[cdo] 01/84: upstream 1.5.9

Alastair McKinstry mckinstry at moszumanska.debian.org
Sat Jun 13 16:48:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

mckinstry pushed a commit to branch master
in repository cdo.

commit aa5ffadeee4be50139375fc25de435e830381e4a
Author: Alastair McKinstry <mckinstry at debian.org>
Date:   Sat Dec 29 17:05:15 2012 +0000

    upstream 1.5.9
---
 AUTHORS                                         |     6 +
 COPYING                                         |   280 +
 ChangeLog                                       |  1709 +
 INSTALL                                         |   229 +
 Makefile.am                                     |     8 +
 Makefile.in                                     |   806 +
 NEWS                                            |   581 +
 OPERATORS                                       |   510 +
 README                                          |    73 +
 acinclude.m4                                    |    98 +
 aclocal.m4                                      |  1066 +
 cdo.settings.in                                 |    52 +
 cdo.spec                                        |    62 +
 cdo.spec.in                                     |    62 +
 config/compile                                  |   143 +
 config/config.guess                             |  1502 +
 config/config.sub                               |  1731 +
 config/default                                  |   244 +
 config/depcomp                                  |   630 +
 config/install-sh                               |   524 +
 config/ltmain.sh                                |  8745 +++
 config/missing                                  |   376 +
 config/mkinstalldirs                            |   161 +
 configure                                       | 21977 ++++++++
 configure.ac                                    |   132 +
 contrib/Makefile.am                             |    21 +
 contrib/Makefile.in                             |   448 +
 contrib/cdoCompletion.bash                      |   714 +
 contrib/cdoCompletion.tcsh                      |   714 +
 contrib/cdoCompletion.zsh                       |   714 +
 contrib/makecompl.rb                            |    78 +
 contrib/python/cdo.py                           |   353 +
 doc/cdo.pdf                                     |   Bin 0 -> 1413621 bytes
 doc/cdo_refcard.pdf                             |   Bin 0 -> 94414 bytes
 libcdi/AUTHORS                                  |     1 +
 libcdi/COPYING                                  |   340 +
 libcdi/ChangeLog                                |  1195 +
 libcdi/INSTALL                                  |   229 +
 libcdi/Makefile.am                              |    16 +
 libcdi/Makefile.in                              |   838 +
 libcdi/NEWS                                     |   110 +
 libcdi/README                                   |    56 +
 libcdi/acinclude.m4                             |    20 +
 libcdi/aclocal.m4                               |  1037 +
 libcdi/app/Makefile.am                          |    27 +
 libcdi/app/Makefile.in                          |   646 +
 libcdi/app/cdi.c                                |  1089 +
 libcdi/app/createtable.c                        |   114 +
 libcdi/app/printinfo.h                          |   392 +
 libcdi/cdi.settings.in                          |    59 +
 libcdi/config/compile                           |   143 +
 libcdi/config/config.guess                      |  1502 +
 libcdi/config/config.sub                        |  1731 +
 libcdi/config/default                           |   139 +
 libcdi/config/depcomp                           |   630 +
 libcdi/config/install-sh                        |   524 +
 libcdi/config/interface.rb                      |     7 +
 libcdi/config/ltmain.sh                         |  9656 ++++
 libcdi/config/missing                           |   376 +
 libcdi/config/mkinstalldirs                     |   161 +
 libcdi/configure                                | 30167 ++++++++++
 libcdi/configure.ac                             |   216 +
 libcdi/doc/cdi_cman.pdf                         |   Bin 0 -> 427249 bytes
 libcdi/doc/cdi_fman.pdf                         |   Bin 0 -> 467404 bytes
 libcdi/examples/Makefile.am                     |    37 +
 libcdi/examples/Makefile.in                     |   666 +
 libcdi/examples/cdi_copy.c                      |    74 +
 libcdi/examples/cdi_read.c                      |    54 +
 libcdi/examples/cdi_read_f2003.f90              |    77 +
 libcdi/examples/cdi_write.c                     |    93 +
 libcdi/examples/cdi_write_ens.c                 |   139 +
 libcdi/examples/cdi_write_f2003.f90             |   103 +
 libcdi/examples/pio/Makefile.am                 |    28 +
 libcdi/examples/pio/Makefile.in                 |   621 +
 libcdi/examples/pio/collectData.c               |   184 +
 libcdi/examples/pio/collectData2003.F90         |   176 +
 libcdi/examples/pio/collectDataNStreams.c       |   199 +
 libcdi/examples/pio/compareResourcesArray.c     |   259 +
 libcdi/interfaces/CdiInfo.cpp                   |   140 +
 libcdi/interfaces/Makefile.am                   |   117 +
 libcdi/interfaces/Makefile.in                   |   751 +
 libcdi/interfaces/cdi.cpp                       |   421 +
 libcdi/interfaces/cdi.hpp                       |   110 +
 libcdi/interfaces/cdilib.i                      |     5 +
 libcdi/interfaces/cdiobj.i                      |    19 +
 libcdi/interfaces/python/CdiLib.py              |   462 +
 libcdi/interfaces/python/CdiObj.py              |   929 +
 libcdi/interfaces/python/cdilib_wrap.c          | 13297 +++++
 libcdi/interfaces/python/cdiobj_wrap.cpp        | 29448 ++++++++++
 libcdi/interfaces/python/setup.py               |    17 +
 libcdi/interfaces/python/setupLib.py            |    19 +
 libcdi/interfaces/python/setupObj.py            |    22 +
 libcdi/interfaces/python/table.py               |   128 +
 libcdi/interfaces/python/testLib.py             |     9 +
 libcdi/interfaces/python/testObj.py             |    47 +
 libcdi/interfaces/ruby/cdilib_wrap.c            | 12206 ++++
 libcdi/interfaces/ruby/cdiobj_wrap.cpp          | 33863 +++++++++++
 libcdi/interfaces/ruby/testLib.rb               |    11 +
 libcdi/interfaces/ruby/testObj.rb               |    63 +
 libcdi/m4/acx_assert_lang_is_fortran_variant.m4 |    56 +
 libcdi/m4/acx_lang_other_suffix_conftest.m4     |    64 +
 libcdi/m4/acx_options.m4                        |   385 +
 libcdi/m4/acx_sl_fc_mod_path_flag.m4            |    96 +
 libcdi/m4/acx_sl_mod_suffix.m4                  |   107 +
 libcdi/m4/asx_unset.m4                          |    60 +
 libcdi/m4/ax_pthread.m4                         |   283 +
 libcdi/m4/libtool.m4                            |  7831 +++
 libcdi/m4/ltoptions.m4                          |   369 +
 libcdi/m4/ltsugar.m4                            |   123 +
 libcdi/m4/ltversion.m4                          |    23 +
 libcdi/m4/lt~obsolete.m4                        |    98 +
 libcdi/m4/starlink_fpp.m4                       |   754 +
 libcdi/src/Makefile.am                          |   178 +
 libcdi/src/Makefile.in                          |   910 +
 libcdi/src/basetime.c                           |    32 +
 libcdi/src/basetime.h                           |    24 +
 libcdi/src/binary.c                             |   263 +
 libcdi/src/binary.h                             |    41 +
 libcdi/src/calendar.c                           |   337 +
 libcdi/src/calendar.h                           |    18 +
 libcdi/src/cdf.c                                |   240 +
 libcdi/src/cdf.h                                |    23 +
 libcdi/src/cdf_int.c                            |   810 +
 libcdi/src/cdf_int.h                            |   105 +
 libcdi/src/cdi.h                                |   967 +
 libcdi/src/cdi.inc                              |  2221 +
 libcdi/src/cdiFortran.c                         |   484 +
 libcdi/src/cdi_error.c                          |    42 +
 libcdi/src/cdi_limits.h                         |    17 +
 libcdi/src/cdi_util.c                           |   104 +
 libcdi/src/cdilib.c                             | 65075 ++++++++++++++++++++++
 libcdi/src/cfortran.doc                         |  2049 +
 libcdi/src/cfortran.h                           |  2388 +
 libcdi/src/cgribex.h                            |   246 +
 libcdi/src/cgribexlib.c                         | 10184 ++++
 libcdi/src/config.h.in                          |   196 +
 libcdi/src/datetime.h                           |    15 +
 libcdi/src/dmemory.c                            |   574 +
 libcdi/src/dmemory.h                            |    54 +
 libcdi/src/dtypes.h                             |    57 +
 libcdi/src/error.c                              |    90 +
 libcdi/src/error.h                              |    46 +
 libcdi/src/extra.h                              |    50 +
 libcdi/src/extralib.c                           |   605 +
 libcdi/src/file.c                               |  1421 +
 libcdi/src/file.h                               |    58 +
 libcdi/src/gaussgrid.c                          |   341 +
 libcdi/src/gaussgrid.h                          |    15 +
 libcdi/src/gribapi.c                            |   134 +
 libcdi/src/gribapi.h                            |    57 +
 libcdi/src/grid.c                               |  4845 ++
 libcdi/src/grid.h                               |    97 +
 libcdi/src/ieg.h                                |   103 +
 libcdi/src/ieglib.c                             |   610 +
 libcdi/src/institution.c                        |   420 +
 libcdi/src/institution.h                        |    20 +
 libcdi/src/mo_cdi.f90                           |  3148 ++
 libcdi/src/model.c                              |   355 +
 libcdi/src/model.h                              |    19 +
 libcdi/src/namespace.c                          |   188 +
 libcdi/src/namespace.h                          |    39 +
 libcdi/src/pio.c                                |   206 +
 libcdi/src/pio.h                                |    30 +
 libcdi/src/pio_c_temp.h                         |    25 +
 libcdi/src/pio_comm.c                           |   836 +
 libcdi/src/pio_comm.h                           |    84 +
 libcdi/src/pio_dbuffer.c                        |   172 +
 libcdi/src/pio_impl.h                           |   106 +
 libcdi/src/pio_interface.c                      |   922 +
 libcdi/src/pio_interface.h                      |    26 +
 libcdi/src/pio_list_set.c                       |   158 +
 libcdi/src/pio_mpinonb.c                        |   348 +
 libcdi/src/pio_posixasynch.c                    |   424 +
 libcdi/src/pio_posixfpguardsendrecv.c           |   555 +
 libcdi/src/pio_posixnonb.c                      |   299 +
 libcdi/src/pio_record_send.c                    |   362 +
 libcdi/src/pio_rpc.c                            |   140 +
 libcdi/src/pio_rpc.h                            |    62 +
 libcdi/src/pio_server.c                         |   504 +
 libcdi/src/pio_server.h                         |    25 +
 libcdi/src/pio_util.c                           |   328 +
 libcdi/src/pio_util.h                           |   198 +
 libcdi/src/pkgconfig/cdi.pc.in                  |    48 +
 libcdi/src/resource_handle.c                    |   706 +
 libcdi/src/resource_handle.h                    |    74 +
 libcdi/src/service.h                            |    48 +
 libcdi/src/servicelib.c                         |   606 +
 libcdi/src/stream.c                             |  2347 +
 libcdi/src/stream_cdf.c                         |  7283 +++
 libcdi/src/stream_cdf.h                         |    35 +
 libcdi/src/stream_cgribex.c                     |  2270 +
 libcdi/src/stream_cgribex.h                     |    24 +
 libcdi/src/stream_ext.c                         |  1070 +
 libcdi/src/stream_ext.h                         |    32 +
 libcdi/src/stream_grb.c                         |   740 +
 libcdi/src/stream_grb.h                         |    33 +
 libcdi/src/stream_gribapi.c                     |  3034 +
 libcdi/src/stream_gribapi.h                     |    25 +
 libcdi/src/stream_history.c                     |    79 +
 libcdi/src/stream_ieg.c                         |  1579 +
 libcdi/src/stream_ieg.h                         |    32 +
 libcdi/src/stream_int.c                         |   742 +
 libcdi/src/stream_int.h                         |   336 +
 libcdi/src/stream_record.c                      |   587 +
 libcdi/src/stream_srv.c                         |  1089 +
 libcdi/src/stream_srv.h                         |    32 +
 libcdi/src/stream_var.c                         |   150 +
 libcdi/src/swap.c                               |    67 +
 libcdi/src/swap.h                               |    12 +
 libcdi/src/table.c                              |   994 +
 libcdi/src/table.h                              |  1426 +
 libcdi/src/tablepar.h                           |    26 +
 libcdi/src/taxis.c                              |  1403 +
 libcdi/src/taxis.h                              |    46 +
 libcdi/src/timebase.c                           |   337 +
 libcdi/src/timebase.h                           |    32 +
 libcdi/src/tsteps.c                             |   102 +
 libcdi/src/util.c                               |    63 +
 libcdi/src/varscan.c                            |   941 +
 libcdi/src/varscan.h                            |    43 +
 libcdi/src/version.c                            |    37 +
 libcdi/src/vlist.c                              |  1681 +
 libcdi/src/vlist.h                              |   170 +
 libcdi/src/vlist_att.c                          |   647 +
 libcdi/src/vlist_att.h                          |    37 +
 libcdi/src/vlist_var.c                          |  2173 +
 libcdi/src/vlist_var.h                          |    38 +
 libcdi/src/zaxis.c                              |  1866 +
 libcdi/tests/Makefile.am                        |    23 +
 libcdi/tests/Makefile.in                        |   752 +
 libcdi/tests/cksum.c                            |   125 +
 libcdi/tests/cksum.h                            |    15 +
 libcdi/tests/cksum_read.c                       |    81 +
 libcdi/tests/cksum_write.c                      |   325 +
 libcdi/tests/ensure_array_size.c                |    16 +
 libcdi/tests/ensure_array_size.h                |    21 +
 libcdi/tests/pio_cksum_asynch                   |     9 +
 libcdi/tests/pio_cksum_asynch.in                |     9 +
 libcdi/tests/pio_cksum_fpguard                  |     9 +
 libcdi/tests/pio_cksum_fpguard.in               |     9 +
 libcdi/tests/pio_cksum_mpinonb                  |     9 +
 libcdi/tests/pio_cksum_mpinonb.in               |     9 +
 libcdi/tests/pio_cksum_writer                   |     9 +
 libcdi/tests/pio_cksum_writer.in                |     9 +
 libcdi/tests/pio_write.c                        |   526 +
 libcdi/tests/pio_write_run                      |    13 +
 libcdi/tests/pio_write_run.in                   |    13 +
 libcdi/tests/stream_cksum.c                     |   140 +
 libcdi/tests/stream_cksum.h                     |    13 +
 libcdi/tests/test_cksum_extra                   |    14 +
 libcdi/tests/test_cksum_extra.in                |    14 +
 libcdi/tests/test_cksum_grib                    |    14 +
 libcdi/tests/test_cksum_grib.in                 |    14 +
 libcdi/tests/test_cksum_ieg                     |    14 +
 libcdi/tests/test_cksum_ieg.in                  |    14 +
 libcdi/tests/test_cksum_nc                      |    14 +
 libcdi/tests/test_cksum_nc.in                   |    14 +
 libcdi/tests/test_cksum_nc2                     |    14 +
 libcdi/tests/test_cksum_nc2.in                  |    14 +
 libcdi/tests/test_cksum_nc4                     |    14 +
 libcdi/tests/test_cksum_nc4.in                  |    14 +
 libcdi/tests/test_cksum_service                 |    14 +
 libcdi/tests/test_cksum_service.in              |    14 +
 libcdi/tests/test_grib.c                        |   137 +
 libcdi/tests/test_grib.sh                       |     9 +
 libcdi/tests/var_cksum.c                        |    55 +
 libcdi/tests/var_cksum.h                        |    19 +
 libcdi/util/serialrun.in                        |     5 +
 libcdi/util/sunf95preproc-wrapper               |    76 +
 libcdi/util/sxpreproc-wrapper                   |    59 +
 libcdi/util/xlfpreproc-wrapper                  |    22 +
 m4/acx_options.m4                               |   466 +
 m4/ax_pthread.m4                                |   283 +
 m4/libtool.m4                                   |  7437 +++
 m4/ltoptions.m4                                 |   369 +
 m4/ltsugar.m4                                   |   123 +
 m4/ltversion.m4                                 |    23 +
 m4/lt~obsolete.m4                               |    98 +
 src/._CdoMagicsMapper.h                         |   Bin 0 -> 205 bytes
 src/._Maggraph.c                                |   Bin 0 -> 205 bytes
 src/._Magplot.c                                 |   Bin 0 -> 205 bytes
 src/._Magvector.c                               |   Bin 0 -> 205 bytes
 src/._StringUtilities.c                         |   Bin 0 -> 205 bytes
 src/._StringUtilities.h                         |   Bin 0 -> 205 bytes
 src/._magics_template_parser.c                  |   Bin 0 -> 205 bytes
 src/._results_template_parser.c                 |   Bin 0 -> 205 bytes
 src/._template_parser.c                         |   Bin 0 -> 205 bytes
 src/._template_parser.h                         |   Bin 0 -> 205 bytes
 src/Arith.c                                     |   345 +
 src/Arithc.c                                    |   163 +
 src/Arithdays.c                                 |   173 +
 src/Arithlat.c                                  |   167 +
 src/CDIread.c                                   |   224 +
 src/CDItest.c                                   |   134 +
 src/CDIwrite.c                                  |   306 +
 src/Cat.c                                       |   152 +
 src/CdoMagicsMapper.c                           |   185 +
 src/CdoMagicsMapper.h                           |    12 +
 src/Change.c                                    |   348 +
 src/Change_e5slm.c                              |   192 +
 src/Cloudlayer.c                                |   413 +
 src/Command.c                                   |   389 +
 src/Comp.c                                      |   302 +
 src/Compc.c                                     |   159 +
 src/Complextorect.c                             |   127 +
 src/Cond.c                                      |   224 +
 src/Cond2.c                                     |   234 +
 src/Condc.c                                     |   128 +
 src/Consecstat.c                                |   314 +
 src/Copy.c                                      |   173 +
 src/Deltime.c                                   |   165 +
 src/Derivepar.c                                 |   556 +
 src/Detrend.c                                   |   256 +
 src/Diff.c                                      |   228 +
 src/Duplicate.c                                 |   179 +
 src/EOFs.c                                      |   768 +
 src/EcaIndices.c                                |  1542 +
 src/Echam5ini.c                                 |  1628 +
 src/Enlarge.c                                   |   160 +
 src/Enlargegrid.c                               |   271 +
 src/Ensstat.c                                   |   274 +
 src/Ensstat3.c                                  |   527 +
 src/Ensval.c                                    |   548 +
 src/Eof3d.c                                     |   586 +
 src/Eofcoeff.c                                  |   255 +
 src/Eofcoeff3d.c                                |   271 +
 src/Exprf.c                                     |   279 +
 src/FC.c                                        |   315 +
 src/Filedes.c                                   |   386 +
 src/Fillmiss.c                                  |   238 +
 src/Filter.c                                    |   468 +
 src/Fldrms.c                                    |   160 +
 src/Fldstat.c                                   |   245 +
 src/Fldstat2.c                                  |   226 +
 src/Fourier.c                                   |   239 +
 src/Gather.c                                    |   472 +
 src/Gengrid.c                                   |   165 +
 src/Gradsdes.c                                  |  1262 +
 src/Gridboxstat.c                               |   744 +
 src/Gridcell.c                                  |   330 +
 src/Harmonic.c                                  |   313 +
 src/Hi.c                                        |   209 +
 src/Histogram.c                                 |   241 +
 src/Importamsr.c                                |   292 +
 src/Importbinary.c                              |   589 +
 src/Importcmsaf.c                               |  1665 +
 src/Importobs.c                                 |   277 +
 src/Info.c                                      |   449 +
 src/Input.c                                     |   283 +
 src/Intgrid.c                                   |   466 +
 src/Intgridtraj.c                               |   256 +
 src/Intlevel.c                                  |   435 +
 src/Intlevel3d.c                                |   649 +
 src/Intntime.c                                  |   267 +
 src/Inttime.c                                   |   333 +
 src/Intyear.c                                   |   199 +
 src/Invert.c                                    |   414 +
 src/Invertlev.c                                 |   251 +
 src/Isosurface.c                                |   259 +
 src/Kvl.c                                       |   200 +
 src/Log.c                                       |    73 +
 src/Maggraph.c                                  |  1042 +
 src/Magplot.c                                   |  1159 +
 src/Magvector.c                                 |   506 +
 src/Makefile.am                                 |   319 +
 src/Makefile.in                                 |  4469 ++
 src/Maskbox.c                                   |   513 +
 src/Mastrfu.c                                   |   190 +
 src/Math.c                                      |   216 +
 src/Merge.c                                     |   278 +
 src/Mergegrid.c                                 |   295 +
 src/Mergetime.c                                 |   229 +
 src/Merstat.c                                   |   189 +
 src/Monarith.c                                  |   195 +
 src/Mrotuv.c                                    |   442 +
 src/Mrotuvb.c                                   |   518 +
 src/Ninfo.c                                     |   157 +
 src/Nmltest.c                                   |    57 +
 src/Output.c                                    |   442 +
 src/Outputgmt.c                                 |  1230 +
 src/Pinfo.c                                     |   203 +
 src/Pressure.c                                  |   452 +
 src/Regres.c                                    |   216 +
 src/Remap.c                                     |  1063 +
 src/Remapeta.c                                  |   870 +
 src/Replace.c                                   |   270 +
 src/Replacevalues.c                             |   193 +
 src/Rhopot.c                                    |   352 +
 src/Rotuv.c                                     |   304 +
 src/Runpctl.c                                   |   246 +
 src/Runstat.c                                   |   499 +
 src/SSOpar.c                                    |  1017 +
 src/Scatter.c                                   |   307 +
 src/Seascount.c                                 |   233 +
 src/Seaspctl.c                                  |   283 +
 src/Seasstat.c                                  |   381 +
 src/Selbox.c                                    |  1002 +
 src/Select.c                                    |   845 +
 src/Seloperator.c                               |   156 +
 src/Selrec.c                                    |   115 +
 src/Seltime.c                                   |   677 +
 src/Selvar.c                                    |   460 +
 src/Set.c                                       |   209 +
 src/Setbox.c                                    |   294 +
 src/Setgatt.c                                   |   152 +
 src/Setgrid.c                                   |   390 +
 src/Sethalo.c                                   |   614 +
 src/Setmiss.c                                   |   229 +
 src/Setpartab.c                                 |   753 +
 src/Setrcaname.c                                |   164 +
 src/Settime.c                                   |   487 +
 src/Setzaxis.c                                  |   119 +
 src/Showinfo.c                                  |   291 +
 src/Sinfo.c                                     |   357 +
 src/Smooth9.c                                   |   312 +
 src/Sort.c                                      |   243 +
 src/Sorttimestamp.c                             |   232 +
 src/Specinfo.c                                  |   493 +
 src/Spectral.c                                  |   310 +
 src/Spectrum.c                                  |   408 +
 src/Split.c                                     |   516 +
 src/Splitrec.c                                  |   125 +
 src/Splitsel.c                                  |   280 +
 src/Splittime.c                                 |   284 +
 src/Splityear.c                                 |   152 +
 src/StringUtilities.c                           |   110 +
 src/StringUtilities.h                           |    19 +
 src/Subtrend.c                                  |   176 +
 src/Tee.c                                       |   110 +
 src/Templates.c                                 |   156 +
 src/Test.c                                      |   160 +
 src/Tests.c                                     |   177 +
 src/Timcount.c                                  |   208 +
 src/Timpctl.c                                   |   269 +
 src/Timselpctl.c                                |   289 +
 src/Timselstat.c                                |   375 +
 src/Timsort.c                                   |   209 +
 src/Timstat.c                                   |   459 +
 src/Timstat2.c                                  |   318 +
 src/Timstat3.c                                  |   347 +
 src/Tinfo.c                                     |   499 +
 src/Tocomplex.c                                 |   127 +
 src/Transpose.c                                 |   135 +
 src/Trend.c                                     |   218 +
 src/Trms.c                                      |   295 +
 src/Tstepcount.c                                |   211 +
 src/Vardup.c                                    |   164 +
 src/Vargen.c                                    |   352 +
 src/Varrms.c                                    |   198 +
 src/Vertint.c                                   |   679 +
 src/Vertstat.c                                  |   251 +
 src/Vertwind.c                                  |   297 +
 src/Wct.c                                       |   187 +
 src/Wind.c                                      |   425 +
 src/Writegrid.c                                 |    78 +
 src/Writerandom.c                               |   134 +
 src/YAR.c                                       |   557 +
 src/Ydayarith.c                                 |   187 +
 src/Ydaypctl.c                                  |   291 +
 src/Ydaystat.c                                  |   343 +
 src/Ydrunpctl.c                                 |   381 +
 src/Ydrunstat.c                                 |   560 +
 src/Yhourarith.c                                |   212 +
 src/Yhourstat.c                                 |   360 +
 src/Ymonarith.c                                 |   185 +
 src/Ymonpctl.c                                  |   277 +
 src/Ymonstat.c                                  |   377 +
 src/Yseaspctl.c                                 |   303 +
 src/Yseasstat.c                                 |   378 +
 src/Zonstat.c                                   |   191 +
 src/cdo.c                                       |  1200 +
 src/cdo.h                                       |   139 +
 src/cdo_int.h                                   |   195 +
 src/cdo_pthread.c                               |    67 +
 src/cdo_vlist.c                                 |   258 +
 src/cdotest.c                                   |   541 +
 src/color.c                                     |   429 +
 src/color.h                                     |    32 +
 src/commandline.c                               |    81 +
 src/config.h.in                                 |   226 +
 src/const.h                                     |    33 +
 src/counter.h                                   |    14 +
 src/dmemory.h                                   |    45 +
 src/dtypes.h                                    |    48 +
 src/ecacore.c                                   |  1513 +
 src/ecacore.h                                   |   273 +
 src/ecautil.c                                   |   623 +
 src/ecautil.h                                   |   341 +
 src/error.h                                     |    37 +
 src/etopo.h                                     | 32401 +++++++++++
 src/exception.c                                 |    75 +
 src/expr.c                                      |   920 +
 src/expr.h                                      |   105 +
 src/expr_lex.c                                  |  2069 +
 src/expr_yacc.c                                 |  1928 +
 src/expr_yacc.h                                 |    72 +
 src/field.c                                     |   593 +
 src/field.h                                     |   161 +
 src/field2.c                                    |   673 +
 src/fieldc.c                                    |   150 +
 src/fieldmem.c                                  |    88 +
 src/fieldmer.c                                  |   410 +
 src/fieldzon.c                                  |   464 +
 src/fouriertrans.c                              |  2279 +
 src/functs.h                                    |    61 +
 src/gradsdeslib.c                               |  2281 +
 src/gradsdeslib.h                               |   170 +
 src/grid.c                                      |  1714 +
 src/grid.h                                      |    84 +
 src/grid_gme.c                                  |  1590 +
 src/grid_lcc.c                                  |   332 +
 src/grid_rot.c                                  |   264 +
 src/griddes.c                                   |  1851 +
 src/griddes.h                                   |    72 +
 src/griddes_h5.c                                |   552 +
 src/griddes_nc.c                                |   332 +
 src/hetaeta.c                                   |  1113 +
 src/hetaeta.h                                   |    15 +
 src/history.c                                   |   105 +
 src/institution.c                               |   117 +
 src/interpol.c                                  |  1382 +
 src/interpol.h                                  |     3 +
 src/job.c                                       |   764 +
 src/juldate.c                                   |    68 +
 src/kvlist.c                                    |   427 +
 src/kvlist.h                                    |    32 +
 src/legendre.c                                  |   457 +
 src/list.c                                      |   238 +
 src/list.h                                      |    44 +
 src/magics_template_parser.c                    |   241 +
 src/magics_template_parser.h                    |    15 +
 src/mask.h                                      |  8101 +++
 src/merge_sort2.c                               |   354 +
 src/merge_sort2.h                               |    19 +
 src/modules.c                                   |  1038 +
 src/modules.h                                   |    31 +
 src/namelist.c                                  |   584 +
 src/namelist.h                                  |    74 +
 src/normal.c                                    |    17 +
 src/nth_element.c                               |    71 +
 src/nth_element.h                               |    39 +
 src/operator_help.h                             |  4771 ++
 src/par_io.c                                    |   111 +
 src/par_io.h                                    |    37 +
 src/percentiles.c                               |   426 +
 src/percentiles.h                               |    50 +
 src/pipe.c                                      |   616 +
 src/pipe.h                                      |   107 +
 src/printinfo.h                                 |   383 +
 src/process.c                                   |  1005 +
 src/process.h                                   |    53 +
 src/pstream.c                                   |  1714 +
 src/pstream.h                                   |    67 +
 src/pstream_int.h                               |    26 +
 src/pthread_debug.c                             |   241 +
 src/pthread_debug.h                             |    31 +
 src/readline.c                                  |    40 +
 src/realtime.c                                  |   248 +
 src/remap.h                                     |   186 +
 src/remaplib.c                                  |  6489 +++
 src/remapsort.c                                 |   795 +
 src/results_template_parser.c                   |   121 +
 src/results_template_parser.h                   |    13 +
 src/specspace.c                                 |   689 +
 src/specspace.h                                 |    65 +
 src/statistic.c                                 |  1495 +
 src/statistic.h                                 |    39 +
 src/table.c                                     |    66 +
 src/temp.h                                      | 32401 +++++++++++
 src/template_parser.c                           |   134 +
 src/template_parser.h                           |    22 +
 src/timebase.h                                  |    23 +
 src/timer.c                                     |   340 +
 src/userlog.c                                   |  1018 +
 src/util.c                                      |   368 +
 src/util.h                                      |    44 +
 src/vinterp.c                                   |   427 +
 src/vinterp.h                                   |    32 +
 src/zaxis.c                                     |   485 +
 test/Makefile.am                                |    26 +
 test/Makefile.in                                |   545 +
 test/README                                     |    20 +
 test/testStreams.py                             |    46 +
 test/test_info.py                               |    37 +
 584 files changed, 551944 insertions(+)

diff --git a/AUTHORS b/AUTHORS
new file mode 100644
index 0000000..de45e83
--- /dev/null
+++ b/AUTHORS
@@ -0,0 +1,6 @@
+
+Uwe Schulzweida, Uwe.Schulzweida at zmaw.de, is the main author.
+Ralf Mueller, Ralf.Mueller at zmaw.de
+Luis Kornblueh, Luis.Kornblueh at zmaw.de
+Cedrick Ansorge, Cedrick.Ansorge at zmaw.de
+Ralf Quast, Ralf.Quast at brockmann-consult.de
diff --git a/COPYING b/COPYING
new file mode 100644
index 0000000..5a965fb
--- /dev/null
+++ b/COPYING
@@ -0,0 +1,280 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+

+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+

+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+

+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+

+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
diff --git a/ChangeLog b/ChangeLog
new file mode 100644
index 0000000..3de0b6e
--- /dev/null
+++ b/ChangeLog
@@ -0,0 +1,1709 @@
+2012-12-17 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.5.9
+	* Version 1.5.9 released
+
+2012-12-06 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* PROJ.4: use proj_api.h instead of projects.h
+
+2012-11-27 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gradsdes: use pstreamInqByteorder() [Bug #3041]
+	* zonSTAT: check whether a zonal grid already exists (bug fix)
+
+2012-11-26 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added workaround to combine CDO operators with the result of	mergetime, merge, copy, cat, ens<STAT>
+	* Selbox: extend check for latitude indices
+
+2012-11-21 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* enlarge: added missing value support [request: Chris Fletcher]
+
+2012-11-15 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Split: added parameter swap to swap the position of <obase> and <xxx>  in the filename
+	* splitgrid: bug fix for gridID output in filename <xxx>
+	* splitzaxis: bug fix for zaxisID output in filename <xxx>
+
+2012-11-14 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdo: added option -k <chunktype> to set the chunk type to auto, grid or lines
+	* cdo option -z zip: added optional compression level -z zip[_1-9] [request: Etienne Tourigny]
+
+2012-11-08 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* pipeInqVlist: wait MIN_WAIT_CYCLES if processNumsActive() == 1 (bug fix) [report:  Jaison Ambadan]
+
+2012-11-07 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* bug fix for user defined lon/lat grids
+             This bug was introduced in CDO version 1.5.8.
+
+2012-10-30 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.5.8
+	* Version 1.5.8 released
+
+2012-10-29 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* mastrfu: set datatype to 32-bit float
+
+2012-10-23 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Fldstat: set weight to 1 if gridsize is 1
+
+2012-10-19 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added operator seinfo
+
+2012-10-17 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* eca_rr1: result has wrong long name attribute [Bug #2763]
+	* eca_pd: disabled, use eca_rr1  (same functionallity) [Bug #2763]
+
+2012-10-14 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added operator tee
+
+2012-10-13 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remaplaf: fixed bug in binary_search_int()
+
+2012-10-05 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* use read/write timer only for single threaded CDO version [Support #2854]
+
+2012-10-05 Modali Kameswarrao  <modali.kameswarrao at zmaw.de>
+
+	* Maggraph update
+
+2012-09-25 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* replace: change streamNtsteps() to vlistNtsteps() (bug fix for CDI 1.5.7)
+
+2012-09-13 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added support for netCDF4(HDF5) formatted SCRIP grids
+
+2012-09-07 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Info: changed output format
+	* Diff: changed output format
+
+2012-09-04 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* processDelete: set Process[processID].threadID = 0 (bug fix)
+
+2012-09-03 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added CDO option -L to lock all I/O calls. This option is neccessary if external I/O libraries like 
+	  netCDF4 (HDF5) were installed without thread-safe support.
+
+2012-08-30 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Sinfo: changed output format
+
+2012-08-28 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.5.7 (merged from cdi-pio)
+	* activate pstreamCopyRecord()
+	* Version 1.5.7 released
+
+2012-08-23 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Arith: bug fix for NVARS1 == NVARS2
+                    This bug was introduced in CDO version 1.5.6.
+
+2012-07-26 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.5.6.1 released
+	* arradd: disable SSE2 optimazation (bug in residual loop)
+	    The following statistical functions are affected:
+	        *mean, *avg, *sum, *var, *std
+	    if all of the following conditions are  complied:
+	       - x86_64 machine (tornado, squall, thunder, lizard)
+	       - dataset has no missing values
+	       - the horizontal grid size is > 1 and not multiple of 8
+            This bug was introduced in CDO version 1.5.6.
+
+2012-07-23  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.5.6
+	* Version 1.5.6 released
+
+2012-07-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Fixed bug #2605
+
+2012-07-17  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added operator zonrange
+
+2012-07-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* vlistCompare(): added check to compare sorted parameter names
+
+2012-07-11  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gradsdes: added support for 64-bit SERVICE, EXTRA and IEG format
+	* import_binary: added support for 64-bit floats via extra OPTION keyword flt64 [request: Tim Bruecher]
+
+2012-07-10  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* sort_iter: call to sort_par() only for parent <= (nthreads-1)
+	* added remapsort.c
+
+2012-07-07  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remaplib::sort_add: use optimized version (speedup +20%)
+
+2012-07-03  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* userFileOverwrite: accept also a simple 'y' as yes [request: Dirk Notz]
+
+2012-06-26  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Arith: added support for 3D masks [request: Ralf M�ller]
+	* pipeInqVlist: wait only 1s and check for other active CDO processes
+
+2012-06-25  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Selvar: added check for time constant fields (bug fix) [report: Ralf M�ller]
+	* mastrfu: use grid coordinates from input file
+
+2012-06-21  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* pstreamCheckDatarange: activate check only if ivals > 0
+
+2012-06-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* ymonmean: removed time bounds if present (bug fix) [Bug #2474]
+	* ymonsub: added support for time bounds (bug fix) [Bug #2475]
+
+2012-06-08  Ralf Mueller     <ralf.mueller at zmaw.de>
+
+	* New operator: showunit (Showinfo)
+
+2012-06-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Sinfo: changed Time entry to Ttype
+	* changed timeID to tsteptype
+
+2012-05-31  Luis Kornblueh  <Luis.Kornblueh at zmaw.de>
+
+	* arradd: SSE2 version (performance +15%)
+
+2012-05-29  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Runstat: optimize missing value handling (speedup)
+	* Runstat: OpenMP parallelization over parameter nts
+	* Runstat: added env. RUNSTAT_NOMISS
+
+2012-05-29  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* input: changed time axis to RELATIVE
+
+2012-05-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.5.5
+	* Version 1.5.5 released
+
+2012-05-09  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Ensstat3: nvars undefined (bug fix)
+
+2012-05-08  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remap_bilin: using fabs(src_lats[n]) for distance-weighted average (big fix) [report: Renate Brokopf]
+	* remap_bilic: using fabs(src_lats[n]) for distance-weighted average (big fix)
+
+2012-04-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* grid.c::gridCurvilinearToRegular: bug fix [report: Ag Stevens]
+	* remaplib: changed warning message for bilinear/bicubic interpolation
+
+2012-04-17  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Yseasstat: changed timestamp of DJF season to last timestep of February
+
+2012-04-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* ml2pl: added support for GRIB2 parameter names [Bug #2252]
+
+2012-03-14  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* pipeInqVlist: changed init of time_to_wait [Bug #2133]
+
+2012-03-02  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* replace: removed debug output [report: K. Houchi]
+
+2012-03-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* eca_rr1: missing value not set correctly (bug fix) [report: Hans-Juergen Panitz]
+	* ecacore: fix all missing values
+
+2012-02-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* geopotheight: added support for WMO code table
+
+2012-02-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* New module: Yhourarith (yhouradd, yhoursub, yhourmul, yhourdiv) [request: Beate Gayer]
+
+2012-02-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* mergetime: added env. SKIP_SAME_TIME to skip all double entries of the same timestamp [request: K. Houchi]
+	* Added operator rohpot - potential density for MPIOM (experimental) [request: Helmut Haak]
+
+2012-01-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.5.4
+	* Version 1.5.4 released
+
+2012-01-24  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remapcon: added env REMAP_AREA_MIN, to set the minimum area fraction [request: Gernot Geppert]
+
+2012-01-23  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remaplaf: using binary search (speedup)
+	* Timstepstat: added support for time bounds
+
+2012-01-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remaplib: use grid2_bound_box only for conservativ remapping
+
+2012-01-09  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* setgridtype: added support for grid type lonlat
+
+2012-01-05  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	splitsel: added support for constant fields [Bug #1701]
+	Splittime: added support for constant fields
+
+2011-12-19  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* timpctl: check index of bins (bug fix for NaNs) [report: Christopher Moseley]
+
+2011-12-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* pipeInqVlist: use pthread_cond_timedwait to wait 30 sec (bug fix) [report: Carsten Ehbrecht]
+
+2011-12-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* pstreamCheckDatarange: use nint() to round smin and smax [report: Kristina Fr�hlich]
+
+2011-11-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added operator timcovar - covariance over time
+	* Added operator fldcovar - covariance in grid space
+
+2011-10-26  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* shifttime: added support for time bounds
+	* setvrange: don't set the attribute valid_range
+
+2011-10-25  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added operator mod - modulo [request: Swantje Preuschmann]
+
+2011-10-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.5.3
+	* Version 1.5.3 released
+
+2011-10-19  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Monarith (monadd, monsub, monmul, mondiv): wrong results for 3D variables (bug fix) [report: Chris Fletcher]
+
+2011-10-02  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * deflate compression with netCDF4 doesn't work (bug fix) [report: Geert Jan van Oldenborgh]
+
+2011-09-26  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added operator: muldoy - Multiply with day of year [request: David Gobbett]
+
+2011-09-19  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* eca_cdd, eca_cwd, eca_rr1, eca_sdii: variable parameter [request: Martin Stendel]
+
+2011-09-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gridarea: bug fix for coarse grid cells with lons between 350 and 0 degrees [report: Aiko Voigt]
+
+2011-09-14  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* sellonlatbox: correct lon bounds if necessary (bug fix) [report: Klaus Keuler]
+
+2011-08-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* ifthenelse: uses only the first time step of the first input file (bug fix) [report: Ronny Petrik]
+
+2011-08-22  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.5.2
+	* Version 1.5.2 released
+
+2011-08-19  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* ymon<stat>: preserve time axis attributes (big fix) [report: Martin Juckes]
+
+2011-08-12  Cedrick Ansorge  <Cedrick.Ansorge at zmaw.de>
+
+        * eof, eoftime, eofspatial, eof3d - Empirical Orthogonal Functions:bug fix [report: Eileen Dahms and Frank Lunkeit]
+            There was a bug in the calculation of the Frobenius norm, which has only been triggered in some cases
+            when using a low precision. The normalization has been changed thus that the eigenvectors are not weighted
+            and their absolute is 1. The default settings for convergence have been changed to be more conservative:
+            CDO_SVD_MODE=jacobi    MAX_JACOBI_ITER=12     FNORM_PRECISION=1.e-12
+
+2011-08-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* setgridtype: compress GME grids [request: Jaison Ambadan]
+
+2011-08-11  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * remapeta: Changed minimum pressure level for condensation from 1000Pa to 0Pa [request: Patrick Joeckel]
+                           Use env. REMAPETA_PTOP to set the minimum pressure level for condensation.
+
+2011-08-09  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* dv2uv: added support for GRIB2 parameter names (d, vo)
+
+2011-08-04  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* expr: wrong result for expression 'const-var (e.g. 1-var)' (bug fix) [report: Hans-J�rgen Panitz]
+	           This bug was introduced in CDO version 1.5.1
+
+2011-08-04  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* invertlat: bug fix for CURVILINEAR grids [report: Christine Rademacher]
+	* import_binary: added support for OPTION ZREV (bug fix) [report: Rene Hommel]
+
+2011-08-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* histAddValue: added check for rounding errors
+
+2011-07-26  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* replace: added support to replace single levels
+	* Vertstat: bug fix for streams with time invariant variables
+
+2011-07-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.5.1
+	* Version 1.5.1 released
+
+2011-07-11  Ralf Mueller  <ralf.mueller at zmaw.de>
+
+	* Added operator stdatm: standard atmosphere values for T,PS
+	* Added operator intlevel3d: vertical interpolation to/from 3d vertical coordinates
+
+2011-07-04  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Exprf:  wrong result for missing values != (double) -9.e33 (bug fix) [report: Michael Boettinger]
+
+2011-07-02  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* detrend: added support for time bounds (bug fix) [report: Andy Aschwanden]
+
+2011-07-01  Cedrick.Ansorge <Cedrick.Ansorge at zmaw.de>
+
+	* Filter: added support for time bounds (bug fix) [report: Andy Aschwanden]
+
+2011-06-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* setgridtype: convert curvilinear to unstructured grids [request: Steffen Tietsche]
+
+2011-05-25  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Remap: added env REMAP_THRESHHOLD to set the threshhold for coordinate transformation
+
+2011-05-04  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* import_binary: Added support for 1 and 2 byte integer [code from: Karsten ???]
+
+2011-05-03  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * bug fix: fldmean and similar operators fail with 1D grid (1 latitude value) [report: Etienne Tourigny]
+
+2011-04-27  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added support for netCDF4 classic format; option -f nc4c
+	* eca*: use the input calendar for the output streams (bug fix) [report: Martin Juckes]
+
+2011-04-04  Uwe Schulzweida  <Uwe.Schulzweda at zmaw.de>
+
+	* intyear: check contents of input files [report: Angelika Heil]
+	* pipeDefTimestep: set EOP if nrecs = 0 (dead lock) [report: Luis Kornnblueh]
+
+2011-03-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* eofspatial: integer overflow; wrong result for grid size > 46340 (bug fix) [report: Hans-J�rgen Panitz]
+	* outputkeys: added keys xind, yind [request: Nils Fischer]
+
+2011-03-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.5.0
+	* Version 1.5.0 released
+
+2011-03-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added operator chparam -  Change parameter identifier
+
+2011-03-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added operator setparam - Set parameter identifiers
+	* Added operator splitparam - Split parameter identifiers
+
+2011-03-11  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added operator selparam - Select parameters by identifier
+	* Added operator delparam - Delete parameters by identifier
+	* sinfo: changed output of table and code number to parameter identifier
+	* info:  changed output of code number to parameter identifier
+	* diff:  changed output of code number to parameter identifier
+
+2011-03-09  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* setgrid: added parameter: dereference
+	* cdo: added option -O to overwrite existing output file [request: Chris Fletscher]
+
+2011-03-08  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* fldmean: check range of lon/lat bounds [report: Jonas Bhend]
+	* ml2pl: wrong result if input file contains full and half level data (bug fix) [report: Jaison Ambadan]
+
+2011-03-07  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gridToCell(GME): set X/Y units to degrees_east/degrees_north [report: Patrick Brockmann]
+
+2011-03-05  Uwe Schulzweida  <Uwe.Schulzweida at zma  int nvars;
+w.de>
+
+	* expr: added functions abs(), int(), nint(), sqr()
+
+2011-02-25  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remapbil: fix pole problem with gr15_psi grids [report: Karoline Block]
+
+2011-02-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* renamed function var to expr_var [report: Jed Kaplan]
+
+2011-01-25  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* splitcode: added support for code numbers > 999
+
+2011-01-21  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * changed grid name GRID_CELL to GRID_UNSTRUCTURED
+
+2011-01-18  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* spcut: only correct results with continuous wave numbers starting at 1 (bug fix)
+
+2011-01-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remaplib: fix data race in calculation of bin_addr (OpenMP)
+
+2011-01-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* detrend: integer overflow; wrong result for nts > 46340 (bug fix) [report: Torsten Seifert]
+
+2011-01-11  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* sellonlatbox: does not work as expected (bug fix) [report: Jonathan Schubert]
+
+2011-01-10  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added operator delete - Delete fields
+	* sellonlatbox: cellidx was not initialized (bug fix) [report: Jaison Ambadan]
+
+2011-01-07  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remaplib: Changed remap weights from 2D to 1D array
+
+2011-01-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.4.7
+	* Version 1.4.7 released
+
+2011-01-05  Frank Kaspar <Frank.Kaspar at dwd.de>
+
+	* import_cmsaf: set max length of date string to 8 (bug fix)
+
+2011-01-05  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* import_cmsaf: added time information also for time constant fields [request: Frank Kaspar]
+
+2010-12-17  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* eofcoeff: set size of eof_name to 6 (bug fix)
+
+2010-12-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* import_binary: check for gauss grids only when flag linear=0
+
+2010-12-14  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* readline: filter carriage return '\r' [report: Christian Steger]
+
+2010-12-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* setclonlatbox: bug fix for 1x1 grids [report: Angelika Heil]
+
+2010-12-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Settime: bug fix for time independent variables in combination with other operators (pipes)
+
+2010-11-22  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* mulcoslat: added support for GME grids [request: Jaison-Thomas Ambadan]
+
+2010-11-19  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* select: added paramter *ltype* [request: Jaison-Thomas Ambadan]
+
+2010-11-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added operator eca_pd - Precipitation days index per time period [request: Barbara Hennemuth]
+
+2010-11-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* sellonlatbox: fix rounding error of the last lon index [report: Mondher Chekki]
+
+2010-11-10  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* ml2pl: open output stream after all error checks
+
+2010-11-08  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* sethalo: added support for grid units radian
+	* sethalo: correct lower bound of grid bounds for negative halos (bug fix)
+	* fldmean: gives wrong result for grid units radian (bug fix) [report: Pilar Ripodas]
+
+2010-10-21  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Yseasstat: bug fix for datasets with time constant fields [report: Ute Merkel]
+
+2010-10-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added docu for operator dv2ps
+
+2010-10-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Cat: call vlistCompare for all input files
+
+2010-09-29  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added env. CDO_FILE_SUFFIX to set the file suffix of CDO generated file names
+
+2010-09-27  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Fldstat2: replaced macros FDIV and FSQRT by function calls DIV and SQRT
+	
+2010-09-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* New module: Ydayarith (ydayadd, ydaysub, ydaymul, ydaydiv)
+
+2010-09-17  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.4.6
+	* Version 1.4.6 released
+
+2010-09-07 Ralf Mueller <ralf.mueller at zmaw.de>
+
+	* using libtool for linking (rpath)
+	* include libcdi as subproject
+	* eca_gsl: adjust implementation to fit definition by ECA [report: Stefan Fronzek]
+	* eca_gsl: make useable in pipes (bug fix) [report: Stefan Fronzek]
+
+2010-08-26  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* sellevel: copy zaxis meta data name and units (bug fix) [report: Don Murray]
+	
+2010-08-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * pstreamDefTimestep: removed call to streamSync (very slow on GPFS)
+
+2010-08-05  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* changed percentile parameter type from integer to float [request: Nikolaus Groll]
+	
+2010-08-03  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* changed predefined gaussian grid names from t<RES>grid to n<N>
+	
+2010-08-02  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added grid mask support
+	
+2010-07-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* sellonlatbox: fix rounding error of the last lon index [report: Flore Mounier]
+	
+2010-07-22  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Module Expr: added missing value support [request: Marco van Hulten]
+
+2010-07-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gridFromNCfile: check grid_dims
+	* seldate: open output file only when time steps found (bug fix) [report: Hannes Reuter]
+
+2010-07-12  Cedrick Ansorge <Cedrick.Ansorge at zmaw.de>
+
+	* Added module Filter - Time series filtering
+
+2010-07-05  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.4.5.1 released
+
+2010-07-05 Edi Kirk <E.Kirk at gmx.de>
+
+	* GRIB1 decode: Correct ZeroShiftError of simple packed spherical harmonics
+
+2010-06-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* bug fix for wrong result of SZIP compressed GRIB records with 24 bit 
+	  packing and a compression ratio < 1.05 [report: Aiko Voigt]
+
+2010-06-28  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.4.5 released
+
+2010-06-17  Etienne Tourigny <tourigny at sca.uqam.ca>
+
+	* Added operator setvals - Set list of old values to new values
+
+2010-05-18  Cedrick Ansorge <Cedrick.Ansorge at zmaw.de>
+
+	* Added operator eof - Calculate EOFs in spatial or time space
+        * Added operator eoftime - Calculate EOFs in time space
+        * Added operator eofspatial - Calculate EOFs in spatial space
+	* Added operator eofcoeff - Principal coefficients of EOFs
+
+2010-05-17  Ralf Mueller  <Ralf.Mueller at zmaw.de>
+
+	* Added operator consecsum - Consecutive Sum
+	* Added operator consects - Consecutive Timesteps
+
+2010-04-29  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.4.4
+	* Version 1.4.4 released
+
+2010-04-19  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * fldsum: change result from 0 to missval, if only missing values found [report: Angelika Heil]
+	* intyear: set the interpolation result always to missval, if missing values found [report: Angelika Heil]
+
+2010-04-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added operator delday
+
+2010-04-09  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added support for time units 3hours and 6hours [request: Jaison-Thomas Ambadan]
+	
+2010-04-07  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Remap: bypass variables with gridtype generic and only one gridpoint
+
+2010-04-04  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* selgrid: change gridID to grididx (bug fix)
+	* Added operator cloudlayer: compute low, mid and high clouds [request: Daniel Klocke]
+
+2010-04-01  Martin Claus  <mclaus at ifm-geomar.de>
+
+	* vertwind: added missing value support
+	
+2010-03-25  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* standard deviation (bug fix): change the result from missval to zero, if variance is zero [report: Jaison-Thomas Ambadan]
+
+2010-03-23  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added operator tstepcount: count number of timesteps (experimental) [request: Swantje Preuschmann]
+
+2010-03-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* import_binary: added support for variables with different number of levels [report: Dennis Shea]
+
+2010-03-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* sellonlatbox: bug fix for parameter lon2 [report: Alberto Maurizi]
+	* random: added optional parameter seed
+
+2010-03-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* pstreamWriteRecord: check pstreamptr->varlist (bug fix) [report: Kevin Sieck]
+	* added operator fldcor to correlate two fields
+	
+2010-03-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added predefined grid t<RES>zon
+	
+2010-03-11  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* expr: added support for const/var (bug fix) [report: Youmin Chen]
+	
+2010-03-10  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added support for netCDF time bounds (bug fix) [report: Beate Geyer]
+
+2010-03-07  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Released module Gridboxstat
+	
+2010-03-03  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* inputsrv: added level information (bug fix) [report: Simon Blessing]
+
+2010-02-22  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.4.3
+	* changed GRIB1 default packing type of spherical harmonics to complex
+	* added CDO option -M to indicate that the I/O streams have missing values
+	* Version 1.4.3 released
+
+2010-02-08  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.4.2
+	* Added new module Gridboxstat (testversion)
+	* Version 1.4.2 released
+	
+2010-02-02  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* netCDF+packed data: check that all values are inside the valid range
+	
+2010-02-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remove netCDF offset/scalefactor if option -b 32 is set
+	
+2010-01-28  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Ensstat: don't overwrite existing files
+
+2010-01-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Zonstat: added support for generic grids
+	* Merstat: added support for generic grids
+
+2010-01-14  Frank Kaspar <Frank.Kaspar at dwd.de>
+
+	* import_cmsaf: added more corrections for wrong projection parameter
+
+2010-01-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* replace: added support for time constant fields [request: Wei Wei]
+	
+2010-01-10  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Genweights: use netCDF2 (64bit) for large remap weights files [request: Daniel Goll]
+	
+2010-01-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added module Fourier
+	* Detrend: OpenMP parallelization
+
+2009-12-23  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remapcon, remaplaf: speed up by fast store of links
+
+2009-12-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.4.1 released
+
+2009-12-14  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Vertint: set default table number to 0
+	
+2009-12-10  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Ensstat: change vlistCompare to func_sftn
+	
+2009-11-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* merge, mergetime: don't overwrite existing files
+	
+2009-11-27  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* New operator: splittabnum - Split parameter table numbers
+
+2009-11-19  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* showtime: removed output of date, only print time string hh:mm:ss
+	* convert date and time to string for printing
+
+2009-11-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* New operator: sethalo - Set the left and right bounds of a field
+	* change number of input streams from unlimited to 1 in pipes
+	* rename module Select to Selvar
+	* rename selgridname/selzaxisname to selgrid/selzaxis
+	* added operator vct2
+	* Selvar: abort if no variable is selected
+	
+2009-11-08  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added default zaxis name "surface"
+	
+2009-11-04  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* setgridtype: added parameter regular to convert reduced gaussian grids
+	* gridFromFile: check floating point parameter
+
+2009-11-03  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* remap: bug fix for weights from gennn (set remap_extrapolate = TRUE) [report: Helmut Frank]
+
+2009-11-02  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gridFromNCfile: lock call to nc_open (race condition) [report: Nils Fischer]
+
+2009-10-23  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* outputbounds: added support for meridional data
+	* showtime: added comma to output string (bug fix) [report: Stefan Hagemann]
+
+2009-10-21  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.4.0.1
+	* seltime: bug fix for scanning of input parameter (report: Emanuele Lombardi]
+	* IEG format: bug fix for identification of lonlat grids
+	* GRIB format: bug fix for decoding of missing values (scalar version only)
+	* Version 1.4.0.1 released
+	
+2009-10-07  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdotest:eca_gsl: bug fix [report: Harald Anlauf]
+
+2009-10-05  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.4.0
+	* New operator: import_binary - Import binary data sets via a GrADS data descriptor file
+	* New operator: setvrange - Set valid range [request: J�rg Trentmann]
+	* added support of time units 'seconds' to all operators
+	  - the format of all time parameter changed from hh:mm to hh:mm:ss!
+	* gridarea: added support for hexagonal GME grid and tripolar MPIOM grid
+	* mergegrid: added support for rotated lon/lat grids
+	* Seasstat: added env. CDO_SEASON_START to set the start month of seasons [request: Laurent Mortier]
+	* remapnn: added support for GRID_CELL without bounds (full grid search)
+	* import_cmsaf: read native float datatype and convert it to double
+	* ieg: added support for Gaussian grids [request: Ralf Podzun]
+	* store_link_cnsrv: remove two restrict keywords (bug fix) [report: Clement Alo]
+	* shifttime: bug fix for negative time increments [report: Andreas H�nsler]
+	* Version 1.4.0 released
+
+2009-09-29  Frank Kaspar <Frank.Kaspar at dwd.de>
+
+	* import_cmsaf: Replacing incorrect projection parameters for sinusoidal products
+
+2009-09-18  Ralf Mueller <Ralf.Mueller at zmaw.de>
+
+	* eca_gsl: consideration of different growing season start for northern and southern hemisphere
+
+2009-07-15  Ralf Mueller <Ralf.Mueller at zmaw.de>
+
+	* eca_gsl: bug fix for finalDay in ecacore:eca4 [report: Elke Keup-Thiel]
+
+2009-06-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.3.2
+	* change C compiler to ANSI C99
+	* added option -Q to sort netCDF variable names
+	* added support for the parameter 'angle' to transform rotated coordinates 
+	        to geographic coordinates [request: Beate Mueller]
+	* splitsel: changed the number of output digits from 3 to 6
+	* settaxis: bug fix for time increment 'months' [report: Ute Merkel]
+	* remaplib: change loop counter from int to long
+	* remaplaf: fixed buffer overflow
+	* remapcon: change max_subseg from 1000 to 100000
+	* Remapeta: correct humidity up to highest level *nctop* where condensation is allowed
+	* replace: bug fix for searching of parameter code/name
+	* remapdis, remapnn: set num_srch_bins to 1 if REMAP_EXTRAPOLATE=OFF (bug fix) [report: Hamid Benhocine]
+	* Version 1.3.2 released
+
+2009-04-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+	
+	* using CDI library version 1.3.1
+	* set default calendar to proleptic gregorian
+	* New operator (experimental): select with parameter code, level, param
+	* added support for proleptic gregorian calendar
+	* added support for missval = NaN
+	* added support for GRID type Lambert Conformal Conic
+	* import_cmsaf: read parameter for Lambert Azimuthal Equal Area projection
+	* import_cmsaf: read parameter for Cylindrical Equal Area projection
+	* import_cmsaf: bug fix for datasets with gain/offset and more than 1 timestep
+	* Sinusoidal and Lambert Azimuthal Equal Area grids with units [km]
+	* cdoInitialize: omp_set_num_threads have to be called for every module
+	* expr: add ';' at the end of input expression if missing
+	* added predefined lonlat grid for germany, europe and africa
+	* gridFromName: define GRID with one point lon=<LON>_lat=<LAT>
+	* sellonlatbox: select box from circular curvilinear grids
+	* CDO_PCTL_NBINS: change default number of bins from 100 to 101
+	* change max parameter from 256 to 4096 (bug fix) [report: Nils Fischer]
+	* intlevel: use zaxis attributes from input [report: Carmen Ulmen]
+	* ml2pl: added support for Geopotential Height [request: Katharina Klehmet]
+	* remapbil, remapbic: enable extrapolation with REMAP_EXTRAPOLATE=ON
+	* remapdis, remapnn: disable extrapolation with REMAP_EXTRAPOLATE=OFF
+	* remapcon: eliminate srch_mask (~40% speed up)
+	* remapcon: change bound_box to int type (~25% speed up)
+	* remapcon: optimization of inner loop (~7% speed up)
+	* remaplaf: bug fix for fields with missing values
+	* remapnn: bug fix for distance equal zero
+	* genYbounds: bug fix for non global fields
+	* mermean: bug fix for weights from 'zonmean' (report: Michael Sigmond)
+	* replaced strncpy/strncmp by memcpy/memcmp
+	* remap: read grid corners only if needed
+	* Version 1.3.1 released
+
+2009-04-15  Pier Giuseppe Fogli <fogli at bo.ingv.it>
+
+	* chlevel: fixed bug that happens when the list of oldlev,newlev 
+	           contains the same level more than once
+
+2009-01-16  �lvaro M. Valdebenito <alvaro.valdebenito at met.no>
+
+	* Settime: added "seconds" support to "settunits", "settaxis" and "shifttime"
+
+2009-01-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+	
+	* using CDI library version 1.3.0
+	* New operator: remapcon2 - Second order conservative remapping
+	* New operator: remaplaf - Largest area fraction remapping
+	* New operator: remapnn - Nearest neighbor remapping
+	* New operator: reci - Reciprocal value
+	* added support for GRID type Sinusoidal
+	* added support for GRID type Lambert Azimuthal Equal Area
+	* import_cmsaf: added support for monthly mean diurnal cycle
+	* remap: use gridIsCyclic to check whether lon is cyclic (bug fix)
+	* remap: check grid and weights
+	* remap: set num_srch_bins to nlat/2 (speedup)
+	* sinfo: extent grid description
+	* diff: check variable names
+	* sellonlatbox: bug fix for curvilinear grids
+	* setzaxis: change float to double (bug fix) [report: Pier Giuseppe Fogli]
+	* Arith: added filltype FILL_RECTS [request: Wolfgang Mueller]
+	* inputsrv: use -f format if set (bug fix)
+	* Seasstat: warning message for seasons with less than 3 input time steps
+	* merge: bug fix for usage in pipes [report: �lvaro M. Valdebenito]
+	* remapcon: change max_subseg from 100000 to 1000
+	* remapbil: 2. bug fix for cross_product eq zero
+	* gridWeights: bug fix for areas greater than hemisphere [report: Malte Heinemann]
+	* gridverify: replaced [Cedrick Ansorge]
+	* intlevel: bug fix for datasets with missing values
+	* yseasstd,yseasvar: wrong array index (bug fix) [report: Robert Nicholas]
+	* Version 1.3.0 released
+
+2008-11-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+	
+	* using CDI library version 1.2.1
+	* New operator: import_cmsaf - import CM-SAF files
+	* New operator: gengrid - generate grid [request: Michael Boettinger]
+	* New operator: pow - Power [request: Gil Lizcano]
+	* New operator: tpnhalo (testversion)
+	* Module Timstat: use taxis with bounds from input [request: Beate Geyer]
+	* sellonlatbox: added support for grid units 'radians' [request: Jeff Daily]
+	* sellonlatbox: added support for GRID_CELL [request: Jeff Daily]
+	* Added option '-u' to determinate whether to overwrite existing files [request: David Wang]
+        * copy, cat: concatenate time constant fields
+	* copy, cat: compare input files
+	* zonvar: activation missing (bug fix) [report: Irene Fischer-Bruns]
+	* detrend: change taxisCreate to taxisDuplicate [report: Ute Merkel]
+	* remapdis: added support for GRID_CELL without bounds (full grid search)
+	* remapbil: bug fix for cross_product eq zero
+	* sethalo: bug fix for x/y bounds [report: Helmut Haak]
+	* ifthen:  bug fix for datasets with different missing values [report: Beate Geyer]
+	* runmean: bug fix for datasets with missing values [report: Carmen Ulmen]
+	* namelist: bug fix for wrong input
+	* Version 1.2.1 released
+
+2008-08-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.2.0
+	* added support for netCDF4 classic with deflate option (option -z zip)
+	* Arith: added filltype FILL_FILE [request: Rita Seiffert]
+	* New operator: intlevel - Linear level interpolation
+	* New operator: invertlev - Invert levels [request: Marco Giorgetta]
+	* New operator: sellevidx - Select levels by index [request: David Wang]
+	* New module: Pressure (fpressure, hpressure) [request: Jan Kazir]
+	* New module: Tests (normal, studentt, chisquare, beta, fisher)
+	* New module: Echam5ini (read_e5ml, write_e5ml)
+	* New operator: import_amsr to read AMSR binary files
+	* New operator: vertwind (testversion) [request: Michael Boettinger]
+	* New operator: ml2pl_lp (testversion) [request: Hui Wan]
+	* remapdis: check that distance is inside the range of -1 to 1 [report: Hui Wan]
+	* remapeta: added missing value support
+	* vlistCompare: compare all lon/lat values
+	* setpartab: added parameter LTYPE [request: Stefan Petri]
+	* Settime: change TIME_CONSTANT to TIME_VARIABLE if ntstep = 0
+	* added support of CM-SAF HDF5 grids (test version)
+        * DBL_IS_EQUAL: check NaN with isnan (removed! compilation problems)
+	* yseasmean: bug fix for datasets with missing values [report: Hans-J�rgen Panitz]
+	* yhourmean: bug fix for datasets with missing values
+	* ydaymean: bug fix for datasets with missing values
+	* namelist: bug fix for wrong input
+	* ntime: bug fix for datasets with time constant parameter only [report: David Wang]
+	  (also affected: ndate, nmon, nyear, showdate, showtime, showmon, showyear)
+	* Version 1.2.0 released
+	
+2008-04-08  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.1.1
+	* configure: --with-szlib=<directory>
+	* configure: check stat.st_blksize
+	* New operator: regres (Regression) [request: Wolfgang Mueller]
+	* New module: Gridcell (gridarea, gridweights)
+	* New operator: del29feb to delete the 29. February [request: Etienne Tourigny]
+	* New operator: zaxisdes
+	* Exprf: using MT safe version of bison and flex (bug fix) [report: Claas Teichmann]
+	* Arith: using missval from vlistID1 if ( filltype == FILL_TS && vlistIDx1 != vlistID1 )
+	* Arithc: recalculate number of missing values (bug fix) [report: Holger Goettel]
+	* Vertint: support for data on hybrid half-level
+	* Vertint: support for GME data [request: Luis Kornblueh]
+	* Vertint: bug fix for input with time constant fields
+	* Outputgmt: use grid_mask if present
+	* Input: skip ',' from standard input stream
+	* splitsel: bug fix for multilevel/multivar datasets [report: Heiner Widmann]
+	* remaplib: set luse_grid_corners = TRUE for GRID_CELL (bug fix)
+	* remap_conserv: skip very small regions if num_subseg exceeded limit
+	* remapcon: bug fix for NORMALIZE_OPT 'dest' and 'none'
+	* Seltime: changed value of NOPERATORS (bug fix)
+	* Version 1.1.1 released
+
+2008-01-24  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.1.0
+	* New module: Monarith (monadd, monsub, monmul, mondiv) [request: Daniel Hernandez]
+	* Add support for Lambert grids in GRIB files
+	* Seltime: bug fix for input with time constant fields [report: Claas Teichmann]
+	* Setlevel: bug fix for usage in pipes [report: Claas Teichmann]
+	* Outputbounds: use -ZNaN for missing values [request: Karin Meier-Fleischer]
+	* Outputbounds: add zonal mean [request: Malte Heinemann]
+	* Remap: check for non global grids
+	* Setgatts: improve attribute format
+	* diff: check number of time steps
+	* Timstat: change datetime type from INT64 to char[16]
+	* gridWeights: warning with code number when using constant area weights
+	* Version 1.1.0 released
+
+2007-10-29  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cat: bug fix for large existing output files (>2GB) on 32-bit machines [report: Heinz-Dieter Hollweg]
+	* gradsdes: bug fix for monthly mean data with start day > 28 [report: Renate Brokopf]
+	* expr: change exponent precedence from left to right (bug fix)[report: Claas Teichmann]
+	* Version 1.0.9.1 released
+	
+2007-10-22  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.0.8
+	* New module: yhourstat (yhour -min/-max/-sum/-mean/-avg/-std/-var) [request: Holger Goettel]
+	* New operator: mrotuv [request: Uwe Mikolajewicz]
+	* New operator: varquot2test and meandiff2test [request: Irene Fischer-Bruns]
+	* ymonstat: write original order of timesteps [report: Ileana Blad�]
+	* gradsdes: add GRIB level type to VARS [report: Ben-Jei Tsuang]
+	* sellonlatbox: support for curvilinear grids [request: Hannes Isaak Reuter]
+	* bug fix for cdo option -f format [report: Stephan Lorenz]
+	* runstat: add env RUNSTAT_DATE to set output date [request: Claudia Wunram]
+	* ifthen: bug fix for masks that varies not with time [report: David Wang]
+	* mrotuvb: calculate coordinates from u and v
+	* eca_cdd/eca_cwd: bug fix for name2 [report: James Hoffmann]
+	* cdotest: bug fix in eca_gsl/module.c -> 2 input streams [report: Harald Anlauf]
+        * use always decode_date and encode_date to decode/encode date
+	* splitname: bug fix [report: Daniel Klocke]
+	* remapcon: bug fix reset BABY_STEP to 0.001 [report: Claas Teichmann]
+	* merge: bug fix for all files with constant fields only [report: Jan Keller]
+	* Version 1.0.9 released
+
+2007-07-04  Ralf Quast  <ralf.quast at brockmann-consult.de>
+
+	* Timcount and Seascount: bug fix for missing values
+
+2007-06-27  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.0.7
+	* New operator: remapeta
+	* New operator: tinfo
+        * Renamed chvar, selvar, delvar, showvar, setvar and splitvar
+               to chname, selname, delname, showname, setname and splitname
+        * Renamed nvar to npar and vardes to pardes
+	* Renamed selpctl to timselpctl
+	* Selstat: renamed to Timselstat
+	* Vertint: add support for LM VCT [request: Tanja Stanelle]
+	* Input: bug fix for missing values [report: Thomas Bruns]
+	* Merge: bug fix for files with constant fields only [report: Christian Rodehacke]
+	* expr.ex: bug fix for mixed time constant and variable fields
+	* Ymonstat: bug fix for missing values [report: Ivonne Anders]
+	* remapdis: bug fix if distance is zero
+	* remapcon: bug fix in intersection (s1 >= ZERO) [report: Joerg Wegner]
+	* remapcon: speed up by increasing BABY_STEP from 0.001 to 0.01
+	* interpolate: bug fix for north/south bounds > 90 or < -90 [report: Stefan Hagemann]
+	* gradsdes: bug fix for GRIB files with absolute path [report: Matthias B�chner]
+	* replace ztype2ltype by zaxis2ltype
+	* ltype2ztype: set default zaxis type to ZAXIS_GENERIC
+	* selltype, setltype, chltype: extent to all ltypes [request: Patrick Samuelsson]
+	* Version 1.0.8 released
+
+2007-06-26  Etienne Tourigny  <tourigny at sca.uqam.ca>
+
+	* Add new operator: splitsel
+	* Add new operator: histfreq
+	* Add new operator: setrtoc and setrtoc2
+	* list.c: changes to accept inf and -inf as arguments 
+
+2007-06-07  Cedrick Ansorge  <Cedrick.Ansorge at zmaw.de>
+
+	* New operator: smooth9
+
+2007-05-30  Ralf Quast  <ralf.quast at brockmann-consult.de>
+
+	* New operator: timcount, hourcount, daycount, moncount, yearcount, seascount
+	* Renamed eca_fdns, eca_strwin, eca_strbre, eca_strgal, eca_hurr   
+	       to fdns, strwin, strbre, strgal, hurr
+	
+2007-04-18  Cedrick Ansorge  <Cedrick.Ansorge at zmaw.de>
+
+	* New operator: maskregion
+	
+2007-03-08  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.0.6
+	* Add docu for dv2uvl and uv2dvl
+	* New operator: read_e5ini (test version)
+	* taxisCopyTimestep: bug fix [report: Harald Anlauf]
+	* sinfo: print ltype for GRIB records on GENERIC zaxis
+	* seldate: bug fix [report: Michael Hofst�tter]
+	* fldmax: bug fix if all values < 0 and missvals [report: Karin Meier-Fleischer]
+	* vlistCompare: check grid orientation for func_sft
+	* gradsdes: set time increment to "mo" for monthly means
+	* gradsdes: process only the first 2GB of a GRIB file
+	* Version 1.0.7 released
+
+2007-01-02  Ralf Quast  <ralf.quast at brockmann-consult.de>
+
+	* rename tchill to wct
+	* split eca_strwind into eca_strwin, eca_strbre, eca_strgal and eca_hurr
+
+2006-12-14  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.0.5
+	* New operator: vertvar, timvar, yearvar, monvar, dayvar, hourvar
+	* New operator: runvar, seasvar, selvar, ydayvar, ydrunvar, ymonvar, yseasvar
+	* New operator: dv2uvl, uv2dvl [request: Luis Kornblueh]
+	* New operator: selsmon [request: Claudia Wunram]
+	* eca: Titles update
+	* remap: set norm_opt after read_remap_scrip (bug fix) [report: Andreas Sterl]
+	* cdo: FP_FAST_FMA bug fix [report: Sunpoet]
+	* ecacore: update [Ralf Quast]
+	* Version 1.0.6 released
+
+
+2006-11-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.0.4
+	* New operator: showformat (Showinfo) [request: Helmuth Haak]
+	* remap: initialize links.option (bug fix) [report: Luis Kornblueh]
+	* update date/time conversion from udunits (bug fix) [report: Oliver Krueger]
+	* rotuvb: change coordinates to geographic (bug fix) [report: Klaus Wyser]
+	* Wind.c: define name, longname and units [report: Chiara Cagnazzo]
+	* add env CDO_DISABLE_HISTORY [request: Bj�rge Solli]
+	* add env CDO_DISABLE_FILESUFFIX [request: Heiner Widmann]
+	* add suffix .sz for SZIP compressed files [request: Monika Esch]
+	* input: bug fix
+	* pstreamFindID: check pstreamptr->name before use (bug fix)
+	* operatorInqModID: speed up
+	* Version 1.0.5 released
+
+2006-11-17  Ralf Quast  <ralf.quast at brockmann-consult.de>
+
+	* New module: Tchill (tchill)
+	* New module: Hi (hi)
+	* New module: ECA Indices of Daily Temperature and Precipitation Extremes
+	              (eca_cfd, eca_csu, eca_cwdi, eca_cwfi, eca_etr, eca_fd, 
+	               eca_gsl, eca_hd, eca_hwdi, eca_hwfi, eca_id, eca_su,       
+                       eca_tg10p, eca_tg90p, eca_tn10p, eca_tn90p,    
+                       eca_tr, eca_tx10p, eca_tx90p,    
+                       eca_cdd, eca_cwd, eca_r10mm, eca_r20mm,    
+                       eca_r75p, eca_r75ptot, eca_r90p, eca_r90ptot,  
+                       eca_r95p, eca_r95ptot, eca_r99p, eca_r99ptot,  
+                       eca_rr1, eca_sdii, eca_fdns, eca_strwind)  
+
+2006-11-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* processSelf: lock/unlock NumProcess (bug fix)
+	* pstreamOpenRead: move mutex_unlock after cdoInqHistory
+	* Version 1.0.4 released
+
+2006-11-06  Ralf Quast  <ralf.quast at brockmann-consult.de>
+
+	* New module: Ydrunstat (ydrun -min, -max, -sum, -mean, -avg, -std, -var)
+	* New module: Timpctl (tim-, hour-, day-, mon-, year- pctl)
+	* New module: Selpctl (selpctl)
+	* New module: Runpctl (runpctl)
+	* New module: Seaspctl (seaspctl)
+	* New module: Ydaypctl (ydaypctl)
+	* New module: Ymonpctl (ymonpctl)
+	* New module: Yseaspctl (yseaspctl)
+	* New module: Ydrunpctl (ydrunpctl)
+	* New operator: enspctl (Ensstat)
+	* New operator: fldpctl (Fldstat)
+	* New operator: zonpctl (Zonstat)
+	* New operator: merpctl (Merstat)	
+	
+2006-11-02  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.0.3
+	* New operator: intntime [request: Michael Boettinger]
+	* New operator: mrotuvb [request: Helmuth Haak]
+	* New operator: outputvector [request: Helmuth Haak]
+	* selyear: bug fix for years > 9999 [report: Uwe Mikolajewicz]
+	* inttime: extention for months and years [request: Holger Goettel]
+	* outputcenter: support of zonal and meridional fields
+	* zonavg: bug fix for non gaussian or non lonlat grids
+	* remaplib.sort_add: don't sort if num_links <= 1
+	* remaplib.remap_bi?: check that src_add is valid
+	* Remap: use REMAP_NON_GLOBAL only for gridsize > 1
+	* Version 1.0.3 released
+
+2006-09-18  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.0.2
+	* set alias gradsdes to gradsdes2
+	* rename gradsdes to gradsdes1
+	* New operator: int and nint (Math) [request: Joerg Wegner]
+	* New operator: ydaysum, ymonsum, yseassum [request: Hannes Reuter]
+	* add option -e exp to test DRMAA
+	* add option -z szip to compress GRIB records with SZIP
+	* use DBL_IS_EQUAL to compare floating point
+	* remapbil, remapbic: improvement and speedup for regional lonlat grids
+	* Seltime: print warning message if parameter not found
+	* pstreamDefVlist: unpack netCDF data if datatype = FLT64
+	* Version 1.0.2 released
+
+2006-08-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CDI library version 1.0.1
+	* add option -b to set the number of bits for the output precision
+	* support of 1 to 32 bit GRIB data
+	* set MIN_STACK_SIZE to 64MB
+	* seldate: use parameter - for min and max val
+	* seldate: change date format to YYYY-MM-DDThh:mm [request: Martina Stockhaus]
+	* New operator: selstdname, showstdname [request: Martina Stockhaus]
+	* New operator: setrcaname, seloperator for RCA GRIB datasets [Frida Brantvall]
+	* New operator: selltype, setltype, chltype, showltype [together with Frida Brantvall]
+	* New operator: setpartabv
+	* add new parameter table format
+	* fix problems on cygwin [report: Mark Hadfield]
+	* merge: move vlistDestroy after streamClose [report: Matthias Cuntz]
+	* gradsdes: fix bug for only one record without time [report: Angelika Heil]
+	* gradsdes: fix problem for variable names with - character
+	* namelist update
+	* New module: Setbox [Etienne Tourigny]
+	* history format changed to nco [Etienne Tourigny]
+	* process: set MAX_ARGS from 1024 to 8192
+	* Version 1.0.1 released
+
+2006-06-15  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using CDI library version 1.0.0
+	* New operator: dv2ps (Wind) [request: Luis Kornblueh]
+	* New module: Arithlat (mulcoslat, divcoslat) <- docu missing
+	* setreftime: use taxisDuplicate to copy bounds [report: Ivonne Anders]
+	* Seasstat: bug fix for datasets with only 1 season [report: Simon Blessing]
+	* Vertint: remove special treatment for geopoth
+	* configure: check compiler version
+	* Version 1.0.0 released
+
+2006-05-04  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using CDI library version 0.9.7
+	* New module: Mergetime [request: Stefanie Legutke]
+	* New operator: atan2 (Arith) [request: Tom Hardy]
+	* New operator: abs (Math) [request: Reiner Schnur]
+	* New module: Enlargegrid [request: Tom Hardy] <- docu missing
+	* New module: Input (input inputext inputsrv)
+	* Invert: fix memory release problem [report: Tom Hardy]
+	* setzaxis: set MAX_LINE_LEN from 1024 to 65536 [bug report: Martine Michou]
+	* enlarge: update for zonal and meridional data [request: Wolfgang Mueller]
+	* gradsdes: bug fix for unsorted GRIB data [report: Stefan Bauer]
+	* splitzaxis: generate file name from zaxisID+1 [bug report: Martina Stockhaus]
+	* splitgrid:  generate file name from gridID+1
+	* Vardup: bug fix for missing values
+	* Timsort: bug fix for time constant fields
+	* Mastrfu: set units to [kg/s] [report: Rita Seiffert]
+	* Merstat: call gridWeights only if needed
+	* Vertint: use args2fltlist to read parameter list
+	* Splitrec: change record number from 5 to 6 digits
+	* Math: rename log to ln
+	* Change help info format
+	* Selbox, Maskbox, Mergegrid, Zonstat, Merstat: check number of different grids
+	* extent macro UNCHANGED_RECORD to cdoDefaultDataType and cdoDefaultByteorder
+	* pipeDefRecord, pstreamClose bug fix for seltimestep in pipes
+	* remove module docu from source code
+	* rename default grid name "ni" to "gme"
+	* rename operator intgrid to intgridbil
+	* add option -s for silent mode [request: Martina Stockhaus]
+	* Version 0.9.13 released
+
+2006-03-08  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using CDI library version 0.9.6
+	* New module: Wind (uv2dv, dv2uv) <- docu missing
+	* New module: Histogram (histcount, histsum, histmean) <- docu missing
+	* New operator: sinfop (Sinfo)
+	* Intgrid: missing value support for intgrid
+	* Cat: the output file must not exist anymore
+	* Zonstat: add support for GRID_GENERIC if ny > 1
+	* read_remap_scrip: if GME grid, read GME mask (bug report Luis)
+	* remaplib: change read/write of grid corners (bug fix)
+	* Spectral: rename sp2gp2/gp2sp2 to sp2gpl/gp2spl
+	* namelist: update
+	* Version 0.9.12 released
+	
+2006-02-01  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using CDI library version 0.9.5
+	* use macro DBL_IS_EQUAL to check floating-point equality
+	* use taxisCopyTimestep if posible
+	* New operator: sp2gp2 (Spectral) for ERA40 data
+	* New operator: gp2sp2 (Spectral) for ERA40 data
+	* New operator: replace (Replace)
+	* New operator: specinfo to print info for spectral transformation
+	* New module: Selstat (selmin, selmax, selsum, selmean, selavg, selstd)
+	* New module: Mergegrid (mergegrid) <- docu missing
+	* Runstat: adjust date and time
+	* Merge: duplicate taxis (bug fix)
+	* Vertint: abort for different grids (bug fix)
+	* Gradsdes: set XYHEADER to 644 (bug report: Holger)
+	* Remap: add GME grid support
+	* Remap: use environment variable NORMLIZE_OPT (bug fix)
+	* Cat: set tsID2 to 1 for input files with constant data only
+	* zaxis: add vct support for hybrid levels
+	* remaplib: change max_subseg from 10000 to 100000
+	* Selrec: add IEG support
+	* Version 0.9.11 released
+
+2005-12-14  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using CDI library version 0.9.4
+	* IEG support
+	* New operator: ifthenelse (Cond2)
+	* Timer: option -T
+	* Gradsdes: IEG 32 support
+	* Selbox: add rotated grids
+	* Diff: change date and time format to ISO
+	* Gradsdes: bug fix for lonlat grids from N->S (report: Thibaut Gridel)
+	* Inttime: abort if units is not minutes, hours or days (bug fix)
+	* Settime: add all available calendars
+	* Inttime: add all available calendars
+	* fourier: made ifax and trig local (bug fix)
+	* Version 0.9.10 released
+
+2005-10-18  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using CDI library version 0.9.2
+	* remapcon: replace gridbox_area after remapping
+	* intgrid: init array2 with zero
+	* Timsort: OpenMP version
+	* gradsdes: bug fix for ZDEF
+	* pstream: mt safe
+	* New operator: gradsdes2 (Gradsdes)
+	* New module: Ensstat (ensmin ensmax enssum ensmean ensavg ensstd ensvar)
+	* New operator: remap (Remap)
+	* New operator: gencon (Remap)
+	* New operator: outputf (Output)
+	* New operator: enlarge (Enlarge)
+	* Arith: support of constant species
+	* zaxis: add bounds
+	* Version 0.9.9 released
+	
+2005-07-17  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using CDI library version 0.9.1
+	* Arith:
+            - filling up 1. record or timestep of 1. or 2. stream if needed
+	* New operator: setlevel (Set)
+	* New operator: chlevel, chlevelv, chlevelc (Change)
+	* Inttime: change date and time format to ISO
+	* Cond: bug fix (change taxisID1 to taxisID2)
+	* Condc: bug fix (else if statemants)
+	* Compc: bug fix (else if statemants)
+	* Copy: bug fix (taxisID2)
+	* gridWeights: bug fix for non global gaussian grids
+	* replace args2intarr by args2intlist
+	* replace args2fltarr by args2fltlist
+	* Speedup remap and remapcon on NEC sx6
+	* Speedup spectral transformation (replace phcs by jspleg1)
+	* Version 0.9.8 released
+
+2005-05-26  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using CDI library version 0.9.0
+	* Speedup Remap with masks by saving MAX_REMAPS maps
+	* Speedup remapcon
+	    - remap_conserv (change malloc to realloc)
+	    - store_link_cnsrv (change search loop)
+	* Setmiss: setctomiss with NaN
+	* Info, Sinfo, Showinfo, Settime, Seltime: change date and time format to ISO
+	* New module: Maskbox (masklonlatbox, maskindexbox)
+	* New module: Arithdays (muldpm, divdpm, muldpy, divdpy)
+	* New operator: setcalendar (Settime)
+	* New operator: setgridarea (Setgrid)
+	* New operator: seltabnum (Select)
+	* Cond: bug fix (filling up the first file)
+	* setmissval: bug fix
+	* farstd, farcstd: bug fix (for missing values)
+	* gridWeights: calculate area weights for LONLAT grids
+	* rename Expr.c to Exprf.c
+	* change function cdoOperatorID
+	* field.h: bug fix for MUL with 0
+	* bug fix in all Modules (define timestep)
+	* Version 0.9.7 released
+
+2005-04-03  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using CDI library version 0.8.9
+	* support for rotated grids
+	* New module: Detrend (detrend)
+	* New module: Trend (trend)
+	* New module: Subtrend (subtrend)
+	* New module: Timsort (timsort)
+	* New module: Ydaystat (ydaymin, ydaymax, ydaymean, ydayavg, ydaystd)
+	* New module: Ymonarith (ymonadd, ymonsub, ymonmul, ymondiv)
+	* rename Lm* to Ymon* and Ls* to Yseas*
+	* Splityear: change filename for doubled years
+	* Version 0.9.6 released
+
+2005-02-17  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using CDI library version 0.8.8
+	* bug fix for taxis with remap, copy, setgrid
+	* New operator: shifttime (shift time steps)
+	* changing all integer level to floating point
+	* Vertint: check range of surface pressure
+	* Sinfo: print data type and file type
+	* Invert: extended for curivilinear grids
+	* pstream: add function pstreamInqFiletype
+	* Reduced grids: read/write record if -R is used
+	* Version 0.9.5 released
+	
+2005-01-03  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using CDI library version 0.8.7
+	* New operator: setmissval (set the missing value)
+	* New operator: setpartab (set the parameter table)
+	* Docu for operator infov, sinfov and diffv
+	* Version 0.9.4 released
+
+2004-12-17  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for CDI library version 0.8.6
+	* New operator: gradsdes for GRIB, SERVICE and EXTRA files
+	* Setmiss: float (4 Byte reals) support
+	* Invert: bug fix
+	* Selbox: buf fix (add gridDefNvertex)
+	* grid.c: using grids from other datafile
+	* grid.c: generate grid from PINGO file
+	* fourier.c: multi threaded version of fft_set
+	* configure: checks for pthread and malloc library
+	* Version 0.9.3 released
+
+2004-11-17  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for CDI library version 0.8.5
+	* New module: Seasstat (seasmin, seasmax, seassum, seasmean, seasavg, seasstd)
+	* New module: Lsstat (lsmean, lsavg, lsmin, lsmax, lsstd)
+	* New operator: Selseas
+	* New operator: Splitseas
+	* Seldate: change parameter to start date and optional end date
+	* readline: add parameter max length
+	* grid.c: generate grid from CDI file
+	* remapcon: Bug fix for NORMALIZE_OPT and missing values
+	* pthread_create: check return value
+	* Version 0.9.2 released
+
+2004-10-14  Uwe Schulzweida  <schulzweida at dkrz.de>
+	
+	* changes for CDI library version 0.8.4
+	* use compNlon to compute nlon from nlat
+	* pipeInqTimestep: Bug fix for Timstat in pipes
+	* Select: Print message if isel not found
+	* Timstat: add missing value support
+	* Runstat: add missing value support
+	* Lmstat: add missing value support
+	* Inttime: add missing value support
+	* Intyear: add missing value support
+	* Vertstat: add missing value support
+	* new operator: timmean, yearmean, monmean, daymean, hourmean
+	* new operator: runmean
+	* new operator: lmmean
+	* new operator: vertmean
+	* new operator: map (source code from PINGO)
+	* new operator: setreftime
+	* new operator: selrec
+	* new operator: splityear
+	* netCDF2 support
+	* Version 0.9.1 released
+
+2004-09-08  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for CDI library version 0.8.3
+	* new module: Vertint (ml2pl, ml2hl)
+	* new module: Outputgmt (outputcenter, outputbounds)
+	* new operator: settaxis, settunits
+	* Arith, Cond, Comp:
+		input stream2 can only have 1 record or 1 timestep
+	* Inttime: set ntsteps to 1 if ijulinc = 0
+	* Timstat: set ntsteps to 1 for tim*
+	* seltimestep: set ntsteps to 1 if nsel = 1
+	* replace all streamCopyRecord by streamReadRecord and streamWriteRecord for piping
+	* Version 0.9.0 released
+	
+2004-07-09  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for CDI library version 0.8.2
+	* new module: Remap (remapcon, remapbil, remapbic, remapdis)
+	* new module: Setgatt (setgatt, setgatts)
+	* new module: Sort (sortcode, sortvar, sortlevel)
+	* new module: Writegrid
+	* new module: Vertstat (vertmin, vertmax, vertsum, vertavg, vertstd)
+	* new operator: delcode, delvar
+	* Timstat, Lmstat: use absolute timeaxis for output
+	* bug fix for use alias names in pipeline
+	* sellonlatbox: bug fix for selection out of bounds
+	* new option -v: Print extra details for some operators
+	* new option -R: Convert reduced to regular grid
+	* Version 0.8.9 released
+	
+2004-05-21  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for CDI library version 0.8.1
+	* Timstat, Runstat, Lmstat: extended for variables with TIME_CONSTANT
+	* pipeDefTimestep: compute nrecs for TIME_VARIABLE
+	* Splittime: bug fix for splithour and splitmon
+	* new operator: chvar, setvar
+	* new module: Intyear
+	* Version 0.8.8 released
+
+2004-04-19  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for CDI library version 0.8.0
+	* Arith: new operator (min and max)
+	* Arith: extended for missing values
+	* Arithc: extended for missing values
+	* Selindexbox: extended for curivilinear grids
+	* new module: Fillmiss
+	* new module: Varrms
+	* new module: Fldrms
+	* new module: Setgridtype
+	* bug fix: setmisstoc
+	* bug fix: Change, Set, Settime - change copy to read/write
+	* Version 0.8.7 released
+	
+2004-03-14  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for CDI library version 0.7.9
+	* change format for online help information
+	* new module: Change (chcode)
+	* new module: Set (setcode)
+	* new module: Settime (setdate, settime, setyear, setmon, setday)
+	* new module: Runstat (runmin, runmax, runsum, runavg, runstd)
+	* new module: Merstat (mermin, mermax, mersum, meravg, mermean, mervar, merstd)
+	* new module: Zonstat (zonmin, zonmax, zonsum, zonavg, zonmean, zonvar, zonstd)
+	* new module: Fldstat (fldmin, fldmax, fldsum, fldavg, fldmean, fldvar, fldstd)
+	* new module: Cond  (ifthen,  ifnotthen)
+	* new module: Condc (ifthenc, ifnotthenc)
+	* Select: select float levels instead of integer
+	* Infos: rename infos to sinfo and vinfo to infov
+	* Timstat: bug fix (calculate timerange)
+	* Version 0.8.6 released
+
+2004-01-05  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for CDI library version 0.7.8
+	* New module: Cat (cat)
+	* New module: Selbox (selindexbox, sellonlatbox)
+	* New module: Merge (merge)
+	* New module: Output (output, outputint, outputsrv, outputext)
+	* New module: Genvar (random, const)
+	* New module: Arithconst (addc, subc, mulc, divc)
+	* New module: Math (sqr sqrt exp log log10 sin cos tan asin acos atan)
+	* New module: Ninfo (nyear nmon ndate ntime ncode nvar nlevel)
+	* New module: Showinfo (showyear showmon showdate showtime showcode showvar showlevel)
+	* gridFromName: add default grid name r<LON>x<LAT>
+	* Copy: changed from one to unlimited inputfiles
+	* Split: bug fix for splitcode
+	* Version 0.8.5 released
+
+2003-12-14  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for CDI library version 0.7.7
+	* pipe bug fix
+	* New module: Lmstat (lmean, lmavg, lmmin, lmmax, lmstd)
+	* New module: Splitrec
+	* Version 0.8.4 released
+
+2003-10-29  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for CDI library version 0.7.5
+	* Version 0.8.3 released
+
+2003-10-12  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for CDI library version 0.7.4
+	* changes for CDI library version 0.7.2 (HDF test interface)
+	* New operator: intarea, setctomiss, setmisstoc, setrangetomiss
+	* Version 0.8.2 released
+
+2003-09-22  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* New operator: interpolate (source from PINGO)
+	* Version 0.8.1 released
+
+2003-09-10  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* renamed to CDO (Climate Data Operators)
+	* changes for CDI library version 0.7.0
+	* replace info with vlist
+	* New operator: splithour, splitday, splitmon
+	* Version 0.8.0 released
+
+2003-07-30  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* changes for gdi library version 0.6.0
+	* Info.c: handle missing values
+	* Version 0.7.0 released
+
+2003-06-25  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* gdi library version 0.5.11
+	* New operator: intgridtraj, mastrfu
+	* Version 0.6.4 released
+
+2003-06-23  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* New operator: intgrid, intpoint, inttime
+	* Version 0.6.3 released
+
+2003-06-12  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* gdi library version 0.5.9
+	* grib library version 0.4.5
+	* Version 0.6.2 released
+
+2003-05-17  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* add module Spectral with operator sp2gp, gp2sp and sp2sp
+	* Version 0.6.1 released
+	
+2003-04-06  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* Version 0.6.0 released
diff --git a/INSTALL b/INSTALL
new file mode 100644
index 0000000..a4b3414
--- /dev/null
+++ b/INSTALL
@@ -0,0 +1,229 @@
+Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
+Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+   By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc.  You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the `--target=TYPE' option to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+will cause the specified gcc to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/Makefile.am b/Makefile.am
new file mode 100644
index 0000000..aa417ff
--- /dev/null
+++ b/Makefile.am
@@ -0,0 +1,8 @@
+# Process this file with automake to produce Makefile.in
+SUBDIRS = libcdi src contrib test
+#
+EXTRA_DIST=config/default OPERATORS doc/cdo.pdf doc/cdo_refcard.pdf cdo.spec README
+#
+ACLOCAL_AMFLAGS = -I m4
+#
+CLEANFILES  = `ls *~ 2> /dev/null`
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000..b7a7a94
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,806 @@
+# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/cdo.settings.in \
+	$(srcdir)/cdo.spec.in $(top_srcdir)/configure AUTHORS COPYING \
+	ChangeLog INSTALL NEWS config/compile config/config.guess \
+	config/config.sub config/depcomp config/install-sh \
+	config/ltmain.sh config/missing config/mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES = cdo.spec cdo.settings
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CLDFLAGS = @CLDFLAGS@
+CLIBS = @CLIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
+ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
+ENABLE_EXTRA = @ENABLE_EXTRA@
+ENABLE_GRIB = @ENABLE_GRIB@
+ENABLE_IEG = @ENABLE_IEG@
+ENABLE_SERVICE = @ENABLE_SERVICE@
+EXEEXT = @EXEEXT@
+FCFLAGS = @FCFLAGS@
+FGREP = @FGREP@
+GREP = @GREP@
+GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
+GRIB_API_LIBS = @GRIB_API_LIBS@
+HDF5_INCLUDE = @HDF5_INCLUDE@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_ROOT = @HDF5_ROOT@
+HOST_NAME = @HOST_NAME@
+INCLUDES = @INCLUDES@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JASPER_LIBS = @JASPER_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAGICS_INCLUDE = @MAGICS_INCLUDE@
+MAGICS_LIBS = @MAGICS_LIBS@
+MAGICS_ROOT = @MAGICS_ROOT@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NC_CONFIG = @NC_CONFIG@
+NETCDF_INCLUDE = @NETCDF_INCLUDE@
+NETCDF_LIBS = @NETCDF_LIBS@
+NETCDF_ROOT = @NETCDF_ROOT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PROJ_INCLUDE = @PROJ_INCLUDE@
+PROJ_LDFLAGS = @PROJ_LDFLAGS@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYSTEM_TYPE = @SYSTEM_TYPE@
+SZLIB_INCLUDE = @SZLIB_INCLUDE@
+SZLIB_LIBS = @SZLIB_LIBS@
+THREADS_INCLUDE = @THREADS_INCLUDE@
+THREADS_LIBS = @THREADS_LIBS@
+UDUNITS_INCLUDE = @UDUNITS_INCLUDE@
+UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@
+USER_NAME = @USER_NAME@
+VERSION = @VERSION@
+XML2_LIBS = @XML2_LIBS@
+ZLIB_INCLUDE = @ZLIB_INCLUDE@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+# Process this file with automake to produce Makefile.in
+SUBDIRS = libcdi src contrib test
+#
+EXTRA_DIST = config/default OPERATORS doc/cdo.pdf doc/cdo_refcard.pdf cdo.spec README
+#
+ACLOCAL_AMFLAGS = -I m4
+#
+CLEANFILES = `ls *~ 2> /dev/null`
+all: all-recursive
+
+.SUFFIXES:
+am--refresh: Makefile
+	@:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+cdo.spec: $(top_builddir)/config.status $(srcdir)/cdo.spec.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+cdo.settings: $(top_builddir)/config.status $(srcdir)/cdo.settings.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool config.lt
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	test -d "$(distdir)" || mkdir "$(distdir)"
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -755 \
+		-exec chmod u+rwx,go+rx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+	$(am__remove_distdir)
+
+dist-lzma: distdir
+	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+	$(am__remove_distdir)
+
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lzma*) \
+	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+	  && cd "$$am__cwd" \
+	  || exit 1
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+	@test -n '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: trying to run $@ with an empty' \
+	       '$$(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	$(am__cd) '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+	install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am am--refresh check check-am clean clean-generic \
+	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
+	dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
+	dist-zip distcheck distclean distclean-generic \
+	distclean-libtool distclean-tags distcleancheck distdir \
+	distuninstallcheck dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/NEWS b/NEWS
new file mode 100644
index 0000000..e353b54
--- /dev/null
+++ b/NEWS
@@ -0,0 +1,581 @@
+CDO NEWS
+--------
+Version 1.5.9 (17 December 2012):
+
+   New features:
+     * cdo option -z zip: added optional compression level -z zip[_1-9]
+     * cdo: added option -k <chunktype> to set the chunk type to auto, grid or lines
+     * Added workaround to combine CDO operators with the result of mergetime, merge, copy, cat, ens<STAT>
+       - use one input parameter with wildcards in single quotes, e.g.: 'ifile?_*' 
+   Changed operators:
+     * enlarge: added missing value support
+   Fixed bugs:
+     * gradsdes: failed
+     * sellevel: loosing level bounds
+     * wrong result for user defined lonlat grids with xfirst < 0
+       (This bug was introduced in CDO version 1.5.8)
+
+Version 1.5.8 (30 October 2012):
+
+   New features:
+     * Added support for netCDF4(HDF5) formatted SCRIP grid description files
+     * added CDO option -L to lock all I/O calls. This option is neccessary if external I/O libraries like 
+       netCDF4 (HDF5) were installed without thread-safe support.
+   New operators:
+     * setunit: Set variable unit
+     * chunit:  Change variable unit
+   Changed operators:
+     * Info:  changed output format
+     * Sinfo: changed output format
+     * Diff:  changed output format
+   Fixed bugs:
+     * remaplaf: fixed bug in binary_search_int()
+     * eca_rr1: result has wrong long name attribute
+
+Version 1.5.6.1 (26 July 2012):
+
+   Fixed bugs:
+     * Wrong results with the following statistical functions:
+         *mean, *avg, *sum, *var, *std
+       only if all of the following conditions are complied:
+         - x86_64 machine (tornado, squall, thunder, lizard)
+         - dataset has no missing values
+         - the horizontal grid size is > 1 and not multiple of 8
+       This bug was introduced in CDO version 1.5.6.
+
+Version 1.5.6 (23 July 2012):
+
+   New features:
+     * Runstat: OpenMP parallelization over parameter nts
+     * import_binary: added support for 64-bit floats via extra OPTION keyword flt64 
+   New operators:
+     * showunit: show unit of a parameter
+   Changed operators:
+     * Arith: added support for 3D masks
+     * mastrfu: use grid coordinates from input file
+   Fixed bugs:
+     * ymonsub: added support for time bounds
+     * Wrong netCDF output for unscaled uint8, int8, int16, int32 variables [Bug #2516]
+
+Version 1.5.5 (15 May 2012):
+
+   New operators:
+     * yhouradd, yhoursub, yhourmul, yhourdiv: Multi-year hourly arithmetic
+   Fixed bugs:
+     * ECA operators: wrong result if missing value is not the default missing value (-9e33)
+     * ml2pl: added support for GRIB2 parameter names
+     * replace: removed debug output 
+
+Version 1.5.4 (30 January 2012):
+
+   New features:
+     * setgridtype: added parameter lonlat to convert curvilinear to regular lon/lat grids
+     * remapcon: added env REMAP_AREA_MIN, to set the minimum area fraction
+   New operators:
+     * timcovar: covariance over time
+     * fldcovar: covariance in grid space
+   Fixed bugs:
+     * splitsel: added support for constant fields [Bug #1701]
+     * combination of selection commands (e.g. selmon -selyear) do not terminate, if no result found [Bug #1640]
+
+Version 1.5.3 (20 October 2011):
+
+   New features:
+     * Variable input parameter for ECA operators: eca_cdd, eca_cwd, eca_rr1, eca_sdii
+   Fixed bugs:
+     * deflate compression with netCDF4 doesn't work (option: -z zip)
+     * sellonlatbox: correct lon bounds if necessary
+     * ifthen, ifthenelse: uses only the first time step of the first input file
+     * module Monarith (monadd, monsub, monmul, mondiv): wrong result for 3D variables
+
+Version 1.5.2 (22 August 2011):
+
+   New features:
+     * replace: added support to replace single levels
+   Changed operators:
+     * remapeta: Changed minimum pressure level for condensation from 1000Pa to 0Pa.
+                 Use the environment variable REMAPETA_PTOP to set the minimum pressure level for condensation. 
+                 Above this level the humidity is set to the constant 1.E-6.
+   Fixed bugs:
+     * invertlat: bug fix for CURVILINEAR grids
+     * ymon<stat>: preserve time axis attributes (type and calendar)
+     * import_binary: added support for OPTION ZREV
+     * expr/exprf: wrong result for expression 'constant-field' and 'constant/field' (e.g. 1-field)
+                   This bug was introduced in CDO version 1.5.1.
+     * eof, eoftime, eofspatial, eof3d - Empirical Orthogonal Functions: 
+            There was a bug in the calculation of the Frobenius norm, which has only been triggered in some cases
+            when using a low precision. The normalization has been changed thus that the eigenvectors are not weighted 
+            and their absolute is 1. The default settings for convergence have been changed to be more conservative:
+            CDO_SVD_MODE=jacobi    MAX_JACOBI_ITER=12   FNORM_PRECISION=1.e-12
+
+Version 1.5.1 (12 July 2011):
+
+   New features:
+     * Added support for netCDF4 classic format; option -f nc4c
+     * import_binary: Added support for 1 and 2 byte integer
+   New operators:
+     * intlevel3d: vertical interpolation to/from 3d vertical coordinates
+     * ensrkhistspace: Ranked Histogram averaged over time
+     * ensrkhisttime:  Ranked Histogram averaged over space
+     * ensroc:  Ensemble Receiver Operating characteristics
+     * enscrps: Ensemble CRPS and decomposition
+     * ensbrs:  Ensemble Brier score
+   Fixed bugs:
+     * Exprf: wrong result for missing values != (double) -9.e33
+     * detrend: added support for time bounds
+     * Filter: added support for time bounds
+     * eofspatial: integer overflow; wrong result for grid size > 46340
+     * eca_*: use the input calendar for the output streams
+
+Version 1.5.0 (15 March 2011):
+
+   New features:
+     * GRIB2 support via ECMWF GRIB_API
+     * Added support for netCDF level bounds
+     * Added option -O to overwrite existing output file (only for ens<STAT>, merge, mergetime)
+   New operators:
+     * selparam: Select parameters by identifier
+     * delparam: Delete parameters by identifier
+     * splitparam: Split parameter identifiers
+     * chparam: Change parameter identifier
+   Changed operators:
+     * expr: added functions abs(), int(), nint(), sqr()
+     * sinfo: changed output of table and code number to parameter identifier
+     * info:  changed output of code number to parameter identifier
+     * diff:  changed output of code number to parameter identifier
+   Fixed bugs:
+     * sellonlatbox: does not work as expected when selecting all longitudes
+     * sellonlatbox: initialization missing for unstructured grids
+     * ml2pl and ml2hl: wrong result if input file contains full *and* half level data
+     * trend and detrend: integer overflow; wrong result for ntimesteps > 46340
+     * spcut: only correct results with continuous wave numbers starting at 1
+     * remaplib: fixed data race in calculation of bin_addr (OpenMP)
+
+Version 1.4.7 (06 January 2011):
+
+   New features:
+     * improved support for netCDF output from WRF model (import time and grid variables)
+   New operators:
+     * ydayadd, ydaysub, ydaymul, ydaydiv: Multi-year daily arithmetic
+     * eca_pd: Precipitation days index per time period
+     * dv2ps: Divergence and vorticity to velocity potential and stream function
+   Changed operators:
+     * import_cmsaf: added time information also for time constant fields
+   Fixed bugs:
+     * eof: fix memory access violation
+     * eofcoeff: fix memory access violation
+     * fldmean: gives wrong result for grid units [radian]
+     * Yseasstat: bug fix for datasets with time constant fields
+     * sellevel: fix problem with hybrid model levels and netCDF output
+     * sellonlatbox: fix rounding error of the last lon index
+     * Settime: bug fix for time independent variables in combination with other operators (pipes)
+
+Version 1.4.6 (17 September 2010):
+
+   New features:
+     * Using libtool for linking (rpath)
+     * Changed predefined gaussian grid names from t<RES>grid to n<N>
+       Use n80 instead of t106grid to define a Gaussian N80 grid
+     * Changed percentile parameter type from integer to float
+   New operators:
+     * bandpass: Bandpass filtering
+     * lowpass:  Lowpass filtering
+     * highpass: Highpass filtering
+   Changed operators:
+     * eca_gsl: adjust implementation to fit definition by ECA
+     * expr, exprf: added missing values support
+   Fixed bugs:
+     * sellevel: copy zaxis meta data name and units
+     * seldate: open output file only when time steps found
+     * sellonlatbox: fix rounding error of the last lon index
+
+Version 1.4.5.1 (05 July 2010):
+
+   New features:
+     * GRIB1 decode: Correct ZeroShiftError of simple packed spherical harmonics
+   Fixed bugs:
+     * wrong result of SZIP compressed GRIB1 records with 24 bit packing and a compression ratio < 1.05 
+
+Version 1.4.5 (28 June 2010):
+
+   New operators:
+     * eof: Calculate EOFs in spatial or time space
+     * eoftime: Calculate EOFs in time space
+     * eofspatial: Calculate EOFs in spatial space
+     * eofcoeff: Principal coefficients of EOFs
+     * consecsum: Consecutive Sum
+     * consects: Consecutive Timesteps
+     * setvals: Set list of old values to new values
+
+Version 1.4.4 (29 April 2010):
+
+   New operators:
+
+     * fldcor: correlation in grid space
+     * timcor: correlation over time
+     * gridbox<stat>: computes statistical values over surrounding grid boxes
+
+   Changed operators:
+
+     * import_binary: added support for variables with different number of levels
+     * random: added optional parameter 'seed'
+
+   Fixed bugs:
+
+     * standard deviation: changed the result from missval to zero, if variance is zero
+     * fldsum: change result from 0 to missval, if only missing values found
+     * intyear: set the interpolation result always to missval, if missing values found
+     * Added support for netCDF time bounds
+     * sellonlatbox: parameter lon2 was not inclusiv
+     * expr: added support for calculations of const/var
+     * setday: writes sometimes wrong date information with GRIB result from afterburner
+     * inputsrv: added level information
+     * merge: added support to merge levels with datasets in netCDF format
+
+Version 1.4.3 (22 February 2010):
+
+   * New features:
+      o using CDI library version 1.4.3
+        improved GRIB1 support and performance
+      o changed GRIB1 default packing type of spherical harmonics to complex
+
+Version 1.4.2 (8 February 2010):
+
+   * Changed operators:
+      o remapcon, remaplaf: speed up by fast store of links
+      o replace: added support for time constant fields
+      o module Genweights: use netCDF2 (64bit) for large remap weights files
+      o module Zonstat, Merstat: added support for generic grids
+      o module Ensstat: don't overwrite existing files
+      o import_cmsaf: added more corrections for wrong projection parameter
+
+Version 1.4.1 (15 December 2009):
+
+   * New features:
+      o using CDI library version 1.4.1
+        improved GRIB and netCDF support and performance
+   * New operators:
+      o splittabnum - Split parameter table numbers
+      o sethalo - Set the left and right bounds of a field
+   * Changed operators:
+      o merge, mergetime: don't overwrite existing files
+      o showtime: removed output of date, only print time string hh:mm:ss
+   * Fixed bugs:
+      o remap: bug fix for weights from gennn (set remap_extrapolate = TRUE)
+
+Version 1.4.0.1 (21 October 2009):
+
+   * Fixed bugs:
+      o seltime: bug fix for scanning of input parameter
+      o IEG format: bug fix for identification of lonlat grids
+      o GRIB format: bug fix for decoding of missing values (scalar version only)
+
+Version 1.4.0 (5 October 2009):
+
+   * New features:
+      o added support of time units 'seconds' to all operators
+   * New operators:
+      o Import binary data sets (via a GrADS data descriptor file) - import_binary
+      o Set valid range - setvrange
+   * Changed operators:
+      o gridarea: added support for hexagonal GME grid and tripolar MPIOM grid
+      o remapnn: added support for unstructured grids without bounds (full grid search)
+      o Seasstat: added env. CDO_SEASON_START to set the start month of seasons
+      o ieg format: added support for Gaussian grids
+   * Fixed bugs:
+      o shifttime: bug fix for negative time increments
+      o import_cmsaf: read native float datatype
+
+Version 1.3.2 (15 June 2009):
+
+   * New features:
+      o Changed compiler to ANSI C99
+      o Added option -Q to sort netCDF variable names
+   * Changed operators:
+      o splitsel: changed the number of output digits from 3 to 6
+      o remapeta: correct humidity up to highest level *nctop* where condensation is allowed
+      o remapcon: change max_subseg from 1000 to 100000
+   * Fixed bugs:
+      o settaxis: bug fix for time increment 'months'
+      o remaplaf: fixed buffer overflow
+      o remapdis, remapnn: set num_srch_bins to 1 if REMAP_EXTRAPOLATE=OFF
+
+Version 1.3.1 (16 April 2009):
+
+   * New features:
+      o The default calendar is now set to "proleptic gregorian".
+        To use a standard calendar set the environment variable CDI_CALENDAR=standard.
+      o Added support for Lambert Conformal Conic projections
+      o Added support for missval = NaN
+   * Changed operators:
+      o ml2pl: added support for Geopotential Height
+      o Settime: added "seconds" support to operator "settunits", "settaxis" and "shifttime"
+      o percentile: change default number of bins from 100 to 101
+   * Fixed bugs:
+      o import_cmsaf: bug fix for datasets with gain/offset and more than 1 timestep
+      o remaplaf: bug fix for fields with missing values
+      o remapnn: bug fix for distance equal zero
+      o mermean: bug fix for weights from 'zonmean' (cdo mermean -zonmean)
+      o chlevel: fixed bug that happens when the list of oldlev,newlev 
+                 contains the same level more than once
+
+Version 1.3.0 (15 January 2009):
+
+   * New features:
+      o add support for Sinusoidal and Lambert Azimuthal Equal Area projections
+   * New operators:
+      o Second order conservative remapping - remapcon2
+      o Nearest neighbor remapping - remapnn
+      o Largest area fraction remapping - remaplaf
+      o Reciprocal value - reci
+   * Changed operators:
+      o import_cmsaf: add support for monthly mean diurnal cycle
+      o remap: set num_srch_bins to nlat/2 (speedup)
+   * Fixed bugs:
+      o setzaxis: changed datatype from float to double
+      o sellonlatbox: bug fix for curvilinear grids
+      o merge: bug fix for usage in CDO pipes
+      o gridarea, gridweights: bug fix for gridboxes with delta lon >= 180 degree
+      o intlevel: bug fix for datasets with missing values
+      o yseasstd, yseasvar: fixed wrong array index
+
+Version 1.2.1 (13 November 2008):
+
+   * New features:
+      o Option '-u' to determinate whether to overwrite existing files
+   * New operators:
+      o Import CM-SAF files - import_cmsaf
+      o Mathematical function 'power' - pow
+   * Changed operators:
+      o sellonlatbox: add support for grid type 'CELL' and units 'radians'
+      o remapdis: add support for grid type 'CELL' without bounds (full grid search)
+      o Timstat: use time axis with bounds from input
+      o copy, cat: concatenate time constant fields
+   * Fixed bugs:
+      o zonvar: activation was missing
+      o ifthen:  bug fix for datasets with different missing values
+      o runmean: bug fix for datasets with missing values
+
+Version 1.2.0 (13 August 2008):
+
+   * New features:
+      o add support for netCDF4 classic with deflate (option -z zip)
+   * New operators:
+      o Linear level interpolation - intlevel
+      o Invert levels - invertlev
+      o Select levels by index - sellevidx
+      o Import AMSR binary files - import_amsr
+   * Changed operators:
+      o remapeta: add missing value support
+   * Fixed bugs:
+      o Operator yseasmean, yhourmean and ydaymean: bug fix for datasets with missing values
+      o Module Ninfo and Showinfo: bug fix for datasets with time constant parameter only
+        Affected operators: ndate, nmon, nyear, showdate, showtime, showmon, showyear
+
+Version 1.1.1 (8 April 2008):
+
+   * New features:
+      o Module Vertint: add support for GME data
+
+   * New operators:
+      o Regression - regres
+      o Grid cell area/weights - gridarea, gridweights
+      o Z-axis description - zaxisdes
+
+   * Fixed bugs:
+      o Module Exprf: using MT safe version of bison and flex
+      o Module Vertint: bug fix for input with time constant fields
+      o Module Arithc: recalculate number of missing values
+      o Operator splitsel: bug fix for multilevel/multivar datasets
+
+Version 1.1.0 (25 January 2008):
+
+   * New features:
+      o Support for Lambert conformal grids in GRIB format
+      o Improved support for netCDF attributes
+
+   * New operators:
+      o Monthly arithmetic - monadd, monsub, monmul, mondiv
+
+   * Fixed bugs:
+      o Operator setlevel and chlevel: bug fix for usage in pipes
+      o Operator cat: bug fix for large existing output files (>2GB) on 32-bit machines
+      o Operator gradsdes: bug fix for monthly mean data with start day > 28
+      o Operator expr: change exponent precedence from left to right
+
+Version 1.0.9 (22 October 2007):
+
+   * New operators:
+      o Multi-year hourly statistical values
+         - yhourmin, yhourmax, yhoursum, yhourmean, yhouravg, yhourstd, yhourvar
+   * Changed operators:
+      o ymonstat: write original order of timesteps
+      o gradsdes: add GRIB level type to VARS
+   * Fixed bugs:
+      o Operator ifthen: bug fix for masks that varies not with time
+
+
+Version 1.0.8 (27 June 2007):
+
+   * New operators:
+      o Remap vertical hybrid level - remapeta
+      o 9 point smoothing - smooth9
+      o Mask region - maskregion
+      o Split selected time steps - splitsel
+      o Set range to constant - setrtoc, setrtoc2
+      o Histogram - histcount, histsum, histmean, histfreq
+      o Show GRIB level types - showltype
+      o Select GRIB level types - selltype
+      o Set GRIB level type - setltype
+   * Changed operators:
+      o Renamed chvar, selvar, delvar, showvar, setvar and splitvar
+             to chname, selname, delname, showname, setname and splitname
+      o Renamed selmin, selmax, selsum, selmean, selavg, selvar, selstd
+             to timselmin, timselmax, timselsum, timselmean, timselavg, timselvar, timselstd
+      o Renamed selpctl to timselpctl
+      o Renamed nvar to npar and vardes to pardes
+   * Fixed bugs:
+      o Module Ymonstat gave wrong results with missing values
+        Affected operators: ymonmean, ymonstd, ymonvar
+      o Library ieglib has had a memory leak for IEG output
+
+Version 1.0.7 (8 March 2007):
+
+   * New operators:
+      o Divergence and vorticity to U and V wind (linear) - dv2uvl
+      o U and V wind to divergence and vorticity (linear) - uv2dvl
+      o Select single month - selsmon
+   * Changed operators:
+      o tchill is renamed to wct
+      o eca_strwind is split into eca_strwin, eca_strbre, eca_strgal and eca_hurr
+   * Fixed bugs:
+      o fldmax has had wrong results if the field has
+        missing values and all other values are less than zero.
+
+Version 1.0.6 (12 December 2006):
+
+   * New operators:
+      o Variance for all statistic modules
+         - vertvar, timvar, yearvar, monvar, dayvar, hourvar,
+           runvar, seasvar, selvar, ydayvar, ydrunvar, ymonvar, yseasvar
+
+Developer version 1.0.5 (30 November 2006):
+
+  * New operators:
+      o Show file format - showformat 
+      o Windchill temperature - tchill
+      o Humidity index - hi
+      o ECA Indices of Daily Temperature and Precipitation Extremes
+        - eca_* (37 different indices!)
+
+Developer version 1.0.4 (7 November 2006):
+
+  * New operators:
+      o Multi-year daily running statistical values
+         - ydrunmin, ydrunmax, ydrunsum, ydrunmean, ydrunavg, ydrunstd
+      o Percentile values for different time ranges
+         - timpctl, hourpctl, daypctl, monpctl, yearpctl, selpctl, runpctl, seaspctl
+      o Multi-year percentile values
+         - ydaypctl, ymonpctl, yseaspctl, ydrunpctl
+      o Ensemble and field percentiles
+         - enspctl, fldpctl, zonpctl, merpctl
+
+Developer version 1.0.3 (3 November 2006):
+
+  * New operators:
+      o Time interpolation - intntime 
+      o Backward transformation of velocity components U and V from MPIOM - mrotuvb
+
+Version 1.0.2 (18 September 2006):
+
+  * Rename operator gradsdes to gradsdes1 and set the alias gradsdes to gradsdes2
+  * Remapping of rotated lonlat grids with remapbi* and genbi* has been changed at the bounds.
+    Generated interpolation weights with older CDO versions can't be used anymore and must
+    be recalculated with genbi*.
+  * New operators:
+      o ydaysum - Multi-year daily sum
+      o ymonsum - Multi-year monthly sum
+      o yseassum - Multi-year seasonally sum
+      o int - Convert to integer value
+      o nint - Convert to nearest integer value
+
+Version 1.0.1 (1 August 2006):
+
+  * New CDO option '-b' to set the number of bits for the output precision
+  * New operators:
+      o selstdname - Select standard names
+      o showstdname - Show standard names
+      o setclonlatbox - Set a longitude/latitude box to constant [Etienne Tourigny]
+      o setcindexbox - Set an index box to constant
+
+Version 1.0.0 (15 June 2006):
+
+  * New operators:
+      o dv2ps - Divergence and vorticity to velocity potential and stream function
+
+Version 0.9.13 (4 May 2006):
+
+  * New operators:
+      o mergetime - Merge datasets sorted by date and time
+      o input, inputext, inputsrv - ASCII input
+      o abs - Absolute value
+      o atan2 - Arc tangent of two fields
+
+Version 0.9.12 (6 March 2006):
+
+  * New operators:
+      o uv2dv, dv2uv - Wind transformation
+
+Version 0.9.11 (1 Februar 2006):
+
+  * Support of GME grids
+  * New operators:
+      o selmin, selmax, selsum, selmean, selavg, selstd - Time range statistic
+      o sp2gpl, gp2spl - Spectral transformation of TL-Model data (e.g. ERA40)
+      o replace - Replace variables
+
+Version 0.9.10 (19 December 2005):
+
+  * Support of REMO IEG format
+  * New operators:
+      o ifthenelse - IF ifile1 THEN ifile2 ELSE ifile3
+
+Version 0.9.9 (19 October 2005):
+
+  * New operators:
+      o ensmin, ensmax, enssum, ensmean, ensavg, ensstd, ensvar - Ensemble statistic
+      o gradsdes2 - Creates a GrADS data descriptor file with a portable GrADS map
+      o enlarge - Enlarge all fields to a user given grid
+      o gencon - Generate conservative interpolation weights
+      o remap - Remapping with the interpolation weights from a netCDF file 
+
+Version 0.9.8 (19 July 2005):
+
+  * New operators:
+      o setlevel - Set level
+      o chlevel - Change level 
+      o chlevelc - Change level of one code
+      o chlevelv - Change level of one variable
+
+Version 0.9.7 (26 May 2005):
+
+  * New operators:
+      o setcalendar - Set calendar
+      o masklonlatbox - Mask lon/lat box
+      o maskindexbox - Mask index box
+      o muldpm - Multiply with days per month
+      o divdpm - Divide with days per month
+ 
+
+Version 0.9.6 (4 April 2005):
+
+  * Support of rotated regular grids.
+  * New operator:
+      o detrend - Linear detrending of time series. 
+
+Version 0.9.4 (3 Jan 2005):
+ 
+  * Support of PINGO grid description files. 
+  * New operator: 
+      o gradsdes - Creates a GrADS data descriptor file.
+                   Supported file formats are GRIB, SERVICE and EXTRA. 
diff --git a/OPERATORS b/OPERATORS
new file mode 100644
index 0000000..2dba242
--- /dev/null
+++ b/OPERATORS
@@ -0,0 +1,510 @@
+===========================
+CDO  Climate Data Operators
+===========================
+
+Operator catalog:
+
+-------------------------------------------------------------
+   Information
+-------------------------------------------------------------
+   Info          info            Dataset information listed by parameter identifier
+   Info          infon           Dataset information listed by parameter name
+   Info          map             Dataset information and simple map
+   Sinfo         sinfo           Short information listed by parameter identifier
+   Sinfo         sinfon          Short information listed by parameter name
+   Diff          diff            Compare two datasets listed by parameter id
+   Diff          diffn           Compare two datasets listed by parameter name
+   Ninfo         npar            Number of parameters
+   Ninfo         nlevel          Number of levels
+   Ninfo         nyear           Number of years
+   Ninfo         nmon            Number of months
+   Ninfo         ndate           Number of dates
+   Ninfo         ntime           Number of timesteps
+   Showinfo      showformat      Show file format
+   Showinfo      showcode        Show code numbers
+   Showinfo      showname        Show variable names
+   Showinfo      showstdname     Show standard names
+   Showinfo      showlevel       Show levels
+   Showinfo      showltype       Show GRIB level types
+   Showinfo      showyear        Show years
+   Showinfo      showmon         Show months
+   Showinfo      showdate        Show date information
+   Showinfo      showtime        Show time information
+   Showinfo      showtimestamp   Show timestamp
+   Filedes       pardes          Parameter description
+   Filedes       griddes         Grid description
+   Filedes       zaxisdes        Z-axis description
+   Filedes       vct             Vertical coordinate table
+-------------------------------------------------------------
+   File operations
+-------------------------------------------------------------
+   Copy          copy            Copy datasets
+   Copy          cat             Concatenate datasets
+   Replace       replace         Replace variables
+   Merge         merge           Merge datasets with different fields
+   Merge         mergetime       Merge datasets sorted by date and time
+   Split         splitcode       Split code numbers
+   Split         splitparam      Split parammeter identifiers
+   Split         splitname       Split variable names
+   Split         splitlevel      Split levels
+   Split         splitgrid       Split grids
+   Split         splitzaxis      Split z-axes
+   Split         splittabnum     Split parameter table numbers
+   Splittime     splithour       Split hours
+   Splittime     splitday        Split days
+   Splittime     splitmon        Split months
+   Splittime     splitseas       Split seasons
+   Splittime     splityear       Split years
+   Splitsel      splitsel        Split time selection
+-------------------------------------------------------------
+   Selection
+-------------------------------------------------------------
+   Selvar        selparam        Select parameters by identifier
+   Selvar        delparam        Delete parameters by identifier
+   Selvar        selcode         Select parameters by code number
+   Selvar        delcode         Delete parameters by code number
+   Selvar        selname         Select parameters by name
+   Selvar        delname         Delete parameters by name
+   Selvar        selstdname      Select parameters by standard name
+   Selvar        sellevel        Select levels
+   Selvar        sellevidx       Select levels by index
+   Selvar        selgrid         Select grids
+   Selvar        selzaxis        Select z-axes
+   Selvar        selltype        Select GRIB level types
+   Selvar        seltabnum       Select parameter table numbers
+   Seltime       seltimestep     Select timesteps
+   Seltime       seltime         Select times
+   Seltime       selhour         Select hours
+   Seltime       selday          Select days
+   Seltime       selmon          Select months
+   Seltime       selyear         Select years
+   Seltime       selseas         Select seasons
+   Seltime       seldate         Select dates
+   Seltime       selsmon         Select single month
+   Selbox        sellonlatbox    Select a longitude/latitude box
+   Selbox        selindexbox     Select an index box
+-------------------------------------------------------------
+   Conditional selection
+-------------------------------------------------------------
+   Cond          ifthen          If then
+   Cond          ifnotthen       If not then
+   Cond2         ifthenelse      If then else
+   Condc         ifthenc         If then constant
+   Condc         ifnotthenc      If not then constant
+-------------------------------------------------------------
+   Comparison
+-------------------------------------------------------------
+   Comp          eq              Equal
+   Comp          ne              Not equal
+   Comp          le              Less equal
+   Comp          lt              Less than
+   Comp          ge              Greater equal
+   Comp          gt              Greater than
+   Compc         eqc             Equal constant
+   Compc         nec             Not equal constant
+   Compc         lec             Less equal constant
+   Compc         ltc             Less than constant
+   Compc         gec             Greater equal constant
+   Compc         gtc             Greater than constant
+-------------------------------------------------------------
+   Modification
+-------------------------------------------------------------
+   Set           setpartab       Set parameter table
+   Set           setcode         Set code number
+   Set           setparam        Set parameter identifier
+   Set           setname         Set variable name
+   Set           setunit         Set variable unit
+   Set           setlevel        Set level
+   Set           setltype        Set GRIB level type
+   Settime       setdate         Set date
+   Settime       settime         Set time of the day
+   Settime       setday          Set day
+   Settime       setmon          Set month
+   Settime       setyear         Set year
+   Settime       settunits       Set time units
+   Settime       settaxis        Set time axis
+   Settime       setreftime      Set reference time
+   Settime       setcalendar     Set calendar
+   Settime       shifttime       Shift timesteps
+   Change        chcode          Change code number
+   Change        chparam         Change parameter identifier
+   Change        chname          Change variable name
+   Change        chunit          Change variable unit
+   Change        chlevel         Change level
+   Change        chlevelc        Change level of one code
+   Change        chlevelv        Change level of one variable
+   Setgrid       setgrid         Set grid
+   Setgrid       setgridtype     Set grid type
+   Setgrid       setgridarea     Set grid cell area
+   Setzaxis      setzaxis        Set z-axis
+   Setgatt       setgatt         Set global attribute
+   Setgatt       setgatts        Set global attributes
+   Invert        invertlat       Invert latitudes
+   Invertlev     invertlev       Invert levels
+   Maskregion    maskregion      Mask regions
+   Maskbox       masklonlatbox   Mask a longitude/latitude box
+   Maskbox       maskindexbox    Mask an index box
+   Setbox        setclonlatbox   Set a longitude/latitude box to constant
+   Setbox        setcindexbox    Set an index box to constant
+   Enlarge       enlarge         Enlarge fields
+   Setmiss       setmissval      Set a new missing value
+   Setmiss       setctomiss      Set constant to missing value
+   Setmiss       setmisstoc      Set missing value to constant
+   Setmiss       setrtomiss      Set range to missing value
+   Setmiss       setvrange       Set valid range
+-------------------------------------------------------------
+   Arithmetic
+-------------------------------------------------------------
+   Exprf         expr            Evaluate expressions
+   Exprf         exprf           Evaluate expressions from script file
+   Math          abs             Absolute value
+   Math          int             Integer value
+   Math          nint            Nearest integer value
+   Math          pow             Power
+   Math          sqr             Square
+   Math          sqrt            Square root
+   Math          exp             Exponential
+   Math          ln              Natural logarithm
+   Math          log10           Base 10 logarithm
+   Math          sin             Sine
+   Math          cos             Cosine
+   Math          tan             Tangent
+   Math          asin            Arc sine
+   Math          acos            Arc cosine
+   Math          reci            Reciprocal value
+   Arithc        addc            Add a constant
+   Arithc        subc            Subtract a constant
+   Arithc        mulc            Multiply with a constant
+   Arithc        divc            Divide by a constant
+   Arith         add             Add two fields
+   Arith         sub             Subtract two fields
+   Arith         mul             Multiply two fields
+   Arith         div             Divide two fields
+   Arith         min             Minimum of two fields
+   Arith         max             Maximum of two fields
+   Arith         atan2           Arc tangent of two fields
+   Monarith      monadd          Add monthly time series
+   Monarith      monsub          Subtract monthly time series
+   Monarith      monmul          Multiply monthly time series
+   Monarith      mondiv          Divide monthly time series
+   Ymonarith     ymonadd         Add multi-year monthly time series
+   Ymonarith     ymonsub         Subtract multi-year monthly time series
+   Ymonarith     ymonmul         Multiply multi-year monthly time series
+   Ymonarith     ymondiv         Divide multi-year monthly time series
+   Ydayarith     ydayadd         Add multi-year daily time series
+   Ydayarith     ydaysub         Subtract multi-year daily time series
+   Ydayarith     ydaymul         Multiply multi-year daily time series
+   Ydayarith     ydaydiv         Divide multi-year daily time series
+   Yhourarith    yhouradd        Add multi-year hourly time series
+   Yhourarith    yhoursub        Subtract multi-year hourly time series
+   Yhourarith    yhourmul        Multiply multi-year hourly time series
+   Yhourarith    yhourdiv        Divide multi-year hourly time series
+   Arithdays     muldpm          Multiply with days per month
+   Arithdays     divdpm          Divide by days per month
+   Arithdays     muldpy          Multiply with days per year
+   Arithdays     divdpy          Divide by days per year
+-------------------------------------------------------------
+   Statistical values
+-------------------------------------------------------------
+   Consecstat    consecsum       Consecutive Sum
+   Consecstat    consects        Consecutive Timesteps
+   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
+   Ensstat2      ensrkhistspace  Ranked Histogram averaged over time
+   Ensstat2      ensrkhisttime   Ranked Histogram averaged over space
+   Ensstat2      ensroc          Ensemble Receiver Operating characteristics
+   Ensval        enscrps         Ensemble CRPS and decomposition
+   Ensval        ensbrs          Ensemble Brier score
+   Fldstat       fldmin          Field minimum
+   Fldstat       fldmax          Field maximum
+   Fldstat       fldsum          Field sum
+   Fldstat       fldmean         Field mean
+   Fldstat       fldavg          Field average
+   Fldstat       fldvar          Field variance
+   Fldstat       fldstd          Field standard deviation
+   Fldstat       fldpctl         Field percentiles
+   Zonstat       zonmin          Zonal minimum
+   Zonstat       zonmax          Zonal maximum
+   Zonstat       zonsum          Zonal sum
+   Zonstat       zonmean         Zonal mean
+   Zonstat       zonavg          Zonal average
+   Zonstat       zonvar          Zonal variance
+   Zonstat       zonstd          Zonal standard deviation
+   Zonstat       zonpctl         Zonal percentiles
+   Merstat       mermin          Meridional minimum
+   Merstat       mermax          Meridional maximum
+   Merstat       mersum          Meridional sum
+   Merstat       mermean         Meridional mean
+   Merstat       meravg          Meridional average
+   Merstat       mervar          Meridional variance
+   Merstat       merstd          Meridional standard deviation
+   Merstat       merpctl         Meridional percentiles
+   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
+   Vertstat      vertmin         Vertical minimum
+   Vertstat      vertmax         Vertical maximum
+   Vertstat      vertsum         Vertical sum
+   Vertstat      vertmean        Vertical mean
+   Vertstat      vertavg         Vertical average
+   Vertstat      vertvar         Vertical variance
+   Vertstat      vertstd         Vertical standard deviation
+   Timselstat    timselmin       Time range minimum
+   Timselstat    timselmax       Time range maximum
+   Timselstat    timselsum       Time range sum
+   Timselstat    timselmean      Time range mean
+   Timselstat    timselavg       Time range average
+   Timselstat    timselvar       Time range variance
+   Timselstat    timselstd       Time range standard deviation
+   Timselpctl    timselpctl      Time range percentiles
+   Runstat       runmin          Running minimum
+   Runstat       runmax          Running maximum
+   Runstat       runsum          Running sum
+   Runstat       runmean         Running mean
+   Runstat       runavg          Running average
+   Runstat       runvar          Running variance
+   Runstat       runstd          Running standard deviation
+   Runpctl       runpctl         Running percentiles
+   Timstat       timmin          Time minimum
+   Timstat       timmax          Time maximum
+   Timstat       timsum          Time sum
+   Timstat       timmean         Time mean
+   Timstat       timavg          Time average
+   Timstat       timvar          Time variance
+   Timstat       timstd          Time standard deviation
+   Timpctl       timpctl         Time percentiles
+   Hourstat      hourmin         Hourly minimum
+   Hourstat      hourmax         Hourly maximum
+   Hourstat      hoursum         Hourly sum
+   Hourstat      hourmean        Hourly mean
+   Hourstat      houravg         Hourly average
+   Hourstat      hourvar         Hourly variance
+   Hourstat      hourstd         Hourly standard deviation
+   Hourpctl      hourpctl        Hourly percentiles
+   Daystat       daymin          Daily minimum
+   Daystat       daymax          Daily maximum
+   Daystat       daysum          Daily sum
+   Daystat       daymean         Daily mean
+   Daystat       dayavg          Daily average
+   Daystat       dayvar          Daily variance
+   Daystat       daystd          Daily standard deviation
+   Daypctl       daypctl         Daily percentiles
+   Monstat       monmin          Monthly minimum
+   Monstat       monmax          Monthly maximum
+   Monstat       monsum          Monthly sum
+   Monstat       monmean         Monthly mean
+   Monstat       monavg          Monthly average
+   Monstat       monvar          Monthly variance
+   Monstat       monstd          Monthly standard deviation
+   Monpctl       monpctl         Monthly percentiles
+   Yearstat      yearmin         Yearly minimum
+   Yearstat      yearmax         Yearly maximum
+   Yearstat      yearsum         Yearly sum
+   Yearstat      yearmean        Yearly mean
+   Yearstat      yearavg         Yearly average
+   Yearstat      yearvar         Yearly variance
+   Yearstat      yearstd         Yearly standard deviation
+   Yearpctl      yearpctl        Yearly percentiles
+   Seasstat      seasmin         Seasonal minimum
+   Seasstat      seasmax         Seasonal maximum
+   Seasstat      seassum         Seasonal sum
+   Seasstat      seasmean        Seasonal mean
+   Seasstat      seasavg         Seasonal average
+   Seasstat      seasvar         Seasonal variance
+   Seasstat      seasstd         Seasonal standard deviation
+   Seaspctl      seaspctl        Seasonal percentiles
+   Yhourstat     yhourmin        Multi-year hourly minimum
+   Yhourstat     yhourmax        Multi-year hourly maximum
+   Yhourstat     yhoursum        Multi-year hourly sum
+   Yhourstat     yhourmean       Multi-year hourly mean
+   Yhourstat     yhouravg        Multi-year hourly average
+   Yhourstat     yhourvar        Multi-year hourly variance
+   Yhourstat     yhourstd        Multi-year hourly standard deviation
+   Ydaystat      ydaymin         Multi-year daily minimum
+   Ydaystat      ydaymax         Multi-year daily maximum
+   Ydaystat      ydaysum         Multi-year daily sum
+   Ydaystat      ydaymean        Multi-year daily mean
+   Ydaystat      ydayavg         Multi-year daily average
+   Ydaystat      ydayvar         Multi-year daily variance
+   Ydaystat      ydaystd         Multi-year daily standard deviation
+   Ydaypctl      ydaypctl        Multi-year daily percentiles
+   Ymonstat      ymonmin         Multi-year monthly minimum
+   Ymonstat      ymonmax         Multi-year monthly maximum
+   Ymonstat      ymonsum         Multi-year monthly sum
+   Ymonstat      ymonmean        Multi-year monthly mean
+   Ymonstat      ymonavg         Multi-year monthly average
+   Ymonstat      ymonvar         Multi-year monthly variance
+   Ymonstat      ymonstd         Multi-year monthly standard deviation
+   Ymonpctl      ymonpctl        Multi-year monthly percentiles
+   Yseasstat     yseasmin        Multi-year seasonal minimum
+   Yseasstat     yseasmax        Multi-year seasonal maximum
+   Yseasstat     yseassum        Multi-year seasonal sum
+   Yseasstat     yseasmean       Multi-year seasonal mean
+   Yseasstat     yseasavg        Multi-year seasonal average
+   Yseasstat     yseasvar        Multi-year seasonal variance
+   Yseasstat     yseasstd        Multi-year seasonal standard deviation
+   Yseaspctl     yseaspctl       Multi-year seasonal percentiles
+   Ydrunstat     ydrunmin        Multi-year daily running minimum
+   Ydrunstat     ydrunmax        Multi-year daily running maximum
+   Ydrunstat     ydrunsum        Multi-year daily running sum
+   Ydrunstat     ydrunmean       Multi-year daily running mean
+   Ydrunstat     ydrunavg        Multi-year daily running average
+   Ydrunstat     ydrunvar        Multi-year daily running variance
+   Ydrunstat     ydrunstd        Multi-year daily running standard deviation
+   Ydrunpctl     ydrunpctl       Multi-year daily running percentiles
+-------------------------------------------------------------
+   Correlation and co.
+-------------------------------------------------------------
+   Fldcor        fldcor          Correlation in grid space
+   Timcor        timcor          Correlation over time
+   Fldcovar      fldcovar        Covariance in grid space
+   Timcovar      timcovar        Covariance over time
+-------------------------------------------------------------
+   Regression
+-------------------------------------------------------------
+   Regres        regres          Regression
+   Detrend       detrend         Detrend
+   Trend         trend           Trend
+   Subtrend      subtrend        Subtract trend
+-------------------------------------------------------------
+   EOFs
+-------------------------------------------------------------
+   EOFs          eof             Calculate EOFs in spatial or time space
+   EOFs          eoftime         Calculate EOFs in time space
+   EOFs          eofspatial      Calculate EOFs in spatial space
+   EOFs          eof3d           Calculate 3-Dimensional EOFs in time space
+   Eofcoeff      eofcoeff        Calculate principal coefficients of EOFs
+-------------------------------------------------------------
+   Interpolation
+-------------------------------------------------------------
+   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
+   Genweights    genbil          Generate bilinear interpolation weights
+   Genweights    genbic          Generate bicubic interpolation weights
+   Genweights    gendis          Generate distance-weighted average remap weights
+   Genweights    gennn           Generate nearest neighbor remap weights
+   Genweights    gencon          Generate 1st order conservative remap weights
+   Genweights    gencon2         Generate 2nd order conservative remap weights
+   Genweights    genlaf          Generate largest area fraction remap weights
+   Remap         remap           SCRIP grid remapping
+   Remapeta      remapeta        Remap vertical hybrid level
+   Vertint       ml2pl           Model to pressure level interpolation
+   Vertint       ml2hl           Model to height level interpolation
+   Intlevel      intlevel        Linear level interpolation
+   Intlevel3d    intlevel3d      Linear level interpolation onto a 3d vertical coordinate
+   Intlevel3d    intlevelx3d     like intlevel3d but with extrapolation
+   Inttime       inttime         Interpolation between timesteps
+   Inttime       intntime        Interpolation between timesteps
+   Intyear       intyear         Interpolation between two years
+-------------------------------------------------------------
+   Transformation
+-------------------------------------------------------------
+   Spectral      sp2gp           Spectral to gridpoint
+   Spectral      sp2gpl          Spectral to gridpoint (linear)
+   Spectral      gp2sp           Gridpoint to spectral
+   Spectral      gp2spl          Gridpoint to spectral (linear)
+   Spectral      sp2sp           Spectral to spectral
+   Wind          dv2uv           Divergence and vorticity to U and V wind
+   Wind          dv2uvl          Divergence and vorticity to U and V wind (linear)
+   Wind          uv2dv           U and V wind to divergence and vorticity
+   Wind          uv2dvl          U and V wind to divergence and vorticity (linear)
+   Wind          dv2ps           D and V to velocity potential and stream function
+-------------------------------------------------------------
+   Import/Export
+-------------------------------------------------------------
+   Importbinary  import_binary   Import binary data sets
+   Importcmsaf   import_cmsaf    Import CM-SAF HDF5 files
+   Importamsr    import_amsr     Import AMSR binary files
+   Input         input           ASCII input
+   Input         inputsrv        SERVICE ASCII input
+   Input         inputext        EXTRA ASCII input
+   Output        output          ASCII output
+   Output        outputf         Formatted output
+   Output        outputint       Integer output
+   Output        outputsrv       SERVICE ASCII output
+   Output        outputext       EXTRA ASCII output
+-------------------------------------------------------------
+   Miscellaneous
+-------------------------------------------------------------
+   Gradsdes      gradsdes1       GrADS data descriptor file (version 1 GRIB map)
+   Gradsdes      gradsdes2       GrADS data descriptor file (version 2 GRIB map)
+   Filter        bandpass        Bandpass filtering
+   Filter        lowpass         Lowpass filtering
+   Filter        highpass        Highpass filtering
+   Gridcell      gridarea        Grid cell area
+   Gridcell      gridweights     Grid cell weights
+   Smooth9       smooth9         9 point smoothing
+   Replacevalues setvals         Set list of old values to new values
+   Replacevalues setrtoc         Set range to constant
+   Replacevalues setrtoc2        Set range to constant others to constant2
+   Timsort       timsort         Sort over the time
+   Vargen        const           Create a constant field
+   Vargen        random          Create a field with random numbers
+   Vargen        stdatm          Create values for pressure and temperature for hydrostatic atmosphere
+   Rotuv         rotuvb          Backward rotation
+   Mastrfu       mastrfu         Mass stream function
+   Histogram     histcount       Histogram count
+   Histogram     histsum         Histogram sum
+   Histogram     histmean        Histogram mean
+   Histogram     histfreq        Histogram frequency
+   Sethalo       sethalo         Set the left and right bounds of a field
+   Wct           wct             Windchill temperature
+   Fdns          fdns            Frost days where no snow index per time period
+   Strwin        strwin          Strong wind days index per time period
+   Strbre        strbre          Strong breeze days index per time period
+   Strgal        strgal          Strong gale days index per time period
+   Hurr          hurr            Hurricane days index per time period
+-------------------------------------------------------------
+   Climate indices
+-------------------------------------------------------------
+   EcaCdd        eca_cdd         Consecutive dry days index per time period
+   EcaCfd        eca_cfd         Consecutive frost days index per time period
+   EcaCsu        eca_csu         Consecutive summer days index per time period
+   EcaCwd        eca_cwd         Consecutive wet days index per time period
+   EcaCwdi       eca_cwdi        Cold wave duration index wrt mean of reference period
+   EcaCwfi       eca_cwfi        Cold-spell days index wrt 10th percentile of reference period
+   EcaEtr        eca_etr         Intra-period extreme temperature range
+   EcaFd         eca_fd          Frost days index per time period
+   EcaGsl        eca_gsl         Growing season length index
+   EcaHd         eca_hd          Heating degree days per time period
+   EcaHwdi       eca_hwdi        Heat wave duration index wrt mean of reference period
+   EcaHwfi       eca_hwfi        Warm spell days index wrt 90th percentile of reference period
+   EcaId         eca_id          Ice days index per time period
+   EcaR75p       eca_r75p        Moderate wet days wrt 75th percentile of reference period
+   EcaR75ptot    eca_r75ptot     Precipitation percent due to R75p days
+   EcaR90p       eca_r90p        Wet days wrt 90th percentile of reference period
+   EcaR90ptot    eca_r90ptot     Precipitation percent due to R90p days
+   EcaR95p       eca_r95p        Very wet days wrt 95th percentile of reference period
+   EcaR95ptot    eca_r95ptot     Precipitation percent due to R95p days
+   EcaR99p       eca_r99p        Extremely wet days wrt 99th percentile of reference period
+   EcaR99ptot    eca_r99ptot     Precipitation percent due to R99p days
+   EcaPd         eca_pd          Precipitation days index per time period
+   EcaPd         eca_r10mm       Heavy precipitation days index per time period
+   EcaPd         eca_r20mm       Very heavy precipitation days index per time period
+   EcaRr1        eca_rr1         Wet days index per time period
+   EcaRx1day     eca_rx1day      Highest one day precipitation amount per time period
+   EcaRx5day     eca_rx5day      Highest five-day precipitation amount per time period
+   EcaSdii       eca_sdii        Simple daily intensity index per time period
+   EcaSu         eca_su          Summer days index per time period
+   EcaTg10p      eca_tg10p       Cold days percent wrt 10th percentile of reference period
+   EcaTg90p      eca_tg90p       Warm days percent wrt 90th percentile of reference period
+   EcaTn10p      eca_tn10p       Cold nights percent wrt 10th percentile of reference period
+   EcaTn90p      eca_tn90p       Warm nights percent wrt 90th percentile of reference period
+   EcaTr         eca_tr          Tropical nights index per time period
+   EcaTx10p      eca_tx10p       Very cold days percent wrt 10th percentile of reference period
+   EcaTx90p      eca_tx90p       Very warm days percent wrt 90th percentile of reference period
diff --git a/README b/README
new file mode 100644
index 0000000..28a6912
--- /dev/null
+++ b/README
@@ -0,0 +1,73 @@
+
+CDO - Climate Data Operators
+----------------------------
+
+     This package contains the source code for CDO. This program was developed at the 
+     Max-Planck-Institute for Meteorology.
+     CDO is a collection of Operators to manipulate and analyse Climate model Data.
+     Supported data formats are GRIB, netCDF, SERVICE, EXTRA and IEG.
+
+     CDO is licensed under the GNU General Public License, version 2.
+     Read the file COPYING in the source distribution for details.
+
+     MPI-M makes no representations or warranties of any kind concerning the Software and any results
+     (including but not limited to any data) generated by use of the Software (hereinafter "Results"),
+     express or implied, and the absence of any legal or actual defects, whether discoverable or not.
+     The use of the Software and the Results is at your own risk.
+
+     Specifically, and not to limit the foregoing, MPI-M makes no representations or warranties 
+       (i) regarding the fitness for a particular purpose of the Software and the Results,
+      (ii) that the use of the Software and the Results will not infringe any patents or other 
+           intellectual property rights of any third party, and 
+     (iii) that the use of the Software and the Results will not cause any damages of any kind 
+           to you or to any third party.
+
+Operators:
+
+     There are more than 400 operators available. Read OPEATORS for
+     a short overview of all operators.
+
+Documentation:
+
+     A detailed description of all operators can be found in: ./doc/cdo.pdf
+
+     Online reference manuals:   cdo -h <operator>
+
+Building and installing it:
+
+     1. Run ./configure, with some options if you wish. The standard
+        options are documented in the INSTALL file. The configuration
+        script has some more options; type 'configure -h' to see them.
+
+        The most interesting ones are the usual
+          --prefix=<installation directory> and
+          --with-netcdf=<directory> to enable netCDF support.
+
+        The netCDF-4 configuration depends on the netCDF-4 and HDF5 installation!
+	You have to define the location of the HDF5 installation if netCDF-4 was 
+        build with HDF5 support:
+ 
+          --with-netcdf=<netCDF-4 root directory> --with-hdf5=<HDF5 root directory> 
+
+        You have to specify also the location of the SZLIB if HDF5 was build
+        with SZLIB support. If only the linking is required, you can directly
+        set the linking path with --with-szlib-lib=<dir>, --with-zlib-lib=<dir>
+        and --with-hdf5-lib=<dir>
+
+        To process szip compressed GRIB files you have to enable SZLIB support with:
+          --with-szlib=<directory>
+
+     2. Do "make" to compile the program.
+
+     3. (Optional) Do "make install", possibly as root if the destination
+        permissions require that. This installs CDO in the directory
+        specified during configuration. The default prefix is /usr/local.
+
+Porting:
+
+     This package was designed for maximum portability. It is written entirely
+     in ANSI C99, and will compile on most UNIX platforms.
+     
+Contact:
+
+     Send questions, comments and bug reports to <http://code.zmaw.de/projects/cdo>
diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644
index 0000000..c4b0816
--- /dev/null
+++ b/acinclude.m4
@@ -0,0 +1,98 @@
+dnl acinclude.m4 --- m4 files that are unconditionally included by autoconf
+dnl
+dnl Copyright  (C)  2010  Thomas Jahns <jahns at dkrz.de>
+dnl
+dnl Version: 1.0
+dnl Keywords: configure configure.ac autotools
+dnl Author: Thomas Jahns <jahns at dkrz.de>
+dnl Maintainer: Thomas Jahns <jahns at dkrz.de>
+dnl URL: https://www.dkrz.de/redmine/projects/show/scales-ppm
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are  permitted provided that the following conditions are
+dnl met:
+dnl
+dnl Redistributions of source code must retain the above copyright notice,
+dnl this list of conditions and the following disclaimer.
+dnl
+dnl Redistributions in binary form must reproduce the above copyright
+dnl notice, this list of conditions and the following disclaimer in the
+dnl documentation and/or other materials provided with the distribution.
+dnl
+dnl Neither the name of the DKRZ GmbH nor the names of its contributors
+dnl may be used to endorse or promote products derived from this software
+dnl without specific prior written permission.
+dnl
+dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+dnl IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+dnl PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+dnl OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+dnl
+dnl Commentary:
+dnl
+dnl
+dnl
+dnl Code:
+dnl
+dnl
+dnl Local Variables:
+dnl mode: autoconf
+dnl license-project-url: "https://www.dkrz.de/redmine/projects/show/scales-ppm"
+dnl license-default: "bsd"
+dnl End:
+dnl acinclude.m4 --- m4 files that are unconditionally included by autoconf
+dnl
+dnl Copyright  (C)  2010  Thomas Jahns <jahns at dkrz.de>
+dnl
+dnl Version: 1.0
+dnl Keywords: configure configure.ac autotools
+dnl Author: Thomas Jahns <jahns at dkrz.de>
+dnl Maintainer: Thomas Jahns <jahns at dkrz.de>
+dnl URL: https://www.dkrz.de/redmine/projects/show/scales-ppm
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are  permitted provided that the following conditions are
+dnl met:
+dnl
+dnl Redistributions of source code must retain the above copyright notice,
+dnl this list of conditions and the following disclaimer.
+dnl
+dnl Redistributions in binary form must reproduce the above copyright
+dnl notice, this list of conditions and the following disclaimer in the
+dnl documentation and/or other materials provided with the distribution.
+dnl
+dnl Neither the name of the DKRZ GmbH nor the names of its contributors
+dnl may be used to endorse or promote products derived from this software
+dnl without specific prior written permission.
+dnl
+dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+dnl IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+dnl PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+dnl OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+dnl
+dnl Commentary:
+dnl
+dnl
+dnl
+dnl Code:
+dnl
+dnl
+dnl Local Variables:
+dnl mode: autoconf
+dnl license-project-url: "https://www.dkrz.de/redmine/projects/show/scales-ppm"
+dnl license-default: "bsd"
+dnl End:
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..191a9ec
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,1066 @@
+# generated automatically by aclocal 1.11.5 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+# Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
+# Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.5], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.5])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
+# 2010, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+			     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+		  [_AM_DEPENDENCIES(CC)],
+		  [define([AC_PROG_CC],
+			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+		  [_AM_DEPENDENCIES(CXX)],
+		  [define([AC_PROG_CXX],
+			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+		  [_AM_DEPENDENCIES(OBJC)],
+		  [define([AC_PROG_OBJC],
+			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
+# Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
+# 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t at _MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+			  (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST([MAINT])dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_PROG_CC_C_O
+# --------------
+# Like AC_PROG_CC_C_O, but changed for automake.
+AC_DEFUN([AM_PROG_CC_C_O],
+[AC_REQUIRE([AC_PROG_CC_C_O])dnl
+AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+dnl Make sure AC_PROG_CC is never called again, or it will override our
+dnl setting of CC.
+m4_define([AC_PROG_CC],
+          [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
+# Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
+# Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+m4_if([$1], [v7],
+     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/acx_options.m4])
+m4_include([m4/ax_pthread.m4])
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
+m4_include([acinclude.m4])
diff --git a/cdo.settings.in b/cdo.settings.in
new file mode 100644
index 0000000..bf0a1bc
--- /dev/null
+++ b/cdo.settings.in
@@ -0,0 +1,52 @@
+{
+   "CC"                 : "@CC@",
+   "CPP"                : "@CPP@",
+   "CPPFLAGS"           : "@CPPFLAGS@",
+   "CFLAGS"             : "@CFLAGS@",
+   "LDFLAGS"            : "@LDFLAGS@",
+   "LIBS"               : "@LIBS@",
+   "FCFLAGS"            : "@FCFLAGS@",
+   "INCLUDES"           : "@INCLUDES@",
+   "LD"                 : "@LD@",
+   "NM"                 : "@NM@",
+   "AR"                 : "@AR@",
+   "AS"                 : "@AS@",
+   "DLLTOOL"            : "@DLLTOOL@",
+   "OBJDUMP"            : "@OBJDUMP@",
+   "STRIP"              : "@STRIP@",
+   "RANLIB"             : "@RANLIB@",
+   "INSTALL"            : "@INSTALL@",
+   "cdi"                : {
+     "enable_cdi_lib" : @ENABLE_CDI_LIB@
+   },
+  "threads"    : {
+    "lib"      : "@THREADS_LIBS@",
+    "include"  : "@THREADS_INCLUDE@"
+  },
+  "zlib"       : {
+    "lib"      : "@ZLIB_LIBS@",
+  },
+  "szlib"      : {
+    "lib"      : "@SZLIB_LIBS@",
+    "include"  : "@SZLIB_INCLUDE@"
+  },
+  "hdf5"       : {
+    "lib"      : "@HDF5_LIBS@",
+    "include"  : "@HDF5_INCLUDE@"
+  },
+  "netcdf"     : {
+    "lib"      : "@NETCDF_LIBS@",
+    "include"  : "@NETCDF_INCLUDE@"
+  },
+  "udunits2"   : {
+    "lib"      : "@UDUNITS_LDFLAGS@",
+    "include"  : "@UDUNITS_INCLUDE@"
+  },
+  "proj"       : {
+    "lib"      : "@PROJ_LDFLAGS@",
+    "include"  : "@PROJ_INCLUDE@"
+  },
+  "USER_NAME"          : "@USER_NAME@",
+  "HOST_NAME"          : "@HOST_NAME@",
+  "SYSTEM_TYPE"        : "@SYSTEM_TYPE@"
+}
diff --git a/cdo.spec b/cdo.spec
new file mode 100644
index 0000000..54d8bf2
--- /dev/null
+++ b/cdo.spec
@@ -0,0 +1,62 @@
+#
+# spec file for package cdo
+#
+
+Name:           cdo
+#BuildRequires:  
+Version:        1.5.9
+Release:        1
+Summary:        Climate Data Operators
+License:        GNU GENERAL PUBLIC LICENSE Version 2, June 1991
+Group:          Productivity/Graphics/Visualization/Other
+Requires:       netcdf
+Autoreqprov:    on
+URL:            http://code.zmaw.de/projects/cdo
+Source0:        cdo-%{version}.tar.gz
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+
+%description
+CDO is a collection of command line Operators to manipulate and analyse Climate model Data.
+Supported data formats are GRIB, netCDF, SERVICE, EXTRA and IEG. There are more than 400
+operators available. The following table provides a brief overview of the main categories.
+
+
+Authors:
+--------
+    This program was developed at the Max-Planck-Institute for Meteorology.
+    Uwe Schulzweida, Uwe.Schulzweida at zmaw.de, is the main author.
+    Ralf Mueller, Ralf.Mueller at zmaw.de
+    Luis Kornblueh, Luis.Kornblueh at zmaw.de
+    Cedrick Ansorge, Cedrick.Ansorge at zmaw.de
+    Ralf Quast, Ralf.Quast at brockmann-consult.de
+    Send questions, comments and bug reports to <http://code.zmaw.de/projects/cdo>
+
+
+%prep
+%setup
+
+
+%build
+./configure --prefix=%{_prefix} --with-netcdf
+make 
+
+%install
+make DESTDIR=$RPM_BUILD_ROOT install 
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,755)
+%doc AUTHORS COPYING ChangeLog NEWS OPERATORS README doc/cdo.pdf doc/cdo_refcard.pdf
+%{_prefix}/bin/cdo
+#%{_prefix}/bin/cdotest
+
+%changelog -n cdo
+* Mon Aug 25 2008 - petri at pik-potsdam.de
+- adapted to cdo-1.2.0
+* Tue May 20 2008 - petri at pik-potsdam.de
+- adapted to cdo-1.1.1
+- dont try to include cdotest in the package
+* Fri Jan 05 2007 - petri at pik-potsdam.de
+- Created initial spec file
diff --git a/cdo.spec.in b/cdo.spec.in
new file mode 100644
index 0000000..78bf9eb
--- /dev/null
+++ b/cdo.spec.in
@@ -0,0 +1,62 @@
+#
+# spec file for package cdo
+#
+
+Name:           cdo
+#BuildRequires:  
+Version:        @PACKAGE_VERSION@
+Release:        1
+Summary:        Climate Data Operators
+License:        GNU GENERAL PUBLIC LICENSE Version 2, June 1991
+Group:          Productivity/Graphics/Visualization/Other
+Requires:       netcdf
+Autoreqprov:    on
+URL:            http://code.zmaw.de/projects/cdo
+Source0:        cdo-%{version}.tar.gz
+BuildRoot:      %{_tmppath}/%{name}-%{version}-build
+
+%description
+CDO is a collection of command line Operators to manipulate and analyse Climate model Data.
+Supported data formats are GRIB, netCDF, SERVICE, EXTRA and IEG. There are more than 400
+operators available. The following table provides a brief overview of the main categories.
+
+
+Authors:
+--------
+    This program was developed at the Max-Planck-Institute for Meteorology.
+    Uwe Schulzweida, Uwe.Schulzweida at zmaw.de, is the main author.
+    Ralf Mueller, Ralf.Mueller at zmaw.de
+    Luis Kornblueh, Luis.Kornblueh at zmaw.de
+    Cedrick Ansorge, Cedrick.Ansorge at zmaw.de
+    Ralf Quast, Ralf.Quast at brockmann-consult.de
+    Send questions, comments and bug reports to <http://code.zmaw.de/projects/cdo>
+
+
+%prep
+%setup
+
+
+%build
+./configure --prefix=%{_prefix} --with-netcdf
+make 
+
+%install
+make DESTDIR=$RPM_BUILD_ROOT install 
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root,755)
+%doc AUTHORS COPYING ChangeLog NEWS OPERATORS README doc/cdo.pdf doc/cdo_refcard.pdf
+%{_prefix}/bin/cdo
+#%{_prefix}/bin/cdotest
+
+%changelog -n cdo
+* Mon Aug 25 2008 - petri at pik-potsdam.de
+- adapted to cdo-1.2.0
+* Tue May 20 2008 - petri at pik-potsdam.de
+- adapted to cdo-1.1.1
+- dont try to include cdotest in the package
+* Fri Jan 05 2007 - petri at pik-potsdam.de
+- Created initial spec file
diff --git a/config/compile b/config/compile
new file mode 100755
index 0000000..c0096a7
--- /dev/null
+++ b/config/compile
@@ -0,0 +1,143 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2009-10-06.20; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
+# Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as `compile cc -o foo foo.c'.
+	# So we strip `-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no `-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # `.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config/config.guess b/config/config.guess
new file mode 100755
index 0000000..115f944
--- /dev/null
+++ b/config/config.guess
@@ -0,0 +1,1502 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2010-04-03'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner.  Please send patches (context
+# diff format) to <config-patches at gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' HUP INT TERM
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    sh5el) machine=sh5le-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep -q __ELF__
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    s390x:SunOS:*:*)
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+	echo i386-pc-auroraux${UNAME_RELEASE}
+	exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+	eval $set_cc_for_build
+	SUN_ARCH="i386"
+	# If there is a compiler, see if it is configured for 64-bit objects.
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+	# This test works for both compilers.
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		SUN_ARCH="x86_64"
+	    fi
+	fi
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit ;;
+    *:AIX:*:[456])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep -q __LP64__
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	case ${UNAME_MACHINE} in
+	    pc98)
+		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    *:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    *:Interix*:*)
+    	case ${UNAME_MACHINE} in
+	    x86)
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    authenticamd | genuineintel | EM64T)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	    IA64)
+		echo ia64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    8664:Windows_NT:*)
+	echo x86_64-pc-mks
+	exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit ;;
+    arm*:Linux:*:*)
+	eval $set_cc_for_build
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_EABI__
+	then
+	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	else
+	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	fi
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-gnu
+	exit ;;
+    i*86:Linux:*:*)
+	LIBC=gnu
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    mips:Linux:*:* | mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef ${UNAME_MACHINE}
+	#undef ${UNAME_MACHINE}el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=${UNAME_MACHINE}el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=${UNAME_MACHINE}
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-gnu
+	exit ;;
+    padre:Linux:*:*)
+	echo sparc-unknown-linux-gnu
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit ;;
+    xtensa*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i586.
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
+        exit ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+	OS_REL='.3'
+	test -r /etc/.relid \
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel at ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
+	echo i586-pc-haiku
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    i386)
+		eval $set_cc_for_build
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		      grep IS_64BIT_ARCH >/dev/null
+		  then
+		      UNAME_PROCESSOR="x86_64"
+		  fi
+		fi ;;
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+    i*86:AROS:*:*)
+	echo ${UNAME_MACHINE}-pc-aros
+	exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config/config.sub b/config/config.sub
new file mode 100755
index 0000000..204218c
--- /dev/null
+++ b/config/config.sub
@@ -0,0 +1,1731 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2010-05-21'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis | -knuth | -cray | -microblaze)
+		os=
+		basic_machine=$1
+		;;
+        -bluegene*)
+	        os=-cnk
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fido | fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| lm32 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore | mep | metag \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64octeon | mips64octeonel \
+	| mips64orion | mips64orionel \
+	| mips64r5900 | mips64r5900el \
+	| mips64vr | mips64vrel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| moxie \
+	| mt \
+	| msp430 \
+	| nios | nios2 \
+	| ns16k | ns32k \
+	| or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| rx \
+	| score \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu | strongarm \
+	| tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+	| ubicom32 \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| z8k | z80)
+		basic_machine=$basic_machine-unknown
+		;;
+	c54x)
+		basic_machine=tic54x-unknown
+		;;
+	c55x)
+		basic_machine=tic55x-unknown
+		;;
+	c6x)
+		basic_machine=tic6x-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
+
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* | avr32-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
+	| clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| lm32-* \
+	| m32c-* | m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64octeon-* | mips64octeonel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64r5900-* | mips64r5900el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| mt-* \
+	| msp430-* \
+	| nios-* | nios2-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* | rx-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tile-* | tilegx-* \
+	| tron-* \
+	| ubicom32-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa*-* \
+	| ymp-* \
+	| z8k-* | z80-*)
+		;;
+	# Recognize the basic CPU types without company name, with glob match.
+	xtensa*)
+		basic_machine=$basic_machine-unknown
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aros)
+		basic_machine=i386-pc
+		os=-aros
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	blackfin)
+		basic_machine=bfin-unknown
+		os=-linux
+		;;
+	blackfin-*)
+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	bluegene*)
+		basic_machine=powerpc-ibm
+		os=-cnk
+		;;
+	c54x-*)
+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c55x-*)
+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c6x-*)
+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+        cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16)
+		basic_machine=cr16-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dicos)
+		basic_machine=i686-pc
+		os=-dicos
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m68knommu)
+		basic_machine=m68k-unknown
+		os=-linux
+		;;
+	m68knommu-*)
+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+        microblaze)
+		basic_machine=microblaze-xilinx
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	parisc)
+		basic_machine=hppa-unknown
+		os=-linux
+		;;
+	parisc-*)
+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=i686-pc
+		;;
+	pentium4)
+		basic_machine=i786-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium4-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+		;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+		;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+		;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+        # This must be matched before tile*.
+        tilegx*)
+		basic_machine=tilegx-unknown
+		os=-linux-gnu
+		;;
+	tile*)
+		basic_machine=tile-unknown
+		os=-linux-gnu
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=f301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	z80-*-coff)
+		basic_machine=z80-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+		basic_machine=sparc-sun
+		;;
+	cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+        -auroraux)
+	        os=-auroraux
+		;;
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+	      | -sym* | -kopensolaris* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* | -aros* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* | -cegcc* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+        -os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+        -tpf*)
+		os=-tpf
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-dicos*)
+		os=-dicos
+		;;
+        -nacl*)
+	        ;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+        score-*)
+		os=-elf
+		;;
+        spu-*)
+		os=-elf
+		;;
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+        c4x-* | tic4x-*)
+        	os=-coff
+		;;
+	tic54x-*)
+		os=-coff
+		;;
+	tic55x-*)
+		os=-coff
+		;;
+	tic6x-*)
+		os=-coff
+		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
+	pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+        mep-*)
+		os=-elf
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-haiku)
+		os=-haiku
+		;;
+	*-ibm)
+		os=-aix
+		;;
+    	*-knuth)
+		os=-mmixware
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+	*-gould)
+		os=-sysv
+		;;
+	*-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+	*-sgi)
+		os=-irix
+		;;
+	*-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-cnk*|-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/config/default b/config/default
new file mode 100755
index 0000000..b635ba2
--- /dev/null
+++ b/config/default
@@ -0,0 +1,244 @@
+#! /bin/sh
+#
+# default configuration options and compiler flags for different hosts
+#
+#
+CONFPATH=`echo $0 | cut -c 1-6`
+if [ "$CONFPATH" != "../../" ] ; then
+CONFPATH='./'
+fi
+#
+if test -z "$1" ; then
+  HOSTNAME=`hostname`
+else
+  HOSTNAME=$1
+fi
+#
+set -x
+#
+case "${HOSTNAME}" in
+    icc)
+	${CONFPATH}configure --prefix=$HOME/local \
+                    --enable-maintainer-mode \
+                    --with-jasper=$HOME/local \
+                    --with-grib_api=$HOME/local/gribapi-1.9.16cgribex \
+                    --with-netcdf=$HOME/local \
+                    --with-hdf5=$HOME/local \
+                    --with-szlib=$HOME/local \
+                    --with-proj=/opt/local \
+                    --with-libxml2=/usr \
+                    --with-magics=/Users/m214003/local/magics-2.14.9 \
+	            CC=icc CFLAGS="-g  -D_REENTRANT -Wall -W -O3 -openmp" \
+                    LIBS="-L/opt/local/lib -lopenjpeg"
+	;;
+# i386-apple-darwin10
+    bailung*)
+	${CONFPATH}configure --prefix=$HOME/local \
+                    --enable-maintainer-mode \
+                    --with-jasper=$HOME/local \
+                    --with-grib_api=$HOME/local/gribapi-1.9.16cgribex \
+                    --with-netcdf=$HOME/local \
+                    --with-hdf5=$HOME/local \
+                    --with-szlib=$HOME/local \
+                    --with-udunits2=$HOME/local/udunits-2.1.24 \
+                    --with-proj=/opt/local \
+	            CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3 -march=native -fopenmp -DHAVE_LIBYAC -I/Users/m214003/cdt/work/YAC/src" \
+                    LIBS="-L/opt/local/lib -lopenjpeg -L/Users/m214003/cdt/work/YAC/src -lyac"
+#                    --with-libxml2=/usr
+#                    --with-magics=/Users/m214003/local/magics-2.14.9
+	;;
+    hama*)
+	${CONFPATH}configure --prefix=$HOME/local \
+                    --enable-maintainer-mode \
+                    --with-jasper=/opt/local \
+                    --with-grib_api=$HOME/local/gribapi-1.9.16 \
+                    --with-netcdf=/opt/local \
+                    --with-szlib=$HOME/local \
+                    --with-proj=/opt/local \
+	            CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3 -march=native -fopenmp -DHAVE_LIBYAC -I/Users/m214003/cdt/work/YAC/src" \
+                    LIBS="-L/Users/m214003/cdt/work/YAC/src -lyac"
+	;;
+# ia64-xxx-linux
+    ds*)
+	${CONFPATH}configure --prefix=$HOME/local \
+                    --with-netcdf=/pool/ia64/netcdf/netcdf-3.6.0-p1 \
+                    --with-szlib=$HOME/local \
+                    CC=icc CFLAGS="-g -O2 -Wall -fno-alias -DMIN_BUF_SIZE=4194304"
+	;;
+    wasser*)
+	${CONFPATH}configure --prefix=$HOME/local \
+                    --with-netcdf=/home/dkrz/m214089/local/ia64 \
+                    CC=icc CFLAGS="-g -O2 -Wall -fno-alias"
+	;;
+# x86_64-suse-linux
+    tornado*)
+ 	${CONFPATH}configure --prefix=$HOME/local --exec_prefix=$HOME/local/sles10-x64 \
+                    --enable-all-static \
+	            --with-netcdf=/sw/sles10-x64/netcdf-4.2-static \
+	            --with-hdf5=/sw/sles10-x64/hdf5-1.8.8-static \
+                    --with-szlib=/sw/sles10-x64/szip-2.1 \
+	            CC=gcc CFLAGS='-g -Wall -O2 -fopenmp'
+#	            CC=suncc CFLAGS="-g -fast -xopenmp"
+	;;
+# x86_64-squeeze-x64-linux
+    thunder*)
+        ${CONFPATH}configure --prefix=$HOME/local --exec_prefix=$HOME/local/squeeze-x64 \
+                    --with-jasper=/sw/squeeze-x64/jasper-1.900.1-static \
+                    --with-grib_api=/sw/squeeze-x64/grib_api-1.9.9-static \
+                    --with-netcdf=/sw/squeeze-x64/netcdf-4.2-static \
+                    --with-hdf5=/sw/squeeze-x64/hdf5-1.8.8-static \
+                    --with-szlib=/sw/squeeze-x64/szip-2.1 \
+                    --with-proj=/sw/squeeze-x64/proj-4.7.0 \
+                    CC=gcc CFLAGS='-g -Wall -O3 -march=native -fopenmp'
+	;;
+# x86_64-lenny-linux-gnu
+    squall*)
+        ${CONFPATH}configure --prefix=$HOME/local --exec_prefix=$HOME/local/lenny-x64 \
+                    --with-jasper=/sw/lenny-x64/jasper-1.900.1-static \
+                    --with-grib_api=/sw/lenny-x64/grib_api-1.9.9-static \
+                    --with-netcdf=/sw/lenny-x64/netcdf-4.2-static \
+                    --with-hdf5=/sw/lenny-x64/hdf5-1.8.8-static \
+                    --with-szlib=/sw/lenny-x64/szip-2.1 \
+                    --with-udunits2=/sw/lenny-x64/udunits-2.1.19 \
+                    --with-proj=/sw/lenny-x64/proj-4.7.0 \
+                    CC=gcc CFLAGS='-g -Wall -O3 -fopenmp'
+	;;
+# x86_64-archlinux
+    thingol*)
+ 	${CONFPATH}configure --prefix=$HOME/local \
+                    --program-suffix=-dev \
+                    --enable-maintainer-mode \
+	            --with-netcdf=$HOME/builds/libs4cdo-0.0.11 \
+	              --with-hdf5=$HOME/builds/libs4cdo-0.0.11 \
+                     --with-szlib=$HOME/builds/libs4cdo-0.0.11 \
+                  --with-grib_api=$HOME/builds/libs4cdo-0.0.11 \
+                    --with-jasper=$HOME/builds/libs4cdo-0.0.11 \
+                    --with-magics=$HOME/builds/libs4cdo-0.0.11 \
+                    --with-libxml2=/usr \
+                      --with-pic \
+                      CC=gcc CFLAGS="-g -Wall -O2 -fopenmp -DWITH_DATA" \
+                      LDFLAGS='-L/home/ram/local/netcdf-4.1.2/lib -L/usr/lib64 -L/usr/lib -lhdf5_hl -lhdf5  -lz -lm -lhdf5_hl -lhdf5 -lz  -lcurl -L/usr/local/lib64 -L/usr/X11R6/lib64 -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo   -lexpat -lpthread -lfontconfig -lz -lgd -lproj -lgrib_api -lpng -lxml2 -lm -ljasper -lopenjpeg   -L/home/ram/local/netcdf-4.1.2/lib -lnetcdf_c++ -lnetcdf  -lcurl  -lstdc++ -lgfortran'
+	;;
+# i686-suse-linux
+    linux | laptop)
+	${CONFPATH}configure --prefix=$HOME/local \
+                    --with-jasper=/usr \
+                    --with-grib_api=$HOME/local \
+                    --with-netcdf=$HOME/local \
+                    --with-hdf5=$HOME/local \
+                    --with-szlib=$HOME/local \
+	            CC=colorgcc CFLAGS="-g -Wall -W -Wfloat-equal -pedantic -O2 -fopenmp"
+	;;
+# standard workstations at MPI-M x86_64-lenny
+    mpipc* )
+	${CONFPATH}configure \
+               --prefix=`pwd`/build \
+               --enable-maintainer-mode \
+               --with-netcdf='/sw/lenny-x64/netcdf-latest-gccsys' \
+               --with-hdf5='/sw/lenny-x64/hdf5-latest' \
+               --with-szlib='/sw/lenny-x64/szip-latest' \
+               --with-proj='/sw/lenny-x64/proj-latest' \
+               --enable-ruby --enable-swig --enable-python \
+	           CC=gcc CFLAGS="-g -fopenmp -Wall -W -Wfloat-equal -pedantic -O2"
+        ;;
+# dap enabled
+    egmont | columbine)
+ 	  ${CONFPATH}configure --prefix=$HOME/local --exec_prefix=$HOME/local/etch-ia32 \
+	            --with-netcdf=/sw/etch-ia32/netcdf-4.1.1-gcc \
+	            --with-hdf5=/sw/etch-ia32/hdf5-1.8.4-threadsafe \
+                    --with-zlib=/sw/etch-ia32/zlib-1.2.3 \
+                    --with-szlib=/sw/etch-ia32/szip-2.1 \
+                    --with-proj=/sw/etch-ia32/proj-4.6.0 \
+	            --enable-all-static CC=icc CFLAGS="-g -fast -openmp" AR=xiar LD=xild
+#	            CC=gcc CFLAGS="-g -Wall -W -Wfloat-equal -pedantic -O2 -fopenmp"
+    ;;
+# i386-pc-solaris2.10
+    grim | mil* )
+	${CONFPATH}configure --prefix=$HOME/local --exec_prefix=$HOME/local/solaris10-x86 \
+                    --with-netcdf=/client \
+                    --with-szlib=$HOME/local/solaris10-x86 \
+                    CC=cc CFLAGS="-g -mt -fast"
+	;;
+# sx6-nec-superux12.2
+    cs*)
+	${CONFPATH}configure --prefix=$HOME/local \
+         	    --with-netcdf=/pool/netcdf/netcdf-3.6.0-p1 \
+		    CC=cc \
+                    CFLAGS="-O -Onooverlap,restrict=all -pvctl,fullmsg,noassume,loopcnt=1000000"
+	;;
+    sx6)
+	${CONFPATH}configure --host=sx6 --prefix=$HOME/local \
+                    --with-netcdf=/pool/SX-6/netcdf/netcdf-3.6.0-p1 \
+		    CC=sxcc AR=sxar \
+                    CFLAGS="-O -Onooverlap,restrict=all -pvctl,fullmsg,noassume,loopcnt=1000000"
+	;;
+    es)
+	${CONFPATH}configure --host=sx6 --prefix=$HOME/local/ES \
+                    --with-netcdf=/S/n010/home010/c0148/local/SX \
+		    CC=escc AR=esar \
+                    CFLAGS="-O -Onooverlap,restrict=all -pvctl,fullmsg,noassume,loopcnt=1000000"
+	;;
+# x86_64-unknown-linux-gnu (rhel55)
+    lizard*)
+        LDFLAGS="-lpng"
+        export LDFLAGS
+	${CONFPATH}configure --prefix=$HOME/local/rhel55-x64 \
+                    --with-jasper=/sw/rhel55-x64/jasper-1.900.1 \
+                    --with-grib_api=/sw/rhel55-x64/grib_api-1.9.0 \
+                    --with-netcdf=/sw/rhel55-x64/netcdf-4.2 \
+                    --with-hdf5=/sw/rhel55-x64/hdf5-1.8.8-threadsafe \
+                    --with-szlib=/sw/rhel55-x64/szip-2.1 \
+                    --with-zlib=/usr \
+	            CC=gcc44 CFLAGS="-g -Wall -O2 -fopenmp"
+	;;
+# powerpc-ibm-aix5.2.0.0
+    ecga*)
+
+	${CONFPATH}configure --prefix=$HOME/local \
+                    --with-jasper=/usr/local/lib/metaps/lib/grib_api/jasper_64 \
+                    --with-grib_api=$HOME/gribapi/1.9.8 \
+                    --with-netcdf=/usr/local/apps/netCDF/3.6.2/LP64 \
+                    --with-szlib=$HOME/local \
+                    AR="ar -X 64"  LDFLAGS="-brtl" \
+	            CC=xlc_r CFLAGS="-g -O3 -q64 -qhot -qstrict -qarch=auto -qtune=auto -qsmp=omp -DHAVE_MMAP -qthreaded"
+	;;
+# powerpc-ibm-aix5.3.0.0
+    blizzard*)
+	${CONFPATH}configure --prefix=$HOME/local \
+                    --with-jasper=/sw/aix53/jasper-1.900.1 \
+                    --with-grib_api=/sw/aix61/grib_api-1.9.9 \
+                    --with-netcdf=/sw/aix61/netcdf-4.2-threadsafe \
+                    --with-hdf5=/sw/aix61/hdf5-1.8.8-threadsafe \
+                    --with-szlib=/sw/aix61/szip-2.1-threadsafe \
+                    --with-udunits2=/sw/aix61/udunits-2.1.14 \
+                    --with-proj=/sw/aix53/proj-4.6.1 \
+                    AR="ar -X 64"  LDFLAGS="-brtl" \
+ 	            CC=xlc_r CFLAGS="-g -O3 -q64 -qhot -qstrict -qarch=auto -qtune=auto -qsmp=omp -DHAVE_MMAP -qthreaded"
+	;;
+    vip*)
+	${CONFPATH}configure --prefix=$HOME/local \
+                    --with-netcdf=$HOME/local \
+                    --with-szlib=$HOME/local \
+                    AR="ar -X 64"  LDFLAGS="-brtl" \
+	            CC=xlc_r CFLAGS="-g -O3 -q64 -qhot -qstrict -qarch=auto -qtune=auto -qsmp=omp -DHAVE_MMAP -qthreaded"
+	;;
+# powerpc-ibm-aix6.0.0.0
+    c1a*)
+	${CONFPATH}configure --prefix=$HOME/local \
+                    --with-netcdf=/usr/local/apps/netcdf/3.6.3/LP64 \
+                    --with-hdf5=/usr/local/apps/hdf5/1.8.1/LP64 \
+                    --with-szlib=/usr/local/apps/szip/2.1/LP64 \
+                    AR="ar -X 64"  LDFLAGS="-brtl" \
+	            CC=xlc_r CFLAGS="-g -O3 -q64 -qhot -qstrict -qarch=auto -qtune=auto -qsmp=omp -DHAVE_MMAP -qthreaded"
+	;;
+# powerpc-ibm-aix6.0.0.0
+    dwd | p???et01)
+	${CONFPATH}configure --prefix=$HOME/local \
+                    --with-netcdf=/uhome/mpischul/local \
+                    AR="ar -X 64"  LDFLAGS="-brtl" \
+	            CC=xlc_r CFLAGS="-g -O3 -q64 -qhot -qstrict -qarch=auto -qtune=auto -qsmp=omp -DHAVE_MMAP -qthreaded"
+	;;
+    *)
+	echo "configuration for hostname $HOSTNAME not found!"
+	;;
+esac
diff --git a/config/depcomp b/config/depcomp
new file mode 100755
index 0000000..df8eea7
--- /dev/null
+++ b/config/depcomp
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
+# Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> "$depfile"
+    echo >> "$depfile"
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+	       s/^ *//
+	       s/ \\*$//
+	       s/$/:/
+	       p
+	     }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+	set fnord "$@"
+	shift
+	shift
+	;;
+    *)
+	set fnord "$@" "$arg"
+	shift
+	shift
+	;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
+  echo "	" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config/install-sh b/config/install-sh
new file mode 100755
index 0000000..3f83ce9
--- /dev/null
+++ b/config/install-sh
@@ -0,0 +1,524 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2010-02-06.18; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+	shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
+
+    -o) chowncmd="$chownprog $2"
+	shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+	shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)	shift
+	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dst_arg: Is a directory" >&2
+	exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writeable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+	/*) prefix='/';;
+	-*) prefix='./';;
+	*)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test -z "$d" && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config/ltmain.sh b/config/ltmain.sh
new file mode 100755
index 0000000..04eaea4
--- /dev/null
+++ b/config/ltmain.sh
@@ -0,0 +1,8745 @@
+# Generated from ltmain.m4sh.
+
+# libtool (GNU libtool) 2.2.10
+# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+#       --config             show all configuration variables
+#       --debug              enable verbose shell tracing
+#   -n, --dry-run            display commands without modifying any files
+#       --features           display basic configuration information and exit
+#       --mode=MODE          use operation mode MODE
+#       --preserve-dup-deps  don't remove duplicate dependency libraries
+#       --quiet, --silent    don't print informational messages
+#       --no-quiet, --no-silent
+#                            print informational messages (default)
+#       --tag=TAG            use configuration variables from tag TAG
+#   -v, --verbose            print more informational messages than default
+#       --no-verbose         don't print the extra informational messages
+#       --version            print version information
+#   -h, --help, --help-all   print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+#         clean              remove files from the build directory
+#         compile            compile a source file into a libtool object
+#         execute            automatically set library path, then run a program
+#         finish             complete the installation of libtool libraries
+#         install            install libraries or executables
+#         link               create a library or an executable
+#         uninstall          remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.  When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+#         host-triplet:	$host
+#         shell:		$SHELL
+#         compiler:		$LTCC
+#         compiler flags:		$LTCFLAGS
+#         linker:		$LD (gnu? $with_gnu_ld)
+#         $progname:	(GNU libtool) 2.2.10
+#         automake:	$automake_version
+#         autoconf:	$autoconf_version
+#
+# Report bugs to <bug-libtool at gnu.org>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.2.10
+TIMESTAMP=""
+package_revision=1.3175
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test \"\${$lt_var+set}\" = set; then
+          save_$lt_var=\$$lt_var
+          $lt_var=C
+	  export $lt_var
+	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+	fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${EGREP="grep -E"}
+: ${FGREP="grep -F"}
+: ${GREP="grep"}
+: ${LN_S="ln -s"}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SED="sed"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" 	$lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+  func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+}
+
+# Generated shell functions inserted here.
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+		s@/\./@/@g
+		t dotsl
+		s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+#             value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+  # Start from root dir and reassemble the path.
+  func_normal_abspath_result=
+  func_normal_abspath_tpath=$1
+  func_normal_abspath_altnamespace=
+  case $func_normal_abspath_tpath in
+    "")
+      # Empty path, that just means $cwd.
+      func_stripname '' '/' "`pwd`"
+      func_normal_abspath_result=$func_stripname_result
+      return
+    ;;
+    # The next three entries are used to spot a run of precisely
+    # two leading slashes without using negated character classes;
+    # we take advantage of case's first-match behaviour.
+    ///*)
+      # Unusual form of absolute path, do nothing.
+    ;;
+    //*)
+      # Not necessarily an ordinary path; POSIX reserves leading '//'
+      # and for example Cygwin uses it to access remote file shares
+      # over CIFS/SMB, so we conserve a leading double slash if found.
+      func_normal_abspath_altnamespace=/
+    ;;
+    /*)
+      # Absolute path, do nothing.
+    ;;
+    *)
+      # Relative path, prepend $cwd.
+      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+    ;;
+  esac
+  # Cancel out all the simple stuff to save iterations.  We also want
+  # the path to end with a slash for ease of parsing, so make sure
+  # there is one (and only one) here.
+  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+  while :; do
+    # Processed it all yet?
+    if test "$func_normal_abspath_tpath" = / ; then
+      # If we ascended to the root using ".." the result may be empty now.
+      if test -z "$func_normal_abspath_result" ; then
+        func_normal_abspath_result=/
+      fi
+      break
+    fi
+    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcar"`
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcdr"`
+    # Figure out what to do with it
+    case $func_normal_abspath_tcomponent in
+      "")
+        # Trailing empty path component, ignore it.
+      ;;
+      ..)
+        # Parent dir; strip last assembled component from result.
+        func_dirname "$func_normal_abspath_result"
+        func_normal_abspath_result=$func_dirname_result
+      ;;
+      *)
+        # Actual path component, append it.
+        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+      ;;
+    esac
+  done
+  # Restore leading double-slash if one was found on entry.
+  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+#             value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+  func_relative_path_result=
+  func_normal_abspath "$1"
+  func_relative_path_tlibdir=$func_normal_abspath_result
+  func_normal_abspath "$2"
+  func_relative_path_tbindir=$func_normal_abspath_result
+
+  # Ascend the tree starting from libdir
+  while :; do
+    # check if we have found a prefix of bindir
+    case $func_relative_path_tbindir in
+      $func_relative_path_tlibdir)
+        # found an exact match
+        func_relative_path_tcancelled=
+        break
+        ;;
+      $func_relative_path_tlibdir*)
+        # found a matching prefix
+        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+        func_relative_path_tcancelled=$func_stripname_result
+        if test -z "$func_relative_path_result"; then
+          func_relative_path_result=.
+        fi
+        break
+        ;;
+      *)
+        func_dirname $func_relative_path_tlibdir
+        func_relative_path_tlibdir=${func_dirname_result}
+        if test "x$func_relative_path_tlibdir" = x ; then
+          # Have to descend all the way to the root!
+          func_relative_path_result=../$func_relative_path_result
+          func_relative_path_tcancelled=$func_relative_path_tbindir
+          break
+        fi
+        func_relative_path_result=../$func_relative_path_result
+        ;;
+    esac
+  done
+
+  # Now calculate path; take care to avoid doubling-up slashes.
+  func_stripname '' '/' "$func_relative_path_result"
+  func_relative_path_result=$func_stripname_result
+  func_stripname '/' '/' "$func_relative_path_tcancelled"
+  if test "x$func_stripname_result" != x ; then
+    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+  fi
+
+  # Normalisation. If bindir is libdir, return empty string,
+  # else relative path ending with a slash; either way, target
+  # file name can be directly appended.
+  if test ! -z "$func_relative_path_result"; then
+    func_stripname './' '' "$func_relative_path_result/"
+    func_relative_path_result=$func_stripname_result
+  fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=$func_dirname_result
+     progdir=`cd "$progdir" && pwd`
+     progpath="$progdir/$progname"
+     ;;
+  *)
+     save_IFS="$IFS"
+     IFS=:
+     for progdir in $PATH; do
+       IFS="$save_IFS"
+       test -x "$progdir/$progname" && break
+     done
+     IFS="$save_IFS"
+     test -n "$progdir" || progdir=`pwd`
+     progpath="$progdir/$progname"
+     ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+  s/$bs4/&\\
+/g
+  s/^$bs2$dollar/$bs&/
+  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+    $ECHO "$progname${mode+: }$mode: $*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+    $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+
+    # bash bug again:
+    :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information."  ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    my_directory_path="$1"
+    my_dir_list=
+
+    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+      # Protect directory names starting with `-'
+      case $my_directory_path in
+        -*) my_directory_path="./$my_directory_path" ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$my_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+	# list incase some portion of path contains whitespace.
+        my_dir_list="$my_directory_path:$my_dir_list"
+
+        # If the last portion added has no slash in it, the list is done
+        case $my_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+      done
+      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+      save_mkdir_p_IFS="$IFS"; IFS=':'
+      for my_dir in $my_dir_list; do
+	IFS="$save_mkdir_p_IFS"
+        # mkdir can fail with a `File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$my_dir" 2>/dev/null || :
+      done
+      IFS="$save_mkdir_p_IFS"
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$my_directory_path" || \
+        func_fatal_error "Failed to create \`$1'"
+    fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$opt_dry_run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+        save_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$my_tmpdir"
+        umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || \
+        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+    fi
+
+    $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+    case $1 in
+      *[\\\`\"\$]*)
+	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+      *)
+        func_quote_for_eval_unquoted_result="$1" ;;
+    esac
+
+    case $func_quote_for_eval_unquoted_result in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and and variable
+      # expansion for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+    esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    case $1 in
+      *[\\\`\"]*)
+	my_arg=`$ECHO "$1" | $SED \
+	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        my_arg="$1" ;;
+    esac
+
+    case $my_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        my_arg="\"$my_arg\""
+        ;;
+    esac
+
+    func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$my_cmd"
+      my_status=$?
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$lt_user_locale
+	    $my_cmd"
+      my_status=$?
+      eval "$lt_safe_locale"
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $SED -n '/(C)/!b go
+	:more
+	/\./!{
+	  N
+	  s/\n# / /
+	  b more
+	}
+	:go
+	/^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //
+	s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
+     }' < "$progpath"
+     exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $SED -n '/^# Usage:/,/^#  *.*--help/ {
+        s/^# //
+	s/^# *$//
+	s/\$progname/'$progname'/
+	p
+    }' < "$progpath"
+    echo
+    $ECHO "run \`$progname --help | more' for full usage"
+    exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+    $SED -n '/^# Usage:/,/# Report bugs to/ {
+        s/^# //
+	s/^# *$//
+	s*\$progname*'$progname'*
+	s*\$host*'"$host"'*
+	s*\$SHELL*'"$SHELL"'*
+	s*\$LTCC*'"$LTCC"'*
+	s*\$LTCFLAGS*'"$LTCFLAGS"'*
+	s*\$LD*'"$LD"'*
+	s/\$with_gnu_ld/'"$with_gnu_ld"'/
+	s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+	p
+     }' < "$progpath"
+    ret=$?
+    if test -z "$1"; then
+      exit $ret
+    fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    func_error "missing argument for $1."
+    exit_cmd=exit
+}
+
+exit_cmd=:
+
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+# $mode is unset
+nonopt=
+execute_dlfiles=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+opt_dry_run=false
+opt_duplicate_deps=false
+opt_silent=false
+opt_debug=:
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func_error ${1+"$@"}
+    func_error "See the $PACKAGE documentation for more information."
+    func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
+
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+    done
+
+    exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+    echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      echo "enable shared libraries"
+    else
+      echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      echo "enable static libraries"
+    else
+      echo "disable static libraries"
+    fi
+
+    exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+  # Global variable:
+  tagname="$1"
+
+  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+  # Validate tagname.
+  case $tagname in
+    *[!-_A-Za-z0-9,/]*)
+      func_fatal_error "invalid tag name: $tagname"
+      ;;
+  esac
+
+  # Don't test for the "default" C tag, as we know it's
+  # there but not specially marked.
+  case $tagname in
+    CC) ;;
+    *)
+      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	taglist="$taglist $tagname"
+
+	# Evaluate the configuration.  Be careful to quote the path
+	# and the sed script, to avoid splitting on whitespace, but
+	# also don't use non-portable quotes within backquotes within
+	# quotes we have to do it in 2 steps:
+	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	eval "$extractedcf"
+      else
+	func_error "ignoring unknown tag $tagname"
+      fi
+      ;;
+  esac
+}
+
+# Parse options once, thoroughly.  This comes as soon as possible in
+# the script to make things like `libtool --version' happen quickly.
+{
+
+  # Shorthand for --mode=foo, only valid as the first argument
+  case $1 in
+  clean|clea|cle|cl)
+    shift; set dummy --mode clean ${1+"$@"}; shift
+    ;;
+  compile|compil|compi|comp|com|co|c)
+    shift; set dummy --mode compile ${1+"$@"}; shift
+    ;;
+  execute|execut|execu|exec|exe|ex|e)
+    shift; set dummy --mode execute ${1+"$@"}; shift
+    ;;
+  finish|finis|fini|fin|fi|f)
+    shift; set dummy --mode finish ${1+"$@"}; shift
+    ;;
+  install|instal|insta|inst|ins|in|i)
+    shift; set dummy --mode install ${1+"$@"}; shift
+    ;;
+  link|lin|li|l)
+    shift; set dummy --mode link ${1+"$@"}; shift
+    ;;
+  uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+    shift; set dummy --mode uninstall ${1+"$@"}; shift
+    ;;
+  esac
+
+  # Parse non-mode specific arguments:
+  while test "$#" -gt 0; do
+    opt="$1"
+    shift
+
+    case $opt in
+      --config)		func_config					;;
+
+      --debug)		preserve_args="$preserve_args $opt"
+			func_echo "enabling shell trace mode"
+			opt_debug='set -x'
+			$opt_debug
+			;;
+
+      -dlopen)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			execute_dlfiles="$execute_dlfiles $1"
+			shift
+			;;
+
+      --dry-run | -n)	opt_dry_run=:					;;
+      --features)       func_features					;;
+      --finish)		mode="finish"					;;
+
+      --mode)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			case $1 in
+			  # Valid mode arguments:
+			  clean)	;;
+			  compile)	;;
+			  execute)	;;
+			  finish)	;;
+			  install)	;;
+			  link)		;;
+			  relink)	;;
+			  uninstall)	;;
+
+			  # Catch anything else as an error
+			  *) func_error "invalid argument for $opt"
+			     exit_cmd=exit
+			     break
+			     ;;
+		        esac
+
+			mode="$1"
+			shift
+			;;
+
+      --preserve-dup-deps)
+			opt_duplicate_deps=:				;;
+
+      --quiet|--silent)	preserve_args="$preserve_args $opt"
+			opt_silent=:
+			opt_verbose=false
+			;;
+
+      --no-quiet|--no-silent)
+			preserve_args="$preserve_args $opt"
+			opt_silent=false
+			;;
+
+      --verbose| -v)	preserve_args="$preserve_args $opt"
+			opt_silent=false
+			opt_verbose=:
+			;;
+
+      --no-verbose)	preserve_args="$preserve_args $opt"
+			opt_verbose=false
+			;;
+
+      --tag)		test "$#" -eq 0 && func_missing_arg "$opt" && break
+			preserve_args="$preserve_args $opt $1"
+			func_enable_tag "$1"	# tagname is set here
+			shift
+			;;
+
+      # Separate optargs to long options:
+      -dlopen=*|--mode=*|--tag=*)
+			func_opt_split "$opt"
+			set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+			shift
+			;;
+
+      -\?|-h)		func_usage					;;
+      --help)		opt_help=:					;;
+      --help-all)	opt_help=': help-all'				;;
+      --version)	func_version					;;
+
+      -*)		func_fatal_help "unrecognized option \`$opt'"	;;
+
+      *)		nonopt="$opt"
+			break
+			;;
+    esac
+  done
+
+
+  case $host in
+    *cygwin* | *mingw* | *pw32* | *cegcc*)
+      # don't eliminate duplications in $postdeps and $predeps
+      opt_duplicate_compiler_generated_deps=:
+      ;;
+    *)
+      opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+      ;;
+  esac
+
+  # Having warned about all mis-specified options, bail out if
+  # anything was wrong.
+  $exit_cmd $EXIT_FAILURE
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      fi
+    else
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+    fi
+
+    exit $EXIT_MISMATCH
+  fi
+}
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+$opt_help || {
+  # Sanity checks first:
+  func_check_version_match
+
+  if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+    func_fatal_configuration "not configured to build any kind of library"
+  fi
+
+  test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+
+
+  # Darwin sucks
+  eval std_shrext=\"$shrext_cmds\"
+
+
+  # Only execute mode is allowed to have -dlopen flags.
+  if test -n "$execute_dlfiles" && test "$mode" != execute; then
+    func_error "unrecognized option \`-dlopen'"
+    $ECHO "$help" 1>&2
+    exit $EXIT_FAILURE
+  fi
+
+  # Change the help message to a mode-specific one.
+  generic_help="$help"
+  help="Try \`$progname --help --mode=$mode' for more information."
+}
+
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null \
+        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+	for lalib_p_l in 1 2 3 4
+	do
+	    read lalib_p_line
+	    case "$lalib_p_line" in
+		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+	    esac
+	done
+	exec 0<&5 5<&-
+    fi
+    test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_ltwrapper_scriptname_result=""
+    if func_ltwrapper_executable_p "$1"; then
+	func_dirname_and_basename "$1" "" "."
+	func_stripname '' '.exe' "$func_basename_result"
+	func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+    fi
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $opt_debug
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$save_ifs
+      eval cmd=\"$cmd\"
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $opt_debug
+    case $1 in
+    */* | *\\*)	. "$1" ;;
+    *)		. "./$1" ;;
+    esac
+}
+
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $opt_debug
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+        func_quote_for_eval "$arg"
+	CC_quoted="$CC_quoted $func_quote_for_eval_result"
+      done
+      CC_expanded=`func_echo_all $CC`
+      CC_quoted_expanded=`func_echo_all $CC_quoted`
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	      # Double-quote args containing other shell metacharacters.
+	      func_quote_for_eval "$arg"
+	      CC_quoted="$CC_quoted $func_quote_for_eval_result"
+	    done
+	    CC_expanded=`func_echo_all $CC`
+	    CC_quoted_expanded=`func_echo_all $CC_quoted`
+	    case "$@ " in
+	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  func_echo "unable to infer tagged configuration"
+	  func_fatal_error "specify a tag with \`--tag'"
+#	else
+#	  func_verbose "using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=${1}
+    if test "$build_libtool_libs" = yes; then
+      write_lobj=\'${2}\'
+    else
+      write_lobj=none
+    fi
+
+    if test "$build_old_libs" = yes; then
+      write_oldobj=\'${3}\'
+    else
+      write_oldobj=none
+    fi
+
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+      $MV "${write_libobj}T" "${write_libobj}"
+    }
+}
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $opt_debug
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+    pie_flag=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg="$arg"
+	arg_mode=normal
+	;;
+
+      target )
+	libobj="$arg"
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  test -n "$libobj" && \
+	    func_fatal_error "you cannot specify \`-o' more than once"
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-pie | -fpie | -fPIE)
+          pie_flag="$pie_flag $arg"
+	  continue
+	  ;;
+
+	-shared | -static | -prefer-pic | -prefer-non-pic)
+	  later="$later $arg"
+	  continue
+	  ;;
+
+	-no-suppress)
+	  suppress_opt=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  func_stripname '-Wc,' '' "$arg"
+	  args=$func_stripname_result
+	  lastarg=
+	  save_ifs="$IFS"; IFS=','
+	  for arg in $args; do
+	    IFS="$save_ifs"
+	    func_quote_for_eval "$arg"
+	    lastarg="$lastarg $func_quote_for_eval_result"
+	  done
+	  IFS="$save_ifs"
+	  func_stripname ' ' '' "$lastarg"
+	  lastarg=$func_stripname_result
+
+	  # Add the arguments to base_compile.
+	  base_compile="$base_compile $lastarg"
+	  continue
+	  ;;
+
+	*)
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg="$srcfile"
+	  srcfile="$arg"
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      func_quote_for_eval "$lastarg"
+      base_compile="$base_compile $func_quote_for_eval_result"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      func_fatal_error "you must specify an argument for -Xcompile"
+      ;;
+    target)
+      func_fatal_error "you must specify a target with \`-o'"
+      ;;
+    *)
+      # Get the name of the library object.
+      test -z "$libobj" && {
+	func_basename "$srcfile"
+	libobj="$func_basename_result"
+      }
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    case $libobj in
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
+    esac
+
+    case $libobj in
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+    *)
+      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	continue
+	;;
+
+      -static)
+	build_libtool_libs=no
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+      esac
+    done
+
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
+      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname="$func_basename_result"
+    xdir="$func_dirname_result"
+    lobj=${xdir}$objdir/$objname
+
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	$ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+      removelist="$removelist $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
+    fi
+
+    $opt_dry_run || $RM $removelist
+    removelist="$removelist $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+    if test -n "$fix_srcfile_path"; then
+      eval srcfile=\"$fix_srcfile_path\"
+    fi
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $qsrcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      fi
+
+      func_mkdir_p "$xdir$objdir"
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	command="$command -o $lobj"
+      fi
+
+      func_show_eval_locale "$command"	\
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	func_show_eval '$MV "$output_obj" "$lobj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+	suppress_output=' >/dev/null 2>&1'
+      fi
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $qsrcfile$pie_flag"
+      else
+	command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	command="$command -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      command="$command$suppress_output"
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	func_show_eval '$MV "$output_obj" "$obj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
+
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+      # Unlock the critical section if it was locked
+      if test "$need_locks" != no; then
+	removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+  test "$mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
+
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to build PIC objects only
+  -prefer-non-pic   try to build non-PIC objects only
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
+  -Wc,FLAG          pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+        ;;
+
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
+
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+        ;;
+
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -bindir BINDIR    specify path to binaries directory (for systems where
+                    libraries must be found in the PATH setting at runtime)
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+  -Wc,FLAG
+  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
+  -Wl,FLAG
+  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
+  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode \`$mode'"
+        ;;
+    esac
+
+    echo
+    $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+  if test "$opt_help" = :; then
+    func_mode_help
+  else
+    {
+      func_help noexit
+      for mode in compile link execute install finish uninstall clean; do
+	func_mode_help
+      done
+    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    {
+      func_help noexit
+      for mode in compile link execute install finish uninstall clean; do
+	echo
+	func_mode_help
+      done
+    } |
+    sed '1d
+      /^When reporting/,/^Report/{
+	H
+	d
+      }
+      $x
+      /information about other modes/d
+      /more detailed .*MODE/d
+      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+  fi
+  exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $opt_debug
+    # The first argument is the command name.
+    cmd="$nonopt"
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $execute_dlfiles; do
+      test -f "$file" \
+	|| func_fatal_help "\`$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+	func_source "$file"
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && \
+	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  dir="$dir/$objdir"
+	else
+	  if test ! -f "$dir/$dlname"; then
+	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+	;;
+
+      *)
+	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -* | *.la | *.lo ) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if func_ltwrapper_script_p "$file"; then
+	  func_source "$file"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	elif func_ltwrapper_executable_p "$file"; then
+	  func_ltwrapper_scriptname "$file"
+	  func_source "$func_ltwrapper_scriptname_result"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_quote_for_eval "$file"
+      args="$args $func_quote_for_eval_result"
+    done
+
+    if test "X$opt_dry_run" = Xfalse; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+	eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+	      else
+		$lt_unset $lt_var
+	      fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $opt_debug
+    libdirs="$nonopt"
+    admincmds=
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for dir
+      do
+	libdirs="$libdirs $dir"
+      done
+
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    $opt_silent && exit $EXIT_SUCCESS
+
+    echo "----------------------------------------------------------------------"
+    echo "Libraries have been installed in:"
+    for libdir in $libdirs; do
+      $ECHO "   $libdir"
+    done
+    echo
+    echo "If you ever happen to want to link against installed libraries"
+    echo "in a given directory, LIBDIR, you must either use libtool, and"
+    echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+    echo "flag during linking and do at least one of the following:"
+    if test -n "$shlibpath_var"; then
+      echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+      echo "     during execution"
+    fi
+    if test -n "$runpath_var"; then
+      echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+      echo "     during linking"
+    fi
+    if test -n "$hardcode_libdir_flag_spec"; then
+      libdir=LIBDIR
+      eval flag=\"$hardcode_libdir_flag_spec\"
+
+      $ECHO "   - use the \`$flag' linker flag"
+    fi
+    if test -n "$admincmds"; then
+      $ECHO "   - have your system administrator run these commands:$admincmds"
+    fi
+    if test -f /etc/ld.so.conf; then
+      echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+    fi
+    echo
+
+    echo "See any operating system documentation about shared libraries for"
+    case $host in
+      solaris2.[6789]|solaris2.1[0-9])
+        echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+	echo "pages."
+	;;
+      *)
+        echo "more information, such as the ld(1) and ld.so(8) manual pages."
+        ;;
+    esac
+    echo "----------------------------------------------------------------------"
+    exit $EXIT_SUCCESS
+}
+
+test "$mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $opt_debug
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       case $nonopt in *shtool*) :;; *) false;; esac; then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    install_prog="$install_prog$func_quote_for_eval_result"
+    install_shared_prog=$install_prog
+    case " $install_prog " in
+      *[\\\ /]cp\ *) install_cp=: ;;
+      *) install_cp=false ;;
+    esac
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    no_mode=:
+    for arg
+    do
+      arg2=
+      if test -n "$dest"; then
+	files="$files $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f)
+	if $install_cp; then :; else
+	  prev=$arg
+	fi
+	;;
+      -g | -m | -o)
+	prev=$arg
+	;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
+	    arg2=$install_override_mode
+	    no_mode=false
+	  fi
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      install_prog="$install_prog $func_quote_for_eval_result"
+      if test -n "$arg2"; then
+	func_quote_for_eval "$arg2"
+      fi
+      install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prev' option requires an argument"
+
+    if test -n "$install_override_mode" && $no_mode; then
+      if $install_cp; then :; else
+	func_quote_for_eval "$install_override_mode"
+	install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
+      fi
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	func_fatal_help "no file or destination specified"
+      else
+	func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir="$func_dirname_result"
+      destname="$func_basename_result"
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+	func_fatal_help "\`$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	staticlibs="$staticlibs $file"
+	;;
+
+      *.la)
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$file' is not a valid libtool archive"
+
+	library_names=
+	old_library=
+	relink_command=
+	func_source "$file"
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) current_libdirs="$current_libdirs $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) future_libdirs="$future_libdirs $libdir" ;;
+	  esac
+	fi
+
+	func_dirname "$file" "/" ""
+	dir="$func_dirname_result"
+	dir="$dir$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  test "$inst_prefix_dir" = "$destdir" && \
+	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  func_warning "relinking \`$file'"
+	  func_show_eval "$relink_command" \
+	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names; shift
+	if test -n "$1"; then
+	  realname="$1"
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+	      'exit $?'
+	  tstripme="$stripme"
+	  case $host_os in
+	  cygwin* | mingw* | pw32* | cegcc*)
+	    case $realname in
+	    *.dll.a)
+	      tstripme=""
+	      ;;
+	    esac
+	    ;;
+	  esac
+	  if test -n "$tstripme" && test -n "$striplib"; then
+	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      test "$linkname" != "$realname" \
+		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  func_execute_cmds "$postinstall_cmds" 'exit $?'
+	fi
+
+	# Install the pseudo-library for information purposes.
+	func_basename "$file"
+	name="$func_basename_result"
+	instname="$dir/$name"i
+	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  func_lo2o "$destfile"
+	  staticdest=$func_lo2o_result
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	test -n "$destfile" && \
+	  func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  func_lo2o "$file"
+	  staticobj=$func_lo2o_result
+	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      func_stripname '' '.exe' "$file"
+	      file=$func_stripname_result
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin* | *mingw*)
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      wrapper=$func_ltwrapper_scriptname_result
+	    else
+	      func_stripname '' '.exe' "$file"
+	      wrapper=$func_stripname_result
+	    fi
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if func_ltwrapper_script_p "$wrapper"; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  func_source "$wrapper"
+
+	  # Check the variables that should have been set.
+	  test -z "$generated_by_libtool_version" && \
+	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      func_source "$lib"
+	    fi
+	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      func_warning "\`$lib' has not been installed in \`$libdir'"
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  func_source "$wrapper"
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    $opt_dry_run || {
+	      if test "$finalize" = yes; then
+	        tmpdir=`func_mktempdir`
+		func_basename "$file$stripped_ext"
+		file="$func_basename_result"
+	        outputname="$tmpdir/$file"
+	        # Replace the output file specification.
+	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+	        $opt_silent || {
+	          func_quote_for_expand "$relink_command"
+		  eval "func_echo $func_quote_for_expand_result"
+	        }
+	        if eval "$relink_command"; then :
+	          else
+		  func_error "error: relink \`$file' with the above command before installing it"
+		  $opt_dry_run || ${RM}r "$tmpdir"
+		  continue
+	        fi
+	        file="$outputname"
+	      else
+	        func_warning "cannot relink \`$file'"
+	      fi
+	    }
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    func_stripname '' '.exe' "$destfile"
+	    destfile=$func_stripname_result
+	    ;;
+	  esac
+	  ;;
+	esac
+	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+	$opt_dry_run || if test -n "$outputname"; then
+	  ${RM}r "$tmpdir"
+	fi
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name="$func_basename_result"
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+
+      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	func_show_eval "$old_striplib $oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $opt_debug
+    my_outputname="$1"
+    my_originator="$2"
+    my_pic_p="${3-no}"
+    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	my_dlsyms="${my_outputname}S.c"
+      else
+	func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+	# Discover the nlist of each of the dlfiles.
+	nlist="$output_objdir/${my_outputname}.nm"
+
+	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+	# Parse the name list into a source file.
+	func_verbose "creating $output_objdir/$my_dlsyms"
+
+	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+	if test "$dlself" = yes; then
+	  func_verbose "generating symbol list for \`$output'"
+
+	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+	  # Add our own program objects to the symbol list.
+	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	  for progfile in $progfiles; do
+	    func_verbose "extracting global C symbols from \`$progfile'"
+	    $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -n "$exclude_expsyms"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  if test -n "$export_symbols_regex"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  # Prepare the list of exported symbols
+	  if test -z "$export_symbols"; then
+	    export_symbols="$output_objdir/$outputname.exp"
+	    $opt_dry_run || {
+	      $RM $export_symbols
+	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      case $host in
+	      *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+	        ;;
+	      esac
+	    }
+	  else
+	    $opt_dry_run || {
+	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	      case $host in
+	        *cygwin* | *mingw* | *cegcc* )
+	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+	          ;;
+	      esac
+	    }
+	  fi
+	fi
+
+	for dlprefile in $dlprefiles; do
+	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_basename "$dlprefile"
+	  name="$func_basename_result"
+	  $opt_dry_run || {
+	    eval '$ECHO ": $name " >> "$nlist"'
+	    eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	  }
+	done
+
+	$opt_dry_run || {
+	  # Make sure we have at least an empty file.
+	  test -f "$nlist" || : > "$nlist"
+
+	  if test -n "$exclude_expsyms"; then
+	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	    $MV "$nlist"T "$nlist"
+	  fi
+
+	  # Try sorting and uniquifying the output.
+	  if $GREP -v "^: " < "$nlist" |
+	      if sort -k 3 </dev/null >/dev/null 2>&1; then
+		sort -k 3
+	      else
+		sort +2
+	      fi |
+	      uniq > "$nlist"S; then
+	    :
+	  else
+	    $GREP -v "^: " < "$nlist" > "$nlist"S
+	  fi
+
+	  if test -f "$nlist"S; then
+	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+	  else
+	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+	  fi
+
+	  echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+"
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc* )
+	    echo >> "$output_objdir/$my_dlsyms" "\
+/* DATA imports from DLLs on WIN32 con't be const, because
+   runtime relocations are performed -- see ld's documentation
+   on pseudo-relocs.  */"
+	    lt_dlsym_const= ;;
+	  *osf5*)
+	    echo >> "$output_objdir/$my_dlsyms" "\
+/* This system does not cope well with relocations in const data */"
+	    lt_dlsym_const= ;;
+	  *)
+	    lt_dlsym_const=const ;;
+	  esac
+
+	  echo >> "$output_objdir/$my_dlsyms" "\
+extern $lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+$lt_dlsym_const lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+  { \"$my_originator\", (void *) 0 },"
+
+	  case $need_lib_prefix in
+	  no)
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  *)
+	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  esac
+	  echo >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	} # !$opt_dry_run
+
+	pic_flag_for_symtable=
+	case "$compile_command " in
+	*" -static "*) ;;
+	*)
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+	  *-*-hpux*)
+	    pic_flag_for_symtable=" $pic_flag"  ;;
+	  *)
+	    if test "X$my_pic_p" != Xno; then
+	      pic_flag_for_symtable=" $pic_flag"
+	    fi
+	    ;;
+	  esac
+	  ;;
+	esac
+	symtab_cflags=
+	for arg in $LTCFLAGS; do
+	  case $arg in
+	  -pie | -fpie | -fPIE) ;;
+	  *) symtab_cflags="$symtab_cflags $arg" ;;
+	  esac
+	done
+
+	# Now compile the dynamic symbol file.
+	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+	# Clean up the generated files.
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+	# Transform the symbol file into the correct name.
+	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	case $host in
+	*cygwin* | *mingw* | *cegcc* )
+	  if test -f "$output_objdir/$my_outputname.def"; then
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	  else
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  fi
+	  ;;
+	*)
+	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  ;;
+	esac
+	;;
+      *)
+	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+  $opt_debug
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+      win32_nmres=`eval $NM -f posix -A $1 |
+	$SED -n -e '
+	    1,100{
+		/ I /{
+		    s,.*,import,
+		    p
+		    q
+		}
+	    }'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $opt_debug
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    if test "$lock_old_archive_extraction" = yes; then
+      lockfile=$f_ex_an_ar_oldlib.lock
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    fi
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+		   'stat=$?; rm -f "$lockfile"; exit $stat'
+    if test "$lock_old_archive_extraction" = yes; then
+      $opt_dry_run || rm -f "$lockfile"
+    fi
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $opt_debug
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib="$func_basename_result"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+	*" $my_xlib_u "*)
+	  func_arith $extracted_serial + 1
+	  extracted_serial=$func_arith_result
+	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
+	*) break ;;
+	esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+	func_verbose "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	$opt_dry_run || {
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  darwin_base_archive=`basename "$darwin_archive"`
+	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+	  if test -n "$darwin_arches"; then
+	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches ; do
+	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	      cd "$darwin_curdir"
+	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	    done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+	      $LIPO -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    $RM -rf unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd $darwin_orig_dir
+	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	} # !$opt_dry_run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+	;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+    done
+
+    func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+	func_emit_wrapper_arg1=${1-no}
+
+	$ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    file=\"\$0\""
+
+    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+    ECHO=\"$qECHO\"
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=\$0
+  shift
+  for lt_opt
+  do
+    case \"\$lt_opt\" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+        cat \"\$lt_dump_D/\$lt_dump_F\"
+        exit 0
+      ;;
+    --lt-*)
+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n \"\$lt_option_debug\"; then
+    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  for lt_wr_arg
+  do
+    case \$lt_wr_arg in
+    --lt-*) ;;
+    *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+    esac
+    shift
+  done
+  func_exec_program_core \${1+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+  done
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+	  $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$ECHO \"\$relink_command_output\" >&2
+	$RM \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+	else
+	  $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	# fixup the dll searchpath if we need to.
+	if test -n "$dllsearchpath"; then
+	  $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	$ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+      func_exec_program \${1+\"\$@\"}
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+
+
+# func_to_host_path arg
+#
+# Convert paths to host format when used with build tools.
+# Intended for use with "native" mingw (where libtool itself
+# is running under the msys shell), or in the following cross-
+# build environments:
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+# where wine is equipped with the `winepath' executable.
+# In the native mingw case, the (msys) shell automatically
+# converts paths for any non-msys applications it launches,
+# but that facility isn't available from inside the cwrapper.
+# Similar accommodations are necessary for $host mingw and
+# $build cygwin.  Calling this function does no harm for other
+# $host/$build combinations not listed above.
+#
+# ARG is the path (on $build) that should be converted to
+# the proper representation for $host. The result is stored
+# in $func_to_host_path_result.
+func_to_host_path ()
+{
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    case $host in
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        case $build in
+          *mingw* ) # actually, msys
+            # awkward: cmd appends spaces to result
+            func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
+              $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_path_result=`cygpath -w "$1" |
+	      $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # Unfortunately, winepath does not exit with a non-zero
+            # error code, so we are forced to check the contents of
+            # stdout. On the other hand, if the command is not
+            # found, the shell will set an exit code of 127 and print
+            # *an error message* to stdout. So we must check for both
+            # error code of zero AND non-empty stdout, which explains
+            # the odd construction:
+            func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
+            if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
+              func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
+                $SED -e "$lt_sed_naive_backslashify"`
+            else
+              # Allow warning below.
+              func_to_host_path_result=
+            fi
+            ;;
+        esac
+        if test -z "$func_to_host_path_result" ; then
+          func_error "Could not determine host path corresponding to"
+          func_error "  \`$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback:
+          func_to_host_path_result="$1"
+        fi
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_path
+
+# func_to_host_pathlist arg
+#
+# Convert pathlists to host format when used with build tools.
+# See func_to_host_path(), above. This function supports the
+# following $build/$host combinations (but does no harm for
+# combinations not listed here):
+#    $build          $host
+#    mingw (msys)    mingw  [e.g. native]
+#    cygwin          mingw
+#    *nix + wine     mingw
+#
+# Path separators are also converted from $build format to
+# $host format. If ARG begins or ends with a path separator
+# character, it is preserved (but converted to $host format)
+# on output.
+#
+# ARG is a pathlist (on $build) that should be converted to
+# the proper representation on $host. The result is stored
+# in $func_to_host_pathlist_result.
+func_to_host_pathlist ()
+{
+  func_to_host_pathlist_result="$1"
+  if test -n "$1"; then
+    case $host in
+      *mingw* )
+        lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+        # Remove leading and trailing path separator characters from
+        # ARG. msys behavior is inconsistent here, cygpath turns them
+        # into '.;' and ';.', and winepath ignores them completely.
+	func_stripname : : "$1"
+        func_to_host_pathlist_tmp1=$func_stripname_result
+        case $build in
+          *mingw* ) # Actually, msys.
+            # Awkward: cmd appends spaces to result.
+            func_to_host_pathlist_result=`
+	      ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
+	      $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+            ;;
+          *cygwin* )
+            func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
+              $SED -e "$lt_sed_naive_backslashify"`
+            ;;
+          * )
+            # unfortunately, winepath doesn't convert pathlists
+            func_to_host_pathlist_result=""
+            func_to_host_pathlist_oldIFS=$IFS
+            IFS=:
+            for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
+              IFS=$func_to_host_pathlist_oldIFS
+              if test -n "$func_to_host_pathlist_f" ; then
+                func_to_host_path "$func_to_host_pathlist_f"
+                if test -n "$func_to_host_path_result" ; then
+                  if test -z "$func_to_host_pathlist_result" ; then
+                    func_to_host_pathlist_result="$func_to_host_path_result"
+                  else
+                    func_append func_to_host_pathlist_result ";$func_to_host_path_result"
+                  fi
+                fi
+              fi
+            done
+            IFS=$func_to_host_pathlist_oldIFS
+            ;;
+        esac
+        if test -z "$func_to_host_pathlist_result"; then
+          func_error "Could not determine the host path(s) corresponding to"
+          func_error "  \`$1'"
+          func_error "Continuing, but uninstalled executables may not work."
+          # Fallback. This may break if $1 contains DOS-style drive
+          # specifications. The fix is not to complicate the expression
+          # below, but for the user to provide a working wine installation
+          # with winepath so that path translation in the cross-to-mingw
+          # case works properly.
+          lt_replace_pathsep_nix_to_dos="s|:|;|g"
+          func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
+            $SED -e "$lt_replace_pathsep_nix_to_dos"`
+        fi
+        # Now, add the leading and trailing path separators back
+        case "$1" in
+          :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
+            ;;
+        esac
+        case "$1" in
+          *: ) func_append func_to_host_pathlist_result ";"
+            ;;
+        esac
+        ;;
+    esac
+  fi
+}
+# end: func_to_host_pathlist
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+	cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+*/
+EOF
+	    cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+#  define _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+	    cat <<EOF
+const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_pathlist "$temp_rpath"
+	      cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test -n "$dllsearchpath"; then
+              func_to_host_pathlist "$dllsearchpath:"
+	      cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_pathlist_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test "$fast_install" = yes; then
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+	    else
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+	    fi
+
+
+	    cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  intptr_t rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  newargz = XMALLOC (char *, argc + 1);
+
+  /* very simple arg parsing; don't want to rely on getopt
+   * also, copy all non cwrapper options to newargz, except
+   * argz[0], which is handled differently
+   */
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (strcmp (argv[i], dumpscript_opt) == 0)
+	{
+EOF
+	    case "$host" in
+	      *mingw* | *cygwin* )
+		# make stdout use "unix" line endings
+		echo "          setmode(1,_O_BINARY);"
+		;;
+	      esac
+
+	    cat <<"EOF"
+	  lt_dump_script (stdout);
+	  return 0;
+	}
+      if (strcmp (argv[i], debug_opt) == 0)
+	{
+          lt_debug = 1;
+          continue;
+	}
+      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal (__FILE__, __LINE__,
+		    "unrecognized %s option: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+EOF
+	    cat <<EOF
+  /* The GNU banner must be the first non-error debug message */
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+	    cat <<"EOF"
+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (before symlink chase) at: %s\n",
+		  tmp_pathspec);
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (after symlink chase) at: %s\n",
+		  actual_cwrapper_path);
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(main) libtool target name: %s\n",
+		  target_name);
+EOF
+
+	    cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+	    cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+	    case $host_os in
+	      mingw*)
+	    cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+	*p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+	*p = '/';
+      }
+  }
+EOF
+	    ;;
+	    esac
+
+	    cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+
+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+		  nonnull (lt_argv_zero));
+  for (i = 0; i < newargc; i++)
+    {
+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+		      i, nonnull (newargz[i]));
+    }
+
+EOF
+
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  newargz = prepare_spawn (newargz);
+  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      lt_debugprintf (__FILE__, __LINE__,
+		      "(main) failed to launch target \"%s\": %s\n",
+		      lt_argv_zero, nonnull (strerror (errno)));
+      return 127;
+    }
+  return rval;
+EOF
+		;;
+	      *)
+		cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+		;;
+	    esac
+
+	    cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+			  string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char *concat_name;
+
+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+                  nonempty (wrapper));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+	return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+	{
+	  concat_name = xstrdup (wrapper);
+	  if (check_executable (concat_name))
+	    return concat_name;
+	  XFREE (concat_name);
+	}
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+	has_slash = 1;
+	break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+	{
+	  for (p = path; *p; p = p_next)
+	    {
+	      const char *q;
+	      size_t p_len;
+	      for (q = p; *q; q++)
+		if (IS_PATH_SEPARATOR (*q))
+		  break;
+	      p_len = q - p;
+	      p_next = (*q == '\0' ? q : q + 1);
+	      if (p_len == 0)
+		{
+		  /* empty path: current directory */
+		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+                              nonnull (strerror (errno)));
+		  tmp_len = strlen (tmp);
+		  concat_name =
+		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, tmp, tmp_len);
+		  concat_name[tmp_len] = '/';
+		  strcpy (concat_name + tmp_len + 1, wrapper);
+		}
+	      else
+		{
+		  concat_name =
+		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, p, p_len);
+		  concat_name[p_len] = '/';
+		  strcpy (concat_name + p_len + 1, wrapper);
+		}
+	      if (check_executable (concat_name))
+		return concat_name;
+	      XFREE (concat_name);
+	    }
+	}
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+              nonnull (strerror (errno)));
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      lt_debugprintf (__FILE__, __LINE__,
+		      "checking path component for symlinks: %s\n",
+		      tmp_pathspec);
+      if (lstat (tmp_pathspec, &s) == 0)
+	{
+	  if (S_ISLNK (s.st_mode) != 0)
+	    {
+	      has_symlinks = 1;
+	      break;
+	    }
+
+	  /* search backwards for last DIR_SEPARATOR */
+	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    p--;
+	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    {
+	      /* no more DIR_SEPARATORS left */
+	      break;
+	    }
+	  *p = '\0';
+	}
+      else
+	{
+	  lt_fatal (__FILE__, __LINE__,
+		    "error accessing file \"%s\": %s",
+		    tmp_pathspec, nonnull (strerror (errno)));
+	}
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal (__FILE__, __LINE__,
+		"could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (strcmp (str, pat) == 0)
+	*str = '\0';
+    }
+  return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+  va_list args;
+  if (lt_debug)
+    {
+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+      va_start (args, fmt);
+      (void) vfprintf (stderr, fmt, args);
+      va_end (args);
+    }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+	       int line, const char *mode,
+	       const char *message, va_list ap)
+{
+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+  va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+  return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+  return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_setenv) setting '%s' to '%s'\n",
+                  nonnull (name), nonnull (value));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    int len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      int orig_value_len = strlen (orig_value);
+      int add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      int len = strlen (new_value);
+      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[len-1] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+EOF
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+  size_t argc;
+  char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = XMALLOC (char *, argc + 1);
+
+  /* Put quoted arguments into the new argument vector.  */
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      if (string[0] == '\0')
+	new_argv[i] = xstrdup ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+	{
+	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+	  size_t length;
+	  unsigned int backslashes;
+	  const char *s;
+	  char *quoted_string;
+	  char *p;
+
+	  length = 0;
+	  backslashes = 0;
+	  if (quote_around)
+	    length++;
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		length += backslashes + 1;
+	      length++;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    length += backslashes + 1;
+
+	  quoted_string = XMALLOC (char, length + 1);
+
+	  p = quoted_string;
+	  backslashes = 0;
+	  if (quote_around)
+	    *p++ = '"';
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		{
+		  unsigned int j;
+		  for (j = backslashes + 1; j > 0; j--)
+		    *p++ = '\\';
+		}
+	      *p++ = c;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    {
+	      unsigned int j;
+	      for (j = backslashes; j > 0; j--)
+		*p++ = '\\';
+	      *p++ = '"';
+	    }
+	  *p = '\0';
+
+	  new_argv[i] = quoted_string;
+	}
+      else
+	new_argv[i] = (char *) string;
+    }
+  new_argv[argc] = NULL;
+
+  return new_argv;
+}
+EOF
+		;;
+	    esac
+
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+	    func_emit_wrapper yes |
+              $SED -e 's/\([\\"]\)/\\\1/g' \
+	           -e 's/^/  fputs ("/' -e 's/$/\\n", f);/'
+
+            cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+    $opt_debug
+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+    *import*) : ;;
+    *) false ;;
+    esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $opt_debug
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args=$nonopt
+    base_compile="$nonopt $@"
+    compile_command=$nonopt
+    finalize_command=$nonopt
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+    new_inherited_linker_flags=
+
+    avoid_version=no
+    bindir=
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+    weak_libs=
+    single_module="${wl}-single_module"
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	break
+	;;
+      -all-static | -static | -static-libtool-libs)
+	case $arg in
+	-all-static)
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    func_warning "complete static linking is impossible in this configuration"
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	-static)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=built
+	  ;;
+	-static-libtool-libs)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	esac
+	build_libtool_libs=no
+	build_old_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  func_append compile_command " @OUTPUT@"
+	  func_append finalize_command " @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	bindir)
+	  bindir="$arg"
+	  prev=
+	  continue
+	  ;;
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    func_append compile_command " @SYMFILE@"
+	    func_append finalize_command " @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      dlfiles="$dlfiles $arg"
+	    else
+	      dlprefiles="$dlprefiles $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  test -f "$arg" \
+	    || func_fatal_error "symbol file \`$arg' does not exist"
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+		*" $qarg.ltframework "*) ;;
+		*) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+		   ;;
+	      esac
+	      ;;
+	  esac
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat "$save_arg"`
+	    do
+#	      moreargs="$moreargs $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if func_lalib_unsafe_p "$arg"; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		func_source "$arg"
+
+		if test -z "$pic_object" ||
+		   test -z "$non_pic_object" ||
+		   test "$pic_object" = none &&
+		   test "$non_pic_object" = none; then
+		  func_fatal_error "cannot find name of object for \`$arg'"
+		fi
+
+		# Extract subdirectory from the argument.
+		func_dirname "$arg" "/" ""
+		xdir="$func_dirname_result"
+
+		if test "$pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object="$xdir$pic_object"
+
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		      dlfiles="$dlfiles $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test "$prev" = dlprefiles; then
+		    # Preload the old-style object.
+		    dlprefiles="$dlprefiles $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  func_append libobjs " $pic_object"
+		  arg="$pic_object"
+		fi
+
+		# Non-PIC object.
+		if test "$non_pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object="$xdir$non_pic_object"
+
+		  # A standard non-PIC object
+		  func_append non_pic_objects " $non_pic_object"
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
+		  fi
+		else
+		  # If the PIC object exists, use it instead.
+		  # $xdir was prepended to $pic_object above.
+		  non_pic_object="$pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if $opt_dry_run; then
+		  # Extract subdirectory from the argument.
+		  func_dirname "$arg" "/" ""
+		  xdir="$func_dirname_result"
+
+		  func_lo2o "$arg"
+		  pic_object=$xdir$objdir/$func_lo2o_result
+		  non_pic_object=$xdir$func_lo2o_result
+		  func_append libobjs " $pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+	        else
+		  func_fatal_error "\`$arg' is not a valid libtool object"
+		fi
+	      fi
+	    done
+	  else
+	    func_fatal_error "link input file \`$arg' does not exist"
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	precious_regex)
+	  precious_files_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    func_fatal_error "only absolute run-paths are allowed"
+	    ;;
+	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) rpath="$rpath $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) xrpath="$xrpath $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	shrext)
+	  shrext_cmds="$arg"
+	  prev=
+	  continue
+	  ;;
+	weak)
+	  weak_libs="$weak_libs $arg"
+	  prev=
+	  continue
+	  ;;
+	xcclinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xcompiler)
+	  compiler_flags="$compiler_flags $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  linker_flags="$linker_flags $qarg"
+	  compiler_flags="$compiler_flags $wl$qarg"
+	  prev=
+	  func_append compile_command " $wl$qarg"
+	  func_append finalize_command " $wl$qarg"
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  # See comment for -static flag below, for more details.
+	  func_append compile_command " $link_static_flag"
+	  func_append finalize_command " $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -bindir)
+	prev=bindir
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  func_fatal_error "more than one -exported-symbols argument is not allowed"
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -framework)
+	prev=framework
+	continue
+	;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	func_stripname '-L' '' "$arg"
+	dir=$func_stripname_result
+	if test -z "$dir"; then
+	  if test "$#" -gt 0; then
+	    func_fatal_error "require no space between \`-L' and \`$1'"
+	  else
+	    func_fatal_error "need path for \`-L' option"
+	  fi
+	fi
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  test -z "$absdir" && \
+	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "*) ;;
+	*)
+	  deplibs="$deplibs -L$dir"
+	  lib_search_path="$lib_search_path $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  ::) dllsearchpath=$dir;;
+	  *) dllsearchpath="$dllsearchpath:$dir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    deplibs="$deplibs System.ltframework"
+	    continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  esac
+	elif test "X$arg" = "X-lc_r"; then
+	 case $host in
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	deplibs="$deplibs $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot)
+	compiler_flags="$compiler_flags $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	prev=xcompiler
+	continue
+	;;
+
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+	compiler_flags="$compiler_flags $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	case "$new_inherited_linker_flags " in
+	    *" $arg "*) ;;
+	    * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+	esac
+	continue
+	;;
+
+      -multi_module)
+	single_module="${wl}-multi_module"
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # and Darwin in order for the loader to find any dlls it needs.
+	  func_warning "\`-no-install' is ignored for $host"
+	  func_warning "assuming \`-no-fast-install' instead"
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+	prev=precious_regex
+	continue
+	;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	func_stripname '-R' '' "$arg"
+	dir=$func_stripname_result
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  func_fatal_error "only absolute run-paths are allowed"
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) xrpath="$xrpath $dir" ;;
+	esac
+	continue
+	;;
+
+      -shared)
+	# The effects of -shared are defined in a previous loop.
+	continue
+	;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -static | -static-libtool-libs)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -weak)
+        prev=weak
+	continue
+	;;
+
+      -Wc,*)
+	func_stripname '-Wc,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+	  arg="$arg $func_quote_for_eval_result"
+	  compiler_flags="$compiler_flags $func_quote_for_eval_result"
+	done
+	IFS="$save_ifs"
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Wl,*)
+	func_stripname '-Wl,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+	  arg="$arg $wl$func_quote_for_eval_result"
+	  compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
+	  linker_flags="$linker_flags $func_quote_for_eval_result"
+	done
+	IFS="$save_ifs"
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      # -msg_* for osf cc
+      -msg_*)
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      # Flags to be passed through unchanged, with rationale:
+      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
+      # -r[0-9][0-9]*        specify processor for the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+      # +DA*, +DD*           enable 64-bit mode for the HP compiler
+      # -q*                  compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+      # -F/path              path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # @file                GCC response files
+      # -tp=*                Portland pgcc target processor selection
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        compiler_flags="$compiler_flags $arg"
+        continue
+        ;;
+
+      # Some other compiler flag.
+      -* | +*)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      *.$objext)
+	# A standard object.
+	objs="$objs $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if func_lalib_unsafe_p "$arg"; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  func_source "$arg"
+
+	  if test -z "$pic_object" ||
+	     test -z "$non_pic_object" ||
+	     test "$pic_object" = none &&
+	     test "$non_pic_object" = none; then
+	    func_fatal_error "cannot find name of object for \`$arg'"
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  func_dirname "$arg" "/" ""
+	  xdir="$func_dirname_result"
+
+	  if test "$pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		dlfiles="$dlfiles $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      dlprefiles="$dlprefiles $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    func_append libobjs " $pic_object"
+	    arg="$pic_object"
+	  fi
+
+	  # Non-PIC object.
+	  if test "$non_pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+	    # A standard non-PIC object
+	    func_append non_pic_objects " $non_pic_object"
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
+	    fi
+	  else
+	    # If the PIC object exists, use it instead.
+	    # $xdir was prepended to $pic_object above.
+	    non_pic_object="$pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if $opt_dry_run; then
+	    # Extract subdirectory from the argument.
+	    func_dirname "$arg" "/" ""
+	    xdir="$func_dirname_result"
+
+	    func_lo2o "$arg"
+	    pic_object=$xdir$objdir/$func_lo2o_result
+	    non_pic_object=$xdir$func_lo2o_result
+	    func_append libobjs " $pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  else
+	    func_fatal_error "\`$arg' is not a valid libtool object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	deplibs="$deplibs $arg"
+	old_deplibs="$old_deplibs $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  dlfiles="$dlfiles $arg"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  dlprefiles="$dlprefiles $arg"
+	  prev=
+	else
+	  deplibs="$deplibs $arg"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+      fi
+    done # argument parsing loop
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prevarg' option requires an argument"
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    func_basename "$output"
+    outputname="$func_basename_result"
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    func_dirname "$output" "/" ""
+    output_objdir="$func_dirname_result$objdir"
+    # Create the object directory.
+    func_mkdir_p "$output_objdir"
+
+    # Determine the type of output
+    case $output in
+    "")
+      func_fatal_help "you must specify an output file"
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if $opt_duplicate_deps ; then
+	case "$libs " in
+	*" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	esac
+      fi
+      libs="$libs $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if $opt_duplicate_compiler_generated_deps; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+	  esac
+	  pre_post_deps="$pre_post_deps $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+
+    case $linkmode in
+    lib)
+	passes="conv dlpreopen link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+
+    for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test "$linkmode,$pass" = "lib,link"; then
+	## FIXME: Find the place where the list is rebuilt in the wrong
+	##        order, and fix it there properly
+        tmp_deplibs=
+	for deplib in $deplibs; do
+	  tmp_deplibs="$deplib $tmp_deplibs"
+	done
+	deplibs="$tmp_deplibs"
+      fi
+
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test "$linkmode" = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+	# Collect and forward deplibs of preopened libtool libs
+	for lib in $dlprefiles; do
+	  # Ignore non-libtool-libs
+	  dependency_libs=
+	  case $lib in
+	  *.la)	func_source "$lib" ;;
+	  esac
+
+	  # Collect preopened libtool deplibs, except any this library
+	  # has declared as weak libs
+	  for deplib in $dependency_libs; do
+	    func_basename "$deplib"
+            deplib_base=$func_basename_result
+	    case " $weak_libs " in
+	    *" $deplib_base "*) ;;
+	    *) deplibs="$deplibs $deplib" ;;
+	    esac
+	  done
+	done
+	libs="$dlprefiles"
+      fi
+      if test "$pass" = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    compiler_flags="$compiler_flags $deplib"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-l*)
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    func_warning "\`-l' is ignored for archives/objects"
+	    continue
+	  fi
+	  func_stripname '-l' '' "$deplib"
+	  name=$func_stripname_result
+	  if test "$linkmode" = lib; then
+	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+	  else
+	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+	  fi
+	  for searchdir in $searchdirs; do
+	    for search_ext in .la $std_shrext .so .a; do
+	      # Search the libtool library
+	      lib="$searchdir/lib${name}${search_ext}"
+	      if test -f "$lib"; then
+		if test "$search_ext" = ".la"; then
+		  found=yes
+		else
+		  found=no
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  else # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if func_lalib_p "$lib"; then
+		  library_names=
+		  old_library=
+		  func_source "$lib"
+		  for l in $old_library $library_names; do
+		    ll="$l"
+		  done
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
+		    func_dirname "$lib" "" "."
+		    ladir="$func_dirname_result"
+		    lib=$ladir/$old_library
+		    if test "$linkmode,$pass" = "prog,link"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+		;;
+	      *) ;;
+	      esac
+	    fi
+	  fi
+	  ;; # -l
+	*.ltframework)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test "$pass" = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    func_stripname '-L' '' "$deplib"
+	    newlib_search_path="$newlib_search_path $func_stripname_result"
+	    ;;
+	  prog)
+	    if test "$pass" = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test "$pass" = scan; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    func_stripname '-L' '' "$deplib"
+	    newlib_search_path="$newlib_search_path $func_stripname_result"
+	    ;;
+	  *)
+	    func_warning "\`-L' is ignored for archives/objects"
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test "$pass" = link; then
+	    func_stripname '-R' '' "$deplib"
+	    dir=$func_stripname_result
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) xrpath="$xrpath $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la) lib="$deplib" ;;
+	*.$libext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    # Linking convenience modules into shared libraries is allowed,
+	    # but linking other static libraries is non-portable.
+	    case " $dlpreconveniencelibs " in
+	    *" $deplib "*) ;;
+	    *)
+	      valid_a_lib=no
+	      case $deplibs_check_method in
+		match_pattern*)
+		  set dummy $deplibs_check_method; shift
+		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+		    | $EGREP "$match_pattern_regex" > /dev/null; then
+		    valid_a_lib=yes
+		  fi
+		;;
+		pass_all)
+		  valid_a_lib=yes
+		;;
+	      esac
+	      if test "$valid_a_lib" != yes; then
+		echo
+		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because the file extensions .$libext of this argument makes me believe"
+		echo "*** that it is just a static archive that I should not use here."
+	      else
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      fi
+	      ;;
+	    esac
+	    continue
+	    ;;
+	  prog)
+	    if test "$pass" != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      newdlprefiles="$newdlprefiles $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      newdlfiles="$newdlfiles $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
+
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+	fi
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$lib" \
+	  || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+	func_dirname "$lib" "" "."
+	ladir="$func_dirname_result"
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	inherited_linker_flags=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+	avoidtemprpath=
+
+
+	# Read the .la file
+	func_source "$lib"
+
+	# Convert "-framework foo" to "foo.ltframework"
+	if test -n "$inherited_linker_flags"; then
+	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+	    case " $new_inherited_linker_flags " in
+	      *" $tmp_inherited_linker_flag "*) ;;
+	      *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+	    esac
+	  done
+	fi
+	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	  test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
+	  test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+	fi
+
+	if test "$pass" = conv; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      func_fatal_error "cannot find name of link library for \`$lib'"
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    convenience="$convenience $ladir/$objdir/$old_library"
+	    old_convenience="$old_convenience $ladir/$objdir/$old_library"
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    func_fatal_error "\`$lib' is not a convenience library"
+	  fi
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    deplibs="$deplib $deplibs"
+	    if $opt_duplicate_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+	  continue
+	fi # $pass = conv
+
+
+	# Get the name of the library we link against.
+	linklib=
+	for l in $old_library $library_names; do
+	  linklib="$l"
+	done
+	if test -z "$linklib"; then
+	  func_fatal_error "cannot find name of link library for \`$lib'"
+	fi
+
+	# This library was specified with -dlopen.
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+	  fi
+	  if test -z "$dlname" ||
+	     test "$dlopen_support" != yes ||
+	     test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    dlprefiles="$dlprefiles $lib $dependency_libs"
+	  else
+	    newdlfiles="$newdlfiles $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "passing it literally to the linker, although it might fail"
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	func_basename "$lib"
+	laname="$func_basename_result"
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    func_warning "library \`$lib' was moved."
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$libdir"
+	    absdir="$libdir"
+	  fi
+	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	else
+	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  else
+	    dir="$ladir/$objdir"
+	    absdir="$abs_ladir/$objdir"
+	    # Remove this search path later
+	    notinst_path="$notinst_path $abs_ladir"
+	  fi
+	fi # $installed = yes
+	func_stripname 'lib' '.la' "$laname"
+	name=$func_stripname_result
+
+	# This library was specified with -dlpreopen.
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir" && test "$linkmode" = prog; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+	  fi
+	  # Prefer using a static library (so that no silly _DYNAMIC symbols
+	  # are required to link).
+	  if test -n "$old_library"; then
+	    newdlprefiles="$newdlprefiles $dir/$old_library"
+	    # Keep a list of preopened convenience libraries to check
+	    # that they are being used correctly in the link pass.
+	    test -z "$libdir" && \
+		dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
+	  # Otherwise, use the dlname, so that lt_dlopen finds it.
+	  elif test -n "$dlname"; then
+	    newdlprefiles="$newdlprefiles $dir/$dlname"
+	  else
+	    newdlprefiles="$newdlprefiles $dir/$linklib"
+	  fi
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test "$linkmode" = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+
+	if test "$linkmode" = prog && test "$pass" != link; then
+	  newlib_search_path="$newlib_search_path $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) func_stripname '-L' '' "$deplib"
+	         newlib_search_path="$newlib_search_path $func_stripname_result"
+		 ;;
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test "$linkalldeplibs" = yes; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if $opt_duplicate_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+	     { { test "$prefer_static_libs" = no ||
+	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	       test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath:" in
+	      *"$absdir:"*) ;;
+	      *) temp_rpath="$temp_rpath$absdir:" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	use_static_libs=$prefer_static_libs
+	if test "$use_static_libs" = built && test "$installed" = yes; then
+	  use_static_libs=no
+	fi
+	if test -n "$library_names" &&
+	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc*)
+	      # No point in relinking DLLs because paths are not encoded
+	      notinst_deplibs="$notinst_deplibs $lib"
+	      need_relink=no
+	    ;;
+	  *)
+	    if test "$installed" = no; then
+	      notinst_deplibs="$notinst_deplibs $lib"
+	      need_relink=yes
+	    fi
+	    ;;
+	  esac
+	  # This is a shared library
+
+	  # Warn about portability, can't link against -module's on some
+	  # systems (darwin).  Don't bleat about dlopened modules though!
+	  dlopenmodule=""
+	  for dlpremoduletest in $dlprefiles; do
+	    if test "X$dlpremoduletest" = "X$lib"; then
+	      dlopenmodule="$dlpremoduletest"
+	      break
+	    fi
+	  done
+	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	    echo
+	    if test "$linkmode" = prog; then
+	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $ECHO "*** $linklib is not portable!"
+	  fi
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) compile_rpath="$compile_rpath $absdir"
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) finalize_rpath="$finalize_rpath $libdir"
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    shift
+	    realname="$1"
+	    shift
+	    libname=`eval "\\$ECHO \"$libname_spec\""`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname="$dlname"
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw* | *cegcc*)
+	        func_arith $current - $age
+		major=$func_arith_result
+		versuffix="-$major"
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot="$soname"
+	    func_basename "$soroot"
+	    soname="$func_basename_result"
+	    func_stripname 'lib' '.dll' "$soname"
+	    newlib=libimp-$func_stripname_result.a
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      func_verbose "generating import library for \`$soname'"
+	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test "$linkmode" = prog || test "$mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+		    *-*-unixware7*) add_dir="-L$dir" ;;
+		  *-*-darwin* )
+		    # if the lib is a (non-dlopened) module then we can not
+		    # link against it, someone is ignoring the earlier warnings
+		    if /usr/bin/file -L $add 2> /dev/null |
+			 $GREP ": [^:]* bundle" >/dev/null ; then
+		      if test "X$dlopenmodule" != "X$lib"; then
+			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
+			if test -z "$old_library" ; then
+			  echo
+			  echo "*** And there doesn't seem to be a static archive available"
+			  echo "*** The link will probably fail, sorry"
+			else
+			  add="$dir/$old_library"
+			fi
+		      elif test -n "$old_library"; then
+			add="$dir/$old_library"
+		      fi
+		    fi
+		esac
+	      elif test "$hardcode_minus_L" = no; then
+		case $host in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes &&
+	         test "$hardcode_direct_absolute" = no; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$dir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case $libdir in
+		    [\\/]*)
+		      add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		      ;;
+		  esac
+		fi
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test "$lib_linked" != yes; then
+	      func_fatal_configuration "unsupported hardcode properties"
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes &&
+		 test "$hardcode_minus_L" != yes &&
+		 test "$hardcode_shlibpath_var" = yes; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test "$linkmode" = prog || test "$mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes &&
+	       test "$hardcode_direct_absolute" = no; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
+		add="$inst_prefix_dir$libdir/$linklib"
+	      else
+		add="$libdir/$linklib"
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case $libdir in
+		  [\\/]*)
+		    add_dir="$add_dir -L$inst_prefix_dir$libdir"
+		    ;;
+		esac
+	      fi
+	      add="-l$name"
+	    fi
+
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test "$linkmode" = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    echo
+	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    echo "*** I have the capability to make that library automatically link in when"
+	    echo "*** you link to this library.  But I can only do this if you have a"
+	    echo "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      echo "*** But as you try to build a module library, libtool will still create "
+	      echo "*** a static module, that should work as long as the dlopening application"
+	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		echo
+		echo "*** However, this would only work if libtool was able to extract symbol"
+		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** not find such a program.  So, this module is probably useless."
+		echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test "$linkmode" = lib; then
+	  if test -n "$dependency_libs" &&
+	     { test "$hardcode_into_libs" != yes ||
+	       test "$build_old_libs" = yes ||
+	       test "$link_static" = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) func_stripname '-R' '' "$libdir"
+	           temp_xrpath=$func_stripname_result
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) xrpath="$xrpath $temp_xrpath";;
+		   esac;;
+	      *) temp_deplibs="$temp_deplibs $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  fi
+
+	  newlib_search_path="$newlib_search_path $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    if $opt_duplicate_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+	      esac
+	    fi
+	    tmp_libs="$tmp_libs $deplib"
+	  done
+
+	  if test "$link_all_deplibs" != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      path=
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+	        func_dirname "$deplib" "" "."
+		dir="$func_dirname_result"
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    func_warning "cannot determine absolute directory name of \`$dir'"
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if $GREP "^installed=no" $deplib > /dev/null; then
+		case $host in
+		*-*-darwin*)
+		  depdepl=
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$absdir/$objdir/$depdepl" ; then
+		      depdepl="$absdir/$objdir/$depdepl"
+		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+		      compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+		      linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+		      path=
+		    fi
+		  fi
+		  ;;
+		*)
+		  path="-L$absdir/$objdir"
+		  ;;
+		esac
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  test -z "$libdir" && \
+		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  test "$absdir" != "$libdir" && \
+		    func_warning "\`$deplib' seems to be moved"
+
+		  path="-L$absdir"
+		fi
+		;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      if test "$pass" = link; then
+	if test "$linkmode" = "prog"; then
+	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+	else
+	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	fi
+      fi
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) lib_search_path="$lib_search_path $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	fi
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) tmp_libs="$tmp_libs $deplib" ;;
+	      esac
+	      ;;
+	    *) tmp_libs="$tmp_libs $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=""
+	  ;;
+	esac
+	if test -n "$i" ; then
+	  tmp_libs="$tmp_libs $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+    fi
+    if test "$linkmode" = prog || test "$linkmode" = lib; then
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for archives"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "\`-l' and \`-L' are ignored for archives" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for archives"
+
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for archives"
+
+      test -n "$vinfo" && \
+	func_warning "\`-version-info/-version-number' is ignored for archives"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for archives"
+
+      test -n "$export_symbols$export_symbols_regex" && \
+	func_warning "\`-export-symbols' is ignored for archives"
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      objs="$objs$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+	func_stripname 'lib' '.la' "$outputname"
+	name=$func_stripname_result
+	eval shared_ext=\"$shrext_cmds\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	test "$module" = no && \
+	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  func_stripname '' '.la' "$outputname"
+	  name=$func_stripname_result
+	  eval shared_ext=\"$shrext_cmds\"
+	  eval libname=\"$libname_spec\"
+	else
+	  func_stripname '' '.la' "$outputname"
+	  libname=$func_stripname_result
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+	else
+	  echo
+	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+	  $ECHO "*** objects $objs is not portable!"
+	  libobjs="$libobjs $objs"
+	fi
+      fi
+
+      test "$dlself" != no && \
+	func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+      set dummy $rpath
+      shift
+      test "$#" -gt 1 && \
+	func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+      install_libdir="$1"
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	test -n "$vinfo" && \
+	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+	test -n "$release" && \
+	  func_warning "\`-release' is ignored for convenience libraries"
+      else
+
+	# Parse the version information argument.
+	save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	shift
+	IFS="$save_ifs"
+
+	test -n "$7" && \
+	  func_fatal_help "too many parameters to \`-version-info'"
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+
+	case $vinfo_number in
+	yes)
+	  number_major="$1"
+	  number_minor="$2"
+	  number_revision="$3"
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # which has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  darwin|linux|osf|windows|none)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age="$number_minor"
+	    revision="$number_revision"
+	    ;;
+	  freebsd-aout|freebsd-elf|qnx|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
+	    ;;
+	  irix|nonstopux)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age="$number_minor"
+	    revision="$number_minor"
+	    lt_irix_increment=no
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current="$1"
+	  revision="$2"
+	  age="$3"
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "CURRENT \`$current' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $revision in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "REVISION \`$revision' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $age in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "AGE \`$age' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  func_arith $current + 1
+	  minor_current=$func_arith_result
+	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
+
+	irix | nonstopux)
+	  if test "X$lt_irix_increment" = "Xno"; then
+	    func_arith $current - $age
+	  else
+	    func_arith $current - $age + 1
+	  fi
+	  major=$func_arith_result
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test "$loop" -ne 0; do
+	    func_arith $revision - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring="$verstring_prefix$major.$iface:$verstring"
+	  done
+
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
+
+	linux)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix="$major.$age.$revision"
+	  ;;
+
+	osf)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test "$loop" -ne 0; do
+	    func_arith $current - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring="$verstring:${iface}.0"
+	  done
+
+	  # Make executables depend on our current version.
+	  verstring="$verstring:${current}.0"
+	  ;;
+
+	qnx)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
+
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  func_arith $current - $age
+	  major=$func_arith_result
+	  versuffix="-$major"
+	  ;;
+
+	*)
+	  func_fatal_configuration "unknown library version type \`$version_type'"
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    func_warning "undefined symbols not allowed in $host shared libraries"
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
+
+      fi
+
+      func_generate_dlsyms "$libname" "$libname" "yes"
+      libobjs="$libobjs $symfileobj"
+      test "X$libobjs" = "X " && libobjs=
+
+      if test "$mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$ECHO "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext | *.gcno)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       if test "X$precious_files_regex" != "X"; then
+		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+		 then
+		   continue
+		 fi
+	       fi
+	       removelist="$removelist $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	test -n "$removelist" && \
+	  func_show_eval "${RM}r \$removelist"
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	oldlibs="$oldlibs $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      #for path in $notinst_path; do
+      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+      #done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  temp_xrpath="$temp_xrpath -R$libdir"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) dlfiles="$dlfiles $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) dlprefiles="$dlprefiles $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    deplibs="$deplibs System.ltframework"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    ;;
+	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test "$build_libtool_need_lc" = "yes"; then
+	      deplibs="$deplibs -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $opt_dry_run || $RM conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $opt_dry_run || $RM conftest
+	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    newdeplibs="$newdeplibs $i"
+		    i=""
+		    ;;
+		  esac
+		fi
+		if test -n "$i" ; then
+		  libname=`eval "\\$ECHO \"$libname_spec\""`
+		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		  set dummy $deplib_matches; shift
+		  deplib_match=$1
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    newdeplibs="$newdeplibs $i"
+		  else
+		    droppeddeps=yes
+		    echo
+		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		    echo "*** I have the capability to make that library automatically link in when"
+		    echo "*** you link to this library.  But I can only do this if you have a"
+		    echo "*** shared version of the library, which I believe you do not have"
+		    echo "*** because a test_compile did reveal that the linker did not use it for"
+		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+		;;
+	      *)
+		newdeplibs="$newdeplibs $i"
+		;;
+	      esac
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		$opt_dry_run || $RM conftest
+		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+		  ldd_output=`ldd conftest`
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      newdeplibs="$newdeplibs $i"
+		      i=""
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i" ; then
+		    libname=`eval "\\$ECHO \"$libname_spec\""`
+		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		    set dummy $deplib_matches; shift
+		    deplib_match=$1
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		      newdeplibs="$newdeplibs $i"
+		    else
+		      droppeddeps=yes
+		      echo
+		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		      echo "*** I have the capability to make that library automatically link in when"
+		      echo "*** you link to this library.  But I can only do this if you have a"
+		      echo "*** shared version of the library, which you do not appear to have"
+		      echo "*** because a test_compile did reveal that the linker did not use this one"
+		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  echo
+		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+		  echo "*** make it link in!  You will probably need to install it or some"
+		  echo "*** library that it depends on before this library will be fully"
+		  echo "*** functional.  Installing it before continuing would be even better."
+		fi
+		;;
+	      *)
+		newdeplibs="$newdeplibs $i"
+		;;
+	      esac
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method; shift
+	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null |
+			 $GREP " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+			 $SED -e 10q |
+			 $EGREP "$file_magic_regex" > /dev/null; then
+			newdeplibs="$newdeplibs $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		echo
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method; shift
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  newdeplibs="$newdeplibs $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+		       $EGREP "$match_pattern_regex" > /dev/null; then
+		      newdeplibs="$newdeplibs $a_deplib"
+		      a_deplib=""
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		echo
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      newdeplibs="$newdeplibs $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+	    done
+	  fi
+	  case $tmp_deplibs in
+	  *[!\	\ ]*)
+	    echo
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	    ;;
+	  esac
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library with the System framework
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+	  ;;
+	esac
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    echo
+	    echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+	    echo "*** a static module, that should work as long as the dlopening"
+	    echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      echo
+	      echo "*** However, this would only work if libtool was able to extract symbol"
+	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** not find such a program.  So, this module is probably useless."
+	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    echo "*** The inter-library dependencies that have been dropped here will be"
+	    echo "*** automatically added whenever a program is linked with this library"
+	    echo "*** or is declared to -dlopen it."
+
+	    if test "$allow_undefined" = no; then
+	      echo
+	      echo "*** Since this library must not contain undefined symbols,"
+	      echo "*** because either the platform does not support them or"
+	      echo "*** it was explicitly requested with -no-undefined,"
+	      echo "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+	*-*-darwin*)
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  ;;
+      esac
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      deplibs="$new_libs"
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+	if test "$hardcode_into_libs" = yes; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath="$finalize_rpath"
+	  test "$mode" != relink && rpath="$compile_rpath$rpath"
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs="$libdir"
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		dep_rpath="$dep_rpath $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) perm_rpath="$perm_rpath $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir="$hardcode_libdirs"
+	    if test -n "$hardcode_libdir_flag_spec_ld"; then
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
+	    else
+	      eval dep_rpath=\"$hardcode_libdir_flag_spec\"
+	    fi
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      rpath="$rpath$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+	fi
+
+	shlibpath="$finalize_shlibpath"
+	test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+	fi
+
+	# Get the real and link names of the library.
+	eval shared_ext=\"$shrext_cmds\"
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	shift
+	realname="$1"
+	shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname="$realname"
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib="$output_objdir/$realname"
+	linknames=
+	for link
+	do
+	  linknames="$linknames $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	test "X$libobjs" = "X " && libobjs=
+
+	delfiles=
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+	  export_symbols="$output_objdir/$libname.uexp"
+	  delfiles="$delfiles $export_symbols"
+	fi
+
+	orig_export_symbols=
+	case $host_os in
+	cygwin* | mingw* | cegcc*)
+	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+	    # exporting using user supplied symfile
+	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	      # and it's NOT already a .def file. Must figure out
+	      # which of the given symbols are data symbols and tag
+	      # them as such. So, trigger use of export_symbols_cmds.
+	      # export_symbols gets reassigned inside the "prepare
+	      # the list of exported symbols" if statement, so the
+	      # include_expsyms logic still works.
+	      orig_export_symbols="$export_symbols"
+	      export_symbols=
+	      always_export_symbols=yes
+	    fi
+	  fi
+	  ;;
+	esac
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $opt_dry_run || $RM $export_symbols
+	    cmds=$export_symbols_cmds
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $cmds; do
+	      IFS="$save_ifs"
+	      eval cmd=\"$cmd\"
+	      func_len " $cmd"
+	      len=$func_len_result
+	      if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+		func_show_eval "$cmd" 'exit $?'
+		skipped_export=false
+	      else
+		# The command line is too long to execute in one step.
+		func_verbose "using reloadable object file for export list..."
+		skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
+	      fi
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  tmp_export_symbols="$export_symbols"
+	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+	fi
+
+	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	  # The given exports_symbols file has to be filtered, so filter it.
+	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # though. Also, the filter scales superlinearly with the number of
+	  # global variables. join(1) would be nice here, but unfortunately
+	  # isn't a blessed tool.
+	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	  delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	  export_symbols=$output_objdir/$libname.def
+	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+	  case " $convenience " in
+	  *" $test_deplib "*) ;;
+	  *)
+	    tmp_deplibs="$tmp_deplibs $test_deplib"
+	    ;;
+	  esac
+	done
+	deplibs="$tmp_deplibs"
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec" &&
+	    test "$compiler_needs_object" = yes &&
+	    test -z "$libobjs"; then
+	    # extract the archives, so we have objects to list.
+	    # TODO: could optimize this to just extract one archive.
+	    whole_archive_flag_spec=
+	  fi
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    generated="$generated $gentop"
+
+	    func_extract_archives $gentop $convenience
+	    libobjs="$libobjs $func_extract_archives_result"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	fi
+
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  linker_flags="$linker_flags $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$mode" = relink; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval test_cmds=\"$module_expsym_cmds\"
+	    cmds=$module_expsym_cmds
+	  else
+	    eval test_cmds=\"$module_cmds\"
+	    cmds=$module_cmds
+	  fi
+	else
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    eval test_cmds=\"$archive_expsym_cmds\"
+	    cmds=$archive_expsym_cmds
+	  else
+	    eval test_cmds=\"$archive_cmds\"
+	    cmds=$archive_cmds
+	  fi
+	fi
+
+	if test "X$skipped_export" != "X:" &&
+	   func_len " $test_cmds" &&
+	   len=$func_len_result &&
+	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise
+	  # or, if using GNU ld and skipped_export is not :, use a linker
+	  # script.
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+	  func_basename "$output"
+	  output_la=$func_basename_result
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  last_robj=
+	  k=1
+
+	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+	    output=${output_objdir}/${output_la}.lnkscript
+	    func_verbose "creating GNU ld script: $output"
+	    echo 'INPUT (' > $output
+	    for obj in $save_libobjs
+	    do
+	      $ECHO "$obj" >> $output
+	    done
+	    echo ')' >> $output
+	    delfiles="$delfiles $output"
+	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+	    output=${output_objdir}/${output_la}.lnk
+	    func_verbose "creating linker input file list: $output"
+	    : > $output
+	    set x $save_libobjs
+	    shift
+	    firstobj=
+	    if test "$compiler_needs_object" = yes; then
+	      firstobj="$1 "
+	      shift
+	    fi
+	    for obj
+	    do
+	      $ECHO "$obj" >> $output
+	    done
+	    delfiles="$delfiles $output"
+	    output=$firstobj\"$file_list_spec$output\"
+	  else
+	    if test -n "$save_libobjs"; then
+	      func_verbose "creating reloadable object files..."
+	      output=$output_objdir/$output_la-${k}.$objext
+	      eval test_cmds=\"$reload_cmds\"
+	      func_len " $test_cmds"
+	      len0=$func_len_result
+	      len=$len0
+
+	      # Loop over the list of objects to be linked.
+	      for obj in $save_libobjs
+	      do
+		func_len " $obj"
+		func_arith $len + $func_len_result
+		len=$func_arith_result
+		if test "X$objlist" = X ||
+		   test "$len" -lt "$max_cmd_len"; then
+		  func_append objlist " $obj"
+		else
+		  # The command $test_cmds is almost too long, add a
+		  # command to the queue.
+		  if test "$k" -eq 1 ; then
+		    # The first file doesn't have a previous command to add.
+		    reload_objs=$objlist
+		    eval concat_cmds=\"$reload_cmds\"
+		  else
+		    # All subsequent reloadable object files will link in
+		    # the last one created.
+		    reload_objs="$objlist $last_robj"
+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+		  fi
+		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  func_arith $k + 1
+		  k=$func_arith_result
+		  output=$output_objdir/$output_la-${k}.$objext
+		  objlist=" $obj"
+		  func_len " $last_robj"
+		  func_arith $len0 + $func_len_result
+		  len=$func_arith_result
+		fi
+	      done
+	      # Handle the remaining objects by creating one last
+	      # reloadable object file.  All subsequent reloadable object
+	      # files will link in the last one created.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      reload_objs="$objlist $last_robj"
+	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+	      if test -n "$last_robj"; then
+	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	      fi
+	      delfiles="$delfiles $output"
+
+	    else
+	      output=
+	    fi
+
+	    if ${skipped_export-false}; then
+	      func_verbose "generating symbol list for \`$libname.la'"
+	      export_symbols="$output_objdir/$libname.exp"
+	      $opt_dry_run || $RM $export_symbols
+	      libobjs=$output
+	      # Append the command to create the export file.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+	      if test -n "$last_robj"; then
+		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+	      fi
+	    fi
+
+	    test -n "$save_libobjs" &&
+	      func_verbose "creating a temporary reloadable object file: $output"
+
+	    # Loop through the commands generated above and execute them.
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $concat_cmds; do
+	      IFS="$save_ifs"
+	      $opt_silent || {
+		  func_quote_for_expand "$cmd"
+		  eval "func_echo $func_quote_for_expand_result"
+	      }
+	      $opt_dry_run || eval "$cmd" || {
+		lt_exit=$?
+
+		# Restore the uninstalled library and exit
+		if test "$mode" = relink; then
+		  ( cd "$output_objdir" && \
+		    $RM "${realname}T" && \
+		    $MV "${realname}U" "$realname" )
+		fi
+
+		exit $lt_exit
+	      }
+	    done
+	    IFS="$save_ifs"
+
+	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+
+          if ${skipped_export-false}; then
+	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	      tmp_export_symbols="$export_symbols"
+	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+	    fi
+
+	    if test -n "$orig_export_symbols"; then
+	      # The given exports_symbols file has to be filtered, so filter it.
+	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # though. Also, the filter scales superlinearly with the number of
+	      # global variables. join(1) would be nice here, but unfortunately
+	      # isn't a blessed tool.
+	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	      delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+	      export_symbols=$output_objdir/$libname.def
+	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	    fi
+	  fi
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test "$module" = yes && test -n "$module_cmds" ; then
+	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	      cmds=$module_expsym_cmds
+	    else
+	      cmds=$module_cmds
+	    fi
+	  else
+	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	      cmds=$archive_expsym_cmds
+	    else
+	      cmds=$archive_cmds
+	    fi
+	  fi
+	fi
+
+	if test -n "$delfiles"; then
+	  # Append the command to remove temporary files to $cmds.
+	  eval cmds=\"\$cmds~\$RM $delfiles\"
+	fi
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  libobjs="$libobjs $func_extract_archives_result"
+	  test "X$libobjs" = "X " && libobjs=
+	fi
+
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $opt_silent || {
+	    func_quote_for_expand "$cmd"
+	    eval "func_echo $func_quote_for_expand_result"
+	  }
+	  $opt_dry_run || eval "$cmd" || {
+	    lt_exit=$?
+
+	    # Restore the uninstalled library and exit
+	    if test "$mode" = relink; then
+	      ( cd "$output_objdir" && \
+	        $RM "${realname}T" && \
+		$MV "${realname}U" "$realname" )
+	    fi
+
+	    exit $lt_exit
+	  }
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$mode" = relink; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      func_show_eval '${RM}r "$gentop"'
+	    fi
+	  fi
+
+	  exit $EXIT_SUCCESS
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for objects"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "\`-l' and \`-L' are ignored for objects" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for objects"
+
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for objects"
+
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for objects"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for objects"
+
+      case $output in
+      *.lo)
+	test -n "$objs$old_deplibs" && \
+	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+	libobj=$output
+	func_lo2o "$libobj"
+	obj=$func_lo2o_result
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $opt_dry_run || $RM $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	else
+	  gentop="$output_objdir/${obj}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $convenience
+	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+	fi
+      fi
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      func_execute_cmds "$reload_cmds" 'exit $?'
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	func_execute_cmds "$reload_cmds" 'exit $?'
+      fi
+
+      if test -n "$gentop"; then
+	func_show_eval '${RM}r "$gentop"'
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) func_stripname '' '.exe' "$output"
+	          output=$func_stripname_result.exe;;
+      esac
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for programs"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for programs"
+
+      test "$preload" = yes \
+        && test "$dlopen_support" = unknown \
+	&& test "$dlopen_self" = unknown \
+	&& test "$dlopen_self_static" = unknown && \
+	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+	;;
+      esac
+
+      case $host in
+      *-*-darwin*)
+	# Don't allow lazy linking, it breaks C++ global constructors
+	# But is supposedly fixed on 10.4 or later (yay!).
+	if test "$tagname" = CXX ; then
+	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+	    10.[0123])
+	      compile_command="$compile_command ${wl}-bind_at_load"
+	      finalize_command="$finalize_command ${wl}-bind_at_load"
+	    ;;
+	  esac
+	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	;;
+      esac
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $compile_deplibs " in
+	  *" -L$path/$objdir "*)
+	    new_libs="$new_libs -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $compile_deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) new_libs="$new_libs $deplib" ;;
+	  esac
+	  ;;
+	*) new_libs="$new_libs $deplib" ;;
+	esac
+      done
+      compile_deplibs="$new_libs"
+
+
+      compile_command="$compile_command $compile_deplibs"
+      finalize_command="$finalize_command $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_rpath="$finalize_rpath $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) perm_rpath="$perm_rpath $libdir" ;;
+	  esac
+	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  ::) dllsearchpath=$libdir;;
+	  *) dllsearchpath="$dllsearchpath:$libdir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) dllsearchpath="$dllsearchpath:$testbindir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    rpath="$rpath $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+      fi
+
+      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+	func_execute_cmds "$prelink_cmds" 'exit $?'
+      fi
+
+      wrappers_required=yes
+      case $host in
+      *cegcc* | *mingw32ce*)
+        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
+      *cygwin* | *mingw* )
+        if test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      *)
+        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      esac
+      if test "$wrappers_required" = no; then
+	# Replace the output file specification.
+	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+	link_command="$compile_command$compile_rpath"
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	exit_status=0
+	func_show_eval "$link_command" 'exit_status=$?'
+
+	# Delete the generated files.
+	if test -f "$output_objdir/${outputname}S.${objext}"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+	fi
+
+	exit $exit_status
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    rpath="$rpath$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$opt_dry_run || $RM $output
+	# Link the executable and exit
+	func_show_eval "$link_command" 'exit $?'
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	func_warning "this platform does not like uninstalled shared libraries"
+	func_warning "\`$output' will be relinked during installation"
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
+	else
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      func_show_eval "$link_command" 'exit $?'
+
+      # Now create the wrapper script.
+      func_verbose "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    func_quote_for_eval "$var_value"
+	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) func_stripname '' '.exe' "$output"
+	         output=$func_stripname_result ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    func_stripname '' '.exe' "$outputname"
+	    outputname=$func_stripname_result ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *cygwin* | *mingw* )
+	    func_dirname_and_basename "$output" "" "."
+	    output_name=$func_basename_result
+	    output_path=$func_dirname_result
+	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
+	    cwrapper="$output_path/$output_name.exe"
+	    $RM $cwrappersource $cwrapper
+	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_cwrapperexe_src > $cwrappersource
+
+	    # The wrapper executable is built using the $host compiler,
+	    # because it contains $host paths and files. If cross-
+	    # compiling, it, like the target executable, must be
+	    # executed on the $host or under an emulation environment.
+	    $opt_dry_run || {
+	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+	      $STRIP $cwrapper
+	    }
+
+	    # Now, create the wrapper script for func_source use:
+	    func_ltwrapper_scriptname $cwrapper
+	    $RM $func_ltwrapper_scriptname_result
+	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+	    $opt_dry_run || {
+	      # note: this script will not be executed, so do not chmod.
+	      if test "x$build" = "x$host" ; then
+		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+	      else
+		func_emit_wrapper no > $func_ltwrapper_scriptname_result
+	      fi
+	    }
+	  ;;
+	  * )
+	    $RM $output
+	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_wrapper no > $output
+	    chmod +x $output
+	  ;;
+	esac
+      }
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save $symfileobj"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$old_deplibs $non_pic_objects"
+	  if test "$preload" = yes && test -f "$symfileobj"; then
+	    oldobjs="$oldobjs $symfileobj"
+	  fi
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	generated="$generated $gentop"
+
+	func_extract_archives $gentop $addlibs
+	oldobjs="$oldobjs $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+	cmds=$old_archive_from_new_cmds
+      else
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  oldobjs="$oldobjs $func_extract_archives_result"
+	fi
+
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      func_basename "$obj"
+	      $ECHO "$func_basename_result"
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  echo "copying selected object files to avoid basename conflicts..."
+	  gentop="$output_objdir/${outputname}x"
+	  generated="$generated $gentop"
+	  func_mkdir_p "$gentop"
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    func_basename "$obj"
+	    objbase="$func_basename_result"
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		func_arith $counter + 1
+		counter=$func_arith_result
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      oldobjs="$oldobjs $gentop/$newobj"
+	      ;;
+	    *) oldobjs="$oldobjs $obj" ;;
+	    esac
+	  done
+	fi
+	eval cmds=\"$old_archive_cmds\"
+
+	func_len " $cmds"
+	len=$func_len_result
+	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  cmds=$old_archive_cmds
+	else
+	  # the command line is too long to link in one step, link in parts
+	  func_verbose "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done
+	  eval test_cmds=\"$old_archive_cmds\"
+	  func_len " $test_cmds"
+	  len0=$func_len_result
+	  len=$len0
+	  for obj in $save_oldobjs
+	  do
+	    func_len " $obj"
+	    func_arith $len + $func_len_result
+	    len=$func_arith_result
+	    func_append objlist " $obj"
+	    if test "$len" -lt "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj" ; then
+		RANLIB=$save_RANLIB
+	      fi
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      objlist=
+	      len=$len0
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test "X$oldobjs" = "X" ; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      func_execute_cmds "$cmds" 'exit $?'
+    done
+
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      func_verbose "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  func_quote_for_eval "$var_value"
+	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+	relink_command=
+      fi
+
+      # Only create the output if not a dry run.
+      $opt_dry_run || {
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		func_basename "$deplib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+		newdependency_libs="$newdependency_libs $libdir/$name"
+		;;
+	      *) newdependency_libs="$newdependency_libs $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
+
+	    for lib in $dlfiles; do
+	      case $lib in
+	      *.la)
+	        func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		newdlfiles="$newdlfiles $libdir/$name"
+		;;
+	      *) newdlfiles="$newdlfiles $lib" ;;
+	      esac
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+	      *.la)
+		# Only pass preopened files to the pseudo-archive (for
+		# eventual linking with the app. that links it) if we
+		# didn't already link the preopened objects directly into
+		# the library:
+		func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		newdlprefiles="$newdlprefiles $libdir/$name"
+		;;
+	      esac
+	    done
+	    dlprefiles="$newdlprefiles"
+	  else
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlfiles="$newdlfiles $abs"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      newdlprefiles="$newdlprefiles $abs"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $RM $output
+	  # place dlname in correct position for cygwin
+	  # In fact, it would be nice if we could use this code for all target
+	  # systems that can't hard-code library paths into their executables
+	  # and that have no shared library path variable independent of PATH,
+	  # but it turns out we can't easily determine that from inspecting
+	  # libtool variables, so we have to hard-code the OSs to which it
+	  # applies here; at the moment, that means platforms that use the PE
+	  # object format with DLL files.  See the long comment at the top of
+	  # tests/bindir.at for full details.
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+	      # If a -bindir argument was supplied, place the dll there.
+	      if test "x$bindir" != x ;
+	      then
+		func_relative_path "$install_libdir" "$bindir"
+		tdlname=$func_relative_path_result$dlname
+	      else
+		# Otherwise fall back on heuristic.
+		tdlname=../bin/$dlname
+	      fi
+	      ;;
+	  esac
+	  $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test "$installed" = no && test "$need_relink" = yes; then
+	    $ECHO >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      }
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+}
+
+{ test "$mode" = link || test "$mode" = relink; } &&
+    func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $opt_debug
+    RM="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) RM="$RM $arg"; rmforce=yes ;;
+      -*) RM="$RM $arg" ;;
+      *) files="$files $arg" ;;
+      esac
+    done
+
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
+
+    rmdirs=
+
+    origobjdir="$objdir"
+    for file in $files; do
+      func_dirname "$file" "" "."
+      dir="$func_dirname_result"
+      if test "X$dir" = X.; then
+	objdir="$origobjdir"
+      else
+	objdir="$dir/$origobjdir"
+      fi
+      func_basename "$file"
+      name="$func_basename_result"
+      test "$mode" = uninstall && objdir="$dir"
+
+      # Remember objdir for removal later, being careful to avoid duplicates
+      if test "$mode" = clean; then
+	case " $rmdirs " in
+	  *" $objdir "*) ;;
+	  *) rmdirs="$rmdirs $objdir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+	 { test -h "$file"; } >/dev/null 2>&1 ||
+	 test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif test "$rmforce" = yes; then
+	continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if func_lalib_p "$file"; then
+	  func_source $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    rmfiles="$rmfiles $objdir/$n"
+	  done
+	  test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+
+	  case "$mode" in
+	  clean)
+	    case "  $library_names " in
+	    # "  " in the beginning catches empty $dlname
+	    *" $dlname "*) ;;
+	    *) rmfiles="$rmfiles $objdir/$dlname" ;;
+	    esac
+	    test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+	    ;;
+	  uninstall)
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	    ;;
+	  esac
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if func_lalib_p "$file"; then
+
+	  # Read the .lo file
+	  func_source $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" &&
+	     test "$pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" &&
+	     test "$non_pic_object" != none; then
+	    rmfiles="$rmfiles $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test "$mode" = clean ; then
+	  noexename=$name
+	  case $file in
+	  *.exe)
+	    func_stripname '' '.exe' "$file"
+	    file=$func_stripname_result
+	    func_stripname '' '.exe' "$name"
+	    noexename=$func_stripname_result
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    rmfiles="$rmfiles $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if func_ltwrapper_p "$file"; then
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      relink_command=
+	      func_source $func_ltwrapper_scriptname_result
+	      rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+	    else
+	      relink_command=
+	      func_source $dir/$noexename
+	    fi
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	      rmfiles="$rmfiles $objdir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name" ; then
+	      rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
+    done
+    objdir="$origobjdir"
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	func_show_eval "rmdir $dir >/dev/null 2>&1"
+      fi
+    done
+
+    exit $exit_status
+}
+
+{ test "$mode" = uninstall || test "$mode" = clean; } &&
+    func_mode_uninstall ${1+"$@"}
+
+test -z "$mode" && {
+  help="$generic_help"
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode \`$mode'"
+
+if test -n "$exec_cmd"; then
+  eval exec "$exec_cmd"
+  exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/config/missing b/config/missing
new file mode 100755
index 0000000..28055d2
--- /dev/null
+++ b/config/missing
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake at gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).  This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+  lex*|yacc*)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar*)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case $f in
+      *:*) touch_files="$touch_files "`echo "$f" |
+				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+	   sed 's/\.am$/.in/' |
+	   while read f; do touch "$f"; done
+    ;;
+
+  autom4te*)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo "#! /bin/sh"
+	echo "# Created by GNU Automake missing as a replacement of"
+	echo "#  $ $@"
+	echo "exit 0"
+	chmod +x $file
+	exit 1
+    fi
+    ;;
+
+  bison*|yacc*)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if test $# -ne 1; then
+        eval LASTARG="\${$#}"
+	case $LASTARG in
+	*.y)
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" y.tab.c
+	    fi
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" y.tab.h
+	    fi
+	  ;;
+	esac
+    fi
+    if test ! -f y.tab.h; then
+	echo >y.tab.h
+    fi
+    if test ! -f y.tab.c; then
+	echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex*|flex*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if test $# -ne 1; then
+        eval LASTARG="\${$#}"
+	case $LASTARG in
+	*.l)
+	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" lex.yy.c
+	    fi
+	  ;;
+	esac
+    fi
+    if test ! -f lex.yy.c; then
+	echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+	 you modified a dependency of a manual page.  You may need the
+	 \`Help2man' package in order for those modifications to take
+	 effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo ".ab help2man is required to generate this page"
+	exit $?
+    fi
+    ;;
+
+  makeinfo*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+	/^@setfilename/{
+	  s/.* \([^ ]*\) *$/\1/
+	  p
+	  q
+	}' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar*)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+	case $firstarg in
+	*o*)
+	    firstarg=`echo "$firstarg" | sed s/o//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+	case $firstarg in
+	*h*)
+	    firstarg=`echo "$firstarg" | sed s/h//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/config/mkinstalldirs b/config/mkinstalldirs
new file mode 100755
index 0000000..ef7e16f
--- /dev/null
+++ b/config/mkinstalldirs
@@ -0,0 +1,161 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2006-05-11.19
+
+# Original author: Noah Friedman <friedman at prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+nl='
+'
+IFS=" ""	$nl"
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake at gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage"
+      exit $?
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit $?
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+  '')
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the `mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because `.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
+    fi
+    ;;
+esac
+
+for file
+do
+  case $file in
+    /*) pathcomp=/ ;;
+    *)  pathcomp= ;;
+  esac
+  oIFS=$IFS
+  IFS=/
+  set fnord $file
+  shift
+  IFS=$oIFS
+
+  for d
+  do
+    test "x$d" = x && continue
+
+    pathcomp=$pathcomp$d
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+	errstatus=$lasterr
+      else
+	if test ! -z "$dirmode"; then
+	  echo "chmod $dirmode $pathcomp"
+	  lasterr=
+	  chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+	  if test ! -z "$lasterr"; then
+	    errstatus=$lasterr
+	  fi
+	fi
+      fi
+    fi
+
+    pathcomp=$pathcomp/
+  done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/configure b/configure
new file mode 100755
index 0000000..1e3da8a
--- /dev/null
+++ b/configure
@@ -0,0 +1,21977 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for cdo 1.5.9.
+#
+# Report bugs to <http://code.zmaw.de/projects/cdo>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+	# neutralization value for shells without unset; and this also
+	# works around shells that cannot unset nonexistent variables.
+	# Preserve -v and -x to the replacement shell.
+	BASH_ENV=/dev/null
+	ENV=/dev/null
+	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+	export CONFIG_SHELL
+	case $- in # ((((
+	  *v*x* | *x*v* ) as_opts=-vx ;;
+	  *v* ) as_opts=-v ;;
+	  *x* ) as_opts=-x ;;
+	  * ) as_opts= ;;
+	esac
+	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf at gnu.org and
+$0: http://code.zmaw.de/projects/cdo about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in #(
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='cdo'
+PACKAGE_TARNAME='cdo'
+PACKAGE_VERSION='1.5.9'
+PACKAGE_STRING='cdo 1.5.9'
+PACKAGE_BUGREPORT='http://code.zmaw.de/projects/cdo'
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_header_list=
+enable_option_checking=no
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+INCLUDES
+CLIBS
+CLDFLAGS
+FCFLAGS
+ENABLE_ALL_STATIC_FALSE
+ENABLE_ALL_STATIC_TRUE
+subdirs
+ENABLE_CDI_LIB
+ENABLE_CDI_LIB_FALSE
+ENABLE_CDI_LIB_TRUE
+ENABLE_MAGICS_FALSE
+ENABLE_MAGICS_TRUE
+XML2_LIBS
+MAGICS_INCLUDE
+MAGICS_ROOT
+MAGICS_LIBS
+UDUNITS_INCLUDE
+UDUNITS_LDFLAGS
+PROJ_INCLUDE
+PROJ_LDFLAGS
+ENABLE_IEG
+ENABLE_EXTRA
+ENABLE_SERVICE
+ENABLE_CGRIBEX
+ENABLE_GRIB
+GRIB_API_LIBS
+GRIB_API_INCLUDE
+JASPER_LIBS
+NETCDF_LIBS
+NETCDF_INCLUDE
+NETCDF_ROOT
+NC_CONFIG
+HDF5_LIBS
+HDF5_INCLUDE
+HDF5_ROOT
+SZLIB_LIBS
+SZLIB_INCLUDE
+ZLIB_LIBS
+ZLIB_INCLUDE
+THREADS_LIBS
+THREADS_INCLUDE
+PTHREAD_CFLAGS
+PTHREAD_LIBS
+PTHREAD_CC
+ax_pthread_config
+SYSTEM_TYPE
+HOST_NAME
+USER_NAME
+CXXCPP
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+DLLTOOL
+AS
+CPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+RANLIB
+AR
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+LIBTOOL
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+enable_dependency_tracking
+with_gnu_ld
+enable_libtool_lock
+enable_largefile
+with_threads
+with_zlib
+with_szlib
+with_hdf5
+with_netcdf
+with_jasper
+with_grib_api
+enable_grib
+enable_cgribex
+enable_service
+enable_extra
+enable_ieg
+with_proj
+with_udunits2
+with_magics
+with_libxml2
+enable_cdi_lib
+enable_all_static
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CXX
+CXXFLAGS
+CCC
+CXXCPP'
+ac_subdirs_all='libcdi'
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used" >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+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.5.9 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/cdo]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of cdo 1.5.9:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-maintainer-mode  enable make rules and dependencies not useful
+			  (and sometimes confusing) to the casual installer
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --disable-largefile     omit support for large files
+  --enable-grib           GRIB support [default=yes]
+  --enable-cgribex        Use the CGRIBEX library [default=yes]
+  --enable-service        Use the service library [default=yes]
+  --enable-extra          Use the extra library [default=yes]
+  --enable-ieg            Use the ieg library [default=yes]
+  --enable-cdi-lib        build, install and link to a CDI library
+                          [default=no]
+  --enable-all-static     build a completely statically linked CDO binary
+                          [default=no]
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-threads=<yes/no/directory>
+                          Compile + link for multithreading [default=yes]
+  --with-zlib=<yes|no|directory> (default=yes)
+                          location of ZLIB compression library (lib and
+                          include subdirs), nec. for HDF5/NETCDF4
+  --with-szlib=<yes|no|directory> (default=no)
+                          location of szlib library, optional for GRIB1 and
+                          NETCDF4 compression
+  --with-hdf5=<yes|no|directory> (default=no)
+                          location of hdf5 library, NETCDF4 requires hdf5 high
+                          level interface
+  --with-netcdf=<yes|no|directory> (default=yes)
+                          location of netcdf library (lib and include subdirs)
+  --with-jasper=<directory>
+                          Specify location of JASPER library. You must specify
+                          its location if GRIB_API was built with JASPER.
+  --with-grib_api=<yes|no|directory>
+                          library for grib2 compression; if a directory is
+                          given, it will be used as a value for
+                          --with-jasper-root
+  --with-proj=<directory> Specify location of PROJ library for cartographic
+                          projections.
+  --with-udunits2=<directory>
+                          Specify location of UDUNITS2 library.
+  --with-magics=<yes|no|directory>
+                          location of magics library (lib and include subdirs)
+  --with-libxml2=<yes|no|directory>
+                          location of libxml2 library (lib and include
+                          subdirs)
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  CXXCPP      C++ preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <http://code.zmaw.de/projects/cdo>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+cdo configure 1.5.9
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_cpp
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_member
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ----------------------------------------------- ##
+## Report this to http://code.zmaw.de/projects/cdo ##
+## ----------------------------------------------- ##"
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+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.5.9, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+as_fn_append ac_header_list " stdlib.h"
+as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_header_list " sys/param.h"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+CONFIG_ABORT=yes
+ac_aux_dir=
+for ac_dir in config "$srcdir"/config; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+am__api_version='1.11'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='cdo'
+ VERSION='1.5.9'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+ac_config_headers="$ac_config_headers src/config.h"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+# Set up libtool.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: setting up libtool" >&5
+$as_echo "$as_me: setting up libtool" >&6;}
+case `pwd` in
+  *\ * | *\	*)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.2.10'
+macro_revision='1.3175'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`print -r -- -n 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case "$ECHO" in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_FGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in dumpbin "link -dump"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+	  cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+const struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_cc_needs_belf=yes
+else
+  lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    NMEDIT=$ac_ct_NMEDIT
+  fi
+else
+  NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LIPO="lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL="otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL=$ac_ct_OTOOL
+  fi
+else
+  OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL64=$ac_ct_OTOOL64
+  fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&5
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ld_exported_symbols_list=yes
+else
+  lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      echo "$RANLIB libconftest.a" >&5
+      $RANLIB libconftest.a 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&5
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[012]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+
+
+        enable_dlopen=no
+
+
+  enable_win32_dll=no
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  withval=$with_pic; pic_mode="$withval"
+else
+  pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+
+
+
+
+
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      lt_prog_compiler_pic='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='--shared'
+	lt_prog_compiler_static='--static'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fpic'
+	lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-qpic'
+	lt_prog_compiler_static='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ F* | *Sun*Fortran*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl=''
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl='-Wl,'
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
+$as_echo "$lt_prog_compiler_pic" >&6; }
+
+
+
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  whole_archive_flag_spec=
+	  tmp_sharedflag='--shared' ;;
+	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+	  hardcode_libdir_flag_spec=
+	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    ld_shlibs=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  hardcode_direct=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L=yes
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_libdir_separator=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      export_dynamic_flag_spec='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    whole_archive_flag_spec='$convenience'
+	  fi
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      hardcode_libdir_flag_spec=' '
+      allow_undefined_flag=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      old_archive_from_new_cmds='true'
+      # FIXME: Should let the user specify the lib program.
+      old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      fix_srcfile_path='`cygpath -w "$srcfile"`'
+      enable_shared_with_static_runtimes=yes
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec=''
+  fi
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld='+b $libdir'
+	hardcode_libdir_separator=:
+	hardcode_direct=yes
+	hardcode_direct_absolute=yes
+	export_dynamic_flag_spec='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	*)
+	  hardcode_direct=yes
+	  hardcode_direct_absolute=yes
+	  export_dynamic_flag_spec='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo(void) {}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        LDFLAGS="$save_LDFLAGS"
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct=yes
+	hardcode_shlibpath_var=no
+	hardcode_direct_absolute=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	  export_dynamic_flag_spec='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     hardcode_libdir_flag_spec='-R$libdir'
+	     ;;
+	   *)
+	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	export_dynamic_flag_spec='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl
+	  pic_flag=$lt_prog_compiler_pic
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag
+	  allow_undefined_flag=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc=no
+	  else
+	    lt_cv_archive_cmds_need_lc=yes
+	  fi
+	  allow_undefined_flag=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+    ;;
+
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
+else
+  ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_svld_dlopen=yes
+else
+  ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_dld_link=yes
+else
+  ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+void fnord () __attribute__((visibility("default")));
+#endif
+
+void fnord () { int i=42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+void fnord () __attribute__((visibility("default")));
+#endif
+
+void fnord () { int i=42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report which library types will actually be built
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+# Check building environment
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+	{
+	case 's': // string
+	  str = va_arg (args_copy, const char *);
+	  break;
+	case 'd': // int
+	  number = va_arg (args_copy, int);
+	  break;
+	case 'f': // float
+	  fnumber = va_arg (args_copy, double);
+	  break;
+	default:
+	  break;
+	}
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+	  || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
+if test "x$CC" != xcc; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
+$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
+$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
+fi
+set dummy $CC; ac_cc=`$as_echo "$2" |
+		      sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+# Make sure it works both with $CC and with simple cc.
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+rm -f conftest2.*
+if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+   test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+then
+  eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  if test "x$CC" != xcc; then
+    # Test first that cc exists at all.
+    if { ac_try='cc -c conftest.$ac_ext >&5'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+      ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
+      rm -f conftest2.*
+      if { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } &&
+	 test -f conftest2.$ac_objext && { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; };
+      then
+	# cc works too.
+	:
+      else
+	# cc exists but doesn't like -o.
+	eval ac_cv_prog_cc_${ac_cc}_c_o=no
+      fi
+    fi
+  fi
+else
+  eval ac_cv_prog_cc_${ac_cc}_c_o=no
+fi
+rm -f core conftest*
+
+fi
+if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
+
+fi
+
+# FIXME: we rely on the cache variable name because
+# there is no other way.
+set dummy $CC
+am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
+eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
+if test "$am_t" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+
+
+#AC_PROG_RANLIB
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cpp", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cpp; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CPP"; then
+  ac_cv_prog_CPP="$CPP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CPP="${ac_tool_prefix}cpp"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CPP=$ac_cv_prog_CPP
+if test -n "$CPP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CPP"; then
+  ac_ct_CPP=$CPP
+  # Extract the first word of "cpp", so it can be a program name with args.
+set dummy cpp; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CPP"; then
+  ac_cv_prog_ac_ct_CPP="$ac_ct_CPP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CPP="cpp"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CPP=$ac_cv_prog_ac_ct_CPP
+if test -n "$ac_ct_CPP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CPP" >&5
+$as_echo "$ac_ct_CPP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CPP" = x; then
+    CPP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CPP=$ac_ct_CPP
+  fi
+else
+  CPP="$ac_cv_prog_CPP"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ld; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LD"; then
+  ac_cv_prog_LD="$LD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LD="${ac_tool_prefix}ld"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+LD=$ac_cv_prog_LD
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LD"; then
+  ac_ct_LD=$LD
+  # Extract the first word of "ld", so it can be a program name with args.
+set dummy ld; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LD"; then
+  ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LD="ld"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LD=$ac_cv_prog_ac_ct_LD
+if test -n "$ac_ct_LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LD" >&5
+$as_echo "$ac_ct_LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LD" = x; then
+    LD=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    LD=$ac_ct_LD
+  fi
+else
+  LD="$ac_cv_prog_LD"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nm; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  ac_cv_prog_NM="$NM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NM="${ac_tool_prefix}nm"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NM=$ac_cv_prog_NM
+if test -n "$NM"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5
+$as_echo "$NM" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NM"; then
+  ac_ct_NM=$NM
+  # Extract the first word of "nm", so it can be a program name with args.
+set dummy nm; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NM"; then
+  ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_NM="nm"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NM=$ac_cv_prog_ac_ct_NM
+if test -n "$ac_ct_NM"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5
+$as_echo "$ac_ct_NM" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NM" = x; then
+    NM=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    NM=$ac_ct_NM
+  fi
+else
+  NM="$ac_cv_prog_NM"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AS"; then
+  ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AS="${ac_tool_prefix}as"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
+$as_echo "$AS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AS"; then
+  ac_ct_AS=$AS
+  # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AS"; then
+  ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AS="as"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
+$as_echo "$ac_ct_AS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AS" = x; then
+    AS=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AS=$ac_ct_AS
+  fi
+else
+  AS="$ac_cv_prog_AS"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+else
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+      if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+  if ${ac_cv_prog_CXXCPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+else
+  _lt_caught_CXX_error=yes
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  compiler=$CC
+  compiler_CXX=$CC
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+    else
+      lt_prog_compiler_no_builtin_flag_CXX=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        archive_expsym_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          whole_archive_flag_spec_CXX=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+    ld_shlibs_CXX=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+      aix[4-9]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        archive_cmds_CXX=''
+        hardcode_direct_CXX=yes
+        hardcode_direct_absolute_CXX=yes
+        hardcode_libdir_separator_CXX=':'
+        link_all_deplibs_CXX=yes
+        file_list_spec_CXX='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[012]|aix4.[012].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    hardcode_direct_CXX=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    hardcode_minus_L_CXX=yes
+	    hardcode_libdir_flag_spec_CXX='-L$libdir'
+	    hardcode_libdir_separator_CXX=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
+	  fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
+	    else
+	      shared_flag='${wl}-bM:SRE'
+	    fi
+          fi
+        fi
+
+        export_dynamic_flag_spec_CXX='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        always_export_symbols_CXX=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          allow_undefined_flag_CXX='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+          hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+	    hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	    allow_undefined_flag_CXX="-z nodefs"
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+
+	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    no_undefined_flag_CXX=' ${wl}-bernotok'
+	    allow_undefined_flag_CXX=' ${wl}-berok'
+	    if test "$with_gnu_ld" = yes; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      whole_archive_flag_spec_CXX='$convenience'
+	    fi
+	    archive_cmds_need_lc_CXX=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  allow_undefined_flag_CXX=unsupported
+	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	else
+	  ld_shlibs_CXX=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+        # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+        # as there is no search path for DLLs.
+        hardcode_libdir_flag_spec_CXX='-L$libdir'
+        export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+        allow_undefined_flag_CXX=unsupported
+        always_export_symbols_CXX=no
+        enable_shared_with_static_runtimes_CXX=yes
+
+        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+          archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+          # If the export-symbols file already is a .def file (1st line
+          # is EXPORTS), use it as is; otherwise, prepend...
+          archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    cp $export_symbols $output_objdir/$soname.def;
+          else
+	    echo EXPORTS > $output_objdir/$soname.def;
+	    cat $export_symbols >> $output_objdir/$soname.def;
+          fi~
+          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        else
+          ld_shlibs_CXX=no
+        fi
+        ;;
+      darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_CXX=no
+  hardcode_direct_CXX=no
+  hardcode_automatic_CXX=yes
+  hardcode_shlibpath_var_CXX=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec_CXX=''
+  fi
+  link_all_deplibs_CXX=yes
+  allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+       if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+
+  else
+  ld_shlibs_CXX=no
+  fi
+
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      freebsd[12]*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        ld_shlibs_CXX=no
+        ;;
+
+      freebsd-elf*)
+        archive_cmds_need_lc_CXX=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        ld_shlibs_CXX=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      haiku*)
+        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        link_all_deplibs_CXX=yes
+        ;;
+
+      hpux9*)
+        hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator_CXX=:
+        export_dynamic_flag_spec_CXX='${wl}-E'
+        hardcode_direct_CXX=yes
+        hardcode_minus_L_CXX=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            ld_shlibs_CXX=no
+            ;;
+          aCC*)
+            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              ld_shlibs_CXX=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+	  hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      export_dynamic_flag_spec_CXX='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct_CXX=no
+            hardcode_shlibpath_var_CXX=no
+            ;;
+          *)
+            hardcode_direct_CXX=yes
+            hardcode_direct_absolute_CXX=yes
+            hardcode_minus_L_CXX=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
+	        case $host_cpu in
+	          hppa*64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[3-9]*)
+	hardcode_direct_CXX=no
+	hardcode_shlibpath_var_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	      else
+	        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	      fi
+	    fi
+	    link_all_deplibs_CXX=yes
+	    ;;
+        esac
+        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        hardcode_libdir_separator_CXX=:
+        inherit_rpath_CXX=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    archive_cmds_need_lc_CXX=no
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+	      prelink_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+	      old_archive_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+		$RANLIB $oldlib'
+	      archive_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      archive_expsym_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 and above use weak symbols
+	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    ;;
+	  xl* | mpixl* | bgxl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
+	      archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      no_undefined_flag_CXX=' -zdefs'
+	      archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      hardcode_libdir_flag_spec_CXX='-R$libdir'
+	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      compiler_needs_object_CXX=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='func_echo_all'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  hardcode_libdir_flag_spec_CXX='-R$libdir'
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        ld_shlibs_CXX=yes
+	;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+	ld_shlibs_CXX=no
+	;;
+
+      openbsd*)
+	if test -f /usr/libexec/ld.so; then
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	  hardcode_direct_absolute_CXX=yes
+	  archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    export_dynamic_flag_spec_CXX='${wl}-E'
+	    whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=func_echo_all
+	else
+	  ld_shlibs_CXX=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+		;;
+	      *)
+	        allow_undefined_flag_CXX=' -expect_unresolved \*'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
+	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+		;;
+	    esac
+
+	    hardcode_libdir_separator_CXX=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+	  *)
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	      case $host in
+	        osf3*)
+	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	        *)
+	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	      hardcode_libdir_separator_CXX=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            archive_cmds_need_lc_CXX=yes
+	    no_undefined_flag_CXX=' -zdefs'
+	    archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    hardcode_libdir_flag_spec_CXX='-R$libdir'
+	    hardcode_shlibpath_var_CXX=no
+	    case $host_os in
+	      solaris2.[0-5] | solaris2.[0-5].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands `-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    link_all_deplibs_CXX=yes
+
+	    output_verbose_link_cmd='func_echo_all'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        archive_cmds_CXX='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # platform.
+	        archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      fi
+
+	      hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	      case $host_os in
+		solaris2.[0-5] | solaris2.[0-5].*) ;;
+		*)
+		  whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_CXX='${wl}-z,text'
+      archive_cmds_need_lc_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We can NOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	no_undefined_flag_CXX='${wl}-z,text'
+	allow_undefined_flag_CXX='${wl}-z,nodefs'
+	archive_cmds_need_lc_CXX=no
+	hardcode_shlibpath_var_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+	hardcode_libdir_separator_CXX=':'
+	link_all_deplibs_CXX=yes
+	export_dynamic_flag_spec_CXX='${wl}-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+	      '"$old_archive_cmds_CXX"
+	    reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+	      '"$reload_cmds_CXX"
+	    ;;
+	  *)
+	    archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+    esac
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+    test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+    GCC_CXX="$GXX"
+    LD_CXX="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+	 prev=$p
+	 continue
+       else
+	 prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 case $p in
+	 -L* | -R*)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+	 fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  predep_objects_CXX=
+  postdep_objects_CXX=
+  postdeps_CXX=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_CXX='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_CXX=
+      ;;
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_CXX='-fPIC -shared'
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[4-9]*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  ecpc* )
+	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-qpic'
+	    lt_prog_compiler_static_CXX='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      lt_prog_compiler_pic_CXX='-KPIC'
+	      lt_prog_compiler_static_CXX='-Bstatic'
+	      lt_prog_compiler_wl_CXX='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        lt_prog_compiler_pic_CXX='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_prog_compiler_pic_CXX" >&6; }
+
+
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works_CXX=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works_CXX=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_CXX=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_CXX=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+    :
+else
+    lt_prog_compiler_static_CXX=
+fi
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix[4-9]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+  ;;
+  cygwin* | mingw* | cegcc*)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;/^.*[ ]__nm__/s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+with_gnu_ld_CXX=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl_CXX
+	  pic_flag=$lt_prog_compiler_pic_CXX
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+	  allow_undefined_flag_CXX=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc_CXX=no
+	  else
+	    lt_cv_archive_cmds_need_lc_CXX=yes
+	  fi
+	  allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+      archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+   test -n "$runpath_var_CXX" ||
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct_CXX" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink ||
+   test "$inherit_rpath_CXX" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+FC=no
+export FC
+#  ----------------------------------------------------------------------
+# Check large file support on 32 bit system
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+  enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+	 # IRIX 6.2 and later do not support large files by default,
+	 # so use the C compiler's -n32 option if that helps.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+	 if ac_fn_c_try_compile "$LINENO"; then :
+  break
+fi
+rm -f core conftest.err conftest.$ac_objext
+	 CC="$CC -n32"
+	 if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+	 break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_large_files=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  fi
+fi
+
+#  ----------------------------------------------------------------------
+# Checks for library functions.
+
+
+
+  for ac_header in $ac_header_list
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+for ac_func in getpagesize
+do :
+  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
+if test "x$ac_cv_func_getpagesize" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETPAGESIZE 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
+$as_echo_n "checking for working mmap... " >&6; }
+if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_mmap_fixed_mapped=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+   Here is a matrix of mmap possibilities:
+	mmap private not fixed
+	mmap private fixed at somewhere currently unmapped
+	mmap private fixed at somewhere already mapped
+	mmap shared not fixed
+	mmap shared fixed at somewhere currently unmapped
+	mmap shared fixed at somewhere already mapped
+   For private mappings, we should verify that changes cannot be read()
+   back from the file, nor mmap's back from the file at a different
+   address.  (There have been systems where private was not correctly
+   implemented like the infamous i386 svr4.0, and systems where the
+   VM page cache was not coherent with the file system buffer cache
+   like early versions of FreeBSD and possibly contemporary NetBSD.)
+   For shared mappings, we should conversely verify that changes get
+   propagated back to all the places they're supposed to be.
+
+   Grep wants private fixed already mapped.
+   The main things grep needs to know about mmap are:
+   * does it exist and is it safe to write into the mmap'd area
+   * how to use it (BSD variants)  */
+
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
+char *malloc ();
+#endif
+
+/* This mess was copied from the GNU getpagesize.h.  */
+#ifndef HAVE_GETPAGESIZE
+# ifdef _SC_PAGESIZE
+#  define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+#  ifdef HAVE_SYS_PARAM_H
+#   include <sys/param.h>
+#   ifdef EXEC_PAGESIZE
+#    define getpagesize() EXEC_PAGESIZE
+#   else /* no EXEC_PAGESIZE */
+#    ifdef NBPG
+#     define getpagesize() NBPG * CLSIZE
+#     ifndef CLSIZE
+#      define CLSIZE 1
+#     endif /* no CLSIZE */
+#    else /* no NBPG */
+#     ifdef NBPC
+#      define getpagesize() NBPC
+#     else /* no NBPC */
+#      ifdef PAGESIZE
+#       define getpagesize() PAGESIZE
+#      endif /* PAGESIZE */
+#     endif /* no NBPC */
+#    endif /* no NBPG */
+#   endif /* no EXEC_PAGESIZE */
+#  else /* no HAVE_SYS_PARAM_H */
+#   define getpagesize() 8192	/* punt totally */
+#  endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+int
+main ()
+{
+  char *data, *data2, *data3;
+  const char *cdata2;
+  int i, pagesize;
+  int fd, fd2;
+
+  pagesize = getpagesize ();
+
+  /* First, make a file with some known garbage in it. */
+  data = (char *) malloc (pagesize);
+  if (!data)
+    return 1;
+  for (i = 0; i < pagesize; ++i)
+    *(data + i) = rand ();
+  umask (0);
+  fd = creat ("conftest.mmap", 0600);
+  if (fd < 0)
+    return 2;
+  if (write (fd, data, pagesize) != pagesize)
+    return 3;
+  close (fd);
+
+  /* Next, check that the tail of a page is zero-filled.  File must have
+     non-zero length, otherwise we risk SIGBUS for entire page.  */
+  fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
+  if (fd2 < 0)
+    return 4;
+  cdata2 = "";
+  if (write (fd2, cdata2, 1) != 1)
+    return 5;
+  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
+  if (data2 == MAP_FAILED)
+    return 6;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data2 + i))
+      return 7;
+  close (fd2);
+  if (munmap (data2, pagesize))
+    return 8;
+
+  /* Next, try to mmap the file at a fixed address which already has
+     something else allocated at it.  If we can, also make sure that
+     we see the same garbage.  */
+  fd = open ("conftest.mmap", O_RDWR);
+  if (fd < 0)
+    return 9;
+  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+		     MAP_PRIVATE | MAP_FIXED, fd, 0L))
+    return 10;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data2 + i))
+      return 11;
+
+  /* Finally, make sure that changes to the mapped area do not
+     percolate back to the file as seen by read().  (This is a bug on
+     some variants of i386 svr4.0.)  */
+  for (i = 0; i < pagesize; ++i)
+    *(data2 + i) = *(data2 + i) + 1;
+  data3 = (char *) malloc (pagesize);
+  if (!data3)
+    return 12;
+  if (read (fd, data3, pagesize) != pagesize)
+    return 13;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data3 + i))
+      return 14;
+  close (fd);
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_mmap_fixed_mapped=yes
+else
+  ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
+$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+
+$as_echo "#define HAVE_MMAP 1" >>confdefs.h
+
+fi
+rm -f conftest.mmap conftest.txt
+
+#  ----------------------------------------------------------------------
+# Checks for library malloc.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -lmalloc" >&5
+$as_echo_n "checking for malloc in -lmalloc... " >&6; }
+if ${ac_cv_lib_malloc_malloc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmalloc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char malloc ();
+int
+main ()
+{
+return malloc ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_malloc_malloc=yes
+else
+  ac_cv_lib_malloc_malloc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_malloc_malloc" >&5
+$as_echo "$ac_cv_lib_malloc_malloc" >&6; }
+if test "x$ac_cv_lib_malloc_malloc" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBMALLOC 1
+_ACEOF
+
+  LIBS="-lmalloc $LIBS"
+
+fi
+
+#  ----------------------------------------------------------------------
+# Checks for structures.
+ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+_ACEOF
+
+
+fi
+
+#  ----------------------------------------------------------------------
+# Checks for header files
+for ac_header in sys/resource.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/resource.h" "ac_cv_header_sys_resource_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_resource_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_RESOURCE_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in sys/times.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "sys/times.h" "ac_cv_header_sys_times_h" "$ac_includes_default"
+if test "x$ac_cv_header_sys_times_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SYS_TIMES_H 1
+_ACEOF
+
+fi
+
+done
+
+for ac_header in malloc.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default"
+if test "x$ac_cv_header_malloc_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MALLOC_H 1
+_ACEOF
+
+fi
+
+done
+
+#  ----------------------------------------------------------------------
+# Checks for the availability of functions
+for ac_func in mallinfo
+do :
+  ac_fn_c_check_func "$LINENO" "mallinfo" "ac_cv_func_mallinfo"
+if test "x$ac_cv_func_mallinfo" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MALLINFO 1
+_ACEOF
+
+fi
+done
+
+#  ----------------------------------------------------------------------
+# Checks for the availability of ANSI-C99 functions
+ac_fn_c_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "$ac_includes_default
+#include <math.h>
+"
+if test "x$ac_cv_have_decl_isnan" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISNAN $ac_have_decl
+_ACEOF
+
+for ac_func in getrlimit
+do :
+  ac_fn_c_check_func "$LINENO" "getrlimit" "ac_cv_func_getrlimit"
+if test "x$ac_cv_func_getrlimit" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETRLIMIT 1
+_ACEOF
+
+fi
+done
+
+for ac_func in gethostname
+do :
+  ac_fn_c_check_func "$LINENO" "gethostname" "ac_cv_func_gethostname"
+if test "x$ac_cv_func_gethostname" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETHOSTNAME 1
+_ACEOF
+
+fi
+done
+
+
+# Check compiler version
+case "$CC" in
+  pgcc*)  COMP_VERSION=`$CC -V | head -2 | tail -n 1`;;
+  *gcc*)  COMP_VERSION=`$CC --version | head -n 1`;;
+  g++*)   COMP_VERSION=`$CC --version | head -n 1`;;
+  clang*) COMP_VERSION=`$CC --version | head -n 1`;;
+  sxc*)   COMP_VERSION=`$CC -V 2>&1   | tail -n 1`;;
+  xlc*)   COMP_VERSION=`$CC -qversion 2>&1   | head -n 1`;;
+  *)      COMP_VERSION=`$CC -V 2>&1   | head -n 1`;;
+esac
+
+if test -z "$COMP_VERSION" ; then COMP_VERSION="unknown"; fi;
+
+cat >>confdefs.h <<_ACEOF
+#define COMP_VERSION "$COMP_VERSION"
+_ACEOF
+
+
+# Checks for username, hostname and system type
+USERNAME=$LOGNAME
+if test -z "$USERNAME" ; then USERNAME=$USER; fi;
+if test -z "$USERNAME" ; then USERNAME="unknown"; fi;
+
+cat >>confdefs.h <<_ACEOF
+#define USER_NAME "$USERNAME"
+_ACEOF
+
+USER_NAME="$USERNAME"
+
+
+if test -z "$HOST"; then :
+  HOST=unknown
+       if test -x /bin/hostname; then :
+  HOST=$(hostname)
+else
+  if test -x /bin/uname; then :
+  HOST=$(uname -n)
+fi
+fi
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HOST_NAME "$HOST"
+_ACEOF
+
+HOST_NAME="$HOST"
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define SYSTEM_TYPE "$ac_cv_build"
+_ACEOF
+
+SYSTEM_TYPE="$ac_cv_build"
+
+#  ----------------------------------------------------------------------
+#  Check for math library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5
+$as_echo_n "checking for floor in -lm... " >&6; }
+if ${ac_cv_lib_m_floor+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char floor ();
+int
+main ()
+{
+return floor ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_floor=yes
+else
+  ac_cv_lib_m_floor=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floor" >&5
+$as_echo "$ac_cv_lib_m_floor" >&6; }
+if test "x$ac_cv_lib_m_floor" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+#  ----------------------------------------------------------------------
+# Add configure options
+
+
+
+#  ----------------------------------------------------------------------
+#  Checks for multithreaded compiling + linking
+
+# Check whether --with-threads was given.
+if test "${with_threads+set}" = set; then :
+  withval=$with_threads;
+else
+  with_threads=yes
+fi
+
+THREADS_INCLUDE=''
+THREADS_LIBS=''
+case $with_threads in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking multithreading" >&5
+$as_echo_n "checking multithreading... " >&6; }
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
+$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; }
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_join ();
+int
+main ()
+{
+return pthread_join ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ax_pthread_ok=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+        if test x"$ax_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+#      ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+        ;;
+
+	*-darwin*)
+	ax_pthread_flags="-pthread $ax_pthread_flags"
+	;;
+esac
+
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
+
+        case $flag in
+                none)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
+$as_echo_n "checking whether pthreads work without any flags... " >&6; }
+                ;;
+
+                -*)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5
+$as_echo_n "checking whether pthreads work with $flag... " >&6; }
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+		pthread-config)
+		# Extract the first word of "pthread-config", so it can be a program name with args.
+set dummy pthread-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ax_pthread_config+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ax_pthread_config"; then
+  ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ax_pthread_config="yes"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
+fi
+fi
+ax_pthread_config=$ac_cv_prog_ax_pthread_config
+if test -n "$ax_pthread_config"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
+$as_echo "$ax_pthread_config" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+		if test x"$ax_pthread_config" = xno; then continue; fi
+		PTHREAD_CFLAGS="`pthread-config --cflags`"
+		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+		;;
+
+                *)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
+$as_echo_n "checking for the pthreads library -l$flag... " >&6; }
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+		     static void routine(void* a) {a=0;}
+		     static void* start_routine(void* a) {return a;}
+int
+main ()
+{
+pthread_t th; pthread_attr_t attr;
+                     pthread_create(&th,0,start_routine,0);
+                     pthread_join(th, 0);
+                     pthread_attr_init(&attr);
+                     pthread_cleanup_push(routine, 0);
+                     pthread_cleanup_pop(0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ax_pthread_ok=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+        if test "x$ax_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
+$as_echo_n "checking for joinable pthread attribute... " >&6; }
+	attr_name=unknown
+	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+int attr=$attr; return attr;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  attr_name=$attr; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	done
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5
+$as_echo "$attr_name" >&6; }
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+
+cat >>confdefs.h <<_ACEOF
+#define PTHREAD_CREATE_JOINABLE $attr_name
+_ACEOF
+
+        fi
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5
+$as_echo_n "checking if more special flags are required for pthreads... " >&6; }
+        flag=no
+        case "${host_cpu}-${host_os}" in
+            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5
+$as_echo "${flag}" >&6; }
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with xlc_r or cc_r
+	if test x"$GCC" != xyes; then
+          for ac_prog in xlc_r cc_r
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PTHREAD_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$PTHREAD_CC"; then
+  ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PTHREAD_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
+if test -n "$PTHREAD_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
+$as_echo "$PTHREAD_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$PTHREAD_CC" && break
+done
+test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}"
+
+        else
+          PTHREAD_CC=$CC
+	fi
+else
+        PTHREAD_CC="$CC"
+fi
+
+
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ax_pthread_ok" = xyes; then
+
+$as_echo "#define HAVE_LIBPTHREAD 1" >>confdefs.h
+
+        :
+else
+        ax_pthread_ok=no
+        as_fn_error $? "multithreaded settings NOT found" "$LINENO" 5
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+               LIBS="$PTHREAD_LIBS $LIBS"
+               CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+               CC="$PTHREAD_CC"
+               $as_echo "CC:$CC CFLAGS:$CFLAGS LIBS:$LIBS" ;; #(
+  *) :
+    THREADS_ROOT=$with_threads
+             LDFLAGS="-L$THREADS_ROOT/lib $LDFLAGS"
+             CPPFLAGS="-I$THREADS_ROOT/include $CPPFLAGS "
+             for ac_header in pthread.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_H 1
+_ACEOF
+
+fi
+
+done
+
+             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
+$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthread_pthread_create=yes
+else
+  ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPTHREAD 1
+_ACEOF
+
+  LIBS="-lpthread $LIBS"
+
+fi
+
+             THREADS_LIBS=" -L$THREADS_ROOT/lib -lpthread"
+             THREADS_INCLUDE=" -I$THREADS_ROOT/include" ;; #(
+  *) :
+     ;;
+esac
+
+
+#  ----------------------------------------------------------------------
+#  Link application to ZLIB library, needed for netcdf
+ZLIB_INCLUDE=''
+ZLIB_LIBS=''
+
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+  withval=$with_zlib; case "$with_zlib" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZLIB library" >&5
+$as_echo_n "checking for ZLIB library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in zlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing deflate" >&5
+$as_echo_n "checking for library containing deflate... " >&6; }
+if ${ac_cv_search_deflate+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char deflate ();
+int
+main ()
+{
+return deflate ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' z; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_deflate=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_deflate+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_deflate+:} false; then :
+
+else
+  ac_cv_search_deflate=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflate" >&5
+$as_echo "$ac_cv_search_deflate" >&6; }
+ac_res=$ac_cv_search_deflate
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+fi
+
+                            ZLIB_LIBS=" -lz" ;; #(
+  *) :
+    ZLIB_ROOT=$with_zlib
+                          LDFLAGS="-L$ZLIB_ROOT/lib $LDFLAGS"
+                          CPPFLAGS="-I$ZLIB_ROOT/include $CPPFLAGS"
+                          for ac_header in zlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+                          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing deflate" >&5
+$as_echo_n "checking for library containing deflate... " >&6; }
+if ${ac_cv_search_deflate+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char deflate ();
+int
+main ()
+{
+return deflate ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' z; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_deflate=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_deflate+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_deflate+:} false; then :
+
+else
+  ac_cv_search_deflate=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflate" >&5
+$as_echo "$ac_cv_search_deflate" >&6; }
+ac_res=$ac_cv_search_deflate
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+fi
+
+                          ZLIB_INCLUDE=" -I$ZLIB_ROOT/include"
+                          ZLIB_LIBS=" -L$ZLIB_ROOT/lib -lz" ;; #(
+  *) :
+     ;;
+esac
+else
+  for ac_header in zlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+                      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing deflate" >&5
+$as_echo_n "checking for library containing deflate... " >&6; }
+if ${ac_cv_search_deflate+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char deflate ();
+int
+main ()
+{
+return deflate ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' z; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_deflate=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_deflate+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_deflate+:} false; then :
+
+else
+  ac_cv_search_deflate=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflate" >&5
+$as_echo "$ac_cv_search_deflate" >&6; }
+ac_res=$ac_cv_search_deflate
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+fi
+
+              ZLIB_LIBS=" -lz"
+fi
+
+
+
+#  ----------------------------------------------------------------------
+#  Compile application with SZLIB library, needed for GRIB1 or for
+#  linking against hdf5/netcdf4
+SZLIB_INCLUDE=''
+SZLIB_LIBS=''
+
+# Check whether --with-szlib was given.
+if test "${with_szlib+set}" = set; then :
+  withval=$with_szlib; case "$with_szlib" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for szlib library" >&5
+$as_echo_n "checking for szlib library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in szlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "szlib.h" "ac_cv_header_szlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_szlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SZ_BufftoBuffCompress" >&5
+$as_echo_n "checking for library containing SZ_BufftoBuffCompress... " >&6; }
+if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SZ_BufftoBuffCompress ();
+int
+main ()
+{
+return SZ_BufftoBuffCompress ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' sz; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_SZ_BufftoBuffCompress=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+
+else
+  ac_cv_search_SZ_BufftoBuffCompress=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SZ_BufftoBuffCompress" >&5
+$as_echo "$ac_cv_search_SZ_BufftoBuffCompress" >&6; }
+ac_res=$ac_cv_search_SZ_BufftoBuffCompress
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBSZ 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to szlib" "$LINENO" 5
+fi
+
+                            SZLIB_LIBS=" -lsz" ;; #(
+  *) :
+    SZLIB_ROOT=$with_szlib
+                          if test -d "$SZLIB_ROOT"; then :
+  LDFLAGS="-L$SZLIB_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$SZLIB_ROOT/include $CPPFLAGS"
+                                 for ac_header in szlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "szlib.h" "ac_cv_header_szlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_szlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SZ_BufftoBuffCompress" >&5
+$as_echo_n "checking for library containing SZ_BufftoBuffCompress... " >&6; }
+if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SZ_BufftoBuffCompress ();
+int
+main ()
+{
+return SZ_BufftoBuffCompress ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' sz; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_SZ_BufftoBuffCompress=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+
+else
+  ac_cv_search_SZ_BufftoBuffCompress=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SZ_BufftoBuffCompress" >&5
+$as_echo "$ac_cv_search_SZ_BufftoBuffCompress" >&6; }
+ac_res=$ac_cv_search_SZ_BufftoBuffCompress
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBSZ 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to szlib" "$LINENO" 5
+fi
+
+                                 SZLIB_LIBS=" -L$SZLIB_ROOT/lib -lsz"
+                                 SZLIB_INCLUDE=" -I$SZLIB_ROOT/include"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: $SZLIB_ROOT is not a directory! SZLIB suppressed" >&5
+$as_echo "$as_me: $SZLIB_ROOT is not a directory! SZLIB suppressed" >&6;}
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for szlib library" >&5
+$as_echo_n "checking for szlib library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+
+#  ----------------------------------------------------------------------
+#  Link application with HDF5 library, required for netcdf4
+HDF5_ROOT=''
+HDF5_INCLUDE=''
+HDF5_LIBS=''
+
+# Check whether --with-hdf5 was given.
+if test "${with_hdf5+set}" = set; then :
+  withval=$with_hdf5; case "$with_hdf5" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hdf5 library" >&5
+$as_echo_n "checking for hdf5 library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in hdf5.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default"
+if test "x$ac_cv_header_hdf5_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_HDF5_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5Fopen" >&5
+$as_echo_n "checking for library containing H5Fopen... " >&6; }
+if ${ac_cv_search_H5Fopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char H5Fopen ();
+int
+main ()
+{
+return H5Fopen ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' hdf5; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_H5Fopen=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_H5Fopen+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_H5Fopen+:} false; then :
+
+else
+  ac_cv_search_H5Fopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5Fopen" >&5
+$as_echo "$ac_cv_search_H5Fopen" >&6; }
+ac_res=$ac_cv_search_H5Fopen
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBHDF5 1" >>confdefs.h
+
+else
+  as_fn_error $? "Cannot link to hdf5 library! It is required for Netcdf4" "$LINENO" 5
+fi
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5DSis_scale" >&5
+$as_echo_n "checking for library containing H5DSis_scale... " >&6; }
+if ${ac_cv_search_H5DSis_scale+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char H5DSis_scale ();
+int
+main ()
+{
+return H5DSis_scale ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' hdf5_hl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_H5DSis_scale=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_H5DSis_scale+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_H5DSis_scale+:} false; then :
+
+else
+  ac_cv_search_H5DSis_scale=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5DSis_scale" >&5
+$as_echo "$ac_cv_search_H5DSis_scale" >&6; }
+ac_res=$ac_cv_search_H5DSis_scale
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  have_hdf5_hl=yes
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot find hdf5 high level interface! It is required for netCDF4." >&5
+$as_echo "$as_me: Cannot find hdf5 high level interface! It is required for netCDF4." >&6;}
+                                            have_hdf5_hl=no
+fi
+
+                            if test "x$have_libhdf5_hl" = xyes; then :
+  HDF5_LIBS=" -lhdf5_hl -lhdf5"
+else
+  HDF5_LIBS=" -lhdf5"
+fi
+                             ;; #(
+  *) :
+    if test -d "$with_hdf5"; then :
+  HDF5_ROOT="$with_hdf5"
+                                 LDFLAGS="-L$HDF5_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$HDF5_ROOT/include $CPPFLAGS"
+                                 for ac_header in hdf5.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default"
+if test "x$ac_cv_header_hdf5_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_HDF5_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5Fopen" >&5
+$as_echo_n "checking for library containing H5Fopen... " >&6; }
+if ${ac_cv_search_H5Fopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char H5Fopen ();
+int
+main ()
+{
+return H5Fopen ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' hdf5; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_H5Fopen=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_H5Fopen+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_H5Fopen+:} false; then :
+
+else
+  ac_cv_search_H5Fopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5Fopen" >&5
+$as_echo "$ac_cv_search_H5Fopen" >&6; }
+ac_res=$ac_cv_search_H5Fopen
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBHDF5 1" >>confdefs.h
+
+else
+  as_fn_error $? "Cannot link to hdf5! It is required for netCDF4." "$LINENO" 5
+fi
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5DSis_scale" >&5
+$as_echo_n "checking for library containing H5DSis_scale... " >&6; }
+if ${ac_cv_search_H5DSis_scale+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char H5DSis_scale ();
+int
+main ()
+{
+return H5DSis_scale ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' hdf5_hl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_H5DSis_scale=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_H5DSis_scale+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_H5DSis_scale+:} false; then :
+
+else
+  ac_cv_search_H5DSis_scale=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5DSis_scale" >&5
+$as_echo "$ac_cv_search_H5DSis_scale" >&6; }
+ac_res=$ac_cv_search_H5DSis_scale
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  have_hdf5_hl=yes
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot link to hdf5 high level interface! It is required for netCDF4.\
+                                                                HDF5 must be built with zlib; the location of zlib must be specified for HDF5 with the \
+                                                                --with-zlib option. If HDF5 was also built with szlib, then the location of szlib must also be \
+                                                                specified with the --with-szlib option.." >&5
+$as_echo "$as_me: Cannot link to hdf5 high level interface! It is required for netCDF4.\
+                                                                HDF5 must be built with zlib; the location of zlib must be specified for HDF5 with the \
+                                                                --with-zlib option. If HDF5 was also built with szlib, then the location of szlib must also be \
+                                                                specified with the --with-szlib option.." >&6;}
+                                                have_hdf5_hl=no
+fi
+
+                                 if test "x$have_libhdf5_hl" = 'xyes'; then :
+  HDF5_LIBS=" -L$HDF5_ROOT/lib -lhdf5_hl -lhdf5"
+else
+  HDF5_LIBS=" -L$HDF5_ROOT/lib -lhdf5"
+fi
+                                 HDF5_INCLUDE=" -I$HDF5_ROOT/include"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: $with_hdf5 is not a directory! HDF5 suppressed" >&5
+$as_echo "$as_me: $with_hdf5 is not a directory! HDF5 suppressed" >&6;}
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hdf5 library" >&5
+$as_echo_n "checking for hdf5 library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+
+
+#  ----------------------------------------------------------------------
+#  Compile application with netcdf
+NETCDF_ROOT=''
+NETCDF_INCLUDE=''
+NETCDF_LIBS=''
+
+# Check whether --with-netcdf was given.
+if test "${with_netcdf+set}" = set; then :
+  withval=$with_netcdf; case "$with_netcdf" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for netcdf library" >&5
+$as_echo_n "checking for netcdf library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in netcdf.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default"
+if test "x$ac_cv_header_netcdf_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_NETCDF_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nc_open" >&5
+$as_echo_n "checking for library containing nc_open... " >&6; }
+if ${ac_cv_search_nc_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nc_open ();
+int
+main ()
+{
+return nc_open ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' netcdf; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_nc_open=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_nc_open+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_nc_open+:} false; then :
+
+else
+  ac_cv_search_nc_open=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nc_open" >&5
+$as_echo "$ac_cv_search_nc_open" >&6; }
+ac_res=$ac_cv_search_nc_open
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBNETCDF 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to netcdf library" "$LINENO" 5
+fi
+
+                            NETCDF_LIBS=" -lnetcdf"
+                            # Extract the first word of "nc-config", so it can be a program name with args.
+set dummy nc-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NC_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NC_CONFIG"; then
+  ac_cv_prog_NC_CONFIG="$NC_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NC_CONFIG="nc-config"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NC_CONFIG=$ac_cv_prog_NC_CONFIG
+if test -n "$NC_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NC_CONFIG" >&5
+$as_echo "$NC_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+                            if test "x$NC_CONFIG" != "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's nc2 support" >&5
+$as_echo_n "checking netcdf's nc2 support... " >&6; }
+                                   if test "x$($NC_CONFIG --has-nc2)" = "xyes"; then :
+
+$as_echo "#define HAVE_NETCDF2 1" >>confdefs.h
+
+                                          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+                                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's nc4 support" >&5
+$as_echo_n "checking netcdf's nc4 support... " >&6; }
+                                   if test "x$($NC_CONFIG --has-nc4)" = "xyes"; then :
+
+$as_echo "#define HAVE_NETCDF4 1" >>confdefs.h
+
+                                          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+else
+  $as_echo Could not find nc-config! go on with default configuration
+fi ;; #(
+  *) :
+    if test -d "$with_netcdf"; then :
+  NETCDF_ROOT=$with_netcdf
+                                 LDFLAGS="-L$NETCDF_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$NETCDF_ROOT/include $CPPFLAGS"
+                                 for ac_header in netcdf.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default"
+if test "x$ac_cv_header_netcdf_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_NETCDF_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nc_open" >&5
+$as_echo_n "checking for library containing nc_open... " >&6; }
+if ${ac_cv_search_nc_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nc_open ();
+int
+main ()
+{
+return nc_open ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' netcdf; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_nc_open=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_nc_open+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_nc_open+:} false; then :
+
+else
+  ac_cv_search_nc_open=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nc_open" >&5
+$as_echo "$ac_cv_search_nc_open" >&6; }
+ac_res=$ac_cv_search_nc_open
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBNETCDF 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to netcdf library" "$LINENO" 5
+fi
+
+                                 NETCDF_LIBS=" -L$NETCDF_ROOT/lib -lnetcdf"
+                                 NETCDF_INCLUDE=" -I$NETCDF_ROOT/include"
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking nc-config script" >&5
+$as_echo_n "checking nc-config script... " >&6; }
+                                 # Extract the first word of "nc-config", so it can be a program name with args.
+set dummy nc-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NC_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NC_CONFIG"; then
+  ac_cv_prog_NC_CONFIG="$NC_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in "$NETCDF_ROOT/bin"
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NC_CONFIG="$NETCDF_ROOT/bin/nc-config"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NC_CONFIG=$ac_cv_prog_NC_CONFIG
+if test -n "$NC_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NC_CONFIG" >&5
+$as_echo "$NC_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+                                 if test "x$NC_CONFIG" != "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's OpenDAP support" >&5
+$as_echo_n "checking netcdf's OpenDAP support... " >&6; }
+                                   if test "x$($NC_CONFIG --has-dap)" = "xyes"; then :
+
+$as_echo "#define HAVE_LIBNC_DAP 1" >>confdefs.h
+
+                                          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+                                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's nc2 support" >&5
+$as_echo_n "checking netcdf's nc2 support... " >&6; }
+                                   if test "x$($NC_CONFIG --has-nc2)" = "xyes"; then :
+
+$as_echo "#define HAVE_NETCDF2 1" >>confdefs.h
+
+                                          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+                                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's nc4 support" >&5
+$as_echo_n "checking netcdf's nc4 support... " >&6; }
+                                   if test "x$($NC_CONFIG --has-nc4)" = "xyes"; then :
+
+$as_echo "#define HAVE_NETCDF4 1" >>confdefs.h
+
+                                          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Could not find nc-config! go on with default configuration" >&5
+$as_echo "Could not find nc-config! go on with default configuration" >&6; }
+fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: $with_netcdf is not a directory! NETCDF suppressed" >&5
+$as_echo "$as_me: $with_netcdf is not a directory! NETCDF suppressed" >&6;}
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NETCDF library" >&5
+$as_echo_n "checking for NETCDF library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+
+
+#  ----------------------------------------------------------------------
+#  Link application with JASPER library (needed for GRIB2 compression)
+JASPER_LIBS=''
+
+# Check whether --with-jasper was given.
+if test "${with_jasper+set}" = set; then :
+  withval=$with_jasper; case "$with_jasper" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jasper library" >&5
+$as_echo_n "checking for jasper library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in jasper.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "jasper.h" "ac_cv_header_jasper_h" "$ac_includes_default"
+if test "x$ac_cv_header_jasper_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_JASPER_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing jas_init" >&5
+$as_echo_n "checking for library containing jas_init... " >&6; }
+if ${ac_cv_search_jas_init+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char jas_init ();
+int
+main ()
+{
+return jas_init ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' jasper; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_jas_init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_jas_init+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_jas_init+:} false; then :
+
+else
+  ac_cv_search_jas_init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_jas_init" >&5
+$as_echo "$ac_cv_search_jas_init" >&6; }
+ac_res=$ac_cv_search_jas_init
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBJASPER 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to jasper library! Required for GRIB_API" "$LINENO" 5
+fi
+
+                            JASPER_LIBS=" -ljasper"
+ ;; #(
+  *) :
+    JASPER_ROOT=$with_jasper
+                          if test -d "$JASPER_ROOT"; then :
+  LDFLAGS="$LDFLAGS -L$JASPER_ROOT/lib"
+                                 CPPFLAGS="$CPPFLAGS -I$JASPER_ROOT/include"
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing jas_stream_memopen" >&5
+$as_echo_n "checking for library containing jas_stream_memopen... " >&6; }
+if ${ac_cv_search_jas_stream_memopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char jas_stream_memopen ();
+int
+main ()
+{
+return jas_stream_memopen ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' jasper; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_jas_stream_memopen=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_jas_stream_memopen+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_jas_stream_memopen+:} false; then :
+
+else
+  ac_cv_search_jas_stream_memopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_jas_stream_memopen" >&5
+$as_echo "$ac_cv_search_jas_stream_memopen" >&6; }
+ac_res=$ac_cv_search_jas_stream_memopen
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBJASPER 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to jasper library! Required for GRIB_API" "$LINENO" 5
+fi
+
+                                 JASPER_LIBS=" -L$JASPER_ROOT/lib -ljasper"
+else
+  as_fn_error $? "$JASPER_ROOT is not a directory! JASPER suppressed" "$LINENO" 5
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the JASPER library" >&5
+$as_echo_n "checking for the JASPER library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+#  ----------------------------------------------------------------------
+#  Compile application with GRIB_API library (for GRIB2 support)
+GRIB_API_INCLUDE=''
+GRIB_API_LIBS=''
+
+# Check whether --with-grib_api was given.
+if test "${with_grib_api+set}" = set; then :
+  withval=$with_grib_api; case "$with_grib_api" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GRIB_API library" >&5
+$as_echo_n "checking for GRIB_API library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in grib_api.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "grib_api.h" "ac_cv_header_grib_api_h" "$ac_includes_default"
+if test "x$ac_cv_header_grib_api_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GRIB_API_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing grib_get_message" >&5
+$as_echo_n "checking for library containing grib_get_message... " >&6; }
+if ${ac_cv_search_grib_get_message+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char grib_get_message ();
+int
+main ()
+{
+return grib_get_message ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' grib_api; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_grib_get_message=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_grib_get_message+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_grib_get_message+:} false; then :
+
+else
+  ac_cv_search_grib_get_message=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_grib_get_message" >&5
+$as_echo "$ac_cv_search_grib_get_message" >&6; }
+ac_res=$ac_cv_search_grib_get_message
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBGRIB_API 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to grib_api library" "$LINENO" 5
+fi
+ ;; #(
+  *) :
+    GRIB_API_ROOT=$with_grib_api
+                          if test -d "$GRIB_API_ROOT"; then :
+  LDFLAGS="-L$GRIB_API_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$GRIB_API_ROOT/include $CPPFLAGS"
+                                 for ac_header in grib_api.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "grib_api.h" "ac_cv_header_grib_api_h" "$ac_includes_default"
+if test "x$ac_cv_header_grib_api_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GRIB_API_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing grib_get_message" >&5
+$as_echo_n "checking for library containing grib_get_message... " >&6; }
+if ${ac_cv_search_grib_get_message+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char grib_get_message ();
+int
+main ()
+{
+return grib_get_message ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' grib_api; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_grib_get_message=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_grib_get_message+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_grib_get_message+:} false; then :
+
+else
+  ac_cv_search_grib_get_message=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_grib_get_message" >&5
+$as_echo "$ac_cv_search_grib_get_message" >&6; }
+ac_res=$ac_cv_search_grib_get_message
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBGRIB_API 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to grib_api library" "$LINENO" 5
+fi
+
+                                 GRIB_API_LIBS=" -L$GRIB_API_ROOT/lib -lgrib_api"
+                                 GRIB_API_INCLUDE=" -I$GRIB_API_ROOT/include"
+else
+  as_fn_error $? "$GRIB_API_ROOT is not a directory! GRIB_API suppressed" "$LINENO" 5
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the GRIB_API library" >&5
+$as_echo_n "checking for the GRIB_API library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+
+#  ----------------------------------------------------------------------
+#  Enable GRIB support
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GRIB support" >&5
+$as_echo_n "checking for GRIB support... " >&6; }
+# Check whether --enable-grib was given.
+if test "${enable_grib+set}" = set; then :
+  enableval=$enable_grib; if test "x$enable_grib" != 'xno'; then :
+
+$as_echo "#define HAVE_LIBGRIB 1" >>confdefs.h
+
+                      enable_grib=yes
+fi
+else
+
+$as_echo "#define HAVE_LIBGRIB 1" >>confdefs.h
+
+               enable_grib=yes
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_grib" >&5
+$as_echo "$enable_grib" >&6; }
+ENABLE_GRIB=$enable_grib
+
+#  ----------------------------------------------------------------------
+#  Compile interface with internal CGRIBEX library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CGRIBEX support" >&5
+$as_echo_n "checking for CGRIBEX support... " >&6; }
+# Check whether --enable-cgribex was given.
+if test "${enable_cgribex+set}" = set; then :
+  enableval=$enable_cgribex; if test "x$enable_cgribex" != 'xno'; then :
+
+$as_echo "#define HAVE_LIBCGRIBEX 1" >>confdefs.h
+
+                      enable_cgribex=yes
+fi
+else
+
+$as_echo "#define HAVE_LIBCGRIBEX 1" >>confdefs.h
+
+               enable_cgribex=yes
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_cgribex" >&5
+$as_echo "$enable_cgribex" >&6; }
+ENABLE_CGRIBEX=$enable_cgribex
+
+#  ----------------------------------------------------------------------
+#  Compile interface with internal SERVICE library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SERVICE support" >&5
+$as_echo_n "checking for SERVICE support... " >&6; }
+# Check whether --enable-service was given.
+if test "${enable_service+set}" = set; then :
+  enableval=$enable_service; if test "x$enable_service" != 'xno'; then :
+
+$as_echo "#define HAVE_LIBSERVICE 1" >>confdefs.h
+
+                      enable_service=yes
+fi
+else
+
+$as_echo "#define HAVE_LIBSERVICE 1" >>confdefs.h
+
+               enable_service=yes
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_service" >&5
+$as_echo "$enable_service" >&6; }
+ENABLE_SERVICE=$enable_service
+
+#  ----------------------------------------------------------------------
+#  Compile interface with internal EXTRA library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXTRA support" >&5
+$as_echo_n "checking for EXTRA support... " >&6; }
+# Check whether --enable-extra was given.
+if test "${enable_extra+set}" = set; then :
+  enableval=$enable_extra; if test "x$enable_extra" != 'xno'; then :
+
+$as_echo "#define HAVE_LIBEXTRA 1" >>confdefs.h
+
+                      enable_extra=yes
+fi
+else
+
+$as_echo "#define HAVE_LIBEXTRA 1" >>confdefs.h
+
+               enable_extra=yes
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_extra" >&5
+$as_echo "$enable_extra" >&6; }
+ENABLE_EXTRA=$enable_extra
+
+#  ----------------------------------------------------------------------
+#  Compile interface with internal IEG library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IEG support" >&5
+$as_echo_n "checking for IEG support... " >&6; }
+# Check whether --enable-ieg was given.
+if test "${enable_ieg+set}" = set; then :
+  enableval=$enable_ieg; if test "x$enable_ieg" != 'xno'; then :
+
+$as_echo "#define HAVE_LIBIEG 1" >>confdefs.h
+
+                      enable_ieg=yes
+fi
+else
+
+$as_echo "#define HAVE_LIBIEG 1" >>confdefs.h
+
+               enable_ieg=yes
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_ieg" >&5
+$as_echo "$enable_ieg" >&6; }
+ENABLE_IEG=$enable_ieg
+
+#  ----------------------------------------------------------------------
+#  Checks for PROJ.4 library
+
+# Check whether --with-proj was given.
+if test "${with_proj+set}" = set; then :
+  withval=$with_proj; case "$with_proj" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for proj library" >&5
+$as_echo_n "checking for proj library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in proj_api.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default"
+if test "x$ac_cv_header_proj_api_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PROJ_API_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pj_init" >&5
+$as_echo_n "checking for library containing pj_init... " >&6; }
+if ${ac_cv_search_pj_init+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pj_init ();
+int
+main ()
+{
+return pj_init ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' proj; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_pj_init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_pj_init+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_pj_init+:} false; then :
+
+else
+  ac_cv_search_pj_init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pj_init" >&5
+$as_echo "$ac_cv_search_pj_init" >&6; }
+ac_res=$ac_cv_search_pj_init
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBPROJ 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to PROJ library!" "$LINENO" 5
+fi
+
+                            PROJ_LDFLAGS=" -lproj"
+
+                            PROJ_INCLUDE=""
+ ;; #(
+  *) :
+    PROJ_ROOT=$with_proj
+                          if test -d "$PROJ_ROOT"; then :
+  LDFLAGS="-L$PROJ_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$PROJ_ROOT/include $CPPFLAGS"
+                                 for ac_header in proj_api.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "proj_api.h" "ac_cv_header_proj_api_h" "$ac_includes_default"
+if test "x$ac_cv_header_proj_api_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PROJ_API_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing pj_init" >&5
+$as_echo_n "checking for library containing pj_init... " >&6; }
+if ${ac_cv_search_pj_init+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pj_init ();
+int
+main ()
+{
+return pj_init ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' proj; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_pj_init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_pj_init+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_pj_init+:} false; then :
+
+else
+  ac_cv_search_pj_init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_pj_init" >&5
+$as_echo "$ac_cv_search_pj_init" >&6; }
+ac_res=$ac_cv_search_pj_init
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBPROJ 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to PROJ library!" "$LINENO" 5
+fi
+
+                                 PROJ_LDFLAGS=" -L$PROJ_ROOT/lib -lproj"
+
+                                 PROJ_INCLUDE=" -I$PROJ_ROOT/include"
+
+else
+  as_fn_error $? "$PROJ_ROOT is not a directory! PROJ suppressed" "$LINENO" 5
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the PROJ library" >&5
+$as_echo_n "checking for the PROJ library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+#  ----------------------------------------------------------------------
+#  Link application with UDUNITS2 library
+
+# Check whether --with-udunits2 was given.
+if test "${with_udunits2+set}" = set; then :
+  withval=$with_udunits2; case "$with_udunits2" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for udunits2 library" >&5
+$as_echo_n "checking for udunits2 library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in udunits2.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "udunits2.h" "ac_cv_header_udunits2_h" "$ac_includes_default"
+if test "x$ac_cv_header_udunits2_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_UDUNITS2_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ut_parse" >&5
+$as_echo_n "checking for library containing ut_parse... " >&6; }
+if ${ac_cv_search_ut_parse+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ut_parse ();
+int
+main ()
+{
+return ut_parse ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' udunits2; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_ut_parse=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_ut_parse+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_ut_parse+:} false; then :
+
+else
+  ac_cv_search_ut_parse=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ut_parse" >&5
+$as_echo "$ac_cv_search_ut_parse" >&6; }
+ac_res=$ac_cv_search_ut_parse
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBUDUNITS2 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to udunits2 library!" "$LINENO" 5
+fi
+
+                            UDUNITS_LDFLAGS=" -ludunits2"
+
+                            UDUNITS_INCLUDE=""
+ ;; #(
+  *) :
+    UDUNITS_ROOT=$with_udunits2
+                          if test -d "$UDUNITS_ROOT"; then :
+  LDFLAGS="$LDFLAGS -L$UDUNITS_ROOT/lib"
+                                 CPPFLAGS="$CPPFLAGS -I$UDUNITS_ROOT/include"
+                                 for ac_header in udunits2.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "udunits2.h" "ac_cv_header_udunits2_h" "$ac_includes_default"
+if test "x$ac_cv_header_udunits2_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_UDUNITS2_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing ut_parse" >&5
+$as_echo_n "checking for library containing ut_parse... " >&6; }
+if ${ac_cv_search_ut_parse+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char ut_parse ();
+int
+main ()
+{
+return ut_parse ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' udunits2; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_ut_parse=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_ut_parse+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_ut_parse+:} false; then :
+
+else
+  ac_cv_search_ut_parse=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_ut_parse" >&5
+$as_echo "$ac_cv_search_ut_parse" >&6; }
+ac_res=$ac_cv_search_ut_parse
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBUDUNITS2 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to udunits2 library!" "$LINENO" 5
+fi
+
+                                 UDUNITS_LDFLAGS=" -L$UDUNITS_ROOT/lib -ludunits2"
+
+                                 UDUNITS_INCLUDE=" -I$UDUNITS_ROOT/include"
+
+else
+  as_fn_error $? "$UDUNITS_ROOT is not a directory! UDUNITS2 suppressed" "$LINENO" 5
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the UDUNITS2 library" >&5
+$as_echo_n "checking for the UDUNITS2 library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+#  ----------------------------------------------------------------------
+#  Compile application with MAGICS (xml required)
+MAGICS_ROOT=''
+MAGICS_INCLUDE=''
+MAGICS_LIBS=''
+
+# Check whether --with-magics was given.
+if test "${with_magics+set}" = set; then :
+  withval=$with_magics; case "$with_magics" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for magics library" >&5
+$as_echo_n "checking for magics library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in magics_api.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "magics_api.h" "ac_cv_header_magics_api_h" "$ac_includes_default"
+if test "x$ac_cv_header_magics_api_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MAGICS_API_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mag_open" >&5
+$as_echo_n "checking for library containing mag_open... " >&6; }
+if ${ac_cv_search_mag_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char mag_open ();
+int
+main ()
+{
+return mag_open ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' MagPlus; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_mag_open=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_mag_open+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_mag_open+:} false; then :
+
+else
+  ac_cv_search_mag_open=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mag_open" >&5
+$as_echo "$ac_cv_search_mag_open" >&6; }
+ac_res=$ac_cv_search_mag_open
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBMAGICS 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to magics library" "$LINENO" 5
+fi
+
+                            MAGICS_LIBS=" -lMagPlus"
+ ;; #(
+  *) :
+    if test -d "$with_magics"; then :
+  MAGICS_ROOT=$with_magics
+                                 LDFLAGS="-L$MAGICS_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$MAGICS_ROOT/include/magics $CPPFLAGS"
+                                 for ac_header in magics_api.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "magics_api.h" "ac_cv_header_magics_api_h" "$ac_includes_default"
+if test "x$ac_cv_header_magics_api_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MAGICS_API_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing mag_open" >&5
+$as_echo_n "checking for library containing mag_open... " >&6; }
+if ${ac_cv_search_mag_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char mag_open ();
+int
+main ()
+{
+return mag_open ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' MagPlus; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_mag_open=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_mag_open+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_mag_open+:} false; then :
+
+else
+  ac_cv_search_mag_open=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_mag_open" >&5
+$as_echo "$ac_cv_search_mag_open" >&6; }
+ac_res=$ac_cv_search_mag_open
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBMAGICS 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to magics library" "$LINENO" 5
+fi
+
+                                 MAGICS_LIBS=" -L$MAGICS_ROOT/lib -lMagPlus"
+                                 MAGICS_INCLUDE=" -I$MAGICS_ROOT/include/magics"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: $with_magics is not a directory! MAGICS suppressed" >&5
+$as_echo "$as_me: $with_magics is not a directory! MAGICS suppressed" >&6;}
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for MAGICS library" >&5
+$as_echo_n "checking for MAGICS library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+
+
+
+# Check whether --with-libxml2 was given.
+if test "${with_libxml2+set}" = set; then :
+  withval=$with_libxml2; case "$with_libxml2" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libxml2 library" >&5
+$as_echo_n "checking for libxml2 library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2"
+                            for ac_header in libxml/parser.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default"
+if test "x$ac_cv_header_libxml_parser_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXML_PARSER_H 1
+_ACEOF
+
+fi
+
+done
+
+                            for ac_header in libxml/tree.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "libxml/tree.h" "ac_cv_header_libxml_tree_h" "$ac_includes_default"
+if test "x$ac_cv_header_libxml_tree_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXML_TREE_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing xmlInitMemory" >&5
+$as_echo_n "checking for library containing xmlInitMemory... " >&6; }
+if ${ac_cv_search_xmlInitMemory+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char xmlInitMemory ();
+int
+main ()
+{
+return xmlInitMemory ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' xml2; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_xmlInitMemory=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_xmlInitMemory+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_xmlInitMemory+:} false; then :
+
+else
+  ac_cv_search_xmlInitMemory=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_xmlInitMemory" >&5
+$as_echo "$ac_cv_search_xmlInitMemory" >&6; }
+ac_res=$ac_cv_search_xmlInitMemory
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBXML2 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to libxml2 library" "$LINENO" 5
+fi
+
+                            XML2_LIBS=" -lxml2"
+ ;; #(
+  *) :
+    if test -d "$with_libxml2"; then :
+  XML2_ROOT=$with_libxml2
+                                 LDFLAGS="-L$XML2_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$XML2_ROOT/include/libxml2 $CPPFLAGS"
+                                 for ac_header in libxml/parser.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "libxml/parser.h" "ac_cv_header_libxml_parser_h" "$ac_includes_default"
+if test "x$ac_cv_header_libxml_parser_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXML_PARSER_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 for ac_header in libxml/tree.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "libxml/tree.h" "ac_cv_header_libxml_tree_h" "$ac_includes_default"
+if test "x$ac_cv_header_libxml_tree_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBXML_TREE_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing xmlInitMemory" >&5
+$as_echo_n "checking for library containing xmlInitMemory... " >&6; }
+if ${ac_cv_search_xmlInitMemory+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char xmlInitMemory ();
+int
+main ()
+{
+return xmlInitMemory ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' xml2; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_xmlInitMemory=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_xmlInitMemory+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_xmlInitMemory+:} false; then :
+
+else
+  ac_cv_search_xmlInitMemory=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_xmlInitMemory" >&5
+$as_echo "$ac_cv_search_xmlInitMemory" >&6; }
+ac_res=$ac_cv_search_xmlInitMemory
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBXML2 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to libxml2 library" "$LINENO" 5
+fi
+
+                                 XML2_LIBS=" -L$XML2_ROOT/lib -lxml2"
+                                 XML2_INCLUDE=" -I$XML2_ROOT/include/libxml2"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: $with_libxml2 is not a directory! XML2 suppressed" >&5
+$as_echo "$as_me: $with_libxml2 is not a directory! XML2 suppressed" >&6;}
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for XML2 library" >&5
+$as_echo_n "checking for XML2 library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+ if test ! x$with_magics = 'x' -a ! x$with_libxml2 = 'x'; then
+  ENABLE_MAGICS_TRUE=
+  ENABLE_MAGICS_FALSE='#'
+else
+  ENABLE_MAGICS_TRUE='#'
+  ENABLE_MAGICS_FALSE=
+fi
+
+#  ----------------------------------------------------------------------
+#  How to build CDI into CDO?
+INTERNAL_CDI_DIR=libcdi
+# At the moment, there are two possible CDI bindings
+# (default)          linking directly to CDI's object files, i.e. a libtool
+#                    convenience library
+# (--enable-cdi-lib) build and link to a shared CDI library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for build a separate CDI library and link CDO to it" >&5
+$as_echo_n "checking for build a separate CDI library and link CDO to it... " >&6; }
+# Check whether --enable-cdi-lib was given.
+if test "${enable_cdi_lib+set}" = set; then :
+  enableval=$enable_cdi_lib; if test "x$enable_cdi_lib" != "xno"; then :
+  enable_cdi_lib=yes
+else
+  enable_cdi_lib=no
+                      CDO_DISABLE_CDILIB=1
+                      export CDO_DISABLE_CDILIB
+fi
+else
+  enable_cdi_lib=no
+               CDO_DISABLE_CDILIB=1
+               export CDO_DISABLE_CDILIB
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_cdi_lib" >&5
+$as_echo "$enable_cdi_lib" >&6; }
+# save CDI binding mode for later automake use
+ if test x$enable_cdi_lib = 'xyes'; then
+  ENABLE_CDI_LIB_TRUE=
+  ENABLE_CDI_LIB_FALSE='#'
+else
+  ENABLE_CDI_LIB_TRUE='#'
+  ENABLE_CDI_LIB_FALSE=
+fi
+
+# create shell variables for the representation of configure results
+if test x$enable_cdi_lib = 'xno'; then :
+  ENABLE_CDI_LIB=false
+
+else
+  ENABLE_CDI_LIB=true
+
+fi
+# scan for CDI as a subproject
+subdirs="$subdirs libcdi"
+
+#  ----------------------------------------------------------------------
+#  Build a static CDO
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for building an additional static CDO binary" >&5
+$as_echo_n "checking for building an additional static CDO binary... " >&6; }
+# Check whether --enable-all-static was given.
+if test "${enable_all_static+set}" = set; then :
+  enableval=$enable_all_static; if test "x$enable_all_static" != "xno"; then :
+  enable_all_static=yes
+else
+  enable_all_static=no
+fi
+else
+  enable_all_static=no
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_all_static" >&5
+$as_echo "$enable_all_static" >&6; }
+ if test x$enable_all_static = 'xyes'; then
+  ENABLE_ALL_STATIC_TRUE=
+  ENABLE_ALL_STATIC_FALSE='#'
+else
+  ENABLE_ALL_STATIC_TRUE='#'
+  ENABLE_ALL_STATIC_FALSE=
+fi
+
+
+#  ----------------------------------------------------------------------
+
+
+
+
+
+
+
+# Checks for compiler
+COMPILER="$CC $CFLAGS"
+
+cat >>confdefs.h <<_ACEOF
+#define COMPILER "$COMPILER"
+_ACEOF
+
+
+ac_config_files="$ac_config_files Makefile src/Makefile contrib/Makefile test/Makefile cdo.spec cdo.settings"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_MAGICS_TRUE}" && test -z "${ENABLE_MAGICS_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_MAGICS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_CDI_LIB_TRUE}" && test -z "${ENABLE_CDI_LIB_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_CDI_LIB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_ALL_STATIC_TRUE}" && test -z "${ENABLE_ALL_STATIC_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_ALL_STATIC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in #(
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# 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.5.9, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <http://code.zmaw.de/projects/cdo>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+cdo config.status 1.5.9
+configured by $0, generated by GNU Autoconf 2.68,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+fix_srcfile_path_CXX='`$ECHO "$fix_srcfile_path_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+AR \
+AR_FLAGS \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_wl \
+lt_prog_compiler_pic \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+fix_srcfile_path \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_CXX \
+reload_flag_CXX \
+compiler_CXX \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_static_CXX \
+lt_cv_prog_compiler_c_o_CXX \
+export_dynamic_flag_spec_CXX \
+whole_archive_flag_spec_CXX \
+compiler_needs_object_CXX \
+with_gnu_ld_CXX \
+allow_undefined_flag_CXX \
+no_undefined_flag_CXX \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_flag_spec_ld_CXX \
+hardcode_libdir_separator_CXX \
+fix_srcfile_path_CXX \
+exclude_expsyms_CXX \
+include_expsyms_CXX \
+file_list_spec_CXX \
+compiler_lib_search_dirs_CXX \
+predep_objects_CXX \
+postdep_objects_CXX \
+predeps_CXX \
+postdeps_CXX \
+compiler_lib_search_path_CXX; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_CXX \
+old_archive_cmds_CXX \
+old_archive_from_new_cmds_CXX \
+old_archive_from_expsyms_cmds_CXX \
+archive_cmds_CXX \
+archive_expsym_cmds_CXX \
+module_cmds_CXX \
+module_expsym_cmds_CXX \
+export_symbols_cmds_CXX \
+prelink_cmds_CXX; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;;
+    "test/Makefile") CONFIG_FILES="$CONFIG_FILES test/Makefile" ;;
+    "cdo.spec") CONFIG_FILES="$CONFIG_FILES cdo.spec" ;;
+    "cdo.settings") CONFIG_FILES="$CONFIG_FILES cdo.settings" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+#                 Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="CXX "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method == "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# The archiver.
+AR=$lt_AR
+AR_FLAGS=$lt_AR_FLAGS
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $* ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+}
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[^=]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$@"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1+=\$2"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$1=\$$1\$2"
+}
+
+_LT_EOF
+    ;;
+  esac
+
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Fix the shell variable \$srcfile for the compiler.
+fix_srcfile_path=$lt_fix_srcfile_path_CXX
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
+
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+
+#
+# CONFIG_SUBDIRS section.
+#
+if test "$no_recursion" != yes; then
+
+  # Remove --cache-file, --srcdir, and --disable-option-checking arguments
+  # so they do not pile up.
+  ac_sub_configure_args=
+  ac_prev=
+  eval "set x $ac_configure_args"
+  shift
+  for ac_arg
+  do
+    if test -n "$ac_prev"; then
+      ac_prev=
+      continue
+    fi
+    case $ac_arg in
+    -cache-file | --cache-file | --cache-fil | --cache-fi \
+    | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+      ac_prev=cache_file ;;
+    -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+    | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* \
+    | --c=*)
+      ;;
+    --config-cache | -C)
+      ;;
+    -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+      ac_prev=srcdir ;;
+    -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+      ;;
+    -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+      ac_prev=prefix ;;
+    -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+      ;;
+    --disable-option-checking)
+      ;;
+    *)
+      case $ac_arg in
+      *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+      esac
+      as_fn_append ac_sub_configure_args " '$ac_arg'" ;;
+    esac
+  done
+
+  # Always prepend --prefix to ensure using the same prefix
+  # in subdir configurations.
+  ac_arg="--prefix=$prefix"
+  case $ac_arg in
+  *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+  esac
+  ac_sub_configure_args="'$ac_arg' $ac_sub_configure_args"
+
+  # Pass --silent
+  if test "$silent" = yes; then
+    ac_sub_configure_args="--silent $ac_sub_configure_args"
+  fi
+
+  # Always prepend --disable-option-checking to silence warnings, since
+  # different subdirs can have different --enable and --with options.
+  ac_sub_configure_args="--disable-option-checking $ac_sub_configure_args"
+
+  ac_popdir=`pwd`
+  for ac_dir in : $subdirs; do test "x$ac_dir" = x: && continue
+
+    # Do not complain, so a configure script can configure whichever
+    # parts of a large source tree are present.
+    test -d "$srcdir/$ac_dir" || continue
+
+    ac_msg="=== configuring in $ac_dir (`pwd`/$ac_dir)"
+    $as_echo "$as_me:${as_lineno-$LINENO}: $ac_msg" >&5
+    $as_echo "$ac_msg" >&6
+    as_dir="$ac_dir"; as_fn_mkdir_p
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+    cd "$ac_dir"
+
+    # Check for guested configure; otherwise get Cygnus style configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      ac_sub_configure=$ac_srcdir/configure.gnu
+    elif test -f "$ac_srcdir/configure"; then
+      ac_sub_configure=$ac_srcdir/configure
+    elif test -f "$ac_srcdir/configure.in"; then
+      # This should be Cygnus configure.
+      ac_sub_configure=$ac_aux_dir/configure
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: no configuration information is in $ac_dir" >&5
+$as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2;}
+      ac_sub_configure=
+    fi
+
+    # The recursion is here.
+    if test -n "$ac_sub_configure"; then
+      # Make the cache file name correct relative to the subdirectory.
+      case $cache_file in
+      [\\/]* | ?:[\\/]* ) ac_sub_cache_file=$cache_file ;;
+      *) # Relative name.
+	ac_sub_cache_file=$ac_top_build_prefix$cache_file ;;
+      esac
+
+      { $as_echo "$as_me:${as_lineno-$LINENO}: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&5
+$as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_srcdir" >&6;}
+      # The eval makes quoting arguments work.
+      eval "\$SHELL \"\$ac_sub_configure\" $ac_sub_configure_args \
+	   --cache-file=\"\$ac_sub_cache_file\" --srcdir=\"\$ac_srcdir\"" ||
+	as_fn_error $? "$ac_sub_configure failed for $ac_dir" "$LINENO" 5
+    fi
+
+    cd "$ac_popdir"
+  done
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+#  ----------------------------------------------------------------------
+#  Show configuration
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CDO is configured with the following options:" >&5
+$as_echo "$as_me: CDO is configured with the following options:" >&6;}
+cat cdo.settings
+
+if test "$ac_cv_prog_cc_c99" = "no"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}:
+
+  Warning: The C compiler does not accept ANSI C99 source code!
+" >&5
+$as_echo "$as_me:
+
+  Warning: The C compiler does not accept ANSI C99 source code!
+" >&6;}
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}:
+
+  Configuration completed.
+
+    You can now say 'make' to compile the CDO package and 'make install' to install it afterwards.
+" >&5
+$as_echo "$as_me:
+
+  Configuration completed.
+
+    You can now say 'make' to compile the CDO package and 'make install' to install it afterwards.
+" >&6;}
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..f18ce26
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,132 @@
+# Process this file with autoconf to produce a configure script.
+
+AC_INIT([cdo], [1.5.9], [http://code.zmaw.de/projects/cdo])
+
+CONFIG_ABORT=yes
+AC_CONFIG_AUX_DIR(config)
+AC_CONFIG_MACRO_DIR([m4])
+AC_CANONICAL_HOST
+AC_CANONICAL_BUILD
+
+AM_INIT_AUTOMAKE
+AM_CONFIG_HEADER(src/config.h)
+AM_MAINTAINER_MODE([disable])
+
+# Set up libtool.
+AC_MSG_NOTICE([setting up libtool])
+LT_INIT
+
+# Check building environment
+AC_CHECK_TOOL([CC],[gcc],[:])
+AC_PROG_CC_C99
+AM_PROG_CC_C_O
+#AC_PROG_RANLIB
+AC_CHECK_TOOL([AR],[ar],[:])
+AC_CHECK_TOOL([CPP],[cpp],[:])
+AC_CHECK_TOOL([LD],[ld],[:])
+AC_CHECK_TOOL([NM],[nm],[:])
+AC_CHECK_TOOL([AR],[ar],[:])
+AC_CHECK_TOOL([AS],[as],[:])
+AC_CHECK_TOOL([DLLTOOL],[dlltool],[:])
+AC_CHECK_TOOL([OBJDUMP],[objdump],[:])
+AC_CHECK_TOOL([STRIP],[strip],[:])
+AC_CHECK_TOOL([RANLIB],[ranlib],[:])
+AC_PROG_INSTALL
+AC_PROG_CXX
+
+FC=no
+export FC
+#  ----------------------------------------------------------------------
+# Check large file support on 32 bit system
+AC_SYS_LARGEFILE
+#  ----------------------------------------------------------------------
+# Checks for library functions.
+AC_FUNC_MMAP
+#  ----------------------------------------------------------------------
+# Checks for library malloc.
+AC_CHECK_LIB(malloc, malloc)
+#  ----------------------------------------------------------------------
+# Checks for structures.
+AC_CHECK_MEMBERS([struct stat.st_blksize])
+#  ----------------------------------------------------------------------
+# Checks for header files
+AC_CHECK_HEADERS(sys/resource.h)
+AC_CHECK_HEADERS(sys/times.h)
+AC_CHECK_HEADERS(malloc.h)
+#  ----------------------------------------------------------------------
+# Checks for the availability of functions
+AC_CHECK_FUNCS(mallinfo)
+#  ----------------------------------------------------------------------
+# Checks for the availability of ANSI-C99 functions
+AC_CHECK_DECLS([isnan],,,[AC_INCLUDES_DEFAULT
+@%:@include <math.h>])
+AC_CHECK_FUNCS(getrlimit)
+AC_CHECK_FUNCS(gethostname)
+
+# Check compiler version
+case "$CC" in
+  pgcc*)  COMP_VERSION=`$CC -V | head -2 | tail -n 1`;;
+  *gcc*)  COMP_VERSION=`$CC --version | head -n 1`;;
+  g++*)   COMP_VERSION=`$CC --version | head -n 1`;;
+  clang*) COMP_VERSION=`$CC --version | head -n 1`;;
+  sxc*)   COMP_VERSION=`$CC -V 2>&1   | tail -n 1`;;
+  xlc*)   COMP_VERSION=`$CC -qversion 2>&1   | head -n 1`;;
+  *)      COMP_VERSION=`$CC -V 2>&1   | head -n 1`;;
+esac
+
+if test -z "$COMP_VERSION" ; then COMP_VERSION="unknown"; fi;
+AC_DEFINE_UNQUOTED(COMP_VERSION, ["$COMP_VERSION"], [Compiler version])
+
+# Checks for username, hostname and system type
+USERNAME=$LOGNAME
+if test -z "$USERNAME" ; then USERNAME=$USER; fi;
+if test -z "$USERNAME" ; then USERNAME="unknown"; fi;
+AC_DEFINE_UNQUOTED([USER_NAME],["$USERNAME"], [User name])
+AC_SUBST([USER_NAME],["$USERNAME"])
+
+AS_IF([test -z "$HOST"],
+      [HOST=unknown
+       AS_IF([test -x /bin/hostname],[HOST=$(hostname)],
+             [AS_IF([test -x /bin/uname],
+                    [HOST=$(uname -n)])])])
+AC_DEFINE_UNQUOTED([HOST_NAME],["$HOST"],[Host name])
+AC_SUBST([HOST_NAME],["$HOST"])
+
+AC_DEFINE_UNQUOTED([SYSTEM_TYPE],["$ac_cv_build"], [System type])
+AC_SUBST([SYSTEM_TYPE],["$ac_cv_build"])
+#  ----------------------------------------------------------------------
+#  Check for math library
+AC_CHECK_LIB([m],[floor])
+#  ----------------------------------------------------------------------
+# Add configure options
+ACX_OPTIONS
+#  ----------------------------------------------------------------------
+AC_SUBST([CPPFLAGS])
+AC_SUBST([FCFLAGS])
+AC_SUBST([CLDFLAGS])
+AC_SUBST([CLIBS])
+AC_SUBST([INCLUDES])
+AC_SUBST([AR])
+
+# Checks for compiler
+COMPILER="$CC $CFLAGS"
+AC_DEFINE_UNQUOTED(COMPILER, ["$COMPILER"], [Compiler])
+
+AC_OUTPUT(Makefile src/Makefile contrib/Makefile test/Makefile cdo.spec cdo.settings)
+
+#  ----------------------------------------------------------------------
+#  Show configuration
+AC_MSG_NOTICE([CDO is configured with the following options:])
+cat cdo.settings
+
+AS_IF([test "$ac_cv_prog_cc_c99" = "no"],
+      [AC_MSG_NOTICE([
+
+  Warning: The C compiler does not accept ANSI C99 source code!
+])])
+AC_MSG_NOTICE([
+
+  Configuration completed.
+
+    You can now say 'make' to compile the CDO package and 'make install' to install it afterwards.
+])
diff --git a/contrib/Makefile.am b/contrib/Makefile.am
new file mode 100644
index 0000000..ab03668
--- /dev/null
+++ b/contrib/Makefile.am
@@ -0,0 +1,21 @@
+EXTRA_DIST = makecompl.rb cdoCompletion.bash cdoCompletion.tcsh cdoCompletion.zsh python/cdo.py
+CLEANFILES = 
+
+completions:
+	if (hash ruby &> /dev/null) ; then \
+	  ruby -KN $(srcdir)/makecompl.rb -o cdoCompletion; \
+	fi
+
+test:
+	if (hash ruby &> /dev/null) ; then \
+	    (cd ruby;ruby test/test_cdo.rb) \
+    fi
+	if (hash ruby &> /dev/null) ; then \
+	    (cd python; python test/test_cdo.py) \
+    fi
+
+if MAINTAINER_MODE
+all-local: completions
+
+CLEANFILES  += `ls cdoCompletion.*`
+endif
diff --git a/contrib/Makefile.in b/contrib/Makefile.in
new file mode 100644
index 0000000..aa9deae
--- /dev/null
+++ b/contrib/Makefile.in
@@ -0,0 +1,448 @@
+# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+ at MAINTAINER_MODE_TRUE@am__append_1 = `ls cdoCompletion.*`
+subdir = contrib
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CLDFLAGS = @CLDFLAGS@
+CLIBS = @CLIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
+ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
+ENABLE_EXTRA = @ENABLE_EXTRA@
+ENABLE_GRIB = @ENABLE_GRIB@
+ENABLE_IEG = @ENABLE_IEG@
+ENABLE_SERVICE = @ENABLE_SERVICE@
+EXEEXT = @EXEEXT@
+FCFLAGS = @FCFLAGS@
+FGREP = @FGREP@
+GREP = @GREP@
+GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
+GRIB_API_LIBS = @GRIB_API_LIBS@
+HDF5_INCLUDE = @HDF5_INCLUDE@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_ROOT = @HDF5_ROOT@
+HOST_NAME = @HOST_NAME@
+INCLUDES = @INCLUDES@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JASPER_LIBS = @JASPER_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAGICS_INCLUDE = @MAGICS_INCLUDE@
+MAGICS_LIBS = @MAGICS_LIBS@
+MAGICS_ROOT = @MAGICS_ROOT@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NC_CONFIG = @NC_CONFIG@
+NETCDF_INCLUDE = @NETCDF_INCLUDE@
+NETCDF_LIBS = @NETCDF_LIBS@
+NETCDF_ROOT = @NETCDF_ROOT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PROJ_INCLUDE = @PROJ_INCLUDE@
+PROJ_LDFLAGS = @PROJ_LDFLAGS@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYSTEM_TYPE = @SYSTEM_TYPE@
+SZLIB_INCLUDE = @SZLIB_INCLUDE@
+SZLIB_LIBS = @SZLIB_LIBS@
+THREADS_INCLUDE = @THREADS_INCLUDE@
+THREADS_LIBS = @THREADS_LIBS@
+UDUNITS_INCLUDE = @UDUNITS_INCLUDE@
+UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@
+USER_NAME = @USER_NAME@
+VERSION = @VERSION@
+XML2_LIBS = @XML2_LIBS@
+ZLIB_INCLUDE = @ZLIB_INCLUDE@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = makecompl.rb cdoCompletion.bash cdoCompletion.tcsh cdoCompletion.zsh python/cdo.py
+CLEANFILES = $(am__append_1)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu contrib/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+ at MAINTAINER_MODE_FALSE@all-local:
+all-am: Makefile all-local
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am all-local check check-am clean clean-generic \
+	clean-libtool distclean distclean-generic distclean-libtool \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	uninstall uninstall-am
+
+
+completions:
+	if (hash ruby &> /dev/null) ; then \
+	  ruby -KN $(srcdir)/makecompl.rb -o cdoCompletion; \
+	fi
+
+test:
+	if (hash ruby &> /dev/null) ; then \
+	    (cd ruby;ruby test/test_cdo.rb) \
+    fi
+	if (hash ruby &> /dev/null) ; then \
+	    (cd python; python test/test_cdo.py) \
+    fi
+
+ at MAINTAINER_MODE_TRUE@all-local: completions
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/contrib/cdoCompletion.bash b/contrib/cdoCompletion.bash
new file mode 100644
index 0000000..5e0f927
--- /dev/null
+++ b/contrib/cdoCompletion.bash
@@ -0,0 +1,714 @@
+complete -W "
+-L \
+-M \
+-O \
+-P \
+-Q \
+-R \
+-S \
+-V \
+-a \
+-b \
+-f \
+-g \
+-h \
+-k \
+-m \
+-r \
+-s \
+-t \
+-v \
+-z \
+abs -abs \
+acos -acos \
+add -add \
+addc -addc \
+aexpr -aexpr \
+aexprf -aexprf \
+anomaly -anomaly \
+asin -asin \
+atan -atan \
+atan2 -atan2 \
+bandpass -bandpass \
+beta -beta \
+boxavg -boxavg \
+cat -cat \
+cdiread -cdiread \
+cdiwrite -cdiwrite \
+change_e5lsm -change_e5lsm \
+change_e5mask -change_e5mask \
+change_e5slm -change_e5slm \
+chcode -chcode \
+chisquare -chisquare \
+chlevel -chlevel \
+chlevelc -chlevelc \
+chlevelv -chlevelv \
+chltype -chltype \
+chname -chname \
+chparam -chparam \
+chtabnum -chtabnum \
+chunit -chunit \
+chvar -chvar \
+cloudlayer -cloudlayer \
+cmd -cmd \
+com -com \
+command -command \
+complextorect -complextorect \
+consecsum -consecsum \
+consects -consects \
+const -const \
+conv_cmor_table -conv_cmor_table \
+copy -copy \
+cos -cos \
+covar0 -covar0 \
+covar0r -covar0r \
+dayavg -dayavg \
+daycount -daycount \
+daylogs -daylogs \
+daymax -daymax \
+daymean -daymean \
+daymin -daymin \
+daypctl -daypctl \
+daystd -daystd \
+daysum -daysum \
+dayvar -dayvar \
+del29feb -del29feb \
+delcode -delcode \
+delday -delday \
+delete -delete \
+delname -delname \
+delparam -delparam \
+deltap -deltap \
+deltap_fl -deltap_fl \
+delvar -delvar \
+detrend -detrend \
+diff -diff \
+diff2 -diff2 \
+diffc -diffc \
+diffn -diffn \
+diffp -diffp \
+diffv -diffv \
+div -div \
+divc -divc \
+divcoslat -divcoslat \
+divdpm -divdpm \
+divdpy -divdpy \
+dumplogo -dumplogo \
+dumplogs -dumplogs \
+dumpmap -dumpmap \
+duplicate -duplicate \
+dv2ps -dv2ps \
+dv2uv -dv2uv \
+dv2uvl -dv2uvl \
+eca_cdd -eca_cdd \
+eca_cfd -eca_cfd \
+eca_csu -eca_csu \
+eca_cwd -eca_cwd \
+eca_cwdi -eca_cwdi \
+eca_cwfi -eca_cwfi \
+eca_etr -eca_etr \
+eca_fd -eca_fd \
+eca_gsl -eca_gsl \
+eca_hd -eca_hd \
+eca_hwdi -eca_hwdi \
+eca_hwfi -eca_hwfi \
+eca_id -eca_id \
+eca_pd -eca_pd \
+eca_r10mm -eca_r10mm \
+eca_r1mm -eca_r1mm \
+eca_r20mm -eca_r20mm \
+eca_r75p -eca_r75p \
+eca_r75ptot -eca_r75ptot \
+eca_r90p -eca_r90p \
+eca_r90ptot -eca_r90ptot \
+eca_r95p -eca_r95p \
+eca_r95ptot -eca_r95ptot \
+eca_r99p -eca_r99p \
+eca_r99ptot -eca_r99ptot \
+eca_rr1 -eca_rr1 \
+eca_rx1day -eca_rx1day \
+eca_rx5day -eca_rx5day \
+eca_sdii -eca_sdii \
+eca_su -eca_su \
+eca_tg10p -eca_tg10p \
+eca_tg90p -eca_tg90p \
+eca_tn10p -eca_tn10p \
+eca_tn90p -eca_tn90p \
+eca_tr -eca_tr \
+eca_tx10p -eca_tx10p \
+eca_tx90p -eca_tx90p \
+enlarge -enlarge \
+enlargegrid -enlargegrid \
+ensavg -ensavg \
+ensbrs -ensbrs \
+enscrps -enscrps \
+ensmax -ensmax \
+ensmean -ensmean \
+ensmin -ensmin \
+enspctl -enspctl \
+ensrkhist_space -ensrkhist_space \
+ensrkhist_time -ensrkhist_time \
+ensrkhistspace -ensrkhistspace \
+ensrkhisttime -ensrkhisttime \
+ensroc -ensroc \
+ensstd -ensstd \
+enssum -enssum \
+ensvar -ensvar \
+eof -eof \
+eof3d -eof3d \
+eof3dspatial -eof3dspatial \
+eof3dtime -eof3dtime \
+eofcoeff -eofcoeff \
+eofcoeff3d -eofcoeff3d \
+eofspatial -eofspatial \
+eoftime -eoftime \
+eq -eq \
+eqc -eqc \
+exp -exp \
+export_e5ml -export_e5ml \
+export_e5res -export_e5res \
+expr -expr \
+exprf -exprf \
+fc2gp -fc2gp \
+fc2sp -fc2sp \
+fdns -fdns \
+filedes -filedes \
+fillmiss -fillmiss \
+fisher -fisher \
+fldavg -fldavg \
+fldcor -fldcor \
+fldcovar -fldcovar \
+fldmax -fldmax \
+fldmean -fldmean \
+fldmin -fldmin \
+fldpctl -fldpctl \
+fldrms -fldrms \
+fldstd -fldstd \
+fldsum -fldsum \
+fldvar -fldvar \
+for -for \
+fourier -fourier \
+fpressure -fpressure \
+gather -gather \
+ge -ge \
+gec -gec \
+genbic -genbic \
+genbil -genbil \
+gencon -gencon \
+gencon2 -gencon2 \
+gendis -gendis \
+gengrid -gengrid \
+genlaf -genlaf \
+gennn -gennn \
+geopotheight -geopotheight \
+ggstat -ggstat \
+ggstats -ggstats \
+globavg -globavg \
+gp2fc -gp2fc \
+gp2sp -gp2sp \
+gp2spl -gp2spl \
+gradsdes -gradsdes \
+gradsdes1 -gradsdes1 \
+gradsdes2 -gradsdes2 \
+gridarea -gridarea \
+gridboxavg -gridboxavg \
+gridboxmax -gridboxmax \
+gridboxmean -gridboxmean \
+gridboxmin -gridboxmin \
+gridboxstd -gridboxstd \
+gridboxsum -gridboxsum \
+gridboxvar -gridboxvar \
+griddes -griddes \
+griddes2 -griddes2 \
+griddx -griddx \
+griddy -griddy \
+gridmask -gridmask \
+gridverify -gridverify \
+gridweights -gridweights \
+gt -gt \
+gtc -gtc \
+harmonic -harmonic \
+highpass -highpass \
+histcount -histcount \
+histfreq -histfreq \
+histmean -histmean \
+histsum -histsum \
+houravg -houravg \
+hourcount -hourcount \
+hourmax -hourmax \
+hourmean -hourmean \
+hourmin -hourmin \
+hourpctl -hourpctl \
+hourstd -hourstd \
+hoursum -hoursum \
+hourvar -hourvar \
+hpressure -hpressure \
+hurr -hurr \
+ifnotthen -ifnotthen \
+ifnotthenc -ifnotthenc \
+ifthen -ifthen \
+ifthenc -ifthenc \
+ifthenelse -ifthenelse \
+import_amsr -import_amsr \
+import_binary -import_binary \
+import_cmsaf -import_cmsaf \
+import_e5ml -import_e5ml \
+import_e5res -import_e5res \
+import_grads -import_grads \
+import_obs -import_obs \
+imtocomplex -imtocomplex \
+info -info \
+infoc -infoc \
+infon -infon \
+infop -infop \
+infos -infos \
+infov -infov \
+input -input \
+inputext -inputext \
+inputsrv -inputsrv \
+int -int \
+interpolate -interpolate \
+intgrid -intgrid \
+intgridbil -intgridbil \
+intgridtraj -intgridtraj \
+intlevel -intlevel \
+intlevel3d -intlevel3d \
+intlevelx -intlevelx \
+intlevelx3d -intlevelx3d \
+intntime -intntime \
+intpoint -intpoint \
+inttime -inttime \
+intyear -intyear \
+invertlat -invertlat \
+invertlatdata -invertlatdata \
+invertlatdes -invertlatdes \
+invertlev -invertlev \
+invertlon -invertlon \
+invertlondata -invertlondata \
+invertlondes -invertlondes \
+isosurface -isosurface \
+le -le \
+lec -lec \
+lmavg -lmavg \
+lmean -lmean \
+lmmean -lmmean \
+lmstd -lmstd \
+ln -ln \
+log -log \
+log10 -log10 \
+lowpass -lowpass \
+lsmean -lsmean \
+lt -lt \
+ltc -ltc \
+map -map \
+mask -mask \
+maskindexbox -maskindexbox \
+masklonlatbox -masklonlatbox \
+maskregion -maskregion \
+mastrfu -mastrfu \
+max -max \
+meandiff2test -meandiff2test \
+meravg -meravg \
+merge -merge \
+mergegrid -mergegrid \
+mergetime -mergetime \
+mermax -mermax \
+mermean -mermean \
+mermin -mermin \
+merpctl -merpctl \
+merstd -merstd \
+mersum -mersum \
+mervar -mervar \
+min -min \
+ml2hl -ml2hl \
+ml2hl_lp -ml2hl_lp \
+ml2hlx -ml2hlx \
+ml2hlx_lp -ml2hlx_lp \
+ml2pl -ml2pl \
+ml2pl_lp -ml2pl_lp \
+ml2plx -ml2plx \
+ml2plx_lp -ml2plx_lp \
+mod -mod \
+monadd -monadd \
+monavg -monavg \
+moncount -moncount \
+mondiv -mondiv \
+monlogs -monlogs \
+monmax -monmax \
+monmean -monmean \
+monmin -monmin \
+monmul -monmul \
+monpctl -monpctl \
+monstd -monstd \
+monsub -monsub \
+monsum -monsum \
+monvar -monvar \
+mrotuv -mrotuv \
+mrotuvb -mrotuvb \
+mul -mul \
+mulc -mulc \
+mulcoslat -mulcoslat \
+muldoy -muldoy \
+muldpm -muldpm \
+muldpy -muldpy \
+ncode -ncode \
+ncode -ncode \
+ncopy -ncopy \
+ndate -ndate \
+ne -ne \
+nec -nec \
+nint -nint \
+nlevel -nlevel \
+nmltest -nmltest \
+nmon -nmon \
+normal -normal \
+npar -npar \
+ntime -ntime \
+nvar -nvar \
+nyear -nyear \
+output -output \
+outputarr -outputarr \
+outputbounds -outputbounds \
+outputboundscpt -outputboundscpt \
+outputcenter -outputcenter \
+outputcenter2 -outputcenter2 \
+outputcentercpt -outputcentercpt \
+outputext -outputext \
+outputf -outputf \
+outputfld -outputfld \
+outputint -outputint \
+outputkey -outputkey \
+outputsrv -outputsrv \
+outputtab -outputtab \
+outputtri -outputtri \
+outputts -outputts \
+outputvector -outputvector \
+outputvrml -outputvrml \
+outputxyz -outputxyz \
+pardes -pardes \
+pardup -pardup \
+parmul -parmul \
+partab -partab \
+partab2 -partab2 \
+pinfo -pinfo \
+pinfov -pinfov \
+pow -pow \
+pressure_fl -pressure_fl \
+pressure_hl -pressure_hl \
+random -random \
+read_cmor_table -read_cmor_table \
+read_e5ml -read_e5ml \
+reci -reci \
+regres -regres \
+remap -remap \
+remapbic -remapbic \
+remapbil -remapbil \
+remapcon -remapcon \
+remapcon1 -remapcon1 \
+remapcon2 -remapcon2 \
+remapdis -remapdis \
+remapdis1 -remapdis1 \
+remapeta -remapeta \
+remapeta_s -remapeta_s \
+remapeta_z -remapeta_z \
+remaplaf -remaplaf \
+remapnn -remapnn \
+remapsum -remapsum \
+replace -replace \
+retocomplex -retocomplex \
+rhopot -rhopot \
+rotuvb -rotuvb \
+runavg -runavg \
+runmax -runmax \
+runmean -runmean \
+runmin -runmin \
+runpctl -runpctl \
+runstd -runstd \
+runsum -runsum \
+runvar -runvar \
+scalllogo -scalllogo \
+scatter -scatter \
+sdiff -sdiff \
+seasavg -seasavg \
+seascount -seascount \
+seasmax -seasmax \
+seasmean -seasmean \
+seasmin -seasmin \
+seaspctl -seaspctl \
+seasstd -seasstd \
+seassum -seassum \
+seasvar -seasvar \
+seinfo -seinfo \
+seinfoc -seinfoc \
+seinfon -seinfon \
+seinfop -seinfop \
+selall -selall \
+selcode -selcode \
+seldate -seldate \
+selday -selday \
+select -select \
+selgrid -selgrid \
+selgridname -selgridname \
+selhour -selhour \
+selindexbox -selindexbox \
+sellevel -sellevel \
+sellevidx -sellevidx \
+sellonlatbox -sellonlatbox \
+selltype -selltype \
+selmon -selmon \
+selname -selname \
+seloperator -seloperator \
+selparam -selparam \
+selrec -selrec \
+selseas -selseas \
+selsmon -selsmon \
+selstdname -selstdname \
+seltabnum -seltabnum \
+seltime -seltime \
+seltimestep -seltimestep \
+selvar -selvar \
+selyear -selyear \
+selzaxis -selzaxis \
+selzaxisname -selzaxisname \
+setcalendar -setcalendar \
+setcindexbox -setcindexbox \
+setclonlatbox -setclonlatbox \
+setcode -setcode \
+setctomiss -setctomiss \
+setdate -setdate \
+setday -setday \
+setgatt -setgatt \
+setgatts -setgatts \
+setgrid -setgrid \
+setgridarea -setgridarea \
+setgridmask -setgridmask \
+setgridnumber -setgridnumber \
+setgridtype -setgridtype \
+sethalo -sethalo \
+setlevel -setlevel \
+setltype -setltype \
+setmisstoc -setmisstoc \
+setmissval -setmissval \
+setmon -setmon \
+setname -setname \
+setparam -setparam \
+setpartab -setpartab \
+setpartabc -setpartabc \
+setpartabn -setpartabn \
+setpartabp -setpartabp \
+setpartabv -setpartabv \
+setrcaname -setrcaname \
+setreftime -setreftime \
+setrtoc -setrtoc \
+setrtoc2 -setrtoc2 \
+setrtomiss -setrtomiss \
+settabnum -settabnum \
+settaxis -settaxis \
+settime -settime \
+settunits -settunits \
+setunit -setunit \
+setvals -setvals \
+setvar -setvar \
+setvrange -setvrange \
+setyear -setyear \
+setzaxis -setzaxis \
+shifttime -shifttime \
+showcode -showcode \
+showdate -showdate \
+showformat -showformat \
+showlevel -showlevel \
+showltype -showltype \
+showmon -showmon \
+showname -showname \
+showparam -showparam \
+showstdname -showstdname \
+showtime -showtime \
+showtimestamp -showtimestamp \
+showunit -showunit \
+showvar -showvar \
+showyear -showyear \
+sin -sin \
+sinfo -sinfo \
+sinfoc -sinfoc \
+sinfon -sinfon \
+sinfop -sinfop \
+sinfov -sinfov \
+smemlogo -smemlogo \
+smooth9 -smooth9 \
+snamelogo -snamelogo \
+sort -sort \
+sortcode -sortcode \
+sortlevel -sortlevel \
+sortname -sortname \
+sorttaxis -sorttaxis \
+sorttimestamp -sorttimestamp \
+sortvar -sortvar \
+sp2fc -sp2fc \
+sp2gp -sp2gp \
+sp2gpl -sp2gpl \
+sp2sp -sp2sp \
+spcut -spcut \
+specinfo -specinfo \
+spectrum -spectrum \
+sperclogo -sperclogo \
+splitcode -splitcode \
+splitday -splitday \
+splitgrid -splitgrid \
+splithour -splithour \
+splitlevel -splitlevel \
+splitmon -splitmon \
+splitname -splitname \
+splitparam -splitparam \
+splitrec -splitrec \
+splitseas -splitseas \
+splitsel -splitsel \
+splittabnum -splittabnum \
+splitvar -splitvar \
+splityear -splityear \
+splitzaxis -splitzaxis \
+sqr -sqr \
+sqrt -sqrt \
+ssopar -ssopar \
+stdatm -stdatm \
+stimelogo -stimelogo \
+strbre -strbre \
+strgal -strgal \
+strwin -strwin \
+studentt -studentt \
+sub -sub \
+subc -subc \
+subtrend -subtrend \
+szip -szip \
+tan -tan \
+tee -tee \
+temp -temp \
+template1 -template1 \
+template2 -template2 \
+test -test \
+test2 -test2 \
+testdata -testdata \
+thinout -thinout \
+timavg -timavg \
+timcor -timcor \
+timcount -timcount \
+timcovar -timcovar \
+timmax -timmax \
+timmean -timmean \
+timmin -timmin \
+timpctl -timpctl \
+timselavg -timselavg \
+timselmax -timselmax \
+timselmean -timselmean \
+timselmin -timselmin \
+timselpctl -timselpctl \
+timselstd -timselstd \
+timselsum -timselsum \
+timselvar -timselvar \
+timsort -timsort \
+timstd -timstd \
+timsum -timsum \
+timvar -timvar \
+tinfo -tinfo \
+topo -topo \
+tpnhalo -tpnhalo \
+transxy -transxy \
+trend -trend \
+trms -trms \
+tstepcount -tstepcount \
+unsetgridmask -unsetgridmask \
+uv2dv -uv2dv \
+uv2dvl -uv2dvl \
+vardes -vardes \
+vardup -vardup \
+varmul -varmul \
+varquot2test -varquot2test \
+varrms -varrms \
+vct -vct \
+vct2 -vct2 \
+vertavg -vertavg \
+vertmax -vertmax \
+vertmean -vertmean \
+vertmin -vertmin \
+vertstd -vertstd \
+vertsum -vertsum \
+vertvar -vertvar \
+vertwind -vertwind \
+vlist -vlist \
+wct -wct \
+write_e5ml -write_e5ml \
+writegrid -writegrid \
+writerandom -writerandom \
+yarbil -yarbil \
+yarcon -yarcon \
+yarnn -yarnn \
+ydayadd -ydayadd \
+ydayavg -ydayavg \
+ydaydiv -ydaydiv \
+ydaymax -ydaymax \
+ydaymean -ydaymean \
+ydaymin -ydaymin \
+ydaymul -ydaymul \
+ydaypctl -ydaypctl \
+ydaystd -ydaystd \
+ydaysub -ydaysub \
+ydaysum -ydaysum \
+ydayvar -ydayvar \
+ydrunavg -ydrunavg \
+ydrunmax -ydrunmax \
+ydrunmean -ydrunmean \
+ydrunmin -ydrunmin \
+ydrunpctl -ydrunpctl \
+ydrunstd -ydrunstd \
+ydrunsum -ydrunsum \
+ydrunvar -ydrunvar \
+yearavg -yearavg \
+yearcount -yearcount \
+yearmax -yearmax \
+yearmean -yearmean \
+yearmin -yearmin \
+yearpctl -yearpctl \
+yearstd -yearstd \
+yearsum -yearsum \
+yearvar -yearvar \
+yhouradd -yhouradd \
+yhouravg -yhouravg \
+yhourdiv -yhourdiv \
+yhourmax -yhourmax \
+yhourmean -yhourmean \
+yhourmin -yhourmin \
+yhourmul -yhourmul \
+yhourstd -yhourstd \
+yhoursub -yhoursub \
+yhoursum -yhoursum \
+yhourvar -yhourvar \
+ymonadd -ymonadd \
+ymonavg -ymonavg \
+ymondiv -ymondiv \
+ymonmax -ymonmax \
+ymonmean -ymonmean \
+ymonmin -ymonmin \
+ymonmul -ymonmul \
+ymonpctl -ymonpctl \
+ymonstd -ymonstd \
+ymonsub -ymonsub \
+ymonsum -ymonsum \
+ymonvar -ymonvar \
+yseasavg -yseasavg \
+yseasmax -yseasmax \
+yseasmean -yseasmean \
+yseasmin -yseasmin \
+yseaspctl -yseaspctl \
+yseasstd -yseasstd \
+yseassum -yseassum \
+yseasvar -yseasvar \
+zaxisdes -zaxisdes \
+zonavg -zonavg \
+zonmax -zonmax \
+zonmean -zonmean \
+zonmin -zonmin \
+zonpctl -zonpctl \
+zonrange -zonrange \
+zonstd -zonstd \
+zonsum -zonsum \
+zonvar -zonvar \
+" -f cdo
diff --git a/contrib/cdoCompletion.tcsh b/contrib/cdoCompletion.tcsh
new file mode 100644
index 0000000..b5a69b0
--- /dev/null
+++ b/contrib/cdoCompletion.tcsh
@@ -0,0 +1,714 @@
+set cdoCmpl = (\
+L \
+M \
+O \
+P \
+Q \
+R \
+S \
+V \
+a \
+b \
+f \
+g \
+h \
+k \
+m \
+r \
+s \
+t \
+v \
+z \
+abs \
+acos \
+add \
+addc \
+aexpr \
+aexprf \
+anomaly \
+asin \
+atan \
+atan2 \
+bandpass \
+beta \
+boxavg \
+cat \
+cdiread \
+cdiwrite \
+change_e5lsm \
+change_e5mask \
+change_e5slm \
+chcode \
+chisquare \
+chlevel \
+chlevelc \
+chlevelv \
+chltype \
+chname \
+chparam \
+chtabnum \
+chunit \
+chvar \
+cloudlayer \
+cmd \
+com \
+command \
+complextorect \
+consecsum \
+consects \
+const \
+conv_cmor_table \
+copy \
+cos \
+covar0 \
+covar0r \
+dayavg \
+daycount \
+daylogs \
+daymax \
+daymean \
+daymin \
+daypctl \
+daystd \
+daysum \
+dayvar \
+del29feb \
+delcode \
+delday \
+delete \
+delname \
+delparam \
+deltap \
+deltap_fl \
+delvar \
+detrend \
+diff \
+diff2 \
+diffc \
+diffn \
+diffp \
+diffv \
+div \
+divc \
+divcoslat \
+divdpm \
+divdpy \
+dumplogo \
+dumplogs \
+dumpmap \
+duplicate \
+dv2ps \
+dv2uv \
+dv2uvl \
+eca_cdd \
+eca_cfd \
+eca_csu \
+eca_cwd \
+eca_cwdi \
+eca_cwfi \
+eca_etr \
+eca_fd \
+eca_gsl \
+eca_hd \
+eca_hwdi \
+eca_hwfi \
+eca_id \
+eca_pd \
+eca_r10mm \
+eca_r1mm \
+eca_r20mm \
+eca_r75p \
+eca_r75ptot \
+eca_r90p \
+eca_r90ptot \
+eca_r95p \
+eca_r95ptot \
+eca_r99p \
+eca_r99ptot \
+eca_rr1 \
+eca_rx1day \
+eca_rx5day \
+eca_sdii \
+eca_su \
+eca_tg10p \
+eca_tg90p \
+eca_tn10p \
+eca_tn90p \
+eca_tr \
+eca_tx10p \
+eca_tx90p \
+enlarge \
+enlargegrid \
+ensavg \
+ensbrs \
+enscrps \
+ensmax \
+ensmean \
+ensmin \
+enspctl \
+ensrkhist_space \
+ensrkhist_time \
+ensrkhistspace \
+ensrkhisttime \
+ensroc \
+ensstd \
+enssum \
+ensvar \
+eof \
+eof3d \
+eof3dspatial \
+eof3dtime \
+eofcoeff \
+eofcoeff3d \
+eofspatial \
+eoftime \
+eq \
+eqc \
+exp \
+export_e5ml \
+export_e5res \
+expr \
+exprf \
+fc2gp \
+fc2sp \
+fdns \
+filedes \
+fillmiss \
+fisher \
+fldavg \
+fldcor \
+fldcovar \
+fldmax \
+fldmean \
+fldmin \
+fldpctl \
+fldrms \
+fldstd \
+fldsum \
+fldvar \
+for \
+fourier \
+fpressure \
+gather \
+ge \
+gec \
+genbic \
+genbil \
+gencon \
+gencon2 \
+gendis \
+gengrid \
+genlaf \
+gennn \
+geopotheight \
+ggstat \
+ggstats \
+globavg \
+gp2fc \
+gp2sp \
+gp2spl \
+gradsdes \
+gradsdes1 \
+gradsdes2 \
+gridarea \
+gridboxavg \
+gridboxmax \
+gridboxmean \
+gridboxmin \
+gridboxstd \
+gridboxsum \
+gridboxvar \
+griddes \
+griddes2 \
+griddx \
+griddy \
+gridmask \
+gridverify \
+gridweights \
+gt \
+gtc \
+harmonic \
+highpass \
+histcount \
+histfreq \
+histmean \
+histsum \
+houravg \
+hourcount \
+hourmax \
+hourmean \
+hourmin \
+hourpctl \
+hourstd \
+hoursum \
+hourvar \
+hpressure \
+hurr \
+ifnotthen \
+ifnotthenc \
+ifthen \
+ifthenc \
+ifthenelse \
+import_amsr \
+import_binary \
+import_cmsaf \
+import_e5ml \
+import_e5res \
+import_grads \
+import_obs \
+imtocomplex \
+info \
+infoc \
+infon \
+infop \
+infos \
+infov \
+input \
+inputext \
+inputsrv \
+int \
+interpolate \
+intgrid \
+intgridbil \
+intgridtraj \
+intlevel \
+intlevel3d \
+intlevelx \
+intlevelx3d \
+intntime \
+intpoint \
+inttime \
+intyear \
+invertlat \
+invertlatdata \
+invertlatdes \
+invertlev \
+invertlon \
+invertlondata \
+invertlondes \
+isosurface \
+le \
+lec \
+lmavg \
+lmean \
+lmmean \
+lmstd \
+ln \
+log \
+log10 \
+lowpass \
+lsmean \
+lt \
+ltc \
+map \
+mask \
+maskindexbox \
+masklonlatbox \
+maskregion \
+mastrfu \
+max \
+meandiff2test \
+meravg \
+merge \
+mergegrid \
+mergetime \
+mermax \
+mermean \
+mermin \
+merpctl \
+merstd \
+mersum \
+mervar \
+min \
+ml2hl \
+ml2hl_lp \
+ml2hlx \
+ml2hlx_lp \
+ml2pl \
+ml2pl_lp \
+ml2plx \
+ml2plx_lp \
+mod \
+monadd \
+monavg \
+moncount \
+mondiv \
+monlogs \
+monmax \
+monmean \
+monmin \
+monmul \
+monpctl \
+monstd \
+monsub \
+monsum \
+monvar \
+mrotuv \
+mrotuvb \
+mul \
+mulc \
+mulcoslat \
+muldoy \
+muldpm \
+muldpy \
+ncode \
+ncode \
+ncopy \
+ndate \
+ne \
+nec \
+nint \
+nlevel \
+nmltest \
+nmon \
+normal \
+npar \
+ntime \
+nvar \
+nyear \
+output \
+outputarr \
+outputbounds \
+outputboundscpt \
+outputcenter \
+outputcenter2 \
+outputcentercpt \
+outputext \
+outputf \
+outputfld \
+outputint \
+outputkey \
+outputsrv \
+outputtab \
+outputtri \
+outputts \
+outputvector \
+outputvrml \
+outputxyz \
+pardes \
+pardup \
+parmul \
+partab \
+partab2 \
+pinfo \
+pinfov \
+pow \
+pressure_fl \
+pressure_hl \
+random \
+read_cmor_table \
+read_e5ml \
+reci \
+regres \
+remap \
+remapbic \
+remapbil \
+remapcon \
+remapcon1 \
+remapcon2 \
+remapdis \
+remapdis1 \
+remapeta \
+remapeta_s \
+remapeta_z \
+remaplaf \
+remapnn \
+remapsum \
+replace \
+retocomplex \
+rhopot \
+rotuvb \
+runavg \
+runmax \
+runmean \
+runmin \
+runpctl \
+runstd \
+runsum \
+runvar \
+scalllogo \
+scatter \
+sdiff \
+seasavg \
+seascount \
+seasmax \
+seasmean \
+seasmin \
+seaspctl \
+seasstd \
+seassum \
+seasvar \
+seinfo \
+seinfoc \
+seinfon \
+seinfop \
+selall \
+selcode \
+seldate \
+selday \
+select \
+selgrid \
+selgridname \
+selhour \
+selindexbox \
+sellevel \
+sellevidx \
+sellonlatbox \
+selltype \
+selmon \
+selname \
+seloperator \
+selparam \
+selrec \
+selseas \
+selsmon \
+selstdname \
+seltabnum \
+seltime \
+seltimestep \
+selvar \
+selyear \
+selzaxis \
+selzaxisname \
+setcalendar \
+setcindexbox \
+setclonlatbox \
+setcode \
+setctomiss \
+setdate \
+setday \
+setgatt \
+setgatts \
+setgrid \
+setgridarea \
+setgridmask \
+setgridnumber \
+setgridtype \
+sethalo \
+setlevel \
+setltype \
+setmisstoc \
+setmissval \
+setmon \
+setname \
+setparam \
+setpartab \
+setpartabc \
+setpartabn \
+setpartabp \
+setpartabv \
+setrcaname \
+setreftime \
+setrtoc \
+setrtoc2 \
+setrtomiss \
+settabnum \
+settaxis \
+settime \
+settunits \
+setunit \
+setvals \
+setvar \
+setvrange \
+setyear \
+setzaxis \
+shifttime \
+showcode \
+showdate \
+showformat \
+showlevel \
+showltype \
+showmon \
+showname \
+showparam \
+showstdname \
+showtime \
+showtimestamp \
+showunit \
+showvar \
+showyear \
+sin \
+sinfo \
+sinfoc \
+sinfon \
+sinfop \
+sinfov \
+smemlogo \
+smooth9 \
+snamelogo \
+sort \
+sortcode \
+sortlevel \
+sortname \
+sorttaxis \
+sorttimestamp \
+sortvar \
+sp2fc \
+sp2gp \
+sp2gpl \
+sp2sp \
+spcut \
+specinfo \
+spectrum \
+sperclogo \
+splitcode \
+splitday \
+splitgrid \
+splithour \
+splitlevel \
+splitmon \
+splitname \
+splitparam \
+splitrec \
+splitseas \
+splitsel \
+splittabnum \
+splitvar \
+splityear \
+splitzaxis \
+sqr \
+sqrt \
+ssopar \
+stdatm \
+stimelogo \
+strbre \
+strgal \
+strwin \
+studentt \
+sub \
+subc \
+subtrend \
+szip \
+tan \
+tee \
+temp \
+template1 \
+template2 \
+test \
+test2 \
+testdata \
+thinout \
+timavg \
+timcor \
+timcount \
+timcovar \
+timmax \
+timmean \
+timmin \
+timpctl \
+timselavg \
+timselmax \
+timselmean \
+timselmin \
+timselpctl \
+timselstd \
+timselsum \
+timselvar \
+timsort \
+timstd \
+timsum \
+timvar \
+tinfo \
+topo \
+tpnhalo \
+transxy \
+trend \
+trms \
+tstepcount \
+unsetgridmask \
+uv2dv \
+uv2dvl \
+vardes \
+vardup \
+varmul \
+varquot2test \
+varrms \
+vct \
+vct2 \
+vertavg \
+vertmax \
+vertmean \
+vertmin \
+vertstd \
+vertsum \
+vertvar \
+vertwind \
+vlist \
+wct \
+write_e5ml \
+writegrid \
+writerandom \
+yarbil \
+yarcon \
+yarnn \
+ydayadd \
+ydayavg \
+ydaydiv \
+ydaymax \
+ydaymean \
+ydaymin \
+ydaymul \
+ydaypctl \
+ydaystd \
+ydaysub \
+ydaysum \
+ydayvar \
+ydrunavg \
+ydrunmax \
+ydrunmean \
+ydrunmin \
+ydrunpctl \
+ydrunstd \
+ydrunsum \
+ydrunvar \
+yearavg \
+yearcount \
+yearmax \
+yearmean \
+yearmin \
+yearpctl \
+yearstd \
+yearsum \
+yearvar \
+yhouradd \
+yhouravg \
+yhourdiv \
+yhourmax \
+yhourmean \
+yhourmin \
+yhourmul \
+yhourstd \
+yhoursub \
+yhoursum \
+yhourvar \
+ymonadd \
+ymonavg \
+ymondiv \
+ymonmax \
+ymonmean \
+ymonmin \
+ymonmul \
+ymonpctl \
+ymonstd \
+ymonsub \
+ymonsum \
+ymonvar \
+yseasavg \
+yseasmax \
+yseasmean \
+yseasmin \
+yseaspctl \
+yseasstd \
+yseassum \
+yseasvar \
+zaxisdes \
+zonavg \
+zonmax \
+zonmean \
+zonmin \
+zonpctl \
+zonrange \
+zonstd \
+zonsum \
+zonvar \
+); complete cdo 'c/-/$cdoCmpl/' 'n/*/f/'
diff --git a/contrib/cdoCompletion.zsh b/contrib/cdoCompletion.zsh
new file mode 100644
index 0000000..50cb62b
--- /dev/null
+++ b/contrib/cdoCompletion.zsh
@@ -0,0 +1,714 @@
+compctl -k "(
+-L \
+-M \
+-O \
+-P \
+-Q \
+-R \
+-S \
+-V \
+-a \
+-b \
+-f \
+-g \
+-h \
+-k \
+-m \
+-r \
+-s \
+-t \
+-v \
+-z \
+abs -abs \
+acos -acos \
+add -add \
+addc -addc \
+aexpr -aexpr \
+aexprf -aexprf \
+anomaly -anomaly \
+asin -asin \
+atan -atan \
+atan2 -atan2 \
+bandpass -bandpass \
+beta -beta \
+boxavg -boxavg \
+cat -cat \
+cdiread -cdiread \
+cdiwrite -cdiwrite \
+change_e5lsm -change_e5lsm \
+change_e5mask -change_e5mask \
+change_e5slm -change_e5slm \
+chcode -chcode \
+chisquare -chisquare \
+chlevel -chlevel \
+chlevelc -chlevelc \
+chlevelv -chlevelv \
+chltype -chltype \
+chname -chname \
+chparam -chparam \
+chtabnum -chtabnum \
+chunit -chunit \
+chvar -chvar \
+cloudlayer -cloudlayer \
+cmd -cmd \
+com -com \
+command -command \
+complextorect -complextorect \
+consecsum -consecsum \
+consects -consects \
+const -const \
+conv_cmor_table -conv_cmor_table \
+copy -copy \
+cos -cos \
+covar0 -covar0 \
+covar0r -covar0r \
+dayavg -dayavg \
+daycount -daycount \
+daylogs -daylogs \
+daymax -daymax \
+daymean -daymean \
+daymin -daymin \
+daypctl -daypctl \
+daystd -daystd \
+daysum -daysum \
+dayvar -dayvar \
+del29feb -del29feb \
+delcode -delcode \
+delday -delday \
+delete -delete \
+delname -delname \
+delparam -delparam \
+deltap -deltap \
+deltap_fl -deltap_fl \
+delvar -delvar \
+detrend -detrend \
+diff -diff \
+diff2 -diff2 \
+diffc -diffc \
+diffn -diffn \
+diffp -diffp \
+diffv -diffv \
+div -div \
+divc -divc \
+divcoslat -divcoslat \
+divdpm -divdpm \
+divdpy -divdpy \
+dumplogo -dumplogo \
+dumplogs -dumplogs \
+dumpmap -dumpmap \
+duplicate -duplicate \
+dv2ps -dv2ps \
+dv2uv -dv2uv \
+dv2uvl -dv2uvl \
+eca_cdd -eca_cdd \
+eca_cfd -eca_cfd \
+eca_csu -eca_csu \
+eca_cwd -eca_cwd \
+eca_cwdi -eca_cwdi \
+eca_cwfi -eca_cwfi \
+eca_etr -eca_etr \
+eca_fd -eca_fd \
+eca_gsl -eca_gsl \
+eca_hd -eca_hd \
+eca_hwdi -eca_hwdi \
+eca_hwfi -eca_hwfi \
+eca_id -eca_id \
+eca_pd -eca_pd \
+eca_r10mm -eca_r10mm \
+eca_r1mm -eca_r1mm \
+eca_r20mm -eca_r20mm \
+eca_r75p -eca_r75p \
+eca_r75ptot -eca_r75ptot \
+eca_r90p -eca_r90p \
+eca_r90ptot -eca_r90ptot \
+eca_r95p -eca_r95p \
+eca_r95ptot -eca_r95ptot \
+eca_r99p -eca_r99p \
+eca_r99ptot -eca_r99ptot \
+eca_rr1 -eca_rr1 \
+eca_rx1day -eca_rx1day \
+eca_rx5day -eca_rx5day \
+eca_sdii -eca_sdii \
+eca_su -eca_su \
+eca_tg10p -eca_tg10p \
+eca_tg90p -eca_tg90p \
+eca_tn10p -eca_tn10p \
+eca_tn90p -eca_tn90p \
+eca_tr -eca_tr \
+eca_tx10p -eca_tx10p \
+eca_tx90p -eca_tx90p \
+enlarge -enlarge \
+enlargegrid -enlargegrid \
+ensavg -ensavg \
+ensbrs -ensbrs \
+enscrps -enscrps \
+ensmax -ensmax \
+ensmean -ensmean \
+ensmin -ensmin \
+enspctl -enspctl \
+ensrkhist_space -ensrkhist_space \
+ensrkhist_time -ensrkhist_time \
+ensrkhistspace -ensrkhistspace \
+ensrkhisttime -ensrkhisttime \
+ensroc -ensroc \
+ensstd -ensstd \
+enssum -enssum \
+ensvar -ensvar \
+eof -eof \
+eof3d -eof3d \
+eof3dspatial -eof3dspatial \
+eof3dtime -eof3dtime \
+eofcoeff -eofcoeff \
+eofcoeff3d -eofcoeff3d \
+eofspatial -eofspatial \
+eoftime -eoftime \
+eq -eq \
+eqc -eqc \
+exp -exp \
+export_e5ml -export_e5ml \
+export_e5res -export_e5res \
+expr -expr \
+exprf -exprf \
+fc2gp -fc2gp \
+fc2sp -fc2sp \
+fdns -fdns \
+filedes -filedes \
+fillmiss -fillmiss \
+fisher -fisher \
+fldavg -fldavg \
+fldcor -fldcor \
+fldcovar -fldcovar \
+fldmax -fldmax \
+fldmean -fldmean \
+fldmin -fldmin \
+fldpctl -fldpctl \
+fldrms -fldrms \
+fldstd -fldstd \
+fldsum -fldsum \
+fldvar -fldvar \
+for -for \
+fourier -fourier \
+fpressure -fpressure \
+gather -gather \
+ge -ge \
+gec -gec \
+genbic -genbic \
+genbil -genbil \
+gencon -gencon \
+gencon2 -gencon2 \
+gendis -gendis \
+gengrid -gengrid \
+genlaf -genlaf \
+gennn -gennn \
+geopotheight -geopotheight \
+ggstat -ggstat \
+ggstats -ggstats \
+globavg -globavg \
+gp2fc -gp2fc \
+gp2sp -gp2sp \
+gp2spl -gp2spl \
+gradsdes -gradsdes \
+gradsdes1 -gradsdes1 \
+gradsdes2 -gradsdes2 \
+gridarea -gridarea \
+gridboxavg -gridboxavg \
+gridboxmax -gridboxmax \
+gridboxmean -gridboxmean \
+gridboxmin -gridboxmin \
+gridboxstd -gridboxstd \
+gridboxsum -gridboxsum \
+gridboxvar -gridboxvar \
+griddes -griddes \
+griddes2 -griddes2 \
+griddx -griddx \
+griddy -griddy \
+gridmask -gridmask \
+gridverify -gridverify \
+gridweights -gridweights \
+gt -gt \
+gtc -gtc \
+harmonic -harmonic \
+highpass -highpass \
+histcount -histcount \
+histfreq -histfreq \
+histmean -histmean \
+histsum -histsum \
+houravg -houravg \
+hourcount -hourcount \
+hourmax -hourmax \
+hourmean -hourmean \
+hourmin -hourmin \
+hourpctl -hourpctl \
+hourstd -hourstd \
+hoursum -hoursum \
+hourvar -hourvar \
+hpressure -hpressure \
+hurr -hurr \
+ifnotthen -ifnotthen \
+ifnotthenc -ifnotthenc \
+ifthen -ifthen \
+ifthenc -ifthenc \
+ifthenelse -ifthenelse \
+import_amsr -import_amsr \
+import_binary -import_binary \
+import_cmsaf -import_cmsaf \
+import_e5ml -import_e5ml \
+import_e5res -import_e5res \
+import_grads -import_grads \
+import_obs -import_obs \
+imtocomplex -imtocomplex \
+info -info \
+infoc -infoc \
+infon -infon \
+infop -infop \
+infos -infos \
+infov -infov \
+input -input \
+inputext -inputext \
+inputsrv -inputsrv \
+int -int \
+interpolate -interpolate \
+intgrid -intgrid \
+intgridbil -intgridbil \
+intgridtraj -intgridtraj \
+intlevel -intlevel \
+intlevel3d -intlevel3d \
+intlevelx -intlevelx \
+intlevelx3d -intlevelx3d \
+intntime -intntime \
+intpoint -intpoint \
+inttime -inttime \
+intyear -intyear \
+invertlat -invertlat \
+invertlatdata -invertlatdata \
+invertlatdes -invertlatdes \
+invertlev -invertlev \
+invertlon -invertlon \
+invertlondata -invertlondata \
+invertlondes -invertlondes \
+isosurface -isosurface \
+le -le \
+lec -lec \
+lmavg -lmavg \
+lmean -lmean \
+lmmean -lmmean \
+lmstd -lmstd \
+ln -ln \
+log -log \
+log10 -log10 \
+lowpass -lowpass \
+lsmean -lsmean \
+lt -lt \
+ltc -ltc \
+map -map \
+mask -mask \
+maskindexbox -maskindexbox \
+masklonlatbox -masklonlatbox \
+maskregion -maskregion \
+mastrfu -mastrfu \
+max -max \
+meandiff2test -meandiff2test \
+meravg -meravg \
+merge -merge \
+mergegrid -mergegrid \
+mergetime -mergetime \
+mermax -mermax \
+mermean -mermean \
+mermin -mermin \
+merpctl -merpctl \
+merstd -merstd \
+mersum -mersum \
+mervar -mervar \
+min -min \
+ml2hl -ml2hl \
+ml2hl_lp -ml2hl_lp \
+ml2hlx -ml2hlx \
+ml2hlx_lp -ml2hlx_lp \
+ml2pl -ml2pl \
+ml2pl_lp -ml2pl_lp \
+ml2plx -ml2plx \
+ml2plx_lp -ml2plx_lp \
+mod -mod \
+monadd -monadd \
+monavg -monavg \
+moncount -moncount \
+mondiv -mondiv \
+monlogs -monlogs \
+monmax -monmax \
+monmean -monmean \
+monmin -monmin \
+monmul -monmul \
+monpctl -monpctl \
+monstd -monstd \
+monsub -monsub \
+monsum -monsum \
+monvar -monvar \
+mrotuv -mrotuv \
+mrotuvb -mrotuvb \
+mul -mul \
+mulc -mulc \
+mulcoslat -mulcoslat \
+muldoy -muldoy \
+muldpm -muldpm \
+muldpy -muldpy \
+ncode -ncode \
+ncode -ncode \
+ncopy -ncopy \
+ndate -ndate \
+ne -ne \
+nec -nec \
+nint -nint \
+nlevel -nlevel \
+nmltest -nmltest \
+nmon -nmon \
+normal -normal \
+npar -npar \
+ntime -ntime \
+nvar -nvar \
+nyear -nyear \
+output -output \
+outputarr -outputarr \
+outputbounds -outputbounds \
+outputboundscpt -outputboundscpt \
+outputcenter -outputcenter \
+outputcenter2 -outputcenter2 \
+outputcentercpt -outputcentercpt \
+outputext -outputext \
+outputf -outputf \
+outputfld -outputfld \
+outputint -outputint \
+outputkey -outputkey \
+outputsrv -outputsrv \
+outputtab -outputtab \
+outputtri -outputtri \
+outputts -outputts \
+outputvector -outputvector \
+outputvrml -outputvrml \
+outputxyz -outputxyz \
+pardes -pardes \
+pardup -pardup \
+parmul -parmul \
+partab -partab \
+partab2 -partab2 \
+pinfo -pinfo \
+pinfov -pinfov \
+pow -pow \
+pressure_fl -pressure_fl \
+pressure_hl -pressure_hl \
+random -random \
+read_cmor_table -read_cmor_table \
+read_e5ml -read_e5ml \
+reci -reci \
+regres -regres \
+remap -remap \
+remapbic -remapbic \
+remapbil -remapbil \
+remapcon -remapcon \
+remapcon1 -remapcon1 \
+remapcon2 -remapcon2 \
+remapdis -remapdis \
+remapdis1 -remapdis1 \
+remapeta -remapeta \
+remapeta_s -remapeta_s \
+remapeta_z -remapeta_z \
+remaplaf -remaplaf \
+remapnn -remapnn \
+remapsum -remapsum \
+replace -replace \
+retocomplex -retocomplex \
+rhopot -rhopot \
+rotuvb -rotuvb \
+runavg -runavg \
+runmax -runmax \
+runmean -runmean \
+runmin -runmin \
+runpctl -runpctl \
+runstd -runstd \
+runsum -runsum \
+runvar -runvar \
+scalllogo -scalllogo \
+scatter -scatter \
+sdiff -sdiff \
+seasavg -seasavg \
+seascount -seascount \
+seasmax -seasmax \
+seasmean -seasmean \
+seasmin -seasmin \
+seaspctl -seaspctl \
+seasstd -seasstd \
+seassum -seassum \
+seasvar -seasvar \
+seinfo -seinfo \
+seinfoc -seinfoc \
+seinfon -seinfon \
+seinfop -seinfop \
+selall -selall \
+selcode -selcode \
+seldate -seldate \
+selday -selday \
+select -select \
+selgrid -selgrid \
+selgridname -selgridname \
+selhour -selhour \
+selindexbox -selindexbox \
+sellevel -sellevel \
+sellevidx -sellevidx \
+sellonlatbox -sellonlatbox \
+selltype -selltype \
+selmon -selmon \
+selname -selname \
+seloperator -seloperator \
+selparam -selparam \
+selrec -selrec \
+selseas -selseas \
+selsmon -selsmon \
+selstdname -selstdname \
+seltabnum -seltabnum \
+seltime -seltime \
+seltimestep -seltimestep \
+selvar -selvar \
+selyear -selyear \
+selzaxis -selzaxis \
+selzaxisname -selzaxisname \
+setcalendar -setcalendar \
+setcindexbox -setcindexbox \
+setclonlatbox -setclonlatbox \
+setcode -setcode \
+setctomiss -setctomiss \
+setdate -setdate \
+setday -setday \
+setgatt -setgatt \
+setgatts -setgatts \
+setgrid -setgrid \
+setgridarea -setgridarea \
+setgridmask -setgridmask \
+setgridnumber -setgridnumber \
+setgridtype -setgridtype \
+sethalo -sethalo \
+setlevel -setlevel \
+setltype -setltype \
+setmisstoc -setmisstoc \
+setmissval -setmissval \
+setmon -setmon \
+setname -setname \
+setparam -setparam \
+setpartab -setpartab \
+setpartabc -setpartabc \
+setpartabn -setpartabn \
+setpartabp -setpartabp \
+setpartabv -setpartabv \
+setrcaname -setrcaname \
+setreftime -setreftime \
+setrtoc -setrtoc \
+setrtoc2 -setrtoc2 \
+setrtomiss -setrtomiss \
+settabnum -settabnum \
+settaxis -settaxis \
+settime -settime \
+settunits -settunits \
+setunit -setunit \
+setvals -setvals \
+setvar -setvar \
+setvrange -setvrange \
+setyear -setyear \
+setzaxis -setzaxis \
+shifttime -shifttime \
+showcode -showcode \
+showdate -showdate \
+showformat -showformat \
+showlevel -showlevel \
+showltype -showltype \
+showmon -showmon \
+showname -showname \
+showparam -showparam \
+showstdname -showstdname \
+showtime -showtime \
+showtimestamp -showtimestamp \
+showunit -showunit \
+showvar -showvar \
+showyear -showyear \
+sin -sin \
+sinfo -sinfo \
+sinfoc -sinfoc \
+sinfon -sinfon \
+sinfop -sinfop \
+sinfov -sinfov \
+smemlogo -smemlogo \
+smooth9 -smooth9 \
+snamelogo -snamelogo \
+sort -sort \
+sortcode -sortcode \
+sortlevel -sortlevel \
+sortname -sortname \
+sorttaxis -sorttaxis \
+sorttimestamp -sorttimestamp \
+sortvar -sortvar \
+sp2fc -sp2fc \
+sp2gp -sp2gp \
+sp2gpl -sp2gpl \
+sp2sp -sp2sp \
+spcut -spcut \
+specinfo -specinfo \
+spectrum -spectrum \
+sperclogo -sperclogo \
+splitcode -splitcode \
+splitday -splitday \
+splitgrid -splitgrid \
+splithour -splithour \
+splitlevel -splitlevel \
+splitmon -splitmon \
+splitname -splitname \
+splitparam -splitparam \
+splitrec -splitrec \
+splitseas -splitseas \
+splitsel -splitsel \
+splittabnum -splittabnum \
+splitvar -splitvar \
+splityear -splityear \
+splitzaxis -splitzaxis \
+sqr -sqr \
+sqrt -sqrt \
+ssopar -ssopar \
+stdatm -stdatm \
+stimelogo -stimelogo \
+strbre -strbre \
+strgal -strgal \
+strwin -strwin \
+studentt -studentt \
+sub -sub \
+subc -subc \
+subtrend -subtrend \
+szip -szip \
+tan -tan \
+tee -tee \
+temp -temp \
+template1 -template1 \
+template2 -template2 \
+test -test \
+test2 -test2 \
+testdata -testdata \
+thinout -thinout \
+timavg -timavg \
+timcor -timcor \
+timcount -timcount \
+timcovar -timcovar \
+timmax -timmax \
+timmean -timmean \
+timmin -timmin \
+timpctl -timpctl \
+timselavg -timselavg \
+timselmax -timselmax \
+timselmean -timselmean \
+timselmin -timselmin \
+timselpctl -timselpctl \
+timselstd -timselstd \
+timselsum -timselsum \
+timselvar -timselvar \
+timsort -timsort \
+timstd -timstd \
+timsum -timsum \
+timvar -timvar \
+tinfo -tinfo \
+topo -topo \
+tpnhalo -tpnhalo \
+transxy -transxy \
+trend -trend \
+trms -trms \
+tstepcount -tstepcount \
+unsetgridmask -unsetgridmask \
+uv2dv -uv2dv \
+uv2dvl -uv2dvl \
+vardes -vardes \
+vardup -vardup \
+varmul -varmul \
+varquot2test -varquot2test \
+varrms -varrms \
+vct -vct \
+vct2 -vct2 \
+vertavg -vertavg \
+vertmax -vertmax \
+vertmean -vertmean \
+vertmin -vertmin \
+vertstd -vertstd \
+vertsum -vertsum \
+vertvar -vertvar \
+vertwind -vertwind \
+vlist -vlist \
+wct -wct \
+write_e5ml -write_e5ml \
+writegrid -writegrid \
+writerandom -writerandom \
+yarbil -yarbil \
+yarcon -yarcon \
+yarnn -yarnn \
+ydayadd -ydayadd \
+ydayavg -ydayavg \
+ydaydiv -ydaydiv \
+ydaymax -ydaymax \
+ydaymean -ydaymean \
+ydaymin -ydaymin \
+ydaymul -ydaymul \
+ydaypctl -ydaypctl \
+ydaystd -ydaystd \
+ydaysub -ydaysub \
+ydaysum -ydaysum \
+ydayvar -ydayvar \
+ydrunavg -ydrunavg \
+ydrunmax -ydrunmax \
+ydrunmean -ydrunmean \
+ydrunmin -ydrunmin \
+ydrunpctl -ydrunpctl \
+ydrunstd -ydrunstd \
+ydrunsum -ydrunsum \
+ydrunvar -ydrunvar \
+yearavg -yearavg \
+yearcount -yearcount \
+yearmax -yearmax \
+yearmean -yearmean \
+yearmin -yearmin \
+yearpctl -yearpctl \
+yearstd -yearstd \
+yearsum -yearsum \
+yearvar -yearvar \
+yhouradd -yhouradd \
+yhouravg -yhouravg \
+yhourdiv -yhourdiv \
+yhourmax -yhourmax \
+yhourmean -yhourmean \
+yhourmin -yhourmin \
+yhourmul -yhourmul \
+yhourstd -yhourstd \
+yhoursub -yhoursub \
+yhoursum -yhoursum \
+yhourvar -yhourvar \
+ymonadd -ymonadd \
+ymonavg -ymonavg \
+ymondiv -ymondiv \
+ymonmax -ymonmax \
+ymonmean -ymonmean \
+ymonmin -ymonmin \
+ymonmul -ymonmul \
+ymonpctl -ymonpctl \
+ymonstd -ymonstd \
+ymonsub -ymonsub \
+ymonsum -ymonsum \
+ymonvar -ymonvar \
+yseasavg -yseasavg \
+yseasmax -yseasmax \
+yseasmean -yseasmean \
+yseasmin -yseasmin \
+yseaspctl -yseaspctl \
+yseasstd -yseasstd \
+yseassum -yseassum \
+yseasvar -yseasvar \
+zaxisdes -zaxisdes \
+zonavg -zonavg \
+zonmax -zonmax \
+zonmean -zonmean \
+zonmin -zonmin \
+zonpctl -zonpctl \
+zonrange -zonrange \
+zonstd -zonstd \
+zonsum -zonsum \
+zonvar -zonvar \
+)" -f cdo
diff --git a/contrib/makecompl.rb b/contrib/makecompl.rb
new file mode 100755
index 0000000..54e16e6
--- /dev/null
+++ b/contrib/makecompl.rb
@@ -0,0 +1,78 @@
+#!/usr/bin/env ruby
+require 'optparse'
+
+$opts = {:bin => '../src/cdo',:outfile => 'cdoCompletion'}
+OptionParser.new do |o|
+  o.banner = "Create auto completion files for different shells\n    " +
+             "Usage:  makecompl.rb [-h] [-b CMD] [-o FILENAME]"
+  o.separator("")
+  o.separator("Options are ...")
+  o.on("-b",
+       "--binary CMD",
+       "Choose a CDO binary different from #{$opts[:bin]}") {|cmd| $opts[:bin] = cmd}
+  o.on("-o",
+       "--outfile FILENAME",
+       "Set the filename for all completions files (default: #{$opts[:outfile]})") {|fname| $opts[:outfile] = fname}
+  o.on("-h","--help","Show this help") {puts o
+    puts
+    puts <<-'END'
+RESTRICTIONS:
+Supported shells are TCSH, BASH and ZSH. For tcsh completion is only performed
+for regular options and operators with prepended '-'. Bash and zsh also
+complete opertors without leading '-'.
+
+AUTHOR:  Ralf Mueller, ralf.mueller at zmaw.de
+
+LICENSE: CDO's License
+END
+    exit
+  }
+end.parse!
+#=============================================================================== 
+def getOperators
+  # try to run the CDO binary first
+  cmd       = $opts[:bin] + ' 2>&1'
+  help      = IO.popen(cmd).readlines.map {|l| l.chomp.lstrip}
+  if 5 >= help.size
+    puts "Operators could not get listed by running the CDO binary (#{$opts[:bin]})"
+    puts "Create operator list by scanning the documentation..."
+    Dir.glob('../doc/tex/mod/*').map {|mod|
+      File.open(mod).readlines.grep(/Operators/).map {|line| 
+        line.chomp.split('=')[-1].split(' ')
+      }
+    }.flatten
+  else
+    help[(help.index("Operators:")+1)..help.index(help.find {|v| v =~ /CDO version/}) - 2].join(' ').split
+  end
+end
+def getOptions
+  cmd     = $opts[:bin] + ' 2>&1'
+  options = IO.popen(cmd).readlines.map {|l| l.chomp.lstrip}.find_all {|item| /^-/.match(item)}.map {|o| o[0,2]}
+  if options.empty?
+    puts "Commandline options could not get listed by running the CDO binary (#{$opts[:bin]})"
+    puts "Go on processing operators only ..."
+    return []
+  end
+  options
+end
+#=============================================================================== 
+operators = getOperators.sort
+options   = getOptions.sort
+# require 'pp'; pp operators; pp options
+# Create the configuration files
+complCmds = { 
+  :tcsh => ['set cdoCmpl = (\\','); complete cdo \'c/-/$cdoCmpl/\' \'n/*/f/\''],
+  :zsh  => ['compctl -k "('    ,')" -f cdo'],
+  :bash => ['complete -W "'    ,'" -f cdo']
+}
+[:bash, :zsh, :tcsh].each {|shell|
+  # tcsh: Remove the prepended '-' from the cdo cmdline options. This will be
+  #       added through tcsh's completion command
+  # otherwise: Add operators WITH leading '-'
+  completions = (:tcsh == shell ) ? options.map {|o| o[1..-1]} + operators : options + operators.map {|o| "#{o} -#{o}"}
+  File.open($opts[:outfile] + '.' + shell.to_s,'w') {|f|
+    f << complCmds[shell][0] << "\n"
+    completions.each {|item| f << item << " \\" << "\n" }
+    f << complCmds[shell][1] << "\n"
+  }
+}
diff --git a/contrib/python/cdo.py b/contrib/python/cdo.py
new file mode 100644
index 0000000..ba98d00
--- /dev/null
+++ b/contrib/python/cdo.py
@@ -0,0 +1,353 @@
+import os,re,subprocess,tempfile,random,string
+
+# Copyright (C) 2011-2012 Ralf Mueller, ralf.mueller at zmaw.de
+# See COPYING file for copying and redistribution conditions.
+# 
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+# 
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+def auto_doc(tool, cdo_self):
+    """Generate the __doc__ string of the decorated function by calling the cdo help command"""
+    def desc(func):
+        func.__doc__ = cdo_self.call([cdo_self.CDO, '-h', tool]).get('stdout')
+        return func
+    return desc
+
+class CDOException(Exception):
+
+    def __init__(self, stdout, stderr, returncode):
+        super(CDOException, self).__init__()
+        self.stdout = stdout
+        self.stderr = stderr
+        self.returncode = returncode
+        self.msg = '(returncode:%s) %s' % (returncode, stderr)
+    def __str__(self):
+        return self.msg
+
+class Cdo(object):
+
+  def __init__(self):
+    # Since cdo-1.5.4 undocumented operators are given with the -h option. For
+    # earlier version, they have to be provided manually
+    self.undocumentedOperators = ['anomaly','beta','boxavg','change_e5lsm','change_e5mask',
+        'change_e5slm','chisquare','chvar','cloudlayer','cmd','com','command','complextorect',
+        'covar0','covar0r','daycount','daylogs','del29feb','delday','delete','deltap','deltap_fl',
+        'delvar','diffv','divcoslat','dumplogo','dumplogs','duplicate','eca_r1mm','enlargegrid',
+        'ensrkhistspace','ensrkhisttime','eof3d','eof3dspatial','eof3dtime','export_e5ml',
+        'export_e5res','fc2gp','fc2sp','fillmiss','fisher','fldcovar','fldrms','fourier','fpressure',
+        'gather','gengrid','geopotheight','ggstat','ggstats','globavg','gp2fc','gradsdes',
+        'gridverify','harmonic','hourcount','hpressure','ifs2icon','import_e5ml','import_e5res',
+        'import_obs','imtocomplex','infos','infov','interpolate','intgrid','intgridbil',
+        'intgridtraj','intpoint','isosurface','lmavg','lmean','lmmean','lmstd','log','lsmean',
+        'meandiff2test','mergegrid','mod','moncount','monlogs','mrotuv','mrotuvb','mulcoslat','ncode',
+        'ncopy','nmltest','normal','nvar','outputbounds','outputboundscpt','outputcenter',
+        'outputcenter2','outputcentercpt','outputkey','outputtri','outputvector','outputvrml',
+        'pardup','parmul','pinfo','pinfov','pressure_fl','pressure_hl','read_e5ml','remapcon1',
+        'remapdis1','retocomplex','scalllogo','scatter','seascount','select','selgridname',
+        'seloperator','selvar','selzaxisname','setrcaname','setvar','showvar','sinfov','smemlogo',
+        'snamelogo','sort','sortcode','sortlevel','sortname','sorttaxis','sorttimestamp','sortvar',
+        'sp2fc','specinfo','spectrum','sperclogo','splitvar','stimelogo','studentt','template1',
+        'template2','test','test2','testdata','thinout','timcount','timcovar','tinfo','transxy','trms',
+        'tstepcount','vardes','vardup','varmul','varquot2test','varrms','vertwind','write_e5ml',
+        'writegrid','writerandom','yearcount']
+
+    if os.environ.has_key('CDO'):
+      self.CDO = os.environ['CDO']
+    else:
+      self.CDO = 'cdo'
+
+    self.operators   = self.getOperators()
+    self.returnCdf   = False
+    self.tempfile    = MyTempfile()
+    self.forceOutput = True
+    self.debug       = False
+    self.outputOperatorsPattern = '(diff|info|output|griddes|zaxisdes|show|ncode|ndate|nlevel|nmon|nvar|nyear|ntime|npar|gradsdes|pardes)'
+
+    self.cdfMod      = ''
+
+  def __dir__(self):
+    res = dir(type(self)) + list(self.__dict__.keys())
+    res.extend(self.operators)
+    return res
+
+  def call(self,cmd):
+    if self.debug:
+      print '# DEBUG ====================================================================='
+      print 'CALL:'+' '.join(cmd)
+      print '# DEBUG ====================================================================='
+
+    proc = subprocess.Popen(' '.join(cmd),
+        shell  = True,
+        stderr = subprocess.PIPE,
+        stdout = subprocess.PIPE)
+    retvals = proc.communicate()
+    return {"stdout"     : retvals[0]
+           ,"stderr"     : retvals[1]
+           ,"returncode" : proc.returncode}
+
+  def hasError(self,method_name,cmd,retvals):
+    if (self.debug):
+      print("RETURNCODE:"+retvals["returncode"].__str__())
+    if ( 0 != retvals["returncode"] ):
+      print("Error in calling operator " + method_name + " with:")
+      print(">>> "+' '.join(cmd)+"<<<")
+      print(retvals["stderr"])
+      return True
+    else:
+      return False
+
+  def __getattr__(self, method_name):
+
+    @auto_doc(method_name, self)
+    def get(self, *args,**kwargs):
+      operator          = [method_name]
+      operatorPrintsOut = re.search(self.outputOperatorsPattern,method_name)
+
+      if args.__len__() != 0:
+        for arg in args:
+          operator.append(arg.__str__())
+
+      #build the cdo command
+      #1. the cdo command
+      cmd = [self.CDO]
+      #2. options
+      if 'options' in kwargs:
+          cmd += kwargs['options'].split()
+      #3. operator(s)
+      cmd.append(','.join(operator))
+      #4. input files or operators
+      if 'input' in kwargs:
+        if isinstance(kwargs["input"], basestring):
+            cmd.append(kwargs["input"])
+        else:
+            #we assume it's either a list, a tuple or any iterable.
+            cmd += kwargs["input"]
+
+      if not kwargs.__contains__("force"):
+        kwargs["force"] = self.forceOutput
+
+      if operatorPrintsOut:
+        retvals = self.call(cmd)
+        if ( not self.hasError(method_name,cmd,retvals) ):
+          r = map(string.strip,retvals["stdout"].split(os.linesep))
+          return r[:len(r)-1]
+        else:
+          raise CDOException(**retvals)
+      else:
+        if kwargs["force"] or \
+           (kwargs.__contains__("output") and not os.path.isfile(kwargs["output"])):
+          if not kwargs.__contains__("output"):
+            kwargs["output"] = self.tempfile.path()
+
+          cmd.append(kwargs["output"])
+
+          retvals = self.call(cmd)
+          if self.hasError(method_name,cmd,retvals):
+              raise CDOException(**retvals)
+        else:
+          if self.debug:
+            print("Use existing file'"+kwargs["output"]+"'")
+
+      if not kwargs.__contains__("returnCdf"):
+        kwargs["returnCdf"] = False
+
+      if not None == kwargs.get("returnArray"):
+        return self.readArray(kwargs["output"],kwargs["returnArray"])
+      elif not None == kwargs.get("returnMaArray"):
+        return self.readMaArray(kwargs["output"],kwargs["returnMaArray"])
+      elif self.returnCdf or kwargs["returnCdf"]:
+        if not self.returnCdf:
+          self.loadCdf()
+        return self.readCdf(kwargs["output"])
+      else:
+        return kwargs["output"]
+
+    if ((method_name in self.__dict__) or (method_name in self.operators)):
+      if self.debug:
+        print("Found method:" + method_name)
+
+      #cache the method for later
+      setattr(self.__class__, method_name, get)
+      return get.__get__(self)
+    else:
+      # If the method isn't in our dictionary, act normal.
+      print("#=====================================================")
+      print("Cannot find method:" + method_name)
+      raise AttributeError, method_name
+
+  def getOperators(self):
+    import os
+    proc = subprocess.Popen([self.CDO,'-h'],stderr = subprocess.PIPE,stdout = subprocess.PIPE)
+    ret  = proc.communicate()
+    l    = ret[1].find("Operators:")
+    ops  = ret[1][l:-1].split(os.linesep)[1:-1]
+    endI = ops.index('')
+    s    = ' '.join(ops[:endI]).strip()
+    s    = re.sub("\s+" , " ", s)
+    return list(set(s.split(" ") + self.undocumentedOperators))
+
+  def loadCdf(self):
+    try:
+      import scipy.io.netcdf as cdf
+      self.cdf    = cdf
+      self.cdfMod = "scipy"
+    except:
+      try:
+        import netCDF4 as cdf
+        self.cdf    = cdf
+        self.cdfMod = "netcdf4"
+      except:
+        raise ImportError,"scipy or python-netcdf4 module is required to return numpy arrays."
+
+
+  def setReturnArray(self,value=True):
+    self.returnCdf = value
+    if value:
+      self.loadCdf()
+
+
+  def unsetReturnArray(self):
+    self.setReturnArray(False)
+
+  def hasCdo(self,path=None):
+    if path is None:
+      path = self.CDO
+
+    if os.path.isfile(path) and os.access(path, os.X_OK):
+      return True
+    return False
+
+  def checkCdo(self):
+    if (self.hasCdo()):
+      call = [self.CDO,' -V']
+      proc = subprocess.Popen(' '.join(call),
+          shell  = True,
+          stderr = subprocess.PIPE,
+          stdout = subprocess.PIPE)
+      retvals = proc.communicate()
+      print retvals
+
+  def setCdo(self,value):
+    self.CDO       = value
+    self.operators = self.getOperators()
+
+  def getCdo(self):
+    return self.CDO
+
+  #==================================================================
+  # Addional operators:
+  #------------------------------------------------------------------
+  def module_version(self):
+    '1.2.1'
+
+  def version(self):
+    # return CDO's version
+    proc = subprocess.Popen([self.CDO,'-h'],stderr = subprocess.PIPE,stdout = subprocess.PIPE)
+    ret  = proc.communicate()
+    cdo_help   = ret[1]
+    match = re.search("CDO version (\d.*), Copyright",cdo_help)
+    return match.group(1)
+
+  def boundaryLevels(self,**kwargs):
+    ilevels         = map(float,self.showlevel(input = kwargs['input'])[0].split())
+    bound_levels    = []
+    bound_levels.insert(0,0)
+    for i in range(1,len(ilevels)+1):
+      bound_levels.insert(i,bound_levels[i-1] + 2*(ilevels[i-1]-bound_levels[i-1]))
+
+    return bound_levels
+
+  def thicknessOfLevels(self,**kwargs):
+    bound_levels = self.boundaryLevels(**kwargs)
+    delta_levels    = []
+    for i in range(0,len(bound_levels)):
+      v = bound_levels[i]
+      if 0 == i:
+        continue
+
+      delta_levels.append(v - bound_levels[i-1])
+
+    return delta_levels
+
+  def readCdf(self,iFile):
+    """Return a cdf handle created by the available cdf library. python-netcdf4 and scipy suported (default:scipy)"""
+    if not self.returnCdf:
+      self.loadCdf()
+
+    if ( "scipy" == self.cdfMod):
+      #making it compatible to older scipy versions
+      fileObj =  self.cdf.netcdf_file(iFile, mode='r')
+    elif ( "netcdf4" == self.cdfMod ):
+      fileObj = self.cdf.Dataset(iFile)
+    else:
+      raise ImportError,"Could not import data from file '" + iFile + "'"
+
+    retval = fileObj
+    fileObj.close()
+    return retval
+
+  def readArray(self,iFile,varname):
+    """Direcly return a numpy array for a given variable name"""
+    filehandle = self.readCdf(iFile)
+    if varname in filehandle.variables:
+      # return the data array
+      return filehandle.variables[varname][:]
+    else:
+      print "Cannot find variable '" + varname +"'"
+      return False
+
+  def readMaArray(self,iFile,varname):
+    """Create a masked array based on cdf's FillValue"""
+    fileObj =  self.readCdf(iFile)
+
+    #.data is not backwards compatible to old scipy versions, [:] is
+    data = fileObj.variables[varname][:]
+
+    # load numpy if available
+    try:
+      import numpy as np
+    except:
+      raise ImportError,"numpy is required to return masked arrays."
+
+    if hasattr(fileObj.variables[varname],'_FillValue'):
+      #return masked array
+      retval = np.ma.array(data,mask=data == fileObj.variables[varname]._FillValue)
+    else:
+      #generate dummy mask which is always valid
+      retval = np.ma.array(data,mask=data != data )
+
+    return retval
+
+# Helper module for easy temp file handling
+class MyTempfile(object):
+
+  __tempfiles = []
+
+  def __init__(self):
+    self.persistent_tempfile = False
+
+  def __del__(self):
+    # remove temporary files
+    for filename in self.__class__.__tempfiles:
+      if os.path.isfile(filename):
+        os.remove(filename)
+
+  def setPersist(self,value):
+    self.persistent_tempfiles = value
+
+  def path(self):
+    if not self.persistent_tempfile:
+      t = tempfile.NamedTemporaryFile(delete=True,prefix='cdoPy')
+      self.__class__.__tempfiles.append(t.name)
+      t.close()
+
+      return t.name
+    else:
+      N =10000000 
+      t = "_"+random.randint(N).__str__()
diff --git a/doc/cdo.pdf b/doc/cdo.pdf
new file mode 100644
index 0000000..2686e56
Binary files /dev/null and b/doc/cdo.pdf differ
diff --git a/doc/cdo_refcard.pdf b/doc/cdo_refcard.pdf
new file mode 100644
index 0000000..1cc1278
Binary files /dev/null and b/doc/cdo_refcard.pdf differ
diff --git a/libcdi/AUTHORS b/libcdi/AUTHORS
new file mode 100644
index 0000000..fe473fb
--- /dev/null
+++ b/libcdi/AUTHORS
@@ -0,0 +1 @@
+Uwe Schulzweida <Uwe.Schulzweida at zmaw.de>
diff --git a/libcdi/COPYING b/libcdi/COPYING
new file mode 100644
index 0000000..d60c31a
--- /dev/null
+++ b/libcdi/COPYING
@@ -0,0 +1,340 @@
+		    GNU GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+     59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users.  This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it.  (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.)  You can apply it to
+your programs, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+  For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have.  You must make sure that they, too, receive or can get the
+source code.  And you must show them these terms so they know their
+rights.
+
+  We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+  Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software.  If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary.  To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.
+

+		    GNU GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License.  The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language.  (Hereinafter, translation is included without limitation in
+the term "modification".)  Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+  1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+  2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) You must cause the modified files to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    b) You must cause any work that you distribute or publish, that in
+    whole or in part contains or is derived from the Program or any
+    part thereof, to be licensed as a whole at no charge to all third
+    parties under the terms of this License.
+
+    c) If the modified program normally reads commands interactively
+    when run, you must cause it, when started running for such
+    interactive use in the most ordinary way, to print or display an
+    announcement including an appropriate copyright notice and a
+    notice that there is no warranty (or else, saying that you provide
+    a warranty) and that users may redistribute the program under
+    these conditions, and telling the user how to view a copy of this
+    License.  (Exception: if the Program itself is interactive but
+    does not normally print such an announcement, your work based on
+    the Program is not required to print an announcement.)
+

+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+    a) Accompany it with the complete corresponding machine-readable
+    source code, which must be distributed under the terms of Sections
+    1 and 2 above on a medium customarily used for software interchange; or,
+
+    b) Accompany it with a written offer, valid for at least three
+    years, to give any third party, for a charge no more than your
+    cost of physically performing source distribution, a complete
+    machine-readable copy of the corresponding source code, to be
+    distributed under the terms of Sections 1 and 2 above on a medium
+    customarily used for software interchange; or,
+
+    c) Accompany it with the information you received as to the offer
+    to distribute corresponding source code.  (This alternative is
+    allowed only for noncommercial distribution and only if you
+    received the program in object code or executable form with such
+    an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it.  For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable.  However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+

+  4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License.  Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+  5. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Program or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+  6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+  7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+

+  8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded.  In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+  9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time.  Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation.  If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+  10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission.  For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this.  Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+			    NO WARRANTY
+
+  11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+  12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
+

+	    How to Apply These Terms to Your New Programs
+
+  If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+  To do so, attach the following notices to the program.  It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+    <one line to give the program's name and a brief idea of what it does.>
+    Copyright (C) <year>  <name of author>
+
+    This program is free software; you can redistribute it and/or modify
+    it under the terms of the GNU General Public License as published by
+    the Free Software Foundation; either version 2 of the License, or
+    (at your option) any later version.
+
+    This program is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+    GNU General Public License for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with this program; if not, write to the Free Software
+    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+    Gnomovision version 69, Copyright (C) year  name of author
+    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+    This is free software, and you are welcome to redistribute it
+    under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary.  Here is a sample; alter the names:
+
+  Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+  `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+  <signature of Ty Coon>, 1 April 1989
+  Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs.  If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library.  If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/libcdi/ChangeLog b/libcdi/ChangeLog
new file mode 100644
index 0000000..1c5ecb9
--- /dev/null
+++ b/libcdi/ChangeLog
@@ -0,0 +1,1195 @@
+2012-12-17  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.5.9 released
+        * using CGRIBEX library version 1.5.6
+
+2012-12-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* removed unused function streamDefineTaxis()
+	* fix warning in streamDefTimestep() for stream with constant fields only
+
+2012-12-11  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added cdfGridCompress() to compress coordinates
+	* added vlistDefVarChunkType() and vlistInqVarChunkType()
+
+2012-12-03  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* vlistCopyFlag: added support for level bounds
+
+2012-11-26  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* netCDF: added support for time axis name and long_name
+
+2012-11-17  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_cdf::define_all_vars: added txt attributes to vlistDefAttTxt() without trailing 0 [Bug #3004]
+
+2012-11-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* file.c: added support for unbuffered write
+
+2012-11-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfReadVarSliceDP: store DATATYPE_FLT32 in a float array and	convert it to double (speedup 2x)
+	* cdfInqTimestep: added check for timevalue = NC_FILL_DOUBLE
+
+2012-11-14  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* app/cdi: added optional compression level -z zip[_1-9]
+
+2012-11-09  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* file.c::file_initialize: added support for env GRIB_API_IO_BUFFER_SIZE [request: Florian Prill]
+
+2012-11-07  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gridGenXvals/gridGenYvals: removed changes from 1.5.8 (bug fix)
+	* cgribexGetGrid: bug fix for xinc/yinc recomputation
+
+2012-11-05  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* grib2: correct endStep if timeunits is not equal stepUnits (bug fix)
+	* cgribexGetGrid: bug fix for yinc for odd ysize
+
+2012-10-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.5.8 released
+	* using CGRIBEX library version 1.5.5
+
+2012-10-29  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_cgribex.c: do not check fraction of xinc/yinc" stream_cgribex.c
+	* gridGenXvals/gridGenYvals: recheck xinc/yinc if (first+(size-1)*inc) > last
+
+2012-10-26  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_gribapi.c::gribapiScanTimestep: changed GRIBAPI_MISSVAL to cdiDefaultMissval
+
+2012-10-18  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* vlistCopyFlag: copy ensdata (bug fix) [report: Jaison Ambadan]
+
+2012-10-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* grib2: changed packingType from grid_jpeg to grid_simple if nmiss > 0 (bug fix)
+
+2012-10-18  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* grib2: added stepType support for absolute time axis
+
+2012-10-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* pio.h remove line 'typedef int MPI_Comm;' [Bug #2882]
+
+2012-09-21  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* vlistInqZaxis: use zaxisGetIndexList() to get global zaxisIDs (bug fix)
+
+2012-09-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* listSizeExtend: init ops, val and status
+
+2012-09-20  Thomas Jahns <jahns at dkrz.de>
+
+	* listInitialize: set mutex type to PTHREAD_MUTEX_RECURSIVE
+
+2012-09-11  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfInqContents: make ncid local to varid
+	* cdfInqContents: group reading of global attribute to read_global_attributtes()
+	* cdfInqContents: set ntsteps to 0 if no data variable found
+	* netCDF: set 1D arrays to coordinate variables if axis attribute is available
+
+2012-09-10  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* unreduced: compute nlon and nvalues from rowlon[] (bug fix)
+
+2012-09-05  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cgribexEncode: initialize the first 256 entries of isec1 to zero
+
+2012-08-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* app/cdi: changed output format of option -s (sinfo)
+
+2012-08-27  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.5.7 released
+	* model.c::modelInq*: check instID != UNDEFID (buf fix)
+	* institution.c::insitutInq*: check instID != UNDEFID (buf fix)
+	* Merge of branch cdo-pio into trunk cdi
+	* using CGRIBEX library version 1.5.4
+	* using EXSE library version 1.3.1
+
+2012-07-23  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.5.6 released
+	* using CGRIBEX library version 1.5.3
+
+2012-07-17  Modali Kameswarrao  <modali.kameswarrao at zmaw.de>
+
+	* added vlistDefVarEnsemble() for GRIB1 and netCDF
+
+2012-07-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added call to cdiInitialize() in all streamOpen functions (bug fix)
+	* added support for environment variable NC_CHUNKSIZEHINT [Feature #2142]
+
+2012-07-04  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* grib scan timestep: changed Error() to Warning() for inconsistent timesteps
+
+2012-07-04  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_cdf::define_all_grids: modify check for same x and y varids
+	* cdfInqContents: set all undefined 1D variables to data variables [request: Florian Prill]
+
+2012-06-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdf_write_var_data: bug fix for unscaled uint8, int8, int16, int32 (bug introduced in 1.5.5)
+
+2012-06-18  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* grib_api: use key significanceOfReferenceTime only for GRIB2
+
+2012-06-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for grib_api key stepType  [request: D�rte Liermann]
+	* changed TIME_CONSTANT and TIME_VARIABLE to TSTEP_CONSTANT and TSTEP_XXX
+	* renamed vlistInqVarTime() vlistInqVarTsteptype()
+
+2012-06-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_gribapi: added support for level type HYBRID_HALF	[request: D�rte Liermann]
+
+2012-05-18  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_cdf::cdfDefUnstructured: fixed memory bug [ICON - Bug #2398]
+
+2012-05-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.5.5 released
+	* using CGRIBEX library version 1.5.2
+
+2012-05-02 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdi.h: added vlistDefVarTime() [request: Florian Prill]
+
+2012-05-02 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_gribapi: bug fix for validation date and time
+
+2012-04-27 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_cdf::define_all_grids: changed scale_add() parameter from x to y (bug fix)
+
+2012-04-26 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for ZAXIS_DEPTH_BELOW_LAND units "mm",  "cm", "dm" and "m"
+
+2012-03-24 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added single precision support: streamWriteVarF, streamWriteVarSliceF
+
+2012-02-15 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_cdf::cdfDefDatatype: bug fix for DATATYPE_UINT8
+
+2012-02-02 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_cdf::cdfDefCurvilinear: bug fix for CLM s,u,v grids [report: Hans-J�rgen Panitz]
+
+2012-01-30 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.5.4 released
+
+2011-12-27 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for GRIB2 packing type grid_ieee
+
+2011-12-19 Luis Kornblueh  <Luis.Kornblueh at zmaw.de>
+
+	* added suppport for GRIB2 level type 150
+
+2011-12-13 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* verify_coordinate_vars: bug fix in check for units = "1" [report: Katharina Six]
+
+2011-11-11 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for netCDF attributes scale_factor and add_offset for lon/lat coordinates
+
+2012-01-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for GRIB gaussian grid parameter NumPar on non global grids [Bug #1711]
+	* added interface functions gridDefNP/gridInqNP (number of parallels between a pole and the equator)
+
+2011-11-04 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for GRIB1_LTYPE_SIGMA_LAYER
+
+2011-11-01 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for netcdf attribute valid_min/valid_max [request: Etienne Tourigny]
+
+2011-10-27 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdilib.c::defineAttributes: bug fix atttxt [report: Florian Prill]
+
+2011-10-25 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for netcdf attribute valid_range [request: Etienne Tourigny]
+
+2011-10-17  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.5.3 released
+	* using CGRIBEX library version 1.5.1
+
+2011-10-11  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+       * zaxisCompare: set epsilon from 0 to 1e-9 [request: Felicia Brisc]
+
+2011-10-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added level type ZAXIS_TOA, ZAXIS_SEA_BOTTOM, ZAXIS_ATMOSPHERE [request: D�rte Liermann]
+
+2011-10-05  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_cdf::cdfInqContents: check units of hybrid levels
+	* varAddRecord: used max number of bit_per_value for 3D GRIB data
+	* gribapiDefGrid: added parameter jScansPositively [report: Juan Jose Tasso]
+
+2011-10-02  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* deflate compression with netCDF4 doesn't work (bug fix) [report: Geert Jan van Oldenborgh]
+
+2011-09-21  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* correct netCDF dimension order of unstructured grids (bug fix) [report: Ralf Mueller]
+
+2011-08-22 Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.5.2 released
+
+2011-08-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* streamFilesuffix: added suffix for filetype NC4C (bug fix)
+
+2011-08-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* scanVarAttributes: check size of axis attribute (bug fix) [report: David Huard]
+
+2011-07-29  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added flexible XYZ dimension ordering for netCDF [request: Andy Aschwanden]
+
+2011-07-28  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added interface function vlistDefVarXYZ to set the dimension order
+
+2011-07-23  Pier Giuseppe Fogli  <piergiuseppe.fogli at cmcc.it>
+
+	* added interface function zaxisInqVct to read the VCT
+
+2011-07-23  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* netcdf input: correct wrong formatted time units [request: Harald Anlauf]
+
+2011-07-14  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* netcdf: added support for GRID_FOURIER (fourier coefficients)
+
+2011-07-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.5.1 released
+
+2011-07-07  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* vlistCopy: allocate and copy varsAllocated elements (bug fix) [report: Ralf Mueller]
+
+2011-06-24  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* vtime2timeval: do not round result (bug fix for TUNIT_YEAR) [report: Andy Aschwanden]
+
+2011-06-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* CDI: changed compression type from Ztype to CompType
+	* CDI: changed compression level from Zlevel to CompLevel [report: Thomas Jahns]
+
+2011-05-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gridGenYvals: changed delta eps to 0.002 for gaussian grids [report: John Lillibridge] 
+	* ruby/python interface: changed GRID_CELL to GRID_UNSTRUCTURED [report: Tim Cera]
+
+2011-05-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* grid::compareXYvals: bug fix for generic grids [report: Felicia Brisc]
+
+2011-04-28  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added attribute standard_name to netCDF time var [request: Karin Meier-Fleischer]
+	* Added attribute standard_name to netCDF zaxes [request: Karin Meier-Fleischer]
+	* Added attribute positive to netCDF zaxes [request: Karin Meier-Fleischer]
+
+2011-04-27  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added support for FILETYPE_NC4C (netcdf4 classic)
+	* netcdf: Skiped time dependent variables if number of time steps is zero
+
+2011-03-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CGRIBEX library version 1.5.0
+	* Version 1.5.0 released
+
+2011-03-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_cdf: added support for GRIB2 parameter identifier
+
+2011-03-08  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.4.8 released
+
+2011-02-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* vlistDestroy: fix memory leak
+
+2011-01-25  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added netCDF support for level bounds
+
+2011-01-21  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added grid type GRID_REFERENCE
+	* changed grid name GRID_CELL to GRID_UNSTRUCTURED
+
+2011-01-19  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support to encode/decode GRIB1 with GRIB_API
+
+2011-01-03  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CGRIBEX library version 1.4.7
+	* Version 1.4.7 released
+
+2010-11-09  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* improved support for netCDF output from WRF model
+
+2010-10-28  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfDefZaxis: changed hybrid level type from int to float
+	* taxisCopyTimestep: added mutex_lock
+	
+2010-10-26  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cgribexAddRecord: correct xinc/yinc if necessary [report: Anders Ullerstig]
+	
+2010-10-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * cdfDefVCT: remove var mlev and ilev (bug fix) [report: Torsten Weber]
+
+2010-10-05  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfOpenFile: create netCDF4 files without NC_CLASSIC_MODEL
+	* cdfOpenFile: switch off checking of netCDF4 format (read)
+	
+2010-09-27  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * cdfDefTime: bug fix for time units 3HOURS, 6HOURS, 12HOURS
+	
+2010-09-17  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CGRIBEX library version 1.4.6
+	* Version 1.4.6 released
+
+2010-09-09  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* GRIB1: use packing only for non constant fields [request: Luis Kornblueh]
+	* varDefZtype: bug fix [report: Stephanie Legutke]
+	
+2010-09-07  Ralf Mueller <ralf.mueller at zmaw.de>
+
+	* use libtool 2.2.10 for compiling + linking
+	* create shared + static library with PIC support by default
+	  (positions independant code)
+	* build CDI configuration file: cdi.settings
+
+2010-09-03  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* check axis attribute (bug fix) [report: Cui Chen]
+	
+2010-08-26  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* vlistCopyFlag: copy zaxis meta data
+	
+2010-08-25  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Added support for attribute type int16 and float32 [Request: Don Murray]
+	
+2010-08-24  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+	
+	* Version 1.4.5.2 released [request: Luis Kornblueh]
+
+2010-08-02  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added grid mask support
+	
+2010-07-26  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added ECHAM6 GRIB1 code table
+
+2010-07-23  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfInqContents: fixed out of bounds access to attstring [report: Heiner Widmann]
+	
+2010-07-05  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfInqContents: fix problem of wrong stdname for grid description [report: Michael Boettinger]
+	* Version 1.4.5.1 released
+
+2010-07-05 Edi Kirk <E.Kirk at gmx.de>
+
+	* GRIB1 decode: Correct ZeroShiftError of simple packed spherical harmonics
+
+2010-07-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfInqContents: use complex packing for spectral data [report: Edi Kirk]
+
+2010-06-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CGRIBEX library version 1.4.5.1 (szip bug fix for 24 bit data)
+
+2010-06-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CGRIBEX library version 1.4.5
+	* Version 1.4.5 released
+
+2010-05-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_history: added NC4 support [report: Etienne Tourigny]
+	
+2010-05-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfDefXYaxis: check also dimnames (bug fix) [report: Mikhail Itkin]
+	
+2010-05-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream_cdf: added support for uppercase attributes [request: Patrick Brockmann]
+	
+2010-05-07  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gridGenYvals: bug fix for nlat > 4096 [report: Thomas Bergmann]
+
+2010-04-29  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.4.4 released
+
+2010-04-24  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gaussgrid: define M_SQRT2 [report: alastair.mckinstry at ichec.ie]
+
+2010-04-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* MAX_STREAMS: changed fixed size of 4096 to dynamic range of 1024 - 65536
+	* MAX_VLISTS:  changed fixed size of 4096 to dynamic range of 1024 - 65536
+	* MAX_TAXES:   changed fixed size of 4096 to dynamic range of 1024 - 65536
+	
+2010-04-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cgribexDefTime: bug fix for GRIB time range 10
+	
+2010-04-09  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for GRIB time units 3hours and 6hours [request: Jaison-Thomas Ambadan]
+	
+2010-04-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* vlistMerge: added support to merge levels
+
+2010-03-31  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * cgribexDefTime: bug fix for timerange=3 [report: Veronika Gayler]
+	* using CGRIBEX library version 1.4.4
+
+2010-03-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* vlistCat: correct temporary parameter numbers
+
+2010-03-19  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for non integer time units MONTH
+
+2010-03-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gauaw: bug fix for allocation of zfnlat for odd number of nlat
+
+2010-03-04  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfDefGrid: check whether the variable or dimension name already exist
+	
+2010-02-27  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * grid.c: replace for loops by memcpy (speed up)
+
+2010-02-25  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* implementation of gridDestroy
+	
+2010-02-22  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.4.3 released
+
+2010-02-18  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* grib1: bug fix for description of gaussian reduced grids [report: Klaus Wyser]
+
+2010-02-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* gauaw: new code to calculate gaussian grid [Luis Kornblueh]
+	
+2010-02-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* rotated grids: correct standard name [report: Michael Boettinger]
+	* cgribexDefTime: bug fix for timerange = -1
+
+2010-02-10  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for encoding of complex packed spectral data in GRIB1
+
+2010-02-09  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added function gridInqComplexPacking/gridDefComplexPacking
+
+2010-02-08  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* Version 1.4.2 released
+
+2010-01-25  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for timerange 1,2,3,4,5 (GRIB1)
+
+2010-01-14  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfDefVar: define add_offset and scale_factor always together
+	
+2010-01-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added optional sorting of parameters
+
+2010-01-13  Oliver Fuhrer <oliver.fuhrer at meteoswiss.ch>
+
+	* added support for cosmo GRIB parameter tables
+	* added missing value support for cosmo GRIB files
+
+2010-01-07  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using CGRIBEX library version 1.4.2 (large record support)
+	
+2009-12-29  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using EXSE library version 1.2.0 (complex numbers with EXTRA)
+
+2009-12-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* fileRead: check result of fread
+	* binReadF77Block: check result of fileRead
+	* Version 1.4.1 released
+
+2009-12-11  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* streamSync: check that vlist has variables to sync [report: Martin Schultz]
+	
+2009-12-09  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfDefVar: define attribute _FillValue if missval was defined (speed up)
+	
+2009-12-08  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* allocate gribHandle for every grid/zaxis combination (speed up for writing GRIB2)
+	
+2009-11-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfInqContents: bug fix for GRID_CELL with levels [report: Stephan Lorenz]
+
+2009-11-25  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using GRIB library version 1.4.1
+	  check max limit of binary scale value (bug fix)
+
+2009-11-22  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* change code/tabnum to param
+	
+2009-11-20  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added function vlistDefVarParam/vlistInqVarParam
+
+2009-11-17  Ralf Mueller  <Ralf.Mueller at zmaw.de>
+
+	* Added ruby and python interfaces
+	  --enable-ruby  --enable-python 
+	
+2009-11-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdi.h: added '_vec' to all int and double vector arguments
+	
+2009-11-12  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* set units to "Pa" if changing zaxis to "pressure" (bug fix) [report: Chao Li]
+
+2009-11-12  Ralf Mueller  <Ralf.Mueller at zmaw.de>
+
+	* Added Fortran Interface via iso_c_bindings facility of F2003
+	  --enable-iso-c-interface
+	
+2009-11-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* added support for GRIB2 JPEG compression
+
+2009-10-28  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* grbWriteVar: bug fix
+	* Version 1.4.0.2 released
+
+2009-10-23  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdfDefXaxis: bug fix for multi generic grids [report: Uwe Mikolajewicz]
+	* streamCopyRecord: check byteorder (bug fix) [report: Claas Teichmann]
+	
+2009-10-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using GRIB library version 1.4.0.1
+	* IEG format: bug fix for lonlat grids [report: Philip Lorenz]
+	* Version 1.4.0.1 released
+
+2009-10-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* cdtInqContents: check attribute type
+	* cdtInqContents: set default time units to DAYS
+	
+2009-10-05  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+	
+	* using GRIB library version 1.4.0
+	* added GRIB2 support (testversion) via grib_api(1.8.0)
+	* changed C compiler to ANSI C99
+	* changed time format from hhmm to hhmmss
+	* changed encode/decode_time to seconds
+	* ieg: added support for Gaussian grids [request: Ralf Podzun]
+	* cdfDefLonLat2D: added attributes for Panoply
+	* added support for netCDF timeseries without grid
+	* added support for netCDF timeseries with only one grid axis
+	* gribDefLevel: bug fix for pressure level units millibar
+	* julday_add_seconds: bug fix for adjusting negative seconds
+	* stream_cdf:cdfReadVarSliceDP: bug fix for swapxy
+	* Version 1.4.0 released
+
+2009-06-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* netCDF: reduced number of nc_enddef
+	* added env CDI_SORTNAME to sort netCDF names
+	* added support for rotated grids on south pole [request: Beate Geyer]
+	* timeval2vtime: bug fix for timeunit TUNIT_MONTH
+	* streamSync: extent to non netCDF files
+	* Version 1.3.2 released
+	
+2009-04-16  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using GRIB library version 1.3.0
+	* added support for NaN in DBL_IS_EQUAL
+	* added support for GRID type LCC2 (LCC PROJ.4 version)
+	* added support for TUNIT_QUARTER (15 minutes)
+	* use env GRIB_INVENTORY_MODE=timestep to skip double entries
+	* grbDefTime: define tunit also for absolute time [report: Pruek Pongprueksa]
+	* set default calendar with env CDI_DEFAULT_CALENDAR
+	* change default calendar to CALENDAR_PROLEPTIC
+	* gridInqXinc: bug fix
+	* grid_check_cyclic: support for curvilinear grids without bounds
+	* cdfInqContents: check dimension of curvilinear grids
+	* streamOpenAppen: set ncmode to 2 (bug fix)
+	* replaced strncpy/strncmp by memcpy/memcmp
+	* Version 1.3.1 released
+
+2009-01-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* add support for GRID type SINUSOIDAL
+	* add support for GRID type LAEA
+	* add support of GRIB level type MEANSEA
+	* gridCreate: CF stdname and units for curvilinear grids [report: Stephanie Legutke]
+	* cdf_create: don't set chunksizehint (bug fix) [report: Luis Kornblueh]
+	* change vlistFlagVar to vlistMergedVar
+	* set default missval of INT8/16/32 to SCHAR_MIN/SHRT_MIN/INT_MIN
+	* move grid_lcc, grid_gme, grid_rot code to CDO
+	* move gridToCurvilinear and gridToCell code to CDO
+	* cdf_inq_contents: check zaxis type "depth_blow_sea/land" (bug fix)
+	* Version 1.3.0 released
+
+2008-11-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* add new function: streamSync
+	* add new taxis functions: taxisXXXVdateBounds and taxisXXXVtimeBounds
+	* cdfReadVarSliceDP: add swapxy support
+	* stream_cdf: check var and axis names
+	* cdfInqContents: support of grid stdname 'longitude' and 'latitude'
+	* lambert grid: support of projection flag (bug fix) [report: Andrew Digby]
+	* streamFilesuffix: bug fix for IEG [report: Class Teichmann]
+	* gridCompare: bug fix for lonlat grids and type = 1 (cdfInqContents)
+	* netcdf: support of timeunit 'year'
+	* Version 1.2.1 released
+
+2008-08-13  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * using GRIB library version 1.2.0
+	* add support for netCDF4 classic with deflate option
+	* add datatype UINT8
+	* streamClose: use taxisDestroy to release memory
+	* cdfInqContents: skip time variable with type = NC_CHAR
+	* grbDefGrid: add warning for curvilinear grids
+	* grbDefGrid: set increment for zonal means [request: Helmut P. Frank]
+	* ptaxisCopy: don't overwrite item 'self' (bug fix)
+	* add function vlistXXXVarTimaccu
+	* DBL_IS_EQUAL: check NaN with isnan
+	* Version 1.2.0 released
+	
+2008-04-08  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * using GRIB library version 1.1.1
+	* configure: --with-szlib=<directory>
+	* configure: check stat.st_blksize [report: Klaus Wyser]
+	* update: echam5 code table
+	* fileOpen: add O_BINARY if available [report: Klaus Wyser]
+	* file.c: _WIN32 support
+	* taxis.c: add support for non integer timevalues (TUNIT_MONTH/CALENDAR_360DAYS)
+	* stream_cdf: add ICON grid support
+	* stream_srv: add support for GRID_CELL (bug fix)
+	* cdfInqContents: support of lon/lat units radian
+	* cdfInqContents: bug fix for gridtype cell
+	* cdfInqContents: bug fix for inconsistent curvilinear grid [report: Holger Goettel]
+	* cdfInqContents: bug fix for unsupported grids (dims > 2) [report: Wolfgang Langhans]
+	* cdfInqContents: check type of _FillValue
+	* gridCompare: compare grid.yinc only if set
+	* vlist_att.find_att: allocate attribute only if size > 0
+	* grid_gme.c: add function areas to compute grid cell areas [Luis Kornblueh]
+	* grid_check_cyclic: bug fix
+	* Version 1.1.1 released
+
+2008-01-24  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * using GRIB library version 1.1.0
+	* using FILE library version 1.6.0
+	* new attribute routines: vlistInqNatts, vlistDefAttr and vlistInqAttr
+	  for Int, Flt and Txt
+	* Add support for Lambert grids [request: Patrick Samuelsson]
+	* Change cdiDefCompress to streamDefZtype/streamDefZlevel
+	* decode_timevalue: bug fix for rounding error [report: Veronika Gayler]
+	* grbDefTime: add support for century < 0
+	* Version 1.1.0 released
+	
+2007-10-22  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * using GRIB library version 1.0.6
+	* stream_grb:grbDefGrid use ISEC2_ScanFlag [request: Alex Kann]
+	* replace calendar module by a new one because of date/time problems
+	  with years < 0 [report: Veronika Gayler]
+	* add module timebase
+	* taxis: add support for years less than zero
+	* use always decode_date and encode_date to decode/encode date
+	* Version 1.0.8 released
+
+2007-06-15  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using EXSE library version 1.0.2
+	* new ECHAM5 code table [Renate Brokopf]
+	* stream_ieg: bug fix memory leak [report: Philip Lorenz]
+	* add function gridIsCyclic
+	* zaxisDuplicate: bug fix
+	* varscan: add full vct support
+	* cdfInqContents: print warning if cell_measures is missing
+	* cdfInqContents: check also x/yvarid to compare curvilinear grids
+	* Version 1.0.7 released
+
+2007-03-06  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * using GRIB library version 1.0.5
+	* use GRIB ltype to define GENERIC zaxis
+	* taxisCopyTimestep: copy rdate and rtime [report: Harald Anlauf]
+	* grbDefGrid: write absolute value of y-inc [report: Paul Dando]
+	* grbDefTime: change to absolute time axis if value < 0 [report: Frank Toussaint]
+	* grbDefGrid: change generic grid to lonlat grid
+	* grbScanTimestep: bug fix for unsorted codes
+	* LOCK/UNLOCK around _init_pointer
+	* Version 1.0.6 released
+
+2006-12-14  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* stream: mt safe version
+	* zaxis: mt safe version
+	* taxis: mt safe version
+	* model: mt safe version
+	* remove H5 test version
+	* stream_srv/ext/ieg: bug fix for codes > 999 [report: Simon Blessing]
+	* cdi_limits: define MAX_STREAMS, MAX_VLISTS, MAX_GRIDS, MAX_ZAXIS
+	* Version 1.0.5 released
+
+2006-11-30  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * using GRIB library version 1.0.4
+	* cdfInqContents: use grid_mapping not for curvilinear grids
+	* add env IGNORE_ATT_COORDINATES to ignore attribute coordinates
+	* splitBasetime: convert timeunit string to lower case
+	* usvs_to_uv: update for zbeta [from: Klaus Wyser]
+	* new function: vlistInqVarSzip
+	* new function: streamNvals
+	* Version 1.0.4 released
+
+2006-11-03  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+        * using GRIB library version 1.0.3
+	* using EXSE library version 1.0.1
+	* add SIGMA level support
+	* gridPrint: extented
+	* Version 1.0.3 released
+
+2006-09-18  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using GRIB library version 1.0.2
+	* grbCopyRecord: add SZIP support
+	* vlistChangeVarGrid: bug fix
+	* cdfDefVar: set default datatype for addoffset and scalefactor to double
+	* cdfWriteVar*: round integer fields with NINT [report: Etienne Tourigny]
+	* Version 1.0.2 released
+
+2006-08-01  Uwe Schulzweida  <Uwe.Schulzweida at zmaw.de>
+
+	* using GRIB library version 1.0.1
+	* add test version of SZIP for GRIB data
+	* add DATATYPE PACK1 to PACK32
+	* change DATATYPE from byte to bit
+	* split GRIB level type 105 with env var SPLIT_LTYPE_105
+	* file.c: remove declaration of getpagesize [report: Mark Hadfield]
+	* tableWrite: bug fix for undefined strings
+	* Version 1.0.1 released
+
+2006-06-15  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using GRIB library version 1.0.0
+	* rename *New functions to *Create
+	* stream_grb: update level type ISENTROPIC (report: Ag Stephens)
+	* stream_ieg: multiply pressure levels with 100 (report: Holger Goettel)
+	* gridPrint: GME support
+	* cdi_error: change return type to char*
+	* move byte order types to cdi.h
+        * add dummy functions gridDestroy, zaxisDestroy, taxisDestroy
+	* Version 1.0.0 released
+
+2006-05-04  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using GRIB library version 0.6.6
+	* cdfInqContents: check attlen for attname "axis"
+	* cdfInqContents: use coord vars from attr coordinates (bug report: Alberto Maurizi)
+	* gridPrint: print xfirst and xinc if xinc is constant
+	* gridGenYvals: try to calculate non global gaussian latitides
+	* add global int attr support
+	* streamOpenRead: fix bug if open failed
+	* add function tableInqParCode
+	* Version 0.9.7 released
+
+2006-03-08  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using GRIB library version 0.6.5
+	* vlist_var: Add function vlistChangeVarGrid
+	* program cdi: add option -s for short info
+	* cdfInqContents: improve GRID_CELL support
+	* cdfDefTime: attr text bounds for time axis (bug report: Veronika)
+	* gridToZonal: add support for GRID_GENERIC if ny > 1
+	* Version 0.9.6 released
+	
+2006-02-01  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using GRIB library version 0.6.4
+	* update ECHAM5 parameter table
+	* taxis: new function taxisCopyTimestep
+	* stream_grb: check status of grib encoding
+	* stream_cdf: use addoffset and scalefactor for all datatypes
+	* stream_cdf: set "height above the surface" to ZAXIS_HEIGHT
+	* grid.c: GME grid support
+	* add support of time bounds
+	* Version 0.9.5 released
+
+2006-01-20  Luis Kornblueh  <kornklueh at dkrz.de>
+
+	* grid_gme.c: compute boundaries of GME grid
+
+2005-12-14  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using GRIB library version 0.6.3
+	* using EXSE library version 0.9.3
+	* stream_srv: changes for new EXSE version
+	* stream_ext: changes for new EXSE version
+	* add IEG support
+	* bug fix for GRIB files with unusable VCT
+	* Version 0.9.4 released
+
+2005-11-21  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* using GRIB library version 0.6.2
+	* using FILE library version 1.5.1
+	* gribCopyRecord: round recsize to 8
+	* grbDefGrid: safe curvilinear as lonlat grid
+	* grbInqTimestep: bug fix for constant fields
+	* timeval2vtime: bug fix for time unit MONTH and YEAR
+	* Version 0.9.3 released
+
+2005-10-23  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* OPeNDAP support for netCDF (nc_dap)
+	  use configure option --enable-dap
+
+2005-10-18  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* cdfInqContents: support of CLM grid
+	* grbDefTime: prevent overflow of forcast timesteps
+	* cdfDefPole: check var name
+	* use standard name for variables
+	* zaxis: define bounds
+	* grid.c: mt safe
+	* vlist.c: mt safe
+	* stream_cdf: bug fix curvilinear grid
+	* cdfCopyRecord: buf fix for constant fields
+	* cdfCreateRecords: Bug fix (allocation of 0 bytes)
+	* grbScanTimestep: Bug fix (check all records)
+	* Version 0.9.2 released
+
+2005-07-17  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* New function: vlistChangeVarZaxis
+	* grbDefGrid: change NINT to INT
+	* gridGenYvals: check gaussian grids
+	* gridCompare: check gaussian grids
+	* stream_grb: correct xinc if necessary
+	* Version 0.9.1 released
+	
+2005-05-17  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* griblib: version 0.6.1
+	* exselib: version 0.9.2
+	* stream_cdf: change cdf_get_att_* to cdfGetAtt*
+	* cdfReadVarSliceDP: implementation of swapyz
+	* zaxis: new zaxis type ZAXIS_ALTITUDE
+	* cdiGenVars: set only generic zaxis with 1 level on 0.0 to surface
+	* codeNewEntry: bug fix for code 0
+	* Version 0.9.0 released
+
+2005-04-03  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* griblib: version 0.6.0
+	* add function zaxisDuplicate
+	* grbScanTimestep1: check level1 and level2
+	* stream_grb: bug fix in grbInqTimestep to return after error
+	* stream_grb: support for rotated grids
+	* stream_cdf: support for rotated grids
+	* vtime2timeval: bug fix for TUNIT_MONTH and TUNIT_YEAR
+	* Program cdi: change level from int to double
+	* Version 0.8.9 released
+
+2005-02-11  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* griblib: version 0.5.7
+	* gridDuplicate: update
+	* cdfInqContents: check gaussian grid S->N
+	* rename zaxisInqLevelDP to zaxisInqLevel
+	* Version 0.8.8 released
+
+2005-01-03  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* implementation of 360, 365 and 366 days calendar
+	* gridGenXvals: bug fix (xfirst == xlast)
+	* Version 0.8.7 released
+
+2004-12-17  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* define ECHAM5.3 table
+	* add missing value support for 4 Byte SRV and EXT data
+	* gridGenXvals: bug fix (set xinc > 0)
+	* Version 0.8.6 released
+
+2004-11-17  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* cdfInqContents: check gaussian grid
+	* gridToCurvilinear: add bounds
+	* gridToCell: add bounds
+	* gridInqXinc: return 0 if increment is not equidistant
+	* gridInqYinc: return 0 if increment is not equidistant
+	* random record structure support (for parallel GRIB output)
+	    	grbScanTimestep, varscan, stream_var, stream_record
+	* vlist: initialize ntsteps
+	* Version 0.8.5 released
+	
+2004-10-12  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+        * netCDF2 support
+	* cdfDefVars: Bug fix (vlistInqNgrids)
+	* stream_grb: check also leveltype to find different variables
+	* Version 0.8.4 released
+	
+2004-09-08  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* griblib: version 0.5.6
+	* grid: use bounds for gaussian and lonlat grids
+	* cdf_create: set initialsz to 0
+	* vlistChangeZaxis and vlistChangeZaxisIndex extent levinfo
+	* new function cdiInqMissval
+	* timeval2vtime: set an offset of 1 second in the call to InvCalendar
+	                 to prevent rounding errors
+        * Version 0.8.3 released
+
+2004-07-04  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* cdiInqContents: read all global text attributes
+	* cdf_create and cdf_open: set min chunksize to 128k
+	* cdfDefTime: set 0 before month and day if less than 10
+	* new function in vlist.c: vlistChangeZaxisIndex, vlistChangeZaxis
+        * Version 0.8.2 released
+
+2004-05-21  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* griblib: version 0.5.4
+	* file.c: set min I/O buffersize to 128k
+	* grib, service, extra: bug fix for variables with TIME_CONSTANT
+	* grb, srv, extCopyRecord: bug fix for variables with TIME_CONSTANT
+	* Error handling for streamOpen*
+	* New function cdiStringError for error handling
+	* change FILETYPE_CDF to FILETYPE_NC
+	* c++ compatible
+	* vlistDefVarName: overwrite old name if exist
+	* set size of dummy longname and units from 128 to 256
+	* splitBasetime: bug fix
+        * Version 0.8.1 released
+
+2004-04-12  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* stream_cdf: replace cdfDefLon and cdfDefLonRot by cdfDefXaxis
+	              replace cdfDefLat and cdfDefLatRot by cdfDefYaxis
+	* stream_cdf: new function cdfDefVars
+	* cdfInqContents: support for attribute associate
+	* new function: grid*name, grid*longname, grid*units
+	* new function: gridDefPrec, gridInqPrec
+	* new function: zaxisDefPrec, zaxisInqPrec
+	* remove: gridDefXfirst, gridDefYfirst, gridDefXlast, gridDefYlast
+	          gridDefXinc, gridDefYinc
+        * Version 0.8.0 released
+	
+2004-03-14  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* new GRID type: CURVILINEAR
+	* add MPIOM1 table
+	* stream_grb.c: check var with table number
+	* srvReadRecord: bug fix
+	* cdfInqContents: set main coordinate variables to isvar=FALSE
+	* grid.c: add gridGenZonal, gridGenMeridional
+	* zaxis.c: add zaxisDefName, zaxisDefLongname, zaxisDefUnits
+	               zaxisInqName, zaxisInqLongname, zaxisInqUnits
+	* grbDefLevel: change pressure level packing
+	* cdfInqContent: change pressure level handling
+        * Version 0.7.9 released
+
+2004-01-05  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* New function: cdiOpenAppend
+	* zaxisDefLevels: move allocation of levels to zaxisNew
+	* cdfDefZaxis: bug fix zaxisID -> zaxisindex
+        * Version 0.7.8 released
+
+2003-12-8  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* griblib: version 0.5.3
+	* dtypes.h:   redefinition of INT64
+	* stream_cdf: use attribute missing_value
+	              warning if bounds var not found
+        * Version 0.7.7 released
+
+2003-11-5  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* dmemory: create memory list only if MEMORY_DEBUG is set
+	* memTotal: get total memory size from mallinfo
+	* tstepsNewEntry: change to add tsteps only (speedup)
+        * Version 0.7.6 released
+
+2003-10-31  Uwe Schulzweida  <schulzweida at dkrz.de>
+	
+	* redesign of the internal record stucture
+	* implementation of TUNIT_MONTH and TUNIT_YEAR
+	* cdf read and write var with nmiss for addoffset and scalefactor
+	* grbDefLevel: check that vct size is less than 256
+        * Version 0.7.5 released
+
+2003-10-12  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* environment variable CD_MISSVAL
+	* missing values for SERVICE and EXTRA
+	* griblib: version 0.5.2
+	* tableRead: update
+        * Version 0.7.4 released
+
+2003-10-5  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* streamInqVlist: return vlist
+	* replace streamVar to vlist
+	* remove streamVar
+	* change *funcID to *func
+        * Version 0.7.3 released
+	
+2003-10-3  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* change configuration for netCDF and HDF5 library to --with
+	* HDF5 test interface
+        * Version 0.7.2 released
+	
+2003-09-22  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* missing values for cdiReadVar*, cdiWriteVar*
+        * Version 0.7.1 released
+	
+2003-09-10  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* rename library to CDI (Climate Date Interface)
+	* fortran interface
+        * cdfInqContents: new implementation
+        * redesign with vlist
+        * implementation of cell grid
+	* cdfWriteVar*: bug fix for non regular grid
+        * Version 0.7.0 released
+	
+2003-07-28  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+        * handle missing values
+        * Version 0.6.0 released
+	
+2003-06-25  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* implementation of trajectory grid
+        * Version 0.5.11 released
+	
+2003-06-23  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* gdi_cdf: update for mozart initial files
+        * Version 0.5.10 released
+
+2003-06-17  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* gdi_cdf: skip bound vars
+
+2003-06-17  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+        * Version 0.5.9 released
+
+2003-06-11  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+        * reimplementation of time axis
+	* timesteps accesssable with timeID
+
+2003-05-20  Uwe Schulzweida  <schulzweida at dkrz.de>
+
+	* configuration with automake
+        * Version 0.5.8 released
+	
diff --git a/libcdi/INSTALL b/libcdi/INSTALL
new file mode 100644
index 0000000..a4b3414
--- /dev/null
+++ b/libcdi/INSTALL
@@ -0,0 +1,229 @@
+Copyright 1994, 1995, 1996, 1999, 2000, 2001, 2002 Free Software
+Foundation, Inc.
+
+   This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+   These are generic installation instructions.
+
+   The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation.  It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions.  Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+   It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring.  (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+   If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release.  If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+   The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'.  You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+  1. `cd' to the directory containing the package's source code and type
+     `./configure' to configure the package for your system.  If you're
+     using `csh' on an old version of System V, you might need to type
+     `sh ./configure' instead to prevent `csh' from trying to execute
+     `configure' itself.
+
+     Running `configure' takes awhile.  While running, it prints some
+     messages telling which features it is checking for.
+
+  2. Type `make' to compile the package.
+
+  3. Optionally, type `make check' to run any self-tests that come with
+     the package.
+
+  4. Type `make install' to install the programs and any data files and
+     documentation.
+
+  5. You can remove the program binaries and object files from the
+     source code directory by typing `make clean'.  To also remove the
+     files that `configure' created (so you can compile the package for
+     a different kind of computer), type `make distclean'.  There is
+     also a `make maintainer-clean' target, but that is intended mainly
+     for the package's developers.  If you use it, you may have to get
+     all sorts of other programs in order to regenerate files that came
+     with the distribution.
+
+Compilers and Options
+=====================
+
+   Some systems require unusual options for compilation or linking that
+the `configure' script does not know about.  Run `./configure --help'
+for details on some of the pertinent environment variables.
+
+   You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment.  Here
+is an example:
+
+     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+   *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+   You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory.  To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'.  `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script.  `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+   If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory.  After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+   By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc.  You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PATH'.
+
+   You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files.  If you
+give `configure' the option `--exec-prefix=PATH', the package will use
+PATH as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+   In addition, if you use an unusual directory layout you can give
+options like `--bindir=PATH' to specify different values for particular
+kinds of files.  Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+   If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+   Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System).  The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+   For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+   There may be some features `configure' cannot figure out
+automatically, but needs to determine by the type of machine the package
+will run on.  Usually, assuming the package is built to be run on the
+_same_ architectures, `configure' can figure that out, but if it prints
+a message saying it cannot guess the machine type, give it the
+`--build=TYPE' option.  TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+     CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+     OS KERNEL-OS
+
+   See the file `config.sub' for the possible values of each field.  If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+   If you are _building_ compiler tools for cross-compiling, you should
+use the `--target=TYPE' option to select the type of system they will
+produce code for.
+
+   If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+   If you want to set default values for `configure' scripts to share,
+you can create a site shell script called `config.site' that gives
+default values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists.  Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+   Variables not defined in a site shell script can be set in the
+environment passed to `configure'.  However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost.  In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'.  For example:
+
+     ./configure CC=/usr/local2/bin/gcc
+
+will cause the specified gcc to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+`configure' Invocation
+======================
+
+   `configure' recognizes the following options to control how it
+operates.
+
+`--help'
+`-h'
+     Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+     Print the version of Autoconf used to generate the `configure'
+     script, and exit.
+
+`--cache-file=FILE'
+     Enable the cache: use and save the results of the tests in FILE,
+     traditionally `config.cache'.  FILE defaults to `/dev/null' to
+     disable caching.
+
+`--config-cache'
+`-C'
+     Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+     Do not print messages saying which checks are being made.  To
+     suppress all normal output, redirect it to `/dev/null' (any error
+     messages will still be shown).
+
+`--srcdir=DIR'
+     Look for the package's source code in directory DIR.  Usually
+     `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options.  Run
+`configure --help' for more details.
+
diff --git a/libcdi/Makefile.am b/libcdi/Makefile.am
new file mode 100644
index 0000000..b9848a7
--- /dev/null
+++ b/libcdi/Makefile.am
@@ -0,0 +1,16 @@
+## Process this file with automake to produce Makefile.in
+#
+SUBDIRS = src interfaces app examples examples/pio tests
+#
+EXTRA_DIST=config/default \
+	doc/cdi_cman.pdf \
+	doc/cdi_fman.pdf \
+	src/cfortran.doc \
+	util/sunf95preproc-wrapper \
+	util/sxpreproc-wrapper \
+	util/xlfpreproc-wrapper \
+	config/interface.rb
+#
+ACLOCAL_AMFLAGS = -I m4
+#
+CLEANFILES  = `ls *~`
diff --git a/libcdi/Makefile.in b/libcdi/Makefile.in
new file mode 100644
index 0000000..120a69b
--- /dev/null
+++ b/libcdi/Makefile.in
@@ -0,0 +1,838 @@
+# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = .
+DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/cdi.settings.in \
+	$(top_srcdir)/configure $(top_srcdir)/src/pkgconfig/cdi.pc.in \
+	$(top_srcdir)/util/serialrun.in AUTHORS COPYING ChangeLog \
+	INSTALL NEWS config/compile config/config.guess \
+	config/config.sub config/depcomp config/install-sh \
+	config/ltmain.sh config/missing config/mkinstalldirs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+	$(top_srcdir)/m4/acx_assert_lang_is_fortran_variant.m4 \
+	$(top_srcdir)/m4/acx_lang_other_suffix_conftest.m4 \
+	$(top_srcdir)/m4/acx_options.m4 \
+	$(top_srcdir)/m4/acx_sl_fc_mod_path_flag.m4 \
+	$(top_srcdir)/m4/acx_sl_mod_suffix.m4 \
+	$(top_srcdir)/m4/asx_unset.m4 $(top_srcdir)/m4/ax_pthread.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/starlink_fpp.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES = util/serialrun cdi.settings src/pkgconfig/cdi.pc
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
+	html-recursive info-recursive install-data-recursive \
+	install-dvi-recursive install-exec-recursive \
+	install-html-recursive install-info-recursive \
+	install-pdf-recursive install-ps-recursive install-recursive \
+	installcheck-recursive installdirs-recursive pdf-recursive \
+	ps-recursive uninstall-recursive
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive	\
+  distclean-recursive maintainer-clean-recursive
+AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
+	$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS \
+	distdir dist dist-all distcheck
+ETAGS = etags
+CTAGS = ctags
+DIST_SUBDIRS = $(SUBDIRS)
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_distdir = \
+  if test -d "$(distdir)"; then \
+    find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+      && rm -rf "$(distdir)" \
+      || { sleep 5 && rm -rf "$(distdir)"; }; \
+  else :; fi
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+DIST_ARCHIVES = $(distdir).tar.gz
+GZIP_ENV = --best
+distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+  | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
+distcleancheck_listfiles = find . -type f -print
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDI_F90_INTERFACE_FCFLAGS = @CDI_F90_INTERFACE_FCFLAGS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
+ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
+ENABLE_EXTRA = @ENABLE_EXTRA@
+ENABLE_GRIB = @ENABLE_GRIB@
+ENABLE_IEG = @ENABLE_IEG@
+ENABLE_PYTHON = @ENABLE_PYTHON@
+ENABLE_RUBY = @ENABLE_RUBY@
+ENABLE_SERVICE = @ENABLE_SERVICE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_f90 = @FCFLAGS_f90@
+FCMODCASE = @FCMODCASE@
+FCMODEXT = @FCMODEXT@
+FC_MOD_FLAG = @FC_MOD_FLAG@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FPP = @FPP@
+FPPFLAGS = @FPPFLAGS@
+FPP_DEFOPT = @FPP_DEFOPT@
+FPP_INCOPT = @FPP_INCOPT@
+GREP = @GREP@
+GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
+GRIB_API_LIBS = @GRIB_API_LIBS@
+HDF5_INCLUDE = @HDF5_INCLUDE@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_ROOT = @HDF5_ROOT@
+HOST_NAME = @HOST_NAME@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JASPER_LIBS = @JASPER_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MPI_LAUNCH = @MPI_LAUNCH@
+NC_CONFIG = @NC_CONFIG@
+NETCDF_INCLUDE = @NETCDF_INCLUDE@
+NETCDF_LIBS = @NETCDF_LIBS@
+NETCDF_ROOT = @NETCDF_ROOT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENJPEG_LIBS = @OPENJPEG_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+RUBY = @RUBY@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SYSTEM_TYPE = @SYSTEM_TYPE@
+SZLIB_INCLUDE = @SZLIB_INCLUDE@
+SZLIB_LIBS = @SZLIB_LIBS@
+THREADS_INCLUDE = @THREADS_INCLUDE@
+THREADS_LIBS = @THREADS_LIBS@
+USER_NAME = @USER_NAME@
+USE_MPI = @USE_MPI@
+VERSION = @VERSION@
+ZLIB_INCLUDE = @ZLIB_INCLUDE@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+openjpeg_LIBS = @openjpeg_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+SUBDIRS = src interfaces app examples examples/pio tests
+#
+EXTRA_DIST = config/default \
+	doc/cdi_cman.pdf \
+	doc/cdi_fman.pdf \
+	src/cfortran.doc \
+	util/sunf95preproc-wrapper \
+	util/sxpreproc-wrapper \
+	util/xlfpreproc-wrapper \
+	config/interface.rb
+
+#
+ACLOCAL_AMFLAGS = -I m4
+#
+CLEANFILES = `ls *~`
+all: all-recursive
+
+.SUFFIXES:
+am--refresh: Makefile
+	@:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      echo ' cd $(srcdir) && $(AUTOMAKE) --gnu'; \
+	      $(am__cd) $(srcdir) && $(AUTOMAKE) --gnu \
+		&& exit 0; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    echo ' $(SHELL) ./config.status'; \
+	    $(SHELL) ./config.status;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	$(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	$(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+util/serialrun: $(top_builddir)/config.status $(top_srcdir)/util/serialrun.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+cdi.settings: $(top_builddir)/config.status $(srcdir)/cdi.settings.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+src/pkgconfig/cdi.pc: $(top_builddir)/config.status $(top_srcdir)/src/pkgconfig/cdi.pc.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+distclean-libtool:
+	-rm -f libtool config.lt
+
+# This directory's subdirectories are mostly independent; you can cd
+# into them and run `make' without going through this Makefile.
+# To change the values of `make' variables: instead of editing Makefiles,
+# (1) if the variable is set in `config.status', edit `config.status'
+#     (which will cause the Makefiles to be regenerated when you run `make');
+# (2) otherwise, pass the desired values on the `make' command line.
+$(RECURSIVE_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	target=`echo $@ | sed s/-recursive//`; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    dot_seen=yes; \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done; \
+	if test "$$dot_seen" = "no"; then \
+	  $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+	fi; test -z "$$fail"
+
+$(RECURSIVE_CLEAN_TARGETS):
+	@fail= failcom='exit 1'; \
+	for f in x $$MAKEFLAGS; do \
+	  case $$f in \
+	    *=* | --[!k]*);; \
+	    *k*) failcom='fail=yes';; \
+	  esac; \
+	done; \
+	dot_seen=no; \
+	case "$@" in \
+	  distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
+	  *) list='$(SUBDIRS)' ;; \
+	esac; \
+	rev=''; for subdir in $$list; do \
+	  if test "$$subdir" = "."; then :; else \
+	    rev="$$subdir $$rev"; \
+	  fi; \
+	done; \
+	rev="$$rev ."; \
+	target=`echo $@ | sed s/-recursive//`; \
+	for subdir in $$rev; do \
+	  echo "Making $$target in $$subdir"; \
+	  if test "$$subdir" = "."; then \
+	    local_target="$$target-am"; \
+	  else \
+	    local_target="$$target"; \
+	  fi; \
+	  ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+	  || eval $$failcom; \
+	done && test -z "$$fail"
+tags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
+	done
+ctags-recursive:
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
+	done
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS: tags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+	  include_option=--etags-include; \
+	  empty_fix=.; \
+	else \
+	  include_option=--include; \
+	  empty_fix=; \
+	fi; \
+	list='$(SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    test ! -f $$subdir/TAGS || \
+	      set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+	  fi; \
+	done; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS: ctags-recursive $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	$(am__remove_distdir)
+	test -d "$(distdir)" || mkdir "$(distdir)"
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+	@list='$(DIST_SUBDIRS)'; for subdir in $$list; do \
+	  if test "$$subdir" = .; then :; else \
+	    $(am__make_dryrun) \
+	      || test -d "$(distdir)/$$subdir" \
+	      || $(MKDIR_P) "$(distdir)/$$subdir" \
+	      || exit 1; \
+	    dir1=$$subdir; dir2="$(distdir)/$$subdir"; \
+	    $(am__relativize); \
+	    new_distdir=$$reldir; \
+	    dir1=$$subdir; dir2="$(top_distdir)"; \
+	    $(am__relativize); \
+	    new_top_distdir=$$reldir; \
+	    echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+	    echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+	    ($(am__cd) $$subdir && \
+	      $(MAKE) $(AM_MAKEFLAGS) \
+	        top_distdir="$$new_top_distdir" \
+	        distdir="$$new_distdir" \
+		am__remove_distdir=: \
+		am__skip_length_check=: \
+		am__skip_mode_fix=: \
+	        distdir) \
+	      || exit 1; \
+	  fi; \
+	done
+	-test -n "$(am__skip_mode_fix)" \
+	|| find "$(distdir)" -type d ! -perm -755 \
+		-exec chmod u+rwx,go+rx {} \; -o \
+	  ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+	  ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+	|| chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+dist-bzip2: distdir
+	tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+	$(am__remove_distdir)
+
+dist-lzip: distdir
+	tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+	$(am__remove_distdir)
+
+dist-lzma: distdir
+	tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
+	$(am__remove_distdir)
+
+dist-xz: distdir
+	tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+	$(am__remove_distdir)
+
+dist-tarZ: distdir
+	tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+	$(am__remove_distdir)
+
+dist-shar: distdir
+	shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+	$(am__remove_distdir)
+
+dist-zip: distdir
+	-rm -f $(distdir).zip
+	zip -rq $(distdir).zip $(distdir)
+	$(am__remove_distdir)
+
+dist dist-all: distdir
+	tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+	$(am__remove_distdir)
+
+# This target untars the dist file and tries a VPATH configuration.  Then
+# it guarantees that the distribution is self-contained by making another
+# tarfile.
+distcheck: dist
+	case '$(DIST_ARCHIVES)' in \
+	*.tar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+	*.tar.bz2*) \
+	  bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+	*.tar.lzma*) \
+	  lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+	*.tar.lz*) \
+	  lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+	*.tar.xz*) \
+	  xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+	*.tar.Z*) \
+	  uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+	*.shar.gz*) \
+	  GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+	*.zip*) \
+	  unzip $(distdir).zip ;;\
+	esac
+	chmod -R a-w $(distdir); chmod a+w $(distdir)
+	mkdir $(distdir)/_build
+	mkdir $(distdir)/_inst
+	chmod a-w $(distdir)
+	test -d $(distdir)/_build || exit 0; \
+	dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+	  && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+	  && am__cwd=`pwd` \
+	  && $(am__cd) $(distdir)/_build \
+	  && ../configure --srcdir=.. --prefix="$$dc_install_base" \
+	    $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+	    $(DISTCHECK_CONFIGURE_FLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) \
+	  && $(MAKE) $(AM_MAKEFLAGS) dvi \
+	  && $(MAKE) $(AM_MAKEFLAGS) check \
+	  && $(MAKE) $(AM_MAKEFLAGS) install \
+	  && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+	  && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+	  && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+	        distuninstallcheck \
+	  && chmod -R a-w "$$dc_install_base" \
+	  && ({ \
+	       (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+	       && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+	            distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+	      } || { rm -rf "$$dc_destdir"; exit 1; }) \
+	  && rm -rf "$$dc_destdir" \
+	  && $(MAKE) $(AM_MAKEFLAGS) dist \
+	  && rm -rf $(DIST_ARCHIVES) \
+	  && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+	  && cd "$$am__cwd" \
+	  || exit 1
+	$(am__remove_distdir)
+	@(echo "$(distdir) archives ready for distribution: "; \
+	  list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
+	  sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
+distuninstallcheck:
+	@test -n '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: trying to run $@ with an empty' \
+	       '$$(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	$(am__cd) '$(distuninstallcheck_dir)' || { \
+	  echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+	  exit 1; \
+	}; \
+	test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
+	   || { echo "ERROR: files left after uninstall:" ; \
+	        if test -n "$(DESTDIR)"; then \
+	          echo "  (check DESTDIR support)"; \
+	        fi ; \
+	        $(distuninstallcheck_listfiles) ; \
+	        exit 1; } >&2
+distcleancheck: distclean
+	@if test '$(srcdir)' = . ; then \
+	  echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+	  exit 1 ; \
+	fi
+	@test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+	  || { echo "ERROR: files left in build directory after distclean:" ; \
+	       $(distcleancheck_listfiles) ; \
+	       exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-libtool \
+	distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+	-rm -f $(am__CONFIG_DISTCLEAN_FILES)
+	-rm -rf $(top_srcdir)/autom4te.cache
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) ctags-recursive \
+	install-am install-strip tags-recursive
+
+.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
+	all all-am am--refresh check check-am clean clean-generic \
+	clean-libtool ctags ctags-recursive dist dist-all dist-bzip2 \
+	dist-gzip dist-lzip dist-lzma dist-shar dist-tarZ dist-xz \
+	dist-zip distcheck distclean distclean-generic \
+	distclean-libtool distclean-tags distcleancheck distdir \
+	distuninstallcheck dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	installdirs-am maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+	ps ps-am tags tags-recursive uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libcdi/NEWS b/libcdi/NEWS
new file mode 100644
index 0000000..f913d46
--- /dev/null
+++ b/libcdi/NEWS
@@ -0,0 +1,110 @@
+CDI NEWS
+--------
+
+Version 1.5.9 (17 December 2012):
+
+   New features:
+     * file.c::file_initialize: added support for env GRIB_API_IO_BUFFER_SIZE
+   New functions:
+     * vlistDefVarChunktype(): set chunktype to CHUNK_AUTO, CHUNK_GRID, CHUNK_LINES
+     * vlistInqVarChunktype(): returns the chunktype
+   Fixed bugs:
+     * vlistCopyFlag: added support for level bounds
+     * netCDF: added support for time axis name and long_name
+     * cgribexGetGrid: bug fix for xinc/yinc recomputation
+     * stream_cdf::define_all_vars: added txt attributes to vlistDefAttTxt() without trailing 0 [Bug #3004]
+
+Version 1.5.8 (30 October 2012):
+
+   New features:
+     * grib2: added stepType support for absolute time axis
+     * netCDF: set 1D arrays to coordinate variables if axis attribute is available
+   Fixed bugs:
+     * grib2: changed packingType from grid_jpeg to grid_simple if nmiss > 0
+
+Version 1.5.7 (27 August 2012):
+
+   New features:
+     * Merge of branch cdo-pio into trunk cdi
+
+Version 1.5.6 (27 July 2012):
+
+   New features:
+     * netCDF: added support for environment variable NC_CHUNKSIZEHINT
+     * GRIB2: added support for level type HYBRID_HALF
+     * GRIB2: added support for grib_api key stepType with TSTEP_<type> in vlistDefVar()
+   Fixed bugs:
+     * wrong netCDF output for unscaled uint8, int8, int16, int32 variables (bug introduced in 1.5.5)
+
+Version 1.5.5 (15 May 2012):
+
+   New features:
+     * Added single precision support: streamWriteVarF, streamWriteVarSliceF
+     * Added support for ZAXIS_DEPTH_BELOW_LAND units "mm",  "cm", "dm" and "m"
+
+Version 1.5.4 (30 January 2012):
+
+   New features:
+     * Added support for GRIB2 packing type grid_ieee
+     * Added support for GRIB2 level type 150
+
+Version 1.5.3 (17 October 2011):
+
+   New features:
+     * Added support for level type ZAXIS_TOA, ZAXIS_SEA_BOTTOM, ZAXIS_ATMOSPHERE
+   Fixed bugs:
+     * deflate compression with netCDF4 doesn't work
+
+Version 1.5.2 (22 August 2011):
+
+   New features:
+     * Added flexible XYZ dimension ordering for netCDF
+     * Added support for grid type GRID_FOURIER (fourier coefficients)
+     * Added interface function zaxisInqVct to read the VCT
+
+Version 1.5.1 (12 July 2011):
+
+   New features:
+     * Added support for FILETYPE_NC4C (netcdf4 classic)
+
+Version 1.5.0 (15 March 2011):
+
+   New features: 
+     * GRIB2 support via ECMWF GRIB_API
+     * Added support for netCDF level bounds
+
+Version 1.4.7 (3 January 2011):
+
+   New features:
+     * improved support for netCDF output from WRF model
+
+Version 1.4.6 (17 September 2010):
+
+   New features:
+     * GRIB1: use packing only for non constant fields
+     * Added support for attribute type int16 and float32
+     * use libtool 2.2.10 for compiling + linking
+
+Version 1.4.5.1 (5 July 2010):
+
+   New features:
+      * Added support for grid mask
+      * GRIB1 decode: Correct ZeroShiftError of simple packed spherical harmonics
+
+Version 1.4.5 (6 June 2010):
+
+   Fixed bugs:
+      * stream_history: added NC4 support
+      * gridGenYvals: bug fix for nlat > 4096
+
+Version 1.4.4 (29 April 2010):
+
+   New features:
+      * MAX_STREAMS: changed fixed size of 4096 to dynamic range of 1024 - 65536
+      * added support for GRIB1 time units 3hours and 6hours
+      * added support for non integer time units MONTH
+      * vlistMerge: added support to merge levels
+
+   Fixed bugs:
+      * gauaw: bug fix for allocation of zfnlat for odd number of nlat
+      * cgribexDefTime: bug fix for GRIB1 time range 3 and 10
diff --git a/libcdi/README b/libcdi/README
new file mode 100644
index 0000000..de23134
--- /dev/null
+++ b/libcdi/README
@@ -0,0 +1,56 @@
+
+CDI - Climate Data Interface
+----------------------------
+
+     This package contains the source code for the CDI library from
+     the Max-Planck-Institute for Meteorology.
+     CDI is a C and Fortran Interface to access Climate model Data.
+     Supported data formats are GRIB, netCDF, SERVICE, EXTRA and IEG.
+
+     CDI is licensed under the GNU General Public License, version 2.
+     Read the file COPYING in the source distribution for details.
+
+     MPI-M makes no representations or warranties of any kind concerning the Software and any results
+     (including but not limited to any data) generated by use of the Software (hereinafter "Results"),
+     express or implied, and the absence of any legal or actual defects, whether discoverable or not.
+     The use of the Software and the Results is at your own risk.
+
+     Specifically, and not to limit the foregoing, MPI-M makes no representations or warranties 
+       (i) regarding the fitness for a particular purpose of the Software and the Results,
+      (ii) that the use of the Software and the Results will not infringe any patents or other 
+           intellectual property rights of any third party, and 
+     (iii) that the use of the Software and the Results will not cause any damages of any kind 
+           to you or to any third party.
+
+Documentation:
+
+     CDI C Manual:       ./doc/cdi_cman.pdf
+     CDI Fortran Manual: ./doc/cdi_fman.pdf
+
+Installation:
+
+     1. Run ./configure, with some options if you wish. The standard
+        options are documented in the INSTALL file. The configuration
+        script has some more options; type 'configure -h' to see them.
+        The most interesting ones are the usual
+        --prefix=<installation directory> and
+        --with-netcdf=<netCDF root directory> to enable netCDF support.
+
+     2. Do "make" to compile the library.
+
+     3. (Optional) Do "make install", possibly as root if the destination
+        permissions require that. This installs CDI in the directory
+        specified during configuration. The default prefix is /usr/local.
+
+Porting:
+
+     This library was designed for maximum portability. It is written entirely
+     in ANSI C99, and will compile on most UNIX platforms.
+
+     The FORTRAN 77 interface is using the cfortran.h macros from
+     http://www-zeus.desy.de/~burow/cfortran/
+     
+Contact:
+
+     Send questions, comments and bug reports to <http://code.zmaw.de/projects/cdi>
+
diff --git a/libcdi/acinclude.m4 b/libcdi/acinclude.m4
new file mode 100644
index 0000000..68f06df
--- /dev/null
+++ b/libcdi/acinclude.m4
@@ -0,0 +1,20 @@
+dnl
+dnl AC_CHECK_CFINT
+dnl
+dnl Check C / Fortran interface
+dnl
+AC_DEFUN([ACX_CHECK_CFINT],
+  [AC_CACHE_CHECK([whether the C / Fortran interface works],[acx_cv_check_cfint],
+     [AC_LANG_PUSH([C])
+      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include "$1"],[])],
+        [acx_cv_check_cfint=yes],
+        [acx_cv_check_cfint=no])
+      AC_LANG_POP([C])])
+   AS_IF([test x$acx_cv_check_cfint = xyes],
+     [AC_DEFINE(HAVE_CF_INTERFACE, [1],
+        [Define if C / Fortran interface cfortran.h works])])
+  ])
+dnl
+dnl Local Variables:
+dnl mode: autoconf
+dnl End:
diff --git a/libcdi/aclocal.m4 b/libcdi/aclocal.m4
new file mode 100644
index 0000000..1ea95c4
--- /dev/null
+++ b/libcdi/aclocal.m4
@@ -0,0 +1,1037 @@
+# generated automatically by aclocal 1.11.5 -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software Foundation,
+# Inc.
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.68],,
+[m4_warning([this file was generated for autoconf 2.68.
+You have another version of autoconf.  It may work, but is not guaranteed to.
+If you have problems, you may need to regenerate the build system entirely.
+To do so, use the procedure documented by the package, typically `autoreconf'.])])
+
+# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008, 2011 Free Software
+# Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.11'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.11.5], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.11.5])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
+# $ac_aux_dir to `$srcdir/foo'.  In other projects, it is set to
+# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
+# are both prefixed by $srcdir.  In an in-source build this is usually
+# harmless because $srcdir is `.', but things will broke when you
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[dnl Rely on autoconf to set up CDPATH properly.
+AC_PREREQ([2.50])dnl
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 9
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[AC_PREREQ(2.52)dnl
+ ifelse([$1], [TRUE],  [AC_FATAL([$0: invalid condition: $1])],
+	[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+AC_SUBST([$1_TRUE])dnl
+AC_SUBST([$1_FALSE])dnl
+_AM_SUBST_NOTMAKE([$1_TRUE])dnl
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009,
+# 2010, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 12
+
+# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# written in clear, in which case automake, when reading aclocal.m4,
+# will think it sees a *use*, and therefore will trigger all it's
+# C support machinery.  Also note that it means that autoscan, seeing
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# We try a few techniques and use that to set a single cache variable.
+#
+# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+ifelse([$1], CC,   [depcc="$CC"   am_compiler_list=],
+       [$1], CXX,  [depcc="$CXX"  am_compiler_list=],
+       [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+       [$1], UPC,  [depcc="$UPC"  am_compiler_list=],
+       [$1], GCJ,  [depcc="$GCJ"  am_compiler_list='gcc3 gcc'],
+                   [depcc="$$1"   am_compiler_list=])
+
+AC_CACHE_CHECK([dependency style of $depcc],
+               [am_cv_$1_dependencies_compiler_type],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+AC_DEFUN([AM_SET_DEPDIR],
+[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[AC_ARG_ENABLE(dependency-tracking,
+[  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors])
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
+AC_SUBST([AMDEPBACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
+])
+
+# Generate code to set up dependency tracking.              -*- Autoconf -*-
+
+# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+#serial 5
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each `.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 8
+
+# AM_CONFIG_HEADER is obsolete.  It has been replaced by AC_CONFIG_HEADERS.
+AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
+# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 16
+
+# This macro actually does too much.  Some checks are only needed if
+# your package does certain things.  But this isn't really a big deal.
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# arguments mandatory, and then we can depend on a new Autoconf
+# release and drop the old call support.
+AC_DEFUN([AM_INIT_AUTOMAKE],
+[AC_PREREQ([2.62])dnl
+dnl Autoconf wants to disallow AM_ names.  We explicitly allow
+dnl the ones we care about.
+m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+ AC_SUBST([PACKAGE], [$1])dnl
+ AC_SUBST([VERSION], [$2])],
+[_AM_SET_OPTIONS([$1])dnl
+dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
+m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+  [m4_fatal([AC_INIT should be called with package and version arguments])])dnl
+ AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
+ AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
+
+_AM_IF_OPTION([no-define],,
+[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
+ AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+
+# Some tools Automake needs.
+AC_REQUIRE([AM_SANITY_CHECK])dnl
+AC_REQUIRE([AC_ARG_PROGRAM])dnl
+AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
+AM_MISSING_PROG(AUTOCONF, autoconf)
+AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
+AM_MISSING_PROG(AUTOHEADER, autoheader)
+AM_MISSING_PROG(MAKEINFO, makeinfo)
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+	      [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+			     [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+		  [_AM_DEPENDENCIES(CC)],
+		  [define([AC_PROG_CC],
+			  defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_CXX],
+		  [_AM_DEPENDENCIES(CXX)],
+		  [define([AC_PROG_CXX],
+			  defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+		  [_AM_DEPENDENCIES(OBJC)],
+		  [define([AC_PROG_OBJC],
+			  defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+])
+_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
+dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
+dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen.  This macro
+dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_CONFIG_COMMANDS_PRE(dnl
+[m4_provide_if([_AM_COMPILER_EXEEXT],
+  [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
+])
+
+dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion.  Do not
+dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
+dnl mangled by Autoconf and run in a shell conditional statement.
+m4_define([_AC_COMPILER_EXEEXT],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001, 2003, 2005, 2008, 2011 Free Software Foundation,
+# Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST(install_sh)])
+
+# Copyright (C) 2003, 2005  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008,
+# 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless `enable' is passed literally.
+# For symmetry, `disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t at _MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+[  --][am_maintainer_other][-maintainer-mode  am_maintainer_other make rules and dependencies not useful
+			  (and sometimes confusing) to the casual installer],
+      [USE_MAINTAINER_MODE=$enableval],
+      [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST([MAINT])dnl
+]
+)
+
+AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
+
+# Check to see how 'make' treats includes.	            -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2009  Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 4
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 6
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# Define MISSING if not defined so far and test if it supports --run.
+# If it does, set am_missing_run to use it, otherwise, to nothing.
+AC_DEFUN([AM_MISSING_HAS_RUN],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([missing])dnl
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  AC_MSG_WARN([`missing' script is too old or missing])
+fi
+])
+
+# Copyright (C) 2003, 2004, 2005, 2006, 2011 Free Software Foundation,
+# Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_MKDIR_P
+# ---------------
+# Check for `mkdir -p'.
+AC_DEFUN([AM_PROG_MKDIR_P],
+[AC_PREREQ([2.60])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+dnl Automake 1.8 to 1.9.6 used to define mkdir_p.  We now use MKDIR_P,
+dnl while keeping a definition of mkdir_p for backward compatibility.
+dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
+dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
+dnl Makefile.ins that do not define MKDIR_P, so we do our own
+dnl adjustment using top_builddir (which is defined more often than
+dnl MKDIR_P).
+AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
+case $mkdir_p in
+  [[\\/$]]* | ?:[[\\/]]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001, 2002, 2003, 2005, 2008, 2010 Free Software
+# Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# _AM_MANGLE_OPTION(NAME)
+# -----------------------
+AC_DEFUN([_AM_MANGLE_OPTION],
+[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
+
+# _AM_SET_OPTION(NAME)
+# --------------------
+# Set option NAME.  Presently that only means defining a flag for this option.
+AC_DEFUN([_AM_SET_OPTION],
+[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+
+# _AM_SET_OPTIONS(OPTIONS)
+# ------------------------
+# OPTIONS is a space-separated list of Automake options.
+AC_DEFUN([_AM_SET_OPTIONS],
+[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
+# Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 5
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \	]]*)
+    AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$[*]" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$[*]" != "X $srcdir/configure conftest.file" \
+      && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      AC_MSG_ERROR([ls -t appears to fail.  Make sure there is not a broken
+alias in your environment])
+   fi
+
+   test "$[2]" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+AC_MSG_RESULT(yes)])
+
+# Copyright (C) 2001, 2003, 2005, 2011 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 1
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# One issue with vendor `install' (even GNU) is that you can't
+# specify the program used to strip binaries.  This is especially
+# annoying in cross-compiling environments, where the build's strip
+# is unlikely to handle the host's binaries.
+# Fortunately install-sh will honor a STRIPPROG variable, so we
+# always use install-sh in `make install-strip', and initialize
+# STRIPPROG with the value of the STRIP variable (set by the user).
+AC_DEFUN([AM_PROG_INSTALL_STRIP],
+[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+if test "$cross_compiling" != no; then
+  AC_CHECK_TOOL([STRIP], [strip], :)
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+AC_SUBST([INSTALL_STRIP_PROGRAM])])
+
+# Copyright (C) 2006, 2008, 2010 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 3
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+AC_DEFUN([_AM_SUBST_NOTMAKE])
+
+# AM_SUBST_NOTMAKE(VARIABLE)
+# --------------------------
+# Public sister of _AM_SUBST_NOTMAKE.
+AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
+
+# Check how to create a tarball.                            -*- Autoconf -*-
+
+# Copyright (C) 2004, 2005, 2012 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# serial 2
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# FORMAT should be one of `v7', `ustar', or `pax'.
+#
+# Substitute a variable $(am__tar) that is a command
+# writing to stdout a FORMAT-tarball containing the directory
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# Substitute a variable $(am__untar) that extract such
+# a tarball read from stdin.
+#     $(am__untar) < result.tar
+AC_DEFUN([_AM_PROG_TAR],
+[# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+m4_if([$1], [v7],
+     [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+     [m4_case([$1], [ustar],, [pax],,
+              [m4_fatal([Unknown tar format])])
+AC_MSG_CHECKING([how to create a $1 tar archive])
+# Loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
+_am_tools=${am_cv_prog_tar_$1-$_am_tools}
+# Do not fold the above two line into one, because Tru64 sh and
+# Solaris sh will not grok spaces in the rhs of `-'.
+for _am_tool in $_am_tools
+do
+  case $_am_tool in
+  gnutar)
+    for _am_tar in tar gnutar gtar;
+    do
+      AM_RUN_LOG([$_am_tar --version]) && break
+    done
+    am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+    am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+    am__untar="$_am_tar -xf -"
+    ;;
+  plaintar)
+    # Must skip GNU tar: if it does not support --format= it doesn't create
+    # ustar tarball either.
+    (tar --version) >/dev/null 2>&1 && continue
+    am__tar='tar chf - "$$tardir"'
+    am__tar_='tar chf - "$tardir"'
+    am__untar='tar xf -'
+    ;;
+  pax)
+    am__tar='pax -L -x $1 -w "$$tardir"'
+    am__tar_='pax -L -x $1 -w "$tardir"'
+    am__untar='pax -r'
+    ;;
+  cpio)
+    am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+    am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+    am__untar='cpio -i -H $1 -d'
+    ;;
+  none)
+    am__tar=false
+    am__tar_=false
+    am__untar=false
+    ;;
+  esac
+
+  # If the value was cached, stop now.  We just wanted to have am__tar
+  # and am__untar set.
+  test -n "${am_cv_prog_tar_$1}" && break
+
+  # tar/untar a dummy directory, and stop if the command works
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  echo GrepMe > conftest.dir/file
+  AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+  rm -rf conftest.dir
+  if test -s conftest.tar; then
+    AM_RUN_LOG([$am__untar <conftest.tar])
+    grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+  fi
+done
+rm -rf conftest.dir
+
+AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+AC_SUBST([am__tar])
+AC_SUBST([am__untar])
+]) # _AM_PROG_TAR
+
+m4_include([m4/acx_assert_lang_is_fortran_variant.m4])
+m4_include([m4/acx_lang_other_suffix_conftest.m4])
+m4_include([m4/acx_options.m4])
+m4_include([m4/acx_sl_fc_mod_path_flag.m4])
+m4_include([m4/acx_sl_mod_suffix.m4])
+m4_include([m4/asx_unset.m4])
+m4_include([m4/ax_pthread.m4])
+m4_include([m4/libtool.m4])
+m4_include([m4/ltoptions.m4])
+m4_include([m4/ltsugar.m4])
+m4_include([m4/ltversion.m4])
+m4_include([m4/lt~obsolete.m4])
+m4_include([m4/starlink_fpp.m4])
+m4_include([acinclude.m4])
diff --git a/libcdi/app/Makefile.am b/libcdi/app/Makefile.am
new file mode 100644
index 0000000..0fc7ff9
--- /dev/null
+++ b/libcdi/app/Makefile.am
@@ -0,0 +1,27 @@
+## Process this file with automake to produce Makefile.in
+#
+bin_PROGRAMS    =
+noinst_PROGRAMS =
+if ENABLE_CDI_LIB
+  bin_PROGRAMS    += cdi
+else
+  noinst_PROGRAMS += cdi
+endif
+#
+noinst_PROGRAMS    += createtable
+#
+cdi_SOURCES         = cdi.c printinfo.h
+cdi_LDADD           = $(top_builddir)/src/libcdi.la @LIBS@
+if ENABLE_ALL_STATIC
+cdi_LDFLAGS         = -all-static
+endif
+#
+createtable_SOURCES = createtable.c
+createtable_LDADD   = $(top_builddir)/src/libcdi.la
+if ENABLE_ALL_STATIC
+createtable_LDFLAGS = -all-static
+endif
+#
+AM_CPPFLAGS         = -I$(top_srcdir)/src
+#
+CLEANFILES          = `ls *~`
diff --git a/libcdi/app/Makefile.in b/libcdi/app/Makefile.in
new file mode 100644
index 0000000..d068af7
--- /dev/null
+++ b/libcdi/app/Makefile.in
@@ -0,0 +1,646 @@
+# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = $(am__EXEEXT_1)
+noinst_PROGRAMS = $(am__EXEEXT_2) createtable$(EXEEXT)
+ at ENABLE_CDI_LIB_TRUE@am__append_1 = cdi
+ at ENABLE_CDI_LIB_FALSE@am__append_2 = cdi
+subdir = app
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+	$(top_srcdir)/m4/acx_assert_lang_is_fortran_variant.m4 \
+	$(top_srcdir)/m4/acx_lang_other_suffix_conftest.m4 \
+	$(top_srcdir)/m4/acx_options.m4 \
+	$(top_srcdir)/m4/acx_sl_fc_mod_path_flag.m4 \
+	$(top_srcdir)/m4/acx_sl_mod_suffix.m4 \
+	$(top_srcdir)/m4/asx_unset.m4 $(top_srcdir)/m4/ax_pthread.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/starlink_fpp.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+ at ENABLE_CDI_LIB_TRUE@am__EXEEXT_1 = cdi$(EXEEXT)
+am__installdirs = "$(DESTDIR)$(bindir)"
+ at ENABLE_CDI_LIB_FALSE@am__EXEEXT_2 = cdi$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+am_cdi_OBJECTS = cdi.$(OBJEXT)
+cdi_OBJECTS = $(am_cdi_OBJECTS)
+cdi_DEPENDENCIES = $(top_builddir)/src/libcdi.la
+cdi_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(cdi_LDFLAGS) \
+	$(LDFLAGS) -o $@
+am_createtable_OBJECTS = createtable.$(OBJEXT)
+createtable_OBJECTS = $(am_createtable_OBJECTS)
+createtable_DEPENDENCIES = $(top_builddir)/src/libcdi.la
+createtable_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(createtable_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(cdi_SOURCES) $(createtable_SOURCES)
+DIST_SOURCES = $(cdi_SOURCES) $(createtable_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDI_F90_INTERFACE_FCFLAGS = @CDI_F90_INTERFACE_FCFLAGS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
+ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
+ENABLE_EXTRA = @ENABLE_EXTRA@
+ENABLE_GRIB = @ENABLE_GRIB@
+ENABLE_IEG = @ENABLE_IEG@
+ENABLE_PYTHON = @ENABLE_PYTHON@
+ENABLE_RUBY = @ENABLE_RUBY@
+ENABLE_SERVICE = @ENABLE_SERVICE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_f90 = @FCFLAGS_f90@
+FCMODCASE = @FCMODCASE@
+FCMODEXT = @FCMODEXT@
+FC_MOD_FLAG = @FC_MOD_FLAG@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FPP = @FPP@
+FPPFLAGS = @FPPFLAGS@
+FPP_DEFOPT = @FPP_DEFOPT@
+FPP_INCOPT = @FPP_INCOPT@
+GREP = @GREP@
+GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
+GRIB_API_LIBS = @GRIB_API_LIBS@
+HDF5_INCLUDE = @HDF5_INCLUDE@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_ROOT = @HDF5_ROOT@
+HOST_NAME = @HOST_NAME@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JASPER_LIBS = @JASPER_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MPI_LAUNCH = @MPI_LAUNCH@
+NC_CONFIG = @NC_CONFIG@
+NETCDF_INCLUDE = @NETCDF_INCLUDE@
+NETCDF_LIBS = @NETCDF_LIBS@
+NETCDF_ROOT = @NETCDF_ROOT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENJPEG_LIBS = @OPENJPEG_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+RUBY = @RUBY@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SYSTEM_TYPE = @SYSTEM_TYPE@
+SZLIB_INCLUDE = @SZLIB_INCLUDE@
+SZLIB_LIBS = @SZLIB_LIBS@
+THREADS_INCLUDE = @THREADS_INCLUDE@
+THREADS_LIBS = @THREADS_LIBS@
+USER_NAME = @USER_NAME@
+USE_MPI = @USE_MPI@
+VERSION = @VERSION@
+ZLIB_INCLUDE = @ZLIB_INCLUDE@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+openjpeg_LIBS = @openjpeg_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+#
+cdi_SOURCES = cdi.c printinfo.h
+cdi_LDADD = $(top_builddir)/src/libcdi.la @LIBS@
+ at ENABLE_ALL_STATIC_TRUE@cdi_LDFLAGS = -all-static
+#
+createtable_SOURCES = createtable.c
+createtable_LDADD = $(top_builddir)/src/libcdi.la
+ at ENABLE_ALL_STATIC_TRUE@createtable_LDFLAGS = -all-static
+#
+AM_CPPFLAGS = -I$(top_srcdir)/src
+#
+CLEANFILES = `ls *~`
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu app/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu app/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+cdi$(EXEEXT): $(cdi_OBJECTS) $(cdi_DEPENDENCIES) $(EXTRA_cdi_DEPENDENCIES) 
+	@rm -f cdi$(EXEEXT)
+	$(cdi_LINK) $(cdi_OBJECTS) $(cdi_LDADD) $(LIBS)
+createtable$(EXEEXT): $(createtable_OBJECTS) $(createtable_DEPENDENCIES) $(EXTRA_createtable_DEPENDENCIES) 
+	@rm -f createtable$(EXEEXT)
+	$(createtable_LINK) $(createtable_OBJECTS) $(createtable_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdi.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/createtable.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool \
+	clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool clean-noinstPROGRAMS ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-binPROGRAMS \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-binPROGRAMS
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libcdi/app/cdi.c b/libcdi/app/cdi.c
new file mode 100644
index 0000000..59f31e3
--- /dev/null
+++ b/libcdi/app/cdi.c
@@ -0,0 +1,1089 @@
+#if defined (HAVE_CONFIG_H)
+#  include "../src/config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <math.h>
+
+#include <cdi.h>
+int      vlistInqVarMissvalUsed(int vlistID, int varID);
+#ifndef DBL_IS_NAN
+#if  defined  (HAVE_DECL_ISNAN)
+#  define DBL_IS_NAN(x)     (isnan(x))
+#elif  defined  (FP_NAN)
+#  define DBL_IS_NAN(x)     (fpclassify(x) == FP_NAN)
+#else
+#  define DBL_IS_NAN(x)     ((x) != (x))
+#endif
+#endif
+
+#ifndef DBL_IS_EQUAL
+/*#define DBL_IS_EQUAL(x,y) (!(x < y || y < x)) */
+#  define DBL_IS_EQUAL(x,y) (DBL_IS_NAN(x)||DBL_IS_NAN(y)?(DBL_IS_NAN(x)&&DBL_IS_NAN(y)?1:0):!(x < y || y < x))
+#endif
+
+#ifndef IS_EQUAL
+#  define IS_NOT_EQUAL(x,y) (x < y || y < x)
+#  define IS_EQUAL(x,y)     (!IS_NOT_EQUAL(x,y))
+#endif
+
+
+#include "printinfo.h"
+
+void cdiDefTableID(int tableID);
+
+int getopt(int argc, char *const argv[], const char *optstring);
+
+extern char *optarg;
+extern int optind, opterr, optopt;
+
+
+char *Progname;
+
+int DefaultFileType  = CDI_UNDEFID;
+int DefaultDataType  = CDI_UNDEFID;
+int DefaultByteorder = CDI_UNDEFID;
+
+int comptype  = COMPRESS_NONE;  // Compression type
+int complevel = 0;              // Compression level
+
+
+static
+void version(void)
+{
+  fprintf(stderr, "CDI version 1.8\n");
+#if defined (COMPILER)
+  fprintf(stderr, "Compiler: %s\n", COMPILER);
+#endif
+#if defined (COMP_VERSION)
+  fprintf(stderr, " version: %s\n", COMP_VERSION);
+#endif
+  fprintf(stderr, "    with:");
+#if defined (HAVE_LIBPTHREAD)
+  fprintf(stderr, " PTHREADS");
+#endif
+#if defined (_OPENMP)
+  fprintf(stderr, " OpenMP");
+#endif
+#if  defined  (HAVE_NETCDF4)
+  fprintf(stderr, " NC4");
+#endif
+#if  defined  (HAVE_LIBNC_DAP)
+  fprintf(stderr, " OPeNDAP");
+#endif
+#if defined (HAVE_LIBSZ)
+  fprintf(stderr, " SZ");
+#endif
+#if defined (HAVE_LIBZ)
+  fprintf(stderr, " Z");
+#endif
+#if defined (HAVE_LIBJASPER)
+  fprintf(stderr, " JASPER");
+#endif
+#if defined (HAVE_LIBPROJ)
+  fprintf(stderr, " PROJ.4");
+#endif
+#if defined (HAVE_LIBDRMAA)
+  fprintf(stderr, " DRMAA");
+#endif
+#if defined (HAVE_LIBCURL)
+  fprintf(stderr, " CURL");
+#endif
+  fprintf(stderr, "\n");
+#if defined (USER_NAME) && defined(HOST_NAME) && defined(SYSTEM_TYPE)
+  fprintf(stderr, "Compiled: by %s on %s (%s) %s %s\n",
+	  USER_NAME, HOST_NAME, SYSTEM_TYPE, __DATE__, __TIME__);
+#endif
+  cdiPrintVersion();
+  fprintf(stderr, "\n");
+/*
+  1.0.0   6 Feb 2001 : initial version
+  1.1.0  30 Jul 2003 : missing values implemented
+  1.2.0   8 Aug 2003 : changes for CDI library version 0.7.0
+  1.3.0  10 Feb 2004 : changes for CDI library version 0.7.9
+  1.4.0   5 May 2004 : changes for CDI library version 0.8.1 (error handling)
+  1.4.1  18 Sep 2004 : netCDF 2 support
+  1.4.2  22 Mar 2005 : change level from int to double
+  1.4.3  11 Apr 2005 : change date and time format to ISO
+  1.5.0  22 Nov 2005 : IEG support
+  1.5.1  21 Feb 2006 : added option -s for short info
+  1.6.0   1 Aug 2006 : added option -z szip for SZIP compression of GRIB records
+  1.6.1  27 Feb 2007 : short info with ltype for GENERIC zaxis
+  1.6.2   3 Jan 2008 : changes for CDI library version 1.1.0 (compress)
+  1.6.3  26 Mar 2008 : call streamDefTimestep also if ntsteps = 0 (buf fix)
+  1.7.0  11 Apr 2008 : added option -z zip for deflate compression of netCDF4 variables
+  1.7.1   1 Nov 2009 : added option -z jpeg for JPEG compression of GRIB2 records
+  1.7.2  14 Nov 2012 : added optional compression level -z zip[_1-9]
+*/
+}
+
+static
+void usage(void)
+{
+  char *name;
+  int id;
+
+  fprintf(stderr, "usage : %s  [Option]  [ifile]  [ofile]\n", Progname);
+
+  fprintf(stderr, "\n");
+  fprintf(stderr, "  Options:\n");
+  fprintf(stderr, "    -d             Print debugging information\n");
+  fprintf(stderr, "    -f <format>    Format of the output file. (grb, grb2, nc, nc2, nc4, nc4c, src, ext or ieg)\n");
+  fprintf(stderr, "    -s             give short information if ofile is missing\n");
+  fprintf(stderr, "    -t <table>     Parameter table name/file\n");
+  fprintf(stderr, "                   Predefined tables: ");
+  for ( id = 0; id < tableInqNumber(); id++ )
+    if ( (name = tableInqNamePtr(id)) )
+      fprintf(stderr, " %s", name);
+  fprintf(stderr, "\n");
+
+  fprintf(stderr, "    -V             Print version number\n");
+  fprintf(stderr, "    -z szip        SZIP compression of GRIB1 records\n");
+  fprintf(stderr, "       jpeg        JPEG compression of GRIB2 records\n");
+  fprintf(stderr, "        zip[_1-9]  Deflate compression of netCDF4 variables\n");
+  fprintf(stderr, "\n");
+  fprintf(stderr, "  Report bugs to <http://code.zmaw.de/projects/cdi>\n");
+}
+
+
+static
+void printInfo(int gridtype, int vdate, int vtime, char *varname, double level,
+	       int datasize, int number, int nmiss, double missval, const double *data, int vardis)
+{
+  static int rec = 0;
+  int i, ivals = 0, imiss = 0;
+  double arrmean, arrmin, arrmax;
+  char vdatestr[32], vtimestr[32];
+
+  if ( ! rec )
+  {
+    if ( vardis )
+      fprintf(stdout,
+    "   Rec :       Date     Time   Level Gridsize    Miss :     Minimum        Mean     Maximum : Parameter name\n");
+/*   ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+ */
+    else
+      fprintf(stdout,
+    "   Rec :       Date     Time   Level Gridsize    Miss :     Minimum        Mean     Maximum : Parameter ID\n");
+/*   ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0----+ */
+  }
+
+  date2str(vdate, vdatestr, sizeof(vdatestr));
+  time2str(vtime, vtimestr, sizeof(vtimestr));
+
+  fprintf(stdout, "%6d :%s %s %7g ", ++rec, vdatestr, vtimestr, level);
+
+  fprintf(stdout, "%8d ", datasize);
+
+  fprintf(stdout, "%7d :", nmiss);
+
+  /*
+  if ( gridtype == GRID_SPECTRAL )
+    {
+      fprintf(stdout, "            %#12.5g\n", data[0]);
+    }
+  else
+  */
+  if ( number == CDI_REAL )
+    {
+      if ( nmiss > 0 )
+	{
+	  arrmean = 0;
+	  arrmin  =  1.e300;
+	  arrmax  = -1.e300;
+	  for ( i = 0; i < datasize; i++ )
+	    {
+	      if ( !DBL_IS_EQUAL(data[i], missval) )
+		{
+		  if ( data[i] < arrmin ) arrmin = data[i];
+		  if ( data[i] > arrmax ) arrmax = data[i];
+		  arrmean += data[i];
+		  ivals++;
+		}
+	    }
+	  imiss = datasize - ivals;
+	  datasize = ivals;
+	}
+      else
+	{
+	  arrmean = data[0];
+	  arrmin  = data[0];
+	  arrmax  = data[0];
+	  for ( i = 1; i < datasize; i++ )
+	    {
+	      if ( data[i] < arrmin ) arrmin = data[i];
+	      if ( data[i] > arrmax ) arrmax = data[i];
+	      arrmean += data[i];
+	    }
+	}
+
+      if ( datasize > 0 ) arrmean /= datasize;
+
+      fprintf(stdout, "%#12.5g%#12.5g%#12.5g", arrmin, arrmean, arrmax);
+    }
+  else
+    {
+      int nvals_r = 0, nvals_i = 0;
+      double arrsum_r, arrsum_i, arrmean_r = 0, arrmean_i = 0;
+      arrsum_r = 0;
+      arrsum_i = 0;
+
+      for ( i = 0; i < datasize; i++ )
+	{
+	  if ( !DBL_IS_EQUAL(data[i*2], missval) )
+	    {
+	      arrsum_r += data[i*2];
+	      nvals_r++;
+	    }
+	  if ( !DBL_IS_EQUAL(data[i*2+1], missval) )
+	    {
+	      arrsum_i += data[i*2+1];
+	      nvals_i++;
+	    }
+	}
+
+      imiss = datasize - nvals_r;
+
+      if ( nvals_r > 0 ) arrmean_r = arrsum_r / nvals_r;
+      if ( nvals_i > 0 ) arrmean_i = arrsum_i / nvals_i;
+      fprintf(stdout, "  -  (%#12.5g,%#12.5g)  -", arrmean_r, arrmean_i);
+    }
+
+  fprintf(stdout, " : %-11s\n", varname);
+
+  if ( imiss != nmiss && nmiss > 0 )
+    fprintf(stdout, "Found %d of %d missing values!\n", imiss, nmiss);
+}
+
+#define MAXCHARS 82
+
+static
+void printShortinfo(int streamID, int vlistID, int vardis)
+{
+  int varID;
+  int gridsize = 0;
+  int gridID, zaxisID, param;
+  int zaxistype, ltype;
+  int vdate, vtime;
+  int nrecs, nvars, nzaxis, ntsteps;
+  int levelID, levelsize;
+  int tsID, ntimeout;
+  int tsteptype, taxisID;
+  int nbyte, nbyte0;
+  int index;
+  char varname[CDI_MAX_NAME];
+  char longname[CDI_MAX_NAME];
+  char units[CDI_MAX_NAME];
+  double level;
+  char *modelptr, *instptr;
+  int datatype;
+  int year, month, day, hour, minute, second;
+  char pstr[4];
+  char paramstr[32];
+
+      printf("   File format: ");
+      printFiletype(streamID, vlistID);
+
+      if ( vardis )
+	fprintf(stdout,
+		"   Var : Institut Source   Ttype    Levels Num  Gridsize Num Dtype : Parameter name\n");
+      else
+	fprintf(stdout,
+		"   Var : Institut Source   Ttype    Levels Num  Gridsize Num Dtype : Parameter ID\n");
+
+      nvars = vlistNvars(vlistID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  param   = vlistInqVarParam(vlistID, varID);
+	  gridID  = vlistInqVarGrid(vlistID, varID);
+	  zaxisID = vlistInqVarZaxis(vlistID, varID);
+
+	  fprintf(stdout, "%6d : ", varID + 1);
+
+	  /* institute info */
+	  instptr = institutInqNamePtr(vlistInqVarInstitut(vlistID, varID));
+	  if ( instptr )
+	    fprintf(stdout, "%-8s ", instptr);
+	  else
+	    fprintf(stdout, "unknown  ");
+
+	  /* source info */
+	  modelptr = modelInqNamePtr(vlistInqVarModel(vlistID, varID));
+	  if ( modelptr )
+	    fprintf(stdout, "%-8s ", modelptr);
+	  else
+	    fprintf(stdout, "unknown  ");
+
+	  /* tsteptype */
+	  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+	  if      ( tsteptype == TSTEP_CONSTANT ) fprintf(stdout, "%-8s ", "constant");
+	  else if ( tsteptype == TSTEP_INSTANT  ) fprintf(stdout, "%-8s ", "instant");
+	  else if ( tsteptype == TSTEP_INSTANT2 ) fprintf(stdout, "%-8s ", "instant");
+	  else if ( tsteptype == TSTEP_INSTANT3 ) fprintf(stdout, "%-8s ", "instant");
+	  else if ( tsteptype == TSTEP_MIN      ) fprintf(stdout, "%-8s ", "min");
+	  else if ( tsteptype == TSTEP_MAX      ) fprintf(stdout, "%-8s ", "max");
+	  else if ( tsteptype == TSTEP_ACCUM    ) fprintf(stdout, "%-8s ", "accum");
+	  else                                    fprintf(stdout, "%-8s ", "unknown");
+
+	  /* layer info */
+	  levelsize = zaxisInqSize(zaxisID);
+	  fprintf(stdout, "%6d ", levelsize);
+	  fprintf(stdout, "%3d ", vlistZaxisIndex(vlistID, zaxisID) + 1);
+
+	  /* grid info */
+	  gridsize = gridInqSize(gridID);
+	  fprintf(stdout, "%9d ", gridsize);
+	  fprintf(stdout, "%3d ", vlistGridIndex(vlistID, gridID) + 1);
+
+	  /* datatype */
+	  datatype = vlistInqVarDatatype(vlistID, varID);
+	  if      ( datatype == DATATYPE_PACK   ) strcpy(pstr, "P0");
+	  else if ( datatype > 0 && datatype <= 32  ) sprintf(pstr, "P%d", datatype);
+	  else if ( datatype == DATATYPE_CPX32  ) strcpy(pstr, "C32");
+	  else if ( datatype == DATATYPE_CPX64  ) strcpy(pstr, "C64");
+	  else if ( datatype == DATATYPE_FLT32  ) strcpy(pstr, "F32");
+	  else if ( datatype == DATATYPE_FLT64  ) strcpy(pstr, "F64");
+	  else if ( datatype == DATATYPE_INT8   ) strcpy(pstr, "I8");
+	  else if ( datatype == DATATYPE_INT16  ) strcpy(pstr, "I16");
+	  else if ( datatype == DATATYPE_INT32  ) strcpy(pstr, "I32");
+	  else if ( datatype == DATATYPE_UINT8  ) strcpy(pstr, "U8");
+	  else if ( datatype == DATATYPE_UINT16 ) strcpy(pstr, "U16");
+	  else if ( datatype == DATATYPE_UINT32 ) strcpy(pstr, "U32");
+	  else                                    strcpy(pstr, "-1");
+
+	  fprintf(stdout, " %-3s", pstr);
+
+	  if ( vlistInqVarCompType(vlistID, varID) == COMPRESS_NONE )
+	    fprintf(stdout, "  ");
+	  else
+	    fprintf(stdout, "z ");
+
+	  /* parameter info */
+	  fprintf(stdout, ": ");
+
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+
+	  if ( vardis ) vlistInqVarName(vlistID, varID, varname);
+
+          if ( vardis )
+	    fprintf(stdout, "%-11s ", varname);
+	  else
+	    fprintf(stdout, "%-11s ", paramstr);
+
+	  fprintf(stdout, "\n");
+	}
+
+      fprintf(stdout, "   Grid coordinates :\n");
+      printGridInfo(vlistID);
+
+      nzaxis = vlistNzaxis(vlistID);
+      fprintf(stdout, "   Vertical coordinates :\n");
+      for ( index = 0; index < nzaxis; index++)
+	{
+	  zaxisID   = vlistZaxis(vlistID, index);
+	  zaxistype = zaxisInqType(zaxisID);
+	  ltype     = zaxisInqLtype(zaxisID);
+	  levelsize = zaxisInqSize(zaxisID);
+	  /* zaxisInqLongname(zaxisID, longname); */
+	  zaxisName(zaxistype, longname);
+	  longname[17] = 0;
+	  zaxisInqUnits(zaxisID, units);
+	  units[12] = 0;
+	  if ( zaxistype == ZAXIS_GENERIC && ltype != 0 )
+	    nbyte0    = fprintf(stdout, "  %4d : %-11s  (ltype=%3d) : ", vlistZaxisIndex(vlistID, zaxisID)+1, longname, ltype);
+	  else
+	    nbyte0    = fprintf(stdout, "  %4d : %-17s  %5s : ", vlistZaxisIndex(vlistID, zaxisID)+1, longname, units);
+	  nbyte = nbyte0;
+	  for ( levelID = 0; levelID < levelsize; levelID++ )
+	    {
+	      if ( nbyte > MAXCHARS )
+		{
+		  fprintf(stdout, "\n");
+		  fprintf(stdout, "%*s", nbyte0, "");
+		  nbyte = nbyte0;
+		}
+	      level = zaxisInqLevel(zaxisID, levelID);
+	      nbyte += fprintf(stdout, "%.9g ", level);
+	    }
+	  fprintf(stdout, "\n");
+	  if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	    {
+	      double level1, level2;
+	      nbyte = nbyte0;
+	      nbyte0 = fprintf(stdout, "%33s : ", "bounds");
+	      for ( levelID = 0; levelID < levelsize; levelID++ )
+		{
+		  if ( nbyte > MAXCHARS )
+		    {
+		      fprintf(stdout, "\n");
+		      fprintf(stdout, "%*s", nbyte0, "");
+		      nbyte = nbyte0;
+		    }
+		  level1 = zaxisInqLbound(zaxisID, levelID);
+		  level2 = zaxisInqUbound(zaxisID, levelID);
+		  nbyte += fprintf(stdout, "%.9g-%.9g ", level1, level2);
+		}
+	      fprintf(stdout, "\n");
+	    }
+	}
+
+      taxisID = vlistInqTaxis(vlistID);
+      ntsteps = vlistNtsteps(vlistID);
+
+      if ( ntsteps != 0 )
+	{
+	  if ( ntsteps == CDI_UNDEFID )
+	    fprintf(stdout, "   Time coordinate :  unlimited steps\n");
+	  else
+	    fprintf(stdout, "   Time coordinate :  %d step%s\n", ntsteps, ntsteps == 1 ? "" : "s");
+
+	  if ( taxisID != CDI_UNDEFID )
+	    {
+	      int calendar, tunits;
+
+	      if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
+		{
+		  vdate = taxisInqRdate(taxisID);
+		  vtime = taxisInqRtime(taxisID);
+
+		  cdiDecodeDate(vdate, &year, &month, &day);
+		  cdiDecodeTime(vtime, &hour, &minute, &second);
+
+		  fprintf(stdout, "     RefTime = %4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d",
+			  year, month, day, hour, minute, second);
+
+		  tunits = taxisInqTunit(taxisID);
+		  if ( tunits != CDI_UNDEFID )
+		    {
+		      if ( tunits == TUNIT_YEAR )
+			fprintf(stdout, "  Units = years");
+		      else if ( tunits == TUNIT_MONTH )
+			fprintf(stdout, "  Units = months");
+		      else if ( tunits == TUNIT_DAY )
+			fprintf(stdout, "  Units = days");
+		      else if ( tunits == TUNIT_12HOURS )
+			fprintf(stdout, "  Units = 12hours");
+		      else if ( tunits == TUNIT_6HOURS )
+			fprintf(stdout, "  Units = 6hours");
+		      else if ( tunits == TUNIT_3HOURS )
+			fprintf(stdout, "  Units = 3hours");
+		      else if ( tunits == TUNIT_HOUR )
+			fprintf(stdout, "  Units = hours");
+		      else if ( tunits == TUNIT_MINUTE )
+			fprintf(stdout, "  Units = minutes");
+		      else if ( tunits == TUNIT_SECOND )
+			fprintf(stdout, "  Units = seconds");
+		      else
+			fprintf(stdout, "  Units = unknown");
+		    }
+
+		  calendar = taxisInqCalendar(taxisID);
+		  if ( calendar != CDI_UNDEFID )
+		    {
+		      if ( calendar == CALENDAR_STANDARD )
+			fprintf(stdout, "  Calendar = STANDARD");
+		      else if ( calendar == CALENDAR_PROLEPTIC )
+			fprintf(stdout, "  Calendar = PROLEPTIC");
+		      else if ( calendar == CALENDAR_360DAYS )
+			fprintf(stdout, "  Calendar = 360DAYS");
+		      else if ( calendar == CALENDAR_365DAYS )
+			fprintf(stdout, "  Calendar = 365DAYS");
+		      else if ( calendar == CALENDAR_366DAYS )
+			fprintf(stdout, "  Calendar = 366DAYS");
+		      else
+			fprintf(stdout, "  Calendar = unknown");
+		    }
+
+		  if ( taxisHasBounds(taxisID) )
+		    fprintf(stdout, "  Bounds = true");
+
+		  fprintf(stdout, "\n");
+		}
+	    }
+
+	  fprintf(stdout, "  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss\n");
+
+	  ntimeout = 0;
+	  tsID = 0;
+	  while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	    {
+	      if ( ntimeout == 4 )
+		{
+		  ntimeout = 0;
+		  fprintf(stdout, "\n");
+		}
+
+	      vdate = taxisInqVdate(taxisID);
+	      vtime = taxisInqVtime(taxisID);
+
+	      cdiDecodeDate(vdate, &year, &month, &day);
+	      cdiDecodeTime(vtime, &hour, &minute, &second);
+
+	      fprintf(stdout, " %5.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d",
+		      year, month, day, hour, minute, second);
+	      ntimeout++;
+	      tsID++;
+	    }
+	  fprintf(stdout, "\n");
+	}
+}
+
+
+#undef  IsBigendian
+#define IsBigendian()  ( u_byteorder.c[sizeof(long) - 1] )
+
+
+static
+void setDefaultDataType(char *datatypestr)
+{
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+  int nbits = -1;
+  enum {D_UINT, D_INT, D_FLT, D_CPX};
+  int dtype = -1;
+
+  if      ( *datatypestr == 'i' || *datatypestr == 'I' )
+    {
+      dtype = D_INT;
+      datatypestr++;
+    }
+  else if ( *datatypestr == 'u' || *datatypestr == 'U' )
+    {
+      dtype = D_UINT;
+      datatypestr++;
+    }
+  else if ( *datatypestr == 'f' || *datatypestr == 'F' )
+    {
+      dtype = D_FLT;
+      datatypestr++;
+    }
+  else if ( *datatypestr == 'c' || *datatypestr == 'C' )
+    {
+      dtype = D_CPX;
+      datatypestr++;
+    }
+
+  if ( isdigit((int) *datatypestr) )
+    {
+      nbits = atoi(datatypestr);
+      if ( nbits < 10 )
+	datatypestr += 1;
+      else
+	datatypestr += 2;
+
+      if ( dtype == -1 )
+	{
+	  if      ( nbits > 0 && nbits < 32 ) DefaultDataType = nbits;
+	  else if ( nbits == 32 )
+	    {
+	      if ( DefaultFileType == FILETYPE_GRB )
+		DefaultDataType = DATATYPE_PACK32;
+	      else
+		DefaultDataType = DATATYPE_FLT32;
+	    }
+	  else if ( nbits == 64 ) DefaultDataType = DATATYPE_FLT64;
+	  else
+	    {
+	      fprintf(stderr, "Unsupported number of bits %d!\n", nbits);
+	      fprintf(stderr, "Use I8/I16/I32/F32/F64 for nc/nc2/nc4/nc4c; F32/F64 for grb2/srv/ext/ieg; P1 - P24 for grb/grb2.\n");
+	      exit(EXIT_FAILURE);
+	    }
+	}
+      else
+	{
+	  if ( dtype == D_INT )
+	    {
+	      if      ( nbits ==  8 ) DefaultDataType = DATATYPE_INT8;
+	      else if ( nbits == 16 ) DefaultDataType = DATATYPE_INT16;
+	      else if ( nbits == 32 ) DefaultDataType = DATATYPE_INT32;
+	      else
+		{
+		  fprintf(stderr, "Unsupported number of bits = %d for datatype INT!\n", nbits);
+		  exit(EXIT_FAILURE);
+		}
+	    }
+	  /*
+	  else if ( dtype == D_UINT )
+	    {
+	      if      ( nbits ==  8 ) DefaultDataType = DATATYPE_UINT8;
+	      else
+		{
+		  fprintf(stderr, "Unsupported number of bits = %d for datatype UINT!\n", nbits);
+		  exit(EXIT_FAILURE);
+		}
+	    }
+	  */
+	  else if ( dtype == D_FLT )
+	    {
+	      if      ( nbits == 32 ) DefaultDataType = DATATYPE_FLT32;
+	      else if ( nbits == 64 ) DefaultDataType = DATATYPE_FLT64;
+	      else
+		{
+		  fprintf(stderr, "Unsupported number of bits = %d for datatype FLT!\n", nbits);
+		  exit(EXIT_FAILURE);
+		}
+	    }
+	  else if ( dtype == D_CPX )
+	    {
+	      if      ( nbits == 32 ) DefaultDataType = DATATYPE_CPX32;
+	      else if ( nbits == 64 ) DefaultDataType = DATATYPE_CPX64;
+	      else
+		{
+		  fprintf(stderr, "Unsupported number of bits = %d for datatype CPX!\n", nbits);
+		  exit(EXIT_FAILURE);
+		}
+	    }
+	}
+    }
+
+  if ( *datatypestr != 0 )
+    {
+      if ( *datatypestr == 'l' || *datatypestr == 'L' )
+	{
+	  if ( IsBigendian() ) DefaultByteorder = CDI_LITTLEENDIAN;
+	  datatypestr++;
+	}
+      else if ( *datatypestr == 'b' || *datatypestr == 'B' )
+	{
+	  if ( ! IsBigendian() ) DefaultByteorder = CDI_BIGENDIAN;
+	  datatypestr++;
+	}
+      else
+	{
+	  fprintf(stderr, "Unsupported character in number of bytes: >%s< !\n", datatypestr);
+	  exit(EXIT_FAILURE);
+	}
+    }
+}
+
+static
+void setDefaultFileType(char *filetypestr)
+{
+  if ( filetypestr )
+    {
+      char *ftstr = filetypestr;
+
+      if      ( memcmp(filetypestr, "grb2", 4)  == 0 ) { ftstr += 4; DefaultFileType = FILETYPE_GRB2;}
+      else if ( memcmp(filetypestr, "grb1", 4)  == 0 ) { ftstr += 4; DefaultFileType = FILETYPE_GRB; }
+      else if ( memcmp(filetypestr, "grb",  3)  == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_GRB; }
+      else if ( memcmp(filetypestr, "nc2",  3)  == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC2; }
+      else if ( memcmp(filetypestr, "nc4c", 4)  == 0 ) { ftstr += 4; DefaultFileType = FILETYPE_NC4C;}
+      else if ( memcmp(filetypestr, "nc4",  3)  == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_NC4; }
+      else if ( memcmp(filetypestr, "nc",   2)  == 0 ) { ftstr += 2; DefaultFileType = FILETYPE_NC;  }
+      else if ( memcmp(filetypestr, "srv",  3)  == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_SRV; }
+      else if ( memcmp(filetypestr, "ext",  3)  == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_EXT; }
+      else if ( memcmp(filetypestr, "ieg",  3)  == 0 ) { ftstr += 3; DefaultFileType = FILETYPE_IEG; }
+      else
+	{
+	  fprintf(stderr, "Unsupported filetype %s!\n", filetypestr);
+	  fprintf(stderr, "Available filetypes: grb, grb2, nc, nc2, nc4, nc4c, srv, ext and ieg\n");
+	  exit(EXIT_FAILURE);
+	}
+
+      if ( DefaultFileType != CDI_UNDEFID && *ftstr != 0 )
+	{
+	  if ( *ftstr == '_' )
+	    {
+	      ftstr++;
+
+	      setDefaultDataType(ftstr);
+	    }
+	  else
+	    {
+	      fprintf(stderr, "Unexpected character >%c< in file type >%s<!\n", *ftstr, filetypestr);
+	      fprintf(stderr, "Use format[_nbits] with:\n");
+	      fprintf(stderr, "    format = grb, grb2, nc, nc2, nc4, nc4c, srv, ext or ieg\n");
+	      fprintf(stderr, "    nbits  = 32/64 for grb2/nc/nc2/nc4/nc4c/srv/ext/ieg; 1 - 24 for grb/grb2\n");
+	      exit(EXIT_FAILURE);
+	    }
+	}
+    }
+}
+
+static
+int handle_error(int cdiErrno, const char *fmt, ...)
+{
+  va_list args;
+
+  va_start(args, fmt);
+
+  printf("\n");
+  vfprintf(stderr, fmt, args);
+   fprintf(stderr, "\n");
+
+  va_end(args);
+
+  fprintf(stderr, "%s\n", cdiStringError(cdiErrno));
+
+  return (cdiErrno);
+}
+
+static
+void defineCompress(const char *arg)
+{
+  size_t len = strlen(arg);
+
+  if      ( strncmp(arg, "szip", len) == 0 )
+    {
+      comptype = COMPRESS_SZIP;
+    }
+  else if ( strncmp(arg, "jpeg", len) == 0 )
+    {
+      comptype = COMPRESS_JPEG;
+    }
+  else if ( strncmp(arg, "gzip", len) == 0 )
+    {
+      comptype = COMPRESS_GZIP;
+      complevel = 6;
+    }
+  else if ( strncmp(arg, "zip", 3) == 0 )
+    {
+      comptype = COMPRESS_ZIP;
+      if ( len == 5 && arg[3] == '_' && isdigit(arg[4]) )
+	complevel = atoi(&arg[4]);
+      else
+        complevel = 1;
+    }
+  else
+    fprintf(stderr, "%s compression unsupported!\n", arg);
+}
+
+
+
+int main(int argc, char *argv[])
+{
+  int c;
+  char *fname1 = NULL;
+  char *fname2 = NULL;
+  char *rTable = NULL;
+  char *wTable = NULL;
+  int Move = 0;
+  int Record = 0;
+  int Debug = 0;
+  int Quiet  = 0;
+  int Vardis = 0;
+  int Version = 0;
+  int Longinfo = 0;
+  int Shortinfo = 0;
+  int varID;
+  int itableID = CDI_UNDEFID, otableID = CDI_UNDEFID;
+  int Info = 1;
+  char varname[CDI_MAX_NAME];
+  char paramstr[32];
+
+  Progname = strrchr(argv[0], '/');
+  if (Progname == 0) Progname = argv[0];
+  else               Progname++;
+
+  while ( (c = getopt(argc, argv, "b:f:t:w:z:cdhlMmqRrsvVZ")) != EOF )
+    {
+      switch (c)
+	{
+	case 'b':
+	  setDefaultDataType(optarg);
+	  break;
+	case 'd':
+	  Debug = 1;
+	  break;
+	case 'f':
+	  setDefaultFileType(optarg);
+	  break;
+	case 'h':
+	  usage();
+	  exit (0);
+	case 'l':
+	  Longinfo = 1;
+	  break;
+	case 'M':
+	  cdiDefGlobal("HAVE_MISSVAL", 1);
+	  break;
+	case 'm':
+	  Move = 1;
+	  break;
+	case 'q':
+	  Quiet = 1;
+	  break;
+	case 'R':
+	  cdiDefGlobal("REGULARGRID", 1);
+	  break;
+	case 'r':
+	  Record = 1;
+	  break;
+	case 's':
+	  Shortinfo = 1;
+	  break;
+	case 't':
+	  rTable = optarg;
+	  break;
+	case 'v':
+	  Vardis = 1;
+	  break;
+	case 'V':
+	  Version = 1;
+	  break;
+	case 'w':
+	  wTable = optarg;
+	  break;
+	case 'z':
+	  defineCompress(optarg);
+	  break;
+	}
+    }
+
+  if ( optind < argc ) fname1 = argv[optind++];
+  if ( optind < argc ) fname2 = argv[optind++];
+  if ( optind < argc ) fprintf(stderr, "optind: %d argc: %d\n", optind, argc);
+
+  if ( Debug || Version ) version();
+
+  if ( Debug ) cdiDebug(Debug);
+
+  if ( rTable )
+    {
+      itableID = tableInq(-1, 0, rTable);
+      if ( itableID != CDI_UNDEFID ) cdiDefTableID(itableID);
+      otableID = itableID;
+    }
+
+  if ( fname1 == NULL && ! (Debug || Version) )
+    {
+      usage();
+      exit (0);
+    }
+
+  if ( fname1 )
+    {
+      double *data = NULL;
+      double missval;
+      double level;
+      int nmiss;
+      int number;
+      int datasize = 0;
+      int streamID1 = CDI_UNDEFID;
+      int streamID2 = CDI_UNDEFID;
+      int filetype;
+      int gridID, zaxisID;
+      int param;
+      int vdate, vtime;
+      int nrecs, nvars;
+      int levelID, levelsize;
+      int nts = 0;
+      int gridsize = 0;
+      int recID;
+      int tsID;
+      int ntsteps = 0;
+      int taxisID1, taxisID2 = CDI_UNDEFID;
+      int gridtype;
+      int vlistID1, vlistID2 = CDI_UNDEFID;
+
+      streamID1 = streamOpenRead(fname1);
+      if ( streamID1 < 0 )
+	return (handle_error(streamID1, "Open failed on %s", fname1));
+
+      vlistID1 = streamInqVlist(streamID1);
+
+      if ( Longinfo )
+	{
+	  int ngrids, nzaxis;
+	  vlistPrint(vlistID1);
+	  ngrids = vlistNgrids(vlistID1);
+	  nzaxis = vlistNzaxis(vlistID1);
+	  for ( gridID = 0; gridID < ngrids; gridID++ ) gridPrint(gridID, 1);
+	  for ( zaxisID = 0; zaxisID < nzaxis; zaxisID++ ) zaxisPrint(zaxisID);
+	}
+
+      nvars   = vlistNvars(vlistID1);
+      taxisID1 = vlistInqTaxis(vlistID1);
+      ntsteps = vlistNtsteps(vlistID1);
+
+      if ( Debug ) fprintf(stderr, "nvars   = %d\n", nvars);
+      if ( Debug ) fprintf(stderr, "ntsteps = %d\n", ntsteps);
+
+      if ( fname2 )
+        {
+          vlistID2 = vlistDuplicate(vlistID1);
+          taxisID2 = taxisDuplicate(taxisID1);
+          vlistDefTaxis(vlistID2, taxisID2);
+        }
+
+      for ( varID = 0; varID < nvars; varID++)
+	{
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  if ( gridsize > datasize ) datasize = gridsize;
+	  if ( fname2 )
+	    {
+	      if ( DefaultDataType != CDI_UNDEFID )
+		vlistDefVarDatatype(vlistID2, varID, DefaultDataType);
+	    }
+	}
+
+      if ( fname2 )
+	{
+	  Info = 0;
+	  filetype = streamInqFiletype(streamID1);
+
+	  if ( DefaultFileType != CDI_UNDEFID )
+	    filetype = DefaultFileType;
+
+	  streamID2 = streamOpenWrite(fname2, filetype);
+	  if ( streamID2 < 0 )
+	    return (handle_error(streamID2, "Open failed on %s", fname2));
+
+	  if ( DefaultByteorder != CDI_UNDEFID )
+	    streamDefByteorder(streamID2, DefaultByteorder);
+
+	  if ( comptype != COMPRESS_NONE )
+	    {
+	      streamDefCompType(streamID2, comptype);
+	      streamDefCompLevel(streamID2, complevel);
+	    }
+
+	  streamDefVlist(streamID2, vlistID2);
+
+	  if ( otableID == CDI_UNDEFID ) otableID = itableID;
+	}
+
+      if ( vlistNumber(vlistID1) != CDI_REAL ) datasize *= 2;
+      data = (double *) malloc(datasize*sizeof(double));
+
+      /*
+	nts = cdiInqTimeSize(streamID1);
+      */
+      if ( Debug )
+	printf("nts = %d\n", nts);
+
+      if ( Debug )
+	printf("streamID1 = %d, streamID2 = %d\n", streamID1, streamID2);
+
+      if ( Shortinfo )
+	{
+	  Info = 0;
+	  printShortinfo(streamID1, vlistID1, Vardis);
+	}
+
+      tsID = 0;
+      if ( Info || fname2 )
+      while ( (nrecs = streamInqTimestep(streamID1, tsID)) > 0 )
+	{
+	  if ( fname2 /* && ntsteps != 0*/ )
+            {
+              taxisCopyTimestep(taxisID2, taxisID1);
+              streamDefTimestep(streamID2, tsID);
+            }
+	  vdate = taxisInqVdate(taxisID1);
+	  vtime = taxisInqVtime(taxisID1);
+
+	  if ( Debug )
+	    fprintf(stdout, "tsID = %d nrecs = %d date = %d time = %d\n", tsID, nrecs, vdate, vtime);
+
+	  if ( Record )
+	    {
+	      for ( recID = 0; recID < nrecs; recID++ )
+		{
+		  streamInqRecord(streamID1, &varID, &levelID);
+		  streamReadRecord(streamID1, data, &nmiss);
+
+		  number   = vlistInqVarNumber(vlistID1, varID);
+		  gridID   = vlistInqVarGrid(vlistID1, varID);
+		  zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+		  param    = vlistInqVarParam(vlistID1, varID);
+
+		  cdiParamToString(param, paramstr, sizeof(paramstr));
+
+		  if ( Vardis ) vlistInqVarName(vlistID1, varID, varname);
+		  else          strcpy(varname, paramstr);
+		  /*
+		  printf("varID=%d, param=%d, gridID=%d, zaxisID=%d levelID=%d\n",
+			 varID, param, gridID, zaxisID, levelID);
+		  */
+		  gridtype = gridInqType(gridID);
+		  gridsize = gridInqSize(gridID);
+		  level    = zaxisInqLevel(zaxisID, levelID);
+		  missval  = vlistInqVarMissval(vlistID1, varID);
+
+		  if ( Info )
+		    printInfo(gridtype, vdate, vtime, varname, level, gridsize, number, nmiss, missval, data, Vardis);
+
+		  if ( fname2 )
+		    {
+		      streamDefRecord(streamID2, varID, levelID);
+		      if ( Move )
+			streamCopyRecord(streamID2, streamID1);
+		      else
+			streamWriteRecord(streamID2, data, nmiss);
+		    }
+	      	}
+	    }
+	  else
+	    {
+	      for ( varID = 0; varID < nvars; varID++ )
+		{
+		  if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT && tsID > 0 ) continue;
+
+		  number   = vlistInqVarNumber(vlistID1, varID);
+		  gridID   = vlistInqVarGrid(vlistID1, varID);
+		  zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+		  param    = vlistInqVarParam(vlistID1, varID);
+
+		  cdiParamToString(param, paramstr, sizeof(paramstr));
+
+		  if ( Vardis ) vlistInqVarName(vlistID1, varID, varname);
+		  else          strcpy(varname, paramstr);
+
+		  if ( Debug )
+		    fprintf(stdout, "varID = %d param = %d gridID = %d zaxisID = %d\n",
+			    varID, param, gridID, zaxisID);
+
+		  gridtype = gridInqType(gridID);
+		  gridsize = gridInqSize(gridID);
+		  missval  = vlistInqVarMissval(vlistID1, varID);
+
+		  levelsize = zaxisInqSize(zaxisID);
+		  for ( levelID = 0; levelID < levelsize; levelID++ )
+		    {
+		      level = zaxisInqLevel(zaxisID, levelID);
+		      streamReadVarSlice(streamID1, varID, levelID, data, &nmiss);
+
+		      if ( Info )
+			printInfo(gridtype, vdate, vtime, varname, level, gridsize, number, nmiss, missval, data, Vardis);
+
+		      if ( fname2 )
+			streamWriteVarSlice(streamID2, varID, levelID, data, nmiss);
+		    }
+		}
+	    }
+	  tsID++;
+        }
+
+      free(data);
+
+      /* fprintf(stderr, "%ld\n", (long) streamNvals(streamID1)); */
+
+      if ( fname2 )
+	{
+	  streamClose(streamID2);
+	  vlistDestroy(vlistID2);
+	  taxisDestroy(taxisID2);
+	}
+      streamClose(streamID1);
+    }
+
+  if ( wTable )
+    tableWrite(wTable, itableID);
+
+  return (0);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/app/createtable.c b/libcdi/app/createtable.c
new file mode 100644
index 0000000..f7e2090
--- /dev/null
+++ b/libcdi/app/createtable.c
@@ -0,0 +1,114 @@
+#include <stdio.h>
+#include <errno.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "cdi.h"
+
+char *Progname;
+
+void version(void)
+{
+  fprintf(stderr, "createtable version 1.00 (11 Nov 2001)\n");
+  fprintf(stderr, "\n");
+}
+
+void usage(void)
+{
+  fprintf(stderr, "usage :  createtable  [-options]  ifile  ofile\n");
+  fprintf(stderr, "with:\n");
+
+  fprintf(stderr, "   -debug        debugging mode\n");
+  fprintf(stderr, "   -version      display version number\n");
+}
+
+int main(int argc, char *argv[])
+{
+  int c, len;
+  char  *cstring;
+  char *ifile = NULL, *ofile = NULL;
+  int debug = 0;
+  int tableID;
+
+
+  Progname = argv[0];
+
+  while ( --argc && (*++argv)[0] == '-' )
+    {
+      c = *++argv[0];
+      cstring = argv[0];
+      len = strlen(cstring);
+      switch (c)
+	{
+        case 'd':
+	  if ( !strncmp(cstring, "debug", len) )
+	    {
+	      debug = 1;
+	      break;
+	    }
+        case 'h':
+	  if ( !strncmp(cstring, "help", len) )
+	    { 
+	      usage( );
+	      return( 0 );
+	      break;
+            }
+        case 'v':
+	  if ( !strncmp(cstring, "version", len) )
+	    {
+	      version();
+	      return (0);
+	      break;
+            }
+        default:
+	  usage();
+	  fprintf(stderr, "illegal option %s\n", cstring);
+	  return (-1);
+	  break;
+        }
+    }
+
+  if ( argc )
+    {
+      ifile = argv[0];
+      argc--;
+    }
+  if ( argc )
+    {
+      ofile = (++argv)[0];
+      argc--;
+    }
+
+  if ( ifile == NULL || ofile == NULL )
+    {
+      usage();
+      fprintf(stderr, "missing filenames\n");
+      return (-1);
+    }
+
+  if ( debug )
+    {
+      fprintf(stderr, "\n");
+      if ( ifile )
+	fprintf(stderr, "  < %s  \n", ifile);
+      if ( ofile )
+	fprintf(stderr, "  > %s\n\n", ofile);
+    }
+  /*
+  if ( debug ) cdiDebug(debug);
+  */
+  tableID = tableRead(ifile);
+  if ( tableID != CDI_UNDEFID )
+    tableWriteC(ofile, tableID);
+
+  return (0);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/app/printinfo.h b/libcdi/app/printinfo.h
new file mode 100644
index 0000000..ed53588
--- /dev/null
+++ b/libcdi/app/printinfo.h
@@ -0,0 +1,392 @@
+#define DATE_FORMAT "%5.4d-%2.2d-%2.2d"
+#define TIME_FORMAT "%2.2d:%2.2d:%2.2d"
+
+void date2str(int date, char *datestr, int maxlen)
+{
+  int year, month, day;
+  int len;
+
+  cdiDecodeDate(date, &year, &month, &day);
+
+  len = sprintf(datestr, DATE_FORMAT, year, month, day);
+
+  if ( len > ( maxlen-1) )
+    fprintf(stderr, "Internal problem (%s): sizeof input string is too small!\n", __func__);
+}
+
+
+void time2str(int time, char *timestr, int maxlen)
+{
+  int hour, minute, second;
+  int len;
+
+  cdiDecodeTime(time, &hour, &minute, &second);
+
+  len = sprintf(timestr, TIME_FORMAT, hour, minute, second);
+
+  if ( len > ( maxlen-1) )
+    fprintf(stderr, "Internal problem (%s): sizeof input string is too small!\n", __func__);
+}
+
+
+void printFiletype(int streamID, int vlistID)
+{
+  int filetype;
+
+  filetype = streamInqFiletype(streamID);
+
+  switch ( filetype )
+    {
+    case FILETYPE_GRB:
+      printf("GRIB");
+      break;
+    case FILETYPE_GRB2:
+      printf("GRIB2");
+      break;
+    case FILETYPE_NC:
+      printf("netCDF");
+      break;
+    case FILETYPE_NC2:
+      printf("netCDF2");
+      break;
+    case FILETYPE_NC4:
+      printf("netCDF4");
+      break;
+    case FILETYPE_NC4C:
+      printf("netCDF4 classic");
+      break;
+    case FILETYPE_SRV:
+      printf("SERVICE");
+      break;
+    case FILETYPE_EXT:
+      printf("EXTRA");
+      break;
+    case FILETYPE_IEG:
+      printf("IEG");
+      break;
+    default:
+      printf("  File format: unsupported filetype %d" , filetype);
+    }
+
+  if ( filetype == FILETYPE_SRV || filetype == FILETYPE_EXT || filetype == FILETYPE_IEG )
+    {
+      switch ( streamInqByteorder(streamID) )
+	{
+	case CDI_BIGENDIAN:
+	  printf("  BIGENDIAN"); break;
+	case CDI_LITTLEENDIAN:
+	  printf("  LITTLEENDIAN"); break;
+	default:
+	  printf("  byteorder: %d undefined", streamInqByteorder(streamID)); break;
+	}
+    }
+
+  if ( filetype == FILETYPE_GRB || filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C )
+    {
+      int nvars, varID;
+      int comptype;
+
+      nvars = vlistNvars(vlistID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  comptype = vlistInqVarCompType(vlistID, varID);
+	  if ( comptype )
+	    {
+	      if ( comptype == COMPRESS_SZIP )
+		printf(" SZIP");
+	      else if ( comptype == COMPRESS_ZIP )
+		printf(" ZIP");
+
+	      break;
+	    }
+	}
+    }
+
+  if ( filetype == FILETYPE_GRB2 )
+    {
+      int nvars, varID;
+      int comptype;
+
+      nvars = vlistNvars(vlistID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  comptype = vlistInqVarCompType(vlistID, varID);
+	  if ( comptype )
+	    {
+	      if ( comptype == COMPRESS_JPEG )
+		printf(" JPEG");
+
+	      break;
+	    }
+	}
+    }
+
+  printf("\n");
+}
+
+static
+void printGridInfo(int vlistID)
+{
+  int ngrids, index;
+  int gridID, gridtype, trunc, gridsize, xsize, ysize;
+  int nbyte0;
+  char xname[CDI_MAX_NAME], yname[CDI_MAX_NAME], xunits[CDI_MAX_NAME], yunits[CDI_MAX_NAME];
+
+  ngrids = vlistNgrids(vlistID);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID   = vlistGrid(vlistID, index);
+      gridtype = gridInqType(gridID);
+      trunc    = gridInqTrunc(gridID);
+      gridsize = gridInqSize(gridID);
+      xsize    = gridInqXsize(gridID);
+      ysize    = gridInqYsize(gridID);
+      gridInqXname(gridID, xname);
+      gridInqYname(gridID, yname);
+      gridInqXunits(gridID, xunits);
+      gridInqYunits(gridID, yunits);
+
+      nbyte0   = fprintf(stdout, "  %4d : %-12s > ", index+1, gridNamePtr(gridtype));
+
+      if ( gridtype == GRID_LONLAT   ||
+	   gridtype == GRID_LCC2 ||
+	   gridtype == GRID_LAEA ||
+	   gridtype == GRID_SINUSOIDAL ||
+	   gridtype == GRID_GAUSSIAN ||
+	   gridtype == GRID_GAUSSIAN_REDUCED )
+	{
+	  double xfirst = 0.0, xlast = 0.0;
+	  double yfirst = 0.0, ylast = 0.0;
+	  double xinc = 0.0, yinc = 0.0;
+
+	  yfirst = gridInqYval(gridID, 0);
+	  ylast  = gridInqYval(gridID, ysize-1);
+	  yinc   = gridInqYinc(gridID);
+
+	  if ( gridtype == GRID_GAUSSIAN_REDUCED )
+	    fprintf(stdout, "size : dim = %d  nlat = %d", gridsize, ysize);
+	  else
+	    fprintf(stdout, "size      : dim = %d  nlon = %d  nlat = %d", gridsize, xsize, ysize);
+	  
+	  if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
+	    fprintf(stdout, "  np = %d", gridInqNP(gridID));
+
+	  fprintf(stdout, "\n");
+
+	  if ( xsize > 0 )
+	    {
+	      if ( gridtype == GRID_GAUSSIAN_REDUCED )
+		{
+		  fprintf(stdout, "size : dim = %d  nlat = %d\n", gridsize, ysize);
+		  fprintf(stdout, "%*s", nbyte0, "");
+		  fprintf(stdout, "longitude : reduced\n");
+		}
+	      else
+		{
+		  xfirst = gridInqXval(gridID, 0);
+		  xlast  = gridInqXval(gridID, xsize-1);
+		  xinc   = gridInqXinc(gridID);
+		  fprintf(stdout, "%*s", nbyte0, "");
+		  fprintf(stdout, "%-9s : first = %.9g", xname, xfirst);
+		  if ( xsize > 1 ) fprintf(stdout, "  last = %.9g", xlast);
+		  if ( IS_NOT_EQUAL(xinc, 0) )
+		    fprintf(stdout, "  inc = %.9g", xinc);
+		  fprintf(stdout, "  %s", xunits);
+		  if ( gridIsCircular(gridID) )
+		    fprintf(stdout, "  circular");
+		  fprintf(stdout, "\n");
+		}
+	    }
+
+	  if ( ysize > 0 )
+	    {
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "%-9s : first = %.9g", yname, yfirst);
+	      if ( ysize > 1 ) fprintf(stdout, "  last = %.9g", ylast);
+	      if ( IS_NOT_EQUAL(yinc, 0) && 
+		   (gridtype == GRID_LONLAT || gridtype == GRID_SINUSOIDAL || 
+		    gridtype == GRID_LCC2 || gridtype == GRID_LAEA) )
+		fprintf(stdout, "  inc = %.9g", yinc);
+	      fprintf(stdout, "  %s", yunits);
+	      fprintf(stdout, "\n");
+	    }
+
+	  if ( gridIsRotated(gridID) )
+	    {
+	      double lonpole, latpole, angle;
+	      lonpole = gridInqXpole(gridID);
+	      latpole = gridInqYpole(gridID);
+	      angle   = gridInqAngle(gridID);
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "northpole : lon = %.9g  lat = %.9g", lonpole, latpole);
+	      if ( angle > 0 ) fprintf(stdout, "  angle = %.9g", angle);
+	      fprintf(stdout, "\n");
+	    }
+
+	  if ( gridInqXbounds(gridID, NULL) || gridInqYbounds(gridID, NULL) )
+	    {
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "available :");
+	      if ( gridInqXbounds(gridID, NULL) ) fprintf(stdout, " xbounds");
+	      if ( gridInqYbounds(gridID, NULL) ) fprintf(stdout, " ybounds");
+	      if ( gridInqMask(gridID, NULL) )    fprintf(stdout, " mask");
+	      fprintf(stdout, "\n");
+	    }
+
+	  if ( gridtype == GRID_LAEA )
+	    {
+	      double a, lon_0, lat_0;
+	      gridInqLaea(gridID, &a, &lon_0, &lat_0);
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "projpar   : a = %g  lon_0 = %g  lat_0 = %g\n", a, lon_0, lat_0);
+	    }
+
+	  if ( gridtype == GRID_LCC2 )
+	    {
+	      double a, lon_0, lat_0, lat_1, lat_2;
+	      gridInqLcc2(gridID, &a, &lon_0, &lat_0, &lat_1, &lat_2);
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "projpar   : a = %7.0f  lon_0 = %g  lat_0 = %g  lat_1 = %g  lat_2 = %g\n",
+		      a, lon_0, lat_0, lat_1, lat_2);
+	    }
+	}
+      else if ( gridtype == GRID_SPECTRAL )
+	{
+	  fprintf(stdout, "size      : dim = %d  nsp = %d  truncation = %d\n", gridsize, gridsize/2, trunc);
+	  fprintf(stdout, "%*s", nbyte0, "");
+	  fprintf(stdout, "            complexPacking = %d\n", gridInqComplexPacking(gridID));
+	}
+      else if ( gridtype == GRID_FOURIER )
+	{
+	  fprintf(stdout, "size      : dim = %d  nfc = %d  truncation = %d\n", gridsize, gridsize/2, trunc);
+	}
+      else if ( gridtype == GRID_GME )
+	{
+	  int ni, nd;
+	  ni = gridInqGMEni(gridID);
+	  nd = gridInqGMEnd(gridID);
+	  fprintf(stdout, "size      : dim = %d  nd = %d  ni = %d\n", gridsize, nd, ni);
+	}
+      else if ( gridtype == GRID_REFERENCE )
+	{
+	  int number, position;
+	  number   = gridInqNumber(gridID);
+	  position = gridInqPosition(gridID);
+	  fprintf(stdout, "size      : dim = %d\n", gridsize);
+	  fprintf(stdout, "%*s", nbyte0, "");
+	  fprintf(stdout, "grid      : number = %d  position = %d\n", number, position);
+	  if ( gridInqReference(gridID, NULL) )
+	    {
+	      char reference_link[8192];
+	      gridInqReference(gridID, reference_link);
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "path      : %s\n", reference_link);
+	    }
+	}
+      else if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED )
+	{
+	  if ( gridtype == GRID_CURVILINEAR )
+	    fprintf(stdout, "size      : dim = %d  nx = %d  ny = %d\n", gridsize, xsize, ysize);
+	  else
+	    fprintf(stdout, "size      : dim = %d  nvertex = %d\n", gridsize, gridInqNvertex(gridID));
+
+	  if ( gridInqXvals(gridID, NULL) && gridInqYvals(gridID, NULL) )
+	    {
+	      int i;
+	      double *xvals, *yvals;
+	      double xfirst, xlast, yfirst, ylast;
+	      xvals = (double *) malloc(gridsize*sizeof(double));
+	      yvals = (double *) malloc(gridsize*sizeof(double));
+
+	      gridInqXvals(gridID, xvals);
+	      gridInqYvals(gridID, yvals);
+
+	      xfirst = xvals[0];
+	      xlast  = xvals[0];
+	      yfirst = yvals[0];
+	      ylast  = yvals[0];
+	      for ( i = 1; i < gridsize; i++ )
+		{
+		  if ( xvals[i] < xfirst ) xfirst = xvals[i];
+		  if ( xvals[i] > xlast )  xlast  = xvals[i];
+		  if ( yvals[i] < yfirst ) yfirst = yvals[i];
+		  if ( yvals[i] > ylast )  ylast  = yvals[i];
+		}
+
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "%-9s : min = %.9g  max = %.9g  %s", xname, xfirst, xlast, xunits);
+	      if ( gridIsCircular(gridID) )
+		fprintf(stdout, "  circular");
+	      fprintf(stdout, "\n");
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "%-9s : min = %.9g  max = %.9g  %s\n", yname, yfirst, ylast, yunits);
+ 
+	      free(xvals);
+	      free(yvals);
+	    }
+	}
+      else if ( gridtype == GRID_LCC )
+	{
+	  double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
+	  int projflag, scanflag;
+
+	  gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm,
+		     &projflag, &scanflag);
+
+	  fprintf(stdout, "size      : dim = %d  nx = %d  ny = %d  ", gridsize, xsize, ysize);
+	  if ( (projflag&128) == 0 )
+	    fprintf(stdout, "North Pole\n");
+	  else
+	    fprintf(stdout, "South Pole\n");
+	  fprintf(stdout, "%*s", nbyte0, "");
+	  fprintf(stdout, "            originLon = %g  originLat = %g  lonParY = %g\n",
+		  originLon, originLat, lonParY);
+	  fprintf(stdout, "%*s", nbyte0, "");
+	  fprintf(stdout, "            lat1 = %g  lat2 = %g  xinc = %g m  yinc = %g m\n",
+		  lat1, lat2, xincm, yincm);
+	}
+      else /* if ( gridtype == GRID_GENERIC ) */
+	{
+	  if ( ysize == 0 )
+	    fprintf(stdout, "size      : dim = %d\n", gridsize);
+	  else
+	    {
+	      fprintf(stdout, "size      : dim = %d  nx = %d  ny = %d\n", gridsize, xsize, ysize);
+	      if ( gridIsCircular(gridID) )
+		{
+		  fprintf(stdout, "%*s", nbyte0, "");
+		  fprintf(stdout, "longitude :  circular\n");
+		}
+	    }
+	}
+
+      if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED ||
+	   gridtype == GRID_GENERIC || gridtype == GRID_LCC )
+	{
+	  if ( gridInqXvals(gridID, NULL) || gridInqYvals(gridID, NULL) || gridHasArea(gridID) ||
+	       gridInqXbounds(gridID, NULL) || gridInqYbounds(gridID, NULL) )
+	    {
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "available :");
+	      if ( gridInqXvals(gridID, NULL) )   fprintf(stdout, " xvals");
+	      if ( gridInqYvals(gridID, NULL) )   fprintf(stdout, " yvals");
+	      if ( gridInqXbounds(gridID, NULL) ) fprintf(stdout, " xbounds");
+	      if ( gridInqYbounds(gridID, NULL) ) fprintf(stdout, " ybounds");
+	      if ( gridHasArea(gridID) )          fprintf(stdout, " area");
+	      if ( gridInqMask(gridID, NULL) )    fprintf(stdout, " mask");
+	      fprintf(stdout, "\n");
+	    }
+	}
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/cdi.settings.in b/libcdi/cdi.settings.in
new file mode 100644
index 0000000..2b27c67
--- /dev/null
+++ b/libcdi/cdi.settings.in
@@ -0,0 +1,59 @@
+{
+   "CC"       : "@CC@",
+   "CPP"      : "@CPP@",
+   "CPPFLAGS" : "@CPPFLAGS@",
+   "CFLAGS"   : "@CFLAGS@",
+   "LDFLAGS"  : "@LDFLAGS@",
+   "LIBS"     : "@LIBS@",
+   "FC"       : "@FC@",
+   "F77"      : "@F77@",
+   "FCFLAGS"  : "@FCFLAGS@",
+   "LD"       : "@LD@",
+   "NM"       : "@NM@",
+   "AR"       : "@AR@",
+   "AS"       : "@AS@",
+   "DLLTOOL"  : "@DLLTOOL@",
+   "OBJDUMP"  : "@OBJDUMP@",
+   "STRIP"    : "@STRIP@",
+   "RANLIB"   : "@RANLIB@",
+   "INSTALL"  : "@INSTALL@",
+  },
+  "enable_cdi_lib" : @ENABLE_CDI_LIB@,
+  "grib"           : "@ENABLE_GRIB@",
+  "cgribex"        : "@ENABLE_CGRIBEX@",
+  "service"        : "@ENABLE_SERVICE@",
+  "extra"          : "@ENABLE_EXTRA@",
+  "ieg"            : "@ENABLE_IEG@",
+  "threads"    : {
+    "lib"      : "@THREADS_LIBS@",
+    "include"  : "@THREADS_INCLUDE@"
+  },
+  "zlib"     : {
+    "lib"      : "@ZLIB_LIBS@",
+    "include"  : "@ZLIB_INCLUDE@",
+  },
+  "szlib"    : {
+    "lib"      : "@SZLIB_LIBS@",
+    "include"  : "@SZLIB_INCLUDE@"
+  },
+  "hdf5"     : {
+    "lib"      : "@HDF5_LIBS@",
+    "include"  : "@HDF5_INCLUDE@"
+  },
+  "netcdf"   : {
+    "lib"      : "@NETCDF_LIBS@",
+    "include"  : "@NETCDF_INCLUDE@"
+  },
+  "grip_api" : {
+    "lib"      : "@GRIB_API_LIBS@",
+    "include"  : "@GRIB_API_INCLUDE@"
+  },
+  "jasper" : {
+    "lib"      : "@JASPER_LIBS@"
+  },
+  "enable_python" : @ENABLE_PYTHON@,
+  "enable_ruby"   : @ENABLE_RUBY@,
+  "USER_NAME"   : "@USER_NAME@",
+  "HOST_NAME"   : "@HOST_NAME@",
+  "SYSTEM_TYPE" : "@SYSTEM_TYPE@"
+}
diff --git a/libcdi/config/compile b/libcdi/config/compile
new file mode 100755
index 0000000..c0096a7
--- /dev/null
+++ b/libcdi/config/compile
@@ -0,0 +1,143 @@
+#! /bin/sh
+# Wrapper for compilers which do not understand `-c -o'.
+
+scriptversion=2009-10-06.20; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2009  Free Software
+# Foundation, Inc.
+# Written by Tom Tromey <tromey at cygnus.com>.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: compile [--help] [--version] PROGRAM [ARGS]
+
+Wrapper for compilers which do not understand `-c -o'.
+Remove `-o dest.o' from ARGS, run PROGRAM with the remaining
+arguments, and rename the output as expected.
+
+If you are trying to build a whole package this is not the
+right script to run: please start by reading the file `INSTALL'.
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "compile $scriptversion"
+    exit $?
+    ;;
+esac
+
+ofile=
+cfile=
+eat=
+
+for arg
+do
+  if test -n "$eat"; then
+    eat=
+  else
+    case $1 in
+      -o)
+	# configure might choose to run compile as `compile cc -o foo foo.c'.
+	# So we strip `-o arg' only if arg is an object.
+	eat=1
+	case $2 in
+	  *.o | *.obj)
+	    ofile=$2
+	    ;;
+	  *)
+	    set x "$@" -o "$2"
+	    shift
+	    ;;
+	esac
+	;;
+      *.c)
+	cfile=$1
+	set x "$@" "$1"
+	shift
+	;;
+      *)
+	set x "$@" "$1"
+	shift
+	;;
+    esac
+  fi
+  shift
+done
+
+if test -z "$ofile" || test -z "$cfile"; then
+  # If no `-o' option was seen then we might have been invoked from a
+  # pattern rule where we don't need one.  That is ok -- this is a
+  # normal compilation that the losing compiler can handle.  If no
+  # `.c' file was seen then we are probably linking.  That is also
+  # ok.
+  exec "$@"
+fi
+
+# Name of file we expect compiler to create.
+cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'`
+
+# Create the lock directory.
+# Note: use `[/\\:.-]' here to ensure that we don't use the same name
+# that we are using for the .o file.  Also, base the name on the expected
+# object file name, since that is what matters with a parallel build.
+lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d
+while true; do
+  if mkdir "$lockdir" >/dev/null 2>&1; then
+    break
+  fi
+  sleep 1
+done
+# FIXME: race condition here if user kills between mkdir and trap.
+trap "rmdir '$lockdir'; exit 1" 1 2 15
+
+# Run the compile.
+"$@"
+ret=$?
+
+if test -f "$cofile"; then
+  test "$cofile" = "$ofile" || mv "$cofile" "$ofile"
+elif test -f "${cofile}bj"; then
+  test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile"
+fi
+
+rmdir "$lockdir"
+exit $ret
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/libcdi/config/config.guess b/libcdi/config/config.guess
new file mode 100755
index 0000000..115f944
--- /dev/null
+++ b/libcdi/config/config.guess
@@ -0,0 +1,1502 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2010-04-03'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner.  Please send patches (context
+# diff format) to <config-patches at gnu.org> and include a ChangeLog
+# entry.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub.  If it succeeds, it prints the system name on stdout, and
+# exits with 0.  Otherwise, it exits with 1.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' HUP INT TERM
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi at noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    sh5el) machine=sh5le-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" in
+	    arm*|i386|m68k|ns32k|sh3*|sparc|vax)
+		eval $set_cc_for_build
+		if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+			| grep -q __ELF__
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee at wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    s390x:SunOS:*:*)
+	echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4H:SunOS:5.*:*)
+	echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+	echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
+	echo i386-pc-auroraux${UNAME_RELEASE}
+	exit ;;
+    i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
+	eval $set_cc_for_build
+	SUN_ARCH="i386"
+	# If there is a compiler, see if it is configured for 64-bit objects.
+	# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
+	# This test works for both compilers.
+	if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+	    if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
+		(CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		grep IS_64BIT_ARCH >/dev/null
+	    then
+		SUN_ARCH="x86_64"
+	    fi
+	fi
+	echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # MiNT.  But MiNT is downward compatible to TOS, so this should
+    # be no problem.
+    atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    AViiON:dgux:*:*)
+        # DG/UX returns AViiON for all architectures
+        UNAME_PROCESSOR=`/usr/bin/uname -p`
+	if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+	then
+	    if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit ;;
+    *:AIX:*:[456])
+	IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
+	if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+		IBM_ARCH=rs6000
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    9000/[678][0-9][0-9])
+		if [ -x /usr/bin/getconf ]; then
+		    sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
+                    sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
+                    case "${sc_cpu_version}" in
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep -q __LP64__
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
+	FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
+        echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+        exit ;;
+    5000:UNIX_System_V:4.*:*)
+        FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
+        FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
+        echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	case ${UNAME_MACHINE} in
+	    pc98)
+		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    *:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    *:Interix*:*)
+    	case ${UNAME_MACHINE} in
+	    x86)
+		echo i586-pc-interix${UNAME_RELEASE}
+		exit ;;
+	    authenticamd | genuineintel | EM64T)
+		echo x86_64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	    IA64)
+		echo ia64-unknown-interix${UNAME_RELEASE}
+		exit ;;
+	esac ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-pc-mks
+	exit ;;
+    8664:Windows_NT:*)
+	echo x86_64-pc-mks
+	exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    alpha:Linux:*:*)
+	case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+	  EV5)   UNAME_MACHINE=alphaev5 ;;
+	  EV56)  UNAME_MACHINE=alphaev56 ;;
+	  PCA56) UNAME_MACHINE=alphapca56 ;;
+	  PCA57) UNAME_MACHINE=alphapca56 ;;
+	  EV6)   UNAME_MACHINE=alphaev6 ;;
+	  EV67)  UNAME_MACHINE=alphaev67 ;;
+	  EV68*) UNAME_MACHINE=alphaev68 ;;
+        esac
+	objdump --private-headers /bin/sh | grep -q ld.so.1
+	if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
+	echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
+	exit ;;
+    arm*:Linux:*:*)
+	eval $set_cc_for_build
+	if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
+	    | grep -q __ARM_EABI__
+	then
+	    echo ${UNAME_MACHINE}-unknown-linux-gnu
+	else
+	    echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+	fi
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-gnu
+	exit ;;
+    i*86:Linux:*:*)
+	LIBC=gnu
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#ifdef __dietlibc__
+	LIBC=dietlibc
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
+	echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    mips:Linux:*:* | mips64:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef ${UNAME_MACHINE}
+	#undef ${UNAME_MACHINE}el
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=${UNAME_MACHINE}el
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=${UNAME_MACHINE}
+	#else
+	CPU=
+	#endif
+	#endif
+EOF
+	eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
+	test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+	;;
+    or32:Linux:*:*)
+	echo or32-unknown-linux-gnu
+	exit ;;
+    padre:Linux:*:*)
+	echo sparc-unknown-linux-gnu
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit ;;
+    ppc64:Linux:*:*)
+	echo powerpc64-unknown-linux-gnu
+	exit ;;
+    ppc:Linux:*:*)
+	echo powerpc-unknown-linux-gnu
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
+    x86_64:Linux:*:*)
+	echo x86_64-unknown-linux-gnu
+	exit ;;
+    xtensa*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    i*86:DYNIX/ptx:4*:*)
+	# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
+	# earlier versions are messed up and put the nodename in both
+	# sysname and nodename.
+	echo i386-sequent-sysv4
+	exit ;;
+    i*86:UNIX_SV:4.2MP:2.*)
+        # Unixware is an offshoot of SVR4, but it has its own version
+        # number series starting with 2...
+        # I am not positive that other SVR4 systems won't match this,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	exit ;;
+    pc:*:*:*)
+	# Left here for compatibility:
+        # uname -m prints for DJGPP always 'pc', but it prints nothing about
+        # the processor, so we play safe by assuming i586.
+	# Note: whatever this is, it MUST be the same as what config.sub
+	# prints for the "djgpp" host, or else GDB configury will decide that
+	# this is a cross-build.
+	echo i586-pc-msdosdjgpp
+        exit ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	OS_REL=''
+	test -r /etc/.relid \
+	&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	  && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	  && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+	OS_REL='.3'
+	test -r /etc/.relid \
+	    && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+	/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+	    && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+	/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
+	    && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel at ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes at openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf at swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green at stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    BePC:Haiku:*:*)	# Haiku running on Intel PC compatible.
+	echo i586-pc-haiku
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-7:SUPER-UX:*:*)
+	echo sx7-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8:SUPER-UX:*:*)
+	echo sx8-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-8R:SUPER-UX:*:*)
+	echo sx8r-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    i386)
+		eval $set_cc_for_build
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+		      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+		      grep IS_64BIT_ARCH >/dev/null
+		  then
+		      UNAME_PROCESSOR="x86_64"
+		  fi
+		fi ;;
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+        echo mips-sei-seiux${UNAME_RELEASE}
+	exit ;;
+    *:DragonFly:*:*)
+	echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+	exit ;;
+    *:*VMS:*:*)
+    	UNAME_MACHINE=`(uname -p) 2>/dev/null`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+    i*86:AROS:*:*)
+	echo ${UNAME_MACHINE}-pc-aros
+	exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+and
+  http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches at gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/libcdi/config/config.sub b/libcdi/config/config.sub
new file mode 100755
index 0000000..204218c
--- /dev/null
+++ b/libcdi/config/config.sub
@@ -0,0 +1,1731 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
+#   Free Software Foundation, Inc.
+
+timestamp='2010-05-21'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches at gnu.org>.  Submit a context
+# diff and a properly formatted GNU ChangeLog entry.
+#
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches at gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
+2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free
+Software Foundation, Inc.
+
+This is free software; see the source for copying conditions.  There is NO
+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+	-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+	-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+	-apple | -axis | -knuth | -cray | -microblaze)
+		os=
+		basic_machine=$1
+		;;
+        -bluegene*)
+	        os=-cnk
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fido | fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| lm32 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore | mep | metag \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64octeon | mips64octeonel \
+	| mips64orion | mips64orionel \
+	| mips64r5900 | mips64r5900el \
+	| mips64vr | mips64vrel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| moxie \
+	| mt \
+	| msp430 \
+	| nios | nios2 \
+	| ns16k | ns32k \
+	| or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| rx \
+	| score \
+	| sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+	| sh64 | sh64le \
+	| sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+	| sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+	| spu | strongarm \
+	| tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+	| ubicom32 \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| z8k | z80)
+		basic_machine=$basic_machine-unknown
+		;;
+	c54x)
+		basic_machine=tic54x-unknown
+		;;
+	c55x)
+		basic_machine=tic55x-unknown
+		;;
+	c6x)
+		basic_machine=tic6x-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12 | picochip)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
+
+	# We use `pc' rather than `unknown'
+	# because (1) that's what they normally are, and
+	# (2) the word "unknown" tends to confuse beginning users.
+	i*86 | x86_64)
+	  basic_machine=$basic_machine-pc
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* | avr32-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* \
+	| clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| lm32-* \
+	| m32c-* | m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64octeon-* | mips64octeonel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64r5900-* | mips64r5900el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| mt-* \
+	| msp430-* \
+	| nios-* | nios2-* \
+	| none-* | np1-* | ns16k-* | ns32k-* \
+	| orion-* \
+	| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+	| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
+	| pyramid-* \
+	| romp-* | rs6000-* | rx-* \
+	| sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+	| shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+	| sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+	| sparclite-* \
+	| sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \
+	| tahoe-* | thumb-* \
+	| tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+	| tile-* | tilegx-* \
+	| tron-* \
+	| ubicom32-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa*-* \
+	| ymp-* \
+	| z8k-* | z80-*)
+		;;
+	# Recognize the basic CPU types without company name, with glob match.
+	xtensa*)
+		basic_machine=$basic_machine-unknown
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aros)
+		basic_machine=i386-pc
+		os=-aros
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	blackfin)
+		basic_machine=bfin-unknown
+		os=-linux
+		;;
+	blackfin-*)
+		basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	bluegene*)
+		basic_machine=powerpc-ibm
+		os=-cnk
+		;;
+	c54x-*)
+		basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c55x-*)
+		basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c6x-*)
+		basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+        cegcc)
+		basic_machine=arm-unknown
+		os=-cegcc
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16)
+		basic_machine=cr16-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	dicos)
+		basic_machine=i686-pc
+		os=-dicos
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m68knommu)
+		basic_machine=m68k-unknown
+		os=-linux
+		;;
+	m68knommu-*)
+		basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+        microblaze)
+		basic_machine=microblaze-xilinx
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	mingw32ce)
+		basic_machine=arm-unknown
+		os=-mingw32ce
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	parisc)
+		basic_machine=hppa-unknown
+		os=-linux
+		;;
+	parisc-*)
+		basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+		os=-linux
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=i686-pc
+		;;
+	pentium4)
+		basic_machine=i786-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium4-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+		;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+		;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+		;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh5el)
+		basic_machine=sh5le-unknown
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		basic_machine=t90-cray
+		os=-unicos
+		;;
+        # This must be matched before tile*.
+        tilegx*)
+		basic_machine=tilegx-unknown
+		os=-linux-gnu
+		;;
+	tile*)
+		basic_machine=tile-unknown
+		os=-linux-gnu
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=f301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	z80-*-coff)
+		basic_machine=z80-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+		basic_machine=sparc-sun
+		;;
+	cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+        -auroraux)
+	        os=-auroraux
+		;;
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# Each alternative MUST END IN A *, to match a version number.
+	# -sysv* is not here because it comes later, after sysvr4.
+	-gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+	      | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+	      | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+	      | -sym* | -kopensolaris* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* | -aros* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* | -cegcc* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-android* \
+	      | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+        -os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+        -tpf*)
+		os=-tpf
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-dicos*)
+		os=-dicos
+		;;
+        -nacl*)
+	        ;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+        score-*)
+		os=-elf
+		;;
+        spu-*)
+		os=-elf
+		;;
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+        c4x-* | tic4x-*)
+        	os=-coff
+		;;
+	tic54x-*)
+		os=-coff
+		;;
+	tic55x-*)
+		os=-coff
+		;;
+	tic6x-*)
+		os=-coff
+		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
+	pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+        mep-*)
+		os=-elf
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-haiku)
+		os=-haiku
+		;;
+	*-ibm)
+		os=-aix
+		;;
+    	*-knuth)
+		os=-mmixware
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+	*-gould)
+		os=-sysv
+		;;
+	*-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+	*-sgi)
+		os=-irix
+		;;
+	*-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-cnk*|-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/libcdi/config/default b/libcdi/config/default
new file mode 100755
index 0000000..0599021
--- /dev/null
+++ b/libcdi/config/default
@@ -0,0 +1,139 @@
+#! /bin/sh
+#
+# default configuration options and compiler flags for different hosts
+#
+if test -z "$1" ; then
+  HOSTNAME=`hostname`
+else
+  HOSTNAME=$1
+fi
+#
+set -x
+#
+case "${HOSTNAME}" in
+# i386-apple-darwin10
+    bailung*)
+	./configure --prefix=$HOME/local \
+                    --enable-maintainer-mode \
+                    --enable-swig \
+                    --enable-python \
+                    --with-jasper=/opt/local \
+                    --with-grib_api=$HOME/local/gribapi-1.9.16 \
+                    --with-netcdf=$HOME/local \
+                    --with-szlib=$HOME/local \
+	            CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3 -march=native -Df2cFortran" LIBS="-L/opt/local/lib -lopenjpeg"
+	;;
+    cinglung*|feilung*|wanglung*)
+	./configure --prefix=$HOME/local \
+                    --enable-shared \
+                    --enable-maintainer-mode \
+                    --enable-swig \
+                    --enable-python \
+                    --with-jasper=/opt/local \
+                    --with-openjpeg=/opt/local \
+                    --with-libpng=/opt/local \
+                    --with-grib_api=/opt/local \
+                    --with-netcdf=/opt/local \
+                    --with-hdf5=/opt/local \
+                    --with-szlib=/opt/local \
+	            CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O2 -DpgiFortran"
+	;;
+    hama*)
+	./configure --prefix=$HOME/local \
+                    --enable-maintainer-mode \
+                    --enable-swig \
+                    --enable-python \
+                    --with-jasper=/opt/local \
+                    --with-grib_api=$HOME/local/gribapi-1.9.16 \
+                    --with-netcdf=/opt/local \
+                    --with-szlib=$HOME/local \
+	            CC=gcc CFLAGS="-g -pipe -D_REENTRANT -Wall -W -Wfloat-equal -pedantic -O3 -march=native -Df2cFortran"
+	;;
+# ia64-nec-linux
+    ds*)
+	./configure --prefix=$HOME/local \
+                    --with-netcdf=/pool/ia64/netcdf/netcdf-3.6.0-p1 \
+                    --with-szlib=$HOME/local \
+                    CC=icc CFLAGS="-g -O2 -Wall -fno-alias -DMIN_BUF_SIZE=4194304 -Df2cFortran"
+	;;
+# i686-linux
+    etch-ia32 | gata)
+	./configure --prefix=$HOME/local/etch-ia32 \
+                    --enable-maintainer-mode \
+                    --enable-all-static \
+                    --enable-swig \
+                    --enable-python \
+                    --with-jasper=/sw/etch-ia32/jasper-1.900.1 \
+                    --with-grib_api=$HOME/local/etch-ia32/grib_api-1.9.8 \
+	            --with-netcdf=/sw/etch-ia32/netcdf-4.0.1 \
+	            --with-hdf5=/sw/etch-ia32/hdf5-1.8.2 \
+                    --with-zlib=/sw/etch-ia32/zlib-1.2.3 \
+                    --with-szlib=$HOME/local/etch-ia32 \
+	            CC=gcc CFLAGS="-g -O2 -Wall -W -Wfloat-equal -pedantic"
+	;;
+    thingol)
+      ./configure --prefix=`pwd`/build \
+	            --with-netcdf=$HOME/builds/libs4cdo \
+	              --with-hdf5=$HOME/builds/libs4cdo \
+                     --with-szlib=$HOME/builds/libs4cdo \
+                  --with-grib_api=$HOME/builds/libs4cdo \
+                    --with-jasper=$HOME/builds/libs4cdo \
+                      --with-pic --enable-swig --enable-ruby --enable-python \
+                      CC=gcc CFLAGS="-g -O2 -Wall" LIBS=-lopenjpeg
+	;;
+# sparc-sun-solaris2.9
+    executor | yang | yin)
+	./configure --prefix=$HOME/local/SUN64 \
+                    --with-netcdf=/scratch/small/m214/m214089/local/SunOS64 \
+                    --with-szlib=$HOME/local/solaris10 \
+                    CC=cc CFLAGS="-g -mt -xO3 -xtarget=native -m64"
+	;;
+# sx6-nec-superux12.2
+    cs*)
+	./configure --prefix=$HOME/local \
+         	    --with-netcdf=/pool/netcdf/netcdf-3.6.0-p1 \
+		    CC=c++ \
+                    CFLAGS="-O -Onooverlap,restrict=all -pvctl,fullmsg,noassume,loopcnt=1000000"
+	;;
+    sx6)
+	./configure --host=sx6 --prefix=$HOME/local \
+                    --with-netcdf=/pool/SX-6/netcdf/netcdf-3.6.0-p1 \
+		    CC=sxc++ AR=sxar RANLIB=ls \
+                    CFLAGS="-O -Onooverlap,restrict=all -pvctl,fullmsg,noassume,loopcnt=1000000"
+	;;
+    lxe0*)
+        echo 'Please choose compiler modules! Checkout with "module av"!'
+        ./configure --prefix=$(pwd)/build-SX  --host=sx9-nec-superux \
+              --with-netcdf=/usr/local/pkg-sx9 \
+              --with-grib_api=/usr/local/pkg-sx9/grib_api   CC=sxc++ FC=sxf90 \
+              LD=/SX/opt/crosskit/inst/bin/sxld AR=/SX/opt/crosskit/inst/bin/sxar \
+              RANLIB=echo
+	;;
+# mips-sgi-irix6.5
+    ecgate1)
+	./configure --prefix=$HOME/local \
+ 	            --with-netcdf=/home/ms/spdekplb/hmk/include,/home/ms/spdekplb/hmk/lib64 \
+	            CC=cc CFLAGS="-O -n32"
+	;;
+# 5000-fujitsu-uxpv4.1_ES
+    vpp5)
+	./configure --prefix=$HOME \
+	            CC=vcc CFLAGS="-O -Wv,-m3 -K4"
+	;;
+# powerpc-ibm-aix6.1.0.0
+    blizzard*)
+        CONFIG_SHELL=/bin/bash /bin/bash \
+                    ./configure --prefix=$HOME/local \
+                    --with-netcdf=/sw/aix61/netcdf-4.2 \
+                    --with-hdf5=/sw/aix61/hdf5-1.8.8-threadsafe \
+                    --with-zlib=/sw/aix61/zlib-1.2.6 \
+                    --with-szlib=/sw/aix61/szip-2.1-threadsafe \
+                    AR="ar -X 64" LDFLAGS="-brtl" FC=xlf2003_r CC=xlc_r \
+                    CFLAGS="-g -O3 -q64 -qhot -qstrict -qarch=pwr6 -qtune=balanced -qlistfmt=html=transforms -DHAVE_MMAP -Dextname" \
+                    FCFLAGS="-qsuffix=cpp=f90" \
+                    SHELL=/bin/bash
+        ;;
+    *)
+	echo "configuration for hostname $HOSTNAME not found!"
+	;;
+esac
diff --git a/libcdi/config/depcomp b/libcdi/config/depcomp
new file mode 100755
index 0000000..df8eea7
--- /dev/null
+++ b/libcdi/config/depcomp
@@ -0,0 +1,630 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1999, 2000, 2003, 2004, 2005, 2006, 2007, 2009 Free
+# Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Originally written by Alexandre Oliva <oliva at dcc.unicamp.br>.
+
+case $1 in
+  '')
+     echo "$0: No command.  Try \`$0 --help' for more information." 1>&2
+     exit 1;
+     ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  source      Source file read by `PROGRAMS ARGS'.
+  object      Object file output by `PROGRAMS ARGS'.
+  DEPDIR      directory where to store dependencies.
+  depfile     Dependency file to output.
+  tmpdepfile  Temporary file to use when outputing dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake at gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+esac
+
+if test -z "$depmode" || test -z "$source" || test -z "$object"; then
+  echo "depcomp: Variables source, object and depmode must be set" 1>&2
+  exit 1
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`}
+
+rm -f "$tmpdepfile"
+
+# Some modes work just like other modes, but use different flags.  We
+# parameterize here, but still list the modes in the big case below,
+# to make depend.m4 easier to write.  Note that we *cannot* use a case
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+   # This is just like dashmstdout with a different argument.
+   dashmflag=-xM
+   depmode=dashmstdout
+fi
+
+cygpath_u="cygpath -u -f -"
+if test "$depmode" = msvcmsys; then
+   # This is just like msvisualcpp but w/o cygpath translation.
+   # Just convert the backslash-escaped backslashes to single forward
+   # slashes to satisfy depend.m4
+   cygpath_u="sed s,\\\\\\\\,/,g"
+   depmode=msvisualcpp
+fi
+
+case "$depmode" in
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+gcc)
+## There are various ways to get dependency output from gcc.  Here's
+## why we pick this rather obscure method:
+## - Don't want to use -MD because we'd like the dependencies to end
+##   up in a subdir.  Having to rename by hand is ugly.
+##   (We might end up doing this anyway to support other compilers.)
+## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
+##   -MM, not -M (despite what the docs say).
+## - Using -M directly means running the compiler twice (even worse
+##   than renaming).
+  if test -z "$gccflag"; then
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz
+## The second -e expression handles DOS-style file names with drive letters.
+  sed -e 's/^[^:]*: / /' \
+      -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile"
+## This next piece of magic avoids the `deleted header file' problem.
+## The problem is that when a header file which appears in a .P file
+## is deleted, the dependency causes make to die (because there is
+## typically no way to rebuild the header).  We avoid this by adding
+## dummy dependencies for each header file.  Too bad gcc doesn't do
+## this for us directly.
+  tr ' ' '
+' < "$tmpdepfile" |
+## Some versions of gcc put a space before the `:'.  On the theory
+## that the space means something, we add a space to the output as
+## well.
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like `#:fec' to the end of the
+    # dependency line.
+    tr ' ' '
+' < "$tmpdepfile" \
+    | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \
+    tr '
+' ' ' >> "$depfile"
+    echo >> "$depfile"
+
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' '
+' < "$tmpdepfile" \
+   | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+   >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+aix)
+  # The C for AIX Compiler uses -M and outputs the dependencies
+  # in a .u file.  In older versions, this file always lives in the
+  # current directory.  Also, the AIX compiler puts `$object:' at the
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  fi
+  stat=$?
+
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+    exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    # Each line is of the form `foo.o: dependent.h'.
+    # Do two passes, one to just change these to
+    # `$object: dependent.h' and one to simply `dependent.h:'.
+    sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+    # That's a tab and a space in the [].
+    sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+  else
+    # The sourcefile does not contain any dependencies, so just
+    # store a dummy comment line, to avoid errors with the Makefile
+    # "include basename.Plo" scheme.
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+icc)
+  # Intel's C compiler understands `-MD -MF file'.  However on
+  #    icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c
+  # ICC 7.0 will fill foo.d with something like
+  #    foo.o: sub/foo.c
+  #    foo.o: sub/foo.h
+  # which is wrong.  We want:
+  #    sub/foo.o: sub/foo.c
+  #    sub/foo.o: sub/foo.h
+  #    sub/foo.c:
+  #    sub/foo.h:
+  # ICC 7.1 will output
+  #    foo.o: sub/foo.c sub/foo.h
+  # and will wrap long lines using \ :
+  #    foo.o: sub/foo.c ... \
+  #     sub/foo.h ... \
+  #     ...
+
+  "$@" -MD -MF "$tmpdepfile"
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile"
+  # Some versions of the HPUX 10.20 sed can't process this invocation
+  # correctly.  Breaking it into two sed invocations is a workaround.
+  sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" |
+    sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # 'foo.d', which lands next to the object file, wherever that
+  # happens to be.
+  # Much of this is similar to the tru64 case; see comments there.
+  dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+  test "x$dir" = "x$object" && dir=
+  base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -eq 0; then :
+  else
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[a-z]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add `dependent.h:' lines.
+    sed -ne '2,${
+	       s/^ *//
+	       s/ \\*$//
+	       s/$/:/
+	       p
+	     }' "$tmpdepfile" >> "$depfile"
+  else
+    echo "#dummy" > "$depfile"
+  fi
+  rm -f "$tmpdepfile" "$tmpdepfile2"
+  ;;
+
+tru64)
+   # The Tru64 compiler uses -MD to generate dependencies as a side
+   # effect.  `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'.
+   # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put
+   # dependencies in `foo.d' instead, so we check for that too.
+   # Subdirectories are respected.
+   dir=`echo "$object" | sed -e 's|/[^/]*$|/|'`
+   test "x$dir" = "x$object" && dir=
+   base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'`
+
+   if test "$libtool" = yes; then
+      # With Tru64 cc, shared objects can also be used to make a
+      # static library.  This mechanism is used in libtool 1.4 series to
+      # handle both shared and static libraries in a single compilation.
+      # With libtool 1.4, dependencies were output in $dir.libs/$base.lo.d.
+      #
+      # With libtool 1.5 this exception was removed, and libtool now
+      # generates 2 separate objects for the 2 libraries.  These two
+      # compilations output dependencies in $dir.libs/$base.o.d and
+      # in $dir$base.o.d.  We have to check for both files, because
+      # one of the two compilations can be disabled.  We should prefer
+      # $dir$base.o.d over $dir.libs/$base.o.d because the latter is
+      # automatically cleaned when .libs/ is deleted, while ignoring
+      # the former would cause a distcleancheck panic.
+      tmpdepfile1=$dir.libs/$base.lo.d   # libtool 1.4
+      tmpdepfile2=$dir$base.o.d          # libtool 1.5
+      tmpdepfile3=$dir.libs/$base.o.d    # libtool 1.5
+      tmpdepfile4=$dir.libs/$base.d      # Compaq CCC V6.2-504
+      "$@" -Wc,-MD
+   else
+      tmpdepfile1=$dir$base.o.d
+      tmpdepfile2=$dir$base.d
+      tmpdepfile3=$dir$base.d
+      tmpdepfile4=$dir$base.d
+      "$@" -MD
+   fi
+
+   stat=$?
+   if test $stat -eq 0; then :
+   else
+      rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+      exit $stat
+   fi
+
+   for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" "$tmpdepfile4"
+   do
+     test -f "$tmpdepfile" && break
+   done
+   if test -f "$tmpdepfile"; then
+      sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile"
+      # That's a tab and a space in the [].
+      sed -e 's,^.*\.[a-z]*:[	 ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile"
+   else
+      echo "#dummy" > "$depfile"
+   fi
+   rm -f "$tmpdepfile"
+   ;;
+
+#nosideeffect)
+  # This comment above is used by automake to tell side-effect
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # Require at least two characters before searching for `:'
+  # in the target name.  This is to cope with DOS-style filenames:
+  # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise.
+  "$@" $dashmflag |
+    sed 's:^[  ]*[^: ][^:][^:]*\:[    ]*:'"$object"'\: :' > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  tr ' ' '
+' < "$tmpdepfile" | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$depfile"
+  sed '1,2d' "$tmpdepfile" | tr ' ' '
+' | \
+## Some versions of the HPUX 10.20 sed can't process this invocation
+## correctly.  Breaking it into two sed invocations is a workaround.
+    sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile" "$tmpdepfile".bak
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove `-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  "$@" -E |
+    sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \
+       -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' |
+    sed '$ s: \\$::' > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+	set fnord "$@"
+	shift
+	shift
+	;;
+    *)
+	set fnord "$@" "$arg"
+	shift
+	shift
+	;;
+    esac
+  done
+  "$@" -E 2>/dev/null |
+  sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::	\1 \\:p' >> "$depfile"
+  echo "	" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # since it is checked for above.
+  exit 1
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/libcdi/config/install-sh b/libcdi/config/install-sh
new file mode 100755
index 0000000..3f83ce9
--- /dev/null
+++ b/libcdi/config/install-sh
@@ -0,0 +1,524 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2010-02-06.18; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# FSF changes to this file are in the public domain.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+nl='
+'
+IFS=" ""	$nl"
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit=${DOITPROG-}
+if test -z "$doit"; then
+  doit_exec=exec
+else
+  doit_exec=$doit
+fi
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_glob='?'
+initialize_posix_glob='
+  test "$posix_glob" != "?" || {
+    if (set -f) 2>/dev/null; then
+      posix_glob=
+    else
+      posix_glob=:
+    fi
+  }
+'
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+no_target_directory=
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+	shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+	case $mode in
+	  *' '* | *'	'* | *'
+'*	  | *'*'* | *'?'* | *'['*)
+	    echo "$0: invalid mode: $mode" >&2
+	    exit 1;;
+	esac
+	shift;;
+
+    -o) chowncmd="$chownprog $2"
+	shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t) dst_arg=$2
+	shift;;
+
+    -T) no_target_directory=true;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --)	shift
+	break;;
+
+    -*)	echo "$0: invalid option: $1" >&2
+	exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    fi
+    shift # arg
+    dst_arg=$arg
+  done
+fi
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # It's OK to call `install-sh -d' without argument.
+  # This can happen when creating conditional directories.
+  exit 0
+fi
+
+if test -z "$dir_arg"; then
+  do_exit='(exit $ret); exit $ret'
+  trap "ret=129; $do_exit" 1
+  trap "ret=130; $do_exit" 2
+  trap "ret=141; $do_exit" 13
+  trap "ret=143; $do_exit" 15
+
+  # Set umask so as not to create temps with too-generous modes.
+  # However, 'strip' requires both read and write access to temps.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+	u_plus_rw=
+      else
+	u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names starting with `-'.
+  case $src in
+    -*) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+
+    dst=$dst_arg
+    # Protect names starting with `-'.
+    case $dst in
+      -*) dst=./$dst;;
+    esac
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test -n "$no_target_directory"; then
+	echo "$0: $dst_arg: Is a directory" >&2
+	exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      # Prefer dirname, but fall back on a substitute if dirname fails.
+      dstdir=`
+	(dirname "$dst") 2>/dev/null ||
+	expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	     X"$dst" : 'X\(//\)[^/]' \| \
+	     X"$dst" : 'X\(//\)$' \| \
+	     X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
+	echo X"$dst" |
+	    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)[^/].*/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\/\)$/{
+		   s//\1/
+		   q
+		 }
+		 /^X\(\/\).*/{
+		   s//\1/
+		   q
+		 }
+		 s/.*/./; q'
+      `
+
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+	# Create intermediate dirs using mode 755 as modified by the umask.
+	# This is like FreeBSD 'install' as of 1997-10-28.
+	umask=`umask`
+	case $stripcmd.$umask in
+	  # Optimize common cases.
+	  *[2367][2367]) mkdir_umask=$umask;;
+	  .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+	  *[0-7])
+	    mkdir_umask=`expr $umask + 22 \
+	      - $umask % 100 % 40 + $umask % 20 \
+	      - $umask % 10 % 4 + $umask % 2
+	    `;;
+	  *) mkdir_umask=$umask,go-w;;
+	esac
+
+	# With -d, create the new directory with the user-specified mode.
+	# Otherwise, rely on $mkdir_umask.
+	if test -n "$dir_arg"; then
+	  mkdir_mode=-m$mode
+	else
+	  mkdir_mode=
+	fi
+
+	posix_mkdir=false
+	case $umask in
+	  *[123567][0-7][0-7])
+	    # POSIX mkdir -p sets u+wx bits regardless of umask, which
+	    # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+	    ;;
+	  *)
+	    tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+	    trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+	    if (umask $mkdir_umask &&
+		exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+	    then
+	      if test -z "$dir_arg" || {
+		   # Check for POSIX incompatibilities with -m.
+		   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+		   # other-writeable bit of parent directory when it shouldn't.
+		   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+		   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+		   case $ls_ld_tmpdir in
+		     d????-?r-*) different_mode=700;;
+		     d????-?--*) different_mode=755;;
+		     *) false;;
+		   esac &&
+		   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+		     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+		     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+		   }
+		 }
+	      then posix_mkdir=:
+	      fi
+	      rmdir "$tmpdir/d" "$tmpdir"
+	    else
+	      # Remove any dirs left behind by ancient mkdir implementations.
+	      rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+	    fi
+	    trap '' 0;;
+	esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+	umask $mkdir_umask &&
+	$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+	/*) prefix='/';;
+	-*) prefix='./';;
+	*)  prefix='';;
+      esac
+
+      eval "$initialize_posix_glob"
+
+      oIFS=$IFS
+      IFS=/
+      $posix_glob set -f
+      set fnord $dstdir
+      shift
+      $posix_glob set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+	test -z "$d" && continue
+
+	prefix=$prefix$d
+	if test -d "$prefix"; then
+	  prefixes=
+	else
+	  if $posix_mkdir; then
+	    (umask=$mkdir_umask &&
+	     $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+	    # Don't fail if two instances are running concurrently.
+	    test -d "$prefix" || exit 1
+	  else
+	    case $prefix in
+	      *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+	      *) qprefix=$prefix;;
+	    esac
+	    prefixes="$prefixes '$qprefix'"
+	  fi
+	fi
+	prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+	# Don't fail if two instances are running concurrently.
+	(umask $mkdir_umask &&
+	 eval "\$doit_exec \$mkdirprog $prefixes") ||
+	  test -d "$dstdir" || exit 1
+	obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"	2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"	2>/dev/null` &&
+
+       eval "$initialize_posix_glob" &&
+       $posix_glob set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       $posix_glob set +f &&
+
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+	# Now remove or move aside any old file at destination location.
+	# We try this two ways since rm can't unlink itself on some
+	# systems and the destination file might be busy for other
+	# reasons.  In this case, the final cleanup might fail but the new
+	# file should still install successfully.
+	{
+	  test ! -f "$dst" ||
+	  $doit $rmcmd -f "$dst" 2>/dev/null ||
+	  { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+	    { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+	  } ||
+	  { echo "$0: cannot unlink or rename $dst" >&2
+	    (exit 1); exit 1
+	  }
+	} &&
+
+	# Now rename the file to the real destination.
+	$doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/libcdi/config/interface.rb b/libcdi/config/interface.rb
new file mode 100644
index 0000000..7ebab59
--- /dev/null
+++ b/libcdi/config/interface.rb
@@ -0,0 +1,7 @@
+require 'mkmf'
+require 'rbconfig'
+if RUBY_VERSION[0,3] == '1.8'
+  puts "-I#{Config::expand(CONFIG['archdir'])}"
+else
+  puts "-I#{RbConfig::CONFIG['rubyhdrdir']} -I#{RbConfig::CONFIG['rubyhdrdir']}/#{RbConfig::CONFIG['arch']}"
+end
diff --git a/libcdi/config/ltmain.sh b/libcdi/config/ltmain.sh
new file mode 100644
index 0000000..9ae038c
--- /dev/null
+++ b/libcdi/config/ltmain.sh
@@ -0,0 +1,9656 @@
+
+# libtool (GNU libtool) 2.4.2
+# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
+
+# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions.  There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+#       --config             show all configuration variables
+#       --debug              enable verbose shell tracing
+#   -n, --dry-run            display commands without modifying any files
+#       --features           display basic configuration information and exit
+#       --mode=MODE          use operation mode MODE
+#       --preserve-dup-deps  don't remove duplicate dependency libraries
+#       --quiet, --silent    don't print informational messages
+#       --no-quiet, --no-silent
+#                            print informational messages (default)
+#       --no-warn            don't display warning messages
+#       --tag=TAG            use configuration variables from tag TAG
+#   -v, --verbose            print more informational messages than default
+#       --no-verbose         don't print the extra informational messages
+#       --version            print version information
+#   -h, --help, --help-all   print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+#         clean              remove files from the build directory
+#         compile            compile a source file into a libtool object
+#         execute            automatically set library path, then run a program
+#         finish             complete the installation of libtool libraries
+#         install            install libraries or executables
+#         link               create a library or an executable
+#         uninstall          remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.  When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+#         host-triplet:	$host
+#         shell:		$SHELL
+#         compiler:		$LTCC
+#         compiler flags:		$LTCFLAGS
+#         linker:		$LD (gnu? $with_gnu_ld)
+#         $progname:	(GNU libtool) 2.4.2
+#         automake:	$automake_version
+#         autoconf:	$autoconf_version
+#
+# Report bugs to <bug-libtool at gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION=2.4.2
+TIMESTAMP=""
+package_revision=1.3337
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test \"\${$lt_var+set}\" = set; then
+          save_$lt_var=\$$lt_var
+          $lt_var=C
+	  export $lt_var
+	  lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+	  lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+	fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77	  # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS=" 	$lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+    # Extract subdirectory from the argument.
+    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+    case ${2} in
+      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+    esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+		s@/\./@/@g
+		t dotsl
+		s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+#             value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+  # Start from root dir and reassemble the path.
+  func_normal_abspath_result=
+  func_normal_abspath_tpath=$1
+  func_normal_abspath_altnamespace=
+  case $func_normal_abspath_tpath in
+    "")
+      # Empty path, that just means $cwd.
+      func_stripname '' '/' "`pwd`"
+      func_normal_abspath_result=$func_stripname_result
+      return
+    ;;
+    # The next three entries are used to spot a run of precisely
+    # two leading slashes without using negated character classes;
+    # we take advantage of case's first-match behaviour.
+    ///*)
+      # Unusual form of absolute path, do nothing.
+    ;;
+    //*)
+      # Not necessarily an ordinary path; POSIX reserves leading '//'
+      # and for example Cygwin uses it to access remote file shares
+      # over CIFS/SMB, so we conserve a leading double slash if found.
+      func_normal_abspath_altnamespace=/
+    ;;
+    /*)
+      # Absolute path, do nothing.
+    ;;
+    *)
+      # Relative path, prepend $cwd.
+      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+    ;;
+  esac
+  # Cancel out all the simple stuff to save iterations.  We also want
+  # the path to end with a slash for ease of parsing, so make sure
+  # there is one (and only one) here.
+  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+  while :; do
+    # Processed it all yet?
+    if test "$func_normal_abspath_tpath" = / ; then
+      # If we ascended to the root using ".." the result may be empty now.
+      if test -z "$func_normal_abspath_result" ; then
+        func_normal_abspath_result=/
+      fi
+      break
+    fi
+    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcar"`
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcdr"`
+    # Figure out what to do with it
+    case $func_normal_abspath_tcomponent in
+      "")
+        # Trailing empty path component, ignore it.
+      ;;
+      ..)
+        # Parent dir; strip last assembled component from result.
+        func_dirname "$func_normal_abspath_result"
+        func_normal_abspath_result=$func_dirname_result
+      ;;
+      *)
+        # Actual path component, append it.
+        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+      ;;
+    esac
+  done
+  # Restore leading double-slash if one was found on entry.
+  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+#             value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+  func_relative_path_result=
+  func_normal_abspath "$1"
+  func_relative_path_tlibdir=$func_normal_abspath_result
+  func_normal_abspath "$2"
+  func_relative_path_tbindir=$func_normal_abspath_result
+
+  # Ascend the tree starting from libdir
+  while :; do
+    # check if we have found a prefix of bindir
+    case $func_relative_path_tbindir in
+      $func_relative_path_tlibdir)
+        # found an exact match
+        func_relative_path_tcancelled=
+        break
+        ;;
+      $func_relative_path_tlibdir*)
+        # found a matching prefix
+        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+        func_relative_path_tcancelled=$func_stripname_result
+        if test -z "$func_relative_path_result"; then
+          func_relative_path_result=.
+        fi
+        break
+        ;;
+      *)
+        func_dirname $func_relative_path_tlibdir
+        func_relative_path_tlibdir=${func_dirname_result}
+        if test "x$func_relative_path_tlibdir" = x ; then
+          # Have to descend all the way to the root!
+          func_relative_path_result=../$func_relative_path_result
+          func_relative_path_tcancelled=$func_relative_path_tbindir
+          break
+        fi
+        func_relative_path_result=../$func_relative_path_result
+        ;;
+    esac
+  done
+
+  # Now calculate path; take care to avoid doubling-up slashes.
+  func_stripname '' '/' "$func_relative_path_result"
+  func_relative_path_result=$func_stripname_result
+  func_stripname '/' '/' "$func_relative_path_tcancelled"
+  if test "x$func_stripname_result" != x ; then
+    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+  fi
+
+  # Normalisation. If bindir is libdir, return empty string,
+  # else relative path ending with a slash; either way, target
+  # file name can be directly appended.
+  if test ! -z "$func_relative_path_result"; then
+    func_stripname './' '' "$func_relative_path_result/"
+    func_relative_path_result=$func_stripname_result
+  fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=$func_dirname_result
+     progdir=`cd "$progdir" && pwd`
+     progpath="$progdir/$progname"
+     ;;
+  *)
+     save_IFS="$IFS"
+     IFS=${PATH_SEPARATOR-:}
+     for progdir in $PATH; do
+       IFS="$save_IFS"
+       test -x "$progdir/$progname" && break
+     done
+     IFS="$save_IFS"
+     test -n "$progdir" || progdir=`pwd`
+     progpath="$progdir/$progname"
+     ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+  s/$bs4/&\\
+/g
+  s/^$bs2$dollar/$bs&/
+  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+    # bash bug again:
+    :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information."  ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    my_directory_path="$1"
+    my_dir_list=
+
+    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+      # Protect directory names starting with `-'
+      case $my_directory_path in
+        -*) my_directory_path="./$my_directory_path" ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$my_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+	# list incase some portion of path contains whitespace.
+        my_dir_list="$my_directory_path:$my_dir_list"
+
+        # If the last portion added has no slash in it, the list is done
+        case $my_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+      done
+      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+      save_mkdir_p_IFS="$IFS"; IFS=':'
+      for my_dir in $my_dir_list; do
+	IFS="$save_mkdir_p_IFS"
+        # mkdir can fail with a `File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$my_dir" 2>/dev/null || :
+      done
+      IFS="$save_mkdir_p_IFS"
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$my_directory_path" || \
+        func_fatal_error "Failed to create \`$1'"
+    fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$opt_dry_run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+        save_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$my_tmpdir"
+        umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || \
+        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+    fi
+
+    $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+    case $1 in
+      *[\\\`\"\$]*)
+	func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+      *)
+        func_quote_for_eval_unquoted_result="$1" ;;
+    esac
+
+    case $func_quote_for_eval_unquoted_result in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and and variable
+      # expansion for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+    esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    case $1 in
+      *[\\\`\"]*)
+	my_arg=`$ECHO "$1" | $SED \
+	    -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        my_arg="$1" ;;
+    esac
+
+    case $my_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \	]*|*]*|"")
+        my_arg="\"$my_arg\""
+        ;;
+    esac
+
+    func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$my_cmd"
+      my_status=$?
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$lt_user_locale
+	    $my_cmd"
+      my_status=$?
+      eval "$lt_safe_locale"
+      if test "$my_status" -eq 0; then :; else
+	eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+  case $1 in
+  [0-9]* | *[!a-zA-Z0-9_]*)
+    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+    ;;
+  * )
+    func_tr_sh_result=$1
+    ;;
+  esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $opt_debug
+
+    $SED -n '/(C)/!b go
+	:more
+	/\./!{
+	  N
+	  s/\n# / /
+	  b more
+	}
+	:go
+	/^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //
+	s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
+     }' < "$progpath"
+     exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $opt_debug
+
+    $SED -n '/^# Usage:/,/^#  *.*--help/ {
+        s/^# //
+	s/^# *$//
+	s/\$progname/'$progname'/
+	p
+    }' < "$progpath"
+    echo
+    $ECHO "run \`$progname --help | more' for full usage"
+    exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+    $opt_debug
+
+    $SED -n '/^# Usage:/,/# Report bugs to/ {
+	:print
+        s/^# //
+	s/^# *$//
+	s*\$progname*'$progname'*
+	s*\$host*'"$host"'*
+	s*\$SHELL*'"$SHELL"'*
+	s*\$LTCC*'"$LTCC"'*
+	s*\$LTCFLAGS*'"$LTCFLAGS"'*
+	s*\$LD*'"$LD"'*
+	s/\$with_gnu_ld/'"$with_gnu_ld"'/
+	s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+	s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+	p
+	d
+     }
+     /^# .* home page:/b print
+     /^# General help using/b print
+     ' < "$progpath"
+    ret=$?
+    if test -z "$1"; then
+      exit $ret
+    fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    $opt_debug
+
+    func_error "missing argument for $1."
+    exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+    my_sed_long_arg='1s/^--[^=]*=//'
+
+    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+    eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+    func_quote_for_eval "${2}"
+    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+    func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func_error ${1+"$@"}
+    func_error "See the $PACKAGE documentation for more information."
+    func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
+
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+    done
+
+    exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+    echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      echo "enable shared libraries"
+    else
+      echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      echo "enable static libraries"
+    else
+      echo "disable static libraries"
+    fi
+
+    exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+  # Global variable:
+  tagname="$1"
+
+  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+  # Validate tagname.
+  case $tagname in
+    *[!-_A-Za-z0-9,/]*)
+      func_fatal_error "invalid tag name: $tagname"
+      ;;
+  esac
+
+  # Don't test for the "default" C tag, as we know it's
+  # there but not specially marked.
+  case $tagname in
+    CC) ;;
+    *)
+      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+	taglist="$taglist $tagname"
+
+	# Evaluate the configuration.  Be careful to quote the path
+	# and the sed script, to avoid splitting on whitespace, but
+	# also don't use non-portable quotes within backquotes within
+	# quotes we have to do it in 2 steps:
+	extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+	eval "$extractedcf"
+      else
+	func_error "ignoring unknown tag $tagname"
+      fi
+      ;;
+  esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      fi
+    else
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+    fi
+
+    exit $EXIT_MISMATCH
+  fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+  shift; set dummy --mode clean ${1+"$@"}; shift
+  ;;
+compile|compil|compi|comp|com|co|c)
+  shift; set dummy --mode compile ${1+"$@"}; shift
+  ;;
+execute|execut|execu|exec|exe|ex|e)
+  shift; set dummy --mode execute ${1+"$@"}; shift
+  ;;
+finish|finis|fini|fin|fi|f)
+  shift; set dummy --mode finish ${1+"$@"}; shift
+  ;;
+install|instal|insta|inst|ins|in|i)
+  shift; set dummy --mode install ${1+"$@"}; shift
+  ;;
+link|lin|li|l)
+  shift; set dummy --mode link ${1+"$@"}; shift
+  ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+  shift; set dummy --mode uninstall ${1+"$@"}; shift
+  ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly.  This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+  # this just eases exit handling
+  while test $# -gt 0; do
+    opt="$1"
+    shift
+    case $opt in
+      --debug|-x)	opt_debug='set -x'
+			func_echo "enabling shell trace mode"
+			$opt_debug
+			;;
+      --dry-run|--dryrun|-n)
+			opt_dry_run=:
+			;;
+      --config)
+			opt_config=:
+func_config
+			;;
+      --dlopen|-dlopen)
+			optarg="$1"
+			opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+			shift
+			;;
+      --preserve-dup-deps)
+			opt_preserve_dup_deps=:
+			;;
+      --features)
+			opt_features=:
+func_features
+			;;
+      --finish)
+			opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+			;;
+      --help)
+			opt_help=:
+			;;
+      --help-all)
+			opt_help_all=:
+opt_help=': help-all'
+			;;
+      --mode)
+			test $# = 0 && func_missing_arg $opt && break
+			optarg="$1"
+			opt_mode="$optarg"
+case $optarg in
+  # Valid mode arguments:
+  clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+  # Catch anything else as an error
+  *) func_error "invalid argument for $opt"
+     exit_cmd=exit
+     break
+     ;;
+esac
+			shift
+			;;
+      --no-silent|--no-quiet)
+			opt_silent=false
+func_append preserve_args " $opt"
+			;;
+      --no-warning|--no-warn)
+			opt_warning=false
+func_append preserve_args " $opt"
+			;;
+      --no-verbose)
+			opt_verbose=false
+func_append preserve_args " $opt"
+			;;
+      --silent|--quiet)
+			opt_silent=:
+func_append preserve_args " $opt"
+        opt_verbose=false
+			;;
+      --verbose|-v)
+			opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+			;;
+      --tag)
+			test $# = 0 && func_missing_arg $opt && break
+			optarg="$1"
+			opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+			shift
+			;;
+
+      -\?|-h)		func_usage				;;
+      --help)		func_help				;;
+      --version)	func_version				;;
+
+      # Separate optargs to long options:
+      --*=*)
+			func_split_long_opt "$opt"
+			set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+			shift
+			;;
+
+      # Separate non-argument short options:
+      -\?*|-h*|-n*|-v*)
+			func_split_short_opt "$opt"
+			set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+			shift
+			;;
+
+      --)		break					;;
+      -*)		func_fatal_help "unrecognized option \`$opt'" ;;
+      *)		set dummy "$opt" ${1+"$@"};	shift; break  ;;
+    esac
+  done
+
+  # Validate options:
+
+  # save first non-option argument
+  if test "$#" -gt 0; then
+    nonopt="$opt"
+    shift
+  fi
+
+  # preserve --debug
+  test "$opt_debug" = : || func_append preserve_args " --debug"
+
+  case $host in
+    *cygwin* | *mingw* | *pw32* | *cegcc*)
+      # don't eliminate duplications in $postdeps and $predeps
+      opt_duplicate_compiler_generated_deps=:
+      ;;
+    *)
+      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+      ;;
+  esac
+
+  $opt_help || {
+    # Sanity checks first:
+    func_check_version_match
+
+    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+      func_fatal_configuration "not configured to build any kind of library"
+    fi
+
+    # Darwin sucks
+    eval std_shrext=\"$shrext_cmds\"
+
+    # Only execute mode is allowed to have -dlopen flags.
+    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+      func_error "unrecognized option \`-dlopen'"
+      $ECHO "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Change the help message to a mode-specific one.
+    generic_help="$help"
+    help="Try \`$progname --help --mode=$opt_mode' for more information."
+  }
+
+
+  # Bail if the options were screwed
+  $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null \
+        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+	for lalib_p_l in 1 2 3 4
+	do
+	    read lalib_p_line
+	    case "$lalib_p_line" in
+		\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+	    esac
+	done
+	exec 0<&5 5<&-
+    fi
+    test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_dirname_and_basename "$1" "" "."
+    func_stripname '' '.exe' "$func_basename_result"
+    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $opt_debug
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$save_ifs
+      eval cmd=\"$cmd\"
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $opt_debug
+    case $1 in
+    */* | *\\*)	. "$1" ;;
+    *)		. "./$1" ;;
+    esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot.  Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+  func_resolve_sysroot_result=$1
+  case $func_resolve_sysroot_result in
+  =*)
+    func_stripname '=' '' "$func_resolve_sysroot_result"
+    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+    ;;
+  esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+  case "$lt_sysroot:$1" in
+  ?*:"$lt_sysroot"*)
+    func_stripname "$lt_sysroot" '' "$1"
+    func_replace_sysroot_result="=$func_stripname_result"
+    ;;
+  *)
+    # Including no sysroot.
+    func_replace_sysroot_result=$1
+    ;;
+  esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $opt_debug
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+	func_append_quoted CC_quoted "$arg"
+      done
+      CC_expanded=`func_echo_all $CC`
+      CC_quoted_expanded=`func_echo_all $CC_quoted`
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+	for z in $available_tags; do
+	  if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+	    # Evaluate the configuration.
+	    eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+	    CC_quoted=
+	    for arg in $CC; do
+	      # Double-quote args containing other shell metacharacters.
+	      func_append_quoted CC_quoted "$arg"
+	    done
+	    CC_expanded=`func_echo_all $CC`
+	    CC_quoted_expanded=`func_echo_all $CC_quoted`
+	    case "$@ " in
+	    " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+	    " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+	      # The compiler in the base compile command matches
+	      # the one in the tagged configuration.
+	      # Assume this is the tagged configuration we want.
+	      tagname=$z
+	      break
+	      ;;
+	    esac
+	  fi
+	done
+	# If $tagname still isn't set, then no tagged configuration
+	# was found and let the user know that the "--tag" command
+	# line option must be used.
+	if test -z "$tagname"; then
+	  func_echo "unable to infer tagged configuration"
+	  func_fatal_error "specify a tag with \`--tag'"
+#	else
+#	  func_verbose "using $tagname tagged configuration"
+	fi
+	;;
+      esac
+    fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=${1}
+    if test "$build_libtool_libs" = yes; then
+      write_lobj=\'${2}\'
+    else
+      write_lobj=none
+    fi
+
+    if test "$build_old_libs" = yes; then
+      write_oldobj=\'${3}\'
+    else
+      write_oldobj=none
+    fi
+
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+      $MV "${write_libobj}T" "${write_libobj}"
+    }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+  $opt_debug
+  func_convert_core_file_wine_to_w32_result="$1"
+  if test -n "$1"; then
+    # Unfortunately, winepath does not exit with a non-zero error code, so we
+    # are forced to check the contents of stdout. On the other hand, if the
+    # command is not found, the shell will set an exit code of 127 and print
+    # *an error message* to stdout. So we must check for both error code of
+    # zero AND non-empty stdout, which explains the odd construction:
+    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+        $SED -e "$lt_sed_naive_backslashify"`
+    else
+      func_convert_core_file_wine_to_w32_result=
+    fi
+  fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+  $opt_debug
+  # unfortunately, winepath doesn't convert paths, only file names
+  func_convert_core_path_wine_to_w32_result=""
+  if test -n "$1"; then
+    oldIFS=$IFS
+    IFS=:
+    for func_convert_core_path_wine_to_w32_f in $1; do
+      IFS=$oldIFS
+      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+        if test -z "$func_convert_core_path_wine_to_w32_result"; then
+          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+        else
+          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+        fi
+      fi
+    done
+    IFS=$oldIFS
+  fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+  $opt_debug
+  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+    if test "$?" -ne 0; then
+      # on failure, ensure result is empty
+      func_cygpath_result=
+    fi
+  else
+    func_cygpath_result=
+    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+  fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format.  Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+  $opt_debug
+  # awkward: cmd appends spaces to result
+  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+  $opt_debug
+  if test -z "$2" && test -n "$1" ; then
+    func_error "Could not determine host file name corresponding to"
+    func_error "  \`$1'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback:
+    func_to_host_file_result="$1"
+  fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+  $opt_debug
+  if test -z "$4" && test -n "$3"; then
+    func_error "Could not determine the host path corresponding to"
+    func_error "  \`$3'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback.  This is a deliberately simplistic "conversion" and
+    # should not be "improved".  See libtool.info.
+    if test "x$1" != "x$2"; then
+      lt_replace_pathsep_chars="s|$1|$2|g"
+      func_to_host_path_result=`echo "$3" |
+        $SED -e "$lt_replace_pathsep_chars"`
+    else
+      func_to_host_path_result="$3"
+    fi
+  fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+  $opt_debug
+  case $4 in
+  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+    ;;
+  esac
+  case $4 in
+  $2 ) func_append func_to_host_path_result "$3"
+    ;;
+  esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+  $opt_debug
+  $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result.  If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+  $opt_debug
+  case ,$2, in
+    *,"$to_tool_file_cmd",*)
+      func_to_tool_file_result=$1
+      ;;
+    *)
+      $to_tool_file_cmd "$1"
+      func_to_tool_file_result=$func_to_host_file_result
+      ;;
+  esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+  func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+    # LT_CYGPATH in this case.
+    func_to_host_file_result=`cygpath -m "$1"`
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format.  Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_file_wine_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+    func_convert_core_file_wine_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format.  If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+#   file name conversion function    : func_convert_file_X_to_Y ()
+#   path conversion function         : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same.  If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+  $opt_debug
+  if test -z "$to_host_path_cmd"; then
+    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+  fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+  $opt_debug
+  func_init_to_host_path_cmd
+  $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+  func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from ARG.  MSYS
+    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+    # and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format.  Requires a wine environment and
+# a working winepath.  Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from
+    # ARG. msys behavior is inconsistent here, cygpath turns them
+    # into '.;' and ';.', and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $opt_debug
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+    pie_flag=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+	# do not "continue".  Instead, add this to base_compile
+	lastarg="$arg"
+	arg_mode=normal
+	;;
+
+      target )
+	libobj="$arg"
+	arg_mode=normal
+	continue
+	;;
+
+      normal )
+	# Accept any command-line options.
+	case $arg in
+	-o)
+	  test -n "$libobj" && \
+	    func_fatal_error "you cannot specify \`-o' more than once"
+	  arg_mode=target
+	  continue
+	  ;;
+
+	-pie | -fpie | -fPIE)
+          func_append pie_flag " $arg"
+	  continue
+	  ;;
+
+	-shared | -static | -prefer-pic | -prefer-non-pic)
+	  func_append later " $arg"
+	  continue
+	  ;;
+
+	-no-suppress)
+	  suppress_opt=no
+	  continue
+	  ;;
+
+	-Xcompiler)
+	  arg_mode=arg  #  the next one goes into the "base_compile" arg list
+	  continue      #  The current "srcfile" will either be retained or
+	  ;;            #  replaced later.  I would guess that would be a bug.
+
+	-Wc,*)
+	  func_stripname '-Wc,' '' "$arg"
+	  args=$func_stripname_result
+	  lastarg=
+	  save_ifs="$IFS"; IFS=','
+	  for arg in $args; do
+	    IFS="$save_ifs"
+	    func_append_quoted lastarg "$arg"
+	  done
+	  IFS="$save_ifs"
+	  func_stripname ' ' '' "$lastarg"
+	  lastarg=$func_stripname_result
+
+	  # Add the arguments to base_compile.
+	  func_append base_compile " $lastarg"
+	  continue
+	  ;;
+
+	*)
+	  # Accept the current argument as the source file.
+	  # The previous "srcfile" becomes the current argument.
+	  #
+	  lastarg="$srcfile"
+	  srcfile="$arg"
+	  ;;
+	esac  #  case $arg
+	;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      func_append_quoted base_compile "$lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      func_fatal_error "you must specify an argument for -Xcompile"
+      ;;
+    target)
+      func_fatal_error "you must specify a target with \`-o'"
+      ;;
+    *)
+      # Get the name of the library object.
+      test -z "$libobj" && {
+	func_basename "$srcfile"
+	libobj="$func_basename_result"
+      }
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    case $libobj in
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
+    esac
+
+    case $libobj in
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+    *)
+      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	continue
+	;;
+
+      -static)
+	build_libtool_libs=no
+	build_old_libs=yes
+	continue
+	;;
+
+      -prefer-pic)
+	pic_mode=yes
+	continue
+	;;
+
+      -prefer-non-pic)
+	pic_mode=no
+	continue
+	;;
+      esac
+    done
+
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'	 &()|`$[]' \
+      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname="$func_basename_result"
+    xdir="$func_dirname_result"
+    lobj=${xdir}$objdir/$objname
+
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+	$ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+      func_append removelist " $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
+    fi
+
+    $opt_dry_run || $RM $removelist
+    func_append removelist " $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+    srcfile=$func_to_tool_file_result
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+	command="$base_compile $qsrcfile $pic_flag"
+      else
+	# Don't build PIC code
+	command="$base_compile $qsrcfile"
+      fi
+
+      func_mkdir_p "$xdir$objdir"
+
+      if test -z "$output_obj"; then
+	# Place PIC objects in $objdir
+	func_append command " -o $lobj"
+      fi
+
+      func_show_eval_locale "$command"	\
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+	func_show_eval '$MV "$output_obj" "$lobj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+	suppress_output=' >/dev/null 2>&1'
+      fi
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+	# Don't build PIC code
+	command="$base_compile $qsrcfile$pie_flag"
+      else
+	command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+	func_append command " -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      func_append command "$suppress_output"
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+	 test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+	$ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+	$opt_dry_run || $RM $removelist
+	exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+	func_show_eval '$MV "$output_obj" "$obj"' \
+	  'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
+
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+      # Unlock the critical section if it was locked
+      if test "$need_locks" != no; then
+	removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $opt_mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
+
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to build PIC objects only
+  -prefer-non-pic   try to build non-PIC objects only
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
+  -Wc,FLAG          pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+        ;;
+
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
+
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+        ;;
+
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -bindir BINDIR    specify path to binaries directory (for systems where
+                    libraries must be found in the PATH setting at runtime)
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+  -Wc,FLAG
+  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
+  -Wl,FLAG
+  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
+  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode \`$opt_mode'"
+        ;;
+    esac
+
+    echo
+    $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+  if test "$opt_help" = :; then
+    func_mode_help
+  else
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	func_mode_help
+      done
+    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+	echo
+	func_mode_help
+      done
+    } |
+    sed '1d
+      /^When reporting/,/^Report/{
+	H
+	d
+      }
+      $x
+      /information about other modes/d
+      /more detailed .*MODE/d
+      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+  fi
+  exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $opt_debug
+    # The first argument is the command name.
+    cmd="$nonopt"
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $opt_dlopen; do
+      test -f "$file" \
+	|| func_fatal_help "\`$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+	# Read the libtool library.
+	dlname=
+	library_names=
+	func_source "$file"
+
+	# Skip this library if it cannot be dlopened.
+	if test -z "$dlname"; then
+	  # Warn if it was a shared library.
+	  test -n "$library_names" && \
+	    func_warning "\`$file' was not linked with \`-export-dynamic'"
+	  continue
+	fi
+
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+
+	if test -f "$dir/$objdir/$dlname"; then
+	  func_append dir "/$objdir"
+	else
+	  if test ! -f "$dir/$dlname"; then
+	    func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+	  fi
+	fi
+	;;
+
+      *.lo)
+	# Just add the directory containing the .lo file.
+	func_dirname "$file" "" "."
+	dir="$func_dirname_result"
+	;;
+
+      *)
+	func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+	continue
+	;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+	eval "$shlibpath_var=\"\$dir\""
+      else
+	eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -* | *.la | *.lo ) ;;
+      *)
+	# Do a test to see if this is really a libtool program.
+	if func_ltwrapper_script_p "$file"; then
+	  func_source "$file"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	elif func_ltwrapper_executable_p "$file"; then
+	  func_ltwrapper_scriptname "$file"
+	  func_source "$func_ltwrapper_scriptname_result"
+	  # Transform arg to wrapped name.
+	  file="$progdir/$program"
+	fi
+	;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_append_quoted args "$file"
+    done
+
+    if test "X$opt_dry_run" = Xfalse; then
+      if test -n "$shlibpath_var"; then
+	# Export the shlibpath_var.
+	eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+	eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+	      else
+		$lt_unset $lt_var
+	      fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+	eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+	echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $opt_debug
+    libs=
+    libdirs=
+    admincmds=
+
+    for opt in "$nonopt" ${1+"$@"}
+    do
+      if test -d "$opt"; then
+	func_append libdirs " $opt"
+
+      elif test -f "$opt"; then
+	if func_lalib_unsafe_p "$opt"; then
+	  func_append libs " $opt"
+	else
+	  func_warning "\`$opt' is not a valid libtool archive"
+	fi
+
+      else
+	func_fatal_error "invalid argument \`$opt'"
+      fi
+    done
+
+    if test -n "$libs"; then
+      if test -n "$lt_sysroot"; then
+        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+      else
+        sysroot_cmd=
+      fi
+
+      # Remove sysroot references
+      if $opt_dry_run; then
+        for lib in $libs; do
+          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+        done
+      else
+        tmpdir=`func_mktempdir`
+        for lib in $libs; do
+	  sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+	    > $tmpdir/tmp-la
+	  mv -f $tmpdir/tmp-la $lib
+	done
+        ${RM}r "$tmpdir"
+      fi
+    fi
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for libdir in $libdirs; do
+	if test -n "$finish_cmds"; then
+	  # Do each command in the finish commands.
+	  func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+	fi
+	if test -n "$finish_eval"; then
+	  # Do the single finish_eval.
+	  eval cmds=\"$finish_eval\"
+	  $opt_dry_run || eval "$cmds" || func_append admincmds "
+       $cmds"
+	fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    $opt_silent && exit $EXIT_SUCCESS
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      echo "----------------------------------------------------------------------"
+      echo "Libraries have been installed in:"
+      for libdir in $libdirs; do
+	$ECHO "   $libdir"
+      done
+      echo
+      echo "If you ever happen to want to link against installed libraries"
+      echo "in a given directory, LIBDIR, you must either use libtool, and"
+      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "flag during linking and do at least one of the following:"
+      if test -n "$shlibpath_var"; then
+	echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+	echo "     during execution"
+      fi
+      if test -n "$runpath_var"; then
+	echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+	echo "     during linking"
+      fi
+      if test -n "$hardcode_libdir_flag_spec"; then
+	libdir=LIBDIR
+	eval flag=\"$hardcode_libdir_flag_spec\"
+
+	$ECHO "   - use the \`$flag' linker flag"
+      fi
+      if test -n "$admincmds"; then
+	$ECHO "   - have your system administrator run these commands:$admincmds"
+      fi
+      if test -f /etc/ld.so.conf; then
+	echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+      fi
+      echo
+
+      echo "See any operating system documentation about shared libraries for"
+      case $host in
+	solaris2.[6789]|solaris2.1[0-9])
+	  echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+	  echo "pages."
+	  ;;
+	*)
+	  echo "more information, such as the ld(1) and ld.so(8) manual pages."
+	  ;;
+      esac
+      echo "----------------------------------------------------------------------"
+    fi
+    exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $opt_debug
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       case $nonopt in *shtool*) :;; *) false;; esac; then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    func_append install_prog "$func_quote_for_eval_result"
+    install_shared_prog=$install_prog
+    case " $install_prog " in
+      *[\\\ /]cp\ *) install_cp=: ;;
+      *) install_cp=false ;;
+    esac
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    no_mode=:
+    for arg
+    do
+      arg2=
+      if test -n "$dest"; then
+	func_append files " $dest"
+	dest=$arg
+	continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f)
+	if $install_cp; then :; else
+	  prev=$arg
+	fi
+	;;
+      -g | -m | -o)
+	prev=$arg
+	;;
+      -s)
+	stripme=" -s"
+	continue
+	;;
+      -*)
+	;;
+      *)
+	# If the previous option needed an argument, then skip it.
+	if test -n "$prev"; then
+	  if test "x$prev" = x-m && test -n "$install_override_mode"; then
+	    arg2=$install_override_mode
+	    no_mode=false
+	  fi
+	  prev=
+	else
+	  dest=$arg
+	  continue
+	fi
+	;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      func_append install_prog " $func_quote_for_eval_result"
+      if test -n "$arg2"; then
+	func_quote_for_eval "$arg2"
+      fi
+      func_append install_shared_prog " $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prev' option requires an argument"
+
+    if test -n "$install_override_mode" && $no_mode; then
+      if $install_cp; then :; else
+	func_quote_for_eval "$install_override_mode"
+	func_append install_shared_prog " -m $func_quote_for_eval_result"
+      fi
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+	func_fatal_help "no file or destination specified"
+      else
+	func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir="$func_dirname_result"
+      destname="$func_basename_result"
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+	func_fatal_help "\`$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+	case $file in
+	*.lo) ;;
+	*)
+	  func_fatal_help "\`$destdir' must be an absolute directory name"
+	  ;;
+	esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+	# Do the static libraries later.
+	func_append staticlibs " $file"
+	;;
+
+      *.la)
+	func_resolve_sysroot "$file"
+	file=$func_resolve_sysroot_result
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$file" \
+	  || func_fatal_help "\`$file' is not a valid libtool archive"
+
+	library_names=
+	old_library=
+	relink_command=
+	func_source "$file"
+
+	# Add the libdir to current_libdirs if it is the destination.
+	if test "X$destdir" = "X$libdir"; then
+	  case "$current_libdirs " in
+	  *" $libdir "*) ;;
+	  *) func_append current_libdirs " $libdir" ;;
+	  esac
+	else
+	  # Note the libdir as a future libdir.
+	  case "$future_libdirs " in
+	  *" $libdir "*) ;;
+	  *) func_append future_libdirs " $libdir" ;;
+	  esac
+	fi
+
+	func_dirname "$file" "/" ""
+	dir="$func_dirname_result"
+	func_append dir "$objdir"
+
+	if test -n "$relink_command"; then
+	  # Determine the prefix the user has applied to our future dir.
+	  inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+	  # Don't allow the user to place us outside of our expected
+	  # location b/c this prevents finding dependent libraries that
+	  # are installed to the same prefix.
+	  # At present, this check doesn't affect windows .dll's that
+	  # are installed into $libdir/../bin (currently, that works fine)
+	  # but it's something to keep an eye on.
+	  test "$inst_prefix_dir" = "$destdir" && \
+	    func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+	  if test -n "$inst_prefix_dir"; then
+	    # Stick the inst_prefix_dir data into the link command.
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+	  else
+	    relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+	  fi
+
+	  func_warning "relinking \`$file'"
+	  func_show_eval "$relink_command" \
+	    'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+	fi
+
+	# See the names of the shared library.
+	set dummy $library_names; shift
+	if test -n "$1"; then
+	  realname="$1"
+	  shift
+
+	  srcname="$realname"
+	  test -n "$relink_command" && srcname="$realname"T
+
+	  # Install the shared library and build the symlinks.
+	  func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+	      'exit $?'
+	  tstripme="$stripme"
+	  case $host_os in
+	  cygwin* | mingw* | pw32* | cegcc*)
+	    case $realname in
+	    *.dll.a)
+	      tstripme=""
+	      ;;
+	    esac
+	    ;;
+	  esac
+	  if test -n "$tstripme" && test -n "$striplib"; then
+	    func_show_eval "$striplib $destdir/$realname" 'exit $?'
+	  fi
+
+	  if test "$#" -gt 0; then
+	    # Delete the old symlinks, and create new ones.
+	    # Try `ln -sf' first, because the `ln' binary might depend on
+	    # the symlink we replace!  Solaris /bin/ln does not understand -f,
+	    # so we also need to try rm && ln -s.
+	    for linkname
+	    do
+	      test "$linkname" != "$realname" \
+		&& func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+	    done
+	  fi
+
+	  # Do each command in the postinstall commands.
+	  lib="$destdir/$realname"
+	  func_execute_cmds "$postinstall_cmds" 'exit $?'
+	fi
+
+	# Install the pseudo-library for information purposes.
+	func_basename "$file"
+	name="$func_basename_result"
+	instname="$dir/$name"i
+	func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+	# Maybe install the static library, too.
+	test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+	;;
+
+      *.lo)
+	# Install (i.e. copy) a libtool object.
+
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# Deduce the name of the destination old-style object file.
+	case $destfile in
+	*.lo)
+	  func_lo2o "$destfile"
+	  staticdest=$func_lo2o_result
+	  ;;
+	*.$objext)
+	  staticdest="$destfile"
+	  destfile=
+	  ;;
+	*)
+	  func_fatal_help "cannot copy a libtool object to \`$destfile'"
+	  ;;
+	esac
+
+	# Install the libtool object if requested.
+	test -n "$destfile" && \
+	  func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+	# Install the old object if enabled.
+	if test "$build_old_libs" = yes; then
+	  # Deduce the name of the old-style object file.
+	  func_lo2o "$file"
+	  staticobj=$func_lo2o_result
+	  func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+	fi
+	exit $EXIT_SUCCESS
+	;;
+
+      *)
+	# Figure out destination file name, if it wasn't already specified.
+	if test -n "$destname"; then
+	  destfile="$destdir/$destname"
+	else
+	  func_basename "$file"
+	  destfile="$func_basename_result"
+	  destfile="$destdir/$destfile"
+	fi
+
+	# If the file is missing, and there is a .exe on the end, strip it
+	# because it is most likely a libtool script we actually want to
+	# install
+	stripped_ext=""
+	case $file in
+	  *.exe)
+	    if test ! -f "$file"; then
+	      func_stripname '' '.exe' "$file"
+	      file=$func_stripname_result
+	      stripped_ext=".exe"
+	    fi
+	    ;;
+	esac
+
+	# Do a test to see if this is really a libtool program.
+	case $host in
+	*cygwin* | *mingw*)
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      wrapper=$func_ltwrapper_scriptname_result
+	    else
+	      func_stripname '' '.exe' "$file"
+	      wrapper=$func_stripname_result
+	    fi
+	    ;;
+	*)
+	    wrapper=$file
+	    ;;
+	esac
+	if func_ltwrapper_script_p "$wrapper"; then
+	  notinst_deplibs=
+	  relink_command=
+
+	  func_source "$wrapper"
+
+	  # Check the variables that should have been set.
+	  test -z "$generated_by_libtool_version" && \
+	    func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+	  finalize=yes
+	  for lib in $notinst_deplibs; do
+	    # Check to see that each library is installed.
+	    libdir=
+	    if test -f "$lib"; then
+	      func_source "$lib"
+	    fi
+	    libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+	    if test -n "$libdir" && test ! -f "$libfile"; then
+	      func_warning "\`$lib' has not been installed in \`$libdir'"
+	      finalize=no
+	    fi
+	  done
+
+	  relink_command=
+	  func_source "$wrapper"
+
+	  outputname=
+	  if test "$fast_install" = no && test -n "$relink_command"; then
+	    $opt_dry_run || {
+	      if test "$finalize" = yes; then
+	        tmpdir=`func_mktempdir`
+		func_basename "$file$stripped_ext"
+		file="$func_basename_result"
+	        outputname="$tmpdir/$file"
+	        # Replace the output file specification.
+	        relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+	        $opt_silent || {
+	          func_quote_for_expand "$relink_command"
+		  eval "func_echo $func_quote_for_expand_result"
+	        }
+	        if eval "$relink_command"; then :
+	          else
+		  func_error "error: relink \`$file' with the above command before installing it"
+		  $opt_dry_run || ${RM}r "$tmpdir"
+		  continue
+	        fi
+	        file="$outputname"
+	      else
+	        func_warning "cannot relink \`$file'"
+	      fi
+	    }
+	  else
+	    # Install the binary that we compiled earlier.
+	    file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+	  fi
+	fi
+
+	# remove .exe since cygwin /usr/bin/install will append another
+	# one anyway
+	case $install_prog,$host in
+	*/usr/bin/install*,*cygwin*)
+	  case $file:$destfile in
+	  *.exe:*.exe)
+	    # this is ok
+	    ;;
+	  *.exe:*)
+	    destfile=$destfile.exe
+	    ;;
+	  *:*.exe)
+	    func_stripname '' '.exe' "$destfile"
+	    destfile=$func_stripname_result
+	    ;;
+	  esac
+	  ;;
+	esac
+	func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+	$opt_dry_run || if test -n "$outputname"; then
+	  ${RM}r "$tmpdir"
+	fi
+	;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name="$func_basename_result"
+
+      # Set up the ranlib parameters.
+      oldlib="$destdir/$name"
+      func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+      tool_oldlib=$func_to_tool_file_result
+
+      func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
+
+      if test -n "$stripme" && test -n "$old_striplib"; then
+	func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $opt_debug
+    my_outputname="$1"
+    my_originator="$2"
+    my_pic_p="${3-no}"
+    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+	my_dlsyms="${my_outputname}S.c"
+      else
+	func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+	# Discover the nlist of each of the dlfiles.
+	nlist="$output_objdir/${my_outputname}.nm"
+
+	func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+	# Parse the name list into a source file.
+	func_verbose "creating $output_objdir/$my_dlsyms"
+
+	$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+	if test "$dlself" = yes; then
+	  func_verbose "generating symbol list for \`$output'"
+
+	  $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+	  # Add our own program objects to the symbol list.
+	  progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	  for progfile in $progfiles; do
+	    func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+	    func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+	    $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+	  done
+
+	  if test -n "$exclude_expsyms"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  if test -n "$export_symbols_regex"; then
+	    $opt_dry_run || {
+	      eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	    }
+	  fi
+
+	  # Prepare the list of exported symbols
+	  if test -z "$export_symbols"; then
+	    export_symbols="$output_objdir/$outputname.exp"
+	    $opt_dry_run || {
+	      $RM $export_symbols
+	      eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+	      case $host in
+	      *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+	        ;;
+	      esac
+	    }
+	  else
+	    $opt_dry_run || {
+	      eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+	      eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+	      eval '$MV "$nlist"T "$nlist"'
+	      case $host in
+	        *cygwin* | *mingw* | *cegcc* )
+	          eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+	          eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+	          ;;
+	      esac
+	    }
+	  fi
+	fi
+
+	for dlprefile in $dlprefiles; do
+	  func_verbose "extracting global C symbols from \`$dlprefile'"
+	  func_basename "$dlprefile"
+	  name="$func_basename_result"
+          case $host in
+	    *cygwin* | *mingw* | *cegcc* )
+	      # if an import library, we need to obtain dlname
+	      if func_win32_import_lib_p "$dlprefile"; then
+	        func_tr_sh "$dlprefile"
+	        eval "curr_lafile=\$libfile_$func_tr_sh_result"
+	        dlprefile_dlbasename=""
+	        if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+	          # Use subshell, to avoid clobbering current variable values
+	          dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+	          if test -n "$dlprefile_dlname" ; then
+	            func_basename "$dlprefile_dlname"
+	            dlprefile_dlbasename="$func_basename_result"
+	          else
+	            # no lafile. user explicitly requested -dlpreopen <import library>.
+	            $sharedlib_from_linklib_cmd "$dlprefile"
+	            dlprefile_dlbasename=$sharedlib_from_linklib_result
+	          fi
+	        fi
+	        $opt_dry_run || {
+	          if test -n "$dlprefile_dlbasename" ; then
+	            eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+	          else
+	            func_warning "Could not compute DLL name from $name"
+	            eval '$ECHO ": $name " >> "$nlist"'
+	          fi
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+	            $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+	        }
+	      else # not an import lib
+	        $opt_dry_run || {
+	          eval '$ECHO ": $name " >> "$nlist"'
+	          func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	          eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	        }
+	      fi
+	    ;;
+	    *)
+	      $opt_dry_run || {
+	        eval '$ECHO ": $name " >> "$nlist"'
+	        func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+	        eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+	      }
+	    ;;
+          esac
+	done
+
+	$opt_dry_run || {
+	  # Make sure we have at least an empty file.
+	  test -f "$nlist" || : > "$nlist"
+
+	  if test -n "$exclude_expsyms"; then
+	    $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+	    $MV "$nlist"T "$nlist"
+	  fi
+
+	  # Try sorting and uniquifying the output.
+	  if $GREP -v "^: " < "$nlist" |
+	      if sort -k 3 </dev/null >/dev/null 2>&1; then
+		sort -k 3
+	      else
+		sort +2
+	      fi |
+	      uniq > "$nlist"S; then
+	    :
+	  else
+	    $GREP -v "^: " < "$nlist" > "$nlist"S
+	  fi
+
+	  if test -f "$nlist"S; then
+	    eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+	  else
+	    echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+	  fi
+
+	  echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+  { \"$my_originator\", (void *) 0 },"
+
+	  case $need_lib_prefix in
+	  no)
+	    eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  *)
+	    eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+	    ;;
+	  esac
+	  echo >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+	} # !$opt_dry_run
+
+	pic_flag_for_symtable=
+	case "$compile_command " in
+	*" -static "*) ;;
+	*)
+	  case $host in
+	  # compiling the symbol table file with pic_flag works around
+	  # a FreeBSD bug that causes programs to crash when -lm is
+	  # linked before any other PIC object.  But we must not use
+	  # pic_flag when linking with -static.  The problem exists in
+	  # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
+	  *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+	    pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+	  *-*-hpux*)
+	    pic_flag_for_symtable=" $pic_flag"  ;;
+	  *)
+	    if test "X$my_pic_p" != Xno; then
+	      pic_flag_for_symtable=" $pic_flag"
+	    fi
+	    ;;
+	  esac
+	  ;;
+	esac
+	symtab_cflags=
+	for arg in $LTCFLAGS; do
+	  case $arg in
+	  -pie | -fpie | -fPIE) ;;
+	  *) func_append symtab_cflags " $arg" ;;
+	  esac
+	done
+
+	# Now compile the dynamic symbol file.
+	func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+	# Clean up the generated files.
+	func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+	# Transform the symbol file into the correct name.
+	symfileobj="$output_objdir/${my_outputname}S.$objext"
+	case $host in
+	*cygwin* | *mingw* | *cegcc* )
+	  if test -f "$output_objdir/$my_outputname.def"; then
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+	  else
+	    compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	    finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  fi
+	  ;;
+	*)
+	  compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+	  ;;
+	esac
+	;;
+      *)
+	func_fatal_error "unknown suffix for \`$my_dlsyms'"
+	;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+  $opt_debug
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+      func_to_tool_file "$1" func_convert_file_msys_to_w32
+      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+	$SED -n -e '
+	    1,100{
+		/ I /{
+		    s,.*,import,
+		    p
+		    q
+		}
+	    }'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+  $opt_debug
+  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+  $opt_debug
+  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+    $SED '/^Contents of section '"$match_literal"':/{
+      # Place marker at beginning of archive member dllname section
+      s/.*/====MARK====/
+      p
+      d
+    }
+    # These lines can sometimes be longer than 43 characters, but
+    # are always uninteresting
+    /:[	 ]*file format pe[i]\{,1\}-/d
+    /^In archive [^:]*:/d
+    # Ensure marker is printed
+    /^====MARK====/p
+    # Remove all lines with less than 43 characters
+    /^.\{43\}/!d
+    # From remaining lines, remove first 43 characters
+    s/^.\{43\}//' |
+    $SED -n '
+      # Join marker and all lines until next marker into a single line
+      /^====MARK====/ b para
+      H
+      $ b para
+      b
+      :para
+      x
+      s/\n//g
+      # Remove the marker
+      s/^====MARK====//
+      # Remove trailing dots and whitespace
+      s/[\. \t]*$//
+      # Print
+      /./p' |
+    # we now have a list, one entry per line, of the stringified
+    # contents of the appropriate section of all members of the
+    # archive which possess that section. Heuristic: eliminate
+    # all those which have a first or second character that is
+    # a '.' (that is, objdump's representation of an unprintable
+    # character.) This should work for all archives with less than
+    # 0x302f exports -- but will fail for DLLs whose name actually
+    # begins with a literal '.' or a single character followed by
+    # a '.'.
+    #
+    # Of those that remain, print the first one.
+    $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+  $opt_debug
+  if func_cygming_gnu_implib_p "$1" ; then
+    # binutils import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+  elif func_cygming_ms_implib_p "$1" ; then
+    # ms-generated import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+  else
+    # unknown
+    sharedlib_from_linklib_result=""
+  fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $opt_debug
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    if test "$lock_old_archive_extraction" = yes; then
+      lockfile=$f_ex_an_ar_oldlib.lock
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+	func_echo "Waiting for $lockfile to be removed"
+	sleep 2
+      done
+    fi
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+		   'stat=$?; rm -f "$lockfile"; exit $stat'
+    if test "$lock_old_archive_extraction" = yes; then
+      $opt_dry_run || rm -f "$lockfile"
+    fi
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $opt_debug
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+	[\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+	*) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib="$func_basename_result"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+	*" $my_xlib_u "*)
+	  func_arith $extracted_serial + 1
+	  extracted_serial=$func_arith_result
+	  my_xlib_u=lt$extracted_serial-$my_xlib ;;
+	*) break ;;
+	esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+	func_verbose "Extracting $my_xabs"
+	# Do not bother doing anything if just a dry run
+	$opt_dry_run || {
+	  darwin_orig_dir=`pwd`
+	  cd $my_xdir || exit $?
+	  darwin_archive=$my_xabs
+	  darwin_curdir=`pwd`
+	  darwin_base_archive=`basename "$darwin_archive"`
+	  darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+	  if test -n "$darwin_arches"; then
+	    darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+	    darwin_arch=
+	    func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+	    for darwin_arch in  $darwin_arches ; do
+	      func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+	      cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+	      func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+	      cd "$darwin_curdir"
+	      $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+	    done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+	    darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+	    darwin_file=
+	    darwin_files=
+	    for darwin_file in $darwin_filelist; do
+	      darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+	      $LIPO -create -output "$darwin_file" $darwin_files
+	    done # $darwin_filelist
+	    $RM -rf unfat-$$
+	    cd "$darwin_orig_dir"
+	  else
+	    cd $darwin_orig_dir
+	    func_extract_an_archive "$my_xdir" "$my_xabs"
+	  fi # $darwin_arches
+	} # !$opt_dry_run
+	;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+	;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+    done
+
+    func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+	func_emit_wrapper_arg1=${1-no}
+
+	$ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    file=\"\$0\""
+
+    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+    ECHO=\"$qECHO\"
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=\$0
+  shift
+  for lt_opt
+  do
+    case \"\$lt_opt\" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+        cat \"\$lt_dump_D/\$lt_dump_F\"
+        exit 0
+      ;;
+    --lt-*)
+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n \"\$lt_option_debug\"; then
+    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  case \" \$* \" in
+  *\\ --lt-*)
+    for lt_wr_arg
+    do
+      case \$lt_wr_arg in
+      --lt-*) ;;
+      *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+      esac
+      shift
+    done ;;
+  esac
+  func_exec_program_core \${1+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+  done
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+	if test "$fast_install" = yes; then
+	  $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+	  $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+	$ECHO \"\$relink_command_output\" >&2
+	$RM \"\$progdir/\$file\"
+	exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+	else
+	  $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+	fi
+
+	$ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+	# fixup the dll searchpath if we need to.
+	#
+	# Fix the DLL searchpath if we need to.  Do this before prepending
+	# to shlibpath, because on Windows, both are PATH and uninstalled
+	# libraries must come first.
+	if test -n "$dllsearchpath"; then
+	  $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+	fi
+
+	# Export our shlibpath_var if we have one.
+	if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+	  $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+	fi
+
+	$ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+      func_exec_program \${1+\"\$@\"}
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+	cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+*/
+EOF
+	    cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+#  define _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+	(((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+	    cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+	    if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_path "$temp_rpath"
+	      cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test -n "$dllsearchpath"; then
+              func_to_host_path "$dllsearchpath:"
+	      cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+	    else
+	      cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+	    fi
+
+	    if test "$fast_install" = yes; then
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+	    else
+	      cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+	    fi
+
+
+	    cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  intptr_t rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  newargz = XMALLOC (char *, argc + 1);
+
+  /* very simple arg parsing; don't want to rely on getopt
+   * also, copy all non cwrapper options to newargz, except
+   * argz[0], which is handled differently
+   */
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (strcmp (argv[i], dumpscript_opt) == 0)
+	{
+EOF
+	    case "$host" in
+	      *mingw* | *cygwin* )
+		# make stdout use "unix" line endings
+		echo "          setmode(1,_O_BINARY);"
+		;;
+	      esac
+
+	    cat <<"EOF"
+	  lt_dump_script (stdout);
+	  return 0;
+	}
+      if (strcmp (argv[i], debug_opt) == 0)
+	{
+          lt_debug = 1;
+          continue;
+	}
+      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal (__FILE__, __LINE__,
+		    "unrecognized %s option: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+EOF
+	    cat <<EOF
+  /* The GNU banner must be the first non-error debug message */
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+	    cat <<"EOF"
+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (before symlink chase) at: %s\n",
+		  tmp_pathspec);
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (after symlink chase) at: %s\n",
+		  actual_cwrapper_path);
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(main) libtool target name: %s\n",
+		  target_name);
+EOF
+
+	    cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+		    strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+	    cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+	    case $host_os in
+	      mingw*)
+	    cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+	*p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+	*p = '/';
+      }
+  }
+EOF
+	    ;;
+	    esac
+
+	    cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
+     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+     because on Windows, both *_VARNAMEs are PATH but uninstalled
+     libraries must come first. */
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+		  nonnull (lt_argv_zero));
+  for (i = 0; i < newargc; i++)
+    {
+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+		      i, nonnull (newargz[i]));
+    }
+
+EOF
+
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  newargz = prepare_spawn (newargz);
+  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      lt_debugprintf (__FILE__, __LINE__,
+		      "(main) failed to launch target \"%s\": %s\n",
+		      lt_argv_zero, nonnull (strerror (errno)));
+      return 127;
+    }
+  return rval;
+EOF
+		;;
+	      *)
+		cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+		;;
+	    esac
+
+	    cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+			  string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char *concat_name;
+
+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+                  nonempty (wrapper));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+	return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+	{
+	  concat_name = xstrdup (wrapper);
+	  if (check_executable (concat_name))
+	    return concat_name;
+	  XFREE (concat_name);
+	}
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+	has_slash = 1;
+	break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+	{
+	  for (p = path; *p; p = p_next)
+	    {
+	      const char *q;
+	      size_t p_len;
+	      for (q = p; *q; q++)
+		if (IS_PATH_SEPARATOR (*q))
+		  break;
+	      p_len = q - p;
+	      p_next = (*q == '\0' ? q : q + 1);
+	      if (p_len == 0)
+		{
+		  /* empty path: current directory */
+		  if (getcwd (tmp, LT_PATHMAX) == NULL)
+		    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+                              nonnull (strerror (errno)));
+		  tmp_len = strlen (tmp);
+		  concat_name =
+		    XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, tmp, tmp_len);
+		  concat_name[tmp_len] = '/';
+		  strcpy (concat_name + tmp_len + 1, wrapper);
+		}
+	      else
+		{
+		  concat_name =
+		    XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+		  memcpy (concat_name, p, p_len);
+		  concat_name[p_len] = '/';
+		  strcpy (concat_name + p_len + 1, wrapper);
+		}
+	      if (check_executable (concat_name))
+		return concat_name;
+	      XFREE (concat_name);
+	    }
+	}
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+              nonnull (strerror (errno)));
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      lt_debugprintf (__FILE__, __LINE__,
+		      "checking path component for symlinks: %s\n",
+		      tmp_pathspec);
+      if (lstat (tmp_pathspec, &s) == 0)
+	{
+	  if (S_ISLNK (s.st_mode) != 0)
+	    {
+	      has_symlinks = 1;
+	      break;
+	    }
+
+	  /* search backwards for last DIR_SEPARATOR */
+	  p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+	  while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    p--;
+	  if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+	    {
+	      /* no more DIR_SEPARATORS left */
+	      break;
+	    }
+	  *p = '\0';
+	}
+      else
+	{
+	  lt_fatal (__FILE__, __LINE__,
+		    "error accessing file \"%s\": %s",
+		    tmp_pathspec, nonnull (strerror (errno)));
+	}
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal (__FILE__, __LINE__,
+		"could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (strcmp (str, pat) == 0)
+	*str = '\0';
+    }
+  return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+  va_list args;
+  if (lt_debug)
+    {
+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+      va_start (args, fmt);
+      (void) vfprintf (stderr, fmt, args);
+      va_end (args);
+    }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+	       int line, const char *mode,
+	       const char *message, va_list ap)
+{
+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+  va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+  return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+  return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_setenv) setting '%s' to '%s'\n",
+                  nonnull (name), nonnull (value));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    int len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      int orig_value_len = strlen (orig_value);
+      int add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      int len = strlen (new_value);
+      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[len-1] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+		  "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+EOF
+	    case $host_os in
+	      mingw*)
+		cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+  size_t argc;
+  char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = XMALLOC (char *, argc + 1);
+
+  /* Put quoted arguments into the new argument vector.  */
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      if (string[0] == '\0')
+	new_argv[i] = xstrdup ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+	{
+	  int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+	  size_t length;
+	  unsigned int backslashes;
+	  const char *s;
+	  char *quoted_string;
+	  char *p;
+
+	  length = 0;
+	  backslashes = 0;
+	  if (quote_around)
+	    length++;
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		length += backslashes + 1;
+	      length++;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    length += backslashes + 1;
+
+	  quoted_string = XMALLOC (char, length + 1);
+
+	  p = quoted_string;
+	  backslashes = 0;
+	  if (quote_around)
+	    *p++ = '"';
+	  for (s = string; *s != '\0'; s++)
+	    {
+	      char c = *s;
+	      if (c == '"')
+		{
+		  unsigned int j;
+		  for (j = backslashes + 1; j > 0; j--)
+		    *p++ = '\\';
+		}
+	      *p++ = c;
+	      if (c == '\\')
+		backslashes++;
+	      else
+		backslashes = 0;
+	    }
+	  if (quote_around)
+	    {
+	      unsigned int j;
+	      for (j = backslashes; j > 0; j--)
+		*p++ = '\\';
+	      *p++ = '"';
+	    }
+	  *p = '\0';
+
+	  new_argv[i] = quoted_string;
+	}
+      else
+	new_argv[i] = (char *) string;
+    }
+  new_argv[argc] = NULL;
+
+  return new_argv;
+}
+EOF
+		;;
+	    esac
+
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+	    func_emit_wrapper yes |
+	      $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
+            cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+    $opt_debug
+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+    *import*) : ;;
+    *) false ;;
+    esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $opt_debug
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args=$nonopt
+    base_compile="$nonopt $@"
+    compile_command=$nonopt
+    finalize_command=$nonopt
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+    new_inherited_linker_flags=
+
+    avoid_version=no
+    bindir=
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+    weak_libs=
+    single_module="${wl}-single_module"
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -shared)
+	test "$build_libtool_libs" != yes && \
+	  func_fatal_configuration "can not build a shared library"
+	build_old_libs=no
+	break
+	;;
+      -all-static | -static | -static-libtool-libs)
+	case $arg in
+	-all-static)
+	  if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+	    func_warning "complete static linking is impossible in this configuration"
+	  fi
+	  if test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	-static)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=built
+	  ;;
+	-static-libtool-libs)
+	  if test -z "$pic_flag" && test -n "$link_static_flag"; then
+	    dlopen_self=$dlopen_self_static
+	  fi
+	  prefer_static_libs=yes
+	  ;;
+	esac
+	build_libtool_libs=no
+	build_old_libs=yes
+	break
+	;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+	case $prev in
+	output)
+	  func_append compile_command " @OUTPUT@"
+	  func_append finalize_command " @OUTPUT@"
+	  ;;
+	esac
+
+	case $prev in
+	bindir)
+	  bindir="$arg"
+	  prev=
+	  continue
+	  ;;
+	dlfiles|dlprefiles)
+	  if test "$preload" = no; then
+	    # Add the symbol object into the linking commands.
+	    func_append compile_command " @SYMFILE@"
+	    func_append finalize_command " @SYMFILE@"
+	    preload=yes
+	  fi
+	  case $arg in
+	  *.la | *.lo) ;;  # We handle these cases below.
+	  force)
+	    if test "$dlself" = no; then
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  self)
+	    if test "$prev" = dlprefiles; then
+	      dlself=yes
+	    elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+	      dlself=yes
+	    else
+	      dlself=needless
+	      export_dynamic=yes
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  *)
+	    if test "$prev" = dlfiles; then
+	      func_append dlfiles " $arg"
+	    else
+	      func_append dlprefiles " $arg"
+	    fi
+	    prev=
+	    continue
+	    ;;
+	  esac
+	  ;;
+	expsyms)
+	  export_symbols="$arg"
+	  test -f "$arg" \
+	    || func_fatal_error "symbol file \`$arg' does not exist"
+	  prev=
+	  continue
+	  ;;
+	expsyms_regex)
+	  export_symbols_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	framework)
+	  case $host in
+	    *-*-darwin*)
+	      case "$deplibs " in
+		*" $qarg.ltframework "*) ;;
+		*) func_append deplibs " $qarg.ltframework" # this is fixed later
+		   ;;
+	      esac
+	      ;;
+	  esac
+	  prev=
+	  continue
+	  ;;
+	inst_prefix)
+	  inst_prefix_dir="$arg"
+	  prev=
+	  continue
+	  ;;
+	objectlist)
+	  if test -f "$arg"; then
+	    save_arg=$arg
+	    moreargs=
+	    for fil in `cat "$save_arg"`
+	    do
+#	      func_append moreargs " $fil"
+	      arg=$fil
+	      # A libtool-controlled object.
+
+	      # Check to see that this really is a libtool object.
+	      if func_lalib_unsafe_p "$arg"; then
+		pic_object=
+		non_pic_object=
+
+		# Read the .lo file
+		func_source "$arg"
+
+		if test -z "$pic_object" ||
+		   test -z "$non_pic_object" ||
+		   test "$pic_object" = none &&
+		   test "$non_pic_object" = none; then
+		  func_fatal_error "cannot find name of object for \`$arg'"
+		fi
+
+		# Extract subdirectory from the argument.
+		func_dirname "$arg" "/" ""
+		xdir="$func_dirname_result"
+
+		if test "$pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  pic_object="$xdir$pic_object"
+
+		  if test "$prev" = dlfiles; then
+		    if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		      func_append dlfiles " $pic_object"
+		      prev=
+		      continue
+		    else
+		      # If libtool objects are unsupported, then we need to preload.
+		      prev=dlprefiles
+		    fi
+		  fi
+
+		  # CHECK ME:  I think I busted this.  -Ossama
+		  if test "$prev" = dlprefiles; then
+		    # Preload the old-style object.
+		    func_append dlprefiles " $pic_object"
+		    prev=
+		  fi
+
+		  # A PIC object.
+		  func_append libobjs " $pic_object"
+		  arg="$pic_object"
+		fi
+
+		# Non-PIC object.
+		if test "$non_pic_object" != none; then
+		  # Prepend the subdirectory the object is found in.
+		  non_pic_object="$xdir$non_pic_object"
+
+		  # A standard non-PIC object
+		  func_append non_pic_objects " $non_pic_object"
+		  if test -z "$pic_object" || test "$pic_object" = none ; then
+		    arg="$non_pic_object"
+		  fi
+		else
+		  # If the PIC object exists, use it instead.
+		  # $xdir was prepended to $pic_object above.
+		  non_pic_object="$pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+		fi
+	      else
+		# Only an error if not doing a dry-run.
+		if $opt_dry_run; then
+		  # Extract subdirectory from the argument.
+		  func_dirname "$arg" "/" ""
+		  xdir="$func_dirname_result"
+
+		  func_lo2o "$arg"
+		  pic_object=$xdir$objdir/$func_lo2o_result
+		  non_pic_object=$xdir$func_lo2o_result
+		  func_append libobjs " $pic_object"
+		  func_append non_pic_objects " $non_pic_object"
+	        else
+		  func_fatal_error "\`$arg' is not a valid libtool object"
+		fi
+	      fi
+	    done
+	  else
+	    func_fatal_error "link input file \`$arg' does not exist"
+	  fi
+	  arg=$save_arg
+	  prev=
+	  continue
+	  ;;
+	precious_regex)
+	  precious_files_regex="$arg"
+	  prev=
+	  continue
+	  ;;
+	release)
+	  release="-$arg"
+	  prev=
+	  continue
+	  ;;
+	rpath | xrpath)
+	  # We need an absolute path.
+	  case $arg in
+	  [\\/]* | [A-Za-z]:[\\/]*) ;;
+	  *)
+	    func_fatal_error "only absolute run-paths are allowed"
+	    ;;
+	  esac
+	  if test "$prev" = rpath; then
+	    case "$rpath " in
+	    *" $arg "*) ;;
+	    *) func_append rpath " $arg" ;;
+	    esac
+	  else
+	    case "$xrpath " in
+	    *" $arg "*) ;;
+	    *) func_append xrpath " $arg" ;;
+	    esac
+	  fi
+	  prev=
+	  continue
+	  ;;
+	shrext)
+	  shrext_cmds="$arg"
+	  prev=
+	  continue
+	  ;;
+	weak)
+	  func_append weak_libs " $arg"
+	  prev=
+	  continue
+	  ;;
+	xcclinker)
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xcompiler)
+	  func_append compiler_flags " $qarg"
+	  prev=
+	  func_append compile_command " $qarg"
+	  func_append finalize_command " $qarg"
+	  continue
+	  ;;
+	xlinker)
+	  func_append linker_flags " $qarg"
+	  func_append compiler_flags " $wl$qarg"
+	  prev=
+	  func_append compile_command " $wl$qarg"
+	  func_append finalize_command " $wl$qarg"
+	  continue
+	  ;;
+	*)
+	  eval "$prev=\"\$arg\""
+	  prev=
+	  continue
+	  ;;
+	esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+	if test -n "$link_static_flag"; then
+	  # See comment for -static flag below, for more details.
+	  func_append compile_command " $link_static_flag"
+	  func_append finalize_command " $link_static_flag"
+	fi
+	continue
+	;;
+
+      -allow-undefined)
+	# FIXME: remove this flag sometime in the future.
+	func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+	;;
+
+      -avoid-version)
+	avoid_version=yes
+	continue
+	;;
+
+      -bindir)
+	prev=bindir
+	continue
+	;;
+
+      -dlopen)
+	prev=dlfiles
+	continue
+	;;
+
+      -dlpreopen)
+	prev=dlprefiles
+	continue
+	;;
+
+      -export-dynamic)
+	export_dynamic=yes
+	continue
+	;;
+
+      -export-symbols | -export-symbols-regex)
+	if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+	  func_fatal_error "more than one -exported-symbols argument is not allowed"
+	fi
+	if test "X$arg" = "X-export-symbols"; then
+	  prev=expsyms
+	else
+	  prev=expsyms_regex
+	fi
+	continue
+	;;
+
+      -framework)
+	prev=framework
+	continue
+	;;
+
+      -inst-prefix-dir)
+	prev=inst_prefix
+	continue
+	;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+	case $with_gcc/$host in
+	no/*-*-irix* | /*-*-irix*)
+	  func_append compile_command " $arg"
+	  func_append finalize_command " $arg"
+	  ;;
+	esac
+	continue
+	;;
+
+      -L*)
+	func_stripname "-L" '' "$arg"
+	if test -z "$func_stripname_result"; then
+	  if test "$#" -gt 0; then
+	    func_fatal_error "require no space between \`-L' and \`$1'"
+	  else
+	    func_fatal_error "need path for \`-L' option"
+	  fi
+	fi
+	func_resolve_sysroot "$func_stripname_result"
+	dir=$func_resolve_sysroot_result
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	*)
+	  absdir=`cd "$dir" && pwd`
+	  test -z "$absdir" && \
+	    func_fatal_error "cannot determine absolute directory name of \`$dir'"
+	  dir="$absdir"
+	  ;;
+	esac
+	case "$deplibs " in
+	*" -L$dir "* | *" $arg "*)
+	  # Will only happen for absolute or sysroot arguments
+	  ;;
+	*)
+	  # Preserve sysroot, but never include relative directories
+	  case $dir in
+	    [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+	    *) func_append deplibs " -L$dir" ;;
+	  esac
+	  func_append lib_search_path " $dir"
+	  ;;
+	esac
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$dir:"*) ;;
+	  ::) dllsearchpath=$dir;;
+	  *) func_append dllsearchpath ":$dir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) func_append dllsearchpath ":$testbindir";;
+	  esac
+	  ;;
+	esac
+	continue
+	;;
+
+      -l*)
+	if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+	    # These systems don't actually have a C or math library (as such)
+	    continue
+	    ;;
+	  *-*-os2*)
+	    # These systems don't actually have a C library (as such)
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C and math libraries are in the System framework
+	    func_append deplibs " System.ltframework"
+	    continue
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    test "X$arg" = "X-lc" && continue
+	    ;;
+	  esac
+	elif test "X$arg" = "X-lc_r"; then
+	 case $host in
+	 *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	   # Do not include libc_r directly, use -pthread flag.
+	   continue
+	   ;;
+	 esac
+	fi
+	func_append deplibs " $arg"
+	continue
+	;;
+
+      -module)
+	module=yes
+	continue
+	;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot|--sysroot)
+	func_append compiler_flags " $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	prev=xcompiler
+	continue
+	;;
+
+      -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+      |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+	func_append compiler_flags " $arg"
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+	case "$new_inherited_linker_flags " in
+	    *" $arg "*) ;;
+	    * ) func_append new_inherited_linker_flags " $arg" ;;
+	esac
+	continue
+	;;
+
+      -multi_module)
+	single_module="${wl}-multi_module"
+	continue
+	;;
+
+      -no-fast-install)
+	fast_install=no
+	continue
+	;;
+
+      -no-install)
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+	  # The PATH hackery in wrapper scripts is required on Windows
+	  # and Darwin in order for the loader to find any dlls it needs.
+	  func_warning "\`-no-install' is ignored for $host"
+	  func_warning "assuming \`-no-fast-install' instead"
+	  fast_install=no
+	  ;;
+	*) no_install=yes ;;
+	esac
+	continue
+	;;
+
+      -no-undefined)
+	allow_undefined=no
+	continue
+	;;
+
+      -objectlist)
+	prev=objectlist
+	continue
+	;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+	prev=precious_regex
+	continue
+	;;
+
+      -release)
+	prev=release
+	continue
+	;;
+
+      -rpath)
+	prev=rpath
+	continue
+	;;
+
+      -R)
+	prev=xrpath
+	continue
+	;;
+
+      -R*)
+	func_stripname '-R' '' "$arg"
+	dir=$func_stripname_result
+	# We need an absolute path.
+	case $dir in
+	[\\/]* | [A-Za-z]:[\\/]*) ;;
+	=*)
+	  func_stripname '=' '' "$dir"
+	  dir=$lt_sysroot$func_stripname_result
+	  ;;
+	*)
+	  func_fatal_error "only absolute run-paths are allowed"
+	  ;;
+	esac
+	case "$xrpath " in
+	*" $dir "*) ;;
+	*) func_append xrpath " $dir" ;;
+	esac
+	continue
+	;;
+
+      -shared)
+	# The effects of -shared are defined in a previous loop.
+	continue
+	;;
+
+      -shrext)
+	prev=shrext
+	continue
+	;;
+
+      -static | -static-libtool-libs)
+	# The effects of -static are defined in a previous loop.
+	# We used to do the same as -all-static on platforms that
+	# didn't have a PIC flag, but the assumption that the effects
+	# would be equivalent was wrong.  It would break on at least
+	# Digital Unix and AIX.
+	continue
+	;;
+
+      -thread-safe)
+	thread_safe=yes
+	continue
+	;;
+
+      -version-info)
+	prev=vinfo
+	continue
+	;;
+
+      -version-number)
+	prev=vinfo
+	vinfo_number=yes
+	continue
+	;;
+
+      -weak)
+        prev=weak
+	continue
+	;;
+
+      -Wc,*)
+	func_stripname '-Wc,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+	  func_append arg " $func_quote_for_eval_result"
+	  func_append compiler_flags " $func_quote_for_eval_result"
+	done
+	IFS="$save_ifs"
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Wl,*)
+	func_stripname '-Wl,' '' "$arg"
+	args=$func_stripname_result
+	arg=
+	save_ifs="$IFS"; IFS=','
+	for flag in $args; do
+	  IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+	  func_append arg " $wl$func_quote_for_eval_result"
+	  func_append compiler_flags " $wl$func_quote_for_eval_result"
+	  func_append linker_flags " $func_quote_for_eval_result"
+	done
+	IFS="$save_ifs"
+	func_stripname ' ' '' "$arg"
+	arg=$func_stripname_result
+	;;
+
+      -Xcompiler)
+	prev=xcompiler
+	continue
+	;;
+
+      -Xlinker)
+	prev=xlinker
+	continue
+	;;
+
+      -XCClinker)
+	prev=xcclinker
+	continue
+	;;
+
+      # -msg_* for osf cc
+      -msg_*)
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      # Flags to be passed through unchanged, with rationale:
+      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
+      # -r[0-9][0-9]*        specify processor for the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+      # +DA*, +DD*           enable 64-bit mode for the HP compiler
+      # -q*                  compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+      # -F/path              path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # @file                GCC response files
+      # -tp=*                Portland pgcc target processor selection
+      # --sysroot=*          for sysroot support
+      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      # -stdlib=*            select c++ std lib with clang
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+      -O*|-flto*|-fwhopr*|-fuse-linker-plugin|-stdlib=*)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        func_append compiler_flags " $arg"
+        continue
+        ;;
+
+      # Some other compiler flag.
+      -* | +*)
+        func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+
+      *.$objext)
+	# A standard object.
+	func_append objs " $arg"
+	;;
+
+      *.lo)
+	# A libtool-controlled object.
+
+	# Check to see that this really is a libtool object.
+	if func_lalib_unsafe_p "$arg"; then
+	  pic_object=
+	  non_pic_object=
+
+	  # Read the .lo file
+	  func_source "$arg"
+
+	  if test -z "$pic_object" ||
+	     test -z "$non_pic_object" ||
+	     test "$pic_object" = none &&
+	     test "$non_pic_object" = none; then
+	    func_fatal_error "cannot find name of object for \`$arg'"
+	  fi
+
+	  # Extract subdirectory from the argument.
+	  func_dirname "$arg" "/" ""
+	  xdir="$func_dirname_result"
+
+	  if test "$pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    pic_object="$xdir$pic_object"
+
+	    if test "$prev" = dlfiles; then
+	      if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+		func_append dlfiles " $pic_object"
+		prev=
+		continue
+	      else
+		# If libtool objects are unsupported, then we need to preload.
+		prev=dlprefiles
+	      fi
+	    fi
+
+	    # CHECK ME:  I think I busted this.  -Ossama
+	    if test "$prev" = dlprefiles; then
+	      # Preload the old-style object.
+	      func_append dlprefiles " $pic_object"
+	      prev=
+	    fi
+
+	    # A PIC object.
+	    func_append libobjs " $pic_object"
+	    arg="$pic_object"
+	  fi
+
+	  # Non-PIC object.
+	  if test "$non_pic_object" != none; then
+	    # Prepend the subdirectory the object is found in.
+	    non_pic_object="$xdir$non_pic_object"
+
+	    # A standard non-PIC object
+	    func_append non_pic_objects " $non_pic_object"
+	    if test -z "$pic_object" || test "$pic_object" = none ; then
+	      arg="$non_pic_object"
+	    fi
+	  else
+	    # If the PIC object exists, use it instead.
+	    # $xdir was prepended to $pic_object above.
+	    non_pic_object="$pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  fi
+	else
+	  # Only an error if not doing a dry-run.
+	  if $opt_dry_run; then
+	    # Extract subdirectory from the argument.
+	    func_dirname "$arg" "/" ""
+	    xdir="$func_dirname_result"
+
+	    func_lo2o "$arg"
+	    pic_object=$xdir$objdir/$func_lo2o_result
+	    non_pic_object=$xdir$func_lo2o_result
+	    func_append libobjs " $pic_object"
+	    func_append non_pic_objects " $non_pic_object"
+	  else
+	    func_fatal_error "\`$arg' is not a valid libtool object"
+	  fi
+	fi
+	;;
+
+      *.$libext)
+	# An archive.
+	func_append deplibs " $arg"
+	func_append old_deplibs " $arg"
+	continue
+	;;
+
+      *.la)
+	# A libtool-controlled library.
+
+	func_resolve_sysroot "$arg"
+	if test "$prev" = dlfiles; then
+	  # This library was specified with -dlopen.
+	  func_append dlfiles " $func_resolve_sysroot_result"
+	  prev=
+	elif test "$prev" = dlprefiles; then
+	  # The library was specified with -dlpreopen.
+	  func_append dlprefiles " $func_resolve_sysroot_result"
+	  prev=
+	else
+	  func_append deplibs " $func_resolve_sysroot_result"
+	fi
+	continue
+	;;
+
+      # Some other compiler argument.
+      *)
+	# Unknown arguments in both finalize_command and compile_command need
+	# to be aesthetically quoted because they are evaled later.
+	func_quote_for_eval "$arg"
+	arg="$func_quote_for_eval_result"
+	;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+	func_append compile_command " $arg"
+	func_append finalize_command " $arg"
+      fi
+    done # argument parsing loop
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prevarg' option requires an argument"
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    func_basename "$output"
+    outputname="$func_basename_result"
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    func_dirname "$output" "/" ""
+    output_objdir="$func_dirname_result$objdir"
+    func_to_tool_file "$output_objdir/"
+    tool_output_objdir=$func_to_tool_file_result
+    # Create the object directory.
+    func_mkdir_p "$output_objdir"
+
+    # Determine the type of output
+    case $output in
+    "")
+      func_fatal_help "you must specify an output file"
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if $opt_preserve_dup_deps ; then
+	case "$libs " in
+	*" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	esac
+      fi
+      func_append libs " $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if $opt_duplicate_compiler_generated_deps; then
+	for pre_post_dep in $predeps $postdeps; do
+	  case "$pre_post_deps " in
+	  *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+	  esac
+	  func_append pre_post_deps " $pre_post_dep"
+	done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+
+    case $linkmode in
+    lib)
+	passes="conv dlpreopen link"
+	for file in $dlfiles $dlprefiles; do
+	  case $file in
+	  *.la) ;;
+	  *)
+	    func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+	    ;;
+	  esac
+	done
+	;;
+    prog)
+	compile_deplibs=
+	finalize_deplibs=
+	alldeplibs=no
+	newdlfiles=
+	newdlprefiles=
+	passes="conv scan dlopen dlpreopen link"
+	;;
+    *)  passes="conv"
+	;;
+    esac
+
+    for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test "$linkmode,$pass" = "lib,link"; then
+	## FIXME: Find the place where the list is rebuilt in the wrong
+	##        order, and fix it there properly
+        tmp_deplibs=
+	for deplib in $deplibs; do
+	  tmp_deplibs="$deplib $tmp_deplibs"
+	done
+	deplibs="$tmp_deplibs"
+      fi
+
+      if test "$linkmode,$pass" = "lib,link" ||
+	 test "$linkmode,$pass" = "prog,scan"; then
+	libs="$deplibs"
+	deplibs=
+      fi
+      if test "$linkmode" = prog; then
+	case $pass in
+	dlopen) libs="$dlfiles" ;;
+	dlpreopen) libs="$dlprefiles" ;;
+	link) libs="$deplibs %DEPLIBS% $dependency_libs" ;;
+	esac
+      fi
+      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+	# Collect and forward deplibs of preopened libtool libs
+	for lib in $dlprefiles; do
+	  # Ignore non-libtool-libs
+	  dependency_libs=
+	  func_resolve_sysroot "$lib"
+	  case $lib in
+	  *.la)	func_source "$func_resolve_sysroot_result" ;;
+	  esac
+
+	  # Collect preopened libtool deplibs, except any this library
+	  # has declared as weak libs
+	  for deplib in $dependency_libs; do
+	    func_basename "$deplib"
+            deplib_base=$func_basename_result
+	    case " $weak_libs " in
+	    *" $deplib_base "*) ;;
+	    *) func_append deplibs " $deplib" ;;
+	    esac
+	  done
+	done
+	libs="$dlprefiles"
+      fi
+      if test "$pass" = dlopen; then
+	# Collect dlpreopened libraries
+	save_deplibs="$deplibs"
+	deplibs=
+      fi
+
+      for deplib in $libs; do
+	lib=
+	found=no
+	case $deplib in
+	-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+        |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    func_append compiler_flags " $deplib"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-l*)
+	  if test "$linkmode" != lib && test "$linkmode" != prog; then
+	    func_warning "\`-l' is ignored for archives/objects"
+	    continue
+	  fi
+	  func_stripname '-l' '' "$deplib"
+	  name=$func_stripname_result
+	  if test "$linkmode" = lib; then
+	    searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+	  else
+	    searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+	  fi
+	  for searchdir in $searchdirs; do
+	    for search_ext in .la $std_shrext .so .a; do
+	      # Search the libtool library
+	      lib="$searchdir/lib${name}${search_ext}"
+	      if test -f "$lib"; then
+		if test "$search_ext" = ".la"; then
+		  found=yes
+		else
+		  found=no
+		fi
+		break 2
+	      fi
+	    done
+	  done
+	  if test "$found" != yes; then
+	    # deplib doesn't seem to be a libtool library
+	    if test "$linkmode,$pass" = "prog,link"; then
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      deplibs="$deplib $deplibs"
+	      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    continue
+	  else # deplib is a libtool library
+	    # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+	    # We need to do some special things here, and not later.
+	    if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	      case " $predeps $postdeps " in
+	      *" $deplib "*)
+		if func_lalib_p "$lib"; then
+		  library_names=
+		  old_library=
+		  func_source "$lib"
+		  for l in $old_library $library_names; do
+		    ll="$l"
+		  done
+		  if test "X$ll" = "X$old_library" ; then # only static version available
+		    found=no
+		    func_dirname "$lib" "" "."
+		    ladir="$func_dirname_result"
+		    lib=$ladir/$old_library
+		    if test "$linkmode,$pass" = "prog,link"; then
+		      compile_deplibs="$deplib $compile_deplibs"
+		      finalize_deplibs="$deplib $finalize_deplibs"
+		    else
+		      deplibs="$deplib $deplibs"
+		      test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+		    fi
+		    continue
+		  fi
+		fi
+		;;
+	      *) ;;
+	      esac
+	    fi
+	  fi
+	  ;; # -l
+	*.ltframework)
+	  if test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$deplib $compile_deplibs"
+	    finalize_deplibs="$deplib $finalize_deplibs"
+	  else
+	    deplibs="$deplib $deplibs"
+	    if test "$linkmode" = lib ; then
+		case "$new_inherited_linker_flags " in
+		    *" $deplib "*) ;;
+		    * ) func_append new_inherited_linker_flags " $deplib" ;;
+		esac
+	    fi
+	  fi
+	  continue
+	  ;;
+	-L*)
+	  case $linkmode in
+	  lib)
+	    deplibs="$deplib $deplibs"
+	    test "$pass" = conv && continue
+	    newdependency_libs="$deplib $newdependency_libs"
+	    func_stripname '-L' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
+	    ;;
+	  prog)
+	    if test "$pass" = conv; then
+	      deplibs="$deplib $deplibs"
+	      continue
+	    fi
+	    if test "$pass" = scan; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    func_stripname '-L' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    func_append newlib_search_path " $func_resolve_sysroot_result"
+	    ;;
+	  *)
+	    func_warning "\`-L' is ignored for archives/objects"
+	    ;;
+	  esac # linkmode
+	  continue
+	  ;; # -L
+	-R*)
+	  if test "$pass" = link; then
+	    func_stripname '-R' '' "$deplib"
+	    func_resolve_sysroot "$func_stripname_result"
+	    dir=$func_resolve_sysroot_result
+	    # Make sure the xrpath contains only unique directories.
+	    case "$xrpath " in
+	    *" $dir "*) ;;
+	    *) func_append xrpath " $dir" ;;
+	    esac
+	  fi
+	  deplibs="$deplib $deplibs"
+	  continue
+	  ;;
+	*.la)
+	  func_resolve_sysroot "$deplib"
+	  lib=$func_resolve_sysroot_result
+	  ;;
+	*.$libext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	    continue
+	  fi
+	  case $linkmode in
+	  lib)
+	    # Linking convenience modules into shared libraries is allowed,
+	    # but linking other static libraries is non-portable.
+	    case " $dlpreconveniencelibs " in
+	    *" $deplib "*) ;;
+	    *)
+	      valid_a_lib=no
+	      case $deplibs_check_method in
+		match_pattern*)
+		  set dummy $deplibs_check_method; shift
+		  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+		  if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+		    | $EGREP "$match_pattern_regex" > /dev/null; then
+		    valid_a_lib=yes
+		  fi
+		;;
+		pass_all)
+		  valid_a_lib=yes
+		;;
+	      esac
+	      if test "$valid_a_lib" != yes; then
+		echo
+		$ECHO "*** Warning: Trying to link with static lib archive $deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because the file extensions .$libext of this argument makes me believe"
+		echo "*** that it is just a static archive that I should not use here."
+	      else
+		echo
+		$ECHO "*** Warning: Linking the shared library $output against the"
+		$ECHO "*** static library $deplib is not portable!"
+		deplibs="$deplib $deplibs"
+	      fi
+	      ;;
+	    esac
+	    continue
+	    ;;
+	  prog)
+	    if test "$pass" != link; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    fi
+	    continue
+	    ;;
+	  esac # linkmode
+	  ;; # *.$libext
+	*.lo | *.$objext)
+	  if test "$pass" = conv; then
+	    deplibs="$deplib $deplibs"
+	  elif test "$linkmode" = prog; then
+	    if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+	      # If there is no dlopen support or we're linking statically,
+	      # we need to preload.
+	      func_append newdlprefiles " $deplib"
+	      compile_deplibs="$deplib $compile_deplibs"
+	      finalize_deplibs="$deplib $finalize_deplibs"
+	    else
+	      func_append newdlfiles " $deplib"
+	    fi
+	  fi
+	  continue
+	  ;;
+	%DEPLIBS%)
+	  alldeplibs=yes
+	  continue
+	  ;;
+	esac # case $deplib
+
+	if test "$found" = yes || test -f "$lib"; then :
+	else
+	  func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+	fi
+
+	# Check to see that this really is a libtool archive.
+	func_lalib_unsafe_p "$lib" \
+	  || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+	func_dirname "$lib" "" "."
+	ladir="$func_dirname_result"
+
+	dlname=
+	dlopen=
+	dlpreopen=
+	libdir=
+	library_names=
+	old_library=
+	inherited_linker_flags=
+	# If the library was installed with an old release of libtool,
+	# it will not redefine variables installed, or shouldnotlink
+	installed=yes
+	shouldnotlink=no
+	avoidtemprpath=
+
+
+	# Read the .la file
+	func_source "$lib"
+
+	# Convert "-framework foo" to "foo.ltframework"
+	if test -n "$inherited_linker_flags"; then
+	  tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+	  for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+	    case " $new_inherited_linker_flags " in
+	      *" $tmp_inherited_linker_flag "*) ;;
+	      *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+	    esac
+	  done
+	fi
+	dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	if test "$linkmode,$pass" = "lib,link" ||
+	   test "$linkmode,$pass" = "prog,scan" ||
+	   { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+	  test -n "$dlopen" && func_append dlfiles " $dlopen"
+	  test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+	fi
+
+	if test "$pass" = conv; then
+	  # Only check for convenience libraries
+	  deplibs="$lib $deplibs"
+	  if test -z "$libdir"; then
+	    if test -z "$old_library"; then
+	      func_fatal_error "cannot find name of link library for \`$lib'"
+	    fi
+	    # It is a libtool convenience library, so add in its objects.
+	    func_append convenience " $ladir/$objdir/$old_library"
+	    func_append old_convenience " $ladir/$objdir/$old_library"
+	  elif test "$linkmode" != prog && test "$linkmode" != lib; then
+	    func_fatal_error "\`$lib' is not a convenience library"
+	  fi
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    deplibs="$deplib $deplibs"
+	    if $opt_preserve_dup_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	      esac
+	    fi
+	    func_append tmp_libs " $deplib"
+	  done
+	  continue
+	fi # $pass = conv
+
+
+	# Get the name of the library we link against.
+	linklib=
+	if test -n "$old_library" &&
+	   { test "$prefer_static_libs" = yes ||
+	     test "$prefer_static_libs,$installed" = "built,no"; }; then
+	  linklib=$old_library
+	else
+	  for l in $old_library $library_names; do
+	    linklib="$l"
+	  done
+	fi
+	if test -z "$linklib"; then
+	  func_fatal_error "cannot find name of link library for \`$lib'"
+	fi
+
+	# This library was specified with -dlopen.
+	if test "$pass" = dlopen; then
+	  if test -z "$libdir"; then
+	    func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+	  fi
+	  if test -z "$dlname" ||
+	     test "$dlopen_support" != yes ||
+	     test "$build_libtool_libs" = no; then
+	    # If there is no dlname, no dlopen support or we're linking
+	    # statically, we need to preload.  We also need to preload any
+	    # dependent libraries so libltdl's deplib preloader doesn't
+	    # bomb out in the load deplibs phase.
+	    func_append dlprefiles " $lib $dependency_libs"
+	  else
+	    func_append newdlfiles " $lib"
+	  fi
+	  continue
+	fi # $pass = dlopen
+
+	# We need an absolute path.
+	case $ladir in
+	[\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+	*)
+	  abs_ladir=`cd "$ladir" && pwd`
+	  if test -z "$abs_ladir"; then
+	    func_warning "cannot determine absolute directory name of \`$ladir'"
+	    func_warning "passing it literally to the linker, although it might fail"
+	    abs_ladir="$ladir"
+	  fi
+	  ;;
+	esac
+	func_basename "$lib"
+	laname="$func_basename_result"
+
+	# Find the relevant object directory and library name.
+	if test "X$installed" = Xyes; then
+	  if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    func_warning "library \`$lib' was moved."
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    libdir="$abs_ladir"
+	  else
+	    dir="$lt_sysroot$libdir"
+	    absdir="$lt_sysroot$libdir"
+	  fi
+	  test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+	else
+	  if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+	    dir="$ladir"
+	    absdir="$abs_ladir"
+	    # Remove this search path later
+	    func_append notinst_path " $abs_ladir"
+	  else
+	    dir="$ladir/$objdir"
+	    absdir="$abs_ladir/$objdir"
+	    # Remove this search path later
+	    func_append notinst_path " $abs_ladir"
+	  fi
+	fi # $installed = yes
+	func_stripname 'lib' '.la' "$laname"
+	name=$func_stripname_result
+
+	# This library was specified with -dlpreopen.
+	if test "$pass" = dlpreopen; then
+	  if test -z "$libdir" && test "$linkmode" = prog; then
+	    func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+	  fi
+	  case "$host" in
+	    # special handling for platforms with PE-DLLs.
+	    *cygwin* | *mingw* | *cegcc* )
+	      # Linker will automatically link against shared library if both
+	      # static and shared are present.  Therefore, ensure we extract
+	      # symbols from the import library if a shared library is present
+	      # (otherwise, the dlopen module name will be incorrect).  We do
+	      # this by putting the import library name into $newdlprefiles.
+	      # We recover the dlopen module name by 'saving' the la file
+	      # name in a special purpose variable, and (later) extracting the
+	      # dlname from the la file.
+	      if test -n "$dlname"; then
+	        func_tr_sh "$dir/$linklib"
+	        eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+	        func_append newdlprefiles " $dir/$linklib"
+	      else
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      fi
+	    ;;
+	    * )
+	      # Prefer using a static library (so that no silly _DYNAMIC symbols
+	      # are required to link).
+	      if test -n "$old_library"; then
+	        func_append newdlprefiles " $dir/$old_library"
+	        # Keep a list of preopened convenience libraries to check
+	        # that they are being used correctly in the link pass.
+	        test -z "$libdir" && \
+	          func_append dlpreconveniencelibs " $dir/$old_library"
+	      # Otherwise, use the dlname, so that lt_dlopen finds it.
+	      elif test -n "$dlname"; then
+	        func_append newdlprefiles " $dir/$dlname"
+	      else
+	        func_append newdlprefiles " $dir/$linklib"
+	      fi
+	    ;;
+	  esac
+	fi # $pass = dlpreopen
+
+	if test -z "$libdir"; then
+	  # Link the convenience library
+	  if test "$linkmode" = lib; then
+	    deplibs="$dir/$old_library $deplibs"
+	  elif test "$linkmode,$pass" = "prog,link"; then
+	    compile_deplibs="$dir/$old_library $compile_deplibs"
+	    finalize_deplibs="$dir/$old_library $finalize_deplibs"
+	  else
+	    deplibs="$lib $deplibs" # used for prog,scan pass
+	  fi
+	  continue
+	fi
+
+
+	if test "$linkmode" = prog && test "$pass" != link; then
+	  func_append newlib_search_path " $ladir"
+	  deplibs="$lib $deplibs"
+
+	  linkalldeplibs=no
+	  if test "$link_all_deplibs" != no || test -z "$library_names" ||
+	     test "$build_libtool_libs" = no; then
+	    linkalldeplibs=yes
+	  fi
+
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    case $deplib in
+	    -L*) func_stripname '-L' '' "$deplib"
+	         func_resolve_sysroot "$func_stripname_result"
+	         func_append newlib_search_path " $func_resolve_sysroot_result"
+		 ;;
+	    esac
+	    # Need to link against all dependency_libs?
+	    if test "$linkalldeplibs" = yes; then
+	      deplibs="$deplib $deplibs"
+	    else
+	      # Need to hardcode shared library paths
+	      # or/and link against static libraries
+	      newdependency_libs="$deplib $newdependency_libs"
+	    fi
+	    if $opt_preserve_dup_deps ; then
+	      case "$tmp_libs " in
+	      *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+	      esac
+	    fi
+	    func_append tmp_libs " $deplib"
+	  done # for deplib
+	  continue
+	fi # $linkmode = prog...
+
+	if test "$linkmode,$pass" = "prog,link"; then
+	  if test -n "$library_names" &&
+	     { { test "$prefer_static_libs" = no ||
+	         test "$prefer_static_libs,$installed" = "built,yes"; } ||
+	       test -z "$old_library"; }; then
+	    # We need to hardcode the library path
+	    if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+	      # Make sure the rpath contains only unique directories.
+	      case "$temp_rpath:" in
+	      *"$absdir:"*) ;;
+	      *) func_append temp_rpath "$absdir:" ;;
+	      esac
+	    fi
+
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) func_append compile_rpath " $absdir" ;;
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append finalize_rpath " $libdir" ;;
+	      esac
+	      ;;
+	    esac
+	  fi # $linkmode,$pass = prog,link...
+
+	  if test "$alldeplibs" = yes &&
+	     { test "$deplibs_check_method" = pass_all ||
+	       { test "$build_libtool_libs" = yes &&
+		 test -n "$library_names"; }; }; then
+	    # We only need to search for static libraries
+	    continue
+	  fi
+	fi
+
+	link_static=no # Whether the deplib will be linked statically
+	use_static_libs=$prefer_static_libs
+	if test "$use_static_libs" = built && test "$installed" = yes; then
+	  use_static_libs=no
+	fi
+	if test -n "$library_names" &&
+	   { test "$use_static_libs" = no || test -z "$old_library"; }; then
+	  case $host in
+	  *cygwin* | *mingw* | *cegcc*)
+	      # No point in relinking DLLs because paths are not encoded
+	      func_append notinst_deplibs " $lib"
+	      need_relink=no
+	    ;;
+	  *)
+	    if test "$installed" = no; then
+	      func_append notinst_deplibs " $lib"
+	      need_relink=yes
+	    fi
+	    ;;
+	  esac
+	  # This is a shared library
+
+	  # Warn about portability, can't link against -module's on some
+	  # systems (darwin).  Don't bleat about dlopened modules though!
+	  dlopenmodule=""
+	  for dlpremoduletest in $dlprefiles; do
+	    if test "X$dlpremoduletest" = "X$lib"; then
+	      dlopenmodule="$dlpremoduletest"
+	      break
+	    fi
+	  done
+	  if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+	    echo
+	    if test "$linkmode" = prog; then
+	      $ECHO "*** Warning: Linking the executable $output against the loadable module"
+	    else
+	      $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+	    fi
+	    $ECHO "*** $linklib is not portable!"
+	  fi
+	  if test "$linkmode" = lib &&
+	     test "$hardcode_into_libs" = yes; then
+	    # Hardcode the library path.
+	    # Skip directories that are in the system default run-time
+	    # search path.
+	    case " $sys_lib_dlsearch_path " in
+	    *" $absdir "*) ;;
+	    *)
+	      case "$compile_rpath " in
+	      *" $absdir "*) ;;
+	      *) func_append compile_rpath " $absdir" ;;
+	      esac
+	      ;;
+	    esac
+	    case " $sys_lib_dlsearch_path " in
+	    *" $libdir "*) ;;
+	    *)
+	      case "$finalize_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append finalize_rpath " $libdir" ;;
+	      esac
+	      ;;
+	    esac
+	  fi
+
+	  if test -n "$old_archive_from_expsyms_cmds"; then
+	    # figure out the soname
+	    set dummy $library_names
+	    shift
+	    realname="$1"
+	    shift
+	    libname=`eval "\\$ECHO \"$libname_spec\""`
+	    # use dlname if we got it. it's perfectly good, no?
+	    if test -n "$dlname"; then
+	      soname="$dlname"
+	    elif test -n "$soname_spec"; then
+	      # bleh windows
+	      case $host in
+	      *cygwin* | mingw* | *cegcc*)
+	        func_arith $current - $age
+		major=$func_arith_result
+		versuffix="-$major"
+		;;
+	      esac
+	      eval soname=\"$soname_spec\"
+	    else
+	      soname="$realname"
+	    fi
+
+	    # Make a new name for the extract_expsyms_cmds to use
+	    soroot="$soname"
+	    func_basename "$soroot"
+	    soname="$func_basename_result"
+	    func_stripname 'lib' '.dll' "$soname"
+	    newlib=libimp-$func_stripname_result.a
+
+	    # If the library has no export list, then create one now
+	    if test -f "$output_objdir/$soname-def"; then :
+	    else
+	      func_verbose "extracting exported symbol list from \`$soname'"
+	      func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+	    fi
+
+	    # Create $newlib
+	    if test -f "$output_objdir/$newlib"; then :; else
+	      func_verbose "generating import library for \`$soname'"
+	      func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+	    fi
+	    # make sure the library variables are pointing to the new library
+	    dir=$output_objdir
+	    linklib=$newlib
+	  fi # test -n "$old_archive_from_expsyms_cmds"
+
+	  if test "$linkmode" = prog || test "$opt_mode" != relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    lib_linked=yes
+	    case $hardcode_action in
+	    immediate | unsupported)
+	      if test "$hardcode_direct" = no; then
+		add="$dir/$linklib"
+		case $host in
+		  *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+		  *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+		  *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+		    *-*-unixware7*) add_dir="-L$dir" ;;
+		  *-*-darwin* )
+		    # if the lib is a (non-dlopened) module then we can not
+		    # link against it, someone is ignoring the earlier warnings
+		    if /usr/bin/file -L $add 2> /dev/null |
+			 $GREP ": [^:]* bundle" >/dev/null ; then
+		      if test "X$dlopenmodule" != "X$lib"; then
+			$ECHO "*** Warning: lib $linklib is a module, not a shared library"
+			if test -z "$old_library" ; then
+			  echo
+			  echo "*** And there doesn't seem to be a static archive available"
+			  echo "*** The link will probably fail, sorry"
+			else
+			  add="$dir/$old_library"
+			fi
+		      elif test -n "$old_library"; then
+			add="$dir/$old_library"
+		      fi
+		    fi
+		esac
+	      elif test "$hardcode_minus_L" = no; then
+		case $host in
+		*-*-sunos*) add_shlibpath="$dir" ;;
+		esac
+		add_dir="-L$dir"
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = no; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    relink)
+	      if test "$hardcode_direct" = yes &&
+	         test "$hardcode_direct_absolute" = no; then
+		add="$dir/$linklib"
+	      elif test "$hardcode_minus_L" = yes; then
+		add_dir="-L$absdir"
+		# Try looking first in the location we're being installed to.
+		if test -n "$inst_prefix_dir"; then
+		  case $libdir in
+		    [\\/]*)
+		      func_append add_dir " -L$inst_prefix_dir$libdir"
+		      ;;
+		  esac
+		fi
+		add="-l$name"
+	      elif test "$hardcode_shlibpath_var" = yes; then
+		add_shlibpath="$dir"
+		add="-l$name"
+	      else
+		lib_linked=no
+	      fi
+	      ;;
+	    *) lib_linked=no ;;
+	    esac
+
+	    if test "$lib_linked" != yes; then
+	      func_fatal_configuration "unsupported hardcode properties"
+	    fi
+
+	    if test -n "$add_shlibpath"; then
+	      case :$compile_shlibpath: in
+	      *":$add_shlibpath:"*) ;;
+	      *) func_append compile_shlibpath "$add_shlibpath:" ;;
+	      esac
+	    fi
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+	      test -n "$add" && compile_deplibs="$add $compile_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	      if test "$hardcode_direct" != yes &&
+		 test "$hardcode_minus_L" != yes &&
+		 test "$hardcode_shlibpath_var" = yes; then
+		case :$finalize_shlibpath: in
+		*":$libdir:"*) ;;
+		*) func_append finalize_shlibpath "$libdir:" ;;
+		esac
+	      fi
+	    fi
+	  fi
+
+	  if test "$linkmode" = prog || test "$opt_mode" = relink; then
+	    add_shlibpath=
+	    add_dir=
+	    add=
+	    # Finalize command for both is simple: just hardcode it.
+	    if test "$hardcode_direct" = yes &&
+	       test "$hardcode_direct_absolute" = no; then
+	      add="$libdir/$linklib"
+	    elif test "$hardcode_minus_L" = yes; then
+	      add_dir="-L$libdir"
+	      add="-l$name"
+	    elif test "$hardcode_shlibpath_var" = yes; then
+	      case :$finalize_shlibpath: in
+	      *":$libdir:"*) ;;
+	      *) func_append finalize_shlibpath "$libdir:" ;;
+	      esac
+	      add="-l$name"
+	    elif test "$hardcode_automatic" = yes; then
+	      if test -n "$inst_prefix_dir" &&
+		 test -f "$inst_prefix_dir$libdir/$linklib" ; then
+		add="$inst_prefix_dir$libdir/$linklib"
+	      else
+		add="$libdir/$linklib"
+	      fi
+	    else
+	      # We cannot seem to hardcode it, guess we'll fake it.
+	      add_dir="-L$libdir"
+	      # Try looking first in the location we're being installed to.
+	      if test -n "$inst_prefix_dir"; then
+		case $libdir in
+		  [\\/]*)
+		    func_append add_dir " -L$inst_prefix_dir$libdir"
+		    ;;
+		esac
+	      fi
+	      add="-l$name"
+	    fi
+
+	    if test "$linkmode" = prog; then
+	      test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+	      test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+	    else
+	      test -n "$add_dir" && deplibs="$add_dir $deplibs"
+	      test -n "$add" && deplibs="$add $deplibs"
+	    fi
+	  fi
+	elif test "$linkmode" = prog; then
+	  # Here we assume that one of hardcode_direct or hardcode_minus_L
+	  # is not unsupported.  This is valid on all known static and
+	  # shared platforms.
+	  if test "$hardcode_direct" != unsupported; then
+	    test -n "$old_library" && linklib="$old_library"
+	    compile_deplibs="$dir/$linklib $compile_deplibs"
+	    finalize_deplibs="$dir/$linklib $finalize_deplibs"
+	  else
+	    compile_deplibs="-l$name -L$dir $compile_deplibs"
+	    finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+	  fi
+	elif test "$build_libtool_libs" = yes; then
+	  # Not a shared library
+	  if test "$deplibs_check_method" != pass_all; then
+	    # We're trying link a shared library against a static one
+	    # but the system doesn't support it.
+
+	    # Just print a warning and add the library to dependency_libs so
+	    # that the program can be linked against the static library.
+	    echo
+	    $ECHO "*** Warning: This system can not link to static lib archive $lib."
+	    echo "*** I have the capability to make that library automatically link in when"
+	    echo "*** you link to this library.  But I can only do this if you have a"
+	    echo "*** shared version of the library, which you do not appear to have."
+	    if test "$module" = yes; then
+	      echo "*** But as you try to build a module library, libtool will still create "
+	      echo "*** a static module, that should work as long as the dlopening application"
+	      echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+	      if test -z "$global_symbol_pipe"; then
+		echo
+		echo "*** However, this would only work if libtool was able to extract symbol"
+		echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+		echo "*** not find such a program.  So, this module is probably useless."
+		echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	      fi
+	      if test "$build_old_libs" = no; then
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  else
+	    deplibs="$dir/$old_library $deplibs"
+	    link_static=yes
+	  fi
+	fi # link shared/static library?
+
+	if test "$linkmode" = lib; then
+	  if test -n "$dependency_libs" &&
+	     { test "$hardcode_into_libs" != yes ||
+	       test "$build_old_libs" = yes ||
+	       test "$link_static" = yes; }; then
+	    # Extract -R from dependency_libs
+	    temp_deplibs=
+	    for libdir in $dependency_libs; do
+	      case $libdir in
+	      -R*) func_stripname '-R' '' "$libdir"
+	           temp_xrpath=$func_stripname_result
+		   case " $xrpath " in
+		   *" $temp_xrpath "*) ;;
+		   *) func_append xrpath " $temp_xrpath";;
+		   esac;;
+	      *) func_append temp_deplibs " $libdir";;
+	      esac
+	    done
+	    dependency_libs="$temp_deplibs"
+	  fi
+
+	  func_append newlib_search_path " $absdir"
+	  # Link against this library
+	  test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+	  # ... and its dependency_libs
+	  tmp_libs=
+	  for deplib in $dependency_libs; do
+	    newdependency_libs="$deplib $newdependency_libs"
+	    case $deplib in
+              -L*) func_stripname '-L' '' "$deplib"
+                   func_resolve_sysroot "$func_stripname_result";;
+              *) func_resolve_sysroot "$deplib" ;;
+            esac
+	    if $opt_preserve_dup_deps ; then
+	      case "$tmp_libs " in
+	      *" $func_resolve_sysroot_result "*)
+                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+	      esac
+	    fi
+	    func_append tmp_libs " $func_resolve_sysroot_result"
+	  done
+
+	  if test "$link_all_deplibs" != no; then
+	    # Add the search paths of all dependency libraries
+	    for deplib in $dependency_libs; do
+	      path=
+	      case $deplib in
+	      -L*) path="$deplib" ;;
+	      *.la)
+	        func_resolve_sysroot "$deplib"
+	        deplib=$func_resolve_sysroot_result
+	        func_dirname "$deplib" "" "."
+		dir=$func_dirname_result
+		# We need an absolute path.
+		case $dir in
+		[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+		*)
+		  absdir=`cd "$dir" && pwd`
+		  if test -z "$absdir"; then
+		    func_warning "cannot determine absolute directory name of \`$dir'"
+		    absdir="$dir"
+		  fi
+		  ;;
+		esac
+		if $GREP "^installed=no" $deplib > /dev/null; then
+		case $host in
+		*-*-darwin*)
+		  depdepl=
+		  eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+		  if test -n "$deplibrary_names" ; then
+		    for tmp in $deplibrary_names ; do
+		      depdepl=$tmp
+		    done
+		    if test -f "$absdir/$objdir/$depdepl" ; then
+		      depdepl="$absdir/$objdir/$depdepl"
+		      darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+		      func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+		      func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+		      path=
+		    fi
+		  fi
+		  ;;
+		*)
+		  path="-L$absdir/$objdir"
+		  ;;
+		esac
+		else
+		  eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+		  test -z "$libdir" && \
+		    func_fatal_error "\`$deplib' is not a valid libtool archive"
+		  test "$absdir" != "$libdir" && \
+		    func_warning "\`$deplib' seems to be moved"
+
+		  path="-L$absdir"
+		fi
+		;;
+	      esac
+	      case " $deplibs " in
+	      *" $path "*) ;;
+	      *) deplibs="$path $deplibs" ;;
+	      esac
+	    done
+	  fi # link_all_deplibs != no
+	fi # linkmode = lib
+      done # for deplib in $libs
+      if test "$pass" = link; then
+	if test "$linkmode" = "prog"; then
+	  compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+	  finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+	else
+	  compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	fi
+      fi
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+	# Link the dlpreopened libraries before other libraries
+	for deplib in $save_deplibs; do
+	  deplibs="$deplib $deplibs"
+	done
+      fi
+      if test "$pass" != dlopen; then
+	if test "$pass" != conv; then
+	  # Make sure lib_search_path contains only unique directories.
+	  lib_search_path=
+	  for dir in $newlib_search_path; do
+	    case "$lib_search_path " in
+	    *" $dir "*) ;;
+	    *) func_append lib_search_path " $dir" ;;
+	    esac
+	  done
+	  newlib_search_path=
+	fi
+
+	if test "$linkmode,$pass" != "prog,link"; then
+	  vars="deplibs"
+	else
+	  vars="compile_deplibs finalize_deplibs"
+	fi
+	for var in $vars dependency_libs; do
+	  # Add libraries to $var in reverse order
+	  eval tmp_libs=\"\$$var\"
+	  new_libs=
+	  for deplib in $tmp_libs; do
+	    # FIXME: Pedantically, this is the right thing to do, so
+	    #        that some nasty dependency loop isn't accidentally
+	    #        broken:
+	    #new_libs="$deplib $new_libs"
+	    # Pragmatically, this seems to cause very few problems in
+	    # practice:
+	    case $deplib in
+	    -L*) new_libs="$deplib $new_libs" ;;
+	    -R*) ;;
+	    *)
+	      # And here is the reason: when a library appears more
+	      # than once as an explicit dependence of a library, or
+	      # is implicitly linked in more than once by the
+	      # compiler, it is considered special, and multiple
+	      # occurrences thereof are not removed.  Compare this
+	      # with having the same library being listed as a
+	      # dependency of multiple other libraries: in this case,
+	      # we know (pedantically, we assume) the library does not
+	      # need to be listed more than once, so we keep only the
+	      # last copy.  This is not always right, but it is rare
+	      # enough that we require users that really mean to play
+	      # such unportable linking tricks to link the library
+	      # using -Wl,-lname, so that libtool does not consider it
+	      # for duplicate removal.
+	      case " $specialdeplibs " in
+	      *" $deplib "*) new_libs="$deplib $new_libs" ;;
+	      *)
+		case " $new_libs " in
+		*" $deplib "*) ;;
+		*) new_libs="$deplib $new_libs" ;;
+		esac
+		;;
+	      esac
+	      ;;
+	    esac
+	  done
+	  tmp_libs=
+	  for deplib in $new_libs; do
+	    case $deplib in
+	    -L*)
+	      case " $tmp_libs " in
+	      *" $deplib "*) ;;
+	      *) func_append tmp_libs " $deplib" ;;
+	      esac
+	      ;;
+	    *) func_append tmp_libs " $deplib" ;;
+	    esac
+	  done
+	  eval $var=\"$tmp_libs\"
+	done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+	case " $predeps $postdeps $compiler_lib_search_path " in
+	*" $i "*)
+	  i=""
+	  ;;
+	esac
+	if test -n "$i" ; then
+	  func_append tmp_libs " $i"
+	fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+    fi
+    if test "$linkmode" = prog || test "$linkmode" = lib; then
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for archives"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "\`-l' and \`-L' are ignored for archives" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for archives"
+
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for archives"
+
+      test -n "$vinfo" && \
+	func_warning "\`-version-info/-version-number' is ignored for archives"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for archives"
+
+      test -n "$export_symbols$export_symbols_regex" && \
+	func_warning "\`-export-symbols' is ignored for archives"
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      func_append objs "$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+	func_stripname 'lib' '.la' "$outputname"
+	name=$func_stripname_result
+	eval shared_ext=\"$shrext_cmds\"
+	eval libname=\"$libname_spec\"
+	;;
+      *)
+	test "$module" = no && \
+	  func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+	if test "$need_lib_prefix" != no; then
+	  # Add the "lib" prefix for modules if required
+	  func_stripname '' '.la' "$outputname"
+	  name=$func_stripname_result
+	  eval shared_ext=\"$shrext_cmds\"
+	  eval libname=\"$libname_spec\"
+	else
+	  func_stripname '' '.la' "$outputname"
+	  libname=$func_stripname_result
+	fi
+	;;
+      esac
+
+      if test -n "$objs"; then
+	if test "$deplibs_check_method" != pass_all; then
+	  func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+	else
+	  echo
+	  $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+	  $ECHO "*** objects $objs is not portable!"
+	  func_append libobjs " $objs"
+	fi
+      fi
+
+      test "$dlself" != no && \
+	func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+      set dummy $rpath
+      shift
+      test "$#" -gt 1 && \
+	func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+      install_libdir="$1"
+
+      oldlibs=
+      if test -z "$rpath"; then
+	if test "$build_libtool_libs" = yes; then
+	  # Building a libtool convenience library.
+	  # Some compilers have problems with a `.al' extension so
+	  # convenience libraries should have the same extension an
+	  # archive normally would.
+	  oldlibs="$output_objdir/$libname.$libext $oldlibs"
+	  build_libtool_libs=convenience
+	  build_old_libs=yes
+	fi
+
+	test -n "$vinfo" && \
+	  func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+	test -n "$release" && \
+	  func_warning "\`-release' is ignored for convenience libraries"
+      else
+
+	# Parse the version information argument.
+	save_ifs="$IFS"; IFS=':'
+	set dummy $vinfo 0 0 0
+	shift
+	IFS="$save_ifs"
+
+	test -n "$7" && \
+	  func_fatal_help "too many parameters to \`-version-info'"
+
+	# convert absolute version numbers to libtool ages
+	# this retains compatibility with .la files and attempts
+	# to make the code below a bit more comprehensible
+
+	case $vinfo_number in
+	yes)
+	  number_major="$1"
+	  number_minor="$2"
+	  number_revision="$3"
+	  #
+	  # There are really only two kinds -- those that
+	  # use the current revision as the major version
+	  # and those that subtract age and use age as
+	  # a minor version.  But, then there is irix
+	  # which has an extra 1 added just for fun
+	  #
+	  case $version_type in
+	  # correct linux to gnu/linux during the next big refactor
+	  darwin|linux|osf|windows|none)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age="$number_minor"
+	    revision="$number_revision"
+	    ;;
+	  freebsd-aout|freebsd-elf|qnx|sunos)
+	    current="$number_major"
+	    revision="$number_minor"
+	    age="0"
+	    ;;
+	  irix|nonstopux)
+	    func_arith $number_major + $number_minor
+	    current=$func_arith_result
+	    age="$number_minor"
+	    revision="$number_minor"
+	    lt_irix_increment=no
+	    ;;
+	  esac
+	  ;;
+	no)
+	  current="$1"
+	  revision="$2"
+	  age="$3"
+	  ;;
+	esac
+
+	# Check that each of the things are valid numbers.
+	case $current in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "CURRENT \`$current' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $revision in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "REVISION \`$revision' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	case $age in
+	0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+	*)
+	  func_error "AGE \`$age' must be a nonnegative integer"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	  ;;
+	esac
+
+	if test "$age" -gt "$current"; then
+	  func_error "AGE \`$age' is greater than the current interface number \`$current'"
+	  func_fatal_error "\`$vinfo' is not valid version information"
+	fi
+
+	# Calculate the version variables.
+	major=
+	versuffix=
+	verstring=
+	case $version_type in
+	none) ;;
+
+	darwin)
+	  # Like Linux, but with the current version available in
+	  # verstring for coding it into the library header
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix="$major.$age.$revision"
+	  # Darwin ld doesn't like 0 for these options...
+	  func_arith $current + 1
+	  minor_current=$func_arith_result
+	  xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+	  verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+	  ;;
+
+	freebsd-aout)
+	  major=".$current"
+	  versuffix=".$current.$revision";
+	  ;;
+
+	freebsd-elf)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
+
+	irix | nonstopux)
+	  if test "X$lt_irix_increment" = "Xno"; then
+	    func_arith $current - $age
+	  else
+	    func_arith $current - $age + 1
+	  fi
+	  major=$func_arith_result
+
+	  case $version_type in
+	    nonstopux) verstring_prefix=nonstopux ;;
+	    *)         verstring_prefix=sgi ;;
+	  esac
+	  verstring="$verstring_prefix$major.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$revision
+	  while test "$loop" -ne 0; do
+	    func_arith $revision - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring="$verstring_prefix$major.$iface:$verstring"
+	  done
+
+	  # Before this point, $major must not contain `.'.
+	  major=.$major
+	  versuffix="$major.$revision"
+	  ;;
+
+	linux) # correct to gnu/linux during the next big refactor
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix="$major.$age.$revision"
+	  ;;
+
+	osf)
+	  func_arith $current - $age
+	  major=.$func_arith_result
+	  versuffix=".$current.$age.$revision"
+	  verstring="$current.$age.$revision"
+
+	  # Add in all the interfaces that we are compatible with.
+	  loop=$age
+	  while test "$loop" -ne 0; do
+	    func_arith $current - $loop
+	    iface=$func_arith_result
+	    func_arith $loop - 1
+	    loop=$func_arith_result
+	    verstring="$verstring:${iface}.0"
+	  done
+
+	  # Make executables depend on our current version.
+	  func_append verstring ":${current}.0"
+	  ;;
+
+	qnx)
+	  major=".$current"
+	  versuffix=".$current"
+	  ;;
+
+	sunos)
+	  major=".$current"
+	  versuffix=".$current.$revision"
+	  ;;
+
+	windows)
+	  # Use '-' rather than '.', since we only want one
+	  # extension on DOS 8.3 filesystems.
+	  func_arith $current - $age
+	  major=$func_arith_result
+	  versuffix="-$major"
+	  ;;
+
+	*)
+	  func_fatal_configuration "unknown library version type \`$version_type'"
+	  ;;
+	esac
+
+	# Clear the version info if we defaulted, and they specified a release.
+	if test -z "$vinfo" && test -n "$release"; then
+	  major=
+	  case $version_type in
+	  darwin)
+	    # we can't check for "0.0" in archive_cmds due to quoting
+	    # problems, so we reset it completely
+	    verstring=
+	    ;;
+	  *)
+	    verstring="0.0"
+	    ;;
+	  esac
+	  if test "$need_version" = no; then
+	    versuffix=
+	  else
+	    versuffix=".0.0"
+	  fi
+	fi
+
+	# Remove version info from name if versioning should be avoided
+	if test "$avoid_version" = yes && test "$need_version" = no; then
+	  major=
+	  versuffix=
+	  verstring=""
+	fi
+
+	# Check to see if the archive will have undefined symbols.
+	if test "$allow_undefined" = yes; then
+	  if test "$allow_undefined_flag" = unsupported; then
+	    func_warning "undefined symbols not allowed in $host shared libraries"
+	    build_libtool_libs=no
+	    build_old_libs=yes
+	  fi
+	else
+	  # Don't allow undefined symbols.
+	  allow_undefined_flag="$no_undefined_flag"
+	fi
+
+      fi
+
+      func_generate_dlsyms "$libname" "$libname" "yes"
+      func_append libobjs " $symfileobj"
+      test "X$libobjs" = "X " && libobjs=
+
+      if test "$opt_mode" != relink; then
+	# Remove our outputs, but don't remove object files since they
+	# may have been created when compiling PIC objects.
+	removelist=
+	tempremovelist=`$ECHO "$output_objdir/*"`
+	for p in $tempremovelist; do
+	  case $p in
+	    *.$objext | *.gcno)
+	       ;;
+	    $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+	       if test "X$precious_files_regex" != "X"; then
+		 if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+		 then
+		   continue
+		 fi
+	       fi
+	       func_append removelist " $p"
+	       ;;
+	    *) ;;
+	  esac
+	done
+	test -n "$removelist" && \
+	  func_show_eval "${RM}r \$removelist"
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+	func_append oldlibs " $output_objdir/$libname.$libext"
+
+	# Transform .lo files to .o files.
+	oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      #for path in $notinst_path; do
+      #	lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+      #	deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+      #	dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+      #done
+
+      if test -n "$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	temp_xrpath=
+	for libdir in $xrpath; do
+	  func_replace_sysroot "$libdir"
+	  func_append temp_xrpath " -R$func_replace_sysroot_result"
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append finalize_rpath " $libdir" ;;
+	  esac
+	done
+	if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+	  dependency_libs="$temp_xrpath $dependency_libs"
+	fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+	case " $dlprefiles $dlfiles " in
+	*" $lib "*) ;;
+	*) func_append dlfiles " $lib" ;;
+	esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+	case "$dlprefiles " in
+	*" $lib "*) ;;
+	*) func_append dlprefiles " $lib" ;;
+	esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+	if test -n "$rpath"; then
+	  case $host in
+	  *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+	    # these systems don't actually have a c library (as such)!
+	    ;;
+	  *-*-rhapsody* | *-*-darwin1.[012])
+	    # Rhapsody C library is in the System framework
+	    func_append deplibs " System.ltframework"
+	    ;;
+	  *-*-netbsd*)
+	    # Don't link with libc until the a.out ld.so is fixed.
+	    ;;
+	  *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+	    # Do not include libc due to us having libc/libc_r.
+	    ;;
+	  *-*-sco3.2v5* | *-*-sco5v6*)
+	    # Causes problems with __ctype
+	    ;;
+	  *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+	    # Compiler inserts libc in the correct place for threads to work
+	    ;;
+	  *)
+	    # Add libc to deplibs on all other systems if necessary.
+	    if test "$build_libtool_need_lc" = "yes"; then
+	      func_append deplibs " -lc"
+	    fi
+	    ;;
+	  esac
+	fi
+
+	# Transform deplibs into only deplibs that can be linked in shared.
+	name_save=$name
+	libname_save=$libname
+	release_save=$release
+	versuffix_save=$versuffix
+	major_save=$major
+	# I'm not sure if I'm treating the release correctly.  I think
+	# release should show up in the -l (ie -lgmp5) so we don't want to
+	# add it in twice.  Is that correct?
+	release=""
+	versuffix=""
+	major=""
+	newdeplibs=
+	droppeddeps=no
+	case $deplibs_check_method in
+	pass_all)
+	  # Don't check for shared/static.  Everything works.
+	  # This might be a little naive.  We might want to check
+	  # whether the library exists or not.  But this is on
+	  # osf3 & osf4 and I'm not really sure... Just
+	  # implementing what was already the behavior.
+	  newdeplibs=$deplibs
+	  ;;
+	test_compile)
+	  # This code stresses the "libraries are programs" paradigm to its
+	  # limits. Maybe even breaks it.  We compile a program, linking it
+	  # against the deplibs as a proxy for the library.  Then we can check
+	  # whether they linked in statically or dynamically with ldd.
+	  $opt_dry_run || $RM conftest.c
+	  cat > conftest.c <<EOF
+	  int main() { return 0; }
+EOF
+	  $opt_dry_run || $RM conftest
+	  if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+	    ldd_output=`ldd conftest`
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		  case " $predeps $postdeps " in
+		  *" $i "*)
+		    func_append newdeplibs " $i"
+		    i=""
+		    ;;
+		  esac
+		fi
+		if test -n "$i" ; then
+		  libname=`eval "\\$ECHO \"$libname_spec\""`
+		  deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		  set dummy $deplib_matches; shift
+		  deplib_match=$1
+		  if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		    func_append newdeplibs " $i"
+		  else
+		    droppeddeps=yes
+		    echo
+		    $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		    echo "*** I have the capability to make that library automatically link in when"
+		    echo "*** you link to this library.  But I can only do this if you have a"
+		    echo "*** shared version of the library, which I believe you do not have"
+		    echo "*** because a test_compile did reveal that the linker did not use it for"
+		    echo "*** its dynamic dependency list that programs get resolved with at runtime."
+		  fi
+		fi
+		;;
+	      *)
+		func_append newdeplibs " $i"
+		;;
+	      esac
+	    done
+	  else
+	    # Error occurred in the first compile.  Let's try to salvage
+	    # the situation: Compile a separate program for each library.
+	    for i in $deplibs; do
+	      case $i in
+	      -l*)
+		func_stripname -l '' "$i"
+		name=$func_stripname_result
+		$opt_dry_run || $RM conftest
+		if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+		  ldd_output=`ldd conftest`
+		  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		    case " $predeps $postdeps " in
+		    *" $i "*)
+		      func_append newdeplibs " $i"
+		      i=""
+		      ;;
+		    esac
+		  fi
+		  if test -n "$i" ; then
+		    libname=`eval "\\$ECHO \"$libname_spec\""`
+		    deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+		    set dummy $deplib_matches; shift
+		    deplib_match=$1
+		    if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+		      func_append newdeplibs " $i"
+		    else
+		      droppeddeps=yes
+		      echo
+		      $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+		      echo "*** I have the capability to make that library automatically link in when"
+		      echo "*** you link to this library.  But I can only do this if you have a"
+		      echo "*** shared version of the library, which you do not appear to have"
+		      echo "*** because a test_compile did reveal that the linker did not use this one"
+		      echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+		    fi
+		  fi
+		else
+		  droppeddeps=yes
+		  echo
+		  $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+		  echo "*** make it link in!  You will probably need to install it or some"
+		  echo "*** library that it depends on before this library will be fully"
+		  echo "*** functional.  Installing it before continuing would be even better."
+		fi
+		;;
+	      *)
+		func_append newdeplibs " $i"
+		;;
+	      esac
+	    done
+	  fi
+	  ;;
+	file_magic*)
+	  set dummy $deplibs_check_method; shift
+	  file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  func_append newdeplibs " $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		if test -n "$file_magic_glob"; then
+		  libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+		else
+		  libnameglob=$libname
+		fi
+		test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  if test "$want_nocaseglob" = yes; then
+		    shopt -s nocaseglob
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		    $nocaseglob
+		  else
+		    potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+		  fi
+		  for potent_lib in $potential_libs; do
+		      # Follow soft links.
+		      if ls -lLd "$potent_lib" 2>/dev/null |
+			 $GREP " -> " >/dev/null; then
+			continue
+		      fi
+		      # The statement above tries to avoid entering an
+		      # endless loop below, in case of cyclic links.
+		      # We might still enter an endless loop, since a link
+		      # loop can be closed while we follow links,
+		      # but so what?
+		      potlib="$potent_lib"
+		      while test -h "$potlib" 2>/dev/null; do
+			potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+			case $potliblink in
+			[\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+			*) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+			esac
+		      done
+		      if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+			 $SED -e 10q |
+			 $EGREP "$file_magic_regex" > /dev/null; then
+			func_append newdeplibs " $a_deplib"
+			a_deplib=""
+			break 2
+		      fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		echo
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a file magic. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      func_append newdeplibs " $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	match_pattern*)
+	  set dummy $deplibs_check_method; shift
+	  match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+	  for a_deplib in $deplibs; do
+	    case $a_deplib in
+	    -l*)
+	      func_stripname -l '' "$a_deplib"
+	      name=$func_stripname_result
+	      if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+		case " $predeps $postdeps " in
+		*" $a_deplib "*)
+		  func_append newdeplibs " $a_deplib"
+		  a_deplib=""
+		  ;;
+		esac
+	      fi
+	      if test -n "$a_deplib" ; then
+		libname=`eval "\\$ECHO \"$libname_spec\""`
+		for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+		  potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+		  for potent_lib in $potential_libs; do
+		    potlib="$potent_lib" # see symlink-check above in file_magic test
+		    if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+		       $EGREP "$match_pattern_regex" > /dev/null; then
+		      func_append newdeplibs " $a_deplib"
+		      a_deplib=""
+		      break 2
+		    fi
+		  done
+		done
+	      fi
+	      if test -n "$a_deplib" ; then
+		droppeddeps=yes
+		echo
+		$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+		echo "*** I have the capability to make that library automatically link in when"
+		echo "*** you link to this library.  But I can only do this if you have a"
+		echo "*** shared version of the library, which you do not appear to have"
+		echo "*** because I did check the linker path looking for a file starting"
+		if test -z "$potlib" ; then
+		  $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+		else
+		  $ECHO "*** with $libname and none of the candidates passed a file format test"
+		  $ECHO "*** using a regex pattern. Last file checked: $potlib"
+		fi
+	      fi
+	      ;;
+	    *)
+	      # Add a -L argument.
+	      func_append newdeplibs " $a_deplib"
+	      ;;
+	    esac
+	  done # Gone through all deplibs.
+	  ;;
+	none | unknown | *)
+	  newdeplibs=""
+	  tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+	  if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+	    for i in $predeps $postdeps ; do
+	      # can't use Xsed below, because $i might contain '/'
+	      tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+	    done
+	  fi
+	  case $tmp_deplibs in
+	  *[!\	\ ]*)
+	    echo
+	    if test "X$deplibs_check_method" = "Xnone"; then
+	      echo "*** Warning: inter-library dependencies are not supported in this platform."
+	    else
+	      echo "*** Warning: inter-library dependencies are not known to be supported."
+	    fi
+	    echo "*** All declared inter-library dependencies are being dropped."
+	    droppeddeps=yes
+	    ;;
+	  esac
+	  ;;
+	esac
+	versuffix=$versuffix_save
+	major=$major_save
+	release=$release_save
+	libname=$libname_save
+	name=$name_save
+
+	case $host in
+	*-*-rhapsody* | *-*-darwin1.[012])
+	  # On Rhapsody replace the C library with the System framework
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+	  ;;
+	esac
+
+	if test "$droppeddeps" = yes; then
+	  if test "$module" = yes; then
+	    echo
+	    echo "*** Warning: libtool could not satisfy all declared inter-library"
+	    $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+	    echo "*** a static module, that should work as long as the dlopening"
+	    echo "*** application is linked with the -dlopen flag."
+	    if test -z "$global_symbol_pipe"; then
+	      echo
+	      echo "*** However, this would only work if libtool was able to extract symbol"
+	      echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+	      echo "*** not find such a program.  So, this module is probably useless."
+	      echo "*** \`nm' from GNU binutils and a full rebuild may help."
+	    fi
+	    if test "$build_old_libs" = no; then
+	      oldlibs="$output_objdir/$libname.$libext"
+	      build_libtool_libs=module
+	      build_old_libs=yes
+	    else
+	      build_libtool_libs=no
+	    fi
+	  else
+	    echo "*** The inter-library dependencies that have been dropped here will be"
+	    echo "*** automatically added whenever a program is linked with this library"
+	    echo "*** or is declared to -dlopen it."
+
+	    if test "$allow_undefined" = no; then
+	      echo
+	      echo "*** Since this library must not contain undefined symbols,"
+	      echo "*** because either the platform does not support them or"
+	      echo "*** it was explicitly requested with -no-undefined,"
+	      echo "*** libtool will only create a static version of it."
+	      if test "$build_old_libs" = no; then
+		oldlibs="$output_objdir/$libname.$libext"
+		build_libtool_libs=module
+		build_old_libs=yes
+	      else
+		build_libtool_libs=no
+	      fi
+	    fi
+	  fi
+	fi
+	# Done checking deplibs!
+	deplibs=$newdeplibs
+      fi
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+	*-*-darwin*)
+	  newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	  ;;
+      esac
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $deplibs " in
+	  *" -L$path/$objdir "*)
+	    func_append new_libs " -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) func_append new_libs " $deplib" ;;
+	  esac
+	  ;;
+	*) func_append new_libs " $deplib" ;;
+	esac
+      done
+      deplibs="$new_libs"
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # Test again, we may have decided not to build it any more
+      if test "$build_libtool_libs" = yes; then
+	# Remove ${wl} instances when linking with ld.
+	# FIXME: should test the right _cmds variable.
+	case $archive_cmds in
+	  *\$LD\ *) wl= ;;
+        esac
+	if test "$hardcode_into_libs" = yes; then
+	  # Hardcode the library paths
+	  hardcode_libdirs=
+	  dep_rpath=
+	  rpath="$finalize_rpath"
+	  test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+	  for libdir in $rpath; do
+	    if test -n "$hardcode_libdir_flag_spec"; then
+	      if test -n "$hardcode_libdir_separator"; then
+		func_replace_sysroot "$libdir"
+		libdir=$func_replace_sysroot_result
+		if test -z "$hardcode_libdirs"; then
+		  hardcode_libdirs="$libdir"
+		else
+		  # Just accumulate the unique libdirs.
+		  case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+		  *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		    ;;
+		  *)
+		    func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		    ;;
+		  esac
+		fi
+	      else
+		eval flag=\"$hardcode_libdir_flag_spec\"
+		func_append dep_rpath " $flag"
+	      fi
+	    elif test -n "$runpath_var"; then
+	      case "$perm_rpath " in
+	      *" $libdir "*) ;;
+	      *) func_append perm_rpath " $libdir" ;;
+	      esac
+	    fi
+	  done
+	  # Substitute the hardcoded libdirs into the rpath.
+	  if test -n "$hardcode_libdir_separator" &&
+	     test -n "$hardcode_libdirs"; then
+	    libdir="$hardcode_libdirs"
+	    eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+	  fi
+	  if test -n "$runpath_var" && test -n "$perm_rpath"; then
+	    # We should set the runpath_var.
+	    rpath=
+	    for dir in $perm_rpath; do
+	      func_append rpath "$dir:"
+	    done
+	    eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+	  fi
+	  test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+	fi
+
+	shlibpath="$finalize_shlibpath"
+	test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+	if test -n "$shlibpath"; then
+	  eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+	fi
+
+	# Get the real and link names of the library.
+	eval shared_ext=\"$shrext_cmds\"
+	eval library_names=\"$library_names_spec\"
+	set dummy $library_names
+	shift
+	realname="$1"
+	shift
+
+	if test -n "$soname_spec"; then
+	  eval soname=\"$soname_spec\"
+	else
+	  soname="$realname"
+	fi
+	if test -z "$dlname"; then
+	  dlname=$soname
+	fi
+
+	lib="$output_objdir/$realname"
+	linknames=
+	for link
+	do
+	  func_append linknames " $link"
+	done
+
+	# Use standard objects if they are pic
+	test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	test "X$libobjs" = "X " && libobjs=
+
+	delfiles=
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+	  export_symbols="$output_objdir/$libname.uexp"
+	  func_append delfiles " $export_symbols"
+	fi
+
+	orig_export_symbols=
+	case $host_os in
+	cygwin* | mingw* | cegcc*)
+	  if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+	    # exporting using user supplied symfile
+	    if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+	      # and it's NOT already a .def file. Must figure out
+	      # which of the given symbols are data symbols and tag
+	      # them as such. So, trigger use of export_symbols_cmds.
+	      # export_symbols gets reassigned inside the "prepare
+	      # the list of exported symbols" if statement, so the
+	      # include_expsyms logic still works.
+	      orig_export_symbols="$export_symbols"
+	      export_symbols=
+	      always_export_symbols=yes
+	    fi
+	  fi
+	  ;;
+	esac
+
+	# Prepare the list of exported symbols
+	if test -z "$export_symbols"; then
+	  if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+	    func_verbose "generating symbol list for \`$libname.la'"
+	    export_symbols="$output_objdir/$libname.exp"
+	    $opt_dry_run || $RM $export_symbols
+	    cmds=$export_symbols_cmds
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd1 in $cmds; do
+	      IFS="$save_ifs"
+	      # Take the normal branch if the nm_file_list_spec branch
+	      # doesn't work or if tool conversion is not needed.
+	      case $nm_file_list_spec~$to_tool_file_cmd in
+		*~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+		  try_normal_branch=yes
+		  eval cmd=\"$cmd1\"
+		  func_len " $cmd"
+		  len=$func_len_result
+		  ;;
+		*)
+		  try_normal_branch=no
+		  ;;
+	      esac
+	      if test "$try_normal_branch" = yes \
+		 && { test "$len" -lt "$max_cmd_len" \
+		      || test "$max_cmd_len" -le -1; }
+	      then
+		func_show_eval "$cmd" 'exit $?'
+		skipped_export=false
+	      elif test -n "$nm_file_list_spec"; then
+		func_basename "$output"
+		output_la=$func_basename_result
+		save_libobjs=$libobjs
+		save_output=$output
+		output=${output_objdir}/${output_la}.nm
+		func_to_tool_file "$output"
+		libobjs=$nm_file_list_spec$func_to_tool_file_result
+		func_append delfiles " $output"
+		func_verbose "creating $NM input file list: $output"
+		for obj in $save_libobjs; do
+		  func_to_tool_file "$obj"
+		  $ECHO "$func_to_tool_file_result"
+		done > "$output"
+		eval cmd=\"$cmd1\"
+		func_show_eval "$cmd" 'exit $?'
+		output=$save_output
+		libobjs=$save_libobjs
+		skipped_export=false
+	      else
+		# The command line is too long to execute in one step.
+		func_verbose "using reloadable object file for export list..."
+		skipped_export=:
+		# Break out early, otherwise skipped_export may be
+		# set to false by a later but shorter cmd.
+		break
+	      fi
+	    done
+	    IFS="$save_ifs"
+	    if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+	fi
+
+	if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	  tmp_export_symbols="$export_symbols"
+	  test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	  $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+	fi
+
+	if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+	  # The given exports_symbols file has to be filtered, so filter it.
+	  func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	  # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	  # 's' commands which not all seds can handle. GNU sed should be fine
+	  # though. Also, the filter scales superlinearly with the number of
+	  # global variables. join(1) would be nice here, but unfortunately
+	  # isn't a blessed tool.
+	  $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	  func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+	  export_symbols=$output_objdir/$libname.def
+	  $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	fi
+
+	tmp_deplibs=
+	for test_deplib in $deplibs; do
+	  case " $convenience " in
+	  *" $test_deplib "*) ;;
+	  *)
+	    func_append tmp_deplibs " $test_deplib"
+	    ;;
+	  esac
+	done
+	deplibs="$tmp_deplibs"
+
+	if test -n "$convenience"; then
+	  if test -n "$whole_archive_flag_spec" &&
+	    test "$compiler_needs_object" = yes &&
+	    test -z "$libobjs"; then
+	    # extract the archives, so we have objects to list.
+	    # TODO: could optimize this to just extract one archive.
+	    whole_archive_flag_spec=
+	  fi
+	  if test -n "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  else
+	    gentop="$output_objdir/${outputname}x"
+	    func_append generated " $gentop"
+
+	    func_extract_archives $gentop $convenience
+	    func_append libobjs " $func_extract_archives_result"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	fi
+
+	if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+	  eval flag=\"$thread_safe_flag_spec\"
+	  func_append linker_flags " $flag"
+	fi
+
+	# Make a backup of the uninstalled library when relinking
+	if test "$opt_mode" = relink; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+	fi
+
+	# Do each of the archive commands.
+	if test "$module" = yes && test -n "$module_cmds" ; then
+	  if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	    eval test_cmds=\"$module_expsym_cmds\"
+	    cmds=$module_expsym_cmds
+	  else
+	    eval test_cmds=\"$module_cmds\"
+	    cmds=$module_cmds
+	  fi
+	else
+	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	    eval test_cmds=\"$archive_expsym_cmds\"
+	    cmds=$archive_expsym_cmds
+	  else
+	    eval test_cmds=\"$archive_cmds\"
+	    cmds=$archive_cmds
+	  fi
+	fi
+
+	if test "X$skipped_export" != "X:" &&
+	   func_len " $test_cmds" &&
+	   len=$func_len_result &&
+	   test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  :
+	else
+	  # The command line is too long to link in one step, link piecewise
+	  # or, if using GNU ld and skipped_export is not :, use a linker
+	  # script.
+
+	  # Save the value of $output and $libobjs because we want to
+	  # use them later.  If we have whole_archive_flag_spec, we
+	  # want to use save_libobjs as it was before
+	  # whole_archive_flag_spec was expanded, because we can't
+	  # assume the linker understands whole_archive_flag_spec.
+	  # This may have to be revisited, in case too many
+	  # convenience libraries get linked in and end up exceeding
+	  # the spec.
+	  if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+	    save_libobjs=$libobjs
+	  fi
+	  save_output=$output
+	  func_basename "$output"
+	  output_la=$func_basename_result
+
+	  # Clear the reloadable object creation command queue and
+	  # initialize k to one.
+	  test_cmds=
+	  concat_cmds=
+	  objlist=
+	  last_robj=
+	  k=1
+
+	  if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+	    output=${output_objdir}/${output_la}.lnkscript
+	    func_verbose "creating GNU ld script: $output"
+	    echo 'INPUT (' > $output
+	    for obj in $save_libobjs
+	    do
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
+	    done
+	    echo ')' >> $output
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$func_to_tool_file_result
+	  elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+	    output=${output_objdir}/${output_la}.lnk
+	    func_verbose "creating linker input file list: $output"
+	    : > $output
+	    set x $save_libobjs
+	    shift
+	    firstobj=
+	    if test "$compiler_needs_object" = yes; then
+	      firstobj="$1 "
+	      shift
+	    fi
+	    for obj
+	    do
+	      func_to_tool_file "$obj"
+	      $ECHO "$func_to_tool_file_result" >> $output
+	    done
+	    func_append delfiles " $output"
+	    func_to_tool_file "$output"
+	    output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+	  else
+	    if test -n "$save_libobjs"; then
+	      func_verbose "creating reloadable object files..."
+	      output=$output_objdir/$output_la-${k}.$objext
+	      eval test_cmds=\"$reload_cmds\"
+	      func_len " $test_cmds"
+	      len0=$func_len_result
+	      len=$len0
+
+	      # Loop over the list of objects to be linked.
+	      for obj in $save_libobjs
+	      do
+		func_len " $obj"
+		func_arith $len + $func_len_result
+		len=$func_arith_result
+		if test "X$objlist" = X ||
+		   test "$len" -lt "$max_cmd_len"; then
+		  func_append objlist " $obj"
+		else
+		  # The command $test_cmds is almost too long, add a
+		  # command to the queue.
+		  if test "$k" -eq 1 ; then
+		    # The first file doesn't have a previous command to add.
+		    reload_objs=$objlist
+		    eval concat_cmds=\"$reload_cmds\"
+		  else
+		    # All subsequent reloadable object files will link in
+		    # the last one created.
+		    reload_objs="$objlist $last_robj"
+		    eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+		  fi
+		  last_robj=$output_objdir/$output_la-${k}.$objext
+		  func_arith $k + 1
+		  k=$func_arith_result
+		  output=$output_objdir/$output_la-${k}.$objext
+		  objlist=" $obj"
+		  func_len " $last_robj"
+		  func_arith $len0 + $func_len_result
+		  len=$func_arith_result
+		fi
+	      done
+	      # Handle the remaining objects by creating one last
+	      # reloadable object file.  All subsequent reloadable object
+	      # files will link in the last one created.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      reload_objs="$objlist $last_robj"
+	      eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+	      if test -n "$last_robj"; then
+	        eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+	      fi
+	      func_append delfiles " $output"
+
+	    else
+	      output=
+	    fi
+
+	    if ${skipped_export-false}; then
+	      func_verbose "generating symbol list for \`$libname.la'"
+	      export_symbols="$output_objdir/$libname.exp"
+	      $opt_dry_run || $RM $export_symbols
+	      libobjs=$output
+	      # Append the command to create the export file.
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+	      if test -n "$last_robj"; then
+		eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+	      fi
+	    fi
+
+	    test -n "$save_libobjs" &&
+	      func_verbose "creating a temporary reloadable object file: $output"
+
+	    # Loop through the commands generated above and execute them.
+	    save_ifs="$IFS"; IFS='~'
+	    for cmd in $concat_cmds; do
+	      IFS="$save_ifs"
+	      $opt_silent || {
+		  func_quote_for_expand "$cmd"
+		  eval "func_echo $func_quote_for_expand_result"
+	      }
+	      $opt_dry_run || eval "$cmd" || {
+		lt_exit=$?
+
+		# Restore the uninstalled library and exit
+		if test "$opt_mode" = relink; then
+		  ( cd "$output_objdir" && \
+		    $RM "${realname}T" && \
+		    $MV "${realname}U" "$realname" )
+		fi
+
+		exit $lt_exit
+	      }
+	    done
+	    IFS="$save_ifs"
+
+	    if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+	      func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+	      func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+	    fi
+	  fi
+
+          if ${skipped_export-false}; then
+	    if test -n "$export_symbols" && test -n "$include_expsyms"; then
+	      tmp_export_symbols="$export_symbols"
+	      test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+	      $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+	    fi
+
+	    if test -n "$orig_export_symbols"; then
+	      # The given exports_symbols file has to be filtered, so filter it.
+	      func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+	      # FIXME: $output_objdir/$libname.filter potentially contains lots of
+	      # 's' commands which not all seds can handle. GNU sed should be fine
+	      # though. Also, the filter scales superlinearly with the number of
+	      # global variables. join(1) would be nice here, but unfortunately
+	      # isn't a blessed tool.
+	      $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+	      func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+	      export_symbols=$output_objdir/$libname.def
+	      $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+	    fi
+	  fi
+
+	  libobjs=$output
+	  # Restore the value of output.
+	  output=$save_output
+
+	  if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+	    eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+	    test "X$libobjs" = "X " && libobjs=
+	  fi
+	  # Expand the library linking commands again to reset the
+	  # value of $libobjs for piecewise linking.
+
+	  # Do each of the archive commands.
+	  if test "$module" = yes && test -n "$module_cmds" ; then
+	    if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+	      cmds=$module_expsym_cmds
+	    else
+	      cmds=$module_cmds
+	    fi
+	  else
+	    if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+	      cmds=$archive_expsym_cmds
+	    else
+	      cmds=$archive_cmds
+	    fi
+	  fi
+	fi
+
+	if test -n "$delfiles"; then
+	  # Append the command to remove temporary files to $cmds.
+	  eval cmds=\"\$cmds~\$RM $delfiles\"
+	fi
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  func_append generated " $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  func_append libobjs " $func_extract_archives_result"
+	  test "X$libobjs" = "X " && libobjs=
+	fi
+
+	save_ifs="$IFS"; IFS='~'
+	for cmd in $cmds; do
+	  IFS="$save_ifs"
+	  eval cmd=\"$cmd\"
+	  $opt_silent || {
+	    func_quote_for_expand "$cmd"
+	    eval "func_echo $func_quote_for_expand_result"
+	  }
+	  $opt_dry_run || eval "$cmd" || {
+	    lt_exit=$?
+
+	    # Restore the uninstalled library and exit
+	    if test "$opt_mode" = relink; then
+	      ( cd "$output_objdir" && \
+	        $RM "${realname}T" && \
+		$MV "${realname}U" "$realname" )
+	    fi
+
+	    exit $lt_exit
+	  }
+	done
+	IFS="$save_ifs"
+
+	# Restore the uninstalled library and exit
+	if test "$opt_mode" = relink; then
+	  $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+	  if test -n "$convenience"; then
+	    if test -z "$whole_archive_flag_spec"; then
+	      func_show_eval '${RM}r "$gentop"'
+	    fi
+	  fi
+
+	  exit $EXIT_SUCCESS
+	fi
+
+	# Create links to the real library.
+	for linkname in $linknames; do
+	  if test "$realname" != "$linkname"; then
+	    func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+	  fi
+	done
+
+	# If -module or -export-dynamic was specified, set the dlname.
+	if test "$module" = yes || test "$export_dynamic" = yes; then
+	  # On all known operating systems, these are identical.
+	  dlname="$soname"
+	fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+	func_warning "\`-dlopen' is ignored for objects"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+	func_warning "\`-l' and \`-L' are ignored for objects" ;;
+      esac
+
+      test -n "$rpath" && \
+	func_warning "\`-rpath' is ignored for objects"
+
+      test -n "$xrpath" && \
+	func_warning "\`-R' is ignored for objects"
+
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for objects"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for objects"
+
+      case $output in
+      *.lo)
+	test -n "$objs$old_deplibs" && \
+	  func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+	libobj=$output
+	func_lo2o "$libobj"
+	obj=$func_lo2o_result
+	;;
+      *)
+	libobj=
+	obj="$output"
+	;;
+      esac
+
+      # Delete the old objects.
+      $opt_dry_run || $RM $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
+      wl=
+
+      if test -n "$convenience"; then
+	if test -n "$whole_archive_flag_spec"; then
+	  eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+	  reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+	else
+	  gentop="$output_objdir/${obj}x"
+	  func_append generated " $gentop"
+
+	  func_extract_archives $gentop $convenience
+	  reload_conv_objs="$reload_objs $func_extract_archives_result"
+	fi
+      fi
+
+      # If we're not building shared, we need to use non_pic_objs
+      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      func_execute_cmds "$reload_cmds" 'exit $?'
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+	if test -n "$gentop"; then
+	  func_show_eval '${RM}r "$gentop"'
+	fi
+
+	# Create an invalid libtool object if no PIC, so that we don't
+	# accidentally link it into a program.
+	# $show "echo timestamp > $libobj"
+	# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+	exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+	# Only do commands if we really have different PIC objects.
+	reload_objs="$libobjs $reload_conv_objs"
+	output="$libobj"
+	func_execute_cmds "$reload_cmds" 'exit $?'
+      fi
+
+      if test -n "$gentop"; then
+	func_show_eval '${RM}r "$gentop"'
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+	*cygwin*) func_stripname '' '.exe' "$output"
+	          output=$func_stripname_result.exe;;
+      esac
+      test -n "$vinfo" && \
+	func_warning "\`-version-info' is ignored for programs"
+
+      test -n "$release" && \
+	func_warning "\`-release' is ignored for programs"
+
+      test "$preload" = yes \
+        && test "$dlopen_support" = unknown \
+	&& test "$dlopen_self" = unknown \
+	&& test "$dlopen_self_static" = unknown && \
+	  func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+	# On Rhapsody replace the C library is the System framework
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+	;;
+      esac
+
+      case $host in
+      *-*-darwin*)
+	# Don't allow lazy linking, it breaks C++ global constructors
+	# But is supposedly fixed on 10.4 or later (yay!).
+	if test "$tagname" = CXX ; then
+	  case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+	    10.[0123])
+	      func_append compile_command " ${wl}-bind_at_load"
+	      func_append finalize_command " ${wl}-bind_at_load"
+	    ;;
+	  esac
+	fi
+	# Time to change all our "foo.ltframework" stuff back to "-framework foo"
+	compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+	;;
+      esac
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+	case " $new_libs " in
+	*" -L$path/$objdir "*) ;;
+	*)
+	  case " $compile_deplibs " in
+	  *" -L$path/$objdir "*)
+	    func_append new_libs " -L$path/$objdir" ;;
+	  esac
+	  ;;
+	esac
+      done
+      for deplib in $compile_deplibs; do
+	case $deplib in
+	-L*)
+	  case " $new_libs " in
+	  *" $deplib "*) ;;
+	  *) func_append new_libs " $deplib" ;;
+	  esac
+	  ;;
+	*) func_append new_libs " $deplib" ;;
+	esac
+      done
+      compile_deplibs="$new_libs"
+
+
+      func_append compile_command " $compile_deplibs"
+      func_append finalize_command " $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+	# If the user specified any rpath flags, then add them.
+	for libdir in $rpath $xrpath; do
+	  # This is the magic to use -rpath.
+	  case "$finalize_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append finalize_rpath " $libdir" ;;
+	  esac
+	done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    func_append rpath " $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append perm_rpath " $libdir" ;;
+	  esac
+	fi
+	case $host in
+	*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+	  testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+	  case :$dllsearchpath: in
+	  *":$libdir:"*) ;;
+	  ::) dllsearchpath=$libdir;;
+	  *) func_append dllsearchpath ":$libdir";;
+	  esac
+	  case :$dllsearchpath: in
+	  *":$testbindir:"*) ;;
+	  ::) dllsearchpath=$testbindir;;
+	  *) func_append dllsearchpath ":$testbindir";;
+	  esac
+	  ;;
+	esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+	if test -n "$hardcode_libdir_flag_spec"; then
+	  if test -n "$hardcode_libdir_separator"; then
+	    if test -z "$hardcode_libdirs"; then
+	      hardcode_libdirs="$libdir"
+	    else
+	      # Just accumulate the unique libdirs.
+	      case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+	      *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+		;;
+	      *)
+		func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+		;;
+	      esac
+	    fi
+	  else
+	    eval flag=\"$hardcode_libdir_flag_spec\"
+	    func_append rpath " $flag"
+	  fi
+	elif test -n "$runpath_var"; then
+	  case "$finalize_perm_rpath " in
+	  *" $libdir "*) ;;
+	  *) func_append finalize_perm_rpath " $libdir" ;;
+	  esac
+	fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+	 test -n "$hardcode_libdirs"; then
+	libdir="$hardcode_libdirs"
+	eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+	# Transform all the library objects into standard objects.
+	compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+	finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+      fi
+
+      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+	func_execute_cmds "$prelink_cmds" 'exit $?'
+      fi
+
+      wrappers_required=yes
+      case $host in
+      *cegcc* | *mingw32ce*)
+        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
+      *cygwin* | *mingw* )
+        if test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      *)
+        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      esac
+      if test "$wrappers_required" = no; then
+	# Replace the output file specification.
+	compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+	link_command="$compile_command$compile_rpath"
+
+	# We have no uninstalled library dependencies, so finalize right now.
+	exit_status=0
+	func_show_eval "$link_command" 'exit_status=$?'
+
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
+	fi
+
+	# Delete the generated files.
+	if test -f "$output_objdir/${outputname}S.${objext}"; then
+	  func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+	fi
+
+	exit $exit_status
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+	compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+	finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+	if test -n "$perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $perm_rpath; do
+	    func_append rpath "$dir:"
+	  done
+	  compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+	if test -n "$finalize_perm_rpath"; then
+	  # We should set the runpath_var.
+	  rpath=
+	  for dir in $finalize_perm_rpath; do
+	    func_append rpath "$dir:"
+	  done
+	  finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+	fi
+      fi
+
+      if test "$no_install" = yes; then
+	# We don't need to create a wrapper script.
+	link_command="$compile_var$compile_command$compile_rpath"
+	# Replace the output file specification.
+	link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+	# Delete the old output file.
+	$opt_dry_run || $RM $output
+	# Link the executable and exit
+	func_show_eval "$link_command" 'exit $?'
+
+	if test -n "$postlink_cmds"; then
+	  func_to_tool_file "$output"
+	  postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	  func_execute_cmds "$postlink_cmds" 'exit $?'
+	fi
+
+	exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+	# Fast installation is not supported
+	link_command="$compile_var$compile_command$compile_rpath"
+	relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+	func_warning "this platform does not like uninstalled shared libraries"
+	func_warning "\`$output' will be relinked during installation"
+      else
+	if test "$fast_install" != no; then
+	  link_command="$finalize_var$compile_command$finalize_rpath"
+	  if test "$fast_install" = yes; then
+	    relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+	  else
+	    # fast_install is set to needless
+	    relink_command=
+	  fi
+	else
+	  link_command="$compile_var$compile_command$compile_rpath"
+	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      func_show_eval "$link_command" 'exit $?'
+
+      if test -n "$postlink_cmds"; then
+	func_to_tool_file "$output_objdir/$outputname"
+	postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+	func_execute_cmds "$postlink_cmds" 'exit $?'
+      fi
+
+      # Now create the wrapper script.
+      func_verbose "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+	# Preserve any variables that may affect compiler behavior
+	for var in $variables_saved_for_relink; do
+	  if eval test -z \"\${$var+set}\"; then
+	    relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	  elif eval var_value=\$$var; test -z "$var_value"; then
+	    relink_command="$var=; export $var; $relink_command"
+	  else
+	    func_quote_for_eval "$var_value"
+	    relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	  fi
+	done
+	relink_command="(cd `pwd`; $relink_command)"
+	relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
+	# win32 will think the script is a binary if it has
+	# a .exe suffix, so we strip it off here.
+	case $output in
+	  *.exe) func_stripname '' '.exe' "$output"
+	         output=$func_stripname_result ;;
+	esac
+	# test for cygwin because mv fails w/o .exe extensions
+	case $host in
+	  *cygwin*)
+	    exeext=.exe
+	    func_stripname '' '.exe' "$outputname"
+	    outputname=$func_stripname_result ;;
+	  *) exeext= ;;
+	esac
+	case $host in
+	  *cygwin* | *mingw* )
+	    func_dirname_and_basename "$output" "" "."
+	    output_name=$func_basename_result
+	    output_path=$func_dirname_result
+	    cwrappersource="$output_path/$objdir/lt-$output_name.c"
+	    cwrapper="$output_path/$output_name.exe"
+	    $RM $cwrappersource $cwrapper
+	    trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_cwrapperexe_src > $cwrappersource
+
+	    # The wrapper executable is built using the $host compiler,
+	    # because it contains $host paths and files. If cross-
+	    # compiling, it, like the target executable, must be
+	    # executed on the $host or under an emulation environment.
+	    $opt_dry_run || {
+	      $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+	      $STRIP $cwrapper
+	    }
+
+	    # Now, create the wrapper script for func_source use:
+	    func_ltwrapper_scriptname $cwrapper
+	    $RM $func_ltwrapper_scriptname_result
+	    trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+	    $opt_dry_run || {
+	      # note: this script will not be executed, so do not chmod.
+	      if test "x$build" = "x$host" ; then
+		$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+	      else
+		func_emit_wrapper no > $func_ltwrapper_scriptname_result
+	      fi
+	    }
+	  ;;
+	  * )
+	    $RM $output
+	    trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+	    func_emit_wrapper no > $output
+	    chmod +x $output
+	  ;;
+	esac
+      }
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+	oldobjs="$libobjs_save $symfileobj"
+	addlibs="$convenience"
+	build_libtool_libs=no
+      else
+	if test "$build_libtool_libs" = module; then
+	  oldobjs="$libobjs_save"
+	  build_libtool_libs=no
+	else
+	  oldobjs="$old_deplibs $non_pic_objects"
+	  if test "$preload" = yes && test -f "$symfileobj"; then
+	    func_append oldobjs " $symfileobj"
+	  fi
+	fi
+	addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+	gentop="$output_objdir/${outputname}x"
+	func_append generated " $gentop"
+
+	func_extract_archives $gentop $addlibs
+	func_append oldobjs " $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+	cmds=$old_archive_from_new_cmds
+      else
+
+	# Add any objects from preloaded convenience libraries
+	if test -n "$dlprefiles"; then
+	  gentop="$output_objdir/${outputname}x"
+	  func_append generated " $gentop"
+
+	  func_extract_archives $gentop $dlprefiles
+	  func_append oldobjs " $func_extract_archives_result"
+	fi
+
+	# POSIX demands no paths to be encoded in archives.  We have
+	# to avoid creating archives with duplicate basenames if we
+	# might have to extract them afterwards, e.g., when creating a
+	# static archive out of a convenience library, or when linking
+	# the entirety of a libtool archive into another (currently
+	# not supported by libtool).
+	if (for obj in $oldobjs
+	    do
+	      func_basename "$obj"
+	      $ECHO "$func_basename_result"
+	    done | sort | sort -uc >/dev/null 2>&1); then
+	  :
+	else
+	  echo "copying selected object files to avoid basename conflicts..."
+	  gentop="$output_objdir/${outputname}x"
+	  func_append generated " $gentop"
+	  func_mkdir_p "$gentop"
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  counter=1
+	  for obj in $save_oldobjs
+	  do
+	    func_basename "$obj"
+	    objbase="$func_basename_result"
+	    case " $oldobjs " in
+	    " ") oldobjs=$obj ;;
+	    *[\ /]"$objbase "*)
+	      while :; do
+		# Make sure we don't pick an alternate name that also
+		# overlaps.
+		newobj=lt$counter-$objbase
+		func_arith $counter + 1
+		counter=$func_arith_result
+		case " $oldobjs " in
+		*[\ /]"$newobj "*) ;;
+		*) if test ! -f "$gentop/$newobj"; then break; fi ;;
+		esac
+	      done
+	      func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+	      func_append oldobjs " $gentop/$newobj"
+	      ;;
+	    *) func_append oldobjs " $obj" ;;
+	    esac
+	  done
+	fi
+	func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+	tool_oldlib=$func_to_tool_file_result
+	eval cmds=\"$old_archive_cmds\"
+
+	func_len " $cmds"
+	len=$func_len_result
+	if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+	  cmds=$old_archive_cmds
+	elif test -n "$archiver_list_spec"; then
+	  func_verbose "using command file archive linking..."
+	  for obj in $oldobjs
+	  do
+	    func_to_tool_file "$obj"
+	    $ECHO "$func_to_tool_file_result"
+	  done > $output_objdir/$libname.libcmd
+	  func_to_tool_file "$output_objdir/$libname.libcmd"
+	  oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+	  cmds=$old_archive_cmds
+	else
+	  # the command line is too long to link in one step, link in parts
+	  func_verbose "using piecewise archive linking..."
+	  save_RANLIB=$RANLIB
+	  RANLIB=:
+	  objlist=
+	  concat_cmds=
+	  save_oldobjs=$oldobjs
+	  oldobjs=
+	  # Is there a better way of finding the last object in the list?
+	  for obj in $save_oldobjs
+	  do
+	    last_oldobj=$obj
+	  done
+	  eval test_cmds=\"$old_archive_cmds\"
+	  func_len " $test_cmds"
+	  len0=$func_len_result
+	  len=$len0
+	  for obj in $save_oldobjs
+	  do
+	    func_len " $obj"
+	    func_arith $len + $func_len_result
+	    len=$func_arith_result
+	    func_append objlist " $obj"
+	    if test "$len" -lt "$max_cmd_len"; then
+	      :
+	    else
+	      # the above command should be used before it gets too long
+	      oldobjs=$objlist
+	      if test "$obj" = "$last_oldobj" ; then
+		RANLIB=$save_RANLIB
+	      fi
+	      test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+	      eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+	      objlist=
+	      len=$len0
+	    fi
+	  done
+	  RANLIB=$save_RANLIB
+	  oldobjs=$objlist
+	  if test "X$oldobjs" = "X" ; then
+	    eval cmds=\"\$concat_cmds\"
+	  else
+	    eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+	  fi
+	fi
+      fi
+      func_execute_cmds "$cmds" 'exit $?'
+    done
+
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      func_verbose "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+	if eval test -z \"\${$var+set}\"; then
+	  relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+	elif eval var_value=\$$var; test -z "$var_value"; then
+	  relink_command="$var=; export $var; $relink_command"
+	else
+	  func_quote_for_eval "$var_value"
+	  relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+	fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+	relink_command=
+      fi
+
+      # Only create the output if not a dry run.
+      $opt_dry_run || {
+	for installed in no yes; do
+	  if test "$installed" = yes; then
+	    if test -z "$install_libdir"; then
+	      break
+	    fi
+	    output="$output_objdir/$outputname"i
+	    # Replace all uninstalled libtool libraries with the installed ones
+	    newdependency_libs=
+	    for deplib in $dependency_libs; do
+	      case $deplib in
+	      *.la)
+		func_basename "$deplib"
+		name="$func_basename_result"
+		func_resolve_sysroot "$deplib"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$deplib' is not a valid libtool archive"
+		func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      -L*)
+		func_stripname -L '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -L$func_replace_sysroot_result"
+		;;
+	      -R*)
+		func_stripname -R '' "$deplib"
+		func_replace_sysroot "$func_stripname_result"
+		func_append newdependency_libs " -R$func_replace_sysroot_result"
+		;;
+	      *) func_append newdependency_libs " $deplib" ;;
+	      esac
+	    done
+	    dependency_libs="$newdependency_libs"
+	    newdlfiles=
+
+	    for lib in $dlfiles; do
+	      case $lib in
+	      *.la)
+	        func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      *) func_append newdlfiles " $lib" ;;
+	      esac
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+	      *.la)
+		# Only pass preopened files to the pseudo-archive (for
+		# eventual linking with the app. that links it) if we
+		# didn't already link the preopened objects directly into
+		# the library:
+		func_basename "$lib"
+		name="$func_basename_result"
+		eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+		test -z "$libdir" && \
+		  func_fatal_error "\`$lib' is not a valid libtool archive"
+		func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+		;;
+	      esac
+	    done
+	    dlprefiles="$newdlprefiles"
+	  else
+	    newdlfiles=
+	    for lib in $dlfiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      func_append newdlfiles " $abs"
+	    done
+	    dlfiles="$newdlfiles"
+	    newdlprefiles=
+	    for lib in $dlprefiles; do
+	      case $lib in
+		[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+		*) abs=`pwd`"/$lib" ;;
+	      esac
+	      func_append newdlprefiles " $abs"
+	    done
+	    dlprefiles="$newdlprefiles"
+	  fi
+	  $RM $output
+	  # place dlname in correct position for cygwin
+	  # In fact, it would be nice if we could use this code for all target
+	  # systems that can't hard-code library paths into their executables
+	  # and that have no shared library path variable independent of PATH,
+	  # but it turns out we can't easily determine that from inspecting
+	  # libtool variables, so we have to hard-code the OSs to which it
+	  # applies here; at the moment, that means platforms that use the PE
+	  # object format with DLL files.  See the long comment at the top of
+	  # tests/bindir.at for full details.
+	  tdlname=$dlname
+	  case $host,$output,$installed,$module,$dlname in
+	    *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+	      # If a -bindir argument was supplied, place the dll there.
+	      if test "x$bindir" != x ;
+	      then
+		func_relative_path "$install_libdir" "$bindir"
+		tdlname=$func_relative_path_result$dlname
+	      else
+		# Otherwise fall back on heuristic.
+		tdlname=../bin/$dlname
+	      fi
+	      ;;
+	  esac
+	  $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+	  if test "$installed" = no && test "$need_relink" = yes; then
+	    $ECHO >> $output "\
+relink_command=\"$relink_command\""
+	  fi
+	done
+      }
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+    func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $opt_debug
+    RM="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) func_append RM " $arg"; rmforce=yes ;;
+      -*) func_append RM " $arg" ;;
+      *) func_append files " $arg" ;;
+      esac
+    done
+
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
+
+    rmdirs=
+
+    for file in $files; do
+      func_dirname "$file" "" "."
+      dir="$func_dirname_result"
+      if test "X$dir" = X.; then
+	odir="$objdir"
+      else
+	odir="$dir/$objdir"
+      fi
+      func_basename "$file"
+      name="$func_basename_result"
+      test "$opt_mode" = uninstall && odir="$dir"
+
+      # Remember odir for removal later, being careful to avoid duplicates
+      if test "$opt_mode" = clean; then
+	case " $rmdirs " in
+	  *" $odir "*) ;;
+	  *) func_append rmdirs " $odir" ;;
+	esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+	 { test -h "$file"; } >/dev/null 2>&1 ||
+	 test -f "$file"; then
+	:
+      elif test -d "$file"; then
+	exit_status=1
+	continue
+      elif test "$rmforce" = yes; then
+	continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+	# Possibly a libtool archive, so verify it.
+	if func_lalib_p "$file"; then
+	  func_source $dir/$name
+
+	  # Delete the libtool libraries and symlinks.
+	  for n in $library_names; do
+	    func_append rmfiles " $odir/$n"
+	  done
+	  test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+	  case "$opt_mode" in
+	  clean)
+	    case " $library_names " in
+	    *" $dlname "*) ;;
+	    *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+	    esac
+	    test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+	    ;;
+	  uninstall)
+	    if test -n "$library_names"; then
+	      # Do each command in the postuninstall commands.
+	      func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	    fi
+
+	    if test -n "$old_library"; then
+	      # Do each command in the old_postuninstall commands.
+	      func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+	    fi
+	    # FIXME: should reinstall the best remaining shared library.
+	    ;;
+	  esac
+	fi
+	;;
+
+      *.lo)
+	# Possibly a libtool object, so verify it.
+	if func_lalib_p "$file"; then
+
+	  # Read the .lo file
+	  func_source $dir/$name
+
+	  # Add PIC object to the list of files to remove.
+	  if test -n "$pic_object" &&
+	     test "$pic_object" != none; then
+	    func_append rmfiles " $dir/$pic_object"
+	  fi
+
+	  # Add non-PIC object to the list of files to remove.
+	  if test -n "$non_pic_object" &&
+	     test "$non_pic_object" != none; then
+	    func_append rmfiles " $dir/$non_pic_object"
+	  fi
+	fi
+	;;
+
+      *)
+	if test "$opt_mode" = clean ; then
+	  noexename=$name
+	  case $file in
+	  *.exe)
+	    func_stripname '' '.exe' "$file"
+	    file=$func_stripname_result
+	    func_stripname '' '.exe' "$name"
+	    noexename=$func_stripname_result
+	    # $file with .exe has already been added to rmfiles,
+	    # add $file without .exe
+	    func_append rmfiles " $file"
+	    ;;
+	  esac
+	  # Do a test to see if this is a libtool program.
+	  if func_ltwrapper_p "$file"; then
+	    if func_ltwrapper_executable_p "$file"; then
+	      func_ltwrapper_scriptname "$file"
+	      relink_command=
+	      func_source $func_ltwrapper_scriptname_result
+	      func_append rmfiles " $func_ltwrapper_scriptname_result"
+	    else
+	      relink_command=
+	      func_source $dir/$noexename
+	    fi
+
+	    # note $name still contains .exe if it was in $file originally
+	    # as does the version of $file that was added into $rmfiles
+	    func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+	    if test "$fast_install" = yes && test -n "$relink_command"; then
+	      func_append rmfiles " $odir/lt-$name"
+	    fi
+	    if test "X$noexename" != "X$name" ; then
+	      func_append rmfiles " $odir/lt-${noexename}.c"
+	    fi
+	  fi
+	fi
+	;;
+      esac
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
+    done
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+	func_show_eval "rmdir $dir >/dev/null 2>&1"
+      fi
+    done
+
+    exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+    func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+  help="$generic_help"
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+  eval exec "$exec_cmd"
+  exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/libcdi/config/missing b/libcdi/config/missing
new file mode 100755
index 0000000..28055d2
--- /dev/null
+++ b/libcdi/config/missing
@@ -0,0 +1,376 @@
+#! /bin/sh
+# Common stub for a few missing GNU programs while installing.
+
+scriptversion=2009-04-28.21; # UTC
+
+# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
+# 2008, 2009 Free Software Foundation, Inc.
+# Originally by Fran,cois Pinard <pinard at iro.umontreal.ca>, 1996.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+if test $# -eq 0; then
+  echo 1>&2 "Try \`$0 --help' for more information"
+  exit 1
+fi
+
+run=:
+sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
+sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
+
+# In the cases where this matters, `missing' is being run in the
+# srcdir already.
+if test -f configure.ac; then
+  configure_ac=configure.ac
+else
+  configure_ac=configure.in
+fi
+
+msg="missing on your system"
+
+case $1 in
+--run)
+  # Try to run requested program, and just exit if it succeeds.
+  run=
+  shift
+  "$@" && exit 0
+  # Exit code 63 means version mismatch.  This often happens
+  # when the user try to use an ancient version of a tool on
+  # a file that requires a minimum version.  In this case we
+  # we should proceed has if the program had been absent, or
+  # if --run hadn't been passed.
+  if test $? = 63; then
+    run=:
+    msg="probably too old"
+  fi
+  ;;
+
+  -h|--h|--he|--hel|--help)
+    echo "\
+$0 [OPTION]... PROGRAM [ARGUMENT]...
+
+Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
+error status if there is no known handling for PROGRAM.
+
+Options:
+  -h, --help      display this help and exit
+  -v, --version   output version information and exit
+  --run           try to run the given command, and emulate it if it fails
+
+Supported PROGRAM values:
+  aclocal      touch file \`aclocal.m4'
+  autoconf     touch file \`configure'
+  autoheader   touch file \`config.h.in'
+  autom4te     touch the output file, or create a stub one
+  automake     touch all \`Makefile.in' files
+  bison        create \`y.tab.[ch]', if possible, from existing .[ch]
+  flex         create \`lex.yy.c', if possible, from existing .c
+  help2man     touch the output file
+  lex          create \`lex.yy.c', if possible, from existing .c
+  makeinfo     touch the output file
+  tar          try tar, gnutar, gtar, then tar without non-portable flags
+  yacc         create \`y.tab.[ch]', if possible, from existing .[ch]
+
+Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
+\`g' are ignored when checking the name.
+
+Send bug reports to <bug-automake at gnu.org>."
+    exit $?
+    ;;
+
+  -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
+    echo "missing $scriptversion (GNU Automake)"
+    exit $?
+    ;;
+
+  -*)
+    echo 1>&2 "$0: Unknown \`$1' option"
+    echo 1>&2 "Try \`$0 --help' for more information"
+    exit 1
+    ;;
+
+esac
+
+# normalize program name to check for.
+program=`echo "$1" | sed '
+  s/^gnu-//; t
+  s/^gnu//; t
+  s/^g//; t'`
+
+# Now exit if we have it, but it failed.  Also exit now if we
+# don't have it and --version was passed (most likely to detect
+# the program).  This is about non-GNU programs, so use $1 not
+# $program.
+case $1 in
+  lex*|yacc*)
+    # Not GNU programs, they don't have --version.
+    ;;
+
+  tar*)
+    if test -n "$run"; then
+       echo 1>&2 "ERROR: \`tar' requires --run"
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       exit 1
+    fi
+    ;;
+
+  *)
+    if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
+       # We have it, but it failed.
+       exit 1
+    elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
+       # Could not run --version or --help.  This is probably someone
+       # running `$TOOL --version' or `$TOOL --help' to check whether
+       # $TOOL exists and not knowing $TOOL uses missing.
+       exit 1
+    fi
+    ;;
+esac
+
+# If it does not exist, or fails to run (possibly an outdated version),
+# try to emulate it.
+case $program in
+  aclocal*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acinclude.m4' or \`${configure_ac}'.  You might want
+         to install the \`Automake' and \`Perl' packages.  Grab them from
+         any GNU archive site."
+    touch aclocal.m4
+    ;;
+
+  autoconf*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`${configure_ac}'.  You might want to install the
+         \`Autoconf' and \`GNU m4' packages.  Grab them from any GNU
+         archive site."
+    touch configure
+    ;;
+
+  autoheader*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`acconfig.h' or \`${configure_ac}'.  You might want
+         to install the \`Autoconf' and \`GNU m4' packages.  Grab them
+         from any GNU archive site."
+    files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
+    test -z "$files" && files="config.h"
+    touch_files=
+    for f in $files; do
+      case $f in
+      *:*) touch_files="$touch_files "`echo "$f" |
+				       sed -e 's/^[^:]*://' -e 's/:.*//'`;;
+      *) touch_files="$touch_files $f.in";;
+      esac
+    done
+    touch $touch_files
+    ;;
+
+  automake*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
+         You might want to install the \`Automake' and \`Perl' packages.
+         Grab them from any GNU archive site."
+    find . -type f -name Makefile.am -print |
+	   sed 's/\.am$/.in/' |
+	   while read f; do touch "$f"; done
+    ;;
+
+  autom4te*)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, but is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.
+         You can get \`$1' as part of \`Autoconf' from any GNU
+         archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo "#! /bin/sh"
+	echo "# Created by GNU Automake missing as a replacement of"
+	echo "#  $ $@"
+	echo "exit 0"
+	chmod +x $file
+	exit 1
+    fi
+    ;;
+
+  bison*|yacc*)
+    echo 1>&2 "\
+WARNING: \`$1' $msg.  You should only need it if
+         you modified a \`.y' file.  You may need the \`Bison' package
+         in order for those modifications to take effect.  You can get
+         \`Bison' from any GNU archive site."
+    rm -f y.tab.c y.tab.h
+    if test $# -ne 1; then
+        eval LASTARG="\${$#}"
+	case $LASTARG in
+	*.y)
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" y.tab.c
+	    fi
+	    SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" y.tab.h
+	    fi
+	  ;;
+	esac
+    fi
+    if test ! -f y.tab.h; then
+	echo >y.tab.h
+    fi
+    if test ! -f y.tab.c; then
+	echo 'main() { return 0; }' >y.tab.c
+    fi
+    ;;
+
+  lex*|flex*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.l' file.  You may need the \`Flex' package
+         in order for those modifications to take effect.  You can get
+         \`Flex' from any GNU archive site."
+    rm -f lex.yy.c
+    if test $# -ne 1; then
+        eval LASTARG="\${$#}"
+	case $LASTARG in
+	*.l)
+	    SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
+	    if test -f "$SRCFILE"; then
+	         cp "$SRCFILE" lex.yy.c
+	    fi
+	  ;;
+	esac
+    fi
+    if test ! -f lex.yy.c; then
+	echo 'main() { return 0; }' >lex.yy.c
+    fi
+    ;;
+
+  help2man*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+	 you modified a dependency of a manual page.  You may need the
+	 \`Help2man' package in order for those modifications to take
+	 effect.  You can get \`Help2man' from any GNU archive site."
+
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -f "$file"; then
+	touch $file
+    else
+	test -z "$file" || exec >$file
+	echo ".ab help2man is required to generate this page"
+	exit $?
+    fi
+    ;;
+
+  makeinfo*)
+    echo 1>&2 "\
+WARNING: \`$1' is $msg.  You should only need it if
+         you modified a \`.texi' or \`.texinfo' file, or any other file
+         indirectly affecting the aspect of the manual.  The spurious
+         call might also be the consequence of using a buggy \`make' (AIX,
+         DU, IRIX).  You might want to install the \`Texinfo' package or
+         the \`GNU make' package.  Grab either from any GNU archive site."
+    # The file to touch is that specified with -o ...
+    file=`echo "$*" | sed -n "$sed_output"`
+    test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
+    if test -z "$file"; then
+      # ... or it is the one specified with @setfilename ...
+      infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
+      file=`sed -n '
+	/^@setfilename/{
+	  s/.* \([^ ]*\) *$/\1/
+	  p
+	  q
+	}' $infile`
+      # ... or it is derived from the source name (dir/f.texi becomes f.info)
+      test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
+    fi
+    # If the file does not exist, the user really needs makeinfo;
+    # let's fail without touching anything.
+    test -f $file || exit 1
+    touch $file
+    ;;
+
+  tar*)
+    shift
+
+    # We have already tried tar in the generic part.
+    # Look for gnutar/gtar before invocation to avoid ugly error
+    # messages.
+    if (gnutar --version > /dev/null 2>&1); then
+       gnutar "$@" && exit 0
+    fi
+    if (gtar --version > /dev/null 2>&1); then
+       gtar "$@" && exit 0
+    fi
+    firstarg="$1"
+    if shift; then
+	case $firstarg in
+	*o*)
+	    firstarg=`echo "$firstarg" | sed s/o//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+	case $firstarg in
+	*h*)
+	    firstarg=`echo "$firstarg" | sed s/h//`
+	    tar "$firstarg" "$@" && exit 0
+	    ;;
+	esac
+    fi
+
+    echo 1>&2 "\
+WARNING: I can't seem to be able to run \`tar' with the given arguments.
+         You may want to install GNU tar or Free paxutils, or check the
+         command line arguments."
+    exit 1
+    ;;
+
+  *)
+    echo 1>&2 "\
+WARNING: \`$1' is needed, and is $msg.
+         You might have modified some files without having the
+         proper tools for further handling them.  Check the \`README' file,
+         it often tells you about the needed prerequisites for installing
+         this package.  You may also peek at any GNU archive site, in case
+         some other package would contain this missing \`$1' program."
+    exit 1
+    ;;
+esac
+
+exit 0
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-time-zone: "UTC"
+# time-stamp-end: "; # UTC"
+# End:
diff --git a/libcdi/config/mkinstalldirs b/libcdi/config/mkinstalldirs
new file mode 100755
index 0000000..ef7e16f
--- /dev/null
+++ b/libcdi/config/mkinstalldirs
@@ -0,0 +1,161 @@
+#! /bin/sh
+# mkinstalldirs --- make directory hierarchy
+
+scriptversion=2006-05-11.19
+
+# Original author: Noah Friedman <friedman at prep.ai.mit.edu>
+# Created: 1993-05-16
+# Public domain.
+#
+# This file is maintained in Automake, please report
+# bugs to <bug-automake at gnu.org> or send patches to
+# <automake-patches at gnu.org>.
+
+nl='
+'
+IFS=" ""	$nl"
+errstatus=0
+dirmode=
+
+usage="\
+Usage: mkinstalldirs [-h] [--help] [--version] [-m MODE] DIR ...
+
+Create each directory DIR (with mode MODE, if specified), including all
+leading file name components.
+
+Report bugs to <bug-automake at gnu.org>."
+
+# process command line arguments
+while test $# -gt 0 ; do
+  case $1 in
+    -h | --help | --h*)         # -h for help
+      echo "$usage"
+      exit $?
+      ;;
+    -m)                         # -m PERM arg
+      shift
+      test $# -eq 0 && { echo "$usage" 1>&2; exit 1; }
+      dirmode=$1
+      shift
+      ;;
+    --version)
+      echo "$0 $scriptversion"
+      exit $?
+      ;;
+    --)                         # stop option processing
+      shift
+      break
+      ;;
+    -*)                         # unknown option
+      echo "$usage" 1>&2
+      exit 1
+      ;;
+    *)                          # first non-opt arg
+      break
+      ;;
+  esac
+done
+
+for file
+do
+  if test -d "$file"; then
+    shift
+  else
+    break
+  fi
+done
+
+case $# in
+  0) exit 0 ;;
+esac
+
+# Solaris 8's mkdir -p isn't thread-safe.  If you mkdir -p a/b and
+# mkdir -p a/c at the same time, both will detect that a is missing,
+# one will create a, then the other will try to create a and die with
+# a "File exists" error.  This is a problem when calling mkinstalldirs
+# from a parallel make.  We use --version in the probe to restrict
+# ourselves to GNU mkdir, which is thread-safe.
+case $dirmode in
+  '')
+    if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
+      echo "mkdir -p -- $*"
+      exec mkdir -p -- "$@"
+    else
+      # On NextStep and OpenStep, the `mkdir' command does not
+      # recognize any option.  It will interpret all options as
+      # directories to create, and then abort because `.' already
+      # exists.
+      test -d ./-p && rmdir ./-p
+      test -d ./--version && rmdir ./--version
+    fi
+    ;;
+  *)
+    if mkdir -m "$dirmode" -p --version . >/dev/null 2>&1 &&
+       test ! -d ./--version; then
+      echo "mkdir -m $dirmode -p -- $*"
+      exec mkdir -m "$dirmode" -p -- "$@"
+    else
+      # Clean up after NextStep and OpenStep mkdir.
+      for d in ./-m ./-p ./--version "./$dirmode";
+      do
+        test -d $d && rmdir $d
+      done
+    fi
+    ;;
+esac
+
+for file
+do
+  case $file in
+    /*) pathcomp=/ ;;
+    *)  pathcomp= ;;
+  esac
+  oIFS=$IFS
+  IFS=/
+  set fnord $file
+  shift
+  IFS=$oIFS
+
+  for d
+  do
+    test "x$d" = x && continue
+
+    pathcomp=$pathcomp$d
+    case $pathcomp in
+      -*) pathcomp=./$pathcomp ;;
+    esac
+
+    if test ! -d "$pathcomp"; then
+      echo "mkdir $pathcomp"
+
+      mkdir "$pathcomp" || lasterr=$?
+
+      if test ! -d "$pathcomp"; then
+	errstatus=$lasterr
+      else
+	if test ! -z "$dirmode"; then
+	  echo "chmod $dirmode $pathcomp"
+	  lasterr=
+	  chmod "$dirmode" "$pathcomp" || lasterr=$?
+
+	  if test ! -z "$lasterr"; then
+	    errstatus=$lasterr
+	  fi
+	fi
+      fi
+    fi
+
+    pathcomp=$pathcomp/
+  done
+done
+
+exit $errstatus
+
+# Local Variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "scriptversion="
+# time-stamp-format: "%:y-%02m-%02d.%02H"
+# time-stamp-end: "$"
+# End:
diff --git a/libcdi/configure b/libcdi/configure
new file mode 100755
index 0000000..ecd6378
--- /dev/null
+++ b/libcdi/configure
@@ -0,0 +1,30167 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.68 for cdi 1.5.9.
+#
+# Report bugs to <http://code.zmaw.de/projects/cdi>.
+#
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software
+# Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+if test "x$CONFIG_SHELL" = x; then
+  as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+test x\$exitcode = x0 || exit 1"
+  as_suggested="  as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO
+  as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO
+  eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     # Try only shells that exist, to save several forks.
+	     as_shell=$as_dir/$as_base
+	     if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		    { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+		   if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+	   done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+	      { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  # We cannot yet assume a decent shell, so we have to provide a
+	# neutralization value for shells without unset; and this also
+	# works around shells that cannot unset nonexistent variables.
+	# Preserve -v and -x to the replacement shell.
+	BASH_ENV=/dev/null
+	ENV=/dev/null
+	(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV
+	export CONFIG_SHELL
+	case $- in # ((((
+	  *v*x* | *x*v* ) as_opts=-vx ;;
+	  *v* ) as_opts=-v ;;
+	  *x* ) as_opts=-x ;;
+	  * ) as_opts= ;;
+	esac
+	exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"}
+fi
+
+    if test x$as_have_required = xno; then :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf at gnu.org and
+$0: http://code.zmaw.de/projects/cdi about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in #(
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='cdi'
+PACKAGE_TARNAME='cdi'
+PACKAGE_VERSION='1.5.9'
+PACKAGE_STRING='cdi 1.5.9'
+PACKAGE_BUGREPORT='http://code.zmaw.de/projects/cdi'
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_header_list=
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+USE_FC_FALSE
+USE_FC_TRUE
+CREATE_INTERFACES_FALSE
+CREATE_INTERFACES_TRUE
+ENABLE_PYTHON
+ENABLE_PYTHON_FALSE
+ENABLE_PYTHON_TRUE
+PYTHON
+ENABLE_RUBY
+ENABLE_RUBY_FALSE
+ENABLE_RUBY_TRUE
+RUBY
+ENABLE_SWIG_FALSE
+ENABLE_SWIG_TRUE
+SWIG
+FCMODCASE
+FCMODEXT
+CDI_F90_INTERFACE_FCFLAGS
+FC_MOD_FLAG
+CREATE_ISOC_FALSE
+CREATE_ISOC_TRUE
+USE_MPI
+USE_MPI_FALSE
+USE_MPI_TRUE
+MPI_LAUNCH
+ENABLE_ALL_STATIC_FALSE
+ENABLE_ALL_STATIC_TRUE
+ENABLE_CDI_LIB
+ENABLE_CDI_LIB_FALSE
+ENABLE_CDI_LIB_TRUE
+ENABLE_IEG
+ENABLE_EXTRA
+ENABLE_SERVICE
+ENABLE_CGRIBEX
+ENABLE_GRIB
+GRIB_API_LIBS
+GRIB_API_INCLUDE
+LIBPNG_LIBS
+OPENJPEG_LIBS
+openjpeg_LIBS
+JASPER_LIBS
+NETCDF_LIBS
+NETCDF_INCLUDE
+NETCDF_ROOT
+NC_CONFIG
+HDF5_LIBS
+HDF5_INCLUDE
+HDF5_ROOT
+SZLIB_LIBS
+SZLIB_INCLUDE
+ZLIB_LIBS
+ZLIB_INCLUDE
+THREADS_LIBS
+THREADS_INCLUDE
+PTHREAD_CFLAGS
+PTHREAD_LIBS
+PTHREAD_CC
+ax_pthread_config
+AS
+CXXCPP
+am__fastdepCXX_FALSE
+am__fastdepCXX_TRUE
+CXXDEPMODE
+ac_ct_CXX
+CXXFLAGS
+CXX
+ac_ct_F77
+FFLAGS
+F77
+FPP_INCOPT
+FPP_DEFOPT
+FPPFLAGS
+FPP
+FCFLAGS_f90
+ac_ct_FC
+FCFLAGS
+FC
+CPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+LIBTOOL
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+AWK
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+SYSTEM_TYPE
+HOST_NAME
+USER_NAME
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+with_pic
+enable_shared
+enable_static
+enable_fast_install
+enable_dependency_tracking
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+enable_largefile
+with_threads
+with_zlib
+with_szlib
+with_hdf5
+with_netcdf
+with_jasper
+with_openjpeg
+with_libpng
+with_grib_api
+enable_grib
+enable_cgribex
+enable_service
+enable_extra
+enable_ieg
+enable_all_static
+enable_mpi
+enable_iso_c_interface
+enable_swig
+enable_ruby
+enable_python
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+FC
+FCFLAGS
+FPP
+FPPFLAGS
+F77
+FFLAGS
+CXX
+CXXFLAGS
+CCC
+CXXCPP
+FCMODEXT'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+	 ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used" >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_myself" : 'X\(//\)[^/]' \| \
+	 X"$as_myself" : 'X\(//\)$' \| \
+	 X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+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 cdi 1.5.9 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/cdi]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of cdi 1.5.9:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-option-checking  ignore unrecognized --enable/--with options
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-maintainer-mode  enable make rules and dependencies not useful
+			  (and sometimes confusing) to the casual installer
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-dependency-tracking  speeds up one-time build
+  --enable-dependency-tracking   do not reject slow dependency extractors
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --disable-largefile     omit support for large files
+  --enable-grib           GRIB support [default=yes]
+  --enable-cgribex        Use the CGRIBEX library [default=yes]
+  --enable-service        Use the service library [default=yes]
+  --enable-extra          Use the extra library [default=yes]
+  --enable-ieg            Use the ieg library [default=yes]
+  --enable-all-static     build a completely statically linked CDO binary
+                          [default=no]
+  --enable-mpi            Compile with MPI compiler [default=no]
+  --enable-iso-c-interface
+                          Create Fortran Interface via iso_c_bindings facility
+                          of F2003 [default=no].
+
+  --enable-swig           use swig to create extra bindings [default=no]
+                          (EXPERIMENTAL)
+  --enable-ruby           ruby language bindings [default=no] (EXPERIMENTAL)
+  --enable-python         python language bindings [default=no] (EXPERIMENTAL)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-pic              try to use only PIC/non-PIC objects [default=use
+                          both]
+  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]
+  --with-sysroot=DIR Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).
+  --with-threads=<yes/no/directory>
+                          Compile + link for multithreading [default=yes]
+  --with-zlib=<yes|no|directory> (default=yes)
+                          location of ZLIB compression library (lib and
+                          include subdirs), nec. for HDF5/NETCDF4
+  --with-szlib=<yes|no|directory> (default=no)
+                          location of szlib library, optional for GRIB1 and
+                          NETCDF4 compression
+  --with-hdf5=<yes|no|directory> (default=no)
+                          location of hdf5 library, NETCDF4 requires hdf5 high
+                          level interface
+  --with-netcdf=<yes|no|directory> (default=yes)
+                          location of netcdf library (lib and include subdirs)
+  --with-jasper=<directory>
+                          Specify location of JASPER library. You must specify
+                          its location if GRIB_API was built with JASPER.
+  --with-openjpeg=<directory>
+                          Specify location of openjpeg library. You must
+                          specify its location if GRIB_API was built with
+                          openjpeg.
+  --with-libpng=<directory>
+                          Specify location of LIBPNG library. You must specify
+                          its location if GRIB_API was built with LIBPNG.
+  --with-grib_api=<yes|no|directory>
+                          library for grib2 compression; if a directory is
+                          given, it will be used as a value for
+                          --with-jasper-root
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  FC          Fortran compiler command
+  FCFLAGS     Fortran compiler flags
+  FPP         Command to preprocess Fortran code
+  FPPFLAGS    Flags for the Fortran preprocessor
+  F77         Fortran 77 compiler command
+  FFLAGS      Fortran 77 compiler flags
+  CXX         C++ compiler command
+  CXXFLAGS    C++ compiler flags
+  CXXCPP      C++ preprocessor
+  FCMODEXT    file extension of compiled Fortran module files
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <http://code.zmaw.de/projects/cdi>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+cdi configure 1.5.9
+generated by GNU Autoconf 2.68
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_fc_try_compile LINENO
+# ---------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_fc_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_fc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_fc_try_compile
+
+# ac_fn_fc_try_link LINENO
+# ------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_fc_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_fc_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_fc_try_link
+
+# ac_fn_f77_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_f77_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_f77_try_compile
+
+# ac_fn_f77_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_f77_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_f77_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_f77_try_link
+
+# ac_fn_cxx_try_compile LINENO
+# ----------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_compile
+
+# ac_fn_cxx_try_cpp LINENO
+# ------------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+	 test -z "$ac_cxx_preproc_warn_flag$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_cpp
+
+# ac_fn_cxx_try_link LINENO
+# -------------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_cxx_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+	 test -z "$ac_cxx_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+	 test "$cross_compiling" = yes ||
+	 $as_test_x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_cxx_try_link
+
+# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES
+# ----------------------------------------------------
+# Tries to find if the field MEMBER exists in type AGGR, after including
+# INCLUDES, setting cache variable VAR accordingly.
+ac_fn_c_check_member ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5
+$as_echo_n "checking for $2.$3... " >&6; }
+if eval \${$4+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$5
+int
+main ()
+{
+static $2 ac_aggr;
+if (sizeof ac_aggr.$3)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$4=yes"
+else
+  eval "$4=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$4
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_member
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+( $as_echo "## ----------------------------------------------- ##
+## Report this to http://code.zmaw.de/projects/cdi ##
+## ----------------------------------------------- ##"
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+
+# ac_fn_c_check_decl LINENO SYMBOL VAR INCLUDES
+# ---------------------------------------------
+# Tests whether SYMBOL is declared in INCLUDES, setting cache variable VAR
+# accordingly.
+ac_fn_c_check_decl ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  as_decl_name=`echo $2|sed 's/ *(.*//'`
+  as_decl_use=`echo $2|sed -e 's/(/((/' -e 's/)/) 0&/' -e 's/,/) 0& (/g'`
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $as_decl_name is declared" >&5
+$as_echo_n "checking whether $as_decl_name is declared... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+int
+main ()
+{
+#ifndef $as_decl_name
+#ifdef __cplusplus
+  (void) $as_decl_use;
+#else
+  (void) $as_decl_name;
+#endif
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_decl
+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 cdi $as_me 1.5.9, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	$as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+as_fn_append ac_header_list " stdlib.h"
+as_fn_append ac_header_list " unistd.h"
+as_fn_append ac_header_list " sys/param.h"
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+	# differences in whitespace do not lead to failure.
+	ac_old_val_w=`echo x $ac_old_val`
+	ac_new_val_w=`echo x $ac_new_val`
+	if test "$ac_old_val_w" != "$ac_new_val_w"; then
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+	  ac_cache_corrupted=:
+	else
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+	  eval $ac_var=\$ac_old_val
+	fi
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+	{ $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}"
+
+CONFIG_ABORT=yes
+ac_aux_dir=
+for ac_dir in config "$srcdir"/config; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+
+
+# Checks for username, hostname and system type
+USERNAME=$LOGNAME
+if test -z "$USERNAME" ; then USERNAME=$USER; fi;
+if test -z "$USERNAME" ; then USERNAME="unknown"; fi;
+
+cat >>confdefs.h <<_ACEOF
+#define USER_NAME "$USERNAME"
+_ACEOF
+
+USER_NAME="$USERNAME"
+
+if test -z "$HOST"; then :
+  HOST=unknown
+       if test -x /bin/hostname; then :
+  HOST=$(hostname)
+else
+  if test -x /bin/uname; then :
+  HOST=$(uname -n)
+fi
+fi
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HOST_NAME "$HOST"
+_ACEOF
+
+HOST_NAME="$HOST"
+
+
+cat >>confdefs.h <<_ACEOF
+#define SYSTEM_TYPE "$ac_cv_build"
+_ACEOF
+
+SYSTEM_TYPE="$ac_cv_build"
+
+
+am__api_version='1.11'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    rm -rf conftest.one conftest.two conftest.dir
+	    echo one > conftest.one
+	    echo two > conftest.two
+	    mkdir conftest.dir
+	    if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+	      test -s conftest.one && test -s conftest.two &&
+	      test -s conftest.dir/conftest.one &&
+	      test -s conftest.dir/conftest.two
+	    then
+	      ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	      break 3
+	    fi
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Just in case
+sleep 1
+echo timestamp > conftest.file
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \	]*)
+    as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+esac
+
+# Do `set' in a subshell so we don't clobber the current shell's
+# arguments.  Must try -L first in case configure is actually a
+# symlink; some systems play weird games with the mod time of symlinks
+# (eg FreeBSD returns the mod time of the symlink's containing
+# directory).
+if (
+   set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+   if test "$*" = "X"; then
+      # -L didn't work.
+      set X `ls -t "$srcdir/configure" conftest.file`
+   fi
+   rm -f conftest.file
+   if test "$*" != "X $srcdir/configure conftest.file" \
+      && test "$*" != "X conftest.file $srcdir/configure"; then
+
+      # If neither matched, then we have a broken ls.  This can happen
+      # if, for instance, CONFIG_SHELL is bash and it inherits a
+      # broken ls alias from the environment.  This has actually
+      # happened.  Such a system could not be considered "sane".
+      as_fn_error $? "ls -t appears to fail.  Make sure there is not a broken
+alias in your environment" "$LINENO" 5
+   fi
+
+   test "$2" = conftest.file
+   )
+then
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+test "$program_prefix" != NONE &&
+  program_transform_name="s&^&$program_prefix&;$program_transform_name"
+# Use a double $ so make ignores it.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --run true"; then
+  am_missing_run="$MISSING --run "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\	*)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# Installed binaries are usually stripped using `strip' when the user
+# run `make install-strip'.  However `strip' might not be the right
+# tool to use in cross-compilation environments, therefore Automake
+# will honor the `STRIP' environment variable to overrule this program.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+	 for ac_exec_ext in '' $ac_executable_extensions; do
+	   { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; } || continue
+	   case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+	     'mkdir (GNU coreutils) '* | \
+	     'mkdir (coreutils) '* | \
+	     'mkdir (fileutils) '4.1*)
+	       ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+	       break 3;;
+	   esac
+	 done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+mkdir_p="$MKDIR_P"
+case $mkdir_p in
+  [\\/$]* | ?:[\\/]*) ;;
+  */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
+esac
+
+for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='cdi'
+ VERSION='1.5.9'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
+
+
+MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+
+# We need awk for the "check" target.  The system "awk" is bad on
+# some platforms.
+# Always define AMTAR for backward compatibility.  Yes, it's still used
+# in the wild :-(  We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
+
+
+
+
+
+ac_config_headers="$ac_config_headers src/config.h"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+
+# Set up libtool.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: setting up libtool" >&5
+$as_echo "$as_me: setting up libtool" >&6;}
+case `pwd` in
+  *\ * | *\	*)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.2'
+macro_revision='1.3337'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case "$ECHO" in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+	@echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from `make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+fi
+
+if test "x$enable_dependency_tracking" != xno; then
+  am_depcomp="$ac_aux_dir/depcomp"
+  AMDEPBACKSLASH='\'
+  am__nodep='_no'
+fi
+ if test "x$enable_dependency_tracking" != xno; then
+  AMDEP_TRUE=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+	if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_SED" && $as_test_x "$ac_path_SED"; } || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in grep ggrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+# Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in egrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+# Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in fgrep; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_FGREP="$as_dir/$ac_prog$ac_exec_ext"
+      { test -f "$ac_path_FGREP" && $as_test_x "$ac_path_FGREP"; } || continue
+# Check for GNU ac_path_FGREP and select it if it is found.
+  # Check for GNU $ac_path_FGREP
+case `"$ac_path_FGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_FGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in dumpbin "link -dump"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[	 ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ar_at_file=no
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+	# Ensure the archiver fails upon bogus file names.
+	rm -f conftest.$ac_objext libconftest.a
+	{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK '"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[	 ]\($symcode$symcode*\)[	 ][	 ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+	  cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT_DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_globsym_save_LIBS=$LIBS
+	  lt_globsym_save_CFLAGS=$CFLAGS
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS=$lt_globsym_save_LIBS
+	  CFLAGS=$lt_globsym_save_CFLAGS
+	else
+	  echo "cannot find nm_test_func in $nlist" >&5
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+  withval=$with_sysroot;
+else
+  with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+   ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_cc_needs_belf=yes
+else
+  lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$MANIFEST_TOOL"; then
+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+  # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_MANIFEST_TOOL"; then
+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
+    MANIFEST_TOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+  fi
+else
+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&5
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DSYMUTIL="dsymutil"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NMEDIT="${ac_tool_prefix}nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_NMEDIT="nmedit"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    NMEDIT=$ac_ct_NMEDIT
+  fi
+else
+  NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LIPO="${ac_tool_prefix}lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LIPO="lipo"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL="${ac_tool_prefix}otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL="otool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL=$ac_ct_OTOOL
+  fi
+else
+  OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OTOOL64="${ac_tool_prefix}otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OTOOL64="otool64"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OTOOL64=$ac_ct_OTOOL64
+  fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&5
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
+$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
+$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
+if ${lt_cv_ld_exported_symbols_list+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ld_exported_symbols_list=yes
+else
+  lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
+$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
+$as_echo_n "checking for -force_load linker flag... " >&6; }
+if ${lt_cv_ld_force_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      echo "$RANLIB libconftest.a" >&5
+      $RANLIB libconftest.a 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&5
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[012]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+		  inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  withval=$with_pic; pic_mode="$withval"
+else
+  pic_mode=default
+fi
+
+
+test -z "$pic_mode" && pic_mode=yes
+
+
+
+
+
+
+
+
+        enable_dlopen=no
+
+
+  enable_win32_dll=no
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+
+lt_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+
+
+
+
+
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      lt_prog_compiler_pic='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static='-Bstatic'
+      else
+	lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-KPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fPIC'
+	lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='--shared'
+	lt_prog_compiler_static='--static'
+	;;
+      nagfor*)
+	# NAG Fortran compiler
+	lt_prog_compiler_wl='-Wl,-Wl,,'
+	lt_prog_compiler_pic='-PIC'
+	lt_prog_compiler_static='-Bstatic'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-fpic'
+	lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	lt_prog_compiler_wl='-Wl,'
+	lt_prog_compiler_pic='-qpic'
+	lt_prog_compiler_static='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ F* | *Sun*Fortran*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl=''
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic='-KPIC'
+	  lt_prog_compiler_static='-Bstatic'
+	  lt_prog_compiler_wl='-Wl,'
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic='-Kconform_pic'
+	lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_flag_spec_ld=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=' $pic_flag'
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  whole_archive_flag_spec=
+	  tmp_sharedflag='--shared' ;;
+	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
+	  hardcode_libdir_flag_spec=
+	  hardcode_libdir_flag_spec_ld='-rpath $libdir'
+	  archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+	    archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    ld_shlibs=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  hardcode_direct=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L=yes
+	  hardcode_libdir_flag_spec='-L$libdir'
+	  hardcode_libdir_separator=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      export_dynamic_flag_spec='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag="-z nodefs"
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
+
+	 hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag=' ${wl}-bernotok'
+	  allow_undefined_flag=' ${wl}-berok'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    whole_archive_flag_spec='$convenience'
+	  fi
+	  archive_cmds_need_lc=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	hardcode_libdir_flag_spec=' '
+	allow_undefined_flag=unsupported
+	always_export_symbols=yes
+	file_list_spec='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+	enable_shared_with_static_runtimes=yes
+	export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	old_postinstall_cmds='chmod 644 $oldlib'
+	postlink_cmds='lt_outputfile="@OUTPUT@"~
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	hardcode_libdir_flag_spec=' '
+	allow_undefined_flag=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	old_archive_from_new_cmds='true'
+	# FIXME: Should let the user specify the lib program.
+	old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	enable_shared_with_static_runtimes=yes
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  hardcode_shlibpath_var=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec=''
+  fi
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld='+b $libdir'
+	hardcode_libdir_separator=:
+	hardcode_direct=yes
+	hardcode_direct_absolute=yes
+	export_dynamic_flag_spec='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_direct=no
+	  hardcode_shlibpath_var=no
+	  ;;
+	*)
+	  hardcode_direct=yes
+	  hardcode_direct_absolute=yes
+	  export_dynamic_flag_spec='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+	# This should be the same for all languages, so no per-tag cache variable.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	fi
+      else
+	archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct=yes
+	hardcode_shlibpath_var=no
+	hardcode_direct_absolute=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	  export_dynamic_flag_spec='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	     archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     hardcode_libdir_flag_spec='-R$libdir'
+	     ;;
+	   *)
+	     archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	ld_shlibs=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag=' -expect_unresolved \*'
+	archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds='$CC -r -o $output$reload_objs'
+	  hardcode_direct=no
+        ;;
+	motorola)
+	  archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	export_dynamic_flag_spec='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl
+	  pic_flag=$lt_prog_compiler_pic
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag
+	  allow_undefined_flag=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc=no
+	  else
+	    lt_cv_archive_cmds_need_lc=yes
+	  fi
+	  allow_undefined_flag=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+    ;;
+
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
+else
+  ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_svld_dlopen=yes
+else
+  ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_dld_link=yes
+else
+  ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  	  if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report which library types will actually be built
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+# Check building environment
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+	{
+	case 's': // string
+	  str = va_arg (args_copy, const char *);
+	  break;
+	case 'd': // int
+	  number = va_arg (args_copy, int);
+	  break;
+	case 'f': // float
+	  fnumber = va_arg (args_copy, double);
+	  break;
+	default:
+	  break;
+	}
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+	  || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -xc99=all -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+
+fi
+
+
+ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$FC"; then
+  ac_cv_prog_FC="$FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_FC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+FC=$ac_cv_prog_FC
+if test -n "$FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $FC" >&5
+$as_echo "$FC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$FC" && break
+  done
+fi
+if test -z "$FC"; then
+  ac_ct_FC=$FC
+  for ac_prog in gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn xlf90 f90 pgf90 pghpf epcf90 g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_FC"; then
+  ac_cv_prog_ac_ct_FC="$ac_ct_FC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_FC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_FC=$ac_cv_prog_ac_ct_FC
+if test -n "$ac_ct_FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_FC" >&5
+$as_echo "$ac_ct_FC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_FC" && break
+done
+
+  if test "x$ac_ct_FC" = x; then
+    FC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    FC=$ac_ct_FC
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran compiler... " >&6; }
+if ${ac_cv_fc_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_fc_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_compiler_gnu" >&5
+$as_echo "$ac_cv_fc_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FCFLAGS=${FCFLAGS+set}
+ac_save_FCFLAGS=$FCFLAGS
+FCFLAGS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $FC accepts -g" >&5
+$as_echo_n "checking whether $FC accepts -g... " >&6; }
+if ${ac_cv_prog_fc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  FCFLAGS=-g
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  ac_cv_prog_fc_g=yes
+else
+  ac_cv_prog_fc_g=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_fc_g" >&5
+$as_echo "$ac_cv_prog_fc_g" >&6; }
+if test "$ac_test_FCFLAGS" = set; then
+  FCFLAGS=$ac_save_FCFLAGS
+elif test $ac_cv_prog_fc_g = yes; then
+  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+    FCFLAGS="-g -O2"
+  else
+    FCFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_fc_compiler_gnu" = xyes; then
+    FCFLAGS="-O2"
+  else
+    FCFLAGS=
+  fi
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+func_stripname_cnf ()
+{
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+} # func_stripname_cnf
+
+
+      ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+
+archive_cmds_need_lc_FC=no
+allow_undefined_flag_FC=
+always_export_symbols_FC=no
+archive_expsym_cmds_FC=
+export_dynamic_flag_spec_FC=
+hardcode_direct_FC=no
+hardcode_direct_absolute_FC=no
+hardcode_libdir_flag_spec_FC=
+hardcode_libdir_flag_spec_ld_FC=
+hardcode_libdir_separator_FC=
+hardcode_minus_L_FC=no
+hardcode_automatic_FC=no
+inherit_rpath_FC=no
+module_cmds_FC=
+module_expsym_cmds_FC=
+link_all_deplibs_FC=unknown
+old_archive_cmds_FC=$old_archive_cmds
+reload_flag_FC=$reload_flag
+reload_cmds_FC=$reload_cmds
+no_undefined_flag_FC=
+whole_archive_flag_spec_FC=
+enable_shared_with_static_runtimes_FC=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+objext_FC=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${FC-"f95"}
+  CFLAGS=$FCFLAGS
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  compiler_FC=$CC
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+  if test -n "$compiler"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[4-9]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+    GCC_FC="$ac_cv_fc_compiler_gnu"
+    LD_FC="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    # Dependencies to place before and after the object being linked:
+predep_objects_FC=
+postdep_objects_FC=
+predeps_FC=
+postdeps_FC=
+compiler_lib_search_path_FC=
+
+cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case ${prev}${p} in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+	 prev=$p
+	 continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test "$pre_test_object_deps_done" = no; then
+	 case ${prev} in
+	 -L | -R)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$compiler_lib_search_path_FC"; then
+	     compiler_lib_search_path_FC="${prev}${p}"
+	   else
+	     compiler_lib_search_path_FC="${compiler_lib_search_path_FC} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$postdeps_FC"; then
+	   postdeps_FC="${prev}${p}"
+	 else
+	   postdeps_FC="${postdeps_FC} ${prev}${p}"
+	 fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$predep_objects_FC"; then
+	   predep_objects_FC="$p"
+	 else
+	   predep_objects_FC="$predep_objects_FC $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_FC"; then
+	   postdep_objects_FC="$p"
+	 else
+	   postdep_objects_FC="$postdep_objects_FC $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling FC test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+
+
+case " $postdeps_FC " in
+*" -lc "*) archive_cmds_need_lc_FC=no ;;
+esac
+ compiler_lib_search_dirs_FC=
+if test -n "${compiler_lib_search_path_FC}"; then
+ compiler_lib_search_dirs_FC=`echo " ${compiler_lib_search_path_FC}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    lt_prog_compiler_wl_FC=
+lt_prog_compiler_pic_FC=
+lt_prog_compiler_static_FC=
+
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_FC='-Wl,'
+    lt_prog_compiler_static_FC='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_FC='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_FC='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic_FC='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_FC='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_FC='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_FC=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_FC='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_FC=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_FC='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_FC=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic_FC='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl_FC='-Xlinker '
+      lt_prog_compiler_pic_FC='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_FC='-Bstatic'
+      else
+	lt_prog_compiler_static_FC='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_FC='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_FC='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_FC='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	lt_prog_compiler_wl_FC='-Wl,'
+	lt_prog_compiler_pic_FC='-KPIC'
+	lt_prog_compiler_static_FC='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	lt_prog_compiler_wl_FC='-Wl,'
+	lt_prog_compiler_pic_FC='-fPIC'
+	lt_prog_compiler_static_FC='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	lt_prog_compiler_wl_FC='-Wl,'
+	lt_prog_compiler_pic_FC='--shared'
+	lt_prog_compiler_static_FC='--static'
+	;;
+      nagfor*)
+	# NAG Fortran compiler
+	lt_prog_compiler_wl_FC='-Wl,-Wl,,'
+	lt_prog_compiler_pic_FC='-PIC'
+	lt_prog_compiler_static_FC='-Bstatic'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_FC='-Wl,'
+	lt_prog_compiler_pic_FC='-fpic'
+	lt_prog_compiler_static_FC='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_FC='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_FC='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	lt_prog_compiler_wl_FC='-Wl,'
+	lt_prog_compiler_pic_FC='-qpic'
+	lt_prog_compiler_static_FC='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ F* | *Sun*Fortran*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic_FC='-KPIC'
+	  lt_prog_compiler_static_FC='-Bstatic'
+	  lt_prog_compiler_wl_FC=''
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic_FC='-KPIC'
+	  lt_prog_compiler_static_FC='-Bstatic'
+	  lt_prog_compiler_wl_FC='-Wl,'
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_FC='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static_FC='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	lt_prog_compiler_wl_FC='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_FC='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_FC='-Qoption ld '
+      lt_prog_compiler_pic_FC='-PIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_FC='-Kconform_pic'
+	lt_prog_compiler_static_FC='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_pic_FC='-KPIC'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_FC='-Wl,'
+      lt_prog_compiler_can_build_shared_FC=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_FC='-pic'
+      lt_prog_compiler_static_FC='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_FC=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_FC=
+    ;;
+  *)
+    lt_prog_compiler_pic_FC="$lt_prog_compiler_pic_FC"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_FC=$lt_prog_compiler_pic_FC
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_FC" >&5
+$as_echo "$lt_cv_prog_compiler_pic_FC" >&6; }
+lt_prog_compiler_pic_FC=$lt_cv_prog_compiler_pic_FC
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_FC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_FC works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_FC works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works_FC=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_FC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_FC=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_FC" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_FC" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_FC" = xyes; then
+    case $lt_prog_compiler_pic_FC in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_FC=" $lt_prog_compiler_pic_FC" ;;
+     esac
+else
+    lt_prog_compiler_pic_FC=
+     lt_prog_compiler_can_build_shared_FC=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_FC eval lt_tmp_static_flag=\"$lt_prog_compiler_static_FC\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works_FC=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_FC=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_FC=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_FC" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_FC" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_FC" = xyes; then
+    :
+else
+    lt_prog_compiler_static_FC=
+fi
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_FC=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_FC=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; }
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_FC=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_FC=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_FC" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_FC" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_FC" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag_FC=
+  always_export_symbols_FC=no
+  archive_cmds_FC=
+  archive_expsym_cmds_FC=
+  compiler_needs_object_FC=no
+  enable_shared_with_static_runtimes_FC=no
+  export_dynamic_flag_spec_FC=
+  export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic_FC=no
+  hardcode_direct_FC=no
+  hardcode_direct_absolute_FC=no
+  hardcode_libdir_flag_spec_FC=
+  hardcode_libdir_flag_spec_ld_FC=
+  hardcode_libdir_separator_FC=
+  hardcode_minus_L_FC=no
+  hardcode_shlibpath_var_FC=unsupported
+  inherit_rpath_FC=no
+  link_all_deplibs_FC=unknown
+  module_cmds_FC=
+  module_expsym_cmds_FC=
+  old_archive_from_new_cmds_FC=
+  old_archive_from_expsyms_cmds_FC=
+  thread_safe_flag_spec_FC=
+  whole_archive_flag_spec_FC=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_FC=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_FC='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_FC=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec_FC='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec_FC="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_FC=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_FC=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds_FC=''
+        ;;
+      m68k)
+            archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_FC='-L$libdir'
+            hardcode_minus_L_FC=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_FC=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_FC='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_FC=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, FC) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      export_dynamic_flag_spec_FC='${wl}--export-all-symbols'
+      allow_undefined_flag_FC=unsupported
+      always_export_symbols_FC=no
+      enable_shared_with_static_runtimes_FC=yes
+      export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms_FC='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs_FC=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs_FC=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct_FC=no
+      hardcode_shlibpath_var_FC=no
+      hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_FC='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_FC='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=' $pic_flag'
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  whole_archive_flag_spec_FC=
+	  tmp_sharedflag='--shared' ;;
+	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  whole_archive_flag_spec_FC='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object_FC=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec_FC='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object_FC=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	archive_cmds_FC='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  whole_archive_flag_spec_FC='--whole-archive$convenience --no-whole-archive'
+	  hardcode_libdir_flag_spec_FC=
+	  hardcode_libdir_flag_spec_ld_FC='-rpath $libdir'
+	  archive_cmds_FC='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    archive_expsym_cmds_FC='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        ld_shlibs_FC=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds_FC='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_FC=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_FC=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs_FC=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+	    archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    ld_shlibs_FC=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds_FC='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_FC=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_FC" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_FC=
+      export_dynamic_flag_spec_FC=
+      whole_archive_flag_spec_FC=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_FC=unsupported
+      always_export_symbols_FC=yes
+      archive_expsym_cmds_FC='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_FC=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_FC=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  export_symbols_cmds_FC='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_FC='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_FC=''
+      hardcode_direct_FC=yes
+      hardcode_direct_absolute_FC=yes
+      hardcode_libdir_separator_FC=':'
+      link_all_deplibs_FC=yes
+      file_list_spec_FC='${wl}-f,'
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  hardcode_direct_FC=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L_FC=yes
+	  hardcode_libdir_flag_spec_FC='-L$libdir'
+	  hardcode_libdir_separator_FC=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      export_dynamic_flag_spec_FC='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_FC=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag_FC='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__FC=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__FC"; then
+    lt_cv_aix_libpath__FC=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__FC"; then
+    lt_cv_aix_libpath__FC="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__FC
+fi
+
+        hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds_FC='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_FC='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_FC="-z nodefs"
+	  archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__FC=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__FC"; then
+    lt_cv_aix_libpath__FC=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__FC"; then
+    lt_cv_aix_libpath__FC="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__FC
+fi
+
+	 hardcode_libdir_flag_spec_FC='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag_FC=' ${wl}-bernotok'
+	  allow_undefined_flag_FC=' ${wl}-berok'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    whole_archive_flag_spec_FC='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    whole_archive_flag_spec_FC='$convenience'
+	  fi
+	  archive_cmds_need_lc_FC=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_FC="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds_FC=''
+        ;;
+      m68k)
+            archive_cmds_FC='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_FC='-L$libdir'
+            hardcode_minus_L_FC=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_FC=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	hardcode_libdir_flag_spec_FC=' '
+	allow_undefined_flag_FC=unsupported
+	always_export_symbols_FC=yes
+	file_list_spec_FC='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds_FC='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	archive_expsym_cmds_FC='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, FC)='true'
+	enable_shared_with_static_runtimes_FC=yes
+	export_symbols_cmds_FC='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	old_postinstall_cmds_FC='chmod 644 $oldlib'
+	postlink_cmds_FC='lt_outputfile="@OUTPUT@"~
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	hardcode_libdir_flag_spec_FC=' '
+	allow_undefined_flag_FC=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds_FC='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	old_archive_from_new_cmds_FC='true'
+	# FIXME: Should let the user specify the lib program.
+	old_archive_cmds_FC='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	enable_shared_with_static_runtimes_FC=yes
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_FC=no
+  hardcode_direct_FC=no
+  hardcode_automatic_FC=yes
+  hardcode_shlibpath_var_FC=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec_FC='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec_FC=''
+  fi
+  link_all_deplibs_FC=yes
+  allow_undefined_flag_FC="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_FC="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds_FC="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds_FC="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds_FC="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs_FC=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_FC=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_FC=yes
+      hardcode_minus_L_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_FC='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds_FC='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      hardcode_direct_FC=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_FC=yes
+      export_dynamic_flag_spec_FC='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	archive_cmds_FC='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_FC='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_FC='+b $libdir'
+	hardcode_libdir_separator_FC=:
+	hardcode_direct_FC=yes
+	hardcode_direct_absolute_FC=yes
+	export_dynamic_flag_spec_FC='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L_FC=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_FC='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_FC='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_FC='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	archive_cmds_FC='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_FC='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_FC=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_direct_FC=no
+	  hardcode_shlibpath_var_FC=no
+	  ;;
+	*)
+	  hardcode_direct_FC=yes
+	  hardcode_direct_absolute_FC=yes
+	  export_dynamic_flag_spec_FC='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_FC=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+	# This should be the same for all languages, so no per-tag cache variable.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	   cat > conftest.$ac_ext <<_ACEOF
+
+      subroutine foo
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          archive_expsym_cmds_FC='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	fi
+      else
+	archive_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_FC='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      inherit_rpath_FC=yes
+      link_all_deplibs_FC=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_FC='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_direct_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    newsos6)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_FC=yes
+      hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct_FC=yes
+	hardcode_shlibpath_var_FC=no
+	hardcode_direct_absolute_FC=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+	  export_dynamic_flag_spec_FC='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	     archive_cmds_FC='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     hardcode_libdir_flag_spec_FC='-R$libdir'
+	     ;;
+	   *)
+	     archive_cmds_FC='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     hardcode_libdir_flag_spec_FC='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	ld_shlibs_FC=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_minus_L_FC=yes
+      allow_undefined_flag_FC=unsupported
+      archive_cmds_FC='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds_FC='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_FC=' -expect_unresolved \*'
+	archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_FC=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_FC=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_FC='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_FC='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_FC=' -expect_unresolved \*'
+	archive_cmds_FC='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_FC='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_FC='-rpath $libdir'
+      fi
+      archive_cmds_need_lc_FC='no'
+      hardcode_libdir_separator_FC=:
+      ;;
+
+    solaris*)
+      no_undefined_flag_FC=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds_FC='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  archive_cmds_FC='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  archive_cmds_FC='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_FC='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      hardcode_libdir_flag_spec_FC='-R$libdir'
+      hardcode_shlibpath_var_FC=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  whole_archive_flag_spec_FC='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec_FC='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      link_all_deplibs_FC=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds_FC='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_FC='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_direct_FC=yes
+      hardcode_minus_L_FC=yes
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_FC=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_FC='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_FC='$CC -r -o $output$reload_objs'
+	  hardcode_direct_FC=no
+        ;;
+	motorola)
+	  archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_FC=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_FC=no
+      export_dynamic_flag_spec_FC='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_FC=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_FC=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_FC='${wl}-z,text'
+      archive_cmds_need_lc_FC=no
+      hardcode_shlibpath_var_FC=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_FC='${wl}-z,text'
+      allow_undefined_flag_FC='${wl}-z,nodefs'
+      archive_cmds_need_lc_FC=no
+      hardcode_shlibpath_var_FC=no
+      hardcode_libdir_flag_spec_FC='${wl}-R,$libdir'
+      hardcode_libdir_separator_FC=':'
+      link_all_deplibs_FC=yes
+      export_dynamic_flag_spec_FC='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds_FC='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_FC='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_FC='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_FC='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds_FC='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_FC='-L$libdir'
+      hardcode_shlibpath_var_FC=no
+      ;;
+
+    *)
+      ld_shlibs_FC=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	export_dynamic_flag_spec_FC='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_FC" >&5
+$as_echo "$ld_shlibs_FC" >&6; }
+test "$ld_shlibs_FC" = no && can_build_shared=no
+
+with_gnu_ld_FC=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_FC" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_FC=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_FC in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_FC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl_FC
+	  pic_flag=$lt_prog_compiler_pic_FC
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag_FC
+	  allow_undefined_flag_FC=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds_FC 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc_FC=no
+	  else
+	    lt_cv_archive_cmds_need_lc_FC=yes
+	  fi
+	  allow_undefined_flag_FC=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_FC" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_FC" >&6; }
+      archive_cmds_need_lc_FC=$lt_cv_archive_cmds_need_lc_FC
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_FC\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_FC\""
+    cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_FC=
+if test -n "$hardcode_libdir_flag_spec_FC" ||
+   test -n "$runpath_var_FC" ||
+   test "X$hardcode_automatic_FC" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct_FC" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, FC)" != no &&
+     test "$hardcode_minus_L_FC" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_FC=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_FC=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_FC=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_FC" >&5
+$as_echo "$hardcode_action_FC" >&6; }
+
+if test "$hardcode_action_FC" = relink ||
+   test "$inherit_rpath_FC" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+if test -n "$FC" && test "X$FC" != "Xno"; then :
+  ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran flag to compile .f90 files" >&5
+$as_echo_n "checking for Fortran flag to compile .f90 files... " >&6; }
+if ${ac_cv_fc_srcext_f90+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=f90
+ac_fcflags_srcext_save=$ac_fcflags_srcext
+ac_fcflags_srcext=
+ac_cv_fc_srcext_f90=unknown
+for ac_flag in none -qsuffix=f=f90 -Tf; do
+  test "x$ac_flag" != xnone && ac_fcflags_srcext="$ac_flag"
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  ac_cv_fc_srcext_f90=$ac_flag; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+done
+rm -f conftest.$ac_objext conftest.f90
+ac_fcflags_srcext=$ac_fcflags_srcext_save
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_fc_srcext_f90" >&5
+$as_echo "$ac_cv_fc_srcext_f90" >&6; }
+if test "x$ac_cv_fc_srcext_f90" = xunknown; then
+  as_fn_error $? "Fortran could not compile .f90 files" "$LINENO" 5
+else
+  ac_fc_srcext=f90
+  if test "x$ac_cv_fc_srcext_f90" = xnone; then
+    ac_fcflags_srcext=""
+    FCFLAGS_f90=""
+  else
+    ac_fcflags_srcext=$ac_cv_fc_srcext_f90
+    FCFLAGS_f90=$ac_cv_fc_srcext_f90
+  fi
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+   # Prefer AC_PROG_FC to AC_PROG_F77
+   export FC FCFLAGS
+   if test "X$F77" != X; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Use AC_PROG_FC with AC_PROG_FPP, instead of AC_PROG_F77" >&5
+$as_echo "$as_me: WARNING: Use AC_PROG_FC with AC_PROG_FPP, instead of AC_PROG_F77" >&2;}
+fi
+
+
+
+
+
+     acx_sl_fpp_srcext=${ac_fc_srcext-F}
+   as_acx_sl_prog_fpp=`$as_echo "     acx_sl_cv_prog_fpp_fc_${ac_fc_srcext-f}" | $as_tr_sh`
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to preprocess Fortran files with suffix $acx_sl_fpp_srcext" >&5
+$as_echo_n "checking how to preprocess Fortran files with suffix $acx_sl_fpp_srcext... " >&6; }
+if eval \${$as_acx_sl_prog_fpp+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$as_acx_sl_prog_fpp="
+      # Let the user specify FPP
+      if test -n "$FPP"; then :
+  rm -f conftest*
+
+   cat > conftest.$ac_ext <<_ACEOF
+      program main
+#define OK
+#ifdef OK
+      REAL A
+#else
+      syntax error
+#endif
+
+      end
+_ACEOF
+   ac_tmp=conftest.fppout
+   if { {        ac_try="$FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext >$ac_tmp"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  ($FPP conftest.$acx_sl_fpp_srcext >$ac_tmp) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  if test -f $ac_tmp \
+        && ! cmp conftest.$acx_sl_fpp_srcext $ac_tmp >/dev/null 2>&1 \
+        && grep '^      REAL A' $ac_tmp >/dev/null 2>&1 \
+        && ! grep 'syntax error' $ac_tmp >/dev/null 2>&1; then :
+  # we have Fortran!  See if the file can be compiled:
+         mv $ac_tmp conftest.$ac_ext
+         if ac_fn_fc_try_compile "$LINENO"; then :
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       eval "$as_acx_sl_prog_fpp=\"\$FPP\""
+else
+             $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+            { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: user-specified \$FPP ($FPP) does not work" >&5
+$as_echo "$as_me: WARNING: user-specified \$FPP ($FPP) does not work" >&2;}
+            FPP=
+fi
+rm -f core conftest.err conftest.$ac_objext
+else
+          mv $ac_tmp conftest.$ac_ext
+         $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+         { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: user-specified \$FPP ($FPP) does not work" >&5
+$as_echo "$as_me: WARNING: user-specified \$FPP ($FPP) does not work" >&2;}
+            FPP=
+fi
+fi
+   rm -f conftest*
+
+fi
+      if test -z "$FPP"; then :
+  for ac_fpp in `cd $srcdir ; pwd`/util/sxpreproc-wrapper \
+           `cd $srcdir ; pwd`/util/xlfpreproc-wrapper \
+           `cd $srcdir ; pwd`/util/sunf95preproc-wrapper \
+           "$FC -F" "$FC -F -fpp" "$FC -E" "$FC -E" "$FC -E -cpp" \
+           "$FC $FCFLAGS -F" "$FC $FCFLAGS -E" "$FC $FCFLAGS -E" \
+           "$FC $FCFLAGS -E -cpp" "$FC $FCFLAGS -x f95-cpp-input -E -P" \
+           "${F77-f77} -F" "${F77-f77} -E" 'fpp' \
+           "$CPP" "$CPP -x c" 'cpp' '/lib/cpp' \
+           '/usr/ccs/lib/cpp' 'g77 -E' '${CC-cc} -E'
+         do
+           rm -f conftest*
+
+   cat > conftest.$ac_ext <<_ACEOF
+      program main
+#define OK
+#ifdef OK
+      REAL A
+#else
+      syntax error
+#endif
+
+      end
+_ACEOF
+   ac_tmp=conftest.fppout
+   if { {        ac_try="$ac_fpp $FPPFLAGS conftest.$acx_sl_fpp_srcext >$ac_tmp"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  ($ac_fpp conftest.$acx_sl_fpp_srcext >$ac_tmp) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  if test -f $ac_tmp \
+        && ! cmp conftest.$acx_sl_fpp_srcext $ac_tmp >/dev/null 2>&1 \
+        && grep '^      REAL A' $ac_tmp >/dev/null 2>&1 \
+        && ! grep 'syntax error' $ac_tmp >/dev/null 2>&1; then :
+  # we have Fortran!  See if the file can be compiled:
+         mv $ac_tmp conftest.$ac_ext
+         if ac_fn_fc_try_compile "$LINENO"; then :
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+            FPP="$ac_fpp"
+              break
+else
+             $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext
+else
+          mv $ac_tmp conftest.$ac_ext
+         $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+fi
+   rm -f conftest*
+
+           rm -f conftest*
+
+   cat > conftest.$ac_ext <<_ACEOF
+      program main
+#define OK
+#ifdef OK
+      REAL A
+#else
+      syntax error
+#endif
+
+      end
+_ACEOF
+   ac_tmp=conftest.fppout
+   if { {        ac_try="$ac_fpp -P $FPPFLAGS conftest.$acx_sl_fpp_srcext >$ac_tmp"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  ($ac_fpp -P conftest.$acx_sl_fpp_srcext >$ac_tmp) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  if test -f $ac_tmp \
+        && ! cmp conftest.$acx_sl_fpp_srcext $ac_tmp >/dev/null 2>&1 \
+        && grep '^      REAL A' $ac_tmp >/dev/null 2>&1 \
+        && ! grep 'syntax error' $ac_tmp >/dev/null 2>&1; then :
+  # we have Fortran!  See if the file can be compiled:
+         mv $ac_tmp conftest.$ac_ext
+         if ac_fn_fc_try_compile "$LINENO"; then :
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                         FPP="$ac_fpp -P"
+              break
+else
+             $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext
+else
+          mv $ac_tmp conftest.$ac_ext
+         $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+fi
+   rm -f conftest*
+
+         done
+fi
+      if test -z "$FPP"; then :
+
+else
+  eval "$as_acx_sl_prog_fpp=\$FPP"
+fi
+fi
+eval ac_res=\$$as_acx_sl_prog_fpp
+	       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+
+
+
+   # ACX_SL_PROG_FC_FPP_FEATURES does the actual feature tests,
+   # storing results of the checks in non-cv variables like
+   # ac_prog_fc_cpp_*, which we copy to cv variables afterwards.  This
+   # allows this macro to be reusable for other cv variables (see
+   # below)
+
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking if preprocessing with $FPP of Fortran source supports required preprocessor features" >&5
+$as_echo_n "checking if preprocessing with $FPP of Fortran source supports required preprocessor features... " >&6; }
+if ${acx_sl_cv_fc_indirect_ok+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+       acx_sl_cv_fc_indirect_ok=yes
+      # Set up ac_fpp_need_* flags based on features in
+      acx_sl_fpp_srcext=${ac_fc_srcext-F}
+      # defaults for needed features
+   ac_fpp_need_d=yes
+   ac_fpp_need_i=yes
+   ac_fpp_need_subs=no
+   ac_fpp_need_wrap=no
+   ac_fpp_need_cstyle=no
+   ac_fpp_need_CSTYLE=no
+   ac_fpp_need_cxxstyle=yes
+   ac_fpp_need_CXXSTYLE=no
+         for _t in  nil
+   do
+     case $_t in #(
+  define) :
+    ac_fpp_need_d=yes ;; #(
+  nodefine) :
+    ac_fpp_need_d=no ;; #(
+  include) :
+    ac_fpp_need_i=yes ;; #(
+  noinclude) :
+    ac_fpp_need_i=no ;; #(
+  substitute) :
+    ac_fpp_need_subs=yes ;; #(
+  nosubstitute) :
+    ac_fpp_need_subs=no ;; #(
+  wrap) :
+    ac_fpp_need_wrap=yes ;; #(
+  nowwrap) :
+    ac_fpp_need_wrap=no ;; #(
+  cstyle) :
+    ac_fpp_need_cstyle=yes ;; #(
+  nocstyle) :
+    ac_fpp_need_cstyle=no ;; #(
+  CSTYLE) :
+    ac_fpp_need_CSTYLE=yes ;; #(
+  noCSTYLE) :
+    ac_fpp_need_CSTYLE=no ;; #(
+  cxxstyle) :
+    ac_fpp_need_cxxstyle=yes ;; #(
+  nocxxstyle) :
+    ac_fpp_need_cxxstyle=no ;; #(
+  CXXSTYLE) :
+    ac_fpp_need_CXXSTYLE=yes ;; #(
+  noCXXSTYLE) :
+    ac_fpp_need_CXXSTYLE=no ;; #(
+  nil) :
+     ;; #(
+  *) :
+     ;;
+esac
+   done
+   # Wrapping requires substitution
+   test $ac_fpp_need_wrap = yes && ac_fpp_need_subs=yes
+   # CSTYLE and cstyle are mutually exclusive.
+   # CSTYLE takes precedence, since if it is not fulfilled,
+   # compile errors may arise
+   test $ac_fpp_need_CSTYLE = yes && ac_fpp_need_cstyle=no
+      test $ac_fpp_need_CXXSTYLE = yes && ac_fpp_need_cxxstyle=no
+
+
+      acx_sl_prog_fc_cpp_CSTYLE=no
+      acx_sl_prog_fc_cpp_cxxstyle=no
+
+
+      ac_save_FCFLAGS=$FCFLAGS
+
+
+
+      # We need to skip the following tests if we're trying direct compilation
+      # and FC won't preprocess.
+      if test x$ac_fpp_need_d = xyes; then :
+  acx_sl_prog_fc_cpp_d=no
+         $as_echo "$as_me:${as_lineno-$LINENO}: Trying flag to create preprocessor defines." >&5
+
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+   ac_ext="$acx_sl_fpp_srcext"
+   cat > conftest.$ac_ext <<_ACEOF
+                 program main
+
+#ifndef OK
+      syntax error
+#endif
+
+      end
+_ACEOF
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+
+         # Normally we expect to be able to define preprocessor macros
+         # with -D, but this might be IBM xlf compiler, which needs
+         # -WF,-D or Fujitsu VPP700 which needs -Wp,-D
+         mv conftest.$acx_sl_fpp_srcext conftest.${acx_sl_fpp_srcext}.bak
+         for FPP_DEFOPT in "$FPP_DEFOPT" '-D' '-WF,-D' '-Wp,-D'
+         do
+           if test x"$FPP_DEFOPT" != x ; then :
+  cp conftest.${acx_sl_fpp_srcext}.bak conftest.$acx_sl_fpp_srcext
+                     { { echo Running preprocessor $FPP $FPPFLAGS ${FPP_DEFOPT}OK conftest.$acx_sl_fpp_srcext; } >&5
+  ($FPP $FPPFLAGS ${FPP_DEFOPT}OK conftest.$acx_sl_fpp_srcext \
+        >conftest.${ac_ext}.tmp) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+
+   mv conftest.${ac_ext}.tmp conftest.${ac_ext}
+   if ac_fn_fc_try_compile "$LINENO"; then :
+                  acx_sl_prog_fc_cpp_d=yes; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+fi
+         done
+         FCFLAGS=$ac_save_FCFLAGS
+         if test $acx_sl_prog_fc_cpp_d = no; then :
+  acx_sl_cv_fc_indirect_ok=no
+fi
+         if test x$acx_sl_cv_fc_indirect_ok = xyes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test successful." >&5
+else
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test failed." >&5
+fi
+
+fi
+
+      if test $ac_fpp_need_i = yes; then :
+  acx_sl_prog_fc_cpp_i=no
+         $as_echo "$as_me:${as_lineno-$LINENO}: Trying flag to add directories to preprocessor search path." >&5
+         mkdir conftst
+         cd conftst
+
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+   ac_ext="inc"
+   cat > conftest.$ac_ext <<_ACEOF
+           !     This statement overrides the IMPLICIT statement in the program
+         REAL cc
+
+_ACEOF
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+
+         cd ..
+
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+   ac_ext="$acx_sl_fpp_srcext"
+   cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      IMPLICIT CHARACTER (c)
+!     Comments in test programs should be freeform compliant just in case.
+!     conftest.inc contains the Fortran statement "REAL cc"
+#include "conftest.inc"
+      cc=1.
+
+      end
+_ACEOF
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+
+         mv conftest.$acx_sl_fpp_srcext conftest.${acx_sl_fpp_srcext}.bak
+         for FPP_INCOPT in "$FPP_INCOPT" '-I' '-WF,-I' '-Wp,-I'
+         do
+           if test x"$FPP_INCOPT" != x ; then :
+  cp conftest.${acx_sl_fpp_srcext}.bak conftest.$acx_sl_fpp_srcext
+                     { { echo Running preprocessor $FPP $FPPFLAGS ${FPP_INCOPT}conftst conftest.$acx_sl_fpp_srcext; } >&5
+  ($FPP $FPPFLAGS ${FPP_INCOPT}conftst conftest.$acx_sl_fpp_srcext \
+        >conftest.${ac_ext}.tmp) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+
+   mv conftest.${ac_ext}.tmp conftest.${ac_ext}
+   if ac_fn_fc_try_compile "$LINENO"; then :
+                  acx_sl_prog_fc_cpp_i=yes
+                 break
+fi
+rm -f core conftest.err conftest.$ac_objext
+fi
+         done
+         FCFLAGS=$ac_save_FCFLAGS
+         rm -rf conftst
+         if test $acx_sl_prog_fc_cpp_i = no; then :
+  acx_sl_cv_fc_indirect_ok=no
+fi
+         if test x$acx_sl_cv_fc_indirect_ok = xyes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test successful." >&5
+else
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test failed." >&5
+fi
+fi
+      if test $ac_fpp_need_subs = yes; then :
+  acx_sl_prog_fc_cpp_subs=no
+         $as_echo "$as_me:${as_lineno-$LINENO}: Testing preprocessor expansion in Fortran code." >&5
+
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+   ac_ext="$acx_sl_fpp_srcext"
+   cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+#define NM xxxx
+      IMPLICIT CHARACTER (n)
+      REAL xxxx
+      NM=1.
+
+      end
+_ACEOF
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+
+                { { echo Running preprocessor $FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext; } >&5
+  ($FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext \
+        >conftest.${ac_ext}.tmp) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+
+   mv conftest.${ac_ext}.tmp conftest.${ac_ext}
+   if ac_fn_fc_try_compile "$LINENO"; then :
+             acx_sl_prog_fc_cpp_subs=yes
+else
+  acx_sl_cv_fc_indirect_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext
+         if test x$acx_sl_cv_fc_indirect_ok = xyes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test successful." >&5
+else
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test failed." >&5
+fi
+
+fi
+      if test $ac_fpp_need_wrap = yes; then :
+  acx_sl_prog_fc_cpp_wrap=no
+         $as_echo "$as_me:${as_lineno-$LINENO}: Testing wether preprocessor wraps long lines." >&5
+
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+   ac_ext="$acx_sl_fpp_srcext"
+   cat > conftest.$ac_ext <<_ACEOF
+                 program main
+
+#define LONG '901234567890123456789012345678901234567890123456789012345678901234567890'
+      CHARACTER*80 A
+      A=LONG
+
+      end
+_ACEOF
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+
+                { { echo Running preprocessor $FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext; } >&5
+  ($FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext \
+        >conftest.${ac_ext}.tmp) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+
+   mv conftest.${ac_ext}.tmp conftest.${ac_ext}
+   if ac_fn_fc_try_compile "$LINENO"; then :
+             acx_sl_prog_fc_cpp_wrap=yes
+else
+  acx_sl_cv_fc_indirect_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext
+         if test x$acx_sl_cv_fc_indirect_ok = xyes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test successful." >&5
+else
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test failed." >&5
+fi
+
+fi
+      if test $ac_fpp_need_CSTYLE = yes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Testing wether preprocessor removes C-style comments." >&5
+
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+   ac_ext="$acx_sl_fpp_srcext"
+   cat > conftest.$ac_ext <<_ACEOF
+                 program main
+
+      A=1. /* C-style comment */
+
+      end
+_ACEOF
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+
+                { { echo Running preprocessor $FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext; } >&5
+  ($FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext \
+        >conftest.${ac_ext}.tmp) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+
+   mv conftest.${ac_ext}.tmp conftest.${ac_ext}
+   if ac_fn_fc_try_compile "$LINENO"; then :
+             acx_sl_prog_fc_cpp_CSTYLE=yes
+else
+  acx_sl_cv_fc_indirect_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext
+         if test x$acx_sl_cv_fc_indirect_ok = xyes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test successful." >&5
+else
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test failed." >&5
+fi
+
+fi
+      if test $ac_fpp_need_cstyle = yes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Testing wether preprocessor leaves C-style comments in place." >&5
+
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+   ac_ext="$acx_sl_fpp_srcext"
+   cat > conftest.$ac_ext <<_ACEOF
+                 program main
+
+      A=1. /* C-style comment */
+
+      end
+_ACEOF
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+
+                { { echo Running preprocessor $FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext; } >&5
+  ($FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext \
+        >conftest.${ac_ext}.tmp) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+
+   mv conftest.${ac_ext}.tmp conftest.${ac_ext}
+   if ac_fn_fc_try_compile "$LINENO"; then :
+             acx_sl_prog_fc_cpp_CSTYLE=yes
+else
+  acx_sl_cv_fc_indirect_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext
+         if test x$acx_sl_cv_fc_indirect_ok = xyes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test failed." >&5
+else
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test successful." >&5
+fi
+
+fi
+      if test $ac_fpp_need_cxxstyle = yes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Testing if preprocessor leaves C++-style comments in place." >&5
+
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+   ac_ext="$acx_sl_fpp_srcext"
+   cat > conftest.$ac_ext <<_ACEOF
+                 PROGRAM MAIN
+      CHARACTER*10 C
+      C = "abcde" // "fghij"; END PROGRAM
+
+
+_ACEOF
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+
+                { { echo Running preprocessor $FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext; } >&5
+  ($FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext \
+        >conftest.${ac_ext}.tmp) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+
+   mv conftest.${ac_ext}.tmp conftest.${ac_ext}
+   if ac_fn_fc_try_compile "$LINENO"; then :
+             acx_sl_prog_fc_cpp_cxxstyle=yes
+else
+  acx_sl_cv_fc_indirect_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext
+         if test x$acx_sl_cv_fc_indirect_ok = xyes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test successful." >&5
+else
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test failed." >&5
+fi
+
+fi
+      if test $ac_fpp_need_CXXSTYLE = yes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Testing if preprocessor suppresses C++-style comments." >&5
+
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+   ac_ext="$acx_sl_fpp_srcext"
+   cat > conftest.$ac_ext <<_ACEOF
+                 PROGRAM MAIN
+      CHARACTER*10 C
+      C = "abcde" // "fghij"; END PROGRAM
+
+
+_ACEOF
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+
+                { { echo Running preprocessor $FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext; } >&5
+  ($FPP $FPPFLAGS conftest.$acx_sl_fpp_srcext \
+        >conftest.${ac_ext}.tmp) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+
+   mv conftest.${ac_ext}.tmp conftest.${ac_ext}
+   if ac_fn_fc_try_compile "$LINENO"; then :
+             acx_sl_prog_fc_cpp_cxxstyle=yes
+else
+             acx_sl_cv_fc_indirect_ok=no
+fi
+rm -f core conftest.err conftest.$ac_objext
+         if test x$acx_sl_cv_fc_indirect_ok = xyes; then :
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test failed." >&5
+else
+  $as_echo "$as_me:${as_lineno-$LINENO}: Test successful." >&5
+fi
+
+fi
+      FCFLAGS=$ac_save_FCFLAGS
+      rm -f conftest.*
+      if test x$acx_sl_cv_fc_indirect_ok = xyes; then :
+
+else
+        { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "required Fortran preprocessor not available
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_sl_cv_fc_indirect_ok" >&5
+$as_echo "$acx_sl_cv_fc_indirect_ok" >&6; }
+   #FIXME we should probably do the AC_SUBST somewhere else.
+
+
+
+
+
+   ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$F77"; then
+  ac_cv_prog_F77="$F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_F77="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+F77=$ac_cv_prog_F77
+if test -n "$F77"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $F77" >&5
+$as_echo "$F77" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$F77" && break
+  done
+fi
+if test -z "$F77"; then
+  ac_ct_F77=$F77
+  for ac_prog in g77 xlf f77 frt pgf77 cf77 fort77 fl32 af77 xlf90 f90 pgf90 pghpf epcf90 gfortran g95 xlf95 f95 fort ifort ifc efc pgfortran pgf95 lf95 ftn
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_F77"; then
+  ac_cv_prog_ac_ct_F77="$ac_ct_F77" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_F77="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_F77=$ac_cv_prog_ac_ct_F77
+if test -n "$ac_ct_F77"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_F77" >&5
+$as_echo "$ac_ct_F77" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_F77" && break
+done
+
+  if test "x$ac_ct_F77" = x; then
+    F77=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    F77=$ac_ct_F77
+  fi
+fi
+
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for Fortran 77 compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+rm -f a.out
+
+# If we don't use `.F' as extension, the preprocessor is not run on the
+# input file.  (Note that this only needs to work for GNU compilers.)
+ac_save_ext=$ac_ext
+ac_ext=F
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU Fortran 77 compiler" >&5
+$as_echo_n "checking whether we are using the GNU Fortran 77 compiler... " >&6; }
+if ${ac_cv_f77_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+#ifndef __GNUC__
+       choke me
+#endif
+
+      end
+_ACEOF
+if ac_fn_f77_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_f77_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_f77_compiler_gnu" >&5
+$as_echo "$ac_cv_f77_compiler_gnu" >&6; }
+ac_ext=$ac_save_ext
+ac_test_FFLAGS=${FFLAGS+set}
+ac_save_FFLAGS=$FFLAGS
+FFLAGS=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $F77 accepts -g" >&5
+$as_echo_n "checking whether $F77 accepts -g... " >&6; }
+if ${ac_cv_prog_f77_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  FFLAGS=-g
+cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_compile "$LINENO"; then :
+  ac_cv_prog_f77_g=yes
+else
+  ac_cv_prog_f77_g=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_f77_g" >&5
+$as_echo "$ac_cv_prog_f77_g" >&6; }
+if test "$ac_test_FFLAGS" = set; then
+  FFLAGS=$ac_save_FFLAGS
+elif test $ac_cv_prog_f77_g = yes; then
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-g -O2"
+  else
+    FFLAGS="-g"
+  fi
+else
+  if test "x$ac_cv_f77_compiler_gnu" = xyes; then
+    FFLAGS="-O2"
+  else
+    FFLAGS=
+  fi
+fi
+
+if test $ac_compiler_gnu = yes; then
+  G77=yes
+else
+  G77=
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+      ac_ext=f
+ac_compile='$F77 -c $FFLAGS conftest.$ac_ext >&5'
+ac_link='$F77 -o conftest$ac_exeext $FFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_f77_compiler_gnu
+
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+
+archive_cmds_need_lc_F77=no
+allow_undefined_flag_F77=
+always_export_symbols_F77=no
+archive_expsym_cmds_F77=
+export_dynamic_flag_spec_F77=
+hardcode_direct_F77=no
+hardcode_direct_absolute_F77=no
+hardcode_libdir_flag_spec_F77=
+hardcode_libdir_flag_spec_ld_F77=
+hardcode_libdir_separator_F77=
+hardcode_minus_L_F77=no
+hardcode_automatic_F77=no
+inherit_rpath_F77=no
+module_cmds_F77=
+module_expsym_cmds_F77=
+link_all_deplibs_F77=unknown
+old_archive_cmds_F77=$old_archive_cmds
+reload_flag_F77=$reload_flag
+reload_cmds_F77=$reload_cmds
+no_undefined_flag_F77=
+whole_archive_flag_spec_F77=
+enable_shared_with_static_runtimes_F77=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+objext_F77=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${F77-"f77"}
+  CFLAGS=$FFLAGS
+  compiler=$CC
+  compiler_F77=$CC
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+  GCC=$G77
+  if test -n "$compiler"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[4-9]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+    GCC_F77="$G77"
+    LD_F77="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    lt_prog_compiler_wl_F77=
+lt_prog_compiler_pic_F77=
+lt_prog_compiler_static_F77=
+
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl_F77='-Wl,'
+    lt_prog_compiler_static_F77='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_F77='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic_F77='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_F77='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_F77=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_F77='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared_F77=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_F77='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_F77=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic_F77='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl_F77='-Xlinker '
+      lt_prog_compiler_pic_F77='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_F77='-Bstatic'
+      else
+	lt_prog_compiler_static_F77='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic_F77='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	lt_prog_compiler_pic_F77='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static_F77='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-KPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-fPIC'
+	lt_prog_compiler_static_F77='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='--shared'
+	lt_prog_compiler_static_F77='--static'
+	;;
+      nagfor*)
+	# NAG Fortran compiler
+	lt_prog_compiler_wl_F77='-Wl,-Wl,,'
+	lt_prog_compiler_pic_F77='-PIC'
+	lt_prog_compiler_static_F77='-Bstatic'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-fpic'
+	lt_prog_compiler_static_F77='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl_F77='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static_F77='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	lt_prog_compiler_wl_F77='-Wl,'
+	lt_prog_compiler_pic_F77='-qpic'
+	lt_prog_compiler_static_F77='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ F* | *Sun*Fortran*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  lt_prog_compiler_pic_F77='-KPIC'
+	  lt_prog_compiler_static_F77='-Bstatic'
+	  lt_prog_compiler_wl_F77=''
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  lt_prog_compiler_pic_F77='-KPIC'
+	  lt_prog_compiler_static_F77='-Bstatic'
+	  lt_prog_compiler_wl_F77='-Wl,'
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_F77='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static_F77='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	lt_prog_compiler_wl_F77='-Qoption ld ';;
+      *)
+	lt_prog_compiler_wl_F77='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl_F77='-Qoption ld '
+      lt_prog_compiler_pic_F77='-PIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	lt_prog_compiler_pic_F77='-Kconform_pic'
+	lt_prog_compiler_static_F77='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_pic_F77='-KPIC'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl_F77='-Wl,'
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic_F77='-pic'
+      lt_prog_compiler_static_F77='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared_F77=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_F77=
+    ;;
+  *)
+    lt_prog_compiler_pic_F77="$lt_prog_compiler_pic_F77"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_F77=$lt_prog_compiler_pic_F77
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_F77" >&5
+$as_echo "$lt_cv_prog_compiler_pic_F77" >&6; }
+lt_prog_compiler_pic_F77=$lt_cv_prog_compiler_pic_F77
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_F77"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_F77 works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works_F77=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_F77"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_F77=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_F77" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_F77" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_F77" = xyes; then
+    case $lt_prog_compiler_pic_F77 in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_F77=" $lt_prog_compiler_pic_F77" ;;
+     esac
+else
+    lt_prog_compiler_pic_F77=
+     lt_prog_compiler_can_build_shared_F77=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_F77 eval lt_tmp_static_flag=\"$lt_prog_compiler_static_F77\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works_F77=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_F77=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_F77=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_F77" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_F77" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_F77" = xyes; then
+    :
+else
+    lt_prog_compiler_static_F77=
+fi
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_F77=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_F77=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_F77" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_F77" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_F77" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag_F77=
+  always_export_symbols_F77=no
+  archive_cmds_F77=
+  archive_expsym_cmds_F77=
+  compiler_needs_object_F77=no
+  enable_shared_with_static_runtimes_F77=no
+  export_dynamic_flag_spec_F77=
+  export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic_F77=no
+  hardcode_direct_F77=no
+  hardcode_direct_absolute_F77=no
+  hardcode_libdir_flag_spec_F77=
+  hardcode_libdir_flag_spec_ld_F77=
+  hardcode_libdir_separator_F77=
+  hardcode_minus_L_F77=no
+  hardcode_shlibpath_var_F77=unsupported
+  inherit_rpath_F77=no
+  link_all_deplibs_F77=unknown
+  module_cmds_F77=
+  module_expsym_cmds_F77=
+  old_archive_from_new_cmds_F77=
+  old_archive_from_expsyms_cmds_F77=
+  thread_safe_flag_spec_F77=
+  whole_archive_flag_spec_F77=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms_F77=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms_F77='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  ld_shlibs_F77=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+	  *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec_F77='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec_F77="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec_F77=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	ld_shlibs_F77=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds_F77=''
+        ;;
+      m68k)
+            archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_F77='-L$libdir'
+            hardcode_minus_L_F77=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	allow_undefined_flag_F77=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	archive_cmds_F77='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, F77) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      export_dynamic_flag_spec_F77='${wl}--export-all-symbols'
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=no
+      enable_shared_with_static_runtimes_F77=yes
+      export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms_F77='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs_F77=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec_F77='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds_F77='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=' $pic_flag'
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  whole_archive_flag_spec_F77=
+	  tmp_sharedflag='--shared' ;;
+	xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object_F77=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  whole_archive_flag_spec_F77='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  compiler_needs_object_F77=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	archive_cmds_F77='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  whole_archive_flag_spec_F77='--whole-archive$convenience --no-whole-archive'
+	  hardcode_libdir_flag_spec_F77=
+	  hardcode_libdir_flag_spec_ld_F77='-rpath $libdir'
+	  archive_cmds_F77='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    archive_expsym_cmds_F77='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        ld_shlibs_F77=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	ld_shlibs_F77=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+	ld_shlibs_F77=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+	    archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    ld_shlibs_F77=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds_F77='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs_F77" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec_F77=
+      export_dynamic_flag_spec_F77=
+      whole_archive_flag_spec_F77=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag_F77=unsupported
+      always_export_symbols_F77=yes
+      archive_expsym_cmds_F77='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L_F77=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	hardcode_direct_F77=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  export_symbols_cmds_F77='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  export_symbols_cmds_F77='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds_F77=''
+      hardcode_direct_F77=yes
+      hardcode_direct_absolute_F77=yes
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+      file_list_spec_F77='${wl}-f,'
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[012]|aix4.[012].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  hardcode_direct_F77=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  hardcode_minus_L_F77=yes
+	  hardcode_libdir_flag_spec_F77='-L$libdir'
+	  hardcode_libdir_separator_F77=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      export_dynamic_flag_spec_F77='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols_F77=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	allow_undefined_flag_F77='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__F77=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__F77"; then
+    lt_cv_aix_libpath__F77=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__F77"; then
+    lt_cv_aix_libpath__F77="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__F77
+fi
+
+        hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds_F77='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  hardcode_libdir_flag_spec_F77='${wl}-R $libdir:/usr/lib:/lib'
+	  allow_undefined_flag_F77="-z nodefs"
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__F77=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__F77"; then
+    lt_cv_aix_libpath__F77=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__F77"; then
+    lt_cv_aix_libpath__F77="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__F77
+fi
+
+	 hardcode_libdir_flag_spec_F77='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  no_undefined_flag_F77=' ${wl}-bernotok'
+	  allow_undefined_flag_F77=' ${wl}-berok'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    whole_archive_flag_spec_F77='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    whole_archive_flag_spec_F77='$convenience'
+	  fi
+	  archive_cmds_need_lc_F77=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  archive_expsym_cmds_F77="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds_F77=''
+        ;;
+      m68k)
+            archive_cmds_F77='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec_F77='-L$libdir'
+            hardcode_minus_L_F77=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec_F77=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	hardcode_libdir_flag_spec_F77=' '
+	allow_undefined_flag_F77=unsupported
+	always_export_symbols_F77=yes
+	file_list_spec_F77='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds_F77='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	archive_expsym_cmds_F77='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, F77)='true'
+	enable_shared_with_static_runtimes_F77=yes
+	export_symbols_cmds_F77='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	old_postinstall_cmds_F77='chmod 644 $oldlib'
+	postlink_cmds_F77='lt_outputfile="@OUTPUT@"~
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	hardcode_libdir_flag_spec_F77=' '
+	allow_undefined_flag_F77=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	archive_cmds_F77='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	old_archive_from_new_cmds_F77='true'
+	# FIXME: Should let the user specify the lib program.
+	old_archive_cmds_F77='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	enable_shared_with_static_runtimes_F77=yes
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_F77=no
+  hardcode_direct_F77=no
+  hardcode_automatic_F77=yes
+  hardcode_shlibpath_var_F77=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec_F77='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec_F77=''
+  fi
+  link_all_deplibs_F77=yes
+  allow_undefined_flag_F77="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_F77="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds_F77="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds_F77="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds_F77="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs_F77=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    freebsd1*)
+      ld_shlibs_F77=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	archive_cmds_F77='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_direct_F77=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	archive_cmds_F77='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	hardcode_libdir_flag_spec_ld_F77='+b $libdir'
+	hardcode_libdir_separator_F77=:
+	hardcode_direct_F77=yes
+	hardcode_direct_absolute_F77=yes
+	export_dynamic_flag_spec_F77='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	hardcode_minus_L_F77=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_F77='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_F77='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_F77='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	archive_cmds_F77='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	hardcode_libdir_flag_spec_F77='${wl}+b ${wl}$libdir'
+	hardcode_libdir_separator_F77=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  hardcode_direct_F77=no
+	  hardcode_shlibpath_var_F77=no
+	  ;;
+	*)
+	  hardcode_direct_F77=yes
+	  hardcode_direct_absolute_F77=yes
+	  export_dynamic_flag_spec_F77='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  hardcode_minus_L_F77=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+	# This should be the same for all languages, so no per-tag cache variable.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	   cat > conftest.$ac_ext <<_ACEOF
+
+      subroutine foo
+      end
+_ACEOF
+if ac_fn_f77_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          archive_expsym_cmds_F77='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	fi
+      else
+	archive_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_F77='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc_F77='no'
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      inherit_rpath_F77=yes
+      link_all_deplibs_F77=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	archive_cmds_F77='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_direct_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    newsos6)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct_F77=yes
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	hardcode_direct_F77=yes
+	hardcode_shlibpath_var_F77=no
+	hardcode_direct_absolute_F77=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	  export_dynamic_flag_spec_F77='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+	     archive_cmds_F77='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     hardcode_libdir_flag_spec_F77='-R$libdir'
+	     ;;
+	   *)
+	     archive_cmds_F77='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     hardcode_libdir_flag_spec_F77='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	ld_shlibs_F77=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_minus_L_F77=yes
+      allow_undefined_flag_F77=unsupported
+      archive_cmds_F77='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds_F77='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc_F77='no'
+      hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	allow_undefined_flag_F77=' ${wl}-expect_unresolved ${wl}\*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	hardcode_libdir_flag_spec_F77='${wl}-rpath ${wl}$libdir'
+      else
+	allow_undefined_flag_F77=' -expect_unresolved \*'
+	archive_cmds_F77='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	archive_expsym_cmds_F77='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	hardcode_libdir_flag_spec_F77='-rpath $libdir'
+      fi
+      archive_cmds_need_lc_F77='no'
+      hardcode_libdir_separator_F77=:
+      ;;
+
+    solaris*)
+      no_undefined_flag_F77=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	archive_cmds_F77='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  archive_cmds_F77='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  archive_cmds_F77='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_F77='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      hardcode_libdir_flag_spec_F77='-R$libdir'
+      hardcode_shlibpath_var_F77=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  whole_archive_flag_spec_F77='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  whole_archive_flag_spec_F77='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      link_all_deplibs_F77=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	archive_cmds_F77='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_direct_F77=yes
+      hardcode_minus_L_F77=yes
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  archive_cmds_F77='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  reload_cmds_F77='$CC -r -o $output$reload_objs'
+	  hardcode_direct_F77=no
+        ;;
+	motorola)
+	  archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  hardcode_direct_F77=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var_F77=no
+      export_dynamic_flag_spec_F77='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	hardcode_shlibpath_var_F77=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	ld_shlibs_F77=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_F77='${wl}-z,text'
+      archive_cmds_need_lc_F77=no
+      hardcode_shlibpath_var_F77=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag_F77='${wl}-z,text'
+      allow_undefined_flag_F77='${wl}-z,nodefs'
+      archive_cmds_need_lc_F77=no
+      hardcode_shlibpath_var_F77=no
+      hardcode_libdir_flag_spec_F77='${wl}-R,$libdir'
+      hardcode_libdir_separator_F77=':'
+      link_all_deplibs_F77=yes
+      export_dynamic_flag_spec_F77='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	archive_cmds_F77='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	archive_cmds_F77='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	archive_expsym_cmds_F77='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds_F77='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec_F77='-L$libdir'
+      hardcode_shlibpath_var_F77=no
+      ;;
+
+    *)
+      ld_shlibs_F77=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	export_dynamic_flag_spec_F77='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_F77" >&5
+$as_echo "$ld_shlibs_F77" >&6; }
+test "$ld_shlibs_F77" = no && can_build_shared=no
+
+with_gnu_ld_F77=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_F77" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_F77=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_F77 in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_F77+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl_F77
+	  pic_flag=$lt_prog_compiler_pic_F77
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag_F77
+	  allow_undefined_flag_F77=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds_F77 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc_F77=no
+	  else
+	    lt_cv_archive_cmds_need_lc_F77=yes
+	  fi
+	  allow_undefined_flag_F77=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_F77" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_F77" >&6; }
+      archive_cmds_need_lc_F77=$lt_cv_archive_cmds_need_lc_F77
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_F77\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_F77\""
+    cat > conftest.$ac_ext <<_ACEOF
+      program main
+
+      end
+_ACEOF
+if ac_fn_f77_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_F77=
+if test -n "$hardcode_libdir_flag_spec_F77" ||
+   test -n "$runpath_var_F77" ||
+   test "X$hardcode_automatic_F77" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct_F77" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, F77)" != no &&
+     test "$hardcode_minus_L_F77" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_F77=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_F77=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_F77=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_F77" >&5
+$as_echo "$hardcode_action_F77" >&6; }
+
+if test "$hardcode_action_F77" = relink ||
+   test "$inherit_rpath_F77" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+  CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+if test -z "$CXX"; then
+  if test -n "$CCC"; then
+    CXX=$CCC
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CXX"; then
+  ac_cv_prog_CXX="$CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CXX="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CXX=$ac_cv_prog_CXX
+if test -n "$CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5
+$as_echo "$CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CXX" && break
+  done
+fi
+if test -z "$CXX"; then
+  ac_ct_CXX=$CXX
+  for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CXX"; then
+  ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CXX="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CXX=$ac_cv_prog_ac_ct_CXX
+if test -n "$ac_ct_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5
+$as_echo "$ac_ct_CXX" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CXX" && break
+done
+
+  if test "x$ac_ct_CXX" = x; then
+    CXX="g++"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CXX=$ac_ct_CXX
+  fi
+fi
+
+  fi
+fi
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C++ compiler" >&5
+$as_echo_n "checking whether we are using the GNU C++ compiler... " >&6; }
+if ${ac_cv_cxx_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_cxx_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5
+$as_echo "$ac_cv_cxx_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GXX=yes
+else
+  GXX=
+fi
+ac_test_CXXFLAGS=${CXXFLAGS+set}
+ac_save_CXXFLAGS=$CXXFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5
+$as_echo_n "checking whether $CXX accepts -g... " >&6; }
+if ${ac_cv_prog_cxx_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_cxx_werror_flag=$ac_cxx_werror_flag
+   ac_cxx_werror_flag=yes
+   ac_cv_prog_cxx_g=no
+   CXXFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+else
+  CXXFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+
+else
+  ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+	 CXXFLAGS="-g"
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_compile "$LINENO"; then :
+  ac_cv_prog_cxx_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_cxx_werror_flag=$ac_save_cxx_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5
+$as_echo "$ac_cv_prog_cxx_g" >&6; }
+if test "$ac_test_CXXFLAGS" = set; then
+  CXXFLAGS=$ac_save_CXXFLAGS
+elif test $ac_cv_prog_cxx_g = yes; then
+  if test "$GXX" = yes; then
+    CXXFLAGS="-g -O2"
+  else
+    CXXFLAGS="-g"
+  fi
+else
+  if test "$GXX" = yes; then
+    CXXFLAGS="-O2"
+  else
+    CXXFLAGS=
+  fi
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+depcc="$CXX"  am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CXX_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named `D' -- because `-MD' means `put the output
+  # in D'.
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CXX_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
+      # Solaris 8's {/usr,}/bin/sh.
+      touch sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with `-c' and `-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle `-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # after this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested
+      if test "x$enable_dependency_tracking" = xyes; then
+	continue
+      else
+	break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok `-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CXX_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CXX_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CXX_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CXX_dependencies_compiler_type" >&6; }
+CXXDEPMODE=depmode=$am_cv_CXX_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CXX_dependencies_compiler_type" = gcc3; then
+  am__fastdepCXX_TRUE=
+  am__fastdepCXX_FALSE='#'
+else
+  am__fastdepCXX_TRUE='#'
+  am__fastdepCXX_FALSE=
+fi
+
+
+      if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C++ preprocessor" >&5
+$as_echo_n "checking how to run the C++ preprocessor... " >&6; }
+if test -z "$CXXCPP"; then
+  if ${ac_cv_prog_CXXCPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CXXCPP needs to be expanded
+    for CXXCPP in "$CXX -E" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CXXCPP=$CXXCPP
+
+fi
+  CXXCPP=$ac_cv_prog_CXXCPP
+else
+  ac_cv_prog_CXXCPP=$CXXCPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CXXCPP" >&5
+$as_echo "$CXXCPP" >&6; }
+ac_preproc_ok=false
+for ac_cxx_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_cxx_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C++ preprocessor \"$CXXCPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+else
+  _lt_caught_CXX_error=yes
+fi
+
+ac_ext=cpp
+ac_cpp='$CXXCPP $CPPFLAGS'
+ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
+
+archive_cmds_need_lc_CXX=no
+allow_undefined_flag_CXX=
+always_export_symbols_CXX=no
+archive_expsym_cmds_CXX=
+compiler_needs_object_CXX=no
+export_dynamic_flag_spec_CXX=
+hardcode_direct_CXX=no
+hardcode_direct_absolute_CXX=no
+hardcode_libdir_flag_spec_CXX=
+hardcode_libdir_flag_spec_ld_CXX=
+hardcode_libdir_separator_CXX=
+hardcode_minus_L_CXX=no
+hardcode_shlibpath_var_CXX=unsupported
+hardcode_automatic_CXX=no
+inherit_rpath_CXX=no
+module_cmds_CXX=
+module_expsym_cmds_CXX=
+link_all_deplibs_CXX=unknown
+old_archive_cmds_CXX=$old_archive_cmds
+reload_flag_CXX=$reload_flag
+reload_cmds_CXX=$reload_cmds
+no_undefined_flag_CXX=
+whole_archive_flag_spec_CXX=
+enable_shared_with_static_runtimes_CXX=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+objext_CXX=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+  # save warnings/boilerplate of simple test code
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+  ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
+  compiler=$CC
+  compiler_CXX=$CC
+  for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      lt_prog_compiler_no_builtin_flag_CXX=' -fno-builtin'
+    else
+      lt_prog_compiler_no_builtin_flag_CXX=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+
+
+# Check whether --with-gnu-ld was given.
+if test "${with_gnu_ld+set}" = set; then :
+  withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+else
+  with_gnu_ld=no
+fi
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        archive_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        archive_expsym_cmds_CXX='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          whole_archive_flag_spec_CXX=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+    ld_shlibs_CXX=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+      aix[4-9]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        archive_cmds_CXX=''
+        hardcode_direct_CXX=yes
+        hardcode_direct_absolute_CXX=yes
+        hardcode_libdir_separator_CXX=':'
+        link_all_deplibs_CXX=yes
+        file_list_spec_CXX='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[012]|aix4.[012].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    hardcode_direct_CXX=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    hardcode_minus_L_CXX=yes
+	    hardcode_libdir_flag_spec_CXX='-L$libdir'
+	    hardcode_libdir_separator_CXX=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
+	  fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
+	    else
+	      shared_flag='${wl}-bM:SRE'
+	    fi
+          fi
+        fi
+
+        export_dynamic_flag_spec_CXX='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        always_export_symbols_CXX=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          allow_undefined_flag_CXX='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+          hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          archive_expsym_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+	    hardcode_libdir_flag_spec_CXX='${wl}-R $libdir:/usr/lib:/lib'
+	    allow_undefined_flag_CXX="-z nodefs"
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath__CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }'
+  lt_cv_aix_libpath__CXX=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath__CXX"; then
+    lt_cv_aix_libpath__CXX="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath__CXX
+fi
+
+	    hardcode_libdir_flag_spec_CXX='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    no_undefined_flag_CXX=' ${wl}-bernotok'
+	    allow_undefined_flag_CXX=' ${wl}-berok'
+	    if test "$with_gnu_ld" = yes; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      whole_archive_flag_spec_CXX='$convenience'
+	    fi
+	    archive_cmds_need_lc_CXX=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    archive_expsym_cmds_CXX="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  allow_undefined_flag_CXX=unsupported
+	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  archive_cmds_CXX='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	else
+	  ld_shlibs_CXX=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  ld_shlibs_CXX=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+	case $GXX,$cc_basename in
+	,cl* | no,cl*)
+	  # Native MSVC
+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
+	  # no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX=' '
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=yes
+	  file_list_spec_CXX='@'
+	  # Tell ltmain to make .lib files, not .a files.
+	  libext=lib
+	  # Tell ltmain to make .dll files, not .so files.
+	  shrext_cmds=".dll"
+	  # FIXME: Setting linknames here is a bad hack.
+	  archive_cmds_CXX='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	  archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	    else
+	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	    fi~
+	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	    linknames='
+	  # The linker will not automatically build a static lib if we build a DLL.
+	  # _LT_TAGVAR(old_archive_from_new_cmds, CXX)='true'
+	  enable_shared_with_static_runtimes_CXX=yes
+	  # Don't use ranlib
+	  old_postinstall_cmds_CXX='chmod 644 $oldlib'
+	  postlink_cmds_CXX='lt_outputfile="@OUTPUT@"~
+	    lt_tool_outputfile="@TOOL_OUTPUT@"~
+	    case $lt_outputfile in
+	      *.exe|*.EXE) ;;
+	      *)
+		lt_outputfile="$lt_outputfile.exe"
+		lt_tool_outputfile="$lt_tool_outputfile.exe"
+		;;
+	    esac~
+	    func_to_tool_file "$lt_outputfile"~
+	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	      $RM "$lt_outputfile.manifest";
+	    fi'
+	  ;;
+	*)
+	  # g++
+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, CXX) is actually meaningless,
+	  # as there is no search path for DLLs.
+	  hardcode_libdir_flag_spec_CXX='-L$libdir'
+	  export_dynamic_flag_spec_CXX='${wl}--export-all-symbols'
+	  allow_undefined_flag_CXX=unsupported
+	  always_export_symbols_CXX=no
+	  enable_shared_with_static_runtimes_CXX=yes
+
+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+	    archive_cmds_CXX='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file (1st line
+	    # is EXPORTS), use it as is; otherwise, prepend...
+	    archive_expsym_cmds_CXX='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      cp $export_symbols $output_objdir/$soname.def;
+	    else
+	      echo EXPORTS > $output_objdir/$soname.def;
+	      cat $export_symbols >> $output_objdir/$soname.def;
+	    fi~
+	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	  else
+	    ld_shlibs_CXX=no
+	  fi
+	  ;;
+	esac
+	;;
+      darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc_CXX=no
+  hardcode_direct_CXX=no
+  hardcode_automatic_CXX=yes
+  hardcode_shlibpath_var_CXX=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    whole_archive_flag_spec_CXX='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    whole_archive_flag_spec_CXX=''
+  fi
+  link_all_deplibs_CXX=yes
+  allow_undefined_flag_CXX="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds_CXX="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds_CXX="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds_CXX="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+       if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      archive_cmds_CXX="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      archive_expsym_cmds_CXX="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+
+  else
+  ld_shlibs_CXX=no
+  fi
+
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      freebsd[12]*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        ld_shlibs_CXX=no
+        ;;
+
+      freebsd-elf*)
+        archive_cmds_need_lc_CXX=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        ld_shlibs_CXX=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      haiku*)
+        archive_cmds_CXX='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        link_all_deplibs_CXX=yes
+        ;;
+
+      hpux9*)
+        hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+        hardcode_libdir_separator_CXX=:
+        export_dynamic_flag_spec_CXX='${wl}-E'
+        hardcode_direct_CXX=yes
+        hardcode_minus_L_CXX=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            ld_shlibs_CXX=no
+            ;;
+          aCC*)
+            archive_cmds_CXX='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              archive_cmds_CXX='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              ld_shlibs_CXX=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+	  hardcode_libdir_flag_spec_CXX='${wl}+b ${wl}$libdir'
+	  hardcode_libdir_separator_CXX=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      export_dynamic_flag_spec_CXX='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            hardcode_direct_CXX=no
+            hardcode_shlibpath_var_CXX=no
+            ;;
+          *)
+            hardcode_direct_CXX=yes
+            hardcode_direct_absolute_CXX=yes
+            hardcode_minus_L_CXX=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        archive_cmds_CXX='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
+	        case $host_cpu in
+	          hppa*64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            archive_cmds_CXX='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[3-9]*)
+	hardcode_direct_CXX=no
+	hardcode_shlibpath_var_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	export_dynamic_flag_spec_CXX='${wl}-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	archive_expsym_cmds_CXX='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    archive_cmds_CXX='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	      else
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	      fi
+	    fi
+	    link_all_deplibs_CXX=yes
+	    ;;
+        esac
+        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+        hardcode_libdir_separator_CXX=:
+        inherit_rpath_CXX=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    archive_expsym_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        archive_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		archive_expsym_cmds_CXX='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    archive_cmds_need_lc_CXX=no
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    whole_archive_flag_spec_CXX='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [1-5].* | *pgcpp\ [1-5].*)
+	      prelink_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+	      old_archive_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+		$RANLIB $oldlib'
+	      archive_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      archive_expsym_cmds_CXX='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 and above use weak symbols
+	      archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    hardcode_libdir_flag_spec_CXX='${wl}--rpath ${wl}$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    whole_archive_flag_spec_CXX='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    archive_expsym_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    ;;
+	  xl* | mpixl* | bgxl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	    export_dynamic_flag_spec_CXX='${wl}--export-dynamic'
+	    archive_cmds_CXX='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
+	      archive_expsym_cmds_CXX='echo "{ global:" > $output_objdir/$libname.ver~
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      no_undefined_flag_CXX=' -zdefs'
+	      archive_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      archive_expsym_cmds_CXX='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      hardcode_libdir_flag_spec_CXX='-R$libdir'
+	      whole_archive_flag_spec_CXX='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      compiler_needs_object_CXX=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='func_echo_all'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	ld_shlibs_CXX=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  archive_cmds_CXX='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  hardcode_libdir_flag_spec_CXX='-R$libdir'
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        ld_shlibs_CXX=yes
+	;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+	ld_shlibs_CXX=no
+	;;
+
+      openbsd*)
+	if test -f /usr/libexec/ld.so; then
+	  hardcode_direct_CXX=yes
+	  hardcode_shlibpath_var_CXX=no
+	  hardcode_direct_absolute_CXX=yes
+	  archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    archive_expsym_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    export_dynamic_flag_spec_CXX='${wl}-E'
+	    whole_archive_flag_spec_CXX="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=func_echo_all
+	else
+	  ld_shlibs_CXX=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    archive_cmds_CXX='tempext=`echo $shared_ext | $SED -e '\''s/\([^()0-9A-Za-z{}]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    hardcode_libdir_flag_spec_CXX='${wl}-rpath,$libdir'
+	    hardcode_libdir_separator_CXX=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) old_archive_cmds_CXX='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) old_archive_cmds_CXX='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+		;;
+	      *)
+	        allow_undefined_flag_CXX=' -expect_unresolved \*'
+	        archive_cmds_CXX='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        archive_expsym_cmds_CXX='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
+	        hardcode_libdir_flag_spec_CXX='-rpath $libdir'
+		;;
+	    esac
+
+	    hardcode_libdir_separator_CXX=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+	  *)
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      allow_undefined_flag_CXX=' ${wl}-expect_unresolved ${wl}\*'
+	      case $host in
+	        osf3*)
+	          archive_cmds_CXX='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	        *)
+	          archive_cmds_CXX='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      hardcode_libdir_flag_spec_CXX='${wl}-rpath ${wl}$libdir'
+	      hardcode_libdir_separator_CXX=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      ld_shlibs_CXX=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            archive_cmds_need_lc_CXX=yes
+	    no_undefined_flag_CXX=' -zdefs'
+	    archive_cmds_CXX='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    hardcode_libdir_flag_spec_CXX='-R$libdir'
+	    hardcode_shlibpath_var_CXX=no
+	    case $host_os in
+	      solaris2.[0-5] | solaris2.[0-5].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands `-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		whole_archive_flag_spec_CXX='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    link_all_deplibs_CXX=yes
+
+	    output_verbose_link_cmd='func_echo_all'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    old_archive_cmds_CXX='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    archive_cmds_CXX='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    old_archive_cmds_CXX='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      no_undefined_flag_CXX=' ${wl}-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        archive_cmds_CXX='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # platform.
+	        archive_cmds_CXX='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      fi
+
+	      hardcode_libdir_flag_spec_CXX='${wl}-R $wl$libdir'
+	      case $host_os in
+		solaris2.[0-5] | solaris2.[0-5].*) ;;
+		*)
+		  whole_archive_flag_spec_CXX='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag_CXX='${wl}-z,text'
+      archive_cmds_need_lc_CXX=no
+      hardcode_shlibpath_var_CXX=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We can NOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	no_undefined_flag_CXX='${wl}-z,text'
+	allow_undefined_flag_CXX='${wl}-z,nodefs'
+	archive_cmds_need_lc_CXX=no
+	hardcode_shlibpath_var_CXX=no
+	hardcode_libdir_flag_spec_CXX='${wl}-R,$libdir'
+	hardcode_libdir_separator_CXX=':'
+	link_all_deplibs_CXX=yes
+	export_dynamic_flag_spec_CXX='${wl}-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    archive_cmds_CXX='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    old_archive_cmds_CXX='$CC -Tprelink_objects $oldobjs~
+	      '"$old_archive_cmds_CXX"
+	    reload_cmds_CXX='$CC -Tprelink_objects $reload_objs~
+	      '"$reload_cmds_CXX"
+	    ;;
+	  *)
+	    archive_cmds_CXX='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    archive_expsym_cmds_CXX='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    ld_shlibs_CXX=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        ld_shlibs_CXX=no
+        ;;
+    esac
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+    test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+    GCC_CXX="$GXX"
+    LD_CXX="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    # Dependencies to place before and after the object being linked:
+predep_objects_CXX=
+postdep_objects_CXX=
+predeps_CXX=
+postdeps_CXX=
+compiler_lib_search_path_CXX=
+
+cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
+if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case ${prev}${p} in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+	 prev=$p
+	 continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test "$pre_test_object_deps_done" = no; then
+	 case ${prev} in
+	 -L | -R)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$compiler_lib_search_path_CXX"; then
+	     compiler_lib_search_path_CXX="${prev}${p}"
+	   else
+	     compiler_lib_search_path_CXX="${compiler_lib_search_path_CXX} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$postdeps_CXX"; then
+	   postdeps_CXX="${prev}${p}"
+	 else
+	   postdeps_CXX="${postdeps_CXX} ${prev}${p}"
+	 fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$predep_objects_CXX"; then
+	   predep_objects_CXX="$p"
+	 else
+	   predep_objects_CXX="$predep_objects_CXX $p"
+	 fi
+       else
+	 if test -z "$postdep_objects_CXX"; then
+	   postdep_objects_CXX="$p"
+	 else
+	   postdep_objects_CXX="$postdep_objects_CXX $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling CXX test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+case $host_os in
+interix[3-9]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  predep_objects_CXX=
+  postdep_objects_CXX=
+  postdeps_CXX=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      postdeps_CXX='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+
+
+case " $postdeps_CXX " in
+*" -lc "*) archive_cmds_need_lc_CXX=no ;;
+esac
+ compiler_lib_search_dirs_CXX=
+if test -n "${compiler_lib_search_path_CXX}"; then
+ compiler_lib_search_dirs_CXX=`echo " ${compiler_lib_search_path_CXX}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+    lt_prog_compiler_wl_CXX=
+lt_prog_compiler_pic_CXX=
+lt_prog_compiler_static_CXX=
+
+
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    lt_prog_compiler_wl_CXX='-Wl,'
+    lt_prog_compiler_static_CXX='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	lt_prog_compiler_static_CXX='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic_CXX='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic_CXX='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic_CXX='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      lt_prog_compiler_pic_CXX=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static_CXX=
+      ;;
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	lt_prog_compiler_pic_CXX=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	;;
+      *)
+	lt_prog_compiler_pic_CXX='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic_CXX='-fPIC -shared'
+      ;;
+    *)
+      lt_prog_compiler_pic_CXX='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[4-9]*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  lt_prog_compiler_static_CXX='-Bstatic'
+	else
+	  lt_prog_compiler_static_CXX='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, CXX)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+	# This hack is so that the source file can tell whether it is being
+	# built for inclusion in a dll (and should export symbols for example).
+	lt_prog_compiler_pic_CXX='-DDLL_EXPORT'
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
+	      lt_prog_compiler_pic_CXX='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='${wl}-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      lt_prog_compiler_pic_CXX='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    ;;
+	  ecpc* )
+	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fPIC'
+	    lt_prog_compiler_static_CXX='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-fpic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  xlc* | xlC* | bgxl[cC]* | mpixl[cC]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-qpic'
+	    lt_prog_compiler_static_CXX='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      lt_prog_compiler_pic_CXX='-KPIC'
+	      lt_prog_compiler_static_CXX='-Bstatic'
+	      lt_prog_compiler_wl_CXX='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    lt_prog_compiler_pic_CXX='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        lt_prog_compiler_pic_CXX='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    lt_prog_compiler_wl_CXX='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    lt_prog_compiler_pic_CXX=
+	    lt_prog_compiler_static_CXX='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    lt_prog_compiler_wl_CXX='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    lt_prog_compiler_pic_CXX='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    lt_prog_compiler_pic_CXX='-pic'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    lt_prog_compiler_pic_CXX='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    lt_prog_compiler_wl_CXX='-Wl,'
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    lt_prog_compiler_static_CXX='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    lt_prog_compiler_pic_CXX='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	lt_prog_compiler_can_build_shared_CXX=no
+	;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic_CXX=
+    ;;
+  *)
+    lt_prog_compiler_pic_CXX="$lt_prog_compiler_pic_CXX -DPIC"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_CXX=$lt_prog_compiler_pic_CXX
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_CXX" >&6; }
+lt_prog_compiler_pic_CXX=$lt_cv_prog_compiler_pic_CXX
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic_CXX"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic_CXX works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works_CXX=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic_CXX -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works_CXX=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works_CXX" = xyes; then
+    case $lt_prog_compiler_pic_CXX in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic_CXX=" $lt_prog_compiler_pic_CXX" ;;
+     esac
+else
+    lt_prog_compiler_pic_CXX=
+     lt_prog_compiler_can_build_shared_CXX=no
+fi
+
+fi
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl_CXX eval lt_tmp_static_flag=\"$lt_prog_compiler_static_CXX\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works_CXX=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works_CXX=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works_CXX=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_static_works_CXX" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works_CXX" = xyes; then
+    :
+else
+    lt_prog_compiler_static_CXX=
+fi
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o_CXX=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o_CXX=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o_CXX" >&5
+$as_echo "$lt_cv_prog_compiler_c_o_CXX" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o_CXX" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  case $host_os in
+  aix[4-9]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    export_symbols_cmds_CXX="$ltdll_cmds"
+    ;;
+  cygwin* | mingw* | cegcc*)
+    case $cc_basename in
+    cl*) ;;
+    *)
+      export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms_CXX='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+      ;;
+    esac
+    ;;
+  *)
+    export_symbols_cmds_CXX='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+    ;;
+  esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs_CXX" >&5
+$as_echo "$ld_shlibs_CXX" >&6; }
+test "$ld_shlibs_CXX" = no && can_build_shared=no
+
+with_gnu_ld_CXX=$with_gnu_ld
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc_CXX" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc_CXX=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds_CXX in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc_CXX+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$lt_prog_compiler_wl_CXX
+	  pic_flag=$lt_prog_compiler_pic_CXX
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$allow_undefined_flag_CXX
+	  allow_undefined_flag_CXX=
+	  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds_CXX 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+	  then
+	    lt_cv_archive_cmds_need_lc_CXX=no
+	  else
+	    lt_cv_archive_cmds_need_lc_CXX=yes
+	  fi
+	  allow_undefined_flag_CXX=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc_CXX" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc_CXX" >&6; }
+      archive_cmds_need_lc_CXX=$lt_cv_archive_cmds_need_lc_CXX
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[123]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl_CXX\"; \
+	 LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec_CXX\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_cxx_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action_CXX=
+if test -n "$hardcode_libdir_flag_spec_CXX" ||
+   test -n "$runpath_var_CXX" ||
+   test "X$hardcode_automatic_CXX" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct_CXX" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, CXX)" != no &&
+     test "$hardcode_minus_L_CXX" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action_CXX=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action_CXX=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action_CXX=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action_CXX" >&5
+$as_echo "$hardcode_action_CXX" >&6; }
+
+if test "$hardcode_action_CXX" = relink ||
+   test "$inherit_rpath_CXX" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Extract the first word of "sed", so it can be a program name with args.
+set dummy sed; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$SED"; then
+  ac_cv_prog_SED="$SED" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_SED="sed"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_prog_SED" && ac_cv_prog_SED="false"
+fi
+fi
+SED=$ac_cv_prog_SED
+if test -n "$SED"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SED" >&5
+$as_echo "$SED" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+# Extract the first word of "grep", so it can be a program name with args.
+set dummy grep; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$GREP"; then
+  ac_cv_prog_GREP="$GREP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_GREP="grep"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_prog_GREP" && ac_cv_prog_GREP="false"
+fi
+fi
+GREP=$ac_cv_prog_GREP
+if test -n "$GREP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $GREP" >&5
+$as_echo "$GREP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AR="${ac_tool_prefix}ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AR"; then
+  ac_ct_AR=$AR
+  # Extract the first word of "ar", so it can be a program name with args.
+set dummy ar; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AR="ar"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AR" = x; then
+    AR=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+else
+  AR="$ac_cv_prog_AR"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}cpp", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cpp; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CPP"; then
+  ac_cv_prog_CPP="$CPP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CPP="${ac_tool_prefix}cpp"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CPP=$ac_cv_prog_CPP
+if test -n "$CPP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CPP"; then
+  ac_ct_CPP=$CPP
+  # Extract the first word of "cpp", so it can be a program name with args.
+set dummy cpp; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CPP"; then
+  ac_cv_prog_ac_ct_CPP="$ac_ct_CPP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CPP="cpp"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CPP=$ac_cv_prog_ac_ct_CPP
+if test -n "$ac_ct_CPP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CPP" >&5
+$as_echo "$ac_ct_CPP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CPP" = x; then
+    CPP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    CPP=$ac_ct_CPP
+  fi
+else
+  CPP="$ac_cv_prog_CPP"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ld; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LD"; then
+  ac_cv_prog_LD="$LD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_LD="${ac_tool_prefix}ld"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+LD=$ac_cv_prog_LD
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LD"; then
+  ac_ct_LD=$LD
+  # Extract the first word of "ld", so it can be a program name with args.
+set dummy ld; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LD"; then
+  ac_cv_prog_ac_ct_LD="$ac_ct_LD" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_LD="ld"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_LD=$ac_cv_prog_ac_ct_LD
+if test -n "$ac_ct_LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LD" >&5
+$as_echo "$ac_ct_LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LD" = x; then
+    LD=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    LD=$ac_ct_LD
+  fi
+else
+  LD="$ac_cv_prog_LD"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nm; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  ac_cv_prog_NM="$NM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NM="${ac_tool_prefix}nm"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NM=$ac_cv_prog_NM
+if test -n "$NM"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NM" >&5
+$as_echo "$NM" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NM"; then
+  ac_ct_NM=$NM
+  # Extract the first word of "nm", so it can be a program name with args.
+set dummy nm; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NM"; then
+  ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_NM="nm"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_NM=$ac_cv_prog_ac_ct_NM
+if test -n "$ac_ct_NM"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NM" >&5
+$as_echo "$ac_ct_NM" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NM" = x; then
+    NM=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    NM=$ac_ct_NM
+  fi
+else
+  NM="$ac_cv_prog_NM"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}as", so it can be a program name with args.
+set dummy ${ac_tool_prefix}as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AS"; then
+  ac_cv_prog_AS="$AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_AS="${ac_tool_prefix}as"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AS=$ac_cv_prog_AS
+if test -n "$AS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AS" >&5
+$as_echo "$AS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_AS"; then
+  ac_ct_AS=$AS
+  # Extract the first word of "as", so it can be a program name with args.
+set dummy as; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AS+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AS"; then
+  ac_cv_prog_ac_ct_AS="$ac_ct_AS" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_AS="as"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AS=$ac_cv_prog_ac_ct_AS
+if test -n "$ac_ct_AS"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AS" >&5
+$as_echo "$ac_ct_AS" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_AS" = x; then
+    AS=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AS=$ac_ct_AS
+  fi
+else
+  AS="$ac_cv_prog_AS"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_OBJDUMP="${ac_tool_prefix}objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_OBJDUMP="objdump"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_STRIP="${ac_tool_prefix}strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_STRIP="strip"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+#  ----------------------------------------------------------------------
+# Check large file support on 32 bit systems
+# Check whether --enable-largefile was given.
+if test "${enable_largefile+set}" = set; then :
+  enableval=$enable_largefile;
+fi
+
+if test "$enable_largefile" != no; then
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5
+$as_echo_n "checking for special C compiler options needed for large files... " >&6; }
+if ${ac_cv_sys_largefile_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_sys_largefile_CC=no
+     if test "$GCC" != yes; then
+       ac_save_CC=$CC
+       while :; do
+	 # IRIX 6.2 and later do not support large files by default,
+	 # so use the C compiler's -n32 option if that helps.
+	 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+	 if ac_fn_c_try_compile "$LINENO"; then :
+  break
+fi
+rm -f core conftest.err conftest.$ac_objext
+	 CC="$CC -n32"
+	 if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_largefile_CC=' -n32'; break
+fi
+rm -f core conftest.err conftest.$ac_objext
+	 break
+       done
+       CC=$ac_save_CC
+       rm -f conftest.$ac_ext
+    fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5
+$as_echo "$ac_cv_sys_largefile_CC" >&6; }
+  if test "$ac_cv_sys_largefile_CC" != no; then
+    CC=$CC$ac_cv_sys_largefile_CC
+  fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5
+$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; }
+if ${ac_cv_sys_file_offset_bits+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _FILE_OFFSET_BITS 64
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_file_offset_bits=64; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_file_offset_bits=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5
+$as_echo "$ac_cv_sys_file_offset_bits" >&6; }
+case $ac_cv_sys_file_offset_bits in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  if test $ac_cv_sys_file_offset_bits = unknown; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5
+$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; }
+if ${ac_cv_sys_large_files+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  while :; do
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=no; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#define _LARGE_FILES 1
+#include <sys/types.h>
+ /* Check that off_t can represent 2**63 - 1 correctly.
+    We can't simply define LARGE_OFF_T to be 9223372036854775807,
+    since some C++ compilers masquerading as C compilers
+    incorrectly reject 9223372036854775807.  */
+#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62))
+  int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721
+		       && LARGE_OFF_T % 2147483647 == 1)
+		      ? 1 : -1];
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_sys_large_files=1; break
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+  ac_cv_sys_large_files=unknown
+  break
+done
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5
+$as_echo "$ac_cv_sys_large_files" >&6; }
+case $ac_cv_sys_large_files in #(
+  no | unknown) ;;
+  *)
+cat >>confdefs.h <<_ACEOF
+#define _LARGE_FILES $ac_cv_sys_large_files
+_ACEOF
+;;
+esac
+rm -rf conftest*
+  fi
+fi
+
+#  ----------------------------------------------------------------------
+# Checks for library functions.
+
+
+
+  for ac_header in $ac_header_list
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+
+
+
+for ac_func in getpagesize
+do :
+  ac_fn_c_check_func "$LINENO" "getpagesize" "ac_cv_func_getpagesize"
+if test "x$ac_cv_func_getpagesize" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GETPAGESIZE 1
+_ACEOF
+
+fi
+done
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for working mmap" >&5
+$as_echo_n "checking for working mmap... " >&6; }
+if ${ac_cv_func_mmap_fixed_mapped+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "$cross_compiling" = yes; then :
+  ac_cv_func_mmap_fixed_mapped=no
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$ac_includes_default
+/* malloc might have been renamed as rpl_malloc. */
+#undef malloc
+
+/* Thanks to Mike Haertel and Jim Avera for this test.
+   Here is a matrix of mmap possibilities:
+	mmap private not fixed
+	mmap private fixed at somewhere currently unmapped
+	mmap private fixed at somewhere already mapped
+	mmap shared not fixed
+	mmap shared fixed at somewhere currently unmapped
+	mmap shared fixed at somewhere already mapped
+   For private mappings, we should verify that changes cannot be read()
+   back from the file, nor mmap's back from the file at a different
+   address.  (There have been systems where private was not correctly
+   implemented like the infamous i386 svr4.0, and systems where the
+   VM page cache was not coherent with the file system buffer cache
+   like early versions of FreeBSD and possibly contemporary NetBSD.)
+   For shared mappings, we should conversely verify that changes get
+   propagated back to all the places they're supposed to be.
+
+   Grep wants private fixed already mapped.
+   The main things grep needs to know about mmap are:
+   * does it exist and is it safe to write into the mmap'd area
+   * how to use it (BSD variants)  */
+
+#include <fcntl.h>
+#include <sys/mman.h>
+
+#if !defined STDC_HEADERS && !defined HAVE_STDLIB_H
+char *malloc ();
+#endif
+
+/* This mess was copied from the GNU getpagesize.h.  */
+#ifndef HAVE_GETPAGESIZE
+# ifdef _SC_PAGESIZE
+#  define getpagesize() sysconf(_SC_PAGESIZE)
+# else /* no _SC_PAGESIZE */
+#  ifdef HAVE_SYS_PARAM_H
+#   include <sys/param.h>
+#   ifdef EXEC_PAGESIZE
+#    define getpagesize() EXEC_PAGESIZE
+#   else /* no EXEC_PAGESIZE */
+#    ifdef NBPG
+#     define getpagesize() NBPG * CLSIZE
+#     ifndef CLSIZE
+#      define CLSIZE 1
+#     endif /* no CLSIZE */
+#    else /* no NBPG */
+#     ifdef NBPC
+#      define getpagesize() NBPC
+#     else /* no NBPC */
+#      ifdef PAGESIZE
+#       define getpagesize() PAGESIZE
+#      endif /* PAGESIZE */
+#     endif /* no NBPC */
+#    endif /* no NBPG */
+#   endif /* no EXEC_PAGESIZE */
+#  else /* no HAVE_SYS_PARAM_H */
+#   define getpagesize() 8192	/* punt totally */
+#  endif /* no HAVE_SYS_PARAM_H */
+# endif /* no _SC_PAGESIZE */
+
+#endif /* no HAVE_GETPAGESIZE */
+
+int
+main ()
+{
+  char *data, *data2, *data3;
+  const char *cdata2;
+  int i, pagesize;
+  int fd, fd2;
+
+  pagesize = getpagesize ();
+
+  /* First, make a file with some known garbage in it. */
+  data = (char *) malloc (pagesize);
+  if (!data)
+    return 1;
+  for (i = 0; i < pagesize; ++i)
+    *(data + i) = rand ();
+  umask (0);
+  fd = creat ("conftest.mmap", 0600);
+  if (fd < 0)
+    return 2;
+  if (write (fd, data, pagesize) != pagesize)
+    return 3;
+  close (fd);
+
+  /* Next, check that the tail of a page is zero-filled.  File must have
+     non-zero length, otherwise we risk SIGBUS for entire page.  */
+  fd2 = open ("conftest.txt", O_RDWR | O_CREAT | O_TRUNC, 0600);
+  if (fd2 < 0)
+    return 4;
+  cdata2 = "";
+  if (write (fd2, cdata2, 1) != 1)
+    return 5;
+  data2 = (char *) mmap (0, pagesize, PROT_READ | PROT_WRITE, MAP_SHARED, fd2, 0L);
+  if (data2 == MAP_FAILED)
+    return 6;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data2 + i))
+      return 7;
+  close (fd2);
+  if (munmap (data2, pagesize))
+    return 8;
+
+  /* Next, try to mmap the file at a fixed address which already has
+     something else allocated at it.  If we can, also make sure that
+     we see the same garbage.  */
+  fd = open ("conftest.mmap", O_RDWR);
+  if (fd < 0)
+    return 9;
+  if (data2 != mmap (data2, pagesize, PROT_READ | PROT_WRITE,
+		     MAP_PRIVATE | MAP_FIXED, fd, 0L))
+    return 10;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data2 + i))
+      return 11;
+
+  /* Finally, make sure that changes to the mapped area do not
+     percolate back to the file as seen by read().  (This is a bug on
+     some variants of i386 svr4.0.)  */
+  for (i = 0; i < pagesize; ++i)
+    *(data2 + i) = *(data2 + i) + 1;
+  data3 = (char *) malloc (pagesize);
+  if (!data3)
+    return 12;
+  if (read (fd, data3, pagesize) != pagesize)
+    return 13;
+  for (i = 0; i < pagesize; ++i)
+    if (*(data + i) != *(data3 + i))
+      return 14;
+  close (fd);
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+  ac_cv_func_mmap_fixed_mapped=yes
+else
+  ac_cv_func_mmap_fixed_mapped=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_mmap_fixed_mapped" >&5
+$as_echo "$ac_cv_func_mmap_fixed_mapped" >&6; }
+if test $ac_cv_func_mmap_fixed_mapped = yes; then
+
+$as_echo "#define HAVE_MMAP 1" >>confdefs.h
+
+fi
+rm -f conftest.mmap conftest.txt
+
+#  ----------------------------------------------------------------------
+# Checks for library malloc.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for malloc in -lmalloc" >&5
+$as_echo_n "checking for malloc in -lmalloc... " >&6; }
+if ${ac_cv_lib_malloc_malloc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lmalloc  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char malloc ();
+int
+main ()
+{
+return malloc ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_malloc_malloc=yes
+else
+  ac_cv_lib_malloc_malloc=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_malloc_malloc" >&5
+$as_echo "$ac_cv_lib_malloc_malloc" >&6; }
+if test "x$ac_cv_lib_malloc_malloc" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBMALLOC 1
+_ACEOF
+
+  LIBS="-lmalloc $LIBS"
+
+fi
+
+#  ----------------------------------------------------------------------
+# Checks for structures.
+ac_fn_c_check_member "$LINENO" "struct stat" "st_blksize" "ac_cv_member_struct_stat_st_blksize" "$ac_includes_default"
+if test "x$ac_cv_member_struct_stat_st_blksize" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+_ACEOF
+
+
+fi
+
+#  ----------------------------------------------------------------------
+# Checks for header files
+for ac_header in malloc.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "malloc.h" "ac_cv_header_malloc_h" "$ac_includes_default"
+if test "x$ac_cv_header_malloc_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MALLOC_H 1
+_ACEOF
+
+fi
+
+done
+
+#  ----------------------------------------------------------------------
+# Checks for the availability of functions
+for ac_func in mallinfo
+do :
+  ac_fn_c_check_func "$LINENO" "mallinfo" "ac_cv_func_mallinfo"
+if test "x$ac_cv_func_mallinfo" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MALLINFO 1
+_ACEOF
+
+fi
+done
+
+#  ----------------------------------------------------------------------
+# Checks for the availability of ANSI-C99 functions
+ac_fn_c_check_decl "$LINENO" "isnan" "ac_cv_have_decl_isnan" "$ac_includes_default
+#include <math.h>
+"
+if test "x$ac_cv_have_decl_isnan" = xyes; then :
+  ac_have_decl=1
+else
+  ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ISNAN $ac_have_decl
+_ACEOF
+
+#  ----------------------------------------------------------------------
+#  Check for math library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for floor in -lm" >&5
+$as_echo_n "checking for floor in -lm... " >&6; }
+if ${ac_cv_lib_m_floor+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lm  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char floor ();
+int
+main ()
+{
+return floor ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_m_floor=yes
+else
+  ac_cv_lib_m_floor=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_floor" >&5
+$as_echo "$ac_cv_lib_m_floor" >&6; }
+if test "x$ac_cv_lib_m_floor" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBM 1
+_ACEOF
+
+  LIBS="-lm $LIBS"
+
+fi
+
+#  ----------------------------------------------------------------------
+# Add basic configure options
+
+#  ----------------------------------------------------------------------
+#  Checks for multithreaded compiling + linking
+
+# Check whether --with-threads was given.
+if test "${with_threads+set}" = set; then :
+  withval=$with_threads;
+else
+  with_threads=yes
+fi
+
+THREADS_INCLUDE=''
+THREADS_LIBS=''
+case $with_threads in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking multithreading" >&5
+$as_echo_n "checking multithreading... " >&6; }
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS" >&5
+$as_echo_n "checking for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS... " >&6; }
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_join ();
+int
+main ()
+{
+return pthread_join ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ax_pthread_ok=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+        if test x"$ax_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+#      ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+        ;;
+
+	*-darwin*)
+	ax_pthread_flags="-pthread $ax_pthread_flags"
+	;;
+esac
+
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
+
+        case $flag in
+                none)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work without any flags" >&5
+$as_echo_n "checking whether pthreads work without any flags... " >&6; }
+                ;;
+
+                -*)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether pthreads work with $flag" >&5
+$as_echo_n "checking whether pthreads work with $flag... " >&6; }
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+		pthread-config)
+		# Extract the first word of "pthread-config", so it can be a program name with args.
+set dummy pthread-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ax_pthread_config+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ax_pthread_config"; then
+  ac_cv_prog_ax_pthread_config="$ax_pthread_config" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ax_pthread_config="yes"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_prog_ax_pthread_config" && ac_cv_prog_ax_pthread_config="no"
+fi
+fi
+ax_pthread_config=$ac_cv_prog_ax_pthread_config
+if test -n "$ax_pthread_config"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_config" >&5
+$as_echo "$ax_pthread_config" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+		if test x"$ax_pthread_config" = xno; then continue; fi
+		PTHREAD_CFLAGS="`pthread-config --cflags`"
+		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+		;;
+
+                *)
+                { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the pthreads library -l$flag" >&5
+$as_echo_n "checking for the pthreads library -l$flag... " >&6; }
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+		     static void routine(void* a) {a=0;}
+		     static void* start_routine(void* a) {return a;}
+int
+main ()
+{
+pthread_t th; pthread_attr_t attr;
+                     pthread_create(&th,0,start_routine,0);
+                     pthread_join(th, 0);
+                     pthread_attr_init(&attr);
+                     pthread_cleanup_push(routine, 0);
+                     pthread_cleanup_pop(0);
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ax_pthread_ok=yes
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ax_pthread_ok" >&5
+$as_echo "$ax_pthread_ok" >&6; }
+        if test "x$ax_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for joinable pthread attribute" >&5
+$as_echo_n "checking for joinable pthread attribute... " >&6; }
+	attr_name=unknown
+	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+	    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <pthread.h>
+int
+main ()
+{
+int attr=$attr; return attr;
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  attr_name=$attr; break
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+	done
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: $attr_name" >&5
+$as_echo "$attr_name" >&6; }
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+
+cat >>confdefs.h <<_ACEOF
+#define PTHREAD_CREATE_JOINABLE $attr_name
+_ACEOF
+
+        fi
+
+        { $as_echo "$as_me:${as_lineno-$LINENO}: checking if more special flags are required for pthreads" >&5
+$as_echo_n "checking if more special flags are required for pthreads... " >&6; }
+        flag=no
+        case "${host_cpu}-${host_os}" in
+            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${flag}" >&5
+$as_echo "${flag}" >&6; }
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with xlc_r or cc_r
+	if test x"$GCC" != xyes -a \( x"$CC" = xxlc -o x"$CC" = cc \) ; then
+          for ac_prog in xlc_r cc_r
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PTHREAD_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$PTHREAD_CC"; then
+  ac_cv_prog_PTHREAD_CC="$PTHREAD_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PTHREAD_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+PTHREAD_CC=$ac_cv_prog_PTHREAD_CC
+if test -n "$PTHREAD_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PTHREAD_CC" >&5
+$as_echo "$PTHREAD_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$PTHREAD_CC" && break
+done
+test -n "$PTHREAD_CC" || PTHREAD_CC="${CC}"
+
+        else
+          PTHREAD_CC=$CC
+	fi
+else
+        PTHREAD_CC="$CC"
+fi
+
+
+
+
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ax_pthread_ok" = xyes; then
+
+$as_echo "#define HAVE_LIBPTHREAD 1" >>confdefs.h
+
+        :
+else
+        ax_pthread_ok=no
+        as_fn_error $? "multithreaded settings NOT found" "$LINENO" 5
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+               LIBS="$PTHREAD_LIBS $LIBS"
+               CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+               CC="$PTHREAD_CC"
+               $as_echo "CC:$CC CFLAGS:$CFLAGS LIBS:$LIBS" ;; #(
+  *) :
+    THREADS_ROOT=$with_threads
+             LDFLAGS="-L$THREADS_ROOT/lib $LDFLAGS"
+             CPPFLAGS="-I$THREADS_ROOT/include $CPPFLAGS "
+             for ac_header in pthread.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "pthread.h" "ac_cv_header_pthread_h" "$ac_includes_default"
+if test "x$ac_cv_header_pthread_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PTHREAD_H 1
+_ACEOF
+
+fi
+
+done
+
+             { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pthread_create in -lpthread" >&5
+$as_echo_n "checking for pthread_create in -lpthread... " >&6; }
+if ${ac_cv_lib_pthread_pthread_create+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lpthread  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char pthread_create ();
+int
+main ()
+{
+return pthread_create ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_pthread_pthread_create=yes
+else
+  ac_cv_lib_pthread_pthread_create=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_pthread_pthread_create" >&5
+$as_echo "$ac_cv_lib_pthread_pthread_create" >&6; }
+if test "x$ac_cv_lib_pthread_pthread_create" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBPTHREAD 1
+_ACEOF
+
+  LIBS="-lpthread $LIBS"
+
+fi
+
+             THREADS_LIBS=" -L$THREADS_ROOT/lib -lpthread"
+             THREADS_INCLUDE=" -I$THREADS_ROOT/include" ;; #(
+  *) :
+     ;;
+esac
+
+
+#  ----------------------------------------------------------------------
+#  Link application to ZLIB library, needed for netcdf
+ZLIB_INCLUDE=''
+ZLIB_LIBS=''
+
+# Check whether --with-zlib was given.
+if test "${with_zlib+set}" = set; then :
+  withval=$with_zlib; case "$with_zlib" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ZLIB library" >&5
+$as_echo_n "checking for ZLIB library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in zlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing deflate" >&5
+$as_echo_n "checking for library containing deflate... " >&6; }
+if ${ac_cv_search_deflate+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char deflate ();
+int
+main ()
+{
+return deflate ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' z; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_deflate=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_deflate+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_deflate+:} false; then :
+
+else
+  ac_cv_search_deflate=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflate" >&5
+$as_echo "$ac_cv_search_deflate" >&6; }
+ac_res=$ac_cv_search_deflate
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+fi
+
+                            ZLIB_LIBS=" -lz" ;; #(
+  *) :
+    ZLIB_ROOT=$with_zlib
+                          LDFLAGS="-L$ZLIB_ROOT/lib $LDFLAGS"
+                          CPPFLAGS="-I$ZLIB_ROOT/include $CPPFLAGS"
+                          for ac_header in zlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+                          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing deflate" >&5
+$as_echo_n "checking for library containing deflate... " >&6; }
+if ${ac_cv_search_deflate+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char deflate ();
+int
+main ()
+{
+return deflate ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' z; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_deflate=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_deflate+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_deflate+:} false; then :
+
+else
+  ac_cv_search_deflate=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflate" >&5
+$as_echo "$ac_cv_search_deflate" >&6; }
+ac_res=$ac_cv_search_deflate
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+fi
+
+                          ZLIB_INCLUDE=" -I$ZLIB_ROOT/include"
+                          ZLIB_LIBS=" -L$ZLIB_ROOT/lib -lz" ;; #(
+  *) :
+     ;;
+esac
+else
+  for ac_header in zlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_ZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+                      { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing deflate" >&5
+$as_echo_n "checking for library containing deflate... " >&6; }
+if ${ac_cv_search_deflate+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char deflate ();
+int
+main ()
+{
+return deflate ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' z; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_deflate=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_deflate+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_deflate+:} false; then :
+
+else
+  ac_cv_search_deflate=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_deflate" >&5
+$as_echo "$ac_cv_search_deflate" >&6; }
+ac_res=$ac_cv_search_deflate
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBZ 1" >>confdefs.h
+
+fi
+
+              ZLIB_LIBS=" -lz"
+fi
+
+
+
+#  ----------------------------------------------------------------------
+#  Compile application with SZLIB library, needed for GRIB1 or for
+#  linking against hdf5/netcdf4
+SZLIB_INCLUDE=''
+SZLIB_LIBS=''
+
+# Check whether --with-szlib was given.
+if test "${with_szlib+set}" = set; then :
+  withval=$with_szlib; case "$with_szlib" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for szlib library" >&5
+$as_echo_n "checking for szlib library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in szlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "szlib.h" "ac_cv_header_szlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_szlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SZ_BufftoBuffCompress" >&5
+$as_echo_n "checking for library containing SZ_BufftoBuffCompress... " >&6; }
+if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SZ_BufftoBuffCompress ();
+int
+main ()
+{
+return SZ_BufftoBuffCompress ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' sz; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_SZ_BufftoBuffCompress=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+
+else
+  ac_cv_search_SZ_BufftoBuffCompress=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SZ_BufftoBuffCompress" >&5
+$as_echo "$ac_cv_search_SZ_BufftoBuffCompress" >&6; }
+ac_res=$ac_cv_search_SZ_BufftoBuffCompress
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBSZ 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to szlib" "$LINENO" 5
+fi
+
+                            SZLIB_LIBS=" -lsz" ;; #(
+  *) :
+    SZLIB_ROOT=$with_szlib
+                          if test -d "$SZLIB_ROOT"; then :
+  LDFLAGS="-L$SZLIB_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$SZLIB_ROOT/include $CPPFLAGS"
+                                 for ac_header in szlib.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "szlib.h" "ac_cv_header_szlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_szlib_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_SZLIB_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing SZ_BufftoBuffCompress" >&5
+$as_echo_n "checking for library containing SZ_BufftoBuffCompress... " >&6; }
+if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char SZ_BufftoBuffCompress ();
+int
+main ()
+{
+return SZ_BufftoBuffCompress ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' sz; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_SZ_BufftoBuffCompress=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_SZ_BufftoBuffCompress+:} false; then :
+
+else
+  ac_cv_search_SZ_BufftoBuffCompress=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_SZ_BufftoBuffCompress" >&5
+$as_echo "$ac_cv_search_SZ_BufftoBuffCompress" >&6; }
+ac_res=$ac_cv_search_SZ_BufftoBuffCompress
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBSZ 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to szlib" "$LINENO" 5
+fi
+
+                                 SZLIB_LIBS=" -L$SZLIB_ROOT/lib -lsz"
+                                 SZLIB_INCLUDE=" -I$SZLIB_ROOT/include"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: $SZLIB_ROOT is not a directory! SZLIB suppressed" >&5
+$as_echo "$as_me: $SZLIB_ROOT is not a directory! SZLIB suppressed" >&6;}
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for szlib library" >&5
+$as_echo_n "checking for szlib library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+
+#  ----------------------------------------------------------------------
+#  Link application with HDF5 library, required for netcdf4
+HDF5_ROOT=''
+HDF5_INCLUDE=''
+HDF5_LIBS=''
+
+# Check whether --with-hdf5 was given.
+if test "${with_hdf5+set}" = set; then :
+  withval=$with_hdf5; case "$with_hdf5" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hdf5 library" >&5
+$as_echo_n "checking for hdf5 library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in hdf5.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default"
+if test "x$ac_cv_header_hdf5_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_HDF5_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5Fopen" >&5
+$as_echo_n "checking for library containing H5Fopen... " >&6; }
+if ${ac_cv_search_H5Fopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char H5Fopen ();
+int
+main ()
+{
+return H5Fopen ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' hdf5; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_H5Fopen=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_H5Fopen+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_H5Fopen+:} false; then :
+
+else
+  ac_cv_search_H5Fopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5Fopen" >&5
+$as_echo "$ac_cv_search_H5Fopen" >&6; }
+ac_res=$ac_cv_search_H5Fopen
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBHDF5 1" >>confdefs.h
+
+else
+  as_fn_error $? "Cannot link to hdf5 library! It is required for Netcdf4" "$LINENO" 5
+fi
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5DSis_scale" >&5
+$as_echo_n "checking for library containing H5DSis_scale... " >&6; }
+if ${ac_cv_search_H5DSis_scale+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char H5DSis_scale ();
+int
+main ()
+{
+return H5DSis_scale ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' hdf5_hl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_H5DSis_scale=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_H5DSis_scale+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_H5DSis_scale+:} false; then :
+
+else
+  ac_cv_search_H5DSis_scale=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5DSis_scale" >&5
+$as_echo "$ac_cv_search_H5DSis_scale" >&6; }
+ac_res=$ac_cv_search_H5DSis_scale
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  have_hdf5_hl=yes
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot find hdf5 high level interface! It is required for netCDF4." >&5
+$as_echo "$as_me: Cannot find hdf5 high level interface! It is required for netCDF4." >&6;}
+                                            have_hdf5_hl=no
+fi
+
+                            if test "x$have_libhdf5_hl" = xyes; then :
+  HDF5_LIBS=" -lhdf5_hl -lhdf5"
+else
+  HDF5_LIBS=" -lhdf5"
+fi
+                             ;; #(
+  *) :
+    if test -d "$with_hdf5"; then :
+  HDF5_ROOT="$with_hdf5"
+                                 LDFLAGS="-L$HDF5_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$HDF5_ROOT/include $CPPFLAGS"
+                                 for ac_header in hdf5.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "hdf5.h" "ac_cv_header_hdf5_h" "$ac_includes_default"
+if test "x$ac_cv_header_hdf5_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_HDF5_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5Fopen" >&5
+$as_echo_n "checking for library containing H5Fopen... " >&6; }
+if ${ac_cv_search_H5Fopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char H5Fopen ();
+int
+main ()
+{
+return H5Fopen ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' hdf5; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_H5Fopen=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_H5Fopen+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_H5Fopen+:} false; then :
+
+else
+  ac_cv_search_H5Fopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5Fopen" >&5
+$as_echo "$ac_cv_search_H5Fopen" >&6; }
+ac_res=$ac_cv_search_H5Fopen
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBHDF5 1" >>confdefs.h
+
+else
+  as_fn_error $? "Cannot link to hdf5! It is required for netCDF4." "$LINENO" 5
+fi
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing H5DSis_scale" >&5
+$as_echo_n "checking for library containing H5DSis_scale... " >&6; }
+if ${ac_cv_search_H5DSis_scale+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char H5DSis_scale ();
+int
+main ()
+{
+return H5DSis_scale ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' hdf5_hl; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_H5DSis_scale=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_H5DSis_scale+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_H5DSis_scale+:} false; then :
+
+else
+  ac_cv_search_H5DSis_scale=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_H5DSis_scale" >&5
+$as_echo "$ac_cv_search_H5DSis_scale" >&6; }
+ac_res=$ac_cv_search_H5DSis_scale
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+  have_hdf5_hl=yes
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: Cannot link to hdf5 high level interface! It is required for netCDF4.\
+                                                                HDF5 must be built with zlib; the location of zlib must be specified for HDF5 with the \
+                                                                --with-zlib option. If HDF5 was also built with szlib, then the location of szlib must also be \
+                                                                specified with the --with-szlib option.." >&5
+$as_echo "$as_me: Cannot link to hdf5 high level interface! It is required for netCDF4.\
+                                                                HDF5 must be built with zlib; the location of zlib must be specified for HDF5 with the \
+                                                                --with-zlib option. If HDF5 was also built with szlib, then the location of szlib must also be \
+                                                                specified with the --with-szlib option.." >&6;}
+                                                have_hdf5_hl=no
+fi
+
+                                 if test "x$have_libhdf5_hl" = 'xyes'; then :
+  HDF5_LIBS=" -L$HDF5_ROOT/lib -lhdf5_hl -lhdf5"
+else
+  HDF5_LIBS=" -L$HDF5_ROOT/lib -lhdf5"
+fi
+                                 HDF5_INCLUDE=" -I$HDF5_ROOT/include"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: $with_hdf5 is not a directory! HDF5 suppressed" >&5
+$as_echo "$as_me: $with_hdf5 is not a directory! HDF5 suppressed" >&6;}
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for hdf5 library" >&5
+$as_echo_n "checking for hdf5 library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+
+
+#  ----------------------------------------------------------------------
+#  Compile application with netcdf
+NETCDF_ROOT=''
+NETCDF_INCLUDE=''
+NETCDF_LIBS=''
+
+# Check whether --with-netcdf was given.
+if test "${with_netcdf+set}" = set; then :
+  withval=$with_netcdf; case "$with_netcdf" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for netcdf library" >&5
+$as_echo_n "checking for netcdf library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in netcdf.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default"
+if test "x$ac_cv_header_netcdf_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_NETCDF_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nc_open" >&5
+$as_echo_n "checking for library containing nc_open... " >&6; }
+if ${ac_cv_search_nc_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nc_open ();
+int
+main ()
+{
+return nc_open ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' netcdf; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_nc_open=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_nc_open+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_nc_open+:} false; then :
+
+else
+  ac_cv_search_nc_open=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nc_open" >&5
+$as_echo "$ac_cv_search_nc_open" >&6; }
+ac_res=$ac_cv_search_nc_open
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBNETCDF 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to netcdf library" "$LINENO" 5
+fi
+
+                            NETCDF_LIBS=" -lnetcdf"
+                            # Extract the first word of "nc-config", so it can be a program name with args.
+set dummy nc-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NC_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NC_CONFIG"; then
+  ac_cv_prog_NC_CONFIG="$NC_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NC_CONFIG="nc-config"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NC_CONFIG=$ac_cv_prog_NC_CONFIG
+if test -n "$NC_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NC_CONFIG" >&5
+$as_echo "$NC_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+                            if test "x$NC_CONFIG" != "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's nc2 support" >&5
+$as_echo_n "checking netcdf's nc2 support... " >&6; }
+                                   if test "x$($NC_CONFIG --has-nc2)" = "xyes"; then :
+
+$as_echo "#define HAVE_NETCDF2 1" >>confdefs.h
+
+                                          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+                                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's nc4 support" >&5
+$as_echo_n "checking netcdf's nc4 support... " >&6; }
+                                   if test "x$($NC_CONFIG --has-nc4)" = "xyes"; then :
+
+$as_echo "#define HAVE_NETCDF4 1" >>confdefs.h
+
+                                    { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+else
+  $as_echo Could not find nc-config! go on with default configuration
+fi ;; #(
+  *) :
+    if test -d "$with_netcdf"; then :
+  NETCDF_ROOT=$with_netcdf
+                                 LDFLAGS="-L$NETCDF_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$NETCDF_ROOT/include $CPPFLAGS"
+                                 for ac_header in netcdf.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "netcdf.h" "ac_cv_header_netcdf_h" "$ac_includes_default"
+if test "x$ac_cv_header_netcdf_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_NETCDF_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing nc_open" >&5
+$as_echo_n "checking for library containing nc_open... " >&6; }
+if ${ac_cv_search_nc_open+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char nc_open ();
+int
+main ()
+{
+return nc_open ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' netcdf; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_nc_open=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_nc_open+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_nc_open+:} false; then :
+
+else
+  ac_cv_search_nc_open=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_nc_open" >&5
+$as_echo "$ac_cv_search_nc_open" >&6; }
+ac_res=$ac_cv_search_nc_open
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBNETCDF 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to netcdf library" "$LINENO" 5
+fi
+
+                                 NETCDF_LIBS=" -L$NETCDF_ROOT/lib -lnetcdf"
+                                 NETCDF_INCLUDE=" -I$NETCDF_ROOT/include"
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking nc-config script" >&5
+$as_echo_n "checking nc-config script... " >&6; }
+                                 # Extract the first word of "nc-config", so it can be a program name with args.
+set dummy nc-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_NC_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NC_CONFIG"; then
+  ac_cv_prog_NC_CONFIG="$NC_CONFIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in "$NETCDF_ROOT/bin"
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_NC_CONFIG="$NETCDF_ROOT/bin/nc-config"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+NC_CONFIG=$ac_cv_prog_NC_CONFIG
+if test -n "$NC_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NC_CONFIG" >&5
+$as_echo "$NC_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+                                 if test "x$NC_CONFIG" != "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's OpenDAP support" >&5
+$as_echo_n "checking netcdf's OpenDAP support... " >&6; }
+                                    if test "x$($NC_CONFIG --has-dap)" = "xyes"; then :
+
+$as_echo "#define HAVE_LIBNC_DAP 1" >>confdefs.h
+
+                                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+                                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's nc2 support" >&5
+$as_echo_n "checking netcdf's nc2 support... " >&6; }
+                                   if test "x$($NC_CONFIG --has-nc2)" = "xyes"; then :
+
+$as_echo "#define HAVE_NETCDF2 1" >>confdefs.h
+
+                                          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+                                   { $as_echo "$as_me:${as_lineno-$LINENO}: checking netcdf's nc4 support" >&5
+$as_echo_n "checking netcdf's nc4 support... " >&6; }
+                                   if test "x$($NC_CONFIG --has-nc4)" = "xyes"; then :
+
+$as_echo "#define HAVE_NETCDF4 1" >>confdefs.h
+
+                                          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: Could not find nc-config! go on with default configuration" >&5
+$as_echo "Could not find nc-config! go on with default configuration" >&6; }
+fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: $with_netcdf is not a directory! NETCDF suppressed" >&5
+$as_echo "$as_me: $with_netcdf is not a directory! NETCDF suppressed" >&6;}
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for NETCDF library" >&5
+$as_echo_n "checking for NETCDF library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+
+
+#  ----------------------------------------------------------------------
+#  Link application with JASPER library (needed for GRIB2 compression)
+JASPER_LIBS=''
+
+# Check whether --with-jasper was given.
+if test "${with_jasper+set}" = set; then :
+  withval=$with_jasper; case "$with_jasper" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for jasper library" >&5
+$as_echo_n "checking for jasper library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in jasper.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "jasper.h" "ac_cv_header_jasper_h" "$ac_includes_default"
+if test "x$ac_cv_header_jasper_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_JASPER_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing jas_init" >&5
+$as_echo_n "checking for library containing jas_init... " >&6; }
+if ${ac_cv_search_jas_init+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char jas_init ();
+int
+main ()
+{
+return jas_init ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' jasper; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_jas_init=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_jas_init+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_jas_init+:} false; then :
+
+else
+  ac_cv_search_jas_init=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_jas_init" >&5
+$as_echo "$ac_cv_search_jas_init" >&6; }
+ac_res=$ac_cv_search_jas_init
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBJASPER 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to jasper library! Required for GRIB_API" "$LINENO" 5
+fi
+
+                            JASPER_LIBS=" -ljasper"
+ ;; #(
+  *) :
+    JASPER_ROOT=$with_jasper
+                          if test -d "$JASPER_ROOT"; then :
+  LDFLAGS="$LDFLAGS -L$JASPER_ROOT/lib"
+                                 CPPFLAGS="$CPPFLAGS -I$JASPER_ROOT/include"
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing jas_stream_memopen" >&5
+$as_echo_n "checking for library containing jas_stream_memopen... " >&6; }
+if ${ac_cv_search_jas_stream_memopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char jas_stream_memopen ();
+int
+main ()
+{
+return jas_stream_memopen ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' jasper; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_jas_stream_memopen=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_jas_stream_memopen+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_jas_stream_memopen+:} false; then :
+
+else
+  ac_cv_search_jas_stream_memopen=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_jas_stream_memopen" >&5
+$as_echo "$ac_cv_search_jas_stream_memopen" >&6; }
+ac_res=$ac_cv_search_jas_stream_memopen
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBJASPER 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to jasper library! Required for GRIB_API" "$LINENO" 5
+fi
+
+                                 JASPER_LIBS=" -L$JASPER_ROOT/lib -ljasper"
+else
+  as_fn_error $? "$JASPER_ROOT is not a directory! JASPER suppressed" "$LINENO" 5
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the JASPER library" >&5
+$as_echo_n "checking for the JASPER library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+#  ----------------------------------------------------------------------
+#  Link application with openjpeg library (needed for GRIB2 compression)
+OPENJPEG_LIBS=''
+
+# Check whether --with-openjpeg was given.
+if test "${with_openjpeg+set}" = set; then :
+  withval=$with_openjpeg; case "$with_openjpeg" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for openjpeg library" >&5
+$as_echo_n "checking for openjpeg library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in openjpeg.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "openjpeg.h" "ac_cv_header_openjpeg_h" "$ac_includes_default"
+if test "x$ac_cv_header_openjpeg_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_OPENJPEG_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opj_image_create" >&5
+$as_echo_n "checking for library containing opj_image_create... " >&6; }
+if ${ac_cv_search_opj_image_create+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opj_image_create ();
+int
+main ()
+{
+return opj_image_create ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' openjpeg; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_opj_image_create=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_opj_image_create+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_opj_image_create+:} false; then :
+
+else
+  ac_cv_search_opj_image_create=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opj_image_create" >&5
+$as_echo "$ac_cv_search_opj_image_create" >&6; }
+ac_res=$ac_cv_search_opj_image_create
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBOPENJPEG 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to openjpeg library! Required for GRIB_API" "$LINENO" 5
+fi
+
+                            openjpeg_LIBS=" -lopenjpeg"
+ ;; #(
+  *) :
+    OPENJPEG_ROOT=$with_openjpeg
+                          if test -d "$OPENJPEG_ROOT"; then :
+  LDFLAGS="$LDFLAGS -L$OPENJPEG_ROOT/lib"
+                                 CPPFLAGS="$CPPFLAGS -I$OPENJPEG_ROOT/include"
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing opj_image_create" >&5
+$as_echo_n "checking for library containing opj_image_create... " >&6; }
+if ${ac_cv_search_opj_image_create+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char opj_image_create ();
+int
+main ()
+{
+return opj_image_create ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' openjpeg; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_opj_image_create=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_opj_image_create+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_opj_image_create+:} false; then :
+
+else
+  ac_cv_search_opj_image_create=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_opj_image_create" >&5
+$as_echo "$ac_cv_search_opj_image_create" >&6; }
+ac_res=$ac_cv_search_opj_image_create
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBOPENJPEG 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to openjpeg library! Required for GRIB_API" "$LINENO" 5
+fi
+
+                                 OPENJPEG_LIBS=" -L$OPENJPEG_ROOT/lib -lopenjpeg"
+else
+  as_fn_error $? "$OPENJPEG_ROOT is not a directory! openjpeg suppressed" "$LINENO" 5
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the openjpeg library" >&5
+$as_echo_n "checking for the openjpeg library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+#  ----------------------------------------------------------------------
+#  Link application with LIBPNG library (needed for GRIB2 compression)
+LIBPNG_LIBS=''
+
+# Check whether --with-libpng was given.
+if test "${with_libpng+set}" = set; then :
+  withval=$with_libpng; case "$with_libpng" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libpng library" >&5
+$as_echo_n "checking for libpng library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in png.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "png.h" "ac_cv_header_png_h" "$ac_includes_default"
+if test "x$ac_cv_header_png_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_PNG_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing png_warning" >&5
+$as_echo_n "checking for library containing png_warning... " >&6; }
+if ${ac_cv_search_png_warning+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char png_warning ();
+int
+main ()
+{
+return png_warning ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' png; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_png_warning=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_png_warning+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_png_warning+:} false; then :
+
+else
+  ac_cv_search_png_warning=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_png_warning" >&5
+$as_echo "$ac_cv_search_png_warning" >&6; }
+ac_res=$ac_cv_search_png_warning
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBLIBPNG 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to libpng library! Required for GRIB_API" "$LINENO" 5
+fi
+
+                            LIBPNG_LIBS=" -lpng"
+ ;; #(
+  *) :
+    LIBPNG_ROOT=$with_libpng
+                          if test -d "$LIBPNG_ROOT"; then :
+  LDFLAGS="$LDFLAGS -L$LIBPNG_ROOT/lib"
+                                 CPPFLAGS="$CPPFLAGS -I$LIBPNG_ROOT/include"
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing png_warning" >&5
+$as_echo_n "checking for library containing png_warning... " >&6; }
+if ${ac_cv_search_png_warning+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char png_warning ();
+int
+main ()
+{
+return png_warning ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' png; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_png_warning=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_png_warning+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_png_warning+:} false; then :
+
+else
+  ac_cv_search_png_warning=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_png_warning" >&5
+$as_echo "$ac_cv_search_png_warning" >&6; }
+ac_res=$ac_cv_search_png_warning
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBLIBPNG 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to libpng library! Required for GRIB_API" "$LINENO" 5
+fi
+
+                                 LIBPNG_LIBS=" -L$LIBPNG_ROOT/lib -lpng"
+else
+  as_fn_error $? "$LIBPNG_ROOT is not a directory! LIBPNG suppressed" "$LINENO" 5
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the LIBPNG library" >&5
+$as_echo_n "checking for the LIBPNG library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+#  ----------------------------------------------------------------------
+#  Compile application with GRIB_API library (for GRIB2 support)
+GRIB_API_INCLUDE=''
+GRIB_API_LIBS=''
+
+# Check whether --with-grib_api was given.
+if test "${with_grib_api+set}" = set; then :
+  withval=$with_grib_api; case "$with_grib_api" in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GRIB_API library" >&5
+$as_echo_n "checking for GRIB_API library... " >&6; }
+                           { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; } ;; #(
+  yes) :
+    for ac_header in grib_api.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "grib_api.h" "ac_cv_header_grib_api_h" "$ac_includes_default"
+if test "x$ac_cv_header_grib_api_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GRIB_API_H 1
+_ACEOF
+
+fi
+
+done
+
+                            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing grib_get_message" >&5
+$as_echo_n "checking for library containing grib_get_message... " >&6; }
+if ${ac_cv_search_grib_get_message+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char grib_get_message ();
+int
+main ()
+{
+return grib_get_message ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' grib_api; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_grib_get_message=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_grib_get_message+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_grib_get_message+:} false; then :
+
+else
+  ac_cv_search_grib_get_message=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_grib_get_message" >&5
+$as_echo "$ac_cv_search_grib_get_message" >&6; }
+ac_res=$ac_cv_search_grib_get_message
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBGRIB_API 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to grib_api library" "$LINENO" 5
+fi
+ ;; #(
+  *) :
+    GRIB_API_ROOT=$with_grib_api
+                          if test -d "$GRIB_API_ROOT"; then :
+  LDFLAGS="-L$GRIB_API_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$GRIB_API_ROOT/include $CPPFLAGS"
+                                 for ac_header in grib_api.h
+do :
+  ac_fn_c_check_header_mongrel "$LINENO" "grib_api.h" "ac_cv_header_grib_api_h" "$ac_includes_default"
+if test "x$ac_cv_header_grib_api_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_GRIB_API_H 1
+_ACEOF
+
+fi
+
+done
+
+                                 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing grib_get_message" >&5
+$as_echo_n "checking for library containing grib_get_message... " >&6; }
+if ${ac_cv_search_grib_get_message+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_func_search_save_LIBS=$LIBS
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char grib_get_message ();
+int
+main ()
+{
+return grib_get_message ();
+  ;
+  return 0;
+}
+_ACEOF
+for ac_lib in '' grib_api; do
+  if test -z "$ac_lib"; then
+    ac_res="none required"
+  else
+    ac_res=-l$ac_lib
+    LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
+  fi
+  if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_search_grib_get_message=$ac_res
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext
+  if ${ac_cv_search_grib_get_message+:} false; then :
+  break
+fi
+done
+if ${ac_cv_search_grib_get_message+:} false; then :
+
+else
+  ac_cv_search_grib_get_message=no
+fi
+rm conftest.$ac_ext
+LIBS=$ac_func_search_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_grib_get_message" >&5
+$as_echo "$ac_cv_search_grib_get_message" >&6; }
+ac_res=$ac_cv_search_grib_get_message
+if test "$ac_res" != no; then :
+  test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
+
+$as_echo "#define HAVE_LIBGRIB_API 1" >>confdefs.h
+
+else
+  as_fn_error $? "Could not link to grib_api library" "$LINENO" 5
+fi
+
+                                 GRIB_API_LIBS=" -L$GRIB_API_ROOT/lib -lgrib_api"
+                                 GRIB_API_INCLUDE=" -I$GRIB_API_ROOT/include"
+else
+  as_fn_error $? "$GRIB_API_ROOT is not a directory! GRIB_API suppressed" "$LINENO" 5
+fi ;; #(
+  *) :
+     ;;
+esac
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the GRIB_API library" >&5
+$as_echo_n "checking for the GRIB_API library... " >&6; }
+             { $as_echo "$as_me:${as_lineno-$LINENO}: result: suppressed" >&5
+$as_echo "suppressed" >&6; }
+fi
+
+
+
+#  ----------------------------------------------------------------------
+#  Enable GRIB support
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GRIB support" >&5
+$as_echo_n "checking for GRIB support... " >&6; }
+# Check whether --enable-grib was given.
+if test "${enable_grib+set}" = set; then :
+  enableval=$enable_grib; if test "x$enable_grib" != 'xno'; then :
+
+$as_echo "#define HAVE_LIBGRIB 1" >>confdefs.h
+
+                      enable_grib=yes
+fi
+else
+
+$as_echo "#define HAVE_LIBGRIB 1" >>confdefs.h
+
+               enable_grib=yes
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_grib" >&5
+$as_echo "$enable_grib" >&6; }
+ENABLE_GRIB=$enable_grib
+
+#  ----------------------------------------------------------------------
+#  Compile interface with internal CGRIBEX library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for CGRIBEX support" >&5
+$as_echo_n "checking for CGRIBEX support... " >&6; }
+# Check whether --enable-cgribex was given.
+if test "${enable_cgribex+set}" = set; then :
+  enableval=$enable_cgribex; if test "x$enable_cgribex" != 'xno'; then :
+
+$as_echo "#define HAVE_LIBCGRIBEX 1" >>confdefs.h
+
+                      enable_cgribex=yes
+fi
+else
+
+$as_echo "#define HAVE_LIBCGRIBEX 1" >>confdefs.h
+
+               enable_cgribex=yes
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_cgribex" >&5
+$as_echo "$enable_cgribex" >&6; }
+ENABLE_CGRIBEX=$enable_cgribex
+
+#  ----------------------------------------------------------------------
+#  Compile interface with internal SERVICE library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SERVICE support" >&5
+$as_echo_n "checking for SERVICE support... " >&6; }
+# Check whether --enable-service was given.
+if test "${enable_service+set}" = set; then :
+  enableval=$enable_service; if test "x$enable_service" != 'xno'; then :
+
+$as_echo "#define HAVE_LIBSERVICE 1" >>confdefs.h
+
+                      enable_service=yes
+fi
+else
+
+$as_echo "#define HAVE_LIBSERVICE 1" >>confdefs.h
+
+               enable_service=yes
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_service" >&5
+$as_echo "$enable_service" >&6; }
+ENABLE_SERVICE=$enable_service
+
+#  ----------------------------------------------------------------------
+#  Compile interface with internal EXTRA library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EXTRA support" >&5
+$as_echo_n "checking for EXTRA support... " >&6; }
+# Check whether --enable-extra was given.
+if test "${enable_extra+set}" = set; then :
+  enableval=$enable_extra; if test "x$enable_extra" != 'xno'; then :
+
+$as_echo "#define HAVE_LIBEXTRA 1" >>confdefs.h
+
+                      enable_extra=yes
+fi
+else
+
+$as_echo "#define HAVE_LIBEXTRA 1" >>confdefs.h
+
+               enable_extra=yes
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_extra" >&5
+$as_echo "$enable_extra" >&6; }
+ENABLE_EXTRA=$enable_extra
+
+#  ----------------------------------------------------------------------
+#  Compile interface with internal IEG library
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for IEG support" >&5
+$as_echo_n "checking for IEG support... " >&6; }
+# Check whether --enable-ieg was given.
+if test "${enable_ieg+set}" = set; then :
+  enableval=$enable_ieg; if test "x$enable_ieg" != 'xno'; then :
+
+$as_echo "#define HAVE_LIBIEG 1" >>confdefs.h
+
+                      enable_ieg=yes
+fi
+else
+
+$as_echo "#define HAVE_LIBIEG 1" >>confdefs.h
+
+               enable_ieg=yes
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_ieg" >&5
+$as_echo "$enable_ieg" >&6; }
+ENABLE_IEG=$enable_ieg
+
+#  ----------------------------------------------------------------------
+# At the moment, there are two possible CDI bindings
+# (default for CDO) linking directly to CDI convenience library with libtool
+# (default for CDI) build and link to a shared CDI library
+if test "x$CDO_DISABLE_CDILIB" = "x1"; then :
+  enable_cdi_lib=no
+else
+  enable_cdi_lib=yes
+fi
+# save CDI binding mode for later automake use
+ if test x$enable_cdi_lib = 'xyes'; then
+  ENABLE_CDI_LIB_TRUE=
+  ENABLE_CDI_LIB_FALSE='#'
+else
+  ENABLE_CDI_LIB_TRUE='#'
+  ENABLE_CDI_LIB_FALSE=
+fi
+
+# create shell variables for the representation of configure results
+if test x$enable_cdi_lib = 'xno'; then :
+  ENABLE_CDI_LIB=false
+
+else
+  ENABLE_CDI_LIB=true
+
+fi
+#  ----------------------------------------------------------------------
+#  Build a static CDI
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for building an additional static CDI binary" >&5
+$as_echo_n "checking for building an additional static CDI binary... " >&6; }
+# Check whether --enable-all-static was given.
+if test "${enable_all_static+set}" = set; then :
+  enableval=$enable_all_static; if test "x$enable_all_static" != "xno"; then :
+  enable_all_static=yes
+else
+  enable_all_static=no
+fi
+else
+  enable_all_static=no
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_all_static" >&5
+$as_echo "$enable_all_static" >&6; }
+ if test x$enable_all_static = 'xyes'; then
+  ENABLE_ALL_STATIC_TRUE=
+  ENABLE_ALL_STATIC_FALSE='#'
+else
+  ENABLE_ALL_STATIC_TRUE='#'
+  ENABLE_ALL_STATIC_FALSE=
+fi
+
+
+#  ----------------------------------------------------------------------
+# Compile with MPI support
+# Check whether --enable-mpi was given.
+if test "${enable_mpi+set}" = set; then :
+  enableval=$enable_mpi; enable_mpi=yes
+else
+  enable_mpi=no
+fi
+
+if test x"${enable_mpi}" = x"yes"; then :
+  USE_MPI=yes
+fi
+if test x"$USE_MPI" = xyes; then :
+
+$as_echo "#define USE_MPI 1" >>confdefs.h
+
+   for ac_prog in mpirun mpiexec
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MPI_LAUNCH+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$MPI_LAUNCH"; then
+  ac_cv_prog_MPI_LAUNCH="$MPI_LAUNCH" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_MPI_LAUNCH="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+MPI_LAUNCH=$ac_cv_prog_MPI_LAUNCH
+if test -n "$MPI_LAUNCH"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MPI_LAUNCH" >&5
+$as_echo "$MPI_LAUNCH" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$MPI_LAUNCH" && break
+done
+
+   if test x$MPI_LAUNCH = x; then :
+
+fi
+else
+  MPI_LAUNCH="`pwd`/util/serialrun"
+
+fi
+ if test x"$USE_MPI" = xyes; then
+  USE_MPI_TRUE=
+  USE_MPI_FALSE='#'
+else
+  USE_MPI_TRUE='#'
+  USE_MPI_FALSE=
+fi
+
+
+#  ----------------------------------------------------------------------
+#  Create the Fortran Interface via iso_c_binding module (Fortran 2003 Standard)
+# Check whether --enable-iso-c-interface was given.
+if test "${enable_iso_c_interface+set}" = set; then :
+  enableval=$enable_iso_c_interface; enable_isoc=${enableval}
+else
+  enable_isoc=no
+fi
+
+ if test $enable_isoc = 'yes'; then
+  CREATE_ISOC_TRUE=
+  CREATE_ISOC_FALSE='#'
+else
+  CREATE_ISOC_TRUE='#'
+  CREATE_ISOC_FALSE=
+fi
+
+# in case the Fortran interface uses the more modern F90-style interface,
+# the FCFLAGS for users of the library have to include a switch to use the
+# .mod file
+CDI_F90_INTERFACE_FCFLAGS=''
+if test "x${enable_isoc}" = "xyes"; then :
+  ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+
+
+      unset acx_sl_cv_fc_mod_path_flag_fc
+   { $as_echo "$as_me:${as_lineno-$LINENO}: checking for flag to alter module search path" >&5
+$as_echo_n "checking for flag to alter module search path... " >&6; }
+if ${acx_sl_cv_fc_mod_path_flag_fc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+       mkdir conftestdir
+      cd conftestdir
+      cat > conftest.$ac_ext <<_ACEOF
+      module cnftst
+       implicit none
+       integer :: i
+      end module cnftst
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+
+else
+  as_fn_error $? "Cannot compile fortran modules" "$LINENO" 5
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+      cd ..
+      for i in -I -M -module -p; do
+        FCFLAGS_save=$FCFLAGS
+        FCFLAGS="$FCFLAGS ${i}conftestdir"
+        cat > conftest.$ac_ext <<_ACEOF
+      program main
+       use cnftst
+       implicit none
+       i = 0
+
+      end
+
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+  acx_sl_cv_fc_mod_path_flag_fc=$i ; FCFLAGS=$FCFLAGS_save ; break
+else
+  :
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+        FCFLAGS=$FCFLAGS_save
+      done
+      FCFLAGS=$FCFLAGS_save
+      rm -rf conftestdir
+      if ${acx_sl_cv_fc_mod_path_flag_fc+:} false; then :
+          :
+else
+          as_fn_error $? "Cannot find flag to alter module search path" "$LINENO" 5
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_sl_cv_fc_mod_path_flag_fc" >&5
+$as_echo "$acx_sl_cv_fc_mod_path_flag_fc" >&6; }
+   FC_MOD_FLAG=$acx_sl_cv_fc_mod_path_flag_fc
+
+
+   ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+   CDI_F90_INTERFACE_FCFLAGS="${FC_MOD_FLAG}${includedir}"
+fi
+
+#  Check the module extension of the fortran compiler
+if test -n "$FC" && test "X$FC" != "Xno"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of module files" >&5
+$as_echo_n "checking for suffix of module files... " >&6; }
+
+   ac_fc_mod_uppercase=no
+   ac_ext=${ac_fc_srcext-f}
+ac_compile='$FC -c $FCFLAGS $ac_fcflags_srcext conftest.$ac_ext >&5'
+ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
+   cat > conftest.$ac_ext <<_ACEOF
+
+      module conftest
+       implicit none
+       integer :: i
+      end module conftest
+
+_ACEOF
+if ac_fn_fc_try_compile "$LINENO"; then :
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   while :; do
+     acx_fc_mod_name=
+        if test -n "conftest.$FCMODEXT" -a -f "conftest.$FCMODEXT"; then :
+          acx_fc_mod_name="conftest.$FCMODEXT" ; break
+fi
+          if test -n "conftest.mod" -a -f "conftest.mod"; then :
+          acx_fc_mod_name="conftest.mod" ; break
+fi
+          if test -n "conftest.MOD" -a -f "conftest.MOD"; then :
+          acx_fc_mod_name="conftest.MOD" ; break
+fi
+          if test -n "conftest.M" -a -f "conftest.M"; then :
+          acx_fc_mod_name="conftest.M" ; break
+fi
+          if test -n "CONFTEST.MOD" -a -f "CONFTEST.MOD"; then :
+          acx_fc_mod_name="CONFTEST.MOD" ; break
+fi
+
+     break
+   done
+   rm -f conftest*
+   ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+   case "$acx_fc_mod_name" in #(
+       conftest.$FCMODEXT) :
+    : ;; #(
+  CONFTEST.$FCMODEXT) :
+    ac_fc_mod_uppercase=yes ;; #(
+  conftest.mod) :
+    FCMODEXT=mod ;; #(
+  conftest.MOD) :
+    FCMODEXT=MOD ;; #(
+  conftest.M) :
+    FCMODEXT=M ;; #(
+  CONFTEST.MOD) :
+    FCMODEXT=MOD
+        ac_fc_mod_uppercase=yes ;; #(
+  *) :
+     ;;
+esac
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${FCMODEXT-not found}" >&5
+$as_echo "${FCMODEXT-not found}" >&6; }
+   ${FCMODEXT+:} false
+   if test $ac_fc_mod_uppercase = yes; then :
+  FCMODCASE=uc
+      { $as_echo "$as_me:${as_lineno-$LINENO}: Fortran module filenames are uppercase." >&5
+$as_echo "$as_me: Fortran module filenames are uppercase." >&6;}
+else
+  FCMODCASE=lc
+fi
+
+
+
+fi
+# -----------------------------------------------------------------------
+# Check for SWIG - Generator for script-language bindings
+# Check whether --enable-swig was given.
+if test "${enable_swig+set}" = set; then :
+  enableval=$enable_swig; # Extract the first word of "swig", so it can be a program name with args.
+set dummy swig; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_SWIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$SWIG"; then
+  ac_cv_prog_SWIG="$SWIG" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_SWIG="swig"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+SWIG=$ac_cv_prog_SWIG
+if test -n "$SWIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5
+$as_echo "$SWIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+else
+  enable_swig=no
+fi
+
+ if test "x$SWIG" != "x"; then
+  ENABLE_SWIG_TRUE=
+  ENABLE_SWIG_FALSE='#'
+else
+  ENABLE_SWIG_TRUE='#'
+  ENABLE_SWIG_FALSE=
+fi
+
+#  ----------------------------------------------------------------------
+#  Create the Ruby Interface via swig
+# Check whether --enable-ruby was given.
+if test "${enable_ruby+set}" = set; then :
+  enableval=$enable_ruby; # Extract the first word of "ruby", so it can be a program name with args.
+set dummy ruby; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RUBY+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RUBY"; then
+  ac_cv_prog_RUBY="$RUBY" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RUBY="ruby"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+RUBY=$ac_cv_prog_RUBY
+if test -n "$RUBY"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RUBY" >&5
+$as_echo "$RUBY" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+   RUBY_INCLUDES="$($RUBY $srcdir/config/interface.rb)"
+   save_CPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS $RUBY_INCLUDES"
+   ac_fn_c_check_header_mongrel "$LINENO" "ruby.h" "ac_cv_header_ruby_h" "$ac_includes_default"
+if test "x$ac_cv_header_ruby_h" = xyes; then :
+
+else
+  enable_ruby=no
+                              RUBY=
+
+fi
+
+
+   CPPFLAGS=$save_CPPFLAGS
+   if test "x$RUBY" != "x"; then :
+  if test "x$SWIG" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: Ruby bindings: Swig is disabled, pregenerated files will be used. Use '--enable-swig' for swig usage" >&5
+$as_echo "$as_me: Ruby bindings: Swig is disabled, pregenerated files will be used. Use '--enable-swig' for swig usage" >&6;}
+fi
+else
+  if test `$SWIG -help 2>&1 | $GREP -c '\-ruby *- Generate'` = 0; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: No (swig does not support -ruby option)" >&5
+$as_echo "$as_me: No (swig does not support -ruby option)" >&6;}
+                        enable_ruby=no
+
+fi
+fi
+else
+  enable_ruby=no
+fi
+
+ if test "x$enable_ruby" != "xno"; then
+  ENABLE_RUBY_TRUE=
+  ENABLE_RUBY_FALSE='#'
+else
+  ENABLE_RUBY_TRUE='#'
+  ENABLE_RUBY_FALSE=
+fi
+
+if test "x$enable_ruby" != "xno"; then :
+  ENABLE_RUBY=true
+
+else
+  ENABLE_RUBY=false
+
+fi
+#  ----------------------------------------------------------------------
+#  Create the Python Interface via swig
+# Check whether --enable-python was given.
+if test "${enable_python+set}" = set; then :
+  enableval=$enable_python; # Extract the first word of "python", so it can be a program name with args.
+set dummy python; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_PYTHON+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$PYTHON"; then
+  ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_PYTHON="python"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+PYTHON=$ac_cv_prog_PYTHON
+if test -n "$PYTHON"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5
+$as_echo "$PYTHON" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+   PYTHON_INCLUDES="-I$($PYTHON -c 'from distutils import sysconfig;print sysconfig.get_python_lib(1,1)' | $SED 's/lib/include/')"
+   save_CPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+   ac_fn_c_check_header_mongrel "$LINENO" "Python.h" "ac_cv_header_Python_h" "$ac_includes_default"
+if test "x$ac_cv_header_Python_h" = xyes; then :
+
+else
+  enable_python=no
+                                PYTHON=
+
+fi
+
+
+   CPPFLAGS=$save_CPPFLAGS
+   if test "x$PYTHON" != "x"; then :
+  if test "x$SWIG" = "x"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: Python bindings: Swig is disabled, pregenerated files will be used. Use '--enable-swig' for swig usage" >&5
+$as_echo "$as_me: Python bindings: Swig is disabled, pregenerated files will be used. Use '--enable-swig' for swig usage" >&6;}
+fi
+else
+  if test `$SWIG -help 2>&1 | $GREP -c '\-python *- Generate'` = 0; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: No (swig does not support -python option)" >&5
+$as_echo "$as_me: No (swig does not support -python option)" >&6;}
+                        enable_python=no
+
+fi
+fi
+else
+  enable_python=no
+fi
+
+ if test "x$enable_python" != "xno"; then
+  ENABLE_PYTHON_TRUE=
+  ENABLE_PYTHON_FALSE='#'
+else
+  ENABLE_PYTHON_TRUE='#'
+  ENABLE_PYTHON_FALSE=
+fi
+
+if test "x$enable_python" != "xno"; then :
+  ENABLE_PYTHON=true
+
+else
+  ENABLE_PYTHON=false
+
+fi
+#  ----------------------------------------------------------------------
+ if test  "x$enable_ruby" = "xyes" -o "x$enable_python" = "xyes"; then
+  CREATE_INTERFACES_TRUE=
+  CREATE_INTERFACES_FALSE='#'
+else
+  CREATE_INTERFACES_TRUE='#'
+  CREATE_INTERFACES_FALSE=
+fi
+
+#  ----------------------------------------------------------------------
+#  Check C / Fortran interface
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C / Fortran interface works" >&5
+$as_echo_n "checking whether the C / Fortran interface works... " >&6; }
+if ${acx_cv_check_cfint+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include "$srcdir/src/cfortran.h"
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  acx_cv_check_cfint=yes
+else
+  acx_cv_check_cfint=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+      ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $acx_cv_check_cfint" >&5
+$as_echo "$acx_cv_check_cfint" >&6; }
+   if test x$acx_cv_check_cfint = xyes; then :
+
+$as_echo "#define HAVE_CF_INTERFACE 1" >>confdefs.h
+
+fi
+
+ if test -n "$FC" && test "X$FC" != "Xno" && test x$acx_cv_check_cfint = "xyes"; then
+  USE_FC_TRUE=
+  USE_FC_FALSE='#'
+else
+  USE_FC_TRUE='#'
+  USE_FC_FALSE=
+fi
+
+
+
+
+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/pio_write_run tests/pio_cksum_mpinonb tests/pio_cksum_fpguard tests/pio_cksum_asynch tests/pio_cksum_writer util/serialrun"
+
+
+ac_config_files="$ac_config_files Makefile src/Makefile interfaces/Makefile app/Makefile tests/Makefile examples/Makefile examples/pio/Makefile cdi.settings src/pkgconfig/cdi.pc"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+	cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+	  mv -f confcache "$cache_file"$$ &&
+	  mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+	  mv -f confcache "$cache_file" ;;
+	esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+U=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+ if test -n "$EXEEXT"; then
+  am__EXEEXT_TRUE=
+  am__EXEEXT_FALSE='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCXX_TRUE}" && test -z "${am__fastdepCXX_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCXX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_CDI_LIB_TRUE}" && test -z "${ENABLE_CDI_LIB_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_CDI_LIB\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_ALL_STATIC_TRUE}" && test -z "${ENABLE_ALL_STATIC_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_ALL_STATIC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_MPI_TRUE}" && test -z "${USE_MPI_FALSE}"; then
+  as_fn_error $? "conditional \"USE_MPI\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${CREATE_ISOC_TRUE}" && test -z "${CREATE_ISOC_FALSE}"; then
+  as_fn_error $? "conditional \"CREATE_ISOC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_SWIG_TRUE}" && test -z "${ENABLE_SWIG_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_SWIG\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_RUBY_TRUE}" && test -z "${ENABLE_RUBY_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_RUBY\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${ENABLE_PYTHON_TRUE}" && test -z "${ENABLE_PYTHON_FALSE}"; then
+  as_fn_error $? "conditional \"ENABLE_PYTHON\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${CREATE_INTERFACES_TRUE}" && test -z "${CREATE_INTERFACES_FALSE}"; then
+  as_fn_error $? "conditional \"CREATE_INTERFACES\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${USE_FC_TRUE}" && test -z "${USE_FC_FALSE}"; then
+  as_fn_error $? "conditional \"USE_FC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+	expr "X$arg" : "X\\(.*\\)$as_nl";
+	arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='	';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... but there are two gotchas:
+    # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+    # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+    # In both cases, we have to default to `cp -p'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -p'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -p'
+  fi
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+	test -d "$1/.";
+      else
+	case $1 in #(
+	-*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #((
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by cdi $as_me 1.5.9, which was
+generated by GNU Autoconf 2.68.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to <http://code.zmaw.de/projects/cdi>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+cdi config.status 1.5.9
+configured by $0, generated by GNU Autoconf 2.68,
+  with options \\"\$ac_cs_config\\"
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+if \$ac_cs_recheck; then
+  set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
+ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
+host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
+host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
+hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs='`$ECHO "$compiler_lib_search_dirs" | $SED "$delay_single_quote_subst"`'
+predep_objects='`$ECHO "$predep_objects" | $SED "$delay_single_quote_subst"`'
+postdep_objects='`$ECHO "$postdep_objects" | $SED "$delay_single_quote_subst"`'
+predeps='`$ECHO "$predeps" | $SED "$delay_single_quote_subst"`'
+postdeps='`$ECHO "$postdeps" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path='`$ECHO "$compiler_lib_search_path" | $SED "$delay_single_quote_subst"`'
+LD_FC='`$ECHO "$LD_FC" | $SED "$delay_single_quote_subst"`'
+LD_F77='`$ECHO "$LD_F77" | $SED "$delay_single_quote_subst"`'
+LD_CXX='`$ECHO "$LD_CXX" | $SED "$delay_single_quote_subst"`'
+reload_flag_FC='`$ECHO "$reload_flag_FC" | $SED "$delay_single_quote_subst"`'
+reload_flag_F77='`$ECHO "$reload_flag_F77" | $SED "$delay_single_quote_subst"`'
+reload_flag_CXX='`$ECHO "$reload_flag_CXX" | $SED "$delay_single_quote_subst"`'
+reload_cmds_FC='`$ECHO "$reload_cmds_FC" | $SED "$delay_single_quote_subst"`'
+reload_cmds_F77='`$ECHO "$reload_cmds_F77" | $SED "$delay_single_quote_subst"`'
+reload_cmds_CXX='`$ECHO "$reload_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_FC='`$ECHO "$old_archive_cmds_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_F77='`$ECHO "$old_archive_cmds_F77" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds_CXX='`$ECHO "$old_archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_FC='`$ECHO "$compiler_FC" | $SED "$delay_single_quote_subst"`'
+compiler_F77='`$ECHO "$compiler_F77" | $SED "$delay_single_quote_subst"`'
+compiler_CXX='`$ECHO "$compiler_CXX" | $SED "$delay_single_quote_subst"`'
+GCC_FC='`$ECHO "$GCC_FC" | $SED "$delay_single_quote_subst"`'
+GCC_F77='`$ECHO "$GCC_F77" | $SED "$delay_single_quote_subst"`'
+GCC_CXX='`$ECHO "$GCC_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_FC='`$ECHO "$lt_prog_compiler_no_builtin_flag_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_F77='`$ECHO "$lt_prog_compiler_no_builtin_flag_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag_CXX='`$ECHO "$lt_prog_compiler_no_builtin_flag_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_FC='`$ECHO "$lt_prog_compiler_pic_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_F77='`$ECHO "$lt_prog_compiler_pic_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic_CXX='`$ECHO "$lt_prog_compiler_pic_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_FC='`$ECHO "$lt_prog_compiler_wl_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_F77='`$ECHO "$lt_prog_compiler_wl_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl_CXX='`$ECHO "$lt_prog_compiler_wl_CXX" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_FC='`$ECHO "$lt_prog_compiler_static_FC" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_F77='`$ECHO "$lt_prog_compiler_static_F77" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static_CXX='`$ECHO "$lt_prog_compiler_static_CXX" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_FC='`$ECHO "$lt_cv_prog_compiler_c_o_FC" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_F77='`$ECHO "$lt_cv_prog_compiler_c_o_F77" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o_CXX='`$ECHO "$lt_cv_prog_compiler_c_o_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_FC='`$ECHO "$archive_cmds_need_lc_FC" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_F77='`$ECHO "$archive_cmds_need_lc_F77" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc_CXX='`$ECHO "$archive_cmds_need_lc_CXX" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_FC='`$ECHO "$enable_shared_with_static_runtimes_FC" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_F77='`$ECHO "$enable_shared_with_static_runtimes_F77" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes_CXX='`$ECHO "$enable_shared_with_static_runtimes_CXX" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_FC='`$ECHO "$export_dynamic_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_F77='`$ECHO "$export_dynamic_flag_spec_F77" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec_CXX='`$ECHO "$export_dynamic_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_FC='`$ECHO "$whole_archive_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_F77='`$ECHO "$whole_archive_flag_spec_F77" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec_CXX='`$ECHO "$whole_archive_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_FC='`$ECHO "$compiler_needs_object_FC" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_F77='`$ECHO "$compiler_needs_object_F77" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object_CXX='`$ECHO "$compiler_needs_object_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_FC='`$ECHO "$old_archive_from_new_cmds_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_F77='`$ECHO "$old_archive_from_new_cmds_F77" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds_CXX='`$ECHO "$old_archive_from_new_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_FC='`$ECHO "$old_archive_from_expsyms_cmds_FC" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_F77='`$ECHO "$old_archive_from_expsyms_cmds_F77" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds_CXX='`$ECHO "$old_archive_from_expsyms_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_cmds_FC='`$ECHO "$archive_cmds_FC" | $SED "$delay_single_quote_subst"`'
+archive_cmds_F77='`$ECHO "$archive_cmds_F77" | $SED "$delay_single_quote_subst"`'
+archive_cmds_CXX='`$ECHO "$archive_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_FC='`$ECHO "$archive_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_F77='`$ECHO "$archive_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds_CXX='`$ECHO "$archive_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_cmds_FC='`$ECHO "$module_cmds_FC" | $SED "$delay_single_quote_subst"`'
+module_cmds_F77='`$ECHO "$module_cmds_F77" | $SED "$delay_single_quote_subst"`'
+module_cmds_CXX='`$ECHO "$module_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_FC='`$ECHO "$module_expsym_cmds_FC" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_F77='`$ECHO "$module_expsym_cmds_F77" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds_CXX='`$ECHO "$module_expsym_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_FC='`$ECHO "$with_gnu_ld_FC" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_F77='`$ECHO "$with_gnu_ld_F77" | $SED "$delay_single_quote_subst"`'
+with_gnu_ld_CXX='`$ECHO "$with_gnu_ld_CXX" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_FC='`$ECHO "$allow_undefined_flag_FC" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_F77='`$ECHO "$allow_undefined_flag_F77" | $SED "$delay_single_quote_subst"`'
+allow_undefined_flag_CXX='`$ECHO "$allow_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_FC='`$ECHO "$no_undefined_flag_FC" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_F77='`$ECHO "$no_undefined_flag_F77" | $SED "$delay_single_quote_subst"`'
+no_undefined_flag_CXX='`$ECHO "$no_undefined_flag_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_FC='`$ECHO "$hardcode_libdir_flag_spec_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_F77='`$ECHO "$hardcode_libdir_flag_spec_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_CXX='`$ECHO "$hardcode_libdir_flag_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_FC='`$ECHO "$hardcode_libdir_flag_spec_ld_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_F77='`$ECHO "$hardcode_libdir_flag_spec_ld_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_flag_spec_ld_CXX='`$ECHO "$hardcode_libdir_flag_spec_ld_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_FC='`$ECHO "$hardcode_libdir_separator_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_F77='`$ECHO "$hardcode_libdir_separator_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_libdir_separator_CXX='`$ECHO "$hardcode_libdir_separator_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_FC='`$ECHO "$hardcode_direct_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_F77='`$ECHO "$hardcode_direct_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_CXX='`$ECHO "$hardcode_direct_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_FC='`$ECHO "$hardcode_direct_absolute_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_F77='`$ECHO "$hardcode_direct_absolute_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_direct_absolute_CXX='`$ECHO "$hardcode_direct_absolute_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_FC='`$ECHO "$hardcode_minus_L_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_F77='`$ECHO "$hardcode_minus_L_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_minus_L_CXX='`$ECHO "$hardcode_minus_L_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_FC='`$ECHO "$hardcode_shlibpath_var_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_F77='`$ECHO "$hardcode_shlibpath_var_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var_CXX='`$ECHO "$hardcode_shlibpath_var_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_FC='`$ECHO "$hardcode_automatic_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_F77='`$ECHO "$hardcode_automatic_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic_CXX='`$ECHO "$hardcode_automatic_CXX" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_FC='`$ECHO "$inherit_rpath_FC" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_F77='`$ECHO "$inherit_rpath_F77" | $SED "$delay_single_quote_subst"`'
+inherit_rpath_CXX='`$ECHO "$inherit_rpath_CXX" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_FC='`$ECHO "$link_all_deplibs_FC" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_F77='`$ECHO "$link_all_deplibs_F77" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs_CXX='`$ECHO "$link_all_deplibs_CXX" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_FC='`$ECHO "$always_export_symbols_FC" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_F77='`$ECHO "$always_export_symbols_F77" | $SED "$delay_single_quote_subst"`'
+always_export_symbols_CXX='`$ECHO "$always_export_symbols_CXX" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_FC='`$ECHO "$export_symbols_cmds_FC" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_F77='`$ECHO "$export_symbols_cmds_F77" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds_CXX='`$ECHO "$export_symbols_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_FC='`$ECHO "$exclude_expsyms_FC" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_F77='`$ECHO "$exclude_expsyms_F77" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms_CXX='`$ECHO "$exclude_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+include_expsyms_FC='`$ECHO "$include_expsyms_FC" | $SED "$delay_single_quote_subst"`'
+include_expsyms_F77='`$ECHO "$include_expsyms_F77" | $SED "$delay_single_quote_subst"`'
+include_expsyms_CXX='`$ECHO "$include_expsyms_CXX" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_FC='`$ECHO "$prelink_cmds_FC" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_F77='`$ECHO "$prelink_cmds_F77" | $SED "$delay_single_quote_subst"`'
+prelink_cmds_CXX='`$ECHO "$prelink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_FC='`$ECHO "$postlink_cmds_FC" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_F77='`$ECHO "$postlink_cmds_F77" | $SED "$delay_single_quote_subst"`'
+postlink_cmds_CXX='`$ECHO "$postlink_cmds_CXX" | $SED "$delay_single_quote_subst"`'
+file_list_spec_FC='`$ECHO "$file_list_spec_FC" | $SED "$delay_single_quote_subst"`'
+file_list_spec_F77='`$ECHO "$file_list_spec_F77" | $SED "$delay_single_quote_subst"`'
+file_list_spec_CXX='`$ECHO "$file_list_spec_CXX" | $SED "$delay_single_quote_subst"`'
+hardcode_action_FC='`$ECHO "$hardcode_action_FC" | $SED "$delay_single_quote_subst"`'
+hardcode_action_F77='`$ECHO "$hardcode_action_F77" | $SED "$delay_single_quote_subst"`'
+hardcode_action_CXX='`$ECHO "$hardcode_action_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_FC='`$ECHO "$compiler_lib_search_dirs_FC" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_F77='`$ECHO "$compiler_lib_search_dirs_F77" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_dirs_CXX='`$ECHO "$compiler_lib_search_dirs_CXX" | $SED "$delay_single_quote_subst"`'
+predep_objects_FC='`$ECHO "$predep_objects_FC" | $SED "$delay_single_quote_subst"`'
+predep_objects_F77='`$ECHO "$predep_objects_F77" | $SED "$delay_single_quote_subst"`'
+predep_objects_CXX='`$ECHO "$predep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+postdep_objects_FC='`$ECHO "$postdep_objects_FC" | $SED "$delay_single_quote_subst"`'
+postdep_objects_F77='`$ECHO "$postdep_objects_F77" | $SED "$delay_single_quote_subst"`'
+postdep_objects_CXX='`$ECHO "$postdep_objects_CXX" | $SED "$delay_single_quote_subst"`'
+predeps_FC='`$ECHO "$predeps_FC" | $SED "$delay_single_quote_subst"`'
+predeps_F77='`$ECHO "$predeps_F77" | $SED "$delay_single_quote_subst"`'
+predeps_CXX='`$ECHO "$predeps_CXX" | $SED "$delay_single_quote_subst"`'
+postdeps_FC='`$ECHO "$postdeps_FC" | $SED "$delay_single_quote_subst"`'
+postdeps_F77='`$ECHO "$postdeps_F77" | $SED "$delay_single_quote_subst"`'
+postdeps_CXX='`$ECHO "$postdeps_CXX" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_FC='`$ECHO "$compiler_lib_search_path_FC" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_F77='`$ECHO "$compiler_lib_search_path_F77" | $SED "$delay_single_quote_subst"`'
+compiler_lib_search_path_CXX='`$ECHO "$compiler_lib_search_path_CXX" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_flag_spec_ld \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib \
+compiler_lib_search_dirs \
+predep_objects \
+postdep_objects \
+predeps \
+postdeps \
+compiler_lib_search_path \
+LD_FC \
+LD_F77 \
+LD_CXX \
+reload_flag_FC \
+reload_flag_F77 \
+reload_flag_CXX \
+compiler_FC \
+compiler_F77 \
+compiler_CXX \
+lt_prog_compiler_no_builtin_flag_FC \
+lt_prog_compiler_no_builtin_flag_F77 \
+lt_prog_compiler_no_builtin_flag_CXX \
+lt_prog_compiler_pic_FC \
+lt_prog_compiler_pic_F77 \
+lt_prog_compiler_pic_CXX \
+lt_prog_compiler_wl_FC \
+lt_prog_compiler_wl_F77 \
+lt_prog_compiler_wl_CXX \
+lt_prog_compiler_static_FC \
+lt_prog_compiler_static_F77 \
+lt_prog_compiler_static_CXX \
+lt_cv_prog_compiler_c_o_FC \
+lt_cv_prog_compiler_c_o_F77 \
+lt_cv_prog_compiler_c_o_CXX \
+export_dynamic_flag_spec_FC \
+export_dynamic_flag_spec_F77 \
+export_dynamic_flag_spec_CXX \
+whole_archive_flag_spec_FC \
+whole_archive_flag_spec_F77 \
+whole_archive_flag_spec_CXX \
+compiler_needs_object_FC \
+compiler_needs_object_F77 \
+compiler_needs_object_CXX \
+with_gnu_ld_FC \
+with_gnu_ld_F77 \
+with_gnu_ld_CXX \
+allow_undefined_flag_FC \
+allow_undefined_flag_F77 \
+allow_undefined_flag_CXX \
+no_undefined_flag_FC \
+no_undefined_flag_F77 \
+no_undefined_flag_CXX \
+hardcode_libdir_flag_spec_FC \
+hardcode_libdir_flag_spec_F77 \
+hardcode_libdir_flag_spec_CXX \
+hardcode_libdir_flag_spec_ld_FC \
+hardcode_libdir_flag_spec_ld_F77 \
+hardcode_libdir_flag_spec_ld_CXX \
+hardcode_libdir_separator_FC \
+hardcode_libdir_separator_F77 \
+hardcode_libdir_separator_CXX \
+exclude_expsyms_FC \
+exclude_expsyms_F77 \
+exclude_expsyms_CXX \
+include_expsyms_FC \
+include_expsyms_F77 \
+include_expsyms_CXX \
+file_list_spec_FC \
+file_list_spec_F77 \
+file_list_spec_CXX \
+compiler_lib_search_dirs_FC \
+compiler_lib_search_dirs_F77 \
+compiler_lib_search_dirs_CXX \
+predep_objects_FC \
+predep_objects_F77 \
+predep_objects_CXX \
+postdep_objects_FC \
+postdep_objects_F77 \
+postdep_objects_CXX \
+predeps_FC \
+predeps_F77 \
+predeps_CXX \
+postdeps_FC \
+postdeps_F77 \
+postdeps_CXX \
+compiler_lib_search_path_FC \
+compiler_lib_search_path_F77 \
+compiler_lib_search_path_CXX; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec \
+reload_cmds_FC \
+reload_cmds_F77 \
+reload_cmds_CXX \
+old_archive_cmds_FC \
+old_archive_cmds_F77 \
+old_archive_cmds_CXX \
+old_archive_from_new_cmds_FC \
+old_archive_from_new_cmds_F77 \
+old_archive_from_new_cmds_CXX \
+old_archive_from_expsyms_cmds_FC \
+old_archive_from_expsyms_cmds_F77 \
+old_archive_from_expsyms_cmds_CXX \
+archive_cmds_FC \
+archive_cmds_F77 \
+archive_cmds_CXX \
+archive_expsym_cmds_FC \
+archive_expsym_cmds_F77 \
+archive_expsym_cmds_CXX \
+module_cmds_FC \
+module_cmds_F77 \
+module_cmds_CXX \
+module_expsym_cmds_FC \
+module_expsym_cmds_F77 \
+module_expsym_cmds_CXX \
+export_symbols_cmds_FC \
+export_symbols_cmds_F77 \
+export_symbols_cmds_CXX \
+prelink_cmds_FC \
+prelink_cmds_F77 \
+prelink_cmds_CXX \
+postlink_cmds_FC \
+postlink_cmds_F77 \
+postlink_cmds_CXX; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
+
+
+
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "src/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+    "tests/test_cksum_grib") CONFIG_FILES="$CONFIG_FILES tests/test_cksum_grib" ;;
+    "tests/test_cksum_nc") CONFIG_FILES="$CONFIG_FILES tests/test_cksum_nc" ;;
+    "tests/test_cksum_nc2") CONFIG_FILES="$CONFIG_FILES tests/test_cksum_nc2" ;;
+    "tests/test_cksum_nc4") CONFIG_FILES="$CONFIG_FILES tests/test_cksum_nc4" ;;
+    "tests/test_cksum_extra") CONFIG_FILES="$CONFIG_FILES tests/test_cksum_extra" ;;
+    "tests/test_cksum_service") CONFIG_FILES="$CONFIG_FILES tests/test_cksum_service" ;;
+    "tests/test_cksum_ieg") CONFIG_FILES="$CONFIG_FILES tests/test_cksum_ieg" ;;
+    "tests/pio_write_run") CONFIG_FILES="$CONFIG_FILES tests/pio_write_run" ;;
+    "tests/pio_cksum_mpinonb") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_mpinonb" ;;
+    "tests/pio_cksum_fpguard") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_fpguard" ;;
+    "tests/pio_cksum_asynch") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_asynch" ;;
+    "tests/pio_cksum_writer") CONFIG_FILES="$CONFIG_FILES tests/pio_cksum_writer" ;;
+    "util/serialrun") CONFIG_FILES="$CONFIG_FILES util/serialrun" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
+    "interfaces/Makefile") CONFIG_FILES="$CONFIG_FILES interfaces/Makefile" ;;
+    "app/Makefile") CONFIG_FILES="$CONFIG_FILES app/Makefile" ;;
+    "tests/Makefile") CONFIG_FILES="$CONFIG_FILES tests/Makefile" ;;
+    "examples/Makefile") CONFIG_FILES="$CONFIG_FILES examples/Makefile" ;;
+    "examples/pio/Makefile") CONFIG_FILES="$CONFIG_FILES examples/pio/Makefile" ;;
+    "cdi.settings") CONFIG_FILES="$CONFIG_FILES cdi.settings" ;;
+    "src/pkgconfig/cdi.pc") CONFIG_FILES="$CONFIG_FILES src/pkgconfig/cdi.pc" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = ""
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=[	 ]*/{
+h
+s///
+s/^/:/
+s/[	 ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[	 ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[	 ]*#[	 ]*define[	 ][	 ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[	 ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = ""
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+	  $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+	`' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+	|| as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$_am_arg" : 'X\(//\)[^/]' \| \
+	 X"$_am_arg" : 'X\(//\)$' \| \
+	 X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Autoconf 2.62 quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named `Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$mf" : 'X\(//\)[^/]' \| \
+	 X"$mf" : 'X\(//\)$' \| \
+	 X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running `make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # When using ansi2knr, U may be empty or an underscore; expand it
+    U=`sed -n 's/^U = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+	 sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$file" : 'X\(//\)[^/]' \| \
+	 X"$file" : 'X\(//\)$' \| \
+	 X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+#                 Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags="FC F77 CXX "
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+SHELL=$lt_SHELL
+
+# An echo program that protects backslashes.
+ECHO=$lt_ECHO
+
+# The host system.
+host_alias=$host_alias
+host=$host
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects
+postdep_objects=$lt_postdep_objects
+predeps=$lt_predeps
+postdeps=$lt_postdeps
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+  if test x"$xsi_shell" = xyes; then
+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\    # positional parameters, so assign one to ordinary parameter first.\
+\    func_stripname_result=${3}\
+\    func_stripname_result=${func_stripname_result#"${1}"}\
+\    func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\    func_split_long_opt_name=${1%%=*}\
+\    func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\    func_split_short_opt_arg=${1#??}\
+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\    case ${1} in\
+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\      *)    func_lo2o_result=${1} ;;\
+\    esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+    func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+    func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+    func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+    eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\    func_quote_for_eval "${2}"\
+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: FC
+
+# The linker used to build libraries.
+LD=$lt_LD_FC
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_FC
+reload_cmds=$lt_reload_cmds_FC
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_FC
+
+# A language specific compiler.
+CC=$lt_compiler_FC
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_FC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_FC
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_FC
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_FC
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_FC
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_FC
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_FC
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_FC
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_FC
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_FC
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_FC
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_FC
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_FC
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_FC
+archive_expsym_cmds=$lt_archive_expsym_cmds_FC
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_FC
+module_expsym_cmds=$lt_module_expsym_cmds_FC
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_FC
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_FC
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_FC
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_FC
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_FC
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_FC
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_FC
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_FC
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_FC
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_FC
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_FC
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_FC
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_FC
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_FC
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_FC
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_FC
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_FC
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_FC
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_FC
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_FC
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_FC
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_FC
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_FC
+postdep_objects=$lt_postdep_objects_FC
+predeps=$lt_predeps_FC
+postdeps=$lt_postdeps_FC
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_FC
+
+# ### END LIBTOOL TAG CONFIG: FC
+_LT_EOF
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: F77
+
+# The linker used to build libraries.
+LD=$lt_LD_F77
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_F77
+reload_cmds=$lt_reload_cmds_F77
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_F77
+
+# A language specific compiler.
+CC=$lt_compiler_F77
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_F77
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_F77
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_F77
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_F77
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_F77
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_F77
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_F77
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_F77
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_F77
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_F77
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_F77
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_F77
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_F77
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_F77
+archive_expsym_cmds=$lt_archive_expsym_cmds_F77
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_F77
+module_expsym_cmds=$lt_module_expsym_cmds_F77
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_F77
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_F77
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_F77
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_F77
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_F77
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_F77
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_F77
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_F77
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_F77
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_F77
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_F77
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_F77
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_F77
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_F77
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_F77
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_F77
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_F77
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_F77
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_F77
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_F77
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_F77
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_F77
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_F77
+postdep_objects=$lt_postdep_objects_F77
+predeps=$lt_predeps_F77
+postdeps=$lt_postdeps_F77
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
+
+# ### END LIBTOOL TAG CONFIG: F77
+_LT_EOF
+
+
+    cat <<_LT_EOF >> "$ofile"
+
+# ### BEGIN LIBTOOL TAG CONFIG: CXX
+
+# The linker used to build libraries.
+LD=$lt_LD_CXX
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag_CXX
+reload_cmds=$lt_reload_cmds_CXX
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds_CXX
+
+# A language specific compiler.
+CC=$lt_compiler_CXX
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC_CXX
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag_CXX
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic_CXX
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl_CXX
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static_CXX
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o_CXX
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc_CXX
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes_CXX
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec_CXX
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec_CXX
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object_CXX
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds_CXX
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds_CXX
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds_CXX
+archive_expsym_cmds=$lt_archive_expsym_cmds_CXX
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds_CXX
+module_expsym_cmds=$lt_module_expsym_cmds_CXX
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld_CXX
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag_CXX
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag_CXX
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec_CXX
+
+# If ld is used when linking, flag to hardcode \$libdir into a binary
+# during linking.  This must work even if \$libdir does not exist.
+hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld_CXX
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct_CXX
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute_CXX
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L_CXX
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var_CXX
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic_CXX
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath_CXX
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs_CXX
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols_CXX
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds_CXX
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms_CXX
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms_CXX
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds_CXX
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds_CXX
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec_CXX
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action_CXX
+
+# The directories searched by this compiler when creating a shared library.
+compiler_lib_search_dirs=$lt_compiler_lib_search_dirs_CXX
+
+# Dependencies to place before and after the objects being linked to
+# create a shared library.
+predep_objects=$lt_predep_objects_CXX
+postdep_objects=$lt_postdep_objects_CXX
+predeps=$lt_predeps_CXX
+postdeps=$lt_postdeps_CXX
+
+# The library search path used internally by the compiler when linking
+# a shared library.
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
+
+# ### END LIBTOOL TAG CONFIG: CXX
+_LT_EOF
+
+ ;;
+    "tests/test_cksum_grib":F) chmod a+x "$ac_file" ;;
+    "tests/test_cksum_nc":F) chmod a+x "$ac_file" ;;
+    "tests/test_cksum_nc2":F) chmod a+x "$ac_file" ;;
+    "tests/test_cksum_nc4":F) chmod a+x "$ac_file" ;;
+    "tests/test_cksum_extra":F) chmod a+x "$ac_file" ;;
+    "tests/test_cksum_service":F) chmod a+x "$ac_file" ;;
+    "tests/test_cksum_ieg":F) chmod a+x "$ac_file" ;;
+    "tests/pio_write_run":F) chmod a+x "$ac_file" ;;
+    "tests/pio_cksum_mpinonb":F) chmod a+x "$ac_file" ;;
+    "tests/pio_cksum_fpguard":F) chmod a+x "$ac_file" ;;
+    "tests/pio_cksum_asynch":F) chmod a+x "$ac_file" ;;
+    "tests/pio_cksum_writer":F) chmod a+x "$ac_file" ;;
+    "util/serialrun":F) chmod a+x "$ac_file" ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
+
+#  ----------------------------------------------------------------------
+#  Show configuration
+{ $as_echo "$as_me:${as_lineno-$LINENO}: CDI is configured with the following options:" >&5
+$as_echo "$as_me: CDI is configured with the following options:" >&6;}
+./config.status cdi.settings
+cat cdi.settings
+
+if test "$ac_cv_prog_cc_c99" = "no"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}:
+
+  Warning: The C compiler does not accept ANSI C99 source code!
+" >&5
+$as_echo "$as_me:
+
+  Warning: The C compiler does not accept ANSI C99 source code!
+" >&6;}
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}:
+
+  Configuration completed.
+
+    You can now say 'make' to compile the CDI package and 'make install' to install it afterwards.
+" >&5
+$as_echo "$as_me:
+
+  Configuration completed.
+
+    You can now say 'make' to compile the CDI package and 'make install' to install it afterwards.
+" >&6;}
diff --git a/libcdi/configure.ac b/libcdi/configure.ac
new file mode 100644
index 0000000..3ce158d
--- /dev/null
+++ b/libcdi/configure.ac
@@ -0,0 +1,216 @@
+#  Process this file with autoconf to produce a configure script.
+
+AC_INIT([cdi], [1.5.9], [http://code.zmaw.de/projects/cdi])
+
+echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}"
+
+CONFIG_ABORT=yes
+AC_CONFIG_AUX_DIR([config])
+AC_CONFIG_MACRO_DIR([m4])
+AC_CANONICAL_HOST
+AC_CANONICAL_BUILD
+
+# Checks for username, hostname and system type
+USERNAME=$LOGNAME
+if test -z "$USERNAME" ; then USERNAME=$USER; fi;
+if test -z "$USERNAME" ; then USERNAME="unknown"; fi;
+AC_DEFINE_UNQUOTED([USER_NAME],["$USERNAME"], [User name])
+AC_SUBST([USER_NAME],["$USERNAME"])
+AS_IF([test -z "$HOST"],
+      [HOST=unknown
+       AS_IF([test -x /bin/hostname],[HOST=$(hostname)],
+             [AS_IF([test -x /bin/uname],
+                    [HOST=$(uname -n)])])])
+AC_DEFINE_UNQUOTED([HOST_NAME],["$HOST"],[Host name])
+AC_SUBST([HOST_NAME],["$HOST"])
+AC_DEFINE_UNQUOTED([SYSTEM_TYPE],["$ac_cv_build"], [System type])
+AC_SUBST([SYSTEM_TYPE],["$ac_cv_build"])
+
+AM_INIT_AUTOMAKE
+AM_CONFIG_HEADER([src/config.h])
+AM_MAINTAINER_MODE([disable])
+
+# Set up libtool.
+AC_MSG_NOTICE([setting up libtool])
+LT_INIT([pic-only])
+
+# Check building environment
+AC_CHECK_TOOL([CC],[gcc],[:])
+AC_PROG_CC_C99
+AC_PROG_FC
+AS_IF([test -n "$FC" && test "X$FC" != "Xno"],
+  [AC_FC_SRCEXT([f90])
+   AC_LANG_PUSH([Fortran])
+   AC_PROG_FPP
+   AC_LANG_POP([Fortran])])
+AC_PROG_F77
+AC_PROG_RANLIB
+AC_PROG_CXX
+AC_CHECK_PROG(SED,sed,sed,false)
+AC_CHECK_PROG(GREP,grep,grep,false)
+AC_PROG_INSTALL
+AC_CHECK_TOOL([AR],[ar],[:])
+AC_CHECK_TOOL([CPP],[cpp],[:])
+AC_CHECK_TOOL([LD],[ld],[:])
+AC_CHECK_TOOL([NM],[nm],[:])
+AC_CHECK_TOOL([AS],[as],[:])
+AC_CHECK_TOOL([DLLTOOL],[dlltool],[:])
+AC_CHECK_TOOL([OBJDUMP],[objdump],[:])
+AC_CHECK_TOOL([STRIP],[strip],[:])
+AC_CHECK_TOOL([RANLIB],[ranlib],[:])
+#  ----------------------------------------------------------------------
+# Check large file support on 32 bit systems
+AC_SYS_LARGEFILE
+#  ----------------------------------------------------------------------
+# Checks for library functions.
+AC_FUNC_MMAP
+#  ----------------------------------------------------------------------
+# Checks for library malloc.
+AC_CHECK_LIB(malloc, malloc)
+#  ----------------------------------------------------------------------
+# Checks for structures.
+AC_CHECK_MEMBERS([struct stat.st_blksize])
+#  ----------------------------------------------------------------------
+# Checks for header files
+AC_CHECK_HEADERS(malloc.h)
+#  ----------------------------------------------------------------------
+# Checks for the availability of functions
+AC_CHECK_FUNCS(mallinfo)
+#  ----------------------------------------------------------------------
+# Checks for the availability of ANSI-C99 functions
+AC_CHECK_DECLS([isnan],,,[AC_INCLUDES_DEFAULT
+@%:@include <math.h>])
+#  ----------------------------------------------------------------------
+#  Check for math library
+AC_CHECK_LIB(m, floor)
+#  ----------------------------------------------------------------------
+# Add basic configure options
+ACX_OPTIONS
+#  ----------------------------------------------------------------------
+# Compile with MPI support
+AC_ARG_ENABLE(mpi,AS_HELP_STRING([--enable-mpi],[Compile with MPI compiler [default=no]]),enable_mpi=yes,enable_mpi=no)
+AS_IF([test x"${enable_mpi}" = x"yes"],
+      [USE_MPI=yes])
+AS_IF([test x"$USE_MPI" = xyes],
+  [AC_DEFINE([USE_MPI],[1],[parallel I/O requested and available])
+   AC_CHECK_PROGS([MPI_LAUNCH],[mpirun mpiexec],[])
+   AS_IF([test x$MPI_LAUNCH = x],[])],
+  [MPI_LAUNCH="`pwd`/util/serialrun"
+   AC_SUBST([MPI_LAUNCH])])
+AM_CONDITIONAL([USE_MPI],[test x"$USE_MPI" = xyes])
+AC_SUBST([USE_MPI])
+#  ----------------------------------------------------------------------
+#  Create the Fortran Interface via iso_c_binding module (Fortran 2003 Standard)
+AC_ARG_ENABLE(iso-c-interface,
+              AS_HELP_STRING([--enable-iso-c-interface],
+                             [Create Fortran Interface via iso_c_bindings facility of F2003 [default=no]]).
+              ,enable_isoc=${enableval},enable_isoc=no)
+AM_CONDITIONAL([CREATE_ISOC],[test $enable_isoc = 'yes'])
+# in case the Fortran interface uses the more modern F90-style interface,
+# the FCFLAGS for users of the library have to include a switch to use the
+# .mod file
+CDI_F90_INTERFACE_FCFLAGS=''
+AS_IF([test "x${enable_isoc}" = "xyes"],
+  [AC_LANG_PUSH([Fortran])
+   ACX_SL_FC_CHECK_MOD_PATH_FLAG
+   AC_LANG_POP([Fortran])
+   CDI_F90_INTERFACE_FCFLAGS="${FC_MOD_FLAG}${includedir}"])
+AC_SUBST([CDI_F90_INTERFACE_FCFLAGS])
+#  Check the module extension of the fortran compiler
+AS_IF([test -n "$FC" && test "X$FC" != "Xno"],
+  [ACX_SL_FC_MOD_SUFFIX(,[FCMODEXT=mod])])
+# -----------------------------------------------------------------------
+# Check for SWIG - Generator for script-language bindings
+AC_ARG_ENABLE(swig,
+              [AS_HELP_STRING([--enable-swig],[use swig to create extra bindings [default=no] (EXPERIMENTAL)])],
+              [AC_CHECK_PROG(SWIG,swig,swig)],
+              [enable_swig=no])
+AM_CONDITIONAL(ENABLE_SWIG,[test "x$SWIG" != "x"])
+#  ----------------------------------------------------------------------
+#  Create the Ruby Interface via swig
+AC_ARG_ENABLE(ruby,
+  [AS_HELP_STRING([--enable-ruby],[ruby language bindings [default=no] (EXPERIMENTAL)])],
+  [AC_CHECK_PROG(RUBY,ruby,ruby)
+   RUBY_INCLUDES="$($RUBY $srcdir/config/interface.rb)"
+   save_CPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS $RUBY_INCLUDES"
+   AC_CHECK_HEADER([ruby.h],,[enable_ruby=no
+                              RUBY=
+                             ])
+   CPPFLAGS=$save_CPPFLAGS
+   AS_IF([test "x$RUBY" != "x"],
+         [AS_IF([test "x$SWIG" = "x"],
+                [AC_MSG_NOTICE([Ruby bindings: Swig is disabled, pregenerated files will be used. Use '--enable-swig' for swig usage])])],
+                [AS_IF([test `$SWIG -help 2>&1 | $GREP -c '\-ruby *- Generate'` = 0],
+                       [AC_MSG_NOTICE([No (swig does not support -ruby option)])
+                        enable_ruby=no
+                       ])])],
+  [enable_ruby=no])
+AM_CONDITIONAL(ENABLE_RUBY,[test "x$enable_ruby" != "xno"])
+AS_IF([test "x$enable_ruby" != "xno"],[AC_SUBST([ENABLE_RUBY],[true])],[AC_SUBST([ENABLE_RUBY],[false])])
+#  ----------------------------------------------------------------------
+#  Create the Python Interface via swig
+AC_ARG_ENABLE(python,
+  [AS_HELP_STRING([--enable-python],[python language bindings [default=no] (EXPERIMENTAL)])],
+  [AC_CHECK_PROG(PYTHON,python,python)
+   PYTHON_INCLUDES="-I$($PYTHON -c 'from distutils import sysconfig;print sysconfig.get_python_lib(1,1)' | $SED 's/lib/include/')"
+   save_CPPFLAGS=$CPPFLAGS
+   CPPFLAGS="$CPPFLAGS $PYTHON_INCLUDES"
+   AC_CHECK_HEADER([Python.h],,[enable_python=no
+                                PYTHON=
+                               ])
+   CPPFLAGS=$save_CPPFLAGS
+   AS_IF([test "x$PYTHON" != "x"],
+         [AS_IF([test "x$SWIG" = "x"],
+                [AC_MSG_NOTICE([Python bindings: Swig is disabled, pregenerated files will be used. Use '--enable-swig' for swig usage])])],
+                [AS_IF([test `$SWIG -help 2>&1 | $GREP -c '\-python *- Generate'` = 0],
+                       [AC_MSG_NOTICE([No (swig does not support -python option)])
+                        enable_python=no
+                       ])])],
+  [enable_python=no])
+AM_CONDITIONAL(ENABLE_PYTHON, [test "x$enable_python" != "xno"])
+AS_IF([test "x$enable_python" != "xno"],[AC_SUBST([ENABLE_PYTHON],[true])],[AC_SUBST([ENABLE_PYTHON],[false])])
+#  ----------------------------------------------------------------------
+AM_CONDITIONAL(CREATE_INTERFACES, [test  "x$enable_ruby" = "xyes" -o "x$enable_python" = "xyes"])
+#  ----------------------------------------------------------------------
+#  Check C / Fortran interface
+ACX_CHECK_CFINT([$srcdir/src/cfortran.h])
+AM_CONDITIONAL([USE_FC],[test -n "$FC" && test "X$FC" != "Xno" && test x$acx_cv_check_cfint = "xyes"])
+
+AC_SUBST([CPPFLAGS])
+
+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/pio_write_run \
+                 tests/pio_cksum_mpinonb \
+                 tests/pio_cksum_fpguard \
+                 tests/pio_cksum_asynch \
+                 tests/pio_cksum_writer \
+                 util/serialrun],[chmod a+x "$ac_file"])
+
+AC_OUTPUT([Makefile src/Makefile interfaces/Makefile app/Makefile \
+	tests/Makefile examples/Makefile examples/pio/Makefile cdi.settings \
+        src/pkgconfig/cdi.pc])
+
+#  ----------------------------------------------------------------------
+#  Show configuration
+AC_MSG_NOTICE([CDI is configured with the following options:])
+./config.status cdi.settings
+cat cdi.settings
+
+AS_IF([test "$ac_cv_prog_cc_c99" = "no"],
+      [AC_MSG_NOTICE([
+
+  Warning: The C compiler does not accept ANSI C99 source code!
+])])
+AC_MSG_NOTICE([
+
+  Configuration completed.
+
+    You can now say 'make' to compile the CDI package and 'make install' to install it afterwards.
+])
diff --git a/libcdi/doc/cdi_cman.pdf b/libcdi/doc/cdi_cman.pdf
new file mode 100644
index 0000000..7cca936
Binary files /dev/null and b/libcdi/doc/cdi_cman.pdf differ
diff --git a/libcdi/doc/cdi_fman.pdf b/libcdi/doc/cdi_fman.pdf
new file mode 100644
index 0000000..35ba4e6
Binary files /dev/null and b/libcdi/doc/cdi_fman.pdf differ
diff --git a/libcdi/examples/Makefile.am b/libcdi/examples/Makefile.am
new file mode 100644
index 0000000..850875f
--- /dev/null
+++ b/libcdi/examples/Makefile.am
@@ -0,0 +1,37 @@
+## Process this file with automake to produce Makefile.in
+#
+EXTRA_DIST = cdi_read_f2003.f90 cdi_write_f2003.f90
+#
+noinst_PROGRAMS = cdi_write cdi_write_ens cdi_read cdi_copy
+if CREATE_ISOC
+  noinst_PROGRAMS += cdi_read_f2003 cdi_write_f2003
+endif
+#
+AM_CPPFLAGS             = -I$(top_srcdir)/src
+AM_FCFLAGS              = $(FPP_INCOPT)$(top_srcdir)/src $(FC_MOD_FLAG)../src
+#
+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_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
+#
+if ENABLE_ALL_STATIC
+cdi_write_LDFLAGS       = -all-static
+cdi_read_LDFLAGS        = -all-static
+cdi_copy_LDFLAGS        = -all-static
+endif
+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_LDFLAGS  = -all-static
+
+cdi_write_f2003_SOURCES = cdi_write_f2003.f90
+cdi_write_f2003_LDADD   = $(top_builddir)/src/libcdi.la $(top_builddir)/src/mo_cdi.o
+cdi_write_f2003_LDFLAGS = -all-static
+
diff --git a/libcdi/examples/Makefile.in b/libcdi/examples/Makefile.in
new file mode 100644
index 0000000..af319b6
--- /dev/null
+++ b/libcdi/examples/Makefile.in
@@ -0,0 +1,666 @@
+# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = cdi_write$(EXEEXT) cdi_write_ens$(EXEEXT) \
+	cdi_read$(EXEEXT) cdi_copy$(EXEEXT) $(am__EXEEXT_1)
+ at CREATE_ISOC_TRUE@am__append_1 = cdi_read_f2003 cdi_write_f2003
+subdir = examples
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+	$(top_srcdir)/m4/acx_assert_lang_is_fortran_variant.m4 \
+	$(top_srcdir)/m4/acx_lang_other_suffix_conftest.m4 \
+	$(top_srcdir)/m4/acx_options.m4 \
+	$(top_srcdir)/m4/acx_sl_fc_mod_path_flag.m4 \
+	$(top_srcdir)/m4/acx_sl_mod_suffix.m4 \
+	$(top_srcdir)/m4/asx_unset.m4 $(top_srcdir)/m4/ax_pthread.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/starlink_fpp.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+ at CREATE_ISOC_TRUE@am__EXEEXT_1 = cdi_read_f2003$(EXEEXT) \
+ at CREATE_ISOC_TRUE@	cdi_write_f2003$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
+am_cdi_copy_OBJECTS = cdi_copy.$(OBJEXT)
+cdi_copy_OBJECTS = $(am_cdi_copy_OBJECTS)
+cdi_copy_DEPENDENCIES = $(top_builddir)/src/libcdi.la
+cdi_copy_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(cdi_copy_LDFLAGS) \
+	$(LDFLAGS) -o $@
+am_cdi_read_OBJECTS = cdi_read.$(OBJEXT)
+cdi_read_OBJECTS = $(am_cdi_read_OBJECTS)
+cdi_read_DEPENDENCIES = $(top_builddir)/src/libcdi.la
+cdi_read_LINK = $(LIBTOOL) --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_LINK = $(LIBTOOL) --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_DEPENDENCIES = $(top_builddir)/src/libcdi.la
+cdi_write_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+	$(cdi_write_LDFLAGS) $(LDFLAGS) -o $@
+am_cdi_write_ens_OBJECTS = cdi_write_ens.$(OBJEXT)
+cdi_write_ens_OBJECTS = $(am_cdi_write_ens_OBJECTS)
+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.o
+cdi_write_f2003_LINK = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) \
+	$(cdi_write_f2003_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+FCCOMPILE = $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+LTFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(FC) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(cdi_copy_SOURCES) $(cdi_read_SOURCES) \
+	$(cdi_read_f2003_SOURCES) $(cdi_write_SOURCES) \
+	$(cdi_write_ens_SOURCES) $(cdi_write_f2003_SOURCES)
+DIST_SOURCES = $(cdi_copy_SOURCES) $(cdi_read_SOURCES) \
+	$(cdi_read_f2003_SOURCES) $(cdi_write_SOURCES) \
+	$(cdi_write_ens_SOURCES) $(cdi_write_f2003_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDI_F90_INTERFACE_FCFLAGS = @CDI_F90_INTERFACE_FCFLAGS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
+ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
+ENABLE_EXTRA = @ENABLE_EXTRA@
+ENABLE_GRIB = @ENABLE_GRIB@
+ENABLE_IEG = @ENABLE_IEG@
+ENABLE_PYTHON = @ENABLE_PYTHON@
+ENABLE_RUBY = @ENABLE_RUBY@
+ENABLE_SERVICE = @ENABLE_SERVICE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_f90 = @FCFLAGS_f90@
+FCMODCASE = @FCMODCASE@
+FCMODEXT = @FCMODEXT@
+FC_MOD_FLAG = @FC_MOD_FLAG@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FPP = @FPP@
+FPPFLAGS = @FPPFLAGS@
+FPP_DEFOPT = @FPP_DEFOPT@
+FPP_INCOPT = @FPP_INCOPT@
+GREP = @GREP@
+GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
+GRIB_API_LIBS = @GRIB_API_LIBS@
+HDF5_INCLUDE = @HDF5_INCLUDE@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_ROOT = @HDF5_ROOT@
+HOST_NAME = @HOST_NAME@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JASPER_LIBS = @JASPER_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MPI_LAUNCH = @MPI_LAUNCH@
+NC_CONFIG = @NC_CONFIG@
+NETCDF_INCLUDE = @NETCDF_INCLUDE@
+NETCDF_LIBS = @NETCDF_LIBS@
+NETCDF_ROOT = @NETCDF_ROOT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENJPEG_LIBS = @OPENJPEG_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+RUBY = @RUBY@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SYSTEM_TYPE = @SYSTEM_TYPE@
+SZLIB_INCLUDE = @SZLIB_INCLUDE@
+SZLIB_LIBS = @SZLIB_LIBS@
+THREADS_INCLUDE = @THREADS_INCLUDE@
+THREADS_LIBS = @THREADS_LIBS@
+USER_NAME = @USER_NAME@
+USE_MPI = @USE_MPI@
+VERSION = @VERSION@
+ZLIB_INCLUDE = @ZLIB_INCLUDE@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+openjpeg_LIBS = @openjpeg_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+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
+#
+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_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
+#
+ at ENABLE_ALL_STATIC_TRUE@cdi_write_LDFLAGS = -all-static
+ at ENABLE_ALL_STATIC_TRUE@cdi_read_LDFLAGS = -all-static
+ at ENABLE_ALL_STATIC_TRUE@cdi_copy_LDFLAGS = -all-static
+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_LDFLAGS = -all-static
+cdi_write_f2003_SOURCES = cdi_write_f2003.f90
+cdi_write_f2003_LDADD = $(top_builddir)/src/libcdi.la $(top_builddir)/src/mo_cdi.o
+cdi_write_f2003_LDFLAGS = -all-static
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .f90 .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu examples/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+cdi_copy$(EXEEXT): $(cdi_copy_OBJECTS) $(cdi_copy_DEPENDENCIES) $(EXTRA_cdi_copy_DEPENDENCIES) 
+	@rm -f cdi_copy$(EXEEXT)
+	$(cdi_copy_LINK) $(cdi_copy_OBJECTS) $(cdi_copy_LDADD) $(LIBS)
+cdi_read$(EXEEXT): $(cdi_read_OBJECTS) $(cdi_read_DEPENDENCIES) $(EXTRA_cdi_read_DEPENDENCIES) 
+	@rm -f cdi_read$(EXEEXT)
+	$(cdi_read_LINK) $(cdi_read_OBJECTS) $(cdi_read_LDADD) $(LIBS)
+cdi_read_f2003$(EXEEXT): $(cdi_read_f2003_OBJECTS) $(cdi_read_f2003_DEPENDENCIES) $(EXTRA_cdi_read_f2003_DEPENDENCIES) 
+	@rm -f cdi_read_f2003$(EXEEXT)
+	$(cdi_read_f2003_LINK) $(cdi_read_f2003_OBJECTS) $(cdi_read_f2003_LDADD) $(LIBS)
+cdi_write$(EXEEXT): $(cdi_write_OBJECTS) $(cdi_write_DEPENDENCIES) $(EXTRA_cdi_write_DEPENDENCIES) 
+	@rm -f cdi_write$(EXEEXT)
+	$(cdi_write_LINK) $(cdi_write_OBJECTS) $(cdi_write_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)
+	$(LINK) $(cdi_write_ens_OBJECTS) $(cdi_write_ens_LDADD) $(LIBS)
+cdi_write_f2003$(EXEEXT): $(cdi_write_f2003_OBJECTS) $(cdi_write_f2003_DEPENDENCIES) $(EXTRA_cdi_write_f2003_DEPENDENCIES) 
+	@rm -f cdi_write_f2003$(EXEEXT)
+	$(cdi_write_f2003_LINK) $(cdi_write_f2003_OBJECTS) $(cdi_write_f2003_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdi_copy.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdi_read.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdi_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdi_write_ens.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+.f90.o:
+	$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) $<
+
+.f90.obj:
+	$(FCCOMPILE) -c -o $@ $(FCFLAGS_f90) `$(CYGPATH_W) '$<'`
+
+.f90.lo:
+	$(LTFCCOMPILE) -c -o $@ $(FCFLAGS_f90) $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libcdi/examples/cdi_copy.c b/libcdi/examples/cdi_copy.c
new file mode 100644
index 0000000..0e4b3b5
--- /dev/null
+++ b/libcdi/examples/cdi_copy.c
@@ -0,0 +1,74 @@
+#include <stdio.h>
+#include "cdi.h"
+
+int nlon = 12; // Number of longitudes
+int nlat =  6; // Number of latitudes 
+int nlev =  5; // Number of levels    
+int nts  =  3; // Number of time steps
+
+int main(void)
+{
+  int taxisID, vlistID1, vlistID2, varID1, varID2, streamID1, streamID2, tsID;
+  int nmiss, vdate, vtime;
+  double var1[nlon*nlat];
+  double var2[nlon*nlat*nlev];
+
+
+  // Open the input dataset
+  streamID1  = streamOpenRead("example.nc");
+  if ( streamID1 < 0 )
+    {
+      fprintf(stderr, "%s\n", cdiStringError(streamID1));
+      return(1);
+    }
+
+  // Get the variable list of the dataset
+  vlistID1 = streamInqVlist(streamID1);
+
+  // Set the variable IDs
+  varID1 = 0;
+  varID2 = 1;
+
+  // Get the Time axis from the variable list
+  taxisID = vlistInqTaxis(vlistID1);
+
+  // Open the output dataset (GRIB format)
+  streamID2  = streamOpenWrite("example.grb", FILETYPE_GRB);
+  if ( streamID2 < 0 )
+    {
+      fprintf(stderr, "%s\n", cdiStringError(streamID2));
+      return(1);
+    }
+
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  streamDefVlist(streamID2, vlistID2);
+
+  // Loop over the number of time steps
+  for ( tsID = 0; tsID < nts; tsID++ )
+    {
+      // Inquire the input time step
+      streamInqTimestep(streamID1, tsID);
+
+      // Get the verification date and time
+      vdate = taxisInqVdate(taxisID);
+      vtime = taxisInqVtime(taxisID);
+
+      // Define the output time step
+      streamDefTimestep(streamID2, tsID);
+
+      // Read var1 and var2 
+      streamReadVar(streamID1, varID1, var1, &nmiss);
+      streamReadVar(streamID1, varID2, var2, &nmiss);
+
+      // Write var1 and var2
+      streamWriteVar(streamID2, varID1, var1, nmiss);
+      streamWriteVar(streamID2, varID2, var2, nmiss);
+    }
+
+  // Close the streams
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  return 0;
+}
diff --git a/libcdi/examples/cdi_read.c b/libcdi/examples/cdi_read.c
new file mode 100644
index 0000000..f619f37
--- /dev/null
+++ b/libcdi/examples/cdi_read.c
@@ -0,0 +1,54 @@
+#include <stdio.h>
+#include "cdi.h"
+
+int nlon = 12; // Number of longitudes
+int nlat =  6; // Number of latitudes
+int nlev =  5; // Number of levels
+int nts  =  3; // Number of time steps
+
+int main(void)
+{
+  int taxisID, vlistID, varID1, varID2, streamID, tsID;
+  int nmiss, vdate, vtime;
+  double var1[nlon*nlat];
+  double var2[nlon*nlat*nlev];
+
+
+  // Open the dataset 
+  streamID = streamOpenRead("example.nc");
+  if ( streamID < 0 )
+    {
+      fprintf(stderr, "%s\n", cdiStringError(streamID));
+      return(1);
+    }
+
+  // Get the variable list of the dataset 
+  vlistID = streamInqVlist(streamID);
+
+  // Set the variable IDs 
+  varID1 = 0;
+  varID2 = 1;
+
+  // Get the Time axis from the variable list 
+  taxisID = vlistInqTaxis(vlistID);
+
+  // Loop over the number of time steps 
+  for ( tsID = 0; tsID < nts; tsID++ )
+    {
+      // Inquire the time step 
+      streamInqTimestep(streamID, tsID);
+
+      // Get the verification date and time 
+      vdate = taxisInqVdate(taxisID);
+      vtime = taxisInqVtime(taxisID);
+
+      // Read var1 and var2 
+      streamReadVar(streamID, varID1, var1, &nmiss);
+      streamReadVar(streamID, varID2, var2, &nmiss);
+    }
+
+  // Close the input stream 
+  streamClose(streamID);
+
+  return 0;
+}
diff --git a/libcdi/examples/cdi_read_f2003.f90 b/libcdi/examples/cdi_read_f2003.f90
new file mode 100644
index 0000000..045499a
--- /dev/null
+++ b/libcdi/examples/cdi_read_f2003.f90
@@ -0,0 +1,77 @@
+PROGRAM CDIREADF2003
+  use iso_c_binding
+  use mo_cdi
+
+  IMPLICIT NONE
+
+  INTEGER :: gsize, nlevel, nvars, code
+  INTEGER :: vdate, vtime, nmiss, status, ilev
+  INTEGER :: streamID, varID, gridID, zaxisID
+  INTEGER :: tsID, vlistID, taxisID
+  DOUBLE PRECISION, ALLOCATABLE :: field(:,:)
+  CHARACTER(kind=c_char,len=256) :: name, longname, units, msg
+
+  ! Open the dataset
+  streamID = streamOpenRead(C_CHAR_"example.nc"//C_NULL_CHAR)
+  IF ( streamID < 0 ) THEN
+    PRINT *,  'Could not Read the file.'
+    msg = cdiStringError(streamID)
+    WRITE(0,*) msg
+    STOP 1
+  END IF
+
+  ! Get the variable list of the dataset
+  vlistID = streamInqVlist(streamID)
+
+  nvars = vlistNvars(vlistID)
+
+  DO varID = 0, nvars-1
+    code = vlistInqVarCode(vlistID, varID)
+    CALL vlistInqVarName(vlistID, varID, name)
+    CALL vlistInqVarLongname(vlistID, varID, longname)
+    CALL vlistInqVarUnits(vlistID, varID, units)
+
+    CALL ctrim(name)
+    CALL ctrim(longname)
+    CALL ctrim(units)
+
+    WRITE(*,*) 'Parameter: ', varID+1, code,' ',trim(name),' ', &
+                trim(longname),' ',trim(units), ' |'
+
+  END DO
+
+  ! Get the Time axis form the variable list
+  taxisID = vlistInqTaxis(vlistID)
+
+  ! Loop over the time steps
+  DO tsID = 0, 999999
+    ! Read the time step
+    status = streamInqTimestep(streamID, tsID)
+    IF ( status == 0 ) exit
+
+    ! Get the verification date and time
+    vdate = taxisInqVdate(taxisID)
+    vtime = taxisInqVtime(taxisID)
+
+    WRITE(*,*) 'Timestep: ', tsID+1, vdate, vtime
+
+    ! Read the variables at the current timestep
+    DO varID = 0, nvars-1
+      gridID = vlistInqVarGrid(vlistID, varID)
+      gsize = gridInqSize(gridID)
+      zaxisID = vlistInqVarZaxis(vlistID, varID)
+      nlevel = zaxisInqSize(zaxisID)
+      ALLOCATE(field(gsize, nlevel))
+      CALL streamReadVar(streamID, varID, field, nmiss)
+      DO ilev = 1, nlevel
+        WRITE(*,*) '   var=', varID+1, ' level=', ilev, ':', &
+                  MINVAL(field(:,ilev)), MAXVAL(field(:,ilev))
+      END DO
+      DEALLOCATE(field)
+    END DO
+  END DO
+
+  ! Close the input stream
+  CALL streamClose(streamID)
+
+END PROGRAM CDIREADF2003
diff --git a/libcdi/examples/cdi_write.c b/libcdi/examples/cdi_write.c
new file mode 100644
index 0000000..89094c2
--- /dev/null
+++ b/libcdi/examples/cdi_write.c
@@ -0,0 +1,93 @@
+#include <stdio.h>
+#include "cdi.h"
+
+#define  nlon   12 // Number of longitudes
+#define  nlat    6 // Number of latitudes 
+#define  nlev    5 // Number of levels    
+#define  nts     3 // Number of time steps
+
+int main(void)
+{
+  int gridID, zaxisID1, zaxisID2, taxisID;
+  int vlistID, varID1, varID2, streamID, tsID;
+  int i, nmiss = 0;
+  double lons[nlon] = {0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330};
+  double lats[nlat] = {-75, -45, -15, 15, 45, 75};
+  double levs[nlev] = {101300, 92500, 85000, 50000, 20000};
+  double var1[nlon*nlat];
+  double var2[nlon*nlat*nlev];
+
+
+  // Create a regular lon/lat grid
+  gridID = gridCreate(GRID_LONLAT, nlon*nlat);
+  gridDefXsize(gridID, nlon);
+  gridDefYsize(gridID, nlat);
+  gridDefXvals(gridID, lons);
+  gridDefYvals(gridID, lats);
+
+  // Create a surface level Z-axis
+  zaxisID1 = zaxisCreate(ZAXIS_SURFACE, 1);
+
+  // Create a pressure level Z-axis
+  zaxisID2 = zaxisCreate(ZAXIS_PRESSURE, nlev);
+  zaxisDefLevels(zaxisID2, levs);
+ 
+  // Create a variable list
+  vlistID = vlistCreate();
+
+  // Define the variables
+  varID1 = vlistDefVar(vlistID, gridID, zaxisID1, TIME_VARIABLE);
+  varID2 = vlistDefVar(vlistID, gridID, zaxisID2, TIME_VARIABLE);
+
+  // Define the variable names
+  vlistDefVarName(vlistID, varID1, "varname1");
+  vlistDefVarName(vlistID, varID2, "varname2");
+
+  // Create a Time axis
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+
+  // Assign the Time axis to the variable list
+  vlistDefTaxis(vlistID, taxisID);
+
+  // Create a dataset in netCDF format
+  streamID = streamOpenWrite("example.nc", FILETYPE_NC);
+  if ( streamID < 0 )
+    {
+      fprintf(stderr, "%s\n", cdiStringError(streamID));
+      return(1);
+    }
+
+  // Assign the variable list to the dataset
+  streamDefVlist(streamID, vlistID);
+
+  // Loop over the number of time steps
+  for ( tsID = 0; tsID < nts; tsID++ )
+    {
+      // Set the verification date to 1985-01-01 + tsID
+      taxisDefVdate(taxisID, 19850101+tsID);
+      // Set the verification time to 12:00:00
+      taxisDefVtime(taxisID, 120000);
+      // Define the time step
+      streamDefTimestep(streamID, tsID);
+
+      // Init var1 and var2
+      for ( i = 0; i < nlon*nlat;      i++ ) var1[i] = 1.1;
+      for ( i = 0; i < nlon*nlat*nlev; i++ ) var2[i] = 2.2;
+
+      // Write var1 and var2
+      streamWriteVar(streamID, varID1, var1, nmiss);
+      streamWriteVar(streamID, varID2, var2, nmiss);
+    }
+
+  // Close the output stream
+  streamClose(streamID);
+
+  // Destroy the objects
+  vlistDestroy(vlistID);
+  taxisDestroy(taxisID);
+  zaxisDestroy(zaxisID1);
+  zaxisDestroy(zaxisID2);
+  gridDestroy(gridID);
+
+  return 0;
+}
diff --git a/libcdi/examples/cdi_write_ens.c b/libcdi/examples/cdi_write_ens.c
new file mode 100644
index 0000000..f578f00
--- /dev/null
+++ b/libcdi/examples/cdi_write_ens.c
@@ -0,0 +1,139 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "cdi.h"
+
+int main(int argc, char *argv[])
+{
+  char fname[] = "test_ens.grb2";
+  int filetype = FILETYPE_GRB2;
+  int nlat = 18, nlon = 2*nlat;
+  double *data = NULL;
+  double missval;
+  int nlevel;
+  int varID;
+  int datasize = 0;
+  int streamID1, streamID2;
+  int gridID, zaxisID, code, vdate, vtime;
+  int nrecs, nvars;
+  int gridtype, gridsize = 0;
+  int tsID;
+  int timeID = 0;
+  int level, levelID;
+  int offset;
+  int vlistID, taxisID;
+  int nmiss;
+
+  int instID;
+  int i1,i2,i3;
+
+  datasize = nlon * nlat;
+  data = (double *) malloc(datasize*sizeof(double));
+  memset(data, 0, datasize*sizeof(double));
+
+  gridID = gridCreate(GRID_GAUSSIAN, datasize);
+  gridDefXsize(gridID, nlon);
+  gridDefYsize(gridID, nlat);
+
+  zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
+  
+  instID  = institutDef( 252, 0, NULL, NULL );
+
+  vlistID = vlistCreate();
+  varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_VARIABLE);
+  
+  vlistDefVarEnsemble( vlistID, varID, 1, 2, 3);
+  
+  vlistInqVarEnsemble(  vlistID, varID, &i1,&i2,&i3);
+  
+  
+  vlistDefInstitut( vlistID,instID );
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+  vlistDefTaxis(vlistID, taxisID);
+
+  streamID1 = streamOpenWrite(fname, filetype);
+  if ( streamID1 < 0 )
+    {
+      fprintf(stderr, "Open failed on %s\n", fname);
+      fprintf(stderr, "%s\n", cdiStringError(streamID1));
+      return (-1);
+    }
+
+  streamDefVlist(streamID1, vlistID);
+
+  (void) streamDefTimestep(streamID1, 0);
+
+  streamWriteVar(streamID1, varID, data, 0);
+
+  return (0);
+
+  vlistID = streamInqVlist(streamID1);
+
+  filetype = streamInqFiletype(streamID1);
+
+  streamID2 = streamOpenWrite(fname, filetype);
+  if ( streamID2 < 0 )
+    {
+      fprintf(stderr, "Open failed on %s\n", fname);
+      fprintf(stderr, "%s\n", cdiStringError(streamID2));
+      return (-1);
+    }
+
+  streamDefVlist(streamID2, vlistID);
+
+  nvars = vlistNvars(vlistID);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID, varID);
+      zaxisID  = vlistInqVarZaxis(vlistID, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(zaxisID);
+      if ( gridsize*nlevel > datasize ) datasize = gridsize*nlevel;
+    }
+
+  data = (double *) malloc(datasize*sizeof(double));
+  memset(data, 0, datasize*sizeof(double));
+
+  taxisID = vlistInqTaxis(vlistID);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID);
+      vtime = taxisInqVtime(taxisID);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  streamReadVar(streamID1, varID, data, &nmiss);
+
+	  code     = vlistInqVarCode(vlistID, varID);
+	  gridID   = vlistInqVarGrid(vlistID, varID);
+	  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+	  gridtype = gridInqType(gridID);
+	  gridsize = gridInqSize(gridID);
+	  nlevel   = zaxisInqSize(zaxisID);
+	  missval  = vlistInqVarMissval(vlistID, varID);
+
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      level  = (int) zaxisInqLevel(zaxisID, levelID);
+	      offset = gridsize*levelID;
+	    }
+
+	  streamWriteVar(streamID2, varID, data, nmiss);
+	}
+      tsID++;
+    }
+
+  free(data);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  return (0);
+}
diff --git a/libcdi/examples/cdi_write_f2003.f90 b/libcdi/examples/cdi_write_f2003.f90
new file mode 100644
index 0000000..a642150
--- /dev/null
+++ b/libcdi/examples/cdi_write_f2003.f90
@@ -0,0 +1,103 @@
+      PROGRAM CDIWRITEF2003
+
+      USE iso_c_binding
+      USE mo_cdi
+
+      IMPLICIT NONE
+
+      INTEGER nlon, nlat, nlev, nts
+      PARAMETER (nlon = 12)   ! Number of longitudes
+      PARAMETER (nlat =  6)   ! Number of latitudes
+      PARAMETER (nlev =  5)   ! Number of levels
+      PARAMETER (nts  =  3)   ! Number of time steps
+
+      INTEGER gridID, zaxisID1, zaxisID2, taxisID
+      INTEGER vlistID, varID1, varID2, streamID, tsID
+      INTEGER i, nmiss, status
+      DOUBLE PRECISION lons(nlon), lats(nlat), levs(nlev)
+      DOUBLE PRECISION var1(nlon*nlat), var2(nlon*nlat*nlev)
+      CHARACTER(len=256) :: varname
+      CHARACTER(kind=c_char,len=256) :: msg
+
+      DATA lons /0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330/
+      DATA lats /-75, -45, -15, 15, 45, 75/
+      DATA levs /101300, 92500, 85000, 50000, 20000/
+
+      nmiss = 0
+
+!     Create a regular lon/lat grid
+      gridID = gridCreate(GRID_LONLAT, nlon*nlat)
+      CALL gridDefXsize(gridID, nlon)
+      CALL gridDefYsize(gridID, nlat)
+      CALL gridDefXvals(gridID, lons)
+      CALL gridDefYvals(gridID, lats)
+
+!     Create a surface level Z-axis
+      zaxisID1 = zaxisCreate(ZAXIS_SURFACE, 1)
+
+!     Create a pressure level Z-axis
+      zaxisID2 = zaxisCreate(ZAXIS_PRESSURE, nlev)
+      CALL zaxisDefLevels(zaxisID2, levs)
+
+!     Create a variable list
+      vlistID = vlistCreate()
+
+!     Define the variables
+      varID1 = vlistDefVar(vlistID, gridID, zaxisID1, TIME_VARIABLE)
+      varID2 = vlistDefVar(vlistID, gridID, zaxisID2, TIME_VARIABLE)
+
+!     Define the variable names
+      varname = "varname1"
+      CALL vlistDefVarName(vlistID, varID1, TRIM(varname)//C_NULL_CHAR)
+      CALL vlistDefVarName(vlistID, varID2, C_CHAR_"varname2"//C_NULL_CHAR)
+
+!     Create a Time axis
+      taxisID = taxisCreate(TAXIS_ABSOLUTE)
+
+!     Assign the Time axis to the variable list
+      CALL vlistDefTaxis(vlistID, taxisID)
+
+!     Create a dataset in netCDF format
+      streamID = streamOpenWrite(C_CHAR_"example.nc"//C_NULL_CHAR, FILETYPE_NC)
+      IF ( streamID < 0 ) THEN
+         msg = cdiStringError(streamID)
+         WRITE(0,*) msg
+         STOP 1
+      END IF
+
+!     Assign the variable list to the dataset
+      CALL streamDefVlist(streamID, vlistID)
+
+!     Loop over the number of time steps
+      DO tsID = 0, nts-1
+!        Set the verification date to 1985-01-01 + tsID
+         CALL taxisDefVdate(taxisID, 19850101+tsID)
+!        Set the verification time to 12:00:00
+         CALL taxisDefVtime(taxisID, 120000)
+!        Define the time step
+         status = streamDefTimestep(streamID, tsID)
+
+!        Init var1 and var2
+         DO i = 1, nlon*nlat
+            var1(i) = 1.1
+         END DO
+         DO i = 1, nlon*nlat*nlev
+            var2(i) = 2.2
+         END DO
+
+!        Write var1 and var2
+         CALL streamWriteVar(streamID, varID1, var1, nmiss)
+         CALL streamWriteVar(streamID, varID2, var2, nmiss)
+      END DO
+
+!     Close the output stream
+      CALL streamClose(streamID)
+
+!     Destroy the objects
+      CALL vlistDestroy(vlistID)
+      CALL taxisDestroy(taxisID)
+      CALL zaxisDestroy(zaxisID1)
+      CALL zaxisDestroy(zaxisID2)
+      CALL gridDestroy(gridID)
+
+      END PROGRAM CDIWRITEF2003
diff --git a/libcdi/examples/pio/Makefile.am b/libcdi/examples/pio/Makefile.am
new file mode 100644
index 0000000..f9c0a0a
--- /dev/null
+++ b/libcdi/examples/pio/Makefile.am
@@ -0,0 +1,28 @@
+noinst_PROGRAMS=collectData collectDataNStreams
+
+if USE_MPI
+noinst_PROGRAMS+=compareResourcesArray
+endif
+
+if USE_FC
+ noinst_PROGRAMS+=collectData2003
+endif
+
+AM_CPPFLAGS = -I$(top_srcdir)/src
+AM_FCFLAGS  = $(FPP_INCOPT)$(top_srcdir)/src
+
+collectData_SOURCES=collectData.c
+
+collectData_LDADD=$(top_builddir)/src/libcdi.la
+
+collectData2003_SOURCES=collectData2003.F90
+
+collectData2003_LDADD=$(top_builddir)/src/libcdi.la
+
+collectDataNStreams_SOURCES=collectDataNStreams.c
+
+collectDataNStreams_LDADD=$(top_builddir)/src/libcdi.la
+
+compareResourcesArray_SOURCES=compareResourcesArray.c
+
+compareResourcesArray_LDADD=$(top_builddir)/src/libcdi.la
diff --git a/libcdi/examples/pio/Makefile.in b/libcdi/examples/pio/Makefile.in
new file mode 100644
index 0000000..7af7aa2
--- /dev/null
+++ b/libcdi/examples/pio/Makefile.in
@@ -0,0 +1,621 @@
+# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+noinst_PROGRAMS = collectData$(EXEEXT) collectDataNStreams$(EXEEXT) \
+	$(am__EXEEXT_1) $(am__EXEEXT_2)
+ at USE_MPI_TRUE@am__append_1 = compareResourcesArray
+ at USE_FC_TRUE@am__append_2 = collectData2003
+subdir = examples/pio
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+	$(top_srcdir)/m4/acx_assert_lang_is_fortran_variant.m4 \
+	$(top_srcdir)/m4/acx_lang_other_suffix_conftest.m4 \
+	$(top_srcdir)/m4/acx_options.m4 \
+	$(top_srcdir)/m4/acx_sl_fc_mod_path_flag.m4 \
+	$(top_srcdir)/m4/acx_sl_mod_suffix.m4 \
+	$(top_srcdir)/m4/asx_unset.m4 $(top_srcdir)/m4/ax_pthread.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/starlink_fpp.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+ at USE_MPI_TRUE@am__EXEEXT_1 = compareResourcesArray$(EXEEXT)
+ at USE_FC_TRUE@am__EXEEXT_2 = collectData2003$(EXEEXT)
+PROGRAMS = $(noinst_PROGRAMS)
+am_collectData_OBJECTS = collectData.$(OBJEXT)
+collectData_OBJECTS = $(am_collectData_OBJECTS)
+collectData_DEPENDENCIES = $(top_builddir)/src/libcdi.la
+am_collectData2003_OBJECTS = collectData2003.$(OBJEXT)
+collectData2003_OBJECTS = $(am_collectData2003_OBJECTS)
+collectData2003_DEPENDENCIES = $(top_builddir)/src/libcdi.la
+am_collectDataNStreams_OBJECTS = collectDataNStreams.$(OBJEXT)
+collectDataNStreams_OBJECTS = $(am_collectDataNStreams_OBJECTS)
+collectDataNStreams_DEPENDENCIES = $(top_builddir)/src/libcdi.la
+am_compareResourcesArray_OBJECTS = compareResourcesArray.$(OBJEXT)
+compareResourcesArray_OBJECTS = $(am_compareResourcesArray_OBJECTS)
+compareResourcesArray_DEPENDENCIES = $(top_builddir)/src/libcdi.la
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+PPFCCOMPILE = $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+LTPPFCCOMPILE = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(FC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_FCFLAGS) $(FCFLAGS)
+FCLD = $(FC)
+FCLINK = $(LIBTOOL) --tag=FC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(FCLD) $(AM_FCFLAGS) $(FCFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(collectData_SOURCES) $(collectData2003_SOURCES) \
+	$(collectDataNStreams_SOURCES) \
+	$(compareResourcesArray_SOURCES)
+DIST_SOURCES = $(collectData_SOURCES) $(collectData2003_SOURCES) \
+	$(collectDataNStreams_SOURCES) \
+	$(compareResourcesArray_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDI_F90_INTERFACE_FCFLAGS = @CDI_F90_INTERFACE_FCFLAGS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
+ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
+ENABLE_EXTRA = @ENABLE_EXTRA@
+ENABLE_GRIB = @ENABLE_GRIB@
+ENABLE_IEG = @ENABLE_IEG@
+ENABLE_PYTHON = @ENABLE_PYTHON@
+ENABLE_RUBY = @ENABLE_RUBY@
+ENABLE_SERVICE = @ENABLE_SERVICE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_f90 = @FCFLAGS_f90@
+FCMODCASE = @FCMODCASE@
+FCMODEXT = @FCMODEXT@
+FC_MOD_FLAG = @FC_MOD_FLAG@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FPP = @FPP@
+FPPFLAGS = @FPPFLAGS@
+FPP_DEFOPT = @FPP_DEFOPT@
+FPP_INCOPT = @FPP_INCOPT@
+GREP = @GREP@
+GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
+GRIB_API_LIBS = @GRIB_API_LIBS@
+HDF5_INCLUDE = @HDF5_INCLUDE@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_ROOT = @HDF5_ROOT@
+HOST_NAME = @HOST_NAME@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JASPER_LIBS = @JASPER_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MPI_LAUNCH = @MPI_LAUNCH@
+NC_CONFIG = @NC_CONFIG@
+NETCDF_INCLUDE = @NETCDF_INCLUDE@
+NETCDF_LIBS = @NETCDF_LIBS@
+NETCDF_ROOT = @NETCDF_ROOT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENJPEG_LIBS = @OPENJPEG_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+RUBY = @RUBY@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SYSTEM_TYPE = @SYSTEM_TYPE@
+SZLIB_INCLUDE = @SZLIB_INCLUDE@
+SZLIB_LIBS = @SZLIB_LIBS@
+THREADS_INCLUDE = @THREADS_INCLUDE@
+THREADS_LIBS = @THREADS_LIBS@
+USER_NAME = @USER_NAME@
+USE_MPI = @USE_MPI@
+VERSION = @VERSION@
+ZLIB_INCLUDE = @ZLIB_INCLUDE@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+openjpeg_LIBS = @openjpeg_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+AM_CPPFLAGS = -I$(top_srcdir)/src
+AM_FCFLAGS = $(FPP_INCOPT)$(top_srcdir)/src
+collectData_SOURCES = collectData.c
+collectData_LDADD = $(top_builddir)/src/libcdi.la
+collectData2003_SOURCES = collectData2003.F90
+collectData2003_LDADD = $(top_builddir)/src/libcdi.la
+collectDataNStreams_SOURCES = collectDataNStreams.c
+collectDataNStreams_LDADD = $(top_builddir)/src/libcdi.la
+compareResourcesArray_SOURCES = compareResourcesArray.c
+compareResourcesArray_LDADD = $(top_builddir)/src/libcdi.la
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .F90 .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu examples/pio/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu examples/pio/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+collectData$(EXEEXT): $(collectData_OBJECTS) $(collectData_DEPENDENCIES) $(EXTRA_collectData_DEPENDENCIES) 
+	@rm -f collectData$(EXEEXT)
+	$(LINK) $(collectData_OBJECTS) $(collectData_LDADD) $(LIBS)
+collectData2003$(EXEEXT): $(collectData2003_OBJECTS) $(collectData2003_DEPENDENCIES) $(EXTRA_collectData2003_DEPENDENCIES) 
+	@rm -f collectData2003$(EXEEXT)
+	$(FCLINK) $(collectData2003_OBJECTS) $(collectData2003_LDADD) $(LIBS)
+collectDataNStreams$(EXEEXT): $(collectDataNStreams_OBJECTS) $(collectDataNStreams_DEPENDENCIES) $(EXTRA_collectDataNStreams_DEPENDENCIES) 
+	@rm -f collectDataNStreams$(EXEEXT)
+	$(LINK) $(collectDataNStreams_OBJECTS) $(collectDataNStreams_LDADD) $(LIBS)
+compareResourcesArray$(EXEEXT): $(compareResourcesArray_OBJECTS) $(compareResourcesArray_DEPENDENCIES) $(EXTRA_compareResourcesArray_DEPENDENCIES) 
+	@rm -f compareResourcesArray$(EXEEXT)
+	$(LINK) $(compareResourcesArray_OBJECTS) $(compareResourcesArray_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/collectData.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/collectDataNStreams.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/compareResourcesArray.Po at am__quote@
+
+.F90.o:
+	$(PPFCCOMPILE) -c -o $@ $<
+
+.F90.obj:
+	$(PPFCCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.F90.lo:
+	$(LTPPFCCOMPILE) -c -o $@ $<
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstPROGRAMS \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
+	clean-libtool clean-noinstPROGRAMS ctags distclean \
+	distclean-compile distclean-generic distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libcdi/examples/pio/collectData.c b/libcdi/examples/pio/collectData.c
new file mode 100644
index 0000000..187c1dc
--- /dev/null
+++ b/libcdi/examples/pio/collectData.c
@@ -0,0 +1,184 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include <unistd.h>
+#include <mpi.h>
+#include "pio_c_temp.h"
+#endif
+
+#include "cdi.h"
+#include "pio_util.h"
+
+
+void modelRun ()
+{
+  enum {
+    filetype    = FILETYPE_GRB,
+    ntfiles     = 2,
+    ntsteps     = 3,
+    nVars       = 5,
+    nlon        = 12,
+    nlat        = 6,
+    maxlev      = 5 };
+
+  static int nlev[nVars]    = {1,1,5,5,2};
+  static char * name        = "example";
+
+  int gridID, zaxisID[nVars], taxisID;
+  int vlistID, varID[nVars], streamID, tsID, tfID = 0;
+  int i, j, nmiss = 0, rank;
+  double lons[nlon] = {0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330};
+  double lats[nlat] = {-75, -45, -15, 15, 45, 75};
+  double levs[maxlev] = {101300, 92500, 85000, 50000, 20000};
+  double var[nlon*nlat*maxlev];
+  int vdate = 19850101, vtime = 120000;
+  int start = CDI_UNDEFID, chunk = CDI_UNDEFID, stop = CDI_UNDEFID;
+  char filename[1024];
+
+  gridID = gridCreate ( GRID_LONLAT, nlon*nlat );
+  gridDefXsize ( gridID, nlon );
+  gridDefYsize ( gridID, nlat );
+  gridDefXvals ( gridID, lons );
+  gridDefYvals ( gridID, lats );
+
+  for ( i = 0; i < nVars; i++ )
+    {
+      zaxisID[i] = zaxisCreate ( ZAXIS_PRESSURE, nlev[i] );
+      zaxisDefLevels ( zaxisID[i], levs );
+    }
+  vlistID = vlistCreate ();
+
+  for ( i = 0; i < nVars; i++ )
+    varID[i] = vlistDefVar ( vlistID, gridID, zaxisID[i], TIME_VARIABLE );
+
+  taxisID = taxisCreate ( TAXIS_ABSOLUTE );
+  vlistDefTaxis ( vlistID, taxisID );
+
+  sprintf ( &filename[0], "%s_%d.grb", name, tfID );
+  streamID = streamOpenWrite ( filename, filetype );
+  xassert ( streamID >= 0 );
+  streamDefVlist ( streamID, vlistID);
+
+  pioEndDef ();
+
+  for ( tfID = 0; tfID < ntfiles; tfID++ )
+    {
+      if ( tfID > 0 )
+	{
+	  streamClose ( streamID );
+	  sprintf ( &filename[0], "%s_%d.grb", name, tfID );
+	  streamID = streamOpenWrite ( filename, filetype );
+	  xassert ( streamID >= 0 );
+	  streamDefVlist ( streamID, vlistID );
+	}
+      for ( tsID = 0; tsID < ntsteps; tsID++ )
+	{
+	  taxisDefVdate ( taxisID, vdate );
+	  taxisDefVtime ( taxisID, vtime );
+	  streamDefTimestep ( streamID, tsID );
+	  for ( i = 0; i < nVars; i++ )
+	    {
+	      start = pioInqVarDecoOff   ( vlistID, varID[i] );
+	      chunk = pioInqVarDecoChunk ( vlistID, varID[i] );
+	      stop = start + chunk;
+	      for ( j = start; j < stop; j++ ) var[j] = 2.2;
+	      streamWriteVar ( streamID, varID[i], &var[start], nmiss );
+	      start = CDI_UNDEFID;
+	      chunk = CDI_UNDEFID;
+	    }
+	  pioWriteTimestep ( tsID, vdate, vtime );
+	}
+    }
+  pioEndTimestepping ();
+  streamClose ( streamID );
+  vlistDestroy ( vlistID );
+  taxisDestroy ( taxisID );
+  for ( i = 0; i < nVars; i++ )
+    zaxisDestroy ( zaxisID[i] );
+  gridDestroy ( gridID );
+}
+
+struct {
+  char *text;
+  int mode;
+} mode_map[] = {
+  { "PIO_MPI", PIO_MPI },
+  { "PIO_FPGUARD", PIO_FPGUARD },
+  { "PIO_ASYNCH", PIO_ASYNCH },
+  { "PIO_WRITER", PIO_WRITER }
+};
+
+
+int main (int argc, char *argv[])
+{
+  enum {
+    nNamespaces = 1 };
+
+  static int hasLocalFile[nNamespaces] = { 0 };
+
+#ifdef USE_MPI
+  MPI_Comm commGlob, commModel;
+  int sizeGlob;
+  int rankGlob;
+  int IOMode = PIO_MPI;
+  int nProcsIO = 2;
+
+  xmpi ( MPI_Init ( &argc, &argv));
+  xmpi ( MPI_Comm_dup ( MPI_COMM_WORLD, &commGlob ));
+  xmpi ( MPI_Comm_set_errhandler ( commGlob, MPI_ERRORS_RETURN ));
+  xmpi ( MPI_Comm_size ( commGlob, &sizeGlob ));
+  xmpi ( MPI_Comm_rank ( commGlob, &rankGlob ));
+
+  {
+    int opt;
+    while ((opt = getopt(argc, argv, "p:w:")) != -1)
+      switch (opt) {
+      case 'p':
+        {
+          int i, found=0;
+          for (i = 0;
+               i < sizeof (mode_map) / sizeof (mode_map[0]);
+               ++i)
+            if (!strcmp(optarg, mode_map[i].text))
+              {
+                found = 1;
+                IOMode = mode_map[i].mode;
+              }
+          if (!found)
+            {
+              fprintf(stderr, "Unsupported PIO mode requested: %s\n", optarg);
+              exit(EXIT_FAILURE);
+            }
+        }
+        break;
+      case 'w':
+        {
+          nProcsIO = strtol(optarg, NULL, 0);
+          break;
+        }
+      }
+  }
+
+  commModel = pioInit_c ( commGlob, nProcsIO, IOMode, nNamespaces, hasLocalFile );
+#endif
+
+  modelRun ();
+
+#ifdef USE_MPI
+  pioFinalize ();
+  MPI_Finalize ();
+#endif
+  return 0;
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/examples/pio/collectData2003.F90 b/libcdi/examples/pio/collectData2003.F90
new file mode 100644
index 0000000..90d8b4f
--- /dev/null
+++ b/libcdi/examples/pio/collectData2003.F90
@@ -0,0 +1,176 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+PROGRAM collectdata2003
+
+  IMPLICIT NONE
+
+  INCLUDE 'cdi.inc'
+
+#ifdef USE_MPI
+  INCLUDE 'mpif.h'
+#endif
+
+  ! For parallel IO:
+  !  Parameter and variables needed.
+  INTEGER, PARAMETER :: nProcsIO     = 3
+  ! INTEGER, PARAMETER :: IOMode       = PIO_NONE                  
+  ! INTEGER, PARAMETER :: IOMode       = PIO_MPI              
+  ! INTEGER, PARAMETER :: IOMode       = PIO_WRITER            
+  ! INTEGER, PARAMETER :: IOMode       = PIO_ASYNCH          
+  INTEGER, PARAMETER :: IOMode       = PIO_FPGUARD 
+  INTEGER, PARAMETER :: nNamespaces  = 1 
+  INTEGER, PARAMETER :: hasLocalFile(nNamespaces) = (/ 0 /)  
+
+  INTEGER ::commGlob, commModel, error
+
+  ! Start parallel environment
+#ifdef USE_MPI
+  CALL MPI_INIT ( error )
+  CALL MPI_COMM_DUP ( MPI_COMM_WORLD, commGlob, error )
+#endif
+
+  ! For parallel IO:
+  ! Initialize environment.
+  commModel = pioInit ( commGlob, nProcsIO, IOMode, nNamespaces, hasLocalFile )
+
+  CALL modelrun ( commModel )
+
+  ! For parallel IO: 
+  ! Cleanup environment.
+  CALL pioFinalize ()
+
+#ifdef USE_MPI
+  CALL MPI_FINALIZE ( error )
+#endif
+
+CONTAINS
+
+  SUBROUTINE modelrun ( commModel )
+
+    INTEGER, INTENT(in) :: commModel
+
+    INTEGER, PARAMETER :: nlon     = 12   ! Number of longitudes
+    INTEGER, PARAMETER :: nlat     =  6   ! Number of latitudes
+    INTEGER, PARAMETER :: nlev     =  5   ! Number of levels
+    INTEGER, PARAMETER :: nts      =  3   ! Number of time steps
+    INTEGER, PARAMETER :: vdate    = 19850101
+    INTEGER, PARAMETER :: vtime    = 120000
+    INTEGER, PARAMETER :: filetype = FILETYPE_GRB
+
+    INTEGER :: gridID, zaxisID1, zaxisID2, taxisID
+    INTEGER :: vlistID, varID1, varID2, streamID, tsID
+    INTEGER :: i, nmiss, status
+    DOUBLE PRECISION :: lons ( nlon ), lats ( nlat ), levs ( nlev )
+    DOUBLE PRECISION :: var1 ( nlon * nlat ), var2 ( nlon * nlat * nlev )
+    CHARACTER(len=256) :: varname
+    INTEGER :: startID, stopID, chunk
+
+    lons = (/0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330/)
+    lats = (/-75, -45, -15, 15, 45, 75/)
+    levs = (/101300, 92500, 85000, 50000, 20000/)
+
+    nmiss = 0
+
+    !     Create a regular lon/lat grid
+    gridID = gridCreate(GRID_LONLAT, nlon*nlat)
+    CALL gridDefXsize(gridID, nlon)
+    CALL gridDefYsize(gridID, nlat)
+    CALL gridDefXvals(gridID, lons)
+    CALL gridDefYvals(gridID, lats)
+
+    !     Create a surface level Z-axis
+    zaxisID1 = zaxisCreate(ZAXIS_SURFACE, 1)
+
+    !     Create a pressure level Z-axis
+    zaxisID2 = zaxisCreate(ZAXIS_PRESSURE, nlev)
+    CALL zaxisDefLevels(zaxisID2, levs)
+
+    !     Create a variable list
+    vlistID = vlistCreate()
+
+    !     Define the variables
+    varID1 = vlistDefVar(vlistID, gridID, zaxisID1, TIME_VARIABLE)
+    varID2 = vlistDefVar(vlistID, gridID, zaxisID2, TIME_VARIABLE)
+
+    !     Define the variable names
+    varname = 'varname1'
+    CALL vlistDefVarName(vlistID, varID1, varname)
+    varname = 'varname2'
+    CALL vlistDefVarName(vlistID, varID2, varname)
+
+    !     Create a Time axis
+    taxisID = taxisCreate(TAXIS_ABSOLUTE)
+
+    !     Assign the Time axis to the variable list
+    CALL vlistDefTaxis(vlistID, taxisID)
+
+    streamID = streamOpenWrite('example.grb', filetype)
+    IF ( streamID < 0 ) THEN
+      WRITE(0,*) cdiStringError(streamID)
+      STOP
+    END IF
+
+    !     Assign the variable list to the dataset
+    CALL streamDefVlist(streamID, vlistID)
+
+    !     For parallel IO: 
+    !          End definition stage for CDI resources, 
+    !          balance load of variables among collecting IO server,
+    !          Decompose data on model processes for IO
+    !          Transfer resources to the collecting IO server.
+    CALL pioEndDef (); 
+
+    !     Loop over the number of time steps
+    DO tsID = 0, nts-1
+      CALL taxisDefVdate ( taxisID, vdate + tsID )
+      CALL taxisDefVtime ( taxisID, vtime )
+      status = streamDefTimestep ( streamID, tsID )
+
+      ! For parallel IO:    
+      ! Inquire start index and chunk for IO transposition of var1
+      startID = pioInqVarDecoOff   ( vlistID, varID1 ) + 1
+      chunk   = pioInqVarDecoChunk ( vlistID, varID1 ) - 1
+      stopID = startID + chunk 
+      ! Init decomposed data for var1
+      DO i = startID, stopID
+        var1(i) = 1.1
+      END DO
+      ! Write var1
+      CALL streamWriteVar(streamID, varID1, var1 ( startID ), nmiss)
+
+      ! For parallel IO: 
+      ! Inquire start index and chunk for IO transposition of var2
+      startID = pioInqVarDecoOff ( vlistID, varID2 ) + 1
+      chunk = pioInqVarDecoChunk ( vlistID, varID2 ) - 1
+      stopID = startID + chunk
+      ! Init decomposed data for var2
+      DO i = startID, stopID
+        var2(i) = 2.2
+      END DO
+      ! Write var2
+      CALL streamWriteVar(streamID, varID2, var2 ( startID ), nmiss)
+
+      ! For parallel IO: 
+      ! Start transmission of all data for output in this timestep to IO server.
+      CALL pioWriteTimestep ( tsID, vdate, vtime )
+    END DO
+
+    ! For parallel IO:
+    ! Preparation for local cleanup
+    CALL pioEndTimestepping ()
+
+    !     Close the output stream
+    CALL streamClose(streamID)
+
+    !     Destroy the objects
+    CALL vlistDestroy(vlistID)
+    CALL taxisDestroy(taxisID)
+    CALL zaxisDestroy(zaxisID1)
+    CALL zaxisDestroy(zaxisID2)
+    CALL gridDestroy(gridID)
+
+  END SUBROUTINE modelrun
+
+END PROGRAM collectdata2003
diff --git a/libcdi/examples/pio/collectDataNStreams.c b/libcdi/examples/pio/collectDataNStreams.c
new file mode 100644
index 0000000..cbbacb1
--- /dev/null
+++ b/libcdi/examples/pio/collectDataNStreams.c
@@ -0,0 +1,199 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include <mpi.h>
+#include "pio_c_temp.h"
+#endif
+
+#include "cdi.h"
+#include "pio_util.h"
+
+void hoursPassingHack ( int * vdate, int * vtime, int hoursPassed )
+{
+  int sum, days, hours, oldDays;
+  
+  xassert ( hoursPassed % 10000 == 0 );
+  sum = * vtime + hoursPassed;
+  days = sum / 240000;
+  hours = sum % 240000;
+  oldDays = * vdate % 100;
+  if ( oldDays + days > 28 ) xabort ( "UNEXPECTED USE" );
+  * vtime = hours;
+  * vdate = * vdate + days;
+}
+ 
+void modelRun ()
+{
+  enum {
+    filetype    = FILETYPE_GRB,
+    nStreams    = 5,
+    MAXNSTREAMS = 25,
+    ntfiles     = 2,
+    ntsteps     = 3,
+    nVars       = 5,
+    nlon        = 12,
+    nlat        = 6,
+    MAXNLEV     = 5 };
+
+  static int nlev[nStreams][nVars] =
+    {{1,1,5,5,2},{3,5,2,2,1},{3,5,2,2,1},{5,2,2,2,1}, {3,3,3,3,3}};
+
+  static char nameExp[7]           = "example";
+  static int asciiA                = 65;
+  char nameStream[8];
+  char filename[1024];
+
+  int gridID, zaxisID[nStreams][nVars], taxisID;
+  int streamID[nStreams], vlistID[nStreams], varID[nStreams][nVars], tsID, tfID = 0;
+  int i, j, k, nmiss = 0, rank;
+  double lons[nlon] = {0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330};
+  double lats[nlat] = {-75, -45, -15, 15, 45, 75};
+  double levs[MAXNLEV] = {101300, 92500, 85000, 50000, 20000};
+  double var[nlon*nlat*MAXNLEV];
+  int vdate = 19850101, vtime = 120000, hourStep = 20000;
+  int start = CDI_UNDEFID, chunk = CDI_UNDEFID, stop = CDI_UNDEFID;
+
+  xassert ( nStreams < MAXNSTREAMS );
+
+  gridID = gridCreate ( GRID_LONLAT, nlon*nlat );
+  gridDefXsize ( gridID, nlon );
+  gridDefYsize ( gridID, nlat );
+  gridDefXvals ( gridID, lons );
+  gridDefYvals ( gridID, lats );
+
+  for ( i = 0; i < nStreams; i++ )
+    {
+      for ( j = 0; j < nVars; j++ )
+        {
+          xassert ( nlev[i][j] > 0 && nlev[i][j] <= MAXNLEV );
+          zaxisID[i][j] = zaxisCreate ( ZAXIS_PRESSURE, nlev[i][j] );
+          zaxisDefLevels ( zaxisID[i][j], levs );
+        }
+      vlistID[i] = vlistCreate ();
+    }
+
+  for ( i = 0; i < nStreams; i++ )
+    for ( j = 0; j < nVars; j++ )
+      varID[i][j] = vlistDefVar ( vlistID[i], gridID, zaxisID[i][j], TIME_VARIABLE );
+
+  taxisID = taxisCreate ( TAXIS_ABSOLUTE );
+  for ( i = 0; i < nStreams; i++ )
+    vlistDefTaxis ( vlistID[i], taxisID );
+
+  for ( i = 0; i < nStreams; i++ )
+    {
+      memset ( filename, 0, 1024 );
+      sprintf ( &filename[0], "%s%c_%d.grb", nameExp, asciiA + i, tfID );
+      streamID[i] = streamOpenWrite ( filename, filetype );
+      xassert ( streamID[i] >= 0 );
+      streamDefVlist ( streamID[i], vlistID[i]);
+    }
+
+  pioEndDef ();
+
+  for ( tfID = 0; tfID < ntfiles; tfID++ )
+    {
+      if ( tfID > 0 )
+	{
+          for ( i = 0; i < nStreams; i++ )
+            {
+              streamClose ( streamID[i] );
+              sprintf ( &filename[0], "%s%c_%d.grb", nameExp, asciiA + i, tfID );
+              streamID[i] = streamOpenWrite ( filename, filetype );
+              xassert ( streamID[i] >= 0 );
+              streamDefVlist ( streamID[i], vlistID[i] );
+            }
+	}
+
+      for ( tsID = 0; tsID < ntsteps; tsID++ )
+	{
+          hoursPassingHack ( &vdate, &vtime, hourStep );
+	  taxisDefVdate ( taxisID, vdate );
+	  taxisDefVtime ( taxisID, vtime );
+          for ( i = 0; i < nStreams; i++ )
+            {
+              streamDefTimestep ( streamID[i], tsID );
+              for ( j = 0; j < nVars; j++ )
+                {
+                  start = pioInqVarDecoOff   ( vlistID[i], varID[i][j] );
+                  chunk = pioInqVarDecoChunk ( vlistID[i], varID[i][j] );
+                  stop = start + chunk;
+                  for ( k = start; k < stop; k++ ) var[k] = 2.2;
+                  streamWriteVar ( streamID[i], varID[i][j], &var[start], nmiss );
+                  start = CDI_UNDEFID;
+                  chunk = CDI_UNDEFID;
+                }
+            }
+	  pioWriteTimestep ( tsID, vdate, vtime );
+	}
+    }
+
+  pioEndTimestepping ();
+
+  for ( i = 0; i < nStreams; i++ )
+    {
+      streamClose ( streamID[i] );
+      vlistDestroy ( vlistID[i] );
+    }
+  taxisDestroy ( taxisID );
+  for ( i = 0; i < nStreams; i++ )
+    for ( j = 0; j < nVars; j++ )
+      zaxisDestroy ( zaxisID[i][j] );
+  gridDestroy ( gridID );
+  xdebug("%s", "RETURN");
+}
+
+
+int main (int argc, char *argv[])
+{
+  enum {
+    nProcsIODef    = 3,
+    //IOModeDef       = PIO_NONE,
+    //IOModeDef       = PIO_MPI,
+    IOModeDef       = PIO_FPGUARD,
+    //IOModeDef       = PIO_ASYNCH,
+    //IOModeDef       = PIO_WRITER,
+    nNamespaces = 1 };
+
+  static int hasLocalFile[nNamespaces] = { 0 };
+
+#ifdef USE_MPI
+  MPI_Comm commGlob, commModel;
+  int sizeGlob;
+  int rankGlob;
+  int IOMode, nProcsIO, count;
+
+  xmpi ( MPI_Init ( &argc, &argv));
+  xmpi ( MPI_Comm_dup ( MPI_COMM_WORLD, &commGlob ));
+  xmpi ( MPI_Comm_set_errhandler ( commGlob, MPI_ERRORS_RETURN ));
+  xmpi ( MPI_Comm_size ( commGlob, &sizeGlob ));
+  xmpi ( MPI_Comm_rank ( commGlob, &rankGlob ));
+
+  if (argc > 1)
+    {
+      xassert ( argc >= 3 );
+      IOMode = atoi(argv[1]);
+      nProcsIO = atoi(argv[2]);
+      xassert ( IOMode >= PIO_MINIOMODE && IOMode <= PIO_MAXIOMODE &&
+                nProcsIO >= 0 && nProcsIO <= sizeGlob );
+      printf ( "IOMode=%d, nProcsIO=%d", IOMode, nProcsIO );
+    }
+  else
+    {
+      IOMode = IOModeDef;
+      nProcsIO = nProcsIODef;
+    }
+
+  commModel = pioInit_c ( commGlob, nProcsIO, IOMode, nNamespaces, hasLocalFile );
+#endif
+
+  modelRun ();
+
+#ifdef USE_MPI
+  pioFinalize ();
+  MPI_Finalize ();
+#endif
+  return 0;
+}
diff --git a/libcdi/examples/pio/compareResourcesArray.c b/libcdi/examples/pio/compareResourcesArray.c
new file mode 100644
index 0000000..62aa035
--- /dev/null
+++ b/libcdi/examples/pio/compareResourcesArray.c
@@ -0,0 +1,259 @@
+#if defined (HAVE_CONFIG_H)
+#include "config.h"
+#endif
+
+#include <stdio.h>
+
+#ifdef USE_MPI
+#include <mpi.h>
+#include "cdi.h"
+#include "pio_c_temp.h"
+#include "pio_util.h"
+
+extern int    reshListCompare      ( int, int );
+extern void   reshPackBufferCreate  ( char **, int *, MPI_Comm );
+extern void   reshPackBufferDestroy ( char ** );
+extern void   rpcUnpackResources    ( char *, int, MPI_Comm );
+extern void   arrayDestroy          ( void );
+
+enum {
+  IOMode           = PIO_NONE,
+  nProcsIO         = 1,
+  nNamespaces      = 2,
+  DOUBLE_PRECISION = 8,
+  nlon             = 12,
+  nlat             = 6,
+  nlev             = 5,
+  ntsteps          = 3 };
+
+static int hasLocalFile[nNamespaces] = { 0, 0 };
+
+double lons[nlon] = {0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330};
+double lats[nlat] = {-75, -45, -15, 15, 45, 75};
+double levs[nlev] = {101300, 92500, 85000, 50000, 20000};
+
+int defineGrid ()
+{
+  int gridID = CDI_UNDEFID;
+  int mask_vec[nlon*nlat];
+  const int * mp = &mask_vec[0];
+  double area_vec[nlon*nlat];
+  const double * ap = &area_vec[0];
+  int i;
+  
+  gridID = gridCreate(GRID_LONLAT, nlon*nlat);
+  gridDefXsize(gridID, nlon);
+  gridDefYsize(gridID, nlat);
+  gridDefXvals(gridID, lons);
+  gridDefYvals(gridID, lats);
+  gridDefNvertex ( gridID, 1 );
+  gridDefXbounds ( gridID, lons );
+  gridDefYbounds ( gridID, lats );
+  for ( i = 0; i < nlon*nlat; i++ )    
+    mask_vec[i] = i % 2 ;
+  gridDefMaskGME ( gridID, mp );
+  for ( i = 0; i < nlon*nlat; i++ )    
+    mask_vec[i] = 1;
+  gridDefMask ( gridID, mp );
+  gridDefXname ( gridID, "myXname" );
+  gridDefXlongname ( gridID, "myXlongname" );
+  gridDefXunits ( gridID, "myXunits" );
+  gridDefYname ( gridID, "myYname" );
+  gridDefYlongname ( gridID, "myYlongname" );
+  gridDefYunits ( gridID, "myYunits" );
+  gridDefPrec ( gridID, DOUBLE_PRECISION );
+  gridDefXpole ( gridID, 90.0 );
+  gridDefYpole ( gridID, 180.0 );
+  gridDefAngle ( gridID, 360.0 );
+  gridDefTrunc ( gridID, 1 );
+  gridDefGMEnd ( gridID, 2 );
+  gridDefGMEni ( gridID, 3 );
+  gridDefGMEni2 ( gridID, 4 );
+  gridDefGMEni3 ( gridID, 5 );
+  gridDefNumber ( gridID, 6 );
+  gridDefPosition ( gridID, 7 );
+  gridDefReference ( gridID, "myReference" );
+/* gridDefLCC ( gridID, double originLon, double originLat,  */
+/* 	   double lonParY, double lat1, double lat2, double xinc, double yinc, int projflag, int scanflag); */
+/* gridDefLcc2 ( gridID, double earth_radius, double lon_0,  */
+/* 	    double lat_0, double lat_1,double lat_2);*/
+/* gridDefLaea ( gridID, double earth_radius, double lon_0, double lat_0); */
+  for ( i = 0; i < nlon*nlat; i++ )    
+    area_vec[i] = 0.1 * i;
+  gridDefArea ( gridID, ap );
+  for ( i = 0; i < nlon*nlat; i++ )    
+    mask_vec[i] = i;
+  gridDefRowlon ( gridID, nlon*nlat, mp );
+  gridDefComplexPacking ( gridID, 1 );	       
+
+  return gridID;
+}
+
+int defineZaxis ()
+{
+  int zaxisID = CDI_UNDEFID;
+  double vct[3] = { 3.0, 3.3, 3.6 };
+
+  zaxisID = zaxisCreate(ZAXIS_PRESSURE, nlev);
+  zaxisDefLevels(zaxisID, levs);
+  zaxisDefLevel ( zaxisID, 2, 8507.3 );
+  zaxisDefName ( zaxisID, "myName" );
+  zaxisDefLongname ( zaxisID, "myLongname" );
+  zaxisDefUnits ( zaxisID, "myUnits" );
+  zaxisDefPrec ( zaxisID, DOUBLE_PRECISION );
+  zaxisDefLtype ( zaxisID, 1 );
+  zaxisDefVct ( zaxisID, 3, vct );
+  zaxisDefLbounds ( zaxisID, &levs[0] );
+  zaxisDefUbounds ( zaxisID, &levs[0] );
+  zaxisDefWeights ( zaxisID, &levs[0] );
+
+  return zaxisID;
+}
+
+int defineTaxis ()
+{
+  int taxisID = CDI_UNDEFID;
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+  
+  taxisDefType  ( taxisID, 0 );
+  taxisDefVdate ( taxisID, 1 );
+  taxisDefVtime ( taxisID, 2 );
+  taxisDefRdate ( taxisID, 3 );
+  taxisDefRtime ( taxisID, 4 );
+  taxisDefVdateBounds ( taxisID, 5, 6 );
+  taxisDefVtimeBounds ( taxisID, 7, 8 );
+  taxisDefCalendar ( taxisID, 1 );
+  taxisDefTunit ( taxisID, 1 );
+  taxisDefNumavg ( taxisID, 1 );
+
+  return taxisID;
+}
+
+void defineStream ( int streamID, int vlistID )
+{
+  streamDefByteorder ( streamID, 1 );
+  streamDefCompType  ( streamID, 2 );
+  streamDefCompLevel ( streamID, 3 );
+  streamDefVlist(streamID, vlistID);
+}
+
+int defineVlist ( int gridID, int zaxisID, int taxisID )
+{
+  int vlistID = CDI_UNDEFID;
+  int zaxisID2 = zaxisCreate(ZAXIS_SURFACE, 1);
+  int varID1, varID2;
+
+  vlistID = vlistCreate();
+  varID1 = vlistDefVar(vlistID, gridID, zaxisID, TIME_VARIABLE);
+  varID2 = vlistDefVar(vlistID, gridID, zaxisID2, TIME_VARIABLE);
+  vlistDefVarName(vlistID, varID1, "varname1");
+  {
+    int globfac[] = { 23, 42 };
+    vlistDefAttInt(vlistID, varID1, "seer's globule factors", DATATYPE_INT16,
+                   2, globfac);
+  }
+  vlistDefVarName(vlistID, varID2, "varname2");
+  vlistDefAttTxt(vlistID, varID2, "txt demo", 6, "banana");
+  vlistDefTaxis(vlistID, taxisID);
+  return vlistID;
+}
+
+int defineInstitute ()
+{
+  int instID = CDI_UNDEFID;
+
+  instID = institutDef( 0, 0,"MYINSTITUTE", "myInstitute");
+
+  return instID;
+}
+
+int defineModel ( int instID )
+{
+  int modelID = CDI_UNDEFID;
+
+  modelID = modelDef ( instID, 0, "myModel");
+
+  return modelID;
+}
+
+void modelRun ( MPI_Comm comm )
+{
+  int gridID, zaxisID, taxisID, instID, modelID, vlistID, streamID;
+
+  char * recvBuffer, * sendBuffer;
+  int bufferSize, differ;
+  MPI_Status status;
+
+  pioNamespaceSetActive ( 0 );
+
+  gridID  = defineGrid      ();
+  zaxisID = defineZaxis     ();
+  taxisID = defineTaxis     ();
+  instID  = defineInstitute ();
+  modelID = defineModel     ( instID );
+  vlistID = defineVlist     ( gridID, zaxisID, taxisID);
+  streamID = streamOpenWrite("example.grb", FILETYPE_GRB);
+  if ( streamID < 0 ) xabort ( "Could not open file" );
+  defineStream ( streamID, vlistID );
+
+  reshPackBufferCreate ( &sendBuffer, &bufferSize, comm );
+  xmpi ( MPI_Send ( sendBuffer, bufferSize, MPI_PACKED, 0, 0, comm ));  
+  recvBuffer = xmalloc ( bufferSize * sizeof ( char ));
+  xmpi ( MPI_Recv ( recvBuffer, bufferSize, MPI_PACKED, 0,
+		    0, comm, &status ));
+ 
+  pioNamespaceSetActive ( 1 );
+  rpcUnpackResources ( recvBuffer, bufferSize, comm );  
+  free ( recvBuffer );  
+  reshPackBufferDestroy ( &sendBuffer );
+
+  differ = reshListCompare ( 0, 1 );
+  printf ( "The resource arrays %s.\n", differ ? "differ" : "are equal" );
+  reshListPrint ( "reshArrayModel" );
+
+  pioNamespaceSetActive ( 0 );
+  streamClose(streamID);
+  return;
+}
+
+#endif 
+
+int main (int argc, char *argv[]) 
+{
+#ifdef USE_MPI
+  int sizeGlob;
+  MPI_Comm commGlob, commModel;
+
+  MPI_Init(&argc, &argv);           
+  xmpi ( MPI_Comm_dup ( MPI_COMM_WORLD, &commGlob ));
+  xmpi ( MPI_Comm_set_errhandler ( commGlob, MPI_ERRORS_RETURN ));
+  xmpi ( MPI_Comm_size ( commGlob, &sizeGlob )); 
+
+  if ( sizeGlob != 1 )                                         
+      xabort ( "test transition of resource array only with 1 PE." );
+                                         
+  if ( nProcsIO != 1 )
+    xabort ( "bad distribution of tasks on PEs" );
+
+  commModel = pioInit_c ( commGlob, nProcsIO, IOMode, nNamespaces, hasLocalFile );
+
+  modelRun ( commModel );
+
+  MPI_Finalize (); 
+#else
+  printf ( "Use MPI for this testprogram.\n" );
+#endif
+
+  return 0;
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/interfaces/CdiInfo.cpp b/libcdi/interfaces/CdiInfo.cpp
new file mode 100644
index 0000000..773203c
--- /dev/null
+++ b/libcdi/interfaces/CdiInfo.cpp
@@ -0,0 +1,140 @@
+#include <stdlib.h>
+#include <stdio.h>
+#include <iostream>
+#include "cdi.hpp"
+
+int main() {
+  int varno;
+  std::string _name;
+  CdiVariable var;
+
+  Cdi info("testdata/mulval.nc");
+ 
+  std::cout << "#===============================" << std::endl;
+  for (int i = 0; i < info.nvars; i++)
+    std::cout << info.codes[i] << ' ';
+  std::cout << std::endl;
+  for (int i = 0; i < info.nvars; i++)
+    std::cout << info.varnames[i] << ' ';
+  std::cout << std::endl;
+
+  std::cout << "#===============================" << std::endl;
+  std::cout << "#= Available GridIDs are: ";
+  for( std::map<int, CdiGrid>::iterator iter = info.grids.begin(); iter != info.grids.end(); ++iter ) {
+    std::cout << (*iter).first << ' ';
+  };std::cout << std::endl;
+  std::cout << "first grid:" << info.grids[0].size << std::endl;
+  if ( info.grids[0].hasXValues )
+    for (int k = 0; k < info.grids[0].xsize; k++)
+      std::cout << info.grids[0].xvalues[k] << ' ';
+  else
+    std::cout << "No XValues!" << std::endl;
+  std::cout << std::endl;
+  std::cout << "second grid:" << info.grids[1].size << std::endl;
+  if ( info.grids[1].hasXValues )
+    for (int k = 0; k < info.grids[1].xsize; k++)
+      std::cout << info.grids[1].xvalues[k] << ' ';
+  else
+    std::cout << "No XValues!" << std::endl;
+  std::cout << std::endl;
+  std::cout << "#===============================" << std::endl;
+  varno = 4;
+  info.variables[varno].sinfo(); 
+  var = info.variables[varno];
+  var = info.var["tsurf"];
+  //var = info.varByCode[176];
+  var.sinfo();
+  std::cout << "#===============================" << std::endl;
+  std::cout << "Gridname:" << var.grid.name << std::endl;
+  std::cout << "GridBounds: NumberOfCorners = " << var.grid.ncorner <<  std::endl;
+  if ( var.grid.hasYValues ) {
+    float * xvals = (float *) malloc(var.grid.xsize*sizeof(float));
+    float * yvals = (float *) malloc(var.grid.ysize*sizeof(float));
+    var.grid.getFloatVals(xvals, yvals);
+  std::cout << "xvals "   << xvals[0]       << std::endl;
+  std::cout << "yvals "   << yvals[0]       << std::endl;
+  std::cout << "xvalues " << var.grid.xvalues[0] << std::endl;
+  std::cout << "xvalues " << var.grid.xvalues.front() << std::endl;
+  std::cout << "xvalues " << var.grid.xvalues.back() << std::endl;
+  }
+  else
+    std::cout << "no grid values available" << std::endl;
+  if ( var.grid.hasBounds ) {
+    float * xbnds = (float *) malloc(var.grid.size*var.grid.ncorner*sizeof(float));
+    float * ybnds = (float *) malloc(var.grid.size*var.grid.ncorner*sizeof(float));
+    var.grid.getFloatBounds(xbnds, ybnds);
+  std::cout << "xbnds "   << xbnds[var.grid.size*var.grid.ncorner - 1]       << std::endl;
+  std::cout << "ybnds "   << ybnds[var.grid.size*var.grid.ncorner - 1]       << std::endl;
+  std::cout << "xbounds " << var.grid.xbounds[0] << std::endl;
+  std::cout << "xbounds " << var.grid.xbounds.front() << std::endl;
+  std::cout << "xbounds " << var.grid.xbounds.back() << std::endl;
+  }
+  else
+    std::cout << "no grid bounds available" << std::endl;
+  {
+    std::cout << "#===============================" << std::endl;
+    printf("Stream:%d\n"         , var.streamID);
+    printf("Taxis (unit):%d\n"   , var.taxis.unit);
+    printf("Taxis (ntsteps):%d\n", var.taxis.ntsteps);
+    printf("Taxis (type):%d\n"   , var.taxis.type);
+    printf("Zaxis (unit):%d\n"   , var.taxis.unit);
+    printf("Zaxis (levels):%d\n" , var.zaxis.size);
+    printf("Zaxis (type):%d\n"   , var.zaxis.type);
+    printf("Zaxis (ltype):%d\n"  , var.zaxis.ltype);
+    printf("Zaxis (prec):%d\n"   , var.zaxis.prec);
+    printf("Zaxis (levels): varno:%f -1:%f\n", var.zaxis.levels[varno], var.zaxis.levels[var.zaxis.size-1]);
+
+  }
+  std::cout << "# field values ================" << std::endl;
+  var.getValues();
+  std::cout << "values[0]  = " << var.values[0] <<  std::endl;
+  std::cout << "values.back() = " << var.values.back() <<  std::endl;
+  std::cout << "# field values on different levels ================" << std::endl;
+  var.getValuesWithLevel();
+  for ( int ilev=0; ilev < var.zaxis.size; ilev++)
+  {
+    std::cout << "Level:" << ilev << std::endl;
+    std::cout << "valuesWithLevel["  << ilev << "][0]  = " << var.valuesWithLevel[ilev][0] << ' ';
+    std::cout << "valuesWithLevel["  << ilev << "][-1] = " << var.valuesWithLevel[ilev][var.grid.size-1] << std::endl;
+  }
+  std::cout << "# field values (FLOAT) ================" << std::endl;
+  std::vector<float> floats;
+  floats = var.getFValues();
+  std::cout << "floats[0]  = " << floats[0] <<  std::endl;
+  std::cout << "floats.back() = " << floats.back() <<  std::endl;
+
+  std::cout << "# field values on different levels (FLOAT) ================" << std::endl;
+  std::vector< std::vector<float> > floatsWithLevel;
+  floatsWithLevel = var.getFValuesWithLevel();
+  for (int i = 0 ; i < floatsWithLevel.size();++i)
+  {
+    std::cout << "floatsWithLevel[" << i << "] = " << floatsWithLevel[i].front() << ' ' << floatsWithLevel[i].back() << std::endl;
+  }
+
+
+  std::cout << "#===============================" << std::endl;
+  std::cout << "#== Reading from the var map ===" << std::endl;
+  _name = info.variables[varno+10].name;
+  std::cout << "#== Use var: " << _name << " ==== (code " << info.variables[varno+10].code << ")" << std::endl;
+  var = info.var[_name];
+  std::cout << "#==== longname: " << var.longname << std::endl;
+  std::cout << "#==== code:     " << var.code << std::endl;
+  std::cout << "#==== size:     " << var.size << std::endl;
+  std::cout << "#==== gridtype: " << var.grid.type << std::endl;
+  std::cout << "#==== unit:     " << var.units << std::endl;
+  std::cout << "#==== zdim Name:" << var.zaxis.name << std::endl;
+  std::cout << "#==== zlevels:  " << var.zaxis.size << std::endl;
+  std::cout << "#===============================" << std::endl;
+
+/*   var = infot.varByCode[176];
+ *   std::cout << var.name << std::endl;
+ *   std::cout << "grid XValues: "; std::vector<double> xv = var.grid.xvalues; for (int k = 0; k < xv.size(); k++) { std::cout << xv[k] << " ";} std::cout << std::endl;
+ *   std::cout << "grid YValues: "; std::vector<double> yv = var.grid.yvalues; for (int k = 0; k < yv.size(); k++) { std::cout << yv[k] << " ";} std::cout << std::endl;
+ *   var = infoz.varByCode[176];
+ *   std::cout << var.name << std::endl;
+ *   std::cout << "grid XValues: "; xv = var.grid.xvalues; for (int k = 0; k < xv.size(); k++) { std::cout << xv[k] << " ";} std::cout << std::endl;
+ *   std::cout << "grid YValues: "; yv = var.grid.yvalues; for (int k = 0; k < yv.size(); k++) { std::cout << yv[k] << " ";} std::cout << std::endl;
+ */
+
+  return 0;
+}
diff --git a/libcdi/interfaces/Makefile.am b/libcdi/interfaces/Makefile.am
new file mode 100644
index 0000000..9d491bf
--- /dev/null
+++ b/libcdi/interfaces/Makefile.am
@@ -0,0 +1,117 @@
+## Process this file with automake to produce Makefile.in
+#
+SWIGCDILIB = cdilib.i
+SWIGCDIOBJ = cdiobj.i
+BINDINGS   =
+EXTRA_DIST = $(SWIGCDIOBJ) $(SWIGCDILIB)
+EXTRA_DIST += ruby/cdilib_wrap.c ruby/cdiobj_wrap.cpp ruby/testLib.rb ruby/testObj.rb
+EXTRA_DIST += python/cdilib_wrap.c python/cdiobj_wrap.cpp python/testLib.py python/testObj.py python/setupObj.py python/setupLib.py python/setup.py python/table.py python/CdiLib.py python/CdiObj.py
+if CREATE_INTERFACES
+BINDINGS += help
+endif
+#
+bin_PROGRAMS =
+noinst_PROGRAMS = 
+noinst_LTLIBRARIES = 
+if CREATE_INTERFACES
+noinst_PROGRAMS += CdiInfo
+noinst_LTLIBRARIES += libcdipp.la
+endif
+#
+locallibs = $(top_builddir)/src/.libs/libcdi.so @LTLIBOBJS@ @NETCDF_LIBS@ @HDF5_LIBS@ @SZLIB_LIBS@ @ZLIB_LIBS@
+
+libcdipp_la_SOURCES = cdi.cpp cdi.hpp
+libcdipp_la_LIBADD  = $(top_builddir)/src/libcdi.la
+libcdipp_la_LDFLAGS = @NETCDF_LIBS@ @HDF5_LIBS@ @SZLIB_LIBS@ @ZLIB_LIBS@ $(LDFLAGS)
+
+CdiInfo_SOURCES     = CdiInfo.cpp
+CdiInfo_LDADD       = libcdipp.la
+CdiInfo_LDFLAGS     = @NETCDF_LIBS@ @HDF5_LIBS@ @SZLIB_LIBS@ @ZLIB_LIBS@ $(LDFLAGS)
+#
+#
+if ENABLE_RUBY
+BINDINGS += rubyObj
+# Ruby ====================================================
+rubyLibMakefile:
+	cd ruby; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(locallibs) $(LDFLAGS)" INCFLAGS="-I../../src" ruby extconfLib.rb
+
+rubyLibWrapper: cdilib.i
+if ENABLE_SWIG
+	$(SWIG) -ruby -module CdiLib -o ruby/cdilib_wrap.c $(AM_CPPFLAGS) cdilib.i
+endif
+
+rubyLib: rubyLibWrapper rubyLibMakefile
+	@cd ruby; make
+
+rubyLibTest: rubyLib
+	@cd ruby; ruby testLib.rb
+# =========================================================
+rubyObjMakefile:
+	cd ruby; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(LDFLAGS)" INCFLAGS="-I../" ruby extconfObj.rb
+
+rubyObjWrapper: cdiobj.i
+if ENABLE_SWIG
+	$(SWIG) -ruby -c++ -module CdiObj -o ruby/cdiobj_wrap.cpp $(AM_CPPFLAGS) cdiobj.i
+endif
+
+rubyObj: rubyObjWrapper rubyObjMakefile
+	@cd ruby; make
+
+rubyObjTest: rubyObj
+	@cd ruby; ruby testObj.rb
+
+rubyObjInstall: rubyObj
+	@cd ruby; make install
+endif
+# =========================================================
+if ENABLE_PYTHON
+BINDINGS += pythonObj
+# Python ==================================================
+pythonLibWrapper: cdilib.i
+if ENABLE_SWIG
+	$(SWIG) -python -module CdiLib -o python/cdilib_wrap.c $(AM_CPPFLAGS) cdilib.i
+endif
+
+pythonLib: pythonLibWrapper
+	@cd python; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(LDFLAGS)" INCFLAGS="-I../../src" python setupLib.py build_ext --inplace
+
+pythonLibTest: pythonLib
+	@cd python; python testLib.py
+# =========================================================
+python/cdiobj_wrap.cpp: cdiobj.i
+if ENABLE_SWIG
+	$(SWIG) -python -c++ -module CdiObj -o python/cdiobj_wrap.cpp $(AM_CPPFLAGS) cdiobj.i
+endif
+
+pythonObj: python/cdiobj_wrap.cpp
+	cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I../" python setupObj.py build_ext --inplace
+
+pythonObjTest: pythonObj
+	@cd python; python testObj.py
+
+pythonObjInstall: pythonObj
+	cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I../" python setupObj.py install --prefix=$(prefix)
+endif
+# =========================================================
+help:
+	@echo "#=====================================================#"
+	@echo "# EXPERIMENTAL FEATURE ===============================#"
+	@echo "#=====================================================#"
+	@echo "Bindings for: python ruby"
+	@echo "(please exchange <lang> with the corresponding language)"
+	@echo "#=====================================================#"
+	@echo "  help             - this message"
+	@echo "  <lang>Obj        - create object interface for Ruby"
+	@echo "  <lang>Lib        - create function interface for Ruby"
+	@echo "  <lang>ObjWrapper - create the wrapper files using swig (object interface)"
+	@echo "  <lang>LibWrapper - create the wrapper files using swig (function interface)"
+	@echo "  <lang>ObjTest    - run object interface test (./<lang>/testObj.rb). Accepts input file argument."
+	@echo "  <lang>LibTest    - run function library test (./<lang>/testLib.rb). Accepts input file argument."
+	@echo "  <lang>ObjInstall - install shared libraries and optional language files for <lang>"
+	@echo "  <lang>LibInstall - see <lang>ObjInstall"
+#
+AM_CPPFLAGS = -I$(top_srcdir)/src
+#
+#all-local: $(BINDINGS)
+#
+CLEANFILES  = `ls *~`
diff --git a/libcdi/interfaces/Makefile.in b/libcdi/interfaces/Makefile.in
new file mode 100644
index 0000000..6477279
--- /dev/null
+++ b/libcdi/interfaces/Makefile.in
@@ -0,0 +1,751 @@
+# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+ at CREATE_INTERFACES_TRUE@am__append_1 = help
+bin_PROGRAMS =
+noinst_PROGRAMS = $(am__EXEEXT_1)
+ at CREATE_INTERFACES_TRUE@am__append_2 = CdiInfo
+ at CREATE_INTERFACES_TRUE@am__append_3 = libcdipp.la
+#
+#
+ at ENABLE_RUBY_TRUE@am__append_4 = rubyObj
+# =========================================================
+ at ENABLE_PYTHON_TRUE@am__append_5 = pythonObj
+subdir = interfaces
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+	$(top_srcdir)/m4/acx_assert_lang_is_fortran_variant.m4 \
+	$(top_srcdir)/m4/acx_lang_other_suffix_conftest.m4 \
+	$(top_srcdir)/m4/acx_options.m4 \
+	$(top_srcdir)/m4/acx_sl_fc_mod_path_flag.m4 \
+	$(top_srcdir)/m4/acx_sl_mod_suffix.m4 \
+	$(top_srcdir)/m4/asx_unset.m4 $(top_srcdir)/m4/ax_pthread.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/starlink_fpp.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcdipp_la_DEPENDENCIES = $(top_builddir)/src/libcdi.la
+am_libcdipp_la_OBJECTS = cdi.lo
+libcdipp_la_OBJECTS = $(am_libcdipp_la_OBJECTS)
+libcdipp_la_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) \
+	$(LIBTOOLFLAGS) --mode=link $(CXXLD) $(AM_CXXFLAGS) \
+	$(CXXFLAGS) $(libcdipp_la_LDFLAGS) $(LDFLAGS) -o $@
+ at CREATE_INTERFACES_TRUE@am_libcdipp_la_rpath =
+am__installdirs = "$(DESTDIR)$(bindir)"
+ at CREATE_INTERFACES_TRUE@am__EXEEXT_1 = CdiInfo$(EXEEXT)
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+am_CdiInfo_OBJECTS = CdiInfo.$(OBJEXT)
+CdiInfo_OBJECTS = $(am_CdiInfo_OBJECTS)
+CdiInfo_DEPENDENCIES = libcdipp.la
+CdiInfo_LINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \
+	$(CdiInfo_LDFLAGS) $(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+CXXLD = $(CXX)
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libcdipp_la_SOURCES) $(CdiInfo_SOURCES)
+DIST_SOURCES = $(libcdipp_la_SOURCES) $(CdiInfo_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDI_F90_INTERFACE_FCFLAGS = @CDI_F90_INTERFACE_FCFLAGS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
+ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
+ENABLE_EXTRA = @ENABLE_EXTRA@
+ENABLE_GRIB = @ENABLE_GRIB@
+ENABLE_IEG = @ENABLE_IEG@
+ENABLE_PYTHON = @ENABLE_PYTHON@
+ENABLE_RUBY = @ENABLE_RUBY@
+ENABLE_SERVICE = @ENABLE_SERVICE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_f90 = @FCFLAGS_f90@
+FCMODCASE = @FCMODCASE@
+FCMODEXT = @FCMODEXT@
+FC_MOD_FLAG = @FC_MOD_FLAG@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FPP = @FPP@
+FPPFLAGS = @FPPFLAGS@
+FPP_DEFOPT = @FPP_DEFOPT@
+FPP_INCOPT = @FPP_INCOPT@
+GREP = @GREP@
+GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
+GRIB_API_LIBS = @GRIB_API_LIBS@
+HDF5_INCLUDE = @HDF5_INCLUDE@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_ROOT = @HDF5_ROOT@
+HOST_NAME = @HOST_NAME@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JASPER_LIBS = @JASPER_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MPI_LAUNCH = @MPI_LAUNCH@
+NC_CONFIG = @NC_CONFIG@
+NETCDF_INCLUDE = @NETCDF_INCLUDE@
+NETCDF_LIBS = @NETCDF_LIBS@
+NETCDF_ROOT = @NETCDF_ROOT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENJPEG_LIBS = @OPENJPEG_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+RUBY = @RUBY@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SYSTEM_TYPE = @SYSTEM_TYPE@
+SZLIB_INCLUDE = @SZLIB_INCLUDE@
+SZLIB_LIBS = @SZLIB_LIBS@
+THREADS_INCLUDE = @THREADS_INCLUDE@
+THREADS_LIBS = @THREADS_LIBS@
+USER_NAME = @USER_NAME@
+USE_MPI = @USE_MPI@
+VERSION = @VERSION@
+ZLIB_INCLUDE = @ZLIB_INCLUDE@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+openjpeg_LIBS = @openjpeg_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+SWIGCDILIB = cdilib.i
+SWIGCDIOBJ = cdiobj.i
+BINDINGS = $(am__append_1) $(am__append_4) $(am__append_5)
+EXTRA_DIST = $(SWIGCDIOBJ) $(SWIGCDILIB) ruby/cdilib_wrap.c \
+	ruby/cdiobj_wrap.cpp ruby/testLib.rb ruby/testObj.rb \
+	python/cdilib_wrap.c python/cdiobj_wrap.cpp python/testLib.py \
+	python/testObj.py python/setupObj.py python/setupLib.py \
+	python/setup.py python/table.py python/CdiLib.py \
+	python/CdiObj.py
+noinst_LTLIBRARIES = $(am__append_3)
+#
+locallibs = $(top_builddir)/src/.libs/libcdi.so @LTLIBOBJS@ @NETCDF_LIBS@ @HDF5_LIBS@ @SZLIB_LIBS@ @ZLIB_LIBS@
+libcdipp_la_SOURCES = cdi.cpp cdi.hpp
+libcdipp_la_LIBADD = $(top_builddir)/src/libcdi.la
+libcdipp_la_LDFLAGS = @NETCDF_LIBS@ @HDF5_LIBS@ @SZLIB_LIBS@ @ZLIB_LIBS@ $(LDFLAGS)
+CdiInfo_SOURCES = CdiInfo.cpp
+CdiInfo_LDADD = libcdipp.la
+CdiInfo_LDFLAGS = @NETCDF_LIBS@ @HDF5_LIBS@ @SZLIB_LIBS@ @ZLIB_LIBS@ $(LDFLAGS)
+#
+AM_CPPFLAGS = -I$(top_srcdir)/src
+#
+#all-local: $(BINDINGS)
+#
+CLEANFILES = `ls *~`
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .cpp .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu interfaces/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu interfaces/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libcdipp.la: $(libcdipp_la_OBJECTS) $(libcdipp_la_DEPENDENCIES) $(EXTRA_libcdipp_la_DEPENDENCIES) 
+	$(libcdipp_la_LINK) $(am_libcdipp_la_rpath) $(libcdipp_la_OBJECTS) $(libcdipp_la_LIBADD) $(LIBS)
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+CdiInfo$(EXEEXT): $(CdiInfo_OBJECTS) $(CdiInfo_DEPENDENCIES) $(EXTRA_CdiInfo_DEPENDENCIES) 
+	@rm -f CdiInfo$(EXEEXT)
+	$(CdiInfo_LINK) $(CdiInfo_OBJECTS) $(CdiInfo_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/CdiInfo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdi.Plo at am__quote@
+
+.cpp.o:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ $<
+
+.cpp.obj:
+ at am__fastdepCXX_TRUE@	$(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
+
+.cpp.lo:
+ at am__fastdepCXX_TRUE@	$(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCXX_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCXX_FALSE@	DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCXX_FALSE@	$(LTCXXCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(PROGRAMS)
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool \
+	clean-noinstLTLIBRARIES clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool clean-noinstLTLIBRARIES \
+	clean-noinstPROGRAMS ctags distclean distclean-compile \
+	distclean-generic distclean-libtool distclean-tags distdir dvi \
+	dvi-am html html-am info info-am install install-am \
+	install-binPROGRAMS install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
+	pdf pdf-am ps ps-am tags uninstall uninstall-am \
+	uninstall-binPROGRAMS
+
+# Ruby ====================================================
+ at ENABLE_RUBY_TRUE@rubyLibMakefile:
+ at ENABLE_RUBY_TRUE@	cd ruby; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(locallibs) $(LDFLAGS)" INCFLAGS="-I../../src" ruby extconfLib.rb
+
+ at ENABLE_RUBY_TRUE@rubyLibWrapper: cdilib.i
+ at ENABLE_RUBY_TRUE@@ENABLE_SWIG_TRUE@	$(SWIG) -ruby -module CdiLib -o ruby/cdilib_wrap.c $(AM_CPPFLAGS) cdilib.i
+
+ at ENABLE_RUBY_TRUE@rubyLib: rubyLibWrapper rubyLibMakefile
+ at ENABLE_RUBY_TRUE@	@cd ruby; make
+
+ at ENABLE_RUBY_TRUE@rubyLibTest: rubyLib
+ at ENABLE_RUBY_TRUE@	@cd ruby; ruby testLib.rb
+# =========================================================
+ at ENABLE_RUBY_TRUE@rubyObjMakefile:
+ at ENABLE_RUBY_TRUE@	cd ruby; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(LDFLAGS)" INCFLAGS="-I../" ruby extconfObj.rb
+
+ at ENABLE_RUBY_TRUE@rubyObjWrapper: cdiobj.i
+ at ENABLE_RUBY_TRUE@@ENABLE_SWIG_TRUE@	$(SWIG) -ruby -c++ -module CdiObj -o ruby/cdiobj_wrap.cpp $(AM_CPPFLAGS) cdiobj.i
+
+ at ENABLE_RUBY_TRUE@rubyObj: rubyObjWrapper rubyObjMakefile
+ at ENABLE_RUBY_TRUE@	@cd ruby; make
+
+ at ENABLE_RUBY_TRUE@rubyObjTest: rubyObj
+ at ENABLE_RUBY_TRUE@	@cd ruby; ruby testObj.rb
+
+ at ENABLE_RUBY_TRUE@rubyObjInstall: rubyObj
+ at ENABLE_RUBY_TRUE@	@cd ruby; make install
+# Python ==================================================
+ at ENABLE_PYTHON_TRUE@pythonLibWrapper: cdilib.i
+ at ENABLE_PYTHON_TRUE@@ENABLE_SWIG_TRUE@	$(SWIG) -python -module CdiLib -o python/cdilib_wrap.c $(AM_CPPFLAGS) cdilib.i
+
+ at ENABLE_PYTHON_TRUE@pythonLib: pythonLibWrapper
+ at ENABLE_PYTHON_TRUE@	@cd python; CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="$(LDFLAGS)" INCFLAGS="-I../../src" python setupLib.py build_ext --inplace
+
+ at ENABLE_PYTHON_TRUE@pythonLibTest: pythonLib
+ at ENABLE_PYTHON_TRUE@	@cd python; python testLib.py
+# =========================================================
+ at ENABLE_PYTHON_TRUE@python/cdiobj_wrap.cpp: cdiobj.i
+ at ENABLE_PYTHON_TRUE@@ENABLE_SWIG_TRUE@	$(SWIG) -python -c++ -module CdiObj -o python/cdiobj_wrap.cpp $(AM_CPPFLAGS) cdiobj.i
+
+ at ENABLE_PYTHON_TRUE@pythonObj: python/cdiobj_wrap.cpp
+ at ENABLE_PYTHON_TRUE@	cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I../" python setupObj.py build_ext --inplace
+
+ at ENABLE_PYTHON_TRUE@pythonObjTest: pythonObj
+ at ENABLE_PYTHON_TRUE@	@cd python; python testObj.py
+
+ at ENABLE_PYTHON_TRUE@pythonObjInstall: pythonObj
+ at ENABLE_PYTHON_TRUE@	cd python; CC="$(CC)" CXX="$(CXX)" BUILDLIBDIR="$(top_builddir)/src/.libs" LIBDIR=$(libdir) CFLAGS="$(CFLAGS)" LIBS="$(LIBS)" LDFLAGS="-L../../src/.libs $(LDFLAGS)" INCFLAGS="-I../" python setupObj.py install --prefix=$(prefix)
+# =========================================================
+help:
+	@echo "#=====================================================#"
+	@echo "# EXPERIMENTAL FEATURE ===============================#"
+	@echo "#=====================================================#"
+	@echo "Bindings for: python ruby"
+	@echo "(please exchange <lang> with the corresponding language)"
+	@echo "#=====================================================#"
+	@echo "  help             - this message"
+	@echo "  <lang>Obj        - create object interface for Ruby"
+	@echo "  <lang>Lib        - create function interface for Ruby"
+	@echo "  <lang>ObjWrapper - create the wrapper files using swig (object interface)"
+	@echo "  <lang>LibWrapper - create the wrapper files using swig (function interface)"
+	@echo "  <lang>ObjTest    - run object interface test (./<lang>/testObj.rb). Accepts input file argument."
+	@echo "  <lang>LibTest    - run function library test (./<lang>/testLib.rb). Accepts input file argument."
+	@echo "  <lang>ObjInstall - install shared libraries and optional language files for <lang>"
+	@echo "  <lang>LibInstall - see <lang>ObjInstall"
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libcdi/interfaces/cdi.cpp b/libcdi/interfaces/cdi.cpp
new file mode 100644
index 0000000..a8381a3
--- /dev/null
+++ b/libcdi/interfaces/cdi.cpp
@@ -0,0 +1,421 @@
+#include <stdlib.h>
+#include <iostream>
+#include <algorithm>
+#include <vector>
+#include <map>
+
+#include "cdi.h"
+#include "cdi.hpp"
+
+/*
+ * CdiGrid
+ * {
+ */
+CdiGrid::CdiGrid() { gridID = -1; }
+CdiGrid::CdiGrid(int gridid) {
+  char _name[CHARSIZE];
+  char _xname[CHARSIZE], _xlongname[CHARSIZE], _xstdname[CHARSIZE], _xunits[CHARSIZE];
+  char _yname[CHARSIZE], _ylongname[CHARSIZE], _ystdname[CHARSIZE], _yunits[CHARSIZE];
+
+  gridID = gridid;
+  type   = gridInqType(gridID);
+  /*  strcpy(_name,gridNamePtr(type)); */
+  name = std::string(gridNamePtr(type));
+
+  size  = gridInqSize(gridID);
+  xsize = gridInqXsize(gridID);
+  ysize = gridInqYsize(gridID);
+  xvalues.resize(xsize);
+  yvalues.resize(ysize);
+//  std::cout << "(gridID:" << gridID<< ") xsize: " << xsize << " ysize:" << ysize << std::endl;
+
+  getValues();
+  getBounds();
+
+  prec = gridInqPrec(gridID);
+
+  gridInqXname(gridID    , _xname);
+  gridInqXlongname(gridID, _xlongname);
+  gridInqXstdname(gridID , _xstdname);
+  gridInqXunits(gridID   , _xunits);
+  gridInqYname(gridID    , _yname);
+  gridInqYlongname(gridID, _ylongname);
+  gridInqYstdname(gridID , _ystdname);
+  gridInqYunits(gridID   , _yunits);
+  xname     = _xname;
+  xlongname = _xlongname;
+  xstdname  = _xstdname;
+  xunits    = _xunits;
+  yname     = _yname;
+  ylongname = _ylongname;
+  ystdname  = _ystdname;
+  yunits    = _yunits;
+
+}
+CdiGrid::~CdiGrid() { gridID = -1; }
+
+void CdiGrid::getValues()
+{
+  double *xvals, *yvals;
+
+  hasXValues = gridInqXvals(gridID, NULL);
+  hasYValues = gridInqYvals(gridID, NULL);
+  if ( hasXValues )
+  {
+    xvals = (double *) malloc(xsize*sizeof(double));
+
+    gridInqXvals(gridID, xvals);
+    std::copy(xvals, xvals + xsize, xvalues.begin());
+    free(xvals);
+  }
+  else
+  {
+    std::cout << "grid " << gridID << " has no YValues" << std::endl;
+  }
+
+  if ( hasYValues )
+  {
+    yvals = (double *) malloc(ysize*sizeof(double));
+    gridInqYvals(gridID, yvals);
+    std::copy(yvals, yvals + ysize, yvalues.begin());
+    free(yvals);
+  }
+  else
+  {
+    std::cout << "grid " << gridID << " has no YValues" << std::endl;
+  }
+}
+
+void CdiGrid::getBounds()
+{
+  double *xbnds, *ybnds;
+
+  hasBounds = (gridInqXbounds(gridID,NULL) && gridInqYbounds(gridID,NULL));
+  if (hasBounds)
+  {
+    ncorner  = ( gridInqType(gridID) == GRID_UNSTRUCTURED ) ? gridInqNvertex(gridID) : 4;
+    ncorner *= size;
+    xbnds    = (double *) malloc((ncorner*size)*sizeof(double));
+    ybnds    = (double *) malloc((ncorner*size)*sizeof(double));
+    gridInqYbounds(gridID, xbnds);
+    gridInqXbounds(gridID, ybnds);
+    xbounds.resize(ncorner*size);
+    ybounds.resize(ncorner*size);
+    std::copy(xbnds, xbnds + ncorner*size, xbounds.begin());
+    std::copy(ybnds, ybnds + ncorner*size, ybounds.begin());
+    free(xbnds);
+    free(ybnds);
+  }
+  else
+  {
+    ncorner = 0;
+    std::cout << "grid " << gridID << " has no XYBounds" << std::endl;
+    xbounds.resize(ncorner*size);
+    ybounds.resize(ncorner*size);
+  }
+}
+/*
+ * pointer value functions {
+ */
+void CdiGrid::getValuesAsPointer(double *xvals, double *yvals)
+{
+  if (hasBounds)
+  {
+    std::copy(xvalues.begin(), xvalues.end(), xvals);
+    std::copy(yvalues.begin(), yvalues.end(), yvals);
+  }
+  else
+  {
+    std::cout << "No Values available." << std::endl;
+  }
+}
+
+void
+CdiGrid::getBoundsAsPointer(double *xbnds, double *ybnds)
+{
+  if (hasBounds)
+  {
+    std::copy(xbounds.begin(), xbounds.end(), xbnds);
+    std::copy(ybounds.begin(), ybounds.end(), ybnds);
+  }
+  else
+  {
+    std::cout << "No bounds available." << std::endl;
+  }
+}
+  /* } */
+/*
+ * float pointer functions {
+ */
+void
+CdiGrid::getFloatVals(float *xvalsF, float *yvalsF)
+{
+  for (int i = 0; i < xsize; i++)
+    xvalsF[i] = (float) xvalues[i];
+  for (int i = 0; i < ysize; i++)
+    yvalsF[i] = (float) yvalues[i];
+}
+
+void
+CdiGrid::getFloatBounds(float *xbndsF, float *ybndsF)
+{
+  if (hasBounds)
+  {
+    for (int i = 0; i < ncorner*size; i++)
+    {
+      xbndsF[i] = (float) xbounds[i];
+      ybndsF[i] = (float) ybounds[i];
+    }
+  }
+  else
+  {
+    std::cout << "No bounds available." << std::endl;
+  }
+}
+  /* } */
+/* } */
+
+/*
+ * CdiTaxis
+ * {
+ */
+CdiTaxis::CdiTaxis() { taxisID = -1; }
+CdiTaxis::CdiTaxis(int vlistID) {
+  taxisID   = vlistInqTaxis(vlistID);
+  type      = taxisInqType(taxisID);
+  ntsteps   = vlistNtsteps(vlistID);
+  hasBounds = taxisHasBounds(taxisID);
+  vdate     = taxisInqVdate(taxisID);
+  vtime     = taxisInqVtime(taxisID);
+  rdate     = taxisInqRdate(taxisID);
+  rtime     = taxisInqRtime(taxisID);
+  calendar  = taxisInqCalendar(taxisID);
+  unit      = taxisInqTunit(taxisID);
+  unitname  = tunitNamePtr(taxisID);
+}
+CdiTaxis::~CdiTaxis() { if (taxisID >= 0) taxisID = -1; }
+/* } */
+
+/*
+ * CdiZaxis
+ * {
+ */
+CdiZaxis::CdiZaxis() { zaxisID = -1; }
+CdiZaxis::CdiZaxis(int zaxisid) {
+  char name[CHARSIZE], longname[CHARSIZE], units[CHARSIZE];
+
+  zaxisID = zaxisid;
+  size    = zaxisInqSize(zaxisID);
+  prec    = zaxisInqPrec(zaxisID);
+  type    = zaxisInqType(zaxisID);
+  ltype   = zaxisInqLtype(zaxisID);
+
+  plevels  = (double *) malloc(size*sizeof(double));
+  plbounds = (double *) malloc(size*sizeof(double));
+  pubounds = (double *) malloc(size*sizeof(double));
+  pweights = (double *) malloc(size*sizeof(double));
+  zaxisInqLevels(zaxisID  ,plevels);
+  zaxisInqLbounds(zaxisID ,plbounds);
+  zaxisInqUbounds(zaxisID ,pubounds);
+  zaxisInqWeights(zaxisID ,pweights);
+  levels.resize(size); lbounds.resize(size); ubounds.resize(size); weights.resize(size);
+  std::copy(plevels,plevels+size,levels.begin());
+  std::copy(plbounds,plbounds+size,lbounds.begin());
+  std::copy(pubounds,pubounds+size,ubounds.begin());
+  std::copy(pweights,pweights+size,weights.begin());
+
+  zaxisInqName(zaxisid    ,name);
+  zaxisInqLongname(zaxisid,longname);
+  zaxisInqUnits(zaxisid   ,units);
+}
+CdiZaxis::~CdiZaxis() { if (zaxisID >= 0) zaxisID = -1; }
+/* } */
+
+/*
+ * CdiVariable
+ * {
+ */
+CdiVariable::CdiVariable() { size = -1; }
+CdiVariable::CdiVariable(int streamid,int vlistid, int varid) {
+  char _name[CHARSIZE],_longname[CHARSIZE], _units[CHARSIZE], _stdname[CHARSIZE];
+  streamID = streamid;
+  vlistID  = vlistid;
+  varID    = varid;
+  code     = vlistInqVarCode(vlistID, varID);
+  vlistInqVar(vlistID        , varID, &gridID    , &zaxisID, &timeID);
+  vlistInqVarName(vlistID    , varID, _name);
+  vlistInqVarLongname(vlistID, varID, _longname);
+  vlistInqVarStdname(vlistID , varID, _stdname);
+  vlistInqVarUnits(vlistID   , varID, _units);
+  taxisID  = vlistInqTaxis(vlistID);
+  size     = vlistInqVarSize(vlistID, varID);
+  datatype = vlistInqVarDatatype(vlistID,varID);
+  missval  = vlistInqVarMissval(vlistID,varID);
+  name     = _name;
+  longname = _longname;
+  stdname  = _stdname;
+  units    = _units;
+}
+CdiVariable::~CdiVariable(){ size = -1; }
+
+void
+CdiVariable::sinfo() { std::cout << "code:"  << std::endl; }
+
+double *
+CdiVariable::getValuesAsPointer()
+{
+  int levelID = 0, tsID = 0, nmiss;
+  int vdate, vtime, nrecs;
+  double *field;
+
+  nrecs = streamInqTimestep(streamID, tsID);
+  vdate = taxisInqVdate(taxisID);
+  vtime = taxisInqVtime(taxisID);
+  field = (double *) malloc(grid.size*sizeof(double));
+  streamReadVarSlice(streamID, varID, levelID, field, &nmiss);
+
+  return field;
+}
+
+double **
+CdiVariable::getValuesWithLevelAsPointer(int tsID)
+{
+  int    levelID, nmiss, nrecs;
+  double **fieldWithLevel, *field;
+
+  nrecs          = streamInqTimestep(streamID, tsID);
+  fieldWithLevel = (double **) malloc(zaxis.size*sizeof(double *));
+  field          = (double *)  malloc(grid.size*sizeof(double));
+  for (levelID = 0; levelID < zaxis.size; levelID++)
+  {
+    streamReadVarSlice(streamID, varID, levelID, field, &nmiss);
+    fieldWithLevel[levelID] = field;
+  }
+  free(field);
+  return fieldWithLevel;
+}
+
+void
+CdiVariable::getValues()
+{
+  double *field = getValuesAsPointer();
+  values.resize(grid.size);
+  std::copy(field, field + grid.size, values.begin());
+  free(field);
+}
+
+void
+CdiVariable::getValuesWithLevel(int tsID) {
+  double **fieldWithLevel = getValuesWithLevelAsPointer(tsID);
+
+  valuesWithLevel.resize(zaxis.size);
+  for (int levelID = 0; levelID < zaxis.size; levelID++)
+  {
+    valuesWithLevel[levelID].resize(grid.size);
+    std::copy(fieldWithLevel[levelID], fieldWithLevel[levelID] + grid.size, valuesWithLevel[levelID].begin());
+  }
+  free(fieldWithLevel);
+}
+
+std::vector<float>
+CdiVariable::getFValues()
+{
+  if (values.empty()) getValues();
+  std::vector<float> retval(values.begin(),values.end());
+  return retval;
+}
+
+
+std::vector< std::vector<float> >
+CdiVariable::getFValuesWithLevel(int tsID)
+{
+  if (valuesWithLevel.empty()) getValuesWithLevel();
+  std::vector< std::vector<float> > retval;
+  for (std::vector< std::vector<double> >::const_iterator it = valuesWithLevel.begin(); it != valuesWithLevel.end(); it++)
+  {
+    std::vector<float> fvalues((*it).begin(),(*it).end());
+    retval.push_back(fvalues);
+  }
+  return retval;
+}
+
+/* } */
+
+/*
+ * Cdi
+ * {
+ */
+Cdi::Cdi(const char *path)  {
+  streamID = streamOpenRead(path);
+  vlistID  = streamInqVlist(streamID);
+  nvars    = vlistNvars(vlistID);
+
+  getTaxes();
+  getZaxes();
+  getGrids();
+  getVars();
+}
+
+Cdi::~Cdi() {}
+
+void
+Cdi::getTaxes() {
+  int taxisID;
+  ntaxes         = 1;
+  taxisID        = vlistInqTaxis(vlistID);
+  taxes[taxisID] = CdiTaxis(vlistID);
+}
+
+void
+Cdi::getZaxes() {
+  int zaxisID;
+  nzaxes = vlistNzaxis(vlistID);
+  for (int i = 0; i < nzaxes; i++)
+  {
+    zaxisID        = vlistZaxis(vlistID, i);
+//    std::cout << "getZaxes : zaxisID=" << zaxisID << std::endl;
+    zaxes[zaxisID] = CdiZaxis(zaxisID);
+  }
+}
+
+void
+Cdi::getGrids() {
+  int gridID;
+  ngrids = vlistNgrids(vlistID);
+  for (int i = 0; i < ngrids; i++)
+  {
+    gridID        = vlistGrid(vlistID, i);
+//    std::cout << "getGrids : gridID=" << gridID << std::endl;
+    grids[gridID] = CdiGrid(gridID);
+  }
+}
+
+void
+Cdi::getVars() {
+  char name[CHARSIZE];
+  int varID, code;
+//  std::cout << vlistID << std::endl;
+  for (varID = 0; varID < nvars; varID++)
+  {
+    code = vlistInqVarCode(vlistID, varID);
+    codes.push_back(code);
+
+    vlistInqVarName(vlistID, varID, name);
+    varnames.push_back(name);
+
+    CdiVariable _var = CdiVariable(streamID,vlistID,varID);
+    _var.grid        = grids[_var.gridID];
+    _var.zaxis       = zaxes[_var.zaxisID];
+    _var.taxis       = taxes[_var.taxisID];
+  
+    variables.push_back(_var);
+
+    var[name] = _var;
+    varByCode[code]        = _var;
+  }
+}
+
+void Cdi::griddes() {
+  //Cdo::griddes("|" + streamID);
+}
+/* } */
diff --git a/libcdi/interfaces/cdi.hpp b/libcdi/interfaces/cdi.hpp
new file mode 100644
index 0000000..a248568
--- /dev/null
+++ b/libcdi/interfaces/cdi.hpp
@@ -0,0 +1,110 @@
+#include <string>
+#include <vector>
+#include <map>
+#define CHARSIZE      128
+
+class CdiGrid {
+  public:
+    CdiGrid();
+    CdiGrid(int gridid);
+    ~CdiGrid();
+
+    int gridID;
+    int type, size, xsize, ysize, prec, ncorner;
+    bool hasXValues, hasYValues, hasBounds;
+    std::vector<double> xvalues, yvalues, xbounds, ybounds;
+
+
+    std::string xname, xlongname, xstdname, xunits;
+    std::string yname, ylongname, ystdname, yunits;      
+    std::string name;
+
+    void getValues();
+    void getBounds();
+    void getValuesAsPointer(double *xvals, double *yvals);
+    void getBoundsAsPointer(double *xbnds, double *ybnds);
+    void getFloatVals(float *xvals, float * yvals);
+    void getFloatBounds(float *xbnds, float *ybnds);
+      
+  private:
+    void determineGrid(int gridID);
+};
+
+class CdiTaxis {
+  public:
+    CdiTaxis();
+    CdiTaxis(int vlistID);
+    ~CdiTaxis();
+    
+    int taxisID;
+    int ntsteps, unit;
+    int rdate, rtime, vdate, vtime;
+    int type, calendar, hasBounds;
+    char name[CHARSIZE], *unitname;
+};
+
+class CdiZaxis {
+  public:
+    CdiZaxis();
+    CdiZaxis(int zaxisid);
+    ~CdiZaxis();
+
+    int zaxisID;
+    int type, ltype, size, prec;
+    double *plevels, *plbounds, *pubounds, *pweights;
+    std::vector<double> levels, lbounds, ubounds, weights;
+    std::string name, longname, units;
+};
+
+class CdiVariable { 
+  public:
+    CdiVariable();
+    CdiVariable(int streamid,int vlistid, int varid);
+    ~CdiVariable();
+
+    int    varID, zaxisID, gridID, taxisID, timeID, vlistID;
+    int    size, code, datatype;
+    int    streamID;
+    std::string  name, longname, units, stdname;
+    double missval;
+            std::vector<double>   values;
+    std::vector< std::vector<double> > valuesWithLevel;
+
+
+    CdiGrid  grid;
+    CdiZaxis zaxis;
+    CdiTaxis taxis;
+
+    void sinfo();
+    void getValues(); 
+    void getValuesWithLevel(int tsID = 0);
+    std::vector<float>   getFValues();
+    std::vector< std::vector<float> > getFValuesWithLevel(int tsID = 0);
+    double  *getValuesAsPointer();
+    double **getValuesWithLevelAsPointer(int tsID = 0);
+};
+
+class Cdi {
+  public:
+    Cdi(const char *path);
+    ~Cdi();
+    int streamID;
+    int vlistID,nvars,nzaxes,ngrids,ntaxes,taxisID;
+
+    std::vector <std::string> varnames;
+    std::vector <int> codes;
+    
+    std::vector<CdiVariable>           variables;
+    std::map<std::string, CdiVariable> var;
+    std::map<int,         CdiVariable> varByCode;
+    std::map<int        , CdiTaxis>    taxes;
+    std::map<int        , CdiZaxis>    zaxes;
+    std::map<int        , CdiGrid>     grids;
+
+    void griddes();
+  private:
+    void getTaxes();
+    void getZaxes();
+    void getGrids();
+    void getVars();
+};
diff --git a/libcdi/interfaces/cdilib.i b/libcdi/interfaces/cdilib.i
new file mode 100644
index 0000000..54e2c00
--- /dev/null
+++ b/libcdi/interfaces/cdilib.i
@@ -0,0 +1,5 @@
+%module CdiLib
+%{
+#include "cdi.h"
+%}
+%include "cdi.h"
diff --git a/libcdi/interfaces/cdiobj.i b/libcdi/interfaces/cdiobj.i
new file mode 100644
index 0000000..31d4162
--- /dev/null
+++ b/libcdi/interfaces/cdiobj.i
@@ -0,0 +1,19 @@
+%module CdiObj
+%{
+#define SWIG_FILE_WITH_INIT
+#include "cdi.hpp"
+%}
+%include "stl.i"
+namespace std {
+   %template(IntVector)    vector<int>;
+   %template(DoubleVector) vector<double>;
+   %template(DoubleDoubleVector) vector< vector<double> >;
+   %template(StringVector) vector<string>;
+   %template(VarsVector)   vector<CdiVariable>;
+   %template(VarsMap)      map<string,CdiVariable>;
+   %template(VarsByCode)   map<int,CdiVariable>;
+   %template(TaxesMap)     map<int,CdiTaxis>;
+   %template(ZaxesMap)     map<int,CdiZaxis>;
+   %template(GridsMap)     map<int,CdiGrid>;
+}
+%include "cdi.hpp"
diff --git a/libcdi/interfaces/python/CdiLib.py b/libcdi/interfaces/python/CdiLib.py
new file mode 100644
index 0000000..feaa961
--- /dev/null
+++ b/libcdi/interfaces/python/CdiLib.py
@@ -0,0 +1,462 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 1.3.36
+#
+# Don't modify this file, modify the SWIG interface instead.
+# This file is compatible with both classic and new-style classes.
+
+import _CdiLib
+import new
+new_instancemethod = new.instancemethod
+try:
+    _swig_property = property
+except NameError:
+    pass # Python < 2.2 doesn't have 'property'.
+def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
+    if (name == "thisown"): return self.this.own(value)
+    if (name == "this"):
+        if type(value).__name__ == 'PySwigObject':
+            self.__dict__[name] = value
+            return
+    method = class_type.__swig_setmethods__.get(name,None)
+    if method: return method(self,value)
+    if (not static) or hasattr(self,name):
+        self.__dict__[name] = value
+    else:
+        raise AttributeError("You cannot add attributes to %s" % self)
+
+def _swig_setattr(self,class_type,name,value):
+    return _swig_setattr_nondynamic(self,class_type,name,value,0)
+
+def _swig_getattr(self,class_type,name):
+    if (name == "thisown"): return self.this.own()
+    method = class_type.__swig_getmethods__.get(name,None)
+    if method: return method(self)
+    raise AttributeError,name
+
+def _swig_repr(self):
+    try: strthis = "proxy of " + self.this.__repr__()
+    except: strthis = ""
+    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
+
+import types
+try:
+    _object = types.ObjectType
+    _newclass = 1
+except AttributeError:
+    class _object : pass
+    _newclass = 0
+del types
+
+
+CDI_UNDEFID = _CdiLib.CDI_UNDEFID
+CDI_GLOBAL = _CdiLib.CDI_GLOBAL
+CDI_BIGENDIAN = _CdiLib.CDI_BIGENDIAN
+CDI_LITTLEENDIAN = _CdiLib.CDI_LITTLEENDIAN
+CDI_NOERR = _CdiLib.CDI_NOERR
+CDI_ESYSTEM = _CdiLib.CDI_ESYSTEM
+CDI_EINVAL = _CdiLib.CDI_EINVAL
+CDI_EUFTYPE = _CdiLib.CDI_EUFTYPE
+CDI_ELIBNAVAIL = _CdiLib.CDI_ELIBNAVAIL
+CDI_EUFSTRUCT = _CdiLib.CDI_EUFSTRUCT
+CDI_EUNC4 = _CdiLib.CDI_EUNC4
+FILETYPE_GRB = _CdiLib.FILETYPE_GRB
+FILETYPE_GRB2 = _CdiLib.FILETYPE_GRB2
+FILETYPE_NC = _CdiLib.FILETYPE_NC
+FILETYPE_NC2 = _CdiLib.FILETYPE_NC2
+FILETYPE_NC4 = _CdiLib.FILETYPE_NC4
+FILETYPE_SRV = _CdiLib.FILETYPE_SRV
+FILETYPE_EXT = _CdiLib.FILETYPE_EXT
+FILETYPE_IEG = _CdiLib.FILETYPE_IEG
+COMPRESS_NONE = _CdiLib.COMPRESS_NONE
+COMPRESS_SZIP = _CdiLib.COMPRESS_SZIP
+COMPRESS_GZIP = _CdiLib.COMPRESS_GZIP
+COMPRESS_BZIP2 = _CdiLib.COMPRESS_BZIP2
+COMPRESS_ZIP = _CdiLib.COMPRESS_ZIP
+DATATYPE_PACK = _CdiLib.DATATYPE_PACK
+DATATYPE_PACK1 = _CdiLib.DATATYPE_PACK1
+DATATYPE_PACK2 = _CdiLib.DATATYPE_PACK2
+DATATYPE_PACK3 = _CdiLib.DATATYPE_PACK3
+DATATYPE_PACK4 = _CdiLib.DATATYPE_PACK4
+DATATYPE_PACK5 = _CdiLib.DATATYPE_PACK5
+DATATYPE_PACK6 = _CdiLib.DATATYPE_PACK6
+DATATYPE_PACK7 = _CdiLib.DATATYPE_PACK7
+DATATYPE_PACK8 = _CdiLib.DATATYPE_PACK8
+DATATYPE_PACK9 = _CdiLib.DATATYPE_PACK9
+DATATYPE_PACK10 = _CdiLib.DATATYPE_PACK10
+DATATYPE_PACK11 = _CdiLib.DATATYPE_PACK11
+DATATYPE_PACK12 = _CdiLib.DATATYPE_PACK12
+DATATYPE_PACK13 = _CdiLib.DATATYPE_PACK13
+DATATYPE_PACK14 = _CdiLib.DATATYPE_PACK14
+DATATYPE_PACK15 = _CdiLib.DATATYPE_PACK15
+DATATYPE_PACK16 = _CdiLib.DATATYPE_PACK16
+DATATYPE_PACK17 = _CdiLib.DATATYPE_PACK17
+DATATYPE_PACK18 = _CdiLib.DATATYPE_PACK18
+DATATYPE_PACK19 = _CdiLib.DATATYPE_PACK19
+DATATYPE_PACK20 = _CdiLib.DATATYPE_PACK20
+DATATYPE_PACK21 = _CdiLib.DATATYPE_PACK21
+DATATYPE_PACK22 = _CdiLib.DATATYPE_PACK22
+DATATYPE_PACK23 = _CdiLib.DATATYPE_PACK23
+DATATYPE_PACK24 = _CdiLib.DATATYPE_PACK24
+DATATYPE_PACK25 = _CdiLib.DATATYPE_PACK25
+DATATYPE_PACK26 = _CdiLib.DATATYPE_PACK26
+DATATYPE_PACK27 = _CdiLib.DATATYPE_PACK27
+DATATYPE_PACK28 = _CdiLib.DATATYPE_PACK28
+DATATYPE_PACK29 = _CdiLib.DATATYPE_PACK29
+DATATYPE_PACK30 = _CdiLib.DATATYPE_PACK30
+DATATYPE_PACK31 = _CdiLib.DATATYPE_PACK31
+DATATYPE_PACK32 = _CdiLib.DATATYPE_PACK32
+DATATYPE_FLT32 = _CdiLib.DATATYPE_FLT32
+DATATYPE_FLT64 = _CdiLib.DATATYPE_FLT64
+DATATYPE_INT8 = _CdiLib.DATATYPE_INT8
+DATATYPE_INT16 = _CdiLib.DATATYPE_INT16
+DATATYPE_INT32 = _CdiLib.DATATYPE_INT32
+DATATYPE_UINT8 = _CdiLib.DATATYPE_UINT8
+DATATYPE_UINT16 = _CdiLib.DATATYPE_UINT16
+DATATYPE_UINT32 = _CdiLib.DATATYPE_UINT32
+DATATYPE_INT = _CdiLib.DATATYPE_INT
+DATATYPE_FLT = _CdiLib.DATATYPE_FLT
+DATATYPE_TXT = _CdiLib.DATATYPE_TXT
+GRID_GENERIC = _CdiLib.GRID_GENERIC
+GRID_GAUSSIAN = _CdiLib.GRID_GAUSSIAN
+GRID_GAUSSIAN_REDUCED = _CdiLib.GRID_GAUSSIAN_REDUCED
+GRID_LONLAT = _CdiLib.GRID_LONLAT
+GRID_SPECTRAL = _CdiLib.GRID_SPECTRAL
+GRID_FOURIER = _CdiLib.GRID_FOURIER
+GRID_GME = _CdiLib.GRID_GME
+GRID_TRAJECTORY = _CdiLib.GRID_TRAJECTORY
+GRID_UNSTRUCTURED = _CdiLib.GRID_UNSTRUCTURED
+GRID_CURVILINEAR = _CdiLib.GRID_CURVILINEAR
+GRID_LCC = _CdiLib.GRID_LCC
+GRID_LCC2 = _CdiLib.GRID_LCC2
+GRID_LAEA = _CdiLib.GRID_LAEA
+GRID_SINUSOIDAL = _CdiLib.GRID_SINUSOIDAL
+ZAXIS_SURFACE = _CdiLib.ZAXIS_SURFACE
+ZAXIS_GENERIC = _CdiLib.ZAXIS_GENERIC
+ZAXIS_HYBRID = _CdiLib.ZAXIS_HYBRID
+ZAXIS_HYBRID_HALF = _CdiLib.ZAXIS_HYBRID_HALF
+ZAXIS_PRESSURE = _CdiLib.ZAXIS_PRESSURE
+ZAXIS_HEIGHT = _CdiLib.ZAXIS_HEIGHT
+ZAXIS_DEPTH_BELOW_SEA = _CdiLib.ZAXIS_DEPTH_BELOW_SEA
+ZAXIS_DEPTH_BELOW_LAND = _CdiLib.ZAXIS_DEPTH_BELOW_LAND
+ZAXIS_ISENTROPIC = _CdiLib.ZAXIS_ISENTROPIC
+ZAXIS_TRAJECTORY = _CdiLib.ZAXIS_TRAJECTORY
+ZAXIS_ALTITUDE = _CdiLib.ZAXIS_ALTITUDE
+ZAXIS_SIGMA = _CdiLib.ZAXIS_SIGMA
+ZAXIS_MEANSEA = _CdiLib.ZAXIS_MEANSEA
+TAXIS_ABSOLUTE = _CdiLib.TAXIS_ABSOLUTE
+TAXIS_RELATIVE = _CdiLib.TAXIS_RELATIVE
+TIME_CONSTANT = _CdiLib.TIME_CONSTANT
+TIME_VARIABLE = _CdiLib.TIME_VARIABLE
+TUNIT_SECOND = _CdiLib.TUNIT_SECOND
+TUNIT_MINUTE = _CdiLib.TUNIT_MINUTE
+TUNIT_HOUR = _CdiLib.TUNIT_HOUR
+TUNIT_DAY = _CdiLib.TUNIT_DAY
+TUNIT_MONTH = _CdiLib.TUNIT_MONTH
+TUNIT_YEAR = _CdiLib.TUNIT_YEAR
+TUNIT_QUARTER = _CdiLib.TUNIT_QUARTER
+CALENDAR_STANDARD = _CdiLib.CALENDAR_STANDARD
+CALENDAR_PROLEPTIC = _CdiLib.CALENDAR_PROLEPTIC
+CALENDAR_360DAYS = _CdiLib.CALENDAR_360DAYS
+CALENDAR_365DAYS = _CdiLib.CALENDAR_365DAYS
+CALENDAR_366DAYS = _CdiLib.CALENDAR_366DAYS
+CALENDAR_NONE = _CdiLib.CALENDAR_NONE
+cdiStringError = _CdiLib.cdiStringError
+cdiDebug = _CdiLib.cdiDebug
+cdiLibraryVersion = _CdiLib.cdiLibraryVersion
+cdiPrintVersion = _CdiLib.cdiPrintVersion
+cdiDefMissval = _CdiLib.cdiDefMissval
+cdiInqMissval = _CdiLib.cdiInqMissval
+cdiDefGlobal = _CdiLib.cdiDefGlobal
+streamOpenRead = _CdiLib.streamOpenRead
+streamOpenWrite = _CdiLib.streamOpenWrite
+streamOpenAppend = _CdiLib.streamOpenAppend
+streamClose = _CdiLib.streamClose
+streamSync = _CdiLib.streamSync
+streamDefVlist = _CdiLib.streamDefVlist
+streamInqVlist = _CdiLib.streamInqVlist
+streamInqFiletype = _CdiLib.streamInqFiletype
+streamDefByteorder = _CdiLib.streamDefByteorder
+streamInqByteorder = _CdiLib.streamInqByteorder
+streamDefZtype = _CdiLib.streamDefZtype
+streamDefZlevel = _CdiLib.streamDefZlevel
+streamInqZtype = _CdiLib.streamInqZtype
+streamInqZlevel = _CdiLib.streamInqZlevel
+streamDefTimestep = _CdiLib.streamDefTimestep
+streamInqTimestep = _CdiLib.streamInqTimestep
+streamFilename = _CdiLib.streamFilename
+streamFilesuffix = _CdiLib.streamFilesuffix
+streamNtsteps = _CdiLib.streamNtsteps
+streamNvals = _CdiLib.streamNvals
+streamReadVar = _CdiLib.streamReadVar
+streamWriteVar = _CdiLib.streamWriteVar
+streamReadVarSlice = _CdiLib.streamReadVarSlice
+streamWriteVarSlice = _CdiLib.streamWriteVarSlice
+streamInqRecord = _CdiLib.streamInqRecord
+streamDefRecord = _CdiLib.streamDefRecord
+streamReadRecord = _CdiLib.streamReadRecord
+streamWriteRecord = _CdiLib.streamWriteRecord
+streamCopyRecord = _CdiLib.streamCopyRecord
+streamInqGinfo = _CdiLib.streamInqGinfo
+vlistCreate = _CdiLib.vlistCreate
+vlistDestroy = _CdiLib.vlistDestroy
+vlistDuplicate = _CdiLib.vlistDuplicate
+vlistCopy = _CdiLib.vlistCopy
+vlistCopyFlag = _CdiLib.vlistCopyFlag
+vlistClearFlag = _CdiLib.vlistClearFlag
+vlistCat = _CdiLib.vlistCat
+vlistMerge = _CdiLib.vlistMerge
+vlistPrint = _CdiLib.vlistPrint
+vlistNvars = _CdiLib.vlistNvars
+vlistNgrids = _CdiLib.vlistNgrids
+vlistNzaxis = _CdiLib.vlistNzaxis
+vlistDefNtsteps = _CdiLib.vlistDefNtsteps
+vlistNtsteps = _CdiLib.vlistNtsteps
+vlistGridsizeMax = _CdiLib.vlistGridsizeMax
+vlistGrid = _CdiLib.vlistGrid
+vlistGridIndex = _CdiLib.vlistGridIndex
+vlistChangeGridIndex = _CdiLib.vlistChangeGridIndex
+vlistChangeGrid = _CdiLib.vlistChangeGrid
+vlistZaxis = _CdiLib.vlistZaxis
+vlistZaxisIndex = _CdiLib.vlistZaxisIndex
+vlistChangeZaxisIndex = _CdiLib.vlistChangeZaxisIndex
+vlistChangeZaxis = _CdiLib.vlistChangeZaxis
+vlistNrecs = _CdiLib.vlistNrecs
+vlistDefTaxis = _CdiLib.vlistDefTaxis
+vlistInqTaxis = _CdiLib.vlistInqTaxis
+vlistDefTable = _CdiLib.vlistDefTable
+vlistInqTable = _CdiLib.vlistInqTable
+vlistDefInstitut = _CdiLib.vlistDefInstitut
+vlistInqInstitut = _CdiLib.vlistInqInstitut
+vlistDefModel = _CdiLib.vlistDefModel
+vlistInqModel = _CdiLib.vlistInqModel
+vlistDefVar = _CdiLib.vlistDefVar
+vlistChangeVarGrid = _CdiLib.vlistChangeVarGrid
+vlistChangeVarZaxis = _CdiLib.vlistChangeVarZaxis
+vlistInqVar = _CdiLib.vlistInqVar
+vlistInqVarGrid = _CdiLib.vlistInqVarGrid
+vlistInqVarZaxis = _CdiLib.vlistInqVarZaxis
+vlistInqVarTime = _CdiLib.vlistInqVarTime
+vlistDefVarZtype = _CdiLib.vlistDefVarZtype
+vlistInqVarZtype = _CdiLib.vlistInqVarZtype
+vlistDefVarZlevel = _CdiLib.vlistDefVarZlevel
+vlistInqVarZlevel = _CdiLib.vlistInqVarZlevel
+vlistDefVarCode = _CdiLib.vlistDefVarCode
+vlistInqVarCode = _CdiLib.vlistInqVarCode
+vlistDefVarDatatype = _CdiLib.vlistDefVarDatatype
+vlistInqVarDatatype = _CdiLib.vlistInqVarDatatype
+vlistDefVarInstitut = _CdiLib.vlistDefVarInstitut
+vlistInqVarInstitut = _CdiLib.vlistInqVarInstitut
+vlistDefVarModel = _CdiLib.vlistDefVarModel
+vlistInqVarModel = _CdiLib.vlistInqVarModel
+vlistDefVarTable = _CdiLib.vlistDefVarTable
+vlistInqVarTable = _CdiLib.vlistInqVarTable
+vlistDefVarName = _CdiLib.vlistDefVarName
+vlistInqVarName = _CdiLib.vlistInqVarName
+vlistDefVarLongname = _CdiLib.vlistDefVarLongname
+vlistDefVarStdname = _CdiLib.vlistDefVarStdname
+vlistInqVarLongname = _CdiLib.vlistInqVarLongname
+vlistInqVarStdname = _CdiLib.vlistInqVarStdname
+vlistDefVarUnits = _CdiLib.vlistDefVarUnits
+vlistInqVarUnits = _CdiLib.vlistInqVarUnits
+vlistDefVarMissval = _CdiLib.vlistDefVarMissval
+vlistInqVarMissval = _CdiLib.vlistInqVarMissval
+vlistDefVarScalefactor = _CdiLib.vlistDefVarScalefactor
+vlistInqVarScalefactor = _CdiLib.vlistInqVarScalefactor
+vlistDefVarAddoffset = _CdiLib.vlistDefVarAddoffset
+vlistInqVarAddoffset = _CdiLib.vlistInqVarAddoffset
+vlistDefVarTimave = _CdiLib.vlistDefVarTimave
+vlistInqVarTimave = _CdiLib.vlistInqVarTimave
+vlistDefVarTimaccu = _CdiLib.vlistDefVarTimaccu
+vlistInqVarTimaccu = _CdiLib.vlistInqVarTimaccu
+vlistInqVarSize = _CdiLib.vlistInqVarSize
+vlistInqVarID = _CdiLib.vlistInqVarID
+vlistDefIndex = _CdiLib.vlistDefIndex
+vlistInqIndex = _CdiLib.vlistInqIndex
+vlistDefFlag = _CdiLib.vlistDefFlag
+vlistInqFlag = _CdiLib.vlistInqFlag
+vlistFindVar = _CdiLib.vlistFindVar
+vlistFindLevel = _CdiLib.vlistFindLevel
+vlistMergedVar = _CdiLib.vlistMergedVar
+vlistMergedLevel = _CdiLib.vlistMergedLevel
+vlistInqNatts = _CdiLib.vlistInqNatts
+vlistInqAtt = _CdiLib.vlistInqAtt
+vlistDelAtt = _CdiLib.vlistDelAtt
+vlistDefAttInt = _CdiLib.vlistDefAttInt
+vlistDefAttFlt = _CdiLib.vlistDefAttFlt
+vlistDefAttTxt = _CdiLib.vlistDefAttTxt
+vlistInqAttInt = _CdiLib.vlistInqAttInt
+vlistInqAttFlt = _CdiLib.vlistInqAttFlt
+vlistInqAttTxt = _CdiLib.vlistInqAttTxt
+gridName = _CdiLib.gridName
+gridNamePtr = _CdiLib.gridNamePtr
+gridCompress = _CdiLib.gridCompress
+gridDefMask = _CdiLib.gridDefMask
+gridInqMask = _CdiLib.gridInqMask
+gridPrint = _CdiLib.gridPrint
+gridSize = _CdiLib.gridSize
+gridCreate = _CdiLib.gridCreate
+gridDestroy = _CdiLib.gridDestroy
+gridDuplicate = _CdiLib.gridDuplicate
+gridInqType = _CdiLib.gridInqType
+gridInqSize = _CdiLib.gridInqSize
+gridDefXsize = _CdiLib.gridDefXsize
+gridInqXsize = _CdiLib.gridInqXsize
+gridDefYsize = _CdiLib.gridDefYsize
+gridInqYsize = _CdiLib.gridInqYsize
+gridDefXvals = _CdiLib.gridDefXvals
+gridInqXvals = _CdiLib.gridInqXvals
+gridDefYvals = _CdiLib.gridDefYvals
+gridInqYvals = _CdiLib.gridInqYvals
+gridDefXname = _CdiLib.gridDefXname
+gridDefXlongname = _CdiLib.gridDefXlongname
+gridDefXunits = _CdiLib.gridDefXunits
+gridDefYname = _CdiLib.gridDefYname
+gridDefYlongname = _CdiLib.gridDefYlongname
+gridDefYunits = _CdiLib.gridDefYunits
+gridInqXname = _CdiLib.gridInqXname
+gridInqXlongname = _CdiLib.gridInqXlongname
+gridInqXstdname = _CdiLib.gridInqXstdname
+gridInqXunits = _CdiLib.gridInqXunits
+gridInqYname = _CdiLib.gridInqYname
+gridInqYlongname = _CdiLib.gridInqYlongname
+gridInqYstdname = _CdiLib.gridInqYstdname
+gridInqYunits = _CdiLib.gridInqYunits
+gridDefPrec = _CdiLib.gridDefPrec
+gridInqPrec = _CdiLib.gridInqPrec
+gridInqXval = _CdiLib.gridInqXval
+gridInqYval = _CdiLib.gridInqYval
+gridInqXinc = _CdiLib.gridInqXinc
+gridInqYinc = _CdiLib.gridInqYinc
+gridIsCircular = _CdiLib.gridIsCircular
+gridIsRotated = _CdiLib.gridIsRotated
+gridInqXpole = _CdiLib.gridInqXpole
+gridDefXpole = _CdiLib.gridDefXpole
+gridInqYpole = _CdiLib.gridInqYpole
+gridDefYpole = _CdiLib.gridDefYpole
+gridInqAngle = _CdiLib.gridInqAngle
+gridDefAngle = _CdiLib.gridDefAngle
+gridDefTrunc = _CdiLib.gridDefTrunc
+gridInqTrunc = _CdiLib.gridInqTrunc
+gridInqGMEnd = _CdiLib.gridInqGMEnd
+gridDefGMEnd = _CdiLib.gridDefGMEnd
+gridInqGMEni = _CdiLib.gridInqGMEni
+gridDefGMEni = _CdiLib.gridDefGMEni
+gridInqGMEni2 = _CdiLib.gridInqGMEni2
+gridDefGMEni2 = _CdiLib.gridDefGMEni2
+gridInqGMEni3 = _CdiLib.gridInqGMEni3
+gridDefGMEni3 = _CdiLib.gridDefGMEni3
+gridDefLCC = _CdiLib.gridDefLCC
+gridInqLCC = _CdiLib.gridInqLCC
+gridDefLcc2 = _CdiLib.gridDefLcc2
+gridInqLcc2 = _CdiLib.gridInqLcc2
+gridDefLaea = _CdiLib.gridDefLaea
+gridInqLaea = _CdiLib.gridInqLaea
+gridDefArea = _CdiLib.gridDefArea
+gridInqArea = _CdiLib.gridInqArea
+gridHasArea = _CdiLib.gridHasArea
+gridDefNvertex = _CdiLib.gridDefNvertex
+gridInqNvertex = _CdiLib.gridInqNvertex
+gridDefXbounds = _CdiLib.gridDefXbounds
+gridInqXbounds = _CdiLib.gridInqXbounds
+gridDefYbounds = _CdiLib.gridDefYbounds
+gridInqYbounds = _CdiLib.gridInqYbounds
+gridDefRowlon = _CdiLib.gridDefRowlon
+gridInqRowlon = _CdiLib.gridInqRowlon
+gridChangeType = _CdiLib.gridChangeType
+zaxisName = _CdiLib.zaxisName
+zaxisCreate = _CdiLib.zaxisCreate
+zaxisDestroy = _CdiLib.zaxisDestroy
+zaxisInqType = _CdiLib.zaxisInqType
+zaxisInqSize = _CdiLib.zaxisInqSize
+zaxisDuplicate = _CdiLib.zaxisDuplicate
+zaxisResize = _CdiLib.zaxisResize
+zaxisPrint = _CdiLib.zaxisPrint
+zaxisSize = _CdiLib.zaxisSize
+zaxisDefLevels = _CdiLib.zaxisDefLevels
+zaxisInqLevels = _CdiLib.zaxisInqLevels
+zaxisDefLevel = _CdiLib.zaxisDefLevel
+zaxisInqLevel = _CdiLib.zaxisInqLevel
+zaxisDefName = _CdiLib.zaxisDefName
+zaxisDefLongname = _CdiLib.zaxisDefLongname
+zaxisDefUnits = _CdiLib.zaxisDefUnits
+zaxisInqName = _CdiLib.zaxisInqName
+zaxisInqLongname = _CdiLib.zaxisInqLongname
+zaxisInqUnits = _CdiLib.zaxisInqUnits
+zaxisDefPrec = _CdiLib.zaxisDefPrec
+zaxisInqPrec = _CdiLib.zaxisInqPrec
+zaxisDefLtype = _CdiLib.zaxisDefLtype
+zaxisInqLtype = _CdiLib.zaxisInqLtype
+zaxisInqLevelsPtr = _CdiLib.zaxisInqLevelsPtr
+zaxisDefVct = _CdiLib.zaxisDefVct
+zaxisInqVctSize = _CdiLib.zaxisInqVctSize
+zaxisInqVctPtr = _CdiLib.zaxisInqVctPtr
+zaxisInqLbounds = _CdiLib.zaxisInqLbounds
+zaxisInqUbounds = _CdiLib.zaxisInqUbounds
+zaxisInqWeights = _CdiLib.zaxisInqWeights
+zaxisInqLbound = _CdiLib.zaxisInqLbound
+zaxisInqUbound = _CdiLib.zaxisInqUbound
+zaxisDefLbounds = _CdiLib.zaxisDefLbounds
+zaxisDefUbounds = _CdiLib.zaxisDefUbounds
+zaxisDefWeights = _CdiLib.zaxisDefWeights
+zaxisChangeType = _CdiLib.zaxisChangeType
+taxisCreate = _CdiLib.taxisCreate
+taxisDestroy = _CdiLib.taxisDestroy
+taxisDuplicate = _CdiLib.taxisDuplicate
+taxisCopyTimestep = _CdiLib.taxisCopyTimestep
+taxisDefType = _CdiLib.taxisDefType
+taxisDefVdate = _CdiLib.taxisDefVdate
+taxisDefVtime = _CdiLib.taxisDefVtime
+taxisDefRdate = _CdiLib.taxisDefRdate
+taxisDefRtime = _CdiLib.taxisDefRtime
+taxisHasBounds = _CdiLib.taxisHasBounds
+taxisDefVdateBounds = _CdiLib.taxisDefVdateBounds
+taxisDefVtimeBounds = _CdiLib.taxisDefVtimeBounds
+taxisInqVdateBounds = _CdiLib.taxisInqVdateBounds
+taxisInqVtimeBounds = _CdiLib.taxisInqVtimeBounds
+taxisDefCalendar = _CdiLib.taxisDefCalendar
+taxisDefTunit = _CdiLib.taxisDefTunit
+taxisDefNumavg = _CdiLib.taxisDefNumavg
+taxisInqType = _CdiLib.taxisInqType
+taxisInqVdate = _CdiLib.taxisInqVdate
+taxisInqVtime = _CdiLib.taxisInqVtime
+taxisInqRdate = _CdiLib.taxisInqRdate
+taxisInqRtime = _CdiLib.taxisInqRtime
+taxisInqCalendar = _CdiLib.taxisInqCalendar
+taxisInqTunit = _CdiLib.taxisInqTunit
+taxisInqNumavg = _CdiLib.taxisInqNumavg
+tunitNamePtr = _CdiLib.tunitNamePtr
+institutDef = _CdiLib.institutDef
+institutInq = _CdiLib.institutInq
+institutInqNumber = _CdiLib.institutInqNumber
+institutInqCenter = _CdiLib.institutInqCenter
+institutInqSubcenter = _CdiLib.institutInqSubcenter
+institutInqNamePtr = _CdiLib.institutInqNamePtr
+institutInqLongnamePtr = _CdiLib.institutInqLongnamePtr
+modelDef = _CdiLib.modelDef
+modelInq = _CdiLib.modelInq
+modelInqInstitut = _CdiLib.modelInqInstitut
+modelInqGribID = _CdiLib.modelInqGribID
+modelInqNamePtr = _CdiLib.modelInqNamePtr
+tableWriteC = _CdiLib.tableWriteC
+tableWrite = _CdiLib.tableWrite
+tableRead = _CdiLib.tableRead
+tableDef = _CdiLib.tableDef
+tableInqNamePtr = _CdiLib.tableInqNamePtr
+tableDefEntry = _CdiLib.tableDefEntry
+tableInq = _CdiLib.tableInq
+tableInqNumber = _CdiLib.tableInqNumber
+tableInqNum = _CdiLib.tableInqNum
+tableInqModel = _CdiLib.tableInqModel
+tableInqPar = _CdiLib.tableInqPar
+tableInqParCode = _CdiLib.tableInqParCode
+tableInqParName = _CdiLib.tableInqParName
+tableInqParLongname = _CdiLib.tableInqParLongname
+tableInqParUnits = _CdiLib.tableInqParUnits
+tableInqParNamePtr = _CdiLib.tableInqParNamePtr
+tableInqParLongnamePtr = _CdiLib.tableInqParLongnamePtr
+tableInqParUnitsPtr = _CdiLib.tableInqParUnitsPtr
+streamDefHistory = _CdiLib.streamDefHistory
+streamInqHistorySize = _CdiLib.streamInqHistorySize
+streamInqHistoryString = _CdiLib.streamInqHistoryString
+
+
diff --git a/libcdi/interfaces/python/CdiObj.py b/libcdi/interfaces/python/CdiObj.py
new file mode 100644
index 0000000..241d17d
--- /dev/null
+++ b/libcdi/interfaces/python/CdiObj.py
@@ -0,0 +1,929 @@
+# This file was automatically generated by SWIG (http://www.swig.org).
+# Version 2.0.4
+#
+# Do not make changes to this file unless you know what you are doing--modify
+# the SWIG interface file instead.
+
+
+
+from sys import version_info
+if version_info >= (2,6,0):
+    def swig_import_helper():
+        from os.path import dirname
+        import imp
+        fp = None
+        try:
+            fp, pathname, description = imp.find_module('_CdiObj', [dirname(__file__)])
+        except ImportError:
+            import _CdiObj
+            return _CdiObj
+        if fp is not None:
+            try:
+                _mod = imp.load_module('_CdiObj', fp, pathname, description)
+            finally:
+                fp.close()
+            return _mod
+    _CdiObj = swig_import_helper()
+    del swig_import_helper
+else:
+    import _CdiObj
+del version_info
+try:
+    _swig_property = property
+except NameError:
+    pass # Python < 2.2 doesn't have 'property'.
+def _swig_setattr_nondynamic(self,class_type,name,value,static=1):
+    if (name == "thisown"): return self.this.own(value)
+    if (name == "this"):
+        if type(value).__name__ == 'SwigPyObject':
+            self.__dict__[name] = value
+            return
+    method = class_type.__swig_setmethods__.get(name,None)
+    if method: return method(self,value)
+    if (not static):
+        self.__dict__[name] = value
+    else:
+        raise AttributeError("You cannot add attributes to %s" % self)
+
+def _swig_setattr(self,class_type,name,value):
+    return _swig_setattr_nondynamic(self,class_type,name,value,0)
+
+def _swig_getattr(self,class_type,name):
+    if (name == "thisown"): return self.this.own()
+    method = class_type.__swig_getmethods__.get(name,None)
+    if method: return method(self)
+    raise AttributeError(name)
+
+def _swig_repr(self):
+    try: strthis = "proxy of " + self.this.__repr__()
+    except: strthis = ""
+    return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,)
+
+try:
+    _object = object
+    _newclass = 1
+except AttributeError:
+    class _object : pass
+    _newclass = 0
+
+
+class SwigPyIterator(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, SwigPyIterator, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, SwigPyIterator, name)
+    def __init__(self, *args, **kwargs): raise AttributeError("No constructor defined - class is abstract")
+    __repr__ = _swig_repr
+    __swig_destroy__ = _CdiObj.delete_SwigPyIterator
+    __del__ = lambda self : None;
+    def value(self): return _CdiObj.SwigPyIterator_value(self)
+    def incr(self, n = 1): return _CdiObj.SwigPyIterator_incr(self, n)
+    def decr(self, n = 1): return _CdiObj.SwigPyIterator_decr(self, n)
+    def distance(self, *args): return _CdiObj.SwigPyIterator_distance(self, *args)
+    def equal(self, *args): return _CdiObj.SwigPyIterator_equal(self, *args)
+    def copy(self): return _CdiObj.SwigPyIterator_copy(self)
+    def next(self): return _CdiObj.SwigPyIterator_next(self)
+    def __next__(self): return _CdiObj.SwigPyIterator___next__(self)
+    def previous(self): return _CdiObj.SwigPyIterator_previous(self)
+    def advance(self, *args): return _CdiObj.SwigPyIterator_advance(self, *args)
+    def __eq__(self, *args): return _CdiObj.SwigPyIterator___eq__(self, *args)
+    def __ne__(self, *args): return _CdiObj.SwigPyIterator___ne__(self, *args)
+    def __iadd__(self, *args): return _CdiObj.SwigPyIterator___iadd__(self, *args)
+    def __isub__(self, *args): return _CdiObj.SwigPyIterator___isub__(self, *args)
+    def __add__(self, *args): return _CdiObj.SwigPyIterator___add__(self, *args)
+    def __sub__(self, *args): return _CdiObj.SwigPyIterator___sub__(self, *args)
+    def __iter__(self): return self
+SwigPyIterator_swigregister = _CdiObj.SwigPyIterator_swigregister
+SwigPyIterator_swigregister(SwigPyIterator)
+
+class IntVector(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, IntVector, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, IntVector, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _CdiObj.IntVector_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _CdiObj.IntVector___nonzero__(self)
+    def __bool__(self): return _CdiObj.IntVector___bool__(self)
+    def __len__(self): return _CdiObj.IntVector___len__(self)
+    def pop(self): return _CdiObj.IntVector_pop(self)
+    def __getslice__(self, *args): return _CdiObj.IntVector___getslice__(self, *args)
+    def __setslice__(self, *args): return _CdiObj.IntVector___setslice__(self, *args)
+    def __delslice__(self, *args): return _CdiObj.IntVector___delslice__(self, *args)
+    def __delitem__(self, *args): return _CdiObj.IntVector___delitem__(self, *args)
+    def __getitem__(self, *args): return _CdiObj.IntVector___getitem__(self, *args)
+    def __setitem__(self, *args): return _CdiObj.IntVector___setitem__(self, *args)
+    def append(self, *args): return _CdiObj.IntVector_append(self, *args)
+    def empty(self): return _CdiObj.IntVector_empty(self)
+    def size(self): return _CdiObj.IntVector_size(self)
+    def clear(self): return _CdiObj.IntVector_clear(self)
+    def swap(self, *args): return _CdiObj.IntVector_swap(self, *args)
+    def get_allocator(self): return _CdiObj.IntVector_get_allocator(self)
+    def begin(self): return _CdiObj.IntVector_begin(self)
+    def end(self): return _CdiObj.IntVector_end(self)
+    def rbegin(self): return _CdiObj.IntVector_rbegin(self)
+    def rend(self): return _CdiObj.IntVector_rend(self)
+    def pop_back(self): return _CdiObj.IntVector_pop_back(self)
+    def erase(self, *args): return _CdiObj.IntVector_erase(self, *args)
+    def __init__(self, *args): 
+        this = _CdiObj.new_IntVector(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def push_back(self, *args): return _CdiObj.IntVector_push_back(self, *args)
+    def front(self): return _CdiObj.IntVector_front(self)
+    def back(self): return _CdiObj.IntVector_back(self)
+    def assign(self, *args): return _CdiObj.IntVector_assign(self, *args)
+    def resize(self, *args): return _CdiObj.IntVector_resize(self, *args)
+    def insert(self, *args): return _CdiObj.IntVector_insert(self, *args)
+    def reserve(self, *args): return _CdiObj.IntVector_reserve(self, *args)
+    def capacity(self): return _CdiObj.IntVector_capacity(self)
+    __swig_destroy__ = _CdiObj.delete_IntVector
+    __del__ = lambda self : None;
+IntVector_swigregister = _CdiObj.IntVector_swigregister
+IntVector_swigregister(IntVector)
+
+class DoubleVector(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, DoubleVector, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, DoubleVector, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _CdiObj.DoubleVector_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _CdiObj.DoubleVector___nonzero__(self)
+    def __bool__(self): return _CdiObj.DoubleVector___bool__(self)
+    def __len__(self): return _CdiObj.DoubleVector___len__(self)
+    def pop(self): return _CdiObj.DoubleVector_pop(self)
+    def __getslice__(self, *args): return _CdiObj.DoubleVector___getslice__(self, *args)
+    def __setslice__(self, *args): return _CdiObj.DoubleVector___setslice__(self, *args)
+    def __delslice__(self, *args): return _CdiObj.DoubleVector___delslice__(self, *args)
+    def __delitem__(self, *args): return _CdiObj.DoubleVector___delitem__(self, *args)
+    def __getitem__(self, *args): return _CdiObj.DoubleVector___getitem__(self, *args)
+    def __setitem__(self, *args): return _CdiObj.DoubleVector___setitem__(self, *args)
+    def append(self, *args): return _CdiObj.DoubleVector_append(self, *args)
+    def empty(self): return _CdiObj.DoubleVector_empty(self)
+    def size(self): return _CdiObj.DoubleVector_size(self)
+    def clear(self): return _CdiObj.DoubleVector_clear(self)
+    def swap(self, *args): return _CdiObj.DoubleVector_swap(self, *args)
+    def get_allocator(self): return _CdiObj.DoubleVector_get_allocator(self)
+    def begin(self): return _CdiObj.DoubleVector_begin(self)
+    def end(self): return _CdiObj.DoubleVector_end(self)
+    def rbegin(self): return _CdiObj.DoubleVector_rbegin(self)
+    def rend(self): return _CdiObj.DoubleVector_rend(self)
+    def pop_back(self): return _CdiObj.DoubleVector_pop_back(self)
+    def erase(self, *args): return _CdiObj.DoubleVector_erase(self, *args)
+    def __init__(self, *args): 
+        this = _CdiObj.new_DoubleVector(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def push_back(self, *args): return _CdiObj.DoubleVector_push_back(self, *args)
+    def front(self): return _CdiObj.DoubleVector_front(self)
+    def back(self): return _CdiObj.DoubleVector_back(self)
+    def assign(self, *args): return _CdiObj.DoubleVector_assign(self, *args)
+    def resize(self, *args): return _CdiObj.DoubleVector_resize(self, *args)
+    def insert(self, *args): return _CdiObj.DoubleVector_insert(self, *args)
+    def reserve(self, *args): return _CdiObj.DoubleVector_reserve(self, *args)
+    def capacity(self): return _CdiObj.DoubleVector_capacity(self)
+    __swig_destroy__ = _CdiObj.delete_DoubleVector
+    __del__ = lambda self : None;
+DoubleVector_swigregister = _CdiObj.DoubleVector_swigregister
+DoubleVector_swigregister(DoubleVector)
+
+class DoubleDoubleVector(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, DoubleDoubleVector, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, DoubleDoubleVector, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _CdiObj.DoubleDoubleVector_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _CdiObj.DoubleDoubleVector___nonzero__(self)
+    def __bool__(self): return _CdiObj.DoubleDoubleVector___bool__(self)
+    def __len__(self): return _CdiObj.DoubleDoubleVector___len__(self)
+    def pop(self): return _CdiObj.DoubleDoubleVector_pop(self)
+    def __getslice__(self, *args): return _CdiObj.DoubleDoubleVector___getslice__(self, *args)
+    def __setslice__(self, *args): return _CdiObj.DoubleDoubleVector___setslice__(self, *args)
+    def __delslice__(self, *args): return _CdiObj.DoubleDoubleVector___delslice__(self, *args)
+    def __delitem__(self, *args): return _CdiObj.DoubleDoubleVector___delitem__(self, *args)
+    def __getitem__(self, *args): return _CdiObj.DoubleDoubleVector___getitem__(self, *args)
+    def __setitem__(self, *args): return _CdiObj.DoubleDoubleVector___setitem__(self, *args)
+    def append(self, *args): return _CdiObj.DoubleDoubleVector_append(self, *args)
+    def empty(self): return _CdiObj.DoubleDoubleVector_empty(self)
+    def size(self): return _CdiObj.DoubleDoubleVector_size(self)
+    def clear(self): return _CdiObj.DoubleDoubleVector_clear(self)
+    def swap(self, *args): return _CdiObj.DoubleDoubleVector_swap(self, *args)
+    def get_allocator(self): return _CdiObj.DoubleDoubleVector_get_allocator(self)
+    def begin(self): return _CdiObj.DoubleDoubleVector_begin(self)
+    def end(self): return _CdiObj.DoubleDoubleVector_end(self)
+    def rbegin(self): return _CdiObj.DoubleDoubleVector_rbegin(self)
+    def rend(self): return _CdiObj.DoubleDoubleVector_rend(self)
+    def pop_back(self): return _CdiObj.DoubleDoubleVector_pop_back(self)
+    def erase(self, *args): return _CdiObj.DoubleDoubleVector_erase(self, *args)
+    def __init__(self, *args): 
+        this = _CdiObj.new_DoubleDoubleVector(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def push_back(self, *args): return _CdiObj.DoubleDoubleVector_push_back(self, *args)
+    def front(self): return _CdiObj.DoubleDoubleVector_front(self)
+    def back(self): return _CdiObj.DoubleDoubleVector_back(self)
+    def assign(self, *args): return _CdiObj.DoubleDoubleVector_assign(self, *args)
+    def resize(self, *args): return _CdiObj.DoubleDoubleVector_resize(self, *args)
+    def insert(self, *args): return _CdiObj.DoubleDoubleVector_insert(self, *args)
+    def reserve(self, *args): return _CdiObj.DoubleDoubleVector_reserve(self, *args)
+    def capacity(self): return _CdiObj.DoubleDoubleVector_capacity(self)
+    __swig_destroy__ = _CdiObj.delete_DoubleDoubleVector
+    __del__ = lambda self : None;
+DoubleDoubleVector_swigregister = _CdiObj.DoubleDoubleVector_swigregister
+DoubleDoubleVector_swigregister(DoubleDoubleVector)
+
+class StringVector(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, StringVector, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, StringVector, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _CdiObj.StringVector_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _CdiObj.StringVector___nonzero__(self)
+    def __bool__(self): return _CdiObj.StringVector___bool__(self)
+    def __len__(self): return _CdiObj.StringVector___len__(self)
+    def pop(self): return _CdiObj.StringVector_pop(self)
+    def __getslice__(self, *args): return _CdiObj.StringVector___getslice__(self, *args)
+    def __setslice__(self, *args): return _CdiObj.StringVector___setslice__(self, *args)
+    def __delslice__(self, *args): return _CdiObj.StringVector___delslice__(self, *args)
+    def __delitem__(self, *args): return _CdiObj.StringVector___delitem__(self, *args)
+    def __getitem__(self, *args): return _CdiObj.StringVector___getitem__(self, *args)
+    def __setitem__(self, *args): return _CdiObj.StringVector___setitem__(self, *args)
+    def append(self, *args): return _CdiObj.StringVector_append(self, *args)
+    def empty(self): return _CdiObj.StringVector_empty(self)
+    def size(self): return _CdiObj.StringVector_size(self)
+    def clear(self): return _CdiObj.StringVector_clear(self)
+    def swap(self, *args): return _CdiObj.StringVector_swap(self, *args)
+    def get_allocator(self): return _CdiObj.StringVector_get_allocator(self)
+    def begin(self): return _CdiObj.StringVector_begin(self)
+    def end(self): return _CdiObj.StringVector_end(self)
+    def rbegin(self): return _CdiObj.StringVector_rbegin(self)
+    def rend(self): return _CdiObj.StringVector_rend(self)
+    def pop_back(self): return _CdiObj.StringVector_pop_back(self)
+    def erase(self, *args): return _CdiObj.StringVector_erase(self, *args)
+    def __init__(self, *args): 
+        this = _CdiObj.new_StringVector(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def push_back(self, *args): return _CdiObj.StringVector_push_back(self, *args)
+    def front(self): return _CdiObj.StringVector_front(self)
+    def back(self): return _CdiObj.StringVector_back(self)
+    def assign(self, *args): return _CdiObj.StringVector_assign(self, *args)
+    def resize(self, *args): return _CdiObj.StringVector_resize(self, *args)
+    def insert(self, *args): return _CdiObj.StringVector_insert(self, *args)
+    def reserve(self, *args): return _CdiObj.StringVector_reserve(self, *args)
+    def capacity(self): return _CdiObj.StringVector_capacity(self)
+    __swig_destroy__ = _CdiObj.delete_StringVector
+    __del__ = lambda self : None;
+StringVector_swigregister = _CdiObj.StringVector_swigregister
+StringVector_swigregister(StringVector)
+
+class VarsVector(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, VarsVector, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, VarsVector, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _CdiObj.VarsVector_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _CdiObj.VarsVector___nonzero__(self)
+    def __bool__(self): return _CdiObj.VarsVector___bool__(self)
+    def __len__(self): return _CdiObj.VarsVector___len__(self)
+    def pop(self): return _CdiObj.VarsVector_pop(self)
+    def __getslice__(self, *args): return _CdiObj.VarsVector___getslice__(self, *args)
+    def __setslice__(self, *args): return _CdiObj.VarsVector___setslice__(self, *args)
+    def __delslice__(self, *args): return _CdiObj.VarsVector___delslice__(self, *args)
+    def __delitem__(self, *args): return _CdiObj.VarsVector___delitem__(self, *args)
+    def __getitem__(self, *args): return _CdiObj.VarsVector___getitem__(self, *args)
+    def __setitem__(self, *args): return _CdiObj.VarsVector___setitem__(self, *args)
+    def append(self, *args): return _CdiObj.VarsVector_append(self, *args)
+    def empty(self): return _CdiObj.VarsVector_empty(self)
+    def size(self): return _CdiObj.VarsVector_size(self)
+    def clear(self): return _CdiObj.VarsVector_clear(self)
+    def swap(self, *args): return _CdiObj.VarsVector_swap(self, *args)
+    def get_allocator(self): return _CdiObj.VarsVector_get_allocator(self)
+    def begin(self): return _CdiObj.VarsVector_begin(self)
+    def end(self): return _CdiObj.VarsVector_end(self)
+    def rbegin(self): return _CdiObj.VarsVector_rbegin(self)
+    def rend(self): return _CdiObj.VarsVector_rend(self)
+    def pop_back(self): return _CdiObj.VarsVector_pop_back(self)
+    def erase(self, *args): return _CdiObj.VarsVector_erase(self, *args)
+    def __init__(self, *args): 
+        this = _CdiObj.new_VarsVector(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def push_back(self, *args): return _CdiObj.VarsVector_push_back(self, *args)
+    def front(self): return _CdiObj.VarsVector_front(self)
+    def back(self): return _CdiObj.VarsVector_back(self)
+    def assign(self, *args): return _CdiObj.VarsVector_assign(self, *args)
+    def resize(self, *args): return _CdiObj.VarsVector_resize(self, *args)
+    def insert(self, *args): return _CdiObj.VarsVector_insert(self, *args)
+    def reserve(self, *args): return _CdiObj.VarsVector_reserve(self, *args)
+    def capacity(self): return _CdiObj.VarsVector_capacity(self)
+    __swig_destroy__ = _CdiObj.delete_VarsVector
+    __del__ = lambda self : None;
+VarsVector_swigregister = _CdiObj.VarsVector_swigregister
+VarsVector_swigregister(VarsVector)
+
+class VarsMap(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, VarsMap, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, VarsMap, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _CdiObj.VarsMap_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _CdiObj.VarsMap___nonzero__(self)
+    def __bool__(self): return _CdiObj.VarsMap___bool__(self)
+    def __len__(self): return _CdiObj.VarsMap___len__(self)
+    def __iter__(self): return self.key_iterator()
+    def iterkeys(self): return self.key_iterator()
+    def itervalues(self): return self.value_iterator()
+    def iteritems(self): return self.iterator()
+    def __getitem__(self, *args): return _CdiObj.VarsMap___getitem__(self, *args)
+    def __delitem__(self, *args): return _CdiObj.VarsMap___delitem__(self, *args)
+    def has_key(self, *args): return _CdiObj.VarsMap_has_key(self, *args)
+    def keys(self): return _CdiObj.VarsMap_keys(self)
+    def values(self): return _CdiObj.VarsMap_values(self)
+    def items(self): return _CdiObj.VarsMap_items(self)
+    def __contains__(self, *args): return _CdiObj.VarsMap___contains__(self, *args)
+    def key_iterator(self): return _CdiObj.VarsMap_key_iterator(self)
+    def value_iterator(self): return _CdiObj.VarsMap_value_iterator(self)
+    def __setitem__(self, *args): return _CdiObj.VarsMap___setitem__(self, *args)
+    def asdict(self): return _CdiObj.VarsMap_asdict(self)
+    def __init__(self, *args): 
+        this = _CdiObj.new_VarsMap(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def empty(self): return _CdiObj.VarsMap_empty(self)
+    def size(self): return _CdiObj.VarsMap_size(self)
+    def clear(self): return _CdiObj.VarsMap_clear(self)
+    def swap(self, *args): return _CdiObj.VarsMap_swap(self, *args)
+    def get_allocator(self): return _CdiObj.VarsMap_get_allocator(self)
+    def begin(self): return _CdiObj.VarsMap_begin(self)
+    def end(self): return _CdiObj.VarsMap_end(self)
+    def rbegin(self): return _CdiObj.VarsMap_rbegin(self)
+    def rend(self): return _CdiObj.VarsMap_rend(self)
+    def count(self, *args): return _CdiObj.VarsMap_count(self, *args)
+    def erase(self, *args): return _CdiObj.VarsMap_erase(self, *args)
+    def find(self, *args): return _CdiObj.VarsMap_find(self, *args)
+    def lower_bound(self, *args): return _CdiObj.VarsMap_lower_bound(self, *args)
+    def upper_bound(self, *args): return _CdiObj.VarsMap_upper_bound(self, *args)
+    __swig_destroy__ = _CdiObj.delete_VarsMap
+    __del__ = lambda self : None;
+VarsMap_swigregister = _CdiObj.VarsMap_swigregister
+VarsMap_swigregister(VarsMap)
+
+class VarsByCode(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, VarsByCode, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, VarsByCode, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _CdiObj.VarsByCode_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _CdiObj.VarsByCode___nonzero__(self)
+    def __bool__(self): return _CdiObj.VarsByCode___bool__(self)
+    def __len__(self): return _CdiObj.VarsByCode___len__(self)
+    def __iter__(self): return self.key_iterator()
+    def iterkeys(self): return self.key_iterator()
+    def itervalues(self): return self.value_iterator()
+    def iteritems(self): return self.iterator()
+    def __getitem__(self, *args): return _CdiObj.VarsByCode___getitem__(self, *args)
+    def __delitem__(self, *args): return _CdiObj.VarsByCode___delitem__(self, *args)
+    def has_key(self, *args): return _CdiObj.VarsByCode_has_key(self, *args)
+    def keys(self): return _CdiObj.VarsByCode_keys(self)
+    def values(self): return _CdiObj.VarsByCode_values(self)
+    def items(self): return _CdiObj.VarsByCode_items(self)
+    def __contains__(self, *args): return _CdiObj.VarsByCode___contains__(self, *args)
+    def key_iterator(self): return _CdiObj.VarsByCode_key_iterator(self)
+    def value_iterator(self): return _CdiObj.VarsByCode_value_iterator(self)
+    def __setitem__(self, *args): return _CdiObj.VarsByCode___setitem__(self, *args)
+    def asdict(self): return _CdiObj.VarsByCode_asdict(self)
+    def __init__(self, *args): 
+        this = _CdiObj.new_VarsByCode(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def empty(self): return _CdiObj.VarsByCode_empty(self)
+    def size(self): return _CdiObj.VarsByCode_size(self)
+    def clear(self): return _CdiObj.VarsByCode_clear(self)
+    def swap(self, *args): return _CdiObj.VarsByCode_swap(self, *args)
+    def get_allocator(self): return _CdiObj.VarsByCode_get_allocator(self)
+    def begin(self): return _CdiObj.VarsByCode_begin(self)
+    def end(self): return _CdiObj.VarsByCode_end(self)
+    def rbegin(self): return _CdiObj.VarsByCode_rbegin(self)
+    def rend(self): return _CdiObj.VarsByCode_rend(self)
+    def count(self, *args): return _CdiObj.VarsByCode_count(self, *args)
+    def erase(self, *args): return _CdiObj.VarsByCode_erase(self, *args)
+    def find(self, *args): return _CdiObj.VarsByCode_find(self, *args)
+    def lower_bound(self, *args): return _CdiObj.VarsByCode_lower_bound(self, *args)
+    def upper_bound(self, *args): return _CdiObj.VarsByCode_upper_bound(self, *args)
+    __swig_destroy__ = _CdiObj.delete_VarsByCode
+    __del__ = lambda self : None;
+VarsByCode_swigregister = _CdiObj.VarsByCode_swigregister
+VarsByCode_swigregister(VarsByCode)
+
+class TaxesMap(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, TaxesMap, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, TaxesMap, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _CdiObj.TaxesMap_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _CdiObj.TaxesMap___nonzero__(self)
+    def __bool__(self): return _CdiObj.TaxesMap___bool__(self)
+    def __len__(self): return _CdiObj.TaxesMap___len__(self)
+    def __iter__(self): return self.key_iterator()
+    def iterkeys(self): return self.key_iterator()
+    def itervalues(self): return self.value_iterator()
+    def iteritems(self): return self.iterator()
+    def __getitem__(self, *args): return _CdiObj.TaxesMap___getitem__(self, *args)
+    def __delitem__(self, *args): return _CdiObj.TaxesMap___delitem__(self, *args)
+    def has_key(self, *args): return _CdiObj.TaxesMap_has_key(self, *args)
+    def keys(self): return _CdiObj.TaxesMap_keys(self)
+    def values(self): return _CdiObj.TaxesMap_values(self)
+    def items(self): return _CdiObj.TaxesMap_items(self)
+    def __contains__(self, *args): return _CdiObj.TaxesMap___contains__(self, *args)
+    def key_iterator(self): return _CdiObj.TaxesMap_key_iterator(self)
+    def value_iterator(self): return _CdiObj.TaxesMap_value_iterator(self)
+    def __setitem__(self, *args): return _CdiObj.TaxesMap___setitem__(self, *args)
+    def asdict(self): return _CdiObj.TaxesMap_asdict(self)
+    def __init__(self, *args): 
+        this = _CdiObj.new_TaxesMap(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def empty(self): return _CdiObj.TaxesMap_empty(self)
+    def size(self): return _CdiObj.TaxesMap_size(self)
+    def clear(self): return _CdiObj.TaxesMap_clear(self)
+    def swap(self, *args): return _CdiObj.TaxesMap_swap(self, *args)
+    def get_allocator(self): return _CdiObj.TaxesMap_get_allocator(self)
+    def begin(self): return _CdiObj.TaxesMap_begin(self)
+    def end(self): return _CdiObj.TaxesMap_end(self)
+    def rbegin(self): return _CdiObj.TaxesMap_rbegin(self)
+    def rend(self): return _CdiObj.TaxesMap_rend(self)
+    def count(self, *args): return _CdiObj.TaxesMap_count(self, *args)
+    def erase(self, *args): return _CdiObj.TaxesMap_erase(self, *args)
+    def find(self, *args): return _CdiObj.TaxesMap_find(self, *args)
+    def lower_bound(self, *args): return _CdiObj.TaxesMap_lower_bound(self, *args)
+    def upper_bound(self, *args): return _CdiObj.TaxesMap_upper_bound(self, *args)
+    __swig_destroy__ = _CdiObj.delete_TaxesMap
+    __del__ = lambda self : None;
+TaxesMap_swigregister = _CdiObj.TaxesMap_swigregister
+TaxesMap_swigregister(TaxesMap)
+
+class ZaxesMap(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, ZaxesMap, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, ZaxesMap, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _CdiObj.ZaxesMap_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _CdiObj.ZaxesMap___nonzero__(self)
+    def __bool__(self): return _CdiObj.ZaxesMap___bool__(self)
+    def __len__(self): return _CdiObj.ZaxesMap___len__(self)
+    def __iter__(self): return self.key_iterator()
+    def iterkeys(self): return self.key_iterator()
+    def itervalues(self): return self.value_iterator()
+    def iteritems(self): return self.iterator()
+    def __getitem__(self, *args): return _CdiObj.ZaxesMap___getitem__(self, *args)
+    def __delitem__(self, *args): return _CdiObj.ZaxesMap___delitem__(self, *args)
+    def has_key(self, *args): return _CdiObj.ZaxesMap_has_key(self, *args)
+    def keys(self): return _CdiObj.ZaxesMap_keys(self)
+    def values(self): return _CdiObj.ZaxesMap_values(self)
+    def items(self): return _CdiObj.ZaxesMap_items(self)
+    def __contains__(self, *args): return _CdiObj.ZaxesMap___contains__(self, *args)
+    def key_iterator(self): return _CdiObj.ZaxesMap_key_iterator(self)
+    def value_iterator(self): return _CdiObj.ZaxesMap_value_iterator(self)
+    def __setitem__(self, *args): return _CdiObj.ZaxesMap___setitem__(self, *args)
+    def asdict(self): return _CdiObj.ZaxesMap_asdict(self)
+    def __init__(self, *args): 
+        this = _CdiObj.new_ZaxesMap(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def empty(self): return _CdiObj.ZaxesMap_empty(self)
+    def size(self): return _CdiObj.ZaxesMap_size(self)
+    def clear(self): return _CdiObj.ZaxesMap_clear(self)
+    def swap(self, *args): return _CdiObj.ZaxesMap_swap(self, *args)
+    def get_allocator(self): return _CdiObj.ZaxesMap_get_allocator(self)
+    def begin(self): return _CdiObj.ZaxesMap_begin(self)
+    def end(self): return _CdiObj.ZaxesMap_end(self)
+    def rbegin(self): return _CdiObj.ZaxesMap_rbegin(self)
+    def rend(self): return _CdiObj.ZaxesMap_rend(self)
+    def count(self, *args): return _CdiObj.ZaxesMap_count(self, *args)
+    def erase(self, *args): return _CdiObj.ZaxesMap_erase(self, *args)
+    def find(self, *args): return _CdiObj.ZaxesMap_find(self, *args)
+    def lower_bound(self, *args): return _CdiObj.ZaxesMap_lower_bound(self, *args)
+    def upper_bound(self, *args): return _CdiObj.ZaxesMap_upper_bound(self, *args)
+    __swig_destroy__ = _CdiObj.delete_ZaxesMap
+    __del__ = lambda self : None;
+ZaxesMap_swigregister = _CdiObj.ZaxesMap_swigregister
+ZaxesMap_swigregister(ZaxesMap)
+
+class GridsMap(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, GridsMap, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, GridsMap, name)
+    __repr__ = _swig_repr
+    def iterator(self): return _CdiObj.GridsMap_iterator(self)
+    def __iter__(self): return self.iterator()
+    def __nonzero__(self): return _CdiObj.GridsMap___nonzero__(self)
+    def __bool__(self): return _CdiObj.GridsMap___bool__(self)
+    def __len__(self): return _CdiObj.GridsMap___len__(self)
+    def __iter__(self): return self.key_iterator()
+    def iterkeys(self): return self.key_iterator()
+    def itervalues(self): return self.value_iterator()
+    def iteritems(self): return self.iterator()
+    def __getitem__(self, *args): return _CdiObj.GridsMap___getitem__(self, *args)
+    def __delitem__(self, *args): return _CdiObj.GridsMap___delitem__(self, *args)
+    def has_key(self, *args): return _CdiObj.GridsMap_has_key(self, *args)
+    def keys(self): return _CdiObj.GridsMap_keys(self)
+    def values(self): return _CdiObj.GridsMap_values(self)
+    def items(self): return _CdiObj.GridsMap_items(self)
+    def __contains__(self, *args): return _CdiObj.GridsMap___contains__(self, *args)
+    def key_iterator(self): return _CdiObj.GridsMap_key_iterator(self)
+    def value_iterator(self): return _CdiObj.GridsMap_value_iterator(self)
+    def __setitem__(self, *args): return _CdiObj.GridsMap___setitem__(self, *args)
+    def asdict(self): return _CdiObj.GridsMap_asdict(self)
+    def __init__(self, *args): 
+        this = _CdiObj.new_GridsMap(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    def empty(self): return _CdiObj.GridsMap_empty(self)
+    def size(self): return _CdiObj.GridsMap_size(self)
+    def clear(self): return _CdiObj.GridsMap_clear(self)
+    def swap(self, *args): return _CdiObj.GridsMap_swap(self, *args)
+    def get_allocator(self): return _CdiObj.GridsMap_get_allocator(self)
+    def begin(self): return _CdiObj.GridsMap_begin(self)
+    def end(self): return _CdiObj.GridsMap_end(self)
+    def rbegin(self): return _CdiObj.GridsMap_rbegin(self)
+    def rend(self): return _CdiObj.GridsMap_rend(self)
+    def count(self, *args): return _CdiObj.GridsMap_count(self, *args)
+    def erase(self, *args): return _CdiObj.GridsMap_erase(self, *args)
+    def find(self, *args): return _CdiObj.GridsMap_find(self, *args)
+    def lower_bound(self, *args): return _CdiObj.GridsMap_lower_bound(self, *args)
+    def upper_bound(self, *args): return _CdiObj.GridsMap_upper_bound(self, *args)
+    __swig_destroy__ = _CdiObj.delete_GridsMap
+    __del__ = lambda self : None;
+GridsMap_swigregister = _CdiObj.GridsMap_swigregister
+GridsMap_swigregister(GridsMap)
+
+CHARSIZE = _CdiObj.CHARSIZE
+class CdiGrid(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, CdiGrid, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, CdiGrid, name)
+    __repr__ = _swig_repr
+    def __init__(self, *args): 
+        this = _CdiObj.new_CdiGrid(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _CdiObj.delete_CdiGrid
+    __del__ = lambda self : None;
+    __swig_setmethods__["gridID"] = _CdiObj.CdiGrid_gridID_set
+    __swig_getmethods__["gridID"] = _CdiObj.CdiGrid_gridID_get
+    if _newclass:gridID = _swig_property(_CdiObj.CdiGrid_gridID_get, _CdiObj.CdiGrid_gridID_set)
+    __swig_setmethods__["type"] = _CdiObj.CdiGrid_type_set
+    __swig_getmethods__["type"] = _CdiObj.CdiGrid_type_get
+    if _newclass:type = _swig_property(_CdiObj.CdiGrid_type_get, _CdiObj.CdiGrid_type_set)
+    __swig_setmethods__["size"] = _CdiObj.CdiGrid_size_set
+    __swig_getmethods__["size"] = _CdiObj.CdiGrid_size_get
+    if _newclass:size = _swig_property(_CdiObj.CdiGrid_size_get, _CdiObj.CdiGrid_size_set)
+    __swig_setmethods__["xsize"] = _CdiObj.CdiGrid_xsize_set
+    __swig_getmethods__["xsize"] = _CdiObj.CdiGrid_xsize_get
+    if _newclass:xsize = _swig_property(_CdiObj.CdiGrid_xsize_get, _CdiObj.CdiGrid_xsize_set)
+    __swig_setmethods__["ysize"] = _CdiObj.CdiGrid_ysize_set
+    __swig_getmethods__["ysize"] = _CdiObj.CdiGrid_ysize_get
+    if _newclass:ysize = _swig_property(_CdiObj.CdiGrid_ysize_get, _CdiObj.CdiGrid_ysize_set)
+    __swig_setmethods__["prec"] = _CdiObj.CdiGrid_prec_set
+    __swig_getmethods__["prec"] = _CdiObj.CdiGrid_prec_get
+    if _newclass:prec = _swig_property(_CdiObj.CdiGrid_prec_get, _CdiObj.CdiGrid_prec_set)
+    __swig_setmethods__["ncorner"] = _CdiObj.CdiGrid_ncorner_set
+    __swig_getmethods__["ncorner"] = _CdiObj.CdiGrid_ncorner_get
+    if _newclass:ncorner = _swig_property(_CdiObj.CdiGrid_ncorner_get, _CdiObj.CdiGrid_ncorner_set)
+    __swig_setmethods__["hasXValues"] = _CdiObj.CdiGrid_hasXValues_set
+    __swig_getmethods__["hasXValues"] = _CdiObj.CdiGrid_hasXValues_get
+    if _newclass:hasXValues = _swig_property(_CdiObj.CdiGrid_hasXValues_get, _CdiObj.CdiGrid_hasXValues_set)
+    __swig_setmethods__["hasYValues"] = _CdiObj.CdiGrid_hasYValues_set
+    __swig_getmethods__["hasYValues"] = _CdiObj.CdiGrid_hasYValues_get
+    if _newclass:hasYValues = _swig_property(_CdiObj.CdiGrid_hasYValues_get, _CdiObj.CdiGrid_hasYValues_set)
+    __swig_setmethods__["hasBounds"] = _CdiObj.CdiGrid_hasBounds_set
+    __swig_getmethods__["hasBounds"] = _CdiObj.CdiGrid_hasBounds_get
+    if _newclass:hasBounds = _swig_property(_CdiObj.CdiGrid_hasBounds_get, _CdiObj.CdiGrid_hasBounds_set)
+    __swig_setmethods__["xvalues"] = _CdiObj.CdiGrid_xvalues_set
+    __swig_getmethods__["xvalues"] = _CdiObj.CdiGrid_xvalues_get
+    if _newclass:xvalues = _swig_property(_CdiObj.CdiGrid_xvalues_get, _CdiObj.CdiGrid_xvalues_set)
+    __swig_setmethods__["yvalues"] = _CdiObj.CdiGrid_yvalues_set
+    __swig_getmethods__["yvalues"] = _CdiObj.CdiGrid_yvalues_get
+    if _newclass:yvalues = _swig_property(_CdiObj.CdiGrid_yvalues_get, _CdiObj.CdiGrid_yvalues_set)
+    __swig_setmethods__["xbounds"] = _CdiObj.CdiGrid_xbounds_set
+    __swig_getmethods__["xbounds"] = _CdiObj.CdiGrid_xbounds_get
+    if _newclass:xbounds = _swig_property(_CdiObj.CdiGrid_xbounds_get, _CdiObj.CdiGrid_xbounds_set)
+    __swig_setmethods__["ybounds"] = _CdiObj.CdiGrid_ybounds_set
+    __swig_getmethods__["ybounds"] = _CdiObj.CdiGrid_ybounds_get
+    if _newclass:ybounds = _swig_property(_CdiObj.CdiGrid_ybounds_get, _CdiObj.CdiGrid_ybounds_set)
+    __swig_setmethods__["xname"] = _CdiObj.CdiGrid_xname_set
+    __swig_getmethods__["xname"] = _CdiObj.CdiGrid_xname_get
+    if _newclass:xname = _swig_property(_CdiObj.CdiGrid_xname_get, _CdiObj.CdiGrid_xname_set)
+    __swig_setmethods__["xlongname"] = _CdiObj.CdiGrid_xlongname_set
+    __swig_getmethods__["xlongname"] = _CdiObj.CdiGrid_xlongname_get
+    if _newclass:xlongname = _swig_property(_CdiObj.CdiGrid_xlongname_get, _CdiObj.CdiGrid_xlongname_set)
+    __swig_setmethods__["xstdname"] = _CdiObj.CdiGrid_xstdname_set
+    __swig_getmethods__["xstdname"] = _CdiObj.CdiGrid_xstdname_get
+    if _newclass:xstdname = _swig_property(_CdiObj.CdiGrid_xstdname_get, _CdiObj.CdiGrid_xstdname_set)
+    __swig_setmethods__["xunits"] = _CdiObj.CdiGrid_xunits_set
+    __swig_getmethods__["xunits"] = _CdiObj.CdiGrid_xunits_get
+    if _newclass:xunits = _swig_property(_CdiObj.CdiGrid_xunits_get, _CdiObj.CdiGrid_xunits_set)
+    __swig_setmethods__["yname"] = _CdiObj.CdiGrid_yname_set
+    __swig_getmethods__["yname"] = _CdiObj.CdiGrid_yname_get
+    if _newclass:yname = _swig_property(_CdiObj.CdiGrid_yname_get, _CdiObj.CdiGrid_yname_set)
+    __swig_setmethods__["ylongname"] = _CdiObj.CdiGrid_ylongname_set
+    __swig_getmethods__["ylongname"] = _CdiObj.CdiGrid_ylongname_get
+    if _newclass:ylongname = _swig_property(_CdiObj.CdiGrid_ylongname_get, _CdiObj.CdiGrid_ylongname_set)
+    __swig_setmethods__["ystdname"] = _CdiObj.CdiGrid_ystdname_set
+    __swig_getmethods__["ystdname"] = _CdiObj.CdiGrid_ystdname_get
+    if _newclass:ystdname = _swig_property(_CdiObj.CdiGrid_ystdname_get, _CdiObj.CdiGrid_ystdname_set)
+    __swig_setmethods__["yunits"] = _CdiObj.CdiGrid_yunits_set
+    __swig_getmethods__["yunits"] = _CdiObj.CdiGrid_yunits_get
+    if _newclass:yunits = _swig_property(_CdiObj.CdiGrid_yunits_get, _CdiObj.CdiGrid_yunits_set)
+    __swig_setmethods__["name"] = _CdiObj.CdiGrid_name_set
+    __swig_getmethods__["name"] = _CdiObj.CdiGrid_name_get
+    if _newclass:name = _swig_property(_CdiObj.CdiGrid_name_get, _CdiObj.CdiGrid_name_set)
+    def getValues(self): return _CdiObj.CdiGrid_getValues(self)
+    def getBounds(self): return _CdiObj.CdiGrid_getBounds(self)
+    def getValuesAsPointer(self, *args): return _CdiObj.CdiGrid_getValuesAsPointer(self, *args)
+    def getBoundsAsPointer(self, *args): return _CdiObj.CdiGrid_getBoundsAsPointer(self, *args)
+    def getFloatVals(self, *args): return _CdiObj.CdiGrid_getFloatVals(self, *args)
+    def getFloatBounds(self, *args): return _CdiObj.CdiGrid_getFloatBounds(self, *args)
+CdiGrid_swigregister = _CdiObj.CdiGrid_swigregister
+CdiGrid_swigregister(CdiGrid)
+
+class CdiTaxis(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, CdiTaxis, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, CdiTaxis, name)
+    __repr__ = _swig_repr
+    def __init__(self, *args): 
+        this = _CdiObj.new_CdiTaxis(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _CdiObj.delete_CdiTaxis
+    __del__ = lambda self : None;
+    __swig_setmethods__["taxisID"] = _CdiObj.CdiTaxis_taxisID_set
+    __swig_getmethods__["taxisID"] = _CdiObj.CdiTaxis_taxisID_get
+    if _newclass:taxisID = _swig_property(_CdiObj.CdiTaxis_taxisID_get, _CdiObj.CdiTaxis_taxisID_set)
+    __swig_setmethods__["ntsteps"] = _CdiObj.CdiTaxis_ntsteps_set
+    __swig_getmethods__["ntsteps"] = _CdiObj.CdiTaxis_ntsteps_get
+    if _newclass:ntsteps = _swig_property(_CdiObj.CdiTaxis_ntsteps_get, _CdiObj.CdiTaxis_ntsteps_set)
+    __swig_setmethods__["unit"] = _CdiObj.CdiTaxis_unit_set
+    __swig_getmethods__["unit"] = _CdiObj.CdiTaxis_unit_get
+    if _newclass:unit = _swig_property(_CdiObj.CdiTaxis_unit_get, _CdiObj.CdiTaxis_unit_set)
+    __swig_setmethods__["rdate"] = _CdiObj.CdiTaxis_rdate_set
+    __swig_getmethods__["rdate"] = _CdiObj.CdiTaxis_rdate_get
+    if _newclass:rdate = _swig_property(_CdiObj.CdiTaxis_rdate_get, _CdiObj.CdiTaxis_rdate_set)
+    __swig_setmethods__["rtime"] = _CdiObj.CdiTaxis_rtime_set
+    __swig_getmethods__["rtime"] = _CdiObj.CdiTaxis_rtime_get
+    if _newclass:rtime = _swig_property(_CdiObj.CdiTaxis_rtime_get, _CdiObj.CdiTaxis_rtime_set)
+    __swig_setmethods__["vdate"] = _CdiObj.CdiTaxis_vdate_set
+    __swig_getmethods__["vdate"] = _CdiObj.CdiTaxis_vdate_get
+    if _newclass:vdate = _swig_property(_CdiObj.CdiTaxis_vdate_get, _CdiObj.CdiTaxis_vdate_set)
+    __swig_setmethods__["vtime"] = _CdiObj.CdiTaxis_vtime_set
+    __swig_getmethods__["vtime"] = _CdiObj.CdiTaxis_vtime_get
+    if _newclass:vtime = _swig_property(_CdiObj.CdiTaxis_vtime_get, _CdiObj.CdiTaxis_vtime_set)
+    __swig_setmethods__["type"] = _CdiObj.CdiTaxis_type_set
+    __swig_getmethods__["type"] = _CdiObj.CdiTaxis_type_get
+    if _newclass:type = _swig_property(_CdiObj.CdiTaxis_type_get, _CdiObj.CdiTaxis_type_set)
+    __swig_setmethods__["calendar"] = _CdiObj.CdiTaxis_calendar_set
+    __swig_getmethods__["calendar"] = _CdiObj.CdiTaxis_calendar_get
+    if _newclass:calendar = _swig_property(_CdiObj.CdiTaxis_calendar_get, _CdiObj.CdiTaxis_calendar_set)
+    __swig_setmethods__["hasBounds"] = _CdiObj.CdiTaxis_hasBounds_set
+    __swig_getmethods__["hasBounds"] = _CdiObj.CdiTaxis_hasBounds_get
+    if _newclass:hasBounds = _swig_property(_CdiObj.CdiTaxis_hasBounds_get, _CdiObj.CdiTaxis_hasBounds_set)
+    __swig_setmethods__["name"] = _CdiObj.CdiTaxis_name_set
+    __swig_getmethods__["name"] = _CdiObj.CdiTaxis_name_get
+    if _newclass:name = _swig_property(_CdiObj.CdiTaxis_name_get, _CdiObj.CdiTaxis_name_set)
+    __swig_setmethods__["unitname"] = _CdiObj.CdiTaxis_unitname_set
+    __swig_getmethods__["unitname"] = _CdiObj.CdiTaxis_unitname_get
+    if _newclass:unitname = _swig_property(_CdiObj.CdiTaxis_unitname_get, _CdiObj.CdiTaxis_unitname_set)
+CdiTaxis_swigregister = _CdiObj.CdiTaxis_swigregister
+CdiTaxis_swigregister(CdiTaxis)
+
+class CdiZaxis(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, CdiZaxis, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, CdiZaxis, name)
+    __repr__ = _swig_repr
+    def __init__(self, *args): 
+        this = _CdiObj.new_CdiZaxis(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _CdiObj.delete_CdiZaxis
+    __del__ = lambda self : None;
+    __swig_setmethods__["zaxisID"] = _CdiObj.CdiZaxis_zaxisID_set
+    __swig_getmethods__["zaxisID"] = _CdiObj.CdiZaxis_zaxisID_get
+    if _newclass:zaxisID = _swig_property(_CdiObj.CdiZaxis_zaxisID_get, _CdiObj.CdiZaxis_zaxisID_set)
+    __swig_setmethods__["type"] = _CdiObj.CdiZaxis_type_set
+    __swig_getmethods__["type"] = _CdiObj.CdiZaxis_type_get
+    if _newclass:type = _swig_property(_CdiObj.CdiZaxis_type_get, _CdiObj.CdiZaxis_type_set)
+    __swig_setmethods__["ltype"] = _CdiObj.CdiZaxis_ltype_set
+    __swig_getmethods__["ltype"] = _CdiObj.CdiZaxis_ltype_get
+    if _newclass:ltype = _swig_property(_CdiObj.CdiZaxis_ltype_get, _CdiObj.CdiZaxis_ltype_set)
+    __swig_setmethods__["size"] = _CdiObj.CdiZaxis_size_set
+    __swig_getmethods__["size"] = _CdiObj.CdiZaxis_size_get
+    if _newclass:size = _swig_property(_CdiObj.CdiZaxis_size_get, _CdiObj.CdiZaxis_size_set)
+    __swig_setmethods__["prec"] = _CdiObj.CdiZaxis_prec_set
+    __swig_getmethods__["prec"] = _CdiObj.CdiZaxis_prec_get
+    if _newclass:prec = _swig_property(_CdiObj.CdiZaxis_prec_get, _CdiObj.CdiZaxis_prec_set)
+    __swig_setmethods__["plevels"] = _CdiObj.CdiZaxis_plevels_set
+    __swig_getmethods__["plevels"] = _CdiObj.CdiZaxis_plevels_get
+    if _newclass:plevels = _swig_property(_CdiObj.CdiZaxis_plevels_get, _CdiObj.CdiZaxis_plevels_set)
+    __swig_setmethods__["plbounds"] = _CdiObj.CdiZaxis_plbounds_set
+    __swig_getmethods__["plbounds"] = _CdiObj.CdiZaxis_plbounds_get
+    if _newclass:plbounds = _swig_property(_CdiObj.CdiZaxis_plbounds_get, _CdiObj.CdiZaxis_plbounds_set)
+    __swig_setmethods__["pubounds"] = _CdiObj.CdiZaxis_pubounds_set
+    __swig_getmethods__["pubounds"] = _CdiObj.CdiZaxis_pubounds_get
+    if _newclass:pubounds = _swig_property(_CdiObj.CdiZaxis_pubounds_get, _CdiObj.CdiZaxis_pubounds_set)
+    __swig_setmethods__["pweights"] = _CdiObj.CdiZaxis_pweights_set
+    __swig_getmethods__["pweights"] = _CdiObj.CdiZaxis_pweights_get
+    if _newclass:pweights = _swig_property(_CdiObj.CdiZaxis_pweights_get, _CdiObj.CdiZaxis_pweights_set)
+    __swig_setmethods__["levels"] = _CdiObj.CdiZaxis_levels_set
+    __swig_getmethods__["levels"] = _CdiObj.CdiZaxis_levels_get
+    if _newclass:levels = _swig_property(_CdiObj.CdiZaxis_levels_get, _CdiObj.CdiZaxis_levels_set)
+    __swig_setmethods__["lbounds"] = _CdiObj.CdiZaxis_lbounds_set
+    __swig_getmethods__["lbounds"] = _CdiObj.CdiZaxis_lbounds_get
+    if _newclass:lbounds = _swig_property(_CdiObj.CdiZaxis_lbounds_get, _CdiObj.CdiZaxis_lbounds_set)
+    __swig_setmethods__["ubounds"] = _CdiObj.CdiZaxis_ubounds_set
+    __swig_getmethods__["ubounds"] = _CdiObj.CdiZaxis_ubounds_get
+    if _newclass:ubounds = _swig_property(_CdiObj.CdiZaxis_ubounds_get, _CdiObj.CdiZaxis_ubounds_set)
+    __swig_setmethods__["weights"] = _CdiObj.CdiZaxis_weights_set
+    __swig_getmethods__["weights"] = _CdiObj.CdiZaxis_weights_get
+    if _newclass:weights = _swig_property(_CdiObj.CdiZaxis_weights_get, _CdiObj.CdiZaxis_weights_set)
+    __swig_setmethods__["name"] = _CdiObj.CdiZaxis_name_set
+    __swig_getmethods__["name"] = _CdiObj.CdiZaxis_name_get
+    if _newclass:name = _swig_property(_CdiObj.CdiZaxis_name_get, _CdiObj.CdiZaxis_name_set)
+    __swig_setmethods__["longname"] = _CdiObj.CdiZaxis_longname_set
+    __swig_getmethods__["longname"] = _CdiObj.CdiZaxis_longname_get
+    if _newclass:longname = _swig_property(_CdiObj.CdiZaxis_longname_get, _CdiObj.CdiZaxis_longname_set)
+    __swig_setmethods__["units"] = _CdiObj.CdiZaxis_units_set
+    __swig_getmethods__["units"] = _CdiObj.CdiZaxis_units_get
+    if _newclass:units = _swig_property(_CdiObj.CdiZaxis_units_get, _CdiObj.CdiZaxis_units_set)
+CdiZaxis_swigregister = _CdiObj.CdiZaxis_swigregister
+CdiZaxis_swigregister(CdiZaxis)
+
+class CdiVariable(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, CdiVariable, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, CdiVariable, name)
+    __repr__ = _swig_repr
+    def __init__(self, *args): 
+        this = _CdiObj.new_CdiVariable(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _CdiObj.delete_CdiVariable
+    __del__ = lambda self : None;
+    __swig_setmethods__["varID"] = _CdiObj.CdiVariable_varID_set
+    __swig_getmethods__["varID"] = _CdiObj.CdiVariable_varID_get
+    if _newclass:varID = _swig_property(_CdiObj.CdiVariable_varID_get, _CdiObj.CdiVariable_varID_set)
+    __swig_setmethods__["zaxisID"] = _CdiObj.CdiVariable_zaxisID_set
+    __swig_getmethods__["zaxisID"] = _CdiObj.CdiVariable_zaxisID_get
+    if _newclass:zaxisID = _swig_property(_CdiObj.CdiVariable_zaxisID_get, _CdiObj.CdiVariable_zaxisID_set)
+    __swig_setmethods__["gridID"] = _CdiObj.CdiVariable_gridID_set
+    __swig_getmethods__["gridID"] = _CdiObj.CdiVariable_gridID_get
+    if _newclass:gridID = _swig_property(_CdiObj.CdiVariable_gridID_get, _CdiObj.CdiVariable_gridID_set)
+    __swig_setmethods__["taxisID"] = _CdiObj.CdiVariable_taxisID_set
+    __swig_getmethods__["taxisID"] = _CdiObj.CdiVariable_taxisID_get
+    if _newclass:taxisID = _swig_property(_CdiObj.CdiVariable_taxisID_get, _CdiObj.CdiVariable_taxisID_set)
+    __swig_setmethods__["timeID"] = _CdiObj.CdiVariable_timeID_set
+    __swig_getmethods__["timeID"] = _CdiObj.CdiVariable_timeID_get
+    if _newclass:timeID = _swig_property(_CdiObj.CdiVariable_timeID_get, _CdiObj.CdiVariable_timeID_set)
+    __swig_setmethods__["vlistID"] = _CdiObj.CdiVariable_vlistID_set
+    __swig_getmethods__["vlistID"] = _CdiObj.CdiVariable_vlistID_get
+    if _newclass:vlistID = _swig_property(_CdiObj.CdiVariable_vlistID_get, _CdiObj.CdiVariable_vlistID_set)
+    __swig_setmethods__["size"] = _CdiObj.CdiVariable_size_set
+    __swig_getmethods__["size"] = _CdiObj.CdiVariable_size_get
+    if _newclass:size = _swig_property(_CdiObj.CdiVariable_size_get, _CdiObj.CdiVariable_size_set)
+    __swig_setmethods__["code"] = _CdiObj.CdiVariable_code_set
+    __swig_getmethods__["code"] = _CdiObj.CdiVariable_code_get
+    if _newclass:code = _swig_property(_CdiObj.CdiVariable_code_get, _CdiObj.CdiVariable_code_set)
+    __swig_setmethods__["datatype"] = _CdiObj.CdiVariable_datatype_set
+    __swig_getmethods__["datatype"] = _CdiObj.CdiVariable_datatype_get
+    if _newclass:datatype = _swig_property(_CdiObj.CdiVariable_datatype_get, _CdiObj.CdiVariable_datatype_set)
+    __swig_setmethods__["streamID"] = _CdiObj.CdiVariable_streamID_set
+    __swig_getmethods__["streamID"] = _CdiObj.CdiVariable_streamID_get
+    if _newclass:streamID = _swig_property(_CdiObj.CdiVariable_streamID_get, _CdiObj.CdiVariable_streamID_set)
+    __swig_setmethods__["name"] = _CdiObj.CdiVariable_name_set
+    __swig_getmethods__["name"] = _CdiObj.CdiVariable_name_get
+    if _newclass:name = _swig_property(_CdiObj.CdiVariable_name_get, _CdiObj.CdiVariable_name_set)
+    __swig_setmethods__["longname"] = _CdiObj.CdiVariable_longname_set
+    __swig_getmethods__["longname"] = _CdiObj.CdiVariable_longname_get
+    if _newclass:longname = _swig_property(_CdiObj.CdiVariable_longname_get, _CdiObj.CdiVariable_longname_set)
+    __swig_setmethods__["units"] = _CdiObj.CdiVariable_units_set
+    __swig_getmethods__["units"] = _CdiObj.CdiVariable_units_get
+    if _newclass:units = _swig_property(_CdiObj.CdiVariable_units_get, _CdiObj.CdiVariable_units_set)
+    __swig_setmethods__["stdname"] = _CdiObj.CdiVariable_stdname_set
+    __swig_getmethods__["stdname"] = _CdiObj.CdiVariable_stdname_get
+    if _newclass:stdname = _swig_property(_CdiObj.CdiVariable_stdname_get, _CdiObj.CdiVariable_stdname_set)
+    __swig_setmethods__["missval"] = _CdiObj.CdiVariable_missval_set
+    __swig_getmethods__["missval"] = _CdiObj.CdiVariable_missval_get
+    if _newclass:missval = _swig_property(_CdiObj.CdiVariable_missval_get, _CdiObj.CdiVariable_missval_set)
+    __swig_setmethods__["values"] = _CdiObj.CdiVariable_values_set
+    __swig_getmethods__["values"] = _CdiObj.CdiVariable_values_get
+    if _newclass:values = _swig_property(_CdiObj.CdiVariable_values_get, _CdiObj.CdiVariable_values_set)
+    __swig_setmethods__["valuesWithLevel"] = _CdiObj.CdiVariable_valuesWithLevel_set
+    __swig_getmethods__["valuesWithLevel"] = _CdiObj.CdiVariable_valuesWithLevel_get
+    if _newclass:valuesWithLevel = _swig_property(_CdiObj.CdiVariable_valuesWithLevel_get, _CdiObj.CdiVariable_valuesWithLevel_set)
+    __swig_setmethods__["grid"] = _CdiObj.CdiVariable_grid_set
+    __swig_getmethods__["grid"] = _CdiObj.CdiVariable_grid_get
+    if _newclass:grid = _swig_property(_CdiObj.CdiVariable_grid_get, _CdiObj.CdiVariable_grid_set)
+    __swig_setmethods__["zaxis"] = _CdiObj.CdiVariable_zaxis_set
+    __swig_getmethods__["zaxis"] = _CdiObj.CdiVariable_zaxis_get
+    if _newclass:zaxis = _swig_property(_CdiObj.CdiVariable_zaxis_get, _CdiObj.CdiVariable_zaxis_set)
+    __swig_setmethods__["taxis"] = _CdiObj.CdiVariable_taxis_set
+    __swig_getmethods__["taxis"] = _CdiObj.CdiVariable_taxis_get
+    if _newclass:taxis = _swig_property(_CdiObj.CdiVariable_taxis_get, _CdiObj.CdiVariable_taxis_set)
+    def sinfo(self): return _CdiObj.CdiVariable_sinfo(self)
+    def getValues(self): return _CdiObj.CdiVariable_getValues(self)
+    def getValuesWithLevel(self, tsID = 0): return _CdiObj.CdiVariable_getValuesWithLevel(self, tsID)
+    def getFValues(self): return _CdiObj.CdiVariable_getFValues(self)
+    def getFValuesWithLevel(self, tsID = 0): return _CdiObj.CdiVariable_getFValuesWithLevel(self, tsID)
+    def getValuesAsPointer(self): return _CdiObj.CdiVariable_getValuesAsPointer(self)
+    def getValuesWithLevelAsPointer(self, tsID = 0): return _CdiObj.CdiVariable_getValuesWithLevelAsPointer(self, tsID)
+CdiVariable_swigregister = _CdiObj.CdiVariable_swigregister
+CdiVariable_swigregister(CdiVariable)
+
+class Cdi(_object):
+    __swig_setmethods__ = {}
+    __setattr__ = lambda self, name, value: _swig_setattr(self, Cdi, name, value)
+    __swig_getmethods__ = {}
+    __getattr__ = lambda self, name: _swig_getattr(self, Cdi, name)
+    __repr__ = _swig_repr
+    def __init__(self, *args): 
+        this = _CdiObj.new_Cdi(*args)
+        try: self.this.append(this)
+        except: self.this = this
+    __swig_destroy__ = _CdiObj.delete_Cdi
+    __del__ = lambda self : None;
+    __swig_setmethods__["streamID"] = _CdiObj.Cdi_streamID_set
+    __swig_getmethods__["streamID"] = _CdiObj.Cdi_streamID_get
+    if _newclass:streamID = _swig_property(_CdiObj.Cdi_streamID_get, _CdiObj.Cdi_streamID_set)
+    __swig_setmethods__["vlistID"] = _CdiObj.Cdi_vlistID_set
+    __swig_getmethods__["vlistID"] = _CdiObj.Cdi_vlistID_get
+    if _newclass:vlistID = _swig_property(_CdiObj.Cdi_vlistID_get, _CdiObj.Cdi_vlistID_set)
+    __swig_setmethods__["nvars"] = _CdiObj.Cdi_nvars_set
+    __swig_getmethods__["nvars"] = _CdiObj.Cdi_nvars_get
+    if _newclass:nvars = _swig_property(_CdiObj.Cdi_nvars_get, _CdiObj.Cdi_nvars_set)
+    __swig_setmethods__["nzaxes"] = _CdiObj.Cdi_nzaxes_set
+    __swig_getmethods__["nzaxes"] = _CdiObj.Cdi_nzaxes_get
+    if _newclass:nzaxes = _swig_property(_CdiObj.Cdi_nzaxes_get, _CdiObj.Cdi_nzaxes_set)
+    __swig_setmethods__["ngrids"] = _CdiObj.Cdi_ngrids_set
+    __swig_getmethods__["ngrids"] = _CdiObj.Cdi_ngrids_get
+    if _newclass:ngrids = _swig_property(_CdiObj.Cdi_ngrids_get, _CdiObj.Cdi_ngrids_set)
+    __swig_setmethods__["ntaxes"] = _CdiObj.Cdi_ntaxes_set
+    __swig_getmethods__["ntaxes"] = _CdiObj.Cdi_ntaxes_get
+    if _newclass:ntaxes = _swig_property(_CdiObj.Cdi_ntaxes_get, _CdiObj.Cdi_ntaxes_set)
+    __swig_setmethods__["taxisID"] = _CdiObj.Cdi_taxisID_set
+    __swig_getmethods__["taxisID"] = _CdiObj.Cdi_taxisID_get
+    if _newclass:taxisID = _swig_property(_CdiObj.Cdi_taxisID_get, _CdiObj.Cdi_taxisID_set)
+    __swig_setmethods__["varnames"] = _CdiObj.Cdi_varnames_set
+    __swig_getmethods__["varnames"] = _CdiObj.Cdi_varnames_get
+    if _newclass:varnames = _swig_property(_CdiObj.Cdi_varnames_get, _CdiObj.Cdi_varnames_set)
+    __swig_setmethods__["codes"] = _CdiObj.Cdi_codes_set
+    __swig_getmethods__["codes"] = _CdiObj.Cdi_codes_get
+    if _newclass:codes = _swig_property(_CdiObj.Cdi_codes_get, _CdiObj.Cdi_codes_set)
+    __swig_setmethods__["variables"] = _CdiObj.Cdi_variables_set
+    __swig_getmethods__["variables"] = _CdiObj.Cdi_variables_get
+    if _newclass:variables = _swig_property(_CdiObj.Cdi_variables_get, _CdiObj.Cdi_variables_set)
+    __swig_setmethods__["var"] = _CdiObj.Cdi_var_set
+    __swig_getmethods__["var"] = _CdiObj.Cdi_var_get
+    if _newclass:var = _swig_property(_CdiObj.Cdi_var_get, _CdiObj.Cdi_var_set)
+    __swig_setmethods__["varByCode"] = _CdiObj.Cdi_varByCode_set
+    __swig_getmethods__["varByCode"] = _CdiObj.Cdi_varByCode_get
+    if _newclass:varByCode = _swig_property(_CdiObj.Cdi_varByCode_get, _CdiObj.Cdi_varByCode_set)
+    __swig_setmethods__["taxes"] = _CdiObj.Cdi_taxes_set
+    __swig_getmethods__["taxes"] = _CdiObj.Cdi_taxes_get
+    if _newclass:taxes = _swig_property(_CdiObj.Cdi_taxes_get, _CdiObj.Cdi_taxes_set)
+    __swig_setmethods__["zaxes"] = _CdiObj.Cdi_zaxes_set
+    __swig_getmethods__["zaxes"] = _CdiObj.Cdi_zaxes_get
+    if _newclass:zaxes = _swig_property(_CdiObj.Cdi_zaxes_get, _CdiObj.Cdi_zaxes_set)
+    __swig_setmethods__["grids"] = _CdiObj.Cdi_grids_set
+    __swig_getmethods__["grids"] = _CdiObj.Cdi_grids_get
+    if _newclass:grids = _swig_property(_CdiObj.Cdi_grids_get, _CdiObj.Cdi_grids_set)
+    def griddes(self): return _CdiObj.Cdi_griddes(self)
+Cdi_swigregister = _CdiObj.Cdi_swigregister
+Cdi_swigregister(Cdi)
+
+# This file is compatible with both classic and new-style classes.
+
+
diff --git a/libcdi/interfaces/python/cdilib_wrap.c b/libcdi/interfaces/python/cdilib_wrap.c
new file mode 100644
index 0000000..8e7fb8f
--- /dev/null
+++ b/libcdi/interfaces/python/cdilib_wrap.c
@@ -0,0 +1,13297 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.36
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPYTHON
+#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif 
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+
+/* Python.h has to appear first */
+#include <Python.h>
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "4"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the swig runtime code.
+  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  
+  But only do this if is strictly necessary, ie, if you have problems
+  with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+#define SWIG_CAST_NEW_MEMORY       0x2
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+	delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {			       
+          if (<need new object>) {		       
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;		       
+          } else {				       
+            *ptr = <ptr to old object>;	       
+            return SWIG_OLDOBJ;		       
+          } 				       
+        } else {				       
+          return SWIG_BADOBJ;		       
+        }					       
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+ 
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *, int *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store information on one type */
+typedef struct swig_type_info {
+  const char             *name;			/* mangled name of this type */
+  const char             *str;			/* human readable name of this type */
+  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
+  void                   *clientdata;		/* language specific type data */
+  int                    owndata;		/* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;		/* function to cast the void pointers */
+  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;			/* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;		        /* Number of types in this module */
+  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;	/* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
+  void                    *clientdata;		/* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+		  const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty)         \
+  if (ty) {                                             \
+    swig_cast_info *iter = ty->cast;                    \
+    while (iter) {                                      \
+      if (comparison) {                                 \
+        if (iter == ty->cast) return iter;              \
+        /* Move iter to the top of the linked list */   \
+        iter->prev->next = iter->next;                  \
+        if (iter->next)                                 \
+          iter->next->prev = iter->prev;                \
+        iter->next = ty->cast;                          \
+        iter->prev = 0;                                 \
+        if (ty->cast) ty->cast->prev = iter;            \
+        ty->cast = iter;                                \
+        return iter;                                    \
+      }                                                 \
+      iter = iter->next;                                \
+    }                                                   \
+  }                                                     \
+  return 0
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+  SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+	SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+		            const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
+	register size_t i = (l + r) >> 1; 
+	const char *iname = iter->types[i]->name;
+	if (iname) {
+	  register int compare = strcmp(name, iname);
+	  if (compare == 0) {	    
+	    return iter->types[i];
+	  } else if (compare < 0) {
+	    if (i) {
+	      r = i - 1;
+	    } else {
+	      break;
+	    }
+	  } else if (compare > 0) {
+	    l = i + 1;
+	  }
+	} else {
+	  break; /* should never happen */
+	}
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+		     const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+	  return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError    	   -1 
+#define  SWIG_IOError        	   -2 
+#define  SWIG_RuntimeError   	   -3 
+#define  SWIG_IndexError     	   -4 
+#define  SWIG_TypeError      	   -5 
+#define  SWIG_DivisionByZero 	   -6 
+#define  SWIG_OverflowError  	   -7 
+#define  SWIG_SyntaxError    	   -8 
+#define  SWIG_ValueError     	   -9 
+#define  SWIG_SystemError    	   -10
+#define  SWIG_AttributeError 	   -11
+#define  SWIG_MemoryError    	   -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+
+/* Add PyOS_snprintf for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
+#  define PyOS_snprintf _snprintf
+# else
+#  define PyOS_snprintf snprintf
+# endif
+#endif
+
+/* A crude PyString_FromFormat implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+
+#ifndef SWIG_PYBUFFER_SIZE
+# define SWIG_PYBUFFER_SIZE 1024
+#endif
+
+static PyObject *
+PyString_FromFormat(const char *fmt, ...) {
+  va_list ap;
+  char buf[SWIG_PYBUFFER_SIZE * 2];
+  int res;
+  va_start(ap, fmt);
+  res = vsnprintf(buf, sizeof(buf), fmt, ap);
+  va_end(ap);
+  return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
+}
+#endif
+
+/* Add PyObject_Del for old Pythons */
+#if PY_VERSION_HEX < 0x01060000
+# define PyObject_Del(op) PyMem_DEL((op))
+#endif
+#ifndef PyObject_DEL
+# define PyObject_DEL PyObject_Del
+#endif
+
+/* A crude PyExc_StopIteration exception for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+# ifndef PyExc_StopIteration
+#  define PyExc_StopIteration PyExc_RuntimeError
+# endif
+# ifndef PyObject_GenericGetAttr
+#  define PyObject_GenericGetAttr 0
+# endif
+#endif
+/* Py_NotImplemented is defined in 2.1 and up. */
+#if PY_VERSION_HEX < 0x02010000
+# ifndef Py_NotImplemented
+#  define Py_NotImplemented PyExc_RuntimeError
+# endif
+#endif
+
+
+/* A crude PyString_AsStringAndSize implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02010000
+# ifndef PyString_AsStringAndSize
+#  define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
+# endif
+#endif
+
+/* PySequence_Size for old Pythons */
+#if PY_VERSION_HEX < 0x02000000
+# ifndef PySequence_Size
+#  define PySequence_Size PySequence_Length
+# endif
+#endif
+
+
+/* PyBool_FromLong for old Pythons */
+#if PY_VERSION_HEX < 0x02030000
+static
+PyObject *PyBool_FromLong(long ok)
+{
+  PyObject *result = ok ? Py_True : Py_False;
+  Py_INCREF(result);
+  return result;
+}
+#endif
+
+/* Py_ssize_t for old Pythons */
+/* This code is as recommended by: */
+/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+# define PY_SSIZE_T_MAX INT_MAX
+# define PY_SSIZE_T_MIN INT_MIN
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGRUNTIME PyObject*
+SWIG_Python_ErrorType(int code) {
+  PyObject* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = PyExc_MemoryError;
+    break;
+  case SWIG_IOError:
+    type = PyExc_IOError;
+    break;
+  case SWIG_RuntimeError:
+    type = PyExc_RuntimeError;
+    break;
+  case SWIG_IndexError:
+    type = PyExc_IndexError;
+    break;
+  case SWIG_TypeError:
+    type = PyExc_TypeError;
+    break;
+  case SWIG_DivisionByZero:
+    type = PyExc_ZeroDivisionError;
+    break;
+  case SWIG_OverflowError:
+    type = PyExc_OverflowError;
+    break;
+  case SWIG_SyntaxError:
+    type = PyExc_SyntaxError;
+    break;
+  case SWIG_ValueError:
+    type = PyExc_ValueError;
+    break;
+  case SWIG_SystemError:
+    type = PyExc_SystemError;
+    break;
+  case SWIG_AttributeError:
+    type = PyExc_AttributeError;
+    break;
+  default:
+    type = PyExc_RuntimeError;
+  }
+  return type;
+}
+
+
+SWIGRUNTIME void
+SWIG_Python_AddErrorMsg(const char* mesg)
+{
+  PyObject *type = 0;
+  PyObject *value = 0;
+  PyObject *traceback = 0;
+
+  if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
+  if (value) {
+    PyObject *old_str = PyObject_Str(value);
+    PyErr_Clear();
+    Py_XINCREF(type);
+    PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+    Py_DECREF(old_str);
+    Py_DECREF(value);
+  } else {
+    PyErr_SetString(PyExc_RuntimeError, mesg);
+  }
+}
+
+
+
+#if defined(SWIG_PYTHON_NO_THREADS)
+#  if defined(SWIG_PYTHON_THREADS)
+#    undef SWIG_PYTHON_THREADS
+#  endif
+#endif
+#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
+#  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
+#    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
+#      define SWIG_PYTHON_USE_GIL
+#    endif
+#  endif
+#  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
+#    ifndef SWIG_PYTHON_INITIALIZE_THREADS
+#     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() 
+#    endif
+#    ifdef __cplusplus /* C++ code */
+       class SWIG_Python_Thread_Block {
+         bool status;
+         PyGILState_STATE state;
+       public:
+         void end() { if (status) { PyGILState_Release(state); status = false;} }
+         SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
+         ~SWIG_Python_Thread_Block() { end(); }
+       };
+       class SWIG_Python_Thread_Allow {
+         bool status;
+         PyThreadState *save;
+       public:
+         void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
+         SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
+         ~SWIG_Python_Thread_Allow() { end(); }
+       };
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
+#      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
+#      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
+#    else /* C code */
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
+#      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
+#      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
+#    endif
+#  else /* Old thread way, not implemented, user must provide it */
+#    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
+#      define SWIG_PYTHON_INITIALIZE_THREADS
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
+#      define SWIG_PYTHON_THREAD_END_BLOCK
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
+#      define SWIG_PYTHON_THREAD_END_ALLOW
+#    endif
+#  endif
+#else /* No thread support */
+#  define SWIG_PYTHON_INITIALIZE_THREADS
+#  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+#  define SWIG_PYTHON_THREAD_END_BLOCK
+#  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+#  define SWIG_PYTHON_THREAD_END_ALLOW
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Python API portion that goes into the runtime
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* cc-mode */
+#endif
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Constant declarations
+ * ----------------------------------------------------------------------------- */
+
+/* Constant Types */
+#define SWIG_PY_POINTER 4
+#define SWIG_PY_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_const_info {
+  int type;
+  char *name;
+  long lvalue;
+  double dvalue;
+  void   *pvalue;
+  swig_type_info **ptype;
+} swig_const_info;
+
+#ifdef __cplusplus
+#if 0
+{ /* cc-mode */
+#endif
+}
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * pyrun.swg
+ *
+ * This file contains the runtime support for Python modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ *
+ * ----------------------------------------------------------------------------- */
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
+#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
+#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(ptr, type, flags)
+#define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
+#define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
+#define swig_owntype                                    int
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
+#define SWIG_NewClientData(obj)                         PySwigClientData_New(obj)
+
+#define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
+#define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg				   
+#define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)                        
+#define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
+#define SWIG_fail                        		goto fail					   
+
+
+/* Runtime API implementation */
+
+/* Error manipulation */
+
+SWIGINTERN void 
+SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
+  SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
+  PyErr_SetObject(errtype, obj);
+  Py_DECREF(obj);
+  SWIG_PYTHON_THREAD_END_BLOCK;
+}
+
+SWIGINTERN void 
+SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
+  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+  PyErr_SetString(errtype, (char *) msg);
+  SWIG_PYTHON_THREAD_END_BLOCK;
+}
+
+#define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
+
+/* Set a constant value */
+
+SWIGINTERN void
+SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
+  PyDict_SetItemString(d, (char*) name, obj);
+  Py_DECREF(obj);                            
+}
+
+/* Append a value to the result obj */
+
+SWIGINTERN PyObject*
+SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
+#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
+  if (!result) {
+    result = obj;
+  } else if (result == Py_None) {
+    Py_DECREF(result);
+    result = obj;
+  } else {
+    if (!PyList_Check(result)) {
+      PyObject *o2 = result;
+      result = PyList_New(1);
+      PyList_SetItem(result, 0, o2);
+    }
+    PyList_Append(result,obj);
+    Py_DECREF(obj);
+  }
+  return result;
+#else
+  PyObject*   o2;
+  PyObject*   o3;
+  if (!result) {
+    result = obj;
+  } else if (result == Py_None) {
+    Py_DECREF(result);
+    result = obj;
+  } else {
+    if (!PyTuple_Check(result)) {
+      o2 = result;
+      result = PyTuple_New(1);
+      PyTuple_SET_ITEM(result, 0, o2);
+    }
+    o3 = PyTuple_New(1);
+    PyTuple_SET_ITEM(o3, 0, obj);
+    o2 = result;
+    result = PySequence_Concat(o2, o3);
+    Py_DECREF(o2);
+    Py_DECREF(o3);
+  }
+  return result;
+#endif
+}
+
+/* Unpack the argument tuple */
+
+SWIGINTERN int
+SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
+{
+  if (!args) {
+    if (!min && !max) {
+      return 1;
+    } else {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
+		   name, (min == max ? "" : "at least "), (int)min);
+      return 0;
+    }
+  }  
+  if (!PyTuple_Check(args)) {
+    PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
+    return 0;
+  } else {
+    register Py_ssize_t l = PyTuple_GET_SIZE(args);
+    if (l < min) {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
+		   name, (min == max ? "" : "at least "), (int)min, (int)l);
+      return 0;
+    } else if (l > max) {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
+		   name, (min == max ? "" : "at most "), (int)max, (int)l);
+      return 0;
+    } else {
+      register int i;
+      for (i = 0; i < l; ++i) {
+	objs[i] = PyTuple_GET_ITEM(args, i);
+      }
+      for (; l < max; ++l) {
+	objs[l] = 0;
+      }
+      return i + 1;
+    }    
+  }
+}
+
+/* A functor is a function object with one single object argument */
+#if PY_VERSION_HEX >= 0x02020000
+#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
+#else
+#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunction(functor, "O", obj);
+#endif
+
+/*
+  Helper for static pointer initialization for both C and C++ code, for example
+  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
+*/
+#ifdef __cplusplus
+#define SWIG_STATIC_POINTER(var)  var
+#else
+#define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Pointer declarations
+ * ----------------------------------------------------------------------------- */
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
+#define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
+
+#define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* cc-mode */
+#endif
+#endif
+
+/*  How to access Py_None */
+#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#  ifndef SWIG_PYTHON_NO_BUILD_NONE
+#    ifndef SWIG_PYTHON_BUILD_NONE
+#      define SWIG_PYTHON_BUILD_NONE
+#    endif
+#  endif
+#endif
+
+#ifdef SWIG_PYTHON_BUILD_NONE
+#  ifdef Py_None
+#   undef Py_None
+#   define Py_None SWIG_Py_None()
+#  endif
+SWIGRUNTIMEINLINE PyObject * 
+_SWIG_Py_None(void)
+{
+  PyObject *none = Py_BuildValue((char*)"");
+  Py_DECREF(none);
+  return none;
+}
+SWIGRUNTIME PyObject * 
+SWIG_Py_None(void)
+{
+  static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
+  return none;
+}
+#endif
+
+/* The python void return value */
+
+SWIGRUNTIMEINLINE PyObject * 
+SWIG_Py_Void(void)
+{
+  PyObject *none = Py_None;
+  Py_INCREF(none);
+  return none;
+}
+
+/* PySwigClientData */
+
+typedef struct {
+  PyObject *klass;
+  PyObject *newraw;
+  PyObject *newargs;
+  PyObject *destroy;
+  int delargs;
+  int implicitconv;
+} PySwigClientData;
+
+SWIGRUNTIMEINLINE int 
+SWIG_Python_CheckImplicit(swig_type_info *ty)
+{
+  PySwigClientData *data = (PySwigClientData *)ty->clientdata;
+  return data ? data->implicitconv : 0;
+}
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Python_ExceptionType(swig_type_info *desc) {
+  PySwigClientData *data = desc ? (PySwigClientData *) desc->clientdata : 0;
+  PyObject *klass = data ? data->klass : 0;
+  return (klass ? klass : PyExc_RuntimeError);
+}
+
+
+SWIGRUNTIME PySwigClientData * 
+PySwigClientData_New(PyObject* obj)
+{
+  if (!obj) {
+    return 0;
+  } else {
+    PySwigClientData *data = (PySwigClientData *)malloc(sizeof(PySwigClientData));
+    /* the klass element */
+    data->klass = obj;
+    Py_INCREF(data->klass);
+    /* the newraw method and newargs arguments used to create a new raw instance */
+    if (PyClass_Check(obj)) {
+      data->newraw = 0;
+      data->newargs = obj;
+      Py_INCREF(obj);
+    } else {
+#if (PY_VERSION_HEX < 0x02020000)
+      data->newraw = 0;
+#else
+      data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
+#endif
+      if (data->newraw) {
+	Py_INCREF(data->newraw);
+	data->newargs = PyTuple_New(1);
+	PyTuple_SetItem(data->newargs, 0, obj);
+      } else {
+	data->newargs = obj;
+      }
+      Py_INCREF(data->newargs);
+    }
+    /* the destroy method, aka as the C++ delete method */
+    data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
+    if (PyErr_Occurred()) {
+      PyErr_Clear();
+      data->destroy = 0;
+    }
+    if (data->destroy) {
+      int flags;
+      Py_INCREF(data->destroy);
+      flags = PyCFunction_GET_FLAGS(data->destroy);
+#ifdef METH_O
+      data->delargs = !(flags & (METH_O));
+#else
+      data->delargs = 0;
+#endif
+    } else {
+      data->delargs = 0;
+    }
+    data->implicitconv = 0;
+    return data;
+  }
+}
+
+SWIGRUNTIME void 
+PySwigClientData_Del(PySwigClientData* data)
+{
+  Py_XDECREF(data->newraw);
+  Py_XDECREF(data->newargs);
+  Py_XDECREF(data->destroy);
+}
+
+/* =============== PySwigObject =====================*/
+
+typedef struct {
+  PyObject_HEAD
+  void *ptr;
+  swig_type_info *ty;
+  int own;
+  PyObject *next;
+} PySwigObject;
+
+SWIGRUNTIME PyObject *
+PySwigObject_long(PySwigObject *v)
+{
+  return PyLong_FromVoidPtr(v->ptr);
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_format(const char* fmt, PySwigObject *v)
+{
+  PyObject *res = NULL;
+  PyObject *args = PyTuple_New(1);
+  if (args) {
+    if (PyTuple_SetItem(args, 0, PySwigObject_long(v)) == 0) {
+      PyObject *ofmt = PyString_FromString(fmt);
+      if (ofmt) {
+	res = PyString_Format(ofmt,args);
+	Py_DECREF(ofmt);
+      }
+      Py_DECREF(args);
+    }
+  }
+  return res;
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_oct(PySwigObject *v)
+{
+  return PySwigObject_format("%o",v);
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_hex(PySwigObject *v)
+{
+  return PySwigObject_format("%x",v);
+}
+
+SWIGRUNTIME PyObject *
+#ifdef METH_NOARGS
+PySwigObject_repr(PySwigObject *v)
+#else
+PySwigObject_repr(PySwigObject *v, PyObject *args)
+#endif
+{
+  const char *name = SWIG_TypePrettyName(v->ty);
+  PyObject *hex = PySwigObject_hex(v);    
+  PyObject *repr = PyString_FromFormat("<Swig Object of type '%s' at 0x%s>", name, PyString_AsString(hex));
+  Py_DECREF(hex);
+  if (v->next) {
+#ifdef METH_NOARGS
+    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next);
+#else
+    PyObject *nrep = PySwigObject_repr((PySwigObject *)v->next, args);
+#endif
+    PyString_ConcatAndDel(&repr,nrep);
+  }
+  return repr;  
+}
+
+SWIGRUNTIME int
+PySwigObject_print(PySwigObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+{
+#ifdef METH_NOARGS
+  PyObject *repr = PySwigObject_repr(v);
+#else
+  PyObject *repr = PySwigObject_repr(v, NULL);
+#endif
+  if (repr) {
+    fputs(PyString_AsString(repr), fp);
+    Py_DECREF(repr);
+    return 0; 
+  } else {
+    return 1; 
+  }
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_str(PySwigObject *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
+    PyString_FromString(result) : 0;
+}
+
+SWIGRUNTIME int
+PySwigObject_compare(PySwigObject *v, PySwigObject *w)
+{
+  void *i = v->ptr;
+  void *j = w->ptr;
+  return (i < j) ? -1 : ((i > j) ? 1 : 0);
+}
+
+SWIGRUNTIME PyTypeObject* _PySwigObject_type(void);
+
+SWIGRUNTIME PyTypeObject*
+PySwigObject_type(void) {
+  static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigObject_type();
+  return type;
+}
+
+SWIGRUNTIMEINLINE int
+PySwigObject_Check(PyObject *op) {
+  return ((op)->ob_type == PySwigObject_type())
+    || (strcmp((op)->ob_type->tp_name,"PySwigObject") == 0);
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_New(void *ptr, swig_type_info *ty, int own);
+
+SWIGRUNTIME void
+PySwigObject_dealloc(PyObject *v)
+{
+  PySwigObject *sobj = (PySwigObject *) v;
+  PyObject *next = sobj->next;
+  if (sobj->own == SWIG_POINTER_OWN) {
+    swig_type_info *ty = sobj->ty;
+    PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
+    PyObject *destroy = data ? data->destroy : 0;
+    if (destroy) {
+      /* destroy is always a VARARGS method */
+      PyObject *res;
+      if (data->delargs) {
+	/* we need to create a temporal object to carry the destroy operation */
+	PyObject *tmp = PySwigObject_New(sobj->ptr, ty, 0);
+	res = SWIG_Python_CallFunctor(destroy, tmp);
+	Py_DECREF(tmp);
+      } else {
+	PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
+	PyObject *mself = PyCFunction_GET_SELF(destroy);
+	res = ((*meth)(mself, v));
+      }
+      Py_XDECREF(res);
+    } 
+#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
+    else {
+      const char *name = SWIG_TypePrettyName(ty);
+      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
+    }
+#endif
+  } 
+  Py_XDECREF(next);
+  PyObject_DEL(v);
+}
+
+SWIGRUNTIME PyObject* 
+PySwigObject_append(PyObject* v, PyObject* next)
+{
+  PySwigObject *sobj = (PySwigObject *) v;
+#ifndef METH_O
+  PyObject *tmp = 0;
+  if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
+  next = tmp;
+#endif
+  if (!PySwigObject_Check(next)) {
+    return NULL;
+  }
+  sobj->next = next;
+  Py_INCREF(next);
+  return SWIG_Py_Void();
+}
+
+SWIGRUNTIME PyObject* 
+#ifdef METH_NOARGS
+PySwigObject_next(PyObject* v)
+#else
+PySwigObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  PySwigObject *sobj = (PySwigObject *) v;
+  if (sobj->next) {    
+    Py_INCREF(sobj->next);
+    return sobj->next;
+  } else {
+    return SWIG_Py_Void();
+  }
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+PySwigObject_disown(PyObject *v)
+#else
+PySwigObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  PySwigObject *sobj = (PySwigObject *)v;
+  sobj->own = 0;
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+PySwigObject_acquire(PyObject *v)
+#else
+PySwigObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  PySwigObject *sobj = (PySwigObject *)v;
+  sobj->own = SWIG_POINTER_OWN;
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+PySwigObject_own(PyObject *v, PyObject *args)
+{
+  PyObject *val = 0;
+#if (PY_VERSION_HEX < 0x02020000)
+  if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
+#else
+  if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) 
+#endif
+    {
+      return NULL;
+    } 
+  else
+    {
+      PySwigObject *sobj = (PySwigObject *)v;
+      PyObject *obj = PyBool_FromLong(sobj->own);
+      if (val) {
+#ifdef METH_NOARGS
+	if (PyObject_IsTrue(val)) {
+	  PySwigObject_acquire(v);
+	} else {
+	  PySwigObject_disown(v);
+	}
+#else
+	if (PyObject_IsTrue(val)) {
+	  PySwigObject_acquire(v,args);
+	} else {
+	  PySwigObject_disown(v,args);
+	}
+#endif
+      } 
+      return obj;
+    }
+}
+
+#ifdef METH_O
+static PyMethodDef
+swigobject_methods[] = {
+  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_O,       (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
+  {0, 0, 0, 0}  
+};
+#else
+static PyMethodDef
+swigobject_methods[] = {
+  {(char *)"disown",  (PyCFunction)PySwigObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)PySwigObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)PySwigObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)PySwigObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)PySwigObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)PySwigObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
+  {0, 0, 0, 0}  
+};
+#endif
+
+#if PY_VERSION_HEX < 0x02020000
+SWIGINTERN PyObject *
+PySwigObject_getattr(PySwigObject *sobj,char *name)
+{
+  return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
+}
+#endif
+
+SWIGRUNTIME PyTypeObject*
+_PySwigObject_type(void) {
+  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
+  
+  static PyNumberMethods PySwigObject_as_number = {
+    (binaryfunc)0, /*nb_add*/
+    (binaryfunc)0, /*nb_subtract*/
+    (binaryfunc)0, /*nb_multiply*/
+    (binaryfunc)0, /*nb_divide*/
+    (binaryfunc)0, /*nb_remainder*/
+    (binaryfunc)0, /*nb_divmod*/
+    (ternaryfunc)0,/*nb_power*/
+    (unaryfunc)0,  /*nb_negative*/
+    (unaryfunc)0,  /*nb_positive*/
+    (unaryfunc)0,  /*nb_absolute*/
+    (inquiry)0,    /*nb_nonzero*/
+    0,		   /*nb_invert*/
+    0,		   /*nb_lshift*/
+    0,		   /*nb_rshift*/
+    0,		   /*nb_and*/
+    0,		   /*nb_xor*/
+    0,		   /*nb_or*/
+    (coercion)0,   /*nb_coerce*/
+    (unaryfunc)PySwigObject_long, /*nb_int*/
+    (unaryfunc)PySwigObject_long, /*nb_long*/
+    (unaryfunc)0,                 /*nb_float*/
+    (unaryfunc)PySwigObject_oct,  /*nb_oct*/
+    (unaryfunc)PySwigObject_hex,  /*nb_hex*/
+#if PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
+#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
+#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
+    0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
+#endif
+  };
+
+  static PyTypeObject pyswigobject_type;  
+  static int type_init = 0;
+  if (!type_init) {
+    const PyTypeObject tmp
+      = {
+	PyObject_HEAD_INIT(NULL)
+	0,				    /* ob_size */
+	(char *)"PySwigObject",		    /* tp_name */
+	sizeof(PySwigObject),		    /* tp_basicsize */
+	0,			            /* tp_itemsize */
+	(destructor)PySwigObject_dealloc,   /* tp_dealloc */
+	(printfunc)PySwigObject_print,	    /* tp_print */
+#if PY_VERSION_HEX < 0x02020000
+	(getattrfunc)PySwigObject_getattr,  /* tp_getattr */ 
+#else
+	(getattrfunc)0,			    /* tp_getattr */ 
+#endif
+	(setattrfunc)0,			    /* tp_setattr */ 
+	(cmpfunc)PySwigObject_compare,	    /* tp_compare */ 
+	(reprfunc)PySwigObject_repr,	    /* tp_repr */    
+	&PySwigObject_as_number,	    /* tp_as_number */
+	0,				    /* tp_as_sequence */
+	0,				    /* tp_as_mapping */
+	(hashfunc)0,			    /* tp_hash */
+	(ternaryfunc)0,			    /* tp_call */
+	(reprfunc)PySwigObject_str,	    /* tp_str */
+	PyObject_GenericGetAttr,            /* tp_getattro */
+	0,				    /* tp_setattro */
+	0,		                    /* tp_as_buffer */
+	Py_TPFLAGS_DEFAULT,	            /* tp_flags */
+	swigobject_doc, 	            /* tp_doc */        
+	0,                                  /* tp_traverse */
+	0,                                  /* tp_clear */
+	0,                                  /* tp_richcompare */
+	0,                                  /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+	0,                                  /* tp_iter */
+	0,                                  /* tp_iternext */
+	swigobject_methods,		    /* tp_methods */ 
+	0,			            /* tp_members */
+	0,				    /* tp_getset */	    	
+	0,			            /* tp_base */	        
+	0,				    /* tp_dict */	    	
+	0,				    /* tp_descr_get */  	
+	0,				    /* tp_descr_set */  	
+	0,				    /* tp_dictoffset */ 	
+	0,				    /* tp_init */	    	
+	0,				    /* tp_alloc */	    	
+	0,			            /* tp_new */	    	
+	0,	                            /* tp_free */	   
+        0,                                  /* tp_is_gc */  
+	0,				    /* tp_bases */   
+	0,				    /* tp_mro */
+	0,				    /* tp_cache */   
+ 	0,				    /* tp_subclasses */
+	0,				    /* tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+	0,                                  /* tp_del */
+#endif
+#ifdef COUNT_ALLOCS
+	0,0,0,0                             /* tp_alloc -> tp_next */
+#endif
+      };
+    pyswigobject_type = tmp;
+    pyswigobject_type.ob_type = &PyType_Type;
+    type_init = 1;
+  }
+  return &pyswigobject_type;
+}
+
+SWIGRUNTIME PyObject *
+PySwigObject_New(void *ptr, swig_type_info *ty, int own)
+{
+  PySwigObject *sobj = PyObject_NEW(PySwigObject, PySwigObject_type());
+  if (sobj) {
+    sobj->ptr  = ptr;
+    sobj->ty   = ty;
+    sobj->own  = own;
+    sobj->next = 0;
+  }
+  return (PyObject *)sobj;
+}
+
+/* -----------------------------------------------------------------------------
+ * Implements a simple Swig Packed type, and use it instead of string
+ * ----------------------------------------------------------------------------- */
+
+typedef struct {
+  PyObject_HEAD
+  void *pack;
+  swig_type_info *ty;
+  size_t size;
+} PySwigPacked;
+
+SWIGRUNTIME int
+PySwigPacked_print(PySwigPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+{
+  char result[SWIG_BUFFER_SIZE];
+  fputs("<Swig Packed ", fp); 
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
+    fputs("at ", fp); 
+    fputs(result, fp); 
+  }
+  fputs(v->ty->name,fp); 
+  fputs(">", fp);
+  return 0; 
+}
+  
+SWIGRUNTIME PyObject *
+PySwigPacked_repr(PySwigPacked *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
+    return PyString_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
+  } else {
+    return PyString_FromFormat("<Swig Packed %s>", v->ty->name);
+  }  
+}
+
+SWIGRUNTIME PyObject *
+PySwigPacked_str(PySwigPacked *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
+    return PyString_FromFormat("%s%s", result, v->ty->name);
+  } else {
+    return PyString_FromString(v->ty->name);
+  }  
+}
+
+SWIGRUNTIME int
+PySwigPacked_compare(PySwigPacked *v, PySwigPacked *w)
+{
+  size_t i = v->size;
+  size_t j = w->size;
+  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
+  return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
+}
+
+SWIGRUNTIME PyTypeObject* _PySwigPacked_type(void);
+
+SWIGRUNTIME PyTypeObject*
+PySwigPacked_type(void) {
+  static PyTypeObject *SWIG_STATIC_POINTER(type) = _PySwigPacked_type();
+  return type;
+}
+
+SWIGRUNTIMEINLINE int
+PySwigPacked_Check(PyObject *op) {
+  return ((op)->ob_type == _PySwigPacked_type()) 
+    || (strcmp((op)->ob_type->tp_name,"PySwigPacked") == 0);
+}
+
+SWIGRUNTIME void
+PySwigPacked_dealloc(PyObject *v)
+{
+  if (PySwigPacked_Check(v)) {
+    PySwigPacked *sobj = (PySwigPacked *) v;
+    free(sobj->pack);
+  }
+  PyObject_DEL(v);
+}
+
+SWIGRUNTIME PyTypeObject*
+_PySwigPacked_type(void) {
+  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
+  static PyTypeObject pyswigpacked_type;
+  static int type_init = 0;  
+  if (!type_init) {
+    const PyTypeObject tmp
+      = {
+	PyObject_HEAD_INIT(NULL)
+	0,				    /* ob_size */	
+	(char *)"PySwigPacked",		    /* tp_name */	
+	sizeof(PySwigPacked),		    /* tp_basicsize */	
+	0,				    /* tp_itemsize */	
+	(destructor)PySwigPacked_dealloc,   /* tp_dealloc */	
+	(printfunc)PySwigPacked_print,	    /* tp_print */   	
+	(getattrfunc)0,			    /* tp_getattr */ 	
+	(setattrfunc)0,			    /* tp_setattr */ 	
+	(cmpfunc)PySwigPacked_compare,	    /* tp_compare */ 	
+	(reprfunc)PySwigPacked_repr,	    /* tp_repr */    	
+	0,	                            /* tp_as_number */	
+	0,				    /* tp_as_sequence */
+	0,				    /* tp_as_mapping */	
+	(hashfunc)0,			    /* tp_hash */	
+	(ternaryfunc)0,			    /* tp_call */	
+	(reprfunc)PySwigPacked_str,	    /* tp_str */	
+	PyObject_GenericGetAttr,            /* tp_getattro */
+	0,				    /* tp_setattro */
+	0,		                    /* tp_as_buffer */
+	Py_TPFLAGS_DEFAULT,	            /* tp_flags */
+	swigpacked_doc, 	            /* tp_doc */
+	0,                                  /* tp_traverse */
+	0,                                  /* tp_clear */
+	0,                                  /* tp_richcompare */
+	0,                                  /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+	0,                                  /* tp_iter */
+	0,                                  /* tp_iternext */
+	0,		                    /* tp_methods */ 
+	0,			            /* tp_members */
+	0,				    /* tp_getset */	    	
+	0,			            /* tp_base */	        
+	0,				    /* tp_dict */	    	
+	0,				    /* tp_descr_get */  	
+	0,				    /* tp_descr_set */  	
+	0,				    /* tp_dictoffset */ 	
+	0,				    /* tp_init */	    	
+	0,				    /* tp_alloc */	    	
+	0,			            /* tp_new */	    	
+	0, 	                            /* tp_free */	   
+        0,                                  /* tp_is_gc */  
+	0,				    /* tp_bases */   
+	0,				    /* tp_mro */
+	0,				    /* tp_cache */   
+ 	0,				    /* tp_subclasses */
+	0,				    /* tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+	0,                                  /* tp_del */
+#endif
+#ifdef COUNT_ALLOCS
+	0,0,0,0                             /* tp_alloc -> tp_next */
+#endif
+      };
+    pyswigpacked_type = tmp;
+    pyswigpacked_type.ob_type = &PyType_Type;
+    type_init = 1;
+  }
+  return &pyswigpacked_type;
+}
+
+SWIGRUNTIME PyObject *
+PySwigPacked_New(void *ptr, size_t size, swig_type_info *ty)
+{
+  PySwigPacked *sobj = PyObject_NEW(PySwigPacked, PySwigPacked_type());
+  if (sobj) {
+    void *pack = malloc(size);
+    if (pack) {
+      memcpy(pack, ptr, size);
+      sobj->pack = pack;
+      sobj->ty   = ty;
+      sobj->size = size;
+    } else {
+      PyObject_DEL((PyObject *) sobj);
+      sobj = 0;
+    }
+  }
+  return (PyObject *) sobj;
+}
+
+SWIGRUNTIME swig_type_info *
+PySwigPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
+{
+  if (PySwigPacked_Check(obj)) {
+    PySwigPacked *sobj = (PySwigPacked *)obj;
+    if (sobj->size != size) return 0;
+    memcpy(ptr, sobj->pack, size);
+    return sobj->ty;
+  } else {
+    return 0;
+  }
+}
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGRUNTIMEINLINE PyObject *
+_SWIG_This(void)
+{
+  return PyString_FromString("this");
+}
+
+SWIGRUNTIME PyObject *
+SWIG_This(void)
+{
+  static PyObject *SWIG_STATIC_POINTER(swig_this) = _SWIG_This();
+  return swig_this;
+}
+
+/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
+
+SWIGRUNTIME PySwigObject *
+SWIG_Python_GetSwigThis(PyObject *pyobj) 
+{
+  if (PySwigObject_Check(pyobj)) {
+    return (PySwigObject *) pyobj;
+  } else {
+    PyObject *obj = 0;
+#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
+    if (PyInstance_Check(pyobj)) {
+      obj = _PyInstance_Lookup(pyobj, SWIG_This());      
+    } else {
+      PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
+      if (dictptr != NULL) {
+	PyObject *dict = *dictptr;
+	obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
+      } else {
+#ifdef PyWeakref_CheckProxy
+	if (PyWeakref_CheckProxy(pyobj)) {
+	  PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
+	  return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
+	}
+#endif
+	obj = PyObject_GetAttr(pyobj,SWIG_This());
+	if (obj) {
+	  Py_DECREF(obj);
+	} else {
+	  if (PyErr_Occurred()) PyErr_Clear();
+	  return 0;
+	}
+      }
+    }
+#else
+    obj = PyObject_GetAttr(pyobj,SWIG_This());
+    if (obj) {
+      Py_DECREF(obj);
+    } else {
+      if (PyErr_Occurred()) PyErr_Clear();
+      return 0;
+    }
+#endif
+    if (obj && !PySwigObject_Check(obj)) {
+      /* a PyObject is called 'this', try to get the 'real this'
+	 PySwigObject from it */ 
+      return SWIG_Python_GetSwigThis(obj);
+    }
+    return (PySwigObject *)obj;
+  }
+}
+
+/* Acquire a pointer value */
+
+SWIGRUNTIME int
+SWIG_Python_AcquirePtr(PyObject *obj, int own) {
+  if (own == SWIG_POINTER_OWN) {
+    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+    if (sobj) {
+      int oldown = sobj->own;
+      sobj->own = own;
+      return oldown;
+    }
+  }
+  return 0;
+}
+
+/* Convert a pointer value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
+  if (!obj) return SWIG_ERROR;
+  if (obj == Py_None) {
+    if (ptr) *ptr = 0;
+    return SWIG_OK;
+  } else {
+    PySwigObject *sobj = SWIG_Python_GetSwigThis(obj);
+    if (own)
+      *own = 0;
+    while (sobj) {
+      void *vptr = sobj->ptr;
+      if (ty) {
+	swig_type_info *to = sobj->ty;
+	if (to == ty) {
+	  /* no type cast needed */
+	  if (ptr) *ptr = vptr;
+	  break;
+	} else {
+	  swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+	  if (!tc) {
+	    sobj = (PySwigObject *)sobj->next;
+	  } else {
+	    if (ptr) {
+              int newmemory = 0;
+              *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+              if (newmemory == SWIG_CAST_NEW_MEMORY) {
+                assert(own);
+                if (own)
+                  *own = *own | SWIG_CAST_NEW_MEMORY;
+              }
+            }
+	    break;
+	  }
+	}
+      } else {
+	if (ptr) *ptr = vptr;
+	break;
+      }
+    }
+    if (sobj) {
+      if (own)
+        *own = *own | sobj->own;
+      if (flags & SWIG_POINTER_DISOWN) {
+	sobj->own = 0;
+      }
+      return SWIG_OK;
+    } else {
+      int res = SWIG_ERROR;
+      if (flags & SWIG_POINTER_IMPLICIT_CONV) {
+	PySwigClientData *data = ty ? (PySwigClientData *) ty->clientdata : 0;
+	if (data && !data->implicitconv) {
+	  PyObject *klass = data->klass;
+	  if (klass) {
+	    PyObject *impconv;
+	    data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
+	    impconv = SWIG_Python_CallFunctor(klass, obj);
+	    data->implicitconv = 0;
+	    if (PyErr_Occurred()) {
+	      PyErr_Clear();
+	      impconv = 0;
+	    }
+	    if (impconv) {
+	      PySwigObject *iobj = SWIG_Python_GetSwigThis(impconv);
+	      if (iobj) {
+		void *vptr;
+		res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
+		if (SWIG_IsOK(res)) {
+		  if (ptr) {
+		    *ptr = vptr;
+		    /* transfer the ownership to 'ptr' */
+		    iobj->own = 0;
+		    res = SWIG_AddCast(res);
+		    res = SWIG_AddNewMask(res);
+		  } else {
+		    res = SWIG_AddCast(res);		    
+		  }
+		}
+	      }
+	      Py_DECREF(impconv);
+	    }
+	  }
+	}
+      }
+      return res;
+    }
+  }
+}
+
+/* Convert a function ptr value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
+  if (!PyCFunction_Check(obj)) {
+    return SWIG_ConvertPtr(obj, ptr, ty, 0);
+  } else {
+    void *vptr = 0;
+    
+    /* here we get the method pointer for callbacks */
+    const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
+    const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
+    if (desc) {
+      desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
+      if (!desc) return SWIG_ERROR;
+    }
+    if (ty) {
+      swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
+      if (tc) {
+        int newmemory = 0;
+        *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+        assert(!newmemory); /* newmemory handling not yet implemented */
+      } else {
+        return SWIG_ERROR;
+      }
+    } else {
+      *ptr = vptr;
+    }
+    return SWIG_OK;
+  }
+}
+
+/* Convert a packed value value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
+  swig_type_info *to = PySwigPacked_UnpackData(obj, ptr, sz);
+  if (!to) return SWIG_ERROR;
+  if (ty) {
+    if (to != ty) {
+      /* check type cast? */
+      swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+      if (!tc) return SWIG_ERROR;
+    }
+  }
+  return SWIG_OK;
+}  
+
+/* -----------------------------------------------------------------------------
+ * Create a new pointer object
+ * ----------------------------------------------------------------------------- */
+
+/*
+  Create a new instance object, whitout calling __init__, and set the
+  'this' attribute.
+*/
+
+SWIGRUNTIME PyObject* 
+SWIG_Python_NewShadowInstance(PySwigClientData *data, PyObject *swig_this)
+{
+#if (PY_VERSION_HEX >= 0x02020000)
+  PyObject *inst = 0;
+  PyObject *newraw = data->newraw;
+  if (newraw) {
+    inst = PyObject_Call(newraw, data->newargs, NULL);
+    if (inst) {
+#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
+      PyObject **dictptr = _PyObject_GetDictPtr(inst);
+      if (dictptr != NULL) {
+	PyObject *dict = *dictptr;
+	if (dict == NULL) {
+	  dict = PyDict_New();
+	  *dictptr = dict;
+	  PyDict_SetItem(dict, SWIG_This(), swig_this);
+	}
+      }
+#else
+      PyObject *key = SWIG_This();
+      PyObject_SetAttr(inst, key, swig_this);
+#endif
+    }
+  } else {
+    PyObject *dict = PyDict_New();
+    PyDict_SetItem(dict, SWIG_This(), swig_this);
+    inst = PyInstance_NewRaw(data->newargs, dict);
+    Py_DECREF(dict);
+  }
+  return inst;
+#else
+#if (PY_VERSION_HEX >= 0x02010000)
+  PyObject *inst;
+  PyObject *dict = PyDict_New();
+  PyDict_SetItem(dict, SWIG_This(), swig_this);
+  inst = PyInstance_NewRaw(data->newargs, dict);
+  Py_DECREF(dict);
+  return (PyObject *) inst;
+#else
+  PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
+  if (inst == NULL) {
+    return NULL;
+  }
+  inst->in_class = (PyClassObject *)data->newargs;
+  Py_INCREF(inst->in_class);
+  inst->in_dict = PyDict_New();
+  if (inst->in_dict == NULL) {
+    Py_DECREF(inst);
+    return NULL;
+  }
+#ifdef Py_TPFLAGS_HAVE_WEAKREFS
+  inst->in_weakreflist = NULL;
+#endif
+#ifdef Py_TPFLAGS_GC
+  PyObject_GC_Init(inst);
+#endif
+  PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
+  return (PyObject *) inst;
+#endif
+#endif
+}
+
+SWIGRUNTIME void
+SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
+{
+ PyObject *dict;
+#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
+ PyObject **dictptr = _PyObject_GetDictPtr(inst);
+ if (dictptr != NULL) {
+   dict = *dictptr;
+   if (dict == NULL) {
+     dict = PyDict_New();
+     *dictptr = dict;
+   }
+   PyDict_SetItem(dict, SWIG_This(), swig_this);
+   return;
+ }
+#endif
+ dict = PyObject_GetAttrString(inst, (char*)"__dict__");
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ Py_DECREF(dict);
+} 
+
+
+SWIGINTERN PyObject *
+SWIG_Python_InitShadowInstance(PyObject *args) {
+  PyObject *obj[2];
+  if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
+    return NULL;
+  } else {
+    PySwigObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
+    if (sthis) {
+      PySwigObject_append((PyObject*) sthis, obj[1]);
+    } else {
+      SWIG_Python_SetSwigThis(obj[0], obj[1]);
+    }
+    return SWIG_Py_Void();
+  }
+}
+
+/* Create a new pointer object */
+
+SWIGRUNTIME PyObject *
+SWIG_Python_NewPointerObj(void *ptr, swig_type_info *type, int flags) {
+  if (!ptr) {
+    return SWIG_Py_Void();
+  } else {
+    int own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
+    PyObject *robj = PySwigObject_New(ptr, type, own);
+    PySwigClientData *clientdata = type ? (PySwigClientData *)(type->clientdata) : 0;
+    if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
+      PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
+      if (inst) {
+	Py_DECREF(robj);
+	robj = inst;
+      }
+    }
+    return robj;
+  }
+}
+
+/* Create a new packed object */
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
+  return ptr ? PySwigPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
+}
+
+/* -----------------------------------------------------------------------------*
+ *  Get type list 
+ * -----------------------------------------------------------------------------*/
+
+#ifdef SWIG_LINK_RUNTIME
+void *SWIG_ReturnGlobalTypeList(void *);
+#endif
+
+SWIGRUNTIME swig_module_info *
+SWIG_Python_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  /* first check if module already created */
+  if (!type_pointer) {
+#ifdef SWIG_LINK_RUNTIME
+    type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
+#else
+    type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+				    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
+    if (PyErr_Occurred()) {
+      PyErr_Clear();
+      type_pointer = (void *)0;
+    }
+#endif
+  }
+  return (swig_module_info *) type_pointer;
+}
+
+#if PY_MAJOR_VERSION < 2
+/* PyModule_AddObject function was introduced in Python 2.0.  The following function
+   is copied out of Python/modsupport.c in python version 2.3.4 */
+SWIGINTERN int
+PyModule_AddObject(PyObject *m, char *name, PyObject *o)
+{
+  PyObject *dict;
+  if (!PyModule_Check(m)) {
+    PyErr_SetString(PyExc_TypeError,
+		    "PyModule_AddObject() needs module as first arg");
+    return SWIG_ERROR;
+  }
+  if (!o) {
+    PyErr_SetString(PyExc_TypeError,
+		    "PyModule_AddObject() needs non-NULL value");
+    return SWIG_ERROR;
+  }
+  
+  dict = PyModule_GetDict(m);
+  if (dict == NULL) {
+    /* Internal error -- modules must have a dict! */
+    PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
+		 PyModule_GetName(m));
+    return SWIG_ERROR;
+  }
+  if (PyDict_SetItemString(dict, name, o))
+    return SWIG_ERROR;
+  Py_DECREF(o);
+  return SWIG_OK;
+}
+#endif
+
+SWIGRUNTIME void
+SWIG_Python_DestroyModule(void *vptr)
+{
+  swig_module_info *swig_module = (swig_module_info *) vptr;
+  swig_type_info **types = swig_module->types;
+  size_t i;
+  for (i =0; i < swig_module->size; ++i) {
+    swig_type_info *ty = types[i];
+    if (ty->owndata) {
+      PySwigClientData *data = (PySwigClientData *) ty->clientdata;
+      if (data) PySwigClientData_Del(data);
+    }
+  }
+  Py_DECREF(SWIG_This());
+}
+
+SWIGRUNTIME void
+SWIG_Python_SetModule(swig_module_info *swig_module) {
+  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} };/* Sentinel */
+
+  PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+				   swig_empty_runtime_method_table);
+  PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
+  if (pointer && module) {
+    PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+  } else {
+    Py_XDECREF(pointer);
+  }
+}
+
+/* The python cached type query */
+SWIGRUNTIME PyObject *
+SWIG_Python_TypeCache(void) {
+  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
+  return cache;
+}
+
+SWIGRUNTIME swig_type_info *
+SWIG_Python_TypeQuery(const char *type)
+{
+  PyObject *cache = SWIG_Python_TypeCache();
+  PyObject *key = PyString_FromString(type); 
+  PyObject *obj = PyDict_GetItem(cache, key);
+  swig_type_info *descriptor;
+  if (obj) {
+    descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
+  } else {
+    swig_module_info *swig_module = SWIG_Python_GetModule();
+    descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
+    if (descriptor) {
+      obj = PyCObject_FromVoidPtr(descriptor, NULL);
+      PyDict_SetItem(cache, key, obj);
+      Py_DECREF(obj);
+    }
+  }
+  Py_DECREF(key);
+  return descriptor;
+}
+
+/* 
+   For backward compatibility only
+*/
+#define SWIG_POINTER_EXCEPTION  0
+#define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
+#define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
+
+SWIGRUNTIME int
+SWIG_Python_AddErrMesg(const char* mesg, int infront)
+{
+  if (PyErr_Occurred()) {
+    PyObject *type = 0;
+    PyObject *value = 0;
+    PyObject *traceback = 0;
+    PyErr_Fetch(&type, &value, &traceback);
+    if (value) {
+      PyObject *old_str = PyObject_Str(value);
+      Py_XINCREF(type);
+      PyErr_Clear();
+      if (infront) {
+	PyErr_Format(type, "%s %s", mesg, PyString_AsString(old_str));
+      } else {
+	PyErr_Format(type, "%s %s", PyString_AsString(old_str), mesg);
+      }
+      Py_DECREF(old_str);
+    }
+    return 1;
+  } else {
+    return 0;
+  }
+}
+  
+SWIGRUNTIME int
+SWIG_Python_ArgFail(int argnum)
+{
+  if (PyErr_Occurred()) {
+    /* add information about failing argument */
+    char mesg[256];
+    PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
+    return SWIG_Python_AddErrMesg(mesg, 1);
+  } else {
+    return 0;
+  }
+}
+
+SWIGRUNTIMEINLINE const char *
+PySwigObject_GetDesc(PyObject *self)
+{
+  PySwigObject *v = (PySwigObject *)self;
+  swig_type_info *ty = v ? v->ty : 0;
+  return ty ? ty->str : (char*)"";
+}
+
+SWIGRUNTIME void
+SWIG_Python_TypeError(const char *type, PyObject *obj)
+{
+  if (type) {
+#if defined(SWIG_COBJECT_TYPES)
+    if (obj && PySwigObject_Check(obj)) {
+      const char *otype = (const char *) PySwigObject_GetDesc(obj);
+      if (otype) {
+	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'PySwigObject(%s)' is received",
+		     type, otype);
+	return;
+      }
+    } else 
+#endif      
+    {
+      const char *otype = (obj ? obj->ob_type->tp_name : 0); 
+      if (otype) {
+	PyObject *str = PyObject_Str(obj);
+	const char *cstr = str ? PyString_AsString(str) : 0;
+	if (cstr) {
+	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
+		       type, otype, cstr);
+	} else {
+	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
+		       type, otype);
+	}
+	Py_XDECREF(str);
+	return;
+      }
+    }   
+    PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
+  } else {
+    PyErr_Format(PyExc_TypeError, "unexpected type is received");
+  }
+}
+
+
+/* Convert a pointer value, signal an exception on a type mismatch */
+SWIGRUNTIME void *
+SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int argnum, int flags) {
+  void *result;
+  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
+    PyErr_Clear();
+    if (flags & SWIG_POINTER_EXCEPTION) {
+      SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
+      SWIG_Python_ArgFail(argnum);
+    }
+  }
+  return result;
+}
+
+
+#ifdef __cplusplus
+#if 0
+{ /* cc-mode */
+#endif
+}
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_char swig_types[0]
+#define SWIGTYPE_p_double swig_types[1]
+#define SWIGTYPE_p_float swig_types[2]
+#define SWIGTYPE_p_int swig_types[3]
+#define SWIGTYPE_p_off_t swig_types[4]
+static swig_type_info *swig_types[6];
+static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#if (PY_VERSION_HEX <= 0x02000000)
+# if !defined(SWIG_PYTHON_CLASSIC)
+#  error "This python version requires swig to be run with the '-classic' option"
+# endif
+#endif
+
+/*-----------------------------------------------
+              @(target):= _CdiLib.so
+  ------------------------------------------------*/
+#define SWIG_init    init_CdiLib
+
+#define SWIG_name    "_CdiLib"
+
+#define SWIGVERSION 0x010336 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 
+
+
+#include "cdi.h"
+
+
+  #define SWIG_From_long   PyInt_FromLong 
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_int  (int value)
+{    
+  return SWIG_From_long  (value);
+}
+
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_double (PyObject *obj, double *val)
+{
+  int res = SWIG_TypeError;
+  if (PyFloat_Check(obj)) {
+    if (val) *val = PyFloat_AsDouble(obj);
+    return SWIG_OK;
+  } else if (PyInt_Check(obj)) {
+    if (val) *val = PyInt_AsLong(obj);
+    return SWIG_OK;
+  } else if (PyLong_Check(obj)) {
+    double v = PyLong_AsDouble(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      PyErr_Clear();
+    }
+  }
+#ifdef SWIG_PYTHON_CAST_MODE
+  {
+    int dispatch = 0;
+    double d = PyFloat_AsDouble(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = d;
+      return SWIG_AddCast(SWIG_OK);
+    } else {
+      PyErr_Clear();
+    }
+    if (!dispatch) {
+      long v = PyLong_AsLong(obj);
+      if (!PyErr_Occurred()) {
+	if (val) *val = v;
+	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
+      } else {
+	PyErr_Clear();
+      }
+    }
+  }
+#endif
+  return res;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+  double x = *d;
+  if ((min <= x && x <= max)) {
+   double fx = floor(x);
+   double cx = ceil(x);
+   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+   if ((errno == EDOM) || (errno == ERANGE)) {
+     errno = 0;
+   } else {
+     double summ, reps, diff;
+     if (rd < x) {
+       diff = x - rd;
+     } else if (rd > x) {
+       diff = rd - x;
+     } else {
+       return 1;
+     }
+     summ = rd + x;
+     reps = diff/summ;
+     if (reps < 8*DBL_EPSILON) {
+       *d = rd;
+       return 1;
+     }
+   }
+  }
+  return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long (PyObject *obj, long* val)
+{
+  if (PyInt_Check(obj)) {
+    if (val) *val = PyInt_AsLong(obj);
+    return SWIG_OK;
+  } else if (PyLong_Check(obj)) {
+    long v = PyLong_AsLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      PyErr_Clear();
+    }
+  }
+#ifdef SWIG_PYTHON_CAST_MODE
+  {
+    int dispatch = 0;
+    long v = PyInt_AsLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_AddCast(SWIG_OK);
+    } else {
+      PyErr_Clear();
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+	if (val) *val = (long)(d);
+	return res;
+      }
+    }
+  }
+#endif
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_int (PyObject * obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long (obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = (int)(v);
+    }
+  }  
+  return res;
+}
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+  if (carray) {
+    if (size > INT_MAX) {
+      swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+      return pchar_descriptor ? 
+	SWIG_NewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void();
+    } else {
+      return PyString_FromStringAndSize(carray, (int)(size));
+    }
+  } else {
+    return SWIG_Py_Void();
+  }
+}
+
+
+SWIGINTERNINLINE PyObject * 
+SWIG_FromCharPtr(const char *cptr)
+{ 
+  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+}
+
+
+  #define SWIG_From_double   PyFloat_FromDouble 
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (PyString_Check(obj)) {
+    char *cstr; Py_ssize_t len;
+    PyString_AsStringAndSize(obj, &cstr, &len);
+    if (cptr)  {
+      if (alloc) {
+	/* 
+	   In python the user should not be able to modify the inner
+	   string representation. To warranty that, if you define
+	   SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
+	   buffer is always returned.
+
+	   The default behavior is just to return the pointer value,
+	   so, be careful.
+	*/ 
+#if defined(SWIG_PYTHON_SAFE_CSTRINGS)
+	if (*alloc != SWIG_OLDOBJ) 
+#else
+	if (*alloc == SWIG_NEWOBJ) 
+#endif
+	  {
+	    *cptr = (char *)memcpy((char *)malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
+	    *alloc = SWIG_NEWOBJ;
+	  }
+	else {
+	  *cptr = cstr;
+	  *alloc = SWIG_OLDOBJ;
+	}
+      } else {
+	*cptr = PyString_AsString(obj);
+      }
+    }
+    if (psize) *psize = len + 1;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      void* vptr = 0;
+      if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
+	if (cptr) *cptr = (char *) vptr;
+	if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
+	if (alloc) *alloc = SWIG_OLDOBJ;
+	return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+SWIGINTERN PyObject *_wrap_cdiStringError(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:cdiStringError",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cdiStringError" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (char *)cdiStringError(arg1);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cdiDebug(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:cdiDebug",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cdiDebug" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  cdiDebug(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cdiLibraryVersion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":cdiLibraryVersion")) SWIG_fail;
+  result = (char *)cdiLibraryVersion();
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cdiPrintVersion(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  
+  if (!PyArg_ParseTuple(args,(char *)":cdiPrintVersion")) SWIG_fail;
+  cdiPrintVersion();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cdiDefMissval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  double arg1 ;
+  double val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:cdiDefMissval",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_double(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "cdiDefMissval" "', argument " "1"" of type '" "double""'");
+  } 
+  arg1 = (double)(val1);
+  cdiDefMissval(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cdiInqMissval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)":cdiInqMissval")) SWIG_fail;
+  result = (double)cdiInqMissval();
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_cdiDefGlobal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  char *arg1 = (char *) 0 ;
+  int arg2 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:cdiDefGlobal",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cdiDefGlobal" "', argument " "1"" of type '" "char const *""'");
+  }
+  arg1 = (char *)(buf1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cdiDefGlobal" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  cdiDefGlobal((char const *)arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return resultobj;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamOpenRead(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  char *arg1 = (char *) 0 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamOpenRead",&obj0)) SWIG_fail;
+  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "streamOpenRead" "', argument " "1"" of type '" "char const *""'");
+  }
+  arg1 = (char *)(buf1);
+  result = (int)streamOpenRead((char const *)arg1);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return resultobj;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamOpenWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  char *arg1 = (char *) 0 ;
+  int arg2 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:streamOpenWrite",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "streamOpenWrite" "', argument " "1"" of type '" "char const *""'");
+  }
+  arg1 = (char *)(buf1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamOpenWrite" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)streamOpenWrite((char const *)arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return resultobj;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamOpenAppend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  char *arg1 = (char *) 0 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamOpenAppend",&obj0)) SWIG_fail;
+  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "streamOpenAppend" "', argument " "1"" of type '" "char const *""'");
+  }
+  arg1 = (char *)(buf1);
+  result = (int)streamOpenAppend((char const *)arg1);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return resultobj;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamClose(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamClose",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamClose" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  streamClose(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamSync(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamSync",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamSync" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  streamSync(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamDefVlist(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:streamDefVlist",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamDefVlist" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamDefVlist" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  streamDefVlist(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamInqVlist(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamInqVlist",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamInqVlist" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqVlist(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamInqFiletype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamInqFiletype",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamInqFiletype" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqFiletype(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamDefByteorder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:streamDefByteorder",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamDefByteorder" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamDefByteorder" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  streamDefByteorder(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamInqByteorder(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamInqByteorder",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamInqByteorder" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqByteorder(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamDefZtype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:streamDefZtype",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamDefZtype" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamDefZtype" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  streamDefZtype(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamDefZlevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:streamDefZlevel",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamDefZlevel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamDefZlevel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  streamDefZlevel(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamInqZtype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamInqZtype",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamInqZtype" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqZtype(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamInqZlevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamInqZlevel",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamInqZlevel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqZlevel(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamDefTimestep(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:streamDefTimestep",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamDefTimestep" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamDefTimestep" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)streamDefTimestep(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamInqTimestep(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:streamInqTimestep",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamInqTimestep" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamInqTimestep" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)streamInqTimestep(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamFilename(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamFilename",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamFilename" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (char *)streamFilename(arg1);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamFilesuffix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamFilesuffix",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamFilesuffix" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (char *)streamFilesuffix(arg1);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamNtsteps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamNtsteps",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamNtsteps" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamNtsteps(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamNvals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  off_t result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamNvals",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamNvals" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = streamNvals(arg1);
+  resultobj = SWIG_NewPointerObj((off_t *)memcpy((off_t *)malloc(sizeof(off_t)),&result,sizeof(off_t)), SWIGTYPE_p_off_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamReadVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  double *arg3 = (double *) 0 ;
+  int *arg4 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:streamReadVar",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamReadVar" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamReadVar" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "streamReadVar" "', argument " "3"" of type '" "double *""'"); 
+  }
+  arg3 = (double *)(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "streamReadVar" "', argument " "4"" of type '" "int *""'"); 
+  }
+  arg4 = (int *)(argp4);
+  streamReadVar(arg1,arg2,arg3,arg4);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamWriteVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  double *arg3 = (double *) 0 ;
+  int arg4 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:streamWriteVar",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamWriteVar" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamWriteVar" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "streamWriteVar" "', argument " "3"" of type '" "double const *""'"); 
+  }
+  arg3 = (double *)(argp3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "streamWriteVar" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = (int)(val4);
+  streamWriteVar(arg1,arg2,(double const *)arg3,arg4);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamReadVarSlice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  double *arg4 = (double *) 0 ;
+  int *arg5 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:streamReadVarSlice",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamReadVarSlice" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamReadVarSlice" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "streamReadVarSlice" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "streamReadVarSlice" "', argument " "4"" of type '" "double *""'"); 
+  }
+  arg4 = (double *)(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "streamReadVarSlice" "', argument " "5"" of type '" "int *""'"); 
+  }
+  arg5 = (int *)(argp5);
+  streamReadVarSlice(arg1,arg2,arg3,arg4,arg5);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamWriteVarSlice(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  double *arg4 = (double *) 0 ;
+  int arg5 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  int val5 ;
+  int ecode5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:streamWriteVarSlice",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamWriteVarSlice" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamWriteVarSlice" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "streamWriteVarSlice" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "streamWriteVarSlice" "', argument " "4"" of type '" "double const *""'"); 
+  }
+  arg4 = (double *)(argp4);
+  ecode5 = SWIG_AsVal_int(obj4, &val5);
+  if (!SWIG_IsOK(ecode5)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "streamWriteVarSlice" "', argument " "5"" of type '" "int""'");
+  } 
+  arg5 = (int)(val5);
+  streamWriteVarSlice(arg1,arg2,arg3,(double const *)arg4,arg5);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamInqRecord(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:streamInqRecord",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamInqRecord" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "streamInqRecord" "', argument " "2"" of type '" "int *""'"); 
+  }
+  arg2 = (int *)(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "streamInqRecord" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = (int *)(argp3);
+  streamInqRecord(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamDefRecord(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:streamDefRecord",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamDefRecord" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamDefRecord" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "streamDefRecord" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  streamDefRecord(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamReadRecord(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:streamReadRecord",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamReadRecord" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "streamReadRecord" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "streamReadRecord" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = (int *)(argp3);
+  streamReadRecord(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamWriteRecord(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:streamWriteRecord",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamWriteRecord" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "streamWriteRecord" "', argument " "2"" of type '" "double const *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "streamWriteRecord" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  streamWriteRecord(arg1,(double const *)arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamCopyRecord(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:streamCopyRecord",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamCopyRecord" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamCopyRecord" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  streamCopyRecord(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamInqGinfo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  float *arg3 = (float *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:streamInqGinfo",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamInqGinfo" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "streamInqGinfo" "', argument " "2"" of type '" "int *""'"); 
+  }
+  arg2 = (int *)(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "streamInqGinfo" "', argument " "3"" of type '" "float *""'"); 
+  }
+  arg3 = (float *)(argp3);
+  streamInqGinfo(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistCreate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)":vlistCreate")) SWIG_fail;
+  result = (int)vlistCreate();
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDestroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistDestroy",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDestroy" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  vlistDestroy(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDuplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistDuplicate",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDuplicate" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistDuplicate(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistCopy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistCopy",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistCopy" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistCopy" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  vlistCopy(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistCopyFlag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistCopyFlag",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistCopyFlag" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistCopyFlag" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  vlistCopyFlag(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistClearFlag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistClearFlag",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistClearFlag" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  vlistClearFlag(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistCat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistCat",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistCat" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistCat" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  vlistCat(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistMerge(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistMerge",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistMerge" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistMerge" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  vlistMerge(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistPrint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistPrint",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistPrint" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  vlistPrint(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistNvars(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistNvars",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistNvars" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistNvars(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistNgrids(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistNgrids",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistNgrids" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistNgrids(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistNzaxis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistNzaxis",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistNzaxis" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistNzaxis(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefNtsteps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistDefNtsteps",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefNtsteps" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefNtsteps" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  vlistDefNtsteps(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistNtsteps(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistNtsteps",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistNtsteps" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistNtsteps(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistGridsizeMax(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistGridsizeMax",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistGridsizeMax" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistGridsizeMax(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistGrid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistGrid",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistGrid" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistGrid" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistGrid(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistGridIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistGridIndex",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistGridIndex" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistGridIndex" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistGridIndex(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistChangeGridIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistChangeGridIndex",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistChangeGridIndex" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistChangeGridIndex" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistChangeGridIndex" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistChangeGridIndex(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistChangeGrid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistChangeGrid",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistChangeGrid" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistChangeGrid" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistChangeGrid" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistChangeGrid(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistZaxis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistZaxis",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistZaxis" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistZaxis" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistZaxis(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistZaxisIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistZaxisIndex",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistZaxisIndex" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistZaxisIndex" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistZaxisIndex(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistChangeZaxisIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistChangeZaxisIndex",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistChangeZaxisIndex" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistChangeZaxisIndex" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistChangeZaxisIndex" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistChangeZaxisIndex(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistChangeZaxis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistChangeZaxis",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistChangeZaxis" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistChangeZaxis" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistChangeZaxis" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistChangeZaxis(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistNrecs(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistNrecs",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistNrecs" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistNrecs(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefTaxis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistDefTaxis",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefTaxis" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefTaxis" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  vlistDefTaxis(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqTaxis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistInqTaxis",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqTaxis" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistInqTaxis(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistDefTable",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefTable" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefTable" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  vlistDefTable(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistInqTable",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqTable" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistInqTable(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefInstitut(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistDefInstitut",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefInstitut" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefInstitut" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  vlistDefInstitut(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqInstitut(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistInqInstitut",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqInstitut" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistInqInstitut(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistDefModel",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefModel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefModel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  vlistDefModel(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:vlistInqModel",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqModel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistInqModel(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int arg4 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:vlistDefVar",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVar" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVar" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVar" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "vlistDefVar" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = (int)(val4);
+  result = (int)vlistDefVar(arg1,arg2,arg3,arg4);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistChangeVarGrid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistChangeVarGrid",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistChangeVarGrid" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistChangeVarGrid" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistChangeVarGrid" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistChangeVarGrid(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistChangeVarZaxis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistChangeVarZaxis",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistChangeVarZaxis" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistChangeVarZaxis" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistChangeVarZaxis" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistChangeVarZaxis(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 = (int *) 0 ;
+  int *arg4 = (int *) 0 ;
+  int *arg5 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:vlistInqVar",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVar" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVar" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistInqVar" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = (int *)(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "vlistInqVar" "', argument " "4"" of type '" "int *""'"); 
+  }
+  arg4 = (int *)(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "vlistInqVar" "', argument " "5"" of type '" "int *""'"); 
+  }
+  arg5 = (int *)(argp5);
+  vlistInqVar(arg1,arg2,arg3,arg4,arg5);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarGrid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarGrid",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarGrid" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarGrid" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarGrid(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarZaxis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarZaxis",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarZaxis" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarZaxis" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarZaxis(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarTime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarTime",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarTime" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarTime" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarTime(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarZtype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarZtype",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarZtype" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarZtype" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarZtype" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarZtype(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarZtype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarZtype",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarZtype" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarZtype" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarZtype(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarZlevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarZlevel",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarZlevel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarZlevel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarZlevel" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarZlevel(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarZlevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarZlevel",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarZlevel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarZlevel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarZlevel(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarCode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarCode",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarCode" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarCode" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarCode" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarCode(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarCode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarCode",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarCode" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarCode" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarCode(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarDatatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarDatatype",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarDatatype" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarDatatype" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarDatatype" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarDatatype(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarDatatype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarDatatype",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarDatatype" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarDatatype" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarDatatype(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarInstitut(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarInstitut",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarInstitut" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarInstitut" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarInstitut" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarInstitut(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarInstitut(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarInstitut",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarInstitut" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarInstitut" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarInstitut(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarModel",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarModel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarModel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarModel" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarModel(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarModel",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarModel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarModel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarModel(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarTable",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarTable" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarTable" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarTable" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarTable(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarTable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarTable",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarTable" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarTable" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarTable(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarName",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarName" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarName" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistDefVarName" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  vlistDefVarName(arg1,arg2,(char const *)arg3);
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistInqVarName",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarName" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarName" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistInqVarName" "', argument " "3"" of type '" "char *""'");
+  }
+  arg3 = (char *)(buf3);
+  vlistInqVarName(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarLongname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarLongname",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarLongname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarLongname" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistDefVarLongname" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  vlistDefVarLongname(arg1,arg2,(char const *)arg3);
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarStdname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarStdname",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarStdname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarStdname" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistDefVarStdname" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  vlistDefVarStdname(arg1,arg2,(char const *)arg3);
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarLongname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistInqVarLongname",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarLongname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarLongname" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistInqVarLongname" "', argument " "3"" of type '" "char *""'");
+  }
+  arg3 = (char *)(buf3);
+  vlistInqVarLongname(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarStdname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistInqVarStdname",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarStdname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarStdname" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistInqVarStdname" "', argument " "3"" of type '" "char *""'");
+  }
+  arg3 = (char *)(buf3);
+  vlistInqVarStdname(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarUnits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarUnits",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarUnits" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarUnits" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistDefVarUnits" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  vlistDefVarUnits(arg1,arg2,(char const *)arg3);
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarUnits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistInqVarUnits",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarUnits" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarUnits" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistInqVarUnits" "', argument " "3"" of type '" "char *""'");
+  }
+  arg3 = (char *)(buf3);
+  vlistInqVarUnits(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarMissval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  double arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarMissval",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarMissval" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarMissval" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarMissval" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = (double)(val3);
+  vlistDefVarMissval(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarMissval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarMissval",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarMissval" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarMissval" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (double)vlistInqVarMissval(arg1,arg2);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarScalefactor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  double arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarScalefactor",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarScalefactor" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarScalefactor" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarScalefactor" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = (double)(val3);
+  vlistDefVarScalefactor(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarScalefactor(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarScalefactor",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarScalefactor" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarScalefactor" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (double)vlistInqVarScalefactor(arg1,arg2);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarAddoffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  double arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarAddoffset",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarAddoffset" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarAddoffset" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarAddoffset" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = (double)(val3);
+  vlistDefVarAddoffset(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarAddoffset(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarAddoffset",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarAddoffset" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarAddoffset" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (double)vlistInqVarAddoffset(arg1,arg2);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarTimave(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarTimave",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarTimave" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarTimave" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarTimave" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarTimave(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarTimave(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarTimave",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarTimave" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarTimave" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarTimave(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefVarTimaccu(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDefVarTimaccu",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefVarTimaccu" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefVarTimaccu" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefVarTimaccu" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarTimaccu(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarTimaccu(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarTimaccu",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarTimaccu" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarTimaccu" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarTimaccu(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarSize",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarSize" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarSize" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarSize(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqVarID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistInqVarID",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqVarID" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqVarID" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarID(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int arg4 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:vlistDefIndex",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefIndex" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefIndex" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefIndex" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "vlistDefIndex" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = (int)(val4);
+  vlistDefIndex(arg1,arg2,arg3,arg4);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqIndex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistInqIndex",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqIndex" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqIndex" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistInqIndex" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  result = (int)vlistInqIndex(arg1,arg2,arg3);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefFlag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int arg4 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:vlistDefFlag",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefFlag" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefFlag" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistDefFlag" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "vlistDefFlag" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = (int)(val4);
+  vlistDefFlag(arg1,arg2,arg3,arg4);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqFlag(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistInqFlag",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqFlag" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqFlag" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistInqFlag" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  result = (int)vlistInqFlag(arg1,arg2,arg3);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistFindVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistFindVar",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistFindVar" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistFindVar" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistFindVar(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistFindLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistFindLevel",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistFindLevel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistFindLevel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistFindLevel" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  result = (int)vlistFindLevel(arg1,arg2,arg3);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistMergedVar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:vlistMergedVar",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistMergedVar" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistMergedVar" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistMergedVar(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistMergedLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistMergedLevel",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistMergedLevel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistMergedLevel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistMergedLevel" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  result = (int)vlistMergedLevel(arg1,arg2,arg3);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqNatts(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistInqNatts",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqNatts" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqNatts" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistInqNatts" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = (int *)(argp3);
+  result = (int)vlistInqNatts(arg1,arg2,arg3);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqAtt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  char *arg4 = (char *) 0 ;
+  int *arg5 = (int *) 0 ;
+  int *arg6 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int res4 ;
+  char *buf4 = 0 ;
+  int alloc4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  void *argp6 = 0 ;
+  int res6 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:vlistInqAtt",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqAtt" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqAtt" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "vlistInqAtt" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "vlistInqAtt" "', argument " "4"" of type '" "char *""'");
+  }
+  arg4 = (char *)(buf4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "vlistInqAtt" "', argument " "5"" of type '" "int *""'"); 
+  }
+  arg5 = (int *)(argp5);
+  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res6)) {
+    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "vlistInqAtt" "', argument " "6"" of type '" "int *""'"); 
+  }
+  arg6 = (int *)(argp6);
+  result = (int)vlistInqAtt(arg1,arg2,arg3,arg4,arg5,arg6);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return resultobj;
+fail:
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDelAtt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:vlistDelAtt",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDelAtt" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDelAtt" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistDelAtt" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  result = (int)vlistDelAtt(arg1,arg2,(char const *)arg3);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefAttInt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  int *arg5 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:vlistDefAttInt",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefAttInt" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefAttInt" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistDefAttInt" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "vlistDefAttInt" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "vlistDefAttInt" "', argument " "5"" of type '" "int const *""'"); 
+  }
+  arg5 = (int *)(argp5);
+  result = (int)vlistDefAttInt(arg1,arg2,(char const *)arg3,arg4,(int const *)arg5);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefAttFlt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  double *arg5 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:vlistDefAttFlt",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefAttFlt" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefAttFlt" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistDefAttFlt" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "vlistDefAttFlt" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "vlistDefAttFlt" "', argument " "5"" of type '" "double const *""'"); 
+  }
+  arg5 = (double *)(argp5);
+  result = (int)vlistDefAttFlt(arg1,arg2,(char const *)arg3,arg4,(double const *)arg5);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistDefAttTxt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  char *arg5 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  int res5 ;
+  char *buf5 = 0 ;
+  int alloc5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:vlistDefAttTxt",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistDefAttTxt" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistDefAttTxt" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistDefAttTxt" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "vlistDefAttTxt" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5);
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "vlistDefAttTxt" "', argument " "5"" of type '" "char const *""'");
+  }
+  arg5 = (char *)(buf5);
+  result = (int)vlistDefAttTxt(arg1,arg2,(char const *)arg3,arg4,(char const *)arg5);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqAttInt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  int *arg5 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:vlistInqAttInt",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqAttInt" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqAttInt" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistInqAttInt" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "vlistInqAttInt" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "vlistInqAttInt" "', argument " "5"" of type '" "int *""'"); 
+  }
+  arg5 = (int *)(argp5);
+  result = (int)vlistInqAttInt(arg1,arg2,(char const *)arg3,arg4,arg5);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqAttFlt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  double *arg5 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:vlistInqAttFlt",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqAttFlt" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqAttFlt" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistInqAttFlt" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "vlistInqAttFlt" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "vlistInqAttFlt" "', argument " "5"" of type '" "double *""'"); 
+  }
+  arg5 = (double *)(argp5);
+  result = (int)vlistInqAttFlt(arg1,arg2,(char const *)arg3,arg4,arg5);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_vlistInqAttTxt(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  char *arg5 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  int res5 ;
+  char *buf5 = 0 ;
+  int alloc5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:vlistInqAttTxt",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "vlistInqAttTxt" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "vlistInqAttTxt" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "vlistInqAttTxt" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "vlistInqAttTxt" "', argument " "4"" of type '" "int""'");
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5);
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "vlistInqAttTxt" "', argument " "5"" of type '" "char *""'");
+  }
+  arg5 = (char *)(buf5);
+  result = (int)vlistInqAttTxt(arg1,arg2,(char const *)arg3,arg4,arg5);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridName",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridName" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridName" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridName(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridNamePtr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridNamePtr",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridNamePtr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (char *)gridNamePtr(arg1);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridCompress(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridCompress",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridCompress" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  gridCompress(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefMask(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefMask",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefMask" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefMask" "', argument " "2"" of type '" "int const *""'"); 
+  }
+  arg2 = (int *)(argp2);
+  gridDefMask(arg1,(int const *)arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqMask(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqMask",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqMask" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqMask" "', argument " "2"" of type '" "int *""'"); 
+  }
+  arg2 = (int *)(argp2);
+  result = (int)gridInqMask(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridPrint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridPrint",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridPrint" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridPrint" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  gridPrint(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)":gridSize")) SWIG_fail;
+  result = (int)gridSize();
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridCreate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridCreate",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridCreate" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridCreate" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)gridCreate(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDestroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridDestroy",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDestroy" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  gridDestroy(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDuplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridDuplicate",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDuplicate" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridDuplicate(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqType",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqType" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqType(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqSize",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqSize" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqSize(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefXsize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefXsize",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefXsize" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefXsize" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  gridDefXsize(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqXsize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqXsize",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqXsize" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqXsize(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefYsize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefYsize",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefYsize" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefYsize" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  gridDefYsize(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqYsize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqYsize",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqYsize" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqYsize(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefXvals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefXvals",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefXvals" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefXvals" "', argument " "2"" of type '" "double const *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  gridDefXvals(arg1,(double const *)arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqXvals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqXvals",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqXvals" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqXvals" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)gridInqXvals(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefYvals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefYvals",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefYvals" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefYvals" "', argument " "2"" of type '" "double const *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  gridDefYvals(arg1,(double const *)arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqYvals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqYvals",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqYvals" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqYvals" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)gridInqYvals(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefXname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefXname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefXname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefXname" "', argument " "2"" of type '" "char const *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridDefXname(arg1,(char const *)arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefXlongname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefXlongname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefXlongname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefXlongname" "', argument " "2"" of type '" "char const *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridDefXlongname(arg1,(char const *)arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefXunits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefXunits",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefXunits" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefXunits" "', argument " "2"" of type '" "char const *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridDefXunits(arg1,(char const *)arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefYname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefYname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefYname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefYname" "', argument " "2"" of type '" "char const *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridDefYname(arg1,(char const *)arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefYlongname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefYlongname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefYlongname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefYlongname" "', argument " "2"" of type '" "char const *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridDefYlongname(arg1,(char const *)arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefYunits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefYunits",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefYunits" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefYunits" "', argument " "2"" of type '" "char const *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridDefYunits(arg1,(char const *)arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqXname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqXname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqXname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqXname" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridInqXname(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqXlongname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqXlongname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqXlongname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqXlongname" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridInqXlongname(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqXstdname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqXstdname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqXstdname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqXstdname" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridInqXstdname(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqXunits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqXunits",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqXunits" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqXunits" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridInqXunits(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqYname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqYname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqYname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqYname" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridInqYname(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqYlongname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqYlongname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqYlongname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqYlongname" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridInqYlongname(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqYstdname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqYstdname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqYstdname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqYstdname" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridInqYstdname(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqYunits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqYunits",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqYunits" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqYunits" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  gridInqYunits(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefPrec(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefPrec",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefPrec" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefPrec" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  gridDefPrec(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqPrec(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqPrec",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqPrec" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqPrec(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqXval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqXval",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqXval" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridInqXval" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (double)gridInqXval(arg1,arg2);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqYval(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqYval",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqYval" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridInqYval" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (double)gridInqYval(arg1,arg2);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqXinc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqXinc",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqXinc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (double)gridInqXinc(arg1);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqYinc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqYinc",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqYinc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (double)gridInqYinc(arg1);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridIsCircular(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridIsCircular",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridIsCircular" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridIsCircular(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridIsRotated(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridIsRotated",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridIsRotated" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridIsRotated(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqXpole(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqXpole",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqXpole" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (double)gridInqXpole(arg1);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefXpole(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefXpole",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefXpole" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefXpole" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = (double)(val2);
+  gridDefXpole(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqYpole(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqYpole",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqYpole" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (double)gridInqYpole(arg1);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefYpole(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefYpole",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefYpole" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefYpole" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = (double)(val2);
+  gridDefYpole(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqAngle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqAngle",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqAngle" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (double)gridInqAngle(arg1);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefAngle(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefAngle",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefAngle" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefAngle" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = (double)(val2);
+  gridDefAngle(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefTrunc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefTrunc",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefTrunc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefTrunc" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  gridDefTrunc(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqTrunc(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqTrunc",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqTrunc" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqTrunc(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqGMEnd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqGMEnd",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqGMEnd" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqGMEnd(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefGMEnd(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefGMEnd",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefGMEnd" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefGMEnd" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  gridDefGMEnd(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqGMEni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqGMEni",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqGMEni" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqGMEni(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefGMEni(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefGMEni",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefGMEni" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefGMEni" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  gridDefGMEni(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqGMEni2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqGMEni2",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqGMEni2" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqGMEni2(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefGMEni2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefGMEni2",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefGMEni2" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefGMEni2" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  gridDefGMEni2(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqGMEni3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqGMEni3",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqGMEni3" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqGMEni3(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefGMEni3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefGMEni3",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefGMEni3" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefGMEni3" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  gridDefGMEni3(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefLCC(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double arg2 ;
+  double arg3 ;
+  double arg4 ;
+  double arg5 ;
+  double arg6 ;
+  double arg7 ;
+  double arg8 ;
+  int arg9 ;
+  int arg10 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  double val4 ;
+  int ecode4 = 0 ;
+  double val5 ;
+  int ecode5 = 0 ;
+  double val6 ;
+  int ecode6 = 0 ;
+  double val7 ;
+  int ecode7 = 0 ;
+  double val8 ;
+  int ecode8 = 0 ;
+  int val9 ;
+  int ecode9 = 0 ;
+  int val10 ;
+  int ecode10 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  PyObject * obj9 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:gridDefLCC",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefLCC" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefLCC" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = (double)(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gridDefLCC" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = (double)(val3);
+  ecode4 = SWIG_AsVal_double(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "gridDefLCC" "', argument " "4"" of type '" "double""'");
+  } 
+  arg4 = (double)(val4);
+  ecode5 = SWIG_AsVal_double(obj4, &val5);
+  if (!SWIG_IsOK(ecode5)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "gridDefLCC" "', argument " "5"" of type '" "double""'");
+  } 
+  arg5 = (double)(val5);
+  ecode6 = SWIG_AsVal_double(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "gridDefLCC" "', argument " "6"" of type '" "double""'");
+  } 
+  arg6 = (double)(val6);
+  ecode7 = SWIG_AsVal_double(obj6, &val7);
+  if (!SWIG_IsOK(ecode7)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "gridDefLCC" "', argument " "7"" of type '" "double""'");
+  } 
+  arg7 = (double)(val7);
+  ecode8 = SWIG_AsVal_double(obj7, &val8);
+  if (!SWIG_IsOK(ecode8)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode8), "in method '" "gridDefLCC" "', argument " "8"" of type '" "double""'");
+  } 
+  arg8 = (double)(val8);
+  ecode9 = SWIG_AsVal_int(obj8, &val9);
+  if (!SWIG_IsOK(ecode9)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode9), "in method '" "gridDefLCC" "', argument " "9"" of type '" "int""'");
+  } 
+  arg9 = (int)(val9);
+  ecode10 = SWIG_AsVal_int(obj9, &val10);
+  if (!SWIG_IsOK(ecode10)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode10), "in method '" "gridDefLCC" "', argument " "10"" of type '" "int""'");
+  } 
+  arg10 = (int)(val10);
+  gridDefLCC(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqLCC(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  double *arg3 = (double *) 0 ;
+  double *arg4 = (double *) 0 ;
+  double *arg5 = (double *) 0 ;
+  double *arg6 = (double *) 0 ;
+  double *arg7 = (double *) 0 ;
+  double *arg8 = (double *) 0 ;
+  int *arg9 = (int *) 0 ;
+  int *arg10 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  void *argp6 = 0 ;
+  int res6 = 0 ;
+  void *argp7 = 0 ;
+  int res7 = 0 ;
+  void *argp8 = 0 ;
+  int res8 = 0 ;
+  void *argp9 = 0 ;
+  int res9 = 0 ;
+  void *argp10 = 0 ;
+  int res10 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  PyObject * obj6 = 0 ;
+  PyObject * obj7 = 0 ;
+  PyObject * obj8 = 0 ;
+  PyObject * obj9 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOOOOOO:gridInqLCC",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6,&obj7,&obj8,&obj9)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqLCC" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqLCC" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "gridInqLCC" "', argument " "3"" of type '" "double *""'"); 
+  }
+  arg3 = (double *)(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "gridInqLCC" "', argument " "4"" of type '" "double *""'"); 
+  }
+  arg4 = (double *)(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "gridInqLCC" "', argument " "5"" of type '" "double *""'"); 
+  }
+  arg5 = (double *)(argp5);
+  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res6)) {
+    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "gridInqLCC" "', argument " "6"" of type '" "double *""'"); 
+  }
+  arg6 = (double *)(argp6);
+  res7 = SWIG_ConvertPtr(obj6, &argp7,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res7)) {
+    SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "gridInqLCC" "', argument " "7"" of type '" "double *""'"); 
+  }
+  arg7 = (double *)(argp7);
+  res8 = SWIG_ConvertPtr(obj7, &argp8,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res8)) {
+    SWIG_exception_fail(SWIG_ArgError(res8), "in method '" "gridInqLCC" "', argument " "8"" of type '" "double *""'"); 
+  }
+  arg8 = (double *)(argp8);
+  res9 = SWIG_ConvertPtr(obj8, &argp9,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res9)) {
+    SWIG_exception_fail(SWIG_ArgError(res9), "in method '" "gridInqLCC" "', argument " "9"" of type '" "int *""'"); 
+  }
+  arg9 = (int *)(argp9);
+  res10 = SWIG_ConvertPtr(obj9, &argp10,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res10)) {
+    SWIG_exception_fail(SWIG_ArgError(res10), "in method '" "gridInqLCC" "', argument " "10"" of type '" "int *""'"); 
+  }
+  arg10 = (int *)(argp10);
+  gridInqLCC(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefLcc2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double arg2 ;
+  double arg3 ;
+  double arg4 ;
+  double arg5 ;
+  double arg6 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  double val4 ;
+  int ecode4 = 0 ;
+  double val5 ;
+  int ecode5 = 0 ;
+  double val6 ;
+  int ecode6 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:gridDefLcc2",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefLcc2" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefLcc2" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = (double)(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gridDefLcc2" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = (double)(val3);
+  ecode4 = SWIG_AsVal_double(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "gridDefLcc2" "', argument " "4"" of type '" "double""'");
+  } 
+  arg4 = (double)(val4);
+  ecode5 = SWIG_AsVal_double(obj4, &val5);
+  if (!SWIG_IsOK(ecode5)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "gridDefLcc2" "', argument " "5"" of type '" "double""'");
+  } 
+  arg5 = (double)(val5);
+  ecode6 = SWIG_AsVal_double(obj5, &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "gridDefLcc2" "', argument " "6"" of type '" "double""'");
+  } 
+  arg6 = (double)(val6);
+  gridDefLcc2(arg1,arg2,arg3,arg4,arg5,arg6);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqLcc2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  double *arg3 = (double *) 0 ;
+  double *arg4 = (double *) 0 ;
+  double *arg5 = (double *) 0 ;
+  double *arg6 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  void *argp6 = 0 ;
+  int res6 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  PyObject * obj5 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOOO:gridInqLcc2",&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqLcc2" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqLcc2" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "gridInqLcc2" "', argument " "3"" of type '" "double *""'"); 
+  }
+  arg3 = (double *)(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "gridInqLcc2" "', argument " "4"" of type '" "double *""'"); 
+  }
+  arg4 = (double *)(argp4);
+  res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "gridInqLcc2" "', argument " "5"" of type '" "double *""'"); 
+  }
+  arg5 = (double *)(argp5);
+  res6 = SWIG_ConvertPtr(obj5, &argp6,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res6)) {
+    SWIG_exception_fail(SWIG_ArgError(res6), "in method '" "gridInqLcc2" "', argument " "6"" of type '" "double *""'"); 
+  }
+  arg6 = (double *)(argp6);
+  gridInqLcc2(arg1,arg2,arg3,arg4,arg5,arg6);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefLaea(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double arg2 ;
+  double arg3 ;
+  double arg4 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  double val4 ;
+  int ecode4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:gridDefLaea",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefLaea" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefLaea" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = (double)(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "gridDefLaea" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = (double)(val3);
+  ecode4 = SWIG_AsVal_double(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "gridDefLaea" "', argument " "4"" of type '" "double""'");
+  } 
+  arg4 = (double)(val4);
+  gridDefLaea(arg1,arg2,arg3,arg4);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqLaea(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  double *arg3 = (double *) 0 ;
+  double *arg4 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:gridInqLaea",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqLaea" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqLaea" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "gridInqLaea" "', argument " "3"" of type '" "double *""'"); 
+  }
+  arg3 = (double *)(argp3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "gridInqLaea" "', argument " "4"" of type '" "double *""'"); 
+  }
+  arg4 = (double *)(argp4);
+  gridInqLaea(arg1,arg2,arg3,arg4);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefArea(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefArea",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefArea" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefArea" "', argument " "2"" of type '" "double const *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  gridDefArea(arg1,(double const *)arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqArea(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqArea",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqArea" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqArea" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  gridInqArea(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridHasArea(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridHasArea",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridHasArea" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridHasArea(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefNvertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefNvertex",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefNvertex" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefNvertex" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  gridDefNvertex(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqNvertex(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:gridInqNvertex",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqNvertex" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqNvertex(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefXbounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefXbounds",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefXbounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefXbounds" "', argument " "2"" of type '" "double const *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  gridDefXbounds(arg1,(double const *)arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqXbounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqXbounds",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqXbounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqXbounds" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)gridInqXbounds(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefYbounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridDefYbounds",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefYbounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridDefYbounds" "', argument " "2"" of type '" "double const *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  gridDefYbounds(arg1,(double const *)arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqYbounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqYbounds",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqYbounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqYbounds" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)gridInqYbounds(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridDefRowlon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:gridDefRowlon",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridDefRowlon" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridDefRowlon" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "gridDefRowlon" "', argument " "3"" of type '" "int const *""'"); 
+  }
+  arg3 = (int *)(argp3);
+  gridDefRowlon(arg1,arg2,(int const *)arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridInqRowlon(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridInqRowlon",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridInqRowlon" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "gridInqRowlon" "', argument " "2"" of type '" "int *""'"); 
+  }
+  arg2 = (int *)(argp2);
+  gridInqRowlon(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_gridChangeType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:gridChangeType",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "gridChangeType" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "gridChangeType" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  gridChangeType(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisName",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisName" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisName" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  zaxisName(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisCreate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisCreate",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisCreate" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "zaxisCreate" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (int)zaxisCreate(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDestroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:zaxisDestroy",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDestroy" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  zaxisDestroy(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:zaxisInqType",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqType" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisInqType(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:zaxisInqSize",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqSize" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisInqSize(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDuplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:zaxisDuplicate",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDuplicate" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisDuplicate(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisResize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisResize",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisResize" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "zaxisResize" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  zaxisResize(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisPrint(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:zaxisPrint",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisPrint" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  zaxisPrint(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)":zaxisSize")) SWIG_fail;
+  result = (int)zaxisSize();
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDefLevels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisDefLevels",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDefLevels" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisDefLevels" "', argument " "2"" of type '" "double const *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  zaxisDefLevels(arg1,(double const *)arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqLevels(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisInqLevels",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqLevels" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisInqLevels" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  zaxisInqLevels(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDefLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  double arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:zaxisDefLevel",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDefLevel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "zaxisDefLevel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "zaxisDefLevel" "', argument " "3"" of type '" "double""'");
+  } 
+  arg3 = (double)(val3);
+  zaxisDefLevel(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqLevel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisInqLevel",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqLevel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "zaxisInqLevel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (double)zaxisInqLevel(arg1,arg2);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDefName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisDefName",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDefName" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisDefName" "', argument " "2"" of type '" "char const *""'");
+  }
+  arg2 = (char *)(buf2);
+  zaxisDefName(arg1,(char const *)arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDefLongname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisDefLongname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDefLongname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisDefLongname" "', argument " "2"" of type '" "char const *""'");
+  }
+  arg2 = (char *)(buf2);
+  zaxisDefLongname(arg1,(char const *)arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDefUnits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisDefUnits",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDefUnits" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisDefUnits" "', argument " "2"" of type '" "char const *""'");
+  }
+  arg2 = (char *)(buf2);
+  zaxisDefUnits(arg1,(char const *)arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisInqName",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqName" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisInqName" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  zaxisInqName(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqLongname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisInqLongname",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqLongname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisInqLongname" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  zaxisInqLongname(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqUnits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisInqUnits",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqUnits" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisInqUnits" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  zaxisInqUnits(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDefPrec(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisDefPrec",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDefPrec" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "zaxisDefPrec" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  zaxisDefPrec(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqPrec(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:zaxisInqPrec",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqPrec" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisInqPrec(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDefLtype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisDefLtype",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDefLtype" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "zaxisDefLtype" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  zaxisDefLtype(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqLtype(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:zaxisInqLtype",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqLtype" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisInqLtype(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqLevelsPtr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:zaxisInqLevelsPtr",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqLevelsPtr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (double *)zaxisInqLevelsPtr(arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDefVct(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  double *arg3 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:zaxisDefVct",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDefVct" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "zaxisDefVct" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "zaxisDefVct" "', argument " "3"" of type '" "double const *""'"); 
+  }
+  arg3 = (double *)(argp3);
+  zaxisDefVct(arg1,arg2,(double const *)arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqVctSize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:zaxisInqVctSize",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqVctSize" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisInqVctSize(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqVctPtr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:zaxisInqVctPtr",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqVctPtr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (double *)zaxisInqVctPtr(arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqLbounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisInqLbounds",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqLbounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisInqLbounds" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)zaxisInqLbounds(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqUbounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisInqUbounds",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqUbounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisInqUbounds" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)zaxisInqUbounds(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqWeights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisInqWeights",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqWeights" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisInqWeights" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)zaxisInqWeights(arg1,arg2);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqLbound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisInqLbound",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqLbound" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "zaxisInqLbound" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (double)zaxisInqLbound(arg1,arg2);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisInqUbound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisInqUbound",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisInqUbound" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "zaxisInqUbound" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (double)zaxisInqUbound(arg1,arg2);
+  resultobj = SWIG_From_double((double)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDefLbounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisDefLbounds",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDefLbounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisDefLbounds" "', argument " "2"" of type '" "double const *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  zaxisDefLbounds(arg1,(double const *)arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDefUbounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisDefUbounds",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDefUbounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisDefUbounds" "', argument " "2"" of type '" "double const *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  zaxisDefUbounds(arg1,(double const *)arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisDefWeights(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisDefWeights",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisDefWeights" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "zaxisDefWeights" "', argument " "2"" of type '" "double const *""'"); 
+  }
+  arg2 = (double *)(argp2);
+  zaxisDefWeights(arg1,(double const *)arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_zaxisChangeType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:zaxisChangeType",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "zaxisChangeType" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "zaxisChangeType" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  zaxisChangeType(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisCreate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisCreate",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisCreate" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisCreate(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDestroy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisDestroy",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDestroy" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  taxisDestroy(arg1);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDuplicate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisDuplicate",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDuplicate" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisDuplicate(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisCopyTimestep(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:taxisCopyTimestep",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisCopyTimestep" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "taxisCopyTimestep" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  taxisCopyTimestep(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDefType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:taxisDefType",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDefType" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "taxisDefType" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  taxisDefType(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDefVdate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:taxisDefVdate",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDefVdate" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "taxisDefVdate" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  taxisDefVdate(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDefVtime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:taxisDefVtime",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDefVtime" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "taxisDefVtime" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  taxisDefVtime(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDefRdate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:taxisDefRdate",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDefRdate" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "taxisDefRdate" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  taxisDefRdate(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDefRtime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:taxisDefRtime",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDefRtime" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "taxisDefRtime" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  taxisDefRtime(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisHasBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisHasBounds",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisHasBounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisHasBounds(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDefVdateBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:taxisDefVdateBounds",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDefVdateBounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "taxisDefVdateBounds" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "taxisDefVdateBounds" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  taxisDefVdateBounds(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDefVtimeBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:taxisDefVtimeBounds",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDefVtimeBounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "taxisDefVtimeBounds" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "taxisDefVtimeBounds" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = (int)(val3);
+  taxisDefVtimeBounds(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisInqVdateBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:taxisInqVdateBounds",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisInqVdateBounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "taxisInqVdateBounds" "', argument " "2"" of type '" "int *""'"); 
+  }
+  arg2 = (int *)(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "taxisInqVdateBounds" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = (int *)(argp3);
+  taxisInqVdateBounds(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisInqVtimeBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:taxisInqVtimeBounds",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisInqVtimeBounds" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "taxisInqVtimeBounds" "', argument " "2"" of type '" "int *""'"); 
+  }
+  arg2 = (int *)(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "taxisInqVtimeBounds" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = (int *)(argp3);
+  taxisInqVtimeBounds(arg1,arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDefCalendar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:taxisDefCalendar",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDefCalendar" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "taxisDefCalendar" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  taxisDefCalendar(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDefTunit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:taxisDefTunit",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDefTunit" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "taxisDefTunit" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  taxisDefTunit(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisDefNumavg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:taxisDefNumavg",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisDefNumavg" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "taxisDefNumavg" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  taxisDefNumavg(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisInqType(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisInqType",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisInqType" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqType(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisInqVdate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisInqVdate",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisInqVdate" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqVdate(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisInqVtime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisInqVtime",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisInqVtime" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqVtime(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisInqRdate(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisInqRdate",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisInqRdate" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqRdate(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisInqRtime(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisInqRtime",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisInqRtime" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqRtime(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisInqCalendar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisInqCalendar",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisInqCalendar" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqCalendar(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisInqTunit(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisInqTunit",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisInqTunit" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqTunit(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_taxisInqNumavg(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:taxisInqNumavg",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "taxisInqNumavg" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqNumavg(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tunitNamePtr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:tunitNamePtr",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tunitNamePtr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (char *)tunitNamePtr(arg1);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_institutDef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int res4 ;
+  char *buf4 = 0 ;
+  int alloc4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:institutDef",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "institutDef" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "institutDef" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "institutDef" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "institutDef" "', argument " "4"" of type '" "char const *""'");
+  }
+  arg4 = (char *)(buf4);
+  result = (int)institutDef(arg1,arg2,(char const *)arg3,(char const *)arg4);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_institutInq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int res4 ;
+  char *buf4 = 0 ;
+  int alloc4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:institutInq",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "institutInq" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "institutInq" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "institutInq" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "institutInq" "', argument " "4"" of type '" "char const *""'");
+  }
+  arg4 = (char *)(buf4);
+  result = (int)institutInq(arg1,arg2,(char const *)arg3,(char const *)arg4);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_institutInqNumber(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)":institutInqNumber")) SWIG_fail;
+  result = (int)institutInqNumber();
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_institutInqCenter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:institutInqCenter",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "institutInqCenter" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)institutInqCenter(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_institutInqSubcenter(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:institutInqSubcenter",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "institutInqSubcenter" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)institutInqSubcenter(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_institutInqNamePtr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:institutInqNamePtr",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "institutInqNamePtr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (char *)institutInqNamePtr(arg1);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_institutInqLongnamePtr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:institutInqLongnamePtr",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "institutInqLongnamePtr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (char *)institutInqLongnamePtr(arg1);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_modelDef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:modelDef",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "modelDef" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "modelDef" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "modelDef" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  result = (int)modelDef(arg1,arg2,(char const *)arg3);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_modelInq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:modelInq",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "modelInq" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "modelInq" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "modelInq" "', argument " "3"" of type '" "char *""'");
+  }
+  arg3 = (char *)(buf3);
+  result = (int)modelInq(arg1,arg2,arg3);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_modelInqInstitut(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:modelInqInstitut",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "modelInqInstitut" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)modelInqInstitut(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_modelInqGribID(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:modelInqGribID",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "modelInqGribID" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)modelInqGribID(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_modelInqNamePtr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:modelInqNamePtr",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "modelInqNamePtr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (char *)modelInqNamePtr(arg1);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableWriteC(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  char *arg1 = (char *) 0 ;
+  int arg2 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:tableWriteC",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tableWriteC" "', argument " "1"" of type '" "char const *""'");
+  }
+  arg1 = (char *)(buf1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableWriteC" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  tableWriteC((char const *)arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return resultobj;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableWrite(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  char *arg1 = (char *) 0 ;
+  int arg2 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:tableWrite",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tableWrite" "', argument " "1"" of type '" "char const *""'");
+  }
+  arg1 = (char *)(buf1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableWrite" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  tableWrite((char const *)arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return resultobj;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableRead(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  char *arg1 = (char *) 0 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:tableRead",&obj0)) SWIG_fail;
+  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "tableRead" "', argument " "1"" of type '" "char const *""'");
+  }
+  arg1 = (char *)(buf1);
+  result = (int)tableRead((char const *)arg1);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return resultobj;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableDef(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:tableDef",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableDef" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableDef" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "tableDef" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  result = (int)tableDef(arg1,arg2,(char const *)arg3);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqNamePtr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:tableInqNamePtr",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInqNamePtr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (char *)tableInqNamePtr(arg1);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableDefEntry(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  char *arg5 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int res4 ;
+  char *buf4 = 0 ;
+  int alloc4 = 0 ;
+  int res5 ;
+  char *buf5 = 0 ;
+  int alloc5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:tableDefEntry",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableDefEntry" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableDefEntry" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "tableDefEntry" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "tableDefEntry" "', argument " "4"" of type '" "char const *""'");
+  }
+  arg4 = (char *)(buf4);
+  res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5);
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "tableDefEntry" "', argument " "5"" of type '" "char const *""'");
+  }
+  arg5 = (char *)(buf5);
+  tableDefEntry(arg1,arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5);
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInq(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:tableInq",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInq" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableInq" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "tableInq" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  result = (int)tableInq(arg1,arg2,(char const *)arg3);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqNumber(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)":tableInqNumber")) SWIG_fail;
+  result = (int)tableInqNumber();
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqNum(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:tableInqNum",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInqNum" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)tableInqNum(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqModel(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:tableInqModel",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInqModel" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)tableInqModel(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqPar(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  char *arg5 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int res4 ;
+  char *buf4 = 0 ;
+  int alloc4 = 0 ;
+  int res5 ;
+  char *buf5 = 0 ;
+  int alloc5 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  PyObject * obj4 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOOO:tableInqPar",&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInqPar" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableInqPar" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "tableInqPar" "', argument " "3"" of type '" "char *""'");
+  }
+  arg3 = (char *)(buf3);
+  res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4);
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "tableInqPar" "', argument " "4"" of type '" "char *""'");
+  }
+  arg4 = (char *)(buf4);
+  res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5);
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "tableInqPar" "', argument " "5"" of type '" "char *""'");
+  }
+  arg5 = (char *)(buf5);
+  tableInqPar(arg1,arg2,arg3,arg4,arg5);
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqParCode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:tableInqParCode",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInqParCode" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "tableInqParCode" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "tableInqParCode" "', argument " "3"" of type '" "int *""'"); 
+  }
+  arg3 = (int *)(argp3);
+  result = (int)tableInqParCode(arg1,arg2,arg3);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqParName(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:tableInqParName",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInqParName" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableInqParName" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "tableInqParName" "', argument " "3"" of type '" "char *""'");
+  }
+  arg3 = (char *)(buf3);
+  result = (int)tableInqParName(arg1,arg2,arg3);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqParLongname(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:tableInqParLongname",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInqParLongname" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableInqParLongname" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "tableInqParLongname" "', argument " "3"" of type '" "char *""'");
+  }
+  arg3 = (char *)(buf3);
+  result = (int)tableInqParLongname(arg1,arg2,arg3);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqParUnits(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:tableInqParUnits",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInqParUnits" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableInqParUnits" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "tableInqParUnits" "', argument " "3"" of type '" "char *""'");
+  }
+  arg3 = (char *)(buf3);
+  result = (int)tableInqParUnits(arg1,arg2,arg3);
+  resultobj = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqParNamePtr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:tableInqParNamePtr",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInqParNamePtr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableInqParNamePtr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (char *)tableInqParNamePtr(arg1,arg2);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqParLongnamePtr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:tableInqParLongnamePtr",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInqParLongnamePtr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableInqParLongnamePtr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (char *)tableInqParLongnamePtr(arg1,arg2);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_tableInqParUnitsPtr(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:tableInqParUnitsPtr",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "tableInqParUnitsPtr" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "tableInqParUnitsPtr" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  result = (char *)tableInqParUnitsPtr(arg1,arg2);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamDefHistory(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:streamDefHistory",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamDefHistory" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "streamDefHistory" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "streamDefHistory" "', argument " "3"" of type '" "char const *""'");
+  }
+  arg3 = (char *)(buf3);
+  streamDefHistory(arg1,arg2,(char const *)arg3);
+  resultobj = SWIG_Py_Void();
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return resultobj;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamInqHistorySize(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:streamInqHistorySize",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamInqHistorySize" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqHistorySize(arg1);
+  resultobj = SWIG_From_int((int)(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_streamInqHistoryString(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:streamInqHistoryString",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "streamInqHistoryString" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "streamInqHistoryString" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = (char *)(buf2);
+  streamInqHistoryString(arg1,arg2);
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return NULL;
+}
+
+
+static PyMethodDef SwigMethods[] = {
+	 { (char *)"cdiStringError", _wrap_cdiStringError, METH_VARARGS, NULL},
+	 { (char *)"cdiDebug", _wrap_cdiDebug, METH_VARARGS, NULL},
+	 { (char *)"cdiLibraryVersion", _wrap_cdiLibraryVersion, METH_VARARGS, NULL},
+	 { (char *)"cdiPrintVersion", _wrap_cdiPrintVersion, METH_VARARGS, NULL},
+	 { (char *)"cdiDefMissval", _wrap_cdiDefMissval, METH_VARARGS, NULL},
+	 { (char *)"cdiInqMissval", _wrap_cdiInqMissval, METH_VARARGS, NULL},
+	 { (char *)"cdiDefGlobal", _wrap_cdiDefGlobal, METH_VARARGS, NULL},
+	 { (char *)"streamOpenRead", _wrap_streamOpenRead, METH_VARARGS, NULL},
+	 { (char *)"streamOpenWrite", _wrap_streamOpenWrite, METH_VARARGS, NULL},
+	 { (char *)"streamOpenAppend", _wrap_streamOpenAppend, METH_VARARGS, NULL},
+	 { (char *)"streamClose", _wrap_streamClose, METH_VARARGS, NULL},
+	 { (char *)"streamSync", _wrap_streamSync, METH_VARARGS, NULL},
+	 { (char *)"streamDefVlist", _wrap_streamDefVlist, METH_VARARGS, NULL},
+	 { (char *)"streamInqVlist", _wrap_streamInqVlist, METH_VARARGS, NULL},
+	 { (char *)"streamInqFiletype", _wrap_streamInqFiletype, METH_VARARGS, NULL},
+	 { (char *)"streamDefByteorder", _wrap_streamDefByteorder, METH_VARARGS, NULL},
+	 { (char *)"streamInqByteorder", _wrap_streamInqByteorder, METH_VARARGS, NULL},
+	 { (char *)"streamDefZtype", _wrap_streamDefZtype, METH_VARARGS, NULL},
+	 { (char *)"streamDefZlevel", _wrap_streamDefZlevel, METH_VARARGS, NULL},
+	 { (char *)"streamInqZtype", _wrap_streamInqZtype, METH_VARARGS, NULL},
+	 { (char *)"streamInqZlevel", _wrap_streamInqZlevel, METH_VARARGS, NULL},
+	 { (char *)"streamDefTimestep", _wrap_streamDefTimestep, METH_VARARGS, NULL},
+	 { (char *)"streamInqTimestep", _wrap_streamInqTimestep, METH_VARARGS, NULL},
+	 { (char *)"streamFilename", _wrap_streamFilename, METH_VARARGS, NULL},
+	 { (char *)"streamFilesuffix", _wrap_streamFilesuffix, METH_VARARGS, NULL},
+	 { (char *)"streamNtsteps", _wrap_streamNtsteps, METH_VARARGS, NULL},
+	 { (char *)"streamNvals", _wrap_streamNvals, METH_VARARGS, NULL},
+	 { (char *)"streamReadVar", _wrap_streamReadVar, METH_VARARGS, NULL},
+	 { (char *)"streamWriteVar", _wrap_streamWriteVar, METH_VARARGS, NULL},
+	 { (char *)"streamReadVarSlice", _wrap_streamReadVarSlice, METH_VARARGS, NULL},
+	 { (char *)"streamWriteVarSlice", _wrap_streamWriteVarSlice, METH_VARARGS, NULL},
+	 { (char *)"streamInqRecord", _wrap_streamInqRecord, METH_VARARGS, NULL},
+	 { (char *)"streamDefRecord", _wrap_streamDefRecord, METH_VARARGS, NULL},
+	 { (char *)"streamReadRecord", _wrap_streamReadRecord, METH_VARARGS, NULL},
+	 { (char *)"streamWriteRecord", _wrap_streamWriteRecord, METH_VARARGS, NULL},
+	 { (char *)"streamCopyRecord", _wrap_streamCopyRecord, METH_VARARGS, NULL},
+	 { (char *)"streamInqGinfo", _wrap_streamInqGinfo, METH_VARARGS, NULL},
+	 { (char *)"vlistCreate", _wrap_vlistCreate, METH_VARARGS, NULL},
+	 { (char *)"vlistDestroy", _wrap_vlistDestroy, METH_VARARGS, NULL},
+	 { (char *)"vlistDuplicate", _wrap_vlistDuplicate, METH_VARARGS, NULL},
+	 { (char *)"vlistCopy", _wrap_vlistCopy, METH_VARARGS, NULL},
+	 { (char *)"vlistCopyFlag", _wrap_vlistCopyFlag, METH_VARARGS, NULL},
+	 { (char *)"vlistClearFlag", _wrap_vlistClearFlag, METH_VARARGS, NULL},
+	 { (char *)"vlistCat", _wrap_vlistCat, METH_VARARGS, NULL},
+	 { (char *)"vlistMerge", _wrap_vlistMerge, METH_VARARGS, NULL},
+	 { (char *)"vlistPrint", _wrap_vlistPrint, METH_VARARGS, NULL},
+	 { (char *)"vlistNvars", _wrap_vlistNvars, METH_VARARGS, NULL},
+	 { (char *)"vlistNgrids", _wrap_vlistNgrids, METH_VARARGS, NULL},
+	 { (char *)"vlistNzaxis", _wrap_vlistNzaxis, METH_VARARGS, NULL},
+	 { (char *)"vlistDefNtsteps", _wrap_vlistDefNtsteps, METH_VARARGS, NULL},
+	 { (char *)"vlistNtsteps", _wrap_vlistNtsteps, METH_VARARGS, NULL},
+	 { (char *)"vlistGridsizeMax", _wrap_vlistGridsizeMax, METH_VARARGS, NULL},
+	 { (char *)"vlistGrid", _wrap_vlistGrid, METH_VARARGS, NULL},
+	 { (char *)"vlistGridIndex", _wrap_vlistGridIndex, METH_VARARGS, NULL},
+	 { (char *)"vlistChangeGridIndex", _wrap_vlistChangeGridIndex, METH_VARARGS, NULL},
+	 { (char *)"vlistChangeGrid", _wrap_vlistChangeGrid, METH_VARARGS, NULL},
+	 { (char *)"vlistZaxis", _wrap_vlistZaxis, METH_VARARGS, NULL},
+	 { (char *)"vlistZaxisIndex", _wrap_vlistZaxisIndex, METH_VARARGS, NULL},
+	 { (char *)"vlistChangeZaxisIndex", _wrap_vlistChangeZaxisIndex, METH_VARARGS, NULL},
+	 { (char *)"vlistChangeZaxis", _wrap_vlistChangeZaxis, METH_VARARGS, NULL},
+	 { (char *)"vlistNrecs", _wrap_vlistNrecs, METH_VARARGS, NULL},
+	 { (char *)"vlistDefTaxis", _wrap_vlistDefTaxis, METH_VARARGS, NULL},
+	 { (char *)"vlistInqTaxis", _wrap_vlistInqTaxis, METH_VARARGS, NULL},
+	 { (char *)"vlistDefTable", _wrap_vlistDefTable, METH_VARARGS, NULL},
+	 { (char *)"vlistInqTable", _wrap_vlistInqTable, METH_VARARGS, NULL},
+	 { (char *)"vlistDefInstitut", _wrap_vlistDefInstitut, METH_VARARGS, NULL},
+	 { (char *)"vlistInqInstitut", _wrap_vlistInqInstitut, METH_VARARGS, NULL},
+	 { (char *)"vlistDefModel", _wrap_vlistDefModel, METH_VARARGS, NULL},
+	 { (char *)"vlistInqModel", _wrap_vlistInqModel, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVar", _wrap_vlistDefVar, METH_VARARGS, NULL},
+	 { (char *)"vlistChangeVarGrid", _wrap_vlistChangeVarGrid, METH_VARARGS, NULL},
+	 { (char *)"vlistChangeVarZaxis", _wrap_vlistChangeVarZaxis, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVar", _wrap_vlistInqVar, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarGrid", _wrap_vlistInqVarGrid, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarZaxis", _wrap_vlistInqVarZaxis, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarTime", _wrap_vlistInqVarTime, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarZtype", _wrap_vlistDefVarZtype, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarZtype", _wrap_vlistInqVarZtype, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarZlevel", _wrap_vlistDefVarZlevel, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarZlevel", _wrap_vlistInqVarZlevel, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarCode", _wrap_vlistDefVarCode, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarCode", _wrap_vlistInqVarCode, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarDatatype", _wrap_vlistDefVarDatatype, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarDatatype", _wrap_vlistInqVarDatatype, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarInstitut", _wrap_vlistDefVarInstitut, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarInstitut", _wrap_vlistInqVarInstitut, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarModel", _wrap_vlistDefVarModel, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarModel", _wrap_vlistInqVarModel, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarTable", _wrap_vlistDefVarTable, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarTable", _wrap_vlistInqVarTable, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarName", _wrap_vlistDefVarName, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarName", _wrap_vlistInqVarName, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarLongname", _wrap_vlistDefVarLongname, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarStdname", _wrap_vlistDefVarStdname, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarLongname", _wrap_vlistInqVarLongname, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarStdname", _wrap_vlistInqVarStdname, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarUnits", _wrap_vlistDefVarUnits, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarUnits", _wrap_vlistInqVarUnits, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarMissval", _wrap_vlistDefVarMissval, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarMissval", _wrap_vlistInqVarMissval, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarScalefactor", _wrap_vlistDefVarScalefactor, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarScalefactor", _wrap_vlistInqVarScalefactor, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarAddoffset", _wrap_vlistDefVarAddoffset, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarAddoffset", _wrap_vlistInqVarAddoffset, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarTimave", _wrap_vlistDefVarTimave, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarTimave", _wrap_vlistInqVarTimave, METH_VARARGS, NULL},
+	 { (char *)"vlistDefVarTimaccu", _wrap_vlistDefVarTimaccu, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarTimaccu", _wrap_vlistInqVarTimaccu, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarSize", _wrap_vlistInqVarSize, METH_VARARGS, NULL},
+	 { (char *)"vlistInqVarID", _wrap_vlistInqVarID, METH_VARARGS, NULL},
+	 { (char *)"vlistDefIndex", _wrap_vlistDefIndex, METH_VARARGS, NULL},
+	 { (char *)"vlistInqIndex", _wrap_vlistInqIndex, METH_VARARGS, NULL},
+	 { (char *)"vlistDefFlag", _wrap_vlistDefFlag, METH_VARARGS, NULL},
+	 { (char *)"vlistInqFlag", _wrap_vlistInqFlag, METH_VARARGS, NULL},
+	 { (char *)"vlistFindVar", _wrap_vlistFindVar, METH_VARARGS, NULL},
+	 { (char *)"vlistFindLevel", _wrap_vlistFindLevel, METH_VARARGS, NULL},
+	 { (char *)"vlistMergedVar", _wrap_vlistMergedVar, METH_VARARGS, NULL},
+	 { (char *)"vlistMergedLevel", _wrap_vlistMergedLevel, METH_VARARGS, NULL},
+	 { (char *)"vlistInqNatts", _wrap_vlistInqNatts, METH_VARARGS, NULL},
+	 { (char *)"vlistInqAtt", _wrap_vlistInqAtt, METH_VARARGS, NULL},
+	 { (char *)"vlistDelAtt", _wrap_vlistDelAtt, METH_VARARGS, NULL},
+	 { (char *)"vlistDefAttInt", _wrap_vlistDefAttInt, METH_VARARGS, NULL},
+	 { (char *)"vlistDefAttFlt", _wrap_vlistDefAttFlt, METH_VARARGS, NULL},
+	 { (char *)"vlistDefAttTxt", _wrap_vlistDefAttTxt, METH_VARARGS, NULL},
+	 { (char *)"vlistInqAttInt", _wrap_vlistInqAttInt, METH_VARARGS, NULL},
+	 { (char *)"vlistInqAttFlt", _wrap_vlistInqAttFlt, METH_VARARGS, NULL},
+	 { (char *)"vlistInqAttTxt", _wrap_vlistInqAttTxt, METH_VARARGS, NULL},
+	 { (char *)"gridName", _wrap_gridName, METH_VARARGS, NULL},
+	 { (char *)"gridNamePtr", _wrap_gridNamePtr, METH_VARARGS, NULL},
+	 { (char *)"gridCompress", _wrap_gridCompress, METH_VARARGS, NULL},
+	 { (char *)"gridDefMask", _wrap_gridDefMask, METH_VARARGS, NULL},
+	 { (char *)"gridInqMask", _wrap_gridInqMask, METH_VARARGS, NULL},
+	 { (char *)"gridPrint", _wrap_gridPrint, METH_VARARGS, NULL},
+	 { (char *)"gridSize", _wrap_gridSize, METH_VARARGS, NULL},
+	 { (char *)"gridCreate", _wrap_gridCreate, METH_VARARGS, NULL},
+	 { (char *)"gridDestroy", _wrap_gridDestroy, METH_VARARGS, NULL},
+	 { (char *)"gridDuplicate", _wrap_gridDuplicate, METH_VARARGS, NULL},
+	 { (char *)"gridInqType", _wrap_gridInqType, METH_VARARGS, NULL},
+	 { (char *)"gridInqSize", _wrap_gridInqSize, METH_VARARGS, NULL},
+	 { (char *)"gridDefXsize", _wrap_gridDefXsize, METH_VARARGS, NULL},
+	 { (char *)"gridInqXsize", _wrap_gridInqXsize, METH_VARARGS, NULL},
+	 { (char *)"gridDefYsize", _wrap_gridDefYsize, METH_VARARGS, NULL},
+	 { (char *)"gridInqYsize", _wrap_gridInqYsize, METH_VARARGS, NULL},
+	 { (char *)"gridDefXvals", _wrap_gridDefXvals, METH_VARARGS, NULL},
+	 { (char *)"gridInqXvals", _wrap_gridInqXvals, METH_VARARGS, NULL},
+	 { (char *)"gridDefYvals", _wrap_gridDefYvals, METH_VARARGS, NULL},
+	 { (char *)"gridInqYvals", _wrap_gridInqYvals, METH_VARARGS, NULL},
+	 { (char *)"gridDefXname", _wrap_gridDefXname, METH_VARARGS, NULL},
+	 { (char *)"gridDefXlongname", _wrap_gridDefXlongname, METH_VARARGS, NULL},
+	 { (char *)"gridDefXunits", _wrap_gridDefXunits, METH_VARARGS, NULL},
+	 { (char *)"gridDefYname", _wrap_gridDefYname, METH_VARARGS, NULL},
+	 { (char *)"gridDefYlongname", _wrap_gridDefYlongname, METH_VARARGS, NULL},
+	 { (char *)"gridDefYunits", _wrap_gridDefYunits, METH_VARARGS, NULL},
+	 { (char *)"gridInqXname", _wrap_gridInqXname, METH_VARARGS, NULL},
+	 { (char *)"gridInqXlongname", _wrap_gridInqXlongname, METH_VARARGS, NULL},
+	 { (char *)"gridInqXstdname", _wrap_gridInqXstdname, METH_VARARGS, NULL},
+	 { (char *)"gridInqXunits", _wrap_gridInqXunits, METH_VARARGS, NULL},
+	 { (char *)"gridInqYname", _wrap_gridInqYname, METH_VARARGS, NULL},
+	 { (char *)"gridInqYlongname", _wrap_gridInqYlongname, METH_VARARGS, NULL},
+	 { (char *)"gridInqYstdname", _wrap_gridInqYstdname, METH_VARARGS, NULL},
+	 { (char *)"gridInqYunits", _wrap_gridInqYunits, METH_VARARGS, NULL},
+	 { (char *)"gridDefPrec", _wrap_gridDefPrec, METH_VARARGS, NULL},
+	 { (char *)"gridInqPrec", _wrap_gridInqPrec, METH_VARARGS, NULL},
+	 { (char *)"gridInqXval", _wrap_gridInqXval, METH_VARARGS, NULL},
+	 { (char *)"gridInqYval", _wrap_gridInqYval, METH_VARARGS, NULL},
+	 { (char *)"gridInqXinc", _wrap_gridInqXinc, METH_VARARGS, NULL},
+	 { (char *)"gridInqYinc", _wrap_gridInqYinc, METH_VARARGS, NULL},
+	 { (char *)"gridIsCircular", _wrap_gridIsCircular, METH_VARARGS, NULL},
+	 { (char *)"gridIsRotated", _wrap_gridIsRotated, METH_VARARGS, NULL},
+	 { (char *)"gridInqXpole", _wrap_gridInqXpole, METH_VARARGS, NULL},
+	 { (char *)"gridDefXpole", _wrap_gridDefXpole, METH_VARARGS, NULL},
+	 { (char *)"gridInqYpole", _wrap_gridInqYpole, METH_VARARGS, NULL},
+	 { (char *)"gridDefYpole", _wrap_gridDefYpole, METH_VARARGS, NULL},
+	 { (char *)"gridInqAngle", _wrap_gridInqAngle, METH_VARARGS, NULL},
+	 { (char *)"gridDefAngle", _wrap_gridDefAngle, METH_VARARGS, NULL},
+	 { (char *)"gridDefTrunc", _wrap_gridDefTrunc, METH_VARARGS, NULL},
+	 { (char *)"gridInqTrunc", _wrap_gridInqTrunc, METH_VARARGS, NULL},
+	 { (char *)"gridInqGMEnd", _wrap_gridInqGMEnd, METH_VARARGS, NULL},
+	 { (char *)"gridDefGMEnd", _wrap_gridDefGMEnd, METH_VARARGS, NULL},
+	 { (char *)"gridInqGMEni", _wrap_gridInqGMEni, METH_VARARGS, NULL},
+	 { (char *)"gridDefGMEni", _wrap_gridDefGMEni, METH_VARARGS, NULL},
+	 { (char *)"gridInqGMEni2", _wrap_gridInqGMEni2, METH_VARARGS, NULL},
+	 { (char *)"gridDefGMEni2", _wrap_gridDefGMEni2, METH_VARARGS, NULL},
+	 { (char *)"gridInqGMEni3", _wrap_gridInqGMEni3, METH_VARARGS, NULL},
+	 { (char *)"gridDefGMEni3", _wrap_gridDefGMEni3, METH_VARARGS, NULL},
+	 { (char *)"gridDefLCC", _wrap_gridDefLCC, METH_VARARGS, NULL},
+	 { (char *)"gridInqLCC", _wrap_gridInqLCC, METH_VARARGS, NULL},
+	 { (char *)"gridDefLcc2", _wrap_gridDefLcc2, METH_VARARGS, NULL},
+	 { (char *)"gridInqLcc2", _wrap_gridInqLcc2, METH_VARARGS, NULL},
+	 { (char *)"gridDefLaea", _wrap_gridDefLaea, METH_VARARGS, NULL},
+	 { (char *)"gridInqLaea", _wrap_gridInqLaea, METH_VARARGS, NULL},
+	 { (char *)"gridDefArea", _wrap_gridDefArea, METH_VARARGS, NULL},
+	 { (char *)"gridInqArea", _wrap_gridInqArea, METH_VARARGS, NULL},
+	 { (char *)"gridHasArea", _wrap_gridHasArea, METH_VARARGS, NULL},
+	 { (char *)"gridDefNvertex", _wrap_gridDefNvertex, METH_VARARGS, NULL},
+	 { (char *)"gridInqNvertex", _wrap_gridInqNvertex, METH_VARARGS, NULL},
+	 { (char *)"gridDefXbounds", _wrap_gridDefXbounds, METH_VARARGS, NULL},
+	 { (char *)"gridInqXbounds", _wrap_gridInqXbounds, METH_VARARGS, NULL},
+	 { (char *)"gridDefYbounds", _wrap_gridDefYbounds, METH_VARARGS, NULL},
+	 { (char *)"gridInqYbounds", _wrap_gridInqYbounds, METH_VARARGS, NULL},
+	 { (char *)"gridDefRowlon", _wrap_gridDefRowlon, METH_VARARGS, NULL},
+	 { (char *)"gridInqRowlon", _wrap_gridInqRowlon, METH_VARARGS, NULL},
+	 { (char *)"gridChangeType", _wrap_gridChangeType, METH_VARARGS, NULL},
+	 { (char *)"zaxisName", _wrap_zaxisName, METH_VARARGS, NULL},
+	 { (char *)"zaxisCreate", _wrap_zaxisCreate, METH_VARARGS, NULL},
+	 { (char *)"zaxisDestroy", _wrap_zaxisDestroy, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqType", _wrap_zaxisInqType, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqSize", _wrap_zaxisInqSize, METH_VARARGS, NULL},
+	 { (char *)"zaxisDuplicate", _wrap_zaxisDuplicate, METH_VARARGS, NULL},
+	 { (char *)"zaxisResize", _wrap_zaxisResize, METH_VARARGS, NULL},
+	 { (char *)"zaxisPrint", _wrap_zaxisPrint, METH_VARARGS, NULL},
+	 { (char *)"zaxisSize", _wrap_zaxisSize, METH_VARARGS, NULL},
+	 { (char *)"zaxisDefLevels", _wrap_zaxisDefLevels, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqLevels", _wrap_zaxisInqLevels, METH_VARARGS, NULL},
+	 { (char *)"zaxisDefLevel", _wrap_zaxisDefLevel, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqLevel", _wrap_zaxisInqLevel, METH_VARARGS, NULL},
+	 { (char *)"zaxisDefName", _wrap_zaxisDefName, METH_VARARGS, NULL},
+	 { (char *)"zaxisDefLongname", _wrap_zaxisDefLongname, METH_VARARGS, NULL},
+	 { (char *)"zaxisDefUnits", _wrap_zaxisDefUnits, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqName", _wrap_zaxisInqName, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqLongname", _wrap_zaxisInqLongname, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqUnits", _wrap_zaxisInqUnits, METH_VARARGS, NULL},
+	 { (char *)"zaxisDefPrec", _wrap_zaxisDefPrec, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqPrec", _wrap_zaxisInqPrec, METH_VARARGS, NULL},
+	 { (char *)"zaxisDefLtype", _wrap_zaxisDefLtype, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqLtype", _wrap_zaxisInqLtype, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqLevelsPtr", _wrap_zaxisInqLevelsPtr, METH_VARARGS, NULL},
+	 { (char *)"zaxisDefVct", _wrap_zaxisDefVct, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqVctSize", _wrap_zaxisInqVctSize, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqVctPtr", _wrap_zaxisInqVctPtr, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqLbounds", _wrap_zaxisInqLbounds, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqUbounds", _wrap_zaxisInqUbounds, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqWeights", _wrap_zaxisInqWeights, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqLbound", _wrap_zaxisInqLbound, METH_VARARGS, NULL},
+	 { (char *)"zaxisInqUbound", _wrap_zaxisInqUbound, METH_VARARGS, NULL},
+	 { (char *)"zaxisDefLbounds", _wrap_zaxisDefLbounds, METH_VARARGS, NULL},
+	 { (char *)"zaxisDefUbounds", _wrap_zaxisDefUbounds, METH_VARARGS, NULL},
+	 { (char *)"zaxisDefWeights", _wrap_zaxisDefWeights, METH_VARARGS, NULL},
+	 { (char *)"zaxisChangeType", _wrap_zaxisChangeType, METH_VARARGS, NULL},
+	 { (char *)"taxisCreate", _wrap_taxisCreate, METH_VARARGS, NULL},
+	 { (char *)"taxisDestroy", _wrap_taxisDestroy, METH_VARARGS, NULL},
+	 { (char *)"taxisDuplicate", _wrap_taxisDuplicate, METH_VARARGS, NULL},
+	 { (char *)"taxisCopyTimestep", _wrap_taxisCopyTimestep, METH_VARARGS, NULL},
+	 { (char *)"taxisDefType", _wrap_taxisDefType, METH_VARARGS, NULL},
+	 { (char *)"taxisDefVdate", _wrap_taxisDefVdate, METH_VARARGS, NULL},
+	 { (char *)"taxisDefVtime", _wrap_taxisDefVtime, METH_VARARGS, NULL},
+	 { (char *)"taxisDefRdate", _wrap_taxisDefRdate, METH_VARARGS, NULL},
+	 { (char *)"taxisDefRtime", _wrap_taxisDefRtime, METH_VARARGS, NULL},
+	 { (char *)"taxisHasBounds", _wrap_taxisHasBounds, METH_VARARGS, NULL},
+	 { (char *)"taxisDefVdateBounds", _wrap_taxisDefVdateBounds, METH_VARARGS, NULL},
+	 { (char *)"taxisDefVtimeBounds", _wrap_taxisDefVtimeBounds, METH_VARARGS, NULL},
+	 { (char *)"taxisInqVdateBounds", _wrap_taxisInqVdateBounds, METH_VARARGS, NULL},
+	 { (char *)"taxisInqVtimeBounds", _wrap_taxisInqVtimeBounds, METH_VARARGS, NULL},
+	 { (char *)"taxisDefCalendar", _wrap_taxisDefCalendar, METH_VARARGS, NULL},
+	 { (char *)"taxisDefTunit", _wrap_taxisDefTunit, METH_VARARGS, NULL},
+	 { (char *)"taxisDefNumavg", _wrap_taxisDefNumavg, METH_VARARGS, NULL},
+	 { (char *)"taxisInqType", _wrap_taxisInqType, METH_VARARGS, NULL},
+	 { (char *)"taxisInqVdate", _wrap_taxisInqVdate, METH_VARARGS, NULL},
+	 { (char *)"taxisInqVtime", _wrap_taxisInqVtime, METH_VARARGS, NULL},
+	 { (char *)"taxisInqRdate", _wrap_taxisInqRdate, METH_VARARGS, NULL},
+	 { (char *)"taxisInqRtime", _wrap_taxisInqRtime, METH_VARARGS, NULL},
+	 { (char *)"taxisInqCalendar", _wrap_taxisInqCalendar, METH_VARARGS, NULL},
+	 { (char *)"taxisInqTunit", _wrap_taxisInqTunit, METH_VARARGS, NULL},
+	 { (char *)"taxisInqNumavg", _wrap_taxisInqNumavg, METH_VARARGS, NULL},
+	 { (char *)"tunitNamePtr", _wrap_tunitNamePtr, METH_VARARGS, NULL},
+	 { (char *)"institutDef", _wrap_institutDef, METH_VARARGS, NULL},
+	 { (char *)"institutInq", _wrap_institutInq, METH_VARARGS, NULL},
+	 { (char *)"institutInqNumber", _wrap_institutInqNumber, METH_VARARGS, NULL},
+	 { (char *)"institutInqCenter", _wrap_institutInqCenter, METH_VARARGS, NULL},
+	 { (char *)"institutInqSubcenter", _wrap_institutInqSubcenter, METH_VARARGS, NULL},
+	 { (char *)"institutInqNamePtr", _wrap_institutInqNamePtr, METH_VARARGS, NULL},
+	 { (char *)"institutInqLongnamePtr", _wrap_institutInqLongnamePtr, METH_VARARGS, NULL},
+	 { (char *)"modelDef", _wrap_modelDef, METH_VARARGS, NULL},
+	 { (char *)"modelInq", _wrap_modelInq, METH_VARARGS, NULL},
+	 { (char *)"modelInqInstitut", _wrap_modelInqInstitut, METH_VARARGS, NULL},
+	 { (char *)"modelInqGribID", _wrap_modelInqGribID, METH_VARARGS, NULL},
+	 { (char *)"modelInqNamePtr", _wrap_modelInqNamePtr, METH_VARARGS, NULL},
+	 { (char *)"tableWriteC", _wrap_tableWriteC, METH_VARARGS, NULL},
+	 { (char *)"tableWrite", _wrap_tableWrite, METH_VARARGS, NULL},
+	 { (char *)"tableRead", _wrap_tableRead, METH_VARARGS, NULL},
+	 { (char *)"tableDef", _wrap_tableDef, METH_VARARGS, NULL},
+	 { (char *)"tableInqNamePtr", _wrap_tableInqNamePtr, METH_VARARGS, NULL},
+	 { (char *)"tableDefEntry", _wrap_tableDefEntry, METH_VARARGS, NULL},
+	 { (char *)"tableInq", _wrap_tableInq, METH_VARARGS, NULL},
+	 { (char *)"tableInqNumber", _wrap_tableInqNumber, METH_VARARGS, NULL},
+	 { (char *)"tableInqNum", _wrap_tableInqNum, METH_VARARGS, NULL},
+	 { (char *)"tableInqModel", _wrap_tableInqModel, METH_VARARGS, NULL},
+	 { (char *)"tableInqPar", _wrap_tableInqPar, METH_VARARGS, NULL},
+	 { (char *)"tableInqParCode", _wrap_tableInqParCode, METH_VARARGS, NULL},
+	 { (char *)"tableInqParName", _wrap_tableInqParName, METH_VARARGS, NULL},
+	 { (char *)"tableInqParLongname", _wrap_tableInqParLongname, METH_VARARGS, NULL},
+	 { (char *)"tableInqParUnits", _wrap_tableInqParUnits, METH_VARARGS, NULL},
+	 { (char *)"tableInqParNamePtr", _wrap_tableInqParNamePtr, METH_VARARGS, NULL},
+	 { (char *)"tableInqParLongnamePtr", _wrap_tableInqParLongnamePtr, METH_VARARGS, NULL},
+	 { (char *)"tableInqParUnitsPtr", _wrap_tableInqParUnitsPtr, METH_VARARGS, NULL},
+	 { (char *)"streamDefHistory", _wrap_streamDefHistory, METH_VARARGS, NULL},
+	 { (char *)"streamInqHistorySize", _wrap_streamInqHistorySize, METH_VARARGS, NULL},
+	 { (char *)"streamInqHistoryString", _wrap_streamInqHistoryString, METH_VARARGS, NULL},
+	 { NULL, NULL, 0, NULL }
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_off_t = {"_p_off_t", "off_t *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_char,
+  &_swigt__p_double,
+  &_swigt__p_float,
+  &_swigt__p_int,
+  &_swigt__p_off_t,
+};
+
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_off_t[] = {  {&_swigt__p_off_t, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_char,
+  _swigc__p_double,
+  _swigc__p_float,
+  _swigc__p_int,
+  _swigc__p_off_t,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_const_info swig_const_table[] = {
+{0, 0, 0, 0.0, 0, 0}};
+
+#ifdef __cplusplus
+}
+#endif
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found, init;
+  
+  clientdata = clientdata;
+  
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+    init = 1;
+  } else {
+    init = 0;
+  }
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+  
+  /* When multiple interpeters are used, a module could have already been initialized in
+       a different interpreter, but not yet have a pointer in this interpreter.
+       In this case, we do not want to continue adding types... everything should be
+       set up already */
+  if (init == 0) return;
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+  
+  /* Python-specific SWIG API */
+#define SWIG_newvarlink()                             SWIG_Python_newvarlink()
+#define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
+#define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
+  
+  /* -----------------------------------------------------------------------------
+   * global variable support code.
+   * ----------------------------------------------------------------------------- */
+  
+  typedef struct swig_globalvar {
+    char       *name;                  /* Name of global variable */
+    PyObject *(*get_attr)(void);       /* Return the current value */
+    int       (*set_attr)(PyObject *); /* Set the value */
+    struct swig_globalvar *next;
+  } swig_globalvar;
+  
+  typedef struct swig_varlinkobject {
+    PyObject_HEAD
+    swig_globalvar *vars;
+  } swig_varlinkobject;
+  
+  SWIGINTERN PyObject *
+  swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
+    return PyString_FromString("<Swig global variables>");
+  }
+  
+  SWIGINTERN PyObject *
+  swig_varlink_str(swig_varlinkobject *v) {
+    PyObject *str = PyString_FromString("(");
+    swig_globalvar  *var;
+    for (var = v->vars; var; var=var->next) {
+      PyString_ConcatAndDel(&str,PyString_FromString(var->name));
+      if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
+    }
+    PyString_ConcatAndDel(&str,PyString_FromString(")"));
+    return str;
+  }
+  
+  SWIGINTERN int
+  swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
+    PyObject *str = swig_varlink_str(v);
+    fprintf(fp,"Swig global variables ");
+    fprintf(fp,"%s\n", PyString_AsString(str));
+    Py_DECREF(str);
+    return 0;
+  }
+  
+  SWIGINTERN void
+  swig_varlink_dealloc(swig_varlinkobject *v) {
+    swig_globalvar *var = v->vars;
+    while (var) {
+      swig_globalvar *n = var->next;
+      free(var->name);
+      free(var);
+      var = n;
+    }
+  }
+  
+  SWIGINTERN PyObject *
+  swig_varlink_getattr(swig_varlinkobject *v, char *n) {
+    PyObject *res = NULL;
+    swig_globalvar *var = v->vars;
+    while (var) {
+      if (strcmp(var->name,n) == 0) {
+        res = (*var->get_attr)();
+        break;
+      }
+      var = var->next;
+    }
+    if (res == NULL && !PyErr_Occurred()) {
+      PyErr_SetString(PyExc_NameError,"Unknown C global variable");
+    }
+    return res;
+  }
+  
+  SWIGINTERN int
+  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
+    int res = 1;
+    swig_globalvar *var = v->vars;
+    while (var) {
+      if (strcmp(var->name,n) == 0) {
+        res = (*var->set_attr)(p);
+        break;
+      }
+      var = var->next;
+    }
+    if (res == 1 && !PyErr_Occurred()) {
+      PyErr_SetString(PyExc_NameError,"Unknown C global variable");
+    }
+    return res;
+  }
+  
+  SWIGINTERN PyTypeObject*
+  swig_varlink_type(void) {
+    static char varlink__doc__[] = "Swig var link object";
+    static PyTypeObject varlink_type;
+    static int type_init = 0;  
+    if (!type_init) {
+      const PyTypeObject tmp
+      = {
+        PyObject_HEAD_INIT(NULL)
+        0,                                  /* Number of items in variable part (ob_size) */
+        (char *)"swigvarlink",              /* Type name (tp_name) */
+        sizeof(swig_varlinkobject),         /* Basic size (tp_basicsize) */
+        0,                                  /* Itemsize (tp_itemsize) */
+        (destructor) swig_varlink_dealloc,   /* Deallocator (tp_dealloc) */ 
+        (printfunc) swig_varlink_print,     /* Print (tp_print) */
+        (getattrfunc) swig_varlink_getattr, /* get attr (tp_getattr) */
+        (setattrfunc) swig_varlink_setattr, /* Set attr (tp_setattr) */
+        0,                                  /* tp_compare */
+        (reprfunc) swig_varlink_repr,       /* tp_repr */
+        0,                                  /* tp_as_number */
+        0,                                  /* tp_as_sequence */
+        0,                                  /* tp_as_mapping */
+        0,                                  /* tp_hash */
+        0,                                  /* tp_call */
+        (reprfunc)swig_varlink_str,        /* tp_str */
+        0,                                  /* tp_getattro */
+        0,                                  /* tp_setattro */
+        0,                                  /* tp_as_buffer */
+        0,                                  /* tp_flags */
+        varlink__doc__,                     /* tp_doc */
+        0,                                  /* tp_traverse */
+        0,                                  /* tp_clear */
+        0,                                  /* tp_richcompare */
+        0,                                  /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+        0,                                  /* tp_del */
+#endif
+#ifdef COUNT_ALLOCS
+        0,0,0,0                             /* tp_alloc -> tp_next */
+#endif
+      };
+      varlink_type = tmp;
+      varlink_type.ob_type = &PyType_Type;
+      type_init = 1;
+    }
+    return &varlink_type;
+  }
+  
+  /* Create a variable linking object for use later */
+  SWIGINTERN PyObject *
+  SWIG_Python_newvarlink(void) {
+    swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
+    if (result) {
+      result->vars = 0;
+    }
+    return ((PyObject*) result);
+  }
+  
+  SWIGINTERN void 
+  SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
+    swig_varlinkobject *v = (swig_varlinkobject *) p;
+    swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
+    if (gv) {
+      size_t size = strlen(name)+1;
+      gv->name = (char *)malloc(size);
+      if (gv->name) {
+        strncpy(gv->name,name,size);
+        gv->get_attr = get_attr;
+        gv->set_attr = set_attr;
+        gv->next = v->vars;
+      }
+    }
+    v->vars = gv;
+  }
+  
+  SWIGINTERN PyObject *
+  SWIG_globals(void) {
+    static PyObject *_SWIG_globals = 0; 
+    if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();  
+    return _SWIG_globals;
+  }
+  
+  /* -----------------------------------------------------------------------------
+   * constants/methods manipulation
+   * ----------------------------------------------------------------------------- */
+  
+  /* Install Constants */
+  SWIGINTERN void
+  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
+    PyObject *obj = 0;
+    size_t i;
+    for (i = 0; constants[i].type; ++i) {
+      switch(constants[i].type) {
+      case SWIG_PY_POINTER:
+        obj = SWIG_NewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
+        break;
+      case SWIG_PY_BINARY:
+        obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
+        break;
+      default:
+        obj = 0;
+        break;
+      }
+      if (obj) {
+        PyDict_SetItemString(d, constants[i].name, obj);
+        Py_DECREF(obj);
+      }
+    }
+  }
+  
+  /* -----------------------------------------------------------------------------*/
+  /* Fix SwigMethods to carry the callback ptrs when needed */
+  /* -----------------------------------------------------------------------------*/
+  
+  SWIGINTERN void
+  SWIG_Python_FixMethods(PyMethodDef *methods,
+    swig_const_info *const_table,
+    swig_type_info **types,
+    swig_type_info **types_initial) {
+    size_t i;
+    for (i = 0; methods[i].ml_name; ++i) {
+      const char *c = methods[i].ml_doc;
+      if (c && (c = strstr(c, "swig_ptr: "))) {
+        int j;
+        swig_const_info *ci = 0;
+        const char *name = c + 10;
+        for (j = 0; const_table[j].type; ++j) {
+          if (strncmp(const_table[j].name, name, 
+              strlen(const_table[j].name)) == 0) {
+            ci = &(const_table[j]);
+            break;
+          }
+        }
+        if (ci) {
+          size_t shift = (ci->ptype) - types;
+          swig_type_info *ty = types_initial[shift];
+          size_t ldoc = (c - methods[i].ml_doc);
+          size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
+          char *ndoc = (char*)malloc(ldoc + lptr + 10);
+          if (ndoc) {
+            char *buff = ndoc;
+            void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
+            if (ptr) {
+              strncpy(buff, methods[i].ml_doc, ldoc);
+              buff += ldoc;
+              strncpy(buff, "swig_ptr: ", 10);
+              buff += 10;
+              SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
+              methods[i].ml_doc = ndoc;
+            }
+          }
+        }
+      }
+    }
+  } 
+  
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------*
+ *  Partial Init method
+ * -----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+extern "C"
+#endif
+SWIGEXPORT void SWIG_init(void) {
+  PyObject *m, *d;
+  
+  /* Fix SwigMethods to carry the callback ptrs when needed */
+  SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
+  
+  m = Py_InitModule((char *) SWIG_name, SwigMethods);
+  d = PyModule_GetDict(m);
+  
+  SWIG_InitializeModule(0);
+  SWIG_InstallConstants(d,swig_const_table);
+  
+  
+  SWIG_Python_SetConstant(d, "CDI_UNDEFID",SWIG_From_int((int)(-1)));
+  SWIG_Python_SetConstant(d, "CDI_GLOBAL",SWIG_From_int((int)(-1)));
+  SWIG_Python_SetConstant(d, "CDI_BIGENDIAN",SWIG_From_int((int)(0)));
+  SWIG_Python_SetConstant(d, "CDI_LITTLEENDIAN",SWIG_From_int((int)(1)));
+  SWIG_Python_SetConstant(d, "CDI_NOERR",SWIG_From_int((int)(0)));
+  SWIG_Python_SetConstant(d, "CDI_ESYSTEM",SWIG_From_int((int)(-10)));
+  SWIG_Python_SetConstant(d, "CDI_EINVAL",SWIG_From_int((int)(-20)));
+  SWIG_Python_SetConstant(d, "CDI_EUFTYPE",SWIG_From_int((int)(-21)));
+  SWIG_Python_SetConstant(d, "CDI_ELIBNAVAIL",SWIG_From_int((int)(-22)));
+  SWIG_Python_SetConstant(d, "CDI_EUFSTRUCT",SWIG_From_int((int)(-23)));
+  SWIG_Python_SetConstant(d, "CDI_EUNC4",SWIG_From_int((int)(-24)));
+  SWIG_Python_SetConstant(d, "FILETYPE_GRB",SWIG_From_int((int)(1)));
+  SWIG_Python_SetConstant(d, "FILETYPE_GRB2",SWIG_From_int((int)(2)));
+  SWIG_Python_SetConstant(d, "FILETYPE_NC",SWIG_From_int((int)(3)));
+  SWIG_Python_SetConstant(d, "FILETYPE_NC2",SWIG_From_int((int)(4)));
+  SWIG_Python_SetConstant(d, "FILETYPE_NC4",SWIG_From_int((int)(5)));
+  SWIG_Python_SetConstant(d, "FILETYPE_SRV",SWIG_From_int((int)(6)));
+  SWIG_Python_SetConstant(d, "FILETYPE_EXT",SWIG_From_int((int)(7)));
+  SWIG_Python_SetConstant(d, "FILETYPE_IEG",SWIG_From_int((int)(8)));
+  SWIG_Python_SetConstant(d, "COMPRESS_NONE",SWIG_From_int((int)(0)));
+  SWIG_Python_SetConstant(d, "COMPRESS_SZIP",SWIG_From_int((int)(1)));
+  SWIG_Python_SetConstant(d, "COMPRESS_GZIP",SWIG_From_int((int)(2)));
+  SWIG_Python_SetConstant(d, "COMPRESS_BZIP2",SWIG_From_int((int)(3)));
+  SWIG_Python_SetConstant(d, "COMPRESS_ZIP",SWIG_From_int((int)(4)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK",SWIG_From_int((int)(0)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK1",SWIG_From_int((int)(1)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK2",SWIG_From_int((int)(2)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK3",SWIG_From_int((int)(3)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK4",SWIG_From_int((int)(4)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK5",SWIG_From_int((int)(5)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK6",SWIG_From_int((int)(6)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK7",SWIG_From_int((int)(7)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK8",SWIG_From_int((int)(8)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK9",SWIG_From_int((int)(9)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK10",SWIG_From_int((int)(10)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK11",SWIG_From_int((int)(11)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK12",SWIG_From_int((int)(12)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK13",SWIG_From_int((int)(13)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK14",SWIG_From_int((int)(14)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK15",SWIG_From_int((int)(15)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK16",SWIG_From_int((int)(16)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK17",SWIG_From_int((int)(17)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK18",SWIG_From_int((int)(18)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK19",SWIG_From_int((int)(19)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK20",SWIG_From_int((int)(20)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK21",SWIG_From_int((int)(21)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK22",SWIG_From_int((int)(22)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK23",SWIG_From_int((int)(23)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK24",SWIG_From_int((int)(24)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK25",SWIG_From_int((int)(25)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK26",SWIG_From_int((int)(26)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK27",SWIG_From_int((int)(27)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK28",SWIG_From_int((int)(28)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK29",SWIG_From_int((int)(29)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK30",SWIG_From_int((int)(30)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK31",SWIG_From_int((int)(31)));
+  SWIG_Python_SetConstant(d, "DATATYPE_PACK32",SWIG_From_int((int)(32)));
+  SWIG_Python_SetConstant(d, "DATATYPE_FLT32",SWIG_From_int((int)(132)));
+  SWIG_Python_SetConstant(d, "DATATYPE_FLT64",SWIG_From_int((int)(164)));
+  SWIG_Python_SetConstant(d, "DATATYPE_INT8",SWIG_From_int((int)(208)));
+  SWIG_Python_SetConstant(d, "DATATYPE_INT16",SWIG_From_int((int)(216)));
+  SWIG_Python_SetConstant(d, "DATATYPE_INT32",SWIG_From_int((int)(232)));
+  SWIG_Python_SetConstant(d, "DATATYPE_UINT8",SWIG_From_int((int)(308)));
+  SWIG_Python_SetConstant(d, "DATATYPE_UINT16",SWIG_From_int((int)(316)));
+  SWIG_Python_SetConstant(d, "DATATYPE_UINT32",SWIG_From_int((int)(332)));
+  SWIG_Python_SetConstant(d, "DATATYPE_INT",SWIG_From_int((int)(251)));
+  SWIG_Python_SetConstant(d, "DATATYPE_FLT",SWIG_From_int((int)(252)));
+  SWIG_Python_SetConstant(d, "DATATYPE_TXT",SWIG_From_int((int)(253)));
+  SWIG_Python_SetConstant(d, "GRID_GENERIC",SWIG_From_int((int)(1)));
+  SWIG_Python_SetConstant(d, "GRID_GAUSSIAN",SWIG_From_int((int)(2)));
+  SWIG_Python_SetConstant(d, "GRID_GAUSSIAN_REDUCED",SWIG_From_int((int)(3)));
+  SWIG_Python_SetConstant(d, "GRID_LONLAT",SWIG_From_int((int)(4)));
+  SWIG_Python_SetConstant(d, "GRID_SPECTRAL",SWIG_From_int((int)(5)));
+  SWIG_Python_SetConstant(d, "GRID_FOURIER",SWIG_From_int((int)(6)));
+  SWIG_Python_SetConstant(d, "GRID_GME",SWIG_From_int((int)(7)));
+  SWIG_Python_SetConstant(d, "GRID_TRAJECTORY",SWIG_From_int((int)(8)));
+  SWIG_Python_SetConstant(d, "GRID_UNSTRUCTURED",SWIG_From_int((int)(9)));
+  SWIG_Python_SetConstant(d, "GRID_CURVILINEAR",SWIG_From_int((int)(10)));
+  SWIG_Python_SetConstant(d, "GRID_LCC",SWIG_From_int((int)(11)));
+  SWIG_Python_SetConstant(d, "GRID_LCC2",SWIG_From_int((int)(12)));
+  SWIG_Python_SetConstant(d, "GRID_LAEA",SWIG_From_int((int)(13)));
+  SWIG_Python_SetConstant(d, "GRID_SINUSOIDAL",SWIG_From_int((int)(14)));
+  SWIG_Python_SetConstant(d, "ZAXIS_SURFACE",SWIG_From_int((int)(0)));
+  SWIG_Python_SetConstant(d, "ZAXIS_GENERIC",SWIG_From_int((int)(1)));
+  SWIG_Python_SetConstant(d, "ZAXIS_HYBRID",SWIG_From_int((int)(2)));
+  SWIG_Python_SetConstant(d, "ZAXIS_HYBRID_HALF",SWIG_From_int((int)(3)));
+  SWIG_Python_SetConstant(d, "ZAXIS_PRESSURE",SWIG_From_int((int)(4)));
+  SWIG_Python_SetConstant(d, "ZAXIS_HEIGHT",SWIG_From_int((int)(5)));
+  SWIG_Python_SetConstant(d, "ZAXIS_DEPTH_BELOW_SEA",SWIG_From_int((int)(6)));
+  SWIG_Python_SetConstant(d, "ZAXIS_DEPTH_BELOW_LAND",SWIG_From_int((int)(7)));
+  SWIG_Python_SetConstant(d, "ZAXIS_ISENTROPIC",SWIG_From_int((int)(8)));
+  SWIG_Python_SetConstant(d, "ZAXIS_TRAJECTORY",SWIG_From_int((int)(9)));
+  SWIG_Python_SetConstant(d, "ZAXIS_ALTITUDE",SWIG_From_int((int)(10)));
+  SWIG_Python_SetConstant(d, "ZAXIS_SIGMA",SWIG_From_int((int)(11)));
+  SWIG_Python_SetConstant(d, "ZAXIS_MEANSEA",SWIG_From_int((int)(12)));
+  SWIG_Python_SetConstant(d, "TAXIS_ABSOLUTE",SWIG_From_int((int)(1)));
+  SWIG_Python_SetConstant(d, "TAXIS_RELATIVE",SWIG_From_int((int)(2)));
+  SWIG_Python_SetConstant(d, "TIME_CONSTANT",SWIG_From_int((int)(1)));
+  SWIG_Python_SetConstant(d, "TIME_VARIABLE",SWIG_From_int((int)(2)));
+  SWIG_Python_SetConstant(d, "TUNIT_SECOND",SWIG_From_int((int)(1)));
+  SWIG_Python_SetConstant(d, "TUNIT_MINUTE",SWIG_From_int((int)(2)));
+  SWIG_Python_SetConstant(d, "TUNIT_HOUR",SWIG_From_int((int)(3)));
+  SWIG_Python_SetConstant(d, "TUNIT_DAY",SWIG_From_int((int)(4)));
+  SWIG_Python_SetConstant(d, "TUNIT_MONTH",SWIG_From_int((int)(5)));
+  SWIG_Python_SetConstant(d, "TUNIT_YEAR",SWIG_From_int((int)(6)));
+  SWIG_Python_SetConstant(d, "TUNIT_QUARTER",SWIG_From_int((int)(7)));
+  SWIG_Python_SetConstant(d, "CALENDAR_STANDARD",SWIG_From_int((int)(0)));
+  SWIG_Python_SetConstant(d, "CALENDAR_PROLEPTIC",SWIG_From_int((int)(1)));
+  SWIG_Python_SetConstant(d, "CALENDAR_360DAYS",SWIG_From_int((int)(2)));
+  SWIG_Python_SetConstant(d, "CALENDAR_365DAYS",SWIG_From_int((int)(3)));
+  SWIG_Python_SetConstant(d, "CALENDAR_366DAYS",SWIG_From_int((int)(4)));
+  SWIG_Python_SetConstant(d, "CALENDAR_NONE",SWIG_From_int((int)(5)));
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/interfaces/python/cdiobj_wrap.cpp b/libcdi/interfaces/python/cdiobj_wrap.cpp
new file mode 100644
index 0000000..f6df6c9
--- /dev/null
+++ b/libcdi/interfaces/python/cdiobj_wrap.cpp
@@ -0,0 +1,29448 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.4
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGPYTHON
+#define SWIG_PYTHON_DIRECTOR_NO_VTABLE
+
+
+#ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
+template<typename T> class SwigValueWrapper {
+  struct SwigMovePointer {
+    T *ptr;
+    SwigMovePointer(T *p) : ptr(p) { }
+    ~SwigMovePointer() { delete ptr; }
+    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+  } pointer;
+  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
+public:
+  SwigValueWrapper() : pointer(0) { }
+  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
+  operator T&() const { return *pointer.ptr; }
+  T *operator&() { return pointer.ptr; }
+};
+
+template <typename T> T SwigValueInit() {
+  return T();
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif 
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+
+/* Python.h has to appear first */
+#include <Python.h>
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic C API SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "4"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the SWIG runtime code.
+  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
+  
+  But only do this if strictly necessary, ie, if you have problems
+  with your compiler or suchlike.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+#define SWIG_CAST_NEW_MEMORY       0x2
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The SWIG conversion methods, as ConvertPtr, return an integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old versions of SWIG, code such as the following was usually written:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   which is the same really, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+	delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   also requires SWIG_ConvertPtr to return new result values, such as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {			       
+          if (<need new object>) {		       
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;		       
+          } else {				       
+            *ptr = <ptr to old object>;	       
+            return SWIG_OLDOBJ;		       
+          } 				       
+        } else {				       
+          return SWIG_BADOBJ;		       
+        }					       
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   SWIG errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+ 
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+*/
+
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *, int *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store information on one type */
+typedef struct swig_type_info {
+  const char             *name;			/* mangled name of this type */
+  const char             *str;			/* human readable name of this type */
+  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
+  void                   *clientdata;		/* language specific type data */
+  int                    owndata;		/* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;		/* function to cast the void pointers */
+  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;			/* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;		        /* Number of types in this module */
+  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;	/* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
+  void                    *clientdata;		/* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+		  const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(iter->type->name, c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
+}
+
+/* 
+  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (iter->type == from) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+	SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+		            const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
+	register size_t i = (l + r) >> 1; 
+	const char *iname = iter->types[i]->name;
+	if (iname) {
+	  register int compare = strcmp(name, iname);
+	  if (compare == 0) {	    
+	    return iter->types[i];
+	  } else if (compare < 0) {
+	    if (i) {
+	      r = i - 1;
+	    } else {
+	      break;
+	    }
+	  } else if (compare > 0) {
+	    l = i + 1;
+	  }
+	} else {
+	  break; /* should never happen */
+	}
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+		     const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+	  return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError    	   -1 
+#define  SWIG_IOError        	   -2 
+#define  SWIG_RuntimeError   	   -3 
+#define  SWIG_IndexError     	   -4 
+#define  SWIG_TypeError      	   -5 
+#define  SWIG_DivisionByZero 	   -6 
+#define  SWIG_OverflowError  	   -7 
+#define  SWIG_SyntaxError    	   -8 
+#define  SWIG_ValueError     	   -9 
+#define  SWIG_SystemError    	   -10
+#define  SWIG_AttributeError 	   -11
+#define  SWIG_MemoryError    	   -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+/* Compatibility macros for Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+
+#define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
+#define PyInt_Check(x) PyLong_Check(x)
+#define PyInt_AsLong(x) PyLong_AsLong(x)
+#define PyInt_FromLong(x) PyLong_FromLong(x)
+#define PyString_Check(name) PyBytes_Check(name)
+#define PyString_FromString(x) PyUnicode_FromString(x)
+#define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
+#define PyString_AsString(str) PyBytes_AsString(str)
+#define PyString_Size(str) PyBytes_Size(str)	
+#define PyString_InternFromString(key) PyUnicode_InternFromString(key)
+#define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
+#define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
+#define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
+
+#endif
+
+#ifndef Py_TYPE
+#  define Py_TYPE(op) ((op)->ob_type)
+#endif
+
+/* SWIG APIs for compatibility of both Python 2 & 3 */
+
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
+#else
+#  define SWIG_Python_str_FromFormat PyString_FromFormat
+#endif
+
+
+/* Warning: This function will allocate a new string in Python 3,
+ * so please call SWIG_Python_str_DelForPy3(x) to free the space.
+ */
+SWIGINTERN char*
+SWIG_Python_str_AsChar(PyObject *str)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  char *cstr;
+  char *newstr;
+  Py_ssize_t len;
+  str = PyUnicode_AsUTF8String(str);
+  PyBytes_AsStringAndSize(str, &cstr, &len);
+  newstr = (char *) malloc(len+1);
+  memcpy(newstr, cstr, len+1);
+  Py_XDECREF(str);
+  return newstr;
+#else
+  return PyString_AsString(str);
+#endif
+}
+
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
+#else
+#  define SWIG_Python_str_DelForPy3(x) 
+#endif
+
+
+SWIGINTERN PyObject*
+SWIG_Python_str_FromChar(const char *c)
+{
+#if PY_VERSION_HEX >= 0x03000000
+  return PyUnicode_FromString(c); 
+#else
+  return PyString_FromString(c);
+#endif
+}
+
+/* Add PyOS_snprintf for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+# if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM)
+#  define PyOS_snprintf _snprintf
+# else
+#  define PyOS_snprintf snprintf
+# endif
+#endif
+
+/* A crude PyString_FromFormat implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+
+#ifndef SWIG_PYBUFFER_SIZE
+# define SWIG_PYBUFFER_SIZE 1024
+#endif
+
+static PyObject *
+PyString_FromFormat(const char *fmt, ...) {
+  va_list ap;
+  char buf[SWIG_PYBUFFER_SIZE * 2];
+  int res;
+  va_start(ap, fmt);
+  res = vsnprintf(buf, sizeof(buf), fmt, ap);
+  va_end(ap);
+  return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf);
+}
+#endif
+
+/* Add PyObject_Del for old Pythons */
+#if PY_VERSION_HEX < 0x01060000
+# define PyObject_Del(op) PyMem_DEL((op))
+#endif
+#ifndef PyObject_DEL
+# define PyObject_DEL PyObject_Del
+#endif
+
+/* A crude PyExc_StopIteration exception for old Pythons */
+#if PY_VERSION_HEX < 0x02020000
+# ifndef PyExc_StopIteration
+#  define PyExc_StopIteration PyExc_RuntimeError
+# endif
+# ifndef PyObject_GenericGetAttr
+#  define PyObject_GenericGetAttr 0
+# endif
+#endif
+
+/* Py_NotImplemented is defined in 2.1 and up. */
+#if PY_VERSION_HEX < 0x02010000
+# ifndef Py_NotImplemented
+#  define Py_NotImplemented PyExc_RuntimeError
+# endif
+#endif
+
+/* A crude PyString_AsStringAndSize implementation for old Pythons */
+#if PY_VERSION_HEX < 0x02010000
+# ifndef PyString_AsStringAndSize
+#  define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;}
+# endif
+#endif
+
+/* PySequence_Size for old Pythons */
+#if PY_VERSION_HEX < 0x02000000
+# ifndef PySequence_Size
+#  define PySequence_Size PySequence_Length
+# endif
+#endif
+
+/* PyBool_FromLong for old Pythons */
+#if PY_VERSION_HEX < 0x02030000
+static
+PyObject *PyBool_FromLong(long ok)
+{
+  PyObject *result = ok ? Py_True : Py_False;
+  Py_INCREF(result);
+  return result;
+}
+#endif
+
+/* Py_ssize_t for old Pythons */
+/* This code is as recommended by: */
+/* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */
+#if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN)
+typedef int Py_ssize_t;
+# define PY_SSIZE_T_MAX INT_MAX
+# define PY_SSIZE_T_MIN INT_MIN
+typedef inquiry lenfunc;
+typedef intargfunc ssizeargfunc;
+typedef intintargfunc ssizessizeargfunc;
+typedef intobjargproc ssizeobjargproc;
+typedef intintobjargproc ssizessizeobjargproc;
+typedef getreadbufferproc readbufferproc;
+typedef getwritebufferproc writebufferproc;
+typedef getsegcountproc segcountproc;
+typedef getcharbufferproc charbufferproc;
+static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc))
+{
+  long result = 0;
+  PyObject *i = PyNumber_Int(x);
+  if (i) {
+    result = PyInt_AsLong(i);
+    Py_DECREF(i);
+  }
+  return result;
+}
+#endif
+
+#if PY_VERSION_HEX < 0x02040000
+#define Py_VISIT(op)				\
+  do { 						\
+    if (op) {					\
+      int vret = visit((op), arg);		\
+      if (vret)					\
+        return vret;				\
+    }						\
+  } while (0)
+#endif
+
+#if PY_VERSION_HEX < 0x02030000
+typedef struct {
+  PyTypeObject type;
+  PyNumberMethods as_number;
+  PyMappingMethods as_mapping;
+  PySequenceMethods as_sequence;
+  PyBufferProcs as_buffer;
+  PyObject *name, *slots;
+} PyHeapTypeObject;
+#endif
+
+#if PY_VERSION_HEX < 0x02030000
+typedef destructor freefunc;
+#endif
+
+#if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \
+     (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \
+     (PY_MAJOR_VERSION > 3))
+# define SWIGPY_USE_CAPSULE
+# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
+#endif
+
+#if PY_VERSION_HEX < 0x03020000
+#define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
+#define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
+#endif
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGRUNTIME PyObject*
+SWIG_Python_ErrorType(int code) {
+  PyObject* type = 0;
+  switch(code) {
+  case SWIG_MemoryError:
+    type = PyExc_MemoryError;
+    break;
+  case SWIG_IOError:
+    type = PyExc_IOError;
+    break;
+  case SWIG_RuntimeError:
+    type = PyExc_RuntimeError;
+    break;
+  case SWIG_IndexError:
+    type = PyExc_IndexError;
+    break;
+  case SWIG_TypeError:
+    type = PyExc_TypeError;
+    break;
+  case SWIG_DivisionByZero:
+    type = PyExc_ZeroDivisionError;
+    break;
+  case SWIG_OverflowError:
+    type = PyExc_OverflowError;
+    break;
+  case SWIG_SyntaxError:
+    type = PyExc_SyntaxError;
+    break;
+  case SWIG_ValueError:
+    type = PyExc_ValueError;
+    break;
+  case SWIG_SystemError:
+    type = PyExc_SystemError;
+    break;
+  case SWIG_AttributeError:
+    type = PyExc_AttributeError;
+    break;
+  default:
+    type = PyExc_RuntimeError;
+  }
+  return type;
+}
+
+
+SWIGRUNTIME void
+SWIG_Python_AddErrorMsg(const char* mesg)
+{
+  PyObject *type = 0;
+  PyObject *value = 0;
+  PyObject *traceback = 0;
+
+  if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback);
+  if (value) {
+    char *tmp;
+    PyObject *old_str = PyObject_Str(value);
+    PyErr_Clear();
+    Py_XINCREF(type);
+
+    PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
+    SWIG_Python_str_DelForPy3(tmp);
+    Py_DECREF(old_str);
+    Py_DECREF(value);
+  } else {
+    PyErr_SetString(PyExc_RuntimeError, mesg);
+  }
+}
+
+#if defined(SWIG_PYTHON_NO_THREADS)
+#  if defined(SWIG_PYTHON_THREADS)
+#    undef SWIG_PYTHON_THREADS
+#  endif
+#endif
+#if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
+#  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
+#    if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */
+#      define SWIG_PYTHON_USE_GIL
+#    endif
+#  endif
+#  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
+#    ifndef SWIG_PYTHON_INITIALIZE_THREADS
+#     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads() 
+#    endif
+#    ifdef __cplusplus /* C++ code */
+       class SWIG_Python_Thread_Block {
+         bool status;
+         PyGILState_STATE state;
+       public:
+         void end() { if (status) { PyGILState_Release(state); status = false;} }
+         SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
+         ~SWIG_Python_Thread_Block() { end(); }
+       };
+       class SWIG_Python_Thread_Allow {
+         bool status;
+         PyThreadState *save;
+       public:
+         void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
+         SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
+         ~SWIG_Python_Thread_Allow() { end(); }
+       };
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
+#      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
+#      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
+#    else /* C code */
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
+#      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
+#      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
+#    endif
+#  else /* Old thread way, not implemented, user must provide it */
+#    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
+#      define SWIG_PYTHON_INITIALIZE_THREADS
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
+#      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
+#      define SWIG_PYTHON_THREAD_END_BLOCK
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
+#      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+#    endif
+#    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
+#      define SWIG_PYTHON_THREAD_END_ALLOW
+#    endif
+#  endif
+#else /* No thread support */
+#  define SWIG_PYTHON_INITIALIZE_THREADS
+#  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
+#  define SWIG_PYTHON_THREAD_END_BLOCK
+#  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
+#  define SWIG_PYTHON_THREAD_END_ALLOW
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Python API portion that goes into the runtime
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Constant declarations
+ * ----------------------------------------------------------------------------- */
+
+/* Constant Types */
+#define SWIG_PY_POINTER 4
+#define SWIG_PY_BINARY  5
+
+/* Constant information structure */
+typedef struct swig_const_info {
+  int type;
+  char *name;
+  long lvalue;
+  double dvalue;
+  void   *pvalue;
+  swig_type_info **ptype;
+} swig_const_info;
+
+
+/* -----------------------------------------------------------------------------
+ * Wrapper of PyInstanceMethod_New() used in Python 3
+ * It is exported to the generated module, used for -fastproxy
+ * ----------------------------------------------------------------------------- */
+#if PY_VERSION_HEX >= 0x03000000
+SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func)
+{
+  return PyInstanceMethod_New(func);
+}
+#else
+SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func))
+{
+  return NULL;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * pyrun.swg
+ *
+ * This file contains the runtime support for Python modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ *
+ * ----------------------------------------------------------------------------- */
+
+/* Common SWIG API */
+
+/* for raw pointers */
+#define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
+#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
+
+#ifdef SWIGPYTHON_BUILTIN
+#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
+#else
+#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
+#endif
+
+#define SWIG_InternalNewPointerObj(ptr, type, flags)	SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
+
+#define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty) 
+#define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
+#define swig_owntype                                    int
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule()
+#define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
+#define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
+
+#define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj                            
+#define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg				   
+#define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)                        
+#define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) 
+#define SWIG_fail                        		goto fail					   
+
+
+/* Runtime API implementation */
+
+/* Error manipulation */
+
+SWIGINTERN void 
+SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
+  SWIG_PYTHON_THREAD_BEGIN_BLOCK; 
+  PyErr_SetObject(errtype, obj);
+  Py_DECREF(obj);
+  SWIG_PYTHON_THREAD_END_BLOCK;
+}
+
+SWIGINTERN void 
+SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
+  SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+  PyErr_SetString(errtype, (char *) msg);
+  SWIG_PYTHON_THREAD_END_BLOCK;
+}
+
+#define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
+
+/* Set a constant value */
+
+#if defined(SWIGPYTHON_BUILTIN)
+
+SWIGINTERN void
+SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
+  PyObject *s = PyString_InternFromString(key);
+  PyList_Append(seq, s);
+  Py_DECREF(s);
+}
+
+SWIGINTERN void
+SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {   
+  PyDict_SetItemString(d, (char *)name, obj);
+  Py_DECREF(obj);
+  if (public_interface)
+    SwigPyBuiltin_AddPublicSymbol(public_interface, name);
+}
+
+#else
+
+SWIGINTERN void
+SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {   
+  PyDict_SetItemString(d, (char *)name, obj);
+  Py_DECREF(obj);                            
+}
+
+#endif
+
+/* Append a value to the result obj */
+
+SWIGINTERN PyObject*
+SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
+#if !defined(SWIG_PYTHON_OUTPUT_TUPLE)
+  if (!result) {
+    result = obj;
+  } else if (result == Py_None) {
+    Py_DECREF(result);
+    result = obj;
+  } else {
+    if (!PyList_Check(result)) {
+      PyObject *o2 = result;
+      result = PyList_New(1);
+      PyList_SetItem(result, 0, o2);
+    }
+    PyList_Append(result,obj);
+    Py_DECREF(obj);
+  }
+  return result;
+#else
+  PyObject*   o2;
+  PyObject*   o3;
+  if (!result) {
+    result = obj;
+  } else if (result == Py_None) {
+    Py_DECREF(result);
+    result = obj;
+  } else {
+    if (!PyTuple_Check(result)) {
+      o2 = result;
+      result = PyTuple_New(1);
+      PyTuple_SET_ITEM(result, 0, o2);
+    }
+    o3 = PyTuple_New(1);
+    PyTuple_SET_ITEM(o3, 0, obj);
+    o2 = result;
+    result = PySequence_Concat(o2, o3);
+    Py_DECREF(o2);
+    Py_DECREF(o3);
+  }
+  return result;
+#endif
+}
+
+/* Unpack the argument tuple */
+
+SWIGINTERN int
+SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
+{
+  if (!args) {
+    if (!min && !max) {
+      return 1;
+    } else {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", 
+		   name, (min == max ? "" : "at least "), (int)min);
+      return 0;
+    }
+  }  
+  if (!PyTuple_Check(args)) {
+    if (min <= 1 && max >= 1) {
+      register int i;
+      objs[0] = args;
+      for (i = 1; i < max; ++i) {
+	objs[i] = 0;
+      }
+      return 2;
+    }
+    PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
+    return 0;
+  } else {
+    register Py_ssize_t l = PyTuple_GET_SIZE(args);
+    if (l < min) {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
+		   name, (min == max ? "" : "at least "), (int)min, (int)l);
+      return 0;
+    } else if (l > max) {
+      PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", 
+		   name, (min == max ? "" : "at most "), (int)max, (int)l);
+      return 0;
+    } else {
+      register int i;
+      for (i = 0; i < l; ++i) {
+	objs[i] = PyTuple_GET_ITEM(args, i);
+      }
+      for (; l < max; ++l) {
+	objs[l] = 0;
+      }
+      return i + 1;
+    }    
+  }
+}
+
+/* A functor is a function object with one single object argument */
+#if PY_VERSION_HEX >= 0x02020000
+#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
+#else
+#define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunction(functor, "O", obj);
+#endif
+
+/*
+  Helper for static pointer initialization for both C and C++ code, for example
+  static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
+*/
+#ifdef __cplusplus
+#define SWIG_STATIC_POINTER(var)  var
+#else
+#define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Pointer declarations
+ * ----------------------------------------------------------------------------- */
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
+#define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
+
+#define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
+
+#define SWIG_BUILTIN_TP_INIT	    (SWIG_POINTER_OWN << 2)
+#define SWIG_BUILTIN_INIT	    (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/*  How to access Py_None */
+#if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#  ifndef SWIG_PYTHON_NO_BUILD_NONE
+#    ifndef SWIG_PYTHON_BUILD_NONE
+#      define SWIG_PYTHON_BUILD_NONE
+#    endif
+#  endif
+#endif
+
+#ifdef SWIG_PYTHON_BUILD_NONE
+#  ifdef Py_None
+#   undef Py_None
+#   define Py_None SWIG_Py_None()
+#  endif
+SWIGRUNTIMEINLINE PyObject * 
+_SWIG_Py_None(void)
+{
+  PyObject *none = Py_BuildValue((char*)"");
+  Py_DECREF(none);
+  return none;
+}
+SWIGRUNTIME PyObject * 
+SWIG_Py_None(void)
+{
+  static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None();
+  return none;
+}
+#endif
+
+/* The python void return value */
+
+SWIGRUNTIMEINLINE PyObject * 
+SWIG_Py_Void(void)
+{
+  PyObject *none = Py_None;
+  Py_INCREF(none);
+  return none;
+}
+
+/* SwigPyClientData */
+
+typedef struct {
+  PyObject *klass;
+  PyObject *newraw;
+  PyObject *newargs;
+  PyObject *destroy;
+  int delargs;
+  int implicitconv;
+  PyTypeObject *pytype;
+} SwigPyClientData;
+
+SWIGRUNTIMEINLINE int 
+SWIG_Python_CheckImplicit(swig_type_info *ty)
+{
+  SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
+  return data ? data->implicitconv : 0;
+}
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Python_ExceptionType(swig_type_info *desc) {
+  SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
+  PyObject *klass = data ? data->klass : 0;
+  return (klass ? klass : PyExc_RuntimeError);
+}
+
+
+SWIGRUNTIME SwigPyClientData * 
+SwigPyClientData_New(PyObject* obj)
+{
+  if (!obj) {
+    return 0;
+  } else {
+    SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
+    /* the klass element */
+    data->klass = obj;
+    Py_INCREF(data->klass);
+    /* the newraw method and newargs arguments used to create a new raw instance */
+    if (PyClass_Check(obj)) {
+      data->newraw = 0;
+      data->newargs = obj;
+      Py_INCREF(obj);
+    } else {
+#if (PY_VERSION_HEX < 0x02020000)
+      data->newraw = 0;
+#else
+      data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__");
+#endif
+      if (data->newraw) {
+	Py_INCREF(data->newraw);
+	data->newargs = PyTuple_New(1);
+	PyTuple_SetItem(data->newargs, 0, obj);
+      } else {
+	data->newargs = obj;
+      }
+      Py_INCREF(data->newargs);
+    }
+    /* the destroy method, aka as the C++ delete method */
+    data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__");
+    if (PyErr_Occurred()) {
+      PyErr_Clear();
+      data->destroy = 0;
+    }
+    if (data->destroy) {
+      int flags;
+      Py_INCREF(data->destroy);
+      flags = PyCFunction_GET_FLAGS(data->destroy);
+#ifdef METH_O
+      data->delargs = !(flags & (METH_O));
+#else
+      data->delargs = 0;
+#endif
+    } else {
+      data->delargs = 0;
+    }
+    data->implicitconv = 0;
+    data->pytype = 0;
+    return data;
+  }
+}
+
+SWIGRUNTIME void 
+SwigPyClientData_Del(SwigPyClientData *data) {
+  Py_XDECREF(data->newraw);
+  Py_XDECREF(data->newargs);
+  Py_XDECREF(data->destroy);
+}
+
+/* =============== SwigPyObject =====================*/
+
+typedef struct {
+  PyObject_HEAD
+  void *ptr;
+  swig_type_info *ty;
+  int own;
+  PyObject *next;
+#ifdef SWIGPYTHON_BUILTIN
+  PyObject *dict;
+#endif
+} SwigPyObject;
+
+SWIGRUNTIME PyObject *
+SwigPyObject_long(SwigPyObject *v)
+{
+  return PyLong_FromVoidPtr(v->ptr);
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_format(const char* fmt, SwigPyObject *v)
+{
+  PyObject *res = NULL;
+  PyObject *args = PyTuple_New(1);
+  if (args) {
+    if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
+      PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
+      if (ofmt) {
+#if PY_VERSION_HEX >= 0x03000000
+	res = PyUnicode_Format(ofmt,args);
+#else
+	res = PyString_Format(ofmt,args);
+#endif
+	Py_DECREF(ofmt);
+      }
+      Py_DECREF(args);
+    }
+  }
+  return res;
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_oct(SwigPyObject *v)
+{
+  return SwigPyObject_format("%o",v);
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_hex(SwigPyObject *v)
+{
+  return SwigPyObject_format("%x",v);
+}
+
+SWIGRUNTIME PyObject *
+#ifdef METH_NOARGS
+SwigPyObject_repr(SwigPyObject *v)
+#else
+SwigPyObject_repr(SwigPyObject *v, PyObject *args)
+#endif
+{
+  const char *name = SWIG_TypePrettyName(v->ty);
+  PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", name, (void *)v);
+  if (v->next) {
+# ifdef METH_NOARGS
+    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
+# else
+    PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args);
+# endif
+# if PY_VERSION_HEX >= 0x03000000
+    PyObject *joined = PyUnicode_Concat(repr, nrep);
+    Py_DecRef(repr);
+    Py_DecRef(nrep);
+    repr = joined;
+# else
+    PyString_ConcatAndDel(&repr,nrep);
+# endif
+  }
+  return repr;  
+}
+
+SWIGRUNTIME int
+SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+{
+  char *str;
+#ifdef METH_NOARGS
+  PyObject *repr = SwigPyObject_repr(v);
+#else
+  PyObject *repr = SwigPyObject_repr(v, NULL);
+#endif
+  if (repr) {
+    str = SWIG_Python_str_AsChar(repr); 
+    fputs(str, fp);
+    SWIG_Python_str_DelForPy3(str);
+    Py_DECREF(repr);
+    return 0; 
+  } else {
+    return 1; 
+  }
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_str(SwigPyObject *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ?
+    SWIG_Python_str_FromChar(result) : 0;
+}
+
+SWIGRUNTIME int
+SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
+{
+  void *i = v->ptr;
+  void *j = w->ptr;
+  return (i < j) ? -1 : ((i > j) ? 1 : 0);
+}
+
+/* Added for Python 3.x, would it also be useful for Python 2.x? */
+SWIGRUNTIME PyObject*
+SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
+{
+  PyObject* res;
+  if( op != Py_EQ && op != Py_NE ) {
+    Py_INCREF(Py_NotImplemented);
+    return Py_NotImplemented;
+  }
+  res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
+  return res;  
+}
+
+
+SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
+
+#ifdef SWIGPYTHON_BUILTIN
+static swig_type_info *SwigPyObject_stype = 0;
+SWIGRUNTIME PyTypeObject*
+SwigPyObject_type(void) {
+    SwigPyClientData *cd;
+    assert(SwigPyObject_stype);
+    cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
+    assert(cd);
+    assert(cd->pytype);
+    return cd->pytype;
+}
+#else
+SWIGRUNTIME PyTypeObject*
+SwigPyObject_type(void) {
+  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
+  return type;
+}
+#endif
+
+SWIGRUNTIMEINLINE int
+SwigPyObject_Check(PyObject *op) {
+#ifdef SWIGPYTHON_BUILTIN
+  PyTypeObject *target_tp = SwigPyObject_type();
+  if (PyType_IsSubtype(op->ob_type, target_tp))
+    return 1;
+  return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
+#else
+  return (Py_TYPE(op) == SwigPyObject_type())
+    || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
+#endif
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
+
+SWIGRUNTIME void
+SwigPyObject_dealloc(PyObject *v)
+{
+  SwigPyObject *sobj = (SwigPyObject *) v;
+  PyObject *next = sobj->next;
+  if (sobj->own == SWIG_POINTER_OWN) {
+    swig_type_info *ty = sobj->ty;
+    SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
+    PyObject *destroy = data ? data->destroy : 0;
+    if (destroy) {
+      /* destroy is always a VARARGS method */
+      PyObject *res;
+      if (data->delargs) {
+	/* we need to create a temporary object to carry the destroy operation */
+	PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
+	res = SWIG_Python_CallFunctor(destroy, tmp);
+	Py_DECREF(tmp);
+      } else {
+	PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
+	PyObject *mself = PyCFunction_GET_SELF(destroy);
+	res = ((*meth)(mself, v));
+      }
+      Py_XDECREF(res);
+    } 
+#if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
+    else {
+      const char *name = SWIG_TypePrettyName(ty);
+      printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
+    }
+#endif
+  } 
+  Py_XDECREF(next);
+  PyObject_DEL(v);
+}
+
+SWIGRUNTIME PyObject* 
+SwigPyObject_append(PyObject* v, PyObject* next)
+{
+  SwigPyObject *sobj = (SwigPyObject *) v;
+#ifndef METH_O
+  PyObject *tmp = 0;
+  if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL;
+  next = tmp;
+#endif
+  if (!SwigPyObject_Check(next)) {
+    return NULL;
+  }
+  sobj->next = next;
+  Py_INCREF(next);
+  return SWIG_Py_Void();
+}
+
+SWIGRUNTIME PyObject* 
+#ifdef METH_NOARGS
+SwigPyObject_next(PyObject* v)
+#else
+SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  SwigPyObject *sobj = (SwigPyObject *) v;
+  if (sobj->next) {    
+    Py_INCREF(sobj->next);
+    return sobj->next;
+  } else {
+    return SWIG_Py_Void();
+  }
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+SwigPyObject_disown(PyObject *v)
+#else
+SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  SwigPyObject *sobj = (SwigPyObject *)v;
+  sobj->own = 0;
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+#ifdef METH_NOARGS
+SwigPyObject_acquire(PyObject *v)
+#else
+SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
+#endif
+{
+  SwigPyObject *sobj = (SwigPyObject *)v;
+  sobj->own = SWIG_POINTER_OWN;
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject*
+SwigPyObject_own(PyObject *v, PyObject *args)
+{
+  PyObject *val = 0;
+#if (PY_VERSION_HEX < 0x02020000)
+  if (!PyArg_ParseTuple(args,(char *)"|O:own",&val))
+#else
+  if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) 
+#endif
+    {
+      return NULL;
+    } 
+  else
+    {
+      SwigPyObject *sobj = (SwigPyObject *)v;
+      PyObject *obj = PyBool_FromLong(sobj->own);
+      if (val) {
+#ifdef METH_NOARGS
+	if (PyObject_IsTrue(val)) {
+	  SwigPyObject_acquire(v);
+	} else {
+	  SwigPyObject_disown(v);
+	}
+#else
+	if (PyObject_IsTrue(val)) {
+	  SwigPyObject_acquire(v,args);
+	} else {
+	  SwigPyObject_disown(v,args);
+	}
+#endif
+      } 
+      return obj;
+    }
+}
+
+#ifdef METH_O
+static PyMethodDef
+swigobject_methods[] = {
+  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_NOARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS, (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_O,       (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_NOARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,    METH_NOARGS,  (char *)"returns object representation"},
+  {0, 0, 0, 0}  
+};
+#else
+static PyMethodDef
+swigobject_methods[] = {
+  {(char *)"disown",  (PyCFunction)SwigPyObject_disown,  METH_VARARGS,  (char *)"releases ownership of the pointer"},
+  {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS,  (char *)"aquires ownership of the pointer"},
+  {(char *)"own",     (PyCFunction)SwigPyObject_own,     METH_VARARGS,  (char *)"returns/sets ownership of the pointer"},
+  {(char *)"append",  (PyCFunction)SwigPyObject_append,  METH_VARARGS,  (char *)"appends another 'this' object"},
+  {(char *)"next",    (PyCFunction)SwigPyObject_next,    METH_VARARGS,  (char *)"returns the next 'this' object"},
+  {(char *)"__repr__",(PyCFunction)SwigPyObject_repr,   METH_VARARGS,  (char *)"returns object representation"},
+  {0, 0, 0, 0}  
+};
+#endif
+
+#if PY_VERSION_HEX < 0x02020000
+SWIGINTERN PyObject *
+SwigPyObject_getattr(SwigPyObject *sobj,char *name)
+{
+  return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name);
+}
+#endif
+
+SWIGRUNTIME PyTypeObject*
+SwigPyObject_TypeOnce(void) {
+  static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
+
+  static PyNumberMethods SwigPyObject_as_number = {
+    (binaryfunc)0, /*nb_add*/
+    (binaryfunc)0, /*nb_subtract*/
+    (binaryfunc)0, /*nb_multiply*/
+    /* nb_divide removed in Python 3 */
+#if PY_VERSION_HEX < 0x03000000
+    (binaryfunc)0, /*nb_divide*/
+#endif
+    (binaryfunc)0, /*nb_remainder*/
+    (binaryfunc)0, /*nb_divmod*/
+    (ternaryfunc)0,/*nb_power*/
+    (unaryfunc)0,  /*nb_negative*/
+    (unaryfunc)0,  /*nb_positive*/
+    (unaryfunc)0,  /*nb_absolute*/
+    (inquiry)0,    /*nb_nonzero*/
+    0,		   /*nb_invert*/
+    0,		   /*nb_lshift*/
+    0,		   /*nb_rshift*/
+    0,		   /*nb_and*/
+    0,		   /*nb_xor*/
+    0,		   /*nb_or*/
+#if PY_VERSION_HEX < 0x03000000
+    0,   /*nb_coerce*/
+#endif
+    (unaryfunc)SwigPyObject_long, /*nb_int*/
+#if PY_VERSION_HEX < 0x03000000
+    (unaryfunc)SwigPyObject_long, /*nb_long*/
+#else
+    0, /*nb_reserved*/
+#endif
+    (unaryfunc)0,                 /*nb_float*/
+#if PY_VERSION_HEX < 0x03000000
+    (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
+    (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
+#endif
+#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
+#elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
+#elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */
+    0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */
+#elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */
+    0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */
+#endif
+  };
+
+  static PyTypeObject swigpyobject_type;
+  static int type_init = 0;
+  if (!type_init) {
+    const PyTypeObject tmp = {
+      /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+      PyVarObject_HEAD_INIT(NULL, 0)
+#else
+      PyObject_HEAD_INIT(NULL)
+      0,                                    /* ob_size */
+#endif
+      (char *)"SwigPyObject",               /* tp_name */
+      sizeof(SwigPyObject),                 /* tp_basicsize */
+      0,                                    /* tp_itemsize */
+      (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
+      (printfunc)SwigPyObject_print,        /* tp_print */
+#if PY_VERSION_HEX < 0x02020000
+      (getattrfunc)SwigPyObject_getattr,    /* tp_getattr */
+#else
+      (getattrfunc)0,                       /* tp_getattr */
+#endif
+      (setattrfunc)0,                       /* tp_setattr */
+#if PY_VERSION_HEX >= 0x03000000
+    0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
+#else
+      (cmpfunc)SwigPyObject_compare,        /* tp_compare */
+#endif
+      (reprfunc)SwigPyObject_repr,          /* tp_repr */
+      &SwigPyObject_as_number,              /* tp_as_number */
+      0,                                    /* tp_as_sequence */
+      0,                                    /* tp_as_mapping */
+      (hashfunc)0,                          /* tp_hash */
+      (ternaryfunc)0,                       /* tp_call */
+      (reprfunc)SwigPyObject_str,           /* tp_str */
+      PyObject_GenericGetAttr,              /* tp_getattro */
+      0,                                    /* tp_setattro */
+      0,                                    /* tp_as_buffer */
+      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
+      swigobject_doc,                       /* tp_doc */
+      0,                                    /* tp_traverse */
+      0,                                    /* tp_clear */
+      (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
+      0,                                    /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+      0,                                    /* tp_iter */
+      0,                                    /* tp_iternext */
+      swigobject_methods,                   /* tp_methods */
+      0,                                    /* tp_members */
+      0,                                    /* tp_getset */
+      0,                                    /* tp_base */
+      0,                                    /* tp_dict */
+      0,                                    /* tp_descr_get */
+      0,                                    /* tp_descr_set */
+      0,                                    /* tp_dictoffset */
+      0,                                    /* tp_init */
+      0,                                    /* tp_alloc */
+      0,                                    /* tp_new */
+      0,                                    /* tp_free */
+      0,                                    /* tp_is_gc */
+      0,                                    /* tp_bases */
+      0,                                    /* tp_mro */
+      0,                                    /* tp_cache */
+      0,                                    /* tp_subclasses */
+      0,                                    /* tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+      0,                                    /* tp_del */
+#endif
+#if PY_VERSION_HEX >= 0x02060000
+      0,                                    /* tp_version */
+#endif
+#ifdef COUNT_ALLOCS
+      0,0,0,0                               /* tp_alloc -> tp_next */
+#endif
+    };
+    swigpyobject_type = tmp;
+    type_init = 1;
+#if PY_VERSION_HEX < 0x02020000
+    swigpyobject_type.ob_type = &PyType_Type;
+#else
+    if (PyType_Ready(&swigpyobject_type) < 0)
+      return NULL;
+#endif
+  }
+  return &swigpyobject_type;
+}
+
+SWIGRUNTIME PyObject *
+SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
+{
+  SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
+  if (sobj) {
+    sobj->ptr  = ptr;
+    sobj->ty   = ty;
+    sobj->own  = own;
+    sobj->next = 0;
+  }
+  return (PyObject *)sobj;
+}
+
+/* -----------------------------------------------------------------------------
+ * Implements a simple Swig Packed type, and use it instead of string
+ * ----------------------------------------------------------------------------- */
+
+typedef struct {
+  PyObject_HEAD
+  void *pack;
+  swig_type_info *ty;
+  size_t size;
+} SwigPyPacked;
+
+SWIGRUNTIME int
+SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags))
+{
+  char result[SWIG_BUFFER_SIZE];
+  fputs("<Swig Packed ", fp); 
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
+    fputs("at ", fp); 
+    fputs(result, fp); 
+  }
+  fputs(v->ty->name,fp); 
+  fputs(">", fp);
+  return 0; 
+}
+  
+SWIGRUNTIME PyObject *
+SwigPyPacked_repr(SwigPyPacked *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
+    return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
+  } else {
+    return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
+  }  
+}
+
+SWIGRUNTIME PyObject *
+SwigPyPacked_str(SwigPyPacked *v)
+{
+  char result[SWIG_BUFFER_SIZE];
+  if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
+    return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
+  } else {
+    return SWIG_Python_str_FromChar(v->ty->name);
+  }  
+}
+
+SWIGRUNTIME int
+SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
+{
+  size_t i = v->size;
+  size_t j = w->size;
+  int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
+  return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size);
+}
+
+SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
+
+SWIGRUNTIME PyTypeObject*
+SwigPyPacked_type(void) {
+  static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
+  return type;
+}
+
+SWIGRUNTIMEINLINE int
+SwigPyPacked_Check(PyObject *op) {
+  return ((op)->ob_type == SwigPyPacked_TypeOnce()) 
+    || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
+}
+
+SWIGRUNTIME void
+SwigPyPacked_dealloc(PyObject *v)
+{
+  if (SwigPyPacked_Check(v)) {
+    SwigPyPacked *sobj = (SwigPyPacked *) v;
+    free(sobj->pack);
+  }
+  PyObject_DEL(v);
+}
+
+SWIGRUNTIME PyTypeObject*
+SwigPyPacked_TypeOnce(void) {
+  static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
+  static PyTypeObject swigpypacked_type;
+  static int type_init = 0;
+  if (!type_init) {
+    const PyTypeObject tmp = {
+      /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX>=0x03000000
+      PyVarObject_HEAD_INIT(NULL, 0)
+#else
+      PyObject_HEAD_INIT(NULL)
+      0,                                    /* ob_size */
+#endif
+      (char *)"SwigPyPacked",               /* tp_name */
+      sizeof(SwigPyPacked),                 /* tp_basicsize */
+      0,                                    /* tp_itemsize */
+      (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
+      (printfunc)SwigPyPacked_print,        /* tp_print */
+      (getattrfunc)0,                       /* tp_getattr */
+      (setattrfunc)0,                       /* tp_setattr */
+#if PY_VERSION_HEX>=0x03000000
+      0, /* tp_reserved in 3.0.1 */
+#else
+      (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
+#endif
+      (reprfunc)SwigPyPacked_repr,          /* tp_repr */
+      0,                                    /* tp_as_number */
+      0,                                    /* tp_as_sequence */
+      0,                                    /* tp_as_mapping */
+      (hashfunc)0,                          /* tp_hash */
+      (ternaryfunc)0,                       /* tp_call */
+      (reprfunc)SwigPyPacked_str,           /* tp_str */
+      PyObject_GenericGetAttr,              /* tp_getattro */
+      0,                                    /* tp_setattro */
+      0,                                    /* tp_as_buffer */
+      Py_TPFLAGS_DEFAULT,                   /* tp_flags */
+      swigpacked_doc,                       /* tp_doc */
+      0,                                    /* tp_traverse */
+      0,                                    /* tp_clear */
+      0,                                    /* tp_richcompare */
+      0,                                    /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+      0,                                    /* tp_iter */
+      0,                                    /* tp_iternext */
+      0,                                    /* tp_methods */
+      0,                                    /* tp_members */
+      0,                                    /* tp_getset */
+      0,                                    /* tp_base */
+      0,                                    /* tp_dict */
+      0,                                    /* tp_descr_get */
+      0,                                    /* tp_descr_set */
+      0,                                    /* tp_dictoffset */
+      0,                                    /* tp_init */
+      0,                                    /* tp_alloc */
+      0,                                    /* tp_new */
+      0,                                    /* tp_free */
+      0,                                    /* tp_is_gc */
+      0,                                    /* tp_bases */
+      0,                                    /* tp_mro */
+      0,                                    /* tp_cache */
+      0,                                    /* tp_subclasses */
+      0,                                    /* tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+      0,                                    /* tp_del */
+#endif
+#if PY_VERSION_HEX >= 0x02060000
+      0,                                    /* tp_version */
+#endif
+#ifdef COUNT_ALLOCS
+      0,0,0,0                               /* tp_alloc -> tp_next */
+#endif
+    };
+    swigpypacked_type = tmp;
+    type_init = 1;
+#if PY_VERSION_HEX < 0x02020000
+    swigpypacked_type.ob_type = &PyType_Type;
+#else
+    if (PyType_Ready(&swigpypacked_type) < 0)
+      return NULL;
+#endif
+  }
+  return &swigpypacked_type;
+}
+
+SWIGRUNTIME PyObject *
+SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
+{
+  SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
+  if (sobj) {
+    void *pack = malloc(size);
+    if (pack) {
+      memcpy(pack, ptr, size);
+      sobj->pack = pack;
+      sobj->ty   = ty;
+      sobj->size = size;
+    } else {
+      PyObject_DEL((PyObject *) sobj);
+      sobj = 0;
+    }
+  }
+  return (PyObject *) sobj;
+}
+
+SWIGRUNTIME swig_type_info *
+SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
+{
+  if (SwigPyPacked_Check(obj)) {
+    SwigPyPacked *sobj = (SwigPyPacked *)obj;
+    if (sobj->size != size) return 0;
+    memcpy(ptr, sobj->pack, size);
+    return sobj->ty;
+  } else {
+    return 0;
+  }
+}
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+SWIGRUNTIMEINLINE PyObject *
+_SWIG_This(void)
+{
+    return SWIG_Python_str_FromChar("this");
+}
+
+static PyObject *swig_this = NULL;
+
+SWIGRUNTIME PyObject *
+SWIG_This(void)
+{
+  if (swig_this == NULL)
+    swig_this = _SWIG_This();
+  return swig_this;
+}
+
+/* #define SWIG_PYTHON_SLOW_GETSET_THIS */
+
+/* TODO: I don't know how to implement the fast getset in Python 3 right now */
+#if PY_VERSION_HEX>=0x03000000
+#define SWIG_PYTHON_SLOW_GETSET_THIS 
+#endif
+
+SWIGRUNTIME SwigPyObject *
+SWIG_Python_GetSwigThis(PyObject *pyobj) 
+{
+  PyObject *obj;
+
+  if (SwigPyObject_Check(pyobj))
+    return (SwigPyObject *) pyobj;
+
+#ifdef SWIGPYTHON_BUILTIN
+  (void)obj;
+# ifdef PyWeakref_CheckProxy
+  if (PyWeakref_CheckProxy(pyobj)) {
+    pyobj = PyWeakref_GET_OBJECT(pyobj);
+    if (pyobj && SwigPyObject_Check(pyobj))
+      return (SwigPyObject*) pyobj;
+  }
+# endif
+  return NULL;
+#else
+
+  obj = 0;
+
+#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000))
+  if (PyInstance_Check(pyobj)) {
+    obj = _PyInstance_Lookup(pyobj, SWIG_This());      
+  } else {
+    PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
+    if (dictptr != NULL) {
+      PyObject *dict = *dictptr;
+      obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
+    } else {
+#ifdef PyWeakref_CheckProxy
+      if (PyWeakref_CheckProxy(pyobj)) {
+	PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
+	return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
+      }
+#endif
+      obj = PyObject_GetAttr(pyobj,SWIG_This());
+      if (obj) {
+	Py_DECREF(obj);
+      } else {
+	if (PyErr_Occurred()) PyErr_Clear();
+	return 0;
+      }
+    }
+  }
+#else
+  obj = PyObject_GetAttr(pyobj,SWIG_This());
+  if (obj) {
+    Py_DECREF(obj);
+  } else {
+    if (PyErr_Occurred()) PyErr_Clear();
+    return 0;
+  }
+#endif
+  if (obj && !SwigPyObject_Check(obj)) {
+    /* a PyObject is called 'this', try to get the 'real this'
+       SwigPyObject from it */ 
+    return SWIG_Python_GetSwigThis(obj);
+  }
+  return (SwigPyObject *)obj;
+#endif
+}
+
+/* Acquire a pointer value */
+
+SWIGRUNTIME int
+SWIG_Python_AcquirePtr(PyObject *obj, int own) {
+  if (own == SWIG_POINTER_OWN) {
+    SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
+    if (sobj) {
+      int oldown = sobj->own;
+      sobj->own = own;
+      return oldown;
+    }
+  }
+  return 0;
+}
+
+/* Convert a pointer value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
+  int res;
+  SwigPyObject *sobj;
+
+  if (!obj)
+    return SWIG_ERROR;
+  if (obj == Py_None) {
+    if (ptr)
+      *ptr = 0;
+    return SWIG_OK;
+  }
+
+  res = SWIG_ERROR;
+
+  sobj = SWIG_Python_GetSwigThis(obj);
+  if (own)
+    *own = 0;
+  while (sobj) {
+    void *vptr = sobj->ptr;
+    if (ty) {
+      swig_type_info *to = sobj->ty;
+      if (to == ty) {
+        /* no type cast needed */
+        if (ptr) *ptr = vptr;
+        break;
+      } else {
+        swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+        if (!tc) {
+          sobj = (SwigPyObject *)sobj->next;
+        } else {
+          if (ptr) {
+            int newmemory = 0;
+            *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+            if (newmemory == SWIG_CAST_NEW_MEMORY) {
+              assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
+              if (own)
+                *own = *own | SWIG_CAST_NEW_MEMORY;
+            }
+          }
+          break;
+        }
+      }
+    } else {
+      if (ptr) *ptr = vptr;
+      break;
+    }
+  }
+  if (sobj) {
+    if (own)
+      *own = *own | sobj->own;
+    if (flags & SWIG_POINTER_DISOWN) {
+      sobj->own = 0;
+    }
+    res = SWIG_OK;
+  } else {
+    if (flags & SWIG_POINTER_IMPLICIT_CONV) {
+      SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
+      if (data && !data->implicitconv) {
+        PyObject *klass = data->klass;
+        if (klass) {
+          PyObject *impconv;
+          data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
+          impconv = SWIG_Python_CallFunctor(klass, obj);
+          data->implicitconv = 0;
+          if (PyErr_Occurred()) {
+            PyErr_Clear();
+            impconv = 0;
+          }
+          if (impconv) {
+            SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
+            if (iobj) {
+              void *vptr;
+              res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
+              if (SWIG_IsOK(res)) {
+                if (ptr) {
+                  *ptr = vptr;
+                  /* transfer the ownership to 'ptr' */
+                  iobj->own = 0;
+                  res = SWIG_AddCast(res);
+                  res = SWIG_AddNewMask(res);
+                } else {
+                  res = SWIG_AddCast(res);		    
+                }
+              }
+            }
+            Py_DECREF(impconv);
+          }
+        }
+      }
+    }
+  }
+  return res;
+}
+
+/* Convert a function ptr value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
+  if (!PyCFunction_Check(obj)) {
+    return SWIG_ConvertPtr(obj, ptr, ty, 0);
+  } else {
+    void *vptr = 0;
+    
+    /* here we get the method pointer for callbacks */
+    const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
+    const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
+    if (desc)
+      desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
+    if (!desc) 
+      return SWIG_ERROR;
+    if (ty) {
+      swig_cast_info *tc = SWIG_TypeCheck(desc,ty);
+      if (tc) {
+        int newmemory = 0;
+        *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
+        assert(!newmemory); /* newmemory handling not yet implemented */
+      } else {
+        return SWIG_ERROR;
+      }
+    } else {
+      *ptr = vptr;
+    }
+    return SWIG_OK;
+  }
+}
+
+/* Convert a packed value value */
+
+SWIGRUNTIME int
+SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
+  swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
+  if (!to) return SWIG_ERROR;
+  if (ty) {
+    if (to != ty) {
+      /* check type cast? */
+      swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
+      if (!tc) return SWIG_ERROR;
+    }
+  }
+  return SWIG_OK;
+}  
+
+/* -----------------------------------------------------------------------------
+ * Create a new pointer object
+ * ----------------------------------------------------------------------------- */
+
+/*
+  Create a new instance object, without calling __init__, and set the
+  'this' attribute.
+*/
+
+SWIGRUNTIME PyObject* 
+SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
+{
+#if (PY_VERSION_HEX >= 0x02020000)
+  PyObject *inst = 0;
+  PyObject *newraw = data->newraw;
+  if (newraw) {
+    inst = PyObject_Call(newraw, data->newargs, NULL);
+    if (inst) {
+#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
+      PyObject **dictptr = _PyObject_GetDictPtr(inst);
+      if (dictptr != NULL) {
+	PyObject *dict = *dictptr;
+	if (dict == NULL) {
+	  dict = PyDict_New();
+	  *dictptr = dict;
+	  PyDict_SetItem(dict, SWIG_This(), swig_this);
+	}
+      }
+#else
+      PyObject *key = SWIG_This();
+      PyObject_SetAttr(inst, key, swig_this);
+#endif
+    }
+  } else {
+#if PY_VERSION_HEX >= 0x03000000
+    inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None);
+    PyObject_SetAttr(inst, SWIG_This(), swig_this);
+    Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
+#else
+    PyObject *dict = PyDict_New();
+    PyDict_SetItem(dict, SWIG_This(), swig_this);
+    inst = PyInstance_NewRaw(data->newargs, dict);
+    Py_DECREF(dict);
+#endif
+  }
+  return inst;
+#else
+#if (PY_VERSION_HEX >= 0x02010000)
+  PyObject *inst;
+  PyObject *dict = PyDict_New();
+  PyDict_SetItem(dict, SWIG_This(), swig_this);
+  inst = PyInstance_NewRaw(data->newargs, dict);
+  Py_DECREF(dict);
+  return (PyObject *) inst;
+#else
+  PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type);
+  if (inst == NULL) {
+    return NULL;
+  }
+  inst->in_class = (PyClassObject *)data->newargs;
+  Py_INCREF(inst->in_class);
+  inst->in_dict = PyDict_New();
+  if (inst->in_dict == NULL) {
+    Py_DECREF(inst);
+    return NULL;
+  }
+#ifdef Py_TPFLAGS_HAVE_WEAKREFS
+  inst->in_weakreflist = NULL;
+#endif
+#ifdef Py_TPFLAGS_GC
+  PyObject_GC_Init(inst);
+#endif
+  PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this);
+  return (PyObject *) inst;
+#endif
+#endif
+}
+
+SWIGRUNTIME void
+SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
+{
+ PyObject *dict;
+#if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
+ PyObject **dictptr = _PyObject_GetDictPtr(inst);
+ if (dictptr != NULL) {
+   dict = *dictptr;
+   if (dict == NULL) {
+     dict = PyDict_New();
+     *dictptr = dict;
+   }
+   PyDict_SetItem(dict, SWIG_This(), swig_this);
+   return;
+ }
+#endif
+ dict = PyObject_GetAttrString(inst, (char*)"__dict__");
+ PyDict_SetItem(dict, SWIG_This(), swig_this);
+ Py_DECREF(dict);
+} 
+
+
+SWIGINTERN PyObject *
+SWIG_Python_InitShadowInstance(PyObject *args) {
+  PyObject *obj[2];
+  if (!SWIG_Python_UnpackTuple(args,(char*)"swiginit", 2, 2, obj)) {
+    return NULL;
+  } else {
+    SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
+    if (sthis) {
+      SwigPyObject_append((PyObject*) sthis, obj[1]);
+    } else {
+      SWIG_Python_SetSwigThis(obj[0], obj[1]);
+    }
+    return SWIG_Py_Void();
+  }
+}
+
+/* Create a new pointer object */
+
+SWIGRUNTIME PyObject *
+SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
+  SwigPyClientData *clientdata;
+  PyObject * robj;
+  int own;
+
+  if (!ptr)
+    return SWIG_Py_Void();
+
+  clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
+  own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
+  if (clientdata && clientdata->pytype) {
+    SwigPyObject *newobj;
+    if (flags & SWIG_BUILTIN_TP_INIT) {
+      newobj = (SwigPyObject*) self;
+      if (newobj->ptr) {
+        PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
+        while (newobj->next)
+	  newobj = (SwigPyObject *) newobj->next;
+        newobj->next = next_self;
+        newobj = (SwigPyObject *)next_self;
+      }
+    } else {
+      newobj = PyObject_New(SwigPyObject, clientdata->pytype);
+    }
+    if (newobj) {
+      newobj->ptr = ptr;
+      newobj->ty = type;
+      newobj->own = own;
+      newobj->next = 0;
+#ifdef SWIGPYTHON_BUILTIN
+      newobj->dict = 0;
+#endif
+      return (PyObject*) newobj;
+    }
+    return SWIG_Py_Void();
+  }
+
+  assert(!(flags & SWIG_BUILTIN_TP_INIT));
+
+  robj = SwigPyObject_New(ptr, type, own);
+  if (clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
+    PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
+    if (inst) {
+      Py_DECREF(robj);
+      robj = inst;
+    }
+  }
+  return robj;
+}
+
+/* Create a new packed object */
+
+SWIGRUNTIMEINLINE PyObject *
+SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
+  return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
+}
+
+/* -----------------------------------------------------------------------------*
+ *  Get type list 
+ * -----------------------------------------------------------------------------*/
+
+#ifdef SWIG_LINK_RUNTIME
+void *SWIG_ReturnGlobalTypeList(void *);
+#endif
+
+SWIGRUNTIME swig_module_info *
+SWIG_Python_GetModule(void) {
+  static void *type_pointer = (void *)0;
+  /* first check if module already created */
+  if (!type_pointer) {
+#ifdef SWIG_LINK_RUNTIME
+    type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
+#else
+# ifdef SWIGPY_USE_CAPSULE
+    type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
+# else
+    type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION,
+				    (char*)"type_pointer" SWIG_TYPE_TABLE_NAME);
+# endif
+    if (PyErr_Occurred()) {
+      PyErr_Clear();
+      type_pointer = (void *)0;
+    }
+#endif
+  }
+  return (swig_module_info *) type_pointer;
+}
+
+#if PY_MAJOR_VERSION < 2
+/* PyModule_AddObject function was introduced in Python 2.0.  The following function
+   is copied out of Python/modsupport.c in python version 2.3.4 */
+SWIGINTERN int
+PyModule_AddObject(PyObject *m, char *name, PyObject *o)
+{
+  PyObject *dict;
+  if (!PyModule_Check(m)) {
+    PyErr_SetString(PyExc_TypeError,
+		    "PyModule_AddObject() needs module as first arg");
+    return SWIG_ERROR;
+  }
+  if (!o) {
+    PyErr_SetString(PyExc_TypeError,
+		    "PyModule_AddObject() needs non-NULL value");
+    return SWIG_ERROR;
+  }
+  
+  dict = PyModule_GetDict(m);
+  if (dict == NULL) {
+    /* Internal error -- modules must have a dict! */
+    PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__",
+		 PyModule_GetName(m));
+    return SWIG_ERROR;
+  }
+  if (PyDict_SetItemString(dict, name, o))
+    return SWIG_ERROR;
+  Py_DECREF(o);
+  return SWIG_OK;
+}
+#endif
+
+SWIGRUNTIME void
+#ifdef SWIGPY_USE_CAPSULE
+SWIG_Python_DestroyModule(PyObject *obj)
+#else
+SWIG_Python_DestroyModule(void *vptr)
+#endif
+{
+#ifdef SWIGPY_USE_CAPSULE
+  swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
+#else
+  swig_module_info *swig_module = (swig_module_info *) vptr;
+#endif
+  swig_type_info **types = swig_module->types;
+  size_t i;
+  for (i =0; i < swig_module->size; ++i) {
+    swig_type_info *ty = types[i];
+    if (ty->owndata) {
+      SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
+      if (data) SwigPyClientData_Del(data);
+    }
+  }
+  Py_DECREF(SWIG_This());
+  swig_this = NULL;
+}
+
+SWIGRUNTIME void
+SWIG_Python_SetModule(swig_module_info *swig_module) {
+#if PY_VERSION_HEX >= 0x03000000
+ /* Add a dummy module object into sys.modules */
+  PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION);
+#else
+  static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
+  PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
+#endif
+#ifdef SWIGPY_USE_CAPSULE
+  PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
+  if (pointer && module) {
+    PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
+  } else {
+    Py_XDECREF(pointer);
+  }
+#else
+  PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule);
+  if (pointer && module) {
+    PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer);
+  } else {
+    Py_XDECREF(pointer);
+  }
+#endif
+}
+
+/* The python cached type query */
+SWIGRUNTIME PyObject *
+SWIG_Python_TypeCache(void) {
+  static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
+  return cache;
+}
+
+SWIGRUNTIME swig_type_info *
+SWIG_Python_TypeQuery(const char *type)
+{
+  PyObject *cache = SWIG_Python_TypeCache();
+  PyObject *key = SWIG_Python_str_FromChar(type); 
+  PyObject *obj = PyDict_GetItem(cache, key);
+  swig_type_info *descriptor;
+  if (obj) {
+#ifdef SWIGPY_USE_CAPSULE
+    descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
+#else
+    descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj);
+#endif
+  } else {
+    swig_module_info *swig_module = SWIG_Python_GetModule();
+    descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
+    if (descriptor) {
+#ifdef SWIGPY_USE_CAPSULE
+      obj = PyCapsule_New((void*) descriptor, NULL, NULL);
+#else
+      obj = PyCObject_FromVoidPtr(descriptor, NULL);
+#endif
+      PyDict_SetItem(cache, key, obj);
+      Py_DECREF(obj);
+    }
+  }
+  Py_DECREF(key);
+  return descriptor;
+}
+
+/* 
+   For backward compatibility only
+*/
+#define SWIG_POINTER_EXCEPTION  0
+#define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
+#define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
+
+SWIGRUNTIME int
+SWIG_Python_AddErrMesg(const char* mesg, int infront)
+{  
+  if (PyErr_Occurred()) {
+    PyObject *type = 0;
+    PyObject *value = 0;
+    PyObject *traceback = 0;
+    PyErr_Fetch(&type, &value, &traceback);
+    if (value) {
+      char *tmp;
+      PyObject *old_str = PyObject_Str(value);
+      Py_XINCREF(type);
+      PyErr_Clear();
+      if (infront) {
+	PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str));
+      } else {
+	PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg);
+      }
+      SWIG_Python_str_DelForPy3(tmp);
+      Py_DECREF(old_str);
+    }
+    return 1;
+  } else {
+    return 0;
+  }
+}
+  
+SWIGRUNTIME int
+SWIG_Python_ArgFail(int argnum)
+{
+  if (PyErr_Occurred()) {
+    /* add information about failing argument */
+    char mesg[256];
+    PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
+    return SWIG_Python_AddErrMesg(mesg, 1);
+  } else {
+    return 0;
+  }
+}
+
+SWIGRUNTIMEINLINE const char *
+SwigPyObject_GetDesc(PyObject *self)
+{
+  SwigPyObject *v = (SwigPyObject *)self;
+  swig_type_info *ty = v ? v->ty : 0;
+  return ty ? ty->str : (char*)"";
+}
+
+SWIGRUNTIME void
+SWIG_Python_TypeError(const char *type, PyObject *obj)
+{
+  if (type) {
+#if defined(SWIG_COBJECT_TYPES)
+    if (obj && SwigPyObject_Check(obj)) {
+      const char *otype = (const char *) SwigPyObject_GetDesc(obj);
+      if (otype) {
+	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
+		     type, otype);
+	return;
+      }
+    } else 
+#endif      
+    {
+      const char *otype = (obj ? obj->ob_type->tp_name : 0); 
+      if (otype) {
+	PyObject *str = PyObject_Str(obj);
+	const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
+	if (cstr) {
+	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
+		       type, otype, cstr);
+          SWIG_Python_str_DelForPy3(cstr);
+	} else {
+	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
+		       type, otype);
+	}
+	Py_XDECREF(str);
+	return;
+      }
+    }   
+    PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
+  } else {
+    PyErr_Format(PyExc_TypeError, "unexpected type is received");
+  }
+}
+
+
+/* Convert a pointer value, signal an exception on a type mismatch */
+SWIGRUNTIME void *
+SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
+  void *result;
+  if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
+    PyErr_Clear();
+#if SWIG_POINTER_EXCEPTION
+    if (flags) {
+      SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
+      SWIG_Python_ArgFail(argnum);
+    }
+#endif
+  }
+  return result;
+}
+
+SWIGRUNTIME int
+SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
+  PyTypeObject *tp = obj->ob_type;
+  PyObject *descr;
+  PyObject *encoded_name;
+  descrsetfunc f;
+  int res;
+
+#ifdef Py_USING_UNICODE
+  if (PyString_Check(name)) {
+    name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
+    if (!name)
+      return -1;
+  } else if (!PyUnicode_Check(name))
+#else
+  if (!PyString_Check(name))
+#endif
+  {
+    PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
+    return -1;
+  } else {
+    Py_INCREF(name);
+  }
+
+  if (!tp->tp_dict) {
+    if (PyType_Ready(tp) < 0)
+      goto done;
+  }
+
+  res = -1;
+  descr = _PyType_Lookup(tp, name);
+  f = NULL;
+  if (descr != NULL)
+    f = descr->ob_type->tp_descr_set;
+  if (!f) {
+    if (PyString_Check(name)) {
+      encoded_name = name;
+      Py_INCREF(name);
+    } else {
+      encoded_name = PyUnicode_AsUTF8String(name);
+    }
+    PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
+    Py_DECREF(encoded_name);
+  } else {
+    res = f(descr, obj, value);
+  }
+  
+  done:
+  Py_DECREF(name);
+  return res;
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) 
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_Cdi swig_types[0]
+#define SWIGTYPE_p_CdiGrid swig_types[1]
+#define SWIGTYPE_p_CdiTaxis swig_types[2]
+#define SWIGTYPE_p_CdiVariable swig_types[3]
+#define SWIGTYPE_p_CdiZaxis swig_types[4]
+#define SWIGTYPE_p_allocator_type swig_types[5]
+#define SWIGTYPE_p_char swig_types[6]
+#define SWIGTYPE_p_difference_type swig_types[7]
+#define SWIGTYPE_p_double swig_types[8]
+#define SWIGTYPE_p_float swig_types[9]
+#define SWIGTYPE_p_key_type swig_types[10]
+#define SWIGTYPE_p_mapped_type swig_types[11]
+#define SWIGTYPE_p_p_PyObject swig_types[12]
+#define SWIGTYPE_p_p_double swig_types[13]
+#define SWIGTYPE_p_size_type swig_types[14]
+#define SWIGTYPE_p_std__allocatorT_CdiVariable_t swig_types[15]
+#define SWIGTYPE_p_std__allocatorT_double_t swig_types[16]
+#define SWIGTYPE_p_std__allocatorT_int_t swig_types[17]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t swig_types[18]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t swig_types[19]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t swig_types[20]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t swig_types[21]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t swig_types[22]
+#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[23]
+#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[24]
+#define SWIGTYPE_p_std__invalid_argument swig_types[25]
+#define SWIGTYPE_p_std__lessT_int_t swig_types[26]
+#define SWIGTYPE_p_std__lessT_std__string_t swig_types[27]
+#define SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t swig_types[28]
+#define SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t swig_types[29]
+#define SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t swig_types[30]
+#define SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t swig_types[31]
+#define SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t swig_types[32]
+#define SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t swig_types[33]
+#define SWIGTYPE_p_std__vectorT__Tp__Alloc_t swig_types[34]
+#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[35]
+#define SWIGTYPE_p_std__vectorT_float_std__allocatorT_float_t_t swig_types[36]
+#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[37]
+#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[38]
+#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[39]
+#define SWIGTYPE_p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t swig_types[40]
+#define SWIGTYPE_p_swig__SwigPyIterator swig_types[41]
+#define SWIGTYPE_p_value_type swig_types[42]
+static swig_type_info *swig_types[44];
+static swig_module_info swig_module = {swig_types, 43, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#if (PY_VERSION_HEX <= 0x02000000)
+# if !defined(SWIG_PYTHON_CLASSIC)
+#  error "This python version requires swig to be run with the '-classic' option"
+# endif
+#endif
+
+/*-----------------------------------------------
+              @(target):= _CdiObj.so
+  ------------------------------------------------*/
+#if PY_VERSION_HEX >= 0x03000000
+#  define SWIG_init    PyInit__CdiObj
+
+#else
+#  define SWIG_init    init_CdiObj
+
+#endif
+#define SWIG_name    "_CdiObj"
+
+#define SWIGVERSION 0x020004 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 
+
+
+#include <stdexcept>
+
+
+namespace swig {
+  class SwigPtr_PyObject {
+  protected:
+    PyObject *_obj;
+
+  public:
+    SwigPtr_PyObject() :_obj(0)
+    {
+    }
+
+    SwigPtr_PyObject(const SwigPtr_PyObject& item) : _obj(item._obj)
+    {
+      Py_XINCREF(_obj);      
+    }
+    
+    SwigPtr_PyObject(PyObject *obj, bool initial_ref = true) :_obj(obj)
+    {
+      if (initial_ref) {
+        Py_XINCREF(_obj);
+      }
+    }
+    
+    SwigPtr_PyObject & operator=(const SwigPtr_PyObject& item) 
+    {
+      Py_XINCREF(item._obj);
+      Py_XDECREF(_obj);
+      _obj = item._obj;
+      return *this;      
+    }
+    
+    ~SwigPtr_PyObject() 
+    {
+      Py_XDECREF(_obj);
+    }
+    
+    operator PyObject *() const
+    {
+      return _obj;
+    }
+
+    PyObject *operator->() const
+    {
+      return _obj;
+    }
+  };
+}
+
+
+namespace swig {
+  struct SwigVar_PyObject : SwigPtr_PyObject {
+    SwigVar_PyObject(PyObject* obj = 0) : SwigPtr_PyObject(obj, false) { }
+    
+    SwigVar_PyObject & operator = (PyObject* obj)
+    {
+      Py_XDECREF(_obj);
+      _obj = obj;
+      return *this;      
+    }
+  };
+}
+
+
+#define SWIG_FILE_WITH_INIT
+#include "cdi.hpp"
+
+
+#include <stdexcept>
+
+
+#if defined(__GNUC__)
+#  if __GNUC__ == 2 && __GNUC_MINOR <= 96
+#     define SWIG_STD_NOMODERN_STL
+#  endif
+#endif
+
+
+#include <string>
+#include <stdexcept>
+#include <stddef.h>
+
+
+#include <string>
+
+
+#include <iostream>
+
+#if PY_VERSION_HEX >= 0x03020000
+# define SWIGPY_SLICE_ARG(obj) ((PyObject*) (obj))
+#else
+# define SWIGPY_SLICE_ARG(obj) ((PySliceObject*) (obj))
+#endif
+
+  
+namespace swig {
+  struct stop_iteration {
+  };
+
+  struct SwigPyIterator {
+  private:
+    SwigPtr_PyObject _seq;
+
+  protected:
+    SwigPyIterator(PyObject *seq) : _seq(seq)
+    {
+    }
+      
+  public:
+    virtual ~SwigPyIterator() {}
+
+    // Access iterator method, required by Python
+    virtual PyObject *value() const = 0;
+
+    // Forward iterator method, required by Python
+    virtual SwigPyIterator *incr(size_t n = 1) = 0;
+    
+    // Backward iterator method, very common in C++, but not required in Python
+    virtual SwigPyIterator *decr(size_t /*n*/ = 1)
+    {
+      throw stop_iteration();
+    }
+
+    // Random access iterator methods, but not required in Python
+    virtual ptrdiff_t distance(const SwigPyIterator &/*x*/) const
+    {
+      throw std::invalid_argument("operation not supported");
+    }
+
+    virtual bool equal (const SwigPyIterator &/*x*/) const
+    {
+      throw std::invalid_argument("operation not supported");
+    }
+    
+    // C++ common/needed methods
+    virtual SwigPyIterator *copy() const = 0;
+
+    PyObject *next()     
+    {
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads       
+      PyObject *obj = value();
+      incr();       
+      SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads
+      return obj;     
+    }
+
+    /* Make an alias for Python 3.x */
+    PyObject *__next__()
+    {
+      return next();
+    }
+
+    PyObject *previous()
+    {
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK; // disable threads       
+      decr();
+      PyObject *obj = value();
+      SWIG_PYTHON_THREAD_END_BLOCK; // re-enable threads       
+      return obj;
+    }
+
+    SwigPyIterator *advance(ptrdiff_t n)
+    {
+      return  (n > 0) ?  incr(n) : decr(-n);
+    }
+      
+    bool operator == (const SwigPyIterator& x)  const
+    {
+      return equal(x);
+    }
+      
+    bool operator != (const SwigPyIterator& x) const
+    {
+      return ! operator==(x);
+    }
+      
+    SwigPyIterator& operator += (ptrdiff_t n)
+    {
+      return *advance(n);
+    }
+
+    SwigPyIterator& operator -= (ptrdiff_t n)
+    {
+      return *advance(-n);
+    }
+      
+    SwigPyIterator* operator + (ptrdiff_t n) const
+    {
+      return copy()->advance(n);
+    }
+
+    SwigPyIterator* operator - (ptrdiff_t n) const
+    {
+      return copy()->advance(-n);
+    }
+      
+    ptrdiff_t operator - (const SwigPyIterator& x) const
+    {
+      return x.distance(*this);
+    }
+      
+    static swig_type_info* descriptor() {
+      static int init = 0;
+      static swig_type_info* desc = 0;
+      if (!init) {
+	desc = SWIG_TypeQuery("swig::SwigPyIterator *");
+	init = 1;
+      }	
+      return desc;
+    }    
+  };
+
+#if defined(SWIGPYTHON_BUILTIN)
+  inline PyObject* make_output_iterator_builtin (PyObject *pyself)
+  {
+    Py_INCREF(pyself);
+    return pyself;
+  }
+#endif
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_double (PyObject *obj, double *val)
+{
+  int res = SWIG_TypeError;
+  if (PyFloat_Check(obj)) {
+    if (val) *val = PyFloat_AsDouble(obj);
+    return SWIG_OK;
+  } else if (PyInt_Check(obj)) {
+    if (val) *val = PyInt_AsLong(obj);
+    return SWIG_OK;
+  } else if (PyLong_Check(obj)) {
+    double v = PyLong_AsDouble(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      PyErr_Clear();
+    }
+  }
+#ifdef SWIG_PYTHON_CAST_MODE
+  {
+    int dispatch = 0;
+    double d = PyFloat_AsDouble(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = d;
+      return SWIG_AddCast(SWIG_OK);
+    } else {
+      PyErr_Clear();
+    }
+    if (!dispatch) {
+      long v = PyLong_AsLong(obj);
+      if (!PyErr_Occurred()) {
+	if (val) *val = v;
+	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
+      } else {
+	PyErr_Clear();
+      }
+    }
+  }
+#endif
+  return res;
+}
+
+
+#include <float.h>
+
+
+#include <math.h>
+
+
+SWIGINTERNINLINE int
+SWIG_CanCastAsInteger(double *d, double min, double max) {
+  double x = *d;
+  if ((min <= x && x <= max)) {
+   double fx = floor(x);
+   double cx = ceil(x);
+   double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
+   if ((errno == EDOM) || (errno == ERANGE)) {
+     errno = 0;
+   } else {
+     double summ, reps, diff;
+     if (rd < x) {
+       diff = x - rd;
+     } else if (rd > x) {
+       diff = rd - x;
+     } else {
+       return 1;
+     }
+     summ = rd + x;
+     reps = diff/summ;
+     if (reps < 8*DBL_EPSILON) {
+       *d = rd;
+       return 1;
+     }
+   }
+  }
+  return 0;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) 
+{
+  if (PyInt_Check(obj)) {
+    long v = PyInt_AsLong(obj);
+    if (v >= 0) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      return SWIG_OverflowError;
+    }
+  } else if (PyLong_Check(obj)) {
+    unsigned long v = PyLong_AsUnsignedLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      PyErr_Clear();
+    }
+  }
+#ifdef SWIG_PYTHON_CAST_MODE
+  {
+    int dispatch = 0;
+    unsigned long v = PyLong_AsUnsignedLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_AddCast(SWIG_OK);
+    } else {
+      PyErr_Clear();
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
+	if (val) *val = (unsigned long)(d);
+	return res;
+      }
+    }
+  }
+#endif
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_AsVal_size_t (PyObject * obj, size_t *val)
+{
+  unsigned long v;
+  int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
+  if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
+  return res;
+}
+
+
+  #define SWIG_From_long   PyInt_FromLong 
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_ptrdiff_t  (ptrdiff_t value)
+{    
+  return SWIG_From_long  (static_cast< long >(value));
+}
+
+
+SWIGINTERNINLINE PyObject*
+  SWIG_From_bool  (bool value)
+{
+  return PyBool_FromLong(value ? 1 : 0);
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_long (PyObject *obj, long* val)
+{
+  if (PyInt_Check(obj)) {
+    if (val) *val = PyInt_AsLong(obj);
+    return SWIG_OK;
+  } else if (PyLong_Check(obj)) {
+    long v = PyLong_AsLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_OK;
+    } else {
+      PyErr_Clear();
+    }
+  }
+#ifdef SWIG_PYTHON_CAST_MODE
+  {
+    int dispatch = 0;
+    long v = PyInt_AsLong(obj);
+    if (!PyErr_Occurred()) {
+      if (val) *val = v;
+      return SWIG_AddCast(SWIG_OK);
+    } else {
+      PyErr_Clear();
+    }
+    if (!dispatch) {
+      double d;
+      int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
+      if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
+	if (val) *val = (long)(d);
+	return res;
+      }
+    }
+  }
+#endif
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_AsVal_ptrdiff_t (PyObject * obj, ptrdiff_t *val)
+{
+  long v;
+  int res = SWIG_AsVal_long (obj, val ? &v : 0);
+  if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
+  return res;
+}
+
+
+#include <stdexcept>
+
+
+#include <algorithm>
+
+
+#include <vector>
+
+
+#include <utility>
+
+
+#include <map>
+#include <algorithm>
+#include <stdexcept>
+
+
+namespace swig {  
+  template <class Type>
+  struct noconst_traits {
+    typedef Type noconst_type;
+  };
+
+  template <class Type>
+  struct noconst_traits<const Type> {
+    typedef Type noconst_type;
+  };
+
+  /*
+    type categories
+  */
+  struct pointer_category { };  
+  struct value_category { };
+
+  /*
+    General traits that provides type_name and type_info
+  */
+  template <class Type> struct traits { };
+
+  template <class Type>
+  inline const char* type_name() {
+    return traits<typename noconst_traits<Type >::noconst_type >::type_name();
+  }
+
+  template <class Type> 
+  struct traits_info {
+    static swig_type_info *type_query(std::string name) {
+      name += " *";
+      return SWIG_TypeQuery(name.c_str());
+    }    
+    static swig_type_info *type_info() {
+      static swig_type_info *info = type_query(type_name<Type>());
+      return info;
+    }
+  };
+
+  template <class Type>
+  inline swig_type_info *type_info() {
+    return traits_info<Type>::type_info();
+  }
+
+  /*
+    Partial specialization for pointers
+  */
+  template <class Type> struct traits <Type *> {
+    typedef pointer_category category;
+    static std::string make_ptr_name(const char* name) {
+      std::string ptrname = name;
+      ptrname += " *";
+      return ptrname;
+    }    
+    static const char* type_name() {
+      static std::string name = make_ptr_name(swig::type_name<Type>());
+      return name.c_str();
+    }
+  };
+
+  template <class Type, class Category> 
+  struct traits_as { };
+ 
+  template <class Type, class Category> 
+  struct traits_check { };
+
+}
+
+
+namespace swig {  
+  /*
+    Traits that provides the from method
+  */
+  template <class Type> struct traits_from_ptr {
+    static PyObject *from(Type *val, int owner = 0) {
+      return SWIG_InternalNewPointerObj(val, type_info<Type>(), owner);
+    }
+  };
+
+  template <class Type> struct traits_from {
+    static PyObject *from(const Type& val) {
+      return traits_from_ptr<Type>::from(new Type(val), 1);
+    }
+  };
+
+  template <class Type> struct traits_from<Type *> {
+    static PyObject *from(Type* val) {
+      return traits_from_ptr<Type>::from(val, 0);
+    }
+  };
+
+  template <class Type> struct traits_from<const Type *> {
+    static PyObject *from(const Type* val) {
+      return traits_from_ptr<Type>::from(const_cast<Type*>(val), 0);
+    }
+  };
+
+
+  template <class Type>
+  inline PyObject *from(const Type& val) {
+    return traits_from<Type>::from(val);
+  }
+
+  template <class Type>
+  inline PyObject *from_ptr(Type* val, int owner) {
+    return traits_from_ptr<Type>::from(val, owner);
+  }
+
+  /*
+    Traits that provides the asval/as/check method
+  */
+  template <class Type>
+  struct traits_asptr {   
+    static int asptr(PyObject *obj, Type **val) {
+      Type *p;
+      int res = SWIG_ConvertPtr(obj, (void**)&p, type_info<Type>(), 0);
+      if (SWIG_IsOK(res)) {
+	if (val) *val = p;
+      }
+      return res;
+    }
+  }; 
+
+  template <class Type>
+  inline int asptr(PyObject *obj, Type **vptr) {
+    return traits_asptr<Type>::asptr(obj, vptr);
+  }
+
+  template <class Type> 
+  struct traits_asval {
+    static int asval(PyObject *obj, Type *val) {
+      if (val) {
+	Type *p = 0;
+	int res = traits_asptr<Type>::asptr(obj, &p);
+	if (!SWIG_IsOK(res)) return res;	
+	if (p) {
+	  typedef typename noconst_traits<Type>::noconst_type noconst_type;
+	  *(const_cast<noconst_type*>(val)) = *p;
+	  if (SWIG_IsNewObj(res)){
+	    delete p;
+	    res = SWIG_DelNewMask(res);
+	  }
+	  return res;
+	} else {
+	  return SWIG_ERROR;
+	}
+      } else {
+	return traits_asptr<Type>::asptr(obj, (Type **)(0));
+      }
+    }
+  };
+
+  template <class Type> struct traits_asval<Type*> {
+    static int asval(PyObject *obj, Type **val) {
+      if (val) {
+        typedef typename noconst_traits<Type>::noconst_type noconst_type;
+        noconst_type *p = 0;
+        int res = traits_asptr<noconst_type>::asptr(obj,  &p);
+        if (SWIG_IsOK(res)) {
+          *(const_cast<noconst_type**>(val)) = p;
+	}
+	return res;
+      } else {
+	return traits_asptr<Type>::asptr(obj, (Type **)(0));
+      }
+    }
+  };
+  
+  template <class Type>
+  inline int asval(PyObject *obj, Type *val) {
+    return traits_asval<Type>::asval(obj, val);
+  }
+
+  template <class Type> 
+  struct traits_as<Type, value_category> {
+    static Type as(PyObject *obj, bool throw_error) {
+      Type v;
+      int res = asval(obj, &v);
+      if (!obj || !SWIG_IsOK(res)) {
+	if (!PyErr_Occurred()) {
+	  ::SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
+	}
+	if (throw_error) throw std::invalid_argument("bad type");
+      }
+      return v;
+    }
+  };
+
+  template <class Type> 
+  struct traits_as<Type, pointer_category> {
+    static Type as(PyObject *obj, bool throw_error) {
+      Type *v = 0;      
+      int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
+      if (SWIG_IsOK(res) && v) {
+	if (SWIG_IsNewObj(res)) {
+	  Type r(*v);
+	  delete v;
+	  return r;
+	} else {
+	  return *v;
+	}
+      } else {
+	// Uninitialized return value, no Type() constructor required.
+	static Type *v_def = (Type*) malloc(sizeof(Type));
+	if (!PyErr_Occurred()) {
+	  SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
+	}
+	if (throw_error) throw std::invalid_argument("bad type");
+	memset(v_def,0,sizeof(Type));
+	return *v_def;
+      }
+    }
+  };
+
+  template <class Type> 
+  struct traits_as<Type*, pointer_category> {
+    static Type* as(PyObject *obj, bool throw_error) {
+      Type *v = 0;      
+      int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
+      if (SWIG_IsOK(res)) {
+	return v;
+      } else {
+	if (!PyErr_Occurred()) {
+	  SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
+	}
+	if (throw_error) throw std::invalid_argument("bad type");
+	return 0;
+      }
+    }
+  };
+    
+  template <class Type>
+  inline Type as(PyObject *obj, bool te = false) {
+    return traits_as<Type, typename traits<Type>::category>::as(obj, te);
+  }
+
+  template <class Type> 
+  struct traits_check<Type, value_category> {
+    static bool check(PyObject *obj) {
+      int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR;
+      return SWIG_IsOK(res) ? true : false;
+    }
+  };
+
+  template <class Type> 
+  struct traits_check<Type, pointer_category> {
+    static bool check(PyObject *obj) {
+      int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR;
+      return SWIG_IsOK(res) ? true : false;
+    }
+  };
+
+  template <class Type>
+  inline bool check(PyObject *obj) {
+    return traits_check<Type, typename traits<Type>::category>::check(obj);
+  }
+}
+
+
+#include <functional>
+
+namespace std {
+  template <>
+  struct less <PyObject *>: public binary_function<PyObject *, PyObject *, bool>
+  {
+    bool
+    operator()(PyObject * v, PyObject *w) const
+    { 
+      bool res;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      res = PyObject_RichCompareBool(v, w, Py_LT) ? true : false;
+      /* This may fall into a case of inconsistent
+               eg. ObjA > ObjX > ObjB
+               but ObjA < ObjB
+      */
+      if( PyErr_Occurred() && PyErr_ExceptionMatches(PyExc_TypeError) )
+      {
+        /* Objects can't be compared, this mostly occurred in Python 3.0 */
+        /* Compare their ptr directly for a workaround */
+        res = (v < w);
+        PyErr_Clear();
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return res;
+    }
+  };
+
+  template <>
+  struct less <swig::SwigPtr_PyObject>: public binary_function<swig::SwigPtr_PyObject, swig::SwigPtr_PyObject, bool>
+  {
+    bool
+    operator()(const swig::SwigPtr_PyObject& v, const swig::SwigPtr_PyObject& w) const
+    {
+      return std::less<PyObject *>()(v, w);
+    }
+  };
+
+  template <>
+  struct less <swig::SwigVar_PyObject>: public binary_function<swig::SwigVar_PyObject, swig::SwigVar_PyObject, bool>
+  {
+    bool
+    operator()(const swig::SwigVar_PyObject& v, const swig::SwigVar_PyObject& w) const
+    {
+      return std::less<PyObject *>()(v, w);
+    }
+  };
+
+}
+
+namespace swig {
+  template <> struct traits<PyObject *> {
+    typedef value_category category;
+    static const char* type_name() { return "PyObject *"; }
+  };  
+
+  template <>  struct traits_asval<PyObject * > {   
+    typedef PyObject * value_type;
+    static int asval(PyObject *obj, value_type *val) {
+      if (val) *val = obj;
+      return SWIG_OK;
+    }
+  };
+
+  template <> 
+  struct traits_check<PyObject *, value_category> {
+    static bool check(PyObject *) {
+      return true;
+    }
+  };
+
+  template <>  struct traits_from<PyObject *> {
+    typedef PyObject * value_type;
+    static PyObject *from(const value_type& val) {
+      Py_XINCREF(val);
+      return val;
+    }
+  };
+  
+}
+
+namespace swig {
+  inline size_t
+  check_index(ptrdiff_t i, size_t size, bool insert = false) {
+    if ( i < 0 ) {
+      if ((size_t) (-i) <= size)
+	return (size_t) (i + size);
+    } else if ( (size_t) i < size ) {
+      return (size_t) i;
+    } else if (insert && ((size_t) i == size)) {
+      return size;
+    }
+    
+    throw std::out_of_range("index out of range");
+  }
+
+  inline size_t
+  slice_index(ptrdiff_t i, size_t size) {
+    if ( i < 0 ) {
+      if ((size_t) (-i) <= size) {
+	return (size_t) (i + size);
+      } else {
+	throw std::out_of_range("index out of range");
+      }
+    } else {
+      return ( (size_t) i < size ) ? ((size_t) i) : size;
+    }
+  }
+
+  template <class Sequence, class Difference>
+  inline typename Sequence::iterator
+  getpos(Sequence* self, Difference i)  {
+    typename Sequence::iterator pos = self->begin();
+    std::advance(pos, check_index(i,self->size()));
+    return pos;
+  }
+
+  template <class Sequence, class Difference>
+  inline typename Sequence::const_iterator
+  cgetpos(const Sequence* self, Difference i)  {
+    typename Sequence::const_iterator pos = self->begin();
+    std::advance(pos, check_index(i,self->size()));
+    return pos;
+  }
+
+  template <class Sequence, class Difference>
+  inline Sequence*
+  getslice(const Sequence* self, Difference i, Difference j) {
+    typename Sequence::size_type size = self->size();
+    typename Sequence::size_type ii = swig::check_index(i, size);
+    typename Sequence::size_type jj = swig::slice_index(j, size);
+
+    if (jj > ii) {
+      typename Sequence::const_iterator vb = self->begin();
+      typename Sequence::const_iterator ve = self->begin();
+      std::advance(vb,ii);
+      std::advance(ve,jj);
+      return new Sequence(vb, ve);
+    } else {
+      return new Sequence();
+    }
+  }
+
+  template <class Sequence, class Difference, class InputSeq>
+  inline void
+  setslice(Sequence* self, Difference i, Difference j, const InputSeq& v = InputSeq()) {
+    typename Sequence::size_type size = self->size();
+    typename Sequence::size_type ii = swig::check_index(i, size, true);
+    typename Sequence::size_type jj = swig::slice_index(j, size);
+    if (jj < ii) jj = ii;
+    size_t ssize = jj - ii;
+    if (ssize <= v.size()) {
+      typename Sequence::iterator sb = self->begin();
+      typename InputSeq::const_iterator vmid = v.begin();
+      std::advance(sb,ii);
+      std::advance(vmid, jj - ii);
+      self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end());
+    } else {
+      typename Sequence::iterator sb = self->begin();
+      typename Sequence::iterator se = self->begin();
+      std::advance(sb,ii);
+      std::advance(se,jj);
+      self->erase(sb,se);
+      self->insert(sb, v.begin(), v.end());
+    }
+  }
+
+  template <class Sequence, class Difference>
+  inline void
+  delslice(Sequence* self, Difference i, Difference j) {
+    typename Sequence::size_type size = self->size();
+    typename Sequence::size_type ii = swig::check_index(i, size, true);
+    typename Sequence::size_type jj = swig::slice_index(j, size);
+    if (jj > ii) {
+      typename Sequence::iterator sb = self->begin();
+      typename Sequence::iterator se = self->begin();
+      std::advance(sb,ii);
+      std::advance(se,jj);
+      self->erase(sb,se);
+    }
+  }
+}
+
+
+#if defined(__SUNPRO_CC) && defined(_RWSTD_VER)
+#  if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL)
+#    define SWIG_STD_NOITERATOR_TRAITS_STL
+#  endif
+#endif
+
+#if !defined(SWIG_STD_NOITERATOR_TRAITS_STL)
+#include <iterator>
+#else
+namespace std {
+  template <class Iterator>
+  struct iterator_traits {
+    typedef ptrdiff_t difference_type;
+    typedef typename Iterator::value_type value_type;
+  };
+
+  template <class Iterator, class Category,class T, class Reference, class Pointer, class Distance>
+  struct iterator_traits<__reverse_bi_iterator<Iterator,Category,T,Reference,Pointer,Distance> > {
+    typedef Distance difference_type;
+    typedef T value_type;
+  };
+
+  template <class T>
+  struct iterator_traits<T*> {
+    typedef T value_type;
+    typedef ptrdiff_t difference_type;
+  };
+
+  template<typename _InputIterator>
+  inline typename iterator_traits<_InputIterator>::difference_type
+  distance(_InputIterator __first, _InputIterator __last)
+  {
+    typename iterator_traits<_InputIterator>::difference_type __n = 0;
+    while (__first != __last) {
+      ++__first; ++__n;
+    }
+    return __n;
+  }
+}
+#endif
+
+
+namespace swig {
+  template<typename OutIterator>
+  class SwigPyIterator_T :  public SwigPyIterator
+  {
+  public:
+    typedef OutIterator out_iterator;
+    typedef typename std::iterator_traits<out_iterator>::value_type value_type;    
+    typedef SwigPyIterator_T<out_iterator> self_type;
+
+    SwigPyIterator_T(out_iterator curr, PyObject *seq)
+      : SwigPyIterator(seq), current(curr)
+    {
+    }
+
+    const out_iterator& get_current() const
+    {
+      return current;
+    }
+
+    
+    bool equal (const SwigPyIterator &iter) const
+    {
+      const self_type *iters = dynamic_cast<const self_type *>(&iter);
+      if (iters) {
+	return (current == iters->get_current());
+      } else {
+	throw std::invalid_argument("bad iterator type");
+      }
+    }
+    
+    ptrdiff_t distance(const SwigPyIterator &iter) const
+    {
+      const self_type *iters = dynamic_cast<const self_type *>(&iter);
+      if (iters) {
+	return std::distance(current, iters->get_current());
+      } else {
+	throw std::invalid_argument("bad iterator type");
+      }
+    }    
+    
+  protected:
+    out_iterator current;
+  };
+  
+  template <class ValueType>
+  struct from_oper 
+  {
+    typedef const ValueType& argument_type;
+    typedef PyObject *result_type;
+    result_type operator()(argument_type v) const
+    {
+      return swig::from(v);
+    }
+  };
+
+  template<typename OutIterator, 
+	   typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
+	   typename FromOper = from_oper<ValueType> >
+  class SwigPyIteratorOpen_T :  public SwigPyIterator_T<OutIterator>
+  {
+  public:
+    FromOper from;
+    typedef OutIterator out_iterator;
+    typedef ValueType value_type;
+    typedef SwigPyIterator_T<out_iterator>  base;
+    typedef SwigPyIteratorOpen_T<OutIterator, ValueType, FromOper> self_type;
+    
+    SwigPyIteratorOpen_T(out_iterator curr, PyObject *seq)
+      : SwigPyIterator_T<OutIterator>(curr, seq)
+    {
+    }
+    
+    PyObject *value() const {
+      return from(static_cast<const value_type&>(*(base::current)));
+    }
+    
+    SwigPyIterator *copy() const
+    {
+      return new self_type(*this);
+    }
+
+    SwigPyIterator *incr(size_t n = 1)
+    {
+      while (n--) {
+	++base::current;
+      }
+      return this;
+    }
+
+    SwigPyIterator *decr(size_t n = 1)
+    {
+      while (n--) {
+	--base::current;
+      }
+      return this;
+    }
+  };
+
+  template<typename OutIterator, 
+	   typename ValueType = typename std::iterator_traits<OutIterator>::value_type,
+	   typename FromOper = from_oper<ValueType> >
+  class SwigPyIteratorClosed_T :  public SwigPyIterator_T<OutIterator>
+  {
+  public:
+    FromOper from;
+    typedef OutIterator out_iterator;
+    typedef ValueType value_type;
+    typedef SwigPyIterator_T<out_iterator>  base;    
+    typedef SwigPyIteratorClosed_T<OutIterator, ValueType, FromOper> self_type;
+    
+    SwigPyIteratorClosed_T(out_iterator curr, out_iterator first, out_iterator last, PyObject *seq)
+      : SwigPyIterator_T<OutIterator>(curr, seq), begin(first), end(last)
+    {
+    }
+    
+    PyObject *value() const {
+      if (base::current == end) {
+	throw stop_iteration();
+      } else {
+	return from(static_cast<const value_type&>(*(base::current)));
+      }
+    }
+    
+    SwigPyIterator *copy() const
+    {
+      return new self_type(*this);
+    }
+
+    SwigPyIterator *incr(size_t n = 1)
+    {
+      while (n--) {
+	if (base::current == end) {
+	  throw stop_iteration();
+	} else {
+	  ++base::current;
+	}
+      }
+      return this;
+    }
+
+    SwigPyIterator *decr(size_t n = 1)
+    {
+      while (n--) {
+	if (base::current == begin) {
+	  throw stop_iteration();
+	} else {
+	  --base::current;
+	}
+      }
+      return this;
+    }
+
+  private:
+    out_iterator begin;
+    out_iterator end;
+  };
+
+  template<typename OutIter>
+  inline SwigPyIterator*
+  make_output_iterator(const OutIter& current, const OutIter& begin,const OutIter& end, PyObject *seq = 0)
+  {
+    return new SwigPyIteratorClosed_T<OutIter>(current, begin, end, seq);
+  }
+
+  template<typename OutIter>
+  inline SwigPyIterator*
+  make_output_iterator(const OutIter& current, PyObject *seq = 0)
+  {
+    return new SwigPyIteratorOpen_T<OutIter>(current, seq);
+  }
+
+}
+
+
+namespace swig
+{
+  template <class T>
+  struct SwigPySequence_Ref
+  {
+    SwigPySequence_Ref(PyObject* seq, int index)
+      : _seq(seq), _index(index)
+    {
+    }
+    
+    operator T () const
+    {
+      swig::SwigVar_PyObject item = PySequence_GetItem(_seq, _index);
+      try {
+	return swig::as<T>(item, true);
+      } catch (std::exception& e) {
+	char msg[1024];
+	sprintf(msg, "in sequence element %d ", _index);
+	if (!PyErr_Occurred()) {
+	  ::SWIG_Error(SWIG_TypeError,  swig::type_name<T>());
+	}
+	SWIG_Python_AddErrorMsg(msg);
+	SWIG_Python_AddErrorMsg(e.what());
+	throw;
+      }
+    }
+
+    SwigPySequence_Ref& operator=(const T& v)
+    {
+      PySequence_SetItem(_seq, _index, swig::from<T>(v));
+      return *this;
+    }
+
+  private:
+    PyObject* _seq;
+    int _index;
+  };
+
+  template <class T>
+  struct SwigPySequence_ArrowProxy
+  {
+    SwigPySequence_ArrowProxy(const T& x): m_value(x) {}
+    const T* operator->() const { return &m_value; }
+    operator const T*() const { return &m_value; }
+    T m_value;
+  };
+
+  template <class T, class Reference >
+  struct SwigPySequence_InputIterator
+  {
+    typedef SwigPySequence_InputIterator<T, Reference > self;
+
+    typedef std::random_access_iterator_tag iterator_category;
+    typedef Reference reference;
+    typedef T value_type;
+    typedef T* pointer;
+    typedef int difference_type;
+
+    SwigPySequence_InputIterator()
+    {
+    }
+
+    SwigPySequence_InputIterator(PyObject* seq, int index)
+      : _seq(seq), _index(index)
+    {
+    }
+
+    reference operator*() const
+    {
+      return reference(_seq, _index);
+    }
+
+    SwigPySequence_ArrowProxy<T>
+    operator->() const {
+      return SwigPySequence_ArrowProxy<T>(operator*());
+    }
+
+    bool operator==(const self& ri) const
+    {
+      return (_index == ri._index) && (_seq == ri._seq);
+    }
+
+    bool operator!=(const self& ri) const
+    {
+      return !(operator==(ri));
+    }
+
+    self& operator ++ ()
+    {
+      ++_index;
+      return *this;
+    }
+
+    self& operator -- ()
+    {
+      --_index;
+      return *this;
+    }
+
+    self& operator += (difference_type n)
+    {
+      _index += n;
+      return *this;
+    }
+
+    self operator +(difference_type n) const
+    {
+      return self(_seq, _index + n);
+    }
+
+    self& operator -= (difference_type n)
+    {
+      _index -= n;
+      return *this;
+    }
+
+    self operator -(difference_type n) const
+    {
+      return self(_seq, _index - n);
+    }
+
+    difference_type operator - (const self& ri) const
+    {
+      return _index - ri._index;
+    }
+
+    bool operator < (const self& ri) const
+    {
+      return _index < ri._index;
+    }
+
+    reference
+    operator[](difference_type n) const
+    {
+      return reference(_seq, _index + n);
+    }
+
+  private:
+    PyObject* _seq;
+    difference_type _index;
+  };
+
+  template <class T>
+  struct SwigPySequence_Cont
+  {
+    typedef SwigPySequence_Ref<T> reference;
+    typedef const SwigPySequence_Ref<T> const_reference;
+    typedef T value_type;
+    typedef T* pointer;
+    typedef int difference_type;
+    typedef int size_type;
+    typedef const pointer const_pointer;
+    typedef SwigPySequence_InputIterator<T, reference> iterator;
+    typedef SwigPySequence_InputIterator<T, const_reference> const_iterator;
+
+    SwigPySequence_Cont(PyObject* seq) : _seq(0)
+    {
+      if (!PySequence_Check(seq)) {
+	throw std::invalid_argument("a sequence is expected");
+      }
+      _seq = seq;
+      Py_INCREF(_seq);
+    }
+
+    ~SwigPySequence_Cont()
+    {
+      Py_XDECREF(_seq);
+    }
+
+    size_type size() const
+    {
+      return static_cast<size_type>(PySequence_Size(_seq));
+    }
+
+    bool empty() const
+    {
+      return size() == 0;
+    }
+
+    iterator begin()
+    {
+      return iterator(_seq, 0);
+    }
+
+    const_iterator begin() const
+    {
+      return const_iterator(_seq, 0);
+    }
+
+    iterator end()
+    {
+      return iterator(_seq, size());
+    }
+
+    const_iterator end() const
+    {
+      return const_iterator(_seq, size());
+    }
+
+    reference operator[](difference_type n)
+    {
+      return reference(_seq, n);
+    }
+
+    const_reference operator[](difference_type n)  const
+    {
+      return const_reference(_seq, n);
+    }
+
+    bool check(bool set_err = true) const
+    {
+      int s = size();
+      for (int i = 0; i < s; ++i) {
+	swig::SwigVar_PyObject item = PySequence_GetItem(_seq, i);
+	if (!swig::check<value_type>(item)) {
+	  if (set_err) {
+	    char msg[1024];
+	    sprintf(msg, "in sequence element %d", i);
+	    SWIG_Error(SWIG_RuntimeError, msg);
+	  }
+	  return false;
+	}
+      }
+      return true;
+    }
+
+  private:
+    PyObject* _seq;
+  };
+
+}
+
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+SWIGINTERN int
+SWIG_AsVal_int (PyObject * obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long (obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = static_cast< int >(v);
+    }
+  }  
+  return res;
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_int  (int value)
+{    
+  return SWIG_From_long  (value);
+}
+
+
+namespace swig {
+  template <> struct traits<int > {
+    typedef value_category category;
+    static const char* type_name() { return"int"; }
+  };  
+  template <>  struct traits_asval<int > {   
+    typedef int value_type;
+    static int asval(PyObject *obj, value_type *val) { 
+      return SWIG_AsVal_int (obj, val);
+    }
+  };
+  template <>  struct traits_from<int > {
+    typedef int value_type;
+    static PyObject *from(const value_type& val) {
+      return SWIG_From_int  (val);
+    }
+  };
+}
+
+
+namespace swig {
+  template <class SwigPySeq, class Seq>
+  inline void
+  assign(const SwigPySeq& swigpyseq, Seq* seq) {
+    // seq->assign(swigpyseq.begin(), swigpyseq.end()); // not used as not always implemented
+    typedef typename SwigPySeq::value_type value_type;
+    typename SwigPySeq::const_iterator it = swigpyseq.begin();
+    for (;it != swigpyseq.end(); ++it) {
+      seq->insert(seq->end(),(value_type)(*it));
+    }
+  }
+
+  template <class Seq, class T = typename Seq::value_type >
+  struct traits_asptr_stdseq {
+    typedef Seq sequence;
+    typedef T value_type;
+
+    static int asptr(PyObject *obj, sequence **seq) {
+      if (obj == Py_None || SWIG_Python_GetSwigThis(obj)) {
+	sequence *p;
+	if (::SWIG_ConvertPtr(obj,(void**)&p,
+			      swig::type_info<sequence>(),0) == SWIG_OK) {
+	  if (seq) *seq = p;
+	  return SWIG_OLDOBJ;
+	}
+      } else if (PySequence_Check(obj)) {
+	try {
+	  SwigPySequence_Cont<value_type> swigpyseq(obj);
+	  if (seq) {
+	    sequence *pseq = new sequence();
+	    assign(swigpyseq, pseq);
+	    *seq = pseq;
+	    return SWIG_NEWOBJ;
+	  } else {
+	    return swigpyseq.check() ? SWIG_OK : SWIG_ERROR;
+	  }
+	} catch (std::exception& e) {
+	  if (seq) {
+	    if (!PyErr_Occurred()) {
+	      PyErr_SetString(PyExc_TypeError, e.what());
+	    }
+	  }
+	  return SWIG_ERROR;
+	}
+      }
+      return SWIG_ERROR;
+    }
+  };
+
+  template <class Seq, class T = typename Seq::value_type >
+  struct traits_from_stdseq {
+    typedef Seq sequence;
+    typedef T value_type;
+    typedef typename Seq::size_type size_type;
+    typedef typename sequence::const_iterator const_iterator;
+
+    static PyObject *from(const sequence& seq) {
+#ifdef SWIG_PYTHON_EXTRA_NATIVE_CONTAINERS
+      swig_type_info *desc = swig::type_info<sequence>();
+      if (desc && desc->clientdata) {
+	return SWIG_NewPointerObj(new sequence(seq), desc, SWIG_POINTER_OWN);
+      }
+#endif
+      size_type size = seq.size();
+      if (size <= (size_type)INT_MAX) {
+	PyObject *obj = PyTuple_New((int)size);
+	int i = 0;
+	for (const_iterator it = seq.begin();
+	     it != seq.end(); ++it, ++i) {
+	  PyTuple_SetItem(obj,i,swig::from<value_type>(*it));
+	}
+	return obj;
+      } else {
+	PyErr_SetString(PyExc_OverflowError,"sequence size not valid in python");
+	return NULL;
+      }
+    }
+  };
+}
+
+
+  namespace swig {
+    template <class T>
+    struct traits_asptr<std::vector<T> >  {
+      static int asptr(PyObject *obj, std::vector<T> **vec) {
+	return traits_asptr_stdseq<std::vector<T> >::asptr(obj, vec);
+      }
+    };
+    
+    template <class T>
+    struct traits_from<std::vector<T> > {
+      static PyObject *from(const std::vector<T>& vec) {
+	return traits_from_stdseq<std::vector<T> >::from(vec);
+      }
+    };
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::vector<int, std::allocator< int > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::vector<" "int" "," "std::allocator< int >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN swig::SwigPyIterator *std_vector_Sl_int_Sg__iterator(std::vector< int > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN bool std_vector_Sl_int_Sg____nonzero__(std::vector< int > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN bool std_vector_Sl_int_Sg____bool__(std::vector< int > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN std::vector< int >::size_type std_vector_Sl_int_Sg____len__(std::vector< int > const *self){
+      return self->size();
+    }
+
+SWIGINTERNINLINE PyObject* 
+SWIG_From_unsigned_SS_long  (unsigned long value)
+{
+  return (value > LONG_MAX) ?
+    PyLong_FromUnsignedLong(value) : PyInt_FromLong(static_cast< long >(value)); 
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_size_t  (size_t value)
+{    
+  return SWIG_From_unsigned_SS_long  (static_cast< unsigned long >(value));
+}
+
+SWIGINTERN std::vector< int >::value_type std_vector_Sl_int_Sg__pop(std::vector< int > *self){
+      if (self->size() == 0)
+	throw std::out_of_range("pop from empty container");
+      std::vector<int,std::allocator< int > >::value_type x = self->back();
+      self->pop_back();
+      return x;
+    }
+SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg____getslice__(std::vector< int > *self,std::vector< int >::difference_type i,std::vector< int >::difference_type j){
+      return swig::getslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_int_Sg____setslice____SWIG_0(std::vector< int > *self,std::vector< int >::difference_type i,std::vector< int >::difference_type j,std::vector< int,std::allocator< int > > const &v=std::vector< int,std::allocator< int > >()){
+      swig::setslice(self, i, j, v);
+    }
+SWIGINTERN void std_vector_Sl_int_Sg____delslice__(std::vector< int > *self,std::vector< int >::difference_type i,std::vector< int >::difference_type j){
+      swig::delslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_int_Sg____delitem____SWIG_0(std::vector< int > *self,std::vector< int >::difference_type i){
+      self->erase(swig::getpos(self,i));
+    }
+SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg____getitem____SWIG_0(std::vector< int > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return NULL;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      return swig::getslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_int_Sg____setitem____SWIG_0(std::vector< int > *self,PySliceObject *slice,std::vector< int,std::allocator< int > > const &v){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::setslice(self, i, j, v);
+    }
+SWIGINTERN void std_vector_Sl_int_Sg____setitem____SWIG_1(std::vector< int > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::delslice(self, i,j);
+    }
+SWIGINTERN void std_vector_Sl_int_Sg____delitem____SWIG_1(std::vector< int > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::delslice(self, i,j);
+    }
+SWIGINTERN std::vector< int >::value_type const &std_vector_Sl_int_Sg____getitem____SWIG_1(std::vector< int > const *self,std::vector< int >::difference_type i){
+      return *(swig::cgetpos(self, i));
+    }
+SWIGINTERN void std_vector_Sl_int_Sg____setitem____SWIG_2(std::vector< int > *self,std::vector< int >::difference_type i,std::vector< int >::value_type const &x){
+      *(swig::getpos(self,i)) = x;
+    }
+SWIGINTERN void std_vector_Sl_int_Sg__append(std::vector< int > *self,std::vector< int >::value_type const &x){
+      self->push_back(x);
+    }
+
+  #define SWIG_From_double   PyFloat_FromDouble 
+
+
+namespace swig {
+  template <> struct traits<double > {
+    typedef value_category category;
+    static const char* type_name() { return"double"; }
+  };  
+  template <>  struct traits_asval<double > {   
+    typedef double value_type;
+    static int asval(PyObject *obj, value_type *val) { 
+      return SWIG_AsVal_double (obj, val);
+    }
+  };
+  template <>  struct traits_from<double > {
+    typedef double value_type;
+    static PyObject *from(const value_type& val) {
+      return SWIG_From_double  (val);
+    }
+  };
+}
+
+
+      namespace swig {
+	template <>  struct traits<std::vector<double, std::allocator< double > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::vector<" "double" "," "std::allocator< double >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN swig::SwigPyIterator *std_vector_Sl_double_Sg__iterator(std::vector< double > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN bool std_vector_Sl_double_Sg____nonzero__(std::vector< double > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN bool std_vector_Sl_double_Sg____bool__(std::vector< double > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN std::vector< double >::size_type std_vector_Sl_double_Sg____len__(std::vector< double > const *self){
+      return self->size();
+    }
+SWIGINTERN std::vector< double >::value_type std_vector_Sl_double_Sg__pop(std::vector< double > *self){
+      if (self->size() == 0)
+	throw std::out_of_range("pop from empty container");
+      std::vector<double,std::allocator< double > >::value_type x = self->back();
+      self->pop_back();
+      return x;
+    }
+SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg____getslice__(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::difference_type j){
+      return swig::getslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_double_Sg____setslice____SWIG_0(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::difference_type j,std::vector< double,std::allocator< double > > const &v=std::vector< double,std::allocator< double > >()){
+      swig::setslice(self, i, j, v);
+    }
+SWIGINTERN void std_vector_Sl_double_Sg____delslice__(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::difference_type j){
+      swig::delslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_double_Sg____delitem____SWIG_0(std::vector< double > *self,std::vector< double >::difference_type i){
+      self->erase(swig::getpos(self,i));
+    }
+SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg____getitem____SWIG_0(std::vector< double > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return NULL;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      return swig::getslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_double_Sg____setitem____SWIG_0(std::vector< double > *self,PySliceObject *slice,std::vector< double,std::allocator< double > > const &v){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::setslice(self, i, j, v);
+    }
+SWIGINTERN void std_vector_Sl_double_Sg____setitem____SWIG_1(std::vector< double > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::delslice(self, i,j);
+    }
+SWIGINTERN void std_vector_Sl_double_Sg____delitem____SWIG_1(std::vector< double > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::delslice(self, i,j);
+    }
+SWIGINTERN std::vector< double >::value_type const &std_vector_Sl_double_Sg____getitem____SWIG_1(std::vector< double > const *self,std::vector< double >::difference_type i){
+      return *(swig::cgetpos(self, i));
+    }
+SWIGINTERN void std_vector_Sl_double_Sg____setitem____SWIG_2(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::value_type const &x){
+      *(swig::getpos(self,i)) = x;
+    }
+SWIGINTERN void std_vector_Sl_double_Sg__append(std::vector< double > *self,std::vector< double >::value_type const &x){
+      self->push_back(x);
+    }
+
+      namespace swig {
+	template <>  struct traits<std::vector<std::vector< double,std::allocator< double > >, std::allocator< std::vector< double,std::allocator< double > > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::vector<" "std::vector< double,std::allocator< double > >" "," "std::allocator< std::vector< double,std::allocator< double > > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN swig::SwigPyIterator *std_vector_Sl_std_vector_Sl_double_Sg__Sg__iterator(std::vector< std::vector< double > > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN bool std_vector_Sl_std_vector_Sl_double_Sg__Sg____nonzero__(std::vector< std::vector< double > > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN bool std_vector_Sl_std_vector_Sl_double_Sg__Sg____bool__(std::vector< std::vector< double > > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN std::vector< std::vector< double > >::size_type std_vector_Sl_std_vector_Sl_double_Sg__Sg____len__(std::vector< std::vector< double > > const *self){
+      return self->size();
+    }
+SWIGINTERN std::vector< std::vector< double > >::value_type std_vector_Sl_std_vector_Sl_double_Sg__Sg__pop(std::vector< std::vector< double > > *self){
+      if (self->size() == 0)
+	throw std::out_of_range("pop from empty container");
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type x = self->back();
+      self->pop_back();
+      return x;
+    }
+SWIGINTERN std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *std_vector_Sl_std_vector_Sl_double_Sg__Sg____getslice__(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::difference_type i,std::vector< std::vector< double > >::difference_type j){
+      return swig::getslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_std_vector_Sl_double_Sg__Sg____setslice____SWIG_0(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::difference_type i,std::vector< std::vector< double > >::difference_type j,std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &v=std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double >  [...]
+      swig::setslice(self, i, j, v);
+    }
+SWIGINTERN void std_vector_Sl_std_vector_Sl_double_Sg__Sg____delslice__(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::difference_type i,std::vector< std::vector< double > >::difference_type j){
+      swig::delslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_std_vector_Sl_double_Sg__Sg____delitem____SWIG_0(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::difference_type i){
+      self->erase(swig::getpos(self,i));
+    }
+SWIGINTERN std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *std_vector_Sl_std_vector_Sl_double_Sg__Sg____getitem____SWIG_0(std::vector< std::vector< double > > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return NULL;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      return swig::getslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_std_vector_Sl_double_Sg__Sg____setitem____SWIG_0(std::vector< std::vector< double > > *self,PySliceObject *slice,std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &v){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::setslice(self, i, j, v);
+    }
+SWIGINTERN void std_vector_Sl_std_vector_Sl_double_Sg__Sg____setitem____SWIG_1(std::vector< std::vector< double > > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::delslice(self, i,j);
+    }
+SWIGINTERN void std_vector_Sl_std_vector_Sl_double_Sg__Sg____delitem____SWIG_1(std::vector< std::vector< double > > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::delslice(self, i,j);
+    }
+SWIGINTERN std::vector< std::vector< double > >::value_type const &std_vector_Sl_std_vector_Sl_double_Sg__Sg____getitem____SWIG_1(std::vector< std::vector< double > > const *self,std::vector< std::vector< double > >::difference_type i){
+      return *(swig::cgetpos(self, i));
+    }
+SWIGINTERN void std_vector_Sl_std_vector_Sl_double_Sg__Sg____setitem____SWIG_2(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::difference_type i,std::vector< std::vector< double > >::value_type const &x){
+      *(swig::getpos(self,i)) = x;
+    }
+SWIGINTERN void std_vector_Sl_std_vector_Sl_double_Sg__Sg__append(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::value_type const &x){
+      self->push_back(x);
+    }
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
+{
+#if PY_VERSION_HEX>=0x03000000
+  if (PyUnicode_Check(obj))
+#else  
+  if (PyString_Check(obj))
+#endif
+  {
+    char *cstr; Py_ssize_t len;
+#if PY_VERSION_HEX>=0x03000000
+    if (!alloc && cptr) {
+        /* We can't allow converting without allocation, since the internal
+           representation of string in Python 3 is UCS-2/UCS-4 but we require
+           a UTF-8 representation.
+           TODO(bhy) More detailed explanation */
+        return SWIG_RuntimeError;
+    }
+    obj = PyUnicode_AsUTF8String(obj);
+    PyBytes_AsStringAndSize(obj, &cstr, &len);
+    if(alloc) *alloc = SWIG_NEWOBJ;
+#else
+    PyString_AsStringAndSize(obj, &cstr, &len);
+#endif
+    if (cptr) {
+      if (alloc) {
+	/* 
+	   In python the user should not be able to modify the inner
+	   string representation. To warranty that, if you define
+	   SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string
+	   buffer is always returned.
+
+	   The default behavior is just to return the pointer value,
+	   so, be careful.
+	*/ 
+#if defined(SWIG_PYTHON_SAFE_CSTRINGS)
+	if (*alloc != SWIG_OLDOBJ) 
+#else
+	if (*alloc == SWIG_NEWOBJ) 
+#endif
+	  {
+	    *cptr = reinterpret_cast< char* >(memcpy((new char[len + 1]), cstr, sizeof(char)*(len + 1)));
+	    *alloc = SWIG_NEWOBJ;
+	  }
+	else {
+	  *cptr = cstr;
+	  *alloc = SWIG_OLDOBJ;
+	}
+      } else {
+        #if PY_VERSION_HEX>=0x03000000
+        assert(0); /* Should never reach here in Python 3 */
+        #endif
+	*cptr = SWIG_Python_str_AsChar(obj);
+      }
+    }
+    if (psize) *psize = len + 1;
+#if PY_VERSION_HEX>=0x03000000
+    Py_XDECREF(obj);
+#endif
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      void* vptr = 0;
+      if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
+	if (cptr) *cptr = (char *) vptr;
+	if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
+	if (alloc) *alloc = SWIG_OLDOBJ;
+	return SWIG_OK;
+      }
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsPtr_std_string (PyObject * obj, std::string **val) 
+{
+  char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
+  if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
+    if (buf) {
+      if (val) *val = new std::string(buf, size - 1);
+      if (alloc == SWIG_NEWOBJ) delete[] buf;
+      return SWIG_NEWOBJ;
+    } else {
+      if (val) *val = 0;
+      return SWIG_OLDOBJ;
+    }
+  } else {
+    static int init = 0;
+    static swig_type_info* descriptor = 0;
+    if (!init) {
+      descriptor = SWIG_TypeQuery("std::string" " *");
+      init = 1;
+    }
+    if (descriptor) {
+      std::string *vptr;
+      int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
+      if (SWIG_IsOK(res) && val) *val = vptr;
+      return res;
+    }
+  }
+  return SWIG_ERROR;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_std_string (PyObject * obj, std::string *val)
+{
+  std::string* v = (std::string *) 0;
+  int res = SWIG_AsPtr_std_string (obj, &v);
+  if (!SWIG_IsOK(res)) return res;
+  if (v) {
+    if (val) *val = *v;
+    if (SWIG_IsNewObj(res)) {
+      delete v;
+      res = SWIG_DelNewMask(res);
+    }
+    return res;
+  }
+  return SWIG_ERROR;
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+  if (carray) {
+    if (size > INT_MAX) {
+      swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+      return pchar_descriptor ? 
+	SWIG_InternalNewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : SWIG_Py_Void();
+    } else {
+#if PY_VERSION_HEX >= 0x03000000
+      return PyUnicode_FromStringAndSize(carray, static_cast< int >(size));
+#else
+      return PyString_FromStringAndSize(carray, static_cast< int >(size));
+#endif
+    }
+  } else {
+    return SWIG_Py_Void();
+  }
+}
+
+
+SWIGINTERNINLINE PyObject *
+SWIG_From_std_string  (const std::string& s)
+{
+  return SWIG_FromCharPtrAndSize(s.data(), s.size());
+}
+
+
+namespace swig {
+  template <> struct traits<std::string > {
+    typedef value_category category;
+    static const char* type_name() { return"std::string"; }
+  };  
+  template <>  struct traits_asval<std::string > {   
+    typedef std::string value_type;
+    static int asval(PyObject *obj, value_type *val) { 
+      return SWIG_AsVal_std_string (obj, val);
+    }
+  };
+  template <>  struct traits_from<std::string > {
+    typedef std::string value_type;
+    static PyObject *from(const value_type& val) {
+      return SWIG_From_std_string  (val);
+    }
+  };
+}
+
+
+      namespace swig {
+	template <>  struct traits<std::vector<std::string, std::allocator< std::string > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::vector<" "std::string" "," "std::allocator< std::string >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN swig::SwigPyIterator *std_vector_Sl_std_string_Sg__iterator(std::vector< std::string > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN bool std_vector_Sl_std_string_Sg____nonzero__(std::vector< std::string > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN bool std_vector_Sl_std_string_Sg____bool__(std::vector< std::string > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN std::vector< std::string >::size_type std_vector_Sl_std_string_Sg____len__(std::vector< std::string > const *self){
+      return self->size();
+    }
+SWIGINTERN std::vector< std::string >::value_type std_vector_Sl_std_string_Sg__pop(std::vector< std::string > *self){
+      if (self->size() == 0)
+	throw std::out_of_range("pop from empty container");
+      std::vector<std::string,std::allocator< std::string > >::value_type x = self->back();
+      self->pop_back();
+      return x;
+    }
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg____getslice__(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j){
+      return swig::getslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_std_string_Sg____setslice____SWIG_0(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j,std::vector< std::string,std::allocator< std::string > > const &v=std::vector< std::string,std::allocator< std::string > >()){
+      swig::setslice(self, i, j, v);
+    }
+SWIGINTERN void std_vector_Sl_std_string_Sg____delslice__(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j){
+      swig::delslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_std_string_Sg____delitem____SWIG_0(std::vector< std::string > *self,std::vector< std::string >::difference_type i){
+      self->erase(swig::getpos(self,i));
+    }
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg____getitem____SWIG_0(std::vector< std::string > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return NULL;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      return swig::getslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_std_string_Sg____setitem____SWIG_0(std::vector< std::string > *self,PySliceObject *slice,std::vector< std::string,std::allocator< std::string > > const &v){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::setslice(self, i, j, v);
+    }
+SWIGINTERN void std_vector_Sl_std_string_Sg____setitem____SWIG_1(std::vector< std::string > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::delslice(self, i,j);
+    }
+SWIGINTERN void std_vector_Sl_std_string_Sg____delitem____SWIG_1(std::vector< std::string > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::delslice(self, i,j);
+    }
+SWIGINTERN std::vector< std::string >::value_type const &std_vector_Sl_std_string_Sg____getitem____SWIG_1(std::vector< std::string > const *self,std::vector< std::string >::difference_type i){
+      return *(swig::cgetpos(self, i));
+    }
+SWIGINTERN void std_vector_Sl_std_string_Sg____setitem____SWIG_2(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::value_type const &x){
+      *(swig::getpos(self,i)) = x;
+    }
+SWIGINTERN void std_vector_Sl_std_string_Sg__append(std::vector< std::string > *self,std::vector< std::string >::value_type const &x){
+      self->push_back(x);
+    }
+
+  namespace swig {
+    template <>  struct traits<CdiVariable > {
+      typedef pointer_category category;
+      static const char* type_name() { return"CdiVariable"; }
+    };
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::vector<CdiVariable, std::allocator< CdiVariable > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::vector<" "CdiVariable" "," "std::allocator< CdiVariable >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN swig::SwigPyIterator *std_vector_Sl_CdiVariable_Sg__iterator(std::vector< CdiVariable > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN bool std_vector_Sl_CdiVariable_Sg____nonzero__(std::vector< CdiVariable > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN bool std_vector_Sl_CdiVariable_Sg____bool__(std::vector< CdiVariable > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN std::vector< CdiVariable >::size_type std_vector_Sl_CdiVariable_Sg____len__(std::vector< CdiVariable > const *self){
+      return self->size();
+    }
+SWIGINTERN std::vector< CdiVariable >::value_type std_vector_Sl_CdiVariable_Sg__pop(std::vector< CdiVariable > *self){
+      if (self->size() == 0)
+	throw std::out_of_range("pop from empty container");
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type x = self->back();
+      self->pop_back();
+      return x;
+    }
+SWIGINTERN std::vector< CdiVariable,std::allocator< CdiVariable > > *std_vector_Sl_CdiVariable_Sg____getslice__(std::vector< CdiVariable > *self,std::vector< CdiVariable >::difference_type i,std::vector< CdiVariable >::difference_type j){
+      return swig::getslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_CdiVariable_Sg____setslice____SWIG_0(std::vector< CdiVariable > *self,std::vector< CdiVariable >::difference_type i,std::vector< CdiVariable >::difference_type j,std::vector< CdiVariable,std::allocator< CdiVariable > > const &v=std::vector< CdiVariable,std::allocator< CdiVariable > >()){
+      swig::setslice(self, i, j, v);
+    }
+SWIGINTERN void std_vector_Sl_CdiVariable_Sg____delslice__(std::vector< CdiVariable > *self,std::vector< CdiVariable >::difference_type i,std::vector< CdiVariable >::difference_type j){
+      swig::delslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_CdiVariable_Sg____delitem____SWIG_0(std::vector< CdiVariable > *self,std::vector< CdiVariable >::difference_type i){
+      self->erase(swig::getpos(self,i));
+    }
+SWIGINTERN std::vector< CdiVariable,std::allocator< CdiVariable > > *std_vector_Sl_CdiVariable_Sg____getitem____SWIG_0(std::vector< CdiVariable > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return NULL;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      return swig::getslice(self, i, j);
+    }
+SWIGINTERN void std_vector_Sl_CdiVariable_Sg____setitem____SWIG_0(std::vector< CdiVariable > *self,PySliceObject *slice,std::vector< CdiVariable,std::allocator< CdiVariable > > const &v){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::setslice(self, i, j, v);
+    }
+SWIGINTERN void std_vector_Sl_CdiVariable_Sg____setitem____SWIG_1(std::vector< CdiVariable > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::delslice(self, i,j);
+    }
+SWIGINTERN void std_vector_Sl_CdiVariable_Sg____delitem____SWIG_1(std::vector< CdiVariable > *self,PySliceObject *slice){
+      Py_ssize_t i, j, step;
+      if( !PySlice_Check(slice) ) {
+        SWIG_Error(SWIG_TypeError, "Slice object expected.");
+        return;
+      }
+      PySlice_GetIndices(SWIGPY_SLICE_ARG(slice), self->size(), &i, &j, &step);
+      swig::delslice(self, i,j);
+    }
+SWIGINTERN std::vector< CdiVariable >::value_type const &std_vector_Sl_CdiVariable_Sg____getitem____SWIG_1(std::vector< CdiVariable > const *self,std::vector< CdiVariable >::difference_type i){
+      return *(swig::cgetpos(self, i));
+    }
+SWIGINTERN void std_vector_Sl_CdiVariable_Sg____setitem____SWIG_2(std::vector< CdiVariable > *self,std::vector< CdiVariable >::difference_type i,std::vector< CdiVariable >::value_type const &x){
+      *(swig::getpos(self,i)) = x;
+    }
+SWIGINTERN void std_vector_Sl_CdiVariable_Sg__append(std::vector< CdiVariable > *self,std::vector< CdiVariable >::value_type const &x){
+      self->push_back(x);
+    }
+
+  namespace swig {
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    template <class T, class U >
+    struct traits_asptr<std::pair<T,U> >  {
+      typedef std::pair<T,U> value_type;
+
+      static int get_pair(PyObject* first, PyObject* second,
+			  std::pair<T,U> **val) 
+      {
+	if (val) {
+	  value_type *vp = (new std::pair<T,U>);
+	  T *pfirst = &(vp->first);
+	  int res1 = swig::asval((PyObject*)first, pfirst);
+	  if (!SWIG_IsOK(res1)) return res1;
+	  U *psecond = &(vp->second);
+	  int res2 = swig::asval((PyObject*)second, psecond);
+	  if (!SWIG_IsOK(res2)) return res2;
+	  *val = vp;
+	  return SWIG_AddNewMask(res1 > res2 ? res1 : res2);
+	} else {
+	  T *pfirst = 0;
+	  int res1 = swig::asval((PyObject*)first, pfirst);
+	  if (!SWIG_IsOK(res1)) return res1;
+	  U *psecond = 0;
+	  int res2 = swig::asval((PyObject*)second, psecond);
+	  if (!SWIG_IsOK(res2)) return res2;
+	  return res1 > res2 ? res1 : res2;
+	}	
+      }
+
+      static int asptr(PyObject *obj, std::pair<T,U> **val) {
+	int res = SWIG_ERROR;
+	if (PyTuple_Check(obj)) {
+	  if (PyTuple_GET_SIZE(obj) == 2) {
+	    res = get_pair(PyTuple_GET_ITEM(obj,0),PyTuple_GET_ITEM(obj,1), val);
+	  }
+	} else if (PySequence_Check(obj)) {
+	  if (PySequence_Size(obj) == 2) {
+	    swig::SwigVar_PyObject first = PySequence_GetItem(obj,0);
+	    swig::SwigVar_PyObject second = PySequence_GetItem(obj,1);
+	    res = get_pair(first, second, val);
+	  }
+	} else {
+	  value_type *p;
+	  res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info<value_type>(),0);
+	  if (SWIG_IsOK(res) && val)  *val = p;
+	}
+	return res;
+      }
+    };
+
+
+    template <class T, class U >
+    struct traits_from<std::pair<T,U> >   {
+      static PyObject *from(const std::pair<T,U>& val) {
+	PyObject* obj = PyTuple_New(2);
+	PyTuple_SetItem(obj,0,swig::from(val.first));
+	PyTuple_SetItem(obj,1,swig::from(val.second));
+	return obj;
+      }
+    };
+  }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+      namespace swig {
+	template <>  struct traits<std::pair< std::string, CdiVariable > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::pair<" "std::string" "," "CdiVariable" " >";
+	  }
+	};
+      }
+    
+
+  namespace swig {
+    template <class SwigPySeq, class K, class T >
+    inline void
+    assign(const SwigPySeq& swigpyseq, std::map<K,T > *map) {
+      typedef typename std::map<K,T>::value_type value_type;
+      typename SwigPySeq::const_iterator it = swigpyseq.begin();
+      for (;it != swigpyseq.end(); ++it) {
+	map->insert(value_type(it->first, it->second));
+      }
+    }
+
+    template <class K, class T>
+    struct traits_asptr<std::map<K,T> >  {
+      typedef std::map<K,T> map_type;
+      static int asptr(PyObject *obj, map_type **val) {
+	int res = SWIG_ERROR;
+	SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+	if (PyDict_Check(obj)) {
+	  SwigVar_PyObject items = PyObject_CallMethod(obj,(char *)"items",NULL);
+#if PY_VERSION_HEX >= 0x03000000
+          /* In Python 3.x the ".items()" method returns a dict_items object */
+          items = PySequence_Fast(items, ".items() didn't return a sequence!");
+#endif
+	  res = traits_asptr_stdseq<std::map<K,T>, std::pair<K, T> >::asptr(items, val);
+	} else {
+	  map_type *p;
+	  res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info<map_type>(),0);
+	  if (SWIG_IsOK(res) && val)  *val = p;
+	}
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return res;
+      }      
+    };
+      
+    template <class K, class T >
+    struct traits_from<std::map<K,T> >  {
+      typedef std::map<K,T> map_type;
+      typedef typename map_type::const_iterator const_iterator;
+      typedef typename map_type::size_type size_type;
+
+      static PyObject *asdict(const map_type& map) {
+	SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+	size_type size = map.size();
+	int pysize = (size <= (size_type) INT_MAX) ? (int) size : -1;
+	if (pysize < 0) {
+	  PyErr_SetString(PyExc_OverflowError,
+			  "map size not valid in python");
+	  SWIG_PYTHON_THREAD_END_BLOCK;
+	  return NULL;
+	}
+	PyObject *obj = PyDict_New();
+	for (const_iterator i= map.begin(); i!= map.end(); ++i) {
+	  swig::SwigVar_PyObject key = swig::from(i->first);
+	  swig::SwigVar_PyObject val = swig::from(i->second);
+	  PyDict_SetItem(obj, key, val);
+	}
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return obj;
+      }
+                
+      static PyObject *from(const map_type& map) {
+	swig_type_info *desc = swig::type_info<map_type>();
+	if (desc && desc->clientdata) {
+	  return SWIG_InternalNewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN);
+	} else {
+	  return asdict(map);
+	}
+      }
+    };
+
+    template <class ValueType>
+    struct from_key_oper 
+    {
+      typedef const ValueType& argument_type;
+      typedef  PyObject *result_type;
+      result_type operator()(argument_type v) const
+      {
+	return swig::from(v.first);
+      }
+    };
+
+    template <class ValueType>
+    struct from_value_oper 
+    {
+      typedef const ValueType& argument_type;
+      typedef  PyObject *result_type;
+      result_type operator()(argument_type v) const
+      {
+	return swig::from(v.second);
+      }
+    };
+
+    template<class OutIterator, class FromOper, class ValueType = typename OutIterator::value_type>
+    struct SwigPyMapIterator_T : SwigPyIteratorClosed_T<OutIterator, ValueType, FromOper>
+    {
+      SwigPyMapIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq)
+	: SwigPyIteratorClosed_T<OutIterator,ValueType,FromOper>(curr, first, last, seq)
+      {
+      }
+    };
+
+
+    template<class OutIterator,
+	     class FromOper = from_key_oper<typename OutIterator::value_type> >
+    struct SwigPyMapKeyIterator_T : SwigPyMapIterator_T<OutIterator, FromOper>
+    {
+      SwigPyMapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq)
+	: SwigPyMapIterator_T<OutIterator, FromOper>(curr, first, last, seq)
+      {
+      }
+    };
+
+    template<typename OutIter>
+    inline SwigPyIterator*
+    make_output_key_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0)
+    {
+      return new SwigPyMapKeyIterator_T<OutIter>(current, begin, end, seq);
+    }
+
+    template<class OutIterator,
+	     class FromOper = from_value_oper<typename OutIterator::value_type> >
+    struct SwigPyMapValueITerator_T : SwigPyMapIterator_T<OutIterator, FromOper>
+    {
+      SwigPyMapValueITerator_T(OutIterator curr, OutIterator first, OutIterator last, PyObject *seq)
+	: SwigPyMapIterator_T<OutIterator, FromOper>(curr, first, last, seq)
+      {
+      }
+    };
+    
+
+    template<typename OutIter>
+    inline SwigPyIterator*
+    make_output_value_iterator(const OutIter& current, const OutIter& begin, const OutIter& end, PyObject *seq = 0)
+    {
+      return new SwigPyMapValueITerator_T<OutIter>(current, begin, end, seq);
+    }
+
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::map<std::string, CdiVariable, std::less< std::string >, std::allocator< std::pair< std::string const,CdiVariable > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::map<" "std::string" "," "CdiVariable" "," "std::less< std::string >" "," "std::allocator< std::pair< std::string const,CdiVariable > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_std_string_Sc_CdiVariable_Sg__iterator(std::map< std::string,CdiVariable > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN bool std_map_Sl_std_string_Sc_CdiVariable_Sg____nonzero__(std::map< std::string,CdiVariable > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN bool std_map_Sl_std_string_Sc_CdiVariable_Sg____bool__(std::map< std::string,CdiVariable > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN std::map< std::string,CdiVariable >::size_type std_map_Sl_std_string_Sc_CdiVariable_Sg____len__(std::map< std::string,CdiVariable > const *self){
+      return self->size();
+    }
+SWIGINTERN std::map< std::string,CdiVariable >::mapped_type const &std_map_Sl_std_string_Sc_CdiVariable_Sg____getitem__(std::map< std::string,CdiVariable > *self,std::map< std::string,CdiVariable >::key_type const &key){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->find(key);
+      if (i != self->end())
+	return i->second;
+      else
+	throw std::out_of_range("key not found");
+    }
+SWIGINTERN void std_map_Sl_std_string_Sc_CdiVariable_Sg____delitem__(std::map< std::string,CdiVariable > *self,std::map< std::string,CdiVariable >::key_type const &key){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator i = self->find(key);
+      if (i != self->end())
+	self->erase(i);
+      else
+	throw std::out_of_range("key not found");
+    }
+SWIGINTERN bool std_map_Sl_std_string_Sc_CdiVariable_Sg__has_key(std::map< std::string,CdiVariable > const *self,std::map< std::string,CdiVariable >::key_type const &key){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->find(key);
+      return i != self->end();
+    }
+SWIGINTERN PyObject *std_map_Sl_std_string_Sc_CdiVariable_Sg__keys(std::map< std::string,CdiVariable > *self){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }
+      PyObject* keyList = PyList_New(pysize);
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(keyList, j, swig::from(i->first));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return keyList;
+    }
+SWIGINTERN PyObject *std_map_Sl_std_string_Sc_CdiVariable_Sg__values(std::map< std::string,CdiVariable > *self){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }
+      PyObject* valList = PyList_New(pysize);
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(valList, j, swig::from(i->second));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return valList;
+    }
+SWIGINTERN PyObject *std_map_Sl_std_string_Sc_CdiVariable_Sg__items(std::map< std::string,CdiVariable > *self){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }    
+      PyObject* itemList = PyList_New(pysize);
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(itemList, j, swig::from(*i));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return itemList;
+    }
+SWIGINTERN bool std_map_Sl_std_string_Sc_CdiVariable_Sg____contains__(std::map< std::string,CdiVariable > *self,std::map< std::string,CdiVariable >::key_type const &key){
+      return self->find(key) != self->end();
+    }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_std_string_Sc_CdiVariable_Sg__key_iterator(std::map< std::string,CdiVariable > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_std_string_Sc_CdiVariable_Sg__value_iterator(std::map< std::string,CdiVariable > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN void std_map_Sl_std_string_Sc_CdiVariable_Sg____setitem____SWIG_0(std::map< std::string,CdiVariable > *self,std::map< std::string,CdiVariable >::key_type const &key){
+      self->erase(key);
+    }
+SWIGINTERN void std_map_Sl_std_string_Sc_CdiVariable_Sg____setitem____SWIG_1(std::map< std::string,CdiVariable > *self,std::map< std::string,CdiVariable >::key_type const &key,std::map< std::string,CdiVariable >::mapped_type const &x){
+      (*self)[key] = x;
+    }
+SWIGINTERN PyObject *std_map_Sl_std_string_Sc_CdiVariable_Sg__asdict(std::map< std::string,CdiVariable > *self){
+      return swig::traits_from< std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > >::asdict(*self);
+    }
+
+      namespace swig {
+	template <>  struct traits<std::pair< int, CdiVariable > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::pair<" "int" "," "CdiVariable" " >";
+	  }
+	};
+      }
+    
+
+      namespace swig {
+	template <>  struct traits<std::map<int, CdiVariable, std::less< int >, std::allocator< std::pair< int const,CdiVariable > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::map<" "int" "," "CdiVariable" "," "std::less< int >" "," "std::allocator< std::pair< int const,CdiVariable > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiVariable_Sg__iterator(std::map< int,CdiVariable > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiVariable_Sg____nonzero__(std::map< int,CdiVariable > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiVariable_Sg____bool__(std::map< int,CdiVariable > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN std::map< int,CdiVariable >::size_type std_map_Sl_int_Sc_CdiVariable_Sg____len__(std::map< int,CdiVariable > const *self){
+      return self->size();
+    }
+SWIGINTERN std::map< int,CdiVariable >::mapped_type const &std_map_Sl_int_Sc_CdiVariable_Sg____getitem__(std::map< int,CdiVariable > *self,std::map< int,CdiVariable >::key_type const &key){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->find(key);
+      if (i != self->end())
+	return i->second;
+      else
+	throw std::out_of_range("key not found");
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiVariable_Sg____delitem__(std::map< int,CdiVariable > *self,std::map< int,CdiVariable >::key_type const &key){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator i = self->find(key);
+      if (i != self->end())
+	self->erase(i);
+      else
+	throw std::out_of_range("key not found");
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiVariable_Sg__has_key(std::map< int,CdiVariable > const *self,std::map< int,CdiVariable >::key_type const &key){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->find(key);
+      return i != self->end();
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiVariable_Sg__keys(std::map< int,CdiVariable > *self){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }
+      PyObject* keyList = PyList_New(pysize);
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(keyList, j, swig::from(i->first));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return keyList;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiVariable_Sg__values(std::map< int,CdiVariable > *self){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }
+      PyObject* valList = PyList_New(pysize);
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(valList, j, swig::from(i->second));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return valList;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiVariable_Sg__items(std::map< int,CdiVariable > *self){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }    
+      PyObject* itemList = PyList_New(pysize);
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(itemList, j, swig::from(*i));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return itemList;
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiVariable_Sg____contains__(std::map< int,CdiVariable > *self,std::map< int,CdiVariable >::key_type const &key){
+      return self->find(key) != self->end();
+    }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiVariable_Sg__key_iterator(std::map< int,CdiVariable > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiVariable_Sg__value_iterator(std::map< int,CdiVariable > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiVariable_Sg____setitem____SWIG_0(std::map< int,CdiVariable > *self,std::map< int,CdiVariable >::key_type const &key){
+      self->erase(key);
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiVariable_Sg____setitem____SWIG_1(std::map< int,CdiVariable > *self,std::map< int,CdiVariable >::key_type const &key,std::map< int,CdiVariable >::mapped_type const &x){
+      (*self)[key] = x;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiVariable_Sg__asdict(std::map< int,CdiVariable > *self){
+      return swig::traits_from< std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > >::asdict(*self);
+    }
+
+  namespace swig {
+    template <>  struct traits<CdiTaxis > {
+      typedef pointer_category category;
+      static const char* type_name() { return"CdiTaxis"; }
+    };
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::pair< int, CdiTaxis > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::pair<" "int" "," "CdiTaxis" " >";
+	  }
+	};
+      }
+    
+
+      namespace swig {
+	template <>  struct traits<std::map<int, CdiTaxis, std::less< int >, std::allocator< std::pair< int const,CdiTaxis > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::map<" "int" "," "CdiTaxis" "," "std::less< int >" "," "std::allocator< std::pair< int const,CdiTaxis > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiTaxis_Sg__iterator(std::map< int,CdiTaxis > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiTaxis_Sg____nonzero__(std::map< int,CdiTaxis > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiTaxis_Sg____bool__(std::map< int,CdiTaxis > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN std::map< int,CdiTaxis >::size_type std_map_Sl_int_Sc_CdiTaxis_Sg____len__(std::map< int,CdiTaxis > const *self){
+      return self->size();
+    }
+SWIGINTERN std::map< int,CdiTaxis >::mapped_type const &std_map_Sl_int_Sc_CdiTaxis_Sg____getitem__(std::map< int,CdiTaxis > *self,std::map< int,CdiTaxis >::key_type const &key){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->find(key);
+      if (i != self->end())
+	return i->second;
+      else
+	throw std::out_of_range("key not found");
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiTaxis_Sg____delitem__(std::map< int,CdiTaxis > *self,std::map< int,CdiTaxis >::key_type const &key){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator i = self->find(key);
+      if (i != self->end())
+	self->erase(i);
+      else
+	throw std::out_of_range("key not found");
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiTaxis_Sg__has_key(std::map< int,CdiTaxis > const *self,std::map< int,CdiTaxis >::key_type const &key){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->find(key);
+      return i != self->end();
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiTaxis_Sg__keys(std::map< int,CdiTaxis > *self){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }
+      PyObject* keyList = PyList_New(pysize);
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(keyList, j, swig::from(i->first));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return keyList;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiTaxis_Sg__values(std::map< int,CdiTaxis > *self){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }
+      PyObject* valList = PyList_New(pysize);
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(valList, j, swig::from(i->second));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return valList;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiTaxis_Sg__items(std::map< int,CdiTaxis > *self){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }    
+      PyObject* itemList = PyList_New(pysize);
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(itemList, j, swig::from(*i));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return itemList;
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiTaxis_Sg____contains__(std::map< int,CdiTaxis > *self,std::map< int,CdiTaxis >::key_type const &key){
+      return self->find(key) != self->end();
+    }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiTaxis_Sg__key_iterator(std::map< int,CdiTaxis > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiTaxis_Sg__value_iterator(std::map< int,CdiTaxis > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiTaxis_Sg____setitem____SWIG_0(std::map< int,CdiTaxis > *self,std::map< int,CdiTaxis >::key_type const &key){
+      self->erase(key);
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiTaxis_Sg____setitem____SWIG_1(std::map< int,CdiTaxis > *self,std::map< int,CdiTaxis >::key_type const &key,std::map< int,CdiTaxis >::mapped_type const &x){
+      (*self)[key] = x;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiTaxis_Sg__asdict(std::map< int,CdiTaxis > *self){
+      return swig::traits_from< std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > >::asdict(*self);
+    }
+
+  namespace swig {
+    template <>  struct traits<CdiZaxis > {
+      typedef pointer_category category;
+      static const char* type_name() { return"CdiZaxis"; }
+    };
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::pair< int, CdiZaxis > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::pair<" "int" "," "CdiZaxis" " >";
+	  }
+	};
+      }
+    
+
+      namespace swig {
+	template <>  struct traits<std::map<int, CdiZaxis, std::less< int >, std::allocator< std::pair< int const,CdiZaxis > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::map<" "int" "," "CdiZaxis" "," "std::less< int >" "," "std::allocator< std::pair< int const,CdiZaxis > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiZaxis_Sg__iterator(std::map< int,CdiZaxis > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiZaxis_Sg____nonzero__(std::map< int,CdiZaxis > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiZaxis_Sg____bool__(std::map< int,CdiZaxis > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN std::map< int,CdiZaxis >::size_type std_map_Sl_int_Sc_CdiZaxis_Sg____len__(std::map< int,CdiZaxis > const *self){
+      return self->size();
+    }
+SWIGINTERN std::map< int,CdiZaxis >::mapped_type const &std_map_Sl_int_Sc_CdiZaxis_Sg____getitem__(std::map< int,CdiZaxis > *self,std::map< int,CdiZaxis >::key_type const &key){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->find(key);
+      if (i != self->end())
+	return i->second;
+      else
+	throw std::out_of_range("key not found");
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiZaxis_Sg____delitem__(std::map< int,CdiZaxis > *self,std::map< int,CdiZaxis >::key_type const &key){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator i = self->find(key);
+      if (i != self->end())
+	self->erase(i);
+      else
+	throw std::out_of_range("key not found");
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiZaxis_Sg__has_key(std::map< int,CdiZaxis > const *self,std::map< int,CdiZaxis >::key_type const &key){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->find(key);
+      return i != self->end();
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiZaxis_Sg__keys(std::map< int,CdiZaxis > *self){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }
+      PyObject* keyList = PyList_New(pysize);
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(keyList, j, swig::from(i->first));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return keyList;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiZaxis_Sg__values(std::map< int,CdiZaxis > *self){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }
+      PyObject* valList = PyList_New(pysize);
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(valList, j, swig::from(i->second));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return valList;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiZaxis_Sg__items(std::map< int,CdiZaxis > *self){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }    
+      PyObject* itemList = PyList_New(pysize);
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(itemList, j, swig::from(*i));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return itemList;
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiZaxis_Sg____contains__(std::map< int,CdiZaxis > *self,std::map< int,CdiZaxis >::key_type const &key){
+      return self->find(key) != self->end();
+    }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiZaxis_Sg__key_iterator(std::map< int,CdiZaxis > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiZaxis_Sg__value_iterator(std::map< int,CdiZaxis > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiZaxis_Sg____setitem____SWIG_0(std::map< int,CdiZaxis > *self,std::map< int,CdiZaxis >::key_type const &key){
+      self->erase(key);
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiZaxis_Sg____setitem____SWIG_1(std::map< int,CdiZaxis > *self,std::map< int,CdiZaxis >::key_type const &key,std::map< int,CdiZaxis >::mapped_type const &x){
+      (*self)[key] = x;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiZaxis_Sg__asdict(std::map< int,CdiZaxis > *self){
+      return swig::traits_from< std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > >::asdict(*self);
+    }
+
+  namespace swig {
+    template <>  struct traits<CdiGrid > {
+      typedef pointer_category category;
+      static const char* type_name() { return"CdiGrid"; }
+    };
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::pair< int, CdiGrid > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::pair<" "int" "," "CdiGrid" " >";
+	  }
+	};
+      }
+    
+
+      namespace swig {
+	template <>  struct traits<std::map<int, CdiGrid, std::less< int >, std::allocator< std::pair< int const,CdiGrid > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::map<" "int" "," "CdiGrid" "," "std::less< int >" "," "std::allocator< std::pair< int const,CdiGrid > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiGrid_Sg__iterator(std::map< int,CdiGrid > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiGrid_Sg____nonzero__(std::map< int,CdiGrid > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiGrid_Sg____bool__(std::map< int,CdiGrid > const *self){
+      return !(self->empty());
+    }
+SWIGINTERN std::map< int,CdiGrid >::size_type std_map_Sl_int_Sc_CdiGrid_Sg____len__(std::map< int,CdiGrid > const *self){
+      return self->size();
+    }
+SWIGINTERN std::map< int,CdiGrid >::mapped_type const &std_map_Sl_int_Sc_CdiGrid_Sg____getitem__(std::map< int,CdiGrid > *self,std::map< int,CdiGrid >::key_type const &key){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->find(key);
+      if (i != self->end())
+	return i->second;
+      else
+	throw std::out_of_range("key not found");
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiGrid_Sg____delitem__(std::map< int,CdiGrid > *self,std::map< int,CdiGrid >::key_type const &key){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator i = self->find(key);
+      if (i != self->end())
+	self->erase(i);
+      else
+	throw std::out_of_range("key not found");
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiGrid_Sg__has_key(std::map< int,CdiGrid > const *self,std::map< int,CdiGrid >::key_type const &key){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->find(key);
+      return i != self->end();
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiGrid_Sg__keys(std::map< int,CdiGrid > *self){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }
+      PyObject* keyList = PyList_New(pysize);
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(keyList, j, swig::from(i->first));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return keyList;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiGrid_Sg__values(std::map< int,CdiGrid > *self){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }
+      PyObject* valList = PyList_New(pysize);
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(valList, j, swig::from(i->second));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return valList;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiGrid_Sg__items(std::map< int,CdiGrid > *self){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type size = self->size();
+      int pysize = (size <= (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type) INT_MAX) ? (int) size : -1;
+      SWIG_PYTHON_THREAD_BEGIN_BLOCK;
+      if (pysize < 0) {
+	PyErr_SetString(PyExc_OverflowError,
+			"map size not valid in python");
+	SWIG_PYTHON_THREAD_END_BLOCK;
+	return NULL;
+      }    
+      PyObject* itemList = PyList_New(pysize);
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->begin();
+      for (int j = 0; j < pysize; ++i, ++j) {
+	PyList_SET_ITEM(itemList, j, swig::from(*i));
+      }
+      SWIG_PYTHON_THREAD_END_BLOCK;
+      return itemList;
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiGrid_Sg____contains__(std::map< int,CdiGrid > *self,std::map< int,CdiGrid >::key_type const &key){
+      return self->find(key) != self->end();
+    }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiGrid_Sg__key_iterator(std::map< int,CdiGrid > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_key_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN swig::SwigPyIterator *std_map_Sl_int_Sc_CdiGrid_Sg__value_iterator(std::map< int,CdiGrid > *self,PyObject **PYTHON_SELF){
+      return swig::make_output_value_iterator(self->begin(), self->begin(), self->end(), *PYTHON_SELF);
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiGrid_Sg____setitem____SWIG_0(std::map< int,CdiGrid > *self,std::map< int,CdiGrid >::key_type const &key){
+      self->erase(key);
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiGrid_Sg____setitem____SWIG_1(std::map< int,CdiGrid > *self,std::map< int,CdiGrid >::key_type const &key,std::map< int,CdiGrid >::mapped_type const &x){
+      (*self)[key] = x;
+    }
+SWIGINTERN PyObject *std_map_Sl_int_Sc_CdiGrid_Sg__asdict(std::map< int,CdiGrid > *self){
+      return swig::traits_from< std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > >::asdict(*self);
+    }
+
+SWIGINTERN int
+SWIG_AsVal_bool (PyObject *obj, bool *val)
+{
+  int r = PyObject_IsTrue(obj);
+  if (r == -1)
+    return SWIG_ERROR;
+  if (val) *val = r ? true : false;
+  return SWIG_OK;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharArray(PyObject * obj, char *val, size_t size)
+{ 
+  char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
+  int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
+  if (SWIG_IsOK(res)) {
+    if ((csize == size + 1) && cptr && !(cptr[csize-1])) --csize;
+    if (csize <= size) {
+      if (val) {
+	if (csize) memcpy(val, cptr, csize*sizeof(char));
+	if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
+      }
+      if (alloc == SWIG_NEWOBJ) {
+	delete[] cptr;
+	res = SWIG_DelNewMask(res);
+      }      
+      return res;
+    }
+    if (alloc == SWIG_NEWOBJ) delete[] cptr;
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+
+SWIGINTERNINLINE PyObject * 
+SWIG_FromCharPtr(const char *cptr)
+{ 
+  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+}
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+SWIGINTERN PyObject *_wrap_delete_SwigPyIterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_SwigPyIterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_SwigPyIterator" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_value(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_value",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_value" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (PyObject *)((swig::SwigPyIterator const *)arg1)->value();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_incr",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_incr" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *)(arg1)->incr(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_incr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_incr",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_incr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (swig::SwigPyIterator *)(arg1)->incr();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_incr(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_SwigPyIterator_incr__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_SwigPyIterator_incr__SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'SwigPyIterator_incr'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    swig::SwigPyIterator::incr(size_t)\n"
+    "    swig::SwigPyIterator::incr()\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_decr",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_decr" "', argument " "2"" of type '" "size_t""'");
+  } 
+  arg2 = static_cast< size_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *)(arg1)->decr(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_decr__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_decr",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_decr" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (swig::SwigPyIterator *)(arg1)->decr();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_decr(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_SwigPyIterator_decr__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_SwigPyIterator_decr__SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'SwigPyIterator_decr'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    swig::SwigPyIterator::decr(size_t)\n"
+    "    swig::SwigPyIterator::decr()\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_distance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  swig::SwigPyIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  ptrdiff_t result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_distance",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_distance" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_distance" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+  try {
+    result = ((swig::SwigPyIterator const *)arg1)->distance((swig::SwigPyIterator const &)*arg2);
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
+  }
+  
+  resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_equal(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  swig::SwigPyIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_equal",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_equal" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator_equal" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+  try {
+    result = (bool)((swig::SwigPyIterator const *)arg1)->equal((swig::SwigPyIterator const &)*arg2);
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_Python_Raise(SWIG_NewPointerObj((new std::invalid_argument(static_cast< const std::invalid_argument& >(_e))),SWIGTYPE_p_std__invalid_argument,SWIG_POINTER_OWN), "std::invalid_argument", SWIGTYPE_p_std__invalid_argument); SWIG_fail;
+  }
+  
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_copy(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_copy",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_copy" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->copy();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_next(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_next",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_next" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (PyObject *)(arg1)->next();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___next__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator___next__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___next__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (PyObject *)(arg1)->__next__();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_previous(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:SwigPyIterator_previous",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_previous" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  try {
+    result = (PyObject *)(arg1)->previous();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator_advance(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator_advance",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator_advance" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator_advance" "', argument " "2"" of type '" "ptrdiff_t""'");
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *)(arg1)->advance(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___eq__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  swig::SwigPyIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___eq__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___eq__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___eq__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+  result = (bool)((swig::SwigPyIterator const *)arg1)->operator ==((swig::SwigPyIterator const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___ne__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  swig::SwigPyIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___ne__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___ne__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___ne__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+  result = (bool)((swig::SwigPyIterator const *)arg1)->operator !=((swig::SwigPyIterator const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___iadd__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___iadd__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___iadd__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___iadd__" "', argument " "2"" of type '" "ptrdiff_t""'");
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *) &(arg1)->operator +=(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___isub__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___isub__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___isub__" "', argument " "1"" of type '" "swig::SwigPyIterator *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___isub__" "', argument " "2"" of type '" "ptrdiff_t""'");
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *) &(arg1)->operator -=(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___add__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___add__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___add__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___add__" "', argument " "2"" of type '" "ptrdiff_t""'");
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator +(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___sub__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "ptrdiff_t""'");
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::SwigPyIterator *)((swig::SwigPyIterator const *)arg1)->operator -(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_SetErrorObj(PyExc_StopIteration, SWIG_Py_Void());
+      SWIG_fail;
+    }
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___sub____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  swig::SwigPyIterator *arg1 = (swig::SwigPyIterator *) 0 ;
+  swig::SwigPyIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  ptrdiff_t result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:SwigPyIterator___sub__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_swig__SwigPyIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "SwigPyIterator___sub__" "', argument " "1"" of type '" "swig::SwigPyIterator const *""'"); 
+  }
+  arg1 = reinterpret_cast< swig::SwigPyIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_swig__SwigPyIterator,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "SwigPyIterator___sub__" "', argument " "2"" of type '" "swig::SwigPyIterator const &""'"); 
+  }
+  arg2 = reinterpret_cast< swig::SwigPyIterator * >(argp2);
+  result = ((swig::SwigPyIterator const *)arg1)->operator -((swig::SwigPyIterator const &)*arg2);
+  resultobj = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_SwigPyIterator___sub__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_swig__SwigPyIterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_SwigPyIterator___sub____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__SwigPyIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_SwigPyIterator___sub____SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  Py_INCREF(Py_NotImplemented);
+  return Py_NotImplemented;
+}
+
+
+SWIGINTERN PyObject *SwigPyIterator_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_swig__SwigPyIterator, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_IntVector_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_iterator" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (swig::SwigPyIterator *)std_vector_Sl_int_Sg__iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector___nonzero__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___nonzero__" "', argument " "1"" of type '" "std::vector< int > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (bool)std_vector_Sl_int_Sg____nonzero__((std::vector< int > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector___bool__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___bool__" "', argument " "1"" of type '" "std::vector< int > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (bool)std_vector_Sl_int_Sg____bool__((std::vector< int > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector___len__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___len__" "', argument " "1"" of type '" "std::vector< int > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = std_vector_Sl_int_Sg____len__((std::vector< int > const *)arg1);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int >::value_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_pop",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_pop" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  try {
+    result = (std::vector< int >::value_type)std_vector_Sl_int_Sg__pop(arg1);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  std::vector< int >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:IntVector___getslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___getslice__" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector___getslice__" "', argument " "2"" of type '" "std::vector< int >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IntVector___getslice__" "', argument " "3"" of type '" "std::vector< int >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< int >::difference_type >(val3);
+  try {
+    result = (std::vector< int,std::allocator< int > > *)std_vector_Sl_int_Sg____getslice__(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___setslice____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  std::vector< int >::difference_type arg3 ;
+  std::vector< int,std::allocator< int > > *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:IntVector___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___setslice__" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector___setslice__" "', argument " "2"" of type '" "std::vector< int >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IntVector___setslice__" "', argument " "3"" of type '" "std::vector< int >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< int >::difference_type >(val3);
+  {
+    std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
+    res4 = swig::asptr(obj3, &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "IntVector___setslice__" "', argument " "4"" of type '" "std::vector< int,std::allocator< int > > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IntVector___setslice__" "', argument " "4"" of type '" "std::vector< int,std::allocator< int > > const &""'"); 
+    }
+    arg4 = ptr;
+  }
+  try {
+    std_vector_Sl_int_Sg____setslice____SWIG_0(arg1,arg2,arg3,(std::vector< int,std::allocator< int > > const &)*arg4);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___setslice____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  std::vector< int >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:IntVector___setslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___setslice__" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector___setslice__" "', argument " "2"" of type '" "std::vector< int >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IntVector___setslice__" "', argument " "3"" of type '" "std::vector< int >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< int >::difference_type >(val3);
+  try {
+    std_vector_Sl_int_Sg____setslice____SWIG_0(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___setslice__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_IntVector___setslice____SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<int,std::allocator< int > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_IntVector___setslice____SWIG_0(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IntVector___setslice__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< int >::__setslice__(std::vector< int >::difference_type,std::vector< int >::difference_type,std::vector< int,std::allocator< int > > const &)\n"
+    "    std::vector< int >::__setslice__(std::vector< int >::difference_type,std::vector< int >::difference_type)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  std::vector< int >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:IntVector___delslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___delslice__" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector___delslice__" "', argument " "2"" of type '" "std::vector< int >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IntVector___delslice__" "', argument " "3"" of type '" "std::vector< int >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< int >::difference_type >(val3);
+  try {
+    std_vector_Sl_int_Sg____delslice__(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___delitem__" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector___delitem__" "', argument " "2"" of type '" "std::vector< int >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  try {
+    std_vector_Sl_int_Sg____delitem____SWIG_0(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___getitem__" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector___getitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    result = (std::vector< int,std::allocator< int > > *)std_vector_Sl_int_Sg____getitem____SWIG_0(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  std::vector< int,std::allocator< int > > *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:IntVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___setitem__" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  {
+    std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
+    res3 = swig::asptr(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "IntVector___setitem__" "', argument " "3"" of type '" "std::vector< int,std::allocator< int > > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IntVector___setitem__" "', argument " "3"" of type '" "std::vector< int,std::allocator< int > > const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  try {
+    std_vector_Sl_int_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< int,std::allocator< int > > const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector___setitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___setitem__" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    std_vector_Sl_int_Sg____setitem____SWIG_1(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___delitem__" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector___delitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    std_vector_Sl_int_Sg____delitem____SWIG_1(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___delitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_IntVector___delitem____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_IntVector___delitem____SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IntVector___delitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< int >::__delitem__(std::vector< int >::difference_type)\n"
+    "    std::vector< int >::__delitem__(PySliceObject *)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< int >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___getitem__" "', argument " "1"" of type '" "std::vector< int > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector___getitem__" "', argument " "2"" of type '" "std::vector< int >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  try {
+    result = (std::vector< int >::value_type *) &std_vector_Sl_int_Sg____getitem____SWIG_1((std::vector< int > const *)arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_From_int(static_cast< int >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___getitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_IntVector___getitem____SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_IntVector___getitem____SWIG_1(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IntVector___getitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< int >::__getitem__(PySliceObject *)\n"
+    "    std::vector< int >::__getitem__(std::vector< int >::difference_type) const\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___setitem____SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  std::vector< int >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< int >::value_type temp3 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:IntVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector___setitem__" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector___setitem__" "', argument " "2"" of type '" "std::vector< int >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IntVector___setitem__" "', argument " "3"" of type '" "std::vector< int >::value_type""'");
+  } 
+  temp3 = static_cast< std::vector< int >::value_type >(val3);
+  arg3 = &temp3;
+  try {
+    std_vector_Sl_int_Sg____setitem____SWIG_2(arg1,arg2,(int const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector___setitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_IntVector___setitem____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        int res = swig::asptr(argv[2], (std::vector<int,std::allocator< int > >**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_IntVector___setitem____SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_IntVector___setitem____SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IntVector___setitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< int >::__setitem__(PySliceObject *,std::vector< int,std::allocator< int > > const &)\n"
+    "    std::vector< int >::__setitem__(PySliceObject *)\n"
+    "    std::vector< int >::__setitem__(std::vector< int >::difference_type,std::vector< int >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::value_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_append",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_append" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_append" "', argument " "2"" of type '" "std::vector< int >::value_type""'");
+  } 
+  temp2 = static_cast< std::vector< int >::value_type >(val2);
+  arg2 = &temp2;
+  std_vector_Sl_int_Sg__append(arg1,(int const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_IntVector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_IntVector")) SWIG_fail;
+  result = (std::vector< int > *)new std::vector< int >();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_IntVector__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  std::vector< int > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_IntVector",&obj0)) SWIG_fail;
+  {
+    std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
+    res1 = swig::asptr(obj0, &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_IntVector" "', argument " "1"" of type '" "std::vector< int > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_IntVector" "', argument " "1"" of type '" "std::vector< int > const &""'"); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::vector< int > *)new std::vector< int >((std::vector< int > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_empty",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_empty" "', argument " "1"" of type '" "std::vector< int > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (bool)((std::vector< int > const *)arg1)->empty();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_size",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_size" "', argument " "1"" of type '" "std::vector< int > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = ((std::vector< int > const *)arg1)->size();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_clear" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  (arg1)->clear();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_swap",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_swap" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "IntVector_swap" "', argument " "2"" of type '" "std::vector< int > &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "IntVector_swap" "', argument " "2"" of type '" "std::vector< int > &""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< int > * >(argp2);
+  (arg1)->swap(*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::allocator< int > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_get_allocator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_get_allocator" "', argument " "1"" of type '" "std::vector< int > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = ((std::vector< int > const *)arg1)->get_allocator();
+  resultobj = SWIG_NewPointerObj((new std::vector< int >::allocator_type(static_cast< const std::vector< int >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_int_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_begin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_begin" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (arg1)->begin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_end",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_end" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (arg1)->end();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_rbegin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_rbegin" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (arg1)->rbegin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_rend",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_rend" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (arg1)->rend();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_IntVector__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int >::size_type arg1 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_IntVector",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IntVector" "', argument " "1"" of type '" "std::vector< int >::size_type""'");
+  } 
+  arg1 = static_cast< std::vector< int >::size_type >(val1);
+  result = (std::vector< int > *)new std::vector< int >(arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_pop_back",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_pop_back" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  (arg1)->pop_back();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_resize",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_resize" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_resize" "', argument " "2"" of type '" "std::vector< int >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< int >::size_type >(val2);
+  (arg1)->resize(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< int >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_erase" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_erase" "', argument " "2"" of type '" "std::vector< int >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< int >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< int >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_erase" "', argument " "2"" of type '" "std::vector< int >::iterator""'");
+    }
+  }
+  result = (arg1)->erase(arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::iterator arg2 ;
+  std::vector< int >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  swig::SwigPyIterator *iter3 = 0 ;
+  int res3 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< int >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:IntVector_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_erase" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_erase" "', argument " "2"" of type '" "std::vector< int >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< int >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< int >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_erase" "', argument " "2"" of type '" "std::vector< int >::iterator""'");
+    }
+  }
+  res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_erase" "', argument " "3"" of type '" "std::vector< int >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< int >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< int >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_erase" "', argument " "3"" of type '" "std::vector< int >::iterator""'");
+    }
+  }
+  result = (arg1)->erase(arg2,arg3);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_erase(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< int >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_IntVector_erase__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< int >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::SwigPyIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< int >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_IntVector_erase__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IntVector_erase'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< int >::erase(std::vector< int >::iterator)\n"
+    "    std::vector< int >::erase(std::vector< int >::iterator,std::vector< int >::iterator)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_IntVector__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int >::size_type arg1 ;
+  std::vector< int >::value_type *arg2 = 0 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  std::vector< int >::value_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< int > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:new_IntVector",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_IntVector" "', argument " "1"" of type '" "std::vector< int >::size_type""'");
+  } 
+  arg1 = static_cast< std::vector< int >::size_type >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_IntVector" "', argument " "2"" of type '" "std::vector< int >::value_type""'");
+  } 
+  temp2 = static_cast< std::vector< int >::value_type >(val2);
+  arg2 = &temp2;
+  result = (std::vector< int > *)new std::vector< int >(arg1,(std::vector< int >::value_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_IntVector(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_IntVector__SWIG_0(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_IntVector__SWIG_2(self, args);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_IntVector__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_new_IntVector__SWIG_3(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_IntVector'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< int >::vector()\n"
+    "    std::vector< int >::vector(std::vector< int > const &)\n"
+    "    std::vector< int >::vector(std::vector< int >::size_type)\n"
+    "    std::vector< int >::vector(std::vector< int >::size_type,std::vector< int >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::value_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_push_back",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_push_back" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_push_back" "', argument " "2"" of type '" "std::vector< int >::value_type""'");
+  } 
+  temp2 = static_cast< std::vector< int >::value_type >(val2);
+  arg2 = &temp2;
+  (arg1)->push_back((std::vector< int >::value_type const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_front",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_front" "', argument " "1"" of type '" "std::vector< int > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (std::vector< int >::value_type *) &((std::vector< int > const *)arg1)->front();
+  resultobj = SWIG_From_int(static_cast< int >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_back",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_back" "', argument " "1"" of type '" "std::vector< int > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (std::vector< int >::value_type *) &((std::vector< int > const *)arg1)->back();
+  resultobj = SWIG_From_int(static_cast< int >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::size_type arg2 ;
+  std::vector< int >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< int >::value_type temp3 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:IntVector_assign",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_assign" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_assign" "', argument " "2"" of type '" "std::vector< int >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< int >::size_type >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IntVector_assign" "', argument " "3"" of type '" "std::vector< int >::value_type""'");
+  } 
+  temp3 = static_cast< std::vector< int >::value_type >(val3);
+  arg3 = &temp3;
+  (arg1)->assign(arg2,(std::vector< int >::value_type const &)*arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::size_type arg2 ;
+  std::vector< int >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< int >::value_type temp3 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:IntVector_resize",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_resize" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_resize" "', argument " "2"" of type '" "std::vector< int >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< int >::size_type >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IntVector_resize" "', argument " "3"" of type '" "std::vector< int >::value_type""'");
+  } 
+  temp3 = static_cast< std::vector< int >::value_type >(val3);
+  arg3 = &temp3;
+  (arg1)->resize(arg2,(std::vector< int >::value_type const &)*arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_resize(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_IntVector_resize__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_IntVector_resize__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IntVector_resize'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< int >::resize(std::vector< int >::size_type)\n"
+    "    std::vector< int >::resize(std::vector< int >::size_type,std::vector< int >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::iterator arg2 ;
+  std::vector< int >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  std::vector< int >::value_type temp3 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< int >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:IntVector_insert",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_insert" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_insert" "', argument " "2"" of type '" "std::vector< int >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< int >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< int >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_insert" "', argument " "2"" of type '" "std::vector< int >::iterator""'");
+    }
+  }
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IntVector_insert" "', argument " "3"" of type '" "std::vector< int >::value_type""'");
+  } 
+  temp3 = static_cast< std::vector< int >::value_type >(val3);
+  arg3 = &temp3;
+  result = (arg1)->insert(arg2,(std::vector< int >::value_type const &)*arg3);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< int >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::iterator arg2 ;
+  std::vector< int >::size_type arg3 ;
+  std::vector< int >::value_type *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  std::vector< int >::value_type temp4 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:IntVector_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_insert" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_insert" "', argument " "2"" of type '" "std::vector< int >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< int >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< int >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "IntVector_insert" "', argument " "2"" of type '" "std::vector< int >::iterator""'");
+    }
+  }
+  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "IntVector_insert" "', argument " "3"" of type '" "std::vector< int >::size_type""'");
+  } 
+  arg3 = static_cast< std::vector< int >::size_type >(val3);
+  ecode4 = SWIG_AsVal_int(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "IntVector_insert" "', argument " "4"" of type '" "std::vector< int >::value_type""'");
+  } 
+  temp4 = static_cast< std::vector< int >::value_type >(val4);
+  arg4 = &temp4;
+  (arg1)->insert(arg2,arg3,(std::vector< int >::value_type const &)*arg4);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_insert(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< int >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_IntVector_insert__SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< int >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_size_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            int res = SWIG_AsVal_int(argv[3], NULL);
+            _v = SWIG_CheckState(res);
+          }
+          if (_v) {
+            return _wrap_IntVector_insert__SWIG_1(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'IntVector_insert'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< int >::insert(std::vector< int >::iterator,std::vector< int >::value_type const &)\n"
+    "    std::vector< int >::insert(std::vector< int >::iterator,std::vector< int >::size_type,std::vector< int >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:IntVector_reserve",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_reserve" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "IntVector_reserve" "', argument " "2"" of type '" "std::vector< int >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< int >::size_type >(val2);
+  (arg1)->reserve(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_IntVector_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:IntVector_capacity",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "IntVector_capacity" "', argument " "1"" of type '" "std::vector< int > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = ((std::vector< int > const *)arg1)->capacity();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_IntVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_IntVector",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_IntVector" "', argument " "1"" of type '" "std::vector< int > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *IntVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_DoubleVector_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_iterator" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (swig::SwigPyIterator *)std_vector_Sl_double_Sg__iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector___nonzero__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___nonzero__" "', argument " "1"" of type '" "std::vector< double > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (bool)std_vector_Sl_double_Sg____nonzero__((std::vector< double > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector___bool__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___bool__" "', argument " "1"" of type '" "std::vector< double > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (bool)std_vector_Sl_double_Sg____bool__((std::vector< double > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector___len__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___len__" "', argument " "1"" of type '" "std::vector< double > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = std_vector_Sl_double_Sg____len__((std::vector< double > const *)arg1);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double >::value_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_pop",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_pop" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  try {
+    result = (std::vector< double >::value_type)std_vector_Sl_double_Sg__pop(arg1);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  std::vector< double >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleVector___getslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___getslice__" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector___getslice__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleVector___getslice__" "', argument " "3"" of type '" "std::vector< double >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< double >::difference_type >(val3);
+  try {
+    result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg____getslice__(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___setslice____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  std::vector< double >::difference_type arg3 ;
+  std::vector< double,std::allocator< double > > *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:DoubleVector___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___setslice__" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector___setslice__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleVector___setslice__" "', argument " "3"" of type '" "std::vector< double >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< double >::difference_type >(val3);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res4 = swig::asptr(obj3, &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "DoubleVector___setslice__" "', argument " "4"" of type '" "std::vector< double,std::allocator< double > > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleVector___setslice__" "', argument " "4"" of type '" "std::vector< double,std::allocator< double > > const &""'"); 
+    }
+    arg4 = ptr;
+  }
+  try {
+    std_vector_Sl_double_Sg____setslice____SWIG_0(arg1,arg2,arg3,(std::vector< double,std::allocator< double > > const &)*arg4);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___setslice____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  std::vector< double >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleVector___setslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___setslice__" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector___setslice__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleVector___setslice__" "', argument " "3"" of type '" "std::vector< double >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< double >::difference_type >(val3);
+  try {
+    std_vector_Sl_double_Sg____setslice____SWIG_0(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___setslice__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_DoubleVector___setslice____SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<double,std::allocator< double > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_DoubleVector___setslice____SWIG_0(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleVector___setslice__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< double >::__setslice__(std::vector< double >::difference_type,std::vector< double >::difference_type,std::vector< double,std::allocator< double > > const &)\n"
+    "    std::vector< double >::__setslice__(std::vector< double >::difference_type,std::vector< double >::difference_type)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  std::vector< double >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleVector___delslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___delslice__" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector___delslice__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleVector___delslice__" "', argument " "3"" of type '" "std::vector< double >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< double >::difference_type >(val3);
+  try {
+    std_vector_Sl_double_Sg____delslice__(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___delitem__" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector___delitem__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  try {
+    std_vector_Sl_double_Sg____delitem____SWIG_0(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___getitem__" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector___getitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg____getitem____SWIG_0(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  std::vector< double,std::allocator< double > > *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___setitem__" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res3 = swig::asptr(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DoubleVector___setitem__" "', argument " "3"" of type '" "std::vector< double,std::allocator< double > > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleVector___setitem__" "', argument " "3"" of type '" "std::vector< double,std::allocator< double > > const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  try {
+    std_vector_Sl_double_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< double,std::allocator< double > > const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector___setitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___setitem__" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    std_vector_Sl_double_Sg____setitem____SWIG_1(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___delitem__" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector___delitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    std_vector_Sl_double_Sg____delitem____SWIG_1(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___delitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_DoubleVector___delitem____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_DoubleVector___delitem____SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleVector___delitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< double >::__delitem__(std::vector< double >::difference_type)\n"
+    "    std::vector< double >::__delitem__(PySliceObject *)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< double >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___getitem__" "', argument " "1"" of type '" "std::vector< double > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector___getitem__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  try {
+    result = (std::vector< double >::value_type *) &std_vector_Sl_double_Sg____getitem____SWIG_1((std::vector< double > const *)arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_From_double(static_cast< double >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___getitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_DoubleVector___getitem____SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_DoubleVector___getitem____SWIG_1(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleVector___getitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< double >::__getitem__(PySliceObject *)\n"
+    "    std::vector< double >::__getitem__(std::vector< double >::difference_type) const\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___setitem____SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  std::vector< double >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< double >::value_type temp3 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector___setitem__" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector___setitem__" "', argument " "2"" of type '" "std::vector< double >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleVector___setitem__" "', argument " "3"" of type '" "std::vector< double >::value_type""'");
+  } 
+  temp3 = static_cast< std::vector< double >::value_type >(val3);
+  arg3 = &temp3;
+  try {
+    std_vector_Sl_double_Sg____setitem____SWIG_2(arg1,arg2,(double const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector___setitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_DoubleVector___setitem____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        int res = swig::asptr(argv[2], (std::vector<double,std::allocator< double > >**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_DoubleVector___setitem____SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_double(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_DoubleVector___setitem____SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleVector___setitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< double >::__setitem__(PySliceObject *,std::vector< double,std::allocator< double > > const &)\n"
+    "    std::vector< double >::__setitem__(PySliceObject *)\n"
+    "    std::vector< double >::__setitem__(std::vector< double >::difference_type,std::vector< double >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::value_type temp2 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_append",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_append" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_append" "', argument " "2"" of type '" "std::vector< double >::value_type""'");
+  } 
+  temp2 = static_cast< std::vector< double >::value_type >(val2);
+  arg2 = &temp2;
+  std_vector_Sl_double_Sg__append(arg1,(double const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_DoubleVector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_DoubleVector")) SWIG_fail;
+  result = (std::vector< double > *)new std::vector< double >();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_DoubleVector__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  std::vector< double > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_DoubleVector",&obj0)) SWIG_fail;
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res1 = swig::asptr(obj0, &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_DoubleVector" "', argument " "1"" of type '" "std::vector< double > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DoubleVector" "', argument " "1"" of type '" "std::vector< double > const &""'"); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::vector< double > *)new std::vector< double >((std::vector< double > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_empty",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_empty" "', argument " "1"" of type '" "std::vector< double > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (bool)((std::vector< double > const *)arg1)->empty();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_size",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_size" "', argument " "1"" of type '" "std::vector< double > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = ((std::vector< double > const *)arg1)->size();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_clear" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  (arg1)->clear();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_swap",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_swap" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DoubleVector_swap" "', argument " "2"" of type '" "std::vector< double > &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleVector_swap" "', argument " "2"" of type '" "std::vector< double > &""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< double > * >(argp2);
+  (arg1)->swap(*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::allocator< double > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_get_allocator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_get_allocator" "', argument " "1"" of type '" "std::vector< double > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = ((std::vector< double > const *)arg1)->get_allocator();
+  resultobj = SWIG_NewPointerObj((new std::vector< double >::allocator_type(static_cast< const std::vector< double >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_double_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_begin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_begin" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (arg1)->begin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_end",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_end" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (arg1)->end();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_rbegin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_rbegin" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (arg1)->rbegin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_rend",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_rend" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (arg1)->rend();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_DoubleVector__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double >::size_type arg1 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_DoubleVector",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_DoubleVector" "', argument " "1"" of type '" "std::vector< double >::size_type""'");
+  } 
+  arg1 = static_cast< std::vector< double >::size_type >(val1);
+  result = (std::vector< double > *)new std::vector< double >(arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_pop_back",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_pop_back" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  (arg1)->pop_back();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_resize",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_resize" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_resize" "', argument " "2"" of type '" "std::vector< double >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< double >::size_type >(val2);
+  (arg1)->resize(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< double >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_erase" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
+    }
+  }
+  result = (arg1)->erase(arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::iterator arg2 ;
+  std::vector< double >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  swig::SwigPyIterator *iter3 = 0 ;
+  int res3 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< double >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleVector_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_erase" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_erase" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
+    }
+  }
+  res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_erase" "', argument " "3"" of type '" "std::vector< double >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_erase" "', argument " "3"" of type '" "std::vector< double >::iterator""'");
+    }
+  }
+  result = (arg1)->erase(arg2,arg3);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_erase(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_DoubleVector_erase__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::SwigPyIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_DoubleVector_erase__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleVector_erase'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< double >::erase(std::vector< double >::iterator)\n"
+    "    std::vector< double >::erase(std::vector< double >::iterator,std::vector< double >::iterator)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_DoubleVector__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double >::size_type arg1 ;
+  std::vector< double >::value_type *arg2 = 0 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  std::vector< double >::value_type temp2 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< double > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:new_DoubleVector",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_DoubleVector" "', argument " "1"" of type '" "std::vector< double >::size_type""'");
+  } 
+  arg1 = static_cast< std::vector< double >::size_type >(val1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_DoubleVector" "', argument " "2"" of type '" "std::vector< double >::value_type""'");
+  } 
+  temp2 = static_cast< std::vector< double >::value_type >(val2);
+  arg2 = &temp2;
+  result = (std::vector< double > *)new std::vector< double >(arg1,(std::vector< double >::value_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_DoubleVector(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_DoubleVector__SWIG_0(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_DoubleVector__SWIG_2(self, args);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_DoubleVector__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_double(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_new_DoubleVector__SWIG_3(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_DoubleVector'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< double >::vector()\n"
+    "    std::vector< double >::vector(std::vector< double > const &)\n"
+    "    std::vector< double >::vector(std::vector< double >::size_type)\n"
+    "    std::vector< double >::vector(std::vector< double >::size_type,std::vector< double >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::value_type temp2 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_push_back",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_push_back" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_push_back" "', argument " "2"" of type '" "std::vector< double >::value_type""'");
+  } 
+  temp2 = static_cast< std::vector< double >::value_type >(val2);
+  arg2 = &temp2;
+  (arg1)->push_back((std::vector< double >::value_type const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_front",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_front" "', argument " "1"" of type '" "std::vector< double > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (std::vector< double >::value_type *) &((std::vector< double > const *)arg1)->front();
+  resultobj = SWIG_From_double(static_cast< double >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_back",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_back" "', argument " "1"" of type '" "std::vector< double > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (std::vector< double >::value_type *) &((std::vector< double > const *)arg1)->back();
+  resultobj = SWIG_From_double(static_cast< double >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::size_type arg2 ;
+  std::vector< double >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< double >::value_type temp3 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleVector_assign",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_assign" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_assign" "', argument " "2"" of type '" "std::vector< double >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< double >::size_type >(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleVector_assign" "', argument " "3"" of type '" "std::vector< double >::value_type""'");
+  } 
+  temp3 = static_cast< std::vector< double >::value_type >(val3);
+  arg3 = &temp3;
+  (arg1)->assign(arg2,(std::vector< double >::value_type const &)*arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::size_type arg2 ;
+  std::vector< double >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< double >::value_type temp3 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleVector_resize",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_resize" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_resize" "', argument " "2"" of type '" "std::vector< double >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< double >::size_type >(val2);
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleVector_resize" "', argument " "3"" of type '" "std::vector< double >::value_type""'");
+  } 
+  temp3 = static_cast< std::vector< double >::value_type >(val3);
+  arg3 = &temp3;
+  (arg1)->resize(arg2,(std::vector< double >::value_type const &)*arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_resize(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_DoubleVector_resize__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_double(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_DoubleVector_resize__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleVector_resize'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< double >::resize(std::vector< double >::size_type)\n"
+    "    std::vector< double >::resize(std::vector< double >::size_type,std::vector< double >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::iterator arg2 ;
+  std::vector< double >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  std::vector< double >::value_type temp3 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< double >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleVector_insert",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_insert" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
+    }
+  }
+  ecode3 = SWIG_AsVal_double(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleVector_insert" "', argument " "3"" of type '" "std::vector< double >::value_type""'");
+  } 
+  temp3 = static_cast< std::vector< double >::value_type >(val3);
+  arg3 = &temp3;
+  result = (arg1)->insert(arg2,(std::vector< double >::value_type const &)*arg3);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< double >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::iterator arg2 ;
+  std::vector< double >::size_type arg3 ;
+  std::vector< double >::value_type *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  std::vector< double >::value_type temp4 ;
+  double val4 ;
+  int ecode4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:DoubleVector_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_insert" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleVector_insert" "', argument " "2"" of type '" "std::vector< double >::iterator""'");
+    }
+  }
+  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleVector_insert" "', argument " "3"" of type '" "std::vector< double >::size_type""'");
+  } 
+  arg3 = static_cast< std::vector< double >::size_type >(val3);
+  ecode4 = SWIG_AsVal_double(obj3, &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "DoubleVector_insert" "', argument " "4"" of type '" "std::vector< double >::value_type""'");
+  } 
+  temp4 = static_cast< std::vector< double >::value_type >(val4);
+  arg4 = &temp4;
+  (arg1)->insert(arg2,arg3,(std::vector< double >::value_type const &)*arg4);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_insert(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_double(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_DoubleVector_insert__SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< double >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_size_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            int res = SWIG_AsVal_double(argv[3], NULL);
+            _v = SWIG_CheckState(res);
+          }
+          if (_v) {
+            return _wrap_DoubleVector_insert__SWIG_1(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleVector_insert'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< double >::insert(std::vector< double >::iterator,std::vector< double >::value_type const &)\n"
+    "    std::vector< double >::insert(std::vector< double >::iterator,std::vector< double >::size_type,std::vector< double >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleVector_reserve",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_reserve" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleVector_reserve" "', argument " "2"" of type '" "std::vector< double >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< double >::size_type >(val2);
+  (arg1)->reserve(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleVector_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleVector_capacity",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleVector_capacity" "', argument " "1"" of type '" "std::vector< double > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = ((std::vector< double > const *)arg1)->capacity();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_DoubleVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_DoubleVector",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DoubleVector" "', argument " "1"" of type '" "std::vector< double > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *DoubleVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_iterator" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (swig::SwigPyIterator *)std_vector_Sl_std_vector_Sl_double_Sg__Sg__iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector___nonzero__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___nonzero__" "', argument " "1"" of type '" "std::vector< std::vector< double > > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (bool)std_vector_Sl_std_vector_Sl_double_Sg__Sg____nonzero__((std::vector< std::vector< double > > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector___bool__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___bool__" "', argument " "1"" of type '" "std::vector< std::vector< double > > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (bool)std_vector_Sl_std_vector_Sl_double_Sg__Sg____bool__((std::vector< std::vector< double > > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector___len__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___len__" "', argument " "1"" of type '" "std::vector< std::vector< double > > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = std_vector_Sl_std_vector_Sl_double_Sg__Sg____len__((std::vector< std::vector< double > > const *)arg1);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > >::value_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_pop",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_pop" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  try {
+    result = std_vector_Sl_std_vector_Sl_double_Sg__Sg__pop(arg1);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = swig::from(static_cast< std::vector<double,std::allocator< double > > >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  std::vector< std::vector< double > >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleDoubleVector___getslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___getslice__" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleDoubleVector___getslice__" "', argument " "2"" of type '" "std::vector< std::vector< double > >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleDoubleVector___getslice__" "', argument " "3"" of type '" "std::vector< std::vector< double > >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< std::vector< double > >::difference_type >(val3);
+  try {
+    result = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)std_vector_Sl_std_vector_Sl_double_Sg__Sg____getslice__(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___setslice____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  std::vector< std::vector< double > >::difference_type arg3 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:DoubleDoubleVector___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___setslice__" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleDoubleVector___setslice__" "', argument " "2"" of type '" "std::vector< std::vector< double > >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleDoubleVector___setslice__" "', argument " "3"" of type '" "std::vector< std::vector< double > >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< std::vector< double > >::difference_type >(val3);
+  {
+    std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0;
+    res4 = swig::asptr(obj3, &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "DoubleDoubleVector___setslice__" "', argument " "4"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleDoubleVector___setslice__" "', argument " "4"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); 
+    }
+    arg4 = ptr;
+  }
+  try {
+    std_vector_Sl_std_vector_Sl_double_Sg__Sg____setslice____SWIG_0(arg1,arg2,arg3,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg4);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___setslice____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  std::vector< std::vector< double > >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleDoubleVector___setslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___setslice__" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleDoubleVector___setslice__" "', argument " "2"" of type '" "std::vector< std::vector< double > >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleDoubleVector___setslice__" "', argument " "3"" of type '" "std::vector< std::vector< double > >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< std::vector< double > >::difference_type >(val3);
+  try {
+    std_vector_Sl_std_vector_Sl_double_Sg__Sg____setslice____SWIG_0(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___setslice__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_DoubleDoubleVector___setslice____SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_DoubleDoubleVector___setslice____SWIG_0(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleDoubleVector___setslice__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::vector< double > >::__setslice__(std::vector< std::vector< double > >::difference_type,std::vector< std::vector< double > >::difference_type,std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)\n"
+    "    std::vector< std::vector< double > >::__setslice__(std::vector< std::vector< double > >::difference_type,std::vector< std::vector< double > >::difference_type)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  std::vector< std::vector< double > >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleDoubleVector___delslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___delslice__" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleDoubleVector___delslice__" "', argument " "2"" of type '" "std::vector< std::vector< double > >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleDoubleVector___delslice__" "', argument " "3"" of type '" "std::vector< std::vector< double > >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< std::vector< double > >::difference_type >(val3);
+  try {
+    std_vector_Sl_std_vector_Sl_double_Sg__Sg____delslice__(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleDoubleVector___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___delitem__" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleDoubleVector___delitem__" "', argument " "2"" of type '" "std::vector< std::vector< double > >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  try {
+    std_vector_Sl_std_vector_Sl_double_Sg__Sg____delitem____SWIG_0(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleDoubleVector___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___getitem__" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector___getitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    result = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)std_vector_Sl_std_vector_Sl_double_Sg__Sg____getitem____SWIG_0(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleDoubleVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___setitem__" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  {
+    std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0;
+    res3 = swig::asptr(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DoubleDoubleVector___setitem__" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleDoubleVector___setitem__" "', argument " "3"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  try {
+    std_vector_Sl_std_vector_Sl_double_Sg__Sg____setitem____SWIG_0(arg1,arg2,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleDoubleVector___setitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___setitem__" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    std_vector_Sl_std_vector_Sl_double_Sg__Sg____setitem____SWIG_1(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleDoubleVector___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___delitem__" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector___delitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    std_vector_Sl_std_vector_Sl_double_Sg__Sg____delitem____SWIG_1(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___delitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_DoubleDoubleVector___delitem____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_DoubleDoubleVector___delitem____SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleDoubleVector___delitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::vector< double > >::__delitem__(std::vector< std::vector< double > >::difference_type)\n"
+    "    std::vector< std::vector< double > >::__delitem__(PySliceObject *)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< std::vector< double > >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleDoubleVector___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___getitem__" "', argument " "1"" of type '" "std::vector< std::vector< double > > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleDoubleVector___getitem__" "', argument " "2"" of type '" "std::vector< std::vector< double > >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  try {
+    result = (std::vector< std::vector< double > >::value_type *) &std_vector_Sl_std_vector_Sl_double_Sg__Sg____getitem____SWIG_1((std::vector< std::vector< double > > const *)arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = swig::from(static_cast< std::vector<double,std::allocator< double > > >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___getitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_DoubleDoubleVector___getitem____SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_DoubleDoubleVector___getitem____SWIG_1(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleDoubleVector___getitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::vector< double > >::__getitem__(PySliceObject *)\n"
+    "    std::vector< std::vector< double > >::__getitem__(std::vector< std::vector< double > >::difference_type) const\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___setitem____SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  std::vector< std::vector< double > >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleDoubleVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector___setitem__" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleDoubleVector___setitem__" "', argument " "2"" of type '" "std::vector< std::vector< double > >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res3 = swig::asptr(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DoubleDoubleVector___setitem__" "', argument " "3"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleDoubleVector___setitem__" "', argument " "3"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  try {
+    std_vector_Sl_std_vector_Sl_double_Sg__Sg____setitem____SWIG_2(arg1,arg2,(std::vector< double,std::allocator< double > > const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector___setitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_DoubleDoubleVector___setitem____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        int res = swig::asptr(argv[2], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_DoubleDoubleVector___setitem____SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = swig::asptr(argv[2], (std::vector<double,std::allocator< double > >**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_DoubleDoubleVector___setitem____SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleDoubleVector___setitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::vector< double > >::__setitem__(PySliceObject *,std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)\n"
+    "    std::vector< std::vector< double > >::__setitem__(PySliceObject *)\n"
+    "    std::vector< std::vector< double > >::__setitem__(std::vector< std::vector< double > >::difference_type,std::vector< std::vector< double > >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleDoubleVector_append",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_append" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res2 = swig::asptr(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DoubleDoubleVector_append" "', argument " "2"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleDoubleVector_append" "', argument " "2"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  std_vector_Sl_std_vector_Sl_double_Sg__Sg__append(arg1,(std::vector< double,std::allocator< double > > const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_DoubleDoubleVector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_DoubleDoubleVector")) SWIG_fail;
+  result = (std::vector< std::vector< double > > *)new std::vector< std::vector< double > >();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_DoubleDoubleVector__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double,std::allocator< double > > > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_DoubleDoubleVector",&obj0)) SWIG_fail;
+  {
+    std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0;
+    res1 = swig::asptr(obj0, &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_DoubleDoubleVector" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > > > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DoubleDoubleVector" "', argument " "1"" of type '" "std::vector< std::vector< double,std::allocator< double > > > const &""'"); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::vector< std::vector< double > > *)new std::vector< std::vector< double > >((std::vector< std::vector< double,std::allocator< double > > > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_empty",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_empty" "', argument " "1"" of type '" "std::vector< std::vector< double > > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (bool)((std::vector< std::vector< double > > const *)arg1)->empty();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_size",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_size" "', argument " "1"" of type '" "std::vector< std::vector< double > > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = ((std::vector< std::vector< double > > const *)arg1)->size();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_clear" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  (arg1)->clear();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double,std::allocator< double > > > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleDoubleVector_swap",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_swap" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DoubleDoubleVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< double,std::allocator< double > > > &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleDoubleVector_swap" "', argument " "2"" of type '" "std::vector< std::vector< double,std::allocator< double > > > &""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< std::vector< double,std::allocator< double > > > * >(argp2);
+  (arg1)->swap(*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::allocator< std::vector< double,std::allocator< double > > > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_get_allocator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_get_allocator" "', argument " "1"" of type '" "std::vector< std::vector< double > > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = ((std::vector< std::vector< double > > const *)arg1)->get_allocator();
+  resultobj = SWIG_NewPointerObj((new std::vector< std::vector< double > >::allocator_type(static_cast< const std::vector< std::vector< double > >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_begin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_begin" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (arg1)->begin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::vector< double > >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_end",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_end" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (arg1)->end();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::vector< double > >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_rbegin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_rbegin" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (arg1)->rbegin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::vector< double > >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_rend",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_rend" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (arg1)->rend();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::vector< double > >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_DoubleDoubleVector__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > >::size_type arg1 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_DoubleDoubleVector",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_DoubleDoubleVector" "', argument " "1"" of type '" "std::vector< std::vector< double > >::size_type""'");
+  } 
+  arg1 = static_cast< std::vector< std::vector< double > >::size_type >(val1);
+  result = (std::vector< std::vector< double > > *)new std::vector< std::vector< double > >(arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_pop_back",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_pop_back" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  (arg1)->pop_back();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleDoubleVector_resize",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_resize" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleDoubleVector_resize" "', argument " "2"" of type '" "std::vector< std::vector< double > >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::size_type >(val2);
+  (arg1)->resize(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< std::vector< double > >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleDoubleVector_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_erase" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector_erase" "', argument " "2"" of type '" "std::vector< std::vector< double > >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector_erase" "', argument " "2"" of type '" "std::vector< std::vector< double > >::iterator""'");
+    }
+  }
+  result = (arg1)->erase(arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::vector< double > >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::iterator arg2 ;
+  std::vector< std::vector< double > >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  swig::SwigPyIterator *iter3 = 0 ;
+  int res3 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< std::vector< double > >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleDoubleVector_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_erase" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector_erase" "', argument " "2"" of type '" "std::vector< std::vector< double > >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector_erase" "', argument " "2"" of type '" "std::vector< std::vector< double > >::iterator""'");
+    }
+  }
+  res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector_erase" "', argument " "3"" of type '" "std::vector< std::vector< double > >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector_erase" "', argument " "3"" of type '" "std::vector< std::vector< double > >::iterator""'");
+    }
+  }
+  result = (arg1)->erase(arg2,arg3);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::vector< double > >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_erase(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_DoubleDoubleVector_erase__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::SwigPyIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_DoubleDoubleVector_erase__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleDoubleVector_erase'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::vector< double > >::erase(std::vector< std::vector< double > >::iterator)\n"
+    "    std::vector< std::vector< double > >::erase(std::vector< std::vector< double > >::iterator,std::vector< std::vector< double > >::iterator)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_DoubleDoubleVector__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > >::size_type arg1 ;
+  std::vector< std::vector< double > >::value_type *arg2 = 0 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< std::vector< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:new_DoubleDoubleVector",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_DoubleDoubleVector" "', argument " "1"" of type '" "std::vector< std::vector< double > >::size_type""'");
+  } 
+  arg1 = static_cast< std::vector< std::vector< double > >::size_type >(val1);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res2 = swig::asptr(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_DoubleDoubleVector" "', argument " "2"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_DoubleDoubleVector" "', argument " "2"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  result = (std::vector< std::vector< double > > *)new std::vector< std::vector< double > >(arg1,(std::vector< std::vector< double > >::value_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_DoubleDoubleVector(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_DoubleDoubleVector__SWIG_0(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_DoubleDoubleVector__SWIG_2(self, args);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_DoubleDoubleVector__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      int res = swig::asptr(argv[1], (std::vector<double,std::allocator< double > >**)(0));
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_new_DoubleDoubleVector__SWIG_3(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_DoubleDoubleVector'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::vector< double > >::vector()\n"
+    "    std::vector< std::vector< double > >::vector(std::vector< std::vector< double,std::allocator< double > > > const &)\n"
+    "    std::vector< std::vector< double > >::vector(std::vector< std::vector< double > >::size_type)\n"
+    "    std::vector< std::vector< double > >::vector(std::vector< std::vector< double > >::size_type,std::vector< std::vector< double > >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleDoubleVector_push_back",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_push_back" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res2 = swig::asptr(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "DoubleDoubleVector_push_back" "', argument " "2"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleDoubleVector_push_back" "', argument " "2"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  (arg1)->push_back((std::vector< std::vector< double > >::value_type const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_front",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_front" "', argument " "1"" of type '" "std::vector< std::vector< double > > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (std::vector< std::vector< double > >::value_type *) &((std::vector< std::vector< double > > const *)arg1)->front();
+  resultobj = swig::from(static_cast< std::vector<double,std::allocator< double > > >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_back",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_back" "', argument " "1"" of type '" "std::vector< std::vector< double > > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (std::vector< std::vector< double > >::value_type *) &((std::vector< std::vector< double > > const *)arg1)->back();
+  resultobj = swig::from(static_cast< std::vector<double,std::allocator< double > > >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::size_type arg2 ;
+  std::vector< std::vector< double > >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleDoubleVector_assign",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_assign" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleDoubleVector_assign" "', argument " "2"" of type '" "std::vector< std::vector< double > >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::size_type >(val2);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res3 = swig::asptr(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DoubleDoubleVector_assign" "', argument " "3"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleDoubleVector_assign" "', argument " "3"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  (arg1)->assign(arg2,(std::vector< std::vector< double > >::value_type const &)*arg3);
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::size_type arg2 ;
+  std::vector< std::vector< double > >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleDoubleVector_resize",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_resize" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleDoubleVector_resize" "', argument " "2"" of type '" "std::vector< std::vector< double > >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::size_type >(val2);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res3 = swig::asptr(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DoubleDoubleVector_resize" "', argument " "3"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleDoubleVector_resize" "', argument " "3"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  (arg1)->resize(arg2,(std::vector< std::vector< double > >::value_type const &)*arg3);
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_resize(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_DoubleDoubleVector_resize__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = swig::asptr(argv[2], (std::vector<double,std::allocator< double > >**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_DoubleDoubleVector_resize__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleDoubleVector_resize'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::vector< double > >::resize(std::vector< std::vector< double > >::size_type)\n"
+    "    std::vector< std::vector< double > >::resize(std::vector< std::vector< double > >::size_type,std::vector< std::vector< double > >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::iterator arg2 ;
+  std::vector< std::vector< double > >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< std::vector< double > >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:DoubleDoubleVector_insert",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_insert" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector_insert" "', argument " "2"" of type '" "std::vector< std::vector< double > >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector_insert" "', argument " "2"" of type '" "std::vector< std::vector< double > >::iterator""'");
+    }
+  }
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res3 = swig::asptr(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "DoubleDoubleVector_insert" "', argument " "3"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleDoubleVector_insert" "', argument " "3"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  result = (arg1)->insert(arg2,(std::vector< std::vector< double > >::value_type const &)*arg3);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::vector< double > >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::iterator arg2 ;
+  std::vector< std::vector< double > >::size_type arg3 ;
+  std::vector< std::vector< double > >::value_type *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:DoubleDoubleVector_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_insert" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector_insert" "', argument " "2"" of type '" "std::vector< std::vector< double > >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "DoubleDoubleVector_insert" "', argument " "2"" of type '" "std::vector< std::vector< double > >::iterator""'");
+    }
+  }
+  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "DoubleDoubleVector_insert" "', argument " "3"" of type '" "std::vector< std::vector< double > >::size_type""'");
+  } 
+  arg3 = static_cast< std::vector< std::vector< double > >::size_type >(val3);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res4 = swig::asptr(obj3, &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "DoubleDoubleVector_insert" "', argument " "4"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "DoubleDoubleVector_insert" "', argument " "4"" of type '" "std::vector< std::vector< double > >::value_type const &""'"); 
+    }
+    arg4 = ptr;
+  }
+  (arg1)->insert(arg2,arg3,(std::vector< std::vector< double > >::value_type const &)*arg4);
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_insert(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *>(iter) != 0));
+      if (_v) {
+        int res = swig::asptr(argv[2], (std::vector<double,std::allocator< double > >**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_DoubleDoubleVector_insert__SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::vector< double > >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_size_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<double,std::allocator< double > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_DoubleDoubleVector_insert__SWIG_1(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'DoubleDoubleVector_insert'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::vector< double > >::insert(std::vector< std::vector< double > >::iterator,std::vector< std::vector< double > >::value_type const &)\n"
+    "    std::vector< std::vector< double > >::insert(std::vector< std::vector< double > >::iterator,std::vector< std::vector< double > >::size_type,std::vector< std::vector< double > >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:DoubleDoubleVector_reserve",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_reserve" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "DoubleDoubleVector_reserve" "', argument " "2"" of type '" "std::vector< std::vector< double > >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::size_type >(val2);
+  (arg1)->reserve(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_DoubleDoubleVector_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double > >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:DoubleDoubleVector_capacity",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "DoubleDoubleVector_capacity" "', argument " "1"" of type '" "std::vector< std::vector< double > > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = ((std::vector< std::vector< double > > const *)arg1)->capacity();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_DoubleDoubleVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_DoubleDoubleVector",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_DoubleDoubleVector" "', argument " "1"" of type '" "std::vector< std::vector< double > > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *DoubleDoubleVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_StringVector_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_iterator" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (swig::SwigPyIterator *)std_vector_Sl_std_string_Sg__iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector___nonzero__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___nonzero__" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (bool)std_vector_Sl_std_string_Sg____nonzero__((std::vector< std::string > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector___bool__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___bool__" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (bool)std_vector_Sl_std_string_Sg____bool__((std::vector< std::string > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector___len__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___len__" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = std_vector_Sl_std_string_Sg____len__((std::vector< std::string > const *)arg1);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string >::value_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_pop",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_pop" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  try {
+    result = std_vector_Sl_std_string_Sg__pop(arg1);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_From_std_string(static_cast< std::string >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  std::vector< std::string >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector___getslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___getslice__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___getslice__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StringVector___getslice__" "', argument " "3"" of type '" "std::vector< std::string >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< std::string >::difference_type >(val3);
+  try {
+    result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg____getslice__(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___setslice____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  std::vector< std::string >::difference_type arg3 ;
+  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:StringVector___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___setslice__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___setslice__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StringVector___setslice__" "', argument " "3"" of type '" "std::vector< std::string >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< std::string >::difference_type >(val3);
+  {
+    std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0;
+    res4 = swig::asptr(obj3, &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "StringVector___setslice__" "', argument " "4"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector___setslice__" "', argument " "4"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); 
+    }
+    arg4 = ptr;
+  }
+  try {
+    std_vector_Sl_std_string_Sg____setslice____SWIG_0(arg1,arg2,arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___setslice____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  std::vector< std::string >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector___setslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___setslice__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___setslice__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StringVector___setslice__" "', argument " "3"" of type '" "std::vector< std::string >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< std::string >::difference_type >(val3);
+  try {
+    std_vector_Sl_std_string_Sg____setslice____SWIG_0(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___setslice__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_StringVector___setslice____SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<std::string,std::allocator< std::string > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_StringVector___setslice____SWIG_0(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector___setslice__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::string >::__setslice__(std::vector< std::string >::difference_type,std::vector< std::string >::difference_type,std::vector< std::string,std::allocator< std::string > > const &)\n"
+    "    std::vector< std::string >::__setslice__(std::vector< std::string >::difference_type,std::vector< std::string >::difference_type)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  std::vector< std::string >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector___delslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___delslice__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___delslice__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StringVector___delslice__" "', argument " "3"" of type '" "std::vector< std::string >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< std::string >::difference_type >(val3);
+  try {
+    std_vector_Sl_std_string_Sg____delslice__(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:StringVector___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___delitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___delitem__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  try {
+    std_vector_Sl_std_string_Sg____delitem____SWIG_0(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:StringVector___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___getitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector___getitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg____getitem____SWIG_0(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  std::vector< std::string,std::allocator< std::string > > *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___setitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  {
+    std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0;
+    res3 = swig::asptr(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StringVector___setitem__" "', argument " "3"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector___setitem__" "', argument " "3"" of type '" "std::vector< std::string,std::allocator< std::string > > const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  try {
+    std_vector_Sl_std_string_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< std::string,std::allocator< std::string > > const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:StringVector___setitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___setitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    std_vector_Sl_std_string_Sg____setitem____SWIG_1(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:StringVector___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___delitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector___delitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    std_vector_Sl_std_string_Sg____delitem____SWIG_1(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___delitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_StringVector___delitem____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_StringVector___delitem____SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector___delitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::string >::__delitem__(std::vector< std::string >::difference_type)\n"
+    "    std::vector< std::string >::__delitem__(PySliceObject *)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< std::string >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:StringVector___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___getitem__" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___getitem__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  try {
+    result = (std::vector< std::string >::value_type *) &std_vector_Sl_std_string_Sg____getitem____SWIG_1((std::vector< std::string > const *)arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___getitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_StringVector___getitem____SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_StringVector___getitem____SWIG_1(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector___getitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::string >::__getitem__(PySliceObject *)\n"
+    "    std::vector< std::string >::__getitem__(std::vector< std::string >::difference_type) const\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___setitem____SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  std::vector< std::string >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector___setitem__" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector___setitem__" "', argument " "2"" of type '" "std::vector< std::string >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  {
+    std::string *ptr = (std::string *)0;
+    res3 = SWIG_AsPtr_std_string(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StringVector___setitem__" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector___setitem__" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  try {
+    std_vector_Sl_std_string_Sg____setitem____SWIG_2(arg1,arg2,(std::string const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector___setitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_StringVector___setitem____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        int res = swig::asptr(argv[2], (std::vector<std::string,std::allocator< std::string > >**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_StringVector___setitem____SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_StringVector___setitem____SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector___setitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::string >::__setitem__(PySliceObject *,std::vector< std::string,std::allocator< std::string > > const &)\n"
+    "    std::vector< std::string >::__setitem__(PySliceObject *)\n"
+    "    std::vector< std::string >::__setitem__(std::vector< std::string >::difference_type,std::vector< std::string >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_append",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_append" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "StringVector_append" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_append" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  std_vector_Sl_std_string_Sg__append(arg1,(std::string const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_StringVector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_StringVector")) SWIG_fail;
+  result = (std::vector< std::string > *)new std::vector< std::string >();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_StringVector__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_StringVector",&obj0)) SWIG_fail;
+  {
+    std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0;
+    res1 = swig::asptr(obj0, &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_StringVector" "', argument " "1"" of type '" "std::vector< std::string > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_StringVector" "', argument " "1"" of type '" "std::vector< std::string > const &""'"); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::vector< std::string > *)new std::vector< std::string >((std::vector< std::string > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_empty",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_empty" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (bool)((std::vector< std::string > const *)arg1)->empty();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_size",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_size" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = ((std::vector< std::string > const *)arg1)->size();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_clear" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  (arg1)->clear();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_swap",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_swap" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "StringVector_swap" "', argument " "2"" of type '" "std::vector< std::string > &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_swap" "', argument " "2"" of type '" "std::vector< std::string > &""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< std::string > * >(argp2);
+  (arg1)->swap(*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::allocator< std::string > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_get_allocator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_get_allocator" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = ((std::vector< std::string > const *)arg1)->get_allocator();
+  resultobj = SWIG_NewPointerObj((new std::vector< std::string >::allocator_type(static_cast< const std::vector< std::string >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__string_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_begin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_begin" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (arg1)->begin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_end",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_end" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (arg1)->end();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_rbegin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_rbegin" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (arg1)->rbegin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_rend",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_rend" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (arg1)->rend();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_StringVector__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string >::size_type arg1 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_StringVector",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_StringVector" "', argument " "1"" of type '" "std::vector< std::string >::size_type""'");
+  } 
+  arg1 = static_cast< std::vector< std::string >::size_type >(val1);
+  result = (std::vector< std::string > *)new std::vector< std::string >(arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_pop_back",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_pop_back" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  (arg1)->pop_back();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_resize",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_resize" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector_resize" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+  (arg1)->resize(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< std::string >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_erase" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+    }
+  }
+  result = (arg1)->erase(arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::iterator arg2 ;
+  std::vector< std::string >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  swig::SwigPyIterator *iter3 = 0 ;
+  int res3 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< std::string >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_erase" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+    }
+  }
+  res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "3"" of type '" "std::vector< std::string >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_erase" "', argument " "3"" of type '" "std::vector< std::string >::iterator""'");
+    }
+  }
+  result = (arg1)->erase(arg2,arg3);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_erase(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_StringVector_erase__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::SwigPyIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_StringVector_erase__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector_erase'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::string >::erase(std::vector< std::string >::iterator)\n"
+    "    std::vector< std::string >::erase(std::vector< std::string >::iterator,std::vector< std::string >::iterator)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_StringVector__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string >::size_type arg1 ;
+  std::vector< std::string >::value_type *arg2 = 0 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< std::string > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:new_StringVector",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_StringVector" "', argument " "1"" of type '" "std::vector< std::string >::size_type""'");
+  } 
+  arg1 = static_cast< std::vector< std::string >::size_type >(val1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_StringVector" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_StringVector" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  result = (std::vector< std::string > *)new std::vector< std::string >(arg1,(std::vector< std::string >::value_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_StringVector(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_StringVector__SWIG_0(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_StringVector__SWIG_2(self, args);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_StringVector__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_new_StringVector__SWIG_3(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_StringVector'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::string >::vector()\n"
+    "    std::vector< std::string >::vector(std::vector< std::string > const &)\n"
+    "    std::vector< std::string >::vector(std::vector< std::string >::size_type)\n"
+    "    std::vector< std::string >::vector(std::vector< std::string >::size_type,std::vector< std::string >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_push_back",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_push_back" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "StringVector_push_back" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_push_back" "', argument " "2"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  (arg1)->push_back((std::vector< std::string >::value_type const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_front",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_front" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (std::vector< std::string >::value_type *) &((std::vector< std::string > const *)arg1)->front();
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_back",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_back" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (std::vector< std::string >::value_type *) &((std::vector< std::string > const *)arg1)->back();
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::size_type arg2 ;
+  std::vector< std::string >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector_assign",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_assign" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector_assign" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+  {
+    std::string *ptr = (std::string *)0;
+    res3 = SWIG_AsPtr_std_string(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StringVector_assign" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_assign" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  (arg1)->assign(arg2,(std::vector< std::string >::value_type const &)*arg3);
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::size_type arg2 ;
+  std::vector< std::string >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector_resize",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_resize" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector_resize" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+  {
+    std::string *ptr = (std::string *)0;
+    res3 = SWIG_AsPtr_std_string(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StringVector_resize" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_resize" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  (arg1)->resize(arg2,(std::vector< std::string >::value_type const &)*arg3);
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_resize(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_StringVector_resize__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_StringVector_resize__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector_resize'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::string >::resize(std::vector< std::string >::size_type)\n"
+    "    std::vector< std::string >::resize(std::vector< std::string >::size_type,std::vector< std::string >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::iterator arg2 ;
+  std::vector< std::string >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< std::string >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:StringVector_insert",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_insert" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+    }
+  }
+  {
+    std::string *ptr = (std::string *)0;
+    res3 = SWIG_AsPtr_std_string(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "StringVector_insert" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_insert" "', argument " "3"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  result = (arg1)->insert(arg2,(std::vector< std::string >::value_type const &)*arg3);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< std::string >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::iterator arg2 ;
+  std::vector< std::string >::size_type arg3 ;
+  std::vector< std::string >::value_type *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:StringVector_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_insert" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "StringVector_insert" "', argument " "2"" of type '" "std::vector< std::string >::iterator""'");
+    }
+  }
+  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "StringVector_insert" "', argument " "3"" of type '" "std::vector< std::string >::size_type""'");
+  } 
+  arg3 = static_cast< std::vector< std::string >::size_type >(val3);
+  {
+    std::string *ptr = (std::string *)0;
+    res4 = SWIG_AsPtr_std_string(obj3, &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "StringVector_insert" "', argument " "4"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "StringVector_insert" "', argument " "4"" of type '" "std::vector< std::string >::value_type const &""'"); 
+    }
+    arg4 = ptr;
+  }
+  (arg1)->insert(arg2,arg3,(std::vector< std::string >::value_type const &)*arg4);
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_insert(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+      if (_v) {
+        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_StringVector_insert__SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_size_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_StringVector_insert__SWIG_1(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'StringVector_insert'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< std::string >::insert(std::vector< std::string >::iterator,std::vector< std::string >::value_type const &)\n"
+    "    std::vector< std::string >::insert(std::vector< std::string >::iterator,std::vector< std::string >::size_type,std::vector< std::string >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:StringVector_reserve",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_reserve" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "StringVector_reserve" "', argument " "2"" of type '" "std::vector< std::string >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+  (arg1)->reserve(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_StringVector_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:StringVector_capacity",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "StringVector_capacity" "', argument " "1"" of type '" "std::vector< std::string > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = ((std::vector< std::string > const *)arg1)->capacity();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_StringVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_StringVector",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_StringVector" "', argument " "1"" of type '" "std::vector< std::string > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *StringVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_VarsVector_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_iterator" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (swig::SwigPyIterator *)std_vector_Sl_CdiVariable_Sg__iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector___nonzero__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___nonzero__" "', argument " "1"" of type '" "std::vector< CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (bool)std_vector_Sl_CdiVariable_Sg____nonzero__((std::vector< CdiVariable > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector___bool__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___bool__" "', argument " "1"" of type '" "std::vector< CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (bool)std_vector_Sl_CdiVariable_Sg____bool__((std::vector< CdiVariable > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector___len__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___len__" "', argument " "1"" of type '" "std::vector< CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = std_vector_Sl_CdiVariable_Sg____len__((std::vector< CdiVariable > const *)arg1);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_pop(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable >::value_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_pop",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_pop" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  try {
+    result = std_vector_Sl_CdiVariable_Sg__pop(arg1);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj((new std::vector< CdiVariable >::value_type(static_cast< const std::vector< CdiVariable >::value_type& >(result))), SWIGTYPE_p_CdiVariable, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___getslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  std::vector< CdiVariable >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsVector___getslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___getslice__" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsVector___getslice__" "', argument " "2"" of type '" "std::vector< CdiVariable >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VarsVector___getslice__" "', argument " "3"" of type '" "std::vector< CdiVariable >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< CdiVariable >::difference_type >(val3);
+  try {
+    result = (std::vector< CdiVariable,std::allocator< CdiVariable > > *)std_vector_Sl_CdiVariable_Sg____getslice__(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___setslice____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  std::vector< CdiVariable >::difference_type arg3 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:VarsVector___setslice__",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___setslice__" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsVector___setslice__" "', argument " "2"" of type '" "std::vector< CdiVariable >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VarsVector___setslice__" "', argument " "3"" of type '" "std::vector< CdiVariable >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< CdiVariable >::difference_type >(val3);
+  {
+    std::vector<CdiVariable,std::allocator< CdiVariable > > *ptr = (std::vector<CdiVariable,std::allocator< CdiVariable > > *)0;
+    res4 = swig::asptr(obj3, &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VarsVector___setslice__" "', argument " "4"" of type '" "std::vector< CdiVariable,std::allocator< CdiVariable > > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsVector___setslice__" "', argument " "4"" of type '" "std::vector< CdiVariable,std::allocator< CdiVariable > > const &""'"); 
+    }
+    arg4 = ptr;
+  }
+  try {
+    std_vector_Sl_CdiVariable_Sg____setslice____SWIG_0(arg1,arg2,arg3,(std::vector< CdiVariable,std::allocator< CdiVariable > > const &)*arg4);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___setslice____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  std::vector< CdiVariable >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsVector___setslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___setslice__" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsVector___setslice__" "', argument " "2"" of type '" "std::vector< CdiVariable >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VarsVector___setslice__" "', argument " "3"" of type '" "std::vector< CdiVariable >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< CdiVariable >::difference_type >(val3);
+  try {
+    std_vector_Sl_CdiVariable_Sg____setslice____SWIG_0(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___setslice__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_VarsVector___setslice____SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_VarsVector___setslice____SWIG_0(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'VarsVector___setslice__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< CdiVariable >::__setslice__(std::vector< CdiVariable >::difference_type,std::vector< CdiVariable >::difference_type,std::vector< CdiVariable,std::allocator< CdiVariable > > const &)\n"
+    "    std::vector< CdiVariable >::__setslice__(std::vector< CdiVariable >::difference_type,std::vector< CdiVariable >::difference_type)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___delslice__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  std::vector< CdiVariable >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsVector___delslice__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___delslice__" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsVector___delslice__" "', argument " "2"" of type '" "std::vector< CdiVariable >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VarsVector___delslice__" "', argument " "3"" of type '" "std::vector< CdiVariable >::difference_type""'");
+  } 
+  arg3 = static_cast< std::vector< CdiVariable >::difference_type >(val3);
+  try {
+    std_vector_Sl_CdiVariable_Sg____delslice__(arg1,arg2,arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___delitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsVector___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___delitem__" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsVector___delitem__" "', argument " "2"" of type '" "std::vector< CdiVariable >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  try {
+    std_vector_Sl_CdiVariable_Sg____delitem____SWIG_0(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___getitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsVector___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___getitem__" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector___getitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    result = (std::vector< CdiVariable,std::allocator< CdiVariable > > *)std_vector_Sl_CdiVariable_Sg____getitem____SWIG_0(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___setitem__" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  {
+    std::vector<CdiVariable,std::allocator< CdiVariable > > *ptr = (std::vector<CdiVariable,std::allocator< CdiVariable > > *)0;
+    res3 = swig::asptr(obj2, &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VarsVector___setitem__" "', argument " "3"" of type '" "std::vector< CdiVariable,std::allocator< CdiVariable > > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsVector___setitem__" "', argument " "3"" of type '" "std::vector< CdiVariable,std::allocator< CdiVariable > > const &""'"); 
+    }
+    arg3 = ptr;
+  }
+  try {
+    std_vector_Sl_CdiVariable_Sg____setitem____SWIG_0(arg1,arg2,(std::vector< CdiVariable,std::allocator< CdiVariable > > const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsVector___setitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___setitem__" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector___setitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    std_vector_Sl_CdiVariable_Sg____setitem____SWIG_1(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___delitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  PySliceObject *arg2 = (PySliceObject *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsVector___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___delitem__" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  {
+    if (!PySlice_Check(obj1)) {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector___delitem__" "', argument " "2"" of type '" "PySliceObject *""'");
+    }
+    arg2 = (PySliceObject *) obj1;
+  }
+  try {
+    std_vector_Sl_CdiVariable_Sg____delitem____SWIG_1(arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___delitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_VarsVector___delitem____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_VarsVector___delitem____SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'VarsVector___delitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< CdiVariable >::__delitem__(std::vector< CdiVariable >::difference_type)\n"
+    "    std::vector< CdiVariable >::__delitem__(PySliceObject *)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___getitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< CdiVariable >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsVector___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___getitem__" "', argument " "1"" of type '" "std::vector< CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsVector___getitem__" "', argument " "2"" of type '" "std::vector< CdiVariable >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  try {
+    result = (std::vector< CdiVariable >::value_type *) &std_vector_Sl_CdiVariable_Sg____getitem____SWIG_1((std::vector< CdiVariable > const *)arg1,arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiVariable, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___getitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_VarsVector___getitem____SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_VarsVector___getitem____SWIG_1(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'VarsVector___getitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< CdiVariable >::__getitem__(PySliceObject *)\n"
+    "    std::vector< CdiVariable >::__getitem__(std::vector< CdiVariable >::difference_type) const\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___setitem____SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  std::vector< CdiVariable >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsVector___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector___setitem__" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsVector___setitem__" "', argument " "2"" of type '" "std::vector< CdiVariable >::difference_type""'");
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CdiVariable,  0  | 0);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VarsVector___setitem__" "', argument " "3"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsVector___setitem__" "', argument " "3"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  arg3 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp3);
+  try {
+    std_vector_Sl_CdiVariable_Sg____setitem____SWIG_2(arg1,arg2,(CdiVariable const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector___setitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        return _wrap_VarsVector___setitem____SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        _v = PySlice_Check(argv[1]);
+      }
+      if (_v) {
+        int res = swig::asptr(argv[2], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_VarsVector___setitem____SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CdiVariable, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_VarsVector___setitem____SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'VarsVector___setitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< CdiVariable >::__setitem__(PySliceObject *,std::vector< CdiVariable,std::allocator< CdiVariable > > const &)\n"
+    "    std::vector< CdiVariable >::__setitem__(PySliceObject *)\n"
+    "    std::vector< CdiVariable >::__setitem__(std::vector< CdiVariable >::difference_type,std::vector< CdiVariable >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_append(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsVector_append",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_append" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_CdiVariable,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsVector_append" "', argument " "2"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsVector_append" "', argument " "2"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp2);
+  std_vector_Sl_CdiVariable_Sg__append(arg1,(CdiVariable const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_VarsVector__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_VarsVector")) SWIG_fail;
+  result = (std::vector< CdiVariable > *)new std::vector< CdiVariable >();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_VarsVector__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_VarsVector",&obj0)) SWIG_fail;
+  {
+    std::vector<CdiVariable,std::allocator< CdiVariable > > *ptr = (std::vector<CdiVariable,std::allocator< CdiVariable > > *)0;
+    res1 = swig::asptr(obj0, &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VarsVector" "', argument " "1"" of type '" "std::vector< CdiVariable > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VarsVector" "', argument " "1"" of type '" "std::vector< CdiVariable > const &""'"); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::vector< CdiVariable > *)new std::vector< CdiVariable >((std::vector< CdiVariable > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_empty",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_empty" "', argument " "1"" of type '" "std::vector< CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (bool)((std::vector< CdiVariable > const *)arg1)->empty();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_size",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_size" "', argument " "1"" of type '" "std::vector< CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = ((std::vector< CdiVariable > const *)arg1)->size();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_clear" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  (arg1)->clear();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsVector_swap",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_swap" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsVector_swap" "', argument " "2"" of type '" "std::vector< CdiVariable > &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsVector_swap" "', argument " "2"" of type '" "std::vector< CdiVariable > &""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< CdiVariable > * >(argp2);
+  (arg1)->swap(*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::allocator< CdiVariable > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_get_allocator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_get_allocator" "', argument " "1"" of type '" "std::vector< CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = ((std::vector< CdiVariable > const *)arg1)->get_allocator();
+  resultobj = SWIG_NewPointerObj((new std::vector< CdiVariable >::allocator_type(static_cast< const std::vector< CdiVariable >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_CdiVariable_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_begin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_begin" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (arg1)->begin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_end",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_end" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (arg1)->end();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_rbegin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_rbegin" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (arg1)->rbegin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< CdiVariable >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_rend",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_rend" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (arg1)->rend();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< CdiVariable >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_VarsVector__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable >::size_type arg1 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_VarsVector",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VarsVector" "', argument " "1"" of type '" "std::vector< CdiVariable >::size_type""'");
+  } 
+  arg1 = static_cast< std::vector< CdiVariable >::size_type >(val1);
+  result = (std::vector< CdiVariable > *)new std::vector< CdiVariable >(arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_pop_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_pop_back",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_pop_back" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  (arg1)->pop_back();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_resize__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsVector_resize",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_resize" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsVector_resize" "', argument " "2"" of type '" "std::vector< CdiVariable >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::size_type >(val2);
+  (arg1)->resize(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsVector_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_erase" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector_erase" "', argument " "2"" of type '" "std::vector< CdiVariable >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector_erase" "', argument " "2"" of type '" "std::vector< CdiVariable >::iterator""'");
+    }
+  }
+  result = (arg1)->erase(arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::iterator arg2 ;
+  std::vector< CdiVariable >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  swig::SwigPyIterator *iter3 = 0 ;
+  int res3 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsVector_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_erase" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector_erase" "', argument " "2"" of type '" "std::vector< CdiVariable >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector_erase" "', argument " "2"" of type '" "std::vector< CdiVariable >::iterator""'");
+    }
+  }
+  res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector_erase" "', argument " "3"" of type '" "std::vector< CdiVariable >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector_erase" "', argument " "3"" of type '" "std::vector< CdiVariable >::iterator""'");
+    }
+  }
+  result = (arg1)->erase(arg2,arg3);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_erase(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_VarsVector_erase__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::SwigPyIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_VarsVector_erase__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'VarsVector_erase'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< CdiVariable >::erase(std::vector< CdiVariable >::iterator)\n"
+    "    std::vector< CdiVariable >::erase(std::vector< CdiVariable >::iterator,std::vector< CdiVariable >::iterator)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_VarsVector__SWIG_3(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable >::size_type arg1 ;
+  std::vector< CdiVariable >::value_type *arg2 = 0 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::vector< CdiVariable > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:new_VarsVector",&obj0,&obj1)) SWIG_fail;
+  ecode1 = SWIG_AsVal_size_t(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_VarsVector" "', argument " "1"" of type '" "std::vector< CdiVariable >::size_type""'");
+  } 
+  arg1 = static_cast< std::vector< CdiVariable >::size_type >(val1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_CdiVariable,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "new_VarsVector" "', argument " "2"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VarsVector" "', argument " "2"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp2);
+  result = (std::vector< CdiVariable > *)new std::vector< CdiVariable >(arg1,(std::vector< CdiVariable >::value_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_VarsVector(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_VarsVector__SWIG_0(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_VarsVector__SWIG_2(self, args);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_VarsVector__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      int res = SWIG_ConvertPtr(argv[1], 0, SWIGTYPE_p_CdiVariable, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_new_VarsVector__SWIG_3(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_VarsVector'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< CdiVariable >::vector()\n"
+    "    std::vector< CdiVariable >::vector(std::vector< CdiVariable > const &)\n"
+    "    std::vector< CdiVariable >::vector(std::vector< CdiVariable >::size_type)\n"
+    "    std::vector< CdiVariable >::vector(std::vector< CdiVariable >::size_type,std::vector< CdiVariable >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_push_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsVector_push_back",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_push_back" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_CdiVariable,  0  | 0);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsVector_push_back" "', argument " "2"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsVector_push_back" "', argument " "2"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp2);
+  (arg1)->push_back((std::vector< CdiVariable >::value_type const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_front(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_front",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_front" "', argument " "1"" of type '" "std::vector< CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (std::vector< CdiVariable >::value_type *) &((std::vector< CdiVariable > const *)arg1)->front();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiVariable, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_back(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable >::value_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_back",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_back" "', argument " "1"" of type '" "std::vector< CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (std::vector< CdiVariable >::value_type *) &((std::vector< CdiVariable > const *)arg1)->back();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiVariable, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_assign(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::size_type arg2 ;
+  std::vector< CdiVariable >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsVector_assign",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_assign" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsVector_assign" "', argument " "2"" of type '" "std::vector< CdiVariable >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::size_type >(val2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CdiVariable,  0  | 0);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VarsVector_assign" "', argument " "3"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsVector_assign" "', argument " "3"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  arg3 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp3);
+  (arg1)->assign(arg2,(std::vector< CdiVariable >::value_type const &)*arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_resize__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::size_type arg2 ;
+  std::vector< CdiVariable >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsVector_resize",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_resize" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsVector_resize" "', argument " "2"" of type '" "std::vector< CdiVariable >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::size_type >(val2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CdiVariable,  0  | 0);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VarsVector_resize" "', argument " "3"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsVector_resize" "', argument " "3"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  arg3 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp3);
+  (arg1)->resize(arg2,(std::vector< CdiVariable >::value_type const &)*arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_resize(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_VarsVector_resize__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CdiVariable, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_VarsVector_resize__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'VarsVector_resize'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< CdiVariable >::resize(std::vector< CdiVariable >::size_type)\n"
+    "    std::vector< CdiVariable >::resize(std::vector< CdiVariable >::size_type,std::vector< CdiVariable >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_insert__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::iterator arg2 ;
+  std::vector< CdiVariable >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  std::vector< CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsVector_insert",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_insert" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector_insert" "', argument " "2"" of type '" "std::vector< CdiVariable >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector_insert" "', argument " "2"" of type '" "std::vector< CdiVariable >::iterator""'");
+    }
+  }
+  res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CdiVariable,  0  | 0);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VarsVector_insert" "', argument " "3"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsVector_insert" "', argument " "3"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  arg3 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp3);
+  result = (arg1)->insert(arg2,(std::vector< CdiVariable >::value_type const &)*arg3);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::vector< CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_insert__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::iterator arg2 ;
+  std::vector< CdiVariable >::size_type arg3 ;
+  std::vector< CdiVariable >::value_type *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  PyObject * obj3 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOOO:VarsVector_insert",&obj0,&obj1,&obj2,&obj3)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_insert" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector_insert" "', argument " "2"" of type '" "std::vector< CdiVariable >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsVector_insert" "', argument " "2"" of type '" "std::vector< CdiVariable >::iterator""'");
+    }
+  }
+  ecode3 = SWIG_AsVal_size_t(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "VarsVector_insert" "', argument " "3"" of type '" "std::vector< CdiVariable >::size_type""'");
+  } 
+  arg3 = static_cast< std::vector< CdiVariable >::size_type >(val3);
+  res4 = SWIG_ConvertPtr(obj3, &argp4, SWIGTYPE_p_CdiVariable,  0  | 0);
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "VarsVector_insert" "', argument " "4"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  if (!argp4) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsVector_insert" "', argument " "4"" of type '" "std::vector< CdiVariable >::value_type const &""'"); 
+  }
+  arg4 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp4);
+  (arg1)->insert(arg2,arg3,(std::vector< CdiVariable >::value_type const &)*arg4);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_insert(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[5];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 4) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CdiVariable, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_VarsVector_insert__SWIG_0(self, args);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::vector< CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_size_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = SWIG_ConvertPtr(argv[3], 0, SWIGTYPE_p_CdiVariable, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_VarsVector_insert__SWIG_1(self, args);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'VarsVector_insert'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::vector< CdiVariable >::insert(std::vector< CdiVariable >::iterator,std::vector< CdiVariable >::value_type const &)\n"
+    "    std::vector< CdiVariable >::insert(std::vector< CdiVariable >::iterator,std::vector< CdiVariable >::size_type,std::vector< CdiVariable >::value_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_reserve(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsVector_reserve",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_reserve" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsVector_reserve" "', argument " "2"" of type '" "std::vector< CdiVariable >::size_type""'");
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::size_type >(val2);
+  (arg1)->reserve(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsVector_capacity(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsVector_capacity",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsVector_capacity" "', argument " "1"" of type '" "std::vector< CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = ((std::vector< CdiVariable > const *)arg1)->capacity();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_VarsVector(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_VarsVector",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VarsVector" "', argument " "1"" of type '" "std::vector< CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *VarsVector_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_VarsMap__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::less< std::string > *arg1 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< std::string,CdiVariable > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_VarsMap",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__lessT_std__string_t,  0  | 0);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VarsMap" "', argument " "1"" of type '" "std::less< std::string > const &""'"); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VarsMap" "', argument " "1"" of type '" "std::less< std::string > const &""'"); 
+  }
+  arg1 = reinterpret_cast< std::less< std::string > * >(argp1);
+  result = (std::map< std::string,CdiVariable > *)new std::map< std::string,CdiVariable >((std::less< std::string > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_iterator" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_std_string_Sc_CdiVariable_Sg__iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap___nonzero__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap___nonzero__" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (bool)std_map_Sl_std_string_Sc_CdiVariable_Sg____nonzero__((std::map< std::string,CdiVariable > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap___bool__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap___bool__" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (bool)std_map_Sl_std_string_Sc_CdiVariable_Sg____bool__((std::map< std::string,CdiVariable > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< std::string,CdiVariable >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap___len__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap___len__" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = std_map_Sl_std_string_Sc_CdiVariable_Sg____len__((std::map< std::string,CdiVariable > const *)arg1);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< std::string,CdiVariable >::mapped_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap___getitem__" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap___getitem__" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap___getitem__" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  try {
+    result = (std::map< std::string,CdiVariable >::mapped_type *) &std_map_Sl_std_string_Sc_CdiVariable_Sg____getitem__(arg1,(std::string const &)*arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap___delitem__" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap___delitem__" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap___delitem__" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  try {
+    std_map_Sl_std_string_Sc_CdiVariable_Sg____delitem__(arg1,(std::string const &)*arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_has_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap_has_key",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_has_key" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap_has_key" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap_has_key" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  result = (bool)std_map_Sl_std_string_Sc_CdiVariable_Sg__has_key((std::map< std::string,CdiVariable > const *)arg1,(std::string const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_keys",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_keys" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (PyObject *)std_map_Sl_std_string_Sc_CdiVariable_Sg__keys(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_values",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_values" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (PyObject *)std_map_Sl_std_string_Sc_CdiVariable_Sg__values(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_items(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_items",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_items" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (PyObject *)std_map_Sl_std_string_Sc_CdiVariable_Sg__items(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap___contains__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap___contains__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap___contains__" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap___contains__" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap___contains__" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  result = (bool)std_map_Sl_std_string_Sc_CdiVariable_Sg____contains__(arg1,(std::string const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_key_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_key_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_key_iterator" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_std_string_Sc_CdiVariable_Sg__key_iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_value_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_value_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_value_iterator" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_std_string_Sc_CdiVariable_Sg__value_iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap___setitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap___setitem__" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap___setitem__" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap___setitem__" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  std_map_Sl_std_string_Sc_CdiVariable_Sg____setitem____SWIG_0(arg1,(std::string const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  std::map< std::string,CdiVariable >::mapped_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsMap___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap___setitem__" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap___setitem__" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap___setitem__" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CdiVariable,  0  | 0);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VarsMap___setitem__" "', argument " "3"" of type '" "std::map< std::string,CdiVariable >::mapped_type const &""'"); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap___setitem__" "', argument " "3"" of type '" "std::map< std::string,CdiVariable >::mapped_type const &""'"); 
+  }
+  arg3 = reinterpret_cast< std::map< std::string,CdiVariable >::mapped_type * >(argp3);
+  try {
+    std_map_Sl_std_string_Sc_CdiVariable_Sg____setitem____SWIG_1(arg1,(std::string const &)*arg2,(CdiVariable const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap___setitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_VarsMap___setitem____SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CdiVariable, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_VarsMap___setitem____SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'VarsMap___setitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< std::string,CdiVariable >::__setitem__(std::map< std::string,CdiVariable >::key_type const &)\n"
+    "    std::map< std::string,CdiVariable >::__setitem__(std::map< std::string,CdiVariable >::key_type const &,std::map< std::string,CdiVariable >::mapped_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_asdict(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_asdict",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_asdict" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (PyObject *)std_map_Sl_std_string_Sc_CdiVariable_Sg__asdict(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_VarsMap__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_VarsMap")) SWIG_fail;
+  result = (std::map< std::string,CdiVariable > *)new std::map< std::string,CdiVariable >();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_VarsMap__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  std::map< std::string,CdiVariable > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_VarsMap",&obj0)) SWIG_fail;
+  {
+    std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *ptr = (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *)0;
+    res1 = swig::asptr(obj0, &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VarsMap" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VarsMap" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > const &""'"); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::map< std::string,CdiVariable > *)new std::map< std::string,CdiVariable >((std::map< std::string,CdiVariable > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_VarsMap(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[2];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 1) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_VarsMap__SWIG_1(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__lessT_std__string_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_VarsMap__SWIG_0(self, args);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_VarsMap__SWIG_2(self, args);
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_VarsMap'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< std::string,CdiVariable >::map(std::less< std::string > const &)\n"
+    "    std::map< std::string,CdiVariable >::map()\n"
+    "    std::map< std::string,CdiVariable >::map(std::map< std::string,CdiVariable > const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_empty",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_empty" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (bool)((std::map< std::string,CdiVariable > const *)arg1)->empty();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< std::string,CdiVariable >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_size",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_size" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = ((std::map< std::string,CdiVariable > const *)arg1)->size();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_clear" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  (arg1)->clear();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap_swap",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_swap" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap_swap" "', argument " "2"" of type '" "std::map< std::string,CdiVariable > &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap_swap" "', argument " "2"" of type '" "std::map< std::string,CdiVariable > &""'"); 
+  }
+  arg2 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp2);
+  (arg1)->swap(*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::allocator< std::pair< std::string const,CdiVariable > > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_get_allocator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_get_allocator" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = ((std::map< std::string,CdiVariable > const *)arg1)->get_allocator();
+  resultobj = SWIG_NewPointerObj((new std::map< std::string,CdiVariable >::allocator_type(static_cast< const std::map< std::string,CdiVariable >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< std::string,CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_begin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_begin" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (arg1)->begin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< std::string,CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_end",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_end" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (arg1)->end();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< std::string,CdiVariable >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_rbegin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_rbegin" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (arg1)->rbegin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,CdiVariable >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< std::string,CdiVariable >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsMap_rend",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_rend" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (arg1)->rend();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,CdiVariable >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< std::string,CdiVariable >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_erase" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap_erase" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap_erase" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  result = (arg1)->erase((std::map< std::string,CdiVariable >::key_type const &)*arg2);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< std::string,CdiVariable >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap_count",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_count" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap_count" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap_count" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  result = ((std::map< std::string,CdiVariable > const *)arg1)->count((std::map< std::string,CdiVariable >::key_type const &)*arg2);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_erase" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsMap_erase" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< std::string,CdiVariable >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsMap_erase" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::iterator""'");
+    }
+  }
+  (arg1)->erase(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_erase__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::iterator arg2 ;
+  std::map< std::string,CdiVariable >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  swig::SwigPyIterator *iter3 = 0 ;
+  int res3 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsMap_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_erase" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsMap_erase" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< std::string,CdiVariable >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsMap_erase" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::iterator""'");
+    }
+  }
+  res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsMap_erase" "', argument " "3"" of type '" "std::map< std::string,CdiVariable >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< std::string,CdiVariable >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,CdiVariable >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsMap_erase" "', argument " "3"" of type '" "std::map< std::string,CdiVariable >::iterator""'");
+    }
+  }
+  (arg1)->erase(arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_erase(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_VarsMap_erase__SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_VarsMap_erase__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::SwigPyIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< std::string,CdiVariable >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_VarsMap_erase__SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'VarsMap_erase'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< std::string,CdiVariable >::erase(std::map< std::string,CdiVariable >::key_type const &)\n"
+    "    std::map< std::string,CdiVariable >::erase(std::map< std::string,CdiVariable >::iterator)\n"
+    "    std::map< std::string,CdiVariable >::erase(std::map< std::string,CdiVariable >::iterator,std::map< std::string,CdiVariable >::iterator)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_find(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< std::string,CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap_find",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_find" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap_find" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap_find" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  result = (arg1)->find((std::map< std::string,CdiVariable >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_lower_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< std::string,CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap_lower_bound",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_lower_bound" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap_lower_bound" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap_lower_bound" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  result = (arg1)->lower_bound((std::map< std::string,CdiVariable >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsMap_upper_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< std::string,CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsMap_upper_bound",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsMap_upper_bound" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsMap_upper_bound" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsMap_upper_bound" "', argument " "2"" of type '" "std::map< std::string,CdiVariable >::key_type const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  result = (arg1)->upper_bound((std::map< std::string,CdiVariable >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< std::string,CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_VarsMap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_VarsMap",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VarsMap" "', argument " "1"" of type '" "std::map< std::string,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *VarsMap_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_VarsByCode__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::less< int > *arg1 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiVariable > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_VarsByCode",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__lessT_int_t,  0  | 0);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VarsByCode" "', argument " "1"" of type '" "std::less< int > const &""'"); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VarsByCode" "', argument " "1"" of type '" "std::less< int > const &""'"); 
+  }
+  arg1 = reinterpret_cast< std::less< int > * >(argp1);
+  result = (std::map< int,CdiVariable > *)new std::map< int,CdiVariable >((std::less< int > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_iterator" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiVariable_Sg__iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode___nonzero__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode___nonzero__" "', argument " "1"" of type '" "std::map< int,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (bool)std_map_Sl_int_Sc_CdiVariable_Sg____nonzero__((std::map< int,CdiVariable > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode___bool__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode___bool__" "', argument " "1"" of type '" "std::map< int,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (bool)std_map_Sl_int_Sc_CdiVariable_Sg____bool__((std::map< int,CdiVariable > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiVariable >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode___len__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode___len__" "', argument " "1"" of type '" "std::map< int,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = std_map_Sl_int_Sc_CdiVariable_Sg____len__((std::map< int,CdiVariable > const *)arg1);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiVariable >::mapped_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode___getitem__" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsByCode___getitem__" "', argument " "2"" of type '" "std::map< int,CdiVariable >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  try {
+    result = (std::map< int,CdiVariable >::mapped_type *) &std_map_Sl_int_Sc_CdiVariable_Sg____getitem__(arg1,(int const &)*arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiVariable, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode___delitem__" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsByCode___delitem__" "', argument " "2"" of type '" "std::map< int,CdiVariable >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  try {
+    std_map_Sl_int_Sc_CdiVariable_Sg____delitem__(arg1,(int const &)*arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_has_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode_has_key",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_has_key" "', argument " "1"" of type '" "std::map< int,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsByCode_has_key" "', argument " "2"" of type '" "std::map< int,CdiVariable >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiVariable_Sg__has_key((std::map< int,CdiVariable > const *)arg1,(int const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_keys",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_keys" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiVariable_Sg__keys(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_values",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_values" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiVariable_Sg__values(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_items(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_items",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_items" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiVariable_Sg__items(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode___contains__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode___contains__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode___contains__" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsByCode___contains__" "', argument " "2"" of type '" "std::map< int,CdiVariable >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiVariable_Sg____contains__(arg1,(int const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_key_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_key_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_key_iterator" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiVariable_Sg__key_iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_value_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_value_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_value_iterator" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiVariable_Sg__value_iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode___setitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode___setitem__" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsByCode___setitem__" "', argument " "2"" of type '" "std::map< int,CdiVariable >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  std_map_Sl_int_Sc_CdiVariable_Sg____setitem____SWIG_0(arg1,(int const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  std::map< int,CdiVariable >::mapped_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsByCode___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode___setitem__" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsByCode___setitem__" "', argument " "2"" of type '" "std::map< int,CdiVariable >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CdiVariable,  0  | 0);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "VarsByCode___setitem__" "', argument " "3"" of type '" "std::map< int,CdiVariable >::mapped_type const &""'"); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsByCode___setitem__" "', argument " "3"" of type '" "std::map< int,CdiVariable >::mapped_type const &""'"); 
+  }
+  arg3 = reinterpret_cast< std::map< int,CdiVariable >::mapped_type * >(argp3);
+  try {
+    std_map_Sl_int_Sc_CdiVariable_Sg____setitem____SWIG_1(arg1,(int const &)*arg2,(CdiVariable const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode___setitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_VarsByCode___setitem____SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CdiVariable, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_VarsByCode___setitem____SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'VarsByCode___setitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiVariable >::__setitem__(std::map< int,CdiVariable >::key_type const &)\n"
+    "    std::map< int,CdiVariable >::__setitem__(std::map< int,CdiVariable >::key_type const &,std::map< int,CdiVariable >::mapped_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_asdict(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_asdict",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_asdict" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiVariable_Sg__asdict(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_VarsByCode__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_VarsByCode")) SWIG_fail;
+  result = (std::map< int,CdiVariable > *)new std::map< int,CdiVariable >();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_VarsByCode__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiVariable > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_VarsByCode",&obj0)) SWIG_fail;
+  {
+    std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *ptr = (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *)0;
+    res1 = swig::asptr(obj0, &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_VarsByCode" "', argument " "1"" of type '" "std::map< int,CdiVariable > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_VarsByCode" "', argument " "1"" of type '" "std::map< int,CdiVariable > const &""'"); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::map< int,CdiVariable > *)new std::map< int,CdiVariable >((std::map< int,CdiVariable > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_VarsByCode(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[2];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 1) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_VarsByCode__SWIG_1(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__lessT_int_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_VarsByCode__SWIG_0(self, args);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_VarsByCode__SWIG_2(self, args);
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_VarsByCode'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiVariable >::map(std::less< int > const &)\n"
+    "    std::map< int,CdiVariable >::map()\n"
+    "    std::map< int,CdiVariable >::map(std::map< int,CdiVariable > const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_empty",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_empty" "', argument " "1"" of type '" "std::map< int,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (bool)((std::map< int,CdiVariable > const *)arg1)->empty();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiVariable >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_size",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_size" "', argument " "1"" of type '" "std::map< int,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = ((std::map< int,CdiVariable > const *)arg1)->size();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_clear" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  (arg1)->clear();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode_swap",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_swap" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "VarsByCode_swap" "', argument " "2"" of type '" "std::map< int,CdiVariable > &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "VarsByCode_swap" "', argument " "2"" of type '" "std::map< int,CdiVariable > &""'"); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiVariable > * >(argp2);
+  (arg1)->swap(*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::allocator< std::pair< int const,CdiVariable > > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_get_allocator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_get_allocator" "', argument " "1"" of type '" "std::map< int,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = ((std::map< int,CdiVariable > const *)arg1)->get_allocator();
+  resultobj = SWIG_NewPointerObj((new std::map< int,CdiVariable >::allocator_type(static_cast< const std::map< int,CdiVariable >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_begin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_begin" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (arg1)->begin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_end",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_end" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (arg1)->end();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiVariable >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_rbegin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_rbegin" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (arg1)->rbegin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiVariable >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiVariable >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:VarsByCode_rend",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_rend" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (arg1)->rend();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiVariable >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiVariable >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_erase" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsByCode_erase" "', argument " "2"" of type '" "std::map< int,CdiVariable >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->erase((std::map< int,CdiVariable >::key_type const &)*arg2);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiVariable >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode_count",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_count" "', argument " "1"" of type '" "std::map< int,CdiVariable > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsByCode_count" "', argument " "2"" of type '" "std::map< int,CdiVariable >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = ((std::map< int,CdiVariable > const *)arg1)->count((std::map< int,CdiVariable >::key_type const &)*arg2);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_erase" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsByCode_erase" "', argument " "2"" of type '" "std::map< int,CdiVariable >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiVariable >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsByCode_erase" "', argument " "2"" of type '" "std::map< int,CdiVariable >::iterator""'");
+    }
+  }
+  (arg1)->erase(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_erase__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::iterator arg2 ;
+  std::map< int,CdiVariable >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  swig::SwigPyIterator *iter3 = 0 ;
+  int res3 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:VarsByCode_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_erase" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsByCode_erase" "', argument " "2"" of type '" "std::map< int,CdiVariable >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiVariable >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsByCode_erase" "', argument " "2"" of type '" "std::map< int,CdiVariable >::iterator""'");
+    }
+  }
+  res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsByCode_erase" "', argument " "3"" of type '" "std::map< int,CdiVariable >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiVariable >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiVariable >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "VarsByCode_erase" "', argument " "3"" of type '" "std::map< int,CdiVariable >::iterator""'");
+    }
+  }
+  (arg1)->erase(arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_erase(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_VarsByCode_erase__SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_VarsByCode_erase__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::SwigPyIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiVariable >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_VarsByCode_erase__SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'VarsByCode_erase'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiVariable >::erase(std::map< int,CdiVariable >::key_type const &)\n"
+    "    std::map< int,CdiVariable >::erase(std::map< int,CdiVariable >::iterator)\n"
+    "    std::map< int,CdiVariable >::erase(std::map< int,CdiVariable >::iterator,std::map< int,CdiVariable >::iterator)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_find(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode_find",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_find" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsByCode_find" "', argument " "2"" of type '" "std::map< int,CdiVariable >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->find((std::map< int,CdiVariable >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_lower_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode_lower_bound",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_lower_bound" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsByCode_lower_bound" "', argument " "2"" of type '" "std::map< int,CdiVariable >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->lower_bound((std::map< int,CdiVariable >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_VarsByCode_upper_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiVariable >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:VarsByCode_upper_bound",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "VarsByCode_upper_bound" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "VarsByCode_upper_bound" "', argument " "2"" of type '" "std::map< int,CdiVariable >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->upper_bound((std::map< int,CdiVariable >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiVariable >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_VarsByCode(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_VarsByCode",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_VarsByCode" "', argument " "1"" of type '" "std::map< int,CdiVariable > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *VarsByCode_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_TaxesMap__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::less< int > *arg1 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiTaxis > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_TaxesMap",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__lessT_int_t,  0  | 0);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_TaxesMap" "', argument " "1"" of type '" "std::less< int > const &""'"); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_TaxesMap" "', argument " "1"" of type '" "std::less< int > const &""'"); 
+  }
+  arg1 = reinterpret_cast< std::less< int > * >(argp1);
+  result = (std::map< int,CdiTaxis > *)new std::map< int,CdiTaxis >((std::less< int > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_iterator" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiTaxis_Sg__iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap___nonzero__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap___nonzero__" "', argument " "1"" of type '" "std::map< int,CdiTaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (bool)std_map_Sl_int_Sc_CdiTaxis_Sg____nonzero__((std::map< int,CdiTaxis > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap___bool__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap___bool__" "', argument " "1"" of type '" "std::map< int,CdiTaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (bool)std_map_Sl_int_Sc_CdiTaxis_Sg____bool__((std::map< int,CdiTaxis > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiTaxis >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap___len__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap___len__" "', argument " "1"" of type '" "std::map< int,CdiTaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = std_map_Sl_int_Sc_CdiTaxis_Sg____len__((std::map< int,CdiTaxis > const *)arg1);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiTaxis >::mapped_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap___getitem__" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TaxesMap___getitem__" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  try {
+    result = (std::map< int,CdiTaxis >::mapped_type *) &std_map_Sl_int_Sc_CdiTaxis_Sg____getitem__(arg1,(int const &)*arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap___delitem__" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TaxesMap___delitem__" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  try {
+    std_map_Sl_int_Sc_CdiTaxis_Sg____delitem__(arg1,(int const &)*arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_has_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap_has_key",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_has_key" "', argument " "1"" of type '" "std::map< int,CdiTaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TaxesMap_has_key" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiTaxis_Sg__has_key((std::map< int,CdiTaxis > const *)arg1,(int const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_keys",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_keys" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiTaxis_Sg__keys(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_values",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_values" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiTaxis_Sg__values(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_items(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_items",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_items" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiTaxis_Sg__items(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap___contains__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap___contains__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap___contains__" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TaxesMap___contains__" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiTaxis_Sg____contains__(arg1,(int const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_key_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_key_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_key_iterator" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiTaxis_Sg__key_iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_value_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_value_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_value_iterator" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiTaxis_Sg__value_iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap___setitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap___setitem__" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TaxesMap___setitem__" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  std_map_Sl_int_Sc_CdiTaxis_Sg____setitem____SWIG_0(arg1,(int const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  std::map< int,CdiTaxis >::mapped_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:TaxesMap___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap___setitem__" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TaxesMap___setitem__" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CdiTaxis,  0  | 0);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "TaxesMap___setitem__" "', argument " "3"" of type '" "std::map< int,CdiTaxis >::mapped_type const &""'"); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "TaxesMap___setitem__" "', argument " "3"" of type '" "std::map< int,CdiTaxis >::mapped_type const &""'"); 
+  }
+  arg3 = reinterpret_cast< std::map< int,CdiTaxis >::mapped_type * >(argp3);
+  try {
+    std_map_Sl_int_Sc_CdiTaxis_Sg____setitem____SWIG_1(arg1,(int const &)*arg2,(CdiTaxis const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap___setitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_TaxesMap___setitem____SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CdiTaxis, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_TaxesMap___setitem____SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'TaxesMap___setitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiTaxis >::__setitem__(std::map< int,CdiTaxis >::key_type const &)\n"
+    "    std::map< int,CdiTaxis >::__setitem__(std::map< int,CdiTaxis >::key_type const &,std::map< int,CdiTaxis >::mapped_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_asdict(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_asdict",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_asdict" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiTaxis_Sg__asdict(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_TaxesMap__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_TaxesMap")) SWIG_fail;
+  result = (std::map< int,CdiTaxis > *)new std::map< int,CdiTaxis >();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_TaxesMap__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiTaxis > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_TaxesMap",&obj0)) SWIG_fail;
+  {
+    std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *ptr = (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *)0;
+    res1 = swig::asptr(obj0, &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_TaxesMap" "', argument " "1"" of type '" "std::map< int,CdiTaxis > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_TaxesMap" "', argument " "1"" of type '" "std::map< int,CdiTaxis > const &""'"); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::map< int,CdiTaxis > *)new std::map< int,CdiTaxis >((std::map< int,CdiTaxis > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_TaxesMap(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[2];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 1) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_TaxesMap__SWIG_1(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__lessT_int_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_TaxesMap__SWIG_0(self, args);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_TaxesMap__SWIG_2(self, args);
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_TaxesMap'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiTaxis >::map(std::less< int > const &)\n"
+    "    std::map< int,CdiTaxis >::map()\n"
+    "    std::map< int,CdiTaxis >::map(std::map< int,CdiTaxis > const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_empty",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_empty" "', argument " "1"" of type '" "std::map< int,CdiTaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (bool)((std::map< int,CdiTaxis > const *)arg1)->empty();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiTaxis >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_size",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_size" "', argument " "1"" of type '" "std::map< int,CdiTaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = ((std::map< int,CdiTaxis > const *)arg1)->size();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_clear" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  (arg1)->clear();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap_swap",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_swap" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "TaxesMap_swap" "', argument " "2"" of type '" "std::map< int,CdiTaxis > &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "TaxesMap_swap" "', argument " "2"" of type '" "std::map< int,CdiTaxis > &""'"); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp2);
+  (arg1)->swap(*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::allocator< std::pair< int const,CdiTaxis > > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_get_allocator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_get_allocator" "', argument " "1"" of type '" "std::map< int,CdiTaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = ((std::map< int,CdiTaxis > const *)arg1)->get_allocator();
+  resultobj = SWIG_NewPointerObj((new std::map< int,CdiTaxis >::allocator_type(static_cast< const std::map< int,CdiTaxis >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiTaxis >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_begin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_begin" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (arg1)->begin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiTaxis >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiTaxis >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_end",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_end" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (arg1)->end();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiTaxis >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiTaxis >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_rbegin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_rbegin" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (arg1)->rbegin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiTaxis >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiTaxis >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:TaxesMap_rend",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_rend" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (arg1)->rend();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiTaxis >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiTaxis >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_erase" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TaxesMap_erase" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->erase((std::map< int,CdiTaxis >::key_type const &)*arg2);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiTaxis >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap_count",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_count" "', argument " "1"" of type '" "std::map< int,CdiTaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TaxesMap_count" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = ((std::map< int,CdiTaxis > const *)arg1)->count((std::map< int,CdiTaxis >::key_type const &)*arg2);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_erase" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "TaxesMap_erase" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiTaxis >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiTaxis >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "TaxesMap_erase" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::iterator""'");
+    }
+  }
+  (arg1)->erase(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_erase__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::iterator arg2 ;
+  std::map< int,CdiTaxis >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  swig::SwigPyIterator *iter3 = 0 ;
+  int res3 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:TaxesMap_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_erase" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "TaxesMap_erase" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiTaxis >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiTaxis >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "TaxesMap_erase" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::iterator""'");
+    }
+  }
+  res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "TaxesMap_erase" "', argument " "3"" of type '" "std::map< int,CdiTaxis >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiTaxis >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiTaxis >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "TaxesMap_erase" "', argument " "3"" of type '" "std::map< int,CdiTaxis >::iterator""'");
+    }
+  }
+  (arg1)->erase(arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_erase(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiTaxis >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_TaxesMap_erase__SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_TaxesMap_erase__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiTaxis >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::SwigPyIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiTaxis >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_TaxesMap_erase__SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'TaxesMap_erase'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiTaxis >::erase(std::map< int,CdiTaxis >::key_type const &)\n"
+    "    std::map< int,CdiTaxis >::erase(std::map< int,CdiTaxis >::iterator)\n"
+    "    std::map< int,CdiTaxis >::erase(std::map< int,CdiTaxis >::iterator,std::map< int,CdiTaxis >::iterator)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_find(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiTaxis >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap_find",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_find" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TaxesMap_find" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->find((std::map< int,CdiTaxis >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiTaxis >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_lower_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiTaxis >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap_lower_bound",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_lower_bound" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TaxesMap_lower_bound" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->lower_bound((std::map< int,CdiTaxis >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiTaxis >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_TaxesMap_upper_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiTaxis >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:TaxesMap_upper_bound",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "TaxesMap_upper_bound" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "TaxesMap_upper_bound" "', argument " "2"" of type '" "std::map< int,CdiTaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->upper_bound((std::map< int,CdiTaxis >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiTaxis >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_TaxesMap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_TaxesMap",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_TaxesMap" "', argument " "1"" of type '" "std::map< int,CdiTaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *TaxesMap_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_ZaxesMap__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::less< int > *arg1 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiZaxis > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_ZaxesMap",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__lessT_int_t,  0  | 0);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ZaxesMap" "', argument " "1"" of type '" "std::less< int > const &""'"); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ZaxesMap" "', argument " "1"" of type '" "std::less< int > const &""'"); 
+  }
+  arg1 = reinterpret_cast< std::less< int > * >(argp1);
+  result = (std::map< int,CdiZaxis > *)new std::map< int,CdiZaxis >((std::less< int > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_iterator" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiZaxis_Sg__iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap___nonzero__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap___nonzero__" "', argument " "1"" of type '" "std::map< int,CdiZaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (bool)std_map_Sl_int_Sc_CdiZaxis_Sg____nonzero__((std::map< int,CdiZaxis > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap___bool__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap___bool__" "', argument " "1"" of type '" "std::map< int,CdiZaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (bool)std_map_Sl_int_Sc_CdiZaxis_Sg____bool__((std::map< int,CdiZaxis > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiZaxis >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap___len__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap___len__" "', argument " "1"" of type '" "std::map< int,CdiZaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = std_map_Sl_int_Sc_CdiZaxis_Sg____len__((std::map< int,CdiZaxis > const *)arg1);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiZaxis >::mapped_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap___getitem__" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ZaxesMap___getitem__" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  try {
+    result = (std::map< int,CdiZaxis >::mapped_type *) &std_map_Sl_int_Sc_CdiZaxis_Sg____getitem__(arg1,(int const &)*arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap___delitem__" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ZaxesMap___delitem__" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  try {
+    std_map_Sl_int_Sc_CdiZaxis_Sg____delitem__(arg1,(int const &)*arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_has_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap_has_key",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_has_key" "', argument " "1"" of type '" "std::map< int,CdiZaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ZaxesMap_has_key" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiZaxis_Sg__has_key((std::map< int,CdiZaxis > const *)arg1,(int const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_keys",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_keys" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiZaxis_Sg__keys(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_values",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_values" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiZaxis_Sg__values(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_items(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_items",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_items" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiZaxis_Sg__items(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap___contains__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap___contains__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap___contains__" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ZaxesMap___contains__" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiZaxis_Sg____contains__(arg1,(int const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_key_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_key_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_key_iterator" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiZaxis_Sg__key_iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_value_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_value_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_value_iterator" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiZaxis_Sg__value_iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap___setitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap___setitem__" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ZaxesMap___setitem__" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  std_map_Sl_int_Sc_CdiZaxis_Sg____setitem____SWIG_0(arg1,(int const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  std::map< int,CdiZaxis >::mapped_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:ZaxesMap___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap___setitem__" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ZaxesMap___setitem__" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CdiZaxis,  0  | 0);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ZaxesMap___setitem__" "', argument " "3"" of type '" "std::map< int,CdiZaxis >::mapped_type const &""'"); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ZaxesMap___setitem__" "', argument " "3"" of type '" "std::map< int,CdiZaxis >::mapped_type const &""'"); 
+  }
+  arg3 = reinterpret_cast< std::map< int,CdiZaxis >::mapped_type * >(argp3);
+  try {
+    std_map_Sl_int_Sc_CdiZaxis_Sg____setitem____SWIG_1(arg1,(int const &)*arg2,(CdiZaxis const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap___setitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_ZaxesMap___setitem____SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CdiZaxis, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_ZaxesMap___setitem____SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ZaxesMap___setitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiZaxis >::__setitem__(std::map< int,CdiZaxis >::key_type const &)\n"
+    "    std::map< int,CdiZaxis >::__setitem__(std::map< int,CdiZaxis >::key_type const &,std::map< int,CdiZaxis >::mapped_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_asdict(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_asdict",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_asdict" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiZaxis_Sg__asdict(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_ZaxesMap__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_ZaxesMap")) SWIG_fail;
+  result = (std::map< int,CdiZaxis > *)new std::map< int,CdiZaxis >();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_ZaxesMap__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiZaxis > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_ZaxesMap",&obj0)) SWIG_fail;
+  {
+    std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *ptr = (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *)0;
+    res1 = swig::asptr(obj0, &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_ZaxesMap" "', argument " "1"" of type '" "std::map< int,CdiZaxis > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_ZaxesMap" "', argument " "1"" of type '" "std::map< int,CdiZaxis > const &""'"); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::map< int,CdiZaxis > *)new std::map< int,CdiZaxis >((std::map< int,CdiZaxis > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_ZaxesMap(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[2];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 1) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_ZaxesMap__SWIG_1(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__lessT_int_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_ZaxesMap__SWIG_0(self, args);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_ZaxesMap__SWIG_2(self, args);
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_ZaxesMap'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiZaxis >::map(std::less< int > const &)\n"
+    "    std::map< int,CdiZaxis >::map()\n"
+    "    std::map< int,CdiZaxis >::map(std::map< int,CdiZaxis > const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_empty",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_empty" "', argument " "1"" of type '" "std::map< int,CdiZaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (bool)((std::map< int,CdiZaxis > const *)arg1)->empty();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiZaxis >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_size",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_size" "', argument " "1"" of type '" "std::map< int,CdiZaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = ((std::map< int,CdiZaxis > const *)arg1)->size();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_clear" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  (arg1)->clear();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap_swap",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_swap" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ZaxesMap_swap" "', argument " "2"" of type '" "std::map< int,CdiZaxis > &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "ZaxesMap_swap" "', argument " "2"" of type '" "std::map< int,CdiZaxis > &""'"); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp2);
+  (arg1)->swap(*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::allocator< std::pair< int const,CdiZaxis > > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_get_allocator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_get_allocator" "', argument " "1"" of type '" "std::map< int,CdiZaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = ((std::map< int,CdiZaxis > const *)arg1)->get_allocator();
+  resultobj = SWIG_NewPointerObj((new std::map< int,CdiZaxis >::allocator_type(static_cast< const std::map< int,CdiZaxis >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiZaxis >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_begin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_begin" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (arg1)->begin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiZaxis >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiZaxis >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_end",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_end" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (arg1)->end();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiZaxis >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiZaxis >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_rbegin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_rbegin" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (arg1)->rbegin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiZaxis >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiZaxis >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:ZaxesMap_rend",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_rend" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (arg1)->rend();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiZaxis >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiZaxis >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_erase" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ZaxesMap_erase" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->erase((std::map< int,CdiZaxis >::key_type const &)*arg2);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiZaxis >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap_count",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_count" "', argument " "1"" of type '" "std::map< int,CdiZaxis > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ZaxesMap_count" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = ((std::map< int,CdiZaxis > const *)arg1)->count((std::map< int,CdiZaxis >::key_type const &)*arg2);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_erase" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ZaxesMap_erase" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiZaxis >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiZaxis >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ZaxesMap_erase" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::iterator""'");
+    }
+  }
+  (arg1)->erase(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_erase__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::iterator arg2 ;
+  std::map< int,CdiZaxis >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  swig::SwigPyIterator *iter3 = 0 ;
+  int res3 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:ZaxesMap_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_erase" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ZaxesMap_erase" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiZaxis >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiZaxis >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ZaxesMap_erase" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::iterator""'");
+    }
+  }
+  res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ZaxesMap_erase" "', argument " "3"" of type '" "std::map< int,CdiZaxis >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiZaxis >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiZaxis >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "ZaxesMap_erase" "', argument " "3"" of type '" "std::map< int,CdiZaxis >::iterator""'");
+    }
+  }
+  (arg1)->erase(arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_erase(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiZaxis >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_ZaxesMap_erase__SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_ZaxesMap_erase__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiZaxis >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::SwigPyIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiZaxis >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_ZaxesMap_erase__SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'ZaxesMap_erase'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiZaxis >::erase(std::map< int,CdiZaxis >::key_type const &)\n"
+    "    std::map< int,CdiZaxis >::erase(std::map< int,CdiZaxis >::iterator)\n"
+    "    std::map< int,CdiZaxis >::erase(std::map< int,CdiZaxis >::iterator,std::map< int,CdiZaxis >::iterator)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_find(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiZaxis >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap_find",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_find" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ZaxesMap_find" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->find((std::map< int,CdiZaxis >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiZaxis >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_lower_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiZaxis >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap_lower_bound",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_lower_bound" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ZaxesMap_lower_bound" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->lower_bound((std::map< int,CdiZaxis >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiZaxis >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_ZaxesMap_upper_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiZaxis >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:ZaxesMap_upper_bound",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ZaxesMap_upper_bound" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ZaxesMap_upper_bound" "', argument " "2"" of type '" "std::map< int,CdiZaxis >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->upper_bound((std::map< int,CdiZaxis >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiZaxis >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_ZaxesMap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_ZaxesMap",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_ZaxesMap" "', argument " "1"" of type '" "std::map< int,CdiZaxis > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *ZaxesMap_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_GridsMap__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::less< int > *arg1 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiGrid > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_GridsMap",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1, SWIGTYPE_p_std__lessT_int_t,  0  | 0);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GridsMap" "', argument " "1"" of type '" "std::less< int > const &""'"); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GridsMap" "', argument " "1"" of type '" "std::less< int > const &""'"); 
+  }
+  arg1 = reinterpret_cast< std::less< int > * >(argp1);
+  result = (std::map< int,CdiGrid > *)new std::map< int,CdiGrid >((std::less< int > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_iterator" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiGrid_Sg__iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap___nonzero__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap___nonzero__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap___nonzero__" "', argument " "1"" of type '" "std::map< int,CdiGrid > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (bool)std_map_Sl_int_Sc_CdiGrid_Sg____nonzero__((std::map< int,CdiGrid > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap___bool__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap___bool__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap___bool__" "', argument " "1"" of type '" "std::map< int,CdiGrid > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (bool)std_map_Sl_int_Sc_CdiGrid_Sg____bool__((std::map< int,CdiGrid > const *)arg1);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap___len__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiGrid >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap___len__",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap___len__" "', argument " "1"" of type '" "std::map< int,CdiGrid > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = std_map_Sl_int_Sc_CdiGrid_Sg____len__((std::map< int,CdiGrid > const *)arg1);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap___getitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiGrid >::mapped_type *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap___getitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap___getitem__" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GridsMap___getitem__" "', argument " "2"" of type '" "std::map< int,CdiGrid >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  try {
+    result = (std::map< int,CdiGrid >::mapped_type *) &std_map_Sl_int_Sc_CdiGrid_Sg____getitem__(arg1,(int const &)*arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiGrid, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap___delitem__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap___delitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap___delitem__" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GridsMap___delitem__" "', argument " "2"" of type '" "std::map< int,CdiGrid >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  try {
+    std_map_Sl_int_Sc_CdiGrid_Sg____delitem__(arg1,(int const &)*arg2);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_has_key(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap_has_key",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_has_key" "', argument " "1"" of type '" "std::map< int,CdiGrid > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GridsMap_has_key" "', argument " "2"" of type '" "std::map< int,CdiGrid >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiGrid_Sg__has_key((std::map< int,CdiGrid > const *)arg1,(int const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_keys(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_keys",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_keys" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiGrid_Sg__keys(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_values(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_values",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_values" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiGrid_Sg__values(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_items(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_items",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_items" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiGrid_Sg__items(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap___contains__(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap___contains__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap___contains__" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GridsMap___contains__" "', argument " "2"" of type '" "std::map< int,CdiGrid >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiGrid_Sg____contains__(arg1,(int const &)*arg2);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_key_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_key_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_key_iterator" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiGrid_Sg__key_iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_value_iterator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  PyObject **arg2 = (PyObject **) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  swig::SwigPyIterator *result = 0 ;
+  
+  arg2 = &obj0;
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_value_iterator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_value_iterator" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (swig::SwigPyIterator *)std_map_Sl_int_Sc_CdiGrid_Sg__value_iterator(arg1,arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__SwigPyIterator, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap___setitem____SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap___setitem__",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap___setitem__" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GridsMap___setitem__" "', argument " "2"" of type '" "std::map< int,CdiGrid >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  std_map_Sl_int_Sc_CdiGrid_Sg____setitem____SWIG_0(arg1,(int const &)*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap___setitem____SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  std::map< int,CdiGrid >::mapped_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:GridsMap___setitem__",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap___setitem__" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GridsMap___setitem__" "', argument " "2"" of type '" "std::map< int,CdiGrid >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  res3 = SWIG_ConvertPtr(obj2, &argp3, SWIGTYPE_p_CdiGrid,  0  | 0);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "GridsMap___setitem__" "', argument " "3"" of type '" "std::map< int,CdiGrid >::mapped_type const &""'"); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GridsMap___setitem__" "', argument " "3"" of type '" "std::map< int,CdiGrid >::mapped_type const &""'"); 
+  }
+  arg3 = reinterpret_cast< std::map< int,CdiGrid >::mapped_type * >(argp3);
+  try {
+    std_map_Sl_int_Sc_CdiGrid_Sg____setitem____SWIG_1(arg1,(int const &)*arg2,(CdiGrid const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap___setitem__(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_GridsMap___setitem____SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = SWIG_ConvertPtr(argv[2], 0, SWIGTYPE_p_CdiGrid, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_GridsMap___setitem____SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'GridsMap___setitem__'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiGrid >::__setitem__(std::map< int,CdiGrid >::key_type const &)\n"
+    "    std::map< int,CdiGrid >::__setitem__(std::map< int,CdiGrid >::key_type const &,std::map< int,CdiGrid >::mapped_type const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_asdict(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_asdict",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_asdict" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (PyObject *)std_map_Sl_int_Sc_CdiGrid_Sg__asdict(arg1);
+  resultobj = result;
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_GridsMap__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_GridsMap")) SWIG_fail;
+  result = (std::map< int,CdiGrid > *)new std::map< int,CdiGrid >();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_GridsMap__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiGrid > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_GridsMap",&obj0)) SWIG_fail;
+  {
+    std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *ptr = (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *)0;
+    res1 = swig::asptr(obj0, &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_GridsMap" "', argument " "1"" of type '" "std::map< int,CdiGrid > const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "new_GridsMap" "', argument " "1"" of type '" "std::map< int,CdiGrid > const &""'"); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::map< int,CdiGrid > *)new std::map< int,CdiGrid >((std::map< int,CdiGrid > const &)*arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, SWIG_POINTER_NEW |  0 );
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_GridsMap(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[2];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 1) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_GridsMap__SWIG_1(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    int res = SWIG_ConvertPtr(argv[0], 0, SWIGTYPE_p_std__lessT_int_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_GridsMap__SWIG_0(self, args);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_GridsMap__SWIG_2(self, args);
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_GridsMap'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiGrid >::map(std::less< int > const &)\n"
+    "    std::map< int,CdiGrid >::map()\n"
+    "    std::map< int,CdiGrid >::map(std::map< int,CdiGrid > const &)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_empty(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_empty",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_empty" "', argument " "1"" of type '" "std::map< int,CdiGrid > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (bool)((std::map< int,CdiGrid > const *)arg1)->empty();
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_size(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiGrid >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_size",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_size" "', argument " "1"" of type '" "std::map< int,CdiGrid > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = ((std::map< int,CdiGrid > const *)arg1)->size();
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_clear(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_clear",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_clear" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  (arg1)->clear();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_swap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap_swap",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_swap" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2, SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "GridsMap_swap" "', argument " "2"" of type '" "std::map< int,CdiGrid > &""'"); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "GridsMap_swap" "', argument " "2"" of type '" "std::map< int,CdiGrid > &""'"); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiGrid > * >(argp2);
+  (arg1)->swap(*arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_get_allocator(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::allocator< std::pair< int const,CdiGrid > > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_get_allocator",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_get_allocator" "', argument " "1"" of type '" "std::map< int,CdiGrid > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = ((std::map< int,CdiGrid > const *)arg1)->get_allocator();
+  resultobj = SWIG_NewPointerObj((new std::map< int,CdiGrid >::allocator_type(static_cast< const std::map< int,CdiGrid >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_begin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiGrid >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_begin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_begin" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (arg1)->begin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiGrid >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_end(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiGrid >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_end",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_end" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (arg1)->end();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiGrid >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_rbegin(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiGrid >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_rbegin",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_rbegin" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (arg1)->rbegin();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiGrid >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_rend(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiGrid >::reverse_iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:GridsMap_rend",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_rend" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (arg1)->rend();
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiGrid >::reverse_iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_erase__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiGrid >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_erase" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GridsMap_erase" "', argument " "2"" of type '" "std::map< int,CdiGrid >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->erase((std::map< int,CdiGrid >::key_type const &)*arg2);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_count(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiGrid >::size_type result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap_count",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_count" "', argument " "1"" of type '" "std::map< int,CdiGrid > const *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GridsMap_count" "', argument " "2"" of type '" "std::map< int,CdiGrid >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = ((std::map< int,CdiGrid > const *)arg1)->count((std::map< int,CdiGrid >::key_type const &)*arg2);
+  resultobj = SWIG_From_size_t(static_cast< size_t >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_erase__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap_erase",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_erase" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "GridsMap_erase" "', argument " "2"" of type '" "std::map< int,CdiGrid >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiGrid >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiGrid >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "GridsMap_erase" "', argument " "2"" of type '" "std::map< int,CdiGrid >::iterator""'");
+    }
+  }
+  (arg1)->erase(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_erase__SWIG_2(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::iterator arg2 ;
+  std::map< int,CdiGrid >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::SwigPyIterator *iter2 = 0 ;
+  int res2 ;
+  swig::SwigPyIterator *iter3 = 0 ;
+  int res3 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:GridsMap_erase",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_erase" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, SWIG_as_voidptrptr(&iter2), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "GridsMap_erase" "', argument " "2"" of type '" "std::map< int,CdiGrid >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiGrid >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiGrid >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "GridsMap_erase" "', argument " "2"" of type '" "std::map< int,CdiGrid >::iterator""'");
+    }
+  }
+  res3 = SWIG_ConvertPtr(obj2, SWIG_as_voidptrptr(&iter3), swig::SwigPyIterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "GridsMap_erase" "', argument " "3"" of type '" "std::map< int,CdiGrid >::iterator""'");
+  } else {
+    swig::SwigPyIterator_T<std::map< int,CdiGrid >::iterator > *iter_t = dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiGrid >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), "in method '" "GridsMap_erase" "', argument " "3"" of type '" "std::map< int,CdiGrid >::iterator""'");
+    }
+  }
+  (arg1)->erase(arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_erase(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiGrid >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_GridsMap_erase__SWIG_1(self, args);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_GridsMap_erase__SWIG_0(self, args);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::SwigPyIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiGrid >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::SwigPyIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), swig::SwigPyIterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::SwigPyIterator_T<std::map< int,CdiGrid >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_GridsMap_erase__SWIG_2(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'GridsMap_erase'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    std::map< int,CdiGrid >::erase(std::map< int,CdiGrid >::key_type const &)\n"
+    "    std::map< int,CdiGrid >::erase(std::map< int,CdiGrid >::iterator)\n"
+    "    std::map< int,CdiGrid >::erase(std::map< int,CdiGrid >::iterator,std::map< int,CdiGrid >::iterator)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_find(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiGrid >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap_find",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_find" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GridsMap_find" "', argument " "2"" of type '" "std::map< int,CdiGrid >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->find((std::map< int,CdiGrid >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiGrid >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_lower_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiGrid >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap_lower_bound",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_lower_bound" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GridsMap_lower_bound" "', argument " "2"" of type '" "std::map< int,CdiGrid >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->lower_bound((std::map< int,CdiGrid >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiGrid >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_GridsMap_upper_bound(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  std::map< int,CdiGrid >::iterator result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:GridsMap_upper_bound",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "GridsMap_upper_bound" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "GridsMap_upper_bound" "', argument " "2"" of type '" "std::map< int,CdiGrid >::key_type""'");
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->upper_bound((std::map< int,CdiGrid >::key_type const &)*arg2);
+  resultobj = SWIG_NewPointerObj(swig::make_output_iterator(static_cast< const std::map< int,CdiGrid >::iterator & >(result)),
+    swig::SwigPyIterator::descriptor(),SWIG_POINTER_OWN);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_GridsMap(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_GridsMap",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_GridsMap" "', argument " "1"" of type '" "std::map< int,CdiGrid > *""'"); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *GridsMap_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CdiGrid__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CdiGrid")) SWIG_fail;
+  result = (CdiGrid *)new CdiGrid();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiGrid, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CdiGrid__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CdiGrid *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_CdiGrid",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CdiGrid" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast< int >(val1);
+  result = (CdiGrid *)new CdiGrid(arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiGrid, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CdiGrid(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[2];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 1) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_CdiGrid__SWIG_0(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_CdiGrid__SWIG_1(self, args);
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_CdiGrid'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CdiGrid::CdiGrid()\n"
+    "    CdiGrid::CdiGrid(int)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CdiGrid(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CdiGrid",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CdiGrid" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_gridID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_gridID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_gridID_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiGrid_gridID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->gridID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_gridID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_gridID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_gridID_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->gridID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_type_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_type_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiGrid_type_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->type = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_type_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_type_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->type);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_size_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_size_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiGrid_size_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->size = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_size_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_size_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->size);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xsize_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_xsize_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xsize_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiGrid_xsize_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->xsize = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xsize_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_xsize_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xsize_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->xsize);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_ysize_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_ysize_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_ysize_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiGrid_ysize_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ysize = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_ysize_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_ysize_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_ysize_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->ysize);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_prec_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_prec_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_prec_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiGrid_prec_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->prec = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_prec_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_prec_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_prec_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->prec);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_ncorner_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_ncorner_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_ncorner_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiGrid_ncorner_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ncorner = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_ncorner_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_ncorner_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_ncorner_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->ncorner);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_hasXValues_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  bool arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_hasXValues_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_hasXValues_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiGrid_hasXValues_set" "', argument " "2"" of type '" "bool""'");
+  } 
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->hasXValues = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_hasXValues_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_hasXValues_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_hasXValues_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (bool) ((arg1)->hasXValues);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_hasYValues_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  bool arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_hasYValues_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_hasYValues_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiGrid_hasYValues_set" "', argument " "2"" of type '" "bool""'");
+  } 
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->hasYValues = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_hasYValues_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_hasYValues_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_hasYValues_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (bool) ((arg1)->hasYValues);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_hasBounds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  bool arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_hasBounds_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_hasBounds_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_bool(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiGrid_hasBounds_set" "', argument " "2"" of type '" "bool""'");
+  } 
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->hasBounds = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_hasBounds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  bool result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_hasBounds_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_hasBounds_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (bool) ((arg1)->hasBounds);
+  resultobj = SWIG_From_bool(static_cast< bool >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xvalues_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_xvalues_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xvalues_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_xvalues_set" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->xvalues = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xvalues_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_xvalues_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xvalues_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->xvalues);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_yvalues_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_yvalues_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_yvalues_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_yvalues_set" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->yvalues = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_yvalues_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_yvalues_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_yvalues_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->yvalues);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xbounds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_xbounds_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xbounds_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_xbounds_set" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->xbounds = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xbounds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_xbounds_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xbounds_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->xbounds);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_ybounds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_ybounds_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_ybounds_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_ybounds_set" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->ybounds = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_ybounds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_ybounds_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_ybounds_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->ybounds);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xname_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_xname_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xname_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_xname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiGrid_xname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->xname = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xname_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_xname_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xname_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->xname);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xlongname_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_xlongname_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xlongname_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_xlongname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiGrid_xlongname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->xlongname = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xlongname_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_xlongname_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xlongname_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->xlongname);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xstdname_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_xstdname_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xstdname_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_xstdname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiGrid_xstdname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->xstdname = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xstdname_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_xstdname_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xstdname_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->xstdname);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xunits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_xunits_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xunits_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_xunits_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiGrid_xunits_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->xunits = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_xunits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_xunits_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_xunits_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->xunits);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_yname_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_yname_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_yname_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_yname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiGrid_yname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->yname = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_yname_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_yname_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_yname_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->yname);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_ylongname_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_ylongname_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_ylongname_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_ylongname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiGrid_ylongname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->ylongname = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_ylongname_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_ylongname_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_ylongname_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->ylongname);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_ystdname_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_ystdname_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_ystdname_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_ystdname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiGrid_ystdname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->ystdname = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_ystdname_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_ystdname_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_ystdname_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->ystdname);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_yunits_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_yunits_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_yunits_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_yunits_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiGrid_yunits_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->yunits = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_yunits_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_yunits_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_yunits_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->yunits);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiGrid_name_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_name_set" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_name_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiGrid_name_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->name = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_name_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_name_get" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->name);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_getValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_getValues",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_getValues" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  (arg1)->getValues();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_getBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiGrid_getBounds",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_getBounds" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  (arg1)->getBounds();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_getValuesAsPointer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  double *arg2 = (double *) 0 ;
+  double *arg3 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CdiGrid_getValuesAsPointer",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_getValuesAsPointer" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_getValuesAsPointer" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CdiGrid_getValuesAsPointer" "', argument " "3"" of type '" "double *""'"); 
+  }
+  arg3 = reinterpret_cast< double * >(argp3);
+  (arg1)->getValuesAsPointer(arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_getBoundsAsPointer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  double *arg2 = (double *) 0 ;
+  double *arg3 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CdiGrid_getBoundsAsPointer",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_getBoundsAsPointer" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_getBoundsAsPointer" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CdiGrid_getBoundsAsPointer" "', argument " "3"" of type '" "double *""'"); 
+  }
+  arg3 = reinterpret_cast< double * >(argp3);
+  (arg1)->getBoundsAsPointer(arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_getFloatVals(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  float *arg2 = (float *) 0 ;
+  float *arg3 = (float *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CdiGrid_getFloatVals",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_getFloatVals" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_getFloatVals" "', argument " "2"" of type '" "float *""'"); 
+  }
+  arg2 = reinterpret_cast< float * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CdiGrid_getFloatVals" "', argument " "3"" of type '" "float *""'"); 
+  }
+  arg3 = reinterpret_cast< float * >(argp3);
+  (arg1)->getFloatVals(arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiGrid_getFloatBounds(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  float *arg2 = (float *) 0 ;
+  float *arg3 = (float *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:CdiGrid_getFloatBounds",&obj0,&obj1,&obj2)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiGrid_getFloatBounds" "', argument " "1"" of type '" "CdiGrid *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiGrid_getFloatBounds" "', argument " "2"" of type '" "float *""'"); 
+  }
+  arg2 = reinterpret_cast< float * >(argp2);
+  res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "CdiGrid_getFloatBounds" "', argument " "3"" of type '" "float *""'"); 
+  }
+  arg3 = reinterpret_cast< float * >(argp3);
+  (arg1)->getFloatBounds(arg2,arg3);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CdiGrid_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CdiGrid, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CdiTaxis__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CdiTaxis")) SWIG_fail;
+  result = (CdiTaxis *)new CdiTaxis();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiTaxis, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CdiTaxis__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CdiTaxis *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_CdiTaxis",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CdiTaxis" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast< int >(val1);
+  result = (CdiTaxis *)new CdiTaxis(arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiTaxis, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CdiTaxis(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[2];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 1) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_CdiTaxis__SWIG_0(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_CdiTaxis__SWIG_1(self, args);
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_CdiTaxis'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CdiTaxis::CdiTaxis()\n"
+    "    CdiTaxis::CdiTaxis(int)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CdiTaxis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CdiTaxis",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CdiTaxis" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_taxisID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_taxisID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_taxisID_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiTaxis_taxisID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->taxisID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_taxisID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_taxisID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_taxisID_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->taxisID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_ntsteps_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_ntsteps_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_ntsteps_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiTaxis_ntsteps_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ntsteps = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_ntsteps_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_ntsteps_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_ntsteps_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->ntsteps);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_unit_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_unit_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_unit_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiTaxis_unit_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->unit = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_unit_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_unit_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_unit_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->unit);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_rdate_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_rdate_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_rdate_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiTaxis_rdate_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->rdate = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_rdate_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_rdate_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_rdate_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->rdate);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_rtime_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_rtime_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_rtime_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiTaxis_rtime_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->rtime = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_rtime_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_rtime_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_rtime_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->rtime);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_vdate_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_vdate_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_vdate_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiTaxis_vdate_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->vdate = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_vdate_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_vdate_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_vdate_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->vdate);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_vtime_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_vtime_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_vtime_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiTaxis_vtime_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->vtime = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_vtime_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_vtime_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_vtime_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->vtime);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_type_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_type_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiTaxis_type_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->type = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_type_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_type_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->type);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_calendar_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_calendar_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_calendar_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiTaxis_calendar_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->calendar = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_calendar_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_calendar_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_calendar_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->calendar);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_hasBounds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_hasBounds_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_hasBounds_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiTaxis_hasBounds_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->hasBounds = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_hasBounds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_hasBounds_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_hasBounds_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->hasBounds);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  char *arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  char temp2[128] ;
+  int res2 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_name_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_name_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  res2 = SWIG_AsCharArray(obj1, temp2, 128);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiTaxis_name_set" "', argument " "2"" of type '" "char [128]""'");
+  }
+  arg2 = reinterpret_cast< char * >(temp2);
+  if (arg2) memcpy(arg1->name,arg2,128*sizeof(char));
+  else memset(arg1->name,0,128*sizeof(char));
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_name_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_name_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (char *)(char *) ((arg1)->name);
+  {
+    size_t size = 128;
+    
+    while (size && (result[size - 1] == '\0')) --size;
+    
+    resultobj = SWIG_FromCharPtrAndSize(result, size);
+  }
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_unitname_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  char *arg2 = (char *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiTaxis_unitname_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_unitname_set" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiTaxis_unitname_set" "', argument " "2"" of type '" "char *""'");
+  }
+  arg2 = reinterpret_cast< char * >(buf2);
+  if (arg1->unitname) delete[] arg1->unitname;
+  if (arg2) {
+    size_t size = strlen(reinterpret_cast< const char * >(arg2)) + 1;
+    arg1->unitname = (char *)reinterpret_cast< char* >(memcpy((new char[size]), reinterpret_cast< const char * >(arg2), sizeof(char)*(size)));
+  } else {
+    arg1->unitname = 0;
+  }
+  resultobj = SWIG_Py_Void();
+  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+  return resultobj;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiTaxis_unitname_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  char *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiTaxis_unitname_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiTaxis_unitname_get" "', argument " "1"" of type '" "CdiTaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (char *) ((arg1)->unitname);
+  resultobj = SWIG_FromCharPtr((const char *)result);
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CdiTaxis_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CdiTaxis, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CdiZaxis__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CdiZaxis")) SWIG_fail;
+  result = (CdiZaxis *)new CdiZaxis();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiZaxis, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CdiZaxis__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CdiZaxis *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_CdiZaxis",&obj0)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CdiZaxis" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast< int >(val1);
+  result = (CdiZaxis *)new CdiZaxis(arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiZaxis, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CdiZaxis(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[2];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 1) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_CdiZaxis__SWIG_0(self, args);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_CdiZaxis__SWIG_1(self, args);
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_CdiZaxis'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CdiZaxis::CdiZaxis()\n"
+    "    CdiZaxis::CdiZaxis(int)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CdiZaxis(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CdiZaxis",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CdiZaxis" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_zaxisID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_zaxisID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_zaxisID_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiZaxis_zaxisID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->zaxisID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_zaxisID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_zaxisID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_zaxisID_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (int) ((arg1)->zaxisID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_type_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_type_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_type_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiZaxis_type_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->type = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_type_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_type_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_type_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (int) ((arg1)->type);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_ltype_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_ltype_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_ltype_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiZaxis_ltype_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ltype = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_ltype_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_ltype_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_ltype_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (int) ((arg1)->ltype);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_size_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_size_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiZaxis_size_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->size = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_size_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_size_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (int) ((arg1)->size);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_prec_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_prec_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_prec_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiZaxis_prec_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->prec = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_prec_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_prec_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_prec_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (int) ((arg1)->prec);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_plevels_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  double *arg2 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_plevels_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_plevels_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiZaxis_plevels_set" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  if (arg1) (arg1)->plevels = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_plevels_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_plevels_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_plevels_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (double *) ((arg1)->plevels);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_plbounds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  double *arg2 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_plbounds_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_plbounds_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiZaxis_plbounds_set" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  if (arg1) (arg1)->plbounds = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_plbounds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_plbounds_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_plbounds_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (double *) ((arg1)->plbounds);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_pubounds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  double *arg2 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_pubounds_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_pubounds_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiZaxis_pubounds_set" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  if (arg1) (arg1)->pubounds = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_pubounds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_pubounds_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_pubounds_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (double *) ((arg1)->pubounds);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_pweights_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  double *arg2 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_pweights_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_pweights_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_double, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiZaxis_pweights_set" "', argument " "2"" of type '" "double *""'"); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  if (arg1) (arg1)->pweights = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_pweights_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_pweights_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_pweights_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (double *) ((arg1)->pweights);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_levels_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_levels_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_levels_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiZaxis_levels_set" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->levels = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_levels_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_levels_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_levels_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->levels);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_lbounds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_lbounds_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_lbounds_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiZaxis_lbounds_set" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->lbounds = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_lbounds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_lbounds_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_lbounds_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->lbounds);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_ubounds_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_ubounds_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_ubounds_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiZaxis_ubounds_set" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->ubounds = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_ubounds_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_ubounds_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_ubounds_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->ubounds);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_weights_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_weights_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_weights_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiZaxis_weights_set" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->weights = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_weights_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_weights_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_weights_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->weights);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_name_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_name_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiZaxis_name_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiZaxis_name_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->name = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_name_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_name_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::string *) & ((arg1)->name);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_longname_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_longname_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_longname_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiZaxis_longname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiZaxis_longname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->longname = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_longname_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_longname_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_longname_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::string *) & ((arg1)->longname);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_units_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiZaxis_units_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_units_set" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiZaxis_units_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiZaxis_units_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->units = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiZaxis_units_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiZaxis_units_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiZaxis_units_get" "', argument " "1"" of type '" "CdiZaxis *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::string *) & ((arg1)->units);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *CdiZaxis_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CdiZaxis, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_CdiVariable__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)":new_CdiVariable")) SWIG_fail;
+  result = (CdiVariable *)new CdiVariable();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiVariable, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CdiVariable__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  PyObject * obj2 = 0 ;
+  CdiVariable *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OOO:new_CdiVariable",&obj0,&obj1,&obj2)) SWIG_fail;
+  ecode1 = SWIG_AsVal_int(obj0, &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "new_CdiVariable" "', argument " "1"" of type '" "int""'");
+  } 
+  arg1 = static_cast< int >(val1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "new_CdiVariable" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  ecode3 = SWIG_AsVal_int(obj2, &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "new_CdiVariable" "', argument " "3"" of type '" "int""'");
+  } 
+  arg3 = static_cast< int >(val3);
+  result = (CdiVariable *)new CdiVariable(arg1,arg2,arg3);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiVariable, SWIG_POINTER_NEW |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_new_CdiVariable(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[4];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 3) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 0) {
+    return _wrap_new_CdiVariable__SWIG_0(self, args);
+  }
+  if (argc == 3) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_new_CdiVariable__SWIG_1(self, args);
+        }
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'new_CdiVariable'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CdiVariable::CdiVariable()\n"
+    "    CdiVariable::CdiVariable(int,int,int)\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_CdiVariable(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_CdiVariable",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_CdiVariable" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_varID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_varID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_varID_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_varID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->varID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_varID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_varID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_varID_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->varID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_zaxisID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_zaxisID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_zaxisID_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_zaxisID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->zaxisID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_zaxisID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_zaxisID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_zaxisID_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->zaxisID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_gridID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_gridID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_gridID_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_gridID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->gridID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_gridID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_gridID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_gridID_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->gridID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_taxisID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_taxisID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_taxisID_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_taxisID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->taxisID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_taxisID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_taxisID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_taxisID_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->taxisID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_timeID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_timeID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_timeID_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_timeID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->timeID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_timeID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_timeID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_timeID_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->timeID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_vlistID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_vlistID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_vlistID_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_vlistID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->vlistID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_vlistID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_vlistID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_vlistID_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->vlistID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_size_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_size_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_size_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_size_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->size = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_size_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_size_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_size_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->size);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_code_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_code_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_code_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_code_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->code = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_code_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_code_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_code_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->code);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_datatype_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_datatype_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_datatype_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_datatype_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->datatype = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_datatype_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_datatype_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_datatype_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->datatype);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_streamID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_streamID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_streamID_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_streamID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->streamID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_streamID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_streamID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_streamID_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->streamID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_name_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_name_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_name_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiVariable_name_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiVariable_name_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->name = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_name_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_name_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_name_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::string *) & ((arg1)->name);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_longname_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_longname_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_longname_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiVariable_longname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiVariable_longname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->longname = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_longname_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_longname_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_longname_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::string *) & ((arg1)->longname);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_units_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_units_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_units_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiVariable_units_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiVariable_units_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->units = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_units_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_units_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_units_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::string *) & ((arg1)->units);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_stdname_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_stdname_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_stdname_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(obj1, &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiVariable_stdname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, "invalid null reference " "in method '" "CdiVariable_stdname_set" "', argument " "2"" of type '" "std::string const &""'"); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->stdname = *arg2;
+  resultobj = SWIG_Py_Void();
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return resultobj;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_stdname_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::string *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_stdname_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_stdname_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::string *) & ((arg1)->stdname);
+  resultobj = SWIG_From_std_string(static_cast< std::string >(*result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_missval_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  double arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_missval_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_missval_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_double(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_missval_set" "', argument " "2"" of type '" "double""'");
+  } 
+  arg2 = static_cast< double >(val2);
+  if (arg1) (arg1)->missval = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_missval_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_missval_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_missval_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (double) ((arg1)->missval);
+  resultobj = SWIG_From_double(static_cast< double >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_values_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_values_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_values_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiVariable_values_set" "', argument " "2"" of type '" "std::vector< double,std::allocator< double > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->values = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_values_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_values_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_values_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->values);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_valuesWithLevel_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg2 = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_valuesWithLevel_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_valuesWithLevel_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiVariable_valuesWithLevel_set" "', argument " "2"" of type '" "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > * >(argp2);
+  if (arg1) (arg1)->valuesWithLevel = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_valuesWithLevel_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_valuesWithLevel_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_valuesWithLevel_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)& ((arg1)->valuesWithLevel);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_grid_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  CdiGrid *arg2 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_grid_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_grid_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiVariable_grid_set" "', argument " "2"" of type '" "CdiGrid *""'"); 
+  }
+  arg2 = reinterpret_cast< CdiGrid * >(argp2);
+  if (arg1) (arg1)->grid = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_grid_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CdiGrid *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_grid_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_grid_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (CdiGrid *)& ((arg1)->grid);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiGrid, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_zaxis_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  CdiZaxis *arg2 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_zaxis_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_zaxis_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiVariable_zaxis_set" "', argument " "2"" of type '" "CdiZaxis *""'"); 
+  }
+  arg2 = reinterpret_cast< CdiZaxis * >(argp2);
+  if (arg1) (arg1)->zaxis = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_zaxis_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CdiZaxis *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_zaxis_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_zaxis_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (CdiZaxis *)& ((arg1)->zaxis);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_taxis_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  CdiTaxis *arg2 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_taxis_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_taxis_set" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "CdiVariable_taxis_set" "', argument " "2"" of type '" "CdiTaxis *""'"); 
+  }
+  arg2 = reinterpret_cast< CdiTaxis * >(argp2);
+  if (arg1) (arg1)->taxis = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_taxis_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  CdiTaxis *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_taxis_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_taxis_get" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (CdiTaxis *)& ((arg1)->taxis);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_sinfo(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_sinfo",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_sinfo" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  (arg1)->sinfo();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_getValues",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_getValues" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  (arg1)->getValues();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getValuesWithLevel__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_getValuesWithLevel",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_getValuesWithLevel" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_getValuesWithLevel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  (arg1)->getValuesWithLevel(arg2);
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getValuesWithLevel__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_getValuesWithLevel",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_getValuesWithLevel" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  (arg1)->getValuesWithLevel();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getValuesWithLevel(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_CdiVariable_getValuesWithLevel__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_CdiVariable_getValuesWithLevel__SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'CdiVariable_getValuesWithLevel'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CdiVariable::getValuesWithLevel(int)\n"
+    "    CdiVariable::getValuesWithLevel()\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getFValues(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::vector< float,std::allocator< float > > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_getFValues",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_getFValues" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (arg1)->getFValues();
+  resultobj = SWIG_NewPointerObj((new std::vector< float,std::allocator< float > >(static_cast< const std::vector< float,std::allocator< float > >& >(result))), SWIGTYPE_p_std__vectorT_float_std__allocatorT_float_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getFValuesWithLevel__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  SwigValueWrapper< std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_getFValuesWithLevel",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_getFValuesWithLevel" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_getFValuesWithLevel" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  result = (arg1)->getFValuesWithLevel(arg2);
+  resultobj = SWIG_NewPointerObj((new std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >(static_cast< const std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >& >(result))), SWIGTYPE_p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getFValuesWithLevel__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  SwigValueWrapper< std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > > > result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_getFValuesWithLevel",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_getFValuesWithLevel" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (arg1)->getFValuesWithLevel();
+  resultobj = SWIG_NewPointerObj((new std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >(static_cast< const std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >& >(result))), SWIGTYPE_p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t, SWIG_POINTER_OWN |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getFValuesWithLevel(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_CdiVariable_getFValuesWithLevel__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_CdiVariable_getFValuesWithLevel__SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'CdiVariable_getFValuesWithLevel'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CdiVariable::getFValuesWithLevel(int)\n"
+    "    CdiVariable::getFValuesWithLevel()\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getValuesAsPointer(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_getValuesAsPointer",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_getValuesAsPointer" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (double *)(arg1)->getValuesAsPointer();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getValuesWithLevelAsPointer__SWIG_0(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  double **result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:CdiVariable_getValuesWithLevelAsPointer",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_getValuesWithLevelAsPointer" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "CdiVariable_getValuesWithLevelAsPointer" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  result = (double **)(arg1)->getValuesWithLevelAsPointer(arg2);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_double, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getValuesWithLevelAsPointer__SWIG_1(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  double **result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:CdiVariable_getValuesWithLevelAsPointer",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "CdiVariable_getValuesWithLevelAsPointer" "', argument " "1"" of type '" "CdiVariable *""'"); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (double **)(arg1)->getValuesWithLevelAsPointer();
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_double, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_CdiVariable_getValuesWithLevelAsPointer(PyObject *self, PyObject *args) {
+  int argc;
+  PyObject *argv[3];
+  int ii;
+  
+  if (!PyTuple_Check(args)) SWIG_fail;
+  argc = args ? (int)PyObject_Length(args) : 0;
+  for (ii = 0; (ii < 2) && (ii < argc); ii++) {
+    argv[ii] = PyTuple_GET_ITEM(args,ii);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_CdiVariable_getValuesWithLevelAsPointer__SWIG_1(self, args);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_CdiVariable_getValuesWithLevelAsPointer__SWIG_0(self, args);
+      }
+    }
+  }
+  
+fail:
+  SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'CdiVariable_getValuesWithLevelAsPointer'.\n"
+    "  Possible C/C++ prototypes are:\n"
+    "    CdiVariable::getValuesWithLevelAsPointer(int)\n"
+    "    CdiVariable::getValuesWithLevelAsPointer()\n");
+  return 0;
+}
+
+
+SWIGINTERN PyObject *CdiVariable_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_CdiVariable, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+SWIGINTERN PyObject *_wrap_new_Cdi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  char *arg1 = (char *) 0 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  PyObject * obj0 = 0 ;
+  Cdi *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:new_Cdi",&obj0)) SWIG_fail;
+  res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "new_Cdi" "', argument " "1"" of type '" "char const *""'");
+  }
+  arg1 = reinterpret_cast< char * >(buf1);
+  result = (Cdi *)new Cdi((char const *)arg1);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_Cdi, SWIG_POINTER_NEW |  0 );
+  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+  return resultobj;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_delete_Cdi(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:delete_Cdi",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_Cdi" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  delete arg1;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_streamID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_streamID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_streamID_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Cdi_streamID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->streamID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_streamID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_streamID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_streamID_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->streamID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_vlistID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_vlistID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_vlistID_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Cdi_vlistID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->vlistID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_vlistID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_vlistID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_vlistID_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->vlistID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_nvars_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_nvars_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_nvars_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Cdi_nvars_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->nvars = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_nvars_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_nvars_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_nvars_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->nvars);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_nzaxes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_nzaxes_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_nzaxes_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Cdi_nzaxes_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->nzaxes = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_nzaxes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_nzaxes_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_nzaxes_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->nzaxes);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_ngrids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_ngrids_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_ngrids_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Cdi_ngrids_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ngrids = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_ngrids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_ngrids_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_ngrids_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->ngrids);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_ntaxes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_ntaxes_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_ntaxes_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Cdi_ntaxes_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ntaxes = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_ntaxes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_ntaxes_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_ntaxes_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->ntaxes);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_taxisID_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_taxisID_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_taxisID_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(obj1, &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "Cdi_taxisID_set" "', argument " "2"" of type '" "int""'");
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->taxisID = arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_taxisID_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  int result;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_taxisID_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_taxisID_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->taxisID);
+  resultobj = SWIG_From_int(static_cast< int >(result));
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_varnames_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::vector< std::string,std::allocator< std::string > > *arg2 = (std::vector< std::string,std::allocator< std::string > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_varnames_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_varnames_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cdi_varnames_set" "', argument " "2"" of type '" "std::vector< std::string,std::allocator< std::string > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< std::string,std::allocator< std::string > > * >(argp2);
+  if (arg1) (arg1)->varnames = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_varnames_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_varnames_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_varnames_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::vector< std::string,std::allocator< std::string > > *)& ((arg1)->varnames);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_codes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::vector< int,std::allocator< int > > *arg2 = (std::vector< int,std::allocator< int > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_codes_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_codes_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cdi_codes_set" "', argument " "2"" of type '" "std::vector< int,std::allocator< int > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< int,std::allocator< int > > * >(argp2);
+  if (arg1) (arg1)->codes = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_codes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_codes_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_codes_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::vector< int,std::allocator< int > > *)& ((arg1)->codes);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_variables_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *arg2 = (std::vector< CdiVariable,std::allocator< CdiVariable > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_variables_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_variables_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cdi_variables_set" "', argument " "2"" of type '" "std::vector< CdiVariable,std::allocator< CdiVariable > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::vector< CdiVariable,std::allocator< CdiVariable > > * >(argp2);
+  if (arg1) (arg1)->variables = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_variables_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_variables_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_variables_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::vector< CdiVariable,std::allocator< CdiVariable > > *)& ((arg1)->variables);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_var_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *arg2 = (std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_var_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_var_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cdi_var_set" "', argument " "2"" of type '" "std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > * >(argp2);
+  if (arg1) (arg1)->var = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_var_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_var_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_var_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *)& ((arg1)->var);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_varByCode_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *arg2 = (std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_varByCode_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_varByCode_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cdi_varByCode_set" "', argument " "2"" of type '" "std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > * >(argp2);
+  if (arg1) (arg1)->varByCode = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_varByCode_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_varByCode_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_varByCode_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *)& ((arg1)->varByCode);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_taxes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *arg2 = (std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_taxes_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_taxes_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cdi_taxes_set" "', argument " "2"" of type '" "std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > * >(argp2);
+  if (arg1) (arg1)->taxes = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_taxes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_taxes_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_taxes_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *)& ((arg1)->taxes);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_zaxes_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *arg2 = (std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_zaxes_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_zaxes_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cdi_zaxes_set" "', argument " "2"" of type '" "std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > * >(argp2);
+  if (arg1) (arg1)->zaxes = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_zaxes_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_zaxes_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_zaxes_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *)& ((arg1)->zaxes);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_grids_set(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *arg2 = (std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  PyObject * obj0 = 0 ;
+  PyObject * obj1 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"OO:Cdi_grids_set",&obj0,&obj1)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_grids_set" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "Cdi_grids_set" "', argument " "2"" of type '" "std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *""'"); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > * >(argp2);
+  if (arg1) (arg1)->grids = *arg2;
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_grids_get(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *result = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_grids_get",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_grids_get" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *)& ((arg1)->grids);
+  resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *_wrap_Cdi_griddes(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *resultobj = 0;
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  PyObject * obj0 = 0 ;
+  
+  if (!PyArg_ParseTuple(args,(char *)"O:Cdi_griddes",&obj0)) SWIG_fail;
+  res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "Cdi_griddes" "', argument " "1"" of type '" "Cdi *""'"); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  (arg1)->griddes();
+  resultobj = SWIG_Py_Void();
+  return resultobj;
+fail:
+  return NULL;
+}
+
+
+SWIGINTERN PyObject *Cdi_swigregister(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
+  PyObject *obj;
+  if (!PyArg_ParseTuple(args,(char*)"O:swigregister", &obj)) return NULL;
+  SWIG_TypeNewClientData(SWIGTYPE_p_Cdi, SWIG_NewClientData(obj));
+  return SWIG_Py_Void();
+}
+
+static PyMethodDef SwigMethods[] = {
+	 { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL},
+	 { (char *)"delete_SwigPyIterator", _wrap_delete_SwigPyIterator, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_value", _wrap_SwigPyIterator_value, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_incr", _wrap_SwigPyIterator_incr, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_decr", _wrap_SwigPyIterator_decr, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_distance", _wrap_SwigPyIterator_distance, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_equal", _wrap_SwigPyIterator_equal, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_copy", _wrap_SwigPyIterator_copy, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_next", _wrap_SwigPyIterator_next, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___next__", _wrap_SwigPyIterator___next__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_previous", _wrap_SwigPyIterator_previous, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_advance", _wrap_SwigPyIterator_advance, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___eq__", _wrap_SwigPyIterator___eq__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___ne__", _wrap_SwigPyIterator___ne__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___iadd__", _wrap_SwigPyIterator___iadd__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___isub__", _wrap_SwigPyIterator___isub__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___add__", _wrap_SwigPyIterator___add__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator___sub__", _wrap_SwigPyIterator___sub__, METH_VARARGS, NULL},
+	 { (char *)"SwigPyIterator_swigregister", SwigPyIterator_swigregister, METH_VARARGS, NULL},
+	 { (char *)"IntVector_iterator", _wrap_IntVector_iterator, METH_VARARGS, NULL},
+	 { (char *)"IntVector___nonzero__", _wrap_IntVector___nonzero__, METH_VARARGS, NULL},
+	 { (char *)"IntVector___bool__", _wrap_IntVector___bool__, METH_VARARGS, NULL},
+	 { (char *)"IntVector___len__", _wrap_IntVector___len__, METH_VARARGS, NULL},
+	 { (char *)"IntVector_pop", _wrap_IntVector_pop, METH_VARARGS, NULL},
+	 { (char *)"IntVector___getslice__", _wrap_IntVector___getslice__, METH_VARARGS, NULL},
+	 { (char *)"IntVector___setslice__", _wrap_IntVector___setslice__, METH_VARARGS, NULL},
+	 { (char *)"IntVector___delslice__", _wrap_IntVector___delslice__, METH_VARARGS, NULL},
+	 { (char *)"IntVector___delitem__", _wrap_IntVector___delitem__, METH_VARARGS, NULL},
+	 { (char *)"IntVector___getitem__", _wrap_IntVector___getitem__, METH_VARARGS, NULL},
+	 { (char *)"IntVector___setitem__", _wrap_IntVector___setitem__, METH_VARARGS, NULL},
+	 { (char *)"IntVector_append", _wrap_IntVector_append, METH_VARARGS, NULL},
+	 { (char *)"IntVector_empty", _wrap_IntVector_empty, METH_VARARGS, NULL},
+	 { (char *)"IntVector_size", _wrap_IntVector_size, METH_VARARGS, NULL},
+	 { (char *)"IntVector_clear", _wrap_IntVector_clear, METH_VARARGS, NULL},
+	 { (char *)"IntVector_swap", _wrap_IntVector_swap, METH_VARARGS, NULL},
+	 { (char *)"IntVector_get_allocator", _wrap_IntVector_get_allocator, METH_VARARGS, NULL},
+	 { (char *)"IntVector_begin", _wrap_IntVector_begin, METH_VARARGS, NULL},
+	 { (char *)"IntVector_end", _wrap_IntVector_end, METH_VARARGS, NULL},
+	 { (char *)"IntVector_rbegin", _wrap_IntVector_rbegin, METH_VARARGS, NULL},
+	 { (char *)"IntVector_rend", _wrap_IntVector_rend, METH_VARARGS, NULL},
+	 { (char *)"IntVector_pop_back", _wrap_IntVector_pop_back, METH_VARARGS, NULL},
+	 { (char *)"IntVector_erase", _wrap_IntVector_erase, METH_VARARGS, NULL},
+	 { (char *)"new_IntVector", _wrap_new_IntVector, METH_VARARGS, NULL},
+	 { (char *)"IntVector_push_back", _wrap_IntVector_push_back, METH_VARARGS, NULL},
+	 { (char *)"IntVector_front", _wrap_IntVector_front, METH_VARARGS, NULL},
+	 { (char *)"IntVector_back", _wrap_IntVector_back, METH_VARARGS, NULL},
+	 { (char *)"IntVector_assign", _wrap_IntVector_assign, METH_VARARGS, NULL},
+	 { (char *)"IntVector_resize", _wrap_IntVector_resize, METH_VARARGS, NULL},
+	 { (char *)"IntVector_insert", _wrap_IntVector_insert, METH_VARARGS, NULL},
+	 { (char *)"IntVector_reserve", _wrap_IntVector_reserve, METH_VARARGS, NULL},
+	 { (char *)"IntVector_capacity", _wrap_IntVector_capacity, METH_VARARGS, NULL},
+	 { (char *)"delete_IntVector", _wrap_delete_IntVector, METH_VARARGS, NULL},
+	 { (char *)"IntVector_swigregister", IntVector_swigregister, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_iterator", _wrap_DoubleVector_iterator, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector___nonzero__", _wrap_DoubleVector___nonzero__, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector___bool__", _wrap_DoubleVector___bool__, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector___len__", _wrap_DoubleVector___len__, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_pop", _wrap_DoubleVector_pop, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector___getslice__", _wrap_DoubleVector___getslice__, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector___setslice__", _wrap_DoubleVector___setslice__, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector___delslice__", _wrap_DoubleVector___delslice__, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector___delitem__", _wrap_DoubleVector___delitem__, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector___getitem__", _wrap_DoubleVector___getitem__, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector___setitem__", _wrap_DoubleVector___setitem__, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_append", _wrap_DoubleVector_append, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_empty", _wrap_DoubleVector_empty, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_size", _wrap_DoubleVector_size, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_clear", _wrap_DoubleVector_clear, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_swap", _wrap_DoubleVector_swap, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_get_allocator", _wrap_DoubleVector_get_allocator, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_begin", _wrap_DoubleVector_begin, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_end", _wrap_DoubleVector_end, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_rbegin", _wrap_DoubleVector_rbegin, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_rend", _wrap_DoubleVector_rend, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_pop_back", _wrap_DoubleVector_pop_back, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_erase", _wrap_DoubleVector_erase, METH_VARARGS, NULL},
+	 { (char *)"new_DoubleVector", _wrap_new_DoubleVector, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_push_back", _wrap_DoubleVector_push_back, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_front", _wrap_DoubleVector_front, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_back", _wrap_DoubleVector_back, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_assign", _wrap_DoubleVector_assign, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_resize", _wrap_DoubleVector_resize, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_insert", _wrap_DoubleVector_insert, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_reserve", _wrap_DoubleVector_reserve, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_capacity", _wrap_DoubleVector_capacity, METH_VARARGS, NULL},
+	 { (char *)"delete_DoubleVector", _wrap_delete_DoubleVector, METH_VARARGS, NULL},
+	 { (char *)"DoubleVector_swigregister", DoubleVector_swigregister, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_iterator", _wrap_DoubleDoubleVector_iterator, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector___nonzero__", _wrap_DoubleDoubleVector___nonzero__, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector___bool__", _wrap_DoubleDoubleVector___bool__, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector___len__", _wrap_DoubleDoubleVector___len__, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_pop", _wrap_DoubleDoubleVector_pop, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector___getslice__", _wrap_DoubleDoubleVector___getslice__, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector___setslice__", _wrap_DoubleDoubleVector___setslice__, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector___delslice__", _wrap_DoubleDoubleVector___delslice__, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector___delitem__", _wrap_DoubleDoubleVector___delitem__, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector___getitem__", _wrap_DoubleDoubleVector___getitem__, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector___setitem__", _wrap_DoubleDoubleVector___setitem__, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_append", _wrap_DoubleDoubleVector_append, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_empty", _wrap_DoubleDoubleVector_empty, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_size", _wrap_DoubleDoubleVector_size, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_clear", _wrap_DoubleDoubleVector_clear, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_swap", _wrap_DoubleDoubleVector_swap, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_get_allocator", _wrap_DoubleDoubleVector_get_allocator, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_begin", _wrap_DoubleDoubleVector_begin, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_end", _wrap_DoubleDoubleVector_end, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_rbegin", _wrap_DoubleDoubleVector_rbegin, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_rend", _wrap_DoubleDoubleVector_rend, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_pop_back", _wrap_DoubleDoubleVector_pop_back, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_erase", _wrap_DoubleDoubleVector_erase, METH_VARARGS, NULL},
+	 { (char *)"new_DoubleDoubleVector", _wrap_new_DoubleDoubleVector, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_push_back", _wrap_DoubleDoubleVector_push_back, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_front", _wrap_DoubleDoubleVector_front, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_back", _wrap_DoubleDoubleVector_back, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_assign", _wrap_DoubleDoubleVector_assign, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_resize", _wrap_DoubleDoubleVector_resize, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_insert", _wrap_DoubleDoubleVector_insert, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_reserve", _wrap_DoubleDoubleVector_reserve, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_capacity", _wrap_DoubleDoubleVector_capacity, METH_VARARGS, NULL},
+	 { (char *)"delete_DoubleDoubleVector", _wrap_delete_DoubleDoubleVector, METH_VARARGS, NULL},
+	 { (char *)"DoubleDoubleVector_swigregister", DoubleDoubleVector_swigregister, METH_VARARGS, NULL},
+	 { (char *)"StringVector_iterator", _wrap_StringVector_iterator, METH_VARARGS, NULL},
+	 { (char *)"StringVector___nonzero__", _wrap_StringVector___nonzero__, METH_VARARGS, NULL},
+	 { (char *)"StringVector___bool__", _wrap_StringVector___bool__, METH_VARARGS, NULL},
+	 { (char *)"StringVector___len__", _wrap_StringVector___len__, METH_VARARGS, NULL},
+	 { (char *)"StringVector_pop", _wrap_StringVector_pop, METH_VARARGS, NULL},
+	 { (char *)"StringVector___getslice__", _wrap_StringVector___getslice__, METH_VARARGS, NULL},
+	 { (char *)"StringVector___setslice__", _wrap_StringVector___setslice__, METH_VARARGS, NULL},
+	 { (char *)"StringVector___delslice__", _wrap_StringVector___delslice__, METH_VARARGS, NULL},
+	 { (char *)"StringVector___delitem__", _wrap_StringVector___delitem__, METH_VARARGS, NULL},
+	 { (char *)"StringVector___getitem__", _wrap_StringVector___getitem__, METH_VARARGS, NULL},
+	 { (char *)"StringVector___setitem__", _wrap_StringVector___setitem__, METH_VARARGS, NULL},
+	 { (char *)"StringVector_append", _wrap_StringVector_append, METH_VARARGS, NULL},
+	 { (char *)"StringVector_empty", _wrap_StringVector_empty, METH_VARARGS, NULL},
+	 { (char *)"StringVector_size", _wrap_StringVector_size, METH_VARARGS, NULL},
+	 { (char *)"StringVector_clear", _wrap_StringVector_clear, METH_VARARGS, NULL},
+	 { (char *)"StringVector_swap", _wrap_StringVector_swap, METH_VARARGS, NULL},
+	 { (char *)"StringVector_get_allocator", _wrap_StringVector_get_allocator, METH_VARARGS, NULL},
+	 { (char *)"StringVector_begin", _wrap_StringVector_begin, METH_VARARGS, NULL},
+	 { (char *)"StringVector_end", _wrap_StringVector_end, METH_VARARGS, NULL},
+	 { (char *)"StringVector_rbegin", _wrap_StringVector_rbegin, METH_VARARGS, NULL},
+	 { (char *)"StringVector_rend", _wrap_StringVector_rend, METH_VARARGS, NULL},
+	 { (char *)"StringVector_pop_back", _wrap_StringVector_pop_back, METH_VARARGS, NULL},
+	 { (char *)"StringVector_erase", _wrap_StringVector_erase, METH_VARARGS, NULL},
+	 { (char *)"new_StringVector", _wrap_new_StringVector, METH_VARARGS, NULL},
+	 { (char *)"StringVector_push_back", _wrap_StringVector_push_back, METH_VARARGS, NULL},
+	 { (char *)"StringVector_front", _wrap_StringVector_front, METH_VARARGS, NULL},
+	 { (char *)"StringVector_back", _wrap_StringVector_back, METH_VARARGS, NULL},
+	 { (char *)"StringVector_assign", _wrap_StringVector_assign, METH_VARARGS, NULL},
+	 { (char *)"StringVector_resize", _wrap_StringVector_resize, METH_VARARGS, NULL},
+	 { (char *)"StringVector_insert", _wrap_StringVector_insert, METH_VARARGS, NULL},
+	 { (char *)"StringVector_reserve", _wrap_StringVector_reserve, METH_VARARGS, NULL},
+	 { (char *)"StringVector_capacity", _wrap_StringVector_capacity, METH_VARARGS, NULL},
+	 { (char *)"delete_StringVector", _wrap_delete_StringVector, METH_VARARGS, NULL},
+	 { (char *)"StringVector_swigregister", StringVector_swigregister, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_iterator", _wrap_VarsVector_iterator, METH_VARARGS, NULL},
+	 { (char *)"VarsVector___nonzero__", _wrap_VarsVector___nonzero__, METH_VARARGS, NULL},
+	 { (char *)"VarsVector___bool__", _wrap_VarsVector___bool__, METH_VARARGS, NULL},
+	 { (char *)"VarsVector___len__", _wrap_VarsVector___len__, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_pop", _wrap_VarsVector_pop, METH_VARARGS, NULL},
+	 { (char *)"VarsVector___getslice__", _wrap_VarsVector___getslice__, METH_VARARGS, NULL},
+	 { (char *)"VarsVector___setslice__", _wrap_VarsVector___setslice__, METH_VARARGS, NULL},
+	 { (char *)"VarsVector___delslice__", _wrap_VarsVector___delslice__, METH_VARARGS, NULL},
+	 { (char *)"VarsVector___delitem__", _wrap_VarsVector___delitem__, METH_VARARGS, NULL},
+	 { (char *)"VarsVector___getitem__", _wrap_VarsVector___getitem__, METH_VARARGS, NULL},
+	 { (char *)"VarsVector___setitem__", _wrap_VarsVector___setitem__, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_append", _wrap_VarsVector_append, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_empty", _wrap_VarsVector_empty, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_size", _wrap_VarsVector_size, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_clear", _wrap_VarsVector_clear, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_swap", _wrap_VarsVector_swap, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_get_allocator", _wrap_VarsVector_get_allocator, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_begin", _wrap_VarsVector_begin, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_end", _wrap_VarsVector_end, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_rbegin", _wrap_VarsVector_rbegin, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_rend", _wrap_VarsVector_rend, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_pop_back", _wrap_VarsVector_pop_back, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_erase", _wrap_VarsVector_erase, METH_VARARGS, NULL},
+	 { (char *)"new_VarsVector", _wrap_new_VarsVector, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_push_back", _wrap_VarsVector_push_back, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_front", _wrap_VarsVector_front, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_back", _wrap_VarsVector_back, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_assign", _wrap_VarsVector_assign, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_resize", _wrap_VarsVector_resize, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_insert", _wrap_VarsVector_insert, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_reserve", _wrap_VarsVector_reserve, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_capacity", _wrap_VarsVector_capacity, METH_VARARGS, NULL},
+	 { (char *)"delete_VarsVector", _wrap_delete_VarsVector, METH_VARARGS, NULL},
+	 { (char *)"VarsVector_swigregister", VarsVector_swigregister, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_iterator", _wrap_VarsMap_iterator, METH_VARARGS, NULL},
+	 { (char *)"VarsMap___nonzero__", _wrap_VarsMap___nonzero__, METH_VARARGS, NULL},
+	 { (char *)"VarsMap___bool__", _wrap_VarsMap___bool__, METH_VARARGS, NULL},
+	 { (char *)"VarsMap___len__", _wrap_VarsMap___len__, METH_VARARGS, NULL},
+	 { (char *)"VarsMap___getitem__", _wrap_VarsMap___getitem__, METH_VARARGS, NULL},
+	 { (char *)"VarsMap___delitem__", _wrap_VarsMap___delitem__, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_has_key", _wrap_VarsMap_has_key, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_keys", _wrap_VarsMap_keys, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_values", _wrap_VarsMap_values, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_items", _wrap_VarsMap_items, METH_VARARGS, NULL},
+	 { (char *)"VarsMap___contains__", _wrap_VarsMap___contains__, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_key_iterator", _wrap_VarsMap_key_iterator, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_value_iterator", _wrap_VarsMap_value_iterator, METH_VARARGS, NULL},
+	 { (char *)"VarsMap___setitem__", _wrap_VarsMap___setitem__, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_asdict", _wrap_VarsMap_asdict, METH_VARARGS, NULL},
+	 { (char *)"new_VarsMap", _wrap_new_VarsMap, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_empty", _wrap_VarsMap_empty, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_size", _wrap_VarsMap_size, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_clear", _wrap_VarsMap_clear, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_swap", _wrap_VarsMap_swap, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_get_allocator", _wrap_VarsMap_get_allocator, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_begin", _wrap_VarsMap_begin, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_end", _wrap_VarsMap_end, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_rbegin", _wrap_VarsMap_rbegin, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_rend", _wrap_VarsMap_rend, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_count", _wrap_VarsMap_count, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_erase", _wrap_VarsMap_erase, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_find", _wrap_VarsMap_find, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_lower_bound", _wrap_VarsMap_lower_bound, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_upper_bound", _wrap_VarsMap_upper_bound, METH_VARARGS, NULL},
+	 { (char *)"delete_VarsMap", _wrap_delete_VarsMap, METH_VARARGS, NULL},
+	 { (char *)"VarsMap_swigregister", VarsMap_swigregister, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_iterator", _wrap_VarsByCode_iterator, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode___nonzero__", _wrap_VarsByCode___nonzero__, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode___bool__", _wrap_VarsByCode___bool__, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode___len__", _wrap_VarsByCode___len__, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode___getitem__", _wrap_VarsByCode___getitem__, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode___delitem__", _wrap_VarsByCode___delitem__, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_has_key", _wrap_VarsByCode_has_key, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_keys", _wrap_VarsByCode_keys, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_values", _wrap_VarsByCode_values, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_items", _wrap_VarsByCode_items, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode___contains__", _wrap_VarsByCode___contains__, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_key_iterator", _wrap_VarsByCode_key_iterator, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_value_iterator", _wrap_VarsByCode_value_iterator, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode___setitem__", _wrap_VarsByCode___setitem__, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_asdict", _wrap_VarsByCode_asdict, METH_VARARGS, NULL},
+	 { (char *)"new_VarsByCode", _wrap_new_VarsByCode, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_empty", _wrap_VarsByCode_empty, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_size", _wrap_VarsByCode_size, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_clear", _wrap_VarsByCode_clear, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_swap", _wrap_VarsByCode_swap, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_get_allocator", _wrap_VarsByCode_get_allocator, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_begin", _wrap_VarsByCode_begin, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_end", _wrap_VarsByCode_end, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_rbegin", _wrap_VarsByCode_rbegin, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_rend", _wrap_VarsByCode_rend, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_count", _wrap_VarsByCode_count, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_erase", _wrap_VarsByCode_erase, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_find", _wrap_VarsByCode_find, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_lower_bound", _wrap_VarsByCode_lower_bound, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_upper_bound", _wrap_VarsByCode_upper_bound, METH_VARARGS, NULL},
+	 { (char *)"delete_VarsByCode", _wrap_delete_VarsByCode, METH_VARARGS, NULL},
+	 { (char *)"VarsByCode_swigregister", VarsByCode_swigregister, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_iterator", _wrap_TaxesMap_iterator, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap___nonzero__", _wrap_TaxesMap___nonzero__, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap___bool__", _wrap_TaxesMap___bool__, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap___len__", _wrap_TaxesMap___len__, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap___getitem__", _wrap_TaxesMap___getitem__, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap___delitem__", _wrap_TaxesMap___delitem__, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_has_key", _wrap_TaxesMap_has_key, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_keys", _wrap_TaxesMap_keys, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_values", _wrap_TaxesMap_values, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_items", _wrap_TaxesMap_items, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap___contains__", _wrap_TaxesMap___contains__, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_key_iterator", _wrap_TaxesMap_key_iterator, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_value_iterator", _wrap_TaxesMap_value_iterator, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap___setitem__", _wrap_TaxesMap___setitem__, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_asdict", _wrap_TaxesMap_asdict, METH_VARARGS, NULL},
+	 { (char *)"new_TaxesMap", _wrap_new_TaxesMap, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_empty", _wrap_TaxesMap_empty, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_size", _wrap_TaxesMap_size, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_clear", _wrap_TaxesMap_clear, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_swap", _wrap_TaxesMap_swap, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_get_allocator", _wrap_TaxesMap_get_allocator, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_begin", _wrap_TaxesMap_begin, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_end", _wrap_TaxesMap_end, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_rbegin", _wrap_TaxesMap_rbegin, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_rend", _wrap_TaxesMap_rend, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_count", _wrap_TaxesMap_count, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_erase", _wrap_TaxesMap_erase, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_find", _wrap_TaxesMap_find, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_lower_bound", _wrap_TaxesMap_lower_bound, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_upper_bound", _wrap_TaxesMap_upper_bound, METH_VARARGS, NULL},
+	 { (char *)"delete_TaxesMap", _wrap_delete_TaxesMap, METH_VARARGS, NULL},
+	 { (char *)"TaxesMap_swigregister", TaxesMap_swigregister, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_iterator", _wrap_ZaxesMap_iterator, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap___nonzero__", _wrap_ZaxesMap___nonzero__, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap___bool__", _wrap_ZaxesMap___bool__, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap___len__", _wrap_ZaxesMap___len__, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap___getitem__", _wrap_ZaxesMap___getitem__, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap___delitem__", _wrap_ZaxesMap___delitem__, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_has_key", _wrap_ZaxesMap_has_key, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_keys", _wrap_ZaxesMap_keys, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_values", _wrap_ZaxesMap_values, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_items", _wrap_ZaxesMap_items, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap___contains__", _wrap_ZaxesMap___contains__, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_key_iterator", _wrap_ZaxesMap_key_iterator, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_value_iterator", _wrap_ZaxesMap_value_iterator, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap___setitem__", _wrap_ZaxesMap___setitem__, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_asdict", _wrap_ZaxesMap_asdict, METH_VARARGS, NULL},
+	 { (char *)"new_ZaxesMap", _wrap_new_ZaxesMap, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_empty", _wrap_ZaxesMap_empty, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_size", _wrap_ZaxesMap_size, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_clear", _wrap_ZaxesMap_clear, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_swap", _wrap_ZaxesMap_swap, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_get_allocator", _wrap_ZaxesMap_get_allocator, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_begin", _wrap_ZaxesMap_begin, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_end", _wrap_ZaxesMap_end, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_rbegin", _wrap_ZaxesMap_rbegin, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_rend", _wrap_ZaxesMap_rend, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_count", _wrap_ZaxesMap_count, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_erase", _wrap_ZaxesMap_erase, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_find", _wrap_ZaxesMap_find, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_lower_bound", _wrap_ZaxesMap_lower_bound, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_upper_bound", _wrap_ZaxesMap_upper_bound, METH_VARARGS, NULL},
+	 { (char *)"delete_ZaxesMap", _wrap_delete_ZaxesMap, METH_VARARGS, NULL},
+	 { (char *)"ZaxesMap_swigregister", ZaxesMap_swigregister, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_iterator", _wrap_GridsMap_iterator, METH_VARARGS, NULL},
+	 { (char *)"GridsMap___nonzero__", _wrap_GridsMap___nonzero__, METH_VARARGS, NULL},
+	 { (char *)"GridsMap___bool__", _wrap_GridsMap___bool__, METH_VARARGS, NULL},
+	 { (char *)"GridsMap___len__", _wrap_GridsMap___len__, METH_VARARGS, NULL},
+	 { (char *)"GridsMap___getitem__", _wrap_GridsMap___getitem__, METH_VARARGS, NULL},
+	 { (char *)"GridsMap___delitem__", _wrap_GridsMap___delitem__, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_has_key", _wrap_GridsMap_has_key, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_keys", _wrap_GridsMap_keys, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_values", _wrap_GridsMap_values, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_items", _wrap_GridsMap_items, METH_VARARGS, NULL},
+	 { (char *)"GridsMap___contains__", _wrap_GridsMap___contains__, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_key_iterator", _wrap_GridsMap_key_iterator, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_value_iterator", _wrap_GridsMap_value_iterator, METH_VARARGS, NULL},
+	 { (char *)"GridsMap___setitem__", _wrap_GridsMap___setitem__, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_asdict", _wrap_GridsMap_asdict, METH_VARARGS, NULL},
+	 { (char *)"new_GridsMap", _wrap_new_GridsMap, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_empty", _wrap_GridsMap_empty, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_size", _wrap_GridsMap_size, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_clear", _wrap_GridsMap_clear, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_swap", _wrap_GridsMap_swap, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_get_allocator", _wrap_GridsMap_get_allocator, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_begin", _wrap_GridsMap_begin, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_end", _wrap_GridsMap_end, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_rbegin", _wrap_GridsMap_rbegin, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_rend", _wrap_GridsMap_rend, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_count", _wrap_GridsMap_count, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_erase", _wrap_GridsMap_erase, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_find", _wrap_GridsMap_find, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_lower_bound", _wrap_GridsMap_lower_bound, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_upper_bound", _wrap_GridsMap_upper_bound, METH_VARARGS, NULL},
+	 { (char *)"delete_GridsMap", _wrap_delete_GridsMap, METH_VARARGS, NULL},
+	 { (char *)"GridsMap_swigregister", GridsMap_swigregister, METH_VARARGS, NULL},
+	 { (char *)"new_CdiGrid", _wrap_new_CdiGrid, METH_VARARGS, NULL},
+	 { (char *)"delete_CdiGrid", _wrap_delete_CdiGrid, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_gridID_set", _wrap_CdiGrid_gridID_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_gridID_get", _wrap_CdiGrid_gridID_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_type_set", _wrap_CdiGrid_type_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_type_get", _wrap_CdiGrid_type_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_size_set", _wrap_CdiGrid_size_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_size_get", _wrap_CdiGrid_size_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xsize_set", _wrap_CdiGrid_xsize_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xsize_get", _wrap_CdiGrid_xsize_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_ysize_set", _wrap_CdiGrid_ysize_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_ysize_get", _wrap_CdiGrid_ysize_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_prec_set", _wrap_CdiGrid_prec_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_prec_get", _wrap_CdiGrid_prec_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_ncorner_set", _wrap_CdiGrid_ncorner_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_ncorner_get", _wrap_CdiGrid_ncorner_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_hasXValues_set", _wrap_CdiGrid_hasXValues_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_hasXValues_get", _wrap_CdiGrid_hasXValues_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_hasYValues_set", _wrap_CdiGrid_hasYValues_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_hasYValues_get", _wrap_CdiGrid_hasYValues_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_hasBounds_set", _wrap_CdiGrid_hasBounds_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_hasBounds_get", _wrap_CdiGrid_hasBounds_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xvalues_set", _wrap_CdiGrid_xvalues_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xvalues_get", _wrap_CdiGrid_xvalues_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_yvalues_set", _wrap_CdiGrid_yvalues_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_yvalues_get", _wrap_CdiGrid_yvalues_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xbounds_set", _wrap_CdiGrid_xbounds_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xbounds_get", _wrap_CdiGrid_xbounds_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_ybounds_set", _wrap_CdiGrid_ybounds_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_ybounds_get", _wrap_CdiGrid_ybounds_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xname_set", _wrap_CdiGrid_xname_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xname_get", _wrap_CdiGrid_xname_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xlongname_set", _wrap_CdiGrid_xlongname_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xlongname_get", _wrap_CdiGrid_xlongname_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xstdname_set", _wrap_CdiGrid_xstdname_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xstdname_get", _wrap_CdiGrid_xstdname_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xunits_set", _wrap_CdiGrid_xunits_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_xunits_get", _wrap_CdiGrid_xunits_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_yname_set", _wrap_CdiGrid_yname_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_yname_get", _wrap_CdiGrid_yname_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_ylongname_set", _wrap_CdiGrid_ylongname_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_ylongname_get", _wrap_CdiGrid_ylongname_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_ystdname_set", _wrap_CdiGrid_ystdname_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_ystdname_get", _wrap_CdiGrid_ystdname_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_yunits_set", _wrap_CdiGrid_yunits_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_yunits_get", _wrap_CdiGrid_yunits_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_name_set", _wrap_CdiGrid_name_set, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_name_get", _wrap_CdiGrid_name_get, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_getValues", _wrap_CdiGrid_getValues, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_getBounds", _wrap_CdiGrid_getBounds, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_getValuesAsPointer", _wrap_CdiGrid_getValuesAsPointer, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_getBoundsAsPointer", _wrap_CdiGrid_getBoundsAsPointer, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_getFloatVals", _wrap_CdiGrid_getFloatVals, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_getFloatBounds", _wrap_CdiGrid_getFloatBounds, METH_VARARGS, NULL},
+	 { (char *)"CdiGrid_swigregister", CdiGrid_swigregister, METH_VARARGS, NULL},
+	 { (char *)"new_CdiTaxis", _wrap_new_CdiTaxis, METH_VARARGS, NULL},
+	 { (char *)"delete_CdiTaxis", _wrap_delete_CdiTaxis, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_taxisID_set", _wrap_CdiTaxis_taxisID_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_taxisID_get", _wrap_CdiTaxis_taxisID_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_ntsteps_set", _wrap_CdiTaxis_ntsteps_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_ntsteps_get", _wrap_CdiTaxis_ntsteps_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_unit_set", _wrap_CdiTaxis_unit_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_unit_get", _wrap_CdiTaxis_unit_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_rdate_set", _wrap_CdiTaxis_rdate_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_rdate_get", _wrap_CdiTaxis_rdate_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_rtime_set", _wrap_CdiTaxis_rtime_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_rtime_get", _wrap_CdiTaxis_rtime_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_vdate_set", _wrap_CdiTaxis_vdate_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_vdate_get", _wrap_CdiTaxis_vdate_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_vtime_set", _wrap_CdiTaxis_vtime_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_vtime_get", _wrap_CdiTaxis_vtime_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_type_set", _wrap_CdiTaxis_type_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_type_get", _wrap_CdiTaxis_type_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_calendar_set", _wrap_CdiTaxis_calendar_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_calendar_get", _wrap_CdiTaxis_calendar_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_hasBounds_set", _wrap_CdiTaxis_hasBounds_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_hasBounds_get", _wrap_CdiTaxis_hasBounds_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_name_set", _wrap_CdiTaxis_name_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_name_get", _wrap_CdiTaxis_name_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_unitname_set", _wrap_CdiTaxis_unitname_set, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_unitname_get", _wrap_CdiTaxis_unitname_get, METH_VARARGS, NULL},
+	 { (char *)"CdiTaxis_swigregister", CdiTaxis_swigregister, METH_VARARGS, NULL},
+	 { (char *)"new_CdiZaxis", _wrap_new_CdiZaxis, METH_VARARGS, NULL},
+	 { (char *)"delete_CdiZaxis", _wrap_delete_CdiZaxis, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_zaxisID_set", _wrap_CdiZaxis_zaxisID_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_zaxisID_get", _wrap_CdiZaxis_zaxisID_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_type_set", _wrap_CdiZaxis_type_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_type_get", _wrap_CdiZaxis_type_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_ltype_set", _wrap_CdiZaxis_ltype_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_ltype_get", _wrap_CdiZaxis_ltype_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_size_set", _wrap_CdiZaxis_size_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_size_get", _wrap_CdiZaxis_size_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_prec_set", _wrap_CdiZaxis_prec_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_prec_get", _wrap_CdiZaxis_prec_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_plevels_set", _wrap_CdiZaxis_plevels_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_plevels_get", _wrap_CdiZaxis_plevels_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_plbounds_set", _wrap_CdiZaxis_plbounds_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_plbounds_get", _wrap_CdiZaxis_plbounds_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_pubounds_set", _wrap_CdiZaxis_pubounds_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_pubounds_get", _wrap_CdiZaxis_pubounds_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_pweights_set", _wrap_CdiZaxis_pweights_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_pweights_get", _wrap_CdiZaxis_pweights_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_levels_set", _wrap_CdiZaxis_levels_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_levels_get", _wrap_CdiZaxis_levels_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_lbounds_set", _wrap_CdiZaxis_lbounds_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_lbounds_get", _wrap_CdiZaxis_lbounds_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_ubounds_set", _wrap_CdiZaxis_ubounds_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_ubounds_get", _wrap_CdiZaxis_ubounds_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_weights_set", _wrap_CdiZaxis_weights_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_weights_get", _wrap_CdiZaxis_weights_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_name_set", _wrap_CdiZaxis_name_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_name_get", _wrap_CdiZaxis_name_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_longname_set", _wrap_CdiZaxis_longname_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_longname_get", _wrap_CdiZaxis_longname_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_units_set", _wrap_CdiZaxis_units_set, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_units_get", _wrap_CdiZaxis_units_get, METH_VARARGS, NULL},
+	 { (char *)"CdiZaxis_swigregister", CdiZaxis_swigregister, METH_VARARGS, NULL},
+	 { (char *)"new_CdiVariable", _wrap_new_CdiVariable, METH_VARARGS, NULL},
+	 { (char *)"delete_CdiVariable", _wrap_delete_CdiVariable, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_varID_set", _wrap_CdiVariable_varID_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_varID_get", _wrap_CdiVariable_varID_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_zaxisID_set", _wrap_CdiVariable_zaxisID_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_zaxisID_get", _wrap_CdiVariable_zaxisID_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_gridID_set", _wrap_CdiVariable_gridID_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_gridID_get", _wrap_CdiVariable_gridID_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_taxisID_set", _wrap_CdiVariable_taxisID_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_taxisID_get", _wrap_CdiVariable_taxisID_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_timeID_set", _wrap_CdiVariable_timeID_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_timeID_get", _wrap_CdiVariable_timeID_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_vlistID_set", _wrap_CdiVariable_vlistID_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_vlistID_get", _wrap_CdiVariable_vlistID_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_size_set", _wrap_CdiVariable_size_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_size_get", _wrap_CdiVariable_size_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_code_set", _wrap_CdiVariable_code_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_code_get", _wrap_CdiVariable_code_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_datatype_set", _wrap_CdiVariable_datatype_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_datatype_get", _wrap_CdiVariable_datatype_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_streamID_set", _wrap_CdiVariable_streamID_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_streamID_get", _wrap_CdiVariable_streamID_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_name_set", _wrap_CdiVariable_name_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_name_get", _wrap_CdiVariable_name_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_longname_set", _wrap_CdiVariable_longname_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_longname_get", _wrap_CdiVariable_longname_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_units_set", _wrap_CdiVariable_units_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_units_get", _wrap_CdiVariable_units_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_stdname_set", _wrap_CdiVariable_stdname_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_stdname_get", _wrap_CdiVariable_stdname_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_missval_set", _wrap_CdiVariable_missval_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_missval_get", _wrap_CdiVariable_missval_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_values_set", _wrap_CdiVariable_values_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_values_get", _wrap_CdiVariable_values_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_valuesWithLevel_set", _wrap_CdiVariable_valuesWithLevel_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_valuesWithLevel_get", _wrap_CdiVariable_valuesWithLevel_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_grid_set", _wrap_CdiVariable_grid_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_grid_get", _wrap_CdiVariable_grid_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_zaxis_set", _wrap_CdiVariable_zaxis_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_zaxis_get", _wrap_CdiVariable_zaxis_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_taxis_set", _wrap_CdiVariable_taxis_set, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_taxis_get", _wrap_CdiVariable_taxis_get, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_sinfo", _wrap_CdiVariable_sinfo, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_getValues", _wrap_CdiVariable_getValues, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_getValuesWithLevel", _wrap_CdiVariable_getValuesWithLevel, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_getFValues", _wrap_CdiVariable_getFValues, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_getFValuesWithLevel", _wrap_CdiVariable_getFValuesWithLevel, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_getValuesAsPointer", _wrap_CdiVariable_getValuesAsPointer, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_getValuesWithLevelAsPointer", _wrap_CdiVariable_getValuesWithLevelAsPointer, METH_VARARGS, NULL},
+	 { (char *)"CdiVariable_swigregister", CdiVariable_swigregister, METH_VARARGS, NULL},
+	 { (char *)"new_Cdi", _wrap_new_Cdi, METH_VARARGS, NULL},
+	 { (char *)"delete_Cdi", _wrap_delete_Cdi, METH_VARARGS, NULL},
+	 { (char *)"Cdi_streamID_set", _wrap_Cdi_streamID_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_streamID_get", _wrap_Cdi_streamID_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_vlistID_set", _wrap_Cdi_vlistID_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_vlistID_get", _wrap_Cdi_vlistID_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_nvars_set", _wrap_Cdi_nvars_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_nvars_get", _wrap_Cdi_nvars_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_nzaxes_set", _wrap_Cdi_nzaxes_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_nzaxes_get", _wrap_Cdi_nzaxes_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_ngrids_set", _wrap_Cdi_ngrids_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_ngrids_get", _wrap_Cdi_ngrids_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_ntaxes_set", _wrap_Cdi_ntaxes_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_ntaxes_get", _wrap_Cdi_ntaxes_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_taxisID_set", _wrap_Cdi_taxisID_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_taxisID_get", _wrap_Cdi_taxisID_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_varnames_set", _wrap_Cdi_varnames_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_varnames_get", _wrap_Cdi_varnames_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_codes_set", _wrap_Cdi_codes_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_codes_get", _wrap_Cdi_codes_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_variables_set", _wrap_Cdi_variables_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_variables_get", _wrap_Cdi_variables_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_var_set", _wrap_Cdi_var_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_var_get", _wrap_Cdi_var_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_varByCode_set", _wrap_Cdi_varByCode_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_varByCode_get", _wrap_Cdi_varByCode_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_taxes_set", _wrap_Cdi_taxes_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_taxes_get", _wrap_Cdi_taxes_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_zaxes_set", _wrap_Cdi_zaxes_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_zaxes_get", _wrap_Cdi_zaxes_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_grids_set", _wrap_Cdi_grids_set, METH_VARARGS, NULL},
+	 { (char *)"Cdi_grids_get", _wrap_Cdi_grids_get, METH_VARARGS, NULL},
+	 { (char *)"Cdi_griddes", _wrap_Cdi_griddes, METH_VARARGS, NULL},
+	 { (char *)"Cdi_swigregister", Cdi_swigregister, METH_VARARGS, NULL},
+	 { NULL, NULL, 0, NULL }
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_Cdi = {"_p_Cdi", "Cdi *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CdiGrid = {"_p_CdiGrid", "std::map< int,CdiGrid >::mapped_type *|CdiGrid *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CdiTaxis = {"_p_CdiTaxis", "std::map< int,CdiTaxis >::mapped_type *|CdiTaxis *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CdiVariable = {"_p_CdiVariable", "std::map< std::string,CdiVariable >::mapped_type *|std::vector< CdiVariable >::value_type *|std::map< int,CdiVariable >::mapped_type *|CdiVariable *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CdiZaxis = {"_p_CdiZaxis", "std::map< int,CdiZaxis >::mapped_type *|CdiZaxis *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_allocator_type = {"_p_allocator_type", "allocator_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_difference_type = {"_p_difference_type", "difference_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_key_type = {"_p_key_type", "key_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_mapped_type = {"_p_mapped_type", "mapped_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_PyObject = {"_p_p_PyObject", "PyObject **", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_double = {"_p_p_double", "double **", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_size_type = {"_p_size_type", "size_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_CdiVariable_t = {"_p_std__allocatorT_CdiVariable_t", "std::vector< CdiVariable >::allocator_type *|std::allocator< CdiVariable > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_double_t = {"_p_std__allocatorT_double_t", "std::vector< double >::allocator_type *|std::allocator< double > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_int_t = {"_p_std__allocatorT_int_t", "std::vector< int >::allocator_type *|std::allocator< int > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t = {"_p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t", "std::map< int,CdiGrid >::allocator_type *|std::allocator< std::pair< int const,CdiGrid > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t = {"_p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t", "std::map< int,CdiTaxis >::allocator_type *|std::allocator< std::pair< int const,CdiTaxis > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t = {"_p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t", "std::map< int,CdiVariable >::allocator_type *|std::allocator< std::pair< int const,CdiVariable > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t = {"_p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t", "std::map< int,CdiZaxis >::allocator_type *|std::allocator< std::pair< int const,CdiZaxis > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t = {"_p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t", "std::allocator< std::pair< std::string const,CdiVariable > > *|std::map< std::string,CdiVariable >::allocator_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__string_t = {"_p_std__allocatorT_std__string_t", "std::vector< std::string >::allocator_type *|std::allocator< std::string > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t = {"_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t", "std::vector< std::vector< double > >::allocator_type *|std::allocator< std::vector< double,std::allocator< double > > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__invalid_argument = {"_p_std__invalid_argument", "std::invalid_argument *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__lessT_int_t = {"_p_std__lessT_int_t", "std::less< int > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__lessT_std__string_t = {"_p_std__lessT_std__string_t", "std::less< std::string > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t = {"_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t", "std::map< int,CdiGrid > *|std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t = {"_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t", "std::map< int,CdiTaxis > *|std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t = {"_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t", "std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *|std::map< int,CdiVariable > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t = {"_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t", "std::map< int,CdiZaxis > *|std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t = {"_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t", "std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *|std::map< std::string,CdiVariable > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t = {"_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t", "std::vector< CdiVariable,std::allocator< CdiVariable > > *|std::vector< CdiVariable > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT__Tp__Alloc_t = {"_p_std__vectorT__Tp__Alloc_t", "std::vector< _Tp,_Alloc > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_double_std__allocatorT_double_t_t = {"_p_std__vectorT_double_std__allocatorT_double_t_t", "std::vector< double,std::allocator< double > > *|std::vector< double > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_float_std__allocatorT_float_t_t = {"_p_std__vectorT_float_std__allocatorT_float_t_t", "std::vector< float,std::allocator< float > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_int_std__allocatorT_int_t_t = {"_p_std__vectorT_int_std__allocatorT_int_t_t", "std::vector< int,std::allocator< int > > *|std::vector< int > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t = {"_p_std__vectorT_std__string_std__allocatorT_std__string_t_t", "std::vector< std::string,std::allocator< std::string > > *|std::vector< std::string > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t = {"_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t", "std::vector< std::vector< double > > *|std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *|std::vector< std::vector< do [...]
+static swig_type_info _swigt__p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t = {"_p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t", "std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_swig__SwigPyIterator = {"_p_swig__SwigPyIterator", "swig::SwigPyIterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_value_type = {"_p_value_type", "value_type *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_Cdi,
+  &_swigt__p_CdiGrid,
+  &_swigt__p_CdiTaxis,
+  &_swigt__p_CdiVariable,
+  &_swigt__p_CdiZaxis,
+  &_swigt__p_allocator_type,
+  &_swigt__p_char,
+  &_swigt__p_difference_type,
+  &_swigt__p_double,
+  &_swigt__p_float,
+  &_swigt__p_key_type,
+  &_swigt__p_mapped_type,
+  &_swigt__p_p_PyObject,
+  &_swigt__p_p_double,
+  &_swigt__p_size_type,
+  &_swigt__p_std__allocatorT_CdiVariable_t,
+  &_swigt__p_std__allocatorT_double_t,
+  &_swigt__p_std__allocatorT_int_t,
+  &_swigt__p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t,
+  &_swigt__p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t,
+  &_swigt__p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t,
+  &_swigt__p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t,
+  &_swigt__p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t,
+  &_swigt__p_std__allocatorT_std__string_t,
+  &_swigt__p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t,
+  &_swigt__p_std__invalid_argument,
+  &_swigt__p_std__lessT_int_t,
+  &_swigt__p_std__lessT_std__string_t,
+  &_swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t,
+  &_swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t,
+  &_swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t,
+  &_swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t,
+  &_swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t,
+  &_swigt__p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t,
+  &_swigt__p_std__vectorT__Tp__Alloc_t,
+  &_swigt__p_std__vectorT_double_std__allocatorT_double_t_t,
+  &_swigt__p_std__vectorT_float_std__allocatorT_float_t_t,
+  &_swigt__p_std__vectorT_int_std__allocatorT_int_t_t,
+  &_swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t,
+  &_swigt__p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t,
+  &_swigt__p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t,
+  &_swigt__p_swig__SwigPyIterator,
+  &_swigt__p_value_type,
+};
+
+static swig_cast_info _swigc__p_Cdi[] = {  {&_swigt__p_Cdi, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CdiGrid[] = {  {&_swigt__p_CdiGrid, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CdiTaxis[] = {  {&_swigt__p_CdiTaxis, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CdiVariable[] = {  {&_swigt__p_CdiVariable, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CdiZaxis[] = {  {&_swigt__p_CdiZaxis, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_allocator_type[] = {  {&_swigt__p_allocator_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_difference_type[] = {  {&_swigt__p_difference_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_key_type[] = {  {&_swigt__p_key_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_mapped_type[] = {  {&_swigt__p_mapped_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_PyObject[] = {  {&_swigt__p_p_PyObject, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_double[] = {  {&_swigt__p_p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_size_type[] = {  {&_swigt__p_size_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_CdiVariable_t[] = {  {&_swigt__p_std__allocatorT_CdiVariable_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_double_t[] = {  {&_swigt__p_std__allocatorT_double_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_int_t[] = {  {&_swigt__p_std__allocatorT_int_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t[] = {  {&_swigt__p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t[] = {  {&_swigt__p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t[] = {  {&_swigt__p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t[] = {  {&_swigt__p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t[] = {  {&_swigt__p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__string_t[] = {  {&_swigt__p_std__allocatorT_std__string_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t[] = {  {&_swigt__p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__invalid_argument[] = {  {&_swigt__p_std__invalid_argument, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__lessT_int_t[] = {  {&_swigt__p_std__lessT_int_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__lessT_std__string_t[] = {  {&_swigt__p_std__lessT_std__string_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t[] = {  {&_swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t[] = {  {&_swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t[] = {  {&_swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t[] = {  {&_swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t[] = {  {&_swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t[] = {  {&_swigt__p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT__Tp__Alloc_t[] = {  {&_swigt__p_std__vectorT__Tp__Alloc_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_double_std__allocatorT_double_t_t[] = {  {&_swigt__p_std__vectorT_double_std__allocatorT_double_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_float_std__allocatorT_float_t_t[] = {  {&_swigt__p_std__vectorT_float_std__allocatorT_float_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_int_std__allocatorT_int_t_t[] = {  {&_swigt__p_std__vectorT_int_std__allocatorT_int_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_std__string_std__allocatorT_std__string_t_t[] = {  {&_swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t[] = {  {&_swigt__p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t[] = {  {&_swigt__p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_swig__SwigPyIterator[] = {  {&_swigt__p_swig__SwigPyIterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_value_type[] = {  {&_swigt__p_value_type, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_Cdi,
+  _swigc__p_CdiGrid,
+  _swigc__p_CdiTaxis,
+  _swigc__p_CdiVariable,
+  _swigc__p_CdiZaxis,
+  _swigc__p_allocator_type,
+  _swigc__p_char,
+  _swigc__p_difference_type,
+  _swigc__p_double,
+  _swigc__p_float,
+  _swigc__p_key_type,
+  _swigc__p_mapped_type,
+  _swigc__p_p_PyObject,
+  _swigc__p_p_double,
+  _swigc__p_size_type,
+  _swigc__p_std__allocatorT_CdiVariable_t,
+  _swigc__p_std__allocatorT_double_t,
+  _swigc__p_std__allocatorT_int_t,
+  _swigc__p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t,
+  _swigc__p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t,
+  _swigc__p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t,
+  _swigc__p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t,
+  _swigc__p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t,
+  _swigc__p_std__allocatorT_std__string_t,
+  _swigc__p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t,
+  _swigc__p_std__invalid_argument,
+  _swigc__p_std__lessT_int_t,
+  _swigc__p_std__lessT_std__string_t,
+  _swigc__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t,
+  _swigc__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t,
+  _swigc__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t,
+  _swigc__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t,
+  _swigc__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t,
+  _swigc__p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t,
+  _swigc__p_std__vectorT__Tp__Alloc_t,
+  _swigc__p_std__vectorT_double_std__allocatorT_double_t_t,
+  _swigc__p_std__vectorT_float_std__allocatorT_float_t_t,
+  _swigc__p_std__vectorT_int_std__allocatorT_int_t_t,
+  _swigc__p_std__vectorT_std__string_std__allocatorT_std__string_t_t,
+  _swigc__p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t,
+  _swigc__p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t,
+  _swigc__p_swig__SwigPyIterator,
+  _swigc__p_value_type,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+static swig_const_info swig_const_table[] = {
+{0, 0, 0, 0.0, 0, 0}};
+
+#ifdef __cplusplus
+}
+#endif
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found, init;
+  
+  clientdata = clientdata;
+  
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+    init = 1;
+  } else {
+    init = 0;
+  }
+  
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+    
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+  
+  /* When multiple interpeters are used, a module could have already been initialized in
+       a different interpreter, but not yet have a pointer in this interpreter.
+       In this case, we do not want to continue adding types... everything should be
+       set up already */
+  if (init == 0) return;
+  
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+    
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+    
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+        type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+    
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+        if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+        if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+          printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+          cast->type = ret;
+          ret = 0;
+        } else {
+          /* Check for casting already in the list */
+          swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+          if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+          if (!ocast) ret = 0;
+        }
+      }
+      
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+        printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+  
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+    printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+  
+  if (init_run) return;
+  init_run = 1;
+  
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+          SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{
+  /* c-mode */
+#endif
+}
+#endif
+
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+  
+  /* Python-specific SWIG API */
+#define SWIG_newvarlink()                             SWIG_Python_newvarlink()
+#define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
+#define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
+  
+  /* -----------------------------------------------------------------------------
+   * global variable support code.
+   * ----------------------------------------------------------------------------- */
+  
+  typedef struct swig_globalvar {
+    char       *name;                  /* Name of global variable */
+    PyObject *(*get_attr)(void);       /* Return the current value */
+    int       (*set_attr)(PyObject *); /* Set the value */
+    struct swig_globalvar *next;
+  } swig_globalvar;
+  
+  typedef struct swig_varlinkobject {
+    PyObject_HEAD
+    swig_globalvar *vars;
+  } swig_varlinkobject;
+  
+  SWIGINTERN PyObject *
+  swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
+#if PY_VERSION_HEX >= 0x03000000
+    return PyUnicode_InternFromString("<Swig global variables>");
+#else
+    return PyString_FromString("<Swig global variables>");
+#endif
+  }
+  
+  SWIGINTERN PyObject *
+  swig_varlink_str(swig_varlinkobject *v) {
+#if PY_VERSION_HEX >= 0x03000000
+    PyObject *str = PyUnicode_InternFromString("(");
+    PyObject *tail;
+    PyObject *joined;
+    swig_globalvar *var;
+    for (var = v->vars; var; var=var->next) {
+      tail = PyUnicode_FromString(var->name);
+      joined = PyUnicode_Concat(str, tail);
+      Py_DecRef(str);
+      Py_DecRef(tail);
+      str = joined;
+      if (var->next) {
+        tail = PyUnicode_InternFromString(", ");
+        joined = PyUnicode_Concat(str, tail);
+        Py_DecRef(str);
+        Py_DecRef(tail);
+        str = joined;
+      }
+    }
+    tail = PyUnicode_InternFromString(")");
+    joined = PyUnicode_Concat(str, tail);
+    Py_DecRef(str);
+    Py_DecRef(tail);
+    str = joined;
+#else
+    PyObject *str = PyString_FromString("(");
+    swig_globalvar *var;
+    for (var = v->vars; var; var=var->next) {
+      PyString_ConcatAndDel(&str,PyString_FromString(var->name));
+      if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
+    }
+    PyString_ConcatAndDel(&str,PyString_FromString(")"));
+#endif
+    return str;
+  }
+  
+  SWIGINTERN int
+  swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) {
+    char *tmp;
+    PyObject *str = swig_varlink_str(v);
+    fprintf(fp,"Swig global variables ");
+    fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str));
+    SWIG_Python_str_DelForPy3(tmp);
+    Py_DECREF(str);
+    return 0;
+  }
+  
+  SWIGINTERN void
+  swig_varlink_dealloc(swig_varlinkobject *v) {
+    swig_globalvar *var = v->vars;
+    while (var) {
+      swig_globalvar *n = var->next;
+      free(var->name);
+      free(var);
+      var = n;
+    }
+  }
+  
+  SWIGINTERN PyObject *
+  swig_varlink_getattr(swig_varlinkobject *v, char *n) {
+    PyObject *res = NULL;
+    swig_globalvar *var = v->vars;
+    while (var) {
+      if (strcmp(var->name,n) == 0) {
+        res = (*var->get_attr)();
+        break;
+      }
+      var = var->next;
+    }
+    if (res == NULL && !PyErr_Occurred()) {
+      PyErr_SetString(PyExc_NameError,"Unknown C global variable");
+    }
+    return res;
+  }
+  
+  SWIGINTERN int
+  swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
+    int res = 1;
+    swig_globalvar *var = v->vars;
+    while (var) {
+      if (strcmp(var->name,n) == 0) {
+        res = (*var->set_attr)(p);
+        break;
+      }
+      var = var->next;
+    }
+    if (res == 1 && !PyErr_Occurred()) {
+      PyErr_SetString(PyExc_NameError,"Unknown C global variable");
+    }
+    return res;
+  }
+  
+  SWIGINTERN PyTypeObject*
+  swig_varlink_type(void) {
+    static char varlink__doc__[] = "Swig var link object";
+    static PyTypeObject varlink_type;
+    static int type_init = 0;
+    if (!type_init) {
+      const PyTypeObject tmp = {
+        /* PyObject header changed in Python 3 */
+#if PY_VERSION_HEX >= 0x03000000
+        PyVarObject_HEAD_INIT(NULL, 0)
+#else
+        PyObject_HEAD_INIT(NULL)
+        0,                                  /* ob_size */
+#endif
+        (char *)"swigvarlink",              /* tp_name */
+        sizeof(swig_varlinkobject),         /* tp_basicsize */
+        0,                                  /* tp_itemsize */
+        (destructor) swig_varlink_dealloc,  /* tp_dealloc */
+        (printfunc) swig_varlink_print,     /* tp_print */
+        (getattrfunc) swig_varlink_getattr, /* tp_getattr */
+        (setattrfunc) swig_varlink_setattr, /* tp_setattr */
+        0,                                  /* tp_compare */
+        (reprfunc) swig_varlink_repr,       /* tp_repr */
+        0,                                  /* tp_as_number */
+        0,                                  /* tp_as_sequence */
+        0,                                  /* tp_as_mapping */
+        0,                                  /* tp_hash */
+        0,                                  /* tp_call */
+        (reprfunc) swig_varlink_str,        /* tp_str */
+        0,                                  /* tp_getattro */
+        0,                                  /* tp_setattro */
+        0,                                  /* tp_as_buffer */
+        0,                                  /* tp_flags */
+        varlink__doc__,                     /* tp_doc */
+        0,                                  /* tp_traverse */
+        0,                                  /* tp_clear */
+        0,                                  /* tp_richcompare */
+        0,                                  /* tp_weaklistoffset */
+#if PY_VERSION_HEX >= 0x02020000
+        0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
+#endif
+#if PY_VERSION_HEX >= 0x02030000
+        0,                                  /* tp_del */
+#endif
+#if PY_VERSION_HEX >= 0x02060000
+        0,                                  /* tp_version */
+#endif
+#ifdef COUNT_ALLOCS
+        0,0,0,0                             /* tp_alloc -> tp_next */
+#endif
+      };
+      varlink_type = tmp;
+      type_init = 1;
+#if PY_VERSION_HEX < 0x02020000
+      varlink_type.ob_type = &PyType_Type;
+#else
+      if (PyType_Ready(&varlink_type) < 0)
+      return NULL;
+#endif
+    }
+    return &varlink_type;
+  }
+  
+  /* Create a variable linking object for use later */
+  SWIGINTERN PyObject *
+  SWIG_Python_newvarlink(void) {
+    swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
+    if (result) {
+      result->vars = 0;
+    }
+    return ((PyObject*) result);
+  }
+  
+  SWIGINTERN void 
+  SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
+    swig_varlinkobject *v = (swig_varlinkobject *) p;
+    swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
+    if (gv) {
+      size_t size = strlen(name)+1;
+      gv->name = (char *)malloc(size);
+      if (gv->name) {
+        strncpy(gv->name,name,size);
+        gv->get_attr = get_attr;
+        gv->set_attr = set_attr;
+        gv->next = v->vars;
+      }
+    }
+    v->vars = gv;
+  }
+  
+  SWIGINTERN PyObject *
+  SWIG_globals(void) {
+    static PyObject *_SWIG_globals = 0; 
+    if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink();  
+    return _SWIG_globals;
+  }
+  
+  /* -----------------------------------------------------------------------------
+   * constants/methods manipulation
+   * ----------------------------------------------------------------------------- */
+  
+  /* Install Constants */
+  SWIGINTERN void
+  SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
+    PyObject *obj = 0;
+    size_t i;
+    for (i = 0; constants[i].type; ++i) {
+      switch(constants[i].type) {
+      case SWIG_PY_POINTER:
+        obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
+        break;
+      case SWIG_PY_BINARY:
+        obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
+        break;
+      default:
+        obj = 0;
+        break;
+      }
+      if (obj) {
+        PyDict_SetItemString(d, constants[i].name, obj);
+        Py_DECREF(obj);
+      }
+    }
+  }
+  
+  /* -----------------------------------------------------------------------------*/
+  /* Fix SwigMethods to carry the callback ptrs when needed */
+  /* -----------------------------------------------------------------------------*/
+  
+  SWIGINTERN void
+  SWIG_Python_FixMethods(PyMethodDef *methods,
+    swig_const_info *const_table,
+    swig_type_info **types,
+    swig_type_info **types_initial) {
+    size_t i;
+    for (i = 0; methods[i].ml_name; ++i) {
+      const char *c = methods[i].ml_doc;
+      if (c && (c = strstr(c, "swig_ptr: "))) {
+        int j;
+        swig_const_info *ci = 0;
+        const char *name = c + 10;
+        for (j = 0; const_table[j].type; ++j) {
+          if (strncmp(const_table[j].name, name, 
+              strlen(const_table[j].name)) == 0) {
+            ci = &(const_table[j]);
+            break;
+          }
+        }
+        if (ci) {
+          void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
+          if (ptr) {
+            size_t shift = (ci->ptype) - types;
+            swig_type_info *ty = types_initial[shift];
+            size_t ldoc = (c - methods[i].ml_doc);
+            size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
+            char *ndoc = (char*)malloc(ldoc + lptr + 10);
+            if (ndoc) {
+              char *buff = ndoc;
+              strncpy(buff, methods[i].ml_doc, ldoc);
+              buff += ldoc;
+              strncpy(buff, "swig_ptr: ", 10);
+              buff += 10;
+              SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
+              methods[i].ml_doc = ndoc;
+            }
+          }
+        }
+      }
+    }
+  } 
+  
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------*
+ *  Partial Init method
+ * -----------------------------------------------------------------------------*/
+
+#ifdef __cplusplus
+extern "C"
+#endif
+
+SWIGEXPORT 
+#if PY_VERSION_HEX >= 0x03000000
+PyObject*
+#else
+void
+#endif
+SWIG_init(void) {
+  PyObject *m, *d, *md;
+#if PY_VERSION_HEX >= 0x03000000
+  static struct PyModuleDef SWIG_module = {
+# if PY_VERSION_HEX >= 0x03020000
+    PyModuleDef_HEAD_INIT,
+# else
+    {
+      PyObject_HEAD_INIT(NULL)
+      NULL, /* m_init */
+      0,    /* m_index */
+      NULL, /* m_copy */
+    },
+# endif
+    (char *) SWIG_name,
+    NULL,
+    -1,
+    SwigMethods,
+    NULL,
+    NULL,
+    NULL,
+    NULL
+  };
+#endif
+  
+#if defined(SWIGPYTHON_BUILTIN)
+  static SwigPyClientData SwigPyObject_clientdata = {
+    0, 0, 0, 0, 0, 0, 0
+  };
+  static PyGetSetDef this_getset_def = {
+    (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
+  };
+  static SwigPyGetSet thisown_getset_closure = {
+    (PyCFunction) SwigPyObject_own,
+    (PyCFunction) SwigPyObject_own
+  };
+  static PyGetSetDef thisown_getset_def = {
+    (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
+  };
+  PyObject *metatype_args;
+  PyTypeObject *builtin_pytype;
+  int builtin_base_count;
+  swig_type_info *builtin_basetype;
+  PyObject *tuple;
+  PyGetSetDescrObject *static_getset;
+  PyTypeObject *metatype;
+  SwigPyClientData *cd;
+  PyObject *public_interface, *public_symbol;
+  PyObject *this_descr;
+  PyObject *thisown_descr;
+  int i;
+  
+  (void)builtin_pytype;
+  (void)builtin_base_count;
+  (void)builtin_basetype;
+  (void)tuple;
+  (void)static_getset;
+  
+  /* metatype is used to implement static member variables. */
+  metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type);
+  assert(metatype_args);
+  metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL);
+  assert(metatype);
+  Py_DECREF(metatype_args);
+  metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro;
+  assert(PyType_Ready(metatype) >= 0);
+#endif
+  
+  /* Fix SwigMethods to carry the callback ptrs when needed */
+  SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
+  
+#if PY_VERSION_HEX >= 0x03000000
+  m = PyModule_Create(&SWIG_module);
+#else
+  m = Py_InitModule((char *) SWIG_name, SwigMethods);
+#endif
+  md = d = PyModule_GetDict(m);
+  
+  SWIG_InitializeModule(0);
+  
+#ifdef SWIGPYTHON_BUILTIN
+  SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
+  assert(SwigPyObject_stype);
+  cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
+  if (!cd) {
+    SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
+    SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce();
+  } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) {
+    PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
+# if PY_VERSION_HEX >= 0x03000000
+    return NULL;
+# else
+    return;
+# endif
+  }
+  
+  /* All objects have a 'this' attribute */
+  this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
+  (void)this_descr;
+  
+  /* All objects have a 'thisown' attribute */
+  thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
+  (void)thisown_descr;
+  
+  public_interface = PyList_New(0);
+  public_symbol = 0;
+  (void)public_symbol;
+  
+  PyDict_SetItemString(md, "__all__", public_interface);
+  Py_DECREF(public_interface);
+  for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
+  SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
+  for (i = 0; swig_const_table[i].name != 0; ++i)
+  SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
+#endif
+  
+  SWIG_InstallConstants(d,swig_const_table);
+  
+  SWIG_Python_SetConstant(d, "CHARSIZE",SWIG_From_int(static_cast< int >(128)));
+#if PY_VERSION_HEX >= 0x03000000
+  return m;
+#else
+  return;
+#endif
+}
+
diff --git a/libcdi/interfaces/python/setup.py b/libcdi/interfaces/python/setup.py
new file mode 100644
index 0000000..d767a44
--- /dev/null
+++ b/libcdi/interfaces/python/setup.py
@@ -0,0 +1,17 @@
+import os, string
+
+INCFLAGS = []
+CFLAGS   = []
+LDFLAGS  = []
+LIBS     = []
+if 'INCFLAGS' in os.environ:
+   INCFLAGS = os.environ['INCFLAGS'].split()
+
+if 'CFLAGS' in os.environ:
+   CFLAGS  = os.environ['CFLAGS'].split()
+
+if 'LDFLAGS' in os.environ:
+   LDFLAGS  = os.environ['LDFLAGS'].split('-L')
+
+if 'LIBS' in os.environ:
+   LIBS     = os.environ['LIBS'].split()
diff --git a/libcdi/interfaces/python/setupLib.py b/libcdi/interfaces/python/setupLib.py
new file mode 100644
index 0000000..4c1a658
--- /dev/null
+++ b/libcdi/interfaces/python/setupLib.py
@@ -0,0 +1,19 @@
+#!/usr/bin/env python
+from distutils.core import setup, Extension
+from setup import *
+
+CdiLib_module = Extension('_CdiLib',
+                  sources=['cdilib_wrap.c'],
+                  extra_compile_args = INCFLAGS,
+                  library_dirs = LDFLAGS,
+                  extra_objects = ['../../src/cdilib.o'],
+                  extra_link_args = LIBS,
+                  )
+
+setup (name = 'CdiLib',
+       version = '0.1',
+       author      = "Ralf Mueller",
+       description = """pyhton bindings to CDI function library""",
+       ext_modules = [CdiLib_module],
+       py_modules = ["CdiLib"],
+       )
diff --git a/libcdi/interfaces/python/setupObj.py b/libcdi/interfaces/python/setupObj.py
new file mode 100644
index 0000000..5c80eca
--- /dev/null
+++ b/libcdi/interfaces/python/setupObj.py
@@ -0,0 +1,22 @@
+#!/usr/bin/env python
+from distutils.core import setup, Extension
+from setup import *
+
+cdiobj_module = Extension('_CdiObj',
+                  sources=['cdiobj_wrap.cpp'],
+                  extra_compile_args = INCFLAGS,
+                  library_dirs = LDFLAGS,
+                  extra_objects = ['../cdi.o'],
+                  runtime_library_dirs = [os.environ['BUILDLIBDIR'],os.environ['LIBDIR']],
+                  extra_link_args = LIBS,
+                  libraries    = ['cdi','stdc++'],
+                  language = 'c++',
+                  )
+
+setup (name = 'CdiObj',
+       version = '0.1',
+       author      = "Ralf Mueller",
+       description = """pyhton bindings to CDI class library""",
+       ext_modules = [cdiobj_module],
+       py_modules = ["CdiObj"],
+       )
diff --git a/libcdi/interfaces/python/table.py b/libcdi/interfaces/python/table.py
new file mode 100644
index 0000000..f2c7d19
--- /dev/null
+++ b/libcdi/interfaces/python/table.py
@@ -0,0 +1,128 @@
+import os, numpy, getopt, sys
+import CdiObj
+
+
+def usage():
+  print("usage: " + sys.argv[0] + " [-o outputFile] [-e experiementTag] [-v] inputFile")
+
+def htmlSkel(experiment):
+  return ['<html> <head> <title>ECHAM Experiment: '+ experiment +'</title></head>' +
+  """<body>
+<script type="text/javascript" src="http://code.jquery.com/jquery-1.4.2.min.js"></script> 
+<script type="text/javascript" src="https://code.zmaw.de/files/cdo/html/tableFold.js"></script>""",
+  '''</body>
+    </html>
+  ''']
+
+def tableSkel():
+  return ["<table id=\"detail_table\" class=\"detail\"> <!--       <col style=\"width: 40px;\"> <col style=\"width: 80px;\"> <col style=\"width: 80px;\"> <col style=\"width: 80px;\">-->" +
+          "<thead align=\"left\"><tr align=\"right\"><th>Code</th><th>North</th><th>South</th><th colspan=\"1000\">Global</th></tr></thead>",
+          '</table>']
+
+def tableRow(code,northVal,southVal,globalVal):
+  return ["<tr  align=\"right\" title=\"Click to expand/collapse\" style=\"cursor: pointer;\" class=\"parent\" id=\"row%d\" >" % code +
+          "<td valign=\"top\">%d</td><td>%3.3f</td><td>%3.3f</td><td>%3.3f</td>" % (code,northVal, southVal, globalVal) +
+          '</tr>' + 
+          "<tr style=\"display: none;\" class=\"child-row%d\">" % code + 
+          '<td></td><td colspan="3">', 
+          '</td></tr></table>']
+
+def generateSubTable(headers, rows):
+  html = []
+
+  if len(headers) > 0:
+    html.append("<tr>")
+  for header in headers:
+    html.append("<th>" + header + "</th>")
+  html.append("</tr>")
+
+  if len(rows) > 0:
+    for row in rows:
+      html.append("<tr>")
+      for cell in row:
+        html.append("<td>%3.3f</td>" % cell)
+  html.append("</tr>")
+
+  if html:
+    html  = ["<table>"] + html + ["</table>"]
+
+  return "".join(html)  
+
+if __name__ == '__main__':
+  try:
+    opts, args = getopt.getopt(sys.argv[1:], "ho:v", ["help", "output="])
+  except getopt.GetoptError, err:
+    #print help information and exit:
+    print str(err) # will print something like "option -a not recognized"
+    usage()
+    sys.exit(2)
+
+  output  = 'table.html'
+  expName = '187'
+  verbose = False
+  for o, a in opts:
+    if o == "-v":
+      verbose = True
+    elif o in ("-h", "--help"):
+      usage()
+      sys.exit()
+    elif o in ("-o", "--output"):
+      output = a
+    elif o in ("-e", "--experiment"):
+      expName = a
+    else:
+      assert False, "unhandled option"
+  
+  sourcefile = args[0]
+  #TODO test if input file exists?
+  if verbose == True:
+    print 'Input:  ' + sourcefile
+    print 'Output: ' + output
+ 
+  cdoOperator = "zonavg"
+  zonalfile   = cdoOperator + "-" + sourcefile
+  cmd         = ' '.join(['cdo',cdoOperator, sourcefile, zonalfile])
+
+  print cmd
+
+  os.popen(cmd).read()
+
+  cdi = CdiObj.Cdi(zonalfile)
+
+  html = []
+  htmlStart, htmlEnd = htmlSkel(expName)
+  tableStart, tableEnd = tableSkel()
+
+  html.append(htmlStart)
+  html.append(tableStart)
+
+  for code in cdi.codes:
+
+      var = cdi.varByCode[code]
+      var.getValues()
+      vals = numpy.array(var.values)
+      lats = numpy.array(var.grid.yvalues)
+      northInd = numpy.where(lats >= 0)
+      southInd = numpy.where(lats <  0)
+      if verbose == True:
+        print 'Global Mean:     ',vals.mean()
+        print 'Global Max|Min:  ',vals.max(),'|',vals.min()
+        print 'North  Mean:     ',vals[northInd].mean()
+        print 'South  Mean:     ',vals[southInd].mean()
+      
+      codeTableStart, codeTableEnd = tableRow(code,vals[northInd].mean(), vals[southInd].mean(), vals.mean())
+      
+      html.append(codeTableStart)
+
+      tdata = numpy.array([lats[northInd],vals[northInd],lats[southInd],vals[southInd]]).transpose().tolist()
+      vtable  = generateSubTable(["latitude","values","latidute","values"],tdata)
+
+      html.append(vtable)
+
+
+  html.append(tableEnd)
+  html.append(htmlEnd)
+
+  f = open(output, 'w')
+  f.write("".join(html))
+  f.close
diff --git a/libcdi/interfaces/python/testLib.py b/libcdi/interfaces/python/testLib.py
new file mode 100644
index 0000000..8649a69
--- /dev/null
+++ b/libcdi/interfaces/python/testLib.py
@@ -0,0 +1,9 @@
+import CdiLib
+ifile = "../testdata/mulval.nc"
+streamID = CdiLib.streamOpenRead(ifile)
+vlistID  = CdiLib.streamInqVlist(streamID)
+nvars    = CdiLib.vlistNvars(vlistID)
+for i in range(0,nvars):
+  print CdiLib.vlistInqVarCode(vlistID, i),
+
+CdiLib.streamClose(streamID)
diff --git a/libcdi/interfaces/python/testObj.py b/libcdi/interfaces/python/testObj.py
new file mode 100644
index 0000000..50d0832
--- /dev/null
+++ b/libcdi/interfaces/python/testObj.py
@@ -0,0 +1,47 @@
+import CdiObj
+
+ifile = "../testdata/mulval.grb"
+
+cdi = CdiObj.Cdi(ifile)
+
+print 'Stream: ',cdi.streamID,' vlistID:',cdi.vlistID,' nvars:{d}', cdi.nvars
+
+print '#========== TAXES ====================================#'
+for k in range(cdi.taxes.size()):
+  print  k,": ", cdi.taxes[k].ntsteps
+
+print '#========== GRIDS ====================================#'
+for k in range(cdi.grids.size()):
+  print k,": ", cdi.grids[k].size,' ', cdi.grids[k].xname,' ', cdi.grids[k].yname,' ', cdi.grids[k].ylongname 
+
+print "#========== ZAXES ====================================#"
+for k in range(cdi.zaxes.size()):
+  print k,": ", cdi.zaxes[k].size,' ', cdi.zaxes[k].name,' ', cdi.zaxes[k].units
+
+print "#========== VARIABLES ================================#"
+for k in range(cdi.variables.size()):
+  v = cdi.variables[k]
+  print v.name," ",v.size, " ", v.missval
+
+print "#========== VARIABLEcdi.NAMES =================================#"
+for k in range(cdi.variables.size()):
+  print cdi.variables[k].longname,' ',cdi.variables[k].units
+
+print "#========== VAR by index ======================================#"
+var = cdi.variables[1]
+var.getValues()
+val = var.values
+i=0; print 'val[',i,'] = ',val[i]
+i=1; print 'val[',i,'] = ',val[i]
+i=2; print 'val[',i,'] = ',val[i]
+i=3; print 'val[',i,'] = ',val[i]
+i=4; print 'val[',i,'] = ',val[i]
+i=5; print 'val[',i,'] = ',val[i]
+print "#========= Var by name ===============================#"
+name ="tsurf"
+newvar = cdi.var[name]
+print "name ",name," var.name: ", newvar.name, " var.grids.xsize: " , newvar.grid.xsize
+print "#========= Var by code ===============================#"
+code = 169
+newvar = cdi.varByCode[code]
+newvar.sinfo()
diff --git a/libcdi/interfaces/ruby/cdilib_wrap.c b/libcdi/interfaces/ruby/cdilib_wrap.c
new file mode 100644
index 0000000..6cf7fc5
--- /dev/null
+++ b/libcdi/interfaces/ruby/cdilib_wrap.c
@@ -0,0 +1,12206 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.36
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGRUBY
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif 
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif 
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic CAPI SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "4"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the swig runtime code.
+  In 99.9% of the cases, swig just needs to declare them as 'static'.
+  
+  But only do this if is strictly necessary, ie, if you have problems
+  with your compiler or so.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+#define SWIG_CAST_NEW_MEMORY       0x2
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The swig conversion methods, as ConvertPtr, return and integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old swig versions, you usually write code as:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit as:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   that seems to be the same, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+	delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   requires also to SWIG_ConvertPtr to return new result values, as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {			       
+          if (<need new object>) {		       
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;		       
+          } else {				       
+            *ptr = <ptr to old object>;	       
+            return SWIG_OLDOBJ;		       
+          } 				       
+        } else {				       
+          return SWIG_BADOBJ;		       
+        }					       
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   swig errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+ 
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+
+
+ */
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *, int *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store information on one type */
+typedef struct swig_type_info {
+  const char             *name;			/* mangled name of this type */
+  const char             *str;			/* human readable name of this type */
+  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
+  void                   *clientdata;		/* language specific type data */
+  int                    owndata;		/* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;		/* function to cast the void pointers */
+  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;			/* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;		        /* Number of types in this module */
+  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;	/* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
+  void                    *clientdata;		/* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+		  const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/* think of this as a c++ template<> or a scheme macro */
+#define SWIG_TypeCheck_Template(comparison, ty)         \
+  if (ty) {                                             \
+    swig_cast_info *iter = ty->cast;                    \
+    while (iter) {                                      \
+      if (comparison) {                                 \
+        if (iter == ty->cast) return iter;              \
+        /* Move iter to the top of the linked list */   \
+        iter->prev->next = iter->next;                  \
+        if (iter->next)                                 \
+          iter->next->prev = iter->prev;                \
+        iter->next = ty->cast;                          \
+        iter->prev = 0;                                 \
+        if (ty->cast) ty->cast->prev = iter;            \
+        ty->cast = iter;                                \
+        return iter;                                    \
+      }                                                 \
+      iter = iter->next;                                \
+    }                                                   \
+  }                                                     \
+  return 0
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  SWIG_TypeCheck_Template(strcmp(iter->type->name, c) == 0, ty);
+}
+
+/* Same as previous function, except strcmp is replaced with a pointer comparison */
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *into) {
+  SWIG_TypeCheck_Template(iter->type == from, into);
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+	SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+		            const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
+	register size_t i = (l + r) >> 1; 
+	const char *iname = iter->types[i]->name;
+	if (iname) {
+	  register int compare = strcmp(name, iname);
+	  if (compare == 0) {	    
+	    return iter->types[i];
+	  } else if (compare < 0) {
+	    if (i) {
+	      r = i - 1;
+	    } else {
+	      break;
+	    }
+	  } else if (compare > 0) {
+	    l = i + 1;
+	  }
+	} else {
+	  break; /* should never happen */
+	}
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+		     const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+	  return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError    	   -1 
+#define  SWIG_IOError        	   -2 
+#define  SWIG_RuntimeError   	   -3 
+#define  SWIG_IndexError     	   -4 
+#define  SWIG_TypeError      	   -5 
+#define  SWIG_DivisionByZero 	   -6 
+#define  SWIG_OverflowError  	   -7 
+#define  SWIG_SyntaxError    	   -8 
+#define  SWIG_ValueError     	   -9 
+#define  SWIG_SystemError    	   -10
+#define  SWIG_AttributeError 	   -11
+#define  SWIG_MemoryError    	   -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+#include <ruby.h>
+
+/* Remove global macros defined in Ruby's win32.h */
+#ifdef write
+# undef write
+#endif
+#ifdef read
+# undef read
+#endif
+
+
+/* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
+#ifndef NUM2LL
+#define NUM2LL(x) NUM2LONG((x))
+#endif
+#ifndef LL2NUM
+#define LL2NUM(x) INT2NUM((long) (x))
+#endif
+#ifndef ULL2NUM
+#define ULL2NUM(x) UINT2NUM((unsigned long) (x))
+#endif
+
+/* Ruby 1.7 doesn't (yet) define NUM2ULL() */
+#ifndef NUM2ULL
+#ifdef HAVE_LONG_LONG
+#define NUM2ULL(x) rb_num2ull((x))
+#else
+#define NUM2ULL(x) NUM2ULONG(x)
+#endif
+#endif
+
+/* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
+/* Define these for older versions so we can just write code the new way */
+#ifndef RSTRING_LEN
+# define RSTRING_LEN(x) RSTRING(x)->len
+#endif
+#ifndef RSTRING_PTR
+# define RSTRING_PTR(x) RSTRING(x)->ptr
+#endif
+#ifndef RSTRING_END
+# define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
+#endif
+#ifndef RARRAY_LEN
+# define RARRAY_LEN(x) RARRAY(x)->len
+#endif
+#ifndef RARRAY_PTR
+# define RARRAY_PTR(x) RARRAY(x)->ptr
+#endif
+#ifndef RFLOAT_VALUE
+# define RFLOAT_VALUE(x) RFLOAT(x)->value
+#endif
+#ifndef DOUBLE2NUM
+# define DOUBLE2NUM(x) rb_float_new(x)
+#endif
+#ifndef RHASH_TBL
+# define RHASH_TBL(x) (RHASH(x)->tbl)
+#endif
+#ifndef RHASH_ITER_LEV
+# define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
+#endif
+#ifndef RHASH_IFNONE
+# define RHASH_IFNONE(x) (RHASH(x)->ifnone)
+#endif
+#ifndef RHASH_SIZE
+# define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
+#endif
+#ifndef RHASH_EMPTY_P
+# define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
+#endif
+#ifndef RSTRUCT_LEN
+# define RSTRUCT_LEN(x) RSTRUCT(x)->len
+#endif
+#ifndef RSTRUCT_PTR
+# define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
+#endif
+
+
+
+/*
+ * Need to be very careful about how these macros are defined, especially
+ * when compiling C++ code or C code with an ANSI C compiler.
+ *
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
+ * a Ruby method so that it can be passed as an argument to API functions
+ * like rb_define_method() and rb_define_singleton_method().
+ *
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
+ * and Data_Make_Struct().
+ */
+ 
+#ifdef __cplusplus
+#  ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
+#    define PROTECTFUNC(f) ((VALUE (*)()) f)
+#    define VALUEFUNC(f) ((VALUE (*)()) f)
+#    define VOIDFUNC(f)  ((void (*)()) f)
+#  else
+#    ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
+#      define PROTECTFUNC(f) ((VALUE (*)()) f)
+#      define VALUEFUNC(f) ((VALUE (*)()) f)
+#      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
+#    else /* These definitions should work for Ruby 1.7+ */
+#      define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
+#      define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
+#      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
+#    endif
+#  endif
+#else
+#  define VALUEFUNC(f) (f)
+#  define VOIDFUNC(f) (f)
+#endif
+
+/* Don't use for expressions have side effect */
+#ifndef RB_STRING_VALUE
+#define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
+#endif
+#ifndef StringValue
+#define StringValue(s) RB_STRING_VALUE(s)
+#endif
+#ifndef StringValuePtr
+#define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
+#endif
+#ifndef StringValueLen
+#define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
+#endif
+#ifndef SafeStringValue
+#define SafeStringValue(v) do {\
+    StringValue(v);\
+    rb_check_safe_str(v);\
+} while (0)
+#endif
+
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+#define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
+#define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
+#endif
+
+static VALUE _mSWIG = Qnil;
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+
+/* Define some additional error types */
+#define SWIG_ObjectPreviouslyDeletedError  -100
+
+
+/* Define custom exceptions for errors that do not map to existing Ruby
+   exceptions.  Note this only works for C++ since a global cannot be
+   initialized by a funtion in C.  For C, fallback to rb_eRuntimeError.*/
+
+SWIGINTERN VALUE 
+getNullReferenceError(void) {
+  static int init = 0;
+  static VALUE rb_eNullReferenceError ;
+  if (!init) {
+    init = 1;
+    rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
+  }
+  return rb_eNullReferenceError;
+} 
+
+SWIGINTERN VALUE 
+getObjectPreviouslyDeletedError(void) {
+  static int init = 0;
+  static VALUE rb_eObjectPreviouslyDeleted ;
+  if (!init) {
+    init = 1;
+    rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
+  }
+  return rb_eObjectPreviouslyDeleted;
+} 
+
+
+SWIGINTERN VALUE
+SWIG_Ruby_ErrorType(int SWIG_code) {
+  VALUE type;
+  switch (SWIG_code) {
+  case SWIG_MemoryError:
+    type = rb_eNoMemError;
+    break;
+  case SWIG_IOError:
+    type = rb_eIOError;
+    break;
+  case SWIG_RuntimeError:
+    type = rb_eRuntimeError;
+    break;
+  case SWIG_IndexError:
+    type = rb_eIndexError;
+    break;
+  case SWIG_TypeError:
+    type = rb_eTypeError;
+    break;
+  case SWIG_DivisionByZero:
+    type = rb_eZeroDivError;
+    break;
+  case SWIG_OverflowError:
+    type = rb_eRangeError;
+    break;
+  case SWIG_SyntaxError:
+    type = rb_eSyntaxError;
+    break;
+  case SWIG_ValueError:
+    type = rb_eArgError;
+    break;
+  case SWIG_SystemError:
+    type = rb_eFatal;
+    break;
+  case SWIG_AttributeError:
+    type = rb_eRuntimeError;
+    break;
+  case SWIG_NullReferenceError:
+    type = getNullReferenceError();
+    break;
+  case SWIG_ObjectPreviouslyDeletedError:
+    type = getObjectPreviouslyDeletedError();
+    break;
+  case SWIG_UnknownError:
+    type = rb_eRuntimeError;
+    break;
+  default:
+    type = rb_eRuntimeError;
+  }
+  return type;
+}
+
+
+/* This function is called when a user inputs a wrong argument to
+   a method.
+ */
+SWIGINTERN 
+const char* Ruby_Format_TypeError( const char* msg,
+				   const char* type, 
+				   const char* name, 
+				   const int argn,
+				   VALUE input )
+{
+  char buf[128];
+  VALUE str;
+  VALUE asStr;
+  if ( msg && *msg )
+    {
+      str = rb_str_new2(msg);
+    }
+  else
+    {
+      str = rb_str_new(NULL, 0);
+    }
+
+  str = rb_str_cat2( str, "Expected argument " );
+  sprintf( buf, "%d of type ", argn-1 );
+  str = rb_str_cat2( str, buf );
+  str = rb_str_cat2( str, type );
+  str = rb_str_cat2( str, ", but got " );
+  str = rb_str_cat2( str, rb_obj_classname(input) );
+  str = rb_str_cat2( str, " " );
+  asStr = rb_inspect(input);
+  if ( RSTRING_LEN(asStr) > 30 )
+    {
+      str = rb_str_cat( str, StringValuePtr(asStr), 30 );
+      str = rb_str_cat2( str, "..." );
+    }
+  else
+    {
+      str = rb_str_append( str, asStr );
+    }
+
+  if ( name )
+    {
+      str = rb_str_cat2( str, "\n\tin SWIG method '" );
+      str = rb_str_cat2( str, name );
+      str = rb_str_cat2( str, "'" );
+    }
+
+  return StringValuePtr( str );
+}
+
+/* This function is called when an overloaded method fails */
+SWIGINTERN 
+void Ruby_Format_OverloadedError(
+				 const int argc,
+				 const int maxargs,
+				 const char* method, 
+				 const char* prototypes 
+				 )
+{
+  const char* msg = "Wrong # of arguments";
+  if ( argc <= maxargs ) msg = "Wrong arguments";
+  rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"  
+	   "Possible C/C++ prototypes are:\n%s",
+	   msg, method, prototypes);
+}
+
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * rubytracking.swg
+ *
+ * This file contains support for tracking mappings from 
+ * Ruby objects to C++ objects.  This functionality is needed
+ * to implement mark functions for Ruby's mark and sweep
+ * garbage collector.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Ruby 1.8 actually assumes the first case. */
+#if SIZEOF_VOIDP == SIZEOF_LONG
+#  define SWIG2NUM(v) LONG2NUM((unsigned long)v)
+#  define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
+#elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
+#  define SWIG2NUM(v) LL2NUM((unsigned long long)v)
+#  define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
+#else
+#  error sizeof(void*) is not the same as long or long long
+#endif
+
+
+/* Global Ruby hash table to store Trackings from C/C++
+   structs to Ruby Objects. 
+*/
+static VALUE swig_ruby_trackings = Qnil;
+
+/* Global variable that stores a reference to the ruby
+   hash table delete function. */
+static ID swig_ruby_hash_delete;
+
+/* Setup a Ruby hash table to store Trackings */
+SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
+  /* Create a ruby hash table to store Trackings from C++ 
+     objects to Ruby objects. */
+
+  /* Try to see if some other .so has already created a 
+     tracking hash table, which we keep hidden in an instance var
+     in the SWIG module.
+     This is done to allow multiple DSOs to share the same
+     tracking table.
+  */
+  ID trackings_id = rb_intern( "@__trackings__" );
+  VALUE verbose = rb_gv_get("VERBOSE");
+  rb_gv_set("VERBOSE", Qfalse);
+  swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
+  rb_gv_set("VERBOSE", verbose);
+
+  /* No, it hasn't.  Create one ourselves */ 
+  if ( swig_ruby_trackings == Qnil )
+    {
+      swig_ruby_trackings = rb_hash_new();
+      rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
+    }
+
+  /* Now store a reference to the hash table delete function
+     so that we only have to look it up once.*/
+  swig_ruby_hash_delete = rb_intern("delete");
+}
+
+/* Get a Ruby number to reference a pointer */
+SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
+  /* We cast the pointer to an unsigned long
+     and then store a reference to it using
+     a Ruby number object. */
+
+  /* Convert the pointer to a Ruby number */
+  return SWIG2NUM(ptr);
+}
+
+/* Get a Ruby number to reference an object */
+SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
+  /* We cast the object to an unsigned long
+     and then store a reference to it using
+     a Ruby number object. */
+
+  /* Convert the Object to a Ruby number */
+  return SWIG2NUM(object);
+}
+
+/* Get a Ruby object from a previously stored reference */
+SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
+  /* The provided Ruby number object is a reference
+     to the Ruby object we want.*/
+
+  /* Convert the Ruby number to a Ruby object */
+  return NUM2SWIG(reference);
+}
+
+/* Add a Tracking from a C/C++ struct to a Ruby object */
+SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
+  /* In a Ruby hash table we store the pointer and
+     the associated Ruby object.  The trick here is
+     that we cannot store the Ruby object directly - if
+     we do then it cannot be garbage collected.  So
+     instead we typecast it as a unsigned long and
+     convert it to a Ruby number object.*/
+
+  /* Get a reference to the pointer as a Ruby number */
+  VALUE key = SWIG_RubyPtrToReference(ptr);
+
+  /* Get a reference to the Ruby object as a Ruby number */
+  VALUE value = SWIG_RubyObjectToReference(object);
+
+  /* Store the mapping to the global hash table. */
+  rb_hash_aset(swig_ruby_trackings, key, value);
+}
+
+/* Get the Ruby object that owns the specified C/C++ struct */
+SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
+  /* Get a reference to the pointer as a Ruby number */
+  VALUE key = SWIG_RubyPtrToReference(ptr);
+
+  /* Now lookup the value stored in the global hash table */
+  VALUE value = rb_hash_aref(swig_ruby_trackings, key);
+	
+  if (value == Qnil) {
+    /* No object exists - return nil. */
+    return Qnil;
+  }
+  else {
+    /* Convert this value to Ruby object */
+    return SWIG_RubyReferenceToObject(value);
+  }
+}
+
+/* Remove a Tracking from a C/C++ struct to a Ruby object.  It
+   is very important to remove objects once they are destroyed
+   since the same memory address may be reused later to create
+   a new object. */
+SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
+  /* Get a reference to the pointer as a Ruby number */
+  VALUE key = SWIG_RubyPtrToReference(ptr);
+
+  /* Delete the object from the hash table by calling Ruby's
+     do this we need to call the Hash.delete method.*/
+  rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
+}
+
+/* This is a helper method that unlinks a Ruby object from its
+   underlying C++ object.  This is needed if the lifetime of the
+   Ruby object is longer than the C++ object */
+SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
+  VALUE object = SWIG_RubyInstanceFor(ptr);
+
+  if (object != Qnil) {
+    DATA_PTR(object) = 0;
+  }
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Ruby API portion that goes into the runtime
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGINTERN VALUE
+SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
+  if (NIL_P(target)) {
+    target = o;
+  } else {
+    if (TYPE(target) != T_ARRAY) {
+      VALUE o2 = target;
+      target = rb_ary_new();
+      rb_ary_push(target, o2);
+    }
+    rb_ary_push(target, o);
+  }
+  return target;
+}
+
+/* For ruby1.8.4 and earlier. */
+#ifndef RUBY_INIT_STACK
+   RUBY_EXTERN void Init_stack(VALUE* addr);
+#  define RUBY_INIT_STACK \
+   VALUE variable_in_this_stack_frame; \
+   Init_stack(&variable_in_this_stack_frame);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * See the LICENSE file for information on copyright, usage and redistribution
+ * of SWIG, and the README file for authors - http://www.swig.org/release.html.
+ *
+ * rubyrun.swg
+ *
+ * This file contains the runtime support for Ruby modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* For backward compatibility only */
+#define SWIG_POINTER_EXCEPTION  0
+
+/* for raw pointers */
+#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
+#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
+#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Ruby_NewPointerObj(ptr, type, flags)
+#define SWIG_AcquirePtr(ptr, own)                       SWIG_Ruby_AcquirePtr(ptr, own)
+#define swig_owntype                                    ruby_owntype
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
+#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Ruby_NewPackedObj(ptr, sz, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Ruby_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Ruby_GetModule()	
+#define SWIG_SetModule(clientdata, pointer) 		SWIG_Ruby_SetModule(pointer)
+
+
+/* Error manipulation */
+
+#define SWIG_ErrorType(code)                            SWIG_Ruby_ErrorType(code)               
+#define SWIG_Error(code, msg)            		rb_raise(SWIG_Ruby_ErrorType(code), msg)
+#define SWIG_fail                        		goto fail				 
+
+
+/* Ruby-specific SWIG API */
+
+#define SWIG_InitRuntime()                              SWIG_Ruby_InitRuntime()              
+#define SWIG_define_class(ty)                        	SWIG_Ruby_define_class(ty)
+#define SWIG_NewClassInstance(value, ty)             	SWIG_Ruby_NewClassInstance(value, ty)
+#define SWIG_MangleStr(value)                        	SWIG_Ruby_MangleStr(value)		  
+#define SWIG_CheckConvert(value, ty)                 	SWIG_Ruby_CheckConvert(value, ty)	  
+
+#include "assert.h"
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+  VALUE klass;
+  VALUE mImpl;
+  void  (*mark)(void *);
+  void  (*destroy)(void *);
+  int trackObjects;
+} swig_class;
+
+
+/* Global pointer used to keep some internal SWIG stuff */
+static VALUE _cSWIG_Pointer = Qnil;
+static VALUE swig_runtime_data_type_pointer = Qnil;
+
+/* Global IDs used to keep some internal SWIG stuff */
+static ID swig_arity_id = 0;
+static ID swig_call_id  = 0;
+
+/*
+  If your swig extension is to be run within an embedded ruby and has
+  director callbacks, you should set -DRUBY_EMBEDDED during compilation.  
+  This will reset ruby's stack frame on each entry point from the main 
+  program the first time a virtual director function is invoked (in a 
+  non-recursive way).
+  If this is not done, you run the risk of Ruby trashing the stack.
+*/
+
+#ifdef RUBY_EMBEDDED
+
+#  define SWIG_INIT_STACK                            \
+      if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
+      ++swig_virtual_calls;
+#  define SWIG_RELEASE_STACK --swig_virtual_calls;
+#  define Ruby_DirectorTypeMismatchException(x) \
+          rb_raise( rb_eTypeError, x ); return c_result;
+
+      static unsigned int swig_virtual_calls = 0;
+
+#else  /* normal non-embedded extension */
+
+#  define SWIG_INIT_STACK
+#  define SWIG_RELEASE_STACK
+#  define Ruby_DirectorTypeMismatchException(x) \
+          throw Swig::DirectorTypeMismatchException( x );
+
+#endif  /* RUBY_EMBEDDED */
+
+
+SWIGRUNTIME VALUE 
+getExceptionClass(void) {
+  static int init = 0;
+  static VALUE rubyExceptionClass ;
+  if (!init) {
+    init = 1;
+    rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
+  }
+  return rubyExceptionClass;
+} 
+
+/* This code checks to see if the Ruby object being raised as part
+   of an exception inherits from the Ruby class Exception.  If so,
+   the object is simply returned.  If not, then a new Ruby exception
+   object is created and that will be returned to Ruby.*/
+SWIGRUNTIME VALUE
+SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
+  VALUE exceptionClass = getExceptionClass();
+  if (rb_obj_is_kind_of(obj, exceptionClass)) {
+    return obj;
+  }  else {
+    return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
+  }
+}
+
+/* Initialize Ruby runtime support */
+SWIGRUNTIME void
+SWIG_Ruby_InitRuntime(void)
+{
+  if (_mSWIG == Qnil) {
+    _mSWIG = rb_define_module("SWIG");
+    swig_call_id  = rb_intern("call");
+    swig_arity_id = rb_intern("arity");
+  }
+}
+
+/* Define Ruby class for C type */
+SWIGRUNTIME void
+SWIG_Ruby_define_class(swig_type_info *type)
+{
+  VALUE klass;
+  char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
+  sprintf(klass_name, "TYPE%s", type->name);
+  if (NIL_P(_cSWIG_Pointer)) {
+    _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
+    rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
+  }
+  klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
+  free((void *) klass_name);
+}
+
+/* Create a new pointer object */
+SWIGRUNTIME VALUE
+SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
+{
+  int own =  flags & SWIG_POINTER_OWN; 
+  int track;
+  char *klass_name;
+  swig_class *sklass;
+  VALUE klass;
+  VALUE obj;
+  
+  if (!ptr)
+    return Qnil;
+  
+  if (type->clientdata) {
+    sklass = (swig_class *) type->clientdata;
+		
+    /* Are we tracking this class and have we already returned this Ruby object? */
+    track = sklass->trackObjects;
+    if (track) {
+      obj = SWIG_RubyInstanceFor(ptr);
+      
+      /* Check the object's type and make sure it has the correct type.
+        It might not in cases where methods do things like 
+        downcast methods. */
+      if (obj != Qnil) {
+        VALUE value = rb_iv_get(obj, "@__swigtype__");
+        char* type_name = RSTRING_PTR(value);
+				
+        if (strcmp(type->name, type_name) == 0) {
+          return obj;
+        }
+      }
+    }
+
+    /* Create a new Ruby object */
+    obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), 
+			   ( own ? VOIDFUNC(sklass->destroy) : 
+			     (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
+			     ), ptr);
+
+    /* If tracking is on for this class then track this object. */
+    if (track) {
+      SWIG_RubyAddTracking(ptr, obj);
+    }
+  } else {
+    klass_name = (char *) malloc(4 + strlen(type->name) + 1);
+    sprintf(klass_name, "TYPE%s", type->name);
+    klass = rb_const_get(_mSWIG, rb_intern(klass_name));
+    free((void *) klass_name);
+    obj = Data_Wrap_Struct(klass, 0, 0, ptr);
+  }
+  rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
+  
+  return obj;
+}
+
+/* Create a new class instance (always owned) */
+SWIGRUNTIME VALUE
+SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
+{
+  VALUE obj;
+  swig_class *sklass = (swig_class *) type->clientdata;
+  obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
+  rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
+  return obj;
+}
+
+/* Get type mangle from class name */
+SWIGRUNTIMEINLINE char *
+SWIG_Ruby_MangleStr(VALUE obj)
+{
+  VALUE stype = rb_iv_get(obj, "@__swigtype__");
+  return StringValuePtr(stype);
+}
+
+/* Acquire a pointer value */
+typedef void (*ruby_owntype)(void*);
+
+SWIGRUNTIME ruby_owntype
+SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
+  if (obj) {
+    ruby_owntype oldown = RDATA(obj)->dfree;
+    RDATA(obj)->dfree = own;
+    return oldown;
+  } else {
+    return 0;
+  }
+}
+
+/* Convert a pointer value */
+SWIGRUNTIME int
+SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
+{
+  char *c;
+  swig_cast_info *tc;
+  void *vptr = 0;
+
+  /* Grab the pointer */
+  if (NIL_P(obj)) {
+    *ptr = 0;
+    return SWIG_OK;
+  } else {
+    if (TYPE(obj) != T_DATA) {
+      return SWIG_ERROR;
+    }
+    Data_Get_Struct(obj, void, vptr);
+  }
+  
+  if (own) *own = RDATA(obj)->dfree;
+    
+  /* Check to see if the input object is giving up ownership
+     of the underlying C struct or C++ object.  If so then we
+     need to reset the destructor since the Ruby object no 
+     longer owns the underlying C++ object.*/ 
+  if (flags & SWIG_POINTER_DISOWN) {
+    /* Is tracking on for this class? */
+    int track = 0;
+    if (ty && ty->clientdata) {
+      swig_class *sklass = (swig_class *) ty->clientdata;
+      track = sklass->trackObjects;
+    }
+		
+    if (track) {
+      /* We are tracking objects for this class.  Thus we change the destructor
+       * to SWIG_RubyRemoveTracking.  This allows us to
+       * remove the mapping from the C++ to Ruby object
+       * when the Ruby object is garbage collected.  If we don't
+       * do this, then it is possible we will return a reference 
+       * to a Ruby object that no longer exists thereby crashing Ruby. */
+      RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
+    } else {    
+      RDATA(obj)->dfree = 0;
+    }
+  }
+
+  /* Do type-checking if type info was provided */
+  if (ty) {
+    if (ty->clientdata) {
+      if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
+        if (vptr == 0) {
+          /* The object has already been deleted */
+          return SWIG_ObjectPreviouslyDeletedError;
+        }
+        *ptr = vptr;
+        return SWIG_OK;
+      }
+    }
+    if ((c = SWIG_MangleStr(obj)) == NULL) {
+      return SWIG_ERROR;
+    }
+    tc = SWIG_TypeCheck(c, ty);
+    if (!tc) {
+      return SWIG_ERROR;
+    } else {
+      int newmemory = 0;
+      *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
+      assert(!newmemory); /* newmemory handling not yet implemented */
+    }
+  } else {
+    *ptr = vptr;
+  }
+  
+  return SWIG_OK;
+}
+
+/* Check convert */
+SWIGRUNTIMEINLINE int
+SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
+{
+  char *c = SWIG_MangleStr(obj);
+  if (!c) return 0;
+  return SWIG_TypeCheck(c,ty) != 0;
+}
+
+SWIGRUNTIME VALUE
+SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
+  char result[1024];
+  char *r = result;
+  if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r, ptr, sz);
+  strcpy(r, type->name);
+  return rb_str_new2(result);
+}
+
+/* Convert a packed value value */
+SWIGRUNTIME int
+SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
+  swig_cast_info *tc;
+  const char  *c;
+
+  if (TYPE(obj) != T_STRING) goto type_error;
+  c = StringValuePtr(obj);
+  /* Pointer values must start with leading underscore */
+  if (*c != '_') goto type_error;
+  c++;
+  c = SWIG_UnpackData(c, ptr, sz);
+  if (ty) {
+    tc = SWIG_TypeCheck(c, ty);
+    if (!tc) goto type_error;
+  }
+  return SWIG_OK;
+
+ type_error:
+  return SWIG_ERROR;
+}
+
+SWIGRUNTIME swig_module_info *
+SWIG_Ruby_GetModule(void)
+{
+  VALUE pointer;
+  swig_module_info *ret = 0;
+  VALUE verbose = rb_gv_get("VERBOSE");
+
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
+  rb_gv_set("VERBOSE", Qfalse);
+  
+  /* first check if pointer already created */
+  pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
+  if (pointer != Qnil) {
+    Data_Get_Struct(pointer, swig_module_info, ret);
+  }
+
+  /* reinstate warnings */
+  rb_gv_set("VERBOSE", verbose);
+  return ret;
+}
+
+SWIGRUNTIME void 
+SWIG_Ruby_SetModule(swig_module_info *pointer)
+{
+  /* register a new class */
+  VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
+  /* create and store the structure pointer to a global variable */
+  swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
+  rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
+}
+
+/* This function can be used to check whether a proc or method or similarly
+   callable function has been passed.  Usually used in a %typecheck, like:
+
+   %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
+        $result = SWIG_Ruby_isCallable( $input );
+   }
+ */
+SWIGINTERN
+int SWIG_Ruby_isCallable( VALUE proc )
+{
+  if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
+    return 1;
+  return 0;
+}
+
+/* This function can be used to check the arity (number of arguments)
+   a proc or method can take.  Usually used in a %typecheck.
+   Valid arities will be that equal to minimal or those < 0
+   which indicate a variable number of parameters at the end.
+ */
+SWIGINTERN
+int SWIG_Ruby_arity( VALUE proc, int minimal )
+{
+  if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
+    {
+      VALUE num = rb_funcall( proc, swig_arity_id, 0 );
+      int arity = NUM2INT(num);
+      if ( arity < 0 && (arity+1) < -minimal ) return 1;
+      if ( arity == minimal ) return 1;
+      return 1;
+    }
+  return 0;
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_char swig_types[0]
+#define SWIGTYPE_p_double swig_types[1]
+#define SWIGTYPE_p_float swig_types[2]
+#define SWIGTYPE_p_int swig_types[3]
+#define SWIGTYPE_p_off_t swig_types[4]
+static swig_type_info *swig_types[6];
+static swig_module_info swig_module = {swig_types, 5, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_init    Init_CdiLib
+#define SWIG_name    "CdiLib"
+
+static VALUE mCdiLib;
+
+#define SWIG_RUBY_THREAD_BEGIN_BLOCK
+#define SWIG_RUBY_THREAD_END_BLOCK
+
+
+#define SWIGVERSION 0x010336 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) (void *)((const void *)(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) 
+
+
+#include "cdi.h"
+
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+  #define SWIG_From_long   LONG2NUM 
+
+
+SWIGINTERNINLINE VALUE
+SWIG_From_int  (int value)
+{    
+  return SWIG_From_long  (value);
+}
+
+
+SWIGINTERN VALUE
+SWIG_ruby_failed(void)
+{
+  return Qnil;
+} 
+
+
+/*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
+SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
+{
+  VALUE obj = args[0];
+  VALUE type = TYPE(obj);
+  long *res = (long *)(args[1]);
+  *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
+  return obj;
+}
+/*@SWIG@*/
+
+SWIGINTERN int
+SWIG_AsVal_long (VALUE obj, long* val)
+{
+  VALUE type = TYPE(obj);
+  if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
+    long v;
+    VALUE a[2];
+    a[0] = obj;
+    a[1] = (VALUE)(&v);
+    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+      if (val) *val = v;
+      return SWIG_OK;
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_int (VALUE obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long (obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = (int)(v);
+    }
+  }  
+  return res;
+}
+
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERNINLINE VALUE 
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+  if (carray) {
+    if (size > LONG_MAX) {
+      swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+      return pchar_descriptor ? 
+	SWIG_NewPointerObj((char *)(carray), pchar_descriptor, 0) : Qnil;
+    } else {
+      return rb_str_new(carray, (long)(size));
+    }
+  } else {
+    return Qnil;
+  }
+}
+
+
+SWIGINTERNINLINE VALUE 
+SWIG_FromCharPtr(const char *cptr)
+{ 
+  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+}
+
+
+/*@SWIG:/usr/share/swig1.3/ruby/rubyprimtypes.swg,23,%ruby_aux_method@*/
+SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
+{
+  VALUE obj = args[0];
+  VALUE type = TYPE(obj);
+  double *res = (double *)(args[1]);
+  *res = (type == T_FLOAT ? NUM2DBL(obj) : (type == T_FIXNUM ? (double) FIX2INT(obj) : rb_big2dbl(obj)));
+  return obj;
+}
+/*@SWIG@*/
+
+SWIGINTERN int
+SWIG_AsVal_double (VALUE obj, double *val)
+{
+  VALUE type = TYPE(obj);
+  if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) {
+    double v;
+    VALUE a[2];
+    a[0] = obj;
+    a[1] = (VALUE)(&v);
+    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+      if (val) *val = v;
+      return SWIG_OK;
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+  #define SWIG_From_double   rb_float_new 
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (TYPE(obj) == T_STRING) {
+    #if defined(StringValuePtr)
+    char *cstr = StringValuePtr(obj); 
+    #else
+    char *cstr = STR2CSTR(obj);
+    #endif
+    size_t size = RSTRING_LEN(obj) + 1;
+    if (cptr)  {
+      if (alloc) {
+	if (*alloc == SWIG_NEWOBJ) {
+	  *cptr = (char *)memcpy((char *)malloc((size)*sizeof(char)), cstr, sizeof(char)*(size));
+	} else {
+	  *cptr = cstr;
+	  *alloc = SWIG_OLDOBJ;
+	}
+      }
+    }
+    if (psize) *psize = size;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      void* vptr = 0;
+      if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
+	if (cptr) *cptr = (char *)vptr;
+	if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
+	if (alloc) *alloc = SWIG_OLDOBJ;
+	return SWIG_OK;
+      }
+    }
+  }  
+  return SWIG_TypeError;
+}
+
+
+
+
+SWIGINTERN VALUE
+_wrap_cdiStringError(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","cdiStringError", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (char *)cdiStringError(arg1);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_cdiDebug(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","cdiDebug", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  cdiDebug(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_cdiLibraryVersion(int argc, VALUE *argv, VALUE self) {
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (char *)cdiLibraryVersion();
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_cdiPrintVersion(int argc, VALUE *argv, VALUE self) {
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  cdiPrintVersion();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_cdiDefMissval(int argc, VALUE *argv, VALUE self) {
+  double arg1 ;
+  double val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_double(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "double","cdiDefMissval", 1, argv[0] ));
+  } 
+  arg1 = (double)(val1);
+  cdiDefMissval(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_cdiInqMissval(int argc, VALUE *argv, VALUE self) {
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (double)cdiInqMissval();
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_cdiDefGlobal(int argc, VALUE *argv, VALUE self) {
+  char *arg1 = (char *) 0 ;
+  int arg2 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","cdiDefGlobal", 1, argv[0] ));
+  }
+  arg1 = (char *)(buf1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","cdiDefGlobal", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  cdiDefGlobal((char const *)arg1,arg2);
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return Qnil;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamOpenRead(int argc, VALUE *argv, VALUE self) {
+  char *arg1 = (char *) 0 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","streamOpenRead", 1, argv[0] ));
+  }
+  arg1 = (char *)(buf1);
+  result = (int)streamOpenRead((char const *)arg1);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return vresult;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamOpenWrite(int argc, VALUE *argv, VALUE self) {
+  char *arg1 = (char *) 0 ;
+  int arg2 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","streamOpenWrite", 1, argv[0] ));
+  }
+  arg1 = (char *)(buf1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamOpenWrite", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)streamOpenWrite((char const *)arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return vresult;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamOpenAppend(int argc, VALUE *argv, VALUE self) {
+  char *arg1 = (char *) 0 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","streamOpenAppend", 1, argv[0] ));
+  }
+  arg1 = (char *)(buf1);
+  result = (int)streamOpenAppend((char const *)arg1);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return vresult;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamClose(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamClose", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  streamClose(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamSync(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamSync", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  streamSync(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamDefVlist(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamDefVlist", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamDefVlist", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  streamDefVlist(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamInqVlist(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamInqVlist", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqVlist(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamInqFiletype(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamInqFiletype", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqFiletype(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamDefByteorder(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamDefByteorder", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamDefByteorder", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  streamDefByteorder(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamInqByteorder(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamInqByteorder", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqByteorder(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamDefZtype(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamDefZtype", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamDefZtype", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  streamDefZtype(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamDefZlevel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamDefZlevel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamDefZlevel", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  streamDefZlevel(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamInqZtype(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamInqZtype", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqZtype(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamInqZlevel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamInqZlevel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqZlevel(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamDefTimestep(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamDefTimestep", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamDefTimestep", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)streamDefTimestep(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamInqTimestep(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamInqTimestep", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamInqTimestep", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)streamInqTimestep(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamFilename(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamFilename", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (char *)streamFilename(arg1);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamFilesuffix(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamFilesuffix", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (char *)streamFilesuffix(arg1);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamNtsteps(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamNtsteps", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamNtsteps(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamNvals(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  off_t result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamNvals", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = streamNvals(arg1);
+  vresult = SWIG_NewPointerObj((off_t *)memcpy((off_t *)malloc(sizeof(off_t)),&result,sizeof(off_t)), SWIGTYPE_p_off_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamReadVar(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  double *arg3 = (double *) 0 ;
+  int *arg4 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  
+  if ((argc < 4) || (argc > 4)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamReadVar", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamReadVar", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "double *","streamReadVar", 3, argv[2] )); 
+  }
+  arg3 = (double *)(argp3);
+  res4 = SWIG_ConvertPtr(argv[3], &argp4,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "int *","streamReadVar", 4, argv[3] )); 
+  }
+  arg4 = (int *)(argp4);
+  streamReadVar(arg1,arg2,arg3,arg4);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamWriteVar(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  double *arg3 = (double *) 0 ;
+  int arg4 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  
+  if ((argc < 4) || (argc > 4)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamWriteVar", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamWriteVar", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "double const *","streamWriteVar", 3, argv[2] )); 
+  }
+  arg3 = (double *)(argp3);
+  ecode4 = SWIG_AsVal_int(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","streamWriteVar", 4, argv[3] ));
+  } 
+  arg4 = (int)(val4);
+  streamWriteVar(arg1,arg2,(double const *)arg3,arg4);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamReadVarSlice(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  double *arg4 = (double *) 0 ;
+  int *arg5 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  
+  if ((argc < 5) || (argc > 5)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamReadVarSlice", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamReadVarSlice", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","streamReadVarSlice", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  res4 = SWIG_ConvertPtr(argv[3], &argp4,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "double *","streamReadVarSlice", 4, argv[3] )); 
+  }
+  arg4 = (double *)(argp4);
+  res5 = SWIG_ConvertPtr(argv[4], &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "int *","streamReadVarSlice", 5, argv[4] )); 
+  }
+  arg5 = (int *)(argp5);
+  streamReadVarSlice(arg1,arg2,arg3,arg4,arg5);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamWriteVarSlice(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  double *arg4 = (double *) 0 ;
+  int arg5 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  int val5 ;
+  int ecode5 = 0 ;
+  
+  if ((argc < 5) || (argc > 5)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamWriteVarSlice", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamWriteVarSlice", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","streamWriteVarSlice", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  res4 = SWIG_ConvertPtr(argv[3], &argp4,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "double const *","streamWriteVarSlice", 4, argv[3] )); 
+  }
+  arg4 = (double *)(argp4);
+  ecode5 = SWIG_AsVal_int(argv[4], &val5);
+  if (!SWIG_IsOK(ecode5)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "int","streamWriteVarSlice", 5, argv[4] ));
+  } 
+  arg5 = (int)(val5);
+  streamWriteVarSlice(arg1,arg2,arg3,(double const *)arg4,arg5);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamInqRecord(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamInqRecord", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "int *","streamInqRecord", 2, argv[1] )); 
+  }
+  arg2 = (int *)(argp2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","streamInqRecord", 3, argv[2] )); 
+  }
+  arg3 = (int *)(argp3);
+  streamInqRecord(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamDefRecord(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamDefRecord", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamDefRecord", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","streamDefRecord", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  streamDefRecord(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamReadRecord(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamReadRecord", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","streamReadRecord", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","streamReadRecord", 3, argv[2] )); 
+  }
+  arg3 = (int *)(argp3);
+  streamReadRecord(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamWriteRecord(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamWriteRecord", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double const *","streamWriteRecord", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","streamWriteRecord", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  streamWriteRecord(arg1,(double const *)arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamCopyRecord(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamCopyRecord", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamCopyRecord", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  streamCopyRecord(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamInqGinfo(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  float *arg3 = (float *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamInqGinfo", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "int *","streamInqGinfo", 2, argv[1] )); 
+  }
+  arg2 = (int *)(argp2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "float *","streamInqGinfo", 3, argv[2] )); 
+  }
+  arg3 = (float *)(argp3);
+  streamInqGinfo(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistCreate(int argc, VALUE *argv, VALUE self) {
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (int)vlistCreate();
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDestroy(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDestroy", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  vlistDestroy(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDuplicate(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDuplicate", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistDuplicate(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistCopy(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistCopy", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistCopy", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  vlistCopy(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistCopyFlag(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistCopyFlag", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistCopyFlag", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  vlistCopyFlag(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistClearFlag(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistClearFlag", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  vlistClearFlag(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistCat(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistCat", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistCat", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  vlistCat(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistMerge(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistMerge", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistMerge", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  vlistMerge(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistPrint(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistPrint", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  vlistPrint(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistNvars(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistNvars", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistNvars(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistNgrids(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistNgrids", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistNgrids(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistNzaxis(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistNzaxis", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistNzaxis(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefNtsteps(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefNtsteps", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefNtsteps", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  vlistDefNtsteps(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistNtsteps(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistNtsteps", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistNtsteps(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistGridsizeMax(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistGridsizeMax", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistGridsizeMax(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistGrid(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistGrid", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistGrid", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistGrid(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistGridIndex(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistGridIndex", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistGridIndex", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistGridIndex(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistChangeGridIndex(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistChangeGridIndex", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistChangeGridIndex", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistChangeGridIndex", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistChangeGridIndex(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistChangeGrid(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistChangeGrid", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistChangeGrid", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistChangeGrid", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistChangeGrid(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistZaxis(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistZaxis", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistZaxis", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistZaxis(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistZaxisIndex(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistZaxisIndex", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistZaxisIndex", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistZaxisIndex(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistChangeZaxisIndex(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistChangeZaxisIndex", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistChangeZaxisIndex", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistChangeZaxisIndex", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistChangeZaxisIndex(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistChangeZaxis(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistChangeZaxis", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistChangeZaxis", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistChangeZaxis", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistChangeZaxis(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistNrecs(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistNrecs", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistNrecs(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefTaxis(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefTaxis", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefTaxis", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  vlistDefTaxis(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqTaxis(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqTaxis", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistInqTaxis(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefTable(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefTable", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefTable", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  vlistDefTable(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqTable(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqTable", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistInqTable(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefInstitut(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefInstitut", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefInstitut", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  vlistDefInstitut(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqInstitut(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqInstitut", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistInqInstitut(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefModel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefModel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefModel", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  vlistDefModel(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqModel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqModel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)vlistInqModel(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVar(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int arg4 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 4) || (argc > 4)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVar", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVar", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefVar", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  ecode4 = SWIG_AsVal_int(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","vlistDefVar", 4, argv[3] ));
+  } 
+  arg4 = (int)(val4);
+  result = (int)vlistDefVar(arg1,arg2,arg3,arg4);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistChangeVarGrid(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistChangeVarGrid", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistChangeVarGrid", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistChangeVarGrid", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistChangeVarGrid(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistChangeVarZaxis(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistChangeVarZaxis", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistChangeVarZaxis", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistChangeVarZaxis", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistChangeVarZaxis(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVar(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int *arg3 = (int *) 0 ;
+  int *arg4 = (int *) 0 ;
+  int *arg5 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  
+  if ((argc < 5) || (argc > 5)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVar", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVar", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","vlistInqVar", 3, argv[2] )); 
+  }
+  arg3 = (int *)(argp3);
+  res4 = SWIG_ConvertPtr(argv[3], &argp4,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "int *","vlistInqVar", 4, argv[3] )); 
+  }
+  arg4 = (int *)(argp4);
+  res5 = SWIG_ConvertPtr(argv[4], &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "int *","vlistInqVar", 5, argv[4] )); 
+  }
+  arg5 = (int *)(argp5);
+  vlistInqVar(arg1,arg2,arg3,arg4,arg5);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarGrid(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarGrid", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarGrid", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarGrid(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarZaxis(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarZaxis", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarZaxis", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarZaxis(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarTime(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarTime", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarTime", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarTime(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarZtype(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarZtype", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarZtype", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefVarZtype", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarZtype(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarZtype(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarZtype", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarZtype", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarZtype(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarZlevel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarZlevel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarZlevel", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefVarZlevel", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarZlevel(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarZlevel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarZlevel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarZlevel", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarZlevel(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarCode(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarCode", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarCode", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefVarCode", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarCode(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarCode(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarCode", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarCode", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarCode(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarDatatype(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarDatatype", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarDatatype", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefVarDatatype", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarDatatype(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarDatatype(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarDatatype", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarDatatype", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarDatatype(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarInstitut(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarInstitut", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarInstitut", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefVarInstitut", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarInstitut(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarInstitut(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarInstitut", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarInstitut", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarInstitut(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarModel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarModel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarModel", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefVarModel", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarModel(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarModel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarModel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarModel", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarModel(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarTable(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarTable", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarTable", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefVarTable", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarTable(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarTable(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarTable", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarTable", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarTable(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarName(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarName", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarName", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","vlistDefVarName", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  vlistDefVarName(arg1,arg2,(char const *)arg3);
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarName(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarName", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarName", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","vlistInqVarName", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  vlistInqVarName(arg1,arg2,arg3);
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarLongname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarLongname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarLongname", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","vlistDefVarLongname", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  vlistDefVarLongname(arg1,arg2,(char const *)arg3);
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarStdname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarStdname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarStdname", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","vlistDefVarStdname", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  vlistDefVarStdname(arg1,arg2,(char const *)arg3);
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarLongname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarLongname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarLongname", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","vlistInqVarLongname", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  vlistInqVarLongname(arg1,arg2,arg3);
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarStdname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarStdname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarStdname", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","vlistInqVarStdname", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  vlistInqVarStdname(arg1,arg2,arg3);
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarUnits(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarUnits", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarUnits", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","vlistDefVarUnits", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  vlistDefVarUnits(arg1,arg2,(char const *)arg3);
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarUnits(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarUnits", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarUnits", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","vlistInqVarUnits", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  vlistInqVarUnits(arg1,arg2,arg3);
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarMissval(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  double arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarMissval", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarMissval", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_double(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","vlistDefVarMissval", 3, argv[2] ));
+  } 
+  arg3 = (double)(val3);
+  vlistDefVarMissval(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarMissval(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarMissval", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarMissval", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (double)vlistInqVarMissval(arg1,arg2);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarScalefactor(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  double arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarScalefactor", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarScalefactor", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_double(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","vlistDefVarScalefactor", 3, argv[2] ));
+  } 
+  arg3 = (double)(val3);
+  vlistDefVarScalefactor(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarScalefactor(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarScalefactor", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarScalefactor", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (double)vlistInqVarScalefactor(arg1,arg2);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarAddoffset(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  double arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarAddoffset", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarAddoffset", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_double(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","vlistDefVarAddoffset", 3, argv[2] ));
+  } 
+  arg3 = (double)(val3);
+  vlistDefVarAddoffset(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarAddoffset(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarAddoffset", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarAddoffset", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (double)vlistInqVarAddoffset(arg1,arg2);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarTimave(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarTimave", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarTimave", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefVarTimave", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarTimave(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarTimave(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarTimave", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarTimave", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarTimave(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefVarTimaccu(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefVarTimaccu", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefVarTimaccu", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefVarTimaccu", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  vlistDefVarTimaccu(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarTimaccu(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarTimaccu", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarTimaccu", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarTimaccu(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarSize(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarSize", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarSize", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarSize(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqVarID(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqVarID", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqVarID", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistInqVarID(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefIndex(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int arg4 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  
+  if ((argc < 4) || (argc > 4)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefIndex", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefIndex", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefIndex", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  ecode4 = SWIG_AsVal_int(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","vlistDefIndex", 4, argv[3] ));
+  } 
+  arg4 = (int)(val4);
+  vlistDefIndex(arg1,arg2,arg3,arg4);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqIndex(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqIndex", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqIndex", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistInqIndex", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  result = (int)vlistInqIndex(arg1,arg2,arg3);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefFlag(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int arg4 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  
+  if ((argc < 4) || (argc > 4)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefFlag", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefFlag", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistDefFlag", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  ecode4 = SWIG_AsVal_int(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","vlistDefFlag", 4, argv[3] ));
+  } 
+  arg4 = (int)(val4);
+  vlistDefFlag(arg1,arg2,arg3,arg4);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqFlag(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqFlag", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqFlag", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistInqFlag", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  result = (int)vlistInqFlag(arg1,arg2,arg3);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistFindVar(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistFindVar", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistFindVar", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistFindVar(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistFindLevel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistFindLevel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistFindLevel", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistFindLevel", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  result = (int)vlistFindLevel(arg1,arg2,arg3);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistMergedVar(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistMergedVar", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistMergedVar", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)vlistMergedVar(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistMergedLevel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistMergedLevel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistMergedLevel", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistMergedLevel", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  result = (int)vlistMergedLevel(arg1,arg2,arg3);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqNatts(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqNatts", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqNatts", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","vlistInqNatts", 3, argv[2] )); 
+  }
+  arg3 = (int *)(argp3);
+  result = (int)vlistInqNatts(arg1,arg2,arg3);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqAtt(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  char *arg4 = (char *) 0 ;
+  int *arg5 = (int *) 0 ;
+  int *arg6 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  int res4 ;
+  char *buf4 = 0 ;
+  int alloc4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  void *argp6 = 0 ;
+  int res6 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 6) || (argc > 6)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqAtt", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqAtt", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","vlistInqAtt", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char *","vlistInqAtt", 4, argv[3] ));
+  }
+  arg4 = (char *)(buf4);
+  res5 = SWIG_ConvertPtr(argv[4], &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "int *","vlistInqAtt", 5, argv[4] )); 
+  }
+  arg5 = (int *)(argp5);
+  res6 = SWIG_ConvertPtr(argv[5], &argp6,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res6)) {
+    SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "int *","vlistInqAtt", 6, argv[5] )); 
+  }
+  arg6 = (int *)(argp6);
+  result = (int)vlistInqAtt(arg1,arg2,arg3,arg4,arg5,arg6);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return vresult;
+fail:
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDelAtt(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDelAtt", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDelAtt", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","vlistDelAtt", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  result = (int)vlistDelAtt(arg1,arg2,(char const *)arg3);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefAttInt(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  int *arg5 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 5) || (argc > 5)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefAttInt", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefAttInt", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","vlistDefAttInt", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","vlistDefAttInt", 4, argv[3] ));
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_ConvertPtr(argv[4], &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "int const *","vlistDefAttInt", 5, argv[4] )); 
+  }
+  arg5 = (int *)(argp5);
+  result = (int)vlistDefAttInt(arg1,arg2,(char const *)arg3,arg4,(int const *)arg5);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefAttFlt(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  double *arg5 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 5) || (argc > 5)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefAttFlt", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefAttFlt", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","vlistDefAttFlt", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","vlistDefAttFlt", 4, argv[3] ));
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_ConvertPtr(argv[4], &argp5,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "double const *","vlistDefAttFlt", 5, argv[4] )); 
+  }
+  arg5 = (double *)(argp5);
+  result = (int)vlistDefAttFlt(arg1,arg2,(char const *)arg3,arg4,(double const *)arg5);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistDefAttTxt(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  char *arg5 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  int res5 ;
+  char *buf5 = 0 ;
+  int alloc5 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 5) || (argc > 5)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistDefAttTxt", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistDefAttTxt", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","vlistDefAttTxt", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","vlistDefAttTxt", 4, argv[3] ));
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_AsCharPtrAndSize(argv[4], &buf5, NULL, &alloc5);
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char const *","vlistDefAttTxt", 5, argv[4] ));
+  }
+  arg5 = (char *)(buf5);
+  result = (int)vlistDefAttTxt(arg1,arg2,(char const *)arg3,arg4,(char const *)arg5);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqAttInt(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  int *arg5 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 5) || (argc > 5)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqAttInt", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqAttInt", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","vlistInqAttInt", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","vlistInqAttInt", 4, argv[3] ));
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_ConvertPtr(argv[4], &argp5,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "int *","vlistInqAttInt", 5, argv[4] )); 
+  }
+  arg5 = (int *)(argp5);
+  result = (int)vlistInqAttInt(arg1,arg2,(char const *)arg3,arg4,arg5);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqAttFlt(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  double *arg5 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 5) || (argc > 5)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqAttFlt", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqAttFlt", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","vlistInqAttFlt", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","vlistInqAttFlt", 4, argv[3] ));
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_ConvertPtr(argv[4], &argp5,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "double *","vlistInqAttFlt", 5, argv[4] )); 
+  }
+  arg5 = (double *)(argp5);
+  result = (int)vlistInqAttFlt(arg1,arg2,(char const *)arg3,arg4,arg5);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_vlistInqAttTxt(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int arg4 ;
+  char *arg5 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  int res5 ;
+  char *buf5 = 0 ;
+  int alloc5 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 5) || (argc > 5)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","vlistInqAttTxt", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistInqAttTxt", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","vlistInqAttTxt", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  ecode4 = SWIG_AsVal_int(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "int","vlistInqAttTxt", 4, argv[3] ));
+  } 
+  arg4 = (int)(val4);
+  res5 = SWIG_AsCharPtrAndSize(argv[4], &buf5, NULL, &alloc5);
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char *","vlistInqAttTxt", 5, argv[4] ));
+  }
+  arg5 = (char *)(buf5);
+  result = (int)vlistInqAttTxt(arg1,arg2,(char const *)arg3,arg4,arg5);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridName(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridName", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","gridName", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridName(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridNamePtr(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridNamePtr", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (char *)gridNamePtr(arg1);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridCompress(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridCompress", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  gridCompress(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefMask(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefMask", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "int const *","gridDefMask", 2, argv[1] )); 
+  }
+  arg2 = (int *)(argp2);
+  gridDefMask(arg1,(int const *)arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqMask(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqMask", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "int *","gridInqMask", 2, argv[1] )); 
+  }
+  arg2 = (int *)(argp2);
+  result = (int)gridInqMask(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridPrint(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridPrint", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridPrint", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  gridPrint(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridSize(int argc, VALUE *argv, VALUE self) {
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (int)gridSize();
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridCreate(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridCreate", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridCreate", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)gridCreate(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDestroy(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDestroy", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  gridDestroy(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDuplicate(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDuplicate", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridDuplicate(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqType(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqType", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqType(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqSize(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqSize", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqSize(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefXsize(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefXsize", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridDefXsize", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  gridDefXsize(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqXsize(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqXsize", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqXsize(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefYsize(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefYsize", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridDefYsize", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  gridDefYsize(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqYsize(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqYsize", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqYsize(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefXvals(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefXvals", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double const *","gridDefXvals", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  gridDefXvals(arg1,(double const *)arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqXvals(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqXvals", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","gridInqXvals", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)gridInqXvals(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefYvals(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefYvals", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double const *","gridDefYvals", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  gridDefYvals(arg1,(double const *)arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqYvals(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqYvals", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","gridInqYvals", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)gridInqYvals(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefXname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefXname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","gridDefXname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridDefXname(arg1,(char const *)arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefXlongname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefXlongname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","gridDefXlongname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridDefXlongname(arg1,(char const *)arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefXunits(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefXunits", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","gridDefXunits", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridDefXunits(arg1,(char const *)arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefYname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefYname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","gridDefYname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridDefYname(arg1,(char const *)arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefYlongname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefYlongname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","gridDefYlongname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridDefYlongname(arg1,(char const *)arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefYunits(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefYunits", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","gridDefYunits", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridDefYunits(arg1,(char const *)arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqXname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqXname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","gridInqXname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridInqXname(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqXlongname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqXlongname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","gridInqXlongname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridInqXlongname(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqXstdname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqXstdname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","gridInqXstdname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridInqXstdname(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqXunits(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqXunits", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","gridInqXunits", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridInqXunits(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqYname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqYname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","gridInqYname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridInqYname(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqYlongname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqYlongname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","gridInqYlongname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridInqYlongname(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqYstdname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqYstdname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","gridInqYstdname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridInqYstdname(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqYunits(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqYunits", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","gridInqYunits", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  gridInqYunits(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefPrec(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefPrec", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridDefPrec", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  gridDefPrec(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqPrec(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqPrec", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqPrec(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqXval(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqXval", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridInqXval", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (double)gridInqXval(arg1,arg2);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqYval(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqYval", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridInqYval", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (double)gridInqYval(arg1,arg2);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqXinc(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqXinc", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (double)gridInqXinc(arg1);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqYinc(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqYinc", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (double)gridInqYinc(arg1);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridIsCircular(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridIsCircular", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridIsCircular(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridIsRotated(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridIsRotated", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridIsRotated(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqXpole(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqXpole", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (double)gridInqXpole(arg1);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefXpole(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefXpole", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","gridDefXpole", 2, argv[1] ));
+  } 
+  arg2 = (double)(val2);
+  gridDefXpole(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqYpole(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqYpole", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (double)gridInqYpole(arg1);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefYpole(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefYpole", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","gridDefYpole", 2, argv[1] ));
+  } 
+  arg2 = (double)(val2);
+  gridDefYpole(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqAngle(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqAngle", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (double)gridInqAngle(arg1);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefAngle(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefAngle", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","gridDefAngle", 2, argv[1] ));
+  } 
+  arg2 = (double)(val2);
+  gridDefAngle(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefTrunc(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefTrunc", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridDefTrunc", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  gridDefTrunc(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqTrunc(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqTrunc", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqTrunc(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqGMEnd(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqGMEnd", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqGMEnd(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefGMEnd(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefGMEnd", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridDefGMEnd", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  gridDefGMEnd(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqGMEni(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqGMEni", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqGMEni(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefGMEni(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefGMEni", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridDefGMEni", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  gridDefGMEni(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqGMEni2(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqGMEni2", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqGMEni2(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefGMEni2(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefGMEni2", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridDefGMEni2", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  gridDefGMEni2(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqGMEni3(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqGMEni3", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqGMEni3(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefGMEni3(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefGMEni3", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridDefGMEni3", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  gridDefGMEni3(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefLCC(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double arg2 ;
+  double arg3 ;
+  double arg4 ;
+  double arg5 ;
+  double arg6 ;
+  double arg7 ;
+  double arg8 ;
+  int arg9 ;
+  int arg10 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  double val4 ;
+  int ecode4 = 0 ;
+  double val5 ;
+  int ecode5 = 0 ;
+  double val6 ;
+  int ecode6 = 0 ;
+  double val7 ;
+  int ecode7 = 0 ;
+  double val8 ;
+  int ecode8 = 0 ;
+  int val9 ;
+  int ecode9 = 0 ;
+  int val10 ;
+  int ecode10 = 0 ;
+  
+  if ((argc < 10) || (argc > 10)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 10)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefLCC", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","gridDefLCC", 2, argv[1] ));
+  } 
+  arg2 = (double)(val2);
+  ecode3 = SWIG_AsVal_double(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","gridDefLCC", 3, argv[2] ));
+  } 
+  arg3 = (double)(val3);
+  ecode4 = SWIG_AsVal_double(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","gridDefLCC", 4, argv[3] ));
+  } 
+  arg4 = (double)(val4);
+  ecode5 = SWIG_AsVal_double(argv[4], &val5);
+  if (!SWIG_IsOK(ecode5)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","gridDefLCC", 5, argv[4] ));
+  } 
+  arg5 = (double)(val5);
+  ecode6 = SWIG_AsVal_double(argv[5], &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","gridDefLCC", 6, argv[5] ));
+  } 
+  arg6 = (double)(val6);
+  ecode7 = SWIG_AsVal_double(argv[6], &val7);
+  if (!SWIG_IsOK(ecode7)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "double","gridDefLCC", 7, argv[6] ));
+  } 
+  arg7 = (double)(val7);
+  ecode8 = SWIG_AsVal_double(argv[7], &val8);
+  if (!SWIG_IsOK(ecode8)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode8), Ruby_Format_TypeError( "", "double","gridDefLCC", 8, argv[7] ));
+  } 
+  arg8 = (double)(val8);
+  ecode9 = SWIG_AsVal_int(argv[8], &val9);
+  if (!SWIG_IsOK(ecode9)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode9), Ruby_Format_TypeError( "", "int","gridDefLCC", 9, argv[8] ));
+  } 
+  arg9 = (int)(val9);
+  ecode10 = SWIG_AsVal_int(argv[9], &val10);
+  if (!SWIG_IsOK(ecode10)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode10), Ruby_Format_TypeError( "", "int","gridDefLCC", 10, argv[9] ));
+  } 
+  arg10 = (int)(val10);
+  gridDefLCC(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqLCC(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  double *arg3 = (double *) 0 ;
+  double *arg4 = (double *) 0 ;
+  double *arg5 = (double *) 0 ;
+  double *arg6 = (double *) 0 ;
+  double *arg7 = (double *) 0 ;
+  double *arg8 = (double *) 0 ;
+  int *arg9 = (int *) 0 ;
+  int *arg10 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  void *argp6 = 0 ;
+  int res6 = 0 ;
+  void *argp7 = 0 ;
+  int res7 = 0 ;
+  void *argp8 = 0 ;
+  int res8 = 0 ;
+  void *argp9 = 0 ;
+  int res9 = 0 ;
+  void *argp10 = 0 ;
+  int res10 = 0 ;
+  
+  if ((argc < 10) || (argc > 10)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 10)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqLCC", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","gridInqLCC", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "double *","gridInqLCC", 3, argv[2] )); 
+  }
+  arg3 = (double *)(argp3);
+  res4 = SWIG_ConvertPtr(argv[3], &argp4,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "double *","gridInqLCC", 4, argv[3] )); 
+  }
+  arg4 = (double *)(argp4);
+  res5 = SWIG_ConvertPtr(argv[4], &argp5,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "double *","gridInqLCC", 5, argv[4] )); 
+  }
+  arg5 = (double *)(argp5);
+  res6 = SWIG_ConvertPtr(argv[5], &argp6,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res6)) {
+    SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "double *","gridInqLCC", 6, argv[5] )); 
+  }
+  arg6 = (double *)(argp6);
+  res7 = SWIG_ConvertPtr(argv[6], &argp7,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res7)) {
+    SWIG_exception_fail(SWIG_ArgError(res7), Ruby_Format_TypeError( "", "double *","gridInqLCC", 7, argv[6] )); 
+  }
+  arg7 = (double *)(argp7);
+  res8 = SWIG_ConvertPtr(argv[7], &argp8,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res8)) {
+    SWIG_exception_fail(SWIG_ArgError(res8), Ruby_Format_TypeError( "", "double *","gridInqLCC", 8, argv[7] )); 
+  }
+  arg8 = (double *)(argp8);
+  res9 = SWIG_ConvertPtr(argv[8], &argp9,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res9)) {
+    SWIG_exception_fail(SWIG_ArgError(res9), Ruby_Format_TypeError( "", "int *","gridInqLCC", 9, argv[8] )); 
+  }
+  arg9 = (int *)(argp9);
+  res10 = SWIG_ConvertPtr(argv[9], &argp10,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res10)) {
+    SWIG_exception_fail(SWIG_ArgError(res10), Ruby_Format_TypeError( "", "int *","gridInqLCC", 10, argv[9] )); 
+  }
+  arg10 = (int *)(argp10);
+  gridInqLCC(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9,arg10);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefLcc2(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double arg2 ;
+  double arg3 ;
+  double arg4 ;
+  double arg5 ;
+  double arg6 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  double val4 ;
+  int ecode4 = 0 ;
+  double val5 ;
+  int ecode5 = 0 ;
+  double val6 ;
+  int ecode6 = 0 ;
+  
+  if ((argc < 6) || (argc > 6)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefLcc2", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","gridDefLcc2", 2, argv[1] ));
+  } 
+  arg2 = (double)(val2);
+  ecode3 = SWIG_AsVal_double(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","gridDefLcc2", 3, argv[2] ));
+  } 
+  arg3 = (double)(val3);
+  ecode4 = SWIG_AsVal_double(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","gridDefLcc2", 4, argv[3] ));
+  } 
+  arg4 = (double)(val4);
+  ecode5 = SWIG_AsVal_double(argv[4], &val5);
+  if (!SWIG_IsOK(ecode5)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","gridDefLcc2", 5, argv[4] ));
+  } 
+  arg5 = (double)(val5);
+  ecode6 = SWIG_AsVal_double(argv[5], &val6);
+  if (!SWIG_IsOK(ecode6)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "double","gridDefLcc2", 6, argv[5] ));
+  } 
+  arg6 = (double)(val6);
+  gridDefLcc2(arg1,arg2,arg3,arg4,arg5,arg6);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqLcc2(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  double *arg3 = (double *) 0 ;
+  double *arg4 = (double *) 0 ;
+  double *arg5 = (double *) 0 ;
+  double *arg6 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  void *argp5 = 0 ;
+  int res5 = 0 ;
+  void *argp6 = 0 ;
+  int res6 = 0 ;
+  
+  if ((argc < 6) || (argc > 6)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 6)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqLcc2", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","gridInqLcc2", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "double *","gridInqLcc2", 3, argv[2] )); 
+  }
+  arg3 = (double *)(argp3);
+  res4 = SWIG_ConvertPtr(argv[3], &argp4,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "double *","gridInqLcc2", 4, argv[3] )); 
+  }
+  arg4 = (double *)(argp4);
+  res5 = SWIG_ConvertPtr(argv[4], &argp5,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "double *","gridInqLcc2", 5, argv[4] )); 
+  }
+  arg5 = (double *)(argp5);
+  res6 = SWIG_ConvertPtr(argv[5], &argp6,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res6)) {
+    SWIG_exception_fail(SWIG_ArgError(res6), Ruby_Format_TypeError( "", "double *","gridInqLcc2", 6, argv[5] )); 
+  }
+  arg6 = (double *)(argp6);
+  gridInqLcc2(arg1,arg2,arg3,arg4,arg5,arg6);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefLaea(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double arg2 ;
+  double arg3 ;
+  double arg4 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  double val4 ;
+  int ecode4 = 0 ;
+  
+  if ((argc < 4) || (argc > 4)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefLaea", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_double(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","gridDefLaea", 2, argv[1] ));
+  } 
+  arg2 = (double)(val2);
+  ecode3 = SWIG_AsVal_double(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","gridDefLaea", 3, argv[2] ));
+  } 
+  arg3 = (double)(val3);
+  ecode4 = SWIG_AsVal_double(argv[3], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "double","gridDefLaea", 4, argv[3] ));
+  } 
+  arg4 = (double)(val4);
+  gridDefLaea(arg1,arg2,arg3,arg4);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqLaea(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  double *arg3 = (double *) 0 ;
+  double *arg4 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  void *argp4 = 0 ;
+  int res4 = 0 ;
+  
+  if ((argc < 4) || (argc > 4)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqLaea", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","gridInqLaea", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "double *","gridInqLaea", 3, argv[2] )); 
+  }
+  arg3 = (double *)(argp3);
+  res4 = SWIG_ConvertPtr(argv[3], &argp4,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "double *","gridInqLaea", 4, argv[3] )); 
+  }
+  arg4 = (double *)(argp4);
+  gridInqLaea(arg1,arg2,arg3,arg4);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefArea(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefArea", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double const *","gridDefArea", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  gridDefArea(arg1,(double const *)arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqArea(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqArea", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","gridInqArea", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  gridInqArea(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridHasArea(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridHasArea", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridHasArea(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefNvertex(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefNvertex", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridDefNvertex", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  gridDefNvertex(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqNvertex(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqNvertex", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)gridInqNvertex(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefXbounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefXbounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double const *","gridDefXbounds", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  gridDefXbounds(arg1,(double const *)arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqXbounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqXbounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","gridInqXbounds", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)gridInqXbounds(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefYbounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefYbounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double const *","gridDefYbounds", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  gridDefYbounds(arg1,(double const *)arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqYbounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqYbounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","gridInqYbounds", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)gridInqYbounds(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridDefRowlon(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridDefRowlon", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridDefRowlon", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int const *","gridDefRowlon", 3, argv[2] )); 
+  }
+  arg3 = (int *)(argp3);
+  gridDefRowlon(arg1,arg2,(int const *)arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridInqRowlon(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridInqRowlon", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "int *","gridInqRowlon", 2, argv[1] )); 
+  }
+  arg2 = (int *)(argp2);
+  gridInqRowlon(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_gridChangeType(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","gridChangeType", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridChangeType", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  gridChangeType(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisName(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisName", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","zaxisName", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  zaxisName(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisCreate(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisCreate", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisCreate", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (int)zaxisCreate(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDestroy(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDestroy", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  zaxisDestroy(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqType(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqType", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisInqType(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqSize(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqSize", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisInqSize(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDuplicate(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDuplicate", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisDuplicate(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisResize(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisResize", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisResize", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  zaxisResize(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisPrint(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisPrint", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  zaxisPrint(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisSize(int argc, VALUE *argv, VALUE self) {
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (int)zaxisSize();
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDefLevels(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDefLevels", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double const *","zaxisDefLevels", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  zaxisDefLevels(arg1,(double const *)arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqLevels(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqLevels", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","zaxisInqLevels", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  zaxisInqLevels(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDefLevel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  double arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDefLevel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisDefLevel", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_double(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "double","zaxisDefLevel", 3, argv[2] ));
+  } 
+  arg3 = (double)(val3);
+  zaxisDefLevel(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqLevel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqLevel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisInqLevel", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (double)zaxisInqLevel(arg1,arg2);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDefName(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDefName", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","zaxisDefName", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  zaxisDefName(arg1,(char const *)arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDefLongname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDefLongname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","zaxisDefLongname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  zaxisDefLongname(arg1,(char const *)arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDefUnits(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDefUnits", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char const *","zaxisDefUnits", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  zaxisDefUnits(arg1,(char const *)arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqName(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqName", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","zaxisInqName", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  zaxisInqName(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqLongname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqLongname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","zaxisInqLongname", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  zaxisInqLongname(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqUnits(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqUnits", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","zaxisInqUnits", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  zaxisInqUnits(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDefPrec(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDefPrec", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisDefPrec", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  zaxisDefPrec(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqPrec(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqPrec", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisInqPrec(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDefLtype(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDefLtype", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisDefLtype", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  zaxisDefLtype(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqLtype(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqLtype", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisInqLtype(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqLevelsPtr(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqLevelsPtr", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (double *)zaxisInqLevelsPtr(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDefVct(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  double *arg3 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDefVct", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisDefVct", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "double const *","zaxisDefVct", 3, argv[2] )); 
+  }
+  arg3 = (double *)(argp3);
+  zaxisDefVct(arg1,arg2,(double const *)arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqVctSize(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqVctSize", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)zaxisInqVctSize(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqVctPtr(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  double *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqVctPtr", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (double *)zaxisInqVctPtr(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqLbounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqLbounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","zaxisInqLbounds", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)zaxisInqLbounds(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqUbounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqUbounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","zaxisInqUbounds", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)zaxisInqUbounds(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqWeights(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqWeights", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","zaxisInqWeights", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  result = (int)zaxisInqWeights(arg1,arg2);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqLbound(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqLbound", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisInqLbound", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (double)zaxisInqLbound(arg1,arg2);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisInqUbound(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisInqUbound", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisInqUbound", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (double)zaxisInqUbound(arg1,arg2);
+  vresult = SWIG_From_double((double)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDefLbounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDefLbounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double const *","zaxisDefLbounds", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  zaxisDefLbounds(arg1,(double const *)arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDefUbounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDefUbounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double const *","zaxisDefUbounds", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  zaxisDefUbounds(arg1,(double const *)arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisDefWeights(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  double *arg2 = (double *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisDefWeights", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double const *","zaxisDefWeights", 2, argv[1] )); 
+  }
+  arg2 = (double *)(argp2);
+  zaxisDefWeights(arg1,(double const *)arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_zaxisChangeType(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","zaxisChangeType", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisChangeType", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  zaxisChangeType(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisCreate(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisCreate", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisCreate(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDestroy(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDestroy", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  taxisDestroy(arg1);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDuplicate(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDuplicate", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisDuplicate(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisCopyTimestep(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisCopyTimestep", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisCopyTimestep", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  taxisCopyTimestep(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDefType(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDefType", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisDefType", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  taxisDefType(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDefVdate(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDefVdate", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisDefVdate", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  taxisDefVdate(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDefVtime(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDefVtime", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisDefVtime", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  taxisDefVtime(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDefRdate(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDefRdate", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisDefRdate", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  taxisDefRdate(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDefRtime(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDefRtime", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisDefRtime", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  taxisDefRtime(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisHasBounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisHasBounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisHasBounds(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDefVdateBounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDefVdateBounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisDefVdateBounds", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","taxisDefVdateBounds", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  taxisDefVdateBounds(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDefVtimeBounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDefVtimeBounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisDefVtimeBounds", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","taxisDefVtimeBounds", 3, argv[2] ));
+  } 
+  arg3 = (int)(val3);
+  taxisDefVtimeBounds(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisInqVdateBounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisInqVdateBounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "int *","taxisInqVdateBounds", 2, argv[1] )); 
+  }
+  arg2 = (int *)(argp2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","taxisInqVdateBounds", 3, argv[2] )); 
+  }
+  arg3 = (int *)(argp3);
+  taxisInqVdateBounds(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisInqVtimeBounds(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int *arg2 = (int *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisInqVtimeBounds", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "int *","taxisInqVtimeBounds", 2, argv[1] )); 
+  }
+  arg2 = (int *)(argp2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","taxisInqVtimeBounds", 3, argv[2] )); 
+  }
+  arg3 = (int *)(argp3);
+  taxisInqVtimeBounds(arg1,arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDefCalendar(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDefCalendar", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisDefCalendar", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  taxisDefCalendar(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDefTunit(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDefTunit", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisDefTunit", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  taxisDefTunit(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisDefNumavg(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisDefNumavg", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisDefNumavg", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  taxisDefNumavg(arg1,arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisInqType(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisInqType", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqType(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisInqVdate(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisInqVdate", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqVdate(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisInqVtime(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisInqVtime", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqVtime(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisInqRdate(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisInqRdate", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqRdate(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisInqRtime(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisInqRtime", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqRtime(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisInqCalendar(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisInqCalendar", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqCalendar(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisInqTunit(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisInqTunit", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqTunit(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_taxisInqNumavg(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","taxisInqNumavg", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)taxisInqNumavg(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tunitNamePtr(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tunitNamePtr", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (char *)tunitNamePtr(arg1);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_institutDef(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int res4 ;
+  char *buf4 = 0 ;
+  int alloc4 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 4) || (argc > 4)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","institutDef", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","institutDef", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","institutDef", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","institutDef", 4, argv[3] ));
+  }
+  arg4 = (char *)(buf4);
+  result = (int)institutDef(arg1,arg2,(char const *)arg3,(char const *)arg4);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_institutInq(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int res4 ;
+  char *buf4 = 0 ;
+  int alloc4 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 4) || (argc > 4)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 4)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","institutInq", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","institutInq", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","institutInq", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","institutInq", 4, argv[3] ));
+  }
+  arg4 = (char *)(buf4);
+  result = (int)institutInq(arg1,arg2,(char const *)arg3,(char const *)arg4);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_institutInqNumber(int argc, VALUE *argv, VALUE self) {
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (int)institutInqNumber();
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_institutInqCenter(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","institutInqCenter", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)institutInqCenter(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_institutInqSubcenter(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","institutInqSubcenter", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)institutInqSubcenter(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_institutInqNamePtr(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","institutInqNamePtr", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (char *)institutInqNamePtr(arg1);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_institutInqLongnamePtr(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","institutInqLongnamePtr", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (char *)institutInqLongnamePtr(arg1);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_modelDef(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","modelDef", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","modelDef", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","modelDef", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  result = (int)modelDef(arg1,arg2,(char const *)arg3);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_modelInq(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","modelInq", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","modelInq", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","modelInq", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  result = (int)modelInq(arg1,arg2,arg3);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_modelInqInstitut(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","modelInqInstitut", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)modelInqInstitut(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_modelInqGribID(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","modelInqGribID", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)modelInqGribID(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_modelInqNamePtr(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","modelInqNamePtr", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (char *)modelInqNamePtr(arg1);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableWriteC(int argc, VALUE *argv, VALUE self) {
+  char *arg1 = (char *) 0 ;
+  int arg2 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","tableWriteC", 1, argv[0] ));
+  }
+  arg1 = (char *)(buf1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableWriteC", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  tableWriteC((char const *)arg1,arg2);
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return Qnil;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableWrite(int argc, VALUE *argv, VALUE self) {
+  char *arg1 = (char *) 0 ;
+  int arg2 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","tableWrite", 1, argv[0] ));
+  }
+  arg1 = (char *)(buf1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableWrite", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  tableWrite((char const *)arg1,arg2);
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return Qnil;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableRead(int argc, VALUE *argv, VALUE self) {
+  char *arg1 = (char *) 0 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","tableRead", 1, argv[0] ));
+  }
+  arg1 = (char *)(buf1);
+  result = (int)tableRead((char const *)arg1);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return vresult;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableDef(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableDef", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableDef", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","tableDef", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  result = (int)tableDef(arg1,arg2,(char const *)arg3);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqNamePtr(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInqNamePtr", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (char *)tableInqNamePtr(arg1);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableDefEntry(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  char *arg5 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int res4 ;
+  char *buf4 = 0 ;
+  int alloc4 = 0 ;
+  int res5 ;
+  char *buf5 = 0 ;
+  int alloc5 = 0 ;
+  
+  if ((argc < 5) || (argc > 5)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableDefEntry", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableDefEntry", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","tableDefEntry", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char const *","tableDefEntry", 4, argv[3] ));
+  }
+  arg4 = (char *)(buf4);
+  res5 = SWIG_AsCharPtrAndSize(argv[4], &buf5, NULL, &alloc5);
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char const *","tableDefEntry", 5, argv[4] ));
+  }
+  arg5 = (char *)(buf5);
+  tableDefEntry(arg1,arg2,(char const *)arg3,(char const *)arg4,(char const *)arg5);
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return Qnil;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInq(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInq", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableInq", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","tableInq", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  result = (int)tableInq(arg1,arg2,(char const *)arg3);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqNumber(int argc, VALUE *argv, VALUE self) {
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (int)tableInqNumber();
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqNum(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInqNum", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)tableInqNum(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqModel(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInqModel", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)tableInqModel(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqPar(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  char *arg4 = (char *) 0 ;
+  char *arg5 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int res4 ;
+  char *buf4 = 0 ;
+  int alloc4 = 0 ;
+  int res5 ;
+  char *buf5 = 0 ;
+  int alloc5 = 0 ;
+  
+  if ((argc < 5) || (argc > 5)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 5)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInqPar", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableInqPar", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","tableInqPar", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  res4 = SWIG_AsCharPtrAndSize(argv[3], &buf4, NULL, &alloc4);
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "char *","tableInqPar", 4, argv[3] ));
+  }
+  arg4 = (char *)(buf4);
+  res5 = SWIG_AsCharPtrAndSize(argv[4], &buf5, NULL, &alloc5);
+  if (!SWIG_IsOK(res5)) {
+    SWIG_exception_fail(SWIG_ArgError(res5), Ruby_Format_TypeError( "", "char *","tableInqPar", 5, argv[4] ));
+  }
+  arg5 = (char *)(buf5);
+  tableInqPar(arg1,arg2,arg3,arg4,arg5);
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return Qnil;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
+  if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqParCode(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int *arg3 = (int *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInqParCode", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","tableInqParCode", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  res3 = SWIG_ConvertPtr(argv[2], &argp3,SWIGTYPE_p_int, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "int *","tableInqParCode", 3, argv[2] )); 
+  }
+  arg3 = (int *)(argp3);
+  result = (int)tableInqParCode(arg1,arg2,arg3);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return vresult;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqParName(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInqParName", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableInqParName", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","tableInqParName", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  result = (int)tableInqParName(arg1,arg2,arg3);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqParLongname(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInqParLongname", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableInqParLongname", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","tableInqParLongname", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  result = (int)tableInqParLongname(arg1,arg2,arg3);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqParUnits(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInqParUnits", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableInqParUnits", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char *","tableInqParUnits", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  result = (int)tableInqParUnits(arg1,arg2,arg3);
+  vresult = SWIG_From_int((int)(result));
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return vresult;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqParNamePtr(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInqParNamePtr", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableInqParNamePtr", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (char *)tableInqParNamePtr(arg1,arg2);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqParLongnamePtr(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInqParLongnamePtr", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableInqParLongnamePtr", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (char *)tableInqParLongnamePtr(arg1,arg2);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_tableInqParUnitsPtr(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","tableInqParUnitsPtr", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","tableInqParUnitsPtr", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  result = (char *)tableInqParUnitsPtr(arg1,arg2);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamDefHistory(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  char *arg3 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int res3 ;
+  char *buf3 = 0 ;
+  int alloc3 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamDefHistory", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamDefHistory", 2, argv[1] ));
+  } 
+  arg2 = (int)(val2);
+  res3 = SWIG_AsCharPtrAndSize(argv[2], &buf3, NULL, &alloc3);
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "char const *","streamDefHistory", 3, argv[2] ));
+  }
+  arg3 = (char *)(buf3);
+  streamDefHistory(arg1,arg2,(char const *)arg3);
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+fail:
+  if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamInqHistorySize(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamInqHistorySize", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  result = (int)streamInqHistorySize(arg1);
+  vresult = SWIG_From_int((int)(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_streamInqHistoryString(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  char *arg2 = (char *) 0 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","streamInqHistoryString", 1, argv[0] ));
+  } 
+  arg1 = (int)(val1);
+  res2 = SWIG_AsCharPtrAndSize(argv[1], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","streamInqHistoryString", 2, argv[1] ));
+  }
+  arg2 = (char *)(buf2);
+  streamInqHistoryString(arg1,arg2);
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
+  return Qnil;
+}
+
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_int = {"_p_int", "int *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_off_t = {"_p_off_t", "off_t *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_char,
+  &_swigt__p_double,
+  &_swigt__p_float,
+  &_swigt__p_int,
+  &_swigt__p_off_t,
+};
+
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_int[] = {  {&_swigt__p_int, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_off_t[] = {  {&_swigt__p_off_t, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_char,
+  _swigc__p_double,
+  _swigc__p_float,
+  _swigc__p_int,
+  _swigc__p_off_t,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found, init;
+
+  clientdata = clientdata;
+
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+    init = 1;
+  } else {
+    init = 0;
+  }
+
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+
+  /* When multiple interpeters are used, a module could have already been initialized in
+     a different interpreter, but not yet have a pointer in this interpreter.
+     In this case, we do not want to continue adding types... everything should be
+     set up already */
+  if (init == 0) return;
+
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+  
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+	type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+    
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+	if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+	if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+	  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+	  cast->type = ret;
+	  ret = 0;
+	} else {
+	  /* Check for casting already in the list */
+	  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+	  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+	  if (!ocast) ret = 0;
+	}
+      }
+
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+	printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+  printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+
+  if (init_run) return;
+  init_run = 1;
+
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+            SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{ /* c-mode */
+#endif
+}
+#endif
+
+/*
+
+*/
+#ifdef __cplusplus
+extern "C"
+#endif
+SWIGEXPORT void Init_CdiLib(void) {
+  size_t i;
+  
+  SWIG_InitRuntime();
+  mCdiLib = rb_define_module("CdiLib");
+  
+  SWIG_InitializeModule(0);
+  for (i = 0; i < swig_module.size; i++) {
+    SWIG_define_class(swig_module.types[i]);
+  }
+  
+  SWIG_RubyInitializeTrackings();
+  rb_define_const(mCdiLib, "CDI_UNDEFID", SWIG_From_int((int)(-1)));
+  rb_define_const(mCdiLib, "CDI_GLOBAL", SWIG_From_int((int)(-1)));
+  rb_define_const(mCdiLib, "CDI_BIGENDIAN", SWIG_From_int((int)(0)));
+  rb_define_const(mCdiLib, "CDI_LITTLEENDIAN", SWIG_From_int((int)(1)));
+  rb_define_const(mCdiLib, "CDI_NOERR", SWIG_From_int((int)(0)));
+  rb_define_const(mCdiLib, "CDI_ESYSTEM", SWIG_From_int((int)(-10)));
+  rb_define_const(mCdiLib, "CDI_EINVAL", SWIG_From_int((int)(-20)));
+  rb_define_const(mCdiLib, "CDI_EUFTYPE", SWIG_From_int((int)(-21)));
+  rb_define_const(mCdiLib, "CDI_ELIBNAVAIL", SWIG_From_int((int)(-22)));
+  rb_define_const(mCdiLib, "CDI_EUFSTRUCT", SWIG_From_int((int)(-23)));
+  rb_define_const(mCdiLib, "CDI_EUNC4", SWIG_From_int((int)(-24)));
+  rb_define_const(mCdiLib, "FILETYPE_GRB", SWIG_From_int((int)(1)));
+  rb_define_const(mCdiLib, "FILETYPE_GRB2", SWIG_From_int((int)(2)));
+  rb_define_const(mCdiLib, "FILETYPE_NC", SWIG_From_int((int)(3)));
+  rb_define_const(mCdiLib, "FILETYPE_NC2", SWIG_From_int((int)(4)));
+  rb_define_const(mCdiLib, "FILETYPE_NC4", SWIG_From_int((int)(5)));
+  rb_define_const(mCdiLib, "FILETYPE_SRV", SWIG_From_int((int)(6)));
+  rb_define_const(mCdiLib, "FILETYPE_EXT", SWIG_From_int((int)(7)));
+  rb_define_const(mCdiLib, "FILETYPE_IEG", SWIG_From_int((int)(8)));
+  rb_define_const(mCdiLib, "COMPRESS_NONE", SWIG_From_int((int)(0)));
+  rb_define_const(mCdiLib, "COMPRESS_SZIP", SWIG_From_int((int)(1)));
+  rb_define_const(mCdiLib, "COMPRESS_GZIP", SWIG_From_int((int)(2)));
+  rb_define_const(mCdiLib, "COMPRESS_BZIP2", SWIG_From_int((int)(3)));
+  rb_define_const(mCdiLib, "COMPRESS_ZIP", SWIG_From_int((int)(4)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK", SWIG_From_int((int)(0)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK1", SWIG_From_int((int)(1)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK2", SWIG_From_int((int)(2)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK3", SWIG_From_int((int)(3)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK4", SWIG_From_int((int)(4)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK5", SWIG_From_int((int)(5)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK6", SWIG_From_int((int)(6)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK7", SWIG_From_int((int)(7)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK8", SWIG_From_int((int)(8)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK9", SWIG_From_int((int)(9)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK10", SWIG_From_int((int)(10)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK11", SWIG_From_int((int)(11)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK12", SWIG_From_int((int)(12)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK13", SWIG_From_int((int)(13)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK14", SWIG_From_int((int)(14)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK15", SWIG_From_int((int)(15)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK16", SWIG_From_int((int)(16)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK17", SWIG_From_int((int)(17)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK18", SWIG_From_int((int)(18)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK19", SWIG_From_int((int)(19)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK20", SWIG_From_int((int)(20)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK21", SWIG_From_int((int)(21)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK22", SWIG_From_int((int)(22)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK23", SWIG_From_int((int)(23)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK24", SWIG_From_int((int)(24)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK25", SWIG_From_int((int)(25)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK26", SWIG_From_int((int)(26)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK27", SWIG_From_int((int)(27)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK28", SWIG_From_int((int)(28)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK29", SWIG_From_int((int)(29)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK30", SWIG_From_int((int)(30)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK31", SWIG_From_int((int)(31)));
+  rb_define_const(mCdiLib, "DATATYPE_PACK32", SWIG_From_int((int)(32)));
+  rb_define_const(mCdiLib, "DATATYPE_FLT32", SWIG_From_int((int)(132)));
+  rb_define_const(mCdiLib, "DATATYPE_FLT64", SWIG_From_int((int)(164)));
+  rb_define_const(mCdiLib, "DATATYPE_INT8", SWIG_From_int((int)(208)));
+  rb_define_const(mCdiLib, "DATATYPE_INT16", SWIG_From_int((int)(216)));
+  rb_define_const(mCdiLib, "DATATYPE_INT32", SWIG_From_int((int)(232)));
+  rb_define_const(mCdiLib, "DATATYPE_UINT8", SWIG_From_int((int)(308)));
+  rb_define_const(mCdiLib, "DATATYPE_UINT16", SWIG_From_int((int)(316)));
+  rb_define_const(mCdiLib, "DATATYPE_UINT32", SWIG_From_int((int)(332)));
+  rb_define_const(mCdiLib, "DATATYPE_INT", SWIG_From_int((int)(251)));
+  rb_define_const(mCdiLib, "DATATYPE_FLT", SWIG_From_int((int)(252)));
+  rb_define_const(mCdiLib, "DATATYPE_TXT", SWIG_From_int((int)(253)));
+  rb_define_const(mCdiLib, "GRID_GENERIC", SWIG_From_int((int)(1)));
+  rb_define_const(mCdiLib, "GRID_GAUSSIAN", SWIG_From_int((int)(2)));
+  rb_define_const(mCdiLib, "GRID_GAUSSIAN_REDUCED", SWIG_From_int((int)(3)));
+  rb_define_const(mCdiLib, "GRID_LONLAT", SWIG_From_int((int)(4)));
+  rb_define_const(mCdiLib, "GRID_SPECTRAL", SWIG_From_int((int)(5)));
+  rb_define_const(mCdiLib, "GRID_FOURIER", SWIG_From_int((int)(6)));
+  rb_define_const(mCdiLib, "GRID_GME", SWIG_From_int((int)(7)));
+  rb_define_const(mCdiLib, "GRID_TRAJECTORY", SWIG_From_int((int)(8)));
+  rb_define_const(mCdiLib, "GRID_UNSTRUCTURED", SWIG_From_int((int)(9)));
+  rb_define_const(mCdiLib, "GRID_CURVILINEAR", SWIG_From_int((int)(10)));
+  rb_define_const(mCdiLib, "GRID_LCC", SWIG_From_int((int)(11)));
+  rb_define_const(mCdiLib, "GRID_LCC2", SWIG_From_int((int)(12)));
+  rb_define_const(mCdiLib, "GRID_LAEA", SWIG_From_int((int)(13)));
+  rb_define_const(mCdiLib, "GRID_SINUSOIDAL", SWIG_From_int((int)(14)));
+  rb_define_const(mCdiLib, "ZAXIS_SURFACE", SWIG_From_int((int)(0)));
+  rb_define_const(mCdiLib, "ZAXIS_GENERIC", SWIG_From_int((int)(1)));
+  rb_define_const(mCdiLib, "ZAXIS_HYBRID", SWIG_From_int((int)(2)));
+  rb_define_const(mCdiLib, "ZAXIS_HYBRID_HALF", SWIG_From_int((int)(3)));
+  rb_define_const(mCdiLib, "ZAXIS_PRESSURE", SWIG_From_int((int)(4)));
+  rb_define_const(mCdiLib, "ZAXIS_HEIGHT", SWIG_From_int((int)(5)));
+  rb_define_const(mCdiLib, "ZAXIS_DEPTH_BELOW_SEA", SWIG_From_int((int)(6)));
+  rb_define_const(mCdiLib, "ZAXIS_DEPTH_BELOW_LAND", SWIG_From_int((int)(7)));
+  rb_define_const(mCdiLib, "ZAXIS_ISENTROPIC", SWIG_From_int((int)(8)));
+  rb_define_const(mCdiLib, "ZAXIS_TRAJECTORY", SWIG_From_int((int)(9)));
+  rb_define_const(mCdiLib, "ZAXIS_ALTITUDE", SWIG_From_int((int)(10)));
+  rb_define_const(mCdiLib, "ZAXIS_SIGMA", SWIG_From_int((int)(11)));
+  rb_define_const(mCdiLib, "ZAXIS_MEANSEA", SWIG_From_int((int)(12)));
+  rb_define_const(mCdiLib, "TAXIS_ABSOLUTE", SWIG_From_int((int)(1)));
+  rb_define_const(mCdiLib, "TAXIS_RELATIVE", SWIG_From_int((int)(2)));
+  rb_define_const(mCdiLib, "TIME_CONSTANT", SWIG_From_int((int)(1)));
+  rb_define_const(mCdiLib, "TIME_VARIABLE", SWIG_From_int((int)(2)));
+  rb_define_const(mCdiLib, "TUNIT_SECOND", SWIG_From_int((int)(1)));
+  rb_define_const(mCdiLib, "TUNIT_MINUTE", SWIG_From_int((int)(2)));
+  rb_define_const(mCdiLib, "TUNIT_HOUR", SWIG_From_int((int)(3)));
+  rb_define_const(mCdiLib, "TUNIT_DAY", SWIG_From_int((int)(4)));
+  rb_define_const(mCdiLib, "TUNIT_MONTH", SWIG_From_int((int)(5)));
+  rb_define_const(mCdiLib, "TUNIT_YEAR", SWIG_From_int((int)(6)));
+  rb_define_const(mCdiLib, "TUNIT_QUARTER", SWIG_From_int((int)(7)));
+  rb_define_const(mCdiLib, "CALENDAR_STANDARD", SWIG_From_int((int)(0)));
+  rb_define_const(mCdiLib, "CALENDAR_PROLEPTIC", SWIG_From_int((int)(1)));
+  rb_define_const(mCdiLib, "CALENDAR_360DAYS", SWIG_From_int((int)(2)));
+  rb_define_const(mCdiLib, "CALENDAR_365DAYS", SWIG_From_int((int)(3)));
+  rb_define_const(mCdiLib, "CALENDAR_366DAYS", SWIG_From_int((int)(4)));
+  rb_define_const(mCdiLib, "CALENDAR_NONE", SWIG_From_int((int)(5)));
+  rb_define_module_function(mCdiLib, "cdiStringError", _wrap_cdiStringError, -1);
+  rb_define_module_function(mCdiLib, "cdiDebug", _wrap_cdiDebug, -1);
+  rb_define_module_function(mCdiLib, "cdiLibraryVersion", _wrap_cdiLibraryVersion, -1);
+  rb_define_module_function(mCdiLib, "cdiPrintVersion", _wrap_cdiPrintVersion, -1);
+  rb_define_module_function(mCdiLib, "cdiDefMissval", _wrap_cdiDefMissval, -1);
+  rb_define_module_function(mCdiLib, "cdiInqMissval", _wrap_cdiInqMissval, -1);
+  rb_define_module_function(mCdiLib, "cdiDefGlobal", _wrap_cdiDefGlobal, -1);
+  rb_define_module_function(mCdiLib, "streamOpenRead", _wrap_streamOpenRead, -1);
+  rb_define_module_function(mCdiLib, "streamOpenWrite", _wrap_streamOpenWrite, -1);
+  rb_define_module_function(mCdiLib, "streamOpenAppend", _wrap_streamOpenAppend, -1);
+  rb_define_module_function(mCdiLib, "streamClose", _wrap_streamClose, -1);
+  rb_define_module_function(mCdiLib, "streamSync", _wrap_streamSync, -1);
+  rb_define_module_function(mCdiLib, "streamDefVlist", _wrap_streamDefVlist, -1);
+  rb_define_module_function(mCdiLib, "streamInqVlist", _wrap_streamInqVlist, -1);
+  rb_define_module_function(mCdiLib, "streamInqFiletype", _wrap_streamInqFiletype, -1);
+  rb_define_module_function(mCdiLib, "streamDefByteorder", _wrap_streamDefByteorder, -1);
+  rb_define_module_function(mCdiLib, "streamInqByteorder", _wrap_streamInqByteorder, -1);
+  rb_define_module_function(mCdiLib, "streamDefZtype", _wrap_streamDefZtype, -1);
+  rb_define_module_function(mCdiLib, "streamDefZlevel", _wrap_streamDefZlevel, -1);
+  rb_define_module_function(mCdiLib, "streamInqZtype", _wrap_streamInqZtype, -1);
+  rb_define_module_function(mCdiLib, "streamInqZlevel", _wrap_streamInqZlevel, -1);
+  rb_define_module_function(mCdiLib, "streamDefTimestep", _wrap_streamDefTimestep, -1);
+  rb_define_module_function(mCdiLib, "streamInqTimestep", _wrap_streamInqTimestep, -1);
+  rb_define_module_function(mCdiLib, "streamFilename", _wrap_streamFilename, -1);
+  rb_define_module_function(mCdiLib, "streamFilesuffix", _wrap_streamFilesuffix, -1);
+  rb_define_module_function(mCdiLib, "streamNtsteps", _wrap_streamNtsteps, -1);
+  rb_define_module_function(mCdiLib, "streamNvals", _wrap_streamNvals, -1);
+  rb_define_module_function(mCdiLib, "streamReadVar", _wrap_streamReadVar, -1);
+  rb_define_module_function(mCdiLib, "streamWriteVar", _wrap_streamWriteVar, -1);
+  rb_define_module_function(mCdiLib, "streamReadVarSlice", _wrap_streamReadVarSlice, -1);
+  rb_define_module_function(mCdiLib, "streamWriteVarSlice", _wrap_streamWriteVarSlice, -1);
+  rb_define_module_function(mCdiLib, "streamInqRecord", _wrap_streamInqRecord, -1);
+  rb_define_module_function(mCdiLib, "streamDefRecord", _wrap_streamDefRecord, -1);
+  rb_define_module_function(mCdiLib, "streamReadRecord", _wrap_streamReadRecord, -1);
+  rb_define_module_function(mCdiLib, "streamWriteRecord", _wrap_streamWriteRecord, -1);
+  rb_define_module_function(mCdiLib, "streamCopyRecord", _wrap_streamCopyRecord, -1);
+  rb_define_module_function(mCdiLib, "streamInqGinfo", _wrap_streamInqGinfo, -1);
+  rb_define_module_function(mCdiLib, "vlistCreate", _wrap_vlistCreate, -1);
+  rb_define_module_function(mCdiLib, "vlistDestroy", _wrap_vlistDestroy, -1);
+  rb_define_module_function(mCdiLib, "vlistDuplicate", _wrap_vlistDuplicate, -1);
+  rb_define_module_function(mCdiLib, "vlistCopy", _wrap_vlistCopy, -1);
+  rb_define_module_function(mCdiLib, "vlistCopyFlag", _wrap_vlistCopyFlag, -1);
+  rb_define_module_function(mCdiLib, "vlistClearFlag", _wrap_vlistClearFlag, -1);
+  rb_define_module_function(mCdiLib, "vlistCat", _wrap_vlistCat, -1);
+  rb_define_module_function(mCdiLib, "vlistMerge", _wrap_vlistMerge, -1);
+  rb_define_module_function(mCdiLib, "vlistPrint", _wrap_vlistPrint, -1);
+  rb_define_module_function(mCdiLib, "vlistNvars", _wrap_vlistNvars, -1);
+  rb_define_module_function(mCdiLib, "vlistNgrids", _wrap_vlistNgrids, -1);
+  rb_define_module_function(mCdiLib, "vlistNzaxis", _wrap_vlistNzaxis, -1);
+  rb_define_module_function(mCdiLib, "vlistDefNtsteps", _wrap_vlistDefNtsteps, -1);
+  rb_define_module_function(mCdiLib, "vlistNtsteps", _wrap_vlistNtsteps, -1);
+  rb_define_module_function(mCdiLib, "vlistGridsizeMax", _wrap_vlistGridsizeMax, -1);
+  rb_define_module_function(mCdiLib, "vlistGrid", _wrap_vlistGrid, -1);
+  rb_define_module_function(mCdiLib, "vlistGridIndex", _wrap_vlistGridIndex, -1);
+  rb_define_module_function(mCdiLib, "vlistChangeGridIndex", _wrap_vlistChangeGridIndex, -1);
+  rb_define_module_function(mCdiLib, "vlistChangeGrid", _wrap_vlistChangeGrid, -1);
+  rb_define_module_function(mCdiLib, "vlistZaxis", _wrap_vlistZaxis, -1);
+  rb_define_module_function(mCdiLib, "vlistZaxisIndex", _wrap_vlistZaxisIndex, -1);
+  rb_define_module_function(mCdiLib, "vlistChangeZaxisIndex", _wrap_vlistChangeZaxisIndex, -1);
+  rb_define_module_function(mCdiLib, "vlistChangeZaxis", _wrap_vlistChangeZaxis, -1);
+  rb_define_module_function(mCdiLib, "vlistNrecs", _wrap_vlistNrecs, -1);
+  rb_define_module_function(mCdiLib, "vlistDefTaxis", _wrap_vlistDefTaxis, -1);
+  rb_define_module_function(mCdiLib, "vlistInqTaxis", _wrap_vlistInqTaxis, -1);
+  rb_define_module_function(mCdiLib, "vlistDefTable", _wrap_vlistDefTable, -1);
+  rb_define_module_function(mCdiLib, "vlistInqTable", _wrap_vlistInqTable, -1);
+  rb_define_module_function(mCdiLib, "vlistDefInstitut", _wrap_vlistDefInstitut, -1);
+  rb_define_module_function(mCdiLib, "vlistInqInstitut", _wrap_vlistInqInstitut, -1);
+  rb_define_module_function(mCdiLib, "vlistDefModel", _wrap_vlistDefModel, -1);
+  rb_define_module_function(mCdiLib, "vlistInqModel", _wrap_vlistInqModel, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVar", _wrap_vlistDefVar, -1);
+  rb_define_module_function(mCdiLib, "vlistChangeVarGrid", _wrap_vlistChangeVarGrid, -1);
+  rb_define_module_function(mCdiLib, "vlistChangeVarZaxis", _wrap_vlistChangeVarZaxis, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVar", _wrap_vlistInqVar, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarGrid", _wrap_vlistInqVarGrid, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarZaxis", _wrap_vlistInqVarZaxis, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarTime", _wrap_vlistInqVarTime, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarZtype", _wrap_vlistDefVarZtype, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarZtype", _wrap_vlistInqVarZtype, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarZlevel", _wrap_vlistDefVarZlevel, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarZlevel", _wrap_vlistInqVarZlevel, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarCode", _wrap_vlistDefVarCode, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarCode", _wrap_vlistInqVarCode, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarDatatype", _wrap_vlistDefVarDatatype, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarDatatype", _wrap_vlistInqVarDatatype, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarInstitut", _wrap_vlistDefVarInstitut, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarInstitut", _wrap_vlistInqVarInstitut, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarModel", _wrap_vlistDefVarModel, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarModel", _wrap_vlistInqVarModel, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarTable", _wrap_vlistDefVarTable, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarTable", _wrap_vlistInqVarTable, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarName", _wrap_vlistDefVarName, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarName", _wrap_vlistInqVarName, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarLongname", _wrap_vlistDefVarLongname, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarStdname", _wrap_vlistDefVarStdname, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarLongname", _wrap_vlistInqVarLongname, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarStdname", _wrap_vlistInqVarStdname, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarUnits", _wrap_vlistDefVarUnits, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarUnits", _wrap_vlistInqVarUnits, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarMissval", _wrap_vlistDefVarMissval, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarMissval", _wrap_vlistInqVarMissval, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarScalefactor", _wrap_vlistDefVarScalefactor, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarScalefactor", _wrap_vlistInqVarScalefactor, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarAddoffset", _wrap_vlistDefVarAddoffset, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarAddoffset", _wrap_vlistInqVarAddoffset, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarTimave", _wrap_vlistDefVarTimave, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarTimave", _wrap_vlistInqVarTimave, -1);
+  rb_define_module_function(mCdiLib, "vlistDefVarTimaccu", _wrap_vlistDefVarTimaccu, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarTimaccu", _wrap_vlistInqVarTimaccu, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarSize", _wrap_vlistInqVarSize, -1);
+  rb_define_module_function(mCdiLib, "vlistInqVarID", _wrap_vlistInqVarID, -1);
+  rb_define_module_function(mCdiLib, "vlistDefIndex", _wrap_vlistDefIndex, -1);
+  rb_define_module_function(mCdiLib, "vlistInqIndex", _wrap_vlistInqIndex, -1);
+  rb_define_module_function(mCdiLib, "vlistDefFlag", _wrap_vlistDefFlag, -1);
+  rb_define_module_function(mCdiLib, "vlistInqFlag", _wrap_vlistInqFlag, -1);
+  rb_define_module_function(mCdiLib, "vlistFindVar", _wrap_vlistFindVar, -1);
+  rb_define_module_function(mCdiLib, "vlistFindLevel", _wrap_vlistFindLevel, -1);
+  rb_define_module_function(mCdiLib, "vlistMergedVar", _wrap_vlistMergedVar, -1);
+  rb_define_module_function(mCdiLib, "vlistMergedLevel", _wrap_vlistMergedLevel, -1);
+  rb_define_module_function(mCdiLib, "vlistInqNatts", _wrap_vlistInqNatts, -1);
+  rb_define_module_function(mCdiLib, "vlistInqAtt", _wrap_vlistInqAtt, -1);
+  rb_define_module_function(mCdiLib, "vlistDelAtt", _wrap_vlistDelAtt, -1);
+  rb_define_module_function(mCdiLib, "vlistDefAttInt", _wrap_vlistDefAttInt, -1);
+  rb_define_module_function(mCdiLib, "vlistDefAttFlt", _wrap_vlistDefAttFlt, -1);
+  rb_define_module_function(mCdiLib, "vlistDefAttTxt", _wrap_vlistDefAttTxt, -1);
+  rb_define_module_function(mCdiLib, "vlistInqAttInt", _wrap_vlistInqAttInt, -1);
+  rb_define_module_function(mCdiLib, "vlistInqAttFlt", _wrap_vlistInqAttFlt, -1);
+  rb_define_module_function(mCdiLib, "vlistInqAttTxt", _wrap_vlistInqAttTxt, -1);
+  rb_define_module_function(mCdiLib, "gridName", _wrap_gridName, -1);
+  rb_define_module_function(mCdiLib, "gridNamePtr", _wrap_gridNamePtr, -1);
+  rb_define_module_function(mCdiLib, "gridCompress", _wrap_gridCompress, -1);
+  rb_define_module_function(mCdiLib, "gridDefMask", _wrap_gridDefMask, -1);
+  rb_define_module_function(mCdiLib, "gridInqMask", _wrap_gridInqMask, -1);
+  rb_define_module_function(mCdiLib, "gridPrint", _wrap_gridPrint, -1);
+  rb_define_module_function(mCdiLib, "gridSize", _wrap_gridSize, -1);
+  rb_define_module_function(mCdiLib, "gridCreate", _wrap_gridCreate, -1);
+  rb_define_module_function(mCdiLib, "gridDestroy", _wrap_gridDestroy, -1);
+  rb_define_module_function(mCdiLib, "gridDuplicate", _wrap_gridDuplicate, -1);
+  rb_define_module_function(mCdiLib, "gridInqType", _wrap_gridInqType, -1);
+  rb_define_module_function(mCdiLib, "gridInqSize", _wrap_gridInqSize, -1);
+  rb_define_module_function(mCdiLib, "gridDefXsize", _wrap_gridDefXsize, -1);
+  rb_define_module_function(mCdiLib, "gridInqXsize", _wrap_gridInqXsize, -1);
+  rb_define_module_function(mCdiLib, "gridDefYsize", _wrap_gridDefYsize, -1);
+  rb_define_module_function(mCdiLib, "gridInqYsize", _wrap_gridInqYsize, -1);
+  rb_define_module_function(mCdiLib, "gridDefXvals", _wrap_gridDefXvals, -1);
+  rb_define_module_function(mCdiLib, "gridInqXvals", _wrap_gridInqXvals, -1);
+  rb_define_module_function(mCdiLib, "gridDefYvals", _wrap_gridDefYvals, -1);
+  rb_define_module_function(mCdiLib, "gridInqYvals", _wrap_gridInqYvals, -1);
+  rb_define_module_function(mCdiLib, "gridDefXname", _wrap_gridDefXname, -1);
+  rb_define_module_function(mCdiLib, "gridDefXlongname", _wrap_gridDefXlongname, -1);
+  rb_define_module_function(mCdiLib, "gridDefXunits", _wrap_gridDefXunits, -1);
+  rb_define_module_function(mCdiLib, "gridDefYname", _wrap_gridDefYname, -1);
+  rb_define_module_function(mCdiLib, "gridDefYlongname", _wrap_gridDefYlongname, -1);
+  rb_define_module_function(mCdiLib, "gridDefYunits", _wrap_gridDefYunits, -1);
+  rb_define_module_function(mCdiLib, "gridInqXname", _wrap_gridInqXname, -1);
+  rb_define_module_function(mCdiLib, "gridInqXlongname", _wrap_gridInqXlongname, -1);
+  rb_define_module_function(mCdiLib, "gridInqXstdname", _wrap_gridInqXstdname, -1);
+  rb_define_module_function(mCdiLib, "gridInqXunits", _wrap_gridInqXunits, -1);
+  rb_define_module_function(mCdiLib, "gridInqYname", _wrap_gridInqYname, -1);
+  rb_define_module_function(mCdiLib, "gridInqYlongname", _wrap_gridInqYlongname, -1);
+  rb_define_module_function(mCdiLib, "gridInqYstdname", _wrap_gridInqYstdname, -1);
+  rb_define_module_function(mCdiLib, "gridInqYunits", _wrap_gridInqYunits, -1);
+  rb_define_module_function(mCdiLib, "gridDefPrec", _wrap_gridDefPrec, -1);
+  rb_define_module_function(mCdiLib, "gridInqPrec", _wrap_gridInqPrec, -1);
+  rb_define_module_function(mCdiLib, "gridInqXval", _wrap_gridInqXval, -1);
+  rb_define_module_function(mCdiLib, "gridInqYval", _wrap_gridInqYval, -1);
+  rb_define_module_function(mCdiLib, "gridInqXinc", _wrap_gridInqXinc, -1);
+  rb_define_module_function(mCdiLib, "gridInqYinc", _wrap_gridInqYinc, -1);
+  rb_define_module_function(mCdiLib, "gridIsCircular", _wrap_gridIsCircular, -1);
+  rb_define_module_function(mCdiLib, "gridIsRotated", _wrap_gridIsRotated, -1);
+  rb_define_module_function(mCdiLib, "gridInqXpole", _wrap_gridInqXpole, -1);
+  rb_define_module_function(mCdiLib, "gridDefXpole", _wrap_gridDefXpole, -1);
+  rb_define_module_function(mCdiLib, "gridInqYpole", _wrap_gridInqYpole, -1);
+  rb_define_module_function(mCdiLib, "gridDefYpole", _wrap_gridDefYpole, -1);
+  rb_define_module_function(mCdiLib, "gridInqAngle", _wrap_gridInqAngle, -1);
+  rb_define_module_function(mCdiLib, "gridDefAngle", _wrap_gridDefAngle, -1);
+  rb_define_module_function(mCdiLib, "gridDefTrunc", _wrap_gridDefTrunc, -1);
+  rb_define_module_function(mCdiLib, "gridInqTrunc", _wrap_gridInqTrunc, -1);
+  rb_define_module_function(mCdiLib, "gridInqGMEnd", _wrap_gridInqGMEnd, -1);
+  rb_define_module_function(mCdiLib, "gridDefGMEnd", _wrap_gridDefGMEnd, -1);
+  rb_define_module_function(mCdiLib, "gridInqGMEni", _wrap_gridInqGMEni, -1);
+  rb_define_module_function(mCdiLib, "gridDefGMEni", _wrap_gridDefGMEni, -1);
+  rb_define_module_function(mCdiLib, "gridInqGMEni2", _wrap_gridInqGMEni2, -1);
+  rb_define_module_function(mCdiLib, "gridDefGMEni2", _wrap_gridDefGMEni2, -1);
+  rb_define_module_function(mCdiLib, "gridInqGMEni3", _wrap_gridInqGMEni3, -1);
+  rb_define_module_function(mCdiLib, "gridDefGMEni3", _wrap_gridDefGMEni3, -1);
+  rb_define_module_function(mCdiLib, "gridDefLCC", _wrap_gridDefLCC, -1);
+  rb_define_module_function(mCdiLib, "gridInqLCC", _wrap_gridInqLCC, -1);
+  rb_define_module_function(mCdiLib, "gridDefLcc2", _wrap_gridDefLcc2, -1);
+  rb_define_module_function(mCdiLib, "gridInqLcc2", _wrap_gridInqLcc2, -1);
+  rb_define_module_function(mCdiLib, "gridDefLaea", _wrap_gridDefLaea, -1);
+  rb_define_module_function(mCdiLib, "gridInqLaea", _wrap_gridInqLaea, -1);
+  rb_define_module_function(mCdiLib, "gridDefArea", _wrap_gridDefArea, -1);
+  rb_define_module_function(mCdiLib, "gridInqArea", _wrap_gridInqArea, -1);
+  rb_define_module_function(mCdiLib, "gridHasArea", _wrap_gridHasArea, -1);
+  rb_define_module_function(mCdiLib, "gridDefNvertex", _wrap_gridDefNvertex, -1);
+  rb_define_module_function(mCdiLib, "gridInqNvertex", _wrap_gridInqNvertex, -1);
+  rb_define_module_function(mCdiLib, "gridDefXbounds", _wrap_gridDefXbounds, -1);
+  rb_define_module_function(mCdiLib, "gridInqXbounds", _wrap_gridInqXbounds, -1);
+  rb_define_module_function(mCdiLib, "gridDefYbounds", _wrap_gridDefYbounds, -1);
+  rb_define_module_function(mCdiLib, "gridInqYbounds", _wrap_gridInqYbounds, -1);
+  rb_define_module_function(mCdiLib, "gridDefRowlon", _wrap_gridDefRowlon, -1);
+  rb_define_module_function(mCdiLib, "gridInqRowlon", _wrap_gridInqRowlon, -1);
+  rb_define_module_function(mCdiLib, "gridChangeType", _wrap_gridChangeType, -1);
+  rb_define_module_function(mCdiLib, "zaxisName", _wrap_zaxisName, -1);
+  rb_define_module_function(mCdiLib, "zaxisCreate", _wrap_zaxisCreate, -1);
+  rb_define_module_function(mCdiLib, "zaxisDestroy", _wrap_zaxisDestroy, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqType", _wrap_zaxisInqType, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqSize", _wrap_zaxisInqSize, -1);
+  rb_define_module_function(mCdiLib, "zaxisDuplicate", _wrap_zaxisDuplicate, -1);
+  rb_define_module_function(mCdiLib, "zaxisResize", _wrap_zaxisResize, -1);
+  rb_define_module_function(mCdiLib, "zaxisPrint", _wrap_zaxisPrint, -1);
+  rb_define_module_function(mCdiLib, "zaxisSize", _wrap_zaxisSize, -1);
+  rb_define_module_function(mCdiLib, "zaxisDefLevels", _wrap_zaxisDefLevels, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqLevels", _wrap_zaxisInqLevels, -1);
+  rb_define_module_function(mCdiLib, "zaxisDefLevel", _wrap_zaxisDefLevel, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqLevel", _wrap_zaxisInqLevel, -1);
+  rb_define_module_function(mCdiLib, "zaxisDefName", _wrap_zaxisDefName, -1);
+  rb_define_module_function(mCdiLib, "zaxisDefLongname", _wrap_zaxisDefLongname, -1);
+  rb_define_module_function(mCdiLib, "zaxisDefUnits", _wrap_zaxisDefUnits, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqName", _wrap_zaxisInqName, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqLongname", _wrap_zaxisInqLongname, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqUnits", _wrap_zaxisInqUnits, -1);
+  rb_define_module_function(mCdiLib, "zaxisDefPrec", _wrap_zaxisDefPrec, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqPrec", _wrap_zaxisInqPrec, -1);
+  rb_define_module_function(mCdiLib, "zaxisDefLtype", _wrap_zaxisDefLtype, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqLtype", _wrap_zaxisInqLtype, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqLevelsPtr", _wrap_zaxisInqLevelsPtr, -1);
+  rb_define_module_function(mCdiLib, "zaxisDefVct", _wrap_zaxisDefVct, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqVctSize", _wrap_zaxisInqVctSize, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqVctPtr", _wrap_zaxisInqVctPtr, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqLbounds", _wrap_zaxisInqLbounds, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqUbounds", _wrap_zaxisInqUbounds, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqWeights", _wrap_zaxisInqWeights, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqLbound", _wrap_zaxisInqLbound, -1);
+  rb_define_module_function(mCdiLib, "zaxisInqUbound", _wrap_zaxisInqUbound, -1);
+  rb_define_module_function(mCdiLib, "zaxisDefLbounds", _wrap_zaxisDefLbounds, -1);
+  rb_define_module_function(mCdiLib, "zaxisDefUbounds", _wrap_zaxisDefUbounds, -1);
+  rb_define_module_function(mCdiLib, "zaxisDefWeights", _wrap_zaxisDefWeights, -1);
+  rb_define_module_function(mCdiLib, "zaxisChangeType", _wrap_zaxisChangeType, -1);
+  rb_define_module_function(mCdiLib, "taxisCreate", _wrap_taxisCreate, -1);
+  rb_define_module_function(mCdiLib, "taxisDestroy", _wrap_taxisDestroy, -1);
+  rb_define_module_function(mCdiLib, "taxisDuplicate", _wrap_taxisDuplicate, -1);
+  rb_define_module_function(mCdiLib, "taxisCopyTimestep", _wrap_taxisCopyTimestep, -1);
+  rb_define_module_function(mCdiLib, "taxisDefType", _wrap_taxisDefType, -1);
+  rb_define_module_function(mCdiLib, "taxisDefVdate", _wrap_taxisDefVdate, -1);
+  rb_define_module_function(mCdiLib, "taxisDefVtime", _wrap_taxisDefVtime, -1);
+  rb_define_module_function(mCdiLib, "taxisDefRdate", _wrap_taxisDefRdate, -1);
+  rb_define_module_function(mCdiLib, "taxisDefRtime", _wrap_taxisDefRtime, -1);
+  rb_define_module_function(mCdiLib, "taxisHasBounds", _wrap_taxisHasBounds, -1);
+  rb_define_module_function(mCdiLib, "taxisDefVdateBounds", _wrap_taxisDefVdateBounds, -1);
+  rb_define_module_function(mCdiLib, "taxisDefVtimeBounds", _wrap_taxisDefVtimeBounds, -1);
+  rb_define_module_function(mCdiLib, "taxisInqVdateBounds", _wrap_taxisInqVdateBounds, -1);
+  rb_define_module_function(mCdiLib, "taxisInqVtimeBounds", _wrap_taxisInqVtimeBounds, -1);
+  rb_define_module_function(mCdiLib, "taxisDefCalendar", _wrap_taxisDefCalendar, -1);
+  rb_define_module_function(mCdiLib, "taxisDefTunit", _wrap_taxisDefTunit, -1);
+  rb_define_module_function(mCdiLib, "taxisDefNumavg", _wrap_taxisDefNumavg, -1);
+  rb_define_module_function(mCdiLib, "taxisInqType", _wrap_taxisInqType, -1);
+  rb_define_module_function(mCdiLib, "taxisInqVdate", _wrap_taxisInqVdate, -1);
+  rb_define_module_function(mCdiLib, "taxisInqVtime", _wrap_taxisInqVtime, -1);
+  rb_define_module_function(mCdiLib, "taxisInqRdate", _wrap_taxisInqRdate, -1);
+  rb_define_module_function(mCdiLib, "taxisInqRtime", _wrap_taxisInqRtime, -1);
+  rb_define_module_function(mCdiLib, "taxisInqCalendar", _wrap_taxisInqCalendar, -1);
+  rb_define_module_function(mCdiLib, "taxisInqTunit", _wrap_taxisInqTunit, -1);
+  rb_define_module_function(mCdiLib, "taxisInqNumavg", _wrap_taxisInqNumavg, -1);
+  rb_define_module_function(mCdiLib, "tunitNamePtr", _wrap_tunitNamePtr, -1);
+  rb_define_module_function(mCdiLib, "institutDef", _wrap_institutDef, -1);
+  rb_define_module_function(mCdiLib, "institutInq", _wrap_institutInq, -1);
+  rb_define_module_function(mCdiLib, "institutInqNumber", _wrap_institutInqNumber, -1);
+  rb_define_module_function(mCdiLib, "institutInqCenter", _wrap_institutInqCenter, -1);
+  rb_define_module_function(mCdiLib, "institutInqSubcenter", _wrap_institutInqSubcenter, -1);
+  rb_define_module_function(mCdiLib, "institutInqNamePtr", _wrap_institutInqNamePtr, -1);
+  rb_define_module_function(mCdiLib, "institutInqLongnamePtr", _wrap_institutInqLongnamePtr, -1);
+  rb_define_module_function(mCdiLib, "modelDef", _wrap_modelDef, -1);
+  rb_define_module_function(mCdiLib, "modelInq", _wrap_modelInq, -1);
+  rb_define_module_function(mCdiLib, "modelInqInstitut", _wrap_modelInqInstitut, -1);
+  rb_define_module_function(mCdiLib, "modelInqGribID", _wrap_modelInqGribID, -1);
+  rb_define_module_function(mCdiLib, "modelInqNamePtr", _wrap_modelInqNamePtr, -1);
+  rb_define_module_function(mCdiLib, "tableWriteC", _wrap_tableWriteC, -1);
+  rb_define_module_function(mCdiLib, "tableWrite", _wrap_tableWrite, -1);
+  rb_define_module_function(mCdiLib, "tableRead", _wrap_tableRead, -1);
+  rb_define_module_function(mCdiLib, "tableDef", _wrap_tableDef, -1);
+  rb_define_module_function(mCdiLib, "tableInqNamePtr", _wrap_tableInqNamePtr, -1);
+  rb_define_module_function(mCdiLib, "tableDefEntry", _wrap_tableDefEntry, -1);
+  rb_define_module_function(mCdiLib, "tableInq", _wrap_tableInq, -1);
+  rb_define_module_function(mCdiLib, "tableInqNumber", _wrap_tableInqNumber, -1);
+  rb_define_module_function(mCdiLib, "tableInqNum", _wrap_tableInqNum, -1);
+  rb_define_module_function(mCdiLib, "tableInqModel", _wrap_tableInqModel, -1);
+  rb_define_module_function(mCdiLib, "tableInqPar", _wrap_tableInqPar, -1);
+  rb_define_module_function(mCdiLib, "tableInqParCode", _wrap_tableInqParCode, -1);
+  rb_define_module_function(mCdiLib, "tableInqParName", _wrap_tableInqParName, -1);
+  rb_define_module_function(mCdiLib, "tableInqParLongname", _wrap_tableInqParLongname, -1);
+  rb_define_module_function(mCdiLib, "tableInqParUnits", _wrap_tableInqParUnits, -1);
+  rb_define_module_function(mCdiLib, "tableInqParNamePtr", _wrap_tableInqParNamePtr, -1);
+  rb_define_module_function(mCdiLib, "tableInqParLongnamePtr", _wrap_tableInqParLongnamePtr, -1);
+  rb_define_module_function(mCdiLib, "tableInqParUnitsPtr", _wrap_tableInqParUnitsPtr, -1);
+  rb_define_module_function(mCdiLib, "streamDefHistory", _wrap_streamDefHistory, -1);
+  rb_define_module_function(mCdiLib, "streamInqHistorySize", _wrap_streamInqHistorySize, -1);
+  rb_define_module_function(mCdiLib, "streamInqHistoryString", _wrap_streamInqHistoryString, -1);
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/interfaces/ruby/cdiobj_wrap.cpp b/libcdi/interfaces/ruby/cdiobj_wrap.cpp
new file mode 100644
index 0000000..6d6ac5f
--- /dev/null
+++ b/libcdi/interfaces/ruby/cdiobj_wrap.cpp
@@ -0,0 +1,33863 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 2.0.4
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGRUBY
+
+
+#ifdef __cplusplus
+/* SwigValueWrapper is described in swig.swg */
+template<typename T> class SwigValueWrapper {
+  struct SwigMovePointer {
+    T *ptr;
+    SwigMovePointer(T *p) : ptr(p) { }
+    ~SwigMovePointer() { delete ptr; }
+    SwigMovePointer& operator=(SwigMovePointer& rhs) { T* oldptr = ptr; ptr = 0; delete oldptr; ptr = rhs.ptr; rhs.ptr = 0; return *this; }
+  } pointer;
+  SwigValueWrapper& operator=(const SwigValueWrapper<T>& rhs);
+  SwigValueWrapper(const SwigValueWrapper<T>& rhs);
+public:
+  SwigValueWrapper() : pointer(0) { }
+  SwigValueWrapper& operator=(const T& t) { SwigMovePointer tmp(new T(t)); pointer = tmp; return *this; }
+  operator T&() const { return *pointer.ptr; }
+  T *operator&() { return pointer.ptr; }
+};
+
+template <typename T> T SwigValueInit() {
+  return T();
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif 
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif 
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * swigrun.swg
+ *
+ * This file contains generic C API SWIG runtime support for pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* This should only be incremented when either the layout of swig_type_info changes,
+   or for whatever reason, the runtime changes incompatibly */
+#define SWIG_RUNTIME_VERSION "4"
+
+/* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
+#ifdef SWIG_TYPE_TABLE
+# define SWIG_QUOTE_STRING(x) #x
+# define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
+# define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
+#else
+# define SWIG_TYPE_TABLE_NAME
+#endif
+
+/*
+  You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
+  creating a static or dynamic library from the SWIG runtime code.
+  In 99.9% of the cases, SWIG just needs to declare them as 'static'.
+  
+  But only do this if strictly necessary, ie, if you have problems
+  with your compiler or suchlike.
+*/
+
+#ifndef SWIGRUNTIME
+# define SWIGRUNTIME SWIGINTERN
+#endif
+
+#ifndef SWIGRUNTIMEINLINE
+# define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
+#endif
+
+/*  Generic buffer size */
+#ifndef SWIG_BUFFER_SIZE
+# define SWIG_BUFFER_SIZE 1024
+#endif
+
+/* Flags for pointer conversions */
+#define SWIG_POINTER_DISOWN        0x1
+#define SWIG_CAST_NEW_MEMORY       0x2
+
+/* Flags for new pointer objects */
+#define SWIG_POINTER_OWN           0x1
+
+
+/* 
+   Flags/methods for returning states.
+   
+   The SWIG conversion methods, as ConvertPtr, return an integer 
+   that tells if the conversion was successful or not. And if not,
+   an error code can be returned (see swigerrors.swg for the codes).
+   
+   Use the following macros/flags to set or process the returning
+   states.
+   
+   In old versions of SWIG, code such as the following was usually written:
+
+     if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
+       // success code
+     } else {
+       //fail code
+     }
+
+   Now you can be more explicit:
+
+    int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+    } else {
+      // fail code
+    }
+
+   which is the same really, but now you can also do
+
+    Type *ptr;
+    int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
+    if (SWIG_IsOK(res)) {
+      // success code
+      if (SWIG_IsNewObj(res) {
+        ...
+	delete *ptr;
+      } else {
+        ...
+      }
+    } else {
+      // fail code
+    }
+    
+   I.e., now SWIG_ConvertPtr can return new objects and you can
+   identify the case and take care of the deallocation. Of course that
+   also requires SWIG_ConvertPtr to return new result values, such as
+
+      int SWIG_ConvertPtr(obj, ptr,...) {         
+        if (<obj is ok>) {			       
+          if (<need new object>) {		       
+            *ptr = <ptr to new allocated object>; 
+            return SWIG_NEWOBJ;		       
+          } else {				       
+            *ptr = <ptr to old object>;	       
+            return SWIG_OLDOBJ;		       
+          } 				       
+        } else {				       
+          return SWIG_BADOBJ;		       
+        }					       
+      }
+
+   Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
+   more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
+   SWIG errors code.
+
+   Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
+   allows to return the 'cast rank', for example, if you have this
+
+       int food(double)
+       int fooi(int);
+
+   and you call
+ 
+      food(1)   // cast rank '1'  (1 -> 1.0)
+      fooi(1)   // cast rank '0'
+
+   just use the SWIG_AddCast()/SWIG_CheckState()
+*/
+
+#define SWIG_OK                    (0) 
+#define SWIG_ERROR                 (-1)
+#define SWIG_IsOK(r)               (r >= 0)
+#define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)  
+
+/* The CastRankLimit says how many bits are used for the cast rank */
+#define SWIG_CASTRANKLIMIT         (1 << 8)
+/* The NewMask denotes the object was created (using new/malloc) */
+#define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
+/* The TmpMask is for in/out typemaps that use temporal objects */
+#define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
+/* Simple returning values */
+#define SWIG_BADOBJ                (SWIG_ERROR)
+#define SWIG_OLDOBJ                (SWIG_OK)
+#define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
+#define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
+/* Check, add and del mask methods */
+#define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
+#define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
+#define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
+#define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
+#define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
+#define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
+
+/* Cast-Rank Mode */
+#if defined(SWIG_CASTRANK_MODE)
+#  ifndef SWIG_TypeRank
+#    define SWIG_TypeRank             unsigned long
+#  endif
+#  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
+#    define SWIG_MAXCASTRANK          (2)
+#  endif
+#  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
+#  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
+SWIGINTERNINLINE int SWIG_AddCast(int r) { 
+  return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
+}
+SWIGINTERNINLINE int SWIG_CheckState(int r) { 
+  return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; 
+}
+#else /* no cast-rank mode */
+#  define SWIG_AddCast
+#  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
+#endif
+
+
+#include <string.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef void *(*swig_converter_func)(void *, int *);
+typedef struct swig_type_info *(*swig_dycast_func)(void **);
+
+/* Structure to store information on one type */
+typedef struct swig_type_info {
+  const char             *name;			/* mangled name of this type */
+  const char             *str;			/* human readable name of this type */
+  swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
+  struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
+  void                   *clientdata;		/* language specific type data */
+  int                    owndata;		/* flag if the structure owns the clientdata */
+} swig_type_info;
+
+/* Structure to store a type and conversion function used for casting */
+typedef struct swig_cast_info {
+  swig_type_info         *type;			/* pointer to type that is equivalent to this type */
+  swig_converter_func     converter;		/* function to cast the void pointers */
+  struct swig_cast_info  *next;			/* pointer to next cast in linked list */
+  struct swig_cast_info  *prev;			/* pointer to the previous cast */
+} swig_cast_info;
+
+/* Structure used to store module information
+ * Each module generates one structure like this, and the runtime collects
+ * all of these structures and stores them in a circularly linked list.*/
+typedef struct swig_module_info {
+  swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
+  size_t                 size;		        /* Number of types in this module */
+  struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
+  swig_type_info         **type_initial;	/* Array of initially generated type structures */
+  swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
+  void                    *clientdata;		/* Language specific module data */
+} swig_module_info;
+
+/* 
+  Compare two type names skipping the space characters, therefore
+  "char*" == "char *" and "Class<int>" == "Class<int >", etc.
+
+  Return 0 when the two name types are equivalent, as in
+  strncmp, but skipping ' '.
+*/
+SWIGRUNTIME int
+SWIG_TypeNameComp(const char *f1, const char *l1,
+		  const char *f2, const char *l2) {
+  for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
+    while ((*f1 == ' ') && (f1 != l1)) ++f1;
+    while ((*f2 == ' ') && (f2 != l2)) ++f2;
+    if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
+  }
+  return (int)((l1 - f1) - (l2 - f2));
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if not equal, 1 if equal
+*/
+SWIGRUNTIME int
+SWIG_TypeEquiv(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+/*
+  Check type equivalence in a name list like <name1>|<name2>|...
+  Return 0 if equal, -1 if nb < tb, 1 if nb > tb
+*/
+SWIGRUNTIME int
+SWIG_TypeCompare(const char *nb, const char *tb) {
+  int equiv = 0;
+  const char* te = tb + strlen(tb);
+  const char* ne = nb;
+  while (!equiv && *ne) {
+    for (nb = ne; *ne; ++ne) {
+      if (*ne == '|') break;
+    }
+    equiv = (SWIG_TypeNameComp(nb, ne, tb, te) == 0) ? 1 : 0;
+    if (*ne) ++ne;
+  }
+  return equiv;
+}
+
+
+/*
+  Check the typename
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheck(const char *c, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (strcmp(iter->type->name, c) == 0) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
+}
+
+/* 
+  Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
+*/
+SWIGRUNTIME swig_cast_info *
+SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
+  if (ty) {
+    swig_cast_info *iter = ty->cast;
+    while (iter) {
+      if (iter->type == from) {
+        if (iter == ty->cast)
+          return iter;
+        /* Move iter to the top of the linked list */
+        iter->prev->next = iter->next;
+        if (iter->next)
+          iter->next->prev = iter->prev;
+        iter->next = ty->cast;
+        iter->prev = 0;
+        if (ty->cast) ty->cast->prev = iter;
+        ty->cast = iter;
+        return iter;
+      }
+      iter = iter->next;
+    }
+  }
+  return 0;
+}
+
+/*
+  Cast a pointer up an inheritance hierarchy
+*/
+SWIGRUNTIMEINLINE void *
+SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
+  return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
+}
+
+/* 
+   Dynamic pointer casting. Down an inheritance hierarchy
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
+  swig_type_info *lastty = ty;
+  if (!ty || !ty->dcast) return ty;
+  while (ty && (ty->dcast)) {
+    ty = (*ty->dcast)(ptr);
+    if (ty) lastty = ty;
+  }
+  return lastty;
+}
+
+/*
+  Return the name associated with this type
+*/
+SWIGRUNTIMEINLINE const char *
+SWIG_TypeName(const swig_type_info *ty) {
+  return ty->name;
+}
+
+/*
+  Return the pretty name associated with this type,
+  that is an unmangled type name in a form presentable to the user.
+*/
+SWIGRUNTIME const char *
+SWIG_TypePrettyName(const swig_type_info *type) {
+  /* The "str" field contains the equivalent pretty names of the
+     type, separated by vertical-bar characters.  We choose
+     to print the last name, as it is often (?) the most
+     specific. */
+  if (!type) return NULL;
+  if (type->str != NULL) {
+    const char *last_name = type->str;
+    const char *s;
+    for (s = type->str; *s; s++)
+      if (*s == '|') last_name = s+1;
+    return last_name;
+  }
+  else
+    return type->name;
+}
+
+/* 
+   Set the clientdata field for a type
+*/
+SWIGRUNTIME void
+SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
+  swig_cast_info *cast = ti->cast;
+  /* if (ti->clientdata == clientdata) return; */
+  ti->clientdata = clientdata;
+  
+  while (cast) {
+    if (!cast->converter) {
+      swig_type_info *tc = cast->type;
+      if (!tc->clientdata) {
+	SWIG_TypeClientData(tc, clientdata);
+      }
+    }    
+    cast = cast->next;
+  }
+}
+SWIGRUNTIME void
+SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
+  SWIG_TypeClientData(ti, clientdata);
+  ti->owndata = 1;
+}
+  
+/*
+  Search for a swig_type_info structure only by mangled name
+  Search is a O(log #types)
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_MangledTypeQueryModule(swig_module_info *start, 
+                            swig_module_info *end, 
+		            const char *name) {
+  swig_module_info *iter = start;
+  do {
+    if (iter->size) {
+      register size_t l = 0;
+      register size_t r = iter->size - 1;
+      do {
+	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
+	register size_t i = (l + r) >> 1; 
+	const char *iname = iter->types[i]->name;
+	if (iname) {
+	  register int compare = strcmp(name, iname);
+	  if (compare == 0) {	    
+	    return iter->types[i];
+	  } else if (compare < 0) {
+	    if (i) {
+	      r = i - 1;
+	    } else {
+	      break;
+	    }
+	  } else if (compare > 0) {
+	    l = i + 1;
+	  }
+	} else {
+	  break; /* should never happen */
+	}
+      } while (l <= r);
+    }
+    iter = iter->next;
+  } while (iter != end);
+  return 0;
+}
+
+/*
+  Search for a swig_type_info structure for either a mangled name or a human readable name.
+  It first searches the mangled names of the types, which is a O(log #types)
+  If a type is not found it then searches the human readable names, which is O(#types).
+  
+  We start searching at module start, and finish searching when start == end.  
+  Note: if start == end at the beginning of the function, we go all the way around
+  the circular list.
+*/
+SWIGRUNTIME swig_type_info *
+SWIG_TypeQueryModule(swig_module_info *start, 
+                     swig_module_info *end, 
+		     const char *name) {
+  /* STEP 1: Search the name field using binary search */
+  swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
+  if (ret) {
+    return ret;
+  } else {
+    /* STEP 2: If the type hasn't been found, do a complete search
+       of the str field (the human readable name) */
+    swig_module_info *iter = start;
+    do {
+      register size_t i = 0;
+      for (; i < iter->size; ++i) {
+	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
+	  return iter->types[i];
+      }
+      iter = iter->next;
+    } while (iter != end);
+  }
+  
+  /* neither found a match */
+  return 0;
+}
+
+/* 
+   Pack binary data into a string
+*/
+SWIGRUNTIME char *
+SWIG_PackData(char *c, void *ptr, size_t sz) {
+  static const char hex[17] = "0123456789abcdef";
+  register const unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu =  u + sz;
+  for (; u != eu; ++u) {
+    register unsigned char uu = *u;
+    *(c++) = hex[(uu & 0xf0) >> 4];
+    *(c++) = hex[uu & 0xf];
+  }
+  return c;
+}
+
+/* 
+   Unpack binary data from a string
+*/
+SWIGRUNTIME const char *
+SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
+  register unsigned char *u = (unsigned char *) ptr;
+  register const unsigned char *eu = u + sz;
+  for (; u != eu; ++u) {
+    register char d = *(c++);
+    register unsigned char uu;
+    if ((d >= '0') && (d <= '9'))
+      uu = ((d - '0') << 4);
+    else if ((d >= 'a') && (d <= 'f'))
+      uu = ((d - ('a'-10)) << 4);
+    else 
+      return (char *) 0;
+    d = *(c++);
+    if ((d >= '0') && (d <= '9'))
+      uu |= (d - '0');
+    else if ((d >= 'a') && (d <= 'f'))
+      uu |= (d - ('a'-10));
+    else 
+      return (char *) 0;
+    *u = uu;
+  }
+  return c;
+}
+
+/* 
+   Pack 'void *' into a string buffer.
+*/
+SWIGRUNTIME char *
+SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
+  char *r = buff;
+  if ((2*sizeof(void *) + 2) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,&ptr,sizeof(void *));
+  if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
+  strcpy(r,name);
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      *ptr = (void *) 0;
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sizeof(void *));
+}
+
+SWIGRUNTIME char *
+SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
+  char *r = buff;
+  size_t lname = (name ? strlen(name) : 0);
+  if ((2*sz + 2 + lname) > bsz) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r,ptr,sz);
+  if (lname) {
+    strncpy(r,name,lname+1);
+  } else {
+    *r = 0;
+  }
+  return buff;
+}
+
+SWIGRUNTIME const char *
+SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
+  if (*c != '_') {
+    if (strcmp(c,"NULL") == 0) {
+      memset(ptr,0,sz);
+      return name;
+    } else {
+      return 0;
+    }
+  }
+  return SWIG_UnpackData(++c,ptr,sz);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+/*  Errors in SWIG */
+#define  SWIG_UnknownError    	   -1 
+#define  SWIG_IOError        	   -2 
+#define  SWIG_RuntimeError   	   -3 
+#define  SWIG_IndexError     	   -4 
+#define  SWIG_TypeError      	   -5 
+#define  SWIG_DivisionByZero 	   -6 
+#define  SWIG_OverflowError  	   -7 
+#define  SWIG_SyntaxError    	   -8 
+#define  SWIG_ValueError     	   -9 
+#define  SWIG_SystemError    	   -10
+#define  SWIG_AttributeError 	   -11
+#define  SWIG_MemoryError    	   -12 
+#define  SWIG_NullReferenceError   -13
+
+
+
+#include <ruby.h>
+
+/* Ruby 1.9.1 has a "memoisation optimisation" when compiling with GCC which
+ * breaks using rb_intern as an lvalue, as SWIG does.  We work around this
+ * issue for now by disabling this.
+ * https://sourceforge.net/tracker/?func=detail&aid=2859614&group_id=1645&atid=101645
+ */
+#ifdef rb_intern
+# undef rb_intern
+#endif
+
+/* Remove global macros defined in Ruby's win32.h */
+#ifdef write
+# undef write
+#endif
+#ifdef read
+# undef read
+#endif
+#ifdef bind
+# undef bind
+#endif
+#ifdef close
+# undef close
+#endif
+#ifdef connect
+# undef connect
+#endif
+
+
+/* Ruby 1.7 defines NUM2LL(), LL2NUM() and ULL2NUM() macros */
+#ifndef NUM2LL
+#define NUM2LL(x) NUM2LONG((x))
+#endif
+#ifndef LL2NUM
+#define LL2NUM(x) INT2NUM((long) (x))
+#endif
+#ifndef ULL2NUM
+#define ULL2NUM(x) UINT2NUM((unsigned long) (x))
+#endif
+
+/* Ruby 1.7 doesn't (yet) define NUM2ULL() */
+#ifndef NUM2ULL
+#ifdef HAVE_LONG_LONG
+#define NUM2ULL(x) rb_num2ull((x))
+#else
+#define NUM2ULL(x) NUM2ULONG(x)
+#endif
+#endif
+
+/* RSTRING_LEN, etc are new in Ruby 1.9, but ->ptr and ->len no longer work */
+/* Define these for older versions so we can just write code the new way */
+#ifndef RSTRING_LEN
+# define RSTRING_LEN(x) RSTRING(x)->len
+#endif
+#ifndef RSTRING_PTR
+# define RSTRING_PTR(x) RSTRING(x)->ptr
+#endif
+#ifndef RSTRING_END
+# define RSTRING_END(x) (RSTRING_PTR(x) + RSTRING_LEN(x))
+#endif
+#ifndef RARRAY_LEN
+# define RARRAY_LEN(x) RARRAY(x)->len
+#endif
+#ifndef RARRAY_PTR
+# define RARRAY_PTR(x) RARRAY(x)->ptr
+#endif
+#ifndef RFLOAT_VALUE
+# define RFLOAT_VALUE(x) RFLOAT(x)->value
+#endif
+#ifndef DOUBLE2NUM
+# define DOUBLE2NUM(x) rb_float_new(x)
+#endif
+#ifndef RHASH_TBL
+# define RHASH_TBL(x) (RHASH(x)->tbl)
+#endif
+#ifndef RHASH_ITER_LEV
+# define RHASH_ITER_LEV(x) (RHASH(x)->iter_lev)
+#endif
+#ifndef RHASH_IFNONE
+# define RHASH_IFNONE(x) (RHASH(x)->ifnone)
+#endif
+#ifndef RHASH_SIZE
+# define RHASH_SIZE(x) (RHASH(x)->tbl->num_entries)
+#endif
+#ifndef RHASH_EMPTY_P
+# define RHASH_EMPTY_P(x) (RHASH_SIZE(x) == 0)
+#endif
+#ifndef RSTRUCT_LEN
+# define RSTRUCT_LEN(x) RSTRUCT(x)->len
+#endif
+#ifndef RSTRUCT_PTR
+# define RSTRUCT_PTR(x) RSTRUCT(x)->ptr
+#endif
+
+
+
+/*
+ * Need to be very careful about how these macros are defined, especially
+ * when compiling C++ code or C code with an ANSI C compiler.
+ *
+ * VALUEFUNC(f) is a macro used to typecast a C function that implements
+ * a Ruby method so that it can be passed as an argument to API functions
+ * like rb_define_method() and rb_define_singleton_method().
+ *
+ * VOIDFUNC(f) is a macro used to typecast a C function that implements
+ * either the "mark" or "free" stuff for a Ruby Data object, so that it
+ * can be passed as an argument to API functions like Data_Wrap_Struct()
+ * and Data_Make_Struct().
+ */
+ 
+#ifdef __cplusplus
+#  ifndef RUBY_METHOD_FUNC /* These definitions should work for Ruby 1.4.6 */
+#    define PROTECTFUNC(f) ((VALUE (*)()) f)
+#    define VALUEFUNC(f) ((VALUE (*)()) f)
+#    define VOIDFUNC(f)  ((void (*)()) f)
+#  else
+#    ifndef ANYARGS /* These definitions should work for Ruby 1.6 */
+#      define PROTECTFUNC(f) ((VALUE (*)()) f)
+#      define VALUEFUNC(f) ((VALUE (*)()) f)
+#      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
+#    else /* These definitions should work for Ruby 1.7+ */
+#      define PROTECTFUNC(f) ((VALUE (*)(VALUE)) f)
+#      define VALUEFUNC(f) ((VALUE (*)(ANYARGS)) f)
+#      define VOIDFUNC(f)  ((RUBY_DATA_FUNC) f)
+#    endif
+#  endif
+#else
+#  define VALUEFUNC(f) (f)
+#  define VOIDFUNC(f) (f)
+#endif
+
+/* Don't use for expressions have side effect */
+#ifndef RB_STRING_VALUE
+#define RB_STRING_VALUE(s) (TYPE(s) == T_STRING ? (s) : (*(volatile VALUE *)&(s) = rb_str_to_str(s)))
+#endif
+#ifndef StringValue
+#define StringValue(s) RB_STRING_VALUE(s)
+#endif
+#ifndef StringValuePtr
+#define StringValuePtr(s) RSTRING_PTR(RB_STRING_VALUE(s))
+#endif
+#ifndef StringValueLen
+#define StringValueLen(s) RSTRING_LEN(RB_STRING_VALUE(s))
+#endif
+#ifndef SafeStringValue
+#define SafeStringValue(v) do {\
+    StringValue(v);\
+    rb_check_safe_str(v);\
+} while (0)
+#endif
+
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+#define rb_define_alloc_func(klass, func) rb_define_singleton_method((klass), "new", VALUEFUNC((func)), -1)
+#define rb_undef_alloc_func(klass) rb_undef_method(CLASS_OF((klass)), "new")
+#endif
+
+static VALUE _mSWIG = Qnil;
+
+/* -----------------------------------------------------------------------------
+ * error manipulation
+ * ----------------------------------------------------------------------------- */
+
+
+/* Define some additional error types */
+#define SWIG_ObjectPreviouslyDeletedError  -100
+
+
+/* Define custom exceptions for errors that do not map to existing Ruby
+   exceptions.  Note this only works for C++ since a global cannot be
+   initialized by a function in C.  For C, fallback to rb_eRuntimeError.*/
+
+SWIGINTERN VALUE 
+getNullReferenceError(void) {
+  static int init = 0;
+  static VALUE rb_eNullReferenceError ;
+  if (!init) {
+    init = 1;
+    rb_eNullReferenceError = rb_define_class("NullReferenceError", rb_eRuntimeError);
+  }
+  return rb_eNullReferenceError;
+} 
+
+SWIGINTERN VALUE 
+getObjectPreviouslyDeletedError(void) {
+  static int init = 0;
+  static VALUE rb_eObjectPreviouslyDeleted ;
+  if (!init) {
+    init = 1;
+    rb_eObjectPreviouslyDeleted = rb_define_class("ObjectPreviouslyDeleted", rb_eRuntimeError);
+  }
+  return rb_eObjectPreviouslyDeleted;
+} 
+
+
+SWIGINTERN VALUE
+SWIG_Ruby_ErrorType(int SWIG_code) {
+  VALUE type;
+  switch (SWIG_code) {
+  case SWIG_MemoryError:
+    type = rb_eNoMemError;
+    break;
+  case SWIG_IOError:
+    type = rb_eIOError;
+    break;
+  case SWIG_RuntimeError:
+    type = rb_eRuntimeError;
+    break;
+  case SWIG_IndexError:
+    type = rb_eIndexError;
+    break;
+  case SWIG_TypeError:
+    type = rb_eTypeError;
+    break;
+  case SWIG_DivisionByZero:
+    type = rb_eZeroDivError;
+    break;
+  case SWIG_OverflowError:
+    type = rb_eRangeError;
+    break;
+  case SWIG_SyntaxError:
+    type = rb_eSyntaxError;
+    break;
+  case SWIG_ValueError:
+    type = rb_eArgError;
+    break;
+  case SWIG_SystemError:
+    type = rb_eFatal;
+    break;
+  case SWIG_AttributeError:
+    type = rb_eRuntimeError;
+    break;
+  case SWIG_NullReferenceError:
+    type = getNullReferenceError();
+    break;
+  case SWIG_ObjectPreviouslyDeletedError:
+    type = getObjectPreviouslyDeletedError();
+    break;
+  case SWIG_UnknownError:
+    type = rb_eRuntimeError;
+    break;
+  default:
+    type = rb_eRuntimeError;
+  }
+  return type;
+}
+
+
+/* This function is called when a user inputs a wrong argument to
+   a method.
+ */
+SWIGINTERN 
+const char* Ruby_Format_TypeError( const char* msg,
+				   const char* type, 
+				   const char* name, 
+				   const int argn,
+				   VALUE input )
+{
+  char buf[128];
+  VALUE str;
+  VALUE asStr;
+  if ( msg && *msg )
+    {
+      str = rb_str_new2(msg);
+    }
+  else
+    {
+      str = rb_str_new(NULL, 0);
+    }
+
+  str = rb_str_cat2( str, "Expected argument " );
+  sprintf( buf, "%d of type ", argn-1 );
+  str = rb_str_cat2( str, buf );
+  str = rb_str_cat2( str, type );
+  str = rb_str_cat2( str, ", but got " );
+  str = rb_str_cat2( str, rb_obj_classname(input) );
+  str = rb_str_cat2( str, " " );
+  asStr = rb_inspect(input);
+  if ( RSTRING_LEN(asStr) > 30 )
+    {
+      str = rb_str_cat( str, StringValuePtr(asStr), 30 );
+      str = rb_str_cat2( str, "..." );
+    }
+  else
+    {
+      str = rb_str_append( str, asStr );
+    }
+
+  if ( name )
+    {
+      str = rb_str_cat2( str, "\n\tin SWIG method '" );
+      str = rb_str_cat2( str, name );
+      str = rb_str_cat2( str, "'" );
+    }
+
+  return StringValuePtr( str );
+}
+
+/* This function is called when an overloaded method fails */
+SWIGINTERN 
+void Ruby_Format_OverloadedError(
+				 const int argc,
+				 const int maxargs,
+				 const char* method, 
+				 const char* prototypes 
+				 )
+{
+  const char* msg = "Wrong # of arguments";
+  if ( argc <= maxargs ) msg = "Wrong arguments";
+  rb_raise(rb_eArgError,"%s for overloaded method '%s'.\n"  
+	   "Possible C/C++ prototypes are:\n%s",
+	   msg, method, prototypes);
+}
+
+/* -----------------------------------------------------------------------------
+ * rubytracking.swg
+ *
+ * This file contains support for tracking mappings from 
+ * Ruby objects to C++ objects.  This functionality is needed
+ * to implement mark functions for Ruby's mark and sweep
+ * garbage collector.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/* Ruby 1.8 actually assumes the first case. */
+#if SIZEOF_VOIDP == SIZEOF_LONG
+#  define SWIG2NUM(v) LONG2NUM((unsigned long)v)
+#  define NUM2SWIG(x) (unsigned long)NUM2LONG(x)
+#elif SIZEOF_VOIDP == SIZEOF_LONG_LONG
+#  define SWIG2NUM(v) LL2NUM((unsigned long long)v)
+#  define NUM2SWIG(x) (unsigned long long)NUM2LL(x)
+#else
+#  error sizeof(void*) is not the same as long or long long
+#endif
+
+
+/* Global Ruby hash table to store Trackings from C/C++
+   structs to Ruby Objects. 
+*/
+static VALUE swig_ruby_trackings = Qnil;
+
+/* Global variable that stores a reference to the ruby
+   hash table delete function. */
+static ID swig_ruby_hash_delete;
+
+/* Setup a Ruby hash table to store Trackings */
+SWIGRUNTIME void SWIG_RubyInitializeTrackings(void) {
+  /* Create a ruby hash table to store Trackings from C++ 
+     objects to Ruby objects. */
+
+  /* Try to see if some other .so has already created a 
+     tracking hash table, which we keep hidden in an instance var
+     in the SWIG module.
+     This is done to allow multiple DSOs to share the same
+     tracking table.
+  */
+  ID trackings_id = rb_intern( "@__trackings__" );
+  VALUE verbose = rb_gv_get("VERBOSE");
+  rb_gv_set("VERBOSE", Qfalse);
+  swig_ruby_trackings = rb_ivar_get( _mSWIG, trackings_id );
+  rb_gv_set("VERBOSE", verbose);
+
+  /* No, it hasn't.  Create one ourselves */ 
+  if ( swig_ruby_trackings == Qnil )
+    {
+      swig_ruby_trackings = rb_hash_new();
+      rb_ivar_set( _mSWIG, trackings_id, swig_ruby_trackings );
+    }
+
+  /* Now store a reference to the hash table delete function
+     so that we only have to look it up once.*/
+  swig_ruby_hash_delete = rb_intern("delete");
+}
+
+/* Get a Ruby number to reference a pointer */
+SWIGRUNTIME VALUE SWIG_RubyPtrToReference(void* ptr) {
+  /* We cast the pointer to an unsigned long
+     and then store a reference to it using
+     a Ruby number object. */
+
+  /* Convert the pointer to a Ruby number */
+  return SWIG2NUM(ptr);
+}
+
+/* Get a Ruby number to reference an object */
+SWIGRUNTIME VALUE SWIG_RubyObjectToReference(VALUE object) {
+  /* We cast the object to an unsigned long
+     and then store a reference to it using
+     a Ruby number object. */
+
+  /* Convert the Object to a Ruby number */
+  return SWIG2NUM(object);
+}
+
+/* Get a Ruby object from a previously stored reference */
+SWIGRUNTIME VALUE SWIG_RubyReferenceToObject(VALUE reference) {
+  /* The provided Ruby number object is a reference
+     to the Ruby object we want.*/
+
+  /* Convert the Ruby number to a Ruby object */
+  return NUM2SWIG(reference);
+}
+
+/* Add a Tracking from a C/C++ struct to a Ruby object */
+SWIGRUNTIME void SWIG_RubyAddTracking(void* ptr, VALUE object) {
+  /* In a Ruby hash table we store the pointer and
+     the associated Ruby object.  The trick here is
+     that we cannot store the Ruby object directly - if
+     we do then it cannot be garbage collected.  So
+     instead we typecast it as a unsigned long and
+     convert it to a Ruby number object.*/
+
+  /* Get a reference to the pointer as a Ruby number */
+  VALUE key = SWIG_RubyPtrToReference(ptr);
+
+  /* Get a reference to the Ruby object as a Ruby number */
+  VALUE value = SWIG_RubyObjectToReference(object);
+
+  /* Store the mapping to the global hash table. */
+  rb_hash_aset(swig_ruby_trackings, key, value);
+}
+
+/* Get the Ruby object that owns the specified C/C++ struct */
+SWIGRUNTIME VALUE SWIG_RubyInstanceFor(void* ptr) {
+  /* Get a reference to the pointer as a Ruby number */
+  VALUE key = SWIG_RubyPtrToReference(ptr);
+
+  /* Now lookup the value stored in the global hash table */
+  VALUE value = rb_hash_aref(swig_ruby_trackings, key);
+	
+  if (value == Qnil) {
+    /* No object exists - return nil. */
+    return Qnil;
+  }
+  else {
+    /* Convert this value to Ruby object */
+    return SWIG_RubyReferenceToObject(value);
+  }
+}
+
+/* Remove a Tracking from a C/C++ struct to a Ruby object.  It
+   is very important to remove objects once they are destroyed
+   since the same memory address may be reused later to create
+   a new object. */
+SWIGRUNTIME void SWIG_RubyRemoveTracking(void* ptr) {
+  /* Get a reference to the pointer as a Ruby number */
+  VALUE key = SWIG_RubyPtrToReference(ptr);
+
+  /* Delete the object from the hash table by calling Ruby's
+     do this we need to call the Hash.delete method.*/
+  rb_funcall(swig_ruby_trackings, swig_ruby_hash_delete, 1, key);
+}
+
+/* This is a helper method that unlinks a Ruby object from its
+   underlying C++ object.  This is needed if the lifetime of the
+   Ruby object is longer than the C++ object */
+SWIGRUNTIME void SWIG_RubyUnlinkObjects(void* ptr) {
+  VALUE object = SWIG_RubyInstanceFor(ptr);
+
+  if (object != Qnil) {
+    DATA_PTR(object) = 0;
+  }
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
+/* -----------------------------------------------------------------------------
+ * Ruby API portion that goes into the runtime
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGINTERN VALUE
+SWIG_Ruby_AppendOutput(VALUE target, VALUE o) {
+  if (NIL_P(target)) {
+    target = o;
+  } else {
+    if (TYPE(target) != T_ARRAY) {
+      VALUE o2 = target;
+      target = rb_ary_new();
+      rb_ary_push(target, o2);
+    }
+    rb_ary_push(target, o);
+  }
+  return target;
+}
+
+/* For ruby1.8.4 and earlier. */
+#ifndef RUBY_INIT_STACK
+   RUBY_EXTERN void Init_stack(VALUE* addr);
+#  define RUBY_INIT_STACK \
+   VALUE variable_in_this_stack_frame; \
+   Init_stack(&variable_in_this_stack_frame);
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+/* -----------------------------------------------------------------------------
+ * rubyrun.swg
+ *
+ * This file contains the runtime support for Ruby modules
+ * and includes code for managing global variables and pointer
+ * type checking.
+ * ----------------------------------------------------------------------------- */
+
+/* For backward compatibility only */
+#define SWIG_POINTER_EXCEPTION  0
+
+/* for raw pointers */
+#define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
+#define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Ruby_ConvertPtrAndOwn(obj, pptr, type, flags, own)
+#define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Ruby_NewPointerObj(ptr, type, flags)
+#define SWIG_AcquirePtr(ptr, own)                       SWIG_Ruby_AcquirePtr(ptr, own)
+#define swig_owntype                                    ruby_owntype
+
+/* for raw packed data */
+#define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty, flags)
+#define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Ruby_NewPackedObj(ptr, sz, type)
+
+/* for class or struct pointers */
+#define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
+#define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
+
+/* for C or C++ function pointers */
+#define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_ConvertPtr(obj, pptr, type, 0)
+#define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_NewPointerObj(ptr, type, 0)
+
+/* for C++ member pointers, ie, member methods */
+#define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Ruby_ConvertPacked(obj, ptr, sz, ty)
+#define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Ruby_NewPackedObj(ptr, sz, type)
+
+
+/* Runtime API */
+
+#define SWIG_GetModule(clientdata)                      SWIG_Ruby_GetModule()	
+#define SWIG_SetModule(clientdata, pointer) 		SWIG_Ruby_SetModule(pointer)
+
+
+/* Error manipulation */
+
+#define SWIG_ErrorType(code)                            SWIG_Ruby_ErrorType(code)               
+#define SWIG_Error(code, msg)            		rb_raise(SWIG_Ruby_ErrorType(code), "%s", msg)
+#define SWIG_fail                        		goto fail				 
+
+
+/* Ruby-specific SWIG API */
+
+#define SWIG_InitRuntime()                              SWIG_Ruby_InitRuntime()              
+#define SWIG_define_class(ty)                        	SWIG_Ruby_define_class(ty)
+#define SWIG_NewClassInstance(value, ty)             	SWIG_Ruby_NewClassInstance(value, ty)
+#define SWIG_MangleStr(value)                        	SWIG_Ruby_MangleStr(value)		  
+#define SWIG_CheckConvert(value, ty)                 	SWIG_Ruby_CheckConvert(value, ty)	  
+
+#include "assert.h"
+
+/* -----------------------------------------------------------------------------
+ * pointers/data manipulation
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct {
+  VALUE klass;
+  VALUE mImpl;
+  void  (*mark)(void *);
+  void  (*destroy)(void *);
+  int trackObjects;
+} swig_class;
+
+
+/* Global pointer used to keep some internal SWIG stuff */
+static VALUE _cSWIG_Pointer = Qnil;
+static VALUE swig_runtime_data_type_pointer = Qnil;
+
+/* Global IDs used to keep some internal SWIG stuff */
+static ID swig_arity_id = 0;
+static ID swig_call_id  = 0;
+
+/*
+  If your swig extension is to be run within an embedded ruby and has
+  director callbacks, you should set -DRUBY_EMBEDDED during compilation.  
+  This will reset ruby's stack frame on each entry point from the main 
+  program the first time a virtual director function is invoked (in a 
+  non-recursive way).
+  If this is not done, you run the risk of Ruby trashing the stack.
+*/
+
+#ifdef RUBY_EMBEDDED
+
+#  define SWIG_INIT_STACK                            \
+      if ( !swig_virtual_calls ) { RUBY_INIT_STACK } \
+      ++swig_virtual_calls;
+#  define SWIG_RELEASE_STACK --swig_virtual_calls;
+#  define Ruby_DirectorTypeMismatchException(x) \
+          rb_raise( rb_eTypeError, "%s", x ); return c_result;
+
+      static unsigned int swig_virtual_calls = 0;
+
+#else  /* normal non-embedded extension */
+
+#  define SWIG_INIT_STACK
+#  define SWIG_RELEASE_STACK
+#  define Ruby_DirectorTypeMismatchException(x) \
+          throw Swig::DirectorTypeMismatchException( x );
+
+#endif  /* RUBY_EMBEDDED */
+
+
+SWIGRUNTIME VALUE 
+getExceptionClass(void) {
+  static int init = 0;
+  static VALUE rubyExceptionClass ;
+  if (!init) {
+    init = 1;
+    rubyExceptionClass = rb_const_get(_mSWIG, rb_intern("Exception"));
+  }
+  return rubyExceptionClass;
+} 
+
+/* This code checks to see if the Ruby object being raised as part
+   of an exception inherits from the Ruby class Exception.  If so,
+   the object is simply returned.  If not, then a new Ruby exception
+   object is created and that will be returned to Ruby.*/
+SWIGRUNTIME VALUE
+SWIG_Ruby_ExceptionType(swig_type_info *desc, VALUE obj) {
+  VALUE exceptionClass = getExceptionClass();
+  if (rb_obj_is_kind_of(obj, exceptionClass)) {
+    return obj;
+  }  else {
+    return rb_exc_new3(rb_eRuntimeError, rb_obj_as_string(obj));
+  }
+}
+
+/* Initialize Ruby runtime support */
+SWIGRUNTIME void
+SWIG_Ruby_InitRuntime(void)
+{
+  if (_mSWIG == Qnil) {
+    _mSWIG = rb_define_module("SWIG");
+    swig_call_id  = rb_intern("call");
+    swig_arity_id = rb_intern("arity");
+  }
+}
+
+/* Define Ruby class for C type */
+SWIGRUNTIME void
+SWIG_Ruby_define_class(swig_type_info *type)
+{
+  VALUE klass;
+  char *klass_name = (char *) malloc(4 + strlen(type->name) + 1);
+  sprintf(klass_name, "TYPE%s", type->name);
+  if (NIL_P(_cSWIG_Pointer)) {
+    _cSWIG_Pointer = rb_define_class_under(_mSWIG, "Pointer", rb_cObject);
+    rb_undef_method(CLASS_OF(_cSWIG_Pointer), "new");
+  }
+  klass = rb_define_class_under(_mSWIG, klass_name, _cSWIG_Pointer);
+  free((void *) klass_name);
+}
+
+/* Create a new pointer object */
+SWIGRUNTIME VALUE
+SWIG_Ruby_NewPointerObj(void *ptr, swig_type_info *type, int flags)
+{
+  int own =  flags & SWIG_POINTER_OWN; 
+  int track;
+  char *klass_name;
+  swig_class *sklass;
+  VALUE klass;
+  VALUE obj;
+  
+  if (!ptr)
+    return Qnil;
+  
+  if (type->clientdata) {
+    sklass = (swig_class *) type->clientdata;
+		
+    /* Are we tracking this class and have we already returned this Ruby object? */
+    track = sklass->trackObjects;
+    if (track) {
+      obj = SWIG_RubyInstanceFor(ptr);
+      
+      /* Check the object's type and make sure it has the correct type.
+        It might not in cases where methods do things like 
+        downcast methods. */
+      if (obj != Qnil) {
+        VALUE value = rb_iv_get(obj, "@__swigtype__");
+        char* type_name = RSTRING_PTR(value);
+				
+        if (strcmp(type->name, type_name) == 0) {
+          return obj;
+        }
+      }
+    }
+
+    /* Create a new Ruby object */
+    obj = Data_Wrap_Struct(sklass->klass, VOIDFUNC(sklass->mark), 
+			   ( own ? VOIDFUNC(sklass->destroy) : 
+			     (track ? VOIDFUNC(SWIG_RubyRemoveTracking) : 0 )
+			     ), ptr);
+
+    /* If tracking is on for this class then track this object. */
+    if (track) {
+      SWIG_RubyAddTracking(ptr, obj);
+    }
+  } else {
+    klass_name = (char *) malloc(4 + strlen(type->name) + 1);
+    sprintf(klass_name, "TYPE%s", type->name);
+    klass = rb_const_get(_mSWIG, rb_intern(klass_name));
+    free((void *) klass_name);
+    obj = Data_Wrap_Struct(klass, 0, 0, ptr);
+  }
+  rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
+  
+  return obj;
+}
+
+/* Create a new class instance (always owned) */
+SWIGRUNTIME VALUE
+SWIG_Ruby_NewClassInstance(VALUE klass, swig_type_info *type)
+{
+  VALUE obj;
+  swig_class *sklass = (swig_class *) type->clientdata;
+  obj = Data_Wrap_Struct(klass, VOIDFUNC(sklass->mark), VOIDFUNC(sklass->destroy), 0);
+  rb_iv_set(obj, "@__swigtype__", rb_str_new2(type->name));
+  return obj;
+}
+
+/* Get type mangle from class name */
+SWIGRUNTIMEINLINE char *
+SWIG_Ruby_MangleStr(VALUE obj)
+{
+  VALUE stype = rb_iv_get(obj, "@__swigtype__");
+  return StringValuePtr(stype);
+}
+
+/* Acquire a pointer value */
+typedef void (*ruby_owntype)(void*);
+
+SWIGRUNTIME ruby_owntype
+SWIG_Ruby_AcquirePtr(VALUE obj, ruby_owntype own) {
+  if (obj) {
+    ruby_owntype oldown = RDATA(obj)->dfree;
+    RDATA(obj)->dfree = own;
+    return oldown;
+  } else {
+    return 0;
+  }
+}
+
+/* Convert a pointer value */
+SWIGRUNTIME int
+SWIG_Ruby_ConvertPtrAndOwn(VALUE obj, void **ptr, swig_type_info *ty, int flags, ruby_owntype *own)
+{
+  char *c;
+  swig_cast_info *tc;
+  void *vptr = 0;
+
+  /* Grab the pointer */
+  if (NIL_P(obj)) {
+    *ptr = 0;
+    return SWIG_OK;
+  } else {
+    if (TYPE(obj) != T_DATA) {
+      return SWIG_ERROR;
+    }
+    Data_Get_Struct(obj, void, vptr);
+  }
+  
+  if (own) *own = RDATA(obj)->dfree;
+    
+  /* Check to see if the input object is giving up ownership
+     of the underlying C struct or C++ object.  If so then we
+     need to reset the destructor since the Ruby object no 
+     longer owns the underlying C++ object.*/ 
+  if (flags & SWIG_POINTER_DISOWN) {
+    /* Is tracking on for this class? */
+    int track = 0;
+    if (ty && ty->clientdata) {
+      swig_class *sklass = (swig_class *) ty->clientdata;
+      track = sklass->trackObjects;
+    }
+		
+    if (track) {
+      /* We are tracking objects for this class.  Thus we change the destructor
+       * to SWIG_RubyRemoveTracking.  This allows us to
+       * remove the mapping from the C++ to Ruby object
+       * when the Ruby object is garbage collected.  If we don't
+       * do this, then it is possible we will return a reference 
+       * to a Ruby object that no longer exists thereby crashing Ruby. */
+      RDATA(obj)->dfree = SWIG_RubyRemoveTracking;
+    } else {    
+      RDATA(obj)->dfree = 0;
+    }
+  }
+
+  /* Do type-checking if type info was provided */
+  if (ty) {
+    if (ty->clientdata) {
+      if (rb_obj_is_kind_of(obj, ((swig_class *) (ty->clientdata))->klass)) {
+        if (vptr == 0) {
+          /* The object has already been deleted */
+          return SWIG_ObjectPreviouslyDeletedError;
+        }
+        *ptr = vptr;
+        return SWIG_OK;
+      }
+    }
+    if ((c = SWIG_MangleStr(obj)) == NULL) {
+      return SWIG_ERROR;
+    }
+    tc = SWIG_TypeCheck(c, ty);
+    if (!tc) {
+      return SWIG_ERROR;
+    } else {
+      int newmemory = 0;
+      *ptr = SWIG_TypeCast(tc, vptr, &newmemory);
+      assert(!newmemory); /* newmemory handling not yet implemented */
+    }
+  } else {
+    *ptr = vptr;
+  }
+  
+  return SWIG_OK;
+}
+
+/* Check convert */
+SWIGRUNTIMEINLINE int
+SWIG_Ruby_CheckConvert(VALUE obj, swig_type_info *ty)
+{
+  char *c = SWIG_MangleStr(obj);
+  if (!c) return 0;
+  return SWIG_TypeCheck(c,ty) != 0;
+}
+
+SWIGRUNTIME VALUE
+SWIG_Ruby_NewPackedObj(void *ptr, int sz, swig_type_info *type) {
+  char result[1024];
+  char *r = result;
+  if ((2*sz + 1 + strlen(type->name)) > 1000) return 0;
+  *(r++) = '_';
+  r = SWIG_PackData(r, ptr, sz);
+  strcpy(r, type->name);
+  return rb_str_new2(result);
+}
+
+/* Convert a packed value value */
+SWIGRUNTIME int
+SWIG_Ruby_ConvertPacked(VALUE obj, void *ptr, int sz, swig_type_info *ty) {
+  swig_cast_info *tc;
+  const char  *c;
+
+  if (TYPE(obj) != T_STRING) goto type_error;
+  c = StringValuePtr(obj);
+  /* Pointer values must start with leading underscore */
+  if (*c != '_') goto type_error;
+  c++;
+  c = SWIG_UnpackData(c, ptr, sz);
+  if (ty) {
+    tc = SWIG_TypeCheck(c, ty);
+    if (!tc) goto type_error;
+  }
+  return SWIG_OK;
+
+ type_error:
+  return SWIG_ERROR;
+}
+
+SWIGRUNTIME swig_module_info *
+SWIG_Ruby_GetModule(void)
+{
+  VALUE pointer;
+  swig_module_info *ret = 0;
+  VALUE verbose = rb_gv_get("VERBOSE");
+
+ /* temporarily disable warnings, since the pointer check causes warnings with 'ruby -w' */
+  rb_gv_set("VERBOSE", Qfalse);
+  
+  /* first check if pointer already created */
+  pointer = rb_gv_get("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME);
+  if (pointer != Qnil) {
+    Data_Get_Struct(pointer, swig_module_info, ret);
+  }
+
+  /* reinstate warnings */
+  rb_gv_set("VERBOSE", verbose);
+  return ret;
+}
+
+SWIGRUNTIME void 
+SWIG_Ruby_SetModule(swig_module_info *pointer)
+{
+  /* register a new class */
+  VALUE cl = rb_define_class("swig_runtime_data", rb_cObject);
+  /* create and store the structure pointer to a global variable */
+  swig_runtime_data_type_pointer = Data_Wrap_Struct(cl, 0, 0, pointer);
+  rb_define_readonly_variable("$swig_runtime_data_type_pointer" SWIG_RUNTIME_VERSION SWIG_TYPE_TABLE_NAME, &swig_runtime_data_type_pointer);
+}
+
+/* This function can be used to check whether a proc or method or similarly
+   callable function has been passed.  Usually used in a %typecheck, like:
+
+   %typecheck(c_callback_t, precedence=SWIG_TYPECHECK_POINTER) {
+        $result = SWIG_Ruby_isCallable( $input );
+   }
+ */
+SWIGINTERN
+int SWIG_Ruby_isCallable( VALUE proc )
+{
+  if ( rb_respond_to( proc, swig_call_id ) == Qtrue )
+    return 1;
+  return 0;
+}
+
+/* This function can be used to check the arity (number of arguments)
+   a proc or method can take.  Usually used in a %typecheck.
+   Valid arities will be that equal to minimal or those < 0
+   which indicate a variable number of parameters at the end.
+ */
+SWIGINTERN
+int SWIG_Ruby_arity( VALUE proc, int minimal )
+{
+  if ( rb_respond_to( proc, swig_arity_id ) == Qtrue )
+    {
+      VALUE num = rb_funcall( proc, swig_arity_id, 0 );
+      int arity = NUM2INT(num);
+      if ( arity < 0 && (arity+1) < -minimal ) return 1;
+      if ( arity == minimal ) return 1;
+      return 1;
+    }
+  return 0;
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
+
+
+#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) 
+
+#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else 
+
+
+
+  #define SWIG_exception(code, msg) do { SWIG_Error(code, msg);; } while(0) 
+
+
+/* -------- TYPES TABLE (BEGIN) -------- */
+
+#define SWIGTYPE_p_Cdi swig_types[0]
+#define SWIGTYPE_p_CdiGrid swig_types[1]
+#define SWIGTYPE_p_CdiTaxis swig_types[2]
+#define SWIGTYPE_p_CdiVariable swig_types[3]
+#define SWIGTYPE_p_CdiZaxis swig_types[4]
+#define SWIGTYPE_p_allocator_type swig_types[5]
+#define SWIGTYPE_p_char swig_types[6]
+#define SWIGTYPE_p_difference_type swig_types[7]
+#define SWIGTYPE_p_double swig_types[8]
+#define SWIGTYPE_p_float swig_types[9]
+#define SWIGTYPE_p_key_type swig_types[10]
+#define SWIGTYPE_p_mapped_type swig_types[11]
+#define SWIGTYPE_p_p_double swig_types[12]
+#define SWIGTYPE_p_p_void swig_types[13]
+#define SWIGTYPE_p_size_type swig_types[14]
+#define SWIGTYPE_p_std__allocatorT_CdiVariable_t swig_types[15]
+#define SWIGTYPE_p_std__allocatorT_double_t swig_types[16]
+#define SWIGTYPE_p_std__allocatorT_int_t swig_types[17]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t swig_types[18]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t swig_types[19]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t swig_types[20]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t swig_types[21]
+#define SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t swig_types[22]
+#define SWIGTYPE_p_std__allocatorT_std__string_t swig_types[23]
+#define SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t swig_types[24]
+#define SWIGTYPE_p_std__lessT_int_t swig_types[25]
+#define SWIGTYPE_p_std__lessT_std__string_t swig_types[26]
+#define SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t swig_types[27]
+#define SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator swig_types[28]
+#define SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__reverse_iterator swig_types[29]
+#define SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t swig_types[30]
+#define SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator swig_types[31]
+#define SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__reverse_iterator swig_types[32]
+#define SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t swig_types[33]
+#define SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator swig_types[34]
+#define SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__reverse_iterator swig_types[35]
+#define SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t swig_types[36]
+#define SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator swig_types[37]
+#define SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__reverse_iterator swig_types[38]
+#define SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t swig_types[39]
+#define SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator swig_types[40]
+#define SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__reverse_iterator swig_types[41]
+#define SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t swig_types[42]
+#define SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t swig_types[43]
+#define SWIGTYPE_p_std__vectorT_float_std__allocatorT_float_t_t swig_types[44]
+#define SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t swig_types[45]
+#define SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t swig_types[46]
+#define SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t swig_types[47]
+#define SWIGTYPE_p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t swig_types[48]
+#define SWIGTYPE_p_swig__ConstIterator swig_types[49]
+#define SWIGTYPE_p_swig__GC_VALUE swig_types[50]
+#define SWIGTYPE_p_swig__Iterator swig_types[51]
+#define SWIGTYPE_p_value_type swig_types[52]
+#define SWIGTYPE_p_void swig_types[53]
+static swig_type_info *swig_types[55];
+static swig_module_info swig_module = {swig_types, 54, 0, 0, 0, 0};
+#define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
+#define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
+
+/* -------- TYPES TABLE (END) -------- */
+
+#define SWIG_init    Init_CdiObj
+#define SWIG_name    "CdiObj"
+
+static VALUE mCdiObj;
+
+#define SWIG_RUBY_THREAD_BEGIN_BLOCK
+#define SWIG_RUBY_THREAD_END_BLOCK
+
+
+#define SWIGVERSION 0x020004 
+#define SWIG_VERSION SWIGVERSION
+
+
+#define SWIG_as_voidptr(a) const_cast< void * >(static_cast< const void * >(a)) 
+#define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),reinterpret_cast< void** >(a)) 
+
+
+#include <stdexcept>
+
+
+#define SWIG_FILE_WITH_INIT
+#include "cdi.hpp"
+
+
+#include <stdexcept>
+
+
+namespace swig {
+  class GC_VALUE {
+  protected:
+    // Hash of all GC_VALUE's currently in use
+    static VALUE _hash;
+
+    VALUE  _obj;
+
+    static ID hash_id;
+    static ID   lt_id;
+    static ID   gt_id;
+    static ID   eq_id;
+    static ID   le_id;
+    static ID   ge_id;
+
+    static ID  pos_id;
+    static ID  neg_id;
+    static ID  inv_id;
+
+    static ID  add_id;
+    static ID  sub_id;
+    static ID  mul_id;
+    static ID  div_id;
+    static ID  mod_id;
+
+    static ID  and_id;
+    static ID   or_id;
+    static ID  xor_id;
+
+    static ID  lshift_id;
+    static ID  rshift_id;
+
+    struct OpArgs
+    {
+      VALUE src;
+      ID    id;
+      int   nargs;
+      VALUE target;
+    };
+
+
+  public:
+    static void initialize()
+    {
+      if ( _hash == Qnil ) 
+	{ 
+	  _hash = rb_hash_new();
+	  rb_gc_register_address( &_hash );
+	}
+    }
+
+    // this function is never called.  Provided for symmetry only.
+    static void cleanup()
+    {
+      rb_gc_unregister_address( &_hash );
+    }
+
+    GC_VALUE() : _obj( Qnil )
+    {
+    }
+
+    GC_VALUE(const GC_VALUE& item) : _obj(item._obj)
+    {
+      GC_register();
+    }
+    
+    GC_VALUE(VALUE obj) :_obj(obj)
+    {
+      GC_register();
+    }
+    
+    ~GC_VALUE() 
+    {
+      GC_unregister();
+    }
+    
+    GC_VALUE & operator=(const GC_VALUE& item) 
+    {
+      GC_unregister();
+      _obj = item._obj;
+      GC_register();
+      return *this;
+    }
+
+    void GC_register()
+    {
+      if ( FIXNUM_P(_obj) || SPECIAL_CONST_P(_obj) || SYMBOL_P(_obj) ) 
+	return;
+      VALUE val = rb_hash_aref( _hash, _obj );
+      unsigned n = FIXNUM_P(val) ? NUM2UINT(val) : 0;
+      ++n;
+      rb_hash_aset( _hash, _obj, INT2NUM(n) );
+    }
+
+    void GC_unregister()
+    {
+      if ( FIXNUM_P(_obj) || SPECIAL_CONST_P(_obj) || SYMBOL_P(_obj) ) 
+	return;
+      // this test should not be needed but I've noticed some very erratic
+      // behavior of none being unregistered in some very rare situations.
+      if ( BUILTIN_TYPE(_obj) == T_NONE ) return;
+
+      VALUE val = rb_hash_aref( _hash, _obj );
+      unsigned n = FIXNUM_P(val) ? NUM2UINT(val) : 1;
+      --n;
+      if ( n )
+	rb_hash_aset( _hash, _obj, INT2NUM(n) );
+      else
+	rb_hash_delete( _hash, _obj );
+    }
+    
+    operator VALUE() const
+    {
+      return _obj;
+    }
+
+    VALUE inspect() const
+    {
+      return rb_inspect(_obj);
+    }
+
+    VALUE to_s() const
+    {
+      return rb_inspect(_obj);
+    }
+
+    static VALUE swig_protect_funcall( VALUE p )
+    {
+      OpArgs* args = (OpArgs*) p;
+      return rb_funcall( args->src, args->id, args->nargs, args->target );
+    }
+
+
+#define GC_VALUE_CMP( op_id, op, cmp, cmpval ) \
+    bool op( const GC_VALUE& other ) const \
+    { \
+      if ( FIXNUM_P(_obj) && FIXNUM_P(other._obj) ) \
+      { \
+	return _obj cmp other._obj; \
+      } \
+      bool  res = false; \
+      VALUE ret = Qnil; \
+      SWIG_RUBY_THREAD_BEGIN_BLOCK; \
+      if ( rb_respond_to( _obj, op_id ) == Qtrue ) \
+	{ \
+	  int status; \
+	  OpArgs  args; \
+          args.src    = _obj; \
+	  args.id     = op_id; \
+	  args.nargs  = 1; \
+	  args.target = VALUE(other); \
+	  ret = rb_protect( PROTECTFUNC(swig_protect_funcall), \
+                            VALUE(&args), &status ); \
+	} \
+      if ( ret == Qnil ) { \
+	VALUE a = rb_funcall(         _obj, hash_id, 0 ); \
+	VALUE b = rb_funcall( VALUE(other), hash_id, 0 ); \
+	res = a cmp b; \
+      } \
+      else \
+	{ \
+	  res = RTEST( ret ); \
+	} \
+      SWIG_RUBY_THREAD_END_BLOCK; \
+      return res; \
+    }
+
+
+    GC_VALUE_CMP( eq_id, operator==, ==, == 0 )
+    GC_VALUE_CMP( lt_id, operator<,  < , <  0 )
+    GC_VALUE_CMP( le_id, operator<=, <=, <= 0 )
+    GC_VALUE_CMP( gt_id, operator>,  > , >  0 )
+    GC_VALUE_CMP( ge_id, operator>=, >=, >= 0 )
+#undef GC_VALUE_CMP
+
+    bool operator!=( const GC_VALUE& other )
+    {
+      return !(this->operator==(other));
+    }
+
+#define GC_VALUE_UNARY( proc_id, op ) \
+    GC_VALUE op() const \
+    { \
+      VALUE ret = Qnil; \
+      SWIG_RUBY_THREAD_BEGIN_BLOCK; \
+      int status; \
+      OpArgs  args; \
+      args.src    = _obj; \
+      args.id     = proc_id; \
+      args.nargs  = 0; \
+      args.target = Qnil; \
+      ret = rb_protect( PROTECTFUNC(swig_protect_funcall), VALUE(&args), \
+			&status ); \
+      SWIG_RUBY_THREAD_END_BLOCK; \
+      return ret; \
+    }
+
+    GC_VALUE_UNARY( pos_id, operator+ )
+    GC_VALUE_UNARY( neg_id, operator- )
+    GC_VALUE_UNARY( inv_id, operator~ )
+#undef GC_VALUE_BINARY
+
+#define GC_VALUE_BINARY( proc_id, op ) \
+    GC_VALUE op( const GC_VALUE& other ) const \
+    { \
+      VALUE ret = Qnil; \
+      SWIG_RUBY_THREAD_BEGIN_BLOCK; \
+      int status; \
+      OpArgs  args; \
+      args.src    = _obj; \
+      args.id     = proc_id; \
+      args.nargs  = 1; \
+      args.target = VALUE(other); \
+      ret = rb_protect( PROTECTFUNC(swig_protect_funcall), VALUE(&args), \
+			&status ); \
+      SWIG_RUBY_THREAD_END_BLOCK; \
+      return GC_VALUE(ret); \
+    }
+
+    GC_VALUE_BINARY( add_id, operator+ );
+    GC_VALUE_BINARY( sub_id, operator- );
+    GC_VALUE_BINARY( mul_id, operator* );
+    GC_VALUE_BINARY( div_id, operator/ );
+    GC_VALUE_BINARY( mod_id, operator% );
+    
+    GC_VALUE_BINARY( and_id, operator& );
+    GC_VALUE_BINARY( xor_id, operator^ );
+    GC_VALUE_BINARY(  or_id, operator| );
+
+    GC_VALUE_BINARY( lshift_id, operator<< );
+    GC_VALUE_BINARY( rshift_id, operator>> );
+#undef GC_VALUE_BINARY
+
+  };
+
+  ID  GC_VALUE::hash_id = rb_intern("hash");
+  ID  GC_VALUE::lt_id = rb_intern("<");
+  ID  GC_VALUE::gt_id = rb_intern(">");
+  ID  GC_VALUE::eq_id = rb_intern("==");
+  ID  GC_VALUE::le_id = rb_intern("<=");
+  ID  GC_VALUE::ge_id = rb_intern(">=");
+
+  ID  GC_VALUE::pos_id = rb_intern("+@");
+  ID  GC_VALUE::neg_id = rb_intern("-@");
+  ID  GC_VALUE::inv_id = rb_intern("~");
+
+  ID  GC_VALUE::add_id = rb_intern("+");
+  ID  GC_VALUE::sub_id = rb_intern("-");
+  ID  GC_VALUE::mul_id = rb_intern("*");
+  ID  GC_VALUE::div_id = rb_intern("/");
+  ID  GC_VALUE::mod_id = rb_intern("%");
+
+  ID  GC_VALUE::and_id = rb_intern("&");
+  ID  GC_VALUE::or_id  = rb_intern("|");
+  ID  GC_VALUE::xor_id = rb_intern("^");
+
+  ID  GC_VALUE::lshift_id = rb_intern("<<");
+  ID  GC_VALUE::rshift_id = rb_intern(">>");
+
+  VALUE GC_VALUE::_hash = Qnil;
+
+  typedef GC_VALUE LANGUAGE_OBJ;
+
+} // namespace swig
+
+
+
+#if defined(__GNUC__)
+#  if __GNUC__ == 2 && __GNUC_MINOR <= 96
+#     define SWIG_STD_NOMODERN_STL
+#  endif
+#endif
+
+
+#include <string>
+#include <stdexcept>
+#include <stddef.h>
+
+
+#include <string>
+
+
+#include <iostream>
+
+  
+namespace swig {
+  struct stop_iteration {
+  };
+
+  /** 
+   * Abstract base class used to represent all iterators of STL containers.
+   */
+  struct ConstIterator {
+  public:
+    typedef ConstIterator self_type;
+
+  protected:
+    GC_VALUE _seq;
+
+  protected:
+    ConstIterator(VALUE seq) : _seq(seq)
+    {
+    }
+
+    // Random access iterator methods, but not required in Ruby
+    virtual ptrdiff_t distance(const ConstIterator &x) const
+    {
+      throw std::invalid_argument("distance not supported");
+    }
+
+    virtual bool equal (const ConstIterator &x) const
+    {
+      throw std::invalid_argument("equal not supported");
+    }
+
+    virtual self_type* advance(ptrdiff_t n)
+    {
+      throw std::invalid_argument("advance not supported");
+    }
+      
+  public:
+    virtual ~ConstIterator() {}
+
+    // Access iterator method, required by Ruby
+    virtual VALUE value() const {
+      throw std::invalid_argument("value not supported");
+      return Qnil;
+    };
+
+    virtual VALUE setValue( const VALUE& v ) {
+      throw std::invalid_argument("value= not supported");
+      return Qnil;
+    }
+
+    virtual self_type* next( size_t n = 1 )
+    {
+      return this->advance( n );
+    }
+
+    virtual self_type* previous( size_t n = 1 )
+    {
+      ptrdiff_t nn = n;
+      return this->advance( -nn );
+    }
+
+    virtual VALUE to_s() const {
+      throw std::invalid_argument("to_s not supported");
+      return Qnil;
+    }
+
+    virtual VALUE inspect() const {
+      throw std::invalid_argument("inspect not supported");
+      return Qnil;
+    }
+    
+    virtual ConstIterator *dup() const
+    {
+      throw std::invalid_argument("dup not supported");
+      return NULL;
+    }
+
+    //
+    // C++ common/needed methods.  We emulate a bidirectional
+    // operator, to be compatible with all the STL.
+    // The iterator traits will then tell the STL what type of
+    // iterator we really are.
+    //
+    ConstIterator() : _seq( Qnil )
+    {
+    }
+
+    ConstIterator( const self_type& b ) : _seq( b._seq )
+    {
+    }
+
+    self_type& operator=( const self_type& b )
+    {
+      _seq = b._seq;
+      return *this;
+    }
+
+    bool operator == (const ConstIterator& x)  const
+    {
+      return equal(x);
+    }
+      
+    bool operator != (const ConstIterator& x) const
+    {
+      return ! operator==(x);
+    }
+      
+    // Pre-decrement operator
+    self_type& operator--()
+    {
+      return *previous();
+    }
+
+    // Pre-increment operator
+    self_type& operator++()
+    {
+      return *next();
+    }
+
+    // Post-decrement operator
+    self_type operator--(int)
+    {
+      self_type r = *this;
+      previous();
+      return r;
+    }
+
+    // Post-increment operator
+    self_type operator++(int)
+    {
+      self_type r = *this;
+      next();
+      return r;
+    }
+
+    ConstIterator& operator += (ptrdiff_t n)
+    {
+      return *advance(n);
+    }
+
+    ConstIterator& operator -= (ptrdiff_t n)
+    {
+      return *advance(-n);
+    }
+
+    ConstIterator* operator + (ptrdiff_t n) const
+    {
+      return dup()->advance(n);
+    }
+
+    ConstIterator* operator - (ptrdiff_t n) const
+    {
+      return dup()->advance(-n);
+    }
+      
+    ptrdiff_t operator - (const ConstIterator& x) const
+    {
+      return x.distance(*this);
+    }
+      
+    static swig_type_info* descriptor() {
+      static int init = 0;
+      static swig_type_info* desc = 0;
+      if (!init) {
+	desc = SWIG_TypeQuery("swig::ConstIterator *");
+	init = 1;
+      }	
+      return desc;
+    }
+  };
+
+
+  /**
+   * Abstract base class used to represent all non-const iterators of STL containers.
+   * 
+   */
+  struct Iterator : public ConstIterator {
+  public:
+    typedef Iterator self_type;
+
+  protected:
+    Iterator(VALUE seq) : ConstIterator(seq)
+    {
+    }
+
+    virtual self_type* advance(ptrdiff_t n)
+    {
+      throw std::invalid_argument("operation not supported");
+    }
+
+  public:
+    static swig_type_info* descriptor() {
+      static int init = 0;
+      static swig_type_info* desc = 0;
+      if (!init) {
+	desc = SWIG_TypeQuery("swig::Iterator *");
+	init = 1;
+      }	
+      return desc;
+    }
+    
+    virtual Iterator *dup() const
+    {
+      throw std::invalid_argument("dup not supported");
+      return NULL;
+    }
+      
+    virtual self_type* next( size_t n = 1 )
+    {
+      return this->advance( n );
+    }
+
+    virtual self_type* previous( size_t n = 1 )
+    {
+      ptrdiff_t nn = n;
+      return this->advance( -nn );
+    }
+
+    bool operator == (const ConstIterator& x)  const
+    {
+      return equal(x);
+    }
+      
+    bool operator != (const Iterator& x) const
+    {
+      return ! operator==(x);
+    }
+      
+    Iterator& operator += (ptrdiff_t n)
+    {
+      return *advance(n);
+    }
+
+    Iterator& operator -= (ptrdiff_t n)
+    {
+      return *advance(-n);
+    }
+      
+    Iterator* operator + (ptrdiff_t n) const
+    {
+      return dup()->advance(n);
+    }
+
+    Iterator* operator - (ptrdiff_t n) const
+    {
+      return dup()->advance(-n);
+    }
+      
+    ptrdiff_t operator - (const Iterator& x) const
+    {
+      return x.distance(*this);
+    }
+  };
+
+}
+
+
+SWIGINTERN VALUE
+SWIG_ruby_failed(void)
+{
+  return Qnil;
+} 
+
+
+/*@SWIG:/usr/share/swig/2.0.4/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
+SWIGINTERN VALUE SWIG_AUX_NUM2ULONG(VALUE *args)
+{
+  VALUE obj = args[0];
+  VALUE type = TYPE(obj);
+  unsigned long *res = (unsigned long *)(args[1]);
+  *res = type == T_FIXNUM ? NUM2ULONG(obj) : rb_big2ulong(obj);
+  return obj;
+}
+/*@SWIG@*/
+
+SWIGINTERN int
+SWIG_AsVal_unsigned_SS_long (VALUE obj, unsigned long *val) 
+{
+  VALUE type = TYPE(obj);
+  if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
+    unsigned long v;
+    VALUE a[2];
+    a[0] = obj;
+    a[1] = (VALUE)(&v);
+    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2ULONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+      if (val) *val = v;
+      return SWIG_OK;
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_AsVal_size_t (VALUE obj, size_t *val)
+{
+  unsigned long v;
+  int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
+  if (SWIG_IsOK(res) && val) *val = static_cast< size_t >(v);
+  return res;
+}
+
+
+SWIGINTERNINLINE VALUE
+SWIG_From_bool  (bool value)
+{
+  return value ? Qtrue : Qfalse;
+}
+
+
+/*@SWIG:/usr/share/swig/2.0.4/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
+SWIGINTERN VALUE SWIG_AUX_NUM2LONG(VALUE *args)
+{
+  VALUE obj = args[0];
+  VALUE type = TYPE(obj);
+  long *res = (long *)(args[1]);
+  *res = type == T_FIXNUM ? NUM2LONG(obj) : rb_big2long(obj);
+  return obj;
+}
+/*@SWIG@*/
+
+SWIGINTERN int
+SWIG_AsVal_long (VALUE obj, long* val)
+{
+  VALUE type = TYPE(obj);
+  if ((type == T_FIXNUM) || (type == T_BIGNUM)) {
+    long v;
+    VALUE a[2];
+    a[0] = obj;
+    a[1] = (VALUE)(&v);
+    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2LONG), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+      if (val) *val = v;
+      return SWIG_OK;
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERNINLINE int
+SWIG_AsVal_ptrdiff_t (VALUE obj, ptrdiff_t *val)
+{
+  long v;
+  int res = SWIG_AsVal_long (obj, val ? &v : 0);
+  if (SWIG_IsOK(res) && val) *val = static_cast< ptrdiff_t >(v);
+  return res;
+}
+
+
+#include <limits.h>
+#if !defined(SWIG_NO_LLONG_MAX)
+# if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
+#   define LLONG_MAX __LONG_LONG_MAX__
+#   define LLONG_MIN (-LLONG_MAX - 1LL)
+#   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
+# endif
+#endif
+
+
+  #define SWIG_From_long   LONG2NUM 
+
+
+SWIGINTERNINLINE VALUE
+SWIG_From_ptrdiff_t  (ptrdiff_t value)
+{    
+  return SWIG_From_long  (static_cast< long >(value));
+}
+
+
+#include <stdexcept>
+
+
+#include <algorithm>
+
+
+#include <vector>
+
+
+#include <utility>
+
+
+#include <map>
+#include <algorithm>
+#include <stdexcept>
+
+
+SWIGINTERN int
+SWIG_AsVal_int (VALUE obj, int *val)
+{
+  long v;
+  int res = SWIG_AsVal_long (obj, &v);
+  if (SWIG_IsOK(res)) {
+    if ((v < INT_MIN || v > INT_MAX)) {
+      return SWIG_OverflowError;
+    } else {
+      if (val) *val = static_cast< int >(v);
+    }
+  }  
+  return res;
+}
+
+
+SWIGINTERNINLINE VALUE
+SWIG_From_int  (int value)
+{    
+  return SWIG_From_long  (value);
+}
+
+
+namespace swig {  
+  template <class Type>
+  struct noconst_traits {
+    typedef Type noconst_type;
+  };
+
+  template <class Type>
+  struct noconst_traits<const Type> {
+    typedef Type noconst_type;
+  };
+
+  /*
+    type categories
+  */
+  struct pointer_category { };  
+  struct value_category { };
+
+  /*
+    General traits that provides type_name and type_info
+  */
+  template <class Type> struct traits { };
+
+  template <class Type>
+  inline const char* type_name() {
+    return traits<typename noconst_traits<Type >::noconst_type >::type_name();
+  }
+
+  template <class Type> 
+  struct traits_info {
+    static swig_type_info *type_query(std::string name) {
+      name += " *";
+      return SWIG_TypeQuery(name.c_str());
+    }    
+    static swig_type_info *type_info() {
+      static swig_type_info *info = type_query(type_name<Type>());
+      return info;
+    }
+  };
+
+  template <class Type>
+  inline swig_type_info *type_info() {
+    return traits_info<Type>::type_info();
+  }
+
+  /*
+    Partial specialization for pointers
+  */
+  template <class Type> struct traits <Type *> {
+    typedef pointer_category category;
+    static std::string make_ptr_name(const char* name) {
+      std::string ptrname = name;
+      ptrname += " *";
+      return ptrname;
+    }    
+    static const char* type_name() {
+      static std::string name = make_ptr_name(swig::type_name<Type>());
+      return name.c_str();
+    }
+  };
+
+  template <class Type, class Category> 
+  struct traits_as { };
+ 
+  template <class Type, class Category> 
+  struct traits_check { };
+
+}
+
+
+
+namespace swig {  
+  /*
+    Traits that provides the from method
+  */
+  template <class Type> struct traits_from_ptr {
+    static VALUE from(Type *val, int owner = 0) {
+      return SWIG_NewPointerObj(val, type_info<Type>(), owner);
+    }
+  };
+
+  template <class Type> struct traits_from {
+    static VALUE from(const Type& val) {
+      return traits_from_ptr<Type>::from(new Type(val), 1);
+    }
+  };
+
+  template <class Type> struct traits_from<Type *> {
+    static VALUE from(Type* val) {
+      return traits_from_ptr<Type>::from(val, 0);
+    }
+  };
+
+  template <class Type> struct traits_from<const Type *> {
+    static VALUE from(const Type* val) {
+      return traits_from_ptr<Type>::from(const_cast<Type*>(val), 0);
+    }
+  };
+
+
+  template <class Type>
+  inline VALUE from(const Type& val) {
+    return traits_from<Type>::from(val);
+  }
+
+  template <class Type>
+  inline VALUE from_ptr(Type* val, int owner) {
+    return traits_from_ptr<Type>::from(val, owner);
+  }
+
+  /*
+    Traits that provides the asval/as/check method
+  */
+  template <class Type>
+  struct traits_asptr {   
+    static int asptr(VALUE obj, Type **val) {
+      Type *p;
+      int res = SWIG_ConvertPtr(obj, (void**)&p, type_info<Type>(), 0);
+      if (SWIG_IsOK(res)) {
+	if (val) *val = p;
+      }
+      return res;
+    }
+  }; 
+
+  template <class Type>
+  inline int asptr(VALUE obj, Type **vptr) {
+    return traits_asptr<Type>::asptr(obj, vptr);
+  }
+
+  template <class Type> 
+  struct traits_asval {
+    static int asval(VALUE obj, Type *val) {
+      if (val) {
+	Type *p = 0;
+	int res = traits_asptr<Type>::asptr(obj, &p);
+	if (!SWIG_IsOK(res)) return res;	
+	if (p) {
+	  typedef typename noconst_traits<Type>::noconst_type noconst_type;
+	  *(const_cast<noconst_type*>(val)) = *p;
+	  if (SWIG_IsNewObj(res)){
+	    delete p;
+	    res = SWIG_DelNewMask(res);
+	  }
+	  return res;
+	} else {
+	  return SWIG_ERROR;
+	}
+      } else {
+	return traits_asptr<Type>::asptr(obj, (Type **)(0));
+      }
+    }
+  };
+
+  template <class Type> struct traits_asval<Type*> {
+    static int asval(VALUE obj, Type **val) {
+      if (val) {
+        typedef typename noconst_traits<Type>::noconst_type noconst_type;
+        noconst_type *p = 0;
+        int res = traits_asptr<noconst_type>::asptr(obj,  &p);
+        if (SWIG_IsOK(res)) {
+          *(const_cast<noconst_type**>(val)) = p;
+	}
+	return res;
+      } else {
+	return traits_asptr<Type>::asptr(obj, (Type **)(0));
+      }
+    }
+  };
+  
+  template <class Type>
+  inline int asval(VALUE obj, Type *val) {
+    return traits_asval<Type>::asval(obj, val);
+  }
+
+  template <class Type> 
+  struct traits_as<Type, value_category> {
+    static Type as(VALUE obj, bool throw_error) {
+      Type v;
+      int res = asval(obj, &v);
+      if (!obj || !SWIG_IsOK(res)) {
+	if (throw_error) throw std::invalid_argument("bad type");
+	VALUE lastErr = rb_gv_get("$!");
+	if (lastErr == Qnil) {
+	  SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
+	}
+      }
+      return v;
+    }
+  };
+
+  template <class Type> 
+  struct traits_as<Type, pointer_category> {
+    static Type as(VALUE obj, bool throw_error) {
+      Type *v = 0;      
+      int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
+      if (SWIG_IsOK(res) && v) {
+	if (SWIG_IsNewObj(res)) {
+	  Type r(*v);
+	  delete v;
+	  return r;
+	} else {
+	  return *v;
+	}
+      } else {
+	// Uninitialized return value, no Type() constructor required.
+	if (throw_error) throw std::invalid_argument("bad type");
+	VALUE lastErr = rb_gv_get("$!");
+	if (lastErr == Qnil) {
+	  SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
+	}
+	static Type *v_def = (Type*) malloc(sizeof(Type));
+	memset(v_def,0,sizeof(Type));
+	return *v_def;
+      }
+    }
+  };
+
+  template <class Type> 
+  struct traits_as<Type*, pointer_category> {
+    static Type* as(VALUE obj, bool throw_error) {
+      Type *v = 0;      
+      int res = (obj ? traits_asptr<Type>::asptr(obj, &v) : SWIG_ERROR);
+      if (SWIG_IsOK(res)) {
+	return v;
+      } else {
+	if (throw_error) throw std::invalid_argument("bad type");
+	VALUE lastErr = rb_gv_get("$!");
+	if (lastErr == Qnil) {
+	  SWIG_Error(SWIG_TypeError,  swig::type_name<Type>());
+	}
+	return 0;
+      }
+    }
+  };
+
+  template <class Type>
+  inline Type as(VALUE obj, bool te = false) {
+    return traits_as< Type, typename traits< Type >::category >::as(obj, te);
+  }
+
+  template <class Type> 
+  struct traits_check<Type, value_category> {
+    static bool check(VALUE obj) {
+      int res = obj ? asval(obj, (Type *)(0)) : SWIG_ERROR;
+      return SWIG_IsOK(res) ? true : false;
+    }
+  };
+
+  template <class Type> 
+  struct traits_check<Type, pointer_category> {
+    static bool check(VALUE obj) {
+      int res = obj ? asptr(obj, (Type **)(0)) : SWIG_ERROR;
+      return SWIG_IsOK(res) ? true : false;
+    }
+  };
+
+  template <class Type>
+  inline bool check(VALUE obj) {
+    return traits_check<Type, typename traits<Type>::category>::check(obj);
+  }
+}
+
+
+namespace swig {
+  template <> struct traits<int > {
+    typedef value_category category;
+    static const char* type_name() { return"int"; }
+  };  
+  template <>  struct traits_asval<int > {   
+    typedef int value_type;
+    static int asval(VALUE obj, value_type *val) { 
+      return SWIG_AsVal_int (obj, val);
+    }
+  };
+  template <>  struct traits_from<int > {
+    typedef int value_type;
+    static VALUE from(const value_type& val) {
+      return SWIG_From_int  (val);
+    }
+  };
+}
+
+
+#include <functional>
+
+
+namespace swig {
+  template < class T >
+  struct yield : public std::unary_function< T, bool >
+  {
+    bool
+    operator()( const T& v ) const
+    { 
+      return RTEST( rb_yield( swig::from< T >(v) ) );
+    }
+  };
+
+
+  inline size_t
+  check_index(ptrdiff_t i, size_t size, bool insert = false) {
+    if ( i < 0 ) {
+      if ((size_t) (-i) <= size)
+	return (size_t) (i + size);
+    } else if ( (size_t) i < size ) {
+      return (size_t) i;
+    } else if (insert && ((size_t) i == size)) {
+      return size;
+    }
+    
+    throw std::out_of_range("index out of range");
+  }
+
+  inline size_t
+  slice_index(ptrdiff_t i, size_t size) {
+    if ( i < 0 ) {
+      if ((size_t) (-i) <= size) {
+	return (size_t) (i + size);
+      } else {
+	throw std::out_of_range("index out of range");
+      }
+    } else {
+      return ( (size_t) i < size ) ? ((size_t) i) : size;
+    }
+  }
+
+  template <class Sequence, class Difference>
+  inline typename Sequence::iterator
+  getpos(Sequence* self, Difference i)  {
+    typename Sequence::iterator pos = self->begin();
+    std::advance(pos, check_index(i,self->size()));
+    return pos;
+  }
+
+  template <class Sequence, class Difference>
+  inline typename Sequence::const_iterator
+  cgetpos(const Sequence* self, Difference i)  {
+    typename Sequence::const_iterator pos = self->begin();
+    std::advance(pos, check_index(i,self->size()));
+    return pos;
+  }
+
+  template <class Sequence, class Difference>
+  inline Sequence*
+  getslice(const Sequence* self, Difference i, Difference j) {
+    typename Sequence::size_type size = self->size();
+    typename Sequence::size_type ii = swig::check_index(i, size);
+    typename Sequence::size_type jj = swig::slice_index(j, size);
+
+    if (jj > ii) {
+      typename Sequence::const_iterator vb = self->begin();
+      typename Sequence::const_iterator ve = self->begin();
+      std::advance(vb,ii);
+      std::advance(ve,jj);
+      return new Sequence(vb, ve);
+    } else {
+      return new Sequence();
+    }
+  }
+
+  template <class Sequence, class Difference, class InputSeq>
+  inline void
+  setslice(Sequence* self, Difference i, Difference j, const InputSeq& v) {
+    typename Sequence::size_type size = self->size();
+    typename Sequence::size_type ii = swig::check_index(i, size, true);
+    typename Sequence::size_type jj = swig::slice_index(j, size);
+    if (jj < ii) jj = ii;
+    size_t ssize = jj - ii;
+    if (ssize <= v.size()) {
+      typename Sequence::iterator sb = self->begin();
+      typename InputSeq::const_iterator vmid = v.begin();
+      std::advance(sb,ii);
+      std::advance(vmid, jj - ii);
+      self->insert(std::copy(v.begin(), vmid, sb), vmid, v.end());
+    } else {
+      typename Sequence::iterator sb = self->begin();
+      typename Sequence::iterator se = self->begin();
+      std::advance(sb,ii);
+      std::advance(se,jj);
+      self->erase(sb,se);
+      self->insert(sb, v.begin(), v.end());
+    }
+  }
+
+  template <class Sequence, class Difference>
+  inline void
+  delslice(Sequence* self, Difference i, Difference j) {
+    typename Sequence::size_type size = self->size();
+    typename Sequence::size_type ii = swig::check_index(i, size, true);
+    typename Sequence::size_type jj = swig::slice_index(j, size);
+    if (jj > ii) {
+      typename Sequence::iterator sb = self->begin();
+      typename Sequence::iterator se = self->begin();
+      std::advance(sb,ii);
+      std::advance(se,jj);
+      self->erase(sb,se);
+    }
+  }
+}
+
+
+#if defined(__SUNPRO_CC) && defined(_RWSTD_VER)
+#  if !defined(SWIG_NO_STD_NOITERATOR_TRAITS_STL)
+#    define SWIG_STD_NOITERATOR_TRAITS_STL
+#  endif
+#endif
+
+#if !defined(SWIG_STD_NOITERATOR_TRAITS_STL)
+#include <iterator>
+#else
+namespace std {
+  template <class Iterator>
+  struct iterator_traits {
+    typedef ptrdiff_t difference_type;
+    typedef typename Iterator::value_type value_type;
+  };
+
+  template <class Iterator, class Category,class T, class Reference, class Pointer, class Distance>
+  struct iterator_traits<__reverse_bi_iterator<Iterator,Category,T,Reference,Pointer,Distance> > {
+    typedef Distance difference_type;
+    typedef T value_type;
+  };
+
+  template <class T>
+  struct iterator_traits<T*> {
+    typedef T value_type;
+    typedef ptrdiff_t difference_type;
+  };
+
+  template<typename _InputIterator>
+  inline typename iterator_traits<_InputIterator>::difference_type
+  distance(_InputIterator __first, _InputIterator __last)
+  {
+    typename iterator_traits<_InputIterator>::difference_type __n = 0;
+    while (__first != __last) {
+      ++__first; ++__n;
+    }
+    return __n;
+  }
+}
+#endif
+
+
+namespace swig {
+
+  /** 
+   * Templated base classes for all custom const_iterators.
+   *
+   */
+  template<typename OutConstIterator>
+  class ConstIterator_T :  public ConstIterator
+  {
+  public:
+    typedef OutConstIterator const_iter;
+    typedef typename std::iterator_traits<const_iter>::value_type value_type;    
+    typedef ConstIterator_T<const_iter> self_type;
+
+  protected:
+
+    
+    virtual bool equal (const ConstIterator &iter) const
+    {
+      const self_type *iters = dynamic_cast<const self_type *>(&iter);
+      if (iters) {
+	return (current == iters->get_current());
+      } else {
+	throw std::invalid_argument("bad iterator type");
+      }
+    }
+    
+    virtual ptrdiff_t distance(const ConstIterator &iter) const
+    {
+      const self_type *iters = dynamic_cast<const self_type *>(&iter);
+      if (iters) {
+	return std::distance(current, iters->get_current());
+      } else {
+	throw std::invalid_argument("bad iterator type");
+      }
+    }
+
+    virtual ConstIterator* advance(ptrdiff_t n)
+    {
+      std::advance( current, n );
+      return this;
+    }
+
+  public:
+    ConstIterator_T() : ConstIterator(Qnil)
+    {
+    }
+
+    ConstIterator_T(const_iter curr, VALUE seq = Qnil)
+      : ConstIterator(seq), current(curr)
+    {
+    }
+
+    const const_iter& get_current() const
+    {
+      return current;
+    }
+
+    const value_type& operator*() const
+    {
+      return *current;
+    }
+
+    virtual VALUE inspect() const
+    {
+      VALUE ret = rb_str_new2("#<");
+      ret = rb_str_cat2( ret, rb_obj_classname(_seq) );
+      ret = rb_str_cat2( ret, "::const_iterator " );
+      VALUE cur = value();
+      ret = rb_str_concat( ret, rb_inspect(cur) );
+      ret = rb_str_cat2( ret, ">" );
+      return ret;
+    }
+
+    virtual VALUE to_s()    const
+    {
+      VALUE ret = rb_str_new2( rb_obj_classname(_seq) );
+      ret = rb_str_cat2( ret, "::const_iterator " );
+      VALUE cur = value();
+      ret = rb_str_concat( ret, rb_obj_as_string(cur) );
+      return ret;
+    }
+
+  protected:
+    const_iter current;
+  };
+
+
+  /** 
+   * Templated base classes for all custom non-const iterators.
+   *
+   */
+  template<typename InOutIterator>
+  class Iterator_T :  public Iterator
+  {
+  public:
+    typedef InOutIterator nonconst_iter;
+
+    // Make this class iterator STL compatible, by using iterator_traits
+    typedef typename std::iterator_traits<nonconst_iter >::iterator_category iterator_category;
+    typedef typename std::iterator_traits<nonconst_iter >::value_type        value_type;
+    typedef typename std::iterator_traits<nonconst_iter >::difference_type   difference_type;
+    typedef typename std::iterator_traits<nonconst_iter >::pointer           pointer;
+    typedef typename std::iterator_traits<nonconst_iter >::reference         reference;
+
+    typedef Iterator                         base;
+    typedef Iterator_T< nonconst_iter > self_type;
+
+  protected:
+
+    virtual bool equal (const ConstIterator &iter) const
+    {
+      const self_type *iters = dynamic_cast<const self_type *>(&iter);
+      if (iters) {
+	return (current == iters->get_current());
+      } else {
+	throw std::invalid_argument("bad iterator type");
+      }
+    }
+    
+    virtual ptrdiff_t distance(const ConstIterator &iter) const
+    {
+      const self_type *iters = dynamic_cast<const self_type *>(&iter);
+      if (iters) {
+	return std::distance(current, iters->get_current());
+      } else {
+	throw std::invalid_argument("bad iterator type");
+      }
+    }
+
+    virtual Iterator* advance(ptrdiff_t n)
+    {
+      std::advance( current, n );
+      return this;
+    }
+
+  public:
+
+    Iterator_T(nonconst_iter curr, VALUE seq = Qnil)
+      : Iterator(seq), current(curr)
+    {
+    }
+
+    const nonconst_iter& get_current() const
+    {
+      return current;
+    }
+
+    self_type& operator=( const self_type& b )
+    {
+      base::operator=( b );
+      return *this;
+    }
+    
+    self_type& operator=( const value_type& b )
+    {
+      *current = b;
+      return *this;
+    }
+
+    const value_type& operator*() const
+    {
+      return *current;
+    }
+
+    value_type& operator*()
+    {
+      return *current;
+    }
+    
+    virtual VALUE inspect() const
+    {
+      VALUE ret = rb_str_new2("#<");
+      ret = rb_str_cat2( ret, rb_obj_classname(_seq) );
+      ret = rb_str_cat2( ret, "::iterator " );
+      VALUE cur = value();
+      ret = rb_str_concat( ret, rb_inspect(cur) );
+      ret = rb_str_cat2( ret, ">" );
+      return ret;
+    }
+
+    virtual VALUE to_s()    const
+    {
+      VALUE ret = rb_str_new2( rb_obj_classname(_seq) );
+      ret = rb_str_cat2( ret, "::iterator " );
+      VALUE cur = value();
+      ret = rb_str_concat( ret, rb_obj_as_string(cur) );
+      return ret;
+    }
+
+  protected:
+    nonconst_iter current;
+  };
+
+
+  /**
+   * Auxiliary functor to store the value of a ruby object inside
+   * a reference of a compatible C++ type.  ie: Ruby -> C++
+   * 
+   */
+  template <class ValueType>
+  struct asval_oper 
+  {
+    typedef ValueType    value_type;
+    typedef bool        result_type;
+    bool operator()(VALUE obj, value_type& v) const
+    {
+      return ( swig::asval< value_type >(obj, &v) == SWIG_OK );
+    }
+  };
+
+  /**
+   * Auxiliary functor to return a ruby object from a C++ type. 
+   * ie: C++ -> Ruby
+   * 
+   */
+  template <class ValueType>
+  struct from_oper 
+  {
+    typedef const ValueType& argument_type;
+    typedef VALUE result_type;
+    result_type operator()(argument_type v) const
+    {
+      return swig::from(v);
+    }
+  };
+
+
+  /** 
+   * ConstIterator class for a const_iterator with no end() boundaries.
+   *
+   */
+  template<typename OutConstIterator, 
+	   typename ValueType = typename std::iterator_traits<OutConstIterator>::value_type,
+	   typename FromOper = from_oper<ValueType> >
+  class ConstIteratorOpen_T :  public ConstIterator_T<OutConstIterator>
+  {
+  public:
+    FromOper from;
+    typedef OutConstIterator const_iter;
+    typedef ValueType value_type;
+    typedef ConstIterator_T<const_iter>  base;
+    typedef ConstIteratorOpen_T<OutConstIterator, ValueType, FromOper> self_type;
+    
+    ConstIteratorOpen_T(const_iter curr, VALUE seq = Qnil)
+      : ConstIterator_T<OutConstIterator>(curr, seq)
+    {
+    }
+    
+    virtual VALUE value() const {
+      return from(static_cast<const value_type&>(*(base::current)));
+    }
+    
+    ConstIterator *dup() const
+    {
+      return new self_type(*this);
+    }
+  };
+
+  /** 
+   * Iterator class for an iterator with no end() boundaries.
+   *
+   */
+  template<typename InOutIterator, 
+	   typename ValueType = typename std::iterator_traits<InOutIterator>::value_type,
+	   typename FromOper = from_oper<ValueType>,
+	   typename AsvalOper = asval_oper<ValueType> >
+  class IteratorOpen_T :  public Iterator_T<InOutIterator>
+  {
+  public:
+    FromOper  from;
+    AsvalOper asval;
+    typedef InOutIterator nonconst_iter;
+    typedef ValueType value_type;
+    typedef Iterator_T<nonconst_iter>  base;
+    typedef IteratorOpen_T<InOutIterator, ValueType, FromOper, AsvalOper> self_type;
+
+  public:
+    IteratorOpen_T(nonconst_iter curr, VALUE seq = Qnil)
+      : Iterator_T<InOutIterator>(curr, seq)
+    {
+    }
+    
+    virtual VALUE value() const {
+      return from(static_cast<const value_type&>(*(base::current)));
+    }
+
+    virtual VALUE setValue( const VALUE& v )
+    {
+      value_type& dst = *base::current;
+      if ( asval(v, dst) ) return v;
+      return Qnil;
+    }
+    
+    Iterator *dup() const
+    {
+      return new self_type(*this);
+    }
+  };
+
+  /** 
+   * ConstIterator class for a const_iterator where begin() and end() boundaries are known.
+   *
+   */
+  template<typename OutConstIterator, 
+	   typename ValueType = typename std::iterator_traits<OutConstIterator>::value_type,
+	   typename FromOper = from_oper<ValueType> >
+  class ConstIteratorClosed_T :  public ConstIterator_T<OutConstIterator>
+  {
+  public:
+    FromOper from;
+    typedef OutConstIterator const_iter;
+    typedef ValueType value_type;
+    typedef ConstIterator_T<const_iter>  base;    
+    typedef ConstIteratorClosed_T<OutConstIterator, ValueType, FromOper> self_type;
+    
+  protected:
+    virtual ConstIterator* advance(ptrdiff_t n)
+    {
+      std::advance( base::current, n );
+      if ( base::current == end )
+	throw stop_iteration();
+      return this;
+    }
+
+  public:
+    ConstIteratorClosed_T(const_iter curr, const_iter first, 
+			  const_iter last, VALUE seq = Qnil)
+      : ConstIterator_T<OutConstIterator>(curr, seq), begin(first), end(last)
+    {
+    }
+    
+    virtual VALUE value() const {
+      if (base::current == end) {
+	throw stop_iteration();
+      } else {
+	return from(static_cast<const value_type&>(*(base::current)));
+      }
+    }
+    
+    ConstIterator *dup() const
+    {
+      return new self_type(*this);
+    }
+
+
+  private:
+    const_iter begin;
+    const_iter end;
+  };
+
+  /** 
+   * Iterator class for a iterator where begin() and end() boundaries are known.
+   *
+   */
+  template<typename InOutIterator, 
+	   typename ValueType = typename std::iterator_traits<InOutIterator>::value_type,
+	   typename FromOper = from_oper<ValueType>,
+	   typename AsvalOper = asval_oper<ValueType> >
+  class IteratorClosed_T :  public Iterator_T<InOutIterator>
+  {
+  public:
+    FromOper   from;
+    AsvalOper asval;
+    typedef InOutIterator nonconst_iter;
+    typedef ValueType value_type;
+    typedef Iterator_T<nonconst_iter>  base;
+    typedef IteratorClosed_T<InOutIterator, ValueType, FromOper, AsvalOper> self_type;
+    
+  protected:
+    virtual Iterator* advance(ptrdiff_t n)
+    {
+      std::advance( base::current, n );
+      if ( base::current == end )
+	throw stop_iteration();
+      return this;
+    }
+
+  public:
+    IteratorClosed_T(nonconst_iter curr, nonconst_iter first, 
+		     nonconst_iter last, VALUE seq = Qnil)
+      : Iterator_T<InOutIterator>(curr, seq), begin(first), end(last)
+    {
+    }
+    
+    virtual VALUE value() const {
+      if (base::current == end) {
+	throw stop_iteration();
+      } else {
+	return from(static_cast<const value_type&>(*(base::current)));
+      }
+    }
+    
+    // Iterator setter method, required by Ruby
+    virtual VALUE setValue( const VALUE& v )
+    {
+      if (base::current == end)
+	throw stop_iteration();
+
+      value_type& dst = *base::current;
+      if ( asval( v, dst ) ) return v;
+      return Qnil;
+    }
+    
+    Iterator *dup() const
+    {
+      return new self_type(*this);
+    }
+
+  private:
+    nonconst_iter begin;
+    nonconst_iter end;
+  };
+
+  /* Partial specialization for bools which don't allow de-referencing */
+  template< typename InOutIterator, typename FromOper, typename AsvalOper >
+  class IteratorOpen_T< InOutIterator, bool, FromOper, AsvalOper > : 
+    public Iterator_T<InOutIterator>
+  {
+  public:
+    FromOper   from;
+    AsvalOper asval;
+    typedef InOutIterator nonconst_iter;
+    typedef bool value_type;
+    typedef Iterator_T<nonconst_iter>  base;
+    typedef IteratorOpen_T<InOutIterator, bool, FromOper, AsvalOper> self_type;
+
+    IteratorOpen_T(nonconst_iter curr, VALUE seq = Qnil)
+      : Iterator_T<InOutIterator>(curr, seq)
+    {
+    }
+
+    virtual VALUE value() const {
+      return from(static_cast<const value_type&>(*(base::current)));
+    }
+    
+    virtual VALUE setValue( const VALUE& v )
+    {
+      bool tmp = *base::current;
+      if ( asval( v, tmp ) )
+	{
+	  *base::current = tmp;
+	  return v;
+	}
+      return Qnil;
+    }    
+    
+    Iterator *dup() const
+    {
+      return new self_type(*this);
+    }
+    
+  };
+
+  /* Partial specialization for bools which don't allow de-referencing */
+  template< typename InOutIterator, typename FromOper, typename AsvalOper >
+  class IteratorClosed_T< InOutIterator, bool, FromOper, AsvalOper > : 
+    public Iterator_T<InOutIterator>
+  {
+  public:
+    FromOper   from;
+    AsvalOper asval;
+    typedef InOutIterator nonconst_iter;
+    typedef bool value_type;
+    typedef Iterator_T<nonconst_iter>  base;
+    typedef IteratorClosed_T<InOutIterator, bool, FromOper, AsvalOper> self_type;
+    
+  protected:
+    virtual Iterator* advance(ptrdiff_t n)
+    {
+      std::advance( base::current, n );
+      if ( base::current == end )
+	throw stop_iteration();
+      return this;
+    }
+
+  public:
+    IteratorClosed_T(nonconst_iter curr, nonconst_iter first, 
+		     nonconst_iter last, VALUE seq = Qnil)
+      : Iterator_T<InOutIterator>(curr, seq), begin(first), end(last)
+    {
+    }
+
+    virtual VALUE value() const {
+      if (base::current == end) {
+	throw stop_iteration();
+      } else {
+	return from(static_cast<const value_type&>(*(base::current)));
+      }
+    }
+
+    virtual VALUE setValue( const VALUE& v )
+    {
+      if (base::current == end)
+	throw stop_iteration();
+
+      bool tmp = *base::current;
+      if ( asval( v, tmp ) )
+	{
+	  *base::current = tmp;
+	  return v;
+	}
+      return Qnil;
+    }
+    
+    Iterator *dup() const
+    {
+      return new self_type(*this);
+    }
+
+  private:
+    nonconst_iter begin;
+    nonconst_iter end;
+  };
+
+
+  /** 
+   * Helper function used to wrap a bounded const_iterator.  This is to be used in
+   * a %typemap(out), for example.
+   *
+   */
+  template<typename InOutIter>
+  inline Iterator*
+  make_nonconst_iterator(const InOutIter& current, const InOutIter& begin,
+			 const InOutIter& end, VALUE seq = Qnil)
+  {
+    return new IteratorClosed_T<InOutIter>(current, begin, end, seq);
+  }
+
+  /** 
+   * Helper function used to wrap an unbounded const_iterator.  This is to be used in
+   * a %typemap(out), for example.
+   *
+   */
+  template<typename InOutIter>
+  inline Iterator*
+  make_nonconst_iterator(const InOutIter& current, VALUE seq = Qnil)
+  {
+    return new IteratorOpen_T<InOutIter>(current, seq);
+  }
+
+  /** 
+   * Helper function used to wrap a bounded const_iterator.  This is to be used in
+   * a %typemap(out), for example.
+   *
+   */
+  template<typename OutIter>
+  inline ConstIterator*
+  make_const_iterator(const OutIter& current, const OutIter& begin,
+                       const OutIter& end, VALUE seq = Qnil)
+  {
+    return new ConstIteratorClosed_T<OutIter>(current, begin, end, seq);
+  }
+
+  /** 
+   * Helper function used to wrap an unbounded const_iterator.  This is to be used in
+   * a %typemap(out), for example.
+   *
+   */
+  template<typename OutIter>
+  inline ConstIterator*
+  make_const_iterator(const OutIter& current, VALUE seq = Qnil)
+  {
+    return new ConstIteratorOpen_T<OutIter>(current, seq);
+  }
+}
+
+
+namespace swig
+{
+
+  /**
+   * This class is a proxy class for references, used to return and set values
+   * of an element of a Ruby Array of stuff.
+   * It can be used by RubySequence_InputIterator to make it work with STL
+   * algorithms.
+   * 
+   */
+  template <class T>
+  struct RubySequence_Ref
+  {
+    RubySequence_Ref(VALUE  seq, int index)
+      : _seq(seq), _index(index)
+    {
+    }
+    
+    operator T () const
+    {
+      VALUE item = rb_ary_entry(_seq, _index );
+      try {
+	return swig::as<T>(item, true);
+      } catch (std::exception& e) {
+	char msg[1024];
+	sprintf(msg, "in sequence element %d ", _index);
+	VALUE lastErr = rb_gv_get("$!");
+	if ( lastErr == Qnil ) {
+	  SWIG_Error(SWIG_TypeError,  swig::type_name<T>());
+	}
+	VALUE str = rb_str_new2(msg);
+	str = rb_str_cat2( str, e.what() );
+	SWIG_Ruby_ExceptionType( NULL, str );
+	throw;
+      }
+    }
+
+    RubySequence_Ref& operator=(const T& v)
+    {
+      rb_ary_set(_seq, _index, swig::from< T >(v));
+      return *this;
+    }
+
+  private:
+    VALUE  _seq;
+    int _index;
+  };
+
+
+  /**
+   * This class is a proxy to return a pointer to a class, usually
+   * RubySequence_Ref. 
+   * It can be used by RubySequence_InputIterator to make it work with STL
+   * algorithms.
+   * 
+   */
+  template <class T>
+  struct RubySequence_ArrowProxy
+  {
+    RubySequence_ArrowProxy(const T& x): m_value(x) {}
+    const T* operator->() const { return &m_value; }
+    operator const T*() const { return &m_value; }
+    T m_value;
+  };
+
+
+  /**
+   * Input Iterator.  This adapator class is a random access iterator that 
+   * allows you to use STL algorithms with a Ruby class (a Ruby Array by default).
+   * 
+   */
+  template <class T, class Reference = RubySequence_Ref< T > >
+  struct RubySequence_InputIterator
+  {
+    typedef RubySequence_InputIterator<T, Reference > self;
+
+    typedef std::random_access_iterator_tag iterator_category;
+    typedef Reference reference;
+    typedef T value_type;
+    typedef T* pointer;
+    typedef ptrdiff_t difference_type;
+
+    RubySequence_InputIterator()
+    {
+    }
+
+    RubySequence_InputIterator(VALUE  seq, int index)
+      : _seq(seq), _index(index)
+    {
+    }
+
+    reference operator*() const
+    {
+      return reference(_seq, _index);
+    }
+
+    RubySequence_ArrowProxy<T>
+    operator->() const {
+      return RubySequence_ArrowProxy<T>(operator*());
+    }
+
+    bool operator==(const self& ri) const
+    {
+      return (_index == ri._index) && (_seq == ri._seq);
+    }
+
+    bool operator!=(const self& ri) const
+    {
+      return !(operator==(ri));
+    }
+
+    self& operator ++ ()
+    {
+      ++_index;
+      return *this;
+    }
+
+    self& operator -- ()
+    {
+      --_index;
+      return *this;
+    }
+
+    self& operator += (difference_type n)
+    {
+      _index += n;
+      return *this;
+    }
+
+    self operator +(difference_type n) const
+    {
+      return self(_seq, _index + n);
+    }
+
+    self& operator -= (difference_type n)
+    {
+      _index -= n;
+      return *this;
+    }
+
+    self operator -(difference_type n) const
+    {
+      return self(_seq, _index - n);
+    }
+
+    difference_type operator - (const self& ri) const
+    {
+      return _index - ri._index;
+    }
+
+    bool operator < (const self& ri) const
+    {
+      return _index < ri._index;
+    }
+
+    reference
+    operator[](difference_type n) const
+    {
+      return reference(_seq, _index + n);
+    }
+
+  private:
+    VALUE  _seq;
+    difference_type _index;
+  };
+
+
+  /**
+   * This adaptor class allows you to use a Ruby Array as if it was an STL
+   * container, giving it begin(), end(), and iterators.
+   * 
+   */
+  template <class T>
+  struct RubySequence_Cont
+  {
+    typedef RubySequence_Ref<T> reference;
+    typedef const RubySequence_Ref<T> const_reference;
+    typedef T value_type;
+    typedef T* pointer;
+    typedef int difference_type;
+    typedef int size_type;
+    typedef const pointer const_pointer;
+    typedef RubySequence_InputIterator<T, reference> iterator;
+    typedef RubySequence_InputIterator<T, const_reference> const_iterator;
+
+    RubySequence_Cont(VALUE  seq) : _seq(0)
+    {
+      if (!rb_obj_is_kind_of(seq, rb_cArray)) {
+	throw std::invalid_argument("an Array is expected");
+      }
+      _seq = seq;
+    }
+
+    ~RubySequence_Cont()
+    {
+    }
+
+    size_type size() const
+    {
+      return RARRAY_LEN(_seq);
+    }
+
+    bool empty() const
+    {
+      return size() == 0;
+    }
+
+    iterator begin()
+    {
+      return iterator(_seq, 0);
+    }
+
+    const_iterator begin() const
+    {
+      return const_iterator(_seq, 0);
+    }
+
+    iterator end()
+    {
+      return iterator(_seq, size());
+    }
+
+    const_iterator end() const
+    {
+      return const_iterator(_seq, size());
+    }
+
+    reference operator[](difference_type n)
+    {
+      return reference(_seq, n);
+    }
+
+    const_reference operator[](difference_type n)  const
+    {
+      return const_reference(_seq, n);
+    }
+
+    bool check(bool set_err = false) const
+    {
+      int s = (int) size();
+      for (int i = 0; i < s; ++i) {
+	VALUE item = rb_ary_entry(_seq, i );
+	if (!swig::check<value_type>(item)) {
+	  if (set_err) {
+	    char msg[1024];
+	    sprintf(msg, "in sequence element %d", i);
+	    SWIG_Error(SWIG_RuntimeError, msg);
+	  }
+	  return false;
+	}
+      }
+      return true;
+    }
+
+  private:
+    VALUE  _seq;
+  };
+
+}
+
+
+namespace swig {
+  template <class RubySeq, class Seq>
+  inline void
+  assign(const RubySeq& rubyseq, Seq* seq) {
+    // seq->assign(rubyseq.begin(), rubyseq.end()); // not used as not always implemented
+    typedef typename RubySeq::value_type value_type;
+    typename RubySeq::const_iterator it = rubyseq.begin();
+    for (;it != rubyseq.end(); ++it) {
+      seq->insert(seq->end(),(value_type)(*it));
+    }
+  }
+
+  template <class Seq, class T = typename Seq::value_type >
+  struct traits_asptr_stdseq {
+    typedef Seq sequence;
+    typedef T value_type;
+
+    static int asptr(VALUE obj, sequence **seq) {
+      if (rb_obj_is_kind_of(obj, rb_cArray) == Qtrue) {
+	try {
+	  RubySequence_Cont<value_type> rubyseq(obj);
+	  if (seq) {
+	    sequence *pseq = new sequence();
+	    assign(rubyseq, pseq);
+	    *seq = pseq;
+	    return SWIG_NEWOBJ;
+	  } else {
+	    return rubyseq.check() ? SWIG_OK : SWIG_ERROR;
+	  }
+	} catch (std::exception& e) {
+	  if (seq) {
+	    VALUE lastErr = rb_gv_get("$!");
+	    if (lastErr == Qnil) {
+	      rb_raise(rb_eTypeError, "%s", e.what());
+	    }
+	  }
+	  return SWIG_ERROR;
+	}
+      } else {
+	sequence *p;
+	if (SWIG_ConvertPtr(obj,(void**)&p,
+			    swig::type_info<sequence>(),0) == SWIG_OK) {
+	  if (seq) *seq = p;
+	  return SWIG_OLDOBJ;
+	}
+      }
+      return SWIG_ERROR;
+    }
+  };
+
+  // Partial specialization for GC_VALUE's.  No need to typecheck each
+  // element.
+  template< class Seq >
+  struct traits_asptr_stdseq< Seq, swig::GC_VALUE > {
+    typedef Seq sequence;
+    typedef swig::GC_VALUE value_type;
+
+    static int asptr(VALUE obj, sequence **seq) {
+      if (rb_obj_is_kind_of(obj, rb_cArray) == Qtrue) {
+	try {
+	  if (seq) {
+	    RubySequence_Cont<value_type> rubyseq(obj);
+	    sequence *pseq = new sequence();
+	    assign(rubyseq, pseq);
+	    *seq = pseq;
+	    return SWIG_NEWOBJ;
+	  } else {
+	    return true;
+	  }
+	} catch (std::exception& e) {
+	  if (seq) {
+	    VALUE lastErr = rb_gv_get("$!");
+	    if (lastErr == Qnil) {
+	      rb_raise(rb_eTypeError, "%s", e.what());
+	    }
+	  }
+	  return SWIG_ERROR;
+	}
+      } else {
+	sequence *p;
+	if (SWIG_ConvertPtr(obj,(void**)&p,
+			    swig::type_info<sequence>(),0) == SWIG_OK) {
+	  if (seq) *seq = p;
+	  return SWIG_OLDOBJ;
+	}
+      }
+      return SWIG_ERROR;
+    }
+  };
+
+  template <class Seq, class T = typename Seq::value_type >
+  struct traits_from_stdseq {
+    typedef Seq sequence;
+    typedef T value_type;
+    typedef typename Seq::size_type size_type;
+    typedef typename sequence::const_iterator const_iterator;
+
+    static VALUE from(const sequence& seq) {
+
+
+
+
+
+
+      size_type size = seq.size();
+      if (size <= (size_type)INT_MAX) {
+	VALUE obj = rb_ary_new2((int)size);
+	int i = 0;
+	for (const_iterator it = seq.begin();
+	     it != seq.end(); ++it, ++i) {
+	  rb_ary_push(obj, swig::from< value_type >(*it));
+	}
+	rb_obj_freeze(obj);  // treat as immutable result
+	return obj;
+      } else {
+	rb_raise(rb_eRangeError,"sequence size not valid in ruby");
+	return Qnil;
+      }
+    }
+  };
+}
+
+
+  namespace swig {
+    template <class T>
+    struct traits_asptr<std::vector<T> >  {
+      static int asptr(VALUE obj, std::vector<T> **vec) {
+	return traits_asptr_stdseq<std::vector<T> >::asptr(obj, vec);
+      }
+    };
+    
+    template <class T>
+    struct traits_from<std::vector<T> > {
+      static VALUE from(const std::vector<T>& vec) {
+	return traits_from_stdseq<std::vector<T> >::from(vec);
+      }
+    };
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::vector<int, std::allocator< int > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::vector<" "int" "," "std::allocator< int >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg__dup(std::vector< int > *self){
+      return new std::vector<int,std::allocator< int > >(*self);
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg__inspect(std::vector< int > *self){
+      std::vector<int,std::allocator< int > >::const_iterator i = self->begin();
+      std::vector<int,std::allocator< int > >::const_iterator e = self->end();
+      const char *type_name = swig::type_name< std::vector<int,std::allocator< int > > >();
+      VALUE str = rb_str_new2(type_name);
+      str = rb_str_cat2( str, " [" );
+      bool comma = false;
+      VALUE tmp;
+      for ( ; i != e; ++i, comma = true )
+	{
+	  if (comma) str = rb_str_cat2( str, "," );
+	  tmp = swig::from< std::vector<int,std::allocator< int > >::value_type >( *i );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      str = rb_str_cat2( str, "]" );
+      return str;
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg__to_a(std::vector< int > *self){
+      std::vector<int,std::allocator< int > >::const_iterator i = self->begin();
+      std::vector<int,std::allocator< int > >::const_iterator e = self->end();
+      VALUE ary = rb_ary_new2( std::distance( i, e ) );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  tmp = swig::from< std::vector<int,std::allocator< int > >::value_type >( *i );
+	  rb_ary_push( ary, tmp );
+	}
+      return ary;
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg__to_s(std::vector< int > *self){
+      std::vector<int,std::allocator< int > >::iterator i = self->begin();
+      std::vector<int,std::allocator< int > >::iterator e = self->end();
+      VALUE str = rb_str_new2( "" );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  tmp = swig::from< std::vector<int,std::allocator< int > >::value_type >( *i );
+	  tmp = rb_obj_as_string( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      return str;
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg__slice(std::vector< int > *self,std::vector< int >::difference_type i,std::vector< int >::difference_type j){
+	if ( j <= 0 ) return Qnil;
+	std::size_t len = self->size();
+	if ( i < 0 ) i = len - i;
+	j += i;
+	if ( static_cast<std::size_t>(j) >= len ) j = len-1;
+
+	VALUE r = Qnil;
+	try {
+	  r = swig::from< const std::vector<int,std::allocator< int > >* >( swig::getslice(self, i, j) );
+	}
+	catch( std::out_of_range )
+	  {
+	  }
+	return r;
+      }
+SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg__each(std::vector< int > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::vector<int,std::allocator< int > >::const_iterator i = self->begin();
+	std::vector<int,std::allocator< int > >::const_iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from< std::vector<int,std::allocator< int > >::value_type >(*i);
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg__select(std::vector< int > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<int,std::allocator< int > >* r = new std::vector<int,std::allocator< int > >;
+      std::vector<int,std::allocator< int > >::const_iterator i = self->begin();
+      std::vector<int,std::allocator< int > >::const_iterator e = self->end();
+      for ( ; i != e; ++i )
+	{
+	  VALUE v = swig::from< std::vector<int,std::allocator< int > >::value_type >(*i);
+	  if ( RTEST( rb_yield(v) ) )
+	    self->insert( r->end(), *i);
+	}
+	
+      return r;
+    }
+SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg__reject_bang(std::vector< int > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<int,std::allocator< int > >::iterator i = self->begin();
+      std::vector<int,std::allocator< int > >::iterator e = self->end();
+      for ( ; i != e; )
+	{
+	  VALUE r = swig::from< std::vector<int,std::allocator< int > >::value_type >(*i);
+	  if ( RTEST( rb_yield(r) ) ) {
+	    self->erase(i++);
+            e = self->end();
+	  } else {
+	    ++i;
+          }
+	}
+	
+      return self;
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg__delete_at(std::vector< int > *self,std::vector< int >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	std::vector<int,std::allocator< int > >::iterator at = swig::getpos(self, i);
+	r = swig::from< std::vector<int,std::allocator< int > >::value_type >( *(at) );
+	self->erase(at); 
+      }
+      catch (std::out_of_range)
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg____delete2__(std::vector< int > *self,std::vector< int >::value_type const &i){
+      VALUE r = Qnil;
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg__pop(std::vector< int > *self){
+      if (self->empty()) return Qnil;
+      std::vector<int,std::allocator< int > >::value_type x = self->back();
+      self->pop_back();
+      return swig::from< std::vector<int,std::allocator< int > >::value_type >( x );
+    }
+SWIGINTERN std::vector< int >::value_type const std_vector_Sl_int_Sg__push(std::vector< int > *self,std::vector< int >::value_type const &e){
+      self->push_back( e );
+      return e;
+    }
+SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg__reject(std::vector< int > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<int,std::allocator< int > >* r = new std::vector<int,std::allocator< int > >;
+      std::remove_copy_if( self->begin(), self->end(),              
+			   std::back_inserter(*r),
+			   swig::yield< std::vector<int,std::allocator< int > >::value_type >() );
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg__at(std::vector< int > const *self,std::vector< int >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	r = swig::from< std::vector<int,std::allocator< int > >::value_type >( *(swig::cgetpos(self, i)) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg____getitem____SWIG_0(std::vector< int > const *self,std::vector< int >::difference_type i,std::vector< int >::difference_type j){
+      if ( j <= 0 ) return Qnil;
+      std::size_t len = self->size();
+      if ( i < 0 ) i = len - i;
+      j += i; if ( static_cast<std::size_t>(j) >= len ) j = len-1;
+
+      VALUE r = Qnil;
+      try {
+	r = swig::from< const std::vector<int,std::allocator< int > >* >( swig::getslice(self, i, j) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg____getitem____SWIG_1(std::vector< int > const *self,std::vector< int >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	r = swig::from< std::vector<int,std::allocator< int > >::value_type >( *(swig::cgetpos(self, i)) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg____getitem____SWIG_2(std::vector< int > const *self,VALUE i){
+      if ( rb_obj_is_kind_of( i, rb_cRange ) == Qfalse )
+	{
+	  rb_raise( rb_eTypeError, "not a valid index or range" );
+	}
+
+      VALUE r = Qnil;
+      static ID id_end   = rb_intern("end");
+      static ID id_start = rb_intern("begin");
+      static ID id_noend = rb_intern("exclude_end?");
+
+      VALUE start = rb_funcall( i, id_start, 0 );
+      VALUE end   = rb_funcall( i, id_end, 0 );
+      bool  noend = ( rb_funcall( i, id_noend, 0 ) == Qtrue );
+
+      int len = self->size();
+
+      int s = NUM2INT( start );
+      if ( s < 0 ) s = len + s;
+      else if ( s >= len ) return Qnil;
+
+      int e = NUM2INT( end );
+      if ( e < 0 ) e = len + e;
+
+      if ( e < s ) return Qnil; //std::swap( s, e );
+
+      if ( noend ) e -= 1;
+      if ( e >= len ) e = len - 1;
+
+      return swig::from< std::vector<int,std::allocator< int > >* >( swig::getslice(self, s, e+1) );
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg____setitem____SWIG_0(std::vector< int > *self,std::vector< int >::difference_type i,std::vector< int >::value_type const &x){
+	std::size_t len = self->size();
+	if ( i < 0 ) i = len - i;
+	else if ( static_cast<std::size_t>(i) >= len )
+	  self->resize( i+1, x );
+	else
+	  *(swig::getpos(self,i)) = x;
+
+	return swig::from< std::vector<int,std::allocator< int > >::value_type >( x );
+      }
+SWIGINTERN VALUE std_vector_Sl_int_Sg____setitem____SWIG_1(std::vector< int > *self,std::vector< int >::difference_type i,std::vector< int >::difference_type j,std::vector< int,std::allocator< int > > const &v){
+
+      if ( j <= 0 ) return Qnil;
+      std::size_t len = self->size();
+      if ( i < 0 ) i = len - i;
+      j += i; 
+      if ( static_cast<std::size_t>(j) >= len ) {
+	self->resize( j+1, *(v.begin()) );
+	j = len-1;
+      }
+
+      VALUE r = Qnil;
+      swig::setslice(self, i, j, v);
+      r = swig::from< const std::vector<int,std::allocator< int > >* >( &v );
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_int_Sg__shift(std::vector< int > *self){
+      if (self->empty()) return Qnil;
+      std::vector<int,std::allocator< int > >::value_type x = self->front();
+      self->erase( self->begin() );
+      return swig::from< std::vector<int,std::allocator< int > >::value_type >( x );
+    }
+SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg__insert__SWIG_0(std::vector< int > *self,std::vector< int >::difference_type pos,int argc,VALUE *argv,...){
+      std::size_t len = self->size();
+      std::size_t   i = swig::check_index( pos, len, true );
+      std::vector<int,std::allocator< int > >::iterator start;
+
+      VALUE elem = argv[0];
+      int idx = 0;
+      try {
+	std::vector<int,std::allocator< int > >::value_type val = swig::as<std::vector<int,std::allocator< int > >::value_type>( elem, true );
+	if ( i >= len ) {
+	  self->resize(i-1, val);
+	  return self;
+	}
+	start = self->begin();
+	std::advance( start, i );
+	self->insert( start++, val );
+
+	for ( ++idx; idx < argc; ++idx )
+	  {
+	    elem = argv[idx];
+	    val = swig::as<std::vector<int,std::allocator< int > >::value_type>( elem );
+	    self->insert( start++, val );
+	  }
+
+      } 
+      catch( std::invalid_argument )
+	{
+	  rb_raise( rb_eArgError, "%s",
+		    Ruby_Format_TypeError( "", 
+					   swig::type_name<std::vector<int,std::allocator< int > >::value_type>(),
+					   __FUNCTION__, idx+2, elem ));
+	}
+
+
+      return self;
+    }
+SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg__unshift(std::vector< int > *self,int argc,VALUE *argv,...){
+      for ( int idx = argc-1; idx >= 0; --idx )
+	{
+	  std::vector<int,std::allocator< int > >::iterator start = self->begin();
+	  VALUE elem = argv[idx];
+	  try {
+	    std::vector<int,std::allocator< int > >::value_type val = swig::as<std::vector<int,std::allocator< int > >::value_type>( elem, true );
+	    self->insert( start, val );
+	  }
+	  catch( std::invalid_argument )
+	    {
+	      rb_raise( rb_eArgError, "%s",
+			Ruby_Format_TypeError( "", 
+					       swig::type_name<std::vector<int,std::allocator< int > >::value_type>(),
+					       __FUNCTION__, idx+2, elem ));
+	    }
+	}
+
+      return self;
+    }
+
+SWIGINTERNINLINE VALUE
+SWIG_From_unsigned_SS_long  (unsigned long value)
+{
+  return ULONG2NUM(value); 
+}
+
+
+SWIGINTERNINLINE VALUE
+SWIG_From_size_t  (size_t value)
+{    
+  return SWIG_From_unsigned_SS_long  (static_cast< unsigned long >(value));
+}
+
+SWIGINTERN std::vector< int,std::allocator< int > > *std_vector_Sl_int_Sg__map_bang(std::vector< int > *self){
+
+    if ( !rb_block_given_p() )
+      rb_raise( rb_eArgError, "No block given" );
+
+    VALUE r = Qnil;
+    std::vector< int >::iterator i = self->begin();
+    std::vector< int >::iterator e = self->end();
+
+    try {
+      for ( ; i != e; ++i )
+	{
+	  r = swig::from< int >( *i );
+	  r = rb_yield( r );
+	  *i = swig::as< int >( r );
+	}
+    }
+    catch ( const std::invalid_argument& )
+      {
+	rb_raise(rb_eTypeError,
+		 "Yield block did not return a valid element for " "std::vector");
+      }
+    
+    return self;
+  }
+SWIGINTERN VALUE std_vector_Sl_int_Sg____delete__(std::vector< int > *self,int const &val){
+    VALUE r = Qnil;
+    std::vector<int >::iterator e = self->end();
+    std::vector<int >::iterator i = std::remove( self->begin(), e, val );
+    // remove dangling elements now
+    self->erase( i, e );
+    
+    if ( i != e )
+      r = swig::from< int >( val );
+    else if ( rb_block_given_p() )
+      r = rb_yield(Qnil);
+    return r;
+  }
+
+/*@SWIG:/usr/share/swig/2.0.4/ruby/rubyprimtypes.swg,19,%ruby_aux_method@*/
+SWIGINTERN VALUE SWIG_AUX_NUM2DBL(VALUE *args)
+{
+  VALUE obj = args[0];
+  VALUE type = TYPE(obj);
+  double *res = (double *)(args[1]);
+  *res = NUM2DBL(obj);
+  return obj;
+}
+/*@SWIG@*/
+
+SWIGINTERN int
+SWIG_AsVal_double (VALUE obj, double *val)
+{
+  VALUE type = TYPE(obj);
+  if ((type == T_FLOAT) || (type == T_FIXNUM) || (type == T_BIGNUM)) {
+    double v;
+    VALUE a[2];
+    a[0] = obj;
+    a[1] = (VALUE)(&v);
+    if (rb_rescue(RUBY_METHOD_FUNC(SWIG_AUX_NUM2DBL), (VALUE)a, RUBY_METHOD_FUNC(SWIG_ruby_failed), 0) != Qnil) {
+      if (val) *val = v;
+      return SWIG_OK;
+    }
+  }
+  return SWIG_TypeError;
+}
+
+
+  #define SWIG_From_double   rb_float_new 
+
+
+namespace swig {
+  template <> struct traits<double > {
+    typedef value_category category;
+    static const char* type_name() { return"double"; }
+  };  
+  template <>  struct traits_asval<double > {   
+    typedef double value_type;
+    static int asval(VALUE obj, value_type *val) { 
+      return SWIG_AsVal_double (obj, val);
+    }
+  };
+  template <>  struct traits_from<double > {
+    typedef double value_type;
+    static VALUE from(const value_type& val) {
+      return SWIG_From_double  (val);
+    }
+  };
+}
+
+
+      namespace swig {
+	template <>  struct traits<std::vector<double, std::allocator< double > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::vector<" "double" "," "std::allocator< double >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg__dup(std::vector< double > *self){
+      return new std::vector<double,std::allocator< double > >(*self);
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg__inspect(std::vector< double > *self){
+      std::vector<double,std::allocator< double > >::const_iterator i = self->begin();
+      std::vector<double,std::allocator< double > >::const_iterator e = self->end();
+      const char *type_name = swig::type_name< std::vector<double,std::allocator< double > > >();
+      VALUE str = rb_str_new2(type_name);
+      str = rb_str_cat2( str, " [" );
+      bool comma = false;
+      VALUE tmp;
+      for ( ; i != e; ++i, comma = true )
+	{
+	  if (comma) str = rb_str_cat2( str, "," );
+	  tmp = swig::from< std::vector<double,std::allocator< double > >::value_type >( *i );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      str = rb_str_cat2( str, "]" );
+      return str;
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg__to_a(std::vector< double > *self){
+      std::vector<double,std::allocator< double > >::const_iterator i = self->begin();
+      std::vector<double,std::allocator< double > >::const_iterator e = self->end();
+      VALUE ary = rb_ary_new2( std::distance( i, e ) );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  tmp = swig::from< std::vector<double,std::allocator< double > >::value_type >( *i );
+	  rb_ary_push( ary, tmp );
+	}
+      return ary;
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg__to_s(std::vector< double > *self){
+      std::vector<double,std::allocator< double > >::iterator i = self->begin();
+      std::vector<double,std::allocator< double > >::iterator e = self->end();
+      VALUE str = rb_str_new2( "" );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  tmp = swig::from< std::vector<double,std::allocator< double > >::value_type >( *i );
+	  tmp = rb_obj_as_string( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      return str;
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg__slice(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::difference_type j){
+	if ( j <= 0 ) return Qnil;
+	std::size_t len = self->size();
+	if ( i < 0 ) i = len - i;
+	j += i;
+	if ( static_cast<std::size_t>(j) >= len ) j = len-1;
+
+	VALUE r = Qnil;
+	try {
+	  r = swig::from< const std::vector<double,std::allocator< double > >* >( swig::getslice(self, i, j) );
+	}
+	catch( std::out_of_range )
+	  {
+	  }
+	return r;
+      }
+SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg__each(std::vector< double > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::vector<double,std::allocator< double > >::const_iterator i = self->begin();
+	std::vector<double,std::allocator< double > >::const_iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from< std::vector<double,std::allocator< double > >::value_type >(*i);
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg__select(std::vector< double > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<double,std::allocator< double > >* r = new std::vector<double,std::allocator< double > >;
+      std::vector<double,std::allocator< double > >::const_iterator i = self->begin();
+      std::vector<double,std::allocator< double > >::const_iterator e = self->end();
+      for ( ; i != e; ++i )
+	{
+	  VALUE v = swig::from< std::vector<double,std::allocator< double > >::value_type >(*i);
+	  if ( RTEST( rb_yield(v) ) )
+	    self->insert( r->end(), *i);
+	}
+	
+      return r;
+    }
+SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg__reject_bang(std::vector< double > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<double,std::allocator< double > >::iterator i = self->begin();
+      std::vector<double,std::allocator< double > >::iterator e = self->end();
+      for ( ; i != e; )
+	{
+	  VALUE r = swig::from< std::vector<double,std::allocator< double > >::value_type >(*i);
+	  if ( RTEST( rb_yield(r) ) ) {
+	    self->erase(i++);
+            e = self->end();
+	  } else {
+	    ++i;
+          }
+	}
+	
+      return self;
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg__delete_at(std::vector< double > *self,std::vector< double >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	std::vector<double,std::allocator< double > >::iterator at = swig::getpos(self, i);
+	r = swig::from< std::vector<double,std::allocator< double > >::value_type >( *(at) );
+	self->erase(at); 
+      }
+      catch (std::out_of_range)
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg____delete2__(std::vector< double > *self,std::vector< double >::value_type const &i){
+      VALUE r = Qnil;
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg__pop(std::vector< double > *self){
+      if (self->empty()) return Qnil;
+      std::vector<double,std::allocator< double > >::value_type x = self->back();
+      self->pop_back();
+      return swig::from< std::vector<double,std::allocator< double > >::value_type >( x );
+    }
+SWIGINTERN std::vector< double >::value_type const std_vector_Sl_double_Sg__push(std::vector< double > *self,std::vector< double >::value_type const &e){
+      self->push_back( e );
+      return e;
+    }
+SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg__reject(std::vector< double > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<double,std::allocator< double > >* r = new std::vector<double,std::allocator< double > >;
+      std::remove_copy_if( self->begin(), self->end(),              
+			   std::back_inserter(*r),
+			   swig::yield< std::vector<double,std::allocator< double > >::value_type >() );
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg__at(std::vector< double > const *self,std::vector< double >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	r = swig::from< std::vector<double,std::allocator< double > >::value_type >( *(swig::cgetpos(self, i)) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg____getitem____SWIG_0(std::vector< double > const *self,std::vector< double >::difference_type i,std::vector< double >::difference_type j){
+      if ( j <= 0 ) return Qnil;
+      std::size_t len = self->size();
+      if ( i < 0 ) i = len - i;
+      j += i; if ( static_cast<std::size_t>(j) >= len ) j = len-1;
+
+      VALUE r = Qnil;
+      try {
+	r = swig::from< const std::vector<double,std::allocator< double > >* >( swig::getslice(self, i, j) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg____getitem____SWIG_1(std::vector< double > const *self,std::vector< double >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	r = swig::from< std::vector<double,std::allocator< double > >::value_type >( *(swig::cgetpos(self, i)) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg____getitem____SWIG_2(std::vector< double > const *self,VALUE i){
+      if ( rb_obj_is_kind_of( i, rb_cRange ) == Qfalse )
+	{
+	  rb_raise( rb_eTypeError, "not a valid index or range" );
+	}
+
+      VALUE r = Qnil;
+      static ID id_end   = rb_intern("end");
+      static ID id_start = rb_intern("begin");
+      static ID id_noend = rb_intern("exclude_end?");
+
+      VALUE start = rb_funcall( i, id_start, 0 );
+      VALUE end   = rb_funcall( i, id_end, 0 );
+      bool  noend = ( rb_funcall( i, id_noend, 0 ) == Qtrue );
+
+      int len = self->size();
+
+      int s = NUM2INT( start );
+      if ( s < 0 ) s = len + s;
+      else if ( s >= len ) return Qnil;
+
+      int e = NUM2INT( end );
+      if ( e < 0 ) e = len + e;
+
+      if ( e < s ) return Qnil; //std::swap( s, e );
+
+      if ( noend ) e -= 1;
+      if ( e >= len ) e = len - 1;
+
+      return swig::from< std::vector<double,std::allocator< double > >* >( swig::getslice(self, s, e+1) );
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg____setitem____SWIG_0(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::value_type const &x){
+	std::size_t len = self->size();
+	if ( i < 0 ) i = len - i;
+	else if ( static_cast<std::size_t>(i) >= len )
+	  self->resize( i+1, x );
+	else
+	  *(swig::getpos(self,i)) = x;
+
+	return swig::from< std::vector<double,std::allocator< double > >::value_type >( x );
+      }
+SWIGINTERN VALUE std_vector_Sl_double_Sg____setitem____SWIG_1(std::vector< double > *self,std::vector< double >::difference_type i,std::vector< double >::difference_type j,std::vector< double,std::allocator< double > > const &v){
+
+      if ( j <= 0 ) return Qnil;
+      std::size_t len = self->size();
+      if ( i < 0 ) i = len - i;
+      j += i; 
+      if ( static_cast<std::size_t>(j) >= len ) {
+	self->resize( j+1, *(v.begin()) );
+	j = len-1;
+      }
+
+      VALUE r = Qnil;
+      swig::setslice(self, i, j, v);
+      r = swig::from< const std::vector<double,std::allocator< double > >* >( &v );
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_double_Sg__shift(std::vector< double > *self){
+      if (self->empty()) return Qnil;
+      std::vector<double,std::allocator< double > >::value_type x = self->front();
+      self->erase( self->begin() );
+      return swig::from< std::vector<double,std::allocator< double > >::value_type >( x );
+    }
+SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg__insert__SWIG_0(std::vector< double > *self,std::vector< double >::difference_type pos,int argc,VALUE *argv,...){
+      std::size_t len = self->size();
+      std::size_t   i = swig::check_index( pos, len, true );
+      std::vector<double,std::allocator< double > >::iterator start;
+
+      VALUE elem = argv[0];
+      int idx = 0;
+      try {
+	std::vector<double,std::allocator< double > >::value_type val = swig::as<std::vector<double,std::allocator< double > >::value_type>( elem, true );
+	if ( i >= len ) {
+	  self->resize(i-1, val);
+	  return self;
+	}
+	start = self->begin();
+	std::advance( start, i );
+	self->insert( start++, val );
+
+	for ( ++idx; idx < argc; ++idx )
+	  {
+	    elem = argv[idx];
+	    val = swig::as<std::vector<double,std::allocator< double > >::value_type>( elem );
+	    self->insert( start++, val );
+	  }
+
+      } 
+      catch( std::invalid_argument )
+	{
+	  rb_raise( rb_eArgError, "%s",
+		    Ruby_Format_TypeError( "", 
+					   swig::type_name<std::vector<double,std::allocator< double > >::value_type>(),
+					   __FUNCTION__, idx+2, elem ));
+	}
+
+
+      return self;
+    }
+SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg__unshift(std::vector< double > *self,int argc,VALUE *argv,...){
+      for ( int idx = argc-1; idx >= 0; --idx )
+	{
+	  std::vector<double,std::allocator< double > >::iterator start = self->begin();
+	  VALUE elem = argv[idx];
+	  try {
+	    std::vector<double,std::allocator< double > >::value_type val = swig::as<std::vector<double,std::allocator< double > >::value_type>( elem, true );
+	    self->insert( start, val );
+	  }
+	  catch( std::invalid_argument )
+	    {
+	      rb_raise( rb_eArgError, "%s",
+			Ruby_Format_TypeError( "", 
+					       swig::type_name<std::vector<double,std::allocator< double > >::value_type>(),
+					       __FUNCTION__, idx+2, elem ));
+	    }
+	}
+
+      return self;
+    }
+SWIGINTERN std::vector< double,std::allocator< double > > *std_vector_Sl_double_Sg__map_bang(std::vector< double > *self){
+
+    if ( !rb_block_given_p() )
+      rb_raise( rb_eArgError, "No block given" );
+
+    VALUE r = Qnil;
+    std::vector< double >::iterator i = self->begin();
+    std::vector< double >::iterator e = self->end();
+
+    try {
+      for ( ; i != e; ++i )
+	{
+	  r = swig::from< double >( *i );
+	  r = rb_yield( r );
+	  *i = swig::as< double >( r );
+	}
+    }
+    catch ( const std::invalid_argument& )
+      {
+	rb_raise(rb_eTypeError,
+		 "Yield block did not return a valid element for " "std::vector");
+      }
+    
+    return self;
+  }
+SWIGINTERN VALUE std_vector_Sl_double_Sg____delete__(std::vector< double > *self,double const &val){
+    VALUE r = Qnil;
+    std::vector<double >::iterator e = self->end();
+    std::vector<double >::iterator i = std::remove( self->begin(), e, val );
+    // remove dangling elements now
+    self->erase( i, e );
+    
+    if ( i != e )
+      r = swig::from< double >( val );
+    else if ( rb_block_given_p() )
+      r = rb_yield(Qnil);
+    return r;
+  }
+
+      namespace swig {
+	template <>  struct traits<std::vector<std::vector< double,std::allocator< double > >, std::allocator< std::vector< double,std::allocator< double > > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::vector<" "std::vector< double,std::allocator< double > >" "," "std::allocator< std::vector< double,std::allocator< double > > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *std_vector_Sl_std_vector_Sl_double_Sg__Sg__dup(std::vector< std::vector< double > > *self){
+      return new std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >(*self);
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg__inspect(std::vector< std::vector< double > > *self){
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::const_iterator i = self->begin();
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::const_iterator e = self->end();
+      const char *type_name = swig::type_name< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > >();
+      VALUE str = rb_str_new2(type_name);
+      str = rb_str_cat2( str, " [" );
+      bool comma = false;
+      VALUE tmp;
+      for ( ; i != e; ++i, comma = true )
+	{
+	  if (comma) str = rb_str_cat2( str, "," );
+	  tmp = swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >( *i );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      str = rb_str_cat2( str, "]" );
+      return str;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg__to_a(std::vector< std::vector< double > > *self){
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::const_iterator i = self->begin();
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::const_iterator e = self->end();
+      VALUE ary = rb_ary_new2( std::distance( i, e ) );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  tmp = swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >( *i );
+	  rb_ary_push( ary, tmp );
+	}
+      return ary;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg__to_s(std::vector< std::vector< double > > *self){
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::iterator i = self->begin();
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::iterator e = self->end();
+      VALUE str = rb_str_new2( "" );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  tmp = swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >( *i );
+	  tmp = rb_obj_as_string( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      return str;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg__slice(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::difference_type i,std::vector< std::vector< double > >::difference_type j){
+	if ( j <= 0 ) return Qnil;
+	std::size_t len = self->size();
+	if ( i < 0 ) i = len - i;
+	j += i;
+	if ( static_cast<std::size_t>(j) >= len ) j = len-1;
+
+	VALUE r = Qnil;
+	try {
+	  r = swig::from< const std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >* >( swig::getslice(self, i, j) );
+	}
+	catch( std::out_of_range )
+	  {
+	  }
+	return r;
+      }
+SWIGINTERN std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *std_vector_Sl_std_vector_Sl_double_Sg__Sg__each(std::vector< std::vector< double > > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::const_iterator i = self->begin();
+	std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::const_iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >(*i);
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *std_vector_Sl_std_vector_Sl_double_Sg__Sg__select(std::vector< std::vector< double > > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >* r = new std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >;
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::const_iterator i = self->begin();
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i )
+	{
+	  VALUE v = swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >(*i);
+	  if ( RTEST( rb_yield(v) ) )
+	    self->insert( r->end(), *i);
+	}
+	
+      return r;
+    }
+SWIGINTERN std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *std_vector_Sl_std_vector_Sl_double_Sg__Sg__reject_bang(std::vector< std::vector< double > > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::iterator i = self->begin();
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::iterator e = self->end();
+      for ( ; i != e; )
+	{
+	  VALUE r = swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >(*i);
+	  if ( RTEST( rb_yield(r) ) ) {
+	    self->erase(i++);
+            e = self->end();
+	  } else {
+	    ++i;
+          }
+	}
+	
+      return self;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg__delete_at(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::iterator at = swig::getpos(self, i);
+	r = swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >( *(at) );
+	self->erase(at); 
+      }
+      catch (std::out_of_range)
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg____delete2__(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::value_type const &i){
+      VALUE r = Qnil;
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg__pop(std::vector< std::vector< double > > *self){
+      if (self->empty()) return Qnil;
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type x = self->back();
+      self->pop_back();
+      return swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >( x );
+    }
+SWIGINTERN std::vector< std::vector< double > >::value_type const std_vector_Sl_std_vector_Sl_double_Sg__Sg__push(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::value_type const &e){
+      self->push_back( e );
+      return e;
+    }
+SWIGINTERN std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *std_vector_Sl_std_vector_Sl_double_Sg__Sg__reject(std::vector< std::vector< double > > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >* r = new std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >;
+      std::remove_copy_if( self->begin(), self->end(),              
+			   std::back_inserter(*r),
+			   swig::yield< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >() );
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg__at(std::vector< std::vector< double > > const *self,std::vector< std::vector< double > >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	r = swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >( *(swig::cgetpos(self, i)) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg____getitem____SWIG_0(std::vector< std::vector< double > > const *self,std::vector< std::vector< double > >::difference_type i,std::vector< std::vector< double > >::difference_type j){
+      if ( j <= 0 ) return Qnil;
+      std::size_t len = self->size();
+      if ( i < 0 ) i = len - i;
+      j += i; if ( static_cast<std::size_t>(j) >= len ) j = len-1;
+
+      VALUE r = Qnil;
+      try {
+	r = swig::from< const std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >* >( swig::getslice(self, i, j) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg____getitem____SWIG_1(std::vector< std::vector< double > > const *self,std::vector< std::vector< double > >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	r = swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >( *(swig::cgetpos(self, i)) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg____getitem____SWIG_2(std::vector< std::vector< double > > const *self,VALUE i){
+      if ( rb_obj_is_kind_of( i, rb_cRange ) == Qfalse )
+	{
+	  rb_raise( rb_eTypeError, "not a valid index or range" );
+	}
+
+      VALUE r = Qnil;
+      static ID id_end   = rb_intern("end");
+      static ID id_start = rb_intern("begin");
+      static ID id_noend = rb_intern("exclude_end?");
+
+      VALUE start = rb_funcall( i, id_start, 0 );
+      VALUE end   = rb_funcall( i, id_end, 0 );
+      bool  noend = ( rb_funcall( i, id_noend, 0 ) == Qtrue );
+
+      int len = self->size();
+
+      int s = NUM2INT( start );
+      if ( s < 0 ) s = len + s;
+      else if ( s >= len ) return Qnil;
+
+      int e = NUM2INT( end );
+      if ( e < 0 ) e = len + e;
+
+      if ( e < s ) return Qnil; //std::swap( s, e );
+
+      if ( noend ) e -= 1;
+      if ( e >= len ) e = len - 1;
+
+      return swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >* >( swig::getslice(self, s, e+1) );
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg____setitem____SWIG_0(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::difference_type i,std::vector< std::vector< double > >::value_type const &x){
+	std::size_t len = self->size();
+	if ( i < 0 ) i = len - i;
+	else if ( static_cast<std::size_t>(i) >= len )
+	  self->resize( i+1, x );
+	else
+	  *(swig::getpos(self,i)) = x;
+
+	return swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >( x );
+      }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg____setitem____SWIG_1(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::difference_type i,std::vector< std::vector< double > >::difference_type j,std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &v){
+
+      if ( j <= 0 ) return Qnil;
+      std::size_t len = self->size();
+      if ( i < 0 ) i = len - i;
+      j += i; 
+      if ( static_cast<std::size_t>(j) >= len ) {
+	self->resize( j+1, *(v.begin()) );
+	j = len-1;
+      }
+
+      VALUE r = Qnil;
+      swig::setslice(self, i, j, v);
+      r = swig::from< const std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >* >( &v );
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_vector_Sl_double_Sg__Sg__shift(std::vector< std::vector< double > > *self){
+      if (self->empty()) return Qnil;
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type x = self->front();
+      self->erase( self->begin() );
+      return swig::from< std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type >( x );
+    }
+SWIGINTERN std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *std_vector_Sl_std_vector_Sl_double_Sg__Sg__insert__SWIG_0(std::vector< std::vector< double > > *self,std::vector< std::vector< double > >::difference_type pos,int argc,VALUE *argv,...){
+      std::size_t len = self->size();
+      std::size_t   i = swig::check_index( pos, len, true );
+      std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::iterator start;
+
+      VALUE elem = argv[0];
+      int idx = 0;
+      try {
+	std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type val = swig::as<std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type>( elem, true );
+	if ( i >= len ) {
+	  self->resize(i-1, val);
+	  return self;
+	}
+	start = self->begin();
+	std::advance( start, i );
+	self->insert( start++, val );
+
+	for ( ++idx; idx < argc; ++idx )
+	  {
+	    elem = argv[idx];
+	    val = swig::as<std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type>( elem );
+	    self->insert( start++, val );
+	  }
+
+      } 
+      catch( std::invalid_argument )
+	{
+	  rb_raise( rb_eArgError, "%s",
+		    Ruby_Format_TypeError( "", 
+					   swig::type_name<std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type>(),
+					   __FUNCTION__, idx+2, elem ));
+	}
+
+
+      return self;
+    }
+SWIGINTERN std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *std_vector_Sl_std_vector_Sl_double_Sg__Sg__unshift(std::vector< std::vector< double > > *self,int argc,VALUE *argv,...){
+      for ( int idx = argc-1; idx >= 0; --idx )
+	{
+	  std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::iterator start = self->begin();
+	  VALUE elem = argv[idx];
+	  try {
+	    std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type val = swig::as<std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type>( elem, true );
+	    self->insert( start, val );
+	  }
+	  catch( std::invalid_argument )
+	    {
+	      rb_raise( rb_eArgError, "%s",
+			Ruby_Format_TypeError( "", 
+					       swig::type_name<std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >::value_type>(),
+					       __FUNCTION__, idx+2, elem ));
+	    }
+	}
+
+      return self;
+    }
+
+SWIGINTERN swig_type_info*
+SWIG_pchar_descriptor(void)
+{
+  static int init = 0;
+  static swig_type_info* info = 0;
+  if (!init) {
+    info = SWIG_TypeQuery("_p_char");
+    init = 1;
+  }
+  return info;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharPtrAndSize(VALUE obj, char** cptr, size_t* psize, int *alloc)
+{
+  if (TYPE(obj) == T_STRING) {
+    #if defined(StringValuePtr)
+    char *cstr = StringValuePtr(obj); 
+    #else
+    char *cstr = STR2CSTR(obj);
+    #endif
+    size_t size = RSTRING_LEN(obj) + 1;
+    if (cptr)  {
+      if (alloc) {
+	if (*alloc == SWIG_NEWOBJ) {
+	  *cptr = reinterpret_cast< char* >(memcpy((new char[size]), cstr, sizeof(char)*(size)));
+	} else {
+	  *cptr = cstr;
+	  *alloc = SWIG_OLDOBJ;
+	}
+      }
+    }
+    if (psize) *psize = size;
+    return SWIG_OK;
+  } else {
+    swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+    if (pchar_descriptor) {
+      void* vptr = 0;
+      if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
+	if (cptr) *cptr = (char *)vptr;
+	if (psize) *psize = vptr ? (strlen((char*)vptr) + 1) : 0;
+	if (alloc) *alloc = SWIG_OLDOBJ;
+	return SWIG_OK;
+      }
+    }
+  }  
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsPtr_std_string (VALUE obj, std::string **val) 
+{
+  char* buf = 0 ; size_t size = 0; int alloc = SWIG_OLDOBJ;
+  if (SWIG_IsOK((SWIG_AsCharPtrAndSize(obj, &buf, &size, &alloc)))) {
+    if (buf) {
+      if (val) *val = new std::string(buf, size - 1);
+      if (alloc == SWIG_NEWOBJ) delete[] buf;
+      return SWIG_NEWOBJ;
+    } else {
+      if (val) *val = 0;
+      return SWIG_OLDOBJ;
+    }
+  } else {
+    static int init = 0;
+    static swig_type_info* descriptor = 0;
+    if (!init) {
+      descriptor = SWIG_TypeQuery("std::string" " *");
+      init = 1;
+    }
+    if (descriptor) {
+      std::string *vptr;
+      int res = SWIG_ConvertPtr(obj, (void**)&vptr, descriptor, 0);
+      if (SWIG_IsOK(res) && val) *val = vptr;
+      return res;
+    }
+  }
+  return SWIG_ERROR;
+}
+
+
+SWIGINTERN int
+SWIG_AsVal_std_string (VALUE obj, std::string *val)
+{
+  std::string* v = (std::string *) 0;
+  int res = SWIG_AsPtr_std_string (obj, &v);
+  if (!SWIG_IsOK(res)) return res;
+  if (v) {
+    if (val) *val = *v;
+    if (SWIG_IsNewObj(res)) {
+      delete v;
+      res = SWIG_DelNewMask(res);
+    }
+    return res;
+  }
+  return SWIG_ERROR;
+}
+
+
+SWIGINTERNINLINE VALUE 
+SWIG_FromCharPtrAndSize(const char* carray, size_t size)
+{
+  if (carray) {
+    if (size > LONG_MAX) {
+      swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
+      return pchar_descriptor ? 
+	SWIG_NewPointerObj(const_cast< char * >(carray), pchar_descriptor, 0) : Qnil;
+    } else {
+      return rb_str_new(carray, static_cast< long >(size));
+    }
+  } else {
+    return Qnil;
+  }
+}
+
+
+SWIGINTERNINLINE VALUE
+SWIG_From_std_string  (const std::string& s)
+{
+  return SWIG_FromCharPtrAndSize(s.data(), s.size());
+}
+
+
+namespace swig {
+  template <> struct traits<std::string > {
+    typedef value_category category;
+    static const char* type_name() { return"std::string"; }
+  };  
+  template <>  struct traits_asval<std::string > {   
+    typedef std::string value_type;
+    static int asval(VALUE obj, value_type *val) { 
+      return SWIG_AsVal_std_string (obj, val);
+    }
+  };
+  template <>  struct traits_from<std::string > {
+    typedef std::string value_type;
+    static VALUE from(const value_type& val) {
+      return SWIG_From_std_string  (val);
+    }
+  };
+}
+
+
+      namespace swig {
+	template <>  struct traits<std::vector<std::string, std::allocator< std::string > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::vector<" "std::string" "," "std::allocator< std::string >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg__dup(std::vector< std::string > *self){
+      return new std::vector<std::string,std::allocator< std::string > >(*self);
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg__inspect(std::vector< std::string > *self){
+      std::vector<std::string,std::allocator< std::string > >::const_iterator i = self->begin();
+      std::vector<std::string,std::allocator< std::string > >::const_iterator e = self->end();
+      const char *type_name = swig::type_name< std::vector<std::string,std::allocator< std::string > > >();
+      VALUE str = rb_str_new2(type_name);
+      str = rb_str_cat2( str, " [" );
+      bool comma = false;
+      VALUE tmp;
+      for ( ; i != e; ++i, comma = true )
+	{
+	  if (comma) str = rb_str_cat2( str, "," );
+	  tmp = swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >( *i );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      str = rb_str_cat2( str, "]" );
+      return str;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg__to_a(std::vector< std::string > *self){
+      std::vector<std::string,std::allocator< std::string > >::const_iterator i = self->begin();
+      std::vector<std::string,std::allocator< std::string > >::const_iterator e = self->end();
+      VALUE ary = rb_ary_new2( std::distance( i, e ) );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  tmp = swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >( *i );
+	  rb_ary_push( ary, tmp );
+	}
+      return ary;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg__to_s(std::vector< std::string > *self){
+      std::vector<std::string,std::allocator< std::string > >::iterator i = self->begin();
+      std::vector<std::string,std::allocator< std::string > >::iterator e = self->end();
+      VALUE str = rb_str_new2( "" );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  tmp = swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >( *i );
+	  tmp = rb_obj_as_string( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      return str;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg__slice(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j){
+	if ( j <= 0 ) return Qnil;
+	std::size_t len = self->size();
+	if ( i < 0 ) i = len - i;
+	j += i;
+	if ( static_cast<std::size_t>(j) >= len ) j = len-1;
+
+	VALUE r = Qnil;
+	try {
+	  r = swig::from< const std::vector<std::string,std::allocator< std::string > >* >( swig::getslice(self, i, j) );
+	}
+	catch( std::out_of_range )
+	  {
+	  }
+	return r;
+      }
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg__each(std::vector< std::string > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::vector<std::string,std::allocator< std::string > >::const_iterator i = self->begin();
+	std::vector<std::string,std::allocator< std::string > >::const_iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >(*i);
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg__select(std::vector< std::string > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<std::string,std::allocator< std::string > >* r = new std::vector<std::string,std::allocator< std::string > >;
+      std::vector<std::string,std::allocator< std::string > >::const_iterator i = self->begin();
+      std::vector<std::string,std::allocator< std::string > >::const_iterator e = self->end();
+      for ( ; i != e; ++i )
+	{
+	  VALUE v = swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >(*i);
+	  if ( RTEST( rb_yield(v) ) )
+	    self->insert( r->end(), *i);
+	}
+	
+      return r;
+    }
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg__reject_bang(std::vector< std::string > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<std::string,std::allocator< std::string > >::iterator i = self->begin();
+      std::vector<std::string,std::allocator< std::string > >::iterator e = self->end();
+      for ( ; i != e; )
+	{
+	  VALUE r = swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >(*i);
+	  if ( RTEST( rb_yield(r) ) ) {
+	    self->erase(i++);
+            e = self->end();
+	  } else {
+	    ++i;
+          }
+	}
+	
+      return self;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg__delete_at(std::vector< std::string > *self,std::vector< std::string >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	std::vector<std::string,std::allocator< std::string > >::iterator at = swig::getpos(self, i);
+	r = swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >( *(at) );
+	self->erase(at); 
+      }
+      catch (std::out_of_range)
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg____delete2__(std::vector< std::string > *self,std::vector< std::string >::value_type const &i){
+      VALUE r = Qnil;
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg__pop(std::vector< std::string > *self){
+      if (self->empty()) return Qnil;
+      std::vector<std::string,std::allocator< std::string > >::value_type x = self->back();
+      self->pop_back();
+      return swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >( x );
+    }
+SWIGINTERN std::vector< std::string >::value_type const std_vector_Sl_std_string_Sg__push(std::vector< std::string > *self,std::vector< std::string >::value_type const &e){
+      self->push_back( e );
+      return e;
+    }
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg__reject(std::vector< std::string > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<std::string,std::allocator< std::string > >* r = new std::vector<std::string,std::allocator< std::string > >;
+      std::remove_copy_if( self->begin(), self->end(),              
+			   std::back_inserter(*r),
+			   swig::yield< std::vector<std::string,std::allocator< std::string > >::value_type >() );
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg__at(std::vector< std::string > const *self,std::vector< std::string >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	r = swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >( *(swig::cgetpos(self, i)) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg____getitem____SWIG_0(std::vector< std::string > const *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j){
+      if ( j <= 0 ) return Qnil;
+      std::size_t len = self->size();
+      if ( i < 0 ) i = len - i;
+      j += i; if ( static_cast<std::size_t>(j) >= len ) j = len-1;
+
+      VALUE r = Qnil;
+      try {
+	r = swig::from< const std::vector<std::string,std::allocator< std::string > >* >( swig::getslice(self, i, j) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg____getitem____SWIG_1(std::vector< std::string > const *self,std::vector< std::string >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	r = swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >( *(swig::cgetpos(self, i)) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg____getitem____SWIG_2(std::vector< std::string > const *self,VALUE i){
+      if ( rb_obj_is_kind_of( i, rb_cRange ) == Qfalse )
+	{
+	  rb_raise( rb_eTypeError, "not a valid index or range" );
+	}
+
+      VALUE r = Qnil;
+      static ID id_end   = rb_intern("end");
+      static ID id_start = rb_intern("begin");
+      static ID id_noend = rb_intern("exclude_end?");
+
+      VALUE start = rb_funcall( i, id_start, 0 );
+      VALUE end   = rb_funcall( i, id_end, 0 );
+      bool  noend = ( rb_funcall( i, id_noend, 0 ) == Qtrue );
+
+      int len = self->size();
+
+      int s = NUM2INT( start );
+      if ( s < 0 ) s = len + s;
+      else if ( s >= len ) return Qnil;
+
+      int e = NUM2INT( end );
+      if ( e < 0 ) e = len + e;
+
+      if ( e < s ) return Qnil; //std::swap( s, e );
+
+      if ( noend ) e -= 1;
+      if ( e >= len ) e = len - 1;
+
+      return swig::from< std::vector<std::string,std::allocator< std::string > >* >( swig::getslice(self, s, e+1) );
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg____setitem____SWIG_0(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::value_type const &x){
+	std::size_t len = self->size();
+	if ( i < 0 ) i = len - i;
+	else if ( static_cast<std::size_t>(i) >= len )
+	  self->resize( i+1, x );
+	else
+	  *(swig::getpos(self,i)) = x;
+
+	return swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >( x );
+      }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg____setitem____SWIG_1(std::vector< std::string > *self,std::vector< std::string >::difference_type i,std::vector< std::string >::difference_type j,std::vector< std::string,std::allocator< std::string > > const &v){
+
+      if ( j <= 0 ) return Qnil;
+      std::size_t len = self->size();
+      if ( i < 0 ) i = len - i;
+      j += i; 
+      if ( static_cast<std::size_t>(j) >= len ) {
+	self->resize( j+1, *(v.begin()) );
+	j = len-1;
+      }
+
+      VALUE r = Qnil;
+      swig::setslice(self, i, j, v);
+      r = swig::from< const std::vector<std::string,std::allocator< std::string > >* >( &v );
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg__shift(std::vector< std::string > *self){
+      if (self->empty()) return Qnil;
+      std::vector<std::string,std::allocator< std::string > >::value_type x = self->front();
+      self->erase( self->begin() );
+      return swig::from< std::vector<std::string,std::allocator< std::string > >::value_type >( x );
+    }
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg__insert__SWIG_0(std::vector< std::string > *self,std::vector< std::string >::difference_type pos,int argc,VALUE *argv,...){
+      std::size_t len = self->size();
+      std::size_t   i = swig::check_index( pos, len, true );
+      std::vector<std::string,std::allocator< std::string > >::iterator start;
+
+      VALUE elem = argv[0];
+      int idx = 0;
+      try {
+	std::vector<std::string,std::allocator< std::string > >::value_type val = swig::as<std::vector<std::string,std::allocator< std::string > >::value_type>( elem, true );
+	if ( i >= len ) {
+	  self->resize(i-1, val);
+	  return self;
+	}
+	start = self->begin();
+	std::advance( start, i );
+	self->insert( start++, val );
+
+	for ( ++idx; idx < argc; ++idx )
+	  {
+	    elem = argv[idx];
+	    val = swig::as<std::vector<std::string,std::allocator< std::string > >::value_type>( elem );
+	    self->insert( start++, val );
+	  }
+
+      } 
+      catch( std::invalid_argument )
+	{
+	  rb_raise( rb_eArgError, "%s",
+		    Ruby_Format_TypeError( "", 
+					   swig::type_name<std::vector<std::string,std::allocator< std::string > >::value_type>(),
+					   __FUNCTION__, idx+2, elem ));
+	}
+
+
+      return self;
+    }
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg__unshift(std::vector< std::string > *self,int argc,VALUE *argv,...){
+      for ( int idx = argc-1; idx >= 0; --idx )
+	{
+	  std::vector<std::string,std::allocator< std::string > >::iterator start = self->begin();
+	  VALUE elem = argv[idx];
+	  try {
+	    std::vector<std::string,std::allocator< std::string > >::value_type val = swig::as<std::vector<std::string,std::allocator< std::string > >::value_type>( elem, true );
+	    self->insert( start, val );
+	  }
+	  catch( std::invalid_argument )
+	    {
+	      rb_raise( rb_eArgError, "%s",
+			Ruby_Format_TypeError( "", 
+					       swig::type_name<std::vector<std::string,std::allocator< std::string > >::value_type>(),
+					       __FUNCTION__, idx+2, elem ));
+	    }
+	}
+
+      return self;
+    }
+SWIGINTERN std::vector< std::string,std::allocator< std::string > > *std_vector_Sl_std_string_Sg__map_bang(std::vector< std::string > *self){
+
+    if ( !rb_block_given_p() )
+      rb_raise( rb_eArgError, "No block given" );
+
+    VALUE r = Qnil;
+    std::vector< std::string >::iterator i = self->begin();
+    std::vector< std::string >::iterator e = self->end();
+
+    try {
+      for ( ; i != e; ++i )
+	{
+	  r = swig::from< std::string >( *i );
+	  r = rb_yield( r );
+	  *i = swig::as< std::string >( r );
+	}
+    }
+    catch ( const std::invalid_argument& )
+      {
+	rb_raise(rb_eTypeError,
+		 "Yield block did not return a valid element for " "std::vector");
+      }
+    
+    return self;
+  }
+SWIGINTERN VALUE std_vector_Sl_std_string_Sg____delete__(std::vector< std::string > *self,std::string const &val){
+    VALUE r = Qnil;
+    std::vector<std::string >::iterator e = self->end();
+    std::vector<std::string >::iterator i = std::remove( self->begin(), e, val );
+    // remove dangling elements now
+    self->erase( i, e );
+    
+    if ( i != e )
+      r = swig::from< std::string >( val );
+    else if ( rb_block_given_p() )
+      r = rb_yield(Qnil);
+    return r;
+  }
+
+  namespace swig {
+    template <>  struct traits<CdiVariable > {
+      typedef pointer_category category;
+      static const char* type_name() { return"CdiVariable"; }
+    };
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::vector<CdiVariable, std::allocator< CdiVariable > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::vector<" "CdiVariable" "," "std::allocator< CdiVariable >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN std::vector< CdiVariable,std::allocator< CdiVariable > > *std_vector_Sl_CdiVariable_Sg__dup(std::vector< CdiVariable > *self){
+      return new std::vector<CdiVariable,std::allocator< CdiVariable > >(*self);
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg__inspect(std::vector< CdiVariable > *self){
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::const_iterator i = self->begin();
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::const_iterator e = self->end();
+      const char *type_name = swig::type_name< std::vector<CdiVariable,std::allocator< CdiVariable > > >();
+      VALUE str = rb_str_new2(type_name);
+      str = rb_str_cat2( str, " [" );
+      bool comma = false;
+      VALUE tmp;
+      for ( ; i != e; ++i, comma = true )
+	{
+	  if (comma) str = rb_str_cat2( str, "," );
+	  tmp = swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >( *i );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      str = rb_str_cat2( str, "]" );
+      return str;
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg__to_a(std::vector< CdiVariable > *self){
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::const_iterator i = self->begin();
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::const_iterator e = self->end();
+      VALUE ary = rb_ary_new2( std::distance( i, e ) );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  tmp = swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >( *i );
+	  rb_ary_push( ary, tmp );
+	}
+      return ary;
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg__to_s(std::vector< CdiVariable > *self){
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::iterator i = self->begin();
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::iterator e = self->end();
+      VALUE str = rb_str_new2( "" );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  tmp = swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >( *i );
+	  tmp = rb_obj_as_string( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      return str;
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg__slice(std::vector< CdiVariable > *self,std::vector< CdiVariable >::difference_type i,std::vector< CdiVariable >::difference_type j){
+	if ( j <= 0 ) return Qnil;
+	std::size_t len = self->size();
+	if ( i < 0 ) i = len - i;
+	j += i;
+	if ( static_cast<std::size_t>(j) >= len ) j = len-1;
+
+	VALUE r = Qnil;
+	try {
+	  r = swig::from< const std::vector<CdiVariable,std::allocator< CdiVariable > >* >( swig::getslice(self, i, j) );
+	}
+	catch( std::out_of_range )
+	  {
+	  }
+	return r;
+      }
+SWIGINTERN std::vector< CdiVariable,std::allocator< CdiVariable > > *std_vector_Sl_CdiVariable_Sg__each(std::vector< CdiVariable > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::vector<CdiVariable,std::allocator< CdiVariable > >::const_iterator i = self->begin();
+	std::vector<CdiVariable,std::allocator< CdiVariable > >::const_iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >(*i);
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN std::vector< CdiVariable,std::allocator< CdiVariable > > *std_vector_Sl_CdiVariable_Sg__select(std::vector< CdiVariable > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<CdiVariable,std::allocator< CdiVariable > >* r = new std::vector<CdiVariable,std::allocator< CdiVariable > >;
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::const_iterator i = self->begin();
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::const_iterator e = self->end();
+      for ( ; i != e; ++i )
+	{
+	  VALUE v = swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >(*i);
+	  if ( RTEST( rb_yield(v) ) )
+	    self->insert( r->end(), *i);
+	}
+	
+      return r;
+    }
+SWIGINTERN std::vector< CdiVariable,std::allocator< CdiVariable > > *std_vector_Sl_CdiVariable_Sg__reject_bang(std::vector< CdiVariable > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::iterator i = self->begin();
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::iterator e = self->end();
+      for ( ; i != e; )
+	{
+	  VALUE r = swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >(*i);
+	  if ( RTEST( rb_yield(r) ) ) {
+	    self->erase(i++);
+            e = self->end();
+	  } else {
+	    ++i;
+          }
+	}
+	
+      return self;
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg__delete_at(std::vector< CdiVariable > *self,std::vector< CdiVariable >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	std::vector<CdiVariable,std::allocator< CdiVariable > >::iterator at = swig::getpos(self, i);
+	r = swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >( *(at) );
+	self->erase(at); 
+      }
+      catch (std::out_of_range)
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg____delete2__(std::vector< CdiVariable > *self,std::vector< CdiVariable >::value_type const &i){
+      VALUE r = Qnil;
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg__pop(std::vector< CdiVariable > *self){
+      if (self->empty()) return Qnil;
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type x = self->back();
+      self->pop_back();
+      return swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >( x );
+    }
+SWIGINTERN std::vector< CdiVariable >::value_type const std_vector_Sl_CdiVariable_Sg__push(std::vector< CdiVariable > *self,std::vector< CdiVariable >::value_type const &e){
+      self->push_back( e );
+      return e;
+    }
+SWIGINTERN std::vector< CdiVariable,std::allocator< CdiVariable > > *std_vector_Sl_CdiVariable_Sg__reject(std::vector< CdiVariable > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::vector<CdiVariable,std::allocator< CdiVariable > >* r = new std::vector<CdiVariable,std::allocator< CdiVariable > >;
+      std::remove_copy_if( self->begin(), self->end(),              
+			   std::back_inserter(*r),
+			   swig::yield< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >() );
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg__at(std::vector< CdiVariable > const *self,std::vector< CdiVariable >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	r = swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >( *(swig::cgetpos(self, i)) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg____getitem____SWIG_0(std::vector< CdiVariable > const *self,std::vector< CdiVariable >::difference_type i,std::vector< CdiVariable >::difference_type j){
+      if ( j <= 0 ) return Qnil;
+      std::size_t len = self->size();
+      if ( i < 0 ) i = len - i;
+      j += i; if ( static_cast<std::size_t>(j) >= len ) j = len-1;
+
+      VALUE r = Qnil;
+      try {
+	r = swig::from< const std::vector<CdiVariable,std::allocator< CdiVariable > >* >( swig::getslice(self, i, j) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg____getitem____SWIG_1(std::vector< CdiVariable > const *self,std::vector< CdiVariable >::difference_type i){
+      VALUE r = Qnil;
+      try {
+	r = swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >( *(swig::cgetpos(self, i)) );
+      }
+      catch( std::out_of_range )
+	{
+	}
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg____getitem____SWIG_2(std::vector< CdiVariable > const *self,VALUE i){
+      if ( rb_obj_is_kind_of( i, rb_cRange ) == Qfalse )
+	{
+	  rb_raise( rb_eTypeError, "not a valid index or range" );
+	}
+
+      VALUE r = Qnil;
+      static ID id_end   = rb_intern("end");
+      static ID id_start = rb_intern("begin");
+      static ID id_noend = rb_intern("exclude_end?");
+
+      VALUE start = rb_funcall( i, id_start, 0 );
+      VALUE end   = rb_funcall( i, id_end, 0 );
+      bool  noend = ( rb_funcall( i, id_noend, 0 ) == Qtrue );
+
+      int len = self->size();
+
+      int s = NUM2INT( start );
+      if ( s < 0 ) s = len + s;
+      else if ( s >= len ) return Qnil;
+
+      int e = NUM2INT( end );
+      if ( e < 0 ) e = len + e;
+
+      if ( e < s ) return Qnil; //std::swap( s, e );
+
+      if ( noend ) e -= 1;
+      if ( e >= len ) e = len - 1;
+
+      return swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >* >( swig::getslice(self, s, e+1) );
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg____setitem____SWIG_0(std::vector< CdiVariable > *self,std::vector< CdiVariable >::difference_type i,std::vector< CdiVariable >::value_type const &x){
+	std::size_t len = self->size();
+	if ( i < 0 ) i = len - i;
+	else if ( static_cast<std::size_t>(i) >= len )
+	  self->resize( i+1, x );
+	else
+	  *(swig::getpos(self,i)) = x;
+
+	return swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >( x );
+      }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg____setitem____SWIG_1(std::vector< CdiVariable > *self,std::vector< CdiVariable >::difference_type i,std::vector< CdiVariable >::difference_type j,std::vector< CdiVariable,std::allocator< CdiVariable > > const &v){
+
+      if ( j <= 0 ) return Qnil;
+      std::size_t len = self->size();
+      if ( i < 0 ) i = len - i;
+      j += i; 
+      if ( static_cast<std::size_t>(j) >= len ) {
+	self->resize( j+1, *(v.begin()) );
+	j = len-1;
+      }
+
+      VALUE r = Qnil;
+      swig::setslice(self, i, j, v);
+      r = swig::from< const std::vector<CdiVariable,std::allocator< CdiVariable > >* >( &v );
+      return r;
+    }
+SWIGINTERN VALUE std_vector_Sl_CdiVariable_Sg__shift(std::vector< CdiVariable > *self){
+      if (self->empty()) return Qnil;
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type x = self->front();
+      self->erase( self->begin() );
+      return swig::from< std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type >( x );
+    }
+SWIGINTERN std::vector< CdiVariable,std::allocator< CdiVariable > > *std_vector_Sl_CdiVariable_Sg__insert__SWIG_0(std::vector< CdiVariable > *self,std::vector< CdiVariable >::difference_type pos,int argc,VALUE *argv,...){
+      std::size_t len = self->size();
+      std::size_t   i = swig::check_index( pos, len, true );
+      std::vector<CdiVariable,std::allocator< CdiVariable > >::iterator start;
+
+      VALUE elem = argv[0];
+      int idx = 0;
+      try {
+	std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type val = swig::as<std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type>( elem, true );
+	if ( i >= len ) {
+	  self->resize(i-1, val);
+	  return self;
+	}
+	start = self->begin();
+	std::advance( start, i );
+	self->insert( start++, val );
+
+	for ( ++idx; idx < argc; ++idx )
+	  {
+	    elem = argv[idx];
+	    val = swig::as<std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type>( elem );
+	    self->insert( start++, val );
+	  }
+
+      } 
+      catch( std::invalid_argument )
+	{
+	  rb_raise( rb_eArgError, "%s",
+		    Ruby_Format_TypeError( "", 
+					   swig::type_name<std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type>(),
+					   __FUNCTION__, idx+2, elem ));
+	}
+
+
+      return self;
+    }
+SWIGINTERN std::vector< CdiVariable,std::allocator< CdiVariable > > *std_vector_Sl_CdiVariable_Sg__unshift(std::vector< CdiVariable > *self,int argc,VALUE *argv,...){
+      for ( int idx = argc-1; idx >= 0; --idx )
+	{
+	  std::vector<CdiVariable,std::allocator< CdiVariable > >::iterator start = self->begin();
+	  VALUE elem = argv[idx];
+	  try {
+	    std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type val = swig::as<std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type>( elem, true );
+	    self->insert( start, val );
+	  }
+	  catch( std::invalid_argument )
+	    {
+	      rb_raise( rb_eArgError, "%s",
+			Ruby_Format_TypeError( "", 
+					       swig::type_name<std::vector<CdiVariable,std::allocator< CdiVariable > >::value_type>(),
+					       __FUNCTION__, idx+2, elem ));
+	    }
+	}
+
+      return self;
+    }
+
+  namespace swig {
+
+    template <class T, class U >
+    struct traits_asval<std::pair<T,U> >  {
+      typedef std::pair<T,U> value_type;
+
+      static int get_pair(VALUE first, VALUE second,
+			  std::pair<T,U> *val)
+      {
+	if (val) {
+	  T *pfirst = &(val->first);
+	  int res1 = swig::asval((VALUE)first, pfirst);
+	  if (!SWIG_IsOK(res1)) return res1;
+	  U *psecond = &(val->second);
+	  int res2 = swig::asval((VALUE)second, psecond);
+	  if (!SWIG_IsOK(res2)) return res2;
+	  return res1 > res2 ? res1 : res2;
+	} else {
+	  T *pfirst = 0;
+	  int res1 = swig::asval((VALUE)first, pfirst);
+	  if (!SWIG_IsOK(res1)) return res1;
+	  U *psecond = 0;
+	  int res2 = swig::asval((VALUE)second, psecond);
+	  if (!SWIG_IsOK(res2)) return res2;
+	  return res1 > res2 ? res1 : res2;
+	}	
+      }
+
+      static int asval(VALUE obj, std::pair<T,U> *val) {
+	int res = SWIG_ERROR;
+	if ( TYPE(obj) == T_ARRAY ) {
+	  if (RARRAY_LEN(obj) == 2) {
+	    VALUE first = rb_ary_entry(obj,0);
+	    VALUE second = rb_ary_entry(obj,1);
+	    res = get_pair(first, second, val);
+	  }
+	} else {
+	  value_type *p;
+	  res = SWIG_ConvertPtr(obj,(void**)&p,
+				swig::type_info<value_type>(),0);
+	  if (SWIG_IsOK(res) && val)  *val = *p;
+	}
+	return res;
+      }
+    };
+
+    template <class T, class U >
+    struct traits_asptr<std::pair<T,U> >  {
+      typedef std::pair<T,U> value_type;
+
+      static int get_pair(VALUE first, VALUE second,
+			  std::pair<T,U> **val) 
+      {
+	if (val) {
+	  value_type *vp = (new std::pair<T,U>);
+	  T *pfirst = &(vp->first);
+	  int res1 = swig::asval((VALUE)first, pfirst);
+	  if (!SWIG_IsOK(res1)) return res1;
+	  U *psecond = &(vp->second);
+	  int res2 = swig::asval((VALUE)second, psecond);
+	  if (!SWIG_IsOK(res2)) return res2;
+	  *val = vp;
+	  return SWIG_AddNewMask(res1 > res2 ? res1 : res2);
+	} else {
+	  T *pfirst = 0;
+	  int res1 = swig::asval((VALUE)first, pfirst);
+	  if (!SWIG_IsOK(res1)) return res1;
+	  U *psecond = 0;
+	  int res2 = swig::asval((VALUE)second, psecond);
+	  if (!SWIG_IsOK(res2)) return res2;
+	  return res1 > res2 ? res1 : res2;
+	}	
+      }
+
+      static int asptr(VALUE obj, std::pair<T,U> **val) {
+	int res = SWIG_ERROR;
+	if ( TYPE(obj) == T_ARRAY ) {
+	  if ( RARRAY_LEN(obj) == 2) {
+	    VALUE first = rb_ary_entry(obj,0);
+	    VALUE second = rb_ary_entry(obj,1);
+	    res = get_pair(first, second, val);
+	  }
+	} else {
+	  value_type *p;
+	  res = SWIG_ConvertPtr(obj,(void**)&p,
+				swig::type_info<value_type>(),0);
+	  if (SWIG_IsOK(res) && val)  *val = p;
+	}
+	return res;
+      }
+    };
+
+
+
+    template <class T, class U >
+    struct traits_from<std::pair<T,U> >   {
+      static VALUE _wrap_pair_second( VALUE self )
+      {
+	std::pair< typename swig::noconst_traits<T >::noconst_type,U>* p = NULL;
+	swig::asptr( self, &p );
+	return swig::from( p->second );
+      }
+
+      static VALUE _wrap_pair_second_eq( VALUE self, VALUE arg )
+      {
+	std::pair< typename swig::noconst_traits<T >::noconst_type,U>* p = NULL;
+	swig::asptr( self, &p );
+	return swig::from( p->second );
+      }
+
+      static VALUE from(const std::pair<T,U>& val) {
+	VALUE obj = rb_ary_new2(2);
+	rb_ary_push(obj, swig::from<typename swig::noconst_traits<T >::noconst_type>(val.first));
+	rb_ary_push(obj, swig::from(val.second));
+	rb_define_singleton_method(obj, "second",
+				   VALUEFUNC(_wrap_pair_second), 0 );
+	rb_define_singleton_method(obj, "second=",
+				   VALUEFUNC(_wrap_pair_second_eq), 1 );
+	rb_obj_freeze(obj); // treat as immutable tuple
+	return obj;
+      }
+    };
+
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::pair< std::string, CdiVariable > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::pair<" "std::string" "," "CdiVariable" " >";
+	  }
+	};
+      }
+    
+
+  namespace swig {
+    template <class RubySeq, class K, class T >
+    inline void
+    assign(const RubySeq& rubyseq, std::map<K,T > *map) {
+      typedef typename std::map<K,T>::value_type value_type;
+      typename RubySeq::const_iterator it = rubyseq.begin();
+      for (;it != rubyseq.end(); ++it) {
+	map->insert(value_type(it->first, it->second));
+      }
+    }
+
+    template <class K, class T>
+    struct traits_asptr<std::map<K,T> >  {
+      typedef std::map<K,T> map_type;
+      static int asptr(VALUE obj, map_type **val) {
+	int res = SWIG_ERROR;
+	if ( TYPE(obj) == T_HASH ) {
+	  static ID id_to_a = rb_intern("to_a");
+	  VALUE items = rb_funcall(obj, id_to_a, 0);
+	  res = traits_asptr_stdseq<std::map<K,T>, std::pair<K, T> >::asptr(items, val);
+	} else {
+	  map_type *p;
+	  res = SWIG_ConvertPtr(obj,(void**)&p,swig::type_info<map_type>(),0);
+	  if (SWIG_IsOK(res) && val)  *val = p;
+	}
+	return res;
+      }
+    };
+      
+    template <class K, class T >
+    struct traits_from<std::map<K,T> >  {
+      typedef std::map<K,T> map_type;
+      typedef typename map_type::const_iterator const_iterator;
+      typedef typename map_type::size_type size_type;
+            
+      static VALUE from(const map_type& map) {
+	swig_type_info *desc = swig::type_info<map_type>();
+	if (desc && desc->clientdata) {
+	  return SWIG_NewPointerObj(new map_type(map), desc, SWIG_POINTER_OWN);
+	} else {
+	  size_type size = map.size();
+	  int rubysize = (size <= (size_type) INT_MAX) ? (int) size : -1;
+	  if (rubysize < 0) {
+	    SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	    rb_raise( rb_eRuntimeError, "map size not valid in Ruby");
+	    SWIG_RUBY_THREAD_END_BLOCK;
+	    return Qnil;
+	  }
+	  VALUE obj = rb_hash_new();
+	  for (const_iterator i= map.begin(); i!= map.end(); ++i) {
+	    VALUE key = swig::from(i->first);
+	    VALUE val = swig::from(i->second);
+	    rb_hash_aset(obj, key, val);
+	  }
+	  return obj;
+	}
+      }
+    };
+
+    template <class ValueType>
+    struct from_key_oper 
+    {
+      typedef const ValueType& argument_type;
+      typedef  VALUE result_type;
+      result_type operator()(argument_type v) const
+      {
+	return swig::from(v.first);
+      }
+    };
+
+    template <class ValueType>
+    struct from_value_oper 
+    {
+      typedef const ValueType& argument_type;
+      typedef  VALUE result_type;
+      result_type operator()(argument_type v) const
+      {
+	return swig::from(v.second);
+      }
+    };
+
+    template<class OutIterator, class FromOper, 
+	     class ValueType = typename OutIterator::value_type>
+    struct MapIterator_T : ConstIteratorClosed_T<OutIterator, ValueType, FromOper>
+    {
+      MapIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq)
+	: ConstIteratorClosed_T<OutIterator,ValueType,FromOper>(curr, first, last, seq)
+      {
+      }
+    };
+
+
+    template<class OutIterator,
+	     class FromOper = from_key_oper<typename OutIterator::value_type> >
+    struct MapKeyIterator_T : MapIterator_T<OutIterator, FromOper>
+    {
+      MapKeyIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq)
+	: MapIterator_T<OutIterator, FromOper>(curr, first, last, seq)
+      {
+      }
+    };
+
+    template<typename OutIter>
+    inline ConstIterator*
+    make_output_key_iterator(const OutIter& current, const OutIter& begin, 
+			     const OutIter& end, VALUE seq = 0)
+    {
+      return new MapKeyIterator_T<OutIter>(current, begin, end, seq);
+    }
+
+    template<class OutIterator,
+	     class FromOper = from_value_oper<typename OutIterator::value_type> >
+    struct MapValueIterator_T : MapIterator_T<OutIterator, FromOper>
+    {
+      MapValueIterator_T(OutIterator curr, OutIterator first, OutIterator last, VALUE seq)
+	: MapIterator_T<OutIterator, FromOper>(curr, first, last, seq)
+      {
+      }
+    };
+    
+
+    template<typename OutIter>
+    inline ConstIterator*
+    make_output_value_iterator(const OutIter& current, const OutIter& begin, 
+			       const OutIter& end, VALUE seq = 0)
+    {
+      return new MapValueIterator_T<OutIter>(current, begin, end, seq);
+    }
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::map<std::string, CdiVariable, std::less< std::string >, std::allocator< std::pair< std::string const,CdiVariable > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::map<" "std::string" "," "CdiVariable" "," "std::less< std::string >" "," "std::allocator< std::pair< std::string const,CdiVariable > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *std_map_Sl_std_string_Sc_CdiVariable_Sg__dup(std::map< std::string,CdiVariable > *self){
+      return new std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >(*self);
+    }
+SWIGINTERN VALUE std_map_Sl_std_string_Sc_CdiVariable_Sg____delete__(std::map< std::string,CdiVariable > *self,std::map< std::string,CdiVariable >::key_type const &key){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator i = self->find(key);
+      if (i != self->end()) {
+	self->erase(i);
+	return swig::from( key );
+      }
+      else {
+	return Qnil;
+      }
+    }
+SWIGINTERN bool std_map_Sl_std_string_Sc_CdiVariable_Sg__has_key(std::map< std::string,CdiVariable > const *self,std::map< std::string,CdiVariable >::key_type const &key){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->find(key);
+      return i != self->end();
+    }
+SWIGINTERN VALUE std_map_Sl_std_string_Sc_CdiVariable_Sg__keys(std::map< std::string,CdiVariable > *self){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->begin();
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from(i->first) );
+      }
+      return ary;
+    }
+SWIGINTERN std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *std_map_Sl_std_string_Sc_CdiVariable_Sg__each(std::map< std::string,CdiVariable > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE k, v;
+	std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator i = self->begin();
+	std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    const std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::key_type&    key = i->first;
+	    const std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::mapped_type& val = i->second;
+
+	    k = swig::from<std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::key_type>(key);
+	    v = swig::from<std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::mapped_type>(val);
+	    rb_yield_values(2, k, v);
+	  }
+	
+	return self;
+      }
+SWIGINTERN std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *std_map_Sl_std_string_Sc_CdiVariable_Sg__select(std::map< std::string,CdiVariable > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >* r = new std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >;
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator i = self->begin();
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator e = self->end();
+      for ( ; i != e; ++i )
+	{
+	  VALUE k = swig::from<std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::key_type>(i->first);
+	  VALUE v = swig::from<std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::mapped_type>(i->second);
+	  if ( RTEST( rb_yield_values(2, k, v) ) )
+	    self->insert(r->end(), *i);
+	}
+	
+      return r;
+    }
+SWIGINTERN VALUE std_map_Sl_std_string_Sc_CdiVariable_Sg__values_at(std::map< std::string,CdiVariable > *self,int argc,VALUE *argv,...){
+    
+    VALUE r = rb_ary_new();
+    ID   id = rb_intern("[]");
+    swig_type_info* type = swig::type_info< std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > >();
+    VALUE me = SWIG_NewPointerObj( self, type, 0 );
+    for ( int i = 0; i < argc; ++i )
+      {
+	VALUE key = argv[i];
+	VALUE tmp = rb_funcall( me, id, 1, key );
+	rb_ary_push( r, tmp );
+      }
+    
+    return r;
+  }
+SWIGINTERN std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *std_map_Sl_std_string_Sc_CdiVariable_Sg__each_key(std::map< std::string,CdiVariable > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator i = self->begin();
+	std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from( i->first );
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN VALUE std_map_Sl_std_string_Sc_CdiVariable_Sg__values(std::map< std::string,CdiVariable > *self){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->begin();
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from(i->second) );
+      }
+      return ary;
+    }
+SWIGINTERN std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *std_map_Sl_std_string_Sc_CdiVariable_Sg__each_value(std::map< std::string,CdiVariable > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator i = self->begin();
+	std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from( i->second );
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN VALUE std_map_Sl_std_string_Sc_CdiVariable_Sg__entries(std::map< std::string,CdiVariable > *self){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->begin();
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from<std::pair<std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::key_type, 
+		     std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::mapped_type> >(*i) );
+      }
+      return ary;
+    }
+SWIGINTERN bool std_map_Sl_std_string_Sc_CdiVariable_Sg____contains__(std::map< std::string,CdiVariable > *self,std::map< std::string,CdiVariable >::key_type const &key){
+      return self->find(key) != self->end();
+    }
+SWIGINTERN swig::ConstIterator *std_map_Sl_std_string_Sc_CdiVariable_Sg__key_iterator(std::map< std::string,CdiVariable > *self,VALUE *RUBY_SELF){
+      return swig::make_output_key_iterator(self->begin(), self->begin(), 
+					    self->end(), *RUBY_SELF);
+    }
+SWIGINTERN swig::ConstIterator *std_map_Sl_std_string_Sc_CdiVariable_Sg__value_iterator(std::map< std::string,CdiVariable > *self,VALUE *RUBY_SELF){
+      return swig::make_output_value_iterator(self->begin(), self->begin(), 
+					      self->end(), *RUBY_SELF);
+    }
+SWIGINTERN VALUE std_map_Sl_std_string_Sc_CdiVariable_Sg____getitem__(std::map< std::string,CdiVariable > const *self,std::map< std::string,CdiVariable >::key_type const &key){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->find(key);
+      if ( i != self->end() )
+	return swig::from<std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::mapped_type>( i->second );
+      else
+	return Qnil;
+    }
+SWIGINTERN void std_map_Sl_std_string_Sc_CdiVariable_Sg____setitem__(std::map< std::string,CdiVariable > *self,std::map< std::string,CdiVariable >::key_type const &key,std::map< std::string,CdiVariable >::mapped_type const &x){
+      (*self)[key] = x;
+    }
+SWIGINTERN VALUE std_map_Sl_std_string_Sc_CdiVariable_Sg__inspect(std::map< std::string,CdiVariable > *self){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->begin();
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator e = self->end();
+      const char *type_name = swig::type_name< std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > >();
+      VALUE str = rb_str_new2( type_name );
+      str = rb_str_cat2( str, " {" );
+      bool comma = false;
+      VALUE tmp;
+      for ( ; i != e; ++i, comma = true )
+	{
+	  if (comma) str = rb_str_cat2( str, "," );
+	  tmp = swig::from< std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::key_type >( i->first );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	  str = rb_str_cat2( str, "=>" );
+	  tmp = swig::from< std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::mapped_type >( i->second );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      str = rb_str_cat2( str, "}" );
+      return str;
+    }
+SWIGINTERN VALUE std_map_Sl_std_string_Sc_CdiVariable_Sg__to_a(std::map< std::string,CdiVariable > *self){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator i = self->begin();
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::const_iterator e = self->end();
+      VALUE ary = rb_ary_new2( std::distance( i, e ) );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  // @todo: improve -- this should just be swig::from(*i)
+	  tmp = swig::from< std::pair<std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::key_type, 
+	    std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::mapped_type> >( *i );
+	  rb_ary_push( ary, tmp );
+	}
+      return ary;
+    }
+SWIGINTERN VALUE std_map_Sl_std_string_Sc_CdiVariable_Sg__to_s(std::map< std::string,CdiVariable > *self){
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator i = self->begin();
+      std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator e = self->end();
+      VALUE str = rb_str_new2( "" );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  // @todo: improve -- this should just be swig::from(*i)
+	  tmp = swig::from< std::pair<std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::key_type, 
+	    std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::mapped_type> >( *i );
+	  tmp = rb_obj_as_string( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      return str;
+    }
+
+      namespace swig {
+	template <>  struct traits<std::pair< int, CdiVariable > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::pair<" "int" "," "CdiVariable" " >";
+	  }
+	};
+      }
+    
+
+      namespace swig {
+	template <>  struct traits<std::map<int, CdiVariable, std::less< int >, std::allocator< std::pair< int const,CdiVariable > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::map<" "int" "," "CdiVariable" "," "std::less< int >" "," "std::allocator< std::pair< int const,CdiVariable > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *std_map_Sl_int_Sc_CdiVariable_Sg__dup(std::map< int,CdiVariable > *self){
+      return new std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >(*self);
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiVariable_Sg____delete__(std::map< int,CdiVariable > *self,std::map< int,CdiVariable >::key_type const &key){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator i = self->find(key);
+      if (i != self->end()) {
+	self->erase(i);
+	return swig::from( key );
+      }
+      else {
+	return Qnil;
+      }
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiVariable_Sg__has_key(std::map< int,CdiVariable > const *self,std::map< int,CdiVariable >::key_type const &key){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->find(key);
+      return i != self->end();
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiVariable_Sg__keys(std::map< int,CdiVariable > *self){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->begin();
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from(i->first) );
+      }
+      return ary;
+    }
+SWIGINTERN std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *std_map_Sl_int_Sc_CdiVariable_Sg__each(std::map< int,CdiVariable > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE k, v;
+	std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator i = self->begin();
+	std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    const std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::key_type&    key = i->first;
+	    const std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::mapped_type& val = i->second;
+
+	    k = swig::from<std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::key_type>(key);
+	    v = swig::from<std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::mapped_type>(val);
+	    rb_yield_values(2, k, v);
+	  }
+	
+	return self;
+      }
+SWIGINTERN std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *std_map_Sl_int_Sc_CdiVariable_Sg__select(std::map< int,CdiVariable > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >* r = new std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >;
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator i = self->begin();
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator e = self->end();
+      for ( ; i != e; ++i )
+	{
+	  VALUE k = swig::from<std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::key_type>(i->first);
+	  VALUE v = swig::from<std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::mapped_type>(i->second);
+	  if ( RTEST( rb_yield_values(2, k, v) ) )
+	    self->insert(r->end(), *i);
+	}
+	
+      return r;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiVariable_Sg__values_at(std::map< int,CdiVariable > *self,int argc,VALUE *argv,...){
+    
+    VALUE r = rb_ary_new();
+    ID   id = rb_intern("[]");
+    swig_type_info* type = swig::type_info< std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > >();
+    VALUE me = SWIG_NewPointerObj( self, type, 0 );
+    for ( int i = 0; i < argc; ++i )
+      {
+	VALUE key = argv[i];
+	VALUE tmp = rb_funcall( me, id, 1, key );
+	rb_ary_push( r, tmp );
+      }
+    
+    return r;
+  }
+SWIGINTERN std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *std_map_Sl_int_Sc_CdiVariable_Sg__each_key(std::map< int,CdiVariable > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator i = self->begin();
+	std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from( i->first );
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiVariable_Sg__values(std::map< int,CdiVariable > *self){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->begin();
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from(i->second) );
+      }
+      return ary;
+    }
+SWIGINTERN std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *std_map_Sl_int_Sc_CdiVariable_Sg__each_value(std::map< int,CdiVariable > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator i = self->begin();
+	std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from( i->second );
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiVariable_Sg__entries(std::map< int,CdiVariable > *self){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->begin();
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from<std::pair<std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::key_type, 
+		     std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::mapped_type> >(*i) );
+      }
+      return ary;
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiVariable_Sg____contains__(std::map< int,CdiVariable > *self,std::map< int,CdiVariable >::key_type const &key){
+      return self->find(key) != self->end();
+    }
+SWIGINTERN swig::ConstIterator *std_map_Sl_int_Sc_CdiVariable_Sg__key_iterator(std::map< int,CdiVariable > *self,VALUE *RUBY_SELF){
+      return swig::make_output_key_iterator(self->begin(), self->begin(), 
+					    self->end(), *RUBY_SELF);
+    }
+SWIGINTERN swig::ConstIterator *std_map_Sl_int_Sc_CdiVariable_Sg__value_iterator(std::map< int,CdiVariable > *self,VALUE *RUBY_SELF){
+      return swig::make_output_value_iterator(self->begin(), self->begin(), 
+					      self->end(), *RUBY_SELF);
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiVariable_Sg____getitem__(std::map< int,CdiVariable > const *self,std::map< int,CdiVariable >::key_type const &key){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->find(key);
+      if ( i != self->end() )
+	return swig::from<std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::mapped_type>( i->second );
+      else
+	return Qnil;
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiVariable_Sg____setitem__(std::map< int,CdiVariable > *self,std::map< int,CdiVariable >::key_type const &key,std::map< int,CdiVariable >::mapped_type const &x){
+      (*self)[key] = x;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiVariable_Sg__inspect(std::map< int,CdiVariable > *self){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->begin();
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator e = self->end();
+      const char *type_name = swig::type_name< std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > >();
+      VALUE str = rb_str_new2( type_name );
+      str = rb_str_cat2( str, " {" );
+      bool comma = false;
+      VALUE tmp;
+      for ( ; i != e; ++i, comma = true )
+	{
+	  if (comma) str = rb_str_cat2( str, "," );
+	  tmp = swig::from< std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::key_type >( i->first );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	  str = rb_str_cat2( str, "=>" );
+	  tmp = swig::from< std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::mapped_type >( i->second );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      str = rb_str_cat2( str, "}" );
+      return str;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiVariable_Sg__to_a(std::map< int,CdiVariable > *self){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator i = self->begin();
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::const_iterator e = self->end();
+      VALUE ary = rb_ary_new2( std::distance( i, e ) );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  // @todo: improve -- this should just be swig::from(*i)
+	  tmp = swig::from< std::pair<std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::key_type, 
+	    std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::mapped_type> >( *i );
+	  rb_ary_push( ary, tmp );
+	}
+      return ary;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiVariable_Sg__to_s(std::map< int,CdiVariable > *self){
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator i = self->begin();
+      std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator e = self->end();
+      VALUE str = rb_str_new2( "" );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  // @todo: improve -- this should just be swig::from(*i)
+	  tmp = swig::from< std::pair<std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::key_type, 
+	    std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::mapped_type> >( *i );
+	  tmp = rb_obj_as_string( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      return str;
+    }
+
+  namespace swig {
+    template <>  struct traits<CdiTaxis > {
+      typedef pointer_category category;
+      static const char* type_name() { return"CdiTaxis"; }
+    };
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::pair< int, CdiTaxis > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::pair<" "int" "," "CdiTaxis" " >";
+	  }
+	};
+      }
+    
+
+      namespace swig {
+	template <>  struct traits<std::map<int, CdiTaxis, std::less< int >, std::allocator< std::pair< int const,CdiTaxis > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::map<" "int" "," "CdiTaxis" "," "std::less< int >" "," "std::allocator< std::pair< int const,CdiTaxis > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *std_map_Sl_int_Sc_CdiTaxis_Sg__dup(std::map< int,CdiTaxis > *self){
+      return new std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >(*self);
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiTaxis_Sg____delete__(std::map< int,CdiTaxis > *self,std::map< int,CdiTaxis >::key_type const &key){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator i = self->find(key);
+      if (i != self->end()) {
+	self->erase(i);
+	return swig::from( key );
+      }
+      else {
+	return Qnil;
+      }
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiTaxis_Sg__has_key(std::map< int,CdiTaxis > const *self,std::map< int,CdiTaxis >::key_type const &key){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->find(key);
+      return i != self->end();
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiTaxis_Sg__keys(std::map< int,CdiTaxis > *self){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->begin();
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from(i->first) );
+      }
+      return ary;
+    }
+SWIGINTERN std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *std_map_Sl_int_Sc_CdiTaxis_Sg__each(std::map< int,CdiTaxis > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE k, v;
+	std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator i = self->begin();
+	std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    const std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::key_type&    key = i->first;
+	    const std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::mapped_type& val = i->second;
+
+	    k = swig::from<std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::key_type>(key);
+	    v = swig::from<std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::mapped_type>(val);
+	    rb_yield_values(2, k, v);
+	  }
+	
+	return self;
+      }
+SWIGINTERN std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *std_map_Sl_int_Sc_CdiTaxis_Sg__select(std::map< int,CdiTaxis > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >* r = new std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >;
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator i = self->begin();
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator e = self->end();
+      for ( ; i != e; ++i )
+	{
+	  VALUE k = swig::from<std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::key_type>(i->first);
+	  VALUE v = swig::from<std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::mapped_type>(i->second);
+	  if ( RTEST( rb_yield_values(2, k, v) ) )
+	    self->insert(r->end(), *i);
+	}
+	
+      return r;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiTaxis_Sg__values_at(std::map< int,CdiTaxis > *self,int argc,VALUE *argv,...){
+    
+    VALUE r = rb_ary_new();
+    ID   id = rb_intern("[]");
+    swig_type_info* type = swig::type_info< std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > >();
+    VALUE me = SWIG_NewPointerObj( self, type, 0 );
+    for ( int i = 0; i < argc; ++i )
+      {
+	VALUE key = argv[i];
+	VALUE tmp = rb_funcall( me, id, 1, key );
+	rb_ary_push( r, tmp );
+      }
+    
+    return r;
+  }
+SWIGINTERN std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *std_map_Sl_int_Sc_CdiTaxis_Sg__each_key(std::map< int,CdiTaxis > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator i = self->begin();
+	std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from( i->first );
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiTaxis_Sg__values(std::map< int,CdiTaxis > *self){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->begin();
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from(i->second) );
+      }
+      return ary;
+    }
+SWIGINTERN std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *std_map_Sl_int_Sc_CdiTaxis_Sg__each_value(std::map< int,CdiTaxis > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator i = self->begin();
+	std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from( i->second );
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiTaxis_Sg__entries(std::map< int,CdiTaxis > *self){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->begin();
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from<std::pair<std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::key_type, 
+		     std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::mapped_type> >(*i) );
+      }
+      return ary;
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiTaxis_Sg____contains__(std::map< int,CdiTaxis > *self,std::map< int,CdiTaxis >::key_type const &key){
+      return self->find(key) != self->end();
+    }
+SWIGINTERN swig::ConstIterator *std_map_Sl_int_Sc_CdiTaxis_Sg__key_iterator(std::map< int,CdiTaxis > *self,VALUE *RUBY_SELF){
+      return swig::make_output_key_iterator(self->begin(), self->begin(), 
+					    self->end(), *RUBY_SELF);
+    }
+SWIGINTERN swig::ConstIterator *std_map_Sl_int_Sc_CdiTaxis_Sg__value_iterator(std::map< int,CdiTaxis > *self,VALUE *RUBY_SELF){
+      return swig::make_output_value_iterator(self->begin(), self->begin(), 
+					      self->end(), *RUBY_SELF);
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiTaxis_Sg____getitem__(std::map< int,CdiTaxis > const *self,std::map< int,CdiTaxis >::key_type const &key){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->find(key);
+      if ( i != self->end() )
+	return swig::from<std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::mapped_type>( i->second );
+      else
+	return Qnil;
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiTaxis_Sg____setitem__(std::map< int,CdiTaxis > *self,std::map< int,CdiTaxis >::key_type const &key,std::map< int,CdiTaxis >::mapped_type const &x){
+      (*self)[key] = x;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiTaxis_Sg__inspect(std::map< int,CdiTaxis > *self){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->begin();
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator e = self->end();
+      const char *type_name = swig::type_name< std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > >();
+      VALUE str = rb_str_new2( type_name );
+      str = rb_str_cat2( str, " {" );
+      bool comma = false;
+      VALUE tmp;
+      for ( ; i != e; ++i, comma = true )
+	{
+	  if (comma) str = rb_str_cat2( str, "," );
+	  tmp = swig::from< std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::key_type >( i->first );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	  str = rb_str_cat2( str, "=>" );
+	  tmp = swig::from< std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::mapped_type >( i->second );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      str = rb_str_cat2( str, "}" );
+      return str;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiTaxis_Sg__to_a(std::map< int,CdiTaxis > *self){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator i = self->begin();
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::const_iterator e = self->end();
+      VALUE ary = rb_ary_new2( std::distance( i, e ) );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  // @todo: improve -- this should just be swig::from(*i)
+	  tmp = swig::from< std::pair<std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::key_type, 
+	    std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::mapped_type> >( *i );
+	  rb_ary_push( ary, tmp );
+	}
+      return ary;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiTaxis_Sg__to_s(std::map< int,CdiTaxis > *self){
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator i = self->begin();
+      std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator e = self->end();
+      VALUE str = rb_str_new2( "" );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  // @todo: improve -- this should just be swig::from(*i)
+	  tmp = swig::from< std::pair<std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::key_type, 
+	    std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::mapped_type> >( *i );
+	  tmp = rb_obj_as_string( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      return str;
+    }
+
+  namespace swig {
+    template <>  struct traits<CdiZaxis > {
+      typedef pointer_category category;
+      static const char* type_name() { return"CdiZaxis"; }
+    };
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::pair< int, CdiZaxis > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::pair<" "int" "," "CdiZaxis" " >";
+	  }
+	};
+      }
+    
+
+      namespace swig {
+	template <>  struct traits<std::map<int, CdiZaxis, std::less< int >, std::allocator< std::pair< int const,CdiZaxis > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::map<" "int" "," "CdiZaxis" "," "std::less< int >" "," "std::allocator< std::pair< int const,CdiZaxis > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *std_map_Sl_int_Sc_CdiZaxis_Sg__dup(std::map< int,CdiZaxis > *self){
+      return new std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >(*self);
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiZaxis_Sg____delete__(std::map< int,CdiZaxis > *self,std::map< int,CdiZaxis >::key_type const &key){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator i = self->find(key);
+      if (i != self->end()) {
+	self->erase(i);
+	return swig::from( key );
+      }
+      else {
+	return Qnil;
+      }
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiZaxis_Sg__has_key(std::map< int,CdiZaxis > const *self,std::map< int,CdiZaxis >::key_type const &key){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->find(key);
+      return i != self->end();
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiZaxis_Sg__keys(std::map< int,CdiZaxis > *self){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->begin();
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from(i->first) );
+      }
+      return ary;
+    }
+SWIGINTERN std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *std_map_Sl_int_Sc_CdiZaxis_Sg__each(std::map< int,CdiZaxis > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE k, v;
+	std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator i = self->begin();
+	std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    const std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::key_type&    key = i->first;
+	    const std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::mapped_type& val = i->second;
+
+	    k = swig::from<std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::key_type>(key);
+	    v = swig::from<std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::mapped_type>(val);
+	    rb_yield_values(2, k, v);
+	  }
+	
+	return self;
+      }
+SWIGINTERN std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *std_map_Sl_int_Sc_CdiZaxis_Sg__select(std::map< int,CdiZaxis > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >* r = new std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >;
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator i = self->begin();
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator e = self->end();
+      for ( ; i != e; ++i )
+	{
+	  VALUE k = swig::from<std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::key_type>(i->first);
+	  VALUE v = swig::from<std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::mapped_type>(i->second);
+	  if ( RTEST( rb_yield_values(2, k, v) ) )
+	    self->insert(r->end(), *i);
+	}
+	
+      return r;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiZaxis_Sg__values_at(std::map< int,CdiZaxis > *self,int argc,VALUE *argv,...){
+    
+    VALUE r = rb_ary_new();
+    ID   id = rb_intern("[]");
+    swig_type_info* type = swig::type_info< std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > >();
+    VALUE me = SWIG_NewPointerObj( self, type, 0 );
+    for ( int i = 0; i < argc; ++i )
+      {
+	VALUE key = argv[i];
+	VALUE tmp = rb_funcall( me, id, 1, key );
+	rb_ary_push( r, tmp );
+      }
+    
+    return r;
+  }
+SWIGINTERN std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *std_map_Sl_int_Sc_CdiZaxis_Sg__each_key(std::map< int,CdiZaxis > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator i = self->begin();
+	std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from( i->first );
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiZaxis_Sg__values(std::map< int,CdiZaxis > *self){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->begin();
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from(i->second) );
+      }
+      return ary;
+    }
+SWIGINTERN std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *std_map_Sl_int_Sc_CdiZaxis_Sg__each_value(std::map< int,CdiZaxis > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator i = self->begin();
+	std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from( i->second );
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiZaxis_Sg__entries(std::map< int,CdiZaxis > *self){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->begin();
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from<std::pair<std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::key_type, 
+		     std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::mapped_type> >(*i) );
+      }
+      return ary;
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiZaxis_Sg____contains__(std::map< int,CdiZaxis > *self,std::map< int,CdiZaxis >::key_type const &key){
+      return self->find(key) != self->end();
+    }
+SWIGINTERN swig::ConstIterator *std_map_Sl_int_Sc_CdiZaxis_Sg__key_iterator(std::map< int,CdiZaxis > *self,VALUE *RUBY_SELF){
+      return swig::make_output_key_iterator(self->begin(), self->begin(), 
+					    self->end(), *RUBY_SELF);
+    }
+SWIGINTERN swig::ConstIterator *std_map_Sl_int_Sc_CdiZaxis_Sg__value_iterator(std::map< int,CdiZaxis > *self,VALUE *RUBY_SELF){
+      return swig::make_output_value_iterator(self->begin(), self->begin(), 
+					      self->end(), *RUBY_SELF);
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiZaxis_Sg____getitem__(std::map< int,CdiZaxis > const *self,std::map< int,CdiZaxis >::key_type const &key){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->find(key);
+      if ( i != self->end() )
+	return swig::from<std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::mapped_type>( i->second );
+      else
+	return Qnil;
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiZaxis_Sg____setitem__(std::map< int,CdiZaxis > *self,std::map< int,CdiZaxis >::key_type const &key,std::map< int,CdiZaxis >::mapped_type const &x){
+      (*self)[key] = x;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiZaxis_Sg__inspect(std::map< int,CdiZaxis > *self){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->begin();
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator e = self->end();
+      const char *type_name = swig::type_name< std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > >();
+      VALUE str = rb_str_new2( type_name );
+      str = rb_str_cat2( str, " {" );
+      bool comma = false;
+      VALUE tmp;
+      for ( ; i != e; ++i, comma = true )
+	{
+	  if (comma) str = rb_str_cat2( str, "," );
+	  tmp = swig::from< std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::key_type >( i->first );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	  str = rb_str_cat2( str, "=>" );
+	  tmp = swig::from< std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::mapped_type >( i->second );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      str = rb_str_cat2( str, "}" );
+      return str;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiZaxis_Sg__to_a(std::map< int,CdiZaxis > *self){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator i = self->begin();
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::const_iterator e = self->end();
+      VALUE ary = rb_ary_new2( std::distance( i, e ) );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  // @todo: improve -- this should just be swig::from(*i)
+	  tmp = swig::from< std::pair<std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::key_type, 
+	    std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::mapped_type> >( *i );
+	  rb_ary_push( ary, tmp );
+	}
+      return ary;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiZaxis_Sg__to_s(std::map< int,CdiZaxis > *self){
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator i = self->begin();
+      std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator e = self->end();
+      VALUE str = rb_str_new2( "" );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  // @todo: improve -- this should just be swig::from(*i)
+	  tmp = swig::from< std::pair<std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::key_type, 
+	    std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::mapped_type> >( *i );
+	  tmp = rb_obj_as_string( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      return str;
+    }
+
+  namespace swig {
+    template <>  struct traits<CdiGrid > {
+      typedef pointer_category category;
+      static const char* type_name() { return"CdiGrid"; }
+    };
+  }
+
+
+      namespace swig {
+	template <>  struct traits<std::pair< int, CdiGrid > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::pair<" "int" "," "CdiGrid" " >";
+	  }
+	};
+      }
+    
+
+      namespace swig {
+	template <>  struct traits<std::map<int, CdiGrid, std::less< int >, std::allocator< std::pair< int const,CdiGrid > > > > {
+	  typedef pointer_category category;
+	  static const char* type_name() {
+	    return "std::map<" "int" "," "CdiGrid" "," "std::less< int >" "," "std::allocator< std::pair< int const,CdiGrid > >" " >";
+	  }
+	};
+      }
+    
+SWIGINTERN std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *std_map_Sl_int_Sc_CdiGrid_Sg__dup(std::map< int,CdiGrid > *self){
+      return new std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >(*self);
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiGrid_Sg____delete__(std::map< int,CdiGrid > *self,std::map< int,CdiGrid >::key_type const &key){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator i = self->find(key);
+      if (i != self->end()) {
+	self->erase(i);
+	return swig::from( key );
+      }
+      else {
+	return Qnil;
+      }
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiGrid_Sg__has_key(std::map< int,CdiGrid > const *self,std::map< int,CdiGrid >::key_type const &key){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->find(key);
+      return i != self->end();
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiGrid_Sg__keys(std::map< int,CdiGrid > *self){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->begin();
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from(i->first) );
+      }
+      return ary;
+    }
+SWIGINTERN std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *std_map_Sl_int_Sc_CdiGrid_Sg__each(std::map< int,CdiGrid > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE k, v;
+	std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator i = self->begin();
+	std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    const std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::key_type&    key = i->first;
+	    const std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::mapped_type& val = i->second;
+
+	    k = swig::from<std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::key_type>(key);
+	    v = swig::from<std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::mapped_type>(val);
+	    rb_yield_values(2, k, v);
+	  }
+	
+	return self;
+      }
+SWIGINTERN std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *std_map_Sl_int_Sc_CdiGrid_Sg__select(std::map< int,CdiGrid > *self){
+      if ( !rb_block_given_p() )
+	rb_raise( rb_eArgError, "no block given" );
+
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >* r = new std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >;
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator i = self->begin();
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator e = self->end();
+      for ( ; i != e; ++i )
+	{
+	  VALUE k = swig::from<std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::key_type>(i->first);
+	  VALUE v = swig::from<std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::mapped_type>(i->second);
+	  if ( RTEST( rb_yield_values(2, k, v) ) )
+	    self->insert(r->end(), *i);
+	}
+	
+      return r;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiGrid_Sg__values_at(std::map< int,CdiGrid > *self,int argc,VALUE *argv,...){
+    
+    VALUE r = rb_ary_new();
+    ID   id = rb_intern("[]");
+    swig_type_info* type = swig::type_info< std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > >();
+    VALUE me = SWIG_NewPointerObj( self, type, 0 );
+    for ( int i = 0; i < argc; ++i )
+      {
+	VALUE key = argv[i];
+	VALUE tmp = rb_funcall( me, id, 1, key );
+	rb_ary_push( r, tmp );
+      }
+    
+    return r;
+  }
+SWIGINTERN std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *std_map_Sl_int_Sc_CdiGrid_Sg__each_key(std::map< int,CdiGrid > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator i = self->begin();
+	std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from( i->first );
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiGrid_Sg__values(std::map< int,CdiGrid > *self){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->begin();
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from(i->second) );
+      }
+      return ary;
+    }
+SWIGINTERN std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *std_map_Sl_int_Sc_CdiGrid_Sg__each_value(std::map< int,CdiGrid > *self){
+	if ( !rb_block_given_p() )
+	  rb_raise( rb_eArgError, "no block given");
+
+	VALUE r;
+	std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator i = self->begin();
+	std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator e = self->end();
+	for ( ; i != e; ++i )
+	  {
+	    r = swig::from( i->second );
+	    rb_yield(r);
+	  }
+	
+	return self;
+      }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiGrid_Sg__entries(std::map< int,CdiGrid > *self){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type size = self->size();
+      int rubysize = (size <= (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::size_type) INT_MAX) ? (int) size : -1;
+      if (rubysize < 0) {
+	SWIG_RUBY_THREAD_BEGIN_BLOCK;
+	rb_raise(rb_eRuntimeError, "map size not valid in Ruby");
+	SWIG_RUBY_THREAD_END_BLOCK;
+	return Qnil;
+      }
+      VALUE ary = rb_ary_new2(rubysize);
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->begin();
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator e = self->end();
+      for ( ; i != e; ++i ) {
+	rb_ary_push( ary, swig::from<std::pair<std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::key_type, 
+		     std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::mapped_type> >(*i) );
+      }
+      return ary;
+    }
+SWIGINTERN bool std_map_Sl_int_Sc_CdiGrid_Sg____contains__(std::map< int,CdiGrid > *self,std::map< int,CdiGrid >::key_type const &key){
+      return self->find(key) != self->end();
+    }
+SWIGINTERN swig::ConstIterator *std_map_Sl_int_Sc_CdiGrid_Sg__key_iterator(std::map< int,CdiGrid > *self,VALUE *RUBY_SELF){
+      return swig::make_output_key_iterator(self->begin(), self->begin(), 
+					    self->end(), *RUBY_SELF);
+    }
+SWIGINTERN swig::ConstIterator *std_map_Sl_int_Sc_CdiGrid_Sg__value_iterator(std::map< int,CdiGrid > *self,VALUE *RUBY_SELF){
+      return swig::make_output_value_iterator(self->begin(), self->begin(), 
+					      self->end(), *RUBY_SELF);
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiGrid_Sg____getitem__(std::map< int,CdiGrid > const *self,std::map< int,CdiGrid >::key_type const &key){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->find(key);
+      if ( i != self->end() )
+	return swig::from<std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::mapped_type>( i->second );
+      else
+	return Qnil;
+    }
+SWIGINTERN void std_map_Sl_int_Sc_CdiGrid_Sg____setitem__(std::map< int,CdiGrid > *self,std::map< int,CdiGrid >::key_type const &key,std::map< int,CdiGrid >::mapped_type const &x){
+      (*self)[key] = x;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiGrid_Sg__inspect(std::map< int,CdiGrid > *self){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->begin();
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator e = self->end();
+      const char *type_name = swig::type_name< std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > >();
+      VALUE str = rb_str_new2( type_name );
+      str = rb_str_cat2( str, " {" );
+      bool comma = false;
+      VALUE tmp;
+      for ( ; i != e; ++i, comma = true )
+	{
+	  if (comma) str = rb_str_cat2( str, "," );
+	  tmp = swig::from< std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::key_type >( i->first );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	  str = rb_str_cat2( str, "=>" );
+	  tmp = swig::from< std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::mapped_type >( i->second );
+	  tmp = rb_inspect( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      str = rb_str_cat2( str, "}" );
+      return str;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiGrid_Sg__to_a(std::map< int,CdiGrid > *self){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator i = self->begin();
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::const_iterator e = self->end();
+      VALUE ary = rb_ary_new2( std::distance( i, e ) );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  // @todo: improve -- this should just be swig::from(*i)
+	  tmp = swig::from< std::pair<std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::key_type, 
+	    std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::mapped_type> >( *i );
+	  rb_ary_push( ary, tmp );
+	}
+      return ary;
+    }
+SWIGINTERN VALUE std_map_Sl_int_Sc_CdiGrid_Sg__to_s(std::map< int,CdiGrid > *self){
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator i = self->begin();
+      std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator e = self->end();
+      VALUE str = rb_str_new2( "" );
+      VALUE tmp;
+      for ( ; i != e; ++i )
+	{
+	  // @todo: improve -- this should just be swig::from(*i)
+	  tmp = swig::from< std::pair<std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::key_type, 
+	    std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::mapped_type> >( *i );
+	  tmp = rb_obj_as_string( tmp );
+	  str = rb_str_buf_append( str, tmp );
+	}
+      return str;
+    }
+
+SWIGINTERN int
+SWIG_AsVal_bool (VALUE obj, bool *val)
+{
+  if (obj == Qtrue) {
+    if (val) *val = true;
+    return SWIG_OK;
+  } else if (obj == Qfalse) {
+    if (val) *val = false;
+    return SWIG_OK;
+  } else {
+    int res = 0;
+    if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {    
+      if (val) *val = res ? true : false;
+      return SWIG_OK;
+    }
+  }  
+  return SWIG_TypeError;
+}
+
+
+SWIGINTERN int
+SWIG_AsCharArray(VALUE obj, char *val, size_t size)
+{ 
+  char* cptr = 0; size_t csize = 0; int alloc = SWIG_OLDOBJ;
+  int res = SWIG_AsCharPtrAndSize(obj, &cptr, &csize, &alloc);
+  if (SWIG_IsOK(res)) {
+    if ((csize == size + 1) && cptr && !(cptr[csize-1])) --csize;
+    if (csize <= size) {
+      if (val) {
+	if (csize) memcpy(val, cptr, csize*sizeof(char));
+	if (csize < size) memset(val + csize, 0, (size - csize)*sizeof(char));
+      }
+      if (alloc == SWIG_NEWOBJ) {
+	delete[] cptr;
+	res = SWIG_DelNewMask(res);
+      }      
+      return res;
+    }
+    if (alloc == SWIG_NEWOBJ) delete[] cptr;
+  }
+  return SWIG_TypeError;
+}
+
+
+
+
+
+SWIGINTERNINLINE VALUE 
+SWIG_FromCharPtr(const char *cptr)
+{ 
+  return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
+}
+
+swig_class SwigClassGC_VALUE;
+
+
+/*
+  Document-method: CdiObj::GC_VALUE.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_GC_VALUE_inspect(int argc, VALUE *argv, VALUE self) {
+  swig::GC_VALUE *arg1 = (swig::GC_VALUE *) 0 ;
+  swig::GC_VALUE r1 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  r1 = self; arg1 = &r1;
+  result = (VALUE)((swig::GC_VALUE const *)arg1)->inspect();
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GC_VALUE.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_GC_VALUE_to_s(int argc, VALUE *argv, VALUE self) {
+  swig::GC_VALUE *arg1 = (swig::GC_VALUE *) 0 ;
+  swig::GC_VALUE r1 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  r1 = self; arg1 = &r1;
+  result = (VALUE)((swig::GC_VALUE const *)arg1)->to_s();
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+swig_class SwigClassConstIterator;
+
+SWIGINTERN void
+free_swig_ConstIterator(swig::ConstIterator *arg1) {
+    delete arg1;
+}
+
+SWIGINTERN VALUE
+_wrap_ConstIterator_value(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","value", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  try {
+    result = (VALUE)((swig::ConstIterator const *)arg1)->value();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_Ruby_ExceptionType(NULL, Qnil);
+      SWIG_fail;
+    }
+  }
+  
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ConstIterator.dup
+
+  call-seq:
+    dup -> ConstIterator
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_ConstIterator_dup(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  result = (swig::ConstIterator *)((swig::ConstIterator const *)arg1)->dup();
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ConstIterator.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_ConstIterator_inspect(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  result = (VALUE)((swig::ConstIterator const *)arg1)->inspect();
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ConstIterator.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_ConstIterator_to_s(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  result = (VALUE)((swig::ConstIterator const *)arg1)->to_s();
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ConstIterator_next__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator *","next", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","next", 2, argv[0] ));
+  } 
+  arg2 = static_cast< size_t >(val2);
+  result = (swig::ConstIterator *)(arg1)->next(arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ConstIterator_next__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator *","next", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  try {
+    result = (swig::ConstIterator *)(arg1)->next();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_Ruby_ExceptionType(NULL, Qnil);
+      SWIG_fail;
+    }
+  }
+  
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_ConstIterator_next(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[3];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 3) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_ConstIterator_next__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_ConstIterator_next__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 3, "ConstIterator.next", 
+    "    swig::ConstIterator * ConstIterator.next(size_t n)\n"
+    "    swig::ConstIterator * ConstIterator.next()\n");
+  
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ConstIterator_previous__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator *","previous", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","previous", 2, argv[0] ));
+  } 
+  arg2 = static_cast< size_t >(val2);
+  result = (swig::ConstIterator *)(arg1)->previous(arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ConstIterator_previous__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator *","previous", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  try {
+    result = (swig::ConstIterator *)(arg1)->previous();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_Ruby_ExceptionType(NULL, Qnil);
+      SWIG_fail;
+    }
+  }
+  
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_ConstIterator_previous(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[3];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 3) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_ConstIterator_previous__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_ConstIterator_previous__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 3, "ConstIterator.previous", 
+    "    swig::ConstIterator * ConstIterator.previous(size_t n)\n"
+    "    swig::ConstIterator * ConstIterator.previous()\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ConstIterator.==
+
+  call-seq:
+    ==(x) -> bool
+
+Equality comparison operator.
+*/
+SWIGINTERN VALUE
+_wrap_ConstIterator___eq__(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  swig::ConstIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","operator ==", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_swig__ConstIterator,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "swig::ConstIterator const &","operator ==", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "swig::ConstIterator const &","operator ==", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< swig::ConstIterator * >(argp2);
+  result = (bool)((swig::ConstIterator const *)arg1)->operator ==((swig::ConstIterator const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ConstIterator.+
+
+  call-seq:
+    +(n) -> ConstIterator
+
+Add operator.
+*/
+SWIGINTERN VALUE
+_wrap_ConstIterator___add__(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","operator +", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ptrdiff_t","operator +", 2, argv[0] ));
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::ConstIterator *)((swig::ConstIterator const *)arg1)->operator +(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_Ruby_ExceptionType(NULL, Qnil);
+      SWIG_fail;
+    }
+  }
+  
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ConstIterator.-
+
+  call-seq:
+    -(n) -> ConstIterator
+    -(x) -> ptrdiff_t
+
+Substraction operator.
+*/
+SWIGINTERN VALUE
+_wrap_ConstIterator___sub____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","operator -", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ptrdiff_t","operator -", 2, argv[0] ));
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::ConstIterator *)((swig::ConstIterator const *)arg1)->operator -(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_Ruby_ExceptionType(NULL, Qnil);
+      SWIG_fail;
+    }
+  }
+  
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ConstIterator___sub____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  swig::ConstIterator *arg1 = (swig::ConstIterator *) 0 ;
+  swig::ConstIterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  ptrdiff_t result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__ConstIterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::ConstIterator const *","operator -", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::ConstIterator * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_swig__ConstIterator,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "swig::ConstIterator const &","operator -", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "swig::ConstIterator const &","operator -", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< swig::ConstIterator * >(argp2);
+  result = ((swig::ConstIterator const *)arg1)->operator -((swig::ConstIterator const &)*arg2);
+  vresult = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_ConstIterator___sub__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[3];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 3) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_ConstIterator___sub____SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__ConstIterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_ConstIterator___sub____SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 3, "__sub__.new", 
+    "    __sub__.new(ptrdiff_t n)\n"
+    "    __sub__.new(swig::ConstIterator const &x)\n");
+  
+  return Qnil;
+}
+
+
+swig_class SwigClassIterator;
+
+SWIGINTERN VALUE
+_wrap_Iterator_valuee___(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  VALUE *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE temp2 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator *","setValue", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  temp2 = static_cast< VALUE >(argv[0]);
+  arg2 = &temp2;
+  result = (VALUE)(arg1)->setValue((VALUE const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::Iterator.dup
+
+  call-seq:
+    dup -> Iterator
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_Iterator_dup(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  result = (swig::Iterator *)((swig::Iterator const *)arg1)->dup();
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Iterator_next__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  swig::Iterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator *","next", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","next", 2, argv[0] ));
+  } 
+  arg2 = static_cast< size_t >(val2);
+  result = (swig::Iterator *)(arg1)->next(arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Iterator_next__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator *","next", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  try {
+    result = (swig::Iterator *)(arg1)->next();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_Ruby_ExceptionType(NULL, Qnil);
+      SWIG_fail;
+    }
+  }
+  
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_Iterator_next(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[3];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 3) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_Iterator_next__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_Iterator_next__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 3, "Iterator.next", 
+    "    swig::Iterator * Iterator.next(size_t n)\n"
+    "    swig::Iterator * Iterator.next()\n");
+  
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Iterator_previous__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  size_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  swig::Iterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator *","previous", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "size_t","previous", 2, argv[0] ));
+  } 
+  arg2 = static_cast< size_t >(val2);
+  result = (swig::Iterator *)(arg1)->previous(arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Iterator_previous__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator *","previous", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  try {
+    result = (swig::Iterator *)(arg1)->previous();
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_Ruby_ExceptionType(NULL, Qnil);
+      SWIG_fail;
+    }
+  }
+  
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_Iterator_previous(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[3];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 3) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_Iterator_previous__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_Iterator_previous__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 3, "Iterator.previous", 
+    "    swig::Iterator * Iterator.previous(size_t n)\n"
+    "    swig::Iterator * Iterator.previous()\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::Iterator.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_Iterator_inspect(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  result = (VALUE)((swig::Iterator const *)arg1)->inspect();
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::Iterator.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_Iterator_to_s(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  result = (VALUE)((swig::Iterator const *)arg1)->to_s();
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::Iterator.==
+
+  call-seq:
+    ==(x) -> bool
+
+Equality comparison operator.
+*/
+SWIGINTERN VALUE
+_wrap_Iterator___eq__(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  swig::Iterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","operator ==", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_swig__Iterator,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "swig::Iterator const &","operator ==", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "swig::Iterator const &","operator ==", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< swig::Iterator * >(argp2);
+  result = (bool)((swig::Iterator const *)arg1)->operator ==((swig::Iterator const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::Iterator.+
+
+  call-seq:
+    +(n) -> Iterator
+
+Add operator.
+*/
+SWIGINTERN VALUE
+_wrap_Iterator___add__(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  swig::Iterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","operator +", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ptrdiff_t","operator +", 2, argv[0] ));
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::Iterator *)((swig::Iterator const *)arg1)->operator +(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_Ruby_ExceptionType(NULL, Qnil);
+      SWIG_fail;
+    }
+  }
+  
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::Iterator.-
+
+  call-seq:
+    -(n) -> Iterator
+    -(x) -> ptrdiff_t
+
+Substraction operator.
+*/
+SWIGINTERN VALUE
+_wrap_Iterator___sub____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  ptrdiff_t arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  swig::Iterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","operator -", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "ptrdiff_t","operator -", 2, argv[0] ));
+  } 
+  arg2 = static_cast< ptrdiff_t >(val2);
+  try {
+    result = (swig::Iterator *)((swig::Iterator const *)arg1)->operator -(arg2);
+  }
+  catch(swig::stop_iteration &_e) {
+    {
+      (void)_e;
+      SWIG_Ruby_ExceptionType(NULL, Qnil);
+      SWIG_fail;
+    }
+  }
+  
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__Iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Iterator___sub____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  swig::Iterator *arg1 = (swig::Iterator *) 0 ;
+  swig::Iterator *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  ptrdiff_t result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_swig__Iterator, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "swig::Iterator const *","operator -", 1, self )); 
+  }
+  arg1 = reinterpret_cast< swig::Iterator * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_swig__Iterator,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "swig::Iterator const &","operator -", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "swig::Iterator const &","operator -", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< swig::Iterator * >(argp2);
+  result = ((swig::Iterator const *)arg1)->operator -((swig::Iterator const &)*arg2);
+  vresult = SWIG_From_ptrdiff_t(static_cast< ptrdiff_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_Iterator___sub__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[3];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 3) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_swig__Iterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_Iterator___sub____SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_swig__Iterator, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_Iterator___sub____SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 3, "__sub__.new", 
+    "    __sub__.new(ptrdiff_t n)\n"
+    "    __sub__.new(swig::Iterator const &x)\n");
+  
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_swig_Iterator(swig::Iterator *arg1) {
+    delete arg1;
+}
+
+swig_class SwigClassIntVector;
+
+
+/*
+  Document-method: CdiObj::IntVector.dup
+
+  call-seq:
+    dup -> IntVector
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_dup(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (std::vector< int,std::allocator< int > > *)std_vector_Sl_int_Sg__dup(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_inspect(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (VALUE)std_vector_Sl_int_Sg__inspect(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.to_a
+
+  call-seq:
+    to_a -> VALUE
+
+Convert IntVector to an Array.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_to_a(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","to_a", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (VALUE)std_vector_Sl_int_Sg__to_a(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_to_s(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (VALUE)std_vector_Sl_int_Sg__to_s(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.slice
+
+  call-seq:
+    slice(i, j) -> VALUE
+
+Return a slice (portion of) the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_slice(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  std::vector< int >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","slice", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::difference_type","slice", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< int >::difference_type","slice", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< int >::difference_type >(val3);
+  result = (VALUE)std_vector_Sl_int_Sg__slice(arg1,arg2,arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.each
+
+  call-seq:
+    each -> IntVector
+
+Iterate thru each element in the IntVector.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_each(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","each", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (std::vector< int,std::allocator< int > > *)std_vector_Sl_int_Sg__each(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.select
+
+  call-seq:
+    select -> IntVector
+
+Iterate thru each element in the IntVector and select those that match a condition.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_select(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","select", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (std::vector< int,std::allocator< int > > *)std_vector_Sl_int_Sg__select(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.reject!
+
+  call-seq:
+    reject! -> IntVector
+
+Iterate thru each element in the IntVector and reject those that fail a condition.  A block must be provided.  IntVector is modified in place.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_rejectN___(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","reject_bang", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (std::vector< int,std::allocator< int > > *)std_vector_Sl_int_Sg__reject_bang(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.delete_at
+
+  call-seq:
+    delete_at(i) -> VALUE
+
+Delete an element at a certain index.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_delete_at(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","delete_at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::difference_type","delete_at", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_int_Sg__delete_at(arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_IntVector___delete2__(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::value_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","__delete2__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::value_type","__delete2__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::vector< int >::value_type >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_vector_Sl_int_Sg____delete2__(arg1,(int const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.pop
+
+  call-seq:
+    pop -> VALUE
+
+Remove and return element at the end of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_pop(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","pop", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (VALUE)std_vector_Sl_int_Sg__pop(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.push
+
+  call-seq:
+    push(e) -> value_type
+
+Add an element at the end of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_push(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::value_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::vector< int >::value_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","push", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::value_type","push", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::vector< int >::value_type >(val2);
+  arg2 = &temp2;
+  result = (std::vector< int >::value_type)std_vector_Sl_int_Sg__push(arg1,(int const &)*arg2);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.reject
+
+  call-seq:
+    reject -> IntVector
+
+Iterate thru each element in the IntVector and reject those that fail a condition returning a new IntVector.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_reject(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","reject", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (std::vector< int,std::allocator< int > > *)std_vector_Sl_int_Sg__reject(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.at
+
+  call-seq:
+    at(i) -> VALUE
+
+Return element at a certain index.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_at(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > const *","at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::difference_type","at", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_int_Sg__at((std::vector< int > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.[]
+
+  call-seq:
+    [](i, j) -> VALUE
+    [](i) -> VALUE
+    [](i) -> VALUE
+
+Element accessor/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector___getitem____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  std::vector< int >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::difference_type","__getitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< int >::difference_type","__getitem__", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< int >::difference_type >(val3);
+  result = (VALUE)std_vector_Sl_int_Sg____getitem____SWIG_0((std::vector< int > const *)arg1,arg2,arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_IntVector___getitem____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::difference_type","__getitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_int_Sg____getitem____SWIG_1((std::vector< int > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_IntVector___getitem____SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  VALUE arg2 = (VALUE) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  arg2 = argv[0];
+  result = (VALUE)std_vector_Sl_int_Sg____getitem____SWIG_2((std::vector< int > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_IntVector___getitem__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_IntVector___getitem____SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      _v = (argv[1] != 0);
+      if (_v) {
+        return _wrap_IntVector___getitem____SWIG_2(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_IntVector___getitem____SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "__getitem__", 
+    "    VALUE __getitem__(std::vector< int >::difference_type i, std::vector< int >::difference_type j)\n"
+    "    VALUE __getitem__(std::vector< int >::difference_type i)\n"
+    "    VALUE __getitem__(VALUE i)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.[]=
+
+  call-seq:
+    []=(i, x) -> VALUE
+    []=(i, j, v) -> VALUE
+
+Element setter/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector___setitem____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  std::vector< int >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< int >::value_type temp3 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::difference_type","__setitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_int(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< int >::value_type","__setitem__", 3, argv[1] ));
+  } 
+  temp3 = static_cast< std::vector< int >::value_type >(val3);
+  arg3 = &temp3;
+  result = (VALUE)std_vector_Sl_int_Sg____setitem____SWIG_0(arg1,arg2,(int const &)*arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_IntVector___setitem____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  std::vector< int >::difference_type arg3 ;
+  std::vector< int,std::allocator< int > > *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::difference_type","__setitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< int >::difference_type","__setitem__", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< int >::difference_type >(val3);
+  {
+    std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
+    res4 = swig::asptr(argv[2], &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > > const &","__setitem__", 4, argv[2] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< int,std::allocator< int > > const &","__setitem__", 4, argv[2])); 
+    }
+    arg4 = ptr;
+  }
+  try {
+    result = (VALUE)std_vector_Sl_int_Sg____setitem____SWIG_1(arg1,arg2,arg3,(std::vector< int,std::allocator< int > > const &)*arg4);
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  vresult = result;
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_IntVector___setitem__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[5];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 5) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_IntVector___setitem____SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<int,std::allocator< int > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_IntVector___setitem____SWIG_1(nargs, args, self);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 5, "__setitem__", 
+    "    VALUE __setitem__(std::vector< int >::difference_type i, std::vector< int >::value_type const &x)\n"
+    "    VALUE __setitem__(std::vector< int >::difference_type i, std::vector< int >::difference_type j, std::vector< int,std::allocator< int > > const &v)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.shift
+
+  call-seq:
+    shift -> VALUE
+
+Remove and return element at the beginning of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_shift(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","shift", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (VALUE)std_vector_Sl_int_Sg__shift(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.insert
+
+  call-seq:
+    insert(pos, argc, ?) -> IntVector
+    insert(pos, x) -> iterator
+    insert(pos, n, x)
+
+Insert one or more new elements in the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_insert__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::difference_type arg2 ;
+  int arg3 ;
+  VALUE *arg4 = (VALUE *) 0 ;
+  void *arg5 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if (argc < 2) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::difference_type","insert", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::difference_type >(val2);
+  {
+    arg3 = argc - 1;
+    arg4 = argv + 1;
+  }
+  result = (std::vector< int,std::allocator< int > > *)std_vector_Sl_int_Sg__insert__SWIG_0(arg1,arg2,arg3,arg4,arg5);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.unshift
+
+  call-seq:
+    unshift(argc, ?) -> IntVector
+
+Add one or more elements at the beginning of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_unshift(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  int arg2 ;
+  VALUE *arg3 = (VALUE *) 0 ;
+  void *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if (argc < 1) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","unshift", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  {
+    arg2 = argc;
+    arg3 = argv;
+  }
+  result = (std::vector< int,std::allocator< int > > *)std_vector_Sl_int_Sg__unshift(arg1,arg2,arg3,arg4);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_IntVector__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (std::vector< int > *)new std::vector< int >();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_IntVector__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  std::vector< int > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  {
+    std::vector<int,std::allocator< int > > *ptr = (std::vector<int,std::allocator< int > > *)0;
+    res1 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > const &","std::vector<(int)>", 1, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< int > const &","std::vector<(int)>", 1, argv[0])); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::vector< int > *)new std::vector< int >((std::vector< int > const &)*arg1);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.empty?
+
+  call-seq:
+    empty? -> bool
+
+Check if the IntVector is empty or not.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_emptyq___(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > const *","empty", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (bool)((std::vector< int > const *)arg1)->empty();
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.size
+
+  call-seq:
+    size -> size_type
+
+Size or Length of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_size(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > const *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = ((std::vector< int > const *)arg1)->size();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.clear
+
+  call-seq:
+    clear
+
+Clear IntVector contents.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_clear(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","clear", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  (arg1)->clear();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_IntVector_swap(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","swap", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< int > &","swap", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< int > &","swap", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::vector< int > * >(argp2);
+  (arg1)->swap(*arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_IntVector_get_allocator(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::allocator< int > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > const *","get_allocator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = ((std::vector< int > const *)arg1)->get_allocator();
+  vresult = SWIG_NewPointerObj((new std::vector< int >::allocator_type(static_cast< const std::vector< int >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_int_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.begin
+
+  call-seq:
+    begin -> iterator
+
+Return an iterator to the beginning of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_begin(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","begin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (arg1)->begin();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< int >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.end
+
+  call-seq:
+    end -> iterator
+
+Return an iterator to past the end of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_end(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","end", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (arg1)->end();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< int >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.rbegin
+
+  call-seq:
+    rbegin -> reverse_iterator
+
+Return a reverse iterator to the beginning (the end) of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_rbegin(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","rbegin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (arg1)->rbegin();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< int >::reverse_iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.rend
+
+  call-seq:
+    rend -> reverse_iterator
+
+Return a reverse iterator to past the end (past the beginning) of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_rend(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","rend", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (arg1)->rend();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< int >::reverse_iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_IntVector__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< int >::size_type arg1 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  std::vector< int > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::vector< int >::size_type","std::vector<(int)>", 1, argv[0] ));
+  } 
+  arg1 = static_cast< std::vector< int >::size_type >(val1);
+  result = (std::vector< int > *)new std::vector< int >(arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.resize
+
+  call-seq:
+    resize(new_size)
+    resize(new_size, x)
+
+Resize the size of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_resize__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","resize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::size_type","resize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::size_type >(val2);
+  (arg1)->resize(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.erase
+
+  call-seq:
+    erase(pos) -> iterator
+    erase(first, last) -> iterator
+
+Delete a portion of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_erase__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  std::vector< int >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< int >::iterator","erase", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< int >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< int >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< int >::iterator","erase", 2, argv[0] ));
+    }
+  }
+  result = (arg1)->erase(arg2);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< int >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_IntVector_erase__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::iterator arg2 ;
+  std::vector< int >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  swig::Iterator *iter3 = 0 ;
+  int res3 ;
+  std::vector< int >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< int >::iterator","erase", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< int >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< int >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< int >::iterator","erase", 2, argv[0] ));
+    }
+  }
+  res3 = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter3), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< int >::iterator","erase", 3, argv[1] ));
+  } else {
+    swig::Iterator_T<std::vector< int >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< int >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< int >::iterator","erase", 3, argv[1] ));
+    }
+  }
+  result = (arg1)->erase(arg2,arg3);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< int >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_IntVector_erase(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< int >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_IntVector_erase__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< int >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::ConstIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), 
+          swig::Iterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< int >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_IntVector_erase__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "IntVector.erase", 
+    "    std::vector< int >::iterator IntVector.erase(std::vector< int >::iterator pos)\n"
+    "    std::vector< int >::iterator IntVector.erase(std::vector< int >::iterator first, std::vector< int >::iterator last)\n");
+  
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_IntVector_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_IntVector_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_IntVector__SWIG_3(int argc, VALUE *argv, VALUE self) {
+  std::vector< int >::size_type arg1 ;
+  std::vector< int >::value_type *arg2 = 0 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  std::vector< int >::value_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::vector< int > *result = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::vector< int >::size_type","std::vector<(int)>", 1, argv[0] ));
+  } 
+  arg1 = static_cast< std::vector< int >::size_type >(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::value_type","std::vector<(int)>", 2, argv[1] ));
+  } 
+  temp2 = static_cast< std::vector< int >::value_type >(val2);
+  arg2 = &temp2;
+  result = (std::vector< int > *)new std::vector< int >(arg1,(std::vector< int >::value_type const &)*arg2);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_IntVector(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[2];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 2) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_IntVector__SWIG_0(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_IntVector__SWIG_2(nargs, args, self);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_IntVector__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_new_IntVector__SWIG_3(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 2, "IntVector.new", 
+    "    IntVector.new()\n"
+    "    IntVector.new(std::vector< int > const &)\n"
+    "    IntVector.new(std::vector< int >::size_type size)\n"
+    "    IntVector.new(std::vector< int >::size_type size, std::vector< int >::value_type const &value)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.front
+
+  call-seq:
+    front -> value_type
+
+Return the first element in IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_front(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::value_type *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > const *","front", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (std::vector< int >::value_type *) &((std::vector< int > const *)arg1)->front();
+  vresult = SWIG_From_int(static_cast< int >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.back
+
+  call-seq:
+    back -> value_type
+
+Return the last element in IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_back(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::value_type *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > const *","back", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (std::vector< int >::value_type *) &((std::vector< int > const *)arg1)->back();
+  vresult = SWIG_From_int(static_cast< int >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.assign
+
+  call-seq:
+    assign(n, x)
+
+Assign a new IntVector or portion of it.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_assign(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::size_type arg2 ;
+  std::vector< int >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< int >::value_type temp3 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","assign", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::size_type","assign", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::size_type >(val2);
+  ecode3 = SWIG_AsVal_int(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< int >::value_type","assign", 3, argv[1] ));
+  } 
+  temp3 = static_cast< std::vector< int >::value_type >(val3);
+  arg3 = &temp3;
+  (arg1)->assign(arg2,(std::vector< int >::value_type const &)*arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.resize
+
+  call-seq:
+    resize(new_size)
+    resize(new_size, x)
+
+Resize the size of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_resize__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::size_type arg2 ;
+  std::vector< int >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< int >::value_type temp3 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","resize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::size_type","resize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::size_type >(val2);
+  ecode3 = SWIG_AsVal_int(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< int >::value_type","resize", 3, argv[1] ));
+  } 
+  temp3 = static_cast< std::vector< int >::value_type >(val3);
+  arg3 = &temp3;
+  (arg1)->resize(arg2,(std::vector< int >::value_type const &)*arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_IntVector_resize(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_IntVector_resize__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_IntVector_resize__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "IntVector.resize", 
+    "    void IntVector.resize(std::vector< int >::size_type new_size)\n"
+    "    void IntVector.resize(std::vector< int >::size_type new_size, std::vector< int >::value_type const &x)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.insert
+
+  call-seq:
+    insert(pos, argc, ?) -> IntVector
+    insert(pos, x) -> iterator
+    insert(pos, n, x)
+
+Insert one or more new elements in the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_insert__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::iterator arg2 ;
+  std::vector< int >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  std::vector< int >::value_type temp3 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  std::vector< int >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< int >::iterator","insert", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< int >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< int >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< int >::iterator","insert", 2, argv[0] ));
+    }
+  }
+  ecode3 = SWIG_AsVal_int(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< int >::value_type","insert", 3, argv[1] ));
+  } 
+  temp3 = static_cast< std::vector< int >::value_type >(val3);
+  arg3 = &temp3;
+  result = (arg1)->insert(arg2,(std::vector< int >::value_type const &)*arg3);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< int >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_IntVector_insert__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::iterator arg2 ;
+  std::vector< int >::size_type arg3 ;
+  std::vector< int >::value_type *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  std::vector< int >::value_type temp4 ;
+  int val4 ;
+  int ecode4 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< int >::iterator","insert", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< int >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< int >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< int >::iterator","insert", 2, argv[0] ));
+    }
+  }
+  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< int >::size_type","insert", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< int >::size_type >(val3);
+  ecode4 = SWIG_AsVal_int(argv[2], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "std::vector< int >::value_type","insert", 4, argv[2] ));
+  } 
+  temp4 = static_cast< std::vector< int >::value_type >(val4);
+  arg4 = &temp4;
+  (arg1)->insert(arg2,arg3,(std::vector< int >::value_type const &)*arg4);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_IntVector_insert(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[5];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 5) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< int >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_IntVector_insert__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          if (argc <= 3) {
+            return _wrap_IntVector_insert__SWIG_0(nargs, args, self);
+          }
+          return _wrap_IntVector_insert__SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<int,std::allocator< int > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< int >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_size_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            int res = SWIG_AsVal_int(argv[3], NULL);
+            _v = SWIG_CheckState(res);
+          }
+          if (_v) {
+            return _wrap_IntVector_insert__SWIG_2(nargs, args, self);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 5, "insert", 
+    "    void insert(std::vector< int >::difference_type pos, int argc, VALUE *argv, ...)\n"
+    "    void insert(std::vector< int >::iterator pos, std::vector< int >::value_type const &x)\n"
+    "    void insert(std::vector< int >::iterator pos, std::vector< int >::size_type n, std::vector< int >::value_type const &x)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.reserve
+
+  call-seq:
+    reserve(n)
+
+Reserve memory in the IntVector for a number of elements.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_reserve(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  std::vector< int >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","reserve", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< int >::size_type","reserve", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< int >::size_type >(val2);
+  (arg1)->reserve(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.capacity
+
+  call-seq:
+    capacity -> size_type
+
+Reserved capacity of the IntVector.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector_capacity(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > const *","capacity", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = ((std::vector< int > const *)arg1)->capacity();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_IntVector_map_bang(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","map_bang", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  result = (std::vector< int,std::allocator< int > > *)std_vector_Sl_int_Sg__map_bang(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::IntVector.__delete__
+
+  call-seq:
+    __delete__(val) -> VALUE
+
+Delete a matching element.
+*/
+SWIGINTERN VALUE
+_wrap_IntVector___delete__(int argc, VALUE *argv, VALUE self) {
+  std::vector< int > *arg1 = (std::vector< int > *) 0 ;
+  int *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< int > *","__delete__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< int > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","__delete__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< int >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_vector_Sl_int_Sg____delete__(arg1,(int const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_std_vector_Sl_int_Sg_(std::vector< int > *arg1) {
+    delete arg1;
+}
+
+swig_class SwigClassDoubleVector;
+
+
+/*
+  Document-method: CdiObj::DoubleVector.dup
+
+  call-seq:
+    dup -> DoubleVector
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_dup(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg__dup(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_inspect(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (VALUE)std_vector_Sl_double_Sg__inspect(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.to_a
+
+  call-seq:
+    to_a -> VALUE
+
+Convert DoubleVector to an Array.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_to_a(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","to_a", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (VALUE)std_vector_Sl_double_Sg__to_a(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_to_s(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (VALUE)std_vector_Sl_double_Sg__to_s(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.slice
+
+  call-seq:
+    slice(i, j) -> VALUE
+
+Return a slice (portion of) the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_slice(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  std::vector< double >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","slice", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::difference_type","slice", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< double >::difference_type","slice", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< double >::difference_type >(val3);
+  result = (VALUE)std_vector_Sl_double_Sg__slice(arg1,arg2,arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.each
+
+  call-seq:
+    each -> DoubleVector
+
+Iterate thru each element in the DoubleVector.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_each(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","each", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg__each(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.select
+
+  call-seq:
+    select -> DoubleVector
+
+Iterate thru each element in the DoubleVector and select those that match a condition.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_select(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","select", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg__select(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.reject!
+
+  call-seq:
+    reject! -> DoubleVector
+
+Iterate thru each element in the DoubleVector and reject those that fail a condition.  A block must be provided.  DoubleVector is modified in place.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_rejectN___(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","reject_bang", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg__reject_bang(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.delete_at
+
+  call-seq:
+    delete_at(i) -> VALUE
+
+Delete an element at a certain index.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_delete_at(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","delete_at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::difference_type","delete_at", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_double_Sg__delete_at(arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleVector___delete2__(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::value_type temp2 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","__delete2__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_double(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::value_type","__delete2__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::vector< double >::value_type >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_vector_Sl_double_Sg____delete2__(arg1,(double const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.pop
+
+  call-seq:
+    pop -> VALUE
+
+Remove and return element at the end of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_pop(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","pop", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (VALUE)std_vector_Sl_double_Sg__pop(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.push
+
+  call-seq:
+    push(e) -> value_type
+
+Add an element at the end of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_push(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::value_type temp2 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  std::vector< double >::value_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","push", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_double(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::value_type","push", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::vector< double >::value_type >(val2);
+  arg2 = &temp2;
+  result = (std::vector< double >::value_type)std_vector_Sl_double_Sg__push(arg1,(double const &)*arg2);
+  vresult = SWIG_From_double(static_cast< double >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.reject
+
+  call-seq:
+    reject -> DoubleVector
+
+Iterate thru each element in the DoubleVector and reject those that fail a condition returning a new DoubleVector.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_reject(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","reject", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg__reject(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.at
+
+  call-seq:
+    at(i) -> VALUE
+
+Return element at a certain index.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_at(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > const *","at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::difference_type","at", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_double_Sg__at((std::vector< double > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.[]
+
+  call-seq:
+    [](i, j) -> VALUE
+    [](i) -> VALUE
+    [](i) -> VALUE
+
+Element accessor/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector___getitem____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  std::vector< double >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::difference_type","__getitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< double >::difference_type","__getitem__", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< double >::difference_type >(val3);
+  result = (VALUE)std_vector_Sl_double_Sg____getitem____SWIG_0((std::vector< double > const *)arg1,arg2,arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleVector___getitem____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::difference_type","__getitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_double_Sg____getitem____SWIG_1((std::vector< double > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleVector___getitem____SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  VALUE arg2 = (VALUE) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  arg2 = argv[0];
+  result = (VALUE)std_vector_Sl_double_Sg____getitem____SWIG_2((std::vector< double > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_DoubleVector___getitem__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_DoubleVector___getitem____SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      _v = (argv[1] != 0);
+      if (_v) {
+        return _wrap_DoubleVector___getitem____SWIG_2(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_DoubleVector___getitem____SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "__getitem__", 
+    "    VALUE __getitem__(std::vector< double >::difference_type i, std::vector< double >::difference_type j)\n"
+    "    VALUE __getitem__(std::vector< double >::difference_type i)\n"
+    "    VALUE __getitem__(VALUE i)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.[]=
+
+  call-seq:
+    []=(i, x) -> VALUE
+    []=(i, j, v) -> VALUE
+
+Element setter/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector___setitem____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  std::vector< double >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< double >::value_type temp3 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::difference_type","__setitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_double(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< double >::value_type","__setitem__", 3, argv[1] ));
+  } 
+  temp3 = static_cast< std::vector< double >::value_type >(val3);
+  arg3 = &temp3;
+  result = (VALUE)std_vector_Sl_double_Sg____setitem____SWIG_0(arg1,arg2,(double const &)*arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleVector___setitem____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  std::vector< double >::difference_type arg3 ;
+  std::vector< double,std::allocator< double > > *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::difference_type","__setitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< double >::difference_type","__setitem__", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< double >::difference_type >(val3);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res4 = swig::asptr(argv[2], &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > const &","__setitem__", 4, argv[2] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< double,std::allocator< double > > const &","__setitem__", 4, argv[2])); 
+    }
+    arg4 = ptr;
+  }
+  try {
+    result = (VALUE)std_vector_Sl_double_Sg____setitem____SWIG_1(arg1,arg2,arg3,(std::vector< double,std::allocator< double > > const &)*arg4);
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  vresult = result;
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_DoubleVector___setitem__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[5];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 5) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_double(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_DoubleVector___setitem____SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<double,std::allocator< double > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_DoubleVector___setitem____SWIG_1(nargs, args, self);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 5, "__setitem__", 
+    "    VALUE __setitem__(std::vector< double >::difference_type i, std::vector< double >::value_type const &x)\n"
+    "    VALUE __setitem__(std::vector< double >::difference_type i, std::vector< double >::difference_type j, std::vector< double,std::allocator< double > > const &v)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.shift
+
+  call-seq:
+    shift -> VALUE
+
+Remove and return element at the beginning of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_shift(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","shift", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (VALUE)std_vector_Sl_double_Sg__shift(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.insert
+
+  call-seq:
+    insert(pos, argc, ?) -> DoubleVector
+    insert(pos, x) -> iterator
+    insert(pos, n, x)
+
+Insert one or more new elements in the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_insert__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::difference_type arg2 ;
+  int arg3 ;
+  VALUE *arg4 = (VALUE *) 0 ;
+  void *arg5 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if (argc < 2) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::difference_type","insert", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::difference_type >(val2);
+  {
+    arg3 = argc - 1;
+    arg4 = argv + 1;
+  }
+  result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg__insert__SWIG_0(arg1,arg2,arg3,arg4,arg5);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.unshift
+
+  call-seq:
+    unshift(argc, ?) -> DoubleVector
+
+Add one or more elements at the beginning of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_unshift(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  int arg2 ;
+  VALUE *arg3 = (VALUE *) 0 ;
+  void *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if (argc < 1) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","unshift", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  {
+    arg2 = argc;
+    arg3 = argv;
+  }
+  result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg__unshift(arg1,arg2,arg3,arg4);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_DoubleVector__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (std::vector< double > *)new std::vector< double >();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_DoubleVector__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  std::vector< double > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res1 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > const &","std::vector<(double)>", 1, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< double > const &","std::vector<(double)>", 1, argv[0])); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::vector< double > *)new std::vector< double >((std::vector< double > const &)*arg1);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.empty?
+
+  call-seq:
+    empty? -> bool
+
+Check if the DoubleVector is empty or not.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_emptyq___(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > const *","empty", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (bool)((std::vector< double > const *)arg1)->empty();
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.size
+
+  call-seq:
+    size -> size_type
+
+Size or Length of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_size(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > const *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = ((std::vector< double > const *)arg1)->size();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.clear
+
+  call-seq:
+    clear
+
+Clear DoubleVector contents.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_clear(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","clear", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  (arg1)->clear();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleVector_swap(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","swap", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< double > &","swap", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< double > &","swap", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::vector< double > * >(argp2);
+  (arg1)->swap(*arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleVector_get_allocator(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::allocator< double > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > const *","get_allocator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = ((std::vector< double > const *)arg1)->get_allocator();
+  vresult = SWIG_NewPointerObj((new std::vector< double >::allocator_type(static_cast< const std::vector< double >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_double_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.begin
+
+  call-seq:
+    begin -> iterator
+
+Return an iterator to the beginning of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_begin(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","begin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (arg1)->begin();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< double >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.end
+
+  call-seq:
+    end -> iterator
+
+Return an iterator to past the end of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_end(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","end", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (arg1)->end();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< double >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.rbegin
+
+  call-seq:
+    rbegin -> reverse_iterator
+
+Return a reverse iterator to the beginning (the end) of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_rbegin(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","rbegin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (arg1)->rbegin();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< double >::reverse_iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.rend
+
+  call-seq:
+    rend -> reverse_iterator
+
+Return a reverse iterator to past the end (past the beginning) of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_rend(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","rend", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (arg1)->rend();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< double >::reverse_iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_DoubleVector__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< double >::size_type arg1 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  std::vector< double > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::vector< double >::size_type","std::vector<(double)>", 1, argv[0] ));
+  } 
+  arg1 = static_cast< std::vector< double >::size_type >(val1);
+  result = (std::vector< double > *)new std::vector< double >(arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.resize
+
+  call-seq:
+    resize(new_size)
+    resize(new_size, x)
+
+Resize the size of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_resize__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","resize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::size_type","resize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::size_type >(val2);
+  (arg1)->resize(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.erase
+
+  call-seq:
+    erase(pos) -> iterator
+    erase(first, last) -> iterator
+
+Delete a portion of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_erase__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  std::vector< double >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< double >::iterator","erase", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< double >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< double >::iterator","erase", 2, argv[0] ));
+    }
+  }
+  result = (arg1)->erase(arg2);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< double >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleVector_erase__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::iterator arg2 ;
+  std::vector< double >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  swig::Iterator *iter3 = 0 ;
+  int res3 ;
+  std::vector< double >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< double >::iterator","erase", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< double >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< double >::iterator","erase", 2, argv[0] ));
+    }
+  }
+  res3 = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter3), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< double >::iterator","erase", 3, argv[1] ));
+  } else {
+    swig::Iterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< double >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< double >::iterator","erase", 3, argv[1] ));
+    }
+  }
+  result = (arg1)->erase(arg2,arg3);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< double >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_DoubleVector_erase(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< double >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_DoubleVector_erase__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< double >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::ConstIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), 
+          swig::Iterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< double >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_DoubleVector_erase__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "DoubleVector.erase", 
+    "    std::vector< double >::iterator DoubleVector.erase(std::vector< double >::iterator pos)\n"
+    "    std::vector< double >::iterator DoubleVector.erase(std::vector< double >::iterator first, std::vector< double >::iterator last)\n");
+  
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_DoubleVector_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_DoubleVector_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_DoubleVector__SWIG_3(int argc, VALUE *argv, VALUE self) {
+  std::vector< double >::size_type arg1 ;
+  std::vector< double >::value_type *arg2 = 0 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  std::vector< double >::value_type temp2 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  std::vector< double > *result = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::vector< double >::size_type","std::vector<(double)>", 1, argv[0] ));
+  } 
+  arg1 = static_cast< std::vector< double >::size_type >(val1);
+  ecode2 = SWIG_AsVal_double(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::value_type","std::vector<(double)>", 2, argv[1] ));
+  } 
+  temp2 = static_cast< std::vector< double >::value_type >(val2);
+  arg2 = &temp2;
+  result = (std::vector< double > *)new std::vector< double >(arg1,(std::vector< double >::value_type const &)*arg2);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_DoubleVector(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[2];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 2) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_DoubleVector__SWIG_0(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_DoubleVector__SWIG_2(nargs, args, self);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_DoubleVector__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_double(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_new_DoubleVector__SWIG_3(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 2, "DoubleVector.new", 
+    "    DoubleVector.new()\n"
+    "    DoubleVector.new(std::vector< double > const &)\n"
+    "    DoubleVector.new(std::vector< double >::size_type size)\n"
+    "    DoubleVector.new(std::vector< double >::size_type size, std::vector< double >::value_type const &value)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.front
+
+  call-seq:
+    front -> value_type
+
+Return the first element in DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_front(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::value_type *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > const *","front", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (std::vector< double >::value_type *) &((std::vector< double > const *)arg1)->front();
+  vresult = SWIG_From_double(static_cast< double >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.back
+
+  call-seq:
+    back -> value_type
+
+Return the last element in DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_back(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::value_type *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > const *","back", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (std::vector< double >::value_type *) &((std::vector< double > const *)arg1)->back();
+  vresult = SWIG_From_double(static_cast< double >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.assign
+
+  call-seq:
+    assign(n, x)
+
+Assign a new DoubleVector or portion of it.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_assign(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::size_type arg2 ;
+  std::vector< double >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< double >::value_type temp3 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","assign", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::size_type","assign", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::size_type >(val2);
+  ecode3 = SWIG_AsVal_double(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< double >::value_type","assign", 3, argv[1] ));
+  } 
+  temp3 = static_cast< std::vector< double >::value_type >(val3);
+  arg3 = &temp3;
+  (arg1)->assign(arg2,(std::vector< double >::value_type const &)*arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.resize
+
+  call-seq:
+    resize(new_size)
+    resize(new_size, x)
+
+Resize the size of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_resize__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::size_type arg2 ;
+  std::vector< double >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< double >::value_type temp3 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","resize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::size_type","resize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::size_type >(val2);
+  ecode3 = SWIG_AsVal_double(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< double >::value_type","resize", 3, argv[1] ));
+  } 
+  temp3 = static_cast< std::vector< double >::value_type >(val3);
+  arg3 = &temp3;
+  (arg1)->resize(arg2,(std::vector< double >::value_type const &)*arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_DoubleVector_resize(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_DoubleVector_resize__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_double(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_DoubleVector_resize__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "DoubleVector.resize", 
+    "    void DoubleVector.resize(std::vector< double >::size_type new_size)\n"
+    "    void DoubleVector.resize(std::vector< double >::size_type new_size, std::vector< double >::value_type const &x)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.insert
+
+  call-seq:
+    insert(pos, argc, ?) -> DoubleVector
+    insert(pos, x) -> iterator
+    insert(pos, n, x)
+
+Insert one or more new elements in the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_insert__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::iterator arg2 ;
+  std::vector< double >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  std::vector< double >::value_type temp3 ;
+  double val3 ;
+  int ecode3 = 0 ;
+  std::vector< double >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< double >::iterator","insert", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< double >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< double >::iterator","insert", 2, argv[0] ));
+    }
+  }
+  ecode3 = SWIG_AsVal_double(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< double >::value_type","insert", 3, argv[1] ));
+  } 
+  temp3 = static_cast< std::vector< double >::value_type >(val3);
+  arg3 = &temp3;
+  result = (arg1)->insert(arg2,(std::vector< double >::value_type const &)*arg3);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< double >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleVector_insert__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::iterator arg2 ;
+  std::vector< double >::size_type arg3 ;
+  std::vector< double >::value_type *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  std::vector< double >::value_type temp4 ;
+  double val4 ;
+  int ecode4 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< double >::iterator","insert", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< double >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< double >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< double >::iterator","insert", 2, argv[0] ));
+    }
+  }
+  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< double >::size_type","insert", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< double >::size_type >(val3);
+  ecode4 = SWIG_AsVal_double(argv[2], &val4);
+  if (!SWIG_IsOK(ecode4)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "std::vector< double >::value_type","insert", 4, argv[2] ));
+  } 
+  temp4 = static_cast< std::vector< double >::value_type >(val4);
+  arg4 = &temp4;
+  (arg1)->insert(arg2,arg3,(std::vector< double >::value_type const &)*arg4);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_DoubleVector_insert(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[5];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 5) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< double >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_double(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_DoubleVector_insert__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          if (argc <= 3) {
+            return _wrap_DoubleVector_insert__SWIG_0(nargs, args, self);
+          }
+          return _wrap_DoubleVector_insert__SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<double,std::allocator< double > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< double >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_size_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          {
+            int res = SWIG_AsVal_double(argv[3], NULL);
+            _v = SWIG_CheckState(res);
+          }
+          if (_v) {
+            return _wrap_DoubleVector_insert__SWIG_2(nargs, args, self);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 5, "insert", 
+    "    void insert(std::vector< double >::difference_type pos, int argc, VALUE *argv, ...)\n"
+    "    void insert(std::vector< double >::iterator pos, std::vector< double >::value_type const &x)\n"
+    "    void insert(std::vector< double >::iterator pos, std::vector< double >::size_type n, std::vector< double >::value_type const &x)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.reserve
+
+  call-seq:
+    reserve(n)
+
+Reserve memory in the DoubleVector for a number of elements.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_reserve(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  std::vector< double >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","reserve", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< double >::size_type","reserve", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< double >::size_type >(val2);
+  (arg1)->reserve(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.capacity
+
+  call-seq:
+    capacity -> size_type
+
+Reserved capacity of the DoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector_capacity(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > const *","capacity", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = ((std::vector< double > const *)arg1)->capacity();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleVector_map_bang(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","map_bang", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)std_vector_Sl_double_Sg__map_bang(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleVector.__delete__
+
+  call-seq:
+    __delete__(val) -> VALUE
+
+Delete a matching element.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleVector___delete__(int argc, VALUE *argv, VALUE self) {
+  std::vector< double > *arg1 = (std::vector< double > *) 0 ;
+  double *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double temp2 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< double > *","__delete__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< double > * >(argp1);
+  ecode2 = SWIG_AsVal_double(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","__delete__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< double >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_vector_Sl_double_Sg____delete__(arg1,(double const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_std_vector_Sl_double_Sg_(std::vector< double > *arg1) {
+    delete arg1;
+}
+
+swig_class SwigClassDoubleDoubleVector;
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.dup
+
+  call-seq:
+    dup -> DoubleDoubleVector
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_dup(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)std_vector_Sl_std_vector_Sl_double_Sg__Sg__dup(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_inspect(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg__inspect(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.to_a
+
+  call-seq:
+    to_a -> VALUE
+
+Convert DoubleDoubleVector to an Array.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_to_a(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","to_a", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg__to_a(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_to_s(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg__to_s(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.slice
+
+  call-seq:
+    slice(i, j) -> VALUE
+
+Return a slice (portion of) the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_slice(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  std::vector< std::vector< double > >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","slice", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::difference_type","slice", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::difference_type","slice", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< std::vector< double > >::difference_type >(val3);
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg__slice(arg1,arg2,arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.each
+
+  call-seq:
+    each -> DoubleDoubleVector
+
+Iterate thru each element in the DoubleDoubleVector.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_each(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","each", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)std_vector_Sl_std_vector_Sl_double_Sg__Sg__each(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.select
+
+  call-seq:
+    select -> DoubleDoubleVector
+
+Iterate thru each element in the DoubleDoubleVector and select those that match a condition.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_select(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","select", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)std_vector_Sl_std_vector_Sl_double_Sg__Sg__select(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.reject!
+
+  call-seq:
+    reject! -> DoubleDoubleVector
+
+Iterate thru each element in the DoubleDoubleVector and reject those that fail a condition.  A block must be provided.  DoubleDoubleVector is modified in place.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_rejectN___(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","reject_bang", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)std_vector_Sl_std_vector_Sl_double_Sg__Sg__reject_bang(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.delete_at
+
+  call-seq:
+    delete_at(i) -> VALUE
+
+Delete an element at a certain index.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_delete_at(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","delete_at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::difference_type","delete_at", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg__delete_at(arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector___delete2__(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","__delete2__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res2 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::value_type const &","__delete2__", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::vector< double > >::value_type const &","__delete2__", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg____delete2__(arg1,(std::vector< double,std::allocator< double > > const &)*arg2);
+  vresult = result;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.pop
+
+  call-seq:
+    pop -> VALUE
+
+Remove and return element at the end of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_pop(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","pop", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg__pop(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.push
+
+  call-seq:
+    push(e) -> value_type
+
+Add an element at the end of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_push(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  std::vector< std::vector< double > >::value_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","push", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res2 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::value_type const &","push", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::vector< double > >::value_type const &","push", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = std_vector_Sl_std_vector_Sl_double_Sg__Sg__push(arg1,(std::vector< double,std::allocator< double > > const &)*arg2);
+  vresult = swig::from(static_cast< std::vector<double,std::allocator< double > > >(result));
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.reject
+
+  call-seq:
+    reject -> DoubleDoubleVector
+
+Iterate thru each element in the DoubleDoubleVector and reject those that fail a condition returning a new DoubleDoubleVector.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_reject(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","reject", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)std_vector_Sl_std_vector_Sl_double_Sg__Sg__reject(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.at
+
+  call-seq:
+    at(i) -> VALUE
+
+Return element at a certain index.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_at(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > const *","at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::difference_type","at", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg__at((std::vector< std::vector< double > > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.[]
+
+  call-seq:
+    [](i, j) -> VALUE
+    [](i) -> VALUE
+    [](i) -> VALUE
+
+Element accessor/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector___getitem____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  std::vector< std::vector< double > >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::difference_type","__getitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::difference_type","__getitem__", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< std::vector< double > >::difference_type >(val3);
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg____getitem____SWIG_0((std::vector< std::vector< double > > const *)arg1,arg2,arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector___getitem____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::difference_type","__getitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg____getitem____SWIG_1((std::vector< std::vector< double > > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector___getitem____SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  VALUE arg2 = (VALUE) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  arg2 = argv[0];
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg____getitem____SWIG_2((std::vector< std::vector< double > > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_DoubleDoubleVector___getitem__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_DoubleDoubleVector___getitem____SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      _v = (argv[1] != 0);
+      if (_v) {
+        return _wrap_DoubleDoubleVector___getitem____SWIG_2(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_DoubleDoubleVector___getitem____SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "__getitem__", 
+    "    VALUE __getitem__(std::vector< std::vector< double > >::difference_type i, std::vector< std::vector< double > >::difference_type j)\n"
+    "    VALUE __getitem__(std::vector< std::vector< double > >::difference_type i)\n"
+    "    VALUE __getitem__(VALUE i)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.[]=
+
+  call-seq:
+    []=(i, x) -> VALUE
+    []=(i, j, v) -> VALUE
+
+Element setter/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector___setitem____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  std::vector< std::vector< double > >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::difference_type","__setitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res3 = swig::asptr(argv[1], &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::value_type const &","__setitem__", 3, argv[1] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::vector< double > >::value_type const &","__setitem__", 3, argv[1])); 
+    }
+    arg3 = ptr;
+  }
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg____setitem____SWIG_0(arg1,arg2,(std::vector< double,std::allocator< double > > const &)*arg3);
+  vresult = result;
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector___setitem____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  std::vector< std::vector< double > >::difference_type arg3 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::difference_type","__setitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::difference_type","__setitem__", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< std::vector< double > >::difference_type >(val3);
+  {
+    std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0;
+    res4 = swig::asptr(argv[2], &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &","__setitem__", 4, argv[2] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &","__setitem__", 4, argv[2])); 
+    }
+    arg4 = ptr;
+  }
+  try {
+    result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg____setitem____SWIG_1(arg1,arg2,arg3,(std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &)*arg4);
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  vresult = result;
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_DoubleDoubleVector___setitem__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[5];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 5) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = swig::asptr(argv[2], (std::vector<double,std::allocator< double > >**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_DoubleDoubleVector___setitem____SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_DoubleDoubleVector___setitem____SWIG_1(nargs, args, self);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 5, "__setitem__", 
+    "    VALUE __setitem__(std::vector< std::vector< double > >::difference_type i, std::vector< std::vector< double > >::value_type const &x)\n"
+    "    VALUE __setitem__(std::vector< std::vector< double > >::difference_type i, std::vector< std::vector< double > >::difference_type j, std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > const &v)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.shift
+
+  call-seq:
+    shift -> VALUE
+
+Remove and return element at the beginning of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_shift(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","shift", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (VALUE)std_vector_Sl_std_vector_Sl_double_Sg__Sg__shift(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.insert
+
+  call-seq:
+    insert(pos, argc, ?) -> DoubleDoubleVector
+    insert(pos, x) -> iterator
+    insert(pos, n, x)
+
+Insert one or more new elements in the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_insert__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::difference_type arg2 ;
+  int arg3 ;
+  VALUE *arg4 = (VALUE *) 0 ;
+  void *arg5 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if (argc < 2) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::difference_type","insert", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::difference_type >(val2);
+  {
+    arg3 = argc - 1;
+    arg4 = argv + 1;
+  }
+  result = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)std_vector_Sl_std_vector_Sl_double_Sg__Sg__insert__SWIG_0(arg1,arg2,arg3,arg4,arg5);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.unshift
+
+  call-seq:
+    unshift(argc, ?) -> DoubleDoubleVector
+
+Add one or more elements at the beginning of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_unshift(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  int arg2 ;
+  VALUE *arg3 = (VALUE *) 0 ;
+  void *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if (argc < 1) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","unshift", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  {
+    arg2 = argc;
+    arg3 = argv;
+  }
+  result = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)std_vector_Sl_std_vector_Sl_double_Sg__Sg__unshift(arg1,arg2,arg3,arg4);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_DoubleDoubleVector__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (std::vector< std::vector< double > > *)new std::vector< std::vector< double > >();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_DoubleDoubleVector__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double,std::allocator< double > > > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  std::vector< std::vector< double > > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  {
+    std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *ptr = (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)0;
+    res1 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double,std::allocator< double > > > const &","std::vector<(std::vector<(double)>)>", 1, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::vector< double,std::allocator< double > > > const &","std::vector<(std::vector<(double)>)>", 1, argv[0])); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::vector< std::vector< double > > *)new std::vector< std::vector< double > >((std::vector< std::vector< double,std::allocator< double > > > const &)*arg1);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.empty?
+
+  call-seq:
+    empty? -> bool
+
+Check if the DoubleDoubleVector is empty or not.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_emptyq___(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > const *","empty", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (bool)((std::vector< std::vector< double > > const *)arg1)->empty();
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.size
+
+  call-seq:
+    size -> size_type
+
+Size or Length of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_size(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double > >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > const *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = ((std::vector< std::vector< double > > const *)arg1)->size();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.clear
+
+  call-seq:
+    clear
+
+Clear DoubleDoubleVector contents.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_clear(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","clear", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  (arg1)->clear();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_swap(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double,std::allocator< double > > > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","swap", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< std::vector< double,std::allocator< double > > > &","swap", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::vector< double,std::allocator< double > > > &","swap", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::vector< std::vector< double,std::allocator< double > > > * >(argp2);
+  (arg1)->swap(*arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_get_allocator(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::allocator< std::vector< double,std::allocator< double > > > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > const *","get_allocator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = ((std::vector< std::vector< double > > const *)arg1)->get_allocator();
+  vresult = SWIG_NewPointerObj((new std::vector< std::vector< double > >::allocator_type(static_cast< const std::vector< std::vector< double > >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.begin
+
+  call-seq:
+    begin -> iterator
+
+Return an iterator to the beginning of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_begin(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double > >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","begin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (arg1)->begin();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::vector< double > >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.end
+
+  call-seq:
+    end -> iterator
+
+Return an iterator to past the end of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_end(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double > >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","end", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (arg1)->end();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::vector< double > >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.rbegin
+
+  call-seq:
+    rbegin -> reverse_iterator
+
+Return a reverse iterator to the beginning (the end) of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_rbegin(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double > >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","rbegin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (arg1)->rbegin();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::vector< double > >::reverse_iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.rend
+
+  call-seq:
+    rend -> reverse_iterator
+
+Return a reverse iterator to past the end (past the beginning) of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_rend(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double > >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","rend", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (arg1)->rend();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::vector< double > >::reverse_iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_DoubleDoubleVector__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > >::size_type arg1 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  std::vector< std::vector< double > > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::size_type","std::vector<(std::vector<(double)>)>", 1, argv[0] ));
+  } 
+  arg1 = static_cast< std::vector< std::vector< double > >::size_type >(val1);
+  result = (std::vector< std::vector< double > > *)new std::vector< std::vector< double > >(arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.resize
+
+  call-seq:
+    resize(new_size)
+    resize(new_size, x)
+
+Resize the size of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_resize__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","resize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::size_type","resize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::size_type >(val2);
+  (arg1)->resize(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.erase
+
+  call-seq:
+    erase(pos) -> iterator
+    erase(first, last) -> iterator
+
+Delete a portion of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_erase__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  std::vector< std::vector< double > >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::iterator","erase", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< std::vector< double > >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< std::vector< double > >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::iterator","erase", 2, argv[0] ));
+    }
+  }
+  result = (arg1)->erase(arg2);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::vector< double > >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_erase__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::iterator arg2 ;
+  std::vector< std::vector< double > >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  swig::Iterator *iter3 = 0 ;
+  int res3 ;
+  std::vector< std::vector< double > >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::iterator","erase", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< std::vector< double > >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< std::vector< double > >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::iterator","erase", 2, argv[0] ));
+    }
+  }
+  res3 = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter3), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::iterator","erase", 3, argv[1] ));
+  } else {
+    swig::Iterator_T<std::vector< std::vector< double > >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< std::vector< double > >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::iterator","erase", 3, argv[1] ));
+    }
+  }
+  result = (arg1)->erase(arg2,arg3);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::vector< double > >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_DoubleDoubleVector_erase(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< std::vector< double > >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_DoubleDoubleVector_erase__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< std::vector< double > >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::ConstIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), 
+          swig::Iterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< std::vector< double > >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_DoubleDoubleVector_erase__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "DoubleDoubleVector.erase", 
+    "    std::vector< std::vector< double > >::iterator DoubleDoubleVector.erase(std::vector< std::vector< double > >::iterator pos)\n"
+    "    std::vector< std::vector< double > >::iterator DoubleDoubleVector.erase(std::vector< std::vector< double > >::iterator first, std::vector< std::vector< double > >::iterator last)\n");
+  
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_DoubleDoubleVector_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_DoubleDoubleVector__SWIG_3(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > >::size_type arg1 ;
+  std::vector< std::vector< double > >::value_type *arg2 = 0 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  std::vector< std::vector< double > > *result = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::size_type","std::vector<(std::vector<(double)>)>", 1, argv[0] ));
+  } 
+  arg1 = static_cast< std::vector< std::vector< double > >::size_type >(val1);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res2 = swig::asptr(argv[1], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::value_type const &","std::vector<(std::vector<(double)>)>", 2, argv[1] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::vector< double > >::value_type const &","std::vector<(std::vector<(double)>)>", 2, argv[1])); 
+    }
+    arg2 = ptr;
+  }
+  result = (std::vector< std::vector< double > > *)new std::vector< std::vector< double > >(arg1,(std::vector< std::vector< double > >::value_type const &)*arg2);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_DoubleDoubleVector(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[2];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 2) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_DoubleDoubleVector__SWIG_0(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_DoubleDoubleVector__SWIG_2(nargs, args, self);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_DoubleDoubleVector__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      int res = swig::asptr(argv[1], (std::vector<double,std::allocator< double > >**)(0));
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_new_DoubleDoubleVector__SWIG_3(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 2, "DoubleDoubleVector.new", 
+    "    DoubleDoubleVector.new()\n"
+    "    DoubleDoubleVector.new(std::vector< std::vector< double,std::allocator< double > > > const &)\n"
+    "    DoubleDoubleVector.new(std::vector< std::vector< double > >::size_type size)\n"
+    "    DoubleDoubleVector.new(std::vector< std::vector< double > >::size_type size, std::vector< std::vector< double > >::value_type const &value)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.front
+
+  call-seq:
+    front -> value_type
+
+Return the first element in DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_front(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double > >::value_type *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > const *","front", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (std::vector< std::vector< double > >::value_type *) &((std::vector< std::vector< double > > const *)arg1)->front();
+  vresult = swig::from(static_cast< std::vector<double,std::allocator< double > > >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.back
+
+  call-seq:
+    back -> value_type
+
+Return the last element in DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_back(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double > >::value_type *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > const *","back", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = (std::vector< std::vector< double > >::value_type *) &((std::vector< std::vector< double > > const *)arg1)->back();
+  vresult = swig::from(static_cast< std::vector<double,std::allocator< double > > >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.assign
+
+  call-seq:
+    assign(n, x)
+
+Assign a new DoubleDoubleVector or portion of it.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_assign(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::size_type arg2 ;
+  std::vector< std::vector< double > >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","assign", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::size_type","assign", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::size_type >(val2);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res3 = swig::asptr(argv[1], &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::value_type const &","assign", 3, argv[1] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::vector< double > >::value_type const &","assign", 3, argv[1])); 
+    }
+    arg3 = ptr;
+  }
+  (arg1)->assign(arg2,(std::vector< std::vector< double > >::value_type const &)*arg3);
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.resize
+
+  call-seq:
+    resize(new_size)
+    resize(new_size, x)
+
+Resize the size of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_resize__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::size_type arg2 ;
+  std::vector< std::vector< double > >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","resize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::size_type","resize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::size_type >(val2);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res3 = swig::asptr(argv[1], &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::value_type const &","resize", 3, argv[1] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::vector< double > >::value_type const &","resize", 3, argv[1])); 
+    }
+    arg3 = ptr;
+  }
+  (arg1)->resize(arg2,(std::vector< std::vector< double > >::value_type const &)*arg3);
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_DoubleDoubleVector_resize(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_DoubleDoubleVector_resize__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = swig::asptr(argv[2], (std::vector<double,std::allocator< double > >**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_DoubleDoubleVector_resize__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "DoubleDoubleVector.resize", 
+    "    void DoubleDoubleVector.resize(std::vector< std::vector< double > >::size_type new_size)\n"
+    "    void DoubleDoubleVector.resize(std::vector< std::vector< double > >::size_type new_size, std::vector< std::vector< double > >::value_type const &x)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.insert
+
+  call-seq:
+    insert(pos, argc, ?) -> DoubleDoubleVector
+    insert(pos, x) -> iterator
+    insert(pos, n, x)
+
+Insert one or more new elements in the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_insert__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::iterator arg2 ;
+  std::vector< std::vector< double > >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  int res3 = SWIG_OLDOBJ ;
+  std::vector< std::vector< double > >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::iterator","insert", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< std::vector< double > >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< std::vector< double > >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::iterator","insert", 2, argv[0] ));
+    }
+  }
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res3 = swig::asptr(argv[1], &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::value_type const &","insert", 3, argv[1] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::vector< double > >::value_type const &","insert", 3, argv[1])); 
+    }
+    arg3 = ptr;
+  }
+  result = (arg1)->insert(arg2,(std::vector< std::vector< double > >::value_type const &)*arg3);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::vector< double > >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_insert__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::iterator arg2 ;
+  std::vector< std::vector< double > >::size_type arg3 ;
+  std::vector< std::vector< double > >::value_type *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::iterator","insert", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< std::vector< double > >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< std::vector< double > >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::iterator","insert", 2, argv[0] ));
+    }
+  }
+  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::size_type","insert", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< std::vector< double > >::size_type >(val3);
+  {
+    std::vector<double,std::allocator< double > > *ptr = (std::vector<double,std::allocator< double > > *)0;
+    res4 = swig::asptr(argv[2], &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::value_type const &","insert", 4, argv[2] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::vector< double > >::value_type const &","insert", 4, argv[2])); 
+    }
+    arg4 = ptr;
+  }
+  (arg1)->insert(arg2,arg3,(std::vector< std::vector< double > >::value_type const &)*arg4);
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_DoubleDoubleVector_insert(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[5];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 5) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< std::vector< double > >::iterator > *>(iter) != 0));
+      if (_v) {
+        int res = swig::asptr(argv[2], (std::vector<double,std::allocator< double > >**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_DoubleDoubleVector_insert__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          if (argc <= 3) {
+            return _wrap_DoubleDoubleVector_insert__SWIG_0(nargs, args, self);
+          }
+          return _wrap_DoubleDoubleVector_insert__SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< std::vector< double > >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_size_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<double,std::allocator< double > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_DoubleDoubleVector_insert__SWIG_2(nargs, args, self);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 5, "insert", 
+    "    void insert(std::vector< std::vector< double > >::difference_type pos, int argc, VALUE *argv, ...)\n"
+    "    void insert(std::vector< std::vector< double > >::iterator pos, std::vector< std::vector< double > >::value_type const &x)\n"
+    "    void insert(std::vector< std::vector< double > >::iterator pos, std::vector< std::vector< double > >::size_type n, std::vector< std::vector< double > >::value_type const &x)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.reserve
+
+  call-seq:
+    reserve(n)
+
+Reserve memory in the DoubleDoubleVector for a number of elements.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_reserve(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  std::vector< std::vector< double > >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > *","reserve", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::vector< double > >::size_type","reserve", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::vector< double > >::size_type >(val2);
+  (arg1)->reserve(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::DoubleDoubleVector.capacity
+
+  call-seq:
+    capacity -> size_type
+
+Reserved capacity of the DoubleDoubleVector.
+*/
+SWIGINTERN VALUE
+_wrap_DoubleDoubleVector_capacity(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::vector< double > > *arg1 = (std::vector< std::vector< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double > >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::vector< double > > const *","capacity", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::vector< double > > * >(argp1);
+  result = ((std::vector< std::vector< double > > const *)arg1)->capacity();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_std_vector_Sl_std_vector_Sl_double_Sg__Sg_(std::vector< std::vector< double > > *arg1) {
+    delete arg1;
+}
+
+swig_class SwigClassStringVector;
+
+
+/*
+  Document-method: CdiObj::StringVector.dup
+
+  call-seq:
+    dup -> StringVector
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_dup(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg__dup(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_inspect(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (VALUE)std_vector_Sl_std_string_Sg__inspect(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.to_a
+
+  call-seq:
+    to_a -> VALUE
+
+Convert StringVector to an Array.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_to_a(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","to_a", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (VALUE)std_vector_Sl_std_string_Sg__to_a(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_to_s(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (VALUE)std_vector_Sl_std_string_Sg__to_s(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.slice
+
+  call-seq:
+    slice(i, j) -> VALUE
+
+Return a slice (portion of) the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_slice(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  std::vector< std::string >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","slice", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::difference_type","slice", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< std::string >::difference_type","slice", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< std::string >::difference_type >(val3);
+  result = (VALUE)std_vector_Sl_std_string_Sg__slice(arg1,arg2,arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.each
+
+  call-seq:
+    each -> StringVector
+
+Iterate thru each element in the StringVector.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_each(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","each", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg__each(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.select
+
+  call-seq:
+    select -> StringVector
+
+Iterate thru each element in the StringVector and select those that match a condition.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_select(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","select", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg__select(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.reject!
+
+  call-seq:
+    reject! -> StringVector
+
+Iterate thru each element in the StringVector and reject those that fail a condition.  A block must be provided.  StringVector is modified in place.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_rejectN___(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","reject_bang", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg__reject_bang(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.delete_at
+
+  call-seq:
+    delete_at(i) -> VALUE
+
+Delete an element at a certain index.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_delete_at(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","delete_at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::difference_type","delete_at", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_std_string_Sg__delete_at(arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_StringVector___delete2__(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","__delete2__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< std::string >::value_type const &","__delete2__", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::string >::value_type const &","__delete2__", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = (VALUE)std_vector_Sl_std_string_Sg____delete2__(arg1,(std::string const &)*arg2);
+  vresult = result;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.pop
+
+  call-seq:
+    pop -> VALUE
+
+Remove and return element at the end of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_pop(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","pop", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (VALUE)std_vector_Sl_std_string_Sg__pop(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.push
+
+  call-seq:
+    push(e) -> value_type
+
+Add an element at the end of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_push(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  std::vector< std::string >::value_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","push", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< std::string >::value_type const &","push", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::string >::value_type const &","push", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = std_vector_Sl_std_string_Sg__push(arg1,(std::string const &)*arg2);
+  vresult = SWIG_From_std_string(static_cast< std::string >(result));
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.reject
+
+  call-seq:
+    reject -> StringVector
+
+Iterate thru each element in the StringVector and reject those that fail a condition returning a new StringVector.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_reject(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","reject", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg__reject(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.at
+
+  call-seq:
+    at(i) -> VALUE
+
+Return element at a certain index.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_at(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > const *","at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::difference_type","at", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_std_string_Sg__at((std::vector< std::string > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.[]
+
+  call-seq:
+    [](i, j) -> VALUE
+    [](i) -> VALUE
+    [](i) -> VALUE
+
+Element accessor/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector___getitem____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  std::vector< std::string >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::difference_type","__getitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< std::string >::difference_type","__getitem__", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< std::string >::difference_type >(val3);
+  result = (VALUE)std_vector_Sl_std_string_Sg____getitem____SWIG_0((std::vector< std::string > const *)arg1,arg2,arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_StringVector___getitem____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::difference_type","__getitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_std_string_Sg____getitem____SWIG_1((std::vector< std::string > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_StringVector___getitem____SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  VALUE arg2 = (VALUE) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  arg2 = argv[0];
+  result = (VALUE)std_vector_Sl_std_string_Sg____getitem____SWIG_2((std::vector< std::string > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_StringVector___getitem__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_StringVector___getitem____SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      _v = (argv[1] != 0);
+      if (_v) {
+        return _wrap_StringVector___getitem____SWIG_2(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_StringVector___getitem____SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "__getitem__", 
+    "    VALUE __getitem__(std::vector< std::string >::difference_type i, std::vector< std::string >::difference_type j)\n"
+    "    VALUE __getitem__(std::vector< std::string >::difference_type i)\n"
+    "    VALUE __getitem__(VALUE i)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.[]=
+
+  call-seq:
+    []=(i, x) -> VALUE
+    []=(i, j, v) -> VALUE
+
+Element setter/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector___setitem____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  std::vector< std::string >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::difference_type","__setitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  {
+    std::string *ptr = (std::string *)0;
+    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< std::string >::value_type const &","__setitem__", 3, argv[1] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::string >::value_type const &","__setitem__", 3, argv[1])); 
+    }
+    arg3 = ptr;
+  }
+  result = (VALUE)std_vector_Sl_std_string_Sg____setitem____SWIG_0(arg1,arg2,(std::string const &)*arg3);
+  vresult = result;
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_StringVector___setitem____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  std::vector< std::string >::difference_type arg3 ;
+  std::vector< std::string,std::allocator< std::string > > *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::difference_type","__setitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< std::string >::difference_type","__setitem__", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< std::string >::difference_type >(val3);
+  {
+    std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0;
+    res4 = swig::asptr(argv[2], &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::vector< std::string,std::allocator< std::string > > const &","__setitem__", 4, argv[2] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::string,std::allocator< std::string > > const &","__setitem__", 4, argv[2])); 
+    }
+    arg4 = ptr;
+  }
+  try {
+    result = (VALUE)std_vector_Sl_std_string_Sg____setitem____SWIG_1(arg1,arg2,arg3,(std::vector< std::string,std::allocator< std::string > > const &)*arg4);
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  vresult = result;
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_StringVector___setitem__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[5];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 5) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_StringVector___setitem____SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<std::string,std::allocator< std::string > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_StringVector___setitem____SWIG_1(nargs, args, self);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 5, "__setitem__", 
+    "    VALUE __setitem__(std::vector< std::string >::difference_type i, std::vector< std::string >::value_type const &x)\n"
+    "    VALUE __setitem__(std::vector< std::string >::difference_type i, std::vector< std::string >::difference_type j, std::vector< std::string,std::allocator< std::string > > const &v)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.shift
+
+  call-seq:
+    shift -> VALUE
+
+Remove and return element at the beginning of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_shift(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","shift", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (VALUE)std_vector_Sl_std_string_Sg__shift(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.insert
+
+  call-seq:
+    insert(pos, argc, ?) -> StringVector
+    insert(pos, x) -> iterator
+    insert(pos, n, x)
+
+Insert one or more new elements in the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_insert__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::difference_type arg2 ;
+  int arg3 ;
+  VALUE *arg4 = (VALUE *) 0 ;
+  void *arg5 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if (argc < 2) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::difference_type","insert", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::difference_type >(val2);
+  {
+    arg3 = argc - 1;
+    arg4 = argv + 1;
+  }
+  result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg__insert__SWIG_0(arg1,arg2,arg3,arg4,arg5);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.unshift
+
+  call-seq:
+    unshift(argc, ?) -> StringVector
+
+Add one or more elements at the beginning of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_unshift(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  int arg2 ;
+  VALUE *arg3 = (VALUE *) 0 ;
+  void *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if (argc < 1) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","unshift", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  {
+    arg2 = argc;
+    arg3 = argv;
+  }
+  result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg__unshift(arg1,arg2,arg3,arg4);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_StringVector__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (std::vector< std::string > *)new std::vector< std::string >();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_StringVector__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  std::vector< std::string > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  {
+    std::vector<std::string,std::allocator< std::string > > *ptr = (std::vector<std::string,std::allocator< std::string > > *)0;
+    res1 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > const &","std::vector<(std::string)>", 1, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::string > const &","std::vector<(std::string)>", 1, argv[0])); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::vector< std::string > *)new std::vector< std::string >((std::vector< std::string > const &)*arg1);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.empty?
+
+  call-seq:
+    empty? -> bool
+
+Check if the StringVector is empty or not.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_emptyq___(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > const *","empty", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (bool)((std::vector< std::string > const *)arg1)->empty();
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.size
+
+  call-seq:
+    size -> size_type
+
+Size or Length of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_size(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > const *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = ((std::vector< std::string > const *)arg1)->size();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.clear
+
+  call-seq:
+    clear
+
+Clear StringVector contents.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_clear(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","clear", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  (arg1)->clear();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_StringVector_swap(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","swap", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< std::string > &","swap", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::string > &","swap", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::vector< std::string > * >(argp2);
+  (arg1)->swap(*arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_StringVector_get_allocator(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::allocator< std::string > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > const *","get_allocator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = ((std::vector< std::string > const *)arg1)->get_allocator();
+  vresult = SWIG_NewPointerObj((new std::vector< std::string >::allocator_type(static_cast< const std::vector< std::string >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__string_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.begin
+
+  call-seq:
+    begin -> iterator
+
+Return an iterator to the beginning of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_begin(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","begin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (arg1)->begin();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::string >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.end
+
+  call-seq:
+    end -> iterator
+
+Return an iterator to past the end of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_end(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","end", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (arg1)->end();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::string >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.rbegin
+
+  call-seq:
+    rbegin -> reverse_iterator
+
+Return a reverse iterator to the beginning (the end) of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_rbegin(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","rbegin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (arg1)->rbegin();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::string >::reverse_iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.rend
+
+  call-seq:
+    rend -> reverse_iterator
+
+Return a reverse iterator to past the end (past the beginning) of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_rend(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","rend", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (arg1)->rend();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::string >::reverse_iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_StringVector__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string >::size_type arg1 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  std::vector< std::string > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::vector< std::string >::size_type","std::vector<(std::string)>", 1, argv[0] ));
+  } 
+  arg1 = static_cast< std::vector< std::string >::size_type >(val1);
+  result = (std::vector< std::string > *)new std::vector< std::string >(arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.resize
+
+  call-seq:
+    resize(new_size)
+    resize(new_size, x)
+
+Resize the size of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_resize__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","resize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::size_type","resize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+  (arg1)->resize(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.erase
+
+  call-seq:
+    erase(pos) -> iterator
+    erase(first, last) -> iterator
+
+Delete a portion of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_erase__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  std::vector< std::string >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::string >::iterator","erase", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< std::string >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::string >::iterator","erase", 2, argv[0] ));
+    }
+  }
+  result = (arg1)->erase(arg2);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::string >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_StringVector_erase__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::iterator arg2 ;
+  std::vector< std::string >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  swig::Iterator *iter3 = 0 ;
+  int res3 ;
+  std::vector< std::string >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::string >::iterator","erase", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< std::string >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::string >::iterator","erase", 2, argv[0] ));
+    }
+  }
+  res3 = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter3), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::string >::iterator","erase", 3, argv[1] ));
+  } else {
+    swig::Iterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< std::string >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::string >::iterator","erase", 3, argv[1] ));
+    }
+  }
+  result = (arg1)->erase(arg2,arg3);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::string >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_StringVector_erase(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_StringVector_erase__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::ConstIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), 
+          swig::Iterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_StringVector_erase__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "StringVector.erase", 
+    "    std::vector< std::string >::iterator StringVector.erase(std::vector< std::string >::iterator pos)\n"
+    "    std::vector< std::string >::iterator StringVector.erase(std::vector< std::string >::iterator first, std::vector< std::string >::iterator last)\n");
+  
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_StringVector_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_StringVector_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_StringVector__SWIG_3(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string >::size_type arg1 ;
+  std::vector< std::string >::value_type *arg2 = 0 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  std::vector< std::string > *result = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::vector< std::string >::size_type","std::vector<(std::string)>", 1, argv[0] ));
+  } 
+  arg1 = static_cast< std::vector< std::string >::size_type >(val1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[1], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< std::string >::value_type const &","std::vector<(std::string)>", 2, argv[1] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::string >::value_type const &","std::vector<(std::string)>", 2, argv[1])); 
+    }
+    arg2 = ptr;
+  }
+  result = (std::vector< std::string > *)new std::vector< std::string >(arg1,(std::vector< std::string >::value_type const &)*arg2);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_StringVector(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[2];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 2) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_StringVector__SWIG_0(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_StringVector__SWIG_2(nargs, args, self);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_StringVector__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_new_StringVector__SWIG_3(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 2, "StringVector.new", 
+    "    StringVector.new()\n"
+    "    StringVector.new(std::vector< std::string > const &)\n"
+    "    StringVector.new(std::vector< std::string >::size_type size)\n"
+    "    StringVector.new(std::vector< std::string >::size_type size, std::vector< std::string >::value_type const &value)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.front
+
+  call-seq:
+    front -> value_type
+
+Return the first element in StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_front(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string >::value_type *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > const *","front", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (std::vector< std::string >::value_type *) &((std::vector< std::string > const *)arg1)->front();
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.back
+
+  call-seq:
+    back -> value_type
+
+Return the last element in StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_back(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string >::value_type *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > const *","back", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (std::vector< std::string >::value_type *) &((std::vector< std::string > const *)arg1)->back();
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.assign
+
+  call-seq:
+    assign(n, x)
+
+Assign a new StringVector or portion of it.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_assign(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::size_type arg2 ;
+  std::vector< std::string >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","assign", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::size_type","assign", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+  {
+    std::string *ptr = (std::string *)0;
+    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< std::string >::value_type const &","assign", 3, argv[1] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::string >::value_type const &","assign", 3, argv[1])); 
+    }
+    arg3 = ptr;
+  }
+  (arg1)->assign(arg2,(std::vector< std::string >::value_type const &)*arg3);
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.resize
+
+  call-seq:
+    resize(new_size)
+    resize(new_size, x)
+
+Resize the size of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_resize__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::size_type arg2 ;
+  std::vector< std::string >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  int res3 = SWIG_OLDOBJ ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","resize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::size_type","resize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+  {
+    std::string *ptr = (std::string *)0;
+    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< std::string >::value_type const &","resize", 3, argv[1] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::string >::value_type const &","resize", 3, argv[1])); 
+    }
+    arg3 = ptr;
+  }
+  (arg1)->resize(arg2,(std::vector< std::string >::value_type const &)*arg3);
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_StringVector_resize(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_StringVector_resize__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_StringVector_resize__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "StringVector.resize", 
+    "    void StringVector.resize(std::vector< std::string >::size_type new_size)\n"
+    "    void StringVector.resize(std::vector< std::string >::size_type new_size, std::vector< std::string >::value_type const &x)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.insert
+
+  call-seq:
+    insert(pos, argc, ?) -> StringVector
+    insert(pos, x) -> iterator
+    insert(pos, n, x)
+
+Insert one or more new elements in the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_insert__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::iterator arg2 ;
+  std::vector< std::string >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  int res3 = SWIG_OLDOBJ ;
+  std::vector< std::string >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::string >::iterator","insert", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< std::string >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::string >::iterator","insert", 2, argv[0] ));
+    }
+  }
+  {
+    std::string *ptr = (std::string *)0;
+    res3 = SWIG_AsPtr_std_string(argv[1], &ptr);
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< std::string >::value_type const &","insert", 3, argv[1] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::string >::value_type const &","insert", 3, argv[1])); 
+    }
+    arg3 = ptr;
+  }
+  result = (arg1)->insert(arg2,(std::vector< std::string >::value_type const &)*arg3);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< std::string >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res3)) delete arg3;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_StringVector_insert__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::iterator arg2 ;
+  std::vector< std::string >::size_type arg3 ;
+  std::vector< std::string >::value_type *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::string >::iterator","insert", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< std::string >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< std::string >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< std::string >::iterator","insert", 2, argv[0] ));
+    }
+  }
+  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< std::string >::size_type","insert", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< std::string >::size_type >(val3);
+  {
+    std::string *ptr = (std::string *)0;
+    res4 = SWIG_AsPtr_std_string(argv[2], &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::vector< std::string >::value_type const &","insert", 4, argv[2] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< std::string >::value_type const &","insert", 4, argv[2])); 
+    }
+    arg4 = ptr;
+  }
+  (arg1)->insert(arg2,arg3,(std::vector< std::string >::value_type const &)*arg4);
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_StringVector_insert(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[5];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 5) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+      if (_v) {
+        int res = SWIG_AsPtr_std_string(argv[2], (std::string**)(0));
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_StringVector_insert__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          if (argc <= 3) {
+            return _wrap_StringVector_insert__SWIG_0(nargs, args, self);
+          }
+          return _wrap_StringVector_insert__SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<std::string,std::allocator< std::string > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< std::string >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_size_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = SWIG_AsPtr_std_string(argv[3], (std::string**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_StringVector_insert__SWIG_2(nargs, args, self);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 5, "insert", 
+    "    void insert(std::vector< std::string >::difference_type pos, int argc, VALUE *argv, ...)\n"
+    "    void insert(std::vector< std::string >::iterator pos, std::vector< std::string >::value_type const &x)\n"
+    "    void insert(std::vector< std::string >::iterator pos, std::vector< std::string >::size_type n, std::vector< std::string >::value_type const &x)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.reserve
+
+  call-seq:
+    reserve(n)
+
+Reserve memory in the StringVector for a number of elements.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_reserve(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::vector< std::string >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","reserve", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< std::string >::size_type","reserve", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< std::string >::size_type >(val2);
+  (arg1)->reserve(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.capacity
+
+  call-seq:
+    capacity -> size_type
+
+Reserved capacity of the StringVector.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector_capacity(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > const *","capacity", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = ((std::vector< std::string > const *)arg1)->capacity();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_StringVector_map_bang(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","map_bang", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  result = (std::vector< std::string,std::allocator< std::string > > *)std_vector_Sl_std_string_Sg__map_bang(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::StringVector.__delete__
+
+  call-seq:
+    __delete__(val) -> VALUE
+
+Delete a matching element.
+*/
+SWIGINTERN VALUE
+_wrap_StringVector___delete__(int argc, VALUE *argv, VALUE self) {
+  std::vector< std::string > *arg1 = (std::vector< std::string > *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< std::string > *","__delete__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< std::string > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","__delete__", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","__delete__", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = (VALUE)std_vector_Sl_std_string_Sg____delete__(arg1,(std::string const &)*arg2);
+  vresult = result;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_std_vector_Sl_std_string_Sg_(std::vector< std::string > *arg1) {
+    delete arg1;
+}
+
+swig_class SwigClassVarsVector;
+
+
+/*
+  Document-method: CdiObj::VarsVector.dup
+
+  call-seq:
+    dup -> VarsVector
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_dup(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (std::vector< CdiVariable,std::allocator< CdiVariable > > *)std_vector_Sl_CdiVariable_Sg__dup(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_inspect(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg__inspect(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.to_a
+
+  call-seq:
+    to_a -> VALUE
+
+Convert VarsVector to an Array.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_to_a(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","to_a", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg__to_a(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_to_s(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg__to_s(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.slice
+
+  call-seq:
+    slice(i, j) -> VALUE
+
+Return a slice (portion of) the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_slice(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  std::vector< CdiVariable >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","slice", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::difference_type","slice", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::difference_type","slice", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< CdiVariable >::difference_type >(val3);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg__slice(arg1,arg2,arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.each
+
+  call-seq:
+    each -> VarsVector
+
+Iterate thru each element in the VarsVector.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_each(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","each", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (std::vector< CdiVariable,std::allocator< CdiVariable > > *)std_vector_Sl_CdiVariable_Sg__each(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.select
+
+  call-seq:
+    select -> VarsVector
+
+Iterate thru each element in the VarsVector and select those that match a condition.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_select(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","select", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (std::vector< CdiVariable,std::allocator< CdiVariable > > *)std_vector_Sl_CdiVariable_Sg__select(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.reject!
+
+  call-seq:
+    reject! -> VarsVector
+
+Iterate thru each element in the VarsVector and reject those that fail a condition.  A block must be provided.  VarsVector is modified in place.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_rejectN___(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","reject_bang", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (std::vector< CdiVariable,std::allocator< CdiVariable > > *)std_vector_Sl_CdiVariable_Sg__reject_bang(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.delete_at
+
+  call-seq:
+    delete_at(i) -> VALUE
+
+Delete an element at a certain index.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_delete_at(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","delete_at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::difference_type","delete_at", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg__delete_at(arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsVector___delete2__(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","__delete2__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_CdiVariable,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::value_type const &","__delete2__", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CdiVariable >::value_type const &","__delete2__", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp2);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg____delete2__(arg1,(CdiVariable const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.pop
+
+  call-seq:
+    pop -> VALUE
+
+Remove and return element at the end of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_pop(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","pop", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg__pop(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.push
+
+  call-seq:
+    push(e) -> value_type
+
+Add an element at the end of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_push(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::value_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  std::vector< CdiVariable >::value_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","push", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_CdiVariable,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::value_type const &","push", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CdiVariable >::value_type const &","push", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp2);
+  result = std_vector_Sl_CdiVariable_Sg__push(arg1,(CdiVariable const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::vector< CdiVariable >::value_type(static_cast< const std::vector< CdiVariable >::value_type& >(result))), SWIGTYPE_p_CdiVariable, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.reject
+
+  call-seq:
+    reject -> VarsVector
+
+Iterate thru each element in the VarsVector and reject those that fail a condition returning a new VarsVector.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_reject(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","reject", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (std::vector< CdiVariable,std::allocator< CdiVariable > > *)std_vector_Sl_CdiVariable_Sg__reject(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.at
+
+  call-seq:
+    at(i) -> VALUE
+
+Return element at a certain index.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_at(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > const *","at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::difference_type","at", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg__at((std::vector< CdiVariable > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.[]
+
+  call-seq:
+    [](i, j) -> VALUE
+    [](i) -> VALUE
+    [](i) -> VALUE
+
+Element accessor/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector___getitem____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  std::vector< CdiVariable >::difference_type arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::difference_type","__getitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::difference_type","__getitem__", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< CdiVariable >::difference_type >(val3);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg____getitem____SWIG_0((std::vector< CdiVariable > const *)arg1,arg2,arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsVector___getitem____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::difference_type","__getitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg____getitem____SWIG_1((std::vector< CdiVariable > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsVector___getitem____SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  VALUE arg2 = (VALUE) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  arg2 = argv[0];
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg____getitem____SWIG_2((std::vector< CdiVariable > const *)arg1,arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_VarsVector___getitem__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_VarsVector___getitem____SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      _v = (argv[1] != 0);
+      if (_v) {
+        return _wrap_VarsVector___getitem____SWIG_2(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_VarsVector___getitem____SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "__getitem__", 
+    "    VALUE __getitem__(std::vector< CdiVariable >::difference_type i, std::vector< CdiVariable >::difference_type j)\n"
+    "    VALUE __getitem__(std::vector< CdiVariable >::difference_type i)\n"
+    "    VALUE __getitem__(VALUE i)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.[]=
+
+  call-seq:
+    []=(i, x) -> VALUE
+    []=(i, j, v) -> VALUE
+
+Element setter/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector___setitem____SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  std::vector< CdiVariable >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::difference_type","__setitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_CdiVariable,  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::value_type const &","__setitem__", 3, argv[1] )); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CdiVariable >::value_type const &","__setitem__", 3, argv[1])); 
+  }
+  arg3 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp3);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg____setitem____SWIG_0(arg1,arg2,(CdiVariable const &)*arg3);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsVector___setitem____SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  std::vector< CdiVariable >::difference_type arg3 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  ptrdiff_t val3 ;
+  int ecode3 = 0 ;
+  int res4 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::difference_type","__setitem__", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  ecode3 = SWIG_AsVal_ptrdiff_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::difference_type","__setitem__", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< CdiVariable >::difference_type >(val3);
+  {
+    std::vector<CdiVariable,std::allocator< CdiVariable > > *ptr = (std::vector<CdiVariable,std::allocator< CdiVariable > > *)0;
+    res4 = swig::asptr(argv[2], &ptr);
+    if (!SWIG_IsOK(res4)) {
+      SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::vector< CdiVariable,std::allocator< CdiVariable > > const &","__setitem__", 4, argv[2] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CdiVariable,std::allocator< CdiVariable > > const &","__setitem__", 4, argv[2])); 
+    }
+    arg4 = ptr;
+  }
+  try {
+    result = (VALUE)std_vector_Sl_CdiVariable_Sg____setitem____SWIG_1(arg1,arg2,arg3,(std::vector< CdiVariable,std::allocator< CdiVariable > > const &)*arg4);
+  }
+  catch(std::invalid_argument &_e) {
+    SWIG_exception_fail(SWIG_ValueError, (&_e)->what());
+  }
+  
+  vresult = result;
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res4)) delete arg4;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_VarsVector___setitem__(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[5];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 5) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CdiVariable, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_VarsVector___setitem____SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_ptrdiff_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          int res = swig::asptr(argv[3], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_VarsVector___setitem____SWIG_1(nargs, args, self);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 5, "__setitem__", 
+    "    VALUE __setitem__(std::vector< CdiVariable >::difference_type i, std::vector< CdiVariable >::value_type const &x)\n"
+    "    VALUE __setitem__(std::vector< CdiVariable >::difference_type i, std::vector< CdiVariable >::difference_type j, std::vector< CdiVariable,std::allocator< CdiVariable > > const &v)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.shift
+
+  call-seq:
+    shift -> VALUE
+
+Remove and return element at the beginning of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_shift(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","shift", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (VALUE)std_vector_Sl_CdiVariable_Sg__shift(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.insert
+
+  call-seq:
+    insert(pos, argc, ?) -> VarsVector
+    insert(pos, x) -> iterator
+    insert(pos, n, x)
+
+Insert one or more new elements in the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_insert__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::difference_type arg2 ;
+  int arg3 ;
+  VALUE *arg4 = (VALUE *) 0 ;
+  void *arg5 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  ptrdiff_t val2 ;
+  int ecode2 = 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if (argc < 2) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_ptrdiff_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::difference_type","insert", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::difference_type >(val2);
+  {
+    arg3 = argc - 1;
+    arg4 = argv + 1;
+  }
+  result = (std::vector< CdiVariable,std::allocator< CdiVariable > > *)std_vector_Sl_CdiVariable_Sg__insert__SWIG_0(arg1,arg2,arg3,arg4,arg5);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.unshift
+
+  call-seq:
+    unshift(argc, ?) -> VarsVector
+
+Add one or more elements at the beginning of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_unshift(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  int arg2 ;
+  VALUE *arg3 = (VALUE *) 0 ;
+  void *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if (argc < 1) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","unshift", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  {
+    arg2 = argc;
+    arg3 = argv;
+  }
+  result = (std::vector< CdiVariable,std::allocator< CdiVariable > > *)std_vector_Sl_CdiVariable_Sg__unshift(arg1,arg2,arg3,arg4);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_VarsVector__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (std::vector< CdiVariable > *)new std::vector< CdiVariable >();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_VarsVector__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  std::vector< CdiVariable > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  {
+    std::vector<CdiVariable,std::allocator< CdiVariable > > *ptr = (std::vector<CdiVariable,std::allocator< CdiVariable > > *)0;
+    res1 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > const &","std::vector<(CdiVariable)>", 1, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CdiVariable > const &","std::vector<(CdiVariable)>", 1, argv[0])); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::vector< CdiVariable > *)new std::vector< CdiVariable >((std::vector< CdiVariable > const &)*arg1);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.empty?
+
+  call-seq:
+    empty? -> bool
+
+Check if the VarsVector is empty or not.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_emptyq___(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > const *","empty", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (bool)((std::vector< CdiVariable > const *)arg1)->empty();
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.size
+
+  call-seq:
+    size -> size_type
+
+Size or Length of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_size(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > const *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = ((std::vector< CdiVariable > const *)arg1)->size();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.clear
+
+  call-seq:
+    clear
+
+Clear VarsVector contents.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_clear(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","clear", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  (arg1)->clear();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsVector_swap(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","swap", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< CdiVariable > &","swap", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CdiVariable > &","swap", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::vector< CdiVariable > * >(argp2);
+  (arg1)->swap(*arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsVector_get_allocator(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::allocator< CdiVariable > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > const *","get_allocator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = ((std::vector< CdiVariable > const *)arg1)->get_allocator();
+  vresult = SWIG_NewPointerObj((new std::vector< CdiVariable >::allocator_type(static_cast< const std::vector< CdiVariable >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_CdiVariable_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.begin
+
+  call-seq:
+    begin -> iterator
+
+Return an iterator to the beginning of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_begin(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","begin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (arg1)->begin();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< CdiVariable >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.end
+
+  call-seq:
+    end -> iterator
+
+Return an iterator to past the end of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_end(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","end", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (arg1)->end();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< CdiVariable >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.rbegin
+
+  call-seq:
+    rbegin -> reverse_iterator
+
+Return a reverse iterator to the beginning (the end) of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_rbegin(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","rbegin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (arg1)->rbegin();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< CdiVariable >::reverse_iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.rend
+
+  call-seq:
+    rend -> reverse_iterator
+
+Return a reverse iterator to past the end (past the beginning) of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_rend(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","rend", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (arg1)->rend();
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< CdiVariable >::reverse_iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_VarsVector__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable >::size_type arg1 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  std::vector< CdiVariable > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::size_type","std::vector<(CdiVariable)>", 1, argv[0] ));
+  } 
+  arg1 = static_cast< std::vector< CdiVariable >::size_type >(val1);
+  result = (std::vector< CdiVariable > *)new std::vector< CdiVariable >(arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.resize
+
+  call-seq:
+    resize(new_size)
+    resize(new_size, x)
+
+Resize the size of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_resize__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","resize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::size_type","resize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::size_type >(val2);
+  (arg1)->resize(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.erase
+
+  call-seq:
+    erase(pos) -> iterator
+    erase(first, last) -> iterator
+
+Delete a portion of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_erase__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  std::vector< CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::iterator","erase", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< CdiVariable >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::iterator","erase", 2, argv[0] ));
+    }
+  }
+  result = (arg1)->erase(arg2);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< CdiVariable >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsVector_erase__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::iterator arg2 ;
+  std::vector< CdiVariable >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  swig::Iterator *iter3 = 0 ;
+  int res3 ;
+  std::vector< CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::iterator","erase", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< CdiVariable >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::iterator","erase", 2, argv[0] ));
+    }
+  }
+  res3 = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter3), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res3) || !iter3) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::iterator","erase", 3, argv[1] ));
+  } else {
+    swig::Iterator_T<std::vector< CdiVariable >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< CdiVariable >::iterator > *>(iter3);
+    if (iter_t) {
+      arg3 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::iterator","erase", 3, argv[1] ));
+    }
+  }
+  result = (arg1)->erase(arg2,arg3);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< CdiVariable >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_VarsVector_erase(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        return _wrap_VarsVector_erase__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        swig::ConstIterator *iter = 0;
+        int res = SWIG_ConvertPtr(argv[2], SWIG_as_voidptrptr(&iter), 
+          swig::Iterator::descriptor(), 0);
+        _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< CdiVariable >::iterator > *>(iter) != 0));
+        if (_v) {
+          return _wrap_VarsVector_erase__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "VarsVector.erase", 
+    "    std::vector< CdiVariable >::iterator VarsVector.erase(std::vector< CdiVariable >::iterator pos)\n"
+    "    std::vector< CdiVariable >::iterator VarsVector.erase(std::vector< CdiVariable >::iterator first, std::vector< CdiVariable >::iterator last)\n");
+  
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_VarsVector_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_VarsVector_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_VarsVector__SWIG_3(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable >::size_type arg1 ;
+  std::vector< CdiVariable >::value_type *arg2 = 0 ;
+  size_t val1 ;
+  int ecode1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  std::vector< CdiVariable > *result = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_size_t(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::size_type","std::vector<(CdiVariable)>", 1, argv[0] ));
+  } 
+  arg1 = static_cast< std::vector< CdiVariable >::size_type >(val1);
+  res2 = SWIG_ConvertPtr(argv[1], &argp2, SWIGTYPE_p_CdiVariable,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::value_type const &","std::vector<(CdiVariable)>", 2, argv[1] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CdiVariable >::value_type const &","std::vector<(CdiVariable)>", 2, argv[1])); 
+  }
+  arg2 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp2);
+  result = (std::vector< CdiVariable > *)new std::vector< CdiVariable >(arg1,(std::vector< CdiVariable >::value_type const &)*arg2);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_VarsVector(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[2];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 2) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_VarsVector__SWIG_0(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_VarsVector__SWIG_2(nargs, args, self);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_VarsVector__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    {
+      int res = SWIG_AsVal_size_t(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_CdiVariable, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_new_VarsVector__SWIG_3(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 2, "VarsVector.new", 
+    "    VarsVector.new()\n"
+    "    VarsVector.new(std::vector< CdiVariable > const &)\n"
+    "    VarsVector.new(std::vector< CdiVariable >::size_type size)\n"
+    "    VarsVector.new(std::vector< CdiVariable >::size_type size, std::vector< CdiVariable >::value_type const &value)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.front
+
+  call-seq:
+    front -> value_type
+
+Return the first element in VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_front(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable >::value_type *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > const *","front", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (std::vector< CdiVariable >::value_type *) &((std::vector< CdiVariable > const *)arg1)->front();
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiVariable, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.back
+
+  call-seq:
+    back -> value_type
+
+Return the last element in VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_back(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable >::value_type *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > const *","back", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = (std::vector< CdiVariable >::value_type *) &((std::vector< CdiVariable > const *)arg1)->back();
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiVariable, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.assign
+
+  call-seq:
+    assign(n, x)
+
+Assign a new VarsVector or portion of it.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_assign(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::size_type arg2 ;
+  std::vector< CdiVariable >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","assign", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::size_type","assign", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::size_type >(val2);
+  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_CdiVariable,  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::value_type const &","assign", 3, argv[1] )); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CdiVariable >::value_type const &","assign", 3, argv[1])); 
+  }
+  arg3 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp3);
+  (arg1)->assign(arg2,(std::vector< CdiVariable >::value_type const &)*arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.resize
+
+  call-seq:
+    resize(new_size)
+    resize(new_size, x)
+
+Resize the size of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_resize__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::size_type arg2 ;
+  std::vector< CdiVariable >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","resize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::size_type","resize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::size_type >(val2);
+  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_CdiVariable,  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::value_type const &","resize", 3, argv[1] )); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CdiVariable >::value_type const &","resize", 3, argv[1])); 
+  }
+  arg3 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp3);
+  (arg1)->resize(arg2,(std::vector< CdiVariable >::value_type const &)*arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_VarsVector_resize(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_VarsVector_resize__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_size_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CdiVariable, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_VarsVector_resize__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "VarsVector.resize", 
+    "    void VarsVector.resize(std::vector< CdiVariable >::size_type new_size)\n"
+    "    void VarsVector.resize(std::vector< CdiVariable >::size_type new_size, std::vector< CdiVariable >::value_type const &x)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.insert
+
+  call-seq:
+    insert(pos, argc, ?) -> VarsVector
+    insert(pos, x) -> iterator
+    insert(pos, n, x)
+
+Insert one or more new elements in the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_insert__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::iterator arg2 ;
+  std::vector< CdiVariable >::value_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  std::vector< CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::iterator","insert", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< CdiVariable >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::iterator","insert", 2, argv[0] ));
+    }
+  }
+  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_CdiVariable,  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::value_type const &","insert", 3, argv[1] )); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CdiVariable >::value_type const &","insert", 3, argv[1])); 
+  }
+  arg3 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp3);
+  result = (arg1)->insert(arg2,(std::vector< CdiVariable >::value_type const &)*arg3);
+  vresult = SWIG_NewPointerObj(swig::make_nonconst_iterator(static_cast< const std::vector< CdiVariable >::iterator & >(result),
+      self),
+    swig::Iterator::descriptor(),SWIG_POINTER_OWN);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsVector_insert__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::iterator arg2 ;
+  std::vector< CdiVariable >::size_type arg3 ;
+  std::vector< CdiVariable >::value_type *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::Iterator *iter2 = 0 ;
+  int res2 ;
+  size_t val3 ;
+  int ecode3 = 0 ;
+  void *argp4 ;
+  int res4 = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","insert", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], SWIG_as_voidptrptr(&iter2), swig::Iterator::descriptor(), 0);
+  if (!SWIG_IsOK(res2) || !iter2) {
+    SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::iterator","insert", 2, argv[0] ));
+  } else {
+    swig::Iterator_T<std::vector< CdiVariable >::iterator > *iter_t = dynamic_cast<swig::Iterator_T<std::vector< CdiVariable >::iterator > *>(iter2);
+    if (iter_t) {
+      arg2 = iter_t->get_current();
+    } else {
+      SWIG_exception_fail(SWIG_ArgError(SWIG_TypeError), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::iterator","insert", 2, argv[0] ));
+    }
+  }
+  ecode3 = SWIG_AsVal_size_t(argv[1], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::size_type","insert", 3, argv[1] ));
+  } 
+  arg3 = static_cast< std::vector< CdiVariable >::size_type >(val3);
+  res4 = SWIG_ConvertPtr(argv[2], &argp4, SWIGTYPE_p_CdiVariable,  0 );
+  if (!SWIG_IsOK(res4)) {
+    SWIG_exception_fail(SWIG_ArgError(res4), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::value_type const &","insert", 4, argv[2] )); 
+  }
+  if (!argp4) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::vector< CdiVariable >::value_type const &","insert", 4, argv[2])); 
+  }
+  arg4 = reinterpret_cast< std::vector< CdiVariable >::value_type * >(argp4);
+  (arg1)->insert(arg2,arg3,(std::vector< CdiVariable >::value_type const &)*arg4);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_VarsVector_insert(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[5];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 5) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_CdiVariable, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_VarsVector_insert__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_ptrdiff_t(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          if (argc <= 3) {
+            return _wrap_VarsVector_insert__SWIG_0(nargs, args, self);
+          }
+          return _wrap_VarsVector_insert__SWIG_0(nargs, args, self);
+        }
+      }
+    }
+  }
+  if (argc == 4) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::vector<CdiVariable,std::allocator< CdiVariable > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      swig::ConstIterator *iter = 0;
+      int res = SWIG_ConvertPtr(argv[1], SWIG_as_voidptrptr(&iter), 
+        swig::Iterator::descriptor(), 0);
+      _v = (SWIG_IsOK(res) && iter && (dynamic_cast<swig::Iterator_T<std::vector< CdiVariable >::iterator > *>(iter) != 0));
+      if (_v) {
+        {
+          int res = SWIG_AsVal_size_t(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          void *vptr = 0;
+          int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_CdiVariable, 0);
+          _v = SWIG_CheckState(res);
+          if (_v) {
+            return _wrap_VarsVector_insert__SWIG_2(nargs, args, self);
+          }
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 5, "insert", 
+    "    void insert(std::vector< CdiVariable >::difference_type pos, int argc, VALUE *argv, ...)\n"
+    "    void insert(std::vector< CdiVariable >::iterator pos, std::vector< CdiVariable >::value_type const &x)\n"
+    "    void insert(std::vector< CdiVariable >::iterator pos, std::vector< CdiVariable >::size_type n, std::vector< CdiVariable >::value_type const &x)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.reserve
+
+  call-seq:
+    reserve(n)
+
+Reserve memory in the VarsVector for a number of elements.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_reserve(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  std::vector< CdiVariable >::size_type arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  size_t val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > *","reserve", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_size_t(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::vector< CdiVariable >::size_type","reserve", 2, argv[0] ));
+  } 
+  arg2 = static_cast< std::vector< CdiVariable >::size_type >(val2);
+  (arg1)->reserve(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsVector.capacity
+
+  call-seq:
+    capacity -> size_type
+
+Reserved capacity of the VarsVector.
+*/
+SWIGINTERN VALUE
+_wrap_VarsVector_capacity(int argc, VALUE *argv, VALUE self) {
+  std::vector< CdiVariable > *arg1 = (std::vector< CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::vector< CdiVariable > const *","capacity", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::vector< CdiVariable > * >(argp1);
+  result = ((std::vector< CdiVariable > const *)arg1)->capacity();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_std_vector_Sl_CdiVariable_Sg_(std::vector< CdiVariable > *arg1) {
+    delete arg1;
+}
+
+swig_class SwigClassVarsMap;
+
+SWIGINTERN VALUE
+_wrap_new_VarsMap__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::less< std::string > *arg1 = 0 ;
+  void *argp1 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__lessT_std__string_t,  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::less< std::string > const &","std::map<(std::string,CdiVariable)>", 1, argv[0] )); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::less< std::string > const &","std::map<(std::string,CdiVariable)>", 1, argv[0])); 
+  }
+  arg1 = reinterpret_cast< std::less< std::string > * >(argp1);
+  result = (std::map< std::string,CdiVariable > *)new std::map< std::string,CdiVariable >((std::less< std::string > const &)*arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.dup
+
+  call-seq:
+    dup -> VarsMap
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_dup(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *)std_map_Sl_std_string_Sc_CdiVariable_Sg__dup(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.delete
+
+  call-seq:
+    delete(key) -> VALUE
+
+Delete a matching element.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_delete(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","__delete__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::key_type const &","__delete__", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::key_type const &","__delete__", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = (VALUE)std_map_Sl_std_string_Sc_CdiVariable_Sg____delete__(arg1,(std::string const &)*arg2);
+  vresult = result;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_has_keyq___(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > const *","has_key", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::key_type const &","has_key", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::key_type const &","has_key", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = (bool)std_map_Sl_std_string_Sc_CdiVariable_Sg__has_key((std::map< std::string,CdiVariable > const *)arg1,(std::string const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.keys
+
+  call-seq:
+    keys -> VALUE
+
+Return an Array of key elements.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_keys(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","keys", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_std_string_Sc_CdiVariable_Sg__keys(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.each
+
+  call-seq:
+    each -> VarsMap
+
+Iterate thru each element in the VarsMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_each(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","each", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *)std_map_Sl_std_string_Sc_CdiVariable_Sg__each(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.select
+
+  call-seq:
+    select -> VarsMap
+
+Iterate thru each element in the VarsMap and select those that match a condition.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_select(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","select", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *)std_map_Sl_std_string_Sc_CdiVariable_Sg__select(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.values_at
+
+  call-seq:
+    values_at(argc, ?) -> VALUE
+
+Return an Array of value elements matching the conditions.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_values_at(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  int arg2 ;
+  VALUE *arg3 = (VALUE *) 0 ;
+  void *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if (argc < 1) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","values_at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    arg2 = argc;
+    arg3 = argv;
+  }
+  result = (VALUE)std_map_Sl_std_string_Sc_CdiVariable_Sg__values_at(arg1,arg2,arg3,arg4);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.each_key
+
+  call-seq:
+    each_key -> VarsMap
+
+Iterate thru each key element in the VarsMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_each_key(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","each_key", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *)std_map_Sl_std_string_Sc_CdiVariable_Sg__each_key(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.values
+
+  call-seq:
+    values -> VALUE
+
+Return an Array of value elements.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_values(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","values", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_std_string_Sc_CdiVariable_Sg__values(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.each_value
+
+  call-seq:
+    each_value -> VarsMap
+
+Iterate thru each key element in the VarsMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_each_value(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","each_value", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *)std_map_Sl_std_string_Sc_CdiVariable_Sg__each_value(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_entries(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","entries", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_std_string_Sc_CdiVariable_Sg__entries(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_includeq___(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","__contains__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::key_type const &","__contains__", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::key_type const &","__contains__", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = (bool)std_map_Sl_std_string_Sc_CdiVariable_Sg____contains__(arg1,(std::string const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_key_iterator(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  VALUE *arg2 = (VALUE *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  arg2 = &self;
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","key_iterator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (swig::ConstIterator *)std_map_Sl_std_string_Sc_CdiVariable_Sg__key_iterator(arg1,arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_value_iterator(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  VALUE *arg2 = (VALUE *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  arg2 = &self;
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","value_iterator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (swig::ConstIterator *)std_map_Sl_std_string_Sc_CdiVariable_Sg__value_iterator(arg1,arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.[]
+
+  call-seq:
+    [](key) -> VALUE
+
+Element accessor/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap___getitem__(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::key_type const &","__getitem__", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::key_type const &","__getitem__", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = (VALUE)std_map_Sl_std_string_Sc_CdiVariable_Sg____getitem__((std::map< std::string,CdiVariable > const *)arg1,(std::string const &)*arg2);
+  vresult = result;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.[]=
+
+  call-seq:
+    []=(key, x)
+
+Element setter/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap___setitem__(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  std::map< std::string,CdiVariable >::mapped_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::key_type const &","__setitem__", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::key_type const &","__setitem__", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_CdiVariable,  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::mapped_type const &","__setitem__", 3, argv[1] )); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::mapped_type const &","__setitem__", 3, argv[1])); 
+  }
+  arg3 = reinterpret_cast< std::map< std::string,CdiVariable >::mapped_type * >(argp3);
+  try {
+    std_map_Sl_std_string_Sc_CdiVariable_Sg____setitem__(arg1,(std::string const &)*arg2,(CdiVariable const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_inspect(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_std_string_Sc_CdiVariable_Sg__inspect(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.to_a
+
+  call-seq:
+    to_a -> VALUE
+
+Convert VarsMap to an Array.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_to_a(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","to_a", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_std_string_Sc_CdiVariable_Sg__to_a(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_to_s(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_std_string_Sc_CdiVariable_Sg__to_s(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_VarsMap__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (std::map< std::string,CdiVariable > *)new std::map< std::string,CdiVariable >();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_VarsMap_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_VarsMap_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_VarsMap__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  std::map< std::string,CdiVariable > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  {
+    std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *ptr = (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *)0;
+    res1 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > const &","std::map<(std::string,CdiVariable)>", 1, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable > const &","std::map<(std::string,CdiVariable)>", 1, argv[0])); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::map< std::string,CdiVariable > *)new std::map< std::string,CdiVariable >((std::map< std::string,CdiVariable > const &)*arg1);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_VarsMap(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[1];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 1) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_VarsMap__SWIG_1(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__lessT_std__string_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_VarsMap__SWIG_0(nargs, args, self);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_VarsMap__SWIG_2(nargs, args, self);
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 1, "VarsMap.new", 
+    "    VarsMap.new(std::less< std::string > const &)\n"
+    "    VarsMap.new()\n"
+    "    VarsMap.new(std::map< std::string,CdiVariable > const &)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.empty?
+
+  call-seq:
+    empty? -> bool
+
+Check if the VarsMap is empty or not.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_emptyq___(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > const *","empty", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (bool)((std::map< std::string,CdiVariable > const *)arg1)->empty();
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.size
+
+  call-seq:
+    size -> size_type
+
+Size or Length of the VarsMap.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_size(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > const *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = ((std::map< std::string,CdiVariable > const *)arg1)->size();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.clear
+
+  call-seq:
+    clear
+
+Clear VarsMap contents.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_clear(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","clear", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  (arg1)->clear();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_swap(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","swap", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > &","swap", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable > &","swap", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp2);
+  (arg1)->swap(*arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_get_allocator(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::allocator< std::pair< std::string const,CdiVariable > > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > const *","get_allocator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = ((std::map< std::string,CdiVariable > const *)arg1)->get_allocator();
+  vresult = SWIG_NewPointerObj((new std::map< std::string,CdiVariable >::allocator_type(static_cast< const std::map< std::string,CdiVariable >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.begin
+
+  call-seq:
+    begin -> iterator
+
+Return an iterator to the beginning of the VarsMap.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_begin(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","begin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (arg1)->begin();
+  vresult = SWIG_NewPointerObj((new std::map< std::string,CdiVariable >::iterator(static_cast< const std::map< std::string,CdiVariable >::iterator& >(result))), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.end
+
+  call-seq:
+    end -> iterator
+
+Return an iterator to past the end of the VarsMap.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_end(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","end", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (arg1)->end();
+  vresult = SWIG_NewPointerObj((new std::map< std::string,CdiVariable >::iterator(static_cast< const std::map< std::string,CdiVariable >::iterator& >(result))), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.rbegin
+
+  call-seq:
+    rbegin -> reverse_iterator
+
+Return a reverse iterator to the beginning (the end) of the VarsMap.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_rbegin(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","rbegin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (arg1)->rbegin();
+  vresult = SWIG_NewPointerObj((new std::map< std::string,CdiVariable >::reverse_iterator(static_cast< const std::map< std::string,CdiVariable >::reverse_iterator& >(result))), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__reverse_iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.rend
+
+  call-seq:
+    rend -> reverse_iterator
+
+Return a reverse iterator to past the end (past the beginning) of the VarsMap.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_rend(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","rend", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  result = (arg1)->rend();
+  vresult = SWIG_NewPointerObj((new std::map< std::string,CdiVariable >::reverse_iterator(static_cast< const std::map< std::string,CdiVariable >::reverse_iterator& >(result))), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__reverse_iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.erase
+
+  call-seq:
+    erase(x) -> size_type
+    erase(position)
+    erase(first, last)
+
+Delete a portion of the VarsMap.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_erase__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  std::map< std::string,CdiVariable >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::key_type const &","erase", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::key_type const &","erase", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = (arg1)->erase((std::map< std::string,CdiVariable >::key_type const &)*arg2);
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_count(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  std::map< std::string,CdiVariable >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > const *","count", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::key_type const &","count", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::key_type const &","count", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = ((std::map< std::string,CdiVariable > const *)arg1)->count((std::map< std::string,CdiVariable >::key_type const &)*arg2);
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_erase__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::iterator","erase", 2, argv[0] )); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::iterator","erase", 2, argv[0]));
+    } else {
+      arg2 = *(reinterpret_cast< std::map< std::string,CdiVariable >::iterator * >(argp2));
+    }
+  }
+  (arg1)->erase(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_erase__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::iterator arg2 ;
+  std::map< std::string,CdiVariable >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::iterator","erase", 2, argv[0] )); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::iterator","erase", 2, argv[0]));
+    } else {
+      arg2 = *(reinterpret_cast< std::map< std::string,CdiVariable >::iterator * >(argp2));
+    }
+  }
+  {
+    res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::iterator","erase", 3, argv[1] )); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::iterator","erase", 3, argv[1]));
+    } else {
+      arg3 = *(reinterpret_cast< std::map< std::string,CdiVariable >::iterator * >(argp3));
+    }
+  }
+  (arg1)->erase(arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_VarsMap_erase(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_VarsMap_erase__SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      int res = SWIG_AsPtr_std_string(argv[1], (std::string**)(0));
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_VarsMap_erase__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_VarsMap_erase__SWIG_2(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "VarsMap.erase", 
+    "    void VarsMap.erase(std::map< std::string,CdiVariable >::key_type const &x)\n"
+    "    void VarsMap.erase(std::map< std::string,CdiVariable >::iterator position)\n"
+    "    void VarsMap.erase(std::map< std::string,CdiVariable >::iterator first, std::map< std::string,CdiVariable >::iterator last)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsMap.find
+
+  call-seq:
+    find(x) -> iterator
+
+Find an element in the class.
+*/
+SWIGINTERN VALUE
+_wrap_VarsMap_find(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  std::map< std::string,CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","find", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::key_type const &","find", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::key_type const &","find", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = (arg1)->find((std::map< std::string,CdiVariable >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< std::string,CdiVariable >::iterator(static_cast< const std::map< std::string,CdiVariable >::iterator& >(result))), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_lower_bound(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  std::map< std::string,CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","lower_bound", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::key_type const &","lower_bound", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::key_type const &","lower_bound", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = (arg1)->lower_bound((std::map< std::string,CdiVariable >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< std::string,CdiVariable >::iterator(static_cast< const std::map< std::string,CdiVariable >::iterator& >(result))), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsMap_upper_bound(int argc, VALUE *argv, VALUE self) {
+  std::map< std::string,CdiVariable > *arg1 = (std::map< std::string,CdiVariable > *) 0 ;
+  std::map< std::string,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  std::map< std::string,CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable > *","upper_bound", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< std::string,CdiVariable > * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable >::key_type const &","upper_bound", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< std::string,CdiVariable >::key_type const &","upper_bound", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  result = (arg1)->upper_bound((std::map< std::string,CdiVariable >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< std::string,CdiVariable >::iterator(static_cast< const std::map< std::string,CdiVariable >::iterator& >(result))), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return vresult;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_std_map_Sl_std_string_Sc_CdiVariable_Sg_(std::map< std::string,CdiVariable > *arg1) {
+    delete arg1;
+}
+
+swig_class SwigClassVarsByCode;
+
+SWIGINTERN VALUE
+_wrap_new_VarsByCode__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::less< int > *arg1 = 0 ;
+  void *argp1 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__lessT_int_t,  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::less< int > const &","std::map<(int,CdiVariable)>", 1, argv[0] )); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::less< int > const &","std::map<(int,CdiVariable)>", 1, argv[0])); 
+  }
+  arg1 = reinterpret_cast< std::less< int > * >(argp1);
+  result = (std::map< int,CdiVariable > *)new std::map< int,CdiVariable >((std::less< int > const &)*arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.dup
+
+  call-seq:
+    dup -> VarsByCode
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_dup(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *)std_map_Sl_int_Sc_CdiVariable_Sg__dup(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.delete
+
+  call-seq:
+    delete(key) -> VALUE
+
+Delete a matching element.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_delete(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","__delete__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::key_type","__delete__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_map_Sl_int_Sc_CdiVariable_Sg____delete__(arg1,(int const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_has_keyq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > const *","has_key", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::key_type","has_key", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiVariable_Sg__has_key((std::map< int,CdiVariable > const *)arg1,(int const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.keys
+
+  call-seq:
+    keys -> VALUE
+
+Return an Array of key elements.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_keys(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","keys", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiVariable_Sg__keys(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.each
+
+  call-seq:
+    each -> VarsByCode
+
+Iterate thru each element in the VarsByCode.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_each(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","each", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *)std_map_Sl_int_Sc_CdiVariable_Sg__each(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.select
+
+  call-seq:
+    select -> VarsByCode
+
+Iterate thru each element in the VarsByCode and select those that match a condition.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_select(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","select", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *)std_map_Sl_int_Sc_CdiVariable_Sg__select(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.values_at
+
+  call-seq:
+    values_at(argc, ?) -> VALUE
+
+Return an Array of value elements matching the conditions.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_values_at(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  int arg2 ;
+  VALUE *arg3 = (VALUE *) 0 ;
+  void *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if (argc < 1) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","values_at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  {
+    arg2 = argc;
+    arg3 = argv;
+  }
+  result = (VALUE)std_map_Sl_int_Sc_CdiVariable_Sg__values_at(arg1,arg2,arg3,arg4);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.each_key
+
+  call-seq:
+    each_key -> VarsByCode
+
+Iterate thru each key element in the VarsByCode.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_each_key(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","each_key", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *)std_map_Sl_int_Sc_CdiVariable_Sg__each_key(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.values
+
+  call-seq:
+    values -> VALUE
+
+Return an Array of value elements.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_values(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","values", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiVariable_Sg__values(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.each_value
+
+  call-seq:
+    each_value -> VarsByCode
+
+Iterate thru each key element in the VarsByCode.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_each_value(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","each_value", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *)std_map_Sl_int_Sc_CdiVariable_Sg__each_value(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_entries(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","entries", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiVariable_Sg__entries(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_includeq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","__contains__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::key_type","__contains__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiVariable_Sg____contains__(arg1,(int const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_key_iterator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  VALUE *arg2 = (VALUE *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  arg2 = &self;
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","key_iterator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (swig::ConstIterator *)std_map_Sl_int_Sc_CdiVariable_Sg__key_iterator(arg1,arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_value_iterator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  VALUE *arg2 = (VALUE *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  arg2 = &self;
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","value_iterator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (swig::ConstIterator *)std_map_Sl_int_Sc_CdiVariable_Sg__value_iterator(arg1,arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.[]
+
+  call-seq:
+    [](key) -> VALUE
+
+Element accessor/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode___getitem__(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::key_type","__getitem__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_map_Sl_int_Sc_CdiVariable_Sg____getitem__((std::map< int,CdiVariable > const *)arg1,(int const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.[]=
+
+  call-seq:
+    []=(key, x)
+
+Element setter/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode___setitem__(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  std::map< int,CdiVariable >::mapped_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::key_type","__setitem__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_CdiVariable,  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::mapped_type const &","__setitem__", 3, argv[1] )); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiVariable >::mapped_type const &","__setitem__", 3, argv[1])); 
+  }
+  arg3 = reinterpret_cast< std::map< int,CdiVariable >::mapped_type * >(argp3);
+  try {
+    std_map_Sl_int_Sc_CdiVariable_Sg____setitem__(arg1,(int const &)*arg2,(CdiVariable const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_inspect(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiVariable_Sg__inspect(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.to_a
+
+  call-seq:
+    to_a -> VALUE
+
+Convert VarsByCode to an Array.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_to_a(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","to_a", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiVariable_Sg__to_a(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_to_s(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiVariable_Sg__to_s(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_VarsByCode__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (std::map< int,CdiVariable > *)new std::map< int,CdiVariable >();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_VarsByCode_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_VarsByCode_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_VarsByCode__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  std::map< int,CdiVariable > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  {
+    std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *ptr = (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *)0;
+    res1 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > const &","std::map<(int,CdiVariable)>", 1, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiVariable > const &","std::map<(int,CdiVariable)>", 1, argv[0])); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::map< int,CdiVariable > *)new std::map< int,CdiVariable >((std::map< int,CdiVariable > const &)*arg1);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_VarsByCode(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[1];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 1) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_VarsByCode__SWIG_1(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__lessT_int_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_VarsByCode__SWIG_0(nargs, args, self);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_VarsByCode__SWIG_2(nargs, args, self);
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 1, "VarsByCode.new", 
+    "    VarsByCode.new(std::less< int > const &)\n"
+    "    VarsByCode.new()\n"
+    "    VarsByCode.new(std::map< int,CdiVariable > const &)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.empty?
+
+  call-seq:
+    empty? -> bool
+
+Check if the VarsByCode is empty or not.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_emptyq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > const *","empty", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (bool)((std::map< int,CdiVariable > const *)arg1)->empty();
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.size
+
+  call-seq:
+    size -> size_type
+
+Size or Length of the VarsByCode.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_size(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > const *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = ((std::map< int,CdiVariable > const *)arg1)->size();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.clear
+
+  call-seq:
+    clear
+
+Clear VarsByCode contents.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_clear(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","clear", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  (arg1)->clear();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_swap(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","swap", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > &","swap", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiVariable > &","swap", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiVariable > * >(argp2);
+  (arg1)->swap(*arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_get_allocator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::allocator< std::pair< int const,CdiVariable > > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > const *","get_allocator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = ((std::map< int,CdiVariable > const *)arg1)->get_allocator();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiVariable >::allocator_type(static_cast< const std::map< int,CdiVariable >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.begin
+
+  call-seq:
+    begin -> iterator
+
+Return an iterator to the beginning of the VarsByCode.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_begin(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","begin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (arg1)->begin();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiVariable >::iterator(static_cast< const std::map< int,CdiVariable >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.end
+
+  call-seq:
+    end -> iterator
+
+Return an iterator to past the end of the VarsByCode.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_end(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","end", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (arg1)->end();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiVariable >::iterator(static_cast< const std::map< int,CdiVariable >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.rbegin
+
+  call-seq:
+    rbegin -> reverse_iterator
+
+Return a reverse iterator to the beginning (the end) of the VarsByCode.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_rbegin(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","rbegin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (arg1)->rbegin();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiVariable >::reverse_iterator(static_cast< const std::map< int,CdiVariable >::reverse_iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__reverse_iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.rend
+
+  call-seq:
+    rend -> reverse_iterator
+
+Return a reverse iterator to past the end (past the beginning) of the VarsByCode.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_rend(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","rend", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  result = (arg1)->rend();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiVariable >::reverse_iterator(static_cast< const std::map< int,CdiVariable >::reverse_iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__reverse_iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.erase
+
+  call-seq:
+    erase(x) -> size_type
+    erase(position)
+    erase(first, last)
+
+Delete a portion of the VarsByCode.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_erase__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiVariable >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::key_type","erase", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->erase((std::map< int,CdiVariable >::key_type const &)*arg2);
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_count(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiVariable >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > const *","count", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::key_type","count", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = ((std::map< int,CdiVariable > const *)arg1)->count((std::map< int,CdiVariable >::key_type const &)*arg2);
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_erase__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  {
+    res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::iterator","erase", 2, argv[0] )); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiVariable >::iterator","erase", 2, argv[0]));
+    } else {
+      arg2 = *(reinterpret_cast< std::map< int,CdiVariable >::iterator * >(argp2));
+    }
+  }
+  (arg1)->erase(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_erase__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::iterator arg2 ;
+  std::map< int,CdiVariable >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  {
+    res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::iterator","erase", 2, argv[0] )); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiVariable >::iterator","erase", 2, argv[0]));
+    } else {
+      arg2 = *(reinterpret_cast< std::map< int,CdiVariable >::iterator * >(argp2));
+    }
+  }
+  {
+    res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::iterator","erase", 3, argv[1] )); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiVariable >::iterator","erase", 3, argv[1]));
+    } else {
+      arg3 = *(reinterpret_cast< std::map< int,CdiVariable >::iterator * >(argp3));
+    }
+  }
+  (arg1)->erase(arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_VarsByCode_erase(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_VarsByCode_erase__SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_VarsByCode_erase__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_VarsByCode_erase__SWIG_2(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "VarsByCode.erase", 
+    "    void VarsByCode.erase(std::map< int,CdiVariable >::key_type const &x)\n"
+    "    void VarsByCode.erase(std::map< int,CdiVariable >::iterator position)\n"
+    "    void VarsByCode.erase(std::map< int,CdiVariable >::iterator first, std::map< int,CdiVariable >::iterator last)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::VarsByCode.find
+
+  call-seq:
+    find(x) -> iterator
+
+Find an element in the class.
+*/
+SWIGINTERN VALUE
+_wrap_VarsByCode_find(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","find", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::key_type","find", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->find((std::map< int,CdiVariable >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiVariable >::iterator(static_cast< const std::map< int,CdiVariable >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_lower_bound(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","lower_bound", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::key_type","lower_bound", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->lower_bound((std::map< int,CdiVariable >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiVariable >::iterator(static_cast< const std::map< int,CdiVariable >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_VarsByCode_upper_bound(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiVariable > *arg1 = (std::map< int,CdiVariable > *) 0 ;
+  std::map< int,CdiVariable >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiVariable >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiVariable > *","upper_bound", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiVariable > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable >::key_type","upper_bound", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiVariable >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->upper_bound((std::map< int,CdiVariable >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiVariable >::iterator(static_cast< const std::map< int,CdiVariable >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_std_map_Sl_int_Sc_CdiVariable_Sg_(std::map< int,CdiVariable > *arg1) {
+    delete arg1;
+}
+
+swig_class SwigClassTaxesMap;
+
+SWIGINTERN VALUE
+_wrap_new_TaxesMap__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::less< int > *arg1 = 0 ;
+  void *argp1 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__lessT_int_t,  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::less< int > const &","std::map<(int,CdiTaxis)>", 1, argv[0] )); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::less< int > const &","std::map<(int,CdiTaxis)>", 1, argv[0])); 
+  }
+  arg1 = reinterpret_cast< std::less< int > * >(argp1);
+  result = (std::map< int,CdiTaxis > *)new std::map< int,CdiTaxis >((std::less< int > const &)*arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.dup
+
+  call-seq:
+    dup -> TaxesMap
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_dup(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *)std_map_Sl_int_Sc_CdiTaxis_Sg__dup(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.delete
+
+  call-seq:
+    delete(key) -> VALUE
+
+Delete a matching element.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_delete(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","__delete__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::key_type","__delete__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_map_Sl_int_Sc_CdiTaxis_Sg____delete__(arg1,(int const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_has_keyq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > const *","has_key", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::key_type","has_key", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiTaxis_Sg__has_key((std::map< int,CdiTaxis > const *)arg1,(int const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.keys
+
+  call-seq:
+    keys -> VALUE
+
+Return an Array of key elements.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_keys(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","keys", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiTaxis_Sg__keys(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.each
+
+  call-seq:
+    each -> TaxesMap
+
+Iterate thru each element in the TaxesMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_each(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","each", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *)std_map_Sl_int_Sc_CdiTaxis_Sg__each(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.select
+
+  call-seq:
+    select -> TaxesMap
+
+Iterate thru each element in the TaxesMap and select those that match a condition.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_select(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","select", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *)std_map_Sl_int_Sc_CdiTaxis_Sg__select(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.values_at
+
+  call-seq:
+    values_at(argc, ?) -> VALUE
+
+Return an Array of value elements matching the conditions.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_values_at(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  int arg2 ;
+  VALUE *arg3 = (VALUE *) 0 ;
+  void *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if (argc < 1) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","values_at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  {
+    arg2 = argc;
+    arg3 = argv;
+  }
+  result = (VALUE)std_map_Sl_int_Sc_CdiTaxis_Sg__values_at(arg1,arg2,arg3,arg4);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.each_key
+
+  call-seq:
+    each_key -> TaxesMap
+
+Iterate thru each key element in the TaxesMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_each_key(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","each_key", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *)std_map_Sl_int_Sc_CdiTaxis_Sg__each_key(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.values
+
+  call-seq:
+    values -> VALUE
+
+Return an Array of value elements.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_values(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","values", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiTaxis_Sg__values(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.each_value
+
+  call-seq:
+    each_value -> TaxesMap
+
+Iterate thru each key element in the TaxesMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_each_value(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","each_value", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *)std_map_Sl_int_Sc_CdiTaxis_Sg__each_value(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_entries(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","entries", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiTaxis_Sg__entries(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_includeq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","__contains__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::key_type","__contains__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiTaxis_Sg____contains__(arg1,(int const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_key_iterator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  VALUE *arg2 = (VALUE *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  arg2 = &self;
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","key_iterator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (swig::ConstIterator *)std_map_Sl_int_Sc_CdiTaxis_Sg__key_iterator(arg1,arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_value_iterator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  VALUE *arg2 = (VALUE *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  arg2 = &self;
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","value_iterator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (swig::ConstIterator *)std_map_Sl_int_Sc_CdiTaxis_Sg__value_iterator(arg1,arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.[]
+
+  call-seq:
+    [](key) -> VALUE
+
+Element accessor/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap___getitem__(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::key_type","__getitem__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_map_Sl_int_Sc_CdiTaxis_Sg____getitem__((std::map< int,CdiTaxis > const *)arg1,(int const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.[]=
+
+  call-seq:
+    []=(key, x)
+
+Element setter/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap___setitem__(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  std::map< int,CdiTaxis >::mapped_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::key_type","__setitem__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_CdiTaxis,  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::mapped_type const &","__setitem__", 3, argv[1] )); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiTaxis >::mapped_type const &","__setitem__", 3, argv[1])); 
+  }
+  arg3 = reinterpret_cast< std::map< int,CdiTaxis >::mapped_type * >(argp3);
+  try {
+    std_map_Sl_int_Sc_CdiTaxis_Sg____setitem__(arg1,(int const &)*arg2,(CdiTaxis const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_inspect(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiTaxis_Sg__inspect(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.to_a
+
+  call-seq:
+    to_a -> VALUE
+
+Convert TaxesMap to an Array.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_to_a(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","to_a", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiTaxis_Sg__to_a(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_to_s(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiTaxis_Sg__to_s(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_TaxesMap__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (std::map< int,CdiTaxis > *)new std::map< int,CdiTaxis >();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_TaxesMap_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_TaxesMap_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_TaxesMap__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  std::map< int,CdiTaxis > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  {
+    std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *ptr = (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *)0;
+    res1 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > const &","std::map<(int,CdiTaxis)>", 1, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiTaxis > const &","std::map<(int,CdiTaxis)>", 1, argv[0])); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::map< int,CdiTaxis > *)new std::map< int,CdiTaxis >((std::map< int,CdiTaxis > const &)*arg1);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_TaxesMap(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[1];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 1) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_TaxesMap__SWIG_1(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__lessT_int_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_TaxesMap__SWIG_0(nargs, args, self);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_TaxesMap__SWIG_2(nargs, args, self);
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 1, "TaxesMap.new", 
+    "    TaxesMap.new(std::less< int > const &)\n"
+    "    TaxesMap.new()\n"
+    "    TaxesMap.new(std::map< int,CdiTaxis > const &)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.empty?
+
+  call-seq:
+    empty? -> bool
+
+Check if the TaxesMap is empty or not.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_emptyq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > const *","empty", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (bool)((std::map< int,CdiTaxis > const *)arg1)->empty();
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.size
+
+  call-seq:
+    size -> size_type
+
+Size or Length of the TaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_size(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > const *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = ((std::map< int,CdiTaxis > const *)arg1)->size();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.clear
+
+  call-seq:
+    clear
+
+Clear TaxesMap contents.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_clear(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","clear", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  (arg1)->clear();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_swap(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","swap", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > &","swap", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiTaxis > &","swap", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp2);
+  (arg1)->swap(*arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_get_allocator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::allocator< std::pair< int const,CdiTaxis > > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > const *","get_allocator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = ((std::map< int,CdiTaxis > const *)arg1)->get_allocator();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiTaxis >::allocator_type(static_cast< const std::map< int,CdiTaxis >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.begin
+
+  call-seq:
+    begin -> iterator
+
+Return an iterator to the beginning of the TaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_begin(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","begin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (arg1)->begin();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiTaxis >::iterator(static_cast< const std::map< int,CdiTaxis >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.end
+
+  call-seq:
+    end -> iterator
+
+Return an iterator to past the end of the TaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_end(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","end", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (arg1)->end();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiTaxis >::iterator(static_cast< const std::map< int,CdiTaxis >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.rbegin
+
+  call-seq:
+    rbegin -> reverse_iterator
+
+Return a reverse iterator to the beginning (the end) of the TaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_rbegin(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","rbegin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (arg1)->rbegin();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiTaxis >::reverse_iterator(static_cast< const std::map< int,CdiTaxis >::reverse_iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__reverse_iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.rend
+
+  call-seq:
+    rend -> reverse_iterator
+
+Return a reverse iterator to past the end (past the beginning) of the TaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_rend(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","rend", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  result = (arg1)->rend();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiTaxis >::reverse_iterator(static_cast< const std::map< int,CdiTaxis >::reverse_iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__reverse_iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.erase
+
+  call-seq:
+    erase(x) -> size_type
+    erase(position)
+    erase(first, last)
+
+Delete a portion of the TaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_erase__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiTaxis >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::key_type","erase", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->erase((std::map< int,CdiTaxis >::key_type const &)*arg2);
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_count(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiTaxis >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > const *","count", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::key_type","count", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = ((std::map< int,CdiTaxis > const *)arg1)->count((std::map< int,CdiTaxis >::key_type const &)*arg2);
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_erase__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  {
+    res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::iterator","erase", 2, argv[0] )); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiTaxis >::iterator","erase", 2, argv[0]));
+    } else {
+      arg2 = *(reinterpret_cast< std::map< int,CdiTaxis >::iterator * >(argp2));
+    }
+  }
+  (arg1)->erase(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_erase__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::iterator arg2 ;
+  std::map< int,CdiTaxis >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  {
+    res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::iterator","erase", 2, argv[0] )); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiTaxis >::iterator","erase", 2, argv[0]));
+    } else {
+      arg2 = *(reinterpret_cast< std::map< int,CdiTaxis >::iterator * >(argp2));
+    }
+  }
+  {
+    res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::iterator","erase", 3, argv[1] )); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiTaxis >::iterator","erase", 3, argv[1]));
+    } else {
+      arg3 = *(reinterpret_cast< std::map< int,CdiTaxis >::iterator * >(argp3));
+    }
+  }
+  (arg1)->erase(arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_TaxesMap_erase(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_TaxesMap_erase__SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_TaxesMap_erase__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_TaxesMap_erase__SWIG_2(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "TaxesMap.erase", 
+    "    void TaxesMap.erase(std::map< int,CdiTaxis >::key_type const &x)\n"
+    "    void TaxesMap.erase(std::map< int,CdiTaxis >::iterator position)\n"
+    "    void TaxesMap.erase(std::map< int,CdiTaxis >::iterator first, std::map< int,CdiTaxis >::iterator last)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::TaxesMap.find
+
+  call-seq:
+    find(x) -> iterator
+
+Find an element in the class.
+*/
+SWIGINTERN VALUE
+_wrap_TaxesMap_find(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiTaxis >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","find", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::key_type","find", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->find((std::map< int,CdiTaxis >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiTaxis >::iterator(static_cast< const std::map< int,CdiTaxis >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_lower_bound(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiTaxis >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","lower_bound", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::key_type","lower_bound", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->lower_bound((std::map< int,CdiTaxis >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiTaxis >::iterator(static_cast< const std::map< int,CdiTaxis >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_TaxesMap_upper_bound(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiTaxis > *arg1 = (std::map< int,CdiTaxis > *) 0 ;
+  std::map< int,CdiTaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiTaxis >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis > *","upper_bound", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiTaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis >::key_type","upper_bound", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiTaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->upper_bound((std::map< int,CdiTaxis >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiTaxis >::iterator(static_cast< const std::map< int,CdiTaxis >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_std_map_Sl_int_Sc_CdiTaxis_Sg_(std::map< int,CdiTaxis > *arg1) {
+    delete arg1;
+}
+
+swig_class SwigClassZaxesMap;
+
+SWIGINTERN VALUE
+_wrap_new_ZaxesMap__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::less< int > *arg1 = 0 ;
+  void *argp1 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__lessT_int_t,  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::less< int > const &","std::map<(int,CdiZaxis)>", 1, argv[0] )); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::less< int > const &","std::map<(int,CdiZaxis)>", 1, argv[0])); 
+  }
+  arg1 = reinterpret_cast< std::less< int > * >(argp1);
+  result = (std::map< int,CdiZaxis > *)new std::map< int,CdiZaxis >((std::less< int > const &)*arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.dup
+
+  call-seq:
+    dup -> ZaxesMap
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_dup(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *)std_map_Sl_int_Sc_CdiZaxis_Sg__dup(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.delete
+
+  call-seq:
+    delete(key) -> VALUE
+
+Delete a matching element.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_delete(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","__delete__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::key_type","__delete__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_map_Sl_int_Sc_CdiZaxis_Sg____delete__(arg1,(int const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_has_keyq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > const *","has_key", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::key_type","has_key", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiZaxis_Sg__has_key((std::map< int,CdiZaxis > const *)arg1,(int const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.keys
+
+  call-seq:
+    keys -> VALUE
+
+Return an Array of key elements.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_keys(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","keys", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiZaxis_Sg__keys(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.each
+
+  call-seq:
+    each -> ZaxesMap
+
+Iterate thru each element in the ZaxesMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_each(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","each", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *)std_map_Sl_int_Sc_CdiZaxis_Sg__each(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.select
+
+  call-seq:
+    select -> ZaxesMap
+
+Iterate thru each element in the ZaxesMap and select those that match a condition.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_select(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","select", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *)std_map_Sl_int_Sc_CdiZaxis_Sg__select(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.values_at
+
+  call-seq:
+    values_at(argc, ?) -> VALUE
+
+Return an Array of value elements matching the conditions.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_values_at(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  int arg2 ;
+  VALUE *arg3 = (VALUE *) 0 ;
+  void *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if (argc < 1) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","values_at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  {
+    arg2 = argc;
+    arg3 = argv;
+  }
+  result = (VALUE)std_map_Sl_int_Sc_CdiZaxis_Sg__values_at(arg1,arg2,arg3,arg4);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.each_key
+
+  call-seq:
+    each_key -> ZaxesMap
+
+Iterate thru each key element in the ZaxesMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_each_key(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","each_key", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *)std_map_Sl_int_Sc_CdiZaxis_Sg__each_key(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.values
+
+  call-seq:
+    values -> VALUE
+
+Return an Array of value elements.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_values(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","values", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiZaxis_Sg__values(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.each_value
+
+  call-seq:
+    each_value -> ZaxesMap
+
+Iterate thru each key element in the ZaxesMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_each_value(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","each_value", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *)std_map_Sl_int_Sc_CdiZaxis_Sg__each_value(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_entries(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","entries", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiZaxis_Sg__entries(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_includeq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","__contains__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::key_type","__contains__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiZaxis_Sg____contains__(arg1,(int const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_key_iterator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  VALUE *arg2 = (VALUE *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  arg2 = &self;
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","key_iterator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (swig::ConstIterator *)std_map_Sl_int_Sc_CdiZaxis_Sg__key_iterator(arg1,arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_value_iterator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  VALUE *arg2 = (VALUE *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  arg2 = &self;
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","value_iterator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (swig::ConstIterator *)std_map_Sl_int_Sc_CdiZaxis_Sg__value_iterator(arg1,arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.[]
+
+  call-seq:
+    [](key) -> VALUE
+
+Element accessor/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap___getitem__(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::key_type","__getitem__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_map_Sl_int_Sc_CdiZaxis_Sg____getitem__((std::map< int,CdiZaxis > const *)arg1,(int const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.[]=
+
+  call-seq:
+    []=(key, x)
+
+Element setter/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap___setitem__(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  std::map< int,CdiZaxis >::mapped_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::key_type","__setitem__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_CdiZaxis,  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::mapped_type const &","__setitem__", 3, argv[1] )); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiZaxis >::mapped_type const &","__setitem__", 3, argv[1])); 
+  }
+  arg3 = reinterpret_cast< std::map< int,CdiZaxis >::mapped_type * >(argp3);
+  try {
+    std_map_Sl_int_Sc_CdiZaxis_Sg____setitem__(arg1,(int const &)*arg2,(CdiZaxis const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_inspect(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiZaxis_Sg__inspect(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.to_a
+
+  call-seq:
+    to_a -> VALUE
+
+Convert ZaxesMap to an Array.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_to_a(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","to_a", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiZaxis_Sg__to_a(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_to_s(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiZaxis_Sg__to_s(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_ZaxesMap__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (std::map< int,CdiZaxis > *)new std::map< int,CdiZaxis >();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_ZaxesMap_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_ZaxesMap_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_ZaxesMap__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  std::map< int,CdiZaxis > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  {
+    std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *ptr = (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *)0;
+    res1 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > const &","std::map<(int,CdiZaxis)>", 1, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiZaxis > const &","std::map<(int,CdiZaxis)>", 1, argv[0])); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::map< int,CdiZaxis > *)new std::map< int,CdiZaxis >((std::map< int,CdiZaxis > const &)*arg1);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_ZaxesMap(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[1];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 1) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_ZaxesMap__SWIG_1(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__lessT_int_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_ZaxesMap__SWIG_0(nargs, args, self);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_ZaxesMap__SWIG_2(nargs, args, self);
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 1, "ZaxesMap.new", 
+    "    ZaxesMap.new(std::less< int > const &)\n"
+    "    ZaxesMap.new()\n"
+    "    ZaxesMap.new(std::map< int,CdiZaxis > const &)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.empty?
+
+  call-seq:
+    empty? -> bool
+
+Check if the ZaxesMap is empty or not.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_emptyq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > const *","empty", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (bool)((std::map< int,CdiZaxis > const *)arg1)->empty();
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.size
+
+  call-seq:
+    size -> size_type
+
+Size or Length of the ZaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_size(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > const *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = ((std::map< int,CdiZaxis > const *)arg1)->size();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.clear
+
+  call-seq:
+    clear
+
+Clear ZaxesMap contents.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_clear(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","clear", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  (arg1)->clear();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_swap(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","swap", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > &","swap", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiZaxis > &","swap", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp2);
+  (arg1)->swap(*arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_get_allocator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::allocator< std::pair< int const,CdiZaxis > > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > const *","get_allocator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = ((std::map< int,CdiZaxis > const *)arg1)->get_allocator();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiZaxis >::allocator_type(static_cast< const std::map< int,CdiZaxis >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.begin
+
+  call-seq:
+    begin -> iterator
+
+Return an iterator to the beginning of the ZaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_begin(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","begin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (arg1)->begin();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiZaxis >::iterator(static_cast< const std::map< int,CdiZaxis >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.end
+
+  call-seq:
+    end -> iterator
+
+Return an iterator to past the end of the ZaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_end(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","end", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (arg1)->end();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiZaxis >::iterator(static_cast< const std::map< int,CdiZaxis >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.rbegin
+
+  call-seq:
+    rbegin -> reverse_iterator
+
+Return a reverse iterator to the beginning (the end) of the ZaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_rbegin(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","rbegin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (arg1)->rbegin();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiZaxis >::reverse_iterator(static_cast< const std::map< int,CdiZaxis >::reverse_iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__reverse_iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.rend
+
+  call-seq:
+    rend -> reverse_iterator
+
+Return a reverse iterator to past the end (past the beginning) of the ZaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_rend(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","rend", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  result = (arg1)->rend();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiZaxis >::reverse_iterator(static_cast< const std::map< int,CdiZaxis >::reverse_iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__reverse_iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.erase
+
+  call-seq:
+    erase(x) -> size_type
+    erase(position)
+    erase(first, last)
+
+Delete a portion of the ZaxesMap.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_erase__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiZaxis >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::key_type","erase", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->erase((std::map< int,CdiZaxis >::key_type const &)*arg2);
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_count(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiZaxis >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > const *","count", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::key_type","count", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = ((std::map< int,CdiZaxis > const *)arg1)->count((std::map< int,CdiZaxis >::key_type const &)*arg2);
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_erase__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  {
+    res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::iterator","erase", 2, argv[0] )); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiZaxis >::iterator","erase", 2, argv[0]));
+    } else {
+      arg2 = *(reinterpret_cast< std::map< int,CdiZaxis >::iterator * >(argp2));
+    }
+  }
+  (arg1)->erase(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_erase__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::iterator arg2 ;
+  std::map< int,CdiZaxis >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  {
+    res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::iterator","erase", 2, argv[0] )); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiZaxis >::iterator","erase", 2, argv[0]));
+    } else {
+      arg2 = *(reinterpret_cast< std::map< int,CdiZaxis >::iterator * >(argp2));
+    }
+  }
+  {
+    res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::iterator","erase", 3, argv[1] )); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiZaxis >::iterator","erase", 3, argv[1]));
+    } else {
+      arg3 = *(reinterpret_cast< std::map< int,CdiZaxis >::iterator * >(argp3));
+    }
+  }
+  (arg1)->erase(arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_ZaxesMap_erase(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_ZaxesMap_erase__SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_ZaxesMap_erase__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_ZaxesMap_erase__SWIG_2(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "ZaxesMap.erase", 
+    "    void ZaxesMap.erase(std::map< int,CdiZaxis >::key_type const &x)\n"
+    "    void ZaxesMap.erase(std::map< int,CdiZaxis >::iterator position)\n"
+    "    void ZaxesMap.erase(std::map< int,CdiZaxis >::iterator first, std::map< int,CdiZaxis >::iterator last)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::ZaxesMap.find
+
+  call-seq:
+    find(x) -> iterator
+
+Find an element in the class.
+*/
+SWIGINTERN VALUE
+_wrap_ZaxesMap_find(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiZaxis >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","find", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::key_type","find", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->find((std::map< int,CdiZaxis >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiZaxis >::iterator(static_cast< const std::map< int,CdiZaxis >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_lower_bound(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiZaxis >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","lower_bound", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::key_type","lower_bound", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->lower_bound((std::map< int,CdiZaxis >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiZaxis >::iterator(static_cast< const std::map< int,CdiZaxis >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_ZaxesMap_upper_bound(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiZaxis > *arg1 = (std::map< int,CdiZaxis > *) 0 ;
+  std::map< int,CdiZaxis >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiZaxis >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis > *","upper_bound", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiZaxis > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis >::key_type","upper_bound", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiZaxis >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->upper_bound((std::map< int,CdiZaxis >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiZaxis >::iterator(static_cast< const std::map< int,CdiZaxis >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_std_map_Sl_int_Sc_CdiZaxis_Sg_(std::map< int,CdiZaxis > *arg1) {
+    delete arg1;
+}
+
+swig_class SwigClassGridsMap;
+
+SWIGINTERN VALUE
+_wrap_new_GridsMap__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::less< int > *arg1 = 0 ;
+  void *argp1 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_std__lessT_int_t,  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::less< int > const &","std::map<(int,CdiGrid)>", 1, argv[0] )); 
+  }
+  if (!argp1) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::less< int > const &","std::map<(int,CdiGrid)>", 1, argv[0])); 
+  }
+  arg1 = reinterpret_cast< std::less< int > * >(argp1);
+  result = (std::map< int,CdiGrid > *)new std::map< int,CdiGrid >((std::less< int > const &)*arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.dup
+
+  call-seq:
+    dup -> GridsMap
+
+Create a duplicate of the class and unfreeze it if needed.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_dup(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","dup", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *)std_map_Sl_int_Sc_CdiGrid_Sg__dup(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.delete
+
+  call-seq:
+    delete(key) -> VALUE
+
+Delete a matching element.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_delete(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","__delete__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::key_type","__delete__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_map_Sl_int_Sc_CdiGrid_Sg____delete__(arg1,(int const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_has_keyq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > const *","has_key", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::key_type","has_key", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiGrid_Sg__has_key((std::map< int,CdiGrid > const *)arg1,(int const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.keys
+
+  call-seq:
+    keys -> VALUE
+
+Return an Array of key elements.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_keys(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","keys", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiGrid_Sg__keys(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.each
+
+  call-seq:
+    each -> GridsMap
+
+Iterate thru each element in the GridsMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_each(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","each", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *)std_map_Sl_int_Sc_CdiGrid_Sg__each(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.select
+
+  call-seq:
+    select -> GridsMap
+
+Iterate thru each element in the GridsMap and select those that match a condition.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_select(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","select", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *)std_map_Sl_int_Sc_CdiGrid_Sg__select(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.values_at
+
+  call-seq:
+    values_at(argc, ?) -> VALUE
+
+Return an Array of value elements matching the conditions.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_values_at(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  int arg2 ;
+  VALUE *arg3 = (VALUE *) 0 ;
+  void *arg4 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if (argc < 1) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","values_at", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  {
+    arg2 = argc;
+    arg3 = argv;
+  }
+  result = (VALUE)std_map_Sl_int_Sc_CdiGrid_Sg__values_at(arg1,arg2,arg3,arg4);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.each_key
+
+  call-seq:
+    each_key -> GridsMap
+
+Iterate thru each key element in the GridsMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_each_key(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","each_key", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *)std_map_Sl_int_Sc_CdiGrid_Sg__each_key(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.values
+
+  call-seq:
+    values -> VALUE
+
+Return an Array of value elements.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_values(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","values", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiGrid_Sg__values(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.each_value
+
+  call-seq:
+    each_value -> GridsMap
+
+Iterate thru each key element in the GridsMap.  A block must be provided.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_each_value(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","each_value", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *)std_map_Sl_int_Sc_CdiGrid_Sg__each_value(arg1);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_entries(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","entries", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiGrid_Sg__entries(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_includeq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","__contains__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::key_type","__contains__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (bool)std_map_Sl_int_Sc_CdiGrid_Sg____contains__(arg1,(int const &)*arg2);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_key_iterator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  VALUE *arg2 = (VALUE *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  arg2 = &self;
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","key_iterator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (swig::ConstIterator *)std_map_Sl_int_Sc_CdiGrid_Sg__key_iterator(arg1,arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_value_iterator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  VALUE *arg2 = (VALUE *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  swig::ConstIterator *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  arg2 = &self;
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","value_iterator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (swig::ConstIterator *)std_map_Sl_int_Sc_CdiGrid_Sg__value_iterator(arg1,arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_swig__ConstIterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.[]
+
+  call-seq:
+    [](key) -> VALUE
+
+Element accessor/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap___getitem__(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > const *","__getitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::key_type","__getitem__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (VALUE)std_map_Sl_int_Sc_CdiGrid_Sg____getitem__((std::map< int,CdiGrid > const *)arg1,(int const &)*arg2);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.[]=
+
+  call-seq:
+    []=(key, x)
+
+Element setter/slicing.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap___setitem__(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  std::map< int,CdiGrid >::mapped_type *arg3 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","__setitem__", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::key_type","__setitem__", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_CdiGrid,  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::mapped_type const &","__setitem__", 3, argv[1] )); 
+  }
+  if (!argp3) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiGrid >::mapped_type const &","__setitem__", 3, argv[1])); 
+  }
+  arg3 = reinterpret_cast< std::map< int,CdiGrid >::mapped_type * >(argp3);
+  try {
+    std_map_Sl_int_Sc_CdiGrid_Sg____setitem__(arg1,(int const &)*arg2,(CdiGrid const &)*arg3);
+  }
+  catch(std::out_of_range &_e) {
+    SWIG_exception_fail(SWIG_IndexError, (&_e)->what());
+  }
+  
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.inspect
+
+  call-seq:
+    inspect -> VALUE
+
+Inspect class and its contents.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_inspect(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","inspect", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiGrid_Sg__inspect(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.to_a
+
+  call-seq:
+    to_a -> VALUE
+
+Convert GridsMap to an Array.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_to_a(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","to_a", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiGrid_Sg__to_a(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.to_s
+
+  call-seq:
+    to_s -> VALUE
+
+Convert class to a String representation.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_to_s(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  VALUE result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","to_s", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (VALUE)std_map_Sl_int_Sc_CdiGrid_Sg__to_s(arg1);
+  vresult = result;
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_new_GridsMap__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (std::map< int,CdiGrid > *)new std::map< int,CdiGrid >();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_GridsMap_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_GridsMap_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_GridsMap__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = 0 ;
+  int res1 = SWIG_OLDOBJ ;
+  std::map< int,CdiGrid > *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  {
+    std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *ptr = (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *)0;
+    res1 = swig::asptr(argv[0], &ptr);
+    if (!SWIG_IsOK(res1)) {
+      SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > const &","std::map<(int,CdiGrid)>", 1, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiGrid > const &","std::map<(int,CdiGrid)>", 1, argv[0])); 
+    }
+    arg1 = ptr;
+  }
+  result = (std::map< int,CdiGrid > *)new std::map< int,CdiGrid >((std::map< int,CdiGrid > const &)*arg1);
+  DATA_PTR(self) = result;
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return self;
+fail:
+  if (SWIG_IsNewObj(res1)) delete arg1;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_GridsMap(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[1];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 1) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_GridsMap__SWIG_1(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_std__lessT_int_t, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_GridsMap__SWIG_0(nargs, args, self);
+    }
+  }
+  if (argc == 1) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_new_GridsMap__SWIG_2(nargs, args, self);
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 1, "GridsMap.new", 
+    "    GridsMap.new(std::less< int > const &)\n"
+    "    GridsMap.new()\n"
+    "    GridsMap.new(std::map< int,CdiGrid > const &)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.empty?
+
+  call-seq:
+    empty? -> bool
+
+Check if the GridsMap is empty or not.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_emptyq___(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > const *","empty", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (bool)((std::map< int,CdiGrid > const *)arg1)->empty();
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.size
+
+  call-seq:
+    size -> size_type
+
+Size or Length of the GridsMap.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_size(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > const *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = ((std::map< int,CdiGrid > const *)arg1)->size();
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.clear
+
+  call-seq:
+    clear
+
+Clear GridsMap contents.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_clear(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","clear", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  (arg1)->clear();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_swap(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid > *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","swap", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t,  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > &","swap", 2, argv[0] )); 
+  }
+  if (!argp2) {
+    SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiGrid > &","swap", 2, argv[0])); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiGrid > * >(argp2);
+  (arg1)->swap(*arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_get_allocator(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::allocator< std::pair< int const,CdiGrid > > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > const *","get_allocator", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = ((std::map< int,CdiGrid > const *)arg1)->get_allocator();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiGrid >::allocator_type(static_cast< const std::map< int,CdiGrid >::allocator_type& >(result))), SWIGTYPE_p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.begin
+
+  call-seq:
+    begin -> iterator
+
+Return an iterator to the beginning of the GridsMap.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_begin(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","begin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (arg1)->begin();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiGrid >::iterator(static_cast< const std::map< int,CdiGrid >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.end
+
+  call-seq:
+    end -> iterator
+
+Return an iterator to past the end of the GridsMap.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_end(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","end", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (arg1)->end();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiGrid >::iterator(static_cast< const std::map< int,CdiGrid >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.rbegin
+
+  call-seq:
+    rbegin -> reverse_iterator
+
+Return a reverse iterator to the beginning (the end) of the GridsMap.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_rbegin(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","rbegin", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (arg1)->rbegin();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiGrid >::reverse_iterator(static_cast< const std::map< int,CdiGrid >::reverse_iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__reverse_iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.rend
+
+  call-seq:
+    rend -> reverse_iterator
+
+Return a reverse iterator to past the end (past the beginning) of the GridsMap.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_rend(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::reverse_iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","rend", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  result = (arg1)->rend();
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiGrid >::reverse_iterator(static_cast< const std::map< int,CdiGrid >::reverse_iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__reverse_iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.erase
+
+  call-seq:
+    erase(x) -> size_type
+    erase(position)
+    erase(first, last)
+
+Delete a portion of the GridsMap.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_erase__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiGrid >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::key_type","erase", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->erase((std::map< int,CdiGrid >::key_type const &)*arg2);
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_count(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiGrid >::size_type result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > const *","count", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::key_type","count", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = ((std::map< int,CdiGrid > const *)arg1)->count((std::map< int,CdiGrid >::key_type const &)*arg2);
+  vresult = SWIG_From_size_t(static_cast< size_t >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_erase__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::iterator arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  {
+    res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::iterator","erase", 2, argv[0] )); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiGrid >::iterator","erase", 2, argv[0]));
+    } else {
+      arg2 = *(reinterpret_cast< std::map< int,CdiGrid >::iterator * >(argp2));
+    }
+  }
+  (arg1)->erase(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_erase__SWIG_2(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::iterator arg2 ;
+  std::map< int,CdiGrid >::iterator arg3 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 ;
+  int res2 = 0 ;
+  void *argp3 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","erase", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  {
+    res2 = SWIG_ConvertPtr(argv[0], &argp2, SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::iterator","erase", 2, argv[0] )); 
+    }  
+    if (!argp2) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiGrid >::iterator","erase", 2, argv[0]));
+    } else {
+      arg2 = *(reinterpret_cast< std::map< int,CdiGrid >::iterator * >(argp2));
+    }
+  }
+  {
+    res3 = SWIG_ConvertPtr(argv[1], &argp3, SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator,  0 );
+    if (!SWIG_IsOK(res3)) {
+      SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::iterator","erase", 3, argv[1] )); 
+    }  
+    if (!argp3) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::map< int,CdiGrid >::iterator","erase", 3, argv[1]));
+    } else {
+      arg3 = *(reinterpret_cast< std::map< int,CdiGrid >::iterator * >(argp3));
+    }
+  }
+  (arg1)->erase(arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_GridsMap_erase(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[4];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 4) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        return _wrap_GridsMap_erase__SWIG_1(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_GridsMap_erase__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  if (argc == 3) {
+    int _v;
+    int res = swig::asptr(argv[0], (std::map<int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >**)(0));
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      void *vptr = 0;
+      int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator, 0);
+      _v = SWIG_CheckState(res);
+      if (_v) {
+        void *vptr = 0;
+        int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator, 0);
+        _v = SWIG_CheckState(res);
+        if (_v) {
+          return _wrap_GridsMap_erase__SWIG_2(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 4, "GridsMap.erase", 
+    "    void GridsMap.erase(std::map< int,CdiGrid >::key_type const &x)\n"
+    "    void GridsMap.erase(std::map< int,CdiGrid >::iterator position)\n"
+    "    void GridsMap.erase(std::map< int,CdiGrid >::iterator first, std::map< int,CdiGrid >::iterator last)\n");
+  
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::GridsMap.find
+
+  call-seq:
+    find(x) -> iterator
+
+Find an element in the class.
+*/
+SWIGINTERN VALUE
+_wrap_GridsMap_find(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiGrid >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","find", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::key_type","find", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->find((std::map< int,CdiGrid >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiGrid >::iterator(static_cast< const std::map< int,CdiGrid >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_lower_bound(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiGrid >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","lower_bound", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::key_type","lower_bound", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->lower_bound((std::map< int,CdiGrid >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiGrid >::iterator(static_cast< const std::map< int,CdiGrid >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_GridsMap_upper_bound(int argc, VALUE *argv, VALUE self) {
+  std::map< int,CdiGrid > *arg1 = (std::map< int,CdiGrid > *) 0 ;
+  std::map< int,CdiGrid >::key_type *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid >::key_type temp2 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  std::map< int,CdiGrid >::iterator result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "std::map< int,CdiGrid > *","upper_bound", 1, self )); 
+  }
+  arg1 = reinterpret_cast< std::map< int,CdiGrid > * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid >::key_type","upper_bound", 2, argv[0] ));
+  } 
+  temp2 = static_cast< std::map< int,CdiGrid >::key_type >(val2);
+  arg2 = &temp2;
+  result = (arg1)->upper_bound((std::map< int,CdiGrid >::key_type const &)*arg2);
+  vresult = SWIG_NewPointerObj((new std::map< int,CdiGrid >::iterator(static_cast< const std::map< int,CdiGrid >::iterator& >(result))), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_std_map_Sl_int_Sc_CdiGrid_Sg_(std::map< int,CdiGrid > *arg1) {
+    delete arg1;
+}
+
+swig_class SwigClassCdiGrid;
+
+SWIGINTERN VALUE
+_wrap_new_CdiGrid__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (CdiGrid *)new CdiGrid();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_CdiGrid_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_CdiGrid_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_CdiGrid);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_CdiGrid__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  CdiGrid *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","CdiGrid", 1, argv[0] ));
+  } 
+  arg1 = static_cast< int >(val1);
+  result = (CdiGrid *)new CdiGrid(arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_CdiGrid(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[1];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 1) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_CdiGrid__SWIG_0(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_CdiGrid__SWIG_1(nargs, args, self);
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 1, "CdiGrid.new", 
+    "    CdiGrid.new()\n"
+    "    CdiGrid.new(int gridid)\n");
+  
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_CdiGrid(CdiGrid *arg1) {
+    delete arg1;
+}
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_gridID_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","gridID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->gridID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_gridID_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","gridID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->gridID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_type_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","type", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","type", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->type = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_type_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","type", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->type);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::CdiGrid.size
+
+  call-seq:
+    size -> int
+
+Size or Length of the CdiGrid.
+*/
+
+/*
+  Document-method: CdiObj::CdiGrid.size=
+
+  call-seq:
+    size=(x) -> int
+
+Size or Length of the CdiGrid.
+*/
+SWIGINTERN VALUE
+_wrap_CdiGrid_size_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","size", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->size = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_size_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->size);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xsize_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xsize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","xsize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->xsize = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xsize_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xsize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->xsize);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_ysize_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","ysize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ysize", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ysize = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_ysize_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","ysize", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->ysize);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_prec_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","prec", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","prec", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->prec = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_prec_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","prec", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->prec);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_ncorner_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","ncorner", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ncorner", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ncorner = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_ncorner_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","ncorner", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (int) ((arg1)->ncorner);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_hasXValues_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  bool arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","hasXValues", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_bool(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","hasXValues", 2, argv[0] ));
+  } 
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->hasXValues = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_hasXValues_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","hasXValues", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (bool) ((arg1)->hasXValues);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_hasYValues_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  bool arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","hasYValues", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_bool(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","hasYValues", 2, argv[0] ));
+  } 
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->hasYValues = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_hasYValues_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","hasYValues", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (bool) ((arg1)->hasYValues);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_hasBounds_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  bool arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","hasBounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  ecode2 = SWIG_AsVal_bool(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "bool","hasBounds", 2, argv[0] ));
+  } 
+  arg2 = static_cast< bool >(val2);
+  if (arg1) (arg1)->hasBounds = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_hasBounds_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  bool result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","hasBounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (bool) ((arg1)->hasBounds);
+  vresult = SWIG_From_bool(static_cast< bool >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xvalues_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xvalues", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > *","xvalues", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->xvalues = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xvalues_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xvalues", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->xvalues);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_yvalues_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","yvalues", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > *","yvalues", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->yvalues = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_yvalues_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","yvalues", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->yvalues);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xbounds_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xbounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > *","xbounds", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->xbounds = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xbounds_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xbounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->xbounds);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_ybounds_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","ybounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > *","ybounds", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->ybounds = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_ybounds_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","ybounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->ybounds);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xname_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","xname", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","xname", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->xname = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xname_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->xname);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xlongname_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xlongname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","xlongname", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","xlongname", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->xlongname = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xlongname_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xlongname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->xlongname);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xstdname_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xstdname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","xstdname", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","xstdname", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->xstdname = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xstdname_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xstdname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->xstdname);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xunits_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xunits", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","xunits", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","xunits", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->xunits = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_xunits_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","xunits", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->xunits);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_yname_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","yname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","yname", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","yname", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->yname = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_yname_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","yname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->yname);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_ylongname_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","ylongname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","ylongname", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","ylongname", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->ylongname = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_ylongname_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","ylongname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->ylongname);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_ystdname_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","ystdname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","ystdname", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","ystdname", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->ystdname = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_ystdname_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","ystdname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->ystdname);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_yunits_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","yunits", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","yunits", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","yunits", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->yunits = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_yunits_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","yunits", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->yunits);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_name_set(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","name", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","name", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","name", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->name = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_name_get(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","name", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  result = (std::string *) & ((arg1)->name);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_getValues(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","getValues", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  (arg1)->getValues();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_getBounds(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","getBounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  (arg1)->getBounds();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_getValuesAsPointer(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  double *arg2 = (double *) 0 ;
+  double *arg3 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","getValuesAsPointer", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","getValuesAsPointer", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "double *","getValuesAsPointer", 3, argv[1] )); 
+  }
+  arg3 = reinterpret_cast< double * >(argp3);
+  (arg1)->getValuesAsPointer(arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_getBoundsAsPointer(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  double *arg2 = (double *) 0 ;
+  double *arg3 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","getBoundsAsPointer", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","getBoundsAsPointer", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_double, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "double *","getBoundsAsPointer", 3, argv[1] )); 
+  }
+  arg3 = reinterpret_cast< double * >(argp3);
+  (arg1)->getBoundsAsPointer(arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_getFloatVals(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  float *arg2 = (float *) 0 ;
+  float *arg3 = (float *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","getFloatVals", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "float *","getFloatVals", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< float * >(argp2);
+  res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "float *","getFloatVals", 3, argv[1] )); 
+  }
+  arg3 = reinterpret_cast< float * >(argp3);
+  (arg1)->getFloatVals(arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiGrid_getFloatBounds(int argc, VALUE *argv, VALUE self) {
+  CdiGrid *arg1 = (CdiGrid *) 0 ;
+  float *arg2 = (float *) 0 ;
+  float *arg3 = (float *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  void *argp3 = 0 ;
+  int res3 = 0 ;
+  
+  if ((argc < 2) || (argc > 2)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiGrid *","getFloatBounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiGrid * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "float *","getFloatBounds", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< float * >(argp2);
+  res3 = SWIG_ConvertPtr(argv[1], &argp3,SWIGTYPE_p_float, 0 |  0 );
+  if (!SWIG_IsOK(res3)) {
+    SWIG_exception_fail(SWIG_ArgError(res3), Ruby_Format_TypeError( "", "float *","getFloatBounds", 3, argv[1] )); 
+  }
+  arg3 = reinterpret_cast< float * >(argp3);
+  (arg1)->getFloatBounds(arg2,arg3);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+swig_class SwigClassCdiTaxis;
+
+SWIGINTERN VALUE
+_wrap_new_CdiTaxis__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (CdiTaxis *)new CdiTaxis();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_CdiTaxis_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_CdiTaxis_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_CdiTaxis);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_CdiTaxis__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  CdiTaxis *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","CdiTaxis", 1, argv[0] ));
+  } 
+  arg1 = static_cast< int >(val1);
+  result = (CdiTaxis *)new CdiTaxis(arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_CdiTaxis(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[1];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 1) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_CdiTaxis__SWIG_0(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_CdiTaxis__SWIG_1(nargs, args, self);
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 1, "CdiTaxis.new", 
+    "    CdiTaxis.new()\n"
+    "    CdiTaxis.new(int vlistID)\n");
+  
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_CdiTaxis(CdiTaxis *arg1) {
+    delete arg1;
+}
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_taxisID_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","taxisID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->taxisID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_taxisID_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","taxisID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->taxisID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_ntsteps_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","ntsteps", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ntsteps", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ntsteps = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_ntsteps_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","ntsteps", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->ntsteps);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_unit_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","unit", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","unit", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->unit = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_unit_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","unit", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->unit);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_rdate_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","rdate", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","rdate", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->rdate = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_rdate_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","rdate", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->rdate);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_rtime_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","rtime", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","rtime", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->rtime = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_rtime_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","rtime", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->rtime);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_vdate_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","vdate", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vdate", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->vdate = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_vdate_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","vdate", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->vdate);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_vtime_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","vtime", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vtime", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->vtime = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_vtime_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","vtime", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->vtime);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_type_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","type", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","type", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->type = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_type_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","type", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->type);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_calendar_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","calendar", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","calendar", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->calendar = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_calendar_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","calendar", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->calendar);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_hasBounds_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","hasBounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","hasBounds", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->hasBounds = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_hasBounds_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","hasBounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (int) ((arg1)->hasBounds);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_name_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  char *arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  char temp2[128] ;
+  int res2 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","name", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  res2 = SWIG_AsCharArray(argv[0], temp2, 128);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char [128]","name", 2, argv[0] ));
+  }
+  arg2 = reinterpret_cast< char * >(temp2);
+  if (arg2) memcpy(arg1->name,arg2,128*sizeof(char));
+  else memset(arg1->name,0,128*sizeof(char));
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_name_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","name", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (char *)(char *) ((arg1)->name);
+  {
+    size_t size = 128;
+    
+    while (size && (result[size - 1] == '\0')) --size;
+    
+    vresult = SWIG_FromCharPtrAndSize(result, size);
+  }
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_unitname_set(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  char *arg2 = (char *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 ;
+  char *buf2 = 0 ;
+  int alloc2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","unitname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  res2 = SWIG_AsCharPtrAndSize(argv[0], &buf2, NULL, &alloc2);
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "char *","unitname", 2, argv[0] ));
+  }
+  arg2 = reinterpret_cast< char * >(buf2);
+  if (arg1->unitname) delete[] arg1->unitname;
+  if (arg2) {
+    size_t size = strlen(reinterpret_cast< const char * >(arg2)) + 1;
+    arg1->unitname = (char *)reinterpret_cast< char* >(memcpy((new char[size]), reinterpret_cast< const char * >(arg2), sizeof(char)*(size)));
+  } else {
+    arg1->unitname = 0;
+  }
+  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+  return Qnil;
+fail:
+  if (alloc2 == SWIG_NEWOBJ) delete[] buf2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiTaxis_unitname_get(int argc, VALUE *argv, VALUE self) {
+  CdiTaxis *arg1 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  char *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiTaxis *","unitname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiTaxis * >(argp1);
+  result = (char *) ((arg1)->unitname);
+  vresult = SWIG_FromCharPtr((const char *)result);
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+swig_class SwigClassCdiZaxis;
+
+SWIGINTERN VALUE
+_wrap_new_CdiZaxis__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (CdiZaxis *)new CdiZaxis();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_CdiZaxis_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_CdiZaxis_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_CdiZaxis);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_CdiZaxis__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  CdiZaxis *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","CdiZaxis", 1, argv[0] ));
+  } 
+  arg1 = static_cast< int >(val1);
+  result = (CdiZaxis *)new CdiZaxis(arg1);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_CdiZaxis(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[1];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 1) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_CdiZaxis__SWIG_0(nargs, args, self);
+  }
+  if (argc == 1) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      return _wrap_new_CdiZaxis__SWIG_1(nargs, args, self);
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 1, "CdiZaxis.new", 
+    "    CdiZaxis.new()\n"
+    "    CdiZaxis.new(int zaxisid)\n");
+  
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_CdiZaxis(CdiZaxis *arg1) {
+    delete arg1;
+}
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_zaxisID_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","zaxisID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->zaxisID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_zaxisID_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","zaxisID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (int) ((arg1)->zaxisID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_type_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","type", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","type", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->type = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_type_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","type", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (int) ((arg1)->type);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_ltype_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","ltype", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ltype", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ltype = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_ltype_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","ltype", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (int) ((arg1)->ltype);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::CdiZaxis.size
+
+  call-seq:
+    size -> int
+
+Size or Length of the CdiZaxis.
+*/
+
+/*
+  Document-method: CdiObj::CdiZaxis.size=
+
+  call-seq:
+    size=(x) -> int
+
+Size or Length of the CdiZaxis.
+*/
+SWIGINTERN VALUE
+_wrap_CdiZaxis_size_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","size", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->size = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_size_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (int) ((arg1)->size);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_prec_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","prec", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","prec", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->prec = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_prec_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","prec", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (int) ((arg1)->prec);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_plevels_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  double *arg2 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","plevels", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_double, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","plevels", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  if (arg1) (arg1)->plevels = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_plevels_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","plevels", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (double *) ((arg1)->plevels);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_plbounds_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  double *arg2 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","plbounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_double, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","plbounds", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  if (arg1) (arg1)->plbounds = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_plbounds_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","plbounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (double *) ((arg1)->plbounds);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_pubounds_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  double *arg2 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","pubounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_double, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","pubounds", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  if (arg1) (arg1)->pubounds = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_pubounds_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","pubounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (double *) ((arg1)->pubounds);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_pweights_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  double *arg2 = (double *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","pweights", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_double, SWIG_POINTER_DISOWN |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "double *","pweights", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< double * >(argp2);
+  if (arg1) (arg1)->pweights = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_pweights_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","pweights", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (double *) ((arg1)->pweights);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_levels_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","levels", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > *","levels", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->levels = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_levels_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","levels", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->levels);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_lbounds_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","lbounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > *","lbounds", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->lbounds = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_lbounds_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","lbounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->lbounds);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_ubounds_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","ubounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > *","ubounds", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->ubounds = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_ubounds_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","ubounds", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->ubounds);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_weights_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","weights", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > *","weights", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->weights = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_weights_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","weights", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->weights);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_name_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","name", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","name", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","name", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->name = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_name_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","name", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::string *) & ((arg1)->name);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_longname_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","longname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","longname", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","longname", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->longname = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_longname_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","longname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::string *) & ((arg1)->longname);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_units_set(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","units", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","units", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","units", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->units = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiZaxis_units_get(int argc, VALUE *argv, VALUE self) {
+  CdiZaxis *arg1 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiZaxis *","units", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiZaxis * >(argp1);
+  result = (std::string *) & ((arg1)->units);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+swig_class SwigClassCdiVariable;
+
+SWIGINTERN VALUE
+_wrap_new_CdiVariable__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *result = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  result = (CdiVariable *)new CdiVariable();
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_CdiVariable_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_CdiVariable_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_CdiVariable);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_CdiVariable__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  int arg1 ;
+  int arg2 ;
+  int arg3 ;
+  int val1 ;
+  int ecode1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  int val3 ;
+  int ecode3 = 0 ;
+  CdiVariable *result = 0 ;
+  
+  if ((argc < 3) || (argc > 3)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 3)",argc); SWIG_fail;
+  }
+  ecode1 = SWIG_AsVal_int(argv[0], &val1);
+  if (!SWIG_IsOK(ecode1)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode1), Ruby_Format_TypeError( "", "int","CdiVariable", 1, argv[0] ));
+  } 
+  arg1 = static_cast< int >(val1);
+  ecode2 = SWIG_AsVal_int(argv[1], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","CdiVariable", 2, argv[1] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  ecode3 = SWIG_AsVal_int(argv[2], &val3);
+  if (!SWIG_IsOK(ecode3)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","CdiVariable", 3, argv[2] ));
+  } 
+  arg3 = static_cast< int >(val3);
+  result = (CdiVariable *)new CdiVariable(arg1,arg2,arg3);
+  DATA_PTR(self) = result;
+  return self;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_new_CdiVariable(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[3];
+  int ii;
+  
+  argc = nargs;
+  if (argc > 3) SWIG_fail;
+  for (ii = 0; (ii < argc); ++ii) {
+    argv[ii] = args[ii];
+  }
+  if (argc == 0) {
+    return _wrap_new_CdiVariable__SWIG_0(nargs, args, self);
+  }
+  if (argc == 3) {
+    int _v;
+    {
+      int res = SWIG_AsVal_int(argv[0], NULL);
+      _v = SWIG_CheckState(res);
+    }
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        {
+          int res = SWIG_AsVal_int(argv[2], NULL);
+          _v = SWIG_CheckState(res);
+        }
+        if (_v) {
+          return _wrap_new_CdiVariable__SWIG_1(nargs, args, self);
+        }
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 3, "CdiVariable.new", 
+    "    CdiVariable.new()\n"
+    "    CdiVariable.new(int streamid, int vlistid, int varid)\n");
+  
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_CdiVariable(CdiVariable *arg1) {
+    delete arg1;
+}
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_varID_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","varID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","varID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->varID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_varID_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","varID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->varID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_zaxisID_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","zaxisID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","zaxisID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->zaxisID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_zaxisID_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","zaxisID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->zaxisID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_gridID_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","gridID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","gridID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->gridID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_gridID_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","gridID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->gridID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_taxisID_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","taxisID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->taxisID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_taxisID_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","taxisID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->taxisID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_timeID_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","timeID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","timeID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->timeID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_timeID_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","timeID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->timeID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_vlistID_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","vlistID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->vlistID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_vlistID_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","vlistID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->vlistID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::CdiVariable.size
+
+  call-seq:
+    size -> int
+
+Size or Length of the CdiVariable.
+*/
+
+/*
+  Document-method: CdiObj::CdiVariable.size=
+
+  call-seq:
+    size=(x) -> int
+
+Size or Length of the CdiVariable.
+*/
+SWIGINTERN VALUE
+_wrap_CdiVariable_size_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","size", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->size = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_size_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","size", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->size);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_code_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","code", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","code", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->code = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_code_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","code", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->code);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_datatype_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","datatype", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","datatype", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->datatype = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_datatype_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","datatype", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->datatype);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_streamID_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","streamID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->streamID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_streamID_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","streamID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (int) ((arg1)->streamID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_name_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","name", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","name", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","name", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->name = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_name_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","name", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::string *) & ((arg1)->name);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_longname_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","longname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","longname", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","longname", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->longname = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_longname_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","longname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::string *) & ((arg1)->longname);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_units_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","units", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","units", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","units", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->units = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_units_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","units", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::string *) & ((arg1)->units);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_stdname_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::string *arg2 = 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int res2 = SWIG_OLDOBJ ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","stdname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  {
+    std::string *ptr = (std::string *)0;
+    res2 = SWIG_AsPtr_std_string(argv[0], &ptr);
+    if (!SWIG_IsOK(res2)) {
+      SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::string const &","stdname", 2, argv[0] )); 
+    }
+    if (!ptr) {
+      SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "std::string const &","stdname", 2, argv[0])); 
+    }
+    arg2 = ptr;
+  }
+  if (arg1) (arg1)->stdname = *arg2;
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+fail:
+  if (SWIG_IsNewObj(res2)) delete arg2;
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_stdname_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::string *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","stdname", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::string *) & ((arg1)->stdname);
+  vresult = SWIG_From_std_string(static_cast< std::string >(*result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_missval_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  double arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","missval", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_double(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","missval", 2, argv[0] ));
+  } 
+  arg2 = static_cast< double >(val2);
+  if (arg1) (arg1)->missval = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_missval_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","missval", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (double) ((arg1)->missval);
+  vresult = SWIG_From_double(static_cast< double >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+
+/*
+  Document-method: CdiObj::CdiVariable.values
+
+  call-seq:
+    values -> DoubleVector
+
+Return an Array of value elements.
+*/
+
+/*
+  Document-method: CdiObj::CdiVariable.values=
+
+  call-seq:
+    values=(x) -> DoubleVector
+
+Return an Array of value elements.
+*/
+SWIGINTERN VALUE
+_wrap_CdiVariable_values_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::vector< double,std::allocator< double > > *arg2 = (std::vector< double,std::allocator< double > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","values", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< double,std::allocator< double > > *","values", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< double,std::allocator< double > > * >(argp2);
+  if (arg1) (arg1)->values = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_values_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< double,std::allocator< double > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","values", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::vector< double,std::allocator< double > > *)& ((arg1)->values);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_valuesWithLevel_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *arg2 = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","valuesWithLevel", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *","valuesWithLevel", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > * >(argp2);
+  if (arg1) (arg1)->valuesWithLevel = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_valuesWithLevel_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","valuesWithLevel", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *)& ((arg1)->valuesWithLevel);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_grid_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  CdiGrid *arg2 = (CdiGrid *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","grid", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_CdiGrid, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "CdiGrid *","grid", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< CdiGrid * >(argp2);
+  if (arg1) (arg1)->grid = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_grid_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  CdiGrid *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","grid", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (CdiGrid *)& ((arg1)->grid);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiGrid, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_zaxis_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  CdiZaxis *arg2 = (CdiZaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","zaxis", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "CdiZaxis *","zaxis", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< CdiZaxis * >(argp2);
+  if (arg1) (arg1)->zaxis = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_zaxis_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  CdiZaxis *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","zaxis", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (CdiZaxis *)& ((arg1)->zaxis);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiZaxis, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_taxis_set(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  CdiTaxis *arg2 = (CdiTaxis *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","taxis", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "CdiTaxis *","taxis", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< CdiTaxis * >(argp2);
+  if (arg1) (arg1)->taxis = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_taxis_get(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  CdiTaxis *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","taxis", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (CdiTaxis *)& ((arg1)->taxis);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_CdiTaxis, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_sinfo(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","sinfo", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  (arg1)->sinfo();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_getValues(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","getValues", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  (arg1)->getValues();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_getValuesWithLevel__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","getValuesWithLevel", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","getValuesWithLevel", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  (arg1)->getValuesWithLevel(arg2);
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_getValuesWithLevel__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","getValuesWithLevel", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  (arg1)->getValuesWithLevel();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_CdiVariable_getValuesWithLevel(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[3];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 3) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_CdiVariable_getValuesWithLevel__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_CdiVariable_getValuesWithLevel__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 3, "CdiVariable.getValuesWithLevel", 
+    "    void CdiVariable.getValuesWithLevel(int tsID)\n"
+    "    void CdiVariable.getValuesWithLevel()\n");
+  
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_getFValues(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::vector< float,std::allocator< float > > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","getFValues", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (arg1)->getFValues();
+  vresult = SWIG_NewPointerObj((new std::vector< float,std::allocator< float > >(static_cast< const std::vector< float,std::allocator< float > >& >(result))), SWIGTYPE_p_std__vectorT_float_std__allocatorT_float_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_getFValuesWithLevel__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  SwigValueWrapper< std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","getFValuesWithLevel", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","getFValuesWithLevel", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  result = (arg1)->getFValuesWithLevel(arg2);
+  vresult = SWIG_NewPointerObj((new std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >(static_cast< const std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >& >(result))), SWIGTYPE_p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_getFValuesWithLevel__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  SwigValueWrapper< std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > > > result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","getFValuesWithLevel", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (arg1)->getFValuesWithLevel();
+  vresult = SWIG_NewPointerObj((new std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >(static_cast< const std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > >& >(result))), SWIGTYPE_p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t, SWIG_POINTER_OWN |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_CdiVariable_getFValuesWithLevel(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[3];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 3) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_CdiVariable_getFValuesWithLevel__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_CdiVariable_getFValuesWithLevel__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 3, "CdiVariable.getFValuesWithLevel", 
+    "    std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > > CdiVariable.getFValuesWithLevel(int tsID)\n"
+    "    std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > > CdiVariable.getFValuesWithLevel()\n");
+  
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_getValuesAsPointer(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","getValuesAsPointer", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (double *)(arg1)->getValuesAsPointer();
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_double, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_getValuesWithLevelAsPointer__SWIG_0(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  double **result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","getValuesWithLevelAsPointer", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","getValuesWithLevelAsPointer", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  result = (double **)(arg1)->getValuesWithLevelAsPointer(arg2);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_double, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_CdiVariable_getValuesWithLevelAsPointer__SWIG_1(int argc, VALUE *argv, VALUE self) {
+  CdiVariable *arg1 = (CdiVariable *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  double **result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_CdiVariable, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "CdiVariable *","getValuesWithLevelAsPointer", 1, self )); 
+  }
+  arg1 = reinterpret_cast< CdiVariable * >(argp1);
+  result = (double **)(arg1)->getValuesWithLevelAsPointer();
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_double, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE _wrap_CdiVariable_getValuesWithLevelAsPointer(int nargs, VALUE *args, VALUE self) {
+  int argc;
+  VALUE argv[3];
+  int ii;
+  
+  argc = nargs + 1;
+  argv[0] = self;
+  if (argc > 3) SWIG_fail;
+  for (ii = 1; (ii < argc); ++ii) {
+    argv[ii] = args[ii-1];
+  }
+  if (argc == 1) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      return _wrap_CdiVariable_getValuesWithLevelAsPointer__SWIG_1(nargs, args, self);
+    }
+  }
+  if (argc == 2) {
+    int _v;
+    void *vptr = 0;
+    int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_CdiVariable, 0);
+    _v = SWIG_CheckState(res);
+    if (_v) {
+      {
+        int res = SWIG_AsVal_int(argv[1], NULL);
+        _v = SWIG_CheckState(res);
+      }
+      if (_v) {
+        return _wrap_CdiVariable_getValuesWithLevelAsPointer__SWIG_0(nargs, args, self);
+      }
+    }
+  }
+  
+fail:
+  Ruby_Format_OverloadedError( argc, 3, "CdiVariable.getValuesWithLevelAsPointer", 
+    "    double ** CdiVariable.getValuesWithLevelAsPointer(int tsID)\n"
+    "    double ** CdiVariable.getValuesWithLevelAsPointer()\n");
+  
+  return Qnil;
+}
+
+
+swig_class SwigClassCdi;
+
+#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
+SWIGINTERN VALUE
+_wrap_Cdi_allocate(VALUE self) {
+#else
+  SWIGINTERN VALUE
+  _wrap_Cdi_allocate(int argc, VALUE *argv, VALUE self) {
+#endif
+    
+    
+    VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Cdi);
+#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
+    rb_obj_call_init(vresult, argc, argv);
+#endif
+    return vresult;
+  }
+  
+
+SWIGINTERN VALUE
+_wrap_new_Cdi(int argc, VALUE *argv, VALUE self) {
+  char *arg1 = (char *) 0 ;
+  int res1 ;
+  char *buf1 = 0 ;
+  int alloc1 = 0 ;
+  Cdi *result = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_AsCharPtrAndSize(argv[0], &buf1, NULL, &alloc1);
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "char const *","Cdi", 1, argv[0] ));
+  }
+  arg1 = reinterpret_cast< char * >(buf1);
+  result = (Cdi *)new Cdi((char const *)arg1);
+  DATA_PTR(self) = result;
+  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+  return self;
+fail:
+  if (alloc1 == SWIG_NEWOBJ) delete[] buf1;
+  return Qnil;
+}
+
+
+SWIGINTERN void
+free_Cdi(Cdi *arg1) {
+    delete arg1;
+}
+
+SWIGINTERN VALUE
+_wrap_Cdi_streamID_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","streamID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","streamID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->streamID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_streamID_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","streamID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->streamID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_vlistID_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","vlistID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","vlistID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->vlistID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_vlistID_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","vlistID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->vlistID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_nvars_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","nvars", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","nvars", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->nvars = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_nvars_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","nvars", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->nvars);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_nzaxes_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","nzaxes", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","nzaxes", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->nzaxes = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_nzaxes_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","nzaxes", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->nzaxes);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_ngrids_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","ngrids", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ngrids", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ngrids = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_ngrids_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","ngrids", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->ngrids);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_ntaxes_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","ntaxes", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","ntaxes", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->ntaxes = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_ntaxes_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","ntaxes", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->ntaxes);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_taxisID_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  int arg2 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int val2 ;
+  int ecode2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","taxisID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  ecode2 = SWIG_AsVal_int(argv[0], &val2);
+  if (!SWIG_IsOK(ecode2)) {
+    SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","taxisID", 2, argv[0] ));
+  } 
+  arg2 = static_cast< int >(val2);
+  if (arg1) (arg1)->taxisID = arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_taxisID_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  int result;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","taxisID", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (int) ((arg1)->taxisID);
+  vresult = SWIG_From_int(static_cast< int >(result));
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_varnames_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::vector< std::string,std::allocator< std::string > > *arg2 = (std::vector< std::string,std::allocator< std::string > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","varnames", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< std::string,std::allocator< std::string > > *","varnames", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< std::string,std::allocator< std::string > > * >(argp2);
+  if (arg1) (arg1)->varnames = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_varnames_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< std::string,std::allocator< std::string > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","varnames", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::vector< std::string,std::allocator< std::string > > *)& ((arg1)->varnames);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_codes_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::vector< int,std::allocator< int > > *arg2 = (std::vector< int,std::allocator< int > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","codes", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< int,std::allocator< int > > *","codes", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< int,std::allocator< int > > * >(argp2);
+  if (arg1) (arg1)->codes = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_codes_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< int,std::allocator< int > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","codes", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::vector< int,std::allocator< int > > *)& ((arg1)->codes);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_variables_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *arg2 = (std::vector< CdiVariable,std::allocator< CdiVariable > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","variables", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::vector< CdiVariable,std::allocator< CdiVariable > > *","variables", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::vector< CdiVariable,std::allocator< CdiVariable > > * >(argp2);
+  if (arg1) (arg1)->variables = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_variables_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::vector< CdiVariable,std::allocator< CdiVariable > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","variables", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::vector< CdiVariable,std::allocator< CdiVariable > > *)& ((arg1)->variables);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_var_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *arg2 = (std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","var", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *","var", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > * >(argp2);
+  if (arg1) (arg1)->var = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_var_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","var", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *)& ((arg1)->var);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_varByCode_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *arg2 = (std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","varByCode", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *","varByCode", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > * >(argp2);
+  if (arg1) (arg1)->varByCode = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_varByCode_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","varByCode", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *)& ((arg1)->varByCode);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_taxes_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *arg2 = (std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","taxes", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *","taxes", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > * >(argp2);
+  if (arg1) (arg1)->taxes = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_taxes_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","taxes", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *)& ((arg1)->taxes);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_zaxes_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *arg2 = (std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","zaxes", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *","zaxes", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > * >(argp2);
+  if (arg1) (arg1)->zaxes = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_zaxes_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","zaxes", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *)& ((arg1)->zaxes);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_grids_set(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *arg2 = (std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  void *argp2 = 0 ;
+  int res2 = 0 ;
+  
+  if ((argc < 1) || (argc > 1)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","grids", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  res2 = SWIG_ConvertPtr(argv[0], &argp2,SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  if (!SWIG_IsOK(res2)) {
+    SWIG_exception_fail(SWIG_ArgError(res2), Ruby_Format_TypeError( "", "std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *","grids", 2, argv[0] )); 
+  }
+  arg2 = reinterpret_cast< std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > * >(argp2);
+  if (arg1) (arg1)->grids = *arg2;
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_grids_get(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *result = 0 ;
+  VALUE vresult = Qnil;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","grids", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  result = (std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *)& ((arg1)->grids);
+  vresult = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0 |  0 );
+  return vresult;
+fail:
+  return Qnil;
+}
+
+
+SWIGINTERN VALUE
+_wrap_Cdi_griddes(int argc, VALUE *argv, VALUE self) {
+  Cdi *arg1 = (Cdi *) 0 ;
+  void *argp1 = 0 ;
+  int res1 = 0 ;
+  
+  if ((argc < 0) || (argc > 0)) {
+    rb_raise(rb_eArgError, "wrong # of arguments(%d for 0)",argc); SWIG_fail;
+  }
+  res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_Cdi, 0 |  0 );
+  if (!SWIG_IsOK(res1)) {
+    SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Cdi *","griddes", 1, self )); 
+  }
+  arg1 = reinterpret_cast< Cdi * >(argp1);
+  (arg1)->griddes();
+  return Qnil;
+fail:
+  return Qnil;
+}
+
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
+
+static void *_p_swig__IteratorTo_p_swig__ConstIterator(void *x, int *SWIGUNUSEDPARM(newmemory)) {
+    return (void *)((swig::ConstIterator *)  ((swig::Iterator *) x));
+}
+static swig_type_info _swigt__p_Cdi = {"_p_Cdi", "Cdi *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CdiGrid = {"_p_CdiGrid", "std::map< int,CdiGrid >::mapped_type *|CdiGrid *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CdiTaxis = {"_p_CdiTaxis", "std::map< int,CdiTaxis >::mapped_type *|CdiTaxis *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CdiVariable = {"_p_CdiVariable", "std::map< std::string,CdiVariable >::mapped_type *|std::vector< CdiVariable >::value_type *|std::map< int,CdiVariable >::mapped_type *|CdiVariable *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_CdiZaxis = {"_p_CdiZaxis", "std::map< int,CdiZaxis >::mapped_type *|CdiZaxis *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_allocator_type = {"_p_allocator_type", "allocator_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_difference_type = {"_p_difference_type", "difference_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_double = {"_p_double", "double *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_float = {"_p_float", "float *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_key_type = {"_p_key_type", "key_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_mapped_type = {"_p_mapped_type", "mapped_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_double = {"_p_p_double", "double **", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_p_void = {"_p_p_void", "void **|VALUE *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_size_type = {"_p_size_type", "size_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_CdiVariable_t = {"_p_std__allocatorT_CdiVariable_t", "std::vector< CdiVariable >::allocator_type *|std::allocator< CdiVariable > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_double_t = {"_p_std__allocatorT_double_t", "std::vector< double >::allocator_type *|std::allocator< double > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_int_t = {"_p_std__allocatorT_int_t", "std::vector< int >::allocator_type *|std::allocator< int > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t = {"_p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t", "std::map< int,CdiGrid >::allocator_type *|std::allocator< std::pair< int const,CdiGrid > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t = {"_p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t", "std::map< int,CdiTaxis >::allocator_type *|std::allocator< std::pair< int const,CdiTaxis > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t = {"_p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t", "std::map< int,CdiVariable >::allocator_type *|std::allocator< std::pair< int const,CdiVariable > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t = {"_p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t", "std::map< int,CdiZaxis >::allocator_type *|std::allocator< std::pair< int const,CdiZaxis > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t = {"_p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t", "std::allocator< std::pair< std::string const,CdiVariable > > *|std::map< std::string,CdiVariable >::allocator_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__string_t = {"_p_std__allocatorT_std__string_t", "std::vector< std::string >::allocator_type *|std::allocator< std::string > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t = {"_p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t", "std::vector< std::vector< double > >::allocator_type *|std::allocator< std::vector< double,std::allocator< double > > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__lessT_int_t = {"_p_std__lessT_int_t", "std::less< int > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__lessT_std__string_t = {"_p_std__lessT_std__string_t", "std::less< std::string > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t = {"_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t", "std::map< int,CdiGrid > *|std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator = {"_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator", "std::map< int,CdiGrid >::iterator *|std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::iterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__reverse_iterator = {"_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__reverse_iterator", "std::map< int,CdiGrid >::reverse_iterator *|std::map< int,CdiGrid,std::less< int >,std::allocator< std::pair< int const,CdiGrid > > >::reverse_iterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t = {"_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t", "std::map< int,CdiTaxis > *|std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator = {"_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator", "std::map< int,CdiTaxis >::iterator *|std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::iterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__reverse_iterator = {"_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__reverse_iterator", "std::map< int,CdiTaxis >::reverse_iterator *|std::map< int,CdiTaxis,std::less< int >,std::allocator< std::pair< int const,CdiTaxis > > >::reverse_iterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t = {"_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t", "std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > > *|std::map< int,CdiVariable > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator = {"_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator", "std::map< int,CdiVariable >::iterator *|std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::iterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__reverse_iterator = {"_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__reverse_iterator", "std::map< int,CdiVariable >::reverse_iterator *|std::map< int,CdiVariable,std::less< int >,std::allocator< std::pair< int const,CdiVariable > > >::reverse_iterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t = {"_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t", "std::map< int,CdiZaxis > *|std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator = {"_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator", "std::map< int,CdiZaxis >::iterator *|std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::iterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__reverse_iterator = {"_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__reverse_iterator", "std::map< int,CdiZaxis >::reverse_iterator *|std::map< int,CdiZaxis,std::less< int >,std::allocator< std::pair< int const,CdiZaxis > > >::reverse_iterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t = {"_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t", "std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > > *|std::map< std::string,CdiVariable > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator = {"_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator", "std::map< std::string,CdiVariable >::iterator *|std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariable > > >::iterator *", 0, [...]
+static swig_type_info _swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__reverse_iterator = {"_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__reverse_iterator", "std::map< std::string,CdiVariable >::reverse_iterator *|std::map< std::string,CdiVariable,std::less< std::string >,std::allocator< std::pair< std::string const,CdiVariabl [...]
+static swig_type_info _swigt__p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t = {"_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t", "std::vector< CdiVariable,std::allocator< CdiVariable > > *|std::vector< CdiVariable > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_double_std__allocatorT_double_t_t = {"_p_std__vectorT_double_std__allocatorT_double_t_t", "std::vector< double,std::allocator< double > > *|std::vector< double > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_float_std__allocatorT_float_t_t = {"_p_std__vectorT_float_std__allocatorT_float_t_t", "std::vector< float,std::allocator< float > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_int_std__allocatorT_int_t_t = {"_p_std__vectorT_int_std__allocatorT_int_t_t", "std::vector< int,std::allocator< int > > *|std::vector< int > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t = {"_p_std__vectorT_std__string_std__allocatorT_std__string_t_t", "std::vector< std::string,std::allocator< std::string > > *|std::vector< std::string > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t = {"_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t", "std::vector< std::vector< double > > *|std::vector< std::vector< double,std::allocator< double > >,std::allocator< std::vector< double,std::allocator< double > > > > *|std::vector< std::vector< do [...]
+static swig_type_info _swigt__p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t = {"_p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t", "std::vector< std::vector< float,std::allocator< float > >,std::allocator< std::vector< float,std::allocator< float > > > > *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_swig__ConstIterator = {"_p_swig__ConstIterator", "swig::ConstIterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_swig__GC_VALUE = {"_p_swig__GC_VALUE", "swig::GC_VALUE *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_swig__Iterator = {"_p_swig__Iterator", "swig::Iterator *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_value_type = {"_p_value_type", "value_type *", 0, 0, (void*)0, 0};
+static swig_type_info _swigt__p_void = {"_p_void", "VALUE|void *", 0, 0, (void*)0, 0};
+
+static swig_type_info *swig_type_initial[] = {
+  &_swigt__p_Cdi,
+  &_swigt__p_CdiGrid,
+  &_swigt__p_CdiTaxis,
+  &_swigt__p_CdiVariable,
+  &_swigt__p_CdiZaxis,
+  &_swigt__p_allocator_type,
+  &_swigt__p_char,
+  &_swigt__p_difference_type,
+  &_swigt__p_double,
+  &_swigt__p_float,
+  &_swigt__p_key_type,
+  &_swigt__p_mapped_type,
+  &_swigt__p_p_double,
+  &_swigt__p_p_void,
+  &_swigt__p_size_type,
+  &_swigt__p_std__allocatorT_CdiVariable_t,
+  &_swigt__p_std__allocatorT_double_t,
+  &_swigt__p_std__allocatorT_int_t,
+  &_swigt__p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t,
+  &_swigt__p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t,
+  &_swigt__p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t,
+  &_swigt__p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t,
+  &_swigt__p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t,
+  &_swigt__p_std__allocatorT_std__string_t,
+  &_swigt__p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t,
+  &_swigt__p_std__lessT_int_t,
+  &_swigt__p_std__lessT_std__string_t,
+  &_swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t,
+  &_swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator,
+  &_swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__reverse_iterator,
+  &_swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t,
+  &_swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator,
+  &_swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__reverse_iterator,
+  &_swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t,
+  &_swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator,
+  &_swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__reverse_iterator,
+  &_swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t,
+  &_swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator,
+  &_swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__reverse_iterator,
+  &_swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t,
+  &_swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator,
+  &_swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__reverse_iterator,
+  &_swigt__p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t,
+  &_swigt__p_std__vectorT_double_std__allocatorT_double_t_t,
+  &_swigt__p_std__vectorT_float_std__allocatorT_float_t_t,
+  &_swigt__p_std__vectorT_int_std__allocatorT_int_t_t,
+  &_swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t,
+  &_swigt__p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t,
+  &_swigt__p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t,
+  &_swigt__p_swig__ConstIterator,
+  &_swigt__p_swig__GC_VALUE,
+  &_swigt__p_swig__Iterator,
+  &_swigt__p_value_type,
+  &_swigt__p_void,
+};
+
+static swig_cast_info _swigc__p_Cdi[] = {  {&_swigt__p_Cdi, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CdiGrid[] = {  {&_swigt__p_CdiGrid, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CdiTaxis[] = {  {&_swigt__p_CdiTaxis, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CdiVariable[] = {  {&_swigt__p_CdiVariable, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_CdiZaxis[] = {  {&_swigt__p_CdiZaxis, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_allocator_type[] = {  {&_swigt__p_allocator_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_difference_type[] = {  {&_swigt__p_difference_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_double[] = {  {&_swigt__p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_float[] = {  {&_swigt__p_float, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_key_type[] = {  {&_swigt__p_key_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_mapped_type[] = {  {&_swigt__p_mapped_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_double[] = {  {&_swigt__p_p_double, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_p_void[] = {  {&_swigt__p_p_void, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_size_type[] = {  {&_swigt__p_size_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_CdiVariable_t[] = {  {&_swigt__p_std__allocatorT_CdiVariable_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_double_t[] = {  {&_swigt__p_std__allocatorT_double_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_int_t[] = {  {&_swigt__p_std__allocatorT_int_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t[] = {  {&_swigt__p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t[] = {  {&_swigt__p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t[] = {  {&_swigt__p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t[] = {  {&_swigt__p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t[] = {  {&_swigt__p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__string_t[] = {  {&_swigt__p_std__allocatorT_std__string_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t[] = {  {&_swigt__p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__lessT_int_t[] = {  {&_swigt__p_std__lessT_int_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__lessT_std__string_t[] = {  {&_swigt__p_std__lessT_std__string_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t[] = {  {&_swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator[] = {  {&_swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__reverse_iterator[] = {  {&_swigt__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__reverse_iterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t[] = {  {&_swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator[] = {  {&_swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__reverse_iterator[] = {  {&_swigt__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__reverse_iterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t[] = {  {&_swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator[] = {  {&_swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__reverse_iterator[] = {  {&_swigt__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__reverse_iterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t[] = {  {&_swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator[] = {  {&_swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__reverse_iterator[] = {  {&_swigt__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__reverse_iterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t[] = {  {&_swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator[] = {  {&_swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__reverse_iterator[] = {  {&_swigt__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__reverse_iterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t[] = {  {&_swigt__p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_double_std__allocatorT_double_t_t[] = {  {&_swigt__p_std__vectorT_double_std__allocatorT_double_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_float_std__allocatorT_float_t_t[] = {  {&_swigt__p_std__vectorT_float_std__allocatorT_float_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_int_std__allocatorT_int_t_t[] = {  {&_swigt__p_std__vectorT_int_std__allocatorT_int_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_std__string_std__allocatorT_std__string_t_t[] = {  {&_swigt__p_std__vectorT_std__string_std__allocatorT_std__string_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t[] = {  {&_swigt__p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t[] = {  {&_swigt__p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_swig__ConstIterator[] = {  {&_swigt__p_swig__ConstIterator, 0, 0, 0},  {&_swigt__p_swig__Iterator, _p_swig__IteratorTo_p_swig__ConstIterator, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_swig__GC_VALUE[] = {  {&_swigt__p_swig__GC_VALUE, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_swig__Iterator[] = {  {&_swigt__p_swig__Iterator, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_value_type[] = {  {&_swigt__p_value_type, 0, 0, 0},{0, 0, 0, 0}};
+static swig_cast_info _swigc__p_void[] = {  {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
+
+static swig_cast_info *swig_cast_initial[] = {
+  _swigc__p_Cdi,
+  _swigc__p_CdiGrid,
+  _swigc__p_CdiTaxis,
+  _swigc__p_CdiVariable,
+  _swigc__p_CdiZaxis,
+  _swigc__p_allocator_type,
+  _swigc__p_char,
+  _swigc__p_difference_type,
+  _swigc__p_double,
+  _swigc__p_float,
+  _swigc__p_key_type,
+  _swigc__p_mapped_type,
+  _swigc__p_p_double,
+  _swigc__p_p_void,
+  _swigc__p_size_type,
+  _swigc__p_std__allocatorT_CdiVariable_t,
+  _swigc__p_std__allocatorT_double_t,
+  _swigc__p_std__allocatorT_int_t,
+  _swigc__p_std__allocatorT_std__pairT_int_const_CdiGrid_t_t,
+  _swigc__p_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t,
+  _swigc__p_std__allocatorT_std__pairT_int_const_CdiVariable_t_t,
+  _swigc__p_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t,
+  _swigc__p_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t,
+  _swigc__p_std__allocatorT_std__string_t,
+  _swigc__p_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t,
+  _swigc__p_std__lessT_int_t,
+  _swigc__p_std__lessT_std__string_t,
+  _swigc__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t,
+  _swigc__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__iterator,
+  _swigc__p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t__reverse_iterator,
+  _swigc__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t,
+  _swigc__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__iterator,
+  _swigc__p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t__reverse_iterator,
+  _swigc__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t,
+  _swigc__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__iterator,
+  _swigc__p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t__reverse_iterator,
+  _swigc__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t,
+  _swigc__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__iterator,
+  _swigc__p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t__reverse_iterator,
+  _swigc__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t,
+  _swigc__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__iterator,
+  _swigc__p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t__reverse_iterator,
+  _swigc__p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t,
+  _swigc__p_std__vectorT_double_std__allocatorT_double_t_t,
+  _swigc__p_std__vectorT_float_std__allocatorT_float_t_t,
+  _swigc__p_std__vectorT_int_std__allocatorT_int_t_t,
+  _swigc__p_std__vectorT_std__string_std__allocatorT_std__string_t_t,
+  _swigc__p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t,
+  _swigc__p_std__vectorT_std__vectorT_float_std__allocatorT_float_t_t_std__allocatorT_std__vectorT_float_std__allocatorT_float_t_t_t_t,
+  _swigc__p_swig__ConstIterator,
+  _swigc__p_swig__GC_VALUE,
+  _swigc__p_swig__Iterator,
+  _swigc__p_value_type,
+  _swigc__p_void,
+};
+
+
+/* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
+
+/* -----------------------------------------------------------------------------
+ * Type initialization:
+ * This problem is tough by the requirement that no dynamic 
+ * memory is used. Also, since swig_type_info structures store pointers to 
+ * swig_cast_info structures and swig_cast_info structures store pointers back
+ * to swig_type_info structures, we need some lookup code at initialization. 
+ * The idea is that swig generates all the structures that are needed. 
+ * The runtime then collects these partially filled structures. 
+ * The SWIG_InitializeModule function takes these initial arrays out of 
+ * swig_module, and does all the lookup, filling in the swig_module.types
+ * array with the correct data and linking the correct swig_cast_info
+ * structures together.
+ *
+ * The generated swig_type_info structures are assigned staticly to an initial 
+ * array. We just loop through that array, and handle each type individually.
+ * First we lookup if this type has been already loaded, and if so, use the
+ * loaded structure instead of the generated one. Then we have to fill in the
+ * cast linked list. The cast data is initially stored in something like a
+ * two-dimensional array. Each row corresponds to a type (there are the same
+ * number of rows as there are in the swig_type_initial array). Each entry in
+ * a column is one of the swig_cast_info structures for that type.
+ * The cast_initial array is actually an array of arrays, because each row has
+ * a variable number of columns. So to actually build the cast linked list,
+ * we find the array of casts associated with the type, and loop through it 
+ * adding the casts to the list. The one last trick we need to do is making
+ * sure the type pointer in the swig_cast_info struct is correct.
+ *
+ * First off, we lookup the cast->type name to see if it is already loaded. 
+ * There are three cases to handle:
+ *  1) If the cast->type has already been loaded AND the type we are adding
+ *     casting info to has not been loaded (it is in this module), THEN we
+ *     replace the cast->type pointer with the type pointer that has already
+ *     been loaded.
+ *  2) If BOTH types (the one we are adding casting info to, and the 
+ *     cast->type) are loaded, THEN the cast info has already been loaded by
+ *     the previous module so we just ignore it.
+ *  3) Finally, if cast->type has not already been loaded, then we add that
+ *     swig_cast_info to the linked list (because the cast->type) pointer will
+ *     be correct.
+ * ----------------------------------------------------------------------------- */
+
+#ifdef __cplusplus
+extern "C" {
+#if 0
+} /* c-mode */
+#endif
+#endif
+
+#if 0
+#define SWIGRUNTIME_DEBUG
+#endif
+
+
+SWIGRUNTIME void
+SWIG_InitializeModule(void *clientdata) {
+  size_t i;
+  swig_module_info *module_head, *iter;
+  int found, init;
+
+  clientdata = clientdata;
+
+  /* check to see if the circular list has been setup, if not, set it up */
+  if (swig_module.next==0) {
+    /* Initialize the swig_module */
+    swig_module.type_initial = swig_type_initial;
+    swig_module.cast_initial = swig_cast_initial;
+    swig_module.next = &swig_module;
+    init = 1;
+  } else {
+    init = 0;
+  }
+
+  /* Try and load any already created modules */
+  module_head = SWIG_GetModule(clientdata);
+  if (!module_head) {
+    /* This is the first module loaded for this interpreter */
+    /* so set the swig module into the interpreter */
+    SWIG_SetModule(clientdata, &swig_module);
+    module_head = &swig_module;
+  } else {
+    /* the interpreter has loaded a SWIG module, but has it loaded this one? */
+    found=0;
+    iter=module_head;
+    do {
+      if (iter==&swig_module) {
+        found=1;
+        break;
+      }
+      iter=iter->next;
+    } while (iter!= module_head);
+
+    /* if the is found in the list, then all is done and we may leave */
+    if (found) return;
+    /* otherwise we must add out module into the list */
+    swig_module.next = module_head->next;
+    module_head->next = &swig_module;
+  }
+
+  /* When multiple interpeters are used, a module could have already been initialized in
+     a different interpreter, but not yet have a pointer in this interpreter.
+     In this case, we do not want to continue adding types... everything should be
+     set up already */
+  if (init == 0) return;
+
+  /* Now work on filling in swig_module.types */
+#ifdef SWIGRUNTIME_DEBUG
+  printf("SWIG_InitializeModule: size %d\n", swig_module.size);
+#endif
+  for (i = 0; i < swig_module.size; ++i) {
+    swig_type_info *type = 0;
+    swig_type_info *ret;
+    swig_cast_info *cast;
+  
+#ifdef SWIGRUNTIME_DEBUG
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+#endif
+
+    /* if there is another module already loaded */
+    if (swig_module.next != &swig_module) {
+      type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
+    }
+    if (type) {
+      /* Overwrite clientdata field */
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found type %s\n", type->name);
+#endif
+      if (swig_module.type_initial[i]->clientdata) {
+	type->clientdata = swig_module.type_initial[i]->clientdata;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
+#endif
+      }
+    } else {
+      type = swig_module.type_initial[i];
+    }
+
+    /* Insert casting types */
+    cast = swig_module.cast_initial[i];
+    while (cast->type) {
+    
+      /* Don't need to add information already in the list */
+      ret = 0;
+#ifdef SWIGRUNTIME_DEBUG
+      printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
+#endif
+      if (swig_module.next != &swig_module) {
+        ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
+#ifdef SWIGRUNTIME_DEBUG
+	if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
+#endif
+      }
+      if (ret) {
+	if (type == swig_module.type_initial[i]) {
+#ifdef SWIGRUNTIME_DEBUG
+	  printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
+#endif
+	  cast->type = ret;
+	  ret = 0;
+	} else {
+	  /* Check for casting already in the list */
+	  swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
+#ifdef SWIGRUNTIME_DEBUG
+	  if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
+#endif
+	  if (!ocast) ret = 0;
+	}
+      }
+
+      if (!ret) {
+#ifdef SWIGRUNTIME_DEBUG
+	printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
+#endif
+        if (type->cast) {
+          type->cast->prev = cast;
+          cast->next = type->cast;
+        }
+        type->cast = cast;
+      }
+      cast++;
+    }
+    /* Set entry in modules->types array equal to the type */
+    swig_module.types[i] = type;
+  }
+  swig_module.types[i] = 0;
+
+#ifdef SWIGRUNTIME_DEBUG
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+  for (i = 0; i < swig_module.size; ++i) {
+    int j = 0;
+    swig_cast_info *cast = swig_module.cast_initial[i];
+    printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name);
+    while (cast->type) {
+      printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
+      cast++;
+      ++j;
+    }
+  printf("---- Total casts: %d\n",j);
+  }
+  printf("**** SWIG_InitializeModule: Cast List ******\n");
+#endif
+}
+
+/* This function will propagate the clientdata field of type to
+* any new swig_type_info structures that have been added into the list
+* of equivalent types.  It is like calling
+* SWIG_TypeClientData(type, clientdata) a second time.
+*/
+SWIGRUNTIME void
+SWIG_PropagateClientData(void) {
+  size_t i;
+  swig_cast_info *equiv;
+  static int init_run = 0;
+
+  if (init_run) return;
+  init_run = 1;
+
+  for (i = 0; i < swig_module.size; i++) {
+    if (swig_module.types[i]->clientdata) {
+      equiv = swig_module.types[i]->cast;
+      while (equiv) {
+        if (!equiv->converter) {
+          if (equiv->type && !equiv->type->clientdata)
+            SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
+        }
+        equiv = equiv->next;
+      }
+    }
+  }
+}
+
+#ifdef __cplusplus
+#if 0
+{ /* c-mode */
+#endif
+}
+#endif
+
+/*
+
+*/
+#ifdef __cplusplus
+extern "C"
+#endif
+SWIGEXPORT void Init_CdiObj(void) {
+  size_t i;
+  
+  SWIG_InitRuntime();
+  mCdiObj = rb_define_module("CdiObj");
+  
+  SWIG_InitializeModule(0);
+  for (i = 0; i < swig_module.size; i++) {
+    SWIG_define_class(swig_module.types[i]);
+  }
+  
+  SWIG_RubyInitializeTrackings();
+  
+  SwigClassGC_VALUE.klass = rb_define_class_under(mCdiObj, "GC_VALUE", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_swig__GC_VALUE, (void *) &SwigClassGC_VALUE);
+  rb_undef_alloc_func(SwigClassGC_VALUE.klass);
+  rb_define_method(SwigClassGC_VALUE.klass, "inspect", VALUEFUNC(_wrap_GC_VALUE_inspect), -1);
+  rb_define_method(SwigClassGC_VALUE.klass, "to_s", VALUEFUNC(_wrap_GC_VALUE_to_s), -1);
+  SwigClassGC_VALUE.mark = 0;
+  SwigClassGC_VALUE.trackObjects = 0;
+  
+  swig::GC_VALUE::initialize();
+  
+  
+  SwigClassConstIterator.klass = rb_define_class_under(mCdiObj, "ConstIterator", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_swig__ConstIterator, (void *) &SwigClassConstIterator);
+  rb_undef_alloc_func(SwigClassConstIterator.klass);
+  rb_define_method(SwigClassConstIterator.klass, "value", VALUEFUNC(_wrap_ConstIterator_value), -1);
+  rb_define_method(SwigClassConstIterator.klass, "dup", VALUEFUNC(_wrap_ConstIterator_dup), -1);
+  rb_define_method(SwigClassConstIterator.klass, "inspect", VALUEFUNC(_wrap_ConstIterator_inspect), -1);
+  rb_define_method(SwigClassConstIterator.klass, "to_s", VALUEFUNC(_wrap_ConstIterator_to_s), -1);
+  rb_define_method(SwigClassConstIterator.klass, "next", VALUEFUNC(_wrap_ConstIterator_next), -1);
+  rb_define_method(SwigClassConstIterator.klass, "previous", VALUEFUNC(_wrap_ConstIterator_previous), -1);
+  rb_define_method(SwigClassConstIterator.klass, "==", VALUEFUNC(_wrap_ConstIterator___eq__), -1);
+  rb_define_method(SwigClassConstIterator.klass, "+", VALUEFUNC(_wrap_ConstIterator___add__), -1);
+  rb_define_method(SwigClassConstIterator.klass, "-", VALUEFUNC(_wrap_ConstIterator___sub__), -1);
+  SwigClassConstIterator.mark = 0;
+  SwigClassConstIterator.destroy = (void (*)(void *)) free_swig_ConstIterator;
+  SwigClassConstIterator.trackObjects = 0;
+  
+  SwigClassIterator.klass = rb_define_class_under(mCdiObj, "Iterator", ((swig_class *) SWIGTYPE_p_swig__ConstIterator->clientdata)->klass);
+  SWIG_TypeClientData(SWIGTYPE_p_swig__Iterator, (void *) &SwigClassIterator);
+  rb_undef_alloc_func(SwigClassIterator.klass);
+  rb_define_method(SwigClassIterator.klass, "value=", VALUEFUNC(_wrap_Iterator_valuee___), -1);
+  rb_define_method(SwigClassIterator.klass, "dup", VALUEFUNC(_wrap_Iterator_dup), -1);
+  rb_define_method(SwigClassIterator.klass, "next", VALUEFUNC(_wrap_Iterator_next), -1);
+  rb_define_method(SwigClassIterator.klass, "previous", VALUEFUNC(_wrap_Iterator_previous), -1);
+  rb_define_method(SwigClassIterator.klass, "inspect", VALUEFUNC(_wrap_Iterator_inspect), -1);
+  rb_define_method(SwigClassIterator.klass, "to_s", VALUEFUNC(_wrap_Iterator_to_s), -1);
+  rb_define_method(SwigClassIterator.klass, "==", VALUEFUNC(_wrap_Iterator___eq__), -1);
+  rb_define_method(SwigClassIterator.klass, "+", VALUEFUNC(_wrap_Iterator___add__), -1);
+  rb_define_method(SwigClassIterator.klass, "-", VALUEFUNC(_wrap_Iterator___sub__), -1);
+  SwigClassIterator.mark = 0;
+  SwigClassIterator.destroy = (void (*)(void *)) free_swig_Iterator;
+  SwigClassIterator.trackObjects = 0;
+  
+  SwigClassIntVector.klass = rb_define_class_under(mCdiObj, "IntVector", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_std__vectorT_int_std__allocatorT_int_t_t, (void *) &SwigClassIntVector);
+  rb_include_module(SwigClassIntVector.klass, rb_eval_string("Enumerable"));
+  rb_define_alloc_func(SwigClassIntVector.klass, _wrap_IntVector_allocate);
+  rb_define_method(SwigClassIntVector.klass, "initialize", VALUEFUNC(_wrap_new_IntVector), -1);
+  rb_define_method(SwigClassIntVector.klass, "dup", VALUEFUNC(_wrap_IntVector_dup), -1);
+  rb_define_method(SwigClassIntVector.klass, "inspect", VALUEFUNC(_wrap_IntVector_inspect), -1);
+  rb_define_method(SwigClassIntVector.klass, "to_a", VALUEFUNC(_wrap_IntVector_to_a), -1);
+  rb_define_method(SwigClassIntVector.klass, "to_s", VALUEFUNC(_wrap_IntVector_to_s), -1);
+  rb_define_method(SwigClassIntVector.klass, "slice", VALUEFUNC(_wrap_IntVector_slice), -1);
+  rb_define_method(SwigClassIntVector.klass, "each", VALUEFUNC(_wrap_IntVector_each), -1);
+  rb_define_method(SwigClassIntVector.klass, "select", VALUEFUNC(_wrap_IntVector_select), -1);
+  rb_define_method(SwigClassIntVector.klass, "reject!", VALUEFUNC(_wrap_IntVector_rejectN___), -1);
+  rb_define_alias(SwigClassIntVector.klass, "delete_if", "reject!");
+  rb_define_method(SwigClassIntVector.klass, "delete_at", VALUEFUNC(_wrap_IntVector_delete_at), -1);
+  rb_define_method(SwigClassIntVector.klass, "__delete2__", VALUEFUNC(_wrap_IntVector___delete2__), -1);
+  rb_define_method(SwigClassIntVector.klass, "pop", VALUEFUNC(_wrap_IntVector_pop), -1);
+  rb_define_method(SwigClassIntVector.klass, "push", VALUEFUNC(_wrap_IntVector_push), -1);
+  rb_define_alias(SwigClassIntVector.klass, "<<", "push");
+  rb_define_method(SwigClassIntVector.klass, "reject", VALUEFUNC(_wrap_IntVector_reject), -1);
+  rb_define_method(SwigClassIntVector.klass, "at", VALUEFUNC(_wrap_IntVector_at), -1);
+  rb_define_method(SwigClassIntVector.klass, "[]", VALUEFUNC(_wrap_IntVector___getitem__), -1);
+  rb_define_method(SwigClassIntVector.klass, "[]=", VALUEFUNC(_wrap_IntVector___setitem__), -1);
+  rb_define_method(SwigClassIntVector.klass, "shift", VALUEFUNC(_wrap_IntVector_shift), -1);
+  rb_define_method(SwigClassIntVector.klass, "unshift", VALUEFUNC(_wrap_IntVector_unshift), -1);
+  rb_define_method(SwigClassIntVector.klass, "empty?", VALUEFUNC(_wrap_IntVector_emptyq___), -1);
+  rb_define_method(SwigClassIntVector.klass, "size", VALUEFUNC(_wrap_IntVector_size), -1);
+  rb_define_method(SwigClassIntVector.klass, "clear", VALUEFUNC(_wrap_IntVector_clear), -1);
+  rb_define_method(SwigClassIntVector.klass, "swap", VALUEFUNC(_wrap_IntVector_swap), -1);
+  rb_define_method(SwigClassIntVector.klass, "get_allocator", VALUEFUNC(_wrap_IntVector_get_allocator), -1);
+  rb_define_method(SwigClassIntVector.klass, "begin", VALUEFUNC(_wrap_IntVector_begin), -1);
+  rb_define_method(SwigClassIntVector.klass, "end", VALUEFUNC(_wrap_IntVector_end), -1);
+  rb_define_method(SwigClassIntVector.klass, "rbegin", VALUEFUNC(_wrap_IntVector_rbegin), -1);
+  rb_define_method(SwigClassIntVector.klass, "rend", VALUEFUNC(_wrap_IntVector_rend), -1);
+  rb_define_method(SwigClassIntVector.klass, "erase", VALUEFUNC(_wrap_IntVector_erase), -1);
+  rb_define_method(SwigClassIntVector.klass, "front", VALUEFUNC(_wrap_IntVector_front), -1);
+  rb_define_method(SwigClassIntVector.klass, "back", VALUEFUNC(_wrap_IntVector_back), -1);
+  rb_define_method(SwigClassIntVector.klass, "assign", VALUEFUNC(_wrap_IntVector_assign), -1);
+  rb_define_method(SwigClassIntVector.klass, "resize", VALUEFUNC(_wrap_IntVector_resize), -1);
+  rb_define_method(SwigClassIntVector.klass, "insert", VALUEFUNC(_wrap_IntVector_insert), -1);
+  rb_define_method(SwigClassIntVector.klass, "reserve", VALUEFUNC(_wrap_IntVector_reserve), -1);
+  rb_define_method(SwigClassIntVector.klass, "capacity", VALUEFUNC(_wrap_IntVector_capacity), -1);
+  rb_define_method(SwigClassIntVector.klass, "map_bang", VALUEFUNC(_wrap_IntVector_map_bang), -1);
+  rb_define_method(SwigClassIntVector.klass, "__delete__", VALUEFUNC(_wrap_IntVector___delete__), -1);
+  SwigClassIntVector.mark = 0;
+  SwigClassIntVector.destroy = (void (*)(void *)) free_std_vector_Sl_int_Sg_;
+  SwigClassIntVector.trackObjects = 0;
+  
+  SwigClassDoubleVector.klass = rb_define_class_under(mCdiObj, "DoubleVector", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_std__vectorT_double_std__allocatorT_double_t_t, (void *) &SwigClassDoubleVector);
+  rb_include_module(SwigClassDoubleVector.klass, rb_eval_string("Enumerable"));
+  rb_define_alloc_func(SwigClassDoubleVector.klass, _wrap_DoubleVector_allocate);
+  rb_define_method(SwigClassDoubleVector.klass, "initialize", VALUEFUNC(_wrap_new_DoubleVector), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "dup", VALUEFUNC(_wrap_DoubleVector_dup), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "inspect", VALUEFUNC(_wrap_DoubleVector_inspect), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "to_a", VALUEFUNC(_wrap_DoubleVector_to_a), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "to_s", VALUEFUNC(_wrap_DoubleVector_to_s), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "slice", VALUEFUNC(_wrap_DoubleVector_slice), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "each", VALUEFUNC(_wrap_DoubleVector_each), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "select", VALUEFUNC(_wrap_DoubleVector_select), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "reject!", VALUEFUNC(_wrap_DoubleVector_rejectN___), -1);
+  rb_define_alias(SwigClassDoubleVector.klass, "delete_if", "reject!");
+  rb_define_method(SwigClassDoubleVector.klass, "delete_at", VALUEFUNC(_wrap_DoubleVector_delete_at), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "__delete2__", VALUEFUNC(_wrap_DoubleVector___delete2__), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "pop", VALUEFUNC(_wrap_DoubleVector_pop), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "push", VALUEFUNC(_wrap_DoubleVector_push), -1);
+  rb_define_alias(SwigClassDoubleVector.klass, "<<", "push");
+  rb_define_method(SwigClassDoubleVector.klass, "reject", VALUEFUNC(_wrap_DoubleVector_reject), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "at", VALUEFUNC(_wrap_DoubleVector_at), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "[]", VALUEFUNC(_wrap_DoubleVector___getitem__), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "[]=", VALUEFUNC(_wrap_DoubleVector___setitem__), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "shift", VALUEFUNC(_wrap_DoubleVector_shift), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "unshift", VALUEFUNC(_wrap_DoubleVector_unshift), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "empty?", VALUEFUNC(_wrap_DoubleVector_emptyq___), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "size", VALUEFUNC(_wrap_DoubleVector_size), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "clear", VALUEFUNC(_wrap_DoubleVector_clear), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "swap", VALUEFUNC(_wrap_DoubleVector_swap), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "get_allocator", VALUEFUNC(_wrap_DoubleVector_get_allocator), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "begin", VALUEFUNC(_wrap_DoubleVector_begin), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "end", VALUEFUNC(_wrap_DoubleVector_end), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "rbegin", VALUEFUNC(_wrap_DoubleVector_rbegin), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "rend", VALUEFUNC(_wrap_DoubleVector_rend), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "erase", VALUEFUNC(_wrap_DoubleVector_erase), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "front", VALUEFUNC(_wrap_DoubleVector_front), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "back", VALUEFUNC(_wrap_DoubleVector_back), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "assign", VALUEFUNC(_wrap_DoubleVector_assign), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "resize", VALUEFUNC(_wrap_DoubleVector_resize), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "insert", VALUEFUNC(_wrap_DoubleVector_insert), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "reserve", VALUEFUNC(_wrap_DoubleVector_reserve), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "capacity", VALUEFUNC(_wrap_DoubleVector_capacity), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "map_bang", VALUEFUNC(_wrap_DoubleVector_map_bang), -1);
+  rb_define_method(SwigClassDoubleVector.klass, "__delete__", VALUEFUNC(_wrap_DoubleVector___delete__), -1);
+  SwigClassDoubleVector.mark = 0;
+  SwigClassDoubleVector.destroy = (void (*)(void *)) free_std_vector_Sl_double_Sg_;
+  SwigClassDoubleVector.trackObjects = 0;
+  
+  SwigClassDoubleDoubleVector.klass = rb_define_class_under(mCdiObj, "DoubleDoubleVector", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_std__vectorT_std__vectorT_double_std__allocatorT_double_t_t_std__allocatorT_std__vectorT_double_std__allocatorT_double_t_t_t_t, (void *) &SwigClassDoubleDoubleVector);
+  rb_include_module(SwigClassDoubleDoubleVector.klass, rb_eval_string("Enumerable"));
+  rb_define_alloc_func(SwigClassDoubleDoubleVector.klass, _wrap_DoubleDoubleVector_allocate);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "initialize", VALUEFUNC(_wrap_new_DoubleDoubleVector), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "dup", VALUEFUNC(_wrap_DoubleDoubleVector_dup), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "inspect", VALUEFUNC(_wrap_DoubleDoubleVector_inspect), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "to_a", VALUEFUNC(_wrap_DoubleDoubleVector_to_a), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "to_s", VALUEFUNC(_wrap_DoubleDoubleVector_to_s), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "slice", VALUEFUNC(_wrap_DoubleDoubleVector_slice), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "each", VALUEFUNC(_wrap_DoubleDoubleVector_each), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "select", VALUEFUNC(_wrap_DoubleDoubleVector_select), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "reject!", VALUEFUNC(_wrap_DoubleDoubleVector_rejectN___), -1);
+  rb_define_alias(SwigClassDoubleDoubleVector.klass, "delete_if", "reject!");
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "delete_at", VALUEFUNC(_wrap_DoubleDoubleVector_delete_at), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "__delete2__", VALUEFUNC(_wrap_DoubleDoubleVector___delete2__), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "pop", VALUEFUNC(_wrap_DoubleDoubleVector_pop), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "push", VALUEFUNC(_wrap_DoubleDoubleVector_push), -1);
+  rb_define_alias(SwigClassDoubleDoubleVector.klass, "<<", "push");
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "reject", VALUEFUNC(_wrap_DoubleDoubleVector_reject), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "at", VALUEFUNC(_wrap_DoubleDoubleVector_at), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "[]", VALUEFUNC(_wrap_DoubleDoubleVector___getitem__), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "[]=", VALUEFUNC(_wrap_DoubleDoubleVector___setitem__), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "shift", VALUEFUNC(_wrap_DoubleDoubleVector_shift), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "unshift", VALUEFUNC(_wrap_DoubleDoubleVector_unshift), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "empty?", VALUEFUNC(_wrap_DoubleDoubleVector_emptyq___), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "size", VALUEFUNC(_wrap_DoubleDoubleVector_size), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "clear", VALUEFUNC(_wrap_DoubleDoubleVector_clear), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "swap", VALUEFUNC(_wrap_DoubleDoubleVector_swap), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "get_allocator", VALUEFUNC(_wrap_DoubleDoubleVector_get_allocator), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "begin", VALUEFUNC(_wrap_DoubleDoubleVector_begin), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "end", VALUEFUNC(_wrap_DoubleDoubleVector_end), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "rbegin", VALUEFUNC(_wrap_DoubleDoubleVector_rbegin), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "rend", VALUEFUNC(_wrap_DoubleDoubleVector_rend), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "erase", VALUEFUNC(_wrap_DoubleDoubleVector_erase), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "front", VALUEFUNC(_wrap_DoubleDoubleVector_front), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "back", VALUEFUNC(_wrap_DoubleDoubleVector_back), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "assign", VALUEFUNC(_wrap_DoubleDoubleVector_assign), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "resize", VALUEFUNC(_wrap_DoubleDoubleVector_resize), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "insert", VALUEFUNC(_wrap_DoubleDoubleVector_insert), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "reserve", VALUEFUNC(_wrap_DoubleDoubleVector_reserve), -1);
+  rb_define_method(SwigClassDoubleDoubleVector.klass, "capacity", VALUEFUNC(_wrap_DoubleDoubleVector_capacity), -1);
+  SwigClassDoubleDoubleVector.mark = 0;
+  SwigClassDoubleDoubleVector.destroy = (void (*)(void *)) free_std_vector_Sl_std_vector_Sl_double_Sg__Sg_;
+  SwigClassDoubleDoubleVector.trackObjects = 0;
+  
+  SwigClassStringVector.klass = rb_define_class_under(mCdiObj, "StringVector", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_std__vectorT_std__string_std__allocatorT_std__string_t_t, (void *) &SwigClassStringVector);
+  rb_include_module(SwigClassStringVector.klass, rb_eval_string("Enumerable"));
+  rb_define_alloc_func(SwigClassStringVector.klass, _wrap_StringVector_allocate);
+  rb_define_method(SwigClassStringVector.klass, "initialize", VALUEFUNC(_wrap_new_StringVector), -1);
+  rb_define_method(SwigClassStringVector.klass, "dup", VALUEFUNC(_wrap_StringVector_dup), -1);
+  rb_define_method(SwigClassStringVector.klass, "inspect", VALUEFUNC(_wrap_StringVector_inspect), -1);
+  rb_define_method(SwigClassStringVector.klass, "to_a", VALUEFUNC(_wrap_StringVector_to_a), -1);
+  rb_define_method(SwigClassStringVector.klass, "to_s", VALUEFUNC(_wrap_StringVector_to_s), -1);
+  rb_define_method(SwigClassStringVector.klass, "slice", VALUEFUNC(_wrap_StringVector_slice), -1);
+  rb_define_method(SwigClassStringVector.klass, "each", VALUEFUNC(_wrap_StringVector_each), -1);
+  rb_define_method(SwigClassStringVector.klass, "select", VALUEFUNC(_wrap_StringVector_select), -1);
+  rb_define_method(SwigClassStringVector.klass, "reject!", VALUEFUNC(_wrap_StringVector_rejectN___), -1);
+  rb_define_alias(SwigClassStringVector.klass, "delete_if", "reject!");
+  rb_define_method(SwigClassStringVector.klass, "delete_at", VALUEFUNC(_wrap_StringVector_delete_at), -1);
+  rb_define_method(SwigClassStringVector.klass, "__delete2__", VALUEFUNC(_wrap_StringVector___delete2__), -1);
+  rb_define_method(SwigClassStringVector.klass, "pop", VALUEFUNC(_wrap_StringVector_pop), -1);
+  rb_define_method(SwigClassStringVector.klass, "push", VALUEFUNC(_wrap_StringVector_push), -1);
+  rb_define_alias(SwigClassStringVector.klass, "<<", "push");
+  rb_define_method(SwigClassStringVector.klass, "reject", VALUEFUNC(_wrap_StringVector_reject), -1);
+  rb_define_method(SwigClassStringVector.klass, "at", VALUEFUNC(_wrap_StringVector_at), -1);
+  rb_define_method(SwigClassStringVector.klass, "[]", VALUEFUNC(_wrap_StringVector___getitem__), -1);
+  rb_define_method(SwigClassStringVector.klass, "[]=", VALUEFUNC(_wrap_StringVector___setitem__), -1);
+  rb_define_method(SwigClassStringVector.klass, "shift", VALUEFUNC(_wrap_StringVector_shift), -1);
+  rb_define_method(SwigClassStringVector.klass, "unshift", VALUEFUNC(_wrap_StringVector_unshift), -1);
+  rb_define_method(SwigClassStringVector.klass, "empty?", VALUEFUNC(_wrap_StringVector_emptyq___), -1);
+  rb_define_method(SwigClassStringVector.klass, "size", VALUEFUNC(_wrap_StringVector_size), -1);
+  rb_define_method(SwigClassStringVector.klass, "clear", VALUEFUNC(_wrap_StringVector_clear), -1);
+  rb_define_method(SwigClassStringVector.klass, "swap", VALUEFUNC(_wrap_StringVector_swap), -1);
+  rb_define_method(SwigClassStringVector.klass, "get_allocator", VALUEFUNC(_wrap_StringVector_get_allocator), -1);
+  rb_define_method(SwigClassStringVector.klass, "begin", VALUEFUNC(_wrap_StringVector_begin), -1);
+  rb_define_method(SwigClassStringVector.klass, "end", VALUEFUNC(_wrap_StringVector_end), -1);
+  rb_define_method(SwigClassStringVector.klass, "rbegin", VALUEFUNC(_wrap_StringVector_rbegin), -1);
+  rb_define_method(SwigClassStringVector.klass, "rend", VALUEFUNC(_wrap_StringVector_rend), -1);
+  rb_define_method(SwigClassStringVector.klass, "erase", VALUEFUNC(_wrap_StringVector_erase), -1);
+  rb_define_method(SwigClassStringVector.klass, "front", VALUEFUNC(_wrap_StringVector_front), -1);
+  rb_define_method(SwigClassStringVector.klass, "back", VALUEFUNC(_wrap_StringVector_back), -1);
+  rb_define_method(SwigClassStringVector.klass, "assign", VALUEFUNC(_wrap_StringVector_assign), -1);
+  rb_define_method(SwigClassStringVector.klass, "resize", VALUEFUNC(_wrap_StringVector_resize), -1);
+  rb_define_method(SwigClassStringVector.klass, "insert", VALUEFUNC(_wrap_StringVector_insert), -1);
+  rb_define_method(SwigClassStringVector.klass, "reserve", VALUEFUNC(_wrap_StringVector_reserve), -1);
+  rb_define_method(SwigClassStringVector.klass, "capacity", VALUEFUNC(_wrap_StringVector_capacity), -1);
+  rb_define_method(SwigClassStringVector.klass, "map_bang", VALUEFUNC(_wrap_StringVector_map_bang), -1);
+  rb_define_method(SwigClassStringVector.klass, "__delete__", VALUEFUNC(_wrap_StringVector___delete__), -1);
+  SwigClassStringVector.mark = 0;
+  SwigClassStringVector.destroy = (void (*)(void *)) free_std_vector_Sl_std_string_Sg_;
+  SwigClassStringVector.trackObjects = 0;
+  
+  SwigClassVarsVector.klass = rb_define_class_under(mCdiObj, "VarsVector", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_std__vectorT_CdiVariable_std__allocatorT_CdiVariable_t_t, (void *) &SwigClassVarsVector);
+  rb_include_module(SwigClassVarsVector.klass, rb_eval_string("Enumerable"));
+  rb_define_alloc_func(SwigClassVarsVector.klass, _wrap_VarsVector_allocate);
+  rb_define_method(SwigClassVarsVector.klass, "initialize", VALUEFUNC(_wrap_new_VarsVector), -1);
+  rb_define_method(SwigClassVarsVector.klass, "dup", VALUEFUNC(_wrap_VarsVector_dup), -1);
+  rb_define_method(SwigClassVarsVector.klass, "inspect", VALUEFUNC(_wrap_VarsVector_inspect), -1);
+  rb_define_method(SwigClassVarsVector.klass, "to_a", VALUEFUNC(_wrap_VarsVector_to_a), -1);
+  rb_define_method(SwigClassVarsVector.klass, "to_s", VALUEFUNC(_wrap_VarsVector_to_s), -1);
+  rb_define_method(SwigClassVarsVector.klass, "slice", VALUEFUNC(_wrap_VarsVector_slice), -1);
+  rb_define_method(SwigClassVarsVector.klass, "each", VALUEFUNC(_wrap_VarsVector_each), -1);
+  rb_define_method(SwigClassVarsVector.klass, "select", VALUEFUNC(_wrap_VarsVector_select), -1);
+  rb_define_method(SwigClassVarsVector.klass, "reject!", VALUEFUNC(_wrap_VarsVector_rejectN___), -1);
+  rb_define_alias(SwigClassVarsVector.klass, "delete_if", "reject!");
+  rb_define_method(SwigClassVarsVector.klass, "delete_at", VALUEFUNC(_wrap_VarsVector_delete_at), -1);
+  rb_define_method(SwigClassVarsVector.klass, "__delete2__", VALUEFUNC(_wrap_VarsVector___delete2__), -1);
+  rb_define_method(SwigClassVarsVector.klass, "pop", VALUEFUNC(_wrap_VarsVector_pop), -1);
+  rb_define_method(SwigClassVarsVector.klass, "push", VALUEFUNC(_wrap_VarsVector_push), -1);
+  rb_define_alias(SwigClassVarsVector.klass, "<<", "push");
+  rb_define_method(SwigClassVarsVector.klass, "reject", VALUEFUNC(_wrap_VarsVector_reject), -1);
+  rb_define_method(SwigClassVarsVector.klass, "at", VALUEFUNC(_wrap_VarsVector_at), -1);
+  rb_define_method(SwigClassVarsVector.klass, "[]", VALUEFUNC(_wrap_VarsVector___getitem__), -1);
+  rb_define_method(SwigClassVarsVector.klass, "[]=", VALUEFUNC(_wrap_VarsVector___setitem__), -1);
+  rb_define_method(SwigClassVarsVector.klass, "shift", VALUEFUNC(_wrap_VarsVector_shift), -1);
+  rb_define_method(SwigClassVarsVector.klass, "unshift", VALUEFUNC(_wrap_VarsVector_unshift), -1);
+  rb_define_method(SwigClassVarsVector.klass, "empty?", VALUEFUNC(_wrap_VarsVector_emptyq___), -1);
+  rb_define_method(SwigClassVarsVector.klass, "size", VALUEFUNC(_wrap_VarsVector_size), -1);
+  rb_define_method(SwigClassVarsVector.klass, "clear", VALUEFUNC(_wrap_VarsVector_clear), -1);
+  rb_define_method(SwigClassVarsVector.klass, "swap", VALUEFUNC(_wrap_VarsVector_swap), -1);
+  rb_define_method(SwigClassVarsVector.klass, "get_allocator", VALUEFUNC(_wrap_VarsVector_get_allocator), -1);
+  rb_define_method(SwigClassVarsVector.klass, "begin", VALUEFUNC(_wrap_VarsVector_begin), -1);
+  rb_define_method(SwigClassVarsVector.klass, "end", VALUEFUNC(_wrap_VarsVector_end), -1);
+  rb_define_method(SwigClassVarsVector.klass, "rbegin", VALUEFUNC(_wrap_VarsVector_rbegin), -1);
+  rb_define_method(SwigClassVarsVector.klass, "rend", VALUEFUNC(_wrap_VarsVector_rend), -1);
+  rb_define_method(SwigClassVarsVector.klass, "erase", VALUEFUNC(_wrap_VarsVector_erase), -1);
+  rb_define_method(SwigClassVarsVector.klass, "front", VALUEFUNC(_wrap_VarsVector_front), -1);
+  rb_define_method(SwigClassVarsVector.klass, "back", VALUEFUNC(_wrap_VarsVector_back), -1);
+  rb_define_method(SwigClassVarsVector.klass, "assign", VALUEFUNC(_wrap_VarsVector_assign), -1);
+  rb_define_method(SwigClassVarsVector.klass, "resize", VALUEFUNC(_wrap_VarsVector_resize), -1);
+  rb_define_method(SwigClassVarsVector.klass, "insert", VALUEFUNC(_wrap_VarsVector_insert), -1);
+  rb_define_method(SwigClassVarsVector.klass, "reserve", VALUEFUNC(_wrap_VarsVector_reserve), -1);
+  rb_define_method(SwigClassVarsVector.klass, "capacity", VALUEFUNC(_wrap_VarsVector_capacity), -1);
+  SwigClassVarsVector.mark = 0;
+  SwigClassVarsVector.destroy = (void (*)(void *)) free_std_vector_Sl_CdiVariable_Sg_;
+  SwigClassVarsVector.trackObjects = 0;
+  
+  SwigClassVarsMap.klass = rb_define_class_under(mCdiObj, "VarsMap", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_std__mapT_std__string_CdiVariable_std__lessT_std__string_t_std__allocatorT_std__pairT_std__string_const_CdiVariable_t_t_t, (void *) &SwigClassVarsMap);
+  rb_include_module(SwigClassVarsMap.klass, rb_eval_string("Enumerable"));
+  rb_define_alloc_func(SwigClassVarsMap.klass, _wrap_VarsMap_allocate);
+  rb_define_method(SwigClassVarsMap.klass, "initialize", VALUEFUNC(_wrap_new_VarsMap), -1);
+  rb_define_method(SwigClassVarsMap.klass, "dup", VALUEFUNC(_wrap_VarsMap_dup), -1);
+  rb_define_method(SwigClassVarsMap.klass, "delete", VALUEFUNC(_wrap_VarsMap_delete), -1);
+  rb_define_method(SwigClassVarsMap.klass, "has_key?", VALUEFUNC(_wrap_VarsMap_has_keyq___), -1);
+  rb_define_method(SwigClassVarsMap.klass, "keys", VALUEFUNC(_wrap_VarsMap_keys), -1);
+  rb_define_method(SwigClassVarsMap.klass, "each", VALUEFUNC(_wrap_VarsMap_each), -1);
+  rb_define_method(SwigClassVarsMap.klass, "select", VALUEFUNC(_wrap_VarsMap_select), -1);
+  rb_define_method(SwigClassVarsMap.klass, "values_at", VALUEFUNC(_wrap_VarsMap_values_at), -1);
+  rb_define_method(SwigClassVarsMap.klass, "each_key", VALUEFUNC(_wrap_VarsMap_each_key), -1);
+  rb_define_method(SwigClassVarsMap.klass, "values", VALUEFUNC(_wrap_VarsMap_values), -1);
+  rb_define_method(SwigClassVarsMap.klass, "each_value", VALUEFUNC(_wrap_VarsMap_each_value), -1);
+  rb_define_method(SwigClassVarsMap.klass, "entries", VALUEFUNC(_wrap_VarsMap_entries), -1);
+  rb_define_method(SwigClassVarsMap.klass, "include?", VALUEFUNC(_wrap_VarsMap_includeq___), -1);
+  rb_define_method(SwigClassVarsMap.klass, "key_iterator", VALUEFUNC(_wrap_VarsMap_key_iterator), -1);
+  rb_define_method(SwigClassVarsMap.klass, "value_iterator", VALUEFUNC(_wrap_VarsMap_value_iterator), -1);
+  rb_define_method(SwigClassVarsMap.klass, "[]", VALUEFUNC(_wrap_VarsMap___getitem__), -1);
+  rb_define_method(SwigClassVarsMap.klass, "[]=", VALUEFUNC(_wrap_VarsMap___setitem__), -1);
+  rb_define_method(SwigClassVarsMap.klass, "inspect", VALUEFUNC(_wrap_VarsMap_inspect), -1);
+  rb_define_method(SwigClassVarsMap.klass, "to_a", VALUEFUNC(_wrap_VarsMap_to_a), -1);
+  rb_define_method(SwigClassVarsMap.klass, "to_s", VALUEFUNC(_wrap_VarsMap_to_s), -1);
+  rb_define_method(SwigClassVarsMap.klass, "empty?", VALUEFUNC(_wrap_VarsMap_emptyq___), -1);
+  rb_define_method(SwigClassVarsMap.klass, "size", VALUEFUNC(_wrap_VarsMap_size), -1);
+  rb_define_method(SwigClassVarsMap.klass, "clear", VALUEFUNC(_wrap_VarsMap_clear), -1);
+  rb_define_method(SwigClassVarsMap.klass, "swap", VALUEFUNC(_wrap_VarsMap_swap), -1);
+  rb_define_method(SwigClassVarsMap.klass, "get_allocator", VALUEFUNC(_wrap_VarsMap_get_allocator), -1);
+  rb_define_method(SwigClassVarsMap.klass, "begin", VALUEFUNC(_wrap_VarsMap_begin), -1);
+  rb_define_method(SwigClassVarsMap.klass, "end", VALUEFUNC(_wrap_VarsMap_end), -1);
+  rb_define_method(SwigClassVarsMap.klass, "rbegin", VALUEFUNC(_wrap_VarsMap_rbegin), -1);
+  rb_define_method(SwigClassVarsMap.klass, "rend", VALUEFUNC(_wrap_VarsMap_rend), -1);
+  rb_define_method(SwigClassVarsMap.klass, "count", VALUEFUNC(_wrap_VarsMap_count), -1);
+  rb_define_method(SwigClassVarsMap.klass, "erase", VALUEFUNC(_wrap_VarsMap_erase), -1);
+  rb_define_method(SwigClassVarsMap.klass, "find", VALUEFUNC(_wrap_VarsMap_find), -1);
+  rb_define_method(SwigClassVarsMap.klass, "lower_bound", VALUEFUNC(_wrap_VarsMap_lower_bound), -1);
+  rb_define_method(SwigClassVarsMap.klass, "upper_bound", VALUEFUNC(_wrap_VarsMap_upper_bound), -1);
+  SwigClassVarsMap.mark = 0;
+  SwigClassVarsMap.destroy = (void (*)(void *)) free_std_map_Sl_std_string_Sc_CdiVariable_Sg_;
+  SwigClassVarsMap.trackObjects = 0;
+  
+  SwigClassVarsByCode.klass = rb_define_class_under(mCdiObj, "VarsByCode", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_std__mapT_int_CdiVariable_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiVariable_t_t_t, (void *) &SwigClassVarsByCode);
+  rb_include_module(SwigClassVarsByCode.klass, rb_eval_string("Enumerable"));
+  rb_define_alloc_func(SwigClassVarsByCode.klass, _wrap_VarsByCode_allocate);
+  rb_define_method(SwigClassVarsByCode.klass, "initialize", VALUEFUNC(_wrap_new_VarsByCode), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "dup", VALUEFUNC(_wrap_VarsByCode_dup), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "delete", VALUEFUNC(_wrap_VarsByCode_delete), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "has_key?", VALUEFUNC(_wrap_VarsByCode_has_keyq___), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "keys", VALUEFUNC(_wrap_VarsByCode_keys), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "each", VALUEFUNC(_wrap_VarsByCode_each), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "select", VALUEFUNC(_wrap_VarsByCode_select), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "values_at", VALUEFUNC(_wrap_VarsByCode_values_at), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "each_key", VALUEFUNC(_wrap_VarsByCode_each_key), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "values", VALUEFUNC(_wrap_VarsByCode_values), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "each_value", VALUEFUNC(_wrap_VarsByCode_each_value), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "entries", VALUEFUNC(_wrap_VarsByCode_entries), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "include?", VALUEFUNC(_wrap_VarsByCode_includeq___), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "key_iterator", VALUEFUNC(_wrap_VarsByCode_key_iterator), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "value_iterator", VALUEFUNC(_wrap_VarsByCode_value_iterator), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "[]", VALUEFUNC(_wrap_VarsByCode___getitem__), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "[]=", VALUEFUNC(_wrap_VarsByCode___setitem__), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "inspect", VALUEFUNC(_wrap_VarsByCode_inspect), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "to_a", VALUEFUNC(_wrap_VarsByCode_to_a), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "to_s", VALUEFUNC(_wrap_VarsByCode_to_s), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "empty?", VALUEFUNC(_wrap_VarsByCode_emptyq___), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "size", VALUEFUNC(_wrap_VarsByCode_size), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "clear", VALUEFUNC(_wrap_VarsByCode_clear), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "swap", VALUEFUNC(_wrap_VarsByCode_swap), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "get_allocator", VALUEFUNC(_wrap_VarsByCode_get_allocator), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "begin", VALUEFUNC(_wrap_VarsByCode_begin), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "end", VALUEFUNC(_wrap_VarsByCode_end), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "rbegin", VALUEFUNC(_wrap_VarsByCode_rbegin), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "rend", VALUEFUNC(_wrap_VarsByCode_rend), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "count", VALUEFUNC(_wrap_VarsByCode_count), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "erase", VALUEFUNC(_wrap_VarsByCode_erase), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "find", VALUEFUNC(_wrap_VarsByCode_find), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "lower_bound", VALUEFUNC(_wrap_VarsByCode_lower_bound), -1);
+  rb_define_method(SwigClassVarsByCode.klass, "upper_bound", VALUEFUNC(_wrap_VarsByCode_upper_bound), -1);
+  SwigClassVarsByCode.mark = 0;
+  SwigClassVarsByCode.destroy = (void (*)(void *)) free_std_map_Sl_int_Sc_CdiVariable_Sg_;
+  SwigClassVarsByCode.trackObjects = 0;
+  
+  SwigClassTaxesMap.klass = rb_define_class_under(mCdiObj, "TaxesMap", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_std__mapT_int_CdiTaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiTaxis_t_t_t, (void *) &SwigClassTaxesMap);
+  rb_include_module(SwigClassTaxesMap.klass, rb_eval_string("Enumerable"));
+  rb_define_alloc_func(SwigClassTaxesMap.klass, _wrap_TaxesMap_allocate);
+  rb_define_method(SwigClassTaxesMap.klass, "initialize", VALUEFUNC(_wrap_new_TaxesMap), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "dup", VALUEFUNC(_wrap_TaxesMap_dup), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "delete", VALUEFUNC(_wrap_TaxesMap_delete), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "has_key?", VALUEFUNC(_wrap_TaxesMap_has_keyq___), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "keys", VALUEFUNC(_wrap_TaxesMap_keys), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "each", VALUEFUNC(_wrap_TaxesMap_each), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "select", VALUEFUNC(_wrap_TaxesMap_select), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "values_at", VALUEFUNC(_wrap_TaxesMap_values_at), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "each_key", VALUEFUNC(_wrap_TaxesMap_each_key), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "values", VALUEFUNC(_wrap_TaxesMap_values), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "each_value", VALUEFUNC(_wrap_TaxesMap_each_value), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "entries", VALUEFUNC(_wrap_TaxesMap_entries), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "include?", VALUEFUNC(_wrap_TaxesMap_includeq___), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "key_iterator", VALUEFUNC(_wrap_TaxesMap_key_iterator), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "value_iterator", VALUEFUNC(_wrap_TaxesMap_value_iterator), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "[]", VALUEFUNC(_wrap_TaxesMap___getitem__), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "[]=", VALUEFUNC(_wrap_TaxesMap___setitem__), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "inspect", VALUEFUNC(_wrap_TaxesMap_inspect), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "to_a", VALUEFUNC(_wrap_TaxesMap_to_a), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "to_s", VALUEFUNC(_wrap_TaxesMap_to_s), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "empty?", VALUEFUNC(_wrap_TaxesMap_emptyq___), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "size", VALUEFUNC(_wrap_TaxesMap_size), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "clear", VALUEFUNC(_wrap_TaxesMap_clear), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "swap", VALUEFUNC(_wrap_TaxesMap_swap), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "get_allocator", VALUEFUNC(_wrap_TaxesMap_get_allocator), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "begin", VALUEFUNC(_wrap_TaxesMap_begin), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "end", VALUEFUNC(_wrap_TaxesMap_end), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "rbegin", VALUEFUNC(_wrap_TaxesMap_rbegin), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "rend", VALUEFUNC(_wrap_TaxesMap_rend), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "count", VALUEFUNC(_wrap_TaxesMap_count), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "erase", VALUEFUNC(_wrap_TaxesMap_erase), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "find", VALUEFUNC(_wrap_TaxesMap_find), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "lower_bound", VALUEFUNC(_wrap_TaxesMap_lower_bound), -1);
+  rb_define_method(SwigClassTaxesMap.klass, "upper_bound", VALUEFUNC(_wrap_TaxesMap_upper_bound), -1);
+  SwigClassTaxesMap.mark = 0;
+  SwigClassTaxesMap.destroy = (void (*)(void *)) free_std_map_Sl_int_Sc_CdiTaxis_Sg_;
+  SwigClassTaxesMap.trackObjects = 0;
+  
+  SwigClassZaxesMap.klass = rb_define_class_under(mCdiObj, "ZaxesMap", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_std__mapT_int_CdiZaxis_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiZaxis_t_t_t, (void *) &SwigClassZaxesMap);
+  rb_include_module(SwigClassZaxesMap.klass, rb_eval_string("Enumerable"));
+  rb_define_alloc_func(SwigClassZaxesMap.klass, _wrap_ZaxesMap_allocate);
+  rb_define_method(SwigClassZaxesMap.klass, "initialize", VALUEFUNC(_wrap_new_ZaxesMap), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "dup", VALUEFUNC(_wrap_ZaxesMap_dup), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "delete", VALUEFUNC(_wrap_ZaxesMap_delete), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "has_key?", VALUEFUNC(_wrap_ZaxesMap_has_keyq___), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "keys", VALUEFUNC(_wrap_ZaxesMap_keys), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "each", VALUEFUNC(_wrap_ZaxesMap_each), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "select", VALUEFUNC(_wrap_ZaxesMap_select), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "values_at", VALUEFUNC(_wrap_ZaxesMap_values_at), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "each_key", VALUEFUNC(_wrap_ZaxesMap_each_key), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "values", VALUEFUNC(_wrap_ZaxesMap_values), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "each_value", VALUEFUNC(_wrap_ZaxesMap_each_value), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "entries", VALUEFUNC(_wrap_ZaxesMap_entries), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "include?", VALUEFUNC(_wrap_ZaxesMap_includeq___), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "key_iterator", VALUEFUNC(_wrap_ZaxesMap_key_iterator), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "value_iterator", VALUEFUNC(_wrap_ZaxesMap_value_iterator), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "[]", VALUEFUNC(_wrap_ZaxesMap___getitem__), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "[]=", VALUEFUNC(_wrap_ZaxesMap___setitem__), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "inspect", VALUEFUNC(_wrap_ZaxesMap_inspect), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "to_a", VALUEFUNC(_wrap_ZaxesMap_to_a), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "to_s", VALUEFUNC(_wrap_ZaxesMap_to_s), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "empty?", VALUEFUNC(_wrap_ZaxesMap_emptyq___), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "size", VALUEFUNC(_wrap_ZaxesMap_size), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "clear", VALUEFUNC(_wrap_ZaxesMap_clear), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "swap", VALUEFUNC(_wrap_ZaxesMap_swap), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "get_allocator", VALUEFUNC(_wrap_ZaxesMap_get_allocator), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "begin", VALUEFUNC(_wrap_ZaxesMap_begin), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "end", VALUEFUNC(_wrap_ZaxesMap_end), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "rbegin", VALUEFUNC(_wrap_ZaxesMap_rbegin), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "rend", VALUEFUNC(_wrap_ZaxesMap_rend), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "count", VALUEFUNC(_wrap_ZaxesMap_count), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "erase", VALUEFUNC(_wrap_ZaxesMap_erase), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "find", VALUEFUNC(_wrap_ZaxesMap_find), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "lower_bound", VALUEFUNC(_wrap_ZaxesMap_lower_bound), -1);
+  rb_define_method(SwigClassZaxesMap.klass, "upper_bound", VALUEFUNC(_wrap_ZaxesMap_upper_bound), -1);
+  SwigClassZaxesMap.mark = 0;
+  SwigClassZaxesMap.destroy = (void (*)(void *)) free_std_map_Sl_int_Sc_CdiZaxis_Sg_;
+  SwigClassZaxesMap.trackObjects = 0;
+  
+  SwigClassGridsMap.klass = rb_define_class_under(mCdiObj, "GridsMap", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_std__mapT_int_CdiGrid_std__lessT_int_t_std__allocatorT_std__pairT_int_const_CdiGrid_t_t_t, (void *) &SwigClassGridsMap);
+  rb_include_module(SwigClassGridsMap.klass, rb_eval_string("Enumerable"));
+  rb_define_alloc_func(SwigClassGridsMap.klass, _wrap_GridsMap_allocate);
+  rb_define_method(SwigClassGridsMap.klass, "initialize", VALUEFUNC(_wrap_new_GridsMap), -1);
+  rb_define_method(SwigClassGridsMap.klass, "dup", VALUEFUNC(_wrap_GridsMap_dup), -1);
+  rb_define_method(SwigClassGridsMap.klass, "delete", VALUEFUNC(_wrap_GridsMap_delete), -1);
+  rb_define_method(SwigClassGridsMap.klass, "has_key?", VALUEFUNC(_wrap_GridsMap_has_keyq___), -1);
+  rb_define_method(SwigClassGridsMap.klass, "keys", VALUEFUNC(_wrap_GridsMap_keys), -1);
+  rb_define_method(SwigClassGridsMap.klass, "each", VALUEFUNC(_wrap_GridsMap_each), -1);
+  rb_define_method(SwigClassGridsMap.klass, "select", VALUEFUNC(_wrap_GridsMap_select), -1);
+  rb_define_method(SwigClassGridsMap.klass, "values_at", VALUEFUNC(_wrap_GridsMap_values_at), -1);
+  rb_define_method(SwigClassGridsMap.klass, "each_key", VALUEFUNC(_wrap_GridsMap_each_key), -1);
+  rb_define_method(SwigClassGridsMap.klass, "values", VALUEFUNC(_wrap_GridsMap_values), -1);
+  rb_define_method(SwigClassGridsMap.klass, "each_value", VALUEFUNC(_wrap_GridsMap_each_value), -1);
+  rb_define_method(SwigClassGridsMap.klass, "entries", VALUEFUNC(_wrap_GridsMap_entries), -1);
+  rb_define_method(SwigClassGridsMap.klass, "include?", VALUEFUNC(_wrap_GridsMap_includeq___), -1);
+  rb_define_method(SwigClassGridsMap.klass, "key_iterator", VALUEFUNC(_wrap_GridsMap_key_iterator), -1);
+  rb_define_method(SwigClassGridsMap.klass, "value_iterator", VALUEFUNC(_wrap_GridsMap_value_iterator), -1);
+  rb_define_method(SwigClassGridsMap.klass, "[]", VALUEFUNC(_wrap_GridsMap___getitem__), -1);
+  rb_define_method(SwigClassGridsMap.klass, "[]=", VALUEFUNC(_wrap_GridsMap___setitem__), -1);
+  rb_define_method(SwigClassGridsMap.klass, "inspect", VALUEFUNC(_wrap_GridsMap_inspect), -1);
+  rb_define_method(SwigClassGridsMap.klass, "to_a", VALUEFUNC(_wrap_GridsMap_to_a), -1);
+  rb_define_method(SwigClassGridsMap.klass, "to_s", VALUEFUNC(_wrap_GridsMap_to_s), -1);
+  rb_define_method(SwigClassGridsMap.klass, "empty?", VALUEFUNC(_wrap_GridsMap_emptyq___), -1);
+  rb_define_method(SwigClassGridsMap.klass, "size", VALUEFUNC(_wrap_GridsMap_size), -1);
+  rb_define_method(SwigClassGridsMap.klass, "clear", VALUEFUNC(_wrap_GridsMap_clear), -1);
+  rb_define_method(SwigClassGridsMap.klass, "swap", VALUEFUNC(_wrap_GridsMap_swap), -1);
+  rb_define_method(SwigClassGridsMap.klass, "get_allocator", VALUEFUNC(_wrap_GridsMap_get_allocator), -1);
+  rb_define_method(SwigClassGridsMap.klass, "begin", VALUEFUNC(_wrap_GridsMap_begin), -1);
+  rb_define_method(SwigClassGridsMap.klass, "end", VALUEFUNC(_wrap_GridsMap_end), -1);
+  rb_define_method(SwigClassGridsMap.klass, "rbegin", VALUEFUNC(_wrap_GridsMap_rbegin), -1);
+  rb_define_method(SwigClassGridsMap.klass, "rend", VALUEFUNC(_wrap_GridsMap_rend), -1);
+  rb_define_method(SwigClassGridsMap.klass, "count", VALUEFUNC(_wrap_GridsMap_count), -1);
+  rb_define_method(SwigClassGridsMap.klass, "erase", VALUEFUNC(_wrap_GridsMap_erase), -1);
+  rb_define_method(SwigClassGridsMap.klass, "find", VALUEFUNC(_wrap_GridsMap_find), -1);
+  rb_define_method(SwigClassGridsMap.klass, "lower_bound", VALUEFUNC(_wrap_GridsMap_lower_bound), -1);
+  rb_define_method(SwigClassGridsMap.klass, "upper_bound", VALUEFUNC(_wrap_GridsMap_upper_bound), -1);
+  SwigClassGridsMap.mark = 0;
+  SwigClassGridsMap.destroy = (void (*)(void *)) free_std_map_Sl_int_Sc_CdiGrid_Sg_;
+  SwigClassGridsMap.trackObjects = 0;
+  rb_define_const(mCdiObj, "CHARSIZE", SWIG_From_int(static_cast< int >(128)));
+  
+  SwigClassCdiGrid.klass = rb_define_class_under(mCdiObj, "CdiGrid", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_CdiGrid, (void *) &SwigClassCdiGrid);
+  rb_define_alloc_func(SwigClassCdiGrid.klass, _wrap_CdiGrid_allocate);
+  rb_define_method(SwigClassCdiGrid.klass, "initialize", VALUEFUNC(_wrap_new_CdiGrid), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "gridID=", VALUEFUNC(_wrap_CdiGrid_gridID_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "gridID", VALUEFUNC(_wrap_CdiGrid_gridID_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "type=", VALUEFUNC(_wrap_CdiGrid_type_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "type", VALUEFUNC(_wrap_CdiGrid_type_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "size=", VALUEFUNC(_wrap_CdiGrid_size_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "size", VALUEFUNC(_wrap_CdiGrid_size_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xsize=", VALUEFUNC(_wrap_CdiGrid_xsize_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xsize", VALUEFUNC(_wrap_CdiGrid_xsize_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "ysize=", VALUEFUNC(_wrap_CdiGrid_ysize_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "ysize", VALUEFUNC(_wrap_CdiGrid_ysize_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "prec=", VALUEFUNC(_wrap_CdiGrid_prec_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "prec", VALUEFUNC(_wrap_CdiGrid_prec_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "ncorner=", VALUEFUNC(_wrap_CdiGrid_ncorner_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "ncorner", VALUEFUNC(_wrap_CdiGrid_ncorner_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "hasXValues=", VALUEFUNC(_wrap_CdiGrid_hasXValues_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "hasXValues", VALUEFUNC(_wrap_CdiGrid_hasXValues_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "hasYValues=", VALUEFUNC(_wrap_CdiGrid_hasYValues_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "hasYValues", VALUEFUNC(_wrap_CdiGrid_hasYValues_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "hasBounds=", VALUEFUNC(_wrap_CdiGrid_hasBounds_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "hasBounds", VALUEFUNC(_wrap_CdiGrid_hasBounds_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xvalues=", VALUEFUNC(_wrap_CdiGrid_xvalues_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xvalues", VALUEFUNC(_wrap_CdiGrid_xvalues_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "yvalues=", VALUEFUNC(_wrap_CdiGrid_yvalues_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "yvalues", VALUEFUNC(_wrap_CdiGrid_yvalues_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xbounds=", VALUEFUNC(_wrap_CdiGrid_xbounds_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xbounds", VALUEFUNC(_wrap_CdiGrid_xbounds_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "ybounds=", VALUEFUNC(_wrap_CdiGrid_ybounds_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "ybounds", VALUEFUNC(_wrap_CdiGrid_ybounds_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xname=", VALUEFUNC(_wrap_CdiGrid_xname_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xname", VALUEFUNC(_wrap_CdiGrid_xname_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xlongname=", VALUEFUNC(_wrap_CdiGrid_xlongname_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xlongname", VALUEFUNC(_wrap_CdiGrid_xlongname_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xstdname=", VALUEFUNC(_wrap_CdiGrid_xstdname_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xstdname", VALUEFUNC(_wrap_CdiGrid_xstdname_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xunits=", VALUEFUNC(_wrap_CdiGrid_xunits_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "xunits", VALUEFUNC(_wrap_CdiGrid_xunits_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "yname=", VALUEFUNC(_wrap_CdiGrid_yname_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "yname", VALUEFUNC(_wrap_CdiGrid_yname_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "ylongname=", VALUEFUNC(_wrap_CdiGrid_ylongname_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "ylongname", VALUEFUNC(_wrap_CdiGrid_ylongname_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "ystdname=", VALUEFUNC(_wrap_CdiGrid_ystdname_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "ystdname", VALUEFUNC(_wrap_CdiGrid_ystdname_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "yunits=", VALUEFUNC(_wrap_CdiGrid_yunits_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "yunits", VALUEFUNC(_wrap_CdiGrid_yunits_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "name=", VALUEFUNC(_wrap_CdiGrid_name_set), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "name", VALUEFUNC(_wrap_CdiGrid_name_get), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "getValues", VALUEFUNC(_wrap_CdiGrid_getValues), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "getBounds", VALUEFUNC(_wrap_CdiGrid_getBounds), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "getValuesAsPointer", VALUEFUNC(_wrap_CdiGrid_getValuesAsPointer), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "getBoundsAsPointer", VALUEFUNC(_wrap_CdiGrid_getBoundsAsPointer), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "getFloatVals", VALUEFUNC(_wrap_CdiGrid_getFloatVals), -1);
+  rb_define_method(SwigClassCdiGrid.klass, "getFloatBounds", VALUEFUNC(_wrap_CdiGrid_getFloatBounds), -1);
+  SwigClassCdiGrid.mark = 0;
+  SwigClassCdiGrid.destroy = (void (*)(void *)) free_CdiGrid;
+  SwigClassCdiGrid.trackObjects = 0;
+  
+  SwigClassCdiTaxis.klass = rb_define_class_under(mCdiObj, "CdiTaxis", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_CdiTaxis, (void *) &SwigClassCdiTaxis);
+  rb_define_alloc_func(SwigClassCdiTaxis.klass, _wrap_CdiTaxis_allocate);
+  rb_define_method(SwigClassCdiTaxis.klass, "initialize", VALUEFUNC(_wrap_new_CdiTaxis), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "taxisID=", VALUEFUNC(_wrap_CdiTaxis_taxisID_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "taxisID", VALUEFUNC(_wrap_CdiTaxis_taxisID_get), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "ntsteps=", VALUEFUNC(_wrap_CdiTaxis_ntsteps_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "ntsteps", VALUEFUNC(_wrap_CdiTaxis_ntsteps_get), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "unit=", VALUEFUNC(_wrap_CdiTaxis_unit_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "unit", VALUEFUNC(_wrap_CdiTaxis_unit_get), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "rdate=", VALUEFUNC(_wrap_CdiTaxis_rdate_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "rdate", VALUEFUNC(_wrap_CdiTaxis_rdate_get), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "rtime=", VALUEFUNC(_wrap_CdiTaxis_rtime_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "rtime", VALUEFUNC(_wrap_CdiTaxis_rtime_get), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "vdate=", VALUEFUNC(_wrap_CdiTaxis_vdate_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "vdate", VALUEFUNC(_wrap_CdiTaxis_vdate_get), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "vtime=", VALUEFUNC(_wrap_CdiTaxis_vtime_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "vtime", VALUEFUNC(_wrap_CdiTaxis_vtime_get), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "type=", VALUEFUNC(_wrap_CdiTaxis_type_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "type", VALUEFUNC(_wrap_CdiTaxis_type_get), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "calendar=", VALUEFUNC(_wrap_CdiTaxis_calendar_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "calendar", VALUEFUNC(_wrap_CdiTaxis_calendar_get), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "hasBounds=", VALUEFUNC(_wrap_CdiTaxis_hasBounds_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "hasBounds", VALUEFUNC(_wrap_CdiTaxis_hasBounds_get), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "name=", VALUEFUNC(_wrap_CdiTaxis_name_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "name", VALUEFUNC(_wrap_CdiTaxis_name_get), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "unitname=", VALUEFUNC(_wrap_CdiTaxis_unitname_set), -1);
+  rb_define_method(SwigClassCdiTaxis.klass, "unitname", VALUEFUNC(_wrap_CdiTaxis_unitname_get), -1);
+  SwigClassCdiTaxis.mark = 0;
+  SwigClassCdiTaxis.destroy = (void (*)(void *)) free_CdiTaxis;
+  SwigClassCdiTaxis.trackObjects = 0;
+  
+  SwigClassCdiZaxis.klass = rb_define_class_under(mCdiObj, "CdiZaxis", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_CdiZaxis, (void *) &SwigClassCdiZaxis);
+  rb_define_alloc_func(SwigClassCdiZaxis.klass, _wrap_CdiZaxis_allocate);
+  rb_define_method(SwigClassCdiZaxis.klass, "initialize", VALUEFUNC(_wrap_new_CdiZaxis), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "zaxisID=", VALUEFUNC(_wrap_CdiZaxis_zaxisID_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "zaxisID", VALUEFUNC(_wrap_CdiZaxis_zaxisID_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "type=", VALUEFUNC(_wrap_CdiZaxis_type_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "type", VALUEFUNC(_wrap_CdiZaxis_type_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "ltype=", VALUEFUNC(_wrap_CdiZaxis_ltype_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "ltype", VALUEFUNC(_wrap_CdiZaxis_ltype_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "size=", VALUEFUNC(_wrap_CdiZaxis_size_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "size", VALUEFUNC(_wrap_CdiZaxis_size_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "prec=", VALUEFUNC(_wrap_CdiZaxis_prec_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "prec", VALUEFUNC(_wrap_CdiZaxis_prec_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "plevels=", VALUEFUNC(_wrap_CdiZaxis_plevels_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "plevels", VALUEFUNC(_wrap_CdiZaxis_plevels_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "plbounds=", VALUEFUNC(_wrap_CdiZaxis_plbounds_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "plbounds", VALUEFUNC(_wrap_CdiZaxis_plbounds_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "pubounds=", VALUEFUNC(_wrap_CdiZaxis_pubounds_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "pubounds", VALUEFUNC(_wrap_CdiZaxis_pubounds_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "pweights=", VALUEFUNC(_wrap_CdiZaxis_pweights_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "pweights", VALUEFUNC(_wrap_CdiZaxis_pweights_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "levels=", VALUEFUNC(_wrap_CdiZaxis_levels_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "levels", VALUEFUNC(_wrap_CdiZaxis_levels_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "lbounds=", VALUEFUNC(_wrap_CdiZaxis_lbounds_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "lbounds", VALUEFUNC(_wrap_CdiZaxis_lbounds_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "ubounds=", VALUEFUNC(_wrap_CdiZaxis_ubounds_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "ubounds", VALUEFUNC(_wrap_CdiZaxis_ubounds_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "weights=", VALUEFUNC(_wrap_CdiZaxis_weights_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "weights", VALUEFUNC(_wrap_CdiZaxis_weights_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "name=", VALUEFUNC(_wrap_CdiZaxis_name_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "name", VALUEFUNC(_wrap_CdiZaxis_name_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "longname=", VALUEFUNC(_wrap_CdiZaxis_longname_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "longname", VALUEFUNC(_wrap_CdiZaxis_longname_get), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "units=", VALUEFUNC(_wrap_CdiZaxis_units_set), -1);
+  rb_define_method(SwigClassCdiZaxis.klass, "units", VALUEFUNC(_wrap_CdiZaxis_units_get), -1);
+  SwigClassCdiZaxis.mark = 0;
+  SwigClassCdiZaxis.destroy = (void (*)(void *)) free_CdiZaxis;
+  SwigClassCdiZaxis.trackObjects = 0;
+  
+  SwigClassCdiVariable.klass = rb_define_class_under(mCdiObj, "CdiVariable", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_CdiVariable, (void *) &SwigClassCdiVariable);
+  rb_define_alloc_func(SwigClassCdiVariable.klass, _wrap_CdiVariable_allocate);
+  rb_define_method(SwigClassCdiVariable.klass, "initialize", VALUEFUNC(_wrap_new_CdiVariable), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "varID=", VALUEFUNC(_wrap_CdiVariable_varID_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "varID", VALUEFUNC(_wrap_CdiVariable_varID_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "zaxisID=", VALUEFUNC(_wrap_CdiVariable_zaxisID_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "zaxisID", VALUEFUNC(_wrap_CdiVariable_zaxisID_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "gridID=", VALUEFUNC(_wrap_CdiVariable_gridID_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "gridID", VALUEFUNC(_wrap_CdiVariable_gridID_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "taxisID=", VALUEFUNC(_wrap_CdiVariable_taxisID_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "taxisID", VALUEFUNC(_wrap_CdiVariable_taxisID_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "timeID=", VALUEFUNC(_wrap_CdiVariable_timeID_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "timeID", VALUEFUNC(_wrap_CdiVariable_timeID_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "vlistID=", VALUEFUNC(_wrap_CdiVariable_vlistID_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "vlistID", VALUEFUNC(_wrap_CdiVariable_vlistID_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "size=", VALUEFUNC(_wrap_CdiVariable_size_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "size", VALUEFUNC(_wrap_CdiVariable_size_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "code=", VALUEFUNC(_wrap_CdiVariable_code_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "code", VALUEFUNC(_wrap_CdiVariable_code_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "datatype=", VALUEFUNC(_wrap_CdiVariable_datatype_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "datatype", VALUEFUNC(_wrap_CdiVariable_datatype_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "streamID=", VALUEFUNC(_wrap_CdiVariable_streamID_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "streamID", VALUEFUNC(_wrap_CdiVariable_streamID_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "name=", VALUEFUNC(_wrap_CdiVariable_name_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "name", VALUEFUNC(_wrap_CdiVariable_name_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "longname=", VALUEFUNC(_wrap_CdiVariable_longname_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "longname", VALUEFUNC(_wrap_CdiVariable_longname_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "units=", VALUEFUNC(_wrap_CdiVariable_units_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "units", VALUEFUNC(_wrap_CdiVariable_units_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "stdname=", VALUEFUNC(_wrap_CdiVariable_stdname_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "stdname", VALUEFUNC(_wrap_CdiVariable_stdname_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "missval=", VALUEFUNC(_wrap_CdiVariable_missval_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "missval", VALUEFUNC(_wrap_CdiVariable_missval_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "values=", VALUEFUNC(_wrap_CdiVariable_values_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "values", VALUEFUNC(_wrap_CdiVariable_values_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "valuesWithLevel=", VALUEFUNC(_wrap_CdiVariable_valuesWithLevel_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "valuesWithLevel", VALUEFUNC(_wrap_CdiVariable_valuesWithLevel_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "grid=", VALUEFUNC(_wrap_CdiVariable_grid_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "grid", VALUEFUNC(_wrap_CdiVariable_grid_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "zaxis=", VALUEFUNC(_wrap_CdiVariable_zaxis_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "zaxis", VALUEFUNC(_wrap_CdiVariable_zaxis_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "taxis=", VALUEFUNC(_wrap_CdiVariable_taxis_set), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "taxis", VALUEFUNC(_wrap_CdiVariable_taxis_get), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "sinfo", VALUEFUNC(_wrap_CdiVariable_sinfo), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "getValues", VALUEFUNC(_wrap_CdiVariable_getValues), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "getValuesWithLevel", VALUEFUNC(_wrap_CdiVariable_getValuesWithLevel), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "getFValues", VALUEFUNC(_wrap_CdiVariable_getFValues), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "getFValuesWithLevel", VALUEFUNC(_wrap_CdiVariable_getFValuesWithLevel), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "getValuesAsPointer", VALUEFUNC(_wrap_CdiVariable_getValuesAsPointer), -1);
+  rb_define_method(SwigClassCdiVariable.klass, "getValuesWithLevelAsPointer", VALUEFUNC(_wrap_CdiVariable_getValuesWithLevelAsPointer), -1);
+  SwigClassCdiVariable.mark = 0;
+  SwigClassCdiVariable.destroy = (void (*)(void *)) free_CdiVariable;
+  SwigClassCdiVariable.trackObjects = 0;
+  
+  SwigClassCdi.klass = rb_define_class_under(mCdiObj, "Cdi", rb_cObject);
+  SWIG_TypeClientData(SWIGTYPE_p_Cdi, (void *) &SwigClassCdi);
+  rb_define_alloc_func(SwigClassCdi.klass, _wrap_Cdi_allocate);
+  rb_define_method(SwigClassCdi.klass, "initialize", VALUEFUNC(_wrap_new_Cdi), -1);
+  rb_define_method(SwigClassCdi.klass, "streamID=", VALUEFUNC(_wrap_Cdi_streamID_set), -1);
+  rb_define_method(SwigClassCdi.klass, "streamID", VALUEFUNC(_wrap_Cdi_streamID_get), -1);
+  rb_define_method(SwigClassCdi.klass, "vlistID=", VALUEFUNC(_wrap_Cdi_vlistID_set), -1);
+  rb_define_method(SwigClassCdi.klass, "vlistID", VALUEFUNC(_wrap_Cdi_vlistID_get), -1);
+  rb_define_method(SwigClassCdi.klass, "nvars=", VALUEFUNC(_wrap_Cdi_nvars_set), -1);
+  rb_define_method(SwigClassCdi.klass, "nvars", VALUEFUNC(_wrap_Cdi_nvars_get), -1);
+  rb_define_method(SwigClassCdi.klass, "nzaxes=", VALUEFUNC(_wrap_Cdi_nzaxes_set), -1);
+  rb_define_method(SwigClassCdi.klass, "nzaxes", VALUEFUNC(_wrap_Cdi_nzaxes_get), -1);
+  rb_define_method(SwigClassCdi.klass, "ngrids=", VALUEFUNC(_wrap_Cdi_ngrids_set), -1);
+  rb_define_method(SwigClassCdi.klass, "ngrids", VALUEFUNC(_wrap_Cdi_ngrids_get), -1);
+  rb_define_method(SwigClassCdi.klass, "ntaxes=", VALUEFUNC(_wrap_Cdi_ntaxes_set), -1);
+  rb_define_method(SwigClassCdi.klass, "ntaxes", VALUEFUNC(_wrap_Cdi_ntaxes_get), -1);
+  rb_define_method(SwigClassCdi.klass, "taxisID=", VALUEFUNC(_wrap_Cdi_taxisID_set), -1);
+  rb_define_method(SwigClassCdi.klass, "taxisID", VALUEFUNC(_wrap_Cdi_taxisID_get), -1);
+  rb_define_method(SwigClassCdi.klass, "varnames=", VALUEFUNC(_wrap_Cdi_varnames_set), -1);
+  rb_define_method(SwigClassCdi.klass, "varnames", VALUEFUNC(_wrap_Cdi_varnames_get), -1);
+  rb_define_method(SwigClassCdi.klass, "codes=", VALUEFUNC(_wrap_Cdi_codes_set), -1);
+  rb_define_method(SwigClassCdi.klass, "codes", VALUEFUNC(_wrap_Cdi_codes_get), -1);
+  rb_define_method(SwigClassCdi.klass, "variables=", VALUEFUNC(_wrap_Cdi_variables_set), -1);
+  rb_define_method(SwigClassCdi.klass, "variables", VALUEFUNC(_wrap_Cdi_variables_get), -1);
+  rb_define_method(SwigClassCdi.klass, "var=", VALUEFUNC(_wrap_Cdi_var_set), -1);
+  rb_define_method(SwigClassCdi.klass, "var", VALUEFUNC(_wrap_Cdi_var_get), -1);
+  rb_define_method(SwigClassCdi.klass, "varByCode=", VALUEFUNC(_wrap_Cdi_varByCode_set), -1);
+  rb_define_method(SwigClassCdi.klass, "varByCode", VALUEFUNC(_wrap_Cdi_varByCode_get), -1);
+  rb_define_method(SwigClassCdi.klass, "taxes=", VALUEFUNC(_wrap_Cdi_taxes_set), -1);
+  rb_define_method(SwigClassCdi.klass, "taxes", VALUEFUNC(_wrap_Cdi_taxes_get), -1);
+  rb_define_method(SwigClassCdi.klass, "zaxes=", VALUEFUNC(_wrap_Cdi_zaxes_set), -1);
+  rb_define_method(SwigClassCdi.klass, "zaxes", VALUEFUNC(_wrap_Cdi_zaxes_get), -1);
+  rb_define_method(SwigClassCdi.klass, "grids=", VALUEFUNC(_wrap_Cdi_grids_set), -1);
+  rb_define_method(SwigClassCdi.klass, "grids", VALUEFUNC(_wrap_Cdi_grids_get), -1);
+  rb_define_method(SwigClassCdi.klass, "griddes", VALUEFUNC(_wrap_Cdi_griddes), -1);
+  SwigClassCdi.mark = 0;
+  SwigClassCdi.destroy = (void (*)(void *)) free_Cdi;
+  SwigClassCdi.trackObjects = 0;
+}
+
diff --git a/libcdi/interfaces/ruby/testLib.rb b/libcdi/interfaces/ruby/testLib.rb
new file mode 100644
index 0000000..4155648
--- /dev/null
+++ b/libcdi/interfaces/ruby/testLib.rb
@@ -0,0 +1,11 @@
+require 'CdiLib'
+include CdiLib
+ifile = ARGV[0].nil? ? "../testdata/mulval.nc" : ARGV[0]
+streamID = streamOpenRead(ifile)
+vlistID  = streamInqVlist(streamID)
+nvars    = vlistNvars(vlistID)
+(0...nvars).each {|i|
+  print vlistInqVarCode(vlistID, i).to_s + ' '
+}
+puts
+streamClose(streamID)
diff --git a/libcdi/interfaces/ruby/testObj.rb b/libcdi/interfaces/ruby/testObj.rb
new file mode 100644
index 0000000..e040bbc
--- /dev/null
+++ b/libcdi/interfaces/ruby/testObj.rb
@@ -0,0 +1,63 @@
+require './CdiObj'
+include CdiObj
+require "pp"
+
+ifile = ARGV[0].nil? ? "../testdata/mulval.grb" : ARGV[0]
+
+puts "Reading file: #{ifile}"
+cdi = Cdi.new(ifile);
+
+puts "Stream: #{cdi.streamID} vlistID:#{cdi.vlistID} nvars:#{cdi.nvars}"
+
+puts "#========== TAXES ====================================#"
+cdi.taxes.each {|k,v| 
+  puts k.to_s+": " + cdi.taxes[k].ntsteps.to_s
+}
+puts "#========== GRIDS ====================================#"
+cdi.grids.each {|k,v| 
+  puts [k.to_s+": ",
+        v.size.to_s,
+        v.xname,
+        v.yname,
+        v.ylongname].join(" ")
+}
+
+puts "#========== ZAXES ====================================#"
+cdi.zaxes.each {|k,v|
+  puts [k.to_s+": ",
+        cdi.zaxes[k].size.to_s,
+        cdi.zaxes[k].name,
+        cdi.zaxes[k].units].join(" ")
+}
+
+puts "#========== VARIABLES ================================#"
+cdi.variables.each_with_index {|k,i| 
+  print k.name[0,5] + " " + k.size.to_s + " "
+  puts if i%16==0
+}
+cdi.variables.each_with_index {|k,i| 
+  print k.missval
+  puts if i%16==0
+}
+
+puts "#========== VARNAMES =================================#"
+puts cdi.varnames.sort.join(" ")
+puts cdi.varnames.grep(/max/).join(" <-> ")
+
+puts "#========== VARIABLE.NAME =================================#"
+puts cdi.variables.collect {|v| v.longname }.join("-")
+puts cdi.variables.collect {|v| v.units }.join("-")
+
+puts "#========== VAR by index ======================================#"
+var = cdi.variables[1]
+var.getValues()
+val = var.values
+pp val[-5..-1]
+puts "#========= Var by name ===============================#"
+name ="tsurf"
+newvar = cdi.var[name]
+puts "name ",name," var.name: ", newvar.name, " var.grids.xsize: " , newvar.grid.xsize
+puts "#========= Var by code ===============================#"
+code = 169
+newvar = cdi.varByCode[code]
+newvar.sinfo
diff --git a/libcdi/m4/acx_assert_lang_is_fortran_variant.m4 b/libcdi/m4/acx_assert_lang_is_fortran_variant.m4
new file mode 100644
index 0000000..fb99556
--- /dev/null
+++ b/libcdi/m4/acx_assert_lang_is_fortran_variant.m4
@@ -0,0 +1,56 @@
+dnl acx_assert_lang_is_fortran_variant.m4 --- assert a fortran lang is active
+dnl
+dnl Copyright  (C)  2010  Thomas Jahns <jahns at dkrz.de>
+dnl
+dnl Version: 1.0
+dnl Keywords: fortran language version assertion
+dnl Author: Thomas Jahns <jahns at dkrz.de>
+dnl Maintainer: Thomas Jahns <jahns at dkrz.de>
+dnl URL: https://www.dkrz.de/redmine/projects/show/scales-ppm
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are  permitted provided that the following conditions are
+dnl met:
+dnl
+dnl Redistributions of source code must retain the above copyright notice,
+dnl this list of conditions and the following disclaimer.
+dnl
+dnl Redistributions in binary form must reproduce the above copyright
+dnl notice, this list of conditions and the following disclaimer in the
+dnl documentation and/or other materials provided with the distribution.
+dnl
+dnl Neither the name of the DKRZ GmbH nor the names of its contributors
+dnl may be used to endorse or promote products derived from this software
+dnl without specific prior written permission.
+dnl
+dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+dnl IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+dnl PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+dnl OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+dnl
+dnl Commentary:
+dnl
+dnl
+dnl
+dnl Code:
+dnl
+# ACX_ASSERT_LANG_IS_FORTRAN_VARIANT
+# Current language must be Fortran or Fortran 77
+AC_DEFUN([ACX_ASSERT_LANG_IS_FORTRAN_VARIANT],
+  [m4_case(_AC_LANG, [Fortran], [],
+     [Fortran 77], [],
+     [m4_fatal([$0: current language is not Fortran: ] _AC_LANG)])])
+dnl
+dnl
+dnl Local Variables:
+dnl mode: autoconf
+dnl license-project-url: "https://www.dkrz.de/redmine/projects/show/scales-ppm"
+dnl license-default: "bsd"
+dnl End:
diff --git a/libcdi/m4/acx_lang_other_suffix_conftest.m4 b/libcdi/m4/acx_lang_other_suffix_conftest.m4
new file mode 100644
index 0000000..b2cb757
--- /dev/null
+++ b/libcdi/m4/acx_lang_other_suffix_conftest.m4
@@ -0,0 +1,64 @@
+dnl acx_lang_other_suffix_conftest.m4 --- create a language test with a suffix
+dnl                                       different from the default, i.e.
+dnl                                       .inc instead of .f90 for Fortran
+dnl                                       headers
+dnl
+dnl Copyright  (C)  2010  Thomas Jahns <jahns at dkrz.de>
+dnl
+dnl Version: 1.0
+dnl Keywords:
+dnl Author: Thomas Jahns <jahns at dkrz.de>
+dnl Maintainer: Thomas Jahns <jahns at dkrz.de>
+dnl URL: https://www.dkrz.de/redmine/projects/show/scales-ppm
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are  permitted provided that the following conditions are
+dnl met:
+dnl
+dnl Redistributions of source code must retain the above copyright notice,
+dnl this list of conditions and the following disclaimer.
+dnl
+dnl Redistributions in binary form must reproduce the above copyright
+dnl notice, this list of conditions and the following disclaimer in the
+dnl documentation and/or other materials provided with the distribution.
+dnl
+dnl Neither the name of the DKRZ GmbH nor the names of its contributors
+dnl may be used to endorse or promote products derived from this software
+dnl without specific prior written permission.
+dnl
+dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+dnl IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+dnl PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+dnl OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+dnl
+dnl Commentary:
+dnl
+dnl
+dnl
+dnl Code:
+dnl
+dnl ACX_LANG_OTHER_SUFFIX_CONFTEST(SUFFIX, SOURCE)
+dnl produce source in same language environment as AC_LANG_CONFTEST uses
+dnl but change ac_ext to SUFFIX, so that a file conftest.SUFFIX will be
+dnl written instead (useful e.g. to produce a header file).
+AC_DEFUN([ACX_LANG_OTHER_SUFFIX_CONFTEST],
+  [m4_define([_ACX_LANG_OLD],_AC_LANG)
+   AC_LANG_PUSH(_AC_LANG)
+   ac_ext="$1"
+   AC_LANG_CONFTEST([$2])
+   AC_LANG_POP(_ACX_LANG_OLD)
+   m4_undefine([_ACX_LANG_OLD])
+  ])
+dnl
+dnl Local Variables:
+dnl mode: autoconf
+dnl license-project-url: "https://www.dkrz.de/redmine/projects/show/scales-ppm"
+dnl license-default: "bsd"
+dnl End:
diff --git a/libcdi/m4/acx_options.m4 b/libcdi/m4/acx_options.m4
new file mode 100644
index 0000000..8d268de
--- /dev/null
+++ b/libcdi/m4/acx_options.m4
@@ -0,0 +1,385 @@
+AC_DEFUN([ACX_OPTIONS],
+[
+#  ----------------------------------------------------------------------
+#  Checks for multithreaded compiling + linking
+AC_ARG_WITH([threads],
+            [AC_HELP_STRING([--with-threads=<yes/no/directory>],
+                            [Compile + link for multithreading [default=yes]])],
+            [],
+            [with_threads=yes])
+THREADS_INCLUDE=''
+THREADS_LIBS=''
+AS_CASE([$with_threads],
+        [no],[AC_MSG_CHECKING([multithreading])
+              AC_MSG_RESULT([suppressed])],
+        [yes],[AX_PTHREAD([AC_DEFINE([HAVE_LIBPTHREAD],[1],[Define 1 for multithread support])],[AC_MSG_ERROR([multithreaded settings NOT found])])
+               LIBS="$PTHREAD_LIBS $LIBS"
+               CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+               CC="$PTHREAD_CC"
+               AS_ECHO(["CC:$CC CFLAGS:$CFLAGS LIBS:$LIBS"])],
+        [*],[THREADS_ROOT=$with_threads
+             LDFLAGS="-L$THREADS_ROOT/lib $LDFLAGS"
+             CPPFLAGS="-I$THREADS_ROOT/include $CPPFLAGS "
+             AC_CHECK_HEADERS(pthread.h)
+             AC_CHECK_LIB([pthread],[pthread_create])
+             THREADS_LIBS=" -L$THREADS_ROOT/lib -lpthread"
+             THREADS_INCLUDE=" -I$THREADS_ROOT/include"])
+AC_SUBST([THREADS_INCLUDE])
+AC_SUBST([THREADS_LIBS])
+#  ----------------------------------------------------------------------
+#  Link application to ZLIB library, needed for netcdf
+ZLIB_INCLUDE=''
+ZLIB_LIBS=''
+AC_ARG_WITH([zlib],
+            [AS_HELP_STRING([--with-zlib=<yes|no|directory> (default=yes)],[location of ZLIB compression library (lib and include subdirs), nec. for HDF5/NETCDF4])],
+            [AS_CASE(["$with_zlib"],
+                     [no],[AC_MSG_CHECKING([for ZLIB library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS(zlib.h)
+                            AC_SEARCH_LIBS([deflate],[z],[AC_DEFINE([HAVE_LIBZ],[1],[Define 1 for ZLIB support])])
+                            ZLIB_LIBS=" -lz"],
+                     [*],[ZLIB_ROOT=$with_zlib
+                          LDFLAGS="-L$ZLIB_ROOT/lib $LDFLAGS"
+                          CPPFLAGS="-I$ZLIB_ROOT/include $CPPFLAGS"
+                          AC_CHECK_HEADERS(zlib.h)
+                          AC_SEARCH_LIBS([deflate],[z],[AC_DEFINE([HAVE_LIBZ],[1],[Define 1 for ZLIB support])])
+                          ZLIB_INCLUDE=" -I$ZLIB_ROOT/include"
+                          ZLIB_LIBS=" -L$ZLIB_ROOT/lib -lz"])],
+                     [AC_CHECK_HEADERS(zlib.h)
+                      AC_SEARCH_LIBS([deflate],[z],[AC_DEFINE([HAVE_LIBZ],[1],[Define 1 for ZLIB support])])
+              ZLIB_LIBS=" -lz"])
+AC_SUBST([ZLIB_INCLUDE])
+AC_SUBST([ZLIB_LIBS])
+#  ----------------------------------------------------------------------
+#  Compile application with SZLIB library, needed for GRIB1 or for
+#  linking against hdf5/netcdf4
+SZLIB_INCLUDE=''
+SZLIB_LIBS=''
+AC_ARG_WITH([szlib],
+            [AS_HELP_STRING([--with-szlib=<yes|no|directory> (default=no)],[location of szlib library, optional for GRIB1 and NETCDF4 compression])],
+            [AS_CASE(["$with_szlib"],
+                     [no],[AC_MSG_CHECKING([for szlib library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS(szlib.h)
+                            AC_SEARCH_LIBS([SZ_BufftoBuffCompress],
+                                           [sz],
+                                           [AC_DEFINE([HAVE_LIBSZ],[1],[Define to 1 for SZIP support])],
+                                           [AC_MSG_ERROR([Could not link to szlib])])
+                            SZLIB_LIBS=" -lsz"],
+                     [*],[SZLIB_ROOT=$with_szlib
+                          AS_IF([test -d "$SZLIB_ROOT"],
+                                [LDFLAGS="-L$SZLIB_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$SZLIB_ROOT/include $CPPFLAGS"
+                                 AC_CHECK_HEADERS(szlib.h)
+                                 AC_SEARCH_LIBS([SZ_BufftoBuffCompress],
+                                                [sz],
+                                                [AC_DEFINE([HAVE_LIBSZ],[1],[Define to 1 for SZIP support])],
+                                                [AC_MSG_ERROR([Could not link to szlib])])
+                                 SZLIB_LIBS=" -L$SZLIB_ROOT/lib -lsz"
+                                 SZLIB_INCLUDE=" -I$SZLIB_ROOT/include"],
+                                [AC_MSG_NOTICE([$SZLIB_ROOT is not a directory! SZLIB suppressed])])])],
+            [AC_MSG_CHECKING([for szlib library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([SZLIB_INCLUDE])
+AC_SUBST([SZLIB_LIBS])
+#  ----------------------------------------------------------------------
+#  Link application with HDF5 library, required for netcdf4
+HDF5_ROOT=''
+HDF5_INCLUDE=''
+HDF5_LIBS=''
+AC_ARG_WITH([hdf5],
+            [AS_HELP_STRING([--with-hdf5=<yes|no|directory> (default=no)],[location of hdf5 library, NETCDF4 requires hdf5 high level interface])],
+            [AS_CASE(["$with_hdf5"],
+                     [no],[AC_MSG_CHECKING([for hdf5 library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([hdf5.h])
+                            AC_SEARCH_LIBS([H5Fopen],
+                                           [hdf5],
+                                           [AC_DEFINE([HAVE_LIBHDF5],[1],[Define to 1 for HDF5 support])],
+                                           [AC_MSG_ERROR([Cannot link to hdf5 library! It is required for Netcdf4])])
+                            AC_SEARCH_LIBS([H5DSis_scale],
+                                           [hdf5_hl],
+                                           [have_hdf5_hl=yes],
+                                           [AC_MSG_NOTICE([Cannot find hdf5 high level interface! It is required for netCDF4.])
+                                            have_hdf5_hl=no])
+                            AS_IF([test "x$have_libhdf5_hl" = xyes],
+                                  [HDF5_LIBS=" -lhdf5_hl -lhdf5"],
+                                  [HDF5_LIBS=" -lhdf5"])
+                            ],
+                     [*],[AS_IF([test -d "$with_hdf5"],
+                                [HDF5_ROOT="$with_hdf5"
+                                 LDFLAGS="-L$HDF5_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$HDF5_ROOT/include $CPPFLAGS"
+                                 AC_CHECK_HEADERS([hdf5.h])
+                                 AC_SEARCH_LIBS([H5Fopen],
+                                                [hdf5],
+                                                [AC_DEFINE([HAVE_LIBHDF5],[1],[Define to 1 for HDF5 support])],
+                                                [AC_MSG_ERROR([Cannot link to hdf5! It is required for netCDF4.])])
+                                 AC_SEARCH_LIBS([H5DSis_scale],
+                                                [hdf5_hl],
+                                                [have_hdf5_hl=yes],
+                                                [AC_MSG_NOTICE([Cannot link to hdf5 high level interface! It is required for netCDF4.\
+                                                                HDF5 must be built with zlib; the location of zlib must be specified for HDF5 with the \
+                                                                --with-zlib option. If HDF5 was also built with szlib, then the location of szlib must also be \
+                                                                specified with the --with-szlib option..])
+                                                have_hdf5_hl=no])
+                                 AS_IF([test "x$have_libhdf5_hl" = 'xyes'],
+                                       [HDF5_LIBS=" -L$HDF5_ROOT/lib -lhdf5_hl -lhdf5"],
+                                       [HDF5_LIBS=" -L$HDF5_ROOT/lib -lhdf5"])
+                                 HDF5_INCLUDE=" -I$HDF5_ROOT/include"],
+                                [AC_MSG_NOTICE([$with_hdf5 is not a directory! HDF5 suppressed])])])],
+            [AC_MSG_CHECKING([for hdf5 library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([HDF5_ROOT])
+AC_SUBST([HDF5_INCLUDE])
+AC_SUBST([HDF5_LIBS])
+#  ----------------------------------------------------------------------
+#  Compile application with netcdf
+NETCDF_ROOT=''
+NETCDF_INCLUDE=''
+NETCDF_LIBS=''
+AC_ARG_WITH([netcdf],
+            [AS_HELP_STRING([--with-netcdf=<yes|no|directory> (default=yes)],[location of netcdf library (lib and include subdirs)])],
+            [AS_CASE(["$with_netcdf"],
+                     [no],[AC_MSG_CHECKING([for netcdf library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([netcdf.h])
+                            AC_SEARCH_LIBS([nc_open],
+                                           [netcdf],
+                                           [AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NETCDF support])],
+                                           [AC_MSG_ERROR([Could not link to netcdf library])])
+                            NETCDF_LIBS=" -lnetcdf"
+                            AC_CHECK_PROG(NC_CONFIG,nc-config,nc-config)
+                            AS_IF([test "x$NC_CONFIG" != "x"],
+                                  [AC_MSG_CHECKING([netcdf's nc2 support])
+                                   AS_IF([test "x$($NC_CONFIG --has-nc2)" = "xyes"],
+                                         [AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NETCDF2 support])
+                                          AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
+                                   AC_MSG_CHECKING([netcdf's nc4 support])
+                                   AS_IF([test "x$($NC_CONFIG --has-nc4)" = "xyes"],
+                                   [AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NETCDF4 support])
+                                    AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])],
+                                  [AS_ECHO([Could not find nc-config! go on with default configuration])])],
+                     [*],[AS_IF([test -d "$with_netcdf"],
+                                [NETCDF_ROOT=$with_netcdf
+                                 LDFLAGS="-L$NETCDF_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$NETCDF_ROOT/include $CPPFLAGS"
+                                 AC_CHECK_HEADERS([netcdf.h])
+                                 AC_SEARCH_LIBS([nc_open],
+                                                [netcdf],
+                                                [AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NETCDF support])],
+                                                [AC_MSG_ERROR([Could not link to netcdf library])])
+                                 NETCDF_LIBS=" -L$NETCDF_ROOT/lib -lnetcdf"
+                                 NETCDF_INCLUDE=" -I$NETCDF_ROOT/include"
+                                 AC_MSG_CHECKING([nc-config script])
+                                 AC_CHECK_PROG(NC_CONFIG,nc-config,[$NETCDF_ROOT/bin/nc-config],,["$NETCDF_ROOT/bin"])
+                                 AS_IF([test "x$NC_CONFIG" != "x"],
+                                   [AC_MSG_CHECKING([netcdf's OpenDAP support])
+                                    AS_IF([test "x$($NC_CONFIG --has-dap)" = "xyes"],
+                                          [AC_DEFINE([HAVE_LIBNC_DAP],[1],[Define to 1 for NETCDF OpenDAP])
+                                           AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])]
+                                   [AC_MSG_CHECKING([netcdf's nc2 support])
+                                   AS_IF([test "x$($NC_CONFIG --has-nc2)" = "xyes"],
+                                         [AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NETCDF2 support])
+                                          AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
+                                   AC_MSG_CHECKING([netcdf's nc4 support])
+                                   AS_IF([test "x$($NC_CONFIG --has-nc4)" = "xyes"],
+                                         [AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NETCDF4 support])
+                                          AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])],
+                                   [AC_MSG_RESULT([Could not find nc-config! go on with default configuration])])],
+                                [AC_MSG_NOTICE([$with_netcdf is not a directory! NETCDF suppressed])])])],
+            [AC_MSG_CHECKING([for NETCDF library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([NETCDF_ROOT])
+AC_SUBST([NETCDF_INCLUDE])
+AC_SUBST([NETCDF_LIBS])
+#  ----------------------------------------------------------------------
+#  Link application with JASPER library (needed for GRIB2 compression)
+JASPER_LIBS=''
+AC_ARG_WITH([jasper],
+            [AS_HELP_STRING([--with-jasper=<directory>],
+                            [Specify location of JASPER library. You must specify its location if GRIB_API was built with JASPER.])],
+            [AS_CASE(["$with_jasper"],
+                     [no],[AC_MSG_CHECKING([for jasper library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([jasper.h])
+                            AC_SEARCH_LIBS([jas_init],[jasper],[AC_DEFINE([HAVE_LIBJASPER],[1],[Define to 1 for JPEG compression for GRIB2])],
+                                           [AC_MSG_ERROR([Could not link to jasper library! Required for GRIB_API])])
+                            AC_SUBST([JASPER_LIBS],[" -ljasper"])],
+                     [*],[JASPER_ROOT=$with_jasper
+                          AS_IF([test -d "$JASPER_ROOT"],
+                                [LDFLAGS="$LDFLAGS -L$JASPER_ROOT/lib"
+                                 CPPFLAGS="$CPPFLAGS -I$JASPER_ROOT/include"
+                                 AC_SEARCH_LIBS([jas_stream_memopen],
+                                                [jasper],
+                                                [AC_DEFINE([HAVE_LIBJASPER],[1],[Define to 1 for JPEG compression for GRIB2])],
+                                                [AC_MSG_ERROR([Could not link to jasper library! Required for GRIB_API])])
+                                 JASPER_LIBS=" -L$JASPER_ROOT/lib -ljasper"],
+                                [AC_MSG_ERROR([$JASPER_ROOT is not a directory! JASPER suppressed])])])],
+            [AC_MSG_CHECKING([for the JASPER library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([JASPER_LIBS])
+#  ----------------------------------------------------------------------
+#  Link application with openjpeg library (needed for GRIB2 compression)
+OPENJPEG_LIBS=''
+AC_ARG_WITH([openjpeg],
+            [AS_HELP_STRING([--with-openjpeg=<directory>],
+                            [Specify location of openjpeg library. You must specify its location if GRIB_API was built with openjpeg.])],
+            [AS_CASE(["$with_openjpeg"],
+                     [no],[AC_MSG_CHECKING([for openjpeg library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([openjpeg.h])
+                            AC_SEARCH_LIBS([opj_image_create],[openjpeg],[AC_DEFINE([HAVE_LIBOPENJPEG],[1],[Define to 1 for JPEG compression for GRIB2])],
+                                           [AC_MSG_ERROR([Could not link to openjpeg library! Required for GRIB_API])])
+                            AC_SUBST([openjpeg_LIBS],[" -lopenjpeg"])],
+                     [*],[OPENJPEG_ROOT=$with_openjpeg
+                          AS_IF([test -d "$OPENJPEG_ROOT"],
+                                [LDFLAGS="$LDFLAGS -L$OPENJPEG_ROOT/lib"
+                                 CPPFLAGS="$CPPFLAGS -I$OPENJPEG_ROOT/include"
+                                 AC_SEARCH_LIBS([opj_image_create],
+                                                [openjpeg],
+                                                [AC_DEFINE([HAVE_LIBOPENJPEG],[1],[Define to 1 for JPEG compression for GRIB2])],
+                                                [AC_MSG_ERROR([Could not link to openjpeg library! Required for GRIB_API])])
+                                 OPENJPEG_LIBS=" -L$OPENJPEG_ROOT/lib -lopenjpeg"],
+                                [AC_MSG_ERROR([$OPENJPEG_ROOT is not a directory! openjpeg suppressed])])])],
+            [AC_MSG_CHECKING([for the openjpeg library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([OPENJPEG_LIBS])
+#  ----------------------------------------------------------------------
+#  Link application with LIBPNG library (needed for GRIB2 compression)
+LIBPNG_LIBS=''
+AC_ARG_WITH([libpng],
+            [AS_HELP_STRING([--with-libpng=<directory>],
+                            [Specify location of LIBPNG library. You must specify its location if GRIB_API was built with LIBPNG.])],
+            [AS_CASE(["$with_libpng"],
+                     [no],[AC_MSG_CHECKING([for libpng library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([png.h])
+                            AC_SEARCH_LIBS([png_warning],[png],[AC_DEFINE([HAVE_LIBLIBPNG],[1],[Define to 1 for PNG compression for GRIB2])],
+                                           [AC_MSG_ERROR([Could not link to libpng library! Required for GRIB_API])])
+                            AC_SUBST([LIBPNG_LIBS],[" -lpng"])],
+                     [*],[LIBPNG_ROOT=$with_libpng
+                          AS_IF([test -d "$LIBPNG_ROOT"],
+                                [LDFLAGS="$LDFLAGS -L$LIBPNG_ROOT/lib"
+                                 CPPFLAGS="$CPPFLAGS -I$LIBPNG_ROOT/include"
+                                 AC_SEARCH_LIBS([png_warning],
+                                                [png],
+                                                [AC_DEFINE([HAVE_LIBLIBPNG],[1],[Define to 1 for PNG compression for GRIB2])],
+                                                [AC_MSG_ERROR([Could not link to libpng library! Required for GRIB_API])])
+                                 LIBPNG_LIBS=" -L$LIBPNG_ROOT/lib -lpng"],
+                                [AC_MSG_ERROR([$LIBPNG_ROOT is not a directory! LIBPNG suppressed])])])],
+            [AC_MSG_CHECKING([for the LIBPNG library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([LIBPNG_LIBS])
+#  ----------------------------------------------------------------------
+#  Compile application with GRIB_API library (for GRIB2 support)
+GRIB_API_INCLUDE=''
+GRIB_API_LIBS=''
+AC_ARG_WITH([grib_api],
+            [AS_HELP_STRING([--with-grib_api=<yes|no|directory>],
+                            [library for grib2 compression; if a directory is given, it will be used as a value for --with-jasper-root])],
+            [AS_CASE(["$with_grib_api"],
+                     [no],[AC_MSG_CHECKING([for GRIB_API library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([grib_api.h])
+                            AC_SEARCH_LIBS([grib_get_message],
+                                           [grib_api],
+                                           [AC_DEFINE([HAVE_LIBGRIB_API],[1],[GRIB_API library is present if defined to 1])],
+                                           [AC_MSG_ERROR([Could not link to grib_api library])])],
+                     [*],[GRIB_API_ROOT=$with_grib_api
+                          AS_IF([test -d "$GRIB_API_ROOT"],
+                                [LDFLAGS="-L$GRIB_API_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$GRIB_API_ROOT/include $CPPFLAGS"
+                                 AC_CHECK_HEADERS([grib_api.h])
+                                 AC_SEARCH_LIBS([grib_get_message],
+                                                [grib_api],
+                                                [AC_DEFINE([HAVE_LIBGRIB_API],[1],[GRIB_API library is present if defined to 1])],
+                                                [AC_MSG_ERROR([Could not link to grib_api library])])
+                                 GRIB_API_LIBS=" -L$GRIB_API_ROOT/lib -lgrib_api"
+                                 GRIB_API_INCLUDE=" -I$GRIB_API_ROOT/include"],
+                                [AC_MSG_ERROR([$GRIB_API_ROOT is not a directory! GRIB_API suppressed])])])],
+            [AC_MSG_CHECKING([for the GRIB_API library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([GRIB_API_INCLUDE])
+AC_SUBST([GRIB_API_LIBS])
+#  ----------------------------------------------------------------------
+#  Enable GRIB support
+AC_MSG_CHECKING([for GRIB support])
+AC_ARG_ENABLE([grib],
+              [AS_HELP_STRING([--enable-grib],[GRIB support [default=yes]])],
+              [AS_IF([test "x$enable_grib" != 'xno'],
+                     [AC_DEFINE(HAVE_LIBGRIB, [1], [Define to 1 for GRIB support])
+                      enable_grib=yes])],
+              [AC_DEFINE(HAVE_LIBGRIB, [1], [Define to 1 for GRIB support])
+               enable_grib=yes])
+AC_MSG_RESULT([$enable_grib])
+AC_SUBST([ENABLE_GRIB],[$enable_grib])
+#  ----------------------------------------------------------------------
+#  Compile interface with internal CGRIBEX library
+AC_MSG_CHECKING([for CGRIBEX support])
+AC_ARG_ENABLE([cgribex],
+              [AC_HELP_STRING([--enable-cgribex],[Use the CGRIBEX library [default=yes]])],
+              [AS_IF([test "x$enable_cgribex" != 'xno'],
+                     [AC_DEFINE(HAVE_LIBCGRIBEX,[1],[Define to 1 for GRIB1 decoding/encoding with cgribex])
+                      enable_cgribex=yes])],
+              [AC_DEFINE(HAVE_LIBCGRIBEX,[1],[Define to 1 for GRIB1 decoding/encoding with cgribex])
+               enable_cgribex=yes])
+AC_MSG_RESULT([$enable_cgribex])
+AC_SUBST([ENABLE_CGRIBEX],[$enable_cgribex])
+#  ----------------------------------------------------------------------
+#  Compile interface with internal SERVICE library
+AC_MSG_CHECKING([for SERVICE support])
+AC_ARG_ENABLE([service],
+              [AC_HELP_STRING([--enable-service],[Use the service library [default=yes]])],
+              [AS_IF([test "x$enable_service" != 'xno'],
+                     [AC_DEFINE(HAVE_LIBSERVICE,[1],[Define to 1 for SERVICE interface])
+                      enable_service=yes])],
+              [AC_DEFINE(HAVE_LIBSERVICE,[1],[Define to 1 for SERVICE interface])
+               enable_service=yes])
+AC_MSG_RESULT([$enable_service])
+AC_SUBST([ENABLE_SERVICE],[$enable_service])
+#  ----------------------------------------------------------------------
+#  Compile interface with internal EXTRA library
+AC_MSG_CHECKING([for EXTRA support])
+AC_ARG_ENABLE([extra],
+              [AC_HELP_STRING([--enable-extra],[Use the extra library [default=yes]])],
+              [AS_IF([test "x$enable_extra" != 'xno'],
+                     [AC_DEFINE(HAVE_LIBEXTRA,[1],[Define to 1 for EXTRA interface])
+                      enable_extra=yes])],
+              [AC_DEFINE(HAVE_LIBEXTRA,[1],[Define to 1 for EXTRA interface])
+               enable_extra=yes])
+AC_MSG_RESULT([$enable_extra])
+AC_SUBST([ENABLE_EXTRA],[$enable_extra])
+#  ----------------------------------------------------------------------
+#  Compile interface with internal IEG library
+AC_MSG_CHECKING([for IEG support])
+AC_ARG_ENABLE([ieg],
+              [AC_HELP_STRING([--enable-ieg],[Use the ieg library [default=yes]])],
+              [AS_IF([test "x$enable_ieg" != 'xno'],
+                     [AC_DEFINE(HAVE_LIBIEG,[1],[Define to 1 for IEG interface])
+                      enable_ieg=yes])],
+              [AC_DEFINE(HAVE_LIBIEG,[1],[Define to 1 for IEG interface])
+               enable_ieg=yes])
+AC_MSG_RESULT([$enable_ieg])
+AC_SUBST([ENABLE_IEG],[$enable_ieg])
+#  ----------------------------------------------------------------------
+# At the moment, there are two possible CDI bindings
+# (default for CDO) linking directly to CDI convenience library with libtool
+# (default for CDI) build and link to a shared CDI library
+AS_IF([test "x$CDO_DISABLE_CDILIB" = "x1"],[enable_cdi_lib=no],[enable_cdi_lib=yes])
+# save CDI binding mode for later automake use
+AM_CONDITIONAL([ENABLE_CDI_LIB],[test x$enable_cdi_lib = 'xyes'])
+# create shell variables for the representation of configure results
+AS_IF([test x$enable_cdi_lib = 'xno'],[AC_SUBST([ENABLE_CDI_LIB],[false])],[AC_SUBST([ENABLE_CDI_LIB],[true])])
+#  ----------------------------------------------------------------------
+#  Build a static CDI
+AC_MSG_CHECKING([for building an additional static CDI binary])
+AC_ARG_ENABLE([all-static],
+              [AS_HELP_STRING([--enable-all-static],[build a completely statically linked CDO binary [default=no]])],
+              [AS_IF([test "x$enable_all_static" != "xno"],
+                     [enable_all_static=yes],
+                     [enable_all_static=no])],
+              [enable_all_static=no])
+AC_MSG_RESULT([$enable_all_static])
+AM_CONDITIONAL([ENABLE_ALL_STATIC],[test x$enable_all_static = 'xyes'])
+])
diff --git a/libcdi/m4/acx_sl_fc_mod_path_flag.m4 b/libcdi/m4/acx_sl_fc_mod_path_flag.m4
new file mode 100644
index 0000000..863f719
--- /dev/null
+++ b/libcdi/m4/acx_sl_fc_mod_path_flag.m4
@@ -0,0 +1,96 @@
+dnl acx_sl_fc_mod_path_flag.m4 --- find flag to use module from other directory
+dnl
+dnl Copyright  (C)  2010  Thomas Jahns <jahns at dkrz.de>
+dnl
+dnl Version: 1.0
+dnl Keywords:
+dnl Author: Thomas Jahns <jahns at dkrz.de>
+dnl Maintainer: Thomas Jahns <jahns at dkrz.de>
+dnl URL: https://www.dkrz.de/redmine/projects/show/scales-ppm
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are  permitted provided that the following conditions are
+dnl met:
+dnl
+dnl Redistributions of source code must retain the above copyright notice,
+dnl this list of conditions and the following disclaimer.
+dnl
+dnl Redistributions in binary form must reproduce the above copyright
+dnl notice, this list of conditions and the following disclaimer in the
+dnl documentation and/or other materials provided with the distribution.
+dnl
+dnl Neither the name of the DKRZ GmbH nor the names of its contributors
+dnl may be used to endorse or promote products derived from this software
+dnl without specific prior written permission.
+dnl
+dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+dnl IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+dnl PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+dnl OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+dnl
+dnl Commentary:
+dnl
+dnl
+dnl
+dnl Code:
+dnl
+# ACX_SL_FC_MOD_PATH_FLAG([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
+# -------------------------
+# Check which flag is necessary to alter the compiler's search path
+# for module files.
+# This obviously requires that the compiler has some notion of
+# module files as separate from object files and some sensible
+# method of altering its search path. This will therefore not work
+# on early Cray F90 compilers, or on v5 (and 6?) of ifc.
+#
+# Nearly every compiler I have found uses -Ipath for this purpose;
+# Sun F95 v7.1 (at least), uses -Mpath
+#
+AC_DEFUN([ACX_SL_FC_CHECK_MOD_PATH_FLAG],dnl
+  [ACX_ASSERT_LANG_IS_FORTRAN_VARIANT
+   AC_REQUIRE([AC_PROG_FC])
+   AS_VAR_PUSHDEF([mod_flag],[acx_sl_cv_fc_mod_path_flag_]_AC_LANG_ABBREV)dnl
+   ASX_VAR_UNSET([mod_flag])
+   AC_CACHE_CHECK([for flag to alter module search path],[mod_flag],dnl
+     [mkdir conftestdir
+      cd conftestdir
+      AC_COMPILE_IFELSE([AC_LANG_SOURCE([      module cnftst
+       implicit none
+       integer :: i
+      end module cnftst])],,
+        [AC_MSG_ERROR([Cannot compile fortran modules])])
+      cd ..
+      for i in -I -M -module -p; do
+        FCFLAGS_save=$FCFLAGS
+        FCFLAGS="$FCFLAGS ${i}conftestdir"
+        AC_COMPILE_IFELSE([AC_LANG_PROGRAM([],[dnl
+       use cnftst
+       implicit none
+       i = 0
+])
+             ],[AS_VAR_SET([mod_flag],[$i]) ; FCFLAGS=$FCFLAGS_save ; break],
+             [:])
+        FCFLAGS=$FCFLAGS_save
+      done
+      FCFLAGS=$FCFLAGS_save
+      rm -rf conftestdir
+      AS_VAR_SET_IF([mod_flag],dnl
+        [m4_default([$1],[:])],dnl
+        [m4_default([$2],[AC_MSG_ERROR([Cannot find flag to alter module search path])])])])
+   FC_MOD_FLAG=AS_VAR_GET([mod_flag])
+   AC_SUBST([FC_MOD_FLAG])
+   AS_VAR_POPDEF([mod_flag])dnl
+])# ACX_SL_FC_MOD_PATH_FLAG
+dnl
+dnl Local Variables:
+dnl mode: autoconf
+dnl license-project-url: "https://www.dkrz.de/redmine/projects/show/scales-ppm"
+dnl license-default: "bsd"
+dnl End:
diff --git a/libcdi/m4/acx_sl_mod_suffix.m4 b/libcdi/m4/acx_sl_mod_suffix.m4
new file mode 100644
index 0000000..bf26daa
--- /dev/null
+++ b/libcdi/m4/acx_sl_mod_suffix.m4
@@ -0,0 +1,107 @@
+dnl acx_sl_mod_suffix.m4 --- determine name of symbol file for Fortran 90 module
+dnl
+dnl Copyright  (C)  2010  Thomas Jahns <jahns at dkrz.de>
+dnl
+dnl Version: 1.0
+dnl Keywords:
+dnl Author: Thomas Jahns <jahns at dkrz.de>
+dnl Maintainer: Thomas Jahns <jahns at dkrz.de>
+dnl URL: https://www.dkrz.de/redmine/projects/show/scales-ppm
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are  permitted provided that the following conditions are
+dnl met:
+dnl
+dnl Redistributions of source code must retain the above copyright notice,
+dnl this list of conditions and the following disclaimer.
+dnl
+dnl Redistributions in binary form must reproduce the above copyright
+dnl notice, this list of conditions and the following disclaimer in the
+dnl documentation and/or other materials provided with the distribution.
+dnl
+dnl Neither the name of the DKRZ GmbH nor the names of its contributors
+dnl may be used to endorse or promote products derived from this software
+dnl without specific prior written permission.
+dnl
+dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+dnl IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+dnl PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+dnl OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+dnl
+dnl Commentary:
+dnl
+dnl
+dnl
+dnl Code:
+dnl
+# ACX_SL_FC_MOD_SUFFIX([ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND])
+# -----------------
+# Determines the form of the filename of modules produced
+# by the Fortran compiler.
+# Tests for all forms of file extension I've (TOHW) found in the
+# wild. Note that at least one compiler (PGI??) changes the
+# case of the basename as well. Whether this happens is
+# encoded in the variable ac_fc_mod_uppercase.
+#
+# This macro depends, of course, on the Fortran compiler producing
+# module files. See comment to AC_FC_MOD_PATH_FLAG.
+#
+# FIXME: This will fail if an F77-only compiler is used.
+# Currently we warn and continue. We should maybe error out.
+#
+AC_DEFUN([ACX_SL_FC_MOD_SUFFIX],
+  [AC_MSG_CHECKING([for suffix of module files])
+   AC_ARG_VAR([FCMODEXT], [file extension of compiled Fortran module files])
+   ac_fc_mod_uppercase=no
+   AC_LANG_PUSH([Fortran])
+   AC_COMPILE_IFELSE([
+      module conftest
+       implicit none
+       integer :: i
+      end module conftest
+     ])
+   while :; do
+     acx_fc_mod_name=
+   m4_foreach([acx_fc_mod_name],dnl
+     [[conftest.$FCMODEXT], [conftest.mod], [conftest.MOD], [conftest.M],
+      [CONFTEST.MOD]],dnl
+     [AS_IF([test -n "acx_fc_mod_name" -a -f "acx_fc_mod_name"],dnl
+        [[acx_fc_mod_name]="acx_fc_mod_name" ; break])
+     ])
+     break
+   done
+   rm -f conftest*
+   AC_LANG_POP([Fortran])
+dnl
+   AS_CASE(["$acx_fc_mod_name"],dnl
+     [conftest.$FCMODEXT], [:],
+     [CONFTEST.$FCMODEXT], [ac_fc_mod_uppercase=yes],
+     [conftest.mod], [FCMODEXT=mod],
+     [conftest.MOD], [FCMODEXT=MOD],
+     [conftest.M], [FCMODEXT=M],
+     [CONFTEST.MOD], [FCMODEXT=MOD
+        ac_fc_mod_uppercase=yes])
+   AC_MSG_RESULT([${FCMODEXT-not found}])
+   AS_VAR_TEST_SET([FCMODEXT], [$1], [m4_ifval([$2],[$2],dnl
+     [AC_MSG_WARN([Could not find Fortran module file extension.])])])
+dnl
+   AS_IF([test $ac_fc_mod_uppercase = yes],
+     [FCMODCASE=uc
+      AC_MSG_NOTICE([Fortran module filenames are uppercase.])],
+     [FCMODCASE=lc])
+   AC_SUBST([FCMODEXT])
+   AC_SUBST([FCMODCASE])
+])dnl _ACX_SL_FC_MOD_SUFFIX
+dnl
+dnl Local Variables:
+dnl mode: autoconf
+dnl license-project-url: "https://www.dkrz.de/redmine/projects/show/scales-ppm"
+dnl license-default: "bsd"
+dnl End:
diff --git a/libcdi/m4/asx_unset.m4 b/libcdi/m4/asx_unset.m4
new file mode 100644
index 0000000..ff49581
--- /dev/null
+++ b/libcdi/m4/asx_unset.m4
@@ -0,0 +1,60 @@
+dnl asx_unset.m4 --- unset a shell variable
+dnl
+dnl Copyright  (C)  2010  Thomas Jahns <jahns at dkrz.de>
+dnl
+dnl Version: 1.0
+dnl Keywords:
+dnl Author: Thomas Jahns <jahns at dkrz.de>
+dnl Maintainer: Thomas Jahns <jahns at dkrz.de>
+dnl URL: https://www.dkrz.de/redmine/projects/show/scales-ppm
+dnl
+dnl Redistribution and use in source and binary forms, with or without
+dnl modification, are  permitted provided that the following conditions are
+dnl met:
+dnl
+dnl Redistributions of source code must retain the above copyright notice,
+dnl this list of conditions and the following disclaimer.
+dnl
+dnl Redistributions in binary form must reproduce the above copyright
+dnl notice, this list of conditions and the following disclaimer in the
+dnl documentation and/or other materials provided with the distribution.
+dnl
+dnl Neither the name of the DKRZ GmbH nor the names of its contributors
+dnl may be used to endorse or promote products derived from this software
+dnl without specific prior written permission.
+dnl
+dnl THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+dnl IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+dnl TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
+dnl PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER
+dnl OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+dnl EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+dnl PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+dnl PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+dnl LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+dnl NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+dnl SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+dnl
+dnl Commentary:
+dnl
+dnl FIXME: this is currently only a placeholder that expects unset to
+dnl be present although it's not universally available
+dnl
+dnl
+dnl Code:
+dnl
+# ASX_VAR_UNSET(VARIABLE)
+# ---------------------------
+# Unset shell VARIABLE.
+# If the variable contains indirections (e.g. `ac_cv_func_$ac_func')
+# perform whenever possible at m4 level, otherwise sh level.
+AC_DEFUN([ASX_VAR_UNSET],
+[AS_LITERAL_IF([$1],
+	       [unset $1],
+	       [unset `eval "$1"`])])
+dnl
+dnl Local Variables:
+dnl mode: autoconf
+dnl license-project-url: "https://www.dkrz.de/redmine/projects/show/scales-ppm"
+dnl license-default: "bsd"
+dnl End:
diff --git a/libcdi/m4/ax_pthread.m4 b/libcdi/m4/ax_pthread.m4
new file mode 100644
index 0000000..4ecd9c6
--- /dev/null
+++ b/libcdi/m4/ax_pthread.m4
@@ -0,0 +1,283 @@
+# ===========================================================================
+#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+#   This macro figures out how to build C programs using POSIX threads. It
+#   sets the PTHREAD_LIBS output variable to the threads library and linker
+#   flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+#   flags that are needed. (The user can also force certain compiler
+#   flags/libs to be tested by setting these environment variables.)
+#
+#   Also sets PTHREAD_CC to any special C compiler that is needed for
+#   multi-threaded programs (defaults to the value of CC otherwise). (This
+#   is necessary on AIX to use the special cc_r compiler alias.)
+#
+#   NOTE: You are assumed to not only compile your program with these flags,
+#   but also link it with them as well. e.g. you should link with
+#   $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+#   If you are only building threads programs, you may wish to use these
+#   variables in your default LIBS, CFLAGS, and CC:
+#
+#     LIBS="$PTHREAD_LIBS $LIBS"
+#     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#     CC="$PTHREAD_CC"
+#
+#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+#   has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
+#   (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+#   ACTION-IF-FOUND is a list of shell commands to run if a threads library
+#   is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+#   is not found. If ACTION-IF-FOUND is not specified, the default action
+#   will define HAVE_PTHREAD.
+#
+#   Please let the authors know if this macro fails on any platform, or if
+#   you have any other suggestions or comments. This macro was based on work
+#   by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+#   from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+#   Alejandro Forero Cuervo to the autoconf macro repository. We are also
+#   grateful for the helpful feedback of numerous users.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Steven G. Johnson <stevenj at alum.mit.edu>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 11
+
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+        AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
+        AC_MSG_RESULT($ax_pthread_ok)
+        if test x"$ax_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+#      ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+        ;;
+
+	*-darwin*)
+	ax_pthread_flags="-pthread $ax_pthread_flags"
+	;;
+esac
+
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
+
+        case $flag in
+                none)
+                AC_MSG_CHECKING([whether pthreads work without any flags])
+                ;;
+
+                -*)
+                AC_MSG_CHECKING([whether pthreads work with $flag])
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+		pthread-config)
+		AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
+		if test x"$ax_pthread_config" = xno; then continue; fi
+		PTHREAD_CFLAGS="`pthread-config --cflags`"
+		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+		;;
+
+                *)
+                AC_MSG_CHECKING([for the pthreads library -l$flag])
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        AC_TRY_LINK([#include <pthread.h>
+		     static void routine(void* a) {a=0;}
+		     static void* start_routine(void* a) {return a;}],
+                    [pthread_t th; pthread_attr_t attr;
+                     pthread_create(&th,0,start_routine,0);
+                     pthread_join(th, 0);
+                     pthread_attr_init(&attr);
+                     pthread_cleanup_push(routine, 0);
+                     pthread_cleanup_pop(0); ],
+                    [ax_pthread_ok=yes])
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        AC_MSG_RESULT($ax_pthread_ok)
+        if test "x$ax_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+	AC_MSG_CHECKING([for joinable pthread attribute])
+	attr_name=unknown
+	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+	    AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
+                        [attr_name=$attr; break])
+	done
+        AC_MSG_RESULT($attr_name)
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+                               [Define to necessary symbol if this constant
+                                uses a non-standard name on your system.])
+        fi
+
+        AC_MSG_CHECKING([if more special flags are required for pthreads])
+        flag=no
+        case "${host_cpu}-${host_os}" in
+            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        AC_MSG_RESULT(${flag})
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with xlc_r or cc_r
+	if test x"$GCC" != xyes -a \( x"$CC" = xxlc -o x"$CC" = cc \) ; then
+          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
+        else
+          PTHREAD_CC=$CC
+	fi
+else
+        PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ax_pthread_ok" = xyes; then
+        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+        :
+else
+        ax_pthread_ok=no
+        $2
+fi
+AC_LANG_RESTORE
+])dnl AX_PTHREAD
diff --git a/libcdi/m4/libtool.m4 b/libcdi/m4/libtool.m4
new file mode 100644
index 0000000..d812584
--- /dev/null
+++ b/libcdi/m4/libtool.m4
@@ -0,0 +1,7831 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+#                 Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+#                 Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+		   [m4_fatal([Libtool version $1 or higher is required],
+		             63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\	*)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+	[m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+	[tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+	   m4_quote(lt_decl_varnames),
+	m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+					   [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+	dnl If the libtool generation code has been placed in $CONFIG_LT,
+	dnl instead of duplicating it all over again into config.status,
+	dnl then we will have config.status run $CONFIG_LT later, so it
+	dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable.  If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins.  After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script.  The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_REPLACE_SHELLFNS
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],			[_LT_LANG(C)],
+  [C++],		[_LT_LANG(CXX)],
+  [Java],		[_LT_LANG(GCJ)],
+  [Fortran 77],		[_LT_LANG(F77)],
+  [Fortran],		[_LT_LANG(FC)],
+  [Windows Resource],	[_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi])
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+      [lt_cv_ld_exported_symbols_list],
+      [lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+	[lt_cv_ld_exported_symbols_list=yes],
+	[lt_cv_ld_exported_symbols_list=no])
+	LDFLAGS="$save_LDFLAGS"
+    ])
+    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+      [lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&AS_MESSAGE_LOG_FD
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  fi
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+  lt_aix_libpath_sed='[
+      /Import File Strings/,/^$/ {
+	  /^0/ {
+	      s/^0  *\([^ ]*\) *$/\1/
+	      p
+	  }
+      }]'
+  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi],[])
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+  fi
+  ])
+  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*" 
+}
+
+case "$ECHO" in
+  printf*) AC_MSG_RESULT([printf]) ;;
+  print*) AC_MSG_RESULT([print -r]) ;;
+  *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[  --with-sysroot[=DIR] Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted.  We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   AC_MSG_RESULT([${with_sysroot}])
+   AC_MSG_ERROR([The sysroot must be an absolute path.])
+   ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+  [lt_cv_ar_at_file=no
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+     [echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([lt_ar_try])
+      if test "$ac_status" -eq 0; then
+	# Ensure the archiver fails upon bogus file names.
+	rm -f conftest.$ac_objext libconftest.a
+	AC_TRY_EVAL([lt_ar_try])
+	if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+     ])
+  ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+  [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+	  [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+	[AC_CHECK_FUNC([dlopen],
+	      [lt_cv_dlopen="dlopen"],
+	  [AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+	    [AC_CHECK_LIB([svld], [dlopen],
+		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+	      [AC_CHECK_LIB([dld], [dld_link],
+		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+	  lt_cv_dlopen_self, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+	  lt_cv_dlopen_self_static, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+	 [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+	 [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+	 [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+	[Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+	[], [
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[[3-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+    [lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+	 [lt_cv_shlibpath_overrides_runpath=yes])])
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+    ])
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+    [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+  AC_SUBST([DUMPBIN])
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+    [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+  [lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+  esac
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+	[Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT@&t at _DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT@&t at _DLSYM_CONST
+#else
+# define LT@&t at _DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+	  cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT@&t at _DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_globsym_save_LIBS=$LIBS
+	  lt_globsym_save_CFLAGS=$CFLAGS
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS=$lt_globsym_save_LIBS
+	  CFLAGS=$lt_globsym_save_CFLAGS
+	else
+	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+    [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+	# This hack is so that the source file can tell whether it is being
+	# built for inclusion in a dll (and should export symbols for example).
+	m4_if([$1], [GCJ], [],
+	  [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  ecpc* )
+	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+	;;
+      nagfor*)
+	# NAG Fortran compiler
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ F* | *Sun*Fortran*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+	[Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+	[How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+	[Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  case $host_os in
+  aix[[4-9]]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+    ;;
+  cygwin* | mingw* | cegcc*)
+    case $cc_basename in
+    cl*) ;;
+    *)
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+      ;;
+    esac
+    ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+    ;;
+  esac
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+      _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    haiku*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=' $pic_flag'
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+	  tmp_sharedflag='--shared' ;;
+	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[[012]]|aix4.[[012]].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX([$1])
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 _LT_SYS_MODULE_PATH_AIX([$1])
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  fi
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+	# Native MSVC
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	_LT_TAGVAR(always_export_symbols, $1)=yes
+	_LT_TAGVAR(file_list_spec, $1)='@'
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	  else
+	    sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	  fi~
+	  $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	  linknames='
+	# The linker will not automatically build a static lib if we build a DLL.
+	# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+	# Don't use ranlib
+	_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+	_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+	  lt_tool_outputfile="@TOOL_OUTPUT@"~
+	  case $lt_outputfile in
+	    *.exe|*.EXE) ;;
+	    *)
+	      lt_outputfile="$lt_outputfile.exe"
+	      lt_tool_outputfile="$lt_tool_outputfile.exe"
+	      ;;
+	  esac~
+	  if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	    $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	    $RM "$lt_outputfile.manifest";
+	  fi'
+	;;
+      *)
+	# Assume MSVC wrapper
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Tell ltmain to make .lib files, not .a files.
+	libext=lib
+	# Tell ltmain to make .dll files, not .so files.
+	shrext_cmds=".dll"
+	# FIXME: Setting linknames here is a bad hack.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+	# The linker will automatically build a .lib file if we build a DLL.
+	_LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	# FIXME: Should let the user specify the lib program.
+	_LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+	_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	m4_if($1, [], [
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  _LT_LINKER_OPTION([if $CC understands -b],
+	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	*)
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+	# This should be the same for all languages, so no per-tag cache variable.
+	AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+	  [lt_cv_irix_exported_symbol],
+	  [save_LDFLAGS="$LDFLAGS"
+	   LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+	   AC_LINK_IFELSE(
+	     [AC_LANG_SOURCE(
+	        [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+			      [C++], [[int foo (void) { return 0; }]],
+			      [Fortran 77], [[
+      subroutine foo
+      end]],
+			      [Fortran], [[
+      subroutine foo
+      end]])])],
+	      [lt_cv_irix_exported_symbol=yes],
+	      [lt_cv_irix_exported_symbol=no])
+           LDFLAGS="$save_LDFLAGS"])
+	if test "$lt_cv_irix_exported_symbol" = yes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+	fi
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	     ;;
+	   *)
+	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+	[$RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+	  _LT_TAGVAR(allow_undefined_flag, $1)=
+	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+	  then
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	  else
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  fi
+	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+	])
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+    [Flag to hardcode $libdir into a binary during linking.
+    This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+    [[If ld is used when linking, flag to hardcode $libdir into a binary
+    during linking.  This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+    [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report which library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_CFLAGS=$CFLAGS
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
+	  fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
+	    else
+	      shared_flag='${wl}-bM:SRE'
+	    fi
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX([$1])
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    _LT_SYS_MODULE_PATH_AIX([$1])
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	    if test "$with_gnu_ld" = yes; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    fi
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+	case $GXX,$cc_basename in
+	,cl* | no,cl*)
+	  # Native MSVC
+	  # hardcode_libdir_flag_spec is actually meaningless, as there is
+	  # no search path for DLLs.
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  _LT_TAGVAR(always_export_symbols, $1)=yes
+	  _LT_TAGVAR(file_list_spec, $1)='@'
+	  # Tell ltmain to make .lib files, not .a files.
+	  libext=lib
+	  # Tell ltmain to make .dll files, not .so files.
+	  shrext_cmds=".dll"
+	  # FIXME: Setting linknames here is a bad hack.
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+	    else
+	      $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+	    fi~
+	    $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+	    linknames='
+	  # The linker will not automatically build a static lib if we build a DLL.
+	  # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+	  # Don't use ranlib
+	  _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+	  _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+	    lt_tool_outputfile="@TOOL_OUTPUT@"~
+	    case $lt_outputfile in
+	      *.exe|*.EXE) ;;
+	      *)
+		lt_outputfile="$lt_outputfile.exe"
+		lt_tool_outputfile="$lt_tool_outputfile.exe"
+		;;
+	    esac~
+	    func_to_tool_file "$lt_outputfile"~
+	    if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+	      $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+	      $RM "$lt_outputfile.manifest";
+	    fi'
+	  ;;
+	*)
+	  # g++
+	  # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+	  # as there is no search path for DLLs.
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  _LT_TAGVAR(always_export_symbols, $1)=no
+	  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+	  if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	    # If the export-symbols file already is a .def file (1st line
+	    # is EXPORTS), use it as is; otherwise, prepend...
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	      cp $export_symbols $output_objdir/$soname.def;
+	    else
+	      echo EXPORTS > $output_objdir/$soname.def;
+	      cat $export_symbols >> $output_objdir/$soname.def;
+	    fi~
+	    $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	  ;;
+	esac
+	;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      freebsd[[12]]*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      haiku*)
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
+	        case $host_cpu in
+	          hppa*64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	      else
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	      fi
+	    fi
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+	    ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+		$RANLIB $oldlib'
+	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 and above use weak symbols
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    ;;
+	  xl* | mpixl* | bgxl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='func_echo_all'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+	;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      openbsd*)
+	if test -f /usr/libexec/ld.so; then
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=func_echo_all
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+		;;
+	      *)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+		;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+	  *)
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	      case $host in
+	        osf3*)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	        *)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	    case $host_os in
+	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands `-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+	    output_verbose_link_cmd='func_echo_all'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # platform.
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      fi
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	      case $host_os in
+		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+		*)
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We can NOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+	_LT_TAGVAR(link_all_deplibs, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
+	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+	      '"$_LT_TAGVAR(reload_cmds, $1)"
+	    ;;
+	  *)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_LT_EOF
+])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+esac
+
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case ${prev}${p} in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+	 prev=$p
+	 continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test "$pre_test_object_deps_done" = no; then
+	 case ${prev} in
+	 -L | -R)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+	 fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+	   _LT_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+	   _LT_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${F77-"f77"}
+  CFLAGS=$FFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+  CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${FC-"f95"}
+  CFLAGS=$FCFLAGS
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([	 ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary parameter first.
+    func_stripname_result=${3}
+    func_stripname_result=${func_stripname_result#"${1}"}
+    func_stripname_result=${func_stripname_result%"${2}"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+    func_split_long_opt_name=${1%%=*}
+    func_split_long_opt_arg=${1#*=}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+    func_split_short_opt_arg=${1#??}
+    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+    case ${1} in
+      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+      *)    func_lo2o_result=${1} ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
+
+  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
+
+  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+    func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+         [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+         [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/libcdi/m4/ltoptions.m4 b/libcdi/m4/ltoptions.m4
new file mode 100644
index 0000000..17cfd51
--- /dev/null
+++ b/libcdi/m4/ltoptions.m4
@@ -0,0 +1,369 @@
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+#   Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+		      [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+  		   [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+	[Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+	[Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+	 [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+		 [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+		 [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+		 [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+		 [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+		 [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/libcdi/m4/ltsugar.m4 b/libcdi/m4/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/libcdi/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+	     [m4_foreach([_Lt_suffix],
+		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+		 [lt_append([$1], [$2], [$3])$4],
+		 [$5])],
+	  [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+	[$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/libcdi/m4/ltversion.m4 b/libcdi/m4/ltversion.m4
new file mode 100644
index 0000000..07a8602
--- /dev/null
+++ b/libcdi/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers			-*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# @configure_input@
+
+# serial 3337 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.4.2'
+macro_revision='1.3337'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/libcdi/m4/lt~obsolete.m4 b/libcdi/m4/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/libcdi/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
diff --git a/libcdi/m4/starlink_fpp.m4 b/libcdi/m4/starlink_fpp.m4
new file mode 100644
index 0000000..0d9e6df
--- /dev/null
+++ b/libcdi/m4/starlink_fpp.m4
@@ -0,0 +1,754 @@
+# This file is part of Autoconf.                       -*- Autoconf -*-
+# Fortran languages support.
+# Copyright (C) 2001, 2003-2005
+# Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+# 02111-1307, USA.
+#
+# As a special exception, the Free Software Foundation gives unlimited
+# permission to copy, distribute and modify the configure scripts that
+# are the output of Autoconf.  You need not follow the terms of the GNU
+# General Public License when using or distributing such scripts, even
+# though portions of the text of Autoconf appear in them.  The GNU
+# General Public License (GPL) does govern all other use of the material
+# that constitutes the Autoconf program.
+#
+# Certain portions of the Autoconf source text are designed to be copied
+# (in certain cases, depending on the input) into the output of
+# Autoconf.  We call these the "data" portions.  The rest of the Autoconf
+# source text consists of comments plus executable code that decides which
+# of the data portions to output in any given case.  We call these
+# comments and executable code the "non-data" portions.  Autoconf never
+# copies any of the non-data portions into its output.
+#
+# This special exception to the GPL applies to versions of Autoconf
+# released by the Free Software Foundation.  When you make and
+# distribute a modified version of Autoconf, you may extend this special
+# exception to the GPL to apply to your modified version as well, *unless*
+# your modified version has the potential to copy into its output some
+# of the text that was the non-data portion of the version that you started
+# with.  (In other words, unless your change moves or copies text from
+# the non-data portions to the data portions.)  If your modification has
+# such potential, you must delete any notice of this special exception
+# to the GPL from your modified version.
+#
+# Written by David MacKenzie, with help from
+# Franc,ois Pinard, Karl Berry, Richard Pixley, Ian Lance Taylor,
+# Roland McGrath, Noah Friedman, david d zuhn, and many others.
+#
+# Fortran preprocessing support written by Martin Wilck, adapted and
+# extended by Norman Gray and Toby White.
+#
+# Reduced to searching the Fortran preprocessor and flags for FC to
+# preprocess by Thomas Jahns, 2009
+
+
+## ------------------------------- ##
+## Preprocessor features           ##
+## ------------------------------- ##
+#
+# Supported features are:
+#
+# include   : correctly process #include directives and -I
+# define    : correctly process -D
+# substitute: substitute macros in Fortran code
+#             (some preprocessors touch only lines starting with #)
+# wrap      : wrap lines that become too long through macro substitution
+#             fpp is probably the only preprocessor that does this.
+# cstyle    : Do not suppress C style comments (-C option in cpp)
+# CSTYLE    : *Do* suppress C style comments
+#             (e.g. code contains C-style comments, and compiler may not
+#             know how to handle them)
+# cxxstyle  : Do not suppress C++ style comments (default)
+# CXXSTYLE  : *Do* suppress C++ style comments (seems unlikely, but in here
+#             for completeness)
+#
+# Features can be abbreviated: i, in, inc etc. are equivalent to include.
+# Features can be deselected (feature not needed) by prepending "no",
+#   e.g. nodef (=nodefine), now (=nowrap).
+#
+# Default for the feature list is
+#       [include define substitute nowrap nocstyle noCSTYLE cxxstyle]
+# Feature requirements corresponding to the defaults may be omitted
+#
+# Note that "wrap" implies "substitute", and CSTYLE and cstyle cannot
+# be requested at the same time. The macro adjusts this automatically.
+#
+
+# -------------------------------------- #
+# Feature tests for Preprocessed Fortran #
+# -------------------------------------- #
+
+# ------------------#
+#   Internal macros #
+# ------------------#
+
+# ----------------------------------------------#
+#     Some test programs for different features #
+# ----------------------------------------------#
+
+# _AC_LANG_PROGRAM_FPP_SIMPLE
+# ---------------------------
+# The minimum test program - any compiler supporting
+# preprocessing should handle this
+AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_SIMPLE],
+         [AC_LANG_PROGRAM(,[@%:@define OK
+@%:@ifndef OK
+      syntax error
+@%:@endif
+])])#_ACX_SL_LANG_PROGRAM_FPP_SIMPLE
+
+
+# _ACX_SL_LANG_PROGRAM_FPP_ONLY
+# ---------------------------
+# Test program for pure preprocessing
+# Note that other macros test for literal strings within this, so check
+# for those if you have to change anything here.
+AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_ONLY],
+         [AC_LANG_PROGRAM(,[@%:@define OK
+@%:@ifdef OK
+      REAL A
+@%:@else
+      syntax error
+@%:@endif
+])])#_ACX_SL_LANG_PROGRAM_FPP_ONLY
+
+
+# _ACX_SL_LANG_PROGRAM_FPP_D
+# ---------------------------
+# Like _ACX_SL_LANG_PROGRAM_FPP_SIMPLE, but OK is passed via -D switch
+AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_D],
+[AC_LANG_PROGRAM([],[
+@%:@ifndef OK
+      syntax error
+@%:@endif
+])])#_ACX_SL_LANG_PROGRAM_FPP_D
+
+
+# _ACX_SL_LANG_PROGRAM_FPP_I
+# ---------------------------
+# Test for #include statement
+# If unsupported, this should give a type error
+AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_I],
+[AC_LANG_PROGRAM([],[
+      IMPLICIT CHARACTER (c)
+!     Comments in test programs should be freeform compliant just in case.
+!     conftest.inc contains the Fortran statement "REAL cc"
+@%:@include "conftest.inc"
+      cc=1.
+])])#_ACX_SL_LANG_PROGRAM_FPP_I
+
+
+# _ACX_SL_LANG_PROGRAM_FPP_SUBS
+# ---------------------------
+# Test whether cpp symbols are expanded in Fortran code lines
+# If not, this should give a type error
+AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_SUBS],
+[AC_LANG_PROGRAM(,[
+@%:@define NM xxxx
+      IMPLICIT CHARACTER (n)
+      REAL xxxx
+      NM=1.
+])])#_ACX_SL_LANG_PROGRAM_FPP_SUBS
+
+
+# _ACX_SL_LANG_PROGRAM_FPP_WRAP
+# ---------------------------
+# Test whether preprocessor breaks lines that become too long due
+# to macro substitution.
+# If not, this gives an "unterminated character constant" error
+AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_WRAP],
+[AC_LANG_PROGRAM(,[
+@%:@define LONG '901234567890123456789012345678901234567890123456789012345678901234567890'
+      CHARACTER*80 A
+      A=LONG
+])])#_ACX_SL_LANG_PROGRAM_FPP_WRAP
+
+
+# _ACX_SL_LANG_PROGRAM_FPP_CSTYLE
+# ---------------------------
+# Test program for C style comments
+AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_CSTYLE],
+[AC_LANG_PROGRAM(,[
+      A=1. /* C-style comment */
+])])#_ACX_SL_LANG_PROGRAM_FPP_CSTYLE
+
+# _ACX_SL_LANG_PROGRAM_FPP_CXXSTYLE
+# ---------------------------
+# Test program for C++ style comments
+AC_DEFUN([_ACX_SL_LANG_PROGRAM_FPP_CXXSTYLE],
+[AC_LANG_SOURCE([dnl
+      PROGRAM MAIN
+      CHARACTER*10 C
+      C = "abcde" // "fghij"; END PROGRAM
+])
+])#_ACX_SL_LANG_PROGRAM_FPP_CXXSTYLE
+
+# _ACX_SL_SET_FPP_FEATURE_VARS ([feature list])
+# --------------------------------------
+# Parse the feature list from configure.in
+AC_DEFUN([_ACX_SL_SET_FPP_FEATURE_VARS],
+  [# defaults for needed features
+   ac_fpp_need_d=yes
+   ac_fpp_need_i=yes
+   ac_fpp_need_subs=no
+   ac_fpp_need_wrap=no
+   ac_fpp_need_cstyle=no
+   ac_fpp_need_CSTYLE=no
+   ac_fpp_need_cxxstyle=yes
+   ac_fpp_need_CXXSTYLE=no
+   dnl FIXME: this should be feasable within m4 constructs, i.e. without
+   dnl using shell loops
+   for _t in $1 nil
+   do
+     AS_CASE([$_t],
+       [define], [ac_fpp_need_d=yes],
+       [nodefine], [ac_fpp_need_d=no],
+       [include], [ac_fpp_need_i=yes],
+       [noinclude], [ac_fpp_need_i=no],
+       [substitute], [ac_fpp_need_subs=yes],
+       [nosubstitute], [ac_fpp_need_subs=no],
+       [wrap], [ac_fpp_need_wrap=yes],
+       [nowwrap], [ac_fpp_need_wrap=no],
+       [cstyle], [ac_fpp_need_cstyle=yes],
+       [nocstyle], [ac_fpp_need_cstyle=no],
+       [CSTYLE], [ac_fpp_need_CSTYLE=yes],
+       [noCSTYLE], [ac_fpp_need_CSTYLE=no],
+       [cxxstyle], [ac_fpp_need_cxxstyle=yes],
+       [nocxxstyle], [ac_fpp_need_cxxstyle=no],
+       [CXXSTYLE], [ac_fpp_need_CXXSTYLE=yes],
+       [noCXXSTYLE], [ac_fpp_need_CXXSTYLE=no],
+       [nil], [])
+   done
+   # Wrapping requires substitution
+   test $ac_fpp_need_wrap = yes && ac_fpp_need_subs=yes
+   # CSTYLE and cstyle are mutually exclusive.
+   # CSTYLE takes precedence, since if it is not fulfilled,
+   # compile errors may arise
+   test $ac_fpp_need_CSTYLE = yes && ac_fpp_need_cstyle=no
+   dnl Similarly for cxxstyle
+   test $ac_fpp_need_CXXSTYLE = yes && ac_fpp_need_cxxstyle=no
+  ])# _ACX_SL_SET_FPP_FEATURE_VARS
+
+
+# _ACX_SL_TEST_FPP(COMMAND,SUFFIX,[ACTION-IF-SUCCESSFULL],[ACTION-IF-FAILED])
+# ------------------------
+# A helper macro to test correct fpp behaviour
+# Invokes COMMAND <FILE_ONLY_COMPILABLE_WHEN_PREPROC_RUN>
+# If the output on stdout is valid input to the Fortran compiler, it sets
+#  * acx_sl_prog_fpp
+#  * acx_sl_prog_fpp_suffix
+# accordingly.
+AC_DEFUN([_ACX_SL_TEST_FPP],
+  [rm -f conftest*
+   ACX_ASSERT_LANG_IS_FORTRAN_VARIANT
+   AC_LANG_CONFTEST([_ACX_SL_LANG_PROGRAM_FPP_ONLY])
+   ac_tmp=conftest.fppout
+   AS_IF([_AC_RUN_LOG([$1 conftest.$2 >$ac_tmp],dnl
+       [_AC_DO_ECHO([$1 $FPPFLAGS conftest.$2 >$ac_tmp])])],
+     [AS_IF([test -f $ac_tmp \
+        && ! cmp conftest.$2 $ac_tmp >/dev/null 2>&1 \
+        && grep '^      REAL A' $ac_tmp >/dev/null 2>&1 \
+        && ! grep 'syntax error' $ac_tmp >/dev/null 2>&1],
+        [# we have Fortran!  See if the file can be compiled:
+         mv $ac_tmp conftest.$ac_ext
+         AC_COMPILE_IFELSE(, [_AC_MSG_LOG_CONFTEST
+            $3],dnl
+           [_AC_MSG_LOG_CONFTEST
+            $4])],dnl
+        [mv $ac_tmp conftest.$ac_ext
+         _AC_MSG_LOG_CONFTEST
+         $4])])
+dnl Preprocessing might fail for one of the following reasons:
+dnl * no output was produced (disk full?),
+dnl * FPP input and output have the same content,
+dnl * the output did not contain the critical part of the source file
+dnl * some syntax error crept into the output
+dnl indicating that this is a case-insensitive filesystem or
+dnl preprocessing failed. So this command doesn't work.
+   rm -f conftest*
+])# _ACX_SL_TEST_FPP
+
+# _ACX_SL_PROG_FPP([SUFFIX], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+# ------------
+# Try to figure out how to preprocess files with the given suffix
+# for use with the selected Fortran compiler
+#
+# Must be run after _ACX_SL_PROG_FC_CPP
+AC_DEFUN([_ACX_SL_PROG_FPP],dnl
+  [acx_sl_fpp_srcext=m4_default([$1],[${ac_fc_srcext-F}])
+   AS_VAR_PUSHDEF([acx_sl_prog_fpp],dnl
+     [acx_sl_cv_prog_fpp_]_AC_LANG_ABBREV[_]m4_default([$1],[${ac_fc_srcext-f}]))
+   AC_CACHE_CHECK([how to preprocess Fortran files with suffix $acx_sl_fpp_srcext],dnl
+[acx_sl_prog_fpp],
+     [AS_VAR_SET([acx_sl_prog_fpp], [])
+      # Let the user specify FPP
+      AS_IF([test -n "$FPP"],
+        [_ACX_SL_TEST_FPP([$FPP],[$acx_sl_fpp_srcext],dnl
+           [AS_VAR_SET([acx_sl_prog_fpp], ["$FPP"])],
+           [AC_MSG_WARN([user-specified \$FPP ($FPP) does not work])
+            FPP=])])
+      AS_IF([test -z "$FPP"],
+        [for ac_fpp in `cd $srcdir ; pwd`/util/sxpreproc-wrapper \
+           `cd $srcdir ; pwd`/util/xlfpreproc-wrapper \
+           `cd $srcdir ; pwd`/util/sunf95preproc-wrapper \
+           "$FC -F" "$FC -F -fpp" "$FC -E" "$FC -E" "$FC -E -cpp" \
+           "$FC $FCFLAGS -F" "$FC $FCFLAGS -E" "$FC $FCFLAGS -E" \
+           "$FC $FCFLAGS -E -cpp" "$FC $FCFLAGS -x f95-cpp-input -E -P" \
+           "${F77-f77} -F" "${F77-f77} -E" 'fpp' \
+           "$CPP" "$CPP -x c" 'cpp' '/lib/cpp' \
+           '/usr/ccs/lib/cpp' 'g77 -E' '${CC-cc} -E'
+         do
+           _ACX_SL_TEST_FPP([$ac_fpp],[$acx_sl_fpp_srcext],[FPP="$ac_fpp"
+              break])
+           _ACX_SL_TEST_FPP([$ac_fpp -P],[$acx_sl_fpp_srcext],dnl
+             [FPP="$ac_fpp -P"
+              break])
+         done])
+      AS_IF([test -z "$FPP"], [$3],
+        [AS_VAR_SET([acx_sl_prog_fpp], [$FPP])])])
+   AS_VAR_PUSHDEF([acx_sl_prog_fpp])
+])# _ACX_SL_PROG_FPP
+
+
+
+# _ACX_SL_PROG_FPP_CSTYLE
+# -------------------
+# Check whether FPP lets C-style comments through to FC
+AC_DEFUN([_ACX_SL_PROG_FPP_CSTYLE],
+[AC_CACHE_CHECK([how to pass C-style comments to $FC],
+   ac_cv_prog_fpp_cstyle,
+[ac_cv_prog_fpp_cstyle=unknown
+ACX_ASSERT_LANG_IS_FORTRAN_VARIANT
+cat > conftest.$ac_ext << \_ACEOF
+_ACX_SL_LANG_PROGRAM_FPP_CSTYLE
+_ACEOF
+
+AC_LANG_PUSH(Fortran)
+ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_fpp_out"
+AS_IF([AC_TRY_EVAL(ac_cmd) && \
+   cat conftest.f | grep '[[*]]/.*[[*]]/' >/dev/null 2>&1],
+   [ac_cv_prog_fpp_cstyle=],
+   [ac_save_FPPFLAGS=$FPPFLAGS
+    ac_name=`expr "x$FPP" : 'x\(fpp\)'`
+    AS_IF([test "x$ac_name" = xfpp],
+      [ac_flag="-c_com=no"],
+      [ac_flag="-C"])
+   FPPFLAGS="$FPPFLAGS $ac_flag"
+   ac_cmd='$FPP $FPPFLAGS conftest.$ac_ext '"$ac_fpp_out"
+   AS_IF([AC_TRY_EVAL(ac_cmd) && \
+     cat conftest.f | grep '/[[*]].*[[*]]/' >/dev/null 2>&1],
+     [ac_cv_prog_fpp_cstyle=$ac_flag])
+   FPPFLAGS=$ac_save_FPPFLAGS])
+rm -f conftest*
+AC_LANG_POP(Fortran)dnl
+])
+if test "x$ac_cv_prog_fpp_cstyle" = "xunknown"; then
+  AC_MSG_WARN([cannot find a way to make $FPP pass C-style comments])
+else
+  FPPFLAGS="$FPPFLAGS $ac_cv_prog_fpp_cstyle"
+fi
+])# _ACX_SL_PROG_FPP_CSTYLE
+
+# _ACX_CHECK_FPP_COMPILE([EXTRA-FLAGS], direct|indirect,
+#    [ACTION-IF-COMPILABLE],[ACTION-IF-NOT-COMPILABLE])
+# helper macro to run the preprocessor or compile directly
+# with preprocessor flags
+m4_define([_ACX_FPP_COMPILE_IFELSE],dnl
+  [m4_if([$2],[direct],dnl
+     [cp conftest.$acx_sl_fpp_srcext conftest.${ac_ext}.tmp],dnl
+     [_AC_RUN_LOG([$FPP $FPPFLAGS m4_ifval([$1],[$1 ])conftest.$acx_sl_fpp_srcext \
+        >conftest.${ac_ext}.tmp],
+        [echo Running preprocessor $FPP $FPPFLAGS m4_ifval([$1],[$1 ])conftest.$acx_sl_fpp_srcext])])
+   m4_if([$2],[direct], [FCFLAGS="$FPPFLAGS $1 $ac_save_FCFLAGS"])
+   mv conftest.${ac_ext}.tmp conftest.${ac_ext}
+   AC_COMPILE_IFELSE(,[$3],[$4])])
+
+# ACX_SL_PROG_FC_FPP_FEATURES(FEATURES,METHOD,[SUFFIX],
+#  [ACTION-IF-SUCCESS],[ACTION-IF-FAILURE])
+# ---------------
+# This macro checks whether the chosen preprocessing method
+# has all the requested features.
+#
+# This macro must be called with METHOD set to either
+# direct or indirect; it behaves differently accordingly.
+#
+# In case one of the checks fails, ACTION-IF-FAILED will be called.
+#
+#FIXME: this is only for fixed form code. Need a separate check for free-form.
+#
+# NB We are definitely using a suffix of .F in this case. If the filesystem
+# is case-insensitive, we may need to force preprocessing.
+#
+# Sets ac_fpp_ok to "no" if a requested feature is unavailable
+#
+AC_DEFUN([ACX_SL_PROG_FC_FPP_FEATURES],
+  [AS_VAR_PUSHDEF([acx_sl_fpp_ok], [acx_sl_cv_]_AC_LANG_ABBREV[_$2_ok])
+   AC_CACHE_CHECK([if ]m4_case([$2],[direct],[compilation with $FC],dnl
+[indirect],[preprocessing with $FPP],dnl
+[m4_fatal([$0: only direct or indirect method supported: ']$2['])])[ of Fortran source supports required preprocessor features],dnl
+[acx_sl_fpp_ok],dnl
+     [AS_VAR_SET([acx_sl_fpp_ok], [yes])
+      # Set up ac_fpp_need_* flags based on features in $1
+      acx_sl_fpp_srcext=m4_default([$3],[${ac_fc_srcext-F}])
+      _ACX_SL_SET_FPP_FEATURE_VARS([$1])
+
+      acx_sl_prog_fc_cpp_CSTYLE=no
+      acx_sl_prog_fc_cpp_cxxstyle=no
+
+      ACX_ASSERT_LANG_IS_FORTRAN_VARIANT
+      ac_save_FCFLAGS=$FCFLAGS
+
+      m4_case([$2],[direct],[],[indirect],[],dnl
+         [m4_fatal([$0: only direct or indirect method supported: ] $2)])
+
+      # We need to skip the following tests if we're trying direct compilation
+      # and FC won't preprocess.
+      AS_IF([test x$ac_fpp_need_d = xyes],
+        [acx_sl_prog_fc_cpp_d=no
+         _AS_ECHO_LOG([Trying flag to create preprocessor defines.])
+         ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext],dnl
+           [_ACX_SL_LANG_PROGRAM_FPP_D])
+         # Normally we expect to be able to define preprocessor macros
+         # with -D, but this might be IBM xlf compiler, which needs
+         # -WF,-D or Fujitsu VPP700 which needs -Wp,-D
+         mv conftest.$acx_sl_fpp_srcext conftest.${acx_sl_fpp_srcext}.bak
+         for FPP_DEFOPT in "$FPP_DEFOPT" '-D' '-WF,-D' '-Wp,-D'
+         do
+           AS_IF([test x"$FPP_DEFOPT" != x ],
+             [cp conftest.${acx_sl_fpp_srcext}.bak conftest.$acx_sl_fpp_srcext
+              _ACX_FPP_COMPILE_IFELSE([${FPP_DEFOPT}OK],[$2],dnl
+                [acx_sl_prog_fc_cpp_d=yes; break])])
+         done
+         FCFLAGS=$ac_save_FCFLAGS
+         AS_IF([test $acx_sl_prog_fc_cpp_d = no],
+           [AS_VAR_SET([acx_sl_fpp_ok], [no])])
+         AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes],
+           [_AS_ECHO_LOG([Test successful.])],
+           [_AS_ECHO_LOG([Test failed.])])
+        ])
+
+      AS_IF([test $ac_fpp_need_i = yes],
+        [acx_sl_prog_fc_cpp_i=no
+         _AS_ECHO_LOG([Trying flag to add directories to preprocessor search path.])
+         mkdir conftst
+         cd conftst
+         ACX_LANG_OTHER_SUFFIX_CONFTEST([inc],dnl
+           [AC_LANG_SOURCE([!     This statement overrides the IMPLICIT statement in the program
+         REAL cc
+])])
+         cd ..
+         ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext],[_ACX_SL_LANG_PROGRAM_FPP_I])
+         mv conftest.$acx_sl_fpp_srcext conftest.${acx_sl_fpp_srcext}.bak
+         for FPP_INCOPT in "$FPP_INCOPT" '-I' '-WF,-I' '-Wp,-I'
+         do
+           AS_IF([test x"$FPP_INCOPT" != x ],
+             [cp conftest.${acx_sl_fpp_srcext}.bak conftest.$acx_sl_fpp_srcext
+              _ACX_FPP_COMPILE_IFELSE([${FPP_INCOPT}conftst],[$2],dnl
+                [acx_sl_prog_fc_cpp_i=yes
+                 break])])
+         done
+         FCFLAGS=$ac_save_FCFLAGS
+         rm -rf conftst
+         AS_IF([test $acx_sl_prog_fc_cpp_i = no],
+           [AS_VAR_SET([acx_sl_fpp_ok], [no])])
+         AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes],
+           [_AS_ECHO_LOG([Test successful.])],
+           [_AS_ECHO_LOG([Test failed.])])])
+dnl
+dnl
+      AS_IF([test $ac_fpp_need_subs = yes],
+        [acx_sl_prog_fc_cpp_subs=no
+         _AS_ECHO_LOG([Testing preprocessor expansion in Fortran code.])
+         ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext],
+           [_ACX_SL_LANG_PROGRAM_FPP_SUBS])
+         _ACX_FPP_COMPILE_IFELSE(,[$2],dnl
+           [acx_sl_prog_fc_cpp_subs=yes],[AS_VAR_SET([acx_sl_fpp_ok], [no])])
+         AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes],
+           [_AS_ECHO_LOG([Test successful.])],
+           [_AS_ECHO_LOG([Test failed.])])
+        ])
+dnl
+dnl
+      AS_IF([test $ac_fpp_need_wrap = yes],
+        [acx_sl_prog_fc_cpp_wrap=no
+         _AS_ECHO_LOG([Testing wether preprocessor wraps long lines.])
+         ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext],dnl
+           [_ACX_SL_LANG_PROGRAM_FPP_WRAP])
+         _ACX_FPP_COMPILE_IFELSE(,[$2],dnl
+           [acx_sl_prog_fc_cpp_wrap=yes], [AS_VAR_SET([acx_sl_fpp_ok], [no])])
+         AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes],
+           [_AS_ECHO_LOG([Test successful.])],
+           [_AS_ECHO_LOG([Test failed.])])
+        ])
+dnl
+dnl
+      AS_IF([test $ac_fpp_need_CSTYLE = yes],
+        [_AS_ECHO_LOG([Testing wether preprocessor removes C-style comments.])
+         ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext],dnl
+           [_ACX_SL_LANG_PROGRAM_FPP_CSTYLE])
+         _ACX_FPP_COMPILE_IFELSE(,[$2],dnl
+           [acx_sl_prog_fc_cpp_CSTYLE=yes], [AS_VAR_SET([acx_sl_fpp_ok], [no])])
+         AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes],
+           [_AS_ECHO_LOG([Test successful.])],
+           [_AS_ECHO_LOG([Test failed.])])
+        ])
+dnl
+      AS_IF([test $ac_fpp_need_cstyle = yes],
+        [_AS_ECHO_LOG([Testing wether preprocessor leaves C-style comments in place.])
+         ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext],dnl
+           [_ACX_SL_LANG_PROGRAM_FPP_CSTYLE])
+         _ACX_FPP_COMPILE_IFELSE(,[$2],dnl
+           [acx_sl_prog_fc_cpp_CSTYLE=yes], [AS_VAR_SET([acx_sl_fpp_ok], [no])])
+         AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes],
+           [_AS_ECHO_LOG([Test failed.])],
+           [_AS_ECHO_LOG([Test successful.])])
+        ])
+dnl
+      AS_IF([test $ac_fpp_need_cxxstyle = yes],
+        [_AS_ECHO_LOG([Testing if preprocessor leaves C++-style comments in place.])
+         ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext],dnl
+           [_ACX_SL_LANG_PROGRAM_FPP_CXXSTYLE])
+         _ACX_FPP_COMPILE_IFELSE(,[$2],dnl
+           [acx_sl_prog_fc_cpp_cxxstyle=yes],[AS_VAR_SET([acx_sl_fpp_ok], [no])])
+         AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes],
+           [_AS_ECHO_LOG([Test successful.])],
+           [_AS_ECHO_LOG([Test failed.])])
+        ])
+dnl
+      AS_IF([test $ac_fpp_need_CXXSTYLE = yes],
+        [_AS_ECHO_LOG([Testing if preprocessor suppresses C++-style comments.])
+         ACX_LANG_OTHER_SUFFIX_CONFTEST([$acx_sl_fpp_srcext],dnl
+           [_ACX_SL_LANG_PROGRAM_FPP_CXXSTYLE])
+         _ACX_FPP_COMPILE_IFELSE(,[$2],dnl
+           [acx_sl_prog_fc_cpp_cxxstyle=yes],dnl
+           [AS_VAR_SET([acx_sl_fpp_ok], [no])])
+         AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes],
+           [_AS_ECHO_LOG([Test failed.])],
+           [_AS_ECHO_LOG([Test successful.])])
+        ])
+dnl
+      FCFLAGS=$ac_save_FCFLAGS
+      rm -f conftest.*
+      AS_IF([test x[]AS_VAR_GET([acx_sl_fpp_ok]) = xyes],[$4],[$5])
+     ])
+   #FIXME we should probably do the AC_SUBST somewhere else.
+   AC_SUBST([FPP_DEFOPT])
+   AC_SUBST([FPP_INCOPT])
+   AS_VAR_POPDEF([acx_sl_fpp_ok])
+ ])#ACX_SL_PROG_FC_FPP_FEATURES
+
+
+
+# _ACX_SL_FC_CHECK_CIFS
+# -----------------
+# Check whether the filesystem is case-insensitive (eg, HFS+ on
+# MacOS X).  Set ac_cv_fc_cifs=yes if so.
+AC_DEFUN([_ACX_SL_FC_CHECK_CIFS],
+   [AC_CACHE_CHECK([whether the filesystem is case-insensitive],
+       [ac_cv_fc_cifs],
+       [rm -f conftest.*
+        echo wibble >conftest.F
+        AS_IF([test -f conftest.f && test "`cat conftest.f`" = wibble],
+          [ac_cv_fc_cifs=yes], [ac_cv_fc_cifs=no])
+])])# _ACX_SL_FC_CHECK_CIFS
+
+
+
+# -----------------------
+# User macros
+# -----------------------
+
+# AC_PROG_FPP([required features], [SUFFIX])
+# --------------------------------------------------
+#
+# [required features] is a space-separated list of features that the Fortran
+# preprocessor must have for the code to compile.
+# It is up to the package maintainer to properly set these requirements.
+#
+# If SUFFIX is set it's assumed that files for the preprocessor have
+# this suffix, otherwise .F is assumed. The output of the preprocessor
+# is placed in files with the extension .f or whatever was last setup
+# with AC_FC_SRCEXT.
+#
+# This macro will find out how to compile a preprocessable fixed-form
+# file, with a .SUFFIX file extension. The type of Fortran code used
+# for tests will be determined by the currently selected AC_LANG
+# (Fortran or Fortran 77 at the time of this writing)
+#
+# See the section Preprocessor features for discussion of individual
+# features.
+#
+# This macro sets and substitutes the variables FPP and FPPFLAGS.
+#
+# The macro depends on both FC and CPP, because we must possibly fall
+# back on CPP for preprocessing.
+#
+AC_DEFUN([AC_PROG_FPP],
+  [AC_REQUIRE([AC_PROG_FC])dnl
+dnl We are not going to use AC_REQUIRE(AC_PROG_CPP) here for
+dnl two reasons:
+dnl 1. we don't really need to if FC will preprocess itself
+dnl 2. we can't pass in an optional parameter to change the
+dnl    default CPP search order, which we need to.
+dnl AC_REQUIRE([AC_PROG_CPP([cpp])])dnl
+
+   # Prefer AC_PROG_FC to AC_PROG_F77
+   export FC FCFLAGS
+   AS_IF([test "X$F77" != X],
+     [AC_MSG_WARN([Use A@&t at C_PROG_FC with A@&t at C_PROG_FPP, instead of A@&t at C_PROG_F77])])
+
+
+   AC_ARG_VAR([FPP], [Command to preprocess Fortran code])
+   AC_ARG_VAR([FPPFLAGS], [Flags for the Fortran preprocessor])
+
+   _ACX_SL_PROG_FPP([$2])
+
+   # ACX_SL_PROG_FC_FPP_FEATURES does the actual feature tests,
+   # storing results of the checks in non-cv variables like
+   # ac_prog_fc_cpp_*, which we copy to cv variables afterwards.  This
+   # allows this macro to be reusable for other cv variables (see
+   # below)
+   ACX_SL_PROG_FC_FPP_FEATURES([$1],[indirect],[$2],,dnl
+      [AC_MSG_FAILURE([required Fortran preprocessor not available])])
+  ])# AC_PROG_FPP
+
+#
+# ACX_FC_INTEGRAL_FPP(FEATURES,[SUFFIX],[ACTION-IF-TRUE],[ACTION-IF-NOT])
+# Determines wether $FC can process files containing preprocessor directives
+# and processes each of the requested features correctly
+# and run the according ACTION-*.
+AC_DEFUN([ACX_FC_INTEGRAL_FPP],
+  [# On nearly all systems where direct compilation is possible, a
+   # .F file containing preprocessable fixed-form will be compiled
+   # and preprocessed automatically. However, case-insensitive
+   # filesystems (eg HFS+ on MacOSX) may get confused.  Therefore,
+   # we must check for cpp flags.
+   AC_ARG_VAR([FPPFLAGS], [Flags for the Fortran preprocessor])
+   acx_sl_prog_fc_cpp=no
+   AC_COMPILE_IFELSE([AC_LANG_PP_MANDATORY_SOURCE],
+     [acx_sl_prog_fc_cpp=yes], [AS_VAR_SET([acx_sl_fpp_ok], [no])])
+   # It is possible we've failed the previous test because of a
+   # Tru64 bug where the compiler fails when called as 'f95' on
+   # a .F file. It works when called as f90.
+   #FIXME: this does not protect the user's setting of FC, though
+   # we set it back if sensible.
+   AS_IF([test x$acx_sl_prog_fc_cpp = xno && test $FC = f95],
+     [FC=f90
+      AC_LINK_IFELSE([AC_LANG_PP_MANDATORY_SOURCE],
+        [acx_sl_prog_fc_cpp=yes],[FC=f95
+         AS_VAR_SET([acx_sl_fpp_ok], [no])])
+     ])
+   ACX_SL_PROG_FC_FPP_FEATURES([$1],[indirect],[$2],,dnl
+      [AC_MSG_FAILURE([required Fortran preprocessor not available])])
+   ac_first_save_FPPFLAGS=$FPPFLAGS
+   FPPFLAGS="$FPPFLAGS $FPPFLAGS_F"
+   # Don't need to test if $FC removes C++ comments - that
+   # way madness lies.
+   ACX_SL_PROG_FC_FPP_FEATURES([$1],[direct],[$2],[$3],[$4])
+])
+
+AC_DEFUN([_ACX_CHOOSE_FPP_BUILD_RULE],
+ [# If so, we don't need to go any further.
+if test x$acx_sl_fpp_ok = xyes; then
+  ac_cv_fpp_build_rule=direct
+  AC_MSG_RESULT([direct])
+else
+# indirect compilation
+  AC_MSG_RESULT([indirect])
+
+# Before we go any further, check that we're not courting disaster,
+# here, by using indirect compilation (.F -> .f -> .o) on a
+# case-insensitive filesystem.  If we are, there's nothing we can do
+# other than fail noisily.
+_ACX_SL_FC_CHECK_CIFS
+if test $ac_cv_fc_cifs = yes; then
+    AC_MSG_ERROR([disaster: this Fortran needs indirect compilation, but we
+ have a case-insensitive filesystem, so .F -> .f would fail; further compilation isn't going to work -- consider filing a bug])
+fi
+
+# Now we check how to invoke a preprocessor that outputs Fortran code
+# that FC can understand
+#FIXME: in a joint C/Fortran project, CPP might have already
+# been defined. Here we are potentially (probably) redefining it.
+# I don't think this matters. Not sure, though.
+# In that case, AC_SUBST has already been called on CPP.
+# We don't want to fail if we can't find cpp - we might be able
+# to fall back on fpp.
+#FIXME: actually, we should just prefer cpp to $CPP
+# The next macro sets FPP (unless already set by the user)
+_ACX_SL_PROG_FPP
+
+# Redefine the compile and link commands for indirect compilation
+  ac_fpp_compile='${FPP-fpp} $FPPFLAGS $FPPFLAGS_SRCEXT conftest.$ac_ext '"$ac_fpp_out"' && ${FC-fc} -c $FCFLAGS conftest.f >&AS_MESSAGE_LOG_FD'
+  ac_fpp_link='${FPP-fpp} $FPPFLAGS conftest.$ac_ext $FPPFLAGS_SRCEXT '"$ac_fpp_out"' && ${FC-fc} -o conftest${ac_exeext} $FCFLAGS $LDFLAGS conftest.f $LIBS >&AS_MESSAGE_LOG_FD'
+
+  ac_compile=$ac_fpp_compile
+  ac_link=$ac_fpp_link
+# Redo all the feature checks for indirect compilation.
+
+  ACX_SL_PROG_FC_FPP_FEATURES([$1], [indirect],
+     ,[AC_MSG_FAILURE([required fortran preprocessor not available])])
+
+if test $ac_fpp_need_d = yes; then
+  AC_CACHE_CHECK([whether $FPP accepts -D],
+     ac_cv_prog_fpp_d,
+    [ac_cv_prog_fpp_d=$ac_prog_fc_cpp_d])
+fi
+
+if test $ac_fpp_need_i = yes; then
+  AC_CACHE_CHECK([whether $FPP accepts -I],
+     ac_cv_prog_fpp_i,
+    [ac_cv_prog_fpp_i=$ac_prog_fc_cpp_i])
+fi
+
+if test $ac_fpp_need_subs = yes; then
+  AC_CACHE_CHECK([whether $FPP substitutes macros in Fortran code],
+     ac_cv_prog_fpp_subs,
+    [ac_cv_prog_fpp_subs=$ac_prog_fc_cpp_subs])
+fi
+
+if test $ac_fpp_need_wrap = yes; then
+  AC_CACHE_CHECK([whether $FPP wraps long lines automatically],
+     ac_cv_prog_fpp_wrap,
+    [ac_cv_prog_fpp_wrap=$ac_prog_fc_cpp_wrap])
+fi
+
+if test $ac_fpp_need_CSTYLE = yes; then
+  AC_CACHE_CHECK([whether $FPP suppresses C-style comments],
+     ac_cv_prog_fpp_CSTYLE,
+    [ac_cv_prog_fpp_CSTYLE=$ac_prog_fc_cpp_CSTYLE])
+
+elif test $ac_fpp_need_cstyle = yes; then
+# It only makes sense to test this for indirect compilation,
+# i.e., if .f files are generated
+    _ACX_SL_PROG_FPP_CSTYLE
+fi
+
+if test $ac_fpp_need_cxxstyle = yes; then
+  AC_CACHE_CHECK([whether $FPP preserves C++-style comments],
+     ac_cv_prog_fpp_cxxstyle,
+    [ac_cv_prog_fpp_cxxstyle=$ac_prog_fc_cpp_cxxstyle])
+fi
+
+AC_CACHE_CHECK([whether $FPP fulfils requested features],
+  ac_cv_prog_fpp_ok,
+  [ac_cv_prog_fpp_ok=AS_VAR_GET([acx_sl_fpp_ok])])
+
+  ac_cv_fpp_build_rule=indirect
+
+fi # test acx_sl_fpp_ok != yes
+])
diff --git a/libcdi/src/Makefile.am b/libcdi/src/Makefile.am
new file mode 100644
index 0000000..b2cc5ff
--- /dev/null
+++ b/libcdi/src/Makefile.am
@@ -0,0 +1,178 @@
+## Process this file with automake to produce Makefile.in
+#
+EXTRA_DIST = cdilib.c mo_cdi.f90
+
+if ENABLE_CDI_LIB
+  lib_LTLIBRARIES = libcdi.la
+  include_HEADERS = cdi.h cdi.inc
+else
+  noinst_LTLIBRARIES = libcdi.la
+endif
+
+
+libcdi_la_SOURCES = 	 \
+	basetime.c     	 \
+	basetime.h	 \
+	binary.c	 \
+	binary.h	 \
+	calendar.c 	 \
+	calendar.h	 \
+	cdf.c            \
+	cdf.h	 	 \
+	cdf_int.c	 \
+	cdf_int.h	 \
+	cdi.h	 	 \
+	cdi_error.c      \
+	cdi_limits.h	 \
+	cdi_util.c       \
+	cdiFortran.c     \
+	cfortran.h       \
+	cgribex.h	 \
+	cgribexlib.c  	 \
+	datetime.h	 \
+	dmemory.c      	 \
+	dmemory.h	 \
+	dtypes.h	 \
+	error.c        	 \
+	error.h	 	 \
+	extra.h	 	 \
+	extralib.c       \
+	file.c         	 \
+	file.h	 	 \
+	gaussgrid.c      \
+	gaussgrid.h	 \
+	gribapi.c  	 \
+	gribapi.h	 \
+	grid.c           \
+	grid.h	 	 \
+	ieg.h	 	 \
+	ieglib.c         \
+	institution.c  	 \
+	institution.h  	 \
+	model.c        	 \
+	model.h        	 \
+	namespace.c      \
+	namespace.h      \
+	pio.c            \
+	pio.h            \
+	pio_c_temp.h     \
+	pio_comm.c       \
+	pio_comm.h       \
+	pio_dbuffer.c    \
+	pio_impl.h 	 \
+	pio_interface.c  \
+	pio_interface.h	 \
+	pio_mpinonb.c    \
+	pio_record_send.c\
+	pio_posixasynch.c\
+	pio_posixfpguardsendrecv.c \
+	pio_posixnonb.c  \
+	pio_list_set.c			\
+	pio_rpc.c        \
+	pio_rpc.h        \
+	pio_server.c     \
+	pio_server.h     \
+	pio_util.c       \
+	pio_util.h       \
+	resource_handle.c\
+	resource_handle.h\
+	service.h	 \
+	servicelib.c     \
+	stream_cdf.c     \
+	stream_cdf.h	 \
+	stream_cgribex.c \
+	stream_cgribex.h \
+	stream_ext.c     \
+	stream_ext.h	 \
+	stream_grb.c     \
+	stream_grb.h     \
+	stream_gribapi.c \
+	stream_gribapi.h \
+	stream_history.c \
+	stream_ieg.c     \
+	stream_ieg.h	 \
+	stream_int.c     \
+	stream_int.h	 \
+	stream_record.c  \
+	stream_srv.c     \
+	stream_srv.h	 \
+	stream_var.c     \
+	swap.h	 	 \
+	table.c        	 \
+	table.h	 	 \
+	tablepar.h	 \
+	taxis.c          \
+	taxis.h	         \
+	timebase.c 	 \
+	timebase.h	 \
+	tsteps.c         \
+	util.c         	 \
+	varscan.c      	 \
+	varscan.h        \
+	version.c      	 \
+	vlist.c 	 \
+	vlist.h	         \
+	vlist_att.c 	 \
+	vlist_att.h 	 \
+	vlist_var.c 	 \
+	vlist_var.h	 \
+	zaxis.c		 \
+        stream.c         \
+        swap.c
+
+#libcdi_la_CPPFLAGS  = @CPPFLAGS@
+#libcdi_la_LIBADD    = @LDFLAGS@
+#
+cdilib.c:
+	$(top_srcdir)/src/make_cdilib $(top_srcdir)/src
+#
+cdilib.o: cdilib.c
+	$(COMPILE) -c $<
+
+LOCALTARGETS  = 
+if ENABLE_CDI_LIB
+LOCALTARGETS += pkgconfig/cdi.pc
+endif
+
+if CREATE_ISOC
+LOCALTARGETS += mo_cdi.o mo_cdi.$(FCMODEXT)
+endif
+#
+mo_cdi.f90:
+	ruby $(top_srcdir)/interfaces/f2003/bindGen.rb cdi.h $@
+#
+mo_cdi.o: mo_cdi.f90
+	$(FC) $(FCFLAGS) -c $(FCFLAGS_f90) $<
+#
+mo_cdi.$(FCMODEXT): mo_cdi.f90
+	$(FC) $(FCFLAGS) -c $(FCFLAGS_f90) $<
+
+pkgconfig/cdi.pc: pkgconfig/cdi.pc.in ../config.status
+	(cd .. ; ./config.status src/pkgconfig/cdi.pc)
+#
+all-local: $(LOCALTARGETS) 
+#
+CLEANFILES  = `ls *~`
+CLEANFILES += cdilib.c
+if CREATE_ISOC
+CLEANFILES += $(top_builddir)/src/mo_cdi.$(FCMODEXT) $(top_builddir)/src/mo_cdi.o
+endif
+
+if ENABLE_CDI_LIB
+CLEANFILES += pkgconfig/cdi.pc
+
+install-exec-local: pkgconfig/cdi.pc
+	$(mkinstalldirs) "$(DESTDIR)$(libdir)/pkgconfig"
+	$(install_sh_DATA) pkgconfig/cdi.pc "$(DESTDIR)$(libdir)/pkgconfig/cdi.pc"
+
+uninstall-local:
+	rm -f "$(DESTDIR)$(libdir)/pkgconfig/cdi.pc"
+	rmdir "$(DESTDIR)$(libdir)/pkgconfig"
+
+endif
+
+install-exec-hook:
+	- at rmdir "$(DESTDIR)$(libdir)"
+install-data-hook:
+	- at rmdir "$(DESTDIR)$(includedir)"
+
diff --git a/libcdi/src/Makefile.in b/libcdi/src/Makefile.in
new file mode 100644
index 0000000..600f4c1
--- /dev/null
+++ b/libcdi/src/Makefile.in
@@ -0,0 +1,910 @@
+# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+ at ENABLE_CDI_LIB_TRUE@am__append_1 = pkgconfig/cdi.pc
+ at CREATE_ISOC_TRUE@am__append_2 = mo_cdi.o mo_cdi.$(FCMODEXT)
+ at CREATE_ISOC_TRUE@am__append_3 = $(top_builddir)/src/mo_cdi.$(FCMODEXT) $(top_builddir)/src/mo_cdi.o
+ at ENABLE_CDI_LIB_TRUE@am__append_4 = pkgconfig/cdi.pc
+subdir = src
+DIST_COMMON = $(am__include_HEADERS_DIST) $(srcdir)/Makefile.am \
+	$(srcdir)/Makefile.in $(srcdir)/config.h.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+	$(top_srcdir)/m4/acx_assert_lang_is_fortran_variant.m4 \
+	$(top_srcdir)/m4/acx_lang_other_suffix_conftest.m4 \
+	$(top_srcdir)/m4/acx_options.m4 \
+	$(top_srcdir)/m4/acx_sl_fc_mod_path_flag.m4 \
+	$(top_srcdir)/m4/acx_sl_mod_suffix.m4 \
+	$(top_srcdir)/m4/asx_unset.m4 $(top_srcdir)/m4/ax_pthread.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/starlink_fpp.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+am__base_list = \
+  sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
+  sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+  test -z "$$files" \
+    || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+    || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+         $(am__cd) "$$dir" && rm -f $$files; }; \
+  }
+am__installdirs = "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"
+LTLIBRARIES = $(lib_LTLIBRARIES) $(noinst_LTLIBRARIES)
+libcdi_la_LIBADD =
+am_libcdi_la_OBJECTS = basetime.lo binary.lo calendar.lo cdf.lo \
+	cdf_int.lo cdi_error.lo cdi_util.lo cdiFortran.lo \
+	cgribexlib.lo dmemory.lo error.lo extralib.lo file.lo \
+	gaussgrid.lo gribapi.lo grid.lo ieglib.lo institution.lo \
+	model.lo namespace.lo pio.lo pio_comm.lo pio_dbuffer.lo \
+	pio_interface.lo pio_mpinonb.lo pio_record_send.lo \
+	pio_posixasynch.lo pio_posixfpguardsendrecv.lo \
+	pio_posixnonb.lo pio_list_set.lo pio_rpc.lo pio_server.lo \
+	pio_util.lo resource_handle.lo servicelib.lo stream_cdf.lo \
+	stream_cgribex.lo stream_ext.lo stream_grb.lo \
+	stream_gribapi.lo stream_history.lo stream_ieg.lo \
+	stream_int.lo stream_record.lo stream_srv.lo stream_var.lo \
+	table.lo taxis.lo timebase.lo tsteps.lo util.lo varscan.lo \
+	version.lo vlist.lo vlist_att.lo vlist_var.lo zaxis.lo \
+	stream.lo swap.lo
+libcdi_la_OBJECTS = $(am_libcdi_la_OBJECTS)
+ at ENABLE_CDI_LIB_FALSE@am_libcdi_la_rpath =
+ at ENABLE_CDI_LIB_TRUE@am_libcdi_la_rpath = -rpath $(libdir)
+DEFAULT_INCLUDES = -I. at am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(libcdi_la_SOURCES)
+DIST_SOURCES = $(libcdi_la_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__include_HEADERS_DIST = cdi.h cdi.inc
+HEADERS = $(include_HEADERS)
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDI_F90_INTERFACE_FCFLAGS = @CDI_F90_INTERFACE_FCFLAGS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
+ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
+ENABLE_EXTRA = @ENABLE_EXTRA@
+ENABLE_GRIB = @ENABLE_GRIB@
+ENABLE_IEG = @ENABLE_IEG@
+ENABLE_PYTHON = @ENABLE_PYTHON@
+ENABLE_RUBY = @ENABLE_RUBY@
+ENABLE_SERVICE = @ENABLE_SERVICE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_f90 = @FCFLAGS_f90@
+FCMODCASE = @FCMODCASE@
+FCMODEXT = @FCMODEXT@
+FC_MOD_FLAG = @FC_MOD_FLAG@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FPP = @FPP@
+FPPFLAGS = @FPPFLAGS@
+FPP_DEFOPT = @FPP_DEFOPT@
+FPP_INCOPT = @FPP_INCOPT@
+GREP = @GREP@
+GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
+GRIB_API_LIBS = @GRIB_API_LIBS@
+HDF5_INCLUDE = @HDF5_INCLUDE@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_ROOT = @HDF5_ROOT@
+HOST_NAME = @HOST_NAME@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JASPER_LIBS = @JASPER_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MPI_LAUNCH = @MPI_LAUNCH@
+NC_CONFIG = @NC_CONFIG@
+NETCDF_INCLUDE = @NETCDF_INCLUDE@
+NETCDF_LIBS = @NETCDF_LIBS@
+NETCDF_ROOT = @NETCDF_ROOT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENJPEG_LIBS = @OPENJPEG_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+RUBY = @RUBY@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SYSTEM_TYPE = @SYSTEM_TYPE@
+SZLIB_INCLUDE = @SZLIB_INCLUDE@
+SZLIB_LIBS = @SZLIB_LIBS@
+THREADS_INCLUDE = @THREADS_INCLUDE@
+THREADS_LIBS = @THREADS_LIBS@
+USER_NAME = @USER_NAME@
+USE_MPI = @USE_MPI@
+VERSION = @VERSION@
+ZLIB_INCLUDE = @ZLIB_INCLUDE@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+openjpeg_LIBS = @openjpeg_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+EXTRA_DIST = cdilib.c mo_cdi.f90
+ at ENABLE_CDI_LIB_TRUE@lib_LTLIBRARIES = libcdi.la
+ at ENABLE_CDI_LIB_TRUE@include_HEADERS = cdi.h cdi.inc
+ at ENABLE_CDI_LIB_FALSE@noinst_LTLIBRARIES = libcdi.la
+libcdi_la_SOURCES = \
+	basetime.c     	 \
+	basetime.h	 \
+	binary.c	 \
+	binary.h	 \
+	calendar.c 	 \
+	calendar.h	 \
+	cdf.c            \
+	cdf.h	 	 \
+	cdf_int.c	 \
+	cdf_int.h	 \
+	cdi.h	 	 \
+	cdi_error.c      \
+	cdi_limits.h	 \
+	cdi_util.c       \
+	cdiFortran.c     \
+	cfortran.h       \
+	cgribex.h	 \
+	cgribexlib.c  	 \
+	datetime.h	 \
+	dmemory.c      	 \
+	dmemory.h	 \
+	dtypes.h	 \
+	error.c        	 \
+	error.h	 	 \
+	extra.h	 	 \
+	extralib.c       \
+	file.c         	 \
+	file.h	 	 \
+	gaussgrid.c      \
+	gaussgrid.h	 \
+	gribapi.c  	 \
+	gribapi.h	 \
+	grid.c           \
+	grid.h	 	 \
+	ieg.h	 	 \
+	ieglib.c         \
+	institution.c  	 \
+	institution.h  	 \
+	model.c        	 \
+	model.h        	 \
+	namespace.c      \
+	namespace.h      \
+	pio.c            \
+	pio.h            \
+	pio_c_temp.h     \
+	pio_comm.c       \
+	pio_comm.h       \
+	pio_dbuffer.c    \
+	pio_impl.h 	 \
+	pio_interface.c  \
+	pio_interface.h	 \
+	pio_mpinonb.c    \
+	pio_record_send.c\
+	pio_posixasynch.c\
+	pio_posixfpguardsendrecv.c \
+	pio_posixnonb.c  \
+	pio_list_set.c			\
+	pio_rpc.c        \
+	pio_rpc.h        \
+	pio_server.c     \
+	pio_server.h     \
+	pio_util.c       \
+	pio_util.h       \
+	resource_handle.c\
+	resource_handle.h\
+	service.h	 \
+	servicelib.c     \
+	stream_cdf.c     \
+	stream_cdf.h	 \
+	stream_cgribex.c \
+	stream_cgribex.h \
+	stream_ext.c     \
+	stream_ext.h	 \
+	stream_grb.c     \
+	stream_grb.h     \
+	stream_gribapi.c \
+	stream_gribapi.h \
+	stream_history.c \
+	stream_ieg.c     \
+	stream_ieg.h	 \
+	stream_int.c     \
+	stream_int.h	 \
+	stream_record.c  \
+	stream_srv.c     \
+	stream_srv.h	 \
+	stream_var.c     \
+	swap.h	 	 \
+	table.c        	 \
+	table.h	 	 \
+	tablepar.h	 \
+	taxis.c          \
+	taxis.h	         \
+	timebase.c 	 \
+	timebase.h	 \
+	tsteps.c         \
+	util.c         	 \
+	varscan.c      	 \
+	varscan.h        \
+	version.c      	 \
+	vlist.c 	 \
+	vlist.h	         \
+	vlist_att.c 	 \
+	vlist_att.h 	 \
+	vlist_var.c 	 \
+	vlist_var.h	 \
+	zaxis.c		 \
+        stream.c         \
+        swap.c
+
+LOCALTARGETS = $(am__append_1) $(am__append_2)
+#
+CLEANFILES = `ls *~` cdilib.c $(am__append_3) $(am__append_4)
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+	@if test ! -f $@; then rm -f stamp-h1; else :; fi
+	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status src/config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+install-libLTLIBRARIES: $(lib_LTLIBRARIES)
+	@$(NORMAL_INSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	list2=; for p in $$list; do \
+	  if test -f $$p; then \
+	    list2="$$list2 $$p"; \
+	  else :; fi; \
+	done; \
+	test -z "$$list2" || { \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(libdir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(libdir)" || exit 1; \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(libdir)'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(libdir)"; \
+	}
+
+uninstall-libLTLIBRARIES:
+	@$(NORMAL_UNINSTALL)
+	@list='$(lib_LTLIBRARIES)'; test -n "$(libdir)" || list=; \
+	for p in $$list; do \
+	  $(am__strip_dir) \
+	  echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(libdir)/$$f'"; \
+	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(libdir)/$$f"; \
+	done
+
+clean-libLTLIBRARIES:
+	-test -z "$(lib_LTLIBRARIES)" || rm -f $(lib_LTLIBRARIES)
+	@list='$(lib_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+
+clean-noinstLTLIBRARIES:
+	-test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+	@list='$(noinst_LTLIBRARIES)'; for p in $$list; do \
+	  dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
+	  test "$$dir" != "$$p" || dir=.; \
+	  echo "rm -f \"$${dir}/so_locations\""; \
+	  rm -f "$${dir}/so_locations"; \
+	done
+libcdi.la: $(libcdi_la_OBJECTS) $(libcdi_la_DEPENDENCIES) $(EXTRA_libcdi_la_DEPENDENCIES) 
+	$(LINK) $(am_libcdi_la_rpath) $(libcdi_la_OBJECTS) $(libcdi_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/basetime.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/binary.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/calendar.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdf.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdf_int.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdiFortran.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdi_error.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdi_util.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cgribexlib.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/dmemory.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/error.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/extralib.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/file.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gaussgrid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/gribapi.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/grid.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ieglib.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/institution.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/model.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/namespace.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_comm.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_dbuffer.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_interface.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_list_set.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_mpinonb.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_posixasynch.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_posixfpguardsendrecv.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_posixnonb.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_record_send.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_rpc.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_server.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_util.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/resource_handle.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/servicelib.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_cdf.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_cgribex.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_ext.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_grb.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_gribapi.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_history.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_ieg.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_int.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_record.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_srv.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_var.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/swap.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/table.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/taxis.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/timebase.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/tsteps.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/util.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/varscan.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/version.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_att.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/vlist_var.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/zaxis.Plo at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+install-includeHEADERS: $(include_HEADERS)
+	@$(NORMAL_INSTALL)
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(includedir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(includedir)" || exit 1; \
+	fi; \
+	for p in $$list; do \
+	  if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+	  echo "$$d$$p"; \
+	done | $(am__base_list) | \
+	while read files; do \
+	  echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \
+	  $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \
+	done
+
+uninstall-includeHEADERS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(include_HEADERS)'; test -n "$(includedir)" || list=; \
+	files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+	dir='$(DESTDIR)$(includedir)'; $(am__uninstall_files_from_dir)
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES) $(HEADERS) config.h all-local
+installdirs:
+	for dir in "$(DESTDIR)$(libdir)" "$(DESTDIR)$(includedir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+ at ENABLE_CDI_LIB_FALSE@uninstall-local:
+ at ENABLE_CDI_LIB_FALSE@install-exec-local:
+clean: clean-am
+
+clean-am: clean-generic clean-libLTLIBRARIES clean-libtool \
+	clean-noinstLTLIBRARIES mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-includeHEADERS
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) install-data-hook
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-exec-local install-libLTLIBRARIES
+	@$(NORMAL_INSTALL)
+	$(MAKE) $(AM_MAKEFLAGS) install-exec-hook
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-includeHEADERS uninstall-libLTLIBRARIES \
+	uninstall-local
+
+.MAKE: all install-am install-data-am install-exec-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am all-local check check-am clean \
+	clean-generic clean-libLTLIBRARIES clean-libtool \
+	clean-noinstLTLIBRARIES ctags distclean distclean-compile \
+	distclean-generic distclean-hdr distclean-libtool \
+	distclean-tags distdir dvi dvi-am html html-am info info-am \
+	install install-am install-data install-data-am \
+	install-data-hook install-dvi install-dvi-am install-exec \
+	install-exec-am install-exec-hook install-exec-local \
+	install-html install-html-am install-includeHEADERS \
+	install-info install-info-am install-libLTLIBRARIES \
+	install-man install-pdf install-pdf-am install-ps \
+	install-ps-am install-strip installcheck installcheck-am \
+	installdirs maintainer-clean maintainer-clean-generic \
+	mostlyclean mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
+	uninstall-am uninstall-includeHEADERS uninstall-libLTLIBRARIES \
+	uninstall-local
+
+
+#libcdi_la_CPPFLAGS  = @CPPFLAGS@
+#libcdi_la_LIBADD    = @LDFLAGS@
+#
+cdilib.c:
+	$(top_srcdir)/src/make_cdilib $(top_srcdir)/src
+#
+cdilib.o: cdilib.c
+	$(COMPILE) -c $<
+#
+mo_cdi.f90:
+	ruby $(top_srcdir)/interfaces/f2003/bindGen.rb cdi.h $@
+#
+mo_cdi.o: mo_cdi.f90
+	$(FC) $(FCFLAGS) -c $(FCFLAGS_f90) $<
+#
+mo_cdi.$(FCMODEXT): mo_cdi.f90
+	$(FC) $(FCFLAGS) -c $(FCFLAGS_f90) $<
+
+pkgconfig/cdi.pc: pkgconfig/cdi.pc.in ../config.status
+	(cd .. ; ./config.status src/pkgconfig/cdi.pc)
+#
+all-local: $(LOCALTARGETS) 
+
+ at ENABLE_CDI_LIB_TRUE@install-exec-local: pkgconfig/cdi.pc
+ at ENABLE_CDI_LIB_TRUE@	$(mkinstalldirs) "$(DESTDIR)$(libdir)/pkgconfig"
+ at ENABLE_CDI_LIB_TRUE@	$(install_sh_DATA) pkgconfig/cdi.pc "$(DESTDIR)$(libdir)/pkgconfig/cdi.pc"
+
+ at ENABLE_CDI_LIB_TRUE@uninstall-local:
+ at ENABLE_CDI_LIB_TRUE@	rm -f "$(DESTDIR)$(libdir)/pkgconfig/cdi.pc"
+ at ENABLE_CDI_LIB_TRUE@	rmdir "$(DESTDIR)$(libdir)/pkgconfig"
+
+install-exec-hook:
+	- at rmdir "$(DESTDIR)$(libdir)"
+install-data-hook:
+	- at rmdir "$(DESTDIR)$(includedir)"
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libcdi/src/basetime.c b/libcdi/src/basetime.c
new file mode 100644
index 0000000..005bb52
--- /dev/null
+++ b/libcdi/src/basetime.c
@@ -0,0 +1,32 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include "error.h"
+#include "cdi.h"
+#include "basetime.h"
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+void basetimeInit(BaseTime *basetime)
+{
+  if ( basetime == NULL )
+    Error("Internal problem! Basetime not allocated.");
+
+  (*basetime).ncvarid       = UNDEFID;
+  (*basetime).ncdimid       = UNDEFID;
+  (*basetime).ncvarboundsid = UNDEFID;
+  (*basetime).lwrf          = 0;
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/basetime.h b/libcdi/src/basetime.h
new file mode 100644
index 0000000..92c6191
--- /dev/null
+++ b/libcdi/src/basetime.h
@@ -0,0 +1,24 @@
+#ifndef _BASETIME_H
+#define _BASETIME_H
+
+
+typedef struct {
+  int   ncvarid;
+  int   ncdimid;
+  int   ncvarboundsid;
+  int   lwrf;     /* TRUE for time axis in WRF format */
+}
+BaseTime;
+
+void basetimeInit(BaseTime *basetime);
+
+#endif  /* _BASETIME_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/binary.c b/libcdi/src/binary.c
new file mode 100644
index 0000000..416f35f
--- /dev/null
+++ b/libcdi/src/binary.c
@@ -0,0 +1,263 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include "error.h"
+#include "file.h"
+#include "swap.h"
+#include "binary.h"
+
+
+#undef  IsBigendian
+#define IsBigendian()  ( u_byteorder.c[sizeof(long) - 1] )
+
+
+UINT32 get_UINT32(unsigned char *x)
+{
+  /* IsBigendian returns 1 for big endian byte order */
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+
+  if ( IsBigendian() )
+    return((UINT32)(((UINT32)x[0]<<24)+((UINT32)x[1]<<16)+((UINT32)x[2]<< 8)+ (UINT32)x[3]));
+  else
+    return((UINT32)(((UINT32)x[3]<<24)+((UINT32)x[2]<<16)+((UINT32)x[1]<< 8)+ (UINT32)x[0]));
+}
+
+
+UINT32 get_SUINT32(unsigned char *x)
+{
+  /* IsBigendian returns 1 for big endian byte order */
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+
+  if ( IsBigendian() )
+    return((UINT32)(((UINT32)x[3]<<24)+((UINT32)x[2]<<16)+((UINT32)x[1]<< 8)+ (UINT32)x[0]));
+  else
+    return((UINT32)(((UINT32)x[0]<<24)+((UINT32)x[1]<<16)+((UINT32)x[2]<< 8)+ (UINT32)x[3]));
+}
+
+
+UINT64 get_UINT64(unsigned char *x)
+{
+  /* IsBigendian returns 1 for big endian byte order */
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+
+  if ( IsBigendian() )
+    return((UINT64)(((UINT64)x[0]<<56)+((UINT64)x[1]<<48)+((UINT64)x[2]<<40)+((UINT64)x[3]<<32)+
+		    ((UINT64)x[4]<<24)+((UINT64)x[5]<<16)+((UINT64)x[6]<< 8)+ (UINT64)x[7]));
+  else
+    return((UINT64)(((UINT64)x[7]<<56)+((UINT64)x[6]<<48)+((UINT64)x[5]<<40)+((UINT64)x[4]<<32)+
+		    ((UINT64)x[3]<<24)+((UINT64)x[2]<<16)+((UINT64)x[1]<< 8)+ (UINT64)x[0]));
+}
+
+
+UINT64 get_SUINT64(unsigned char *x)
+{
+  /* IsBigendian returns 1 for big endian byte order */
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+
+  if ( IsBigendian() )
+    return((UINT64)(((UINT64)x[7]<<56)+((UINT64)x[6]<<48)+((UINT64)x[5]<<40)+((UINT64)x[4]<<32)+
+		    ((UINT64)x[3]<<24)+((UINT64)x[2]<<16)+((UINT64)x[1]<< 8)+ (UINT64)x[0]));
+  else
+    return((UINT64)(((UINT64)x[0]<<56)+((UINT64)x[1]<<48)+((UINT64)x[2]<<40)+((UINT64)x[3]<<32)+
+		    ((UINT64)x[4]<<24)+((UINT64)x[5]<<16)+((UINT64)x[6]<< 8)+ (UINT64)x[7]));
+}
+
+
+size_t binReadF77Block(int fileID, int byteswap)
+{
+  unsigned char f77block[4];
+  size_t blocklen = 0;
+
+  if ( fileRead(fileID, f77block, 4) == 4 )
+    {
+      if ( byteswap )
+	blocklen = get_SUINT32(f77block);
+      else
+	blocklen =  get_UINT32(f77block);
+    }
+
+  return (blocklen);
+}
+
+
+void binWriteF77Block(int fileID, int byteswap, size_t blocksize)
+{
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+  unsigned char f77block[4];
+
+  if ( IsBigendian() )
+    {
+      if ( byteswap )
+	{
+	  f77block[0] = (unsigned char) (blocksize);
+	  f77block[1] = (unsigned char) (blocksize >>  8);
+	  f77block[2] = (unsigned char) (blocksize >> 16);
+	  f77block[3] = (unsigned char) (blocksize >> 24);
+	}
+      else
+	{
+	  f77block[3] = (unsigned char) (blocksize);
+	  f77block[2] = (unsigned char) (blocksize >>  8);
+	  f77block[1] = (unsigned char) (blocksize >> 16);
+	  f77block[0] = (unsigned char) (blocksize >> 24);
+	}
+    }
+  else
+    {
+      if ( byteswap )
+	{
+	  f77block[3] = (unsigned char) (blocksize);
+	  f77block[2] = (unsigned char) (blocksize >>  8);
+	  f77block[1] = (unsigned char) (blocksize >> 16);
+	  f77block[0] = (unsigned char) (blocksize >> 24);
+	}
+      else
+	{
+	  f77block[0] = (unsigned char) (blocksize);
+	  f77block[1] = (unsigned char) (blocksize >>  8);
+	  f77block[2] = (unsigned char) (blocksize >> 16);
+	  f77block[3] = (unsigned char) (blocksize >> 24);
+	}
+    }
+
+  if ( fileWrite(fileID, f77block, 4) != 4 )
+    Error("write failed on %s", fileInqName(fileID));
+}
+
+
+int binReadInt32(int fileID, int byteswap, size_t size, INT32 *ptr)
+{
+  if ( sizeof(INT32) == 4 )
+    {
+      fileRead(fileID, (void *) ptr, 4*size);
+      if ( byteswap ) swap4byte(ptr, size);
+    }
+  else
+    {
+      Error("not implemented for %d byte integer", sizeof(INT32));
+    }
+
+  return (0);
+}
+
+
+int binReadInt64(int fileID, int byteswap, size_t size, INT64 *ptr)
+{
+  if ( sizeof(INT64) == 8 )
+    {
+      fileRead(fileID, (void *) ptr, 8*size);
+      if ( byteswap ) swap8byte(ptr, size);
+    }
+  else
+    {
+      Error("not implemented for %d byte integer", sizeof(INT64));
+    }
+
+  return (0);
+}
+
+
+int binReadFlt32(int fileID, int byteswap, size_t size, FLT32 *ptr)
+{
+  if ( sizeof(FLT32) == 4 )
+    {
+      fileRead(fileID, (void *) ptr, 4*size);
+      if ( byteswap ) swap4byte(ptr, size);
+    }
+  else
+    {
+      Error("not implemented for %d byte float", sizeof(FLT32));
+    }
+
+  return (0);
+}
+
+
+int binReadFlt64(int fileID, int byteswap, size_t size, FLT64 *ptr)
+{
+  if ( sizeof(FLT64) == 8 )
+    {
+      fileRead(fileID, (void *) ptr, 8*size);
+      if ( byteswap ) swap8byte(ptr, size);
+    }
+  else
+    {
+      Error("not implemented for %d byte float", sizeof(FLT64));
+    }
+
+  return (0);
+}
+
+
+int binWriteInt32(int fileID, int byteswap, size_t size, INT32 *ptr)
+{
+  if ( sizeof(INT32) == 4 )
+    {
+      if ( byteswap ) swap4byte(ptr, size);
+      fileWrite(fileID, (void *) ptr, 4*size);
+    }
+  else
+    {
+      Error("not implemented for %d byte integer", sizeof(INT32));
+    }
+
+  return (0);
+}
+
+
+int binWriteInt64(int fileID, int byteswap, size_t size, INT64 *ptr)
+{
+  if ( sizeof(INT64) == 8 )
+    {
+      if ( byteswap ) swap8byte(ptr, size);
+      fileWrite(fileID, (void *) ptr, 8*size);
+    }
+  else
+    {
+      Error("not implemented for %d byte integer", sizeof(INT64));
+    }
+
+  return (0);
+}
+
+
+int binWriteFlt32(int fileID, int byteswap, size_t size, FLT32 *ptr)
+{
+  if ( sizeof(FLT32) == 4 )
+    {
+      if ( byteswap ) swap4byte(ptr, size);
+      fileWrite(fileID, (void *) ptr, 4*size);
+    }
+  else
+    {
+      Error("not implemented for %d byte float", sizeof(FLT32));
+    }
+
+  return (0);
+}
+
+
+int binWriteFlt64(int fileID, int byteswap, size_t size, FLT64 *ptr)
+{
+  if ( sizeof(FLT64) == 8 )
+    {
+      if ( byteswap ) swap8byte(ptr, size);
+      fileWrite(fileID, (void *) ptr, 8*size);
+    }
+  else
+    {
+      Error("not implemented for %d byte float", sizeof(FLT64));
+    }
+
+  return (0);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/binary.h b/libcdi/src/binary.h
new file mode 100644
index 0000000..2decfe5
--- /dev/null
+++ b/libcdi/src/binary.h
@@ -0,0 +1,41 @@
+#ifndef _BINARY_H
+#define _BINARY_H
+
+#include <stdio.h>
+
+#ifndef _DTYPES_H
+#include "dtypes.h"
+#endif
+
+
+UINT32 get_UINT32(unsigned char *x);
+UINT32 get_SUINT32(unsigned char *x);
+UINT64 get_UINT64(unsigned char *x);
+UINT64 get_SUINT64(unsigned char *x);
+
+
+size_t binReadF77Block(int fileID, int byteswap);
+void   binWriteF77Block(int fileID, int byteswap, size_t blocksize);
+
+int binReadInt32(int fileID, int byteswap, size_t size, INT32 *ptr);
+int binReadInt64(int fileID, int byteswap, size_t size, INT64 *ptr);
+
+int binWriteInt32(int fileID, int byteswap, size_t size, INT32 *ptr);
+int binWriteInt64(int fileID, int byteswap, size_t size, INT64 *ptr);
+
+int binReadFlt32(int fileID, int byteswap, size_t size, FLT32 *ptr);
+int binReadFlt64(int fileID, int byteswap, size_t size, FLT64 *ptr);
+
+int binWriteFlt32(int fileID, int byteswap, size_t size, FLT32 *ptr);
+int binWriteFlt64(int fileID, int byteswap, size_t size, FLT64 *ptr);
+
+#endif  /* _BINARY_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/calendar.c b/libcdi/src/calendar.c
new file mode 100644
index 0000000..e98bf8e
--- /dev/null
+++ b/libcdi/src/calendar.c
@@ -0,0 +1,337 @@
+#include <stdio.h>
+
+#include "cdi.h"  		/* CALENDAR_ */
+#include "timebase.h"
+
+
+static int month_360[12] = {30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30};
+static int month_365[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+static int month_366[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+
+int calendar_dpy(int calendar)
+{
+  int dpy = 0;
+
+  if      ( calendar == CALENDAR_360DAYS ) dpy = 360;
+  else if ( calendar == CALENDAR_365DAYS ) dpy = 365;
+  else if ( calendar == CALENDAR_366DAYS ) dpy = 366;
+
+  return (dpy);
+}
+
+
+int days_per_month(int calendar, int year, int month)
+{
+  int dayspermonth = 0;
+  int *dpm = NULL;
+  int dpy;
+
+  dpy = calendar_dpy(calendar);
+
+  if      ( dpy == 360 ) dpm = month_360;
+  else if ( dpy == 365 ) dpm = month_365;
+  else                   dpm = month_366;
+
+  if ( month >= 1 && month <= 12 )
+    dayspermonth = dpm[month-1];
+  /*
+  else
+    fprintf(stderr, "days_per_month: month %d out of range\n", month);
+  */
+  if ( dpy == 0 && month == 2 )
+    {
+      if ( (year%4 == 0 && year%100 != 0) || year%400 == 0 )
+	dayspermonth = 29;
+      else
+	dayspermonth = 28;
+    }
+
+  return (dayspermonth);
+}
+
+
+int days_per_year(int calendar, int year)
+{
+  int daysperyear;
+  int dpy;
+
+  dpy = calendar_dpy(calendar);
+
+  if ( dpy == 0 )
+    {
+      if ( calendar == CALENDAR_STANDARD )
+	{
+	  if ( year == 1582 )
+	    dpy = 355;
+	  else if ( (year%4 == 0 && year%100 != 0) || year%400 == 0 )
+	    dpy = 366;
+	  else
+	    dpy = 365;
+	}
+      else
+	{
+	  if ( (year%4 == 0 && year%100 != 0) || year%400 == 0 )
+	    dpy = 366;
+	  else
+	    dpy = 365;
+	}
+    }
+
+  daysperyear = dpy;
+  
+  return (daysperyear);
+}
+
+
+static void decode_day(int dpy, int days, int *year, int *month, int *day)
+{
+  int i = 0;
+  int *dpm = NULL;
+
+  *year = (days-1) / dpy;
+  days -= (*year*dpy);
+
+  if      ( dpy == 360 ) dpm = month_360;
+  else if ( dpy == 365 ) dpm = month_365;
+  else if ( dpy == 366 ) dpm = month_366;
+
+  if ( dpm )
+    for ( i = 0; i < 12; i++ )
+      {
+	if ( days > dpm[i] ) days -= dpm[i];
+	else break;
+      }
+
+  *month = i + 1;
+  *day   = days;
+}
+
+
+static int encode_day(int dpy, int year, int month, int day)
+{
+  int i;
+  int *dpm = NULL;
+  double rval;
+
+  rval = dpy * year + day;
+
+  if      ( dpy == 360 ) dpm = month_360;
+  else if ( dpy == 365 ) dpm = month_365;
+  else if ( dpy == 366 ) dpm = month_366;
+  
+  if ( dpm ) for ( i = 0; i < month-1; i++ ) rval += dpm[i];
+
+  return (rval);
+}
+
+
+int date_to_calday(int calendar, int date)
+{
+  int calday;
+  int dpy;
+  int year, month, day;
+
+  dpy = calendar_dpy(calendar);
+
+  cdiDecodeDate(date, &year, &month, &day);
+
+  if ( dpy == 360 || dpy == 365 || dpy == 366 )
+    calday = encode_day(dpy, year, month, day);
+  else
+    calday = encode_julday(calendar, year, month, day);
+
+  return (calday);
+}
+
+
+int calday_to_date(int calendar, int calday)
+{
+  int date;
+  int dpy;
+  int year, month, day;
+
+  dpy = calendar_dpy(calendar);
+
+  if ( dpy == 360 || dpy == 365 || dpy == 366 )
+    decode_day(dpy, calday, &year, &month, &day);
+  else
+    decode_julday(calendar, calday, &year, &month, &day);
+
+  date = cdiEncodeDate(year, month, day);
+
+  return (date);
+}
+
+
+void encode_caldaysec(int calendar, int year, int month, int day, int hour, int minute, int second,
+		      int *julday, int *secofday)
+{
+  int dpy;
+
+  dpy = calendar_dpy(calendar);
+
+  if ( dpy == 360 || dpy == 365 || dpy == 366 )
+    *julday = encode_day(dpy, year, month, day);
+  else
+    *julday = encode_julday(calendar, year, month, day);
+
+  *secofday = hour*3600 + minute*60 + second;
+}
+
+
+void decode_caldaysec(int calendar, int julday, int secofday, 
+		      int *year, int *month, int *day, int *hour, int *minute, int *second)
+{
+  int dpy;
+
+  dpy = calendar_dpy(calendar);
+
+  if ( dpy == 360 || dpy == 365 || dpy == 366 )
+    decode_day(dpy, julday, year, month, day);
+  else
+    decode_julday(calendar, julday, year, month, day);
+
+  *hour   = secofday/3600;
+  *minute = secofday/60 - *hour*60;
+  *second = secofday - *hour*3600 - *minute*60;
+}
+
+
+#ifdef TEST
+int main(void)
+{
+  int calendar = CALENDAR_STANDARD;
+  int nmin;
+  int vdate0, vtime0;
+  int vdate, vtime;
+  int ijulinc;
+  int i, j = 0;
+  int year, mon, day, hour, minute, second;
+  int calday, secofday;
+
+  /* 1 - Check valid range of years */
+
+  nmin = 11000;
+  vdate0 = -80001201;
+  vtime0 = 120500;
+
+  printf("start time: %8d %4d\n", vdate0, vtime0);
+
+  for ( i = 0; i < nmin; i++ )
+    {
+      cdiDecodeDate(vdate0, &year, &mon, &day);
+      cdiDecodeTime(vtime0, &hour, &minute, &second);
+
+      calday  = date_to_calday(calendar, vdate0);
+      secofday = time_to_sec(vtime0);
+
+      vdate = calday_to_date(calendar, calday);
+      vtime = sec_to_time(secofday);
+
+      if ( vdate0 != vdate || vtime0 != vtime )
+	printf("%4d %8d %4d %8d %4d %9d %9d\n",
+	       ++j, vdate0, vtime0, vdate, vtime, calday, secofday);
+
+      year++;
+      vdate0 = cdiEncodeDate(year, mon, day);
+      vtime0 = cdiEncodeTime(hour, minute, second);
+    }
+
+  printf("stop time: %8d %4d\n", vdate0, vtime0);
+
+  /* 2 - Check time increment of one minute */
+
+  nmin = 120000;
+  ijulinc = 60;
+  vdate0 = 20001201;
+  vtime0 = 0;
+
+  printf("start time: %8d %4d\n", vdate0, vtime0);
+
+  calday = date_to_calday(calendar, vdate0);
+  secofday = time_to_sec(vtime0);
+  for ( i = 0; i < nmin; i++ )
+    {
+      cdiDecodeDate(vdate0, &year, &mon, &day);
+      cdiDecodeTime(vtime0, &hour, &minute, &second);
+
+      if ( ++minute >= 60 )
+	{
+	  minute = 0;
+	  if ( ++hour >= 24 )
+	    {
+	      hour = 0;
+	      if ( ++day >= 32 )
+		{
+		  day = 1;
+		  if ( ++mon >= 13 )
+		    {
+		      mon = 1;
+		      year++;
+		    }
+		}
+	    }
+	}
+
+      vdate0 = cdiEncodeDate(year, mon, day);
+      vtime0 = cdiEncodeTime(hour, minute, second);
+
+      julday_add_seconds(ijulinc, &calday, &secofday);
+
+      vdate = calday_to_date(calendar, calday);
+      vtime = sec_to_time(secofday);
+      if ( vdate0 != vdate || vtime0 != vtime )
+	printf("%4d %8d %4d %8d %4d %9d %9d\n",
+	       ++j, vdate0, vtime0, vdate, vtime, calday, secofday);
+    }
+
+  printf("stop time: %8d %4d\n", vdate0, vtime0);
+
+  return (0);
+}
+#endif
+
+
+#ifdef TEST2
+int main(void)
+{
+  int calendar = CALENDAR_STANDARD;
+  int i;
+  int calday, secofday;
+  int year, month, day, hour, minute, second;
+  int value = 30;
+  int factor = 86400;
+  
+  calendar = CALENDAR_360DAYS;
+
+  year=1979; month=1; day=15; hour=12; minute=30; second = 0;
+
+  printf("calendar = %d\n", calendar);
+  printf("%d/%02d/%02d %02d:%02d:%02d\n", year, month, day, hour, minute, second);
+
+  encode_caldaysec(calendar, year, month, day, hour, minute, second, &calday, &secofday);
+
+  decode_caldaysec(calendar, calday, secofday, &year, &month, &day, &hour, &minute, &second);
+  printf("%d/%02d/%02d %02d:%02d:%02d   %d %d\n", year, month, day, hour, minute, second, calday, secofday);
+
+  for ( i = 0; i < 420; i++ )
+    {
+
+      decode_caldaysec(calendar, calday, secofday, &year, &month, &day, &hour, &minute, &second);
+      printf("%2d %d/%02d/%02d %02d:%02d:%02d\n", i, year, month, day, hour, minute, second);
+      julday_add_seconds(value*factor, &calday, &secofday);
+    }
+
+  return (0);
+}
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/calendar.h b/libcdi/src/calendar.h
new file mode 100644
index 0000000..a0c432d
--- /dev/null
+++ b/libcdi/src/calendar.h
@@ -0,0 +1,18 @@
+#ifndef _CALENDAR_H
+#define _CALENDAR_H
+
+void encode_caldaysec(int calendar, int year, int month, int day, int hour, int minute, int second,
+		      int *julday, int *secofday);
+void decode_caldaysec(int calendar, int julday, int secofday, 
+		      int *year, int *month, int *day, int *hour, int *minute, int *second);
+
+#endif  /* _CALENDAR_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/cdf.c b/libcdi/src/cdf.c
new file mode 100644
index 0000000..0d25ff8
--- /dev/null
+++ b/libcdi/src/cdf.c
@@ -0,0 +1,240 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "cdf.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "cdf_int.h"
+
+
+const char *cdfLibraryVersion(void)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  return (nc_inq_libvers());
+#else
+  return ("library undefined");
+#endif
+}
+
+#if  defined(HAVE_LIBHDF5)
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  int H5get_libversion(unsigned *, unsigned *, unsigned *);
+#if defined(__cplusplus)
+}
+#endif
+#endif
+
+const char *hdfLibraryVersion(void)
+{
+#if  defined(HAVE_LIBHDF5)
+  static char hdf_libvers[256];
+  unsigned majnum, minnum, relnum;
+
+  H5get_libversion(&majnum, &minnum, &relnum);
+
+  sprintf(hdf_libvers, "%u.%u.%u", majnum, minnum, relnum);
+
+  return (hdf_libvers);
+#else
+  return ("library undefined");
+#endif
+}
+
+
+int CDF_Debug   = 0;    /* If set to 1, debugging           */
+
+
+void cdfDebug(int debug)
+{
+  CDF_Debug = debug;
+
+  if ( CDF_Debug )
+    Message("debug level %d", debug);
+}
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfComment(int ncid)
+{
+  static char comment[256] = "Climate Data Interface version ";
+  static int init = 0;
+  char *blank;
+  int size = 0;
+
+  if ( ! init )
+    {
+      init = 1;
+      blank = strchr(cdiLibraryVersion(), ' ');
+      if ( blank ) size = blank - cdiLibraryVersion();
+
+      if ( size == 0 || ! isdigit((int) *cdiLibraryVersion()) )
+	strcat(comment, "??");
+      else
+	strncat(comment, cdiLibraryVersion(), size);
+      strcat(comment, " (http://code.zmaw.de/projects/cdi)");
+    }
+
+  cdf_put_att_text(ncid, NC_GLOBAL, "CDI", strlen(comment), comment);
+  cdf_put_att_text(ncid, NC_GLOBAL, "Conventions", 6, "CF-1.4");
+}
+#endif
+
+int cdfOpenFile(const char *filename, const char *mode, int *filetype)
+{
+  int ncid = -1;
+#if  defined  (HAVE_LIBNETCDF)
+  int fmode = tolower(*mode);
+  int writemode = NC_CLOBBER;
+  int readmode = NC_NOWRITE;
+  int status;
+
+  if ( filename == NULL )
+    ncid = CDI_EINVAL;
+  else
+    {
+      switch (fmode)
+	{
+	case 'r':
+	  status = cdf_open(filename, readmode, &ncid);
+	  if ( status > 0 && ncid < 0 ) ncid = CDI_ESYSTEM;
+#if  defined  (HAVE_NETCDF4)
+	  else
+	    {
+	      int format;
+	      (void) nc_inq_format(ncid, &format);
+	      if ( format == NC_FORMAT_NETCDF4_CLASSIC )
+		{
+		  *filetype = FILETYPE_NC4C;
+		}
+	    }
+#endif
+	  break;
+	case 'w':
+#if  defined  (NC_64BIT_OFFSET)
+	  if      ( *filetype == FILETYPE_NC2  ) writemode |= NC_64BIT_OFFSET;
+#endif
+#if  defined  (HAVE_NETCDF4)
+	  if      ( *filetype == FILETYPE_NC4  ) writemode |= NC_NETCDF4;
+	  else if ( *filetype == FILETYPE_NC4C ) writemode |= NC_NETCDF4 | NC_CLASSIC_MODEL;
+#endif
+	  cdf_create(filename, writemode, &ncid);
+	  cdfComment(ncid);
+	  break;
+	case 'a':
+	  cdf_open(filename, NC_WRITE, &ncid);
+	  break;
+	default:
+	  ncid = CDI_EINVAL;
+	}
+    }
+#endif
+
+  return (ncid);
+}
+
+
+int cdfOpen(const char *filename, const char *mode)
+{
+  int fileID = 0;
+  int filetype = FILETYPE_NC;
+
+  if ( CDF_Debug )
+    Message("Open %s with mode %c", filename, *mode);
+
+  fileID = cdfOpenFile(filename, mode, &filetype);
+
+  if ( CDF_Debug )
+    Message("File %s opened with id %d", filename, fileID);
+
+  return (fileID);
+}
+
+
+int cdfOpen64(const char *filename, const char *mode)
+{
+  int fileID = -1;
+  int open_file = TRUE;
+  int filetype = FILETYPE_NC2;
+
+  if ( CDF_Debug )
+    Message("Open %s with mode %c", filename, *mode);
+
+#if  defined  (HAVE_LIBNETCDF)
+#if  ! defined  (NC_64BIT_OFFSET)
+  open_file = FALSE;
+#endif
+#endif
+
+  if ( open_file )
+    {
+      fileID = cdfOpenFile(filename, mode, &filetype);
+
+      if ( CDF_Debug )
+	Message("File %s opened with id %d", filename, fileID);
+    }
+  else
+    {
+      fileID = CDI_ELIBNAVAIL;
+    }
+
+  return (fileID);
+}
+
+
+int cdf4Open(const char *filename, const char *mode, int *filetype)
+{
+  int fileID = -1;
+  int open_file = FALSE;
+
+  if ( CDF_Debug )
+    Message("Open %s with mode %c", filename, *mode);
+
+#if  defined  (HAVE_NETCDF4)
+  open_file = TRUE;
+#endif
+
+  if ( open_file )
+    {
+      fileID = cdfOpenFile(filename, mode, filetype);
+
+      if ( CDF_Debug )
+	Message("File %s opened with id %d", filename, fileID);
+    }
+  else
+    {
+      fileID = CDI_ELIBNAVAIL;
+    }
+
+  return (fileID);
+}
+
+
+void cdfCloseFile(int fileID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  cdf_close(fileID);
+#endif
+}
+
+void cdfClose(int fileID)
+{
+  cdfCloseFile(fileID);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/cdf.h b/libcdi/src/cdf.h
new file mode 100644
index 0000000..536c296
--- /dev/null
+++ b/libcdi/src/cdf.h
@@ -0,0 +1,23 @@
+#ifndef _CDF_H
+#define _CDF_H
+
+void cdfDebug(int debug);
+
+const char *cdfLibraryVersion(void);
+const char *hdfLibraryVersion(void);
+
+int  cdfOpen(const char *filename, const char *mode);
+int  cdfOpen64(const char *filename, const char *mode);
+int  cdf4Open(const char *filename, const char *mode, int *filetype);
+void cdfClose(int fileID);
+
+#endif  /* _CDF_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/cdf_int.c b/libcdi/src/cdf_int.c
new file mode 100644
index 0000000..e6693b2
--- /dev/null
+++ b/libcdi/src/cdf_int.c
@@ -0,0 +1,810 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+
+#include "cdi.h"
+#include "stream_int.h"
+#include "cdf_int.h"
+
+
+extern int CDF_Fatal;
+extern int CDF_Verbose;
+extern int CDF_Debug;
+
+#if  defined  (HAVE_LIBNETCDF)
+/*
+#if ! defined (MIN_BUF_SIZE)
+#  define  MIN_BUF_SIZE  131072L
+#endif
+
+static size_t ChunkSizeMin = MIN_BUF_SIZE;
+*/
+
+void cdf_create(const char *path, int cmode, int *ncidp)
+{
+  int status;
+  int oldfill;
+  size_t initialsz = 0, chunksizehint = 0;
+  /*
+#if defined (HAVE_STRUCT_STAT_ST_BLKSIZE)
+  struct stat filestat;
+  char basename[1024];
+  char *pend;
+
+  pend = strrchr(path, '/');
+  if ( pend == 0 )
+    strcpy(basename, "./");
+  else
+    {
+      memcpy(basename, path, pend-path);
+      basename[pend-path] = 0;
+    }
+
+  if ( stat(basename, &filestat) != 0 )
+    SysError(basename);
+
+  chunksizehint = (size_t) filestat.st_blksize * 4;
+#endif
+
+  if ( chunksizehint < ChunkSizeMin ) chunksizehint = ChunkSizeMin;
+  */
+#if defined(__SX__) || defined(ES)
+  chunksizehint = 16777216; /* 16 MB */
+#endif
+
+  if ( cdiNcChunksizehint != CDI_UNDEFID ) chunksizehint = cdiNcChunksizehint;
+
+  status = nc__create(path, cmode, initialsz, &chunksizehint, ncidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  mode = %d  file = %s", *ncidp, cmode, path);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("chunksizehint %d", chunksizehint);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+
+  status = nc_set_fill(*ncidp, NC_NOFILL, &oldfill);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+int cdf_open(const char *path, int omode, int *ncidp)
+{
+  int status = 0;
+  int dapfile = FALSE;
+  struct stat filestat;
+  size_t chunksizehint = 0;
+
+#if  defined  (HAVE_LIBNC_DAP)
+  if ( memcmp(path, "http:", 5) == 0 ) dapfile = TRUE;
+#endif
+
+  if ( dapfile )
+    {
+      status = nc_open(path, omode, ncidp);
+    }
+  else
+    {
+      if ( stat(path, &filestat) != 0 ) SysError(path);
+
+#if defined (HAVE_STRUCT_STAT_ST_BLKSIZE)
+      chunksizehint = (size_t) filestat.st_blksize * 4;
+#endif
+      /*
+      if ( chunksizehint < ChunkSizeMin ) chunksizehint = ChunkSizeMin;
+      */
+      if ( cdiNcChunksizehint != CDI_UNDEFID ) chunksizehint = cdiNcChunksizehint;
+
+      status = nc__open(path, omode, &chunksizehint, ncidp);
+
+      if ( CDF_Debug ) Message("chunksizehint %d", chunksizehint);
+    }
+
+  if ( CDF_Debug )
+    Message("ncid = %d  mode = %d  file = %s", *ncidp, omode, path);
+
+  if ( CDF_Debug && status != NC_NOERR ) Message("%s", nc_strerror(status));
+
+  return (status);
+}
+
+
+void cdf_close(int ncid)
+{
+  int status;
+
+  status = nc_close(ncid);
+
+  if ( status != NC_NOERR )
+    Error("%s", nc_strerror(status));
+}
+
+
+void cdf_redef(int ncid)
+{
+  int status;
+
+  status = nc_redef(ncid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_enddef(int ncid)
+{
+  int status;
+
+  status = nc_enddef(ncid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_sync(int ncid)
+{
+  int status;
+
+  status = nc_sync(ncid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq(int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp)
+{
+  int status;
+
+  status = nc_inq(ncid, ndimsp, nvarsp, ngattsp, unlimdimidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d ndims = %d nvars = %d ngatts = %d unlimid = %d",
+	    ncid, *ndimsp, *nvarsp, *ngattsp, *unlimdimidp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_def_dim(int ncid, const char *name, size_t len, int *dimidp)
+{
+  int status;
+
+  status = nc_def_dim(ncid, name, len, dimidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  name = %s  len = %d", ncid, name, len);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_dimid(int ncid, const char *name, int *dimidp)
+{
+  int status;
+
+  status = nc_inq_dimid(ncid, name, dimidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  name = %s  dimid= %d", ncid, name, *dimidp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_dim(int ncid, int dimid, char *name, size_t * lengthp)
+{
+  int status;
+
+  status = nc_inq_dim(ncid, dimid, name, lengthp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  dimid = %d  length = %d name = %s", ncid, dimid, *lengthp, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_dimname(int ncid, int dimid, char *name)
+{
+  int status;
+
+  status = nc_inq_dimname(ncid, dimid, name);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  dimid = %d  name = %s", ncid, dimid, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_dimlen(int ncid, int dimid, size_t * lengthp)
+{
+  int status;
+
+  status = nc_inq_dimlen(ncid, dimid, lengthp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d dimid = %d length = %d", ncid, dimid, *lengthp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_def_var(int ncid, const char *name, nc_type xtype, int ndims,
+	    const int dimids[], int *varidp)
+{
+  int status;
+
+  status = nc_def_var(ncid, name, xtype, ndims, dimids, varidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  name = %s  xtype = %d  ndims = %d  varid = %d",
+	    ncid, name, xtype, ndims, *varidp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_varid(int ncid, const char *name, int *varidp)
+{
+  int status;
+
+  status = nc_inq_varid(ncid, name, varidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  name = %s  varid = %d ", ncid, name, *varidp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_nvars(int ncid, int *nvarsp)
+{
+  int status;
+
+  status = nc_inq_nvars(ncid, nvarsp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  nvars = %d", ncid, *nvarsp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_var(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp,
+		 int dimids[], int *nattsp)
+{
+  int status;
+
+  status = nc_inq_var(ncid, varid, name, xtypep, ndimsp, dimids, nattsp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d ndims = %d xtype = %d natts = %d name = %s",
+	    ncid, varid, *ndimsp, *xtypep, *nattsp, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_varname(int ncid, int varid, char *name)
+{
+  int status;
+
+  status = nc_inq_varname(ncid, varid, name);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d name = %s", ncid, varid, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_vartype(int ncid, int varid, nc_type *xtypep)
+{
+  int status;
+
+  status = nc_inq_vartype(ncid, varid, xtypep);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d xtype = %s", ncid, varid, *xtypep);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_varndims(int ncid, int varid, int *ndimsp)
+{
+  int status;
+
+  status = nc_inq_varndims(ncid, varid, ndimsp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_vardimid(int ncid, int varid, int dimids[])
+{
+  int status;
+
+  status = nc_inq_vardimid(ncid, varid, dimids);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_varnatts(int ncid, int varid, int *nattsp)
+{
+  int status;
+
+  status = nc_inq_varnatts(ncid, varid, nattsp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d nattsp = %d", ncid, varid, *nattsp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_text(int ncid, int varid, const char *tp)
+{
+  int status;
+
+  status = nc_put_var_text(ncid, varid, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %s", ncid, varid, tp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_short(int ncid, int varid, const short *sp)
+{
+  int status;
+
+  status = nc_put_var_short(ncid, varid, sp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %hd", ncid, varid, *sp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_int(int ncid, int varid, const int *ip)
+{
+  int status;
+
+  status = nc_put_var_int(ncid, varid, ip);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %d", ncid, varid, *ip);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_long(int ncid, int varid, const long *lp)
+{
+  int status;
+
+  status = nc_put_var_long(ncid, varid, lp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %ld", ncid, varid, *lp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_float(int ncid, int varid, const float *fp)
+{
+  int status;
+
+  status = nc_put_var_float(ncid, varid, fp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %f", ncid, varid, *fp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_vara_double(int ncid, int varid, const size_t start[],
+                         const size_t count[], const double *dp)
+{
+  int status;
+
+  status = nc_put_vara_double(ncid, varid, start, count, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d val0 = %f", ncid, varid, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void  cdf_put_vara_float(int ncid, int varid, const size_t start[],
+                         const size_t count[], const float *fp)
+{
+  int status;
+
+  status = nc_put_vara_float(ncid, varid, start, count, fp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d val0 = %f", ncid, varid, *fp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void  cdf_get_vara_int(int ncid, int varid, const size_t start[],
+                       const size_t count[], int *dp)
+{
+  int status;
+
+  status = nc_get_vara_int(ncid, varid, start, count, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void  cdf_get_vara_double(int ncid, int varid, const size_t start[],
+                          const size_t count[], double *dp)
+{
+  int status;
+
+  status = nc_get_vara_double(ncid, varid, start, count, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void  cdf_get_vara_float(int ncid, int varid, const size_t start[],
+                         const size_t count[], float *fp)
+{
+  int status;
+
+  status = nc_get_vara_float(ncid, varid, start, count, fp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void  cdf_get_vara_text(int ncid, int varid, const size_t start[],
+			const size_t count[], char *tp)
+{
+  int status;
+
+  status = nc_get_vara_text(ncid, varid, start, count, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_double (int ncid, int varid, const double *dp)
+{
+  int status;
+
+  status = nc_put_var_double(ncid, varid, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d val0 = %f", ncid, varid, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var1_text(int ncid, int varid, const size_t index[], char *tp)
+{
+  int status;
+
+  status = nc_get_var1_text(ncid, varid, index, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var1_double(int ncid, int varid, const size_t index[], double *dp)
+{
+  int status;
+
+  status = nc_get_var1_double(ncid, varid, index, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var1_double(int ncid, int varid, const size_t index[], const double *dp)
+{
+  int status;
+
+  status = nc_put_var1_double(ncid, varid, index, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d val = %f", ncid, varid, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_text(int ncid, int varid, char *tp)
+{
+  int status;
+
+  status = nc_get_var_text(ncid, varid, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_short(int ncid, int varid, short *sp)
+{
+  int status;
+
+  status = nc_get_var_short(ncid, varid, sp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_int(int ncid, int varid, int *ip)
+{
+  int status;
+
+  status = nc_get_var_int(ncid, varid, ip);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_long(int ncid, int varid, long *lp)
+{
+  int status;
+
+  status = nc_get_var_long(ncid, varid, lp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_float(int ncid, int varid, float *fp)
+{
+  int status;
+
+  status = nc_get_var_float(ncid, varid, fp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_double(int ncid, int varid, double *dp)
+{
+  int status;
+
+  status = nc_get_var_double(ncid, varid, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d val[0] = %f", ncid, varid, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out,
+		  int varid_out)
+{
+  int status;
+
+  status = nc_copy_att(ncid_in, varid_in, name, ncid_out, varid_out);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %s %d %d", ncid_in, varid_out, name, ncid_out, varid_out);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_att_text(int ncid, int varid, const char *name, size_t len,
+		      const char *tp)
+{
+  int status;
+
+  status = nc_put_att_text(ncid, varid, name, len, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d att = %s text = %s",
+	    ncid, varid, name, tp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_att_int(int ncid, int varid, const char *name, nc_type xtype,
+		     size_t len, const int *ip)
+{
+  int status;
+
+  status = nc_put_att_int(ncid, varid, name, xtype, len, ip);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d att = %s val = %d", ncid, varid, name, *ip);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_att_double(int ncid, int varid, const char *name, nc_type xtype,
+			size_t len, const double *dp)
+{
+  int status;
+
+  status = nc_put_att_double(ncid, varid, name, xtype, len, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %f", ncid, varid, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_att_text(int ncid, int varid, char *name, char *tp)
+{
+  int status;
+
+  status = nc_get_att_text(ncid, varid, name, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d name = %s", ncid, varid, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_att_int(int ncid, int varid, char *name, int *ip)
+{
+  int status;
+
+  status = nc_get_att_int(ncid, varid, name, ip);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d att = %s val = %d", ncid, varid, name, *ip);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_att_double(int ncid, int varid, char *name, double *dp)
+{
+  int status;
+
+  status = nc_get_att_double(ncid, varid, name, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d att = %s val = %.9g",
+	    ncid, varid, name, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_att(int ncid, int varid, const char *name, nc_type *xtypep,
+		 size_t *lenp)
+{
+  int status;
+
+  status = nc_inq_att(ncid, varid, name, xtypep, lenp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_atttype(int ncid, int varid, const char *name, nc_type * xtypep)
+{
+  int status;
+
+  status = nc_inq_atttype(ncid, varid, name, xtypep);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_attlen(int ncid, int varid, const char *name, size_t * lenp)
+{
+  int status;
+
+  status = nc_inq_attlen(ncid, varid, name, lenp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d name = %s len = %d", ncid, varid, name, *lenp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_attname(int ncid, int varid, int attnum, char *name)
+{
+  int status;
+
+  status = nc_inq_attname(ncid, varid, attnum, name);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d attnum = %d name = %s", ncid, varid, attnum, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_attid(int ncid, int varid, const char *name, int *attnump)
+{
+  int status;
+
+  status = nc_inq_attid(ncid, varid, name, attnump);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/cdf_int.h b/libcdi/src/cdf_int.h
new file mode 100644
index 0000000..2937209
--- /dev/null
+++ b/libcdi/src/cdf_int.h
@@ -0,0 +1,105 @@
+#ifndef _CDF_INT_H
+#define _CDF_INT_H
+
+#if  defined  (HAVE_LIBNETCDF)
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+#include "netcdf.h"
+
+void cdf_create (const char *path, int cmode, int *idp);
+int  cdf_open   (const char *path, int omode, int *idp);
+void cdf_close  (int ncid);
+
+void cdf_redef (int ncid);
+void cdf_enddef (int ncid);
+void cdf_sync (int ncid);
+
+void cdf_inq (int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp);
+
+void cdf_def_dim (int ncid, const char *name, size_t len, int *idp);
+void cdf_inq_dimid (int ncid, const char *name, int *dimidp);
+void cdf_inq_dim (int ncid, int dimid, char *name, size_t * lengthp);
+void cdf_inq_dimname (int ncid, int dimid, char *name);
+void cdf_inq_dimlen (int ncid, int dimid, size_t * lengthp);
+void cdf_def_var (int ncid, const char *name, nc_type xtype, int ndims,
+		 const int dimids[], int *varidp);
+void cdf_inq_varid (int ncid, const char *name, int *varidp);
+void cdf_inq_nvars (int ncid, int *nvarsp);
+void cdf_inq_var (int ncid, int varid, char *name, nc_type *xtypep,
+		 int *ndimsp, int dimids[], int *nattsp);
+void cdf_inq_varname (int ncid, int varid, char *name);
+void cdf_inq_vartype (int ncid, int varid, nc_type *xtypep);
+void cdf_inq_varndims (int ncid, int varid, int *ndimsp);
+void cdf_inq_vardimid (int ncid, int varid, int dimids[]);
+void cdf_inq_varnatts (int ncid, int varid, int *nattsp);
+
+void cdf_copy_att (int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out);
+void cdf_put_var_text   (int ncid, int varid, const char *tp);
+void cdf_put_var_uchar  (int ncid, int varid, const unsigned char *up);
+void cdf_put_var_schar  (int ncid, int varid, const signed char *cp);
+void cdf_put_var_short  (int ncid, int varid, const short *sp);
+void cdf_put_var_int    (int ncid, int varid, const int *ip);
+void cdf_put_var_long   (int ncid, int varid, const long *lp);
+void cdf_put_var_float  (int ncid, int varid, const float *fp);
+void cdf_put_var_double (int ncid, int varid, const double *dp);
+
+void cdf_get_var_text   (int ncid, int varid, char *tp);
+void cdf_get_var_uchar  (int ncid, int varid, unsigned char *up);
+void cdf_get_var_schar  (int ncid, int varid, signed char *cp);
+void cdf_get_var_short  (int ncid, int varid, short *sp);
+void cdf_get_var_int    (int ncid, int varid, int *ip);
+void cdf_get_var_long   (int ncid, int varid, long *lp);
+void cdf_get_var_float  (int ncid, int varid, float *fp);
+void cdf_get_var_double (int ncid, int varid, double *dp);
+
+void cdf_get_var1_text(int ncid, int varid, const size_t index[], char *tp);
+
+void cdf_get_var1_double(int ncid, int varid, const size_t index[], double *dp);
+void cdf_put_var1_double(int ncid, int varid, const size_t index[], const double *dp);
+
+void cdf_get_vara_text(int ncid, int varid, const size_t start[],
+		       const size_t count[], char *tp);
+
+void cdf_get_vara_double(int ncid, int varid, const size_t start[],
+                         const size_t count[], double *dp);
+void cdf_put_vara_double(int ncid, int varid, const size_t start[],
+                         const size_t count[], const double *dp);
+
+void cdf_get_vara_float(int ncid, int varid, const size_t start[],
+                        const size_t count[], float *fp);
+void cdf_put_vara_float(int ncid, int varid, const size_t start[],
+                        const size_t count[], const float *fp);
+
+void cdf_put_att_text (int ncid, int varid, const char *name, size_t len,
+		      const char *tp);
+void cdf_put_att_int (int ncid, int varid, const char *name, nc_type xtype,
+		     size_t len, const int *ip);
+void cdf_put_att_double (int ncid, int varid, const char *name, nc_type xtype,
+			size_t len, const double *dp);
+
+void cdf_get_att_text (int ncid, int varid, char *name, char *tp);
+void cdf_get_att_int (int ncid, int varid, char *name, int *ip);
+void cdf_get_att_double (int ncid, int varid, char *name, double *dp);
+
+void cdf_inq_att (int ncid, int varid, const char *name, nc_type * xtypep,
+		 size_t * lenp);
+void cdf_inq_atttype (int ncid, int varid, const char *name, nc_type *xtypep);
+void cdf_inq_attlen (int ncid, int varid, const char *name, size_t *lenp);
+void cdf_inq_attname (int ncid, int varid, int attnum, char *name);
+void cdf_inq_attid (int ncid, int varid, const char *name, int *attnump);
+
+#endif
+
+#endif  /* _CDF_INT_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/cdi.h b/libcdi/src/cdi.h
new file mode 100644
index 0000000..5441048
--- /dev/null
+++ b/libcdi/src/cdi.h
@@ -0,0 +1,967 @@
+/*
+  CDI C header file
+
+  This is the only file that must be included to use the CDI library from C.
+*/
+
+#ifndef  _CDI_H
+#define  _CDI_H
+
+#include <sys/types.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define  CDI_MAX_NAME           256   /* max length of a name                 */
+
+#define  CDI_UNDEFID             -1
+#define  CDI_GLOBAL              -1   /* Global var ID for vlist              */
+
+/* Byte order */
+
+#define  CDI_BIGENDIAN            0   /* Byte order BIGENDIAN                 */
+#define  CDI_LITTLEENDIAN         1   /* Byte order LITTLEENDIAN              */
+
+#define  CDI_REAL                 1   /* Real numbers                         */
+#define  CDI_COMP                 2   /* Complex numbers                      */
+#define  CDI_BOTH                 3   /* Both numbers                         */
+
+/* Error identifier */
+
+#define	 CDI_NOERR        	  0   /* No Error                             */
+#define  CDI_ESYSTEM            -10   /* Operating system error               */
+#define  CDI_EINVAL             -20   /* Invalid argument                     */
+#define  CDI_EUFTYPE            -21   /* Unsupported file type                */
+#define  CDI_ELIBNAVAIL         -22   /* xxx library not available            */
+#define  CDI_EUFSTRUCT          -23   /* Unsupported file structure           */
+#define  CDI_EUNC4              -24   /* Unsupported netCDF4 structure        */
+#define  CDI_ELIMIT             -99   /* Internal limits exceeded             */
+
+/* File types */
+
+#define  FILETYPE_GRB             1   /* File type GRIB                       */
+#define  FILETYPE_GRB2            2   /* File type GRIB version 2             */
+#define  FILETYPE_NC              3   /* File type netCDF                     */
+#define  FILETYPE_NC2             4   /* File type netCDF version 2 (64-bit)  */
+#define  FILETYPE_NC4             5   /* File type netCDF version 4           */
+#define  FILETYPE_NC4C            6   /* File type netCDF version 4 (classic) */
+#define  FILETYPE_SRV             7   /* File type SERVICE                    */
+#define  FILETYPE_EXT             8   /* File type EXTRA                      */
+#define  FILETYPE_IEG             9   /* File type IEG                        */
+
+/* Compress types */
+
+#define  COMPRESS_NONE            0
+#define  COMPRESS_SZIP            1
+#define  COMPRESS_GZIP            2
+#define  COMPRESS_BZIP2           3
+#define  COMPRESS_ZIP             4
+#define  COMPRESS_JPEG            5
+
+/* external data types */
+
+#define  DATATYPE_PACK            0
+#define  DATATYPE_PACK1           1
+#define  DATATYPE_PACK2           2
+#define  DATATYPE_PACK3           3
+#define  DATATYPE_PACK4           4
+#define  DATATYPE_PACK5           5
+#define  DATATYPE_PACK6           6
+#define  DATATYPE_PACK7           7
+#define  DATATYPE_PACK8           8
+#define  DATATYPE_PACK9           9
+#define  DATATYPE_PACK10         10
+#define  DATATYPE_PACK11         11
+#define  DATATYPE_PACK12         12
+#define  DATATYPE_PACK13         13
+#define  DATATYPE_PACK14         14
+#define  DATATYPE_PACK15         15
+#define  DATATYPE_PACK16         16
+#define  DATATYPE_PACK17         17
+#define  DATATYPE_PACK18         18
+#define  DATATYPE_PACK19         19
+#define  DATATYPE_PACK20         20
+#define  DATATYPE_PACK21         21
+#define  DATATYPE_PACK22         22
+#define  DATATYPE_PACK23         23
+#define  DATATYPE_PACK24         24
+#define  DATATYPE_PACK25         25
+#define  DATATYPE_PACK26         26
+#define  DATATYPE_PACK27         27
+#define  DATATYPE_PACK28         28
+#define  DATATYPE_PACK29         29
+#define  DATATYPE_PACK30         30
+#define  DATATYPE_PACK31         31
+#define  DATATYPE_PACK32         32
+#define  DATATYPE_CPX32          64
+#define  DATATYPE_CPX64         128
+#define  DATATYPE_FLT32         132
+#define  DATATYPE_FLT64         164
+#define  DATATYPE_INT8          208
+#define  DATATYPE_INT16         216
+#define  DATATYPE_INT32         232
+#define  DATATYPE_UINT8         308
+#define  DATATYPE_UINT16        316
+#define  DATATYPE_UINT32        332
+
+/* internal data types */
+
+#define  DATATYPE_INT           251
+#define  DATATYPE_FLT           252
+#define  DATATYPE_TXT           253
+#define  DATATYPE_CPX           254
+
+/* Chunks */
+
+#define  CHUNK_AUTO               1  /* use default chunk size                  */
+#define  CHUNK_GRID               2
+#define  CHUNK_LINES              3
+
+/* GRID types */
+
+#define  GRID_GENERIC             1  /* Generic grid                            */
+#define  GRID_GAUSSIAN            2  /* Regular Gaussian lon/lat grid           */
+#define  GRID_GAUSSIAN_REDUCED    3  /* Reduced Gaussian lon/lat grid           */
+#define  GRID_LONLAT              4  /* Regular longitude/latitude grid         */
+#define  GRID_SPECTRAL            5  /* Spherical harmonic coefficients         */
+#define  GRID_FOURIER             6  /* Fourier coefficients                    */
+#define  GRID_GME                 7  /* Icosahedral-hexagonal GME grid          */
+#define  GRID_TRAJECTORY          8  /* Trajectory                              */
+#define  GRID_UNSTRUCTURED        9  /* General unstructured grid               */
+#define  GRID_CURVILINEAR        10  /* Curvilinear grid                        */
+#define  GRID_LCC                11  /* Lambert Conformal Conic (GRIB)          */
+#define  GRID_LCC2               12  /* Lambert Conformal Conic (PROJ)          */
+#define  GRID_LAEA               13  /* Lambert Azimuthal Equal Area            */
+#define  GRID_SINUSOIDAL         14  /* Sinusoidal                              */
+#define  GRID_REFERENCE          15  /* Grid reference number                   */
+#define  GRID_PROJECTION         16  /* Projected coordiantes                   */
+
+/* ZAXIS types */
+
+#define  ZAXIS_SURFACE            0  /* Surface level                           */
+#define  ZAXIS_GENERIC            1  /* Generic level                           */
+#define  ZAXIS_HYBRID             2  /* Hybrid level                            */
+#define  ZAXIS_HYBRID_HALF        3  /* Hybrid half level                       */
+#define  ZAXIS_PRESSURE           4  /* Isobaric pressure level in Pascal       */
+#define  ZAXIS_HEIGHT             5  /* Height above ground in meters           */
+#define  ZAXIS_DEPTH_BELOW_SEA    6  /* Depth below sea level in meters         */
+#define  ZAXIS_DEPTH_BELOW_LAND   7  /* Depth below land surface in centimeters */
+#define  ZAXIS_ISENTROPIC         8  /* Isentropic                              */
+#define  ZAXIS_TRAJECTORY         9  /* Trajectory                              */
+#define  ZAXIS_ALTITUDE          10  /* Altitude above mean sea level in meters */
+#define  ZAXIS_SIGMA             11  /* Sigma level                             */
+#define  ZAXIS_MEANSEA           12  /* Mean sea level                          */
+#define  ZAXIS_TOA               13  /* Norminal top of atmosphere              */
+#define  ZAXIS_SEA_BOTTOM        14  /* Sea bottom                              */
+#define  ZAXIS_ATMOSPHERE        15  /* Entire atmosphere                       */
+#define  ZAXIS_REFERENCE         16  /* zaxis reference number                  */
+
+/* TIME types */
+
+#define  TIME_CONSTANT            0  /* obsolate, use TSTEP_CONSTANT            */
+#define  TIME_VARIABLE            1  /* obsolate, use TSTEP_INSTANT             */
+
+/* TSTEP types */
+
+#define  TSTEP_CONSTANT           0
+#define  TSTEP_INSTANT            1
+#define  TSTEP_AVG                2
+#define  TSTEP_ACCUM              3
+#define  TSTEP_MAX                4
+#define  TSTEP_MIN                5
+#define  TSTEP_DIFF               6
+#define  TSTEP_RMS                7
+#define  TSTEP_SD                 8
+#define  TSTEP_COV                9
+#define  TSTEP_RATIO             10
+#define  TSTEP_RANGE             11
+#define  TSTEP_INSTANT2          12
+#define  TSTEP_INSTANT3          13
+
+/* TAXIS types */
+
+#define  TAXIS_ABSOLUTE           1
+#define  TAXIS_RELATIVE           2
+
+/* TUNIT types */
+
+#define  TUNIT_SECOND             1
+#define  TUNIT_MINUTE             2
+#define  TUNIT_HOUR               3
+#define  TUNIT_DAY                4
+#define  TUNIT_MONTH              5
+#define  TUNIT_YEAR               6
+#define  TUNIT_QUARTER            7
+#define  TUNIT_3HOURS             8
+#define  TUNIT_6HOURS             9
+#define  TUNIT_12HOURS           10
+
+/* CALENDAR types */
+
+#define  CALENDAR_STANDARD        0  /* don't change this value (used also in cgribexlib)! */
+#define  CALENDAR_PROLEPTIC       1
+#define  CALENDAR_360DAYS         2
+#define  CALENDAR_365DAYS         3
+#define  CALENDAR_366DAYS         4
+#define  CALENDAR_NONE            5
+
+/* parallel IO IOMode */
+
+#define  PIO_NONE                 0
+#define  PIO_MPI                  1
+#define  PIO_WRITER               2
+#define  PIO_ASYNCH               3
+#define  PIO_FPGUARD              4
+
+#define  PIO_MINIOMODE                  PIO_NONE
+#define  PIO_MAXIOMODE                  PIO_FPGUARD
+#define  PIO_MINIOMODEWITHSPECIALPROCS  PIO_WRITER
+
+/* parallel IO routines */
+
+void     pioEndDef             ( void );
+void     pioEndTimestepping    ( void );
+void     pioFinalize           ( void );
+int      pioInit               ( int, int, int, int, int * );
+int      pioInqVarDecoChunk    ( int, int );
+int      pioInqVarDecoOff      ( int, int );
+void     pioNamespaceSetActive ( int );
+void     pioWriteTimestep      ( int, int, int );
+
+/* CDI control routines */
+
+void    cdiReset(void);
+
+char   *cdiStringError(int cdiErrno);
+
+void    cdiDebug(int debug);
+
+char   *cdiLibraryVersion(void);
+void    cdiPrintVersion(void);
+
+void    cdiDefMissval(double missval);
+double  cdiInqMissval(void);
+void    cdiDefGlobal(const char *string, int val);
+
+/* CDI converter routines */
+
+/* parameter */
+
+void    cdiParamToString(int param, char *paramstr, int maxlen);
+
+void    cdiDecodeParam(int param, int *pnum, int *pcat, int *pdis);
+int     cdiEncodeParam(int pnum, int pcat, int pdis);
+
+/* date format:  YYYYMMDD */
+/* time format:    hhmmss */
+
+void    cdiDecodeDate(int date, int *year, int *month, int *day);
+int     cdiEncodeDate(int year, int month, int day);
+
+void    cdiDecodeTime(int time, int *hour, int *minute, int *second);
+int     cdiEncodeTime(int hour, int minute, int second);
+
+
+/* STREAM control routines */
+
+/*      streamOpenRead: Open a dataset for reading */
+int     streamOpenRead(const char *path);
+
+/*      streamOpenWrite: Create a new dataset */
+int     streamOpenWrite(const char *path, int filetype);
+
+int     streamOpenAppend(const char *path);
+
+/*      streamClose: Close an open dataset */
+void    streamClose(int streamID);
+
+/*      streamSync: Synchronize an Open Dataset to Disk */
+void    streamSync(int streamID);
+
+/*      streamDefVlist: Define the Vlist for a stream */
+void    streamDefVlist(int streamID, int vlistID);
+
+/*      streamInqVlist: Get the Vlist of a stream */
+int     streamInqVlist(int streamID);
+int     streamInqVlistIDorig(int streamID);
+
+/*      streamInqFiletype: Get the filetype */
+int     streamInqFiletype(int streamID);
+
+/*      streamDefByteorder: Define the byteorder */
+void    streamDefByteorder(int streamID, int byteorder);
+
+/*      streamInqByteorder: Get the byteorder */
+int     streamInqByteorder(int streamID);
+
+/*      streamDefCompType: Define compression type */
+void    streamDefCompType(int streamID, int comptype);
+
+/*      streamDefCompLevel: Define compression level */
+void    streamDefCompLevel(int streamID, int complevel);
+
+/*      streamInqCompType: Get compression type */
+int     streamInqCompType(int streamID);
+
+/*      streamInqCompLevel: Get compression level */
+int     streamInqCompLevel(int streamID);
+
+/*      streamDefTimestep: Define time step */
+int     streamDefTimestep(int streamID, int tsID);
+
+/*      streamInqTimestep: Get time step */
+int     streamInqTimestep(int streamID, int tsID);
+
+char   *streamFilename(int streamID);
+char   *streamFilesuffix(int filetype);
+int     streamNtsteps(int streamID);
+off_t   streamNvals(int streamID);
+
+int     streamInqNvars ( int streamID );
+
+/* STREAM var I/O routines */
+
+/*      streamReadVar: Read a variable */
+void    streamReadVar(int streamID, int varID, double *data_vec, int *nmiss);
+
+/*      streamWriteVar: Write a variable */
+void    streamWriteVar(int streamID, int varID, const double *data_vec, int nmiss);
+void    streamWriteVarF(int streamID, int varID, const float *data_vec, int nmiss);
+
+/*      streamReadVarSlice: Read a horizontal slice of a variable */
+void    streamReadVarSlice(int streamID, int varID, int levelID, double *data_vec, int *nmiss);
+
+/*      streamWriteVarSlice: Write a horizontal slice of a variable */
+void    streamWriteVarSlice(int streamID, int varID, int levelID, const double *data_vec, int nmiss);
+void    streamWriteVarSliceF(int streamID, int varID, int levelID, const float *data_vec, int nmiss);
+
+
+/* STREAM record I/O routines */
+
+void    streamInqRecord(int streamID, int *varID, int *levelID);
+void    streamDefRecord(int streamID, int  varID, int  levelID);
+void    streamReadRecord(int streamID, double *data_vec, int *nmiss);
+void    streamWriteRecord(int streamID, const double *data_vec, int nmiss);
+void    streamWriteRecordF(int streamID, const float *data_vec, int nmiss);
+void    streamCopyRecord(int streamIDdest, int streamIDsrc);
+
+void    streamInqGinfo(int streamID, int *intnum, float *fltnum);
+
+/* VLIST routines */
+
+/*      vlistCreate: Create a variable list */
+int     vlistCreate(void);
+
+/*      vlistDestroy: Destroy a variable list */
+void    vlistDestroy(int vlistID);
+
+/*      vlistDuplicate: Duplicate a variable list */
+int     vlistDuplicate(int vlistID);
+
+/*      vlistCopy: Copy a variable list */
+void    vlistCopy(int vlistID2, int vlistID1);
+
+/*      vlistCopyFlag: Copy some entries of a variable list */
+void    vlistCopyFlag(int vlistID2, int vlistID1);
+
+void    vlistClearFlag(int vlistID);
+
+/*      vlistCat: Concatenate two variable lists */
+void    vlistCat(int vlistID2, int vlistID1);
+
+/*      vlistMerge: Merge two variable lists */
+void    vlistMerge(int vlistID2, int vlistID1);
+
+void    vlistPrint(int vlistID);
+
+/*      vlistNumber: Number type in a variable list */
+int     vlistNumber(int vlistID);
+
+/*      vlistNvars: Number of variables in a variable list */
+int     vlistNvars(int vlistID);
+
+/*      vlistNgrids: Number of grids in a variable list */
+int     vlistNgrids(int vlistID);
+
+/*      vlistNzaxis: Number of zaxis in a variable list */
+int     vlistNzaxis(int vlistID);
+
+void    vlistDefNtsteps(int vlistID, int nts);
+int     vlistNtsteps(int vlistID);
+int     vlistGridsizeMax(int vlistID);
+int     vlistGrid(int vlistID, int index);
+int     vlistGridIndex(int vlistID, int gridID);
+void    vlistChangeGridIndex(int vlistID, int index, int gridID);
+void    vlistChangeGrid(int vlistID, int gridID1, int gridID2);
+int     vlistZaxis(int vlistID, int index);
+int     vlistZaxisIndex(int vlistID, int zaxisID);
+void    vlistChangeZaxisIndex(int vlistID, int index, int zaxisID);
+void    vlistChangeZaxis(int vlistID, int zaxisID1, int zaxisID2);
+int     vlistNrecs(int vlistID);
+
+/*      vlistDefTaxis: Define the time axis of a variable list */
+void    vlistDefTaxis(int vlistID, int taxisID);
+
+/*      vlistInqTaxis: Get the time axis of a variable list */
+int     vlistInqTaxis(int vlistID);
+
+void    vlistDefTable(int vlistID, int tableID);
+int     vlistInqTable(int vlistID);
+void    vlistDefInstitut(int vlistID, int instID);
+int     vlistInqInstitut(int vlistID);
+void    vlistDefModel(int vlistID, int modelID);
+int     vlistInqModel(int vlistID);
+
+
+/* VLIST VAR routines */
+
+/*      vlistDefVar: Create a new Variable */
+int     vlistDefVar(int vlistID, int gridID, int zaxisID, int tsteptype);
+
+void    vlistChangeVarGrid(int vlistID, int varID, int gridID);
+void    vlistChangeVarZaxis(int vlistID, int varID, int zaxisID);
+
+void    vlistInqVar(int vlistID, int varID, int *gridID, int *zaxisID, int *tsteptype);
+int     vlistInqVarGrid(int vlistID, int varID);
+int     vlistInqVarZaxis(int vlistID, int varID);
+
+/* used in MPIOM */
+int     vlistInqVarID(int vlistID, int code);
+
+int     vlistInqVarTsteptype(int vlistID, int varID);
+void    vlistDefVarTsteptype(int vlistID, int varID, int tsteptype);
+
+void    vlistDefVarCompType(int vlistID, int varID, int comptype);
+int     vlistInqVarCompType(int vlistID, int varID);
+void    vlistDefVarCompLevel(int vlistID, int varID, int complevel);
+int     vlistInqVarCompLevel(int vlistID, int varID);
+
+/*      vlistDefVarParam: Define the parameter number of a Variable */
+void    vlistDefVarParam(int vlistID, int varID, int param);
+
+/*      vlistInqVarParam: Get the parameter number of a Variable */
+int     vlistInqVarParam(int vlistID, int varID);
+
+/*      vlistDefVarCode: Define the code number of a Variable */
+void    vlistDefVarCode(int vlistID, int varID, int code);
+
+/*      vlistInqVarCode: Get the code number of a Variable */
+int     vlistInqVarCode(int vlistID, int varID);
+
+/*      vlistDefVarDatatype: Define the data type of a Variable */
+void    vlistDefVarDatatype(int vlistID, int varID, int datatype);
+
+/*      vlistInqVarDatatype: Get the data type of a Variable */
+int     vlistInqVarDatatype(int vlistID, int varID);
+
+void    vlistDefVarChunkType(int vlistID, int varID, int chunktype);
+int     vlistInqVarChunkType(int vlistID, int varID);
+
+void    vlistDefVarXYZ(int vlistID, int varID, int xyz);
+int     vlistInqVarXYZ(int vlistID, int varID);
+
+int     vlistInqVarNumber(int vlistID, int varID);
+
+void    vlistDefVarInstitut(int vlistID, int varID, int instID);
+int     vlistInqVarInstitut(int vlistID, int varID);
+void    vlistDefVarModel(int vlistID, int varID, int modelID);
+int     vlistInqVarModel(int vlistID, int varID);
+void    vlistDefVarTable(int vlistID, int varID, int tableID);
+int     vlistInqVarTable(int vlistID, int varID);
+
+/*      vlistDefVarName: Define the name of a Variable */
+void    vlistDefVarName(int vlistID, int varID, const char *name);
+
+/*      vlistInqVarName: Get the name of a Variable */
+void    vlistInqVarName(int vlistID, int varID, char *name);
+
+/*      vlistDefVarStdname: Define the standard name of a Variable */
+void    vlistDefVarStdname(int vlistID, int varID, const char *stdname);
+
+/*      vlistInqVarStdname: Get the standard name of a Variable */
+void    vlistInqVarStdname(int vlistID, int varID, char *stdname);
+
+/*      vlistDefVarLongname: Define the long name of a Variable */
+void    vlistDefVarLongname(int vlistID, int varID, const char *longname);
+
+/*      vlistInqVarLongname: Get the long name of a Variable */
+void    vlistInqVarLongname(int vlistID, int varID, char *longname);
+
+/*      vlistDefVarUnits: Define the units of a Variable */
+void    vlistDefVarUnits(int vlistID, int varID, const char *units);
+
+/*      vlistInqVarUnits: Get the units of a Variable */
+void    vlistInqVarUnits(int vlistID, int varID, char *units);
+
+/*      vlistDefVarMissval: Define the missing value of a Variable */
+void    vlistDefVarMissval(int vlistID, int varID, double missval);
+
+/*      vlistInqVarMissval: Get the missing value of a Variable */
+double  vlistInqVarMissval(int vlistID, int varID);
+
+void    vlistDefVarScalefactor(int vlistID, int varID, double scalefactor);
+double  vlistInqVarScalefactor(int vlistID, int varID);
+void    vlistDefVarAddoffset(int vlistID, int varID, double addoffset);
+double  vlistInqVarAddoffset(int vlistID, int varID);
+
+void    vlistDefVarTimave(int vlistID, int varID, int timave);
+int     vlistInqVarTimave(int vlistID, int varID);
+void    vlistDefVarTimaccu(int vlistID, int varID, int timaccu);
+int     vlistInqVarTimaccu(int vlistID, int varID);
+
+int     vlistInqVarSize(int vlistID, int varID);
+
+void    vlistDefIndex(int vlistID, int varID, int levID, int index);
+int     vlistInqIndex(int vlistID, int varID, int levID);
+void    vlistDefFlag(int vlistID, int varID, int levID, int flag);
+int     vlistInqFlag(int vlistID, int varID, int levID);
+int     vlistFindVar(int vlistID, int fvarID);
+int     vlistFindLevel(int vlistID, int fvarID, int flevelID);
+int     vlistMergedVar(int vlistID, int varID);
+int     vlistMergedLevel(int vlistID, int varID, int levelID);
+
+/*     Ensemble info routines */
+void    vlistDefVarEnsemble(int vlistID, int varID, int ensID, int ensCount, int forecast_type);
+int     vlistInqVarEnsemble(int vlistID, int varID, int *ensID, int *ensCount, int *forecast_type);
+
+/* VLIST attributes */
+
+/*      vlistInqNatts: Get number of variable attributes assigned to this variable */
+int     vlistInqNatts(int vlistID, int varID, int *nattsp);
+/*      vlistInqAtt: Get information about an attribute */
+int     vlistInqAtt(int vlistID, int varID, int attrnum, char *name, int *typep, int *lenp);
+int     vlistDelAtt(int vlistID, int varID, const char *name);
+
+/*      vlistDefAttInt: Define an integer attribute */
+int     vlistDefAttInt(int vlistID, int varID, const char *name, int type, int len, const int *ip_vec);
+/*      vlistDefAttFlt: Define a floating point attribute */
+int     vlistDefAttFlt(int vlistID, int varID, const char *name, int type, int len, const double *dp_vec);
+/*      vlistDefAttTxt: Define a text attribute */
+int     vlistDefAttTxt(int vlistID, int varID, const char *name, int len, const char *tp);
+
+/*      vlistInqAttInt: Get the value(s) of an integer attribute */
+int     vlistInqAttInt(int vlistID, int varID, const char *name, int mlen, int *ip_vec);
+/*      vlistInqAttFlt: Get the value(s) of a floating point attribute */
+int     vlistInqAttFlt(int vlistID, int varID, const char *name, int mlen, double *dp_vec);
+/*      vlistInqAttTxt: Get the value(s) of a text attribute */
+int     vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen, char *tp);
+
+
+/* GRID routines */
+
+void    gridName(int gridtype, char *gridname);
+char   *gridNamePtr(int gridtype);
+
+void    gridCompress(int gridID);
+
+void    gridDefMaskGME(int gridID, const int *mask_vec);
+int     gridInqMaskGME(int gridID, int *mask_vec);
+
+void    gridDefMask(int gridID, const int *mask_vec);
+int     gridInqMask(int gridID, int *mask_vec);
+
+void    gridPrint(int gridID, int opt);
+int     gridSize(void);
+
+/*      gridCreate: Create a horizontal Grid */
+int     gridCreate(int gridtype, int size);
+
+/*      gridDestroy: Destroy a horizontal Grid */
+void    gridDestroy(int gridID);
+
+/*      gridDuplicate: Duplicate a Grid */
+int     gridDuplicate(int gridID);
+
+/*      gridInqType: Get the type of a Grid */
+int     gridInqType(int gridID);
+
+/*      gridInqSize: Get the size of a Grid */
+int     gridInqSize(int gridID);
+
+/*      gridDefXsize: Define the size of a X-axis */
+void    gridDefXsize(int gridID, int xsize);
+
+/*      gridInqXsize: Get the size of a X-axis */
+int     gridInqXsize(int gridID);
+
+/*      gridDefYsize: Define the size of a Y-axis */
+void    gridDefYsize(int gridID, int ysize);
+
+/*      gridInqYsize: Get the size of a Y-axis */
+int     gridInqYsize(int gridID);
+
+/*      gridDefNP: Define the number of parallels between a pole and the equator */
+void    gridDefNP(int gridID, int np);
+
+/*      gridInqNP: Get the number of parallels between a pole and the equator */
+int     gridInqNP(int gridID);
+
+/*      gridDefXvals: Define the values of a X-axis */
+void    gridDefXvals(int gridID, const double *xvals_vec);
+
+/*      gridInqXvals: Get all values of a X-axis */
+int     gridInqXvals(int gridID, double *xvals_vec);
+
+/*      gridDefYvals: Define the values of a Y-axis */
+void    gridDefYvals(int gridID, const double *yvals_vec);
+
+/*      gridInqYvals: Get all values of a Y-axis */
+int     gridInqYvals(int gridID, double *yvals_vec);
+
+/*      gridDefXname: Define the name of a X-axis */
+void    gridDefXname(int gridID, const char *xname);
+
+/*      gridDefXlongname: Define the longname of a X-axis  */
+void    gridDefXlongname(int gridID, const char *xlongname);
+
+/*      gridDefXunits: Define the units of a X-axis */
+void    gridDefXunits(int gridID, const char *xunits);
+
+/*      gridDefYname: Define the name of a Y-axis */
+void    gridDefYname(int gridID, const char *yname);
+
+/*      gridDefYlongname: Define the longname of a Y-axis */
+void    gridDefYlongname(int gridID, const char *ylongname);
+
+/*      gridDefYunits: Define the units of a Y-axis */
+void    gridDefYunits(int gridID, const char *yunits);
+
+/*      gridInqXname: Get the name of a X-axis */
+void    gridInqXname(int gridID, char *xname);
+
+/*      gridInqXlongname: Get the longname of a X-axis */
+void    gridInqXlongname(int gridID, char *xlongname);
+
+/*      gridInqXstdname: Get the standard name of a X-axis */
+void    gridInqXstdname(int gridID, char *xstdname);
+
+/*      gridInqXunits: Get the units of a X-axis */
+void    gridInqXunits(int gridID, char *xunits);
+
+/*      gridInqYname: Get the name of a Y-axis */
+void    gridInqYname(int gridID, char *yname);
+
+/*      gridInqYlongname: Get the longname of a Y-axis */
+void    gridInqYlongname(int gridID, char *ylongname);
+
+/*      gridInqYstdname: Get the standard name of a Y-axis */
+void    gridInqYstdname(int gridID, char *ystdname);
+
+/*      gridInqYunits: Get the units of a Y-axis */
+void    gridInqYunits(int gridID, char *yunits);
+
+/*      gridDefPrec: Define the precision of a Grid */
+void    gridDefPrec(int gridID, int prec);
+
+/*      gridInqPrec: Get the precision of a Grid */
+int     gridInqPrec(int gridID);
+
+/*      gridInqXval: Get one value of a X-axis */
+double  gridInqXval(int gridID, int index);
+
+/*      gridInqYval: Get one value of a Y-axis */
+double  gridInqYval(int gridID, int index);
+
+double  gridInqXinc(int gridID);
+double  gridInqYinc(int gridID);
+
+int     gridIsCircular(int gridID);
+int     gridIsRotated(int gridID);
+double  gridInqXpole(int gridID);
+void    gridDefXpole(int gridID, double xpole);
+double  gridInqYpole(int gridID);
+void    gridDefYpole(int gridID, double ypole);
+double  gridInqAngle(int gridID);
+void    gridDefAngle(int gridID, double angle);
+void    gridDefTrunc(int gridID, int trunc);
+int     gridInqTrunc(int gridID);
+/* Hexagonal GME grid */
+int     gridInqGMEnd(int gridID);
+void    gridDefGMEnd(int gridID, int nd);
+int     gridInqGMEni(int gridID);
+void    gridDefGMEni(int gridID, int ni);
+int     gridInqGMEni2(int gridID);
+void    gridDefGMEni2(int gridID, int ni2);
+int     gridInqGMEni3(int gridID);
+void    gridDefGMEni3(int gridID, int ni3);
+
+/* Reference grid */
+int     gridInqNumber(int gridID);
+void    gridDefNumber(int gridID, int number);
+int     gridInqPosition(int gridID);
+void    gridDefPosition(int gridID, int position);
+int     gridInqReference(int gridID, char *reference);
+void    gridDefReference(int gridID, const char *reference);
+char   *gridInqUUID(int gridID, char *uuid);
+void    gridDefUUID(int gridID, const char *uuid);
+
+
+/* Lambert Conformal Conic grid (GRIB version) */
+void gridDefLCC(int gridID, double originLon, double originLat, double lonParY, double lat1, double lat2, double xinc, double yinc, int projflag, int scanflag);
+void gridInqLCC(int gridID, double *originLon, double *originLat, double *lonParY, double *lat1, double *lat2, double *xinc, double *yinc, int *projflag, int *scanflag);
+
+/* Lambert Conformal Conic 2 grid (PROJ version) */
+void gridDefLcc2(int gridID, double earth_radius, double lon_0, double lat_0, double lat_1, double lat_2);
+void gridInqLcc2(int gridID, double *earth_radius, double *lon_0, double *lat_0, double *lat_1, double *lat_2);
+
+/* Lambert Azimuthal Equal Area grid */
+void gridDefLaea(int gridID, double earth_radius, double lon_0, double lat_0);
+void gridInqLaea(int gridID, double *earth_radius, double *lon_0, double *lat_0);
+
+
+void    gridDefArea(int gridID, const double *area_vec);
+void    gridInqArea(int gridID, double *area_vec);
+int     gridHasArea(int gridID);
+
+/*      gridDefNvertex: Define the number of vertex of a Gridbox */
+void    gridDefNvertex(int gridID, int nvertex);
+
+/*      gridInqNvertex: Get the number of vertex of a Gridbox */
+int     gridInqNvertex(int gridID);
+
+/*      gridDefXbounds: Define the bounds of a X-axis */
+void    gridDefXbounds(int gridID, const double *xbounds_vec);
+
+/*      gridInqXbounds: Get the bounds of a X-axis */
+int     gridInqXbounds(int gridID, double *xbounds_vec);
+
+/*      gridDefYbounds: Define the bounds of a Y-axis */
+void    gridDefYbounds(int gridID, const double *ybounds_vec);
+
+/*      gridInqYbounds: Get the bounds of a Y-axis */
+int     gridInqYbounds(int gridID, double *ybounds_vec);
+
+void    gridDefRowlon(int gridID, int nrowlon, const int *rowlon_vec);
+void    gridInqRowlon(int gridID, int *rowlon_vec);
+void    gridChangeType(int gridID, int gridtype);
+
+void    gridDefComplexPacking(int gridID, int lpack);
+int     gridInqComplexPacking(int gridID);
+
+/* ZAXIS routines */
+
+void    zaxisName(int zaxistype, char *zaxisname);
+
+/*      zaxisCreate: Create a vertical Z-axis */
+int     zaxisCreate(int zaxistype, int size);
+
+/*      zaxisDestroy: Destroy a vertical Z-axis */
+void    zaxisDestroy(int zaxisID);
+
+/*      zaxisInqType: Get the type of a Z-axis */
+int     zaxisInqType(int zaxisID);
+
+/*      zaxisInqSize: Get the size of a Z-axis */
+int     zaxisInqSize(int zaxisID);
+
+/*      zaxisDuplicate: Duplicate a Z-axis */
+int     zaxisDuplicate(int zaxisID);
+
+void    zaxisResize(int zaxisID, int size);
+
+void    zaxisPrint(int zaxisID);
+int     zaxisSize(void);
+
+/*      zaxisDefLevels: Define the levels of a Z-axis */
+void    zaxisDefLevels(int zaxisID, const double *levels_vec);
+
+/*      zaxisInqLevels: Get all levels of a Z-axis */
+void    zaxisInqLevels(int zaxisID, double *levels_vec);
+
+/*      zaxisDefLevel: Define one level of a Z-axis */
+void    zaxisDefLevel(int zaxisID, int levelID, double levels);
+
+/*      zaxisInqLevel: Get one level of a Z-axis */
+double  zaxisInqLevel(int zaxisID, int levelID);
+
+/*      zaxisDefReference: Define the reference of a generalized Z-axis */
+void    zaxisDefReference(int zaxisID, int refID);
+
+/*      zaxisDefUUID: Define the uuid of a generalized Z-axis */
+void    zaxisDefUUID(int zaxisID, const char *uuid);
+
+/*      zaxisInqUUID: Get the reference of a generalized Z-axis */
+char   *zaxisInqUUID(int zaxisID, char *uuid);
+
+/*      zaxisInqReference: Get the reference of a generalized Z-axis */
+int     zaxisInqReference(int zaxisID);
+
+/*      zaxisDefName: Define the name of a Z-axis */
+void    zaxisDefName(int zaxisID, const char *name);
+
+/*      zaxisDefLongname: Define the longname of a Z-axis */
+void    zaxisDefLongname(int zaxisID, const char *longname);
+
+/*      zaxisDefUnits: Define the units of a Z-axis */
+void    zaxisDefUnits(int zaxisID, const char *units);
+
+/*      zaxisInqName: Get the name of a Z-axis */
+void    zaxisInqName(int zaxisID, char *name);
+
+/*      zaxisInqLongname: Get the longname of a Z-axis */
+void    zaxisInqLongname(int zaxisID, char *longname);
+
+/*      zaxisInqStdname: Get the standard name of a Z-axis */
+void    zaxisInqStdname(int zaxisID, char *stdname);
+
+/*      zaxisInqUnits: Get the units of a Z-axis */
+void    zaxisInqUnits(int zaxisID, char *units);
+
+void    zaxisDefPrec(int zaxisID, int prec);
+int     zaxisInqPrec(int zaxisID);
+
+int     zaxisInqPositive(int zaxisID);
+
+void    zaxisDefLtype(int zaxisID, int ltype);
+int     zaxisInqLtype(int zaxisID);
+
+const double *zaxisInqLevelsPtr(int zaxisID);
+void    zaxisDefVct(int zaxisID, int size, const double *vct_vec);
+void    zaxisInqVct(int zaxisID, double *vct_vec);
+int     zaxisInqVctSize(int zaxisID);
+const double *zaxisInqVctPtr(int zaxisID);
+int     zaxisInqLbounds(int zaxisID, double *lbounds_vec);
+int     zaxisInqUbounds(int zaxisID, double *ubounds_vec);
+int     zaxisInqWeights(int zaxisID, double *weights_vec);
+double  zaxisInqLbound(int zaxisID, int index);
+double  zaxisInqUbound(int zaxisID, int index);
+void    zaxisDefLbounds(int zaxisID, const double *lbounds_vec);
+void    zaxisDefUbounds(int zaxisID, const double *ubounds_vec);
+void    zaxisDefWeights(int zaxisID, const double *weights_vec);
+void    zaxisChangeType(int zaxisID, int zaxistype);
+
+/* TAXIS routines */
+
+/*      taxisCreate: Create a Time axis */
+int     taxisCreate(int timetype);
+
+/*      taxisDestroy: Destroy a Time axis */
+void    taxisDestroy(int taxisID);
+
+int     taxisDuplicate(int taxisID);
+
+void    taxisCopyTimestep(int taxisIDdes, int taxisIDsrc);
+
+void    taxisDefType(int taxisID, int type);
+
+/*      taxisDefVdate: Define the verification date */
+void    taxisDefVdate(int taxisID, int date);
+
+/*      taxisDefVtime: Define the verification time */
+void    taxisDefVtime(int taxisID, int time);
+
+/*      taxisDefRdate: Define the reference date */
+void    taxisDefRdate(int taxisID, int date);
+
+/*      taxisDefRtime: Define the reference date */
+void    taxisDefRtime(int taxisID, int time);
+
+int     taxisHasBounds(int taxisID);
+
+void    taxisDeleteBounds(int taxisID);
+
+void    taxisDefVdateBounds(int taxisID, int vdate_lb, int vdate_ub);
+
+void    taxisDefVtimeBounds(int taxisID, int vtime_lb, int vtime_ub);
+
+void    taxisInqVdateBounds(int taxisID, int *vdate_lb, int *vdate_ub);
+
+void    taxisInqVtimeBounds(int taxisID, int *vtime_lb, int *vtime_ub);
+
+/*      taxisDefCalendar: Define the calendar */
+void    taxisDefCalendar(int taxisID, int calendar);
+
+void    taxisDefTunit(int taxisID, int tunit);
+
+void    taxisDefNumavg(int taxisID, int numavg);
+
+int     taxisInqType(int taxisID);
+
+/*      taxisInqVdate: Get the verification date */
+int     taxisInqVdate(int taxisID);
+
+/*      taxisInqVtime: Get the verification time */
+int     taxisInqVtime(int taxisID);
+
+/*      taxisInqRdate: Get the reference date */
+int     taxisInqRdate(int taxisID);
+
+/*      taxisInqRtime: Get the reference time */
+int     taxisInqRtime(int taxisID);
+
+/*      taxisInqCalendar: Get the calendar */
+int     taxisInqCalendar(int taxisID);
+
+int     taxisInqTunit(int taxisID);
+
+int     taxisInqNumavg(int taxisID);
+
+char   *tunitNamePtr(int tunitID);
+
+
+/* Institut routines */
+
+int     institutDef(int center, int subcenter, const char *name, const char *longname);
+int     institutInq(int center, int subcenter, const char *name, const char *longname);
+int     institutInqNumber(void);
+int     institutInqCenter(int instID);
+int     institutInqSubcenter(int instID);
+char   *institutInqNamePtr(int instID);
+char   *institutInqLongnamePtr(int instID);
+
+/* Model routines */
+
+int     modelDef(int instID, int modelgribID, const char *name);
+int     modelInq(int instID, int modelgribID, char *name);
+int     modelInqInstitut(int modelID);
+int     modelInqGribID(int modelID);
+char   *modelInqNamePtr(int modelID);
+
+/* Table routines */
+
+void    tableWriteC(const char *filename, int tableID);
+void    tableWrite(const char *filename, int tableID);
+int     tableRead(const char *tablefile);
+int     tableDef(int modelID, int tablenum, const char *tablename);
+
+char   *tableInqNamePtr(int tableID);
+void    tableDefEntry(int tableID, int code, const char *name, const char *longname, const char *units);
+
+int     tableInq(int modelID, int tablenum, const char *tablename);
+int     tableInqNumber(void);
+
+int     tableInqNum(int tableID);
+int     tableInqModel(int tableID);
+
+void    tableInqPar(int tableID, int code, char *name, char *longname, char *units);
+
+int     tableInqParCode(int tableID, char *name, int *code);
+int     tableInqParName(int tableID, int code, char *name);
+int     tableInqParLongname(int tableID, int code, char *longname);
+int     tableInqParUnits(int tableID, int code, char *units);
+
+char   *tableInqParNamePtr(int tableID, int parID);
+char   *tableInqParLongnamePtr(int tableID, int parID);
+char   *tableInqParUnitsPtr(int tableID, int parID);
+
+/* History routines */
+
+void    streamDefHistory(int streamID, int size, const char *history);
+int     streamInqHistorySize(int streamID);
+void    streamInqHistoryString(int streamID, char *history);
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif  /* _CDI_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/cdi.inc b/libcdi/src/cdi.inc
new file mode 100644
index 0000000..5c4a024
--- /dev/null
+++ b/libcdi/src/cdi.inc
@@ -0,0 +1,2221 @@
+! This file was automatically generated, don't edit!
+!
+! Fortran interface for CDI library version 1.5.9
+!
+! Author:
+! -------
+! Uwe Schulzweida, MPI-MET, Hamburg,   December 2012
+!
+
+      INTEGER    CDI_MAX_NAME          
+      PARAMETER (CDI_MAX_NAME           = 256)
+      INTEGER    CDI_UNDEFID           
+      PARAMETER (CDI_UNDEFID            = -1)
+      INTEGER    CDI_GLOBAL            
+      PARAMETER (CDI_GLOBAL             = -1)
+!
+!  Byte order
+!
+      INTEGER    CDI_BIGENDIAN         
+      PARAMETER (CDI_BIGENDIAN          =  0)
+      INTEGER    CDI_LITTLEENDIAN      
+      PARAMETER (CDI_LITTLEENDIAN       =  1)
+      INTEGER    CDI_REAL              
+      PARAMETER (CDI_REAL               =  1)
+      INTEGER    CDI_COMP              
+      PARAMETER (CDI_COMP               =  2)
+      INTEGER    CDI_BOTH              
+      PARAMETER (CDI_BOTH               =  3)
+!
+!  Error identifier
+!
+      INTEGER    CDI_NOERR             
+      PARAMETER (CDI_NOERR              =  0)
+      INTEGER    CDI_ESYSTEM           
+      PARAMETER (CDI_ESYSTEM            = -10)
+      INTEGER    CDI_EINVAL            
+      PARAMETER (CDI_EINVAL             = -20)
+      INTEGER    CDI_EUFTYPE           
+      PARAMETER (CDI_EUFTYPE            = -21)
+      INTEGER    CDI_ELIBNAVAIL        
+      PARAMETER (CDI_ELIBNAVAIL         = -22)
+      INTEGER    CDI_EUFSTRUCT         
+      PARAMETER (CDI_EUFSTRUCT          = -23)
+      INTEGER    CDI_EUNC4             
+      PARAMETER (CDI_EUNC4              = -24)
+      INTEGER    CDI_ELIMIT            
+      PARAMETER (CDI_ELIMIT             = -99)
+!
+!  File types
+!
+      INTEGER    FILETYPE_GRB          
+      PARAMETER (FILETYPE_GRB           =  1)
+      INTEGER    FILETYPE_GRB2         
+      PARAMETER (FILETYPE_GRB2          =  2)
+      INTEGER    FILETYPE_NC           
+      PARAMETER (FILETYPE_NC            =  3)
+      INTEGER    FILETYPE_NC2          
+      PARAMETER (FILETYPE_NC2           =  4)
+      INTEGER    FILETYPE_NC4          
+      PARAMETER (FILETYPE_NC4           =  5)
+      INTEGER    FILETYPE_NC4C         
+      PARAMETER (FILETYPE_NC4C          =  6)
+      INTEGER    FILETYPE_SRV          
+      PARAMETER (FILETYPE_SRV           =  7)
+      INTEGER    FILETYPE_EXT          
+      PARAMETER (FILETYPE_EXT           =  8)
+      INTEGER    FILETYPE_IEG          
+      PARAMETER (FILETYPE_IEG           =  9)
+!
+!  Compress types
+!
+      INTEGER    COMPRESS_NONE         
+      PARAMETER (COMPRESS_NONE          =  0)
+      INTEGER    COMPRESS_SZIP         
+      PARAMETER (COMPRESS_SZIP          =  1)
+      INTEGER    COMPRESS_GZIP         
+      PARAMETER (COMPRESS_GZIP          =  2)
+      INTEGER    COMPRESS_BZIP2        
+      PARAMETER (COMPRESS_BZIP2         =  3)
+      INTEGER    COMPRESS_ZIP          
+      PARAMETER (COMPRESS_ZIP           =  4)
+      INTEGER    COMPRESS_JPEG         
+      PARAMETER (COMPRESS_JPEG          =  5)
+!
+!  external data types
+!
+      INTEGER    DATATYPE_PACK         
+      PARAMETER (DATATYPE_PACK          =  0)
+      INTEGER    DATATYPE_PACK1        
+      PARAMETER (DATATYPE_PACK1         =  1)
+      INTEGER    DATATYPE_PACK2        
+      PARAMETER (DATATYPE_PACK2         =  2)
+      INTEGER    DATATYPE_PACK3        
+      PARAMETER (DATATYPE_PACK3         =  3)
+      INTEGER    DATATYPE_PACK4        
+      PARAMETER (DATATYPE_PACK4         =  4)
+      INTEGER    DATATYPE_PACK5        
+      PARAMETER (DATATYPE_PACK5         =  5)
+      INTEGER    DATATYPE_PACK6        
+      PARAMETER (DATATYPE_PACK6         =  6)
+      INTEGER    DATATYPE_PACK7        
+      PARAMETER (DATATYPE_PACK7         =  7)
+      INTEGER    DATATYPE_PACK8        
+      PARAMETER (DATATYPE_PACK8         =  8)
+      INTEGER    DATATYPE_PACK9        
+      PARAMETER (DATATYPE_PACK9         =  9)
+      INTEGER    DATATYPE_PACK10       
+      PARAMETER (DATATYPE_PACK10        = 10)
+      INTEGER    DATATYPE_PACK11       
+      PARAMETER (DATATYPE_PACK11        = 11)
+      INTEGER    DATATYPE_PACK12       
+      PARAMETER (DATATYPE_PACK12        = 12)
+      INTEGER    DATATYPE_PACK13       
+      PARAMETER (DATATYPE_PACK13        = 13)
+      INTEGER    DATATYPE_PACK14       
+      PARAMETER (DATATYPE_PACK14        = 14)
+      INTEGER    DATATYPE_PACK15       
+      PARAMETER (DATATYPE_PACK15        = 15)
+      INTEGER    DATATYPE_PACK16       
+      PARAMETER (DATATYPE_PACK16        = 16)
+      INTEGER    DATATYPE_PACK17       
+      PARAMETER (DATATYPE_PACK17        = 17)
+      INTEGER    DATATYPE_PACK18       
+      PARAMETER (DATATYPE_PACK18        = 18)
+      INTEGER    DATATYPE_PACK19       
+      PARAMETER (DATATYPE_PACK19        = 19)
+      INTEGER    DATATYPE_PACK20       
+      PARAMETER (DATATYPE_PACK20        = 20)
+      INTEGER    DATATYPE_PACK21       
+      PARAMETER (DATATYPE_PACK21        = 21)
+      INTEGER    DATATYPE_PACK22       
+      PARAMETER (DATATYPE_PACK22        = 22)
+      INTEGER    DATATYPE_PACK23       
+      PARAMETER (DATATYPE_PACK23        = 23)
+      INTEGER    DATATYPE_PACK24       
+      PARAMETER (DATATYPE_PACK24        = 24)
+      INTEGER    DATATYPE_PACK25       
+      PARAMETER (DATATYPE_PACK25        = 25)
+      INTEGER    DATATYPE_PACK26       
+      PARAMETER (DATATYPE_PACK26        = 26)
+      INTEGER    DATATYPE_PACK27       
+      PARAMETER (DATATYPE_PACK27        = 27)
+      INTEGER    DATATYPE_PACK28       
+      PARAMETER (DATATYPE_PACK28        = 28)
+      INTEGER    DATATYPE_PACK29       
+      PARAMETER (DATATYPE_PACK29        = 29)
+      INTEGER    DATATYPE_PACK30       
+      PARAMETER (DATATYPE_PACK30        = 30)
+      INTEGER    DATATYPE_PACK31       
+      PARAMETER (DATATYPE_PACK31        = 31)
+      INTEGER    DATATYPE_PACK32       
+      PARAMETER (DATATYPE_PACK32        = 32)
+      INTEGER    DATATYPE_CPX32        
+      PARAMETER (DATATYPE_CPX32         = 64)
+      INTEGER    DATATYPE_CPX64        
+      PARAMETER (DATATYPE_CPX64         = 128)
+      INTEGER    DATATYPE_FLT32        
+      PARAMETER (DATATYPE_FLT32         = 132)
+      INTEGER    DATATYPE_FLT64        
+      PARAMETER (DATATYPE_FLT64         = 164)
+      INTEGER    DATATYPE_INT8         
+      PARAMETER (DATATYPE_INT8          = 208)
+      INTEGER    DATATYPE_INT16        
+      PARAMETER (DATATYPE_INT16         = 216)
+      INTEGER    DATATYPE_INT32        
+      PARAMETER (DATATYPE_INT32         = 232)
+      INTEGER    DATATYPE_UINT8        
+      PARAMETER (DATATYPE_UINT8         = 308)
+      INTEGER    DATATYPE_UINT16       
+      PARAMETER (DATATYPE_UINT16        = 316)
+      INTEGER    DATATYPE_UINT32       
+      PARAMETER (DATATYPE_UINT32        = 332)
+!
+!  internal data types
+!
+      INTEGER    DATATYPE_INT          
+      PARAMETER (DATATYPE_INT           = 251)
+      INTEGER    DATATYPE_FLT          
+      PARAMETER (DATATYPE_FLT           = 252)
+      INTEGER    DATATYPE_TXT          
+      PARAMETER (DATATYPE_TXT           = 253)
+      INTEGER    DATATYPE_CPX          
+      PARAMETER (DATATYPE_CPX           = 254)
+!
+!  Chunks
+!
+      INTEGER    CHUNK_AUTO            
+      PARAMETER (CHUNK_AUTO             =  1)
+      INTEGER    CHUNK_GRID            
+      PARAMETER (CHUNK_GRID             =  2)
+      INTEGER    CHUNK_LINES           
+      PARAMETER (CHUNK_LINES            =  3)
+!
+!  GRID types
+!
+      INTEGER    GRID_GENERIC          
+      PARAMETER (GRID_GENERIC           =  1)
+      INTEGER    GRID_GAUSSIAN         
+      PARAMETER (GRID_GAUSSIAN          =  2)
+      INTEGER    GRID_GAUSSIAN_REDUCED 
+      PARAMETER (GRID_GAUSSIAN_REDUCED  =  3)
+      INTEGER    GRID_LONLAT           
+      PARAMETER (GRID_LONLAT            =  4)
+      INTEGER    GRID_SPECTRAL         
+      PARAMETER (GRID_SPECTRAL          =  5)
+      INTEGER    GRID_FOURIER          
+      PARAMETER (GRID_FOURIER           =  6)
+      INTEGER    GRID_GME              
+      PARAMETER (GRID_GME               =  7)
+      INTEGER    GRID_TRAJECTORY       
+      PARAMETER (GRID_TRAJECTORY        =  8)
+      INTEGER    GRID_UNSTRUCTURED     
+      PARAMETER (GRID_UNSTRUCTURED      =  9)
+      INTEGER    GRID_CURVILINEAR      
+      PARAMETER (GRID_CURVILINEAR       = 10)
+      INTEGER    GRID_LCC              
+      PARAMETER (GRID_LCC               = 11)
+      INTEGER    GRID_LCC2             
+      PARAMETER (GRID_LCC2              = 12)
+      INTEGER    GRID_LAEA             
+      PARAMETER (GRID_LAEA              = 13)
+      INTEGER    GRID_SINUSOIDAL       
+      PARAMETER (GRID_SINUSOIDAL        = 14)
+      INTEGER    GRID_REFERENCE        
+      PARAMETER (GRID_REFERENCE         = 15)
+      INTEGER    GRID_PROJECTION       
+      PARAMETER (GRID_PROJECTION        = 16)
+!
+!  ZAXIS types
+!
+      INTEGER    ZAXIS_SURFACE         
+      PARAMETER (ZAXIS_SURFACE          =  0)
+      INTEGER    ZAXIS_GENERIC         
+      PARAMETER (ZAXIS_GENERIC          =  1)
+      INTEGER    ZAXIS_HYBRID          
+      PARAMETER (ZAXIS_HYBRID           =  2)
+      INTEGER    ZAXIS_HYBRID_HALF     
+      PARAMETER (ZAXIS_HYBRID_HALF      =  3)
+      INTEGER    ZAXIS_PRESSURE        
+      PARAMETER (ZAXIS_PRESSURE         =  4)
+      INTEGER    ZAXIS_HEIGHT          
+      PARAMETER (ZAXIS_HEIGHT           =  5)
+      INTEGER    ZAXIS_DEPTH_BELOW_SEA 
+      PARAMETER (ZAXIS_DEPTH_BELOW_SEA  =  6)
+      INTEGER    ZAXIS_DEPTH_BELOW_LAND
+      PARAMETER (ZAXIS_DEPTH_BELOW_LAND =  7)
+      INTEGER    ZAXIS_ISENTROPIC      
+      PARAMETER (ZAXIS_ISENTROPIC       =  8)
+      INTEGER    ZAXIS_TRAJECTORY      
+      PARAMETER (ZAXIS_TRAJECTORY       =  9)
+      INTEGER    ZAXIS_ALTITUDE        
+      PARAMETER (ZAXIS_ALTITUDE         = 10)
+      INTEGER    ZAXIS_SIGMA           
+      PARAMETER (ZAXIS_SIGMA            = 11)
+      INTEGER    ZAXIS_MEANSEA         
+      PARAMETER (ZAXIS_MEANSEA          = 12)
+      INTEGER    ZAXIS_TOA             
+      PARAMETER (ZAXIS_TOA              = 13)
+      INTEGER    ZAXIS_SEA_BOTTOM      
+      PARAMETER (ZAXIS_SEA_BOTTOM       = 14)
+      INTEGER    ZAXIS_ATMOSPHERE      
+      PARAMETER (ZAXIS_ATMOSPHERE       = 15)
+      INTEGER    ZAXIS_REFERENCE       
+      PARAMETER (ZAXIS_REFERENCE        = 16)
+!
+!  TIME types
+!
+      INTEGER    TIME_CONSTANT         
+      PARAMETER (TIME_CONSTANT          =  0)
+      INTEGER    TIME_VARIABLE         
+      PARAMETER (TIME_VARIABLE          =  1)
+!
+!  TSTEP types
+!
+      INTEGER    TSTEP_CONSTANT        
+      PARAMETER (TSTEP_CONSTANT         =  0)
+      INTEGER    TSTEP_INSTANT         
+      PARAMETER (TSTEP_INSTANT          =  1)
+      INTEGER    TSTEP_AVG             
+      PARAMETER (TSTEP_AVG              =  2)
+      INTEGER    TSTEP_ACCUM           
+      PARAMETER (TSTEP_ACCUM            =  3)
+      INTEGER    TSTEP_MAX             
+      PARAMETER (TSTEP_MAX              =  4)
+      INTEGER    TSTEP_MIN             
+      PARAMETER (TSTEP_MIN              =  5)
+      INTEGER    TSTEP_DIFF            
+      PARAMETER (TSTEP_DIFF             =  6)
+      INTEGER    TSTEP_RMS             
+      PARAMETER (TSTEP_RMS              =  7)
+      INTEGER    TSTEP_SD              
+      PARAMETER (TSTEP_SD               =  8)
+      INTEGER    TSTEP_COV             
+      PARAMETER (TSTEP_COV              =  9)
+      INTEGER    TSTEP_RATIO           
+      PARAMETER (TSTEP_RATIO            = 10)
+      INTEGER    TSTEP_RANGE           
+      PARAMETER (TSTEP_RANGE            = 11)
+      INTEGER    TSTEP_INSTANT2        
+      PARAMETER (TSTEP_INSTANT2         = 12)
+      INTEGER    TSTEP_INSTANT3        
+      PARAMETER (TSTEP_INSTANT3         = 13)
+!
+!  TAXIS types
+!
+      INTEGER    TAXIS_ABSOLUTE        
+      PARAMETER (TAXIS_ABSOLUTE         =  1)
+      INTEGER    TAXIS_RELATIVE        
+      PARAMETER (TAXIS_RELATIVE         =  2)
+!
+!  TUNIT types
+!
+      INTEGER    TUNIT_SECOND          
+      PARAMETER (TUNIT_SECOND           =  1)
+      INTEGER    TUNIT_MINUTE          
+      PARAMETER (TUNIT_MINUTE           =  2)
+      INTEGER    TUNIT_HOUR            
+      PARAMETER (TUNIT_HOUR             =  3)
+      INTEGER    TUNIT_DAY             
+      PARAMETER (TUNIT_DAY              =  4)
+      INTEGER    TUNIT_MONTH           
+      PARAMETER (TUNIT_MONTH            =  5)
+      INTEGER    TUNIT_YEAR            
+      PARAMETER (TUNIT_YEAR             =  6)
+      INTEGER    TUNIT_QUARTER         
+      PARAMETER (TUNIT_QUARTER          =  7)
+      INTEGER    TUNIT_3HOURS          
+      PARAMETER (TUNIT_3HOURS           =  8)
+      INTEGER    TUNIT_6HOURS          
+      PARAMETER (TUNIT_6HOURS           =  9)
+      INTEGER    TUNIT_12HOURS         
+      PARAMETER (TUNIT_12HOURS          = 10)
+!
+!  CALENDAR types
+!
+      INTEGER    CALENDAR_STANDARD     
+      PARAMETER (CALENDAR_STANDARD      =  0)
+      INTEGER    CALENDAR_PROLEPTIC    
+      PARAMETER (CALENDAR_PROLEPTIC     =  1)
+      INTEGER    CALENDAR_360DAYS      
+      PARAMETER (CALENDAR_360DAYS       =  2)
+      INTEGER    CALENDAR_365DAYS      
+      PARAMETER (CALENDAR_365DAYS       =  3)
+      INTEGER    CALENDAR_366DAYS      
+      PARAMETER (CALENDAR_366DAYS       =  4)
+      INTEGER    CALENDAR_NONE         
+      PARAMETER (CALENDAR_NONE          =  5)
+!
+!  parallel IO IOMode
+!
+      INTEGER    PIO_NONE              
+      PARAMETER (PIO_NONE               =  0)
+      INTEGER    PIO_MPI               
+      PARAMETER (PIO_MPI                =  1)
+      INTEGER    PIO_WRITER            
+      PARAMETER (PIO_WRITER             =  2)
+      INTEGER    PIO_ASYNCH            
+      PARAMETER (PIO_ASYNCH             =  3)
+      INTEGER    PIO_FPGUARD           
+      PARAMETER (PIO_FPGUARD            =  4)
+!
+!  parallel IO routines
+!
+!                     pioEndDef
+      EXTERNAL        pioEndDef
+
+!                     pioEndTimestepping
+      EXTERNAL        pioEndTimestepping
+
+!                     pioFinalize
+      EXTERNAL        pioFinalize
+
+      INTEGER         pioInit
+!                                    (INTEGER         ,
+!                                     INTEGER         ,
+!                                     INTEGER         ,
+!                                     INTEGER         ,
+!                                     INTEGER         )
+      EXTERNAL        pioInit
+
+      INTEGER         pioInqVarDecoChunk
+!                                    (INTEGER         ,
+!                                     INTEGER         )
+      EXTERNAL        pioInqVarDecoChunk
+
+      INTEGER         pioInqVarDecoOff
+!                                    (INTEGER         ,
+!                                     INTEGER         )
+      EXTERNAL        pioInqVarDecoOff
+
+!                     pioNamespaceSetActive
+!                                    (INTEGER         )
+      EXTERNAL        pioNamespaceSetActive
+
+!                     pioWriteTimestep
+!                                    (INTEGER         ,
+!                                     INTEGER         ,
+!                                     INTEGER         )
+      EXTERNAL        pioWriteTimestep
+
+!
+!  CDI control routines
+!
+!                     cdiReset
+      EXTERNAL        cdiReset
+
+      CHARACTER(80)   cdiStringError
+!                                    (INTEGER         cdiErrno)
+      EXTERNAL        cdiStringError
+
+!                     cdiDebug
+!                                    (INTEGER         debug)
+      EXTERNAL        cdiDebug
+
+      CHARACTER(80)   cdiLibraryVersion
+      EXTERNAL        cdiLibraryVersion
+
+!                     cdiPrintVersion
+      EXTERNAL        cdiPrintVersion
+
+!                     cdiDefMissval
+!                                    (DOUBLEPRECISION missval)
+      EXTERNAL        cdiDefMissval
+
+      DOUBLEPRECISION cdiInqMissval
+      EXTERNAL        cdiInqMissval
+
+!                     cdiDefGlobal
+!                                    (CHARACTER*(*)   string,
+!                                     INTEGER         val)
+      EXTERNAL        cdiDefGlobal
+
+!
+!  CDI converter routines
+!
+!
+!  parameter
+!
+!                     cdiParamToString
+!                                    (INTEGER         param,
+!                                     CHARACTER*(*)   paramstr,
+!                                     INTEGER         maxlen)
+      EXTERNAL        cdiParamToString
+
+!                     cdiDecodeParam
+!                                    (INTEGER         param,
+!                                     INTEGER         pnum,
+!                                     INTEGER         pcat,
+!                                     INTEGER         pdis)
+      EXTERNAL        cdiDecodeParam
+
+      INTEGER         cdiEncodeParam
+!                                    (INTEGER         pnum,
+!                                     INTEGER         pcat,
+!                                     INTEGER         pdis)
+      EXTERNAL        cdiEncodeParam
+
+!                     cdiDecodeDate
+!                                    (INTEGER         date,
+!                                     INTEGER         year,
+!                                     INTEGER         month,
+!                                     INTEGER         day)
+      EXTERNAL        cdiDecodeDate
+
+      INTEGER         cdiEncodeDate
+!                                    (INTEGER         year,
+!                                     INTEGER         month,
+!                                     INTEGER         day)
+      EXTERNAL        cdiEncodeDate
+
+!                     cdiDecodeTime
+!                                    (INTEGER         time,
+!                                     INTEGER         hour,
+!                                     INTEGER         minute,
+!                                     INTEGER         second)
+      EXTERNAL        cdiDecodeTime
+
+      INTEGER         cdiEncodeTime
+!                                    (INTEGER         hour,
+!                                     INTEGER         minute,
+!                                     INTEGER         second)
+      EXTERNAL        cdiEncodeTime
+
+!
+!  STREAM control routines
+!
+      INTEGER         streamOpenRead
+!                                    (CHARACTER*(*)   path)
+      EXTERNAL        streamOpenRead
+
+      INTEGER         streamOpenWrite
+!                                    (CHARACTER*(*)   path,
+!                                     INTEGER         filetype)
+      EXTERNAL        streamOpenWrite
+
+      INTEGER         streamOpenAppend
+!                                    (CHARACTER*(*)   path)
+      EXTERNAL        streamOpenAppend
+
+!                     streamClose
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamClose
+
+!                     streamSync
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamSync
+
+!                     streamDefVlist
+!                                    (INTEGER         streamID,
+!                                     INTEGER         vlistID)
+      EXTERNAL        streamDefVlist
+
+      INTEGER         streamInqVlist
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamInqVlist
+
+      INTEGER         streamInqVlistIDorig
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamInqVlistIDorig
+
+      INTEGER         streamInqFiletype
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamInqFiletype
+
+!                     streamDefByteorder
+!                                    (INTEGER         streamID,
+!                                     INTEGER         byteorder)
+      EXTERNAL        streamDefByteorder
+
+      INTEGER         streamInqByteorder
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamInqByteorder
+
+!                     streamDefCompType
+!                                    (INTEGER         streamID,
+!                                     INTEGER         comptype)
+      EXTERNAL        streamDefCompType
+
+!                     streamDefCompLevel
+!                                    (INTEGER         streamID,
+!                                     INTEGER         complevel)
+      EXTERNAL        streamDefCompLevel
+
+      INTEGER         streamInqCompType
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamInqCompType
+
+      INTEGER         streamInqCompLevel
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamInqCompLevel
+
+      INTEGER         streamDefTimestep
+!                                    (INTEGER         streamID,
+!                                     INTEGER         tsID)
+      EXTERNAL        streamDefTimestep
+
+      INTEGER         streamInqTimestep
+!                                    (INTEGER         streamID,
+!                                     INTEGER         tsID)
+      EXTERNAL        streamInqTimestep
+
+      CHARACTER(80)   streamFilename
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamFilename
+
+      CHARACTER(80)   streamFilesuffix
+!                                    (INTEGER         filetype)
+      EXTERNAL        streamFilesuffix
+
+      INTEGER         streamNtsteps
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamNtsteps
+
+      INTEGER         streamInqNvars
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamInqNvars
+
+!
+!  STREAM var I/O routines
+!
+!                     streamReadVar
+!                                    (INTEGER         streamID,
+!                                     INTEGER         varID,
+!                                     DOUBLEPRECISION data_vec,
+!                                     INTEGER         nmiss)
+      EXTERNAL        streamReadVar
+
+!                     streamWriteVar
+!                                    (INTEGER         streamID,
+!                                     INTEGER         varID,
+!                                     DOUBLEPRECISION data_vec,
+!                                     INTEGER         nmiss)
+      EXTERNAL        streamWriteVar
+
+!                     streamWriteVarF
+!                                    (INTEGER         streamID,
+!                                     INTEGER         varID,
+!                                     REAL            data_vec,
+!                                     INTEGER         nmiss)
+      EXTERNAL        streamWriteVarF
+
+!                     streamReadVarSlice
+!                                    (INTEGER         streamID,
+!                                     INTEGER         varID,
+!                                     INTEGER         levelID,
+!                                     DOUBLEPRECISION data_vec,
+!                                     INTEGER         nmiss)
+      EXTERNAL        streamReadVarSlice
+
+!                     streamWriteVarSlice
+!                                    (INTEGER         streamID,
+!                                     INTEGER         varID,
+!                                     INTEGER         levelID,
+!                                     DOUBLEPRECISION data_vec,
+!                                     INTEGER         nmiss)
+      EXTERNAL        streamWriteVarSlice
+
+!                     streamWriteVarSliceF
+!                                    (INTEGER         streamID,
+!                                     INTEGER         varID,
+!                                     INTEGER         levelID,
+!                                     REAL            data_vec,
+!                                     INTEGER         nmiss)
+      EXTERNAL        streamWriteVarSliceF
+
+!
+!  STREAM record I/O routines
+!
+!                     streamInqRecord
+!                                    (INTEGER         streamID,
+!                                     INTEGER         varID,
+!                                     INTEGER         levelID)
+      EXTERNAL        streamInqRecord
+
+!                     streamDefRecord
+!                                    (INTEGER         streamID,
+!                                     INTEGER         varID,
+!                                     INTEGER         levelID)
+      EXTERNAL        streamDefRecord
+
+!                     streamReadRecord
+!                                    (INTEGER         streamID,
+!                                     DOUBLEPRECISION data_vec,
+!                                     INTEGER         nmiss)
+      EXTERNAL        streamReadRecord
+
+!                     streamWriteRecord
+!                                    (INTEGER         streamID,
+!                                     DOUBLEPRECISION data_vec,
+!                                     INTEGER         nmiss)
+      EXTERNAL        streamWriteRecord
+
+!                     streamWriteRecordF
+!                                    (INTEGER         streamID,
+!                                     REAL            data_vec,
+!                                     INTEGER         nmiss)
+      EXTERNAL        streamWriteRecordF
+
+!                     streamCopyRecord
+!                                    (INTEGER         streamIDdest,
+!                                     INTEGER         streamIDsrc)
+      EXTERNAL        streamCopyRecord
+
+!                     streamInqGinfo
+!                                    (INTEGER         streamID,
+!                                     INTEGER         intnum,
+!                                     REAL            fltnum)
+      EXTERNAL        streamInqGinfo
+
+!
+!  VLIST routines
+!
+      INTEGER         vlistCreate
+      EXTERNAL        vlistCreate
+
+!                     vlistDestroy
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistDestroy
+
+      INTEGER         vlistDuplicate
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistDuplicate
+
+!                     vlistCopy
+!                                    (INTEGER         vlistID2,
+!                                     INTEGER         vlistID1)
+      EXTERNAL        vlistCopy
+
+!                     vlistCopyFlag
+!                                    (INTEGER         vlistID2,
+!                                     INTEGER         vlistID1)
+      EXTERNAL        vlistCopyFlag
+
+!                     vlistClearFlag
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistClearFlag
+
+!                     vlistCat
+!                                    (INTEGER         vlistID2,
+!                                     INTEGER         vlistID1)
+      EXTERNAL        vlistCat
+
+!                     vlistMerge
+!                                    (INTEGER         vlistID2,
+!                                     INTEGER         vlistID1)
+      EXTERNAL        vlistMerge
+
+!                     vlistPrint
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistPrint
+
+      INTEGER         vlistNumber
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistNumber
+
+      INTEGER         vlistNvars
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistNvars
+
+      INTEGER         vlistNgrids
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistNgrids
+
+      INTEGER         vlistNzaxis
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistNzaxis
+
+!                     vlistDefNtsteps
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         nts)
+      EXTERNAL        vlistDefNtsteps
+
+      INTEGER         vlistNtsteps
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistNtsteps
+
+      INTEGER         vlistGridsizeMax
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistGridsizeMax
+
+      INTEGER         vlistGrid
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         index)
+      EXTERNAL        vlistGrid
+
+      INTEGER         vlistGridIndex
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         gridID)
+      EXTERNAL        vlistGridIndex
+
+!                     vlistChangeGridIndex
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         index,
+!                                     INTEGER         gridID)
+      EXTERNAL        vlistChangeGridIndex
+
+!                     vlistChangeGrid
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         gridID1,
+!                                     INTEGER         gridID2)
+      EXTERNAL        vlistChangeGrid
+
+      INTEGER         vlistZaxis
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         index)
+      EXTERNAL        vlistZaxis
+
+      INTEGER         vlistZaxisIndex
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         zaxisID)
+      EXTERNAL        vlistZaxisIndex
+
+!                     vlistChangeZaxisIndex
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         index,
+!                                     INTEGER         zaxisID)
+      EXTERNAL        vlistChangeZaxisIndex
+
+!                     vlistChangeZaxis
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         zaxisID1,
+!                                     INTEGER         zaxisID2)
+      EXTERNAL        vlistChangeZaxis
+
+      INTEGER         vlistNrecs
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistNrecs
+
+!                     vlistDefTaxis
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         taxisID)
+      EXTERNAL        vlistDefTaxis
+
+      INTEGER         vlistInqTaxis
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistInqTaxis
+
+!                     vlistDefTable
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         tableID)
+      EXTERNAL        vlistDefTable
+
+      INTEGER         vlistInqTable
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistInqTable
+
+!                     vlistDefInstitut
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         instID)
+      EXTERNAL        vlistDefInstitut
+
+      INTEGER         vlistInqInstitut
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistInqInstitut
+
+!                     vlistDefModel
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         modelID)
+      EXTERNAL        vlistDefModel
+
+      INTEGER         vlistInqModel
+!                                    (INTEGER         vlistID)
+      EXTERNAL        vlistInqModel
+
+!
+!  VLIST VAR routines
+!
+      INTEGER         vlistDefVar
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         gridID,
+!                                     INTEGER         zaxisID,
+!                                     INTEGER         tsteptype)
+      EXTERNAL        vlistDefVar
+
+!                     vlistChangeVarGrid
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         gridID)
+      EXTERNAL        vlistChangeVarGrid
+
+!                     vlistChangeVarZaxis
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         zaxisID)
+      EXTERNAL        vlistChangeVarZaxis
+
+!                     vlistInqVar
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         gridID,
+!                                     INTEGER         zaxisID,
+!                                     INTEGER         tsteptype)
+      EXTERNAL        vlistInqVar
+
+      INTEGER         vlistInqVarGrid
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarGrid
+
+      INTEGER         vlistInqVarZaxis
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarZaxis
+
+!
+!  used in MPIOM
+!
+      INTEGER         vlistInqVarID
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         code)
+      EXTERNAL        vlistInqVarID
+
+      INTEGER         vlistInqVarTsteptype
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarTsteptype
+
+!                     vlistDefVarTsteptype
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         tsteptype)
+      EXTERNAL        vlistDefVarTsteptype
+
+!                     vlistDefVarCompType
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         comptype)
+      EXTERNAL        vlistDefVarCompType
+
+      INTEGER         vlistInqVarCompType
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarCompType
+
+!                     vlistDefVarCompLevel
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         complevel)
+      EXTERNAL        vlistDefVarCompLevel
+
+      INTEGER         vlistInqVarCompLevel
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarCompLevel
+
+!                     vlistDefVarParam
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         param)
+      EXTERNAL        vlistDefVarParam
+
+      INTEGER         vlistInqVarParam
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarParam
+
+!                     vlistDefVarCode
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         code)
+      EXTERNAL        vlistDefVarCode
+
+      INTEGER         vlistInqVarCode
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarCode
+
+!                     vlistDefVarDatatype
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         datatype)
+      EXTERNAL        vlistDefVarDatatype
+
+      INTEGER         vlistInqVarDatatype
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarDatatype
+
+!                     vlistDefVarChunkType
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         chunktype)
+      EXTERNAL        vlistDefVarChunkType
+
+      INTEGER         vlistInqVarChunkType
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarChunkType
+
+!                     vlistDefVarXYZ
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         xyz)
+      EXTERNAL        vlistDefVarXYZ
+
+      INTEGER         vlistInqVarXYZ
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarXYZ
+
+      INTEGER         vlistInqVarNumber
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarNumber
+
+!                     vlistDefVarInstitut
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         instID)
+      EXTERNAL        vlistDefVarInstitut
+
+      INTEGER         vlistInqVarInstitut
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarInstitut
+
+!                     vlistDefVarModel
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         modelID)
+      EXTERNAL        vlistDefVarModel
+
+      INTEGER         vlistInqVarModel
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarModel
+
+!                     vlistDefVarTable
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         tableID)
+      EXTERNAL        vlistDefVarTable
+
+      INTEGER         vlistInqVarTable
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarTable
+
+!                     vlistDefVarName
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   name)
+      EXTERNAL        vlistDefVarName
+
+!                     vlistInqVarName
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   name)
+      EXTERNAL        vlistInqVarName
+
+!                     vlistDefVarStdname
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   stdname)
+      EXTERNAL        vlistDefVarStdname
+
+!                     vlistInqVarStdname
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   stdname)
+      EXTERNAL        vlistInqVarStdname
+
+!                     vlistDefVarLongname
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   longname)
+      EXTERNAL        vlistDefVarLongname
+
+!                     vlistInqVarLongname
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   longname)
+      EXTERNAL        vlistInqVarLongname
+
+!                     vlistDefVarUnits
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   units)
+      EXTERNAL        vlistDefVarUnits
+
+!                     vlistInqVarUnits
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   units)
+      EXTERNAL        vlistInqVarUnits
+
+!                     vlistDefVarMissval
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     DOUBLEPRECISION missval)
+      EXTERNAL        vlistDefVarMissval
+
+      DOUBLEPRECISION vlistInqVarMissval
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarMissval
+
+!                     vlistDefVarScalefactor
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     DOUBLEPRECISION scalefactor)
+      EXTERNAL        vlistDefVarScalefactor
+
+      DOUBLEPRECISION vlistInqVarScalefactor
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarScalefactor
+
+!                     vlistDefVarAddoffset
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     DOUBLEPRECISION addoffset)
+      EXTERNAL        vlistDefVarAddoffset
+
+      DOUBLEPRECISION vlistInqVarAddoffset
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarAddoffset
+
+!                     vlistDefVarTimave
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         timave)
+      EXTERNAL        vlistDefVarTimave
+
+      INTEGER         vlistInqVarTimave
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarTimave
+
+!                     vlistDefVarTimaccu
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         timaccu)
+      EXTERNAL        vlistDefVarTimaccu
+
+      INTEGER         vlistInqVarTimaccu
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarTimaccu
+
+      INTEGER         vlistInqVarSize
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistInqVarSize
+
+!                     vlistDefIndex
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         levID,
+!                                     INTEGER         index)
+      EXTERNAL        vlistDefIndex
+
+      INTEGER         vlistInqIndex
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         levID)
+      EXTERNAL        vlistInqIndex
+
+!                     vlistDefFlag
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         levID,
+!                                     INTEGER         flag)
+      EXTERNAL        vlistDefFlag
+
+      INTEGER         vlistInqFlag
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         levID)
+      EXTERNAL        vlistInqFlag
+
+      INTEGER         vlistFindVar
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         fvarID)
+      EXTERNAL        vlistFindVar
+
+      INTEGER         vlistFindLevel
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         fvarID,
+!                                     INTEGER         flevelID)
+      EXTERNAL        vlistFindLevel
+
+      INTEGER         vlistMergedVar
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID)
+      EXTERNAL        vlistMergedVar
+
+      INTEGER         vlistMergedLevel
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         levelID)
+      EXTERNAL        vlistMergedLevel
+
+!
+!  Ensemble info routines
+!
+!                     vlistDefVarEnsemble
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         ensID,
+!                                     INTEGER         ensCount,
+!                                     INTEGER         forecast_type)
+      EXTERNAL        vlistDefVarEnsemble
+
+      INTEGER         vlistInqVarEnsemble
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         ensID,
+!                                     INTEGER         ensCount,
+!                                     INTEGER         forecast_type)
+      EXTERNAL        vlistInqVarEnsemble
+
+!
+!  VLIST attributes
+!
+      INTEGER         vlistInqNatts
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         nattsp)
+      EXTERNAL        vlistInqNatts
+
+      INTEGER         vlistInqAtt
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     INTEGER         attrnum,
+!                                     CHARACTER*(*)   name,
+!                                     INTEGER         typep,
+!                                     INTEGER         lenp)
+      EXTERNAL        vlistInqAtt
+
+      INTEGER         vlistDelAtt
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   name)
+      EXTERNAL        vlistDelAtt
+
+      INTEGER         vlistDefAttInt
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   name,
+!                                     INTEGER         type,
+!                                     INTEGER         len,
+!                                     INTEGER         ip_vec)
+      EXTERNAL        vlistDefAttInt
+
+      INTEGER         vlistDefAttFlt
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   name,
+!                                     INTEGER         type,
+!                                     INTEGER         len,
+!                                     DOUBLEPRECISION dp_vec)
+      EXTERNAL        vlistDefAttFlt
+
+      INTEGER         vlistDefAttTxt
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   name,
+!                                     INTEGER         len,
+!                                     CHARACTER*(*)   tp)
+      EXTERNAL        vlistDefAttTxt
+
+      INTEGER         vlistInqAttInt
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   name,
+!                                     INTEGER         mlen,
+!                                     INTEGER         ip_vec)
+      EXTERNAL        vlistInqAttInt
+
+      INTEGER         vlistInqAttFlt
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   name,
+!                                     INTEGER         mlen,
+!                                     DOUBLEPRECISION dp_vec)
+      EXTERNAL        vlistInqAttFlt
+
+      INTEGER         vlistInqAttTxt
+!                                    (INTEGER         vlistID,
+!                                     INTEGER         varID,
+!                                     CHARACTER*(*)   name,
+!                                     INTEGER         mlen,
+!                                     CHARACTER*(*)   tp)
+      EXTERNAL        vlistInqAttTxt
+
+!
+!  GRID routines
+!
+!                     gridName
+!                                    (INTEGER         gridtype,
+!                                     CHARACTER*(*)   gridname)
+      EXTERNAL        gridName
+
+      CHARACTER(80)   gridNamePtr
+!                                    (INTEGER         gridtype)
+      EXTERNAL        gridNamePtr
+
+!                     gridCompress
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridCompress
+
+!                     gridDefMaskGME
+!                                    (INTEGER         gridID,
+!                                     INTEGER         mask_vec)
+      EXTERNAL        gridDefMaskGME
+
+      INTEGER         gridInqMaskGME
+!                                    (INTEGER         gridID,
+!                                     INTEGER         mask_vec)
+      EXTERNAL        gridInqMaskGME
+
+!                     gridDefMask
+!                                    (INTEGER         gridID,
+!                                     INTEGER         mask_vec)
+      EXTERNAL        gridDefMask
+
+      INTEGER         gridInqMask
+!                                    (INTEGER         gridID,
+!                                     INTEGER         mask_vec)
+      EXTERNAL        gridInqMask
+
+!                     gridPrint
+!                                    (INTEGER         gridID,
+!                                     INTEGER         opt)
+      EXTERNAL        gridPrint
+
+      INTEGER         gridSize
+      EXTERNAL        gridSize
+
+      INTEGER         gridCreate
+!                                    (INTEGER         gridtype,
+!                                     INTEGER         size)
+      EXTERNAL        gridCreate
+
+!                     gridDestroy
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridDestroy
+
+      INTEGER         gridDuplicate
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridDuplicate
+
+      INTEGER         gridInqType
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqType
+
+      INTEGER         gridInqSize
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqSize
+
+!                     gridDefXsize
+!                                    (INTEGER         gridID,
+!                                     INTEGER         xsize)
+      EXTERNAL        gridDefXsize
+
+      INTEGER         gridInqXsize
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqXsize
+
+!                     gridDefYsize
+!                                    (INTEGER         gridID,
+!                                     INTEGER         ysize)
+      EXTERNAL        gridDefYsize
+
+      INTEGER         gridInqYsize
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqYsize
+
+!                     gridDefNP
+!                                    (INTEGER         gridID,
+!                                     INTEGER         np)
+      EXTERNAL        gridDefNP
+
+      INTEGER         gridInqNP
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqNP
+
+!                     gridDefXvals
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION xvals_vec)
+      EXTERNAL        gridDefXvals
+
+      INTEGER         gridInqXvals
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION xvals_vec)
+      EXTERNAL        gridInqXvals
+
+!                     gridDefYvals
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION yvals_vec)
+      EXTERNAL        gridDefYvals
+
+      INTEGER         gridInqYvals
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION yvals_vec)
+      EXTERNAL        gridInqYvals
+
+!                     gridDefXname
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   xname)
+      EXTERNAL        gridDefXname
+
+!                     gridDefXlongname
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   xlongname)
+      EXTERNAL        gridDefXlongname
+
+!                     gridDefXunits
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   xunits)
+      EXTERNAL        gridDefXunits
+
+!                     gridDefYname
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   yname)
+      EXTERNAL        gridDefYname
+
+!                     gridDefYlongname
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   ylongname)
+      EXTERNAL        gridDefYlongname
+
+!                     gridDefYunits
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   yunits)
+      EXTERNAL        gridDefYunits
+
+!                     gridInqXname
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   xname)
+      EXTERNAL        gridInqXname
+
+!                     gridInqXlongname
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   xlongname)
+      EXTERNAL        gridInqXlongname
+
+!                     gridInqXstdname
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   xstdname)
+      EXTERNAL        gridInqXstdname
+
+!                     gridInqXunits
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   xunits)
+      EXTERNAL        gridInqXunits
+
+!                     gridInqYname
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   yname)
+      EXTERNAL        gridInqYname
+
+!                     gridInqYlongname
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   ylongname)
+      EXTERNAL        gridInqYlongname
+
+!                     gridInqYstdname
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   ystdname)
+      EXTERNAL        gridInqYstdname
+
+!                     gridInqYunits
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   yunits)
+      EXTERNAL        gridInqYunits
+
+!                     gridDefPrec
+!                                    (INTEGER         gridID,
+!                                     INTEGER         prec)
+      EXTERNAL        gridDefPrec
+
+      INTEGER         gridInqPrec
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqPrec
+
+      DOUBLEPRECISION gridInqXval
+!                                    (INTEGER         gridID,
+!                                     INTEGER         index)
+      EXTERNAL        gridInqXval
+
+      DOUBLEPRECISION gridInqYval
+!                                    (INTEGER         gridID,
+!                                     INTEGER         index)
+      EXTERNAL        gridInqYval
+
+      DOUBLEPRECISION gridInqXinc
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqXinc
+
+      DOUBLEPRECISION gridInqYinc
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqYinc
+
+      INTEGER         gridIsCircular
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridIsCircular
+
+      INTEGER         gridIsRotated
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridIsRotated
+
+      DOUBLEPRECISION gridInqXpole
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqXpole
+
+!                     gridDefXpole
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION xpole)
+      EXTERNAL        gridDefXpole
+
+      DOUBLEPRECISION gridInqYpole
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqYpole
+
+!                     gridDefYpole
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION ypole)
+      EXTERNAL        gridDefYpole
+
+      DOUBLEPRECISION gridInqAngle
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqAngle
+
+!                     gridDefAngle
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION angle)
+      EXTERNAL        gridDefAngle
+
+!                     gridDefTrunc
+!                                    (INTEGER         gridID,
+!                                     INTEGER         trunc)
+      EXTERNAL        gridDefTrunc
+
+      INTEGER         gridInqTrunc
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqTrunc
+
+!
+!  Hexagonal GME grid
+!
+      INTEGER         gridInqGMEnd
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqGMEnd
+
+!                     gridDefGMEnd
+!                                    (INTEGER         gridID,
+!                                     INTEGER         nd)
+      EXTERNAL        gridDefGMEnd
+
+      INTEGER         gridInqGMEni
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqGMEni
+
+!                     gridDefGMEni
+!                                    (INTEGER         gridID,
+!                                     INTEGER         ni)
+      EXTERNAL        gridDefGMEni
+
+      INTEGER         gridInqGMEni2
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqGMEni2
+
+!                     gridDefGMEni2
+!                                    (INTEGER         gridID,
+!                                     INTEGER         ni2)
+      EXTERNAL        gridDefGMEni2
+
+      INTEGER         gridInqGMEni3
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqGMEni3
+
+!                     gridDefGMEni3
+!                                    (INTEGER         gridID,
+!                                     INTEGER         ni3)
+      EXTERNAL        gridDefGMEni3
+
+!
+!  Reference grid
+!
+      INTEGER         gridInqNumber
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqNumber
+
+!                     gridDefNumber
+!                                    (INTEGER         gridID,
+!                                     INTEGER         number)
+      EXTERNAL        gridDefNumber
+
+      INTEGER         gridInqPosition
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqPosition
+
+!                     gridDefPosition
+!                                    (INTEGER         gridID,
+!                                     INTEGER         position)
+      EXTERNAL        gridDefPosition
+
+      INTEGER         gridInqReference
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   reference)
+      EXTERNAL        gridInqReference
+
+!                     gridDefReference
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   reference)
+      EXTERNAL        gridDefReference
+
+      CHARACTER(80)   gridInqUUID
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   uuid)
+      EXTERNAL        gridInqUUID
+
+!                     gridDefUUID
+!                                    (INTEGER         gridID,
+!                                     CHARACTER*(*)   uuid)
+      EXTERNAL        gridDefUUID
+
+!
+!  Lambert Conformal Conic grid (GRIB version)
+!
+!                     gridDefLCC
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION originLon,
+!                                     DOUBLEPRECISION originLat,
+!                                     DOUBLEPRECISION lonParY,
+!                                     DOUBLEPRECISION lat1,
+!                                     DOUBLEPRECISION lat2,
+!                                     DOUBLEPRECISION xinc,
+!                                     DOUBLEPRECISION yinc,
+!                                     INTEGER         projflag,
+!                                     INTEGER         scanflag)
+      EXTERNAL        gridDefLCC
+
+!                     gridInqLCC
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION originLon,
+!                                     DOUBLEPRECISION originLat,
+!                                     DOUBLEPRECISION lonParY,
+!                                     DOUBLEPRECISION lat1,
+!                                     DOUBLEPRECISION lat2,
+!                                     DOUBLEPRECISION xinc,
+!                                     DOUBLEPRECISION yinc,
+!                                     INTEGER         projflag,
+!                                     INTEGER         scanflag)
+      EXTERNAL        gridInqLCC
+
+!
+!  Lambert Conformal Conic 2 grid (PROJ version)
+!
+!                     gridDefLcc2
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION earth_radius,
+!                                     DOUBLEPRECISION lon_0,
+!                                     DOUBLEPRECISION lat_0,
+!                                     DOUBLEPRECISION lat_1,
+!                                     DOUBLEPRECISION lat_2)
+      EXTERNAL        gridDefLcc2
+
+!                     gridInqLcc2
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION earth_radius,
+!                                     DOUBLEPRECISION lon_0,
+!                                     DOUBLEPRECISION lat_0,
+!                                     DOUBLEPRECISION lat_1,
+!                                     DOUBLEPRECISION lat_2)
+      EXTERNAL        gridInqLcc2
+
+!
+!  Lambert Azimuthal Equal Area grid
+!
+!                     gridDefLaea
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION earth_radius,
+!                                     DOUBLEPRECISION lon_0,
+!                                     DOUBLEPRECISION lat_0)
+      EXTERNAL        gridDefLaea
+
+!                     gridInqLaea
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION earth_radius,
+!                                     DOUBLEPRECISION lon_0,
+!                                     DOUBLEPRECISION lat_0)
+      EXTERNAL        gridInqLaea
+
+!                     gridDefArea
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION area_vec)
+      EXTERNAL        gridDefArea
+
+!                     gridInqArea
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION area_vec)
+      EXTERNAL        gridInqArea
+
+      INTEGER         gridHasArea
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridHasArea
+
+!                     gridDefNvertex
+!                                    (INTEGER         gridID,
+!                                     INTEGER         nvertex)
+      EXTERNAL        gridDefNvertex
+
+      INTEGER         gridInqNvertex
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqNvertex
+
+!                     gridDefXbounds
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION xbounds_vec)
+      EXTERNAL        gridDefXbounds
+
+      INTEGER         gridInqXbounds
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION xbounds_vec)
+      EXTERNAL        gridInqXbounds
+
+!                     gridDefYbounds
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION ybounds_vec)
+      EXTERNAL        gridDefYbounds
+
+      INTEGER         gridInqYbounds
+!                                    (INTEGER         gridID,
+!                                     DOUBLEPRECISION ybounds_vec)
+      EXTERNAL        gridInqYbounds
+
+!                     gridDefRowlon
+!                                    (INTEGER         gridID,
+!                                     INTEGER         nrowlon,
+!                                     INTEGER         rowlon_vec)
+      EXTERNAL        gridDefRowlon
+
+!                     gridInqRowlon
+!                                    (INTEGER         gridID,
+!                                     INTEGER         rowlon_vec)
+      EXTERNAL        gridInqRowlon
+
+!                     gridChangeType
+!                                    (INTEGER         gridID,
+!                                     INTEGER         gridtype)
+      EXTERNAL        gridChangeType
+
+!                     gridDefComplexPacking
+!                                    (INTEGER         gridID,
+!                                     INTEGER         lpack)
+      EXTERNAL        gridDefComplexPacking
+
+      INTEGER         gridInqComplexPacking
+!                                    (INTEGER         gridID)
+      EXTERNAL        gridInqComplexPacking
+
+!
+!  ZAXIS routines
+!
+!                     zaxisName
+!                                    (INTEGER         zaxistype,
+!                                     CHARACTER*(*)   zaxisname)
+      EXTERNAL        zaxisName
+
+      INTEGER         zaxisCreate
+!                                    (INTEGER         zaxistype,
+!                                     INTEGER         size)
+      EXTERNAL        zaxisCreate
+
+!                     zaxisDestroy
+!                                    (INTEGER         zaxisID)
+      EXTERNAL        zaxisDestroy
+
+      INTEGER         zaxisInqType
+!                                    (INTEGER         zaxisID)
+      EXTERNAL        zaxisInqType
+
+      INTEGER         zaxisInqSize
+!                                    (INTEGER         zaxisID)
+      EXTERNAL        zaxisInqSize
+
+      INTEGER         zaxisDuplicate
+!                                    (INTEGER         zaxisID)
+      EXTERNAL        zaxisDuplicate
+
+!                     zaxisResize
+!                                    (INTEGER         zaxisID,
+!                                     INTEGER         size)
+      EXTERNAL        zaxisResize
+
+!                     zaxisPrint
+!                                    (INTEGER         zaxisID)
+      EXTERNAL        zaxisPrint
+
+      INTEGER         zaxisSize
+      EXTERNAL        zaxisSize
+
+!                     zaxisDefLevels
+!                                    (INTEGER         zaxisID,
+!                                     DOUBLEPRECISION levels_vec)
+      EXTERNAL        zaxisDefLevels
+
+!                     zaxisInqLevels
+!                                    (INTEGER         zaxisID,
+!                                     DOUBLEPRECISION levels_vec)
+      EXTERNAL        zaxisInqLevels
+
+!                     zaxisDefLevel
+!                                    (INTEGER         zaxisID,
+!                                     INTEGER         levelID,
+!                                     DOUBLEPRECISION levels)
+      EXTERNAL        zaxisDefLevel
+
+      DOUBLEPRECISION zaxisInqLevel
+!                                    (INTEGER         zaxisID,
+!                                     INTEGER         levelID)
+      EXTERNAL        zaxisInqLevel
+
+!                     zaxisDefReference
+!                                    (INTEGER         zaxisID,
+!                                     INTEGER         refID)
+      EXTERNAL        zaxisDefReference
+
+!                     zaxisDefUUID
+!                                    (INTEGER         zaxisID,
+!                                     CHARACTER*(*)   uuid)
+      EXTERNAL        zaxisDefUUID
+
+      CHARACTER(80)   zaxisInqUUID
+!                                    (INTEGER         zaxisID,
+!                                     CHARACTER*(*)   uuid)
+      EXTERNAL        zaxisInqUUID
+
+      INTEGER         zaxisInqReference
+!                                    (INTEGER         zaxisID)
+      EXTERNAL        zaxisInqReference
+
+!                     zaxisDefName
+!                                    (INTEGER         zaxisID,
+!                                     CHARACTER*(*)   name)
+      EXTERNAL        zaxisDefName
+
+!                     zaxisDefLongname
+!                                    (INTEGER         zaxisID,
+!                                     CHARACTER*(*)   longname)
+      EXTERNAL        zaxisDefLongname
+
+!                     zaxisDefUnits
+!                                    (INTEGER         zaxisID,
+!                                     CHARACTER*(*)   units)
+      EXTERNAL        zaxisDefUnits
+
+!                     zaxisInqName
+!                                    (INTEGER         zaxisID,
+!                                     CHARACTER*(*)   name)
+      EXTERNAL        zaxisInqName
+
+!                     zaxisInqLongname
+!                                    (INTEGER         zaxisID,
+!                                     CHARACTER*(*)   longname)
+      EXTERNAL        zaxisInqLongname
+
+!                     zaxisInqStdname
+!                                    (INTEGER         zaxisID,
+!                                     CHARACTER*(*)   stdname)
+      EXTERNAL        zaxisInqStdname
+
+!                     zaxisInqUnits
+!                                    (INTEGER         zaxisID,
+!                                     CHARACTER*(*)   units)
+      EXTERNAL        zaxisInqUnits
+
+!                     zaxisDefPrec
+!                                    (INTEGER         zaxisID,
+!                                     INTEGER         prec)
+      EXTERNAL        zaxisDefPrec
+
+      INTEGER         zaxisInqPrec
+!                                    (INTEGER         zaxisID)
+      EXTERNAL        zaxisInqPrec
+
+      INTEGER         zaxisInqPositive
+!                                    (INTEGER         zaxisID)
+      EXTERNAL        zaxisInqPositive
+
+!                     zaxisDefLtype
+!                                    (INTEGER         zaxisID,
+!                                     INTEGER         ltype)
+      EXTERNAL        zaxisDefLtype
+
+      INTEGER         zaxisInqLtype
+!                                    (INTEGER         zaxisID)
+      EXTERNAL        zaxisInqLtype
+
+!                     zaxisDefVct
+!                                    (INTEGER         zaxisID,
+!                                     INTEGER         size,
+!                                     DOUBLEPRECISION vct_vec)
+      EXTERNAL        zaxisDefVct
+
+!                     zaxisInqVct
+!                                    (INTEGER         zaxisID,
+!                                     DOUBLEPRECISION vct_vec)
+      EXTERNAL        zaxisInqVct
+
+      INTEGER         zaxisInqVctSize
+!                                    (INTEGER         zaxisID)
+      EXTERNAL        zaxisInqVctSize
+
+      INTEGER         zaxisInqLbounds
+!                                    (INTEGER         zaxisID,
+!                                     DOUBLEPRECISION lbounds_vec)
+      EXTERNAL        zaxisInqLbounds
+
+      INTEGER         zaxisInqUbounds
+!                                    (INTEGER         zaxisID,
+!                                     DOUBLEPRECISION ubounds_vec)
+      EXTERNAL        zaxisInqUbounds
+
+      INTEGER         zaxisInqWeights
+!                                    (INTEGER         zaxisID,
+!                                     DOUBLEPRECISION weights_vec)
+      EXTERNAL        zaxisInqWeights
+
+      DOUBLEPRECISION zaxisInqLbound
+!                                    (INTEGER         zaxisID,
+!                                     INTEGER         index)
+      EXTERNAL        zaxisInqLbound
+
+      DOUBLEPRECISION zaxisInqUbound
+!                                    (INTEGER         zaxisID,
+!                                     INTEGER         index)
+      EXTERNAL        zaxisInqUbound
+
+!                     zaxisDefLbounds
+!                                    (INTEGER         zaxisID,
+!                                     DOUBLEPRECISION lbounds_vec)
+      EXTERNAL        zaxisDefLbounds
+
+!                     zaxisDefUbounds
+!                                    (INTEGER         zaxisID,
+!                                     DOUBLEPRECISION ubounds_vec)
+      EXTERNAL        zaxisDefUbounds
+
+!                     zaxisDefWeights
+!                                    (INTEGER         zaxisID,
+!                                     DOUBLEPRECISION weights_vec)
+      EXTERNAL        zaxisDefWeights
+
+!                     zaxisChangeType
+!                                    (INTEGER         zaxisID,
+!                                     INTEGER         zaxistype)
+      EXTERNAL        zaxisChangeType
+
+!
+!  TAXIS routines
+!
+      INTEGER         taxisCreate
+!                                    (INTEGER         timetype)
+      EXTERNAL        taxisCreate
+
+!                     taxisDestroy
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisDestroy
+
+      INTEGER         taxisDuplicate
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisDuplicate
+
+!                     taxisCopyTimestep
+!                                    (INTEGER         taxisIDdes,
+!                                     INTEGER         taxisIDsrc)
+      EXTERNAL        taxisCopyTimestep
+
+!                     taxisDefType
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         type)
+      EXTERNAL        taxisDefType
+
+!                     taxisDefVdate
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         date)
+      EXTERNAL        taxisDefVdate
+
+!                     taxisDefVtime
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         time)
+      EXTERNAL        taxisDefVtime
+
+!                     taxisDefRdate
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         date)
+      EXTERNAL        taxisDefRdate
+
+!                     taxisDefRtime
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         time)
+      EXTERNAL        taxisDefRtime
+
+      INTEGER         taxisHasBounds
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisHasBounds
+
+!                     taxisDeleteBounds
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisDeleteBounds
+
+!                     taxisDefVdateBounds
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         vdate_lb,
+!                                     INTEGER         vdate_ub)
+      EXTERNAL        taxisDefVdateBounds
+
+!                     taxisDefVtimeBounds
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         vtime_lb,
+!                                     INTEGER         vtime_ub)
+      EXTERNAL        taxisDefVtimeBounds
+
+!                     taxisInqVdateBounds
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         vdate_lb,
+!                                     INTEGER         vdate_ub)
+      EXTERNAL        taxisInqVdateBounds
+
+!                     taxisInqVtimeBounds
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         vtime_lb,
+!                                     INTEGER         vtime_ub)
+      EXTERNAL        taxisInqVtimeBounds
+
+!                     taxisDefCalendar
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         calendar)
+      EXTERNAL        taxisDefCalendar
+
+!                     taxisDefTunit
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         tunit)
+      EXTERNAL        taxisDefTunit
+
+!                     taxisDefNumavg
+!                                    (INTEGER         taxisID,
+!                                     INTEGER         numavg)
+      EXTERNAL        taxisDefNumavg
+
+      INTEGER         taxisInqType
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisInqType
+
+      INTEGER         taxisInqVdate
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisInqVdate
+
+      INTEGER         taxisInqVtime
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisInqVtime
+
+      INTEGER         taxisInqRdate
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisInqRdate
+
+      INTEGER         taxisInqRtime
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisInqRtime
+
+      INTEGER         taxisInqCalendar
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisInqCalendar
+
+      INTEGER         taxisInqTunit
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisInqTunit
+
+      INTEGER         taxisInqNumavg
+!                                    (INTEGER         taxisID)
+      EXTERNAL        taxisInqNumavg
+
+      CHARACTER(80)   tunitNamePtr
+!                                    (INTEGER         tunitID)
+      EXTERNAL        tunitNamePtr
+
+!
+!  Institut routines
+!
+      INTEGER         institutDef
+!                                    (INTEGER         center,
+!                                     INTEGER         subcenter,
+!                                     CHARACTER*(*)   name,
+!                                     CHARACTER*(*)   longname)
+      EXTERNAL        institutDef
+
+      INTEGER         institutInq
+!                                    (INTEGER         center,
+!                                     INTEGER         subcenter,
+!                                     CHARACTER*(*)   name,
+!                                     CHARACTER*(*)   longname)
+      EXTERNAL        institutInq
+
+      INTEGER         institutInqNumber
+      EXTERNAL        institutInqNumber
+
+      INTEGER         institutInqCenter
+!                                    (INTEGER         instID)
+      EXTERNAL        institutInqCenter
+
+      INTEGER         institutInqSubcenter
+!                                    (INTEGER         instID)
+      EXTERNAL        institutInqSubcenter
+
+      CHARACTER(80)   institutInqNamePtr
+!                                    (INTEGER         instID)
+      EXTERNAL        institutInqNamePtr
+
+      CHARACTER(80)   institutInqLongnamePtr
+!                                    (INTEGER         instID)
+      EXTERNAL        institutInqLongnamePtr
+
+!
+!  Model routines
+!
+      INTEGER         modelDef
+!                                    (INTEGER         instID,
+!                                     INTEGER         modelgribID,
+!                                     CHARACTER*(*)   name)
+      EXTERNAL        modelDef
+
+      INTEGER         modelInq
+!                                    (INTEGER         instID,
+!                                     INTEGER         modelgribID,
+!                                     CHARACTER*(*)   name)
+      EXTERNAL        modelInq
+
+      INTEGER         modelInqInstitut
+!                                    (INTEGER         modelID)
+      EXTERNAL        modelInqInstitut
+
+      INTEGER         modelInqGribID
+!                                    (INTEGER         modelID)
+      EXTERNAL        modelInqGribID
+
+      CHARACTER(80)   modelInqNamePtr
+!                                    (INTEGER         modelID)
+      EXTERNAL        modelInqNamePtr
+
+!
+!  Table routines
+!
+!                     tableWriteC
+!                                    (CHARACTER*(*)   filename,
+!                                     INTEGER         tableID)
+      EXTERNAL        tableWriteC
+
+!                     tableWrite
+!                                    (CHARACTER*(*)   filename,
+!                                     INTEGER         tableID)
+      EXTERNAL        tableWrite
+
+      INTEGER         tableRead
+!                                    (CHARACTER*(*)   tablefile)
+      EXTERNAL        tableRead
+
+      INTEGER         tableDef
+!                                    (INTEGER         modelID,
+!                                     INTEGER         tablenum,
+!                                     CHARACTER*(*)   tablename)
+      EXTERNAL        tableDef
+
+      CHARACTER(80)   tableInqNamePtr
+!                                    (INTEGER         tableID)
+      EXTERNAL        tableInqNamePtr
+
+!                     tableDefEntry
+!                                    (INTEGER         tableID,
+!                                     INTEGER         code,
+!                                     CHARACTER*(*)   name,
+!                                     CHARACTER*(*)   longname,
+!                                     CHARACTER*(*)   units)
+      EXTERNAL        tableDefEntry
+
+      INTEGER         tableInq
+!                                    (INTEGER         modelID,
+!                                     INTEGER         tablenum,
+!                                     CHARACTER*(*)   tablename)
+      EXTERNAL        tableInq
+
+      INTEGER         tableInqNumber
+      EXTERNAL        tableInqNumber
+
+      INTEGER         tableInqNum
+!                                    (INTEGER         tableID)
+      EXTERNAL        tableInqNum
+
+      INTEGER         tableInqModel
+!                                    (INTEGER         tableID)
+      EXTERNAL        tableInqModel
+
+!                     tableInqPar
+!                                    (INTEGER         tableID,
+!                                     INTEGER         code,
+!                                     CHARACTER*(*)   name,
+!                                     CHARACTER*(*)   longname,
+!                                     CHARACTER*(*)   units)
+      EXTERNAL        tableInqPar
+
+      INTEGER         tableInqParCode
+!                                    (INTEGER         tableID,
+!                                     CHARACTER*(*)   name,
+!                                     INTEGER         code)
+      EXTERNAL        tableInqParCode
+
+      INTEGER         tableInqParName
+!                                    (INTEGER         tableID,
+!                                     INTEGER         code,
+!                                     CHARACTER*(*)   name)
+      EXTERNAL        tableInqParName
+
+      INTEGER         tableInqParLongname
+!                                    (INTEGER         tableID,
+!                                     INTEGER         code,
+!                                     CHARACTER*(*)   longname)
+      EXTERNAL        tableInqParLongname
+
+      INTEGER         tableInqParUnits
+!                                    (INTEGER         tableID,
+!                                     INTEGER         code,
+!                                     CHARACTER*(*)   units)
+      EXTERNAL        tableInqParUnits
+
+      CHARACTER(80)   tableInqParNamePtr
+!                                    (INTEGER         tableID,
+!                                     INTEGER         parID)
+      EXTERNAL        tableInqParNamePtr
+
+      CHARACTER(80)   tableInqParLongnamePtr
+!                                    (INTEGER         tableID,
+!                                     INTEGER         parID)
+      EXTERNAL        tableInqParLongnamePtr
+
+      CHARACTER(80)   tableInqParUnitsPtr
+!                                    (INTEGER         tableID,
+!                                     INTEGER         parID)
+      EXTERNAL        tableInqParUnitsPtr
+
+!
+!  History routines
+!
+!                     streamDefHistory
+!                                    (INTEGER         streamID,
+!                                     INTEGER         size,
+!                                     CHARACTER*(*)   history)
+      EXTERNAL        streamDefHistory
+
+      INTEGER         streamInqHistorySize
+!                                    (INTEGER         streamID)
+      EXTERNAL        streamInqHistorySize
+
+!                     streamInqHistoryString
+!                                    (INTEGER         streamID,
+!                                     CHARACTER*(*)   history)
+      EXTERNAL        streamInqHistoryString
+
diff --git a/libcdi/src/cdiFortran.c b/libcdi/src/cdiFortran.c
new file mode 100644
index 0000000..b0329ce
--- /dev/null
+++ b/libcdi/src/cdiFortran.c
@@ -0,0 +1,484 @@
+/* Automatically generated by make_fint.c, don't edit! */
+
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if ! defined (_CDI_H)
+#  include "cdi.h"
+#endif
+
+#if defined (HAVE_CF_INTERFACE)
+
+#if ! defined (__CFORTRAN_LOADED)
+#  include "cfortran.h"
+#endif
+
+
+/*  Byte order  */
+
+
+/*  Error identifier  */
+
+
+/*  File types  */
+
+
+/*  Compress types  */
+
+
+/*  external data types  */
+
+
+/*  internal data types  */
+
+
+/*  Chunks  */
+
+
+/*  GRID types  */
+
+
+/*  ZAXIS types  */
+
+
+/*  TIME types  */
+
+
+/*  TSTEP types  */
+
+
+/*  TAXIS types  */
+
+
+/*  TUNIT types  */
+
+
+/*  CALENDAR types  */
+
+
+/*  parallel IO IOMode  */
+
+
+/*  parallel IO routines  */
+
+FCALLSCSUB0 (pioEndDef, PIOENDDEF, pioenddef)
+FCALLSCSUB0 (pioEndTimestepping, PIOENDTIMESTEPPING, pioendtimestepping)
+FCALLSCSUB0 (pioFinalize, PIOFINALIZE, piofinalize)
+FCALLSCFUN5 (INT, pioInit, PIOINIT, pioinit, INT, INT, INT, INT, PINT)
+FCALLSCFUN2 (INT, pioInqVarDecoChunk, PIOINQVARDECOCHUNK, pioinqvardecochunk, INT, INT)
+FCALLSCFUN2 (INT, pioInqVarDecoOff, PIOINQVARDECOOFF, pioinqvardecooff, INT, INT)
+FCALLSCSUB1 (pioNamespaceSetActive, PIONAMESPACESETACTIVE, pionamespacesetactive, INT)
+FCALLSCSUB3 (pioWriteTimestep, PIOWRITETIMESTEP, piowritetimestep, INT, INT, INT)
+
+/*  CDI control routines  */
+
+FCALLSCSUB0 (cdiReset, CDIRESET, cdireset)
+FCALLSCFUN1 (STRING, cdiStringError, CDISTRINGERROR, cdistringerror, INT)
+FCALLSCSUB1 (cdiDebug, CDIDEBUG, cdidebug, INT)
+FCALLSCFUN0 (STRING, cdiLibraryVersion, CDILIBRARYVERSION, cdilibraryversion)
+FCALLSCSUB0 (cdiPrintVersion, CDIPRINTVERSION, cdiprintversion)
+FCALLSCSUB1 (cdiDefMissval, CDIDEFMISSVAL, cdidefmissval, DOUBLE)
+FCALLSCFUN0 (DOUBLE, cdiInqMissval, CDIINQMISSVAL, cdiinqmissval)
+FCALLSCSUB2 (cdiDefGlobal, CDIDEFGLOBAL, cdidefglobal, STRING, INT)
+
+/*  CDI converter routines  */
+
+
+/*  parameter  */
+
+FCALLSCSUB3 (cdiParamToString, CDIPARAMTOSTRING, cdiparamtostring, INT, PSTRING, INT)
+FCALLSCSUB4 (cdiDecodeParam, CDIDECODEPARAM, cdidecodeparam, INT, PINT, PINT, PINT)
+FCALLSCFUN3 (INT, cdiEncodeParam, CDIENCODEPARAM, cdiencodeparam, INT, INT, INT)
+FCALLSCSUB4 (cdiDecodeDate, CDIDECODEDATE, cdidecodedate, INT, PINT, PINT, PINT)
+FCALLSCFUN3 (INT, cdiEncodeDate, CDIENCODEDATE, cdiencodedate, INT, INT, INT)
+FCALLSCSUB4 (cdiDecodeTime, CDIDECODETIME, cdidecodetime, INT, PINT, PINT, PINT)
+FCALLSCFUN3 (INT, cdiEncodeTime, CDIENCODETIME, cdiencodetime, INT, INT, INT)
+
+/*  STREAM control routines  */
+
+FCALLSCFUN1 (INT, streamOpenRead, STREAMOPENREAD, streamopenread, STRING)
+FCALLSCFUN2 (INT, streamOpenWrite, STREAMOPENWRITE, streamopenwrite, STRING, INT)
+FCALLSCFUN1 (INT, streamOpenAppend, STREAMOPENAPPEND, streamopenappend, STRING)
+FCALLSCSUB1 (streamClose, STREAMCLOSE, streamclose, INT)
+FCALLSCSUB1 (streamSync, STREAMSYNC, streamsync, INT)
+FCALLSCSUB2 (streamDefVlist, STREAMDEFVLIST, streamdefvlist, INT, INT)
+FCALLSCFUN1 (INT, streamInqVlist, STREAMINQVLIST, streaminqvlist, INT)
+FCALLSCFUN1 (INT, streamInqVlistIDorig, STREAMINQVLISTIDORIG, streaminqvlistidorig, INT)
+FCALLSCFUN1 (INT, streamInqFiletype, STREAMINQFILETYPE, streaminqfiletype, INT)
+FCALLSCSUB2 (streamDefByteorder, STREAMDEFBYTEORDER, streamdefbyteorder, INT, INT)
+FCALLSCFUN1 (INT, streamInqByteorder, STREAMINQBYTEORDER, streaminqbyteorder, INT)
+FCALLSCSUB2 (streamDefCompType, STREAMDEFCOMPTYPE, streamdefcomptype, INT, INT)
+FCALLSCSUB2 (streamDefCompLevel, STREAMDEFCOMPLEVEL, streamdefcomplevel, INT, INT)
+FCALLSCFUN1 (INT, streamInqCompType, STREAMINQCOMPTYPE, streaminqcomptype, INT)
+FCALLSCFUN1 (INT, streamInqCompLevel, STREAMINQCOMPLEVEL, streaminqcomplevel, INT)
+FCALLSCFUN2 (INT, streamDefTimestep, STREAMDEFTIMESTEP, streamdeftimestep, INT, INT)
+FCALLSCFUN2 (INT, streamInqTimestep, STREAMINQTIMESTEP, streaminqtimestep, INT, INT)
+FCALLSCFUN1 (STRING, streamFilename, STREAMFILENAME, streamfilename, INT)
+FCALLSCFUN1 (STRING, streamFilesuffix, STREAMFILESUFFIX, streamfilesuffix, INT)
+FCALLSCFUN1 (INT, streamNtsteps, STREAMNTSTEPS, streamntsteps, INT)
+FCALLSCFUN1 (INT, streamInqNvars, STREAMINQNVARS, streaminqnvars, INT)
+
+/*  STREAM var I/O routines  */
+
+FCALLSCSUB4 (streamReadVar, STREAMREADVAR, streamreadvar, INT, INT, PDOUBLE, PINT)
+FCALLSCSUB4 (streamWriteVar, STREAMWRITEVAR, streamwritevar, INT, INT, PDOUBLE, INT)
+FCALLSCSUB4 (streamWriteVarF, STREAMWRITEVARF, streamwritevarf, INT, INT, PFLOAT, INT)
+FCALLSCSUB5 (streamReadVarSlice, STREAMREADVARSLICE, streamreadvarslice, INT, INT, INT, PDOUBLE, PINT)
+FCALLSCSUB5 (streamWriteVarSlice, STREAMWRITEVARSLICE, streamwritevarslice, INT, INT, INT, PDOUBLE, INT)
+FCALLSCSUB5 (streamWriteVarSliceF, STREAMWRITEVARSLICEF, streamwritevarslicef, INT, INT, INT, PFLOAT, INT)
+
+/*  STREAM record I/O routines  */
+
+FCALLSCSUB3 (streamInqRecord, STREAMINQRECORD, streaminqrecord, INT, PINT, PINT)
+FCALLSCSUB3 (streamDefRecord, STREAMDEFRECORD, streamdefrecord, INT, INT, INT)
+FCALLSCSUB3 (streamReadRecord, STREAMREADRECORD, streamreadrecord, INT, PDOUBLE, PINT)
+FCALLSCSUB3 (streamWriteRecord, STREAMWRITERECORD, streamwriterecord, INT, PDOUBLE, INT)
+FCALLSCSUB3 (streamWriteRecordF, STREAMWRITERECORDF, streamwriterecordf, INT, PFLOAT, INT)
+FCALLSCSUB2 (streamCopyRecord, STREAMCOPYRECORD, streamcopyrecord, INT, INT)
+FCALLSCSUB3 (streamInqGinfo, STREAMINQGINFO, streaminqginfo, INT, PINT, PFLOAT)
+
+/*  VLIST routines  */
+
+FCALLSCFUN0 (INT, vlistCreate, VLISTCREATE, vlistcreate)
+FCALLSCSUB1 (vlistDestroy, VLISTDESTROY, vlistdestroy, INT)
+FCALLSCFUN1 (INT, vlistDuplicate, VLISTDUPLICATE, vlistduplicate, INT)
+FCALLSCSUB2 (vlistCopy, VLISTCOPY, vlistcopy, INT, INT)
+FCALLSCSUB2 (vlistCopyFlag, VLISTCOPYFLAG, vlistcopyflag, INT, INT)
+FCALLSCSUB1 (vlistClearFlag, VLISTCLEARFLAG, vlistclearflag, INT)
+FCALLSCSUB2 (vlistCat, VLISTCAT, vlistcat, INT, INT)
+FCALLSCSUB2 (vlistMerge, VLISTMERGE, vlistmerge, INT, INT)
+FCALLSCSUB1 (vlistPrint, VLISTPRINT, vlistprint, INT)
+FCALLSCFUN1 (INT, vlistNumber, VLISTNUMBER, vlistnumber, INT)
+FCALLSCFUN1 (INT, vlistNvars, VLISTNVARS, vlistnvars, INT)
+FCALLSCFUN1 (INT, vlistNgrids, VLISTNGRIDS, vlistngrids, INT)
+FCALLSCFUN1 (INT, vlistNzaxis, VLISTNZAXIS, vlistnzaxis, INT)
+FCALLSCSUB2 (vlistDefNtsteps, VLISTDEFNTSTEPS, vlistdefntsteps, INT, INT)
+FCALLSCFUN1 (INT, vlistNtsteps, VLISTNTSTEPS, vlistntsteps, INT)
+FCALLSCFUN1 (INT, vlistGridsizeMax, VLISTGRIDSIZEMAX, vlistgridsizemax, INT)
+FCALLSCFUN2 (INT, vlistGrid, VLISTGRID, vlistgrid, INT, INT)
+FCALLSCFUN2 (INT, vlistGridIndex, VLISTGRIDINDEX, vlistgridindex, INT, INT)
+FCALLSCSUB3 (vlistChangeGridIndex, VLISTCHANGEGRIDINDEX, vlistchangegridindex, INT, INT, INT)
+FCALLSCSUB3 (vlistChangeGrid, VLISTCHANGEGRID, vlistchangegrid, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistZaxis, VLISTZAXIS, vlistzaxis, INT, INT)
+FCALLSCFUN2 (INT, vlistZaxisIndex, VLISTZAXISINDEX, vlistzaxisindex, INT, INT)
+FCALLSCSUB3 (vlistChangeZaxisIndex, VLISTCHANGEZAXISINDEX, vlistchangezaxisindex, INT, INT, INT)
+FCALLSCSUB3 (vlistChangeZaxis, VLISTCHANGEZAXIS, vlistchangezaxis, INT, INT, INT)
+FCALLSCFUN1 (INT, vlistNrecs, VLISTNRECS, vlistnrecs, INT)
+FCALLSCSUB2 (vlistDefTaxis, VLISTDEFTAXIS, vlistdeftaxis, INT, INT)
+FCALLSCFUN1 (INT, vlistInqTaxis, VLISTINQTAXIS, vlistinqtaxis, INT)
+FCALLSCSUB2 (vlistDefTable, VLISTDEFTABLE, vlistdeftable, INT, INT)
+FCALLSCFUN1 (INT, vlistInqTable, VLISTINQTABLE, vlistinqtable, INT)
+FCALLSCSUB2 (vlistDefInstitut, VLISTDEFINSTITUT, vlistdefinstitut, INT, INT)
+FCALLSCFUN1 (INT, vlistInqInstitut, VLISTINQINSTITUT, vlistinqinstitut, INT)
+FCALLSCSUB2 (vlistDefModel, VLISTDEFMODEL, vlistdefmodel, INT, INT)
+FCALLSCFUN1 (INT, vlistInqModel, VLISTINQMODEL, vlistinqmodel, INT)
+
+/*  VLIST VAR routines  */
+
+FCALLSCFUN4 (INT, vlistDefVar, VLISTDEFVAR, vlistdefvar, INT, INT, INT, INT)
+FCALLSCSUB3 (vlistChangeVarGrid, VLISTCHANGEVARGRID, vlistchangevargrid, INT, INT, INT)
+FCALLSCSUB3 (vlistChangeVarZaxis, VLISTCHANGEVARZAXIS, vlistchangevarzaxis, INT, INT, INT)
+FCALLSCSUB5 (vlistInqVar, VLISTINQVAR, vlistinqvar, INT, INT, PINT, PINT, PINT)
+FCALLSCFUN2 (INT, vlistInqVarGrid, VLISTINQVARGRID, vlistinqvargrid, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarZaxis, VLISTINQVARZAXIS, vlistinqvarzaxis, INT, INT)
+
+/*  used in MPIOM  */
+
+FCALLSCFUN2 (INT, vlistInqVarID, VLISTINQVARID, vlistinqvarid, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarTsteptype, VLISTINQVARTSTEPTYPE, vlistinqvartsteptype, INT, INT)
+FCALLSCSUB3 (vlistDefVarTsteptype, VLISTDEFVARTSTEPTYPE, vlistdefvartsteptype, INT, INT, INT)
+FCALLSCSUB3 (vlistDefVarCompType, VLISTDEFVARCOMPTYPE, vlistdefvarcomptype, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarCompType, VLISTINQVARCOMPTYPE, vlistinqvarcomptype, INT, INT)
+FCALLSCSUB3 (vlistDefVarCompLevel, VLISTDEFVARCOMPLEVEL, vlistdefvarcomplevel, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarCompLevel, VLISTINQVARCOMPLEVEL, vlistinqvarcomplevel, INT, INT)
+FCALLSCSUB3 (vlistDefVarParam, VLISTDEFVARPARAM, vlistdefvarparam, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarParam, VLISTINQVARPARAM, vlistinqvarparam, INT, INT)
+FCALLSCSUB3 (vlistDefVarCode, VLISTDEFVARCODE, vlistdefvarcode, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarCode, VLISTINQVARCODE, vlistinqvarcode, INT, INT)
+FCALLSCSUB3 (vlistDefVarDatatype, VLISTDEFVARDATATYPE, vlistdefvardatatype, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarDatatype, VLISTINQVARDATATYPE, vlistinqvardatatype, INT, INT)
+FCALLSCSUB3 (vlistDefVarChunkType, VLISTDEFVARCHUNKTYPE, vlistdefvarchunktype, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarChunkType, VLISTINQVARCHUNKTYPE, vlistinqvarchunktype, INT, INT)
+FCALLSCSUB3 (vlistDefVarXYZ, VLISTDEFVARXYZ, vlistdefvarxyz, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarXYZ, VLISTINQVARXYZ, vlistinqvarxyz, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarNumber, VLISTINQVARNUMBER, vlistinqvarnumber, INT, INT)
+FCALLSCSUB3 (vlistDefVarInstitut, VLISTDEFVARINSTITUT, vlistdefvarinstitut, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarInstitut, VLISTINQVARINSTITUT, vlistinqvarinstitut, INT, INT)
+FCALLSCSUB3 (vlistDefVarModel, VLISTDEFVARMODEL, vlistdefvarmodel, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarModel, VLISTINQVARMODEL, vlistinqvarmodel, INT, INT)
+FCALLSCSUB3 (vlistDefVarTable, VLISTDEFVARTABLE, vlistdefvartable, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarTable, VLISTINQVARTABLE, vlistinqvartable, INT, INT)
+FCALLSCSUB3 (vlistDefVarName, VLISTDEFVARNAME, vlistdefvarname, INT, INT, STRING)
+FCALLSCSUB3 (vlistInqVarName, VLISTINQVARNAME, vlistinqvarname, INT, INT, PSTRING)
+FCALLSCSUB3 (vlistDefVarStdname, VLISTDEFVARSTDNAME, vlistdefvarstdname, INT, INT, STRING)
+FCALLSCSUB3 (vlistInqVarStdname, VLISTINQVARSTDNAME, vlistinqvarstdname, INT, INT, PSTRING)
+FCALLSCSUB3 (vlistDefVarLongname, VLISTDEFVARLONGNAME, vlistdefvarlongname, INT, INT, STRING)
+FCALLSCSUB3 (vlistInqVarLongname, VLISTINQVARLONGNAME, vlistinqvarlongname, INT, INT, PSTRING)
+FCALLSCSUB3 (vlistDefVarUnits, VLISTDEFVARUNITS, vlistdefvarunits, INT, INT, STRING)
+FCALLSCSUB3 (vlistInqVarUnits, VLISTINQVARUNITS, vlistinqvarunits, INT, INT, PSTRING)
+FCALLSCSUB3 (vlistDefVarMissval, VLISTDEFVARMISSVAL, vlistdefvarmissval, INT, INT, DOUBLE)
+FCALLSCFUN2 (DOUBLE, vlistInqVarMissval, VLISTINQVARMISSVAL, vlistinqvarmissval, INT, INT)
+FCALLSCSUB3 (vlistDefVarScalefactor, VLISTDEFVARSCALEFACTOR, vlistdefvarscalefactor, INT, INT, DOUBLE)
+FCALLSCFUN2 (DOUBLE, vlistInqVarScalefactor, VLISTINQVARSCALEFACTOR, vlistinqvarscalefactor, INT, INT)
+FCALLSCSUB3 (vlistDefVarAddoffset, VLISTDEFVARADDOFFSET, vlistdefvaraddoffset, INT, INT, DOUBLE)
+FCALLSCFUN2 (DOUBLE, vlistInqVarAddoffset, VLISTINQVARADDOFFSET, vlistinqvaraddoffset, INT, INT)
+FCALLSCSUB3 (vlistDefVarTimave, VLISTDEFVARTIMAVE, vlistdefvartimave, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarTimave, VLISTINQVARTIMAVE, vlistinqvartimave, INT, INT)
+FCALLSCSUB3 (vlistDefVarTimaccu, VLISTDEFVARTIMACCU, vlistdefvartimaccu, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarTimaccu, VLISTINQVARTIMACCU, vlistinqvartimaccu, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarSize, VLISTINQVARSIZE, vlistinqvarsize, INT, INT)
+FCALLSCSUB4 (vlistDefIndex, VLISTDEFINDEX, vlistdefindex, INT, INT, INT, INT)
+FCALLSCFUN3 (INT, vlistInqIndex, VLISTINQINDEX, vlistinqindex, INT, INT, INT)
+FCALLSCSUB4 (vlistDefFlag, VLISTDEFFLAG, vlistdefflag, INT, INT, INT, INT)
+FCALLSCFUN3 (INT, vlistInqFlag, VLISTINQFLAG, vlistinqflag, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistFindVar, VLISTFINDVAR, vlistfindvar, INT, INT)
+FCALLSCFUN3 (INT, vlistFindLevel, VLISTFINDLEVEL, vlistfindlevel, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistMergedVar, VLISTMERGEDVAR, vlistmergedvar, INT, INT)
+FCALLSCFUN3 (INT, vlistMergedLevel, VLISTMERGEDLEVEL, vlistmergedlevel, INT, INT, INT)
+
+/*  Ensemble info routines  */
+
+FCALLSCSUB5 (vlistDefVarEnsemble, VLISTDEFVARENSEMBLE, vlistdefvarensemble, INT, INT, INT, INT, INT)
+FCALLSCFUN5 (INT, vlistInqVarEnsemble, VLISTINQVARENSEMBLE, vlistinqvarensemble, INT, INT, PINT, PINT, PINT)
+
+/*  VLIST attributes  */
+
+FCALLSCFUN3 (INT, vlistInqNatts, VLISTINQNATTS, vlistinqnatts, INT, INT, PINT)
+FCALLSCFUN6 (INT, vlistInqAtt, VLISTINQATT, vlistinqatt, INT, INT, INT, PSTRING, PINT, PINT)
+FCALLSCFUN3 (INT, vlistDelAtt, VLISTDELATT, vlistdelatt, INT, INT, STRING)
+FCALLSCFUN6 (INT, vlistDefAttInt, VLISTDEFATTINT, vlistdefattint, INT, INT, STRING, INT, INT, PINT)
+FCALLSCFUN6 (INT, vlistDefAttFlt, VLISTDEFATTFLT, vlistdefattflt, INT, INT, STRING, INT, INT, PDOUBLE)
+FCALLSCFUN5 (INT, vlistDefAttTxt, VLISTDEFATTTXT, vlistdefatttxt, INT, INT, STRING, INT, STRING)
+FCALLSCFUN5 (INT, vlistInqAttInt, VLISTINQATTINT, vlistinqattint, INT, INT, STRING, INT, PINT)
+FCALLSCFUN5 (INT, vlistInqAttFlt, VLISTINQATTFLT, vlistinqattflt, INT, INT, STRING, INT, PDOUBLE)
+FCALLSCFUN5 (INT, vlistInqAttTxt, VLISTINQATTTXT, vlistinqatttxt, INT, INT, STRING, INT, PSTRING)
+
+/*  GRID routines  */
+
+FCALLSCSUB2 (gridName, GRIDNAME, gridname, INT, PSTRING)
+FCALLSCFUN1 (STRING, gridNamePtr, GRIDNAMEPTR, gridnameptr, INT)
+FCALLSCSUB1 (gridCompress, GRIDCOMPRESS, gridcompress, INT)
+FCALLSCSUB2 (gridDefMaskGME, GRIDDEFMASKGME, griddefmaskgme, INT, PINT)
+FCALLSCFUN2 (INT, gridInqMaskGME, GRIDINQMASKGME, gridinqmaskgme, INT, PINT)
+FCALLSCSUB2 (gridDefMask, GRIDDEFMASK, griddefmask, INT, PINT)
+FCALLSCFUN2 (INT, gridInqMask, GRIDINQMASK, gridinqmask, INT, PINT)
+FCALLSCSUB2 (gridPrint, GRIDPRINT, gridprint, INT, INT)
+FCALLSCFUN0 (INT, gridSize, GRIDSIZE, gridsize)
+FCALLSCFUN2 (INT, gridCreate, GRIDCREATE, gridcreate, INT, INT)
+FCALLSCSUB1 (gridDestroy, GRIDDESTROY, griddestroy, INT)
+FCALLSCFUN1 (INT, gridDuplicate, GRIDDUPLICATE, gridduplicate, INT)
+FCALLSCFUN1 (INT, gridInqType, GRIDINQTYPE, gridinqtype, INT)
+FCALLSCFUN1 (INT, gridInqSize, GRIDINQSIZE, gridinqsize, INT)
+FCALLSCSUB2 (gridDefXsize, GRIDDEFXSIZE, griddefxsize, INT, INT)
+FCALLSCFUN1 (INT, gridInqXsize, GRIDINQXSIZE, gridinqxsize, INT)
+FCALLSCSUB2 (gridDefYsize, GRIDDEFYSIZE, griddefysize, INT, INT)
+FCALLSCFUN1 (INT, gridInqYsize, GRIDINQYSIZE, gridinqysize, INT)
+FCALLSCSUB2 (gridDefNP, GRIDDEFNP, griddefnp, INT, INT)
+FCALLSCFUN1 (INT, gridInqNP, GRIDINQNP, gridinqnp, INT)
+FCALLSCSUB2 (gridDefXvals, GRIDDEFXVALS, griddefxvals, INT, PDOUBLE)
+FCALLSCFUN2 (INT, gridInqXvals, GRIDINQXVALS, gridinqxvals, INT, PDOUBLE)
+FCALLSCSUB2 (gridDefYvals, GRIDDEFYVALS, griddefyvals, INT, PDOUBLE)
+FCALLSCFUN2 (INT, gridInqYvals, GRIDINQYVALS, gridinqyvals, INT, PDOUBLE)
+FCALLSCSUB2 (gridDefXname, GRIDDEFXNAME, griddefxname, INT, STRING)
+FCALLSCSUB2 (gridDefXlongname, GRIDDEFXLONGNAME, griddefxlongname, INT, STRING)
+FCALLSCSUB2 (gridDefXunits, GRIDDEFXUNITS, griddefxunits, INT, STRING)
+FCALLSCSUB2 (gridDefYname, GRIDDEFYNAME, griddefyname, INT, STRING)
+FCALLSCSUB2 (gridDefYlongname, GRIDDEFYLONGNAME, griddefylongname, INT, STRING)
+FCALLSCSUB2 (gridDefYunits, GRIDDEFYUNITS, griddefyunits, INT, STRING)
+FCALLSCSUB2 (gridInqXname, GRIDINQXNAME, gridinqxname, INT, PSTRING)
+FCALLSCSUB2 (gridInqXlongname, GRIDINQXLONGNAME, gridinqxlongname, INT, PSTRING)
+FCALLSCSUB2 (gridInqXstdname, GRIDINQXSTDNAME, gridinqxstdname, INT, PSTRING)
+FCALLSCSUB2 (gridInqXunits, GRIDINQXUNITS, gridinqxunits, INT, PSTRING)
+FCALLSCSUB2 (gridInqYname, GRIDINQYNAME, gridinqyname, INT, PSTRING)
+FCALLSCSUB2 (gridInqYlongname, GRIDINQYLONGNAME, gridinqylongname, INT, PSTRING)
+FCALLSCSUB2 (gridInqYstdname, GRIDINQYSTDNAME, gridinqystdname, INT, PSTRING)
+FCALLSCSUB2 (gridInqYunits, GRIDINQYUNITS, gridinqyunits, INT, PSTRING)
+FCALLSCSUB2 (gridDefPrec, GRIDDEFPREC, griddefprec, INT, INT)
+FCALLSCFUN1 (INT, gridInqPrec, GRIDINQPREC, gridinqprec, INT)
+FCALLSCFUN2 (DOUBLE, gridInqXval, GRIDINQXVAL, gridinqxval, INT, INT)
+FCALLSCFUN2 (DOUBLE, gridInqYval, GRIDINQYVAL, gridinqyval, INT, INT)
+FCALLSCFUN1 (DOUBLE, gridInqXinc, GRIDINQXINC, gridinqxinc, INT)
+FCALLSCFUN1 (DOUBLE, gridInqYinc, GRIDINQYINC, gridinqyinc, INT)
+FCALLSCFUN1 (INT, gridIsCircular, GRIDISCIRCULAR, gridiscircular, INT)
+FCALLSCFUN1 (INT, gridIsRotated, GRIDISROTATED, gridisrotated, INT)
+FCALLSCFUN1 (DOUBLE, gridInqXpole, GRIDINQXPOLE, gridinqxpole, INT)
+FCALLSCSUB2 (gridDefXpole, GRIDDEFXPOLE, griddefxpole, INT, DOUBLE)
+FCALLSCFUN1 (DOUBLE, gridInqYpole, GRIDINQYPOLE, gridinqypole, INT)
+FCALLSCSUB2 (gridDefYpole, GRIDDEFYPOLE, griddefypole, INT, DOUBLE)
+FCALLSCFUN1 (DOUBLE, gridInqAngle, GRIDINQANGLE, gridinqangle, INT)
+FCALLSCSUB2 (gridDefAngle, GRIDDEFANGLE, griddefangle, INT, DOUBLE)
+FCALLSCSUB2 (gridDefTrunc, GRIDDEFTRUNC, griddeftrunc, INT, INT)
+FCALLSCFUN1 (INT, gridInqTrunc, GRIDINQTRUNC, gridinqtrunc, INT)
+
+/*  Hexagonal GME grid  */
+
+FCALLSCFUN1 (INT, gridInqGMEnd, GRIDINQGMEND, gridinqgmend, INT)
+FCALLSCSUB2 (gridDefGMEnd, GRIDDEFGMEND, griddefgmend, INT, INT)
+FCALLSCFUN1 (INT, gridInqGMEni, GRIDINQGMENI, gridinqgmeni, INT)
+FCALLSCSUB2 (gridDefGMEni, GRIDDEFGMENI, griddefgmeni, INT, INT)
+FCALLSCFUN1 (INT, gridInqGMEni2, GRIDINQGMENI2, gridinqgmeni2, INT)
+FCALLSCSUB2 (gridDefGMEni2, GRIDDEFGMENI2, griddefgmeni2, INT, INT)
+FCALLSCFUN1 (INT, gridInqGMEni3, GRIDINQGMENI3, gridinqgmeni3, INT)
+FCALLSCSUB2 (gridDefGMEni3, GRIDDEFGMENI3, griddefgmeni3, INT, INT)
+
+/*  Reference grid  */
+
+FCALLSCFUN1 (INT, gridInqNumber, GRIDINQNUMBER, gridinqnumber, INT)
+FCALLSCSUB2 (gridDefNumber, GRIDDEFNUMBER, griddefnumber, INT, INT)
+FCALLSCFUN1 (INT, gridInqPosition, GRIDINQPOSITION, gridinqposition, INT)
+FCALLSCSUB2 (gridDefPosition, GRIDDEFPOSITION, griddefposition, INT, INT)
+FCALLSCFUN2 (INT, gridInqReference, GRIDINQREFERENCE, gridinqreference, INT, PSTRING)
+FCALLSCSUB2 (gridDefReference, GRIDDEFREFERENCE, griddefreference, INT, STRING)
+FCALLSCFUN2 (STRING, gridInqUUID, GRIDINQUUID, gridinquuid, INT, PSTRING)
+FCALLSCSUB2 (gridDefUUID, GRIDDEFUUID, griddefuuid, INT, STRING)
+
+/*  Lambert Conformal Conic grid (GRIB version)  */
+
+FCALLSCSUB10 (gridDefLCC, GRIDDEFLCC, griddeflcc, INT, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE, INT, INT)
+FCALLSCSUB10 (gridInqLCC, GRIDINQLCC, gridinqlcc, INT, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PINT, PINT)
+
+/*  Lambert Conformal Conic 2 grid (PROJ version)  */
+
+FCALLSCSUB6 (gridDefLcc2, GRIDDEFLCC2, griddeflcc2, INT, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE)
+FCALLSCSUB6 (gridInqLcc2, GRIDINQLCC2, gridinqlcc2, INT, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE)
+
+/*  Lambert Azimuthal Equal Area grid  */
+
+FCALLSCSUB4 (gridDefLaea, GRIDDEFLAEA, griddeflaea, INT, DOUBLE, DOUBLE, DOUBLE)
+FCALLSCSUB4 (gridInqLaea, GRIDINQLAEA, gridinqlaea, INT, PDOUBLE, PDOUBLE, PDOUBLE)
+FCALLSCSUB2 (gridDefArea, GRIDDEFAREA, griddefarea, INT, PDOUBLE)
+FCALLSCSUB2 (gridInqArea, GRIDINQAREA, gridinqarea, INT, PDOUBLE)
+FCALLSCFUN1 (INT, gridHasArea, GRIDHASAREA, gridhasarea, INT)
+FCALLSCSUB2 (gridDefNvertex, GRIDDEFNVERTEX, griddefnvertex, INT, INT)
+FCALLSCFUN1 (INT, gridInqNvertex, GRIDINQNVERTEX, gridinqnvertex, INT)
+FCALLSCSUB2 (gridDefXbounds, GRIDDEFXBOUNDS, griddefxbounds, INT, PDOUBLE)
+FCALLSCFUN2 (INT, gridInqXbounds, GRIDINQXBOUNDS, gridinqxbounds, INT, PDOUBLE)
+FCALLSCSUB2 (gridDefYbounds, GRIDDEFYBOUNDS, griddefybounds, INT, PDOUBLE)
+FCALLSCFUN2 (INT, gridInqYbounds, GRIDINQYBOUNDS, gridinqybounds, INT, PDOUBLE)
+FCALLSCSUB3 (gridDefRowlon, GRIDDEFROWLON, griddefrowlon, INT, INT, PINT)
+FCALLSCSUB2 (gridInqRowlon, GRIDINQROWLON, gridinqrowlon, INT, PINT)
+FCALLSCSUB2 (gridChangeType, GRIDCHANGETYPE, gridchangetype, INT, INT)
+FCALLSCSUB2 (gridDefComplexPacking, GRIDDEFCOMPLEXPACKING, griddefcomplexpacking, INT, INT)
+FCALLSCFUN1 (INT, gridInqComplexPacking, GRIDINQCOMPLEXPACKING, gridinqcomplexpacking, INT)
+
+/*  ZAXIS routines  */
+
+FCALLSCSUB2 (zaxisName, ZAXISNAME, zaxisname, INT, PSTRING)
+FCALLSCFUN2 (INT, zaxisCreate, ZAXISCREATE, zaxiscreate, INT, INT)
+FCALLSCSUB1 (zaxisDestroy, ZAXISDESTROY, zaxisdestroy, INT)
+FCALLSCFUN1 (INT, zaxisInqType, ZAXISINQTYPE, zaxisinqtype, INT)
+FCALLSCFUN1 (INT, zaxisInqSize, ZAXISINQSIZE, zaxisinqsize, INT)
+FCALLSCFUN1 (INT, zaxisDuplicate, ZAXISDUPLICATE, zaxisduplicate, INT)
+FCALLSCSUB2 (zaxisResize, ZAXISRESIZE, zaxisresize, INT, INT)
+FCALLSCSUB1 (zaxisPrint, ZAXISPRINT, zaxisprint, INT)
+FCALLSCFUN0 (INT, zaxisSize, ZAXISSIZE, zaxissize)
+FCALLSCSUB2 (zaxisDefLevels, ZAXISDEFLEVELS, zaxisdeflevels, INT, PDOUBLE)
+FCALLSCSUB2 (zaxisInqLevels, ZAXISINQLEVELS, zaxisinqlevels, INT, PDOUBLE)
+FCALLSCSUB3 (zaxisDefLevel, ZAXISDEFLEVEL, zaxisdeflevel, INT, INT, DOUBLE)
+FCALLSCFUN2 (DOUBLE, zaxisInqLevel, ZAXISINQLEVEL, zaxisinqlevel, INT, INT)
+FCALLSCSUB2 (zaxisDefReference, ZAXISDEFREFERENCE, zaxisdefreference, INT, INT)
+FCALLSCSUB2 (zaxisDefUUID, ZAXISDEFUUID, zaxisdefuuid, INT, STRING)
+FCALLSCFUN2 (STRING, zaxisInqUUID, ZAXISINQUUID, zaxisinquuid, INT, PSTRING)
+FCALLSCFUN1 (INT, zaxisInqReference, ZAXISINQREFERENCE, zaxisinqreference, INT)
+FCALLSCSUB2 (zaxisDefName, ZAXISDEFNAME, zaxisdefname, INT, STRING)
+FCALLSCSUB2 (zaxisDefLongname, ZAXISDEFLONGNAME, zaxisdeflongname, INT, STRING)
+FCALLSCSUB2 (zaxisDefUnits, ZAXISDEFUNITS, zaxisdefunits, INT, STRING)
+FCALLSCSUB2 (zaxisInqName, ZAXISINQNAME, zaxisinqname, INT, PSTRING)
+FCALLSCSUB2 (zaxisInqLongname, ZAXISINQLONGNAME, zaxisinqlongname, INT, PSTRING)
+FCALLSCSUB2 (zaxisInqStdname, ZAXISINQSTDNAME, zaxisinqstdname, INT, PSTRING)
+FCALLSCSUB2 (zaxisInqUnits, ZAXISINQUNITS, zaxisinqunits, INT, PSTRING)
+FCALLSCSUB2 (zaxisDefPrec, ZAXISDEFPREC, zaxisdefprec, INT, INT)
+FCALLSCFUN1 (INT, zaxisInqPrec, ZAXISINQPREC, zaxisinqprec, INT)
+FCALLSCFUN1 (INT, zaxisInqPositive, ZAXISINQPOSITIVE, zaxisinqpositive, INT)
+FCALLSCSUB2 (zaxisDefLtype, ZAXISDEFLTYPE, zaxisdefltype, INT, INT)
+FCALLSCFUN1 (INT, zaxisInqLtype, ZAXISINQLTYPE, zaxisinqltype, INT)
+FCALLSCSUB3 (zaxisDefVct, ZAXISDEFVCT, zaxisdefvct, INT, INT, PDOUBLE)
+FCALLSCSUB2 (zaxisInqVct, ZAXISINQVCT, zaxisinqvct, INT, PDOUBLE)
+FCALLSCFUN1 (INT, zaxisInqVctSize, ZAXISINQVCTSIZE, zaxisinqvctsize, INT)
+FCALLSCFUN2 (INT, zaxisInqLbounds, ZAXISINQLBOUNDS, zaxisinqlbounds, INT, PDOUBLE)
+FCALLSCFUN2 (INT, zaxisInqUbounds, ZAXISINQUBOUNDS, zaxisinqubounds, INT, PDOUBLE)
+FCALLSCFUN2 (INT, zaxisInqWeights, ZAXISINQWEIGHTS, zaxisinqweights, INT, PDOUBLE)
+FCALLSCFUN2 (DOUBLE, zaxisInqLbound, ZAXISINQLBOUND, zaxisinqlbound, INT, INT)
+FCALLSCFUN2 (DOUBLE, zaxisInqUbound, ZAXISINQUBOUND, zaxisinqubound, INT, INT)
+FCALLSCSUB2 (zaxisDefLbounds, ZAXISDEFLBOUNDS, zaxisdeflbounds, INT, PDOUBLE)
+FCALLSCSUB2 (zaxisDefUbounds, ZAXISDEFUBOUNDS, zaxisdefubounds, INT, PDOUBLE)
+FCALLSCSUB2 (zaxisDefWeights, ZAXISDEFWEIGHTS, zaxisdefweights, INT, PDOUBLE)
+FCALLSCSUB2 (zaxisChangeType, ZAXISCHANGETYPE, zaxischangetype, INT, INT)
+
+/*  TAXIS routines  */
+
+FCALLSCFUN1 (INT, taxisCreate, TAXISCREATE, taxiscreate, INT)
+FCALLSCSUB1 (taxisDestroy, TAXISDESTROY, taxisdestroy, INT)
+FCALLSCFUN1 (INT, taxisDuplicate, TAXISDUPLICATE, taxisduplicate, INT)
+FCALLSCSUB2 (taxisCopyTimestep, TAXISCOPYTIMESTEP, taxiscopytimestep, INT, INT)
+FCALLSCSUB2 (taxisDefType, TAXISDEFTYPE, taxisdeftype, INT, INT)
+FCALLSCSUB2 (taxisDefVdate, TAXISDEFVDATE, taxisdefvdate, INT, INT)
+FCALLSCSUB2 (taxisDefVtime, TAXISDEFVTIME, taxisdefvtime, INT, INT)
+FCALLSCSUB2 (taxisDefRdate, TAXISDEFRDATE, taxisdefrdate, INT, INT)
+FCALLSCSUB2 (taxisDefRtime, TAXISDEFRTIME, taxisdefrtime, INT, INT)
+FCALLSCFUN1 (INT, taxisHasBounds, TAXISHASBOUNDS, taxishasbounds, INT)
+FCALLSCSUB1 (taxisDeleteBounds, TAXISDELETEBOUNDS, taxisdeletebounds, INT)
+FCALLSCSUB3 (taxisDefVdateBounds, TAXISDEFVDATEBOUNDS, taxisdefvdatebounds, INT, INT, INT)
+FCALLSCSUB3 (taxisDefVtimeBounds, TAXISDEFVTIMEBOUNDS, taxisdefvtimebounds, INT, INT, INT)
+FCALLSCSUB3 (taxisInqVdateBounds, TAXISINQVDATEBOUNDS, taxisinqvdatebounds, INT, PINT, PINT)
+FCALLSCSUB3 (taxisInqVtimeBounds, TAXISINQVTIMEBOUNDS, taxisinqvtimebounds, INT, PINT, PINT)
+FCALLSCSUB2 (taxisDefCalendar, TAXISDEFCALENDAR, taxisdefcalendar, INT, INT)
+FCALLSCSUB2 (taxisDefTunit, TAXISDEFTUNIT, taxisdeftunit, INT, INT)
+FCALLSCSUB2 (taxisDefNumavg, TAXISDEFNUMAVG, taxisdefnumavg, INT, INT)
+FCALLSCFUN1 (INT, taxisInqType, TAXISINQTYPE, taxisinqtype, INT)
+FCALLSCFUN1 (INT, taxisInqVdate, TAXISINQVDATE, taxisinqvdate, INT)
+FCALLSCFUN1 (INT, taxisInqVtime, TAXISINQVTIME, taxisinqvtime, INT)
+FCALLSCFUN1 (INT, taxisInqRdate, TAXISINQRDATE, taxisinqrdate, INT)
+FCALLSCFUN1 (INT, taxisInqRtime, TAXISINQRTIME, taxisinqrtime, INT)
+FCALLSCFUN1 (INT, taxisInqCalendar, TAXISINQCALENDAR, taxisinqcalendar, INT)
+FCALLSCFUN1 (INT, taxisInqTunit, TAXISINQTUNIT, taxisinqtunit, INT)
+FCALLSCFUN1 (INT, taxisInqNumavg, TAXISINQNUMAVG, taxisinqnumavg, INT)
+FCALLSCFUN1 (STRING, tunitNamePtr, TUNITNAMEPTR, tunitnameptr, INT)
+
+/*  Institut routines  */
+
+FCALLSCFUN4 (INT, institutDef, INSTITUTDEF, institutdef, INT, INT, STRING, STRING)
+FCALLSCFUN4 (INT, institutInq, INSTITUTINQ, institutinq, INT, INT, STRING, STRING)
+FCALLSCFUN0 (INT, institutInqNumber, INSTITUTINQNUMBER, institutinqnumber)
+FCALLSCFUN1 (INT, institutInqCenter, INSTITUTINQCENTER, institutinqcenter, INT)
+FCALLSCFUN1 (INT, institutInqSubcenter, INSTITUTINQSUBCENTER, institutinqsubcenter, INT)
+FCALLSCFUN1 (STRING, institutInqNamePtr, INSTITUTINQNAMEPTR, institutinqnameptr, INT)
+FCALLSCFUN1 (STRING, institutInqLongnamePtr, INSTITUTINQLONGNAMEPTR, institutinqlongnameptr, INT)
+
+/*  Model routines  */
+
+FCALLSCFUN3 (INT, modelDef, MODELDEF, modeldef, INT, INT, STRING)
+FCALLSCFUN3 (INT, modelInq, MODELINQ, modelinq, INT, INT, PSTRING)
+FCALLSCFUN1 (INT, modelInqInstitut, MODELINQINSTITUT, modelinqinstitut, INT)
+FCALLSCFUN1 (INT, modelInqGribID, MODELINQGRIBID, modelinqgribid, INT)
+FCALLSCFUN1 (STRING, modelInqNamePtr, MODELINQNAMEPTR, modelinqnameptr, INT)
+
+/*  Table routines  */
+
+FCALLSCSUB2 (tableWriteC, TABLEWRITEC, tablewritec, STRING, INT)
+FCALLSCSUB2 (tableWrite, TABLEWRITE, tablewrite, STRING, INT)
+FCALLSCFUN1 (INT, tableRead, TABLEREAD, tableread, STRING)
+FCALLSCFUN3 (INT, tableDef, TABLEDEF, tabledef, INT, INT, STRING)
+FCALLSCFUN1 (STRING, tableInqNamePtr, TABLEINQNAMEPTR, tableinqnameptr, INT)
+FCALLSCSUB5 (tableDefEntry, TABLEDEFENTRY, tabledefentry, INT, INT, STRING, STRING, STRING)
+FCALLSCFUN3 (INT, tableInq, TABLEINQ, tableinq, INT, INT, STRING)
+FCALLSCFUN0 (INT, tableInqNumber, TABLEINQNUMBER, tableinqnumber)
+FCALLSCFUN1 (INT, tableInqNum, TABLEINQNUM, tableinqnum, INT)
+FCALLSCFUN1 (INT, tableInqModel, TABLEINQMODEL, tableinqmodel, INT)
+FCALLSCSUB5 (tableInqPar, TABLEINQPAR, tableinqpar, INT, INT, PSTRING, PSTRING, PSTRING)
+FCALLSCFUN3 (INT, tableInqParCode, TABLEINQPARCODE, tableinqparcode, INT, PSTRING, PINT)
+FCALLSCFUN3 (INT, tableInqParName, TABLEINQPARNAME, tableinqparname, INT, INT, PSTRING)
+FCALLSCFUN3 (INT, tableInqParLongname, TABLEINQPARLONGNAME, tableinqparlongname, INT, INT, PSTRING)
+FCALLSCFUN3 (INT, tableInqParUnits, TABLEINQPARUNITS, tableinqparunits, INT, INT, PSTRING)
+FCALLSCFUN2 (STRING, tableInqParNamePtr, TABLEINQPARNAMEPTR, tableinqparnameptr, INT, INT)
+FCALLSCFUN2 (STRING, tableInqParLongnamePtr, TABLEINQPARLONGNAMEPTR, tableinqparlongnameptr, INT, INT)
+FCALLSCFUN2 (STRING, tableInqParUnitsPtr, TABLEINQPARUNITSPTR, tableinqparunitsptr, INT, INT)
+
+/*  History routines  */
+
+FCALLSCSUB3 (streamDefHistory, STREAMDEFHISTORY, streamdefhistory, INT, INT, STRING)
+FCALLSCFUN1 (INT, streamInqHistorySize, STREAMINQHISTORYSIZE, streaminqhistorysize, INT)
+FCALLSCSUB2 (streamInqHistoryString, STREAMINQHISTORYSTRING, streaminqhistorystring, INT, PSTRING)
+
+#endif
diff --git a/libcdi/src/cdi_error.c b/libcdi/src/cdi_error.c
new file mode 100644
index 0000000..e092208
--- /dev/null
+++ b/libcdi/src/cdi_error.c
@@ -0,0 +1,42 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <string.h>
+#include <errno.h>
+#include "cdi.h"
+
+char *cdiStringError(int cdiErrno)
+{
+  static char UnknownError[] = "Unknown Error";
+  static char _EUFTYPE[]     = "Unsupported file type";
+  static char _ELIBNAVAIL[]  = "Unsupported file type (library support not compiled in)";
+  static char _EUFSTRUCT[]   = "Unsupported file structure";
+  static char _EUNC4[]       = "Unsupported netCDF4 structure";
+  static char _ELIMIT[]      = "Internal limits exceeded";
+
+  switch (cdiErrno) {
+  case CDI_ESYSTEM:
+    {
+      char *cp = (char *) strerror(errno);
+      if ( cp == NULL ) break;
+      return cp;
+    }
+  case CDI_EUFTYPE:    return _EUFTYPE;
+  case CDI_ELIBNAVAIL: return _ELIBNAVAIL;
+  case CDI_EUFSTRUCT:  return _EUFSTRUCT;
+  case CDI_EUNC4:      return _EUNC4;
+  case CDI_ELIMIT:     return _ELIMIT;
+  }
+
+  return UnknownError;
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/cdi_limits.h b/libcdi/src/cdi_limits.h
new file mode 100644
index 0000000..0ef0207
--- /dev/null
+++ b/libcdi/src/cdi_limits.h
@@ -0,0 +1,17 @@
+#ifndef _CDI_LIMITS_H
+#define _CDI_LIMITS_H
+
+#define  MAX_GRIDS_PS    128  /* maximum number of different grids per stream */
+#define  MAX_ZAXES_PS    128  /* maximum number of different zaxes per stream */
+#define  MAX_ATTRIBUTES  256  /* maximum number of attributes per variable    */
+
+#endif  /* _CDI_LIMITS_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/cdi_util.c b/libcdi/src/cdi_util.c
new file mode 100644
index 0000000..b5fc74f
--- /dev/null
+++ b/libcdi/src/cdi_util.c
@@ -0,0 +1,104 @@
+#include <stdio.h>
+
+void cdiDecodeParam(int param, int *pnum, int *pcat, int *pdis)
+{
+  unsigned int *uparam = (unsigned int *) ¶m;
+  unsigned int upnum;
+
+  *pdis = 0xff   & *uparam;
+  *pcat = 0xff   & *uparam >> 8;
+  upnum = 0xffff & *uparam >> 16;
+  if ( upnum > 0x7fff ) upnum = 0x8000 - upnum;
+  *pnum = upnum;
+}
+
+
+int cdiEncodeParam(int pnum, int pcat, int pdis)
+{
+  unsigned int uparam, upnum;
+
+  if ( pcat < 0 || pcat > 255 ) pcat = 255;
+  if ( pdis < 0 || pdis > 255 ) pdis = 255;
+
+  upnum = pnum;
+  if ( pnum < 0 ) upnum = 0x8000 - pnum;
+
+  uparam = upnum << 16 | pcat << 8 | pdis;
+
+  return ((int)uparam);
+}
+
+
+void cdiDecodeDate(int date, int *year, int *month, int *day)
+{
+  int idate;
+
+  *year  =  date / 10000;
+  idate  = date - *year*10000;
+  if ( idate < 0 ) idate = -idate;
+  *month = idate / 100;
+  *day   = idate - *month*100;
+}
+
+
+int cdiEncodeDate(int year, int month, int day)
+{
+  int date;
+  int iyear;
+
+  iyear = year;
+  if ( iyear < 0 ) iyear = -iyear;
+  date = iyear*10000 + month*100 + day;
+  if ( year < 0 ) date = -date;
+
+  return (date);
+}
+
+
+void cdiDecodeTime(int time, int *hour, int *minute, int *second)
+{
+  int itime;
+
+  *hour   = time / 10000;
+  itime   = time - *hour*10000;
+  *minute = itime / 100;
+  *second = itime - *minute*100;
+}
+
+
+int cdiEncodeTime(int hour, int minute, int second)
+{
+  int time;
+
+  time = hour*10000 + minute*100 + second;
+
+  return (time);
+}
+
+
+void cdiParamToString(int param, char *paramstr, int maxlen)
+{
+  int dis, cat, num;
+  int len;
+
+  cdiDecodeParam(param, &num, &cat, &dis);
+
+  if ( dis == 255 && (cat == 255 || cat == 0 ) )
+    len = sprintf(paramstr, "%d", num);
+  else  if ( dis == 255 )
+    len = sprintf(paramstr, "%d.%d", num, cat);
+  else
+    len = sprintf(paramstr, "%d.%d.%d", num, cat, dis);
+
+  if ( len > ( maxlen-1) )
+    fprintf(stderr, "Internal problem (%s): size of input string is too small!\n", __func__);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/cdilib.c b/libcdi/src/cdilib.c
new file mode 100644
index 0000000..b3a43f3
--- /dev/null
+++ b/libcdi/src/cdilib.c
@@ -0,0 +1,65075 @@
+
+/* Automatically generated by m214003 at 2012-12-17, do not edit */
+
+/* CDILIB_VERSION="1.5.9" */
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+#include <limits.h>
+#include <float.h>
+#include <math.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+#ifndef _SX
+#include <aio.h>
+#endif
+#include <stdbool.h>
+#ifdef USE_MPI
+#include "mpi.h"
+#endif
+#include <assert.h>
+
+#if  defined  (HAVE_LIBGRIB_API)
+#  include <grib_api.h>
+#endif
+
+#if defined (HAVE_MMAP)
+#  include <sys/mman.h> /* mmap() is defined in this header */
+#endif
+
+#if  defined  (HAVE_LIBPTHREAD)
+#  include <pthread.h>
+#endif
+
+#if  defined  (HAVE_LIBSZ)
+#  include <szlib.h>
+#endif
+
+#if ! defined (HAVE_CONFIG_H)
+#  define  HAVE_LIBGRIB      1
+#  define  HAVE_LIBCGRIBEX   1
+#  define  HAVE_LIBSERVICE   1
+#  define  HAVE_LIBEXTRA     1
+#  define  HAVE_LIBIEG       1
+#endif
+
+#ifndef _CDI_LIMITS_H
+#define _CDI_LIMITS_H
+
+#define  MAX_GRIDS_PS    128  /* maximum number of different grids per stream */
+#define  MAX_ZAXES_PS    128  /* maximum number of different zaxes per stream */
+#define  MAX_ATTRIBUTES  256  /* maximum number of attributes per variable    */
+
+#endif  /* _CDI_LIMITS_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _TAXIS_H
+#define _TAXIS_H
+
+
+typedef struct {
+  /* Date format  YYYYMMDD */
+  /* Time format    hhmmss */
+  int     self;
+  int     used;
+  int     type;           /* time type             */
+  int     vdate;          /* verification date     */
+  int     vtime;          /* verification time     */
+  int     rdate;          /* reference date        */
+  int     rtime;          /* reference time        */
+  int     calendar;
+  int     unit;           /* time unit             */
+  int     numavg;
+  int     has_bounds;
+  int     vdate_lb;       /* lower bounds of vdate */
+  int     vtime_lb;       /* lower bounds of vtime */
+  int     vdate_ub;       /* upper bounds of vdate */
+  int     vtime_ub;       /* upper bounds of vtime */
+  char   *name;
+  char   *longname;
+}
+taxis_t;
+
+void    ptaxisInit(taxis_t *taxis);
+void    ptaxisCopy(taxis_t *dest, taxis_t *source);
+taxis_t  *taxisPtr(int taxisID);
+void    cdiDecodeTimeval(double timevalue, taxis_t *taxis, int *date, int *time);
+double  cdiEncodeTimeval(int date, int time, taxis_t *taxis);
+void    timeval2vtime(double timevalue, taxis_t *taxis, int *vdate, int *vtime);
+double  vtime2timeval(int vdate, int vtime, taxis_t *taxis);
+
+
+#endif  /* _TAXIS_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _DTYPES_H
+#define _DTYPES_H
+
+#include <stdio.h>
+#include <limits.h>
+
+/* INT32 */
+
+#if ! defined (INT_MAX)
+#  error INT_MAX undefined
+#endif
+
+#undef  INT32
+#if  INT_MAX == 2147483647L
+#  define  INT32  int
+#elif LONG_MAX == 2147483647L
+#  define  INT32  long
+#endif
+
+/* INT64 */
+
+#if ! defined (LONG_MAX)
+#  error LONG_MAX undefined
+#endif
+
+#undef  INT64
+#if  LONG_MAX > 2147483647L
+#  define  INT64  long
+#else
+#  define  INT64  long long
+#endif
+
+/* FLT32 */
+
+#undef   FLT32
+#define  FLT32  float
+
+/* FLT64 */
+
+#undef   FLT64
+#define  FLT64  double
+
+/* UINT32 and UINT64 */
+
+#define  UINT32   unsigned INT32
+#define  UINT64   unsigned INT64
+
+#endif  /* _DTYPES_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _FILE_H
+#define _FILE_H
+
+#include <stdio.h>
+#include <sys/types.h>
+
+
+#define  FILE_UNDEFID      -1
+
+#define  FILE_TYPE_OPEN     1
+#define  FILE_TYPE_FOPEN    2
+
+/* buffer types for FILE_TYPE_OPEN */
+#define  FILE_BUFTYPE_STD   1
+#define  FILE_BUFTYPE_MMAP  2
+
+const
+char  *fileLibraryVersion(void);
+
+void   fileDebug(int debug);
+
+void  *filePtr(int fileID);
+
+int    fileSetBufferType(int fileID, int type);
+void   fileSetBufferSize(int fileID, long buffersize);
+
+int    fileOpen(const char *filename, const char *mode);
+int    fileClose(int fileID);
+
+char  *fileInqName(int fileID);
+int    fileInqMode(int fileID);
+
+int    fileFlush(int fileID);
+void   fileClearerr(int fileID);
+int    fileEOF(int fileID);
+int    filePtrEOF(void *fileptr);
+void   fileRewind(int fileID);
+
+off_t  fileGetPos(int fileID);
+int    fileSetPos(int fileID, off_t offset, int whence);
+
+int    fileGetc(int fileID);
+int    filePtrGetc(void *fileptr);
+
+size_t filePtrRead(void *fileptr, void *restrict ptr, size_t size);
+size_t fileRead(int fileID, void *restrict ptr, size_t size);
+size_t fileWrite(int fileID, const void *restrict ptr, size_t size);
+
+#endif  /* _FILE_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _CGRIBEX_H
+#define _CGRIBEX_H
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#define  GRIB_MISSVAL  -9.E33
+
+/* GRIB1 Level Types */
+#define  GRIB1_LTYPE_SURFACE               1
+#define  GRIB1_LTYPE_TOA                   8
+#define  GRIB1_LTYPE_SEA_BOTTOM            9
+#define  GRIB1_LTYPE_ATMOSPHERE           10
+#define  GRIB1_LTYPE_99                   99
+#define  GRIB1_LTYPE_ISOBARIC            100
+#define  GRIB1_LTYPE_MEANSEA             102
+#define  GRIB1_LTYPE_ALTITUDE            103
+#define  GRIB1_LTYPE_HEIGHT              105
+#define  GRIB1_LTYPE_SIGMA               107
+#define  GRIB1_LTYPE_SIGMA_LAYER         108
+#define  GRIB1_LTYPE_HYBRID              109
+#define  GRIB1_LTYPE_HYBRID_LAYER        110
+#define  GRIB1_LTYPE_LANDDEPTH           111
+#define  GRIB1_LTYPE_LANDDEPTH_LAYER     112
+#define  GRIB1_LTYPE_ISENTROPIC          113
+#define  GRIB1_LTYPE_SEADEPTH            160
+#define  GRIB1_LTYPE_99_MARGIN          1000
+
+/* GRIB1 Data representation type (Grid Type) [Table 6] */
+#define  GRIB1_GTYPE_LATLON                0  /*  latitude/longitude                       */
+#define  GRIB1_GTYPE_LATLON_ROT           10  /*  rotated latitude/longitude               */
+#define  GRIB1_GTYPE_LATLON_STR           20  /*  stretched latitude/longitude             */
+#define  GRIB1_GTYPE_LATLON_ROTSTR        30  /*  rotated and stretched latitude/longitude */
+#define  GRIB1_GTYPE_GAUSSIAN              4  /*  gaussian grid                            */
+#define  GRIB1_GTYPE_GAUSSIAN_ROT         14  /*  rotated gaussian grid                    */
+#define  GRIB1_GTYPE_GAUSSIAN_STR         24  /*  stretched gaussian grid                  */
+#define  GRIB1_GTYPE_GAUSSIAN_ROTSTR      34  /*  rotated and stretched gaussian grid      */
+#define  GRIB1_GTYPE_LCC                   3  /*  Lambert conformal                        */
+#define  GRIB1_GTYPE_SPECTRAL             50  /*  spherical harmonics                      */
+#define  GRIB1_GTYPE_GME                 192  /*  hexagonal GME grid                       */
+
+/*
+ *  Macros for the indicator section ( Section 0 )
+ */
+#define  ISEC0_GRIB_Len             (isec0[ 0])  /*  Number of octets in the GRIB message         */
+#define  ISEC0_GRIB_Version         (isec0[ 1])  /*  GRIB edition number                          */
+
+
+/*
+ *  Macros for the product definition section ( Section 1 )
+ */
+#define  ISEC1_TABLE4_MINUTE    0
+#define  ISEC1_TABLE4_HOUR      1
+#define  ISEC1_TABLE4_DAY       2
+#define  ISEC1_TABLE4_3HOURS   10
+#define  ISEC1_TABLE4_6HOURS   11
+#define  ISEC1_TABLE4_12HOURS  12
+#define  ISEC1_TABLE4_QUARTER  13
+
+
+#define  ISEC1_CodeTable            (isec1[ 0])  /*  Version number of code table                 */
+#define  ISEC1_CenterID             (isec1[ 1])  /*  Identification of centre                     */
+#define  ISEC1_ModelID              (isec1[ 2])  /*  Identification of model                      */
+#define  ISEC1_GridDefinition       (isec1[ 3])  /*  Grid definition                              */
+#define  ISEC1_Sec2Or3Flag          (isec1[ 4])  /*  Section 2 or 3 included                      */
+#define  ISEC1_Parameter            (isec1[ 5])  /*  Parameter indicator                          */
+#define  ISEC1_LevelType            (isec1[ 6])  /*  Type of level indicator                      */
+#define  ISEC1_Level1               (isec1[ 7])  /*  Level 1                                      */
+#define  ISEC1_Level2               (isec1[ 8])  /*  Level 2                                      */
+#define  ISEC1_Year                 (isec1[ 9])  /*  Year of century (YY)                         */
+#define  ISEC1_Month                (isec1[10])  /*  Month (MM)                                   */
+#define  ISEC1_Day                  (isec1[11])  /*  Day (DD)                                     */
+#define  ISEC1_Hour                 (isec1[12])  /*  Hour (HH)                                    */
+#define  ISEC1_Minute               (isec1[13])  /*  Minute (MM)                                  */
+#define  ISEC1_TimeUnit             (isec1[14])  /*  Time unit indicator                          */
+#define  ISEC1_TimePeriod1          (isec1[15])  /*  P1 Time period                               */
+#define  ISEC1_TimePeriod2          (isec1[16])  /*  P2 Time period                               */
+#define  ISEC1_TimeRange            (isec1[17])  /*  Time range indicator                         */
+#define  ISEC1_AvgNum               (isec1[18])  /*  Number of products included in an average    */
+#define  ISEC1_AvgMiss              (isec1[19])  /*  Number of products missing from an average   */
+#define  ISEC1_Century              (isec1[20])  /*  Century                                      */
+#define  ISEC1_SubCenterID          (isec1[21])  /*  Subcenter identifier                         */
+#define  ISEC1_DecScaleFactor       (isec1[22])  /*  Decimal scale factor                         */
+#define  ISEC1_LocalFLag            (isec1[23])  /*  Flag field to indicate local use in isec1    */
+
+#define  ISEC1_ECMWF_LocalExtension (isec1[36])
+#define  ISEC1_ECMWF_Class          (isec1[37])
+
+
+/*
+ *  Macros for the grid definition section ( Section 2 )
+ */
+#define  ISEC2_GridType             (isec2[ 0])  /* Data representation type */
+
+/* Triangular grids */
+
+#define  ISEC2_GME_NI2              (isec2[ 1])  /*  Number of factor 2 in factorisation of Ni    */
+#define  ISEC2_GME_NI3              (isec2[ 2])  /*  Number of factor 3 in factorisation of Ni    */
+#define  ISEC2_GME_ND               (isec2[ 3])  /*  Nubmer of diamonds                           */
+#define  ISEC2_GME_NI               (isec2[ 4])  /*  Number of tri. subdiv. of the icosahedron    */
+#define  ISEC2_GME_AFlag            (isec2[ 5])  /*  Flag for orientation of diamonds (Table A)   */
+#define  ISEC2_GME_LatPP            (isec2[ 6])  /*  Latitude of pole point                       */
+#define  ISEC2_GME_LonPP            (isec2[ 7])  /*  Longitude of pole point                      */
+#define  ISEC2_GME_LonMPL           (isec2[ 8])  /*  Longitude of the first diamond               */
+#define  ISEC2_GME_BFlag            (isec2[ 9])  /*  Flag for storage sequence (Table B)          */
+
+/* Spherical harmonic coeficients */
+
+#define  ISEC2_PentaJ               (isec2[ 1])  /*  J pentagonal resolution parameter            */
+#define  ISEC2_PentaK               (isec2[ 2])  /*  K pentagonal resolution parameter            */
+#define  ISEC2_PentaM               (isec2[ 3])  /*  M pentagonal resolution parameter            */
+#define  ISEC2_RepType              (isec2[ 4])  /*  Representation type                          */
+#define  ISEC2_RepMode              (isec2[ 5])  /*  Representation mode                          */
+
+/* Gaussian grids */
+
+#define  ISEC2_NumLon               (isec2[ 1])  /*  Number of points along a parallel (Ni)       */
+#define  ISEC2_NumLat               (isec2[ 2])  /*  Number of points along a meridian (Nj)       */
+#define  ISEC2_FirstLat             (isec2[ 3])  /*  Latitude of the first grid point             */
+#define  ISEC2_FirstLon             (isec2[ 4])  /*  Longitude of the first grid point            */
+#define  ISEC2_ResFlag              (isec2[ 5])  /*  Resolution flag: 128 regular grid            */
+#define  ISEC2_LastLat              (isec2[ 6])  /*  Latitude of the last grid point              */
+#define  ISEC2_LastLon              (isec2[ 7])  /*  Longitude of the last grid point             */
+#define  ISEC2_LonIncr              (isec2[ 8])  /*  i direction increment                        */
+#define  ISEC2_LatIncr              (isec2[ 9])  /*  j direction increment                        */
+#define  ISEC2_NumPar               (isec2[ 9])  /*  Number of parallels between a pole and the E.*/
+#define  ISEC2_ScanFlag             (isec2[10])  /*  Scanning mode flags                          */
+#define  ISEC2_NumVCP               (isec2[11])  /*  Number of vertical coordinate parameters     */
+
+/* Lambert */
+#define  ISEC2_Lambert_Lov          (isec2[ 6])  /*  Orientation of the grid                      */
+#define  ISEC2_Lambert_dx           (isec2[ 8])  /*  X-direction grid length                      */
+#define  ISEC2_Lambert_dy           (isec2[ 9])  /*  Y-direction grid length                      */
+#define  ISEC2_Lambert_ProjFlag     (isec2[12])  /*  Projection centre flag                       */
+#define  ISEC2_Lambert_LatS1        (isec2[13])  /*  First lat at which the secant cone cuts the sphere */
+#define  ISEC2_Lambert_LatS2        (isec2[14])  /*  Second lat at which the secant cone cuts the sphere */
+#define  ISEC2_Lambert_LatSP        (isec2[19])  /*  Latitude of the southern pole                */
+#define  ISEC2_Lambert_LonSP        (isec2[20])  /*  Longitude of the southern pole               */
+
+
+#define  ISEC2_Reduced              (isec2[16])  /* 0: regular, 1: reduced grid                   */
+
+#define  ISEC2_RowLonPtr            (&isec2[22])
+#define  ISEC2_RowLon(i)            (isec2[22+i]) /* Number of points along each parallel         */
+
+/* */
+
+#define  ISEC2_LatSP                (isec2[12])  /* Latitude of the southern pole of rotation     */
+#define  ISEC2_LonSP                (isec2[13])  /* Longitude of the southern pole of rotation    */
+
+#define  FSEC2_RotAngle             (fsec2[ 0])  /* Angle of rotation                             */
+#define  FSEC2_StrFact              (fsec2[ 1])  /* Stretching factor                             */
+
+/*
+ *  Macros for the bit map section ( Section 3 )
+ */
+#define  ISEC3_PredefBitmap         (isec3[ 0])  /* Predefined bitmap                             */
+#define  ISEC3_MissVal              (isec3[ 1])  /* Missing data value for integers               */
+#define  FSEC3_MissVal              (fsec3[ 1])  /* Missing data value for floats                 */
+
+/*
+ *  Macros for the binary data section ( Section 4 )
+ */
+#define  ISEC4_NumValues            (isec4[ 0])  /* Number of data values for encode/decode       */
+#define  ISEC4_NumBits              (isec4[ 1])  /* Number of bits used for each encoded value    */
+#define  ISEC4_NumNonMissValues     (isec4[20])  /* Number of non-missing values                  */
+
+
+
+
+void  gribFixZSE(int flag);     /* 1: Fix ZeroShiftError of simple packed spherical harmonics */
+void  gribSetConst(int flag);   /* 1: Don't pack constant fields on regular grids */
+void  gribSetDebug(int debug);  /* 1: Debugging */
+void  gribSetRound(int round);
+void  gribSetRefDP(double refval);
+void  gribSetRefSP(float  refval);
+void  gribSetValueCheck(int vcheck);
+
+
+void  gribExSP(int *isec0, int *isec1, int *isec2, float *fsec2, int *isec3,
+               float *fsec3, int *isec4, float *fsec4, int klenp, int *kgrib,
+               int kleng, int *kword, char *hoper, int *kret);
+
+void  gribExDP(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+               double *fsec3, int *isec4, double *fsec4, int klenp, int *kgrib,
+               int kleng, int *kword, char *hoper, int *kret);
+
+
+const char *cgribexLibraryVersion(void);
+
+void  gribDebug(int debug);
+void  gribSetCalendar(int calendar);
+
+void  gribDateTime(int *isec1, int *date, int *time);
+int   gribRefDate(int *isec1);
+int   gribRefTime(int *isec1);
+int   gribTimeIsFC(int *isec1);
+
+void  gribPrintSec0(int *isec0);
+void  gribPrintSec1(int *isec0, int *isec1);
+void  gribPrintSec2DP(int *isec0, int *isec2, double *fsec2);
+void  gribPrintSec2SP(int *isec0, int *isec2, float  *fsec2);
+void  gribPrintSec3DP(int *isec0, int *isec3, double *fsec3);
+void  gribPrintSec3SP(int *isec0, int *isec3, float  *fsec3);
+void  gribPrintSec4DP(int *isec0, int *isec4, double *fsec4);
+void  gribPrintSec4SP(int *isec0, int *isec4, float  *fsec4);
+void  gribPrintSec4Wave(int *isec4);
+
+void  gribPrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribPrintPDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribPrintGDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribPrintBMS(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribPrintBDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribCheck1(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribRepair1(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+
+int grib1Sections(unsigned char *gribbuffer, long recsize, unsigned char **pdsp,
+		  unsigned char **gdsp, unsigned char **bmsp, unsigned char **bdsp);
+int grib2Sections(unsigned char *gribbuffer, long recsize, unsigned char **idsp,
+		  unsigned char **lusp, unsigned char **gdsp, unsigned char **pdsp,
+		  unsigned char **drsp, unsigned char **bmsp, unsigned char **bdsp);
+
+int   gribGetZip(long recsize, unsigned char *gribbuffer, long *urecsize);
+
+int   gribBzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufsize);
+int   gribZip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufsize);
+int   gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufsize);
+
+int   gribOpen(const char *filename, const char *mode);
+void  gribClose(int fileID);
+
+int   gribRead(int fileID, unsigned char *buffer, size_t *buffersize);
+int   gribWrite(int fileID, unsigned char *buffer, size_t buffersize);
+off_t gribGetPos(int fileID);
+int   gribGetSize(int fileID);
+int   gribCheckSeek(int fileID, long *offset, int *version);
+int   gribFileSeek(int fileID, long *offset);
+int   gribReadSize(int fileID);
+int   gribVersion(unsigned char *buffer, size_t buffersize);
+
+int   gribGinfo(long recpos, long recsize, unsigned char *gribbuffer, int *intnum, float *fltnum);
+
+double calculate_pfactor(const double* spectralField, long fieldTruncation, long subsetTruncation);
+
+#endif  /* _CGRIBEX_H */ 
+
+#ifndef _GRIBAPI_H
+#define _GRIBAPI_H
+
+#define  GRIBAPI_MISSVAL  -9.E33
+
+/* GRIB2 Level Types */
+#define  GRIB2_LTYPE_SURFACE               1
+#define  GRIB2_LTYPE_TOA                   8
+#define  GRIB2_LTYPE_SEA_BOTTOM            9
+#define  GRIB2_LTYPE_ATMOSPHERE           10
+#define  GRIB2_LTYPE_ISOBARIC            100
+#define  GRIB2_LTYPE_MEANSEA             101
+#define  GRIB2_LTYPE_ALTITUDE            102
+#define  GRIB2_LTYPE_HEIGHT              103
+#define  GRIB2_LTYPE_SIGMA               104
+#define  GRIB2_LTYPE_HYBRID              105
+#define  GRIB2_LTYPE_LANDDEPTH           106
+#define  GRIB2_LTYPE_ISENTROPIC          107
+#define  GRIB2_LTYPE_REFERENCE           150
+#define  GRIB2_LTYPE_SEADEPTH            160
+
+/* GRIB2 Data representation type (Grid Type) */
+#define  GRIB2_GTYPE_LATLON                0  /*  latitude/longitude                       */
+#define  GRIB2_GTYPE_LATLON_ROT            1  /*  rotated latitude/longitude               */
+#define  GRIB2_GTYPE_LATLON_STR            2  /*  stretched latitude/longitude             */
+#define  GRIB2_GTYPE_LATLON_ROTSTR         3  /*  rotated and stretched latitude/longitude */
+#define  GRIB2_GTYPE_GAUSSIAN             40  /*  gaussian grid                            */
+#define  GRIB2_GTYPE_GAUSSIAN_ROT         41  /*  rotated gaussian grid                    */
+#define  GRIB2_GTYPE_GAUSSIAN_STR         42  /*  stretched gaussian grid                  */
+#define  GRIB2_GTYPE_GAUSSIAN_ROTSTR      43  /*  rotated and stretched gaussian grid      */
+#define  GRIB2_GTYPE_LCC                  30  /*  Lambert conformal                        */
+#define  GRIB2_GTYPE_SPECTRAL             50  /*  spherical harmonics                      */
+#define  GRIB2_GTYPE_GME                 100  /*  hexagonal GME grid                       */
+#define  GRIB2_GTYPE_NUMBER              101  /*  General Unstructured Grid                */
+
+const char *gribapiLibraryVersion(void);
+void gribContainersNew(int streamID);
+void gribContainersDelete(int streamID);
+void *gribHandleNew(int editionNumber);
+void gribHandleDelete(void *gh);
+
+typedef struct {
+  int init;
+  void *gribHandle;
+}
+gribContainer_t;
+
+#endif  /* _GRIBAPI_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _SERVICE_H
+#define _SERVICE_H
+
+
+typedef struct {
+  int    checked;
+  int    byteswap;
+  int    header[8];
+  int    hprec;      /* header precision */
+  int    dprec;      /* data   precision */
+  size_t datasize;
+  size_t buffersize;
+  void  *buffer;
+}
+srvrec_t;
+
+
+const char *srvLibraryVersion(void);
+
+void srvDebug(int debug);
+
+int  srvCheckFiletype(int fileID, int *swap);
+
+srvrec_t *srvNew(void);
+void srvDelete(srvrec_t *srvp);
+
+int  srvRead(int fileID, srvrec_t *srvp);
+int  srvWrite(int fileID, srvrec_t *srvp);
+
+int  srvInqHeader(srvrec_t *srvp, int *header);
+int  srvInqDataSP(srvrec_t *srvp, float *data);
+int  srvInqDataDP(srvrec_t *srvp, double *data);
+
+int  srvDefHeader(srvrec_t *srvp, const int *header);
+int  srvDefDataSP(srvrec_t *srvp, const float *data);
+int  srvDefDataDP(srvrec_t *srvp, const double *data);
+
+
+#endif  /* _SERVICE_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _EXTRA_H
+#define _EXTRA_H
+
+#define  EXT_REAL   1
+#define  EXT_COMP   2
+
+
+typedef struct {
+  int    checked;
+  int    byteswap;
+  int    header[4];
+  int    prec;      /* single or double precison */
+  int    number;    /* real or complex */
+  size_t datasize;
+  size_t buffersize;
+  void  *buffer;
+}
+extrec_t;
+
+
+const char *extLibraryVersion(void);
+
+void extDebug(int debug);
+
+int  extCheckFiletype(int fileID, int *swap);
+
+void *extNew(void);
+void extDelete(void *ext);
+
+int  extRead(int fileID, void *ext);
+int  extWrite(int fileID, void *ext);
+
+int  extInqHeader(void *ext, int *header);
+int  extInqDataSP(void *ext, float *data);
+int  extInqDataDP(void *ext, double *data);
+
+int  extDefHeader(void *ext, const int *header);
+int  extDefDataSP(void *ext, const float *data);
+int  extDefDataDP(void *ext, const double *data);
+
+#endif  /* _EXTRA_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _IEG_H
+#define _IEG_H
+
+/* Level Types */
+#define  IEG_LTYPE_SURFACE               1
+#define  IEG_LTYPE_99                   99
+#define  IEG_LTYPE_ISOBARIC            100
+#define  IEG_LTYPE_MEANSEA             102
+#define  IEG_LTYPE_ALTITUDE            103
+#define  IEG_LTYPE_HEIGHT              105
+#define  IEG_LTYPE_SIGMA               107
+#define  IEG_LTYPE_HYBRID              109
+#define  IEG_LTYPE_HYBRID_LAYER        110
+#define  IEG_LTYPE_LANDDEPTH           111
+#define  IEG_LTYPE_LANDDEPTH_LAYER     112
+#define  IEG_LTYPE_SEADEPTH            160
+#define  IEG_LTYPE_99_MARGIN          1000
+
+/*
+ *  Data representation type (Grid Type) [Table 6]
+ */
+#define  IEG_GTYPE_LATLON             0  /*  latitude/longitude                       */
+#define  IEG_GTYPE_LATLON_ROT        10  /*  rotated latitude/longitude               */
+
+#define  IEG_P_CodeTable(x)   (x[ 5])  /*  Version number of code table                 */
+#define  IEG_P_Parameter(x)   (x[ 6])  /*  Parameter indicator                          */
+#define  IEG_P_LevelType(x)   (x[ 7])  /*  Type of level indicator                      */
+#define  IEG_P_Level1(x)      (x[ 8])  /*  Level 1                                      */
+#define  IEG_P_Level2(x)      (x[ 9])  /*  Level 2                                      */
+#define  IEG_P_Year(x)        (x[10])  /*  Year of century (YY)                         */
+#define  IEG_P_Month(x)       (x[11])  /*  Month (MM)                                   */
+#define  IEG_P_Day(x)         (x[12])  /*  Day (DD)                                     */
+#define  IEG_P_Hour(x)        (x[13])  /*  Hour (HH)                                    */
+#define  IEG_P_Minute(x)      (x[14])  /*  Minute (MM)                                  */
+
+/*
+ *  Macros for the grid definition section ( Section 2 )
+ */
+#define  IEG_G_Size(x)        (x[ 0])
+#define  IEG_G_NumVCP(x)      (x[3] == 10 ? (x[0]-42)/4 : (x[0]-32)/4)
+#define  IEG_G_GridType(x)    (x[ 3])  /*  Data representation type */
+#define  IEG_G_NumLon(x)      (x[ 4])  /*  Number of points along a parallel (Ni)       */
+#define  IEG_G_NumLat(x)      (x[ 5])  /*  Number of points along a meridian (Nj)       */
+#define  IEG_G_FirstLat(x)    (x[ 6])  /*  Latitude of the first grid point             */
+#define  IEG_G_FirstLon(x)    (x[ 7])  /*  Longitude of the first grid point            */
+#define  IEG_G_ResFlag(x)     (x[ 8])  /*  Resolution flag: 128 regular grid            */
+#define  IEG_G_LastLat(x)     (x[ 9])  /*  Latitude of the last grid point              */
+#define  IEG_G_LastLon(x)     (x[10])  /*  Longitude of the last grid point             */
+#define  IEG_G_LonIncr(x)     (x[11])  /*  i direction increment                        */
+#define  IEG_G_LatIncr(x)     (x[12])  /*  j direction increment                        */
+#define  IEG_G_ScanFlag(x)    (x[13])
+#define  IEG_G_LatSP(x)       (x[16])  /*  Latitude of the southern pole of rotation    */
+#define  IEG_G_LonSP(x)       (x[17])  /*  Longitude of the southern pole of rotation   */
+
+
+typedef struct {
+  int    checked;
+  int    byteswap;
+  int    dprec;      /* data   precision */
+  double refval;
+  int    ipdb[37];
+  int    igdb[22];
+  double vct[100];
+  size_t datasize;
+  size_t buffersize;
+  void  *buffer;
+}
+iegrec_t;
+
+
+const char *iegLibraryVersion(void);
+
+void iegDebug(int debug);
+int  iegCheckFiletype(int fileID, int *swap);
+
+iegrec_t *iegNew(void);
+void iegDelete(iegrec_t *iegp);
+void iegInit(iegrec_t *iegp);
+void iegInitMem(iegrec_t *iegp);
+
+int  iegRead(int fileID, iegrec_t *iegp);
+int  iegWrite(int fileID, iegrec_t *iegp);
+
+void iegCopyMeta(iegrec_t *diegp, iegrec_t *siegp);
+int  iegInqHeader(iegrec_t *iegp, int *header);
+int  iegInqDataSP(iegrec_t *iegp, float *data);
+int  iegInqDataDP(iegrec_t *iegp, double *data);
+
+int  iegDefHeader(iegrec_t *iegp, const int *header);
+int  iegDefDataSP(iegrec_t *iegp, const float *data);
+int  iegDefDataDP(iegrec_t *iegp, const double *data);
+
+
+#endif  /* _IEG_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+/*
+  CDI C header file
+
+  This is the only file that must be included to use the CDI library from C.
+*/
+
+#ifndef  _CDI_H
+#define  _CDI_H
+
+#include <sys/types.h>
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+#define  CDI_MAX_NAME           256   /* max length of a name                 */
+
+#define  CDI_UNDEFID             -1
+#define  CDI_GLOBAL              -1   /* Global var ID for vlist              */
+
+/* Byte order */
+
+#define  CDI_BIGENDIAN            0   /* Byte order BIGENDIAN                 */
+#define  CDI_LITTLEENDIAN         1   /* Byte order LITTLEENDIAN              */
+
+#define  CDI_REAL                 1   /* Real numbers                         */
+#define  CDI_COMP                 2   /* Complex numbers                      */
+#define  CDI_BOTH                 3   /* Both numbers                         */
+
+/* Error identifier */
+
+#define	 CDI_NOERR        	  0   /* No Error                             */
+#define  CDI_ESYSTEM            -10   /* Operating system error               */
+#define  CDI_EINVAL             -20   /* Invalid argument                     */
+#define  CDI_EUFTYPE            -21   /* Unsupported file type                */
+#define  CDI_ELIBNAVAIL         -22   /* xxx library not available            */
+#define  CDI_EUFSTRUCT          -23   /* Unsupported file structure           */
+#define  CDI_EUNC4              -24   /* Unsupported netCDF4 structure        */
+#define  CDI_ELIMIT             -99   /* Internal limits exceeded             */
+
+/* File types */
+
+#define  FILETYPE_GRB             1   /* File type GRIB                       */
+#define  FILETYPE_GRB2            2   /* File type GRIB version 2             */
+#define  FILETYPE_NC              3   /* File type netCDF                     */
+#define  FILETYPE_NC2             4   /* File type netCDF version 2 (64-bit)  */
+#define  FILETYPE_NC4             5   /* File type netCDF version 4           */
+#define  FILETYPE_NC4C            6   /* File type netCDF version 4 (classic) */
+#define  FILETYPE_SRV             7   /* File type SERVICE                    */
+#define  FILETYPE_EXT             8   /* File type EXTRA                      */
+#define  FILETYPE_IEG             9   /* File type IEG                        */
+
+/* Compress types */
+
+#define  COMPRESS_NONE            0
+#define  COMPRESS_SZIP            1
+#define  COMPRESS_GZIP            2
+#define  COMPRESS_BZIP2           3
+#define  COMPRESS_ZIP             4
+#define  COMPRESS_JPEG            5
+
+/* external data types */
+
+#define  DATATYPE_PACK            0
+#define  DATATYPE_PACK1           1
+#define  DATATYPE_PACK2           2
+#define  DATATYPE_PACK3           3
+#define  DATATYPE_PACK4           4
+#define  DATATYPE_PACK5           5
+#define  DATATYPE_PACK6           6
+#define  DATATYPE_PACK7           7
+#define  DATATYPE_PACK8           8
+#define  DATATYPE_PACK9           9
+#define  DATATYPE_PACK10         10
+#define  DATATYPE_PACK11         11
+#define  DATATYPE_PACK12         12
+#define  DATATYPE_PACK13         13
+#define  DATATYPE_PACK14         14
+#define  DATATYPE_PACK15         15
+#define  DATATYPE_PACK16         16
+#define  DATATYPE_PACK17         17
+#define  DATATYPE_PACK18         18
+#define  DATATYPE_PACK19         19
+#define  DATATYPE_PACK20         20
+#define  DATATYPE_PACK21         21
+#define  DATATYPE_PACK22         22
+#define  DATATYPE_PACK23         23
+#define  DATATYPE_PACK24         24
+#define  DATATYPE_PACK25         25
+#define  DATATYPE_PACK26         26
+#define  DATATYPE_PACK27         27
+#define  DATATYPE_PACK28         28
+#define  DATATYPE_PACK29         29
+#define  DATATYPE_PACK30         30
+#define  DATATYPE_PACK31         31
+#define  DATATYPE_PACK32         32
+#define  DATATYPE_CPX32          64
+#define  DATATYPE_CPX64         128
+#define  DATATYPE_FLT32         132
+#define  DATATYPE_FLT64         164
+#define  DATATYPE_INT8          208
+#define  DATATYPE_INT16         216
+#define  DATATYPE_INT32         232
+#define  DATATYPE_UINT8         308
+#define  DATATYPE_UINT16        316
+#define  DATATYPE_UINT32        332
+
+/* internal data types */
+
+#define  DATATYPE_INT           251
+#define  DATATYPE_FLT           252
+#define  DATATYPE_TXT           253
+#define  DATATYPE_CPX           254
+
+/* Chunks */
+
+#define  CHUNK_AUTO               1  /* use default chunk size                  */
+#define  CHUNK_GRID               2
+#define  CHUNK_LINES              3
+
+/* GRID types */
+
+#define  GRID_GENERIC             1  /* Generic grid                            */
+#define  GRID_GAUSSIAN            2  /* Regular Gaussian lon/lat grid           */
+#define  GRID_GAUSSIAN_REDUCED    3  /* Reduced Gaussian lon/lat grid           */
+#define  GRID_LONLAT              4  /* Regular longitude/latitude grid         */
+#define  GRID_SPECTRAL            5  /* Spherical harmonic coefficients         */
+#define  GRID_FOURIER             6  /* Fourier coefficients                    */
+#define  GRID_GME                 7  /* Icosahedral-hexagonal GME grid          */
+#define  GRID_TRAJECTORY          8  /* Trajectory                              */
+#define  GRID_UNSTRUCTURED        9  /* General unstructured grid               */
+#define  GRID_CURVILINEAR        10  /* Curvilinear grid                        */
+#define  GRID_LCC                11  /* Lambert Conformal Conic (GRIB)          */
+#define  GRID_LCC2               12  /* Lambert Conformal Conic (PROJ)          */
+#define  GRID_LAEA               13  /* Lambert Azimuthal Equal Area            */
+#define  GRID_SINUSOIDAL         14  /* Sinusoidal                              */
+#define  GRID_REFERENCE          15  /* Grid reference number                   */
+#define  GRID_PROJECTION         16  /* Projected coordiantes                   */
+
+/* ZAXIS types */
+
+#define  ZAXIS_SURFACE            0  /* Surface level                           */
+#define  ZAXIS_GENERIC            1  /* Generic level                           */
+#define  ZAXIS_HYBRID             2  /* Hybrid level                            */
+#define  ZAXIS_HYBRID_HALF        3  /* Hybrid half level                       */
+#define  ZAXIS_PRESSURE           4  /* Isobaric pressure level in Pascal       */
+#define  ZAXIS_HEIGHT             5  /* Height above ground in meters           */
+#define  ZAXIS_DEPTH_BELOW_SEA    6  /* Depth below sea level in meters         */
+#define  ZAXIS_DEPTH_BELOW_LAND   7  /* Depth below land surface in centimeters */
+#define  ZAXIS_ISENTROPIC         8  /* Isentropic                              */
+#define  ZAXIS_TRAJECTORY         9  /* Trajectory                              */
+#define  ZAXIS_ALTITUDE          10  /* Altitude above mean sea level in meters */
+#define  ZAXIS_SIGMA             11  /* Sigma level                             */
+#define  ZAXIS_MEANSEA           12  /* Mean sea level                          */
+#define  ZAXIS_TOA               13  /* Norminal top of atmosphere              */
+#define  ZAXIS_SEA_BOTTOM        14  /* Sea bottom                              */
+#define  ZAXIS_ATMOSPHERE        15  /* Entire atmosphere                       */
+#define  ZAXIS_REFERENCE         16  /* zaxis reference number                  */
+
+/* TIME types */
+
+#define  TIME_CONSTANT            0  /* obsolate, use TSTEP_CONSTANT            */
+#define  TIME_VARIABLE            1  /* obsolate, use TSTEP_INSTANT             */
+
+/* TSTEP types */
+
+#define  TSTEP_CONSTANT           0
+#define  TSTEP_INSTANT            1
+#define  TSTEP_AVG                2
+#define  TSTEP_ACCUM              3
+#define  TSTEP_MAX                4
+#define  TSTEP_MIN                5
+#define  TSTEP_DIFF               6
+#define  TSTEP_RMS                7
+#define  TSTEP_SD                 8
+#define  TSTEP_COV                9
+#define  TSTEP_RATIO             10
+#define  TSTEP_RANGE             11
+#define  TSTEP_INSTANT2          12
+#define  TSTEP_INSTANT3          13
+
+/* TAXIS types */
+
+#define  TAXIS_ABSOLUTE           1
+#define  TAXIS_RELATIVE           2
+
+/* TUNIT types */
+
+#define  TUNIT_SECOND             1
+#define  TUNIT_MINUTE             2
+#define  TUNIT_HOUR               3
+#define  TUNIT_DAY                4
+#define  TUNIT_MONTH              5
+#define  TUNIT_YEAR               6
+#define  TUNIT_QUARTER            7
+#define  TUNIT_3HOURS             8
+#define  TUNIT_6HOURS             9
+#define  TUNIT_12HOURS           10
+
+/* CALENDAR types */
+
+#define  CALENDAR_STANDARD        0  /* don't change this value (used also in cgribexlib)! */
+#define  CALENDAR_PROLEPTIC       1
+#define  CALENDAR_360DAYS         2
+#define  CALENDAR_365DAYS         3
+#define  CALENDAR_366DAYS         4
+#define  CALENDAR_NONE            5
+
+/* parallel IO IOMode */
+
+#define  PIO_NONE                 0
+#define  PIO_MPI                  1
+#define  PIO_WRITER               2
+#define  PIO_ASYNCH               3
+#define  PIO_FPGUARD              4
+
+#define  PIO_MINIOMODE                  PIO_NONE
+#define  PIO_MAXIOMODE                  PIO_FPGUARD
+#define  PIO_MINIOMODEWITHSPECIALPROCS  PIO_WRITER
+
+/* parallel IO routines */
+
+void     pioEndDef             ( void );
+void     pioEndTimestepping    ( void );
+void     pioFinalize           ( void );
+int      pioInit               ( int, int, int, int, int * );
+int      pioInqVarDecoChunk    ( int, int );
+int      pioInqVarDecoOff      ( int, int );
+void     pioNamespaceSetActive ( int );
+void     pioWriteTimestep      ( int, int, int );
+
+/* CDI control routines */
+
+void    cdiReset(void);
+
+char   *cdiStringError(int cdiErrno);
+
+void    cdiDebug(int debug);
+
+char   *cdiLibraryVersion(void);
+void    cdiPrintVersion(void);
+
+void    cdiDefMissval(double missval);
+double  cdiInqMissval(void);
+void    cdiDefGlobal(const char *string, int val);
+
+/* CDI converter routines */
+
+/* parameter */
+
+void    cdiParamToString(int param, char *paramstr, int maxlen);
+
+void    cdiDecodeParam(int param, int *pnum, int *pcat, int *pdis);
+int     cdiEncodeParam(int pnum, int pcat, int pdis);
+
+/* date format:  YYYYMMDD */
+/* time format:    hhmmss */
+
+void    cdiDecodeDate(int date, int *year, int *month, int *day);
+int     cdiEncodeDate(int year, int month, int day);
+
+void    cdiDecodeTime(int time, int *hour, int *minute, int *second);
+int     cdiEncodeTime(int hour, int minute, int second);
+
+
+/* STREAM control routines */
+
+/*      streamOpenRead: Open a dataset for reading */
+int     streamOpenRead(const char *path);
+
+/*      streamOpenWrite: Create a new dataset */
+int     streamOpenWrite(const char *path, int filetype);
+
+int     streamOpenAppend(const char *path);
+
+/*      streamClose: Close an open dataset */
+void    streamClose(int streamID);
+
+/*      streamSync: Synchronize an Open Dataset to Disk */
+void    streamSync(int streamID);
+
+/*      streamDefVlist: Define the Vlist for a stream */
+void    streamDefVlist(int streamID, int vlistID);
+
+/*      streamInqVlist: Get the Vlist of a stream */
+int     streamInqVlist(int streamID);
+int     streamInqVlistIDorig(int streamID);
+
+/*      streamInqFiletype: Get the filetype */
+int     streamInqFiletype(int streamID);
+
+/*      streamDefByteorder: Define the byteorder */
+void    streamDefByteorder(int streamID, int byteorder);
+
+/*      streamInqByteorder: Get the byteorder */
+int     streamInqByteorder(int streamID);
+
+/*      streamDefCompType: Define compression type */
+void    streamDefCompType(int streamID, int comptype);
+
+/*      streamDefCompLevel: Define compression level */
+void    streamDefCompLevel(int streamID, int complevel);
+
+/*      streamInqCompType: Get compression type */
+int     streamInqCompType(int streamID);
+
+/*      streamInqCompLevel: Get compression level */
+int     streamInqCompLevel(int streamID);
+
+/*      streamDefTimestep: Define time step */
+int     streamDefTimestep(int streamID, int tsID);
+
+/*      streamInqTimestep: Get time step */
+int     streamInqTimestep(int streamID, int tsID);
+
+char   *streamFilename(int streamID);
+char   *streamFilesuffix(int filetype);
+int     streamNtsteps(int streamID);
+off_t   streamNvals(int streamID);
+
+int     streamInqNvars ( int streamID );
+
+/* STREAM var I/O routines */
+
+/*      streamReadVar: Read a variable */
+void    streamReadVar(int streamID, int varID, double *data_vec, int *nmiss);
+
+/*      streamWriteVar: Write a variable */
+void    streamWriteVar(int streamID, int varID, const double *data_vec, int nmiss);
+void    streamWriteVarF(int streamID, int varID, const float *data_vec, int nmiss);
+
+/*      streamReadVarSlice: Read a horizontal slice of a variable */
+void    streamReadVarSlice(int streamID, int varID, int levelID, double *data_vec, int *nmiss);
+
+/*      streamWriteVarSlice: Write a horizontal slice of a variable */
+void    streamWriteVarSlice(int streamID, int varID, int levelID, const double *data_vec, int nmiss);
+void    streamWriteVarSliceF(int streamID, int varID, int levelID, const float *data_vec, int nmiss);
+
+
+/* STREAM record I/O routines */
+
+void    streamInqRecord(int streamID, int *varID, int *levelID);
+void    streamDefRecord(int streamID, int  varID, int  levelID);
+void    streamReadRecord(int streamID, double *data_vec, int *nmiss);
+void    streamWriteRecord(int streamID, const double *data_vec, int nmiss);
+void    streamWriteRecordF(int streamID, const float *data_vec, int nmiss);
+void    streamCopyRecord(int streamIDdest, int streamIDsrc);
+
+void    streamInqGinfo(int streamID, int *intnum, float *fltnum);
+
+/* VLIST routines */
+
+/*      vlistCreate: Create a variable list */
+int     vlistCreate(void);
+
+/*      vlistDestroy: Destroy a variable list */
+void    vlistDestroy(int vlistID);
+
+/*      vlistDuplicate: Duplicate a variable list */
+int     vlistDuplicate(int vlistID);
+
+/*      vlistCopy: Copy a variable list */
+void    vlistCopy(int vlistID2, int vlistID1);
+
+/*      vlistCopyFlag: Copy some entries of a variable list */
+void    vlistCopyFlag(int vlistID2, int vlistID1);
+
+void    vlistClearFlag(int vlistID);
+
+/*      vlistCat: Concatenate two variable lists */
+void    vlistCat(int vlistID2, int vlistID1);
+
+/*      vlistMerge: Merge two variable lists */
+void    vlistMerge(int vlistID2, int vlistID1);
+
+void    vlistPrint(int vlistID);
+
+/*      vlistNumber: Number type in a variable list */
+int     vlistNumber(int vlistID);
+
+/*      vlistNvars: Number of variables in a variable list */
+int     vlistNvars(int vlistID);
+
+/*      vlistNgrids: Number of grids in a variable list */
+int     vlistNgrids(int vlistID);
+
+/*      vlistNzaxis: Number of zaxis in a variable list */
+int     vlistNzaxis(int vlistID);
+
+void    vlistDefNtsteps(int vlistID, int nts);
+int     vlistNtsteps(int vlistID);
+int     vlistGridsizeMax(int vlistID);
+int     vlistGrid(int vlistID, int index);
+int     vlistGridIndex(int vlistID, int gridID);
+void    vlistChangeGridIndex(int vlistID, int index, int gridID);
+void    vlistChangeGrid(int vlistID, int gridID1, int gridID2);
+int     vlistZaxis(int vlistID, int index);
+int     vlistZaxisIndex(int vlistID, int zaxisID);
+void    vlistChangeZaxisIndex(int vlistID, int index, int zaxisID);
+void    vlistChangeZaxis(int vlistID, int zaxisID1, int zaxisID2);
+int     vlistNrecs(int vlistID);
+
+/*      vlistDefTaxis: Define the time axis of a variable list */
+void    vlistDefTaxis(int vlistID, int taxisID);
+
+/*      vlistInqTaxis: Get the time axis of a variable list */
+int     vlistInqTaxis(int vlistID);
+
+void    vlistDefTable(int vlistID, int tableID);
+int     vlistInqTable(int vlistID);
+void    vlistDefInstitut(int vlistID, int instID);
+int     vlistInqInstitut(int vlistID);
+void    vlistDefModel(int vlistID, int modelID);
+int     vlistInqModel(int vlistID);
+
+
+/* VLIST VAR routines */
+
+/*      vlistDefVar: Create a new Variable */
+int     vlistDefVar(int vlistID, int gridID, int zaxisID, int tsteptype);
+
+void    vlistChangeVarGrid(int vlistID, int varID, int gridID);
+void    vlistChangeVarZaxis(int vlistID, int varID, int zaxisID);
+
+void    vlistInqVar(int vlistID, int varID, int *gridID, int *zaxisID, int *tsteptype);
+int     vlistInqVarGrid(int vlistID, int varID);
+int     vlistInqVarZaxis(int vlistID, int varID);
+
+/* used in MPIOM */
+int     vlistInqVarID(int vlistID, int code);
+
+int     vlistInqVarTsteptype(int vlistID, int varID);
+void    vlistDefVarTsteptype(int vlistID, int varID, int tsteptype);
+
+void    vlistDefVarCompType(int vlistID, int varID, int comptype);
+int     vlistInqVarCompType(int vlistID, int varID);
+void    vlistDefVarCompLevel(int vlistID, int varID, int complevel);
+int     vlistInqVarCompLevel(int vlistID, int varID);
+
+/*      vlistDefVarParam: Define the parameter number of a Variable */
+void    vlistDefVarParam(int vlistID, int varID, int param);
+
+/*      vlistInqVarParam: Get the parameter number of a Variable */
+int     vlistInqVarParam(int vlistID, int varID);
+
+/*      vlistDefVarCode: Define the code number of a Variable */
+void    vlistDefVarCode(int vlistID, int varID, int code);
+
+/*      vlistInqVarCode: Get the code number of a Variable */
+int     vlistInqVarCode(int vlistID, int varID);
+
+/*      vlistDefVarDatatype: Define the data type of a Variable */
+void    vlistDefVarDatatype(int vlistID, int varID, int datatype);
+
+/*      vlistInqVarDatatype: Get the data type of a Variable */
+int     vlistInqVarDatatype(int vlistID, int varID);
+
+void    vlistDefVarChunkType(int vlistID, int varID, int chunktype);
+int     vlistInqVarChunkType(int vlistID, int varID);
+
+void    vlistDefVarXYZ(int vlistID, int varID, int xyz);
+int     vlistInqVarXYZ(int vlistID, int varID);
+
+int     vlistInqVarNumber(int vlistID, int varID);
+
+void    vlistDefVarInstitut(int vlistID, int varID, int instID);
+int     vlistInqVarInstitut(int vlistID, int varID);
+void    vlistDefVarModel(int vlistID, int varID, int modelID);
+int     vlistInqVarModel(int vlistID, int varID);
+void    vlistDefVarTable(int vlistID, int varID, int tableID);
+int     vlistInqVarTable(int vlistID, int varID);
+
+/*      vlistDefVarName: Define the name of a Variable */
+void    vlistDefVarName(int vlistID, int varID, const char *name);
+
+/*      vlistInqVarName: Get the name of a Variable */
+void    vlistInqVarName(int vlistID, int varID, char *name);
+
+/*      vlistDefVarStdname: Define the standard name of a Variable */
+void    vlistDefVarStdname(int vlistID, int varID, const char *stdname);
+
+/*      vlistInqVarStdname: Get the standard name of a Variable */
+void    vlistInqVarStdname(int vlistID, int varID, char *stdname);
+
+/*      vlistDefVarLongname: Define the long name of a Variable */
+void    vlistDefVarLongname(int vlistID, int varID, const char *longname);
+
+/*      vlistInqVarLongname: Get the long name of a Variable */
+void    vlistInqVarLongname(int vlistID, int varID, char *longname);
+
+/*      vlistDefVarUnits: Define the units of a Variable */
+void    vlistDefVarUnits(int vlistID, int varID, const char *units);
+
+/*      vlistInqVarUnits: Get the units of a Variable */
+void    vlistInqVarUnits(int vlistID, int varID, char *units);
+
+/*      vlistDefVarMissval: Define the missing value of a Variable */
+void    vlistDefVarMissval(int vlistID, int varID, double missval);
+
+/*      vlistInqVarMissval: Get the missing value of a Variable */
+double  vlistInqVarMissval(int vlistID, int varID);
+
+void    vlistDefVarScalefactor(int vlistID, int varID, double scalefactor);
+double  vlistInqVarScalefactor(int vlistID, int varID);
+void    vlistDefVarAddoffset(int vlistID, int varID, double addoffset);
+double  vlistInqVarAddoffset(int vlistID, int varID);
+
+void    vlistDefVarTimave(int vlistID, int varID, int timave);
+int     vlistInqVarTimave(int vlistID, int varID);
+void    vlistDefVarTimaccu(int vlistID, int varID, int timaccu);
+int     vlistInqVarTimaccu(int vlistID, int varID);
+
+int     vlistInqVarSize(int vlistID, int varID);
+
+void    vlistDefIndex(int vlistID, int varID, int levID, int index);
+int     vlistInqIndex(int vlistID, int varID, int levID);
+void    vlistDefFlag(int vlistID, int varID, int levID, int flag);
+int     vlistInqFlag(int vlistID, int varID, int levID);
+int     vlistFindVar(int vlistID, int fvarID);
+int     vlistFindLevel(int vlistID, int fvarID, int flevelID);
+int     vlistMergedVar(int vlistID, int varID);
+int     vlistMergedLevel(int vlistID, int varID, int levelID);
+
+/*     Ensemble info routines */
+void    vlistDefVarEnsemble(int vlistID, int varID, int ensID, int ensCount, int forecast_type);
+int     vlistInqVarEnsemble(int vlistID, int varID, int *ensID, int *ensCount, int *forecast_type);
+
+/* VLIST attributes */
+
+/*      vlistInqNatts: Get number of variable attributes assigned to this variable */
+int     vlistInqNatts(int vlistID, int varID, int *nattsp);
+/*      vlistInqAtt: Get information about an attribute */
+int     vlistInqAtt(int vlistID, int varID, int attrnum, char *name, int *typep, int *lenp);
+int     vlistDelAtt(int vlistID, int varID, const char *name);
+
+/*      vlistDefAttInt: Define an integer attribute */
+int     vlistDefAttInt(int vlistID, int varID, const char *name, int type, int len, const int *ip_vec);
+/*      vlistDefAttFlt: Define a floating point attribute */
+int     vlistDefAttFlt(int vlistID, int varID, const char *name, int type, int len, const double *dp_vec);
+/*      vlistDefAttTxt: Define a text attribute */
+int     vlistDefAttTxt(int vlistID, int varID, const char *name, int len, const char *tp);
+
+/*      vlistInqAttInt: Get the value(s) of an integer attribute */
+int     vlistInqAttInt(int vlistID, int varID, const char *name, int mlen, int *ip_vec);
+/*      vlistInqAttFlt: Get the value(s) of a floating point attribute */
+int     vlistInqAttFlt(int vlistID, int varID, const char *name, int mlen, double *dp_vec);
+/*      vlistInqAttTxt: Get the value(s) of a text attribute */
+int     vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen, char *tp);
+
+
+/* GRID routines */
+
+void    gridName(int gridtype, char *gridname);
+char   *gridNamePtr(int gridtype);
+
+void    gridCompress(int gridID);
+
+void    gridDefMaskGME(int gridID, const int *mask_vec);
+int     gridInqMaskGME(int gridID, int *mask_vec);
+
+void    gridDefMask(int gridID, const int *mask_vec);
+int     gridInqMask(int gridID, int *mask_vec);
+
+void    gridPrint(int gridID, int opt);
+int     gridSize(void);
+
+/*      gridCreate: Create a horizontal Grid */
+int     gridCreate(int gridtype, int size);
+
+/*      gridDestroy: Destroy a horizontal Grid */
+void    gridDestroy(int gridID);
+
+/*      gridDuplicate: Duplicate a Grid */
+int     gridDuplicate(int gridID);
+
+/*      gridInqType: Get the type of a Grid */
+int     gridInqType(int gridID);
+
+/*      gridInqSize: Get the size of a Grid */
+int     gridInqSize(int gridID);
+
+/*      gridDefXsize: Define the size of a X-axis */
+void    gridDefXsize(int gridID, int xsize);
+
+/*      gridInqXsize: Get the size of a X-axis */
+int     gridInqXsize(int gridID);
+
+/*      gridDefYsize: Define the size of a Y-axis */
+void    gridDefYsize(int gridID, int ysize);
+
+/*      gridInqYsize: Get the size of a Y-axis */
+int     gridInqYsize(int gridID);
+
+/*      gridDefNP: Define the number of parallels between a pole and the equator */
+void    gridDefNP(int gridID, int np);
+
+/*      gridInqNP: Get the number of parallels between a pole and the equator */
+int     gridInqNP(int gridID);
+
+/*      gridDefXvals: Define the values of a X-axis */
+void    gridDefXvals(int gridID, const double *xvals_vec);
+
+/*      gridInqXvals: Get all values of a X-axis */
+int     gridInqXvals(int gridID, double *xvals_vec);
+
+/*      gridDefYvals: Define the values of a Y-axis */
+void    gridDefYvals(int gridID, const double *yvals_vec);
+
+/*      gridInqYvals: Get all values of a Y-axis */
+int     gridInqYvals(int gridID, double *yvals_vec);
+
+/*      gridDefXname: Define the name of a X-axis */
+void    gridDefXname(int gridID, const char *xname);
+
+/*      gridDefXlongname: Define the longname of a X-axis  */
+void    gridDefXlongname(int gridID, const char *xlongname);
+
+/*      gridDefXunits: Define the units of a X-axis */
+void    gridDefXunits(int gridID, const char *xunits);
+
+/*      gridDefYname: Define the name of a Y-axis */
+void    gridDefYname(int gridID, const char *yname);
+
+/*      gridDefYlongname: Define the longname of a Y-axis */
+void    gridDefYlongname(int gridID, const char *ylongname);
+
+/*      gridDefYunits: Define the units of a Y-axis */
+void    gridDefYunits(int gridID, const char *yunits);
+
+/*      gridInqXname: Get the name of a X-axis */
+void    gridInqXname(int gridID, char *xname);
+
+/*      gridInqXlongname: Get the longname of a X-axis */
+void    gridInqXlongname(int gridID, char *xlongname);
+
+/*      gridInqXstdname: Get the standard name of a X-axis */
+void    gridInqXstdname(int gridID, char *xstdname);
+
+/*      gridInqXunits: Get the units of a X-axis */
+void    gridInqXunits(int gridID, char *xunits);
+
+/*      gridInqYname: Get the name of a Y-axis */
+void    gridInqYname(int gridID, char *yname);
+
+/*      gridInqYlongname: Get the longname of a Y-axis */
+void    gridInqYlongname(int gridID, char *ylongname);
+
+/*      gridInqYstdname: Get the standard name of a Y-axis */
+void    gridInqYstdname(int gridID, char *ystdname);
+
+/*      gridInqYunits: Get the units of a Y-axis */
+void    gridInqYunits(int gridID, char *yunits);
+
+/*      gridDefPrec: Define the precision of a Grid */
+void    gridDefPrec(int gridID, int prec);
+
+/*      gridInqPrec: Get the precision of a Grid */
+int     gridInqPrec(int gridID);
+
+/*      gridInqXval: Get one value of a X-axis */
+double  gridInqXval(int gridID, int index);
+
+/*      gridInqYval: Get one value of a Y-axis */
+double  gridInqYval(int gridID, int index);
+
+double  gridInqXinc(int gridID);
+double  gridInqYinc(int gridID);
+
+int     gridIsCircular(int gridID);
+int     gridIsRotated(int gridID);
+double  gridInqXpole(int gridID);
+void    gridDefXpole(int gridID, double xpole);
+double  gridInqYpole(int gridID);
+void    gridDefYpole(int gridID, double ypole);
+double  gridInqAngle(int gridID);
+void    gridDefAngle(int gridID, double angle);
+void    gridDefTrunc(int gridID, int trunc);
+int     gridInqTrunc(int gridID);
+/* Hexagonal GME grid */
+int     gridInqGMEnd(int gridID);
+void    gridDefGMEnd(int gridID, int nd);
+int     gridInqGMEni(int gridID);
+void    gridDefGMEni(int gridID, int ni);
+int     gridInqGMEni2(int gridID);
+void    gridDefGMEni2(int gridID, int ni2);
+int     gridInqGMEni3(int gridID);
+void    gridDefGMEni3(int gridID, int ni3);
+
+/* Reference grid */
+int     gridInqNumber(int gridID);
+void    gridDefNumber(int gridID, int number);
+int     gridInqPosition(int gridID);
+void    gridDefPosition(int gridID, int position);
+int     gridInqReference(int gridID, char *reference);
+void    gridDefReference(int gridID, const char *reference);
+char   *gridInqUUID(int gridID, char *uuid);
+void    gridDefUUID(int gridID, const char *uuid);
+
+
+/* Lambert Conformal Conic grid (GRIB version) */
+void gridDefLCC(int gridID, double originLon, double originLat, double lonParY, double lat1, double lat2, double xinc, double yinc, int projflag, int scanflag);
+void gridInqLCC(int gridID, double *originLon, double *originLat, double *lonParY, double *lat1, double *lat2, double *xinc, double *yinc, int *projflag, int *scanflag);
+
+/* Lambert Conformal Conic 2 grid (PROJ version) */
+void gridDefLcc2(int gridID, double earth_radius, double lon_0, double lat_0, double lat_1, double lat_2);
+void gridInqLcc2(int gridID, double *earth_radius, double *lon_0, double *lat_0, double *lat_1, double *lat_2);
+
+/* Lambert Azimuthal Equal Area grid */
+void gridDefLaea(int gridID, double earth_radius, double lon_0, double lat_0);
+void gridInqLaea(int gridID, double *earth_radius, double *lon_0, double *lat_0);
+
+
+void    gridDefArea(int gridID, const double *area_vec);
+void    gridInqArea(int gridID, double *area_vec);
+int     gridHasArea(int gridID);
+
+/*      gridDefNvertex: Define the number of vertex of a Gridbox */
+void    gridDefNvertex(int gridID, int nvertex);
+
+/*      gridInqNvertex: Get the number of vertex of a Gridbox */
+int     gridInqNvertex(int gridID);
+
+/*      gridDefXbounds: Define the bounds of a X-axis */
+void    gridDefXbounds(int gridID, const double *xbounds_vec);
+
+/*      gridInqXbounds: Get the bounds of a X-axis */
+int     gridInqXbounds(int gridID, double *xbounds_vec);
+
+/*      gridDefYbounds: Define the bounds of a Y-axis */
+void    gridDefYbounds(int gridID, const double *ybounds_vec);
+
+/*      gridInqYbounds: Get the bounds of a Y-axis */
+int     gridInqYbounds(int gridID, double *ybounds_vec);
+
+void    gridDefRowlon(int gridID, int nrowlon, const int *rowlon_vec);
+void    gridInqRowlon(int gridID, int *rowlon_vec);
+void    gridChangeType(int gridID, int gridtype);
+
+void    gridDefComplexPacking(int gridID, int lpack);
+int     gridInqComplexPacking(int gridID);
+
+/* ZAXIS routines */
+
+void    zaxisName(int zaxistype, char *zaxisname);
+
+/*      zaxisCreate: Create a vertical Z-axis */
+int     zaxisCreate(int zaxistype, int size);
+
+/*      zaxisDestroy: Destroy a vertical Z-axis */
+void    zaxisDestroy(int zaxisID);
+
+/*      zaxisInqType: Get the type of a Z-axis */
+int     zaxisInqType(int zaxisID);
+
+/*      zaxisInqSize: Get the size of a Z-axis */
+int     zaxisInqSize(int zaxisID);
+
+/*      zaxisDuplicate: Duplicate a Z-axis */
+int     zaxisDuplicate(int zaxisID);
+
+void    zaxisResize(int zaxisID, int size);
+
+void    zaxisPrint(int zaxisID);
+int     zaxisSize(void);
+
+/*      zaxisDefLevels: Define the levels of a Z-axis */
+void    zaxisDefLevels(int zaxisID, const double *levels_vec);
+
+/*      zaxisInqLevels: Get all levels of a Z-axis */
+void    zaxisInqLevels(int zaxisID, double *levels_vec);
+
+/*      zaxisDefLevel: Define one level of a Z-axis */
+void    zaxisDefLevel(int zaxisID, int levelID, double levels);
+
+/*      zaxisInqLevel: Get one level of a Z-axis */
+double  zaxisInqLevel(int zaxisID, int levelID);
+
+/*      zaxisDefReference: Define the reference of a generalized Z-axis */
+void    zaxisDefReference(int zaxisID, int refID);
+
+/*      zaxisDefUUID: Define the uuid of a generalized Z-axis */
+void    zaxisDefUUID(int zaxisID, const char *uuid);
+
+/*      zaxisInqUUID: Get the reference of a generalized Z-axis */
+char   *zaxisInqUUID(int zaxisID, char *uuid);
+
+/*      zaxisInqReference: Get the reference of a generalized Z-axis */
+int     zaxisInqReference(int zaxisID);
+
+/*      zaxisDefName: Define the name of a Z-axis */
+void    zaxisDefName(int zaxisID, const char *name);
+
+/*      zaxisDefLongname: Define the longname of a Z-axis */
+void    zaxisDefLongname(int zaxisID, const char *longname);
+
+/*      zaxisDefUnits: Define the units of a Z-axis */
+void    zaxisDefUnits(int zaxisID, const char *units);
+
+/*      zaxisInqName: Get the name of a Z-axis */
+void    zaxisInqName(int zaxisID, char *name);
+
+/*      zaxisInqLongname: Get the longname of a Z-axis */
+void    zaxisInqLongname(int zaxisID, char *longname);
+
+/*      zaxisInqStdname: Get the standard name of a Z-axis */
+void    zaxisInqStdname(int zaxisID, char *stdname);
+
+/*      zaxisInqUnits: Get the units of a Z-axis */
+void    zaxisInqUnits(int zaxisID, char *units);
+
+void    zaxisDefPrec(int zaxisID, int prec);
+int     zaxisInqPrec(int zaxisID);
+
+int     zaxisInqPositive(int zaxisID);
+
+void    zaxisDefLtype(int zaxisID, int ltype);
+int     zaxisInqLtype(int zaxisID);
+
+const double *zaxisInqLevelsPtr(int zaxisID);
+void    zaxisDefVct(int zaxisID, int size, const double *vct_vec);
+void    zaxisInqVct(int zaxisID, double *vct_vec);
+int     zaxisInqVctSize(int zaxisID);
+const double *zaxisInqVctPtr(int zaxisID);
+int     zaxisInqLbounds(int zaxisID, double *lbounds_vec);
+int     zaxisInqUbounds(int zaxisID, double *ubounds_vec);
+int     zaxisInqWeights(int zaxisID, double *weights_vec);
+double  zaxisInqLbound(int zaxisID, int index);
+double  zaxisInqUbound(int zaxisID, int index);
+void    zaxisDefLbounds(int zaxisID, const double *lbounds_vec);
+void    zaxisDefUbounds(int zaxisID, const double *ubounds_vec);
+void    zaxisDefWeights(int zaxisID, const double *weights_vec);
+void    zaxisChangeType(int zaxisID, int zaxistype);
+
+/* TAXIS routines */
+
+/*      taxisCreate: Create a Time axis */
+int     taxisCreate(int timetype);
+
+/*      taxisDestroy: Destroy a Time axis */
+void    taxisDestroy(int taxisID);
+
+int     taxisDuplicate(int taxisID);
+
+void    taxisCopyTimestep(int taxisIDdes, int taxisIDsrc);
+
+void    taxisDefType(int taxisID, int type);
+
+/*      taxisDefVdate: Define the verification date */
+void    taxisDefVdate(int taxisID, int date);
+
+/*      taxisDefVtime: Define the verification time */
+void    taxisDefVtime(int taxisID, int time);
+
+/*      taxisDefRdate: Define the reference date */
+void    taxisDefRdate(int taxisID, int date);
+
+/*      taxisDefRtime: Define the reference date */
+void    taxisDefRtime(int taxisID, int time);
+
+int     taxisHasBounds(int taxisID);
+
+void    taxisDeleteBounds(int taxisID);
+
+void    taxisDefVdateBounds(int taxisID, int vdate_lb, int vdate_ub);
+
+void    taxisDefVtimeBounds(int taxisID, int vtime_lb, int vtime_ub);
+
+void    taxisInqVdateBounds(int taxisID, int *vdate_lb, int *vdate_ub);
+
+void    taxisInqVtimeBounds(int taxisID, int *vtime_lb, int *vtime_ub);
+
+/*      taxisDefCalendar: Define the calendar */
+void    taxisDefCalendar(int taxisID, int calendar);
+
+void    taxisDefTunit(int taxisID, int tunit);
+
+void    taxisDefNumavg(int taxisID, int numavg);
+
+int     taxisInqType(int taxisID);
+
+/*      taxisInqVdate: Get the verification date */
+int     taxisInqVdate(int taxisID);
+
+/*      taxisInqVtime: Get the verification time */
+int     taxisInqVtime(int taxisID);
+
+/*      taxisInqRdate: Get the reference date */
+int     taxisInqRdate(int taxisID);
+
+/*      taxisInqRtime: Get the reference time */
+int     taxisInqRtime(int taxisID);
+
+/*      taxisInqCalendar: Get the calendar */
+int     taxisInqCalendar(int taxisID);
+
+int     taxisInqTunit(int taxisID);
+
+int     taxisInqNumavg(int taxisID);
+
+char   *tunitNamePtr(int tunitID);
+
+
+/* Institut routines */
+
+int     institutDef(int center, int subcenter, const char *name, const char *longname);
+int     institutInq(int center, int subcenter, const char *name, const char *longname);
+int     institutInqNumber(void);
+int     institutInqCenter(int instID);
+int     institutInqSubcenter(int instID);
+char   *institutInqNamePtr(int instID);
+char   *institutInqLongnamePtr(int instID);
+
+/* Model routines */
+
+int     modelDef(int instID, int modelgribID, const char *name);
+int     modelInq(int instID, int modelgribID, char *name);
+int     modelInqInstitut(int modelID);
+int     modelInqGribID(int modelID);
+char   *modelInqNamePtr(int modelID);
+
+/* Table routines */
+
+void    tableWriteC(const char *filename, int tableID);
+void    tableWrite(const char *filename, int tableID);
+int     tableRead(const char *tablefile);
+int     tableDef(int modelID, int tablenum, const char *tablename);
+
+char   *tableInqNamePtr(int tableID);
+void    tableDefEntry(int tableID, int code, const char *name, const char *longname, const char *units);
+
+int     tableInq(int modelID, int tablenum, const char *tablename);
+int     tableInqNumber(void);
+
+int     tableInqNum(int tableID);
+int     tableInqModel(int tableID);
+
+void    tableInqPar(int tableID, int code, char *name, char *longname, char *units);
+
+int     tableInqParCode(int tableID, char *name, int *code);
+int     tableInqParName(int tableID, int code, char *name);
+int     tableInqParLongname(int tableID, int code, char *longname);
+int     tableInqParUnits(int tableID, int code, char *units);
+
+char   *tableInqParNamePtr(int tableID, int parID);
+char   *tableInqParLongnamePtr(int tableID, int parID);
+char   *tableInqParUnitsPtr(int tableID, int parID);
+
+/* History routines */
+
+void    streamDefHistory(int streamID, int size, const char *history);
+int     streamInqHistorySize(int streamID);
+void    streamInqHistoryString(int streamID, char *history);
+
+#if defined (__cplusplus)
+}
+#endif
+
+#endif  /* _CDI_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef  _TIMEBASE_H
+#define  _TIMEBASE_H
+
+/* date format:  YYYYMMDD */
+/* time format:  hhmmss   */
+
+void decode_julday(int calendar, int julday, int *year, int *mon, int *day);
+int  encode_julday(int calendar, int year, int month, int day);
+
+int date_to_julday(int calendar, int date);
+int julday_to_date(int calendar, int julday);
+
+int time_to_sec(int time);
+int sec_to_time(int secofday);
+
+void   julday_add_seconds(int seconds, int *julday, int *secofday);
+void   julday_add(int days, int secs, int *julday, int *secofday);
+double julday_sub(int julday1, int secofday1, int julday2, int secofday2, int *days, int *secs);
+
+void encode_juldaysec(int calendar, int year, int month, int day, int hour, int minute, int *julday, int *secofday);
+void decode_juldaysec(int calendar, int julday, int secofday, int *year, int *month, int *day, int *hour, int *minute);
+
+#endif  /* _TIMEBASE_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _CALENDAR_H
+#define _CALENDAR_H
+
+void encode_caldaysec(int calendar, int year, int month, int day, int hour, int minute, int second,
+		      int *julday, int *secofday);
+void decode_caldaysec(int calendar, int julday, int secofday, 
+		      int *year, int *month, int *day, int *hour, int *minute, int *second);
+
+#endif  /* _CALENDAR_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _BASETIME_H
+#define _BASETIME_H
+
+
+typedef struct {
+  int   ncvarid;
+  int   ncdimid;
+  int   ncvarboundsid;
+  int   lwrf;     /* TRUE for time axis in WRF format */
+}
+BaseTime;
+
+void basetimeInit(BaseTime *basetime);
+
+#endif  /* _BASETIME_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+typedef struct
+{
+  long date;
+  long time;
+}
+DateTime;
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _STREAM_CGRIBEX_H
+#define _STREAM_CGRIBEX_H
+
+int cgribexScanTimestep1(int streamID);
+int cgribexScanTimestep2(int streamID);
+int cgribexScanTimestep(int streamID);
+
+int cgribexDecode(unsigned char *gribbuffer, int gribsize, double *data, int gridsize,
+		  int unreduced, int *nmiss, int *zip, double missval);
+
+size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisID,
+		     int vdate, int vtime, int tsteptype, int numavg, 
+		     long datasize, const double *data, int nmiss, unsigned char *gribbuffer, size_t gribbuffersize);
+
+#endif  /* _STREAM_CGRIBEX_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _STREAM_GRIBAPI_H
+#define _STREAM_GRIBAPI_H
+
+int gribapiScanTimestep1(int streamID);
+int gribapiScanTimestep2(int streamID);
+int gribapiScanTimestep(int streamID);
+
+int gribapiDecode(unsigned char *gribbuffer, int gribsize, double *data, int gridsize,
+		  int unreduced, int *nmiss, int *zip, double missval);
+
+size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisID,
+		     int vdate, int vtime, int tsteptype, int numavg, 
+		     long datasize, const double *data, int nmiss, unsigned char **gribbuffer, size_t *gribbuffersize,
+		     int ljpeg, void *gribContainer);
+
+#endif  /* _STREAM_GRIBAPI_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _STREAM_GRB_H
+#define _STREAM_GRB_H
+
+int   grbBitsPerValue(int datatype);
+
+int   grbInqContents(int streamID);
+int   grbInqTimestep(int streamID, int tsID);
+
+int   grbInqRecord(int streamID, int *varID, int *levelID);
+int   grbDefRecord(int streamID);
+int   grbWriteRecord(int streamID, const double *data, int nmiss);
+int   grbReadRecord(int streamID, double *data, int *nmiss);
+int   grbCopyRecord(int streamIDdest, int streamIDsrc);
+
+void  grbReadVarDP(int streamID, int varID, double *data, int *nmiss);
+void  grbWriteVarDP(int streamID, int varID, const double *data, int nmiss);
+
+void  grbReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *nmiss);
+int   grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data, int nmiss);
+
+int   grib1ltypeToZaxisType(int grib_ltype);
+int   grib2ltypeToZaxisType(int grib_ltype);
+
+#endif  /* _STREAM_GRB_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _STREAM_CDF_H
+#define _STREAM_CDF_H
+
+void   cdfDefVars(int streamID);
+void   cdfDefTimestep(int streamID, int tsID);
+int    cdfInqTimestep(int streamID, int tsID);
+int    cdfInqContents(int streamID);
+void   cdfDefHistory(int streamID, int size, char *history);
+int    cdfInqHistorySize(int streamID);
+void   cdfInqHistoryString(int streamID, char *history);
+
+void   cdfEndDef(int streamID);
+int    cdfDefRecord(int streamID);
+
+int    cdfCopyRecord(int streamIDdest, int streamIDsrc);
+
+int    cdfReadRecord(int streamID, double *data, int *nmiss);
+void   cdf_write_record(int streamID, int memtype, const void *data, int nmiss);
+
+void   cdfReadVarDP(int streamID, int varID, double *data, int *nmiss);
+void   cdf_write_var(int streamID, int varID, int memtype, const void *data, int nmiss);
+
+int    cdfReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *nmiss);
+int    cdf_write_var_slice(int streamID, int varID, int levelID, int memtype, const void *data, int nmiss);
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _TABLEPAR_H
+#define _TABLEPAR_H
+
+typedef struct
+{
+  int   id;	     /* Parameter number (GRIB) */
+  char *name;	     /* Parameter name */
+  char *longname;    /* Parameter long name */
+  char *units;	     /* Parameter units */
+}
+PAR;
+
+
+void tableLink(int tableID, PAR *pars, int npars);
+int tableDef(int modelID, int tablegribID, const char *tablename);
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _TABLE_H
+#define _TABLE_H
+
+static PAR echam4[] = {
+  {   4, "precip",      "total precipitation",                      "m/s"      },
+  {  34, "low_cld",     "low cloud",                                 NULL      },
+  {  35, "mid_cld",     "mid cloud",                                 NULL      },
+  {  36, "hih_cld",     "high cloud",                                NULL      },
+  { 129, "geosp",       "surface geopotential (orography)",         "m^2/s^2"  },
+  { 130, "t",           "temperature",                              "K"        },
+  { 131, "u",           "u-velocity",                               "m/s"      },
+  { 132, "v",           "v-velocity",                               "m/s"      },
+  { 133, "sq",          "specific humidity",                        "kg/kg"    },
+  { 134, "aps",         "Surface pressure",                         "Pa"       },
+  { 135, "omega",       "vertical velocity",                        "Pa/s"     },
+  { 138, "svo",         "vorticity",                                "1/s"      },
+  { 139, "ts",          "surface temperature",                      "K"        },
+  { 140, "ws",          "soil wetness",                             "m"        },
+  { 141, "sn",          "snow depth",                               "m"        },
+  { 142, "aprl",        "large scale precipitation",                "m/s"      },
+  { 143, "aprc",        "convective  precipitation",                "m/s"      },
+  { 144, "aprs",        "snow fall",                                "m/s"      },
+  { 145, "vdis",        "boundary layer dissipation",               "W/m^2"    },
+  { 146, "ahfs",        "surface sensible heat flux",               "W/m^2"    },
+  { 147, "ahfl",        "surface latent heat flux",                 "W/m^2"    },
+  { 148, "stream",      "streamfunction",                           "m^2/s"    },
+  { 149, "velopot",     "velocity potential",                       "m^2/s"    },
+  { 151, "slp",         "mean sea level pressure",                  "Pa"       },
+  { 152, "lsp",         "log surface pressure",                      NULL      },
+  { 153, "sx",          "liquid water content",                     "kg/kg"    },
+  { 155, "sd",          "divergence",                               "1/s"      },
+  { 156, "geopoth",     "geopotential height",                      "m"        },
+  { 157, "rhumidity",   "relative humidity",                        "fraction" },
+  { 158, "var158",      "tendency of surface pressure",             "Pa/s"     },
+  { 159, "ustar3",      "ustar3",                                   "m^3/s^3"  },
+  { 160, "runoff",      "surface runoff",                           "m/s"      },
+  { 161, "alwc",        "liquid water content",                     "kg/kg"    },
+  { 162, "aclc",        "cloud cover",                              "fraction" },
+  { 163, "aclcv",       "total cloud cover",                        "fraction" },
+  { 164, "aclcov",      "total cloud cover",                        "fraction" },
+  { 165, "u10",         "10m u-velocity",                           "m/s"      },
+  { 166, "v10",         "10m v-velocity",                           "m/s"      },
+  { 167, "temp2",       "2m temperature",                           "K"        },
+  { 168, "dew2",        "2m dew point temperature",                 "K"        },
+  { 169, "tsurf",       "surface temperature",                      "K"        },
+  { 170, "td",          "deep soil temperature",                    "K"        },
+  { 171, "wind10",      "10m windspeed",                            "m/s"      },
+  { 172, "slm",         "land sea mask",                            "fraction" },
+  { 173, "az0",         "surface roughness length",                 "m"        },
+  { 174, "alb",         "surface background albedo",                "fraction" },
+  { 175, "albedo",      "surface albedo",                           "fraction" },
+  { 176, "srads",       "net surface solar radiation",              "W/m^2"    },
+  { 177, "trads",       "net surface thermal radiation",            "W/m^2"    },
+  { 178, "srad0",       "net top solar radiation",                  "W/m^2"    },
+  { 179, "trad0",       "top thermal radiation (OLR)",              "W/m^2"    },
+  { 180, "ustr",        "surface u-stress",                         "Pa"       },
+  { 181, "vstr",        "surface v-stress",                         "Pa"       },
+  { 182, "evap",        "surface evaporation",                      "m/s"      },
+  { 183, "tdcl",        "soil temperature",                         "K"        },
+  { 185, "srafs",       "net surf. solar radiation   (clear sky)",  "W/m^2"    },
+  { 186, "trafs",       "net surf. thermal radiation (clear sky)",  "W/m^2"    },
+  { 187, "sraf0",       "net top solar radiation     (clear sky)",  "W/m^2"    },
+  { 188, "traf0",       "net top thermal radiation   (clear sky)",  "W/m^2"    },
+  { 189, "sclfs",       "surface solar cloud forcing",              "W/m^2"    },
+  { 190, "tclfs",       "surface thermal cloud forcing",            "W/m^2"    },
+  { 191, "sclf0",       "top solar cloud forcing",                  "W/m^2"    },
+  { 192, "tclf0",       "top thermal cloud forcing",                "W/m^2"    },
+  { 193, "wl",          "skin reservoir content",                   "m"        },
+  { 194, "wlm1",        "skin reservoir content of plants",         "m"        },
+  { 195, "ustrgw",      "u-gravity wave stress",                    "Pa"       },
+  { 196, "vstrgw",      "v-gravity wave stress",                    "Pa"       },
+  { 197, "vdisgw",      "gravity wave dissipation",                 "W/m^2"    },
+  { 198, "vgrat",       "vegetation ratio",                         "fraction" },
+  { 199, "varor",       "orographic variance",                      "m^2"      },
+  { 200, "vlt",         "leaf area index",                           NULL      },
+  { 201, "t2max",       "maximum 2m-temperature",                   "K"        },
+  { 202, "t2min",       "minimum 2m-temperature",                   "K"        },
+  { 203, "srad0u",      "top solar radiation upward",               "W/m^2"    },
+  { 204, "sradsu",      "surface solar radiation upward",           "W/m^2"    },
+  { 205, "tradsu",      "surface thermal radiation upward",         "W/m^2"    },
+  { 206, "tsn",         "snow temperature",                         "K"        },
+  { 207, "td3",         "soil temperature 3",                       "K"        },
+  { 208, "td4",         "soil temperature 4",                       "K"        },
+  { 209, "td5",         "soil temperature 5",                       "K"        },
+  { 210, "seaice",      "sea ice cover",                            "fraction" },
+  { 211, "siced",       "sea ice depth",                            "m"        },
+  { 212, "forest",      "vegetation type",                          "fraction" },
+  { 213, "teff",        "(effective) sea-ice skin temperature",     "K"        },
+  { 214, "tsmax",       "maximum surface temperature",              "K"        },
+  { 215, "tsmin",       "minimum surface temperature",              "K"        },
+  { 216, "wimax",       "maximum 10m-wind speed",                   "m/s"      },
+  { 217, "topmax",      "maximum height of convective cloud tops",  "Pa"       },
+  { 218, "snmel",       "snow melt",                                "m/s"      },
+  { 219, "runtoc",      "surface runoff into ocean",                 NULL      },
+  { 220, "tslin",       "land: residual surface heat budget",       "W/m^2"    },
+  { 221, "dsnac",       "snow depth change",                        "m/s"      },
+  { 222, "alwcac",      "liquid water content",                     "kg/kg"    },
+  { 223, "aclcac",      "cloud cover",                              "fraction" },
+  { 224, "tke",         "turbulent kinetic energy",                  NULL      },
+  { 225, "tkem1",       "turbulent kinetic energy (t-1)",            NULL      },
+  { 226, "fao",         "FAO data set (soil data flags)",            NULL      },
+  { 227, "rgcgn",       "heat capacity of soil",                     NULL      },
+  { 228, "sodif",       "soil diffusivity",                          NULL      },
+  { 229, "wsmx",        "field capacity of soil",                   "m"        },
+  { 230, "qvi",         "vertically integrated specific humidity",  "kg/m^2"   },
+  { 231, "alwcvi",      "vertically integrated liquid water cont.", "kg/m^2"   },
+  { 232, "glac",        "glacier mask",                             "fraction" },
+  { 233, "runlnd",      "surface runoff not running into ocean",     NULL      },
+  { 259, "windspeed",   "windspeed (sqrt(u^2+v^2))",                 NULL      },
+  { 260, "precip",      "total precipitation",                      "m/s"      },
+  { 261, "net_top",     "total top radiation",                       NULL      },
+  { 262, "net_bot",     "total surface radiation",                   NULL      },
+  { 263, "net_heat",    "net surface heat flux",                     NULL      },
+  { 264, "net_water",   "total surface water",                       NULL      },
+  { 268, "sw_atm",       NULL,                                       NULL      },
+  { 269, "lw_atm",       NULL,                                       NULL      },
+  { 270, "net_atm",      NULL,                                       NULL      },
+  { 271, "surf_runoff", "surface runoff",                            NULL      },
+  { 275, "fresh_water",  NULL,                                       NULL      },
+};
+
+static PAR echam5[] = {
+  {   4, "precip",     "total precipitation",                       "kg/m^2s" },
+  {  79, "swnirac",    "net surface NIR flux acc.",                 "W/m^2"   },
+  {  80, "swdifnirac", "fraction of diffuse NIR acc.",              "W/m^2"   },
+  {  81, "swvisac",    "net surface visible flux acc.",             "W/m^2"   },
+  {  82, "swdifvisac", "fraction of diffuse visible acc.",          "W/m^2"   },
+  {  83, "ocu",        "ocean eastw. velocity (coupled mode)",      "m/s"     },
+  {  84, "ocv",        "ocean northw. velocity (coupled mode)",     "m/s"     },
+  {  85, "tradl",      "net LW radiation 200mb",                    "W/m^2"   },
+  {  86, "sradl",      "net SW radiation 200mb",                    "W/m^2"   },
+  {  87, "trafl",      "net LW radiation 200mb (clear sky)",        "W/m^2"   },
+  {  88, "srafl",      "net SW radiation 200mb (clear sky)",        "W/m^2"   },
+  {  89, "amlcorac",   "mixed layer flux correction",               "W/m^2"   },
+  {  90, "amlheatac",  "mixed layer heat content",                  "J/m^2"   },
+  {  91, "trfliac",    "net LW radiation over ice",                 "W/m^2"   },
+  {  92, "trflwac",    "net LW radiation over water",               "W/m^2"   },
+  {  93, "trfllac",    "net LW radiation over land",                "W/m^2"   },
+  {  94, "sofliac",    "net SW radiation over ice",                 "W/m^2"   },
+  {  95, "soflwac",    "net SW radiation over water",               "W/m^2"   },
+  {  96, "sofllac",    "net SW radiation over land",                "W/m^2"   },
+  {  97, "friac",      "ice cover (fraction of grid box)",           NULL     },
+  { 102, "tsi",        "surface temperature of ice",                "K"       },
+  { 103, "tsw",        "surface temperature of water",              "K"       },
+  { 104, "ustri",      "zonal      wind stress over ice",           "Pa"      },
+  { 105, "vstri",      "meridional wind stress over ice",           "Pa"      },
+  { 106, "ustrw",      "zonal      wind stress over water",         "Pa"      },
+  { 107, "vstrw",      "meridional wind stress over water",         "Pa"      },
+  { 108, "ustrl",      "zonal      wind stress over land",          "Pa"      },
+  { 109, "vstrl",      "meridional wind stress over land",          "Pa"      },
+  { 110, "ahfliac",    "latent heat flux over ice",                 "W/m^2"   },
+  { 111, "ahflwac",    "latent heat flux over water",               "W/m^2"   },
+  { 112, "ahfllac",    "latent heat flux over land",                "W/m^2"   },
+  { 113, "evapiac",    "evaporation over ice",                      "kg/m^2s" },
+  { 114, "evapwac",    "evaporation over water",                    "kg/m^2s" },
+  { 115, "evaplac",    "evaporation over land",                     "kg/m^2s" },
+  { 116, "az0i",       "roughness length over ice",                 "m"       },
+  { 117, "az0w",       "roughness length over water",               "m"       },
+  { 118, "az0l",       "roughness length over land",                "m"       },
+  { 119, "ahfsiac",    "sensible heat flux over ice",               "W/m^2"   },
+  { 120, "ahfswac",    "sensible heat flux over water",             "W/m^2"   },
+  { 121, "ahfslac",    "sensible heat flux over land",              "W/m^2"   },
+  { 122, "alsoi",      "albedo of ice",                              NULL     },
+  { 123, "alsow",      "albedo of water",                            NULL     },
+  { 124, "alsol",      "albedo of land",                             NULL     },
+  { 125, "ahfice",     "conductive heat flux through ice",          "W/m^2"   },
+  { 126, "qres",       "residual heat flux for melting sea ice",    "W/m^2"   },
+  { 127, "alake",      "lake fraction",                              NULL     },
+  { 128, "rintop",     "low level inversion",                        NULL     },
+  { 129, "geosp",      "surface geopotential (orography)",          "m^2/s^2" },
+  { 130, "t",          "temperature",                               "K"       },
+  { 131, "u",          "u-velocity",                                "m/s"     },
+  { 132, "v",          "v-velocity",                                "m/s"     },
+  { 133, "q",          "specific humidity",                         "kg/kg"   },
+  { 134, "aps",        "surface pressure",                          "Pa"      },
+  { 135, "omega",      "vertical velocity",                         "Pa/s"    },
+  { 136, "acdnc",      "cloud droplet number concentration",        "1/m^3"   },
+  { 137, "apmeb",      "(P-E) error",                               "kg/m^2s" },
+  { 138, "svo",        "vorticity",                                 "1/s"     },
+  { 139, "tslm1",      "surface temperature of land",               "K"       },
+  { 140, "ws",         "soil wetness",                              "m"       },
+  { 141, "sn",         "water equivalent snow depth",               "m"       },
+  { 142, "aprl",       "large scale precipitation",                 "kg/m^2s" },
+  { 143, "aprc",       "convective  precipitation",                 "kg/m^2s" },
+  { 144, "aprs",       "snow fall",                                 "kg/m^2s" },
+  { 145, "vdis",       "boundary layer dissipation",                "W/m^2"   },
+  { 146, "ahfs",       "sensible heat flux",                        "W/m^2"   },
+  { 147, "ahfl",       "latent heat flux",                          "W/m^2"   },
+  { 148, "stream",     "streamfunction",                            "m^2/s"   },
+  { 149, "velopot",    "velocity potential",                        "m^2/s"   },
+  { 150, "xivi",       "vertically integrated cloud ice",           "kg/m^2"  },
+  { 151, "slp",        "mean sea level pressure",                   "Pa"      },
+  { 152, "lsp",        "log surface pressure",                       NULL     },
+  { 153, "xl",         "cloud water",                               "kg/kg"   },
+  { 154, "xi",         "cloud ice",                                 "kg/kg"   },
+  { 155, "sd",         "divergence",                                "1/s"     },
+  { 156, "geopoth",    "geopotential height",                       "m"       },
+  { 157, "rhumidity",  "relative humidity",                          NULL     },
+  { 159, "wind10w",    "10m windspeed over water",                  "m/s"     },
+  { 160, "runoff",     "surface runoff and drainage",               "kg/m^2s" },
+  { 161, "drain",      "drainage",                                  "kg/m^2s" },
+  { 162, "aclc",       "cloud cover",                                NULL     },
+  { 164, "aclcov",     "total cloud cover",                          NULL     },
+  { 165, "u10",        "10m u-velocity",                            "m/s"     },
+  { 166, "v10",        "10m v-velocity",                            "m/s"     },
+  { 167, "temp2",      "2m temperature",                            "K"       },
+  { 168, "dew2",       "2m dew point temperature",                  "K"       },
+  { 169, "tsurf",      "surface temperature",                       "K"       },
+  { 170, "xvar",       "variance of total water amount",            "kg/kg"   },
+  { 171, "wind10",     "10m windspeed",                             "m/s"     },
+  { 172, "slm",        "land sea mask (1. = land, 0. = sea/lakes)",  NULL     },
+  { 173, "az0",        "roughness length",                          "m"       },
+  { 174, "alb",        "surface background albedo",                  NULL     },
+  { 175, "albedo",     "surface albedo",                             NULL     },
+  { 176, "srads",      "net surface SW radiation",                  "W/m^2"   },
+  { 177, "trads",      "net surface LW radiation",                  "W/m^2"   },
+  { 178, "srad0",      "net top SW radiation",                      "W/m^2"   },
+  { 179, "trad0",      "net top LW radiation (-OLR)",               "W/m^2"   },
+  { 180, "ustr",       "u-stress",                                  "Pa"      },
+  { 181, "vstr",       "v-stress",                                  "Pa"      },
+  { 182, "evap",       "evaporation",                               "kg/m^2s" },
+  { 183, "xskew",      "skewness of total water amount qv+qi+ql",    NULL     },
+  { 184, "srad0d",     "top incoming SW radiation",                 "W/m^2"   },
+  { 185, "srafs",      "net surface SW radiation (clear sky)",      "W/m^2"   },
+  { 186, "trafs",      "net surface LW radiation (clear sky)",      "W/m^2"   },
+  { 187, "sraf0",      "net top SW radiation   (clear sky)",        "W/m^2"   },
+  { 188, "traf0",      "net top LW radiation   (clear sky)",        "W/m^2"   },
+  { 189, "sclfs",      "net surface SW cloud forcing (176-185)",    "W/m^2"   },
+  { 190, "tclfs",      "net surface LW cloud forcing (177-186)",    "W/m^2"   },
+  { 191, "sclf0",      "net SW top cloud forcing (178-187)",        "W/m^2"   },
+  { 192, "tclf0",      "net LW top cloud forcing (179-188)",        "W/m^2"   },
+  { 193, "wl",         "skin reservoir content",                    "m"       },
+  { 194, "slf",        "fractional land cover",                      NULL     },
+  { 195, "ustrgw",     "u-gravity wave stress",                     "Pa"      },
+  { 196, "vstrgw",     "v-gravity wave stress",                     "Pa"      },
+  { 197, "vdisgw",     "gravity wave dissipation",                  "W/m^2"   },
+  { 198, "vgrat",      "vegetation ratio",                           NULL     },
+  { 199, "orostd",     "orographic standard deviation",             "m"       },
+  { 200, "vlt",        "leaf area index",                            NULL     },
+  { 201, "t2max",      "maximum 2m-temperature",                    "K"       },
+  { 202, "t2min",      "minimum 2m-temperature",                    "K"       },
+  { 203, "srad0u",     "top SW radiation upward",                   "W/m^2"   },
+  { 204, "sradsu",     "surface SW radiation upward",               "W/m^2"   },
+  { 205, "tradsu",     "surface LW radiation upward",               "W/m^2"   },
+  { 206, "grndflux",   "surface ground heat flux",                   NULL     },
+  { 207, "tsoil",      "deep soil temperatures (5 layers)",         "K"       },
+  { 208, "ahfcon",     "conductive heat flux through ice",          "W/m^2"   },
+  { 209, "ahfres",     "res. heat flux for melting ice",            "W/m^2"   },
+  { 210, "seaice",     "ice cover (fraction of ice+water)",          NULL     },
+  { 211, "siced",      "ice thickness",                             "m"       },
+  { 212, "forest",     "forest fraction",                            NULL     },
+  { 213, "gld",        "glacier thickness",                         "m"       },
+  { 214, "sni",        "water equivalent of snow on ice",           "m"       },
+  { 215, "rogl",       "glacier runoff",                            "kg/m^2s" },
+  { 216, "wimax",      "maximum 10m-wind speed",                    "m/s"     },
+  { 217, "topmax",     "maximum height of convective cloud tops",   "Pa"      },
+  { 218, "snmel",      "snow melt",                                 "kg/m^2s" },
+  { 219, "runtoc",     "surface runoff into ocean",                 "kg/m^2s" },
+  { 220, "runlnd",     "surface runoff not running into ocean",     "kg/m^2s" },
+  { 221, "apmegl",     "P-E over land ice",                         "kg/m^2s" },
+  { 222, "snacl",      "snow accumulation over land",               "kg/m^2s" },
+  { 223, "aclcac",     "cloud cover",                                NULL     },
+  { 224, "tke",        "turbulent kinetic energy",                  "m^2/s^2" },
+  { 225, "tkem1",      "turbulent kinetic energy (t-1)",            "m^2/s^2" },
+  { 226, "fao",        "FAO data set (soil data flags) 0...5",       NULL     },
+  { 227, "rgcgn",      "heat capacity of soil",                      NULL     },
+  { 228, "sodif",      "soil diffusivity",                          "m^2/s"   },
+  { 229, "wsmx",       "field capacity of soil",                    "m"       },
+  { 230, "qvi",        "vertically integrated water vapor",         "kg/m^2"  },
+  { 231, "xlvi",       "vertically integrated cloud water",         "kg/m^2"  },
+  { 232, "glac",       "fraction of land covered by glaciers",       NULL     },
+  { 233, "snc",        "snow depth at the canopy",                  "m"       },
+  { 234, "rtype",      "type of convection",                        "0...3"   },
+  { 235, "abso4",      "anthropogenic sulfur burden",               "kg/m^2"  },
+  { 236, "ao3",        "ipcc ozone",                                "kg/m^2"  },
+  { 237, "tropo",      "WMO defined tropopause height",             "Pa"      },
+  { 259, "windspeed",  "windspeed (sqrt(u^2+v^2))",                 "m/s"     },
+  { 260, "precip",     "total precipitation  (142+143)",            "kg/m^2s" },
+  { 261, "net_top",    "total top radiation  (178+179)",            "W/m^2"   },
+  { 262, "net_bot",    "total surface radiation (176+177)",         "W/m^2"   },
+  { 272, "mastrfu",    "mass stream function",                      "kg/s"    },
+};
+
+static PAR echam6[] = {
+  {   4, "precip",         "total precipitation",                       "kg m-2 s-1" },
+  {  34, "low_cld",        "low cloud",                                  NULL        },
+  {  35, "mid_cld",        "mid cloud",                                  NULL        },
+  {  36, "hih_cld",        "high cloud",                                 NULL        },
+  {  68, "fage",           "aging factor of snow on ice",                NULL        },
+  {  69, "snifrac",        "fraction of ice covered with snow",          NULL        },
+  {  70, "barefrac",       "bare ice fraction",                          NULL        },
+  {  71, "alsom",          "albedo of melt ponds",                       NULL        },
+  {  72, "alsobs",         "albedo of bare ice and snow",                NULL        },
+  {  73, "sicepdw",        "melt pond depth on sea-ice",                "m"          },
+  {  74, "sicepdi",        "ice thickness on melt pond",                "m"          },
+  {  75, "tsicepdi",       "ice temperature on frozen melt pond",       "K"          },
+  {  76, "sicepres",       "residual heat flux",                        "W m-2"      },
+  {  77, "ameltdepth",     "total melt pond depth",                     "m"          },
+  {  78, "ameltfrac",      "fractional area of melt ponds on sea-ice",   NULL        },
+  {  79, "albedo_vis_dir", "surface albedo visible range direct",        NULL        },
+  {  80, "albedo_nir_dir", "surface albedo NIR range direct",            NULL        },
+  {  81, "albedo_vis_dif", "surface albedo visible range diffuse",       NULL        },
+  {  82, "albedo_nir_dif", "surface albedo NIR range diffuse",           NULL        },
+  {  83, "ocu",            "ocean eastw. velocity (coupled mode)",      "m/s"        },
+  {  84, "ocv",            "ocean northw. velocity (coupled mode)",     "m/s"        },
+  {  85, "tradl",          "thermal radiation 200mb",                   "W m-2"      },
+  {  86, "sradl",          "solar radiation 200mb",                     "W m-2"      },
+  {  87, "trafl",          "thermal radiation 200mb (clear sky)",       "W m-2"      },
+  {  88, "srafl",          "solar radiation 200mb (clear sky)",         "W m-2"      },
+  {  89, "amlcorac",       "mixed layer flux correction",               "W m-2"      },
+  {  90, "amlheatac",      "mixed layer heat content",                  "J m-2"      },
+  {  91, "trfliac",        "LW flux over ice",                          "W m-2"      },
+  {  92, "trflwac",        "LW flux over water",                        "W m-2"      },
+  {  93, "trfllac",        "LW flux over land",                         "W m-2"      },
+  {  94, "sofliac",        "SW flux over ice",                          "W m-2"      },
+  {  95, "soflwac",        "SW flux over water",                        "W m-2"      },
+  {  96, "sofllac",        "SW flux over land",                         "W m-2"      },
+  {  97, "friac",          "ice cover (fraction of grid box)",           NULL        },
+  { 102, "tsi",            "surface temperature of ice",                "K"          },
+  { 103, "tsw",            "surface temperature of water",              "K"          },
+  { 104, "ustri",          "zonal      wind stress over ice",           "Pa"         },
+  { 105, "vstri",          "meridional wind stress over ice",           "Pa"         },
+  { 106, "ustrw",          "zonal      wind stress over water",         "Pa"         },
+  { 107, "vstrw",          "meridional wind stress over water",         "Pa"         },
+  { 108, "ustrl",          "zonal      wind stress over land",          "Pa"         },
+  { 109, "vstrl",          "meridional wind stress over land",          "Pa"         },
+  { 110, "ahfliac",        "latent heat flux over ice",                 "W m-2"      },
+  { 111, "ahflwac",        "latent heat flux over water",               "W m-2"      },
+  { 112, "ahfllac",        "latent heat flux over land",                "W m-2"      },
+  { 113, "evapiac",        "evaporation over ice",                      "kg m-2 s-1" },
+  { 114, "evapwac",        "evaporation over water",                    "kg m-2 s-1" },
+  { 115, "evaplac",        "evaporation over land",                     "kg m-2 s-1" },
+  { 116, "az0i",           "roughness length over ice",                 "m"          },
+  { 117, "az0w",           "roughness length over water",               "m"          },
+  { 118, "az0l",           "roughness length over land",                "m"          },
+  { 119, "ahfsiac",        "sensible heat flux over ice",               "W m-2"      },
+  { 120, "ahfswac",        "sensible heat flux over water",             "W m-2"      },
+  { 121, "ahfslac",        "sensible heat flux over land",              "W m-2"      },
+  { 122, "alsoi",          "albedo of ice",                              NULL        },
+  { 123, "alsow",          "albedo of water",                            NULL        },
+  { 124, "alsol",          "albedo of land",                             NULL        },
+  { 125, "ahfice",         "conductive heat flux",                      "W m-2"      },
+  { 126, "qres",           "residual heat flux for melting sea ice",    "W m-2"      },
+  { 127, "alake",          "lake fraction of grid box",                 "fraction"   },
+  { 128, "rintop",         "low level inversion",                        NULL        },
+  { 129, "geosp",          "surface geopotential (orography)",          "m^2/s^2"    },
+  { 130, "t",              "temperature",                               "K"          },
+  { 131, "u",              "u-velocity",                                "m/s"        },
+  { 132, "v",              "v-velocity",                                "m/s"        },
+  { 133, "q",              "specific humidity",                         "kg/kg"      },
+  { 134, "aps",            "surface pressure",                          "Pa"         },
+  { 135, "omega",          "vertical velocity",                         "Pa/s"       },
+  { 136, "acdnc",          "cloud droplet number concentration",        "1 m-3"      },
+  { 137, "apmeb",          "vert. integr. tendencies of water",         "kg m-2 s-1" },
+  { 138, "svo",            "vorticity",                                 "1/s"        },
+  { 139, "tslm1",          "surface temperature of land",               "K"          },
+  { 140, "ws",             "soil wetness",                              "m"          },
+  { 141, "sn",             "snow depth",                                "m"          },
+  { 142, "aprl",           "large scale precipitation",                 "kg m-2 s-1" },
+  { 143, "aprc",           "convective  precipitation",                 "kg m-2 s-1" },
+  { 144, "aprs",           "snow fall",                                 "kg m-2 s-1" },
+  { 145, "vdis",           "boundary layer dissipation",                "W m-2"      },
+  { 146, "ahfs",           "sensible heat flux",                        "W m-2"      },
+  { 147, "ahfl",           "latent heat flux",                          "W m-2"      },
+  { 148, "stream",         "streamfunction",                            "m^2/s"      },
+  { 149, "velopot",        "velocity potential",                        "m^2/s"      },
+  { 150, "xivi",           "vertically integrated cloud ice",           "kg m-2"     },
+  { 151, "slp",            "mean sea level pressure",                   "Pa"         },
+  { 152, "lsp",            "log surface pressure",                       NULL        },
+  { 153, "xl",             "cloud water",                               "kg/kg"      },
+  { 154, "xi",             "cloud ice",                                 "kg/kg"      },
+  { 155, "sd",             "divergence",                                "1/s"        },
+  { 156, "geopoth",        "geopotential height",                       "m"          },
+  { 157, "rhumidity",      "relative humidity",                         "fraction"   },
+  { 158, "var158",         "tendency of surface pressure",              "Pa/s"       },
+  { 159, "wind10w",        "10m windspeed over water",                  "m/s"        },
+  { 160, "runoff",         "surface runoff and drainage",               "kg m-2 s-1" },
+  { 161, "drain",          "drainage",                                  "kg m-2 s-1" },
+  { 162, "aclc",           "cloud cover",                                NULL        },
+  { 163, "aclcv",          "total cloud cover",                          NULL        },
+  { 164, "aclcov",         "total cloud cover (mean)",                   NULL        },
+  { 165, "u10",            "10m u-velocity",                            "m/s"        },
+  { 166, "v10",            "10m v-velocity",                            "m/s"        },
+  { 167, "temp2",          "2m temperature",                            "K"          },
+  { 168, "dew2",           "2m dew point temperature",                  "K"          },
+  { 169, "tsurf",          "surface temperature",                       "K"          },
+  { 170, "xvar",           "variance of total water amount qv+qi+ql",   "kg/kg"      },
+  { 171, "wind10",         "10m windspeed",                             "m/s"        },
+  { 172, "slm",            "land sea mask (1. = land, 0. = sea/lakes)",  NULL        },
+  { 173, "az0",            "roughness length",                          "m"          },
+  { 174, "alb",            "surface background albedo",                  NULL        },
+  { 175, "albedo",         "surface albedo",                             NULL        },
+  { 176, "srads",          "net surface solar radiation",               "W m-2"      },
+  { 177, "trads",          "net surface thermal radiation",             "W m-2"      },
+  { 178, "srad0",          "net top solar radiation",                   "W m-2"      },
+  { 179, "trad0",          "top thermal radiation (OLR)",               "W m-2"      },
+  { 180, "ustr",           "u-stress",                                  "Pa"         },
+  { 181, "vstr",           "v-stress",                                  "Pa"         },
+  { 182, "evap",           "evaporation",                               "kg m-2 s-1" },
+  { 183, "xskew",          "skewness of total water amount qv+qi+ql",    NULL        },
+  { 184, "srad0d",         "top incoming solar radiation",              "W m-2"      },
+  { 185, "srafs",          "net surf. solar radiation   (clear sky)",   "W m-2"      },
+  { 186, "trafs",          "net surf. thermal radiation (clear sky)",   "W m-2"      },
+  { 187, "sraf0",          "net top solar radiation     (clear sky)",   "W m-2"      },
+  { 188, "traf0",          "net top thermal radiation   (clear sky)",   "W m-2"      },
+  { 189, "sclfs",          "surface solar cloud forcing",               "W m-2"      },
+  { 190, "tclfs",          "surface thermal cloud forcing",             "W m-2"      },
+  { 191, "sclf0",          "SW top cloud forcing (178-187)",            "W m-2"      },
+  { 192, "tclf0",          "LW top cloud forcing (179-188)",            "W m-2"      },
+  { 193, "wl",             "skin reservoir content",                    "m"          },
+  { 194, "slf",            "sea land fraction",                          NULL        },
+  { 195, "ustrgw",         "u-gravity wave stress",                     "Pa"         },
+  { 196, "vstrgw",         "v-gravity wave stress",                     "Pa"         },
+  { 197, "vdisgw",         "gravity wave dissipation",                  "W m-2"      },
+  { 198, "vgrat",          "vegetation ratio",                           NULL        },
+  { 199, "orostd",         "orographic standard deviation",             "m"          },
+  { 200, "vlt",            "leaf area index",                            NULL        },
+  { 201, "t2max",          "maximum 2m-temperature",                    "K"          },
+  { 202, "t2min",          "minimum 2m-temperature",                    "K"          },
+  { 203, "srad0u",         "top solar radiation upward",                "W m-2"      },
+  { 204, "sradsu",         "surface solar radiation upward",            "W m-2"      },
+  { 205, "tradsu",         "surface thermal radiation upward",          "W m-2"      },
+  { 206, "grndflux",       "surface ground heat flux",                   NULL        },
+  { 207, "tsoil",          "deep soil temperatures (5 layers)",         "K"          },
+  { 208, "ahfcon",         "conductive heat flux through ice",          "W m-2"      },
+  { 209, "ahfres",         "melting of ice",                            "W m-2"      },
+  { 210, "seaice",         "ice cover (fraction of 1-SLM)",              NULL        },
+  { 211, "siced",          "ice depth",                                 "m"          },
+  { 212, "forest",         "forest fraction",                            NULL        },
+  { 213, "gld",            "glacier depth",                             "m"          },
+  { 214, "sni",            "water equivalent of snow on ice",           "m"          },
+  { 215, "rogl",           "glacier runoff",                            "kg m-2 s-1" },
+  { 216, "wimax",          "maximum 10m-wind speed",                    "m/s"        },
+  { 217, "topmax",         "maximum height of convective cloud tops",   "Pa"         },
+  { 218, "snmel",          "snow melt",                                 "kg m-2 s-1" },
+  { 219, "runtoc",         "surface runoff into ocean",                 "kg m-2 s-1" },
+  { 220, "runlnd",         "surface runoff not running into ocean",     "kg m-2 s-1" },
+  { 221, "apmegl",         "P-E over land ice",                         "kg m-2 s-1" },
+  { 222, "snacl",          "snow accumulation over land",               "kg m-2 s-1" },
+  { 223, "aclcac",         "cloud cover",                                NULL        },
+  { 224, "tke",            "turbulent kinetic energy",                  "m^2/s^2"    },
+  { 225, "tkem1",          "turbulent kinetic energy (t-1)",            "m^2/s^2"    },
+  { 226, "fao",            "FAO data set (soil data flags)",            "0...5"      },
+  { 227, "rgcgn",          "heat capacity of soil",                      NULL        },
+  { 228, "sodif",          "diffusivity of soil and land ice",          "m^2/s"      },
+  { 229, "wsmx",           "field capacity of soil",                    "m"          },
+  { 230, "qvi",            "vertically integrated water vapor",         "kg m-2"     },
+  { 231, "xlvi",           "vertically integrated cloud water",         "kg m-2"     },
+  { 232, "glac",           "fraction of land covered by glaciers",       NULL        },
+  { 233, "snc",            "snow depth at the canopy",                  "m"          },
+  { 234, "rtype",          "type of convection",                        "0...3"      },
+  { 235, "abso4",          "antropogenic sulfur burden",                "kg m-2"     },
+  { 236, "ao3",            "ipcc ozone",                                "kg m-2"     },
+  { 237, "tropo",          "WMO defined tropopause height",             "Pa"         },
+  { 259, "windspeed",      "windspeed (sqrt(u^2+v^2))",                 "m/s"        },
+  { 260, "precip",         "total precipitation  (142+143)",            "kg m-2 s-1" },
+  { 261, "net_top",        "total top radiation  (178+179)",            "W m-2"      },
+  { 262, "net_bot",        "total surface radiation (176+177)",         "W m-2"      },
+  { 272, "mastfru",        "mass stream function",                      "kg/s"       },
+};
+
+static PAR mpiom1[] = {
+  {   2, "THO",      "temperature",                     "C"        },
+  {   5, "SAO",      "salinity",                        "psu"      },
+  {   3, "UKO",      "zon. velocity",                   "m/s"      },
+  {   4, "VKE",      "mer. velocity",                   "m/s"      },
+  { 303, "UKOMFL",   "zon. velocity (divergence free)", "m/s"      },
+  { 304, "VKEMFL",   "mer. velocity (divergence free)", "m/s"      },
+  {   7, "WO",       "ver. velocity",                   "m/s"      },
+  {   8, "RHO",      "insitu density",                  "kg/m**3"  },
+  {   6, "PO",       "pressure",                        "Pa"       },
+  {  67, "EMINPO",   "freshwaterflux by restoring",     "m/s"      },
+  {  70, "FLUM",     "total heatflux",                  "W/m**2"   },
+  {  79, "PEM",      "total freshwaterflux",            "m/s"      },
+  {  13, "SICTHO",   "ice thickness",                   "m"        },
+  {  15, "SICOMO",   "ice compactness",                 "frac."    },
+  {  35, "SICUO",    "zon. ice velocity",               "m/s"      },
+  {  36, "SICVE",    "mer. ice velocity",               "m/s"      },
+  {  92, "TAFO",     "surface air temperature",         "C"        },
+  { 164, "FCLOU",    "cloud cover",                      NULL      },
+  {  52, "TXO",      "surface u-stress",                "Pa/1025." },
+  {  53, "TYE",      "surface v-stress",                "Pa/1025." },
+  { 260, "FPREC",    "prescr. precipitation",           "m/s"      },
+  {  80, "FSWR",     "downward shortwave rad.",         "W/m**2"   },
+  {  81, "FTDEW",    "dewpoint temperature",            "K"        },
+  { 171, "FU10",     "10m windspeed",                   "m/s"      },
+  { 141, "SICSNO",   "snow thickness",                  "m"        },
+  { 176, "QSWO",     "heat flux shortwave",             "W/m**2"   },
+  { 177, "QLWO",     "heat flux longwave",              "W/m**2"   },
+  { 147, "QLAO",     "heat flux latent",                "W/m**2"   },
+  { 146, "QSEO",     "heat flux sensible",              "W/m**2"   },
+  {  65, "PRECO",    "net freshwater flux + runoff",    "m/s"      },
+  {   1, "ZO",       "sealevel",                        "m"        },
+  {  82, "Z1O",      "sealevel change",                 "m"        },
+  {  69, "KCONDEP",  "depth of convection",             "level"    },
+  {  27, "PSIUWE",   "hor. bar. streamfunction",        "Sv"       },
+  {  83, "AMLD",     "mixed layer depth",               "m"        },
+  { 172, "WETO",     "landseamask (pressure points)",    NULL      },
+  { 507, "AMSUE",    "landseamask (vector points v)",    NULL      },
+  { 508, "AMSUO",    "landseamask (vector points u)",    NULL      },
+  {  84, "DEPTO",    "depth at pressure points",        "m"        },
+  { 484, "DEUTO",    "depth at vector points (u)",      "m"        },
+  { 584, "DEUTE",    "depth at vector points (v)",      "m"        },
+  { 184, "DDUO",     "level thickness (vector u )",     "m"        },
+  { 284, "DDUE",     "level thickness (vector v )",     "m"        },
+  { 384, "DDPO",     "level thickness (pressure )",     "m"        },
+  {  85, "DLXP",     "grid distance x",                 "m"        },
+  {  86, "DLYP",     "grid distance y",                 "m"        },
+  { 185, "DLXU",     "grid distance x  (vector u)",     "m"        },
+  { 186, "DLYU",     "grid distance y  (vector u)",     "m"        },
+  { 285, "DLXV",     "grid distance x  (vector v)",     "m"        },
+  { 286, "DLYV",     "grid distance y  (vector v)",     "m"        },
+  {  54, "GILA",     "latitude in radiants",            "rad"      },
+  {  55, "GIPH",     "longitude in radiants",           "rad"      },
+  { 354, "ALAT",     "latitude in degrees (pressure)",  "deg"      },
+  { 355, "ALON",     "longitude in degrees (pressure)", "deg"      },
+  { 154, "ALATU",    "latitude in degrees (vector u)",  "deg"      },
+  { 155, "ALONU",    "longitude in degrees (vector u)", "deg"      },
+  { 254, "ALATV",    "latitude in degrees (vector v)",  "deg"      },
+  { 255, "ALONV",    "longitude in degrees (vector v)", "deg"      },
+  { 110, "AVO",      "vertical impuls diffusion",       "m**2/s"   },
+  { 111, "DVO",      "vertical T,S diffusion",          "m**2/s"   },
+  { 142, "SICTRU",   "seaice transport x",              "m**2/s"   },
+  { 143, "SICTRV",   "seaice transport y",              "m**2/s"   },
+  { 612, "WTMIX",    "wind mixing",                     "m**2/s"   },
+  { 183, "zmld",     "mixed layer depth (SJ)",          "m"        },
+  { 207, "WGO",      "GM vertical velocity",            "m/s"      },
+  { 305, "rivrun",   "RiverRunoff",                     "m/s"      },
+  { 158, "TMCDO",    "mon. mean depth of convection",   "level"    },
+  { 247, "DQSWO",    "heatflux sw over water",          "W/m**2"   },
+  { 248, "DQLWO",    "heatflux lw over water",          "W/m**2"   },
+  { 249, "DQSEO",    "heatflux se over water",          "W/m**2"   },
+  { 250, "DQLAO",    "heatflux la over water",          "W/m**2"   },
+  { 251, "DQTHO",    "heatflux net over water",         "W/m**2"   },
+  { 252, "DQSWI",    "heatflux sw over seaice",         "W/m**2"   },
+  { 253, "DQLWI",    "heatflux lw over seaice",         "W/m**2"   },
+  { 254, "DQSEI",    "heatflux se over seaice",         "W/m**2"   },
+  { 255, "DQLAI",    "heatflux la over seaice",         "W/m**2"   },
+  { 256, "DQTHI",    "heatflux net over seaice",        "W/m**2"   },
+  { 257, "DTICEO",   "Equi. temp over seaice",          "K"        },
+  { 270, "AOFLNHWO", "oasis net heat flux water",       "W/m**2"   },
+  { 271, "AOFLSHWO", "oasis downward short wave",       "W/m**2"   },
+  { 272, "AOFLRHIO", "oasis residual heat flux ice",    "W/m**2"   },
+  { 273, "AOFLCHIO", "oasis conduct. heat flux ice",    "W/m**2"   },
+  { 274, "AOFLFRWO", "oasis fluid fresh water flux",    "m/s"      },
+  { 275, "AOFLFRIO", "oasis solid fresh water flux",    "m/s"      },
+  { 276, "AOFLTXWO", "oasis wind stress water x",       "Pa/102"   },
+  { 277, "AOFLTYWO", "oasis wind stress water y",       "Pa/102"   },
+  { 278, "AOFLTXIO", "oasis wind stress ice x",         "Pa/102"   },
+  { 279, "AOFLTYIO", "oasis wind stress ice x",         "Pa/102"   },
+  { 280, "AOFLWSVO", "oasis wind speed",                "m/s"      },
+};
+
+static PAR ecmwf[] = {
+  {   1, "STRF",   "Stream function",                                            "m**2 s**-1"            },
+  {   2, "VPOT",   "Velocity potential",                                         "m**2 s**-1"            },
+  {   3, "PT",     "Potential temperature",                                      "K"                     },
+  {   4, "EQPT",   "Equivalent potential temperature",                           "K"                     },
+  {   5, "SEPT",   "Saturated equivalent potential temperature",                 "K"                     },
+  {  11, "UDVW",   "U component of divergent wind",                              "m s**-1"               },
+  {  12, "VDVW",   "V component of divergent wind",                              "m s**-1"               },
+  {  13, "URTW",   "U component of rotational wind",                             "m s**-1"               },
+  {  14, "VRTW",   "V component of rotational wind",                             "m s**-1"               },
+  {  21, "UCTP",   "Unbalanced component of temperature",                        "K"                     },
+  {  22, "UCLN",   "Unbalanced component of logarithm of surface pressure",       NULL                   },
+  {  23, "UCDV",   "Unbalanced component of divergence",                         "s**-1"                 },
+  {  26, "CL",     "Lake cover",                                                  NULL                   },
+  {  27, "CVL",    "Low vegetation cover",                                        NULL                   },
+  {  28, "CVH",    "High vegetation cover",                                       NULL                   },
+  {  29, "TVL",    "Type of low vegetation",                                      NULL                   },
+  {  30, "TVH",    "Type of high vegetation",                                     NULL                   },
+  {  31, "CI",     "Sea-ice cover",                                               NULL                   },
+  {  32, "ASN",    "Snow albedo",                                                 NULL                   },
+  {  33, "RSN",    "Snow density kg",                                            "m**-3"                 },
+  {  34, "SSTK",   "Sea surface temperature",                                    "K"                     },
+  {  35, "ISTL1",  "Ice surface temperature layer 1",                            "K"                     },
+  {  36, "ISTL2",  "Ice surface temperature layer 2",                            "K"                     },
+  {  37, "ISTL3",  "Ice surface temperature layer 3",                            "K"                     },
+  {  38, "ISTL4",  "Ice surface temperature layer 4",                            "K"                     },
+  {  39, "SWVL1",  "Volumetric soil water layer 1",                              "m**3 m**-3"            },
+  {  40, "SWVL2",  "Volumetric soil water layer 2",                              "m**3 m**-3"            },
+  {  41, "SWVL3",  "Volumetric soil water layer 3",                              "m**3 m**-3"            },
+  {  42, "SWVL4",  "Volumetric soil water layer 4",                              "m**3 m**-3"            },
+  {  43, "SLT",    "Soil type",                                                   NULL                   },
+  {  44, "ES",     "Snow evaporation m of water",                                 NULL                   },
+  {  45, "SMLT",   "Snowmelt m of water",                                         NULL                   },
+  {  46, "SDUR",   "Solar duration",                                             "s"                     },
+  {  47, "DSRP",   "Direct solar radiation",                                     "w m**-2"               },
+  {  48, "MAGSS",  "Magnitude of surface stress",                                "N m**-2 s"             },
+  {  49, "WG10",   "Wind gust at 10 metres",                                     "m s**-1"               },
+  {  50, "LSPF",   "Large-scale precipitation fraction",                         "s"                     },
+  {  51, "MX2T24", "Maximum 2 metre temperature",                                "K"                     },
+  {  52, "MN2T24", "Minimum 2 metre temperature",                                "K"                     },
+  {  53, "MONT",   "Montgomery potential",                                       "m**2 s**-2"            },
+  {  54, "PRES",   "Pressure",                                                   "Pa"                    },
+  {  55, "MN2T24", "Mean 2 metre temperature past 24 hours",                     "K"                     },
+  {  56, "MN2D24", "Mean 2 metre dewpoint temperature past 24 hours",            "K"                     },
+  {  60, "PV",     "Potential vorticity",                                        "K m**2 kg**-1 s**-1"   },
+  { 127, "AT",     "Atmospheric tide",                                            NULL                   },
+  { 128, "BV",     "Budget values",                                               NULL                   },
+  { 129, "Z",      "Geopotential",                                               "m**2 s**-2"            },
+  { 130, "T",      "Temperature",                                                "K"                     },
+  { 131, "U",      "U velocity",                                                 "m s**-1"               },
+  { 132, "V",      "V velocity",                                                 "m s**-1"               },
+  { 133, "Q",      "Specific humidity",                                          "kg kg**-1"             },
+  { 134, "SP",     "Surface pressure",                                           "Pa"                    },
+  { 135, "W",      "Vertical velocity",                                          "Pa s**-1"              },
+  { 136, "TCW",    "Total column water",                                         "kg m**-2"              },
+  { 137, "TCWV",   "Total column water vapour",                                  "kg m**-2"              },
+  { 138, "VO",     "Vorticity (relative)",                                       "s**-1"                 },
+  { 139, "STL1",   "Soil temperature level 1",                                   "K"                     },
+  { 140, "SWL1",   "Soil wetness level 1 m of water",                             NULL                   },
+  { 141, "SD",     "Snow depth         1 m of water equivalent",                  NULL                   },
+  { 142, "LSP",    "Stratiform precipitation (Large scale precipitation)",       "m"                     },
+  { 143, "CP",     "Convective precipitation",                                   "m"                     },
+  { 144, "SF",     "Snowfall (convective + stratiform)",                         "m"                     },
+  { 145, "BLD",    "Boundary layer dissipation",                                 "W m**-2 s"             },
+  { 146, "SSHF",   "Surface sensible heat flux",                                 "W m**-2 s"             },
+  { 147, "SLHF",   "Surface latent heat flux",                                   "W m**-2 s"             },
+  { 148, "CHNK",   "Charnock",                                                    NULL                   },
+  { 149, "SNR",    "Surface net radiation",                                      "W m**-2 s"             },
+  { 150, "TNR",    "Top net radiation",                                           NULL                   },
+  { 151, "MSL",    "Mean sea-level pressure",                                    "Pa"                    },
+  { 152, "LNSP",   "Logarithm of surface pressure",                               NULL                   },
+  { 153, "SWHR",   "Short-wave heating rate",                                    "K"                     },
+  { 154, "LWHR",   "Long-wave heating rate",                                     "K"                     },
+  { 155, "D",      "Divergence",                                                 "s**-1"                 },
+  { 156, "GH",     "Height m Geopotential height",                                NULL                   },
+  { 157, "R",      "Relative humidity",                                          "%"                     },
+  { 158, "TSP",    "Tendency of surface pressure",                               "Pa s**-1"              },
+  { 159, "BLH",    "Boundary layer height",                                      "m"                     },
+  { 160, "SDOR",   "Standard deviation of orography",                             NULL                   },
+  { 161, "ISOR",   "Anisotropy of sub-gridscale orography",                       NULL                   },
+  { 162, "ANOR",   "Angle of sub-gridscale orography",                           "rad"                   },
+  { 163, "SLOR",   "Slope of sub-gridscale orography",                            NULL                   },
+  { 164, "TCC",    "Total cloud cover",                                           NULL                   },
+  { 165, "U10M",   "10 metre U wind component",                                  "m s**-1"               },
+  { 166, "V10M",   "10 metre V wind component",                                  "m s**-1"               },
+  { 167, "T2M",    "2 metre temperature",                                        "K"                     },
+  { 168, "D2M",    "2 metre dewpoint temperature",                               "K"                     },
+  { 169, "SSRD",   "Surface solar radiation downwards",                          "W m**-2 s"             },
+  { 170, "STL2",   "Soil temperature level 2",                                   "K"                     },
+  { 171, "SWL2",   "Soil wetness level 2",                                       "m of water"            },
+  { 172, "LSM",    "Land/sea mask",                                               NULL                   },
+  { 173, "SR",     "Surface roughness",                                          "m"                     },
+  { 174, "AL",     "Albedo",                                                      NULL                   },
+  { 175, "STRD",   "Surface thermal radiation downwards",                        "W m**-2 s"             },
+  { 176, "SSR",    "Surface solar radiation",                                    "W m**-2 s"             },
+  { 177, "STR",    "Surface thermal radiation",                                  "W m**-2 s"             },
+  { 178, "TSR",    "Top solar radiation",                                        "W m**-2 s"             },
+  { 179, "TTR",    "Top thermal radiation",                                      "W m**-2 s"             },
+  { 180, "EWSS",   "East/West surface stress",                                   "N m**-2 s"             },
+  { 181, "NSSS",   "North/South surface stress",                                 "N m**-2 s"             },
+  { 182, "E",      "Evaporation",                                                "m of water"            },
+  { 183, "STL3",   "Soil temperature level 3",                                   "K"                     },
+  { 184, "SWL3",   "Soil wetness level 3",                                       "m of water"            },
+  { 185, "CCC",    "Convective cloud cover",                                      NULL                   },
+  { 186, "LCC",    "Low cloud cover",                                             NULL                   },
+  { 187, "MCC",    "Medium cloud cover",                                          NULL                   },
+  { 188, "HCC",    "High cloud cover",                                            NULL                   },
+  { 189, "SUND",   "Sunshine duration",                                          "s"                     },
+  { 190, "EWOV",   "EW component of subgrid orographic variance",                "m**2"                  },
+  { 191, "NSOV",   "NS component of subgrid orographic variance",                "m**2"                  },
+  { 192, "NWOV",   "NWSE component of subgrid orographic variance",              "m**2"                  },
+  { 193, "NEOV",   "NESW component of subgrid orographic variance",              "m**2"                  },
+  { 194, "BTMP",   "Brightness temperature",                                     "K"                     },
+  { 195, "LGWS",   "Lat. component of gravity wave stress",                      "N m**-2 s"             },
+  { 196, "MGWS",   "Meridional component of gravity wave stress",                "N m**-2 s"             },
+  { 197, "GWD",    "Gravity wave dissipation",                                   "W m**-2 s"             },
+  { 198, "SRC",    "Skin reservoir content",                                     "m of water"            },
+  { 199, "VEG",    "Vegetation fraction",                                         NULL                   },
+  { 200, "VSO",    "Variance of sub-gridscale orography",                        "m**2"                  },
+  { 201, "MX2T",   "Maximum 2 metre temperature since previous post-processing", "K"                     },
+  { 202, "MN2T",   "Minimum 2 metre temperature since previous post-processing", "K"                     },
+  { 203, "O3",     "Ozone mass mixing ratio",                                    "kg kg**-1"             },
+  { 204, "PAW",    "Precipiation analysis weights",                               NULL                   },
+  { 205, "RO",     "Runoff",                                                     "m"                     },
+  { 206, "TCO3",   "Total column ozone",                                         "kg m**-2"              },
+  { 207, "WS10",   "10 meter windspeed",                                         "m s**-1"               },
+  { 208, "TSRC",   "Top net solar radiation, clear sky",                         "W m**-2"               },
+  { 209, "TTRC",   "Top net thermal radiation, clear sky",                       "W m**-2"               },
+  { 210, "SSRC",   "Surface net solar radiation, clear sky",                     "W m**-2"               },
+  { 211, "STRC",   "Surface net thermal radiation, clear sky",                   "W m**-2"               },
+  { 212, "SI",     "Solar insolation",                                           "W m**-2"               },
+  { 214, "DHR",    "Diabatic heating by radiation",                              "K"                     },
+  { 215, "DHVD",   "Diabatic heating by vertical diffusion",                     "K"                     },
+  { 216, "DHCC",   "Diabatic heating by cumulus convection",                     "K"                     },
+  { 217, "DHLC",   "Diabatic heating large-scale condensation",                  "K"                     },
+  { 218, "VDZW",   "Vertical diffusion of zonal wind",                           "m s**-1"               },
+  { 219, "VDMW",   "Vertical diffusion of meridional wind",                      "m s**-1"               },
+  { 220, "EWGD",   "EW gravity wave drag tendency",                              "m s**-1"               },
+  { 221, "NSGD",   "NS gravity wave drag tendency",                              "m s**-1"               },
+  { 222, "CTZW",   "Convective tendency of zonal wind",                          "m s**-1"               },
+  { 223, "CTMW",   "Convective tendency of meridional wind",                     "m s**-1"               },
+  { 224, "VDH",    "Vertical diffusion of humidity",                             "kg kg**-1"             },
+  { 225, "HTCC",   "Humidity tendency by cumulus convection",                    "kg kg**-1"             },
+  { 226, "HTLC",   "Humidity tendency large-scale condensation",                 "kg kg**-1"             },
+  { 227, "CRNH",   "Change from removing negative humidity",                     "kg kg**-1"             },
+  { 228, "TP",     "Total precipitation",                                        "m"                     },
+  { 229, "IEWS",   "Instantaneous X surface stress",                             "N m**-2"               },
+  { 230, "INSS",   "Instantaneous Y surface stress",                             "N m**-2"               },
+  { 231, "ISHF",   "Instantaneous surface heat flux",                            "W m**-2"               },
+  { 232, "IE",     "Instantaneous moisture flux",                                "kg m**-2 s"            },
+  { 233, "ASQ",    "Apparent surface humidity",                                  "kg kg**-1"             },
+  { 234, "LSRH",   "Logarithm of surface roughness length for heat",              NULL                   },
+  { 235, "SKT",    "Skin temperature",                                           "K"                     },
+  { 236, "STL4",   "Soil temperature level 4",                                   "K"                     },
+  { 237, "SWL4",   "Soil wetness level 4",                                       "m"                     },
+  { 238, "TSN",    "Temperature of snow layer",                                  "K"                     },
+  { 239, "CSF",    "Convective snowfall",                                        "m of water equivalent" },
+  { 240, "LSF",    "Large-scale snowfall",                                       "m of water equivalent" },
+  { 241, "ACF",    "Accumulated cloud fraction tendency",                         NULL                   },
+  { 242, "ALW",    "Accumulated liquid water tendency",                           NULL                   },
+  { 243, "FAL",    "Forecast albedo",                                             NULL                   },
+  { 244, "FSR",    "Forecast surface roughness",                                 "m"                     },
+  { 245, "FLSR",   "Forecast log of surface roughness for heat",                  NULL                   },
+  { 246, "CLWC",   "Cloud liquid water content",                                 "kg kg**-1"             },
+  { 247, "CIWC",   "Cloud ice water content",                                    "kg kg**-1"             },
+  { 248, "CC",     "Cloud cover",                                                 NULL                   },
+  { 249, "AIW",    "Accumulated ice water tendency",                              NULL                   },
+  { 250, "ICE",    "Ice age",                                                     NULL                   },
+  { 251, "ATTE",   "Adiabatic tendency of temperature",                          "K"                     },
+  { 252, "ATHE",   "Adiabatic tendency of humidity",                             "kg kg**-1"             },
+  { 253, "ATZE",   "Adiabatic tendency of zonal wind",                           "m s**-1"               },
+  { 254, "ATMW",   "Adiabatic tendency of meridional wind",                      "m s**-1"               },
+};
+
+static PAR remo[] = {
+  {  14, "FTKVM",     "turbulent transfer coefficient of momentum in the atmosphere",   NULL           },
+  {  15, "FTKVH",     "turbulent transfer coefficient of heat in the atmosphere",       NULL           },
+  {  38, "U10ER",     "10m u-velocity",                                                "m/s"           },
+  {  39, "V10ER",     "10m v-velocity",                                                "m/s"           },
+  {  40, "CAPE",      "convetive available potential energy",                           NULL           },
+  {  41, "GHPBL",     "height of the planetary boudary layer",                         "gpm"           },
+  {  42, "BETA",      "BETA",                                                           NULL           },
+  {  43, "WMINLOK",   "WMINLOK",                                                        NULL           },
+  {  44, "WMAXLOK",   "WMAXLOK",                                                        NULL           },
+  {  45, "VBM10M",    "maximum of the expected gust velocity near the surface",        "m/s"           },
+  {  46, "BFLHS",     "surface sensible heat flux",                                    "W/m**2"        },
+  {  47, "BFLQDS",    "surface latent heat flux",                                      "W/m**2"        },
+  {  48, "TMCM",      "turbulent transfer coefficient of momentum at the surface",      NULL           },
+  {  49, "TRSOL",     "TRSOL",                                                          NULL           },
+  {  50, "TMCH",      "turbulent transfer coefficient of heat at the surface",          NULL           },
+  {  51, "EMTEF",     "EMTEF",                                                          NULL           },
+  {  52, "TRSOF",     "TRSOF",                                                          NULL           },
+  {  53, "DRAIN",     "drainage",                                                      "mm"            },
+  {  54, "TSL",       "surface temperature (land)",                                    "K"             },
+  {  55, "TSW",       "surface temperature (water)",                                   "K"             },
+  {  56, "TSI",       "surface temperature (ice)",                                     "K"             },
+  {  57, "USTRL",     "surface u-stress (land)",                                       "Pa"            },
+  {  58, "USTRW",     "surface u-stress (water)",                                      "Pa"            },
+  {  59, "USTRI",     "surface u-stress (ice)",                                        "Pa"            },
+  {  60, "VSTRL",     "surface v-stress (land)",                                       "Pa"            },
+  {  61, "VSTRW",     "surface v-stress (water)",                                      "Pa"            },
+  {  62, "VSTRI",     "surface v-stress (ice)",                                        "Pa"            },
+  {  63, "EVAPL",     "surface evaporation (land)",                                    "mm"            },
+  {  64, "EVAPW",     "surface evaporation (water)",                                   "mm"            },
+  {  65, "EVAPI",     "surface evaporation (ice)",                                     "mm"            },
+  {  66, "AHFLL",     "surface latent heat flux (land)",                               "W/m**2"        },
+  {  67, "AHFLW",     "surface latent heat flux (water)",                              "W/m**2"        },
+  {  68, "AHFLI",     "surface latent heat flux (ice)",                                "W/m**2"        },
+  {  69, "AHFSL",     "surface sensible heat flux (land)",                             "W/m**2"        },
+  {  70, "AHFSW",     "surface sensible heat flux (water)",                            "W/m**2"        },
+  {  71, "AHFSI",     "surface sensible heat flux (ice)",                              "W/m**2"        },
+  {  72, "AZ0L",      "surface roughness length (land)",                               "m"             },
+  {  73, "AZ0W",      "surface roughness length (water)",                              "m"             },
+  {  74, "AZ0I",      "surface roughness length (ice)",                                "m"             },
+  {  75, "ALSOL",     "surface albedo (land)",                                         "fract."        },
+  {  76, "ALSOW",     "surface albedo (water)",                                        "fract."        },
+  {  77, "ALSOI",     "surface albedo (ice)",                                          "fract."        },
+  {  81, "TMCHL",     "turbulent transfer coefficient of heat at the surface (land)",   NULL           },
+  {  82, "TMCHW",     "turbulent transfer coefficient of heat at the surface (water)",  NULL           },
+  {  83, "TMCHI",     "turbulent transfer coefficient of heat at the surface (ice)",    NULL           },
+  {  84, "QDBL",      "specific humidity surface (land)",                              "kg/kg"         },
+  {  85, "QDBW",      "specific humidity surface (water)",                             "kg/kg"         },
+  {  86, "QDBI",      "specific humidity surface (ice)",                               "kg/kg"         },
+  {  87, "BFLHSL",    "surface sensible heat flux (land)",                             "W/m**2"        },
+  {  88, "BFLHSW",    "surface sensible heat flux (water)",                            "W/m**2"        },
+  {  89, "BFLHSI",    "surface sensible heat flux (ice)",                              "W/m**2"        },
+  {  90, "BFLQDSL",   "surface latent heat flux (land)",                               "W/m**2"        },
+  {  91, "BFLQDSW",   "surface latent heat flux (water)",                              "W/m**2"        },
+  {  92, "BFLQDSI",   "surface latent heat flux (ice)",                                "W/m**2"        },
+  {  93, "AHFICE",    "sea-ice: conductive heat",                                      "W/m"           },
+  {  94, "QRES",      "residual heat flux for melting sea ice",                        "W/m**2"        },
+  {  95, "SRFL",      "SRFL",                                                           NULL           },
+  {  96, "QDBOXS",    "horizontal transport of water vapour",                          "kg/m**2"       },
+  {  97, "QWBOXS",    "horizontal transport of cloud water",                           "kg/m**2"       },
+  {  98, "EKBOXS",    "horizontal transport of kinetic energy",                        "(3600*J)/m**2" },
+  {  99, "FHBOXS",    "horizontal transport of sensible heat",                         "(3600*J)/m**2" },
+  { 100, "FIBOXS",    "horizontal transport of potential energy",                      "(3600*J)/m**2" },
+  { 101, "TLAMBDA",   "heat conductivity of dry soil",                                 "W/(K*m)"       },
+  { 103, "DLAMBDA",   "parameter for increasing the heat conductivity of the soil",     NULL           },
+  { 104, "PORVOL",    "pore volume",                                                    NULL           },
+  { 105, "FCAP",      "field capacity of soil",                                         NULL           },
+  { 106, "WI3",       "fraction of frozen soil",                                        NULL           },
+  { 107, "WI4",       "fraction of frozen soil",                                        NULL           },
+  { 108, "WI5",       "fraction of frozen soil",                                        NULL           },
+  { 109, "WI",        "fraction of frozen soil",                                        NULL           },
+  { 110, "WICL",      "fraction of frozen soil",                                        NULL           },
+  { 112, "QDB",       "specific humidity surface",                                     "kg/kg"         },
+  { 129, "FIB",       "surface geopotential (orography)",                              "m"             },
+  { 130, "T",         "temperature",                                                   "K"             },
+  { 131, "U",         "u-velocity",                                                    "m/s"           },
+  { 132, "V",         "v-velocity",                                                    "m/s"           },
+  { 133, "QD",        "specific humidity",                                             "kg/kg"         },
+  { 134, "PS",        "Surface pressure",                                              "Pa"            },
+  { 135, "VERVEL",    "Vertical velocity",                                             "Pa/s"          },
+  { 138, "SVO",       "vorticity",                                                     "1/s"           },
+  { 139, "TS",        "surface temperature",                                           "K"             },
+  { 140, "WS",        "soil wetness",                                                  "m"             },
+  { 141, "SN",        "snow depth",                                                    "m"             },
+  { 142, "APRL",      "large scale precipitation",                                     "mm"            },
+  { 143, "APRC",      "convective  precipitation",                                     "mm"            },
+  { 144, "APRS",      "snow fall",                                                     "mm"            },
+  { 145, "VDIS",      "boundary layer dissipation",                                    "W/m**2"        },
+  { 146, "AHFS",      "surface sensible heat flux",                                    "W/m**2"        },
+  { 147, "AHFL",      "surface latent heat flux",                                      "W/m**2"        },
+  { 148, "STREAM",    "streamfunction",                                                "m**2/s"        },
+  { 149, "VELOPOT",   "velocity potential",                                            "m**2/s"        },
+  { 151, "PSRED",     "mean sea level pressure",                                       "Pa"            },
+  { 152, "LSP",       "log surface pressure",                                           NULL           },
+  { 153, "QW",        "liquid water content",                                          "kg/kg"         },
+  { 155, "SD",        "divergence",                                                    "1/s"           },
+  { 156, "FI",        "geopotential height",                                           "gpm"           },
+  { 159, "USTAR3",    "ustar**3",                                                      "m**3/s**3"     },
+  { 160, "RUNOFF",    "surface runoff",                                                "mm"            },
+  { 162, "ACLC",      "cloud cover",                                                   "fract."        },
+  { 163, "ACLCV",     "total cloud cover",                                             "fract."        },
+  { 164, "ACLCOV",    "total cloud cover",                                             "fract."        },
+  { 165, "U10",       "10m u-velocity",                                                "m/s"           },
+  { 166, "V10",       "10m v-velocity",                                                "m/s"           },
+  { 167, "TEMP2",     "2m temperature",                                                "K"             },
+  { 168, "DEW2",      "2m dew point temperature",                                      "K"             },
+  { 169, "TSURF",     "surface temperature (land)",                                    "K"             },
+  { 170, "TD",        "deep soil temperature",                                         "K"             },
+  { 171, "WIND10",    "10m windspeed",                                                 "m/s"           },
+  { 172, "BLA",       "land sea mask",                                                 "fract."        },
+  { 173, "AZ0",       "surface roughness length",                                      "m"             },
+  { 174, "ALB",       "surface background albedo",                                     "fract."        },
+  { 175, "ALBEDO",    "surface albedo",                                                "fract."        },
+  { 176, "SRADS",     "net surface solar radiation",                                   "W/m**2"        },
+  { 177, "TRADS",     "net surface thermal radiation",                                 "W/m**2"        },
+  { 178, "SRAD0",     "net top solar radiation",                                       "W/m**2"        },
+  { 179, "TRAD0",     "top thermal radiation (OLR)",                                   "W/m**2"        },
+  { 180, "USTR",      "surface u-stress",                                              "Pa"            },
+  { 181, "VSTR",      "surface v-stress",                                              "Pa"            },
+  { 182, "EVAP",      "surface evaporation",                                           "mm"            },
+  { 183, "TDCL",      "soil temperature",                                              "K"             },
+  { 185, "SRAFS",     "net surf. solar radiation   (clear sky)",                       "W/m**2"        },
+  { 186, "TRAFS",     "net surf. thermal radiation (clear sky)",                       "W/m**2"        },
+  { 187, "SRAF0",     "net top solar radiation     (clear sky)",                       "W/m**2"        },
+  { 188, "TRAF0",     "net top thermal radiation   (clear sky)",                       "W/m**2"        },
+  { 189, "SCLFS",     "surface solar cloud forcing",                                   "W/m**2"        },
+  { 190, "TCLFS",     "surface thermal cloud forcing",                                 "W/m**2"        },
+  { 191, "SCLF0",     "top solar cloud forcing",                                       "W/m**2"        },
+  { 192, "TCLF0",     "top thermal cloud forcing",                                     "W/m**2"        },
+  { 194, "WL",        "skin reservoir content",                                        "m"             },
+  { 195, "USTRGW",    "u-gravity wave stress",                                         "Pa"            },
+  { 196, "VSTRGW",    "v-gravity wave stress",                                         "Pa"            },
+  { 197, "VDISGW",    "gravity wave dissipation",                                      "W/m**2"        },
+  { 198, "VGRAT",     "vegetation ratio",                                               NULL           },
+  { 199, "VAROR",     "orographic variance (for surface runoff)",                       NULL           },
+  { 200, "VLT",       "leaf area index",                                                NULL           },
+  { 201, "T2MAX",     "maximum 2m-temperature",                                        "K"             },
+  { 202, "T2MIN",     "minimum 2m-temperature",                                        "K"             },
+  { 203, "SRAD0U",    "top solar radiation upward",                                    "W/m**2"        },
+  { 204, "SRADSU",    "surface solar radiation upward",                                "W/m**2"        },
+  { 205, "TRADSU",    "surface thermal radiation upward",                              "W/m**2"        },
+  { 206, "TSN",       "snow temperature",                                              "K"             },
+  { 207, "TD3",       "soil temperature",                                              "K"             },
+  { 208, "TD4",       "soil temperature",                                              "K"             },
+  { 209, "TD5",       "soil temperature",                                              "K"             },
+  { 210, "SEAICE",    "sea ice cover",                                                 "fract."        },
+  { 211, "SICED",     "sea ice depth",                                                 "m"             },
+  { 212, "FOREST",    "vegetation type",                                                NULL           },
+  { 213, "TEFF",      "(effective) sea-ice skin temperature",                          "K"             },
+  { 214, "TSMAX",     "maximum surface temperature",                                   "K"             },
+  { 215, "TSMIN",     "minimum surface temperature",                                   "K"             },
+  { 216, "WIMAX",     "maximum 10m-wind speed",                                        "m/s"           },
+  { 217, "TOPMAX",    "maximum height of convective cloud tops",                       "Pa"            },
+  { 218, "SNMEL",     "snow melt",                                                     "mm"            },
+  { 220, "TSLIN",     "land: residual surface heat budget",                            "W/m**2"        },
+  { 221, "DSNAC",     "snow depth change",                                             "mm"            },
+  { 222, "EMTER",     "EMTER",                                                          NULL           },
+  { 223, "ACLCAC",    "cloud cover",                                                   "fract."        },
+  { 224, "TKE",       "turbulent kinetic energy",                                       NULL           },
+  { 226, "FAO",       "FAO data set (soil data flags)",                                 NULL           },
+  { 227, "RGCGN",     "heat capacity of soil",                                          NULL           },
+  { 229, "WSMX",      "field capacity of soil",                                         NULL           },
+  { 230, "QVI",       "vertically integrated specific humidity",                       "kg/m**2"       },
+  { 231, "ALWCVI",    "vertically integrated liquid water cont.",                      "kg/m**2"       },
+  { 232, "GLAC",      "glacier mask",                                                   NULL           },
+  { 253, "PHI",       "latitude in real coordinates",                                  "degrees_north" },
+  { 254, "RLA",       "longitude in real coordinates",                                 "degrees_east"  },
+  { 259, "WINDSPEED", "windspeed (sqrt(u**2+v**2))",                                    NULL           },
+  { 260, "PRECIP",    "total precipitation",                                            NULL           },
+};
+
+static PAR cosmo002[] = {
+  {   1, "P",         "pressure",                                          "Pa"         },
+  {   2, "PMSL",      "mean sea level pressure",                           "Pa"         },
+  {   3, "DPSDT",     "surface pressure change",                           "Pa s-1"     },
+  {   6, "FI",        "geopotential",                                      "m2 s-2"     },
+  {   8, "HH",        "height",                                            "m"          },
+  {  10, "TO3",       "vertical integrated ozone content",                 "Dobson"     },
+  {  11, "T",         "temperature",                                       "K"          },
+  {  15, "TMAX",      "2m maximum temperature",                            "K"          },
+  {  16, "TMIN",      "2m minimum temperature",                            "K"          },
+  {  17, "TD",        "2m dew point temperature",                          "K"          },
+  {  31, "DD",        "undefined",                                         "undefined"  },
+  {  32, "FF",        "undefined",                                         "undefined"  },
+  {  33, "U",         "U-component of wind",                               "m s-1"      },
+  {  34, "V",         "V-component of wind",                               "m s-1"      },
+  {  39, "OMEGA",     "omega",                                             "Pa s-1"     },
+  {  40, "W",         "vertical wind velocity",                            "m s-1"      },
+  {  51, "QV",        "specific humidity",                                 "kg kg-1"    },
+  {  52, "RELHUM",    "relative humidity",                                 "%"          },
+  {  54, "TQV",       "precipitable water",                                "kg m-2"     },
+  {  57, "AEVAP",     "surface evaporation",                               "kg m-2"     },
+  {  58, "TQI",       "vertical integrated cloud ice",                     "kg m-2"     },
+  {  59, "TOT_PR",    "total precipitation rate",                          "kg m-2 s-1" },
+  {  61, "TOT_PREC",  "total precipitation amount",                        "kg m-2"     },
+  {  65, "W_SNOW",    "surface snow amount",                               "m"          },
+  {  66, "H_SNOW",    "thickness of snow",                                 "m"          },
+  {  71, "CLCT",      "total cloud cover",                                 "1"          },
+  {  72, "CLC_CON",   "convective cloud area fraction",                    "1"          },
+  {  73, "CLCL",      "low cloud cover",                                   "1"          },
+  {  74, "CLCM",      "medium cloud cover",                                "1"          },
+  {  75, "CLCH",      "high cloud cover",                                  "1"          },
+  {  76, "TQC",       "vertical integrated cloud water",                   "kg m-2"     },
+  {  78, "SNOW_CON",  "convective snowfall",                               "kg m-2"     },
+  {  79, "SNOW_GSP",  "large scale snowfall",                              "kg m-2"     },
+  {  81, "FR_LAND",   "land-sea fraction",                                 "1"          },
+  {  83, "Z0",        "surface roughness length",                          "m"          },
+  {  84, "ALB_RAD",   "surface albedo",                                    "1"          },
+  {  85, "TSOIL",     "soil surface temperature",                          "K"          },
+  {  86, "WSOIL",     "water content of 1. soil layer",                    "m"          },
+  {  87, "PLCOV",     "vegetation area fraction",                          "1"          },
+  {  90, "RUNOFF",    "subsurface runoff",                                 "kg m-2"     },
+  {  91, "FR_ICE",    "sea ice area fraction",                             "1"          },
+  {  92, "H_ICE",     "sea ice thickness",                                 "m"          },
+  { 111, "ASOB",      "averaged surface net downward shortwave radiation", "W m-2"      },
+  { 112, "ATHB",      "averaged surface net downward longwave radiation",  "W m-2"      },
+  { 113, "ASOB",      "averaged TOA net downward shortwave radiation",     "W m-2"      },
+  { 114, "ATHB",      "averaged TOA outgoing longwave radiation",          "W m-2"      },
+  { 115, "ASWDIR",    "direct downward sw radiation at the surface",       "W m-2"      },
+  { 116, "ASWDIFD",   "diffuse downward sw radiation at the surface",      "W m-2"      },
+  { 117, "ASWDIFU",   "diffuse upwnward sw radiation at the surface",      "W m-2"      },
+  { 118, "ALWD",      "downward lw radiation at the surface",              "W m-2"      },
+  { 119, "ALWU",      "upward lw radiation at the surface",                "W m-2"      },
+  { 121, "ALHFL",     "averaged surface latent heat flux",                 "W m-2"      },
+  { 122, "ASHFL",     "averaged surface sensible heat flux",               "W m-2"      },
+  { 124, "AUMFL",     "averaged eastward stress",                          "Pa"         },
+  { 125, "AVMFL",     "averaged northward stress",                         "Pa"         },
+  { 128, "SUNSH",     "undefined",                                         "undefined"  },
+  { 129, "SUNSH2",    "undefined",                                         "undefined"  },
+  { 130, "SUN_SUM",   "undefined",                                         "undefined"  },
+  { 131, "SUN_SUM2",  "undefined",                                         "undefined"  },
+  { 133, "FCOR",      "undefined",                                         "undefined"  },
+  { 134, "SKYVIEW",   "sky-view factor",                                   "1"          },
+  { 137, "SWDIR_COR", "topo correction of direct solar radiarion",         "1"          },
+};
+
+static PAR cosmo201[] = {
+  {   5, "APAB",      "&",                                                         "W m-2"      },
+  {  13, "SOHR_RAD",  "&",                                                         "K s-1"      },
+  {  14, "THHR_RAD",  "&",                                                         "K s-1"      },
+  {  20, "DURSUN",    "duration of sunshine",                                      "s"          },
+  {  29, "CLC",       "cloud area fraction",                                       "1"          },
+  {  30, "CLC_SGS",   "grid scale cloud area fraction",                            "1"          },
+  {  31, "QC",        "specific cloud liquid water content",                       "kg kg-1"    },
+  {  33, "QI",        "specific cloud ice content",                                "kg kg-1"    },
+  {  35, "QR",        "specific rain content",                                     "kg kg-1"    },
+  {  36, "QS",        "specific snow content",                                     "kg kg-1"    },
+  {  37, "TQR",       "total rain water content vertically integrated",            "kg m-2"     },
+  {  38, "TQS",       "total snow content vertically integrated",                  "kg m-2"     },
+  {  39, "QG",        "specific graupel content",                                  "kg kg-1"    },
+  {  40, "TQG",       "total graupel content vertically integrated",               "kg m-2"     },
+  {  41, "TWATER",    "cloud condensed water content",                             "kg m-2"     },
+  {  42, "TDIV_HUM",  "atmosphere water divergence",                               "kg m-2"     },
+  {  43, "QC_RAD",    "sub scale specific cloud liquid water content",             "kg kg-1"    },
+  {  44, "QI_RAD",    "sub scale specific cloud ice content",                      "kg kg-1"    },
+  {  61, "CLW_CON",   "convective cloud liquid water",                             "1"          },
+  {  68, "HBAS_CON",  "height of convective cloud base",                           "m"          },
+  {  69, "HTOP_CON",  "height of convective cloud top",                            "m"          },
+  {  70, "HBAS_CONI", "height of convective cloud base",                           "m"          },
+  {  71, "HTOP_CONI", "height of convective cloud top",                            "m"          },
+  {  72, "BAS_CON",   "index of convective cloud base",                            "1"          },
+  {  73, "TOP_CON",   "index of convective cloud top",                             "1"          },
+  {  74, "DT_CON",    "convective tendency of temperature",                        "K s-1"      },
+  {  75, "DQV_CON",   "convective tendency of specific humidity",                  "s-1"        },
+  {  78, "DU_CON",    "convective tendency of u-wind component",                   "m s-2"      },
+  {  79, "DV_CON",    "convective tendency of v-wind component",                   "m s-2"      },
+  {  82, "HTOP_DC",   "height of dry convection top",                              "m"          },
+  {  84, "HZEROCL",   "height of freezing level",                                  "m"          },
+  {  85, "SNOWLMT",   "height of the snow fall limit in m above sea level",        "m"          },
+  {  86, "HCBAS",     "height of cloud base",                                      "m"          },
+  {  87, "HCTOP",     "height of cloud top",                                       "m"          },
+  {  91, "C_T_LK",    "&",                                                         "1"          },
+  {  92, "GAMSO_LK",  "&",                                                         "m-1"        },
+  {  93, "DP_BS_LK",  "&",                                                         "m"          },
+  {  94, "H_B1_LK",   "&",                                                         "m"          },
+  {  95, "H_ML_LK",   "&",                                                         "m"          },
+  {  96, "DEPTH_LK",  "lake depth",                                                "m"          },
+  {  97, "FETCH_LK",  "wind fetch over lake",                                      "m"          },
+  {  99, "QRS",       "precipitation water (water loading)",                       "1"          },
+  { 100, "PRR_GSP",   "mass flux density of large scale rainfall",                 "kg m-2 s-1" },
+  { 101, "PRS_GSP",   "mass flux density of large scale snowfall",                 "kg m-2 s-1" },
+  { 102, "RAIN_GSP",  "large scale rainfall",                                      "kg m-2"     },
+  { 111, "PRR_CON",   "mass flux density of convective rainfall",                  "kg m-2 s-1" },
+  { 112, "PRS_CON",   "mass flux density of convective snowfall",                  "kg m-2 s-1" },
+  { 113, "RAIN_CON",  "convective rainfall",                                       "kg m-2"     },
+  { 129, "FRESHSNW",  "freshness of snow",                                         "undefined"  },
+  { 131, "PRG_GSP",   "mass flux density of large scale graupel",                  "kg m-2 s-1" },
+  { 132, "GRAU_GSP",  "large scale graupel",                                       "kg m-2"     },
+  { 133, "RHO_SNOW",  "density of snow",                                           "kg m-3"     },
+  { 139, "PP",        "deviation from reference pressure",                         "Pa"         },
+  { 140, "RCLD",      "standard deviation of saturation deficit",                  "undefined"  },
+  { 143, "CAPE_MU",   "cape of most unstable parcel",                              "J kg-1"     },
+  { 144, "CIN_MU",    "convective inhibition of most unstable parcel",             "J kg-1"     },
+  { 145, "CAPE_ML",   "cape of mean surface layer parcel",                         "J kg-1"     },
+  { 146, "CIN_ML",    "convective inhibition of mean surface layer parcel",        "J kg-1"     },
+  { 147, "TKE_CON",   "convective turbulent kinetic energy",                       "undefined"  },
+  { 148, "TKETENS",   "tendency of turbulent kinetic energy",                      "undefined"  },
+  { 152, "TKE",       "turbulent kinetic energy",                                  "m2 s-2"     },
+  { 153, "TKVM",      "diffusion coefficient of momentum",                         "m2 s-1"     },
+  { 154, "TKVH",      "diffusion coefficient of heat",                             "m2 s-1"     },
+  { 170, "TCM",       "drag coefficient of momentum",                              "1"          },
+  { 171, "TCH",       "drag coefficient of heat",                                  "1"          },
+  { 187, "VMAX",      "maximum turbulent wind gust in 10m",                        "m s-1"      },
+  { 190, "TSOIL",     "&",                                                         "K"          },
+  { 191, "TSOIL",     "&",                                                         "K"          },
+  { 192, "TSOIL",     "&",                                                         "K"          },
+  { 193, "TSOIL",     "mixed layer temperature",                                   "K"          },
+  { 194, "TSOIL",     "mean temperature of water column",                          "K"          },
+  { 197, "TSOIL",     "soil temperature",                                          "K"          },
+  { 198, "W_SO",      "soil water content",                                        "m"          },
+  { 199, "W_SO_ICE",  "soil frozen water content",                                 "m"          },
+  { 200, "W_I",       "canopy water amount",                                       "m"          },
+  { 203, "TSOIL",     "snow surface temperature",                                  "K"          },
+  { 215, "TSOIL",     "temperature of ice upper surface",                          "K"          },
+  { 230, "dBZ",       "unattenuated radar reflectivity in Rayleigh approximation", "1"          },
+  { 240, "MFLX_CON",  "convective mass flux density",                              "kg m-2 s-1" },
+  { 241, "CAPE_CON",  "&",                                                         "J kg-1"     },
+  { 243, "QCVG_CON",  "&",                                                         "s-1"        },
+};
+
+static PAR cosmo202[] = {
+  {  46, "SSO_STDH",  "standard deviation of subgrid scale height",                "m"         },
+  {  47, "SSO_GAMMA", "anisotropy of topography",                                  "-"         },
+  {  48, "SSO_THETA", "angle between principal axis of orography and global east", "-"         },
+  {  49, "SSO_SIGMA", "mean slope of subgrid scale orography",                     "-"         },
+  {  55, "FR_LAKE",   "fraction of inland lake water",                             "1"         },
+  {  57, "SOILTYP",   "soil type",                                                 "1"         },
+  {  61, "LAI",       "leaf area index",                                           "1"         },
+  {  62, "ROOTDP",    "root depth",                                                "m"         },
+  {  64, "HMO3",      "air pressure at ozone maximum",                             "Pa"        },
+  {  65, "VIO3",      "vertical integrated ozone amount",                          "Pa"        },
+  {  67, "PLCOV_MX",  "vegetation area fraction maximum",                          "1"         },
+  {  68, "PLCOV_MN",  "vegetation area fraction minimum",                          "1"         },
+  {  69, "LAI_MX",    "leaf area index maximum",                                   "1"         },
+  {  70, "LAI_MN",    "leaf area index minimum",                                   "1"         },
+  {  75, "FOR_E",     "ground fraction covered by evergreen forest",               "-"         },
+  {  76, "FOR_D",     "ground fraction covered by deciduous forest",               "-"         },
+  { 104, "DQVDT",     "tendency of water vapor",                                   "s-1"       },
+  { 105, "QVSFLX",    "surface flux of water vapour",                              "s-1m-2"    },
+  { 113, "FC",        "coriolis parameter",                                        "s-1"       },
+  { 114, "RLAT",      "latitude",                                                  "radian"    },
+  { 115, "RLON",      "longitude",                                                 "radian"    },
+  { 121, "ZTD",       "integrated total atmospheric refractivity",                 "undefined" },
+  { 122, "ZWD",       "integrated wet atmospheric refractivity",                   "undefined" },
+  { 123, "ZHD",       "integrated dry atmospheric refractivity",                   "undefined" },
+  { 180, "O3",        "ozone mass mixing ratio",                                   "kg kg-1"   },
+  { 200, "I131a",     "undefined",                                                 "undefined" },
+  { 201, "I131a_DD",  "undefined",                                                 "undefined" },
+  { 202, "I131a_WD",  "undefined",                                                 "undefined" },
+  { 203, "Cs137",     "undefined",                                                 "undefined" },
+  { 204, "Cs137_DD",  "undefined",                                                 "undefined" },
+  { 205, "Cs137_WD",  "undefined",                                                 "undefined" },
+  { 206, "Te132",     "undefined",                                                 "undefined" },
+  { 207, "Te132_DD",  "undefined",                                                 "undefined" },
+  { 208, "Te132_WD",  "undefined",                                                 "undefined" },
+  { 209, "Zr95",      "undefined",                                                 "undefined" },
+  { 210, "Zr95_DD",   "undefined",                                                 "undefined" },
+  { 211, "Zr95_WD",   "undefined",                                                 "undefined" },
+  { 212, "Kr85",      "undefined",                                                 "undefined" },
+  { 213, "Kr85_DD",   "undefined",                                                 "undefined" },
+  { 214, "Kr85_WD",   "undefined",                                                 "undefined" },
+  { 215, "TRACER",    "undefined",                                                 "undefined" },
+  { 216, "TRACER_DD", "undefined",                                                 "undefined" },
+  { 217, "TRACER_WD", "undefined",                                                 "undefined" },
+  { 218, "Xe133",     "undefined",                                                 "undefined" },
+  { 219, "Xe133_DD",  "undefined",                                                 "undefined" },
+  { 220, "Xe133_WD",  "undefined",                                                 "undefined" },
+  { 221, "I131g",     "undefined",                                                 "undefined" },
+  { 222, "I131g_DD",  "undefined",                                                 "undefined" },
+  { 223, "I131g_WD",  "undefined",                                                 "undefined" },
+  { 224, "I131o",     "undefined",                                                 "undefined" },
+  { 225, "I131o_DD",  "undefined",                                                 "undefined" },
+  { 226, "I131o_WD",  "undefined",                                                 "undefined" },
+  { 227, "Ba140",     "undefined",                                                 "undefined" },
+  { 228, "Ba140_DD",  "undefined",                                                 "undefined" },
+  { 229, "Ba140_WD",  "undefined",                                                 "undefined" },
+  { 230, "Sr90",      "undefined",                                                 "undefined" },
+  { 231, "Sr90_DD",   "undefined",                                                 "undefined" },
+  { 232, "Sr90_WD",   "undefined",                                                 "undefined" },
+  { 233, "Ru103",     "undefined",                                                 "undefined" },
+  { 234, "Ru103_DD",  "undefined",                                                 "undefined" },
+  { 235, "Ru103_WD",  "undefined",                                                 "undefined" },
+};
+
+static PAR cosmo203[] = {
+  { 135, "LCL_ML",   "undefined",                  "undefined" },
+  { 136, "LFC_ML",   "undefined",                  "undefined" },
+  { 137, "CAPE_3KM", "undefined",                  "undefined" },
+  { 138, "SWISS00",  "swiss00 index",              "1"         },
+  { 139, "SWISS12",  "swiss12 index",              "1"         },
+  { 147, "SLI",      "surface lifted index",       "K"         },
+  { 149, "SI",       "showalter index",            "K"         },
+  { 155, "BRN",      "undefined",                  "undefined" },
+  { 156, "HPBL",     "undefined",                  "undefined" },
+  { 203, "CLDEPTH",  "normalized cloud depth",     "1"         },
+  { 204, "CLCT_MOD", "modified_total_cloud_cover", "1"         },
+};
+
+static PAR cosmo205[] = {
+  {   1, "SYNME5", "synthetic satellite images Meteosat5", "-" },
+  {   2, "SYNME6", "synthetic satellite images Meteosat6", "-" },
+  {   3, "SYNME7", "synthetic satellite images Meteosat7", "-" },
+  {   4, "SYNMSG", "synthetic satellite images MSG",       "-" },
+};
+
+static PAR cosmo250[] = {
+  {   1, "QNH",       "sea level air pressure",                                         "hPa"                                },
+  {  11, "TSOIL",     "2m temperature",                                                 "K"                                  },
+  {  12, "TSOIL",     "2m temperature",                                                 "K"                                  },
+  {  13, "D_T_2M_K",  "kalman correction to 2m temperature",                            "K"                                  },
+  {  14, "TSOIL",     "2m temperature",                                                 "K"                                  },
+  {  15, "TSOIL",     "2m temperature",                                                 "K"                                  },
+  {  16, "RH_ICE",    "relative humidity over ice",                                     "%"                                  },
+  {  17, "TD",        "dew point temperature",                                          "K"                                  },
+  {  18, "D_TD",      "dew point depression",                                           "K"                                  },
+  {  19, "THETAE",    "equivalent potential temperature",                               "K"                                  },
+  {  20, "TD_2M_K",   "2m dew point temperature",                                       "K"                                  },
+  {  21, "D_TD_2M_K", "kalman correction to 2m dew point temperature",                  "K"                                  },
+  {  22, "TD_2M_OLD", "2m dew point temperature",                                       "K"                                  },
+  {  23, "TD_2M_BUZ", "2m dew point temperature",                                       "K"                                  },
+  {  24, "HI",        "heat index",                                                     "Fahrenheit"                         },
+  {  25, "DURSUN_M",  "maximum duration of sunshine",                                   "s"                                  },
+  {  26, "DURSUN_R",  "relative duration of sunshine",                                  "%"                                  },
+  {  52, "RH_2M_K",   "2m relative humidity",                                           "%"                                  },
+  {  53, "D_RH_2M_K", "kalman correction to 2m relative humidity",                      "%"                                  },
+  {  58, "CLI_RATIO", "cloud ice ratio (Qi/Qc+Qi)",                                     "%"                                  },
+  {  61, "TOT_SNOW",  "total precipitation in snow",                                    "kg/m**2"                            },
+  {  62, "TOT_RAIN",  "total precipitation in rain",                                    "kg/m**2"                            },
+  {  63, "TOT_CON",   "total convective precipitation",                                 "kg/m**2"                            },
+  {  64, "TOT_GSP",   "total large scale precipitation",                                "kg/m**2"                            },
+  {  65, "SNOW_%",    "percentage of precipitation in snow",                            "%"                                  },
+  {  66, "CONV_%",    "percentage of convective precipitation",                         "%"                                  },
+  {  67, "VORTP_ABS", "absolute",                                                       "VORTP_ABS 67 -1 absolute vorticity" },
+  {  68, "VORTP_REL", "relative",                                                       "VORTP_REL 68 -1 relative vorticity" },
+  {  70, "PDIFF_CON", "pressure difference between cloud base and cloud top",           "Pa"                                 },
+  {  71, "TTOP_CON",  "temperature at cloud top",                                       "K"                                  },
+  {  80, "GEM",       "emissivity of the ground",                                       "%"                                  },
+  {  82, "Z0LOC",     "local surface roughness length",                                 "m"                                  },
+  { 110, "LUM",       "luminosity",                                                     "klux"                               },
+  { 111, "GLOB",      "global shortwave radiation at surface",                          "W/m**2"                             },
+  { 112, "LW_IN_TG",  "incoming longwave radiation at surface",                         "W/m**2"                             },
+  { 113, "LW_IN_TS",  "incoming longwave radiation at surface",                         "W/m**2"                             },
+  { 114, "LW_IN_T2M", "incoming longwave radiation at surface",                         "W/m**2"                             },
+  { 115, "SWISS_WE",  "Swiss",                                                          "SWISS_WE 115 1 Swiss coordinates"   },
+  { 116, "SWISS_SN",  "Swiss",                                                          "SWISS_SN 116 1 Swiss coordinates"   },
+  { 150, "KOINDEX",   "KO index",                                                       "K"                                  },
+  { 151, "TTINDEX",   "total-totals index",                                             "K"                                  },
+  { 152, "DCI",       "deep convection index",                                          "K"                                  },
+  { 153, "SWEAT",     "severe weather thread index",                                    "undefined"                          },
+  { 154, "ADEDO2",    "adedokun 2 index",                                               "K"                                  },
+  { 160, "C_TSTORM",  "thunderstorm index using AdaBoost classifier",                   "undefined"                          },
+  { 161, "CN_TSTORM", "thunderstorm probabilty using AdaBoost classifier",              "%"                                  },
+  { 200, "WSHEARL",   "wind shear between surface and 3 km asl",                        "1/s"                                },
+  { 201, "WSHEARM",   "wind shear between surface and 6 km asl",                        "1/s"                                },
+  { 202, "WSHEARU",   "wind shear between 3 km (or surface) and 6 km asl",              "1/s"                                },
+  { 211, "VWIN",      "maximum OLD turbulent wind gust in 10m",                         "m s-1"                              },
+  { 212, "VW10M_20",  "maximum 10m wind speed",                                         "m s-1"                              },
+  { 213, "VW10M_25",  "duration of VWIN_10M above 25 knots",                            "s"                                  },
+  { 214, "VW10M_30",  "duration of VWIN_10M above 30 knots",                            "s"                                  },
+  { 215, "VW10M_35",  "duration of VWIN_10M above 35 knots",                            "s"                                  },
+  { 216, "VW10M_40",  "duration of VWIN_10M above 40 knots",                            "s"                                  },
+  { 217, "VW10M_45",  "duration of VWIN_10M above 45 knots",                            "s"                                  },
+  { 218, "VW10M_50",  "duration of VWIN_10M above 50 knots",                            "s"                                  },
+  { 219, "VOLD",      "maximum turbulent wind gust in 10m",                             "m s-1"                              },
+  { 220, "VJPS",      "maximum turbulent wind gust in 10m",                             "m s-1"                              },
+  { 221, "VBRA",      "maximum Brasseur turbulent wind gust in 10m",                    "m s-1"                              },
+  { 222, "VB10M_20",  "duration of VBRA_10M above 20 knots",                            "s"                                  },
+  { 223, "VB10M_25",  "duration of VBRA_10M above 25 knots",                            "s"                                  },
+  { 224, "VB10M_30",  "duration of VBRA_10M above 30 knots",                            "s"                                  },
+  { 225, "VB10M_35",  "duration of VBRA_10M above 35 knots",                            "s"                                  },
+  { 226, "VB10M_40",  "duration of VBRA_10M above 40 knots",                            "s"                                  },
+  { 227, "VB10M_45",  "duration of VBRA_10M above 45 knots",                            "s"                                  },
+  { 228, "VB10M_50",  "duration of VBRA_10M above 50 knots",                            "s"                                  },
+  { 231, "VCON",      "maximum convective wind gust in 10m",                            "m s-1"                              },
+  { 232, "VC10M_20",  "duration of VCON_10M above 20 knots",                            "s"                                  },
+  { 233, "VC10M_25",  "duration of VCON_10M above 25 knots",                            "s"                                  },
+  { 234, "VC10M_30",  "duration of VCON_10M above 30 knots",                            "s"                                  },
+  { 235, "VC10M_35",  "duration of VCON_10M above 35 knots",                            "s"                                  },
+  { 236, "VC10M_40",  "duration of VCON_10M above 40 knots",                            "s"                                  },
+  { 237, "VC10M_45",  "duration of VCON_10M above 45 knots",                            "s"                                  },
+  { 238, "VC10M_50",  "duration of VCON_10M above 50 knots",                            "s"                                  },
+  { 241, "FMAX",      "maximum wind speed at k=ke",                                     "m s-1"                              },
+  { 242, "USTARMAX",  "maximal u*=SQRT(Drag_coef)*fmax_10m",                            "m s-1"                              },
+  { 243, "GLOB_DIF",  "global diffuse shortwave radiation at the surface",              "W/m**2"                             },
+  { 244, "GLOB_DIR",  "global direct (beam) shortwave radiation at the surface",        "W/m**2"                             },
+  { 245, "GLOB_vE",   "global shortwave radiation on a vertical surface facing east",   "W/m**2"                             },
+  { 246, "GLOB_vS",   "global shortwave radiation on a vertical surface facing south",  "W/m**2"                             },
+  { 247, "GLOB_vW",   "global shortwave radiation on a vertical surface facing west",   "W/m**2"                             },
+  { 248, "GLOB_vN",   "global shortwave radiation on a vertical surface facing north",  "W/m**2"                             },
+  { 249, "LW_TG_vS",  "incoming longwave radiation on a vertical surface facing south", "W/m**2"                             },
+  { 250, "ENTH",      "enthalpy",                                                       "kJ/kg"                              },
+  { 251, "ENTH",      "enthalpy",                                                       "kJ/kg"                              },
+  { 252, "MIXRAT",    "mixing ratio",                                                   "g/kg"                               },
+  { 253, "MIXRAT",    "mixing ratio",                                                   "g/kg"                               },
+  { 254, "TW",        "wet bulb temperature",                                           "degC"                               },
+  { 255, "TW",        "wet bulb temperature",                                           "degC"                               },
+};
+
+
+void
+tableDefault(void)
+{
+  int tableID, instID, modelID;
+
+
+  /*
+   *  define table : echam4
+   */
+
+  instID  = institutInq(98, 255, "MPIMET", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(98, 255, "MPIMET", NULL);
+
+  modelID = modelInq(instID, 0, "ECHAM4");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "ECHAM4");
+
+  tableID = tableDef(modelID, 128, "echam4");
+
+  tableLink(tableID, echam4, sizeof(echam4) / sizeof(PAR));
+
+  /*
+   *  define table : echam5
+   */
+
+  instID  = institutInq(0, 0, "MPIMET", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MPIMET", NULL);
+
+  modelID = modelInq(instID, 0, "ECHAM5");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "ECHAM5");
+
+  tableID = tableDef(modelID, 128, "echam5");
+
+  tableLink(tableID, echam5, sizeof(echam5) / sizeof(PAR));
+
+  /*
+   *  define table : echam6
+   */
+
+  instID  = institutInq(0, 0, "MPIMET", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MPIMET", NULL);
+
+  modelID = modelInq(instID, 0, "ECHAM6");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "ECHAM6");
+
+  tableID = tableDef(modelID, 128, "echam6");
+
+  tableLink(tableID, echam6, sizeof(echam6) / sizeof(PAR));
+
+  /*
+   *  define table : mpiom1
+   */
+
+  instID  = institutInq(0, 0, "MPIMET", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MPIMET", NULL);
+
+  modelID = modelInq(instID, 0, "MPIOM1");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "MPIOM1");
+
+  tableID = tableDef(modelID, 128, "mpiom1");
+
+  tableLink(tableID, mpiom1, sizeof(mpiom1) / sizeof(PAR));
+
+  /*
+   *  define table : ecmwf
+   */
+
+  instID  = institutInq(0, 0, "ECMWF", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "ECMWF", NULL);
+
+  modelID = modelInq(instID, 0, "");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "");
+
+  tableID = tableDef(modelID, 128, "ecmwf");
+
+  tableLink(tableID, ecmwf, sizeof(ecmwf) / sizeof(PAR));
+
+  /*
+   *  define table : remo
+   */
+
+  instID  = institutInq(0, 0, "MPIMET", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MPIMET", NULL);
+
+  modelID = modelInq(instID, 0, "REMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "REMO");
+
+  tableID = tableDef(modelID, 128, "remo");
+
+  tableLink(tableID, remo, sizeof(remo) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo002
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 002, "cosmo002");
+
+  tableLink(tableID, cosmo002, sizeof(cosmo002) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo201
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 201, "cosmo201");
+
+  tableLink(tableID, cosmo201, sizeof(cosmo201) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo202
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 202, "cosmo202");
+
+  tableLink(tableID, cosmo202, sizeof(cosmo202) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo203
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 203, "cosmo203");
+
+  tableLink(tableID, cosmo203, sizeof(cosmo203) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo205
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 205, "cosmo205");
+
+  tableLink(tableID, cosmo205, sizeof(cosmo205) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo250
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 250, "cosmo250");
+
+  tableLink(tableID, cosmo250, sizeof(cosmo250) / sizeof(PAR));
+}
+
+#endif  /* _TABLE_H */
+#ifndef _GAUSSGRID_H
+#define _GAUSSGRID_H
+
+void   gaussaw(double *pa, double *pw, int nlat);
+
+#endif  /* _GAUSSGRID_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _GRID_H
+#define _GRID_H
+
+typedef unsigned char mask_t;
+
+typedef struct {
+  int     self;
+  int     type;                   /* grid type                      */
+  int     prec;                   /* grid precision                 */
+  int     proj;                   /* grid projection                */
+  mask_t *mask;
+  mask_t *mask_gme;
+  double *xvals;
+  double *yvals;
+  double *area;
+  double *xbounds;
+  double *ybounds;
+  double  xfirst, yfirst;
+  double  xlast, ylast;
+  double  xinc, yinc;
+  double  lcc_originLon;          /* Lambert Conformal Conic        */
+  double  lcc_originLat;
+  double  lcc_lonParY;
+  double  lcc_lat1;
+  double  lcc_lat2;
+  double  lcc_xinc;
+  double  lcc_yinc;
+  int     lcc_projflag;
+  int     lcc_scanflag;
+  int     lcc_defined;
+  double  lcc2_lon_0;             /* Lambert Conformal Conic 2      */
+  double  lcc2_lat_0;
+  double  lcc2_lat_1;
+  double  lcc2_lat_2;
+  double  lcc2_a;
+  int     lcc2_defined;
+  double  laea_lon_0;             /* Lambert Azimuthal Equal Area   */
+  double  laea_lat_0;
+  double  laea_a;
+  int     laea_defined;
+  double  xpole, ypole, angle;    /* rotated north pole             */
+  int     isCyclic;               /* TRUE for global cyclic grids   */
+  int     isRotated;              /* TRUE for rotated grids         */
+  int     xdef;                   /* 0: undefined 1:xvals 2:x0+xinc */
+  int     ydef;                   /* 0: undefined 1:yvals 2:y0+yinc */
+  int     nd, ni, ni2, ni3;       /* parameter for GRID_GME         */
+  int     number, position;       /* parameter for GRID_REFERENCE   */
+  char   *reference;
+  char    uuid[17];               /* uuid for grid reference        */
+  int     trunc;                  /* parameter for GRID_SPECTEAL    */
+  int     nvertex;
+  int    *rowlon;
+  int     nrowlon;
+  int     size;
+  int     xsize;                  /* number of values along X */
+  int     ysize;                  /* number of values along Y */
+  int     np;                     /* number of parallels between a pole and the equator */
+  int     locked;
+  int     lcomplex;
+  char    xname[CDI_MAX_NAME];
+  char    yname[CDI_MAX_NAME];
+  char    xlongname[CDI_MAX_NAME];
+  char    ylongname[CDI_MAX_NAME];
+  char    xstdname[CDI_MAX_NAME];
+  char    ystdname[CDI_MAX_NAME];
+  char    xunits[CDI_MAX_NAME];
+  char    yunits[CDI_MAX_NAME];
+  char   *name;
+}
+grid_t;
+
+
+void grid_init(grid_t *gridptr);
+void grid_free(grid_t *gridptr);
+
+const double *gridInqXvalsPtr(int gridID);
+const double *gridInqYvalsPtr(int gridID);
+
+double *gridInqXboundsPtr(int gridID);
+double *gridInqYboundsPtr(int gridID);
+const double *gridInqAreaPtr(int gridID);
+
+int gridCompare(int gridID, grid_t grid);
+int gridGenerate(grid_t grid);
+
+void     gridGetIndexList    ( int, int * );
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _VARSCAN_H
+#define _VARSCAN_H
+
+#ifndef _GRID_H
+#  include "grid.h"
+#endif
+
+
+void varAddRecord(int recID, int param, int gridID, int zaxistype, int lbounds,
+		  int level1, int level2, int prec,
+		  int *pvarID, int *plevelID, int tsteptype, int numavg, int ltype,
+		  const char *name, const char *longname, const char *units);
+
+void varDefVCT(size_t vctsize, double *vctptr);
+void varDefZAxisReference(int nlev, int nvgrid, char *uuid);
+
+int  varDefGrid(int vlistID, grid_t grid, int mode);
+int  varDefZaxis(int vlistID, int zaxistype, int nlevels, double *levels, int lbounds,
+		 double *levels1, double *levels2, int vctsize, double *vct, char *name,
+		 char *longname, char *units, int prec, int mode, int ltype);
+
+void varDefMissval(int varID, double missval);
+void varDefCompType(int varID, int comptype);
+void varDefInst(int varID, int instID);
+int  varInqInst(int varID);
+void varDefModel(int varID, int modelID);
+int  varInqModel(int varID);
+void varDefTable(int varID, int tableID);
+int  varInqTable(int varID);
+void varDefEnsembleInfo(int varID, int ens_idx, int ens_count, int forecast_type);
+
+int  zaxisCompare(int zaxisID, int zaxistype, int nlevels, int lbounds, double *levels, char *longname, char *units, int ltype);
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _BINARY_H
+#define _BINARY_H
+
+#include <stdio.h>
+
+#ifndef _DTYPES_H
+#include "dtypes.h"
+#endif
+
+
+UINT32 get_UINT32(unsigned char *x);
+UINT32 get_SUINT32(unsigned char *x);
+UINT64 get_UINT64(unsigned char *x);
+UINT64 get_SUINT64(unsigned char *x);
+
+
+size_t binReadF77Block(int fileID, int byteswap);
+void   binWriteF77Block(int fileID, int byteswap, size_t blocksize);
+
+int binReadInt32(int fileID, int byteswap, size_t size, INT32 *ptr);
+int binReadInt64(int fileID, int byteswap, size_t size, INT64 *ptr);
+
+int binWriteInt32(int fileID, int byteswap, size_t size, INT32 *ptr);
+int binWriteInt64(int fileID, int byteswap, size_t size, INT64 *ptr);
+
+int binReadFlt32(int fileID, int byteswap, size_t size, FLT32 *ptr);
+int binReadFlt64(int fileID, int byteswap, size_t size, FLT64 *ptr);
+
+int binWriteFlt32(int fileID, int byteswap, size_t size, FLT32 *ptr);
+int binWriteFlt64(int fileID, int byteswap, size_t size, FLT64 *ptr);
+
+#endif  /* _BINARY_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+
+void swap4byte(void *ptr, size_t size);
+void swap8byte(void *ptr, size_t size);
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _SERVICE_H
+#define _SERVICE_H
+
+
+typedef struct {
+  int    checked;
+  int    byteswap;
+  int    header[8];
+  int    hprec;      /* header precision */
+  int    dprec;      /* data   precision */
+  size_t datasize;
+  size_t buffersize;
+  void  *buffer;
+}
+srvrec_t;
+
+
+const char *srvLibraryVersion(void);
+
+void srvDebug(int debug);
+
+int  srvCheckFiletype(int fileID, int *swap);
+
+srvrec_t *srvNew(void);
+void srvDelete(srvrec_t *srvp);
+
+int  srvRead(int fileID, srvrec_t *srvp);
+int  srvWrite(int fileID, srvrec_t *srvp);
+
+int  srvInqHeader(srvrec_t *srvp, int *header);
+int  srvInqDataSP(srvrec_t *srvp, float *data);
+int  srvInqDataDP(srvrec_t *srvp, double *data);
+
+int  srvDefHeader(srvrec_t *srvp, const int *header);
+int  srvDefDataSP(srvrec_t *srvp, const float *data);
+int  srvDefDataDP(srvrec_t *srvp, const double *data);
+
+
+#endif  /* _SERVICE_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _STREAM_SRV_H
+#define _STREAM_SRV_H
+
+#ifndef _SERVICE_H
+#  include "service.h"
+#endif
+
+int    srvInqContents(int streamID);
+int    srvInqTimestep(int streamID, int tsID);
+
+int    srvInqRecord(int streamID, int *varID, int *levelID);
+int    srvDefRecord(int streamID);
+int    srvCopyRecord(int streamIDdest, int streamIDsrc);
+int    srvReadRecord(int streamID, double *data, int *nmiss);
+int    srvWriteRecord(int streamID, const double *data);
+
+void   srvReadVarDP (int streamID, int varID,       double *data, int *nmiss);
+void   srvWriteVarDP(int streamID, int varID, const double *data);
+
+void   srvReadVarSliceDP (int streamID, int varID, int levelID,       double *data, int *nmiss);
+void   srvWriteVarSliceDP(int streamID, int varID, int levelID, const double *data);
+
+#endif  /* _STREAM_SRV_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _STREAM_EXT_H
+#define _STREAM_EXT_H
+
+#ifndef _EXTRA_H
+#  include "extra.h"
+#endif
+
+int    extInqContents(int streamID);
+int    extInqTimestep(int streamID, int tsID);
+
+int    extInqRecord(int streamID, int *varID, int *levelID);
+int    extDefRecord(int streamID);
+int    extCopyRecord(int streamIDdest, int streamIDsrc);
+int    extReadRecord(int streamID, double *data, int *nmiss);
+int    extWriteRecord(int streamID, const double *data);
+
+void   extReadVarDP (int streamID, int varID,       double *data, int *nmiss);
+void   extWriteVarDP(int streamID, int varID, const double *data);
+
+void   extReadVarSliceDP (int streamID, int varID, int levelID,       double *data, int *nmiss);
+void   extWriteVarSliceDP(int streamID, int varID, int levelID, const double *data);
+
+#endif  /* _STREAM_EXT_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _STREAM_IEG_H
+#define _STREAM_IEG_H
+
+#ifndef _IEG_H
+#  include "ieg.h"
+#endif
+
+int    iegInqContents(int streamID);
+int    iegInqTimestep(int streamID, int tsID);
+
+int    iegInqRecord(int streamID, int *varID, int *levelID);
+int    iegDefRecord(int streamID);
+int    iegCopyRecord(int streamIDdest, int streamIDsrc);
+int    iegReadRecord(int streamID, double *data, int *nmiss);
+int    iegWriteRecord(int streamID, const double *data);
+
+void   iegReadVarDP (int streamID, int varID,       double *data, int *nmiss);
+void   iegWriteVarDP(int streamID, int varID, const double *data);
+
+void   iegReadVarSliceDP (int streamID, int varID, int levelID,       double *data, int *nmiss);
+void   iegWriteVarSliceDP(int streamID, int varID, int levelID, const double *data);
+
+#endif  /* _STREAM_IEG_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _CDF_INT_H
+#define _CDF_INT_H
+
+#if  defined  (HAVE_LIBNETCDF)
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+#include "netcdf.h"
+
+void cdf_create (const char *path, int cmode, int *idp);
+int  cdf_open   (const char *path, int omode, int *idp);
+void cdf_close  (int ncid);
+
+void cdf_redef (int ncid);
+void cdf_enddef (int ncid);
+void cdf_sync (int ncid);
+
+void cdf_inq (int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp);
+
+void cdf_def_dim (int ncid, const char *name, size_t len, int *idp);
+void cdf_inq_dimid (int ncid, const char *name, int *dimidp);
+void cdf_inq_dim (int ncid, int dimid, char *name, size_t * lengthp);
+void cdf_inq_dimname (int ncid, int dimid, char *name);
+void cdf_inq_dimlen (int ncid, int dimid, size_t * lengthp);
+void cdf_def_var (int ncid, const char *name, nc_type xtype, int ndims,
+		 const int dimids[], int *varidp);
+void cdf_inq_varid (int ncid, const char *name, int *varidp);
+void cdf_inq_nvars (int ncid, int *nvarsp);
+void cdf_inq_var (int ncid, int varid, char *name, nc_type *xtypep,
+		 int *ndimsp, int dimids[], int *nattsp);
+void cdf_inq_varname (int ncid, int varid, char *name);
+void cdf_inq_vartype (int ncid, int varid, nc_type *xtypep);
+void cdf_inq_varndims (int ncid, int varid, int *ndimsp);
+void cdf_inq_vardimid (int ncid, int varid, int dimids[]);
+void cdf_inq_varnatts (int ncid, int varid, int *nattsp);
+
+void cdf_copy_att (int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out);
+void cdf_put_var_text   (int ncid, int varid, const char *tp);
+void cdf_put_var_uchar  (int ncid, int varid, const unsigned char *up);
+void cdf_put_var_schar  (int ncid, int varid, const signed char *cp);
+void cdf_put_var_short  (int ncid, int varid, const short *sp);
+void cdf_put_var_int    (int ncid, int varid, const int *ip);
+void cdf_put_var_long   (int ncid, int varid, const long *lp);
+void cdf_put_var_float  (int ncid, int varid, const float *fp);
+void cdf_put_var_double (int ncid, int varid, const double *dp);
+
+void cdf_get_var_text   (int ncid, int varid, char *tp);
+void cdf_get_var_uchar  (int ncid, int varid, unsigned char *up);
+void cdf_get_var_schar  (int ncid, int varid, signed char *cp);
+void cdf_get_var_short  (int ncid, int varid, short *sp);
+void cdf_get_var_int    (int ncid, int varid, int *ip);
+void cdf_get_var_long   (int ncid, int varid, long *lp);
+void cdf_get_var_float  (int ncid, int varid, float *fp);
+void cdf_get_var_double (int ncid, int varid, double *dp);
+
+void cdf_get_var1_text(int ncid, int varid, const size_t index[], char *tp);
+
+void cdf_get_var1_double(int ncid, int varid, const size_t index[], double *dp);
+void cdf_put_var1_double(int ncid, int varid, const size_t index[], const double *dp);
+
+void cdf_get_vara_text(int ncid, int varid, const size_t start[],
+		       const size_t count[], char *tp);
+
+void cdf_get_vara_double(int ncid, int varid, const size_t start[],
+                         const size_t count[], double *dp);
+void cdf_put_vara_double(int ncid, int varid, const size_t start[],
+                         const size_t count[], const double *dp);
+
+void cdf_get_vara_float(int ncid, int varid, const size_t start[],
+                        const size_t count[], float *fp);
+void cdf_put_vara_float(int ncid, int varid, const size_t start[],
+                        const size_t count[], const float *fp);
+
+void cdf_put_att_text (int ncid, int varid, const char *name, size_t len,
+		      const char *tp);
+void cdf_put_att_int (int ncid, int varid, const char *name, nc_type xtype,
+		     size_t len, const int *ip);
+void cdf_put_att_double (int ncid, int varid, const char *name, nc_type xtype,
+			size_t len, const double *dp);
+
+void cdf_get_att_text (int ncid, int varid, char *name, char *tp);
+void cdf_get_att_int (int ncid, int varid, char *name, int *ip);
+void cdf_get_att_double (int ncid, int varid, char *name, double *dp);
+
+void cdf_inq_att (int ncid, int varid, const char *name, nc_type * xtypep,
+		 size_t * lenp);
+void cdf_inq_atttype (int ncid, int varid, const char *name, nc_type *xtypep);
+void cdf_inq_attlen (int ncid, int varid, const char *name, size_t *lenp);
+void cdf_inq_attname (int ncid, int varid, int attnum, char *name);
+void cdf_inq_attid (int ncid, int varid, const char *name, int *attnump);
+
+#endif
+
+#endif  /* _CDF_INT_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _CDF_H
+#define _CDF_H
+
+void cdfDebug(int debug);
+
+const char *cdfLibraryVersion(void);
+const char *hdfLibraryVersion(void);
+
+int  cdfOpen(const char *filename, const char *mode);
+int  cdfOpen64(const char *filename, const char *mode);
+int  cdf4Open(const char *filename, const char *mode, int *filetype);
+void cdfClose(int fileID);
+
+#endif  /* _CDF_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _VLIST_H
+#define _VLIST_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stddef.h>  /* size_t */
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+#ifndef _CDI_LIMITS_H
+#  include "cdi_limits.h"
+#endif
+
+#define VALIDMISS 1.e+303
+
+/*
+ * CDI attribute
+ */
+typedef struct {
+  size_t    xsz;	  /* amount of space at xvalue                      */
+  size_t    namesz;       /* size of name                                   */
+  char     *name;         /* attribute name                                 */
+  int       indtype;	  /* internal data type of xvalue (INT, FLT or TXT) */
+  int       exdtype;      /* external data type                             */
+                          /* indtype    exdtype                             */
+                          /* TXT        TXT                                 */
+                          /* INT        INT16, INT32                        */
+                          /* FLT        FLT32, FLT64                        */
+  size_t    nelems;    	  /* number of elements                             */
+  void     *xvalue;       /* the actual data                                */
+} cdi_att_t;
+
+
+typedef struct {
+  size_t     nalloc;		/* number allocated >= nelems */
+  size_t     nelems;		/* length of the array */
+  cdi_att_t  value[MAX_ATTRIBUTES];
+} cdi_atts_t;
+
+
+typedef struct
+{
+  int      flag;
+  int      index;
+  int      mlevelID;
+  int      flevelID;
+}
+levinfo_t;
+
+
+typedef struct
+{
+  int      rank;
+  int      offset;
+  int      chunk;
+}
+deco_t;
+
+typedef struct
+{
+  int ens_index;
+  int ens_count;
+  int forecast_init_type;
+}
+ensinfo_t;
+
+
+typedef struct
+{
+  int         flag;
+  int         nlevs;
+  int         isUsed;
+  int         mvarID;
+  int         fvarID;
+  int         param;
+  int         gridID;
+  int         zaxisID;
+  int         tsteptype; /* TSTEP_* */
+  int         datatype;  /* DATATYPE_PACKX for GRIB data, else DATATYPE_FLT32 or DATATYPE_FLT64 */
+  int         instID;
+  int         modelID;
+  int         tableID;
+  int         timave;
+  int         timaccu;
+  int         chunktype;
+  int         xyz;
+  int         missvalused; /* TRUE if missval is defined */
+  int         lvalidrange;
+  char       *name;
+  char       *longname;
+  char       *stdname;
+  char       *units;
+  double      missval;
+  double      scalefactor;
+  double      addoffset;
+  double      validrange[2];
+  levinfo_t  *levinfo;
+  int         comptype;     // compression type
+  int         complevel;    // compression level
+  ensinfo_t  *ensdata;      /* Ensemble information */
+  cdi_atts_t  atts;
+  int         iorank;
+  int         decoSize;
+  deco_t     *deco;
+
+}
+var_t;
+
+
+typedef struct
+{
+  int         self;
+  int         nvars;        /* number of variables                */
+  int         ngrids;
+  int         nzaxis;
+  int         ntsteps;
+  int         taxisID;
+  int         tableID;
+  int         instID;
+  int         modelID;
+  int         varsAllocated;
+  int         gridIDs[MAX_GRIDS_PS];
+  int         zaxisIDs[MAX_ZAXES_PS];
+  var_t      *vars;
+  cdi_atts_t  atts;
+}
+vlist_t;
+
+
+vlist_t *vlist_to_pointer(int vlistID);
+const char *vlistInqVarNamePtr(int vlistID, int varID);
+const char *vlistInqVarLongnamePtr(int vlistID, int varID);
+const char *vlistInqVarStdnamePtr(int vlistID, int varID);
+const char *vlistInqVarUnitsPtr(int vlistID, int varID);
+void     vlistDestroyVarName(int vlistID, int varID);
+void     vlistDestroyVarLongname(int vlistID, int varID);
+void     vlistDestroyVarUnits(int vlistID, int varID);
+void     vlistDefVarTsteptype(int vlistID, int varID, int tsteptype);
+int      vlistInqVarMissvalUsed(int vlistID, int varID);
+int      vlistHasTime(int vlistID);
+
+int      vlistDelAtts(int vlistID, int varID);
+int      vlistCopyVarAtts(int vlistID1, int varID_1, int vlistID2, int varID_2);
+
+#ifdef USE_MPI
+void     vlistUnpack(char * buffer, int bufferSize, int * pos, int, MPI_Comm comm);
+void     vlistDefVarDeco ( int vlistID, int varID, int decoSize, 
+                              deco_t * deco );
+#endif
+
+/*      vlistDefVarValidrange: Define the valid range of a Variable */
+void    vlistDefVarValidrange(int vlistID, int varID, const double *validrange);
+
+/*      vlistInqVarValidrange: Get the valid range of a Variable */
+int     vlistInqVarValidrange(int vlistID, int varID, double *validrange);
+
+#endif  /* _VLIST_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef VLIST_VAR_H
+#define VLIST_VAR_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+#ifndef _VLIST_H
+#include "vlist.h"
+#endif
+
+int  vlistInqVarDecoChunk ( int, int, int );
+int  vlistInqVarDecoOff   ( int, int, int );
+
+#ifdef USE_MPI
+int  vlistVarGetSize(vlist_t *p, int varID, MPI_Comm comm);
+void vlistVarPack(vlist_t *p, int varID,
+                  char * buffer, int bufferSize, int * pos, MPI_Comm comm);
+void vlistVarUnpack(int vlistID,
+                    char * buf, int size, int *position, int, MPI_Comm comm);
+void vlistDefVarIOrank    ( int, int, int );
+int  vlistInqVarIOrank    ( int, int );
+#endif
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef VLIST_ATT_H
+#define VLIST_ATT_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+#ifdef USE_MPI
+
+int
+vlistAttsGetSize(vlist_t *p, int varID, MPI_Comm comm);
+
+void
+vlistAttsPack(vlist_t *p, int varID,
+              void * buf, int size, int *position, MPI_Comm comm);
+
+void
+vlistAttsUnpack(int vlistID, int varID,
+                void * buf, int size, int *position, MPI_Comm comm);
+
+#endif
+
+#endif
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef MODEL_H
+#define MODEL_H
+
+#ifdef USE_MPI
+int
+modelUnpack(void *buf, int size, int *position,
+            int, MPI_Comm comm);
+#endif
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef INSTITUTION_H
+#define INSTITUTION_H
+
+#ifdef USE_MPI
+int
+instituteUnpack(void *buf, int size, int *position, int,
+                MPI_Comm comm);
+#endif
+
+#endif
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef NAMESPACE_H
+#define NAMESPACE_H
+
+typedef enum {
+  STAGE_DEFINITION = 0,
+  STAGE_TIMELOOP   = 1,
+  STAGE_CLEANUP    = 2
+} statusCode;
+
+typedef struct {
+  int idx;
+  int nsp;
+  statusCode resStatus;
+} namespaceTuple_t;
+
+void             namespaceCleanup      ( void );
+void             namespaceInit         ( int, int * );
+void             namespaceShowbits     ( int, char * );
+int              namespaceGetNumber    ( void );
+int              namespaceGetActive    ( void );
+int              namespaceIdxEncode    ( namespaceTuple_t );
+int              namespaceIdxEncode2   ( int, int );
+namespaceTuple_t namespaceResHDecode   ( int );
+int              namespaceHasLocalFile ( int );
+int              namespaceAdaptKey     ( int, int );
+int              namespaceAdaptKey2    ( int );
+void             namespaceDefResStatus ( statusCode );
+statusCode       namespaceInqResStatus ( void );
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef RESOURCE_HANDLE_H
+#define RESOURCE_HANDLE_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include <mpi.h>
+#include <stdlib.h>
+#endif
+
+/*
+ * CDI internal handling of resource handles given to user code
+ */
+
+/*
+ * for reasons of compatibility with cfortran.h, the handle type is: int
+ */
+typedef int cdiResH;
+
+/* return 0 on equality, not 0 otherwise */
+typedef int    ( * valCompareFunc     )( void *, void * );
+typedef void   ( * valDestroyFunc     )( void * );
+typedef void   ( * valPrintFunc       )( void *, FILE * );
+#ifdef USE_MPI
+typedef int    ( * valGetPackSizeFunc )( void *, MPI_Comm comm );
+typedef void   ( * valPackFunc        )( void *, void *buf, int size, int *pos, MPI_Comm comm );
+typedef int    ( * valTxCodeFunc      )( void );
+#endif
+
+typedef struct {
+  valCompareFunc     valCompare;
+  valDestroyFunc     valDestroy;
+  valPrintFunc       valPrint;
+#ifdef USE_MPI
+  valGetPackSizeFunc valGetPackSize;
+  valPackFunc        valPack;
+  valTxCodeFunc      valTxCode;
+#endif
+}resOps;
+
+enum { RESH_UNDEFID, ASSIGNED, SUSPENDED, CLOSED };
+
+int    reshPut ( void *, resOps * );
+void   reshRemove ( cdiResH, resOps * );
+
+int    reshCountType ( resOps * );
+
+void * reshGetVal ( cdiResH, resOps * );
+
+void   reshGetResHListOfType ( int, int *, resOps * );
+
+#ifdef USE_MPI
+void   reshPackBufferCreate ( char **, int *, MPI_Comm );
+void   reshPackBufferDestroy ( char ** );
+#endif
+
+void   reshSetStatus ( cdiResH, resOps *, int );
+int    reshGetStatus ( cdiResH, resOps * );
+
+void   reshLock   ( void );
+void   reshUnlock ( void );
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef PIO_UTIL_
+#define PIO_UTIL_
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef USE_MPI
+#include "mpi.h"
+#endif
+
+
+#define MAXSTRLNNETCDF    32
+#define MAXBUFFERSIZE     32
+#define MAXVALUE          10
+#define MAXDEBUG           3
+#define MAXLEVELINFOS     10
+#define MAXVARS           10
+
+#define MAXLEVEL          10
+#define MAXLEVELIDX       10
+#define MAXRECORDS        10
+#define MAXRECIDS         10
+#define MAXVARS           10
+#define MAXTSTEPS         10
+#define MAXFNAMES         10
+#define MAXGHBUFFERSIZE_0 10
+#define MAXGHBUFFERSIZE_1 10
+
+#define MAXSTRING        256
+#define MINFILETYPE        1
+#define MAXFILETYPE        9
+
+#define ddebug             0
+
+#define debugString "#####"
+
+/* If we're not using GNU C, elide __attribute__ */
+#ifndef __GNUC__
+#  define  __attribute__(x)  /*NOTHING*/
+#endif
+
+void pcdiAssert   ( bool, const char *, const char *, int );
+#define xassert(arg) do {                               \
+    if ((arg)) {                                        \
+    } else {                                            \
+      pcdiAssert(0, __FILE__, __func__, __LINE__ );     \
+    }                                                   \
+  } while(0)
+
+#ifdef USE_MPI
+#define xdebug(fmt, ...)                                                \
+  if ( ddebug ){                                                        \
+    int rank;                                                           \
+    {                                                                   \
+      int init_flag;                                                    \
+      if (MPI_Initialized(&init_flag) == MPI_SUCCESS && init_flag)      \
+        MPI_Comm_rank ( MPI_COMM_WORLD, &rank );                        \
+      else                                                              \
+        rank = -1;                                                      \
+    }                                                                   \
+    fprintf ( stderr, "%s pe%d in %s, %s, line %d: " fmt "\n",          \
+              debugString, rank,  __func__, __FILE__,  __LINE__,        \
+              __VA_ARGS__ );                                            \
+  }
+
+#else
+#define xdebug(fmt, ...)                                           \
+  if ( ddebug ){                                                   \
+    fprintf ( stderr, "%s %s, %s, line %d: " fmt "\n",             \
+              debugString, __func__, __FILE__,  __LINE__,          \
+              __VA_ARGS__ );                                       \
+  }
+#endif
+
+
+#ifdef USE_MPI
+#define xdebug3(fmt, ...)					\
+  if ( ddebug == MAXDEBUG ){                                    \
+    int rank;                                                   \
+    MPI_Comm_rank ( MPI_COMM_WORLD, &rank );                    \
+    fprintf ( stderr, "pe%d in %s, %s, line %d: " fmt "\n",     \
+              rank,  __func__, __FILE__,  __LINE__,             \
+              __VA_ARGS__ );                                    \
+  }
+
+#else
+#define xdebug3(fmt, ...)					\
+  if ( ddebug == MAXDEBUG ){                                    \
+    fprintf ( stderr, "%s, %s, line %d: " fmt "\n",             \
+              __func__, __FILE__,  __LINE__,                    \
+              __VA_ARGS__ );                                 \
+  }
+#endif
+/*
+#ifdef USE_MPI
+char * outTextComm ( MPI_Comm * );
+
+#define xdebugComm(comm,fmt, ...)				\
+  if ( ddebug ){						\
+    fprintf ( stderr, "%s%s, %s, line %d%s: " fmt "\n",		\
+	      outTextRank (),  __func__, __FILE__,  __LINE__,	\
+	      outTextComm ( comm ),				\
+	      ## __VA_ARGS__  );				\
+    }
+#endif
+*/
+
+#ifdef USE_MPI
+#define xwarning(fmt, ...)						\
+  if ( ddebug ){							\
+    int rank;								\
+    MPI_Comm_rank ( MPI_COMM_WORLD, &rank );				\
+    fprintf ( stderr, "WARNING: pe%d in %s, %s, line %d: " fmt "\n",	\
+              rank,  __func__, __FILE__,  __LINE__,			\
+              __VA_ARGS__ );						\
+  }
+#else
+#define xwarning(fmt, ...)					\
+  if ( ddebug ){                                                \
+    fprintf ( stderr, "WARNING: %s, %s, line %d: " fmt "\n",    \
+              __func__, __FILE__,  __LINE__,                    \
+              __VA_ARGS__ );                                 \
+  }
+#endif
+
+void pcdiAbort (const char *, const char *, int, const char *, ... )
+  __attribute__((noreturn));
+#define xabort(...) pcdiAbort(__FILE__, __func__, __LINE__, __VA_ARGS__ )
+
+void * pcdiXmalloc ( size_t, const char *, const char *, int );
+#define xmalloc(size) pcdiXmalloc ( size, __FILE__, __func__,  __LINE__ )
+
+void * pcdiXcalloc ( size_t, size_t, const char *, const char *, int );
+#define xcalloc(nmemb,size) pcdiXcalloc(nmemb, size,            \
+                                        __FILE__, __func__, __LINE__)
+
+void * pcdiXrealloc ( void *, size_t, const char *, const char *, int );
+#define xrealloc(p,size) pcdiXrealloc(p, size,            \
+                                      __FILE__, __func__, __LINE__)
+
+void pcdiXMPI ( int, const char *, int );
+#define xmpi(ret) pcdiXMPI ( ret, __FILE__, __LINE__ )
+
+#ifdef USE_MPI
+void pcdiXMPIStat ( int, const char *, int, MPI_Status * );
+#define xmpiStat(ret,stat) pcdiXMPIStat ( ret, __FILE__, __LINE__, stat )
+
+void pcdiDebugComm ( const char *filename, const char *functionname, int line, \
+                     MPI_Comm *comm );
+#define xdebugComm(comm)\
+  if ( ddebug ) pcdiDebugComm (  __FILE__, __func__, __LINE__, comm )
+#endif
+
+void pcdiDebugMsg ( const char * cdiDebugString, const char *filename, const char *functionname, int line, \
+                    int tag, int source, int nfinished );
+#define xdebugMsg(tag,source,nfinished) \
+  if ( ddebug ) \
+      pcdiDebugMsg ( debugString, __FILE__, __func__, __LINE__, tag, source, nfinished )
+
+void pcdiDebugMsg2 ( const char *filename, const char *functionname, int line, \
+                    int tag, int source, char * text );
+#define xdebugMsg2(tag,source,text) \
+  if ( ddebug ) pcdiDebugMsg ( __FILE__, __func__,  __LINE__, tag, source, text )
+
+int xmaxInt ( int, int );
+int xminInt ( int, int );
+int xsum ( int, int * );
+
+double xchecksum ( int, int, void * );
+ 
+void printArray ( const char *, char *, const void *, int, int, const char *, const char *, int );
+#define xprintArray(ps,array,n,datatype)                                \
+  if ( ddebug )                                                         \
+      printArray ( debugString, ps, array, n, datatype,  __func__, __FILE__, __LINE__ )
+ 
+#define xprintArray3(ps,array,n,datatype)                                \
+  if ( ddebug == MAXDEBUG )                                                         \
+      printArray ( debugString, ps, array, n, datatype,  __func__, __FILE__, __LINE__ )
+
+
+void reshListPrint ( char * );
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _PIO_H
+#define _PIO_H
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include <stdlib.h>
+#include <mpi.h>
+
+void   backendCleanup  ( void );
+void   backendInit     ( void );
+void   backendFinalize ( void );
+int    pioFileOpenW    ( const char* );
+int    pioFileClose    ( int );
+size_t pioFileWrite    ( int, int, const void*, size_t );
+
+#endif
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _PIO_IMPL_H
+#define _PIO_IMPL_H
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <stdbool.h>
+
+#ifdef USE_MPI
+#include "mpi.h"
+
+typedef enum 
+{
+  IO_Open_file,
+  IO_Close_file,
+  IO_Get_fp,
+  IO_Set_fp,
+  IO_Send_buffer,
+  IO_Finalize
+} IO_Server_command;
+
+struct dBuffer
+{
+  size_t wr_pointer;
+  size_t size;
+  unsigned char * buffer;
+};
+
+typedef int ( * valDestroyFunction ) ( void * );
+typedef bool (*eqPredicate)(void *, void *);
+
+typedef struct listSet listSet;
+
+struct fileOpTag
+{
+  int id;
+  int command;
+};
+
+/* pio.c */
+int encodeFileOpTag(int fileID, int command);
+struct fileOpTag decodeFileOpTag(int);
+
+/* pio_dbuffer.c */
+int       dbuffer_init ( struct dBuffer **, size_t );
+int       dbuffer_push(struct dBuffer *, const void *, size_t);
+size_t    dbuffer_data_size ( struct dBuffer * );
+int       dbuffer_reset ( struct dBuffer * );
+void      dbuffer_cleanup ( struct dBuffer ** );
+
+/* pio_list_set.c */
+listSet *listSetNew(valDestroyFunction, eqPredicate);
+void listSetDelete(listSet *);
+int listSetAdd(listSet *, void *);
+bool listSetIsEmpty(listSet *);
+int listSetRemove(listSet *, int (*predicate)(void *, void *),
+                  void *data);
+void *listSetGet(listSet *q, int (*predicate)(void *, void *), void *data);
+
+typedef void (*elemOp)(void *elem, void *data);
+void listSetForeach(listSet *q, elemOp func, void *data);
+
+/* pio_mpinonb.c */
+int       fowMPINONB ( const char * );
+int       fcMPINONB ( int );
+size_t    fwMPINONB( int, int, const void *, size_t );
+void      initMPINONB ( void );
+void      finalizeMPINONB ( void );
+
+
+/* common functionality for file split between collectors and writer(s) */
+int pioSendClose(int);
+int pioSendOpen(const char *);
+size_t pioSendWrite(int, int, const void *, size_t);
+void pioSendInitialize(void);
+void pioSendFinalize(void);
+
+
+/* pio_posixasynch.c */
+#ifndef _SX
+void pioWriterAIO(void);
+#endif
+
+/* pio_posixfpguardsendrecv.c */
+void      fpgPOSIXFPGUARDSENDRECV ( void );
+int       fowPOSIXFPGUARDSENDRECV ( const char * );
+int       fcPOSIXFPGUARDSENDRECV ( int );
+size_t    fwPOSIXFPGUARDSENDRECV ( int, int, const void *, size_t );
+void      initPOSIXFPGUARDSENDRECV ( void );
+void      finalizePOSIXFPGUARDSENDRECV ( void );
+
+/* pio_posixnonb.c */
+void pioWriterStdIO(void);
+
+#endif
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if  defined  (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <errno.h>
+
+
+#if ! defined (HAVE_CONFIG_H)
+#if ! defined (HAVE_MALLOC_H)
+#  if defined (SX)
+#    define  HAVE_MALLOC_H
+#  endif
+#endif
+#endif
+
+#if  defined  (HAVE_MALLOC_H)
+#    include <malloc.h>
+#endif
+
+
+#define  MALLOC_FUNC   0
+#define  CALLOC_FUNC   1
+#define  REALLOC_FUNC  2
+#define  FREE_FUNC     3
+
+#undef   UNDEFID
+#define  UNDEFID  -1
+
+#define  MAXNAME  32   /* Min = 8, for  "unknown" ! */
+
+int dmemory_ExitOnError = 0;
+
+typedef struct
+{
+  void     *ptr;
+  int       item;
+  size_t    size;
+  size_t    nobj;
+  int       mtype;
+  int       line;
+  char      file[MAXNAME];
+  char      caller[MAXNAME];
+}
+MemTable;
+
+static MemTable *memTable;
+static int     memTableSize  = 0;
+static long    memAccess     = 0;
+
+static size_t  MemObjs       = 0;
+static size_t  MaxMemObjs    = 0;
+static size_t  MemUsed       = 0;
+static size_t  MaxMemUsed    = 0;
+
+static int     MEM_Debug     = 0;   /* If set to 1, debugging */
+
+void memDebug(int debug)
+{
+  MEM_Debug = debug;
+}
+
+static
+void memInternalProblem(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+  printf("\n");
+   fprintf(stderr, "Internal problem (%s) : ", caller);
+  vfprintf(stderr, fmt, args);
+   fprintf(stderr, "\n");
+
+  va_end(args);
+
+  exit(EXIT_FAILURE);
+}
+
+static
+void memError(const char *caller, const char *file, int line, size_t size)
+{
+  printf("\n");
+  fprintf(stderr, "Error (%s) : Allocation of %lu bytes failed. [ line %d file %s ]\n",
+	  caller, (unsigned long) size, line, file);
+
+  if ( errno )
+    perror("System error message ");
+	
+  exit(EXIT_FAILURE);
+}
+
+static
+void memListPrintEntry(int mtype, int item, size_t size, void *ptr,
+		       const char *caller, const char *file, int line)
+{
+  switch (mtype)
+    {
+    case MALLOC_FUNC:
+      fprintf(stderr, "[%-7s ", "Malloc");
+      break;
+    case CALLOC_FUNC:
+      fprintf(stderr, "[%-7s ", "Calloc");
+      break;
+    case REALLOC_FUNC:
+      fprintf(stderr, "[%-7s ", "Realloc");
+      break;
+    case FREE_FUNC:
+      fprintf(stderr, "[%-7s ", "Free");
+      break;
+    }
+
+   fprintf(stderr, "memory item %3d ", item);
+   fprintf(stderr, "(%6lu byte) ", (unsigned long) size);
+   fprintf(stderr, "at %p", ptr);
+   if ( file != NULL )
+     {
+       fprintf(stderr, " line %4d", line);
+       fprintf(stderr, " file %s", file);
+     }    
+   if ( caller != NULL )
+     fprintf(stderr, " (%s)", caller);     
+   fprintf(stderr, "]\n");
+}
+
+static
+void memListPrintTable(void)
+{
+  int memID, item, item1, item2 = 0;
+
+  if ( MemObjs ) fprintf(stderr, "\nMemory table:\n");
+
+  /* find maximum item */
+  for ( memID = 0; memID < memTableSize; memID++ )
+    if ( memTable[memID].item != UNDEFID )
+      if ( memTable[memID].item > item2 ) item2 = memTable[memID].item;
+
+  /* find minimum item */
+  item1 = item2;
+  for ( memID = 0; memID < memTableSize; memID++ )
+    if ( memTable[memID].item != UNDEFID )
+      if ( memTable[memID].item < item1 ) item1 = memTable[memID].item;
+
+  for ( item = item1; item <= item2; item++ )
+    for ( memID = 0; memID < memTableSize; memID++ )
+      {
+	if ( memTable[memID].item == item )
+	  memListPrintEntry(memTable[memID].mtype, memTable[memID].item,
+			    memTable[memID].size*memTable[memID].nobj,
+			    memTable[memID].ptr, memTable[memID].caller,
+			    memTable[memID].file, memTable[memID].line);
+      }
+
+  if ( MemObjs )
+    {
+      fprintf(stderr, "  Memory access             : %6u\n", (unsigned) memAccess);
+      fprintf(stderr, "  Maximum objects           : %6u\n", (unsigned) memTableSize);
+      fprintf(stderr, "  Objects used              : %6u\n", (unsigned) MaxMemObjs);
+      fprintf(stderr, "  Objects in use            : %6u\n", (unsigned) MemObjs);
+      fprintf(stderr, "  Memory allocated          : ");
+      if (MemUsed > 1024*1024*1024)
+	fprintf(stderr, " %5d GB\n",   (int) (MemUsed/(1024*1024*1024)));
+      else if (MemUsed > 1024*1024)
+	fprintf(stderr, " %5d MB\n",   (int) (MemUsed/(1024*1024)));
+      else if (MemUsed > 1024)
+	fprintf(stderr, " %5d KB\n",   (int) (MemUsed/(1024)));
+      else
+	fprintf(stderr, " %5d Byte\n", (int)  MemUsed);
+    }
+
+  if ( MaxMemUsed )
+    {
+      fprintf(stderr, "  Maximum memory allocated  : ");
+      if (MaxMemUsed > 1024*1024*1024)
+	fprintf(stderr, " %5d GB\n",   (int) (MaxMemUsed/(1024*1024*1024)));
+      else if (MaxMemUsed > 1024*1024)
+	fprintf(stderr, " %5d MB\n",   (int) (MaxMemUsed/(1024*1024)));
+      else if (MaxMemUsed > 1024)
+	fprintf(stderr, " %5d KB\n",   (int) (MaxMemUsed/(1024)));
+      else
+	fprintf(stderr, " %5d Byte\n", (int)  MaxMemUsed);
+    }
+}
+
+static
+void memGetDebugLevel(void)
+{
+  char *debugLevel;
+
+  debugLevel = getenv("MEMORY_DEBUG");
+
+  if ( debugLevel )
+    {
+      if ( isdigit((int) debugLevel[0]) )
+	MEM_Debug = atoi(debugLevel);
+
+      if ( MEM_Debug )
+	atexit(memListPrintTable);
+    }
+}
+
+static
+void memInit(void)
+{
+  static int initDebugLevel = 0;
+
+  if ( ! initDebugLevel )
+    {
+      memGetDebugLevel();
+      initDebugLevel = 1;
+    }  
+}
+
+static
+int memListDeleteEntry(void *ptr, size_t *size)
+{
+  int memID = 0;
+  int item = UNDEFID;
+
+  for ( memID = 0; memID < memTableSize; memID++ )
+    {
+      if ( memTable[memID].item == UNDEFID ) continue;
+      if ( memTable[memID].ptr == ptr ) break;
+    }
+
+  if ( memID != memTableSize )
+    {
+      MemObjs--;
+      MemUsed -= memTable[memID].size * memTable[memID].nobj;
+      *size = memTable[memID].size * memTable[memID].nobj;
+       item = memTable[memID].item;
+       memTable[memID].item   = UNDEFID;
+    }
+
+  return (item);
+}
+
+static
+void memTableInitEntry(int memID)
+{
+  if ( memID < 0 || memID >= memTableSize )
+    memInternalProblem(__func__, "memID %d undefined!", memID);
+
+  memTable[memID].ptr    = NULL;
+  memTable[memID].item   = UNDEFID;
+  memTable[memID].size   = 0;
+  memTable[memID].nobj   = 0;
+  memTable[memID].mtype  = UNDEFID;
+  memTable[memID].line   = UNDEFID;
+}
+
+static
+int memListNewEntry(int mtype, void *ptr, size_t size, size_t nobj,
+		    const char *caller, const char *file, int line)
+{
+  static int item = 0;
+  size_t memSize = 0;
+  int memID = 0;
+  size_t len;
+  int i;
+
+  /*
+    Look for a free slot in memTable.
+    (Create the table the first time through).
+  */
+  if ( memTableSize == 0 )
+    {
+      memTableSize = 8;
+      memSize  = memTableSize*sizeof(MemTable);
+      memTable = (MemTable *) malloc(memSize);
+      if( memTable == NULL ) memError(__func__, __FILE__, __LINE__, memSize);
+
+      for( i = 0; i < memTableSize; i++ )
+	memTableInitEntry(i);
+    }
+  else
+    {
+      while( memID < memTableSize )
+	{
+	  if ( memTable[memID].item == UNDEFID ) break;
+	  memID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if ( memID == memTableSize )
+    {
+      memTableSize = 2*memTableSize;
+      memSize  = memTableSize*sizeof(MemTable);
+      memTable = (MemTable *) realloc(memTable, memSize);
+      if( memTable == NULL ) memError(__func__, __FILE__, __LINE__, memSize);
+
+      for( i = memID; i < memTableSize; i++ )
+	memTableInitEntry(i);
+    }
+
+  memTable[memID].item  = item;
+  memTable[memID].ptr   = ptr;
+  memTable[memID].size  = size;
+  memTable[memID].nobj  = nobj;
+  memTable[memID].mtype = mtype;
+  memTable[memID].line  = line;
+
+  if ( file )
+    {
+      len = strlen(file);
+      if ( len > MAXNAME-1 ) len = MAXNAME-1;
+    
+      (void) memcpy(memTable[memID].file, file, len);
+      memTable[memID].file[len] = '\0';
+    }
+  else
+    {
+      (void) strcpy(memTable[memID].file, "unknown");
+    }
+
+  if ( caller )
+    {
+      len = strlen(caller);
+      if ( len > MAXNAME-1 ) len = MAXNAME-1;
+
+      (void) memcpy(memTable[memID].caller, caller, len);
+      memTable[memID].caller[len] = '\0';
+    }
+  else
+    {
+      (void) strcpy(memTable[memID].caller, "unknown");
+    }
+
+  MaxMemObjs++;
+  MemObjs++;
+  MemUsed += size*nobj;
+  if ( MemUsed > MaxMemUsed ) MaxMemUsed = MemUsed;
+
+  return (item++);
+}
+
+static
+int memListChangeEntry(void *ptrold, void *ptr, size_t size,
+		       const char *caller, const char *file, int line)
+{
+  int item = UNDEFID;
+  int memID = 0;
+  size_t len;
+  size_t sizeold;
+
+  while( memID < memTableSize )
+    {
+      if ( memTable[memID].item != UNDEFID )
+	if ( memTable[memID].ptr == ptrold ) break;
+      memID++;
+    }
+
+  if ( memID == memTableSize )
+    {
+      if ( ptrold != NULL )
+	memInternalProblem(__func__, "Item at %p not found.", ptrold);
+    }
+  else
+    {
+      item = memTable[memID].item;
+
+      sizeold = memTable[memID].size*memTable[memID].nobj;
+      
+      memTable[memID].ptr   = ptr;
+      memTable[memID].size  = size;
+      memTable[memID].nobj  = 1;
+      memTable[memID].mtype = REALLOC_FUNC;
+      memTable[memID].line  = line;
+
+      if ( file )
+	{
+	  len = strlen(file);
+	  if ( len > MAXNAME-1 ) len = MAXNAME-1;
+
+	  (void) memcpy(memTable[memID].file, file, len);
+	  memTable[memID].file[len] = '\0';
+	}
+      else
+	{
+	  (void) strcpy(memTable[memID].file, "unknown");
+	}
+
+      if ( caller )
+	{
+	  len = strlen(caller);
+	  if ( len > MAXNAME-1 ) len = MAXNAME-1;
+
+	  (void) memcpy(memTable[memID].caller, caller, len);
+	  memTable[memID].caller[len] = '\0';
+	}
+      else
+	{
+	  (void) strcpy(memTable[memID].caller, "unknown");
+	}
+
+      MemUsed -= sizeold;
+      MemUsed += size;
+      if ( MemUsed > MaxMemUsed ) MaxMemUsed = MemUsed;
+    }
+
+  return (item);
+}
+
+
+void *Calloc(const char *caller, const char *file, int line, size_t nobjs, size_t size)
+{
+  void *ptr = NULL;
+  int item = UNDEFID;
+
+  memInit();
+
+  if ( nobjs*size > 0 )
+    {
+      ptr = calloc(nobjs, size);
+
+      if ( MEM_Debug )
+	{
+	  memAccess++;
+
+	  if ( ptr )
+	    item = memListNewEntry(CALLOC_FUNC, ptr, size, nobjs, caller, file, line);
+
+	  memListPrintEntry(CALLOC_FUNC, item, size*nobjs, ptr, caller, file, line);
+	}
+
+      if ( ptr == NULL && dmemory_ExitOnError )
+	memError(caller, file, line, size*nobjs);
+    }
+  else
+    fprintf(stderr, "Warning (%s) : Allocation of 0 bytes! [ line %d file %s ]\n", caller, line, file);
+
+  return(ptr);
+}
+
+
+void *Malloc(const char *caller, const char *file, int line, size_t size)
+{
+  void *ptr = NULL;
+  int item = UNDEFID;
+
+  memInit();
+
+  if ( size > 0 )
+    {
+      ptr = malloc(size);
+
+      if ( MEM_Debug )
+	{
+	  memAccess++;
+
+	  if ( ptr )
+	    item = memListNewEntry(MALLOC_FUNC, ptr, size, 1, caller, file, line);
+
+	  memListPrintEntry(MALLOC_FUNC, item, size, ptr, caller, file, line);
+	}
+
+      if ( ptr == NULL && dmemory_ExitOnError )
+	memError(caller, file, line, size);
+    }
+  else
+    fprintf(stderr, "Warning (%s) : Allocation of 0 bytes! [ line %d file %s ]\n", caller, line, file);
+
+  return (ptr);
+}
+
+
+void *Realloc(const char *caller, const char *file, int line, void *ptrold, size_t size)
+{
+  void *ptr = NULL;
+  int item = UNDEFID;
+
+  memInit();
+
+  if ( size > 0 )
+    {
+      ptr = realloc(ptrold, size);
+
+      if ( MEM_Debug )
+	{
+	  memAccess++;
+
+	  if ( ptr )
+	    {
+	      item = memListChangeEntry(ptrold, ptr, size, caller, file, line);
+
+	      if ( item == UNDEFID )
+		item = memListNewEntry(REALLOC_FUNC, ptr, size, 1, caller, file, line);
+	    }
+
+	  memListPrintEntry(REALLOC_FUNC, item, size, ptr, caller, file, line);
+	}
+
+      if ( ptr == NULL && dmemory_ExitOnError )
+	memError(caller, file, line, size);
+    }
+  else
+    fprintf(stderr, "Warning (%s) : Allocation of 0 bytes! [ line %d file %s ]\n", caller, line, file);
+
+  return (ptr);
+}
+
+
+void Free(const char *caller, const char *file, int line, void *ptr)
+{
+  int item;
+  size_t size;
+
+  memInit();
+
+  if ( MEM_Debug )
+    {
+      if ( (item = memListDeleteEntry(ptr, &size)) >= 0 )
+	{
+	  memListPrintEntry(FREE_FUNC, item, size, ptr, caller, file, line);
+	}
+      else
+	{
+	  if ( ptr )
+	    fprintf(stderr, "%s info: memory entry at %p not found. [line %4d file %s (%s)]\n",
+		    __func__, ptr, line, file, caller);
+	}
+    }
+
+  free(ptr);
+}
+
+
+size_t memTotal(void)
+{
+  size_t memtotal = 0;
+#if  defined  (HAVE_MALLINFO)
+  struct mallinfo meminfo = mallinfo();
+  if ( MEM_Debug )
+    {
+      fprintf(stderr, "arena      %8ld (non-mmapped space allocated from system)\n", (unsigned long) meminfo.arena);
+      fprintf(stderr, "ordblks    %8ld (number of free chunks)\n", (unsigned long) meminfo.ordblks);
+      fprintf(stderr, "smblks     %8ld (number of fastbin blocks)\n", (unsigned long) meminfo.smblks);
+      fprintf(stderr, "hblks      %8ld (number of mmapped regions)\n", (unsigned long) meminfo.hblks);
+      fprintf(stderr, "hblkhd     %8ld (space in mmapped regions)\n", (unsigned long) meminfo.hblkhd);
+      fprintf(stderr, "usmblks    %8ld (maximum total allocated space)\n", (unsigned long) meminfo.usmblks);
+      fprintf(stderr, "fsmblks    %8ld (maximum total allocated space)\n", (unsigned long) meminfo.fsmblks);
+      fprintf(stderr, "uordblks   %8ld (total allocated space)\n", (unsigned long) meminfo.uordblks);
+      fprintf(stderr, "fordblks   %8ld (total free space)\n", (unsigned long) meminfo.fordblks);
+      fprintf(stderr, "Memory in use:   %8ld bytes\n", (unsigned long) meminfo.usmblks + meminfo.uordblks);
+      fprintf(stderr, "Total heap size: %8ld bytes\n", (unsigned long) meminfo.arena);
+
+      /* malloc_stats(); */
+    }
+  memtotal = meminfo.arena;
+#endif
+
+  return (memtotal);
+}
+
+
+void memExitOnError(void)
+{
+  dmemory_ExitOnError = 1;
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _DMEMORY_H
+#define _DMEMORY_H
+
+#include <stdlib.h>
+
+/*
+ * if DEBUG_MEMORY is defined setenv MEMORY_DEBUG to debug memory
+ */
+
+#define  DEBUG_MEMORY
+
+#ifndef  WITH_CALLER_NAME
+#define  WITH_CALLER_NAME
+#endif
+
+extern size_t  memTotal(void);
+extern void    memDebug(int debug);
+extern void    memExitOnError(void);
+
+#if  defined  DEBUG_MEMORY
+
+extern void   *Realloc(const char *caller, const char *file, int line, void *ptr, size_t size);
+extern void   *Calloc (const char *caller, const char *file, int line, size_t nmemb, size_t size);
+extern void   *Malloc (const char *caller, const char *file, int line, size_t size);
+extern void    Free   (const char *caller, const char *file, int line, void *ptr);
+
+#if  defined  calloc
+#  undef  calloc
+#endif
+
+#if  defined  WITH_CALLER_NAME
+#  define  realloc(p, s)  Realloc(__func__, __FILE__, __LINE__, p, (size_t)s)
+#  define   calloc(n, s)   Calloc(__func__, __FILE__, __LINE__, n, (size_t)s)
+#  define   malloc(s)      Malloc(__func__, __FILE__, __LINE__, (size_t)s)
+#  define     free(p)        Free(__func__, __FILE__, __LINE__, p)
+#else
+#  define  realloc(p, s)  Realloc((void *) NULL, __FILE__, __LINE__, p, (size_t)s)
+#  define   calloc(n, s)   Calloc((void *) NULL, __FILE__, __LINE__, n, (size_t)s)
+#  define   malloc(s)      Malloc((void *) NULL, __FILE__, __LINE__, (size_t)s)
+#  define     free(p)        Free((void *) NULL, __FILE__, __LINE__, p)
+#endif
+
+#endif /* DEBUG_MEMORY */
+
+#endif /* _DMEMORY_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <errno.h>
+
+
+int _ExitOnError   = 1;	/* If set to 1, exit on error       */
+int _Verbose = 1;	/* If set to 1, errors are reported */
+int _Debug   = 0;       /* If set to 1, debugging           */
+
+
+void SysError_(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+  printf("\n");
+   fprintf(stderr, "Error (%s) : ", caller);
+  vfprintf(stderr, fmt, args);
+   fprintf(stderr, "\n");
+
+  va_end(args);
+
+  if ( errno )
+    perror("System error message ");
+	
+  exit(EXIT_FAILURE);
+}
+
+
+void Error_(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+  printf("\n");
+   fprintf(stderr, "Error (%s) : ", caller);
+  vfprintf(stderr, fmt, args);
+   fprintf(stderr, "\n");
+
+  va_end(args);
+
+  if ( _ExitOnError ) exit(EXIT_FAILURE);
+}
+
+
+void Warning_(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+  if ( _Verbose )
+    {
+       fprintf(stderr, "Warning (%s) : ", caller);
+      vfprintf(stderr, fmt, args);
+       fprintf(stderr, "\n");
+    }
+
+  va_end(args);
+}
+
+
+void Message_(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+   fprintf(stdout, "%-18s : ", caller);
+  vfprintf(stdout, fmt, args);
+   fprintf(stdout, "\n");
+
+  va_end(args);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _ERROR_H
+#define _ERROR_H
+
+#ifndef  WITH_CALLER_NAME
+#define  WITH_CALLER_NAME
+#endif
+
+#define  _FATAL     1     /* Error flag: exit on error  */
+#define  _VERBOSE   2     /* Error flag: report errors  */
+#define  _DEBUG     4     /* Error flag: debug          */
+
+extern int _ExitOnError;  /* If set to 1, exit on error (default 1)       */
+extern int _Verbose;      /* If set to 1, errors are reported (default 1) */
+extern int _Debug;        /* If set to 1, debuggig (default 0)            */
+
+void SysError_(const char *caller, const char *fmt, ...);
+void    Error_(const char *caller, const char *fmt, ...);
+void  Warning_(const char *caller, const char *fmt, ...);
+void  Message_(const char *caller, const char *fmt, ...);
+
+#if  defined  WITH_CALLER_NAME
+#  define  SysError(...)  SysError_(__func__, __VA_ARGS__)
+#  define    Errorc(...)     Error_(  caller, __VA_ARGS__)
+#  define     Error(...)     Error_(__func__, __VA_ARGS__)
+#  define   Warning(...)   Warning_(__func__, __VA_ARGS__)
+#  define  Messagec(...)   Message_(  caller, __VA_ARGS__)
+#  define   Message(...)   Message_(__func__, __VA_ARGS__)
+#else
+#  define  SysError(...)  SysError_((void *), __VA_ARGS__)
+#  define    Errorc(...)     Error_((void *), __VA_ARGS__)
+#  define     Error(...)     Error_((void *), __VA_ARGS__)
+#  define   Warning(...)   Warning_((void *), __VA_ARGS__)
+#  define  Messagec(...)   Message_((void *), __VA_ARGS__)
+#  define   Message(...)   Message_((void *), __VA_ARGS__)
+#endif
+
+#endif  /* _ERROR_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifndef _STREAM_INT_H
+#define _STREAM_INT_H
+
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <sys/types.h>
+
+#ifndef strdupx
+#ifndef strdup
+char *strdup(const char *s);
+#endif
+#define strdupx  strdup
+/*
+#define strdupx(s)			          \
+({					      	  \
+   const char *__old = (s);			  \
+   size_t __len = strlen(__old) + 1;		  \
+   char *__new = (char *) malloc(__len);	  \
+   (char *) memcpy(__new, __old, __len);	  \
+})
+*/
+#endif
+
+#ifndef  M_PI
+#define  M_PI        3.14159265358979323846  /* pi */
+#endif
+
+
+#ifndef  _ERROR_H
+#endif
+#ifndef _BASETIME_H
+#endif
+#ifndef _TIMEBASE_H
+#endif
+#ifndef  _TAXIS_H
+#endif
+#ifndef  _CDI_LIMITS_H
+#endif
+#ifndef  _SERVICE_H
+#endif
+#ifndef  _EXTRA_H
+#endif
+#ifndef  _IEG_H
+#endif
+
+
+#define check_parg(arg)  if ( arg == 0 ) Warning("Argument '" #arg "' not allocated!")
+
+#if defined (__xlC__) /* performance problems on IBM */
+#ifndef DBL_IS_NAN
+#  define DBL_IS_NAN(x)     ((x) != (x))
+#endif
+#else
+#ifndef DBL_IS_NAN
+#if  defined  (HAVE_DECL_ISNAN)
+#  define DBL_IS_NAN(x)     (isnan(x))
+#elif  defined  (FP_NAN)
+#  define DBL_IS_NAN(x)     (fpclassify(x) == FP_NAN)
+#else
+#  define DBL_IS_NAN(x)     ((x) != (x))
+#endif
+#endif
+#endif
+
+#ifndef DBL_IS_EQUAL
+/*#define DBL_IS_EQUAL(x,y) (!(x < y || y < x)) */
+#  define DBL_IS_EQUAL(x,y) (DBL_IS_NAN(x)||DBL_IS_NAN(y)?(DBL_IS_NAN(x)&&DBL_IS_NAN(y)?1:0):!(x < y || y < x))
+#endif
+
+#ifndef IS_EQUAL
+#  define IS_NOT_EQUAL(x,y) (x < y || y < x)
+#  define IS_EQUAL(x,y)     (!IS_NOT_EQUAL(x,y))
+#endif
+
+
+#ifndef INT
+#  define  INT(x)  ((int)(x))
+#endif
+
+#ifndef NINT
+#  define  NINT(x)  ((x) < 0 ? (int)((x)-.5) : (int)((x)+.5))
+#endif
+
+#define  FALSE  0
+#define  TRUE   1
+
+#define  TYPE_REC  0
+#define  TYPE_VAR  1
+
+#define  MEMTYPE_DOUBLE  1
+#define  MEMTYPE_FLOAT   2
+
+typedef struct
+{
+  void     *buffer;
+  size_t    buffersize;
+  off_t     position;
+  int       recsize;
+  int       size;
+  int       dataread;
+  int       param;
+  int       level;
+  int       date;
+  int       time;
+  int       gridID;
+  int       zaxisID;
+  int       used;
+  int       nrec;
+  int       varID;
+  int       levelID;
+  int       recid;
+  int       prec;
+  int       sec0[2];
+  int       sec1[1024];
+  int       sec2[4096];
+  int       sec3[2];
+  int       sec4[512];
+#if  defined  (HAVE_LIBSERVICE)
+  srvrec_t   *srvp;
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+  extrec_t   *extp;
+#endif
+#if  defined  (HAVE_LIBIEG)
+  iegrec_t   *iegp;
+#endif
+}
+Record;
+
+
+typedef struct
+{
+  off_t     position;
+  size_t    size;
+  int       zip;
+  int       param;
+  int       ilevel;
+  int       ilevel2;
+  int       ltype;
+  short     used;
+  short     varID;
+  short     levelID;
+}
+record_t;
+
+
+typedef struct {
+  record_t *records;
+  int       recordSize;  /* number of allocated records           */
+  int      *recIDs;      /* IDs of non constant records           */
+  int       nrecs;       /* number of used records                */
+                         /* tsID=0 nallrecs                       */
+                         /* tsID>0 number of non constant records */
+  int       nallrecs;    /* number of all records                 */
+  int       curRecID;    /* current record ID                     */
+  long      next;
+  off_t     position;    /* timestep file position                */
+  taxis_t   taxis;
+}
+tsteps_t;
+
+
+typedef struct {
+  int       ncvarid;
+  int       nlevs;
+  int      *level;       /* record IDs */
+  int      *lindex;      /* level index */
+  int       defmiss;     /* TRUE if missval is defined in file */
+
+  int       isUsed;
+  int       gridID;
+  int       zaxisID;
+  int       tsteptype;   /* TSTEP_* */
+}
+svarinfo_t;
+
+
+typedef struct {
+  int       ilev;
+  int       mlev;
+  int       ilevID;
+  int       mlevID;
+}
+VCT;
+
+
+typedef struct {
+  int         self;
+  int         accesstype;   /* TYPE_REC or TYPE_VAR */
+  int         accessmode;
+  int         filetype;
+  int         byteorder;
+  int         fileID;
+  int         dimgroupID;
+  int         filemode;
+  off_t       numvals;
+  char       *filename;
+  Record     *record;
+  int        nrecs;        /* number of records                  */
+  int         nvars;        /* number of variables                */
+  int         varlocked;    /* variables locked                   */
+  svarinfo_t *vars;
+  int         varsAllocated;
+  int         varinit;
+  int         curTsID;      /* current timestep ID */
+  int         rtsteps;      /* number of tsteps accessed       */
+  long        ntsteps;      /* number of tsteps : only set if all records accessed */
+  int         numTimestep;  /* number of tsteps : only set if all records accessed */
+  tsteps_t   *tsteps;
+  int         tstepsTableSize;
+  int         tstepsNextID;
+  BaseTime    basetime;
+  int         ncmode;
+  int         vlistID;
+  int         xdimID[MAX_GRIDS_PS];
+  int         ydimID[MAX_GRIDS_PS];
+  int         zaxisID[MAX_ZAXES_PS];
+  int         ncxvarID[MAX_GRIDS_PS];
+  int         ncyvarID[MAX_GRIDS_PS];
+  int         ncavarID[MAX_GRIDS_PS];
+  int         historyID;
+  int         globalatts;
+  int         localatts;
+  VCT         vct;
+  int         unreduced;
+  int         sortname;
+  int         have_missval;
+  int         comptype;      // compression type
+  int         complevel;     // compression level
+  int         curfile;
+  int         nfiles;
+  char      **fnames;
+#if defined (GRIBCONTAINER2D)
+  void      **gribContainers;
+#else
+  void       *gribContainers;
+#endif
+  int         vlistIDorig;
+}
+stream_t;
+
+
+extern int CDI_Debug;      /* If set to 1, debuggig (default 0)            */
+extern double cdiDefaultMissval;
+extern int cdiDefaultInstID;
+extern int cdiDefaultModelID;
+extern int cdiDefaultTableID;
+extern int cdiDefaultLeveltype;
+extern int cdiNcMissingValue;
+extern int cdiNcChunksizehint;
+extern int cdiChunkType;
+extern int cdiSplitLtype105;
+
+extern char *cdiPartabPath;
+extern int   cdiPartabIntern;
+
+stream_t *stream_to_pointer(int idx);
+stream_t *stream_new_entry(void);
+void stream_delete_entry(stream_t *streamptr);
+void stream_check_ptr(const char *caller, stream_t *streamptr);
+
+int     streamInqFileID(int streamID);
+
+int     zaxisInqLevelID(int zaxisID, double level);
+char   *gridNamePtr(int gridtype);
+char   *zaxisNamePtr(int leveltype);
+
+void    streamCheckID(const char *caller, int streamID);
+
+void    streamDefineTaxis(int streamID);
+
+int     streamsNewEntry(int filetype);
+void    streamsInitEntry(int streamID);
+int     streamNewVar(int streamID, int gridID, int zaxisID);
+
+int     tstepsNewEntry(int streamID);
+
+char   *strfiletype(int filetype);
+
+void    cdiGenVars(int streamID);
+
+void    cdiCheckContents(int streamID);
+
+void    cdiCreateRecords(int streamID, int tsID);
+
+int     recordNewEntry(int streamID, int tsID);
+
+void    cdiCreateTimesteps(int streamID);
+
+void    recordInitEntry(record_t *record);
+
+void    cdiCheckZaxis(int zaxisID);
+
+void    cdiPrintDatatypes(void);
+
+void    cdiDefAccesstype(int streamID, int type);
+int     cdiInqAccesstype(int streamID);
+
+void    streamDefDimgroupID(int streamID, int dimgroupID);
+int     streamInqDimgroupID(int streamID);
+
+int     getByteswap(int byteorder);
+
+int     streamSize ();
+void    streamGetIndexList ( int, int * );
+
+
+void  cdiInitialize(void);
+
+void stream_write_record(int streamID, int memtype, const void *data, int nmiss);
+
+
+#endif  /* _STREAM_INT_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <string.h>
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+
+
+extern int cdiDefaultCalendar;
+
+static int DefaultTimeType = TAXIS_ABSOLUTE;
+static int DefaultTimeUnit = TUNIT_HOUR;
+
+
+char *Timeunits[] = {
+  "undefined",
+  "seconds",
+  "minutes",
+  "hours",
+  "days",
+  "months",
+  "years",
+  "quarters",
+  "3hours",
+  "6hours",
+  "12hours",
+};
+
+
+static int    taxisCompareP    ( void * taxisptr1, void * taxisptr2 );
+static void   taxisDestroyP    ( void * taxisptr );
+static void   taxisPrintP      ( void * taxisptr, FILE * fp );
+#ifdef USE_MPI
+static int    taxisGetPackSize ( void * taxisptr, MPI_Comm comm );
+static void   taxisPack        ( void * taxisptr, void *buf, int size,
+				 int *position, MPI_Comm comm );
+static int    taxisTxCode      ( void );
+#endif
+
+resOps taxisOps = { taxisCompareP, taxisDestroyP, taxisPrintP
+#ifdef USE_MPI
+                    , taxisGetPackSize, taxisPack, taxisTxCode
+#endif
+};
+
+
+static int  TAXIS_Debug = 0;   /* If set to 1, debugging */
+
+
+char *tunitNamePtr(int unitID)
+{
+  char *name;
+  int size = sizeof(Timeunits)/sizeof(char *);
+
+  if ( unitID > 0 && unitID < size )
+    name = Timeunits[unitID];
+  else
+    name = Timeunits[0];
+
+  return (name);
+}
+
+#if 0
+static
+void taxis_defaults(void)
+{
+  char *timeunit;
+
+  timeunit = getenv("TIMEUNIT");
+  if ( timeunit )
+    {
+      if ( strcmp(timeunit, "minutes") == 0 )
+	DefaultTimeUnit = TUNIT_MINUTE;
+      else if ( strcmp(timeunit, "hours") == 0 )
+	DefaultTimeUnit = TUNIT_HOUR;
+      else if ( strcmp(timeunit, "3hours") == 0 )
+	DefaultTimeUnit = TUNIT_3HOURS;
+      else if ( strcmp(timeunit, "6hours") == 0 )
+	DefaultTimeUnit = TUNIT_6HOURS;
+      else if ( strcmp(timeunit, "12hours") == 0 )
+	DefaultTimeUnit = TUNIT_12HOURS;
+      else if ( strcmp(timeunit, "days") == 0 )
+	DefaultTimeUnit = TUNIT_DAY;
+      else if ( strcmp(timeunit, "months") == 0 )
+	DefaultTimeUnit = TUNIT_MONTH;
+      else if ( strcmp(timeunit, "years") == 0 )
+	DefaultTimeUnit = TUNIT_YEAR;
+      else
+	Warning("Unsupported TIMEUNIT %s!", timeunit);
+    }
+}
+#endif
+
+static
+void taxisDefaultValue ( taxis_t *taxisptr )
+{
+  taxisptr->self        = CDI_UNDEFID;
+  taxisptr->used        = FALSE;
+  taxisptr->type        = DefaultTimeType;
+  taxisptr->vdate       = 0;
+  taxisptr->vtime       = 0;
+  taxisptr->rdate       = CDI_UNDEFID;
+  taxisptr->rtime       = 0;
+  taxisptr->calendar    = cdiDefaultCalendar;
+  taxisptr->unit        = DefaultTimeUnit;
+  taxisptr->numavg      = 0;
+  taxisptr->has_bounds  = FALSE;
+  taxisptr->vdate_lb    = 0;
+  taxisptr->vtime_lb    = 0;
+  taxisptr->vdate_ub    = 0;
+  taxisptr->vtime_ub    = 0;
+  taxisptr->name        = NULL;
+  taxisptr->longname    = NULL;
+}
+
+static
+taxis_t *taxisNewEntry(void)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = (taxis_t *) xmalloc ( sizeof ( taxis_t ));
+
+  taxisDefaultValue ( taxisptr );
+  taxisptr->self = reshPut (( void * ) taxisptr, &taxisOps );
+
+  return (taxisptr);
+}
+
+static
+void taxisInit (void)
+{
+  static int taxisInitialized = 0;
+  char *env;
+
+  if ( taxisInitialized ) return;
+
+  taxisInitialized = 1; 
+
+  env = getenv("TAXIS_DEBUG");
+  if ( env ) TAXIS_Debug = atoi(env);
+}
+
+#if 0
+static
+void taxis_copy(taxis_t *taxisptr2, taxis_t *taxisptr1)
+{
+  int taxisID2;
+
+  taxisID2 = taxisptr2->self;
+  memcpy(taxisptr2, taxisptr1, sizeof(taxis_t));
+  taxisptr2->self = taxisID2;
+}
+#endif
+
+static
+void taxis_check_ptr(const char *caller, taxis_t *taxisptr)
+{
+  if ( taxisptr == NULL )
+    Errorc("taxis undefined!");
+}
+
+/*
+ at Function  taxisCreate
+ at Title     Create a Time axis
+
+ at Prototype int taxisCreate(int taxistype)
+ at Parameter
+    @Item  taxistype  The type of the Time axis, one of the set of predefined CDI time axis types.
+                      The valid CDI time axis types are @func{TAXIS_ABSOLUTE} and @func{TAXIS_RELATIVE}.
+
+ at Description
+The function @func{taxisCreate} creates a Time axis.
+
+ at Result
+ at func{taxisCreate} returns an identifier to the Time axis.
+
+ at Example
+Here is an example using @func{taxisCreate} to create a relative T-axis
+with a standard calendar.
+
+ at Source
+   ...
+int taxisID;
+   ...
+taxisID = taxisCreate(TAXIS_RELATIVE);
+taxisDefCalendar(taxisID, CALENDAR_STANDARD);
+taxisDefRdate(taxisID, 19850101);
+taxisDefRtime(taxisID, 120000);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int taxisCreate(int taxistype)
+{
+  int taxisID;
+  taxis_t *taxisptr;
+
+  if ( CDI_Debug )
+    Message("taxistype: %d", taxistype);
+
+  taxisInit ();
+
+  taxisptr = taxisNewEntry();
+
+  taxisID = taxisptr->self;
+  taxisptr->type = taxistype;
+
+  if ( CDI_Debug )
+    Message("taxisID: %d", taxisID);
+
+  return (taxisID);
+}
+
+static
+void taxisDestroyKernel( taxis_t * taxisptr )
+{
+  int id;
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  id = taxisptr->self;
+
+  free ( taxisptr );
+
+  reshRemove ( id, &taxisOps );
+}
+
+/*
+ at Function  taxisDestroy
+ at Title     Destroy a Time axis
+
+ at Prototype void taxisDestroy(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @func{taxisCreate}
+
+ at EndFunction
+*/
+void taxisDestroy(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  if ( taxisptr->name     ) free(taxisptr->name);
+  if ( taxisptr->longname ) free(taxisptr->longname);
+
+  taxisDestroyKernel ( taxisptr );
+}
+
+
+void taxisDestroyP( void * taxisptr )
+{
+  taxisDestroyKernel (( taxis_t * ) taxisptr );
+}
+
+
+int taxisDuplicate(int taxisID1)
+{
+  int taxisID2;
+  taxis_t *taxisptr1;
+  taxis_t *taxisptr2;
+
+  taxisptr1 = ( taxis_t * ) reshGetVal ( taxisID1, &taxisOps );
+
+  taxisptr2 = taxisNewEntry();
+  if ( ! taxisptr2 ) Error("No memory");
+
+  taxisID2 = taxisptr2->self;
+
+  if ( CDI_Debug )
+    Message("taxisID2: %d", taxisID2);
+
+  ptaxisCopy(taxisptr2, taxisptr1);
+  if ( taxisptr1->name     ) taxisptr2->name = strdup(taxisptr1->name);
+  if ( taxisptr1->longname ) taxisptr2->longname = strdup(taxisptr1->longname);
+
+  // taxisptr2->has_bounds = FALSE;
+
+  return (taxisID2);
+}
+
+
+void taxisDefType(int taxisID, int type)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->type = type;
+}
+
+/*
+ at Function  taxisDefVdate
+ at Title     Define the verification date
+
+ at Prototype void taxisDefVdate(int taxisID, int vdate)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+    @Item  vdate    Verification date (YYYYMMDD)
+
+ at Description
+The function @func{taxisDefVdate} defines the verification date of a Time axis.
+
+ at EndFunction
+*/
+void taxisDefVdate(int taxisID, int vdate)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->vdate = vdate;
+}
+
+/*
+ at Function  taxisDefVtime
+ at Title     Define the verification time
+
+ at Prototype void taxisDefVtime(int taxisID, int vtime)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+    @Item  vtime    Verification time (hhmmss)
+
+ at Description
+The function @func{taxisDefVtime} defines the verification time of a Time axis.
+
+ at EndFunction
+*/
+void taxisDefVtime(int taxisID, int vtime)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->vtime = vtime;
+}
+
+/*
+ at Function  taxisDefRdate
+ at Title     Define the reference date
+
+ at Prototype void taxisDefRdate(int taxisID, int rdate)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+    @Item  rdate    Reference date (YYYYMMDD)
+
+ at Description
+The function @func{taxisDefVdate} defines the reference date of a Time axis.
+
+ at EndFunction
+*/
+void taxisDefRdate(int taxisID, int rdate)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->rdate = rdate;
+}
+
+/*
+ at Function  taxisDefRtime
+ at Title     Define the reference time
+
+ at Prototype void taxisDefRtime(int taxisID, int rtime)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+    @Item  rtime    Reference time (hhmmss)
+
+ at Description
+The function @func{taxisDefVdate} defines the reference time of a Time axis.
+
+ at EndFunction
+*/
+void taxisDefRtime(int taxisID, int rtime)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->rtime = rtime;
+}
+
+/*
+ at Function  taxisDefCalendar
+ at Title     Define the calendar
+
+ at Prototype void taxisDefCalendar(int taxisID, int calendar)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+    @Item  calendar The type of the calendar, one of the set of predefined CDI calendar types.
+                    The valid CDI calendar types are @func{CALENDAR_STANDARD}, @func{CALENDAR_PROLEPTIC}, 
+                    @func{CALENDAR_360DAYS}, @func{CALENDAR_365DAYS} and @func{CALENDAR_366DAYS}.
+
+ at Description
+The function @func{taxisDefCalendar} defines the calendar of a Time axis.
+
+ at EndFunction
+*/
+void taxisDefCalendar(int taxisID, int calendar)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->calendar = calendar;
+}
+
+
+void taxisDefTunit(int taxisID, int unit)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->unit = unit;
+}
+
+
+void taxisDefNumavg(int taxisID, int numavg)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->numavg = numavg;
+}
+
+/*
+The type of the time axis, one of the set of predefined CDI time types.
+The valid CDI time types are TAXIS_ABSOLUTE and TAXIS_RELATIVE.
+*/
+int taxisInqType(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->type);
+}
+
+
+int taxisHasBounds(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->has_bounds);
+}
+
+
+void taxisDeleteBounds(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->has_bounds = FALSE;
+}
+
+
+void taxisCopyTimestep(int taxisID2, int taxisID1)
+{
+  taxis_t *taxisptr1;
+  taxis_t *taxisptr2;
+
+  taxisptr1 = ( taxis_t * ) reshGetVal ( taxisID1, &taxisOps );
+  taxisptr2 = ( taxis_t * ) reshGetVal ( taxisID2, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr1);
+  taxis_check_ptr(__func__, taxisptr2);
+
+  reshLock ();
+
+  taxisptr2->rdate = taxisptr1->rdate;
+  taxisptr2->rtime = taxisptr1->rtime;
+
+  taxisptr2->vdate = taxisptr1->vdate;
+  taxisptr2->vtime = taxisptr1->vtime;
+
+  if ( taxisptr2->has_bounds )
+    {
+      taxisptr2->vdate_lb = taxisptr1->vdate_lb;
+      taxisptr2->vtime_lb = taxisptr1->vtime_lb;
+      taxisptr2->vdate_ub = taxisptr1->vdate_ub;
+      taxisptr2->vtime_ub = taxisptr1->vtime_ub;
+    }
+
+  reshUnlock ();
+}
+
+/*
+ at Function  taxisInqVdate
+ at Title     Get the verification date
+
+ at Prototype int taxisInqVdate(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{taxisInqVdate} returns the verification date of a Time axis.
+
+ at Result
+ at func{taxisInqVdate} returns the verification date.
+
+ at EndFunction
+*/
+int taxisInqVdate(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->vdate);
+}
+
+
+void taxisInqVdateBounds(int taxisID, int *vdate_lb, int *vdate_ub)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  *vdate_lb = taxisptr->vdate_lb;
+  *vdate_ub = taxisptr->vdate_ub;
+}
+
+
+void taxisDefVdateBounds(int taxisID, int vdate_lb, int vdate_ub)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->vdate_lb = vdate_lb;
+  taxisptr->vdate_ub = vdate_ub;
+ 
+  taxisptr->has_bounds = TRUE;
+}
+
+/*
+ at Function  taxisInqVtime
+ at Title     Get the verification time
+
+ at Prototype int taxisInqVtime(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{taxisInqVtime} returns the verification time of a Time axis.
+
+ at Result
+ at func{taxisInqVtime} returns the verification time.
+
+ at EndFunction
+*/
+int taxisInqVtime(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->vtime);
+}
+
+
+void taxisInqVtimeBounds(int taxisID, int *vtime_lb, int *vtime_ub)
+{
+  taxis_t *taxisptr;
+  
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  *vtime_lb = taxisptr->vtime_lb;
+  *vtime_ub = taxisptr->vtime_ub;
+}
+
+
+void taxisDefVtimeBounds(int taxisID, int vtime_lb, int vtime_ub)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->vtime_lb = vtime_lb;
+  taxisptr->vtime_ub = vtime_ub;
+ 
+  taxisptr->has_bounds = TRUE;
+}
+
+/*
+ at Function  taxisInqRdate
+ at Title     Get the reference date
+
+ at Prototype int taxisInqRdate(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{taxisInqRdate} returns the reference date of a Time axis.
+
+ at Result
+ at func{taxisInqVdate} returns the reference date.
+
+ at EndFunction
+*/
+int taxisInqRdate(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  if ( taxisptr->rdate == -1 )
+    {
+      taxisptr->rdate = taxisptr->vdate;
+      taxisptr->rtime = taxisptr->vtime;
+    }
+
+  return (taxisptr->rdate);
+}
+
+/*
+ at Function  taxisInqRtime
+ at Title     Get the reference time
+
+ at Prototype int taxisInqRtime(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{taxisInqRtime} returns the reference time of a Time axis.
+
+ at Result
+ at func{taxisInqVtime} returns the reference time.
+
+ at EndFunction
+*/
+int taxisInqRtime(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  if ( taxisptr->rdate == -1 )
+    {
+      taxisptr->rdate = taxisptr->vdate;
+      taxisptr->rtime = taxisptr->vtime;
+    }
+
+  return (taxisptr->rtime);
+}
+
+/*
+ at Function  taxisInqCalendar
+ at Title     Get the calendar
+
+ at Prototype int taxisInqCalendar(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{taxisInqCalendar} returns the calendar of a Time axis.
+
+ at Result
+ at func{taxisInqCalendar} returns the type of the calendar,
+one of the set of predefined CDI calendar types.
+The valid CDI calendar types are @func{CALENDAR_STANDARD}, @func{CALENDAR_PROLEPTIC}, 
+ at func{CALENDAR_360DAYS}, @func{CALENDAR_365DAYS} and @func{CALENDAR_366DAYS}.
+
+ at EndFunction
+*/
+int taxisInqCalendar(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->calendar);
+}
+
+
+int taxisInqTunit(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->unit);
+}
+
+
+int taxisInqNumavg(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->numavg);
+}
+
+
+taxis_t *taxisPtr(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr);
+}
+
+
+void cdiDecodeTimevalue(int timeunit, double timevalue, int *days, int *secs)
+{
+  static int lwarn = TRUE;
+
+  if ( timeunit == TUNIT_MINUTE )
+    {
+      timevalue *= 60;
+      timeunit = TUNIT_SECOND;
+    }
+  else if ( timeunit == TUNIT_HOUR )
+    {
+      timevalue /= 24;
+      timeunit = TUNIT_DAY;
+    }
+
+  if ( timeunit == TUNIT_SECOND )
+    {
+      *days = (int) (timevalue/86400);
+      *secs = (int) (timevalue - *days*86400.);
+      if ( *secs < 0 ) { *days -= 1; *secs += 86400; };
+      /*
+      {
+	double cval = *days*86400. + *secs;
+	if ( cval != timevalue )
+	  printf("TUNIT_SECOND error: %g %g %d %d\n", timevalue, cval, *days, *secs);
+      }
+      */
+    }
+  else if ( timeunit == TUNIT_DAY )
+    {
+      *days = (int) timevalue;
+      *secs = (int) ((timevalue - *days)*86400 + 0.5);
+      if ( *secs < 0 ) { *days -= 1; *secs += 86400; };
+      /*
+      {
+	double cval = *days + *secs/86400.;
+	if ( cval != timevalue )
+	  printf("TUNIT_DAY error: %g %g %d %d\n", timevalue, cval, *days, *secs);
+      }
+      */
+    }
+  else
+    {
+      if ( lwarn )
+	{
+	  Warning("timeunit %s unsupported!", tunitNamePtr(timeunit));
+	  lwarn = FALSE;
+	}
+    }
+}
+
+static
+void cdiEncodeTimevalue(int days, int secs, int timeunit, double *timevalue)
+{
+  static int lwarn = TRUE;
+
+  if ( timeunit == TUNIT_SECOND )
+    {
+      *timevalue = days*86400. + secs;
+    }
+  else if ( timeunit == TUNIT_MINUTE ||
+	    timeunit == TUNIT_QUARTER )
+    {
+      *timevalue = days*1440. + secs/60.;
+    }
+  else if ( timeunit == TUNIT_HOUR   ||
+	    timeunit == TUNIT_3HOURS ||
+	    timeunit == TUNIT_6HOURS ||
+	    timeunit == TUNIT_12HOURS )
+    {
+      *timevalue = days*24. + secs/3600.;
+    }
+  else if ( timeunit == TUNIT_DAY )
+    {
+      *timevalue = days + secs/86400.;
+    }
+  else
+    {
+      if ( lwarn )
+	{
+	  Warning("timeunit %s unsupported!", tunitNamePtr(timeunit));
+	  lwarn = FALSE;
+	}
+    }
+}
+
+int days_per_month(int calendar, int year, int month);
+
+void timeval2vtime(double timevalue, taxis_t *taxis, int *vdate, int *vtime)
+{
+  int year, month, day, hour, minute, second;
+  int rdate, rtime;
+  int timeunit;
+  int calendar;
+  int julday, secofday, days, secs;
+
+  *vdate = 0;
+  *vtime = 0;
+
+  timeunit = (*taxis).unit;
+  calendar = (*taxis).calendar;
+
+  rdate  = (*taxis).rdate;
+  rtime  = (*taxis).rtime;
+
+  if ( rdate == 0 && rtime == 0 && DBL_IS_EQUAL(timevalue, 0.) ) return;
+
+  cdiDecodeDate(rdate, &year, &month, &day);
+  cdiDecodeTime(rtime, &hour, &minute, &second);
+
+  if ( timeunit == TUNIT_MONTH && calendar == CALENDAR_360DAYS )
+    {
+      timeunit = TUNIT_DAY;
+      timevalue *= 30;
+    }
+
+  if ( timeunit == TUNIT_MONTH || timeunit == TUNIT_YEAR )
+    {
+      int nmon, dpm;
+      double fmon;
+
+      if ( timeunit == TUNIT_YEAR ) timevalue *= 12;
+
+      nmon = (int) timevalue;
+      fmon = timevalue - nmon;
+
+      month += nmon;
+
+      while ( month > 12 ) { month -= 12; year++; }
+      while ( month <  1 ) { month += 12; year--; }
+
+      dpm = days_per_month(calendar, year, month);
+      timeunit = TUNIT_DAY;
+      timevalue = fmon*dpm;
+    }
+
+  encode_caldaysec(calendar, year, month, day, hour, minute, second, &julday, &secofday);
+
+  cdiDecodeTimevalue(timeunit, timevalue, &days, &secs);
+
+  julday_add(days, secs, &julday, &secofday);
+
+  decode_caldaysec(calendar, julday, secofday, &year, &month, &day, &hour, &minute, &second);
+
+  *vdate = cdiEncodeDate(year, month, day);
+  *vtime = cdiEncodeTime(hour, minute, second);
+}
+
+
+double vtime2timeval(int vdate, int vtime, taxis_t *taxis)
+{
+  int ryear, rmonth;
+  int year, month, day, hour, minute, second;
+  int rdate, rtime;
+  double value = 0;
+  int timeunit;
+  int timeunit0;
+  int calendar;
+  int julday1, secofday1, julday2, secofday2, days, secs;
+
+  timeunit = (*taxis).unit;
+  calendar = (*taxis).calendar;
+
+  rdate = (*taxis).rdate;
+  rtime = (*taxis).rtime;
+  if ( rdate == -1 )
+    {
+      rdate  = (*taxis).vdate;
+      rtime  = (*taxis).vtime;
+    }
+
+  if ( rdate == 0 && rtime == 0 && vdate == 0 && vtime == 0 ) return(value);
+
+  cdiDecodeDate(rdate, &ryear, &rmonth, &day);
+  cdiDecodeTime(rtime, &hour, &minute, &second);
+
+  encode_caldaysec(calendar, ryear, rmonth, day, hour, minute, second, &julday1, &secofday1);
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+
+  timeunit0 = timeunit;
+
+  if ( timeunit == TUNIT_MONTH && calendar == CALENDAR_360DAYS )
+    {
+      timeunit = TUNIT_DAY;
+    }
+
+  if ( timeunit == TUNIT_MONTH || timeunit == TUNIT_YEAR )
+    {
+      int nmonth, dpm;
+
+      dpm = days_per_month(calendar, year, month);
+
+      value = (year-ryear)*12 - rmonth + month;
+
+      nmonth = (int) value;
+      month -= nmonth;
+
+      while ( month > 12 ) { month -= 12; year++; }
+      while ( month <  1 ) { month += 12; year--; }
+
+      encode_caldaysec(calendar, year, month, day, hour, minute, second, &julday2, &secofday2);
+
+      julday_sub(julday1, secofday1, julday2, secofday2, &days, &secs);
+
+      value += (days+secs/86400.)/dpm;
+
+      if ( timeunit == TUNIT_YEAR ) value = value/12;
+    }
+  else
+    {
+      encode_caldaysec(calendar, year, month, day, hour, minute, second, &julday2, &secofday2);
+
+      julday_sub(julday1, secofday1, julday2, secofday2, &days, &secs);
+
+      cdiEncodeTimevalue(days, secs, timeunit, &value);
+    }
+
+  if ( timeunit0 == TUNIT_MONTH && calendar == CALENDAR_360DAYS )
+    {
+      value /= 30;
+    }
+
+  return (value);
+}
+
+
+void conv_timeval(double timevalue, int *rvdate, int *rvtime)
+{
+  int vdate = 0, vtime = 0;
+  int hour, minute, second;
+  int daysec;
+
+  vdate = (int) timevalue;
+  if ( vdate < 0 )
+    daysec = (int) (-(timevalue - vdate)*86400 + 0.01);
+  else
+    daysec = (int) ( (timevalue - vdate)*86400 + 0.01);
+
+  hour   =  daysec / 3600;
+  minute = (daysec - hour*3600)/60;
+  second =  daysec - hour*3600 - minute*60;
+  vtime  = cdiEncodeTime(hour, minute, second);
+
+  *rvdate = vdate;
+  *rvtime = vtime;
+}
+
+
+void splitTimevalue(double timevalue, int timeunit, int *date, int *time)
+{
+  int vdate = 0, vtime = 0;
+  int hour, minute, second;
+  int year, month, day;
+  static int lwarn = TRUE;
+
+  if ( timeunit == TUNIT_SECOND )
+    {
+      timevalue /= 86400;
+      conv_timeval(timevalue, &vdate, &vtime);
+    }
+  else if ( timeunit == TUNIT_HOUR )
+    {
+      timevalue /= 24;
+      conv_timeval(timevalue, &vdate, &vtime);
+    }
+  else if ( timeunit == TUNIT_DAY )
+    {
+      conv_timeval(timevalue, &vdate, &vtime);
+    }
+  else if ( timeunit == TUNIT_MONTH )
+    {
+      vdate = (int) timevalue*100;
+      vtime = 0;
+    }
+  else if ( timeunit == TUNIT_YEAR )
+    {
+      if ( timevalue < -214700 )
+	{
+	  Warning("Year %g out of range, set to -214700", timevalue);
+	  timevalue = -214700;
+	}
+      else if ( timevalue > 214700 )
+	{
+	  Warning("Year %g out of range, set to 214700", timevalue);
+	  timevalue = 214700;
+	}
+
+      vdate = (int) timevalue*10000;
+      vtime = 0;
+    }
+  else
+    {
+      if ( lwarn )
+	{
+	  Warning("timeunit %s unsupported!", tunitNamePtr(timeunit));
+	  lwarn = FALSE;
+	}
+    }
+
+  /* verify date and time */
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+
+  if ( month > 17 || day > 31 || hour > 23 || minute > 59 || second > 59 )
+    {
+      if ( (month  > 17 || day > 31) && (year < -9999 || year > 9999) ) year = 1;
+      if ( month  > 17 ) month  = 1;
+      if ( day    > 31 ) day    = 1;
+      if ( hour   > 23 ) hour   = 0;
+      if ( minute > 59 ) minute = 0;
+      if ( second > 59 ) second = 0;
+
+      vdate = cdiEncodeDate(year, month, day);
+      vtime = cdiEncodeTime(hour, minute, second);
+
+      Warning("Reset wrong date/time to %4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d!",
+	      year, month, day, hour, minute, second);
+    }
+
+  *date = vdate;
+  *time = vtime;
+}
+
+
+void cdiDecodeTimeval(double timevalue, taxis_t *taxis, int *date, int *time)
+{
+  if ( taxis->type == TAXIS_ABSOLUTE )
+    splitTimevalue(timevalue, taxis->unit, date, time);
+  else
+    timeval2vtime(timevalue, taxis, date, time);
+}
+
+
+double cdiEncodeTimeval(int date, int time, taxis_t *taxis)
+{
+  double timevalue;
+
+  if ( taxis->type == TAXIS_ABSOLUTE )
+    {
+      if ( taxis->unit == TUNIT_YEAR )
+	{
+	  int year, month, day;
+	  cdiDecodeDate(date, &year, &month, &day);
+
+	  timevalue = year;
+	}
+      else if ( taxis->unit == TUNIT_MONTH )
+	{
+	  int year, month, day;
+	  cdiDecodeDate(date, &year, &month, &day);
+	  if ( day == 0 )
+	    timevalue = date/100;
+	  else
+	    timevalue = date/100 + 0.5;
+	}
+      else
+	{
+	  int hour, minute, second;
+	  cdiDecodeTime(time, &hour, &minute, &second);
+	  if ( date < 0 )
+	    timevalue = -(-date + (hour*3600 + minute*60 + second)/86400.);
+	  else
+	    timevalue =    date + (hour*3600 + minute*60 + second)/86400.;
+	}
+    }
+  else
+    timevalue = vtime2timeval(date, time, taxis);
+
+  return (timevalue);
+}
+
+
+void ptaxisInit(taxis_t *taxisptr)
+{
+  taxisDefaultValue ( taxisptr );
+}
+
+
+void ptaxisCopy(taxis_t *dest, taxis_t *source)
+{
+  reshLock ();
+
+  /* memcpy(dest, source, sizeof(taxis_t)); */
+  dest->used       = source->used;
+  dest->type       = source->type;
+  dest->vdate      = source->vdate;
+  dest->vtime      = source->vtime;
+  dest->rdate      = source->rdate;
+  dest->rtime      = source->rtime;
+  dest->calendar   = source->calendar;
+  dest->unit       = source->unit;
+  dest->numavg     = source->numavg;
+  dest->has_bounds = source->has_bounds;
+  dest->vdate_lb   = source->vdate_lb;
+  dest->vtime_lb   = source->vtime_lb;
+  dest->vdate_ub   = source->vdate_ub;
+  dest->vtime_ub   = source->vtime_ub;
+
+  reshUnlock ();
+}
+
+
+void taxisPrintKernel ( taxis_t * taxisptr, FILE * fp )
+{
+  int vdate_lb, vdate_ub;
+  int vtime_lb, vtime_ub;
+
+  taxis_check_ptr ( __func__, taxisptr );
+
+  taxisInqVdateBounds ( taxisptr->self, &vdate_lb, &vdate_ub);
+  taxisInqVtimeBounds ( taxisptr->self, &vtime_lb, &vtime_ub);
+
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "# taxisID %d\n", taxisptr->self);
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "self       = %d\n", taxisptr->self );
+  fprintf ( fp, "used       = %d\n", taxisptr->used );
+  fprintf ( fp, "type       = %d\n", taxisptr->type );
+  fprintf ( fp, "vdate      = %d\n", taxisptr->vdate );
+  fprintf ( fp, "vtime      = %d\n", taxisptr->vtime );
+  fprintf ( fp, "rdate      = %d\n", taxisptr->rdate );
+  fprintf ( fp, "rtime      = %d\n", taxisptr->rtime );
+  fprintf ( fp, "calendar   = %d\n", taxisptr->calendar );
+  fprintf ( fp, "unit       = %d\n", taxisptr->unit );
+  fprintf ( fp, "numavg     = %d\n", taxisptr->numavg );
+  fprintf ( fp, "has_bounds = %d\n", taxisptr->has_bounds );
+  fprintf ( fp, "vdate_lb   = %d\n", vdate_lb );
+  fprintf ( fp, "vtime_lb   = %d\n", vtime_lb );
+  fprintf ( fp, "vdate_ub   = %d\n", vdate_ub );
+  fprintf ( fp, "vtime_ub   = %d\n", vtime_ub );
+  fprintf ( fp, "\n");
+}
+
+void taxisPrint ( int taxisID )
+{
+  taxis_t * taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+  taxisPrintKernel ( taxisptr, stdout );
+}
+
+void taxisPrintP ( void * taxisptr, FILE * fp )
+{
+  taxisPrintKernel (( taxis_t * ) taxisptr, fp );
+}
+
+int taxisCompareP ( void *  taxisptr1, void * taxisptr2 )
+{
+  taxis_t * t1, * t2;
+
+  t1 = ( taxis_t * ) taxisptr1;
+  t2 = ( taxis_t * ) taxisptr2;
+
+  xassert ( t1 );
+  xassert ( t2 );
+
+  return ! ( t1->used       == t2->used       &&
+	     t1->type       == t2->type       &&
+	     t1->vdate      == t2->vdate      &&
+	     t1->vtime      == t2->vtime      &&
+	     t1->rdate      == t2->rdate      &&
+	     t1->rtime      == t2->rtime      &&
+	     t1->calendar   == t2->calendar   &&
+	     t1->unit       == t2->unit       &&
+	     t1->numavg     == t2->numavg     &&
+	     t1->has_bounds == t2->has_bounds &&
+	     t1->vdate_lb   == t2->vdate_lb   &&
+	     t1->vtime_lb   == t2->vtime_lb   &&
+	     t1->vdate_ub   == t2->vdate_ub   &&
+	     t1->vtime_ub   == t2->vtime_ub );
+}
+
+
+#ifdef USE_MPI
+static int
+taxisTxCode ( void )
+{
+  return TAXIS;
+}
+
+enum { taxisNint = 15 };
+
+static
+int taxisGetPackSize ( void * voidP, MPI_Comm comm )
+{
+  int packBufferSize = 0, size;
+
+  xmpi ( MPI_Pack_size ( taxisNint, MPI_INT, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBufferSize += size;
+
+  return packBufferSize;
+}
+
+
+void taxisUnpack ( char * unpackBuffer, int unpackBufferSize,
+		   int * unpackBufferPos, int nspTarget, MPI_Comm comm )
+{
+  taxis_t * taxisP;
+  int intBuffer[taxisNint];
+  double d;
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+		      intBuffer, taxisNint, MPI_INT, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+		      &d, 1, MPI_DOUBLE, comm ));
+
+  xassert ( xchecksum ( DATATYPE_INT, taxisNint, intBuffer ) == d );
+
+  taxisInit ();
+
+  taxisP = taxisNewEntry();
+  if ( ! taxisP ) Error("No memory");
+
+  xassert ( namespaceAdaptKey ( intBuffer[0], nspTarget ) == taxisP->self );
+
+  taxisP->used       = intBuffer[1];
+  taxisP->type       = intBuffer[2];
+  taxisP->vdate      = intBuffer[3];
+  taxisP->vtime      = intBuffer[4];
+  taxisP->rdate      = intBuffer[5];
+  taxisP->rtime      = intBuffer[6];
+  taxisP->calendar   = intBuffer[7];
+  taxisP->unit       = intBuffer[8];
+  taxisP->numavg     = intBuffer[9];
+  taxisP->has_bounds = intBuffer[10];
+  taxisP->vdate_lb   = intBuffer[11];
+  taxisP->vtime_lb   = intBuffer[12];
+  taxisP->vdate_ub   = intBuffer[13];
+  taxisP->vtime_ub   = intBuffer[14];
+}
+
+
+static
+void taxisPack ( void * voidP, void * packBuffer, int packBufferSize,
+		 int * packBufferPos, MPI_Comm comm )
+{
+  taxis_t   * taxisP = ( taxis_t * ) voidP;
+  int intBuffer[taxisNint];
+  double d;
+
+  intBuffer[0]  = taxisP->self; 
+  intBuffer[1]  = taxisP->used;      
+  intBuffer[2]  = taxisP->type;      
+  intBuffer[3]  = taxisP->vdate;     
+  intBuffer[4]  = taxisP->vtime;     
+  intBuffer[5]  = taxisP->rdate;     
+  intBuffer[6]  = taxisP->rtime;     
+  intBuffer[7]  = taxisP->calendar;  
+  intBuffer[8]  = taxisP->unit;      
+  intBuffer[9]  = taxisP->numavg;    
+  intBuffer[10] = taxisP->has_bounds;
+  intBuffer[11] = taxisP->vdate_lb;  
+  intBuffer[12] = taxisP->vtime_lb;  
+  intBuffer[13] = taxisP->vdate_ub;  
+  intBuffer[14] = taxisP->vtime_ub;  
+  
+  xmpi ( MPI_Pack ( intBuffer, taxisNint, MPI_INT, 
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+  d = xchecksum ( DATATYPE_INT, taxisNint, intBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#include <stdio.h>
+#include <math.h>		/* for floor() */
+
+
+
+/* convert Julian date into year, months, day */
+void decode_julday(int calendar,
+		   int julday,	/* Julian day number to convert */
+		   int *year,	/* Gregorian year (out)         */
+		   int *mon,	/* Gregorian month (1-12) (out) */
+		   int *day)	/* Gregorian day (1-31) (out)   */
+{
+  int a = julday;
+  double b, c;
+  double d, e, f;
+
+  b = floor((a - 1867216.25)/36524.25);
+  c = a + b - floor(b/4) + 1525;
+
+  if ( calendar == CALENDAR_STANDARD )
+    if ( a < 2299161 )
+      {
+	c = a + 1524;
+      } 
+
+  d = floor((c - 122.1)/365.25);
+  e = floor(365.25*d);
+  f = floor((c - e)/30.6001);
+
+  *day  = (int)(c - e - floor(30.6001*f));
+  *mon  = (int)(f - 1 - 12*floor(f/14));
+  *year = (int)(d - 4715 - floor((7 + *mon)/10));
+}
+
+
+/* convert year, month, day into Julian calendar day */
+int encode_julday(int calendar, int year, int month, int day)
+{
+  int iy;
+  int im;
+  int ib;
+  int julday;
+
+  if ( month <= 2 )
+    {
+      iy = year  - 1;
+      im = month + 12;
+    }
+  else
+    {
+      iy = year;
+      im = month;
+    }
+
+
+  if ( iy < 0 )
+    ib = (int)((iy+1)/400) - (int)((iy+1)/100);
+  else
+    ib = (int)(iy/400) - (int)(iy/100);
+
+  if ( calendar == CALENDAR_STANDARD )
+    {
+      if ( year > 1582 || (year == 1582 && (month > 10 || (month == 10 && day >= 15))) )
+	{
+	  /*
+	  ** 15th October 1582 AD or later
+	  */
+	}
+      else
+	{
+	  /*
+	  ** 4th October 1582 AD or earlier
+	  */
+	  ib = -2;
+	}
+    }
+
+  julday = (int) (floor(365.25*iy) + (int)(30.6001*(im+1)) + ib + 1720996.5 + day + 0.5);
+
+  return (julday);
+}
+
+
+int date_to_julday(int calendar, int date)
+{
+  int julday;
+  int year, month, day;
+
+  cdiDecodeDate(date, &year, &month, &day);
+
+  julday = encode_julday(calendar, year, month, day);
+
+  return (julday);
+}
+
+
+int julday_to_date(int calendar, int julday)
+{
+  int date;
+  int year, month, day;
+
+  decode_julday(calendar, julday, &year, &month, &day);
+
+  date = cdiEncodeDate(year, month, day);
+
+  return (date);
+}
+
+
+int time_to_sec(int time)
+{
+  int secofday;
+  int hour, minute, second;
+
+  cdiDecodeTime(time, &hour, &minute, &second);
+
+  secofday = hour*3600 + minute*60 + second;
+
+  return (secofday);
+}
+
+
+int sec_to_time(int secofday)
+{
+  int time;
+  int hour, minute, second;
+
+  hour   = secofday/3600;
+  minute = secofday/60 - hour*60;
+  second = secofday - hour*3600 - minute*60;
+
+  time = cdiEncodeTime(hour, minute, second);
+
+  return (time);
+}
+
+static
+void adjust_seconds(int *julday, int *secofday)
+{
+  int secperday = 86400;
+
+  while ( *secofday >= secperday ) 
+    { 
+      *secofday -= secperday; 
+      (*julday)++;
+    }
+
+  while ( *secofday <  0 ) 
+    { 
+      *secofday += secperday;
+      (*julday)--;
+    }
+}
+
+
+void julday_add_seconds(int seconds, int *julday, int *secofday)
+{
+  *secofday += seconds;
+
+  adjust_seconds(julday, secofday);
+}
+
+/* add days and secs to julday/secofday */
+void julday_add(int days, int secs, int *julday, int *secofday)
+{
+  *julday   += days;
+  *secofday += secs;
+
+  adjust_seconds(julday, secofday);
+}
+
+/* subtract julday1/secofday1 from julday2/secofday2 and returns the result in seconds */
+double julday_sub(int julday1, int secofday1, int julday2, int secofday2, int *days, int *secs)
+{
+  int seconds;
+
+  *days = julday2 - julday1;
+  *secs = secofday2 - secofday1;
+
+  adjust_seconds(days, secs);
+
+  seconds = *days*86400. + *secs;
+
+  return (seconds);
+}
+
+
+void encode_juldaysec(int calendar, int year, int month, int day, int hour, int minute, int *julday, int *secofday)
+{
+  *julday = encode_julday(calendar, year, month, day);
+
+  *secofday = (hour*60 + minute)*60;
+}
+
+
+void decode_juldaysec(int calendar, int julday, int secofday, int *year, int *month, int *day, int *hour, int *minute)
+{
+  decode_julday(calendar, julday, year, month, day);
+
+  *hour   = secofday/3600;
+  *minute = secofday/60 - *hour*60;
+}
+
+
+#ifdef TEST
+int main(void)
+{
+  int nmin;
+  int vdate0, vtime0;
+  int vdate, vtime;
+  int ijulinc;
+  int i, j = 0;
+  int year, mon, day, hour, minute, second;
+  int julday, secofday;
+
+  /* 1 - Check valid range of years */
+
+  nmin = 11000;
+  vdate0 = -80001201;
+  vtime0 = 120500;
+
+  printf("start time: %8d %4d\n", vdate0, vtime0);
+
+  for ( i = 0; i < nmin; i++ )
+    {
+      cdiDecodeDate(vdate0, &year, &mon, &day);
+      cdiDecodeTime(vtime0, &hour, &minute, &second);
+
+      julday  = date_to_julday(calendar, vdate0);
+      secofday = time_to_sec(vtime0);
+
+      vdate = julday_to_date(calendar, julday);
+      vtime = sec_to_time(secofday);
+
+      if ( vdate0 != vdate || vtime0 != vtime )
+	printf("%4d %8d %4d %8d %4d %9d %9d\n",
+	       ++j, vdate0, vtime0, vdate, vtime, julday, secofday);
+
+      year++;
+      vdate0 = cdiEncodeDate(year, mon, day);
+      vtime0 = cdiEncodeTime(hour, minute, second);
+    }
+
+  printf("stop time: %8d %4d\n", vdate0, vtime0);
+
+  /* 2 - Check time increment of one minute */
+
+  nmin = 120000;
+  ijulinc = 60;
+  vdate0 = 20001201;
+  vtime0 = 0;
+
+  printf("start time: %8d %4d\n", vdate0, vtime0);
+
+  julday = date_to_julday(calendar, vdate0);
+  secofday = time_to_sec(vtime0);
+  for ( i = 0; i < nmin; i++ )
+    {
+      cdiDecodeDate(vdate0, &year, &mon, &day);
+      cdiDecodeTime(vtime0, &hour, &minute, &second);
+
+      if ( ++minute >= 60 )
+	{
+	  minute = 0;
+	  if ( ++hour >= 24 )
+	    {
+	      hour = 0;
+	      if ( ++day >= 32 )
+		{
+		  day = 1;
+		  if ( ++mon >= 13 )
+		    {
+		      mon = 1;
+		      year++;
+		    }
+		}
+	    }
+	}
+
+      vdate0 = cdiEncodeDate(year, mon, day);
+      vtime0 = cdiEncodeTime(hour, minute, second);
+
+      julday_add_seconds(ijulinc, &julday, &secofday);
+
+      vdate = julday_to_date(calendar, julday);
+      vtime = sec_to_time(secofday);
+      if ( vdate0 != vdate || vtime0 != vtime )
+	printf("%4d %8d %4d %8d %4d %9d %9d\n",
+	       ++j, vdate0, vtime0, vdate, vtime, julday, secofday);
+    }
+
+  printf("stop time: %8d %4d\n", vdate0, vtime0);
+
+  return (0);
+}
+#endif
+
+
+#ifdef TEST2
+int main(void)
+{
+  int i;
+  int julday, secofday;
+  int year, month, day, hour, minute;
+  int value = 30;
+  int factor = 86400;
+
+  year=1979; month=1; day=15; hour=12; minute=30;
+
+  printf("%d/%02d/%02d %02d:%02d\n", year, month, day, hour, minute);
+
+  encode_juldaysec(calendar, year, month, day, hour, minute, &julday, &secofday);
+
+  decode_juldaysec(calendar, julday, secofday, &year, &month, &day, &hour, &minute);
+  printf("%d/%02d/%02d %02d:%02d   %d %d\n", year, month, day, hour, minute, julday, secofday);
+
+  for ( i = 0; i < 420; i++ )
+    {
+
+      decode_juldaysec(calendar, julday, secofday, &year, &month, &day, &hour, &minute);
+      printf("%2d %d/%02d/%02d %02d:%02d\n", i, year, month, day, hour, minute);
+      julday_add_seconds(value*factor, &julday, &secofday);
+    }
+
+  return (0);
+}
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#include <stdio.h>
+
+
+
+static int month_360[12] = {30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30};
+static int month_365[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+static int month_366[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+
+
+int calendar_dpy(int calendar)
+{
+  int dpy = 0;
+
+  if      ( calendar == CALENDAR_360DAYS ) dpy = 360;
+  else if ( calendar == CALENDAR_365DAYS ) dpy = 365;
+  else if ( calendar == CALENDAR_366DAYS ) dpy = 366;
+
+  return (dpy);
+}
+
+
+int days_per_month(int calendar, int year, int month)
+{
+  int dayspermonth = 0;
+  int *dpm = NULL;
+  int dpy;
+
+  dpy = calendar_dpy(calendar);
+
+  if      ( dpy == 360 ) dpm = month_360;
+  else if ( dpy == 365 ) dpm = month_365;
+  else                   dpm = month_366;
+
+  if ( month >= 1 && month <= 12 )
+    dayspermonth = dpm[month-1];
+  /*
+  else
+    fprintf(stderr, "days_per_month: month %d out of range\n", month);
+  */
+  if ( dpy == 0 && month == 2 )
+    {
+      if ( (year%4 == 0 && year%100 != 0) || year%400 == 0 )
+	dayspermonth = 29;
+      else
+	dayspermonth = 28;
+    }
+
+  return (dayspermonth);
+}
+
+
+int days_per_year(int calendar, int year)
+{
+  int daysperyear;
+  int dpy;
+
+  dpy = calendar_dpy(calendar);
+
+  if ( dpy == 0 )
+    {
+      if ( calendar == CALENDAR_STANDARD )
+	{
+	  if ( year == 1582 )
+	    dpy = 355;
+	  else if ( (year%4 == 0 && year%100 != 0) || year%400 == 0 )
+	    dpy = 366;
+	  else
+	    dpy = 365;
+	}
+      else
+	{
+	  if ( (year%4 == 0 && year%100 != 0) || year%400 == 0 )
+	    dpy = 366;
+	  else
+	    dpy = 365;
+	}
+    }
+
+  daysperyear = dpy;
+  
+  return (daysperyear);
+}
+
+
+static void decode_day(int dpy, int days, int *year, int *month, int *day)
+{
+  int i = 0;
+  int *dpm = NULL;
+
+  *year = (days-1) / dpy;
+  days -= (*year*dpy);
+
+  if      ( dpy == 360 ) dpm = month_360;
+  else if ( dpy == 365 ) dpm = month_365;
+  else if ( dpy == 366 ) dpm = month_366;
+
+  if ( dpm )
+    for ( i = 0; i < 12; i++ )
+      {
+	if ( days > dpm[i] ) days -= dpm[i];
+	else break;
+      }
+
+  *month = i + 1;
+  *day   = days;
+}
+
+
+static int encode_day(int dpy, int year, int month, int day)
+{
+  int i;
+  int *dpm = NULL;
+  double rval;
+
+  rval = dpy * year + day;
+
+  if      ( dpy == 360 ) dpm = month_360;
+  else if ( dpy == 365 ) dpm = month_365;
+  else if ( dpy == 366 ) dpm = month_366;
+  
+  if ( dpm ) for ( i = 0; i < month-1; i++ ) rval += dpm[i];
+
+  return (rval);
+}
+
+
+int date_to_calday(int calendar, int date)
+{
+  int calday;
+  int dpy;
+  int year, month, day;
+
+  dpy = calendar_dpy(calendar);
+
+  cdiDecodeDate(date, &year, &month, &day);
+
+  if ( dpy == 360 || dpy == 365 || dpy == 366 )
+    calday = encode_day(dpy, year, month, day);
+  else
+    calday = encode_julday(calendar, year, month, day);
+
+  return (calday);
+}
+
+
+int calday_to_date(int calendar, int calday)
+{
+  int date;
+  int dpy;
+  int year, month, day;
+
+  dpy = calendar_dpy(calendar);
+
+  if ( dpy == 360 || dpy == 365 || dpy == 366 )
+    decode_day(dpy, calday, &year, &month, &day);
+  else
+    decode_julday(calendar, calday, &year, &month, &day);
+
+  date = cdiEncodeDate(year, month, day);
+
+  return (date);
+}
+
+
+void encode_caldaysec(int calendar, int year, int month, int day, int hour, int minute, int second,
+		      int *julday, int *secofday)
+{
+  int dpy;
+
+  dpy = calendar_dpy(calendar);
+
+  if ( dpy == 360 || dpy == 365 || dpy == 366 )
+    *julday = encode_day(dpy, year, month, day);
+  else
+    *julday = encode_julday(calendar, year, month, day);
+
+  *secofday = hour*3600 + minute*60 + second;
+}
+
+
+void decode_caldaysec(int calendar, int julday, int secofday, 
+		      int *year, int *month, int *day, int *hour, int *minute, int *second)
+{
+  int dpy;
+
+  dpy = calendar_dpy(calendar);
+
+  if ( dpy == 360 || dpy == 365 || dpy == 366 )
+    decode_day(dpy, julday, year, month, day);
+  else
+    decode_julday(calendar, julday, year, month, day);
+
+  *hour   = secofday/3600;
+  *minute = secofday/60 - *hour*60;
+  *second = secofday - *hour*3600 - *minute*60;
+}
+
+
+#ifdef TEST
+int main(void)
+{
+  int calendar = CALENDAR_STANDARD;
+  int nmin;
+  int vdate0, vtime0;
+  int vdate, vtime;
+  int ijulinc;
+  int i, j = 0;
+  int year, mon, day, hour, minute, second;
+  int calday, secofday;
+
+  /* 1 - Check valid range of years */
+
+  nmin = 11000;
+  vdate0 = -80001201;
+  vtime0 = 120500;
+
+  printf("start time: %8d %4d\n", vdate0, vtime0);
+
+  for ( i = 0; i < nmin; i++ )
+    {
+      cdiDecodeDate(vdate0, &year, &mon, &day);
+      cdiDecodeTime(vtime0, &hour, &minute, &second);
+
+      calday  = date_to_calday(calendar, vdate0);
+      secofday = time_to_sec(vtime0);
+
+      vdate = calday_to_date(calendar, calday);
+      vtime = sec_to_time(secofday);
+
+      if ( vdate0 != vdate || vtime0 != vtime )
+	printf("%4d %8d %4d %8d %4d %9d %9d\n",
+	       ++j, vdate0, vtime0, vdate, vtime, calday, secofday);
+
+      year++;
+      vdate0 = cdiEncodeDate(year, mon, day);
+      vtime0 = cdiEncodeTime(hour, minute, second);
+    }
+
+  printf("stop time: %8d %4d\n", vdate0, vtime0);
+
+  /* 2 - Check time increment of one minute */
+
+  nmin = 120000;
+  ijulinc = 60;
+  vdate0 = 20001201;
+  vtime0 = 0;
+
+  printf("start time: %8d %4d\n", vdate0, vtime0);
+
+  calday = date_to_calday(calendar, vdate0);
+  secofday = time_to_sec(vtime0);
+  for ( i = 0; i < nmin; i++ )
+    {
+      cdiDecodeDate(vdate0, &year, &mon, &day);
+      cdiDecodeTime(vtime0, &hour, &minute, &second);
+
+      if ( ++minute >= 60 )
+	{
+	  minute = 0;
+	  if ( ++hour >= 24 )
+	    {
+	      hour = 0;
+	      if ( ++day >= 32 )
+		{
+		  day = 1;
+		  if ( ++mon >= 13 )
+		    {
+		      mon = 1;
+		      year++;
+		    }
+		}
+	    }
+	}
+
+      vdate0 = cdiEncodeDate(year, mon, day);
+      vtime0 = cdiEncodeTime(hour, minute, second);
+
+      julday_add_seconds(ijulinc, &calday, &secofday);
+
+      vdate = calday_to_date(calendar, calday);
+      vtime = sec_to_time(secofday);
+      if ( vdate0 != vdate || vtime0 != vtime )
+	printf("%4d %8d %4d %8d %4d %9d %9d\n",
+	       ++j, vdate0, vtime0, vdate, vtime, calday, secofday);
+    }
+
+  printf("stop time: %8d %4d\n", vdate0, vtime0);
+
+  return (0);
+}
+#endif
+
+
+#ifdef TEST2
+int main(void)
+{
+  int calendar = CALENDAR_STANDARD;
+  int i;
+  int calday, secofday;
+  int year, month, day, hour, minute, second;
+  int value = 30;
+  int factor = 86400;
+  
+  calendar = CALENDAR_360DAYS;
+
+  year=1979; month=1; day=15; hour=12; minute=30; second = 0;
+
+  printf("calendar = %d\n", calendar);
+  printf("%d/%02d/%02d %02d:%02d:%02d\n", year, month, day, hour, minute, second);
+
+  encode_caldaysec(calendar, year, month, day, hour, minute, second, &calday, &secofday);
+
+  decode_caldaysec(calendar, calday, secofday, &year, &month, &day, &hour, &minute, &second);
+  printf("%d/%02d/%02d %02d:%02d:%02d   %d %d\n", year, month, day, hour, minute, second, calday, secofday);
+
+  for ( i = 0; i < 420; i++ )
+    {
+
+      decode_caldaysec(calendar, calday, secofday, &year, &month, &day, &hour, &minute, &second);
+      printf("%2d %d/%02d/%02d %02d:%02d:%02d\n", i, year, month, day, hour, minute, second);
+      julday_add_seconds(value*factor, &calday, &secofday);
+    }
+
+  return (0);
+}
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+
+#undef  UNDEFID
+#define UNDEFID -1
+
+int ECHAM4 = UNDEFID;
+int ECHAM5 = UNDEFID;
+int COSMO  = UNDEFID;
+
+typedef struct
+{
+  int      self;
+  int      used;
+  int      instID;
+  int      modelgribID;
+  char    *name;
+}
+model_t;
+
+
+static int  MODEL_Debug = 0;   /* If set to 1, debugging */
+static int * modelInitializedNsp;
+
+static void modelInit(void);
+
+
+static int    modelCompareP ( void * modelptr1, void * modelptr2 );
+static void   modelDestroyP ( void * modelptr );
+static void   modelPrintP   ( void * modelptr, FILE * fp );
+#ifdef USE_MPI
+static int    modelGetSizeP ( void * modelptr, MPI_Comm comm );
+static void   modelPackP    ( void * modelptr, void * buff, int size, int *position, MPI_Comm comm);
+static int    modelTxCode   ( void );
+#endif
+
+resOps modelOps = { modelCompareP, modelDestroyP, modelPrintP
+#ifdef USE_MPI
+                    , modelGetSizeP, modelPackP, modelTxCode
+#endif
+};
+
+static
+void modelDefaultValue ( model_t *modelptr )
+{
+  modelptr->self        = UNDEFID;
+  modelptr->used        = 0;
+  modelptr->instID      = UNDEFID;
+  modelptr->modelgribID = UNDEFID;
+  modelptr->name        = NULL;
+}
+
+static
+model_t *modelNewEntry ( void )
+{
+  model_t *modelptr;
+
+  modelptr = (model_t *) xmalloc(sizeof(model_t));
+  modelDefaultValue ( modelptr );
+  modelptr->self = reshPut (( void * ) modelptr, &modelOps );
+  modelptr->used = 1;
+
+  return (modelptr);
+}
+
+
+int modelDef(int instID, int modelgribID, const char *name);
+
+static
+void modelDefaultEntries ( void )
+{
+  int instID, i;
+  cdiResH resH[10];
+
+  instID  = institutInq(  0,   0, "ECMWF", NULL);
+  /* (void)    modelDef(instID, 131, "ERA15"); */
+  /* (void)    modelDef(instID, 199, "ERA40"); */
+  instID  = institutInq(  0,   0, "MPIMET", NULL);
+
+  resH[0] = ECHAM5  = modelDef(instID,  64, "ECHAM5.4");
+  resH[1] = modelDef(instID,  63, "ECHAM5.3");
+  resH[2] = modelDef(instID,  62, "ECHAM5.2");
+  resH[3] = modelDef(instID,  61, "ECHAM5.1");
+
+  instID  = institutInq( 98, 255, "MPIMET", NULL);
+  resH[4] = modelDef(instID,  60, "ECHAM5.0");
+  resH[5] = ECHAM4  = modelDef(instID,  50, "ECHAM4");
+  resH[6] = modelDef(instID, 110, "MPIOM1");
+
+  instID  = institutInq(  0,   0, "DWD", NULL);
+  resH[7] = modelDef(instID, 149, "GME");
+
+  instID  = institutInq(  0,   0, "MCH", NULL);
+  //(void)  = modelDef(instID, 137, "COSMO");
+  resH[8] = COSMO   = modelDef(instID, 255, "COSMO");
+
+  instID  = institutInq(  0,   1, "NCEP", NULL);
+  resH[9] = modelDef(instID,  80, "T62L28MRF");
+  
+  if ( ! namespaceHasLocalFile ( namespaceGetActive ()))
+    for ( i = 0; i < 10 ; i++ )
+      reshSetStatus ( resH[i], &modelOps, SUSPENDED );  
+}
+
+static
+void modelFinalize ( void )
+{
+  free (   modelInitializedNsp );
+}
+
+static
+void modelInit(void)
+{
+  static int modelInitialized = 0;
+  int nsp, nspc;
+  char *env;
+
+  nspc = namespaceGetNumber ();
+  
+  if ( !modelInitialized )
+    {
+      modelInitialized = 1;
+      modelInitializedNsp = xcalloc ( 1, nspc * sizeof ( int ));
+      atexit ( modelFinalize );
+      env = getenv("MODEL_DEBUG");
+      if ( env ) MODEL_Debug = atoi(env);  
+    }
+
+  nsp = namespaceGetActive ();
+  
+  if ( modelInitializedNsp[nsp] ) return;
+  
+  modelInitializedNsp[nsp] = 1;
+  
+  modelDefaultEntries ();
+}
+
+int modelSize ( void )
+{
+  return reshCountType ( &modelOps );
+}
+
+
+int modelInq(int instID, int modelgribID, char *name)
+{
+  int modelID = UNDEFID;
+  size_t len;
+  int found;
+  int modelCount;
+  model_t *modelptr;
+  int i, * modelResHs;
+
+  modelInit ();
+
+  modelCount = modelSize();
+  modelResHs = xmalloc ( modelCount * sizeof ( int ));
+  reshGetResHListOfType ( modelCount, modelResHs, &modelOps );
+
+  for( i = 0; i < modelCount; i++ )
+    {
+      modelID = modelResHs[i];
+      modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
+
+      if ( modelptr->used )
+        {
+          if ( name )
+            {
+              found = 1;
+              if ( instID      != -1 && modelptr->instID      != instID )      found = 0;
+              if ( modelgribID !=  0 && modelptr->modelgribID != modelgribID ) found = 0;
+
+              if ( found )
+                {
+                  if ( modelptr->name )
+                    {
+                      len = strlen(modelptr->name);
+                      if ( memcmp(modelptr->name, name, len) == 0 ) break;
+                      len = strlen(name);
+                      if ( memcmp(modelptr->name, name, len) == 0 ) break;
+                    }
+                }
+            }
+          else
+            {
+              if ( modelptr->instID      == instID &&
+                   modelptr->modelgribID == modelgribID ) break;
+            }
+        }
+    }
+
+  if ( i == modelCount ) modelID = UNDEFID;
+
+  if ( modelResHs ) free ( modelResHs );
+
+  return (modelID);
+}
+
+
+int modelDef(int instID, int modelgribID, const char *name)
+{
+  model_t *modelptr;
+
+  modelInit ();
+
+  modelptr = modelNewEntry();
+
+  modelptr->instID      = instID;
+  modelptr->modelgribID = modelgribID;
+  if ( name ) modelptr->name = strdupx(name);
+
+  return modelptr->self;
+}
+
+
+int modelInqInstitut(int modelID)
+{
+  model_t *modelptr = NULL;
+
+  modelInit ();
+
+  if ( modelID != UNDEFID )
+    modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
+
+  return modelptr ? modelptr->instID : UNDEFID;
+}
+
+
+int modelInqGribID(int modelID)
+{
+  model_t *modelptr = NULL;
+
+  modelInit ();
+
+  if ( modelID != UNDEFID )
+    modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
+
+  return modelptr ? modelptr->modelgribID : UNDEFID;
+}
+
+
+char *modelInqNamePtr(int modelID)
+{
+  model_t *modelptr = NULL;
+
+  modelInit ();
+
+  if ( modelID != UNDEFID )
+    modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
+
+  return modelptr ? modelptr->name : NULL;
+}
+
+
+int  modelCompareP ( void * modelptr1, void * modelptr2 )
+{
+  return 0;
+}
+
+
+void modelDestroyP ( void * modelptr )
+{
+}
+
+
+void modelPrintP   ( void * modelptr, FILE * fp )
+{
+  model_t * mp = ( model_t * ) modelptr;
+
+  if ( !mp ) return;
+
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "# modelID %d\n", mp->self);
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "self          = %d\n", mp->self );
+  fprintf ( fp, "used          = %d\n", mp->used );
+  fprintf ( fp, "instID        = %d\n", mp->instID );
+  fprintf ( fp, "modelgribID   = %d\n", mp->modelgribID );
+  fprintf ( fp, "name          = %s\n", mp->name ? mp->name : "NN" );
+}
+
+
+#ifdef USE_MPI
+
+static int
+modelTxCode ( void )
+{
+  return MODEL;
+}
+
+enum {
+  model_nints = 4,
+};
+
+
+static
+int modelGetSizeP ( void * modelptr, MPI_Comm comm )
+{
+  model_t *p = modelptr;
+  int txsize = 0, txinc;
+  xmpi(MPI_Pack_size(model_nints, MPI_INT, comm, &txsize));
+  xmpi(MPI_Pack_size(strlen(p->name) + 1, MPI_CHAR, comm, &txinc));
+  txsize += txinc;
+  return txsize;
+}
+
+
+static
+void modelPackP ( void * modelptr, void * buf, int size,
+                  int *position, MPI_Comm comm )
+{
+  model_t *p = modelptr;
+  int tempbuf[model_nints];
+  tempbuf[0] = p->self;
+  tempbuf[1] = p->instID;
+  tempbuf[2] = p->modelgribID;
+  tempbuf[3] = (int)strlen(p->name) + 1;
+  xmpi(MPI_Pack(tempbuf, model_nints, MPI_INT, buf, size, position, comm));
+  xmpi(MPI_Pack(p->name, tempbuf[3], MPI_CHAR, buf, size, position, comm));
+}
+
+int
+modelUnpack(void *buf, int size, int *position, int nspTarget,
+            MPI_Comm comm)
+{
+  int tempbuf[model_nints];
+  int modelID;
+  char *name;
+  xmpi(MPI_Unpack(buf, size, position, tempbuf, model_nints, MPI_INT, comm));
+  name = xmalloc(tempbuf[3]);
+  xmpi(MPI_Unpack(buf, size, position, name, tempbuf[3], MPI_CHAR, comm));
+  modelID = modelDef( namespaceAdaptKey ( tempbuf[1], nspTarget ), tempbuf[2], name);
+  // FIXME: this should work, once all types are transferred
+  //assert(modelID == tempbuf[0]);
+  return modelID;
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+
+#undef  UNDEFID
+#define UNDEFID  -1
+
+int ECMWF  = UNDEFID;
+int MPIMET = UNDEFID;
+int DWD    = UNDEFID;
+int MCH    = UNDEFID;
+
+typedef struct
+{
+  int    self;
+  int    used;
+  int    center;
+  int    subcenter;
+  char  *name;
+  char  *longname;
+}
+institute_t;
+
+
+static int    instituteCompareP ( void * instituteptr1, void * instituteptr2 );
+static void   instituteDestroyP ( void * instituteptr );
+static void   institutePrintP   ( void * instituteptr, FILE * fp );
+#ifdef USE_MPI
+static int    instituteGetSizeP ( void * instituteptr, MPI_Comm comm );
+static void   institutePackP    ( void * instituteptr, void *buf, int size, int *position, MPI_Comm comm );
+static int    instituteTxCode   ( void );
+#endif
+
+resOps instituteOps = { instituteCompareP, instituteDestroyP, institutePrintP
+#ifdef USE_MPI
+                        ,instituteGetSizeP, institutePackP, instituteTxCode
+#endif
+ };
+
+static int * instituteInitializedNsp;
+
+static
+void instituteDefaultValue ( institute_t * instituteptr )
+{
+  instituteptr->self       = UNDEFID;
+  instituteptr->used       = 0;
+  instituteptr->center     = UNDEFID;
+  instituteptr->subcenter  = UNDEFID;
+  instituteptr->name       = NULL;
+  instituteptr->longname   = NULL;
+}
+
+static
+institute_t * instituteNewEntry ( void )
+{
+  institute_t *instituteptr;
+
+  instituteptr = ( institute_t * ) xmalloc ( sizeof ( institute_t ));
+
+  instituteDefaultValue ( instituteptr );
+  instituteptr->self = reshPut (( void * ) instituteptr, &instituteOps );
+  instituteptr->used = 1;
+
+  return  instituteptr;
+}
+
+static
+void instituteDefaultEntries ( void )
+{
+  cdiResH resH[12];
+  int i;
+
+  resH[0]  = ECMWF   = institutDef( 98,   0, "ECMWF",     "European Centre for Medium-Range Weather Forecasts");
+  resH[1]  = MPIMET  = institutDef( 98, 232, "MPIMET",    "Max-Planck-Institute for Meteorology");
+  resH[2]  =           institutDef( 98, 255, "MPIMET",    "Max-Planck-Institute for Meteorology");
+  resH[3]  =           institutDef( 98, 232, "MPIMET",    "Max-Planck Institute for Meteorology");
+  resH[4]  =           institutDef( 78, 255, "DWD",       "Deutscher Wetterdienst");
+  resH[5]  = MCH     = institutDef(215, 255, "MCH",       "MeteoSwiss");
+  resH[6]  =           institutDef(  7,   0, "NCEP",      "National Centers for Environmental Prediction");
+  resH[7]  =           institutDef(  7,   1, "NCEP",      "National Centers for Environmental Prediction");
+  resH[8]  =           institutDef( 60,   0, "NCAR",      "National Center for Atmospheric Research");
+  resH[9]  =           institutDef( 74,   0, "METOFFICE", "U.K. Met Office");
+  resH[10] =           institutDef( 97,   0, "ESA",       "European Space Agency ");
+  resH[11] =           institutDef( 99,   0, "KNMI",      "Royal Netherlands Meteorological Institute");
+  /*     (void) institutDef(  0,   0, "IPSL", "IPSL (Institut Pierre Simon Laplace, Paris, France)"); */
+
+  if ( ! namespaceHasLocalFile ( namespaceGetActive ()))
+    for ( i = 0; i < 12 ; i++ )
+      reshSetStatus ( resH[i], &instituteOps, SUSPENDED );
+}
+
+static
+void instituteFinalize ( void )
+{
+  free ( instituteInitializedNsp );
+}
+
+static
+void instituteInit (void)
+{
+  static int instituteInitialized = 0;
+  int nsp, nspc;
+
+  nspc = namespaceGetNumber ();
+
+  if ( !instituteInitialized )
+    {
+      instituteInitialized = 1;
+      instituteInitializedNsp = xcalloc ( 1, nspc * sizeof ( int ));
+      atexit ( instituteFinalize );
+    }
+
+  nsp = namespaceGetActive ();
+  if ( instituteInitializedNsp[nsp] ) return;
+  instituteInitializedNsp[nsp] = 1;
+
+  instituteDefaultEntries();
+}
+
+
+int instituteCount ( void )
+{
+  return reshCountType ( &instituteOps );
+}
+
+
+int instituteCompareKernel ( institute_t *  ip1, institute_t * ip2 )
+{
+  int differ = 0;
+  size_t len;
+
+  if ( ip1->name )
+    {
+      if ( ip1->center    > 0 && ip2->center    != ip1->center )    differ = 1;
+      if ( ip1->subcenter > 0 && ip2->subcenter != ip1->subcenter ) differ = 1;
+
+      if ( !differ )
+        {
+          if ( ip2->name )
+            {
+              len = strlen(ip2->name);
+              if ( memcmp(ip2->name, ip1->name, len)) differ = 1;
+            }
+        }
+    }
+  else if ( ip1->longname )
+    {
+      if ( ip2->longname )
+        {
+          len = strlen(ip2->longname);
+          if ( memcmp(ip2->longname, ip1->longname, len)) differ = 1;
+        }
+    }
+  else
+    {
+      if ( !( ip2->center    == ip1->center &&
+              ip2->subcenter == ip1->subcenter )) differ = 1;
+    }
+
+  return differ;
+}
+
+
+static int instituteCompareP ( void *  instituteptr1, void * instituteptr2 )
+{
+  institute_t * i1, * i2;
+
+  i1 = ( institute_t * ) instituteptr1;
+  i2 = ( institute_t * ) instituteptr2;
+
+  xassert(i1);
+  xassert(i2);
+
+  return instituteCompareKernel ( i1, i2 );
+}
+
+
+int institutInq(int center, int subcenter, const char *name, const char *longname)
+{
+  int instID = UNDEFID, instCount, * instResHs, i;
+  institute_t * ip1;
+  institute_t * ip2;
+
+  instituteInit ();
+
+  ip1 = xmalloc ( sizeof ( institute_t ));
+
+  ip1->self       = UNDEFID;
+  ip1->used       = 0;
+  ip1->center     = center;
+  ip1->subcenter  = subcenter;
+  ip1->name       = ( char * ) name;
+  ip1->longname   = ( char * ) longname;
+
+  instCount = instituteCount ();
+  instResHs = xmalloc ( instCount * sizeof ( int ));
+  reshGetResHListOfType ( instCount, instResHs, &instituteOps );
+
+  for ( i = 0; i < instCount; i++ )
+    {
+      ip2 = ( institute_t * ) reshGetVal ( instResHs[i], &instituteOps );
+      xassert ( ip2 );
+
+      if ( ip2->used && ! instituteCompareKernel ( ip1, ip2 ))
+        {
+          instID = ip2->self;
+          break;
+        }
+    }
+
+  free ( instResHs );
+  free ( ip1 );
+
+  return  (instID);
+}
+
+
+int institutDef(int center, int subcenter, const char *name, const char *longname)
+{
+  institute_t * instituteptr;
+
+  instituteInit ();
+
+  instituteptr = instituteNewEntry();
+
+  instituteptr->center    = center;
+  instituteptr->subcenter = subcenter;
+  if ( name )     instituteptr->name     = strdupx(name);
+  if ( longname ) instituteptr->longname = strdupx(longname);
+
+  return instituteptr->self;
+}
+
+
+int institutInqCenter(int instID)
+{
+  institute_t * instituteptr = NULL;
+
+  instituteInit ();
+
+  if ( instID != UNDEFID )
+    instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
+
+  return  instituteptr ? instituteptr->center : UNDEFID;
+}
+
+
+int institutInqSubcenter(int instID)
+{
+  institute_t * instituteptr = NULL;
+
+  instituteInit ();
+
+  if ( instID != UNDEFID )
+    instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
+
+  return instituteptr ? instituteptr->subcenter: UNDEFID;
+}
+
+
+char *institutInqNamePtr(int instID)
+{
+  institute_t * instituteptr = NULL;
+
+  instituteInit ();
+
+  if ( instID != UNDEFID )
+    instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
+
+  return instituteptr ? instituteptr->name : NULL;
+}
+
+
+char *institutInqLongnamePtr(int instID)
+{
+  institute_t * instituteptr = NULL;
+
+  instituteInit ();
+
+  if ( instID != UNDEFID )
+    instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
+
+  return instituteptr ? instituteptr->longname : NULL;
+}
+
+
+int institutInqNumber(void)
+{
+  int i, instCount, * instResHs, instNum = 0;
+  institute_t * instituteptr;
+
+  instituteInit ();
+
+  instCount = reshCountType ( &instituteOps );
+  instResHs = xmalloc ( instCount * sizeof ( int ));
+  reshGetResHListOfType ( instCount, instResHs, &instituteOps );
+
+  for ( i = 0; i < instCount; i++ )
+    {
+      instituteptr = ( institute_t * ) reshGetVal ( instResHs[i], &instituteOps );
+      if ( instituteptr && instituteptr->used )
+        instNum++;
+    }
+
+  if ( instResHs ) free ( instResHs );
+
+  return instNum;
+}
+
+
+void instituteDestroyP ( void * instituteptr )
+{
+  int id;
+  institute_t * i1 = ( institute_t * ) instituteptr;
+
+  xassert ( i1 );
+
+  id = i1->self;
+
+  if ( instituteptr ) free ( instituteptr );
+
+  reshRemove ( id, &instituteOps );
+}
+
+
+void institutePrintP   ( void * instituteptr, FILE * fp )
+{
+  institute_t * ip = ( institute_t * ) instituteptr;
+
+  if ( !ip ) return;
+
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "# instituteID %d\n", ip->self);
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "self          = %d\n", ip->self );
+  fprintf ( fp, "used          = %d\n", ip->used );
+  fprintf ( fp, "center        = %d\n", ip->center );
+  fprintf ( fp, "subcenter     = %d\n", ip->subcenter );
+  fprintf ( fp, "name          = %s\n", ip->name ? ip->name : "NN" );
+  fprintf ( fp, "longname      = %s\n", ip->longname ? ip->longname : "NN" );
+}
+
+
+#ifdef USE_MPI
+static int
+instituteTxCode ( void )
+{
+  return INSTITUTE;
+}
+
+enum {
+  institute_nints = 5,
+};
+
+static
+int instituteGetSizeP ( void * instituteptr, MPI_Comm comm )
+{
+  institute_t *p = instituteptr;
+  int txsize = 0, txinc;
+  xmpi(MPI_Pack_size(institute_nints, MPI_INT, comm, &txsize));
+  xmpi(MPI_Pack_size(strlen(p->name) + 1, MPI_CHAR, comm, &txinc));
+  txsize += txinc;
+  xmpi(MPI_Pack_size(strlen(p->longname) + 1, MPI_CHAR, comm, &txinc));
+  txsize += txinc;
+  return txsize;
+}
+
+static
+void institutePackP ( void * instituteptr, void *buf, int size,
+                      int *position, MPI_Comm comm )
+{
+  institute_t *p = instituteptr;
+  int tempbuf[institute_nints];
+  tempbuf[0] = p->self;
+  tempbuf[1] = p->center;
+  tempbuf[2] = p->subcenter;
+  tempbuf[3] = (int)strlen(p->name) + 1;
+  tempbuf[4] = (int)strlen(p->longname) + 1;
+  xmpi(MPI_Pack(tempbuf, institute_nints, MPI_INT, buf, size, position, comm));
+  xmpi(MPI_Pack(p->name, tempbuf[3], MPI_CHAR, buf, size, position, comm));
+  xmpi(MPI_Pack(p->longname, tempbuf[4], MPI_CHAR, buf, size, position, comm));
+}
+
+int
+instituteUnpack(void *buf, int size, int *position, int nspTarget,
+                MPI_Comm comm)
+{
+  int tempbuf[institute_nints];
+  int instituteID;
+  char *name, *longname;
+  xmpi(MPI_Unpack(buf, size, position, tempbuf, institute_nints, MPI_INT, comm));
+  name = xmalloc(tempbuf[3]);
+  longname = xmalloc(tempbuf[4]);
+  xmpi(MPI_Unpack(buf, size, position, name, tempbuf[3], MPI_CHAR, comm));
+  xmpi(MPI_Unpack(buf, size, position, longname, tempbuf[4], MPI_CHAR, comm));
+  instituteID = institutDef(tempbuf[1], tempbuf[2], name, longname);
+  // FIXME: this should work, once all types are transferred
+  //xassert(instituteID == tempbuf[0]);
+  return instituteID;
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <ctype.h>
+
+
+#undef  UNDEFID
+#define UNDEFID -1
+
+/*int TableDefine = 0; */ /* Define new table also if the entry already exist */
+                          /* This is needed for createtable */
+
+
+#define MAX_TABLE  256
+#define MAX_PARS   1024
+
+typedef struct
+{
+  int    used;  
+  PAR   *pars;
+  int    npars;
+  int    modelID;
+  int    number;
+  char  *name;
+} 
+PARTAB;
+
+static PARTAB parTable[MAX_TABLE];
+static int  parTableSize = MAX_TABLE;
+static int  parTableNum  = 0;
+static int  ParTableInit = 0;
+
+static char *tablePath = NULL;
+
+void tableDefModelID(int tableID, int modelID);
+void tableDefNum(int tableID, int tablenum);
+
+
+void tableDefEntry(int tableID, int id, const char *name,
+		   const char *longname, const char *units)
+{
+  int item;
+
+  item = parTable[tableID].npars++;
+  parTable[tableID].pars[item].id       = id;
+  parTable[tableID].pars[item].name     = NULL;
+  parTable[tableID].pars[item].longname = NULL;
+  parTable[tableID].pars[item].units    = NULL;
+
+  if ( name )
+    if ( strlen(name) > 0 )
+      parTable[tableID].pars[item].name     = strdupx(name);
+  if ( longname )
+    if ( strlen(longname) > 0 )
+      parTable[tableID].pars[item].longname = strdupx(longname);
+  if ( units )
+    if ( strlen(units) > 0 )
+      parTable[tableID].pars[item].units    = strdupx(units);
+}
+
+void tableLink(int tableID, PAR *pars, int npars)
+{
+  int item;
+
+  for ( item = 0; item < npars; item++ )
+    {
+      parTable[tableID].pars[item].id       = pars[item].id;
+      parTable[tableID].pars[item].name     = pars[item].name;
+      parTable[tableID].pars[item].longname = pars[item].longname;
+      parTable[tableID].pars[item].units    = pars[item].units;
+    }
+
+  parTable[tableID].npars = npars;
+}
+
+void parTableInitEntry(int tableID)
+{
+  parTable[tableID].used    = 0;
+  parTable[tableID].pars    = NULL;
+  parTable[tableID].npars   = 0;
+  parTable[tableID].modelID = UNDEFID;
+  parTable[tableID].number  = UNDEFID;
+  parTable[tableID].name    = NULL;
+}
+
+void tableGetPath(void)
+{
+  char *path;
+
+  path = getenv("TABLEPATH");
+
+  if ( path ) tablePath = strdupx(path);
+  /*
+  printf("tablePath = %s\n", tablePath);
+  */
+}
+
+void parTableInit(void)
+{
+  ParTableInit = 1;
+
+  if ( cdiPartabIntern )
+    tableDefault();
+
+  tableGetPath();
+}
+
+int tableNewEntry()
+{
+  int tableID = 0;
+  static int init = 0;
+
+  if ( ! init )
+    {
+      for ( tableID = 0; tableID < parTableSize; tableID++ )
+	parTableInitEntry(tableID);
+      init = 1;
+    }
+
+  /*
+    Look for a free slot in parTable.
+  */
+  for ( tableID = 0; tableID < parTableSize; tableID++ )
+    {
+      if ( ! parTable[tableID].used ) break;
+    }
+
+  if ( tableID == parTableSize )
+    Error("no more entries!");
+
+  parTable[tableID].used = 1;
+  parTableNum++;
+
+  return (tableID);
+}
+
+int decodeForm1(char *pline, char *name, char *longname, char *units)
+{
+  /* Format 1 : code name add mult longname [units] */
+  double add, mult;
+  int level;
+  char *pstart, *pend;
+  long len;
+
+  level = strtol(pline, &pline, 10);
+  while ( isspace((int) *pline) ) pline++;
+
+  pstart = pline;
+  while ( ! (isspace((int) *pline) || *pline == 0) ) pline++;
+  len = pline - pstart;
+  if ( len > 0 )
+    {
+      memcpy(name, pstart, len);
+      name[len] = 0;
+    }
+  else
+    return (0);
+
+  len = strlen(pline);
+  if ( len == 0 ) return (0);
+
+  add  = strtod(pline, &pline);
+  mult = strtod(pline, &pline);
+
+  while ( isspace((int) *pline) ) pline++;
+
+  len = strlen(pline);
+  if ( len > 0)
+    {
+      pstart = pline;
+      pend = strrchr(pline, '[');
+      if ( pend )
+	pend--;
+      else
+	pend = pstart + len;
+      while ( isspace((int) *pend) ) pend--;
+      len = pend - pstart + 1;
+      if ( len > 0 )
+	{
+	  memcpy(longname, pstart, len);
+	  longname[len] = 0;
+	}
+      pstart = strrchr(pline, '[');
+      if ( pstart )
+	{
+	  pstart++;
+	  while ( isspace((int) *pstart) ) pstart++;
+	  pend = strchr(pstart, ']');
+	  if ( ! pend ) return (0);
+	  pend--;
+	  while ( isspace((int) *pend) ) pend--;
+	  len = pend - pstart + 1;
+	  if ( len > 0 )
+	    {
+	      memcpy(units, pstart, len);
+	      units[len] = 0;
+	    }	  
+	}
+    }
+ 
+  return (0);
+}
+
+int decodeForm2(char *pline, char *name, char *longname, char *units)
+{
+  /* Format 2 : code | name | longname | units */
+  char *pend;
+  long len;
+
+  pline = strchr(pline, '|');
+  pline++;
+
+  while ( isspace((int) *pline) ) pline++;
+  pend = strchr(pline, '|');
+  if ( ! pend )
+    {
+      pend = pline;
+      while ( ! isspace((int) *pend) ) pend++;
+      len = pend - pline;
+      if ( len > 0 )
+	{
+	  memcpy(name, pline, len);
+	  name[len] = 0;
+	}
+      return (0);
+    }
+  else
+    {
+      pend--;
+      while ( isspace((int) *pend) ) pend--;
+      len = pend - pline + 1;
+      if ( len > 0 )
+	{
+	  memcpy(name, pline, len);
+	  name[len] = 0;
+	}
+    }
+
+  pline = strchr(pline, '|');
+  pline++;
+  while ( isspace((int) *pline) ) pline++;
+  pend = strchr(pline, '|');
+  if ( !pend ) pend = strchr(pline, 0);
+  pend--;
+  while ( isspace((int) *pend) ) pend--;
+  len = pend - pline + 1;
+  if ( len > 0 )
+    {
+      memcpy(longname, pline, len);
+      longname[len] = 0;
+    }
+
+  pline = strchr(pline, '|');
+  if ( pline )
+    {
+      pline++;
+      while ( isspace((int) *pline) ) pline++;
+      pend = strchr(pline, '|');
+      if ( !pend ) pend = strchr(pline, 0);
+      pend--;
+      while ( isspace((int) *pend) ) pend--;
+      len = pend - pline + 1;
+      if ( len < 0 ) len = 0;
+      memcpy(units, pline, len);
+      units[len] = 0;
+    }
+
+  return (0);
+}
+
+int tableRead(const char *tablefile)
+{
+  char line[1024], *pline;
+  int lnr = 0;
+  long len;
+  int id;
+  char name[256], longname[256], units[256];
+  int tableID = UNDEFID;
+  int err;
+  char *tablename;
+  FILE *tablefp;
+
+  tablefp = fopen(tablefile, "r");
+  if ( tablefp == NULL ) return (tableID);
+
+  tablename = strrchr(tablefile, '/');
+  if ( tablename == 0 ) tablename = (char *) tablefile;
+  else                  tablename++;
+
+  tableID = tableDef(-1, 0, tablename);
+
+  while ( fgets(line, 1023, tablefp) )
+    {
+      len = strlen(line);
+      if ( line[len-1] == '\n' ) line[len-1] = '\0';
+      lnr++;
+      id       = CDI_UNDEFID;
+      name[0]     = 0;
+      longname[0] = 0;
+      units[0]    = 0;
+      if ( line[0] == '#' ) continue;
+      pline = line;
+
+      len = strlen(pline);
+      if ( len < 4 ) continue;
+      while ( isspace((int) *pline) ) pline++;
+      id = atoi(pline);
+      /*
+      if ( id > 255 ) id -= 256;
+      */
+      if ( id == 0 ) continue;
+
+      while ( isdigit((int) *pline) ) pline++; 
+
+      if ( strchr(pline, '|') )
+	err = decodeForm2(pline, name, longname, units);
+      else
+	err = decodeForm1(pline, name, longname, units);
+
+      if ( err ) continue;
+
+      if ( strlen(name) == 0 ) sprintf(name, "var%d", id);
+
+      tableDefEntry(tableID, id, name, longname, units);
+    }
+
+  return (tableID);
+}
+
+int tableFromEnv(int modelID, int tablenum)
+{
+  int tableID = UNDEFID;
+  char tablename[256] = {'\0'};
+  int tablenamefound = 0;
+
+  if ( modelInqNamePtr(modelID) )
+    {
+      strcpy(tablename, modelInqNamePtr(modelID));
+      if ( tablenum )
+	{
+	  int len = strlen(tablename);
+	  sprintf(tablename+len, "_%03d", tablenum);
+	}
+      tablenamefound = 1;
+    }
+  else
+    {
+      int instID = modelInqInstitut(modelID);
+      if ( instID != UNDEFID )
+	{
+	  if ( institutInqNamePtr(instID) )
+	    {
+	      strcpy(tablename, institutInqNamePtr(instID));
+	      if ( tablenum )
+		{
+		  int len = strlen(tablename);
+		  sprintf(tablename+len, "_%03d", tablenum);
+		}
+	      tablenamefound = 1;
+	    }
+	}
+    }
+
+  if ( tablenamefound )
+    {
+      int lenp = 0, lenf;
+      char *tablefile = NULL;
+      if ( tablePath )
+	lenp = strlen(tablePath);
+      lenf = strlen(tablename);
+      /* if (tablePath) printf("tablePath = %s\n", tablePath); */
+      /* if (tablename) printf("tableName = %s\n", tablename); */
+      tablefile = (char *) malloc(lenp+lenf+3);
+      if ( tablePath )
+	{
+	  strcpy(tablefile, tablePath);
+	  strcat(tablefile, "/");
+	}
+      else
+	tablefile[0] = '\0';
+      strcat(tablefile, tablename);
+      /* if (tablefile) printf("tableFile = %s\n", tablefile); */
+
+      tableID = tableRead(tablefile);
+      if ( tableID != UNDEFID )
+	{
+	  tableDefModelID(tableID, modelID);
+	  tableDefNum(tableID, tablenum);
+	}
+      /* printf("tableID = %d %s\n", tableID, tablefile); */
+
+      free(tablefile);
+    }
+
+  return (tableID);
+}
+
+int tableInq(int modelID, int tablenum, const char *tablename)
+{
+  int tableID = UNDEFID;
+  int modelID2 = UNDEFID, i, len;
+  char tablefile[256] = {'\0'};
+
+  if ( ! ParTableInit ) parTableInit();
+
+  if ( tablename )
+    {
+      size_t len;
+      strcpy(tablefile, tablename);
+      /*
+      printf("tableInq: tablefile = >%s<\n", tablefile);
+      */
+      /* search for internal table */
+      for ( tableID = 0; tableID < MAX_TABLE; tableID++ )
+	{
+	  if ( parTable[tableID].used && parTable[tableID].name )
+	    {
+	      /* len = strlen(parTable[tableID].name); */
+	      len = strlen(tablename);
+	      if ( memcmp(parTable[tableID].name, tablename, len) == 0 ) break;
+	    }
+	}
+      if ( tableID == MAX_TABLE ) tableID = UNDEFID;
+      if ( CDI_Debug )
+	Message("tableID = %d tablename = %s", tableID, tablename);
+    }
+  else
+    {
+      for ( tableID = 0; tableID < MAX_TABLE; tableID++ )
+	{
+	  if ( parTable[tableID].used )
+	    {	  
+	      if ( parTable[tableID].modelID == modelID &&
+		   parTable[tableID].number  == tablenum ) break;
+	    }
+	}
+  
+      if ( tableID == MAX_TABLE ) tableID = UNDEFID;
+
+      if ( tableID == UNDEFID )
+	{
+	  if ( modelID != UNDEFID )
+	    {
+	      if ( modelInqNamePtr(modelID) )
+		{
+		  strcpy(tablefile, modelInqNamePtr(modelID));
+		  len = strlen(tablefile);
+		  for ( i = 0; i < len; i++)
+		    if ( tablefile[i] == '.' ) tablefile[i] = '\0';
+		  modelID2 = modelInq(-1, 0, tablefile);
+		}
+	    }
+	  if ( modelID2 != UNDEFID )
+	    for ( tableID = 0; tableID < MAX_TABLE; tableID++ )
+	      {
+		if ( parTable[tableID].used )
+		  {
+		    if ( parTable[tableID].modelID == modelID2 &&
+			 parTable[tableID].number  == tablenum ) break;
+		  }
+	      }
+	}
+
+      if ( tableID == MAX_TABLE ) tableID = UNDEFID;
+
+      if ( tableID == UNDEFID && modelID != UNDEFID )
+	tableID = tableFromEnv(modelID, tablenum);
+
+      if ( CDI_Debug )
+	if ( tablename )
+	  Message("tableID = %d tablename = %s", tableID, tablename);
+    }
+
+  return (tableID);
+}
+
+int tableDef(int modelID, int tablenum, const char *tablename)
+{
+  int tableID = UNDEFID;
+
+  if ( ! ParTableInit ) parTableInit();
+  /*
+  if ( ! (modelID == UNDEFID && tablenum == 0) )
+    tableID = tableInq(modelID, tablenum, tablename);
+    */
+  if ( tableID == UNDEFID )
+    {
+      tableID = tableNewEntry();
+
+      parTable[tableID].modelID = modelID;
+      parTable[tableID].number  = tablenum;
+      if ( tablename ) 
+	parTable[tableID].name = strdupx(tablename);
+
+      parTable[tableID].pars = (PAR *) malloc(MAX_PARS * sizeof(PAR));
+    }
+
+  return (tableID);
+}
+
+void tableDefModelID(int tableID, int modelID)
+{
+  parTable[tableID].modelID = modelID;
+}
+
+void tableDefNum(int tableID, int tablenum)
+{
+  parTable[tableID].number  = tablenum;
+}
+
+int tableInqNum(int tableID)
+{
+  int number = 0;
+
+  if ( tableID >= 0 && tableID < MAX_TABLE )
+    number = parTable[tableID].number;
+
+  return (number);
+}
+
+int tableInqModel(int tableID)
+{
+  int modelID = -1;
+
+  if ( tableID >= 0 && tableID < MAX_TABLE )
+    modelID = parTable[tableID].modelID;
+
+  return (modelID);
+}
+
+void partabCheckID(int item)
+{
+  if ( item < 0 || item >= parTableSize )
+    Error("item %d undefined!", item);
+
+  if ( ! parTable[item].name )
+    Error("item %d name undefined!", item);
+}
+
+char *tableInqNamePtr(int tableID)
+{
+  char *tablename = NULL;
+
+  if ( CDI_Debug )
+    Message("tableID = %d", tableID);
+
+  if ( ! ParTableInit ) parTableInit();
+
+  if ( tableID >= 0 && tableID < parTableSize )
+    if ( parTable[tableID].name )
+      tablename = parTable[tableID].name;
+
+  return (tablename);
+}
+
+void tableWrite(const char *ptfile, int tableID)
+{
+  int item, npars;
+  int lenname, lenlname, lenunits;
+  int maxname = 4, maxlname = 10, maxunits = 2;
+  FILE *ptfp;
+  int tablenum, modelID, instID = CDI_UNDEFID;
+  int center = 0, subcenter = 0;
+  char *name, *longname, *units;
+  char *instnameptr = NULL, *modelnameptr = NULL;
+
+  if ( CDI_Debug )
+    Message("write parameter table %d to %s", tableID, ptfile);
+
+  if ( tableID == UNDEFID )
+    {
+      Warning("parameter table ID undefined");
+      return;
+    }
+
+  partabCheckID(tableID);
+
+  ptfp = fopen(ptfile, "w");
+
+  npars = parTable[tableID].npars;
+
+  for ( item = 0; item < npars; item++)
+    {
+      if ( parTable[tableID].pars[item].name )
+	{
+	  lenname  = strlen(parTable[tableID].pars[item].name);
+	  if ( lenname  > maxname )  maxname  = lenname;
+	}
+
+      if ( parTable[tableID].pars[item].longname )
+	{
+	  lenlname = strlen(parTable[tableID].pars[item].longname);
+	  if ( lenlname > maxlname ) maxlname = lenlname;
+	}
+
+      if ( parTable[tableID].pars[item].units )
+	{
+	  lenunits = strlen(parTable[tableID].pars[item].units);
+	  if ( lenunits > maxunits ) maxunits = lenunits;
+	}
+    }
+
+  tablenum = tableInqNum(tableID);
+  modelID = parTable[tableID].modelID;
+  if ( modelID != CDI_UNDEFID )
+    {
+      modelnameptr = modelInqNamePtr(modelID);
+      instID = modelInqInstitut(modelID);
+    }
+  if ( instID != CDI_UNDEFID )
+    {
+      center = institutInqCenter(instID);
+      subcenter = institutInqSubcenter(instID);
+      instnameptr = institutInqNamePtr(instID);
+    }
+
+  fprintf(ptfp, "# Parameter table\n");
+  fprintf(ptfp, "#\n");
+  if ( tablenum )
+    fprintf(ptfp, "# TABLE_ID=%d\n", tablenum);
+  fprintf(ptfp, "# TABLE_NAME=%s\n", parTable[tableID].name);
+  if ( modelnameptr )
+    fprintf(ptfp, "# TABLE_MODEL=%s\n", modelnameptr);
+  if ( instnameptr )
+    fprintf(ptfp, "# TABLE_INSTITUT=%s\n", instnameptr);
+  if ( center )
+    fprintf(ptfp, "# TABLE_CENTER=%d\n", center);
+  if ( subcenter )
+    fprintf(ptfp, "# TABLE_SUBCENTER=%d\n", subcenter);
+  fprintf(ptfp, "#\n");
+  fprintf(ptfp, "#\n");
+  fprintf(ptfp, "# id       = parameter ID\n");
+  fprintf(ptfp, "# name     = variable name\n");
+  fprintf(ptfp, "# title    = long name (description)\n");
+  fprintf(ptfp, "# units    = variable units\n");
+  fprintf(ptfp, "#\n");
+  fprintf(ptfp, "# The format of each record is:\n");
+  fprintf(ptfp, "#\n");
+  fprintf(ptfp, "# id | %-*s | %-*s | %-*s\n",
+	  maxname,  "name",
+	  maxlname, "title",
+	  maxunits, "units");
+	  
+  for ( item = 0; item < npars; item++)
+    {
+      name = parTable[tableID].pars[item].name;
+      longname = parTable[tableID].pars[item].longname;
+      units = parTable[tableID].pars[item].units;
+      if ( name == NULL ) name = " ";
+      if ( longname == NULL ) longname = " ";
+      if ( units == NULL ) units = " ";
+      fprintf(ptfp, "%4d | %-*s | %-*s | %-*s\n",
+	      parTable[tableID].pars[item].id,
+	      maxname, name,
+	      maxlname, longname,
+	      maxunits, units);
+    }
+
+  fclose(ptfp);
+}
+
+
+void tableWriteC(const char *filename, int tableID)
+{
+  char chelp[] = "";
+  int item, npars;
+  int lenname, lenlname, lenunits;
+  int maxname = 0, maxlname = 0, maxunits = 0;
+  char tablename[256];
+  int len, i;
+  FILE *ptfp;
+
+  if ( CDI_Debug )
+    Message("write parameter table %d to %s", tableID, filename);
+
+  if ( tableID == UNDEFID )
+    {
+      Warning("parameter table ID undefined");
+      return;
+    }
+
+  partabCheckID(tableID);
+
+  ptfp = fopen(filename, "w");
+
+  npars = parTable[tableID].npars;
+
+  for ( item = 0; item < npars; item++)
+    {
+      if ( parTable[tableID].pars[item].name )
+	{
+	  lenname  = strlen(parTable[tableID].pars[item].name);
+	  if ( lenname  > maxname )  maxname  = lenname;
+	}
+
+      if ( parTable[tableID].pars[item].longname )
+	{
+	  lenlname = strlen(parTable[tableID].pars[item].longname);
+	  if ( lenlname > maxlname ) maxlname = lenlname;
+	}
+
+      if ( parTable[tableID].pars[item].units )
+	{
+	  lenunits = strlen(parTable[tableID].pars[item].units);
+	  if ( lenunits > maxunits ) maxunits = lenunits;
+	}
+    }
+
+  strcpy(tablename, parTable[tableID].name);
+  len = strlen(tablename);
+
+  for ( i = 0; i < len; i++ )
+    if ( tablename[i] == '.' ) tablename[i] = '_';
+
+  fprintf(ptfp, "static PAR %s[] = {\n", tablename);
+	  
+  for ( item = 0; item < npars; item++ )
+    {
+      len = strlen(parTable[tableID].pars[item].name);
+      fprintf(ptfp, "  {%4d, \"%s\", %-*s",
+	      parTable[tableID].pars[item].id,
+	      parTable[tableID].pars[item].name, maxname-len, chelp);
+
+      if ( parTable[tableID].pars[item].longname )
+	len = strlen(parTable[tableID].pars[item].longname);
+      else
+	len = 0;
+
+      if ( len == 0 )
+	fprintf(ptfp, " NULL, %-*s", maxlname-3, chelp);
+      else
+	fprintf(ptfp, "\"%s\", %-*s",
+		parTable[tableID].pars[item].longname, maxlname-len, chelp);
+
+      if ( parTable[tableID].pars[item].units )
+	len = strlen(parTable[tableID].pars[item].units);
+      else
+	len = 0;
+
+      if ( len == 0 )
+	fprintf(ptfp, " NULL %-*s},\n", maxunits-3, chelp);
+      else
+	fprintf(ptfp, "\"%s\" %-*s},\n",
+		parTable[tableID].pars[item].units,
+		maxunits-len, chelp);
+    }
+
+  fprintf(ptfp, "};\n\n");
+
+  fclose(ptfp);
+}
+
+
+int tableInqParCode(int tableID, char *varname, int *code)
+{
+  int item, npars;
+  int err = 0;
+
+  npars = parTable[tableID].npars;
+
+  if ( tableID == UNDEFID || varname == NULL )
+    {
+      err = 1;
+    }
+  else
+    {
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].name )
+	    if ( strcmp(parTable[tableID].pars[item].name, varname) == 0 )
+	      {
+		*code = parTable[tableID].pars[item].id;
+		break;
+	      }
+	}
+      if ( item == npars ) err = 1;
+    }
+
+  return (err);
+}
+
+
+int tableInqParName(int tableID, int code, char *varname)
+{
+  int item, npars;
+  int err = 0;
+
+  npars = parTable[tableID].npars;
+
+  if ( tableID == UNDEFID )
+    {
+      err = 1;
+    }
+  else
+    {
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      if ( parTable[tableID].pars[item].name )
+		strcpy(varname, parTable[tableID].pars[item].name);
+	      break;
+	    }
+	}
+      if ( item == npars ) err = 1;
+    }
+
+  return (err);
+}
+
+
+char *tableInqParNamePtr(int tableID, int code)
+{
+  char *name = NULL;
+  int item, npars;
+
+  if ( tableID != UNDEFID )
+    {
+      npars = parTable[tableID].npars;
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      name = parTable[tableID].pars[item].name;
+	      break;
+	    }
+	}
+    }
+
+  return (name);
+}
+
+
+char *tableInqParLongnamePtr(int tableID, int code)
+{
+  char *longname = NULL;
+  int item, npars;
+
+  if ( tableID != UNDEFID )
+    {
+      npars = parTable[tableID].npars;
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      longname = parTable[tableID].pars[item].longname;
+	      break;
+	    }
+	}
+    }
+
+  return (longname);
+}
+
+
+char *tableInqParUnitsPtr(int tableID, int code)
+{
+  char *units = NULL;
+  int item, npars;
+
+  if ( tableID != UNDEFID )
+    {
+      npars = parTable[tableID].npars;
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      units = parTable[tableID].pars[item].units;
+	      break;
+	    }
+	}
+    }
+
+  return (units);
+}
+
+
+int tableInqParLongname(int tableID, int code, char *longname)
+{
+  int item, npars;
+  int err = 0;
+
+  npars = parTable[tableID].npars;
+
+  if ( tableID == UNDEFID )
+    {
+      err = 1;
+    }
+  else
+    {
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      if ( parTable[tableID].pars[item].longname )
+		strcpy(longname, parTable[tableID].pars[item].longname);
+	      break;
+	    }
+	}
+      if ( item == npars ) err = 1;
+    }
+
+  return (err);
+}
+
+
+int tableInqParUnits(int tableID, int code, char *units)
+{
+  int item, npars;
+  int err = 0;
+
+  npars = parTable[tableID].npars;
+
+  if ( tableID == UNDEFID )
+    {
+      err = 1;
+    }
+  else
+    {
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      if ( parTable[tableID].pars[item].units )
+		strcpy(units, parTable[tableID].pars[item].units);
+	      break;
+	    }
+	}
+      if ( item == npars ) err = 1;
+    }
+
+  return (err);
+}
+
+
+void tableInqPar(int tableID, int code, char *name, char *longname, char *units)
+{
+  int item, npars;
+
+  npars = parTable[tableID].npars;
+
+  for ( item = 0; item < npars; item++ )
+    {
+      if ( parTable[tableID].pars[item].id == code )
+	{
+	  if ( parTable[tableID].pars[item].name )
+	    strcpy(name, parTable[tableID].pars[item].name);
+	  if ( parTable[tableID].pars[item].longname )
+	    strcpy(longname, parTable[tableID].pars[item].longname);
+	  if ( parTable[tableID].pars[item].units )
+	    strcpy(units, parTable[tableID].pars[item].units);
+	  break;
+	}
+    }
+}
+
+
+int parInqID(int tableID, int code)
+{
+  int item, npars;
+
+  npars = parTable[tableID].npars;
+
+  for ( item = 0; item < npars; item++ )
+    {
+      if ( parTable[tableID].pars[item].id == code ) break;
+    }
+
+  if ( item == npars ) item = -1;
+
+  return (item);
+}
+
+int tableInqNumber(void)
+{
+  if ( ! ParTableInit ) parTableInit();
+
+  return (parTableNum);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+#include <sys/types.h>
+
+
+
+#undef  IsBigendian
+#define IsBigendian()  ( u_byteorder.c[sizeof(long) - 1] )
+
+void cdiPrintDatatypes(void)
+{
+  /* IsBigendian returns 1 for big endian byte order */
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+
+  fprintf (stderr, "+-------------+-------+\n"); 
+  fprintf (stderr, "| types       | bytes |\n"); 
+  fprintf (stderr, "+-------------+-------+\n"); 
+  fprintf (stderr, "| void *      |   %3d |\n", (int) sizeof(void *));
+  fprintf (stderr, "+-------------+-------+\n"); 
+  fprintf (stderr, "| char        |   %3d |\n", (int) sizeof(char));
+  fprintf (stderr, "+-------------+-------+\n"); 
+  fprintf (stderr, "| short       |   %3d |\n", (int) sizeof(short));
+  fprintf (stderr, "| int         |   %3d |\n", (int) sizeof(int));
+  fprintf (stderr, "| long        |   %3d |\n", (int) sizeof(long));
+  fprintf (stderr, "| long long   |   %3d |\n", (int) sizeof(long long));
+  fprintf (stderr, "| size_t      |   %3d |\n", (int) sizeof(size_t));
+  fprintf (stderr, "| off_t       |   %3d |\n", (int) sizeof(off_t));
+  fprintf (stderr, "+-------------+-------+\n"); 
+  fprintf (stderr, "| float       |   %3d |\n", (int) sizeof(float));
+  fprintf (stderr, "| double      |   %3d |\n", (int) sizeof(double));
+  fprintf (stderr, "| long double |   %3d |\n", (int) sizeof(long double));
+  fprintf (stderr, "+-------------+-------+\n\n"); 
+#define XSTRING(x)	#x
+#define STRING(x)	XSTRING(x)
+  fprintf (stderr, "+-------------+-----------+\n"); 
+  fprintf (stderr, "| INT32       | %-9s |\n", STRING(INT32));
+  fprintf (stderr, "| INT64       | %-9s |\n", STRING(INT64));
+  fprintf (stderr, "| FLT32       | %-9s |\n", STRING(FLT32));
+  fprintf (stderr, "| FLT64       | %-9s |\n", STRING(FLT64));
+  fprintf (stderr, "+-------------+-----------+\n");
+
+  if ( IsBigendian() )
+    fprintf (stderr, "\n  byte ordering is BIGENDIAN\n\n");
+  else
+    fprintf (stderr, "\n  byte ordering is LITTLEENDIAN\n\n");
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#include <math.h>
+#include <float.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+
+#ifndef  M_PI
+#define  M_PI        3.14159265358979323846  /* pi */
+#endif
+
+#ifndef  M_SQRT2
+#define  M_SQRT2     1.41421356237309504880
+#endif
+
+
+static
+void cpledn(int kn, int kodd, double *pfn, double pdx, int kflag, 
+            double *pw, double *pdxn, double *pxmod)
+{
+  double zdlk;
+  double zdlldn;
+  double zdlx;
+  double zdlmod;
+  double zdlxn;
+
+  int ik, jn;
+
+  /* 1.0 Newton iteration step */
+
+  zdlx = pdx;
+  zdlk = 0.0;
+  if (kodd == 0) 
+    {
+      zdlk = 0.5*pfn[0];
+    }
+  zdlxn  = 0.0;
+  zdlldn = 0.0;
+
+  ik = 1;
+
+  if (kflag == 0) 
+    {
+      for(jn = 2-kodd; jn <= kn; jn += 2) 
+	{
+	  /* normalised ordinary Legendre polynomial == \overbar{p_n}^0 */
+	  zdlk   = zdlk + pfn[ik]*cos((double)(jn)*zdlx);
+	  /* normalised derivative == d/d\theta(\overbar{p_n}^0) */
+	  zdlldn = zdlldn - pfn[ik]*(double)(jn)*sin((double)(jn)*zdlx);
+	  ik++;
+	}
+      /* Newton method */
+      zdlmod = -(zdlk/zdlldn);
+      zdlxn = zdlx + zdlmod;
+      *pdxn = zdlxn;
+      *pxmod = zdlmod;
+    }
+
+  /* 2.0 Compute weights */
+
+  if (kflag == 1) 
+    {
+      for(jn = 2-kodd; jn <= kn; jn += 2) 
+	{
+	  /* normalised derivative */
+	  zdlldn = zdlldn - pfn[ik]*(double)(jn)*sin((double)(jn)*zdlx);
+	  ik++;
+	}
+      *pw = (double)(2*kn+1)/(zdlldn*zdlldn);
+    }
+
+  return;
+}
+
+static
+void gawl(double *pfn, double *pl, double *pw, int kn, int *kiter)
+{
+  int iodd;
+  double pmod = 0;
+  int iflag;
+  int itemax;
+  int jter;
+  double zw = 0;
+  double zdlx;
+  double zdlxn = 0;
+
+  /* 1.0 Initizialization */
+
+  iflag  =  0;
+  itemax = 20;
+
+  iodd   = (kn % 2);
+
+  zdlx   =  *pl;
+
+  /* 2.0 Newton iteration */
+
+  for (jter = 1; jter <= itemax+1; jter++) 
+    {
+      *kiter = jter;
+      cpledn(kn, iodd, pfn, zdlx, iflag, &zw, &zdlxn, &pmod);
+      zdlx = zdlxn;
+      if (iflag == 1) break;
+      if (fabs(pmod) <= DBL_EPSILON*1000.0) iflag = 1;
+    }
+
+  *pl = zdlxn;
+  *pw = zw;
+
+  return;
+}
+
+static
+void gauaw(int kn, double *pl, double *pw)
+{
+  /*
+   * 1.0 Initialize Fourier coefficients for ordinary Legendre polynomials
+   *
+   * Belousov, Swarztrauber, and ECHAM use zfn(0,0) = sqrt(2)
+   * IFS normalisation chosen to be 0.5*Integral(Pnm**2) = 1 (zfn(0,0) = 2.0)
+   */
+  double *zfn, *zfnlat;
+
+  double z, zfnn;
+
+  int *iter;
+
+  int ik, ins2, isym, jgl, jglm1, jn, iodd;
+
+  iter   = (int *)    malloc(kn*sizeof(int));
+  zfn    = (double *) malloc((kn+1)*(kn+1)*sizeof(double));
+  zfnlat = (double *) malloc((kn/2+1+1)*sizeof(double));  
+
+  zfn[0] = M_SQRT2;
+  for (jn = 1; jn <= kn; jn++)
+    {
+      zfnn = zfn[0];
+      for (jgl = 1; jgl <= jn; jgl++)
+	{
+	  zfnn *= sqrt(1.0-0.25/((double)(jgl*jgl))); 
+	}
+
+      zfn[jn*(kn+1)+jn] = zfnn;
+
+      iodd = jn % 2;
+      for (jgl = 2; jgl <= jn-iodd; jgl += 2) 
+	{
+	  zfn[jn*(kn+1)+jn-jgl] = zfn[jn*(kn+1)+jn-jgl+2]
+	    *((double)((jgl-1)*(2*jn-jgl+2)))/((double)(jgl*(2*jn-jgl+1)));
+	}
+    }
+
+
+  /* 2.0 Gaussian latitudes and weights */
+
+  iodd = kn % 2;
+  ik = iodd;
+  for (jgl = iodd; jgl <= kn; jgl += 2)
+    {
+      zfnlat[ik] = zfn[kn*(kn+1)+jgl];
+      ik++;
+    } 
+
+  /*
+   * 2.1 Find first approximation of the roots of the
+   *     Legendre polynomial of degree kn.
+   */
+
+  ins2 = kn/2+(kn % 2);
+
+  for (jgl = 1; jgl <= ins2; jgl++) 
+    {
+      z = ((double)(4*jgl-1))*M_PI/((double)(4*kn+2)); 
+      pl[jgl-1] = z+1.0/(tan(z)*((double)(8*kn*kn)));
+    }
+
+  /* 2.2 Computes roots and weights for transformed theta */
+
+  for (jgl = ins2; jgl >= 1 ; jgl--) 
+    {
+      jglm1 = jgl-1;
+      gawl(zfnlat, &(pl[jglm1]), &(pw[jglm1]), kn, &(iter[jglm1]));
+    }
+
+  /* convert to physical latitude */
+
+  for (jgl = 0; jgl < ins2; jgl++) 
+    {
+      pl[jgl] = cos(pl[jgl]);
+    }
+
+  for (jgl = 1; jgl <= kn/2; jgl++) 
+    {
+      jglm1 = jgl-1;
+      isym =  kn-jgl;
+      pl[isym] =  -pl[jglm1];
+      pw[isym] =  pw[jglm1];
+    }
+
+  free(zfnlat);
+  free(zfn);
+  free(iter);
+
+  return;
+}
+
+#if 0
+static
+void gauaw_old(double *pa, double *pw, int nlat)
+{
+  /*
+   * Compute Gaussian latitudes.  On return pa contains the
+   * sine of the latitudes starting closest to the north pole and going
+   * toward the south
+   *
+   */
+
+  const int itemax = 20;
+
+  int isym, iter, ins2, jn, j;
+  double za, zw, zan;
+  double z, zk, zkm1, zkm2, zx, zxn, zldn, zmod;
+
+  /*
+   * Perform the Newton loop
+   * Find 0 of Legendre polynomial with Newton loop
+   */
+
+  ins2 = nlat/2 + nlat%2;
+
+  for ( j = 0; j < ins2; j++ )
+    {
+      z = (double) (4*(j+1)-1)*M_PI / (double) (4*nlat+2);
+      pa[j] = cos(z + 1.0/(tan(z)*(double)(8*nlat*nlat)));
+    }
+
+  for ( j = 0; j < ins2; j++ )
+    {
+
+      za = pa[j];
+
+      iter = 0;
+      do
+	{
+	  iter++;
+	  zk = 0.0;
+
+	  /* Newton iteration step */
+
+	  zkm2 = 1.0;
+	  zkm1 = za;
+	  zx = za;
+	  for ( jn = 2; jn <= nlat; jn++ )
+	    {
+	      zk = ((double) (2*jn-1)*zx*zkm1-(double)(jn-1)*zkm2) / (double)(jn);
+	      zkm2 = zkm1;
+	      zkm1 = zk;
+	    }
+	  zkm1 = zkm2;
+	  zldn = ((double) (nlat)*(zkm1-zx*zk)) / (1.-zx*zx);
+	  zmod = -zk/zldn;
+	  zxn = zx+zmod;
+	  zan = zxn;
+
+	  /* computes weight */
+
+	  zkm2 = 1.0;
+	  zkm1 = zxn;
+	  zx = zxn;
+	  for ( jn = 2; jn <= nlat; jn++ )
+	    {
+	      zk = ((double) (2*jn-1)*zx*zkm1-(double)(jn-1)*zkm2) / (double) (jn);
+	      zkm2 = zkm1;
+	      zkm1 = zk;
+	    }
+	  zkm1 = zkm2;
+	  zw = (1.0-zx*zx) / ((double) (nlat*nlat)*zkm1*zkm1);
+	  za = zan;
+	}
+      while ( iter <= itemax && fabs(zmod) >= DBL_EPSILON );
+
+      pa[j] = zan;
+      pw[j] = 2.0*zw;
+    }
+
+#if defined (SX)
+#pragma vdir nodep
+#endif
+  for (j = 0; j < nlat/2; j++)
+    {
+      isym = nlat-(j+1);
+      pa[isym] = -pa[j];
+      pw[isym] =  pw[j];
+    }
+
+  return;
+}
+#endif
+
+void gaussaw(double *pa, double *pw, int nlat)
+{
+  //gauaw_old(pa, pw, nlat);
+  gauaw(nlat, pa, pw);
+}
+
+/*
+#define NGL  48
+
+int main (int rgc, char *argv[])
+{
+  int ngl = NGL;
+  double plo[NGL], pwo[NGL];
+  double pl[NGL], pw[NGL];
+
+  int i;
+
+  gauaw(ngl, pl, pw);
+  gauaw_old(plo, pwo, ngl);
+  for (i = 0; i < ngl; i++)
+    {
+      pl[i]  = asin(pl[i])/M_PI*180.0;
+      plo[i] = asin(plo[i])/M_PI*180.0;
+    }
+
+  for (i = 0; i < ngl; i++)
+    {
+      fprintf(stderr, "%4d%25.18f%25.18f%25.18f%25.18f\n", i+1, pl[i], pw[i], pl[i]-plo[i], pw[i]-pwo[i]);
+    }
+
+  return 0;
+}
+*/
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <string.h>
+#include <math.h>
+
+
+
+extern void zaxisGetIndexList ( int, int * );
+
+
+#undef  UNDEFID
+#define UNDEFID -1
+
+static size_t Vctsize = 0;
+static double *Vct = NULL;
+
+static int numberOfVerticalLevels = 0;
+static int numberOfVerticalGrid = 0;
+static char uuidVGrid[17];
+
+typedef struct
+{
+  int      level1;
+  int      level2;
+  int      recID;
+  int      lindex;
+}
+leveltable_t;
+
+typedef struct
+{
+  int         param;
+  int         prec;
+  int         tsteptype;
+  int         timave;
+  int         timaccu;
+  int         gridID;
+  int         zaxistype;
+  int         ltype;     /* GRIB level type */
+  int         lbounds;
+  int         zaxisID;
+  int         nlevels;
+  int         levelTableSize;
+  leveltable_t *levelTable;
+  int         instID;
+  int         modelID;
+  int         tableID;
+  int         comptype;       // compression type
+  int         complevel;      // compression level
+  int         lmissval;
+  double      missval;
+  char       *name;
+  char       *longname;
+  char       *units;
+  ensinfo_t  *ensdata;
+}
+vartable_t;
+
+
+int vartableInit = 0;
+vartable_t *vartable;
+static int varTablesize = 0;
+int nvars = 0;
+
+
+static
+void paramInitEntry(int varID, int param)
+{
+  vartable[varID].param          = param;
+  vartable[varID].prec           = 0;
+  vartable[varID].tsteptype      = TSTEP_INSTANT;
+  vartable[varID].timave         = 0;
+  vartable[varID].timaccu        = 0;
+  vartable[varID].gridID         = UNDEFID;
+  vartable[varID].zaxistype      = 0;
+  vartable[varID].ltype          = 0;
+  vartable[varID].levelTable     = NULL;
+  vartable[varID].levelTableSize = 0;
+  vartable[varID].nlevels        = 0;
+  vartable[varID].instID         = UNDEFID;
+  vartable[varID].modelID        = UNDEFID;
+  vartable[varID].tableID        = UNDEFID;
+  vartable[varID].comptype       = COMPRESS_NONE;
+  vartable[varID].complevel      = 1;
+  vartable[varID].lmissval       = 0;
+  vartable[varID].missval        = 0;
+  vartable[varID].name           = NULL;
+  vartable[varID].longname       = NULL;
+  vartable[varID].units          = NULL;
+  vartable[varID].ensdata        = NULL;
+}
+
+static
+int varGetEntry(int param, int zaxistype, int ltype)
+{
+  int varID;
+
+  for ( varID = 0; varID < varTablesize; varID++ )
+    {
+      if ( vartable[varID].param     == param     &&
+	   vartable[varID].zaxistype == zaxistype &&
+	   vartable[varID].ltype     == ltype )
+	return (varID);
+    }
+
+  return (UNDEFID);
+}
+
+static
+void varFree(void)
+{
+  int varID;
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( vartable[varID].levelTable )
+	free(vartable[varID].levelTable);
+
+      if ( vartable[varID].name )     free(vartable[varID].name);
+      if ( vartable[varID].longname ) free(vartable[varID].longname);
+      if ( vartable[varID].units )    free(vartable[varID].units);
+      if ( vartable[varID].ensdata )  free(vartable[varID].ensdata);
+    }
+
+  if ( vartable )
+    free(vartable);
+
+  vartable = NULL;
+  varTablesize = 0;
+  nvars = 0;
+
+  if ( Vct )
+    free(Vct);
+
+  Vct = NULL;
+  Vctsize = 0;
+}
+
+static
+int levelNewEntry(int varID, int level1, int level2)
+{
+  int levelID = 0;
+  int levelTableSize;
+  leveltable_t *levelTable;
+
+  levelTableSize = vartable[varID].levelTableSize;
+  levelTable     = vartable[varID].levelTable;
+
+  /*
+    Look for a free slot in levelTable.
+    (Create the table the first time through).
+  */
+  if ( ! levelTableSize )
+    {
+      int i;
+
+      levelTableSize = 2;
+      levelTable = (leveltable_t *) malloc(levelTableSize*sizeof(leveltable_t));
+      if( levelTable == NULL )
+	{
+          Message("levelTableSize = %d", levelTableSize);
+	  SysError("Allocation of leveltable failed!");
+	}
+
+      for( i = 0; i < levelTableSize; i++ )
+	levelTable[i].recID = UNDEFID;
+    }
+  else
+    {
+      while( levelID < levelTableSize )
+	{
+	  if ( levelTable[levelID].recID == UNDEFID ) break;
+	  levelID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if( levelID == levelTableSize )
+    {
+      int i;
+
+      levelTableSize = 2*levelTableSize;
+      levelTable = (leveltable_t *) realloc(levelTable, levelTableSize*sizeof(leveltable_t));
+      if( levelTable == NULL )
+	{
+          Message("levelTableSize = %d", levelTableSize);
+	  SysError("Reallocation of leveltable failed");
+	}
+      levelID = levelTableSize/2;
+
+      for( i = levelID; i < levelTableSize; i++ )
+	levelTable[i].recID = UNDEFID;
+    }
+
+  levelTable[levelID].level1 = level1;
+  levelTable[levelID].level2 = level2;
+  levelTable[levelID].lindex = levelID;
+
+  vartable[varID].nlevels = levelID+1;
+  vartable[varID].levelTableSize = levelTableSize;
+  vartable[varID].levelTable = levelTable;
+
+  return (levelID);
+}
+
+#define  UNDEF_PARAM  -4711
+
+static
+int paramNewEntry(int param)
+{
+  int varID = 0;
+
+  /*
+    Look for a free slot in vartable.
+    (Create the table the first time through).
+  */
+  if ( ! varTablesize )
+    {
+      int i;
+
+      varTablesize = 2;
+      vartable = (vartable_t *) malloc(varTablesize*sizeof(vartable_t));
+      if( vartable == NULL )
+	{
+          Message("varTablesize = %d", varTablesize);
+	  SysError("Allocation of vartable failed");
+	}
+
+      for( i = 0; i < varTablesize; i++ )
+	vartable[i].param = UNDEF_PARAM;
+    }
+  else
+    {
+      while( varID < varTablesize )
+	{
+	  if ( vartable[varID].param == UNDEF_PARAM ) break;
+	  varID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if ( varID == varTablesize )
+    {
+      int i;
+
+      varTablesize = 2*varTablesize;
+      vartable = (vartable_t *) realloc(vartable, varTablesize*sizeof(vartable_t));
+      if( vartable == NULL )
+	{
+          Message("varTablesize = %d", varTablesize);
+	  SysError("Reallocation of vartable failed!");
+	}
+      varID = varTablesize/2;
+
+      for( i = varID; i < varTablesize; i++ )
+	vartable[i].param = UNDEF_PARAM;
+    }
+
+  paramInitEntry(varID, param);
+
+  return (varID);
+}
+
+
+void varAddRecord(int recID, int param, int gridID, int zaxistype, int lbounds,
+		  int level1, int level2, int prec,
+		  int *pvarID, int *plevelID, int tsteptype, int numavg, int ltype,
+		  const char *name, const char *longname, const char *units)
+{
+  int varID = UNDEFID;
+  int levelID = -1;
+
+  if ( ! (cdiSplitLtype105 == 1 && zaxistype == ZAXIS_HEIGHT) )
+    varID = varGetEntry(param, zaxistype, ltype);
+
+  if ( varID == UNDEFID )
+    {
+      nvars++;
+      varID = paramNewEntry(param);
+      vartable[varID].gridID    = gridID;
+      vartable[varID].zaxistype = zaxistype;
+      vartable[varID].ltype     = ltype;
+      vartable[varID].lbounds   = lbounds;
+      if ( tsteptype != UNDEFID ) vartable[varID].tsteptype = tsteptype;
+      if ( numavg ) vartable[varID].timave = 1;
+
+      if ( name )     if ( name[0] )     vartable[varID].name     = strdup(name);
+      if ( longname ) if ( longname[0] ) vartable[varID].longname = strdup(longname);
+      if ( units )    if ( units[0] )    vartable[varID].units    = strdup(units);
+    }
+  else
+    {
+      if ( vartable[varID].gridID != gridID )
+	{
+	  char paramstr[32];
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+	  Message("param = %s gridID = %d", paramstr, gridID);
+	  Error("horizontal grid must not change for same param!");
+	}
+      if ( vartable[varID].zaxistype != zaxistype )
+	{
+	  char paramstr[32];
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+	  Message("param = %s zaxistype = %d", paramstr, zaxistype);
+	  Error("zaxistype must not change for same param!");
+	}
+    }
+
+  if ( prec > vartable[varID].prec ) vartable[varID].prec = prec;
+
+  levelID = levelNewEntry(varID, level1, level2);
+  vartable[varID].levelTable[levelID].recID = recID;
+
+  if ( CDI_Debug )
+    Message("varID = %d  levelID = %d", varID, levelID);
+
+  *pvarID   = varID;
+  *plevelID = levelID;
+}
+
+static
+int dblcmp(const void *s1, const void *s2)
+{
+  int cmp = 0;
+
+  if      ( *((double *) s1) < *((double *) s2) ) cmp = -1;
+  else if ( *((double *) s1) > *((double *) s2) ) cmp =  1;
+
+  return (cmp);
+}
+
+static
+int cmpLevelTable(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  leveltable_t *x = (leveltable_t *) s1;
+  leveltable_t *y = (leveltable_t *) s2;
+  /*
+  printf("%g %g  %d %d\n", x->leve11, y->level1, x, y);
+  */
+  if      ( x->level1 < y->level1 ) cmp = -1;
+  else if ( x->level1 > y->level1 ) cmp =  1;
+
+  return (cmp);
+}
+
+
+typedef struct
+{
+  int      varid;
+  int      param;
+  int      ltype;
+}
+param_t;
+
+
+static
+int cmpparam(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  param_t *x = (param_t *) s1;
+  param_t *y = (param_t *) s2;
+
+  if      ( x->param > y->param ) cmp =  1;
+  else if ( x->param < y->param ) cmp = -1;
+
+  return (cmp);
+}
+
+
+static
+int cmpltype(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  param_t *x = (param_t *) s1;
+  param_t *y = (param_t *) s2;
+
+  if      ( x->ltype > y->ltype ) cmp =  1;
+  else if ( x->ltype < y->ltype ) cmp = -1;
+
+  return (cmp);
+}
+
+
+void cdiGenVars(int streamID)
+{
+  int varID, gridID, zaxisID, levelID;
+  int instID, modelID, tableID;
+  int param, nlevels, zaxistype, lindex, ltype;
+  int prec;
+  int tsteptype;
+  int timave, timaccu;
+  int lbounds;
+  int comptype;
+  char name[CDI_MAX_NAME], longname[CDI_MAX_NAME], units[CDI_MAX_NAME];
+  double *dlevels = NULL;
+  double *dlevels1 = NULL;
+  double *dlevels2 = NULL;
+  int vlistID;
+  int *varids, index, varid;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID =  streamInqVlist(streamID);
+
+  varids = (int *) malloc(nvars*sizeof(int));
+  for ( varID = 0; varID < nvars; varID++ ) varids[varID] = varID;
+
+  if ( streamptr->sortname )
+    {
+      int index;
+      param_t **varInfo;
+      varInfo    = (param_t **) malloc(nvars*sizeof(param_t *));
+      varInfo[0] = (param_t *)  malloc(nvars*sizeof(param_t));
+
+      for ( index = 1; index < nvars; index++ )
+	varInfo[index] = varInfo[0] + index;
+
+      for ( varid = 0; varid < nvars; varid++ )
+	{
+	  varInfo[varid]->varid = varids[varid];
+	  varInfo[varid]->param = vartable[varid].param;
+	  varInfo[varid]->ltype = vartable[varid].ltype;
+	}
+      qsort(varInfo[0], nvars, sizeof(param_t), cmpltype);
+      qsort(varInfo[0], nvars, sizeof(param_t), cmpparam);
+      for ( varid = 0; varid < nvars; varid++ )
+	{
+	  varids[varid] = varInfo[varid]->varid;
+	}
+      free(varInfo[0]);
+      free(varInfo);
+    }
+
+  for ( index = 0; index < nvars; index++ )
+    {
+      varid     = varids[index];
+
+      gridID    = vartable[varid].gridID;
+      param     = vartable[varid].param;
+      nlevels   = vartable[varid].nlevels;
+      ltype     = vartable[varid].ltype;
+      zaxistype = vartable[varid].zaxistype;
+      if ( ltype == 0 && zaxistype == ZAXIS_GENERIC && cdiDefaultLeveltype != -1 )
+	zaxistype = cdiDefaultLeveltype;
+      lbounds   = vartable[varid].lbounds;
+      prec      = vartable[varid].prec;
+      instID    = vartable[varid].instID;
+      modelID   = vartable[varid].modelID;
+      tableID   = vartable[varid].tableID;
+      tsteptype = vartable[varid].tsteptype;
+      timave    = vartable[varid].timave;
+      timaccu   = vartable[varid].timaccu;
+      comptype  = vartable[varid].comptype;
+
+      zaxisID = UNDEFID;
+
+      if ( ltype == 0 && zaxistype == ZAXIS_GENERIC && nlevels == 1 &&
+	   ! (fabs(vartable[varid].levelTable[0].level1)>0) )
+	zaxistype = ZAXIS_SURFACE;
+
+      dlevels = (double *) malloc(nlevels*sizeof(double));
+
+      if ( lbounds && zaxistype != ZAXIS_HYBRID && zaxistype != ZAXIS_HYBRID_HALF )
+	for ( levelID = 0; levelID < nlevels; levelID++ )
+	  dlevels[levelID] = (vartable[varid].levelTable[levelID].level1 +
+	                      vartable[varid].levelTable[levelID].level2)/2;
+      else
+	for ( levelID = 0; levelID < nlevels; levelID++ )
+	  dlevels[levelID] = vartable[varid].levelTable[levelID].level1;
+
+      if ( nlevels > 1 )
+	{
+	  int linc = FALSE, ldec = FALSE;
+	  /* check increasing of levels */
+	  for ( levelID = 1; levelID < nlevels; levelID++ )
+	    if ( dlevels[levelID] < dlevels[levelID-1] ) break;
+
+	  if ( levelID == nlevels ) linc = TRUE;
+
+	  if ( linc == FALSE )
+	    {
+	      /* check decreasing of levels */
+	      for ( levelID = 1; levelID < nlevels; levelID++ )
+		if ( dlevels[levelID] > dlevels[levelID-1] ) break;
+
+	      if ( levelID == nlevels ) ldec = TRUE;
+
+	      if ( ldec == FALSE ||
+		   zaxistype == ZAXIS_HYBRID ||
+		   zaxistype == ZAXIS_DEPTH_BELOW_LAND )
+		{
+		  /*
+		  qsort(dlevels, nlevels, sizeof(double), dblcmp);
+		  */
+		  qsort(vartable[varid].levelTable, nlevels, 
+			sizeof(leveltable_t), cmpLevelTable);
+
+		  if ( lbounds && zaxistype != ZAXIS_HYBRID && zaxistype != ZAXIS_HYBRID_HALF )
+		    for ( levelID = 0; levelID < nlevels; levelID++ )
+		      dlevels[levelID] = (vartable[varid].levelTable[levelID].level1 +
+					  vartable[varid].levelTable[levelID].level2)/2.;
+		  else
+		    for ( levelID = 0; levelID < nlevels; levelID++ )
+		      dlevels[levelID] = vartable[varid].levelTable[levelID].level1;
+		}
+	    }
+	}
+
+      if ( lbounds )
+	{
+	  dlevels1 = (double *) malloc(nlevels*sizeof(double));
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    dlevels1[levelID] = vartable[varid].levelTable[levelID].level1;
+	  dlevels2 = (double *) malloc(nlevels*sizeof(double));
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    dlevels2[levelID] = vartable[varid].levelTable[levelID].level2;
+	}
+
+      zaxisID = varDefZaxis(vlistID, zaxistype, nlevels, dlevels, lbounds, dlevels1, dlevels2,
+			    Vctsize, Vct, NULL, NULL, NULL, 0, 0, ltype);
+
+      if ( lbounds ) free(dlevels1);
+      if ( lbounds ) free(dlevels2);
+      free(dlevels);
+
+      varID = streamNewVar(streamID, gridID, zaxisID);
+      varID = vlistDefVar(vlistID, gridID, zaxisID, tsteptype);
+
+      vlistDefVarParam(vlistID, varID, param);
+      vlistDefVarDatatype(vlistID, varID, prec);
+      vlistDefVarTimave(vlistID, varID, timave);
+      vlistDefVarTimaccu(vlistID, varID, timaccu);
+      vlistDefVarCompType(vlistID, varID, comptype);
+
+      if ( vartable[varid].lmissval ) vlistDefVarMissval(vlistID, varID, vartable[varid].missval);
+
+      if ( vartable[varid].name )     vlistDefVarName(vlistID, varID, vartable[varid].name);
+      if ( vartable[varid].longname ) vlistDefVarLongname(vlistID, varID, vartable[varid].longname);
+      if ( vartable[varid].units )    vlistDefVarUnits(vlistID, varID, vartable[varid].units);
+
+      if ( vartable[varid].ensdata )  vlistDefVarEnsemble(vlistID, varID, vartable[varid].ensdata->ens_index,
+	                                                  vartable[varid].ensdata->ens_count,
+							  vartable[varid].ensdata->forecast_init_type);
+
+      if ( cdiDefaultTableID != UNDEFID )
+	{
+	  int pdis, pcat, pnum;
+	  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+	  if ( tableInqParNamePtr(cdiDefaultTableID, pnum) )
+	    {
+	      if ( tableID != UNDEFID )
+		{
+		  strcpy(name, tableInqParNamePtr(cdiDefaultTableID, pnum));
+		  vlistDefVarName(vlistID, varID, name);
+		  if ( tableInqParLongnamePtr(cdiDefaultTableID, pnum) )
+		    {
+		      strcpy(longname, tableInqParLongnamePtr(cdiDefaultTableID, pnum));
+		      vlistDefVarLongname(vlistID, varID, longname);
+		    }
+		  if ( tableInqParUnitsPtr(cdiDefaultTableID, pnum) )
+		    {
+		      strcpy(units, tableInqParUnitsPtr(cdiDefaultTableID, pnum));
+		      vlistDefVarUnits(vlistID, varID, units);
+		    }
+		}
+	      else
+		tableID = cdiDefaultTableID;
+	    }
+	  if ( cdiDefaultModelID != UNDEFID ) modelID = cdiDefaultModelID;
+	  if ( cdiDefaultInstID  != UNDEFID )  instID = cdiDefaultInstID;
+	}
+
+      if ( instID  != UNDEFID ) vlistDefVarInstitut(vlistID, varID, instID);
+      if ( modelID != UNDEFID ) vlistDefVarModel(vlistID, varID, modelID);
+      if ( tableID != UNDEFID ) vlistDefVarTable(vlistID, varID, tableID);
+    }
+
+  for ( index = 0; index < nvars; index++ )
+    {
+      varID     = index;
+      varid     = varids[index];
+
+      nlevels   = vartable[varid].nlevels;
+      /*
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	{
+	  lindex = vartable[varid].levelTable[levelID].lindex;
+	  printf("%d %d %d %d %d\n", varID, levelID, 
+		 vartable[varid].levelTable[levelID].lindex,
+		 vartable[varid].levelTable[levelID].recID,
+		 vartable[varid].levelTable[levelID].level1);
+	}
+      */
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	{
+	  streamptr->vars[varID].level[levelID] =
+	    vartable[varid].levelTable[levelID].recID;
+	  for ( lindex = 0; lindex < nlevels; lindex++ )
+	    if ( levelID == vartable[varid].levelTable[lindex].lindex ) break;
+
+	  if ( lindex == nlevels )
+	    Error("Internal problem! lindex not found.");
+
+	  streamptr->vars[varID].lindex[levelID] = lindex;
+	}
+    }
+
+  free(varids);
+
+  varFree();
+}
+
+
+void varDefVCT(size_t vctsize, double *vctptr)
+{
+  if ( Vct == NULL && vctptr != NULL && vctsize > 0 )
+    {
+      Vctsize = vctsize;
+      Vct = (double *) malloc(vctsize*sizeof(double));
+      memcpy(Vct, vctptr, vctsize*sizeof(double));
+    }
+}
+
+
+void varDefZAxisReference(int nlev, int nvgrid, char *uuid)
+{
+  numberOfVerticalLevels = nlev;
+  numberOfVerticalGrid = nvgrid;
+  strncpy(uuidVGrid, uuid, 16);
+}
+
+
+int varDefGrid(int vlistID, grid_t grid, int mode)
+{
+  /*
+    mode: 0 search in vlist and grid table
+          1 search in grid table
+   */
+  int gridglobdefined = FALSE;
+  int griddefined;
+  int ngrids;
+  int gridID = UNDEFID;
+  int index;
+  vlist_t *vlistptr;
+  int * gridIndexList, i;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  griddefined = FALSE;
+  ngrids = vlistptr->ngrids;
+
+  if ( mode == 0 )
+    for ( index = 0; index < ngrids; index++ )
+      {
+	gridID = vlistptr->gridIDs[index];
+	if ( gridID == UNDEFID )
+	  Error("Internal problem: undefined gridID %d!", gridID);
+
+	if ( gridCompare(gridID, grid) == 0 )
+	  {
+	    griddefined = TRUE;
+	    break;
+	  }
+      }
+
+  if ( ! griddefined )
+    {
+      ngrids = gridSize();
+      if ( ngrids > 0 )
+        {
+          gridIndexList = malloc(ngrids*sizeof(int));
+          gridGetIndexList ( ngrids, gridIndexList );
+          for ( i = 0; i < ngrids; i++ )
+            {
+              gridID = gridIndexList[i];
+              if ( gridCompare(gridID, grid) == 0 )
+                {
+                  gridglobdefined = TRUE;
+                  break;
+                }
+            }
+          if ( gridIndexList ) free ( gridIndexList );
+        }
+
+      ngrids = vlistptr->ngrids;
+      if ( mode == 1 )
+	for ( index = 0; index < ngrids; index++ )
+	  if ( vlistptr->gridIDs[index] == gridID )
+	    {
+	      gridglobdefined = FALSE;
+	      break;
+	    }
+    }
+
+  if ( ! griddefined )
+    {
+      if ( ! gridglobdefined ) gridID = gridGenerate(grid);
+      ngrids = vlistptr->ngrids;
+      vlistptr->gridIDs[ngrids] = gridID;
+      vlistptr->ngrids++;
+    }
+
+  return (gridID);
+}
+
+
+int zaxisCompare(int zaxisID, int zaxistype, int nlevels, int lbounds, double *levels, char *longname, char *units, int ltype)
+{
+  int differ = 1;
+  int levelID;
+  int zlbounds = 0;
+  int ltype_is_equal = FALSE;
+
+  if ( ltype == zaxisInqLtype(zaxisID) ) ltype_is_equal = TRUE;
+
+  if ( ltype_is_equal && (zaxistype == zaxisInqType(zaxisID) || zaxistype == ZAXIS_GENERIC) )
+    {
+      if ( zaxisInqLbounds(zaxisID, NULL) > 0 ) zlbounds = 1;
+      if ( nlevels == zaxisInqSize(zaxisID) && zlbounds == lbounds )
+	{
+	  const double *dlevels;
+	  char zlongname[CDI_MAX_NAME];
+	  char zunits[CDI_MAX_NAME];
+
+	  dlevels = zaxisInqLevelsPtr(zaxisID);
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    {
+	      if ( fabs(dlevels[levelID] - levels[levelID]) > 1.e-9 )
+		break;
+	    }
+
+	  if ( levelID == nlevels ) differ = 0;
+
+	  if ( ! differ )
+	    {
+	      zaxisInqLongname(zaxisID, zlongname);
+	      zaxisInqUnits(zaxisID, zunits);
+	      if ( longname && zlongname[0] )
+		{
+		  if ( strcmp(longname, zlongname) != 0 ) differ = 1;
+		}
+	      if ( units && zunits[0] )
+		{
+		  if ( strcmp(units, zunits) != 0 ) differ = 1;
+		}
+	    }
+	}
+    }
+
+  return (differ);
+}
+
+
+int varDefZaxis(int vlistID, int zaxistype, int nlevels, double *levels, int lbounds,
+		double *levels1, double *levels2, int vctsize, double *vct, char *name,
+		char *longname, char *units, int prec, int mode, int ltype)
+{
+  /*
+    mode: 0 search in vlist and zaxis table
+          1 search in zaxis table
+   */
+  int zaxisdefined;
+  int nzaxis;
+  int zaxisID = UNDEFID;
+  int index;
+  int zaxisglobdefined = 0;
+  vlist_t *vlistptr;
+  int i;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  zaxisdefined = 0;
+  nzaxis = vlistptr->nzaxis;
+
+  if ( mode == 0 )
+    for ( index = 0; index < nzaxis; index++ )
+      {
+	zaxisID = vlistptr->zaxisIDs[index];
+
+	if ( zaxisCompare(zaxisID, zaxistype, nlevels, lbounds, levels, longname, units, ltype) == 0 )
+	  {
+	    zaxisdefined = 1;
+	    break;
+	  }
+      }
+
+  if ( ! zaxisdefined )
+    {
+      nzaxis = zaxisSize();
+      if ( nzaxis > 0 )
+        {
+          int *zaxisIndexList;
+          zaxisIndexList = (int *) malloc ( nzaxis * sizeof ( int ));
+          zaxisGetIndexList ( nzaxis, zaxisIndexList );
+          for ( i = 0; i < nzaxis; i++ )
+            {
+              zaxisID = zaxisIndexList[i];
+              if ( zaxisCompare(zaxisID, zaxistype, nlevels, lbounds, levels, longname, units, ltype) == 0 )
+                {
+                  zaxisglobdefined = 1;
+                  break;
+                }
+            }
+          if ( zaxisIndexList ) free ( zaxisIndexList );
+        }
+
+      nzaxis = vlistptr->nzaxis;
+      if ( mode == 1 )
+	for ( index = 0; index < nzaxis; index++ )
+	  if ( vlistptr->zaxisIDs[index] == zaxisID )
+	    {
+	      zaxisglobdefined = FALSE;
+	      break;
+	    }
+    }
+
+  if ( ! zaxisdefined )
+    {
+      if ( ! zaxisglobdefined )
+	{
+	  zaxisID = zaxisCreate(zaxistype, nlevels);
+	  zaxisDefLevels(zaxisID, levels);
+	  if ( lbounds )
+	    {
+	      zaxisDefLbounds(zaxisID, levels1);
+	      zaxisDefUbounds(zaxisID, levels2);
+	    }
+
+	  if ( zaxistype == ZAXIS_HYBRID || zaxistype == ZAXIS_HYBRID_HALF )
+	    {
+	      /* if ( vctsize > 0 && vctsize >= 2*(nlevels+1)) */
+	      /* if ( vctsize > 0 && vctsize >= 2*(nlevels)) */
+	      if ( vctsize > 0 )
+		zaxisDefVct(zaxisID, vctsize, vct);
+	      else
+		Warning("VCT missing");
+	    }
+
+	  zaxisDefName(zaxisID, name);
+	  zaxisDefLongname(zaxisID, longname);
+	  zaxisDefUnits(zaxisID, units);
+	  zaxisDefPrec(zaxisID, prec);
+	  zaxisDefLtype(zaxisID, ltype);
+	}
+
+      nzaxis = vlistptr->nzaxis;
+      vlistptr->zaxisIDs[nzaxis] = zaxisID;
+      vlistptr->nzaxis++;
+    }
+
+  return (zaxisID);
+}
+
+
+void varDefMissval(int varID, double missval)
+{
+  vartable[varID].lmissval = 1;
+  vartable[varID].missval = missval;
+}
+
+
+void varDefCompType(int varID, int comptype)
+{
+  if ( vartable[varID].comptype == COMPRESS_NONE )
+    vartable[varID].comptype = comptype;
+}
+
+
+void varDefCompLevel(int varID, int complevel)
+{
+  vartable[varID].complevel = complevel;
+}
+
+
+int varInqInst(int varID)
+{
+  return (vartable[varID].instID);
+}
+
+
+void varDefInst(int varID, int instID)
+{
+  vartable[varID].instID = instID;
+}
+
+
+int varInqModel(int varID)
+{
+  return (vartable[varID].modelID);
+}
+
+
+void varDefModel(int varID, int modelID)
+{
+  vartable[varID].modelID = modelID;
+}
+
+
+int varInqTable(int varID)
+{
+  return (vartable[varID].tableID);
+}
+
+
+void varDefTable(int varID, int tableID)
+{
+  vartable[varID].tableID = tableID;
+}
+
+
+void varDefEnsembleInfo(int varID, int ens_idx, int ens_count, int forecast_type)
+{
+  if ( vartable[varID].ensdata == NULL )
+      vartable[varID].ensdata = (ensinfo_t *) malloc( sizeof( ensinfo_t ) );
+
+  vartable[varID].ensdata->ens_index = ens_idx;
+  vartable[varID].ensdata->ens_count = ens_count;
+  vartable[varID].ensdata->forecast_init_type = forecast_type;
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+
+extern void zaxisGetIndexList ( int, int * );
+
+static int VLIST_Debug = 0;
+
+static int vlistIsInitialized = 0;
+static void vlist_initialize(void);
+
+#if  defined  (HAVE_LIBPTHREAD)
+#  include <pthread.h>
+
+static pthread_once_t  _vlist_init_thread = PTHREAD_ONCE_INIT;
+
+#  define VLIST_INIT()        \
+  pthread_once(&_vlist_init_thread, vlist_initialize)
+
+#else
+
+#  define VLIST_INIT()               \
+  if ( vlistIsInitialized == FALSE ) vlist_initialize()
+#endif
+
+
+/* FIXME: implementation incomplete, fix once leaf nodes are complete */
+static int
+vlist_compare(vlist_t *a, vlist_t *b)
+{
+  int diff;
+  diff = (a->nvars != b->nvars) || (a->ngrids != b->ngrids)
+    || (a->nzaxis != b->nzaxis) || (a->instID != b->instID)
+    || (a->modelID != b->modelID) || (a->tableID != b->tableID)
+    || (a->ntsteps != b->ntsteps);
+  return diff;
+}
+
+static void
+vlistPrintKernel(vlist_t *vlistptr, FILE * fp );
+#ifdef USE_MPI
+static int  vlistGetSizeP ( void * vlistptr, MPI_Comm comm );
+static void vlistPackP    ( void * vlistptr, void * buff, int size,
+                            int *position, MPI_Comm comm );
+static int  vlistTxCode   ( void );
+#endif
+
+resOps vlist_ops = {
+  (valCompareFunc)vlist_compare,
+  free,
+  (valPrintFunc)vlistPrintKernel
+#ifdef USE_MPI
+  , vlistGetSizeP,
+  vlistPackP,
+  vlistTxCode
+#endif
+};
+
+
+vlist_t *vlist_to_pointer(int code)
+{
+  VLIST_INIT();
+  return reshGetVal(code, &vlist_ops );
+}
+
+static
+void vlist_init_entry(vlist_t *vlistptr)
+{
+  vlistptr->self           = reshPut(vlistptr, &vlist_ops);
+
+  vlistptr->nvars          = 0;
+  vlistptr->vars           = NULL;
+  vlistptr->ngrids         = 0;
+  vlistptr->nzaxis         = 0;
+  vlistptr->taxisID        = CDI_UNDEFID;
+  vlistptr->instID         = cdiDefaultInstID;
+  vlistptr->modelID        = cdiDefaultModelID;
+  vlistptr->tableID        = cdiDefaultTableID;
+  vlistptr->varsAllocated  = 0;
+  vlistptr->ntsteps        = CDI_UNDEFID;
+  vlistptr->atts.nalloc    = MAX_ATTRIBUTES;
+  vlistptr->atts.nelems    = 0;
+}
+
+static
+vlist_t *vlist_new_entry(void)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = (vlist_t *)xmalloc(sizeof(vlist_t));
+
+  vlist_init_entry(vlistptr);
+
+  return (vlistptr);
+}
+
+static
+void vlist_delete_entry(vlist_t *vlistptr)
+{
+  int idx;
+
+  idx = vlistptr->self;
+
+  reshRemove(idx, &vlist_ops );
+
+  free(vlistptr);
+
+  if ( VLIST_Debug )
+    Message("Removed idx %d from vlist list", idx);
+}
+
+static
+void vlist_initialize(void)
+{
+  char *env;
+
+  env = getenv("VLIST_DEBUG");
+  if ( env ) VLIST_Debug = atoi(env);
+
+  vlistIsInitialized = TRUE;
+}
+
+static
+void vlist_copy(vlist_t *vlistptr2, vlist_t *vlistptr1)
+{
+  int vlistID2;
+
+  vlistID2 = vlistptr2->self;
+  memcpy(vlistptr2, vlistptr1, sizeof(vlist_t));
+  vlistptr2->atts.nelems = 0;
+  vlistptr2->self = vlistID2;
+}
+
+static
+void vlist_check_ptr(const char *caller, vlist_t *vlistptr)
+{
+  if ( vlistptr == NULL )
+    Errorc("vlist undefined!");
+}
+
+/*
+ at Function  vlistCreate
+ at Title     Create a variable list
+
+ at Prototype int vlistCreate(void)
+
+ at Example
+Here is an example using @func{vlistCreate} to create a variable list
+and add a variable with @func{vlistDefVar}.
+
+ at Source
+   ...
+int vlistID, varID;
+   ...
+vlistID = vlistCreate();
+varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+   ...
+streamDefVlist(streamID, vlistID);
+   ...
+vlistDestroy(vlistID);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int vlistCreate(void)
+{
+  int vlistID = 0;
+  vlist_t *vlistptr;
+
+  cdiInitialize();
+
+  VLIST_INIT();
+
+  vlistptr = vlist_new_entry();
+
+  vlistID = vlistptr->self;
+
+  return (vlistID);
+}
+
+/*
+ at Function  vlistDestroy
+ at Title     Destroy a variable list
+
+ at Prototype void vlistDestroy(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at EndFunction
+*/
+void vlistDestroy(int vlistID)
+{
+  vlist_t *vlistptr;
+  int nvars;
+  int varID;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  vlistDelAtts(vlistID, CDI_GLOBAL);
+
+  nvars = vlistptr->nvars;
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( vlistptr->vars[varID].levinfo )  free(vlistptr->vars[varID].levinfo);
+      if ( vlistptr->vars[varID].name )     free(vlistptr->vars[varID].name);
+      if ( vlistptr->vars[varID].longname ) free(vlistptr->vars[varID].longname);
+      if ( vlistptr->vars[varID].stdname )  free(vlistptr->vars[varID].stdname);
+      if ( vlistptr->vars[varID].units )    free(vlistptr->vars[varID].units);
+
+      if ( vlistptr->vars[varID].ensdata )  free(vlistptr->vars[varID].ensdata);
+
+      vlistDelAtts(vlistID, varID);
+    }
+
+  if ( vlistptr->vars ) free(vlistptr->vars);
+
+  vlist_delete_entry(vlistptr);
+}
+
+/*
+ at Function  vlistCopy
+ at Title     Copy a variable list
+
+ at Prototype void vlistCopy(int vlistID2, int vlistID1)
+ at Parameter
+    @Item  vlistID2  Target variable list ID
+    @Item  vlistID1  Source variable list ID
+
+ at Description
+The function @func{vlistCopy} copies all entries from vlistID1 to vlistID2.
+
+ at EndFunction
+*/
+void vlistCopy(int vlistID2, int vlistID1)
+{
+  vlist_t *vlistptr1, *vlistptr2;
+
+  vlistptr1 = vlist_to_pointer(vlistID1);
+  vlistptr2 = vlist_to_pointer(vlistID2);
+
+  vlist_check_ptr(__func__, vlistptr1);
+  vlist_check_ptr(__func__, vlistptr2);
+
+  vlist_copy(vlistptr2, vlistptr1);
+
+  vlistCopyVarAtts(vlistID1, CDI_GLOBAL, vlistID2, CDI_GLOBAL);
+
+  if ( vlistptr1->vars )
+    {
+      int nvars = vlistptr1->nvars;
+      int nlevs, varID;
+
+      //vlistptr2->varsAllocated = nvars;
+      vlistptr2->vars = (var_t *) malloc(vlistptr2->varsAllocated*sizeof(var_t));
+      memcpy(vlistptr2->vars, vlistptr1->vars, vlistptr2->varsAllocated*sizeof(var_t));
+
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          if ( vlistptr1->vars[varID].name )
+            vlistptr2->vars[varID].name = strdupx(vlistptr1->vars[varID].name);
+
+          if ( vlistptr1->vars[varID].longname )
+            vlistptr2->vars[varID].longname = strdupx(vlistptr1->vars[varID].longname);
+
+          if ( vlistptr1->vars[varID].stdname )
+            vlistptr2->vars[varID].stdname = strdupx(vlistptr1->vars[varID].stdname);
+
+          if ( vlistptr1->vars[varID].units )
+            vlistptr2->vars[varID].units = strdupx(vlistptr1->vars[varID].units);
+
+          if ( vlistptr1->vars[varID].ensdata )
+            {
+              vlistptr2->vars[varID].ensdata = (ensinfo_t *) malloc(sizeof(ensinfo_t));
+              memcpy(vlistptr2->vars[varID].ensdata,
+                     vlistptr1->vars[varID].ensdata, sizeof(ensinfo_t));
+            }
+
+	  vlistptr2->vars[varID].atts.nelems = 0;
+	  vlistCopyVarAtts(vlistID1, varID, vlistID2, varID);
+
+          nlevs = vlistptr1->vars[varID].nlevs;
+          vlistptr2->vars[varID].levinfo = (levinfo_t *) malloc(nlevs*sizeof(levinfo_t));
+          memcpy(vlistptr2->vars[varID].levinfo,
+                 vlistptr1->vars[varID].levinfo, nlevs*sizeof(levinfo_t));
+	}
+    }
+}
+
+/*
+ at Function  vlistDuplicate
+ at Title     Duplicate a variable list
+
+ at Prototype int vlistDuplicate(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at Description
+The function @func{vlistDuplicate} duplicates the variable list from vlistID1.
+
+ at Result
+ at func{vlistDuplicate} returns an identifier to the duplicated variable list.
+
+ at EndFunction
+*/
+int vlistDuplicate(int vlistID)
+{
+  int vlistIDnew;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  vlistIDnew = vlistCreate();
+
+  vlistCopy(vlistIDnew, vlistID);
+
+  if ( ! namespaceHasLocalFile ( namespaceGetActive ()))
+    reshSetStatus ( vlistIDnew, &vlist_ops, SUSPENDED );
+
+  return (vlistIDnew);
+}
+
+
+void vlistClearFlag(int vlistID)
+{
+  int varID, levID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  for ( varID = 0; varID < vlistptr->nvars; varID++ )
+    {
+      vlistptr->vars[varID].flag = FALSE;
+      for ( levID = 0; levID < vlistptr->vars[varID].nlevs; levID++ )
+        {
+          vlistptr->vars[varID].levinfo[levID].flag = FALSE;
+        }
+    }
+}
+
+static
+int vlist_generate_zaxis(int vlistID, int zaxistype, int nlevels, double *levels,
+                         double *lbounds, double *ubounds, int vctsize, const double *vct)
+{
+  int zaxisdefined;
+  int nzaxis;
+  int zaxisID = CDI_UNDEFID;
+  int index;
+  int zaxisglobdefined = 0;
+  int has_bounds = FALSE;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  zaxisdefined = 0;
+  nzaxis = vlistptr->nzaxis;
+
+  if ( lbounds && ubounds ) has_bounds = TRUE;
+
+  for ( index = 0; index < nzaxis; ++index )
+    {
+      zaxisID = vlistptr->zaxisIDs[index];
+
+      if ( zaxisCompare(zaxisID, zaxistype, nlevels, has_bounds, levels, NULL, NULL, 0) == 0 )
+        {
+          zaxisdefined = 1;
+          break;
+        }
+    }
+
+  if ( ! zaxisdefined )
+    {
+      nzaxis = zaxisSize();
+      if ( nzaxis > 0 )
+        {
+          int *zaxisIndexList;
+          zaxisIndexList = (int *) malloc ( nzaxis * sizeof ( int ));
+          zaxisGetIndexList ( nzaxis, zaxisIndexList );
+          for ( index = 0; index < nzaxis; ++index )
+            {
+              zaxisID = zaxisIndexList[index];
+              if ( zaxisCompare(zaxisID, zaxistype, nlevels, has_bounds, levels, NULL, NULL, 0) == 0 )
+                {
+                  zaxisglobdefined = 1;
+                  break;
+                }
+            }
+          if ( zaxisIndexList ) free ( zaxisIndexList );
+        }
+    }
+
+  if ( ! zaxisdefined )
+    {
+      if ( ! zaxisglobdefined )
+	{
+	  zaxisID = zaxisCreate(zaxistype, nlevels);
+	  zaxisDefLevels(zaxisID, levels);
+	  if ( has_bounds )
+	    {
+	      zaxisDefLbounds(zaxisID, lbounds);
+	      zaxisDefUbounds(zaxisID, ubounds);
+	    }
+
+	  if ( zaxistype == ZAXIS_HYBRID )
+	    {
+	      if ( vctsize > 0 )
+		zaxisDefVct(zaxisID, vctsize, vct);
+	      else
+		Warning("VCT missing");
+	    }
+	}
+
+      nzaxis = vlistptr->nzaxis;
+      vlistptr->zaxisIDs[nzaxis] = zaxisID;
+      vlistptr->nzaxis++;
+    }
+
+  return (zaxisID);
+}
+
+/*
+ at Function  vlistCopyFlag
+ at Title     Copy some entries of a variable list
+
+ at Prototype void vlistCopyFlag(int vlistID2, int vlistID1)
+ at Parameter
+    @Item  vlistID2  Target variable list ID
+    @Item  vlistID1  Source variable list ID
+
+ at Description
+The function @func{vlistCopyFlag} copies all entries with a flag from vlistID1 to vlistID2.
+
+ at EndFunction
+*/
+void vlistCopyFlag(int vlistID2, int vlistID1)
+{
+  vlist_t *vlistptr1, *vlistptr2;
+
+  vlistptr1 = vlist_to_pointer(vlistID1);
+  vlistptr2 = vlist_to_pointer(vlistID2);
+
+  vlist_check_ptr(__func__, vlistptr1);
+  vlist_check_ptr(__func__, vlistptr2);
+
+  vlist_copy(vlistptr2, vlistptr1);
+
+  vlistCopyVarAtts(vlistID1, CDI_GLOBAL, vlistID2, CDI_GLOBAL);
+
+  if ( vlistptr1->vars )
+    {
+      int nvars = vlistptr1->nvars;
+      int nvars2 = 0, levID2;
+      int nlevs, nlevs2, levID, varID, varID2;
+      int gridID, zaxisID;
+      int index;
+
+      vlistptr2->ngrids = 0;
+      vlistptr2->nzaxis = 0;
+
+      for ( varID = 0; varID < nvars; varID++ )
+        if ( vlistptr1->vars[varID].flag ) nvars2++;
+
+      vlistptr2->nvars = nvars2;
+      vlistptr2->varsAllocated = nvars2;
+      if ( nvars2 > 0 )
+        vlistptr2->vars  = (var_t *) malloc(nvars2*sizeof(var_t));
+      else
+        vlistptr2->vars  = NULL;
+
+      varID2 = 0;
+      for ( varID = 0; varID < nvars; varID++ )
+	if ( vlistptr1->vars[varID].flag )
+	  {
+	    vlistptr2->vars[varID2].flag = FALSE;
+	    zaxisID = vlistptr1->vars[varID].zaxisID;
+	    gridID  = vlistptr1->vars[varID].gridID;
+
+	    memcpy(&vlistptr2->vars[varID2], &vlistptr1->vars[varID], sizeof(var_t));
+
+	    vlistptr1->vars[varID].fvarID = varID2;
+	    vlistptr2->vars[varID2].fvarID = varID;
+
+	    vlistptr2->vars[varID2].mvarID = varID2;
+
+	    if ( vlistptr1->vars[varID].name )
+	      vlistptr2->vars[varID2].name = strdupx(vlistptr1->vars[varID].name);
+
+	    if ( vlistptr1->vars[varID].longname )
+	      vlistptr2->vars[varID2].longname = strdupx(vlistptr1->vars[varID].longname);
+
+	    if ( vlistptr1->vars[varID].stdname )
+	      vlistptr2->vars[varID2].stdname = strdupx(vlistptr1->vars[varID].stdname);
+
+	    if ( vlistptr1->vars[varID].units )
+	      vlistptr2->vars[varID2].units = strdupx(vlistptr1->vars[varID].units);
+
+            if ( vlistptr1->vars[varID].ensdata )
+              {
+                vlistptr2->vars[varID2].ensdata = (ensinfo_t *) malloc(sizeof(ensinfo_t));
+                memcpy(vlistptr2->vars[varID2].ensdata,
+                       vlistptr1->vars[varID].ensdata, sizeof(ensinfo_t));
+              }
+
+	    vlistptr2->vars[varID2].atts.nelems = 0;
+	    vlistCopyVarAtts(vlistID1, varID, vlistID2, varID2);
+
+	    nlevs  = vlistptr1->vars[varID].nlevs;
+	    nlevs2 = 0;
+	    for ( levID = 0; levID < nlevs; levID++ )
+	      if ( vlistptr1->vars[varID].levinfo[levID].flag ) nlevs2++;
+
+	    vlistptr2->vars[varID2].levinfo = (levinfo_t *) malloc(nlevs2*sizeof(levinfo_t));
+
+	    if ( nlevs != nlevs2 )
+	      {
+		int zaxisType;
+		int zaxisID2;
+		int nvct = 0;
+		double *levels;
+		double *lbounds = NULL, *ubounds = NULL;
+		const double *vct = NULL;
+                char ctemp[CDI_MAX_NAME];
+
+		zaxisID = vlistptr1->vars[varID].zaxisID;
+		levels = (double *) malloc(nlevs2*sizeof(double));
+		levID2 = 0;
+		for ( levID = 0; levID < nlevs; ++levID )
+		  if ( vlistptr1->vars[varID].levinfo[levID].flag )
+		    {
+		      vlistptr1->vars[varID].levinfo[levID].flevelID = levID2;
+		      vlistptr1->vars[varID].levinfo[levID].mlevelID = levID2;
+		      levels[levID2++] = zaxisInqLevel(zaxisID, levID);
+		    }
+
+		zaxisType = zaxisInqType(zaxisID);
+
+		if ( zaxisType == ZAXIS_HYBRID )
+		  {
+		    nvct = zaxisInqVctSize(zaxisID);
+		    vct  = zaxisInqVctPtr(zaxisID);
+		  }
+
+                if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+                  {
+                    double *lbounds1, *ubounds1;
+                    lbounds1 = (double *) malloc(nlevs*sizeof(double));
+                    ubounds1 = (double *) malloc(nlevs*sizeof(double));
+
+                    zaxisInqLbounds(zaxisID, lbounds1);
+                    zaxisInqUbounds(zaxisID, ubounds1);
+
+                    lbounds = (double *) malloc(nlevs2*sizeof(double));
+                    ubounds = (double *) malloc(nlevs2*sizeof(double));
+
+                    levID2 = 0;
+                    for ( levID = 0; levID < nlevs; ++levID )
+                      if ( vlistptr1->vars[varID].levinfo[levID].flag )
+                        {
+                          lbounds[levID2] = lbounds1[levID];
+                          ubounds[levID2] = ubounds1[levID];
+                          levID2++;
+                        }
+
+                    free(lbounds1);
+                    free(ubounds1);
+                  }
+
+		zaxisID2 = vlist_generate_zaxis(vlistID2, zaxisType, nlevs2, levels, lbounds, ubounds, nvct, vct);
+		free(levels);
+                if ( lbounds ) free(lbounds);
+                if ( ubounds ) free(ubounds);
+
+                zaxisInqName(zaxisID, ctemp);
+                zaxisDefName(zaxisID2, ctemp);
+                zaxisInqLongname(zaxisID, ctemp);
+                zaxisDefLongname(zaxisID2, ctemp);
+                zaxisInqUnits(zaxisID, ctemp);
+                zaxisDefUnits(zaxisID2, ctemp);
+
+		zaxisID = zaxisID2;
+		vlistptr2->vars[varID2].zaxisID = zaxisID2;
+		vlistptr2->vars[varID2].nlevs   = nlevs2;
+	      }
+
+	    for ( levID = 0; levID < nlevs2; levID++ )
+	      {
+		vlistptr2->vars[varID2].levinfo[levID].flag  = FALSE;
+		vlistptr2->vars[varID2].levinfo[levID].index = -1;
+	      }
+
+	    levID2 = 0;
+	    for ( levID = 0; levID < nlevs; levID++ )
+	      if ( vlistptr1->vars[varID].levinfo[levID].flag )
+		{
+		  vlistptr2->vars[varID2].levinfo[levID2].flevelID = levID;
+		  vlistptr2->vars[varID2].levinfo[levID2].mlevelID = levID;
+		  levID2++;
+		}
+
+	    for ( index = 0; index <vlistptr2->ngrids; index++ )
+	      if (vlistptr2->gridIDs[index] == gridID ) break;
+
+	    if ( index == vlistptr2->ngrids )
+	      {
+		vlistptr2->gridIDs[vlistptr2->ngrids++] = gridID;
+		if (vlistptr2->ngrids >= MAX_GRIDS_PS )
+		  Error("Internal Problem! More than %d grids.", MAX_GRIDS_PS);
+	      }
+
+	    for ( index = 0; index < vlistptr2->nzaxis; index++ )
+	      if ( vlistptr2->zaxisIDs[index] == zaxisID ) break;
+
+	    if ( index == vlistptr2->nzaxis )
+	      {
+		vlistptr2->zaxisIDs[vlistptr2->nzaxis++] = zaxisID;
+		if (vlistptr2->nzaxis >= MAX_ZAXES_PS )
+		  Error("Internal Problem! More than %d zaxis.", MAX_ZAXES_PS);
+	      }
+
+	    varID2++;
+	  }
+    }
+}
+
+/*
+ at Function  vlistCat
+ at Title     Concatenate two variable lists
+
+ at Prototype void vlistCat(int vlistID2, int vlistID1)
+ at Parameter
+    @Item  vlistID2  Target variable list ID
+    @Item  vlistID1  Source variable list ID
+
+ at Description
+Concatenate the variable list vlistID1 at the end of vlistID2.
+
+ at EndFunction
+*/
+void vlistCat(int vlistID2, int vlistID1)
+{
+  int nvars, nvars1, nvars2;
+  int varID, varID2, nlevs;
+  int index, gridID, zaxisID;
+  vlist_t *vlistptr1, *vlistptr2;
+
+  vlistptr1 = vlist_to_pointer(vlistID1);
+  vlistptr2 = vlist_to_pointer(vlistID2);
+
+  vlist_check_ptr(__func__, vlistptr1);
+  vlist_check_ptr(__func__, vlistptr2);
+
+  nvars1 = vlistptr1->nvars;
+  nvars2 = vlistptr2->nvars;
+  nvars = nvars1 + nvars2;
+  vlistptr2->nvars = nvars;
+
+  if ( nvars > vlistptr2->varsAllocated )
+    {
+      vlistptr2->varsAllocated = nvars;
+      vlistptr2->vars = (var_t *) realloc(vlistptr2->vars, nvars*sizeof(var_t));
+    }
+  memcpy(vlistptr2->vars+nvars2, vlistptr1->vars, nvars1*sizeof(var_t));
+
+  for ( varID = 0; varID < nvars1; varID++ )
+    {
+      varID2 = varID + nvars2;
+      vlistptr1->vars[varID].fvarID = varID2;
+      vlistptr2->vars[varID2].fvarID = varID;
+
+      vlistptr1->vars[varID].mvarID = varID2;
+      vlistptr2->vars[varID2].mvarID = varID;
+
+      if ( vlistptr1->vars[varID].param < 0 )
+	{
+	  int pnum, pcat, pdis;
+	  cdiDecodeParam(vlistptr1->vars[varID].param, &pnum, &pcat, &pdis);
+	  pnum = -(varID2+1);
+	  vlistptr2->vars[varID2].param = cdiEncodeParam(pnum, pcat, pdis);
+	}
+
+      if ( vlistptr1->vars[varID].name )
+        vlistptr2->vars[varID2].name = strdupx(vlistptr1->vars[varID].name);
+
+      if ( vlistptr1->vars[varID].longname )
+        vlistptr2->vars[varID2].longname = strdupx(vlistptr1->vars[varID].longname);
+
+      if ( vlistptr1->vars[varID].stdname )
+        vlistptr2->vars[varID2].stdname = strdupx(vlistptr1->vars[varID].stdname);
+
+      if ( vlistptr1->vars[varID].units )
+        vlistptr2->vars[varID2].units = strdupx(vlistptr1->vars[varID].units);
+
+      nlevs = vlistptr1->vars[varID].nlevs;
+      vlistptr2->vars[varID2].levinfo = (levinfo_t *) malloc(nlevs*sizeof(levinfo_t));
+      memcpy(vlistptr2->vars[varID2].levinfo, vlistptr1->vars[varID].levinfo, nlevs*sizeof(levinfo_t));
+
+      if ( vlistptr1->vars[varID].ensdata )
+        {
+          vlistptr2->vars[varID2].ensdata = (ensinfo_t *) malloc(sizeof(ensinfo_t));
+          memcpy(vlistptr2->vars[varID2].ensdata, vlistptr1->vars[varID].ensdata, sizeof(ensinfo_t));
+        }
+
+      vlistptr2->vars[varID2].atts.nelems = 0;
+      vlistCopyVarAtts(vlistID1, varID, vlistID2, varID2);
+
+      gridID = vlistptr1->vars[varID].gridID;
+      for ( index = 0; index < vlistptr2->ngrids; index++ )
+        if ( gridID == vlistptr2->gridIDs[index] ) break;
+
+      if ( index == vlistptr2->ngrids )
+	{
+	  vlistptr2->gridIDs[vlistptr2->ngrids++] = gridID;
+	  if ( vlistptr2->ngrids >= MAX_GRIDS_PS )
+	    Error("Internal Problem! More than %d grids.", MAX_GRIDS_PS);
+	}
+
+      zaxisID = vlistptr1->vars[varID].zaxisID;
+      for ( index = 0; index < vlistptr2->nzaxis; index++ )
+        if ( zaxisID == vlistptr2->zaxisIDs[index] ) break;
+
+      if ( index == vlistptr2->nzaxis )
+	{
+	  vlistptr2->zaxisIDs[vlistptr2->nzaxis++] = zaxisID;
+	  if ( vlistptr2->nzaxis >= MAX_ZAXES_PS )
+	    Error("Internal Problem! More than %d zaxis.", MAX_ZAXES_PS);
+	}
+    }
+}
+
+/*
+ at Function  vlistMerge
+ at Title     Merge two variable lists
+
+ at Prototype void vlistMerge(int vlistID2, int vlistID1)
+ at Parameter
+    @Item  vlistID2  Target variable list ID
+    @Item  vlistID1  Source variable list ID
+
+ at Description
+Merge the variable list vlistID1 to the variable list vlistID2.
+
+ at EndFunction
+*/
+void vlistMerge(int vlistID2, int vlistID1)
+{
+  int nvars1, nvars2;
+  int varID = 0, varID2, levID, nlevs, nlevs1, nlevs2;
+  int index, zaxisID;
+  int zaxisID1, zaxisID2;
+  int *lvar;
+  double *levels;
+  vlist_t *vlistptr1, *vlistptr2;
+
+  vlistptr1 = vlist_to_pointer(vlistID1);
+  vlistptr2 = vlist_to_pointer(vlistID2);
+
+  vlist_check_ptr(__func__, vlistptr1);
+  vlist_check_ptr(__func__, vlistptr2);
+
+  nvars1 = vlistptr1->nvars;
+  nvars2 = vlistptr2->nvars;
+
+  if ( nvars1 == nvars2 )
+    {
+      for ( varID = 0; varID < nvars2; varID++ )
+	{
+	  if ( vlistptr1->vars[varID].name && vlistptr2->vars[varID].name )
+	    {
+	      if ( strcmp(vlistptr1->vars[varID].name,
+			  vlistptr2->vars[varID].name) != 0 ) break;
+	    }
+	  else
+	    {
+	      if ( vlistptr1->vars[varID].param != vlistptr2->vars[varID].param )
+		break;
+	    }
+	}
+    }
+
+  if ( varID == nvars2 ) /* same variables in vlistID1 and vlistID2 */
+    {
+      for ( varID = 0; varID < nvars2; varID++ )
+        {
+          vlistptr1->vars[varID].fvarID = varID;
+          vlistptr2->vars[varID].fvarID = varID;
+
+          vlistptr1->vars[varID].mvarID = varID;
+          vlistptr2->vars[varID].mvarID = varID;
+
+          nlevs1 = vlistptr1->vars[varID].nlevs;
+          nlevs2 = vlistptr2->vars[varID].nlevs;
+
+          nlevs = nlevs1 + nlevs2;
+
+          vlistptr2->vars[varID].nlevs = nlevs;
+          /*
+          fprintf(stderr, "var %d %d %d %d %d\n", varID, nlevs1, nlevs2, nlevs, sizeof(levinfo_t));
+          */
+          vlistptr2->vars[varID].levinfo =
+            (levinfo_t *) realloc(vlistptr2->vars[varID].levinfo, nlevs*sizeof(levinfo_t));
+
+	  memcpy(vlistptr2->vars[varID].levinfo+nlevs2,
+		 vlistptr1->vars[varID].levinfo, nlevs1*sizeof(levinfo_t));
+
+	  for ( levID = 0; levID < nlevs1; levID++ )
+	    {
+	      vlistptr1->vars[varID].levinfo[levID].mlevelID = nlevs2 + levID;
+	    }
+	}
+
+      lvar = (int *) malloc(nvars2*sizeof(int));
+      for ( varID = 0; varID < nvars2; varID++ ) lvar[varID] = FALSE;
+
+      for ( varID = 0; varID < nvars2; varID++ )
+        {
+          if ( lvar[varID] == TRUE ) continue;
+
+          zaxisID1 = vlistptr1->vars[varID].zaxisID;
+          zaxisID2 = vlistptr2->vars[varID].zaxisID;
+          /*
+          nlevs1 = vlistptr1->vars[varID].nlevs;
+          nlevs2 = vlistptr2->vars[varID].nlevs;
+          */
+          nlevs1 = zaxisInqSize(zaxisID1);
+          nlevs2 = zaxisInqSize(zaxisID2);
+          /*
+          fprintf(stderr, "zaxis %d %d %d %d\n", zaxisID1, zaxisID2, nlevs1, nlevs2);
+          */
+          nlevs = nlevs1 + nlevs2;
+
+          zaxisID = zaxisDuplicate(zaxisID2);
+
+          zaxisResize(zaxisID, nlevs);
+
+          levels = (double *) malloc(nlevs1*sizeof(double));
+
+          zaxisInqLevels(zaxisID1, levels);
+          /*
+          for ( levID = 0; levID < nlevs1; levID++ )
+            fprintf(stderr, "%d %d %d %d %d %g\n", varID, levID, nlevs1, nlevs2, vlistptr2->vars[varID].nlevs, levels[levID]);
+          */
+          for ( levID = 0; levID < nlevs1; levID++ )
+            zaxisDefLevel(zaxisID, nlevs2+levID, levels[levID]);
+
+          free(levels);
+
+          for ( index = 0; index < vlistptr2->nzaxis; index++ )
+            if ( vlistptr2->zaxisIDs[index] == zaxisID2 )
+              vlistptr2->zaxisIDs[index] = zaxisID;
+
+          for ( varID2 = 0; varID2 < nvars2; varID2++ )
+            if ( lvar[varID2] == FALSE && vlistptr2->vars[varID2].zaxisID == zaxisID2 )
+              {
+                vlistptr2->vars[varID2].zaxisID = zaxisID;
+                lvar[varID2] = TRUE;
+              }
+        }
+
+      free(lvar);
+    }
+  else
+    {
+      vlistCat(vlistID2, vlistID1);
+    }
+}
+
+/*
+ at Function  vlistNvars
+ at Title     Number of variables in a variable list
+
+ at Prototype int vlistNvars(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at Description
+The function @func{vlistNvars} returns the number of variables in the variable list vlistID.
+
+ at Result
+ at func{vlistNvars} returns the number of variables in a variable list.
+
+ at EndFunction
+*/
+int vlistNvars(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->nvars);
+}
+
+
+int vlistNrecs(int vlistID)
+{
+  int varID, nrecs = 0;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  for ( varID = 0; varID < vlistptr->nvars; varID++ )
+    nrecs +=  vlistptr->vars[varID].nlevs;
+
+  return (nrecs);
+}
+
+
+int vlistNumber(int vlistID)
+{
+  int varID, number, number2, datatype;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  datatype = vlistptr->vars[0].datatype;
+  if (  datatype== DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    number = CDI_COMP;
+  else
+    number = CDI_REAL;
+
+  for ( varID = 1; varID < vlistptr->nvars; varID++ )
+    {
+      datatype = vlistptr->vars[varID].datatype;
+      if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+        number2 = CDI_COMP;
+      else
+        number2 = CDI_REAL;
+
+      if ( number2 != number )
+        {
+          number = CDI_BOTH;
+          break;
+        }
+    }
+
+  return (number);
+}
+
+/*
+ at Function  vlistNgrids
+ at Title     Number of grids in a variable list
+
+ at Prototype int vlistNgrids(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at Description
+The function @func{vlistNgrids} returns the number of grids in the variable list vlistID.
+
+ at Result
+ at func{vlistNgrids} returns the number of grids in a variable list.
+
+ at EndFunction
+*/
+int vlistNgrids(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->ngrids);
+}
+
+/*
+ at Function  vlistNzaxis
+ at Title     Number of zaxis in a variable list
+
+ at Prototype int vlistNzaxis(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at Description
+The function @func{vlistNzaxis} returns the number of zaxis in the variable list vlistID.
+
+ at Result
+ at func{vlistNzaxis} returns the number of zaxis in a variable list.
+
+ at EndFunction
+*/
+int vlistNzaxis(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->nzaxis);
+}
+
+
+void vlistDefNtsteps(int vlistID, int nts)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->ntsteps = nts;
+}
+
+
+int vlistNtsteps(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->ntsteps);
+}
+
+static void
+vlistPrintKernel(vlist_t *vlistptr, FILE * fp )
+{
+  int nvars, flag, index;
+  int varID, fvarID, mvarID, flevID, mlevID, levID;
+  int param, gridID, zaxisID, tsteptype, nlevs;
+  int dtype;
+
+  int i, iorank, decoSize, size, rank, offset, chunk;
+
+  char paramstr[32];
+  char *name, *longname, *units;
+  double level;
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  fprintf ( fp, "#\n# vlistID %d\n#\n", vlistptr->self);
+
+  nvars = vlistptr->nvars;
+
+  fprintf ( fp, "nvars   %d\n", nvars);
+  fprintf ( fp, "ngrids  %d\n", vlistptr->ngrids);
+  fprintf ( fp, "nzaxis  %d\n", vlistptr->nzaxis);
+  fprintf ( fp, "taxisID %d\n", vlistptr->taxisID);
+  fprintf ( fp, "instID  %d\n", vlistptr->instID);
+  fprintf ( fp, "modelID %d\n", vlistptr->modelID);
+  fprintf ( fp, "tableID %d\n", vlistptr->tableID);
+
+  if ( nvars > 0 )
+    {
+      fprintf(fp, " varID param    gridID zaxisID tsteptype nlevel flag "
+              " name     longname iorank decosize\n");
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          param    = vlistptr->vars[varID].param;
+          gridID   = vlistptr->vars[varID].gridID;
+          zaxisID  = vlistptr->vars[varID].zaxisID;
+	  tsteptype= vlistptr->vars[varID].tsteptype;
+          nlevs    = vlistptr->vars[varID].nlevs;
+          name     = vlistptr->vars[varID].name;
+          longname = vlistptr->vars[varID].longname;
+          units    = vlistptr->vars[varID].units;
+          flag     = vlistptr->vars[varID].flag;
+          iorank   = vlistptr->vars[varID].iorank;
+          decoSize = vlistptr->vars[varID].decoSize;
+
+          cdiParamToString(param, paramstr, sizeof(paramstr));
+          fprintf(fp, "%6d %-8s %6d %6d %6d %6d %5d %-8s"
+                  " %s %6d %6d",
+                  varID, paramstr, gridID, zaxisID, tsteptype, nlevs, flag,
+                  name ? name : "", longname ? longname : "",
+                  iorank, decoSize);
+
+          if ( units ) fprintf ( fp, "   [%s]", units);
+          fprintf ( fp, "\n");
+        }
+
+      fprintf(fp, "\n");
+      fprintf(fp, " varID  levID fvarID flevID mvarID mlevID  index  dtype  flag  level\n");
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          nlevs    = vlistptr->vars[varID].nlevs;
+          zaxisID  = vlistptr->vars[varID].zaxisID;
+          fvarID   = vlistptr->vars[varID].fvarID;
+          mvarID   = vlistptr->vars[varID].mvarID;
+          dtype    = vlistptr->vars[varID].datatype;
+          for ( levID = 0; levID < nlevs; levID++ )
+            {
+              flevID = vlistptr->vars[varID].levinfo[levID].flevelID;
+              mlevID = vlistptr->vars[varID].levinfo[levID].mlevelID;
+              index  = vlistptr->vars[varID].levinfo[levID].index;
+              flag   = vlistptr->vars[varID].levinfo[levID].flag;
+              level  = zaxisInqLevel(zaxisID, levID);
+              fprintf(fp, "%6d %6d %6d %6d %6d %6d %6d %6d %5d  %.9g\n",
+                      varID, levID, fvarID, flevID, mvarID, mlevID, index,
+                      dtype, flag, level);
+            }
+        }
+
+      fprintf(fp, "\n");
+      fprintf(fp, " varID  size iorank decosize corank offset  chunk\n");
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          iorank    = vlistptr->vars[varID].iorank;
+          decoSize  = vlistptr->vars[varID].decoSize;
+          size      = vlistptr->vars[varID].nlevs *
+            gridInqSize ( vlistptr->vars[varID].gridID );
+
+          for ( i = 0; i < decoSize; i++ )
+            {
+              rank   = vlistptr->vars[varID].deco[i].rank;
+              offset = vlistptr->vars[varID].deco[i].offset;
+              offset = vlistptr->vars[varID].deco[i].offset;
+              chunk  = vlistptr->vars[varID].deco[i].chunk;
+              fprintf ( fp, "%3d %8d %6d %6d %6d %8d %6d\n",
+                        varID, size, iorank, decoSize, rank, offset, chunk );
+            }
+        }
+    }
+}
+
+
+void vlistPrint(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  if ( vlistID == CDI_UNDEFID ) return;
+
+  vlistptr = vlist_to_pointer(vlistID);
+  vlist_check_ptr(__func__, vlistptr);
+  vlistPrintKernel(vlistptr, stdout);
+}
+
+/*
+ at Function  vlistDefTaxis
+ at Title     Define the time axis
+
+ at Prototype void vlistDefTaxis(int vlistID, int taxisID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{vlistDefTaxis} defines the time axis of a variable list.
+
+ at EndFunction
+*/
+void vlistDefTaxis(int vlistID, int taxisID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->taxisID = taxisID;
+}
+
+/*
+ at Function  vlistInqTaxis
+ at Title     Get the time axis
+
+ at Prototype int vlistInqTaxis(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at Description
+The function @func{vlistInqTaxis} returns the time axis of a variable list.
+
+ at Result
+ at func{vlistInqTaxis} returns an identifier to the time axis.
+
+ at EndFunction
+*/
+int vlistInqTaxis(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->taxisID);
+}
+
+
+void  vlistDefTable(int vlistID, int tableID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->tableID = tableID;
+}
+
+
+int vlistInqTable(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->tableID);
+}
+
+
+void vlistDefInstitut(int vlistID, int instID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+
+      xdebug("%s", "");
+      return;
+    }
+
+  vlistptr->instID = instID;
+}
+
+
+int vlistInqInstitut(int vlistID)
+{
+  int varID, instID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  instID = vlistptr->instID;
+
+  if ( instID == CDI_UNDEFID )
+    {
+      instID  = vlistInqVarInstitut(vlistID, 0);
+
+      for ( varID = 1; varID < vlistptr->nvars; varID++ )
+        if ( instID != vlistInqVarInstitut(vlistID, varID) )
+          {
+            instID = CDI_UNDEFID;
+            break;
+      }
+      vlistDefInstitut(vlistID, instID);
+    }
+
+  return (instID);
+}
+
+
+void vlistDefModel(int vlistID, int modelID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->modelID = modelID;
+}
+
+
+int vlistInqModel(int vlistID)
+{
+  int varID, modelID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  modelID = vlistptr->modelID;
+
+  if ( modelID == CDI_UNDEFID )
+    {
+      modelID = vlistInqVarModel(vlistID, 0);
+
+      for ( varID = 1; varID < vlistptr->nvars; varID++ )
+        if ( modelID != vlistInqVarModel(vlistID, varID) )
+          {
+            modelID = CDI_UNDEFID;
+            break;
+          }
+
+      vlistDefModel(vlistID, modelID);
+    }
+
+  return (modelID);
+}
+
+
+int vlistGridsizeMax(int vlistID)
+{
+  int gridsize, gridsizemax = 0;
+  int gridID, index;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  for ( index = 0 ; index < vlistptr->ngrids ; index++ )
+    {
+      gridID = vlistptr->gridIDs[index];
+      gridsize = gridInqSize(gridID);
+      if ( gridsize > gridsizemax ) gridsizemax = gridsize;
+    }
+
+  return (gridsizemax);
+}
+
+
+int vlistGrid(int vlistID, int index)
+{
+  int gridID = CDI_UNDEFID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( index < vlistptr->ngrids && index >= 0 )
+    gridID = vlistptr->gridIDs[index];
+
+  return (gridID);
+}
+
+
+int vlistGridIndex(int vlistID, int gridID)
+{
+  int index;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  for ( index = 0 ; index < vlistptr->ngrids ; index++ )
+    if ( gridID == vlistptr->gridIDs[index] ) break;
+
+  if ( index == vlistptr->ngrids ) index = -1;
+
+  return (index);
+}
+
+
+void vlistChangeGridIndex(int vlistID, int index, int gridID)
+{
+  int gridIDold;
+  int varID, nvars;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  gridIDold = vlistptr->gridIDs[index];
+  vlistptr->gridIDs[index] = gridID;
+
+  nvars = vlistptr->nvars;
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vlistptr->vars[varID].gridID == gridIDold )
+      vlistptr->vars[varID].gridID = gridID;
+}
+
+
+void vlistChangeGrid(int vlistID, int gridID1, int gridID2)
+{
+  int varID, nvars;
+  int index, ngrids;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  ngrids = vlistptr->ngrids;
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( vlistptr->gridIDs[index] == gridID1 )
+        {
+          vlistptr->gridIDs[index] = gridID2;
+          break;
+        }
+    }
+
+  nvars = vlistptr->nvars;
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vlistptr->vars[varID].gridID == gridID1 )
+      vlistptr->vars[varID].gridID = gridID2;
+}
+
+
+int vlistZaxis(int vlistID, int index)
+{
+  int zaxisID = CDI_UNDEFID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( index < vlistptr->nzaxis && index >= 0 )
+    zaxisID = vlistptr->zaxisIDs[index];
+
+  return (zaxisID);
+}
+
+int vlistZaxisIndex(int vlistID, int zaxisID)
+{
+  int index;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  for ( index = 0 ; index < vlistptr->nzaxis ; index++ )
+    if ( zaxisID == vlistptr->zaxisIDs[index] ) break;
+
+  if ( index == vlistptr->nzaxis ) index = -1;
+
+  return (index);
+}
+
+
+void vlistChangeZaxisIndex(int vlistID, int index, int zaxisID)
+{
+  int zaxisIDold;
+  int varID, nvars;
+  int nlevs, levID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  zaxisIDold = vlistptr->zaxisIDs[index];
+  vlistptr->zaxisIDs[index] = zaxisID;
+
+  nvars = vlistptr->nvars;
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vlistptr->vars[varID].zaxisID == zaxisIDold )
+      {
+        vlistptr->vars[varID].zaxisID = zaxisID;
+
+        nlevs = zaxisInqSize(zaxisID);
+        if ( nlevs != vlistptr->vars[varID].nlevs )
+          {
+            vlistptr->vars[varID].nlevs   = nlevs;
+            vlistptr->vars[varID].levinfo = (levinfo_t *) realloc(vlistptr->vars[varID].levinfo,
+                                                                     nlevs*sizeof(levinfo_t));
+
+            for ( levID = 0; levID < nlevs; levID++ )
+              {
+                vlistptr->vars[varID].levinfo[levID].flevelID = levID;
+                vlistptr->vars[varID].levinfo[levID].mlevelID = levID;
+                vlistptr->vars[varID].levinfo[levID].index    = -1;
+                vlistptr->vars[varID].levinfo[levID].flag     = FALSE;
+              }
+          }
+      }
+}
+
+
+void vlistChangeZaxis(int vlistID, int zaxisID1, int zaxisID2)
+{
+  int varID, nvars;
+  int index, nzaxis;
+  int nlevs, levID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  nzaxis = vlistptr->nzaxis;
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      if ( vlistptr->zaxisIDs[index] == zaxisID1 )
+        {
+          vlistptr->zaxisIDs[index] = zaxisID2;
+          break;
+        }
+    }
+
+  nvars = vlistptr->nvars;
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vlistptr->vars[varID].zaxisID == zaxisID1 )
+      {
+        vlistptr->vars[varID].zaxisID = zaxisID2;
+
+        nlevs = zaxisInqSize(zaxisID2);
+        if ( nlevs != vlistptr->vars[varID].nlevs )
+          {
+            vlistptr->vars[varID].nlevs   = nlevs;
+            vlistptr->vars[varID].levinfo = (levinfo_t *) realloc(vlistptr->vars[varID].levinfo,
+                                                                     nlevs*sizeof(levinfo_t));
+
+            for ( levID = 0; levID < nlevs; levID++ )
+              {
+                vlistptr->vars[varID].levinfo[levID].flevelID = levID;
+                vlistptr->vars[varID].levinfo[levID].mlevelID = levID;
+                vlistptr->vars[varID].levinfo[levID].index    = -1;
+                vlistptr->vars[varID].levinfo[levID].flag     = FALSE;
+              }
+          }
+      }
+}
+
+
+int vlistHasTime(int vlistID)
+{
+  int varID;
+  int hastime = FALSE;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  for ( varID = 0; varID <  vlistptr->nvars; varID++ )
+    if ( vlistptr->vars[varID].tsteptype != TSTEP_CONSTANT )
+      {
+        hastime = TRUE;
+        break;
+      }
+
+  return (hastime);
+}
+
+#ifdef USE_MPI
+
+enum {
+  vlist_nints=7,
+};
+
+static int
+vlistTxCode ( void )
+{
+  return VLIST;
+}
+
+
+static
+int  vlistGetSizeP ( void * vlistptr, MPI_Comm comm )
+{
+  int txsize, varID;
+  vlist_t *p = vlistptr;
+  xmpi(MPI_Pack_size(vlist_nints, MPI_INT, comm, &txsize));
+  txsize += vlistAttsGetSize(p, CDI_GLOBAL, comm);
+  for ( varID = 0; varID <  p->nvars; varID++ )
+    txsize += vlistVarGetSize(p, varID, comm);
+  return txsize;
+}
+
+
+static
+void vlistPackP ( void * vlistptr, void * buf, int size, int *position,
+                  MPI_Comm comm )
+{
+  int varID, tempbuf[vlist_nints];
+  vlist_t *p = vlistptr;
+  tempbuf[0] = p->self;
+  tempbuf[1] = p->nvars;
+  tempbuf[2] = p->ntsteps;
+  tempbuf[3] = p->taxisID;
+  tempbuf[4] = p->tableID;
+  tempbuf[5] = p->instID;
+  tempbuf[6] = p->modelID;
+  xmpi(MPI_Pack(tempbuf, vlist_nints, MPI_INT, buf, size, position, comm));
+  vlistAttsPack(p, CDI_GLOBAL, buf, size, position, comm);
+  for ( varID = 0; varID < p->nvars; varID++ )
+    {
+      vlistVarPack(p, varID, buf, size, position, comm);
+    }
+}
+
+void vlistUnpack(char * buf, int size, int *position, int nspTarget, MPI_Comm comm)
+{
+  int newvlist;
+  int varID, tempbuf[vlist_nints];
+  xmpi(MPI_Unpack(buf, size, position, tempbuf, vlist_nints, MPI_INT, comm));
+  newvlist = vlistCreate();
+  /* xassert(newvlist == tempbuf[0]); */
+  vlistDefTaxis ( newvlist, namespaceAdaptKey ( tempbuf[3], nspTarget ));
+  vlistDefTable(newvlist, tempbuf[4]);
+  vlistDefInstitut ( newvlist, namespaceAdaptKey ( tempbuf[5], nspTarget ));
+  vlistDefModel ( newvlist, namespaceAdaptKey ( tempbuf[6], nspTarget ));
+  vlistAttsUnpack(newvlist, CDI_GLOBAL, buf, size, position, comm);
+  for ( varID = 0; varID < tempbuf[1]; varID++ )
+    vlistVarUnpack ( newvlist, buf, size, position, nspTarget, comm );
+}
+
+#endif
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifdef HAVE_CONFIG_H
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+
+
+
+static
+cdi_atts_t *get_attsp(vlist_t *vlistptr, int varID)
+{
+  cdi_atts_t *attsp = NULL;
+
+  if ( varID == CDI_GLOBAL )
+    {
+      attsp = &vlistptr->atts;
+    }
+  else
+    {
+      if ( varID >= 0 && varID < vlistptr->nvars )
+	attsp = &(vlistptr->vars[varID].atts);
+    }
+
+  return (attsp);
+}
+
+static
+cdi_att_t *find_att(cdi_atts_t *attsp, const char *name)
+{
+  cdi_att_t *attp;
+  size_t attid;
+  size_t slen;
+
+  xassert(attsp != NULL);
+
+  if ( attsp->nelems == 0 ) return NULL;
+
+  slen = strlen(name);
+
+  for ( attid = 0; attid < attsp->nelems; attid++ )
+    {
+      attp = &(attsp->value[attid]);
+      if ( attp->namesz == slen )
+	if ( memcmp(attp->name, name, slen) == 0)
+	  {
+	    return (attp); /* Normal return */
+	  }
+    }
+
+  return (NULL);
+}
+
+static
+cdi_att_t *new_att(cdi_atts_t *attsp, const char *name)
+{
+  cdi_att_t *attp;
+  size_t slen;
+
+  xassert(attsp != NULL);
+  xassert(name  != NULL);
+
+  if ( attsp->nelems == attsp->nalloc ) return (NULL);
+
+  attp = &(attsp->value[attsp->nelems]);
+  attsp->nelems++;
+
+  slen = strlen(name);
+
+  attp->name = (char *) malloc(slen+1);
+  memcpy(attp->name, name, slen+1);
+  attp->namesz = slen;
+  attp->xvalue = NULL;
+
+  return (attp);
+}
+
+static
+void fill_att(cdi_att_t *attp, int indtype, int exdtype, size_t nelems, size_t xsz, const void *xvalue)
+{
+  xassert(attp != NULL);
+
+  attp->xsz = xsz;
+  attp->indtype = indtype;
+  attp->exdtype = exdtype;
+  attp->nelems  = nelems;
+
+  if ( xsz > 0 )
+    {
+      attp->xvalue = xrealloc(attp->xvalue, xsz);
+      memcpy(attp->xvalue, xvalue, xsz);
+    }
+}
+
+/*
+ at Function  vlistInqNatts
+ at Title     Get number of variable attributes
+
+ at Prototype int vlistInqNatts(int vlistID, int varID, int *nattsp)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  nattsp   Pointer to location for returned number of variable attributes.
+
+ at Description
+The function @func{vlistInqNatts} gets the number of variable attributes assigned to this variable.
+
+ at EndFunction
+*/
+int vlistInqNatts(int vlistID, int varID, int *nattsp)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr;
+  cdi_atts_t *attsp;
+
+  vlistptr = vlist_to_pointer(vlistID);
+  
+  attsp = get_attsp(vlistptr, varID);
+  xassert(attsp != NULL);
+
+  *nattsp = attsp->nelems;
+
+  return (status);
+}
+
+/*
+ at Function  vlistInqAtt
+ at Title     Get information about an attribute
+
+ at Prototype int vlistInqAtt(int vlistID, int varID, int attnum, char *name, int *typep, int *lenp)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  attnum   Attribute number (from 0 to natts-1).
+    @Item  name     Pointer to the location for the returned attribute name. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+    @Item  typep    Pointer to location for returned attribute type.
+    @Item  lenp     Pointer to location for returned attribute number.
+
+ at Description
+The function @func{vlistInqAtt} gets information about an attribute.
+
+ at EndFunction
+*/
+int vlistInqAtt(int vlistID, int varID, int attnum, char *name, int *typep, int *lenp)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr;
+  cdi_att_t *attp = NULL;
+  cdi_atts_t *attsp;
+
+  xassert(name != NULL);
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  attsp = get_attsp(vlistptr, varID);
+  xassert(attsp != NULL);
+
+  if ( attnum >= 0 && attnum < (int)attsp->nelems )
+    attp = &(attsp->value[attnum]);
+
+  if ( attp != NULL ) /* name in use */
+    {
+      memcpy(name, attp->name, attp->namesz+1);
+      *typep  = attp->exdtype;
+      *lenp   = attp->nelems;
+    }
+  else
+    {
+      name[0] =  0;
+      *typep  = -1;
+      *lenp   =  0;
+    }
+
+  return (status);
+}
+
+
+int vlistDelAtts(int vlistID, int varID)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr;
+  cdi_att_t *attp = NULL;
+  cdi_atts_t *attsp;
+  int attid;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  attsp = get_attsp(vlistptr, varID);
+  xassert(attsp != NULL);
+
+  for ( attid = 0; attid < (int)attsp->nelems; attid++ )
+    {
+      attp = &(attsp->value[attid]);
+      if ( attp->name   ) free(attp->name);
+      if ( attp->xvalue ) free(attp->xvalue);
+    }
+
+  attsp->nelems = 0;
+
+  return (status);
+}
+
+
+int vlistDelAtt(int vlistID, int varID, const char *name)
+{
+  int status = CDI_NOERR;
+
+  fprintf(stderr, "vlistDelAtt not implemented!\n");
+
+  return (status);
+}
+
+static
+int vlist_def_att(int indtype, int exdtype, int vlistID, int varID, const char *name, size_t len, size_t xsz, const void *xp)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr;
+  cdi_att_t *attp;
+  cdi_atts_t *attsp;
+
+  if ( len != 0 && xp == NULL ) /* Null arg */
+    {
+      return (CDI_EINVAL);
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  attsp = get_attsp(vlistptr, varID);
+  xassert(attsp != NULL);
+
+  attp = find_att(attsp, name);
+  if ( attp == NULL )
+    attp = new_att(attsp, name);
+
+  if ( attp != NULL )
+    fill_att(attp, indtype, exdtype, len, xsz, xp);
+  
+  return (status);
+}
+
+static
+int vlist_inq_att(int indtype, int vlistID, int varID, const char *name, size_t mxsz, void *xp)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr;
+  cdi_att_t *attp;
+  cdi_atts_t *attsp;
+  size_t xsz;
+
+  if ( mxsz != 0 && xp == NULL ) /* Null arg */
+    {
+      return (CDI_EINVAL);
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  attsp = get_attsp(vlistptr, varID);
+  xassert(attsp != NULL);
+
+  attp = find_att(attsp, name);
+  if ( attp != NULL ) /* name in use */
+    {
+      if ( attp->indtype == indtype )
+	{
+	  xsz = attp->xsz;
+	  if ( mxsz < xsz ) xsz = mxsz;
+	  if ( xsz > 0 )
+	    memcpy(xp, attp->xvalue, xsz);
+	}
+      else
+	{
+	  Warning("Attribute %s has wrong data type!", name);
+	}
+    }
+  else
+    {
+      Warning("Internal problem, attribute %s not found!", name);
+    }
+
+  return (status);
+}
+
+
+int vlistCopyVarAtts(int vlistID1, int varID_1, int vlistID2, int varID_2)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr1;
+  cdi_att_t *attp = NULL;
+  cdi_atts_t *attsp1;
+  int attid;
+
+  vlistptr1 = vlist_to_pointer(vlistID1);
+
+  attsp1 = get_attsp(vlistptr1, varID_1);
+  xassert(attsp1 != NULL);
+
+  for ( attid = 0; attid < (int)attsp1->nelems; attid++ )
+    {
+      attp = &(attsp1->value[attid]);
+      vlist_def_att(attp->indtype, attp->exdtype, vlistID2, varID_2, attp->name, attp->nelems, attp->xsz, attp->xvalue);
+    }
+
+  return (status);
+}
+
+/*
+ at Function  vlistDefAttInt
+ at Title     Define an integer attribute
+
+ at Prototype int vlistDefAttInt(int vlistID, int varID, const char *name, int type, int len, const int *ip)
+
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  type     External data type (@func{DATATYPE_INT16} or @func{DATATYPE_INT32}).
+    @Item  len      Number of values provided for the attribute.
+    @Item  ip       Pointer to one or more integer values.
+
+ at Description
+The function @func{vlistDefAttInt} defines an integer attribute.
+
+ at EndFunction
+*/
+int vlistDefAttInt(int vlistID, int varID, const char *name, int type, int len, const int *ip)
+{
+  int status;
+
+  status = vlist_def_att(DATATYPE_INT, type, vlistID, varID, name, (size_t) len, len*sizeof(int), (const void *) ip);
+
+  return (status);
+}
+
+/*
+ at Function  vlistDefAttFlt
+ at Title     Define a floating point attribute
+
+ at Prototype int vlistDefAttFlt(int vlistID, int varID, const char *name, int type, int len, const double *dp)
+
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  type     External data type (@func{DATATYPE_FLT32} or @func{DATATYPE_FLT64}).
+    @Item  len      Number of values provided for the attribute.
+    @Item  dp       Pointer to one or more floating point values.
+
+ at Description
+The function @func{vlistDefAttFlt} defines a floating point attribute.
+
+ at EndFunction
+*/
+int vlistDefAttFlt(int vlistID, int varID, const char *name, int type, int len, const double *dp)
+{
+  int status;
+
+  status = vlist_def_att(DATATYPE_FLT, type, vlistID, varID, name, (size_t) len, len*sizeof(double), (const void *) dp);
+
+  return (status);
+}
+
+/*
+ at Function  vlistDefAttTxt
+ at Title     Define a text attribute
+
+ at Prototype int vlistDefAttTxt(int vlistID, int varID, const char *name, int len, const char *tp)
+
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  len      Number of values provided for the attribute.
+    @Item  tp       Pointer to one or more character values.
+
+ at Description
+The function @func{vlistDefAttTxt} defines a text attribute.
+
+ at EndFunction
+*/
+int vlistDefAttTxt(int vlistID, int varID, const char *name, int len, const char *tp)
+{
+  int status;
+
+  status = vlist_def_att(DATATYPE_TXT, DATATYPE_TXT, vlistID, varID, name, (size_t) len, len*sizeof(char), (const void *) tp);
+
+  return (status);
+}
+
+/*
+ at Function  vlistInqAttInt
+ at Title     Get the value(s) of an integer attribute
+
+ at Prototype int vlistInqAttInt(int vlistID, int varID, const char *name, int mlen, int *ip)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  mlen     Number of allocated values provided for the attribute.
+    @Item  ip       Pointer location for returned integer attribute value(s).
+
+ at Description
+The function @func{vlistInqAttInt} gets the values(s) of an integer attribute.
+
+ at EndFunction
+*/
+int vlistInqAttInt(int vlistID, int varID, const char *name, int mlen, int *ip)
+{
+  int status
+    = vlist_inq_att(DATATYPE_INT, vlistID, varID, name,
+                    mlen*sizeof(int), (void *) ip);
+  return status;
+}
+
+/*
+ at Function  vlistInqAttFlt
+ at Title     Get the value(s) of a floating point attribute
+
+ at Prototype int vlistInqAttFlt(int vlistID, int varID, const char *name, int mlen, int *dp)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  mlen     Number of allocated values provided for the attribute.
+    @Item  dp       Pointer location for returned floating point attribute value(s).
+
+ at Description
+The function @func{vlistInqAttFlt} gets the values(s) of a floating point attribute.
+
+ at EndFunction
+*/
+int vlistInqAttFlt(int vlistID, int varID, const char *name, int mlen, double *dp)
+{
+  int status = CDI_NOERR;
+
+  status = vlist_inq_att(DATATYPE_FLT, vlistID, varID, name, mlen*sizeof(double), (void *) dp);
+
+  return (status);
+}
+
+/*
+ at Function  vlistInqAttTxt
+ at Title     Get the value(s) of a text attribute
+
+ at Prototype int vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen, int *tp)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  mlen     Number of allocated values provided for the attribute.
+    @Item  tp       Pointer location for returned text attribute value(s).
+
+ at Description
+The function @func{vlistInqAttTxt} gets the values(s) of a text attribute.
+
+ at EndFunction
+*/
+int vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen, char *tp)
+{
+  int status = CDI_NOERR;
+
+  status = vlist_inq_att(DATATYPE_TXT, vlistID, varID, name, mlen*sizeof(char), (void *) tp);
+
+  return (status);
+}
+
+#ifdef USE_MPI
+
+enum {
+  vlist_att_nints = 4,          /* namesz, exdtype, indtype, nelems */
+};
+
+static int
+vlistAttGetSize(vlist_t *vlistptr, int varID, int attnum, MPI_Comm comm)
+{
+  int txsize = 0, txinc;
+  cdi_atts_t *attsp;
+  cdi_att_t *attp;
+  char text[1024];
+
+  xassert(attsp = get_attsp(vlistptr, varID));
+  xassert(attnum >= 0 && attnum < (int)attsp->nelems);
+  attp = &(attsp->value[attnum]);
+  xmpi(MPI_Pack_size(vlist_att_nints, MPI_INT, comm, &txsize));
+  xmpi(MPI_Pack_size(attp->namesz, MPI_CHAR, comm, &txinc));
+  txsize += txinc;
+  switch (attp->indtype)
+  {
+  case DATATYPE_FLT:
+    xmpi(MPI_Pack_size((int)attp->nelems, MPI_DOUBLE, comm, &txinc));
+    break;
+  case DATATYPE_INT:
+    xmpi(MPI_Pack_size((int)attp->nelems, MPI_INT, comm, &txinc));
+    break;
+  case DATATYPE_TXT:
+    xmpi(MPI_Pack_size((int)attp->nelems, MPI_CHAR, comm, &txinc));
+    break;
+  default:
+    sprintf( text, "Unknown datatype encountered in attribute %s: %d\n",
+            attp->name, attp->indtype);
+    xabort ( text );
+  }
+  txsize += txinc;
+  return txsize;
+}
+
+int
+vlistAttsGetSize(vlist_t *p, int varID, MPI_Comm comm)
+{
+  int numAtts, i;
+  int txsize;
+  cdi_atts_t *attsp = get_attsp(p, varID);
+  numAtts = attsp->nelems;
+  xmpi(MPI_Pack_size(1, MPI_INT, comm, &txsize));
+  for (i = 0; i < numAtts; ++i)
+  {
+    txsize += vlistAttGetSize(p, varID, i, comm);
+  }
+  return txsize;
+}
+
+static void
+vlistAttPack(vlist_t *vlistptr, int varID, int attnum,
+             void * buf, int size, int *position, MPI_Comm comm)
+{
+  cdi_atts_t *attsp;
+  cdi_att_t *attp;
+  int tempbuf[vlist_att_nints];
+  MPI_Datatype attVMPIDt;
+
+  xassert(attsp = get_attsp(vlistptr, varID));
+  xassert(attnum >= 0 && attnum < (int)attsp->nelems);
+  attp = &(attsp->value[attnum]);
+  tempbuf[0] = attp->namesz;
+  tempbuf[1] = attp->exdtype;
+  tempbuf[2] = attp->indtype;
+  tempbuf[3] = attp->nelems;
+  xmpi(MPI_Pack(tempbuf, vlist_att_nints, MPI_INT, buf, size, position, comm));
+  xmpi(MPI_Pack(attp->name, attp->namesz, MPI_CHAR, buf, size, position, comm));
+  switch (attp->indtype)
+  {
+  case DATATYPE_FLT:
+    attVMPIDt = MPI_DOUBLE;
+    break;
+  case DATATYPE_INT:
+    attVMPIDt = MPI_INT;
+    break;
+  case DATATYPE_TXT:
+    attVMPIDt = MPI_CHAR;
+    break;
+  default:
+    xabort("Unknown datatype encountered in attribute %s: %d\n",
+           attp->name, attp->indtype);
+  }
+  xmpi(MPI_Pack(attp->xvalue, (int)attp->nelems, attVMPIDt,
+                buf, size, position, comm));
+}
+
+void
+vlistAttsPack(vlist_t *p, int varID,
+              void * buf, int size, int *position, MPI_Comm comm)
+{
+  int numAtts, i;
+  cdi_atts_t *attsp = get_attsp(p, varID);
+  numAtts = attsp->nelems;
+  xmpi(MPI_Pack(&numAtts, 1, MPI_INT, buf, size, position, comm));
+  for (i = 0; i < numAtts; ++i)
+    vlistAttPack(p, varID, i, buf, size, position, comm);
+}
+
+static void
+vlistAttUnpack(int vlistID, int varID,
+               void * buf, int size, int *position, MPI_Comm comm)
+{
+  char *attName;
+  int tempbuf[vlist_att_nints];
+  MPI_Datatype attVMPIDt;
+  int elemSize;
+  void *attData;
+
+  xmpi(MPI_Unpack(buf, size, position,
+                  tempbuf, vlist_att_nints, MPI_INT, comm));
+  attName = xmalloc(tempbuf[0] + 1);
+  xmpi(MPI_Unpack(buf, size, position, attName, tempbuf[0], MPI_CHAR, comm));
+  attName[tempbuf[0]] = '\0';
+  switch (tempbuf[2])
+  {
+  case DATATYPE_FLT:
+    attVMPIDt = MPI_DOUBLE;
+    elemSize = sizeof(double);
+    break;
+  case DATATYPE_INT:
+    attVMPIDt = MPI_INT;
+    elemSize = sizeof(int);
+    break;
+  case DATATYPE_TXT:
+    attVMPIDt = MPI_CHAR;
+    elemSize = 1;
+    break;
+  default:
+    xabort("Unknown datatype encountered in attribute %s: %d\n",
+           attName, tempbuf[2]);
+  }
+  attData = xmalloc(elemSize * tempbuf[3]);
+  xmpi(MPI_Unpack(buf, size, position, attData, tempbuf[3], attVMPIDt, comm));
+  vlist_def_att(tempbuf[2], tempbuf[1], vlistID, varID, attName,
+                tempbuf[3], tempbuf[3] * elemSize, attData);
+  free(attName);
+  free(attData);
+}
+
+void
+vlistAttsUnpack(int vlistID, int varID,
+                void * buf, int size, int *position, MPI_Comm comm)
+{
+  int numAtts, i;
+  xmpi(MPI_Unpack(buf, size, position, &numAtts, 1, MPI_INT, comm));
+  for (i = 0; i < numAtts; ++i)
+  {
+    vlistAttUnpack(vlistID, varID, buf, size, position, comm);
+  }
+}
+
+
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <limits.h>
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+
+extern resOps vlist_ops;
+
+static
+void vlistvarInitEntry(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].fvarID        = varID;
+  vlistptr->vars[varID].mvarID        = varID;
+  vlistptr->vars[varID].flag          = 0;
+  vlistptr->vars[varID].param         = 0;
+  vlistptr->vars[varID].datatype      = CDI_UNDEFID;
+  vlistptr->vars[varID].tsteptype     = TSTEP_INSTANT;
+  vlistptr->vars[varID].timave        = 0;
+  vlistptr->vars[varID].timaccu       = 0;
+  vlistptr->vars[varID].chunktype     = cdiChunkType;
+  vlistptr->vars[varID].xyz           = 0;
+  vlistptr->vars[varID].gridID        = CDI_UNDEFID;
+  vlistptr->vars[varID].zaxisID       = CDI_UNDEFID;
+  vlistptr->vars[varID].instID        = CDI_UNDEFID;
+  vlistptr->vars[varID].modelID       = CDI_UNDEFID;
+  vlistptr->vars[varID].tableID       = CDI_UNDEFID;
+  vlistptr->vars[varID].missvalused   = FALSE;
+  vlistptr->vars[varID].missval       = cdiDefaultMissval;
+  vlistptr->vars[varID].addoffset     = 0.0;
+  vlistptr->vars[varID].scalefactor   = 1.0;
+  vlistptr->vars[varID].name          = NULL;
+  vlistptr->vars[varID].longname      = NULL;
+  vlistptr->vars[varID].stdname       = NULL;
+  vlistptr->vars[varID].units         = NULL;
+  vlistptr->vars[varID].nlevs         = 0;
+  vlistptr->vars[varID].levinfo       = NULL;
+  vlistptr->vars[varID].comptype      = COMPRESS_NONE;
+  vlistptr->vars[varID].complevel     = 1;
+  vlistptr->vars[varID].atts.nalloc   = MAX_ATTRIBUTES;
+  vlistptr->vars[varID].atts.nelems   = 0;
+  vlistptr->vars[varID].lvalidrange   = 0;
+  vlistptr->vars[varID].validrange[0] = VALIDMISS;
+  vlistptr->vars[varID].validrange[1] = VALIDMISS;
+  vlistptr->vars[varID].ensdata       = NULL;
+  vlistptr->vars[varID].iorank        = CDI_UNDEFID;
+  vlistptr->vars[varID].decoSize      = 0;
+  vlistptr->vars[varID].deco          = NULL;
+}
+
+static
+int vlistvarNewEntry(int vlistID)
+{
+  int varID = 0;
+  int vlistvarSize;
+  var_t *vlistvar;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistvarSize = vlistptr->varsAllocated;
+  vlistvar     = vlistptr->vars;
+  /*
+    Look for a free slot in vlistvar.
+    (Create the table the first time through).
+  */
+  if ( ! vlistvarSize )
+    {
+      int i;
+
+      vlistvarSize = 2;
+      vlistvar = (var_t *) malloc(vlistvarSize*sizeof(var_t));
+      if ( vlistvar == NULL )
+	{
+          Message("vlistvarSize = %d", vlistvarSize);
+	  SysError("Allocation of var_t failed");
+	}
+
+      for ( i = 0; i < vlistvarSize; i++ )
+	vlistvar[i].isUsed = FALSE;
+    }
+  else
+    {
+      while ( varID < vlistvarSize )
+	{
+	  if ( ! vlistvar[varID].isUsed ) break;
+	  varID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if ( varID == vlistvarSize )
+    {
+      int i;
+
+      vlistvarSize = 2*vlistvarSize;
+      vlistvar = (var_t *) realloc(vlistvar, vlistvarSize*sizeof(var_t));
+      if ( vlistvar == NULL )
+	{
+          Message("vlistvarSize = %d", vlistvarSize);
+	  SysError("Reallocation of var_t failed");
+	}
+      varID = vlistvarSize/2;
+
+      for ( i = varID; i < vlistvarSize; i++ )
+	vlistvar[i].isUsed = FALSE;
+    }
+
+  vlistptr->varsAllocated = vlistvarSize;
+  vlistptr->vars          = vlistvar;
+
+  vlistvarInitEntry(vlistID, varID);
+
+  vlistptr->vars[varID].isUsed = TRUE;
+
+  return (varID);
+}
+
+static
+void vlistCheckVarID(const char *caller, int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( vlistptr == NULL )
+    Errorc("vlist undefined!");
+
+  if ( varID < 0 || varID >= vlistptr->nvars )
+    Errorc("varID %d undefined!", varID);
+
+  if ( ! vlistptr->vars[varID].isUsed )
+    Errorc("varID %d undefined!", varID);
+}
+
+/*
+ at Function  vlistDefVar
+ at Title     Define a Variable
+
+ at Prototype int vlistDefVar(int vlistID, int gridID, int zaxisID, int tsteptype)
+ at Parameter
+    @Item  vlistID   Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  gridID    Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  zaxisID   Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  tsteptype One of the set of predefined CDI timestep types.
+                     The valid CDI timestep types are @func{TSTEP_CONSTANT} and @func{TSTEP_INSTANT}.
+
+ at Description
+The function @func{vlistDefVar} adds a new variable to vlistID.
+
+ at Result
+ at func{vlistDefVar} returns an identifier to the new variable.
+
+ at Example
+Here is an example using @func{vlistCreate} to create a variable list
+and add a variable with @func{vlistDefVar}.
+
+ at Source
+   ...
+int vlistID, varID;
+   ...
+vlistID = vlistCreate();
+varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_INSTANT);
+   ...
+streamDefVlist(streamID, vlistID);
+   ...
+vlistDestroy(vlistID);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int vlistDefVar(int vlistID, int gridID, int zaxisID, int tsteptype)
+{
+  int varID;
+  int nlevs;
+  int levID;
+  int index;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return CDI_UNDEFID;
+    }
+
+  if ( CDI_Debug )
+    Message("gridID = %d  zaxisID = %d  tsteptype = %d", gridID, zaxisID, tsteptype);
+
+  varID = vlistvarNewEntry(vlistID);
+
+  vlistptr->nvars++;
+
+  vlistptr->vars[varID].gridID  = gridID;
+  vlistptr->vars[varID].zaxisID = zaxisID;
+  vlistptr->vars[varID].tsteptype = tsteptype;
+
+  if ( tsteptype < 0 )
+    {
+      Message("Unexpected tstep type %d, set to TSTEP_INSTANT!", tsteptype);
+      vlistptr->vars[varID].tsteptype = TSTEP_INSTANT;
+    }
+
+  nlevs = zaxisInqSize(zaxisID);
+
+  vlistptr->vars[varID].levinfo = (levinfo_t *) malloc(nlevs*sizeof(levinfo_t));
+
+  for ( levID = 0; levID < nlevs; levID++ )
+    {
+      vlistptr->vars[varID].levinfo[levID].flag     = 0;
+      vlistptr->vars[varID].levinfo[levID].index    = -1;
+      vlistptr->vars[varID].levinfo[levID].flevelID = levID;
+      vlistptr->vars[varID].levinfo[levID].mlevelID = levID;
+    }
+
+  vlistptr->vars[varID].nlevs = nlevs;
+
+  for ( index = 0; index < vlistptr->ngrids; index++ )
+    if ( gridID == vlistptr->gridIDs[index] ) break;
+
+  if ( index == vlistptr->ngrids )
+    {
+      if ( vlistptr->ngrids + 1 >= MAX_GRIDS_PS )
+	Error("Maximum of %d grids reached", MAX_GRIDS_PS);
+
+      vlistptr->gridIDs[vlistptr->ngrids] = gridID;
+      vlistptr->ngrids++;
+    }
+
+  for ( index = 0; index < vlistptr->nzaxis; index++ )
+    if ( zaxisID == vlistptr->zaxisIDs[index] ) break;
+
+  if ( index == vlistptr->nzaxis )
+    {
+      if ( vlistptr->nzaxis + 1 >= MAX_ZAXES_PS )
+	Error("Maximum of %d zaxis reached", MAX_ZAXES_PS);
+
+      vlistptr->zaxisIDs[vlistptr->nzaxis] = zaxisID;
+      vlistptr->nzaxis++;
+    }
+
+  vlistptr->vars[varID].param = cdiEncodeParam(-(varID + 1), 255, 255);
+
+  return (varID);
+}
+
+/*
+ at Function  vlistDefVarParam
+ at Title     Define the parameter number of a Variable
+
+ at Prototype void vlistDefVarParam(int vlistID, int varID, int param)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  param    Parameter number.
+
+ at Description
+The function @func{vlistDefVarParam} defines the parameter number of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarParam(int vlistID, int varID, int param)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->vars[varID].param = param;
+}
+
+/*
+ at Function  vlistDefVarCode
+ at Title     Define the code number of a Variable
+
+ at Prototype void vlistDefVarCode(int vlistID, int varID, int code)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  code     Code number.
+
+ at Description
+The function @func{vlistDefVarCode} defines the code number of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarCode(int vlistID, int varID, int code)
+{
+  vlist_t *vlistptr;
+  int param, pnum, pcat, pdis;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  param = vlistptr->vars[varID].param;
+
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+  
+  vlistptr->vars[varID].param = cdiEncodeParam(code, pcat, pdis);
+}
+
+
+void vlistInqVar(int vlistID, int varID, int *gridID, int *zaxisID, int *tsteptype)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  *gridID    = vlistptr->vars[varID].gridID;
+  *zaxisID   = vlistptr->vars[varID].zaxisID;
+  *tsteptype = vlistptr->vars[varID].tsteptype;
+
+  return;
+}
+
+/*
+ at Function  vlistInqVarGrid
+ at Title     Get the Grid ID of a Variable
+
+ at Prototype int vlistInqVarGrid(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarGrid} returns the grid ID of a variable.
+
+ at Result
+ at func{vlistInqVarGrid} returns the grid ID of the variable.
+
+ at EndFunction
+*/
+int vlistInqVarGrid(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].gridID);
+}
+
+/*
+ at Function  vlistInqVarZaxis
+ at Title     Get the Zaxis ID of a Variable
+
+ at Prototype int vlistInqVarZaxis(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarZaxis} returns the zaxis ID of a variable.
+
+ at Result
+ at func{vlistInqVarZaxis} returns the zaxis ID of the variable.
+
+ at EndFunction
+*/
+int vlistInqVarZaxis(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].zaxisID);
+}
+
+/*
+ at Function  vlistInqVarParam
+ at Title     Get the parameter number of a Variable
+
+ at Prototype int vlistInqVarParam(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarParam} returns the parameter number of a variable.
+
+ at Result
+ at func{vlistInqVarParam} returns the parameter number of the variable.
+
+ at EndFunction
+*/
+int vlistInqVarParam(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+  int param;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  param = vlistptr->vars[varID].param;
+
+  return (param);
+}
+
+/*
+ at Function  vlistInqVarCode
+ at Title     Get the Code number of a Variable
+
+ at Prototype int vlistInqVarCode(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarCode} returns the code number of a variable.
+
+ at Result
+ at func{vlistInqVarCode} returns the code number of the variable.
+
+ at EndFunction
+*/
+int vlistInqVarCode(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+  int param, code;
+  int pdis, pcat, pnum;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  param = vlistptr->vars[varID].param;
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+  code = pnum;
+
+  if ( code < 0 && vlistptr->vars[varID].tableID != -1 && vlistptr->vars[varID].name != NULL )
+    {
+      tableInqParCode(vlistptr->vars[varID].tableID, vlistptr->vars[varID].name, &code);
+    }
+
+  return (code);
+}
+
+
+const char *vlistInqVarNamePtr(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].name);
+}
+
+
+const char *vlistInqVarLongnamePtr(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].longname);
+}
+
+
+const char *vlistInqVarStdnamePtr(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].stdname);
+}
+
+
+const char *vlistInqVarUnitsPtr(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].units);
+}
+
+/*
+ at Function  vlistInqVarName
+ at Title     Get the name of a Variable
+
+ at Prototype void vlistInqVarName(int vlistID, int varID, char *name)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  name     Returned variable name. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{vlistInqVarName} returns the name of a variable.
+
+ at Result
+ at func{vlistInqVarName} returns the name of the variable to the parameter name if available,
+otherwise the result is an empty string.
+
+ at EndFunction
+*/
+void vlistInqVarName(int vlistID, int varID, char *name)
+{
+  int tableID;
+  int param;
+  int pdis, pcat, pnum;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( vlistptr->vars[varID].name == NULL )
+    {
+      param = vlistptr->vars[varID].param;
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+      if ( pdis == 255 )
+	{
+	  int code = pnum;
+	  tableID = vlistptr->vars[varID].tableID;
+	  if ( tableInqParName(tableID, code, name) != 0 )
+	    sprintf(name, "var%d", code);
+	}
+      else
+	{
+	  sprintf(name, "param%d.%d.%d", pnum, pcat, pdis);
+	}
+    }  
+  else
+    strcpy(name, vlistptr->vars[varID].name);
+
+  return;
+}
+
+/*
+ at Function  vlistInqVarLongname
+ at Title     Get the longname of a Variable
+
+ at Prototype void vlistInqVarLongname(int vlistID, int varID, char *longname)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  longname Long name of the variable. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{vlistInqVarLongname} returns the longname of a variable if available,
+otherwise the result is an empty string.
+
+ at Result
+ at func{vlistInqVaeLongname} returns the longname of the variable to the parameter longname.
+
+ at EndFunction
+*/
+void vlistInqVarLongname(int vlistID, int varID, char *longname)
+{
+  int tableID;
+  int param;
+  int pdis, pcat, pnum;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  longname[0] = '\0';
+
+  if ( vlistptr->vars[varID].longname == NULL )
+    {
+      param = vlistptr->vars[varID].param;
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+      if ( pdis == 255 )
+	{
+	  int code = pnum;
+	  tableID = vlistptr->vars[varID].tableID;
+	  if ( tableInqParLongname(tableID, code, longname) != 0 )
+	    longname[0] = '\0';
+	}
+    }  
+  else
+    strcpy(longname, vlistptr->vars[varID].longname);
+
+  return;
+}
+
+/*
+ at Function  vlistInqVarStdname
+ at Title     Get the standard name of a Variable
+
+ at Prototype void vlistInqVarStdname(int vlistID, int varID, char *stdname)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  stdname  Standard name of the variable. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{vlistInqVarStdname} returns the standard name of a variable if available,
+otherwise the result is an empty string.
+
+ at Result
+ at func{vlistInqVarName} returns the standard name of the variable to the parameter stdname.
+
+ at EndFunction
+*/
+void vlistInqVarStdname(int vlistID, int varID, char *stdname)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( vlistptr->vars[varID].stdname == NULL )
+    {
+      stdname[0] = '\0';
+    }  
+  else
+    strcpy(stdname, vlistptr->vars[varID].stdname);
+
+  return;
+}
+
+/*
+ at Function  vlistInqVarUnits
+ at Title     Get the units of a Variable
+
+ at Prototype void vlistInqVarUnits(int vlistID, int varID, char *units)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  units    Units of the variable. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{vlistInqVarUnits} returns the units of a variable if available,
+otherwise the result is an empty string.
+
+ at Result
+ at func{vlistInqVarUnits} returns the units of the variable to the parameter units.
+
+ at EndFunction
+*/
+void vlistInqVarUnits(int vlistID, int varID, char *units)
+{
+  int tableID;
+  int param;
+  int pdis, pcat, pnum;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  units[0] = '\0';
+
+  if ( vlistptr->vars[varID].units == NULL )
+    {
+      param = vlistptr->vars[varID].param;
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+      if ( pdis == 255 )
+	{
+	  int code = pnum;
+	  tableID = vlistptr->vars[varID].tableID;
+	  if ( tableInqParUnits(tableID, code, units) != 0 )
+	    units[0] = '\0';
+	}
+    }
+  else
+    strcpy(units, vlistptr->vars[varID].units);
+
+  return;
+}
+
+/* used in MPIOM ! */
+int vlistInqVarID(int vlistID, int code)
+{
+  int varID;
+  vlist_t *vlistptr;
+  int param, pdis, pcat, pnum;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  for ( varID = 0; varID < vlistptr->nvars; varID++ )
+    {
+      param = vlistptr->vars[varID].param;
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+      if ( pnum == code ) return (varID);
+    }
+
+  return (CDI_UNDEFID);
+}
+
+
+int vlistInqVarSize(int vlistID, int varID)
+{
+  int size;
+  int zaxisID, gridID;
+  int nlevs, gridsize;
+  int tsteptype;
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistInqVar(vlistID, varID, &gridID, &zaxisID, &tsteptype);
+
+  nlevs = zaxisInqSize(zaxisID);
+
+  gridsize = gridInqSize(gridID);
+
+  size = gridsize*nlevs;
+
+  return (size);
+}
+
+/*
+ at Function  vlistInqVarDatatype
+ at Title     Get the data type of a Variable
+
+ at Prototype int vlistInqVarDatatype(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarDatatype} returns the data type of a variable.
+
+ at Result
+ at func{vlistInqVarDatatype} returns an identifier to the data type of the variable.
+The valid CDI data types are @func{DATATYPE_PACK8}, @func{DATATYPE_PACK16}, @func{DATATYPE_PACK24},
+ at func{DATATYPE_FLT32}, @func{DATATYPE_FLT64}, @func{DATATYPE_INT8}, @func{DATATYPE_INT16} and 
+ at func{DATATYPE_INT32}.
+
+ at EndFunction
+*/
+int vlistInqVarDatatype(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].datatype);
+}
+
+
+int vlistInqVarNumber(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+  int number = CDI_REAL;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( vlistptr->vars[varID].datatype == DATATYPE_CPX32 ||
+       vlistptr->vars[varID].datatype == DATATYPE_CPX64 )
+    number = CDI_COMP;
+
+  return (number);
+}
+
+/*
+ at Function  vlistDefVarDatatype
+ at Title     Define the data type of a Variable
+
+ at Prototype void vlistDefVarDatatype(int vlistID, int varID, int datatype)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  datatype The data type identifier.
+                    The valid CDI data types are @func{DATATYPE_PACK8}, @func{DATATYPE_PACK16},
+                    @func{DATATYPE_PACK24}, @func{DATATYPE_FLT32}, @func{DATATYPE_FLT64},
+                    @func{DATATYPE_INT8}, @func{DATATYPE_INT16} and @func{DATATYPE_INT32}.
+
+ at Description
+The function @func{vlistDefVarDatatype} defines the data type of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarDatatype(int vlistID, int varID, int datatype)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->vars[varID].datatype = datatype;
+  
+  if ( vlistptr->vars[varID].missvalused == FALSE )
+    switch (datatype)
+      {
+      case DATATYPE_INT8:   vlistptr->vars[varID].missval = SCHAR_MIN; break;
+      case DATATYPE_UINT8:  vlistptr->vars[varID].missval = UCHAR_MAX; break;
+      case DATATYPE_INT16:  vlistptr->vars[varID].missval = SHRT_MIN;  break;
+      case DATATYPE_UINT16: vlistptr->vars[varID].missval = USHRT_MAX; break;
+      case DATATYPE_INT32:  vlistptr->vars[varID].missval = INT_MIN;   break;
+      case DATATYPE_UINT32: vlistptr->vars[varID].missval = UINT_MAX;  break;
+      }
+}
+
+
+void vlistDefVarInstitut(int vlistID, int varID, int instID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->vars[varID].instID = instID;
+}
+
+
+int vlistInqVarInstitut(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].instID);
+}
+
+
+void vlistDefVarModel(int vlistID, int varID, int modelID)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].modelID = modelID;
+}
+
+
+int vlistInqVarModel(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].modelID);
+}
+
+
+void vlistDefVarTable(int vlistID, int varID, int tableID)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].tableID = tableID;
+
+  {
+    int param, pnum, pcat, pdis;
+    int tablenum;
+    tablenum = tableInqNum(tableID);
+
+    param = vlistptr->vars[varID].param;
+
+    cdiDecodeParam(param, &pnum, &pcat, &pdis);
+  
+    vlistptr->vars[varID].param = cdiEncodeParam(pnum, tablenum, pdis);
+  }
+}
+
+
+int vlistInqVarTable(int vlistID, int varID)
+{
+  int tableID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  tableID = vlistptr->vars[varID].tableID;
+
+  return (tableID);
+}
+
+/*
+ at Function  vlistDefVarName
+ at Title     Define the name of a Variable
+
+ at Prototype void vlistDefVarName(int vlistID, int varID, const char *name)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  name     Name of the variable.
+
+ at Description
+The function @func{vlistDefVarName} defines the name of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarName(int vlistID, int varID, const char *name)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( name )
+    {
+      if ( vlistptr->vars[varID].name )
+	{
+	  free(vlistptr->vars[varID].name);
+	  vlistptr->vars[varID].name = NULL;
+	}
+
+      vlistptr->vars[varID].name = strdupx(name);
+    }
+}
+
+/*
+ at Function  vlistDefVarLongname
+ at Title     Define the long name of a Variable
+
+ at Prototype void vlistDefVarLongname(int vlistID, int varID, const char *longname)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  longname Long name of the variable.
+
+ at Description
+The function @func{vlistDefVarLongname} defines the long name of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarLongname(int vlistID, int varID, const char *longname)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( longname )
+    {
+      if ( vlistptr->vars[varID].longname )
+	{
+	  free(vlistptr->vars[varID].longname);
+	  vlistptr->vars[varID].longname = 0;
+	}
+
+      vlistptr->vars[varID].longname = strdupx(longname);
+    }
+}
+
+/*
+ at Function  vlistDefVarStdname
+ at Title     Define the standard name of a Variable
+
+ at Prototype void vlistDefVarStdname(int vlistID, int varID, const char *stdname)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  stdname  Standard name of the variable.
+
+ at Description
+The function @func{vlistDefVarStdname} defines the standard name of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarStdname(int vlistID, int varID, const char *stdname)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( stdname )
+    {
+      if ( vlistptr->vars[varID].stdname )
+	{
+	  free(vlistptr->vars[varID].stdname);
+	  vlistptr->vars[varID].stdname = 0;
+	}
+
+      vlistptr->vars[varID].stdname = strdupx(stdname);
+    }
+}
+
+/*
+ at Function  vlistDefVarUnits
+ at Title     Define the units of a Variable
+
+ at Prototype void vlistDefVarUnits(int vlistID, int varID, const char *units)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  units    Units of the variable.
+
+ at Description
+The function @func{vlistDefVarUnits} defines the units of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarUnits(int vlistID, int varID, const char *units)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( units )
+    {
+      if ( vlistptr->vars[varID].units )
+	{
+	  free(vlistptr->vars[varID].units);
+	  vlistptr->vars[varID].units = 0;
+	}
+
+      vlistptr->vars[varID].units = strdupx(units);
+    }
+}
+
+/*
+ at Function  vlistInqVarMissval
+ at Title     Get the missing value of a Variable
+
+ at Prototype double vlistInqVarMissval(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarMissval} returns the missing value of a variable.
+
+ at Result
+ at func{vlistInqVarMissval} returns the missing value of the variable.
+
+ at EndFunction
+*/
+double vlistInqVarMissval(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].missval);
+}
+
+/*
+ at Function  vlistDefVarMissval
+ at Title     Define the missing value of a Variable
+
+ at Prototype void vlistDefVarMissval(int vlistID, int varID, double missval)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  missval  Missing value.
+
+ at Description
+The function @func{vlistDefVarMissval} defines the missing value of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarMissval(int vlistID, int varID, double missval)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].missval = missval;
+  vlistptr->vars[varID].missvalused = TRUE;
+}
+
+
+int vlistInqVarValidrange(int vlistID, int varID, double *validrange)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( validrange != NULL && vlistptr->vars[varID].lvalidrange )
+    {
+      validrange[0] = vlistptr->vars[varID].validrange[0];
+      validrange[1] = vlistptr->vars[varID].validrange[1];
+    }
+
+  return (vlistptr->vars[varID].lvalidrange);
+}
+
+
+void vlistDefVarValidrange(int vlistID, int varID, const double *validrange)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].validrange[0] = validrange[0];
+  vlistptr->vars[varID].validrange[1] = validrange[1];
+  vlistptr->vars[varID].lvalidrange = TRUE;
+}
+
+
+double vlistInqVarScalefactor(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return 1.0;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].scalefactor);
+}
+
+
+double vlistInqVarAddoffset(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].addoffset);
+}
+
+void vlistDefVarScalefactor(int vlistID, int varID, double scalefactor)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].scalefactor = scalefactor;
+}
+
+
+void vlistDefVarAddoffset(int vlistID, int varID, double addoffset)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].addoffset = addoffset;
+}
+
+
+void vlistDefVarTsteptype(int vlistID, int varID, int tsteptype)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].tsteptype = tsteptype;
+}
+
+
+int vlistInqVarTsteptype(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].tsteptype);
+}
+
+
+void vlistDefVarTimave(int vlistID, int varID, int timave)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].timave = timave;
+}
+
+
+int vlistInqVarTimave(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].timave);
+}
+
+
+void vlistDefVarTimaccu(int vlistID, int varID, int timaccu)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].timaccu = timaccu;
+}
+
+
+int vlistInqVarTimaccu(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].timaccu);
+}
+
+
+void vlistDestroyVarName(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( vlistptr->vars[varID].name )
+    {
+      free(vlistptr->vars[varID].name);
+      vlistptr->vars[varID].name = NULL;
+    }
+}
+
+
+void vlistDestroyVarLongname(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( vlistptr->vars[varID].longname )
+    {
+      free(vlistptr->vars[varID].longname);
+      vlistptr->vars[varID].longname = NULL;
+    }
+}
+
+
+void vlistDestroyVarStdname(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( vlistptr->vars[varID].stdname )
+    {
+      free(vlistptr->vars[varID].stdname);
+      vlistptr->vars[varID].stdname = NULL;
+    }
+}
+
+
+void vlistDestroyVarUnits(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( vlistptr->vars[varID].units )
+    {
+      free(vlistptr->vars[varID].units);
+      vlistptr->vars[varID].units = NULL;
+    }
+}
+
+
+int vlistInqVarMissvalUsed(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].missvalused);
+}
+
+
+void vlistDefFlag(int vlistID, int varID, int levID, int flag)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].flag = flag;
+  vlistptr->vars[varID].levinfo[levID].flag = flag;
+}
+
+
+int vlistInqFlag(int vlistID, int varID, int levID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].levinfo[levID].flag);
+}
+
+
+int vlistFindVar(int vlistID, int fvarID)
+{
+  int varID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  for ( varID = 0; varID < vlistptr->nvars; varID++ )
+    {
+      if ( vlistptr->vars[varID].fvarID == fvarID ) break;
+    }
+
+  if ( varID == vlistptr->nvars )
+    {
+      varID = -1;
+      Message("varID not found for fvarID %d in vlistID %d!", fvarID, vlistID);
+    }
+
+  return (varID);  
+}
+
+
+int vlistFindLevel(int vlistID, int fvarID, int flevelID)
+{
+  int varID;
+  int levelID = -1;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  varID = vlistFindVar(vlistID, fvarID);
+
+  if ( varID != -1 )
+    {
+      for ( levelID = 0; levelID < vlistptr->vars[varID].nlevs; levelID++ )
+	{
+	  if ( vlistptr->vars[varID].levinfo[levelID].flevelID == flevelID ) break;
+	}
+
+      if ( levelID == vlistptr->vars[varID].nlevs )
+	{
+	  levelID = -1;
+	  Message("levelID not found for fvarID %d and levelID %d in vlistID %d!",
+		  fvarID, flevelID, vlistID);
+	}
+    }
+
+  return (levelID);  
+}
+
+
+int vlistMergedVar(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].mvarID);  
+}
+
+
+int vlistMergedLevel(int vlistID, int varID, int levelID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].levinfo[levelID].mlevelID);  
+}
+
+
+void vlistDefIndex(int vlistID, int varID, int levelID, int index)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].levinfo[levelID].index = index;  
+}
+
+
+int vlistInqIndex(int vlistID, int varID, int levelID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].levinfo[levelID].index);  
+}
+
+
+void vlistChangeVarZaxis(int vlistID, int varID, int zaxisID)
+{
+  int nlevs1, nlevs2;
+  int nvars, index;
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  nlevs1 = zaxisInqSize(vlistptr->vars[varID].zaxisID);
+  nlevs2 = zaxisInqSize(zaxisID);
+
+  if ( nlevs1 != nlevs2 ) Error("Number of levels must not change!");
+
+  nvars = vlistptr->nvars;
+  for ( index = 0; index < nvars; index++ )
+    if ( index != varID )
+      if ( vlistptr->vars[index].zaxisID == vlistptr->vars[varID].zaxisID ) break;
+
+  if ( index == nvars )
+    {
+      for ( index = 0; index < vlistptr->nzaxis; index++ )
+	if ( vlistptr->zaxisIDs[index] == vlistptr->vars[varID].zaxisID )
+	  vlistptr->zaxisIDs[index] = zaxisID;
+    }
+  else
+    {
+      for ( index = 0; index < vlistptr->nzaxis; index++ )
+	if ( vlistptr->zaxisIDs[index] == zaxisID ) break;
+
+      if ( index == vlistptr->nzaxis )
+	{
+	  if ( vlistptr->nzaxis + 1 >= MAX_ZAXES_PS )
+	    Error("Maximum of %d zaxis reached", MAX_ZAXES_PS);
+
+	  vlistptr->zaxisIDs[vlistptr->nzaxis] = zaxisID;
+	  vlistptr->nzaxis++;
+	}
+    }
+  
+  vlistptr->vars[varID].zaxisID = zaxisID;
+}
+
+
+void vlistChangeVarGrid(int vlistID, int varID, int gridID)
+{
+  int nvars, index;
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  nvars = vlistptr->nvars;
+  for ( index = 0; index < nvars; index++ )
+    if ( index != varID )
+      if ( vlistptr->vars[index].gridID == vlistptr->vars[varID].gridID ) break;
+
+  if ( index == nvars )
+    {
+      for ( index = 0; index < vlistptr->ngrids; index++ )
+	if ( vlistptr->gridIDs[index] == vlistptr->vars[varID].gridID )
+	  vlistptr->gridIDs[index] = gridID;
+    }
+  else
+    {
+      for ( index = 0; index < vlistptr->ngrids; index++ )
+	if ( vlistptr->gridIDs[index] == gridID ) break;
+
+      if ( index == vlistptr->ngrids )
+	{
+	  if ( vlistptr->ngrids + 1 >= MAX_GRIDS_PS )
+	    Error("Maximum of %d grids reached", MAX_GRIDS_PS);
+
+	  vlistptr->gridIDs[vlistptr->ngrids] = gridID;
+	  vlistptr->ngrids++;
+	}
+    }
+  
+  vlistptr->vars[varID].gridID = gridID;
+}
+
+
+void vlistDefVarCompType(int vlistID, int varID, int comptype)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr->vars[varID].comptype = comptype;
+}
+
+
+int vlistInqVarCompType(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].comptype);
+}
+
+
+void vlistDefVarCompLevel(int vlistID, int varID, int complevel)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].complevel = complevel;
+}
+
+
+int vlistInqVarCompLevel(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].complevel);
+}
+
+
+void  vlistDefVarChunkType(int vlistID, int varID, int chunktype)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].chunktype = chunktype;
+}
+
+
+int vlistInqVarChunkType(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].chunktype);
+}
+
+
+void  vlistDefVarXYZ(int vlistID, int varID, int xyz)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  /* check xyz dimension order */
+  {
+    int dimorder[3];
+    int dimx = 0, dimy = 0, dimz = 0;
+    dimorder[0] = xyz/100;
+    dimorder[1] = (xyz-dimorder[0]*100)/10;
+    dimorder[2] = (xyz-dimorder[0]*100-dimorder[1]*10);
+    for ( int id = 0; id < 3; ++id )
+      {
+        if      ( dimorder[id] == 3 ) { dimz++; }
+        else if ( dimorder[id] == 2 ) { dimy++; }
+        else if ( dimorder[id] == 1 ) { dimx++; }
+      }
+    if ( dimz > 1 || dimy > 1 || dimx > 1 ) xyz = 321; // ZYX
+    else
+      {
+        int lchanged = 0;
+        if ( dimz == 0 ) for ( int id = 0; id < 3; ++id ) if ( dimorder[id] == 0 ) {dimorder[id] = 3; lchanged++; break;}
+        if ( dimy == 0 ) for ( int id = 0; id < 3; ++id ) if ( dimorder[id] == 0 ) {dimorder[id] = 2; lchanged++; break;}
+        if ( dimx == 0 ) for ( int id = 0; id < 3; ++id ) if ( dimorder[id] == 0 ) {dimorder[id] = 1; lchanged++; break;}
+        if ( lchanged ) xyz = dimorder[0]*100 + dimorder[1]*10 + dimorder[2];
+      }
+  }
+
+  vlistptr->vars[varID].xyz = xyz;
+}
+
+
+int vlistInqVarXYZ(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].xyz);
+}
+
+
+/* Ensemble Info Routines */
+void vlistDefVarEnsemble(int vlistID, int varID, int ensID, int ensCount, int forecast_type )
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( vlistptr->vars[varID].ensdata == NULL )
+    vlistptr->vars[varID].ensdata = (ensinfo_t *) malloc( sizeof( ensinfo_t ) );
+
+  vlistptr->vars[varID].ensdata->ens_index          = ensID;
+  vlistptr->vars[varID].ensdata->ens_count          = ensCount;
+  vlistptr->vars[varID].ensdata->forecast_init_type = forecast_type;
+}
+
+
+int vlistInqVarEnsemble( int vlistID, int varID, int *ensID, int *ensCount, int *forecast_type )
+{
+  vlist_t *vlistptr;
+  int status = 0;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( vlistptr->vars[varID].ensdata )
+    {
+      *ensID = vlistptr->vars[varID].ensdata->ens_index;
+      *ensCount = vlistptr->vars[varID].ensdata->ens_count;
+      *forecast_type = vlistptr->vars[varID].ensdata->forecast_init_type;
+
+      status = 1;
+    }
+
+  return (status);
+}
+
+
+void vlistDefVarDeco ( int vlistID, int varID, int decoSize, deco_t * deco )
+{
+  vlist_t * vlistptr;
+  int i;
+
+  vlistptr = vlist_to_pointer(vlistID );
+
+  vlistCheckVarID ( __func__, vlistID, varID );
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  xassert ( decoSize && deco );
+ 
+  vlistptr->vars[varID].deco = xmalloc ( decoSize * sizeof ( deco_t )); 
+
+  for ( i = 0; i < decoSize; i++ )
+    {
+      vlistptr->vars[varID].deco[i].rank   = deco[i].rank;
+      vlistptr->vars[varID].deco[i].offset = deco[i].offset;
+      vlistptr->vars[varID].deco[i].chunk  = deco[i].chunk;
+    }
+
+  vlistptr->vars[varID].decoSize = decoSize;
+}
+
+
+int vlistInqVarDecoChunk ( int vlistID, int varID, int rankModel  )
+{
+  vlist_t *vlistptr;
+  int iret = CDI_UNDEFID;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+#ifdef USE_MPI
+  {
+    deco_t * deco;
+    int i, decoSize = 0;
+    xassert ( vlistptr->vars[varID].deco != NULL &&
+             vlistptr->vars[varID].decoSize != CDI_UNDEFID ); 
+    
+    deco  = vlistptr->vars[varID].deco;
+    decoSize = vlistptr->vars[varID].decoSize;
+    if ( decoSize && deco )
+      for ( i = 0; i < decoSize; i++ )
+        if ( deco[i].rank == rankModel ) 
+          {
+            iret = deco[i].chunk;
+            break;
+          }
+  }
+#else
+  iret = vlistInqVarSize ( vlistID, varID );
+#endif
+
+  xassert ( iret != CDI_UNDEFID );
+  return iret;
+}
+
+
+int vlistInqVarDecoOff ( int vlistID, int varID, int rankModel  )
+{
+  vlist_t *vlistptr;
+  int iret = CDI_UNDEFID;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+#ifdef USE_MPI
+  {
+    deco_t * deco;
+    int i, decoSize = 0;
+    
+    xassert ( vlistptr->vars[varID].deco != NULL &&
+             vlistptr->vars[varID].decoSize != CDI_UNDEFID );
+    
+    deco  = vlistptr->vars[varID].deco;
+    decoSize = vlistptr->vars[varID].decoSize;
+    if ( decoSize && deco )
+      for ( i = 0; i < decoSize; i++ )
+        if ( deco[i].rank == rankModel ) 
+          {
+            iret = deco[i].offset;
+            break;
+          }
+  }
+#else
+  iret = 0;
+#endif
+
+  xassert (  iret != CDI_UNDEFID );  
+  return iret;
+}
+
+
+void     vlistDefVarIOrank   ( int vlistID, int varID, int iorank )
+{
+  vlist_t * vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID );
+
+  vlistCheckVarID ( __func__, vlistID, varID );
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr->vars[varID].iorank = iorank;
+}
+
+
+int vlistInqVarIOrank(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return vlistptr->vars[varID].iorank;
+}
+
+
+#ifdef USE_MPI
+
+enum {
+  vlistvar_nints = 21,
+  vlistvar_ndbls = 3,
+};
+
+int vlistVarGetSize(vlist_t *p, int varID, MPI_Comm comm)
+{
+  var_t *var = p->vars + varID;
+  int varsize, txinc;
+
+  xmpi(MPI_Pack_size(vlistvar_nints, MPI_INT, comm, &varsize));
+  xmpi(MPI_Pack_size(vlistvar_ndbls, MPI_DOUBLE, comm, &txinc));
+  varsize += txinc;
+  if (var->name)
+  {
+    xmpi(MPI_Pack_size(strlen(var->name), MPI_CHAR, comm, &txinc));
+    varsize += txinc;
+  }
+  if (var->longname)
+  {
+    xmpi(MPI_Pack_size(strlen(var->longname), MPI_CHAR, comm, &txinc));
+    varsize += txinc;
+  }
+  if (var->stdname)
+  {
+    xmpi(MPI_Pack_size(strlen(var->stdname), MPI_CHAR, comm, &txinc));
+    varsize += txinc;
+  }
+  if (var->units)
+  {
+    xmpi(MPI_Pack_size(strlen(var->units), MPI_CHAR, comm, &txinc));
+    varsize += txinc;
+  }
+  xmpi(MPI_Pack_size(4 * var->nlevs, MPI_INT, comm, &txinc));
+  varsize += txinc;
+  if ( var->deco != NULL )
+    {
+      xmpi(MPI_Pack_size(3 * var->decoSize, MPI_INT, comm, &txinc));
+      varsize += txinc;
+    }
+  varsize += vlistAttsGetSize(p, varID, comm);
+  return varsize;
+}
+
+void vlistVarPack(vlist_t *p, int varID, char * buf, int size, int *position,
+                  MPI_Comm comm)
+{
+  double dtempbuf[vlistvar_ndbls];
+  var_t *var = p->vars + varID;
+  int tempbuf[vlistvar_nints], namesz, longnamesz, stdnamesz, unitssz, i;
+
+  tempbuf[0] = var->flag;
+  tempbuf[1] = var->gridID;
+  tempbuf[2] = var->zaxisID;
+  tempbuf[3] = var->tsteptype;
+  tempbuf[4] = namesz = var->name?strlen(var->name):0;
+  tempbuf[5] = longnamesz = var->longname?strlen(var->longname):0;
+  tempbuf[6] = stdnamesz = var->stdname?strlen(var->stdname):0;
+  tempbuf[7] = unitssz = var->units?strlen(var->units):0;
+  tempbuf[8] = var->datatype;
+  tempbuf[9] = var->param;
+  tempbuf[10] = var->instID;
+  tempbuf[11] = var->modelID;
+  tempbuf[12] = var->tableID;
+  tempbuf[13] = var->timave;
+  tempbuf[14] = var->timaccu;
+  tempbuf[15] = var->missvalused;
+  tempbuf[16] = var->comptype;
+  tempbuf[17] = var->complevel;
+  tempbuf[18] = var->nlevs;
+  tempbuf[19] = var->iorank;
+  tempbuf[20] = var->decoSize;
+  dtempbuf[0] = var->missval;
+  dtempbuf[1] = var->scalefactor;
+  dtempbuf[2] = var->addoffset;
+  xmpi(MPI_Pack(tempbuf, vlistvar_nints, MPI_INT,
+                buf, size, position, comm));
+  xmpi(MPI_Pack(dtempbuf, vlistvar_ndbls, MPI_DOUBLE,
+                buf, size, position, comm));
+  if (namesz)
+    xmpi(MPI_Pack(var->name, namesz, MPI_CHAR, buf, size, position, comm));
+  if (longnamesz)
+    xmpi(MPI_Pack(var->longname, longnamesz, MPI_CHAR,
+                  buf, size, position, comm));
+  if (stdnamesz)
+    xmpi(MPI_Pack(var->stdname, stdnamesz, MPI_CHAR,
+                  buf, size, position, comm));
+  if (unitssz)
+    xmpi(MPI_Pack(var->units, unitssz, MPI_CHAR,
+                  buf, size, position, comm));
+  {
+    int levbuf[var->nlevs][4];
+    for (i = 0; i < var->nlevs; ++i)
+    {
+      levbuf[i][0] = var->levinfo[i].flag;
+      levbuf[i][1] = var->levinfo[i].index;
+      levbuf[i][2] = var->levinfo[i].mlevelID;
+      levbuf[i][3] = var->levinfo[i].flevelID;
+    }
+    xmpi(MPI_Pack(levbuf, var->nlevs * 4, MPI_INT,
+                  buf, size, position, comm));
+  }
+  if ( var->deco != NULL )
+    {
+      int deco[var->decoSize][3];
+      for (i = 0; i < var->decoSize; ++i)
+        {
+          deco[i][0] = var->deco[i].rank;
+          deco[i][1] = var->deco[i].offset;
+          deco[i][2] = var->deco[i].chunk;
+        }
+      xmpi(MPI_Pack(deco, var->decoSize * 3, MPI_INT,
+                    buf, size, position, comm));
+    }
+  vlistAttsPack(p, varID, buf, size, position, comm);
+}
+
+static inline int
+imax(int a, int b)
+{
+  return a>=b?a:b;
+}
+
+
+void vlistVarUnpack(int vlistID, char * buf, int size, int *position,
+		    int nspTarget, MPI_Comm comm)
+{
+  double dtempbuf[vlistvar_ndbls];
+  int tempbuf[vlistvar_nints];
+  int newvar;
+  char *varname = NULL;
+  xmpi(MPI_Unpack(buf, size, position,
+                  tempbuf, vlistvar_nints, MPI_INT, comm));
+  xmpi(MPI_Unpack(buf, size, position,
+                  dtempbuf, vlistvar_ndbls, MPI_DOUBLE, comm));
+
+  newvar = vlistDefVar ( vlistID,
+			 namespaceAdaptKey ( tempbuf[1], nspTarget ),
+			 namespaceAdaptKey ( tempbuf[2], nspTarget ),
+			 tempbuf[3]);
+  if (tempbuf[4] || tempbuf[5] || tempbuf[6] || tempbuf[7])
+    varname = xmalloc(imax(imax(imax(tempbuf[4],tempbuf[5]),tempbuf[6]),
+                           tempbuf[7])+ 1);
+  if (tempbuf[4])
+  {
+    xmpi(MPI_Unpack(buf, size, position,
+                    varname, tempbuf[4], MPI_CHAR, comm));
+    varname[tempbuf[4]] = '\0';
+    vlistDefVarName(vlistID, newvar, varname);
+  }
+  if (tempbuf[5])
+  {
+    xmpi(MPI_Unpack(buf, size, position,
+                    varname, tempbuf[5], MPI_CHAR, comm));
+    varname[tempbuf[5]] = '\0';
+    vlistDefVarLongname(vlistID, newvar, varname);
+  }
+  if (tempbuf[6])
+  {
+    xmpi(MPI_Unpack(buf, size, position,
+                    varname, tempbuf[6], MPI_CHAR, comm));
+    varname[tempbuf[6]] = '\0';
+    vlistDefVarStdname(vlistID, newvar, varname);
+  }
+  if (tempbuf[7])
+  {
+    xmpi(MPI_Unpack(buf, size, position,
+                    varname, tempbuf[7], MPI_CHAR, comm));
+    varname[tempbuf[7]] = '\0';
+    vlistDefVarUnits(vlistID, newvar, varname);
+  }
+  if ( varname ) free ( varname );
+  vlistDefVarDatatype(vlistID, newvar, tempbuf[8]);
+  vlistDefVarInstitut ( vlistID, newvar,
+			namespaceAdaptKey ( tempbuf[10], nspTarget ));
+  vlistDefVarModel ( vlistID, newvar,
+		     namespaceAdaptKey ( tempbuf[11], nspTarget ));
+  vlistDefVarTable(vlistID, newvar, tempbuf[12]);
+  /* FIXME: changing the table might change the param code */
+  vlistDefVarParam(vlistID, newvar, tempbuf[9]);
+  vlistDefVarTimave(vlistID, newvar, tempbuf[13]);
+  vlistDefVarTimaccu(vlistID, newvar, tempbuf[14]);
+  if (tempbuf[15])
+    vlistDefVarMissval(vlistID, newvar, dtempbuf[0]);
+  vlistDefVarScalefactor(vlistID, newvar, dtempbuf[1]);
+  vlistDefVarAddoffset(vlistID, newvar, dtempbuf[2]);
+  vlistDefVarCompType(vlistID, newvar, tempbuf[16]);
+  vlistDefVarCompLevel(vlistID, newvar, tempbuf[17]);
+  {
+    int levbuf[tempbuf[18]][4];
+    var_t *var = vlist_to_pointer(vlistID)->vars + newvar;
+    int nlevs=tempbuf[18], i, flagSetLev = 0;
+    xassert(nlevs == var->nlevs);
+    xmpi(MPI_Unpack(buf, size, position,
+                    levbuf, nlevs * 4, MPI_INT, comm));
+    for (i = 0; i < nlevs; ++i)
+    {
+      vlistDefFlag(vlistID, newvar, i, levbuf[i][0]);
+      vlistDefIndex(vlistID, newvar, i, levbuf[i][1]);
+      // FIXME: these lack an accessor function
+      var->levinfo[i].mlevelID = levbuf[i][2];
+      var->levinfo[i].flevelID = levbuf[i][3];
+      if (levbuf[i][0] == tempbuf[0])
+        flagSetLev = i;
+    }
+    vlistDefFlag(vlistID, newvar, flagSetLev, levbuf[flagSetLev][0]);
+  }
+  if ( tempbuf[20] != 0 )
+    {
+      int decoSize = tempbuf[20], i;
+      deco_t deco[decoSize];
+      int decobuf[decoSize][3];
+
+      xmpi ( MPI_Unpack(buf, size, position,
+                        decobuf, decoSize * 3, MPI_INT, comm ));
+      for (i = 0; i < decoSize; ++i)
+        {
+          deco[i].rank   = decobuf[i][0];
+          deco[i].offset = decobuf[i][1];
+          deco[i].chunk  = decobuf[i][2];
+        }
+      vlistDefVarDeco(vlistID, newvar, decoSize, &deco[0]);
+    }
+  vlistDefVarIOrank(vlistID, newvar, tempbuf[19]);
+  vlistAttsUnpack(vlistID, newvar, buf, size, position, comm);
+}
+
+
+#endif
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+void basetimeInit(BaseTime *basetime)
+{
+  if ( basetime == NULL )
+    Error("Internal problem! Basetime not allocated.");
+
+  (*basetime).ncvarid       = UNDEFID;
+  (*basetime).ncdimid       = UNDEFID;
+  (*basetime).ncvarboundsid = UNDEFID;
+  (*basetime).lwrf          = 0;
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+
+
+
+
+#define SINGLE_PRECISION  4
+#define DOUBLE_PRECISION  8
+
+#define SRV_HEADER_LEN    8
+
+
+static int initSrvLib      = 0;
+static int srvDefaultHprec = 0;
+static int srvDefaultDprec = 0;
+
+
+/*
+ * A version string.
+ */
+
+#undef  LIBVERSION
+#define LIBVERSION      1.3.1
+#define XSTRING(x)	#x
+#define STRING(x)	XSTRING(x)
+static const char srv_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
+
+const char *srvLibraryVersion(void)
+{
+  return (srv_libvers);
+}
+
+
+int SRV_Debug = 0;    /* If set to 1, debugging */
+
+
+void srvDebug(int debug)
+{
+  SRV_Debug = debug;
+
+  if ( SRV_Debug )
+    Message("debug level %d", debug);
+}
+
+
+void srvLibInit()
+{
+  char *envString;
+  char *envName = "SRV_PRECISION";
+
+
+  envString = getenv(envName);
+  if ( envString )
+    {
+      int pos;
+      int nrun;
+      if ( strlen(envString) == 2 ) nrun = 1;
+      else                          nrun = 2;
+
+      pos = 0;
+      while ( nrun-- )
+	{
+	  switch ( tolower((int) envString[pos]) )
+	    {
+	    case 'i':
+	      {
+		switch ( (int) envString[pos+1] )
+		  {
+		  case '4': srvDefaultHprec = SINGLE_PRECISION; break;
+		  case '8': srvDefaultHprec = DOUBLE_PRECISION; break;
+		  default:
+		    Message("Invalid digit in %s: %s", envName, envString);
+		  }
+		break;
+	      }
+	    case 'r':
+	      {
+		switch ( (int) envString[pos+1] )
+		  {
+		  case '4': srvDefaultDprec = SINGLE_PRECISION; break;
+		  case '8': srvDefaultDprec = DOUBLE_PRECISION; break;
+		  default:
+		    Message("Invalid digit in %s: %s", envName, envString);
+		  }
+		break;		
+	      }
+	    default:
+	      Message("Invalid character in %s: %s", envName, envString);
+	    }
+	  pos += 2;
+	}
+    }
+
+  initSrvLib = 1;
+}
+
+
+void srvInit(srvrec_t *srvp)
+{
+  srvp->checked    = 0;
+  srvp->byteswap   = 0;
+  srvp->hprec      = 0;
+  srvp->dprec      = 0;
+  srvp->datasize   = 0;
+  srvp->buffersize = 0;
+  srvp->buffer     = NULL;
+}
+
+
+srvrec_t *srvNew(void)
+{
+  srvrec_t *srvp;
+
+  if ( ! initSrvLib ) srvLibInit();
+
+  srvp = (srvrec_t *) malloc(sizeof(srvrec_t));
+
+  srvInit(srvp);
+
+  return (srvp);
+}
+
+
+void srvDelete(srvrec_t *srvp)
+{
+  if ( srvp )
+    {
+      if ( srvp->buffer ) free(srvp->buffer);
+      free(srvp);
+    }
+}
+
+
+int srvCheckFiletype(int fileID, int *swap)
+{
+  size_t blocklen = 0;
+  size_t sblocklen = 0;
+  size_t data = 0;
+  size_t dimx = 0, dimy = 0;
+  int fact = 0, found = 0;
+  unsigned char buffer[72], *pbuf;
+
+  if ( fileRead(fileID, buffer, 4) != 4 ) return (found);
+
+  blocklen  = (size_t) get_UINT32(buffer);
+  sblocklen = (size_t) get_SUINT32(buffer);
+
+  if ( SRV_Debug )
+    Message("blocklen = %d sblocklen = %d", blocklen, sblocklen);
+
+  if ( blocklen == 32 )
+    {
+     *swap = 0;
+      fact = blocklen>>3;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+4*fact;      dimx = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+5*fact;      dimy = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+blocklen+4;  data = (size_t) get_UINT32(pbuf);
+    }
+  else if ( blocklen == 64 )
+    {
+     *swap = 0;
+      fact = blocklen>>3;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+4*fact;      dimx = (size_t) get_UINT64(pbuf);
+      pbuf = buffer+5*fact;      dimy = (size_t) get_UINT64(pbuf);
+      pbuf = buffer+blocklen+4;  data = (size_t) get_UINT32(pbuf);
+    }
+  else if ( sblocklen == 32 )
+    {
+     *swap = 1;
+      fact = sblocklen>>3;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+4*fact;       dimx = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+5*fact;       dimy = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+sblocklen+4;  data = (size_t) get_SUINT32(pbuf);
+    }
+  else if ( sblocklen == 64 )
+    {
+     *swap = 1;
+      fact = sblocklen>>3;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+4*fact;       dimx = (size_t) get_SUINT64(pbuf);
+      pbuf = buffer+5*fact;       dimy = (size_t) get_SUINT64(pbuf);
+      pbuf = buffer+sblocklen+4;  data = (size_t) get_SUINT32(pbuf);
+    }
+
+  fileRewind(fileID);
+
+  if      ( data && dimx*dimy*fact == data ) found = 1;
+  else if ( data && dimx*dimy*8    == data ) found = 1;
+
+  if ( SRV_Debug )
+    {
+      Message("swap = %d fact = %d", *swap, fact);
+      Message("dimx = %lu dimy = %lu data = %lu", dimx, dimy, data);
+    }
+
+  return (found);
+}
+
+
+int srvInqHeader(srvrec_t *srvp, int *header)
+{
+  size_t i;
+
+  for ( i = 0; i < SRV_HEADER_LEN; i++ )
+    header[i] = srvp->header[i];
+  
+  if ( SRV_Debug )
+    Message("datasize = %lu", srvp->datasize);
+
+  return (0);
+}
+
+
+int srvDefHeader(srvrec_t *srvp, const int *header)
+{
+  size_t i;
+
+  for ( i = 0; i < SRV_HEADER_LEN; i++ )
+    srvp->header[i] = header[i];
+  
+  srvp->datasize = header[4]*header[5];
+
+  if ( SRV_Debug )
+    Message("datasize = %lu", srvp->datasize);
+
+  return (0);
+}
+
+
+int srvInqData(srvrec_t *srvp, int prec, void *data)
+{
+  size_t datasize;
+  size_t i;
+  int ierr = 0;
+  int dprec;
+  void *buffer;
+  int byteswap = srvp->byteswap;
+
+  datasize = srvp->datasize;
+
+  buffer = srvp->buffer;
+
+  dprec = srvp->dprec;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( sizeof(FLT32) == 4 )
+	  {
+	    if ( byteswap ) swap4byte(buffer, datasize);
+
+	    if ( dprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT32));
+	    else
+	      for (i = 0; i < datasize; i++)
+		((double *) data)[i] = (double) ((float *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT32));
+	  }	
+	break;
+      }
+    case DOUBLE_PRECISION:
+	if ( sizeof(FLT64) == 8 )
+	  {
+	    if ( byteswap ) swap8byte(buffer, datasize);
+
+	    if ( dprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT64));
+	    else
+	      for (i = 0; i < datasize; i++)
+		((float *) data)[i] = (float) ((double *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT64));
+	  }	
+	break;
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  return (ierr);
+}
+
+
+int srvInqDataSP(srvrec_t *srvp, float *data)
+{
+  return (srvInqData(srvp, SINGLE_PRECISION, (void *) data));
+}
+
+
+int srvInqDataDP(srvrec_t *srvp, double *data)
+{
+  return (srvInqData(srvp, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int srvDefData(srvrec_t *srvp, int prec, const void *data)
+{
+  size_t datasize;
+  size_t blocklen;
+  size_t buffersize;
+  size_t i;
+  int dprec, hprec;
+  int *header;
+  void *buffer;
+
+  if ( srvDefaultDprec ) dprec = srvDefaultDprec;
+  else                   dprec = srvp->dprec;
+
+  if ( ! dprec ) dprec = prec;
+
+  srvp->dprec = dprec;
+
+  if ( srvDefaultHprec ) hprec = srvDefaultHprec;
+  else                   hprec = srvp->hprec;
+
+  if ( ! hprec ) hprec = dprec;
+  
+  srvp->hprec = hprec;
+
+  header = srvp->header;
+
+  datasize = header[4]*header[5];
+  blocklen = datasize * dprec;
+
+  srvp->datasize = datasize;
+
+  buffersize = srvp->buffersize;
+
+  if ( buffersize != blocklen )
+    {
+      buffersize = blocklen;
+      buffer = srvp->buffer;
+      buffer = realloc(buffer, buffersize);
+      srvp->buffer = buffer;
+      srvp->buffersize = buffersize;
+    }
+  else
+    buffer = srvp->buffer;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( dprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT32));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((float *) buffer)[i] = (float) ((double *) data)[i];
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	if ( dprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT64));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((double *) buffer)[i] = (double) ((float *) data)[i];
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  return (0);
+}
+
+
+int srvDefDataSP(srvrec_t *srvp, const float *data)
+{
+  return (srvDefData(srvp, SINGLE_PRECISION, (void *) data));
+}
+
+
+int srvDefDataDP(srvrec_t *srvp, const double *data)
+{
+  return (srvDefData(srvp, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int srvRead(int fileID, srvrec_t *srvp)
+{
+  size_t datasize;
+  size_t blocklen, blocklen2;
+  size_t i;
+  char tempheader[64];
+  int hprec, dprec;
+  void *buffer;
+  int buffersize;
+  int byteswap;
+  int status;
+
+  if ( ! srvp->checked )
+    {
+      status = srvCheckFiletype(fileID, &srvp->byteswap);
+      if ( status == 0 ) Error("Not a SERVICE file!");
+      srvp->checked = 1;
+    }
+
+  byteswap = srvp->byteswap;
+
+  /* read header record */
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  if ( fileEOF(fileID) ) return (-1);
+
+  if ( SRV_Debug )
+    Message("blocklen = %lu", blocklen);
+
+  hprec = blocklen / SRV_HEADER_LEN;
+
+  srvp->hprec = hprec;
+
+  switch ( hprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	binReadInt32(fileID, byteswap, SRV_HEADER_LEN, (INT32 *) tempheader);
+
+	for ( i = 0; i < SRV_HEADER_LEN; i++ )
+          srvp->header[i] = (int) ((INT32 *) tempheader)[i];
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	binReadInt64(fileID, byteswap, SRV_HEADER_LEN, (INT64 *) tempheader);
+
+	for ( i = 0; i < SRV_HEADER_LEN; i++ )
+          srvp->header[i] = (int) ((INT64 *) tempheader)[i];
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected header precision %d", hprec);
+      }
+    }
+
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("header blocklen differ!");
+      return (-1);
+    }
+
+  srvp->datasize = srvp->header[4]*srvp->header[5];
+
+  if ( SRV_Debug )
+    Message("datasize = %lu", srvp->datasize);
+
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  buffersize = srvp->buffersize;
+
+  if ( buffersize < (int) blocklen )
+    {
+      buffersize = blocklen;
+      buffer = srvp->buffer;
+      buffer = realloc(buffer, buffersize);
+      srvp->buffer = buffer;
+      srvp->buffersize = buffersize;
+    }
+  else
+    buffer = srvp->buffer;
+
+  datasize = srvp->datasize;
+
+  dprec = blocklen / datasize;
+
+  srvp->dprec = dprec;
+
+  if ( dprec != SINGLE_PRECISION && dprec != DOUBLE_PRECISION )
+    {
+      Warning("unexpected data precision %d", dprec);
+      return (-1);
+    }
+
+  fileRead(fileID, buffer, blocklen);
+
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("data blocklen differ!");
+      return (-1);
+    }
+
+  return (0);
+}
+
+
+int srvWrite(int fileID, srvrec_t *srvp)
+{
+  size_t datasize;
+  size_t blocklen;
+  size_t i;
+  int dprec, hprec;
+  char tempheader[64];
+  int *header;
+  void *buffer;
+  int byteswap = srvp->byteswap;
+
+  dprec  = srvp->dprec;
+  hprec  = srvp->hprec;
+  header = srvp->header;
+
+  /* write header record */
+  blocklen = SRV_HEADER_LEN * hprec;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  switch ( hprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	for (i = 0; i < SRV_HEADER_LEN; i++)
+          ((INT32 *) tempheader)[i] = (INT32) header[i];
+
+	binWriteInt32(fileID, byteswap, SRV_HEADER_LEN, (INT32 *) tempheader);
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	for (i = 0; i < SRV_HEADER_LEN; i++)
+          ((INT64 *) tempheader)[i] = (INT64) header[i];
+
+	binWriteInt64(fileID, byteswap, SRV_HEADER_LEN, (INT64 *) tempheader);
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected header precision %d", hprec);
+      }
+    }
+  
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  datasize = header[4]*header[5];
+  blocklen = datasize * dprec;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  srvp->datasize = datasize;
+
+  buffer = srvp->buffer;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	binWriteFlt32(fileID, byteswap, datasize, (FLT32 *) buffer);
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	binWriteFlt64(fileID, byteswap, datasize, (FLT64 *) buffer);
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  return (0);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+
+
+
+
+#define  SINGLE_PRECISION    4
+#define  DOUBLE_PRECISION    8
+
+#define  EXT_HEADER_LEN      4
+
+
+static int initExtLib       = 0;
+static int extDefaultPrec   = 0;
+static int extDefaultNumber = EXT_REAL;
+
+
+/*
+ * A version string.
+ */
+
+#undef  LIBVERSION
+#define LIBVERSION      1.3.1
+#define XSTRING(x)	#x
+#define STRING(x)	XSTRING(x)
+static const char ext_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
+
+const char *extLibraryVersion(void)
+{
+  return (ext_libvers);
+}
+
+
+int EXT_Debug = 0;    /* If set to 1, debugging */
+
+
+void extDebug(int debug)
+{
+  EXT_Debug = debug;
+
+  if ( EXT_Debug )
+    Message("debug level %d", debug);
+}
+
+
+void extLibInit()
+{
+  char *envString;
+  char *envName = "EXT_PRECISION";
+
+
+  envString = getenv(envName);
+  if ( envString )
+    {
+      int pos = 0;
+
+      if ( strlen(envString) == 2  )
+	{
+	  switch ( tolower((int) envString[pos]) )
+	    {
+	    case 'r':
+	      {
+		extDefaultNumber = EXT_REAL;
+		switch ( (int) envString[pos+1] )
+		  {
+		  case '4': extDefaultPrec = SINGLE_PRECISION; break;
+		  case '8': extDefaultPrec = DOUBLE_PRECISION; break;
+		  default:
+		    Message("Invalid digit in %s: %s", envName, envString);
+		  }
+		break;		
+	      }
+	    case 'c':
+	      {
+		extDefaultNumber = EXT_COMP;
+		switch ( (int) envString[pos+1] )
+		  {
+		  case '4': extDefaultPrec = SINGLE_PRECISION; break;
+		  case '8': extDefaultPrec = DOUBLE_PRECISION; break;
+		  default:
+		    Message("Invalid digit in %s: %s", envName, envString);
+		  }
+		break;		
+	      }
+	    default:
+	      Message("Invalid character in %s: %s", envName, envString);
+	    }
+	}
+    }
+
+  initExtLib = 1;
+}
+
+static
+void extInit(extrec_t *extp)
+{
+  extp->checked    = 0;
+  extp->byteswap   = 0;
+  extp->prec       = 0;
+  extp->number     = extDefaultNumber;
+  extp->datasize   = 0;
+  extp->buffersize = 0;
+  extp->buffer     = NULL;
+}
+
+
+void *extNew(void)
+{
+  extrec_t *extp;
+
+  if ( ! initExtLib ) extLibInit();
+
+  extp = (extrec_t *) malloc(sizeof(extrec_t));
+
+  extInit(extp);
+
+  return ((void*)extp);
+}
+
+
+void extDelete(void *ext)
+{
+  extrec_t *extp = (extrec_t *) ext;
+
+  if ( extp )
+    {
+      if ( extp->buffer ) free(extp->buffer);
+      free(extp);
+    }
+}
+
+
+int extCheckFiletype(int fileID, int *swap)
+{
+  size_t blocklen = 0;
+  size_t sblocklen = 0;
+  size_t data =  0;
+  size_t dimxy = 0;
+  int fact = 0, found = 0;
+  unsigned char buffer[40], *pbuf;
+
+  if ( fileRead(fileID, buffer, 4) != 4 ) return (found);
+
+  blocklen  = (size_t) get_UINT32(buffer);
+  sblocklen = (size_t) get_SUINT32(buffer);
+
+  if ( EXT_Debug )
+    Message("blocklen = %d sblocklen = %d", blocklen, sblocklen);
+
+  if ( blocklen == 16 )
+    {
+     *swap = 0;
+      fact = blocklen/4;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+3*fact;      dimxy = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+blocklen+4;  data  = (size_t) get_UINT32(pbuf);
+    }
+  else if ( blocklen == 32 )
+    {
+     *swap = 0;
+      fact = blocklen/4;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+3*fact;      dimxy = (size_t) get_UINT64(pbuf);
+      pbuf = buffer+blocklen+4;  data  = (size_t) get_UINT32(pbuf);
+    }
+  else if ( sblocklen == 16 )
+    {
+     *swap = 1;
+      fact = sblocklen/4;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+3*fact;       dimxy = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+sblocklen+4;  data  = (size_t) get_SUINT32(pbuf);
+    }
+  else if ( sblocklen == 32 )
+    {
+     *swap = 1;
+      fact = sblocklen/4;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+3*fact;       dimxy = (size_t) get_SUINT64(pbuf);
+      pbuf = buffer+sblocklen+4;  data  = (size_t) get_SUINT32(pbuf);
+    }
+
+  fileRewind(fileID);
+
+  if      ( data && dimxy*fact   == data ) found = 1;
+  else if ( data && dimxy*fact*2 == data ) found = 1;
+
+  if ( EXT_Debug )
+    {
+      Message("swap = %d fact = %d", *swap, fact);
+      Message("dimxy = %lu data = %lu", dimxy, data);
+    }
+
+  return (found);
+}
+
+
+int extInqHeader(void *ext, int *header)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t i;
+
+  for ( i = 0; i < EXT_HEADER_LEN; i++ )
+    header[i] = extp->header[i];
+  
+  if ( EXT_Debug ) Message("datasize = %lu", extp->datasize);
+
+  return (0);
+}
+
+
+int extDefHeader(void *ext, const int *header)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t i;
+
+  for ( i = 0; i < EXT_HEADER_LEN; i++ )
+    extp->header[i] = header[i];
+  
+  extp->datasize = header[3];
+  if ( extp->number == EXT_COMP ) extp->datasize *= 2;
+
+  if ( EXT_Debug ) Message("datasize = %lu", extp->datasize);
+
+  return (0);
+}
+
+
+int extInqData(void *ext, int prec, void *data)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t datasize;
+  size_t i;
+  int ierr = 0;
+  int rprec;
+  void *buffer;
+  int byteswap = extp->byteswap;
+
+  datasize = extp->datasize;
+  buffer   = extp->buffer;
+  rprec    = extp->prec;
+
+  switch ( rprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( sizeof(FLT32) == 4 )
+	  {
+	    if ( byteswap ) swap4byte(buffer, datasize);
+
+	    if ( rprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT32));
+	    else
+	      for ( i = 0; i < datasize; ++i )
+		((double *) data)[i] = (double) ((float *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT32));
+	  }	
+	break;
+      }
+    case DOUBLE_PRECISION:
+	if ( sizeof(FLT64) == 8 )
+	  {
+	    if ( byteswap ) swap8byte(buffer, datasize);
+
+	    if ( rprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT64));
+	    else
+	      for ( i = 0; i < datasize; ++i )
+		((float *) data)[i] = (float) ((double *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT64));
+	  }	
+	break;
+    default:
+      {
+	Error("unexpected data precision %d", rprec);
+      }
+    }
+
+  return (ierr);
+}
+
+
+int extInqDataSP(void *ext, float *data)
+{
+  return (extInqData(ext, SINGLE_PRECISION, (void *) data));
+}
+
+
+int extInqDataDP(void *ext, double *data)
+{
+  return (extInqData(ext, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int extDefData(void *ext, int prec, const void *data)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t datasize;
+  size_t blocklen;
+  size_t buffersize;
+  size_t i;
+  int rprec;
+  int *header;
+  void *buffer;
+
+  if ( extDefaultPrec ) rprec = extDefaultPrec;
+  else                  rprec = extp->prec;
+
+  if ( ! rprec ) rprec = prec;
+
+  extp->prec = rprec;
+
+  header = extp->header;
+
+  datasize = header[3];
+  if ( extp->number == EXT_COMP ) datasize *= 2;
+  blocklen = datasize * rprec;
+
+  extp->datasize = datasize;
+
+  buffersize = extp->buffersize;
+
+  if ( buffersize != blocklen )
+    {
+      buffersize = blocklen;
+      buffer = extp->buffer;
+      buffer = realloc(buffer, buffersize);
+      extp->buffer = buffer;
+      extp->buffersize = buffersize;
+    }
+  else
+    buffer = extp->buffer;
+
+  switch ( rprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( rprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT32));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((float *) buffer)[i] = (float) ((double *) data)[i];
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	if ( rprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT64));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((double *) buffer)[i] = (double) ((float *) data)[i];
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", rprec);
+      }
+    }
+
+  return (0);
+}
+
+
+int extDefDataSP(void *ext, const float *data)
+{
+  return (extDefData(ext, SINGLE_PRECISION, (void *) data));
+}
+
+
+int extDefDataDP(void *ext, const double *data)
+{
+  return (extDefData(ext, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int extRead(int fileID, void *ext)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t blocklen, blocklen2;
+  size_t i;
+  char tempheader[32];
+  int hprec, dprec;
+  void *buffer;
+  int buffersize;
+  int byteswap;
+  int status;
+
+  if ( ! extp->checked )
+    {
+      status = extCheckFiletype(fileID, &extp->byteswap);
+      if ( status == 0 ) Error("Not a EXTRA file!");
+      extp->checked = 1;
+    }
+
+  byteswap = extp->byteswap;
+
+  /* read header record */
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  if ( fileEOF(fileID) ) return (-1);
+
+  if ( EXT_Debug )
+    Message("blocklen = %lu", blocklen);
+
+  hprec = blocklen / EXT_HEADER_LEN;
+
+  extp->prec = hprec;
+
+  switch ( hprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	binReadInt32(fileID, byteswap, EXT_HEADER_LEN, (INT32 *) tempheader);
+
+	for ( i = 0; i < EXT_HEADER_LEN; i++ )
+          extp->header[i] = (int) ((INT32 *) tempheader)[i];
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	binReadInt64(fileID, byteswap, EXT_HEADER_LEN, (INT64 *) tempheader);
+
+	for ( i = 0; i < EXT_HEADER_LEN; i++ )
+          extp->header[i] = (int) ((INT64 *) tempheader)[i];
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected header precision %d", hprec);
+      }
+    }
+
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("header blocklen differ!");
+      return (-1);
+    }
+
+  extp->datasize = extp->header[3];
+
+  if ( EXT_Debug ) Message("datasize = %lu", extp->datasize);
+
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  buffersize = extp->buffersize;
+
+  if ( buffersize < (int) blocklen )
+    {
+      buffersize = blocklen;
+      buffer = extp->buffer;
+      buffer = realloc(buffer, buffersize);
+      extp->buffer = buffer;
+      extp->buffersize = buffersize;
+    }
+  else
+    buffer = extp->buffer;
+
+  dprec = blocklen / extp->datasize;
+
+  if ( dprec == hprec )
+    {
+      extp->number = EXT_REAL;
+    }
+  else if ( dprec == 2*hprec )
+    {
+      dprec /= 2;
+      extp->datasize *= 2;
+      extp->number = EXT_COMP;
+    }
+
+  if ( dprec != SINGLE_PRECISION && dprec != DOUBLE_PRECISION )
+    {
+      Warning("unexpected data precision %d", dprec);
+      return (-1);
+    }
+
+  fileRead(fileID, buffer, blocklen);
+
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("data blocklen differ!");
+      return (-1);
+    }
+
+  return (0);
+}
+
+
+int extWrite(int fileID, void *ext)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t datasize;
+  size_t blocklen;
+  size_t i;
+  int rprec, number;
+  char tempheader[32];
+  int *header;
+  void *buffer;
+  int byteswap = extp->byteswap;
+
+
+  rprec  = extp->prec;
+  number = extp->number;
+  header = extp->header;
+
+  /* write header record */
+  blocklen = EXT_HEADER_LEN * rprec;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  switch ( rprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	for (i = 0; i < EXT_HEADER_LEN; i++)
+          ((INT32 *) tempheader)[i] = (INT32) header[i];
+
+	binWriteInt32(fileID, byteswap, EXT_HEADER_LEN, (INT32 *) tempheader);
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	for (i = 0; i < EXT_HEADER_LEN; i++)
+          ((INT64 *) tempheader)[i] = (INT64) header[i];
+
+	binWriteInt64(fileID, byteswap, EXT_HEADER_LEN, (INT64 *) tempheader);
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected header precision %d", rprec);
+      }
+    }
+  
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  datasize = header[3];
+  if ( number == EXT_COMP ) datasize *= 2;
+  blocklen = datasize * rprec;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  extp->datasize = datasize;
+
+  buffer = extp->buffer;
+
+  switch ( rprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	binWriteFlt32(fileID, byteswap, datasize, (FLT32 *) buffer);
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	binWriteFlt64(fileID, byteswap, datasize, (FLT64 *) buffer);
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", rprec);
+      }
+    }
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  return (0);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+
+
+
+
+#define SINGLE_PRECISION  4
+#define DOUBLE_PRECISION  8
+
+
+static int initIegLib      = 0;
+static int iegDefaultDprec = 0;
+
+
+/*
+ * A version string.
+ */
+
+#undef  LIBVERSION
+#define LIBVERSION      1.3.1
+#define XSTRING(x)	#x
+#define STRING(x)	XSTRING(x)
+static const char ieg_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
+
+const char *iegLibraryVersion(void)
+{
+  return (ieg_libvers);
+}
+
+
+int IEG_Debug = 0;    /* If set to 1, debugging */
+
+
+
+void iegLibInit()
+{
+  char *envString;
+  char *envName = "IEG_PRECISION";
+
+
+  envString = getenv(envName);
+  if ( envString )
+    {
+      int pos;
+      int nrun;
+      if ( strlen(envString) == 2 ) nrun = 1;
+      else                          nrun = 2;
+
+      pos = 0;
+      while ( nrun-- )
+	{
+	  switch ( tolower((int) envString[pos]) )
+	    {
+	    case 'r':
+	      {
+		switch ( (int) envString[pos+1] )
+		  {
+		  case '4': iegDefaultDprec = SINGLE_PRECISION; break;
+		  case '8': iegDefaultDprec = DOUBLE_PRECISION; break;
+		  default:
+		    Message("Invalid digit in %s: %s", envName, envString);
+		  }
+		break;		
+	      }
+	    default:
+	      Message("Invalid character in %s: %s", envName, envString);
+	    }
+	  pos += 2;
+	}
+    }
+
+  initIegLib = 1;
+}
+
+
+void iegDebug(int debug)
+{
+  IEG_Debug = debug;
+
+  if ( IEG_Debug )
+    Message("debug level %d", debug);
+}
+
+
+void iegInit(iegrec_t *iegp)
+{
+  iegp->checked    = 0;
+  iegp->byteswap   = 0;
+  iegp->dprec      = 0;
+  iegp->refval     = 0;
+  iegp->datasize   = 0;
+  iegp->buffersize = 0;
+  iegp->buffer     = NULL;
+}
+
+
+void iegInitMem(iegrec_t *iegp)
+{
+  memset(iegp->ipdb, 0, sizeof(iegp->ipdb));
+  memset(iegp->igdb, 0, sizeof(iegp->igdb));
+  memset(iegp->vct,  0, sizeof(iegp->vct));
+}
+
+
+iegrec_t *iegNew(void)
+{
+  iegrec_t *iegp;
+
+  if ( ! initIegLib ) iegLibInit();
+
+  iegp = (iegrec_t *) malloc(sizeof(iegrec_t));
+
+  iegInit(iegp);
+  iegInitMem(iegp);
+
+  return (iegp);
+}
+
+
+void iegDelete(iegrec_t *iegp)
+{
+  if ( iegp )
+    {
+      if ( iegp->buffer ) free(iegp->buffer);
+      free(iegp);
+    }
+}
+
+
+int iegCheckFiletype(int fileID, int *swap)
+{
+  size_t blocklen = 0;
+  size_t sblocklen = 0;
+  size_t data = 0;
+  size_t dimx = 0, dimy = 0;
+  int fact = 0, found = 0;
+  unsigned char buffer[1048], *pbuf;
+
+  if ( fileRead(fileID, buffer, 4) != 4 ) return (found);
+
+  blocklen  = get_UINT32(buffer);
+  sblocklen = get_SUINT32(buffer);
+
+  if ( IEG_Debug )
+    Message("blocklen = %d sblocklen = %d", blocklen, sblocklen);
+
+  if ( blocklen == 636 || blocklen == 640 )
+    {
+     *swap = 0;
+      fact = 4;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+(37+4)*4;    dimx = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+(37+5)*4;    dimy = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+blocklen+4;  data = (size_t) get_UINT32(pbuf);
+    }
+  else if ( blocklen == 1040 || blocklen == 1036 )
+    {
+     *swap = 0;
+      fact = 8;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+(37+4)*4;    dimx = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+(37+5)*4;    dimy = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+blocklen+4;  data = (size_t) get_UINT32(pbuf);
+    }
+  else if ( sblocklen == 636 || sblocklen == 640 )
+    {
+     *swap = 1;
+      fact = 4;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+(37+4)*4;     dimx = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+(37+5)*4;     dimy = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+sblocklen+4;  data = (size_t) get_SUINT32(pbuf);
+    }
+  else if ( sblocklen == 1040 || sblocklen == 1036 )
+    {
+     *swap = 1;
+      fact = 8;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+(37+4)*4;     dimx = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+(37+5)*4;     dimy = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+sblocklen+4;  data = (size_t) get_SUINT32(pbuf);
+    }
+
+  fileRewind(fileID);
+
+  if      ( data && dimx*dimy*fact == data ) found = 1;
+  else if ( data && dimx*dimy*8    == data ) found = 1;
+
+  if ( IEG_Debug )
+    {
+      Message("swap = %d fact = %d", *swap, fact);
+      Message("dimx = %lu dimy = %lu data = %lu", dimx, dimy, data);
+    }
+
+  return (found);
+}
+
+
+void iegCopyMeta(iegrec_t *diegp, iegrec_t *siegp)
+{
+  /*  diegp->byteswap = siegp->byteswap; */
+  diegp->dprec    = siegp->dprec;
+  diegp->refval   = siegp->refval;
+
+  memcpy(diegp->ipdb, siegp->ipdb, sizeof(siegp->ipdb));
+  memcpy(diegp->igdb, siegp->igdb, sizeof(siegp->igdb));
+  memcpy(diegp->vct,  siegp->vct,  sizeof(siegp->vct));
+}
+
+
+int iegInqData(iegrec_t *iegp, int prec, void *data)
+{
+  size_t datasize;
+  size_t i;
+  int ierr = 0;
+  int dprec;
+  void *buffer;
+  int byteswap = iegp->byteswap;
+
+
+  datasize = iegp->datasize;
+
+  buffer = iegp->buffer;
+
+  dprec = iegp->dprec;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( sizeof(FLT32) == 4 )
+	  {
+	    if ( byteswap ) swap4byte(buffer, datasize);
+
+	    if ( dprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT32));
+	    else
+	      for (i = 0; i < datasize; i++)
+		((double *) data)[i] = (double) ((float *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT32));
+	  }	
+	break;
+      }
+    case DOUBLE_PRECISION:
+	if ( sizeof(FLT64) == 8 )
+	  {
+	    if ( byteswap ) swap8byte(buffer, datasize);
+
+	    if ( dprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT64));
+	    else
+	      for (i = 0; i < datasize; i++)
+		((float *) data)[i] = (float) ((double *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT64));
+	  }	
+	break;
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  return (ierr);
+}
+
+
+int iegInqDataSP(iegrec_t *iegp, float *data)
+{
+  return (iegInqData(iegp, SINGLE_PRECISION, (void *) data));
+}
+
+
+int iegInqDataDP(iegrec_t *iegp, double *data)
+{
+  return (iegInqData(iegp, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int iegDefData(iegrec_t *iegp, int prec, const void *data)
+{
+  size_t datasize;
+  size_t blocklen;
+  size_t buffersize;
+  size_t i;
+  int dprec;
+  void *buffer;
+
+
+  if ( iegDefaultDprec ) dprec = iegDefaultDprec;
+  else                   dprec = iegp->dprec;
+
+  if ( ! dprec ) dprec = prec;
+
+  iegp->dprec = dprec;
+
+  datasize = IEG_G_NumLon(iegp->igdb)*IEG_G_NumLat(iegp->igdb);
+  blocklen = datasize * dprec;
+
+  iegp->datasize = datasize;
+
+  buffersize = iegp->buffersize;
+
+  if ( buffersize != blocklen )
+    {
+      buffersize = blocklen;
+      buffer = iegp->buffer;
+      buffer = realloc(buffer, buffersize);
+      iegp->buffer = buffer;
+      iegp->buffersize = buffersize;
+    }
+  else
+    buffer = iegp->buffer;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( dprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT32));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((float *) buffer)[i] = (float) ((double *) data)[i];
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	if ( dprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT64));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((double *) buffer)[i] = (double) ((float *) data)[i];
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  return (0);
+}
+
+
+int iegDefDataSP(iegrec_t *iegp, const float *data)
+{
+  return (iegDefData(iegp, SINGLE_PRECISION, (void *) data));
+}
+
+
+int iegDefDataDP(iegrec_t *iegp, const double *data)
+{
+  return (iegDefData(iegp, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int iegRead(int fileID, iegrec_t *iegp)
+{
+  size_t datasize;
+  size_t blocklen, blocklen2;
+  size_t i;
+  char tmpbuffer[800], *tmpbuf = tmpbuffer;
+  int dprec = 0;
+  void *buffer;
+  int buffersize;
+  int byteswap;
+  int status;
+
+  if ( ! iegp->checked )
+    {
+      status = iegCheckFiletype(fileID, &iegp->byteswap);
+      if ( status == 0 ) Error("Not a IEG file!");
+      iegp->checked = 1;
+    }
+
+  byteswap = iegp->byteswap;
+
+  /* read header record */
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  if ( fileEOF(fileID) ) return (-1);
+
+  if ( IEG_Debug )
+    Message("blocklen = %lu", blocklen);
+
+  if ( blocklen == 636 || blocklen == 640 )
+    dprec = 4;
+  else if ( blocklen == 1040 || blocklen == 1036 )
+    dprec = 8;
+  else
+    {
+      Warning("unexpecteted header size %d!", (int) blocklen);
+      return (-1);
+    }
+
+  iegp->dprec = dprec;
+
+  binReadInt32(fileID, byteswap, 37, (INT32 *) tmpbuf);
+  for ( i = 0; i < 37; i++ ) iegp->ipdb[i] = (int) ((INT32 *) tmpbuf)[i];
+
+  binReadInt32(fileID, byteswap, 18, (INT32 *) tmpbuf);
+  for ( i = 0; i < 18; i++ ) iegp->igdb[i] = (int) ((INT32 *) tmpbuf)[i];
+
+  if ( blocklen == 636 || blocklen == 1036 )
+    {
+      fileRead(fileID, tmpbuf, 4);
+      if ( byteswap ) swap4byte(tmpbuf, 1);
+      iegp->refval = (double) ((float *) tmpbuf)[0];
+    }
+  else
+    {
+      fileRead(fileID, tmpbuf, 8);
+      if ( byteswap ) swap8byte(tmpbuf, 1);
+      iegp->refval = (double) ((double *) tmpbuf)[0];
+    }
+
+  binReadInt32(fileID, byteswap, 3, (INT32 *) tmpbuf);
+  for ( i = 0; i < 3; i++ ) iegp->igdb[18+i] = (int) ((INT32 *) tmpbuf)[i];
+
+  if ( dprec == SINGLE_PRECISION )
+    {
+      fileRead(fileID, tmpbuf, 400);
+      if ( byteswap ) swap4byte(tmpbuf, 100);
+      for ( i = 0; i < 100; i++ )
+	iegp->vct[i] = (double) ((float *) tmpbuf)[i];
+    }
+  else
+    {
+      fileRead(fileID, tmpbuf, 800);
+      if ( byteswap ) swap8byte(tmpbuf, 100);
+      for ( i = 0; i < 100; i++ )
+	iegp->vct[i] = (double) ((double *) tmpbuf)[i];
+    }
+  
+  /*
+  fprintf(stderr, "refval %g\n", iegp->refval);
+
+  for ( i = 0; i < 100; i++ )
+    fprintf(stderr, "%3d %g\n", i, iegp->vct[i]);
+  
+  {
+    int i;
+    for ( i = 0; i < 37; i++ )
+      fprintf(stderr, "pdb: %d %d\n", i, iegp->ipdb[i]);
+    for ( i = 0; i < 22; i++ )
+      fprintf(stderr, "gdb: %d %d\n", i, iegp->igdb[i]);
+  }
+  */
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("header blocklen differ!");
+      return (-1);
+    }
+
+  iegp->datasize = IEG_G_NumLon(iegp->igdb)*IEG_G_NumLat(iegp->igdb);
+
+  if ( IEG_Debug )
+    Message("datasize = %lu", iegp->datasize);
+
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  buffersize = iegp->buffersize;
+
+  if ( buffersize < (int) blocklen )
+    {
+      buffersize = blocklen;
+      buffer = iegp->buffer;
+      buffer = realloc(buffer, buffersize);
+      iegp->buffer = buffer;
+      iegp->buffersize = buffersize;
+    }
+  else
+    buffer = iegp->buffer;
+
+  datasize = iegp->datasize;
+
+  if ( dprec != (int) (blocklen/datasize) )
+    {
+      Warning("data precision differ! (h = %d; d = %d)",
+	      (int) dprec, (int) (blocklen/datasize));
+      return (-1);
+    }
+
+  fileRead(fileID, buffer, blocklen);
+
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("data blocklen differ!");
+      return (-1);
+    }
+
+  return (0);
+}
+
+
+int iegWrite(int fileID, iegrec_t *iegp)
+{
+  size_t datasize;
+  size_t blocklen;
+  size_t i;
+  int dprec;
+  float refvalf;
+  double refval;
+  char tmpbuf[800];
+  float fvct[100];
+  void *buffer;
+  int byteswap = iegp->byteswap;
+
+
+  dprec  = iegp->dprec;
+
+  /* write header record */
+  if ( dprec == SINGLE_PRECISION )
+    blocklen = 636;
+  else
+    blocklen = 1040;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  for ( i = 0; i < 37; i++ ) ((INT32 *) tmpbuf)[i] = (INT32) iegp->ipdb[i];
+  binWriteInt32(fileID, byteswap, 37, (INT32 *) tmpbuf);
+
+  for ( i = 0; i < 18; i++ ) ((INT32 *) tmpbuf)[i] = (INT32) iegp->igdb[i];
+  binWriteInt32(fileID, byteswap, 18, (INT32 *) tmpbuf);
+
+  refval = iegp->refval;
+  refvalf = (float) refval;
+  if ( dprec == SINGLE_PRECISION )
+    binWriteFlt32(fileID, byteswap, 1, (FLT32 *) &refvalf);
+  else
+    binWriteFlt64(fileID, byteswap, 1, (FLT64 *) &refval);
+
+  for ( i = 0; i < 3; i++ ) ((INT32 *) tmpbuf)[i] = (INT32) iegp->igdb[18+i];
+  binWriteInt32(fileID, byteswap, 3, (INT32 *) tmpbuf);
+
+  if ( dprec == SINGLE_PRECISION )
+    {
+      for ( i = 0; i < 100; i++ ) fvct[i] = (float) iegp->vct[i];
+      binWriteFlt32(fileID, byteswap, 100, fvct);
+    }
+  else
+    {
+      binWriteFlt64(fileID, byteswap, 100, iegp->vct);
+    }
+  
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  datasize = iegp->igdb[4]*iegp->igdb[5];
+  blocklen = datasize * dprec;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  iegp->datasize = datasize;
+
+  buffer = iegp->buffer;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	binWriteFlt32(fileID, byteswap, datasize, (FLT32 *) buffer);
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	binWriteFlt64(fileID, byteswap, datasize, (FLT64 *) buffer);
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  return (0);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <string.h>
+#include <float.h>  /* FLT_EPSILON */
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+
+#ifndef  RAD2DEG
+#define  RAD2DEG  (180./M_PI)   /* conversion for rad to deg */
+#endif
+
+#ifndef  DEG2RAD
+#define  DEG2RAD  (M_PI/180.)   /* conversion for deg to rad */
+#endif
+
+
+char *Grids[] = {
+  /*  0 */  "undefined",
+  /*  1 */  "generic",
+  /*  2 */  "gaussian",
+  /*  3 */  "gaussian reduced",
+  /*  4 */  "lonlat",
+  /*  5 */  "spectral",
+  /*  6 */  "fourier",
+  /*  7 */  "gme",
+  /*  8 */  "trajectory",
+  /*  9 */  "unstructured",
+  /* 10 */  "curvilinear",
+  /* 11 */  "lcc",
+  /* 12 */  "lcc2",
+  /* 13 */  "laea",
+  /* 14 */  "sinusoidal",
+  /* 15 */  "reference",
+  /* 16 */  "projection",
+};
+
+
+static int    gridCompareP    ( void * gridptr1, void * gridptr2 );
+static void   gridDestroyP    ( void * gridptr );
+static void   gridPrintP      ( void * gridptr, FILE * fp );
+#ifdef USE_MPI
+static int    gridGetPackSize ( void * gridptr, MPI_Comm comm );
+static void   gridPack        ( void * gridptr, void * buff, int size,
+				int *position, MPI_Comm comm );
+static int    gridTxCode      ( void );
+#endif
+
+resOps gridOps = { gridCompareP, gridDestroyP, gridPrintP
+#ifdef USE_MPI
+                   , gridGetPackSize, gridPack, gridTxCode
+#endif
+};
+
+
+static int  GRID_Debug = 0;   /* If set to 1, debugging */
+
+
+void grid_init(grid_t *gridptr)
+{
+  gridptr->self         = CDI_UNDEFID;
+  gridptr->type         = CDI_UNDEFID;
+  gridptr->proj         = CDI_UNDEFID;
+  gridptr->mask         = NULL;
+  gridptr->mask_gme     = NULL;
+  gridptr->xvals        = NULL;
+  gridptr->yvals        = NULL;
+  gridptr->area         = NULL;
+  gridptr->xbounds      = NULL;
+  gridptr->ybounds      = NULL;
+  gridptr->rowlon       = NULL;
+  gridptr->nrowlon      = 0;
+  gridptr->xinc         = 0.0;
+  gridptr->yinc         = 0.0;
+  gridptr->lcc_originLon = 0.0;
+  gridptr->lcc_originLat = 0.0;
+  gridptr->lcc_lonParY  = 0.0;
+  gridptr->lcc_lat1     = 0.0;
+  gridptr->lcc_lat2     = 0.0;
+  gridptr->lcc_xinc     = 0.0;
+  gridptr->lcc_yinc     = 0.0;
+  gridptr->lcc_projflag = 0;
+  gridptr->lcc_scanflag = 0;
+  gridptr->lcc_defined  = FALSE;
+  gridptr->lcc2_lon_0   = 0.0;
+  gridptr->lcc2_lat_0   = 0.0;
+  gridptr->lcc2_lat_1   = 0.0;
+  gridptr->lcc2_lat_2   = 0.0;
+  gridptr->lcc2_a       = 0.0;
+  gridptr->lcc2_defined = FALSE;
+  gridptr->laea_lon_0   = 0.0;
+  gridptr->laea_lat_0   = 0.0;
+  gridptr->laea_a       = 0.0;
+  gridptr->laea_defined = FALSE;
+  gridptr->trunc        = 0;
+  gridptr->nvertex      = 0;
+  gridptr->nd           = 0;
+  gridptr->ni           = 0;
+  gridptr->ni2          = 0;
+  gridptr->ni3          = 0;
+  gridptr->number       = 0;
+  gridptr->position     = 0;
+  gridptr->reference    = NULL;
+  gridptr->prec         = 0;
+  gridptr->size         = 0;
+  gridptr->xsize        = 0;
+  gridptr->ysize        = 0;
+  gridptr->np           = 0;
+  gridptr->xdef         = 0;
+  gridptr->ydef         = 0;
+  gridptr->isCyclic     = CDI_UNDEFID;
+  gridptr->isRotated    = FALSE;
+  gridptr->xpole        = 0.0;
+  gridptr->ypole        = 0.0;
+  gridptr->angle        = 0.0;
+  gridptr->locked       = FALSE;
+  gridptr->lcomplex     = 0;
+  gridptr->xname[0]     = 0;
+  gridptr->yname[0]     = 0;
+  gridptr->xlongname[0] = 0;
+  gridptr->ylongname[0] = 0;
+  gridptr->xunits[0]    = 0;
+  gridptr->yunits[0]    = 0;
+  gridptr->xstdname[0]  = 0;
+  gridptr->ystdname[0]  = 0;
+  gridptr->uuid[0]      = 0;
+  gridptr->name         = NULL;
+}
+
+
+void grid_free(grid_t *gridptr)
+{
+  if ( gridptr->mask      ) free(gridptr->mask);
+  if ( gridptr->mask_gme  ) free(gridptr->mask_gme);
+  if ( gridptr->xvals     ) free(gridptr->xvals);
+  if ( gridptr->yvals     ) free(gridptr->yvals);
+  if ( gridptr->area      ) free(gridptr->area);
+  if ( gridptr->xbounds   ) free(gridptr->xbounds);
+  if ( gridptr->ybounds   ) free(gridptr->ybounds);
+  if ( gridptr->rowlon    ) free(gridptr->rowlon);
+  if ( gridptr->reference ) free(gridptr->reference);
+  if ( gridptr->name      ) free(gridptr->name);
+
+  grid_init(gridptr);
+}
+
+static
+grid_t *gridNewEntry ( void )
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) xmalloc ( sizeof ( grid_t ));
+  grid_init ( gridptr );
+  gridptr->self = reshPut (( void * ) gridptr, &gridOps );
+
+  return gridptr;
+}
+
+static
+void gridInit (void)
+{
+  static int gridInitialized = 0;
+  char *env;
+
+  if ( gridInitialized ) return;
+
+  gridInitialized = 1;
+
+  env = getenv("GRID_DEBUG");
+  if ( env ) GRID_Debug = atoi(env);
+}
+
+static
+void grid_copy(grid_t *gridptr2, grid_t *gridptr1)
+{
+  int gridID2;
+
+  gridID2 = gridptr2->self;
+  memcpy(gridptr2, gridptr1, sizeof(grid_t));
+  gridptr2->self = gridID2;
+}
+
+static
+void gridCheckPtr(const char *caller, int gridID, grid_t *gridptr)
+{
+  if ( gridptr == NULL )
+    Errorc("grid %d undefined!", gridID);
+}
+
+#define  grid_check_ptr(gridID, gridptr)  gridCheckPtr(__func__, gridID, gridptr)
+
+
+int gridSize(void)
+{
+  return reshCountType ( &gridOps );
+}
+
+
+void gridGenXvals(int xsize, double xfirst, double xlast, double xinc, double *xvals)
+{
+  if ( (! (fabs(xinc) > 0)) && xsize > 1 )
+    {
+      if ( xfirst >= xlast )
+        {
+          while ( xfirst >= xlast ) xlast += 360;
+          xinc = (xlast-xfirst)/(xsize);
+        }
+      else
+        {
+          xinc = (xlast-xfirst)/(xsize-1);
+        }
+    }
+
+  for ( int i = 0; i < xsize; ++i )
+    xvals[i] = xfirst + i*xinc;
+}
+
+static
+void calc_gaussgrid(double *yvals, int ysize, double yfirst, double ylast)
+{
+  double *yw;
+  long yhsize;
+  long i;
+
+  yw = (double *) malloc(ysize*sizeof(double));
+  gaussaw(yvals, yw, ysize);
+  free(yw);
+  for ( i = 0; i < ysize; i++ )
+    yvals[i] = asin(yvals[i])/M_PI*180.0;
+
+  if ( yfirst < ylast && yfirst > -90.0 && ylast < 90.0 )
+    {
+      double ytmp;
+      yhsize = ysize/2;
+      for ( i = 0; i < yhsize; i++ )
+        {
+          ytmp = yvals[i];
+          yvals[i] = yvals[ysize-i-1];
+          yvals[ysize-i-1] = ytmp;
+        }
+    }
+}
+
+
+void gridGenYvals(int gridtype, int ysize, double yfirst, double ylast, double yinc, double *yvals)
+{
+  long i;
+  double deleps = 0.002;
+
+  if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
+    {
+      if ( ysize > 2 )
+	{
+	  calc_gaussgrid(yvals, ysize, yfirst, ylast);
+
+	  if ( ! (IS_EQUAL(yfirst, 0) && IS_EQUAL(ylast, 0)) )
+	    if ( fabs(yvals[0] - yfirst) > deleps || fabs(yvals[ysize-1] - ylast) > deleps )
+	      {
+		double yinc = fabs(ylast-yfirst)/(ysize-1);
+		double *ytmp = NULL;
+		int nstart, lfound = 0;
+		int ny = (int) (180./yinc + 0.5);
+		ny -= ny%2;
+		/* printf("%g %g %g %g %g %d\n", ylast, yfirst, ylast-yfirst,yinc, 180/yinc, ny); */
+		if ( ny > ysize && ny < 4096 )
+		  {
+		    ytmp = (double *) malloc(ny*sizeof(double));
+		    calc_gaussgrid(ytmp, ny, yfirst, ylast);
+		    for ( i = 0; i < (ny-ysize); i++ )
+		      if ( fabs(ytmp[i] - yfirst) < deleps ) break;
+
+		    nstart = i;
+
+		    if ( (nstart+ysize-1) < ny )
+		      if ( fabs(ytmp[nstart+ysize-1] - ylast) < deleps ) lfound = 1;
+		  }
+
+		if ( lfound )
+		  {
+		    for ( i = 0; i < ysize; i++ ) yvals[i] = ytmp[i+nstart];
+		  }
+		else
+		  {
+		    Warning("Cannot calculate gaussian latitudes for lat1 = %g latn = %g!", yfirst, ylast);
+		    for ( i = 0; i < ysize; i++ ) yvals[i] = 0;
+		    yvals[0] = yfirst;
+		    yvals[ysize-1] = ylast;
+		  }
+
+		if ( ytmp ) free(ytmp);
+	      }
+	}
+      else
+        {
+          yvals[0] = yfirst;
+          yvals[ysize-1] = ylast;
+        }
+    }
+  /*     else if ( gridtype == GRID_LONLAT || gridtype == GRID_GENERIC ) */
+  else
+    {
+      if ( (! (fabs(yinc) > 0)) && ysize > 1 )
+        {
+          if ( IS_EQUAL(yfirst, ylast) && IS_NOT_EQUAL(yfirst, 0) ) ylast *= -1;
+
+          if ( yfirst > ylast )
+            yinc = (yfirst-ylast)/(ysize-1);
+          else if ( yfirst < ylast )
+            yinc = (ylast-yfirst)/(ysize-1);
+          else
+            {
+              if ( ysize%2 != 0 )
+                {
+                  yinc = 180.0/(ysize-1);
+                  yfirst = -90;
+                }
+              else
+                {
+                  yinc = 180.0/ysize;
+                  yfirst = -90 + yinc/2;
+                }
+            }
+        }
+
+      if ( yfirst > ylast && yinc > 0 ) yinc = -yinc;
+
+      for ( i = 0; i < ysize; i++ )
+        yvals[i] = yfirst + i*yinc;
+    }
+  /*
+    else
+    Error("unable to calculate values for %s grid!", gridNamePtr(gridtype));
+  */
+}
+
+/*
+ at Function  gridCreate
+ at Title     Create a horizontal Grid
+
+ at Prototype int gridCreate(int gridtype, int size)
+ at Parameter
+    @Item  gridtype  The type of the grid, one of the set of predefined CDI grid types.
+                     The valid CDI grid types are @func{GRID_GENERIC}, @func{GRID_GAUSSIAN},
+                     @func{GRID_LONLAT}, @func{GRID_LCC}, @func{GRID_SPECTRAL},
+                     @func{GRID_GME}, @func{GRID_CURVILINEAR}, @func{GRID_UNSTRUCTURED} and
+                     @func{GRID_REFERENCE}.
+    @Item  size      Number of gridpoints.
+
+ at Description
+The function @func{gridCreate} creates a horizontal Grid.
+
+ at Result
+ at func{gridCreate} returns an identifier to the Grid.
+
+ at Example
+Here is an example using @func{gridCreate} to create a regular lon/lat Grid:
+
+ at Source
+   ...
+#define  nlon  12
+#define  nlat   6
+   ...
+double lons[nlon] = {0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330};
+double lats[nlat] = {-75, -45, -15, 15, 45, 75};
+int gridID;
+   ...
+gridID = gridCreate(GRID_LONLAT, nlon*nlat);
+gridDefXsize(gridID, nlon);
+gridDefYsize(gridID, nlat);
+gridDefXvals(gridID, lons);
+gridDefYvals(gridID, lats);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int gridCreate(int gridtype, int size)
+{
+  int gridID;
+  grid_t *gridptr;
+
+  if ( CDI_Debug )
+    Message("gridtype: %d size: %d", gridtype, size);
+
+  gridInit ();
+
+  gridptr = gridNewEntry();
+  if ( ! gridptr ) Error("No memory");
+
+  gridID = gridptr->self;
+
+  if ( CDI_Debug ) Message("gridID: %d", gridID);
+
+  gridptr->type = gridtype;
+  gridptr->size = size;
+
+  /*  if ( gridtype == GRID_GENERIC )     gridptr->xsize = size; */
+  if ( gridtype == GRID_UNSTRUCTURED )  gridptr->xsize = size;
+  if ( gridtype == GRID_CURVILINEAR  )  gridptr->nvertex = 4;
+
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_GAUSSIAN_REDUCED:
+    case GRID_CURVILINEAR:
+    case GRID_TRAJECTORY:
+      {
+        if ( gridtype == GRID_TRAJECTORY )
+          {
+            gridDefXname(gridID, "tlon");
+            gridDefYname(gridID, "tlat");
+          }
+        else
+          {
+            gridDefXname(gridID, "lon");
+            gridDefYname(gridID, "lat");
+          }
+        gridDefXlongname(gridID, "longitude");
+        gridDefYlongname(gridID, "latitude");
+
+        /*
+        if ( gridtype == GRID_CURVILINEAR )
+          {
+            strcpy(gridptr->xstdname, "grid_longitude");
+            strcpy(gridptr->ystdname, "grid_latitude");
+            gridDefXunits(gridID, "degrees");
+            gridDefYunits(gridID, "degrees");
+          }
+        else
+        */
+          {
+            strcpy(gridptr->xstdname, "longitude");
+            strcpy(gridptr->ystdname, "latitude");
+            gridDefXunits(gridID, "degrees_east");
+            gridDefYunits(gridID, "degrees_north");
+          }
+
+        break;
+      }
+    case GRID_GME:
+    case GRID_UNSTRUCTURED:
+      {
+        gridDefXname(gridID, "lon");
+        gridDefYname(gridID, "lat");
+        strcpy(gridptr->xstdname, "longitude");
+        strcpy(gridptr->ystdname, "latitude");
+        gridDefXunits(gridID, "degrees_east");
+        gridDefYunits(gridID, "degrees_north");
+        break;
+      }
+    case GRID_GENERIC:
+      {
+        gridDefXname(gridID, "x");
+        gridDefYname(gridID, "y");
+        strcpy(gridptr->xstdname, "grid_longitude");
+        strcpy(gridptr->ystdname, "grid_latitude");
+        gridDefXunits(gridID, "degrees");
+        gridDefYunits(gridID, "degrees");
+        break;
+      }
+    case GRID_LCC2:
+    case GRID_SINUSOIDAL:
+    case GRID_LAEA:
+      {
+        gridDefXname(gridID, "x");
+        gridDefYname(gridID, "y");
+        strcpy(gridptr->xstdname, "projection_x_coordinate");
+        strcpy(gridptr->ystdname, "projection_y_coordinate");
+        gridDefXunits(gridID, "m");
+        gridDefYunits(gridID, "m");
+        break;
+      }
+    }
+
+  return (gridID);
+}
+
+static
+void gridDestroyKernel( grid_t * gridptr )
+{
+  int id;
+
+  xassert ( gridptr );
+
+  id = gridptr->self;
+
+  if ( gridptr->mask      ) free(gridptr->mask);
+  if ( gridptr->mask_gme  ) free(gridptr->mask_gme);
+  if ( gridptr->xvals     ) free(gridptr->xvals);
+  if ( gridptr->yvals     ) free(gridptr->yvals);
+  if ( gridptr->area      ) free(gridptr->area);
+  if ( gridptr->xbounds   ) free(gridptr->xbounds);
+  if ( gridptr->ybounds   ) free(gridptr->ybounds);
+  if ( gridptr->rowlon    ) free(gridptr->rowlon);
+  if ( gridptr->reference ) free(gridptr->reference);
+
+  free ( gridptr );
+
+  reshRemove ( id, &gridOps );
+}
+
+/*
+ at Function  gridDestroy
+ at Title     Destroy a horizontal Grid
+
+ at Prototype void gridDestroy(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at EndFunction
+*/
+void gridDestroy(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  gridDestroyKernel ( gridptr );
+}
+
+void gridDestroyP ( void * gridptr )
+{
+  gridDestroyKernel (( grid_t * ) gridptr );
+}
+
+
+char *gridNamePtr(int gridtype)
+{
+  char *name;
+  int size = (int) (sizeof(Grids)/sizeof(char *));
+
+  if ( gridtype >= 0 && gridtype < size )
+    name = Grids[gridtype];
+  else
+    name = Grids[GRID_GENERIC];
+
+  return (name);
+}
+
+
+void gridName(int gridtype, char *gridname)
+{
+  strcpy(gridname, gridNamePtr(gridtype));
+}
+
+/*
+ at Function  gridDefXname
+ at Title     Define the name of a X-axis
+
+ at Prototype void gridDefXname(int gridID, const char *name)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  name     Name of the X-axis.
+
+ at Description
+The function @func{gridDefXname} defines the name of a X-axis.
+
+ at EndFunction
+*/
+void gridDefXname(int gridID, const char *xname)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning ("%s", "Operation not executed." );
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( xname )
+    strcpy(gridptr->xname, xname);
+}
+
+/*
+ at Function  gridDefXlongname
+ at Title     Define the longname of a X-axis
+
+ at Prototype void gridDefXlongname(int gridID, const char *longname)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  longname Longname of the X-axis.
+
+ at Description
+The function @func{gridDefXlongname} defines the longname of a X-axis.
+
+ at EndFunction
+*/
+void gridDefXlongname(int gridID, const char *xlongname)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning ("%s", "Operation not executed." );
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  if ( xlongname )
+    strcpy(gridptr->xlongname, xlongname);
+}
+
+/*
+ at Function  gridDefXunits
+ at Title     Define the units of a X-axis
+
+ at Prototype void gridDefXunits(int gridID, const char *units)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  units    Units of the X-axis.
+
+ at Description
+The function @func{gridDefXunits} defines the units of a X-axis.
+
+ at EndFunction
+*/
+void gridDefXunits(int gridID, const char *xunits)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( xunits )
+    strcpy(gridptr->xunits, xunits);
+}
+
+/*
+ at Function  gridDefYname
+ at Title     Define the name of a Y-axis
+
+ at Prototype void gridDefYname(int gridID, const char *name)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  name     Name of the Y-axis.
+
+ at Description
+The function @func{gridDefYname} defines the name of a Y-axis.
+
+ at EndFunction
+*/
+void gridDefYname(int gridID, const char *yname)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( yname )
+    strcpy(gridptr->yname, yname);
+}
+
+/*
+ at Function  gridDefYlongname
+ at Title     Define the longname of a Y-axis
+
+ at Prototype void gridDefYlongname(int gridID, const char *longname)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  longname Longname of the Y-axis.
+
+ at Description
+The function @func{gridDefYlongname} defines the longname of a Y-axis.
+
+ at EndFunction
+*/
+void gridDefYlongname(int gridID, const char *ylongname)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( ylongname )
+    strcpy(gridptr->ylongname, ylongname);
+}
+
+/*
+ at Function  gridDefYunits
+ at Title     Define the units of a Y-axis
+
+ at Prototype void gridDefYunits(int gridID, const char *units)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  units    Units of the Y-axis.
+
+ at Description
+The function @func{gridDefYunits} defines the units of a Y-axis.
+
+ at EndFunction
+*/
+void gridDefYunits(int gridID, const char *yunits)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( yunits )
+    strcpy(gridptr->yunits, yunits);
+}
+
+/*
+ at Function  gridInqXname
+ at Title     Get the name of a X-axis
+
+ at Prototype void gridInqXname(int gridID, char *name)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  name     Name of the X-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqXname} returns the name of a X-axis.
+
+ at Result
+ at func{gridInqXname} returns the name of the X-axis to the parameter name.
+
+ at EndFunction
+*/
+void gridInqXname(int gridID, char *xname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(xname, gridptr->xname);
+}
+
+/*
+ at Function  gridInqXlongname
+ at Title     Get the longname of a X-axis
+
+ at Prototype void gridInqXlongname(int gridID, char *longname)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  longname Longname of the X-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqXlongname} returns the longname of a X-axis.
+
+ at Result
+ at func{gridInqXlongname} returns the longname of the X-axis to the parameter longname.
+
+ at EndFunction
+*/
+void gridInqXlongname(int gridID, char *xlongname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(xlongname, gridptr->xlongname);
+}
+
+/*
+ at Function  gridInqXunits
+ at Title     Get the units of a X-axis
+
+ at Prototype void gridInqXunits(int gridID, char *units)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  units    Units of the X-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqXunits} returns the units of a X-axis.
+
+ at Result
+ at func{gridInqXunits} returns the units of the X-axis to the parameter units.
+
+ at EndFunction
+*/
+void gridInqXunits(int gridID, char *xunits)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(xunits, gridptr->xunits);
+}
+
+
+void gridInqXstdname(int gridID, char *xstdname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(xstdname, gridptr->xstdname);
+}
+
+/*
+ at Function  gridInqYname
+ at Title     Get the name of a Y-axis
+
+ at Prototype void gridInqYname(int gridID, char *name)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  name     Name of the Y-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqYname} returns the name of a Y-axis.
+
+ at Result
+ at func{gridInqYname} returns the name of the Y-axis to the parameter name.
+
+ at EndFunction
+*/
+void gridInqYname(int gridID, char *yname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(yname, gridptr->yname);
+}
+
+/*
+ at Function  gridInqYlongname
+ at Title     Get the longname of a Y-axis
+
+ at Prototype void gridInqXlongname(int gridID, char *longname)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  longname Longname of the Y-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqYlongname} returns the longname of a Y-axis.
+
+ at Result
+ at func{gridInqYlongname} returns the longname of the Y-axis to the parameter longname.
+
+ at EndFunction
+*/
+void gridInqYlongname(int gridID, char *ylongname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(ylongname, gridptr->ylongname);
+}
+
+/*
+ at Function  gridInqYunits
+ at Title     Get the units of a Y-axis
+
+ at Prototype void gridInqYunits(int gridID, char *units)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  units    Units of the Y-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqYunits} returns the units of a Y-axis.
+
+ at Result
+ at func{gridInqYunits} returns the units of the Y-axis to the parameter units.
+
+ at EndFunction
+*/
+void gridInqYunits(int gridID, char *yunits)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(yunits, gridptr->yunits);
+}
+
+void gridInqYstdname(int gridID, char *ystdname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(ystdname, gridptr->ystdname);
+}
+
+/*
+ at Function  gridInqType
+ at Title     Get the type of a Grid
+
+ at Prototype int gridInqType(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at Description
+The function @func{gridInqType} returns the type of a Grid.
+
+ at Result
+ at func{gridInqType} returns the type of the grid,
+one of the set of predefined CDI grid types.
+The valid CDI grid types are @func{GRID_GENERIC}, @func{GRID_GAUSSIAN},
+ at func{GRID_LONLAT}, @func{GRID_LCC}, @func{GRID_SPECTRAL}, @func{GRID_GME},
+ at func{GRID_CURVILINEAR}, @func{GRID_UNSTRUCTURED} and @func{GRID_REFERENCE}.
+
+ at EndFunction
+*/
+int gridInqType(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->type);
+}
+
+
+/*
+ at Function  gridInqSize
+ at Title     Get the size of a Grid
+
+ at Prototype int gridInqSize(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at Description
+The function @func{gridInqSize} returns the size of a Grid.
+
+ at Result
+ at func{gridInqSize} returns the number of grid points of a Grid.
+
+ at EndFunction
+*/
+int gridInqSize(int gridID)
+{
+  int size = 0;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( ! size )
+    {
+      int xsize, ysize;
+
+      xsize = gridptr->xsize;
+      ysize = gridptr->ysize;
+
+      if ( ysize )
+        size = xsize *ysize;
+      else
+        size = xsize;
+
+      gridptr->size = size;
+    }
+
+  return (size);
+}
+
+static
+int nsp2trunc(int nsp)
+{
+  /*  nsp = (trunc+1)*(trunc+1)              */
+  /*      => trunc^2 + 3*trunc - (x-2) = 0   */
+  /*                                         */
+  /*  with:  y^2 + p*y + q = 0               */
+  /*         y = -p/2 +- sqrt((p/2)^2 - q)   */
+  /*         p = 3 and q = - (x-2)           */
+  int trunc;
+
+  trunc = (int) (sqrt(nsp*4 + 1.) - 3) / 2;
+
+  return (trunc);
+}
+
+
+int gridInqTrunc(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->trunc == 0 )
+    {
+      if ( gridptr->type == GRID_SPECTRAL )
+        gridptr->trunc = nsp2trunc(gridptr->size);
+      /*
+      else if      ( gridptr->type == GRID_GAUSSIAN )
+        gridptr->trunc = nlat2trunc(gridptr->ysize);
+      */
+    }
+
+  return (gridptr->trunc);
+}
+
+
+void gridDefTrunc(int gridID, int trunc)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->trunc = trunc;
+}
+
+/*
+ at Function  gridDefXsize
+ at Title     Define the number of values of a X-axis
+
+ at Prototype void gridDefXsize(int gridID, int xsize)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  xsize    Number of values of a X-axis.
+
+ at Description
+The function @func{gridDefXsize} defines the number of values of a X-axis.
+
+ at EndFunction
+*/
+void gridDefXsize(int gridID, int xsize)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( xsize > gridInqSize(gridID) )
+    Error("xsize %d is greater then gridsize %d", xsize, gridInqSize(gridID));
+
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED && xsize != gridInqSize(gridID) )
+    Error("xsize %d must be equal to gridsize %d for gridtype: UNSTRUCTURED", xsize, gridInqSize(gridID));
+
+  gridptr->xsize = xsize;
+
+  if ( gridInqType(gridID) != GRID_UNSTRUCTURED )
+    {
+      long gridsize = gridptr->xsize*gridptr->ysize;
+      if ( gridsize > 0 && gridsize != gridInqSize(gridID) )
+        Error("Inconsistent grid declaration! (xsize=%d ysize=%d gridsize=%d)",
+              gridptr->xsize, gridptr->ysize, gridInqSize(gridID));
+    }
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefPrec(int gridID, int prec)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->prec = prec;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+int gridInqPrec(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->prec);
+}
+
+/*
+ at Function  gridInqXsize
+ at Title     Get the number of values of a X-axis
+
+ at Prototype int gridInqXsize(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at Description
+The function @func{gridInqXsize} returns the number of values of a X-axis.
+
+ at Result
+ at func{gridInqXsize} returns the number of values of a X-axis.
+
+ at EndFunction
+*/
+int gridInqXsize(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->xsize);
+}
+
+/*
+ at Function  gridDefYsize
+ at Title     Define the number of values of a Y-axis
+
+ at Prototype void gridDefYsize(int gridID, int ysize)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  ysize    Number of values of a Y-axis.
+
+ at Description
+The function @func{gridDefYsize} defines the number of values of a Y-axis.
+
+ at EndFunction
+*/
+void gridDefYsize(int gridID, int ysize)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( ysize > gridInqSize(gridID) )
+    Error("ysize %d is greater then gridsize %d", ysize, gridInqSize(gridID));
+
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED && ysize != gridInqSize(gridID) )
+    Error("ysize %d must be equal gridsize %d for gridtype: UNSTRUCTURED", ysize, gridInqSize(gridID));
+
+  gridptr->ysize = ysize;
+
+  if ( gridInqType(gridID) != GRID_UNSTRUCTURED )
+    {
+      long gridsize = gridptr->xsize*gridptr->ysize;
+      if ( gridsize > 0 && gridsize != gridInqSize(gridID) )
+        Error("Inconsistent grid declaration! (xsize=%d ysize=%d gridsize=%d)",
+              gridptr->xsize, gridptr->ysize, gridInqSize(gridID));
+    }
+}
+
+/*
+ at Function  gridInqYsize
+ at Title     Get the number of values of a Y-axis
+
+ at Prototype int gridInqYsize(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at Description
+The function @func{gridInqYsize} returns the number of values of a Y-axis.
+
+ at Result
+ at func{gridInqYsize} returns the number of values of a Y-axis.
+
+ at EndFunction
+*/
+int gridInqYsize(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ysize);
+}
+
+/*
+ at Function  gridDefNP
+ at Title     Define the number of parallels between a pole and the equator
+
+ at Prototype void gridDefNP(int gridID, int np)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  np       Number of parallels between a pole and the equator.
+
+ at Description
+The function @func{gridDefNP} defines the number of parallels between a pole and the equator
+of a Gaussian grid.
+
+ at EndFunction
+*/
+void gridDefNP(int gridID, int np)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning ("%s", "Operation not executed." );
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->np = np;
+}
+
+/*
+ at Function  gridInqNP
+ at Title     Get the number of parallels between a pole and the equator
+
+ at Prototype int gridInqNP(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at Description
+The function @func{gridInqNP} returns the number of parallels between a pole and the equator
+of a Gaussian grid.
+
+ at Result
+ at func{gridInqNP} returns the number of parallels between a pole and the equator.
+
+ at EndFunction
+*/
+int gridInqNP(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->np);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefRowlon(int gridID, int nrowlon, const int *rowlon)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->rowlon = (int *) malloc(nrowlon*sizeof(int));
+  gridptr->nrowlon = nrowlon;
+
+  memcpy(gridptr->rowlon, rowlon, nrowlon*sizeof(int));
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridInqRowlon(int gridID, int *rowlon)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->rowlon == 0 )  Error("undefined pointer!");
+
+  memcpy(rowlon, gridptr->rowlon, gridptr->nrowlon*sizeof(int));
+}
+
+
+int gridInqMask(int gridID, int *mask)
+{
+  long size, i;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("Size undefined for gridID = %d", gridID);
+
+  if ( mask && gridptr->mask )
+    for ( i = 0; i < size; ++i )
+      mask[i] = gridptr->mask[i];
+
+  if ( gridptr->mask == NULL ) size = 0;
+
+  return (size);
+}
+
+
+void gridDefMask(int gridID, const int *mask)
+{
+  long size, i;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  size = gridptr->size;
+
+  if ( size == 0 )
+    Error("Size undefined for gridID = %d", gridID);
+
+  if ( mask == NULL )
+    {
+      if ( gridptr->mask )
+	{
+	  free(gridptr->mask);
+	  gridptr->mask = NULL;
+	}
+    }
+  else
+    {
+      if ( gridptr->mask == NULL )
+	gridptr->mask = (mask_t *) malloc(size*sizeof(mask_t));
+      else if ( CDI_Debug )
+	Warning("grid mask already defined!");
+
+      for ( i = 0; i < size; ++i )
+	gridptr->mask[i] = mask[i];
+    }
+}
+
+
+int gridInqMaskGME(int gridID, int *mask)
+{
+  long size, i;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("Size undefined for gridID = %d", gridID);
+
+  if ( mask && gridptr->mask_gme )
+    for ( i = 0; i < size; ++i )
+      mask[i] = gridptr->mask_gme[i];
+
+  if ( gridptr->mask_gme == NULL ) size = 0;
+
+  return (size);
+}
+
+
+void gridDefMaskGME(int gridID, const int *mask)
+{
+  long size, i;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( size == 0 )
+    Error("Size undefined for gridID = %d", gridID);
+
+  if ( gridptr->mask_gme == NULL )
+    gridptr->mask_gme = (mask_t *) malloc(size*sizeof(mask_t));
+  else if ( CDI_Debug )
+    Warning("mask already defined!");
+
+  for ( i = 0; i < size; ++i )
+    gridptr->mask_gme[i] = mask[i];
+}
+
+/*
+ at Function  gridInqXvals
+ at Title     Get all values of a X-axis
+
+ at Prototype int gridInqXvals(int gridID, double *xvals)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  xvals    Pointer to the location into which the X-values are read.
+                    The caller must allocate space for the returned values.
+
+ at Description
+The function @func{gridInqXvals} returns all values of the X-axis.
+
+ at Result
+Upon successful completion @func{gridInqXvals} returns the number of values and
+the values are stored in @func{xvals}.
+Otherwise, 0 is returned and @func{xvals} is empty.
+
+ at EndFunction
+*/
+int gridInqXvals(int gridID, double *xvals)
+{
+  long size;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = gridptr->size;
+  else
+    size = gridptr->xsize;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("Size undefined for gridID = %d", gridID);
+
+  if ( xvals && gridptr->xvals )
+    memcpy(xvals, gridptr->xvals, size*sizeof(double));
+
+  if ( gridptr->xvals == NULL ) size = 0;
+
+  return (size);
+}
+
+/*
+ at Function  gridDefXvals
+ at Title     Define the values of a X-axis
+
+ at Prototype void gridDefXvals(int gridID, const double *xvals)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  xvals    X-values of the grid.
+
+ at Description
+The function @func{gridDefXvals} defines all values of the X-axis.
+
+ at EndFunction
+*/
+void gridDefXvals(int gridID, const double *xvals)
+{
+  int gridtype;
+  long size;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridtype = gridptr->type;
+
+  if ( gridtype == GRID_UNSTRUCTURED || gridtype == GRID_CURVILINEAR )
+    size = gridptr->size;
+  else
+    size = gridptr->xsize;
+
+  if ( size == 0 )
+    Error("Size undefined for gridID = %d", gridID);
+
+  if ( gridptr->xvals == NULL )
+    gridptr->xvals = (double *) malloc(size*sizeof(double));
+  else if ( CDI_Debug )
+    Warning("values already defined!");
+
+  memcpy(gridptr->xvals, xvals, size*sizeof(double));
+}
+
+/*
+ at Function  gridInqYvals
+ at Title     Get all values of a Y-axis
+
+ at Prototype int gridInqYvals(int gridID, double *yvals)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  yvals    Pointer to the location into which the Y-values are read.
+                    The caller must allocate space for the returned values.
+
+ at Description
+The function @func{gridInqYvals} returns all values of the Y-axis.
+
+ at Result
+Upon successful completion @func{gridInqYvals} returns the number of values and
+the values are stored in @func{yvals}.
+Otherwise, 0 is returned and @func{yvals} is empty.
+
+ at EndFunction
+*/
+int gridInqYvals(int gridID, double *yvals)
+{
+  long size;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = gridptr->size;
+  else
+    size = gridptr->ysize;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("Size undefined for gridID = %d!", gridID);
+
+  if ( yvals && gridptr->yvals )
+    memcpy(yvals, gridptr->yvals, size*sizeof(double));
+
+  if ( gridptr->yvals == NULL ) size = 0;
+
+  return (size);
+}
+
+/*
+ at Function  gridDefYvals
+ at Title     Define the values of a Y-axis
+
+ at Prototype void gridDefYvals(int gridID, const double *yvals)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  yvals    Y-values of the grid.
+
+ at Description
+The function @func{gridDefYvals} defines all values of the Y-axis.
+
+ at EndFunction
+*/
+void gridDefYvals(int gridID, const double *yvals)
+{
+  int gridtype;
+  long size;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridtype = gridptr->type;
+
+  if ( gridtype == GRID_UNSTRUCTURED || gridtype == GRID_CURVILINEAR )
+    size = gridptr->size;
+  else
+    size = gridptr->ysize;
+
+  if ( size == 0 )
+    Error("Size undefined for gridID = %d!", gridID);
+
+  if ( gridptr->yvals == NULL )
+    gridptr->yvals = (double *) malloc(size*sizeof(double));
+  else if ( CDI_Debug )
+    Warning("Values already defined!");
+
+  memcpy(gridptr->yvals, yvals, size*sizeof(double));
+}
+
+
+double gridInqXval(int gridID, int index)
+{
+  double xval = 0;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->xvals )
+    xval = gridptr->xvals[index];
+
+  return (xval);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqYval(int gridID, int index)
+{
+  double yval = 0;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->yvals )
+    yval = gridptr->yvals[index];
+
+  return (yval);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqXinc(int gridID)
+{
+  double xinc;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  xinc = gridptr->xinc;
+
+  if ( (! (fabs(xinc) > 0)) && gridptr->xvals )
+    {
+      int xsize;
+      double *xvals;
+
+      xsize = gridptr->xsize;
+      xvals = gridptr->xvals;
+
+      if ( xsize > 1 )
+        {
+          long i;
+          xinc = fabs(xvals[xsize-1] - xvals[0])/(xsize-1);
+          for ( i = 2; i < xsize; i++ )
+            if ( fabs(fabs(xvals[i-1] - xvals[i]) - xinc) > 0.01*xinc ) break;
+
+          if ( i < xsize ) xinc = 0;
+        }
+    }
+
+  return (xinc);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqYinc(int gridID)
+{
+  double yinc;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  yinc = gridptr->yinc;
+
+  if ( (! (fabs(yinc) > 0)) && gridptr->yvals )
+    {
+      int ysize;
+      double *yvals;
+
+      ysize = gridptr->ysize;
+      yvals = gridptr->yvals;
+
+      if ( ysize > 1 )
+        {
+          long i;
+          yinc = fabs(yvals[1] - yvals[0]);
+          for ( i = 2; i < ysize; i++ )
+            if ( fabs(fabs(yvals[i] - yvals[i-1]) - yinc) > (yinc/1000) ) break;
+
+          if ( i < ysize ) yinc = 0;
+          else             yinc = yvals[1] - yvals[0];
+        }
+    }
+
+  return (yinc);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqXpole(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->xpole);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefXpole(int gridID, double xpole)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( memcmp(gridptr->xstdname, "grid", 4) != 0 )
+    strcpy(gridptr->xstdname, "grid_longitude");
+
+  gridptr->isRotated = TRUE;
+  gridptr->xpole = xpole;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqYpole(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ypole);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefYpole(int gridID, double ypole)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( memcmp(gridptr->ystdname, "grid", 4) != 0 )
+    strcpy(gridptr->ystdname, "grid_latitude");
+
+  gridptr->isRotated = TRUE;
+  gridptr->ypole = ypole;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqAngle(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->angle);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefAngle(int gridID, double angle)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->isRotated = TRUE;
+  gridptr->angle = angle;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+int gridInqGMEnd(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->nd);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefGMEnd(int gridID, int nd)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->nd = nd;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+int gridInqGMEni(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ni);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefGMEni(int gridID, int ni)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->ni = ni;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+int gridInqGMEni2(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ni2);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefGMEni2(int gridID, int ni2)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->ni2 = ni2;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+int gridInqGMEni3(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ni3);
+}
+
+void gridDefGMEni3(int gridID, int ni3)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->ni3 = ni3;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridChangeType(int gridID, int gridtype)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  Message("Changed grid type from %s to %s",
+          gridNamePtr(gridptr->type),
+          gridNamePtr(gridtype));
+
+  gridptr->type = gridtype;
+}
+
+static
+void grid_check_cyclic(grid_t *gridptr)
+{
+  int xsize, ysize;
+  long i1, i2, in, j, k1, k2, nc;
+  double xinc, x0;
+  const double *xvals, *xbounds;
+
+  gridptr->isCyclic = FALSE;
+
+  xsize = gridptr->xsize;
+  ysize = gridptr->ysize;
+  xvals = gridptr->xvals;
+  xbounds = gridptr->xbounds;
+
+  if ( gridptr->type == GRID_GAUSSIAN || gridptr->type == GRID_LONLAT )
+    {
+      if ( xvals && xsize > 1 )
+        {
+          xinc = xvals[1] - xvals[0];
+          if ( IS_EQUAL(xinc, 0) )
+            xinc = (xvals[xsize-1] - xvals[0])/(xsize-1);
+          x0 = 2*xvals[xsize-1]-xvals[xsize-2]-360;
+          if ( IS_NOT_EQUAL(xvals[0], xvals[xsize-1]) )
+            if ( fabs(x0 - xvals[0]) < 0.01*xinc ) gridptr->isCyclic = TRUE;
+        }
+    }
+  else if ( gridptr->type == GRID_CURVILINEAR )
+    {
+      if ( xvals && xsize > 1 )
+        {
+          double val1, val2, valn;
+
+          nc = 0;
+          gridptr->isCyclic = FALSE;
+          for ( j = 0; j < ysize; ++j )
+            {
+              i1 = j*xsize;
+              i2 = j*xsize+1;
+              in = j*xsize+(xsize-1);
+              val1 = xvals[i1];
+              val2 = xvals[i2];
+              valn = xvals[in];
+
+              xinc = fabs(val2-val1);
+
+	      if ( val1 <    1 && valn > 300 ) val1 += 360;
+	      if ( valn <    1 && val1 > 300 ) valn += 360;
+	      if ( val1 < -179 && valn > 120 ) val1 += 360;
+	      if ( valn < -179 && val1 > 120 ) valn += 360;
+
+              if ( valn > val1 ) x0 = valn - xinc;
+              else               x0 = valn + xinc;
+
+              if ( fabs(x0-val1) < 0.5*xinc ) nc++;
+            }
+
+          if ( nc > 0.5*ysize ) gridptr->isCyclic = TRUE;
+        }
+
+      if ( xbounds && xsize > 1 )
+	{
+	  double val1, val2;
+
+	  gridptr->isCyclic = TRUE;
+	  for ( j = 0; j < ysize; ++j )
+	    {
+	      i1 = j*xsize*4;
+	      i2 = j*xsize*4+(xsize-1)*4;
+	      nc = 0;
+	      for ( k1 = 0; k1 < 4; ++k1 )
+		{
+		  val1 = xbounds[i1+k1];
+		  for ( k2 = 0; k2 < 4; ++k2 )
+		    {
+		      val2 = xbounds[i2+k2];
+
+		      if ( val1 <    1 && val2 > 300 ) val1 += 360;
+		      if ( val2 <    1 && val1 > 300 ) val2 += 360;
+		      if ( val1 < -179 && val2 > 120 ) val1 += 360;
+		      if ( val2 < -179 && val1 > 120 ) val2 += 360;
+
+		      if ( fabs(val1-val2) < 0.001 )
+			{
+			  nc++;
+			  break;
+			}
+		    }
+		}
+
+	      if ( nc < 1 )
+		{
+		  gridptr->isCyclic = FALSE;
+		  break;
+		}
+	    }
+	}
+    }
+}
+
+
+int gridIsCircular(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->isCyclic == CDI_UNDEFID ) grid_check_cyclic(gridptr);
+
+  return ( gridptr->isCyclic );
+}
+
+
+int gridIsRotated(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return ( gridptr->isRotated );
+}
+
+static
+int compareXYvals(int gridID, long xsize, long ysize, double *xvals0, double *yvals0)
+{
+  long i;
+  int differ = 0;
+
+  if ( !differ && xsize == gridInqXvals(gridID, NULL) )
+    {
+      double *xvals;
+
+      xvals = (double *) malloc(xsize*sizeof(double));
+
+      gridInqXvals(gridID, xvals);
+
+      for ( i = 0; i < xsize; ++i )
+	if ( fabs(xvals0[i] - xvals[i]) > 1.e-10 )
+	  {
+	    differ = 1;
+	    break;
+	  }
+
+      free(xvals);
+    }
+
+  if ( !differ && ysize == gridInqYvals(gridID, NULL) )
+    {
+      double *yvals;
+
+      yvals = (double *) malloc(ysize*sizeof(double));
+
+      gridInqYvals(gridID, yvals);
+
+      for ( i = 0; i < ysize; ++i )
+	if ( fabs(yvals0[i] - yvals[i]) > 1.e-10 )
+	  {
+	    differ = 1;
+	    break;
+	  }
+
+      free(yvals);
+    }
+
+  return (differ);
+}
+
+static
+int compareXYvals2(int gridID, long gridsize, double *xvals, double *yvals)
+{
+  int differ = 0;
+
+  if ( !differ && xvals && gridInqXvalsPtr(gridID) )
+    {
+      if ( fabs(xvals[0] - gridInqXval(gridID, 0)) > 1.e-9 ||
+	   fabs(xvals[gridsize-1] - gridInqXval(gridID, gridsize-1)) > 1.e-9 )
+	differ = 1;
+    }
+
+  if ( !differ && yvals && gridInqYvalsPtr(gridID) )
+    {
+      if ( fabs(yvals[0] - gridInqYval(gridID, 0)) > 1.e-9 ||
+	   fabs(yvals[gridsize-1] - gridInqYval(gridID, gridsize-1)) > 1.e-9 )
+	differ = 1;
+    }
+
+  return (differ);
+}
+
+
+int gridCompare(int gridID, grid_t grid)
+{
+  int differ = 1;
+
+  if ( grid.type == gridInqType(gridID) || grid.type == GRID_GENERIC )
+    {
+      if ( grid.size == gridInqSize(gridID) )
+	{
+	  differ = 0;
+	  if ( grid.type == GRID_LONLAT )
+	    {
+	      /*
+	      printf("gridID      %d\n", gridID);
+	      printf("grid.xdef   %d\n", grid.xdef);
+	      printf("grid.ydef   %d\n", grid.ydef);
+	      printf("grid.xsize  %d\n", grid.xsize);
+	      printf("grid.ysize  %d\n", grid.ysize);
+	      printf("grid.xfirst %f\n", grid.xfirst);
+	      printf("grid.yfirst %f\n", grid.yfirst);
+	      printf("grid.xfirst %f\n", gridInqXval(gridID, 0));
+	      printf("grid.yfirst %f\n", gridInqYval(gridID, 0));
+	      printf("grid.xinc   %f\n", grid.xinc);
+	      printf("grid.yinc   %f\n", grid.yinc);
+	      printf("grid.xinc   %f\n", gridInqXinc(gridID));
+	      printf("grid.yinc   %f\n", gridInqYinc(gridID));
+	      */
+	      if ( grid.xsize == gridInqXsize(gridID) && grid.ysize == gridInqYsize(gridID) )
+		{
+		  if ( grid.xdef == 2 && grid.ydef == 2 )
+		    {
+		      if ( ! (IS_EQUAL(grid.xfirst, 0) && IS_EQUAL(grid.xlast, 0) && IS_EQUAL(grid.xinc, 0)) &&
+			   ! (IS_EQUAL(grid.yfirst, 0) && IS_EQUAL(grid.ylast, 0) && IS_EQUAL(grid.yinc, 0)) &&
+			   IS_NOT_EQUAL(grid.xfirst, grid.xlast) && IS_NOT_EQUAL(grid.yfirst, grid.ylast) )
+			{
+			  if ( IS_NOT_EQUAL(grid.xfirst, gridInqXval(gridID, 0)) ||
+			       IS_NOT_EQUAL(grid.yfirst, gridInqYval(gridID, 0)))
+			    {
+			      differ = 1;
+			    }
+			  if ( !differ && fabs(grid.xinc) > 0 &&
+			       fabs(fabs(grid.xinc) - fabs(gridInqXinc(gridID))) > fabs(grid.xinc/1000))
+			    {
+			      differ = 1;
+			    }
+			  if ( !differ && fabs(grid.yinc) > 0 &&
+			       fabs(fabs(grid.yinc) - fabs(gridInqYinc(gridID))) > fabs(grid.yinc/1000))
+			    {
+			      differ = 1;
+			    }
+			}
+		    }
+		  else
+		    {
+		      if ( grid.xvals && grid.yvals )
+			differ = compareXYvals(gridID, grid.xsize, grid.ysize, grid.xvals, grid.yvals);
+		    }
+		}
+	      else
+		differ = 1;
+	    }
+	  else if ( grid.type == GRID_GENERIC )
+	    {
+	      if ( grid.xsize == gridInqXsize(gridID) && grid.ysize == gridInqYsize(gridID) )
+		{
+		  if ( grid.xdef == 1 && grid.ydef == 1 )
+		    {
+		      if ( grid.xvals && grid.yvals )
+			differ = compareXYvals(gridID, grid.xsize, grid.ysize, grid.xvals, grid.yvals);
+		    }
+		}
+	      else if ( (grid.ysize == 0 || grid.ysize == 1) &&
+			grid.xsize == gridInqXsize(gridID)*gridInqYsize(gridID) )
+		{
+		}
+	      else
+		differ = 1;
+	    }
+	  else if ( grid.type == GRID_GAUSSIAN )
+	    {
+	      if ( grid.xsize == gridInqXsize(gridID) && grid.ysize == gridInqYsize(gridID) )
+		{
+		  if ( grid.xdef == 2 && grid.ydef == 2 )
+		    {
+		      if ( ! (IS_EQUAL(grid.xfirst, 0) && IS_EQUAL(grid.xlast, 0) && IS_EQUAL(grid.xinc, 0)) &&
+			   ! (IS_EQUAL(grid.yfirst, 0) && IS_EQUAL(grid.ylast, 0)) )
+			if ( fabs(grid.xfirst - gridInqXval(gridID, 0)) > 0.001 ||
+			     fabs(grid.yfirst - gridInqYval(gridID, 0)) > 0.001 ||
+			     (fabs(grid.xinc)>0 && fabs(fabs(grid.xinc) - fabs(gridInqXinc(gridID))) > fabs(grid.xinc/1000)) )
+			  {
+			    differ = 1;
+			  }
+		    }
+		  else
+		    {
+		      if ( grid.xvals && grid.yvals )
+			differ = compareXYvals(gridID, grid.xsize, grid.ysize, grid.xvals, grid.yvals);
+		    }
+		}
+	      else
+		differ = 1;
+	    }
+	  else if ( grid.type == GRID_CURVILINEAR )
+	    {
+	      /*
+	      printf("gridID      %d\n", gridID);
+	      printf("grid.xsize  %d\n", grid.xsize);
+	      printf("grid.ysize  %d\n", grid.ysize);
+	      printf("grid.xfirst %f\n", grid.xvals[0]);
+	      printf("grid.yfirst %f\n", grid.yvals[0]);
+	      printf("grid xfirst %f\n", gridInqXval(gridID, 0));
+	      printf("grid yfirst %f\n", gridInqYval(gridID, 0));
+	      printf("grid.xlast  %f\n", grid.xvals[grid.size-1]);
+	      printf("grid.ylast  %f\n", grid.yvals[grid.size-1]);
+	      printf("grid xlast  %f\n", gridInqXval(gridID, grid.size-1));
+	      printf("grid ylast  %f\n", gridInqYval(gridID, grid.size-1));
+	      printf("grid.nv     %d\n", grid.nvertex);
+	      printf("grid nv     %d\n", gridInqNvertex(gridID));
+	      */
+	      if ( grid.xsize == gridInqXsize(gridID) && grid.ysize == gridInqYsize(gridID) )
+		differ = compareXYvals2(gridID, grid.size, grid.xvals, grid.yvals);
+	    }
+	  else if ( grid.type == GRID_UNSTRUCTURED )
+	    {
+	      if ( grid.nvertex == gridInqNvertex(gridID) )
+		differ = compareXYvals2(gridID, grid.size, grid.xvals, grid.yvals);
+	    }
+	}
+    }
+
+  return (differ);
+}
+
+
+int gridCompareP ( void * gridptr1, void * gridptr2 )
+{
+  grid_t * g1 = ( grid_t * ) gridptr1;
+  grid_t * g2 = ( grid_t * ) gridptr2;
+  int differ = -1;
+  int equal  = 0;
+  int i, size;
+
+  xassert ( g1 );
+  xassert ( g2 );
+
+  if ( g1->type          != g2->type         ) return differ;
+  if ( g1->prec          != g2->prec         ) return differ;
+  if ( g1->lcc_projflag  != g2->lcc_projflag ) return differ;
+  if ( g1->lcc_scanflag  != g2->lcc_scanflag ) return differ;
+  if ( g1->lcc_defined   != g2->lcc_defined  ) return differ;
+  if ( g1->lcc2_defined  != g2->lcc2_defined ) return differ;
+  if ( g1->laea_defined  != g2->laea_defined ) return differ;
+  if ( g1->isCyclic      != g2->isCyclic     ) return differ;
+  if ( g1->isRotated     != g2->isRotated    ) return differ;
+  if ( g1->xdef          != g2->xdef         ) return differ;
+  if ( g1->ydef          != g2->ydef         ) return differ;
+  if ( g1->nd            != g2->nd           ) return differ;
+  if ( g1->ni            != g2->ni           ) return differ;
+  if ( g1->ni2           != g2->ni2          ) return differ;
+  if ( g1->ni3           != g2->ni3          ) return differ;
+  if ( g1->number        != g2->number       ) return differ;
+  if ( g1->position      != g2->position     ) return differ;
+  if ( g1->trunc         != g2->trunc        ) return differ;
+  if ( g1->nvertex       != g2->nvertex      ) return differ;
+  if ( g1->nrowlon       != g2->nrowlon      ) return differ;
+  if ( g1->size          != g2->size         ) return differ;
+  if ( g1->xsize         != g2->xsize        ) return differ;
+  if ( g1->ysize         != g2->ysize        ) return differ;
+  if ( g1->locked        != g2->locked       ) return differ;
+  if ( g1->lcomplex      != g2->lcomplex     ) return differ;
+
+  if ( g1->rowlon )
+    {
+      for ( i = 0; i < g1->nrowlon; i++ )
+	if ( g1->rowlon[i] != g2->rowlon[i] ) return differ; 
+    } 
+  else if ( g2->rowlon )
+    return differ;
+
+  if ( g1->xfirst        != g2->xfirst        ) return differ;       
+  if ( g1->yfirst	 != g2->yfirst        ) return differ;
+  if ( g1->xlast         != g2->xlast         ) return differ;
+  if ( g1->ylast         != g2->ylast         ) return differ;
+  if ( g1->xinc	         != g2->xinc          ) return differ;
+  if ( g1->yinc	         != g2->yinc          ) return differ;
+  if ( g1->lcc_originLon != g2->lcc_originLon ) return differ;         
+  if ( g1->lcc_originLat != g2->lcc_originLat ) return differ;
+  if ( g1->lcc_lonParY   != g2->lcc_lonParY   ) return differ;
+  if ( g1->lcc_lat1      != g2->lcc_lat1      ) return differ;
+  if ( g1->lcc_lat2      != g2->lcc_lat2      ) return differ;
+  if ( g1->lcc_xinc      != g2->lcc_xinc      ) return differ;
+  if ( g1->lcc_yinc      != g2->lcc_yinc      ) return differ;
+  if ( g1->lcc2_lon_0    != g2->lcc2_lon_0    ) return differ;         
+  if ( g1->lcc2_lat_0    != g2->lcc2_lat_0    ) return differ;
+  if ( g1->lcc2_lat_1    != g2->lcc2_lat_1    ) return differ;
+  if ( g1->lcc2_lat_2    != g2->lcc2_lat_2    ) return differ;
+  if ( g1->lcc2_a        != g2->lcc2_a        ) return differ;
+  if ( g1->laea_lon_0    != g2->laea_lon_0    ) return differ;         
+  if ( g1->laea_lat_0    != g2->laea_lat_0    ) return differ;
+  if ( g1->laea_a        != g2->laea_a        ) return differ;
+  if ( g1->xpole         != g2->xpole         ) return differ;
+  if ( g1->ypole         != g2->ypole         ) return differ;
+  if ( g1->angle         != g2->angle         ) return differ; 
+
+  
+  if ( g1->xvals )
+    {
+      if ( g1->type == GRID_UNSTRUCTURED || g1->type == GRID_CURVILINEAR )
+	size = g1->size;
+      else
+	size = g1->xsize;
+      xassert ( size );
+
+      if ( !g2->xvals ) return differ;
+
+      for ( i = 0; i < size; i++ )
+	if ( g1->xvals[i] != g2->xvals[i] ) return differ; 
+    } 
+  else if ( g2->xvals )
+    return differ;
+  
+  if ( g1->yvals )
+    {
+      if ( g1->type == GRID_UNSTRUCTURED || g1->type == GRID_CURVILINEAR )
+	size = g1->size;
+      else
+	size = g1->ysize;
+      xassert ( size );
+
+      if ( !g2->yvals ) return differ;
+
+      for ( i = 0; i < size; i++ )
+	  if ( g1->yvals[i] != g2->yvals[i] ) return differ;
+    } 
+  else if ( g2->yvals )
+    return differ;
+  
+  if ( g1->area )
+    {
+      xassert ( g1->size );
+
+      if ( !g2->area ) return differ;
+
+      for ( i = 0; i < g1->size; i++ )
+	if ( g1->area[i] != g2->area[i] ) return differ;
+    } 
+  else if ( g2->area )
+    return differ;
+
+  if ( g1->xbounds )
+    {
+      xassert ( g1->nvertex );
+      if ( g1->type == GRID_CURVILINEAR || g1->type == GRID_UNSTRUCTURED )
+	size = g1->nvertex * g1->size;
+      else
+	size = g1->nvertex * g1->xsize;
+      xassert ( size );
+
+      if ( !g2->xbounds ) return differ;
+
+      for ( i = 0; i < size; i++ )
+	if ( g1->xbounds[i] != g2->xbounds[i] ) return differ;
+    } 
+  else if ( g2->xbounds )
+    return differ;
+
+  if ( g1->ybounds )
+    {
+      xassert ( g1->nvertex );
+      if ( g1->type == GRID_CURVILINEAR || g1->type == GRID_UNSTRUCTURED )
+	size = g1->nvertex * g1->size;
+      else
+	size = g1->nvertex * g1->ysize;
+      xassert ( size );
+
+      if ( !g2->ybounds ) return differ;
+
+      for ( i = 0; i < size; i++ )
+	if ( g1->ybounds[i] != g2->ybounds[i] ) return differ;
+    } 
+  else if ( g2->ybounds )
+    return differ;
+
+  if ( memcmp ( &g1->xname    ,&g2->xname    ,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->yname    ,&g2->yname    ,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->xlongname,&g2->xlongname,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->ylongname,&g2->ylongname,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->xstdname ,&g2->xstdname ,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->ystdname ,&g2->ystdname ,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->xunits   ,&g2->xunits   ,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->yunits   ,&g2->yunits   ,CDI_MAX_NAME )) 
+    return differ; 
+
+  if ( g1->reference )
+    {
+      if ( !g2->reference ) return differ;
+      size = strlen ( g1->reference ) + 1;
+      if ( memcmp ( g1->reference, g2->reference, size )) 
+	return differ;
+    }
+  else if ( g2->reference )
+    return differ;
+
+  if ( g1->mask )
+    {
+      xassert ( g1->size );
+      if ( !g2->mask ) return differ;
+      if ( memcmp ( g1->mask, g2->mask, g1->size * sizeof ( unsigned char ))) 
+	return differ;
+    }
+  else if ( g2->mask )
+    return differ;
+
+  if ( g1->mask_gme )
+    {
+      xassert ( g1->size );
+      if ( !g2->mask_gme ) return differ;
+      if ( memcmp ( g1->mask_gme, g2->mask_gme, 
+		    g1->size * sizeof ( unsigned char ))) return differ;
+    }
+  else if ( g2->mask_gme )
+    return differ;
+
+  return equal;
+}
+
+
+int gridGenerate(grid_t grid)
+{
+  int gridID;
+  grid_t *gridptr;
+
+  gridID = gridCreate(grid.type, grid.size);
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridDefPrec(gridID, grid.prec);
+
+  switch (grid.type)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_UNSTRUCTURED:
+    case GRID_CURVILINEAR:
+    case GRID_GENERIC:
+    case GRID_LCC:
+    case GRID_LCC2:
+    case GRID_SINUSOIDAL:
+    case GRID_LAEA:
+    case GRID_PROJECTION:
+      {
+	if ( grid.xsize > 0 ) gridDefXsize(gridID, grid.xsize);
+	if ( grid.ysize > 0 ) gridDefYsize(gridID, grid.ysize);
+
+        if ( grid.type == GRID_GAUSSIAN ) gridDefNP(gridID, grid.np);
+
+	if ( grid.nvertex > 0 )
+	  gridDefNvertex(gridID, grid.nvertex);
+
+	if ( grid.xdef == 1 )
+	  {
+	    gridDefXvals(gridID, grid.xvals);
+	    if ( grid.xbounds )
+	      gridDefXbounds(gridID, grid.xbounds);
+	  }
+	else if ( grid.xdef == 2 )
+	  {
+	    double *xvals = (double *) malloc(grid.xsize*sizeof(double));
+	    gridGenXvals(grid.xsize, grid.xfirst, grid.xlast, grid.xinc, xvals);
+	    gridDefXvals(gridID, xvals);
+	    free(xvals);
+	    /*
+	    gridDefXinc(gridID, grid.xinc);
+	    */
+	  }
+
+	if ( grid.ydef == 1 )
+	  {
+	    gridDefYvals(gridID, grid.yvals);
+	    if ( grid.ybounds && grid.nvertex )
+	      gridDefYbounds(gridID, grid.ybounds);
+	  }
+	else if ( grid.ydef == 2 )
+	  {
+	    double *yvals = (double *) malloc(grid.ysize*sizeof(double));
+	    gridGenYvals(grid.type, grid.ysize, grid.yfirst, grid.ylast, grid.yinc, yvals);
+	    gridDefYvals(gridID, yvals);
+	    free(yvals);
+	    /*
+	    gridDefYinc(gridID, grid.yinc);
+	    */
+	  }
+
+	if ( grid.isRotated )
+	  {
+	    gridDefXname(gridID, "rlon");
+	    gridDefYname(gridID, "rlat");
+	    gridDefXlongname(gridID, "longitude in rotated pole grid");
+	    gridDefYlongname(gridID, "latitude in rotated pole grid");
+	    strcpy(gridptr->xstdname, "grid_longitude");
+	    strcpy(gridptr->ystdname, "grid_latitude");
+	    gridDefXunits(gridID, "degrees");
+	    gridDefYunits(gridID, "degrees");
+
+	    gridDefXpole(gridID, grid.xpole);
+	    gridDefYpole(gridID, grid.ypole);
+	    gridDefAngle(gridID, grid.angle);
+	  }
+
+	if ( grid.area )
+	  {
+	    gridDefArea(gridID, grid.area);
+	  }
+
+	if ( grid.type == GRID_LAEA )
+	  gridDefLaea(gridID, grid.laea_a, grid.laea_lon_0, grid.laea_lat_0);
+
+	if ( grid.type == GRID_LCC2 )
+	  gridDefLcc2(gridID, grid.lcc2_a, grid.lcc2_lon_0, grid.lcc2_lat_0, grid.lcc2_lat_1, grid.lcc2_lat_2);
+
+	if ( grid.type == GRID_LCC )
+	  gridDefLCC(gridID, grid.lcc_originLon, grid.lcc_originLat, grid.lcc_lonParY,
+		     grid.lcc_lat1, grid.lcc_lat2, grid.lcc_xinc, grid.lcc_yinc,
+		     grid.lcc_projflag, grid.lcc_scanflag);
+
+	if ( grid.type == GRID_PROJECTION )
+	  {
+	    gridptr->name = strdup(grid.name);
+	  }
+
+	break;
+      }
+    case GRID_GAUSSIAN_REDUCED:
+      {
+	gridDefNP(gridID, grid.np);
+	gridDefYsize(gridID, grid.ysize);
+	gridDefRowlon(gridID, grid.ysize, grid.rowlon);
+
+	if ( grid.ydef == 1 )
+	  {
+	    gridDefYvals(gridID, grid.yvals);
+	    if ( grid.ybounds && grid.nvertex )
+	      gridDefYbounds(gridID, grid.ybounds);
+	  }
+	else if ( grid.ydef == 2 )
+	  {
+	    double *yvals = (double *) malloc(grid.ysize*sizeof(double));
+	    gridGenYvals(grid.type, grid.ysize, grid.yfirst, grid.ylast, grid.yinc, yvals);
+	    gridDefYvals(gridID, yvals);
+	    free(yvals);
+	    /*
+	    gridDefYinc(gridID, grid.yinc);
+	    */
+	  }
+	break;
+      }
+    case GRID_SPECTRAL:
+      {
+        gridDefTrunc(gridID, grid.trunc);
+        if ( grid.lcomplex ) gridDefComplexPacking(gridID, 1);
+        break;
+      }
+    case GRID_FOURIER:
+      {
+	gridDefTrunc(gridID, grid.trunc);
+	break;
+      }
+    case GRID_GME:
+      {
+        gridDefGMEnd(gridID, grid.nd);
+        gridDefGMEni(gridID, grid.ni);
+        gridDefGMEni2(gridID, grid.ni2);
+        gridDefGMEni3(gridID, grid.ni3);
+        break;
+      }
+    case GRID_REFERENCE:
+      {
+        gridDefNumber(gridID, grid.number);
+        gridDefPosition(gridID, grid.position);
+        gridDefUUID(gridID, grid.uuid);
+        if ( grid.reference ) gridDefReference(gridID, grid.reference);
+        break;
+      }
+      /*
+    case GRID_GENERIC:
+      {
+        if ( grid.xsize > 0 && grid.ysize > 0 )
+          {
+            gridDefXsize(gridID, grid.xsize);
+            gridDefYsize(gridID, grid.ysize);
+            if ( grid.xvals ) gridDefXvals(gridID, grid.xvals);
+            if ( grid.yvals ) gridDefYvals(gridID, grid.yvals);
+          }
+        break;
+      }
+      */
+    case GRID_TRAJECTORY:
+      {
+        gridDefXsize(gridID, 1);
+        gridDefYsize(gridID, 1);
+        break;
+      }
+    default:
+      {
+	Error("Gridtype %s unsupported!", gridNamePtr(grid.type));
+	break;
+      }
+    }
+
+  if ( grid.xname[0]     ) gridDefXname(gridID, grid.xname);
+  if ( grid.xlongname[0] ) gridDefXlongname(gridID, grid.xlongname);
+  if ( grid.xunits[0]    ) gridDefXunits(gridID, grid.xunits);
+  if ( grid.yname[0]     ) gridDefYname(gridID, grid.yname);
+  if ( grid.ylongname[0] ) gridDefYlongname(gridID, grid.ylongname);
+  if ( grid.yunits[0]    ) gridDefYunits(gridID, grid.yunits);
+
+  return (gridID);
+}
+
+/*
+ at Function  gridDuplicate
+ at Title     Duplicate a horizontal Grid
+
+ at Prototype int gridDuplicate(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate},
+                    @fref{gridDuplicate} or @fref{vlistInqVarGrid}.
+
+ at Description
+The function @func{gridDuplicate} duplicates a horizontal Grid.
+
+ at Result
+ at func{gridDuplicate} returns an identifier to the duplicated Grid.
+
+ at EndFunction
+*/
+int gridDuplicate(int gridID)
+{
+  int gridIDnew;
+  int gridtype, gridsize;
+  int nrowlon;
+  int size;
+  grid_t *gridptr, *gridptrnew;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridtype = gridInqType(gridID);
+  gridsize = gridInqSize(gridID);
+
+  gridIDnew = gridCreate(gridtype, gridsize);
+  gridptrnew = ( grid_t *) reshGetVal ( gridIDnew, &gridOps );
+
+  grid_copy(gridptrnew, gridptr);
+
+  strcpy(gridptrnew->xname, gridptr->xname);
+  strcpy(gridptrnew->yname, gridptr->yname);
+  strcpy(gridptrnew->xlongname, gridptr->xlongname);
+  strcpy(gridptrnew->ylongname, gridptr->ylongname);
+  strcpy(gridptrnew->xunits, gridptr->xunits);
+  strcpy(gridptrnew->yunits, gridptr->yunits);
+  strcpy(gridptrnew->xstdname, gridptr->xstdname);
+  strcpy(gridptrnew->ystdname, gridptr->ystdname);
+
+  nrowlon = gridptr->nrowlon;
+  if ( nrowlon )
+    {
+      gridptrnew->rowlon = (int *) malloc(nrowlon*sizeof(int));
+      memcpy(gridptrnew->rowlon, gridptr->rowlon, nrowlon*sizeof(int));
+    }
+
+  if ( gridptr->xvals != NULL )
+    {
+      if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED )
+	size = gridsize;
+      else
+        size = gridptr->xsize;
+
+      gridptrnew->xvals = (double *) malloc(size*sizeof(double));
+      memcpy(gridptrnew->xvals, gridptr->xvals, size*sizeof(double));
+    }
+
+  if ( gridptr->yvals != NULL )
+    {
+      if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED )
+	size = gridsize;
+      else
+        size = gridptr->ysize;
+
+      gridptrnew->yvals = (double *) malloc(size*sizeof(double));
+      memcpy(gridptrnew->yvals, gridptr->yvals, size*sizeof(double));
+    }
+
+  if ( gridptr->xbounds != NULL )
+    {
+      if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED )
+	size = gridsize;
+      else
+        size = gridptr->xsize;
+
+      size *= gridptr->nvertex;
+
+      gridptrnew->xbounds = (double *) malloc(size*sizeof(double));
+      memcpy(gridptrnew->xbounds, gridptr->xbounds, size*sizeof(double));
+    }
+
+  if ( gridptr->ybounds != NULL )
+    {
+      if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED )
+	size = gridsize;
+      else
+        size = gridptr->ysize;
+
+      size *= gridptr->nvertex;
+
+      gridptrnew->ybounds = (double *) malloc(size*sizeof(double));
+      memcpy(gridptrnew->ybounds, gridptr->ybounds, size*sizeof(double));
+    }
+
+  if ( gridptr->area != NULL )
+    {
+      size = gridsize;
+
+      gridptrnew->area = (double *) malloc(size*sizeof(double));
+      memcpy(gridptrnew->area, gridptr->area, size*sizeof(double));
+    }
+
+  if ( gridptr->mask != NULL )
+    {
+      size = gridsize;
+
+      gridptrnew->mask = (mask_t *) malloc(size*sizeof(mask_t));
+      memcpy(gridptrnew->mask, gridptr->mask, size*sizeof(mask_t));
+    }
+
+  if ( gridptr->mask_gme != NULL )
+    {
+      size = gridsize;
+
+      gridptrnew->mask_gme = (mask_t *) malloc(size*sizeof(mask_t));
+      memcpy(gridptrnew->mask_gme, gridptr->mask_gme, size*sizeof(mask_t));
+    }
+
+  return (gridIDnew);
+}
+
+
+void gridCompress(int gridID)
+{
+  int gridtype, gridsize;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridtype = gridInqType(gridID);
+  gridsize = gridInqSize(gridID);
+
+  if ( gridtype == GRID_UNSTRUCTURED )
+    {
+      if ( gridptr->mask_gme != NULL )
+	{
+	  long i, j, iv, nv;
+
+	  nv = gridptr->nvertex;
+
+	  j = 0;
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+	      if ( gridptr->mask_gme[i] )
+		{
+		  if ( gridptr->xvals != NULL ) gridptr->xvals[j] = gridptr->xvals[i];
+		  if ( gridptr->yvals != NULL ) gridptr->yvals[j] = gridptr->yvals[i];
+		  if ( gridptr->area  != NULL ) gridptr->area[j]  = gridptr->area[i];
+		  if ( gridptr->xbounds != NULL )
+		    for ( iv = 0; iv < nv; iv++ )
+		      gridptr->xbounds[j*nv+iv] = gridptr->xbounds[i*nv+iv];
+		  if ( gridptr->ybounds != NULL )
+		    for ( iv = 0; iv < nv; iv++ )
+		      gridptr->ybounds[j*nv+iv] = gridptr->ybounds[i*nv+iv];
+
+		  j++;
+		}
+	    }
+
+	  /* fprintf(stderr, "grid compress %d %d %d\n", i, j, gridsize); */
+	  gridsize = j;
+	  gridptr->size  = gridsize;
+	  gridptr->xsize = gridsize;
+	  gridptr->ysize = gridsize;
+
+	  if ( gridptr->xvals )
+	    gridptr->xvals = (double *) realloc(gridptr->xvals, gridsize*sizeof(double));
+
+	  if ( gridptr->yvals )
+	    gridptr->yvals = (double *) realloc(gridptr->yvals, gridsize*sizeof(double));
+
+	  if ( gridptr->area )
+	    gridptr->area  = (double *) realloc(gridptr->area, gridsize*sizeof(double));
+
+	  if ( gridptr->xbounds )
+	    gridptr->xbounds = (double *) realloc(gridptr->xbounds, nv*gridsize*sizeof(double));
+
+	  if ( gridptr->ybounds )
+	    gridptr->ybounds = (double *) realloc(gridptr->ybounds, nv*gridsize*sizeof(double));
+
+	  free(gridptr->mask_gme);
+	  gridptr->mask_gme = NULL;
+	}
+    }
+  else
+    Warning("Unsupported grid type: %s", gridNamePtr(gridtype));
+}
+
+
+void gridDefArea(int gridID, const double *area)
+{
+  long size;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( size == 0 )
+    Error("size undefined for gridID = %d", gridID);
+
+  if ( gridptr->area == NULL )
+    gridptr->area = (double *) malloc(size*sizeof(double));
+  else if ( CDI_Debug )
+    Warning("values already defined!");
+
+  memcpy(gridptr->area, area, size*sizeof(double));
+}
+
+
+void gridInqArea(int gridID, double *area)
+{
+  long size;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( gridptr->area )
+    memcpy(area, gridptr->area, size*sizeof(double));
+}
+
+
+int gridHasArea(int gridID)
+{
+  int hasArea = FALSE;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->area != NULL ) hasArea = TRUE;
+
+  return (hasArea);
+}
+
+
+const double *gridInqAreaPtr(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->area);
+}
+
+
+void gridDefNvertex(int gridID, int nvertex)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->nvertex = nvertex;
+}
+
+
+int gridInqNvertex(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->nvertex);
+}
+
+/*
+ at Function  gridDefXbounds
+ at Title     Define the bounds of a X-axis
+
+ at Prototype void gridDefXbounds(int gridID, const double *xbounds)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  xbounds  X-bounds of the grid.
+
+ at Description
+The function @func{gridDefXbounds} defines all bounds of the X-axis.
+
+ at EndFunction
+*/
+void gridDefXbounds(int gridID, const double *xbounds)
+{
+  long size;
+  long nvertex;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning ("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  nvertex = gridptr->nvertex;
+  if ( nvertex == 0 )
+    {
+      Warning("nvertex undefined for gridID = %d. Cannot define bounds!", gridID);
+      return;
+    }
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = nvertex*gridptr->size;
+  else
+    size = nvertex*gridptr->xsize;
+
+  if ( size == 0 )
+    Error("size undefined for gridID = %d", gridID);
+
+  if ( gridptr->xbounds == NULL )
+    gridptr->xbounds = (double *) malloc(size*sizeof(double));
+  else if ( CDI_Debug )
+    Warning("values already defined!");
+
+  memcpy(gridptr->xbounds, xbounds, size*sizeof(double));
+}
+
+/*
+ at Function  gridInqXbounds
+ at Title     Get the bounds of a X-axis
+
+ at Prototype int gridInqXbounds(int gridID, double *xbounds)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  xbounds  Pointer to the location into which the X-bounds are read.
+                    The caller must allocate space for the returned values.
+
+ at Description
+The function @func{gridInqXbounds} returns the bounds of the X-axis.
+
+ at Result
+Upon successful completion @func{gridInqXbounds} returns the number of bounds and
+the bounds are stored in @func{xbounds}.
+Otherwise, 0 is returned and @func{xbounds} is empty.
+
+ at EndFunction
+*/
+int gridInqXbounds(int gridID, double *xbounds)
+{
+  long size;
+  long nvertex;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  nvertex = gridptr->nvertex;
+  if ( CDI_Debug && nvertex == 0 )
+    Warning("nvertex undefined for gridID = %d", gridID);
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = nvertex*gridptr->size;
+  else
+    size = nvertex*gridptr->xsize;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("size undefined for gridID = %d", gridID);
+
+  if ( xbounds && gridptr->xbounds )
+    memcpy(xbounds, gridptr->xbounds, size*sizeof(double));
+
+  if ( gridptr->xbounds == NULL ) size = 0;
+
+  return ((int)size);
+}
+
+
+double *gridInqXboundsPtr(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->xbounds);
+}
+
+/*
+ at Function  gridDefYbounds
+ at Title     Define the bounds of a Y-axis
+
+ at Prototype void gridDefYbounds(int gridID, const double *ybounds)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  ybounds  Y-bounds of the grid.
+
+ at Description
+The function @func{gridDefYbounds} defines all bounds of the Y-axis.
+
+ at EndFunction
+*/
+void gridDefYbounds(int gridID, const double *ybounds)
+{
+  long size;
+  long nvertex;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  nvertex = gridptr->nvertex;
+  if ( nvertex == 0 )
+    {
+      Warning("nvertex undefined for gridID = %d. Cannot define bounds!", gridID);
+      return;
+    }
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = nvertex*gridptr->size;
+  else
+    size = nvertex*gridptr->ysize;
+
+  if ( size == 0 )
+    Error("size undefined for gridID = %d", gridID);
+
+  if ( gridptr->ybounds == NULL )
+    gridptr->ybounds = (double *) malloc(size*sizeof(double));
+  else if ( CDI_Debug )
+    Warning("values already defined!");
+
+  memcpy(gridptr->ybounds, ybounds, size*sizeof(double));
+}
+
+/*
+ at Function  gridInqYbounds
+ at Title     Get the bounds of a Y-axis
+
+ at Prototype int gridInqYbounds(int gridID, double *ybounds)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  ybounds  Pointer to the location into which the Y-bounds are read.
+                    The caller must allocate space for the returned values.
+
+ at Description
+The function @func{gridInqYbounds} returns the bounds of the Y-axis.
+
+ at Result
+Upon successful completion @func{gridInqYbounds} returns the number of bounds and
+the bounds are stored in @func{ybounds}.
+Otherwise, 0 is returned and @func{ybounds} is empty.
+
+ at EndFunction
+*/
+int gridInqYbounds(int gridID, double *ybounds)
+{
+  long size;
+  long nvertex;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  nvertex = gridptr->nvertex;
+  if ( CDI_Debug && nvertex == 0 )
+    Warning("nvertex undefined for gridID = %d", gridID);
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = nvertex*gridptr->size;
+  else
+    size = nvertex*gridptr->ysize;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("size undefined for gridID = %d", gridID);
+
+  if ( ybounds && gridptr->ybounds )
+    memcpy(ybounds, gridptr->ybounds, size*sizeof(double));
+
+  if ( gridptr->ybounds == NULL ) size = 0;
+
+  return ((int)size);
+}
+
+
+double *gridInqYboundsPtr(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ybounds);
+}
+
+
+void gridPrintKernel(grid_t * gridptr, int opt, FILE *fp)
+{
+  int type;
+  int gridsize, xsize, ysize, xdim, ydim;
+  int trunc;
+  int nbyte0, nbyte;
+  int i;
+  int nvertex, iv;
+  char uuid[17];
+  int gridID = gridptr->self;
+  const double *area    = gridInqAreaPtr(gridID);
+  const double *xvals   = gridInqXvalsPtr(gridID);
+  const double *yvals   = gridInqYvalsPtr(gridID);
+  const double *xbounds = gridInqXboundsPtr(gridID);
+  const double *ybounds = gridInqYboundsPtr(gridID);
+
+  grid_check_ptr(gridID, gridptr);
+
+  type     = gridInqType(gridID);
+  trunc    = gridInqTrunc(gridID);
+  gridsize = gridInqSize(gridID);
+  xsize    = gridInqXsize(gridID);
+  ysize    = gridInqYsize(gridID);
+  nvertex  = gridInqNvertex(gridID);
+
+  nbyte0 = 0;
+  fprintf(fp, "#\n");
+  fprintf(fp, "# gridID %d\n", gridID);
+  fprintf(fp, "#\n");
+  fprintf(fp, "gridtype  = %s\n", gridNamePtr(type));
+  fprintf(fp, "gridsize  = %d\n", gridsize);
+
+  if ( type != GRID_GME )
+    {
+      if ( gridptr->xname[0]     )     fprintf(fp, "xname     = %s\n", gridptr->xname);
+      if ( gridptr->xlongname[0] )     fprintf(fp, "xlongname = %s\n", gridptr->xlongname);
+      if ( gridptr->xunits[0]    )     fprintf(fp, "xunits    = %s\n", gridptr->xunits);
+      if ( gridptr->yname[0]     )     fprintf(fp, "yname     = %s\n", gridptr->yname);
+      if ( gridptr->ylongname[0] )     fprintf(fp, "ylongname = %s\n", gridptr->ylongname);
+      if ( gridptr->yunits[0]    )     fprintf(fp, "yunits    = %s\n", gridptr->yunits);
+      if ( type == GRID_UNSTRUCTURED ) fprintf(fp, "nvertex   = %d\n", nvertex);
+    }
+
+  switch (type)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_GENERIC:
+    case GRID_LCC2:
+    case GRID_SINUSOIDAL:
+    case GRID_LAEA:
+    case GRID_CURVILINEAR:
+    case GRID_UNSTRUCTURED:
+      {
+        if ( type == GRID_GAUSSIAN ) fprintf(fp, "np        = %d\n", gridptr->np);
+
+	if ( type == GRID_CURVILINEAR || type == GRID_UNSTRUCTURED )
+	  {
+	    xdim = gridsize;
+	    ydim = gridsize;
+	  }
+	else
+	  {
+	    xdim = xsize;
+	    ydim = ysize;
+	  }
+
+	if ( type != GRID_UNSTRUCTURED )
+	  {
+	    if ( xsize > 0 ) fprintf(fp, "xsize     = %d\n", xsize);
+	    if ( ysize > 0 ) fprintf(fp, "ysize     = %d\n", ysize);
+	  }
+
+	if ( type == GRID_LAEA )
+	  {
+	    double a, lon_0, lat_0;
+	    gridInqLaea(gridID, &a, &lon_0, &lat_0);
+	    fprintf(fp, "a         = %g\n", a);
+	    fprintf(fp, "lon_0     = %g\n", lon_0);
+	    fprintf(fp, "lat_0     = %g\n", lat_0);
+	  }
+
+	if ( type == GRID_LCC2 )
+	  {
+	    double a, lon_0, lat_0, lat_1, lat_2;
+	    gridInqLcc2(gridID, &a, &lon_0, &lat_0, &lat_1, &lat_2);
+	    fprintf(fp, "a         = %g\n", a);
+	    fprintf(fp, "lon_0     = %g\n", lon_0);
+	    fprintf(fp, "lat_0     = %g\n", lat_0);
+	    fprintf(fp, "lat_1     = %g\n", lat_1);
+	    fprintf(fp, "lat_2     = %g\n", lat_2);
+	  }
+
+	if ( gridptr->isRotated )
+	  {
+	    if ( xsize > 0 ) fprintf(fp, "xnpole    = %g\n", gridptr->xpole);
+	    if ( ysize > 0 ) fprintf(fp, "ynpole    = %g\n", gridptr->ypole);
+	    if ( gridptr->angle > 0 ) fprintf(fp, "angle     = %g\n", gridptr->angle);
+ 	  }
+
+	if ( xvals )
+	  {
+	    double xfirst = 0.0, xinc = 0.0;
+
+	    if ( type == GRID_LONLAT     || type == GRID_GAUSSIAN || 
+		 type == GRID_GENERIC    || type == GRID_LCC2     || 
+                 type == GRID_SINUSOIDAL || type == GRID_LAEA )
+	      {
+		xfirst = gridInqXval(gridID, 0);
+		xinc   = gridInqXinc(gridID);
+	      }
+
+	    if ( IS_NOT_EQUAL(xinc, 0) && opt )
+	      {
+	  	fprintf(fp, "xfirst    = %g\n", xfirst);
+		fprintf(fp, "xinc      = %g\n", xinc);
+	      }
+	    else
+	      {
+		nbyte0 = fprintf(fp, "xvals     = ");
+		nbyte = nbyte0;
+		for ( i = 0; i < xdim; i++ )
+		  {
+		    if ( nbyte > 80 )
+		      {
+			fprintf(fp, "\n");
+			fprintf(fp, "%*s", nbyte0, "");
+			nbyte = nbyte0;
+		      }
+		    nbyte += fprintf(fp, "%.9g ", xvals[i]);
+		  }
+		fprintf(fp, "\n");
+	      }
+	  }
+
+	if ( xbounds )
+	  {
+	    nbyte0 = fprintf(fp, "xbounds   = ");
+	    for ( i = 0; i < xdim; i++ )
+	      {
+		if ( i ) fprintf(fp, "%*s", nbyte0, "");
+
+		for ( iv = 0; iv < nvertex; iv++ )
+		  fprintf(fp, "%.9g ", xbounds[i*nvertex+iv]);
+		fprintf(fp, "\n");
+	      }
+	  }
+
+	if ( yvals )
+	  {
+	    double yfirst = 0.0, yinc = 0.0;
+
+	    if ( type == GRID_LONLAT || type == GRID_GENERIC || type == GRID_LCC2 ||
+		 type == GRID_SINUSOIDAL || type == GRID_LAEA )
+	      {
+		yfirst = gridInqYval(gridID, 0);
+		yinc   = gridInqYinc(gridID);
+	      }
+
+	    if ( IS_NOT_EQUAL(yinc, 0) && opt )
+	      {
+	  	fprintf(fp, "yfirst    = %g\n", yfirst);
+		fprintf(fp, "yinc      = %g\n", yinc);
+	      }
+	    else
+	      {
+		nbyte0 = fprintf(fp, "yvals     = ");
+		nbyte = nbyte0;
+		for ( i = 0; i < ydim; i++ )
+		  {
+		    if ( nbyte > 80 )
+		      {
+			fprintf(fp, "\n");
+			fprintf(fp, "%*s", nbyte0, "");
+			nbyte = nbyte0;
+		      }
+		    nbyte += fprintf(fp, "%.9g ", yvals[i]);
+		  }
+		fprintf(fp, "\n");
+	      }
+	  }
+
+	if ( ybounds )
+	  {
+	    nbyte0 = fprintf(fp, "ybounds   = ");
+	    for ( i = 0; i < ydim; i++ )
+	      {
+		if ( i ) fprintf(fp, "%*s", nbyte0, "");
+
+		for ( iv = 0; iv < nvertex; iv++ )
+		  fprintf(fp, "%.9g ", ybounds[i*nvertex+iv]);
+		fprintf(fp, "\n");
+	      }
+	  }
+
+	if ( area )
+	  {
+	    nbyte0 = fprintf(fp, "area      = ");
+	    nbyte  = nbyte0;
+	    for ( i = 0; i < gridsize; i++ )
+	      {
+		if ( nbyte > 80 )
+		  {
+		    fprintf(fp, "\n");
+		    fprintf(fp, "%*s", nbyte0, "");
+		    nbyte = nbyte0;
+		  }
+		nbyte += fprintf(fp, "%.9g ", area[i]);
+	      }
+	    fprintf(fp, "\n");
+	  }
+	break;
+      }
+   case GRID_GAUSSIAN_REDUCED:
+      {
+	int *rowlon;
+	fprintf(fp, "ysize = %d\n", ysize);
+	nbyte0 = fprintf(fp, "rowlon = %d  ", ysize);
+	nbyte  = nbyte0;
+	rowlon = (int *) malloc(ysize*sizeof(int));
+	gridInqRowlon(gridID, rowlon);
+	for ( i = 0; i < ysize; i++ )
+	  {
+	    if ( nbyte > 80 )
+	      {
+		fprintf(fp, "\n");
+		fprintf(fp, "%*s", nbyte0, "");
+		nbyte = nbyte0;
+	      }
+	    nbyte += fprintf(fp, "%d ", rowlon[i]);
+	  }
+	fprintf(fp, "\n");
+	free(rowlon);
+	break;
+      }
+    case GRID_LCC:
+      {
+	double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
+	int projflag, scanflag;
+	gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm,
+		   &projflag, &scanflag);
+
+	fprintf(fp, "xsize     = %d\n", xsize);
+	fprintf(fp, "ysize     = %d\n", ysize);
+
+	fprintf(fp, "originLon = %g\n", originLon);
+	fprintf(fp, "originLat = %g\n", originLat);
+	fprintf(fp, "lonParY   = %g\n", lonParY);
+	fprintf(fp, "lat1      = %g\n", lat1);
+	fprintf(fp, "lat2      = %g\n", lat2);
+	fprintf(fp, "xinc      = %g\n", xincm);
+	fprintf(fp, "yinc      = %g\n", yincm);
+	if ( (projflag & 128) == 0 )
+	  fprintf(fp, "projection = northpole\n");
+	else
+	  fprintf(fp, "projection = southpole\n");
+
+	break;
+      }
+    case GRID_SPECTRAL:
+      {
+        fprintf(fp, "truncation = %d\n", trunc);
+        fprintf(fp, "complexpacking = %d\n", gridptr->lcomplex );
+        break;
+      }
+    case GRID_FOURIER:
+      {
+	fprintf(fp, "truncation = %d\n", trunc);
+	break;
+      }
+    case GRID_GME:
+      {
+        fprintf(fp, "ni        = %d\n", gridptr->ni );
+        break;
+      }
+    case GRID_REFERENCE:
+      {
+        const unsigned char *d;
+	fprintf(fp, "number    = %d\n", gridInqNumber(gridID));
+	fprintf(fp, "position  = %d\n", gridInqPosition(gridID));
+        gridInqUUID(gridID, uuid);
+        d = (unsigned char *) &uuid;
+	fprintf(fp, "uuid      = %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n", 
+                d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7],
+                d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]);
+	if ( gridInqReference(gridID, NULL) )
+	  {
+	    char reference_link[8192];
+	    gridInqReference(gridID, reference_link);
+	    fprintf(fp, "path      = %s\n", reference_link);
+	  }
+	break;
+      }
+   default:
+      {
+	fprintf(stderr, "Unsupported grid type: %s\n", gridNamePtr(type));
+      }
+    }
+
+  if ( gridptr->mask )
+    {
+      nbyte0 = fprintf(fp, "mask      = ");
+      nbyte  = nbyte0;
+      for ( i = 0; i < gridsize; i++ )
+        {
+          if ( nbyte > 80 )
+            {
+              fprintf(fp, "\n");
+              fprintf(fp, "%*s", nbyte0, "");
+              nbyte = nbyte0;
+            }
+          nbyte += fprintf(fp, "%d ", (int) gridptr->mask[i]);
+        }
+      fprintf(fp, "\n");
+    }
+}
+
+void gridPrint ( int gridID, int opt )
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridPrintKernel ( gridptr, opt, stdout );
+}
+
+
+
+void gridPrintP ( void * voidptr, FILE * fp )
+{
+  grid_t * gridptr = ( grid_t * ) voidptr;
+  int nbyte0, nbyte, i;
+
+  xassert ( gridptr );
+
+  gridPrintKernel ( gridptr , 0, fp );
+
+  fprintf ( fp, "precision = %d\n", gridptr->prec);
+  fprintf ( fp, "nd        = %d\n", gridptr->nd );
+  fprintf ( fp, "ni        = %d\n", gridptr->ni );
+  fprintf ( fp, "ni2       = %d\n", gridptr->ni2 );
+  fprintf ( fp, "ni3       = %d\n", gridptr->ni3 ); 
+  fprintf ( fp, "number    = %d\n", gridptr->number );
+  fprintf ( fp, "position  = %d\n", gridptr->position );
+  fprintf ( fp, "trunc     = %d\n", gridptr->trunc );
+  fprintf ( fp, "lcomplex  = %d\n", gridptr->lcomplex );
+  fprintf ( fp, "nrowlon   = %d\n", gridptr->nrowlon );
+
+  if ( gridptr->rowlon )
+    {
+      nbyte0 = fprintf(fp, "rowlon    = ");
+      nbyte  = nbyte0;
+      for ( i = 0; i < gridptr->nrowlon; i++ )
+        {
+          if ( nbyte > 80 )
+            {
+              fprintf(fp, "\n");
+              fprintf(fp, "%*s", nbyte0, "");
+              nbyte = nbyte0;
+            }
+          nbyte += fprintf(fp, "%d ", gridptr->rowlon[i]);
+        }
+      fprintf(fp, "\n");
+    }
+
+  if ( gridptr->mask_gme )
+    {
+      nbyte0 = fprintf(fp, "mask_gme  = ");
+      nbyte  = nbyte0;
+      for ( i = 0; i < gridptr->size; i++ )
+        {
+          if ( nbyte > 80 )
+            {
+              fprintf(fp, "\n");
+              fprintf(fp, "%*s", nbyte0, "");
+              nbyte = nbyte0;
+            }
+          nbyte += fprintf(fp, "%d ", (int) gridptr->mask_gme[i]);
+        }
+      fprintf(fp, "\n");
+    }
+}
+
+
+const double *gridInqXvalsPtr(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return ( gridptr->xvals );
+}
+
+
+const double *gridInqYvalsPtr(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return ( gridptr->yvals );
+}
+
+/*
+ at Function  gridDefLCC
+ at Title     Define the parameter of a Lambert Conformal Conic grid
+
+ at Prototype void gridDefLCC(int gridID, double originLon, double originLat, double lonParY, double lat1, double lat2, double xinc, double yinc, int projflag, int scanflag)
+ at Parameter
+    @Item  gridID    Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  originLon Longitude of the first grid point.
+    @Item  originLat Latitude of the first grid point.
+    @Item  lonParY   The East longitude of the meridian which is parallel to the Y-axis.
+    @Item  lat1      First latitude from the pole at which the secant cone cuts the sphere.
+    @Item  lat2      Second latitude at which the secant cone cuts the sphere.
+    @Item  xinc      X-direction grid lenght in meter.
+    @Item  yinc      Y-direction grid lenght in meter.
+    @Item  projflag  Projection centre flag.
+    @Item  scanflag  Scanning mode flag.
+ 
+ at Description
+The function @func{gridDefLCC} defines the parameter of a Lambert Conformal Conic grid.
+
+ at EndFunction
+*/
+void gridDefLCC(int gridID, double originLon, double originLat, double lonParY,
+                double lat1, double lat2, double xinc, double yinc,
+                int projflag, int scanflag)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LCC )
+    Warning("Definition of LCC grid for %s grid not allowed!",
+	    gridNamePtr(gridptr->type));
+  else
+    {
+      gridptr->lcc_originLon = originLon;
+      gridptr->lcc_originLat = originLat;
+      gridptr->lcc_lonParY   = lonParY;
+      gridptr->lcc_lat1      = lat1;
+      gridptr->lcc_lat2      = lat2;
+      gridptr->lcc_xinc      = xinc;
+      gridptr->lcc_yinc      = yinc;
+      gridptr->lcc_projflag  = projflag;
+      gridptr->lcc_scanflag  = scanflag;
+      gridptr->lcc_defined   = TRUE;
+    }
+}
+
+/*
+ at Function  gridInqLCC
+ at Title     Get the parameter of a Lambert Conformal Conic grid
+
+ at Prototype void gridInqLCC(int gridID, double *originLon, double *originLat, double *lonParY, double *lat1, double *lat2, double *xinc, double *yinc, int *projflag, int *scanflag)
+ at Parameter
+    @Item  gridID    Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  originLon Longitude of the first grid point.
+    @Item  originLat Latitude of the first grid point.
+    @Item  lonParY   The East longitude of the meridian which is parallel to the Y-axis.
+    @Item  lat1      First latitude from the pole at which the secant cone cuts the sphere.
+    @Item  lat2      Second latitude at which the secant cone cuts the sphere.
+    @Item  xinc      X-direction grid lenght in meter.
+    @Item  yinc      Y-direction grid lenght in meter.
+    @Item  projflag  Projection centre flag.
+    @Item  scanflag  Scanning mode flag.
+ 
+ at Description
+The function @func{gridInqLCC} returns the parameter of a Lambert Conformal Conic grid.
+
+ at EndFunction
+*/
+void gridInqLCC(int gridID, double *originLon, double *originLat, double *lonParY,
+                double *lat1, double *lat2, double *xinc, double *yinc,
+                int *projflag, int *scanflag)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LCC )
+    Warning("Inquire of LCC grid definition for %s grid not allowed!",
+	    gridNamePtr(gridptr->type));
+  else
+    {
+      if ( gridptr->lcc_defined )
+        {
+          *originLon = gridptr->lcc_originLon;
+          *originLat = gridptr->lcc_originLat;
+          *lonParY   = gridptr->lcc_lonParY;
+          *lat1      = gridptr->lcc_lat1;
+          *lat2      = gridptr->lcc_lat2;
+          *xinc      = gridptr->lcc_xinc;
+          *yinc      = gridptr->lcc_yinc;
+          *projflag  = gridptr->lcc_projflag;
+          *scanflag  = gridptr->lcc_scanflag;
+        }
+      else
+	Warning("Lambert Conformal grid undefined (gridID = %d)", gridID);
+    }
+}
+
+void gridDefLcc2(int gridID, double earth_radius, double lon_0, double lat_0, double lat_1, double lat_2)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LCC2 )
+    Warning("Definition of LCC2 grid for %s grid not allowed!",
+	    gridNamePtr(gridptr->type));
+  else
+    {
+      gridptr->lcc2_a       = earth_radius;
+      gridptr->lcc2_lon_0   = lon_0;
+      gridptr->lcc2_lat_0   = lat_0;
+      gridptr->lcc2_lat_1   = lat_1;
+      gridptr->lcc2_lat_2   = lat_2;
+      gridptr->lcc2_defined = TRUE;
+    }
+}
+
+
+void gridInqLcc2(int gridID, double *earth_radius, double *lon_0, double *lat_0, double *lat_1, double *lat_2)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LCC2 )
+    Warning("Inquire of LCC2 grid definition for %s grid not allowed!",
+	    gridNamePtr(gridptr->type));
+  else
+    {
+      if ( gridptr->lcc2_defined )
+        {
+          *earth_radius = gridptr->lcc2_a;
+          *lon_0        = gridptr->lcc2_lon_0;
+          *lat_0        = gridptr->lcc2_lat_0;
+          *lat_1        = gridptr->lcc2_lat_1;
+          *lat_2        = gridptr->lcc2_lat_2;
+        }
+      else
+        Warning("LCC2 grid undefined (gridID = %d)", gridID);
+    }
+}
+
+void gridDefLaea(int gridID, double earth_radius, double lon_0, double lat_0)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LAEA )
+    Warning("Definition of LAEA grid for %s grid not allowed!",
+            gridNamePtr(gridptr->type));
+  else
+    {
+      gridptr->laea_a       = earth_radius;
+      gridptr->laea_lon_0   = lon_0;
+      gridptr->laea_lat_0   = lat_0;
+      gridptr->laea_defined = TRUE;
+    }
+}
+
+
+void gridInqLaea(int gridID, double *earth_radius, double *lon_0, double *lat_0)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LAEA )
+    Warning("Inquire of LAEA grid definition for %s grid not allowed!",
+            gridNamePtr(gridptr->type));
+  else
+    {
+      if ( gridptr->laea_defined )
+        {
+          *earth_radius = gridptr->laea_a;
+          *lon_0        = gridptr->laea_lon_0;
+          *lat_0        = gridptr->laea_lat_0;
+        }
+      else
+        Warning("LAEA grid undefined (gridID = %d)", gridID);
+    }
+}
+
+
+void gridDefComplexPacking(int gridID, int lcomplex)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->lcomplex = lcomplex;
+}
+
+
+int gridInqComplexPacking(int gridID)
+{
+  int lcomplex;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  lcomplex = gridptr->lcomplex;
+
+  return (lcomplex);
+}
+
+
+int gridInqNumber(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->number);
+}
+
+
+void gridDefNumber(int gridID, int number)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->number = number;
+}
+
+
+int gridInqPosition(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->position);
+}
+
+
+void gridDefPosition(int gridID, int position)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->position = position;
+}
+
+
+int gridInqReference(int gridID, char *reference)
+{
+  grid_t *gridptr;
+  int len = 0;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->reference )
+    {
+      len = (int) strlen(gridptr->reference);
+
+      if ( reference )
+        strcpy(reference, gridptr->reference);
+    }
+
+  return (len);
+}
+
+
+void gridDefReference(int gridID, const char *reference)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( reference )
+    {
+      if ( gridptr->reference )
+        {
+          free(gridptr->reference);
+          gridptr->reference = NULL;
+        }
+
+      gridptr->reference = strdupx(reference);
+    }
+}
+
+
+void gridGetIndexList ( int ngrids, int * gridIndexList )
+{
+  reshGetResHListOfType ( ngrids, gridIndexList, &gridOps );
+}
+
+char *gridInqUUID(int gridID, char *uuid)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strncpy(uuid, gridptr->uuid, 16);
+
+  return (uuid);
+}
+
+
+void gridDefUUID(int gridID, const char *uuid)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strncpy(gridptr->uuid, uuid, 16);
+
+  return;
+}
+
+
+#ifdef USE_MPI
+
+static int
+gridTxCode ()
+{
+  return GRID;
+}
+
+enum { gridNint    = 26, 
+       gridNdouble = 24,
+       gridNstrings= 8,
+       mask        = 1 << 0,
+       mask_gme    = 1 << 1,
+       xvals       = 1 << 2,
+       yvals       = 1 << 3,
+       area        = 1 << 4,
+       xbounds     = 1 << 5,
+       ybounds     = 1 << 6,
+       reference   = 1 << 7,
+       rowlon      = 1 << 8
+};
+
+
+static int getMemberMask ( grid_t * gridP )
+{
+  int memberMask = 0;
+
+  if ( gridP->mask )       memberMask |= mask;
+  if ( gridP->mask_gme )   memberMask |= mask_gme;
+  if ( gridP->xvals )      memberMask |= xvals;
+  if ( gridP->yvals )      memberMask |= yvals; 
+  if ( gridP->area )       memberMask |= area;
+  if ( gridP->xbounds )    memberMask |= xbounds;
+  if ( gridP->ybounds )    memberMask |= ybounds;
+  if ( gridP->reference )  memberMask |= reference;
+  if ( gridP->rowlon )     memberMask |= rowlon;
+
+  return memberMask;
+}
+
+
+static
+int gridGetPackSize ( void * voidP, MPI_Comm comm )
+{
+  grid_t * gridP = ( grid_t * ) voidP;
+  int packBuffSize = 0, size, count;
+
+  xmpi ( MPI_Pack_size ( gridNint + 1, MPI_INT, comm, &size ));
+  packBuffSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBuffSize += size;
+
+  if ( gridP->rowlon )
+    {
+      xassert ( gridP->nrowlon );
+
+      xmpi ( MPI_Pack_size ( gridP->nrowlon, MPI_INT, comm, &size ));
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }  
+
+  xmpi ( MPI_Pack_size ( gridNdouble + 1, MPI_DOUBLE, comm, &size ));
+  packBuffSize += size;  
+
+  if ( gridP->xvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	count =  gridP->size;
+      else
+	count =  gridP->xsize;
+      xassert ( count );
+      
+      xmpi ( MPI_Pack_size ( count, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  if ( gridP->yvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	count =  gridP->size;
+      else
+	count =  gridP->ysize;
+      xassert ( count );
+      
+      xmpi ( MPI_Pack_size ( count, MPI_DOUBLE, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  if ( gridP->area )
+    {
+      xassert ( gridP->size );
+      
+      xmpi ( MPI_Pack_size ( gridP->size, MPI_DOUBLE, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  if ( gridP->xbounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	count = gridP->nvertex * gridP->size;
+      else
+	count = gridP->nvertex * gridP->xsize;
+      xassert ( count );
+      
+      xmpi ( MPI_Pack_size ( count, MPI_DOUBLE, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  if ( gridP->ybounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	count = gridP->nvertex * gridP->size;
+      else
+	count = gridP->nvertex * gridP->ysize;
+      xassert ( count );
+      
+      xmpi ( MPI_Pack_size ( count, MPI_DOUBLE, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  xmpi ( MPI_Pack_size ( gridNstrings * CDI_MAX_NAME , MPI_CHAR, comm, &size ));
+  packBuffSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBuffSize += size;
+
+  if ( gridP->reference )
+    {
+      count = strlen ( gridP->reference ) + 1;
+      xmpi ( MPI_Pack_size ( 1, MPI_INT, comm, &size ));
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( count, MPI_CHAR, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+ 
+  if ( gridP->mask )
+    {
+      xassert ( gridP->size );
+      xmpi ( MPI_Pack_size ( gridP->size, MPI_UNSIGNED_CHAR, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  if ( gridP->mask_gme )
+    {
+      xassert ( gridP->size );
+      xmpi ( MPI_Pack_size ( gridP->size, MPI_UNSIGNED_CHAR, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+  
+  return packBuffSize; 
+}
+
+
+void gridUnpack ( char * unpackBuffer, int unpackBufferSize, 
+		  int * unpackBufferPos, int nspTarget, MPI_Comm comm )
+{
+  grid_t * gridP;
+  int intBuffer[gridNint + 1], memberMask, size, referenceSize;
+  double doubleBuffer[gridNdouble + 1], d;
+  char charBuffer[gridNstrings * CDI_MAX_NAME];
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      intBuffer, gridNint + 1, MPI_INT, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      &d, 1, MPI_DOUBLE, comm ));
+
+  xassert ( xchecksum ( DATATYPE_INT , gridNint + 1, intBuffer ) == d );
+
+  gridInit ();
+
+  gridP = gridNewEntry();
+  xassert ( gridP );
+
+  xassert ( namespaceAdaptKey ( intBuffer[0], nspTarget ) == gridP->self );
+
+  gridP->type          =   intBuffer[1] ;
+  gridP->prec          =   intBuffer[2] ;
+  gridP->lcc_projflag  =   intBuffer[3] ;
+  gridP->lcc_scanflag  =   intBuffer[4] ;
+  gridP->lcc_defined   =   intBuffer[5] ;
+  gridP->lcc2_defined  =   intBuffer[6] ;
+  gridP->laea_defined  =   intBuffer[7] ;
+  gridP->isCyclic      =   intBuffer[8] ;
+  gridP->isRotated     =   intBuffer[9] ;
+  gridP->xdef          =   intBuffer[10] ;
+  gridP->ydef          =   intBuffer[11];
+  gridP->nd            =   intBuffer[12];
+  gridP->ni            =   intBuffer[13];
+  gridP->ni2           =   intBuffer[14];
+  gridP->ni3           =   intBuffer[15];
+  gridP->number        =   intBuffer[16];
+  gridP->position      =   intBuffer[17];
+  gridP->trunc         =   intBuffer[18];
+  gridP->nvertex       =   intBuffer[19];
+  gridP->nrowlon       =   intBuffer[20];
+  gridP->size          =   intBuffer[21];
+  gridP->xsize         =   intBuffer[22];
+  gridP->ysize         =   intBuffer[23];
+  gridP->locked        =   intBuffer[24];
+  gridP->lcomplex      =   intBuffer[25];
+  memberMask           =   intBuffer[26];
+
+  if ( memberMask & rowlon )
+    {
+      xassert ( gridP->nrowlon );
+      gridP->rowlon = xmalloc ( gridP->nrowlon * sizeof ( int ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			gridP->rowlon, gridP->nrowlon , MPI_INT, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_INT , gridP->nrowlon, gridP->rowlon ) == d );
+    } 
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      doubleBuffer, gridNdouble + 1, MPI_DOUBLE, comm ));
+
+  xassert ( doubleBuffer[24] == xchecksum ( DATATYPE_FLT, gridNdouble, 
+                                            doubleBuffer ));
+
+  gridP->xfirst        =   doubleBuffer[0] ;       
+  gridP->yfirst	       =   doubleBuffer[1] ;
+  gridP->xlast	       =   doubleBuffer[2] ;
+  gridP->ylast	       =   doubleBuffer[3] ;
+  gridP->xinc	       =   doubleBuffer[4] ;
+  gridP->yinc	       =   doubleBuffer[5] ;
+  gridP->lcc_originLon =   doubleBuffer[6] ;         
+  gridP->lcc_originLat =   doubleBuffer[7] ;
+  gridP->lcc_lonParY   =   doubleBuffer[8] ;
+  gridP->lcc_lat1      =   doubleBuffer[9] ;
+  gridP->lcc_lat2      =   doubleBuffer[10];
+  gridP->lcc_xinc      =   doubleBuffer[11];
+  gridP->lcc_yinc      =   doubleBuffer[12];
+  gridP->lcc2_lon_0    =   doubleBuffer[13];         
+  gridP->lcc2_lat_0    =   doubleBuffer[14];
+  gridP->lcc2_lat_1    =   doubleBuffer[15];
+  gridP->lcc2_lat_2    =   doubleBuffer[16];
+  gridP->lcc2_a	       =   doubleBuffer[17];
+  gridP->laea_lon_0    =   doubleBuffer[18];         
+  gridP->laea_lat_0    =   doubleBuffer[19];
+  gridP->laea_a	       =   doubleBuffer[20];
+  gridP->xpole 	       =   doubleBuffer[21];
+  gridP->ypole	       =   doubleBuffer[22];
+  gridP->angle         =   doubleBuffer[23]; 
+
+  if ( memberMask & xvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	size = gridP->size;
+      else
+	size = gridP->xsize;
+      
+      gridP->xvals =  xmalloc( size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->xvals, size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, size, gridP->xvals ) == d );
+    }
+
+  if ( memberMask & yvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	size = gridP->size;
+      else
+	size = gridP->ysize;
+      
+      gridP->yvals =  xmalloc( size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->yvals, size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, size, gridP->yvals ) == d );
+    }
+
+  if ( memberMask & area )
+    {
+      xassert ( gridP->size );
+      
+      gridP->area =  xmalloc( gridP->size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->area, gridP->size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, gridP->size, gridP->area ) == d );
+    }
+
+  if ( memberMask & xbounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	size = gridP->nvertex * gridP->size;
+      else
+	size = gridP->nvertex * gridP->xsize;
+      xassert ( size );
+      
+      gridP->xbounds =  xmalloc( size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->xbounds, size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, size, gridP->xbounds ) == d );
+    }
+
+  if ( memberMask & ybounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	size = gridP->nvertex * gridP->size;
+      else
+	size = gridP->nvertex * gridP->ysize;
+      xassert ( size );
+      
+      gridP->ybounds =  xmalloc( size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->ybounds, size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, size, gridP->ybounds ) == d );
+    }
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      charBuffer, gridNstrings * CDI_MAX_NAME, MPI_CHAR, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      &d, 1, MPI_DOUBLE, comm ));
+
+  xassert ( d == xchecksum ( DATATYPE_TXT, gridNstrings * CDI_MAX_NAME, 
+                             charBuffer ));
+
+  memcpy ( gridP->xname    , &charBuffer[CDI_MAX_NAME * 0], CDI_MAX_NAME );
+  memcpy ( gridP->yname    , &charBuffer[CDI_MAX_NAME * 1], CDI_MAX_NAME );
+  memcpy ( gridP->xlongname, &charBuffer[CDI_MAX_NAME * 2], CDI_MAX_NAME );
+  memcpy ( gridP->ylongname, &charBuffer[CDI_MAX_NAME * 3], CDI_MAX_NAME );
+  memcpy ( gridP->xstdname , &charBuffer[CDI_MAX_NAME * 4], CDI_MAX_NAME );
+  memcpy ( gridP->ystdname , &charBuffer[CDI_MAX_NAME * 5], CDI_MAX_NAME );
+  memcpy ( gridP->xunits   , &charBuffer[CDI_MAX_NAME * 6], CDI_MAX_NAME );
+  memcpy ( gridP->yunits   , &charBuffer[CDI_MAX_NAME * 7], CDI_MAX_NAME );
+
+  if ( memberMask & reference )
+    {
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &referenceSize, 1, MPI_INT, comm ));
+      gridP->reference = xmalloc ( referenceSize );
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->reference, referenceSize, MPI_CHAR, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_TXT, referenceSize, 
+                            gridP->reference ) == d );
+    }
+
+  if ( memberMask & mask )
+    {
+      xassert ( gridP->size );
+      gridP->mask = xmalloc ( gridP->size * sizeof ( mask_t ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->mask, gridP->size, MPI_UNSIGNED_CHAR, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_TXT, gridP->size, gridP->mask ) == d );
+    }
+
+  if ( memberMask & mask_gme )
+    {
+      xassert ( gridP->size );
+      gridP->mask_gme = xmalloc ( gridP->size * sizeof ( mask_t ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->mask_gme, gridP->size, MPI_UNSIGNED_CHAR, 
+                          comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_TXT, gridP->size, gridP->mask_gme ) == d );
+    }
+} 							       
+
+
+static
+void gridPack ( void * voidP, void * packBuffer, int packBufferSize, 
+		int * packBufferPos, MPI_Comm comm )
+{
+  grid_t   * gridP = ( grid_t * )   voidP;
+  int intBuffer[gridNint + 1], size;
+  double doubleBuffer[gridNdouble + 1], d;
+  char charBuffer[gridNstrings * CDI_MAX_NAME];
+
+  intBuffer[0]  = gridP->self;
+  intBuffer[1]  = gridP->type;
+  intBuffer[2]  = gridP->prec;
+  intBuffer[3]  = gridP->lcc_projflag;
+  intBuffer[4]  = gridP->lcc_scanflag;
+  intBuffer[5]  = gridP->lcc_defined;
+  intBuffer[6]  = gridP->lcc2_defined;
+  intBuffer[7]  = gridP->laea_defined;
+  intBuffer[8]  = gridP->isCyclic;
+  intBuffer[9]  = gridP->isRotated; 
+  intBuffer[10] = gridP->xdef; 
+  intBuffer[11] = gridP->ydef;
+  intBuffer[12] = gridP->nd;
+  intBuffer[13] = gridP->ni;
+  intBuffer[14] = gridP->ni2;
+  intBuffer[15] = gridP->ni3; 
+  intBuffer[16] = gridP->number;
+  intBuffer[17] = gridP->position;
+  intBuffer[18] = gridP->trunc;
+  intBuffer[19] = gridP->nvertex;
+  intBuffer[20] = gridP->nrowlon;
+  intBuffer[21] = gridP->size;
+  intBuffer[22] = gridP->xsize;
+  intBuffer[23] = gridP->ysize;
+  intBuffer[24] = gridP->locked;
+  intBuffer[25] = gridP->lcomplex;
+  intBuffer[26] = getMemberMask ( gridP );
+  
+  xmpi ( MPI_Pack ( intBuffer, gridNint + 1, MPI_INT, 
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+  d = xchecksum ( DATATYPE_INT , gridNint + 1, intBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  if ( gridP->rowlon )
+    {
+      xassert ( gridP->nrowlon );
+      xmpi ( MPI_Pack ( gridP->rowlon, gridP->nrowlon, MPI_INT,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_INT , gridP->nrowlon, gridP->rowlon );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }  
+
+  doubleBuffer[0]  = gridP->xfirst;         
+  doubleBuffer[1]  = gridP->yfirst;
+  doubleBuffer[2]  = gridP->xlast;
+  doubleBuffer[3]  = gridP->ylast;
+  doubleBuffer[4]  = gridP->xinc;
+  doubleBuffer[5]  = gridP->yinc;
+  doubleBuffer[6]  = gridP->lcc_originLon;          
+  doubleBuffer[7]  = gridP->lcc_originLat;
+  doubleBuffer[8]  = gridP->lcc_lonParY;
+  doubleBuffer[9]  = gridP->lcc_lat1;
+  doubleBuffer[10] = gridP->lcc_lat2;
+  doubleBuffer[11] = gridP->lcc_xinc;
+  doubleBuffer[12] = gridP->lcc_yinc;
+  doubleBuffer[13] = gridP->lcc2_lon_0;             
+  doubleBuffer[14] = gridP->lcc2_lat_0;
+  doubleBuffer[15] = gridP->lcc2_lat_1;
+  doubleBuffer[16] = gridP->lcc2_lat_2;
+  doubleBuffer[17] = gridP->lcc2_a;
+  doubleBuffer[18] = gridP->laea_lon_0;             
+  doubleBuffer[19] = gridP->laea_lat_0;
+  doubleBuffer[20] = gridP->laea_a;
+  doubleBuffer[21] = gridP->xpole; 
+  doubleBuffer[22] = gridP->ypole;
+  doubleBuffer[23] = gridP->angle;
+  doubleBuffer[24] = xchecksum ( DATATYPE_FLT, gridNdouble - 1, doubleBuffer );
+
+  xmpi ( MPI_Pack ( doubleBuffer, gridNdouble + 1, MPI_DOUBLE, 
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  if ( gridP->xvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	size = gridP->size;
+      else
+	size = gridP->xsize;
+      xassert ( size );
+      
+      xmpi ( MPI_Pack ( gridP->xvals, size, MPI_DOUBLE, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, size, gridP->xvals );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( gridP->yvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	size = gridP->size;
+      else
+	size = gridP->ysize;
+      xassert ( size );
+      
+      xmpi ( MPI_Pack ( gridP->yvals, size, MPI_DOUBLE, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, size, gridP->yvals );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( gridP->area )
+    {
+      xassert ( gridP->size );
+
+      xmpi ( MPI_Pack ( gridP->area, gridP->size, MPI_DOUBLE, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, gridP->size, gridP->area );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( gridP->xbounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	size = gridP->nvertex * gridP->size;
+      else
+	size = gridP->nvertex * gridP->xsize;
+      xassert ( size );
+
+      xmpi ( MPI_Pack ( gridP->xbounds, size, MPI_DOUBLE, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, size, gridP->xbounds );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( gridP->ybounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	size = gridP->nvertex * gridP->size;
+      else
+	size = gridP->nvertex * gridP->ysize;
+      xassert ( size );
+
+      xmpi ( MPI_Pack ( gridP->ybounds, size, MPI_DOUBLE, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, size, gridP->ybounds );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  memcpy ( &charBuffer[CDI_MAX_NAME * 0], gridP->xname,     CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 1], gridP->yname,     CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 2], gridP->xlongname, CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 3], gridP->ylongname, CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 4], gridP->xstdname,  CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 5], gridP->ystdname,  CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 6], gridP->xunits,    CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 7], gridP->yunits,    CDI_MAX_NAME );
+
+  xmpi ( MPI_Pack ( charBuffer, gridNstrings * CDI_MAX_NAME, MPI_CHAR, 
+		    packBuffer, packBufferSize, packBufferPos, comm )); 
+  d = xchecksum  ( DATATYPE_TXT, gridNstrings * CDI_MAX_NAME, charBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  if ( gridP->reference )
+    {
+      size = strlen ( gridP->reference ) + 1;
+      xmpi ( MPI_Pack ( &size, 1, MPI_INT, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      xmpi ( MPI_Pack ( gridP->reference, size, MPI_CHAR, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_TXT, size, gridP->reference );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm )); 
+    }
+ 
+  if ( gridP->mask )
+    {
+      xassert ( gridP->size );
+      xmpi ( MPI_Pack ( gridP->mask, gridP->size, MPI_UNSIGNED_CHAR, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_TXT, gridP->size, gridP->mask );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm )); 
+    }
+
+  if ( gridP->mask_gme )
+    {
+      xassert ( gridP->size );
+
+      xmpi ( MPI_Pack ( gridP->mask_gme, gridP->size, MPI_UNSIGNED_CHAR, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_TXT, gridP->size, gridP->mask );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm )); 
+    }
+}
+
+#endif
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <string.h>
+#include <math.h>
+#include <float.h>
+
+
+
+#define  LevelUp    1
+#define  LevelDown  2
+
+
+static struct {
+  unsigned char positive;
+  char *name;
+  char *longname;
+  char *stdname;
+  char *units;    // 1: up;  2: down
+}
+ZaxistypeEntry[] = {
+  { /*  0 */ 0, "sfc",        "surface",           "",               ""},
+  { /*  1 */ 0, "lev",        "generic",           "",               "level"},
+  { /*  2 */ 2, "lev",        "hybrid",            "",               "level"},
+  { /*  3 */ 2, "lev",        "hybrid_half",       "",               "level"},
+  { /*  4 */ 2, "lev",        "pressure",          "air_pressure",   "Pa"},
+  { /*  5 */ 1, "height",     "height",            "height",         "m"},
+  { /*  6 */ 2, "depth",      "depth_below_sea",   "depth",          "m"},
+  { /*  7 */ 2, "depth",      "depth_below_land",  "",               "cm"},
+  { /*  8 */ 0, "lev",        "isentropic",        "",               "K"},
+  { /*  9 */ 0, "lev",        "trajectory",        "",               ""},
+  { /* 10 */ 1, "alt",        "altitude",          "",               "m"},
+  { /* 11 */ 0, "lev",        "sigma",             "",               "level"},
+  { /* 12 */ 0, "lev",        "meansea",           "",               "level"},
+  { /* 13 */ 0, "toa",        "top_of_atmosphere", "",               ""},
+  { /* 14 */ 0, "seabottom",  "sea_bottom",        "",               ""},
+  { /* 15 */ 0, "atmosphere", "atmosphere",        "",               ""},
+  { /* 16 */ 0, "height",     "generalized height","height",         "m"},
+};
+
+static int CDI_MaxZaxistype = sizeof(ZaxistypeEntry) / sizeof(ZaxistypeEntry[0]);
+
+
+typedef struct {
+  unsigned char positive;
+  char     name[CDI_MAX_NAME];
+  char     longname[CDI_MAX_NAME];
+  char     stdname[CDI_MAX_NAME];
+  char     units[CDI_MAX_NAME];
+  double  *vals;
+  double  *lbounds;
+  double  *ubounds;
+  double  *weights;
+  int      self;
+  int      prec;
+  int      type;
+  int      ltype;    /* GRIB level type */
+  int      size;
+  int      direction;
+  int      vctsize;
+  double  *vct;
+  int      reference;
+  char     uuid[17];
+}
+zaxis_t;
+
+static int    zaxisCompareP    ( void * zaxisptr1, void * zaxisptr2 );
+static void   zaxisDestroyP    ( void * zaxisptr );
+static void   zaxisPrintP      ( void * zaxisptr, FILE * fp );
+#ifdef USE_MPI
+static int    zaxisGetPackSize ( void * zaxisptr, MPI_Comm comm );
+static void   zaxisPack        ( void * zaxisptr, void * buffer, int size,
+                                 int *pos, MPI_Comm comm);
+static int    zaxisTxCode      ( void );
+#endif
+
+resOps zaxisOps = { zaxisCompareP, zaxisDestroyP, zaxisPrintP
+#ifdef USE_MPI
+                    , zaxisGetPackSize, zaxisPack, zaxisTxCode
+#endif
+};
+
+static int  ZAXIS_Debug = 0;   /* If set to 1, debugging */
+
+static
+void zaxisDefaultValue ( zaxis_t *zaxisptr )
+{
+  zaxisptr->self        = CDI_UNDEFID;
+  zaxisptr->name[0]     = 0;
+  zaxisptr->longname[0] = 0;
+  zaxisptr->stdname[0]  = 0;
+  zaxisptr->units[0]    = 0;
+  zaxisptr->vals        = NULL;
+  zaxisptr->ubounds     = NULL;
+  zaxisptr->lbounds     = NULL;
+  zaxisptr->weights     = NULL;
+  zaxisptr->type        = CDI_UNDEFID;
+  zaxisptr->ltype       = 0;
+  zaxisptr->positive    = 0;
+  zaxisptr->direction   = 0;
+  zaxisptr->prec        = 0;
+  zaxisptr->size        = 0;
+  zaxisptr->vctsize     = 0;
+  zaxisptr->vct         = NULL;
+  zaxisptr->reference   = CDI_UNDEFID;
+  zaxisptr->uuid[0]     = 0;
+}
+
+
+static
+zaxis_t *zaxisNewEntry(void)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = (zaxis_t *) xmalloc(sizeof(zaxis_t));
+
+  zaxisDefaultValue ( zaxisptr );
+
+  zaxisptr->self = reshPut (( void * ) zaxisptr, &zaxisOps );
+
+  return (zaxisptr);
+}
+
+static
+void zaxisInit(void)
+{
+  static int zaxisInitialized = 0;
+  char *env;
+
+  if ( zaxisInitialized ) return;
+
+  zaxisInitialized = 1;
+
+  env = getenv("ZAXIS_DEBUG");
+  if ( env ) ZAXIS_Debug = atoi(env);
+}
+
+static
+void zaxis_copy(zaxis_t *zaxisptr2, zaxis_t *zaxisptr1)
+{
+  int zaxisID2;
+
+  zaxisID2 = zaxisptr2->self;
+  memcpy(zaxisptr2, zaxisptr1, sizeof(zaxis_t));
+  zaxisptr2->self = zaxisID2;
+}
+
+static
+void zaxisCheckPtr(const char *caller, int zaxisID, zaxis_t *zaxisptr)
+{
+  if ( zaxisptr == NULL )
+    Errorc("zaxis %d undefined!", zaxisID);
+}
+
+#define  zaxis_check_ptr(zaxisID, zaxisptr)  zaxisCheckPtr(__func__, zaxisID, zaxisptr)
+
+int zaxisSize(void)
+{
+  return reshCountType ( &zaxisOps );
+}
+
+
+/*
+ at Function  zaxisCreate
+ at Title     Create a vertical Z-axis
+
+ at Prototype int zaxisCreate(int zaxistype, int size)
+ at Parameter
+    @Item  zaxistype  The type of the Z-axis, one of the set of predefined CDI Z-axis types.
+                      The valid CDI Z-axis types are @func{ZAXIS_GENERIC}, @func{ZAXIS_SURFACE},
+                      @func{ZAXIS_HYBRID}, @func{ZAXIS_SIGMA}, @func{ZAXIS_PRESSURE}, @func{ZAXIS_HEIGHT},
+                      @func{ZAXIS_DEPTH_BELOW_SEA} and @func{ZAXIS_DEPTH_BELOW_LAND}.
+    @Item  size       Number of levels.
+
+ at Description
+The function @func{zaxisCreate} creates a vertical Z-axis.
+
+ at Result
+ at func{zaxisCreate} returns an identifier to the Z-axis.
+
+ at Example
+Here is an example using @func{zaxisCreate} to create a pressure level Z-axis:
+
+ at Source
+   ...
+#define  nlev    5
+   ...
+double levs[nlev] = {101300, 92500, 85000, 50000, 20000};
+int zaxisID;
+   ...
+zaxisID = zaxisCreate(ZAXIS_PRESSURE, nlev);
+zaxisDefLevels(zaxisID, levs);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int zaxisCreate(int zaxistype, int size)
+{
+  int ilev;
+  int zaxisID;
+  double *vals;
+  zaxis_t *zaxisptr;
+
+  if ( CDI_Debug )
+    Message("zaxistype: %d size: %d ", zaxistype, size);
+
+  zaxisInit ();
+
+  zaxisptr = zaxisNewEntry();
+
+  zaxisID = zaxisptr->self;
+
+  zaxisptr->type = zaxistype;
+  zaxisptr->size = size;
+
+  if ( zaxistype > CDI_MaxZaxistype )
+    Error("Internal problem! zaxistype > CDI_MaxZaxistype");
+
+  zaxisDefName(zaxisID, ZaxistypeEntry[zaxistype].name);
+  zaxisDefLongname(zaxisID, ZaxistypeEntry[zaxistype].longname);
+  zaxisDefUnits(zaxisID, ZaxistypeEntry[zaxistype].units);
+
+  if ( *ZaxistypeEntry[zaxistype].stdname )
+    strcpy(zaxisptr->stdname, ZaxistypeEntry[zaxistype].stdname);
+
+  zaxisptr->positive = ZaxistypeEntry[zaxistype].positive;
+
+  vals = (double *) malloc(size*sizeof(double));
+
+  for ( ilev = 0; ilev < size; ilev++ )
+    vals[ilev] = 0.0;
+
+  zaxisptr->vals = vals;
+
+  return (zaxisID);
+}
+
+
+void zaxisDestroyKernel( zaxis_t * zaxisptr )
+{
+  int id;
+
+  xassert ( zaxisptr );
+
+  id = zaxisptr->self;
+
+  if ( zaxisptr->vals )    free ( zaxisptr->vals );
+  if ( zaxisptr->lbounds ) free ( zaxisptr->lbounds );
+  if ( zaxisptr->ubounds ) free ( zaxisptr->ubounds );
+  if ( zaxisptr->weights ) free ( zaxisptr->weights );
+  if ( zaxisptr->vct )     free ( zaxisptr->vct );
+
+  free ( zaxisptr );
+
+  reshRemove ( id, &zaxisOps );
+}
+
+/*
+ at Function  zaxisDestroy
+ at Title     Destroy a vertical Z-axis
+
+ at Prototype void zaxisDestroy(int zaxisID)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+
+ at EndFunction
+*/
+void zaxisDestroy(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxisDestroyKernel ( zaxisptr );
+}
+
+
+static
+void zaxisDestroyP ( void * zaxisptr )
+{
+  zaxisDestroyKernel (( zaxis_t * ) zaxisptr );
+}
+
+
+char *zaxisNamePtr(int zaxistype)
+{
+  char *name;
+
+  if ( zaxistype >= 0 && zaxistype < CDI_MaxZaxistype )
+    name = ZaxistypeEntry[zaxistype].longname;
+  else
+    name = ZaxistypeEntry[ZAXIS_GENERIC].longname;
+
+  return (name);
+}
+
+
+void zaxisName(int zaxistype, char *zaxisname)
+{
+  strcpy(zaxisname, zaxisNamePtr(zaxistype));
+}
+
+/*
+ at Function  zaxisDefName
+ at Title     Define the name of a Z-axis
+
+ at Prototype void zaxisDefName(int zaxisID, const char *name)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  name     Name of the Z-axis.
+
+ at Description
+The function @func{zaxisDefName} defines the name of a Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefName(int zaxisID, const char *name)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( name )
+    strcpy(zaxisptr->name, name);
+}
+
+/*
+ at Function  zaxisDefLongname
+ at Title     Define the longname of a Z-axis
+
+ at Prototype void zaxisDefLongname(int zaxisID, const char *longname)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  longname Longname of the Z-axis.
+
+ at Description
+The function @func{zaxisDefLongname} defines the longname of a Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefLongname(int zaxisID, const char *longname)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( longname )
+    strcpy(zaxisptr->longname, longname);
+}
+
+/*
+ at Function  zaxisDefUnits
+ at Title     Define the units of a Z-axis
+
+ at Prototype void zaxisDefUnits(int zaxisID, const char *units)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  units    Units of the Z-axis.
+
+ at Description
+The function @func{zaxisDefUnits} defines the units of a Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefUnits(int zaxisID, const char *units)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( units )
+    strcpy(zaxisptr->units, units);
+}
+
+/*
+ at Function  zaxisInqName
+ at Title     Get the name of a Z-axis
+
+ at Prototype void zaxisInqName(int zaxisID, char *name)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  name     Name of the Z-axis. The caller must allocate space for the
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{zaxisInqName} returns the name of a Z-axis.
+
+ at Result
+ at func{zaxisInqName} returns the name of the Z-axis to the parameter name.
+
+ at EndFunction
+*/
+void zaxisInqName(int zaxisID, char *name)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strcpy(name, zaxisptr->name);
+}
+
+/*
+ at Function  zaxisInqLongname
+ at Title     Get the longname of a Z-axis
+
+ at Prototype void zaxisInqLongname(int zaxisID, char *longname)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  longname Longname of the Z-axis. The caller must allocate space for the
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{zaxisInqLongname} returns the longname of a Z-axis.
+
+ at Result
+ at func{zaxisInqLongname} returns the longname of the Z-axis to the parameter longname.
+
+ at EndFunction
+*/
+void zaxisInqLongname(int zaxisID, char *longname)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strcpy(longname, zaxisptr->longname);
+}
+
+/*
+ at Function  zaxisInqUnits
+ at Title     Get the units of a Z-axis
+
+ at Prototype void zaxisInqUnits(int zaxisID, char *units)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}
+    @Item  units    Units of the Z-axis. The caller must allocate space for the
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{zaxisInqUnits} returns the units of a Z-axis.
+
+ at Result
+ at func{zaxisInqUnits} returns the units of the Z-axis to the parameter units.
+
+ at EndFunction
+*/
+void zaxisInqUnits(int zaxisID, char *units)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strcpy(units, zaxisptr->units);
+}
+
+
+void zaxisInqStdname(int zaxisID, char *stdname)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strcpy(stdname, zaxisptr->stdname);
+}
+
+
+void zaxisDefPrec(int zaxisID, int prec)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxisptr->prec = prec;
+}
+
+
+int zaxisInqPrec(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->prec);
+}
+
+
+int zaxisInqPositive(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->positive);
+}
+
+
+void zaxisDefLtype(int zaxisID, int ltype)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxisptr->ltype = ltype;
+}
+
+
+int zaxisInqLtype(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->ltype);
+}
+
+/*
+ at Function  zaxisDefLevels
+ at Title     Define the levels of a Z-axis
+
+ at Prototype void zaxisDefLevels(int zaxisID, const double *levels)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  levels   All levels of the Z-axis.
+
+ at Description
+The function @func{zaxisDefLevels} defines the levels of a Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefLevels(int zaxisID, const double *levels)
+{
+  int ilev;
+  int size;
+  double *vals;
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+
+  vals = zaxisptr->vals;
+
+  for ( ilev = 0; ilev < size; ilev++ )
+    vals[ilev] = levels[ilev];
+}
+
+/*
+ at Function  zaxisDefLevel
+ at Title     Define one level of a Z-axis
+
+ at Prototype void zaxisDefLevel(int zaxisID, int levelID, double level)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  levelID  Level identifier.
+    @Item  level    Level.
+
+ at Description
+The function @func{zaxisDefLevel} defines one level of a Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefLevel(int zaxisID, int levelID, double level)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( levelID >= 0 && levelID < zaxisptr->size )
+    zaxisptr->vals[levelID] = level;
+}
+
+/*
+ at Function  zaxisDefReference
+ at Title     Define the reference for a genralized Z-axis
+
+ at Prototype void zaxisDefReference(int zaxisID, const int reference)
+ at Parameter
+    @Item  zaxisID     Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  reference   Reference for a generalized Z-axis.
+
+ at Description
+The function @func{zaxisDefReference} defines the reference for a generalized  Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefReference(int zaxisID, const int reference)
+{
+  zaxis_t *zaxisptr;
+
+    if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxisptr->reference = reference;
+}
+
+/*
+ at Function  zaxisDefUUID
+ at Title     Define the UUID for a genralized Z-axis
+
+ at Prototype void zaxisDefUUID(int zaxisID, const char *uuid)
+ at Parameter
+    @Item  zaxisID     Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  uuid        UUID for a generalized Z-axis.
+
+ at Description
+The function @func{zaxisDefUUID} defines the UUID for a generalized  Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefUUID(int zaxisID, const char *uuid)
+{
+  zaxis_t *zaxisptr;
+
+    if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strncpy(zaxisptr->uuid, uuid, 16);
+
+  return;
+}
+
+/*
+ at Function  zaxisInqUUID
+ at Title     Get the uuid to a generalized Z-axis.
+
+ at Prototype char *zaxisInqUUID(int zaxisID, char *uuid)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+
+ at Description
+The function @func{zaxisInqUUID} returns the UUID to a generalized Z-axis.
+
+ at Result
+ at func{zaxisInqUUID} returns the UUID to a generalized Z-axis.
+ at EndFunction
+*/
+char *zaxisInqUUID(int zaxisID, char *uuid)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strncpy(uuid, zaxisptr->uuid, 16);
+
+  return (uuid);
+}
+
+/*
+ at Function  zaxisInqReference
+ at Title     Get the reference to a generalized Z-axis.
+
+ at Prototype int zaxisInqReference(int zaxisID)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+
+ at Description
+The function @func{zaxisInqReference} returns the reference to a generalized Z-axis.
+
+ at Result
+ at func{zaxisInqReference} returns the reference to a generalized Z-axis.
+ at EndFunction
+*/
+int zaxisInqReference(int zaxisID)
+{
+  int reference = -1;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  reference = zaxisptr->reference;
+
+  return (reference);
+}
+
+/*
+ at Function  zaxisInqLevel
+ at Title     Get one level of a Z-axis
+
+ at Prototype double zaxisInqLevel(int zaxisID, int levelID)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  levelID  Level index (range: 0 to nlevel-1).
+
+ at Description
+The function @func{zaxisInqLevel} returns one level of a Z-axis.
+
+ at Result
+ at func{zaxisInqLevel} returns the level of a Z-axis.
+ at EndFunction
+*/
+double zaxisInqLevel(int zaxisID, int levelID)
+{
+  double level = 0;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( levelID >= 0 && levelID < zaxisptr->size )
+    level = zaxisptr->vals[levelID];
+
+  return (level);
+}
+
+double zaxisInqLbound(int zaxisID, int index)
+{
+  double level = 0;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->lbounds )
+    if ( index >= 0 && index < zaxisptr->size )
+      level = zaxisptr->lbounds[index];
+
+  return (level);
+}
+
+
+double zaxisInqUbound(int zaxisID, int index)
+{
+  double level = 0;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->ubounds )
+    if ( index >= 0 && index < zaxisptr->size )
+      level = zaxisptr->ubounds[index];
+
+  return (level);
+}
+
+
+const double *zaxisInqLevelsPtr(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return ( zaxisptr->vals );
+}
+
+/*
+ at Function  zaxisInqLevels
+ at Title     Get all levels of a Z-axis
+
+ at Prototype void zaxisInqLevels(int zaxisID, double *levels)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  levels   Pointer to the location into which the levels are read.
+                    The caller must allocate space for the returned values.
+
+ at Description
+The function @func{zaxisInqLevels} returns all levels of a Z-axis.
+
+ at Result
+ at func{zaxisInqLevels} saves all levels to the parameter @func{levels}.
+ at EndFunction
+*/
+void zaxisInqLevels(int zaxisID, double *levels)
+{
+  int size;
+  int i;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+  for ( i = 0; i < size; i++ )
+    levels[i] =  zaxisptr->vals[i];
+}
+
+
+int zaxisInqLbounds(int zaxisID, double *lbounds)
+{
+  int size = 0;
+  int i;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->lbounds )
+    {
+      size = zaxisptr->size;
+
+      if ( lbounds )
+        for ( i = 0; i < size; i++ )
+          lbounds[i] =  zaxisptr->lbounds[i];
+    }
+
+  return (size);
+}
+
+
+int zaxisInqUbounds(int zaxisID, double *ubounds)
+{
+  int size = 0;
+  int i;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->ubounds )
+    {
+      size = zaxisptr->size;
+
+      if ( ubounds )
+        for ( i = 0; i < size; i++ )
+          ubounds[i] =  zaxisptr->ubounds[i];
+    }
+
+  return (size);
+}
+
+
+int zaxisInqWeights(int zaxisID, double *weights)
+{
+  int size = 0;
+  int i;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->weights )
+    {
+      size = zaxisptr->size;
+
+      if ( weights )
+        for ( i = 0; i < size; i++ )
+          weights[i] =  zaxisptr->weights[i];
+    }
+
+  return (size);
+}
+
+
+int zaxisInqLevelID(int zaxisID, double level)
+{
+  int size;
+  int levelID = CDI_UNDEFID;
+  int i;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+  for ( i = 0; i < size; i++ )
+    if ( fabs(level-zaxisptr->vals[i]) < DBL_EPSILON ) break;
+
+  if ( i < size ) levelID = i;
+
+  return (levelID);
+}
+
+/*
+ at Function  zaxisInqType
+ at Title     Get the type of a Z-axis
+
+ at Prototype int zaxisInqType(int zaxisID)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+
+ at Description
+The function @func{zaxisInqType} returns the type of a Z-axis.
+
+ at Result
+ at func{zaxisInqType} returns the type of the Z-axis,
+one of the set of predefined CDI Z-axis types.
+The valid CDI Z-axis types are @func{ZAXIS_GENERIC}, @func{ZAXIS_SURFACE},
+ at func{ZAXIS_HYBRID}, @func{ZAXIS_SIGMA}, @func{ZAXIS_PRESSURE}, @func{ZAXIS_HEIGHT},
+ at func{ZAXIS_DEPTH_BELOW_SEA} and @func{ZAXIS_DEPTH_BELOW_LAND}.
+
+ at EndFunction
+*/
+int zaxisInqType(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->type);
+}
+
+/*
+ at Function  zaxisInqSize
+ at Title     Get the size of a Z-axis
+
+ at Prototype int zaxisInqSize(int zaxisID)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}
+
+ at Description
+The function @func{zaxisInqSize} returns the size of a Z-axis.
+
+ at Result
+ at func{zaxisInqSize} returns the number of levels of a Z-axis.
+
+ at EndFunction
+*/
+int zaxisInqSize(int zaxisID)
+{
+  int size = 1;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+
+  return (size);
+}
+
+
+void cdiCheckZaxis(int zaxisID)
+{
+  int size, i, found;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisInqType(zaxisID) == ZAXIS_GENERIC )
+    {
+      size = zaxisptr->size;
+      if ( size > 1 )
+        {
+          /* check direction */
+          if ( ! zaxisptr->direction )
+            {
+              found = 0;
+              for ( i = 1; i < size; i++ )
+                if ( zaxisptr->vals[i] > zaxisptr->vals[i-1] )
+                  found++;
+              if ( found == size-1 )
+                {
+                  zaxisptr->direction = LevelUp;
+                }
+              else
+                {
+                  found = 0;
+                  for ( i = 1; i < size; i++ )
+                    if ( zaxisptr->vals[i] < zaxisptr->vals[i-1] )
+                      found++;
+                  if ( found == size-1 )
+                    {
+                      zaxisptr->direction = LevelDown;
+                    }
+                }
+            }
+          /* check consistent */
+          if ( !zaxisptr->direction )
+            {
+              Warning("Direction undefined for zaxisID %d", zaxisID);
+            }
+        }
+    }
+}
+
+
+void zaxisDefVct(int zaxisID, int size, const double *vct)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->vct == 0 )
+    {
+      zaxisptr->vctsize = size;
+      zaxisptr->vct = (double *) malloc(size*sizeof(double));
+      memcpy(zaxisptr->vct, vct, size*sizeof(double));
+    }
+  else
+    if ( zaxisptr->vctsize != size )
+      Warning("VCT was already defined");
+}
+
+
+void zaxisInqVct(int zaxisID, double *vct)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  memcpy(vct, zaxisptr->vct, zaxisptr->vctsize*sizeof(double));
+}
+
+
+int zaxisInqVctSize(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->vctsize);
+}
+
+
+const double *zaxisInqVctPtr(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->vct);
+}
+
+
+void zaxisDefLbounds(int zaxisID, const double *lbounds)
+{
+  size_t size;
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+
+  if ( CDI_Debug )
+    if ( zaxisptr->lbounds != NULL )
+      Warning("Lower bounds already defined for zaxisID = %d", zaxisID);
+
+  if ( zaxisptr->lbounds == NULL )
+    zaxisptr->lbounds = (double *) malloc(size*sizeof(double));
+
+  memcpy(zaxisptr->lbounds, lbounds, size*sizeof(double));
+}
+
+
+void zaxisDefUbounds(int zaxisID, const double *ubounds)
+{
+  size_t size;
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+
+  if ( CDI_Debug )
+    if ( zaxisptr->ubounds != NULL )
+      Warning("Upper bounds already defined for zaxisID = %d", zaxisID);
+
+  if ( zaxisptr->ubounds == NULL )
+    zaxisptr->ubounds = (double *) malloc(size*sizeof(double));
+
+  memcpy(zaxisptr->ubounds, ubounds, size*sizeof(double));
+}
+
+
+void zaxisDefWeights(int zaxisID, const double *weights)
+{
+  size_t size;
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+
+  if ( CDI_Debug )
+    if ( zaxisptr->weights != NULL )
+      Warning("Weights already defined for zaxisID = %d", zaxisID);
+
+  if ( zaxisptr->weights == NULL )
+    zaxisptr->weights = (double *) malloc(size*sizeof(double));
+
+  memcpy(zaxisptr->weights, weights, size*sizeof(double));
+}
+
+
+void zaxisChangeType(int zaxisID, int zaxistype)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxisptr->type = zaxistype;
+}
+
+
+void zaxisResize(int zaxisID, int size)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxisptr->size = size;
+
+  if ( zaxisptr->vals )
+    zaxisptr->vals = (double *) realloc(zaxisptr->vals, size*sizeof(double));
+}
+
+
+int zaxisDuplicate(int zaxisID)
+{
+  int zaxisIDnew;
+  int zaxistype, zaxissize;
+  int size;
+  zaxis_t *zaxisptr, *zaxisptrnew;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxistype = zaxisInqType(zaxisID);
+  zaxissize = zaxisInqSize(zaxisID);
+
+  zaxisIDnew = zaxisCreate(zaxistype, zaxissize);
+  zaxisptrnew = ( zaxis_t * ) reshGetVal ( zaxisIDnew, &zaxisOps );
+
+  zaxis_copy(zaxisptrnew, zaxisptr);
+
+  strcpy(zaxisptrnew->name, zaxisptr->name);
+  strcpy(zaxisptrnew->longname, zaxisptr->longname);
+  strcpy(zaxisptrnew->units, zaxisptr->units);
+
+  if ( zaxisptr->vals != NULL )
+    {
+      size = zaxissize;
+
+      zaxisptrnew->vals = (double *) malloc(size*sizeof(double));
+      memcpy(zaxisptrnew->vals, zaxisptr->vals, size*sizeof(double));
+    }
+
+  if ( zaxisptr->lbounds )
+    {
+      size = zaxissize;
+
+      zaxisptrnew->lbounds = (double *) malloc(size*sizeof(double));
+      memcpy(zaxisptrnew->lbounds, zaxisptr->lbounds, size*sizeof(double));
+    }
+
+  if ( zaxisptr->ubounds )
+    {
+      size = zaxissize;
+
+      zaxisptrnew->ubounds = (double *) malloc(size*sizeof(double));
+      memcpy(zaxisptrnew->ubounds, zaxisptr->ubounds, size*sizeof(double));
+    }
+
+  if ( zaxisptr->vct != NULL )
+    {
+      size = zaxisptr->vctsize;
+
+      if ( size )
+        {
+          zaxisptrnew->vctsize = size;
+          zaxisptrnew->vct = (double *) malloc(size*sizeof(double));
+          memcpy(zaxisptrnew->vct, zaxisptr->vct, size*sizeof(double));
+        }
+    }
+
+  return (zaxisIDnew);
+}
+
+
+void zaxisPrintKernel ( zaxis_t * zaxisptr, FILE * fp )
+{
+  int zaxisID;
+  int type;
+  char uuid[17];
+  int nlevels, levelID;
+  int nbyte0, nbyte;
+  double level;
+
+  xassert ( zaxisptr );
+
+  zaxisID = zaxisptr->self;
+
+  type    = zaxisptr->type;
+  nlevels = zaxisptr->size;
+
+  nbyte0 = 0;
+  fprintf(fp, "#\n");
+  fprintf(fp, "# zaxisID %d\n", zaxisID);
+  fprintf(fp, "#\n");
+  fprintf(fp, "zaxistype = %s\n", zaxisNamePtr(type));
+  fprintf(fp, "size      = %d\n", nlevels);
+  if ( zaxisptr->name[0]     ) fprintf(fp, "name      = %s\n", zaxisptr->name);
+  if ( zaxisptr->longname[0] ) fprintf(fp, "longname  = %s\n", zaxisptr->longname);
+  if ( zaxisptr->units[0]    ) fprintf(fp, "units     = %s\n", zaxisptr->units);
+
+  nbyte0 = fprintf(fp, "levels    = ");
+  nbyte = nbyte0;
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      if ( nbyte > 80 )
+	{
+	  fprintf(fp, "\n");
+	  fprintf(fp, "%*s", nbyte0, "");
+	  nbyte = nbyte0;
+	}
+      level = zaxisInqLevel(zaxisID, levelID);
+      nbyte += fprintf(fp, "%.9g ", level);
+    }
+  fprintf(fp, "\n");
+
+  if ( zaxisptr->lbounds && zaxisptr->ubounds )
+    {
+      double level1, level2;
+      nbyte = nbyte0;
+      nbyte0 = fprintf(fp, "bounds    = ");
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	{
+	  if ( nbyte > 80 )
+	    {
+	      fprintf(fp, "\n");
+	      fprintf(fp, "%*s", nbyte0, "");
+	      nbyte = nbyte0;
+	    }
+	  level1 = zaxisInqLbound(zaxisID, levelID);
+	  level2 = zaxisInqUbound(zaxisID, levelID);
+	  nbyte += fprintf(fp, "%.9g-%.9g ", level1, level2);
+	}
+      fprintf(fp, "\n");
+    }
+
+  if ( type == ZAXIS_HYBRID || type == ZAXIS_HYBRID_HALF )
+    {
+      int i;
+      int vctsize;
+      const double *vct;
+
+      vctsize = zaxisptr->vctsize;
+      vct     = zaxisptr->vct;
+      fprintf(fp, "vctsize   = %d\n", vctsize);
+      if ( vctsize )
+        {
+          nbyte0 = fprintf(fp, "vct       = ");
+          nbyte = nbyte0;
+          for ( i = 0; i < vctsize; i++ )
+            {
+              if ( nbyte > 70 || i == vctsize/2 )
+                {
+                  fprintf(fp, "\n%*s", nbyte0, "");
+                  nbyte = nbyte0;
+                }
+              nbyte += fprintf(fp, "%.9g ", vct[i]);
+            }
+          fprintf(fp, "\n");
+          /*
+          nbyte0 = fprintf(fp, "vct_b     = ");
+          nbyte  = nbyte0;
+          for ( i = 0; i < vctsize/2; i++ )
+            {
+              if ( nbyte > 70 )
+                {
+                  fprintf(fp, "\n%*s", nbyte0, "");
+                  nbyte = nbyte0;
+                }
+              nbyte += fprintf(fp, "%.9g ", vct[vctsize/2+i]);
+            }
+          fprintf(fp, "\n");
+          */
+        }
+    }
+
+  if ( type == ZAXIS_REFERENCE )
+    {
+      const unsigned char *d;
+      zaxisInqUUID(zaxisID, uuid);
+      d = (unsigned char *) &uuid;
+      fprintf(fp, "uuid      = %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
+              d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7],
+              d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]);
+    }
+}
+
+
+void zaxisPrint ( int zaxisID )
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxisPrintKernel ( zaxisptr, stdout );
+}
+
+
+static
+void zaxisPrintP ( void * voidptr, FILE * fp )
+{
+  zaxis_t *zaxisptr = ( zaxis_t * ) voidptr;
+
+  xassert ( zaxisptr );
+
+  zaxisPrintKernel(zaxisptr, fp);
+}
+
+
+static
+int  zaxisCompareP ( void * zaxisptr1, void * zaxisptr2 )
+{
+  zaxis_t * z1 = ( zaxis_t * ) zaxisptr1 ;
+  zaxis_t * z2 = ( zaxis_t * ) zaxisptr2 ;
+  static int differ = -1;
+  static int equal  =  0;
+  int i;
+
+  xassert ( z1 );
+  xassert ( z2 );
+
+  if ( z1->type      != z2->type )      return differ;
+  if ( z1->ltype     != z2->ltype )     return differ;
+  if ( z1->direction != z2->direction ) return differ;
+  if ( z1->prec      != z2->prec )      return differ;
+  if ( z1->size      != z2->size )      return differ;
+  if ( z1->vctsize   != z2->vctsize )   return differ;
+
+  if ( z1->vals )
+    {
+      xassert ( z1->size );
+
+      if ( !z2->vals ) return differ;
+
+      for ( i = 0; i < z1->size; i++ )
+        if ( z1->vals[i] != z2->vals[i] ) return differ;
+    }
+  else if ( z2->vals )
+    return differ;
+
+  if ( z1->lbounds )
+    {
+      xassert ( z1->size );
+
+      if ( !z2->lbounds ) return differ;
+
+      for ( i = 0; i < z1->size; i++ )
+        if ( z1->lbounds[i] != z2->lbounds[i] ) return differ;
+    }
+  else if ( z2->lbounds )
+    return differ;
+
+  if ( z1->ubounds )
+    {
+      xassert ( z1->size );
+
+      if ( !z2->ubounds ) return differ;
+
+      for ( i = 0; i < z1->size; i++ )
+        if ( z1->ubounds[i] != z2->ubounds[i] ) return differ;
+    }
+  else if ( z2->ubounds )
+    return differ;
+
+  if ( z1->weights )
+    {
+      xassert ( z1->size );
+
+      if ( !z2->weights ) return differ;
+
+      for ( i = 0; i < z1->size; i++ )
+        if ( z1->weights[i] != z2->weights[i] ) return differ;
+    }
+  else if ( z2->weights )
+    return differ;
+
+ if ( z1->vct )
+    {
+      xassert ( z1->vctsize );
+
+      if ( !z2->vct ) return differ;
+
+      for ( i = 0; i < z1->vctsize; i++ )
+        if ( z1->vct[i] != z2->vct[i] ) return differ;
+    }
+  else if ( z2->vct )
+    return differ;
+
+  if ( memcmp ( &z1->name    , &z2->name    , CDI_MAX_NAME ))
+    return differ;
+  if ( memcmp ( &z1->longname, &z2->longname, CDI_MAX_NAME ))
+    return differ;
+  if ( memcmp ( &z1->stdname , &z2->stdname , CDI_MAX_NAME ))
+    return differ;
+  if ( memcmp ( &z1->units   , &z2->units   , CDI_MAX_NAME ))
+    return differ;
+
+  if ( z1->positive != z2->positive ) return differ;
+
+
+  return equal;
+}
+
+
+#ifdef USE_MPI
+static int
+zaxisTxCode ( void )
+{
+  return ZAXIS;
+}
+
+enum { zaxisNint     = 7,
+       zaxisNstrings = 4,
+       vals     = 1 << 0,
+       lbounds  = 1 << 1,
+       ubounds  = 1 << 2,
+       weights  = 1 << 3,
+       vct      = 1 << 4
+};
+
+
+static
+int zaxisGetMemberMask ( zaxis_t * zaxisP )
+{
+  int memberMask = 0;
+
+  if ( zaxisP->vals )      memberMask |= vals;
+  if ( zaxisP->lbounds )   memberMask |= lbounds;
+  if ( zaxisP->ubounds )   memberMask |= ubounds;
+  if ( zaxisP->weights )   memberMask |= weights;
+  if ( zaxisP->vct )       memberMask |= vct;
+
+  return memberMask;
+}
+
+static
+int zaxisGetPackSize ( void * voidP, MPI_Comm comm )
+{
+  zaxis_t * zaxisP = ( zaxis_t * ) voidP;
+  int packBufferSize = 0, size;
+
+  xmpi ( MPI_Pack_size ( zaxisNint + 1, MPI_INT, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBufferSize += size;
+
+  if ( zaxisP->vals )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack_size ( zaxisP->size, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+    }
+
+  if ( zaxisP->lbounds )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack_size ( zaxisP->size, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+    }
+
+  if ( zaxisP->ubounds )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack_size ( zaxisP->size, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+    }
+
+  if ( zaxisP->weights )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack_size ( zaxisP->size, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+    }
+
+  if ( zaxisP->vct )
+    {
+      xassert ( zaxisP->vctsize );
+
+      xmpi ( MPI_Pack_size ( zaxisP->vctsize, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+    }
+
+  xmpi ( MPI_Pack_size ( zaxisNstrings * CDI_MAX_NAME , MPI_CHAR, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_UNSIGNED_CHAR, comm, &size ));
+  packBufferSize += size;
+
+  return packBufferSize;
+}
+
+
+void zaxisUnpack ( char * unpackBuffer, int unpackBufferSize,
+                   int * unpackBufferPos, int nspTarget, MPI_Comm comm )
+{
+  zaxis_t * zaxisP;
+  int intBuffer[zaxisNint + 1], memberMask;
+  double d;
+  char charBuffer[zaxisNstrings * CDI_MAX_NAME];
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                      intBuffer, zaxisNint + 1, MPI_INT, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                      &d, 1, MPI_DOUBLE, comm ));
+
+  xassert ( xchecksum ( DATATYPE_INT, zaxisNint + 1, intBuffer ) == d );
+
+  zaxisInit ();
+
+  zaxisP = zaxisNewEntry();
+  if ( ! zaxisP ) Error("No memory");
+
+  xassert ( namespaceAdaptKey ( intBuffer[0], nspTarget ) == zaxisP->self );
+
+  zaxisP->prec      = intBuffer[1];
+  zaxisP->type      = intBuffer[2];
+  zaxisP->ltype     = intBuffer[3];
+  zaxisP->size      = intBuffer[4];
+  zaxisP->direction = intBuffer[5];
+  zaxisP->vctsize   = intBuffer[6];
+  memberMask        = intBuffer[7];
+
+  if ( memberMask & vals )
+    {
+      xassert ( zaxisP->size );
+
+      zaxisP->vals = xmalloc ( zaxisP->size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          zaxisP->vals, zaxisP->size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->vals ) == d );
+    }
+
+  if ( memberMask & lbounds )
+    {
+      xassert ( zaxisP->size );
+
+      zaxisP->lbounds = xmalloc ( zaxisP->size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          zaxisP->lbounds, zaxisP->size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->lbounds ) == d );
+    }
+
+  if ( memberMask & ubounds )
+    {
+      xassert ( zaxisP->size );
+
+      zaxisP->ubounds = xmalloc ( zaxisP->size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          zaxisP->ubounds, zaxisP->size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->ubounds ) == d );
+    }
+
+  if ( memberMask & weights )
+    {
+      xassert ( zaxisP->size );
+
+      zaxisP->weights = xmalloc ( zaxisP->size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          zaxisP->weights, zaxisP->size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->weights ) == d );
+    }
+
+  if ( memberMask & vct )
+    {
+      xassert ( zaxisP->vctsize );
+
+      zaxisP->vct = xmalloc ( zaxisP->vctsize * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          zaxisP->vct, zaxisP->vctsize, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, zaxisP->vctsize, zaxisP->vct ) == d );
+    }
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                      charBuffer, zaxisNstrings * CDI_MAX_NAME, MPI_CHAR, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                      &d, 1, MPI_DOUBLE, comm ));
+
+  xassert ( d == xchecksum ( DATATYPE_TXT, zaxisNstrings * CDI_MAX_NAME, charBuffer ));
+
+  memcpy ( zaxisP->name,     &charBuffer[CDI_MAX_NAME * 0], CDI_MAX_NAME );
+  memcpy ( zaxisP->longname, &charBuffer[CDI_MAX_NAME * 1], CDI_MAX_NAME );
+  memcpy ( zaxisP->stdname,  &charBuffer[CDI_MAX_NAME * 2], CDI_MAX_NAME );
+  memcpy ( zaxisP->units,    &charBuffer[CDI_MAX_NAME * 3], CDI_MAX_NAME );
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                      &zaxisP->positive, 1, MPI_UNSIGNED_CHAR, comm ));
+}
+
+static
+void zaxisPack ( void * voidP, void * packBuffer, int packBufferSize,
+                 int * packBufferPos, MPI_Comm comm )
+{
+  zaxis_t   * zaxisP = ( zaxis_t * ) voidP;
+  int intBuffer[zaxisNint + 1];
+  double d;
+  char charBuffer[zaxisNstrings * CDI_MAX_NAME];
+
+  intBuffer[0]  = zaxisP->self;
+  intBuffer[1]  = zaxisP->prec;
+  intBuffer[2]  = zaxisP->type;
+  intBuffer[3]  = zaxisP->ltype;
+  intBuffer[4]  = zaxisP->size;
+  intBuffer[5]  = zaxisP->direction;
+  intBuffer[6]  = zaxisP->vctsize;
+  intBuffer[7]  = zaxisGetMemberMask ( zaxisP );
+
+  xmpi ( MPI_Pack ( intBuffer, zaxisNint + 1, MPI_INT,
+                    packBuffer, packBufferSize, packBufferPos, comm ));
+  d = xchecksum ( DATATYPE_INT, zaxisNint + 1, intBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  if ( zaxisP->vals )
+    {
+
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack ( zaxisP->vals, zaxisP->size, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->vals );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( zaxisP->lbounds )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack ( zaxisP->lbounds, zaxisP->size, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->lbounds );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( zaxisP->ubounds )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack ( zaxisP->ubounds, zaxisP->size, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->ubounds );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( zaxisP->weights )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack ( zaxisP->weights, zaxisP->size, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->weights );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( zaxisP->vct )
+    {
+      xassert ( zaxisP->vctsize );
+
+      xmpi ( MPI_Pack ( zaxisP->vct, zaxisP->vctsize, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, zaxisP->vctsize, zaxisP->vct );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  memcpy ( &charBuffer[CDI_MAX_NAME * 0], zaxisP->name,     CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 1], zaxisP->longname, CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 2], zaxisP->stdname,  CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 3], zaxisP->units,    CDI_MAX_NAME );
+
+  xmpi ( MPI_Pack ( charBuffer, zaxisNstrings * CDI_MAX_NAME, MPI_CHAR,
+                    packBuffer, packBufferSize, packBufferPos, comm ));
+  d = xchecksum  ( DATATYPE_TXT, zaxisNstrings * CDI_MAX_NAME, charBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  xmpi ( MPI_Pack ( &zaxisP->positive, 1, MPI_UNSIGNED_CHAR,
+                    packBuffer, packBufferSize, packBufferPos, comm ));
+}
+
+#endif
+
+void zaxisGetIndexList ( int nzaxis, int * zaxisResHs )
+{
+  reshGetResHListOfType ( nzaxis, zaxisResHs, &zaxisOps );
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <string.h>
+
+
+
+extern int CDF_Fatal;
+extern int CDF_Verbose;
+extern int CDF_Debug;
+
+#if  defined  (HAVE_LIBNETCDF)
+/*
+#if ! defined (MIN_BUF_SIZE)
+#  define  MIN_BUF_SIZE  131072L
+#endif
+
+static size_t ChunkSizeMin = MIN_BUF_SIZE;
+*/
+
+void cdf_create(const char *path, int cmode, int *ncidp)
+{
+  int status;
+  int oldfill;
+  size_t initialsz = 0, chunksizehint = 0;
+  /*
+#if defined (HAVE_STRUCT_STAT_ST_BLKSIZE)
+  struct stat filestat;
+  char basename[1024];
+  char *pend;
+
+  pend = strrchr(path, '/');
+  if ( pend == 0 )
+    strcpy(basename, "./");
+  else
+    {
+      memcpy(basename, path, pend-path);
+      basename[pend-path] = 0;
+    }
+
+  if ( stat(basename, &filestat) != 0 )
+    SysError(basename);
+
+  chunksizehint = (size_t) filestat.st_blksize * 4;
+#endif
+
+  if ( chunksizehint < ChunkSizeMin ) chunksizehint = ChunkSizeMin;
+  */
+#if defined(__SX__) || defined(ES)
+  chunksizehint = 16777216; /* 16 MB */
+#endif
+
+  if ( cdiNcChunksizehint != CDI_UNDEFID ) chunksizehint = cdiNcChunksizehint;
+
+  status = nc__create(path, cmode, initialsz, &chunksizehint, ncidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  mode = %d  file = %s", *ncidp, cmode, path);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("chunksizehint %d", chunksizehint);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+
+  status = nc_set_fill(*ncidp, NC_NOFILL, &oldfill);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+int cdf_open(const char *path, int omode, int *ncidp)
+{
+  int status = 0;
+  int dapfile = FALSE;
+  struct stat filestat;
+  size_t chunksizehint = 0;
+
+#if  defined  (HAVE_LIBNC_DAP)
+  if ( memcmp(path, "http:", 5) == 0 ) dapfile = TRUE;
+#endif
+
+  if ( dapfile )
+    {
+      status = nc_open(path, omode, ncidp);
+    }
+  else
+    {
+      if ( stat(path, &filestat) != 0 ) SysError(path);
+
+#if defined (HAVE_STRUCT_STAT_ST_BLKSIZE)
+      chunksizehint = (size_t) filestat.st_blksize * 4;
+#endif
+      /*
+      if ( chunksizehint < ChunkSizeMin ) chunksizehint = ChunkSizeMin;
+      */
+      if ( cdiNcChunksizehint != CDI_UNDEFID ) chunksizehint = cdiNcChunksizehint;
+
+      status = nc__open(path, omode, &chunksizehint, ncidp);
+
+      if ( CDF_Debug ) Message("chunksizehint %d", chunksizehint);
+    }
+
+  if ( CDF_Debug )
+    Message("ncid = %d  mode = %d  file = %s", *ncidp, omode, path);
+
+  if ( CDF_Debug && status != NC_NOERR ) Message("%s", nc_strerror(status));
+
+  return (status);
+}
+
+
+void cdf_close(int ncid)
+{
+  int status;
+
+  status = nc_close(ncid);
+
+  if ( status != NC_NOERR )
+    Error("%s", nc_strerror(status));
+}
+
+
+void cdf_redef(int ncid)
+{
+  int status;
+
+  status = nc_redef(ncid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_enddef(int ncid)
+{
+  int status;
+
+  status = nc_enddef(ncid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_sync(int ncid)
+{
+  int status;
+
+  status = nc_sync(ncid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq(int ncid, int *ndimsp, int *nvarsp, int *ngattsp, int *unlimdimidp)
+{
+  int status;
+
+  status = nc_inq(ncid, ndimsp, nvarsp, ngattsp, unlimdimidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d ndims = %d nvars = %d ngatts = %d unlimid = %d",
+	    ncid, *ndimsp, *nvarsp, *ngattsp, *unlimdimidp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_def_dim(int ncid, const char *name, size_t len, int *dimidp)
+{
+  int status;
+
+  status = nc_def_dim(ncid, name, len, dimidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  name = %s  len = %d", ncid, name, len);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_dimid(int ncid, const char *name, int *dimidp)
+{
+  int status;
+
+  status = nc_inq_dimid(ncid, name, dimidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  name = %s  dimid= %d", ncid, name, *dimidp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_dim(int ncid, int dimid, char *name, size_t * lengthp)
+{
+  int status;
+
+  status = nc_inq_dim(ncid, dimid, name, lengthp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  dimid = %d  length = %d name = %s", ncid, dimid, *lengthp, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_dimname(int ncid, int dimid, char *name)
+{
+  int status;
+
+  status = nc_inq_dimname(ncid, dimid, name);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  dimid = %d  name = %s", ncid, dimid, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_dimlen(int ncid, int dimid, size_t * lengthp)
+{
+  int status;
+
+  status = nc_inq_dimlen(ncid, dimid, lengthp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d dimid = %d length = %d", ncid, dimid, *lengthp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_def_var(int ncid, const char *name, nc_type xtype, int ndims,
+	    const int dimids[], int *varidp)
+{
+  int status;
+
+  status = nc_def_var(ncid, name, xtype, ndims, dimids, varidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  name = %s  xtype = %d  ndims = %d  varid = %d",
+	    ncid, name, xtype, ndims, *varidp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_varid(int ncid, const char *name, int *varidp)
+{
+  int status;
+
+  status = nc_inq_varid(ncid, name, varidp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  name = %s  varid = %d ", ncid, name, *varidp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_nvars(int ncid, int *nvarsp)
+{
+  int status;
+
+  status = nc_inq_nvars(ncid, nvarsp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d  nvars = %d", ncid, *nvarsp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_var(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp,
+		 int dimids[], int *nattsp)
+{
+  int status;
+
+  status = nc_inq_var(ncid, varid, name, xtypep, ndimsp, dimids, nattsp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d ndims = %d xtype = %d natts = %d name = %s",
+	    ncid, varid, *ndimsp, *xtypep, *nattsp, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_varname(int ncid, int varid, char *name)
+{
+  int status;
+
+  status = nc_inq_varname(ncid, varid, name);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d name = %s", ncid, varid, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_vartype(int ncid, int varid, nc_type *xtypep)
+{
+  int status;
+
+  status = nc_inq_vartype(ncid, varid, xtypep);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d xtype = %s", ncid, varid, *xtypep);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_varndims(int ncid, int varid, int *ndimsp)
+{
+  int status;
+
+  status = nc_inq_varndims(ncid, varid, ndimsp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_vardimid(int ncid, int varid, int dimids[])
+{
+  int status;
+
+  status = nc_inq_vardimid(ncid, varid, dimids);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_varnatts(int ncid, int varid, int *nattsp)
+{
+  int status;
+
+  status = nc_inq_varnatts(ncid, varid, nattsp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d nattsp = %d", ncid, varid, *nattsp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_text(int ncid, int varid, const char *tp)
+{
+  int status;
+
+  status = nc_put_var_text(ncid, varid, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %s", ncid, varid, tp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_short(int ncid, int varid, const short *sp)
+{
+  int status;
+
+  status = nc_put_var_short(ncid, varid, sp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %hd", ncid, varid, *sp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_int(int ncid, int varid, const int *ip)
+{
+  int status;
+
+  status = nc_put_var_int(ncid, varid, ip);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %d", ncid, varid, *ip);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_long(int ncid, int varid, const long *lp)
+{
+  int status;
+
+  status = nc_put_var_long(ncid, varid, lp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %ld", ncid, varid, *lp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_float(int ncid, int varid, const float *fp)
+{
+  int status;
+
+  status = nc_put_var_float(ncid, varid, fp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %f", ncid, varid, *fp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_vara_double(int ncid, int varid, const size_t start[],
+                         const size_t count[], const double *dp)
+{
+  int status;
+
+  status = nc_put_vara_double(ncid, varid, start, count, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d val0 = %f", ncid, varid, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void  cdf_put_vara_float(int ncid, int varid, const size_t start[],
+                         const size_t count[], const float *fp)
+{
+  int status;
+
+  status = nc_put_vara_float(ncid, varid, start, count, fp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d val0 = %f", ncid, varid, *fp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void  cdf_get_vara_int(int ncid, int varid, const size_t start[],
+                       const size_t count[], int *dp)
+{
+  int status;
+
+  status = nc_get_vara_int(ncid, varid, start, count, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void  cdf_get_vara_double(int ncid, int varid, const size_t start[],
+                          const size_t count[], double *dp)
+{
+  int status;
+
+  status = nc_get_vara_double(ncid, varid, start, count, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void  cdf_get_vara_float(int ncid, int varid, const size_t start[],
+                         const size_t count[], float *fp)
+{
+  int status;
+
+  status = nc_get_vara_float(ncid, varid, start, count, fp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void  cdf_get_vara_text(int ncid, int varid, const size_t start[],
+			const size_t count[], char *tp)
+{
+  int status;
+
+  status = nc_get_vara_text(ncid, varid, start, count, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var_double (int ncid, int varid, const double *dp)
+{
+  int status;
+
+  status = nc_put_var_double(ncid, varid, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d val0 = %f", ncid, varid, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var1_text(int ncid, int varid, const size_t index[], char *tp)
+{
+  int status;
+
+  status = nc_get_var1_text(ncid, varid, index, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var1_double(int ncid, int varid, const size_t index[], double *dp)
+{
+  int status;
+
+  status = nc_get_var1_double(ncid, varid, index, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_var1_double(int ncid, int varid, const size_t index[], const double *dp)
+{
+  int status;
+
+  status = nc_put_var1_double(ncid, varid, index, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d val = %f", ncid, varid, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_text(int ncid, int varid, char *tp)
+{
+  int status;
+
+  status = nc_get_var_text(ncid, varid, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_short(int ncid, int varid, short *sp)
+{
+  int status;
+
+  status = nc_get_var_short(ncid, varid, sp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_int(int ncid, int varid, int *ip)
+{
+  int status;
+
+  status = nc_get_var_int(ncid, varid, ip);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_long(int ncid, int varid, long *lp)
+{
+  int status;
+
+  status = nc_get_var_long(ncid, varid, lp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_float(int ncid, int varid, float *fp)
+{
+  int status;
+
+  status = nc_get_var_float(ncid, varid, fp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_var_double(int ncid, int varid, double *dp)
+{
+  int status;
+
+  status = nc_get_var_double(ncid, varid, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d val[0] = %f", ncid, varid, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out,
+		  int varid_out)
+{
+  int status;
+
+  status = nc_copy_att(ncid_in, varid_in, name, ncid_out, varid_out);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %s %d %d", ncid_in, varid_out, name, ncid_out, varid_out);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_att_text(int ncid, int varid, const char *name, size_t len,
+		      const char *tp)
+{
+  int status;
+
+  status = nc_put_att_text(ncid, varid, name, len, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d att = %s text = %s",
+	    ncid, varid, name, tp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_att_int(int ncid, int varid, const char *name, nc_type xtype,
+		     size_t len, const int *ip)
+{
+  int status;
+
+  status = nc_put_att_int(ncid, varid, name, xtype, len, ip);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d att = %s val = %d", ncid, varid, name, *ip);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_put_att_double(int ncid, int varid, const char *name, nc_type xtype,
+			size_t len, const double *dp)
+{
+  int status;
+
+  status = nc_put_att_double(ncid, varid, name, xtype, len, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("%d %d %f", ncid, varid, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_att_text(int ncid, int varid, char *name, char *tp)
+{
+  int status;
+
+  status = nc_get_att_text(ncid, varid, name, tp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d name = %s", ncid, varid, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_att_int(int ncid, int varid, char *name, int *ip)
+{
+  int status;
+
+  status = nc_get_att_int(ncid, varid, name, ip);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d att = %s val = %d", ncid, varid, name, *ip);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_get_att_double(int ncid, int varid, char *name, double *dp)
+{
+  int status;
+
+  status = nc_get_att_double(ncid, varid, name, dp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d att = %s val = %.9g",
+	    ncid, varid, name, *dp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_att(int ncid, int varid, const char *name, nc_type *xtypep,
+		 size_t *lenp)
+{
+  int status;
+
+  status = nc_inq_att(ncid, varid, name, xtypep, lenp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_atttype(int ncid, int varid, const char *name, nc_type * xtypep)
+{
+  int status;
+
+  status = nc_inq_atttype(ncid, varid, name, xtypep);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_attlen(int ncid, int varid, const char *name, size_t * lenp)
+{
+  int status;
+
+  status = nc_inq_attlen(ncid, varid, name, lenp);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d name = %s len = %d", ncid, varid, name, *lenp);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_attname(int ncid, int varid, int attnum, char *name)
+{
+  int status;
+
+  status = nc_inq_attname(ncid, varid, attnum, name);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d attnum = %d name = %s", ncid, varid, attnum, name);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+
+void cdf_inq_attid(int ncid, int varid, const char *name, int *attnump)
+{
+  int status;
+
+  status = nc_inq_attid(ncid, varid, name, attnump);
+
+  if ( CDF_Debug || status != NC_NOERR )
+    Message("ncid = %d varid = %d", ncid, varid);
+
+  if ( status != NC_NOERR ) Error("%s", nc_strerror(status));
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <string.h>
+#include <errno.h>
+
+char *cdiStringError(int cdiErrno)
+{
+  static char UnknownError[] = "Unknown Error";
+  static char _EUFTYPE[]     = "Unsupported file type";
+  static char _ELIBNAVAIL[]  = "Unsupported file type (library support not compiled in)";
+  static char _EUFSTRUCT[]   = "Unsupported file structure";
+  static char _EUNC4[]       = "Unsupported netCDF4 structure";
+  static char _ELIMIT[]      = "Internal limits exceeded";
+
+  switch (cdiErrno) {
+  case CDI_ESYSTEM:
+    {
+      char *cp = (char *) strerror(errno);
+      if ( cp == NULL ) break;
+      return cp;
+    }
+  case CDI_EUFTYPE:    return _EUFTYPE;
+  case CDI_ELIBNAVAIL: return _ELIBNAVAIL;
+  case CDI_EUFSTRUCT:  return _EUFSTRUCT;
+  case CDI_EUNC4:      return _EUNC4;
+  case CDI_ELIMIT:     return _ELIMIT;
+  }
+
+  return UnknownError;
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#include <stdio.h>
+
+void cdiDecodeParam(int param, int *pnum, int *pcat, int *pdis)
+{
+  unsigned int *uparam = (unsigned int *) ¶m;
+  unsigned int upnum;
+
+  *pdis = 0xff   & *uparam;
+  *pcat = 0xff   & *uparam >> 8;
+  upnum = 0xffff & *uparam >> 16;
+  if ( upnum > 0x7fff ) upnum = 0x8000 - upnum;
+  *pnum = upnum;
+}
+
+
+int cdiEncodeParam(int pnum, int pcat, int pdis)
+{
+  unsigned int uparam, upnum;
+
+  if ( pcat < 0 || pcat > 255 ) pcat = 255;
+  if ( pdis < 0 || pdis > 255 ) pdis = 255;
+
+  upnum = pnum;
+  if ( pnum < 0 ) upnum = 0x8000 - pnum;
+
+  uparam = upnum << 16 | pcat << 8 | pdis;
+
+  return ((int)uparam);
+}
+
+
+void cdiDecodeDate(int date, int *year, int *month, int *day)
+{
+  int idate;
+
+  *year  =  date / 10000;
+  idate  = date - *year*10000;
+  if ( idate < 0 ) idate = -idate;
+  *month = idate / 100;
+  *day   = idate - *month*100;
+}
+
+
+int cdiEncodeDate(int year, int month, int day)
+{
+  int date;
+  int iyear;
+
+  iyear = year;
+  if ( iyear < 0 ) iyear = -iyear;
+  date = iyear*10000 + month*100 + day;
+  if ( year < 0 ) date = -date;
+
+  return (date);
+}
+
+
+void cdiDecodeTime(int time, int *hour, int *minute, int *second)
+{
+  int itime;
+
+  *hour   = time / 10000;
+  itime   = time - *hour*10000;
+  *minute = itime / 100;
+  *second = itime - *minute*100;
+}
+
+
+int cdiEncodeTime(int hour, int minute, int second)
+{
+  int time;
+
+  time = hour*10000 + minute*100 + second;
+
+  return (time);
+}
+
+
+void cdiParamToString(int param, char *paramstr, int maxlen)
+{
+  int dis, cat, num;
+  int len;
+
+  cdiDecodeParam(param, &num, &cat, &dis);
+
+  if ( dis == 255 && (cat == 255 || cat == 0 ) )
+    len = sprintf(paramstr, "%d", num);
+  else  if ( dis == 255 )
+    len = sprintf(paramstr, "%d.%d", num, cat);
+  else
+    len = sprintf(paramstr, "%d.%d.%d", num, cat, dis);
+
+  if ( len > ( maxlen-1) )
+    fprintf(stderr, "Internal problem (%s): size of input string is too small!\n", __func__);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <ctype.h>
+
+
+
+#if  defined  (HAVE_LIBCGRIBEX)
+#endif
+
+int cdiDefaultCalendar = CALENDAR_PROLEPTIC;
+
+int cdiDefaultInstID   = CDI_UNDEFID;
+int cdiDefaultModelID  = CDI_UNDEFID;
+int cdiDefaultTableID  = CDI_UNDEFID;
+int cdiNcMissingValue  = CDI_UNDEFID;
+int cdiNcChunksizehint = CDI_UNDEFID;
+int cdiChunkType       = CHUNK_GRID;
+int cdiSplitLtype105   = CDI_UNDEFID;
+
+int cdiIgnoreAttCoordinates = FALSE;
+int cdiSkipRecords          = 0;
+int cdiInventoryMode        = 1;
+
+char *cdiPartabPath   = NULL;
+int   cdiPartabIntern = 1;
+
+double cdiDefaultMissval = -9.E33;
+
+char *Filetypes[] = {
+  "UNKNOWN",
+  "GRIB",
+  "GRIB2",
+  "netCDF",
+  "netCDF2",
+  "netCDF4",
+  "SERVICE",
+  "EXTRA",
+  "IEG",
+  "HDF5",
+};
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+
+int CDI_Debug   = 0;    /* If set to 1, debugging           */
+
+static int  STREAM_Debug = 0;   /* If set to 1, debugging */
+
+int cdiDefaultLeveltype = -1;
+static int cdiDataUnreduced = 0;
+static int cdiSortName = 0;
+static int cdiHaveMissval = 0;
+
+
+static int    streamCompareP ( void * streamptr1, void * streamptr2 );
+static void   streamDestroyP ( void * streamptr );
+static void   streamPrintP   ( void * streamptr, FILE * fp );
+#ifdef USE_MPI
+static int    streamGetPackSize ( void * streamptr, MPI_Comm comm );
+static void   streamPack        ( void * streamptr, void * buff, int size,
+				  int * position, MPI_Comm comm );
+static int    streamTxCode      ( void );
+#endif
+
+resOps streamOps = { streamCompareP, streamDestroyP, streamPrintP,
+#ifdef USE_MPI
+                     streamGetPackSize,
+		     streamPack,
+                     streamTxCode
+#endif
+};
+
+long cdiGetenvInt(char *envName)
+{
+  char *envString;
+  long envValue = -1;
+  long fact = 1;
+
+  envString = getenv(envName);
+
+  if ( envString )
+    {
+      int loop, len;
+
+      len = (int) strlen(envString);
+      for ( loop = 0; loop < len; loop++ )
+	{
+	  if ( ! isdigit((int) envString[loop]) )
+	    {
+	      switch ( tolower((int) envString[loop]) )
+		{
+		case 'k':  fact = 1024;        break;
+		case 'm':  fact = 1048576;     break;
+		case 'g':  fact = 1073741824;  break;
+		default:
+		  fact = 0;
+		  Message("Invalid number string in %s: %s", envName, envString);
+		  Warning("%s must comprise only digits [0-9].",envName);
+		}
+	      break;
+	    }
+	}
+
+      if ( fact ) envValue = fact*atol(envString);
+
+      if ( CDI_Debug ) Message("set %s to %ld", envName, envValue);
+    }
+
+  return (envValue);
+}
+
+static
+void cdiSetChunk(const char *chunkAlgo)
+{
+  char *pch;
+  size_t len = strlen(chunkAlgo);
+  int algo = -1;
+
+  if      ( strcmp("auto",  chunkAlgo)   == 0 ) algo = CHUNK_AUTO;
+  else if ( strcmp("grid",  chunkAlgo)   == 0 ) algo = CHUNK_GRID;
+  else if ( strcmp("lines", chunkAlgo)   == 0 ) algo = CHUNK_LINES;
+  /*
+  else if ( (pch = strstr(chunkAlgo,"x")) != 0 )
+    {
+      int ix, iy;
+      ix = atoi(chunkAlgo);
+      iy = atoi(pch+1);
+      if ( ix > 0 && iy > 0 )
+        {
+          cdiChunkX = ix;
+          cdiChunkY = iy;
+          algo = CHUNK_USER;
+        }
+      else
+        Warning("Invalid environment variable CDI_CHUNK_ALGO: %s", chunkAlgo);
+    }
+  */
+  else
+    Warning("Invalid environment variable CDI_CHUNK_ALGO: %s", chunkAlgo);
+
+  if ( algo != -1 )
+    {
+      cdiChunkType = algo;
+      if ( CDI_Debug ) Message("set ChunkAlgo to %s", chunkAlgo);
+    }
+}
+
+
+void cdiInitialize(void)
+{
+  static int Init_CDI = FALSE;
+  char *envString;
+  long value;
+
+  if ( ! Init_CDI )
+    {
+      Init_CDI = TRUE;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+      gribFixZSE(1);   // 1: Fix ZeroShiftError of simple packed spherical harmonics
+      gribSetConst(1); // 1: Don't pack constant fields on regular grids
+#endif
+
+      value = cdiGetenvInt("CDI_REGULARGRID");
+      if ( value >= 0 ) cdiDataUnreduced = (int) value;
+
+      value = cdiGetenvInt("CDI_SORTNAME");
+      if ( value >= 0 ) cdiSortName = (int) value;
+
+      value = cdiGetenvInt("CDI_HAVE_MISSVAL");
+      if ( value >= 0 ) cdiHaveMissval = (int) value;
+
+      value = cdiGetenvInt("CDI_LEVELTYPE");
+      if ( value >= 0 ) cdiDefaultLeveltype = (int) value;
+
+      envString = getenv("CDI_MISSVAL");
+      if ( envString ) cdiDefaultMissval = atof(envString);
+
+      envString = getenv("NC_MISSING_VALUE");
+      if ( envString ) cdiNcMissingValue = atoi(envString);
+
+      envString = getenv("NC_CHUNKSIZEHINT");
+      if ( envString ) cdiNcChunksizehint = atoi(envString);
+
+      envString = getenv("CDI_CHUNK_ALGO");
+      if ( envString ) cdiSetChunk(envString);
+
+      envString = getenv("SPLIT_LTYPE_105");
+      if ( envString ) cdiSplitLtype105 = atoi(envString);
+
+      envString = getenv("IGNORE_ATT_COORDINATES");
+      if ( envString ) cdiIgnoreAttCoordinates = atoi(envString);
+
+      envString = getenv("CDI_SKIP_RECORDS");
+      if ( envString )
+	{
+	  cdiSkipRecords = atoi(envString);
+	  cdiSkipRecords = cdiSkipRecords > 0 ? cdiSkipRecords : 0;
+	}
+
+      envString = getenv("GRIB_INVENTORY_MODE");
+      if ( envString )
+	{
+	  if ( strncmp(envString, "time", 4) == 0 )
+	    {
+	      cdiInventoryMode = 2;
+	      if ( CDI_Debug )
+		Message("Inventory mode was set to timestep!");
+	    }
+	}
+
+      envString = getenv("CDI_CALENDAR");
+      if ( envString )
+	{
+	  if      ( strncmp(envString, "standard", 8) == 0 )
+	    cdiDefaultCalendar = CALENDAR_STANDARD;
+	  else if ( strncmp(envString, "proleptic", 9) == 0 )
+	    cdiDefaultCalendar = CALENDAR_PROLEPTIC;
+	  else if ( strncmp(envString, "360days", 7) == 0 )
+	    cdiDefaultCalendar = CALENDAR_360DAYS;
+	  else if ( strncmp(envString, "365days", 7) == 0 )
+	    cdiDefaultCalendar = CALENDAR_365DAYS;
+	  else if ( strncmp(envString, "366days", 7) == 0 )
+	    cdiDefaultCalendar = CALENDAR_366DAYS;
+	  else if ( strncmp(envString, "none", 4) == 0 )
+	    cdiDefaultCalendar = CALENDAR_NONE;
+
+	  if ( CDI_Debug )
+	    Message("Default calendar set to %s!", envString);
+	}
+#if  defined  (HAVE_LIBCGRIBEX)
+      gribSetCalendar(cdiDefaultCalendar);
+#endif
+
+      envString = getenv("PARTAB_INTERN");
+      if ( envString ) cdiPartabIntern = atoi(envString);
+
+      envString = getenv("PARTAB_PATH");
+      if ( envString ) cdiPartabPath = strdup(envString);
+
+      envString = getenv("STREAM_DEBUG");
+      if ( envString ) STREAM_Debug = atoi(envString);
+    }
+}
+
+
+char *strfiletype(int filetype)
+{
+  char *name;
+  int size = (int) (sizeof(Filetypes)/sizeof(char *));
+
+  if ( filetype > 0 && filetype < size )
+    name = Filetypes[filetype];
+  else
+    name = Filetypes[0];  
+
+  return (name);
+}
+
+
+stream_t *stream_to_pointer(int idx)
+{
+  return ( stream_t *) reshGetVal ( idx, &streamOps );
+}
+
+static
+void streamDefaultValue ( stream_t * streamptr )
+{
+  int i;
+
+  streamptr->self              = UNDEFID;
+  streamptr->accesstype        = UNDEFID;
+  streamptr->accessmode        = 0;
+  streamptr->filetype          = UNDEFID;
+  streamptr->byteorder         = UNDEFID;
+  streamptr->fileID            = 0;
+  streamptr->dimgroupID        = UNDEFID;
+  streamptr->filemode          = 0;
+  streamptr->numvals           = 0;
+  streamptr->filename          = NULL;
+  streamptr->record            = NULL;
+  streamptr->varsAllocated     = 0;
+  streamptr->nrecs             = 0;
+  streamptr->nvars             = 0;
+  streamptr->vars              = NULL;
+  streamptr->varinit           = 0;
+  streamptr->ncmode            = 0;
+  streamptr->curTsID           = UNDEFID;
+  streamptr->rtsteps           = 0;
+  streamptr->ntsteps           = UNDEFID;
+  streamptr->numTimestep       = 0;
+  streamptr->tsteps            = NULL;
+  streamptr->tstepsTableSize   = 0;
+  streamptr->tstepsNextID      = 0;
+  streamptr->historyID         = UNDEFID;
+  streamptr->vlistID           = UNDEFID;
+  streamptr->globalatts        = 0;
+  streamptr->localatts         = 0;
+  streamptr->vct.ilev          = 0;
+  streamptr->vct.mlev          = 0;
+  streamptr->vct.ilevID        = UNDEFID;
+  streamptr->vct.mlevID        = UNDEFID;
+  streamptr->unreduced         = cdiDataUnreduced;
+  streamptr->sortname          = cdiSortName;
+  streamptr->have_missval      = cdiHaveMissval;
+  streamptr->comptype          = COMPRESS_NONE;
+  streamptr->complevel         = 0;
+
+  basetimeInit(&streamptr->basetime);
+
+  for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->xdimID[i]   = UNDEFID;
+  for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ydimID[i]   = UNDEFID;
+  for ( i = 0; i < MAX_ZAXES_PS; i++ ) streamptr->zaxisID[i]  = UNDEFID;
+  for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ncxvarID[i] = UNDEFID;
+  for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ncyvarID[i] = UNDEFID;
+  for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ncavarID[i] = UNDEFID;
+
+  streamptr->curfile           = 0;
+  streamptr->nfiles            = 0;
+  streamptr->fnames            = NULL;
+
+  streamptr->gribContainers    = NULL;
+  streamptr->vlistIDorig       = UNDEFID;
+}
+
+
+stream_t *stream_new_entry(void)
+{
+  stream_t *streamptr;
+
+  cdiInitialize(); /* ***************** make MT version !!! */
+
+  streamptr = (stream_t *) xmalloc(sizeof(stream_t));
+  streamDefaultValue ( streamptr );
+  streamptr->self = reshPut (( void * ) streamptr, &streamOps );
+
+  return streamptr;
+}
+
+
+void stream_delete_entry(stream_t *streamptr)
+{
+  int idx;
+
+  xassert ( streamptr );
+
+  idx = streamptr->self;
+  free ( streamptr );
+  reshRemove ( idx, &streamOps );
+
+  if ( STREAM_Debug )
+    Message("Removed idx %d from stream list", idx);
+}
+
+
+void stream_check_ptr(const char *caller, stream_t *streamptr)
+{
+  if ( streamptr == NULL )
+    Errorc("stream undefined!");
+}
+
+
+int streamSize(void)
+{
+  return reshCountType ( &streamOps );
+}
+
+
+void cdiDefGlobal(const char *string, int val)
+{
+  if ( strcmp(string, "REGULARGRID") == 0 )
+    {
+      cdiDataUnreduced = val;
+    }
+  else if ( strcmp(string, "SORTNAME") == 0 )
+    {
+      cdiSortName = val;
+    }
+  else if ( strcmp(string, "HAVE_MISSVAL") == 0 )
+    {
+      cdiHaveMissval = val;
+    }
+  else if ( strcmp(string, "NC_CHUNKSIZEHINT") == 0 )
+    {
+      cdiNcChunksizehint = val;
+    }
+  else
+    {
+      Warning("Unsupported global key: %s", string);
+    }
+}
+
+
+void cdiDefMissval(double missval)
+{
+  cdiInitialize();
+
+  cdiDefaultMissval = missval;
+}
+
+
+double cdiInqMissval(void)
+{
+  cdiInitialize();
+
+  return (cdiDefaultMissval);
+}
+
+
+void cdiCheckContents(int streamID)
+{
+  int index, nzaxis, zaxisID;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  nzaxis = vlistNzaxis(vlistID);
+
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      zaxisID = vlistZaxis(vlistID, index);
+      if ( zaxisInqType(zaxisID) == ZAXIS_GENERIC )
+	cdiCheckZaxis(zaxisID);
+    }
+}
+
+
+int streamInqFileID(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  return (streamptr->fileID);
+}
+
+/* not used anymore */
+/*
+void streamDefineTaxis(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  if ( streamptr->tsteps == NULL )
+    {
+      int varID, nvars;
+      int vlistID;
+
+      vlistID = streamInqVlist(streamID);
+
+      nvars = vlistNvars(vlistID);
+      for ( varID = 0; varID < nvars; varID++ )
+	if ( vlistInqVarTsteptype(vlistID, varID) == TSTEP_CONSTANT ) break;
+
+      if ( varID == nvars )
+	{
+	  int taxisID;
+
+	  taxisID = vlistInqTaxis(vlistID);
+	  if ( taxisID == CDI_UNDEFID )
+	    {
+	      taxisID = taxisCreate(TAXIS_ABSOLUTE);
+	      vlistDefTaxis(vlistID, taxisID);
+	    }
+
+	  (void) streamDefTimestep(streamID, 0);
+	}
+      else
+	Error("time axis undefined");
+    }
+}
+*/
+
+void streamDefDimgroupID(int streamID, int dimgroupID)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  streamptr->dimgroupID = dimgroupID;
+}
+
+
+int streamInqDimgroupID(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  return (streamptr->dimgroupID);
+}
+
+
+void cdiDefAccesstype(int streamID, int type)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  if ( streamptr->accesstype == UNDEFID )
+    {
+      streamptr->accesstype = type;
+    }
+  else
+    {
+      if ( streamptr->accesstype != type )
+	{
+	  if ( streamptr->accesstype == TYPE_REC )
+	    Error("Changing access type from REC to VAR not allowed!");
+	  else
+	    Error("Changing access type from VAR to REC not allowed!");
+	}
+    }
+}
+
+
+int cdiInqAccesstype(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  return (streamptr->accesstype);
+} 
+
+
+int streamInqNvars ( int streamID )
+{
+  stream_t * streamptr;
+  streamptr = ( stream_t * ) reshGetVal ( streamID, &streamOps );
+  return ( streamptr->nvars );
+}
+
+
+int  streamCompareP ( void * streamptr1, void * streamptr2 )
+{
+  stream_t * s1 = ( stream_t * ) streamptr1;
+  stream_t * s2 = ( stream_t * ) streamptr2;
+  int differ = -1;
+  int equal  = 0;
+  int len;
+
+  xassert ( s1 );
+  xassert ( s2 );
+
+  if ( s1->filetype  != s2->filetype  ) return differ;
+  if (  namespaceAdaptKey2 ( s1->vlistIDorig ) != 			     
+	namespaceAdaptKey2 ( s2->vlistIDorig )) return differ;
+  if ( s1->byteorder != s2->byteorder ) return differ;
+  if ( s1->comptype  != s2->comptype  ) return differ;
+  if ( s1->complevel != s2->complevel ) return differ; 
+
+  if ( s1->filename )
+    {
+      len = strlen ( s1->filename ) + 1;
+      if ( memcmp ( s1->filename, s2->filename, len )) 
+	return differ;
+    }
+  else if ( s2->filename ) 
+    return differ;
+
+  return equal;
+}
+
+
+void streamDestroyP ( void * streamptr )
+{
+  int id;
+  stream_t * sp = ( stream_t * ) streamptr;
+
+  xassert ( sp );
+
+  id = sp->self;
+  streamClose ( id );
+}
+
+
+void streamPrintP   ( void * streamptr, FILE * fp )
+{
+  stream_t * sp = ( stream_t * ) streamptr;
+
+  if ( !sp ) return;
+
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "# streamID %d\n", sp->self);
+  fprintf ( fp, "#\n"); 
+  fprintf ( fp, "self          = %d\n", sp->self );
+  fprintf ( fp, "accesstype    = %d\n", sp->accesstype );
+  fprintf ( fp, "accessmode    = %d\n", sp->accessmode ); 
+  fprintf ( fp, "filetype      = %d\n", sp->filetype );
+  fprintf ( fp, "byteorder     = %d\n", sp->byteorder );
+  fprintf ( fp, "fileID        = %d\n", sp->fileID );
+  fprintf ( fp, "dimgroupID    = %d\n", sp->dimgroupID );
+  fprintf ( fp, "filemode      = %d\n", sp->filemode );
+  fprintf ( fp, "//off_t numvals;\n" );
+  fprintf ( fp, "filename      = %s\n", sp->filename );
+  fprintf ( fp, "//Record   *record;\n" );
+  fprintf ( fp, "nrecs         = %d\n", sp->nrecs );
+  fprintf ( fp, "nvars         = %d\n", sp->nvars );
+  fprintf ( fp, "varlocked     = %d\n", sp->varlocked );
+  fprintf ( fp, "//svarinfo_t *vars;\n" );
+  fprintf ( fp, "varsAllocated = %d\n", sp->varsAllocated );
+  fprintf ( fp, "varinit       = %d\n", sp->varinit );
+  fprintf ( fp, "curTsID       = %d\n", sp->curTsID );
+  fprintf ( fp, "rtsteps       = %d\n", sp->rtsteps );
+  fprintf ( fp, "//long ntsteps;\n" );
+  fprintf ( fp, "numTimestep   = %d\n", sp->numTimestep );
+  fprintf ( fp, "//  tsteps_t   *tsteps;\n" );
+  fprintf ( fp, "tstepsTableSize= %d\n", sp->tstepsTableSize );
+  fprintf ( fp, "tstepsNextID  = %d\n", sp->tstepsNextID );
+  fprintf ( fp, "//BaseTime  basetime;\n" );
+  fprintf ( fp, "ncmode        = %d\n", sp->ncmode );
+  fprintf ( fp, "vlistID       = %d\n", sp->vlistID );
+  fprintf ( fp, "//  int       xdimID[MAX_GRIDS_PS];\n" );
+  fprintf ( fp, "//  int       ydimID[MAX_GRIDS_PS];\n" );
+  fprintf ( fp, "//  int       zaxisID[MAX_ZAXES_PS];\n" );
+  fprintf ( fp, "//  int       ncxvarID[MAX_GRIDS_PS];\n" );
+  fprintf ( fp, "//  int       ncyvarID[MAX_GRIDS_PS];\n" );
+  fprintf ( fp, "//  int       ncavarID[MAX_GRIDS_PS];\n" );
+  fprintf ( fp, "historyID     = %d\n", sp->historyID );
+  fprintf ( fp, "globalatts    = %d\n", sp->globalatts );
+  fprintf ( fp, "localatts     = %d\n", sp->localatts );
+  fprintf ( fp, "//  VCT       vct;\n" );
+  fprintf ( fp, "unreduced     = %d\n", sp->unreduced );
+  fprintf ( fp, "sortname      = %d\n", sp->sortname );
+  fprintf ( fp, "have_missval  = %d\n", sp->have_missval );
+  fprintf ( fp, "ztype         = %d\n", sp->comptype );
+  fprintf ( fp, "zlevel        = %d\n", sp->complevel );
+  fprintf ( fp, "curfile       = %d\n", sp->curfile );
+  fprintf ( fp, "nfiles        = %d\n", sp->nfiles );
+  fprintf ( fp, "//  char    **fnames;\n" );
+  fprintf ( fp, "//  void    **gribContainers;\n" );
+  fprintf ( fp, "vlistIDorig   = %d\n", sp->vlistIDorig );
+}
+
+
+void streamGetIndexList ( int nstreams, int * streamIndexList )
+{
+  reshGetResHListOfType ( nstreams, streamIndexList, &streamOps );
+}
+
+
+#ifdef USE_MPI
+static int
+streamTxCode ( void )
+{
+  return STREAM;
+}
+
+
+int streamNint = 11 ;
+
+
+static
+int streamGetPackSize ( void * voidP, MPI_Comm comm )
+{
+  stream_t * streamP = ( stream_t * ) voidP;
+  int packBufferSize = 0, size;
+
+  xmpi ( MPI_Pack_size ( streamNint, MPI_INT, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBufferSize += 2 * size;
+
+
+  xmpi ( MPI_Pack_size (( int ) strlen ( streamP->filename ) + 1,
+			MPI_CHAR, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBufferSize += size;
+
+  return packBufferSize;
+}
+
+
+static
+void streamPack ( void * streamptr, void * packBuffer, int packBufferSize,
+                  int * packBufferPos, MPI_Comm comm )
+{
+  stream_t * streamP = ( stream_t * ) streamptr;
+  int intBuffer[streamNint];  
+  double d;
+
+  intBuffer[0]  = streamP->self;
+  intBuffer[1]  = streamP->filetype;
+  intBuffer[2]  =  ( int ) strlen ( streamP->filename ) + 1;
+  intBuffer[3]  = streamP->vlistID;
+  intBuffer[4]  = streamP->vlistIDorig;
+  intBuffer[5]  = streamP->byteorder;
+  intBuffer[6]  = streamP->comptype;
+  intBuffer[7]  = streamP->complevel; 
+  intBuffer[8]  = cdiDataUnreduced;
+  intBuffer[9]  = cdiSortName;
+  intBuffer[10] = cdiHaveMissval;
+  
+  xmpi ( MPI_Pack ( intBuffer, streamNint, MPI_INT, 
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+  d = xchecksum ( DATATYPE_INT , streamNint, intBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  xmpi ( MPI_Pack ( &cdiDefaultMissval, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  xmpi ( MPI_Pack ( streamP->filename, intBuffer[2], MPI_CHAR, 
+		    packBuffer, packBufferSize, packBufferPos, comm )); 
+  d = xchecksum  ( DATATYPE_TXT, intBuffer[2], &streamP->filename );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <ctype.h>
+
+
+
+#include <string.h>
+
+#define  MAX_FNAMES  3
+
+extern resOps streamOps;
+
+
+FILE *popen(const char *command, const char *type);
+int pclose(FILE *stream);
+
+void cdiPrintDefaults(void)
+{
+  fprintf (stderr, "default instID     :  %d\n", cdiDefaultInstID);
+  fprintf (stderr, "default modelID    :  %d\n", cdiDefaultModelID);
+  fprintf (stderr, "default tableID    :  %d\n", cdiDefaultTableID);
+  fprintf (stderr, "default missval    :  %g\n", cdiDefaultMissval);
+}
+
+
+void cdiDebug(int level)
+{
+  if ( level == 1 || level &  2 ) CDI_Debug = 1;
+
+  if ( CDI_Debug ) Message("debug level %d", level);
+
+  if ( level == 1 || level &  4 ) memDebug(1);
+
+  if ( level == 1 || level &  8 ) fileDebug(1);
+
+  if ( level == 1 || level & 16 )
+    {
+#if  defined  (HAVE_LIBGRIB)
+      gribSetDebug(1);
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+      cdfDebug(1);
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+      srvDebug(1);
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+      extDebug(1);
+#endif
+#if  defined  (HAVE_LIBIEG)
+      iegDebug(1);
+#endif
+    }
+
+  if ( CDI_Debug )
+    {
+      cdiPrintDefaults();
+      cdiPrintDatatypes();
+    }
+}
+
+
+#undef  IsBigendian
+#define IsBigendian()  ( u_byteorder.c[sizeof(long) - 1] )
+
+
+static
+int getByteorder(int byteswap)
+{
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+  int byteorder = -1;
+
+  if ( IsBigendian() )
+    {
+      if ( byteswap ) byteorder = CDI_LITTLEENDIAN;
+      else            byteorder = CDI_BIGENDIAN;
+    }
+  else
+    {
+      if ( byteswap ) byteorder = CDI_BIGENDIAN;
+      else            byteorder = CDI_LITTLEENDIAN;
+    }
+
+  return (byteorder);
+}
+
+
+static
+int getFiletype(const char *filename, int *byteorder)
+{
+  int filetype = CDI_EUFTYPE;
+  int fileID;
+  int swap = 0;
+  int version;
+  long recpos;
+  char buffer[8];
+
+  fileID = fileOpen(filename, "r");
+
+  if ( fileID == CDI_UNDEFID )
+    {
+      if ( memcmp(filename, "http:", 5) == 0 )
+	return (FILETYPE_NC);
+      else
+	return (CDI_ESYSTEM);
+    }
+
+  if ( fileRead(fileID, buffer, 8) != 8 ) return (CDI_EUFTYPE);
+
+  fileRewind(fileID);
+
+  if ( memcmp(buffer, "GRIB", 4) == 0 )
+    {
+      version = buffer[7];
+      if ( version <= 1 )
+	{
+	  filetype = FILETYPE_GRB;
+	  if ( CDI_Debug ) Message("found GRIB file = %s, version %d", filename, version);
+	}
+      else if ( version == 2 )
+	{
+	  filetype = FILETYPE_GRB2;
+	  if ( CDI_Debug ) Message("found GRIB2 file = %s", filename);
+	}
+    }
+  else if ( memcmp(buffer, "CDF\001", 4) == 0 )
+    {
+      filetype = FILETYPE_NC;
+      if ( CDI_Debug ) Message("found CDF1 file = %s", filename);
+    }
+  else if ( memcmp(buffer, "CDF\002", 4) == 0 )
+    {
+      filetype = FILETYPE_NC2;
+      if ( CDI_Debug ) Message("found CDF2 file = %s", filename);
+    }
+  else if ( memcmp(buffer+1, "HDF", 3) == 0 )
+    {
+      filetype = FILETYPE_NC4;
+      if ( CDI_Debug ) Message("found HDF file = %s", filename);
+    }
+#if  defined  (HAVE_LIBSERVICE)
+  else if ( srvCheckFiletype(fileID, &swap) )
+    {
+      filetype = FILETYPE_SRV;
+      if ( CDI_Debug ) Message("found SRV file = %s", filename);
+    }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+  else if ( extCheckFiletype(fileID, &swap) )
+    {
+      filetype = FILETYPE_EXT;
+      if ( CDI_Debug ) Message("found EXT file = %s", filename);
+    }
+#endif
+#if  defined  (HAVE_LIBIEG)
+  else if ( iegCheckFiletype(fileID, &swap) )
+    {
+      filetype = FILETYPE_IEG;
+      if ( CDI_Debug ) Message("found IEG file = %s", filename);
+    }
+#endif
+  else if ( gribCheckSeek(fileID, &recpos, &version) == 0 )
+    {
+      if ( version <= 1 )
+	{
+	  filetype = FILETYPE_GRB;
+	  if ( CDI_Debug ) Message("found seeked GRIB file = %s", filename);
+	}
+      else if ( version == 2 )
+	{
+	  filetype = FILETYPE_GRB2;
+	  if ( CDI_Debug ) Message("found seeked GRIB2 file = %s", filename);
+	}
+    }
+
+  fileClose(fileID);
+
+  *byteorder = getByteorder(swap);
+
+  return (filetype);
+}
+
+
+int _readline_(FILE *fp, char *line, int len)
+{
+  int ichar, ipos = 0;
+
+  while ( (ichar = fgetc(fp)) != EOF )
+    {
+      if ( ichar == '\n' ) break;
+      line[ipos++] = ichar;
+      if ( ipos >= len )
+        {
+          fprintf(stderr, "readline Warning: end of line not found (maxlen = %d)!\n", len);
+          break;
+        }
+    }
+  line[ipos] = 0;
+
+  if ( feof(fp) && ipos == 0 ) return (0);
+
+  return (1);
+}
+
+#define  MAX_LINE  4096
+
+int get_fnames(const char *argument, char *fnames[], int max_fnames)
+{
+  int num_fnames = 0;
+  int len;
+  int nfiles = 0;
+  int i, j;
+  const char *pch;
+  char line[MAX_LINE];
+
+  len = (int) strlen(argument);
+  for ( i = 0; i < len; ++i )
+    if ( argument[i] == ':' ) break;
+
+  if ( i < len )
+    {
+      pch = &argument[i+1];
+      len -= (i+1);
+      if ( len && ( memcmp(argument, "filelist:", i) == 0 ||
+		    memcmp(argument, "flist:", i) == 0 ) )
+	{
+	  for ( i = 0; i < len; ++i ) if ( pch[i] == ',' ) nfiles++;
+
+	  if ( nfiles == 0 )
+	    {
+	      FILE *fp;
+	      fp = fopen(pch, "r");
+	      if ( fp == NULL ) Error("Open failed on %s", pch);
+
+	      if ( CDI_Debug )
+		Message("Reading file names from %s", pch);
+
+	      rewind(fp);
+
+	      nfiles = 0;
+	      while ( _readline_(fp, line, MAX_LINE) )
+		{
+		  if ( line[0] == '#' || line[0] == '\0' ||
+		       line[0] == ' ' ) continue;
+
+		  if ( nfiles >= max_fnames )
+		    {
+		      Warning("Too many input files (limit: %d)", max_fnames);
+		      break;
+		    }
+		  fnames[nfiles] = strdupx(line);
+		  nfiles++;
+		}
+
+	      fclose(fp);
+
+	      if ( nfiles == 0 ) Error("No input file found in %s", pch);
+	    }
+	  else
+	    {
+	      char xline[65536];
+
+	      strcpy(xline, pch);
+	      for ( i = 0; i < len; i++ ) if ( xline[i] == ',' ) xline[i] = 0;
+
+	      nfiles++;
+	      if ( nfiles >= max_fnames )
+		{
+		  Warning("Too many input files (limit: %d)", max_fnames);
+		  nfiles = max_fnames;
+		}
+
+	      i = 0;
+	      for ( j = 0; j < nfiles; j++ )
+		{
+		  fnames[j] = strdupx(&xline[i]);
+		  i += strlen(&xline[i]) + 1;
+		}
+	    }
+	}
+      else if ( len && memcmp(argument, "ls:", i) == 0 )
+	{
+	  char command[4096];
+	  FILE *pfp;
+
+	  strcpy(command, "ls ");
+	  strcat(command, pch);
+
+	  pfp = popen(command, "r");
+	  if ( pfp == NULL ) SysError("popen %s failed", command);
+
+	  nfiles = 0;
+	  while ( _readline_(pfp, line, MAX_LINE) )
+	    {
+	      if ( nfiles >= max_fnames )
+		{
+		  Warning("Too many input files (limit: %d)", max_fnames);
+		  break;
+		}
+	      fnames[nfiles++] = strdupx(line);
+	    }
+
+	  pclose(pfp);
+	  /*
+	  for ( j = 0; j < nfiles; j++ )
+	    fnames[j] = fnames[j];
+	  */
+	}
+    }
+
+  num_fnames = nfiles;
+
+  return (num_fnames);
+}
+
+/*
+ at Function  streamInqFiletype
+ at Title     Get the filetype
+
+ at Prototype int streamInqFiletype(int streamID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead} or @fref{streamOpenWrite}.
+
+ at Description
+The function @func{streamInqFiletype} returns the filetype of a stream.
+
+ at Result
+ at func{streamInqFiletype} returns the type of the file format,
+one of the set of predefined CDI file format types.
+The valid CDI file format types are @func{FILETYPE_GRB}, @func{FILETYPE_GRB2}, @func{FILETYPE_NC}, @func{FILETYPE_NC2},
+ at func{FILETYPE_NC4}, @func{FILETYPE_NC4C}, @func{FILETYPE_SRV}, @func{FILETYPE_EXT} and @func{FILETYPE_IEG}.
+
+ at EndFunction
+*/
+int streamInqFiletype(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->filetype);
+}
+
+
+int getByteswap(int byteorder)
+{
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+  int byteswap = 0;
+
+  if ( IsBigendian() )
+    {
+      if ( byteorder == CDI_LITTLEENDIAN ) byteswap = TRUE;
+    }
+  else
+    {
+      if ( byteorder == CDI_BIGENDIAN ) byteswap = TRUE;
+    }
+
+  return (byteswap);
+}
+
+/*
+ at Function  streamDefByteorder
+ at Title     Define the byte order
+
+ at Prototype void streamDefByteorder(int streamID, int byteorder)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  byteorder The byte order of a dataset, one of the CDI constants @func{CDI_BIGENDIAN} and
+                     @func{CDI_LITTLEENDIAN}.
+
+ at Description
+The function @func{streamDefByteorder} defines the byte order of a binary dataset
+with the file format type @func{FILETYPE_SRV}, @func{FILETYPE_EXT} or @func{FILETYPE_IEG}.
+
+ at EndFunction
+*/
+void streamDefByteorder(int streamID, int byteorder)
+{
+  int filetype;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( reshGetStatus ( streamID, &streamOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  streamptr->byteorder = byteorder;
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+	srvrec_t *srvp = streamptr->record->srvp;
+	srvp->byteswap = getByteswap(byteorder);
+
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+	extrec_t *extp = streamptr->record->extp;
+	extp->byteswap = getByteswap(byteorder);
+
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+	iegrec_t *iegp = streamptr->record->iegp;
+	iegp->byteswap = getByteswap(byteorder);
+
+	break;
+      }
+#endif
+    }
+}
+
+/*
+ at Function  streamInqByteorder
+ at Title     Get the byte order
+
+ at Prototype int streamInqByteorder(int streamID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead} or @fref{streamOpenWrite}.
+
+ at Description
+The function @func{streamInqByteorder} returns the byte order of a binary dataset
+with the file format type @func{FILETYPE_SRV}, @func{FILETYPE_EXT} or @func{FILETYPE_IEG}.
+
+ at Result
+ at func{streamInqByteorder} returns the type of the byte order.
+The valid CDI byte order types are @func{CDI_BIGENDIAN} and @func{CDI_LITTLEENDIAN}
+
+ at EndFunction
+*/
+int streamInqByteorder(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->byteorder);
+}
+
+
+char *streamFilesuffix(int filetype)
+{
+  static char *fileSuffix[] = {"", ".grb", ".g2", ".nc", ".nc2", ".nc4", ".nc4", ".srv", ".ext", ".ieg", ".h5"};
+  int size = (int) (sizeof(fileSuffix)/sizeof(char *));
+
+  if ( filetype > 0 && filetype < size )
+    return (fileSuffix[filetype]);
+  else
+    return (fileSuffix[0]);
+}
+
+
+char *streamFilename(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->filename);
+}
+
+
+int cdiInqTimeSize(int streamID)
+{
+  int ntsteps;
+  int tsID = 0, nrecs;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  ntsteps = streamptr->ntsteps;
+
+  if ( ntsteps == CDI_UNDEFID )
+    while ( (nrecs = streamInqTimestep(streamID, tsID++)) )
+
+  ntsteps = streamptr->ntsteps;
+
+  return (ntsteps);
+}
+
+
+int cdiInqContents(int streamID)
+{
+  int filetype;
+  int vlistID;
+  int taxisID;
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        status = grbInqContents(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        status = srvInqContents(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        status = extInqContents(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        status = iegInqContents(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+        status = cdfInqContents(streamID);
+	break;
+      }
+#endif
+    default:
+      {
+	if ( CDI_Debug )
+	  Message("%s support not compiled in!", strfiletype(filetype));
+
+	status = CDI_ELIBNAVAIL;
+      }
+    }
+
+  if ( status == 0 )
+    {
+      vlistID = streamInqVlist(streamID);
+      taxisID = vlistInqTaxis(vlistID);
+      if ( taxisID != -1 )
+        {
+          taxis_t *taxisptr1 = &streamptr->tsteps[0].taxis;
+          taxis_t *taxisptr2 = taxisPtr(taxisID);
+          ptaxisCopy(taxisptr2, taxisptr1);
+          if ( taxisptr1->name     ) taxisptr2->name = taxisptr1->name;
+          if ( taxisptr1->longname ) taxisptr2->longname = taxisptr1->longname;
+        }
+    }
+
+  return (status);
+}
+
+
+int streamOpen(const char *filename, const char *filemode, int filetype)
+{
+  int fileID = CDI_UNDEFID;
+  int streamID = CDI_ESYSTEM;
+  int status;
+  Record *record = NULL;
+  stream_t *streamptr = NULL;
+  int hasLocalFile = namespaceHasLocalFile ( namespaceGetActive ());
+
+  if ( CDI_Debug )
+    Message("Open %s mode %c file %s", strfiletype(filetype), (int) *filemode, filename);
+
+  if ( ! filename || ! filemode || filetype < 0 ) return (CDI_EINVAL);
+
+  xdebug("START, filename = %s, filemode = %s, filetype = %d, "
+         "namespaceHasLocalFile(%d)=%s",
+         filename, filemode, filetype, namespaceGetActive(),
+	 namespaceHasLocalFile ( namespaceGetActive ()) ? "true":"false");
+
+  if ( hasLocalFile )
+    {
+      switch (filetype)
+	{
+#if  defined  (HAVE_LIBGRIB)
+	case FILETYPE_GRB:
+	case FILETYPE_GRB2:
+	  {
+	    fileID = gribOpen(filename, filemode);
+            if ( fileID < 0 ) fileID = CDI_ESYSTEM;
+            xdebug("%s OPENED, fileID=%d", filename, fileID);
+	    record = (Record *) malloc(sizeof(Record));
+	    record->buffer = NULL;
+	    break;
+	  }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+	case FILETYPE_SRV:
+	  {
+	    fileID = fileOpen(filename, filemode);
+            if ( fileID < 0 ) fileID = CDI_ESYSTEM;
+	    record = (Record *) malloc(sizeof(Record));
+	    record->buffer = NULL;
+	    record->srvp   = srvNew();
+	    break;
+	  }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+	case FILETYPE_EXT:
+	  {
+	    fileID = fileOpen(filename, filemode);
+            if ( fileID < 0 ) fileID = CDI_ESYSTEM;
+	    record = (Record *) malloc(sizeof(Record));
+	    record->buffer = NULL;
+	    record->extp   = extNew();
+	    break;
+	  }
+#endif
+#if  defined  (HAVE_LIBIEG)
+	case FILETYPE_IEG:
+	  {
+	    fileID = fileOpen(filename, filemode);
+            if ( fileID < 0 ) fileID = CDI_ESYSTEM;
+	    record = (Record *) malloc(sizeof(Record));
+	    record->buffer = NULL;
+	    record->iegp   = iegNew();
+	    break;
+	  }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+	case FILETYPE_NC:
+	  {
+	    fileID = cdfOpen(filename, filemode);
+	    break;
+	  }
+	case FILETYPE_NC2:
+	  {
+	    fileID = cdfOpen64(filename, filemode);
+	    break;
+	  }
+	case FILETYPE_NC4:
+	case FILETYPE_NC4C:
+	  {
+	    fileID = cdf4Open(filename, filemode, &filetype);
+	    break;
+	  }
+#endif
+	default:
+	  {
+	    if ( CDI_Debug ) Message("%s support not compiled in!", strfiletype(filetype));
+	    return (CDI_ELIBNAVAIL);
+	  }
+	}
+    }
+#ifdef USE_MPI
+  else if ( tolower ( * filemode ) == 'w' )
+    {
+      statusCode nspStatus = namespaceInqResStatus ();
+      switch ( nspStatus )
+        {
+        case STAGE_DEFINITION:
+          break;
+        case STAGE_TIMELOOP:
+          pioBufferFuncCall(STREAMOPEN, 2, filename, filetype);
+          break;
+        case STAGE_CLEANUP:
+          xabort ( "TRANSITION TO IO PROCESSES ALREADY FINISHED." );
+        break;
+        default:
+          xabort ( "INTERNAL ERROR" );
+        }
+    }
+#endif
+
+  if ( fileID < 0 && hasLocalFile )
+    {
+      streamID = fileID;
+    }
+  else
+    {
+      streamptr = stream_new_entry();
+      streamID  = streamptr->self;
+
+      if ( streamID < 0 ) return (CDI_ELIMIT);
+
+      streamptr->record   = record;
+      streamptr->filetype = filetype;
+      streamptr->filemode = tolower(*filemode);
+      streamptr->filename = strdupx(filename);
+      streamptr->fileID   = fileID;
+
+      if ( streamptr->filemode == 'r' )
+	{
+	  vlist_t *vlistptr;
+	  int vlistID;
+	  vlistID = vlistCreate();
+	  if ( vlistID < 0 ) return(CDI_ELIMIT);
+
+	  streamptr->vlistID = vlistID;
+	  /* cdiReadByteorder(streamID); */
+	  status = cdiInqContents(streamID);
+	  if ( status < 0 ) return (status);
+	  vlistptr = vlist_to_pointer(streamptr->vlistID);
+	  vlistptr->ntsteps = streamNtsteps(streamID);
+	}
+    }
+
+  return (streamID);
+}
+
+
+int streamOpenA(const char *filename, const char *filemode, int filetype)
+{
+  int fileID = CDI_UNDEFID;
+  int streamID = CDI_ESYSTEM;
+  int status;
+  Record *record = NULL;
+  stream_t *streamptr = NULL;
+
+  if ( CDI_Debug )
+    Message("Open %s mode %c file %s", strfiletype(filetype), (int) *filemode, filename);
+
+  if ( ! filename || ! filemode || filetype < 0 ) return (CDI_EINVAL);
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        fileID = gribOpen(filename, "r");
+	record = (Record *) malloc(sizeof(Record));
+	record->buffer = NULL;
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        fileID = fileOpen(filename, "r");
+	record = (Record *) malloc(sizeof(Record));
+	record->buffer = NULL;
+	record->srvp   = srvNew();
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        fileID = fileOpen(filename, "r");
+	record = (Record *) malloc(sizeof(Record));
+	record->buffer = NULL;
+	record->extp   = extNew();
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        fileID = fileOpen(filename, "r");
+	record = (Record *) malloc(sizeof(Record));
+	record->buffer = NULL;
+	record->iegp   = iegNew();
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+      {
+	fileID = cdfOpen(filename, "r");
+	break;
+      }
+    case FILETYPE_NC2:
+      {
+	fileID = cdfOpen64(filename, "r");
+	break;
+      }
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	fileID = cdf4Open(filename, "r", &filetype);
+	break;
+      }
+#endif
+    default:
+      {
+	if ( CDI_Debug ) Message("%s support not compiled in!", strfiletype(filetype));
+	return (CDI_ELIBNAVAIL);
+      }
+    }
+
+  if ( fileID == CDI_UNDEFID || fileID == CDI_ELIBNAVAIL )
+    {
+      streamID = fileID;
+      return (streamID);
+    }
+  else
+    {
+      vlist_t *vlistptr;
+      streamptr = stream_new_entry();
+      streamID = streamptr->self;
+
+      streamptr->record   = record;
+      streamptr->filetype = filetype;
+      streamptr->filemode = tolower(*filemode);
+      streamptr->filename = strdupx(filename);
+      streamptr->fileID   = fileID;
+
+      streamptr->vlistID = vlistCreate();
+      /* cdiReadByteorder(streamID); */
+      status = cdiInqContents(streamID);
+      if ( status < 0 ) return (status);
+      vlistptr = vlist_to_pointer(streamptr->vlistID);
+      vlistptr->ntsteps = cdiInqTimeSize(streamID);
+    }
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+	gribClose(fileID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+	fileClose(fileID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+	fileClose(fileID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+	fileClose(fileID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	cdfClose(fileID);
+	break;
+      }
+#endif
+    default:
+      {
+	if ( CDI_Debug ) Message("%s support not compiled in!", strfiletype(filetype));
+	return (CDI_ELIBNAVAIL);
+      }
+    }
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        fileID = gribOpen(filename, filemode);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        fileID = fileOpen(filename, filemode);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        fileID = fileOpen(filename, filemode);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        fileID = fileOpen(filename, filemode);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+      {
+	fileID = cdfOpen(filename, filemode);
+	streamptr->ncmode = 2;
+	break;
+      }
+    case FILETYPE_NC2:
+      {
+	fileID = cdfOpen64(filename, filemode);
+	streamptr->ncmode = 2;
+	break;
+      }
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	fileID = cdf4Open(filename, filemode, &filetype);
+	streamptr->ncmode = 2;
+	break;
+      }
+#endif
+    default:
+      {
+	if ( CDI_Debug ) Message("%s support not compiled in!", strfiletype(filetype));
+	return (CDI_ELIBNAVAIL);
+      }
+    }
+
+  if ( fileID == CDI_UNDEFID )
+    streamID = CDI_UNDEFID;
+  else
+    streamptr->fileID   = fileID;
+
+  return (streamID);
+}
+
+/*
+ at Function  streamOpenRead
+ at Title     Open a dataset for reading
+
+ at Prototype int streamOpenRead(const char *path)
+ at Parameter
+    @Item  path  The name of the dataset to be read.
+
+ at Description
+The function @func{streamOpenRead} opens an existing dataset for reading.
+
+ at Result
+Upon successful completion @func{streamOpenRead} returns an identifier to the
+open stream. Otherwise, a negative number with the error status is returned.
+
+ at Errors
+ at List
+   @Item  CDI_ESYSTEM     Operating system error.
+   @Item  CDI_EINVAL      Invalid argument.
+   @Item  CDI_EUFILETYPE  Unsupported file type.
+   @Item  CDI_ELIBNAVAIL  Library support not compiled in.
+ at EndList
+
+ at Example
+Here is an example using @func{streamOpenRead} to open an existing netCDF
+file named @func{foo.nc} for reading:
+
+ at Source
+   ...
+int streamID;
+   ...
+streamID = streamOpenRead("foo.nc");
+if ( streamID < 0 ) handle_error(streamID);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int streamOpenRead(const char *filenames)
+{
+  int filetype, byteorder;
+  int streamID;
+  int num_fnames = 0;
+  char *fnames[MAX_FNAMES];
+  const char *filename;
+  stream_t *streamptr = NULL;
+
+  cdiInitialize();
+
+  //num_fnames = get_fnames(filenames, fnames, MAX_FNAMES);
+
+  if ( num_fnames == 0 )
+    filename = filenames;
+  else
+    {
+      int i;
+      for ( i = 0; i < num_fnames; ++i ) printf("fnames: %d %s\n", i, fnames[i]);
+      filename = fnames[0];
+    }
+
+  filetype = getFiletype(filename, &byteorder);
+
+  if ( filetype < 0 ) return (filetype);
+
+  streamID = streamOpen(filename, "r", filetype);
+
+  if ( streamID >= 0 )
+    {
+      streamptr = stream_to_pointer(streamID);
+      streamptr->byteorder = byteorder;
+
+      if ( num_fnames > 0 )
+	{
+	  int i;
+	  streamptr->nfiles = num_fnames;
+	  streamptr->fnames = (char **) malloc(num_fnames*sizeof(char *));
+	  for ( i = 0; i < num_fnames; ++i )
+	    streamptr->fnames[i] = fnames[i];
+	}
+    }
+
+  return (streamID);
+}
+
+
+int streamOpenAppend(const char *filename)
+{
+  int filetype, byteorder;
+  int streamID;
+  stream_t *streamptr;
+
+  cdiInitialize();
+
+  filetype = getFiletype(filename, &byteorder);
+
+  if ( filetype < 0 ) return (filetype);
+
+  streamID = streamOpenA(filename, "a", filetype);
+
+  if ( streamID >= 0 )
+    {
+      streamptr = stream_to_pointer(streamID);
+      streamptr->byteorder = byteorder;
+    }
+
+  return (streamID);
+}
+
+/*
+ at Function  streamOpenWrite
+ at Title     Create a new dataset
+
+ at Prototype int streamOpenWrite(const char *path, int filetype)
+ at Parameter
+    @Item  path      The name of the new dataset.
+    @Item  filetype  The type of the file format, one of the set of predefined CDI file format types.
+                     The valid CDI file format types are @func{FILETYPE_GRB}, @func{FILETYPE_GRB2}, @func{FILETYPE_NC},
+                     @func{FILETYPE_NC2}, @func{FILETYPE_NC4}, @func{FILETYPE_NC4C}, @func{FILETYPE_SRV},
+                     @func{FILETYPE_EXT} and @func{FILETYPE_IEG}.
+
+ at Description
+The function @func{streamOpenWrite} creates a new datset.
+ at Result
+Upon successful completion @func{streamOpenWrite} returns an identifier to the
+open stream. Otherwise, a negative number with the error status is returned.
+
+ at Errors
+ at List
+   @Item  CDI_ESYSTEM     Operating system error.
+   @Item  CDI_EINVAL      Invalid argument.
+   @Item  CDI_EUFILETYPE  Unsupported file type.
+   @Item  CDI_ELIBNAVAIL  Library support not compiled in.
+ at EndList
+
+ at Example
+Here is an example using @func{streamOpenWrite} to create a new netCDF file
+named @func{foo.nc} for writing:
+
+ at Source
+   ...
+int streamID;
+   ...
+streamID = streamOpenWrite("foo.nc", FILETYPE_NC);
+if ( streamID < 0 ) handle_error(streamID);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int streamOpenWrite(const char *filename, int filetype)
+{
+  cdiInitialize();
+
+  return (streamOpen(filename, "w", filetype));
+}
+
+/*
+ at Function  streamClose
+ at Title     Close an open dataset
+
+ at Prototype  void streamClose(int streamID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead} or @fref{streamOpenWrite}.
+
+ at Description
+The function @func{streamClose} closes an open dataset.
+
+ at EndFunction
+*/
+void streamClose(int streamID)
+{
+  int filetype;
+  int fileID;
+  int index;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( CDI_Debug )
+    Message("fileID = %d filename = %s", streamID, streamptr->filename);
+
+  fileID   = streamptr->fileID;
+  filetype = streamptr->filetype;
+  vlistID  = streamptr->vlistID;
+
+  if ( namespaceHasLocalFile ( namespaceGetActive ()))
+    {
+      if ( fileID == CDI_UNDEFID )
+        Warning("File %s not open!", streamptr->filename);
+      else
+	switch (filetype)
+	  {
+#if  defined  (HAVE_LIBGRIB)
+	  case FILETYPE_GRB:
+	  case FILETYPE_GRB2:
+	    {
+	      gribClose(fileID);
+	      gribContainersDelete(streamID);
+	      break;
+	    }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+	  case FILETYPE_SRV:
+	    {
+	      fileClose(fileID);
+	      srvDelete(streamptr->record->srvp);
+	      break;
+	    }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+	  case FILETYPE_EXT:
+	    {
+	      fileClose(fileID);
+	      extDelete(streamptr->record->extp);
+	      break;
+	    }
+#endif
+#if  defined  (HAVE_LIBIEG)
+	  case FILETYPE_IEG:
+	    {
+	      fileClose(fileID);
+	      iegDelete(streamptr->record->iegp);
+	      break;
+	    }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+	  case FILETYPE_NC:
+	  case FILETYPE_NC2:
+	  case FILETYPE_NC4:
+	  case FILETYPE_NC4C:
+	    {
+	      cdfClose(fileID);
+	      break;
+	    }
+#endif
+	  default:
+	    {
+	      Error("%s support not compiled in!", strfiletype(filetype));
+	      break;
+	    }
+	  }
+    }
+#ifdef USE_MPI
+  else
+    {
+      statusCode nspStatus = namespaceInqResStatus ();
+      switch ( nspStatus )
+        {
+        case STAGE_DEFINITION:
+          break;
+        case STAGE_TIMELOOP:
+          pioBufferFuncCall(STREAMCLOSE, 1, streamID);
+          break;
+        case STAGE_CLEANUP:
+        break;
+        default:
+          xabort ( "INTERNAL ERROR" );
+        }
+    }
+#endif
+
+  if ( streamptr->record )
+      {
+	  if ( streamptr->record->buffer )
+              free(streamptr->record->buffer);
+
+	  free(streamptr->record);
+      }
+
+  streamptr->filetype = 0;
+  if ( streamptr->filename ) free(streamptr->filename);
+
+  for ( index = 0; index < streamptr->nvars; index++ )
+    {
+      if ( streamptr->vars[index].level )
+	free(streamptr->vars[index].level);
+      if ( streamptr->vars[index].lindex )
+	free(streamptr->vars[index].lindex);
+    }
+  free(streamptr->vars);
+
+  for ( index = 0; index < streamptr->ntsteps; ++index )
+    {
+      if ( streamptr->tsteps[index].records )
+	free(streamptr->tsteps[index].records);
+      if ( streamptr->tsteps[index].recIDs )
+	free(streamptr->tsteps[index].recIDs);
+    }
+
+  if ( streamptr->tsteps ) free(streamptr->tsteps);
+
+  if ( streamptr->nfiles > 0 )
+    {
+      for ( index = 0; index < streamptr->nfiles; ++index )
+	free(streamptr->fnames[index]);
+
+      free(streamptr->fnames);
+    }
+
+  if ( vlistID != -1 )
+    {
+      if ( streamptr->filemode != 'w' )
+	if ( vlistInqTaxis(vlistID) != -1 )
+	  {
+	    taxisDestroy(vlistInqTaxis(vlistID));
+	  }
+
+      vlistDestroy(vlistID);
+    }
+
+  stream_delete_entry(streamptr);
+}
+
+/*
+ at Function  streamSync
+ at Title     Synchronize an Open Dataset to Disk
+
+ at Prototype  void streamSync(int streamID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+
+ at Description
+The function @func{streamSync} offers a way to synchronize the disk copy of a dataset with in-memory buffers.
+
+ at EndFunction
+*/
+void streamSync(int streamID)
+{
+  int filetype;
+  int fileID;
+  int vlistID;
+  int nvars;
+  stream_t *streamptr;
+
+  if ( !namespaceHasLocalFile ( namespaceGetActive ())) return;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID   = streamptr->fileID;
+  filetype = streamptr->filetype;
+  vlistID  = streamInqVlist(streamID);
+  nvars    = vlistNvars(vlistID);
+
+  if ( fileID == CDI_UNDEFID )
+    Warning("File %s not open!", streamptr->filename);
+  else if ( vlistID == CDI_UNDEFID )
+    Warning("Vlist undefined for file %s!", streamptr->filename);
+  else if ( nvars == 0 )
+    Warning("No variables defined!");
+  else
+    {
+      if ( streamptr->filemode == 'w' || streamptr->filemode == 'a' )
+	{
+	  switch (filetype)
+	    {
+#if  defined  (HAVE_LIBNETCDF)
+	    case FILETYPE_NC:
+	    case FILETYPE_NC2:
+	    case FILETYPE_NC4:
+	    case FILETYPE_NC4C:
+	      {
+		void cdf_sync(int ncid);
+		if ( streamptr->ncmode == 2 ) cdf_sync(fileID);
+		break;
+	      }
+#endif
+	    default:
+	      {
+		fileFlush(fileID);
+		break;
+	      }
+	    }
+	}
+    }
+}
+
+/*
+ at Function  streamDefTimestep
+ at Title     Define time step
+
+ at Prototype int streamDefTimestep(int streamID, int tsID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  tsID      Timestep identifier.
+
+ at Description
+The function @func{streamDefTimestep} defines the time step of a stream.
+
+ at Result
+ at func{streamDefTimestep} returns the number of records of the time step.
+
+ at EndFunction
+*/
+int streamDefTimestep(int streamID, int tsID)
+{
+  int newtsID;
+  int taxisID;
+  int vlistID;
+  int time_is_varying;
+  stream_t *streamptr;
+  taxis_t *taxisptr1;
+  taxis_t *taxisptr2;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  tsID = %d", streamID, tsID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+
+  time_is_varying = vlistHasTime(vlistID);
+
+  if ( time_is_varying )
+    {
+      taxisID = vlistInqTaxis(vlistID);
+      if ( taxisID == CDI_UNDEFID )
+        {
+          Warning("taxisID undefined for fileID = %d! Using absolute time axis.", streamID);
+          taxisID = taxisCreate(TAXIS_ABSOLUTE);
+          vlistDefTaxis(vlistID, taxisID);
+        }
+    }
+
+  newtsID = tstepsNewEntry(streamID);
+
+  if ( tsID != newtsID )
+    Error("Internal problem: tsID = %d newtsID = %d", tsID, newtsID);
+
+  streamptr->curTsID = tsID;
+
+  if ( time_is_varying )
+    {
+      taxisptr1 = taxisPtr(taxisID);
+      taxisptr2 = &streamptr->tsteps[tsID].taxis;
+      ptaxisCopy(taxisptr2, taxisptr1);
+      if ( tsID == 0 )
+        {
+          if ( taxisptr1->name     ) taxisptr2->name = taxisptr1->name;
+          if ( taxisptr1->longname ) taxisptr2->longname = taxisptr1->longname;
+        }
+    }
+
+  streamptr->ntsteps = tsID + 1;
+
+  if ( namespaceHasLocalFile(namespaceGetActive())
+       && (streamptr->filetype == FILETYPE_NC  ||
+           streamptr->filetype == FILETYPE_NC2 ||
+           streamptr->filetype == FILETYPE_NC4 ||
+           streamptr->filetype == FILETYPE_NC4C)
+       && time_is_varying )
+    cdfDefTimestep(streamID, tsID);
+
+  cdiCreateRecords(streamID, tsID);
+
+  return (streamptr->ntsteps);
+}
+
+/*
+ at Function  streamInqTimestep
+ at Title     Get time step
+
+ at Prototype int streamInqTimestep(int streamID, int tsID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead} or @fref{streamOpenWrite}.
+    @Item  tsID      Timestep identifier.
+
+ at Description
+The function @func{streamInqTimestep} returns the time step of a stream.
+
+ at Result
+ at func{streamInqTimestep} returns the number of records of the time step.
+
+ at EndFunction
+*/
+int streamInqTimestep(int streamID, int tsID)
+{
+  int filetype;
+  int nrecs = 0;
+  int taxisID;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+
+  if ( tsID < streamptr->rtsteps )
+    {
+      streamptr->curTsID = tsID;
+      nrecs = streamptr->tsteps[tsID].nrecs;
+      streamptr->tsteps[tsID].curRecID = CDI_UNDEFID;
+      taxisID = vlistInqTaxis(vlistID);
+      if ( taxisID == -1 )
+	Error("Timestep undefined for fileID = %d", streamID);
+      ptaxisCopy(taxisPtr(taxisID), &streamptr->tsteps[tsID].taxis);
+
+      return (nrecs);
+    }
+
+  if ( tsID >= streamptr->ntsteps && streamptr->ntsteps != CDI_UNDEFID )
+    {
+      return (0);
+    }
+
+  filetype = streamptr->filetype;
+
+  if ( CDI_Debug )
+    Message("streamID = %d  tsID = %d  filetype = %d", streamID, tsID, filetype);
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        nrecs = grbInqTimestep(streamID, tsID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        nrecs = srvInqTimestep(streamID, tsID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        nrecs = extInqTimestep(streamID, tsID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        nrecs = iegInqTimestep(streamID, tsID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+        nrecs = cdfInqTimestep(streamID, tsID);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+
+  taxisID = vlistInqTaxis(vlistID);
+  if ( taxisID == -1 )
+    Error("Timestep undefined for fileID = %d", streamID);
+
+  ptaxisCopy(taxisPtr(taxisID), &streamptr->tsteps[tsID].taxis);
+
+  return (nrecs);
+}
+
+/*
+ at Function  streamReadVar
+ at Title     Read a variable
+
+ at Prototype void streamReadVar(int streamID, int varID, double *data, int *nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead}.
+    @Item  varID     Variable identifier.
+    @Item  data      Pointer to the location into which the data values are read.
+                     The caller must allocate space for the returned values.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamReadVar reads all the values of one time step of a variable
+from an open dataset.
+ at EndFunction
+*/
+void streamReadVar(int streamID, int varID, double *data, int *nmiss)
+{
+  int filetype;
+  stream_t *streamptr;
+
+  if ( CDI_Debug ) Message("streamID = %d  varID = %d", streamID, varID);
+
+  check_parg(data);
+  check_parg(nmiss);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  *nmiss = 0;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        grbReadVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        srvReadVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        extReadVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        iegReadVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+        cdfReadVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+
+void stream_write_var(int streamID, int varID, int memtype, const void *data, int nmiss)
+{
+  int filetype;
+  stream_t *streamptr;
+
+  if ( CDI_Debug ) Message("streamID = %d varID = %d", streamID, varID);
+
+  check_parg(data);
+
+  /* begin deike */
+#ifdef USE_MPI
+  if ( ! namespaceHasLocalFile ( namespaceGetActive ()))
+    {
+      statusCode nspStatus = namespaceInqResStatus ();
+      switch ( nspStatus )
+        {
+        case STAGE_DEFINITION:
+          xabort ( "DEFINITION STAGE: PARALLEL WRITING NOT POSSIBLE." );
+          break;
+        case STAGE_TIMELOOP:
+          pioBufferData ( streamID, varID, data, nmiss );
+          return;
+        case STAGE_CLEANUP:
+          xabort ( "CLEANUP STAGE: PARALLEL WRITING NOT POSSIBLE." );
+          break;
+        default:
+          xabort ( "INTERNAL ERROR" );
+        }
+    }
+#endif
+  /* end deike */
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  // streamDefineTaxis(streamID);
+
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("grbWriteVar not implemented for memtype float!");
+        grbWriteVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("srvWriteVar not implemented for memtype float!");
+        srvWriteVarDP(streamID, varID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("extWriteVar not implemented for memtype float!");
+        extWriteVarDP(streamID, varID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("iegWriteVar not implemented for memtype float!");
+        iegWriteVarDP(streamID, varID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	if ( streamptr->accessmode == 0 ) cdfEndDef(streamID);
+        cdf_write_var(streamID, varID, memtype, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+/*
+ at Function  streamWriteVar
+ at Title     Write a variable
+
+ at Prototype void streamWriteVar(int streamID, int varID, const double *data, int nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  varID     Variable identifier.
+    @Item  data      Pointer to a block of double precision floating point data values to be written.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamWriteVar writes the values of one time step of a variable to an open dataset.
+The values are converted to the external data type of the variable, if necessary.
+ at EndFunction
+*/
+void streamWriteVar(int streamID, int varID, const double *data, int nmiss)
+{
+  stream_write_var(streamID, varID, MEMTYPE_DOUBLE, data, nmiss);
+}
+
+/*
+ at Function  streamWriteVarF
+ at Title     Write a variable
+
+ at Prototype void streamWriteVarF(int streamID, int varID, const float *data, int nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  varID     Variable identifier.
+    @Item  data      Pointer to a block of single precision floating point data values to be written.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamWriteVarF writes the values of one time step of a variable to an open dataset.
+The values are converted to the external data type of the variable, if necessary.
+Only support for netCDF was implemented in this function.
+ at EndFunction
+*/
+void streamWriteVarF(int streamID, int varID, const float *data, int nmiss)
+{
+  stream_write_var(streamID, varID, MEMTYPE_FLOAT, data, nmiss);
+}
+
+/*
+ at Function  streamReadVarSlice
+ at Title     Read a horizontal slice of a variable
+
+ at Prototype void streamReadVarSlice(int streamID, int varID, int levelID, double *data, int *nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead}.
+    @Item  varID     Variable identifier.
+    @Item  levelID   Level identifier.
+    @Item  data      Pointer to the location into which the data values are read.
+                     The caller must allocate space for the returned values.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamReadVar reads all the values of a horizontal slice of a variable
+from an open dataset.
+ at EndFunction
+*/
+void streamReadVarSlice(int streamID, int varID, int levelID, double *data, int *nmiss)
+{
+  int filetype;
+  stream_t *streamptr;
+
+  if ( CDI_Debug ) Message("streamID = %d  varID = %d", streamID, varID);
+
+  check_parg(data);
+  check_parg(nmiss);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  *nmiss = 0;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        grbReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        srvReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        extReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        iegReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+        /* FIXME: status value ignored */
+        int ierr = cdfReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+
+void stream_write_var_slice(int streamID, int varID, int levelID, int memtype, const void *data, int nmiss)
+{
+  int filetype;
+  stream_t *streamptr;
+
+  if ( CDI_Debug ) Message("streamID = %d varID = %d", streamID, varID);
+
+  check_parg(data);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("grbWriteVarSlice not implemented for memtype float!");
+        grbWriteVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("srvWriteVarSlice not implemented for memtype float!");
+        srvWriteVarSliceDP(streamID, varID, levelID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("extWriteVarSlice not implemented for memtype float!");
+        extWriteVarSliceDP(streamID, varID, levelID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("iegWriteVarSlice not implemented for memtype float!");
+        iegWriteVarSliceDP(streamID, varID, levelID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+        int ierr = 0;
+	if ( streamptr->accessmode == 0 ) cdfEndDef(streamID);
+        ierr = cdf_write_var_slice(streamID, varID, levelID, memtype, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+/*
+ at Function  streamWriteVarSlice
+ at Title     Write a horizontal slice of a variable
+
+ at Prototype void streamWriteVarSlice(int streamID, int varID, int levelID, const double *data, int nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  varID     Variable identifier.
+    @Item  levelID   Level identifier.
+    @Item  data      Pointer to a block of double precision floating point data values to be written.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamWriteVarSlice writes the values of a horizontal slice of a variable to an open dataset.
+The values are converted to the external data type of the variable, if necessary.
+ at EndFunction
+*/
+void streamWriteVarSlice(int streamID, int varID, int levelID, const double *data, int nmiss)
+{
+  stream_write_var_slice(streamID, varID, levelID, MEMTYPE_DOUBLE, data, nmiss);
+}
+
+/*
+ at Function  streamWriteVarSliceF
+ at Title     Write a horizontal slice of a variable
+
+ at Prototype void streamWriteVarSliceF(int streamID, int varID, int levelID, const float *data, int nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  varID     Variable identifier.
+    @Item  levelID   Level identifier.
+    @Item  data      Pointer to a block of single precision floating point data values to be written.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamWriteVarSliceF writes the values of a horizontal slice of a variable to an open dataset.
+The values are converted to the external data type of the variable, if necessary.
+Only support for netCDF was implemented in this function.
+ at EndFunction
+*/
+void streamWriteVarSliceF(int streamID, int varID, int levelID, const float *data, int nmiss)
+{
+  stream_write_var_slice(streamID, varID, levelID, MEMTYPE_FLOAT, data, nmiss);
+}
+
+
+void streamWriteContents(int streamID, char *cname)
+{
+  FILE *cnp;
+  int tsID, recID, varID, levelID;
+  long recsize;
+  int nrecs, nvars;
+  int code, gridID, zaxisID, tsteptype, datatype;
+  int ngrids;
+  int filetype, gridtype;
+  int xsize, ysize;
+  int date, time;
+  int i;
+  off_t recpos, position;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+
+  cnp = fopen(cname, "w");
+
+  if ( cnp == NULL ) SysError(cname);
+
+  fprintf(cnp, "#CDI library version %s\n", cdiLibraryVersion());
+  fprintf(cnp, "#\n");
+
+  fprintf(cnp, "filename: %s\n", streamptr->filename);
+  filetype = streamptr->filetype;
+  fprintf(cnp, "filetype: %s\n", strfiletype(filetype));
+
+  fprintf(cnp, "#\n");
+  fprintf(cnp, "#grids:\n");
+
+  ngrids = vlistNgrids(vlistID);
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID   = vlistGrid(vlistID, i);
+      gridtype = gridInqType(gridID);
+      xsize    = gridInqXsize(gridID);
+      ysize    = gridInqYsize(gridID);
+      fprintf(cnp, "%4d:%4d:%4d:%4d\n", i+1, gridtype, xsize, ysize);
+    }
+
+  fprintf(cnp, "#\n");
+
+  fprintf(cnp, "varID:code:gridID:zaxisID:tsteptype:datatype\n");
+
+  nvars = vlistNvars(vlistID);
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      code      = vlistInqVarCode(vlistID, varID);
+      gridID    = vlistInqVarGrid(vlistID, varID);
+      zaxisID   = vlistInqVarZaxis(vlistID, varID);
+      tsteptype = vlistInqVarTsteptype(vlistID, varID);
+      datatype  = vlistInqVarDatatype(vlistID, varID);
+      fprintf(cnp, "%4d:%4d:%4d:%4d:%4d:%4d:\n",
+	      varID+1, code, gridID, zaxisID, tsteptype, datatype);
+    }
+
+  fprintf(cnp, "#\n");
+
+  fprintf(cnp, "tsID:nrecs:date:time\n");
+
+  tsID = 0;
+  while (1)
+    {
+      nrecs = streamptr->tsteps[tsID].nallrecs;
+      date  = streamptr->tsteps[tsID].taxis.vdate;
+      time  = streamptr->tsteps[tsID].taxis.vtime;
+      position = streamptr->tsteps[tsID].position;
+
+      fprintf(cnp, "%4d:%4d:%4d:%4d:%ld\n",
+	      tsID, nrecs, date, time, (long) position);
+
+      if ( streamptr->tsteps[tsID].next )
+	tsID++;
+      else
+	break;
+    }
+
+  fprintf(cnp, "#\n");
+
+  fprintf(cnp, "tsID:recID:varID:levID:size:pos\n");
+
+  tsID = 0;
+  while (1)
+    {
+      nrecs = streamptr->tsteps[tsID].nallrecs;
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  varID   = streamptr->tsteps[tsID].records[recID].varID;
+	  levelID = streamptr->tsteps[tsID].records[recID].levelID;
+	  recpos  = streamptr->tsteps[tsID].records[recID].position;
+	  recsize = (long)streamptr->tsteps[tsID].records[recID].size;
+	  fprintf(cnp, "%4d:%4d:%4d:%4d:%4ld:%ld\n",
+		  tsID, recID, varID, levelID, recsize, (long) recpos);
+	}
+
+      if ( streamptr->tsteps[tsID].next )
+	tsID++;
+      else
+	break;
+    }
+
+  fclose(cnp);
+}
+
+
+void cdiDefTableID(int tableID)
+{
+  int modelID, instID;
+
+  cdiDefaultTableID = tableID;
+
+  modelID = tableInqModel(tableID);
+  cdiDefaultModelID = modelID;
+
+  instID = modelInqInstitut(modelID);
+  cdiDefaultInstID = instID;
+}
+
+
+void cdiPrintVersion(void)
+{
+  fprintf(stderr, "     CDI library version : %s\n", cdiLibraryVersion());
+#if  defined  (HAVE_LIBCGRIBEX)
+  fprintf(stderr, " CGRIBEX library version : %s\n", cgribexLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBGRIB_API)
+  fprintf(stderr, "GRIB_API library version : %s\n", gribapiLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+  fprintf(stderr, "  netCDF library version : %s\n", cdfLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBHDF5)
+  fprintf(stderr, "    HDF5 library version : %s\n", hdfLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+  fprintf(stderr, " SERVICE library version : %s\n", srvLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+  fprintf(stderr, "   EXTRA library version : %s\n", extLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBIEG)
+  fprintf(stderr, "     IEG library version : %s\n", iegLibraryVersion());
+#endif
+  fprintf(stderr, "    FILE library version : %s\n", fileLibraryVersion());
+}
+
+
+int streamNtsteps(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->ntsteps);
+}
+
+
+off_t   streamNvals(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->numvals);
+}
+
+/*
+ at Function  streamDefVlist
+ at Title     Define the variable list
+
+ at Prototype void streamDefVlist(int streamID, int vlistID)
+ at Parameter
+    @Item  streamID Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+
+ at Description
+The function @func{streamDefVlist} defines the variable list of a stream.
+
+ at EndFunction
+*/
+void streamDefVlist(int streamID, int vlistID)
+{
+  int nvars, varID;
+  int gridID, zaxisID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+#ifdef USE_MPI
+  if (!namespaceHasLocalFile(namespaceGetActive()))
+  {
+    statusCode nspStatus = namespaceInqResStatus ();
+    switch ( nspStatus )
+      {
+      case STAGE_DEFINITION:
+        break;
+      case STAGE_TIMELOOP:
+        pioBufferFuncCall(STREAMDEFVLIST, 2, streamID, vlistID);
+        break;
+      case STAGE_CLEANUP:
+        xabort ( "TRANSITION TO IO PROCESSES ALREADY FINISHED." );
+        break;
+      default:
+        xabort ( "INTERNAL ERROR" );
+      }
+  }
+
+#endif
+
+  if ( streamptr->vlistID == CDI_UNDEFID )
+    {
+      streamptr->vlistID = vlistDuplicate(vlistID);
+      streamptr->vlistIDorig = vlistID ;
+
+      nvars = vlistNvars(vlistID);
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridID  = vlistInqVarGrid(vlistID, varID);
+	  zaxisID = vlistInqVarZaxis(vlistID, varID);
+	  streamNewVar(streamID, gridID, zaxisID);
+	  if ( streamptr->have_missval )
+	    vlistDefVarMissval(streamptr->vlistID, varID, 
+                               vlistInqVarMissval(vlistID, varID));
+	}
+
+      if (namespaceHasLocalFile(namespaceGetActive())
+          && streamptr->filemode == 'w' )
+	{
+	  if ( streamptr->filetype == FILETYPE_NC  ||
+	       streamptr->filetype == FILETYPE_NC2 ||
+	       streamptr->filetype == FILETYPE_NC4 ||
+	       streamptr->filetype == FILETYPE_NC4C )
+	    {
+	      cdfDefVars(streamID);
+	    }
+	  else if ( streamptr->filetype == FILETYPE_GRB  ||
+		    streamptr->filetype == FILETYPE_GRB2 )
+	    {
+	      gribContainersNew(streamID);
+	    }
+	}
+    }
+  else
+    {
+      Warning("vlist already defined for %s!", streamptr->filename);
+    }
+}
+
+/*
+ at Function  streamInqVlist
+ at Title     Get the variable list
+
+ at Prototype int streamInqVlist(int streamID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead} or @fref{streamOpenWrite}.
+
+ at Description
+The function @func{streamInqVlist} returns the variable list of a stream.
+
+ at Result
+ at func{streamInqVlist} returns an identifier to the variable list.
+
+ at EndFunction
+*/
+int streamInqVlist(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->vlistID);
+}
+
+
+int streamInqVlistIDorig(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->vlistIDorig);
+}
+
+
+void streamDefCompType(int streamID, int comptype)
+{
+  stream_t *streamptr;
+
+  if ( reshGetStatus ( streamID, &streamOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->comptype = comptype;
+}
+
+
+void streamDefCompLevel(int streamID, int complevel)
+{
+  stream_t *streamptr;
+
+  if ( reshGetStatus ( streamID, &streamOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->complevel = complevel;
+}
+
+
+int streamInqCompType(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->comptype);
+}
+
+
+int streamInqCompLevel(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->complevel);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+
+
+void streamDefHistory(int streamID, int length, const char *history)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->filetype == FILETYPE_NC  ||
+       streamptr->filetype == FILETYPE_NC2 ||
+       streamptr->filetype == FILETYPE_NC4 ||
+       streamptr->filetype == FILETYPE_NC4C )
+    {
+      char *histstring;
+      size_t len;
+      if ( history )
+	{
+	  len = strlen(history);
+	  if ( len )
+	    {
+	      histstring = strdupx(history);
+	      cdfDefHistory(streamID, length, histstring);
+	      free(histstring);
+	    }
+	}
+    }
+}
+
+
+int streamInqHistorySize(int streamID)
+{
+  int size = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->filetype == FILETYPE_NC  ||
+       streamptr->filetype == FILETYPE_NC2 ||
+       streamptr->filetype == FILETYPE_NC4 ||
+       streamptr->filetype == FILETYPE_NC4C )
+    {
+      size = cdfInqHistorySize(streamID);
+    }
+
+  return (size);
+}
+
+
+void streamInqHistoryString(int streamID, char *history)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->filetype == FILETYPE_NC  ||
+       streamptr->filetype == FILETYPE_NC2 ||
+       streamptr->filetype == FILETYPE_NC4 ||
+       streamptr->filetype == FILETYPE_NC4C )
+    {
+      cdfInqHistoryString(streamID, history);
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+// #include <float.h>  /* FLT_EPSILON */
+
+
+#if  defined  (HAVE_LIBCGRIBEX)
+#endif
+
+extern int cdiInventoryMode;
+
+typedef struct {
+  int param;
+  int level1;
+  int level2;
+  int ltype;
+} compvar_t;
+
+
+#if  defined  (HAVE_LIBCGRIBEX)
+static
+int cgribexGetGridType(int *isec2)
+{
+  int gridtype = GRID_GENERIC;
+
+  switch (ISEC2_GridType)
+    {
+    case  GRIB1_GTYPE_LATLON:     { if ( ISEC2_Reduced )      break; }
+    case  GRIB1_GTYPE_LATLON_ROT: { gridtype = GRID_LONLAT;   break; }
+    case  GRIB1_GTYPE_LCC:        { gridtype = GRID_LCC;      break; }
+    case  GRIB1_GTYPE_GAUSSIAN:   { if ( ISEC2_Reduced )
+	                              gridtype = GRID_GAUSSIAN_REDUCED;
+                         	    else
+				      gridtype = GRID_GAUSSIAN;
+          	                    break;
+                                  }
+    case  GRIB1_GTYPE_SPECTRAL:   { gridtype = GRID_SPECTRAL; break; }
+    case  GRIB1_GTYPE_GME:        { gridtype = GRID_GME;      break; }
+    }
+
+  return (gridtype);
+}
+
+static
+int cgribexGetIsRotated(int *isec2)
+{
+  int isRotated = 0;
+
+  if ( ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )
+    {
+      isRotated = 1;
+    }
+ 
+  return (isRotated);
+}
+
+static
+int cgribexGetZaxisHasBounds(int grb_ltype)
+{
+  int lbounds = 0;
+
+  switch (grb_ltype)
+    {
+    case GRIB1_LTYPE_SIGMA_LAYER:
+    case GRIB1_LTYPE_HYBRID_LAYER:
+    case GRIB1_LTYPE_LANDDEPTH_LAYER:
+      {
+	lbounds = 1;
+	break;
+      }
+    }
+
+  return (lbounds);
+}
+
+static
+int cgribexGetTimeUnit(int *isec1)
+{
+  int timeunit = TUNIT_HOUR;
+  static int lprint = TRUE;
+
+  switch ( ISEC1_TimeUnit )
+    {
+    case ISEC1_TABLE4_MINUTE:  timeunit = TUNIT_MINUTE;  break;
+    case ISEC1_TABLE4_QUARTER: timeunit = TUNIT_QUARTER; break;
+    case ISEC1_TABLE4_HOUR:    timeunit = TUNIT_HOUR;    break;
+    case ISEC1_TABLE4_3HOURS:  timeunit = TUNIT_3HOURS;  break;
+    case ISEC1_TABLE4_6HOURS:  timeunit = TUNIT_6HOURS;  break;
+    case ISEC1_TABLE4_12HOURS: timeunit = TUNIT_12HOURS; break;
+    case ISEC1_TABLE4_DAY:     timeunit = TUNIT_DAY;     break;
+    default:
+      if ( lprint )
+	{
+	  Message("GRIB time unit %d unsupported!", ISEC1_TimeUnit);
+	  lprint = FALSE;
+	}
+    }
+
+  return (timeunit);
+}
+
+static
+int cgribexTimeIsFC(int *isec1)
+{
+  int isFC = TRUE;
+
+  if ( ISEC1_TimeRange == 10 && ISEC1_TimePeriod1 == 0 && ISEC1_TimePeriod2 == 0 )
+    isFC = FALSE;
+
+  return (isFC);
+}
+
+static
+int cgribexGetTsteptype(int timerange)
+{
+  int tsteptype = 0;
+  static int lprint = TRUE;
+
+  switch ( timerange )
+    {
+    case  0:  tsteptype = TSTEP_INSTANT;  break;
+    case  1:  tsteptype = TSTEP_INSTANT2; break;
+    case  2:  tsteptype = TSTEP_RANGE;    break;
+    case  3:  tsteptype = TSTEP_AVG;      break;
+    case  4:  tsteptype = TSTEP_ACCUM;    break;
+    case  5:  tsteptype = TSTEP_DIFF;     break;
+    case 10:  tsteptype = TSTEP_INSTANT3; break;
+    default:
+      if ( lprint )
+	{
+	  Message("GRIB time range %d unsupported!", timerange);
+	  lprint = FALSE;
+	}
+    }
+
+  return (tsteptype);
+}
+
+static
+void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, int iret)
+{
+  int gridtype;
+
+  gridtype = cgribexGetGridType(isec2);
+
+  if ( streamptr->unreduced && gridtype == GRID_GAUSSIAN_REDUCED && iret != -801 )
+    {
+      int ilat, nlon = 0;
+      for ( ilat = 0; ilat < ISEC2_NumLat; ++ilat )
+        if ( ISEC2_RowLon(ilat) > nlon ) nlon = ISEC2_RowLon(ilat);
+      gridtype = GRID_GAUSSIAN;
+      ISEC2_NumLon = nlon;
+      ISEC4_NumValues = nlon*ISEC2_NumLat;
+    }
+
+  memset(grid, 0, sizeof(grid_t));
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+      {
+	if ( ISEC4_NumValues != ISEC2_NumLon*ISEC2_NumLat )
+	  Error("numberOfPoints (%d) and gridSize (%d) differ!",
+		ISEC4_NumValues, ISEC2_NumLon*ISEC2_NumLat);
+	grid->size  = ISEC4_NumValues;
+	grid->xsize = ISEC2_NumLon;
+	grid->ysize = ISEC2_NumLat;
+        if ( gridtype == GRID_GAUSSIAN ) grid->np = ISEC2_NumPar;
+	grid->xinc  = 0;
+	grid->yinc  = 0;
+	grid->xdef  = 0;
+	/* if ( ISEC2_FirstLon != 0 || ISEC2_LastLon != 0 ) */
+	  {
+	    if ( grid->xsize > 1 )
+	      {
+                int recompinc = TRUE;
+
+		if ( ISEC2_ResFlag && ISEC2_LonIncr > 0 )
+                  {
+                    if ( abs(ISEC2_LastLon - (ISEC2_FirstLon+ISEC2_LonIncr*(grid->xsize-1))) <= 2 )
+                      {
+                        recompinc = FALSE;
+                        grid->xinc = ISEC2_LonIncr * 0.001;
+                      }
+                  }
+
+		/* recompute xinc if necessary */
+                if ( recompinc ) grid->xinc = (ISEC2_LastLon - ISEC2_FirstLon) * 0.001 / (grid->xsize-1);
+
+		/* correct xinc if necessary */
+		if ( ISEC2_FirstLon == 0 && ISEC2_LastLon > 354000 && ISEC2_LastLon < 360000 )
+		  {
+		    double xinc = 360. / grid->xsize;
+
+		    if ( fabs(grid->xinc-xinc) > 0.0 )
+		      {
+			grid->xinc = xinc;
+			if ( CDI_Debug ) Message("set xinc to %g", grid->xinc);
+		      }
+		  }
+	      }
+	    grid->xfirst = ISEC2_FirstLon * 0.001;
+	    grid->xlast  = ISEC2_LastLon  * 0.001;
+	    grid->xdef   = 2;
+	  }
+	grid->ydef  = 0;
+	/* if ( ISEC2_FirstLat != 0 || ISEC2_LastLat != 0 ) */
+	  {
+	    if ( grid->ysize > 1 )
+	      {
+                int recompinc = TRUE;
+
+		if ( ISEC2_ResFlag && ISEC2_LatIncr > 0 )
+                  {
+                    if ( abs(ISEC2_LastLat - (ISEC2_FirstLat+ISEC2_LatIncr*(grid->ysize-1))) <= 2 )
+                      {
+                        recompinc = FALSE;
+                        grid->yinc = ISEC2_LatIncr * 0.001;
+                      }
+                  }
+
+		/* recompute yinc if necessary */
+                if ( recompinc ) grid->yinc = (ISEC2_LastLat - ISEC2_FirstLat) * 0.001 / (grid->ysize - 1);
+	      }
+	    grid->yfirst = ISEC2_FirstLat * 0.001;
+	    grid->ylast  = ISEC2_LastLat  * 0.001;
+	    grid->ydef   = 2;
+	  }
+	break;
+      }
+    case GRID_GAUSSIAN_REDUCED:
+      {
+        grid->np     = ISEC2_NumPar;
+	grid->size   = ISEC4_NumValues;
+        grid->rowlon = ISEC2_RowLonPtr;
+	grid->ysize  = ISEC2_NumLat;
+	grid->xinc   = 0;
+	grid->yinc   = 0;
+	grid->xdef   = 0;
+	/* if ( ISEC2_FirstLon != 0 || ISEC2_LastLon != 0 ) */
+	  {
+	    if ( grid->xsize > 1 )
+	      {
+		if ( ISEC2_ResFlag && ISEC2_LonIncr > 0 )
+		  grid->xinc = ISEC2_LonIncr * 0.001;
+		else
+		  grid->xinc = (ISEC2_LastLon - ISEC2_FirstLon) * 0.001 / (grid->xsize - 1);
+	      }
+	    grid->xfirst = ISEC2_FirstLon * 0.001;
+	    grid->xlast  = ISEC2_LastLon  * 0.001;
+	    grid->xdef   = 2;
+	  }
+	grid->ydef  = 0;
+	/* if ( ISEC2_FirstLat != 0 || ISEC2_LastLat != 0 ) */
+	  {
+	    if ( grid->ysize > 1 )
+	      {
+		if ( ISEC2_ResFlag && ISEC2_LatIncr > 0 )
+		  grid->yinc = ISEC2_LatIncr * 0.001;
+		else
+		  grid->yinc = (ISEC2_LastLat - ISEC2_FirstLat) * 0.001 / (grid->ysize - 1);
+	      }
+	    grid->yfirst = ISEC2_FirstLat * 0.001;
+	    grid->ylast  = ISEC2_LastLat  * 0.001;
+	    grid->ydef   = 2;
+	  }
+	break;
+      }
+    case GRID_LCC:
+      {
+	if ( ISEC4_NumValues != ISEC2_NumLon*ISEC2_NumLat )
+	  Error("numberOfPoints (%d) and gridSize (%d) differ!",
+		ISEC4_NumValues, ISEC2_NumLon*ISEC2_NumLat);
+
+	grid->size  = ISEC4_NumValues;
+	grid->xsize = ISEC2_NumLon;
+	grid->ysize = ISEC2_NumLat;
+
+	grid->lcc_xinc      = ISEC2_Lambert_dx;
+	grid->lcc_yinc      = ISEC2_Lambert_dy;
+	grid->lcc_originLon = ISEC2_FirstLon * 0.001;
+	grid->lcc_originLat = ISEC2_FirstLat * 0.001;
+	grid->lcc_lonParY   = ISEC2_Lambert_Lov * 0.001;
+	grid->lcc_lat1      = ISEC2_Lambert_LatS1 * 0.001;
+	grid->lcc_lat2      = ISEC2_Lambert_LatS2 * 0.001;
+	grid->lcc_projflag  = ISEC2_Lambert_ProjFlag;
+	grid->lcc_scanflag  = ISEC2_ScanFlag;
+
+	grid->xdef   = 0;
+	grid->ydef   = 0;
+
+	break;
+      }
+    case GRID_SPECTRAL:
+      {
+	grid->size  = ISEC4_NumValues;
+	grid->trunc = ISEC2_PentaJ;
+	if ( ISEC2_RepMode == 2 )
+	  grid->lcomplex = 1;
+	else
+	  grid->lcomplex = 0;
+
+	break;
+      }
+    case GRID_GME:
+      {
+	grid->size  = ISEC4_NumValues;
+	grid->nd    = ISEC2_GME_ND;
+	grid->ni    = ISEC2_GME_NI;
+	grid->ni2   = ISEC2_GME_NI2;
+	grid->ni3   = ISEC2_GME_NI3;
+	break;
+      }
+    case GRID_GENERIC:
+      {
+	grid->size  = ISEC4_NumValues;
+	grid->xsize = 0;
+	grid->ysize = 0;
+	break;
+      }
+    default:
+      {
+	Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+	break;
+      }
+    }
+
+  grid->isRotated = FALSE;
+  if ( cgribexGetIsRotated(isec2) )
+    {
+      grid->isRotated = TRUE;
+      grid->ypole     = - ISEC2_LatSP * 0.001;
+      grid->xpole     =   ISEC2_LonSP * 0.001 - 180;
+      grid->angle     = 0;
+    }
+
+  grid->xvals = NULL;
+  grid->yvals = NULL;
+  grid->type  = gridtype;
+}
+
+static
+void cgribexAddRecord(int streamID, int param, int *isec1, int *isec2, double *fsec2, double *fsec3,
+		      int *isec4, long recsize, off_t position, int datatype, int comptype, int lmv, int iret)
+{
+  int zaxistype;
+  int gridID = CDI_UNDEFID, varID;
+  int levelID = 0;
+  int tsID, recID;
+  int level1, level2;
+  int numavg;
+  int tsteptype;
+  int lbounds = 0;
+  record_t *record;
+  grid_t grid;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  tsID    = streamptr->curTsID;
+  recID   = recordNewEntry(streamID, tsID);
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  tsteptype = cgribexGetTsteptype(ISEC1_TimeRange);
+  numavg    = ISEC1_AvgNum;
+
+  level1  = ISEC1_Level1;
+  level2  = ISEC1_Level2;
+
+  /* fprintf(stderr, "param %d %d %d %d\n", param, level1, level2, ISEC1_LevelType); */
+
+  (*record).size     = recsize;
+  (*record).position = position;
+  (*record).param    = param;
+  (*record).ilevel   = level1;
+  (*record).ilevel2  = level2;
+  (*record).ltype    = ISEC1_LevelType;
+
+  cgribexGetGrid(streamptr, isec2, isec4, &grid, iret);
+
+  gridID = varDefGrid(vlistID, grid, 0);
+
+  zaxistype = grib1ltypeToZaxisType(ISEC1_LevelType);
+
+  if ( zaxistype == ZAXIS_HYBRID || zaxistype == ZAXIS_HYBRID_HALF )
+    {
+      int vctsize = ISEC2_NumVCP;
+      double *vctptr = &fsec2[10];
+
+      varDefVCT(vctsize, vctptr);
+    }
+
+  lbounds = cgribexGetZaxisHasBounds(ISEC1_LevelType);
+
+  if ( datatype > 32 ) datatype = DATATYPE_PACK32;
+  if ( datatype <  0 ) datatype = DATATYPE_PACK;
+
+  varAddRecord(recID, param, gridID, zaxistype, lbounds, level1, level2,
+	       datatype, &varID, &levelID, tsteptype, numavg, ISEC1_LevelType, NULL, NULL, NULL);
+
+  (*record).varID   = varID;
+  (*record).levelID = levelID;
+
+  varDefCompType(varID, comptype);
+
+  if ( ISEC1_LocalFLag )
+    {
+      if      ( ISEC1_CenterID == 78  && isec1[36] == 253 ) // DWD local extension
+        varDefEnsembleInfo(varID, isec1[54], isec1[53], isec1[52]);
+      else if ( ISEC1_CenterID == 252 && isec1[36] ==   1 ) // MPIM local extension
+        varDefEnsembleInfo(varID, isec1[38], isec1[39], isec1[37]);
+    }
+
+  if ( lmv ) varDefMissval(varID, FSEC3_MissVal);
+
+  if ( varInqInst(varID) == CDI_UNDEFID )
+    {
+      int center, subcenter, instID;
+      center    = ISEC1_CenterID;
+      subcenter = ISEC1_SubCenterID;
+      instID    = institutInq(center, subcenter, NULL, NULL);
+      if ( instID == CDI_UNDEFID )
+	instID = institutDef(center, subcenter, NULL, NULL);
+      varDefInst(varID, instID);
+    }
+
+  if ( varInqModel(varID) == CDI_UNDEFID )
+    {
+      int modelID;
+      modelID = modelInq(varInqInst(varID), ISEC1_ModelID, NULL);
+      if ( modelID == CDI_UNDEFID )
+	modelID = modelDef(varInqInst(varID), ISEC1_ModelID, NULL);
+      varDefModel(varID, modelID);
+    }
+
+  if ( varInqTable(varID) == CDI_UNDEFID )
+    {
+      int tableID;
+
+      tableID = tableInq(varInqModel(varID), ISEC1_CodeTable, NULL);
+
+      if ( tableID == CDI_UNDEFID )
+	tableID = tableDef(varInqModel(varID), ISEC1_CodeTable, NULL);
+      varDefTable(varID, tableID);
+    }
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+
+  if ( CDI_Debug )
+    Message("varID = %d  param = %d  zaxistype = %d  gridID = %d  levelID = %d",
+	    varID, param, zaxistype, gridID, levelID);
+}
+
+static
+void MCH_get_undef(int *isec1, double *undef_pds, double *undef_eps)
+{
+  /* 2010-01-13: Oliver Fuhrer */
+  if ( ISEC1_CenterID == 215 ) {
+    if (isec1[34] != 0 && isec1[34] != 255) {
+      if (isec1[34] & 2) {
+        if (isec1[34] & 1) {
+          *undef_pds = -0.99*pow(10.0,-isec1[35]);
+        } else {
+          *undef_pds = +0.99*pow(10.0,-isec1[35]);
+        }
+        *undef_eps = pow(10.0,-isec1[35]-1);
+      } else {
+        if (isec1[34] & 1) {
+          *undef_pds = -0.99*pow(10.0,+isec1[35]);
+        } else {
+          *undef_pds = +0.99*pow(10.0,+isec1[35]);
+        }
+        *undef_eps = pow(10.0,isec1[35]-1);
+      }
+    }
+  }
+}
+
+static
+void cgribexDecodeHeader(int *isec0, int *isec1, int *isec2, double *fsec2,
+			 int *isec3, double *fsec3, int *isec4, double *fsec4, 
+			 int *gribbuffer, int recsize, int *lmv, int *iret)
+{
+  int ipunp = 0, iword = 0;
+
+  memset(isec1, 0, 256*sizeof(int));
+
+  gribExDP(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, fsec4,
+	   ipunp, (int *) gribbuffer, recsize, &iword, "J", iret);
+
+  *lmv = 0;
+
+  if ( ISEC1_CenterID == 215 && (isec1[34] != 0 && isec1[34] != 255) )
+    {
+      double undef_pds, undef_eps;
+
+      MCH_get_undef(isec1, &undef_pds, &undef_eps);
+      FSEC3_MissVal = undef_pds;
+      *lmv = 1;
+    }
+}
+#endif
+
+int cgribexScanTimestep1(int streamID)
+{
+#if  defined  (HAVE_LIBCGRIBEX)
+  int *isec0, *isec1, *isec2, *isec3, *isec4;
+  double fsec2[512], fsec3[2], *fsec4 = NULL;
+  int lmv = 0, iret = 0;
+  off_t recpos = 0;
+  unsigned char *gribbuffer = NULL;
+  long buffersize = 0;
+  int rstatus;
+  int fileID;
+  int param = 0;
+  int level1 = 0, level2 = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  size_t readsize;
+  int nrecords, nrecs, recID;
+  int datatype;
+  long recsize = 0;
+  int warn_time = TRUE;
+  int warn_numavg = TRUE;
+  int taxisID = -1;
+  int rdate = 0, rtime = 0, tunit = 0, fcast = 0;
+  taxis_t *taxis;
+  int vlistID;
+  int comptype;
+  long unzipsize;
+  compvar_t compVar, compVar0;
+  stream_t *streamptr;
+  extern int cdiSkipRecords;
+  int nskip = cdiSkipRecords;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 0;
+
+  isec0 = streamptr->record->sec0;
+  isec1 = streamptr->record->sec1;
+  isec2 = streamptr->record->sec2;
+  isec3 = streamptr->record->sec3;
+  isec4 = streamptr->record->sec4;
+
+  tsID  = tstepsNewEntry(streamID);
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( tsID != 0 )
+    Error("Internal problem! tstepsNewEntry returns %d", tsID);
+
+  fileID = streamInqFileID(streamID);
+
+  while ( nskip-- > 0 )
+    {
+      recsize = gribGetSize(fileID);
+      if ( recsize == 0 )
+	Error("Skipping of %d records failed!", cdiSkipRecords);
+
+      recpos  = fileGetPos(fileID);
+      fileSetPos(fileID, recsize, SEEK_CUR);
+    }
+
+  nrecs = 0;
+  while ( TRUE )
+    {
+      recsize = gribGetSize(fileID);
+      recpos  = fileGetPos(fileID);
+
+      if ( recsize == 0 )
+	{
+	  if ( nrecs == 0 )
+	    Error("No GRIB records found!");
+
+	  streamptr->ntsteps = 1;
+	  break;
+	}
+      if ( recsize > buffersize )
+	{
+	  buffersize = recsize;
+	  gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	}
+
+      readsize = recsize;
+      rstatus = gribRead(fileID, gribbuffer, &readsize);
+      if ( rstatus ) break;
+
+      comptype = COMPRESS_NONE;
+      if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	{
+	  comptype = COMPRESS_SZIP;
+	  unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+	  if ( (long) buffersize < unzipsize )
+	    {
+	      buffersize = unzipsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+	}
+
+      cgribexDecodeHeader(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, fsec4,
+			  (int *) gribbuffer, recsize, &lmv, &iret);
+
+      param = cdiEncodeParam(ISEC1_Parameter, ISEC1_CodeTable, 255);
+      if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
+      if ( ISEC1_LevelType ==  99 ) ISEC1_LevelType = 100;
+      level1   = ISEC1_Level1;
+      level2   = ISEC1_Level2;
+
+      gribDateTime(isec1, &vdate, &vtime);
+
+      if ( ISEC4_NumBits > 0 && ISEC4_NumBits <= 32 )
+	datatype = ISEC4_NumBits;
+      else
+        datatype = DATATYPE_PACK;
+
+      if ( nrecs == 0 )
+	{
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	  rdate = gribRefDate(isec1);
+	  rtime = gribRefTime(isec1);
+	  tunit = cgribexGetTimeUnit(isec1);
+	  fcast = cgribexTimeIsFC(isec1);
+	}
+      else
+	{
+	  datetime.date  = vdate;
+	  datetime.time  = vtime;
+	  compVar.param  = param;
+          compVar.level1 = level1;
+          compVar.level2 = level2;
+          compVar.ltype  = ISEC1_LevelType;
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      compVar0.param  = streamptr->tsteps[0].records[recID].param;
+	      compVar0.level1 = streamptr->tsteps[0].records[recID].ilevel;
+	      compVar0.level2 = streamptr->tsteps[0].records[recID].ilevel2;
+	      compVar0.ltype  = streamptr->tsteps[0].records[recID].ltype;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(compvar_t)) == 0 ) break;
+	    }
+
+	  if ( cdiInventoryMode == 1 )
+	    {
+	      if ( recID < nrecs ) break;
+	      if ( warn_time )
+		if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 )
+		  {
+		    char paramstr[32];
+		    cdiParamToString(param, paramstr, sizeof(paramstr));
+		    Warning("Inconsistent verification time (param=%s level=%d)", paramstr, level1);
+		    warn_time = FALSE;
+		  }
+	    }
+	  else
+	    {
+	      if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+	      if ( recID < nrecs )
+		{
+		  char paramstr[32];
+		  cdiParamToString(param, paramstr, sizeof(paramstr));
+		  Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+		  continue;
+		}
+	    }
+	}
+
+      if ( ISEC1_AvgNum )
+	{
+	  if (  taxis->numavg && warn_numavg && (taxis->numavg != ISEC1_AvgNum) )
+	    {
+	      Warning("Changing numavg from %d to %d not supported!",
+		      taxis->numavg, ISEC1_AvgNum);
+	      warn_numavg = FALSE;
+	    }
+	  else
+	    {
+	      taxis->numavg = ISEC1_AvgNum;
+	    }
+	}
+
+      nrecs++;
+
+      if ( CDI_Debug )
+	Message("%4d %8d %4d  %8d %8d %6d", nrecs, (int)recpos, param, level1, vdate, vtime);
+
+      cgribexAddRecord(streamID, param, isec1, isec2, fsec2, fsec3,
+		       isec4, recsize, recpos, datatype, comptype, lmv, iret);
+    }
+
+  streamptr->rtsteps = 1;
+
+  if ( nrecs == 0 ) return (CDI_EUFSTRUCT);
+
+  cdiGenVars(streamID);
+
+  if ( fcast )
+    {
+      taxisID = taxisCreate(TAXIS_RELATIVE);
+      taxis->type  = TAXIS_RELATIVE;
+      taxis->rdate = rdate;
+      taxis->rtime = rtime;
+      taxis->unit  = tunit;
+    }
+  else
+    {
+      taxisID = taxisCreate(TAXIS_ABSOLUTE);
+      taxis->type  = TAXIS_ABSOLUTE;
+      taxis->unit  = tunit;
+    }
+
+  taxis->vdate = datetime0.date;
+  taxis->vtime = datetime0.time;
+
+  vlistID = streamInqVlist(streamID);
+  vlistDefTaxis(vlistID, taxisID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  if ( nrecords < streamptr->tsteps[0].recordSize )
+    {
+      streamptr->tsteps[0].recordSize = nrecords;
+      streamptr->tsteps[0].records =
+      (record_t *) realloc(streamptr->tsteps[0].records, nrecords*sizeof(record_t));
+    }
+
+  streamptr->tsteps[0].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[0].nrecs = nrecords;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[0].recIDs[recID] = recID;
+
+  streamptr->record->buffer     = gribbuffer;
+  streamptr->record->buffersize = buffersize;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( streamptr->ntsteps == 1 )
+    {
+      if ( taxis->vdate == 0 && taxis->vtime == 0 )
+	{
+	  streamptr->ntsteps = 0;
+	  for ( varID = 0; varID < streamptr->nvars; varID++ )
+	    {
+	      vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	    }
+	}
+    }
+#else
+  Error("CGRIBEX support not compiled in!");
+#endif
+
+  return (0);
+}
+
+
+int cgribexScanTimestep2(int streamID)
+{
+  int rstatus = 0;
+#if  defined  (HAVE_LIBCGRIBEX)
+  int *isec0, *isec1, *isec2, *isec3, *isec4;
+  double fsec2[512], fsec3[2], *fsec4 = NULL;
+  int lmv = 0, iret = 0;
+  off_t recpos = 0;
+  unsigned char *gribbuffer = NULL;
+  long buffersize = 0;
+  int fileID;
+  int param = 0;
+  int level1 = 0, level2 = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID, gridID;
+  size_t readsize;
+  int nrecords, nrecs, recID, rindex;
+  long recsize = 0;
+  int warn_numavg = TRUE;
+  int tsteptype;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  long unzipsize;
+  compvar_t compVar, compVar0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 1;
+
+  isec0 = streamptr->record->sec0;
+  isec1 = streamptr->record->sec1;
+  isec2 = streamptr->record->sec2;
+  isec3 = streamptr->record->sec3;
+  isec4 = streamptr->record->sec4;
+
+  fileID  = streamInqFileID(streamID);
+  vlistID = streamInqVlist(streamID);
+  taxisID = vlistInqTaxis(vlistID);
+
+  gribbuffer = (unsigned char *) streamptr->record->buffer;
+  buffersize = streamptr->record->buffersize;
+
+  tsID = streamptr->rtsteps;
+  if ( tsID != 1 )
+    Error("Internal problem! unexpeceted timestep %d", tsID+1);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+  cdiCreateRecords(streamID, tsID);
+
+  nrecords = streamptr->tsteps[tsID].nallrecs;
+  streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[1].nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[1].recIDs[recID] = -1;
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID = streamptr->tsteps[0].records[recID].varID;
+      streamptr->tsteps[tsID].records[recID].position =	streamptr->tsteps[0].records[recID].position;
+      streamptr->tsteps[tsID].records[recID].size     =	streamptr->tsteps[0].records[recID].size;
+    }
+
+  rindex = 0;
+  while ( TRUE )
+    {
+      if ( rindex > nrecords ) break;
+
+      recsize = gribGetSize(fileID);
+      recpos  = fileGetPos(fileID);
+      if ( recsize == 0 )
+	{
+	  streamptr->ntsteps = 2;
+	  break;
+	}
+      if ( recsize > buffersize )
+	{
+	  buffersize = recsize;
+	  gribbuffer = (unsigned char *) realloc(gribbuffer, (size_t)buffersize);
+	}
+
+      readsize = recsize;
+      rstatus = gribRead(fileID, gribbuffer, &readsize);
+      if ( rstatus ) break;
+
+      if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	{
+	  unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+	  if ( (long) buffersize < unzipsize )
+	    {
+	      buffersize = unzipsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+	}
+
+      cgribexDecodeHeader(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, fsec4,
+			  (int *) gribbuffer, recsize, &lmv, &iret);
+
+      param = cdiEncodeParam(ISEC1_Parameter, ISEC1_CodeTable, 255);
+      if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
+      if ( ISEC1_LevelType ==  99 ) ISEC1_LevelType = 100;
+      level1    = ISEC1_Level1;
+      level2    = ISEC1_Level2;
+
+      gribDateTime(isec1, &vdate, &vtime);
+
+      if ( rindex == 0 )
+	{
+	  if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
+	    {
+	      taxis->type  = TAXIS_RELATIVE;
+	      taxis->rdate = gribRefDate(isec1);
+	      taxis->rtime = gribRefTime(isec1);
+	    }
+	  else
+	    {
+	      taxis->type  = TAXIS_ABSOLUTE;
+	    }
+	  taxis->unit  = cgribexGetTimeUnit(isec1);
+	  taxis->vdate = vdate;
+	  taxis->vtime = vtime;
+
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	}
+
+      tsteptype = cgribexGetTsteptype(ISEC1_TimeRange);
+
+      if ( ISEC1_AvgNum )
+	{
+	  if (  taxis->numavg && warn_numavg &&
+        	(taxis->numavg != ISEC1_AvgNum) )
+	    {
+	  /*
+	      Warning("Changing numavg from %d to %d not supported!",
+		      taxis->numavg, ISEC1_AvgNum);
+	  */
+	      warn_numavg = FALSE;
+	    }
+	  else
+	    {
+	      taxis->numavg = ISEC1_AvgNum;
+	    }
+	}
+
+      datetime.date  = vdate;
+      datetime.time  = vtime;
+      compVar.param  = param;
+      compVar.level1 = level1;
+      compVar.level2 = level2;
+      compVar.ltype  = ISEC1_LevelType;
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	  compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	  compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(compvar_t)) == 0 ) break;
+	}
+
+      if ( recID == nrecords )
+	{
+	  char paramstr[32];
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+	  Warning("Param=%s level=%d not defined at timestep 1!", paramstr, level1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      if ( cdiInventoryMode == 1 )
+	{
+	  if ( streamptr->tsteps[tsID].records[recID].used )
+	    {
+	      break;
+	    }
+	  else
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }
+	}
+      else
+	{
+	  if ( streamptr->tsteps[tsID].records[recID].used )
+	    {
+	      char paramstr[32];
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+
+	      if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+	      Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+	      continue;
+	    }
+	  else
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }
+	}
+
+      if ( CDI_Debug )
+	Message("%4d %8d %4d %8d %8d %6d", rindex+1, (int)recpos, param, level1, vdate, vtime);
+
+      streamptr->tsteps[tsID].records[recID].size = recsize;
+
+      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+      compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+      compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+      compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+      if ( memcmp(&compVar0, &compVar, sizeof(compvar_t)) != 0 )
+	{
+	  Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		  tsID, recID,
+		  streamptr->tsteps[tsID].records[recID].param, param,
+		  streamptr->tsteps[tsID].records[recID].ilevel, level1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->tsteps[1].records[recID].position = recpos;
+      varID = streamptr->tsteps[tsID].records[recID].varID;
+      gridID = vlistInqVarGrid(vlistID, varID);
+      if ( gridInqSize(gridID) == 1 && gridInqType(gridID) == GRID_LONLAT )
+	{
+	  if ( IS_NOT_EQUAL(gridInqXval(gridID, 0),ISEC2_FirstLon*0.001) ||
+	       IS_NOT_EQUAL(gridInqYval(gridID, 0),ISEC2_FirstLat*0.001) )
+	    gridChangeType(gridID, GRID_TRAJECTORY);
+	}
+
+      if ( tsteptype != vlistInqVarTsteptype(vlistID, varID) )
+	vlistDefVarTsteptype(vlistID, varID, tsteptype);
+
+      rindex++;
+    }
+
+  nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      if ( ! streamptr->tsteps[tsID].records[recID].used )
+	{
+	  varID = streamptr->tsteps[tsID].records[recID].varID;
+          vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	}
+      else
+	{
+	  nrecs++;
+	}
+    }
+  streamptr->tsteps[tsID].nrecs = nrecs;
+
+  streamptr->rtsteps = 2;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  streamptr->record->buffer     = gribbuffer;
+  streamptr->record->buffersize = buffersize;
+#endif
+
+  return (rstatus);
+}
+
+
+int cgribexScanTimestep(int streamID)
+{
+  int rstatus = 0;
+#if  defined  (HAVE_LIBCGRIBEX)
+  int *isec0, *isec1, *isec2, *isec3, *isec4;
+  double fsec2[512], fsec3[2], *fsec4 = NULL;
+  int lmv = 0, iret = 0;
+  long recsize = 0;
+  off_t recpos = 0;
+  unsigned char *gribbuffer;
+  long buffersize = 0;
+  int fileID;
+  int param = 0;
+  int level1 = 0, level2 = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int vrecID, recID;
+  int warn_numavg = TRUE;
+  size_t readsize;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  int rindex, nrecs = 0;
+  long unzipsize;
+  compvar_t compVar, compVar0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+
+  if ( CDI_Debug )
+    {
+      Message("streamID = %d", streamID);
+      Message("cts = %d", streamptr->curTsID);
+      Message("rts = %d", streamptr->rtsteps);
+      Message("nts = %d", streamptr->ntsteps);
+    }
+
+  isec0 = streamptr->record->sec0;
+  isec1 = streamptr->record->sec1;
+  isec2 = streamptr->record->sec2;
+  isec3 = streamptr->record->sec3;
+  isec4 = streamptr->record->sec4;
+
+  tsID  = streamptr->rtsteps;
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->tsteps[tsID].recordSize == 0 )
+    {
+      gribbuffer = (unsigned char *) streamptr->record->buffer;
+      buffersize = streamptr->record->buffersize;
+
+      cdiCreateRecords(streamID, tsID);
+
+      nrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->tsteps[tsID].nrecs = nrecs;
+      streamptr->tsteps[tsID].recIDs = (int *) malloc(nrecs*sizeof(int));
+      for ( recID = 0; recID < nrecs; recID++ )
+	streamptr->tsteps[tsID].recIDs[recID] = streamptr->tsteps[1].recIDs[recID];
+
+      fileID = streamInqFileID(streamID);
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+      rindex = 0;
+      while ( TRUE )
+	{
+	  if ( rindex > nrecs ) break;
+
+	  recsize = gribGetSize(fileID);
+	  recpos  = fileGetPos(fileID);
+	  if ( recsize == 0 )
+	    {
+	      streamptr->ntsteps = streamptr->rtsteps + 1;
+	      break;
+	    }
+	  if ( recsize > buffersize )
+	    {
+	      buffersize = recsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+
+	  if ( rindex >= nrecs ) break;
+
+	  readsize = recsize;
+	  rstatus = gribRead(fileID, gribbuffer, &readsize);
+	  if ( rstatus )
+	    {
+	      Warning("Inconsistent timestep %d (GRIB record %d/%d)!", tsID+1, rindex+1,
+                      streamptr->tsteps[tsID].recordSize);
+	      break;
+	    }
+
+	  if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	    {
+	      unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+	      if ( (long) buffersize < unzipsize )
+		{
+		  buffersize = unzipsize;
+		  gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+		}
+	    }
+
+	  cgribexDecodeHeader(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, fsec4,
+			      (int *) gribbuffer, recsize, &lmv, &iret);
+
+	  param = cdiEncodeParam(ISEC1_Parameter, ISEC1_CodeTable, 255);
+	  if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
+	  if ( ISEC1_LevelType ==  99 ) ISEC1_LevelType = 100;
+	  level1   = ISEC1_Level1;
+	  level2   = ISEC1_Level2;
+
+	  gribDateTime(isec1, &vdate, &vtime);
+
+	  if ( rindex == nrecs ) break;
+
+	  if ( rindex == 0 )
+	    {
+	      taxisID = vlistInqTaxis(vlistID);
+	      if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
+		{
+		  taxis->type  = TAXIS_RELATIVE;
+		  taxis->rdate = gribRefDate(isec1);
+		  taxis->rtime = gribRefTime(isec1);
+		}
+	      else
+		{
+		  taxis->type  = TAXIS_ABSOLUTE;
+		}
+	      taxis->unit  = cgribexGetTimeUnit(isec1);
+	      taxis->vdate = vdate;
+	      taxis->vtime = vtime;
+
+	      datetime0.date = vdate;
+	      datetime0.time = vtime;
+	    }
+
+	  if ( ISEC1_AvgNum )
+	    {
+	      if (  taxis->numavg && warn_numavg &&
+		   (taxis->numavg != ISEC1_AvgNum) )
+		{
+	      /*
+	          Warning("Changing numavg from %d to %d not supported!",
+			  streamptr->tsteps[tsID].taxis.numavg, ISEC1_AvgNum);
+	      */
+		  warn_numavg = FALSE;
+		}
+	      else
+		{
+		  taxis->numavg = ISEC1_AvgNum;
+		}
+	    }
+
+	  datetime.date  = vdate;
+	  datetime.time  = vtime;
+	  compVar.param  = param;
+          compVar.level1 = level1;
+          compVar.level2 = level2;
+          compVar.ltype  = ISEC1_LevelType;
+	  for ( vrecID = 0; vrecID < nrecs; vrecID++ )
+	    {
+	      recID   = streamptr->tsteps[1].recIDs[vrecID];
+	      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	      compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	      compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	      compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(compvar_t)) == 0 ) break;
+	    }
+
+	  if ( vrecID == nrecs )
+	    {
+	      char paramstr[32];
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+	      Warning("Param=%s level=%d not available at timestep %d!", paramstr, level1, tsID+1);
+
+	      if ( cdiInventoryMode == 1 )
+		return (CDI_EUFSTRUCT);
+	      else
+		continue;
+	    }
+
+	  if ( cdiInventoryMode == 1 )
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }
+	  else
+	    {
+	      if ( streamptr->tsteps[tsID].records[recID].used )
+		{
+		  char paramstr[32];
+		  cdiParamToString(param, paramstr, sizeof(paramstr));
+
+		  if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+		  if ( CDI_Debug )
+		    Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+
+		  continue;
+		}
+	      else
+		{
+		  streamptr->tsteps[tsID].records[recID].used = TRUE;
+		  streamptr->tsteps[tsID].recIDs[rindex] = recID;
+		}
+	    }
+
+	  if ( CDI_Debug )
+	    Message("%4d %8d %4d %8d %8d %6d", rindex+1, (int)recpos, param, level1, vdate, vtime);
+
+	  compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	  compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	  compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(compvar_t)) != 0 )
+	    {
+	      Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		      tsID, recID,
+		      streamptr->tsteps[tsID].records[recID].param, param,
+		      streamptr->tsteps[tsID].records[recID].ilevel, level1);
+	      Error("Invalid, unsupported or inconsistent record structure");
+	    }
+
+	  streamptr->tsteps[tsID].records[recID].position = recpos;
+	  streamptr->tsteps[tsID].records[recID].size = recsize;
+
+	  if ( CDI_Debug )
+	    Message("%4d %8d %4d %8d %8d %6d", rindex, (int)recpos, param, level1, vdate, vtime);
+
+	  rindex++;
+	}
+
+      for ( vrecID = 0; vrecID < nrecs; vrecID++ )
+	{
+	  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+	  if ( ! streamptr->tsteps[tsID].records[recID].used ) break;
+	}
+
+      if ( vrecID < nrecs )
+	{
+	  char paramstr[32];
+	  cdiParamToString(streamptr->tsteps[tsID].records[recID].param, paramstr, sizeof(paramstr));
+	  Warning("Param=%s level=%d not found at timestep %d!",
+		  paramstr, streamptr->tsteps[tsID].records[recID].ilevel, tsID+1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->rtsteps++;
+
+      if ( streamptr->ntsteps != streamptr->rtsteps )
+	{
+	  tsID = tstepsNewEntry(streamID);
+	  if ( tsID != streamptr->rtsteps )
+	    Error("Internal error. tsID = %d", tsID);
+
+	  streamptr->tsteps[tsID-1].next   = 1;
+	  streamptr->tsteps[tsID].position = recpos;
+	}
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+      streamptr->tsteps[tsID].position = recpos;
+
+      streamptr->record->buffer     = gribbuffer;
+      streamptr->record->buffersize = buffersize;
+    }
+
+  if ( nrecs > 0 && nrecs < streamptr->tsteps[tsID].nrecs )
+    {
+      Warning("Incomplete timestep. Stop scanning at timestep %d.", tsID);
+      streamptr->ntsteps = tsID;
+    }
+
+  rstatus = streamptr->ntsteps;
+#endif
+
+  return (rstatus);
+}
+
+
+int cgribexDecode(unsigned char *gribbuffer, int gribsize, double *data, int gridsize,
+		  int unreduced, int *nmiss, int *zip, double missval)
+{
+  int status = 0;
+#if  defined  (HAVE_LIBCGRIBEX)
+  int iret = 0, iword = 0;
+  int isec0[2], isec1[4096], isec2[4096], isec3[2], isec4[512];
+  int izip;
+  long unzipsize;
+  double fsec2[512], fsec3[2];
+  char hoper[2];
+
+  *zip = 0;
+
+  if ( unreduced ) strcpy(hoper, "R");
+  else             strcpy(hoper, "D");
+
+  FSEC3_MissVal = missval;
+
+  if ( (izip = gribGetZip(gribsize, gribbuffer, &unzipsize)) > 0 )
+    {
+      *zip = izip;
+      if ( izip == 128 ) /* szip */
+	{
+	  unsigned char *itmpbuffer = NULL;
+	  size_t itmpbuffersize = 0;
+
+	  if ( unzipsize < (long) gribsize )
+	    {
+	      fprintf(stderr, "Decompressed size smaller than compressed size (in %d; out %ld)!\n",
+		      gribsize, unzipsize);
+	      return (status);
+	    }
+
+	  if ( itmpbuffersize < (size_t) gribsize )
+	    {
+	      itmpbuffersize = gribsize;
+	      itmpbuffer = (unsigned char *) realloc(itmpbuffer, itmpbuffersize);
+	    }
+
+	  memcpy(itmpbuffer, gribbuffer, itmpbuffersize);
+
+	  unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+
+	  gribsize = gribUnzip(gribbuffer, unzipsize, itmpbuffer, gribsize);
+
+	  if ( gribsize <= 0 )
+	    Error("Decompression problem!");
+
+	  free(itmpbuffer);
+	}
+      else
+	{
+	  Error("Decompression for %d not implemented!", izip);
+	}
+    }
+
+  gribExDP(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, data,
+	   gridsize, (int *) gribbuffer, gribsize, &iword, hoper, &iret);
+
+  if ( ISEC1_Sec2Or3Flag & 64 )
+    *nmiss = ISEC4_NumValues - ISEC4_NumNonMissValues;
+  else
+    *nmiss = 0;
+
+  if ( ISEC1_CenterID == 215 && (isec1[34] != 0 && isec1[34] != 255) )
+    {
+      double undef_pds, undef_eps;
+      int i;
+
+      MCH_get_undef(isec1, &undef_pds, &undef_eps);
+
+      *nmiss = 0;
+      for ( i = 0; i < gridsize; i++ )
+        if ( (abs(data[i]-undef_pds) < undef_eps) || IS_EQUAL(data[i],FSEC3_MissVal) ) {
+          data[i] = missval;
+          (*nmiss)++;
+        }
+    }
+#else
+  Error("CGRIBEX support not compiled in!");
+#endif
+
+  return (status);
+}
+
+#if  defined  (HAVE_LIBCGRIBEX)
+static
+void cgribexDefInstitut(int *isec1, int vlistID, int varID)
+{
+  int instID;
+
+  if ( vlistInqInstitut(vlistID) != CDI_UNDEFID )
+    instID = vlistInqInstitut(vlistID);
+  else
+    instID = vlistInqVarInstitut(vlistID, varID);
+
+  if ( instID != CDI_UNDEFID )
+    {
+      int center, subcenter;
+      center    = institutInqCenter(instID);
+      subcenter = institutInqSubcenter(instID);
+      ISEC1_CenterID    = center;
+      ISEC1_SubCenterID = subcenter;
+    }
+}
+
+static
+void cgribexDefModel(int *isec1, int vlistID, int varID)
+{
+  int modelID;
+
+  if ( vlistInqModel(vlistID) != CDI_UNDEFID )
+    modelID = vlistInqModel(vlistID);
+  else
+    modelID = vlistInqVarModel(vlistID, varID);
+
+  if ( modelID != CDI_UNDEFID )
+    ISEC1_ModelID = modelInqGribID(modelID);
+}
+
+static
+void cgribexDefParam(int *isec1, int param)
+{
+  int pdis, pcat, pnum;
+
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+
+  if ( pnum < 0 ) pnum = -pnum;
+
+  if ( pdis != 255 )
+    {
+      char paramstr[32];
+      cdiParamToString(param, paramstr, sizeof(paramstr));
+      Warning("Can't convert GRIB2 parameter ID (%s) to GRIB1, set to %d.%d!", paramstr, pnum, pcat);
+    }
+
+  ISEC1_CodeTable = pcat;
+  ISEC1_Parameter = pnum;
+}
+
+static
+int cgribexDefTimerange(int tsteptype, int factor, int calendar,
+			int rdate, int rtime, int vdate, int vtime, int *pip1, int *pip2)
+{
+  int timerange = -1;
+  int year, month, day, hour, minute, second;
+  int julday1, secofday1, julday2, secofday2, days, secs;
+  int ip, ip1 = 0, ip2 = 0;
+
+  cdiDecodeDate(rdate, &year, &month, &day);
+  cdiDecodeTime(rtime, &hour, &minute, &second);
+  encode_juldaysec(calendar, year, month, day, hour, minute, &julday1, &secofday1);
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+  encode_juldaysec(calendar, year, month, day, hour, minute, &julday2, &secofday2);
+
+  (void) julday_sub(julday1, secofday1, julday2, secofday2, &days, &secs);
+
+  if ( !(int) fmod(days*86400.0 + secs, factor) )
+    {
+      ip = (int) ((days*86400.0 + secs)/factor);
+
+      switch ( tsteptype )
+	{
+	case TSTEP_INSTANT:  timerange =  0; ip1 = ip; ip2 = 0;  break;
+	case TSTEP_INSTANT2: timerange =  1; ip1 = 0;  ip2 = 0;  break;
+	case TSTEP_RANGE:    timerange =  2; ip1 = 0;  ip2 = ip; break;
+	case TSTEP_AVG:      timerange =  3; ip1 = 0;  ip2 = ip; break;
+	case TSTEP_ACCUM:    timerange =  4; ip1 = 0;  ip2 = ip; break;
+	case TSTEP_DIFF:     timerange =  5; ip1 = 0;  ip2 = ip; break;
+	case TSTEP_INSTANT3:
+	default:             timerange = 10; ip1 = ip/256; ip2 = ip%256;  break;
+	}
+    }
+
+  *pip1 = ip1;
+  *pip2 = ip2;
+
+  return (timerange);
+}
+
+static
+int cgribexDefDateTime(int *isec1, int timeunit, int date, int time)
+{
+  int year, month, day, hour, minute, second;
+  int century = 0;
+  int factor = 1;
+
+  cdiDecodeDate(date, &year, &month, &day);
+  cdiDecodeTime(time, &hour, &minute, &second);
+
+  century =  year / 100;
+
+  ISEC1_Year = year - century*100;
+
+  if ( year < 0 )
+    {
+      century = -century;
+      ISEC1_Year = -ISEC1_Year;
+    }
+
+  if ( ISEC1_Year == 0 )
+    {
+      century -= 1;
+      ISEC1_Year = 100;
+    }
+
+  century += 1;
+  if ( year < 0 ) century = -century;
+
+  ISEC1_Month  = month;
+  ISEC1_Day    = day;
+  ISEC1_Hour   = hour;
+  ISEC1_Minute = minute;
+
+  ISEC1_Century = century;
+
+  switch (timeunit)
+    {
+    case TUNIT_MINUTE:  factor =    60; ISEC1_TimeUnit = ISEC1_TABLE4_MINUTE;  break;
+    case TUNIT_QUARTER: factor =   900; ISEC1_TimeUnit = ISEC1_TABLE4_QUARTER; break;
+    case TUNIT_HOUR:    factor =  3600; ISEC1_TimeUnit = ISEC1_TABLE4_HOUR;    break;
+    case TUNIT_3HOURS:  factor = 10800; ISEC1_TimeUnit = ISEC1_TABLE4_3HOURS;  break;
+    case TUNIT_6HOURS:  factor = 21600; ISEC1_TimeUnit = ISEC1_TABLE4_6HOURS;  break;
+    case TUNIT_12HOURS: factor = 43200; ISEC1_TimeUnit = ISEC1_TABLE4_12HOURS; break;
+    case TUNIT_DAY:     factor = 86400; ISEC1_TimeUnit = ISEC1_TABLE4_DAY;     break;
+    default:            factor =  3600; ISEC1_TimeUnit = ISEC1_TABLE4_HOUR;    break;
+    }
+
+  return (factor);
+}
+
+static
+void cgribexDefTime(int *isec1, int vdate, int vtime, int tsteptype, int numavg, int taxisID)
+{
+  int timetype = -1;
+  int timerange = 0;
+  int timeunit;
+
+  if ( taxisID != -1 ) timetype = taxisInqType(taxisID);
+
+  timeunit = taxisInqTunit(taxisID);
+
+  if ( timetype == TAXIS_RELATIVE )
+    {
+      int factor = 1;
+      int rdate, rtime;
+      int ip1 = 0, ip2 = 0;
+      int calendar;
+
+      calendar = taxisInqCalendar(taxisID);
+      rdate    = taxisInqRdate(taxisID);
+      rtime    = taxisInqRtime(taxisID);
+
+      factor = cgribexDefDateTime(isec1, timeunit, rdate, rtime);
+
+      timerange = cgribexDefTimerange(tsteptype, factor, calendar,
+				      rdate, rtime, vdate, vtime, &ip1, &ip2);
+
+      if ( timerange == -1 || timerange == 3 )
+	{
+	  timetype = TAXIS_ABSOLUTE;
+	}
+      /*
+      else if ( timerange == 10 )
+	{
+	  if ( ip1 < 0 || ip1 > 0xFFFF ) timetype = TAXIS_ABSOLUTE;
+	  if ( ip2 < 0 || ip2 > 0xFFFF ) timetype = TAXIS_ABSOLUTE;
+	}
+      */
+      else
+	{
+	  if ( ip1 < 0 || ip1 > 0xFF   ) timetype = TAXIS_ABSOLUTE;
+	  if ( ip2 < 0 || ip2 > 0xFF   ) timetype = TAXIS_ABSOLUTE;
+	}
+
+      ISEC1_TimeRange   = timerange;
+      ISEC1_TimePeriod1 = ip1;
+      ISEC1_TimePeriod2 = ip2;
+    }
+
+  if ( timetype == TAXIS_ABSOLUTE )
+    {
+      (void) cgribexDefDateTime(isec1, timeunit, vdate, vtime);
+
+      /*
+      if ( numavg > 0 )
+	ISEC1_TimeRange = 0;
+      else
+      */
+      if ( ISEC1_TimeRange != 3 )
+	ISEC1_TimeRange   = 10;
+
+      ISEC1_TimePeriod1 = 0;
+      ISEC1_TimePeriod2 = 0;
+    }
+
+  ISEC1_AvgNum         = numavg;
+  ISEC1_AvgMiss        = 0;
+  ISEC1_DecScaleFactor = 0;
+}
+
+static
+void cgribexDefGrid(int *isec1, int *isec2, int *isec4, int gridID)
+{
+  int gridtype;
+  int lcurvi = FALSE;
+  static short lwarn = TRUE;
+
+  memset(isec2, 0, 16*sizeof(int));
+
+  ISEC1_Sec2Or3Flag = 128;
+
+  gridtype = gridInqType(gridID);
+
+  ISEC1_GridDefinition = 255;
+
+  if ( gridtype == GRID_GENERIC )
+    {
+      int xsize, ysize, gridsize;
+
+      gridsize = gridInqSize(gridID);
+      xsize = gridInqXsize(gridID);
+      ysize = gridInqYsize(gridID);
+
+      if ( (ysize ==  32 || ysize ==  48 || ysize ==  64 ||
+	    ysize ==  96 || ysize == 160 || ysize == 192 ||
+	    ysize == 240 || ysize == 320 || ysize == 384 ||
+	    ysize == 480 || ysize == 768 ) && 
+	   (xsize == 2*ysize || xsize == 1) )
+	{
+	  gridtype = GRID_GAUSSIAN;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( gridsize == 1 )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( gridInqXvals(gridID, NULL) && gridInqYvals(gridID, NULL) )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+    }
+  else if ( gridtype == GRID_CURVILINEAR )
+    {
+      if ( lwarn && gridInqSize(gridID) > 1 )
+	{
+	  lwarn = FALSE;
+	  Warning("Curvilinear grids are unsupported in GRIB1! Created wrong GDS!");
+	}
+      gridtype = GRID_LONLAT;
+      lcurvi = TRUE;
+    }
+
+  ISEC2_Reduced  = FALSE;
+  ISEC2_ScanFlag = 0;
+
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_GAUSSIAN_REDUCED:
+    case GRID_TRAJECTORY:
+      {
+	int nlon = 0, nlat;
+	double xfirst = 0, xlast = 0, xinc = 0;
+	double yfirst = 0, ylast = 0, yinc = 0;
+
+	if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
+          ISEC2_GridType = GRIB1_GTYPE_GAUSSIAN;
+        else if ( gridtype == GRID_LONLAT && gridIsRotated(gridID) )
+	  ISEC2_GridType = GRIB1_GTYPE_LATLON_ROT;
+	else
+	  ISEC2_GridType = GRIB1_GTYPE_LATLON;
+
+	nlon = gridInqXsize(gridID);
+	nlat = gridInqYsize(gridID);
+
+	if ( gridtype == GRID_GAUSSIAN_REDUCED )
+	  {
+	    ISEC2_Reduced = TRUE;
+	    nlon = 0;
+	    gridInqRowlon(gridID, ISEC2_RowLonPtr);
+	  }
+	else
+	  {
+	    if ( nlon == 0 )
+	      {
+		nlon = 1;
+	      }
+	    else
+	      {
+		xfirst = gridInqXval(gridID,      0);
+		if ( lcurvi )
+		  xlast  = gridInqXval(gridID, nlon*nlat-1);
+		else
+		  xlast  = gridInqXval(gridID, nlon-1);
+		xinc   = gridInqXinc(gridID);
+	      }
+	  }
+
+	if ( nlat == 0 )
+	  {
+	    nlat = 1;
+	  }
+	else
+	  {
+	    yfirst = gridInqYval(gridID,      0);
+	    if ( lcurvi )
+	      ylast  = gridInqYval(gridID, nlon*nlat-1);
+	    else
+	      ylast  = gridInqYval(gridID, nlat-1);
+	    yinc   = gridInqYinc(gridID);
+	    if ( yinc < 0 ) yinc = -yinc;
+	  }
+
+	ISEC2_NumLon   = nlon;
+	ISEC2_NumLat   = nlat;
+	ISEC2_FirstLat = NINT(yfirst*1000);
+	ISEC2_LastLat  = NINT(ylast*1000);
+	if ( gridtype == GRID_GAUSSIAN_REDUCED )
+	  {
+	    ISEC2_FirstLon = 0;
+	    ISEC2_LastLon  = NINT(1000*(360.-360./(nlat*2)));
+	    ISEC2_LonIncr  = NINT(1000*360./(nlat*2));
+	  }
+	else
+	  {
+	    ISEC2_FirstLon = NINT(xfirst*1000);
+	    ISEC2_LastLon  = NINT(xlast*1000);
+	    ISEC2_LonIncr  = NINT(xinc*1000);
+	  }
+
+	// if ( fabs(xinc*1000 - ISEC2_LonIncr) > FLT_EPSILON ) ISEC2_LonIncr = 0;
+
+	if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
+          {
+            int np = gridInqNP(gridID);
+            if ( np == 0 ) np = nlat/2;
+            ISEC2_NumPar = np;
+          }
+	else
+	  {
+	    ISEC2_LatIncr = NINT(yinc*1000);
+	    // if ( fabs(yinc*1000 - ISEC2_LatIncr) > FLT_EPSILON ) ISEC2_LatIncr = 0;
+
+	    if ( ISEC2_LatIncr < 0 ) ISEC2_LatIncr = -ISEC2_LatIncr;
+	  }
+
+	if ( ISEC2_NumLon > 1 && ISEC2_NumLat == 1 )
+	  if ( ISEC2_LonIncr != 0 && ISEC2_LatIncr == 0 ) ISEC2_LatIncr = ISEC2_LonIncr;
+
+	if ( ISEC2_NumLon == 1 && ISEC2_NumLat > 1 )
+	  if ( ISEC2_LonIncr == 0 && ISEC2_LatIncr != 0 ) ISEC2_LonIncr = ISEC2_LatIncr;
+
+	if ( ISEC2_LatIncr == 0 || ISEC2_LonIncr == 0 )
+	  ISEC2_ResFlag = 0;
+	else
+	  ISEC2_ResFlag = 128;
+
+	if ( gridIsRotated(gridID) )
+	  {
+	    ISEC2_LatSP = - NINT(gridInqYpole(gridID) * 1000);
+	    ISEC2_LonSP =   NINT((gridInqXpole(gridID) + 180) * 1000);
+	  }
+
+	/* East -> West */
+	if ( ISEC2_LastLon < ISEC2_FirstLon ) ISEC2_ScanFlag += 128;
+
+	/* South -> North */
+	if ( ISEC2_LastLat > ISEC2_FirstLat ) ISEC2_ScanFlag += 64;
+
+	break;
+      }
+    case GRID_LCC:
+      {
+	double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
+	int xsize, ysize;
+	int projflag, scanflag;
+
+	xsize = gridInqXsize(gridID);
+	ysize = gridInqYsize(gridID);
+
+	gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm,
+		   &projflag, &scanflag);
+
+	ISEC2_GridType = GRIB1_GTYPE_LCC;
+	ISEC2_NumLon   = xsize;
+	ISEC2_NumLat   = ysize;
+	ISEC2_FirstLon = NINT(originLon * 1000);
+	ISEC2_FirstLat = NINT(originLat * 1000);
+	ISEC2_Lambert_Lov    = NINT(lonParY * 1000);
+	ISEC2_Lambert_LatS1  = NINT(lat1 * 1000);
+	ISEC2_Lambert_LatS2  = NINT(lat2 * 1000);
+	ISEC2_Lambert_dx     = NINT(xincm);
+	ISEC2_Lambert_dy     = NINT(yincm);
+	ISEC2_Lambert_LatSP  = 0;
+	ISEC2_Lambert_LatSP  = 0;
+	ISEC2_Lambert_ProjFlag = projflag;
+	ISEC2_ScanFlag = scanflag;
+
+	break;
+      }
+    case GRID_SPECTRAL:
+      {
+	ISEC2_GridType = GRIB1_GTYPE_SPECTRAL;
+	ISEC2_PentaJ   = gridInqTrunc(gridID);
+	ISEC2_PentaK   = ISEC2_PentaJ;
+	ISEC2_PentaM   = ISEC2_PentaJ;
+	ISEC2_RepType  = 1;
+	isec4[2]       = 128;
+	if ( gridInqComplexPacking(gridID) && ISEC2_PentaJ >= 21 )
+	  {
+	    ISEC2_RepMode  = 2;
+	    isec4[3]       = 64;
+	    isec4[16]      = 0;
+	    isec4[17]      = 20;
+	    isec4[18]      = 20;
+	    isec4[19]      = 20;
+	  }
+	else
+	  {
+	    ISEC2_RepMode  = 1;
+	    isec4[3]       = 0;
+	  }
+	break;
+      }
+    case GRID_GME:
+      {
+	ISEC2_GridType   = GRIB1_GTYPE_GME;
+	ISEC2_GME_ND     = gridInqGMEnd(gridID);
+	ISEC2_GME_NI     = gridInqGMEni(gridID);
+	ISEC2_GME_NI2    = gridInqGMEni2(gridID);
+	ISEC2_GME_NI3    = gridInqGMEni3(gridID);
+	ISEC2_GME_AFlag  = 0;
+	ISEC2_GME_LatPP  = 90000;
+	ISEC2_GME_LonPP  = 0;
+	ISEC2_GME_LonMPL = 0;
+	ISEC2_GME_BFlag  = 0;
+	break;
+      }
+    default:
+      {
+	Warning("The CGRIBEX library can not store fields on the used grid!");
+	Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+      }
+    }
+}
+
+static
+void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int levelID)
+{
+  double level;
+  int ilevel, zaxistype, ltype;
+  static int warning = 1;
+  static int vct_warning = 1;
+
+  zaxistype = zaxisInqType(zaxisID);
+  ltype = zaxisInqLtype(zaxisID);
+
+  if ( zaxistype == ZAXIS_GENERIC && ltype == 0 )
+    {
+      Message("Changed zaxis type from %s to %s",
+	      zaxisNamePtr(zaxistype),
+	      zaxisNamePtr(ZAXIS_PRESSURE));
+      zaxistype = ZAXIS_PRESSURE;
+      zaxisChangeType(zaxisID, zaxistype);
+      zaxisDefUnits(zaxisID, "Pa");
+    }
+
+  ISEC2_NumVCP = 0;
+
+  switch (zaxistype)
+    {
+    case ZAXIS_SURFACE:
+      {
+	ISEC1_LevelType = GRIB1_LTYPE_SURFACE;
+	ISEC1_Level1    = (int) zaxisInqLevel(zaxisID, levelID);
+	ISEC1_Level2    = 0;
+	break;
+      }
+    case ZAXIS_TOA:
+      {
+	ISEC1_LevelType = GRIB1_LTYPE_TOA;
+	ISEC1_Level1    = 0;
+	ISEC1_Level2    = 0;
+	break;
+      }
+    case ZAXIS_SEA_BOTTOM:
+      {
+	ISEC1_LevelType = GRIB1_LTYPE_SEA_BOTTOM;
+	ISEC1_Level1    = 0;
+	ISEC1_Level2    = 0;
+	break;
+      }
+    case ZAXIS_ATMOSPHERE:
+      {
+	ISEC1_LevelType = GRIB1_LTYPE_ATMOSPHERE;
+	ISEC1_Level1    = 0;
+	ISEC1_Level2    = 0;
+	break;
+      }
+    case ZAXIS_MEANSEA:
+      {
+	ISEC1_LevelType = GRIB1_LTYPE_MEANSEA;
+	ISEC1_Level1    = (int) zaxisInqLevel(zaxisID, levelID);
+	ISEC1_Level2    = 0;
+	break;
+      }
+    case ZAXIS_HYBRID:
+    case ZAXIS_HYBRID_HALF:
+      {
+	int vctsize;
+
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+	    ISEC1_LevelType = GRIB1_LTYPE_HYBRID_LAYER;
+	    ISEC1_Level1    = (int) zaxisInqLbound(zaxisID, levelID);
+	    ISEC1_Level2    = (int) zaxisInqUbound(zaxisID, levelID);
+	  }
+	else
+	  {
+	    ISEC1_LevelType = GRIB1_LTYPE_HYBRID;
+	    ISEC1_Level1    = (int) zaxisInqLevel(zaxisID, levelID);
+	    ISEC1_Level2    = 0;
+	  }
+
+	vctsize = zaxisInqVctSize(zaxisID);
+	if ( vctsize == 0 && warning )
+	  {
+	    Warning("VCT missing. ( param = %d, zaxisID = %d )", ISEC1_Parameter, zaxisID);
+	    warning = 0;
+	  }
+	if ( vctsize > 255 )
+	  {
+	    ISEC2_NumVCP = 0;
+	    if ( vct_warning )
+	      {
+		Warning("VCT size of %d is too large (maximum is 255). Set to 0!", vctsize);
+		vct_warning = 0;
+	      }
+	  }
+	else
+	  {
+	    ISEC2_NumVCP = vctsize;
+	    zaxisInqVct(zaxisID, &fsec2[10]);
+	  }
+	break;
+      }
+    case ZAXIS_PRESSURE:
+      {
+	double dum;
+	char units[128];
+
+	level = zaxisInqLevel(zaxisID, levelID);
+	if ( level < 0 )
+	  Warning("Pressure level of %f Pa is below zero!", level);
+
+	zaxisInqUnits(zaxisID, units);
+	if ( memcmp(units, "Pa", 2) != 0 ) level *= 100;
+
+	ilevel = (int) level;
+	if ( level < 32768 && (level < 100 || modf(level/100, &dum) > 0) )
+	  {
+	    ISEC1_LevelType = GRIB1_LTYPE_99;
+	    ISEC1_Level1    = ilevel;
+	    ISEC1_Level2    = 0;
+	  }
+	else
+	  {
+	    ISEC1_LevelType = GRIB1_LTYPE_ISOBARIC;
+	    ISEC1_Level1    = ilevel/100;
+	    ISEC1_Level2    = 0;
+	  }
+	break;
+      }
+    case ZAXIS_HEIGHT:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	ISEC1_LevelType = GRIB1_LTYPE_HEIGHT;
+	ISEC1_Level1    = ilevel;
+	ISEC1_Level2    = 0;
+
+	break;
+      }
+    case ZAXIS_ALTITUDE:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	ISEC1_LevelType = GRIB1_LTYPE_ALTITUDE;
+	ISEC1_Level1    = ilevel;
+	ISEC1_Level2    = 0;
+
+	break;
+      }
+    case ZAXIS_SIGMA:
+      {
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+	    ISEC1_LevelType = GRIB1_LTYPE_SIGMA_LAYER;
+	    ISEC1_Level1    = (int) zaxisInqLbound(zaxisID, levelID);
+	    ISEC1_Level2    = (int) zaxisInqUbound(zaxisID, levelID);
+	  }
+	else
+	  {
+            level = zaxisInqLevel(zaxisID, levelID);
+
+            ilevel = (int) level;
+            ISEC1_LevelType = GRIB1_LTYPE_SIGMA;
+            ISEC1_Level1    = ilevel;
+            ISEC1_Level2    = 0;
+          }
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_LAND:
+      {
+	char units[128];
+	double factor;
+
+	zaxisInqUnits(zaxisID, units);
+
+        if      ( memcmp(units, "mm", 2) == 0 ) factor =   0.1;
+        else if ( memcmp(units, "cm", 2) == 0 ) factor =   1;
+        else if ( memcmp(units, "dm", 2) == 0 ) factor =  10;
+        else                                    factor = 100; // meter
+
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+            double level1, level2;
+            level1 = zaxisInqLbound(zaxisID, levelID);
+            level2 = zaxisInqUbound(zaxisID, levelID);
+	    ISEC1_LevelType = GRIB1_LTYPE_LANDDEPTH_LAYER;
+	    ISEC1_Level1    = (int) (level1*factor);
+	    ISEC1_Level2    = (int) (level2*factor);
+	  }
+	else
+	  {
+	    level = zaxisInqLevel(zaxisID, levelID);
+
+	    ilevel = (int) (level*factor);
+	    ISEC1_LevelType = GRIB1_LTYPE_LANDDEPTH;
+	    ISEC1_Level1    = ilevel;
+	    ISEC1_Level2    = 0;
+	  }
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_SEA:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	ISEC1_LevelType = GRIB1_LTYPE_SEADEPTH;
+	ISEC1_Level1    = ilevel;
+	ISEC1_Level2    = 0;
+
+	break;
+      }
+    case ZAXIS_ISENTROPIC:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	ISEC1_LevelType = GRIB1_LTYPE_ISENTROPIC;
+	ISEC1_Level1    = ilevel;
+	ISEC1_Level2    = 0;
+
+	break;
+      }
+    case ZAXIS_GENERIC:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	ISEC1_LevelType = ltype;
+	ISEC1_Level1    = ilevel;
+	ISEC1_Level2    = 0;
+
+	break;
+      }
+    default:
+      {
+	Error("Unsupported zaxis type: %s", zaxisNamePtr(zaxistype));
+	break;
+      }
+    }
+}
+
+static
+void cgribexDefMask(int *isec3)
+{
+}
+
+static
+void cgribexDefaultSec0(int *isec0)
+{
+  ISEC0_GRIB_Len     = 0;
+  ISEC0_GRIB_Version = 0;
+}
+
+static
+void cgribexDefaultSec1(int *isec1)
+{
+  ISEC1_CenterID    = 0;
+  ISEC1_SubCenterID = 0;
+  ISEC1_LocalFLag   = 0;
+}
+
+static
+void cgribexDefaultSec4(int *isec4)
+{
+  long i;
+
+  for ( i = 2; i <= 10; ++i ) isec4[i] = 0;
+}
+
+static
+void cgribexDefEnsembleVar(int *isec1, int vlistID, int varID)
+{
+  int ensID, ensCount, forecast_type;
+
+  /* For Ensemble info  */
+
+  //Put1Byte(isec1[36]);        /* MPIM local GRIB use definition identifier  */
+                                /*    (extension identifier)                  */
+  //Put1Byte(isec1[37]);        /* type of ensemble forecast                  */
+  //Put2Byte(isec1[38]);        /* individual ensemble member                 */
+  //Put2Byte(isec1[39]);        /* number of forecasts in ensemble            */
+
+  if ( vlistInqVarEnsemble(vlistID, varID, &ensID, &ensCount, &forecast_type) )
+    {
+      if ( ISEC1_CenterID == 252 )
+        {
+          ISEC1_LocalFLag = 1;
+          isec1[36] = 1;
+
+          isec1[37] =  forecast_type;
+          isec1[38] =  ensID;
+          isec1[39] =  ensCount;
+        }
+    }
+}
+#endif
+
+
+size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisID,
+		     int vdate, int vtime, int tsteptype, int numavg,
+		     long datasize, const double *data, int nmiss, unsigned char *gribbuffer, size_t gribbuffersize)
+{
+  size_t nbytes = 0;
+#if  defined  (HAVE_LIBCGRIBEX)
+  long gribsize;
+  int iret = 0, iword = 0;
+  int isec0[2], isec1[4096], isec2[4096], isec3[2], isec4[512];
+  double fsec2[512], fsec3[2];
+  int datatype;
+  int param;
+
+  memset(isec1, 0, 256*sizeof(int));
+  fsec2[0] = 0; fsec2[1] = 0;
+
+  gribsize = gribbuffersize / sizeof(int);
+  param    = vlistInqVarParam(vlistID, varID);
+
+  cgribexDefaultSec0(isec0);
+  cgribexDefaultSec1(isec1);
+  cgribexDefaultSec4(isec4);
+
+  cgribexDefInstitut(isec1, vlistID, varID);
+  cgribexDefModel(isec1, vlistID, varID);
+
+  datatype = vlistInqVarDatatype(vlistID, varID);
+
+  cgribexDefParam(isec1, param);
+  cgribexDefTime(isec1, vdate, vtime, tsteptype, numavg, vlistInqTaxis(vlistID));
+  cgribexDefGrid(isec1, isec2, isec4, gridID);
+  cgribexDefLevel(isec1, isec2, fsec2, zaxisID, levelID);
+  cgribexDefMask(isec3);
+
+  cgribexDefEnsembleVar(isec1, vlistID, varID);
+
+  ISEC4_NumValues = gridInqSize(gridID);
+  ISEC4_NumBits   = grbBitsPerValue(datatype);
+
+  if ( nmiss > 0 )
+    {
+      FSEC3_MissVal = vlistInqVarMissval(vlistID, varID);
+      ISEC1_Sec2Or3Flag |= 64;
+    }
+
+  if ( isec4[2] == 128 && isec4[3] == 64 )
+    {
+      isec4[16] = (int) (1000*calculate_pfactor(data, ISEC2_PentaJ, isec4[17]));
+      if ( isec4[16] < -10000 ) isec4[16] = -10000;
+      if ( isec4[16] >  10000 ) isec4[16] =  10000;
+    }
+  //printf("isec4[16] %d\n", isec4[16]);
+
+  gribExDP(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, (double*) data,
+	   datasize, (int *) gribbuffer, gribsize, &iword, "C", &iret);
+
+  if ( iret ) Error("Problem during GRIB encode (errno = %d)!", iret);
+
+  nbytes = iword*sizeof(int);
+#else
+  Error("CGRIBEX support not compiled in!");
+#endif
+
+  return (nbytes);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+
+
+
+#if  defined  (HAVE_LIBGRIB_API)
+#endif
+
+
+extern int cdiInventoryMode;
+
+typedef struct {
+  int param;
+  int level1;
+  int level2;
+  int ltype;
+} compvar2_t;
+
+
+#if  defined  (HAVE_LIBGRIB_API)
+static
+int gribapiGetGridType(grib_handle *gh)
+{
+  int gridtype = GRID_GENERIC;
+  int gribgridtype;
+  long lpar;
+
+    {
+      GRIB_CHECK(grib_get_long(gh, "gridDefinitionTemplateNumber", &lpar), 0);
+      gribgridtype = (int) lpar;
+
+      switch (gribgridtype)
+	{
+	case  GRIB2_GTYPE_LATLON:     { GRIB_CHECK(grib_get_long(gh, "Ni", &lpar), 0);
+	                                if ( lpar == (long) GRIB_MISSING_LONG ) break;
+                                      }
+	case  GRIB2_GTYPE_LATLON_ROT: { gridtype = GRID_LONLAT;    break; }
+	case  GRIB2_GTYPE_LCC:        { gridtype = GRID_LCC;       break; }
+	case  GRIB2_GTYPE_GAUSSIAN:   { GRIB_CHECK(grib_get_long(gh, "Ni", &lpar), 0);
+	                                if ( lpar == (long) GRIB_MISSING_LONG )
+					  gridtype = GRID_GAUSSIAN_REDUCED;
+					else
+					  gridtype = GRID_GAUSSIAN;
+					break;
+                                      }
+	case  GRIB2_GTYPE_SPECTRAL:   { gridtype = GRID_SPECTRAL;  break; }
+	case  GRIB2_GTYPE_GME:        { gridtype = GRID_GME;       break; }
+	case  GRIB2_GTYPE_NUMBER:     { gridtype = GRID_REFERENCE; break; }
+	}
+    }
+
+  return (gridtype);
+}
+
+static
+int gribapiGetIsRotated(grib_handle *gh)
+{
+  int isRotated = 0;
+  int gribgridtype;
+  long lpar;
+
+    {
+      GRIB_CHECK(grib_get_long(gh, "gridDefinitionTemplateNumber", &lpar), 0);
+      gribgridtype = (int) lpar;
+
+      if ( gribgridtype == GRIB2_GTYPE_LATLON_ROT ) isRotated = 1;
+    }
+
+  return (isRotated);
+}
+
+static
+int gribapiGetZaxisType(long editionNumber, int grib_ltype)
+{
+  int zaxistype = ZAXIS_GENERIC;
+
+  if ( editionNumber <= 1 )
+    {
+      zaxistype = grib1ltypeToZaxisType(grib_ltype);
+    }
+  else
+    {
+      zaxistype = grib2ltypeToZaxisType(grib_ltype);
+    }
+
+  return (zaxistype);
+}
+
+static
+int getTimeunits(long unitsOfTime)
+{
+  int timeunits = -1;
+
+  switch (unitsOfTime)
+    {
+    case 13:  timeunits = TUNIT_SECOND;  break;
+    case  0:  timeunits = TUNIT_MINUTE;  break;
+    case  1:  timeunits = TUNIT_HOUR;    break;
+    case 10:  timeunits = TUNIT_3HOURS;  break;
+    case 11:  timeunits = TUNIT_6HOURS;  break;
+    case 12:  timeunits = TUNIT_12HOURS; break;
+    case  2:  timeunits = TUNIT_DAY;     break;
+    default:  timeunits = TUNIT_HOUR;    break;
+    }
+
+  return (timeunits);
+}
+
+static
+double timeunit_factor(int tu1, int tu2)
+{
+  double factor = 1;
+
+  if ( tu2 == TUNIT_HOUR )
+    {
+      switch (tu1)
+        {
+        case TUNIT_SECOND:  factor = 3600;   break;
+        case TUNIT_MINUTE:  factor = 60;     break;
+        case TUNIT_HOUR:    factor = 1;      break;
+        case TUNIT_3HOURS:  factor = 1./3;   break;
+        case TUNIT_6HOURS:  factor = 1./6;   break;
+        case TUNIT_12HOURS: factor = 1./12;  break;
+        case TUNIT_DAY:     factor = 1./24;  break;
+        }
+    }
+
+  return (factor);
+}
+
+static
+int gribapiGetEndStep(grib_handle *gh, int startStep, int timeunits)
+{
+  int endStep = startStep;
+  int timeunits2;
+  long unitsOfTime;
+  long lpar;
+
+  GRIB_CHECK(grib_get_long(gh, "stepUnits", &unitsOfTime), 0);
+
+  timeunits2 = getTimeunits(unitsOfTime);
+
+  GRIB_CHECK(grib_get_long(gh, "endStep", &lpar), 0);
+
+  endStep = (int)  ((lpar * timeunit_factor(timeunits, timeunits2)) + 0.5);
+
+  return (endStep);
+}
+
+static
+int gribapiGetTimeUnits(grib_handle *gh)
+{
+  int timeunits = -1;
+  long unitsOfTime;
+  // size_t len = 8;
+  //char stepunits[8];
+  //static int lprint = TRUE;
+
+  GRIB_CHECK(grib_get_long(gh, "indicatorOfUnitOfTimeRange", &unitsOfTime), 0);
+
+  timeunits = getTimeunits(unitsOfTime);
+
+  /*
+  GRIB_CHECK(grib_get_string(gh, "stepUnits", stepunits, &len), 0);
+
+  len--;
+
+  if      ( memcmp(stepunits, "s",   len) == 0 ) timeunits = TUNIT_SECOND;
+  else if ( memcmp(stepunits, "m",   len) == 0 ) timeunits = TUNIT_MINUTE;
+  else if ( memcmp(stepunits, "h",   len) == 0 ) timeunits = TUNIT_HOUR;
+  else if ( memcmp(stepunits, "3h",  len) == 0 ) timeunits = TUNIT_3HOURS;
+  else if ( memcmp(stepunits, "6h",  len) == 0 ) timeunits = TUNIT_6HOURS;
+  else if ( memcmp(stepunits, "12h", len) == 0 ) timeunits = TUNIT_12HOURS;
+  else if ( memcmp(stepunits, "D",   len) == 0 ) timeunits = TUNIT_DAY;
+  else if ( memcmp(stepunits, "M",   len) == 0 ) timeunits = TUNIT_MONTH;
+  else if ( memcmp(stepunits, "Y",   len) == 0 ) timeunits = TUNIT_YEAR;
+  else if ( lprint )
+    {
+      Message("Step units >%s< unsupported!", stepunits);
+      lprint = FALSE;
+    }
+  */
+
+  return (timeunits);
+}
+
+static
+int gribapiTimeIsFC(grib_handle *gh)
+{
+  long editionNumber;
+  int isFC = TRUE;
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  if ( editionNumber > 1 )
+    {
+      long sigofrtime;
+
+      GRIB_CHECK(grib_get_long(gh, "significanceOfReferenceTime", &sigofrtime), 0);
+
+      if ( sigofrtime == 3 ) isFC = FALSE;
+    }
+
+  return (isFC);
+}
+
+static
+int gribapiGetTsteptype(grib_handle *gh)
+{
+  int tsteptype = TSTEP_INSTANT;
+  static int lprint = TRUE;
+
+  if ( gribapiTimeIsFC(gh) )
+    {
+      int status;
+      size_t len = 256;
+      char stepType[256];
+
+      status = grib_get_string(gh, "stepType", stepType, &len);
+      if ( status == 0 && len > 1 && len < 256 )
+	{
+	  if      ( strncmp("instant", stepType, len) == 0 ) tsteptype = TSTEP_INSTANT;
+	  else if ( strncmp("avg",     stepType, len) == 0 ) tsteptype = TSTEP_AVG;
+	  else if ( strncmp("accum",   stepType, len) == 0 ) tsteptype = TSTEP_ACCUM;
+	  else if ( strncmp("max",     stepType, len) == 0 ) tsteptype = TSTEP_MAX;
+	  else if ( strncmp("min",     stepType, len) == 0 ) tsteptype = TSTEP_MIN;
+	  else if ( strncmp("diff",    stepType, len) == 0 ) tsteptype = TSTEP_DIFF;
+	  else if ( strncmp("rms",     stepType, len) == 0 ) tsteptype = TSTEP_RMS;
+	  else if ( strncmp("sd",      stepType, len) == 0 ) tsteptype = TSTEP_SD;
+	  else if ( strncmp("cov",     stepType, len) == 0 ) tsteptype = TSTEP_COV;
+	  else if ( strncmp("ratio",   stepType, len) == 0 ) tsteptype = TSTEP_RATIO;
+	  else if ( lprint )
+	    {
+	      Message("stepType %s unsupported, set to instant!", stepType);
+	      lprint = FALSE;
+	    }
+
+	  // printf("stepType: %s %ld %d\n", stepType, len, tsteptype);
+	}
+    }
+
+  return (tsteptype);
+}
+
+static
+int gribapiGetValidityDateTime(grib_handle *gh, int *vdate, int *vtime)
+{
+  int rdate, rtime;
+  int timeUnits, startStep, endStep;
+  int tstepRange = 0;
+  int range;
+  long lpar;
+  long sigofrtime = 3;
+  long editionNumber;
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  if ( editionNumber > 1 )
+    {
+      GRIB_CHECK(grib_get_long(gh, "significanceOfReferenceTime", &sigofrtime), 0);
+    }
+
+  if ( sigofrtime == 3 )
+    {
+      GRIB_CHECK(grib_get_long(gh, "dataDate", &lpar), 0);
+      *vdate = (int) lpar;
+      GRIB_CHECK(grib_get_long(gh, "dataTime", &lpar), 0);
+      *vtime = (int) lpar*100;
+    }
+  else
+    {
+      GRIB_CHECK(grib_get_long(gh, "dataDate", &lpar), 0);
+      rdate = (int) lpar;
+      GRIB_CHECK(grib_get_long(gh, "dataTime", &lpar), 0);
+      rtime = (int) lpar*100;
+      GRIB_CHECK(grib_get_long(gh, "forecastTime", &lpar), 0);
+      startStep = (int) lpar;
+      timeUnits = gribapiGetTimeUnits(gh);
+      endStep = gribapiGetEndStep(gh, startStep, timeUnits);
+
+      range = endStep - startStep;
+
+      if ( range > 0 )
+	{
+	  if ( startStep == 0 ) tstepRange = -1;
+	  else                  tstepRange =  1;
+	}
+
+      {
+	static int lprint = TRUE;
+	extern int grib_calendar;
+	int ryear, rmonth, rday, rhour, rminute, rsecond;
+	int time_period = endStep;
+	int julday, secofday, addsec;
+
+	cdiDecodeDate(rdate, &ryear, &rmonth, &rday);
+	cdiDecodeTime(rtime, &rhour, &rminute, &rsecond);
+
+	encode_caldaysec(grib_calendar, ryear, rmonth, rday, rhour, rminute, rsecond, &julday, &secofday);
+
+	addsec = 0;
+	switch ( timeUnits )
+	  {
+	  case TUNIT_SECOND:  addsec =         time_period; break;
+	  case TUNIT_MINUTE:  addsec =    60 * time_period; break;
+	  case TUNIT_HOUR:    addsec =  3600 * time_period; break;
+	  case TUNIT_3HOURS:  addsec = 10800 * time_period; break;
+	  case TUNIT_6HOURS:  addsec = 21600 * time_period; break;
+	  case TUNIT_12HOURS: addsec = 43200 * time_period; break;
+	  case TUNIT_DAY:     addsec = 86400 * time_period; break;
+	  default:
+	    if ( lprint )
+	      {
+	        Warning("Time unit %d unsupported", timeUnits);
+		lprint = FALSE;
+	      }
+	  }
+
+	julday_add_seconds(addsec, &julday, &secofday);
+
+	decode_caldaysec(grib_calendar, julday, secofday, &ryear, &rmonth, &rday, &rhour, &rminute, &rsecond);
+	/*
+	  printf("new %d/%d/%d %d:%d\n", ryear, rmonth, rday, rhour, rminute);
+	*/
+	*vdate = cdiEncodeDate(ryear, rmonth, rday);
+	*vtime = cdiEncodeTime(rhour, rminute, rsecond);
+      }
+    }
+
+  return (tstepRange);
+}
+
+static
+void gribapiGetGrid(grib_handle *gh, grid_t *grid)
+{
+  long editionNumber;
+  int gridtype;
+  size_t datasize;
+  long numberOfPoints;
+  long lpar;
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  gridtype = gribapiGetGridType(gh);
+  /*
+  if ( streamptr->unreduced && gridtype == GRID_GAUSSIAN_REDUCED )
+    {
+      gridtype = GRID_GAUSSIAN;
+      ISEC2_NumLon = 2*ISEC2_NumLat;
+      ISEC4_NumValues = ISEC2_NumLon*ISEC2_NumLat;
+    }
+  */
+  memset(grid, 0, sizeof(grid_t));
+
+  GRIB_CHECK(grib_get_size(gh, "values", &datasize), 0);
+  GRIB_CHECK(grib_get_long(gh, "numberOfPoints", &numberOfPoints), 0);
+
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+      {
+	int nlon, nlat;
+
+	GRIB_CHECK(grib_get_long(gh, "Ni", &lpar), 0);
+	nlon = lpar;
+	GRIB_CHECK(grib_get_long(gh, "Nj", &lpar), 0);
+	nlat = lpar;
+
+	if ( gridtype == GRID_GAUSSIAN )
+          {
+            GRIB_CHECK(grib_get_long(gh, "numberOfParallelsBetweenAPoleAndTheEquator", &lpar), 0);
+            grid->np = lpar;
+          }
+
+	if ( numberOfPoints != nlon*nlat )
+	  Error("numberOfPoints (%d) and gridSize (%d) differ!",
+		(int)numberOfPoints, nlon*nlat);
+
+	grid->size  = numberOfPoints;
+	grid->xsize = nlon;
+	grid->ysize = nlat;
+	grid->xinc  = 0;
+	grid->yinc  = 0;
+	grid->xdef  = 0;
+	GRIB_CHECK(grib_get_double(gh, "longitudeOfFirstGridPointInDegrees", &grid->xfirst), 0);
+	GRIB_CHECK(grib_get_double(gh, "longitudeOfLastGridPointInDegrees",  &grid->xlast), 0);
+	GRIB_CHECK(grib_get_double(gh, "latitudeOfFirstGridPointInDegrees",  &grid->yfirst), 0);
+	GRIB_CHECK(grib_get_double(gh, "latitudeOfLastGridPointInDegrees",   &grid->ylast), 0);
+	GRIB_CHECK(grib_get_double(gh, "iDirectionIncrementInDegrees", &grid->xinc), 0);
+	if ( gridtype == GRID_LONLAT )
+	  GRIB_CHECK(grib_get_double(gh, "jDirectionIncrementInDegrees", &grid->yinc), 0);
+
+	if ( IS_EQUAL(grid->xinc, GRIB_MISSING_DOUBLE) ) grid->xinc = 0;
+
+	/* if ( IS_NOT_EQUAL(grid->xfirst, 0) || IS_NOT_EQUAL(grid->xlast, 0) ) */
+	  {
+	    if ( grid->xsize > 1 )
+	      {
+		if ( (grid->xfirst >= grid->xlast) && (grid->xfirst >= 180) ) grid->xfirst -= 360;
+
+		if ( editionNumber <= 1 )
+		  {
+		    /* correct xinc if necessary */
+		    if ( IS_EQUAL(grid->xfirst, 0) && grid->xlast > 354 )
+		      {
+			double xinc = 360. / grid->xsize;
+
+			if ( fabs(grid->xinc-xinc) > 0.0 )
+			  {
+			    grid->xinc = xinc;
+			    if ( CDI_Debug ) Message("set xinc to %g", grid->xinc);
+			  }
+		      }
+		  }
+	      }
+	    grid->xdef = 2;
+	  }
+	grid->ydef = 0;
+        /* if ( IS_NOT_EQUAL(grid->yfirst, 0) || IS_NOT_EQUAL(grid->ylast, 0) ) */
+	  {
+	    if ( grid->ysize > 1 )
+	      {
+		if ( editionNumber <= 1 )
+		  {
+		  }
+	      }
+	    grid->ydef = 2;
+	  }
+	break;
+      }
+    case GRID_GAUSSIAN_REDUCED:
+      {
+	int nlat, i;
+	size_t dummy;
+	long *pl;
+
+        GRIB_CHECK(grib_get_long(gh, "numberOfParallelsBetweenAPoleAndTheEquator", &lpar), 0);
+        grid->np = lpar;
+
+	GRIB_CHECK(grib_get_long(gh, "Nj", &lpar), 0);
+	nlat = lpar;
+
+	grid->size   = numberOfPoints;
+
+        grid->rowlon = (int *) malloc(nlat*sizeof(int));
+        pl          = (long *) malloc(nlat*sizeof(long));
+	dummy       = nlat;
+	GRIB_CHECK(grib_get_long_array(gh, "pl", pl, &dummy), 0);
+	for ( i = 0; i < nlat; ++i ) grid->rowlon[i] = pl[i];
+	free(pl);
+
+	grid->ysize  = nlat;
+	grid->xinc   = 0;
+	grid->yinc   = 0;
+	grid->xdef   = 0;
+	GRIB_CHECK(grib_get_double(gh, "longitudeOfFirstGridPointInDegrees", &grid->xfirst), 0);
+	GRIB_CHECK(grib_get_double(gh, "longitudeOfLastGridPointInDegrees",  &grid->xlast), 0);
+	GRIB_CHECK(grib_get_double(gh, "latitudeOfFirstGridPointInDegrees",  &grid->yfirst), 0);
+	GRIB_CHECK(grib_get_double(gh, "latitudeOfLastGridPointInDegrees",   &grid->ylast), 0);
+	GRIB_CHECK(grib_get_double(gh, "iDirectionIncrementInDegrees", &grid->xinc), 0);
+
+	if ( IS_EQUAL(grid->xinc, GRIB_MISSING_DOUBLE) ) grid->xinc = 0;
+
+	/* if ( IS_NOT_EQUAL(grid->xfirst, 0) || IS_NOT_EQUAL(grid->xlast, 0) ) */
+	  {
+	    if ( grid->xsize > 1 )
+	      {
+		if ( (grid->xfirst > grid->xlast) && (grid->xfirst >= 180) ) grid->xfirst -= 360;
+
+		if ( editionNumber <= 1 )
+		  {
+		    /* correct xinc if necessary */
+		    if ( IS_EQUAL(grid->xfirst, 0) && grid->xlast > 354 )
+		      {
+			double xinc = 360. / grid->xsize;
+
+			if ( fabs(grid->xinc-xinc) > 0.0 )
+			  {
+			    grid->xinc = xinc;
+			    if ( CDI_Debug ) Message("set xinc to %g", grid->xinc);
+			  }
+		      }
+		  }
+	      }
+	    grid->xdef = 2;
+	  }
+	grid->ydef  = 0;
+        /* if ( IS_NOT_EQUAL(grid->yfirst, 0) || IS_NOT_EQUAL(grid->ylast, 0) ) */
+	  {
+	    if ( grid->ysize > 1 )
+	      {
+		if ( editionNumber <= 1 )
+		  {
+		  }
+	      }
+	    grid->ydef = 2;
+	  }
+	break;
+      }
+      /*
+    case GRID_LCC:
+      {
+	if ( ISEC4_NumValues != ISEC2_NumLon*ISEC2_NumLat )
+	  Error("numberOfPoints (%d) and gridSize (%d) differ!",
+		ISEC4_NumValues, ISEC2_NumLon*ISEC2_NumLat);
+
+	grid->size  = ISEC4_NumValues;
+	grid->xsize = ISEC2_NumLon;
+	grid->ysize = ISEC2_NumLat;
+
+	grid->lcc_xinc      = ISEC2_Lambert_dx;
+	grid->lcc_yinc      = ISEC2_Lambert_dy;
+	grid->lcc_originLon = ISEC2_FirstLon * 0.001;
+	grid->lcc_originLat = ISEC2_FirstLat * 0.001;
+	grid->lcc_lonParY   = ISEC2_Lambert_Lov * 0.001;
+	grid->lcc_lat1      = ISEC2_Lambert_LatS1 * 0.001;
+	grid->lcc_lat2      = ISEC2_Lambert_LatS2 * 0.001;
+	grid->lcc_projflag  = ISEC2_Lambert_ProjFlag;
+	grid->lcc_scanflag  = ISEC2_ScanFlag;
+
+	grid->xdef   = 0;
+	grid->ydef   = 0;
+
+	break;
+      }
+      */
+    case GRID_SPECTRAL:
+      {
+	size_t len = 256;
+	char typeOfPacking[256];
+	GRIB_CHECK(grib_get_string(gh, "packingType", typeOfPacking, &len), 0);
+	grid->lcomplex = 0;
+	if ( strncmp(typeOfPacking, "spectral_complex", len) == 0 ) grid->lcomplex = 1;
+
+	grid->size  = datasize;
+	GRIB_CHECK(grib_get_long(gh, "J", &lpar), 0);
+	grid->trunc = lpar;
+
+	break;
+      }
+    case GRID_GME:
+      {
+	grid->size  = numberOfPoints;
+	if ( grib_get_long(gh, "nd", &lpar) == 0 ) grid->nd  = lpar;
+	if ( grib_get_long(gh, "Ni", &lpar) == 0 ) grid->ni  = lpar;
+	if ( grib_get_long(gh, "n2", &lpar) == 0 ) grid->ni2 = lpar;
+	if ( grib_get_long(gh, "n3", &lpar) == 0 ) grid->ni3 = lpar;
+
+	break;
+      }
+    case GRID_REFERENCE:
+      {
+        char uuid[17];
+	char reference_link[8192];
+	size_t len = sizeof(reference_link);
+	reference_link[0] = 0;
+
+	grid->size  = numberOfPoints;
+	if ( grib_get_long(gh, "numberOfGridUsed", &lpar) == 0 )
+	  {
+	    grid->number   = lpar;
+	    if ( grib_get_long(gh, "numberOfGridInReference", &lpar) == 0 ) grid->position = lpar;
+	    if ( grib_get_string(gh, "gridDescriptionFile", reference_link, &len) == 0 )
+	      {
+		if ( strncmp(reference_link, "file://", 7) == 0 )
+		  grid->reference = strdupx(reference_link);
+	      }
+            len = (size_t) 16;
+            if ( grib_get_string(gh, "uuidOfHGrid", uuid, &len) == 0)
+              {
+                strncpy(grid->uuid, uuid, 16);
+              }
+	  }
+
+	break;
+      }
+    case GRID_GENERIC:
+      {
+	int nlon = 0, nlat = 0;
+
+	if ( grib_get_long(gh, "Ni", &lpar) == 0 ) nlon = lpar;
+	if ( grib_get_long(gh, "Nj", &lpar) == 0 ) nlat = lpar;
+
+	grid->size  = numberOfPoints;
+
+	if ( nlon > 0 && nlat > 0 && nlon*nlat == grid->size )
+	  {
+	    grid->xsize = nlon;
+	    grid->ysize = nlat;
+	  }
+	else
+	  {
+	    grid->xsize = 0;
+	    grid->ysize = 0;
+	  }
+
+	break;
+      }
+    default:
+      {
+	Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+	break;
+      }
+    }
+
+  grid->isRotated = FALSE;
+  if ( gribapiGetIsRotated(gh) )
+    {
+      grid->isRotated = TRUE;
+      GRIB_CHECK(grib_get_double(gh, "latitudeOfSouthernPoleInDegrees",  &grid->ypole), 0);
+      GRIB_CHECK(grib_get_double(gh, "longitudeOfSouthernPoleInDegrees", &grid->xpole), 0);
+      GRIB_CHECK(grib_get_double(gh, "angleOfRotation", &grid->angle), 0);
+      /* change from south to north pole */
+      grid->ypole = -grid->ypole;
+      grid->xpole =  grid->xpole - 180;
+    }
+
+  grid->xvals = NULL;
+  grid->yvals = NULL;
+  grid->type  = gridtype;
+}
+
+static
+void grib1GetLevel(grib_handle *gh, int *leveltype, int *lbounds, int *level1, int *level2)
+{
+  int status;
+  long lpar;
+  double dlevel;
+
+  *leveltype = 0;
+  *lbounds = 0;
+  *level1  = 0;
+  *level2  = 0;
+
+  status = grib_get_long(gh, "indicatorOfTypeOfLevel", &lpar);
+  if ( status == 0 )
+    {
+      *leveltype = (int) lpar;
+
+      switch (*leveltype)
+	{
+	case GRIB1_LTYPE_SIGMA_LAYER:
+	case GRIB1_LTYPE_HYBRID_LAYER:
+	case GRIB1_LTYPE_LANDDEPTH_LAYER:
+	  { *lbounds = 1; break; }
+	}
+
+      if ( *lbounds == 0 )
+	{
+	  GRIB_CHECK(grib_get_double(gh, "level", &dlevel), 0);
+	  if ( *leveltype == 100 ) dlevel *= 100;
+	  if ( dlevel < -2.e9 || dlevel > 2.e9 ) dlevel = 0;
+	  if ( *leveltype == 99 ) *leveltype = 100;
+
+	  *level1 = (int) dlevel;
+	  *level2 = 0;
+	}
+      else
+	{
+	  GRIB_CHECK(grib_get_long(gh, "topLevel", &lpar), 0);
+	  *level1 = lpar;
+	  GRIB_CHECK(grib_get_long(gh, "bottomLevel", &lpar), 0);
+	  *level2 = lpar;
+	}
+    }
+}
+
+static
+void grib2GetLevel(grib_handle *gh, int *leveltype, int *lbounds, int *level1, int *level2)
+{
+  int status;
+  int leveltype2 = -1;
+  long lpar;
+  long factor;
+  double dlevel;
+
+  *leveltype = 0;
+  *lbounds = 0;
+  *level1  = 0;
+  *level2  = 0;
+
+  status = grib_get_long(gh, "typeOfFirstFixedSurface", &lpar);
+  if ( status == 0 )
+    {
+      *leveltype = (int) lpar;
+
+      status = grib_get_long(gh, "typeOfSecondFixedSurface", &lpar);
+      if ( status == 0 ) leveltype2 = lpar;
+
+      if ( *leveltype == leveltype2 && *leveltype != 255 ) *lbounds = 1;
+
+      if ( *lbounds == 0 )
+	{
+	  if ( *leveltype == GRIB2_LTYPE_LANDDEPTH )
+	    {
+	      GRIB_CHECK(grib_get_long(gh, "scaleFactorOfFirstFixedSurface", &factor), 0);
+	      GRIB_CHECK(grib_get_double(gh, "scaledValueOfFirstFixedSurface", &dlevel), 0);
+	      if      ( factor == 0 ) dlevel *= 100;   //  m to cm
+	      else if ( factor == 1 ) dlevel *=  10;   // dm to cm
+	      else if ( factor == 3 ) dlevel *=   0.1; // mm to cm
+	    }
+	  else
+	    {
+	      GRIB_CHECK(grib_get_double(gh, "level", &dlevel), 0);
+	      if ( *leveltype == GRIB2_LTYPE_ISOBARIC ) dlevel *= 100;
+	      if ( dlevel < -2.e9 || dlevel > 2.e9 ) dlevel = 0;
+	      if ( *leveltype == 99 ) *leveltype = 100;
+	    }
+
+	  *level1 = (int) dlevel;
+	  *level2 = 0;
+	}
+      else
+	{
+	  if ( *leveltype == GRIB2_LTYPE_LANDDEPTH )
+	    {
+	      GRIB_CHECK(grib_get_long(gh, "scaleFactorOfFirstFixedSurface", &factor), 0);
+	      GRIB_CHECK(grib_get_double(gh, "scaledValueOfFirstFixedSurface", &dlevel), 0);
+	      if      ( factor == 0 ) dlevel *= 100;   //  m to cm
+	      else if ( factor == 1 ) dlevel *=  10;   // dm to cm
+	      else if ( factor == 3 ) dlevel *=   0.1; // mm to cm
+	      *level1 = (int) dlevel;
+	      GRIB_CHECK(grib_get_long(gh, "scaleFactorOfSecondFixedSurface", &factor), 0);
+	      GRIB_CHECK(grib_get_double(gh, "scaledValueOfSecondFixedSurface", &dlevel), 0);
+	      if      ( factor == 0 ) dlevel *= 100;   //  m to cm
+	      else if ( factor == 1 ) dlevel *=  10;   // dm to cm
+	      else if ( factor == 3 ) dlevel *=   0.1; // mm to cm
+	      *level2 = (int) dlevel;
+	    }
+	  else
+	    {
+	      GRIB_CHECK(grib_get_long(gh, "topLevel", &lpar), 0);
+	      *level1 = lpar;
+	      GRIB_CHECK(grib_get_long(gh, "bottomLevel", &lpar), 0);
+	      *level2 = lpar;
+	    }
+	}
+    }
+}
+
+static
+void gribapiAddRecord(int streamID, int param, grib_handle *gh,
+		      long recsize, off_t position, int datatype, int comptype)
+{
+  long editionNumber;
+  int zaxistype;
+  int gridID = CDI_UNDEFID, varID;
+  int levelID = 0;
+  int tsID, recID;
+  int level1 = 0, level2 = 0;
+  int numavg;
+  int tsteptype;
+  int lbounds = 0;
+  record_t *record;
+  grid_t grid;
+  int vlistID;
+  stream_t *streamptr;
+  int leveltype;
+  long lpar;
+  int status;
+  char name[256], longname[256], units[256];
+  size_t vlen;
+  long ens_index = 0, ens_count = 0, ens_forecast_type = 0;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  tsID    = streamptr->curTsID;
+  recID   = recordNewEntry(streamID, tsID);
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  tsteptype = gribapiGetTsteptype(gh);
+  // numavg  = ISEC1_AvgNum;
+  numavg  = 0;
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  if ( editionNumber <= 1 )
+    grib1GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+  else
+    grib2GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+
+  // fprintf(stderr, "param %d %d %d %d\n", param, level1, level2, leveltype);
+
+  (*record).size     = recsize;
+  (*record).position = position;
+  (*record).param    = param;
+  (*record).ilevel   = level1;
+  (*record).ilevel2  = level2;
+  (*record).ltype    = leveltype;
+
+  gribapiGetGrid(gh, &grid);
+
+  gridID = varDefGrid(vlistID, grid, 0);
+
+  zaxistype = gribapiGetZaxisType(editionNumber, leveltype);
+
+  switch (zaxistype)
+    {
+    case ZAXIS_HYBRID:
+    case ZAXIS_HYBRID_HALF:
+      {
+        int vctsize;
+        size_t dummy;
+        double *vctptr;
+
+        GRIB_CHECK(grib_get_long(gh, "NV", &lpar), 0);
+        vctsize = lpar;
+        if ( vctsize > 0 )
+          {
+            vctptr = (double *) malloc(vctsize*sizeof(double));
+            dummy = vctsize;
+            GRIB_CHECK(grib_get_double_array(gh, "pv", vctptr, &dummy), 0);
+            varDefVCT(vctsize, vctptr);
+            free(vctptr);
+          }
+        break;
+      }
+    case ZAXIS_REFERENCE:
+      {
+        size_t len;
+        char uuid[17];
+        long nlev, nvgrid;
+
+        GRIB_CHECK(grib_get_long(gh, "NV", &lpar), 0);
+        if ( lpar != 3 )
+          {
+            fprintf(stderr, "Warning ...\n");
+          }
+        GRIB_CHECK(grib_get_long(gh, "nlev", &nlev), 0);
+        GRIB_CHECK(grib_get_long(gh, "numberOfVGridUsed", &nvgrid), 0);
+
+        len = (size_t) 16;
+        uuid[16] = 0;
+        GRIB_CHECK(grib_get_string(gh, "uuidOfVGrid", uuid, &len), 0);
+        varDefZAxisReference((int) nlev, (int) nvgrid, uuid);
+        break;
+      }
+    }
+
+  // if ( datatype > 32 ) datatype = DATATYPE_PACK32;
+  if ( datatype <  0 ) datatype = DATATYPE_PACK;
+
+  name[0] = 0;
+  longname[0] = 0;
+  units[0] = 0;
+
+  vlen = 256;
+  GRIB_CHECK(grib_get_string(gh, "shortName", name, &vlen), 0);
+  if      ( vlen == 8 && memcmp(name, "unknown", vlen) == 0 ) name[0] = 0;
+  else if ( vlen == 2 && memcmp(name, "~", vlen)       == 0 ) name[0] = 0;
+
+  if ( name[0] != 0 )
+    {
+      vlen = 256;
+      GRIB_CHECK(grib_get_string(gh, "name", longname, &vlen), 0);
+      if ( vlen == 8 && memcmp(longname, "unknown", vlen) == 0 ) longname[0] = 0;
+      vlen = 256;
+      GRIB_CHECK(grib_get_string(gh, "units", units, &vlen), 0);
+      if ( vlen == 8 && memcmp(units, "unknown", vlen) == 0 ) units[0] = 0;
+    }
+  // fprintf(stderr, "param %d name %s %s %s\n", param, name, longname, units); 
+
+  varAddRecord(recID, param, gridID, zaxistype, lbounds, level1, level2,
+	       datatype, &varID, &levelID, tsteptype, numavg, leveltype,
+	       name, longname, units);
+
+  (*record).varID   = varID;
+  (*record).levelID = levelID;
+
+  varDefCompType(varID, comptype);
+
+  /*
+    Get the ensemble Info from the grib-2 Tables and update the intermediate datastructure.
+    Further update to the "vlist" is handled in the same way as for GRIB-1 by "cdiGenVars"
+  */
+  {
+    int status;
+    status = grib_get_long(gh, "typeOfEnsembleForecast", &ens_forecast_type );
+    if ( status == 0 )
+      {
+        GRIB_CHECK(grib_get_long(gh, "numberOfForecastsInEnsemble", &ens_count ), 0);
+        GRIB_CHECK(grib_get_long(gh, "perturbationNumber", &ens_index ), 0);
+      }
+  }
+  if ( ens_index > 0 )
+    varDefEnsembleInfo(varID, (int)ens_index, (int)ens_count, (int)ens_forecast_type);
+
+
+  if ( varInqInst(varID) == CDI_UNDEFID )
+    {
+      long center, subcenter;
+      int instID;
+      GRIB_CHECK(grib_get_long(gh, "centre", &center), 0);
+      GRIB_CHECK(grib_get_long(gh, "subCentre", &subcenter), 0);
+      instID    = institutInq((int)center, (int)subcenter, NULL, NULL);
+      if ( instID == CDI_UNDEFID )
+	instID = institutDef((int)center, (int)subcenter, NULL, NULL);
+      varDefInst(varID, instID);
+    }
+
+  if ( varInqModel(varID) == CDI_UNDEFID )
+    {
+      int modelID;
+      long processID;
+      status = grib_get_long(gh, "generatingProcessIdentifier", &processID);
+      if ( status == 0 )
+	{
+	  modelID = modelInq(varInqInst(varID), processID, NULL);
+	  if ( modelID == CDI_UNDEFID )
+	    modelID = modelDef(varInqInst(varID), processID, NULL);
+	  varDefModel(varID, modelID);
+	}
+    }
+
+  if ( varInqTable(varID) == CDI_UNDEFID )
+    {
+      int pdis, pcat, pnum;
+
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+
+      if ( pdis == 255 )
+	{
+	  int tableID;
+	  int tabnum = pcat;
+
+	  tableID = tableInq(varInqModel(varID), tabnum, NULL);
+
+	  if ( tableID == CDI_UNDEFID )
+	    tableID = tableDef(varInqModel(varID), tabnum, NULL);
+	  varDefTable(varID, tableID);
+	}
+    }
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+
+  if ( CDI_Debug )
+    Message("varID = %d  param = %d  zaxistype = %d  gridID = %d  levelID = %d",
+	    varID, param, zaxistype, gridID, levelID);
+}
+#endif
+
+int gribapiScanTimestep1(int streamID)
+{
+#if  defined  (HAVE_LIBGRIB_API)
+  off_t recpos = 0;
+  unsigned char *gribbuffer = NULL;
+  long buffersize = 0;
+  int rstatus;
+  int status;
+  int fileID;
+  int rtabnum = 0;
+  int rcode = 0, level1 = 0, level2 = 0;
+  int vdate = 0, vtime = 0;
+  int param = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  size_t readsize;
+  int nrecords, nrecs, recID;
+  int datatype;
+  long recsize = 0;
+  int warn_time = TRUE;
+  // int warn_numavg = TRUE;
+  int taxisID = -1;
+  int rdate = 0, rtime = 0, tunit = 0, fcast = 0;
+  taxis_t *taxis;
+  int vlistID;
+  int comptype;
+  long unzipsize;
+  compvar2_t compVar, compVar0;
+  stream_t *streamptr;
+  grib_handle *gh = NULL;
+  int leveltype;
+  int pdis = 0, pcat = 0, pnum = 0;
+  long editionNumber;
+  long lpar;
+  int bitsPerValue;
+  int lieee = FALSE;
+  int lbounds;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 0;
+
+  tsID  = tstepsNewEntry(streamID);
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( tsID != 0 )
+    Error("Internal problem! tstepsNewEntry returns %d", tsID);
+
+  fileID = streamInqFileID(streamID);
+
+  nrecs = 0;
+  while ( TRUE )
+    {
+      level1 = 0;
+      level2 = 0;
+      recsize = gribGetSize(fileID);
+      recpos  = fileGetPos(fileID);
+
+      if ( recsize == 0 )
+	{
+	  streamptr->ntsteps = 1;
+	  break;
+	}
+      if ( recsize > buffersize )
+	{
+	  buffersize = recsize;
+	  gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	}
+
+      readsize = recsize;
+      rstatus = gribRead(fileID, gribbuffer, &readsize);
+      if ( rstatus ) break;
+
+      lieee = FALSE;
+
+      comptype = COMPRESS_NONE;
+      if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	{
+	  comptype = COMPRESS_SZIP;
+	  unzipsize += 100;
+	  if ( (long) buffersize < unzipsize )
+	    {
+	      buffersize = unzipsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+	}
+
+      gh = grib_handle_new_from_message(NULL, (void *) gribbuffer, recsize);
+      GRIB_CHECK(grib_set_double(gh, "missingValue", cdiDefaultMissval), 0);
+
+      GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+      if ( editionNumber <= 1 )
+	{
+	  GRIB_CHECK(grib_get_long(gh, "table2Version", &lpar), 0);
+	  rtabnum = (int) lpar;
+	  GRIB_CHECK(grib_get_long(gh, "indicatorOfParameter", &lpar), 0);
+	  rcode = (int) lpar;
+
+	  param = cdiEncodeParam(rcode, rtabnum, 255);
+
+	  grib1GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	}
+      else
+	{
+	  size_t len = 256;
+	  char typeOfPacking[256];
+
+	  status = grib_get_string(gh, "packingType", typeOfPacking, &len);
+	  if ( status == 0 )
+	    {
+	      // fprintf(stderr, "packingType %d %s\n", len, typeOfPacking);
+	      if      ( strncmp(typeOfPacking, "grid_jpeg", len) == 0 ) comptype = COMPRESS_JPEG;
+	      else if ( strncmp(typeOfPacking, "grid_ieee", len) == 0 ) lieee = TRUE;
+	    }
+
+	  GRIB_CHECK(grib_get_long(gh, "discipline", &lpar), 0);
+	  pdis = (int) lpar;
+
+	  GRIB_CHECK(grib_get_long(gh, "parameterCategory", &lpar), 0);
+	  pcat = (int) lpar;
+
+	  GRIB_CHECK(grib_get_long(gh, "parameterNumber", &lpar), 0);
+	  pnum = (int) lpar;
+
+	  param = cdiEncodeParam(pnum, pcat, pdis);
+
+	  grib2GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	}
+
+      gribapiGetValidityDateTime(gh, &vdate, &vtime);
+      /*
+      printf("%d %d %d.%d.%d %d\n", vdate, vtime, pnum, pcat, pdis, leveltype);
+      */
+      if ( lieee )
+        {
+          datatype = DATATYPE_FLT64;
+          status = grib_get_long(gh, "precision", &lpar);
+          if ( status == 0 && lpar == 1 ) datatype = DATATYPE_FLT32;
+        }
+      else
+        {
+          datatype = DATATYPE_PACK;
+          status = grib_get_long(gh, "bitsPerValue", &lpar);
+          if ( status == 0 )
+            {
+              bitsPerValue = (int) lpar;
+              if ( bitsPerValue > 0 && bitsPerValue <= 32 )
+                datatype = bitsPerValue;
+            }
+        }
+
+      if ( nrecs == 0 )
+	{
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	  GRIB_CHECK(grib_get_long(gh, "dataDate", &lpar), 0);
+	  rdate = (int) lpar;
+	  GRIB_CHECK(grib_get_long(gh, "dataTime", &lpar), 0);
+	  rtime = (int) lpar*100;
+	  fcast = gribapiTimeIsFC(gh);
+	  if ( fcast ) tunit = gribapiGetTimeUnits(gh);
+	}
+      else
+	{
+	  datetime.date  = vdate;
+	  datetime.time  = vtime;
+
+	  compVar.param  = param;
+          compVar.level1 = level1;
+          compVar.level2 = level2;
+	  compVar.ltype  = leveltype;
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      compVar0.param  = streamptr->tsteps[0].records[recID].param;
+	      compVar0.level1 = streamptr->tsteps[0].records[recID].ilevel;
+	      compVar0.level2 = streamptr->tsteps[0].records[recID].ilevel2;
+	      compVar0.ltype  = streamptr->tsteps[0].records[recID].ltype;
+	      /*
+	      printf("var0: %d %d %d %d %d\n", recID, compVar0.param, compVar0.level1, compVar0.level2, compVar0.ltype);
+	      printf("var1: %d %d %d %d %d\n", recID, compVar.param, compVar.level1, compVar.level2, compVar.ltype);
+	      */
+	      if ( memcmp(&compVar0, &compVar, sizeof(compvar2_t)) == 0 ) break;
+	    }
+
+	  if ( cdiInventoryMode == 1 )
+	    {
+	      if ( recID < nrecs ) break;
+	      if ( warn_time )
+		if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 )
+		  {
+		    char paramstr[32];
+		    cdiParamToString(param, paramstr, sizeof(paramstr));
+		    Warning("Inconsistent verification time (param=%s level=%d)", paramstr, level1);
+		    warn_time = FALSE;
+		  }
+	    }
+	  else
+	    {
+	      if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+	      if ( recID < nrecs )
+		{
+		  char paramstr[32];
+		  cdiParamToString(param, paramstr, sizeof(paramstr));
+		  Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+		  continue;
+		}
+	    }
+	}
+      /*
+      if ( ISEC1_AvgNum )
+	{
+	  if (  taxis->numavg && warn_numavg && (taxis->numavg != ISEC1_AvgNum) )
+	    {
+	      Message("Change numavg from %d to %d not allowed!",
+		      taxis->numavg, ISEC1_AvgNum);
+	      warn_numavg = FALSE;
+	    }
+	  else
+	    {
+	      taxis->numavg = ISEC1_AvgNum;
+	    }
+	}
+      */
+      nrecs++;
+
+      if ( CDI_Debug )
+	Message("%4d %8d %4d  %8d %8d %6d", nrecs, (int)recpos, param, level1, vdate, vtime);
+
+      gribapiAddRecord(streamID, param, gh, recsize, recpos, datatype, comptype);
+
+      grib_handle_delete(gh);
+      gh = NULL;
+    }
+
+  if ( gh ) grib_handle_delete(gh);
+
+  streamptr->rtsteps = 1;
+
+  if ( nrecs == 0 ) return (CDI_EUFSTRUCT);
+
+  cdiGenVars(streamID);
+
+  if ( fcast )
+    {
+      taxisID = taxisCreate(TAXIS_RELATIVE);
+      taxis->type  = TAXIS_RELATIVE;
+      taxis->rdate = rdate;
+      taxis->rtime = rtime;
+      taxis->unit  = tunit;
+    }
+  else
+    {
+      taxisID = taxisCreate(TAXIS_ABSOLUTE);
+      taxis->type  = TAXIS_ABSOLUTE;
+    }
+
+  taxis->vdate = datetime0.date;
+  taxis->vtime = datetime0.time;
+
+  vlistID = streamInqVlist(streamID);
+  vlistDefTaxis(vlistID, taxisID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  if ( nrecords < streamptr->tsteps[0].recordSize )
+    {
+      streamptr->tsteps[0].recordSize = nrecords;
+      streamptr->tsteps[0].records =
+      (record_t *) realloc(streamptr->tsteps[0].records, nrecords*sizeof(record_t));
+    }
+
+  streamptr->tsteps[0].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[0].nrecs = nrecords;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[0].recIDs[recID] = recID;
+
+  streamptr->record->buffer     = gribbuffer;
+  streamptr->record->buffersize = buffersize;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( streamptr->ntsteps == 1 )
+    {
+      if ( taxis->vdate == 0 && taxis->vtime == 0 )
+	{
+	  streamptr->ntsteps = 0;
+	  for ( varID = 0; varID < streamptr->nvars; varID++ )
+	    {
+	      vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	    }
+	}
+    }
+#else
+  Error("GRIB_API support not compiled in!");
+#endif
+
+  return (0);
+}
+
+
+int gribapiScanTimestep2(int streamID)
+{
+  int rstatus = 0;
+#if  defined  (HAVE_LIBGRIB_API)
+  off_t recpos = 0;
+  unsigned char *gribbuffer = NULL;
+  long buffersize = 0;
+  int fileID;
+  int rtabnum = 0;
+  int rcode = 0, level1 = 0, level2 = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  // int gridID;
+  size_t readsize;
+  int nrecords, nrecs, recID, rindex;
+  long recsize = 0;
+  //  int warn_numavg = TRUE;
+  int tsteptype;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  long unzipsize;
+  compvar2_t compVar, compVar0;
+  stream_t *streamptr;
+  grib_handle *gh = NULL;
+  int leveltype;
+  int pdis = 0, pcat = 0, pnum = 0;
+  int param = 0;
+  long editionNumber;
+  long lpar;
+  int lbounds;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 1;
+
+  fileID  = streamInqFileID(streamID);
+  vlistID = streamInqVlist(streamID);
+  taxisID = vlistInqTaxis(vlistID);
+
+  gribbuffer = (unsigned char *) streamptr->record->buffer;
+  buffersize = streamptr->record->buffersize;
+
+  tsID = streamptr->rtsteps;
+  if ( tsID != 1 )
+    Error("Internal problem! unexpeceted timestep %d", tsID+1);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+  cdiCreateRecords(streamID, tsID);
+
+  nrecords = streamptr->tsteps[tsID].nallrecs;
+  streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[1].nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[1].recIDs[recID] = -1;
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID = streamptr->tsteps[0].records[recID].varID;
+      streamptr->tsteps[tsID].records[recID].position = streamptr->tsteps[0].records[recID].position;
+      streamptr->tsteps[tsID].records[recID].size     = streamptr->tsteps[0].records[recID].size;
+    }
+
+  rindex = 0;
+  while ( TRUE )
+    {
+      if ( rindex > nrecords ) break;
+
+      recsize = gribGetSize(fileID);
+      recpos  = fileGetPos(fileID);
+      if ( recsize == 0 )
+	{
+	  streamptr->ntsteps = 2;
+	  break;
+	}
+      if ( recsize > buffersize )
+	{
+	  buffersize = recsize;
+	  gribbuffer = (unsigned char *) realloc(gribbuffer, (size_t)buffersize);
+	}
+
+      readsize = recsize;
+      rstatus = gribRead(fileID, gribbuffer, &readsize);
+      if ( rstatus ) break;
+
+      if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	{
+	  unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+	  if ( (long) buffersize < unzipsize )
+	    {
+	      buffersize = unzipsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+	}
+
+      gh = grib_handle_new_from_message(NULL, (void *) gribbuffer, recsize);
+      GRIB_CHECK(grib_set_double(gh, "missingValue", cdiDefaultMissval), 0);
+
+      GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+      if ( editionNumber <= 1 )
+	{
+	  GRIB_CHECK(grib_get_long(gh, "table2Version", &lpar), 0);
+	  rtabnum = (int) lpar;
+	  GRIB_CHECK(grib_get_long(gh, "indicatorOfParameter", &lpar), 0);
+	  rcode = (int) lpar;
+
+	  param = cdiEncodeParam(rcode, rtabnum, 255);
+
+	  grib1GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	}
+      else
+	{
+	  GRIB_CHECK(grib_get_long(gh, "discipline", &lpar), 0);
+	  pdis = (int) lpar;
+
+	  GRIB_CHECK(grib_get_long(gh, "parameterCategory", &lpar), 0);
+	  pcat = (int) lpar;
+
+	  GRIB_CHECK(grib_get_long(gh, "parameterNumber", &lpar), 0);
+	  pnum = (int) lpar;
+
+	  param = cdiEncodeParam(pnum, pcat, pdis);
+
+	  grib2GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	}
+
+      gribapiGetValidityDateTime(gh, &vdate, &vtime);
+
+      if ( rindex == 0 )
+	{
+	  if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
+	    {
+	      taxis->type  = TAXIS_RELATIVE;
+	      GRIB_CHECK(grib_get_long(gh, "dataDate", &lpar), 0);
+	      taxis->rdate = (int) lpar;
+	      GRIB_CHECK(grib_get_long(gh, "dataTime", &lpar), 0);
+	      taxis->rtime = (int) lpar*100;
+	      taxis->unit  = gribapiGetTimeUnits(gh);
+	    }
+	  else
+	    {
+	      taxis->type  = TAXIS_ABSOLUTE;
+	    }
+	  taxis->vdate = vdate;
+	  taxis->vtime = vtime;
+
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	}
+
+      tsteptype = gribapiGetTsteptype(gh);
+      /*
+      if ( ISEC1_AvgNum )
+	{
+	  if (  taxis->numavg && warn_numavg &&
+		(taxis->numavg != ISEC1_AvgNum) )
+	    {
+	      warn_numavg = FALSE;
+	    }
+	  else
+	    {
+	      taxis->numavg = ISEC1_AvgNum;
+	    }
+	}
+      */
+      datetime.date  = vdate;
+      datetime.time  = vtime;
+      compVar.param  = param;
+      compVar.level1 = level1;
+      compVar.level2 = level2;
+      compVar.ltype  = leveltype;
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	  compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	  compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(compvar2_t)) == 0 ) break;
+	}
+
+      if ( recID == nrecords )
+	{
+	  char paramstr[32];
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+	  Warning("Param=%s level=%d not defined at timestep 1!", paramstr, level1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      if ( cdiInventoryMode == 1 )
+	{
+	  if ( streamptr->tsteps[tsID].records[recID].used )
+	    {
+	      break;
+	    }
+	  else
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }    
+	}
+      else
+	{
+	  if ( streamptr->tsteps[tsID].records[recID].used )
+	    {
+	      char paramstr[32];
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+
+	      if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+	      Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+	      continue;
+	    }
+	  else
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }    
+	}
+
+      if ( CDI_Debug )
+	Message("%4d %8d %4d %8d %8d %6d", rindex+1, (int)recpos, param, level1, vdate, vtime);
+
+      streamptr->tsteps[tsID].records[recID].size = recsize;
+
+      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+      compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+      compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+      compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+      if ( memcmp(&compVar0, &compVar, sizeof(compvar2_t)) != 0 )
+	{
+	  Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		  tsID, recID,
+		  streamptr->tsteps[tsID].records[recID].param, param,
+		  streamptr->tsteps[tsID].records[recID].ilevel, level1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->tsteps[1].records[recID].position = recpos;
+      varID = streamptr->tsteps[tsID].records[recID].varID;
+      /*
+      gridID = vlistInqVarGrid(vlistID, varID);
+      if ( gridInqSize(gridID) == 1 && gridInqType(gridID) == GRID_LONLAT )
+	{
+	  if ( IS_NOT_EQUAL(gridInqXval(gridID, 0),ISEC2_FirstLon*0.001) ||
+	       IS_NOT_EQUAL(gridInqYval(gridID, 0),ISEC2_FirstLat*0.001) )
+	    gridChangeType(gridID, GRID_TRAJECTORY);
+	}
+      */
+      if ( tsteptype != vlistInqVarTsteptype(vlistID, varID) )
+	vlistDefVarTsteptype(vlistID, varID, tsteptype);
+
+      grib_handle_delete(gh);
+      gh = NULL;
+
+      rindex++;
+    }
+
+  if ( gh ) grib_handle_delete(gh);
+
+  nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      if ( ! streamptr->tsteps[tsID].records[recID].used )
+	{
+	  varID = streamptr->tsteps[tsID].records[recID].varID;
+	  vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	}
+      else
+	{
+	  nrecs++;
+	}
+    }
+  streamptr->tsteps[tsID].nrecs = nrecs;
+
+  streamptr->rtsteps = 2;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  streamptr->record->buffer     = gribbuffer;
+  streamptr->record->buffersize = buffersize;
+#endif
+
+  return (rstatus);
+}
+
+
+int gribapiScanTimestep(int streamID)
+{
+  int rstatus = 0;
+#if  defined  (HAVE_LIBGRIB_API)
+  long recsize = 0;
+  off_t recpos = 0;
+  unsigned char *gribbuffer;
+  long buffersize = 0;
+  int fileID;
+  int rtabnum = 0;
+  int rcode = 0, level1 = 0, level2 = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int vrecID, recID;
+  //int warn_numavg = TRUE;
+  size_t readsize;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  int rindex, nrecs = 0;
+  long unzipsize;
+  compvar2_t compVar, compVar0;
+  stream_t *streamptr;
+  grib_handle *gh = NULL;
+  int leveltype;
+  int pdis = 0, pcat = 0, pnum = 0;
+  int param = 0;
+  long editionNumber;
+  long lpar;
+  int lbounds;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+
+  if ( CDI_Debug )
+    {
+      Message("streamID = %d", streamID);
+      Message("cts = %d", streamptr->curTsID);
+      Message("rts = %d", streamptr->rtsteps);
+      Message("nts = %d", streamptr->ntsteps);
+    }
+
+  tsID  = streamptr->rtsteps;
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->tsteps[tsID].recordSize == 0 )
+    {
+      gribbuffer = (unsigned char *) streamptr->record->buffer;
+      buffersize = streamptr->record->buffersize;
+
+      cdiCreateRecords(streamID, tsID);
+
+      nrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->tsteps[tsID].nrecs = nrecs;
+      streamptr->tsteps[tsID].recIDs = (int *) malloc(nrecs*sizeof(int));
+      for ( recID = 0; recID < nrecs; recID++ )
+	streamptr->tsteps[tsID].recIDs[recID] = streamptr->tsteps[1].recIDs[recID];
+
+      fileID = streamInqFileID(streamID);
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+      rindex = 0;
+      while ( TRUE )
+	{
+	  if ( rindex > nrecs ) break;
+
+	  recsize = gribGetSize(fileID);
+	  recpos  = fileGetPos(fileID);
+	  if ( recsize == 0 )
+	    {
+	      streamptr->ntsteps = streamptr->rtsteps + 1;
+	      break;
+	    }
+
+	  if ( rindex >= nrecs ) break;
+
+	  if ( recsize > buffersize )
+	    {
+	      buffersize = recsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+
+	  readsize = recsize;
+	  rstatus = gribRead(fileID, gribbuffer, &readsize);
+	  if ( rstatus )
+	    {
+	      Warning("Inconsistent timestep %d (GRIB record %d/%d)!", tsID+1, rindex+1,
+		      streamptr->tsteps[tsID].recordSize);
+	      break;
+	    }
+
+	  if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	    {
+	      unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+	      if ( (long) buffersize < unzipsize )
+		{
+		  buffersize = unzipsize;
+		  gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+		}
+	    }
+
+	  gh = grib_handle_new_from_message(NULL, (void *) gribbuffer, recsize);
+	  GRIB_CHECK(grib_set_double(gh, "missingValue", cdiDefaultMissval), 0);
+
+	  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+	  if ( editionNumber <= 1 )
+	    {
+	      GRIB_CHECK(grib_get_long(gh, "table2Version", &lpar), 0);
+	      rtabnum = (int) lpar;
+	      GRIB_CHECK(grib_get_long(gh, "indicatorOfParameter", &lpar), 0);
+	      rcode = (int) lpar;
+
+	      param = cdiEncodeParam(rcode, rtabnum, 255);
+
+	      grib1GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	    }
+	  else
+	    {
+	      GRIB_CHECK(grib_get_long(gh, "discipline", &lpar), 0);
+	      pdis = (int) lpar;
+
+	      GRIB_CHECK(grib_get_long(gh, "parameterCategory", &lpar), 0);
+	      pcat = (int) lpar;
+
+	      GRIB_CHECK(grib_get_long(gh, "parameterNumber", &lpar), 0);
+	      pnum = (int) lpar;
+
+	      param = cdiEncodeParam(pnum, pcat, pdis);
+
+	      grib2GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	    }
+
+	  gribapiGetValidityDateTime(gh, &vdate, &vtime);
+
+	  if ( rindex == nrecs ) break;
+
+	  if ( rindex == 0 )
+	    {
+	      taxisID = vlistInqTaxis(vlistID);
+	      if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
+		{
+		  taxis->type  = TAXIS_RELATIVE;
+		  GRIB_CHECK(grib_get_long(gh, "dataDate", &lpar), 0);
+		  taxis->rdate = (int) lpar;
+		  GRIB_CHECK(grib_get_long(gh, "dataTime", &lpar), 0);
+		  taxis->rtime = (int) lpar*100;
+		  taxis->unit  = gribapiGetTimeUnits(gh);
+		}
+	      else
+		{
+		  taxis->type  = TAXIS_ABSOLUTE;
+		}
+	      taxis->vdate = vdate;
+	      taxis->vtime = vtime;
+
+	      datetime0.date = vdate;
+	      datetime0.time = vtime;
+	    }
+	  /*
+	  if ( ISEC1_AvgNum )
+	    {
+	      if (  taxis->numavg && warn_numavg &&
+		   (taxis->numavg != ISEC1_AvgNum) )
+		{
+		  warn_numavg = FALSE;
+		}
+	      else
+		{
+		  taxis->numavg = ISEC1_AvgNum;
+		}
+	    }
+	  */
+	  datetime.date  = vdate;
+	  datetime.time  = vtime;
+	  compVar.param  = param;
+          compVar.level1 = level1;
+          compVar.level2 = level2;
+          compVar.ltype  = leveltype;
+	  for ( vrecID = 0; vrecID < nrecs; vrecID++ )
+	    {
+	      recID   = streamptr->tsteps[1].recIDs[vrecID];
+	      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	      compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	      compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	      compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(compvar2_t)) == 0 ) break;
+	    }
+
+	  if ( vrecID == nrecs )
+	    {
+	      char paramstr[32];
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+	      Warning("Param=%s level=%d not available at timestep %d!", paramstr, level1, tsID+1);
+
+	      if ( cdiInventoryMode == 1 )
+		return (CDI_EUFSTRUCT);
+	      else
+		continue;
+	    }
+
+	  if ( cdiInventoryMode == 1 )
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }
+	  else
+	    {
+	      if ( streamptr->tsteps[tsID].records[recID].used )
+		{
+		  char paramstr[32];
+		  cdiParamToString(param, paramstr, sizeof(paramstr));
+
+		  if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+		  if ( CDI_Debug )
+		    Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+
+		  continue;
+		}
+	      else
+		{
+		  streamptr->tsteps[tsID].records[recID].used = TRUE;
+		  streamptr->tsteps[tsID].recIDs[rindex] = recID;
+		}
+	    }
+
+	  if ( CDI_Debug )
+	    Message("%4d %8d %4d %8d %8d %6d", rindex+1, (int)recpos, param, level1, vdate, vtime);
+
+	  compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	  compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	  compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(compvar2_t)) != 0 )
+	    {
+	      Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		      tsID, recID,
+		      streamptr->tsteps[tsID].records[recID].param, param,
+		      streamptr->tsteps[tsID].records[recID].ilevel, level1);
+	      Error("Invalid, unsupported or inconsistent record structure");
+	    }
+
+	  streamptr->tsteps[tsID].records[recID].position = recpos;
+	  streamptr->tsteps[tsID].records[recID].size = recsize;
+
+	  if ( CDI_Debug )
+	    Message("%4d %8d %4d %8d %8d %6d", rindex, (int)recpos, param, level1, vdate, vtime);
+
+	  grib_handle_delete(gh);
+	  gh = NULL;
+
+	  rindex++;
+	}
+
+      if ( gh ) grib_handle_delete(gh);
+
+      for ( vrecID = 0; vrecID < nrecs; vrecID++ )
+	{
+	  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+	  if ( ! streamptr->tsteps[tsID].records[recID].used ) break;
+	}
+
+      if ( vrecID < nrecs )
+	{
+	  char paramstr[32];
+	  cdiParamToString(streamptr->tsteps[tsID].records[recID].param, paramstr, sizeof(paramstr));
+	  Warning("Param %d level %d not found at timestep %d!",
+		  paramstr, streamptr->tsteps[tsID].records[recID].ilevel, tsID+1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->rtsteps++;
+
+      if ( streamptr->ntsteps != streamptr->rtsteps )
+	{
+	  tsID = tstepsNewEntry(streamID);
+	  if ( tsID != streamptr->rtsteps )
+	    Error("Internal error. tsID = %d", tsID);
+
+	  streamptr->tsteps[tsID-1].next   = 1;
+	  streamptr->tsteps[tsID].position = recpos;
+	}
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+      streamptr->tsteps[tsID].position = recpos;
+
+      streamptr->record->buffer     = gribbuffer;
+      streamptr->record->buffersize = buffersize;
+    }
+
+  if ( nrecs > 0 && nrecs < streamptr->tsteps[tsID].nrecs )
+    {
+      Warning("Incomplete timestep. Stop scanning at timestep %d.", tsID);
+      streamptr->ntsteps = tsID;
+    }
+
+  rstatus = streamptr->ntsteps;
+#else
+  Error("GRIB_API support not compiled in!");
+#endif
+
+  return (rstatus);
+}
+
+
+int gribapiDecode(unsigned char *gribbuffer, int gribsize, double *data, int gridsize,
+		  int unreduced, int *nmiss, int *zip, double missval)
+{
+  int status = 0;
+#if  defined  (HAVE_LIBGRIB_API)
+  long lpar;
+  long editionNumber, numberOfPoints;
+  size_t datasize, dummy, recsize;
+  grib_handle *gh = NULL;
+
+  if ( unreduced )
+    {
+      static int lwarn = 1;
+
+      if ( lwarn )
+	{
+	  lwarn = 0;
+	  Warning("Conversion of gaussian reduced grids unsupported!");
+	}
+    }
+
+  recsize = gribsize;
+  gh = grib_handle_new_from_message(NULL, (void *) gribbuffer, recsize);
+  GRIB_CHECK(grib_set_double(gh, "missingValue", missval), 0);
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  /* get the size of the values array*/
+  GRIB_CHECK(grib_get_size(gh, "values", &datasize), 0);
+  GRIB_CHECK(grib_get_long(gh, "numberOfPoints", &numberOfPoints), 0);
+
+  // printf("values_size = %d  numberOfPoints = %ld\n", datasize, numberOfPoints);
+
+  if ( gridsize != (int) datasize )
+    Error("Internal problem: gridsize(%d) != datasize(%d)!", gridsize, datasize);
+  dummy = datasize;
+  GRIB_CHECK(grib_get_double_array(gh, "values", data, &dummy), 0);
+
+  int gridtype;
+  GRIB_CHECK(grib_get_long(gh, "gridDefinitionTemplateNumber", &lpar), 0);
+  gridtype = (int) lpar;
+
+  *nmiss = 0;
+  if ( gridtype < 50 || gridtype > 53 )
+    {
+      GRIB_CHECK(grib_get_long(gh, "numberOfMissing", &lpar), 0);
+      *nmiss = (int) lpar;
+      // printf("gridtype %d, nmiss %d\n", gridtype, nmiss);
+    }
+
+  grib_handle_delete(gh);
+
+#else
+  Error("GRIB_API support not compiled in!");
+#endif
+
+  return (status);
+}
+
+#if  defined  (HAVE_LIBGRIB_API)
+static
+void gribapiDefInstitut(grib_handle *gh, int vlistID, int varID)
+{
+  int instID;
+
+  if ( vlistInqInstitut(vlistID) != CDI_UNDEFID )
+    instID = vlistInqInstitut(vlistID);
+  else
+    instID = vlistInqVarInstitut(vlistID, varID);
+
+  if ( instID != CDI_UNDEFID )
+    {
+      long center, subcenter;
+      long center0, subcenter0;
+
+      center    = institutInqCenter(instID);
+      subcenter = institutInqSubcenter(instID);
+
+      GRIB_CHECK(grib_get_long(gh, "centre", &center0), 0);
+      GRIB_CHECK(grib_get_long(gh, "subCentre", &subcenter0), 0);
+
+      if ( center != center0 )
+	GRIB_CHECK(grib_set_long(gh, "centre", center), 0);
+      if ( subcenter != subcenter0 )
+	GRIB_CHECK(grib_set_long(gh, "subCentre", subcenter), 0);
+    }
+}
+
+static
+void gribapiDefModel(grib_handle *gh, int vlistID, int varID)
+{
+  int modelID;
+
+  if ( vlistInqModel(vlistID) != CDI_UNDEFID )
+    modelID = vlistInqModel(vlistID);
+  else
+    modelID = vlistInqVarModel(vlistID, varID);
+
+  if ( modelID != CDI_UNDEFID )
+    GRIB_CHECK(grib_set_long(gh, "generatingProcessIdentifier", modelInqGribID(modelID)), 0);
+}
+
+static
+void gribapiDefParam(int editionNumber, grib_handle *gh, int param, const char *name)
+{
+  int pdis, pcat, pnum;
+
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+
+  if ( pnum < 0 )
+    {
+      size_t len;
+      int status;
+      len = strlen(name);
+      status = grib_set_string(gh, "shortName", name, &len);
+      if ( status != 0 )
+	Warning("grib_api: No match for shortName=%s", name);
+    }
+  else
+    {
+      if ( pnum < 0 ) pnum = -pnum;
+
+      if ( editionNumber <= 1 )
+	{
+	  if ( pdis != 255 )
+	    {
+	      char paramstr[32];
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+	      Warning("Can't convert GRIB2 parameter ID (%s) to GRIB1, set to %d.%d!", paramstr, pnum, pcat);
+	    }
+
+	  GRIB_CHECK(grib_set_long(gh, "table2Version",        pcat), 0);
+	  GRIB_CHECK(grib_set_long(gh, "indicatorOfParameter", pnum), 0);
+	}
+      else
+	{
+	  GRIB_CHECK(grib_set_long(gh, "discipline",        pdis), 0);
+	  GRIB_CHECK(grib_set_long(gh, "parameterCategory", pcat), 0);
+	  GRIB_CHECK(grib_set_long(gh, "parameterNumber",   pnum), 0);
+	}
+    }
+
+  // printf("param: %d.%d.%d %s\n", pnum, pcat, pdis, name);
+}
+
+static
+int gribapiDefStepUnits(grib_handle *gh, int timeunit, int gcinit)
+{
+  int factor = 1;
+  long unitsOfTime;
+  char stepunits[8];
+  size_t len;
+
+  switch (timeunit)
+    {
+    case TUNIT_SECOND:  factor =     1;  unitsOfTime = 13;  strcpy(stepunits, "s");   break;
+    case TUNIT_MINUTE:  factor =    60;  unitsOfTime =  0;  strcpy(stepunits, "m");   break;
+    case TUNIT_HOUR:    factor =  3600;  unitsOfTime =  1;  strcpy(stepunits, "h");   break;
+    case TUNIT_3HOURS:  factor = 10800;  unitsOfTime = 10;  strcpy(stepunits, "3h");  break;
+    case TUNIT_6HOURS:  factor = 21600;  unitsOfTime = 11;  strcpy(stepunits, "6h");  break;
+    case TUNIT_12HOURS: factor = 43200;  unitsOfTime = 12;  strcpy(stepunits, "12h"); break;
+    case TUNIT_DAY:     factor = 86400;  unitsOfTime =  2;  strcpy(stepunits, "D");   break;
+    default:            factor =  3600;  unitsOfTime =  1;  strcpy(stepunits, "h");   break;
+    }
+
+  if ( !gcinit )
+    {
+      len = strlen(stepunits) + 1;
+      GRIB_CHECK(grib_set_long(gh, "indicatorOfUnitOfTimeRange", unitsOfTime), 0);
+      GRIB_CHECK(grib_set_string(gh, "stepUnits", stepunits, &len), 0);
+    }
+
+  return (factor);
+}
+
+static
+int gribapiDefSteptype(int editionNumber, grib_handle *gh, int tsteptype, int gcinit)
+{
+  long proDefTempNum = 0;
+  size_t len = 64;
+  char stepType[64];
+
+  switch ( tsteptype )
+    {
+    case TSTEP_AVG:      strcpy(stepType, "avg");     proDefTempNum = 8; break;
+    case TSTEP_ACCUM:    strcpy(stepType, "accum");   proDefTempNum = 8; break;
+    case TSTEP_MAX:      strcpy(stepType, "max");     proDefTempNum = 8; break;
+    case TSTEP_MIN:      strcpy(stepType, "min");     proDefTempNum = 8; break;
+    case TSTEP_DIFF:     strcpy(stepType, "diff");    proDefTempNum = 8; break;
+    case TSTEP_RMS:      strcpy(stepType, "rms");     proDefTempNum = 8; break;
+    case TSTEP_SD:       strcpy(stepType, "sd");      proDefTempNum = 8; break;
+    case TSTEP_COV:      strcpy(stepType, "cov");     proDefTempNum = 8; break;
+    case TSTEP_RATIO:    strcpy(stepType, "ratio");   proDefTempNum = 8; break;
+    case TSTEP_INSTANT:  strcpy(stepType, "instant"); proDefTempNum = 0; break;
+    default:             strcpy(stepType, "instant"); proDefTempNum = 0; break;
+    }
+
+  if ( !gcinit )
+    {
+      if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "productDefinitionTemplateNumber", proDefTempNum), 0);
+      len = strlen(stepType);
+      GRIB_CHECK(grib_set_string(gh, "stepType", stepType, &len), 0);
+    }
+
+  return ((int)proDefTempNum);
+}
+
+static
+void gribapiDefDateTimeAbs(int editionNumber, grib_handle *gh, int date, int time, int tsteptype, int gcinit)
+{
+  if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "significanceOfReferenceTime", 0), 0);
+  if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "stepRange", 0), 0);
+
+  if ( date == 0 ) date = 10101;
+  GRIB_CHECK(grib_set_long(gh, "dataDate", date), 0);
+  GRIB_CHECK(grib_set_long(gh, "dataTime", time/100), 0);
+
+  (void ) gribapiDefSteptype(editionNumber, gh, tsteptype, gcinit);
+}
+
+static
+int gribapiDefDateTimeRel(int editionNumber, grib_handle *gh, int rdate, int rtime, int vdate, int vtime,
+                          int tsteptype, int factor, int calendar, int gcinit)
+{
+  int status = -1;
+  int year, month, day, hour, minute, second;
+  int julday1, secofday1, julday2, secofday2, days, secs;
+  long startStep = 0, endStep;
+  long proDefTempNum = 0;
+
+  cdiDecodeDate(rdate, &year, &month, &day);
+  cdiDecodeTime(rtime, &hour, &minute, &second);
+  encode_juldaysec(calendar, year, month, day, hour, minute, &julday1, &secofday1);
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+  encode_juldaysec(calendar, year, month, day, hour, minute, &julday2, &secofday2);
+
+  (void) julday_sub(julday1, secofday1, julday2, secofday2, &days, &secs);
+
+  if ( !(int) fmod(days*86400.0 + secs, factor) )
+    {
+      endStep = (int) ((days*86400.0 + secs)/factor);
+
+      if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "significanceOfReferenceTime", 1), 0);
+      if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "stepRange", 0), 0);
+
+      if ( rdate == 0 ) rdate = 10101;
+      GRIB_CHECK(grib_set_long(gh, "dataDate", rdate), 0);
+      GRIB_CHECK(grib_set_long(gh, "dataTime", rtime/100), 0);
+
+      // printf(">>>>> tsteptype %d  startStep %d  endStep %d\n", tsteptype, startStep, endStep);
+
+      proDefTempNum = gribapiDefSteptype(editionNumber, gh, tsteptype, gcinit);
+
+      if ( proDefTempNum == 0 ) startStep = endStep;
+
+      if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "forecastTime", startStep), 0);
+      GRIB_CHECK(grib_set_long(gh, "endStep", endStep), 0);
+
+      status = 0;
+    }
+
+  return (status);
+}
+
+static
+void gribapiDefTime(int editionNumber, grib_handle *gh , int vdate, int vtime, int tsteptype, int numavg, int taxisID, int gcinit)
+{
+  int taxistype = -1;
+  int timeunit;
+  int factor;
+
+  if ( taxisID != -1 ) taxistype = taxisInqType(taxisID);
+
+  timeunit = taxisInqTunit(taxisID);
+
+  factor = gribapiDefStepUnits(gh, timeunit, gcinit);
+
+  if ( taxistype == TAXIS_RELATIVE )
+    {
+      int status;
+      int calendar = taxisInqCalendar(taxisID);
+      int rdate    = taxisInqRdate(taxisID);
+      int rtime    = taxisInqRtime(taxisID);
+
+      status = gribapiDefDateTimeRel(editionNumber, gh, rdate, rtime, vdate, vtime,
+                                     tsteptype, factor, calendar, gcinit);
+
+      if ( status != 0 ) taxistype = TAXIS_ABSOLUTE;
+    }
+
+  if ( taxistype == TAXIS_ABSOLUTE )
+    {
+      gribapiDefDateTimeAbs(editionNumber, gh, vdate, vtime, tsteptype, gcinit);
+    }
+}
+
+static
+void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int ljpeg, int lieee, int datatype, int nmiss, int gcinit)
+{
+  int gridtype;
+  int status;
+  char uuid[17];
+  static short lwarn = TRUE;
+  size_t len;
+  char *mesg;
+
+  gridtype = gridInqType(gridID);
+
+  if ( editionNumber <= 1 )
+    if ( gridtype == GRID_GME || gridtype == GRID_REFERENCE )
+      gridtype = -1;
+
+  if ( gridtype == GRID_GENERIC )
+    {
+      int xsize, ysize, gridsize;
+
+      gridsize = gridInqSize(gridID);
+      xsize = gridInqXsize(gridID);
+      ysize = gridInqYsize(gridID);
+
+      if ( (ysize ==  32 || ysize ==  48 || ysize ==  64 ||
+	    ysize ==  96 || ysize == 160 || ysize == 192 ||
+	    ysize == 240 || ysize == 320 || ysize == 384 ||
+	    ysize == 480 || ysize == 768 ) &&
+	   (xsize == 2*ysize || xsize == 1) )
+	{
+	  gridtype = GRID_GAUSSIAN;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( gridsize == 1 )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( gridInqXvals(gridID, NULL) && gridInqYvals(gridID, NULL) )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+    }
+  else if ( gridtype == GRID_CURVILINEAR )
+    {
+      if ( lwarn && gridInqSize(gridID) > 1 )
+	{
+	  lwarn = FALSE;
+	  Warning("Curvilinear grids are unsupported in GRIB format! Created wrong GDS!");
+	}
+      gridtype = GRID_LONLAT;
+    }
+
+
+  if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN )
+    {
+      if ( editionNumber != 2 || lieee ) { ljpeg = 0; }
+
+      if ( ljpeg )
+        {
+          if ( nmiss > 0 ) ljpeg = 0;
+
+          if ( ljpeg )
+            {
+              mesg = "grid_jpeg"; len = strlen(mesg);
+              GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+            }
+          else
+            {
+              mesg = "grid_simple"; len = strlen(mesg);
+              GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+            }
+        }
+    }
+
+  if ( gcinit ) return;
+
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_GAUSSIAN_REDUCED:
+    case GRID_TRAJECTORY:
+      {
+	int nlon = 0, nlat;
+	double xfirst = 0, xlast = 0, xinc = 0;
+	double yfirst = 0, ylast = 0, yinc = 0;
+	double latIncr;
+
+	if ( gridtype == GRID_GAUSSIAN )
+	  {
+	    mesg = "regular_gg"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "gridType", mesg, &len), 0);
+	  }
+	else if ( gridtype == GRID_GAUSSIAN_REDUCED )
+	  {
+	    mesg = "reduced_gg"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "gridType", mesg, &len), 0);
+	  }
+	else if ( gridtype == GRID_LONLAT && gridIsRotated(gridID) )
+	  {
+	    mesg = "rotated_ll"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "gridType", mesg, &len), 0);
+	  }
+	else
+	  {
+	    mesg = "regular_ll"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "gridType", mesg, &len), 0);
+	  }
+
+	nlon = gridInqXsize(gridID);
+	nlat = gridInqYsize(gridID);
+
+	if ( gridtype == GRID_GAUSSIAN_REDUCED )
+	  {
+	    int *rowlon, i;
+	    long *pl = NULL;
+
+	    nlon = 0;
+
+	    rowlon = (int *) malloc(nlat*sizeof(int));
+	    pl     = (long *) malloc(nlat*sizeof(long));
+	    gridInqRowlon(gridID, rowlon);
+	    for ( i = 0; i < nlat; ++i ) pl[i] = rowlon[i];
+
+	    // GRIB_CHECK(grib_set_long_array(gh, "pl", pl, nlat), 0);
+
+	    free(pl);
+	    free(rowlon);
+	  }
+	else
+	  {
+	    if ( nlon == 0 )
+	      {
+		nlon = 1;
+	      }
+	    else
+	      {
+		xfirst = gridInqXval(gridID,      0);
+		xlast  = gridInqXval(gridID, nlon-1);
+		xinc   = gridInqXinc(gridID);
+	      }
+	  }
+
+	if ( nlat == 0 )
+	  {
+	    nlat = 1;
+	  }
+	else
+	  {
+	    yfirst = gridInqYval(gridID,      0);
+	    ylast  = gridInqYval(gridID, nlat-1);
+	    yinc   = gridInqYinc(gridID);
+	  }
+
+	GRIB_CHECK(grib_set_long(gh, "Ni", nlon), 0);
+	GRIB_CHECK(grib_set_long(gh, "Nj", nlat), 0);
+	GRIB_CHECK(grib_set_double(gh, "longitudeOfFirstGridPointInDegrees", xfirst), 0);
+	GRIB_CHECK(grib_set_double(gh, "longitudeOfLastGridPointInDegrees",  xlast), 0);
+	GRIB_CHECK(grib_set_double(gh, "latitudeOfFirstGridPointInDegrees",  yfirst), 0);
+	GRIB_CHECK(grib_set_double(gh, "latitudeOfLastGridPointInDegrees",   ylast), 0);
+	GRIB_CHECK(grib_set_double(gh, "iDirectionIncrementInDegrees", xinc), 0);
+
+        {
+          long jscan = 0;
+          if ( yfirst < ylast ) jscan = 1;
+          GRIB_CHECK(grib_set_long(gh, "jScansPositively", jscan), 0);
+        }
+	/*
+	if ( fabs(xinc*1000 - ISEC2_LonIncr) > FLT_EPSILON )
+	  ISEC2_LonIncr = 0;
+	*/
+	if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
+          {
+            int np = gridInqNP(gridID);
+            if ( np == 0 ) np = nlat/2;
+            GRIB_CHECK(grib_set_long(gh, "numberOfParallelsBetweenAPoleAndTheEquator", np), 0);
+          }
+	else
+	  {
+	    latIncr = yinc;
+	    if ( latIncr < 0 ) latIncr = -latIncr;
+	    GRIB_CHECK(grib_set_double(gh, "jDirectionIncrementInDegrees", latIncr), 0);
+	    /*
+	    if ( fabs(yinc*1000 - ISEC2_LatIncr) > FLT_EPSILON )
+	      ISEC2_LatIncr = 0;
+	    */
+	  }
+	/*
+	if ( ISEC2_NumLon > 1 && ISEC2_NumLat == 1 ) 
+	  if ( ISEC2_LonIncr != 0 && ISEC2_LatIncr == 0 ) ISEC2_LatIncr = ISEC2_LonIncr;
+
+	if ( ISEC2_NumLon == 1 && ISEC2_NumLat > 1 ) 
+	  if ( ISEC2_LonIncr == 0 && ISEC2_LatIncr != 0 ) ISEC2_LonIncr = ISEC2_LatIncr;
+
+	if ( ISEC2_LatIncr == 0 || ISEC2_LonIncr == 0 )
+	  ISEC2_ResFlag = 0;
+	else
+	  ISEC2_ResFlag = 128;
+	*/
+	if ( gridIsRotated(gridID) )
+	  {
+	    double xpole, ypole, angle;
+	    xpole = gridInqXpole(gridID);
+	    ypole = gridInqYpole(gridID);
+	    angle = gridInqAngle(gridID);
+	    /* change from noth to south pole */
+	    ypole = -ypole;
+	    xpole =  xpole + 180;
+	    GRIB_CHECK(grib_set_double(gh, "latitudeOfSouthernPoleInDegrees",  ypole), 0);
+	    GRIB_CHECK(grib_set_double(gh, "longitudeOfSouthernPoleInDegrees", xpole), 0);
+	    GRIB_CHECK(grib_set_double(gh, "angleOfRotation", angle), 0);
+	  }
+
+	/* East -> West */
+	//if ( ISEC2_LastLon < ISEC2_FirstLon ) ISEC2_ScanFlag += 128;
+
+	/* South -> North */
+	//if ( ISEC2_LastLat > ISEC2_FirstLat ) ISEC2_ScanFlag += 64;
+
+        if ( editionNumber != 2 ) { lieee = 0; ljpeg = 0; }
+
+        if ( lieee )
+          {
+            mesg = "grid_ieee"; len = strlen(mesg);
+            GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+
+	    if ( datatype == DATATYPE_FLT64 )
+	      GRIB_CHECK(grib_set_long(gh, "precision", 2), 0);
+	    else
+	      GRIB_CHECK(grib_set_long(gh, "precision", 1), 0);
+          }
+        else if ( ljpeg )
+	  {
+            if ( nmiss > 0 ) ljpeg = 0;
+
+            if ( ljpeg )
+              {
+                mesg = "grid_jpeg"; len = strlen(mesg);
+                GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+              }
+            else
+              {
+                mesg = "grid_simple"; len = strlen(mesg);
+                GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+              }
+	  }
+	else
+	  {
+	    mesg = "grid_simple"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+	  }
+
+	break;
+      }
+      /*
+    case GRID_LCC:
+      {
+	double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
+	int xsize, ysize;
+	int projflag, scanflag;
+
+	xsize = gridInqXsize(gridID);
+	ysize = gridInqYsize(gridID);
+
+	gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm,
+		   &projflag, &scanflag);
+
+	ISEC2_GridType = GRIB2_GTYPE_LCC;
+	ISEC2_NumLon   = xsize;
+	ISEC2_NumLat   = ysize;
+	ISEC2_FirstLon = NINT(originLon * 1000);
+	ISEC2_FirstLat = NINT(originLat * 1000);
+	ISEC2_Lambert_Lov    = NINT(lonParY * 1000);
+	ISEC2_Lambert_LatS1  = NINT(lat1 * 1000);
+	ISEC2_Lambert_LatS2  = NINT(lat2 * 1000);
+	ISEC2_Lambert_dx     = NINT(xincm);
+	ISEC2_Lambert_dy     = NINT(yincm);
+	ISEC2_Lambert_LatSP  = 0;
+	ISEC2_Lambert_LatSP  = 0;
+	ISEC2_Lambert_ProjFlag = projflag;
+	ISEC2_ScanFlag = scanflag;
+
+	break;
+      }
+      */
+    case GRID_SPECTRAL:
+      {
+	int trunc = gridInqTrunc(gridID);
+
+	mesg = "sh"; len = strlen(mesg);
+	GRIB_CHECK(grib_set_string(gh, "gridType", mesg, &len), 0);
+
+	GRIB_CHECK(grib_set_long(gh, "J", trunc), 0);
+	GRIB_CHECK(grib_set_long(gh, "K", trunc), 0);
+	GRIB_CHECK(grib_set_long(gh, "M", trunc), 0);
+
+	// GRIB_CHECK(grib_set_long(gh, "numberOfDataPoints", gridInqSize(gridID)), 0);
+        /*
+        if ( lieee )
+          {
+            printf("spectral_ieee\n");
+            if ( editionNumber == 2 ) GRIB_CHECK(grib_set_long(gh, "numberOfValues", gridInqSize(gridID)), 0);
+            mesg = "spectral_ieee"; len = strlen(mesg);
+            GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+          }
+        else */ if ( gridInqComplexPacking(gridID) )
+	  {
+	    if ( editionNumber == 2 ) GRIB_CHECK(grib_set_long(gh, "numberOfValues", gridInqSize(gridID)), 0);
+	    mesg = "spectral_complex"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+	    /*
+	    GRIB_CHECK(grib_set_long(gh, "JS", 20), 0);
+	    GRIB_CHECK(grib_set_long(gh, "KS", 20), 0);
+	    GRIB_CHECK(grib_set_long(gh, "MS", 20), 0);
+	    */
+	  }
+	else
+	  {
+	    mesg = "spectral_simple"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+	  }
+
+	break;
+      }
+    case GRID_GME:
+      {
+	GRIB_CHECK(grib_set_long(gh, "gridDefinitionTemplateNumber", GRIB2_GTYPE_GME), 0);
+
+	GRIB_CHECK(grib_set_long(gh, "nd", gridInqGMEnd(gridID)), 0);
+	GRIB_CHECK(grib_set_long(gh, "Ni", gridInqGMEni(gridID)), 0);
+	GRIB_CHECK(grib_set_long(gh, "n2", gridInqGMEni2(gridID)), 0);
+	GRIB_CHECK(grib_set_long(gh, "n3", gridInqGMEni3(gridID)), 0);
+	GRIB_CHECK(grib_set_long(gh, "latitudeOfThePolePoint", 90000), 0);
+	GRIB_CHECK(grib_set_long(gh, "longitudeOfThePolePoint", 0), 0);
+
+	GRIB_CHECK(grib_set_long(gh, "numberOfDataPoints", gridInqSize(gridID)), 0);
+	GRIB_CHECK(grib_set_long(gh, "totalNumberOfGridPoints", gridInqSize(gridID)), 0);
+
+	break;
+      }
+    case GRID_REFERENCE:
+      {
+	static int warning = 1;
+	status = grib_set_long(gh, "gridDefinitionTemplateNumber", GRIB2_GTYPE_NUMBER);
+	if ( status != 0 && warning )
+	  {
+	    warning = 0;
+	    Warning("Can't write reference grid!");
+	    Warning("gridDefinitionTemplateNumber %d not found (grib2/template.3.%d.def)!",
+		    GRIB2_GTYPE_NUMBER, GRIB2_GTYPE_NUMBER);
+	  }
+	else
+	  {
+	    GRIB_CHECK(grib_set_long(gh, "numberOfGridUsed", gridInqNumber(gridID)), 0);
+	    GRIB_CHECK(grib_set_long(gh, "numberOfGridInReference", gridInqPosition(gridID)), 0);
+            len = 16;
+            GRIB_CHECK(grib_set_string(gh, "uuidOfHGrid", gridInqUUID(gridID, uuid), &len), 0);
+	  }
+
+	break;
+      }
+    default:
+      {
+	Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+      }
+    }
+}
+
+static
+void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID, int levelID, int gcinit)
+{
+  double level;
+  int zaxistype, ltype;
+  static int warning = 1;
+  int reference;
+  char uuid[17];
+  size_t len;
+
+  zaxistype = zaxisInqType(zaxisID);
+  ltype = zaxisInqLtype(zaxisID);
+  level = zaxisInqLevel(zaxisID, levelID);
+
+  if ( zaxistype == ZAXIS_GENERIC && ltype == 0 )
+    {
+      Message("Changed zaxis type from %s to %s",
+	      zaxisNamePtr(zaxistype),
+	      zaxisNamePtr(ZAXIS_PRESSURE));
+      zaxistype = ZAXIS_PRESSURE;
+      zaxisChangeType(zaxisID, zaxistype);
+      zaxisDefUnits(zaxisID, "Pa");
+    }
+
+  switch (zaxistype)
+    {
+    case ZAXIS_SURFACE:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_SURFACE), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_SURFACE), 0);
+          }
+
+        GRIB_CHECK(grib_set_long(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_TOA:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_TOA), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_TOA), 0);
+          }
+
+        break;
+      }
+    case ZAXIS_SEA_BOTTOM:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_SEA_BOTTOM), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_SEA_BOTTOM), 0);
+          }
+
+        break;
+      }
+    case ZAXIS_ATMOSPHERE:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_ATMOSPHERE), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_ATMOSPHERE), 0);
+          }
+
+        break;
+      }
+    case ZAXIS_MEANSEA:
+      {
+	if ( editionNumber <= 1 )
+	  {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_MEANSEA), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_MEANSEA), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_HYBRID:
+    case ZAXIS_HYBRID_HALF:
+      {
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+	    long level1, level2;
+
+	    if ( editionNumber <= 1 )
+	      {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_HYBRID_LAYER), 0);
+              }
+            else
+	      {
+		if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_HYBRID), 0);
+		if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfSecondFixedSurface", GRIB2_LTYPE_HYBRID), 0);
+	      }
+
+	    level1 = zaxisInqLbound(zaxisID, levelID);
+	    level2 = zaxisInqUbound(zaxisID, levelID);
+
+	    GRIB_CHECK(grib_set_long(gh, "topLevel", level1), 0);
+	    GRIB_CHECK(grib_set_long(gh, "bottomLevel", level2), 0);
+	  }
+	else
+	  {
+	    if ( editionNumber <= 1 )
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_HYBRID), 0);
+              }
+            else
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_HYBRID), 0);
+              }
+
+	    GRIB_CHECK(grib_set_long(gh, "level", level), 0);
+	  }
+
+        if ( !gcinit )
+          {
+            int vctsize = zaxisInqVctSize(zaxisID);
+            if ( vctsize == 0 && warning )
+              {
+                char paramstr[32];
+                cdiParamToString(param, paramstr, sizeof(paramstr));
+                Warning("VCT missing ( param = %s, zaxisID = %d )", paramstr, zaxisID);
+                warning = 0;
+              }
+            GRIB_CHECK(grib_set_long(gh, "PVPresent", 1), 0);
+            GRIB_CHECK(grib_set_double_array(gh, "pv", zaxisInqVctPtr(zaxisID), vctsize), 0);
+          }
+
+	break;
+      }
+    case ZAXIS_PRESSURE:
+      {
+	double dum;
+	char units[128];
+
+	if ( level < 0 ) Warning("Pressure level of %f Pa is below zero!", level);
+
+	zaxisInqUnits(zaxisID, units);
+	if ( memcmp(units, "Pa", 2) != 0 ) level *= 100;
+
+	if ( level < 32768 && (level < 100 || modf(level/100, &dum) > 0) )
+	  {
+	    if ( editionNumber <= 1 )
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_99), 0);
+              }
+            else
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB1_LTYPE_99), 0);
+              }
+
+	    GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+	  }
+	else
+	  {
+	    if ( editionNumber <= 1 )
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_ISOBARIC), 0);
+              }
+            else
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_ISOBARIC), 0);
+              }
+            //GRIB_CHECK(grib_set_double(gh, "scaledValueOfFirstFixedSurface", level), 0);
+	    GRIB_CHECK(grib_set_double(gh, "level", level/100), 0);
+	  }
+
+	break;
+      }
+    case ZAXIS_HEIGHT:
+      {
+        if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_HEIGHT), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_HEIGHT), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_ALTITUDE:
+      {
+        if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_ALTITUDE), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_ALTITUDE), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_SIGMA:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_SIGMA), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_SIGMA), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_LAND:
+      {
+	char units[128];
+
+	zaxisInqUnits(zaxisID, units);
+
+	if ( editionNumber <= 1 )
+	  {
+	    double factor;
+	    if      ( memcmp(units, "mm", 2) == 0 ) factor =   0.1;
+	    else if ( memcmp(units, "cm", 2) == 0 ) factor =   1;
+	    else if ( memcmp(units, "dm", 2) == 0 ) factor =  10;
+	    else                                    factor = 100; // meter
+
+	    if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_LANDDEPTH), 0);
+	    GRIB_CHECK(grib_set_double(gh, "level", level*factor), 0);
+	  }
+	else
+	  {
+	    long factor;
+	    if      ( memcmp(units, "mm", 2) == 0 ) factor = 3;
+	    else if ( memcmp(units, "cm", 2) == 0 ) factor = 2;
+	    else if ( memcmp(units, "dm", 2) == 0 ) factor = 1;
+	    else                                    factor = 0; // meter
+
+	    if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	      {
+		double level1, level2;
+		level1 = zaxisInqLbound(zaxisID, levelID);
+		level2 = zaxisInqUbound(zaxisID, levelID);
+
+		if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_LANDDEPTH), 0);
+		GRIB_CHECK(grib_set_long(gh, "scaleFactorOfFirstFixedSurface", factor), 0);
+		GRIB_CHECK(grib_set_double(gh, "scaledValueOfFirstFixedSurface", level1), 0);
+		if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfSecondFixedSurface", GRIB2_LTYPE_LANDDEPTH), 0);
+		GRIB_CHECK(grib_set_long(gh, "scaleFactorOfSecondFixedSurface", factor), 0);
+		GRIB_CHECK(grib_set_double(gh, "scaledValueOfSecondFixedSurface", level2), 0);
+	      }
+	    else
+	      {
+		if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_LANDDEPTH), 0);
+		GRIB_CHECK(grib_set_long(gh, "scaleFactorOfFirstFixedSurface", factor), 0);
+	       	GRIB_CHECK(grib_set_double(gh, "scaledValueOfFirstFixedSurface", level), 0);
+	      }
+	  }
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_SEA:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_SEADEPTH), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_SEADEPTH), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_ISENTROPIC:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_ISENTROPIC), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_ISENTROPIC), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_REFERENCE:
+      {
+        if ( editionNumber <= 1 )
+          ; // not available
+        else
+          {
+            reference = zaxisInqReference(zaxisID);
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_REFERENCE), 0);
+            GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+            GRIB_CHECK(grib_set_long(gh, "NV", 3), 0);
+            GRIB_CHECK(grib_set_long(gh, "nlev", (long) zaxisInqSize(zaxisID)), 0);
+            GRIB_CHECK(grib_set_long(gh, "numberOfVGridUsed", reference), 0);
+            len = 16;
+            GRIB_CHECK(grib_set_string(gh, "uuidOfVGrid", zaxisInqUUID(zaxisID, uuid), &len), 0);
+          }
+
+        break;
+      }
+    case ZAXIS_GENERIC:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", ltype), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", ltype), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    default:
+      {
+	Error("Unsupported zaxis type: %s", zaxisNamePtr(zaxistype));
+	break;
+      }
+    }
+}
+#endif
+
+void *gribHandleNew(int editionNumber)
+{
+  void *gh = NULL;
+
+#if  defined  (HAVE_LIBGRIB_API)
+  if ( editionNumber == 1 )
+    gh = (void *) grib_handle_new_from_samples(NULL, "GRIB1");
+  else
+    gh = (void *) grib_handle_new_from_samples(NULL, "GRIB2");
+
+  if ( gh == NULL ) Error("grib_handle_new_from_samples failed!");
+#endif
+
+  return (gh);
+}
+
+
+void gribHandleDelete(void *gh)
+{
+#if  defined  (HAVE_LIBGRIB_API)
+  grib_handle_delete(gh);
+#endif
+}
+
+/* #define GRIBAPIENCODETEST 1 */
+
+size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisID,
+		     int vdate, int vtime, int tsteptype, int numavg, 
+		     long datasize, const double *data, int nmiss, unsigned char **gribbuffer, size_t *gribbuffersize,
+		     int ljpeg, void *gribContainer)
+{
+  size_t nbytes = 0;
+#if  defined  (HAVE_LIBGRIB_API)
+  size_t recsize = 0;
+  void *dummy = NULL;
+  int datatype;
+  int param;
+  int lieee = FALSE;
+  int ensID, ensCount, forecast_type; /* Ensemble Data */
+  long bitsPerValue;
+  long editionNumber = 2;
+  char name[256];
+  grib_handle *gh = NULL;
+  gribContainer_t *gc = (gribContainer_t *) gribContainer;
+  // extern unsigned char _grib_template_GRIB2[];
+
+  param    = vlistInqVarParam(vlistID, varID);
+  datatype = vlistInqVarDatatype(vlistID, varID);
+  vlistInqVarName(vlistID, varID, name);
+
+#if defined(GRIBAPIENCODETEST)
+  gh = (grib_handle *) gribHandleNew(editionNumber);
+#else
+  gh = gc->gribHandle;
+#endif
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  if ( ! gc->init ) gribapiDefInstitut(gh, vlistID, varID);
+  if ( ! gc->init ) gribapiDefModel(gh, vlistID, varID);
+
+  if ( ! gc->init ) gribapiDefParam(editionNumber, gh, param, name);
+  /*
+  if( vlistInqVarEnsemble( vlistID,  varID, &ensID, &ensCount, &forecast_type ) )
+    {
+      GRIB_CHECK(grib_set_long(gh, "typeOfEnsembleForecast", forecast_type ), 0);
+      GRIB_CHECK(grib_set_long(gh, "numberOfForecastsInEnsemble", ensCount ), 0);
+      GRIB_CHECK(grib_set_long(gh, "perturbationNumber", ensID ), 0);
+    }
+  */
+  gribapiDefTime(editionNumber, gh, vdate, vtime, tsteptype, numavg, vlistInqTaxis(vlistID), gc->init);
+
+  if ( editionNumber == 2 && (datatype == DATATYPE_FLT32 || datatype == DATATYPE_FLT64) ) lieee = TRUE;
+
+  /* bitsPerValue have to be defined before call to DefGrid (complex packing) */
+  //  if ( lieee == FALSE )
+    {
+      bitsPerValue = grbBitsPerValue(datatype);
+      GRIB_CHECK(grib_set_long(gh, "bitsPerValue", bitsPerValue), 0);
+    }
+
+  gribapiDefGrid(editionNumber, gh, gridID, ljpeg, lieee, datatype, nmiss, gc->init);
+
+  gribapiDefLevel(editionNumber, gh, param, zaxisID, levelID, gc->init);
+
+  if ( nmiss > 0 )
+    {
+      GRIB_CHECK(grib_set_long(gh, "bitmapPresent", 1), 0);
+      GRIB_CHECK(grib_set_double(gh, "missingValue", vlistInqVarMissval(vlistID, varID)), 0);
+    }
+
+  GRIB_CHECK(grib_set_double_array(gh, "values", data, datasize), 0);
+
+  /* get the size of coded message  */
+  GRIB_CHECK(grib_get_message(gh, (const void **)&dummy, &recsize), 0);
+  recsize += 512; /* add some space for possible filling */
+  *gribbuffersize = recsize;
+  *gribbuffer = (unsigned char *) malloc(*gribbuffersize);
+
+  /* get a copy of the coded message */
+  GRIB_CHECK(grib_get_message_copy(gh, *gribbuffer, &recsize), 0);
+
+#if defined(GRIBAPIENCODETEST)
+  gribHandleDelete(gh);
+#endif
+
+  gc->init = TRUE;
+
+  nbytes = recsize;
+#else
+  Error("GRIB_API support not compiled in!");
+#endif
+
+  return (nbytes);
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+
+#ifdef USE_MPI
+#endif
+
+
+int grib1ltypeToZaxisType(int grib_ltype)
+{
+  int zaxistype = ZAXIS_GENERIC;
+
+  switch ( grib_ltype )
+    {
+    case GRIB1_LTYPE_SURFACE:         { zaxistype = ZAXIS_SURFACE;           break; }
+    case GRIB1_LTYPE_TOA:             { zaxistype = ZAXIS_TOA;               break; }
+    case GRIB1_LTYPE_SEA_BOTTOM:      { zaxistype = ZAXIS_SEA_BOTTOM;        break; }
+    case GRIB1_LTYPE_ATMOSPHERE:      { zaxistype = ZAXIS_ATMOSPHERE;        break; }
+    case GRIB1_LTYPE_MEANSEA:         { zaxistype = ZAXIS_MEANSEA;           break; }
+    case GRIB1_LTYPE_99:
+    case GRIB1_LTYPE_ISOBARIC:        { zaxistype = ZAXIS_PRESSURE;          break; }
+    case GRIB1_LTYPE_HEIGHT:          { zaxistype = ZAXIS_HEIGHT;            break; }
+    case GRIB1_LTYPE_ALTITUDE:        { zaxistype = ZAXIS_ALTITUDE;	     break; }
+    case GRIB1_LTYPE_SIGMA:
+    case GRIB1_LTYPE_SIGMA_LAYER:     { zaxistype = ZAXIS_SIGMA;	     break; }
+    case GRIB1_LTYPE_HYBRID:
+    case GRIB1_LTYPE_HYBRID_LAYER:    { zaxistype = ZAXIS_HYBRID;	     break; }
+    case GRIB1_LTYPE_LANDDEPTH:
+    case GRIB1_LTYPE_LANDDEPTH_LAYER: { zaxistype = ZAXIS_DEPTH_BELOW_LAND;  break; }
+    case GRIB1_LTYPE_ISENTROPIC:      { zaxistype = ZAXIS_ISENTROPIC;	     break; }
+    case GRIB1_LTYPE_SEADEPTH:        { zaxistype = ZAXIS_DEPTH_BELOW_SEA;   break; }
+    }
+
+  return (zaxistype);
+}
+
+
+int grib2ltypeToZaxisType(int grib_ltype)
+{
+  int zaxistype = ZAXIS_GENERIC;
+
+  switch ( grib_ltype )
+    {
+    case GRIB2_LTYPE_SURFACE:            { zaxistype = ZAXIS_SURFACE;           break; }
+    case GRIB2_LTYPE_TOA:                { zaxistype = ZAXIS_TOA;               break; }
+    case GRIB2_LTYPE_SEA_BOTTOM:         { zaxistype = ZAXIS_SEA_BOTTOM;        break; }
+    case GRIB2_LTYPE_ATMOSPHERE:         { zaxistype = ZAXIS_ATMOSPHERE;        break; }
+    case GRIB2_LTYPE_MEANSEA:            { zaxistype = ZAXIS_MEANSEA;           break; }
+    case GRIB2_LTYPE_ISOBARIC:           { zaxistype = ZAXIS_PRESSURE;          break; }
+    case GRIB2_LTYPE_HEIGHT:             { zaxistype = ZAXIS_HEIGHT;            break; }
+    case GRIB2_LTYPE_ALTITUDE:           { zaxistype = ZAXIS_ALTITUDE;          break; }
+    case GRIB2_LTYPE_SIGMA:              { zaxistype = ZAXIS_SIGMA;             break; }
+    case GRIB2_LTYPE_HYBRID:
+ /* case GRIB2_LTYPE_HYBRID_LAYER: */    { zaxistype = ZAXIS_HYBRID;            break; }
+    case GRIB2_LTYPE_LANDDEPTH:
+ /* case GRIB2_LTYPE_LANDDEPTH_LAYER: */ { zaxistype = ZAXIS_DEPTH_BELOW_LAND;  break; }
+    case GRIB2_LTYPE_ISENTROPIC:         { zaxistype = ZAXIS_ISENTROPIC;        break; }
+    case GRIB2_LTYPE_SEADEPTH:           { zaxistype = ZAXIS_DEPTH_BELOW_SEA;   break; }
+    }
+
+  return (zaxistype);
+}
+
+
+int grbBitsPerValue(int datatype)
+{
+  int bitsPerValue = 16;
+
+  if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    Error("CDI/GRIB library does not support complex numbers!");
+
+  if ( datatype != CDI_UNDEFID )
+    {
+      if ( datatype > 0 && datatype <= 32 )
+	bitsPerValue = datatype;
+      else if ( datatype == DATATYPE_FLT64 )
+	bitsPerValue = 24;
+      else
+	bitsPerValue = 16;
+    }
+
+  return (bitsPerValue);
+}
+
+
+/*
+int grbInqRecord(int streamID, int *varID, int *levelID)
+{
+  int status;
+
+  status = cgribexInqRecord(streamID, varID, levelID);
+
+  return (status);
+}
+*/
+
+int grbDefRecord(int streamID)
+{
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (status);
+}
+
+static
+int grbDecode(int filetype, unsigned char *gribbuffer, int gribsize, double *data, int gridsize,
+	      int unreduced, int *nmiss, int *zip, double missval)
+{
+  int status = 0;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    status = cgribexDecode(gribbuffer, gribsize, data, gridsize, unreduced, nmiss, zip, missval);
+  else
+#endif
+    status = gribapiDecode(gribbuffer, gribsize, data, gridsize, unreduced, nmiss, zip, missval);
+ 
+  return (status);
+}
+
+
+int grbReadRecord(int streamID, double *data, int *nmiss)
+{
+  int status = 0;
+  unsigned char *gribbuffer;
+  int fileID;
+  int recID, vrecID, tsID, gridID, varID;
+  long recsize;
+  off_t recpos;
+  int gridsize;
+  int vlistID;
+  int zip;
+  int filetype;
+  double missval;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  gribbuffer = (unsigned char *) streamptr->record->buffer;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  tsID    = streamptr->curTsID;
+  vrecID  = streamptr->tsteps[tsID].curRecID;
+  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr->tsteps[tsID].records[recID].position;
+  recsize = streamptr->tsteps[tsID].records[recID].size;
+  varID   = streamptr->tsteps[tsID].records[recID].varID;
+
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+
+  streamptr->numvals += gridsize;
+
+  fileSetPos(fileID, recpos, SEEK_SET);
+
+  fileRead(fileID, gribbuffer, (size_t) recsize);
+
+  missval = vlistInqVarMissval(vlistID, varID);
+
+  grbDecode(filetype, gribbuffer, recsize, data, gridsize, streamptr->unreduced, nmiss, &zip, missval);
+
+  streamptr->tsteps[tsID].records[recID].zip = zip;
+
+  return (status);
+}
+
+static
+int grbScanTimestep1(int streamID)
+{
+  int status;
+  int filetype;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+  filetype  = streamptr->filetype;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    {
+      status = cgribexScanTimestep1(streamID);
+    }
+  else
+#endif
+    {
+      status = gribapiScanTimestep1(streamID);
+    }
+
+  return (status);
+}
+
+static
+int grbScanTimestep2(int streamID)
+{
+  int status;
+  int filetype;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+  filetype  = streamptr->filetype;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    {
+      status = cgribexScanTimestep2(streamID);
+    }
+  else
+#endif
+    {
+      status = gribapiScanTimestep2(streamID);
+    }
+
+  return (status);
+}
+
+static
+int grbScanTimestep(int streamID)
+{
+  int status;
+  int filetype;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+  filetype  = streamptr->filetype;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    {
+      status = cgribexScanTimestep(streamID);
+    }
+  else
+#endif
+    {
+      status = gribapiScanTimestep(streamID);
+    }
+
+  return (status);
+}
+
+
+int grbInqContents(int streamID)
+{
+  int fileID;
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+
+  streamptr->curTsID = 0;
+
+  status = grbScanTimestep1(streamID);
+ 
+  if ( status == 0 && streamptr->ntsteps == -1 ) status = grbScanTimestep2(streamID);
+
+  fileSetPos(fileID, 0, SEEK_SET);
+
+  return (status);
+}
+
+
+int grbInqTimestep(int streamID, int tsID)
+{
+  int ntsteps, nrecs;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( tsID == 0 && streamptr->rtsteps == 0 )
+    Error("Call to cdiInqContents missing!");
+
+  if ( CDI_Debug )
+    Message("tsid = %d rtsteps = %d", tsID, streamptr->rtsteps);
+  
+  ntsteps = CDI_UNDEFID;
+  while ( (tsID + 1) > streamptr->rtsteps && ntsteps == CDI_UNDEFID )
+    {
+      ntsteps = grbScanTimestep(streamID);
+      if ( ntsteps == CDI_EUFSTRUCT )
+	{
+	  streamptr->ntsteps = streamptr->rtsteps;
+	  break;
+	}
+    }
+
+  if ( tsID >= streamptr->ntsteps && streamptr->ntsteps != CDI_UNDEFID )
+    {
+      nrecs = 0;
+    }
+  else
+    {
+      streamptr->curTsID = tsID;
+      nrecs = streamptr->tsteps[tsID].nrecs;
+    }
+
+  return (nrecs);
+}
+
+
+void grbReadVarDP(int streamID, int varID, double *data, int *nmiss)
+{
+  int fileID;
+  int levelID, nlevs, gridID, gridsize;
+  unsigned char *gribbuffer;
+  int tsID, recID;
+  long recsize;
+  off_t recpos, currentfilepos;
+  int imiss;
+  int vlistID;
+  int zip;
+  int filetype;
+  double missval;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  gribbuffer = (unsigned char *) streamptr->record->buffer;
+
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+
+  nlevs    = streamptr->vars[varID].nlevs;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  *nmiss = 0;
+  for ( levelID = 0; levelID < nlevs; levelID++ )
+    {
+      recID   = streamptr->vars[varID].level[levelID];
+      recpos  = streamptr->tsteps[tsID].records[recID].position;
+      recsize = streamptr->tsteps[tsID].records[recID].size;
+
+      fileSetPos(fileID, recpos, SEEK_SET);
+
+      fileRead(fileID, gribbuffer, recsize);
+
+      missval = vlistInqVarMissval(vlistID, varID);
+
+      grbDecode(filetype, gribbuffer, recsize, &data[levelID*gridsize], gridsize, 
+		streamptr->unreduced, &imiss, &zip, missval);
+
+      *nmiss += imiss;
+
+      streamptr->tsteps[tsID].records[recID].zip = zip;
+    }
+
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+}
+
+
+void grbReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *nmiss)
+{
+  int fileID;
+  int gridID, gridsize;
+  unsigned char *gribbuffer;
+  long recsize;
+  off_t recpos, currentfilepos;
+  int tsID, recID;
+  int vlistID;
+  int zip;
+  int filetype;
+  double missval;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  gribbuffer = (unsigned char *) streamptr->record->buffer;
+
+  vlistID  = streamInqVlist(streamID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsID     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("gridID = %d gridsize = %d", gridID, gridsize);
+
+  fileID = streamInqFileID(streamID);
+
+  currentfilepos = fileGetPos(fileID);
+
+  recID   = streamptr->vars[varID].level[levelID];
+  recpos  = streamptr->tsteps[tsID].records[recID].position;
+  recsize = streamptr->tsteps[tsID].records[recID].size;
+
+  if ( recsize == 0 )
+    Error("Internal problem! Recordsize is zero for record %d at timestep %d",
+	  recID+1, tsID+1);
+
+  fileSetPos(fileID, recpos, SEEK_SET);
+
+  fileRead(fileID, gribbuffer, recsize);
+
+  missval = vlistInqVarMissval(vlistID, varID);
+
+  grbDecode(filetype, gribbuffer, recsize, data, gridsize, streamptr->unreduced, nmiss, &zip, missval);
+
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  streamptr->tsteps[tsID].records[recID].zip = zip;
+}
+
+static
+size_t grbEncode(int filetype, int varID, int levelID, int vlistID, int gridID, int zaxisID,
+		 int date, int time, int tsteptype, int numavg, 
+		 long datasize, const double *data, int nmiss, unsigned char **gribbuffer,
+		 int ljpeg, void *gribContainer)
+{
+  size_t nbytes;
+  size_t gribbuffersize;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    {
+      gribbuffersize = datasize*4+3000;
+      *gribbuffer = (unsigned char *) malloc(gribbuffersize);
+
+      nbytes = cgribexEncode(varID, levelID, vlistID, gridID, zaxisID,
+			     date, time, tsteptype, numavg, 
+			     datasize, data, nmiss, *gribbuffer, gribbuffersize);
+    }
+  else
+#endif
+    {
+      nbytes = gribapiEncode(varID, levelID, vlistID, gridID, zaxisID,
+			     date, time, tsteptype, numavg, 
+			     datasize, data, nmiss, gribbuffer, &gribbuffersize,
+			     ljpeg, gribContainer);
+    }
+
+  return (nbytes);
+}
+
+static
+size_t grbSzip(int filetype, unsigned char *gribbuffer, size_t gribbuffersize)
+{
+  size_t nbytes = 0;
+  unsigned char *buffer;
+  size_t buffersize;
+  static int lszip_warn = 1;
+
+  buffersize = gribbuffersize + 1000; /* compressed record can be greater than source record */
+  buffer = (unsigned char *) malloc(buffersize);
+
+  /*  memcpy(buffer, gribbuffer, gribbuffersize); */
+
+  if ( filetype == FILETYPE_GRB )
+    {
+      nbytes = gribZip(gribbuffer, (long) gribbuffersize, buffer, (long) buffersize);
+    }
+  else
+    {
+      if ( lszip_warn ) Warning("Szip compression of GRIB2 records not implemented!");
+      lszip_warn = 0;
+      nbytes = gribbuffersize;
+    }
+
+  free(buffer);
+
+  return (nbytes);
+}
+
+
+int grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data, int nmiss)
+{
+  size_t nwrite;
+  int fileID;
+  int gridID;
+  int zaxisID;
+  unsigned char *gribbuffer = NULL;
+  long datasize;
+  int tsID;
+  int vlistID;
+  int date, time;
+  int tsteptype;
+  int numavg = 0;
+  size_t nbytes;
+  int filetype;
+  stream_t *streamptr;
+  int ljpeg = 0;
+  int ljpeg_warn = 1;
+  void *gc = NULL;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype  = streamptr->filetype;
+
+  fileID    = streamInqFileID(streamID);
+  vlistID   = streamInqVlist(streamID);
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+
+  tsID      = streamptr->curTsID;
+  date      = streamptr->tsteps[tsID].taxis.vdate;
+  time      = streamptr->tsteps[tsID].taxis.vtime;
+  if ( vlistInqVarTimave(vlistID, varID) )
+    numavg = streamptr->tsteps[tsID].taxis.numavg;
+
+  if ( CDI_Debug )
+    Message("gridID = %d zaxisID = %d", gridID, zaxisID);
+
+  datasize = gridInqSize(gridID);
+  /*
+  gribbuffersize = datasize*4+3000;
+  gribbuffer = (unsigned char *) malloc(gribbuffersize);
+  */
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    {
+    }
+  else
+#endif
+    {
+#if defined (GRIBCONTAINER2D)
+      gribContainer_t **gribContainers =  (gribContainer_t **) streamptr->gribContainers;
+      gc = (void *) &gribContainers[varID][levelID];
+#else
+      gribContainer_t *gribContainers =  (gribContainer_t *) streamptr->gribContainers;
+      gc = (void *) &gribContainers[varID];
+#endif
+    }
+
+  if ( streamptr->comptype == COMPRESS_JPEG )
+    {
+      if ( filetype == FILETYPE_GRB2 )
+	{
+	  ljpeg = 1;
+	}
+      else
+	{
+	  if ( ljpeg_warn ) Warning("JPEG compression of GRIB1 records not available!");
+	  ljpeg_warn = 0;
+	}
+    }
+
+  nbytes = grbEncode(filetype, varID, levelID, vlistID, gridID, zaxisID, date, time, tsteptype, numavg, 
+		     datasize, data, nmiss, &gribbuffer, ljpeg, gc);
+
+  if ( streamptr->comptype == COMPRESS_SZIP )
+    nbytes = grbSzip(filetype, gribbuffer, nbytes);
+
+  /* begin deike */
+#ifdef USE_MPI
+  if ( commInqIOMode () != PIO_NONE )
+    nwrite = pioFileWrite ( fileID, tsID, gribbuffer, nbytes );
+  else
+#endif
+  /* end deike */
+    nwrite = fileWrite(fileID, gribbuffer, nbytes);
+
+  if ( nwrite != nbytes ) perror(__func__);
+
+  if ( gribbuffer ) free(gribbuffer);
+
+  return ((int)nwrite);
+}
+
+
+void grbWriteVarDP(int streamID, int varID, const double *data, int nmiss)
+{
+  int vlistID, gridID, zaxisID, levelID, nlevs;
+  int gridsize;
+
+  vlistID  = streamInqVlist(streamID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  nlevs    = zaxisInqSize(zaxisID);
+
+  for ( levelID = 0; levelID < nlevs; levelID++ )
+    {
+      grbWriteVarSliceDP(streamID, varID, levelID, data+levelID*gridsize, nmiss);
+    }
+}
+
+
+int grbCopyRecord(int streamID2, int streamID1)
+{
+  int fileID1, fileID2;
+  int tsID, recID, vrecID;
+  long recsize;
+  size_t gribbuffersize;
+  off_t recpos;
+  size_t nwrite;
+  unsigned char *gribbuffer;
+  int filetype;
+  size_t nbytes;
+  long unzipsize;
+  int izip;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  filetype = streamptr1->filetype;
+
+  fileID1 = streamInqFileID(streamID1);
+  fileID2 = streamInqFileID(streamID2);
+
+  tsID    = streamptr1->curTsID;
+  vrecID  = streamptr1->tsteps[tsID].curRecID;
+  recID   = streamptr1->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr1->tsteps[tsID].records[recID].position;
+  recsize = streamptr1->tsteps[tsID].records[recID].size;
+
+  fileSetPos(fileID1, recpos, SEEK_SET);
+
+  gribbuffersize = recsize == (recsize>>3)<<3 ? recsize : (1+(recsize>>3))<<3;
+
+  gribbuffer = (unsigned char *) malloc(gribbuffersize);
+
+  fileRead(fileID1, gribbuffer, recsize);
+
+  nbytes = recsize;
+
+  izip = gribGetZip(recsize, gribbuffer, &unzipsize);
+
+  if ( izip == 0 )
+    if ( streamptr2->comptype == COMPRESS_SZIP )
+      nbytes = grbSzip(filetype, gribbuffer, nbytes);
+
+  while ( nbytes & 7 ) gribbuffer[nbytes++] = 0;
+
+  nwrite = fileWrite(fileID2, gribbuffer, nbytes);
+  if ( nwrite != nbytes ) perror(__func__);
+
+  free(gribbuffer);
+
+  return ((int)nwrite);
+}
+
+
+int grbWriteRecord(int streamID, const double *data, int nmiss)
+{
+  int status = 0;
+  int varID, levelID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  varID   = streamptr->record->varID;
+  levelID = streamptr->record->levelID;
+
+  status = grbWriteVarSliceDP(streamID, varID, levelID, data, nmiss);
+
+  return (status);
+}
+
+
+void streamInqGinfo(int streamID, int *intnum, float *fltnum)
+{
+  int recID, vrecID, tsID;
+  int filetype;
+  void *gribbuffer;
+  long gribbuffersize;
+  off_t recpos;
+  int zip;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  if ( filetype == FILETYPE_GRB )
+    {
+      tsID    = streamptr->curTsID;
+      vrecID  = streamptr->tsteps[tsID].curRecID;
+      recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+      recpos  = streamptr->tsteps[tsID].records[recID].position;
+      zip     = streamptr->tsteps[tsID].records[recID].zip;
+
+      gribbuffer = streamptr->record->buffer;
+      gribbuffersize = streamptr->record->buffersize;
+
+      if ( zip > 0 )
+	Error("Compressed GRIB records unsupported!");
+      else
+	gribGinfo(recpos, gribbuffersize, (unsigned char *) gribbuffer, intnum, fltnum);
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+
+
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+#define SINGLE_PRECISION  4
+#define DOUBLE_PRECISION  8
+
+#if defined (HAVE_LIBSERVICE)
+
+
+typedef struct {
+  int param;
+  int level;
+} SRVCOMPVAR; 
+
+
+int srvInqDatatype(int prec)
+{
+  int datatype;
+
+  if ( prec == DOUBLE_PRECISION ) datatype = DATATYPE_FLT64;
+  else                            datatype = DATATYPE_FLT32;
+
+  return (datatype);
+}
+
+
+int srvDefDatatype(int datatype)
+{
+  int prec;
+
+  if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    Error("CDI/SERVICE library does not support complex numbers!");
+
+  if ( datatype != DATATYPE_FLT32 && datatype != DATATYPE_FLT64 )
+    datatype = DATATYPE_FLT32;
+
+  if ( datatype == DATATYPE_FLT64 ) prec = DOUBLE_PRECISION;
+  else                              prec = SINGLE_PRECISION;
+
+  return (prec);
+}
+
+/* not used
+int srvInqRecord(int streamID, int *varID, int *levelID)
+{
+  int status;
+  int fileID;
+  int icode, ilevel;
+  int zaxisID = -1;
+  int header[8];
+  int vlistID;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  srvp    = streamptr->record->srvp;
+
+  *varID   = -1;
+  *levelID = -1;
+
+  status = srvRead(fileID, srvp);
+  if ( status != 0 ) return (0);
+
+  srvInqHeader(srvp, header);
+
+  icode  = header[0];
+  ilevel = header[1];
+
+  *varID = vlistInqVarID(vlistID, icode);
+
+  if ( *varID == UNDEFID ) Error("Code %d undefined", icode);
+
+  zaxisID = vlistInqVarZaxis(vlistID, *varID);
+
+  *levelID = zaxisInqLevelID(zaxisID, (double) ilevel);
+  
+  return (1);
+}
+*/
+
+int srvReadRecord(int streamID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int status;
+  int recID, vrecID, tsID;
+  off_t recpos;
+  int header[8];
+  int varID, gridID;
+  int i, size;
+  double missval;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  tsID    = streamptr->curTsID;
+  vrecID  = streamptr->tsteps[tsID].curRecID;
+  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr->tsteps[tsID].records[recID].position;
+  varID   = streamptr->tsteps[tsID].records[recID].varID;
+  srvp    = streamptr->record->srvp;
+
+  fileSetPos(fileID, recpos, SEEK_SET);
+
+  status = srvRead(fileID, srvp);
+  if ( status != 0 ) return (0);
+
+  srvInqHeader(srvp, header);
+  srvInqDataDP(srvp, data);
+
+  missval = vlistInqVarMissval(vlistID, varID);
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  size    = gridInqSize(gridID);
+
+  streamptr->numvals += size;
+
+  *nmiss = 0;
+  for ( i = 0; i < size; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+
+  return (1);
+}
+
+
+int srvCopyRecord(int streamID2, int streamID1)
+{
+  int fileID1, fileID2;
+  int tsID, recID, vrecID;
+  long recsize;
+  off_t recpos;
+  int status = 0;
+  char *buffer;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  fileID1 = streamInqFileID(streamID1);
+  fileID2 = streamInqFileID(streamID2);
+
+  tsID    = streamptr1->curTsID;
+  vrecID  = streamptr1->tsteps[tsID].curRecID;
+  recID   = streamptr1->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr1->tsteps[tsID].records[recID].position;
+  recsize = streamptr1->tsteps[tsID].records[recID].size;
+
+  fileSetPos(fileID1, recpos, SEEK_SET);
+
+  buffer = (char *) malloc(recsize);
+
+  fileRead(fileID1, buffer, recsize);
+
+  fileWrite(fileID2, buffer, recsize);
+
+  free(buffer);
+
+  return (status);
+}
+
+
+int srvDefRecord(int streamID)
+{
+  int gridID;
+  int header[8];
+  int status = 0;
+  int xsize, ysize;
+  int datatype;
+  int pdis, pcat, pnum;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  gridID = streamptr->record->gridID;
+  srvp   = streamptr->record->srvp;
+
+  cdiDecodeParam(streamptr->record->param, &pnum, &pcat, &pdis);
+  header[0] = pnum;
+  header[1] = streamptr->record->level;
+  header[2] = streamptr->record->date;
+  header[3] = streamptr->record->time;
+
+  xsize = gridInqXsize(gridID);
+  ysize = gridInqYsize(gridID);
+  if ( xsize == 0 || ysize == 0 )
+    {
+      xsize = gridInqSize(gridID);
+      ysize = 1;
+    }
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED ) ysize = 1;
+  if ( gridInqSize(gridID) != xsize*ysize )
+    Error("Internal problem with gridsize!");
+
+  header[4] = xsize;
+  header[5] = ysize;
+  header[6] = 0;
+  header[7] = 0;
+
+  datatype = streamptr->record->prec;
+
+  srvp->dprec = srvDefDatatype(datatype);
+
+  srvDefHeader(srvp, header);
+
+  return (status);
+}
+
+
+int srvWriteRecord(int streamID, const double *data)
+{
+  int fileID;
+  int status = 0;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+  srvp   = streamptr->record->srvp;
+
+  srvDefDataDP(srvp, data);
+
+  srvWrite(fileID, srvp);
+
+  return (status);
+}
+
+
+void srvAddRecord(int streamID, int param, int level, int xsize, int ysize,
+		  long recsize, off_t position, int prec)
+{
+  int leveltype;
+  int gridID = UNDEFID;
+  int levelID = 0;
+  int tsID, recID, varID;
+  int datatype;
+  record_t *record;
+  grid_t grid;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  tsID    = streamptr->curTsID;
+  recID   = recordNewEntry(streamID, tsID);
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  (*record).size     = recsize;
+  (*record).position = position;
+  (*record).param    = param;
+  (*record).ilevel   = level;
+
+  memset(&grid, 0, sizeof(grid_t));
+  grid.type  = GRID_GENERIC; 
+  grid.size  = xsize*ysize;
+  grid.xsize = xsize;
+  grid.ysize = ysize;
+  grid.xvals = NULL;
+  grid.yvals = NULL;
+  gridID = varDefGrid(vlistID, grid, 0);
+  /*
+  if ( level == 0 ) leveltype = ZAXIS_SURFACE;
+  else              leveltype = ZAXIS_GENERIC;
+  */
+  leveltype = ZAXIS_GENERIC;
+
+  datatype = srvInqDatatype(prec);
+
+  varAddRecord(recID, param, gridID, leveltype, 0, level, 0,
+	       datatype, &varID, &levelID, UNDEFID, 0, 0, NULL, NULL, NULL);
+
+  (*record).varID   = varID;
+  (*record).levelID = levelID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+
+  if ( CDI_Debug )
+    Message("varID = %d gridID = %d levelID = %d",
+	    varID, gridID, levelID);
+}
+
+
+void srvCmpRecord(int streamID, int tsID, int recID, off_t position, int param,
+		  int level, int xsize, int ysize)
+{
+  int varID = 0;
+  int levelID = 0;
+  record_t *record;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  if ( param != (*record).param || level != (*record).ilevel )
+    Error("inconsistent timestep");
+
+  (*record).position = position;
+  /*
+  varID   = (*record).varID;
+  levelID = (*record).levelID;
+
+  streamptr->vars[varID].level[levelID] = recID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+  */
+  if ( CDI_Debug )
+    Message("varID = %d levelID = %d", varID, levelID);
+}
+
+static
+void srvScanTimestep1(int streamID)
+{  
+  int header[8];
+  int prec = 0;
+  int status;
+  int fileID;
+  int rxsize = 0, rysize = 0;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos;
+  int nrecords, nrecs, recID;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  SRVCOMPVAR compVar, compVar0;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 0;
+
+  srvp  = streamptr->record->srvp;
+  tsID  = tstepsNewEntry(streamID);
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( tsID != 0 )
+    Error("Internal problem! tstepsNewEntry returns %d", tsID);
+
+  fileID = streamInqFileID(streamID);
+
+  nrecs = 0;
+  while ( TRUE )
+    {
+      recpos = fileGetPos(fileID);
+      status = srvRead(fileID, srvp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 1;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      srvInqHeader(srvp, header);
+
+      prec   = srvp->dprec;
+      rcode  = header[0];
+      rlevel = header[1];
+      vdate  = header[2];
+      vtime  = header[3];
+      rxsize = header[4];
+      rysize = header[5];
+
+      param = cdiEncodeParam(rcode, 255, 255);
+
+      if ( nrecs == 0 )
+	{
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	}
+      else
+	{
+	  datetime.date = vdate;
+	  datetime.time = vtime;
+	  compVar.param = param;
+          compVar.level = rlevel;
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      compVar0.param = streamptr->tsteps[0].records[recID].param;
+	      compVar0.level = streamptr->tsteps[0].records[recID].ilevel;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(SRVCOMPVAR)) == 0 ) break;
+	    }
+	  if ( recID < nrecs ) break;
+	  if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) )
+	    Warning("Inconsistent verification time for code %d level %d", rcode, rlevel);
+	}
+
+      nrecs++;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", nrecs, (int)recpos, rcode, rlevel, vdate, vtime);
+
+      srvAddRecord(streamID, param, rlevel, rxsize, rysize, recsize, recpos, prec);
+    }
+
+  streamptr->rtsteps = 1;
+
+  cdiGenVars(streamID);
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+  taxis->type  = TAXIS_ABSOLUTE;
+  taxis->vdate = datetime0.date;
+  taxis->vtime = datetime0.time;
+
+  vlistID = streamInqVlist(streamID);
+  vlistDefTaxis(vlistID, taxisID);
+
+  cdiCheckContents(streamID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  if ( nrecords < streamptr->tsteps[0].recordSize )
+    {
+      streamptr->tsteps[0].recordSize = nrecords;
+      streamptr->tsteps[0].records =
+	(record_t *) realloc(streamptr->tsteps[0].records, nrecords*sizeof(record_t));
+    }
+
+  streamptr->tsteps[0].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[0].nrecs = nrecords;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[0].recIDs[recID] = recID;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( streamptr->ntsteps == 1 )
+    {
+      if ( taxis->vdate == 0 && taxis->vtime == 0 )
+	{
+	  streamptr->ntsteps = 0;
+	  for ( varID = 0; varID < streamptr->nvars; varID++ )
+	    {
+	      vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	    }
+	}
+    }
+}
+
+static
+int srvScanTimestep2(int streamID)
+{  
+  int header[8];
+  int status;
+  int fileID;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos = 0;
+  int nrecords, nrecs, recID, rindex;
+  int nextstep;
+  taxis_t *taxis;
+  int vlistID;
+  SRVCOMPVAR compVar, compVar0;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 1;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  srvp    = streamptr->record->srvp;
+
+  tsID = streamptr->rtsteps;
+  if ( tsID != 1 )
+    Error("Internal problem! unexpeceted timestep %d", tsID+1);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+  cdiCreateRecords(streamID, tsID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[1].nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[1].recIDs[recID] = -1;
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID = streamptr->tsteps[0].records[recID].varID;
+      streamptr->tsteps[tsID].records[recID].position = 
+	streamptr->tsteps[0].records[recID].position;
+      streamptr->tsteps[tsID].records[recID].size     = 
+	streamptr->tsteps[0].records[recID].size;
+    }
+
+  for ( rindex = 0; rindex <= nrecords; rindex++ )
+    {
+      recpos = fileGetPos(fileID);
+      status = srvRead(fileID, srvp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 2;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      srvInqHeader(srvp, header);
+
+      rcode  = header[0];
+      rlevel = header[1];
+      vdate  = header[2];
+      vtime  = header[3];
+
+      param = cdiEncodeParam(rcode, 255, 255);
+
+      if ( rindex == 0 )
+	{
+	  taxis->type  = TAXIS_ABSOLUTE;
+	  taxis->vdate = vdate;
+	  taxis->vtime = vtime;
+	}
+
+      compVar.param = param;
+      compVar.level = rlevel;
+      nextstep = FALSE;
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(SRVCOMPVAR)) == 0 )
+	    {
+	      if ( streamptr->tsteps[tsID].records[recID].used )
+		{
+		  nextstep = TRUE;
+		}
+	      else
+		{
+		  streamptr->tsteps[tsID].records[recID].used = TRUE;
+		  streamptr->tsteps[tsID].recIDs[rindex] = recID;
+		}
+	      break;
+	    }
+	}
+      if ( recID == nrecords )
+	{
+	  Warning("Code %d level %d not found at timestep %d", rcode, rlevel, tsID+1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      if ( nextstep ) break;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", rindex+1, (int)recpos, rcode, rlevel, vdate, vtime);
+
+      streamptr->tsteps[tsID].records[recID].size = recsize;
+
+      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+      compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+      if ( memcmp(&compVar0, &compVar, sizeof(SRVCOMPVAR)) != 0 )
+	{
+	  Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		  tsID, recID,
+		  streamptr->tsteps[tsID].records[recID].param, param,
+		  streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->tsteps[1].records[recID].position = recpos;
+    }
+
+  nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      if ( ! streamptr->tsteps[tsID].records[recID].used )
+	{
+	  varID = streamptr->tsteps[tsID].records[recID].varID;
+          vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	}
+      else
+	{
+	  nrecs++;
+	}
+    }
+  streamptr->tsteps[tsID].nrecs = nrecs;
+
+  streamptr->rtsteps = 2;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  return (0);
+}
+
+
+int srvInqContents(int streamID)
+{
+  int fileID;
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+
+  streamptr->curTsID = 0;
+
+  srvScanTimestep1(streamID);
+ 
+  if ( streamptr->ntsteps == -1 ) status = srvScanTimestep2(streamID);
+
+  fileSetPos(fileID, 0, SEEK_SET);
+
+  return (status);
+}
+
+static
+int srvScanTimestep(int streamID)
+{
+  int header[8];
+  int status;
+  int fileID;
+  int tsID;
+  /* int rxsize = 0, rysize = 0; */
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  long recsize = 0;
+  off_t recpos = 0;
+  int recID;
+  taxis_t *taxis;
+  int rindex, nrecs = 0;
+  SRVCOMPVAR compVar, compVar0;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( CDI_Debug )
+    {
+      Message("streamID = %d", streamID);
+      Message("cts = %d", streamptr->curTsID);
+      Message("rts = %d", streamptr->rtsteps);
+      Message("nts = %d", streamptr->ntsteps);
+    }
+
+  if ( streamptr->rtsteps == 0 )
+    Error("Internal problem! Missing contents.");
+
+  srvp  = streamptr->record->srvp;
+  tsID  = streamptr->rtsteps;
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->tsteps[tsID].recordSize == 0 )
+    {
+      cdiCreateRecords(streamID, tsID);
+
+      nrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->tsteps[tsID].nrecs = nrecs;
+      streamptr->tsteps[tsID].recIDs = (int *) malloc(nrecs*sizeof(int));
+      for ( recID = 0; recID < nrecs; recID++ )
+	streamptr->tsteps[tsID].recIDs[recID] = streamptr->tsteps[1].recIDs[recID];
+
+      fileID = streamInqFileID(streamID);
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+      for ( rindex = 0; rindex <= nrecs; rindex++ )
+	{
+	  recpos = fileGetPos(fileID);
+	  status = srvRead(fileID, srvp);
+	  if ( status != 0 )
+	    {
+	      streamptr->ntsteps = streamptr->rtsteps + 1;
+	      break;
+	    }
+	  recsize = fileGetPos(fileID) - recpos;
+
+	  srvInqHeader(srvp, header);
+
+	  rcode  = header[0];
+	  rlevel = header[1];
+	  vdate  = header[2];
+	  vtime  = header[3];
+          /* rxsize = header[4]; */
+          /* rysize = header[5]; */
+
+	  param = cdiEncodeParam(rcode, 255, 255);
+
+	  // if ( rindex == nrecs ) break; gcc-4.5 internal compiler error
+	  if ( rindex == nrecs ) continue;
+	  recID = streamptr->tsteps[tsID].recIDs[rindex];
+
+	  if ( rindex == 0 )
+	    {
+	      taxis->type  = TAXIS_ABSOLUTE;
+	      taxis->vdate = vdate;
+	      taxis->vtime = vtime;
+	    }
+	  /*
+	  srvCmpRecord(streamID, tsID, nrecs, recpos, param, rlevel, rxsize, rysize);
+	  */
+	  compVar.param  = param;
+          compVar.level  = rlevel;
+	  compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(SRVCOMPVAR)) != 0 )
+	    {
+	      Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		      tsID, recID,
+		      streamptr->tsteps[tsID].records[recID].param, param,
+		      streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	      Error("Invalid, unsupported or inconsistent record structure");
+	    }
+
+	  streamptr->tsteps[tsID].records[recID].position = recpos;
+	  streamptr->tsteps[tsID].records[recID].size = recsize;
+
+	  if ( CDI_Debug )
+	    Message("%4d%8d%4d%8d%8d%6d", rindex, (int)recpos, rcode, rlevel, vdate, vtime);
+	}
+
+      streamptr->rtsteps++;
+
+      if ( streamptr->ntsteps != streamptr->rtsteps )
+	{
+	  tsID = tstepsNewEntry(streamID);
+	  if ( tsID != streamptr->rtsteps )
+	    Error("Internal error. tsID = %d", tsID);
+
+	  streamptr->tsteps[tsID-1].next   = 1;
+	  streamptr->tsteps[tsID].position = recpos;
+	}
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( nrecs > 0 && nrecs < streamptr->tsteps[tsID].nrecs )
+    {
+      Warning("Incomplete timestep. Stop scanning at timestep %d.", tsID);
+      streamptr->ntsteps = tsID;
+    }
+
+  return (streamptr->ntsteps);
+}
+
+
+int srvInqTimestep(int streamID, int tsID)
+{
+  int ntsteps, nrecs;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( tsID == 0 && streamptr->rtsteps == 0 )
+    Error("Call to cdiInqContents missing!");
+
+  if ( CDI_Debug )
+    Message("tsID = %d rtsteps = %d", tsID, streamptr->rtsteps);
+  
+  ntsteps = UNDEFID;
+  while ( ( tsID + 1 ) > streamptr->rtsteps && ntsteps == UNDEFID )
+    ntsteps = srvScanTimestep(streamID);
+
+  if ( tsID >= streamptr->ntsteps && streamptr->ntsteps != CDI_UNDEFID )
+    {
+      nrecs = 0;
+    }
+  else
+    {
+      streamptr->curTsID = tsID;
+      nrecs = streamptr->tsteps[tsID].nrecs;
+    }
+
+  return (nrecs);
+}
+
+
+void srvReadVarDP(int streamID, int varID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int levID, nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int header[8];
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  srvp     = streamptr->record->srvp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  for (levID = 0; levID < nlevs; levID++)
+    {
+      recID = streamptr->vars[varID].level[levID];
+      recpos = streamptr->tsteps[tsid].records[recID].position;
+      fileSetPos(fileID, recpos, SEEK_SET);
+      srvRead(fileID, srvp);
+      srvInqHeader(srvp, header);
+      srvInqDataDP(srvp, &data[levID*gridsize]);
+    }
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  for ( i = 0; i < nlevs*gridsize; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+}
+
+
+void srvReadVarSliceDP(int streamID, int varID, int levID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int header[8];
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  srvp     = streamptr->record->srvp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d",
+	     nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  recID = streamptr->vars[varID].level[levID];
+  recpos = streamptr->tsteps[tsid].records[recID].position;
+  fileSetPos(fileID, recpos, SEEK_SET);
+  srvRead(fileID, srvp);
+  srvInqHeader(srvp, header);
+  srvInqDataDP(srvp, data);
+
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  for ( i = 0; i < gridsize; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+}
+
+
+void srvWriteVarDP(int streamID, int varID, const double *data)
+{
+  int fileID;
+  int levID, nlevs, gridID, gridsize;
+  int zaxisID;
+  double level;
+  int header[8];
+  int xsize, ysize;
+  int datatype;
+  int tsID;
+  int vlistID;
+  int pdis, pcat, pnum;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  srvp     = streamptr->record->srvp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  nlevs    = zaxisInqSize(zaxisID);
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
+
+  header[0] = pnum;
+  header[2] = streamptr->tsteps[tsID].taxis.vdate;
+  header[3] = streamptr->tsteps[tsID].taxis.vtime;
+
+  xsize = gridInqXsize(gridID);
+  ysize = gridInqYsize(gridID);
+  if ( xsize == 0 || ysize == 0 )
+    {
+      xsize = gridInqSize(gridID);
+      ysize = 1;
+    }
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED ) ysize = 1;
+  if ( gridInqSize(gridID) != xsize*ysize )
+    Error("Internal problem with gridsize!");
+
+  header[4] = xsize;
+  header[5] = ysize;
+  header[6] = 0;
+  header[7] = 0;
+
+  datatype = vlistInqVarDatatype(vlistID, varID);
+
+  srvp->dprec = srvDefDatatype(datatype);
+
+  for ( levID = 0; levID < nlevs; levID++ )
+    {
+      level = zaxisInqLevel(zaxisID, levID);
+
+      header[1] = (int) level;
+      srvDefHeader(srvp, header);
+      srvDefDataDP(srvp, &data[levID*gridsize]);
+      srvWrite(fileID, srvp);
+    }
+}
+
+
+void srvWriteVarSliceDP(int streamID, int varID, int levID, const double *data)
+{
+  int fileID;
+  int gridID;
+  int zaxisID;
+  double level;
+  int header[8];
+  int xsize, ysize;
+  int datatype;
+  int tsID;
+  int vlistID;
+  int pdis, pcat, pnum;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  srvp     = streamptr->record->srvp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  level    = zaxisInqLevel(zaxisID, levID);
+
+  if ( CDI_Debug )
+    Message("gridID = %d zaxisID = %d", gridID, zaxisID);
+
+  cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
+
+  header[0] = pnum;
+  header[1] = (int) level;
+  header[2] = streamptr->tsteps[tsID].taxis.vdate;
+  header[3] = streamptr->tsteps[tsID].taxis.vtime;
+
+  xsize = gridInqXsize(gridID);
+  ysize = gridInqYsize(gridID);
+  if ( xsize == 0 || ysize == 0 )
+    {
+      xsize = gridInqSize(gridID);
+      ysize = 1;
+    }
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED ) ysize = 1;
+  if ( gridInqSize(gridID) != xsize*ysize )
+    Error("Internal problem with gridsize!");
+
+  header[4] = xsize;
+  header[5] = ysize;
+  header[6] = 0;
+  header[7] = 0;
+
+  datatype = vlistInqVarDatatype(vlistID, varID);
+
+  srvp->dprec = srvDefDatatype(datatype);
+
+  srvDefHeader(srvp, header);
+  srvDefDataDP(srvp, data);
+  srvWrite(fileID, srvp);
+}
+
+#endif /* HAVE_LIBSERVICE */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+
+
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+#define SINGLE_PRECISION  4
+#define DOUBLE_PRECISION  8
+
+#if defined (HAVE_LIBEXTRA)
+
+
+typedef struct {
+  int param;
+  int level;
+} extcompvar_t; 
+
+static
+int extInqDatatype(int prec, int number)
+{
+  int datatype;
+
+  if ( number == 2 )
+    {
+      if ( prec == DOUBLE_PRECISION ) datatype = DATATYPE_CPX64;
+      else                            datatype = DATATYPE_CPX32;
+    }
+  else
+    {
+      if ( prec == DOUBLE_PRECISION ) datatype = DATATYPE_FLT64;
+      else                            datatype = DATATYPE_FLT32;
+    }
+
+  return (datatype);
+}
+
+static
+void extDefDatatype(int datatype, int *prec, int *number)
+{
+
+  if ( datatype != DATATYPE_FLT32 && datatype != DATATYPE_FLT64 &&
+       datatype != DATATYPE_CPX32 && datatype != DATATYPE_CPX64 )
+    datatype = DATATYPE_FLT32;
+
+  if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    *number = 2;
+  else
+    *number = 1;
+
+  if ( datatype == DATATYPE_FLT64 || datatype == DATATYPE_CPX64 )
+    *prec = DOUBLE_PRECISION;
+  else 
+    *prec = SINGLE_PRECISION;
+}
+
+/* not used
+int extInqRecord(int streamID, int *varID, int *levelID)
+{
+  int status;
+  int fileID;
+  int icode, ilevel;
+  int zaxisID = -1;
+  int header[4];
+  int vlistID;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  extp    = streamptr->record->extp;
+
+  *varID   = -1;
+  *levelID = -1;
+
+  status = extRead(fileID, extp);
+  if ( status != 0 ) return (0);
+
+  extInqHeader(extp, header);
+
+  icode  = header[1];
+  ilevel = header[2];
+
+  *varID = vlistInqVarID(vlistID, icode);
+
+  if ( *varID == UNDEFID ) Error("Code %d undefined", icode);
+
+  zaxisID = vlistInqVarZaxis(vlistID, *varID);
+
+  *levelID = zaxisInqLevelID(zaxisID, (double) ilevel);
+  
+  return (1);
+}
+*/
+
+int extReadRecord(int streamID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int status;
+  int recID, vrecID, tsID;
+  off_t recpos;
+  int header[4];
+  int varID, gridID;
+  int i, size;
+  double missval;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  tsID    = streamptr->curTsID;
+  vrecID  = streamptr->tsteps[tsID].curRecID;
+  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr->tsteps[tsID].records[recID].position;
+  varID   = streamptr->tsteps[tsID].records[recID].varID;
+  extp    = streamptr->record->extp;
+
+  fileSetPos(fileID, recpos, SEEK_SET);
+
+  status = extRead(fileID, extp);
+  if ( status != 0 ) return (0);
+
+  extInqHeader(extp, header);
+  extInqDataDP(extp, data);
+
+  missval = vlistInqVarMissval(vlistID, varID);
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  size    = gridInqSize(gridID);
+
+  streamptr->numvals += size;
+
+  *nmiss = 0;
+  if ( vlistInqVarNumber(vlistID, varID) == CDI_REAL )
+    {
+      for ( i = 0; i < size; i++ )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+  else
+    {
+      for ( i = 0; i < 2*size; i+=2 )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+
+  return (1);
+}
+
+
+int extCopyRecord(int streamID2, int streamID1)
+{
+  int fileID1, fileID2;
+  int tsID, recID, vrecID;
+  long recsize;
+  off_t recpos;
+  int status = 0;
+  char *buffer;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  fileID1 = streamInqFileID(streamID1);
+  fileID2 = streamInqFileID(streamID2);
+
+  tsID    = streamptr1->curTsID;
+  vrecID  = streamptr1->tsteps[tsID].curRecID;
+  recID   = streamptr1->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr1->tsteps[tsID].records[recID].position;
+  recsize = streamptr1->tsteps[tsID].records[recID].size;
+
+  fileSetPos(fileID1, recpos, SEEK_SET);
+
+  buffer = (char *) malloc(recsize);
+
+  fileRead(fileID1, buffer, recsize);
+
+  fileWrite(fileID2, buffer, recsize);
+
+  free(buffer);
+
+  return (status);
+}
+
+
+int extDefRecord(int streamID)
+{
+  int gridID;
+  int header[4];
+  int status = 0;
+  int pdis, pcat, pnum;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  gridID   = streamptr->record->gridID;
+  extp     = streamptr->record->extp;
+
+  cdiDecodeParam(streamptr->record->param, &pnum, &pcat, &pdis);
+  header[0] = streamptr->record->date;
+  header[1] = pnum;
+  header[2] = streamptr->record->level;
+  header[3] = gridInqSize(gridID);
+
+  extDefDatatype(streamptr->record->prec, &extp->prec, &extp->number);
+
+  extDefHeader(extp, header);
+
+  return (status);
+}
+
+
+int extWriteRecord(int streamID, const double *data)
+{
+  int fileID;
+  int status = 0;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+  extp   = streamptr->record->extp;
+
+  extDefDataDP(extp, data);
+
+  extWrite(fileID, extp);
+
+  return (status);
+}
+
+static
+void extAddRecord(int streamID, int param, int level, int xysize,
+		  long recsize, off_t position, int prec, int number)
+{
+  int leveltype;
+  int gridID = UNDEFID;
+  int levelID = 0;
+  int tsID, recID, varID;
+  record_t *record;
+  grid_t grid;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  tsID    = streamptr->curTsID;
+  recID   = recordNewEntry(streamID, tsID);
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  (*record).size     = recsize;
+  (*record).position = position;
+  (*record).param     = param;
+  (*record).ilevel   = level;
+
+  memset(&grid, 0, sizeof(grid_t));
+  grid.type  = GRID_GENERIC;
+  grid.size  = xysize;
+  grid.xsize = xysize;
+  grid.ysize = 0;
+  grid.xvals = NULL;
+  grid.yvals = NULL;
+  gridID = varDefGrid(vlistID, grid, 0);
+  /*
+  if ( level == 0 ) leveltype = ZAXIS_SURFACE;
+  else              leveltype = ZAXIS_GENERIC;
+  */
+  leveltype = ZAXIS_GENERIC;
+
+  varAddRecord(recID, param, gridID, leveltype, 0, level, 0,
+	       extInqDatatype(prec, number), &varID, &levelID, UNDEFID, 0, 0, NULL, NULL, NULL);
+
+  (*record).varID   = varID;
+  (*record).levelID = levelID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+
+  if ( CDI_Debug )
+    Message("varID = %d gridID = %d levelID = %d",
+	    varID, gridID, levelID);
+}
+
+
+void extCmpRecord(int streamID, int tsID, int recID, off_t position, int param,
+		  int level, int xysize)
+{
+  int varID = 0;
+  int levelID = 0;
+  record_t *record;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  if ( param != (*record).param || level != (*record).ilevel )
+    Error("inconsistent timestep");
+
+  (*record).position = position;
+  /*
+  varID   = (*record).varID;
+  levelID = (*record).levelID;
+
+  streamptr->vars[varID].level[levelID] = recID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+  */
+  if ( CDI_Debug )
+    Message("varID = %d levelID = %d", varID, levelID);
+}
+
+static
+void extScanTimestep1(int streamID)
+{  
+  int header[4];
+  int status;
+  int fileID;
+  int rxysize = 0;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos;
+  int nrecords, nrecs, recID;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  extcompvar_t compVar, compVar0;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 0;
+
+  extp  = streamptr->record->extp;
+  tsID  = tstepsNewEntry(streamID);
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( tsID != 0 )
+    Error("Internal problem! tstepsNewEntry returns %d", tsID);
+
+  fileID = streamInqFileID(streamID);
+
+  nrecs = 0;
+  while ( TRUE )
+    {
+      recpos = fileGetPos(fileID);
+      status = extRead(fileID, extp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 1;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      extInqHeader(extp, header);
+
+      vdate   = header[0];
+      vtime   = 0;
+      rcode   = header[1];
+      rlevel  = header[2];
+      rxysize = header[3];
+
+      param = cdiEncodeParam(rcode, 255, 255);
+
+      if ( nrecs == 0 )
+	{
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	}
+      else
+	{
+	  datetime.date = vdate;
+	  datetime.time = vtime;
+	  compVar.param = param;
+          compVar.level = rlevel;
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      compVar0.param  = streamptr->tsteps[0].records[recID].param;
+	      compVar0.level = streamptr->tsteps[0].records[recID].ilevel;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(extcompvar_t)) == 0 ) break;
+	    }
+	  if ( recID < nrecs ) break;
+	  if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) )
+	    Warning("Inconsistent verification time for code %d level %d", rcode, rlevel);
+	}
+
+      nrecs++;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", nrecs, (int)recpos, rcode, rlevel, vdate, vtime);
+
+      extAddRecord(streamID, param, rlevel, rxysize, recsize, recpos, extp->prec, extp->number);
+    }
+
+  streamptr->rtsteps = 1;
+
+  cdiGenVars(streamID);
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+  taxis->type  = TAXIS_ABSOLUTE;
+  taxis->vdate = datetime0.date;
+  taxis->vtime = datetime0.time;
+
+  vlistID = streamInqVlist(streamID);
+  vlistDefTaxis(vlistID, taxisID);
+
+  cdiCheckContents(streamID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  if ( nrecords < streamptr->tsteps[0].recordSize )
+    {
+      streamptr->tsteps[0].recordSize = nrecords;
+      streamptr->tsteps[0].records =
+      (record_t *) realloc(streamptr->tsteps[0].records, nrecords*sizeof(record_t));
+    }
+
+  streamptr->tsteps[0].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[0].nrecs = nrecords;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[0].recIDs[recID] = recID;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( streamptr->ntsteps == 1 )
+    {
+      if ( taxis->vdate == 0 && taxis->vtime == 0 )
+	{
+	  streamptr->ntsteps = 0;
+	  for ( varID = 0; varID < streamptr->nvars; varID++ )
+	    {
+	      vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	    }
+	}
+    }
+}
+
+static
+int extScanTimestep2(int streamID)
+{  
+  int header[4];
+  int status;
+  int fileID;
+  // int rxysize = 0;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos = 0;
+  int nrecords, nrecs, recID, rindex;
+  int nextstep;
+  taxis_t *taxis;
+  int vlistID;
+  extcompvar_t compVar, compVar0;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 1;
+
+  fileID  = streamInqFileID(streamID);
+  vlistID = streamInqVlist(streamID);
+  extp    = streamptr->record->extp;
+
+  tsID = streamptr->rtsteps;
+  if ( tsID != 1 )
+    Error("Internal problem! unexpeceted timestep %d", tsID+1);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+  cdiCreateRecords(streamID, tsID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[1].nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[1].recIDs[recID] = -1;
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID = streamptr->tsteps[0].records[recID].varID;
+      streamptr->tsteps[tsID].records[recID].position = 
+	streamptr->tsteps[0].records[recID].position;
+      streamptr->tsteps[tsID].records[recID].size     = 
+	streamptr->tsteps[0].records[recID].size;
+    }
+
+  for ( rindex = 0; rindex <= nrecords; rindex++ )
+    {
+      recpos = fileGetPos(fileID);
+      status = extRead(fileID, extp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 2;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      extInqHeader(extp, header);
+
+      vdate  = header[0];
+      vtime  = 0;
+      rcode  = header[1];
+      rlevel = header[2];
+      // rxysize = header[3];
+
+      param = cdiEncodeParam(rcode, 255, 255);
+
+      if ( rindex == 0 )
+	{
+	  taxis->type  = TAXIS_ABSOLUTE;
+	  taxis->vdate = vdate;
+	  taxis->vtime = vtime;
+	}
+
+      compVar.param = param;
+      compVar.level = rlevel;
+      nextstep = FALSE;
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(extcompvar_t)) == 0 )
+	    {
+	      if ( streamptr->tsteps[tsID].records[recID].used )
+		{
+		  nextstep = TRUE;
+		}
+	      else
+		{
+		  streamptr->tsteps[tsID].records[recID].used = TRUE;
+		  streamptr->tsteps[tsID].recIDs[rindex] = recID;
+		}
+	      break;
+	    }
+	}
+      if ( recID == nrecords )
+	{
+	  Warning("Code %d level %d not found at timestep %d", rcode, rlevel, tsID+1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      if ( nextstep ) break;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", rindex+1, (int)recpos, rcode, rlevel, vdate, vtime);
+
+      streamptr->tsteps[tsID].records[recID].size = recsize;
+
+      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+      compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+      if ( memcmp(&compVar0, &compVar, sizeof(extcompvar_t)) != 0 )
+	{
+	  Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		  tsID, recID,
+		  streamptr->tsteps[tsID].records[recID].param, param,
+		  streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->tsteps[1].records[recID].position = recpos;
+    }
+
+  nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      if ( ! streamptr->tsteps[tsID].records[recID].used )
+	{
+	  varID = streamptr->tsteps[tsID].records[recID].varID;
+          vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	}
+      else
+	{
+	  nrecs++;
+	}
+    }
+  streamptr->tsteps[tsID].nrecs = nrecs;
+
+  streamptr->rtsteps = 2;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  return (0);
+}
+
+
+int extInqContents(int streamID)
+{
+  int fileID;
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+
+  streamptr->curTsID = 0;
+
+  extScanTimestep1(streamID);
+ 
+  if ( streamptr->ntsteps == -1 ) status = extScanTimestep2(streamID);
+
+  fileSetPos(fileID, 0, SEEK_SET);
+
+  return (status);
+}
+
+static
+int extScanTimestep(int streamID)
+{
+  int header[4];
+  int status;
+  int fileID;
+  int tsID;
+  // int rxysize = 0;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  long recsize = 0;
+  off_t recpos = 0;
+  int recID;
+  taxis_t *taxis;
+  int rindex, nrecs = 0;
+  extcompvar_t compVar, compVar0;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( CDI_Debug )
+    {
+      Message("streamID = %d", streamID);
+      Message("cts = %d", streamptr->curTsID);
+      Message("rts = %d", streamptr->rtsteps);
+      Message("nts = %d", streamptr->ntsteps);
+    }
+
+  if ( streamptr->rtsteps == 0 )
+    Error("Internal problem! Missing contents.");
+
+  extp  = streamptr->record->extp;
+  tsID  = streamptr->rtsteps;
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->tsteps[tsID].recordSize == 0 )
+    {
+      cdiCreateRecords(streamID, tsID);
+
+      nrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->tsteps[tsID].nrecs = nrecs;
+      streamptr->tsteps[tsID].recIDs = (int *) malloc(nrecs*sizeof(int));
+      for ( recID = 0; recID < nrecs; recID++ )
+	streamptr->tsteps[tsID].recIDs[recID] = streamptr->tsteps[1].recIDs[recID];
+
+      fileID = streamInqFileID(streamID);
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+      for ( rindex = 0; rindex <= nrecs; rindex++ )
+	{
+	  recpos = fileGetPos(fileID);
+	  status = extRead(fileID, extp);
+	  if ( status != 0 )
+	    {
+	      streamptr->ntsteps = streamptr->rtsteps + 1;
+	      break;
+	    }
+	  recsize = fileGetPos(fileID) - recpos;
+
+	  extInqHeader(extp, header);
+
+	  vdate  = header[0];
+	  vtime  = 0;
+	  rcode  = header[1];
+	  rlevel = header[2];
+	  // rxysize = header[3];
+
+	  param = cdiEncodeParam(rcode, 255, 255);
+
+	  // if ( rindex == nrecs ) break; gcc-4.5 internal compiler error
+	  if ( rindex == nrecs ) continue;
+	  recID = streamptr->tsteps[tsID].recIDs[rindex];
+
+	  if ( rindex == 0 )
+	    {
+	      taxis->type  = TAXIS_ABSOLUTE;
+	      taxis->vdate = vdate;
+	      taxis->vtime = vtime;
+	    }
+	  /*
+	  extCmpRecord(streamID, tsID, nrecs, recpos, param, rlevel, rxysize);
+	  */
+	  compVar.param  = param;
+          compVar.level  = rlevel;
+	  compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(extcompvar_t)) != 0 )
+	    {
+	      Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		      tsID, recID,
+		      streamptr->tsteps[tsID].records[recID].param, param,
+		      streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	      Error("Invalid, unsupported or inconsistent record structure");
+	    }
+
+	  streamptr->tsteps[tsID].records[recID].position = recpos;
+	  streamptr->tsteps[tsID].records[recID].size = recsize;
+
+	  if ( CDI_Debug )
+	    Message("%4d%8d%4d%8d%8d%6d", rindex, (int)recpos, rcode, rlevel, vdate, vtime);
+	}
+
+      streamptr->rtsteps++;
+
+      if ( streamptr->ntsteps != streamptr->rtsteps )
+	{
+	  tsID = tstepsNewEntry(streamID);
+	  if ( tsID != streamptr->rtsteps )
+	    Error("Internal error. tsID = %d", tsID);
+
+	  streamptr->tsteps[tsID-1].next   = 1;
+	  streamptr->tsteps[tsID].position = recpos;
+	}
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( nrecs > 0 && nrecs < streamptr->tsteps[tsID].nrecs )
+    {
+      Warning("Incomplete timestep. Stop scanning at timestep %d.", tsID);
+      streamptr->ntsteps = tsID;
+    }
+
+  return (streamptr->ntsteps);
+}
+
+
+int extInqTimestep(int streamID, int tsID)
+{
+  int ntsteps, nrecs;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( tsID == 0 && streamptr->rtsteps == 0 )
+    Error("Call to cdiInqContents missing!");
+
+  if ( CDI_Debug )
+    Message("tsID = %d rtsteps = %d", tsID, streamptr->rtsteps);
+  
+  ntsteps = UNDEFID;
+  while ( ( tsID + 1 ) > streamptr->rtsteps && ntsteps == UNDEFID )
+    ntsteps = extScanTimestep(streamID);
+
+  if ( tsID >= streamptr->ntsteps && streamptr->ntsteps != CDI_UNDEFID )
+    {
+      nrecs = 0;
+    }
+  else
+    {
+      streamptr->curTsID = tsID;
+      nrecs = streamptr->tsteps[tsID].nrecs;
+    }
+
+  return (nrecs);
+}
+
+
+void extReadVarDP(int streamID, int varID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int levID, nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int header[4];
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  extp     = streamptr->record->extp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  for (levID = 0; levID < nlevs; levID++)
+    {
+      recID = streamptr->vars[varID].level[levID];
+      recpos = streamptr->tsteps[tsid].records[recID].position;
+      fileSetPos(fileID, recpos, SEEK_SET);
+      extRead(fileID, extp);
+      extInqHeader(extp, header);
+      extInqDataDP(extp, &data[levID*gridsize]);
+    }
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  if ( vlistInqVarNumber(vlistID, varID) == CDI_REAL )
+    {
+      for ( i = 0; i < nlevs*gridsize; i++ )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+  else
+    {
+      for ( i = 0; i < 2*nlevs*gridsize; i+=2 )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+}
+
+
+void extReadVarSliceDP(int streamID, int varID, int levID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int header[4];
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  extp     = streamptr->record->extp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d",
+	     nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  recID = streamptr->vars[varID].level[levID];
+  recpos = streamptr->tsteps[tsid].records[recID].position;
+  fileSetPos(fileID, recpos, SEEK_SET);
+  extRead(fileID, extp);
+  extInqHeader(extp, header);
+  extInqDataDP(extp, data);
+ 
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  if ( vlistInqVarNumber(vlistID, varID) == CDI_REAL )
+    {
+      for ( i = 0; i < gridsize; i++ )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+  else
+    {
+      for ( i = 0; i < 2*gridsize; i+=2 )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+}
+
+
+void extWriteVarDP(int streamID, int varID, const double *data)
+{
+  int fileID;
+  int levID, nlevs, gridID, gridsize;
+  int zaxisID;
+  double level;
+  int header[4];
+  int tsID;
+  int vlistID;
+  int pdis, pcat, pnum;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  extp     = streamptr->record->extp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  nlevs    = zaxisInqSize(zaxisID);
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
+
+  header[0] = streamptr->tsteps[tsID].taxis.vdate;
+  header[1] = pnum;
+  header[3] = gridInqSize(gridID);
+
+  extDefDatatype(vlistInqVarDatatype(vlistID, varID), &extp->prec, &extp->number);
+
+  for ( levID = 0;  levID < nlevs; levID++ )
+    {
+      level = zaxisInqLevel(zaxisID, levID);
+
+      header[2] = (int) level;
+      extDefHeader(extp, header);
+      extDefDataDP(extp, &data[levID*gridsize]);
+      extWrite(fileID, extp);
+    }
+}
+
+
+void extWriteVarSliceDP(int streamID, int varID, int levID, const double *data)
+{
+  int fileID;
+  int gridID;
+  int zaxisID;
+  double level;
+  int header[4];
+  int tsID;
+  int vlistID;
+  int pdis, pcat, pnum;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  extp     = streamptr->record->extp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  level    = zaxisInqLevel(zaxisID, levID);
+
+  if ( CDI_Debug )
+    Message("gridID = %d zaxisID = %d", gridID, zaxisID);
+
+  cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
+
+  header[0] = streamptr->tsteps[tsID].taxis.vdate;
+  header[1] = pnum;
+  header[2] = (int) level;
+  header[3] = gridInqSize(gridID);
+
+  extDefDatatype(vlistInqVarDatatype(vlistID, varID), &extp->prec, &extp->number);
+
+  extDefHeader(extp, header);
+  extDefDataDP(extp, data);
+  extWrite(fileID, extp);
+}
+
+#endif /* HAVE_LIBEXTRA */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+#include <math.h>
+
+
+
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+#define SINGLE_PRECISION  4
+#define DOUBLE_PRECISION  8
+
+#if defined (HAVE_LIBIEG)
+
+
+typedef struct {
+  int param;
+  int level;
+} IEGCOMPVAR; 
+
+
+int iegInqDatatype(int prec)
+{
+  int datatype;
+
+  if ( prec == DOUBLE_PRECISION ) datatype = DATATYPE_FLT64;
+  else                            datatype = DATATYPE_FLT32;
+
+  return (datatype);
+}
+
+
+int iegDefDatatype(int datatype)
+{
+  int prec;
+
+  if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    Error("CDI/IEG library does not support complex numbers!");
+
+  if ( datatype != DATATYPE_FLT32 && datatype != DATATYPE_FLT64 )
+    datatype = DATATYPE_FLT32;
+
+  if ( datatype == DATATYPE_FLT64 ) prec = DOUBLE_PRECISION;
+  else                              prec = SINGLE_PRECISION;
+
+  return (prec);
+}
+
+/* not used
+int iegInqRecord(int streamID, int *varID, int *levelID)
+{
+  int status;
+  int fileID;
+  int icode, ilevel;
+  int zaxisID = -1;
+  int vlistID;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  iegp    = streamptr->record->iegp;
+
+  *varID   = -1;
+  *levelID = -1;
+
+  status = iegRead(fileID, iegp);
+  if ( status != 0 ) return (0);
+
+  icode  = IEG_P_Parameter(iegp->ipdb);
+  if ( IEG_P_LevelType(iegp->ipdb) == IEG_LTYPE_HYBRID_LAYER )
+    ilevel = IEG_P_Level1(iegp->ipdb);
+  else
+    ilevel = IEG_P_Level2(iegp->ipdb);
+
+  *varID = vlistInqVarID(vlistID, icode);
+
+  if ( *varID == UNDEFID ) Error("Code %d undefined", icode);
+
+  zaxisID = vlistInqVarZaxis(vlistID, *varID);
+
+  *levelID = zaxisInqLevelID(zaxisID, (double) ilevel);
+  
+  return (1);
+}
+*/
+
+int iegReadRecord(int streamID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int status;
+  int recID, vrecID, tsID;
+  off_t recpos;
+  int varID, gridID;
+  int i, size;
+  double missval;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  tsID    = streamptr->curTsID;
+  vrecID  = streamptr->tsteps[tsID].curRecID;
+  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr->tsteps[tsID].records[recID].position;
+  varID   = streamptr->tsteps[tsID].records[recID].varID;
+  iegp    = streamptr->record->iegp;
+
+  fileSetPos(fileID, recpos, SEEK_SET);
+
+  status = iegRead(fileID, iegp);
+  if ( status != 0 ) return (0);
+
+  iegInqDataDP(iegp, data);
+
+  missval = vlistInqVarMissval(vlistID, varID);
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  size    = gridInqSize(gridID);
+
+  streamptr->numvals += size;
+
+  *nmiss = 0;
+  for ( i = 0; i < size; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+
+  return (1);
+}
+
+static
+int iegGetZaxisType(int iegleveltype)
+{
+  int leveltype = 0;
+
+  switch ( iegleveltype )
+    {
+    case IEG_LTYPE_SURFACE:
+      {
+	leveltype = ZAXIS_SURFACE;
+	break;
+      }
+    case IEG_LTYPE_99:
+    case IEG_LTYPE_ISOBARIC:
+      {
+	leveltype = ZAXIS_PRESSURE;
+	break;
+      }
+    case IEG_LTYPE_HEIGHT:
+      {
+	leveltype = ZAXIS_HEIGHT;
+	break;
+      }
+    case IEG_LTYPE_ALTITUDE:
+      {
+	leveltype = ZAXIS_ALTITUDE;
+	break;
+      }
+    case IEG_LTYPE_HYBRID:
+    case IEG_LTYPE_HYBRID_LAYER:
+      {
+	leveltype = ZAXIS_HYBRID;
+	break;
+      }
+    case IEG_LTYPE_LANDDEPTH:
+    case IEG_LTYPE_LANDDEPTH_LAYER:
+      {
+	leveltype = ZAXIS_DEPTH_BELOW_LAND;
+	break;
+      }
+    case IEG_LTYPE_SEADEPTH:
+      {
+	leveltype = ZAXIS_DEPTH_BELOW_SEA;
+	break;
+      }
+    default:
+      {
+	leveltype = ZAXIS_GENERIC;
+	break;
+      }
+    }
+
+  return (leveltype);
+}
+
+
+void iegDefTime(int *pdb, int date, int time, int taxisID)
+{
+  int year, month, day, hour, minute, second;
+  int timetype = -1;
+
+  if ( taxisID != -1 ) timetype = taxisInqType(taxisID);
+
+  if ( timetype == TAXIS_ABSOLUTE || timetype == TAXIS_RELATIVE )
+    {
+      cdiDecodeDate(date, &year, &month, &day);
+      cdiDecodeTime(time, &hour, &minute, &second);
+
+      IEG_P_Year(pdb)     = year;
+      IEG_P_Month(pdb)    = month;
+      IEG_P_Day(pdb)      = day;
+      IEG_P_Hour(pdb)     = hour;
+      IEG_P_Minute(pdb)   = minute;
+
+      pdb[15] = 1;
+      pdb[16] = 0;
+      pdb[17] = 0;
+      pdb[18] = 10;
+      pdb[36] = 1;
+    }
+
+  pdb[5] = 128;
+}
+
+static
+void iegDefGrid(int *gdb, int gridID)
+{
+  int gridtype;
+
+  gridtype = gridInqType(gridID);
+
+  if ( gridtype == GRID_GENERIC )
+    {
+      int xsize, ysize;
+
+      xsize = gridInqXsize(gridID);
+      ysize = gridInqYsize(gridID);
+
+      if ( (ysize == 32  || ysize == 48 || ysize == 64 ||
+	    ysize == 96  || ysize == 160) && 
+	   (xsize == 2*ysize || xsize == 1) )
+	{
+	  gridtype = GRID_GAUSSIAN;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( (xsize == 1 && ysize == 1) || (xsize == 0 && ysize == 0) )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( gridInqXvals(gridID, NULL) && gridInqYvals(gridID, NULL) )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+    }
+  else if ( gridtype == GRID_CURVILINEAR )
+    {
+      gridtype = GRID_LONLAT;
+    }
+
+  if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN )
+    {
+      int nlon, nlat;
+      double xfirst = 0, xlast = 0, xinc = 0;
+      double yfirst = 0, ylast = 0, yinc = 0;
+
+      nlon = (int) gridInqXsize(gridID);
+      nlat = (int) gridInqYsize(gridID);
+
+      if ( nlon == 0 )
+	{
+	  nlon = 1;
+	}
+      else
+	{
+	  xfirst = gridInqXval(gridID,      0);
+	  xlast  = gridInqXval(gridID, nlon-1);
+	  xinc   = gridInqXinc(gridID);
+	}
+
+      if ( nlat == 0 )
+	{
+	  nlat = 1;
+	}
+      else
+	{
+	  yfirst = gridInqYval(gridID,      0);
+	  ylast  = gridInqYval(gridID, nlat-1);
+	  yinc   = gridInqYinc(gridID);
+	}
+
+      if ( gridtype == GRID_GAUSSIAN )
+	IEG_G_GridType(gdb) = 4;
+      else if ( gridtype == GRID_LONLAT && gridIsRotated(gridID) )
+	IEG_G_GridType(gdb) = 10;
+      else
+	IEG_G_GridType(gdb) = 0;
+
+      IEG_G_NumLon(gdb)   = nlon;
+      IEG_G_NumLat(gdb)   = nlat;
+      IEG_G_FirstLat(gdb) = NINT(yfirst*1000);
+      IEG_G_LastLat(gdb)  = NINT(ylast*1000);
+      IEG_G_FirstLon(gdb) = NINT(xfirst*1000);
+      IEG_G_LastLon(gdb)  = NINT(xlast*1000);
+      IEG_G_LonIncr(gdb)  = NINT(xinc*1000);
+      if ( fabs(xinc*1000 - IEG_G_LonIncr(gdb)) > FLT_EPSILON )
+	IEG_G_LonIncr(gdb) = 0;
+
+      if ( gridtype == GRID_GAUSSIAN )
+	IEG_G_LatIncr(gdb) = nlat/2;
+      else
+	{
+	  IEG_G_LatIncr(gdb) = NINT(yinc*1000);
+	  if ( fabs(yinc*1000 - IEG_G_LatIncr(gdb)) > FLT_EPSILON )
+	    IEG_G_LatIncr(gdb) = 0;
+
+	  if ( IEG_G_LatIncr(gdb) < 0 ) IEG_G_LatIncr(gdb) = -IEG_G_LatIncr(gdb);
+	}
+
+      if ( IEG_G_NumLon(gdb) > 1 && IEG_G_NumLat(gdb) == 1 ) 
+	if ( IEG_G_LonIncr(gdb) != 0 && IEG_G_LatIncr(gdb) == 0 ) IEG_G_LatIncr(gdb) = IEG_G_LonIncr(gdb);
+
+      if ( IEG_G_NumLon(gdb) == 1 && IEG_G_NumLat(gdb) > 1 ) 
+	if ( IEG_G_LonIncr(gdb) == 0 && IEG_G_LatIncr(gdb) != 0 ) IEG_G_LonIncr(gdb) = IEG_G_LatIncr(gdb);
+
+      if ( IEG_G_LatIncr(gdb) == 0 || IEG_G_LonIncr(gdb) == 0 )
+	IEG_G_ResFlag(gdb) = 0;
+      else
+	IEG_G_ResFlag(gdb) = 128;
+
+      if ( gridIsRotated(gridID) )
+	{
+	  IEG_G_LatSP(gdb) = - NINT(gridInqYpole(gridID) * 1000);
+	  IEG_G_LonSP(gdb) =   NINT((gridInqXpole(gridID) + 180) * 1000);
+	  IEG_G_Size(gdb)  = 42;
+	}
+      else
+	{
+	  IEG_G_Size(gdb)  = 32;
+	}
+    }
+  else
+    {
+      Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+    }
+
+  IEG_G_ScanFlag(gdb) = 64;
+}
+
+static
+void iegDefLevel(int *pdb, int *gdb, double *vct, int zaxisID, int levelID)
+{
+  double level;
+  int ilevel, leveltype;
+  static int warning = 1;
+  static int vct_warning = 1;
+
+  leveltype = zaxisInqType(zaxisID);
+
+  if ( leveltype == ZAXIS_GENERIC )
+    {
+      Message("Changed zaxis type from %s to %s",
+	      zaxisNamePtr(leveltype),
+	      zaxisNamePtr(ZAXIS_PRESSURE));
+      leveltype = ZAXIS_PRESSURE;
+      zaxisChangeType(zaxisID, leveltype);
+      zaxisDefUnits(zaxisID, "Pa");
+    }
+
+  /*  IEG_G_NumVCP(gdb) = 0; */
+
+  switch (leveltype)
+    {
+    case ZAXIS_SURFACE:
+      {
+	IEG_P_LevelType(pdb) = IEG_LTYPE_SURFACE;
+	IEG_P_Level1(pdb)    = 0;
+	IEG_P_Level2(pdb)    = (int) zaxisInqLevel(zaxisID, levelID);
+	break;
+      }
+    case ZAXIS_HYBRID:
+      {
+	int vctsize;
+
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_HYBRID_LAYER;
+	    IEG_P_Level1(pdb)    = (int) zaxisInqLbound(zaxisID, levelID);
+	    IEG_P_Level2(pdb)    = (int) zaxisInqUbound(zaxisID, levelID);
+	  }
+	else
+	  {
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_HYBRID;
+	    IEG_P_Level1(pdb)    = 0;
+	    IEG_P_Level2(pdb)    = (int) zaxisInqLevel(zaxisID, levelID);
+	  }
+
+	vctsize = zaxisInqVctSize(zaxisID);
+	if ( vctsize == 0 && warning )
+	  {
+	    Warning("VCT missing. ( code = %d, zaxisID = %d )",
+		    IEG_P_Parameter(pdb), zaxisID);
+	    warning = 0;
+	  }
+	if ( vctsize > 100 )
+	  {
+	    /*	    IEG_G_NumVCP(gdb) = 0; */
+	    if ( vct_warning )
+	      {
+		Warning("VCT size of %d is too large (maximum is 100). Set to 0!", vctsize);
+		vct_warning = 0;
+	      }
+	  }
+	else
+	  {
+	    IEG_G_Size(gdb) += (vctsize*4);
+	    memcpy(vct, zaxisInqVctPtr(zaxisID), vctsize/2*sizeof(double));
+	    memcpy(vct+50, zaxisInqVctPtr(zaxisID)+vctsize/2, vctsize/2*sizeof(double));
+	  }
+	break;
+      }
+    case ZAXIS_PRESSURE:
+      {
+	double dum;
+	char units[128];
+
+	level = zaxisInqLevel(zaxisID, levelID);
+	if ( level < 0 )
+	  Warning("pressure level of %f Pa is below 0.", level);
+
+	zaxisInqUnits(zaxisID, units);
+	if ( memcmp(units, "hPa", 3) == 0 || memcmp(units, "mb",2 ) == 0 )
+	  level = level*100;
+
+	ilevel = (int) level;
+	if ( level < 32768 && (level < 100 || modf(level/100, &dum) > 0) )
+	  {
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_99;
+	    IEG_P_Level1(pdb)    = 0;
+	    IEG_P_Level2(pdb)    = ilevel;
+	  }
+	else
+	  {
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_ISOBARIC;
+	    IEG_P_Level1(pdb)    = 0;
+	    IEG_P_Level2(pdb)    = ilevel/100;
+	  }
+	break;
+      }
+    case ZAXIS_HEIGHT:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	IEG_P_LevelType(pdb) = IEG_LTYPE_HEIGHT;
+	IEG_P_Level1(pdb)    = 0;
+	IEG_P_Level2(pdb)    = ilevel;
+
+	break;
+      }
+    case ZAXIS_ALTITUDE:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	IEG_P_LevelType(pdb) = IEG_LTYPE_ALTITUDE;
+	IEG_P_Level1(pdb)    = 0;
+	IEG_P_Level2(pdb)    = ilevel;
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_LAND:
+      {
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_LANDDEPTH_LAYER;
+	    IEG_P_Level1(pdb)    = (int) zaxisInqLbound(zaxisID, levelID);
+	    IEG_P_Level2(pdb)    = (int) zaxisInqUbound(zaxisID, levelID);
+	  }
+	else
+	  {
+	    level = zaxisInqLevel(zaxisID, levelID);
+
+	    ilevel = (int) level;
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_LANDDEPTH;
+	    IEG_P_Level1(pdb)    = 0;
+	    IEG_P_Level2(pdb)    = ilevel;
+	  }
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_SEA:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	IEG_P_LevelType(pdb) = IEG_LTYPE_SEADEPTH;
+	IEG_P_Level1(pdb)    = 0;
+	IEG_P_Level2(pdb)    = ilevel;
+
+	break;
+      }
+    case ZAXIS_ISENTROPIC:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	IEG_P_LevelType(pdb) = 113;
+	IEG_P_Level1(pdb)    = 0;
+	IEG_P_Level2(pdb)    = ilevel;
+
+	break;
+      }
+    default:
+      {
+	Error("Unsupported zaxis type: %s", zaxisNamePtr(leveltype));
+	break;
+      }
+    }
+}
+
+
+int iegCopyRecord(int streamID2, int streamID1)
+{
+  int fileID1, fileID2;
+  int tsID, recID, vrecID;
+  long recsize;
+  off_t recpos;
+  int status = 0;
+  char *buffer;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  fileID1 = streamInqFileID(streamID1);
+  fileID2 = streamInqFileID(streamID2);
+
+  tsID    = streamptr1->curTsID;
+  vrecID  = streamptr1->tsteps[tsID].curRecID;
+  recID   = streamptr1->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr1->tsteps[tsID].records[recID].position;
+  recsize = streamptr1->tsteps[tsID].records[recID].size;
+
+  fileSetPos(fileID1, recpos, SEEK_SET);
+
+  buffer = (char *) malloc(recsize);
+
+  fileRead(fileID1, buffer, recsize);
+
+  fileWrite(fileID2, buffer, recsize);
+
+  free(buffer);
+
+  return (status);
+}
+
+
+int iegDefRecord(int streamID)
+{
+  int status = 0;
+  int vlistID;
+  int gridID;
+  int date, time;
+  int datatype;
+  int i;
+  int param, pdis, pcat, pnum;
+  int varID, levelID, tsID, zaxisID;
+  int byteorder;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  iegp    = streamptr->record->iegp;
+  byteorder = streamptr->byteorder;
+
+  varID   = streamptr->record->varID;
+  levelID = streamptr->record->levelID;
+  tsID    = streamptr->curTsID;
+
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  zaxisID = vlistInqVarZaxis(vlistID, varID);
+  
+  iegInitMem(iegp);
+  for ( i = 0; i < 37; i++ ) iegp->ipdb[i] = -1;
+
+  iegp->byteswap = getByteswap(byteorder);
+
+  param =  vlistInqVarParam(vlistID, varID);
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+  IEG_P_Parameter(iegp->ipdb) = pnum;
+  if ( pdis == 255 ) IEG_P_CodeTable(iegp->ipdb) = pcat;
+  date     = streamptr->tsteps[tsID].taxis.vdate;
+  time     = streamptr->tsteps[tsID].taxis.vtime;
+
+  iegDefTime(iegp->ipdb, date, time, vlistInqTaxis(vlistID));
+  iegDefGrid(iegp->igdb, gridID);
+  iegDefLevel(iegp->ipdb, iegp->igdb, iegp->vct, zaxisID, levelID);
+
+  datatype = streamptr->record->prec;
+
+  iegp->dprec = iegDefDatatype(datatype);
+
+  return (status);
+}
+
+
+int iegWriteRecord(int streamID, const double *data)
+{
+  int fileID;
+  int status = 0;
+  int i, gridsize, gridID;
+  double refval;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+  iegp   = streamptr->record->iegp;
+  gridID = streamptr->record->gridID;
+  
+  gridsize = gridInqSize(gridID);
+
+  refval = data[0];
+  for ( i = 1; i < gridsize; i++ )
+    if ( data[i] < refval ) refval = data[i];
+
+  iegp->refval = refval;
+
+  iegDefDataDP(iegp, data);
+
+  iegWrite(fileID, iegp);
+
+  return (status);
+}
+
+static
+void iegAddRecord(int streamID, int param, int *pdb, int *gdb, double *vct,
+		  long recsize, off_t position, int prec)
+{
+  int leveltype;
+  int gridID = UNDEFID;
+  int levelID = 0;
+  int tsID, recID, varID;
+  int datatype;
+  int level1, level2;
+  int gridtype;
+  int lbounds = 0;
+  record_t *record;
+  grid_t grid;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  tsID    = streamptr->curTsID;
+  recID   = recordNewEntry(streamID, tsID);
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  if ( IEG_P_LevelType(pdb) == IEG_LTYPE_HYBRID_LAYER )
+    {
+      level1 = IEG_P_Level1(pdb);
+      level2 = IEG_P_Level2(pdb);
+    }
+  else
+    {
+      level1 = IEG_P_Level2(pdb);
+      level2 = 0;
+      if ( IEG_P_LevelType(pdb) == 100 ) level1 *= 100;
+    }
+
+  (*record).size     = recsize;
+  (*record).position = position;
+  (*record).param    = param;
+  (*record).ilevel   = level1;
+  (*record).ilevel2  = level2;
+  (*record).ltype    = IEG_P_LevelType(pdb);
+
+  if ( IEG_G_GridType(gdb) == 0 || IEG_G_GridType(gdb) == 10 )
+    gridtype = GRID_LONLAT;
+  else if ( IEG_G_GridType(gdb) == 4 )
+    gridtype = GRID_GAUSSIAN;
+  else
+    gridtype = GRID_GENERIC;
+
+  memset(&grid, 0, sizeof(grid_t));
+  grid.type  = gridtype; 
+  grid.size  = IEG_G_NumLon(gdb)*IEG_G_NumLat(gdb);
+  grid.xsize = IEG_G_NumLon(gdb);
+  grid.ysize = IEG_G_NumLat(gdb);
+  grid.xinc  = 0;
+  grid.yinc  = 0;
+  grid.xdef  = 0;
+  /* if ( IEG_G_FirstLon != 0 || IEG_G_LastLon != 0 ) */
+  {
+    if ( grid.xsize > 1 )
+      {
+	if ( IEG_G_ResFlag(gdb) && IEG_G_LonIncr(gdb) > 0 )
+	  grid.xinc = IEG_G_LonIncr(gdb) * 0.001;
+	else
+	  grid.xinc = (IEG_G_LastLon(gdb) - IEG_G_FirstLon(gdb)) * 0.001 / (grid.xsize - 1);
+
+	/* correct xinc if necessary */
+	if ( IEG_G_FirstLon(gdb) == 0 && IEG_G_LastLon(gdb) > 354000 )
+	  {
+	    double xinc = 360. / grid.xsize;
+	    
+	    if ( fabs(grid.xinc-xinc) > 0.0 )
+	      {
+		grid.xinc = xinc;
+		if ( CDI_Debug ) Message("set xinc to %g", grid.xinc);
+	      }
+	  }
+      }
+    grid.xfirst = IEG_G_FirstLon(gdb) * 0.001;
+    grid.xlast  = IEG_G_LastLon(gdb)  * 0.001;
+    grid.xdef   = 2;	    
+  }
+  grid.ydef  = 0;
+  /* if ( IEG_G_FirstLat != 0 || IEG_G_LastLat != 0 ) */
+  {
+    if ( grid.ysize > 1 )
+      {
+	if ( IEG_G_ResFlag(gdb) && IEG_G_LatIncr(gdb) > 0 )
+	  grid.yinc = IEG_G_LatIncr(gdb) * 0.001;
+	else
+	  grid.yinc = (IEG_G_LastLat(gdb) - IEG_G_FirstLat(gdb)) * 0.001 / (grid.ysize - 1);
+      }
+    grid.yfirst = IEG_G_FirstLat(gdb) * 0.001;
+    grid.ylast  = IEG_G_LastLat(gdb)  * 0.001;
+    grid.ydef   = 2;	    
+  }
+  /*
+  grid.xfirst= IEG_G_FirstLon(gdb) * 0.001;
+  grid.xlast = IEG_G_LastLon(gdb) * 0.001;
+  grid.xinc  = IEG_G_LonIncr(gdb) * 0.001;
+  grid.xdef  = 2;	    
+  grid.yfirst= IEG_G_FirstLat(gdb) * 0.001;
+  grid.ylast = IEG_G_LastLat(gdb) * 0.001;
+  grid.yinc  = IEG_G_LatIncr(gdb) * 0.001;
+  grid.ydef  = 2;
+  */
+  grid.xvals = NULL;
+  grid.yvals = NULL;
+
+  grid.isRotated = FALSE;
+  if ( IEG_G_GridType(gdb) == 10 )
+    {
+      grid.isRotated = TRUE;
+      grid.ypole     = - IEG_G_LatSP(gdb) * 0.001;
+      grid.xpole     =   IEG_G_LonSP(gdb) * 0.001 - 180;
+      grid.angle     = 0;
+    }
+
+  gridID = varDefGrid(vlistID, grid, 0);
+
+  leveltype = iegGetZaxisType(IEG_P_LevelType(pdb));
+  
+  if ( leveltype == ZAXIS_HYBRID )
+    {
+      int i;
+      double tmpvct[100];
+      int vctsize = IEG_G_NumVCP(gdb);
+
+      for ( i = 0; i < vctsize/2; i++ ) tmpvct[i] = vct[i];
+      for ( i = 0; i < vctsize/2; i++ ) tmpvct[i+vctsize/2] = vct[i+50];
+
+      varDefVCT(vctsize, tmpvct);
+    }
+
+  if ( IEG_P_LevelType(pdb) == IEG_LTYPE_HYBRID_LAYER ) lbounds = 1;
+
+  datatype = iegInqDatatype(prec);
+
+  varAddRecord(recID, param, gridID, leveltype, lbounds, level1, level2,
+	       datatype, &varID, &levelID, UNDEFID, 0, 0, NULL, NULL, NULL);
+
+  (*record).varID   = varID;
+  (*record).levelID = levelID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+
+  if ( CDI_Debug )
+    Message("varID = %d gridID = %d levelID = %d",
+	    varID, gridID, levelID);
+}
+
+#if 0
+static
+void iegCmpRecord(int streamID, int tsID, int recID, off_t position, int param,
+		  int level, int xsize, int ysize)
+{
+  int varID = 0;
+  int levelID = 0;
+  record_t *record;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  if ( param != (*record).param || level != (*record).ilevel )
+    Error("inconsistent timestep");
+
+  (*record).position = position;
+  /*
+  varID   = (*record).varID;
+  levelID = (*record).levelID;
+
+  streamptr->vars[varID].level[levelID] = recID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+  */
+  if ( CDI_Debug )
+    Message("varID = %d levelID = %d", varID, levelID);
+}
+#endif
+
+void iegDateTime(int *pdb, int *date, int *time)
+{
+  int ryear, rmonth, rday, rhour, rminute;
+
+  ryear   = IEG_P_Year(pdb);
+
+  rmonth  = IEG_P_Month(pdb);
+  rday    = IEG_P_Day(pdb);
+
+  rhour   = IEG_P_Hour(pdb);
+  rminute = IEG_P_Minute(pdb);
+
+  if ( rminute == -1 ) rminute = 0;
+
+  *date = cdiEncodeDate(ryear, rmonth, rday);
+  *time = cdiEncodeTime(rhour, rminute, 0);
+}
+
+static
+void iegScanTimestep1(int streamID)
+{  
+  int prec = 0;
+  int status;
+  int fileID;
+  int tabnum;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos;
+  int nrecords, nrecs, recID;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  IEGCOMPVAR compVar, compVar0;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 0;
+
+  iegp  = streamptr->record->iegp;
+  tsID  = tstepsNewEntry(streamID);
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( tsID != 0 )
+    Error("Internal problem! tstepsNewEntry returns %d", tsID);
+
+  fileID = streamInqFileID(streamID);
+
+  nrecs = 0;
+  while ( TRUE )
+    {
+      recpos = fileGetPos(fileID);
+      status = iegRead(fileID, iegp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 1;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      prec   = iegp->dprec;
+      rcode  = IEG_P_Parameter(iegp->ipdb);
+      tabnum = IEG_P_CodeTable(iegp->ipdb);
+      param  = cdiEncodeParam(rcode, tabnum, 255);
+
+      if ( IEG_P_LevelType(iegp->ipdb) == IEG_LTYPE_HYBRID_LAYER )
+	rlevel = IEG_P_Level1(iegp->ipdb);
+      else
+	rlevel = IEG_P_Level2(iegp->ipdb);
+
+      if ( IEG_P_LevelType(iegp->ipdb) == 100 ) rlevel *= 100;
+
+      iegDateTime(iegp->ipdb, &vdate, &vtime);
+
+      if ( nrecs == 0 )
+	{
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	}
+      else
+	{
+	  datetime.date = vdate;
+	  datetime.time = vtime;
+	  compVar.param = param;
+          compVar.level = rlevel;
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      compVar0.param = streamptr->tsteps[0].records[recID].param;
+	      compVar0.level = streamptr->tsteps[0].records[recID].ilevel;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(IEGCOMPVAR)) == 0 ) break;
+	    }
+	  if ( recID < nrecs ) break;
+	  if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) )
+	    Warning("Inconsistent verification time for param %d level %d", param, rlevel);
+	}
+
+      nrecs++;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", nrecs, (int)recpos, param, rlevel, vdate, vtime);
+
+      iegAddRecord(streamID, param, iegp->ipdb, iegp->igdb, iegp->vct, recsize, recpos, prec);
+    }
+
+  streamptr->rtsteps = 1;
+
+  cdiGenVars(streamID);
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+  taxis->type  = TAXIS_ABSOLUTE;
+  taxis->vdate = datetime0.date;
+  taxis->vtime = datetime0.time;
+
+  vlistID = streamInqVlist(streamID);
+  vlistDefTaxis(vlistID, taxisID);
+
+  cdiCheckContents(streamID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  if ( nrecords < streamptr->tsteps[0].recordSize )
+    {
+      streamptr->tsteps[0].recordSize = nrecords;
+      streamptr->tsteps[0].records =
+	(record_t *) realloc(streamptr->tsteps[0].records, nrecords*sizeof(record_t));
+    }
+
+  streamptr->tsteps[0].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[0].nrecs = nrecords;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[0].recIDs[recID] = recID;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( streamptr->ntsteps == 1 )
+    {
+      if ( taxis->vdate == 0 && taxis->vtime == 0 )
+	{
+	  streamptr->ntsteps = 0;
+	  for ( varID = 0; varID < streamptr->nvars; varID++ )
+	    {
+	      vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	    }
+	}
+    }
+}
+
+static
+int iegScanTimestep2(int streamID)
+{  
+  int status;
+  int fileID;
+  int tabnum;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos = 0;
+  int nrecords, nrecs, recID, rindex;
+  int nextstep;
+  taxis_t *taxis;
+  int vlistID;
+  IEGCOMPVAR compVar, compVar0;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 1;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  iegp    = streamptr->record->iegp;
+
+  tsID = streamptr->rtsteps;
+  if ( tsID != 1 )
+    Error("Internal problem! unexpeceted timestep %d", tsID+1);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+  cdiCreateRecords(streamID, tsID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[1].nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[1].recIDs[recID] = -1;
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID = streamptr->tsteps[0].records[recID].varID;
+      streamptr->tsteps[tsID].records[recID].position = 
+	streamptr->tsteps[0].records[recID].position;
+      streamptr->tsteps[tsID].records[recID].size     = 
+	streamptr->tsteps[0].records[recID].size;
+    }
+
+  for ( rindex = 0; rindex <= nrecords; rindex++ )
+    {
+      recpos = fileGetPos(fileID);
+      status = iegRead(fileID, iegp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 2;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      rcode  = IEG_P_Parameter(iegp->ipdb);
+      tabnum = IEG_P_CodeTable(iegp->ipdb);
+      param  = cdiEncodeParam(rcode, tabnum, 255);
+
+      if ( IEG_P_LevelType(iegp->ipdb) == IEG_LTYPE_HYBRID_LAYER )
+	rlevel = IEG_P_Level1(iegp->ipdb);
+      else
+	rlevel = IEG_P_Level2(iegp->ipdb);
+
+      if ( IEG_P_LevelType(iegp->ipdb) == 100 ) rlevel *= 100;
+
+      iegDateTime(iegp->ipdb, &vdate, &vtime);
+
+      if ( rindex == 0 )
+	{
+	  taxis->type  = TAXIS_ABSOLUTE;
+	  taxis->vdate = vdate;
+	  taxis->vtime = vtime;
+	}
+
+      compVar.param = param;
+      compVar.level = rlevel;
+      nextstep = FALSE;
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(IEGCOMPVAR)) == 0 )
+	    {
+	      if ( streamptr->tsteps[tsID].records[recID].used )
+		{
+		  nextstep = TRUE;
+		}
+	      else
+		{
+		  streamptr->tsteps[tsID].records[recID].used = TRUE;
+		  streamptr->tsteps[tsID].recIDs[rindex] = recID;
+		}
+	      break;
+	    }
+	}
+      if ( recID == nrecords )
+	{
+	  char paramstr[32];
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+	  Warning("param %s level %d not defined at timestep 1", paramstr, rlevel);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      if ( nextstep ) break;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", rindex+1, (int)recpos, param, rlevel, vdate, vtime);
+
+      streamptr->tsteps[tsID].records[recID].size = recsize;
+
+      compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+      compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+      if ( memcmp(&compVar0, &compVar, sizeof(IEGCOMPVAR)) != 0 )
+	{
+	  Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		  tsID, recID,
+		  streamptr->tsteps[tsID].records[recID].param, param,
+		  streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->tsteps[1].records[recID].position = recpos;
+    }
+
+  nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      if ( ! streamptr->tsteps[tsID].records[recID].used )
+	{
+	  varID = streamptr->tsteps[tsID].records[recID].varID;
+          vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	}
+      else
+	{
+	  nrecs++;
+	}
+    }
+  streamptr->tsteps[tsID].nrecs = nrecs;
+
+  streamptr->rtsteps = 2;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  return (0);
+}
+
+
+int iegInqContents(int streamID)
+{
+  int fileID;
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+
+  streamptr->curTsID = 0;
+
+  iegScanTimestep1(streamID);
+ 
+  if ( streamptr->ntsteps == -1 ) status = iegScanTimestep2(streamID);
+
+  fileSetPos(fileID, 0, SEEK_SET);
+
+  return (status);
+}
+
+static
+int iegScanTimestep(int streamID)
+{
+  int status;
+  int fileID;
+  int tsID;
+  int tabnum;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  long recsize = 0;
+  off_t recpos = 0;
+  int recID;
+  taxis_t *taxis;
+  int rindex, nrecs = 0;
+  IEGCOMPVAR compVar, compVar0;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( CDI_Debug )
+    {
+      Message("streamID = %d", streamID);
+      Message("cts = %d", streamptr->curTsID);
+      Message("rts = %d", streamptr->rtsteps);
+      Message("nts = %d", streamptr->ntsteps);
+    }
+
+  if ( streamptr->rtsteps == 0 )
+    Error("Internal problem! Missing contents.");
+
+  iegp  = streamptr->record->iegp;
+  tsID  = streamptr->rtsteps;
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->tsteps[tsID].recordSize == 0 )
+    {
+      cdiCreateRecords(streamID, tsID);
+
+      nrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->tsteps[tsID].nrecs = nrecs;
+      streamptr->tsteps[tsID].recIDs = (int *) malloc(nrecs*sizeof(int));
+      for ( recID = 0; recID < nrecs; recID++ )
+	streamptr->tsteps[tsID].recIDs[recID] = streamptr->tsteps[1].recIDs[recID];
+
+      fileID = streamInqFileID(streamID);
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+      for ( rindex = 0; rindex <= nrecs; rindex++ )
+	{
+	  recpos = fileGetPos(fileID);
+	  status = iegRead(fileID, iegp);
+	  if ( status != 0 )
+	    {
+	      streamptr->ntsteps = streamptr->rtsteps + 1;
+	      break;
+	    }
+	  recsize = fileGetPos(fileID) - recpos;
+
+	  rcode  = IEG_P_Parameter(iegp->ipdb);
+	  tabnum = IEG_P_CodeTable(iegp->ipdb);
+	  param  = cdiEncodeParam(rcode, tabnum, 255);
+
+	  if ( IEG_P_LevelType(iegp->ipdb) == IEG_LTYPE_HYBRID_LAYER )
+	    rlevel = IEG_P_Level1(iegp->ipdb);
+	  else
+	    rlevel = IEG_P_Level2(iegp->ipdb);
+
+	  if ( IEG_P_LevelType(iegp->ipdb) == 100 ) rlevel *= 100;
+
+	  iegDateTime(iegp->ipdb, &vdate, &vtime);
+
+	  // if ( rindex == nrecs ) break; gcc-4.5 internal compiler error
+	  if ( rindex == nrecs ) continue;
+	  recID = streamptr->tsteps[tsID].recIDs[rindex];
+
+	  if ( rindex == 0 )
+	    {
+	      taxis->type  = TAXIS_ABSOLUTE;
+	      taxis->vdate = vdate;
+	      taxis->vtime = vtime;
+	    }
+
+	  compVar.param = param;
+          compVar.level = rlevel;
+	  compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(IEGCOMPVAR)) != 0 )
+	    {
+	      Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		      tsID, recID,
+		      streamptr->tsteps[tsID].records[recID].param, param,
+		      streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	      Error("Invalid, unsupported or inconsistent record structure");
+	    }
+
+	  streamptr->tsteps[tsID].records[recID].position = recpos;
+	  streamptr->tsteps[tsID].records[recID].size = recsize;
+
+	  if ( CDI_Debug )
+	    Message("%4d%8d%4d%8d%8d%6d", rindex, (int)recpos, param, rlevel, vdate, vtime);
+	}
+
+      streamptr->rtsteps++;
+
+      if ( streamptr->ntsteps != streamptr->rtsteps )
+	{
+	  tsID = tstepsNewEntry(streamID);
+	  if ( tsID != streamptr->rtsteps )
+	    Error("Internal error. tsID = %d", tsID);
+
+	  streamptr->tsteps[tsID-1].next   = 1;
+	  streamptr->tsteps[tsID].position = recpos;
+	}
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( nrecs > 0 && nrecs < streamptr->tsteps[tsID].nrecs )
+    {
+      Warning("Incomplete timestep. Stop scanning at timestep %d.", tsID);
+      streamptr->ntsteps = tsID;
+    }
+
+  return (streamptr->ntsteps);
+}
+
+
+int iegInqTimestep(int streamID, int tsID)
+{
+  int ntsteps, nrecs;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( tsID == 0 && streamptr->rtsteps == 0 )
+    Error("Call to cdiInqContents missing!");
+
+  if ( CDI_Debug )
+    Message("tsID = %d rtsteps = %d", tsID, streamptr->rtsteps);
+  
+  ntsteps = UNDEFID;
+  while ( ( tsID + 1 ) > streamptr->rtsteps && ntsteps == UNDEFID )
+    ntsteps = iegScanTimestep(streamID);
+
+  if ( tsID >= streamptr->ntsteps && streamptr->ntsteps != CDI_UNDEFID )
+    {
+      nrecs = 0;
+    }
+  else
+    {
+      streamptr->curTsID = tsID;
+      nrecs = streamptr->tsteps[tsID].nrecs;
+    }
+
+  return (nrecs);
+}
+
+
+void iegReadVarDP(int streamID, int varID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int levID, nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  iegp     = streamptr->record->iegp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  for (levID = 0; levID < nlevs; levID++)
+    {
+      recID = streamptr->vars[varID].level[levID];
+      recpos = streamptr->tsteps[tsid].records[recID].position;
+      fileSetPos(fileID, recpos, SEEK_SET);
+      iegRead(fileID, iegp);
+      iegInqDataDP(iegp, &data[levID*gridsize]);
+    }
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  for ( i = 0; i < nlevs*gridsize; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+}
+
+
+void iegReadVarSliceDP(int streamID, int varID, int levID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  iegp     = streamptr->record->iegp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d",
+	     nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  recID = streamptr->vars[varID].level[levID];
+  recpos = streamptr->tsteps[tsid].records[recID].position;
+  fileSetPos(fileID, recpos, SEEK_SET);
+  iegRead(fileID, iegp);
+  iegInqDataDP(iegp, data);
+
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  for ( i = 0; i < gridsize; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+}
+
+
+void iegWriteVarDP(int streamID, int varID, const double *data)
+{
+  int fileID;
+  int levID, nlevs, gridID, gridsize;
+  int zaxisID;
+  int datatype;
+  int tsID;
+  int vlistID;
+  int i;
+  int date, time;
+  int param, pdis, pcat, pnum;
+  double refval;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  iegp     = streamptr->record->iegp;
+
+  iegInitMem(iegp);
+  for ( i = 0; i < 37; i++ ) iegp->ipdb[i] = -1;
+
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  nlevs    = zaxisInqSize(zaxisID);
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  param    = vlistInqVarParam(vlistID, varID);
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+  IEG_P_Parameter(iegp->ipdb) = pnum;
+  if ( pdis == 255 ) IEG_P_CodeTable(iegp->ipdb) = pcat;
+  date     = streamptr->tsteps[tsID].taxis.vdate;
+  time     = streamptr->tsteps[tsID].taxis.vtime;
+
+  iegDefTime(iegp->ipdb, date, time, vlistInqTaxis(vlistID));
+  iegDefGrid(iegp->igdb, gridID);
+
+  datatype = vlistInqVarDatatype(vlistID, varID);
+
+  iegp->dprec = iegDefDatatype(datatype);
+
+  for ( levID = 0;  levID < nlevs; levID++ )
+    {
+      iegDefLevel(iegp->ipdb, iegp->igdb, iegp->vct, zaxisID, levID);
+
+      refval = data[0];
+      for ( i = 1; i < gridsize; i++ )
+	if ( data[levID*gridsize+i] < refval ) refval = data[levID*gridsize+i];
+
+      iegp->refval = refval;
+
+      iegDefDataDP(iegp, &data[levID*gridsize]);
+      iegWrite(fileID, iegp);
+    }
+}
+
+
+void iegWriteVarSliceDP(int streamID, int varID, int levID, const double *data)
+{
+  int fileID;
+  int gridID;
+  int zaxisID;
+  /* double level; */
+  int datatype;
+  /* int tsID; */
+  int vlistID;
+  /* int param, date, time, datasize; */
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  iegp     = streamptr->record->iegp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  /* tsID     = streamptr->curTsID; */
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  /* level    = zaxisInqLevel(zaxisID, levID); */
+
+  if ( CDI_Debug )
+    Message("gridID = %d zaxisID = %d", gridID, zaxisID);
+
+  /* param = vlistInqVarParam(vlistID, varID); */
+  /* date = streamptr->tsteps[tsID].taxis.vdate; */
+  /* time = streamptr->tsteps[tsID].taxis.vtime; */
+  /* datasize = gridInqSize(gridID); */
+
+  datatype = vlistInqVarDatatype(vlistID, varID);
+
+  iegp->dprec = iegDefDatatype(datatype);
+
+  iegDefDataDP(iegp, data);
+  iegWrite(fileID, iegp);
+}
+
+#endif /* HAVE_LIBIEG */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+//#define TEST_GROUPS 1
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <math.h>
+#include <float.h>
+
+
+
+
+#if  defined  (HAVE_LIBNETCDF)
+#endif
+
+//#define PROJECTION_TEST
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+
+void cdfDefGlobalAtts(int streamID);
+void cdfDefLocalAtts(int streamID);
+
+
+#define  X_AXIS  1
+#define  Y_AXIS  2
+#define  Z_AXIS  3
+#define  T_AXIS  4
+
+typedef struct {
+  int     ncvarid;
+  int     dimtype;
+  size_t  len;
+  char    name[CDI_MAX_NAME];
+}
+ncdim_t;
+
+typedef struct {
+  int      ncid;
+  int      ignore;
+  int      isvar;
+  int      islon;
+  int      islat;
+  int      islev;
+  int      istime;
+  int      warn;
+  int      tsteptype;
+  int      param;
+  int      code;
+  int      tabnum;
+  int      bounds;
+  int      gridID;
+  int      zaxisID;
+  int      gridtype;
+  int      zaxistype;
+  int      xdim;
+  int      ydim;
+  int      zdim;
+  int      xvarid;
+  int      yvarid;
+  int      zvarid;
+  int      tvarid;
+  int      ncoordvars;
+  int      coordvarids[4];
+  int      cellarea;
+  int      calendar;
+  int      tableID;
+  int      truncation;
+  int      defmiss;
+  int      xtype;
+  int      ndims;
+  int      gmapid;
+  int      positive;
+  int      dimids[8];
+  int      dimtype[8];
+  int      chunks[8];
+  int      chunked;
+  int      chunktype;
+  int      natts;
+  int     *atts;
+  int      deflate;
+  int      lunsigned;
+  int      lvalidrange;
+  size_t   vlen;
+  double  *vdata;
+  double   missval;
+  double   addoffset;
+  double   scalefactor;
+  double   validrange[2];
+  char     name[CDI_MAX_NAME];
+  char     longname[CDI_MAX_NAME];
+  char     stdname[CDI_MAX_NAME];
+  char     units[CDI_MAX_NAME];
+  ensinfo_t   *ensdata;    /* Ensemble information */
+}
+ncvar_t;
+
+#ifdef HAVE_LIBNETCDF
+static
+void strtolower(char *str)
+{
+  int i, len;
+
+  if ( str )
+    {
+      len = (int) strlen(str);
+      for ( i = 0; i < len; i++ )
+        str[i] = tolower((int) str[i]);
+    }
+}
+
+static
+int get_timeunit(int len, char *ptu)
+{
+  int timeunit = -1;
+
+  if ( len > 2 )
+    {
+      if      ( memcmp(ptu, "sec",    3) == 0 )          timeunit = TUNIT_SECOND;
+      else if ( memcmp(ptu, "minute", 6) == 0 )          timeunit = TUNIT_MINUTE;
+      else if ( memcmp(ptu, "hour",   4) == 0 )          timeunit = TUNIT_HOUR;
+      else if ( memcmp(ptu, "day",    3) == 0 )          timeunit = TUNIT_DAY;
+      else if ( memcmp(ptu, "month",  5) == 0 )          timeunit = TUNIT_MONTH;
+      else if ( memcmp(ptu, "calendar_month", 14) == 0 ) timeunit = TUNIT_MONTH;
+      else if ( memcmp(ptu, "year",   4) == 0 )          timeunit = TUNIT_YEAR;
+    }
+  else if ( len == 1 )
+    {
+      if ( ptu[0] == 's' ) timeunit = TUNIT_SECOND;
+    }
+
+  return (timeunit);
+}
+
+static
+int isTimeUnits(const char *timeunits)
+{
+  int len, i;
+  char *ptu, *tu;
+  int timetype = -1;
+  int timeunit;
+  int status = FALSE;
+
+  len = (int) strlen(timeunits);
+  tu = (char *) malloc((len+1)*sizeof(char));
+  memcpy(tu, timeunits, (len+1)*sizeof(char));
+  ptu = tu;
+
+  for ( i = 0; i < len; i++ ) ptu[i] = tolower((int) ptu[i]);
+
+  timeunit = get_timeunit(len, ptu);
+  if ( timeunit != -1 )
+    {
+
+      while ( ! isspace(*ptu) && *ptu != 0 ) ptu++;
+      if ( *ptu )
+        {
+          while ( isspace(*ptu) ) ptu++;
+
+          if ( memcmp(ptu, "as", 2) == 0 )
+            timetype = TAXIS_ABSOLUTE;
+          else if ( memcmp(ptu, "since", 5) == 0 )
+            timetype = TAXIS_RELATIVE;
+
+          if ( timetype != -1 ) status = TRUE;
+        }
+    }
+
+  free(tu);
+
+  return (status);
+}
+
+static
+int splitBasetime(const char *timeunits, taxis_t *taxis)
+{
+  int len, i;
+  char *ptu, *tu;
+  int year, month, day;
+  int hour = 0, minute = 0, second = 0;
+  int timetype = TAXIS_ABSOLUTE;
+  int rdate = -1, rtime = -1;
+  int timeunit;
+
+  len = (int) strlen(timeunits);
+  tu = (char *) malloc((len+1)*sizeof(char));
+  memcpy(tu, timeunits, (len+1)*sizeof(char));
+  ptu = tu;
+
+  for ( i = 0; i < len; i++ ) ptu[i] = tolower((int) ptu[i]);
+
+  timeunit = get_timeunit(len, ptu);
+  if ( timeunit == -1 )
+    {
+      Message("Unsupported TIMEUNIT: %s!", timeunits);
+      return (1);
+    }
+
+  while ( ! isspace(*ptu) && *ptu != 0 ) ptu++;
+  if ( *ptu )
+    {
+      while ( isspace(*ptu) ) ptu++;
+
+      if ( memcmp(ptu, "as", 2) == 0 )
+        timetype = TAXIS_ABSOLUTE;
+      else if ( memcmp(ptu, "since", 5) == 0 )
+        timetype = TAXIS_RELATIVE;
+
+      while ( ! isspace(*ptu) && *ptu != 0 ) ptu++;
+      if ( *ptu )
+        {
+          while ( isspace(*ptu) ) ptu++;
+
+          if ( timetype == TAXIS_ABSOLUTE )
+            {
+              if ( memcmp(ptu, "%y%m%d.%f", 9) != 0 && timeunit == TUNIT_DAY )
+                {
+                  Message("Unsupported format %s for TIMEUNIT day!", ptu);
+                  timeunit = -1;
+                }
+              else if ( memcmp(ptu, "%y%m.%f", 7) != 0 && timeunit == TUNIT_MONTH )
+                {
+                  Message("Unsupported format %s for TIMEUNIT month!", ptu);
+                  timeunit = -1;
+                }
+            }
+          else if ( timetype == TAXIS_RELATIVE )
+            {
+              int v1, v2, v3;
+              v1 = atoi(ptu);
+              if ( v1 < 0 ) ptu++;
+              while ( isdigit((int) *ptu) ) ptu++;
+              v2 = atoi(++ptu);
+              while ( isdigit((int) *ptu) ) ptu++;
+              v3 = atoi(++ptu);
+              while ( isdigit((int) *ptu) ) ptu++;
+
+              if ( v3 > 999 && v1 < 32 )
+                { year = v3; month = v2; day = v1; }
+              else
+                { year = v1; month = v2; day = v3; }
+
+              while ( isspace((int) *ptu) ) ptu++;
+
+              if ( *ptu )
+                {
+                  while ( ! isdigit((int) *ptu) ) ptu++;
+
+                  hour = atoi(ptu);
+                  while ( isdigit((int) *ptu) ) ptu++;
+                  if ( *ptu == ':' )
+                    {
+                      ptu++;
+                      minute = atoi(ptu);
+                      while ( isdigit((int) *ptu) ) ptu++;
+                      if ( *ptu == ':' )
+                        {
+                          ptu++;
+                          second = atoi(ptu);
+                          /*
+                          if ( second != 0 )
+                            Message("Seconds not supported in time units!");
+                          */
+                        }
+                    }
+                }
+
+              rdate = cdiEncodeDate(year, month, day);
+              rtime = cdiEncodeTime(hour, minute, second);
+              (*taxis).rdate = rdate;
+              (*taxis).rtime = rtime;
+
+              if ( CDI_Debug )
+                Message("rdate = %d  rtime = %d", rdate, rtime);
+            }
+        }
+    }
+
+  (*taxis).type = timetype;
+  (*taxis).unit = timeunit;
+
+  free(tu);
+
+  if ( CDI_Debug )
+    Message("timetype = %d  unit = %d", timetype, timeunit);
+
+  return (0);
+}
+
+static
+void cdfGetAttInt(int fileID, int ncvarid, char *attname, int attlen, int *attint)
+{
+  size_t nc_attlen;
+  int *pintatt;
+
+  cdf_inq_attlen(fileID, ncvarid, attname, &nc_attlen);
+
+  if ( (int)nc_attlen > attlen )
+    pintatt = (int *) malloc(nc_attlen*sizeof(int));
+  else
+    pintatt = attint;
+
+  cdf_get_att_int(fileID, ncvarid, attname, pintatt);
+
+  if ( (int)nc_attlen > attlen )
+    {
+      memcpy(attint, pintatt, attlen*sizeof(int));
+      free(pintatt);
+    }
+}
+
+static
+void cdfGetAttDouble(int fileID, int ncvarid, char *attname, int attlen, double *attdouble)
+{
+  size_t nc_attlen;
+  double *pdoubleatt;
+
+  cdf_inq_attlen(fileID, ncvarid, attname, &nc_attlen);
+
+  if ( (int)nc_attlen > attlen )
+    pdoubleatt = (double *) malloc(nc_attlen*sizeof(double));
+  else
+    pdoubleatt = attdouble;
+
+  cdf_get_att_double(fileID, ncvarid, attname, pdoubleatt);
+
+  if ( (int)nc_attlen > attlen )
+    {
+      memcpy(attdouble, pdoubleatt, attlen*sizeof(double));
+      free(pdoubleatt);
+    }
+}
+
+static
+void cdfGetAttText(int fileID, int ncvarid, char *attname, int attlen, char *atttext)
+{
+  size_t nc_attlen;
+  char attbuf[65636];
+
+  cdf_inq_attlen(fileID, ncvarid, attname, &nc_attlen);
+
+  if ( nc_attlen < sizeof(attbuf) )
+    {
+      cdf_get_att_text(fileID, ncvarid, attname, attbuf);
+
+      attbuf[nc_attlen++] = 0;
+
+      if ( (int) nc_attlen > attlen ) nc_attlen = attlen;
+      memcpy(atttext, attbuf, nc_attlen);
+    }
+  else
+    {
+      atttext[0] = 0;
+    }
+}
+
+static
+int cdfInqDatatype(int xtype, int lunsigned)
+{
+  int datatype = -1;
+
+#if  defined  (HAVE_NETCDF4)
+  if ( xtype == NC_BYTE && lunsigned ) xtype = NC_UBYTE;
+#endif
+
+  if      ( xtype == NC_BYTE   )  datatype = DATATYPE_INT8;
+  /* else if ( xtype == NC_CHAR   )  datatype = DATATYPE_UINT8; */
+  else if ( xtype == NC_SHORT  )  datatype = DATATYPE_INT16;
+  else if ( xtype == NC_INT    )  datatype = DATATYPE_INT32;
+  else if ( xtype == NC_FLOAT  )  datatype = DATATYPE_FLT32;
+  else if ( xtype == NC_DOUBLE )  datatype = DATATYPE_FLT64;
+#if  defined  (HAVE_NETCDF4)
+  else if ( xtype == NC_UBYTE  )  datatype = DATATYPE_UINT8;
+  else if ( xtype == NC_LONG   )  datatype = DATATYPE_INT32;
+  else if ( xtype == NC_USHORT )  datatype = DATATYPE_UINT16;
+  else if ( xtype == NC_UINT   )  datatype = DATATYPE_UINT32;
+  else if ( xtype == NC_INT64  )  datatype = DATATYPE_FLT64;
+  else if ( xtype == NC_UINT64 )  datatype = DATATYPE_FLT64;
+#endif
+
+  return (datatype);
+}
+
+static
+int cdfDefDatatype(int datatype, int filetype)
+{
+  int xtype;
+
+  if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    Error("CDI/netCDF library does not support complex numbers!");
+
+  if ( filetype == FILETYPE_NC4 )
+    {
+      if      ( datatype == DATATYPE_INT8   ) xtype = NC_BYTE;
+      else if ( datatype == DATATYPE_INT16  ) xtype = NC_SHORT;
+      else if ( datatype == DATATYPE_INT32  ) xtype = NC_INT;
+#if  defined  (HAVE_NETCDF4)
+      else if ( datatype == DATATYPE_UINT8  ) xtype = NC_UBYTE;
+      else if ( datatype == DATATYPE_UINT16 ) xtype = NC_USHORT;
+      else if ( datatype == DATATYPE_UINT32 ) xtype = NC_UINT;
+#else
+      else if ( datatype == DATATYPE_UINT8  ) xtype = NC_SHORT;
+      else if ( datatype == DATATYPE_UINT16 ) xtype = NC_INT;
+      else if ( datatype == DATATYPE_UINT32 ) xtype = NC_INT;
+#endif
+      else if ( datatype == DATATYPE_FLT64  ) xtype = NC_DOUBLE;
+      else                                    xtype = NC_FLOAT;
+    }
+  else
+    {
+      if      ( datatype == DATATYPE_INT8   ) xtype = NC_BYTE;
+      else if ( datatype == DATATYPE_INT16  ) xtype = NC_SHORT;
+      else if ( datatype == DATATYPE_INT32  ) xtype = NC_INT;
+      else if ( datatype == DATATYPE_UINT8  ) xtype = NC_SHORT;
+      else if ( datatype == DATATYPE_UINT16 ) xtype = NC_INT;
+      else if ( datatype == DATATYPE_UINT32 ) xtype = NC_INT;
+      else if ( datatype == DATATYPE_FLT64  ) xtype = NC_DOUBLE;
+      else                                    xtype = NC_FLOAT;
+    }
+
+  return (xtype);
+}
+
+static
+void defineAttributes(int vlistID, int varID, int fileID, int ncvarID)
+{
+  int natts, iatt;
+  int atttype, attlen;
+  size_t len;
+  char attname[1024];
+
+  vlistInqNatts(vlistID, varID, &natts);
+
+  for ( iatt = 0; iatt < natts; iatt++ )
+    {
+      vlistInqAtt(vlistID, varID, iatt, attname, &atttype, &attlen);
+
+      if ( attlen == 0 ) continue;
+
+      if ( atttype == DATATYPE_TXT )
+        {
+          char *atttxt;
+          atttxt = (char *) malloc(attlen*sizeof(char));
+          vlistInqAttTxt(vlistID, varID, attname, attlen, atttxt);
+          len = attlen;
+          cdf_put_att_text(fileID, ncvarID, attname, len, atttxt);
+          free(atttxt);
+        }
+      else if ( atttype == DATATYPE_INT16 || atttype == DATATYPE_INT32 )
+        {
+          int *attint;
+          attint = (int *) malloc(attlen*sizeof(int));
+          vlistInqAttInt(vlistID, varID, attname, attlen, &attint[0]);
+          len = attlen;
+          if ( atttype == DATATYPE_INT16 )
+            cdf_put_att_int(fileID, ncvarID, attname, NC_SHORT, len, attint);
+          else
+            cdf_put_att_int(fileID, ncvarID, attname, NC_INT, len, attint);
+          free(attint);
+        }
+      else if ( atttype == DATATYPE_FLT32 || atttype == DATATYPE_FLT64 )
+        {
+          double *attflt;
+          attflt = (double *) malloc(attlen*sizeof(double));
+          vlistInqAttFlt(vlistID, varID, attname, attlen, attflt);
+          len = attlen;
+          if ( atttype == DATATYPE_FLT32 )
+            cdf_put_att_double(fileID, ncvarID, attname, NC_FLOAT, len, attflt);
+          else
+            cdf_put_att_double(fileID, ncvarID, attname, NC_DOUBLE, len, attflt);
+          free(attflt);
+        }
+    }
+}
+#endif
+
+int cdfCopyRecord(int streamID2, int streamID1)
+{
+  double *data;
+  int datasize;
+  int tsID1, recID1;
+  int ivarID, gridID;
+  int nmiss;
+  int ierr = 0;
+  int memtype = MEMTYPE_DOUBLE;
+  int vlistID1;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  vlistID1 = streamptr1->vlistID;
+
+  tsID1 = streamptr1->curTsID;
+
+  recID1 = streamptr1->tsteps[tsID1].curRecID;
+
+  ivarID = streamptr1->tsteps[tsID1].records[recID1].varID;
+
+  gridID = vlistInqVarGrid(vlistID1, ivarID);
+
+  datasize = gridInqSize(gridID);
+  /* bug fix for constant netCDF fields */
+  if ( datasize < 1048576 ) datasize = 1048576;
+
+  data = (double *) malloc(datasize*sizeof(double));
+
+  streamReadRecord(streamID1, data, &nmiss);
+  stream_write_record(streamID2, memtype, data, nmiss);
+
+  free(data);
+
+  return (ierr);
+}
+
+/* not used
+int cdfInqRecord(int streamID, int *varID, int *levelID)
+{
+  int tsID, recID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  recID = streamptr->tsteps[0].curRecID++;
+  printf("cdfInqRecord recID %d %d\n", recID, streamptr->tsteps[0].curRecID);
+  printf("cdfInqRecord tsID %d\n", streamptr->curTsID);
+
+  if ( streamptr->tsteps[0].curRecID >= 
+       streamptr->tsteps[0].nrecs )
+    {
+      streamptr->tsteps[0].curRecID = 0;
+    }
+
+  *varID   = streamptr->tsteps[0].records[recID].varID;
+  *levelID = streamptr->tsteps[0].records[recID].levelID;
+
+  streamptr->record->varID   = *varID;
+  streamptr->record->levelID = *levelID;
+
+  if ( CDI_Debug )
+    Message("recID = %d  varID = %d  levelID = %d", recID, *varID, *levelID);
+  
+  return (recID+1);
+}
+*/
+int cdfDefRecord(int streamID)
+{
+  int ierr = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d", streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (ierr);
+}
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfWriteGridTraj(int streamID, int gridID)
+{
+  int tsID, fileID;
+  int lonID, latID, gridindex;
+  size_t index;
+  double xlon, xlat;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  lonID = streamptr->xdimID[gridindex];
+  latID = streamptr->ydimID[gridindex];
+
+  xlon = gridInqXval(gridID, 0);
+  xlat = gridInqYval(gridID, 0);
+  tsID = streamptr->curTsID;
+  index = tsID;
+
+  cdf_put_var1_double(fileID, lonID, &index, &xlon);
+  cdf_put_var1_double(fileID, latID, &index, &xlat);
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfReadGridTraj(int streamID, int gridID)
+{
+  int tsID, fileID;
+  int lonID, latID, gridindex;
+  size_t index;
+  double xlon, xlat;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  lonID = streamptr->xdimID[gridindex];
+  latID = streamptr->ydimID[gridindex];
+
+  tsID = streamptr->curTsID;
+  index = tsID;
+
+  cdf_get_var1_double(fileID, lonID, &index, &xlon);
+  cdf_get_var1_double(fileID, latID, &index, &xlat);
+
+  gridDefXvals(gridID, &xlon);
+  gridDefYvals(gridID, &xlat);
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefVarDeflate(int ncid, int ncvarid, int deflate_level)
+{
+#if  defined  (HAVE_NETCDF4)
+  int retval;
+  /* Set chunking, shuffle, and deflate. */
+  int shuffle = 1;
+  int deflate = 1;
+
+  if ( deflate_level < 1 || deflate_level > 9 ) deflate_level = 1;
+
+  if ((retval = nc_def_var_deflate(ncid, ncvarid, shuffle, deflate, deflate_level)))
+    {
+      Error("nc_def_var_deflate failed, status = %d", retval);
+    }
+#else
+  static int lwarn = TRUE;
+
+  if ( lwarn )
+    {
+      lwarn = FALSE;
+      Warning("Deflate compression failed, netCDF4 not available!");
+    }
+#endif
+}
+#endif
+
+#if  defined(HAVE_LIBNETCDF) && defined(NC_SZIP_NN_OPTION_MASK)
+static
+void cdfDefVarSzip(int ncid, int ncvarid)
+{
+  int retval;
+  /* Set options_mask and bits_per_pixel. */
+  int options_mask = NC_SZIP_NN_OPTION_MASK;
+  int bits_per_pixel = 16;
+
+  if ((retval = nc_def_var_szip(ncid, ncvarid, options_mask, bits_per_pixel)))
+    {
+      if ( retval == NC_EINVAL )
+        {
+          static int lwarn = TRUE;
+
+          if ( lwarn )
+            {
+              lwarn = FALSE;
+              Warning("netCDF4/Szip compression not compiled in!");
+            }
+        }
+      else
+        Error("nc_def_var_szip failed, status = %d", retval);
+    }
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefVarMissval(int streamID, int varID, int dtype, int lcheck)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->vars[varID].defmiss == FALSE )
+    {
+      int fileID;
+      int ncvarid;
+      double missval;
+      int vlistID;
+      int xtype;
+
+      vlistID = streamInqVlist(streamID);
+      fileID  = streamInqFileID(streamID);
+      ncvarid = streamptr->vars[varID].ncvarid;
+      missval = vlistInqVarMissval(vlistID, varID);
+      if ( lcheck && streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      xtype = cdfDefDatatype(dtype, streamptr->filetype);
+
+      cdf_put_att_double(fileID, ncvarid, "_FillValue", (nc_type) xtype, 1, &missval);
+
+      if ( cdiNcMissingValue == 1 )
+        cdf_put_att_double(fileID, ncvarid, "missing_value", (nc_type) xtype, 1, &missval);
+
+      if ( lcheck && streamptr->ncmode == 2 ) cdf_enddef(fileID);
+
+      streamptr->vars[varID].defmiss = TRUE;
+    }
+}
+#endif
+
+void cdf_write_record(int streamID, int memtype, const void *data, int nmiss)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int varID;
+  int levelID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  varID   = streamptr->record->varID;
+  levelID = streamptr->record->levelID;
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  cdf_write_var_slice(streamID, varID, levelID, memtype, data, nmiss);
+#endif
+}
+
+
+int cdfReadRecord(int streamID, double *data, int *nmiss)
+{
+  int ierr = 0;
+  int levelID, varID, tsID, recID, vrecID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug ) Message("streamID = %d", streamID);
+
+  tsID    = streamptr->curTsID;
+  vrecID  = streamptr->tsteps[tsID].curRecID;
+  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+  varID   = streamptr->tsteps[tsID].records[recID].varID;
+  levelID = streamptr->tsteps[tsID].records[recID].levelID;
+
+  cdfReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+
+  return (ierr);
+}
+
+static
+void cdfDefTimeValue(int streamID, int tsID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  double timevalue;
+  int ncvarid;
+  size_t index;
+  taxis_t *taxis;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  fileID = streamInqFileID(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d, fileID = %d", streamID, fileID);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->ncmode == 1 )
+    {
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  index = tsID;
+
+  timevalue = cdiEncodeTimeval(taxis->vdate, taxis->vtime, &streamptr->tsteps[0].taxis);
+  if ( CDI_Debug ) Message("tsID = %d  timevalue = %f", tsID, timevalue);
+
+  ncvarid = streamptr->basetime.ncvarid;
+  cdf_put_var1_double(fileID, ncvarid, &index, &timevalue);
+
+  if ( taxis->has_bounds )
+    {
+      size_t start[2], count[2];
+
+      ncvarid = streamptr->basetime.ncvarboundsid;
+
+      timevalue = cdiEncodeTimeval(taxis->vdate_lb, taxis->vtime_lb, &streamptr->tsteps[0].taxis);
+      start[0] = tsID; count[0] = 1; start[1] = 0; count[1] = 1;
+      cdf_put_vara_double(fileID, ncvarid, start, count, &timevalue);
+
+      timevalue = cdiEncodeTimeval(taxis->vdate_ub, taxis->vtime_ub, &streamptr->tsteps[0].taxis);
+      start[0] = tsID; count[0] = 1; start[1] = 1; count[1] = 1;
+      cdf_put_vara_double(fileID, ncvarid, start, count, &timevalue);
+    }
+  /*
+printf("fileID = %d %d %d %f\n", fileID, time_varid, index, timevalue);
+  */
+#endif
+}
+
+static
+void cdfDefTime(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  int time_varid;
+  int time_bndsid;
+  int dims[2];
+  int year, month, day, hour, minute, second;
+  char unitstr[80];
+  char calstr[80];
+  char tmpstr[CDI_MAX_NAME];
+  char default_name[] = "time";
+  char *taxis_name = default_name;
+  size_t len;
+  taxis_t *taxis;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->basetime.ncvarid != UNDEFID ) return;
+
+  fileID = streamInqFileID(streamID);
+
+  if ( streamptr->ncmode == 0 ) streamptr->ncmode = 1;
+
+  if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+  taxis = &streamptr->tsteps[0].taxis;
+
+  if ( taxis->name && taxis->name[0] ) taxis_name = taxis->name;
+
+  cdf_def_dim(fileID, taxis_name, NC_UNLIMITED, &streamptr->basetime.ncdimid);
+
+  dims[0] = streamptr->basetime.ncdimid;
+  cdf_def_var(fileID, taxis_name, NC_DOUBLE, 1, dims, &time_varid);
+
+  streamptr->basetime.ncvarid = time_varid;
+
+  strcpy(tmpstr, "time");
+  cdf_put_att_text(fileID, time_varid, "standard_name", strlen(tmpstr), tmpstr);
+
+  if ( taxis->longname && taxis->longname[0] )
+    cdf_put_att_text(fileID, time_varid, "long_name", strlen(taxis->longname), taxis->longname);
+
+  if ( taxis->has_bounds )
+    {
+      /* fprintf(stderr, "time has bounds\n"); */
+
+      if ( nc_inq_dimid(fileID, "nb2", &dims[1]) != NC_NOERR )
+	cdf_def_dim(fileID, "nb2", 2, &dims[1]);
+
+      strcpy(tmpstr, taxis_name);
+      strcat(tmpstr, "_bnds");
+      cdf_def_var(fileID, tmpstr, NC_DOUBLE, 2, dims, &time_bndsid);
+
+      streamptr->basetime.ncvarboundsid = time_bndsid;
+
+      cdf_put_att_text(fileID, time_varid, "bounds", strlen(tmpstr), tmpstr);
+    }
+
+  unitstr[0] = 0;
+  if ( streamptr->tsteps[0].taxis.type == TAXIS_ABSOLUTE )
+    {
+      if ( streamptr->tsteps[0].taxis.unit == TUNIT_YEAR )
+        sprintf(unitstr, "year as %s", "%Y.%f");
+      else if ( streamptr->tsteps[0].taxis.unit == TUNIT_MONTH )
+        sprintf(unitstr, "month as %s", "%Y%m.%f");
+      else
+        sprintf(unitstr, "day as %s", "%Y%m%d.%f");
+    }
+  else
+    {
+      int rdate, rtime;
+      int timeunit;
+
+      timeunit = taxis->unit;
+      if ( timeunit == -1 ) timeunit = TUNIT_HOUR;
+      rdate    = taxis->rdate;
+      rtime    = taxis->rtime;
+      if ( rdate == -1 )
+        {
+          rdate  = taxis->vdate;
+          rtime  = taxis->vtime;
+        }
+
+      cdiDecodeDate(rdate, &year, &month, &day);
+      cdiDecodeTime(rtime, &hour, &minute, &second);
+
+      if ( timeunit == TUNIT_QUARTER ) timeunit = TUNIT_MINUTE;
+      if ( timeunit == TUNIT_3HOURS  ||
+	   timeunit == TUNIT_6HOURS  ||
+	   timeunit == TUNIT_12HOURS ) timeunit = TUNIT_HOUR;
+
+      sprintf(unitstr, "%s since %d-%02d-%02d %02d:%02d:%02d",
+              tunitNamePtr(timeunit), year, month, day, hour, minute, second);
+    }
+
+  len = strlen(unitstr);
+  if ( len )
+    cdf_put_att_text(fileID, time_varid, "units", len, unitstr);
+
+  if ( taxis->has_bounds )
+    if ( len )
+      cdf_put_att_text(fileID, time_bndsid, "units", len, unitstr);
+
+  if ( taxis->calendar != -1 )
+    {
+      calstr[0] = 0;
+
+      if      ( taxis->calendar == CALENDAR_STANDARD )  strcpy(calstr, "standard");
+      else if ( taxis->calendar == CALENDAR_PROLEPTIC ) strcpy(calstr, "proleptic_gregorian");
+      else if ( taxis->calendar == CALENDAR_NONE )      strcpy(calstr, "none");
+      else if ( taxis->calendar == CALENDAR_360DAYS )   strcpy(calstr, "360_day");
+      else if ( taxis->calendar == CALENDAR_365DAYS )   strcpy(calstr, "365_day");
+      else if ( taxis->calendar == CALENDAR_366DAYS )   strcpy(calstr, "366_day");
+
+      len = strlen(calstr);
+      if ( len )
+        {
+          cdf_put_att_text(fileID, time_varid, "calendar", len, calstr);
+
+          if ( taxis->has_bounds )
+            cdf_put_att_text(fileID, time_bndsid, "calendar", len, calstr);
+        }
+    }
+
+  if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
+#endif
+}
+
+
+void cdfDefTimestep(int streamID, int tsID)
+{
+  int vlistID;
+
+  vlistID = streamInqVlist(streamID);
+
+  if ( vlistHasTime(vlistID) ) cdfDefTime(streamID);
+
+  cdfDefTimeValue(streamID, tsID);
+}
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefComplex(int streamID, int gridID)
+{
+  char axisname[] = "nc2";
+  int index;
+  int dimID = UNDEFID;
+  int gridID0, gridtype0, gridindex;
+  int ngrids;
+  int fileID;
+  int dimlen;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->xdimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_SPECTRAL || gridtype0 == GRID_FOURIER )
+            {
+              dimID = streamptr->xdimID[index];
+              break;
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      dimlen = 2;
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  streamptr->xdimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefSP(int streamID, int gridID)
+{
+  /*
+  char longname[] = "Spherical harmonic coefficient";
+  */
+  char axisname[5] = "nspX";
+  int index, iz = 0;
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqSize(gridID)/2;
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->ydimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_SPECTRAL )
+            {
+              dimlen0 = gridInqSize(gridID0)/2;
+              if ( dimlen == dimlen0 )
+                {
+                  dimID = streamptr->ydimID[index];
+                  break;
+                }
+              else
+                iz++;
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      if ( iz == 0 ) axisname[3] = '\0';
+      else           sprintf(&axisname[3], "%1d", iz+1);
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  streamptr->ydimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefFC(int streamID, int gridID)
+{
+  char axisname[5] = "nfcX";
+  int index, iz = 0;
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqSize(gridID)/2;
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->ydimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_FOURIER )
+            {
+              dimlen0 = gridInqSize(gridID0)/2;
+              if ( dimlen == dimlen0 )
+                {
+                  dimID = streamptr->ydimID[index];
+                  break;
+                }
+              else
+                iz++;
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      if ( iz == 0 ) axisname[3] = '\0';
+      else           sprintf(&axisname[3], "%1d", iz+1);
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  streamptr->ydimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefTrajLon(int streamID, int gridID)
+{
+  char units[CDI_MAX_NAME];
+  char longname[CDI_MAX_NAME];
+  char stdname[CDI_MAX_NAME];
+  char axisname[CDI_MAX_NAME];
+  int gridtype, gridindex;
+  int dimID = UNDEFID;
+  int fileID;
+  int dimlen;
+  size_t len;
+  int ncvarid;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  gridtype = gridInqType(gridID);
+  dimlen = gridInqXsize(gridID);
+  if ( dimlen != 1 ) Error("Xsize isn't 1 for %s grid!", gridNamePtr(gridtype));
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  ncvarid = streamptr->xdimID[gridindex];
+
+  gridInqXname(gridID, axisname);
+  gridInqXlongname(gridID, longname);
+  gridInqXstdname(gridID, stdname);
+  gridInqXunits(gridID, units);
+
+  if ( ncvarid == UNDEFID )
+    {
+      dimID = streamptr->basetime.ncvarid;
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID, &ncvarid);
+
+      if ( (len = strlen(stdname)) )
+        cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname);
+      if ( (len = strlen(longname)) )
+        cdf_put_att_text(fileID, ncvarid, "long_name", len, longname);
+      if ( (len = strlen(units)) )
+        cdf_put_att_text(fileID, ncvarid, "units", len, units);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  streamptr->xdimID[gridindex] = ncvarid; /* var ID for trajectory !!! */
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefTrajLat(int streamID, int gridID)
+{
+  char units[] = "degrees_north";
+  char longname[] = "latitude";
+  char stdname[] = "latitude";
+  char axisname[] = "tlat";
+  int gridtype, gridindex;
+  int dimID = UNDEFID;
+  int fileID;
+  int dimlen;
+  size_t len;
+  int ncvarid;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID = streamInqFileID(streamID);
+
+  gridtype = gridInqType(gridID);
+  dimlen = gridInqYsize(gridID);
+  if ( dimlen != 1 ) Error("Ysize isn't 1 for %s grid!", gridNamePtr(gridtype));
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  ncvarid = streamptr->ydimID[gridindex];
+
+  gridInqYname(gridID, axisname);
+  gridInqYlongname(gridID, longname);
+  gridInqYstdname(gridID, stdname);
+  gridInqYunits(gridID, units);
+
+  if ( ncvarid == UNDEFID )
+    {
+      dimID = streamptr->basetime.ncvarid;
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID, &ncvarid);
+
+      if ( (len = strlen(stdname)) )
+        cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname);
+      if ( (len = strlen(longname)) )
+        cdf_put_att_text(fileID, ncvarid, "long_name", len, longname);
+      if ( (len = strlen(units)) )
+        cdf_put_att_text(fileID, ncvarid, "units", len, units);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  streamptr->ydimID[gridindex] = ncvarid; /* var ID for trajectory !!! */
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+int checkGridName(int type, char *axisname, int fileID, int vlistID, int gridID, int ngrids, int mode)
+{
+  int iz, index;
+  int gridID0;
+  int ncdimid;
+  char axisname0[CDI_MAX_NAME];
+  char axisname2[CDI_MAX_NAME];
+  int checkname;
+  int status;
+
+  /* check that the name is not already defined */
+  checkname = TRUE;
+  iz = 0;
+
+  while ( checkname ) 
+    {
+      strcpy(axisname2, axisname);
+      if ( iz ) sprintf(&axisname2[strlen(axisname2)], "_%d", iz+1);
+
+      //status = nc_inq_varid(fileID, axisname2, &ncvarid);
+      if ( type == 'V' ) /* type Var oder Dim */
+        status = nc_inq_varid(fileID, axisname2, &ncdimid);
+      else
+        status = nc_inq_dimid(fileID, axisname2, &ncdimid);
+
+      if ( status != NC_NOERR )
+        {
+          if ( iz )
+            {
+              /* check that the name does not exist for other grids */
+              for ( index = 0; index < ngrids; index++ )
+                {
+                  gridID0 = vlistGrid(vlistID, index);
+                  if ( gridID != gridID0 )
+                    {
+                      if ( mode == 'X' ) /* mode X or Y */
+                        gridInqXname(gridID0, axisname0);
+                      else
+                        gridInqYname(gridID0, axisname0);
+
+                      if ( strcmp(axisname0, axisname2) == 0 ) break;
+                    }
+                }
+              if ( index == ngrids ) checkname = FALSE;
+            }
+          else
+            {
+              checkname = FALSE;
+            }
+        }
+
+      if ( checkname ) iz++;
+
+      if ( iz > 99 ) break;
+    }
+
+  if ( iz ) sprintf(&axisname[strlen(axisname)], "_%d", iz+1);
+
+  return (iz);
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefXaxis(int streamID, int gridID)
+{
+  char units[CDI_MAX_NAME];
+  char longname[CDI_MAX_NAME];
+  char stdname[CDI_MAX_NAME];
+  char axisname[CDI_MAX_NAME];
+  int index;
+  /*  int index2; */
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int dimIDs[2];
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  size_t len;
+  int ncvarid = UNDEFID, ncbvarid = UNDEFID;
+  int nvertex = 2, nvdimID = UNDEFID;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqXsize(gridID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+
+  gridInqXname(gridID, axisname);
+  gridInqXlongname(gridID, longname);
+  gridInqXstdname(gridID, stdname);
+  gridInqXunits(gridID, units);
+
+  if ( axisname[0] == 0 ) Error("axis name undefined!");
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->xdimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_GAUSSIAN    ||
+               gridtype0 == GRID_LONLAT      ||
+               gridtype0 == GRID_CURVILINEAR ||
+               gridtype0 == GRID_GENERIC )
+            {
+              dimlen0 = gridInqXsize(gridID0);
+              if ( dimlen == dimlen0 )
+                if ( IS_EQUAL(gridInqXval(gridID0, 0), gridInqXval(gridID, 0)) &&
+                     IS_EQUAL(gridInqXval(gridID0, dimlen-1), gridInqXval(gridID, dimlen-1)) )
+                  {
+                    dimID = streamptr->xdimID[index];
+                    break;
+                  }
+              /*
+              for ( index2 = 0; index2 < index; index2++ )
+                if ( streamptr->xdimID[index] == streamptr->xdimID[index2] )
+                  break;
+              if ( index2 == index ) iz++;
+              */
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      int status;
+      status = checkGridName('V', axisname, fileID, vlistID, gridID, ngrids, 'X');
+      if ( status == 0 )
+        status = checkGridName('D', axisname, fileID, vlistID, gridID, ngrids, 'X');
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      if ( gridInqXboundsPtr(gridID) || gridInqYboundsPtr(gridID) )
+        {
+          if ( nc_inq_dimid(fileID, "nb2", &nvdimID) != NC_NOERR )
+            cdf_def_dim(fileID, "nb2", nvertex, &nvdimID);
+        }
+
+      if ( gridInqXvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID, &ncvarid);
+
+          if ( (len = strlen(stdname)) )
+            cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname);
+          if ( (len = strlen(longname)) )
+            cdf_put_att_text(fileID, ncvarid, "long_name", len, longname);
+          if ( (len = strlen(units)) )
+            cdf_put_att_text(fileID, ncvarid, "units", len, units);
+
+          cdf_put_att_text(fileID, ncvarid, "axis", 1, "X");
+
+          if ( gridInqXboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              strcat(axisname, "_bnds");
+              dimIDs[0] = dimID;
+              dimIDs[1] = nvdimID;
+              cdf_def_var(fileID, axisname, (nc_type) xtype, 2, dimIDs, &ncbvarid);
+              cdf_put_att_text(fileID, ncvarid, "bounds", strlen(axisname), axisname);
+            }
+          /*
+          if ( gridIsRotated(gridID) )
+            {
+              double north_pole = gridInqXpole(gridID);
+              cdf_put_att_double(fileID, ncvarid, "north_pole", NC_DOUBLE, 1, &north_pole);
+            }
+          */
+        }
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+
+      if ( ncvarid  != UNDEFID ) cdf_put_var_double(fileID, ncvarid, gridInqXvalsPtr(gridID));
+      if ( ncbvarid != UNDEFID ) cdf_put_var_double(fileID, ncbvarid, gridInqXboundsPtr(gridID));
+    }
+
+  streamptr->xdimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefYaxis(int streamID, int gridID)
+{
+  char units[CDI_MAX_NAME];
+  char longname[CDI_MAX_NAME];
+  char stdname[CDI_MAX_NAME];
+  char axisname[CDI_MAX_NAME];
+  int index;
+  /*  int index2; */
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int dimIDs[2];
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  size_t len;
+  int ncvarid = UNDEFID, ncbvarid = UNDEFID;
+  int nvertex = 2, nvdimID = UNDEFID;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqYsize(gridID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+
+  gridInqYname(gridID, axisname);
+  gridInqYlongname(gridID, longname);
+  gridInqYstdname(gridID, stdname);
+  gridInqYunits(gridID, units);
+
+  if ( axisname[0] == 0 ) Error("axis name undefined!");
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->ydimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_GAUSSIAN    ||
+               gridtype0 == GRID_LONLAT      ||
+               gridtype0 == GRID_CURVILINEAR ||
+               gridtype0 == GRID_GENERIC )
+            {
+              dimlen0 = gridInqYsize(gridID0);
+              if ( dimlen == dimlen0 )
+                if ( IS_EQUAL(gridInqYval(gridID0, 0), gridInqYval(gridID, 0)) &&
+                     IS_EQUAL(gridInqYval(gridID0, dimlen-1), gridInqYval(gridID, dimlen-1)) )
+                  {
+                    dimID = streamptr->ydimID[index];
+                    break;
+                  }
+              /*
+              for ( index2 = 0; index2 < index; index2++ )
+                if ( streamptr->ydimID[index] == streamptr->ydimID[index2] )
+                  break;
+              if ( index2 == index ) iz++;
+              */
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      int status;
+      status = checkGridName('V', axisname, fileID, vlistID, gridID, ngrids, 'Y');
+      if ( status == 0 )
+        status = checkGridName('D', axisname, fileID, vlistID, gridID, ngrids, 'Y');
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      if ( gridInqXboundsPtr(gridID) || gridInqYboundsPtr(gridID) )
+        {
+          if ( nc_inq_dimid(fileID, "nb2", &nvdimID) != NC_NOERR )
+            cdf_def_dim(fileID, "nb2", nvertex, &nvdimID);
+        }
+
+      if ( gridInqYvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID, &ncvarid);
+
+          if ( (len = strlen(stdname)) )
+            cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname);
+          if ( (len = strlen(longname)) )
+            cdf_put_att_text(fileID, ncvarid, "long_name", len, longname);
+          if ( (len = strlen(units)) )
+            cdf_put_att_text(fileID, ncvarid, "units", len, units);
+
+          cdf_put_att_text(fileID, ncvarid, "axis", 1, "Y");
+
+          if ( gridInqYboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              strcat(axisname, "_bnds");
+              dimIDs[0] = dimID;
+              dimIDs[1] = nvdimID;
+              cdf_def_var(fileID, axisname, (nc_type) xtype, 2, dimIDs, &ncbvarid);
+              cdf_put_att_text(fileID, ncvarid, "bounds", strlen(axisname), axisname);
+            }
+          /*
+          if ( gridIsRotated(gridID) )
+            {
+              double north_pole = gridInqYpole(gridID);
+              cdf_put_att_double(fileID, ncvarid, "north_pole", NC_DOUBLE, 1, &north_pole);
+            }
+          */
+        }
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+
+      if ( ncvarid  != UNDEFID ) cdf_put_var_double(fileID, ncvarid, gridInqYvalsPtr(gridID));
+      if ( ncbvarid != UNDEFID ) cdf_put_var_double(fileID, ncbvarid, gridInqYboundsPtr(gridID));
+    }
+
+  streamptr->ydimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfGridCompress(int fileID, int ncvarid, int gridsize, int filetype, int comptype)
+{
+#if  defined  (HAVE_NETCDF4)
+  if ( gridsize > 1 && comptype == COMPRESS_ZIP && (filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C) )
+    {
+      nc_def_var_chunking(fileID, ncvarid, NC_CHUNKED, NULL);
+      cdfDefVarDeflate(fileID, ncvarid, 1);
+    }
+#endif
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefCurvilinear(int streamID, int gridID)
+{
+  char xunits[CDI_MAX_NAME];
+  char xlongname[CDI_MAX_NAME];
+  char xstdname[CDI_MAX_NAME];
+  char yunits[CDI_MAX_NAME];
+  char ylongname[CDI_MAX_NAME];
+  char ystdname[CDI_MAX_NAME];
+  char xaxisname[CDI_MAX_NAME];
+  char yaxisname[CDI_MAX_NAME];
+  char xdimname[4] = "x";
+  char ydimname[4] = "y";
+  int index;
+  int gridID0, gridtype0, gridindex;
+  int xdimID = UNDEFID;
+  int ydimID = UNDEFID;
+  int dimIDs[3];
+  int ngrids;
+  int fileID;
+  int xdimlen, ydimlen, dimlen0;
+  size_t len;
+  int ncxvarid = UNDEFID, ncyvarid = UNDEFID;
+  int ncbxvarid = UNDEFID, ncbyvarid = UNDEFID, ncavarid = UNDEFID;
+  int nvertex = 4, nvdimID = UNDEFID;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  xdimlen = gridInqXsize(gridID);
+  ydimlen = gridInqYsize(gridID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+
+  gridInqXname(gridID, xaxisname);
+  gridInqXlongname(gridID, xlongname);
+  gridInqXstdname(gridID, xstdname);
+  gridInqXunits(gridID, xunits);
+  gridInqYname(gridID, yaxisname);
+  gridInqYlongname(gridID, ylongname);
+  gridInqYstdname(gridID, ystdname);
+  gridInqYunits(gridID, yunits);
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->xdimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_GAUSSIAN    ||
+               gridtype0 == GRID_LONLAT      ||
+               gridtype0 == GRID_CURVILINEAR ||
+               gridtype0 == GRID_GENERIC )
+            {
+              dimlen0 = gridInqXsize(gridID0);
+              if ( xdimlen == dimlen0 )
+                if ( IS_EQUAL(gridInqXval(gridID0, 0), gridInqXval(gridID, 0)) &&
+                     IS_EQUAL(gridInqXval(gridID0, xdimlen-1), gridInqXval(gridID, xdimlen-1)) )
+                  {
+                    xdimID = streamptr->xdimID[index];
+                    break;
+                  }
+              dimlen0 = gridInqYsize(gridID0);
+              if ( ydimlen == dimlen0 )
+                if ( IS_EQUAL(gridInqYval(gridID0, 0), gridInqYval(gridID, 0)) &&
+                     IS_EQUAL(gridInqYval(gridID0, xdimlen-1), gridInqYval(gridID, xdimlen-1)) )
+                  {
+                    ydimID = streamptr->ydimID[index];
+                    break;
+                  }
+            }
+        }
+    }
+
+  if ( xdimID == UNDEFID || ydimID == UNDEFID )
+    {
+      int status;
+      status = checkGridName('V', xaxisname, fileID, vlistID, gridID, ngrids, 'X');
+      status = checkGridName('V', yaxisname, fileID, vlistID, gridID, ngrids, 'Y');
+      status = checkGridName('D', xdimname, fileID, vlistID, gridID, ngrids, 'X');
+      status = checkGridName('D', ydimname, fileID, vlistID, gridID, ngrids, 'Y');
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, xdimname, xdimlen, &xdimID);
+      cdf_def_dim(fileID, ydimname, ydimlen, &ydimID);
+
+      if ( gridInqXboundsPtr(gridID) || gridInqYboundsPtr(gridID) )
+        {
+          if ( nc_inq_dimid(fileID, "nv4", &nvdimID) != NC_NOERR )
+            cdf_def_dim(fileID, "nv4", nvertex, &nvdimID);
+        }
+
+      dimIDs[0] = ydimID;
+      dimIDs[1] = xdimID;
+
+      if ( gridInqXvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, xaxisname, (nc_type) xtype, 2, dimIDs, &ncxvarid);
+          cdfGridCompress(fileID, ncxvarid, xdimlen*ydimlen, streamptr->filetype, streamptr->comptype);
+
+          if ( (len = strlen(xstdname)) )
+            cdf_put_att_text(fileID, ncxvarid, "standard_name", len, xstdname);
+          if ( (len = strlen(xlongname)) )
+            cdf_put_att_text(fileID, ncxvarid, "long_name", len, xlongname);
+          if ( (len = strlen(xunits)) )
+            cdf_put_att_text(fileID, ncxvarid, "units", len, xunits);
+
+          /* attribute for Panoply */
+          cdf_put_att_text(fileID, ncxvarid, "_CoordinateAxisType", 3, "Lon");
+
+          streamptr->ncxvarID[gridindex] = ncxvarid;
+
+          if ( gridInqXboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              strcat(xaxisname, "_bnds");
+              dimIDs[0] = ydimID;
+              dimIDs[1] = xdimID;
+              dimIDs[2] = nvdimID;
+              cdf_def_var(fileID, xaxisname, (nc_type) xtype, 3, dimIDs, &ncbxvarid);
+              cdfGridCompress(fileID, ncbxvarid, xdimlen*ydimlen, streamptr->filetype, streamptr->comptype);
+
+              cdf_put_att_text(fileID, ncxvarid, "bounds", strlen(xaxisname), xaxisname);
+            }
+        }
+
+      if ( gridInqYvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, yaxisname, (nc_type) xtype, 2, dimIDs, &ncyvarid);
+          cdfGridCompress(fileID, ncyvarid, xdimlen*ydimlen, streamptr->filetype, streamptr->comptype);
+
+          if ( (len = strlen(ystdname)) )
+            cdf_put_att_text(fileID, ncyvarid, "standard_name", len, ystdname);
+          if ( (len = strlen(ylongname)) )
+            cdf_put_att_text(fileID, ncyvarid, "long_name", len, ylongname);
+          if ( (len = strlen(yunits)) )
+            cdf_put_att_text(fileID, ncyvarid, "units", len, yunits);
+
+          /* attribute for Panoply */
+          cdf_put_att_text(fileID, ncyvarid, "_CoordinateAxisType", 3, "Lat");
+
+          streamptr->ncyvarID[gridindex] = ncyvarid;
+
+          if ( gridInqYboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              strcat(yaxisname, "_bnds");
+              dimIDs[0] = ydimID;
+              dimIDs[1] = xdimID;
+              dimIDs[2] = nvdimID;
+              cdf_def_var(fileID, yaxisname, (nc_type) xtype, 3, dimIDs, &ncbyvarid);
+              cdfGridCompress(fileID, ncbyvarid, xdimlen*ydimlen, streamptr->filetype, streamptr->comptype);
+
+              cdf_put_att_text(fileID, ncyvarid, "bounds", strlen(yaxisname), yaxisname);
+            }
+        }
+
+      if ( gridInqAreaPtr(gridID) )
+        {
+          char yaxisname[] = "cell_area";
+          char units[] = "m2";
+          char longname[] = "area of grid cell";
+          char stdname[] = "cell_area";
+
+          cdf_def_var(fileID, yaxisname, (nc_type) xtype, 2, dimIDs, &ncavarid);
+
+          cdf_put_att_text(fileID, ncavarid, "standard_name", strlen(stdname), stdname);
+          cdf_put_att_text(fileID, ncavarid, "long_name", strlen(longname), longname);
+          cdf_put_att_text(fileID, ncavarid, "units", strlen(units), units);
+
+          streamptr->ncavarID[gridindex] = ncavarid;
+        }
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+
+      if ( ncxvarid  != UNDEFID ) cdf_put_var_double(fileID, ncxvarid,  gridInqXvalsPtr(gridID));
+      if ( ncbxvarid != UNDEFID ) cdf_put_var_double(fileID, ncbxvarid, gridInqXboundsPtr(gridID));
+      if ( ncyvarid  != UNDEFID ) cdf_put_var_double(fileID, ncyvarid,  gridInqYvalsPtr(gridID));
+      if ( ncbyvarid != UNDEFID ) cdf_put_var_double(fileID, ncbyvarid, gridInqYboundsPtr(gridID));
+      if ( ncavarid  != UNDEFID ) cdf_put_var_double(fileID, ncavarid,  gridInqAreaPtr(gridID));
+    }
+
+  streamptr->xdimID[gridindex] = xdimID;
+  streamptr->ydimID[gridindex] = ydimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefRgrid(int streamID, int gridID)
+{
+  char axisname[7] = "rgridX";
+  int index, iz = 0;
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  int vlistID;
+  int lwarn = TRUE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqSize(gridID);
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->xdimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_GAUSSIAN_REDUCED )
+            {
+              dimlen0 = gridInqSize(gridID0);
+
+              if ( dimlen == dimlen0 )
+                {
+                  dimID = streamptr->xdimID[index];
+                  break;
+                }
+              else
+                iz++;
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      if ( lwarn )
+        {
+          Warning("Creating a netCDF file with data on a gaussian reduced grid.");
+          Warning("The further processing of the resulting file is unsupported!");
+          lwarn = FALSE;
+        }
+
+      if ( iz == 0 ) axisname[5] = '\0';
+      else           sprintf(&axisname[5], "%1d", iz+1);
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  streamptr->xdimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefGdim(int streamID, int gridID)
+{
+  char axisname[7] = "gsizeX";
+  int index, iz = 0;
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqSize(gridID);
+
+  if ( gridInqYsize(gridID) == 0 )
+    for ( index = 0; index < ngrids; index++ )
+      {
+        if ( streamptr->xdimID[index] != UNDEFID )
+          {
+            gridID0 = vlistGrid(vlistID, index);
+            gridtype0 = gridInqType(gridID0);
+            if ( gridtype0 == GRID_GENERIC )
+              {
+                dimlen0 = gridInqSize(gridID0);
+                if ( dimlen == dimlen0 )
+                  {
+                    dimID = streamptr->xdimID[index];
+                    break;
+                  }
+                else
+                  iz++; 
+              }
+          }
+      }
+
+  if ( gridInqXsize(gridID) == 0 )
+    for ( index = 0; index < ngrids; index++ )
+      {
+        if ( streamptr->ydimID[index] != UNDEFID )
+          {
+            gridID0 = vlistGrid(vlistID, index);
+            gridtype0 = gridInqType(gridID0);
+            if ( gridtype0 == GRID_GENERIC )
+              {
+                dimlen0 = gridInqSize(gridID0);
+                if ( dimlen == dimlen0 )
+                  {
+                    dimID = streamptr->ydimID[index];
+                    break;
+                  }
+                else
+                  iz++; 
+              }
+          }
+      }
+
+  if ( dimID == UNDEFID )
+    {
+      if ( iz == 0 ) axisname[5] = '\0';
+      else           sprintf(&axisname[5], "%1d", iz+1);
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  streamptr->xdimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefUnstructured(int streamID, int gridID)
+{
+  char xunits[CDI_MAX_NAME];
+  char xlongname[CDI_MAX_NAME];
+  char xstdname[CDI_MAX_NAME];
+  char yunits[CDI_MAX_NAME];
+  char ylongname[CDI_MAX_NAME];
+  char ystdname[CDI_MAX_NAME];
+  char xaxisname[CDI_MAX_NAME];
+  char yaxisname[CDI_MAX_NAME];
+  int index;
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  size_t len;
+  int ncxvarid = UNDEFID, ncyvarid = UNDEFID;
+  int ncbxvarid = UNDEFID, ncbyvarid = UNDEFID, ncavarid = UNDEFID;
+  int nvertex, nvdimID = UNDEFID;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqSize(gridID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+
+  gridInqXname(gridID, xaxisname);
+  gridInqXlongname(gridID, xlongname);
+  gridInqXstdname(gridID, xstdname);
+  gridInqXunits(gridID, xunits);
+  gridInqYname(gridID, yaxisname);
+  gridInqYlongname(gridID, ylongname);
+  gridInqYstdname(gridID, ystdname);
+  gridInqYunits(gridID, yunits);
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->xdimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_UNSTRUCTURED )
+            {
+              dimlen0 = gridInqSize(gridID0);
+              if ( dimlen == dimlen0 )
+		if ( gridInqNvertex(gridID0) == gridInqNvertex(gridID) &&
+		     IS_EQUAL(gridInqXval(gridID0, 0), gridInqXval(gridID, 0)) &&
+                     IS_EQUAL(gridInqXval(gridID0, dimlen-1), gridInqXval(gridID, dimlen-1)) )
+		  {
+		    dimID = streamptr->xdimID[index];
+		    break;
+		  }
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      int status;
+      char axisname[CDI_MAX_NAME];
+      char vertname[CDI_MAX_NAME];
+      strcpy(axisname, "ncells");
+      strcpy(vertname, "nv");
+
+      status = checkGridName('V', xaxisname, fileID, vlistID, gridID, ngrids, 'X');
+      status = checkGridName('V', yaxisname, fileID, vlistID, gridID, ngrids, 'Y');
+      status = checkGridName('D', axisname, fileID, vlistID, gridID, ngrids, 'X');
+      status = checkGridName('D', vertname, fileID, vlistID, gridID, ngrids, 'X');
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      nvertex = gridInqNvertex(gridID);
+      if ( nvertex > 0 ) cdf_def_dim(fileID, vertname, nvertex, &nvdimID);
+
+      if ( gridInqXvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, xaxisname, (nc_type) xtype, 1, &dimID, &ncxvarid);
+          cdfGridCompress(fileID, ncxvarid, dimlen, streamptr->filetype, streamptr->comptype);
+
+          if ( (len = strlen(xstdname)) )
+            cdf_put_att_text(fileID, ncxvarid, "standard_name", len, xstdname);
+          if ( (len = strlen(xlongname)) )
+            cdf_put_att_text(fileID, ncxvarid, "long_name", len, xlongname);
+          if ( (len = strlen(xunits)) )
+            cdf_put_att_text(fileID, ncxvarid, "units", len, xunits);
+
+          streamptr->ncxvarID[gridindex] = ncxvarid;
+
+          if ( gridInqXboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              int dimIDs[2];
+              dimIDs[0] = dimID;
+              dimIDs[1] = nvdimID;
+              strcat(xaxisname, "_vertices");
+              cdf_def_var(fileID, xaxisname, (nc_type) xtype, 2, dimIDs, &ncbxvarid);
+              cdfGridCompress(fileID, ncbxvarid, dimlen, streamptr->filetype, streamptr->comptype);
+
+              cdf_put_att_text(fileID, ncxvarid, "bounds", strlen(xaxisname), xaxisname);
+            }
+        }
+
+      if ( gridInqYvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, yaxisname, (nc_type) xtype, 1, &dimID, &ncyvarid);
+          cdfGridCompress(fileID, ncyvarid, dimlen, streamptr->filetype, streamptr->comptype);
+
+          if ( (len = strlen(ystdname)) )
+            cdf_put_att_text(fileID, ncyvarid, "standard_name", len, ystdname);
+          if ( (len = strlen(ylongname)) )
+            cdf_put_att_text(fileID, ncyvarid, "long_name", len, ylongname);
+          if ( (len = strlen(yunits)) )
+            cdf_put_att_text(fileID, ncyvarid, "units", len, yunits);
+
+          streamptr->ncyvarID[gridindex] = ncyvarid;
+
+          if ( gridInqYboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              int dimIDs[2];
+              dimIDs[0] = dimID;
+              dimIDs[1] = nvdimID;
+              strcat(yaxisname, "_vertices");
+              cdf_def_var(fileID, yaxisname, (nc_type) xtype, 2, dimIDs, &ncbyvarid);
+              cdfGridCompress(fileID, ncbyvarid, dimlen, streamptr->filetype, streamptr->comptype);
+
+              cdf_put_att_text(fileID, ncyvarid, "bounds", strlen(yaxisname), yaxisname);
+            }
+        }
+
+      if ( gridInqAreaPtr(gridID) )
+        {
+          char yaxisname[] = "cell_area";
+          char units[] = "m2";
+          char longname[] = "area of grid cell";
+          char stdname[] = "cell_area";
+
+          cdf_def_var(fileID, yaxisname, (nc_type) xtype, 1, &dimID, &ncavarid);
+
+          cdf_put_att_text(fileID, ncavarid, "standard_name", strlen(stdname), stdname);
+          cdf_put_att_text(fileID, ncavarid, "long_name", strlen(longname), longname);
+          cdf_put_att_text(fileID, ncavarid, "units", strlen(units), units);
+
+          streamptr->ncavarID[gridindex] = ncavarid;
+        }
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+
+      if ( ncxvarid  != UNDEFID ) cdf_put_var_double(fileID, ncxvarid,  gridInqXvalsPtr(gridID));
+      if ( ncbxvarid != UNDEFID ) cdf_put_var_double(fileID, ncbxvarid, gridInqXboundsPtr(gridID));
+      if ( ncyvarid  != UNDEFID ) cdf_put_var_double(fileID, ncyvarid,  gridInqYvalsPtr(gridID));
+      if ( ncbyvarid != UNDEFID ) cdf_put_var_double(fileID, ncbyvarid, gridInqYboundsPtr(gridID));
+      if ( ncavarid  != UNDEFID ) cdf_put_var_double(fileID, ncavarid,  gridInqAreaPtr(gridID));
+    }
+
+  streamptr->xdimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefVCT(int streamID, int zaxisID)
+{
+  int type;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  type = zaxisInqType(zaxisID);
+  if ( type == ZAXIS_HYBRID || type == ZAXIS_HYBRID_HALF )
+    {
+      int i;
+      int fileID;
+      int ilev = zaxisInqVctSize(zaxisID)/2;
+      int mlev = ilev - 1;
+      size_t start;
+      size_t count = 1;
+      int ncdimid, ncdimid2;
+      int hyaiid, hybiid, hyamid, hybmid;
+      double mval;
+      char tmpname[CDI_MAX_NAME];
+
+      if ( streamptr->vct.ilev > 0 )
+        {
+          if ( streamptr->vct.ilev != ilev )
+            Error("more than one VCT for each file unsupported!");
+          return;
+        }
+
+      if ( ilev == 0 )
+        {
+          Warning("VCT missing");
+          return;
+        }
+
+      fileID = streamInqFileID(streamID);
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, "nhym", mlev, &ncdimid);
+      cdf_def_dim(fileID, "nhyi", ilev, &ncdimid2);
+
+      streamptr->vct.mlev   = mlev;
+      streamptr->vct.ilev   = ilev;
+      streamptr->vct.mlevID = ncdimid;
+      streamptr->vct.ilevID = ncdimid2;
+
+      cdf_def_var(fileID, "hyai", NC_DOUBLE, 1, &ncdimid2, &hyaiid);
+      cdf_def_var(fileID, "hybi", NC_DOUBLE, 1, &ncdimid2, &hybiid);
+      cdf_def_var(fileID, "hyam", NC_DOUBLE, 1, &ncdimid,  &hyamid);
+      cdf_def_var(fileID, "hybm", NC_DOUBLE, 1, &ncdimid,  &hybmid);
+
+      strcpy(tmpname, "hybrid A coefficient at layer interfaces");
+      cdf_put_att_text(fileID, hyaiid, "long_name", strlen(tmpname), tmpname);
+      strcpy(tmpname, "Pa");
+      cdf_put_att_text(fileID, hyaiid, "units", strlen(tmpname), tmpname);
+      strcpy(tmpname, "hybrid B coefficient at layer interfaces");
+      cdf_put_att_text(fileID, hybiid, "long_name", strlen(tmpname), tmpname);
+      strcpy(tmpname, "1");
+      cdf_put_att_text(fileID, hybiid, "units", strlen(tmpname), tmpname);
+      strcpy(tmpname, "hybrid A coefficient at layer midpoints");
+      cdf_put_att_text(fileID, hyamid, "long_name", strlen(tmpname), tmpname);
+      strcpy(tmpname, "Pa");
+      cdf_put_att_text(fileID, hyamid, "units", strlen(tmpname), tmpname);
+      strcpy(tmpname, "hybrid B coefficient at layer midpoints");
+      cdf_put_att_text(fileID, hybmid, "long_name", strlen(tmpname), tmpname);
+      strcpy(tmpname, "1");
+      cdf_put_att_text(fileID, hybmid, "units", strlen(tmpname), tmpname);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+
+      const double *vctptr = zaxisInqVctPtr(zaxisID);
+
+      cdf_put_var_double(fileID, hyaiid, vctptr);
+      cdf_put_var_double(fileID, hybiid, vctptr+ilev);
+
+      for ( i = 0; i < mlev; i++ )
+        {
+          start = i;
+          mval = (vctptr[i] + vctptr[i+1]) * 0.5;
+          cdf_put_vara_double(fileID, hyamid, &start, &count, &mval);
+          mval = (vctptr[ilev+i] + vctptr[ilev+i+1]) * 0.5;
+          cdf_put_vara_double(fileID, hybmid, &start, &count, &mval);
+        }
+    }
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefZaxis(int streamID, int zaxisID)
+{
+  /*  char zaxisname0[CDI_MAX_NAME]; */
+  char axisname[CDI_MAX_NAME];
+  char stdname[CDI_MAX_NAME];
+  char longname[CDI_MAX_NAME];
+  char units[CDI_MAX_NAME];
+  char tmpname[CDI_MAX_NAME];
+  int index;
+  int zaxisID0;
+  int dimID = UNDEFID;
+  int dimIDs[2];
+  int fileID;
+  int dimlen;
+  size_t len;
+  int ncvarid = UNDEFID, ncbvarid = UNDEFID;
+  int nvertex = 2, nvdimID = UNDEFID;
+  int type;
+  int nzaxis;
+  int ilevel = 0;
+  int vlistID;
+  int zaxisindex;
+  int xtype = NC_DOUBLE;
+  int positive;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( zaxisInqPrec(zaxisID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+
+  nzaxis = vlistNzaxis(vlistID);
+
+  dimlen = zaxisInqSize(zaxisID);
+  type   = zaxisInqType(zaxisID);
+
+  if ( dimlen == 1 && type == ZAXIS_SURFACE     ) return;
+  if ( dimlen == 1 && type == ZAXIS_TOA         ) return;
+  if ( dimlen == 1 && type == ZAXIS_SEA_BOTTOM  ) return;
+  if ( dimlen == 1 && type == ZAXIS_ATMOSPHERE  ) return;
+  if ( dimlen == 1 && type == ZAXIS_MEANSEA     ) return;
+
+  zaxisInqName(zaxisID, axisname);
+  /*
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      if ( streamptr->zaxisID[index] != UNDEFID )
+        {
+          zaxisID0 = vlistZaxis(vlistID, index);
+          zaxisInqName(zaxisID0, zaxisname0);
+          if ( strcmp(zaxisname0, axisname) == 0 ) ilevel++;
+        }
+    }
+  */
+  if ( dimID == UNDEFID )
+    {
+      char axisname0[CDI_MAX_NAME];
+      char axisname2[CDI_MAX_NAME];
+      int checkname = FALSE;
+      int status;
+
+      /* check that the name is not already defined */
+      checkname = TRUE;
+      ilevel = 0;
+
+      while ( checkname ) 
+        {
+          strcpy(axisname2, axisname);
+          if ( ilevel ) sprintf(&axisname2[strlen(axisname2)], "_%d", ilevel+1);
+
+          status = nc_inq_varid(fileID, axisname2, &ncvarid);
+          if ( status != NC_NOERR )
+            {
+              if ( ilevel )
+                {
+                  /* check that the name does not exist for other grids */
+                  for ( index = 0; index < nzaxis; index++ )
+                    {
+                      zaxisID0 = vlistZaxis(vlistID, index);
+                      if ( zaxisID != zaxisID0 )
+                        {
+                          zaxisInqName(zaxisID0, axisname0);
+                          if ( strcmp(axisname0, axisname2) == 0 ) break;
+                        }
+                    }
+                  if ( index == nzaxis ) checkname = FALSE;
+                }
+              else
+                {
+                  checkname = FALSE;
+                }
+            }
+
+          if ( checkname ) ilevel++;
+
+          if ( ilevel > 99 ) break;
+        }
+
+      if ( ilevel ) sprintf(&axisname[strlen(axisname)], "_%1d", ilevel+1);
+
+      if ( type == ZAXIS_HYBRID || type == ZAXIS_HYBRID_HALF )
+        {
+          if ( type == ZAXIS_HYBRID )
+            {
+	      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+	      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+	      cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID,  &ncvarid);
+
+	      strcpy(tmpname, "hybrid_sigma_pressure");
+	      cdf_put_att_text(fileID, ncvarid, "standard_name", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "hybrid level at layer midpoints");
+	      cdf_put_att_text(fileID, ncvarid, "long_name", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "level");
+	      cdf_put_att_text(fileID, ncvarid, "units", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "down");
+	      cdf_put_att_text(fileID, ncvarid, "positive", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "hyam hybm (mlev=hyam+hybm*aps)");
+	      cdf_put_att_text(fileID, ncvarid, "formula", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "ap: hyam b: hybm ps: aps");
+	      cdf_put_att_text(fileID, ncvarid, "formula_terms", strlen(tmpname), tmpname);
+	      /*
+	      strcpy(tmpname, "ilev");
+	      cdf_put_att_text(fileID, ncvarid, "borders", strlen(tmpname), tmpname);
+	      */
+	      cdf_enddef(fileID);
+	      streamptr->ncmode = 2;
+
+	      cdf_put_var_double(fileID, ncvarid, zaxisInqLevelsPtr(zaxisID));
+            }
+
+          if ( type == ZAXIS_HYBRID_HALF )
+            {
+	      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+	      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+	      cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID,  &ncvarid);
+
+	      strcpy(tmpname, "hybrid_sigma_pressure");
+	      cdf_put_att_text(fileID, ncvarid, "standard_name", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "hybrid level at layer interfaces");
+	      cdf_put_att_text(fileID, ncvarid, "long_name", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "level");
+	      cdf_put_att_text(fileID, ncvarid, "units", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "down");
+	      cdf_put_att_text(fileID, ncvarid, "positive", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "hyai hybi (ilev=hyai+hybi*aps)");
+	      cdf_put_att_text(fileID, ncvarid, "formula", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "ap: hyai b: hybi ps: aps");
+	      cdf_put_att_text(fileID, ncvarid, "formula_terms", strlen(tmpname), tmpname);
+
+	      cdf_enddef(fileID);
+	      streamptr->ncmode = 2;
+
+	      cdf_put_var_double(fileID, ncvarid, zaxisInqLevelsPtr(zaxisID));
+            }
+
+          cdfDefVCT(streamID, zaxisID);
+
+          if ( dimID == UNDEFID )
+            {
+              if ( type == ZAXIS_HYBRID )
+                streamptr->zaxisID[zaxisindex] = streamptr->vct.mlevID;
+              else
+                streamptr->zaxisID[zaxisindex] = streamptr->vct.ilevID;
+            }
+        }
+      else
+        {
+          if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+          cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+          zaxisInqLongname(zaxisID, longname);
+          zaxisInqUnits(zaxisID, units);
+          zaxisInqStdname(zaxisID, stdname);
+
+          cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID, &ncvarid);
+
+          if ( (len = strlen(stdname)) )
+            cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname);
+          if ( (len = strlen(longname)) )
+            cdf_put_att_text(fileID, ncvarid, "long_name", len, longname);
+          if ( (len = strlen(units)) )
+            cdf_put_att_text(fileID, ncvarid, "units", len, units);
+
+	  positive = zaxisInqPositive(zaxisID);
+	  if ( positive == 1 )
+	    {
+	      strcpy(tmpname, "up");
+	      cdf_put_att_text(fileID, ncvarid, "positive", strlen(tmpname), tmpname);
+	    }
+	  else if ( positive == 2 )
+	    {
+	      strcpy(tmpname, "down");
+	      cdf_put_att_text(fileID, ncvarid, "positive", strlen(tmpname), tmpname);
+	    }
+
+          cdf_put_att_text(fileID, ncvarid, "axis", 1, "Z");
+
+	  if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+            {
+	      if ( nc_inq_dimid(fileID, "nb2", &nvdimID) != NC_NOERR )
+		cdf_def_dim(fileID, "nb2", nvertex, &nvdimID);
+
+	      if ( nvdimID != UNDEFID )
+		{
+		  strcat(axisname, "_bnds");
+		  dimIDs[0] = dimID;
+		  dimIDs[1] = nvdimID;
+		  cdf_def_var(fileID, axisname, (nc_type) xtype, 2, dimIDs, &ncbvarid);
+		  cdf_put_att_text(fileID, ncvarid, "bounds", strlen(axisname), axisname);
+		}
+	    }
+
+          cdf_enddef(fileID);
+          streamptr->ncmode = 2;
+
+          cdf_put_var_double(fileID, ncvarid, zaxisInqLevelsPtr(zaxisID));
+
+          if ( ncbvarid != UNDEFID )
+	    {
+	      int i;
+	      double *zbounds, *lbounds, *ubounds;
+
+	      lbounds = (double *) malloc(dimlen*sizeof(double));
+	      ubounds = (double *) malloc(dimlen*sizeof(double));
+	      zbounds = (double *) malloc(2*dimlen*sizeof(double));
+
+	      zaxisInqLbounds(zaxisID, lbounds);
+	      zaxisInqUbounds(zaxisID, ubounds);
+
+	      for ( i = 0; i < dimlen; ++i )
+		{
+		  zbounds[2*i  ] = lbounds[i];
+		  zbounds[2*i+1] = ubounds[i];
+		}
+
+	      cdf_put_var_double(fileID, ncbvarid, zbounds);
+
+	      free(zbounds);
+	      free(ubounds);
+	      free(lbounds);
+	    }
+        }
+    }
+
+  if ( dimID != UNDEFID )
+    streamptr->zaxisID[zaxisindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefPole(int streamID, int gridID)
+{
+  int fileID;
+  int ncvarid = UNDEFID;
+  int ncerr;
+  double xpole, ypole, angle;
+  char varname[] = "rotated_pole";
+  char mapname[] = "rotated_latitude_longitude";
+
+  fileID  = streamInqFileID(streamID);
+
+  ypole = gridInqYpole(gridID);
+  xpole = gridInqXpole(gridID);
+  angle = gridInqAngle(gridID);
+
+  cdf_redef(fileID);
+
+  ncerr = nc_def_var(fileID, varname, (nc_type) NC_CHAR, 0, NULL, &ncvarid);
+  if ( ncerr == NC_NOERR )
+    {
+      cdf_put_att_text(fileID, ncvarid, "grid_mapping_name", strlen(mapname), mapname);
+      cdf_put_att_double(fileID, ncvarid, "grid_north_pole_latitude", NC_DOUBLE, 1, &ypole);
+      cdf_put_att_double(fileID, ncvarid, "grid_north_pole_longitude", NC_DOUBLE, 1, &xpole);
+      if ( angle > 0 )
+        cdf_put_att_double(fileID, ncvarid, "north_pole_grid_longitude", NC_DOUBLE, 1, &angle);
+    }
+
+  cdf_enddef(fileID);
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefMapping(int streamID, int gridID)
+{
+  int fileID;
+  int ncvarid = UNDEFID;
+  int ncerr;
+
+  if ( gridInqType(gridID) == GRID_SINUSOIDAL )
+    {
+      char varname[] = "sinusoidal";
+      char mapname[] = "sinusoidal";
+
+      fileID  = streamInqFileID(streamID);
+
+      cdf_redef(fileID);
+
+      ncerr = nc_def_var(fileID, varname, (nc_type) NC_CHAR, 0, NULL, &ncvarid);
+      if ( ncerr == NC_NOERR )
+        {
+          cdf_put_att_text(fileID, ncvarid, "grid_mapping_name", strlen(mapname), mapname);
+          /*
+          cdf_put_att_double(fileID, ncvarid, "grid_north_pole_latitude", NC_DOUBLE, 1, &ypole);
+          cdf_put_att_double(fileID, ncvarid, "grid_north_pole_longitude", NC_DOUBLE, 1, &xpole);
+          */
+        }
+
+      cdf_enddef(fileID);
+    }
+  else if ( gridInqType(gridID) == GRID_LAEA )
+    {
+      char varname[] = "laea";
+      char mapname[] = "lambert_azimuthal_equal_area";
+
+      fileID  = streamInqFileID(streamID);
+
+      cdf_redef(fileID);
+
+      ncerr = nc_def_var(fileID, varname, (nc_type) NC_CHAR, 0, NULL, &ncvarid);
+      if ( ncerr == NC_NOERR )
+        {
+          double a, lon_0, lat_0;
+
+          gridInqLaea(gridID, &a, &lon_0, &lat_0);
+
+          cdf_put_att_text(fileID, ncvarid, "grid_mapping_name", strlen(mapname), mapname);
+          cdf_put_att_double(fileID, ncvarid, "earth_radius", NC_DOUBLE, 1, &a);
+          cdf_put_att_double(fileID, ncvarid, "longitude_of_projection_origin", NC_DOUBLE, 1, &lon_0);
+          cdf_put_att_double(fileID, ncvarid, "latitude_of_projection_origin", NC_DOUBLE, 1, &lat_0);
+        }
+
+      cdf_enddef(fileID);
+    }
+  else if ( gridInqType(gridID) == GRID_LCC2 )
+    {
+      char varname[] = "Lambert_Conformal";
+      char mapname[] = "lambert_conformal_conic";
+
+      fileID  = streamInqFileID(streamID);
+
+      cdf_redef(fileID);
+
+      ncerr = nc_def_var(fileID, varname, (nc_type) NC_CHAR, 0, NULL, &ncvarid);
+      if ( ncerr == NC_NOERR )
+        {
+          double radius, lon_0, lat_0, lat_1, lat_2;
+
+          gridInqLcc2(gridID, &radius, &lon_0, &lat_0, &lat_1, &lat_2);
+
+          cdf_put_att_text(fileID, ncvarid, "grid_mapping_name", strlen(mapname), mapname);
+          if ( radius > 0 )
+            cdf_put_att_double(fileID, ncvarid, "earth_radius", NC_DOUBLE, 1, &radius);
+          cdf_put_att_double(fileID, ncvarid, "longitude_of_central_meridian", NC_DOUBLE, 1, &lon_0);
+          cdf_put_att_double(fileID, ncvarid, "latitude_of_projection_origin", NC_DOUBLE, 1, &lat_0);
+          if ( IS_EQUAL(lat_1, lat_2) )
+            cdf_put_att_double(fileID, ncvarid, "standard_parallel", NC_DOUBLE, 1, &lat_1);
+          else
+            {
+              double lat_1_2[2];
+              lat_1_2[0] = lat_1;
+              lat_1_2[1] = lat_2;
+              cdf_put_att_double(fileID, ncvarid, "standard_parallel", NC_DOUBLE, 2, lat_1_2);
+            }
+        }
+
+      cdf_enddef(fileID);
+    }
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefGrid(int streamID, int gridID)
+{
+  int gridtype, size;
+  int gridindex;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( streamptr->xdimID[gridindex] != UNDEFID ) return;
+
+  gridtype = gridInqType(gridID);
+  size     = gridInqSize(gridID);
+
+  if ( CDI_Debug )
+    Message("gridtype = %d  size = %d", gridtype, size);
+
+  if ( gridtype == GRID_GAUSSIAN ||
+       gridtype == GRID_LONLAT   ||
+       gridtype == GRID_GENERIC )
+    {
+      if ( gridtype == GRID_GENERIC && size == 1 && 
+           gridInqXsize(gridID) == 0 && gridInqYsize(gridID) == 0 )
+        {
+          /* no grid information */
+        }
+      else if ( gridtype == GRID_GENERIC && (gridInqXsize(gridID) == 0 || gridInqYsize(gridID) == 0) )
+        {
+          cdfDefGdim(streamID, gridID);
+        }
+      else
+        {
+          if ( gridInqXsize(gridID) > 0 ) cdfDefXaxis(streamID, gridID);
+          if ( gridInqYsize(gridID) > 0 ) cdfDefYaxis(streamID, gridID);
+        }
+
+      if ( gridIsRotated(gridID) ) cdfDefPole(streamID, gridID);
+    }
+  else if ( gridtype == GRID_CURVILINEAR )
+    {
+      cdfDefCurvilinear(streamID, gridID);
+    }
+  else if ( gridtype == GRID_UNSTRUCTURED )
+    {
+      cdfDefUnstructured(streamID, gridID);
+    }
+  else if ( gridtype == GRID_GAUSSIAN_REDUCED )
+    {
+      cdfDefRgrid(streamID, gridID);
+    }
+  else if ( gridtype == GRID_SPECTRAL )
+    {
+      cdfDefComplex(streamID, gridID);
+      cdfDefSP(streamID, gridID);
+    }
+  else if ( gridtype == GRID_FOURIER )
+    {
+      cdfDefComplex(streamID, gridID);
+      cdfDefFC(streamID, gridID);
+    }
+  else if ( gridtype == GRID_TRAJECTORY )
+    {
+      cdfDefTrajLon(streamID, gridID);
+      cdfDefTrajLat(streamID, gridID);
+    }
+  else if ( gridtype == GRID_SINUSOIDAL || gridtype == GRID_LAEA || gridtype == GRID_LCC2 )
+    {
+      cdfDefXaxis(streamID, gridID);
+      cdfDefYaxis(streamID, gridID);
+
+      cdfDefMapping(streamID, gridID);
+    }
+  /*
+  else if ( gridtype == GRID_LCC )
+    {
+      cdfDefLcc(streamID, gridID);
+    }
+  */
+  else
+    {
+      Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+    }
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+int cdfDefVar(int streamID, int varID)
+{
+  int ncvarid = -1;
+  int fileID;
+  int xid = UNDEFID, yid = UNDEFID, zid = UNDEFID, tid = UNDEFID;
+  size_t xsize = 0, ysize = 0;
+  int code, param, gridID, zaxisID;
+  int pnum, pcat, pdis;
+  char varname[CDI_MAX_NAME];
+  const char *name = NULL;
+  const char *longname = NULL;
+  const char *stdname = NULL;
+  const char *units = NULL;
+  int dims[4];
+  int lchunk = FALSE;
+  int chunktype;
+  size_t chunks[4] = {0,0,0,0};
+  int tableID;
+  int ndims = 0;
+  int len;
+  int tsteptype;
+  int xtype, dtype;
+  int gridtype, gridsize;
+  int gridindex, zaxisindex;
+  int tablenum;
+  int vlistID;
+  int dimorder[3];
+  int ixyz;
+  int iax = 0;
+  char axis[5];
+  stream_t *streamptr;
+  int ensID, ensCount, forecast_type;
+  int retval;
+
+  streamptr = stream_to_pointer(streamID);
+
+  fileID  = streamInqFileID(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d, fileID = %d, varID = %d", streamID, fileID, varID);
+
+  if ( streamptr->vars[varID].ncvarid != UNDEFID )
+    return (streamptr->vars[varID].ncvarid);
+
+  vlistID   = streamInqVlist(streamID);
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+  code      = vlistInqVarCode(vlistID, varID);
+  param     = vlistInqVarParam(vlistID, varID);
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+
+  chunktype = vlistInqVarChunkType(vlistID, varID);
+
+  ixyz    = vlistInqVarXYZ(vlistID, varID);
+  if ( ixyz == 0 ) ixyz = 321; // ZYX
+
+  gridsize  = gridInqSize(gridID);
+  if ( gridsize > 1 ) lchunk = TRUE;
+  gridtype  = gridInqType(gridID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( gridtype != GRID_TRAJECTORY )
+    {
+      xid = streamptr->xdimID[gridindex];
+      yid = streamptr->ydimID[gridindex];
+      if ( xid != UNDEFID ) cdf_inq_dimlen(fileID, xid, &xsize);
+      if ( yid != UNDEFID ) cdf_inq_dimlen(fileID, yid, &ysize);
+    }
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+  zid = streamptr->zaxisID[zaxisindex];
+
+  dimorder[0] = ixyz/100;
+  dimorder[1] = (ixyz-dimorder[0]*100)/10;
+  dimorder[2] = (ixyz-dimorder[0]*100-dimorder[1]*10);
+  if ( dimorder[0] != 3 ) lchunk = FALSE; /* ZYX and ZXY */
+
+  if ( ((dimorder[0]>0)+(dimorder[1]>0)+(dimorder[2]>0)) < ((xid!=UNDEFID)+(yid!=UNDEFID)+(zid!=UNDEFID)) )
+    {
+      printf("xyz=%d  zid=%d  yid=%d  xid=%d\n", ixyz, zid, yid, xid);
+      Error("Internal problem, dimension order missing!");
+    }
+
+  tid = streamptr->basetime.ncdimid;
+
+  if ( tsteptype != TSTEP_CONSTANT )
+    {
+      if ( tid == UNDEFID ) Error("Internal problem, time undefined!");
+      chunks[ndims] = 1;
+      dims[ndims++] = tid;
+      axis[iax++] = 'T';
+    }
+  /*
+  if ( zid != UNDEFID ) axis[iax++] = 'Z';
+  if ( zid != UNDEFID ) chunks[ndims] = 1;
+  if ( zid != UNDEFID ) dims[ndims++] = zid;
+
+  if ( yid != UNDEFID ) chunks[ndims] = ysize;
+  if ( yid != UNDEFID ) dims[ndims++] = yid;
+
+  if ( xid != UNDEFID ) chunks[ndims] = xsize;
+  if ( xid != UNDEFID ) dims[ndims++] = xid;
+  */
+  for ( int id = 0; id < 3; ++id )
+    {
+      if ( dimorder[id] == 3 && zid != UNDEFID )
+        {
+          axis[iax++] = 'Z';
+          chunks[ndims] = 1;
+          dims[ndims] = zid;
+          ndims++;
+        }
+      else if ( dimorder[id] == 2 && yid != UNDEFID )
+        {
+          if ( chunktype == CHUNK_LINES )
+            chunks[ndims] = 1;
+          else
+            chunks[ndims] = ysize;
+          dims[ndims] = yid;
+          ndims++;
+        }
+      else if ( dimorder[id] == 1 && xid != UNDEFID )
+        {
+          chunks[ndims] = xsize;
+          dims[ndims] = xid;
+          ndims++;
+        }
+    }
+
+  if ( CDI_Debug )
+    fprintf(stderr, "chunktype %d  chunks %d %d %d %d\n", chunktype, (int)chunks[0], (int)chunks[1], (int)chunks[2], (int)chunks[3]);
+
+  tableID  = vlistInqVarTable(vlistID, varID);
+
+  name     = vlistInqVarNamePtr(vlistID, varID);
+  longname = vlistInqVarLongnamePtr(vlistID, varID);
+  stdname  = vlistInqVarStdnamePtr(vlistID, varID);
+  units    = vlistInqVarUnitsPtr(vlistID, varID);
+
+  if ( name     == NULL )     name = tableInqParNamePtr(tableID, code);
+  if ( longname == NULL ) longname = tableInqParLongnamePtr(tableID, code);
+  if ( units    == NULL )    units = tableInqParUnitsPtr(tableID, code);
+  if ( name )
+    {
+      int checkname;
+      int iz;
+      int status;
+
+      sprintf(varname, "%s", name);
+
+      checkname = TRUE;
+      iz = 0;
+
+      while ( checkname ) 
+        {
+          if ( iz ) sprintf(varname, "%s_%d", name, iz+1);
+
+          status = nc_inq_varid(fileID, varname, &ncvarid);
+          if ( status != NC_NOERR )
+            {
+              checkname = FALSE;
+            }
+
+          if ( checkname ) iz++;
+
+          if ( iz >= CDI_MAX_NAME ) Error("Double entry of variable name '%s'!", name);
+        }
+
+      if ( strcmp(name, varname) != 0 )
+        {
+          if ( iz == 1 )
+            Warning("Changed double entry of variable name '%s' to '%s'!", name, varname);
+          else
+            Warning("Changed multiple entry of variable name '%s' to '%s'!", name, varname);
+        }
+
+      name = varname;
+    }
+  else
+    {
+      int checkname;
+      int iz;
+      int status;
+      char *varname2;
+
+      if ( code < 0 ) code = -code;
+      if ( pnum < 0 ) pnum = -pnum;
+
+      if ( pdis == 255 )
+	sprintf(varname, "var%d", code);
+      else
+	sprintf(varname, "param%d.%d.%d", pnum, pcat, pdis);
+
+      varname2 = varname+strlen(varname);
+
+      checkname = TRUE;
+      iz = 0;
+
+      while ( checkname )
+        {
+          if ( iz ) sprintf(varname2, "_%d", iz+1);
+
+          status = nc_inq_varid(fileID, varname, &ncvarid);
+          if ( status != NC_NOERR ) checkname = FALSE;
+
+          if ( checkname ) iz++;
+
+          if ( iz >= CDI_MAX_NAME ) break;
+        }
+
+      name = varname;
+      code = 0;
+      pdis = 255;
+    }
+
+  /* if ( streamptr->ncmode == 2 ) cdf_redef(fileID); */
+
+  dtype = vlistInqVarDatatype(vlistID, varID);
+  xtype = cdfDefDatatype(dtype, streamptr->filetype);
+
+  cdf_def_var(fileID, name, (nc_type) xtype, ndims, dims, &ncvarid);
+
+#if  defined  (HAVE_NETCDF4)
+  if ( lchunk && (streamptr->filetype == FILETYPE_NC4 || streamptr->filetype == FILETYPE_NC4C) )
+    {
+      if ( chunktype == CHUNK_AUTO )
+        retval = nc_def_var_chunking(fileID, ncvarid, NC_CHUNKED, NULL);
+      else
+        retval = nc_def_var_chunking(fileID, ncvarid, NC_CHUNKED, chunks);
+
+      if ( retval ) Error("nc_def_var_chunking failed, status = %d", retval);
+    }
+#endif
+
+  if ( streamptr->comptype == COMPRESS_ZIP )
+    {
+      if ( lchunk && (streamptr->filetype == FILETYPE_NC4 || streamptr->filetype == FILETYPE_NC4C) )
+        {
+          cdfDefVarDeflate(fileID, ncvarid, streamptr->complevel);
+        }
+      else
+        {
+          if ( lchunk )
+            {
+              static int lwarn = TRUE;
+
+              if ( lwarn )
+                {
+                  lwarn = FALSE;
+                  Warning("Deflate compression is only available for netCDF4!");
+                }
+            }
+        }
+    }
+
+  if ( streamptr->comptype == COMPRESS_SZIP )
+    {
+      if ( lchunk && (streamptr->filetype == FILETYPE_NC4 || streamptr->filetype == FILETYPE_NC4C) )
+        {
+#if defined (NC_SZIP_NN_OPTION_MASK)
+          cdfDefVarSzip(fileID, ncvarid);
+#else
+          static int lwarn = TRUE;
+
+          if ( lwarn )
+            {
+              lwarn = FALSE;
+              Warning("netCDF4/SZIP compression not available!");
+            }
+#endif
+        }
+      else
+        {
+          static int lwarn = TRUE;
+
+          if ( lwarn )
+            {
+              lwarn = FALSE;
+              Warning("SZIP compression is only available for netCDF4!");
+            }
+        }
+    }
+
+  if ( stdname && *stdname )
+    cdf_put_att_text(fileID, ncvarid, "standard_name", strlen(stdname), stdname);
+
+  if ( longname && *longname )
+    cdf_put_att_text(fileID, ncvarid, "long_name", strlen(longname), longname);
+
+  if ( units && *units )
+    cdf_put_att_text(fileID, ncvarid, "units", strlen(units), units);
+
+  if ( code > 0 && pdis == 255 )
+    cdf_put_att_int(fileID, ncvarid, "code", NC_INT, 1, &code);
+
+  if ( pdis != 255 )
+    {
+      char paramstr[32];
+      cdiParamToString(param, paramstr, sizeof(paramstr));
+      cdf_put_att_text(fileID, ncvarid, "param", strlen(paramstr), paramstr);
+    }
+
+  if ( tableID != UNDEFID )
+    {
+      tablenum = tableInqNum(tableID);
+      if ( tablenum > 0 )
+        cdf_put_att_int(fileID, ncvarid, "table", NC_INT, 1, &tablenum);
+    }
+
+  if ( gridtype != GRID_GENERIC && gridtype != GRID_LONLAT  &&
+       gridtype != GRID_CURVILINEAR )
+    {
+      len = strlen(gridNamePtr(gridtype));
+      if ( len > 0 )
+        cdf_put_att_text(fileID, ncvarid, "grid_type", len, gridNamePtr(gridtype));
+    }
+
+  if ( gridIsRotated(gridID) )
+    {
+      char mapping[] = "rotated_pole";
+      cdf_put_att_text(fileID, ncvarid, "grid_mapping", strlen(mapping), mapping);
+    }
+
+  if ( gridtype == GRID_SINUSOIDAL )
+    {
+      char mapping[] = "sinusoidal";
+      cdf_put_att_text(fileID, ncvarid, "grid_mapping", strlen(mapping), mapping);
+    }
+  else if ( gridtype == GRID_LAEA )
+    {
+      char mapping[] = "laea";
+      cdf_put_att_text(fileID, ncvarid, "grid_mapping", strlen(mapping), mapping);
+    }
+  else if ( gridtype == GRID_LCC2 )
+    {
+      char mapping[] = "Lambert_Conformal";
+      cdf_put_att_text(fileID, ncvarid, "grid_mapping", strlen(mapping), mapping);
+    }
+  else if ( gridtype == GRID_TRAJECTORY )
+    {
+      cdf_put_att_text(fileID, ncvarid, "coordinates", 9, "tlon tlat" );
+    }
+  else if ( gridtype == GRID_UNSTRUCTURED || gridtype == GRID_CURVILINEAR )
+    {
+      char coordinates[CDI_MAX_NAME] = "";
+      char cellarea[CDI_MAX_NAME] = "area: ";
+      int ncxvarID, ncyvarID, ncavarID;
+      int gridindex;
+      size_t len;
+
+      gridindex = vlistGridIndex(vlistID, gridID);
+      ncxvarID = streamptr->ncxvarID[gridindex];
+      ncyvarID = streamptr->ncyvarID[gridindex];
+      ncavarID = streamptr->ncavarID[gridindex];
+      if ( ncxvarID != CDI_UNDEFID )
+        cdf_inq_varname(fileID, ncxvarID, coordinates);
+      len = strlen(coordinates);
+      if ( ncyvarID != CDI_UNDEFID )
+        {
+          if ( len ) coordinates[len++] = ' ';
+          cdf_inq_varname(fileID, ncyvarID, coordinates+len);
+        }
+      len = strlen(coordinates);
+      if ( len )
+        cdf_put_att_text(fileID, ncvarid, "coordinates", len, coordinates);
+
+      if ( ncavarID != CDI_UNDEFID )
+        {
+          len = strlen(cellarea);
+          cdf_inq_varname(fileID, ncavarID, cellarea+len);
+          len = strlen(cellarea);
+          cdf_put_att_text(fileID, ncvarid, "cell_measures", len, cellarea);
+        }
+    }
+  else if ( gridtype == GRID_SPECTRAL || gridtype == GRID_FOURIER )
+    {
+      int gridTruncation = gridInqTrunc(gridID);
+
+      axis[iax++] = '-';
+      axis[iax++] = '-';
+      cdf_put_att_text(fileID, ncvarid, "axis", iax, axis);
+      cdf_put_att_int(fileID, ncvarid, "truncation", NC_INT, 1, &gridTruncation);
+    }
+
+  /*  if ( xtype == NC_BYTE || xtype == NC_SHORT || xtype == NC_INT ) */
+    {
+      int laddoffset, lscalefactor;
+      double addoffset, scalefactor;
+      int astype = NC_DOUBLE;
+
+      addoffset    = vlistInqVarAddoffset(vlistID, varID);
+      scalefactor  = vlistInqVarScalefactor(vlistID, varID);
+      laddoffset   = IS_NOT_EQUAL(addoffset, 0);
+      lscalefactor = IS_NOT_EQUAL(scalefactor, 1);
+
+      if ( laddoffset || lscalefactor )
+        {
+          if ( IS_EQUAL(addoffset,   (double) ((float) addoffset)) &&
+               IS_EQUAL(scalefactor, (double) ((float) scalefactor)) )
+            {
+              astype = NC_FLOAT;
+            }
+
+          if ( xtype == (int) NC_FLOAT ) astype = NC_FLOAT;
+
+          cdf_put_att_double(fileID, ncvarid, "add_offset",   (nc_type) astype, 1, &addoffset);
+          cdf_put_att_double(fileID, ncvarid, "scale_factor", (nc_type) astype, 1, &scalefactor);
+        }
+    }
+
+  if ( dtype == DATATYPE_UINT8 && xtype == NC_BYTE )
+    {
+      int validrange[2] = {0, 255};
+      cdf_put_att_int(fileID, ncvarid, "valid_range", NC_SHORT, 2, validrange);
+      cdf_put_att_text(fileID, ncvarid, "_Unsigned", 4, "true");
+    }
+
+  streamptr->vars[varID].ncvarid = ncvarid;
+
+  if ( vlistInqVarMissvalUsed(vlistID, varID) )
+    cdfDefVarMissval(streamID, varID, vlistInqVarDatatype(vlistID, varID), 0);
+
+  if ( zid == -1 )
+    {
+      if ( zaxisInqType(zaxisID) == ZAXIS_TOA         || 
+           zaxisInqType(zaxisID) == ZAXIS_SEA_BOTTOM  ||
+           zaxisInqType(zaxisID) == ZAXIS_ATMOSPHERE )
+        {
+          zaxisInqName(zaxisID, varname);
+          cdf_put_att_text(fileID, ncvarid, "level_type", strlen(varname), varname);
+        }
+    }
+
+  if( vlistInqVarEnsemble( vlistID,  varID, &ensID, &ensCount, &forecast_type ) )
+    {
+      /* void cdf_put_att_int(  int ncid, int varid, const char *name, nc_type xtype,
+	                        size_t len, const int *ip )
+       */
+
+	cdf_put_att_int(fileID, ncvarid, "realization", NC_INT, 1, &ensID);
+	cdf_put_att_int(fileID, ncvarid, "ensemble_members", NC_INT, 1, &ensCount);
+	cdf_put_att_int(fileID, ncvarid, "forecast_init_type", NC_INT, 1, &forecast_type);
+
+#ifdef DBG
+	if( DBG )
+	  {
+	    fprintf( stderr, "cdfDefVar :\n EnsID  %d\n Enscount %d\n Forecast init type %d\n",  ensID,
+		     ensCount,  forecast_type );
+	  }
+#endif
+    }
+
+  /* Attributes */
+  defineAttributes(vlistID, varID, fileID, ncvarid);
+
+  /* if ( streamptr->ncmode == 2 ) cdf_enddef(fileID); */
+
+  return (ncvarid);
+}
+
+static
+void scale_add(long size, double *data, double addoffset, double scalefactor)
+{
+  long i;
+  int laddoffset;
+  int lscalefactor;
+
+  laddoffset   = IS_NOT_EQUAL(addoffset, 0);
+  lscalefactor = IS_NOT_EQUAL(scalefactor, 1);
+
+  if ( laddoffset || lscalefactor )
+    {
+      for ( i = 0; i < size; ++i )
+        {
+          if ( lscalefactor ) data[i] *= scalefactor;
+          if ( laddoffset )   data[i] += addoffset;
+        }
+    }
+}
+#endif
+
+void cdfReadVarDP(int streamID, int varID, double *data, int *nmiss)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  int gridID;
+  int zaxisID;
+  int xid = UNDEFID, yid = UNDEFID, zid = UNDEFID;
+  int ncvarid;
+  int tsID;
+  size_t size;
+  size_t start[4];
+  size_t count[4];
+  int ndims = 0;
+  int idim;
+  int tsteptype;
+  int gridindex, zaxisindex;
+  int vlistID;
+  int i;
+  double missval;
+  int laddoffset, lscalefactor;
+  double addoffset, scalefactor;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  tsID = streamptr->curTsID;
+
+  if ( CDI_Debug ) Message("tsID = %d", tsID);
+
+  ncvarid = streamptr->vars[varID].ncvarid;
+
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( gridInqType(gridID) == GRID_TRAJECTORY )
+    {
+      cdfReadGridTraj(streamID, gridID);
+    }
+  else
+    {
+      xid = streamptr->xdimID[gridindex];
+      yid = streamptr->ydimID[gridindex];
+    }
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+  zid = streamptr->zaxisID[zaxisindex];
+
+  if ( tsteptype != TSTEP_CONSTANT )
+    {
+      start[ndims] = tsID;
+      count[ndims] = 1;
+      ndims++;
+    }
+  if ( zid != UNDEFID )
+    {
+      start[ndims] = 0;
+      count[ndims] = zaxisInqSize(zaxisID);
+      ndims++;
+    }
+  if ( yid != UNDEFID )
+    {
+      start[ndims] = 0;
+      count[ndims] = gridInqYsize(gridID);
+      ndims++;
+    }
+  if ( xid != UNDEFID )
+    {
+      start[ndims] = 0;
+      count[ndims] = gridInqXsize(gridID);
+      ndims++;
+    }
+
+  if ( CDI_Debug )
+    for (idim = 0; idim < ndims; idim++)
+      Message("dim = %d  start = %d  count = %d", idim, start[idim], count[idim]);
+
+  cdf_get_vara_double(fileID, ncvarid, start, count, data);
+
+  *nmiss = 0;
+  if ( vlistInqVarMissvalUsed(vlistID, varID) == TRUE  )
+    {
+      size    = gridInqSize(gridID)*zaxisInqSize(zaxisID);
+      missval = vlistInqVarMissval(vlistID, varID);
+
+      for ( i = 0; i < (int) size; i++ )
+        if ( DBL_IS_EQUAL(data[i], missval) ) *nmiss += 1;
+    }
+
+  addoffset    = vlistInqVarAddoffset(vlistID, varID);
+  scalefactor  = vlistInqVarScalefactor(vlistID, varID);
+  laddoffset   = IS_NOT_EQUAL(addoffset, 0);
+  lscalefactor = IS_NOT_EQUAL(scalefactor, 1);
+
+  if ( laddoffset || lscalefactor )
+    {
+      size    = gridInqSize(gridID)*zaxisInqSize(zaxisID);
+      missval = vlistInqVarMissval(vlistID, varID);
+
+      if ( *nmiss > 0 )
+        {
+          for ( i = 0; i < (int) size; i++ )
+            {
+              if ( !DBL_IS_EQUAL(data[i], missval) )
+                {
+                  if ( lscalefactor ) data[i] *= scalefactor;
+                  if ( laddoffset )   data[i] += addoffset;
+                }
+            }
+        }
+      else
+        {
+          for ( i = 0; i < (int) size; i++ )
+            {
+              if ( lscalefactor ) data[i] *= scalefactor;
+              if ( laddoffset )   data[i] += addoffset;
+            }
+        }
+    }
+#endif
+}
+
+#if defined(HAVE_LIBNETCDF)
+static
+int cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dtype, long nvals, size_t xsize, size_t ysize, int swapxy, size_t *start, size_t *count, int memtype, const void *data, int nmiss)
+{
+  long i, j;
+  const double *pdata_dp = (const double *) data;
+  double *mdata_dp = NULL;
+  double *sdata_dp = NULL;
+  const float *pdata_sp = (const float *) data;
+  float *mdata_sp = NULL;
+  float *sdata_sp = NULL;
+  extern int CDF_Debug;
+
+  /*  if ( dtype == DATATYPE_INT8 || dtype == DATATYPE_INT16 || dtype == DATATYPE_INT32 ) */
+    {
+      int laddoffset, lscalefactor;
+      double addoffset, scalefactor;
+      double missval;
+
+      addoffset    = vlistInqVarAddoffset(vlistID, varID);
+      scalefactor  = vlistInqVarScalefactor(vlistID, varID);
+      laddoffset   = IS_NOT_EQUAL(addoffset, 0);
+      lscalefactor = IS_NOT_EQUAL(scalefactor, 1);
+
+      missval      = vlistInqVarMissval(vlistID, varID);
+
+      if ( laddoffset || lscalefactor )
+        {
+          if ( memtype == MEMTYPE_FLOAT )
+            {
+              mdata_sp = (float *) malloc(nvals*sizeof(float));
+              memcpy(mdata_sp, pdata_sp, nvals*sizeof(float));
+              pdata_sp = mdata_sp;
+
+              if ( nmiss > 0 )
+                {
+                  for ( i = 0; i < nvals; i++ )
+                    {
+                      if ( !DBL_IS_EQUAL(mdata_sp[i], missval) )
+                        {
+                          if ( laddoffset )   mdata_sp[i] -= addoffset;
+                          if ( lscalefactor ) mdata_sp[i] /= scalefactor;
+                        }
+                    }
+                }
+              else
+                {
+                  for ( i = 0; i < nvals; i++ )
+                    {
+                      if ( laddoffset )   mdata_sp[i] -= addoffset;
+                      if ( lscalefactor ) mdata_sp[i] /= scalefactor;
+                    }
+                }
+            }
+          else
+            {
+              mdata_dp = (double *) malloc(nvals*sizeof(double));
+              memcpy(mdata_dp, pdata_dp, nvals*sizeof(double));
+              pdata_dp = mdata_dp;
+
+              if ( nmiss > 0 )
+                {
+                  for ( i = 0; i < nvals; i++ )
+                    {
+                      if ( !DBL_IS_EQUAL(mdata_dp[i], missval) )
+                        {
+                          if ( laddoffset )   mdata_dp[i] -= addoffset;
+                          if ( lscalefactor ) mdata_dp[i] /= scalefactor;
+                        }
+                    }
+                }
+              else
+                {
+                  for ( i = 0; i < nvals; i++ )
+                    {
+                      if ( laddoffset )   mdata_dp[i] -= addoffset;
+                      if ( lscalefactor ) mdata_dp[i] /= scalefactor;
+                    }
+                }
+            }
+        }
+
+      if ( dtype == DATATYPE_UINT8 || dtype == DATATYPE_INT8 ||
+           dtype == DATATYPE_INT16 || dtype == DATATYPE_INT32 )
+        {
+          if ( memtype == MEMTYPE_FLOAT )
+            {
+              if ( mdata_sp == NULL )
+                {
+                  mdata_sp = (float *) malloc(nvals*sizeof(float));
+                  memcpy(mdata_sp, pdata_sp, nvals*sizeof(float));
+                  pdata_sp = mdata_sp;
+                }
+
+              for ( i = 0; i < nvals; i++ ) mdata_sp[i] = NINT(mdata_sp[i]);
+
+              if ( dtype == DATATYPE_UINT8 )
+                {
+                  nc_type xtype;
+                  cdf_inq_vartype(fileID, ncvarid, &xtype);
+                  if ( xtype == NC_BYTE )
+                    {
+                      for ( i = 0; i < nvals; ++i )
+                        if ( mdata_sp[i] > 127 ) mdata_sp[i] -= 256;
+                    }
+                }
+            }
+          else
+            {
+              if ( mdata_dp == NULL )
+                {
+                  mdata_dp = (double *) malloc(nvals*sizeof(double));
+                  memcpy(mdata_dp, pdata_dp, nvals*sizeof(double));
+                  pdata_dp = mdata_dp;
+                }
+
+              for ( i = 0; i < nvals; i++ ) mdata_dp[i] = NINT(mdata_dp[i]);
+
+              if ( dtype == DATATYPE_UINT8 )
+                {
+                  nc_type xtype;
+                  cdf_inq_vartype(fileID, ncvarid, &xtype);
+                  if ( xtype == NC_BYTE )
+                    {
+                      for ( i = 0; i < nvals; ++i )
+                        if ( mdata_dp[i] > 127 ) mdata_dp[i] -= 256;
+                    }
+                }
+            }
+        }
+
+      if ( CDF_Debug && memtype != MEMTYPE_FLOAT )
+        {
+          double fmin, fmax;
+          fmin =  1.0e200;
+          fmax = -1.0e200;
+          for ( i = 0; i < nvals; ++i )
+            {
+              if ( !DBL_IS_EQUAL(pdata_dp[i], missval) )
+                {
+                  if ( pdata_dp[i] < fmin ) fmin = pdata_dp[i];
+                  if ( pdata_dp[i] > fmax ) fmax = pdata_dp[i];
+                }
+            }
+          Message("nvals = %d, nmiss = %d, missval = %g, minval = %g, maxval = %g",
+                  nvals, nmiss, missval, fmin, fmax);
+        }
+    }
+
+  if ( swapxy )
+    {
+      if ( memtype == MEMTYPE_FLOAT )
+        {
+          sdata_sp = (float *) malloc(nvals*sizeof(float));
+          for ( j = 0; j < (long)ysize; ++j )
+            for ( i = 0; i < (long)xsize; ++i )
+              sdata_sp[i*ysize+j] = pdata_sp[j*xsize+i];
+          pdata_sp = sdata_sp;
+        }
+      else
+        {
+          sdata_dp = (double *) malloc(nvals*sizeof(double));
+          for ( j = 0; j < (long)ysize; ++j )
+            for ( i = 0; i < (long)xsize; ++i )
+              sdata_dp[i*ysize+j] = pdata_dp[j*xsize+i];
+          pdata_dp = sdata_dp;
+        }
+    }
+
+  if ( memtype == MEMTYPE_FLOAT )
+    cdf_put_vara_float(fileID, ncvarid, start, count, pdata_sp);
+  else
+    cdf_put_vara_double(fileID, ncvarid, start, count, pdata_dp);
+
+  if ( mdata_dp ) free(mdata_dp);
+  if ( sdata_dp ) free(sdata_dp);
+  if ( mdata_sp ) free(mdata_sp);
+  if ( sdata_sp ) free(sdata_sp);
+
+  return (0);
+}
+#endif
+
+void cdf_write_var(int streamID, int varID, int memtype, const void *data, int nmiss)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  int gridID;
+  int zaxisID;
+  int xid = UNDEFID, yid = UNDEFID, zid = UNDEFID;
+  int ncvarid;
+  int ntsteps;
+  size_t xsize = 0, ysize = 0;
+  size_t size;
+  size_t start[4];
+  size_t count[4];
+  long nvals;
+  int swapxy = FALSE;
+  int ndims = 0;
+  int idim;
+  int tsteptype;
+  int gridindex, zaxisindex;
+  int dtype;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ntsteps = streamptr->ntsteps;
+  if ( CDI_Debug )
+    Message("ntsteps = %d", ntsteps); 
+
+  if ( vlistHasTime(vlistID) ) cdfDefTime(streamID);
+
+  ncvarid = cdfDefVar(streamID, varID);
+
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( gridInqType(gridID) == GRID_TRAJECTORY )
+    {
+      cdfWriteGridTraj(streamID, gridID);
+    }
+  else
+    {
+      xid = streamptr->xdimID[gridindex];
+      yid = streamptr->ydimID[gridindex];
+    }
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+  zid = streamptr->zaxisID[zaxisindex];
+
+  if ( tsteptype != TSTEP_CONSTANT )
+    {
+      start[ndims] = ntsteps - 1;
+      count[ndims] = 1;
+      ndims++;
+    }
+  if ( zid != UNDEFID )
+    {
+      start[ndims] = 0;
+      count[ndims] = zaxisInqSize(zaxisID);
+      ndims++;
+    }
+  if ( yid != UNDEFID )
+    {
+      start[ndims] = 0;
+      cdf_inq_dimlen(fileID, yid, &size);
+      /*      count[ndims] = gridInqYsize(gridID); */
+      count[ndims] = size;
+      ndims++;
+    }
+  if ( xid != UNDEFID )
+    {
+      start[ndims] = 0;
+      cdf_inq_dimlen(fileID, xid, &size);
+      /*      count[ndims] = gridInqXsize(gridID); */
+      count[ndims] = size;
+      ndims++;
+    }
+
+  if ( CDI_Debug )
+    for (idim = 0; idim < ndims; idim++)
+      Message("dim = %d  start = %d  count = %d", idim, start[idim], count[idim]);
+
+  if ( streamptr->ncmode == 1 )
+    {
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  dtype = vlistInqVarDatatype(vlistID, varID);
+
+  if ( nmiss > 0 ) cdfDefVarMissval(streamID, varID, dtype, 1);
+
+  nvals = gridInqSize(gridID)*zaxisInqSize(zaxisID);
+
+  cdf_write_var_data(fileID, vlistID, varID, ncvarid, dtype, nvals, xsize, ysize, swapxy, start, count, memtype, data, nmiss);
+
+#endif
+}
+
+
+int cdfReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *nmiss)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  int gridID;
+  int zaxisID;
+  int xid = UNDEFID, yid = UNDEFID, zid = UNDEFID;
+  int ncvarid;
+  int tsID;
+  int gridsize, xsize, ysize;
+  size_t size;
+  size_t start[4];
+  size_t count[4];
+  int ndims = 0;
+  int idim;
+  int tsteptype;
+  int gridindex;
+  int zaxisindex;
+  int vlistID;
+  int i, j;
+  int dimorder[3];
+  int ixyz;
+  int swapxy = FALSE;
+  int lvalidrange;
+  double validrange[2];
+  double missval;
+  int laddoffset, lscalefactor;
+  double addoffset, scalefactor;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d  levelID = %d", streamID, varID, levelID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  tsID = streamptr->curTsID;
+  if ( CDI_Debug )
+    Message("tsID = %d", tsID);
+
+  ncvarid = streamptr->vars[varID].ncvarid;
+
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+  ixyz      = vlistInqVarXYZ(vlistID, varID);
+  if ( ixyz == 0 ) ixyz = 321; // ZYX
+
+  gridsize = gridInqSize(gridID);
+  xsize = gridInqXsize(gridID);
+  ysize = gridInqYsize(gridID);
+
+  streamptr->numvals += gridsize;
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( gridInqType(gridID) == GRID_TRAJECTORY )
+    {
+      cdfReadGridTraj(streamID, gridID);
+    }
+  else if ( gridInqType(gridID) == GRID_UNSTRUCTURED )
+    {
+      xid = streamptr->xdimID[gridindex];
+    }
+  else
+    {
+      xid = streamptr->xdimID[gridindex];
+      yid = streamptr->ydimID[gridindex];
+    }
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+  zid = streamptr->zaxisID[zaxisindex];
+  /*
+  printf("2 %d %d %d %s\n", streamID, zaxisindex, streamptr->zaxisID[zaxisindex], vlistInqVarNamePtr(vlistID, varID));
+  */
+  dimorder[0] = ixyz/100;
+  dimorder[1] = (ixyz-dimorder[0]*100)/10;
+  dimorder[2] = (ixyz-dimorder[0]*100-dimorder[1]*10);
+
+  if ( (dimorder[2] == 2 || dimorder[0] == 1) && xid != UNDEFID && yid != UNDEFID ) swapxy = TRUE;
+  /*
+  printf("swapxy %d\n", swapxy);
+  printf("ixyz %d\n", ixyz);
+  printf("dimorder: %d %d %d\n", dimorder[0], dimorder[1], dimorder[2]);
+  */
+
+  if ( tsteptype != TSTEP_CONSTANT )
+    {
+      start[ndims] = tsID;
+      count[ndims] = 1;
+      ndims++;
+    }
+
+  for ( int id = 0; id < 3; ++id )
+    {
+      if ( dimorder[id] == 3 && zid != UNDEFID )
+        {
+          start[ndims] = levelID;
+          count[ndims] = 1;
+          ndims++;
+        }
+      else if ( dimorder[id] == 2 && yid != UNDEFID )
+        {
+          start[ndims] = 0;
+          cdf_inq_dimlen(fileID, yid, &size);
+          count[ndims] = size;
+          ndims++;
+        }
+      else if ( dimorder[id] == 1 && xid != UNDEFID )
+        {
+          start[ndims] = 0;
+          cdf_inq_dimlen(fileID, xid, &size);
+          count[ndims] = size;
+          ndims++;
+        }
+    }
+
+  if ( CDI_Debug )
+    for (idim = 0; idim < ndims; idim++)
+      Message("dim = %d  start = %d  count = %d", idim, start[idim], count[idim]);
+
+  if ( vlistInqVarDatatype(vlistID, varID) == DATATYPE_FLT32 )
+    {
+      float *data_fp = (float *) data;
+      cdf_get_vara_float(fileID, ncvarid, start, count, data_fp);
+      for ( i = gridsize-1; i >=0; i-- )
+        data[i] = (double) data_fp[i];
+    }
+  else
+    cdf_get_vara_double(fileID, ncvarid, start, count, data);
+
+  if ( swapxy )
+    {
+      double *tdata;
+      tdata = (double *) malloc(gridsize*sizeof(double));
+      memcpy(tdata, data, gridsize*sizeof(double));
+      for ( j = 0; j < ysize; ++j )
+        for ( i = 0; i < xsize; ++i )
+          data[j*xsize+i] = tdata[i*ysize+j];
+      free(tdata);
+    }
+
+  if ( vlistInqVarDatatype(vlistID, varID) == DATATYPE_UINT8 )
+    {
+      nc_type xtype;
+      cdf_inq_vartype(fileID, ncvarid, &xtype);
+      if ( xtype == NC_BYTE )
+        {
+          for ( i = 0; i < gridsize; i++ )
+            if ( data[i] < 0 ) data[i] += 256;
+        }
+    }
+
+  *nmiss = 0;
+  if ( vlistInqVarMissvalUsed(vlistID, varID) == TRUE )
+    {
+      missval = vlistInqVarMissval(vlistID, varID);
+
+      lvalidrange = vlistInqVarValidrange(vlistID, varID, validrange);
+      // printf("readvarslice: validrange %d %g %g\n", lvalidrange, validrange[0], validrange[1]);
+      if ( lvalidrange )
+        for ( i = 0; i < gridsize; i++ )
+          {
+            if ( IS_NOT_EQUAL(validrange[0], VALIDMISS) && data[i] < validrange[0] ) data[i] = missval;
+            if ( IS_NOT_EQUAL(validrange[1], VALIDMISS) && data[i] > validrange[1] ) data[i] = missval;
+          }
+
+      // printf("XXX %31.0f %31.0f %31.0f %31.0f\n", missval, (float)data[0]);
+      for ( i = 0; i < gridsize; i++ )
+        if ( DBL_IS_EQUAL(data[i], missval) ) *nmiss += 1;
+    }
+
+  addoffset    = vlistInqVarAddoffset(vlistID, varID);
+  scalefactor  = vlistInqVarScalefactor(vlistID, varID);
+  laddoffset   = IS_NOT_EQUAL(addoffset, 0);
+  lscalefactor = IS_NOT_EQUAL(scalefactor, 1);
+
+  if ( laddoffset || lscalefactor )
+    {
+      missval = vlistInqVarMissval(vlistID, varID);
+
+      if ( *nmiss > 0 )
+        {
+          for ( i = 0; i < gridsize; i++ )
+            {
+              if ( !DBL_IS_EQUAL(data[i], missval) )
+                {
+                  if ( lscalefactor ) data[i] *= scalefactor;
+                  if ( laddoffset )   data[i] += addoffset;
+                }
+            }
+        }
+      else
+        {
+          for ( i = 0; i < gridsize; i++ )
+            {
+              if ( lscalefactor ) data[i] *= scalefactor;
+              if ( laddoffset )   data[i] += addoffset;
+            }
+        }
+    }
+
+#endif
+  return (0);
+}
+
+
+int cdf_write_var_slice(int streamID, int varID, int levelID, int memtype, const void *data, int nmiss)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  int gridID;
+  int zaxisID;
+  int xid = UNDEFID, yid = UNDEFID, zid = UNDEFID;
+  int ncvarid;
+  int ntsteps;
+  long nvals;
+  size_t xsize = 0, ysize = 0;
+  size_t start[4];
+  size_t count[4];
+  int ndims = 0;
+  int idim;
+  int tsteptype;
+  int gridindex, zaxisindex;
+  int dimorder[3];
+  int ixyz;
+  int swapxy = FALSE;
+  int dtype;
+  int vlistID;
+  stream_t *streamptr;
+  extern int CDF_Debug;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ntsteps = streamptr->ntsteps;
+  if ( CDI_Debug ) Message("ntsteps = %d", ntsteps);
+
+  if ( vlistHasTime(vlistID) ) cdfDefTime(streamID);
+
+  ncvarid = cdfDefVar(streamID, varID);
+
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+  ixyz      = vlistInqVarXYZ(vlistID, varID);
+  if ( ixyz == 0 ) ixyz = 321; // ZYX
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( gridInqType(gridID) == GRID_TRAJECTORY )
+    {
+      cdfWriteGridTraj(streamID, gridID);
+    }
+  else
+    {
+      xid = streamptr->xdimID[gridindex];
+      yid = streamptr->ydimID[gridindex];
+    }
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+  zid = streamptr->zaxisID[zaxisindex];
+
+  dimorder[0] = ixyz/100;
+  dimorder[1] = (ixyz-dimorder[0]*100)/10;
+  dimorder[2] = (ixyz-dimorder[0]*100-dimorder[1]*10);
+
+  if ( (dimorder[2] == 2 || dimorder[0] == 1) && xid != UNDEFID && yid != UNDEFID ) swapxy = TRUE;
+  /*
+  printf("swapxy %d\n", swapxy);
+  printf("ixyz %d\n", ixyz);
+  printf("dimorder: %d %d %d\n", dimorder[0], dimorder[1], dimorder[2]);
+  */
+
+  if ( tsteptype != TSTEP_CONSTANT )
+    {
+      start[ndims] = ntsteps - 1;
+      count[ndims] = 1;
+      ndims++;
+    }
+
+  for ( int id = 0; id < 3; ++id )
+    {
+      if ( dimorder[id] == 3 && zid != UNDEFID )
+        {
+          start[ndims] = levelID;
+          count[ndims] = 1;
+          ndims++;
+        }
+      else if ( dimorder[id] == 2 && yid != UNDEFID )
+        {
+          start[ndims] = 0;
+          cdf_inq_dimlen(fileID, yid, &ysize);
+          count[ndims] = ysize;
+          ndims++;
+        }
+      else if ( dimorder[id] == 1 && xid != UNDEFID )
+        {
+          start[ndims] = 0;
+          cdf_inq_dimlen(fileID, xid, &xsize);
+          count[ndims] = xsize;
+          ndims++;
+        }
+    }
+
+  if ( CDI_Debug )
+    for (idim = 0; idim < ndims; idim++)
+      Message("dim = %d  start = %d  count = %d", idim, start[idim], count[idim]);
+
+  dtype = vlistInqVarDatatype(vlistID, varID);
+
+  if ( nmiss > 0 ) cdfDefVarMissval(streamID, varID, dtype, 1);
+
+  nvals = gridInqSize(gridID);
+
+  cdf_write_var_data(fileID, vlistID, varID, ncvarid, dtype, nvals, xsize, ysize, swapxy, start, count, memtype, data, nmiss);
+
+#endif
+  return (0);
+}
+
+
+void cdfCreateRecords(int streamID, int tsID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int varID, levelID, recID, vrecID, zaxisID;
+  int nvars, nlev, nrecs, nvrecs;
+  record_t *records = NULL;
+  int *recIDs = NULL;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID  = streamInqVlist(streamID);
+
+  if ( tsID < 0 || (tsID >= streamptr->ntsteps && tsID > 0) ) return;
+
+  if ( streamptr->tsteps[tsID].nallrecs > 0 ) return;
+
+  if ( tsID == 0 )
+    {
+      nvars = vlistNvars(vlistID);
+      nrecs = vlistNrecs(vlistID);
+
+      streamptr->nrecs += nrecs;
+
+      if ( nrecs > 0 ) records = (record_t *) malloc(nrecs*sizeof(record_t));
+      streamptr->tsteps[tsID].records    = records;
+      streamptr->tsteps[tsID].nrecs      = nrecs;
+      streamptr->tsteps[tsID].nallrecs   = nrecs;
+      streamptr->tsteps[tsID].recordSize = nrecs;
+      streamptr->tsteps[tsID].curRecID   = UNDEFID;
+
+      nvrecs = nrecs; /* use all records at first timestep */
+      if ( nvrecs > 0 ) recIDs = (int *) malloc(nvrecs*sizeof(int));
+      streamptr->tsteps[tsID].recIDs     = recIDs;
+      for ( recID = 0; recID < nvrecs; recID++ )
+        recIDs[recID] = recID;
+
+      recID = 0;
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          zaxisID = vlistInqVarZaxis(vlistID, varID);
+          nlev    = zaxisInqSize(zaxisID);
+          for ( levelID = 0; levelID < nlev; levelID++ )
+            {
+              recordInitEntry(&records[recID]);
+              records[recID].varID   = varID;
+              records[recID].levelID = levelID;
+              recID++;
+            }
+        }
+    }
+  else if ( tsID == 1 )
+    {
+      nvars = vlistNvars(vlistID);
+      nrecs = vlistNrecs(vlistID);
+
+      nvrecs = 0;
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          if ( vlistInqVarTsteptype(vlistID, varID) != TSTEP_CONSTANT )
+            {
+              zaxisID = vlistInqVarZaxis(vlistID, varID);
+              nvrecs += zaxisInqSize(zaxisID);
+            }
+        }
+
+      streamptr->nrecs += nvrecs;
+
+      records = (record_t *) malloc(nrecs*sizeof(record_t));
+      streamptr->tsteps[tsID].records    = records;
+      streamptr->tsteps[tsID].nrecs      = nvrecs;
+      streamptr->tsteps[tsID].nallrecs   = nrecs;
+      streamptr->tsteps[tsID].recordSize = nrecs;
+      streamptr->tsteps[tsID].curRecID   = UNDEFID;
+
+      memcpy(streamptr->tsteps[tsID].records,
+             streamptr->tsteps[0].records,
+             nrecs*sizeof(record_t));
+
+      if ( nvrecs )
+        {
+          recIDs = (int *) malloc(nvrecs*sizeof(int));
+          streamptr->tsteps[tsID].recIDs     = recIDs;
+          vrecID = 0;
+          for ( recID = 0; recID < nrecs; recID++ )
+            {
+              varID = records[recID].varID;
+              if ( vlistInqVarTsteptype(vlistID, varID) != TSTEP_CONSTANT )
+                {
+                  recIDs[vrecID++] = recID;
+                }
+            }
+        }
+    }
+  else
+    {
+      nvars = vlistNvars(vlistID);
+      nrecs = vlistNrecs(vlistID);
+
+      nvrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->nrecs += nvrecs;
+
+      records = (record_t *) malloc(nrecs*sizeof(record_t));
+      streamptr->tsteps[tsID].records    = records;
+      streamptr->tsteps[tsID].nrecs      = nvrecs;
+      streamptr->tsteps[tsID].nallrecs   = nrecs;
+      streamptr->tsteps[tsID].recordSize = nrecs;
+      streamptr->tsteps[tsID].curRecID   = UNDEFID;
+
+      memcpy(streamptr->tsteps[tsID].records,
+             streamptr->tsteps[0].records,
+             nrecs*sizeof(record_t));
+
+      recIDs = (int *) malloc(nvrecs*sizeof(int));
+      streamptr->tsteps[tsID].recIDs     = recIDs;
+
+      memcpy(streamptr->tsteps[tsID].recIDs,
+             streamptr->tsteps[1].recIDs,
+             nvrecs*sizeof(int));
+    }
+#endif
+}
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+int cdfTimeDimID(int fileID, int ndims, int nvars)
+{
+  int dimid = 0;
+  char dimname[80];
+  char timeunits[CDI_MAX_NAME];
+  char attname[CDI_MAX_NAME];
+  char name[CDI_MAX_NAME];
+  nc_type xtype;
+  int nvdims, nvatts;
+  int dimids[9];
+  int varid, iatt;
+
+  for ( dimid = 0; dimid < ndims; dimid++ )
+    {
+      cdf_inq_dimname(fileID, dimid, dimname);
+      if ( memcmp(dimname, "time", 4) == 0 ) break;
+    }
+
+  if ( dimid == ndims ) dimid = UNDEFID;
+
+  for ( varid = 0; varid < nvars; varid++ )
+    {
+      if ( dimid != UNDEFID ) break;
+
+      cdf_inq_var(fileID, varid, name, &xtype, &nvdims, dimids, &nvatts);
+      if ( nvdims == 1 )
+        {
+          for ( iatt = 0; iatt < nvatts; iatt++ )
+            {
+              cdf_inq_attname(fileID, varid, iatt, attname);
+              if ( memcmp(attname, "units", 5) == 0 )
+                {
+                  cdfGetAttText(fileID, varid, "units", sizeof(timeunits), timeunits);
+                  strtolower(timeunits);
+
+                  if ( memcmp(timeunits, "sec",    3) == 0 ||
+                       memcmp(timeunits, "minute", 6) == 0 ||
+                       memcmp(timeunits, "hour",   4) == 0 ||
+                       memcmp(timeunits, "day",    3) == 0 ||
+                       memcmp(timeunits, "month",  5) == 0 )
+                    {
+                      dimid = dimids[0];
+                      break;
+                    }
+                }
+            }
+        }
+    }
+
+  return (dimid);
+}
+
+static
+void init_ncdims(long ndims, ncdim_t *ncdims)
+{
+  long ncdimid;
+
+  for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+    {
+      ncdims[ncdimid].ncvarid      = UNDEFID;
+      ncdims[ncdimid].dimtype      = UNDEFID;
+      ncdims[ncdimid].len          = 0;
+      ncdims[ncdimid].name[0]      = 0;
+    }
+}
+
+static
+void init_ncvars(long nvars, ncvar_t *ncvars)
+{
+  long ncvarid;
+
+  for ( ncvarid = 0; ncvarid < nvars; ++ncvarid )
+    {
+      ncvars[ncvarid].ncid            = UNDEFID;
+      ncvars[ncvarid].ignore          = FALSE;
+      ncvars[ncvarid].isvar           = UNDEFID;
+      ncvars[ncvarid].islon           = FALSE;
+      ncvars[ncvarid].islat           = FALSE;
+      ncvars[ncvarid].islev           = FALSE;
+      ncvars[ncvarid].istime          = FALSE;
+      ncvars[ncvarid].warn            = FALSE;
+      ncvars[ncvarid].tsteptype       = TSTEP_CONSTANT;
+      ncvars[ncvarid].param           = UNDEFID;
+      ncvars[ncvarid].code            = UNDEFID;
+      ncvars[ncvarid].tabnum          = 0;
+      ncvars[ncvarid].calendar        = FALSE;
+      ncvars[ncvarid].bounds          = UNDEFID;
+      ncvars[ncvarid].gridID          = UNDEFID;
+      ncvars[ncvarid].zaxisID         = UNDEFID;
+      ncvars[ncvarid].gridtype        = UNDEFID;
+      ncvars[ncvarid].zaxistype       = UNDEFID;
+      ncvars[ncvarid].xdim            = UNDEFID;
+      ncvars[ncvarid].ydim            = UNDEFID;
+      ncvars[ncvarid].zdim            = UNDEFID;
+      ncvars[ncvarid].xvarid          = UNDEFID;
+      ncvars[ncvarid].yvarid          = UNDEFID;
+      ncvars[ncvarid].zvarid          = UNDEFID;
+      ncvars[ncvarid].tvarid          = UNDEFID;
+      ncvars[ncvarid].ncoordvars      = 0;
+      ncvars[ncvarid].coordvarids[0]  = UNDEFID;
+      ncvars[ncvarid].coordvarids[1]  = UNDEFID;
+      ncvars[ncvarid].coordvarids[2]  = UNDEFID;
+      ncvars[ncvarid].coordvarids[3]  = UNDEFID;
+      ncvars[ncvarid].cellarea        = UNDEFID;
+      ncvars[ncvarid].tableID         = UNDEFID;
+      ncvars[ncvarid].xtype           = 0;
+      ncvars[ncvarid].ndims           = 0;
+      ncvars[ncvarid].gmapid          = UNDEFID;
+      ncvars[ncvarid].vlen            = 0;
+      ncvars[ncvarid].vdata           = NULL;
+      ncvars[ncvarid].truncation      = 0;
+      ncvars[ncvarid].positive        = 0;
+      ncvars[ncvarid].chunked         = 0;
+      ncvars[ncvarid].chunktype       = UNDEFID;
+      ncvars[ncvarid].defmiss         = 0;
+      ncvars[ncvarid].missval         = 0;
+      ncvars[ncvarid].addoffset       = 0;
+      ncvars[ncvarid].scalefactor     = 1;
+      ncvars[ncvarid].name[0]         = 0;
+      ncvars[ncvarid].longname[0]     = 0;
+      ncvars[ncvarid].stdname[0]      = 0;
+      ncvars[ncvarid].units[0]        = 0;
+      ncvars[ncvarid].natts           = 0;
+      ncvars[ncvarid].atts            = NULL;
+      ncvars[ncvarid].deflate         = 0;
+      ncvars[ncvarid].lunsigned       = 0;
+      ncvars[ncvarid].lvalidrange     = 0;
+      ncvars[ncvarid].validrange[0]   = VALIDMISS;
+      ncvars[ncvarid].validrange[1]   = VALIDMISS;
+      ncvars[ncvarid].ensdata         = NULL;
+    }
+}
+
+static
+int isLonAxis(const char *units, const char *stdname)
+{
+  int status = FALSE;
+
+  if ( memcmp(units, "degrees_east", 12) == 0 ||
+       memcmp(units, "degree_east", 11)  == 0 ||
+       memcmp(units, "degree_E", 8)      == 0 ||
+       memcmp(units, "degrees_E", 9)     == 0 ||
+       memcmp(units, "degreeE", 7)       == 0 ||
+       memcmp(units, "degreesE", 8)      == 0 ||
+       memcmp(stdname, "longitude", 9)   == 0 ||
+       (memcmp(units, "degree", 6)            == 0 &&
+        memcmp(stdname, "grid_longitude", 14) == 0) ||
+       (memcmp(units, "radian", 6)            == 0 &&
+        memcmp(stdname, "grid_longitude", 14) == 0) )
+    {
+      status = TRUE;
+    }
+
+  return (status);
+}
+
+static
+int isLatAxis(const char *units, const char *stdname)
+{
+  int status = FALSE;
+
+  if ( memcmp(units, "degrees_north", 13) == 0 ||
+       memcmp(units, "degree_north", 12)  == 0 ||
+       memcmp(units, "degree_N", 8)       == 0 ||
+       memcmp(units, "degrees_N", 9)      == 0 ||
+       memcmp(units, "degreeN", 7)        == 0 ||
+       memcmp(units, "degreesN", 8)       == 0 ||
+       memcmp(stdname, "latitude", 8)     == 0 ||
+       (memcmp(units, "degree", 6)           == 0 &&
+        memcmp(stdname, "grid_latitude", 13) == 0) ||
+       (memcmp(units, "radian", 6)           == 0 &&
+        memcmp(stdname, "grid_latitude", 13) == 0) )
+    {
+      status = TRUE;
+    }
+
+  return (status);
+}
+
+static
+int isDBLAxis(const char *units, const char *longname)
+{
+  int status = FALSE;
+
+  if ( strcmp(longname, "depth below land")         == 0 ||
+       strcmp(longname, "depth_below_land")         == 0 ||
+       strcmp(longname, "levels below the surface") == 0 )
+    {
+      /*
+      if ( strcmp(ncvars[ncvarid].units, "cm") == 0 ||
+           strcmp(ncvars[ncvarid].units, "dm") == 0 ||
+           strcmp(ncvars[ncvarid].units, "m")  == 0 )
+      */
+        status = TRUE;
+    }
+
+  return (status);
+}
+
+static
+int isDepthAxis(const char *stdname, const char *longname)
+{
+  int status = FALSE;
+
+  if ( strcmp(stdname, "depth") == 0 ) status = TRUE;
+ 
+  if ( status == FALSE )
+    if ( strcmp(longname, "depth_below_sea") == 0 ||
+         strcmp(longname, "depth below sea") == 0 )
+      {
+        status = TRUE;
+      }
+
+  return (status);
+}
+
+static
+int isHeightAxis(const char *stdname, const char *longname)
+{
+  int status = FALSE;
+
+  if ( strcmp(stdname, "height") == 0 ) status = TRUE;
+
+  if ( status == FALSE )
+    if ( strcmp(longname, "height") == 0 ||
+         strcmp(longname, "height above the surface") == 0 )
+      {
+        status = TRUE;
+      }
+
+  return (status);
+}
+
+static
+int unitsIsPressure(const char *units)
+{
+  int status = FALSE;
+
+  if ( memcmp(units, "millibar", 8) == 0 ||
+       memcmp(units, "mb", 2)       == 0 ||
+       memcmp(units, "hectopas", 8) == 0 ||
+       memcmp(units, "hPa", 3)      == 0 ||
+       memcmp(units, "Pa", 2)       == 0 )
+    {
+      status = TRUE;
+    }
+
+  return (status);
+}
+
+static
+int isGaussGrid(long ysize, double yinc, double *yvals)
+{
+  int lgauss = FALSE;
+  long i;
+  double *yv, *yw;
+
+  if ( IS_EQUAL(yinc, 0) && ysize > 2 ) /* check if gaussian */
+    {
+      yv = (double *) malloc(ysize*sizeof(double));
+      yw = (double *) malloc(ysize*sizeof(double));
+      gaussaw(yv, yw, ysize);
+      free(yw);
+      for ( i = 0; i < ysize; i++ )
+        yv[i] = asin(yv[i])/M_PI*180.0;
+
+      for ( i = 0; i < ysize; i++ )
+        if ( fabs(yv[i] - yvals[i]) >
+             ((yv[0] - yv[1])/500) ) break;
+
+      if ( i == ysize ) lgauss = TRUE;
+
+      /* check S->N */
+      if ( lgauss == FALSE )
+        {
+          for ( i = 0; i < ysize; i++ )
+            if ( fabs(yv[i] - yvals[ysize-i-1]) >
+                 ((yv[0] - yv[1])/500) ) break;
+
+          if ( i == ysize ) lgauss = TRUE;
+        }
+
+      free(yv);
+    }
+
+  return (lgauss);
+}
+
+static
+void cdfSetVar(ncvar_t *ncvars, int ncvarid, int isvar)
+{
+  if ( isvar != TRUE && isvar != FALSE )
+    Error("Internal problem! var %s undefined", ncvars[ncvarid].name);
+
+  if ( ncvars[ncvarid].isvar != UNDEFID &&
+       ncvars[ncvarid].isvar != isvar   &&
+       ncvars[ncvarid].warn  == FALSE )
+    {
+      if ( ! ncvars[ncvarid].ignore )
+        Warning("Inconsistent variable definition for %s!", ncvars[ncvarid].name);
+
+      ncvars[ncvarid].warn = TRUE;
+      isvar = FALSE;
+    }
+
+  ncvars[ncvarid].isvar = isvar;
+}
+
+static
+void cdfSetDim(ncvar_t *ncvars, int ncvarid, int dimid, int dimtype)
+{
+  if ( ncvars[ncvarid].dimtype[dimid] != UNDEFID &&
+       ncvars[ncvarid].dimtype[dimid] != dimtype )
+    {
+      Warning("Inconsistent dimension definition for %s! dimid = %d;  type = %d;  newtype = %d",
+              ncvars[ncvarid].name, dimid, ncvars[ncvarid].dimtype[dimid], dimtype);
+    }
+
+  ncvars[ncvarid].dimtype[dimid] = dimtype;
+}
+
+static
+void printNCvars(ncvar_t *ncvars, int nvars, const char *oname)
+{
+  char axis[7];
+  int ncvarid, i;
+  int ndim;
+  int iaxis[] = {'t', 'z', 'y', 'x'};
+
+  fprintf(stderr, "%s:\n", oname);
+
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      ndim = 0;
+      if ( ncvars[ncvarid].isvar )
+        {
+          axis[ndim++] = 'v';
+          axis[ndim++] = ':';
+          for ( i = 0; i < ncvars[ncvarid].ndims; i++ )
+            {/*
+              if      ( ncvars[ncvarid].tvarid != -1 ) axis[ndim++] = iaxis[0];
+              else if ( ncvars[ncvarid].zvarid != -1 ) axis[ndim++] = iaxis[1];
+              else if ( ncvars[ncvarid].yvarid != -1 ) axis[ndim++] = iaxis[2];
+              else if ( ncvars[ncvarid].xvarid != -1 ) axis[ndim++] = iaxis[3];
+              else
+             */
+              if      ( ncvars[ncvarid].dimtype[i] == T_AXIS ) axis[ndim++] = iaxis[0];
+              else if ( ncvars[ncvarid].dimtype[i] == Z_AXIS ) axis[ndim++] = iaxis[1];
+              else if ( ncvars[ncvarid].dimtype[i] == Y_AXIS ) axis[ndim++] = iaxis[2];
+              else if ( ncvars[ncvarid].dimtype[i] == X_AXIS ) axis[ndim++] = iaxis[3];
+              else                                             axis[ndim++] = '?';
+            }
+        }
+      else
+        {
+          axis[ndim++] = 'c';
+          axis[ndim++] = ':';
+          if      ( ncvars[ncvarid].istime ) axis[ndim++] = iaxis[0];
+          else if ( ncvars[ncvarid].islev  ) axis[ndim++] = iaxis[1];
+          else if ( ncvars[ncvarid].islat  ) axis[ndim++] = iaxis[2];
+          else if ( ncvars[ncvarid].islon  ) axis[ndim++] = iaxis[3];
+          else                               axis[ndim++] = '?';
+        }
+
+      axis[ndim++] = 0;
+
+      fprintf(stderr, "%3d %3d  %-6s %s\n", ncvarid, ndim-3, axis, ncvars[ncvarid].name);
+    }
+}
+#endif
+
+typedef struct
+{
+  int      ncvarid;
+  char     name[CDI_MAX_NAME];
+}
+varinfo_t;
+
+
+#ifdef HAVE_LIBNETCDF
+static
+int cmpvarname(const void *s1, const void *s2)
+{
+  varinfo_t *x = (varinfo_t *) s1;
+  varinfo_t *y = (varinfo_t *) s2;
+
+  return (strcmp(x->name, y->name));
+}
+
+static
+void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
+                          int timedimid, int modelID, int format)
+{
+  int ncid;
+  int ncvarid;
+  int ncdimid;
+  int nvdims, nvatts;
+  int *dimidsp;
+  nc_type xtype, atttype;
+  size_t attlen;
+  char name[CDI_MAX_NAME];
+  char attname[CDI_MAX_NAME];
+  const int attstringlen = 8192; char attstring[8192];
+  int iatt;
+  int i;
+  int tablenum;
+
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      ncid    = ncvars[ncvarid].ncid;
+      dimidsp = ncvars[ncvarid].dimids;
+
+      cdf_inq_var(ncid, ncvarid, name, &xtype, &nvdims, dimidsp, &nvatts);
+      strcpy(ncvars[ncvarid].name, name);
+
+      for ( ncdimid = 0; ncdimid < nvdims; ncdimid++ )
+        ncvars[ncvarid].dimtype[ncdimid] = -1;
+
+      ncvars[ncvarid].xtype = xtype;
+      ncvars[ncvarid].ndims = nvdims;
+
+#if  defined  (HAVE_NETCDF4)
+      if ( format == NC_FORMAT_NETCDF4_CLASSIC || format == NC_FORMAT_NETCDF4 )
+        {
+          int shuffle, deflate, deflate_level;
+          size_t chunks[nvdims];
+          int storage_in;
+          nc_inq_var_deflate(ncid, ncvarid, &shuffle, &deflate, &deflate_level);
+          if ( deflate > 0 ) ncvars[ncvarid].deflate = 1;
+
+          if ( nc_inq_var_chunking(ncid, ncvarid, &storage_in, chunks) == NC_NOERR )
+            {
+              if ( storage_in == NC_CHUNKED )
+                {
+                  ncvars[ncvarid].chunked = 1;
+                  for ( int i = 0; i < nvdims; ++i ) ncvars[ncvarid].chunks[i] = chunks[i];
+                  /*
+                  printf("storage %d %d %d\n", storage_in, NC_CONTIGUOUS, NC_CHUNKED);
+                  for ( int i = 0; i < nvdims; ++i ) printf("chunk %d %d\n", i, chunks[i]);
+                  */
+                }
+            }
+        }
+#endif
+
+      if ( nvdims > 0 )
+        if ( timedimid == dimidsp[0] )
+          {
+            ncvars[ncvarid].tsteptype = TSTEP_INSTANT;
+            cdfSetDim(ncvars, ncvarid, 0, T_AXIS);
+          }
+
+      for ( iatt = 0; iatt < nvatts; iatt++ )
+        {
+          cdf_inq_attname(ncid, ncvarid, iatt, attname);
+          cdf_inq_atttype(ncid, ncvarid, attname, &atttype);
+          cdf_inq_attlen(ncid, ncvarid, attname, &attlen);
+
+          if ( strcmp(attname, "long_name") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, CDI_MAX_NAME, ncvars[ncvarid].longname);
+            }
+          else if ( strcmp(attname, "standard_name") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, CDI_MAX_NAME, ncvars[ncvarid].stdname);
+            }
+          else if ( strcmp(attname, "units") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, CDI_MAX_NAME, ncvars[ncvarid].units);
+            }
+          else if ( strcmp(attname, "calendar") == 0 )
+            {
+              ncvars[ncvarid].calendar = TRUE;
+            }
+          else if ( strcmp(attname, "param") == 0 && atttype == NC_CHAR )
+            {
+	      char paramstr[32];
+	      int pnum = 0, pcat = 255, pdis = 255;
+              cdfGetAttText(ncid, ncvarid, attname, sizeof(paramstr), paramstr);
+	      sscanf(paramstr, "%d.%d.%d", &pnum, &pcat, &pdis);
+	      ncvars[ncvarid].param = cdiEncodeParam(pnum, pcat, pdis);
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "code") == 0 && atttype != NC_CHAR )
+            {
+              cdfGetAttInt(ncid, ncvarid, attname, 1, &ncvars[ncvarid].code);
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "table") == 0 && atttype != NC_CHAR )
+            {
+              cdfGetAttInt(ncid, ncvarid, attname, 1, &tablenum);
+              if ( tablenum > 0 )
+                {
+                  ncvars[ncvarid].tabnum = tablenum;
+                  ncvars[ncvarid].tableID = tableInq(modelID, tablenum, NULL);
+                  if ( ncvars[ncvarid].tableID == CDI_UNDEFID )
+                    ncvars[ncvarid].tableID = tableDef(modelID, tablenum, NULL);
+                }
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "trunc_type") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              if ( memcmp(attstring, "Triangular", attlen) == 0 )
+                ncvars[ncvarid].gridtype = GRID_SPECTRAL;
+            }
+          else if ( strcmp(attname, "grid_type") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              strtolower(attstring);
+
+              if      ( strcmp(attstring, "gaussian reduced") == 0 )
+                ncvars[ncvarid].gridtype = GRID_GAUSSIAN_REDUCED;
+              else if ( strcmp(attstring, "gaussian") == 0 )
+                ncvars[ncvarid].gridtype = GRID_GAUSSIAN;
+              else if ( strncmp(attstring, "spectral", 8) == 0 )
+                ncvars[ncvarid].gridtype = GRID_SPECTRAL;
+              else if ( strncmp(attstring, "fourier", 7) == 0 )
+                ncvars[ncvarid].gridtype = GRID_FOURIER;
+              else if ( strcmp(attstring, "trajectory") == 0 )
+                ncvars[ncvarid].gridtype = GRID_TRAJECTORY;
+              else if ( strcmp(attstring, "generic") == 0 )
+                ncvars[ncvarid].gridtype = GRID_GENERIC;
+              else if ( strcmp(attstring, "cell") == 0 )
+                ncvars[ncvarid].gridtype = GRID_UNSTRUCTURED;
+              else if ( strcmp(attstring, "unstructured") == 0 )
+                ncvars[ncvarid].gridtype = GRID_UNSTRUCTURED;
+              else if ( strcmp(attstring, "curvilinear") == 0 )
+                ncvars[ncvarid].gridtype = GRID_CURVILINEAR;
+              else if ( strcmp(attstring, "sinusoidal") == 0 )
+                ;
+              else if ( strcmp(attstring, "laea") == 0 )
+                ;
+              else if ( strcmp(attstring, "lcc2") == 0 )
+                ;
+              else if ( strcmp(attstring, "linear") == 0 ) // ignore grid type linear
+                ;
+              else
+                {
+                  static int warn = TRUE;
+                  if ( warn )
+                    {
+                      warn = FALSE;
+                      Warning("netCDF attribute grid_type='%s' unsupported!", attstring);
+                    }
+                }
+
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "level_type") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              strtolower(attstring);
+
+              if      ( strcmp(attstring, "toa") == 0 )
+                ncvars[ncvarid].zaxistype = ZAXIS_TOA;
+              else if ( strcmp(attstring, "seabottom") == 0 )
+                ncvars[ncvarid].zaxistype = ZAXIS_SEA_BOTTOM;
+              else if ( strcmp(attstring, "atmosphere") == 0 )
+                ncvars[ncvarid].zaxistype = ZAXIS_ATMOSPHERE;
+              else
+                { 
+                  static int warn = TRUE;
+                  if ( warn )
+                    {
+                      warn = FALSE;
+                      Warning("netCDF attribute level_type='%s' unsupported!", attstring);
+                    }
+                }
+
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "trunc_count") == 0 && atttype != NC_CHAR )
+            {
+              cdfGetAttInt(ncid, ncvarid, attname, 1, &ncvars[ncvarid].truncation);
+            }
+          else if ( strcmp(attname, "truncation") == 0 && atttype != NC_CHAR )
+            {
+              cdfGetAttInt(ncid, ncvarid, attname, 1, &ncvars[ncvarid].truncation);
+            }
+          else if ( strcmp(attname, "add_offset") == 0 && atttype != NC_CHAR )
+            {
+	      cdfGetAttDouble(ncid, ncvarid, attname, 1, &ncvars[ncvarid].addoffset);
+	      /*
+		if ( atttype != NC_BYTE && atttype != NC_SHORT && atttype != NC_INT )
+		if ( ncvars[ncvarid].addoffset != 0 )
+		Warning("attribute add_offset not supported for atttype %d", atttype);
+	      */
+	      /* (also used for lon/lat) cdfSetVar(ncvars, ncvarid, TRUE); */
+            }
+          else if ( strcmp(attname, "scale_factor") == 0 && atttype != NC_CHAR )
+            {
+	      cdfGetAttDouble(ncid, ncvarid, attname, 1, &ncvars[ncvarid].scalefactor);
+	      /*
+		if ( atttype != NC_BYTE && atttype != NC_SHORT && atttype != NC_INT )
+		if ( ncvars[ncvarid].scalefactor != 1 )
+		Warning("attribute scale_factor not supported for atttype %d", atttype);
+	      */
+	      /* (also used for lon/lat) cdfSetVar(ncvars, ncvarid, TRUE); */
+            }
+          else if ( strcmp(attname, "bounds") == 0 && atttype == NC_CHAR )
+            {
+              int status, ncboundsid;
+
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+
+              status = nc_inq_varid(ncid, attstring, &ncboundsid);
+
+              if ( status == NC_NOERR )
+                {
+                  ncvars[ncvarid].bounds = ncboundsid;
+                  cdfSetVar(ncvars, ncvars[ncvarid].bounds, FALSE);
+                  cdfSetVar(ncvars, ncvarid, FALSE);
+                }
+              else
+                Warning("%s - %s", nc_strerror(status), attstring);
+            }
+          else if ( strcmp(attname, "cell_measures") == 0 && atttype == NC_CHAR )
+            {
+              char *pstring, *cell_measures = NULL, *cell_var = NULL;
+
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              pstring = attstring;
+
+              while ( isspace((int) *pstring) ) pstring++;
+              cell_measures = pstring;
+              while ( isalnum((int) *pstring) ) pstring++;
+              *pstring++ = 0;
+              while ( isspace((int) *pstring) ) pstring++;
+              cell_var = pstring;
+              while ( ! isspace((int) *pstring) && *pstring != 0 ) pstring++;
+              *pstring++ = 0;
+              /*
+              printf("cell_measures >%s<\n", cell_measures);
+              printf("cell_var >%s<\n", cell_var);
+              */
+              if ( memcmp(cell_measures, "area", 4) == 0 )
+                {
+                  int status;
+                  int nc_cell_id;
+
+                  status = nc_inq_varid(ncid, cell_var, &nc_cell_id);
+                  if ( status == NC_NOERR )
+                    {
+                      ncvars[ncvarid].cellarea = nc_cell_id;
+                      /* ncvars[nc_cell_id].isvar = UNDEFID; */
+                      cdfSetVar(ncvars, nc_cell_id, FALSE);
+                    }
+                  else
+                    Warning("%s - %s", nc_strerror(status), cell_var);
+                }
+              else
+                {
+                  Warning("%s has an unexpected contents: %s", attname, cell_measures);
+                }
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          /*
+          else if ( strcmp(attname, "coordinates") == 0 )
+            {
+              char *pstring, *xvarname = NULL, *yvarname = NULL;
+
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              pstring = attstring;
+
+              while ( isspace((int) *pstring) ) pstring++;
+              xvarname = pstring;
+              while ( isgraph((int) *pstring) ) pstring++;
+              *pstring++ = 0;
+              while ( isspace((int) *pstring) ) pstring++;
+              yvarname = pstring;
+              while ( isgraph((int) *pstring) ) pstring++;
+              *pstring++ = 0;
+
+              cdf_inq_varid(ncid, xvarname, &ncvars[ncvarid].xvarid);
+              cdf_inq_varid(ncid, yvarname, &ncvars[ncvarid].yvarid);
+
+              cdfSetVar(ncvars, ncvars[ncvarid].xvarid, FALSE);
+              cdfSetVar(ncvars, ncvars[ncvarid].yvarid, FALSE);
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          */
+          else if ( (strcmp(attname, "associate")  == 0 || strcmp(attname, "coordinates") == 0) &&
+		    atttype == NC_CHAR )
+            {
+              int status;
+              char *pstring, *varname = NULL;
+              int lstop = FALSE;
+              int dimvarid;
+              extern int cdiIgnoreAttCoordinates;
+
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              pstring = attstring;
+
+              for ( i = 0; i < 4; i++ )
+                {
+                  while ( isspace((int) *pstring) ) pstring++;
+                  if ( *pstring == 0 ) break;
+                  varname = pstring;
+                  while ( !isspace((int) *pstring) && *pstring != 0 ) pstring++;
+                  if ( *pstring == 0 ) lstop = TRUE;
+                  *pstring++ = 0;
+
+                  status = nc_inq_varid(ncid, varname, &dimvarid);
+                  if ( status == NC_NOERR )
+                    {
+                      cdfSetVar(ncvars, dimvarid, FALSE);
+                      if ( cdiIgnoreAttCoordinates == FALSE )
+                        {
+                          ncvars[ncvarid].coordvarids[i] = dimvarid;
+                          ncvars[ncvarid].ncoordvars++;
+                        }
+                    }
+                  else
+                    Warning("%s - %s", nc_strerror(status), varname);
+
+                  if ( lstop ) break;
+                }
+
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "grid_mapping") == 0 && atttype == NC_CHAR )
+            {
+              int status;
+              int nc_gmap_id;
+
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+
+              status = nc_inq_varid(ncid, attstring, &nc_gmap_id);
+              if ( status == NC_NOERR )
+                {
+                  ncvars[ncvarid].gmapid = nc_gmap_id;
+                  cdfSetVar(ncvars, ncvars[ncvarid].gmapid, FALSE);
+                }
+              else
+                Warning("%s - %s", nc_strerror(status), attstring);
+
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "positive") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              strtolower(attstring);
+
+              if    ( memcmp(attstring, "down", 4) == 0 ) ncvars[ncvarid].positive = -1;
+              else if ( memcmp(attstring, "up", 2) == 0 ) ncvars[ncvarid].positive = 1;
+
+              if ( ncvars[ncvarid].ndims == 1 )
+                {
+                  cdfSetVar(ncvars, ncvarid, FALSE);
+                  cdfSetDim(ncvars, ncvarid, 0, Z_AXIS);
+                  ncdims[ncvars[ncvarid].dimids[0]].dimtype = Z_AXIS;
+                }
+            }
+          else if ( (strcmp(attname, "_FillValue") == 0 || strcmp(attname, "missing_value") == 0) &&
+		    atttype != NC_CHAR )
+            {
+	      cdfGetAttDouble(ncid, ncvarid, attname, 1, &ncvars[ncvarid].missval);
+	      ncvars[ncvarid].defmiss = TRUE;
+	      /* cdfSetVar(ncvars, ncvarid, TRUE); */
+            }
+          else if ( strcmp(attname, "valid_range") == 0 && attlen == 2 )
+            {
+              if ( ncvars[ncvarid].lvalidrange == FALSE )
+                {
+                  cdfGetAttDouble(ncid, ncvarid, attname, 2, ncvars[ncvarid].validrange);
+                  ncvars[ncvarid].lvalidrange = TRUE;
+                  if ( ((int)ncvars[ncvarid].validrange[0]) == 0 && ((int)ncvars[ncvarid].validrange[1]) == 255 )
+                    ncvars[ncvarid].lunsigned = TRUE;
+                  /* cdfSetVar(ncvars, ncvarid, TRUE); */
+                }
+            }
+          else if ( strcmp(attname, "valid_min") == 0 && attlen == 1 )
+            {
+              cdfGetAttDouble(ncid, ncvarid, attname, 1, &(ncvars[ncvarid].validrange)[0]);
+              ncvars[ncvarid].lvalidrange = TRUE;
+            }
+          else if ( strcmp(attname, "valid_max") == 0 && attlen == 1 )
+            {
+              cdfGetAttDouble(ncid, ncvarid, attname, 1, &(ncvars[ncvarid].validrange)[1]);
+              ncvars[ncvarid].lvalidrange = TRUE;
+            }
+          else if ( strcmp(attname, "_Unsigned") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              strtolower(attstring);
+
+              if ( memcmp(attstring, "true", 4) == 0 )
+                {
+                  ncvars[ncvarid].lunsigned = TRUE;
+                  /*
+                  ncvars[ncvarid].lvalidrange = TRUE;
+                  ncvars[ncvarid].validrange[0] = 0;
+                  ncvars[ncvarid].validrange[1] = 255;
+                  */
+                }
+	      /* cdfSetVar(ncvars, ncvarid, TRUE); */
+            }
+          else if ( strcmp(attname, "cdi") == 0 && atttype == NC_CHAR )
+            {
+	      cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+	      strtolower(attstring);
+
+	      if ( memcmp(attstring, "ignore", 6) == 0 )
+		{
+		  ncvars[ncvarid].ignore = TRUE;
+		  cdfSetVar(ncvars, ncvarid, FALSE);
+		}
+            }
+          else if ( strcmp(attname, "axis") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+	      attlen = strlen(attstring);
+
+	      if ( (int) attlen > nvdims )
+		{
+		  if ( nvdims > 0 )
+		    Warning("Unexpected axis attribute length for %s, ignored!", name);
+		}
+	      else
+		{
+		  strtolower(attstring);
+		  for ( i = 0; i < (int)attlen; ++i )
+		    {
+		      if ( attstring[i] != '-' && attstring[i] != 't' && attstring[i] != 'z' &&
+			   attstring[i] != 'y' && attstring[i] != 'x' )
+			{
+			  Warning("Unexpected character in axis attribute for %s, ignored!", name);
+			  break;
+			}
+		    }
+
+		  if ( i == (int) attlen && (int) attlen == nvdims)
+		    {
+		      while ( attlen-- )
+			{
+			  if ( (int) attstring[attlen] == 't' )
+			    {
+			      if ( attlen != 0 ) Warning("axis attribute 't' not on first position");
+			      cdfSetDim(ncvars, ncvarid, attlen, T_AXIS);
+			    }
+			  else if ( (int) attstring[attlen] == 'z' )
+			    {
+			      ncvars[ncvarid].zdim = dimidsp[attlen];
+			      cdfSetDim(ncvars, ncvarid, attlen, Z_AXIS);
+
+			      if ( ncvars[ncvarid].ndims == 1 )
+				{
+				  cdfSetVar(ncvars, ncvarid, FALSE);
+				  ncdims[ncvars[ncvarid].dimids[0]].dimtype = Z_AXIS;
+				}
+			    }
+			  else if ( (int) attstring[attlen] == 'y' )
+			    {
+			      ncvars[ncvarid].ydim = dimidsp[attlen];
+			      cdfSetDim(ncvars, ncvarid, attlen, Y_AXIS);
+
+			      if ( ncvars[ncvarid].ndims == 1 )
+				{
+				  cdfSetVar(ncvars, ncvarid, FALSE);
+				  ncdims[ncvars[ncvarid].dimids[0]].dimtype = Y_AXIS;
+				}
+			    }
+			  else if ( (int) attstring[attlen] == 'x' )
+			    {
+			      ncvars[ncvarid].xdim = dimidsp[attlen];
+			      cdfSetDim(ncvars, ncvarid, attlen, X_AXIS);
+
+			      if ( ncvars[ncvarid].ndims == 1 )
+				{
+				  cdfSetVar(ncvars, ncvarid, FALSE);
+				  ncdims[ncvars[ncvarid].dimids[0]].dimtype = X_AXIS;
+				}
+			    }
+			}
+		    }
+		}
+	    }
+	  else if ( ( strcmp(attname, "realization") == 0 )         ||
+	            ( strcmp(attname, "ensemble_members") == 0 )    ||
+	            ( strcmp(attname, "forecast_init_type") == 0 )    )
+	    {
+	      int temp;
+
+	      if( ncvars[ncvarid].ensdata == NULL )
+		ncvars[ncvarid].ensdata = (ensinfo_t *) malloc( sizeof( ensinfo_t ) );
+
+	      cdfGetAttInt(ncid, ncvarid, attname, 1, &temp);
+
+	      if( strcmp(attname, "realization") == 0 )
+		ncvars[ncvarid].ensdata->ens_index = temp;
+	      else if( strcmp(attname, "ensemble_members") == 0 )
+		ncvars[ncvarid].ensdata->ens_count = temp;
+	      else if( strcmp(attname, "forecast_init_type") == 0 )
+		ncvars[ncvarid].ensdata->forecast_init_type = temp;
+
+	      cdfSetVar(ncvars, ncvarid, TRUE);
+	    }
+	  else
+	    {
+	      if ( ncvars[ncvarid].natts == 0 )
+		ncvars[ncvarid].atts = (int *) malloc(nvatts*sizeof(int));
+
+	      ncvars[ncvarid].atts[ncvars[ncvarid].natts++] = iatt;
+	      /*
+	      int attrint;
+	      double attrflt;
+	      nc_type attrtype;
+	      cdf_inq_attlen(ncid, ncvarid, attname, &attlen);
+	      cdf_inq_atttype(ncid, ncvarid, attname, &attrtype);
+	      if ( attlen == 1 && (attrtype == NC_INT || attrtype == NC_SHORT) )
+		{
+		  cdfGetAttInt(ncid, ncvarid, attname, 1, &attrint);
+		  printf("int: %s.%s = %d\n", ncvars[ncvarid].name, attname, attrint);
+		}
+	      else if ( attlen == 1 && (attrtype == NC_FLOAT || attrtype == NC_DOUBLE) )
+		{
+		  cdfGetAttDouble(ncid, ncvarid, attname, 1, &attrflt);
+		  printf("flt: %s.%s = %g\n", ncvars[ncvarid].name, attname, attrflt);
+		}
+	      else if ( attrtype == NC_CHAR )
+		{
+		  cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+		  attstring[attlen] = 0;
+		  printf("txt: %s.%s = %s\n", ncvars[ncvarid].name, attname, attstring);
+		}
+	      else
+		printf("att: %s.%s = unknown\n", ncvars[ncvarid].name, attname);
+	      */
+	    }
+	}
+    }
+}
+
+static
+void setDimType(int nvars, ncvar_t *ncvars, ncdim_t *ncdims)
+{
+  int ndims;
+  int ncvarid, ncdimid;
+  int i;
+
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( ncvars[ncvarid].isvar == TRUE )
+	{
+	  int lxdim = 0, lydim = 0, lzdim = 0/* , ltdim = 0 */;
+	  ndims = ncvars[ncvarid].ndims;
+	  for ( i = 0; i < ndims; i++ )
+	    {
+	      ncdimid = ncvars[ncvarid].dimids[i];
+	      if      ( ncdims[ncdimid].dimtype == X_AXIS ) cdfSetDim(ncvars, ncvarid, i, X_AXIS);
+	      else if ( ncdims[ncdimid].dimtype == Y_AXIS ) cdfSetDim(ncvars, ncvarid, i, Y_AXIS);
+	      else if ( ncdims[ncdimid].dimtype == Z_AXIS ) cdfSetDim(ncvars, ncvarid, i, Z_AXIS);
+	      else if ( ncdims[ncdimid].dimtype == T_AXIS ) cdfSetDim(ncvars, ncvarid, i, T_AXIS);
+	    }
+
+	  if ( CDI_Debug )
+	    {
+	      Message("var %d %s", ncvarid, ncvars[ncvarid].name);
+	      for ( i = 0; i < ndims; i++ )
+		printf("  dim %d type %d  ", i, ncvars[ncvarid].dimtype[i]);
+	      printf("\n");
+	    }
+
+	  for ( i = 0; i < ndims; i++ )
+	    {
+	      if      ( ncvars[ncvarid].dimtype[i] == X_AXIS ) lxdim = TRUE;
+	      else if ( ncvars[ncvarid].dimtype[i] == Y_AXIS ) lydim = TRUE;
+	      else if ( ncvars[ncvarid].dimtype[i] == Z_AXIS ) lzdim = TRUE;
+	      /* else if ( ncvars[ncvarid].dimtype[i] == T_AXIS ) ltdim = TRUE; */
+	    }
+
+          //   if ( ndims > 1 )
+            for ( i = ndims-1; i >= 0; i-- )
+              {
+                if ( ncvars[ncvarid].dimtype[i] == -1 )
+                  {
+                    if ( lxdim == FALSE )
+                      {
+                        cdfSetDim(ncvars, ncvarid, i, X_AXIS);
+                        lxdim = TRUE;
+                      }
+                    else if ( lydim == FALSE && ncvars[ncvarid].gridtype != GRID_UNSTRUCTURED )
+                      {
+                        cdfSetDim(ncvars, ncvarid, i, Y_AXIS);
+                        lydim = TRUE;
+                      }
+                    else if ( lzdim == FALSE )
+                      {
+                        cdfSetDim(ncvars, ncvarid, i, Z_AXIS);
+                        lzdim = TRUE;
+                      }
+                  }
+              }
+	}
+    }
+}
+
+/* verify coordinate vars - first scan (dimname == varname) */
+static
+void verify_coordinate_vars_1(int ndims, ncdim_t *ncdims, ncvar_t *ncvars, int timedimid)
+{
+  int ncdimid, ncvarid;
+
+  for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+    {
+      ncvarid = ncdims[ncdimid].ncvarid;
+      if ( ncvarid != -1 )
+	{
+	  if ( ncvars[ncvarid].dimids[0] == timedimid )
+	    {
+              ncvars[ncvarid].istime = TRUE;
+	      ncdims[ncdimid].dimtype = T_AXIS;
+	      continue;
+	    }
+
+	  if ( ncvars[ncvarid].longname[0] != 0 && ncvars[ncvarid].longname[1] != 0 )
+	    {
+	      if ( memcmp(ncvars[ncvarid].longname+1, "ongitude", 8) == 0 )
+		{
+		  ncvars[ncvarid].islon = TRUE;
+		  cdfSetVar(ncvars, ncvarid, FALSE);
+		  cdfSetDim(ncvars, ncvarid, 0, X_AXIS);
+		  ncdims[ncdimid].dimtype = X_AXIS;
+		  continue;
+		}
+	      else if ( memcmp(ncvars[ncvarid].longname+1, "atitude", 7) == 0 )
+		{
+		  ncvars[ncvarid].islat = TRUE;
+		  cdfSetVar(ncvars, ncvarid, FALSE);
+		  cdfSetDim(ncvars, ncvarid, 0, Y_AXIS);
+		  ncdims[ncdimid].dimtype = Y_AXIS;
+		  continue;
+		}
+	    }
+
+	  if ( ncvars[ncvarid].units[0] != 0 )
+	    {
+	      if ( isLonAxis(ncvars[ncvarid].units, ncvars[ncvarid].stdname) )
+		{
+		  ncvars[ncvarid].islon = TRUE;
+		  cdfSetVar(ncvars, ncvarid, FALSE);
+		  cdfSetDim(ncvars, ncvarid, 0, X_AXIS);
+		  ncdims[ncdimid].dimtype = X_AXIS;
+		}
+	      else if ( isLatAxis(ncvars[ncvarid].units, ncvars[ncvarid].stdname) )
+		{
+		  ncvars[ncvarid].islat = TRUE;
+		  cdfSetVar(ncvars, ncvarid, FALSE);
+		  cdfSetDim(ncvars, ncvarid, 0, Y_AXIS);
+		  ncdims[ncdimid].dimtype = Y_AXIS;
+		}
+	      else if ( unitsIsPressure(ncvars[ncvarid].units) )
+		{
+		  ncvars[ncvarid].zaxistype = ZAXIS_PRESSURE;
+		}
+	      else if ( strcmp(ncvars[ncvarid].units, "level") == 0 || strcmp(ncvars[ncvarid].units, "1") == 0 )
+		{
+		  if      ( strcmp(ncvars[ncvarid].longname, "hybrid level at layer midpoints") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID;
+		  else if ( memcmp(ncvars[ncvarid].longname, "hybrid level at midpoints", 25) == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID;
+		  else if ( strcmp(ncvars[ncvarid].longname, "hybrid level at layer interfaces") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID_HALF;
+		  else if ( memcmp(ncvars[ncvarid].longname, "hybrid level at interfaces", 26) == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID_HALF;
+		  else if ( strcmp(ncvars[ncvarid].units, "level") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_GENERIC;
+		}
+	      else if ( isDBLAxis(ncvars[ncvarid].units, ncvars[ncvarid].longname) )
+                {
+                  ncvars[ncvarid].zaxistype = ZAXIS_DEPTH_BELOW_LAND;
+		}
+	      else if ( strcmp(ncvars[ncvarid].units, "m")   == 0 )
+		{
+		  if ( isDepthAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
+		    ncvars[ncvarid].zaxistype = ZAXIS_DEPTH_BELOW_SEA;
+		  else if ( isHeightAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HEIGHT;
+		}
+	    }
+
+	  if ( ncvars[ncvarid].zaxistype != UNDEFID )
+	    {
+              ncvars[ncvarid].islev = TRUE;
+	      cdfSetVar(ncvars, ncvarid, FALSE);
+	      cdfSetDim(ncvars, ncvarid, 0, Z_AXIS);
+	      ncdims[ncdimid].dimtype = Z_AXIS;
+	    }
+	}
+    }
+}
+
+/* verify coordinate vars - second scan (all other variables) */
+static
+void verify_coordinate_vars_2(int nvars, ncvar_t *ncvars)
+{
+  int ncvarid;
+
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( ncvars[ncvarid].isvar == 0 )
+	{
+	  /* not needed anymore for rotated grids */
+	  if ( ncvars[ncvarid].longname[0] != 0 && ncvars[ncvarid].longname[1] != 0 )
+	    {
+	      if ( memcmp(ncvars[ncvarid].longname+1, "ongitude", 8) == 0 )
+		{
+		  ncvars[ncvarid].islon = TRUE;
+		  continue;
+		}
+	      else if ( memcmp(ncvars[ncvarid].longname+1, "atitude", 7) == 0 )
+		{
+		  ncvars[ncvarid].islat = TRUE;
+		  continue;
+		}
+	    }
+
+	  if ( ncvars[ncvarid].units[0] != 0 )
+	    {
+	      if ( isLonAxis(ncvars[ncvarid].units, ncvars[ncvarid].stdname) )
+		{
+		  ncvars[ncvarid].islon = TRUE;
+		  continue;
+		}
+	      else if ( isLatAxis(ncvars[ncvarid].units, ncvars[ncvarid].stdname) )
+		{
+		  ncvars[ncvarid].islat = TRUE;
+		  continue;
+		}
+	      else if ( unitsIsPressure(ncvars[ncvarid].units) )
+		{
+		  ncvars[ncvarid].zaxistype = ZAXIS_PRESSURE;
+		  continue;
+		}
+	      else if ( strcmp(ncvars[ncvarid].units, "level") == 0 || strcmp(ncvars[ncvarid].units, "1") == 0 )
+		{
+		  if      ( strcmp(ncvars[ncvarid].longname, "hybrid level at layer midpoints") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID;
+		  else if ( memcmp(ncvars[ncvarid].longname, "hybrid level at midpoints", 25) == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID;
+		  else if ( strcmp(ncvars[ncvarid].longname, "hybrid level at layer interfaces") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID_HALF;
+		  else if ( memcmp(ncvars[ncvarid].longname, "hybrid level at interfaces", 26) == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID_HALF;
+		  else if ( strcmp(ncvars[ncvarid].units, "level") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_GENERIC;
+		  continue;
+		}
+	      else if ( isDBLAxis(ncvars[ncvarid].units, ncvars[ncvarid].longname) )
+		{
+                  ncvars[ncvarid].zaxistype = ZAXIS_DEPTH_BELOW_LAND;
+		  continue;
+		}
+	      else if ( strcmp(ncvars[ncvarid].units, "m")   == 0 )
+		{
+		  if ( isDepthAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
+		    ncvars[ncvarid].zaxistype = ZAXIS_DEPTH_BELOW_SEA;
+		  else if ( isHeightAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HEIGHT;
+		  continue;
+		}
+	    }
+	}
+    }
+}
+
+static
+void copy_numeric_projatts(int gridID, int ncvarID, int ncfileID)
+{
+  int iatt, nvatts;
+  size_t attlen;
+  char attname[CDI_MAX_NAME];
+  nc_type xtype;
+
+  cdf_inq_varnatts(ncfileID, ncvarID, &nvatts);
+
+  for ( iatt = 0; iatt < nvatts; iatt++ )
+    {
+      cdf_inq_attname(ncfileID, ncvarID, iatt, attname);
+      cdf_inq_atttype(ncfileID, ncvarID, attname, &xtype);
+      cdf_inq_attlen(ncfileID, ncvarID, attname, &attlen);
+
+      //  printf("%s %d\n", attname, (int)attlen);
+    }
+
+}
+
+/* define all input grids */
+static
+void define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nvars, ncvar_t *ncvars, int timedimid)
+{
+  int ncvarid, ncvarid2;
+  int ndims;
+  int nbdims;
+  int i;
+  int nvatts;
+  size_t nvertex;
+  grid_t grid;
+  grid_t proj;
+  int gridindex;
+  size_t size = 0, xsize, ysize, np;
+  char name[CDI_MAX_NAME];
+  int iatt;
+  int ltwarn = TRUE;
+  size_t attlen;
+  char attname[CDI_MAX_NAME];
+  const int attstringlen = 8192; char attstring[8192];
+  double datt;
+
+  for ( ncvarid = 0; ncvarid < nvars; ++ncvarid )
+    {
+      if ( ncvars[ncvarid].isvar && ncvars[ncvarid].gridID == UNDEFID )
+	{
+	  int xdimids[2] = {-1,-1}, ydimids[2] = {-1,-1};
+	  int xdimid = -1, ydimid = -1;
+	  int xvarid = -1, yvarid = -1;
+	  int islon = 0, islat = 0;
+	  int nxdims = 0, nydims = 0;
+	  double xinc = 0, yinc = 0;
+
+	  xsize = 0;
+	  ysize = 0;
+          np    = 0;
+
+	  ndims = ncvars[ncvarid].ndims;
+	  for ( i = 0; i < ndims; i++ )
+	    {
+	      if ( ncvars[ncvarid].dimtype[i] == X_AXIS && nxdims < 2 )
+		{
+		  xdimids[nxdims] = ncvars[ncvarid].dimids[i];
+		  nxdims++;
+		}
+	      else if ( ncvars[ncvarid].dimtype[i] == Y_AXIS && nydims < 2 )
+		{
+		  ydimids[nydims] = ncvars[ncvarid].dimids[i];
+		  nydims++;
+		}
+	    }
+
+	  if ( nxdims == 2 )
+	    {
+	      xdimid = xdimids[1];
+	      ydimid = xdimids[0];
+	    }
+	  else if ( nydims == 2 )
+	    {
+	      xdimid = ydimids[1];
+	      ydimid = ydimids[0];
+	    }
+	  else
+	    {
+	      xdimid = xdimids[0];
+	      ydimid = ydimids[0];
+	    }
+
+	  if ( ncvars[ncvarid].xvarid != UNDEFID )
+	    xvarid = ncvars[ncvarid].xvarid;
+	  else if ( xdimid != UNDEFID )
+	    xvarid = ncdims[xdimid].ncvarid;
+
+	  if ( ncvars[ncvarid].yvarid != UNDEFID )
+	    yvarid = ncvars[ncvarid].yvarid;
+	  else if ( ydimid != UNDEFID )
+	    yvarid = ncdims[ydimid].ncvarid;
+
+	  /*
+	  if ( xdimid != UNDEFID )
+	    xvarid = ncdims[xdimid].ncvarid;
+	  if ( xvarid == UNDEFID && ncvars[ncvarid].xvarid != UNDEFID )
+	    xvarid = ncvars[ncvarid].xvarid;
+
+	  if ( ydimid != UNDEFID )
+	    yvarid = ncdims[ydimid].ncvarid;
+	  if ( yvarid == UNDEFID && ncvars[ncvarid].yvarid != UNDEFID )
+	    yvarid = ncvars[ncvarid].yvarid;
+	  */
+
+	  if ( xdimid != UNDEFID ) xsize = ncdims[xdimid].len;
+	  if ( ydimid != UNDEFID ) ysize = ncdims[ydimid].len;
+
+	  if ( ydimid == UNDEFID && yvarid != UNDEFID )
+	    {
+	      if ( ncvars[yvarid].ndims == 1 )
+		{
+		  ydimid = ncvars[yvarid].dimids[0];
+		  ysize  = ncdims[ydimid].len;
+		}
+	    }
+
+	  if ( ncvars[ncvarid].gridtype == UNDEFID || ncvars[ncvarid].gridtype == GRID_GENERIC )
+	    if ( ydimid == xdimid ) ncvars[ncvarid].gridtype = GRID_UNSTRUCTURED;
+
+	  grid_init(&grid);
+	  grid_init(&proj);
+
+	  grid.prec  = DATATYPE_FLT64;
+	  grid.trunc = ncvars[ncvarid].truncation;
+
+	  if ( ncvars[ncvarid].gridtype == GRID_TRAJECTORY )
+	    {
+	      if ( ncvars[ncvarid].xvarid == UNDEFID )
+		Error("Longitude coordinate undefined for %s!", name);
+	      if ( ncvars[ncvarid].yvarid == UNDEFID )
+		Error("Latitude coordinate undefined for %s!", name);
+	    }
+	  else
+	    {
+	      size_t start[3], count[3];
+	      int ltgrid = FALSE;
+
+	      if ( xvarid != UNDEFID && yvarid != UNDEFID )
+		{
+		  if ( ncvars[xvarid].ndims != ncvars[yvarid].ndims )
+		    {
+		      Warning("Inconsistent grid structure for variable %s!",
+			      ncvars[ncvarid].name);
+		      ncvars[ncvarid].xvarid = UNDEFID;
+		      ncvars[ncvarid].yvarid = UNDEFID;
+		      xvarid = UNDEFID;
+		      yvarid = UNDEFID;
+		    }
+
+		  if ( ncvars[xvarid].ndims > 2 || ncvars[yvarid].ndims > 2 )
+		    {
+		      if ( ncvars[xvarid].ndims == 3 && ncvars[xvarid].dimids[0] == timedimid &&
+			   ncvars[yvarid].ndims == 3 && ncvars[yvarid].dimids[0] == timedimid )
+			{
+			  if ( ltwarn )
+			    Warning("Time varying grids unsupported, using grid at time step 1!");
+			  ltgrid = TRUE;
+			  ltwarn = FALSE;
+			  start[0] = start[1] = start[2] = 0;
+			  count[0] = 1; count[1] = ysize; count[2] = xsize;
+			}
+		      else
+			{
+			  Warning("Unsupported grid structure for variable %s (grid dims > 2)!", ncvars[ncvarid].name);
+			  ncvars[ncvarid].xvarid = UNDEFID;
+			  ncvars[ncvarid].yvarid = UNDEFID;
+			  xvarid = UNDEFID;
+			  yvarid = UNDEFID;
+			}
+		    }
+		}
+
+	      if ( xvarid != UNDEFID )
+		{
+		  islon = ncvars[xvarid].islon;
+		  ndims = ncvars[xvarid].ndims;
+		  if ( ndims == 2 || ndims == 3 )
+		    {
+		      ncvars[ncvarid].gridtype = GRID_CURVILINEAR;
+		      size = xsize*ysize;
+		      /* Check size of 2 dimensional coordinate variables */
+		      {
+			int dimid;
+			size_t dimsize1, dimsize2;
+			dimid = ncvars[xvarid].dimids[ndims-2];
+			dimsize1 = ncdims[dimid].len;
+			dimid = ncvars[xvarid].dimids[ndims-1];
+			dimsize2 = ncdims[dimid].len;
+			if ( dimsize1*dimsize2 != size )
+			  {
+			    Warning("Unsupported array structure, skipped variable %s!", ncvars[ncvarid].name);
+			    ncvars[ncvarid].isvar = -1;
+			    continue;
+			  }
+		      }
+		    }
+		  else
+		    {
+		      size = xsize;
+		      /* Check size of 1 dimensional coordinate variables */
+		      {
+			int dimid;
+			size_t dimsize;
+			dimid = ncvars[xvarid].dimids[0];
+			dimsize = ncdims[dimid].len;
+			if ( dimsize != size )
+			  {
+			    Warning("Unsupported array structure, skipped variable %s!", ncvars[ncvarid].name);
+			    ncvars[ncvarid].isvar = -1;
+			    continue;
+			  }
+		      }
+		    }
+
+		  if ( ncvars[xvarid].xtype == NC_FLOAT ) grid.prec = DATATYPE_FLT32;
+		  grid.xvals = (double *) malloc(size*sizeof(double));
+
+		  if ( ltgrid )
+		    cdf_get_vara_double(ncvars[xvarid].ncid, xvarid, start, count, grid.xvals);
+		  else
+		    cdf_get_var_double(ncvars[xvarid].ncid, xvarid, grid.xvals);
+
+                  scale_add(size, grid.xvals, ncvars[xvarid].addoffset, ncvars[xvarid].scalefactor);
+
+		  strcpy(grid.xname, ncvars[xvarid].name);
+		  strcpy(grid.xlongname, ncvars[xvarid].longname);
+		  strcpy(grid.xunits, ncvars[xvarid].units);
+		  /* don't change the name !!! */
+		  /*
+		  if ( (len = strlen(grid.xname)) > 2 )
+		    if ( grid.xname[len-2] == '_' && isdigit((int) grid.xname[len-1]) )
+		      grid.xname[len-2] = 0;
+		  */
+		  if ( islon && xsize > 1 )
+		    {
+		      xinc = fabs(grid.xvals[0] - grid.xvals[1]);
+		      for ( i = 2; i < (int) xsize; i++ )
+			if ( (fabs(grid.xvals[i-1] - grid.xvals[i]) - xinc) > (xinc/1000) ) break;
+
+		      if ( i < (int) xsize ) xinc = 0;
+		    }
+		}
+
+	      if ( yvarid != UNDEFID )
+		{
+		  islat = ncvars[yvarid].islat;
+		  ndims = ncvars[yvarid].ndims;
+		  if ( ndims == 2 || ndims == 3 )
+		    {
+		      ncvars[ncvarid].gridtype = GRID_CURVILINEAR;
+		      size = xsize*ysize;
+		      /* Check size of 2 dimensional coordinate variables */
+		      {
+			int dimid;
+			size_t dimsize1, dimsize2;
+			dimid = ncvars[yvarid].dimids[ndims-2];
+			dimsize1 = ncdims[dimid].len;
+			dimid = ncvars[yvarid].dimids[ndims-1];
+			dimsize2 = ncdims[dimid].len;
+			if ( dimsize1*dimsize2 != size )
+			  {
+			    Warning("Unsupported array structure, skipped variable %s!", ncvars[ncvarid].name);
+			    ncvars[ncvarid].isvar = -1;
+			    continue;
+			  }
+		      }
+		    }
+		  else
+		    {
+		      if ( (int) ysize == 0 ) size = xsize;
+		      else                    size = ysize;
+
+		      /* Check size of 1 dimensional coordinate variables */
+		      {
+			int dimid;
+			size_t dimsize;
+			dimid = ncvars[yvarid].dimids[0];
+			dimsize = ncdims[dimid].len;
+			if ( dimsize != size )
+			  {
+			    Warning("Unsupported array structure, skipped variable %s!", ncvars[ncvarid].name);
+			    ncvars[ncvarid].isvar = -1;
+			    continue;
+			  }
+		      }
+		    }
+
+		  if ( ncvars[yvarid].xtype == NC_FLOAT ) grid.prec = DATATYPE_FLT32;
+		  grid.yvals = (double *) malloc(size*sizeof(double));
+
+		  if ( ltgrid )
+		    cdf_get_vara_double(ncvars[yvarid].ncid, yvarid, start, count, grid.yvals);
+		  else
+		    cdf_get_var_double(ncvars[yvarid].ncid, yvarid, grid.yvals);
+
+                  scale_add(size, grid.yvals, ncvars[yvarid].addoffset, ncvars[yvarid].scalefactor);
+
+		  strcpy(grid.yname, ncvars[yvarid].name);
+		  strcpy(grid.ylongname, ncvars[yvarid].longname);
+		  strcpy(grid.yunits, ncvars[yvarid].units);
+		  /* don't change the name !!! */
+		  /*
+		  if ( (len = strlen(grid.yname)) > 2 )
+		    if ( grid.yname[len-2] == '_' && isdigit((int) grid.yname[len-1]) )
+		      grid.yname[len-2] = 0;
+		  */
+		  if ( islon && (int) ysize > 1 )
+		    {
+		      yinc = fabs(grid.yvals[0] - grid.yvals[1]);
+		      for ( i = 2; i < (int) ysize; i++ )
+			if ( (fabs(grid.yvals[i-1] - grid.yvals[i]) - yinc) > (yinc/1000) ) break;
+
+		      if ( i < (int) ysize ) yinc = 0;
+		    }
+		}
+
+	      if      ( (int) ysize == 0 ) size = xsize;
+	      else if ( (int) xsize == 0 ) size = ysize;
+	      else if ( ncvars[ncvarid].gridtype == GRID_UNSTRUCTURED ) size = xsize; 
+	      else                         size = xsize*ysize;
+	    }
+
+	  if ( ncvars[ncvarid].gridtype == UNDEFID ||
+	       ncvars[ncvarid].gridtype == GRID_GENERIC )
+	    {
+	      if ( islat && islon )
+		{
+		  if ( isGaussGrid(ysize, yinc, grid.yvals) )
+                    {
+                      ncvars[ncvarid].gridtype = GRID_GAUSSIAN;
+                      np = ysize/2;
+                    }
+                  else
+		    ncvars[ncvarid].gridtype = GRID_LONLAT;
+		}
+	      else if ( islat && !islon && xsize == 0 )
+		{
+		  if ( isGaussGrid(ysize, yinc, grid.yvals) )
+                    {
+                      ncvars[ncvarid].gridtype = GRID_GAUSSIAN;
+                      np = ysize/2;
+                    }
+                  else
+		    ncvars[ncvarid].gridtype = GRID_LONLAT;
+		}
+	      else if ( islon && !islat && ysize == 0 )
+		{
+		  ncvars[ncvarid].gridtype = GRID_LONLAT;
+		}
+	      else
+		ncvars[ncvarid].gridtype = GRID_GENERIC;
+	    }
+
+	  switch (ncvars[ncvarid].gridtype)
+	    {
+	    case GRID_GENERIC:
+	    case GRID_LONLAT:
+	    case GRID_GAUSSIAN:
+	    case GRID_UNSTRUCTURED:
+	    case GRID_CURVILINEAR:
+	      {
+		grid.size  = size;
+		grid.xsize = xsize;
+		grid.ysize = ysize;
+                grid.np    = np;
+		if ( xvarid != UNDEFID )
+		  {
+		    grid.xdef  = 1;
+		    if ( ncvars[xvarid].bounds != UNDEFID )
+		      {
+			nbdims = ncvars[ncvars[xvarid].bounds].ndims;
+			if ( nbdims == 2 || nbdims == 3 )
+			  {
+			    nvertex = ncdims[ncvars[ncvars[xvarid].bounds].dimids[nbdims-1]].len;
+			    grid.nvertex = (int) nvertex;
+			    grid.xbounds = (double *) malloc(nvertex*size*sizeof(double));
+			    cdf_get_var_double(ncvars[xvarid].ncid, ncvars[xvarid].bounds, grid.xbounds);
+			  }
+		      }
+		  }
+		if ( yvarid != UNDEFID )
+		  {
+		    grid.ydef  = 1;
+		    if ( ncvars[yvarid].bounds != UNDEFID )
+		      {
+			nbdims = ncvars[ncvars[yvarid].bounds].ndims;
+			if ( nbdims == 2 || nbdims == 3 )
+			  {
+			    nvertex = ncdims[ncvars[ncvars[yvarid].bounds].dimids[nbdims-1]].len;
+			    /*
+			    if ( nvertex != grid.nvertex )
+			      Warning("nvertex problem! nvertex x %d, nvertex y %d",
+				      grid.nvertex, (int) nvertex);
+			    */
+			    grid.ybounds = (double *) malloc(nvertex*size*sizeof(double));
+			    cdf_get_var_double(ncvars[yvarid].ncid, ncvars[yvarid].bounds, grid.ybounds);
+			  }
+		      }
+		  }
+
+		if ( ncvars[ncvarid].cellarea != UNDEFID )
+		  {
+		    grid.area = (double *) malloc(size*sizeof(double));
+		    cdf_get_var_double(ncvars[ncvarid].ncid, ncvars[ncvarid].cellarea, grid.area);
+		  }
+
+		break;
+	      }
+	    case GRID_SPECTRAL:
+	      {
+		grid.size = size;
+		grid.lcomplex = 1;
+		break;
+	      }
+	    case GRID_FOURIER:
+	      {
+		grid.size = size;
+		break;
+	      }
+	    case GRID_TRAJECTORY:
+	      {
+		grid.size = 1;
+		break;
+	      }
+	    }
+
+	  grid.type = ncvars[ncvarid].gridtype;
+
+	  if ( grid.size == 0 )
+	    {
+	      if ( (ncvars[ncvarid].ndims == 1 && ncvars[ncvarid].dimtype[0] == T_AXIS) ||
+		   (ncvars[ncvarid].ndims == 2 && ncvars[ncvarid].dimtype[0] == T_AXIS &&
+		    ncvars[ncvarid].dimtype[1] == Z_AXIS) )
+		{
+		  grid.type  = GRID_GENERIC;
+		  grid.size  = 1;
+		  grid.xsize = 0;
+		  grid.ysize = 0;
+		}
+	      else
+		{
+		  Warning("Variable %s has an unsupported grid, skipped!", ncvars[ncvarid].name);
+		  ncvars[ncvarid].isvar = -1;
+		  continue;
+		}
+	    }
+
+	  if ( ncvars[ncvarid].gmapid >= 0 && ncvars[ncvarid].gridtype != GRID_CURVILINEAR )
+	    {
+	      cdf_inq_varnatts(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, &nvatts);
+
+	      for ( iatt = 0; iatt < nvatts; iatt++ )
+		{
+		  cdf_inq_attname(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, iatt, attname);
+		  cdf_inq_attlen(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, &attlen);
+
+		  if ( strcmp(attname, "grid_mapping_name") == 0 )
+		    {
+		      cdfGetAttText(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, attstringlen-1, attstring);
+		      strtolower(attstring);
+
+		      if ( strcmp(attstring, "rotated_latitude_longitude") == 0 )
+			grid.isRotated = TRUE;
+		      else if ( strcmp(attstring, "sinusoidal") == 0 )
+			grid.type = GRID_SINUSOIDAL;
+		      else if ( strcmp(attstring, "lambert_azimuthal_equal_area") == 0 )
+			grid.type = GRID_LAEA;
+		      else if ( strcmp(attstring, "lambert_conformal_conic") == 0 )
+			grid.type = GRID_LCC2;
+		      else if ( strcmp(attstring, "lambert_cylindrical_equal_area") == 0 )
+			{
+			  proj.type = GRID_PROJECTION;
+			  proj.name = strdup(attstring);
+			}
+		    }
+		  else if ( strcmp(attname, "earth_radius") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &datt);
+		      grid.laea_a = datt;
+		      grid.lcc2_a = datt;
+		    }
+		  else if ( strcmp(attname, "longitude_of_projection_origin") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &grid.laea_lon_0);
+		    }
+		  else if ( strcmp(attname, "longitude_of_central_meridian") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &grid.lcc2_lon_0);
+		    }
+		  else if ( strcmp(attname, "latitude_of_projection_origin") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &datt);
+		      grid.laea_lat_0 = datt;
+		      grid.lcc2_lat_0 = datt;
+		    }
+		  else if ( strcmp(attname, "standard_parallel") == 0 )
+		    {
+		      if ( attlen == 1 )
+			{
+			  cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &datt);
+			  grid.lcc2_lat_1 = datt;
+			  grid.lcc2_lat_2 = datt;
+			}
+		      else
+			{
+			  double datt2[2];
+			  cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 2, datt2);
+			  grid.lcc2_lat_1 = datt2[0];
+			  grid.lcc2_lat_2 = datt2[1];
+			}
+		    }
+		  else if ( strcmp(attname, "grid_north_pole_latitude") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &grid.ypole);
+		    }
+		  else if ( strcmp(attname, "grid_north_pole_longitude") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &grid.xpole);
+		    }
+		  else if ( strcmp(attname, "north_pole_grid_longitude") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &grid.angle);
+		    }
+		}
+	    }
+
+#if defined (PROJECTION_TEST)
+	  if ( proj.type == GRID_PROJECTION )
+	    {
+	      if ( grid.type == GRID_GENERIC )
+		{
+		  grid.type = GRID_CURVILINEAR;
+		}
+
+	      if ( grid.type == GRID_CURVILINEAR )
+		{
+		  proj.size  = grid.size;
+		  proj.xsize = grid.xsize;
+                  proj.ysize = grid.ysize;
+		}
+
+	      //  grid.proj = gridGenerate(proj);
+	    }
+#endif
+
+	  if ( CDI_Debug )
+	    {
+	      Message("grid: type = %d, size = %d, nx = %d, ny %d",
+		      grid.type, grid.size, grid.xsize, grid.ysize);
+	      Message("proj: type = %d, size = %d, nx = %d, ny %d",
+		      proj.type, proj.size, proj.xsize, proj.ysize);
+	    }
+
+#if defined (PROJECTION_TEST)
+	  if ( proj.type == GRID_PROJECTION )
+	    {
+	      ncvars[ncvarid].gridID = varDefGrid(vlistID, proj, 1);
+	      copy_numeric_projatts(ncvars[ncvarid].gridID, ncvars[ncvarid].gmapid, ncvars[ncvarid].ncid);
+	    }
+	  else
+#endif
+	    ncvars[ncvarid].gridID = varDefGrid(vlistID, grid, 1);
+
+          if ( ncvars[ncvarid].chunked )
+            {
+              ndims = ncvars[ncvarid].ndims;
+
+              if ( grid.type == GRID_UNSTRUCTURED )
+                {
+                  if ( ncvars[ncvarid].chunks[ndims-1] == grid.size )
+                    ncvars[ncvarid].chunktype = CHUNK_GRID;
+                  else
+                    ncvars[ncvarid].chunktype = CHUNK_AUTO;
+                }
+              else
+                {
+                  if ( grid.xsize > 1 && grid.ysize > 1 && ndims > 1 &&
+                       grid.xsize == ncvars[ncvarid].chunks[ndims-1] &&
+                       grid.ysize == ncvars[ncvarid].chunks[ndims-2] ) 
+                    ncvars[ncvarid].chunktype = CHUNK_GRID;
+                  else if ( grid.xsize > 1 && grid.xsize == ncvars[ncvarid].chunks[ndims-1] )
+                    ncvars[ncvarid].chunktype = CHUNK_LINES;
+                  else
+                    ncvars[ncvarid].chunktype = CHUNK_AUTO;
+                }
+            }
+
+	  gridindex = vlistGridIndex(vlistID, ncvars[ncvarid].gridID);
+	  streamptr->xdimID[gridindex] = xdimid;
+	  streamptr->ydimID[gridindex] = ydimid;
+
+	  grid_free(&grid);
+	  grid_free(&proj);
+
+	  if ( CDI_Debug )
+	    Message("gridID %d %d %s", ncvars[ncvarid].gridID, ncvarid, ncvars[ncvarid].name);
+
+	  for ( ncvarid2 = ncvarid+1; ncvarid2 < nvars; ncvarid2++ )
+	    if ( ncvars[ncvarid2].isvar == TRUE && ncvars[ncvarid2].gridID == UNDEFID )
+	      {
+		int xdimid2 = -1, ydimid2 = -1;
+		ndims = ncvars[ncvarid2].ndims;
+		for ( i = 0; i < ndims; i++ )
+		  {
+		    if ( ncvars[ncvarid2].dimtype[i] == X_AXIS )
+		      xdimid2 = ncvars[ncvarid2].dimids[i];
+		    else if ( ncvars[ncvarid2].dimtype[i] == Y_AXIS )
+		      ydimid2 = ncvars[ncvarid2].dimids[i];
+		  }
+
+		if ( xdimid == xdimid2 &&
+		    (ydimid == ydimid2 || (xdimid == ydimid && ydimid2 == UNDEFID)) )
+		  {
+		    int same_grid = TRUE;
+                    /*
+		    if ( xvarid != -1 && ncvars[ncvarid2].xvarid != UNDEFID &&
+			 xvarid != ncvars[ncvarid2].xvarid ) same_grid = FALSE;
+
+		    if ( yvarid != -1 && ncvars[ncvarid2].yvarid != UNDEFID &&
+			 yvarid != ncvars[ncvarid2].yvarid ) same_grid = FALSE;
+                    */
+		    if ( ncvars[ncvarid].xvarid != ncvars[ncvarid2].xvarid ) same_grid = FALSE;
+		    if ( ncvars[ncvarid].yvarid != ncvars[ncvarid2].yvarid ) same_grid = FALSE;
+
+		    if ( same_grid )
+		      {
+			if ( CDI_Debug )
+			  Message("Same gridID %d %d %s",
+				  ncvars[ncvarid].gridID, ncvarid2, ncvars[ncvarid2].name);
+			ncvars[ncvarid2].gridID = ncvars[ncvarid].gridID;
+			ncvars[ncvarid2].chunktype = ncvars[ncvarid].chunktype;
+		      }
+		  }
+	      }
+	}
+    }
+}
+
+/* define all input zaxes */
+static
+void define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nvars, ncvar_t *ncvars,
+		      size_t vctsize, double *vct)
+{
+  int ncvarid, ncvarid2;
+  int i, ilev, ndims;
+  int zaxisindex;
+  int zprec;
+  int nbdims, nvertex, nlevel;
+  char *pname, *plongname, *punits;
+
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( ncvars[ncvarid].isvar == TRUE && ncvars[ncvarid].zaxisID == UNDEFID )
+	{
+	  int with_bounds = FALSE;
+	  int zdimid = UNDEFID;
+	  int zvarid = UNDEFID;
+	  int zsize = 1;
+	  double *zvar = NULL;
+	  double *lbounds = NULL;
+	  double *ubounds = NULL;
+	  int zaxisType;
+
+	  ndims = ncvars[ncvarid].ndims;
+	  for ( i = 0; i < ndims; i++ )
+	    {
+	      if ( ncvars[ncvarid].dimtype[i] == Z_AXIS )
+		zdimid = ncvars[ncvarid].dimids[i];
+	    }
+
+	  if ( zdimid != UNDEFID )
+	    {
+	      zvarid = ncdims[zdimid].ncvarid;
+	      zsize  = ncdims[zdimid].len;
+	    }
+
+	  if ( CDI_Debug ) Message("nlevs = %d", zsize);
+
+	  zvar = (double *) malloc(zsize*sizeof(double));
+
+	  zaxisType = UNDEFID;
+
+	  if ( zvarid != UNDEFID ) zaxisType = ncvars[zvarid].zaxistype;
+
+	  if ( zaxisType == UNDEFID )  zaxisType = ZAXIS_GENERIC;
+
+	  zprec = DATATYPE_FLT64;
+
+	  if ( zvarid != UNDEFID )
+	    {
+	      pname     = ncvars[zvarid].name;
+	      plongname = ncvars[zvarid].longname;
+	      punits    = ncvars[zvarid].units;
+	      if ( ncvars[zvarid].xtype == NC_FLOAT ) zprec = DATATYPE_FLT32;
+	      /* don't change the name !!! */
+	      /*
+	      if ( (len = strlen(pname)) > 2 )
+		if ( pname[len-2] == '_' && isdigit((int) pname[len-1]) )
+		  pname[len-2] = 0;
+	      */
+	      cdf_get_var_double(ncvars[zvarid].ncid, zvarid, zvar);
+
+	      if ( ncvars[zvarid].bounds != UNDEFID )
+		{
+		  nbdims = ncvars[ncvars[zvarid].bounds].ndims;
+		  if ( nbdims == 2 )
+		    {
+		      nlevel  = ncdims[ncvars[ncvars[zvarid].bounds].dimids[0]].len;
+		      nvertex = ncdims[ncvars[ncvars[zvarid].bounds].dimids[1]].len;
+		      if ( nlevel == zsize && nvertex == 2 )
+			{
+			  double *zbounds;
+			  with_bounds = TRUE;
+			  zbounds = (double *) malloc(2*nlevel*sizeof(double));
+			  lbounds = (double *) malloc(nlevel*sizeof(double));
+			  ubounds = (double *) malloc(nlevel*sizeof(double));
+			  cdf_get_var_double(ncvars[zvarid].ncid, ncvars[zvarid].bounds, zbounds);
+			  for ( i = 0; i < nlevel; ++i )
+			    {
+			      lbounds[i] = zbounds[i*2];
+			      ubounds[i] = zbounds[i*2+1];
+			    }
+			  free(zbounds);
+			}
+		    }
+		}
+	    }
+	  else
+	    {
+	      pname     = NULL;
+	      plongname = NULL;
+	      punits    = NULL;
+
+	      if ( zsize == 1 )
+		{
+                  if ( ncvars[ncvarid].zaxistype != UNDEFID )
+                    zaxisType = ncvars[ncvarid].zaxistype;
+                  else
+                    zaxisType = ZAXIS_SURFACE;
+
+		  zvar[0] = 0;
+		  /*
+		  if ( zdimid == UNDEFID )
+		    zvar[0] = 9999;
+		  else
+		    zvar[0] = 0;
+		  */
+		}
+	      else
+		{
+		  for ( ilev = 0; ilev < (int)zsize; ilev++ ) zvar[ilev] = ilev + 1;
+		}
+	    }
+
+      	  ncvars[ncvarid].zaxisID = varDefZaxis(vlistID, zaxisType, (int) zsize, zvar, with_bounds, lbounds, ubounds,
+						vctsize, vct, pname, plongname, punits, zprec, 1, 0);
+	  free(zvar);
+	  free(lbounds);
+	  free(ubounds);
+
+	  zaxisindex = vlistZaxisIndex(vlistID, ncvars[ncvarid].zaxisID);
+	  streamptr->zaxisID[zaxisindex]  = zdimid;
+
+	  if ( CDI_Debug )
+	    Message("zaxisID %d %d %s", ncvars[ncvarid].zaxisID, ncvarid, ncvars[ncvarid].name);
+
+	  for ( ncvarid2 = ncvarid+1; ncvarid2 < nvars; ncvarid2++ )
+	    if ( ncvars[ncvarid2].isvar == TRUE && ncvars[ncvarid2].zaxisID == UNDEFID )
+	      {
+		int zdimid2 = -1;
+		ndims = ncvars[ncvarid2].ndims;
+		for ( i = 0; i < ndims; i++ )
+		  {
+		    if ( ncvars[ncvarid2].dimtype[i] == Z_AXIS )
+		      zdimid2 = ncvars[ncvarid2].dimids[i];
+		  }
+		if ( zdimid == zdimid2 )
+		  {
+		    if ( CDI_Debug )
+		      Message("zaxisID %d %d %s",
+			      ncvars[ncvarid].zaxisID, ncvarid2, ncvars[ncvarid2].name);
+		    ncvars[ncvarid2].zaxisID = ncvars[ncvarid].zaxisID;
+		  }
+	      }
+	}
+    }
+}
+
+/* define all input data variables */
+static
+void define_all_vars(int streamID, int vlistID, int instID, int modelID, int *varids, int nvars, ncvar_t *ncvars)
+{
+  int ncid;
+  int varID1, varID, ncvarid;
+  int code;
+  int tableID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( streamptr->sortname )
+    {
+      int index;
+      varinfo_t **varInfo;
+      varInfo    = (varinfo_t **) malloc(nvars*sizeof(varinfo_t *));
+      varInfo[0] = (varinfo_t *)  malloc(nvars*sizeof(varinfo_t));
+
+      for ( index = 1; index < nvars; index++ )
+	varInfo[index] = varInfo[0] + index;
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  ncvarid = varids[varID];
+	  varInfo[varID]->ncvarid = ncvarid;
+	  strcpy(varInfo[varID]->name, ncvars[ncvarid].name);
+	}
+      qsort(varInfo[0], nvars, sizeof(varinfo_t), cmpvarname);
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  varids[varID] = varInfo[varID]->ncvarid;
+	}
+      free(varInfo[0]);
+      free(varInfo);
+    }
+
+  for ( varID1 = 0; varID1 < nvars; varID1++ )
+    {
+      int gridID, zaxisID;
+
+      ncvarid = varids[varID1];
+      gridID  = ncvars[ncvarid].gridID;
+      zaxisID = ncvars[ncvarid].zaxisID;
+
+      varID = streamNewVar(streamID, gridID, zaxisID);
+      varID = vlistDefVar(vlistID, gridID, zaxisID, ncvars[ncvarid].tsteptype);
+
+#if  defined  (HAVE_NETCDF4)
+      if ( ncvars[ncvarid].deflate )
+	vlistDefVarCompType(vlistID, varID, COMPRESS_ZIP);
+
+      if ( ncvars[ncvarid].chunked && ncvars[ncvarid].chunktype != UNDEFID )
+        vlistDefVarChunkType(vlistID, varID, ncvars[ncvarid].chunktype);
+#endif
+
+      streamptr->vars[varID1].level   = NULL;
+      streamptr->vars[varID1].defmiss = 0;
+      streamptr->vars[varID1].nlevs   = zaxisInqSize(ncvars[ncvarid].zaxisID);
+      streamptr->vars[varID1].ncvarid = ncvarid;
+
+      vlistDefVarName(vlistID, varID, ncvars[ncvarid].name);
+      if ( ncvars[ncvarid].param != UNDEFID ) vlistDefVarParam(vlistID, varID, ncvars[ncvarid].param);
+      if ( ncvars[ncvarid].code != UNDEFID )  vlistDefVarCode(vlistID, varID, ncvars[ncvarid].code);
+      if ( ncvars[ncvarid].code != UNDEFID )
+	{
+	  int param;
+	  param = cdiEncodeParam(ncvars[ncvarid].code, ncvars[ncvarid].tabnum, 255);
+	  vlistDefVarParam(vlistID, varID, param);
+	}
+      if ( ncvars[ncvarid].longname[0] )      vlistDefVarLongname(vlistID, varID, ncvars[ncvarid].longname);
+      if ( ncvars[ncvarid].stdname[0] )       vlistDefVarStdname(vlistID, varID, ncvars[ncvarid].stdname);
+      if ( ncvars[ncvarid].units[0] )         vlistDefVarUnits(vlistID, varID, ncvars[ncvarid].units);
+
+      if ( ncvars[ncvarid].lvalidrange )
+        vlistDefVarValidrange(vlistID, varID, ncvars[ncvarid].validrange);
+
+      if ( IS_NOT_EQUAL(ncvars[ncvarid].addoffset, 0) )
+	vlistDefVarAddoffset(vlistID, varID, ncvars[ncvarid].addoffset);
+      if ( IS_NOT_EQUAL(ncvars[ncvarid].scalefactor, 1) )
+	vlistDefVarScalefactor(vlistID, varID, ncvars[ncvarid].scalefactor);
+
+      vlistDefVarDatatype(vlistID, varID, cdfInqDatatype(ncvars[ncvarid].xtype, ncvars[ncvarid].lunsigned));
+
+      vlistDefVarInstitut(vlistID, varID, instID);
+      vlistDefVarModel(vlistID, varID, modelID);
+      if ( ncvars[ncvarid].tableID != UNDEFID )
+	vlistDefVarTable(vlistID, varID, ncvars[ncvarid].tableID);
+
+      if ( ncvars[ncvarid].defmiss == TRUE ) vlistDefVarMissval(vlistID, varID, ncvars[ncvarid].missval);
+
+      if ( CDI_Debug )
+	Message("varID = %d  gridID = %d  zaxisID = %d", varID,
+		vlistInqVarGrid(vlistID, varID), vlistInqVarZaxis(vlistID, varID));
+
+      int gridindex = vlistGridIndex(vlistID, gridID);
+      int xdimid = streamptr->xdimID[gridindex];
+      int ydimid = streamptr->ydimID[gridindex];
+
+      int zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+      int zdimid = streamptr->zaxisID[zaxisindex];
+
+      int ndims = ncvars[ncvarid].ndims;
+      int iodim = 0;
+      int ixyz = 0;
+      int ipow10[4] = {1, 10, 100, 1000};
+
+      if ( ncvars[ncvarid].tsteptype != TSTEP_CONSTANT ) iodim++;
+
+      if ( gridInqType(gridID) == GRID_UNSTRUCTURED && ndims-iodim <= 2 && ydimid == xdimid )
+        {
+          if ( xdimid == ncvars[ncvarid].dimids[ndims-1] )
+            {
+              ixyz = 321;
+            }
+          else
+            {
+              ixyz = 213;
+            }
+        }
+      else
+        {
+          for ( int idim = iodim; idim < ndims; idim++ )
+            {
+              if      ( xdimid == ncvars[ncvarid].dimids[idim] )
+                ixyz += 1*ipow10[ndims-idim-1];
+              else if ( ydimid == ncvars[ncvarid].dimids[idim] )
+                ixyz += 2*ipow10[ndims-idim-1];
+              else if ( zdimid == ncvars[ncvarid].dimids[idim] )
+                ixyz += 3*ipow10[ndims-idim-1];
+            }
+        }
+
+      vlistDefVarXYZ(vlistID, varID, ixyz);
+      /*
+      printf("ixyz %d\n", ixyz);
+      printf("ndims %d\n", ncvars[ncvarid].ndims);
+      for ( int i = 0; i < ncvars[ncvarid].ndims; ++i )
+        printf("dimids: %d %d\n", i, ncvars[ncvarid].dimids[i]);
+      printf("xdimid, ydimid %d %d\n", xdimid, ydimid);
+      */
+      if ( ncvars[ncvarid].ensdata != NULL )
+        {
+          vlistDefVarEnsemble( vlistID, varID, ncvars[ncvarid].ensdata->ens_index,
+                               ncvars[ncvarid].ensdata->ens_count,
+                               ncvars[ncvarid].ensdata->forecast_init_type );
+          free(ncvars[ncvarid].ensdata);
+          ncvars[ncvarid].ensdata = NULL;
+        }
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      ncvarid = varids[varID];
+      ncid = ncvars[ncvarid].ncid;
+
+      if ( ncvars[ncvarid].natts )
+	{
+	  int nvatts;
+	  int attnum;
+	  int iatt;
+	  nc_type attrtype;
+	  size_t attlen;
+	  char attname[CDI_MAX_NAME];
+	  const int attstringlen = 8192; char attstring[8192];
+
+	  nvatts = ncvars[ncvarid].natts;
+	  for ( iatt = 0; iatt < nvatts; iatt++ )
+	    {
+	      attnum = ncvars[ncvarid].atts[iatt];
+	      cdf_inq_attname(ncid, ncvarid, attnum, attname);
+	      cdf_inq_attlen(ncid, ncvarid, attname, &attlen);
+	      cdf_inq_atttype(ncid, ncvarid, attname, &attrtype);
+	      if ( attrtype == NC_SHORT || attrtype == NC_INT )
+		{
+		  int *attint;
+		  attint = (int *) malloc(attlen*sizeof(int));
+		  cdfGetAttInt(ncid, ncvarid, attname, attlen, attint);
+		  if ( attrtype == NC_SHORT )
+		    vlistDefAttInt(vlistID, varID, attname, DATATYPE_INT16, (int)attlen, attint);
+		  else
+		    vlistDefAttInt(vlistID, varID, attname, DATATYPE_INT32, (int)attlen, attint);
+		  if ( CDI_Debug )
+		    printf("int: %s.%s = %d\n", ncvars[ncvarid].name, attname, attint[0]);
+		  free(attint);
+		}
+	      else if ( attrtype == NC_FLOAT || attrtype == NC_DOUBLE )
+		{
+		  double *attflt;
+		  attflt = (double *) malloc(attlen*sizeof(double));
+		  cdfGetAttDouble(ncid, ncvarid, attname, attlen, attflt);
+		  if ( attrtype == NC_FLOAT )
+		    vlistDefAttFlt(vlistID, varID, attname, DATATYPE_FLT32, (int)attlen, attflt);
+		  else
+		    vlistDefAttFlt(vlistID, varID, attname, DATATYPE_FLT64, (int)attlen, attflt);
+		  if ( CDI_Debug )
+		    printf("flt: %s.%s = %g\n", ncvars[ncvarid].name, attname, attflt[0]);
+		  free(attflt);
+		}
+	      else if ( attrtype == NC_CHAR )
+		{
+		  cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+		  vlistDefAttTxt(vlistID, varID, attname, (int)attlen, attstring);
+		  if ( CDI_Debug )
+		    printf("txt: %s.%s = %s\n", ncvars[ncvarid].name, attname, attstring);
+		}
+	      else
+		{
+		  if ( CDI_Debug )
+		    printf("att: %s.%s = unknown\n", ncvars[ncvarid].name, attname);
+		}
+	    }
+
+	  free(ncvars[ncvarid].atts);
+	}
+    }
+
+  if ( varids ) free(varids);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( vlistInqVarCode(vlistID, varID) == -varID-1 )
+	{
+	  const char *pname = vlistInqVarNamePtr(vlistID, varID);
+	  size_t len = strlen(pname);
+	  if ( len > 3 && isdigit((int) pname[3]) )
+	    {
+	      if ( memcmp("var", pname, 3) == 0 )
+		{
+		  vlistDefVarCode(vlistID, varID, atoi(pname+3));
+		  vlistDestroyVarName(vlistID, varID);
+		}
+	    }
+	  else if ( len > 4 && isdigit((int) pname[4]) )
+	    {
+	      if ( memcmp("code", pname, 4) == 0 )
+		{
+		  vlistDefVarCode(vlistID, varID, atoi(pname+4));
+		  vlistDestroyVarName(vlistID, varID);
+		}
+	    }
+	  else if ( len > 5 && isdigit((int) pname[5]) )
+	    {
+	      if ( memcmp("param", pname, 5) == 0 )
+		{
+		  int pnum = -1, pcat = 255, pdis = 255;
+		  sscanf(pname+5, "%d.%d.%d", &pnum, &pcat, &pdis);
+		  vlistDefVarParam(vlistID, varID, cdiEncodeParam(pnum, pcat, pdis));
+		  vlistDestroyVarName(vlistID, varID);
+		}
+	    }
+	}
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      instID  = vlistInqVarInstitut(vlistID, varID);
+      modelID = vlistInqVarModel(vlistID, varID);
+      tableID = vlistInqVarTable(vlistID, varID);
+      code    = vlistInqVarCode(vlistID, varID);
+      if ( cdiDefaultTableID != UNDEFID )
+	{
+	  if ( tableInqParNamePtr(cdiDefaultTableID, code) )
+	    {
+	      vlistDestroyVarName(vlistID, varID);
+	      vlistDestroyVarLongname(vlistID, varID);
+	      vlistDestroyVarUnits(vlistID, varID);
+
+	      if ( tableID != UNDEFID )
+		{
+		  vlistDefVarName(vlistID, varID, tableInqParNamePtr(cdiDefaultTableID, code));
+		  if ( tableInqParLongnamePtr(cdiDefaultTableID, code) )
+		    vlistDefVarLongname(vlistID, varID, tableInqParLongnamePtr(cdiDefaultTableID, code));
+		  if ( tableInqParUnitsPtr(cdiDefaultTableID, code) )
+		    vlistDefVarUnits(vlistID, varID, tableInqParUnitsPtr(cdiDefaultTableID, code));
+		}
+	      else
+		{
+		  tableID = cdiDefaultTableID;
+		}
+	    }
+	  if ( cdiDefaultModelID != UNDEFID )
+	    modelID = cdiDefaultModelID;
+	  if ( cdiDefaultInstID != UNDEFID )
+	    instID = cdiDefaultInstID;
+	}
+      if ( instID  != UNDEFID ) vlistDefVarInstitut(vlistID, varID, instID);
+      if ( modelID != UNDEFID ) vlistDefVarModel(vlistID, varID, modelID);
+      if ( tableID != UNDEFID ) vlistDefVarTable(vlistID, varID, tableID);
+    }
+}
+
+static
+void read_global_attributtes(int fileID, int vlistID, stream_t *streamptr, int ngatts,
+                               int *instID, int *modelID, int *ucla_les)
+{
+  nc_type xtype;
+  size_t attlen;
+  char attname[CDI_MAX_NAME];
+  const int attstringlen = 8192; char attstring[8192];
+  int iatt;
+
+  for ( iatt = 0; iatt < ngatts; iatt++ )
+    {
+      cdf_inq_attname(fileID, NC_GLOBAL, iatt, attname);
+      cdf_inq_atttype(fileID, NC_GLOBAL, attname, &xtype);
+      cdf_inq_attlen(fileID, NC_GLOBAL, attname, &attlen);
+
+      if ( xtype == NC_CHAR )
+	{
+	  cdfGetAttText(fileID, NC_GLOBAL, attname, attstringlen-1, attstring);
+
+	  if ( attlen > 0 && attstring[0] != 0 )
+	    {
+	      if ( strcmp(attname, "history") == 0 )
+		{
+		  streamptr->historyID = iatt;
+		}
+	      else if ( strcmp(attname, "institution") == 0 )
+		{
+		  *instID = institutInq(0, 0, NULL, attstring);
+		  if ( *instID == UNDEFID )
+		    *instID = institutDef(0, 0, NULL, attstring);
+		}
+	      else if ( strcmp(attname, "source") == 0 )
+		{
+		  *modelID = modelInq(-1, 0, attstring);
+		}
+	      else if ( strcmp(attname, "Source") == 0 )
+		{
+		  if ( strncmp(attstring, "UCLA-LES", 8) == 0 )
+		    *ucla_les = TRUE;
+		}
+	      /*
+	      else if ( strcmp(attname, "Conventions") == 0 )
+		{
+		}
+	      */
+	      else if ( strcmp(attname, "CDI") == 0 )
+		{
+		}
+	      else if ( strcmp(attname, "CDO") == 0 )
+		{
+		}
+	      else
+		{
+		  vlistDefAttTxt(vlistID, CDI_GLOBAL, attname, (int)attlen, attstring);
+		}
+	    }
+	}
+      else if ( xtype == NC_SHORT || xtype == NC_INT )
+	{
+	  int *attint;
+	  attint = (int *) malloc(attlen*sizeof(int));
+	  cdfGetAttInt(fileID, NC_GLOBAL, attname, attlen, attint);
+	  if ( xtype == NC_SHORT )
+	    vlistDefAttInt(vlistID, CDI_GLOBAL, attname, DATATYPE_INT16, (int)attlen, attint);
+	  else
+	    vlistDefAttInt(vlistID, CDI_GLOBAL, attname, DATATYPE_INT32, (int)attlen, attint);
+	  free(attint);
+	}
+      else if ( xtype == NC_FLOAT || xtype == NC_DOUBLE )
+	{
+	  double *attflt;
+	  attflt = (double *) malloc(attlen*sizeof(double));
+	  cdfGetAttDouble(fileID, NC_GLOBAL, attname, attlen, attflt);
+	  if ( xtype == NC_FLOAT )
+	    vlistDefAttFlt(vlistID, CDI_GLOBAL, attname, DATATYPE_FLT32, (int)attlen, attflt);
+	  else
+	    vlistDefAttFlt(vlistID, CDI_GLOBAL, attname, DATATYPE_FLT64, (int)attlen, attflt);
+	  free(attflt);
+	}
+    }
+}
+#endif
+
+int cdfInqContents(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int ndims, nvars, ngatts, unlimdimid;
+  int ncvarid;
+  int ncdimid;
+  int fileID;
+  size_t ntsteps;
+  int timedimid = -1;
+  int *varids;
+  int nvarids;
+  const int attstringlen = 8192; char attstring[8192];
+  int timehasunits = FALSE;
+  int time_has_bounds = FALSE;
+  size_t len;
+  int nvars_data;
+  int nvcth_id = UNDEFID, vcta_id = UNDEFID, vctb_id = UNDEFID;
+  size_t vctsize = 0;
+  double *vct = NULL;
+  int instID  = UNDEFID;
+  int modelID = UNDEFID;
+  int taxisID;
+  int i;
+  int nbdims;
+  int calendar = UNDEFID;
+  ncdim_t *ncdims;
+  ncvar_t *ncvars = NULL;
+  int vlistID;
+  stream_t *streamptr;
+  int format = 0;
+  int ucla_les = FALSE;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d, fileID = %d", streamID, fileID);
+
+#if  defined  (HAVE_NETCDF4)
+  nc_inq_format(fileID, &format);
+#endif
+
+  cdf_inq(fileID, &ndims , &nvars, &ngatts, &unlimdimid);
+
+  if ( CDI_Debug )
+    Message("root: ndims %d, nvars %d, ngatts %d", ndims, nvars, ngatts);
+
+  if ( ndims == 0 )
+    {
+      Warning("ndims = %d", ndims);
+      return (CDI_EUFSTRUCT);
+    }
+
+  /* alloc ncdims */
+  ncdims = (ncdim_t *) malloc(ndims*sizeof(ncdim_t));
+  init_ncdims(ndims, ncdims);
+
+  if ( nvars > 0 )
+    {
+      /* alloc ncvars */
+      ncvars = (ncvar_t *) malloc(nvars*sizeof(ncvar_t));
+      init_ncvars(nvars, ncvars);
+
+      for ( ncvarid = 0; ncvarid < nvars; ++ncvarid )
+        ncvars[ncvarid].ncid = fileID;
+    }
+
+#if  defined  (TEST_GROUPS)
+#if  defined  (HAVE_NETCDF4)
+  if ( format == NC_FORMAT_NETCDF4 )
+    {
+      int ncid;
+      int numgrps;
+      int ncids[NC_MAX_VARS];
+      char name1[CDI_MAX_NAME];
+      int gndims, gnvars, gngatts, gunlimdimid;
+      nc_inq_grps(fileID, &numgrps, ncids);
+      for ( int i = 0; i < numgrps; ++i )
+        {
+          ncid = ncids[i];
+          nc_inq_grpname (ncid, name1);
+          cdf_inq(ncid, &gndims , &gnvars, &gngatts, &gunlimdimid);
+
+          if ( CDI_Debug )
+            Message("%s: ndims %d, nvars %d, ngatts %d", name1, gndims, gnvars, gngatts);
+
+          if ( gndims == 0 )
+            {
+            }
+        }
+    }
+#endif
+#endif
+
+  if ( nvars == 0 )
+    {
+      Warning("nvars = %d", nvars);
+      return (CDI_EUFSTRUCT);
+    }
+
+  /* read global attributtes */
+  read_global_attributtes(fileID, vlistID, streamptr, ngatts, &instID, &modelID, &ucla_les);
+
+  /* find time dim */
+  if ( unlimdimid >= 0 )
+    timedimid = unlimdimid;
+  else
+    timedimid = cdfTimeDimID(fileID, ndims, nvars);
+
+  streamptr->basetime.ncdimid = timedimid;
+
+  if ( timedimid != UNDEFID )
+    cdf_inq_dimlen(fileID, timedimid, &ntsteps);
+  else
+    ntsteps = 0;
+
+  if ( CDI_Debug ) Message("Number of timesteps = %d", ntsteps);
+  if ( CDI_Debug ) Message("Time dimid = %d", streamptr->basetime.ncdimid);
+
+  /* read ncdims */
+  for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+    {
+      cdf_inq_dimlen(fileID, ncdimid, &ncdims[ncdimid].len);
+      cdf_inq_dimname(fileID, ncdimid, ncdims[ncdimid].name);
+      if ( timedimid == ncdimid )
+	ncdims[ncdimid].dimtype = T_AXIS;
+    }
+
+  if ( CDI_Debug ) printNCvars(ncvars, nvars, "cdfScanVarAttributes");
+
+  /* scan attributes of all variables */
+  cdfScanVarAttributes(nvars, ncvars, ncdims, timedimid, modelID, format);
+
+
+  if ( CDI_Debug ) printNCvars(ncvars, nvars, "find coordinate vars");
+
+  /* find coordinate vars */
+  for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+    {
+      for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+	{
+	  if ( ncvars[ncvarid].ndims == 1 )
+	    {
+	      if ( timedimid != UNDEFID && timedimid == ncvars[ncvarid].dimids[0] )
+		{
+		  if ( ncvars[ncvarid].isvar != FALSE ) cdfSetVar(ncvars, ncvarid, TRUE);
+		}
+	      else
+		{
+                  //  if ( ncvars[ncvarid].isvar != TRUE ) cdfSetVar(ncvars, ncvarid, FALSE);
+		}
+	      // if ( ncvars[ncvarid].isvar != TRUE ) cdfSetVar(ncvars, ncvarid, FALSE);
+
+	      if ( ncdimid == ncvars[ncvarid].dimids[0] && ncdims[ncdimid].ncvarid == UNDEFID )
+		if ( strcmp(ncvars[ncvarid].name, ncdims[ncdimid].name) == 0 )
+		  {
+		    ncdims[ncdimid].ncvarid = ncvarid;
+		    ncvars[ncvarid].isvar = FALSE;
+		  }
+	    }
+	}
+    }
+
+  /* find time vars */
+  if ( timedimid != UNDEFID )
+    {
+      int ltimevar = FALSE;
+
+      if ( ncdims[timedimid].ncvarid != UNDEFID )
+	{
+	  streamptr->basetime.ncvarid = ncdims[timedimid].ncvarid;
+	  ltimevar = TRUE;
+	}
+
+      for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+	if ( ncvarid != streamptr->basetime.ncvarid &&
+	     ncvars[ncvarid].ndims == 1 &&
+	     timedimid == ncvars[ncvarid].dimids[0] &&
+	     ncvars[ncvarid].xtype != NC_CHAR &&
+	     isTimeUnits(ncvars[ncvarid].units) )
+	  {
+	    ncvars[ncvarid].isvar = FALSE;
+
+	    if ( !ltimevar )
+	      {
+		streamptr->basetime.ncvarid = ncvarid;
+		ltimevar = TRUE;
+		if ( CDI_Debug ) 
+		  fprintf(stderr, "timevar %s\n", ncvars[ncvarid].name);
+	      }
+	    else
+	      {
+		if ( CDI_Debug )
+		  fprintf(stderr, "skip timevar %s\n", ncvars[ncvarid].name);
+	      }
+	  }
+
+      if ( ltimevar == FALSE ) /* search for WRF time description */
+	{
+	  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+	    if ( ncvarid != streamptr->basetime.ncvarid &&
+		 ncvars[ncvarid].ndims == 2 &&
+		 timedimid == ncvars[ncvarid].dimids[0] &&
+		 ncvars[ncvarid].xtype == NC_CHAR &&
+		 ncdims[ncvars[ncvarid].dimids[1]].len == 19 )
+	      {
+		streamptr->basetime.ncvarid = ncvarid;
+		streamptr->basetime.lwrf    = TRUE;
+		break;
+	      }
+	}
+
+      /* time varID */
+      ncvarid = streamptr->basetime.ncvarid;
+
+      if ( ncvarid == UNDEFID )
+	Warning("Variable >time< not found!");
+      else if ( streamptr->basetime.lwrf == FALSE )
+	{
+	  if ( ncvars[ncvarid].units[0] != 0 )
+	    timehasunits = TRUE;
+
+	  if ( ncvars[ncvarid].bounds != UNDEFID )
+	    {
+	      nbdims = ncvars[ncvars[ncvarid].bounds].ndims;
+	      if ( nbdims == 2 )
+		{
+		  len = ncdims[ncvars[ncvars[ncvarid].bounds].dimids[nbdims-1]].len;
+		  if ( (int)len == 2 && timedimid == ncvars[ncvars[ncvarid].bounds].dimids[0] )
+		    {
+		      time_has_bounds = TRUE;
+		      streamptr->basetime.ncvarboundsid = ncvars[ncvarid].bounds;
+		    }
+		}
+	    }
+	}
+    }
+
+  /* check ncvars */
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( timedimid != UNDEFID )
+	if ( ncvars[ncvarid].isvar == -1 &&
+	     ncvars[ncvarid].ndims > 1   &&
+	     timedimid == ncvars[ncvarid].dimids[0] )
+	  cdfSetVar(ncvars, ncvarid, TRUE);
+
+      if ( ncvars[ncvarid].isvar == -1 && ncvars[ncvarid].ndims == 0 )
+	cdfSetVar(ncvars, ncvarid, FALSE);
+
+      //if ( ncvars[ncvarid].isvar == -1 && ncvars[ncvarid].ndims > 1 )
+      if ( ncvars[ncvarid].isvar == -1 && ncvars[ncvarid].ndims >= 1 )
+	cdfSetVar(ncvars, ncvarid, TRUE);
+
+      if ( ncvars[ncvarid].isvar == -1 )
+	{
+	  ncvars[ncvarid].isvar = 0;
+	  Warning("Variable %s has an unknown type, skipped!", ncvars[ncvarid].name);
+	  continue;
+	}
+
+      if ( ncvars[ncvarid].ndims > 4 )
+	{
+	  ncvars[ncvarid].isvar = 0;
+	  Warning("%d dimensional variables unsupported, skipped variable %s!",
+		ncvars[ncvarid].ndims, ncvars[ncvarid].name);
+	  continue;
+	}
+
+      if ( ncvars[ncvarid].xtype == NC_CHAR )
+	{
+	  ncvars[ncvarid].isvar = 0;
+	  continue;
+	}
+
+      if ( cdfInqDatatype(ncvars[ncvarid].xtype, ncvars[ncvarid].lunsigned) == -1 )
+	{
+	  ncvars[ncvarid].isvar = 0;
+	  Warning("Variable %s has an unsupported data type, skipped!", ncvars[ncvarid].name);
+	  continue;
+	}
+
+      if ( timedimid != UNDEFID && ntsteps == 0 && ncvars[ncvarid].ndims > 0 )
+	{
+	  if ( timedimid == ncvars[ncvarid].dimids[0] )
+	    {
+	      ncvars[ncvarid].isvar = 0;
+	      Warning("Number of time steps undefined, skipped variable %s!", ncvars[ncvarid].name);
+	      continue;
+	    }
+	}
+    }
+
+
+  /* verify coordinate vars - first scan (dimname == varname) */
+  verify_coordinate_vars_1(ndims, ncdims, ncvars, timedimid);
+
+  /* verify coordinate vars - second scan (all other variables) */
+  verify_coordinate_vars_2(nvars, ncvars);
+
+  if ( CDI_Debug ) printNCvars(ncvars, nvars, "verify_coordinate_vars");
+
+  if ( ucla_les == TRUE )
+    {
+      for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+	{
+	  ncvarid = ncdims[ncdimid].ncvarid;
+	  if ( ncvarid != -1 )
+	    {
+	      if ( ncdims[ncdimid].dimtype == UNDEFID && ncvars[ncvarid].units[0] == 'm' )
+		{
+		  if      ( ncvars[ncvarid].name[0] == 'x' ) ncdims[ncdimid].dimtype = X_AXIS;
+		  else if ( ncvars[ncvarid].name[0] == 'y' ) ncdims[ncdimid].dimtype = Y_AXIS;
+		  else if ( ncvars[ncvarid].name[0] == 'z' ) ncdims[ncdimid].dimtype = Z_AXIS;
+		}
+	    }
+	}
+    }
+  /*
+  for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+    {
+      ncvarid = ncdims[ncdimid].ncvarid;
+      if ( ncvarid != -1 )
+	{
+	  printf("coord var %d %s %s\n", ncvarid, ncvars[ncvarid].name, ncvars[ncvarid].units);
+	  if ( ncdims[ncdimid].dimtype == X_AXIS )
+	    printf("coord var %d %s is x dim\n", ncvarid, ncvars[ncvarid].name);
+	  if ( ncdims[ncdimid].dimtype == Y_AXIS )
+	    printf("coord var %d %s is y dim\n", ncvarid, ncvars[ncvarid].name);
+	  if ( ncdims[ncdimid].dimtype == Z_AXIS )
+	    printf("coord var %d %s is z dim\n", ncvarid, ncvars[ncvarid].name);
+	  if ( ncdims[ncdimid].dimtype == T_AXIS )
+	    printf("coord var %d %s is t dim\n", ncvarid, ncvars[ncvarid].name);
+
+	  if ( ncvars[ncvarid].islon )
+	    printf("coord var %d %s is lon\n", ncvarid, ncvars[ncvarid].name);
+	  if ( ncvars[ncvarid].islat )
+	    printf("coord var %d %s is lat\n", ncvarid, ncvars[ncvarid].name);
+	  if ( ncvars[ncvarid].islev )
+	    printf("coord var %d %s is lev\n", ncvarid, ncvars[ncvarid].name);
+	}
+    }
+  */
+  /* set dim type */
+  setDimType(nvars, ncvars, ncdims);
+
+  /* Set coordinate varids (att: associate)  */
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( ncvars[ncvarid].isvar == TRUE && ncvars[ncvarid].ncoordvars )
+	{
+	  /* ndims = ncvars[ncvarid].ndims; */
+	  ndims = ncvars[ncvarid].ncoordvars;
+	  for ( i = 0; i < ndims; i++ )
+	    {
+	      if ( ncvars[ncvars[ncvarid].coordvarids[i]].islon )
+		ncvars[ncvarid].xvarid = ncvars[ncvarid].coordvarids[i];
+	      else if ( ncvars[ncvars[ncvarid].coordvarids[i]].islat )
+		ncvars[ncvarid].yvarid = ncvars[ncvarid].coordvarids[i];
+	      else if ( ncvars[ncvars[ncvarid].coordvarids[i]].islev )
+		ncvars[ncvarid].zvarid = ncvars[ncvarid].coordvarids[i];
+	    }
+	}
+    }
+
+  /* find VCT */
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( ncvars[ncvarid].ndims == 1 )
+	{
+	  if ( memcmp(ncvars[ncvarid].name, "hyai", 4) == 0 )
+	    {
+	      vcta_id = ncvarid;
+	      nvcth_id = ncvars[ncvarid].dimids[0];
+              ncvars[ncvarid].isvar = FALSE;
+	      continue;
+	    }
+	  if ( memcmp(ncvars[ncvarid].name, "hybi", 4) == 0 )
+	    {
+	      vctb_id = ncvarid;
+	      nvcth_id = ncvars[ncvarid].dimids[0];
+              ncvars[ncvarid].isvar = FALSE;
+	      continue;
+	    }
+
+	  if      ( memcmp(ncvars[ncvarid].name, "hyam", 4) == 0 ) ncvars[ncvarid].isvar = FALSE;
+	  else if ( memcmp(ncvars[ncvarid].name, "hybm", 4) == 0 ) ncvars[ncvarid].isvar = FALSE;
+	}
+    }
+
+  if ( CDI_Debug ) printNCvars(ncvars, nvars, "define_all_grids");
+
+
+  /* define all grids */
+  define_all_grids(streamptr, vlistID, ncdims, nvars, ncvars, timedimid);
+
+
+  /* read VCT */
+  if ( nvcth_id != UNDEFID && vcta_id != UNDEFID && vctb_id != UNDEFID )
+    {
+      vctsize = ncdims[nvcth_id].len;
+      vctsize *= 2;
+      vct = (double *) malloc(vctsize*sizeof(double));
+      cdf_get_var_double(fileID, vcta_id, vct);
+      cdf_get_var_double(fileID, vctb_id, vct+vctsize/2);
+    }
+
+
+  /* define all zaxes */
+  define_all_zaxes(streamptr, vlistID, ncdims, nvars, ncvars, vctsize, vct);
+
+
+  if ( vct ) free(vct);
+
+  /* select vars */
+  varids = (int *) malloc(nvars*sizeof(int));
+  nvarids = 0;
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    if ( ncvars[ncvarid].isvar == TRUE ) varids[nvarids++] = ncvarid;
+
+  nvars_data = nvarids;
+
+  if ( CDI_Debug ) Message("time varid = %d", streamptr->basetime.ncvarid);
+  if ( CDI_Debug ) Message("ntsteps = %d", ntsteps);
+  if ( CDI_Debug ) Message("nvars_data = %d", nvars_data);
+
+
+  if ( nvars_data == 0 )
+    {
+      streamptr->ntsteps = 0;
+      return (CDI_EUFSTRUCT);
+    }
+
+  streamptr->ntsteps = ntsteps;
+
+  /* define all data variables */
+  define_all_vars(streamID, vlistID, instID, modelID, varids, nvars_data, ncvars);
+
+
+  cdiCreateTimesteps(streamID);
+
+  /* time varID */
+  ncvarid = streamptr->basetime.ncvarid;
+
+  if ( timehasunits )
+    {
+      taxis_t *taxis;
+      taxis = &streamptr->tsteps[0].taxis;
+
+      cdfGetAttText(fileID, ncvarid, "units", attstringlen-1, attstring);
+      if ( splitBasetime(attstring, taxis) == 1 )
+	streamptr->basetime.ncvarid = UNDEFID;
+    }
+
+  if ( time_has_bounds )
+    streamptr->tsteps[0].taxis.has_bounds = TRUE;
+
+  if ( ncvarid != -1 )
+    {
+      taxis_t *taxis;
+      taxis = &streamptr->tsteps[0].taxis;
+
+      taxis->name = strdup(ncvars[ncvarid].name);
+      if ( ncvars[ncvarid].longname[0] )
+        taxis->longname = strdup(ncvars[ncvarid].longname);
+    }
+
+  if ( ncvarid != -1 )
+    if ( ncvars[ncvarid].calendar == TRUE )
+      {
+	cdfGetAttText(fileID, ncvarid, "calendar", attstringlen-1, attstring);
+	strtolower(attstring);
+
+	if ( memcmp(attstring, "standard", 8)  == 0 ||
+	     memcmp(attstring, "gregorian", 9) == 0 )
+	  calendar = CALENDAR_STANDARD;
+	else if ( memcmp(attstring, "none", 4) == 0 )
+	  calendar = CALENDAR_NONE;
+	else if ( memcmp(attstring, "proleptic", 9) == 0 )
+	  calendar = CALENDAR_PROLEPTIC;
+	else if ( memcmp(attstring, "360", 3) == 0 )
+	  calendar = CALENDAR_360DAYS;
+	else if ( memcmp(attstring, "365", 3) == 0 ||
+		  memcmp(attstring, "noleap", 6)  == 0 )
+	  calendar = CALENDAR_365DAYS;
+	else if ( memcmp(attstring, "366", 3)  == 0 ||
+		  memcmp(attstring, "all_leap", 8) == 0 )
+	  calendar = CALENDAR_366DAYS;
+	else
+	  Warning("calendar >%s< unsupported!", attstring);
+      }
+
+  if ( streamptr->tsteps[0].taxis.type == TAXIS_RELATIVE )
+    taxisID = taxisCreate(TAXIS_RELATIVE);
+  else
+    {
+      taxisID = taxisCreate(TAXIS_ABSOLUTE);
+      if ( !timehasunits )
+	{
+	  taxisDefTunit(taxisID, TUNIT_DAY);
+	  streamptr->tsteps[0].taxis.unit = TUNIT_DAY;
+	}
+    }
+
+  if ( calendar != UNDEFID )
+    {
+      taxis_t *taxis;
+      taxis = &streamptr->tsteps[0].taxis;
+
+      taxis->calendar = calendar;
+      taxisDefCalendar(taxisID, calendar);
+    }
+  else if ( streamptr->tsteps[0].taxis.type == TAXIS_RELATIVE )
+    {
+      taxis_t *taxis;
+
+      calendar = CALENDAR_STANDARD;
+
+      taxis = &streamptr->tsteps[0].taxis;
+
+      taxis->calendar = calendar;
+      taxisDefCalendar(taxisID, calendar);
+    }
+
+  vlistDefTaxis(vlistID, taxisID);
+
+  streamptr->curTsID = 0;
+  streamptr->rtsteps = 1;
+
+  (void) cdfInqTimestep(streamID, 0);
+
+  cdfCreateRecords(streamID, 0);
+
+  /* free ncdims */
+  free (ncdims);
+
+  /* free ncvars */
+  free (ncvars);
+
+#endif
+
+  return (0);
+}
+
+
+int cdfInqTimestep(int streamID, int tsID)
+{
+  long nrecs = 0;
+#if  defined  (HAVE_LIBNETCDF)
+  double timevalue;
+  int nctimevarid;
+  int nctimeboundsid;
+  int fileID;
+  size_t index;
+  taxis_t *taxis;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  tsID = %d", streamID, tsID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( tsID < 0 ) Error("unexpected tsID = %d", tsID);
+
+  if ( tsID < streamptr->ntsteps && streamptr->ntsteps > 0 )
+    {
+      cdfCreateRecords(streamID, tsID);
+
+      taxis = &streamptr->tsteps[tsID].taxis;
+      if ( tsID > 0 )
+	ptaxisCopy(taxis, &streamptr->tsteps[0].taxis);
+
+      timevalue = tsID;
+
+      nctimevarid = streamptr->basetime.ncvarid;
+      if ( nctimevarid != UNDEFID )
+	{
+	  fileID = streamInqFileID(streamID);
+	  index  = tsID;
+
+	  if ( streamptr->basetime.lwrf )
+	    {
+	      size_t start[2], count[2];
+	      char stvalue[32];
+	      start[0] = index; start[1] = 0;
+	      count[0] = 1; count[1] = 19;
+	      stvalue[0] = 0;
+	      cdf_get_vara_text(fileID, nctimevarid, start, count, stvalue);
+	      stvalue[19] = 0;
+	      {
+		int year = 1, month = 1, day = 1 , hour = 0, minute = 0, second = 0;
+		if ( strlen(stvalue) == 19 )
+		  sscanf(stvalue, "%d-%d-%d_%d:%d:%d", &year, &month, &day, &hour, &minute, &second);
+		taxis->vdate = cdiEncodeDate(year, month, day);
+		taxis->vtime = cdiEncodeTime(hour, minute, second);
+		taxis->type = TAXIS_ABSOLUTE;
+	      }
+	    }
+	  else
+	    {
+	      cdf_get_var1_double(fileID, nctimevarid, &index, &timevalue);
+              if ( timevalue >= NC_FILL_DOUBLE ) timevalue = 0;
+
+	      cdiDecodeTimeval(timevalue, taxis, &taxis->vdate, &taxis->vtime);
+	    }
+
+	  nctimeboundsid = streamptr->basetime.ncvarboundsid;
+	  if ( nctimeboundsid != UNDEFID )
+	    {
+	      size_t start[2], count[2];
+	      start[0] = tsID; count[0] = 1; start[1] = 0; count[1] = 1;
+	      cdf_get_vara_double(fileID, nctimeboundsid, start, count, &timevalue);
+              if ( timevalue >= NC_FILL_DOUBLE ) timevalue = 0;
+
+	      cdiDecodeTimeval(timevalue, taxis, &taxis->vdate_lb, &taxis->vtime_lb);
+
+	      start[0] = tsID; count[0] = 1; start[1] = 1; count[1] = 1;
+	      cdf_get_vara_double(fileID, nctimeboundsid, start, count, &timevalue);
+              if ( timevalue >= NC_FILL_DOUBLE ) timevalue = 0;
+
+	      cdiDecodeTimeval(timevalue, taxis, &taxis->vdate_ub, &taxis->vtime_ub);
+	    }
+	}
+    }
+
+  streamptr->curTsID = tsID;
+  nrecs = streamptr->tsteps[tsID].nrecs;
+
+#endif
+  return ((int) nrecs);
+}
+
+
+void cdfEndDef(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int varID;
+  int nvars;
+  int fileID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  fileID  = streamInqFileID(streamID);
+
+  cdfDefGlobalAtts(streamID);
+  cdfDefLocalAtts(streamID);
+  if ( streamptr->accessmode == 0 )
+    {
+      nvars =  streamptr->nvars;
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	cdfDefVar(streamID, varID);
+
+      if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
+
+      streamptr->accessmode = 1;
+    }
+#endif
+}
+
+
+void cdfDefInstitut(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID, instID;
+  char *longname;
+  size_t len;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  instID  = vlistInqInstitut(vlistID);
+
+  if ( instID != UNDEFID )
+    {
+      longname = institutInqLongnamePtr(instID);
+      if ( longname )
+	{
+	  len = strlen(longname);
+	  if ( len > 0 )
+	    {
+	      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+	      cdf_put_att_text(fileID, NC_GLOBAL, "institution", len, longname);
+	      if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
+	    }
+	}
+    }
+#endif
+}
+
+void cdfDefSource(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID, modelID;
+  char *longname;
+  size_t len;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  modelID = vlistInqModel(vlistID);
+
+  if ( modelID != UNDEFID )
+    {
+      longname = modelInqNamePtr(modelID);
+      if ( longname )
+	{
+	  len = strlen(longname);
+	  if ( len > 0 )
+	    {
+	      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+	      cdf_put_att_text(fileID, NC_GLOBAL, "source", len, longname);
+	      if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
+	    }
+	}
+    }
+#endif
+}
+
+
+void cdfDefGlobalAtts(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID, vlistID;
+  stream_t *streamptr;
+  int natts;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->globalatts ) return;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  cdfDefSource(streamID);
+  cdfDefInstitut(streamID);
+
+  vlistInqNatts(vlistID, CDI_GLOBAL, &natts);
+
+  if ( natts > 0 && streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+  defineAttributes(vlistID, CDI_GLOBAL, fileID, NC_GLOBAL);
+
+  if ( natts > 0 && streamptr->ncmode == 2 ) cdf_enddef(fileID);
+
+  streamptr->globalatts = 1;
+#endif
+}
+
+
+void cdfDefLocalAtts(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int varID, instID, fileID;
+  char *name;
+  size_t len;
+  int ncvarid;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  if ( streamptr->localatts ) return;
+  if ( vlistInqInstitut(vlistID) != UNDEFID ) return;
+
+  streamptr->localatts = 1;
+
+  if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+  for ( varID = 0; varID < streamptr->nvars; varID++ )
+    {
+      instID = vlistInqVarInstitut(vlistID, varID);
+      if ( instID != UNDEFID )
+	{
+          ncvarid = streamptr->vars[varID].ncvarid;
+  	  name = institutInqNamePtr(instID);
+	  if ( name )
+	    {
+	      len = strlen(name);
+	      cdf_put_att_text(fileID, ncvarid, "institution", len, name);
+	    }
+	}
+      }
+
+  if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
+#endif
+}
+
+void cdfDefHistory(int streamID, int size, char *history)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int ncid;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  ncid = streamptr->fileID;
+  cdf_put_att_text(ncid, NC_GLOBAL, "history", (size_t) size, history);
+#endif
+}
+
+int cdfInqHistorySize(int streamID)
+{
+  size_t size = 0;
+#if  defined  (HAVE_LIBNETCDF)
+  int ncid;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  ncid = streamptr->fileID;
+  if ( streamptr->historyID != UNDEFID )
+    cdf_inq_attlen(ncid, NC_GLOBAL, "history", &size);
+
+#endif
+  return ((int) size);
+}
+
+
+void cdfInqHistoryString(int streamID, char *history)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int ncid;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  ncid = streamptr->fileID;
+  if ( streamptr->historyID != UNDEFID )
+    cdf_get_att_text(ncid, NC_GLOBAL, "history", history);
+
+#endif
+}
+
+
+void cdfDefVars(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int index, gridID, zaxisID, vlistID;
+  int ngrids, nzaxis;
+  /* int  nvars, ncvarid; */
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  if ( vlistID == UNDEFID )
+    Error("Internal problem! vlist undefined for streamID %d", streamID);
+
+  /* nvars  = vlistNvars(vlistID); */
+  ngrids = vlistNgrids(vlistID);
+  nzaxis = vlistNzaxis(vlistID);
+  /*
+  if ( vlistHasTime(vlistID) ) cdfDefTime(streamID);
+  */
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID = vlistGrid(vlistID, index);
+      cdfDefGrid(streamID, gridID);
+    }
+
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      zaxisID = vlistZaxis(vlistID, index);
+      if ( streamptr->zaxisID[index] == UNDEFID ) cdfDefZaxis(streamID, zaxisID);
+    }
+  /*
+    define time first!!!
+  for (varID = 0; varID < nvars; varID++ )
+    {
+      ncvarid = cdfDefVar(streamID, varID);
+    }
+  */
+#endif
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <string.h>
+
+
+
+
+static
+void streamvarInitEntry(int streamID, int varID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  streamptr->vars[varID].ncvarid      = CDI_UNDEFID;
+  streamptr->vars[varID].defmiss      = 0;
+  streamptr->vars[varID].nlevs        = 0;
+  streamptr->vars[varID].level        = NULL;
+  streamptr->vars[varID].lindex       = NULL;
+
+  streamptr->vars[varID].gridID       = CDI_UNDEFID;
+  streamptr->vars[varID].zaxisID      = CDI_UNDEFID;
+  streamptr->vars[varID].tsteptype    = CDI_UNDEFID;
+  streamptr->vars[varID].level        = NULL;
+  streamptr->vars[varID].nlevs        = 0;
+}
+
+static
+int streamvarNewEntry(int streamID)
+{
+  int varID = 0;
+  int streamvarSize;
+  svarinfo_t *streamvar;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  streamvarSize = streamptr->varsAllocated;
+  streamvar     = streamptr->vars;
+  /*
+    Look for a free slot in streamvar.
+    (Create the table the first time through).
+  */
+  if ( ! streamvarSize )
+    {
+      int i;
+
+      streamvarSize = 2;
+      streamvar = (svarinfo_t *) malloc(streamvarSize*sizeof(svarinfo_t));
+      if ( streamvar == NULL )
+	{
+          Message("streamvarSize = %d", streamvarSize);
+	  SysError("Allocation of svarinfo_t failed");
+	}
+
+      for ( i = 0; i < streamvarSize; i++ )
+	streamvar[i].isUsed = FALSE;
+    }
+  else
+    {
+      while ( varID < streamvarSize )
+	{
+	  if ( ! streamvar[varID].isUsed ) break;
+	  varID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if ( varID == streamvarSize )
+    {
+      int i;
+
+      streamvarSize = 2*streamvarSize;
+      streamvar = (svarinfo_t *) realloc(streamvar, streamvarSize*sizeof(svarinfo_t));
+      if ( streamvar == NULL )
+	{
+          Message("streamvarSize = %d", streamvarSize);
+	  SysError("Reallocation of svarinfo_t failed");
+	}
+      varID = streamvarSize/2;
+
+      for ( i = varID; i < streamvarSize; i++ )
+	streamvar[i].isUsed = FALSE;
+    }
+
+  streamptr->varsAllocated = streamvarSize;
+  streamptr->vars          = streamvar;
+
+  streamvarInitEntry(streamID, varID);
+
+  streamptr->vars[varID].isUsed = TRUE;
+
+  return (varID);
+}
+
+
+int streamNewVar(int streamID, int gridID, int zaxisID)
+{
+  int varID;
+  int *level;
+  int *lindex;
+  int nlevs;
+  int levID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("gridID = %d  zaxisID = %d", gridID, zaxisID);
+
+  varID = streamvarNewEntry(streamID);
+
+  streamptr->nvars++;
+
+  streamptr->vars[varID].gridID  = gridID;
+  streamptr->vars[varID].zaxisID = zaxisID;
+
+  nlevs = zaxisInqSize(zaxisID);
+
+  level  = (int *) malloc(nlevs*sizeof(int));
+  lindex = (int *) malloc(nlevs*sizeof(int));
+
+  for ( levID = 0; levID < nlevs; levID++ )
+    level[levID] = CDI_UNDEFID;
+
+  for ( levID = 0; levID < nlevs; levID++ )
+    lindex[levID] = levID;
+
+  streamptr->vars[varID].nlevs  = nlevs;
+  streamptr->vars[varID].level  = level;
+  streamptr->vars[varID].lindex = lindex;
+
+  return (varID);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+
+
+
+void recordInitEntry(record_t *record)
+{
+  (*record).position = CDI_UNDEFID;
+  (*record).size     = 0;
+  (*record).param    = 0;
+  (*record).ilevel   = CDI_UNDEFID;
+  (*record).used     = FALSE;
+  (*record).varID    = CDI_UNDEFID;
+  (*record).levelID  = CDI_UNDEFID;
+}
+
+
+int recordNewEntry(int streamID, int tsID)
+{
+  int recordID = 0;
+  int recordSize;
+  record_t *records;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  recordSize = streamptr->tsteps[tsID].recordSize;
+  records    = streamptr->tsteps[tsID].records;
+  /*
+    Look for a free slot in record.
+    (Create the table the first time through).
+  */
+  if ( ! recordSize )
+    {
+      int i;
+      recordSize = 1;   /*  <<<<----  */
+      records = (record_t *) malloc(recordSize*sizeof(record_t));
+      if ( records == NULL )
+	{
+          Message("recordSize = %d", recordSize);
+	  SysError("Allocation of record_tTABLE failed");
+	}
+
+      for ( i = 0; i < recordSize; i++ )
+	records[i].used = CDI_UNDEFID;
+    }
+  else
+    {
+      while ( recordID < recordSize )
+	{
+	  if ( records[recordID].used == CDI_UNDEFID ) break;
+	  recordID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if ( recordID == recordSize )
+    {
+      int i;
+
+      recordSize = 2*recordSize;
+      records    = (record_t *) realloc(records, recordSize*sizeof(record_t));
+      if ( records == NULL )
+	{
+          Message("recordSize = %d", recordSize);
+	  SysError("Reallocation of record_tTABLE failed");
+	}
+      recordID = recordSize/2;
+
+      for ( i = recordID; i < recordSize; i++ )
+	records[i].used = CDI_UNDEFID;
+    }
+
+
+  recordInitEntry(&records[recordID]);
+
+  records[recordID].used = 1;
+
+  streamptr->tsteps[tsID].recordSize = recordSize;
+  streamptr->tsteps[tsID].records    = records;
+
+  return (recordID);
+}
+
+
+void cdiInitRecord(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  streamptr->record = (Record *) malloc(sizeof(Record));
+
+  streamptr->record->used       = 0;
+  streamptr->record->nrec       = 0;
+  streamptr->record->dataread   = 1;
+  streamptr->record->param      = 0;
+  streamptr->record->level      = 0;
+  streamptr->record->date       = 0;
+  streamptr->record->time       = 0;
+  streamptr->record->gridID     = 0;
+  streamptr->record->zaxisID    = 0;
+  streamptr->record->buffer     = NULL;
+  streamptr->record->buffersize = 0;
+  streamptr->record->position   = 0;
+  streamptr->record->varID      = 0;
+  streamptr->record->levelID    = CDI_UNDEFID;
+  streamptr->record->recid      = 0;
+}
+
+
+void streamInqRecord(int streamID, int *varID, int *levelID)
+{
+  /* int rec = 0; */
+  int recID, tsID, rindex;
+  int lindex;
+  stream_t *streamptr;
+
+  check_parg(varID);
+  check_parg(levelID);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  cdiDefAccesstype(streamID, TYPE_REC);
+
+  if ( ! streamptr->record ) cdiInitRecord(streamID);
+
+  tsID   = streamptr->curTsID;
+  rindex = streamptr->tsteps[tsID].curRecID + 1;
+
+  if ( rindex >= streamptr->tsteps[tsID].nrecs )
+    Error("record %d not available at timestep %d", rindex+1, tsID+1);
+
+  recID  = streamptr->tsteps[tsID].recIDs[rindex];
+
+  if ( recID == -1 || recID >= streamptr->tsteps[tsID].nallrecs )
+    Error("Internal problem! tsID = %d recID = %d", tsID, recID);
+
+  *varID   = streamptr->tsteps[tsID].records[recID].varID;
+  lindex   = streamptr->tsteps[tsID].records[recID].levelID;
+
+  *levelID = streamptr->vars[*varID].lindex[lindex];
+
+  if ( CDI_Debug )
+    Message("tsID = %d, recID = %d, varID = %d, levelID = %d\n",
+	    tsID, recID, *varID, *levelID);
+
+  streamptr->curTsID = tsID;
+  streamptr->tsteps[tsID].curRecID = rindex;
+
+  /*
+  rec = recID + 1;
+  filetype = streamptr->filetype;
+
+  switch ( filetype )
+    {
+    case FILETYPE_GRB:
+      {
+        rec = grbInqRecord(streamID, varID, levelID);
+	break;
+      }
+    case FILETYPE_SRV:
+      {
+        rec = srvInqRecord(streamID, varID, levelID);
+	break;
+      }
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	rec = cdfInqRecord(streamID, varID, levelID);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+  */
+}
+
+
+void streamDefRecord(int streamID, int varID, int levelID)
+{
+  int status = 0;
+  int filetype;
+  int param, gridID, zaxisID, level;
+  int tsID;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  tsID = streamptr->curTsID;
+
+  if ( tsID == CDI_UNDEFID )
+    {
+      tsID++;
+      streamDefTimestep(streamID, tsID);
+    }
+
+  if ( ! streamptr->record ) cdiInitRecord(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  zaxisID = vlistInqVarZaxis(vlistID, varID);
+  param   = vlistInqVarParam(vlistID, varID);
+  level   = (int) zaxisInqLevel(zaxisID, levelID);
+
+  streamptr->record->varID    = varID;
+  streamptr->record->levelID  = levelID;
+  streamptr->record->param    = param;
+  streamptr->record->level    = level;
+  streamptr->record->date     = streamptr->tsteps[tsID].taxis.vdate;
+  streamptr->record->time     = streamptr->tsteps[tsID].taxis.vtime;
+  streamptr->record->gridID   = gridID;
+  streamptr->record->zaxisID  = zaxisID;
+  streamptr->record->prec     = vlistInqVarDatatype(vlistID, varID);
+
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        status = grbDefRecord(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        status = srvDefRecord(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        status = extDefRecord(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        status = iegDefRecord(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	if ( streamptr->accessmode == 0 ) cdfEndDef(streamID);
+	status = cdfDefRecord(streamID);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+
+void streamReadRecord(int streamID, double *data, int *nmiss)
+{
+  int status = 0;
+  int filetype;
+  stream_t *streamptr;
+
+  check_parg(data);
+  check_parg(nmiss);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  *nmiss = 0;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        status = grbReadRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        status = srvReadRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        status = extReadRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        status = iegReadRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	status = cdfReadRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+
+void stream_write_record(int streamID, int memtype, const void *data, int nmiss)
+{
+  int status = 0;
+  int filetype;
+  stream_t *streamptr;
+
+  check_parg(data);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("grbWriteRecord not implemented for memtype float!");
+        status = grbWriteRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("srvWriteRecord not implemented for memtype float!");
+        status = srvWriteRecord(streamID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("extWriteRecord not implemented for memtype float!");
+        status = extWriteRecord(streamID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("iegWriteRecord not implemented for memtype float!");
+        status = iegWriteRecord(streamID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	cdf_write_record(streamID, memtype, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+
+void streamWriteRecord(int streamID, const double *data, int nmiss)
+{
+  stream_write_record(streamID, MEMTYPE_DOUBLE, (const void *) data, nmiss);
+}
+
+void streamWriteRecordF(int streamID, const float *data, int nmiss)
+{
+  stream_write_record(streamID, MEMTYPE_FLOAT, (const void *) data, nmiss);
+}
+
+
+void streamCopyRecord(int streamID2, int streamID1)
+{
+  int status = 0;
+  int filetype = CDI_UNDEFID, filetype1, filetype2;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  filetype1 = streamptr1->filetype;
+  filetype2 = streamptr2->filetype;
+
+  if ( filetype1 == filetype2 ) filetype = filetype2;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+	status = grbCopyRecord(streamID2, streamID1);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+	status = srvCopyRecord(streamID2, streamID1);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+	status = extCopyRecord(streamID2, streamID1);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+	status = iegCopyRecord(streamID2, streamID1);
+	break;
+      }
+#endif
+    default:
+      {
+	status = cdfCopyRecord(streamID2, streamID1);
+	break;
+      }
+    }
+}
+
+
+void cdiCreateRecords(int streamID, int tsID)
+{
+  int nrecords, maxrecords;
+  int nvars, varID, recID;
+  record_t *records;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( streamptr->tsteps[tsID].records ) return;
+
+  vlistID  = streamInqVlist(streamID);
+
+  if ( tsID == 0 )
+    {
+      maxrecords = 0;
+      nvars = streamptr->nvars;
+      for ( varID = 0; varID < nvars; varID++)
+	maxrecords += streamptr->vars[varID].nlevs;
+    }
+  else
+    maxrecords = streamptr->tsteps[0].recordSize;
+
+  if ( tsID == 0 )
+    {
+      nrecords = maxrecords;
+    }
+  else if ( tsID == 1 )
+    {
+      nrecords = 0;
+      maxrecords = streamptr->tsteps[0].recordSize;
+      for ( recID = 0; recID < maxrecords; recID++ )
+	{
+	  varID = streamptr->tsteps[0].records[recID].varID;
+	  if ( varID != -1 ) /* varID = -1 for write mode !!! */
+	    if ( vlistInqVarTsteptype(vlistID, varID) == TSTEP_CONSTANT )
+	      continue;
+	  nrecords++;
+	}
+    }
+  else
+    nrecords = streamptr->tsteps[1].nallrecs;
+
+  if ( maxrecords > 0 )
+    records = (record_t *) malloc(maxrecords*sizeof(record_t));
+  else
+    records = NULL;
+
+  streamptr->tsteps[tsID].records    = records;
+  streamptr->tsteps[tsID].recordSize = maxrecords;
+  streamptr->tsteps[tsID].nallrecs   = nrecords;
+
+  if ( tsID == 0 )
+    {
+      for ( recID = 0; recID < maxrecords; recID++ )
+	recordInitEntry(&streamptr->tsteps[tsID].records[recID]);
+    }
+  else
+    {
+      memcpy(streamptr->tsteps[tsID].records,
+	     streamptr->tsteps[0].records,
+	     maxrecords*sizeof(record_t));
+
+      for ( recID = 0; recID < maxrecords; recID++ )
+	{
+	  varID = streamptr->tsteps[0].records[recID].varID;
+	  if ( varID != -1 ) /* varID = -1 for write mode !!! */
+	    if ( vlistInqVarTsteptype(vlistID, varID) != TSTEP_CONSTANT )
+	      {
+		streamptr->tsteps[tsID].records[recID].position = CDI_UNDEFID;
+		streamptr->tsteps[tsID].records[recID].size     = 0;
+		streamptr->tsteps[tsID].records[recID].used     = FALSE;
+	      }
+	}
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+
+
+
+static void tstepsInitEntry(int streamID, int tsID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  streamptr->tsteps[tsID].curRecID     = CDI_UNDEFID;
+  streamptr->tsteps[tsID].position     = 0;
+  streamptr->tsteps[tsID].records      = NULL;
+  streamptr->tsteps[tsID].recordSize   = 0;
+  streamptr->tsteps[tsID].nallrecs     = 0;
+  streamptr->tsteps[tsID].recIDs       = NULL;
+  streamptr->tsteps[tsID].nrecs        = 0;
+  streamptr->tsteps[tsID].next         = 0;
+
+  ptaxisInit(&streamptr->tsteps[tsID].taxis);
+}
+
+int tstepsNewEntry(int streamID)
+{
+  int tsID = 0;
+  int tstepsTableSize;
+  tsteps_t *tstepsTable;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  tsID            = streamptr->tstepsNextID++;
+  tstepsTableSize = streamptr->tstepsTableSize;
+  tstepsTable     = streamptr->tsteps;
+
+  /*
+    If the table overflows, double its size.
+  */
+  if ( tsID == tstepsTableSize )
+    {
+      if ( tstepsTableSize == 0 ) tstepsTableSize = 1;
+      tstepsTableSize = 2*tstepsTableSize;
+      tstepsTable = (tsteps_t *) realloc(tstepsTable, tstepsTableSize*sizeof(tsteps_t));
+      if ( tstepsTable == NULL )
+	{
+          Message("tstepsTableSize = %d", tstepsTableSize);
+	  SysError("Reallocation of tsteps_t failed");
+	}
+    }
+
+  streamptr->tstepsTableSize = tstepsTableSize;
+  streamptr->tsteps          = tstepsTable;
+
+  tstepsInitEntry(streamID, tsID);
+
+  streamptr->tsteps[tsID].taxis.used = TRUE;
+
+  return (tsID);
+}
+
+void cdiCreateTimesteps(int streamID)
+{
+  int ntsteps;
+  int tsID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->ntsteps < 0 || streamptr->tstepsTableSize > 0 )
+    return;
+
+  if ( streamptr->ntsteps == 0 ) ntsteps = 1;    /* <<<<<-------- */
+  else ntsteps = streamptr->ntsteps;
+
+  streamptr->tsteps = (tsteps_t *) malloc(ntsteps*sizeof(tsteps_t));
+  if ( streamptr->tsteps == NULL )
+    SysError("Allocation of tsteps_t failed");
+
+  streamptr->tstepsTableSize = ntsteps;
+  streamptr->tstepsNextID    = ntsteps;
+
+  for ( tsID = 0; tsID < ntsteps; tsID++ )
+    {
+      tstepsInitEntry(streamID, tsID);
+      streamptr->tsteps[tsID].taxis.used = TRUE;
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+/*
+size_t getpagesize(void);
+*/
+
+#ifdef USE_MPI
+#endif
+
+#if ! defined(O_BINARY)
+#define O_BINARY 0
+#endif
+
+#ifndef strdupx
+#ifndef strdup
+char *strdup(const char *s);
+#endif
+#define strdupx  strdup
+/*
+#define strdupx(s)                                \
+({                                                \
+   const char *__old = (s);                       \
+   size_t __len = strlen(__old) + 1;              \
+   char *__new = (char *) malloc(__len);          \
+   (char *) memcpy(__new, __old, __len);          \
+})
+*/
+#endif
+
+
+#if defined (HAVE_MMAP)
+#  include <sys/mman.h> /* mmap() is defined in this header */
+#endif
+
+
+#if ! defined   (FALSE)
+#  define  FALSE  0
+#endif
+
+#if ! defined   (TRUE)
+#  define  TRUE   1
+#endif
+
+/* #define  MAX_FILES  FOPEN_MAX */
+#define  MAX_FILES  4096
+
+static int _file_max = MAX_FILES;
+
+static void file_initialize(void);
+
+static int _file_init = FALSE;
+
+#if  defined  (HAVE_LIBPTHREAD)
+#include <pthread.h>
+
+static pthread_once_t  _file_init_thread = PTHREAD_ONCE_INIT;
+static pthread_mutex_t _file_mutex;
+
+#  define FILE_LOCK()         pthread_mutex_lock(&_file_mutex)
+#  define FILE_UNLOCK()       pthread_mutex_unlock(&_file_mutex)
+#  define FILE_INIT()        \
+   if ( _file_init == FALSE ) pthread_once(&_file_init_thread, file_initialize)
+
+#else
+
+#  define FILE_LOCK()
+#  define FILE_UNLOCK()
+#  define FILE_INIT()        \
+   if ( _file_init == FALSE ) file_initialize()
+
+#endif
+
+
+typedef struct
+{
+  int        self;
+  int        flag;           /* access and error flag         */
+  int        eof;            /* end of file flag              */
+  int        fd;             /* file descriptor used for read */
+  FILE      *fp;             /* FILE pointer used for write   */
+  int        mode;           /* file access mode              */
+  char      *name;           /* file name                     */
+  off_t      size;           /* file size                     */
+  off_t      position;       /* file position                 */
+  long       access;         /* file access                   */
+  off_t      byteTrans;      /*                               */
+  size_t     blockSize;      /* file block size               */
+  int        type;           /* file type ( 1:open 2:fopen )  */
+  int        bufferType;     /* buffer type ( 1:std 2:mmap )  */
+  size_t     bufferSize;     /* file buffer size              */
+  size_t     mappedSize;     /* mmap buffer size              */
+  char      *buffer;         /* file buffer                   */
+  long       bufferNumFill;  /* number of buffer fill         */
+  char      *bufferPtr;      /* file buffer pointer           */
+  off_t      bufferPos;
+  off_t      bufferStart;
+  off_t      bufferEnd;
+  size_t     bufferCnt;
+}
+bfile_t;
+
+
+enum F_I_L_E_Flags
+  {
+    FILE_READ  =  01,
+    FILE_WRITE =  02,
+    FILE_UNBUF =  04,
+    FILE_EOF   = 010,
+    FILE_ERROR = 020
+  };
+
+
+static int FileInfo = FALSE;
+
+
+#if ! defined (MIN_BUF_SIZE)
+#  define  MIN_BUF_SIZE  131072L
+#endif
+
+
+static size_t FileBufferSizeMin = MIN_BUF_SIZE;
+static long   FileBufferSizeEnv = -1;
+static int    FileBufferTypeEnv =  0;
+
+static int    FileTypeEnv =  0;
+
+static int    FILE_Debug = 0;   /* If set to 1, debugging */
+
+
+static void file_table_print(void);
+
+/*
+ * A version string.
+ */
+#undef   LIBVERSION
+#define  LIBVERSION      1.8.1
+#define  XSTRING(x)	 #x
+#define  STRING(x) 	 XSTRING(x)
+const char file_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
+
+/*
+  21/05/2004  1.3.2 set min I/O Buffersize to 128k
+  31/05/2005  1.4.0 replace fileTable by _fileList
+  26/08/2005  1.4.1 fileClose with return value
+                    checks for all fileptr
+  01/09/2005  1.5.0 thread safe version
+  06/11/2005  1.5.1 add filePtrEOF, filePtr, filePtrGetc
+  03/02/2006  1.5.2 ansi C: define getpagesize and strdupx
+  27/12/2007  1.6.0 add FILE_TYPE_FOPEN
+  24/03/2008  1.6.1 add O_BINARY if available
+                    remove default HAVE_MMAP
+                    use HAVE_STRUCT_STAT_ST_BLKSIZE
+  22/08/2010  1.7.0 refactor
+  11/11/2010  1.7.1 update for changed interface of error.h
+  02/02/2012  1.8.0 cleanup
+  16/11/2012  1.8.1 added support for unbuffered write
+ */
+
+
+typedef struct _filePtrToIdx {
+  int idx;
+  bfile_t *ptr;
+  struct _filePtrToIdx *next;
+} filePtrToIdx;
+
+
+static filePtrToIdx *_fileList  = NULL;
+static filePtrToIdx *_fileAvail = NULL;
+
+static
+void file_list_new(void)
+{
+  assert(_fileList == NULL);
+
+  _fileList = (filePtrToIdx *) malloc(_file_max*sizeof(filePtrToIdx));
+}
+
+static
+void file_list_delete(void)
+{
+  if ( _fileList )
+    {
+      free(_fileList);
+      _fileList = NULL;
+    }
+}
+
+static
+void file_init_pointer(void)
+{
+  int  i;
+
+  for ( i = 0; i < _file_max; i++ )
+    {
+      _fileList[i].next = _fileList + i + 1;
+      _fileList[i].idx  = i;
+      _fileList[i].ptr  = 0;
+    }
+
+  _fileList[_file_max-1].next = 0;
+
+  _fileAvail = _fileList;
+}
+
+static
+bfile_t *file_to_pointer(int idx)
+{
+  bfile_t *fileptr = NULL;
+
+  FILE_INIT();
+
+  if ( idx >= 0 && idx < _file_max )
+    {
+      FILE_LOCK();
+
+      fileptr = _fileList[idx].ptr;
+
+      FILE_UNLOCK();
+    }
+  else
+    Error("file index %d undefined!", idx);
+
+  return (fileptr);
+}
+
+/* Create an index from a pointer */
+static
+int file_from_pointer(bfile_t *ptr)
+{
+  int      idx = -1;
+  filePtrToIdx *newptr;
+
+  if ( ptr )
+    {
+      FILE_LOCK();
+
+      if ( _fileAvail )
+	{
+	  newptr       = _fileAvail;
+	  _fileAvail   = _fileAvail->next;
+	  newptr->next = 0;
+	  idx	       = newptr->idx;
+	  newptr->ptr  = ptr;
+
+	  if ( FILE_Debug )
+	    Message("Pointer %p has idx %d from file list", ptr, idx);
+	}
+      else
+	Warning("Too many open files (limit is %d)!", _file_max);
+
+      FILE_UNLOCK();
+    }
+  else
+    Error("Internal problem (pointer %p undefined)", ptr);
+
+  return (idx);
+}
+
+static
+void file_init_entry(bfile_t *fileptr)
+{
+  fileptr->self          = file_from_pointer(fileptr);
+
+  fileptr->flag          = 0;
+  fileptr->fd            = -1;
+  fileptr->fp            = NULL;
+  fileptr->mode          = 0;
+  fileptr->size          = 0;
+  fileptr->name          = NULL;
+  fileptr->access        = 0;
+  fileptr->position      = 0;
+  fileptr->byteTrans     = 0;
+  fileptr->type          = 0;
+  fileptr->bufferType    = 0;
+  fileptr->bufferSize    = 0;
+  fileptr->mappedSize    = 0;
+  fileptr->buffer        = NULL;
+  fileptr->bufferNumFill = 0;
+  fileptr->bufferStart   = 0;
+  fileptr->bufferEnd     = -1;
+  fileptr->bufferPos     = 0;
+  fileptr->bufferCnt     = 0;
+  fileptr->bufferPtr     = NULL;
+}
+
+static
+bfile_t *file_new_entry(void)
+{
+  bfile_t *fileptr;
+
+  fileptr = (bfile_t *) malloc(sizeof(bfile_t));
+
+  if ( fileptr ) file_init_entry(fileptr);
+
+  return (fileptr);
+}
+
+static
+void file_delete_entry(bfile_t *fileptr)
+{
+  int idx;
+
+  idx = fileptr->self;
+
+  FILE_LOCK();
+
+  free(fileptr);
+
+  _fileList[idx].next = _fileAvail;
+  _fileList[idx].ptr  = 0;
+  _fileAvail   	      = &_fileList[idx];
+
+  FILE_UNLOCK();
+
+  if ( FILE_Debug )
+    Message("Removed idx %d from file list", idx);
+}
+
+
+const char *fileLibraryVersion(void)
+{
+  return (file_libvers);
+}
+
+
+#ifndef POSIXIO_DEFAULT_PAGESIZE
+#define POSIXIO_DEFAULT_PAGESIZE 4096
+#endif
+
+static
+int pagesize(void)
+{
+#if defined (HAVE_MMAP)
+  return ((int) getpagesize());
+#else
+  return ((int) POSIXIO_DEFAULT_PAGESIZE);
+#endif
+}
+
+
+void fileDebug(int debug)
+{
+  FILE_Debug = debug;
+
+  if ( FILE_Debug )
+    Message("Debug level %d", debug);
+}
+
+
+void *filePtr(int fileID)
+{
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  return (fileptr);
+}
+
+static
+void file_pointer_info(const char *caller, int fileID)
+{
+  if ( FILE_Debug )
+    {
+      fprintf(stdout, "%-18s : ", caller);
+      fprintf(stdout, "The fileID %d underlying pointer is not valid!", fileID);
+      fprintf(stdout, "\n");
+    }
+}
+
+
+int fileSetBufferType(int fileID, int type)
+{
+  int ret = 0;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr )
+    {
+      switch (type)
+	{
+	case FILE_BUFTYPE_STD:
+	case FILE_BUFTYPE_MMAP:
+	  fileptr->bufferType = type;
+	  break;
+	default:
+	  Error("File type %d not implemented!", type);
+	}
+    }
+
+#if ! defined (HAVE_MMAP)
+  if ( type == FILE_BUFTYPE_MMAP ) ret = 1;
+#endif
+
+  return (ret);
+}
+
+
+int fileGetBufferType(int fileID)
+{
+  bfile_t *fileptr;
+  int bufferType = 0;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) bufferType = fileptr->bufferType;
+
+  return (bufferType);
+}
+
+
+int fileFlush(int fileID)
+{
+  bfile_t *fileptr;
+  int retval = 0;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) retval = fflush(fileptr->fp);
+
+  return (retval);
+}
+
+
+void fileClearerr(int fileID)
+{
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr )
+    {
+      if ( fileptr->mode != 'r' )
+	clearerr(fileptr->fp);
+    }
+}
+
+
+int filePtrEOF(void *vfileptr)
+{
+  bfile_t *fileptr = (bfile_t *) vfileptr;
+  int retval = 0;
+
+  if ( fileptr ) retval = (fileptr->flag & FILE_EOF) != 0;
+
+  return (retval);
+}
+
+
+int fileEOF(int fileID)
+{
+  bfile_t *fileptr;
+  int retval = 0;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) retval = (fileptr->flag & FILE_EOF) != 0;
+
+  return (retval);
+}
+
+
+int fileError(int fileID)
+{
+  bfile_t *fileptr;
+  int retval = 0;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) retval = (fileptr->flag & FILE_ERROR) != 0;
+
+  return (retval);
+}
+
+
+void fileRewind(int fileID)
+{
+  fileSetPos(fileID, (off_t) 0, SEEK_SET);
+  fileClearerr(fileID);
+}
+
+
+off_t fileGetPos(int fileID)
+{
+  off_t filepos = 0;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr )
+    {
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	filepos = fileptr->position;
+      else
+	filepos = ftell(fileptr->fp);
+    }
+
+  if ( FILE_Debug ) Message("Position %ld", filepos);
+
+  return (filepos);
+}
+
+
+int fileSetPos(int fileID, off_t offset, int whence)
+{
+  int status = 0;
+  off_t position;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( FILE_Debug ) Message("Offset %8ld  Whence %3d", (long) offset, whence);
+
+  if ( fileptr == 0 )
+    {
+      file_pointer_info(__func__, fileID);
+      return (1);
+    }
+
+  switch (whence)
+    {
+    case SEEK_SET:
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	{
+	  position = offset;
+	  fileptr->position = position;
+	  if ( position < fileptr->bufferStart || position > fileptr->bufferEnd )
+	    {
+	      if ( fileptr->bufferType == FILE_BUFTYPE_STD )
+		fileptr->bufferPos = position;
+	      else
+		fileptr->bufferPos = position - position % pagesize();
+
+	      fileptr->bufferCnt = 0;
+	      fileptr->bufferPtr = NULL;
+	    }
+	  else
+	    {
+	      if ( fileptr->bufferPos != fileptr->bufferEnd + 1 )
+		{
+		  if ( FILE_Debug )
+		    Message("Reset buffer pos from %ld to %ld",
+			    fileptr->bufferPos, fileptr->bufferEnd + 1);
+
+		  fileptr->bufferPos = fileptr->bufferEnd + 1;
+		}
+	      fileptr->bufferCnt = fileptr->bufferEnd - position + 1;
+	      fileptr->bufferPtr = fileptr->buffer + position - fileptr->bufferStart;
+	    }
+	}
+      else
+	{
+	  status = fseek(fileptr->fp, offset, whence);
+	}
+      break;
+    case SEEK_CUR:
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	{
+	  fileptr->position += offset;
+	  position = fileptr->position;
+	  if ( position < fileptr->bufferStart || position > fileptr->bufferEnd )
+	    {
+	      if ( fileptr->bufferType == FILE_BUFTYPE_STD )
+		fileptr->bufferPos = position;
+	      else
+		fileptr->bufferPos = position - position % pagesize();
+
+	      fileptr->bufferCnt = 0;
+	      fileptr->bufferPtr = NULL;
+	    }
+	  else
+	    {
+	      if ( fileptr->bufferPos != fileptr->bufferEnd + 1 )
+		{
+		  if ( FILE_Debug )
+		    Message("Reset buffer pos from %ld to %ld",
+			    fileptr->bufferPos, fileptr->bufferEnd + 1);
+
+		  fileptr->bufferPos = fileptr->bufferEnd + 1;
+		}
+	      fileptr->bufferCnt -= offset;
+	      fileptr->bufferPtr += offset;
+	    }
+	}
+      else
+	{
+	  status = fseek(fileptr->fp, offset, whence);
+	}
+      break;
+    default:
+      Error("Whence = %d not implemented", whence);
+    }
+
+  if ( fileptr->position < fileptr->size )
+    if ( (fileptr->flag & FILE_EOF) != 0 )
+      fileptr->flag -= FILE_EOF;
+
+  return (status);
+}
+
+static
+void file_table_print(void)
+{
+  int fileID;
+  int lprintHeader = 1;
+  bfile_t *fileptr;
+
+  for ( fileID = 0; fileID < _file_max; fileID++ )
+    {
+      fileptr = file_to_pointer(fileID);
+
+      if ( fileptr )
+	{
+	  if ( lprintHeader )
+	    {
+	      fprintf(stderr, "\nFile table:\n");
+	      fprintf(stderr, "+-----+---------+");
+	      fprintf(stderr, "----------------------------------------------------+\n");
+	      fprintf(stderr, "|  ID |  Mode   |");
+	      fprintf(stderr, "  Name                                              |\n");
+	      fprintf(stderr, "+-----+---------+");
+	      fprintf(stderr, "----------------------------------------------------+\n");
+	      lprintHeader = 0;
+	    }
+
+	  fprintf(stderr, "| %3d | ", fileID);
+
+	  switch ( fileptr->mode )
+	    {
+	    case 'r':
+	      fprintf(stderr, "read   ");
+	      break;
+	    case 'w':
+	      fprintf(stderr, "write  ");
+	      break;
+	    case 'a':
+	      fprintf(stderr, "append ");
+	      break;
+	    default:
+	      fprintf(stderr, "unknown");
+	    }
+
+          fprintf(stderr, " | %-51s|\n", fileptr->name);
+	}
+    }
+
+  if ( lprintHeader == 0 )
+    {
+      fprintf(stderr, "+-----+---------+");
+      fprintf(stderr, "----------------------------------------------------+\n");
+    }
+}
+
+
+char *fileInqName(int fileID)
+{
+  bfile_t *fileptr;
+  char *name = NULL;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) name = fileptr->name;
+
+  return (name);
+}
+
+
+int fileInqMode(int fileID)
+{
+  bfile_t *fileptr;
+  int mode = 0;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) mode = fileptr->mode;
+
+  return (mode);
+}
+
+static
+long file_getenv(const char *envName)
+{
+  char *envString;
+  long envValue = -1;
+  long fact = 1;
+
+  envString = getenv(envName);
+
+  if ( envString )
+    {
+      int loop;
+
+      for ( loop = 0; loop < (int) strlen(envString); loop++ )
+	{
+	  if ( ! isdigit((int) envString[loop]) )
+	    {
+	      switch ( tolower((int) envString[loop]) )
+		{
+		case 'k':  fact =       1024;  break;
+		case 'm':  fact =    1048576;  break;
+		case 'g':  fact = 1073741824;  break;
+		default:
+		  fact = 0;
+		  Message("Invalid number string in %s: %s", envName, envString);
+		  Warning("%s must comprise only digits [0-9].",envName);
+		}
+	      break;
+	    }
+	}
+
+      if ( fact ) envValue = fact*atol(envString);
+
+      if ( FILE_Debug ) Message("Set %s to %ld", envName, envValue);
+    }
+
+  return (envValue);
+}
+
+static
+void file_initialize(void)
+{
+  long value;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  /* initialize global API mutex lock */
+  pthread_mutex_init(&_file_mutex, NULL);
+#endif
+
+  value = file_getenv("FILE_DEBUG");
+  if ( value >= 0 ) FILE_Debug = (int) value;
+
+  value = file_getenv("FILE_MAX");
+  if ( value >= 0 ) _file_max = (int) value;
+
+  if ( FILE_Debug )
+    Message("FILE_MAX = %d", _file_max);
+
+  FileInfo = (int) file_getenv("FILE_INFO");
+
+  value  = file_getenv("FILE_BUFSIZE");
+  if ( value >= 0 ) FileBufferSizeEnv = value;
+  else
+    {
+      value  = file_getenv("GRIB_API_IO_BUFFER_SIZE");
+      if ( value >= 0 ) FileBufferSizeEnv = value;
+    }
+
+  value = file_getenv("FILE_TYPE");
+  if ( value > 0 )
+    {
+      switch (value)
+	{
+	case FILE_TYPE_OPEN:
+	case FILE_TYPE_FOPEN:
+	  FileTypeEnv = value;
+	  break;
+	default:
+	  Warning("File type %d not implemented!", value);
+	}
+    }
+
+  value = file_getenv("FILE_BUFTYPE");
+#if ! defined (HAVE_MMAP)
+  if ( value == FILE_BUFTYPE_MMAP )
+    {
+      Warning("MMAP not available!");
+      value = 0;
+    }
+#endif
+  if ( value > 0 )
+    {
+      switch (value)
+	{
+	case FILE_BUFTYPE_STD:
+	case FILE_BUFTYPE_MMAP:
+	  FileBufferTypeEnv = value;
+	  break;
+	default:
+	  Warning("File buffer type %d not implemented!", value);
+	}
+    }
+
+  file_list_new();
+  atexit(file_list_delete);
+
+  FILE_LOCK();
+
+  file_init_pointer();
+
+  FILE_UNLOCK();
+
+  if ( FILE_Debug ) atexit(file_table_print);
+
+  _file_init = TRUE;
+}
+
+static
+void file_set_buffer(bfile_t *fileptr)
+{
+  size_t buffersize = 0;
+
+  if ( fileptr->mode == 'r' )
+    {
+      if ( FileBufferTypeEnv )
+	fileptr->bufferType = FileBufferTypeEnv;
+      else if ( fileptr->bufferType == 0 )
+	fileptr->bufferType = FILE_BUFTYPE_STD;
+
+      if ( FileBufferSizeEnv >= 0 )
+	buffersize = (size_t) FileBufferSizeEnv;
+      else if ( fileptr->bufferSize > 0 )
+	buffersize = fileptr->bufferSize;
+      else
+	{
+	  buffersize = fileptr->blockSize * 4;
+	  if ( buffersize < FileBufferSizeMin ) buffersize = FileBufferSizeMin;
+	}
+
+      if ( (size_t) fileptr->size < buffersize )
+	buffersize = (size_t) fileptr->size;
+
+      if ( fileptr->bufferType == FILE_BUFTYPE_MMAP )
+	{
+	  size_t blocksize = (size_t) pagesize();
+	  size_t minblocksize = 4 * blocksize;
+	  buffersize = buffersize - buffersize % minblocksize;
+
+	  if ( buffersize < (size_t) fileptr->size && buffersize < minblocksize )
+	    buffersize = minblocksize;
+	}
+
+      if ( buffersize == 0 ) buffersize = 1;
+    }
+  else
+    {
+      fileptr->bufferType = FILE_BUFTYPE_STD;
+
+      if ( FileBufferSizeEnv >= 0 )
+	buffersize = (size_t) FileBufferSizeEnv;
+      else if ( fileptr->bufferSize > 0 )
+	buffersize = fileptr->bufferSize;
+      else
+	{
+	  buffersize = fileptr->blockSize * 4;
+	  if ( buffersize < FileBufferSizeMin ) buffersize = FileBufferSizeMin;
+	}
+    }
+
+  if ( fileptr->bufferType == FILE_BUFTYPE_STD || fileptr->type == FILE_TYPE_FOPEN )
+    {
+      if ( buffersize > 0 )
+        {
+          fileptr->buffer = (char *) malloc(buffersize);
+          if ( fileptr->buffer == NULL )
+            SysError("Allocation of file buffer failed!");
+        }
+    }
+
+  if ( fileptr->type == FILE_TYPE_FOPEN )
+    if ( setvbuf(fileptr->fp, fileptr->buffer, fileptr->buffer ? _IOFBF : _IONBF, buffersize) )
+      SysError("setvbuf failed!");
+
+  fileptr->bufferSize = buffersize;
+}
+
+static
+int file_fill_buffer(bfile_t *fileptr)
+{
+  long nread;
+  int fd;
+  int ret;
+  long offset = 0;
+  off_t retseek;
+
+  if ( FILE_Debug )
+    Message("file ptr = %p  Cnt = %ld", fileptr, fileptr->bufferCnt);
+
+  if ( (fileptr->flag & FILE_EOF) != 0 ) return (EOF);
+
+  if ( fileptr->buffer == NULL ) file_set_buffer(fileptr);
+
+  if ( fileptr->bufferSize == 0 ) return (EOF);
+
+  fd = fileptr->fd;
+
+#if defined (HAVE_MMAP)
+  if ( fileptr->bufferType == FILE_BUFTYPE_MMAP )
+    {
+      if ( fileptr->bufferPos >= fileptr->size )
+	{
+	  nread = 0;
+	}
+      else
+	{
+	  nread = fileptr->bufferSize;
+	  if ( (nread + fileptr->bufferPos) > fileptr->size )
+	    nread = fileptr->size - fileptr->bufferPos;
+
+	  if ( fileptr->buffer )
+	    {
+	      ret = munmap(fileptr->buffer, fileptr->mappedSize);
+	      if ( ret == -1 )
+		SysError("munmap error for read %s", fileptr->name);
+	      fileptr->buffer = NULL;
+	    }
+
+	  fileptr->mappedSize = (size_t) nread;
+
+	  fileptr->buffer =
+            (char *) mmap(0, (size_t) nread, PROT_READ, MAP_SHARED, fd, fileptr->bufferPos);
+
+	  if ( fileptr->buffer == (void *)-1 )
+	    SysError("mmap error for read %s", fileptr->name);
+
+	  offset = fileptr->position - fileptr->bufferPos;
+	}
+    }
+  else
+#endif
+    {
+      retseek = lseek(fileptr->fd, fileptr->bufferPos, SEEK_SET);
+      if ( retseek == (off_t)-1 )
+	SysError("lseek error at pos %ld file %s", (long) fileptr->bufferPos, fileptr->name);
+
+      nread = (long) read(fd, fileptr->buffer, fileptr->bufferSize);
+    }
+
+  if ( nread <= 0 )
+    {
+      if ( nread == 0 )
+	fileptr->flag |= FILE_EOF;
+      else
+	fileptr->flag |= FILE_ERROR;
+
+      fileptr->bufferCnt = 0;
+      return (EOF);
+    }
+
+  fileptr->bufferPtr = fileptr->buffer;
+  fileptr->bufferCnt = nread;
+
+  fileptr->bufferStart = fileptr->bufferPos;
+  fileptr->bufferPos  += nread;
+  fileptr->bufferEnd   = fileptr->bufferPos - 1;
+
+  if ( FILE_Debug )
+    {
+      Message("fileID = %d  Val     = %d",  fileptr->self, (int) fileptr->buffer[0]);
+      Message("fileID = %d  Start   = %ld", fileptr->self, fileptr->bufferStart);
+      Message("fileID = %d  End     = %ld", fileptr->self, fileptr->bufferEnd);
+      Message("fileID = %d  nread   = %ld", fileptr->self, nread);
+      Message("fileID = %d  offset  = %ld", fileptr->self, offset);
+      Message("fileID = %d  Pos     = %ld", fileptr->self, fileptr->bufferPos);
+      Message("fileID = %d  postion = %ld", fileptr->self, fileptr->position);
+    }
+
+  if ( offset > 0 )
+    {
+      if ( offset > nread )
+	Error("Internal problem with buffer handling. nread = %d offset = %d", nread, offset);
+
+      fileptr->bufferPtr += offset;
+      fileptr->bufferCnt -= offset;
+    }
+
+  fileptr->bufferNumFill++;
+
+  return ((unsigned char) *fileptr->bufferPtr);
+}
+
+static
+void file_copy_from_buffer(bfile_t *fileptr, void *ptr, size_t size)
+{
+  if ( FILE_Debug )
+    Message("size = %ld  Cnt = %ld", size, fileptr->bufferCnt);
+
+  if ( fileptr->bufferCnt < size )
+    Error("Buffer too small. bufferCnt = %d", fileptr->bufferCnt);
+
+  if ( size == 1 )
+    {
+      ((char *)ptr)[0] = fileptr->bufferPtr[0];
+
+      fileptr->bufferPtr++;
+      fileptr->bufferCnt--;
+    }
+  else
+    {
+      memcpy(ptr, fileptr->bufferPtr, size);
+
+      fileptr->bufferPtr += size;
+      fileptr->bufferCnt -= size;
+    }
+}
+
+static
+size_t file_read_from_buffer(bfile_t *fileptr, void *ptr, size_t size)
+{
+  size_t nread, rsize;
+  size_t offset = 0;
+
+  if ( FILE_Debug )
+    Message("size = %ld  Cnt = %d", size, (int) fileptr->bufferCnt);
+
+  if ( ((int)fileptr->bufferCnt) < 0 )
+    Error("Internal problem. bufferCnt = %d", (int) fileptr->bufferCnt);
+
+  rsize = size;
+
+  while ( fileptr->bufferCnt < rsize )
+    {
+      nread = fileptr->bufferCnt;
+      /*
+      fprintf(stderr, "rsize = %d nread = %d\n", (int) rsize, (int) nread);
+      */
+      if ( nread > (size_t) 0 )
+	file_copy_from_buffer(fileptr, (char *)ptr+offset, nread);
+      offset += nread;
+      if ( nread < rsize )
+	rsize -= nread;
+      else
+	rsize = 0;
+
+      if ( file_fill_buffer(fileptr) == EOF ) break;
+    }
+
+  nread = size - offset;
+
+  if ( fileptr->bufferCnt < nread ) nread = fileptr->bufferCnt;
+
+  if ( nread > (unsigned) 0 )
+    file_copy_from_buffer(fileptr, (char *)ptr+offset, nread);
+
+  return (nread+offset);
+}
+
+
+void fileSetBufferSize(int fileID, long buffersize)
+{
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) fileptr->bufferSize = buffersize;
+}
+
+/*
+ *   Open a file. Returns file ID, or -1 on error
+ */
+int fileOpen(const char *filename, const char *mode)
+{
+  FILE *fp = NULL;    /* file pointer    (used for write) */
+  int fd = -1;        /* file descriptor (used for read)  */
+  int fileID = FILE_UNDEFID;
+  int fmode = 0;
+  struct stat filestat;
+  bfile_t *fileptr = NULL;
+
+#ifdef USE_MPI
+  if ( mode[0] == 'w' && commInqIOMode () != PIO_NONE )
+      return pioFileOpenW ( filename );
+#endif
+
+  FILE_INIT();
+
+  fmode = tolower((int) mode[0]);
+
+  switch ( fmode )
+    {
+    case 'r':
+      if ( FileTypeEnv == FILE_TYPE_FOPEN )
+	fp = fopen(filename, "rb");
+      else
+	fd =  open(filename, O_RDONLY | O_BINARY);
+      break;
+    case 'x':  fp = fopen(filename, "rb");      break;
+    case 'w':  fp = fopen(filename, "wb");      break;
+    case 'a':  fp = fopen(filename, "ab");      break;
+    default:   Error("Mode %c unexpected!", fmode);
+    }
+
+  if ( FILE_Debug )
+    if ( fp == NULL && fd == -1 )
+      Message("Open failed on %s mode %c errno %d", filename, fmode, errno);
+
+  if ( fp )
+    {
+      if ( stat(filename, &filestat) != 0 ) return (fileID);
+
+      fileptr = file_new_entry();
+      if ( fileptr )
+	{
+	  fileID = fileptr->self;
+	  fileptr->fp = fp;
+	}
+    }
+  else if ( fd >= 0 )
+    {
+      if ( fstat(fd, &filestat) != 0 ) return (fileID);
+
+      fileptr = file_new_entry();
+      if ( fileptr )
+	{
+	  fileID = fileptr->self;
+	  fileptr->fd = fd;
+	}
+    }
+
+  if ( fileID >= 0 )
+    {
+      fileptr->mode = fmode;
+      fileptr->name = strdupx(filename);
+
+#if defined (HAVE_STRUCT_STAT_ST_BLKSIZE)
+      fileptr->blockSize = (size_t) filestat.st_blksize;
+#else
+      fileptr->blockSize = (size_t) 4096;
+#endif
+
+      if ( fmode == 'r' )
+	{
+	  if ( FileTypeEnv == FILE_TYPE_FOPEN )
+	    fileptr->type = FILE_TYPE_FOPEN;
+	  else
+	    fileptr->type = FILE_TYPE_OPEN;
+	}
+      else
+	fileptr->type = FILE_TYPE_FOPEN;
+
+      if ( fmode == 'r' ) fileptr->size = filestat.st_size;
+
+      if ( fileptr->type == FILE_TYPE_FOPEN ) file_set_buffer(fileptr);
+
+      if ( FILE_Debug )
+	Message("File %s opened with ID %d", filename, fileID);
+    }
+
+  return (fileID);
+}
+
+/*
+ *   Close a file.
+ */
+int fileClose(int fileID)
+{
+  char *name;
+  int ret;
+  char *fbtname[] = {"unknown", "standard", "mmap"};
+  char *ftname[] = {"unknown", "open", "fopen"};
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+#ifdef USE_MPI
+  if (((fileptr && fileptr->mode == 'w') || !fileptr)
+      && commInqIOMode () != PIO_NONE )
+    return pioFileClose ( fileID );
+#endif
+
+  if ( fileptr == NULL )
+    {
+      file_pointer_info(__func__, fileID);
+      return (1);
+    }
+
+  name = fileptr->name;
+
+  if ( FILE_Debug )
+    Message("fileID = %d  filename = %s", fileID, name);
+
+  if ( FileInfo > 0 )
+    {
+      fprintf(stderr, "____________________________________________\n");
+      fprintf(stderr, " file ID          : %d\n",  fileID);
+      fprintf(stderr, " file name        : %s\n",  fileptr->name);
+      fprintf(stderr, " file type        : %d (%s)\n", fileptr->type, ftname[fileptr->type]);
+
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	fprintf(stderr, " file descriptor  : %d\n",  fileptr->fd);
+      else
+	fprintf(stderr, " file pointer     : %p\n",  (void *) fileptr->fp);
+
+      fprintf(stderr, " file mode        : %c\n",  fileptr->mode);
+
+      if ( sizeof(off_t) > sizeof(long) )
+	{
+#if defined (_WIN32)
+	  fprintf(stderr, " file size        : %I64d\n", (long long) fileptr->size);
+	  if ( fileptr->type == FILE_TYPE_OPEN )
+	    fprintf(stderr, " file position    : %I64d\n", (long long) fileptr->position);
+	  fprintf(stderr, " bytes transfered : %I64d\n", (long long) fileptr->byteTrans);
+#else
+	  fprintf(stderr, " file size        : %lld\n", (long long) fileptr->size);
+	  if ( fileptr->type == FILE_TYPE_OPEN )
+	    fprintf(stderr, " file position    : %lld\n", (long long) fileptr->position);
+	  fprintf(stderr, " bytes transfered : %lld\n", (long long) fileptr->byteTrans);
+#endif
+	}
+      else
+	{
+	  fprintf(stderr, " file size        : %ld\n", (long) fileptr->size);
+	  if ( fileptr->type == FILE_TYPE_OPEN )
+	    fprintf(stderr, " file position    : %ld\n", (long) fileptr->position);
+	  fprintf(stderr, " bytes transfered : %ld\n", (long) fileptr->byteTrans);
+	}
+
+      fprintf(stderr, " file access      : %ld\n", fileptr->access);
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	{
+	  fprintf(stderr, " buffer type      : %d (%s)\n", fileptr->bufferType, fbtname[fileptr->bufferType]);
+	  fprintf(stderr, " num buffer fill  : %ld\n", fileptr->bufferNumFill);
+	}
+      fprintf(stderr, " buffer size      : %lu\n", (unsigned long) fileptr->bufferSize);
+      fprintf(stderr, " block size       : %lu\n", (unsigned long) fileptr->blockSize);
+#if defined (HAVE_MMAP)
+      fprintf(stderr, " page size        : %d\n",  pagesize());
+#endif
+      fprintf(stderr, "--------------------------------------------\n");
+    }
+
+  if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+    {
+#if defined (HAVE_MMAP)
+      if ( fileptr->buffer && fileptr->mappedSize )
+	{
+	  ret = munmap(fileptr->buffer, fileptr->mappedSize);
+	  if ( ret == -1 )
+	    SysError("munmap error for close %s", fileptr->name);
+	  fileptr->buffer = NULL;
+	}
+#endif
+      ret = close(fileptr->fd);
+      if ( ret == -1 )
+	SysError("EOF returned for close of %s!", name);
+    }
+  else
+    {
+      ret = fclose(fileptr->fp);
+      if ( ret == EOF )
+	SysError("EOF returned for close of %s!", name);
+    }
+
+  if ( fileptr->name )    free((void*) fileptr->name);
+  if ( fileptr->buffer )  free((void*) fileptr->buffer);
+
+  file_delete_entry(fileptr);
+
+  return (0);
+}
+
+
+int filePtrGetc(void *vfileptr)
+{
+  int ivalue = EOF;
+  int fillret = 0;
+  bfile_t *fileptr = (bfile_t *) vfileptr;
+
+  if ( fileptr )
+    {
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	{
+	  if ( fileptr->bufferCnt == 0 ) fillret = file_fill_buffer(fileptr);
+
+	  if ( fillret >= 0 )
+	    {
+	      ivalue = (unsigned char) *fileptr->bufferPtr++;
+	      fileptr->bufferCnt--;
+	      fileptr->position++;
+
+	      fileptr->byteTrans++;
+	      fileptr->access++;
+	    }
+	}
+      else
+	{
+	  ivalue = fgetc(fileptr->fp);
+	  if ( ivalue >= 0 )
+	    {
+	      fileptr->byteTrans++;
+	      fileptr->access++;
+	    }
+	  else
+	    fileptr->flag |= FILE_EOF;
+	}
+    }
+
+  return (ivalue);
+}
+
+
+int fileGetc(int fileID)
+{
+  int ivalue;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  ivalue = filePtrGetc((void *)fileptr);
+
+  return (ivalue);
+}
+
+
+size_t filePtrRead(void *vfileptr, void *restrict ptr, size_t size)
+{
+  size_t nread = 0;
+  bfile_t *fileptr = (bfile_t *) vfileptr;
+
+  if ( fileptr )
+    {
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	nread = file_read_from_buffer(fileptr, ptr, size);
+      else
+	{
+	  nread = fread(ptr, 1, size, fileptr->fp);
+	  if ( nread != size )
+	    {
+	      if ( nread == 0 )
+		fileptr->flag |= FILE_EOF;
+	      else
+		fileptr->flag |= FILE_ERROR;
+	    }
+	}
+
+      fileptr->position  += nread;
+      fileptr->byteTrans += nread;
+      fileptr->access++;
+    }
+
+  if ( FILE_Debug ) Message("size %ld  nread %ld", size, nread);
+
+  return (nread);
+}
+
+
+size_t fileRead(int fileID, void *restrict ptr, size_t size)
+{
+  size_t nread = 0;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr )
+    {
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	nread = file_read_from_buffer(fileptr, ptr, size);
+      else
+	{
+	  nread = fread(ptr, 1, size, fileptr->fp);
+	  if ( nread != size )
+	    {
+	      if ( nread == 0 )
+		fileptr->flag |= FILE_EOF;
+	      else
+		fileptr->flag |= FILE_ERROR;
+	    }
+	}
+
+      fileptr->position  += nread;
+      fileptr->byteTrans += nread;
+      fileptr->access++;
+    }
+
+  if ( FILE_Debug ) Message("size %ld  nread %ld", size, nread);
+
+  return (nread);
+}
+
+
+size_t fileWrite(int fileID, const void *restrict ptr, size_t size)
+{
+  size_t nwrite = 0;
+  FILE *fp;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr )
+    {
+      /* if ( fileptr->buffer == NULL ) file_set_buffer(fileptr); */
+
+      fp = fileptr->fp;
+
+      nwrite = fwrite(ptr, 1, size, fp);
+
+      fileptr->position  += nwrite;
+      fileptr->byteTrans += nwrite;
+      fileptr->access++;
+    }
+
+  return (nwrite);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+
+/* Automatically generated by m214003 at 2012-12-17, do not edit */
+
+/* CGRIBEXLIB_VERSION="1.5.6" */
+
+#ifdef _ARCH_PWR6
+#pragma options nostrict
+#endif
+
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <string.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <sys/types.h>
+
+
+
+#ifndef _GRIB_INT_H
+#define _GRIB_INT_H
+
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <float.h>
+
+
+#if ! defined   (_CGRIBEX_H)
+#endif
+#if ! defined   (_ERROR_H)
+#endif
+#if ! defined   (_DTYPES_H)
+#endif
+
+#if ! defined   (FALSE)
+#  define  FALSE  0
+#endif
+
+#if ! defined   (TRUE)
+#  define  TRUE  1
+#endif
+
+#if ! defined   (UCHAR)
+#  define  UCHAR  unsigned char
+#endif
+
+
+#if defined (CRAY) || defined (SX) || defined (__uxpch__)
+#  define VECTORCODE
+#endif
+
+#if defined (VECTORCODE)
+#if  defined  (INT32)
+#  define  GRIBPACK     unsigned INT32
+#  define  PACK_GRIB    packInt32
+#  define  UNPACK_GRIB  unpackInt32
+#else
+#  define  GRIBPACK     unsigned INT64
+#  define  PACK_GRIB    packInt64
+#  define  UNPACK_GRIB  unpackInt64
+#endif
+#else
+#  define  GRIBPACK     unsigned char
+#endif
+
+#define  U_BYTEORDER     static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1}
+#define  IS_BIGENDIAN()  (u_byteorder.c[sizeof(long) - 1])
+
+#if defined (__xlC__) /* performance problems on IBM */
+#ifndef DBL_IS_NAN
+#  define DBL_IS_NAN(x)     ((x) != (x))
+#endif
+#else
+#ifndef DBL_IS_NAN
+#if  defined  (HAVE_DECL_ISNAN)
+#  define DBL_IS_NAN(x)     (isnan(x))
+#elif  defined  (FP_NAN)
+#  define DBL_IS_NAN(x)     (fpclassify(x) == FP_NAN)
+#else
+#  define DBL_IS_NAN(x)     ((x) != (x))
+#endif
+#endif
+#endif
+
+#ifndef DBL_IS_EQUAL
+/*#define DBL_IS_EQUAL(x,y) (!(x < y || y < x)) */
+#  define DBL_IS_EQUAL(x,y) (DBL_IS_NAN(x)||DBL_IS_NAN(y)?(DBL_IS_NAN(x)&&DBL_IS_NAN(y)?1:0):!(x < y || y < x))
+#endif
+
+#ifndef IS_EQUAL
+#  define IS_NOT_EQUAL(x,y) (x < y || y < x)
+#  define IS_EQUAL(x,y)     (!IS_NOT_EQUAL(x,y))
+#endif
+
+
+#define  JP23SET    0x7FFFFF  /* 2**23 - 1 (---> 8388607)  */
+
+#define  POW_2_M24  0.000000059604644775390625  /*  pow(2.0, -24.0) */
+
+double intpow2(int x);
+
+int gribrec_len(int b1, int b2, int b3);
+int correct_bdslen(int bdslen, long recsize, long gribpos);
+
+/* CDI converter routines */
+
+/* param format:  DDDCCCNNN */
+
+void    cdiDecodeParam(int param, int *dis, int *cat, int *num);
+int     cdiEncodeParam(int dis, int cat, int num);
+
+/* date format:  YYYYMMDD */
+/* time format:  hhmmss   */
+
+void    cdiDecodeDate(int date, int *year, int *month, int *day);
+int     cdiEncodeDate(int year, int month, int day);
+
+void    cdiDecodeTime(int time, int *hour, int *minute, int *second);
+int     cdiEncodeTime(int hour, int minute, int second);
+
+/* CALENDAR types */
+
+#define  CALENDAR_STANDARD        0  /* don't change this value (used also in cgribexlib)! */
+#define  CALENDAR_PROLEPTIC       1
+#define  CALENDAR_360DAYS         2
+#define  CALENDAR_365DAYS         3
+#define  CALENDAR_366DAYS         4
+#define  CALENDAR_NONE            5
+
+extern FILE *grprsm;
+
+extern int  CGRIBEX_Debug;
+
+void   gprintf(const char *caller, const char *fmt, ...);
+
+void   grsdef(void);
+
+void   prtbin(int kin, int knbit, int *kout, int *kerr);
+void   confp3(double pval, int *kexp, int *kmant, int kbits, int kround);
+double decfp2(int kexp, int kmant);
+void   ref2ibm(double *pref, int kbits);
+
+void   scaleComplex(double *fpdata, int pcStart, int pcScale, int trunc, int inv);
+void   scatterComplex(double *fpdata, int pcStart, int trunc, int nsp);
+void   gatherComplex(double *fpdata, int pcStart, int trunc, int nsp);
+
+void   scm0(double *pdl, double *pdr, double *pfl, double *pfr, int klg);
+int    rowina2(double *p, int ko, int ki, double *pw,
+	       int kcode, double msval, int *kret);
+int    rowina3(double *p, int ko, int ki, double *pw,
+	       int kcode, double msval, int *kret, int omisng, int operio, int oveggy);
+int    qu2reg2(double *pfield, int *kpoint, int klat, int klon,
+	       double *ztemp, double msval, int *kret);
+int    qu2reg3(double *pfield, int *kpoint, int klat, int klon,
+	       double msval, int *kret, int omisng, int operio, int oveggy);
+
+#if  defined  (INT32)
+long   packInt32(unsigned INT32 *up, unsigned char *cp, long bc, long tc);
+#endif
+long   packInt64(unsigned INT64 *up, unsigned char *cp, long bc, long tc);
+#if  defined  (INT32)
+long   unpackInt32(unsigned char *cp, unsigned INT32 *up, long bc, long tc);
+#endif
+long   unpackInt64(unsigned char *cp, unsigned INT64 *up, long bc, long tc);
+
+void  gribEncode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+		 double *fsec3, int *isec4, double *fsec4, int klenp, int *kgrib,
+		 int kleng, int *kword, int efunc, int *kret);
+
+void  gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+		 double *fsec3, int *isec4, double *fsec4, int klenp, int *kgrib,
+		 int kleng, int *kword, int dfunc, int *kret);
+
+#endif  /* _GRIB_INT_H */
+#ifndef _GRIBDECODE_H
+#define _GRIBDECODE_H
+
+#define  UNDEFINED          9.999e20
+
+
+#define  GET_INT3(a,b,c)    ((1-(int) ((unsigned) (a & 128) >> 6)) * (int) (((a & 127) << 16)+(b<<8)+c))
+#define  GET_INT2(a,b)      ((1-(int) ((unsigned) (a & 128) >> 6)) * (int) (((a & 127) << 8) + b))
+#define  GET_INT1(a)        ((1-(int) ((unsigned) (a & 128) >> 6)) * (int) (a&127))
+
+/* this requires a 32-bit default integer machine */
+#define  GET_UINT4(a,b,c,d) ((int) ((a << 24) + (b << 16) + (c << 8) + (d)))
+#define  GET_UINT3(a,b,c)   ((int) ((a << 16) + (b << 8)  + (c)))
+#define  GET_UINT2(a,b)     ((int) ((a << 8)  + (b)))
+#define  GET_UINT1(a)       ((int)  (a))
+
+#define  BUDG_START(s)      (s[0]=='B' && s[1]=='U' && s[2]=='D' && s[3]=='G')
+#define  TIDE_START(s)      (s[0]=='T' && s[1]=='I' && s[2]=='D' && s[3]=='E')
+#define  GRIB_START(s)      (s[0]=='G' && s[1]=='R' && s[2]=='I' && s[3]=='B')
+#define  GRIB_FIN(s)        (s[0]=='7' && s[1]=='7' && s[2]=='7' && s[3]=='7')
+
+/* GRIB1 Section 0: Indicator Section (IS) */
+
+#define  GRIB1_SECLEN(s)     GET_INT3(s[ 4], s[ 5], s[ 6])
+#define  GRIB_EDITION(s)     GET_UINT1(s[ 7])
+
+/* GRIB1 Section 1: Product Definition Section (PDS) */
+
+#define  PDS_Len             GET_UINT3(pds[ 0], pds[ 1], pds[ 2])
+#define  PDS_CodeTable       GET_UINT1(pds[ 3])
+#define  PDS_CenterID        GET_UINT1(pds[ 4])
+#define  PDS_ModelID         GET_UINT1(pds[ 5])
+#define  PDS_GridDefinition  GET_UINT1(pds[ 6])
+#define  PDS_Sec2Or3Flag     GET_UINT1(pds[ 7])
+#define  PDS_HAS_GDS         ((pds[7] & 128) != 0)
+#define  PDS_HAS_BMS         ((pds[7] &  64) != 0)
+#define  PDS_Parameter       GET_UINT1(pds[ 8])
+#define  PDS_LevelType       GET_UINT1(pds[ 9])
+#define  PDS_Level1          (pds[10])
+#define  PDS_Level2	     (pds[11])
+#define  PDS_Level	     GET_UINT2(pds[10], pds[11])
+#define  PDS_Year            GET_INT1(pds[12])
+#define  PDS_Month           GET_UINT1(pds[13])
+#define  PDS_Day             GET_UINT1(pds[14])
+#define  PDS_Hour            GET_UINT1(pds[15])
+#define  PDS_Minute          GET_UINT1(pds[16])
+#define  PDS_Date            (PDS_Year*10000+PDS_Month*100+PDS_Day)
+#define  PDS_Time            (PDS_Hour*100+PDS_Minute)
+#define  PDS_TimeUnit        GET_UINT1(pds[17])
+#define  PDS_TimePeriod1     GET_UINT1(pds[18])
+#define  PDS_TimePeriod2     GET_UINT1(pds[19])
+#define  PDS_TimeRange       GET_UINT1(pds[20])
+#define  PDS_AvgNum          GET_UINT2(pds[21], pds[22])
+#define  PDS_AvgMiss         GET_UINT1(pds[23])
+#define  PDS_Century         GET_UINT1(pds[24])
+#define  PDS_Subcenter       GET_UINT1(pds[25])
+#define  PDS_DecimalScale    GET_INT2(pds[26],pds[27])
+
+
+/* GRIB1 Section 2: Grid Description Section (GDS) */
+
+#define  GDS_Len             ((gds) == NULL ? 0 : GET_UINT3(gds[ 0], gds[ 1], gds[ 2]))
+#define  GDS_NV              GET_UINT1(gds[ 3])
+#define  GDS_PVPL            GET_UINT1(gds[ 4])
+#define  GDS_PV	             ((gds[3] ==    0) ? -1 : (int) gds[4] - 1)
+#define  GDS_PL	             ((gds[4] == 0xFF) ? -1 : (int) gds[3] * 4 + (int) gds[4] - 1)
+#define  GDS_GridType        GET_UINT1(gds[ 5])
+
+
+/* GRIB1 Triangular grid of DWD */
+#define  GDS_GME_NI2         GET_UINT2(gds[ 6], gds[ 7])
+#define  GDS_GME_NI3         GET_UINT2(gds[ 8], gds[ 9])
+#define  GDS_GME_ND          GET_UINT3(gds[10], gds[11], gds[12])
+#define  GDS_GME_NI          GET_UINT3(gds[13], gds[14], gds[15])
+#define  GDS_GME_AFlag       GET_UINT1(gds[16])
+#define  GDS_GME_LatPP       GET_INT3(gds[17], gds[18], gds[19])
+#define  GDS_GME_LonPP       GET_INT3(gds[20], gds[21], gds[22])
+#define  GDS_GME_LonMPL      GET_INT3(gds[23], gds[24], gds[25])
+#define  GDS_GME_BFlag       GET_UINT1(gds[27])
+
+/* GRIB1 Spectral */
+#define  GDS_PentaJ          GET_UINT2(gds[ 6], gds[ 7])
+#define  GDS_PentaK          GET_UINT2(gds[ 8], gds[ 9])
+#define  GDS_PentaM          GET_UINT2(gds[10], gds[11])
+#define  GDS_RepType         GET_UINT1(gds[12])
+#define  GDS_RepMode         GET_UINT1(gds[13])
+
+/* GRIB1 Regular grid */
+#define  GDS_NumLon          GET_UINT2(gds[ 6], gds[ 7])
+#define  GDS_NumLat          GET_UINT2(gds[ 8], gds[ 9])
+#define  GDS_FirstLat        GET_INT3(gds[10], gds[11], gds[12])
+#define  GDS_FirstLon        GET_INT3(gds[13], gds[14], gds[15])
+#define  GDS_ResFlag         GET_UINT1(gds[16])
+#define  GDS_LastLat         GET_INT3(gds[17], gds[18], gds[19])
+#define  GDS_LastLon         GET_INT3(gds[20], gds[21], gds[22])
+#define  GDS_LonIncr         GET_UINT2(gds[23], gds[24])
+#define  GDS_LatIncr         GET_UINT2(gds[25], gds[26])
+#define  GDS_NumPar          GET_UINT2(gds[25], gds[26])
+#define  GDS_ScanFlag        GET_UINT1(gds[27])
+#define  GDS_LatSP           GET_INT3(gds[32], gds[33], gds[34])
+#define  GDS_LonSP           GET_INT3(gds[35], gds[36], gds[37])
+#define  GDS_RotAngle        GET_Real(&(gds[38]))
+
+/* GRIB1 Lambert */
+#define  GDS_Lambert_Lov     GET_INT3(gds[17], gds[18], gds[19])
+#define  GDS_Lambert_dx	     GET_INT3(gds[20], gds[21], gds[22])
+#define  GDS_Lambert_dy	     GET_INT3(gds[23], gds[24], gds[25])
+#define  GDS_Lambert_ProjFlag GET_UINT1(gds[26])
+#define  GDS_Lambert_LatS1   GET_INT3(gds[28], gds[29], gds[30])
+#define  GDS_Lambert_LatS2   GET_INT3(gds[31], gds[32], gds[33])
+#define  GDS_Lambert_LatSP   GET_INT3(gds[34], gds[35], gds[36])
+#define  GDS_Lambert_LonSP   GET_INT3(gds[37], gds[37], gds[37])
+
+/* GRIB1 Section 3: Bit Map Section (BMS) */
+
+#define  BMS_Len	     ((bms) == NULL ? 0 : (int) (bms[0]<<16)+(bms[1]<<8)+bms[2])
+#define  BMS_UnusedBits      (bms[3])
+#define  BMS_Numeric         
+#define  BMS_Bitmap	     ((bms) == NULL ? NULL : (bms)+6)
+#define  BMS_BitmapSize      (((((bms[0]<<16)+(bms[1]<<8)+bms[2]) - 6)<<3) - bms[3])
+
+/* GRIB1 Section 4: Binary Data Section (BDS) */
+
+#define  BDS_Len	    ((int) ((bds[0]<<16)+(bds[1]<<8)+bds[2]))
+#define  BDS_Flag	    (bds[3])
+#define  BDS_BinScale       GET_INT2(bds[ 4], bds[ 5])
+#define  BDS_RefValue       decfp2((int)bds[ 6], GET_UINT3(bds[ 7], bds[ 8], bds[ 9]))
+#define  BDS_NumBits        ((int) bds[10])
+#define  BDS_RealCoef       decfp2((int)bds[zoff+11], GET_UINT3(bds[zoff+12], bds[zoff+13], bds[zoff+14]))
+#define  BDS_PackData       ((int) ((bds[zoff+11]<<8) + bds[zoff+12]))
+#define  BDS_Power          GET_INT2(bds[zoff+13], bds[zoff+14])
+#define  BDS_Z              (bds[13])
+
+/* GRIB1 Section 5: End Section (ES) */
+
+/* GRIB2 */
+
+#define  GRIB2_SECLEN(section)   (GET_UINT4(section[0], section[1], section[2], section[3]))
+#define  GRIB2_SECNUM(section)   (GET_UINT1(section[4]))
+
+#endif  /* _GRIBDECODE_H */
+#ifndef _GRIBENCODE_H
+#define _GRIBENCODE_H
+
+
+#define PutnZero(n) \
+{ \
+  int i; \
+  for ( i = z; i < z+n; i++ ) lGrib[i] = 0; \
+  z += n; \
+}
+
+#define Put1Byte(Value)  (lGrib[z++] = (Value))
+#define Put2Byte(Value) ((lGrib[z++] = (Value) >>  8), \
+                         (lGrib[z++] = (Value)))
+#define Put3Byte(Value) ((lGrib[z++] = (Value) >> 16), \
+                         (lGrib[z++] = (Value) >>  8), \
+                         (lGrib[z++] = (Value)))
+#define Put4Byte(Value) ((lGrib[z++] = (Value) >> 24), \
+                         (lGrib[z++] = (Value) >> 16), \
+                         (lGrib[z++] = (Value) >>  8), \
+                         (lGrib[z++] = (Value)))
+
+#define Put1Int(Value)  {ival = Value; if ( ival < 0 ) ival =     0x80 - ival; Put1Byte(ival);}
+#define Put2Int(Value)  {ival = Value; if ( ival < 0 ) ival =   0x8000 - ival; Put2Byte(ival);}
+#define Put3Int(Value)  {ival = Value; if ( ival < 0 ) ival = 0x800000 - ival; Put3Byte(ival);}
+
+#define Put1Real(Value)          \
+{                                \
+  confp3(Value, &exponent, &mantissa, BitsPerInt, 1); \
+  Put1Byte(exponent);            \
+  Put3Byte(mantissa);            \
+}
+
+#endif  /* _GRIBENCODE_H */
+#include <stdio.h>
+#include <math.h>
+
+
+double _pow2tab[158] = {
+ /* pow(2.0,  0.0) */  1.0,
+ /* pow(2.0,  1.0) */  2.0,
+ /* pow(2.0,  2.0) */  4.0,
+ /* pow(2.0,  3.0) */  8.0,
+ /* pow(2.0,  4.0) */  16.0,
+ /* pow(2.0,  5.0) */  32.0,
+ /* pow(2.0,  6.0) */  64.0,
+ /* pow(2.0,  7.0) */  128.0,
+ /* pow(2.0,  8.0) */  256.0,
+ /* pow(2.0,  9.0) */  512.0,
+ /* pow(2.0, 10.0) */  1024.0,
+ /* pow(2.0, 11.0) */  2048.0,
+ /* pow(2.0, 12.0) */  4096.0,
+ /* pow(2.0, 13.0) */  8192.0,
+ /* pow(2.0, 14.0) */  16384.0,
+ /* pow(2.0, 15.0) */  32768.0,
+ /* pow(2.0, 16.0) */  65536.0,
+ /* pow(2.0, 17.0) */  131072.0,
+ /* pow(2.0, 18.0) */  262144.0,
+ /* pow(2.0, 19.0) */  524288.0,
+ /* pow(2.0, 20.0) */  1048576.0,
+ /* pow(2.0, 21.0) */  2097152.0,
+ /* pow(2.0, 22.0) */  4194304.0,
+ /* pow(2.0, 23.0) */  8388608.0,
+ /* pow(2.0, 24.0) */  16777216.0,
+ /* pow(2.0, 25.0) */  33554432.0,
+ /* pow(2.0, 26.0) */  67108864.0,
+ /* pow(2.0, 27.0) */  134217728.0,
+ /* pow(2.0, 28.0) */  268435456.0,
+ /* pow(2.0, 29.0) */  536870912.0,
+ /* pow(2.0, 30.0) */  1073741824.0,
+ /* pow(2.0, 31.0) */  2147483648.0,
+ /* pow(2.0, 32.0) */  4294967296.0,
+ /* pow(2.0, 33.0) */  8589934592.0,
+ /* pow(2.0, 34.0) */  17179869184.0,
+ /* pow(2.0, 35.0) */  34359738368.0,
+ /* pow(2.0, 36.0) */  68719476736.0,
+ /* pow(2.0, 37.0) */  137438953472.0,
+ /* pow(2.0, 38.0) */  274877906944.0,
+ /* pow(2.0, 39.0) */  549755813888.0,
+ /* pow(2.0, 40.0) */  1099511627776.0,
+ /* pow(2.0, 41.0) */  2199023255552.0,
+ /* pow(2.0, 42.0) */  4398046511104.0,
+ /* pow(2.0, 43.0) */  8796093022208.0,
+ /* pow(2.0, 44.0) */  17592186044416.0,
+ /* pow(2.0, 45.0) */  35184372088832.0,
+ /* pow(2.0, 46.0) */  70368744177664.0,
+ /* pow(2.0, 47.0) */  140737488355328.0,
+ /* pow(2.0, 48.0) */  281474976710656.0,
+ /* pow(2.0, 49.0) */  562949953421312.0,
+ /* pow(2.0, 50.0) */  1125899906842624.0,
+ /* pow(2.0, 51.0) */  2251799813685248.0,
+ /* pow(2.0, 52.0) */  4503599627370496.0,
+ /* pow(2.0, 53.0) */  9007199254740992.0,
+ /* pow(2.0, 54.0) */  18014398509481984.0,
+ /* pow(2.0, 55.0) */  36028797018963968.0,
+ /* pow(2.0, 56.0) */  72057594037927936.0,
+ /* pow(2.0, 57.0) */  144115188075855872.0,
+ /* pow(2.0, 58.0) */  288230376151711744.0,
+ /* pow(2.0, 59.0) */  576460752303423488.0,
+ /* pow(2.0, 60.0) */  1152921504606846976.0,
+ /* pow(2.0, 61.0) */  2305843009213693952.0,
+ /* pow(2.0, 62.0) */  4611686018427387904.0,
+ /* pow(2.0, 63.0) */  9223372036854775808.0,
+ /* pow(2.0, 64.0) */  18446744073709551616.0,
+ /* pow(2.0, 65.0) */  36893488147419103232.0,
+ /* pow(2.0, 66.0) */  73786976294838206464.0,
+ /* pow(2.0, 67.0) */  147573952589676412928.0,
+ /* pow(2.0, 68.0) */  295147905179352825856.0,
+ /* pow(2.0, 69.0) */  590295810358705651712.0,
+ /* pow(2.0, 70.0) */  1180591620717411303424.0,
+ /* pow(2.0, 71.0) */  2361183241434822606848.0,
+ /* pow(2.0, 72.0) */  4722366482869645213696.0,
+ /* pow(2.0, 73.0) */  9444732965739290427392.0,
+ /* pow(2.0, 74.0) */  18889465931478580854784.0,
+ /* pow(2.0, 75.0) */  37778931862957161709568.0,
+ /* pow(2.0, 76.0) */  75557863725914323419136.0,
+ /* pow(2.0, 77.0) */  151115727451828646838272.0,
+ /* pow(2.0, 78.0) */  302231454903657293676544.0,
+ /* pow(2.0, 79.0) */  604462909807314587353088.0,
+ /* pow(2.0, 80.0) */  1208925819614629174706176.0,
+ /* pow(2.0, 81.0) */  2417851639229258349412352.0,
+ /* pow(2.0, 82.0) */  4835703278458516698824704.0,
+ /* pow(2.0, 83.0) */  9671406556917033397649408.0,
+ /* pow(2.0, 84.0) */  19342813113834066795298816.0,
+ /* pow(2.0, 85.0) */  38685626227668133590597632.0,
+ /* pow(2.0, 86.0) */  77371252455336267181195264.0,
+ /* pow(2.0, 87.0) */  154742504910672534362390528.0,
+ /* pow(2.0, 88.0) */  309485009821345068724781056.0,
+ /* pow(2.0, 89.0) */  618970019642690137449562112.0,
+ /* pow(2.0, 90.0) */  1237940039285380274899124224.0,
+ /* pow(2.0, 91.0) */  2475880078570760549798248448.0,
+ /* pow(2.0, 92.0) */  4951760157141521099596496896.0,
+ /* pow(2.0, 93.0) */  9903520314283042199192993792.0,
+ /* pow(2.0, 94.0) */  19807040628566084398385987584.0,
+ /* pow(2.0, 95.0) */  39614081257132168796771975168.0,
+ /* pow(2.0, 96.0) */  79228162514264337593543950336.0,
+ /* pow(2.0, 97.0) */  158456325028528675187087900672.0,
+ /* pow(2.0, 98.0) */  316912650057057350374175801344.0,
+ /* pow(2.0, 99.0) */  633825300114114700748351602688.0,
+ /* pow(2.0, 100.0) */  1267650600228229401496703205376.0,
+ /* pow(2.0, 101.0) */  2535301200456458802993406410752.0,
+ /* pow(2.0, 102.0) */  5070602400912917605986812821504.0,
+ /* pow(2.0, 103.0) */  10141204801825835211973625643008.0,
+ /* pow(2.0, 104.0) */  20282409603651670423947251286016.0,
+ /* pow(2.0, 105.0) */  40564819207303340847894502572032.0,
+ /* pow(2.0, 106.0) */  81129638414606681695789005144064.0,
+ /* pow(2.0, 107.0) */  162259276829213363391578010288128.0,
+ /* pow(2.0, 108.0) */  324518553658426726783156020576256.0,
+ /* pow(2.0, 109.0) */  649037107316853453566312041152512.0,
+ /* pow(2.0, 110.0) */  1298074214633706907132624082305024.0,
+ /* pow(2.0, 111.0) */  2596148429267413814265248164610048.0,
+ /* pow(2.0, 112.0) */  5192296858534827628530496329220096.0,
+ /* pow(2.0, 113.0) */  10384593717069655257060992658440192.0,
+ /* pow(2.0, 114.0) */  20769187434139310514121985316880384.0,
+ /* pow(2.0, 115.0) */  41538374868278621028243970633760768.0,
+ /* pow(2.0, 116.0) */  83076749736557242056487941267521536.0,
+ /* pow(2.0, 117.0) */  166153499473114484112975882535043072.0,
+ /* pow(2.0, 118.0) */  332306998946228968225951765070086144.0,
+ /* pow(2.0, 119.0) */  664613997892457936451903530140172288.0,
+ /* pow(2.0, 120.0) */  1329227995784915872903807060280344576.0,
+ /* pow(2.0, 121.0) */  2658455991569831745807614120560689152.0,
+ /* pow(2.0, 122.0) */  5316911983139663491615228241121378304.0,
+ /* pow(2.0, 123.0) */  10633823966279326983230456482242756608.0,
+ /* pow(2.0, 124.0) */  21267647932558653966460912964485513216.0,
+ /* pow(2.0, 125.0) */  42535295865117307932921825928971026432.0,
+ /* pow(2.0, 126.0) */  85070591730234615865843651857942052864.0,
+ /* pow(2.0, 127.0) */  170141183460469231731687303715884105728.0,
+ /* pow(2.0, 128.0) */  340282366920938463463374607431768211456.0,
+ /* pow(2.0, 129.0) */  680564733841876926926749214863536422912.0,
+ /* pow(2.0, 130.0) */  1361129467683753853853498429727072845824.0,
+ /* pow(2.0, 131.0) */  2722258935367507707706996859454145691648.0,
+ /* pow(2.0, 132.0) */  5444517870735015415413993718908291383296.0,
+ /* pow(2.0, 133.0) */  10889035741470030830827987437816582766592.0,
+ /* pow(2.0, 134.0) */  21778071482940061661655974875633165533184.0,
+ /* pow(2.0, 135.0) */  43556142965880123323311949751266331066368.0,
+ /* pow(2.0, 136.0) */  87112285931760246646623899502532662132736.0,
+ /* pow(2.0, 137.0) */  174224571863520493293247799005065324265472.0,
+ /* pow(2.0, 138.0) */  348449143727040986586495598010130648530944.0,
+ /* pow(2.0, 139.0) */  696898287454081973172991196020261297061888.0,
+ /* pow(2.0, 140.0) */  1393796574908163946345982392040522594123776.0,
+ /* pow(2.0, 141.0) */  2787593149816327892691964784081045188247552.0,
+ /* pow(2.0, 142.0) */  5575186299632655785383929568162090376495104.0,
+ /* pow(2.0, 143.0) */  11150372599265311570767859136324180752990208.0,
+ /* pow(2.0, 144.0) */  22300745198530623141535718272648361505980416.0,
+ /* pow(2.0, 145.0) */  44601490397061246283071436545296723011960832.0,
+ /* pow(2.0, 146.0) */  89202980794122492566142873090593446023921664.0,
+ /* pow(2.0, 147.0) */  178405961588244985132285746181186892047843328.0,
+ /* pow(2.0, 148.0) */  356811923176489970264571492362373784095686656.0,
+ /* pow(2.0, 149.0) */  713623846352979940529142984724747568191373312.0,
+ /* pow(2.0, 150.0) */  1427247692705959881058285969449495136382746624.0,
+ /* pow(2.0, 151.0) */  2854495385411919762116571938898990272765493248.0,
+ /* pow(2.0, 152.0) */  5708990770823839524233143877797980545530986496.0,
+ /* pow(2.0, 153.0) */  11417981541647679048466287755595961091061972992.0,
+ /* pow(2.0, 154.0) */  22835963083295358096932575511191922182123945984.0,
+ /* pow(2.0, 155.0) */  45671926166590716193865151022383844364247891968.0,
+ /* pow(2.0, 156.0) */  91343852333181432387730302044767688728495783936.0,
+ /* pow(2.0, 157.0) */  182687704666362864775460604089535377456991567872.0,
+};
+
+
+double _pow16tab[71] = {
+ /* pow(16.0,  0.0) */  1.0,
+ /* pow(16.0,  1.0) */  16.0,
+ /* pow(16.0,  2.0) */  256.0,
+ /* pow(16.0,  3.0) */  4096.0,
+ /* pow(16.0,  4.0) */  65536.0,
+ /* pow(16.0,  5.0) */  1048576.0,
+ /* pow(16.0,  6.0) */  16777216.0,
+ /* pow(16.0,  7.0) */  268435456.0,
+ /* pow(16.0,  8.0) */  4294967296.0,
+ /* pow(16.0,  9.0) */  68719476736.0,
+ /* pow(16.0, 10.0) */  1099511627776.0,
+ /* pow(16.0, 11.0) */  17592186044416.0,
+ /* pow(16.0, 12.0) */  281474976710656.0,
+ /* pow(16.0, 13.0) */  4503599627370496.0,
+ /* pow(16.0, 14.0) */  72057594037927936.0,
+ /* pow(16.0, 15.0) */  1152921504606846976.0,
+ /* pow(16.0, 16.0) */  18446744073709551616.0,
+ /* pow(16.0, 17.0) */  295147905179352825856.0,
+ /* pow(16.0, 18.0) */  4722366482869645213696.0,
+ /* pow(16.0, 19.0) */  75557863725914323419136.0,
+ /* pow(16.0, 20.0) */  1208925819614629174706176.0,
+ /* pow(16.0, 21.0) */  19342813113834066795298816.0,
+ /* pow(16.0, 22.0) */  309485009821345068724781056.0,
+ /* pow(16.0, 23.0) */  4951760157141521099596496896.0,
+ /* pow(16.0, 24.0) */  79228162514264337593543950336.0,
+ /* pow(16.0, 25.0) */  1267650600228229401496703205376.0,
+ /* pow(16.0, 26.0) */  20282409603651670423947251286016.0,
+ /* pow(16.0, 27.0) */  324518553658426726783156020576256.0,
+ /* pow(16.0, 28.0) */  5192296858534827628530496329220096.0,
+ /* pow(16.0, 29.0) */  83076749736557242056487941267521536.0,
+ /* pow(16.0, 30.0) */  1329227995784915872903807060280344576.0,
+ /* pow(16.0, 31.0) */  21267647932558653966460912964485513216.0,
+ /* pow(16.0, 32.0) */  340282366920938463463374607431768211456.0,
+ /* pow(16.0, 33.0) */  5444517870735015415413993718908291383296.0,
+ /* pow(16.0, 34.0) */  87112285931760246646623899502532662132736.0,
+ /* pow(16.0, 35.0) */  1393796574908163946345982392040522594123776.0,
+ /* pow(16.0, 36.0) */  22300745198530623141535718272648361505980416.0,
+ /* pow(16.0, 37.0) */  356811923176489970264571492362373784095686656.0,
+ /* pow(16.0, 38.0) */  5708990770823839524233143877797980545530986496.0,
+ /* pow(16.0, 39.0) */  91343852333181432387730302044767688728495783936.0,
+ /* pow(16.0, 40.0) */  1461501637330902918203684832716283019655932542976.0,
+ /* pow(16.0, 41.0) */  23384026197294446691258957323460528314494920687616.0,
+ /* pow(16.0, 42.0) */  374144419156711147060143317175368453031918731001856.0,
+ /* pow(16.0, 43.0) */  5986310706507378352962293074805895248510699696029696.0,
+ /* pow(16.0, 44.0) */  95780971304118053647396689196894323976171195136475136.0,
+ /* pow(16.0, 45.0) */  1532495540865888858358347027150309183618739122183602176.0,
+ /* pow(16.0, 46.0) */  24519928653854221733733552434404946937899825954937634816.0,
+ /* pow(16.0, 47.0) */  392318858461667547739736838950479151006397215279002157056.0,
+ /* pow(16.0, 48.0) */  6277101735386680763835789423207666416102355444464034512896.0,
+ /* pow(16.0, 49.0) */  100433627766186892221372630771322662657637687111424552206336.0,
+ /* pow(16.0, 50.0) */  1606938044258990275541962092341162602522202993782792835301376.0,
+ /* pow(16.0, 51.0) */  25711008708143844408671393477458601640355247900524685364822016.0,
+ /* pow(16.0, 52.0) */  411376139330301510538742295639337626245683966408394965837152256.0,
+ /* pow(16.0, 53.0) */  6582018229284824168619876730229402019930943462534319453394436096.0,
+ /* pow(16.0, 54.0) */  105312291668557186697918027683670432318895095400549111254310977536.0,
+ /* pow(16.0, 55.0) */  1684996666696914987166688442938726917102321526408785780068975640576.0,
+ /* pow(16.0, 56.0) */  26959946667150639794667015087019630673637144422540572481103610249216.0,
+ /* pow(16.0, 57.0) */  431359146674410236714672241392314090778194310760649159697657763987456.0,
+ /* pow(16.0, 58.0) */  6901746346790563787434755862277025452451108972170386555162524223799296.0,
+ /* pow(16.0, 59.0) */  110427941548649020598956093796432407239217743554726184882600387580788736.0,
+ /* pow(16.0, 60.0) */  1766847064778384329583297500742918515827483896875618958121606201292619776.0,
+ /* pow(16.0, 61.0) */  28269553036454149273332760011886696253239742350009903329945699220681916416.0,
+ /* pow(16.0, 62.0) */  452312848583266388373324160190187140051835877600158453279131187530910662656.0,
+ /* pow(16.0, 63.0) */  7237005577332262213973186563042994240829374041602535252466099000494570602496.0,
+ /* pow(16.0, 64.0) */  115792089237316195423570985008687907853269984665640564039457584007913129639936.0,
+ /* pow(16.0, 65.0) */  1852673427797059126777135760139006525652319754650249024631321344126610074238976.0,
+ /* pow(16.0, 66.0) */  29642774844752946028434172162224104410437116074403984394101141506025761187823616.0,
+ /* pow(16.0, 67.0) */  474284397516047136454946754595585670566993857190463750305618264096412179005177856.0,
+ /* pow(16.0, 68.0) */  7588550360256754183279148073529370729071901715047420004889892225542594864082845696.0,
+ /* pow(16.0, 69.0) */  121416805764108066932466369176469931665150427440758720078238275608681517825325531136.0,
+ /* pow(16.0, 70.0) */  1942668892225729070919461906823518906642406839052139521251812409738904285205208498176.0,
+};
+
+static int _pow2tab_size = sizeof(_pow2tab)/sizeof(double);
+
+void gen_pow2tab(void)
+{
+  int jloop;
+
+  for ( jloop = 0; jloop < 158; jloop++ )
+    printf(" /* pow(2.0, %2d.0) */  %.1f,\n", jloop,  pow(2.0, (double) jloop));
+}
+
+
+void gen_pow16tab(void)
+{
+  double pval;
+  int iexp;
+
+  for ( iexp = 0; iexp < 71; iexp++ )
+    {
+      pval = pow(16.0, (double)(iexp));
+      printf(" /* pow(16.0, %2d.0) */  %.1f,\n", iexp, pval);
+    }
+}
+
+
+double intpow2(int x)
+{
+  if ( x < _pow2tab_size )
+    return (_pow2tab[x]);
+  else
+    return (pow(2.0, (double) x));
+}
+//#undef _GET_X86_COUNTER
+//#undef _GET_IBM_COUNTER
+//#undef _GET_MACH_COUNTER
+//#undef _ARCH_PWR6
+
+#if   defined(__GNUC__) && (__GNUC__ >= 4)
+#elif defined(__ICC)    && (__ICC >= 1100)
+#elif defined(__clang__)
+#else
+#define DISABLE_SIMD
+#endif
+
+#if defined _GET_IBM_COUNTER
+#include <libhpc.h>
+#elif defined _GET_X86_COUNTER
+#include <x86intrin.h>
+#elif defined _GET_MACH_COUNTER
+#include <mach/mach_time.h>
+#endif
+
+//#define DISABLE_SIMD
+
+#ifdef DISABLE_SIMD
+#ifndef ENABLE_AVX
+#undef __AVX__
+#endif
+#ifndef ENABLE_SSE2
+#undef __SSE2__
+#endif
+#endif
+
+#if defined __AVX__
+#include <float.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <immintrin.h>
+#elif defined __SSE2__
+#include <float.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <emmintrin.h>
+#endif
+
+#if defined __AVX__
+
+static
+void avx_minmax_val(const double *restrict buf, size_t nframes, double *min, double *max)
+{
+  double fmin[4], fmax[4];
+  __m256d current_max, current_min, work;
+
+  // load max and min values into all four slots of the YMM registers
+  current_min = _mm256_set1_pd(*min);
+  current_max = _mm256_set1_pd(*max);
+
+  // Work input until "buf" reaches 32 byte alignment
+  while ( ((unsigned long)buf) % 32 != 0 && nframes > 0) {
+
+    // Load the next double into the work buffer
+    work = _mm256_set1_pd(*buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf++;
+    nframes--;
+  }
+
+  while (nframes >= 16) {
+
+    (void) _mm_prefetch(buf+8, _MM_HINT_NTA);
+
+    work = _mm256_load_pd(buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf += 4;
+
+    work = _mm256_load_pd(buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf += 4;
+
+    (void) _mm_prefetch(buf+8, _MM_HINT_NTA);
+
+    work = _mm256_load_pd(buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf += 4;
+
+    work = _mm256_load_pd(buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf += 4;
+    nframes -= 16;
+  }
+
+  // work through aligned buffers
+  while (nframes >= 4) {
+    work = _mm256_load_pd(buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf += 4;
+    nframes -= 4;
+  }
+
+  // work through the remainung values
+  while ( nframes > 0) {
+    work = _mm256_set1_pd(*buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf++;
+    nframes--;
+  }
+
+  // find min & max value through shuffle tricks
+
+  work = current_min;
+  work = _mm256_shuffle_pd(work, work, 5);
+  work = _mm256_min_pd (work, current_min);
+  current_min = work;
+  work = _mm256_permute2f128_pd(work, work, 1);
+  work = _mm256_min_pd (work, current_min);
+  _mm256_storeu_pd(fmin, work);
+
+  work = current_max;
+  work = current_max;
+  work = _mm256_shuffle_pd(work, work, 5);
+  work = _mm256_max_pd (work, current_max);
+  current_max = work;
+  work = _mm256_permute2f128_pd(work, work, 1);
+  work = _mm256_max_pd (work, current_max);
+  _mm256_storeu_pd(fmax, work);
+
+  *min = fmin[0];
+  *max = fmax[0];
+
+  return;
+}
+
+#elif defined __SSE2__
+
+static
+void sse2_minmax_val(const double *restrict buf, size_t nframes, double *min, double *max)
+{
+  __m128d current_max, current_min, work;
+  
+  // load starting max and min values into all slots of the XMM registers
+  current_min = _mm_set1_pd(*min);
+  current_max = _mm_set1_pd(*max);
+  
+  // work on input until buf reaches 16 byte alignment
+  while ( ((unsigned long)buf) % 16 != 0 && nframes > 0) {
+    
+    // load one double and replicate
+    work = _mm_set1_pd(*buf);    
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);    
+    buf++;
+    nframes--;
+  }
+  
+  while (nframes >= 8) {
+    // use 64 byte prefetch for double octetts
+    // __builtin_prefetch(buf+64,0,0); // for GCC 4.3.2 +
+
+    work = _mm_load_pd(buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf += 2;
+    work = _mm_load_pd(buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf += 2;
+    work = _mm_load_pd(buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf += 2;
+    work = _mm_load_pd(buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf += 2;
+    nframes -= 8;
+  }
+
+  // work through smaller chunks of aligned buffers without prefetching
+  while (nframes >= 2) {
+    work = _mm_load_pd(buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf += 2;
+    nframes -= 2;
+  }
+
+  // work through the remaining value
+  while ( nframes > 0) {
+    // load the last double and replicate
+    work = _mm_set1_pd(*buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf++;
+    nframes--;
+  }
+
+  // find final min and max value through shuffle tricks
+  work = current_min;
+  work = _mm_shuffle_pd(work, work, _MM_SHUFFLE2(0, 1));
+  work = _mm_min_pd (work, current_min);
+  _mm_store_sd(min, work);
+  work = current_max;
+  work = _mm_shuffle_pd(work, work, _MM_SHUFFLE2(0, 1));
+  work = _mm_max_pd (work, current_max);
+  _mm_store_sd(max, work);
+
+  return;
+}
+
+#endif
+
+static
+void minmax_val(const double *restrict data, long idatasize, double *fmin, double *fmax)
+{
+#if defined _GET_X86_COUNTER || defined _GET_MACH_COUNTER 
+  uint64_t start_minmax, end_minmax;
+#endif
+  size_t datasize = idatasize;
+
+  if ( idatasize < 1 ) return;
+
+#ifdef _GET_X86_COUNTER 
+  start_minmax = _rdtsc();
+#endif
+#ifdef _GET_MACH_COUNTER 
+  start_minmax = mach_absolute_time();
+#endif
+
+#if defined __AVX__
+
+  avx_minmax_val(data, datasize, fmin, fmax);
+
+#elif defined __SSE2__
+
+  sse2_minmax_val(data, datasize, fmin, fmax);
+
+#else
+
+#ifdef _ARCH_PWR6
+#define __UNROLL_DEPTH_1 6
+
+  // to allow pipelining we have to unroll 
+
+#ifdef _GET_IBM_COUNTER 
+  hpmStart(1, "minmax fsel");
+#endif
+  {
+    size_t i, j;
+    size_t residual =  datasize % __UNROLL_DEPTH_1;
+    size_t ofs = datasize - residual;
+    double register dmin[__UNROLL_DEPTH_1];
+    double register dmax[__UNROLL_DEPTH_1];
+
+    for ( j = 0; j < __UNROLL_DEPTH_1; j++) 
+      {
+	dmin[j] = data[0];
+	dmax[j] = data[0];
+      }
+    
+    for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_1 ) 
+      {
+	for (j = 0; j < __UNROLL_DEPTH_1; j++) 
+	  {
+	    dmin[j] = __fsel(dmin[j] - data[i+j], data[i+j], dmin[j]);
+	    dmax[j] = __fsel(data[i+j] - dmax[j], data[i+j], dmax[j]);
+	  }
+      }
+
+    for (j = 0; j < residual; j++) 
+      {
+	dmin[j] = __fsel(dmin[j] - data[ofs+j], data[ofs+j], dmin[j]);
+	dmax[j] = __fsel(data[ofs+j] - dmax[j], data[ofs+j], dmax[j]);
+      }
+
+    for ( j = 0; j < __UNROLL_DEPTH_1; j++) 
+      {
+	*fmin = __fsel(*fmin - dmin[j], dmin[j], *fmin);
+	*fmax = __fsel(dmax[j] - *fmax, dmax[j], *fmax);
+      }
+  }
+#ifdef _GET_IBM_COUNTER 
+  hpmStop(1);
+#endif
+
+#undef __UNROLL_DEPTH_1
+
+#else // original loop
+
+#ifdef _GET_IBM_COUNTER 
+  hpmStart(1, "minmax base");
+#endif
+  {
+    size_t i;
+
+#if   defined (CRAY)
+#pragma _CRI ivdep
+#elif defined (SX)
+#pragma vdir nodep
+#elif defined (__uxp__)
+#pragma loop novrec
+#endif
+    for ( i = 0; i < datasize; ++i )
+      {
+	if ( *fmin > data[i] ) *fmin = data[i];
+	if ( *fmax < data[i] ) *fmax = data[i];
+	/*
+	 *fmin = *fmin < data[i] ? *fmin : data[i];
+	 *fmax = *fmax > data[i] ? *fmax : data[i];
+	 */
+      }
+  }
+#ifdef _GET_IBM_COUNTER 
+  hpmStop(1);
+#endif
+
+#endif // _ARCH_PWR6 && original loop
+#endif // SIMD
+
+#if defined _GET_X86_COUNTER || defined _GET_MACH_COUNTER
+#ifdef _GET_X86_COUNTER 
+  end_minmax = _rdtsc();
+#endif
+#ifdef _GET_MACH_COUNTER 
+  end_minmax = mach_absolute_time();
+#endif
+#if defined __AVX__
+  printf("AVX minmax cycles:: %" PRIu64 "\n", 
+	 end_minmax-start_minmax);
+  fprintf (stderr, "AVX min: %lf max: %lf\n", *fmin, *fmax);
+#elif defined __SSE2__
+  printf("SSE2 minmax cycles:: %" PRIu64 "\n", 
+	 end_minmax-start_minmax);
+  fprintf (stderr, "SSE2 min: %lf max: %lf\n", *fmin, *fmax);
+#else
+  printf("loop minmax cycles:: %" PRIu64 "\n", 
+	 end_minmax-start_minmax);
+  fprintf (stderr, "loop min: %lf max: %lf\n", *fmin, *fmax);
+#endif
+#endif
+
+  return;
+}
+//#undef _GET_X86_COUNTER
+//#undef _GET_MACH_COUNTER
+//#undef _GET_IBM_COUNTER
+//#undef _ARCH_PWR6
+
+#include <stdint.h>
+
+#if   defined(__GNUC__) && (__GNUC__ >= 4)
+#elif defined(__ICC)    && (__ICC >= 1100)
+#elif defined(__clang__)
+#else
+#define DISABLE_SIMD
+#endif
+
+#if defined _GET_IBM_COUNTER
+#include <libhpc.h>
+#elif defined _GET_X86_COUNTER
+#include <x86intrin.h>
+#elif defined _GET_MACH_COUNTER
+#include <mach/mach_time.h>
+#endif
+
+//#define DISABLE_SIMD
+
+#ifdef DISABLE_SIMD
+#ifndef ENABLE_AVX
+#undef __AVX__
+#endif
+#ifndef ENABLE_SSE4_1
+#undef __SSE4_1__
+#endif
+#endif
+
+#if defined __AVX__
+#include <immintrin.h>
+#elif defined __SSE4_1__
+#include <smmintrin.h>
+#endif
+
+#if defined __AVX__
+
+static
+void avx_encode_double_array_2byte(size_t datasize, 
+				   unsigned char * restrict lGrib,
+				   const double * restrict data, 
+				   double zref, double factor, size_t *gz) 
+{
+  size_t i, j;
+  const double *dval = data;
+  __m128i *sgrib = (__m128i *) (lGrib+(*gz));
+
+  const __m128i swap = _mm_set_epi8(14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1);
+
+  const __m256d c0 = _mm256_set1_pd(zref);
+  const __m256d c1 = _mm256_set1_pd(factor);
+  const __m256d c2 = _mm256_set1_pd(0.5);
+  
+  __m256d d0, d3, d2, d1;
+  __m128i i0, i1, i2, i3;
+  __m128i s0, s1;  
+
+  for (i = 0; i < datasize; i += 16)
+    {
+      (void) _mm_prefetch(dval+8, _MM_HINT_NTA);
+      //_____________________________________________________________________________
+
+      d0 = _mm256_loadu_pd (dval);
+      d0 = _mm256_sub_pd (d0, c0);
+      d0 = _mm256_mul_pd (d0, c1);
+      d0 = _mm256_add_pd (d0, c2);
+
+      i0 = _mm256_cvttpd_epi32 (d0);
+      
+      //_____________________________________________________________________________
+      
+      d1 = _mm256_loadu_pd (dval+4);
+      d1 = _mm256_sub_pd (d1, c0);
+      d1 = _mm256_mul_pd (d1, c1);
+      d1 = _mm256_add_pd (d1, c2);
+      
+      i1 = _mm256_cvttpd_epi32 (d1);
+
+      //_____________________________________________________________________________
+
+      s0 = _mm_packus_epi32(i0, i1);
+      s0 = _mm_shuffle_epi8 (s0, swap);
+      (void) _mm_storeu_si128 (sgrib, s0);
+
+      //_____________________________________________________________________________
+
+      (void) _mm_prefetch(dval+16, _MM_HINT_NTA);
+
+      //_____________________________________________________________________________
+      
+      d2 = _mm256_loadu_pd (dval+8);
+      d2 = _mm256_sub_pd (d2, c0);
+      d2 = _mm256_mul_pd (d2, c1);
+      d2 = _mm256_add_pd (d2, c2);
+      
+      i2 = _mm256_cvttpd_epi32 (d2);
+
+      //_____________________________________________________________________________
+      
+      d3 = _mm256_loadu_pd (dval+12);
+      d3 = _mm256_sub_pd (d3, c0);
+      d3 = _mm256_mul_pd (d3, c1);
+      d3 = _mm256_add_pd (d3, c2);
+      
+      i3 = _mm256_cvttpd_epi32 (d3);
+
+      //_____________________________________________________________________________
+
+      s1 = _mm_packus_epi32(i2, i3);
+      s1 = _mm_shuffle_epi8 (s1, swap);
+      (void) _mm_storeu_si128 (sgrib+1, s1);
+
+      //_____________________________________________________________________________
+           
+      dval += 16;
+      sgrib += 2;
+    }
+
+  if (i != datasize)
+    {
+      uint16_t ui16;
+      i -= 16;
+      for ( j = i; j < datasize; j++ )
+	{
+	  ui16 = (uint16_t) ((data[j] - zref) * factor + 0.5);
+	  lGrib[*gz+2*j  ] = ui16 >>  8;
+	  lGrib[*gz+2*j+1] = ui16;
+	}
+    }
+  
+  *gz += 2*datasize;
+
+  return;
+}
+
+#elif defined __SSE4_1__
+
+static
+void sse41_encode_double_array_2byte(size_t datasize, 
+				     unsigned char * restrict lGrib,
+				     const double * restrict data, 
+				     double zref, double factor, size_t *gz) 
+{
+  size_t i, j;
+  const double *dval = data;
+  __m128i *sgrib = (__m128i *) (lGrib+(*gz));
+
+  const __m128i swap = _mm_set_epi8(14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1);
+
+  const __m128d c0 = _mm_set1_pd(zref);
+  const __m128d c1 = _mm_set1_pd(factor);
+  const __m128d c2 = _mm_set1_pd(0.5);
+  
+  __m128d d0, d4, d3, d2, d1;
+  __m128i i0, i1, i2, i3, i4;
+  __m128i s0, s1;  
+
+  for (i = 0; i < datasize; i += 16)
+    {
+      (void) _mm_prefetch(dval+8, _MM_HINT_NTA);
+      //_____________________________________________________________________________
+
+      d0 = _mm_loadu_pd (dval);
+      d0 = _mm_sub_pd (d0, c0);
+      d0 = _mm_mul_pd (d0, c1);
+      d0 = _mm_add_pd (d0, c2);
+      
+      d4 = _mm_loadu_pd (dval+2);
+      d4 = _mm_sub_pd (d4, c0);
+      d4 = _mm_mul_pd (d4, c1);
+      d4 = _mm_add_pd (d4, c2);
+
+      i0 = _mm_cvttpd_epi32 (d0);
+      i4 = _mm_cvttpd_epi32 (d4);  
+      i0 = _mm_unpacklo_epi64 (i0, i4);
+
+      //_____________________________________________________________________________
+      
+      d1 = _mm_loadu_pd (dval+4);
+      d1 = _mm_sub_pd (d1, c0);
+      d1 = _mm_mul_pd (d1, c1);
+      d1 = _mm_add_pd (d1, c2);
+      
+      d4 = _mm_loadu_pd (dval+6);
+      d4 = _mm_sub_pd (d4, c0);
+      d4 = _mm_mul_pd (d4, c1);
+      d4 = _mm_add_pd (d4, c2);
+      
+      i1 = _mm_cvttpd_epi32 (d1);
+      i4 = _mm_cvttpd_epi32 (d4);  
+      i1 = _mm_unpacklo_epi64 (i1, i4);
+
+      //_____________________________________________________________________________
+
+      s0 = _mm_packus_epi32(i0, i1);
+      s0 = _mm_shuffle_epi8 (s0, swap);
+      (void) _mm_storeu_si128 (sgrib, s0);
+
+      //_____________________________________________________________________________
+
+      (void) _mm_prefetch(dval+16, _MM_HINT_NTA);
+
+      //_____________________________________________________________________________
+      
+      d2 = _mm_loadu_pd (dval+8);
+      d2 = _mm_sub_pd (d2, c0);
+      d2 = _mm_mul_pd (d2, c1);
+      d2 = _mm_add_pd (d2, c2);
+      
+      d4 = _mm_loadu_pd (dval+10);
+      d4 = _mm_sub_pd (d4, c0);
+      d4 = _mm_mul_pd (d4, c1);
+      d4 = _mm_add_pd (d4, c2);
+      
+      i2 = _mm_cvttpd_epi32 (d2);
+      i4  = _mm_cvttpd_epi32 (d4);  
+      i2 = _mm_unpacklo_epi64 (i2, i4);
+
+      //_____________________________________________________________________________
+      
+      d3 = _mm_loadu_pd (dval+12);
+      d3 = _mm_sub_pd (d3, c0);
+      d3 = _mm_mul_pd (d3, c1);
+      d3 = _mm_add_pd (d3, c2);
+      
+      d4 = _mm_loadu_pd (dval+14);
+      d4 = _mm_sub_pd (d4, c0);
+      d4 = _mm_mul_pd (d4, c1);
+      d4 = _mm_add_pd (d4, c2);
+      
+      i3 = _mm_cvttpd_epi32 (d3);
+      i4 = _mm_cvttpd_epi32 (d4);  
+      i3 = _mm_unpacklo_epi64 (i3, i4);
+
+      //_____________________________________________________________________________
+
+      s1 = _mm_packus_epi32(i2, i3);
+      s1 = _mm_shuffle_epi8 (s1, swap);
+      (void) _mm_storeu_si128 (sgrib+1, s1);
+
+      //_____________________________________________________________________________
+           
+      dval += 16;
+      sgrib += 2;
+    }
+
+  if (i != datasize) 
+    {
+      uint16_t ui16;
+      i -= 16;  
+      for ( j = i; j < datasize; j++ )
+	{
+	  ui16 = (uint16_t) ((data[j] - zref) * factor + 0.5);
+	  lGrib[*gz+2*j  ] = ui16 >>  8;
+	  lGrib[*gz+2*j+1] = ui16;
+	}
+    }
+
+  *gz += 2*datasize;
+  
+  return;
+}
+
+#endif // SIMD variants
+
+static
+void encode_double_array_common(int numBits, size_t packStart, size_t datasize, GRIBPACK *lGrib,
+				const double *data, double zref, double factor, size_t *gz)
+{
+  size_t i, z = *gz;
+  unsigned int ival;
+  int cbits, jbits;
+  unsigned int c;
+  static unsigned int mask[] = {0,1,3,7,15,31,63,127,255};
+    
+  /* code from gribw routine flist2bitstream */
+
+  cbits = 8;
+  c = 0;
+  for ( i = packStart; i < datasize; i++ )
+    {
+      /* note float -> unsigned int .. truncate */
+      ival = (unsigned int) ((data[i] - zref) * factor + 0.5);
+      /*
+	if ( ival > max_nbpv_pow2 ) ival = max_nbpv_pow2;
+	if ( ival < 0 ) ival = 0;
+      */
+      jbits = numBits;
+      while ( cbits <= jbits ) 
+	{
+	  if ( cbits == 8 )
+	    {
+	      jbits -= 8;
+	      lGrib[z++] = (ival >> jbits) & 0xFF;
+	    }
+	  else
+	    {
+	      jbits -= cbits;
+	      lGrib[z++] = (c << cbits) + ((ival >> jbits) & mask[cbits]);
+	      cbits = 8;
+	      c = 0;
+	    }
+	}
+      /* now jbits < cbits */
+      if ( jbits )
+	{
+	  c = (c << jbits) + (ival & mask[jbits]);
+	  cbits -= jbits;
+	}
+    }
+  if ( cbits != 8 ) lGrib[z++] = c << cbits;
+
+  *gz = z;
+}
+
+static
+void encode_double_array_byte(int numBits, size_t packStart, size_t datasize, 
+			      GRIBPACK *restrict lGrib,
+			      const double *restrict data, 
+			      double zref, double factor, size_t *gz)
+{
+#if defined _GET_X86_COUNTER || defined _GET_MACH_COUNTER 
+  uint64_t start_minmax, end_minmax;
+#endif
+
+  uint32_t ui32;
+  size_t i, z = *gz;
+  double tmp;
+
+  data += packStart;
+  datasize -= packStart;
+
+  if      ( numBits ==  8 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(2, "pack 8 bit base");
+#endif
+
+#if defined (CRAY)
+#pragma _CRI ivdep
+#elif defined (SX)
+#pragma vdir nodep
+#elif defined (__uxp__)
+#pragma loop novrec
+#endif
+      for ( i = 0; i < datasize; i++ )
+	{
+	  tmp = ((data[i] - zref) * factor + 0.5);
+	  lGrib[z  ] = (uint16_t) tmp;
+          z++;
+	}
+
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(2);
+#endif
+    }
+  else if ( numBits == 16 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(3, "pack 16 bit base");
+#elif defined _GET_X86_COUNTER 
+  start_minmax = _rdtsc();
+#elif defined _GET_MACH_COUNTER 
+  start_minmax = mach_absolute_time();
+#endif
+
+#if defined __AVX__
+
+      avx_encode_double_array_2byte(datasize, lGrib, data, zref, factor, &z);
+
+#elif defined __SSE4_1__
+
+      sse41_encode_double_array_2byte(datasize, lGrib, data, zref, factor, &z);
+
+#else
+
+      uint16_t ui16;
+
+#if   defined (CRAY)
+#pragma _CRI ivdep
+#elif defined (SX)
+#pragma vdir nodep
+#elif defined (__uxp__)
+#pragma loop novrec
+#endif
+      for ( i = 0; i < datasize; i++ )
+      	{
+      	  tmp = ((data[i] - zref) * factor + 0.5);
+          ui16 = (uint16_t) tmp;
+          lGrib[z  ] = ui16 >>  8;
+          lGrib[z+1] = ui16;
+          z += 2;
+      	}
+#endif
+
+#if defined _GET_X86_COUNTER || defined _GET_MACH_COUNTER
+#if defined _GET_X86_COUNTER 
+      end_minmax = _rdtsc();
+#elif defined _GET_MACH_COUNTER 
+      end_minmax = mach_absolute_time();
+#endif
+#if defined __AVX__
+      printf("AVX encoding cycles:: %" PRIu64 "\n", 
+	     end_minmax-start_minmax);
+#elif defined __SSE4_1__
+      printf("SSE 4.1 encoding cycles:: %" PRIu64 "\n", 
+	     end_minmax-start_minmax);
+#else
+      printf("loop encoding cycles:: %" PRIu64 "\n", 
+	     end_minmax-start_minmax);
+#endif  
+#endif
+      
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(3);
+#endif
+    }
+  else if ( numBits == 24 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(4, "pack 24 bit base");
+#endif
+
+#if   defined (CRAY)
+#pragma _CRI ivdep
+#elif defined (SX)
+#pragma vdir nodep
+#elif defined (__uxp__)
+#pragma loop novrec
+#endif
+      for ( i = 0; i < datasize; i++ )
+	{
+	  tmp = ((data[i] - zref) * factor + 0.5);
+          ui32 = (uint32_t) tmp;
+          lGrib[z  ] =  ui32 >> 16;
+          lGrib[z+1] =  ui32 >>  8;
+          lGrib[z+2] =  ui32;
+          z += 3;
+	}
+
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(4);
+#endif
+    }
+  else if ( numBits == 32 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(5, "pack 32 bit base");
+#endif
+
+#if   defined (CRAY)
+#pragma _CRI ivdep
+#elif defined (SX)
+#pragma vdir nodep
+#elif defined (__uxp__)
+#pragma loop novrec
+#endif
+      for ( i = 0; i < datasize; i++ )
+	{
+	  tmp = ((data[i] - zref) * factor + 0.5);
+          ui32 = (uint32_t) tmp;
+          lGrib[z  ] =  ui32 >> 24;
+          lGrib[z+1] =  ui32 >> 16;
+          lGrib[z+2] =  ui32 >>  8;
+          lGrib[z+3] =  ui32;
+          z += 4;
+	}
+
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(5);
+#endif
+    }
+  else if ( numBits > 0 && numBits <= 32 )
+    {
+      encode_double_array_common(numBits, 0, datasize, lGrib, 
+				 data, zref, factor, &z);
+    }
+  else if ( numBits == 0 )
+    {
+    }
+  else
+    {
+      Error("Unimplemented packing factor %d!", numBits);
+    }
+
+  *gz = z;
+}
+
+static
+void encode_double_array_unrolled(int numBits, size_t packStart, size_t datasize, 
+				  GRIBPACK *restrict lGrib,
+				  const double *restrict data, 
+				  double zref, double factor, size_t *gz)
+{
+  U_BYTEORDER;
+  size_t i, j, z = *gz;
+#ifdef _ARCH_PWR6
+#define __UNROLL_DEPTH_2 8
+#else
+#define __UNROLL_DEPTH_2 8
+#endif
+  size_t residual =  datasize % __UNROLL_DEPTH_2;
+  size_t ofs = datasize - residual;
+  double dval[__UNROLL_DEPTH_2];
+  unsigned long ival;
+
+  data += packStart;
+  datasize -= packStart;
+
+  // reducing FP operations to single FMA is slowing down on pwr6 ...
+
+  if      ( numBits ==  8 )
+    {
+      unsigned char *cgrib = (unsigned char *) (lGrib + z);
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(2, "pack 8 bit unrolled");
+#endif
+      for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) 
+	{
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      dval[j] = ((data[i+j] - zref) * factor + 0.5);
+	    }
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      *cgrib++ =  (unsigned long) dval[j];
+	    }
+	  z += __UNROLL_DEPTH_2;
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  dval[j] = ((data[ofs+j] - zref) * factor + 0.5);
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  *cgrib++ = (unsigned long) dval[j];
+	}
+      z += residual;
+
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(2);
+#endif
+    }
+  else if ( numBits == 16 )
+    {
+      unsigned short *sgrib = (unsigned short *) (lGrib + z);
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(3, "pack 16 bit unrolled");
+#endif
+      for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) 
+	{
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      dval[j] = ((data[i+j] - zref) * factor + 0.5);
+	    }
+	  if ( IS_BIGENDIAN() )
+	    {
+	      for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+		{
+		  *sgrib++ = (unsigned long) dval[j];
+		}
+	      z += 2*__UNROLL_DEPTH_2;
+	    }
+	  else
+	    {
+	      for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+		{
+		  ival = (unsigned long) dval[j];
+		  lGrib[z  ] = ival >>  8;
+		  lGrib[z+1] = ival;
+		  z += 2;
+		}
+	    }
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  dval[j] = ((data[ofs+j] - zref) * factor + 0.5);
+	}
+      if ( IS_BIGENDIAN() )
+	{
+	  for (j = 0; j < residual; j++) 
+	    {
+	      *sgrib++ = (unsigned long) dval[j];
+	    }
+	  z += 2*residual;
+	}
+      else
+	{
+	  for (j = 0; j < residual; j++) 
+	    {
+	      ival = (unsigned long) dval[j];
+	      lGrib[z  ] = ival >>  8;
+	      lGrib[z+1] = ival;
+	      z += 2;
+	    }
+	}
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(3);
+#endif
+    }
+  else if ( numBits == 24 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(4, "pack 24 bit unrolled");
+#endif
+      for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) 
+	{
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      dval[j] = ((data[i+j] - zref) * factor + 0.5);
+	    }
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      ival = (unsigned long) dval[j];
+	      lGrib[z  ] =  ival >> 16;
+	      lGrib[z+1] =  ival >>  8;
+	      lGrib[z+2] =  ival;
+	      z += 3;
+	    }
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  dval[j] = ((data[ofs+j] - zref) * factor + 0.5);
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  ival = (unsigned long) dval[j];
+	  lGrib[z  ] =  ival >> 16;
+	  lGrib[z+1] =  ival >>  8;
+	  lGrib[z+2] =  ival;
+	  z += 3;
+	}
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(4);
+#endif
+    }
+  else if ( numBits == 32 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(5, "pack 32 bit unrolled");
+#endif
+      unsigned int *igrib = (unsigned int *) (lGrib + z);
+      for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) 
+	{
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      dval[j] = ((data[i+j] - zref) * factor + 0.5);
+	    }
+	  if ( IS_BIGENDIAN() )
+	    {
+	      for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+		{
+		  *igrib = (unsigned long) dval[j];
+		  igrib++;
+		  z += 4;
+		}
+	    }
+	  else
+	    {
+	      for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+		{
+		  ival = (unsigned long) dval[j];
+		  lGrib[z  ] =  ival >> 24;
+		  lGrib[z+1] =  ival >> 16;
+		  lGrib[z+2] =  ival >>  8;
+		  lGrib[z+3] =  ival;
+		  z += 4;
+		}
+	    }
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  dval[j] = ((data[ofs+j] - zref) * factor + 0.5);
+	}
+      if ( IS_BIGENDIAN() )
+	{
+	  for (j = 0; j < residual; j++) 
+	    {
+	      *igrib = (unsigned long) dval[j];
+	      igrib++;
+	      z += 4;
+	    }
+	}
+      else
+	{
+	  for (j = 0; j < residual; j++) 
+	    {
+	      ival = (unsigned long) dval[j];
+	      lGrib[z  ] =  ival >> 24;
+	      lGrib[z+1] =  ival >> 16;
+	      lGrib[z+2] =  ival >>  8;
+	      lGrib[z+3] =  ival;
+	      z += 4;
+	    }
+	}
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(5);
+#endif
+    }
+  else if ( numBits > 0 && numBits <= 32 )
+    {
+      encode_double_array_common(numBits, 0, datasize, lGrib, data, zref, factor, &z);
+    }
+  else if ( numBits == 0 )
+    {
+    }
+  else
+    {
+      Error("Unimplemented packing factor %d!", numBits);
+    }
+
+  *gz = z;
+#undef __UNROLL_DEPTH_2
+}
+
+#define  NINT(x)  ((x) < 0 ? (int)((x)-.5) : (int)((x)+.5))
+
+
+void confp3(double pval, int *kexp, int *kmant, int kbits, int kround)
+{
+  /*
+
+    Purpose:
+    --------
+
+    Convert floating point number from machine
+    representation to GRIB representation.
+
+    Input Parameters:
+    -----------------
+
+       pval    - Floating point number to be converted.
+       kbits   - Number of bits in computer word.
+       kround  - Conversion type.
+                 0 , Closest number in GRIB format less than
+                     original number.
+                 1 , Closest number in GRIB format to the
+                     original number (equal to, greater than or
+                     less than original number).
+
+    Output Parameters:
+    ------------------
+
+       kexp    - 8 Bit signed exponent.
+       kmant   - 24 Bit mantissa.
+
+    Method:
+    -------
+
+    Floating point number represented as 8 bit signed
+    exponent and 24 bit mantissa in integer values.
+
+    Externals.
+    ----------
+
+    decfp2    - Decode from IBM floating point format.
+
+    Reference:
+    ----------
+
+    WMO Manual on Codes re GRIB representation.
+
+    Comments:
+    ---------
+
+    Routine aborts if an invalid conversion type parameter
+    is used or if a 24 bit mantissa is not produced.
+
+    Author:
+    -------
+     
+    John Hennessy   ECMWF   18.06.91
+
+    Modifications:
+    --------------
+
+    Uwe Schulzweida   MPIfM   01/04/2001
+
+    Convert to C from EMOS library version 130
+
+    Uwe Schulzweida   MPIfM   02/08/2002
+
+     - speed up by factor 1.6 on NEC SX6
+        - replace 1.0 / pow(16.0, (double)(iexp - 70)) by rpow16m70tab[iexp]
+  */
+
+  double zval, rpowref;
+  double zref, zeps;
+  int iexp, isign;
+  int iround;
+  extern int CGRIBEX_Debug;
+  extern double _pow16tab[71];
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 1 . Initialise                                          */
+  /* ----------------------------------------------------------------- */
+
+  /*  Check conversion type parameter. */
+
+  iround = kround;
+  if ( iround != 0 && iround != 1 )
+    {
+      Error("Invalid conversion type = %d", iround);
+
+      /*  If not aborting, arbitrarily set rounding to 'up'. */
+     iround = 1;
+    }
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 2 . Convert value of zero.                              */
+  /* ----------------------------------------------------------------- */
+
+  if ( ! (fabs(pval) > 0))
+    {
+      *kexp  = 0;
+      *kmant = 0;
+      iexp   = 0;
+      isign  = 0;
+      goto LABEL900;
+    }
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 3 . Convert other values.                               */
+  /* ----------------------------------------------------------------- */
+
+  zeps = 1.0e-12;
+  if ( kbits == 32 ) zeps = 1.0e-8;
+  zref = pval;
+
+  /*  Sign of value. */
+
+  isign = 0;
+  if ( zref < 0.0 )
+    {
+      isign = 128;
+      zref  = - zref;
+    }
+
+  /*  Exponent. */
+
+  iexp = (int) (log(zref)/log(16.0) + 65.0 + zeps);
+
+  /* only ANSI C99 has log2 */
+  /* iexp = (int) (log2(zref) * 0.25 + 65.0 + zeps); */
+
+  if ( iexp < 0   ) iexp = 0;
+  if ( iexp > 127 ) iexp = 127;
+
+  /*
+  rpowref = zref / pow(16.0, (double)(iexp - 70));
+  */
+
+  if ( (iexp - 70) < 0 )
+    rpowref = zref * _pow16tab[-(iexp - 70)];
+  else
+    rpowref = zref / _pow16tab[(iexp - 70)];
+
+  /*  Mantissa. */
+
+  if ( iround == 0 )
+    {
+      /*  Closest number in GRIB format less than original number. */
+      /*  Truncate for positive numbers. */
+      /*  Round up for negative numbers. */
+
+      if ( isign == 0 )
+	*kmant = (int) rpowref;
+      else
+	*kmant = NINT(rpowref + 0.5);
+    }
+  else
+    {
+      /*  Closest number in GRIB format to the original number   */
+      /*  (equal to, greater than or less than original number). */
+
+      *kmant = NINT(rpowref);
+    }
+
+  /*  Check that mantissa value does not exceed 24 bits. */
+  /*  If it does, adjust the exponent upwards and recalculate */
+  /*  the mantissa. */
+  /*  16777215 = 2**24 - 1 */
+
+  if ( *kmant > 16777215 )
+    {
+
+    LABEL350:
+
+      ++iexp;
+
+      /*  Check for exponent overflow during adjustment  */
+
+      if ( iexp > 127 )
+	{
+          Message("Exponent overflow");
+          Message("Original number = %30.20f", pval);
+          Message("Sign = %3d, Exponent = %3d, Mantissa = %12d",
+		  isign, iexp, *kmant);
+
+	  Error("Exponent overflow");
+
+	  /*  If not aborting, arbitrarily set value to zero  */
+
+          Message("Value arbitrarily set to zero.");
+          *kexp  = 0;
+          *kmant = 0;
+          iexp  = 0;
+          isign = 0;
+          goto LABEL900;
+	}
+
+      if ( (iexp - 70) < 0 )
+	rpowref = zref * _pow16tab[-(iexp - 70)];
+      else
+	rpowref = zref / _pow16tab[(iexp - 70)];
+
+      if ( iround == 0 )
+	{
+	  /*  Closest number in GRIB format less than original number. */
+	  /*  Truncate for positive numbers. */
+	  /*  Round up for negative numbers. */
+
+	  if ( isign == 0 )
+	    *kmant = (int) rpowref;
+	  else
+	    *kmant = NINT(rpowref + 0.5);
+	}
+      else
+	{
+	  /*  Closest number in GRIB format to the original number */
+	  /*  (equal to, greater or less than original number). */
+
+	  *kmant = NINT(rpowref);
+	}
+
+      /*  Repeat calculation (with modified exponent) if still have */
+      /*  mantissa overflow. */
+
+      if ( *kmant > 16777215 ) goto LABEL350;
+    }
+
+  /*  Add sign bit to exponent. */
+
+  *kexp = iexp + isign;
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 9. Return                                               */
+  /* ----------------------------------------------------------------- */
+
+LABEL900:
+
+  if ( CGRIBEX_Debug )
+    {
+      Message("Conversion type parameter = %4d", kround);
+      Message("Original number = %30.20f", pval);
+
+      zval = decfp2(*kexp, *kmant);
+
+      Message("Converted to      %30.20f", zval);
+      Message("Sign = %3d, Exponent = %3d, Mantissa = %12d",
+	      isign, iexp, *kmant);
+    }
+
+  return;
+} /* confp3 */
+
+
+double decfp2(int kexp, int kmant)
+{
+  /*
+
+    Purpose:
+    --------
+
+    Convert GRIB representation of a floating point
+    number to machine representation.
+
+    Input Parameters:
+    -----------------
+
+    kexp    - 8 Bit signed exponent.
+    kmant   - 24 Bit mantissa.
+
+    Output Parameters:
+    ------------------
+
+    Return value   - Floating point number represented
+                     by kexp and kmant.
+
+    Method:
+    -------
+
+    Floating point number represented as 8 bit exponent
+    and 24 bit mantissa in integer values converted to
+    machine floating point format.
+
+    Externals:
+    ----------
+
+    None.
+
+    Reference:
+    ----------
+
+    WMO Manual on Codes re GRIB representation.
+
+    Comments:
+    ---------
+
+    Rewritten from DECFP, to conform to programming standards.
+    Sign bit on 0 value now ignored, if present.
+    If using 32 bit reals, check power of 16 is not so small as to
+    cause overflows (underflows!); this causes warning to be given
+    on Fujitsus.
+
+    Author:
+    -------
+
+    John Hennessy   ECMWF   18.06.91
+
+    Modifications:
+    --------------
+
+    Uwe Schulzweida   MPIfM   01/04/2001
+
+     - Convert to C from EMOS library version 130
+     
+    Uwe Schulzweida   MPIfM   02/08/2002
+
+     - speed up by factor 2 on NEC SX6
+        - replace pow(2.0, -24.0) by constant POW_2_M24
+        - replace pow(16.0, (double)(iexp - 64)) by pow16m64tab[iexp]
+  */
+
+  double pval;
+  int iexp, isign;
+  extern int CGRIBEX_Debug;
+  extern double _pow16tab[71];
+  
+  /* ----------------------------------------------------------------- */
+  /*   Section 1 . Convert value of 0.0. Ignore sign bit.              */
+  /* ----------------------------------------------------------------- */
+
+  if ( CGRIBEX_Debug ) Message("KEXP = %d  KMANT = %d", kexp, kmant);
+  /*
+  if ( (kexp == 128 || kexp == 0) && kmant == 0 )
+  */
+  if ( (kexp == 128) || (kexp == 0) || (kexp == 255) )
+    {
+      pval = 0.0;
+      goto LABEL900;
+    }
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 2 . Convert other values.                               */
+  /* ----------------------------------------------------------------- */
+
+  /*  Sign of value. */
+
+  iexp  = kexp;
+  isign = 1;
+
+  if ( iexp >= 128 )
+    {
+      iexp -= 128;
+      isign = -1;
+    }
+
+  /*  Decode value. */
+
+  /* pval = isign * pow(2.0, -24.0) * kmant * pow(16.0, (double)(iexp - 64)); */
+
+  iexp -= 64;
+
+  if ( iexp < 0 )
+    pval = 1./_pow16tab[-iexp];
+  else
+    pval = _pow16tab[iexp];
+
+  pval *= isign * POW_2_M24 * kmant;
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 9. Return to calling routine.                           */
+  /* ----------------------------------------------------------------- */
+
+LABEL900:
+
+  if ( CGRIBEX_Debug ) Message("Returned value = %f", pval);
+
+  return (pval);
+} /* decfp2 */
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+
+
+
+int gribRefDate(int *isec1)
+{
+  int date, ryear, rmonth, rday;
+  int century;
+
+  century = ISEC1_Century;
+  if ( century < 0 ) century = -century;
+  century -= 1;
+
+  ryear   = ISEC1_Year;
+
+  /* if ( century != 0 ) */
+    {
+      if ( ryear == 100 )
+	{
+	  ryear = 0;
+	  century += 1;
+	}
+
+      if ( ryear != 255 )
+	{
+	  ryear = century*100 + ryear;
+	  if ( ISEC1_Century < 0 ) ryear = -ryear;
+	}
+      else
+	ryear = 1;
+    }
+
+  rmonth  = ISEC1_Month;
+  rday    = ISEC1_Day;
+
+  date = cdiEncodeDate(ryear, rmonth, rday);
+
+  return (date) ;
+}
+
+
+int gribRefTime(int *isec1)
+{
+  int time, rhour, rminute;
+
+  rhour   = ISEC1_Hour;
+  rminute = ISEC1_Minute;
+
+  time = cdiEncodeTime(rhour, rminute, 0);
+
+  return (time) ;
+}
+
+
+int gribTimeIsFC(int *isec1)
+{
+  int isFC = FALSE;
+  int time_period;
+
+  if ( ISEC1_TimeRange == 10 )
+    time_period = (ISEC1_TimePeriod1<<8) + ISEC1_TimePeriod2;
+  else
+    time_period = ISEC1_TimePeriod1;
+
+  if ( time_period > 0 && ISEC1_Day > 0 )
+    {
+      if ( ISEC1_TimeRange == 0 || ISEC1_TimeRange == 10 ) isFC = TRUE;
+    }
+
+  return (isFC);
+}
+
+
+void gribDateTime(int *isec1, int *date, int *time)
+{
+  static int lprint = TRUE;
+  int ryear, rmonth, rday, rhour, rminute, second;
+  int time_period = 0;
+  int julday, secofday, addsec;
+  int century;
+  extern int grib_calendar;
+
+  century = ISEC1_Century;
+  if ( century < 0 ) century = -century;
+  century -= 1;
+
+  ryear   = ISEC1_Year;
+
+  /* if ( century != 0 ) */
+    {
+      if ( ryear == 100 )
+	{
+	  ryear = 0;
+	  century += 1;
+	}
+
+      if ( ryear != 255 )
+	{
+	  ryear = century*100 + ryear;
+	  if ( ISEC1_Century < 0 ) ryear = -ryear;
+	}
+      else
+	ryear = 1;
+    }
+
+  rmonth  = ISEC1_Month;
+  rday    = ISEC1_Day;
+
+  rhour   = ISEC1_Hour;
+  rminute = ISEC1_Minute;
+  second  = 0;
+
+  /* printf("ref %d/%d/%d %d:%d\n", ryear, rmonth, rday, rhour, rminute); */
+
+  if ( ISEC1_TimeRange == 10 )
+    time_period = (ISEC1_TimePeriod1<<8) + ISEC1_TimePeriod2;
+  else if ( ISEC1_TimeRange >=2 && ISEC1_TimeRange <= 5 )
+    time_period = ISEC1_TimePeriod2;
+  else if ( ISEC1_TimeRange == 0 )
+    time_period = ISEC1_TimePeriod1;
+
+  if ( time_period > 0 && rday > 0 )
+    {
+      encode_caldaysec(grib_calendar, ryear, rmonth, rday, rhour, rminute, second, &julday, &secofday);
+
+      addsec = 0;
+      switch ( ISEC1_TimeUnit )
+	{
+	case ISEC1_TABLE4_MINUTE:  addsec =    60 * time_period; break;
+	case ISEC1_TABLE4_QUARTER: addsec =   900 * time_period; break;
+	case ISEC1_TABLE4_HOUR:    addsec =  3600 * time_period; break;
+	case ISEC1_TABLE4_3HOURS:  addsec = 10800 * time_period; break;
+	case ISEC1_TABLE4_6HOURS:  addsec = 21600 * time_period; break;
+	case ISEC1_TABLE4_12HOURS: addsec = 43200 * time_period; break;
+	case ISEC1_TABLE4_DAY:     addsec = 86400 * time_period; break;
+	default:
+	  if ( lprint )
+	    {
+	      gprintf(__func__, "Time unit %d unsupported", ISEC1_TimeUnit);
+	      lprint = FALSE;
+	    }
+	}
+
+      julday_add_seconds(addsec, &julday, &secofday);
+
+      decode_caldaysec(grib_calendar, julday, secofday, &ryear, &rmonth, &rday, &rhour, &rminute, &second);
+    }
+  /*
+  printf("new %d/%d/%d %d:%d\n", ryear, rmonth, rday, rhour, rminute);
+  */
+  *date = cdiEncodeDate(ryear, rmonth, rday);
+  *time = cdiEncodeTime(rhour, rminute, 0);
+
+  return;
+}
+
+
+void gprintf(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+
+  if ( grprsm == NULL ) Error("GRIBEX initialization missing!");
+	
+  va_start(args, fmt);
+
+   fprintf(grprsm, "%-18s : ", caller);
+  vfprintf(grprsm, fmt, args);
+   fprintf(grprsm, "\n");
+
+  va_end(args);
+}
+
+
+void
+gribExDP(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+	 double *fsec3, int *isec4, double *fsec4, int klenp, int *kgrib,
+	 int kleng, int *kword, char *hoper, int *kret)
+{
+  int yfunc = *hoper;
+
+  if ( yfunc == 'D' || yfunc == 'J' || yfunc == 'R' )
+    gribDecode(isec0, isec1, isec2, fsec2, isec3,
+	       fsec3, isec4, fsec4, klenp, kgrib,
+	       kleng, kword, yfunc, kret);
+  else if ( yfunc == 'C' )
+    gribEncode(isec0, isec1, isec2, fsec2, isec3,
+	       fsec3, isec4, fsec4, klenp, kgrib,
+	       kleng, kword, yfunc, kret);
+  else if ( yfunc == 'V' )
+    fprintf(stderr, "  cgribex: Version is %s\n", cgribexLibraryVersion());
+  else
+    {
+      Error("oper %c unsupported!", yfunc);
+      *kret=-9;
+    }
+}
+
+
+void
+gribExSP(int *isec0, int *isec1, int *isec2, float *fsec2sp, int *isec3,
+	 float *fsec3sp, int *isec4, float *fsec4sp, int klenp, int *kgrib,
+	 int kleng, int *kword, char *hoper, int *kret)
+{
+  int inum, j;
+  double fsec2dp[1024];
+  double fsec3dp[2];
+  double *fsec4dp = NULL;
+  int yfunc = *hoper;
+
+  if ( yfunc == 'C' )
+    {
+      inum = 10 + isec2[11];
+      for ( j = 0; j < inum; j++ ) fsec2dp[j] = fsec2sp[j];
+
+      fsec3dp[0] = fsec3sp[0];
+      fsec3dp[1] = fsec3sp[1];
+
+      inum = isec4[0];
+      fsec4dp = (double *) malloc(inum*sizeof(double));
+      if ( fsec4dp == NULL ) SysError("No Memory!");
+
+      for ( j = 0; j < inum; j++ ) fsec4dp[j] = fsec4sp[j];
+
+      gribExDP(isec0, isec1, isec2, fsec2dp, isec3,
+	       fsec3dp, isec4, fsec4dp, klenp, kgrib,
+	       kleng, kword, hoper, kret);
+
+      free(fsec4dp);
+    }
+  else if ( yfunc == 'D' || yfunc == 'J' || yfunc == 'R' )
+    {
+      fsec4dp = (double *) malloc(klenp*sizeof(double));
+      if ( fsec4dp == NULL ) SysError("No Memory!");
+
+      for ( j = 0; j < 10; j++ ) fsec2dp[j] = 0.0;
+      for ( j = 0; j <  2; j++ ) fsec3dp[j] = 0.0;
+
+      gribExDP(isec0, isec1, isec2, fsec2dp, isec3,
+	       fsec3dp, isec4, fsec4dp, klenp, kgrib,
+	       kleng, kword, hoper, kret);
+
+      inum = 10 + isec2[11];
+      for ( j = 0; j < inum; j++ ) fsec2sp[j] = fsec2dp[j];
+
+      fsec3sp[0] = fsec3dp[0];
+      fsec3sp[1] = fsec3dp[1];
+
+      inum = isec4[0];
+      for ( j = 0; j < inum; j++ )
+	{
+	  if ( fsec4dp[j] > -FLT_MIN && fsec4dp[j] < FLT_MIN )
+	    fsec4sp[j] = 0;
+	  else if ( fsec4dp[j] > FLT_MAX )
+	    fsec4sp[j] = FLT_MAX;
+	  else if ( fsec4dp[j] < -FLT_MAX )
+	    fsec4sp[j] = -FLT_MAX;
+	  else
+	    fsec4sp[j] = fsec4dp[j];
+	}
+
+      free(fsec4dp);
+    }
+  else if ( yfunc == 'V' )
+    fprintf(stderr, " c-gribex: Version is %s\n", cgribexLibraryVersion());
+  else
+    {
+      Error("oper %c unsupported!", yfunc);
+      *kret=-9;
+    }
+}
+
+int CGRIBEX_Fix_ZSE  = 0;    /* 1: Fix ZeroShiftError of simple packed spherical harmonics */
+int CGRIBEX_Const    = 0;    /* 1: Don't pack constant fields on regular grids */
+int CGRIBEX_Debug    = 0;    /* 1: Debugging */
+
+void gribSetDebug(int debug)
+{
+  CGRIBEX_Debug = debug;
+
+  if ( CGRIBEX_Debug )
+    Message("debug level %d", debug);
+}
+
+
+void gribFixZSE(int flag)
+{
+  CGRIBEX_Fix_ZSE = flag;
+
+  if ( CGRIBEX_Debug )
+    Message("Fix ZeroShiftError set to %d", flag);
+}
+
+
+void gribSetConst(int flag)
+{
+  CGRIBEX_Const = flag;
+
+  if ( CGRIBEX_Debug )
+    Message("Const set to %d", flag);
+}
+
+
+void gribSetRound(int round)
+{
+}
+
+
+void gribSetRefDP(double refval)
+{
+}
+
+
+void gribSetRefSP(float refval)
+{
+  gribSetRefDP((double) refval);
+}
+
+
+void gribSetValueCheck(int vcheck)
+{
+}
+#include <string.h>
+#include <math.h>
+
+
+
+void gribPrintSec0(int *isec0)
+{
+  /*
+
+    Print the information in the Indicator
+    Section (Section 0) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec0 - Array of decoded integers from Section 0
+
+
+    Converted from EMOS routine GRPRS0.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+
+  grsdef();
+
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " Section 0 - Indicator Section.       \n");
+  fprintf(grprsm, " -------------------------------------\n");
+  fprintf(grprsm, " Length of GRIB message (octets).     %9d\n", ISEC0_GRIB_Len);
+  fprintf(grprsm, " GRIB Edition Number.                 %9d\n", ISEC0_GRIB_Version);
+}
+
+void gribPrintSec1(int *isec0, int *isec1)
+{
+  /*
+
+    Print the information in the Product Definition
+    Section (Section 1) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec0 - Array of decoded integers from Section 0
+
+       isec1 - Array of decoded integers from Section 1
+
+    Comments:
+
+       When decoding data from Experimental Edition or Edition 0,
+       routine GRIBEX adds the additional fields available in
+       Edition 1.
+
+
+    Converted from EMOS routine GRPRS1.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+
+  int iprev, icurr, icount, ioffset;
+  int ibit, ierr, iout, iyear;
+  int jloop, jiloop;
+  float value;
+
+  char hversion[9];
+  /*
+  char hfirst[121], hsecond[121], hthird[121], hfourth[121];
+  */
+
+  grsdef();
+
+  /*
+    -----------------------------------------------------------------
+    Section 0 . Print required information.
+    -----------------------------------------------------------------
+  */
+
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " Section 1 - Product Definition Section.\n");
+  fprintf(grprsm, " ---------------------------------------\n");
+
+  fprintf(grprsm, " Code Table 2 Version Number.         %9d\n", isec1[0]);
+  fprintf(grprsm, " Originating centre identifier.       %9d\n", isec1[1]);
+  fprintf(grprsm, " Model identification.                %9d\n", isec1[2]);
+  fprintf(grprsm, " Grid definition.                     %9d\n", isec1[3]);
+
+  ibit = 8;
+  prtbin(isec1[4], ibit, &iout, &ierr);
+  fprintf(grprsm, " Flag (Code Table 1)                   %8.8d\n", iout);
+  fprintf(grprsm, " Parameter identifier (Code Table 2). %9d\n", isec1[5]);
+
+  /*
+      IERR = CHKTAB2(ISEC1,HFIRST,HSECOND,HTHIRD,HFOURTH)
+      IF( IERR .EQ. 0 ) THEN
+       DO JLOOP = 121, 1, -1
+          IF( HSECOND(JLOOP:JLOOP).NE.' ' ) THEN
+            IOFFSET = JLOOP
+            GOTO 110
+          ENDIF
+        ENDDO
+        GOTO 120
+ 110    CONTINUE
+        WRITE(*,'(2H ",A,1H")') HSECOND(1:IOFFSET)
+ 120    CONTINUE
+      ENDIF
+  */
+
+  if ( isec1[5] != 127 )
+    {
+      fprintf(grprsm, " Type of level (Code Table 3).        %9d\n", isec1[6]);
+      fprintf(grprsm, " Value 1 of level (Code Table 3).     %9d\n", isec1[7]);
+      fprintf(grprsm, " Value 2 of level (Code Table 3).     %9d\n", isec1[8]);
+    }
+  else
+    {
+      fprintf(grprsm, " Satellite identifier.                %9d\n", isec1[6]);
+      fprintf(grprsm, " Spectral band.                       %9d\n", isec1[7]);
+    }
+
+  iyear = isec1[9];
+  if ( iyear != 255 )
+    {
+      int date, time;
+      /* iyear  = ((isec1[20]-1)*100 + isec1[9]); */
+      gribDateTime(isec1, &date, &time);
+      iyear = date/10000;
+      fprintf(grprsm, " Year of reference time of data.      %9d  (%4d)\n", isec1[9], iyear);
+    }
+  else
+    {
+      fprintf(grprsm, " Year of reference time of data MISSING  (=255)\n");
+    }
+
+  fprintf(grprsm, " Month of reference time of data.     %9d\n", isec1[10]);
+  fprintf(grprsm, " Day of reference time of data.       %9d\n", isec1[11]);
+  fprintf(grprsm, " Hour of reference time of data.      %9d\n", isec1[12]);
+  fprintf(grprsm, " Minute of reference time of data.    %9d\n", isec1[13]);
+  fprintf(grprsm, " Time unit (Code Table 4).            %9d\n", isec1[14]);
+  fprintf(grprsm, " Time range one.                      %9d\n", isec1[15]);
+  fprintf(grprsm, " Time range two.                      %9d\n", isec1[16]);
+  fprintf(grprsm, " Time range indicator (Code Table 5)  %9d\n", isec1[17]);
+  fprintf(grprsm, " Number averaged.                     %9d\n", isec1[18]);
+  fprintf(grprsm, " Number missing from average.         %9d\n", isec1[19]);
+  /*
+     All ECMWF data in GRIB Editions before Edition 1 is decoded
+     as 20th century data. Other centres are decoded as missing.
+  */
+  if ( isec0[1] < 1 && isec1[1] != 98 )
+    fprintf(grprsm, " Century of reference time of data.   Not given\n");
+  else
+    fprintf(grprsm, " Century of reference time of data.   %9d\n", isec1[20]);
+
+  /*   Print sub-centre  */
+  fprintf(grprsm, " Sub-centre identifier.               %9d\n", isec1[21]);
+
+  /*   Decimal scale factor  */
+  fprintf(grprsm, " Units decimal scaling factor.        %9d\n", isec1[22]);
+
+  /*
+    -----------------------------------------------------------------
+    Section 1 . Print local DWD information.
+    -----------------------------------------------------------------
+  */
+  if ( (isec1[ 1] == 78 && isec1[36] == 253) ||
+       (isec1[ 1] == 78 && isec1[36] == 254) )
+    {
+      fprintf(grprsm, " DWD local usage identifier.          %9d\n", isec1[36]);
+      if ( isec1[36] == 253 )
+	fprintf(grprsm, " (Database labelling and ensemble forecast)\n");
+      if ( isec1[36] == 254 )
+	fprintf(grprsm, " (Database labelling)\n");
+
+      fprintf(grprsm, " Year of database entry                     %3d  (%4d)\n", isec1[43], 1900+isec1[43]);
+      fprintf(grprsm, " Month of database entry                    %3d\n", isec1[44]);
+      fprintf(grprsm, " Day of database entry                      %3d\n", isec1[45]);
+      fprintf(grprsm, " Hour of database entry                     %3d\n", isec1[46]);
+      fprintf(grprsm, " Minute of database entry                   %3d\n", isec1[47]);
+      fprintf(grprsm, " DWD experiment number                %9d\n",isec1[48]);
+      fprintf(grprsm, " DWD run type                         %9d\n",isec1[49]);
+      if ( isec1[36] == 253 ) 
+	{
+	  fprintf(grprsm, " User id                              %9d\n",isec1[50]);
+	  fprintf(grprsm, " Experiment identifier                %9d\n",isec1[51]);
+	  fprintf(grprsm, " Ensemble identification type         %9d\n",isec1[52]);
+	  fprintf(grprsm, " Number of ensemble members           %9d\n",isec1[53]);
+	  fprintf(grprsm, " Actual number of ensemble member     %9d\n",isec1[54]);
+	  fprintf(grprsm, " Model version                            %2d.%2.2d\n",isec1[55],isec1[56]);
+	}
+    }
+
+  /*
+    -----------------------------------------------------------------
+    Section 2 . Print local ECMWF information.
+    -----------------------------------------------------------------
+  */
+  /*
+    Regular MARS labelling, or reformatted Washington EPS products.
+  */
+  if ( (ISEC1_CenterID    == 98 && ISEC1_LocalFLag ==  1) ||
+       (ISEC1_SubCenterID == 98 && ISEC1_LocalFLag ==  1) ||
+       (ISEC1_CenterID    ==  7 && ISEC1_SubCenterID == 98) )
+    {
+      /*   Parameters common to all definitions.  */
+
+      fprintf(grprsm, " ECMWF local usage identifier.        %9d\n", isec1[36]);
+      if ( isec1[36] == 1 )
+	fprintf(grprsm, " (Mars labelling or ensemble forecast)\n");
+      if ( isec1[36] == 2 )
+        fprintf(grprsm, " (Cluster means and standard deviations)\n");
+      if ( isec1[36] == 3 )
+        fprintf(grprsm, " (Satellite image data)\n");
+      if ( isec1[36] == 4 )
+        fprintf(grprsm, " (Ocean model data)\n");
+      if ( isec1[36] == 5 )
+        fprintf(grprsm, " (Forecast probability data)\n");
+      if ( isec1[36] == 6 )
+        fprintf(grprsm, " (Surface temperature data)\n");
+      if ( isec1[36] == 7 )
+        fprintf(grprsm, " (Sensitivity data)\n");
+      if ( isec1[36] == 8 )
+        fprintf(grprsm, " (ECMWF re-analysis data)\n");
+      if ( isec1[36] == 9 )
+        fprintf(grprsm, " (Singular vectors and ensemble perturbations)\n");
+      if ( isec1[36] == 10 )
+        fprintf(grprsm, " (EPS tubes)\n");
+      if ( isec1[36] == 11 )
+        fprintf(grprsm, " (Supplementary data used by analysis)\n");
+      if ( isec1[36] == 13 )
+        fprintf(grprsm, " (Wave 2D spectra direction and frequency)\n");
+
+      fprintf(grprsm, " Class.                               %9d\n", isec1[37]);
+      fprintf(grprsm, " Type.                                %9d\n", isec1[38]);
+      fprintf(grprsm, " Stream.                              %9d\n", isec1[39]);
+      sprintf(hversion, "%4s", (char*)&isec1[40]); hversion[4] = 0;
+      fprintf(grprsm, " Version number or Experiment identifier.  %4s\n", hversion);
+      /*
+	ECMWF Local definition 1.
+	(MARS labelling or ensemble forecast data)
+      */
+      if ( isec1[36] == 1 )
+	{
+	  fprintf(grprsm, " Forecast number.                     %9d\n", isec1[41]);
+	  if ( isec1[39] != 1090 )
+	    fprintf(grprsm, " Total number of forecasts.           %9d\n", isec1[42]);
+
+	  return;
+	}
+      /*
+	ECMWF Local definition 2.
+	(Cluster means and standard deviations)
+      */
+      if ( isec1[36] == 2 )
+	{
+	  fprintf(grprsm, " Cluster number.                      %9d\n", isec1[41]);
+	  fprintf(grprsm, " Total number of clusters.            %9d\n", isec1[42]);
+	  fprintf(grprsm, " Clustering method.                   %9d\n", isec1[43]);
+	  fprintf(grprsm, " Start time step when clustering.     %9d\n", isec1[44]);
+	  fprintf(grprsm, " End time step when clustering.       %9d\n", isec1[45]);
+	  fprintf(grprsm, " Northern latitude of domain.         %9d\n", isec1[46]);
+	  fprintf(grprsm, " Western longitude of domain.         %9d\n", isec1[47]);
+	  fprintf(grprsm, " Southern latitude of domain.         %9d\n", isec1[48]);
+	  fprintf(grprsm, " Eastern longitude of domain.         %9d\n", isec1[49]);
+	  fprintf(grprsm, " Operational forecast in cluster      %9d\n", isec1[50]);
+	  fprintf(grprsm, " Control forecast in cluster          %9d\n", isec1[51]);
+	  fprintf(grprsm, " Number of forecasts in cluster.      %9d\n", isec1[52]);
+
+	  for (jloop = 0; jloop < isec1[52]; jloop++)
+	    fprintf(grprsm, " Forecast number                      %9d\n", isec1[jloop+53]);
+
+	  return;
+	}
+      /*
+	ECMWF Local definition 3.
+	(Satellite image data)
+      */
+      if ( isec1[36] == 3 )
+	{
+	  fprintf(grprsm, " Satellite spectral band.             %9d\n", isec1[41]);
+	  fprintf(grprsm, " Function code.                       %9d\n", isec1[42]);
+	  return;
+	}
+      /*
+	ECMWF Local definition 4.
+	(Ocean model data)
+      */
+      if ( isec1[36] == 4 )
+	{
+	  fprintf(grprsm, " Satellite spectral band.             %9d\n", isec1[41]);
+	  if ( isec1[39] != 1090 )
+	    fprintf(grprsm, " Function code.                       %9d\n", isec1[42]);
+	  fprintf(grprsm, " Coordinate structure definition.\n");
+	  fprintf(grprsm, " Fundamental spatial reference system.%9d\n", isec1[43]);
+	  fprintf(grprsm, " Fundamental time reference.          %9d\n", isec1[44]);
+	  fprintf(grprsm, " Space unit flag.                     %9d\n", isec1[45]);
+	  fprintf(grprsm, " Vertical coordinate definition.      %9d\n", isec1[46]);
+	  fprintf(grprsm, " Horizontal coordinate definition.    %9d\n", isec1[47]);
+	  fprintf(grprsm, " Time unit flag.                      %9d\n", isec1[48]);
+	  fprintf(grprsm, " Time coordinate definition.          %9d\n", isec1[49]);
+	  fprintf(grprsm, " Position definition.     \n");
+	  fprintf(grprsm, " Mixed coordinate field flag.         %9d\n", isec1[50]);
+	  fprintf(grprsm, " Coordinate 1 flag.                   %9d\n", isec1[51]);
+	  fprintf(grprsm, " Averaging flag.                      %9d\n", isec1[52]);
+	  fprintf(grprsm, " Position of level 1.                 %9d\n", isec1[53]);
+	  fprintf(grprsm, " Position of level 2.                 %9d\n", isec1[54]);
+	  fprintf(grprsm, " Coordinate 2 flag.                   %9d\n", isec1[55]);
+	  fprintf(grprsm, " Averaging flag.                      %9d\n", isec1[56]);
+	  fprintf(grprsm, " Position of level 1.                 %9d\n", isec1[57]);
+	  fprintf(grprsm, " Position of level 2.                 %9d\n", isec1[58]);
+	  fprintf(grprsm, " Grid Definition.\n");
+	  fprintf(grprsm, " Coordinate 3 flag (x-axis)           %9d\n", isec1[59]);
+	  fprintf(grprsm, " Coordinate 4 flag (y-axis)           %9d\n", isec1[60]);
+	  fprintf(grprsm, " Coordinate 4 of first grid point.    %9d\n", isec1[61]);
+	  fprintf(grprsm, " Coordinate 3 of first grid point.    %9d\n", isec1[62]);
+	  fprintf(grprsm, " Coordinate 4 of last grid point.     %9d\n", isec1[63]);
+	  fprintf(grprsm, " Coordinate 3 of last grid point.     %9d\n", isec1[64]);
+	  fprintf(grprsm, " i - increment.                       %9d\n", isec1[65]);
+	  fprintf(grprsm, " j - increment.                       %9d\n", isec1[66]);
+	  fprintf(grprsm, " Flag for irregular grid coordinates. %9d\n", isec1[67]);
+	  fprintf(grprsm, " Flag for normal or staggered grids.  %9d\n", isec1[68]);
+	  fprintf(grprsm, " Further information.\n");
+	  fprintf(grprsm, " Further information flag.            %9d\n", isec1[69]);
+	  fprintf(grprsm, " Auxiliary information.\n");
+	  fprintf(grprsm, " No. entries in horizontal coordinate %9d\n", isec1[70]);
+	  fprintf(grprsm, " No. entries in mixed coordinate defn.%9d\n", isec1[71]);
+	  fprintf(grprsm, " No. entries in grid coordinate list. %9d\n", isec1[72]);
+	  fprintf(grprsm, " No. entries in auxiliary array.      %9d\n", isec1[73]);
+	  /*
+	    Horizontal coordinate supplement.
+	  */
+	  fprintf(grprsm, " Horizontal coordinate supplement.\n");
+	  if ( isec1[70] == 0 )
+	    {
+	      fprintf(grprsm, "(None).\n");
+	    }
+	  else
+	    {
+	      fprintf(grprsm, "Number of items = %d\n", isec1[70]);
+	      for (jloop = 0; jloop < isec1[70]; jloop++)
+		fprintf(grprsm, "         %12d\n", isec1[74+jloop]);
+	    }
+	  /*
+	    Mixed coordinate definition.
+	  */
+	  fprintf(grprsm, " Mixed coordinate definition.\n");
+	  if ( isec1[71] == 0 )
+	    {
+	      fprintf(grprsm, "(None).\n");
+	    }
+	  else
+	    {
+	      fprintf(grprsm, "Number of items = %d\n", isec1[71]);
+	      ioffset = 74 + isec1[70];
+	      for (jloop = 0; jloop < isec1[71]; jloop++)
+		fprintf(grprsm, "         %12d\n", isec1[ioffset+jloop]);
+	    }
+	  /*
+	    Grid coordinate list.
+	  */
+	  fprintf(grprsm, " Grid coordinate list. \n");
+	  if ( isec1[72] == 0 )
+	    {
+	      fprintf(grprsm, "(None).\n");
+	    }
+	  else
+	    {
+	      fprintf(grprsm, "Number of items = %d\n", isec1[72]);
+	      ioffset = 74 + isec1[70] + isec1[71];
+	      for (jloop = 0; jloop < isec1[72]; jloop++)
+		fprintf(grprsm, "         %12d\n", isec1[ioffset+jloop]);
+	    }
+	  /*
+	    Auxiliary array.
+	  */
+	  fprintf(grprsm, " Auxiliary array.      \n");
+	  if ( isec1[73] == 0 )
+	    {
+	      fprintf(grprsm, "(None).\n");
+	    }
+	  else
+	    {
+	      fprintf(grprsm, "Number of items = %d\n", isec1[73]);
+	      ioffset = 74 + isec1[70] + isec1[71] + isec1[72];
+	      for (jloop = 0; jloop < isec1[73]; jloop++)
+		fprintf(grprsm, "         %12d\n", isec1[ioffset+jloop]);
+	    }
+	  /*
+	    Post-auxiliary array.
+	  */
+	  fprintf(grprsm, " Post-auxiliary array. \n");
+	  ioffset = 74 + isec1[70] + isec1[71] + isec1[72] + isec1[73];
+	  if ( isec1[ioffset] == 0 )
+	    {
+	      fprintf(grprsm, "(None).\n");
+	    }
+	  else
+	    {
+	      fprintf(grprsm, "Number of items = %d\n", isec1[ioffset]);
+	      for (jloop = 1; jloop < isec1[ioffset]; jloop++)
+		fprintf(grprsm, "         %12d\n", isec1[ioffset+jloop]);
+	    }
+
+	  return;
+	}
+      /*
+	ECMWF Local definition 5.
+	(Forecast probability data)
+      */
+      if ( isec1[36] == 5 )
+	{
+	  fprintf(grprsm, " Forecast probability number          %9d\n", isec1[41]);
+	  fprintf(grprsm, " Total number of forecast probabilities %7d\n", isec1[42]);
+	  fprintf(grprsm, " Threshold units decimal scale factor %9d\n", isec1[43]);
+	  fprintf(grprsm, " Threshold indicator(1=lower,2=upper,3=both) %2d\n", isec1[44]);
+	  if ( isec1[44]  !=  2 )
+	    fprintf(grprsm, " Lower threshold value                %9d\n", isec1[45]);
+	  if ( isec1[44]  !=  1 )
+	    fprintf(grprsm, " Upper threshold value                %9d\n", isec1[46]);
+	  return;
+	}
+      /*
+	ECMWF Local definition 6.
+	(Surface temperature data)
+      */
+      if ( isec1[36] == 6 )
+	{
+	  iyear = isec1[43];
+	  if ( iyear > 100 )
+	    {
+	      if ( iyear < 19000000 ) iyear = iyear + 19000000;
+	      fprintf(grprsm, " Date of SST field used               %9d\n", iyear);
+	    }
+	  else
+	    fprintf(grprsm, "Date of SST field used               Not given\n");
+	}
+      if ( isec1[44] == 0 )
+	fprintf(grprsm, " Type of SST field (= climatology)    %9d\n", isec1[44]);
+      if ( isec1[44] == 1 )
+	fprintf(grprsm, " Type of SST field (= 1/1 degree)     %9d\n", isec1[44]);
+      if ( isec1[44] == 2 )
+	fprintf(grprsm, " Type of SST field (= 2/2 degree)     %9d\n", isec1[44]);
+
+      fprintf(grprsm, " Number of ICE fields used:           %9d\n", isec1[45]);
+
+      for (jloop = 1; jloop <= isec1[45]; jloop++)
+	{
+	  iyear = isec1[44+(jloop*2)];
+	  if ( iyear > 100 )
+	    {
+              if ( iyear < 19000000 ) iyear = iyear + 19000000;
+	      fprintf(grprsm, " Date of ICE field%3d                 %9d\n", jloop, iyear);
+	      fprintf(grprsm, " Satellite number (ICE field%3d)      %9d\n", jloop,
+		     isec1[45+(jloop*2)]);
+	    }
+	  else
+	    fprintf(grprsm, "Date of SST field used               Not given\n");
+	}
+      /*
+	ECMWF Local definition 7.
+	(Sensitivity data)
+      */
+      if ( isec1[36] == 7 )
+	{
+	  if ( isec1[38]  ==  51 )
+	    fprintf(grprsm, " Forecast number                      %9d\n", isec1[41]);
+	  if ( isec1[38]  !=  51 )
+	    fprintf(grprsm, " Iteration number                     %9d\n", isec1[41]);
+	  if ( isec1[38]  !=  52 )
+	    fprintf(grprsm, " Total number of diagnostics          %9d\n", isec1[42]);
+	  if ( isec1[38]  ==  52 )
+	    fprintf(grprsm, " No.interations in diag. minimisation %9d\n", isec1[42]);
+	  fprintf(grprsm, " Domain(0=Global,1=Europe,2=N.Hem.,3=S.Hem.) %2d\n", isec1[43]);
+	  fprintf(grprsm, " Diagnostic number                    %9d\n", isec1[44]);
+	}
+      /*
+	ECMWF Local definition 8.
+	(ECMWF re-analysis data)
+      */
+      if ( isec1[36] == 8 )
+	{
+	  if ( (isec1[39] == 1043) ||
+	       (isec1[39] == 1070) ||
+	       (isec1[39] == 1071) )
+	    {
+	      fprintf(grprsm, " Interval between reference times     %9d\n", isec1[41]);
+	      for (jloop = 43; jloop <= 54; jloop++)
+		{
+		  jiloop = jloop + 8;
+		  fprintf(grprsm, " ERA section 1 octet %2d.              %9d\n",
+			 jiloop, isec1[jloop-1]);
+		}
+	    }
+	  else
+	    {
+	      for (jloop = 42; jloop <= 54; jloop++)
+		{
+		  jiloop = jloop + 8;
+		  fprintf(grprsm, " ERA section 1 octet %2d.              %9d\n",
+			 jiloop, isec1[jloop-1]);
+		}
+	    }
+	  return;
+	}
+
+      if ( isec1[38] > 4  && isec1[38] < 9 )
+	{
+	  fprintf(grprsm, " Simulation number.                   %9d\n", isec1[41]);
+	  fprintf(grprsm, " Total number of simulations.         %9d\n", isec1[42]);
+	}
+      /*
+	ECMWF Local definition 9.
+	(Singular vectors and ensemble perturbations)
+      */
+      if ( isec1[36] == 9 )
+	{
+	  if ( isec1[38] == 60 )
+	    fprintf(grprsm, " Perturbed ensemble forecast number   %9d\n", isec1[41]);
+	  if ( isec1[38] == 61 )
+	    fprintf(grprsm, " Initial state perturbation number    %9d\n", isec1[41]);
+	  if ( isec1[38] == 62 )
+	    fprintf(grprsm, " Singular vector number               %9d\n", isec1[41]);
+	  if ( isec1[38] == 62 )
+	    {
+	      fprintf(grprsm, " Number of iterations                 %9d\n", isec1[42]);
+	      fprintf(grprsm, " Number of singular vectors computed  %9d\n", isec1[43]);
+	      fprintf(grprsm, " Norm used at initial time            %9d\n", isec1[44]);
+	      fprintf(grprsm, " Norm used at final time              %9d\n", isec1[45]);
+	      fprintf(grprsm, " Multiplication factor                %9d\n", isec1[46]);
+    	      fprintf(grprsm, " Latitude of north-west corner        %9d\n", isec1[47]);
+    	      fprintf(grprsm, " Longitude of north-west corner       %9d\n", isec1[48]);
+	      fprintf(grprsm, " Latitude of south-east corner        %9d\n", isec1[49]);
+	      fprintf(grprsm, " Longitude of south-east corner       %9d\n", isec1[50]);
+	      fprintf(grprsm, " Accuracy                             %9d\n", isec1[51]);
+	      fprintf(grprsm, " Number of singular vectors evolved   %9d\n", isec1[52]);
+	      fprintf(grprsm, " Ritz number one                      %9d\n", isec1[53]);
+	      fprintf(grprsm, " Ritz number two                      %9d\n", isec1[54]);
+	    }
+	}
+      /*
+	ECMWF Local definition 10.
+	(EPS tubes)
+      */
+      if ( isec1[36] == 10 )
+	{
+	  fprintf(grprsm, " Tube number                          %9d\n", isec1[41]);
+          fprintf(grprsm, " Total number of tubes                %9d\n", isec1[42]);
+          fprintf(grprsm, " Central cluster definition           %9d\n", isec1[43]);
+          fprintf(grprsm, " Parameter                            %9d\n", isec1[44]);
+          fprintf(grprsm, " Type of level                        %9d\n", isec1[45]);
+          fprintf(grprsm, " Northern latitude of domain of tubing%9d\n", isec1[46]);
+          fprintf(grprsm, " Western longitude of domain of tubing%9d\n", isec1[47]);
+          fprintf(grprsm, " Southern latitude of domain of tubing%9d\n", isec1[48]);
+          fprintf(grprsm, " Eastern longitude of domain of tubing%9d\n", isec1[49]);
+          fprintf(grprsm, " Tube number of operational forecast  %9d\n", isec1[50]);
+          fprintf(grprsm, " Tube number of control forecast      %9d\n", isec1[51]);
+          fprintf(grprsm, " Height/pressure of level             %9d\n", isec1[52]);
+          fprintf(grprsm, " Reference step                       %9d\n", isec1[53]);
+          fprintf(grprsm, " Radius of central cluster            %9d\n", isec1[54]);
+          fprintf(grprsm, " Ensemble standard deviation          %9d\n", isec1[55]);
+          fprintf(grprsm, " Dist.of tube extreme to ensemble mean%9d\n", isec1[56]);
+          fprintf(grprsm, " Number of forecasts in the tube      %9d\n", isec1[57]);
+
+          fprintf(grprsm, " List of ensemble forecast numbers:\n");
+          for (jloop = 1; jloop <=  isec1[57]; jloop++)
+	    fprintf(grprsm, "    %9d\n", isec1[57+jloop]);
+	}
+      /*
+	ECMWF Local definition 11.
+	(Supplementary data used by the analysis)
+      */
+      if ( isec1[36] == 11 )
+	{
+	  fprintf(grprsm, " Details of analysis which used the supplementary data:\n");
+	  fprintf(grprsm, "   Class                              %9d\n", isec1[41]);
+	  fprintf(grprsm, "   Type                               %9d\n", isec1[42]);
+	  fprintf(grprsm, "   Stream                             %9d\n", isec1[43]);
+	  /*
+	  sprintf(hversion, "%8d", isec1[44]);
+	  fprintf(grprsm, "   Version number/experiment identifier:   %4s\n", &hversion[4]);
+	  */
+	  iyear = isec1[45];
+	  if ( iyear > 50 )
+	    iyear = iyear + 1900;
+	  else
+	    iyear = iyear + 2000;
+
+	  fprintf(grprsm, "   Year                               %9d\n", iyear);
+	  fprintf(grprsm, "   Month                              %9d\n", isec1[46]);
+	  fprintf(grprsm, "   Day                                %9d\n", isec1[47]);
+	  fprintf(grprsm, "   Hour                               %9d\n", isec1[48]);
+	  fprintf(grprsm, "   Minute                             %9d\n", isec1[49]);
+	  fprintf(grprsm, "   Century                            %9d\n", isec1[50]);
+	  fprintf(grprsm, "   Originating centre                 %9d\n", isec1[51]);
+	  fprintf(grprsm, "   Sub-centre                         %9d\n", isec1[52]);
+	}
+      /*
+	ECMWF Local definition 12.
+      */
+      if ( isec1[36] == 12 )
+	{
+	  fprintf(grprsm, " (Mean, average, etc)\n");
+          fprintf(grprsm, " Start date of the period              %8d\n", isec1[41]);
+          fprintf(grprsm, " Start time of the period                  %4.4d\n", isec1[42]);
+          fprintf(grprsm, " Finish date of the period             %8d\n", isec1[43]);
+          fprintf(grprsm, " Finish time of the period                 %4.4d\n", isec1[44]);
+          fprintf(grprsm, " Verifying date of the period          %8d\n", isec1[45]);
+          fprintf(grprsm, " Verifying time of the period              %4.4d\n", isec1[46]);
+          fprintf(grprsm, " Code showing method                   %8d\n", isec1[47]);
+          fprintf(grprsm, " Number of different time intervals used  %5d\n", isec1[48]);
+          fprintf(grprsm, " List of different time intervals used:\n");
+          iprev  = isec1[49];
+          icurr  = 0;
+          icount = 0;
+          for (jloop = 1; jloop <= isec1[48]; jloop++)
+	    {
+	      icurr = isec1[48+jloop];
+	      if ( icurr != iprev )
+		{
+		  if ( icount == 1 )
+		    fprintf(grprsm, "  - interval %5.4d used       once\n", iprev);
+		  if ( icount == 2 )
+		    fprintf(grprsm, "  - interval %5.4d used       twice\n", iprev);
+		  if ( icount > 2 )
+		    fprintf(grprsm, "  - interval %5.4d used %5d times\n",  iprev, icount);
+		  iprev  = icurr;
+		  icount = 1;
+		}
+	      else
+		icount = icount + 1;
+	    }
+	  if ( icount == 1 )
+	    fprintf(grprsm, "  - interval %5.4d used       once\n", iprev);
+	  if ( icount == 2 )
+	    fprintf(grprsm, "  - interval %5.4d used       twice\n", iprev);
+	  if ( icount > 2 )
+	    fprintf(grprsm, "  - interval %5.4d used %5d times\n",  iprev, icount);
+	}
+      /*
+	ECMWF Local definition 13.
+	(Wave 2D spectra direction and frequency)
+      */
+      if ( isec1[36] == 13 )
+	{
+          fprintf(grprsm, " Direction number                     %9d\n", isec1[43]);
+	  fprintf(grprsm, " Frequency number                     %9d\n", isec1[44]);
+	  fprintf(grprsm, " Total number of directions           %9d\n", isec1[45]);
+	  fprintf(grprsm, " Total number of frequencies          %9d\n", isec1[46]);
+	  fprintf(grprsm, " Scale factor applied to directions   %9d\n", isec1[47]);
+	  fprintf(grprsm, " Scale factor applied to frequencies  %9d\n", isec1[48]);
+	  fprintf(grprsm, " List of directions:\n");
+          for (jloop = 1; jloop <= isec1[45]; jloop++)
+            {
+	      value = (float)(isec1[48+jloop])/(float)(isec1[47]);
+	      if ( isec1[43] == jloop )
+		fprintf(grprsm, " %2.2d:%15.7f   <-- this field value\n",  jloop, value);
+	      else
+		fprintf(grprsm, "%2.2d:%15.7f\n",  jloop, value);
+            }
+	  fprintf(grprsm, " List of frequencies:\n");
+          for (jloop = 1; jloop <= isec1[46]; jloop++)
+	    {
+	      value = (float)(isec1[48+isec1[45]+jloop])/(float)(isec1[48]);
+	      if ( isec1[44] == jloop )
+		fprintf(grprsm, " %2.2d:%15.7f   <-- this field value\n",  jloop, value);
+	      else
+		fprintf(grprsm, "%2.2d:%15.7f\n",  jloop, value);
+
+	      if ( isec1[49+isec1[45]+isec1[46]] != 0 )
+		{
+		  fprintf(grprsm, " System number (65535 = missing)      %9d\n",
+			 isec1[49+isec1[45]+isec1[46]]);
+		  fprintf(grprsm, " Method number (65535 = missing)      %9d\n",
+			 isec1[50+isec1[45]+isec1[46]]);
+		}
+	    }
+	  /*
+	    ECMWF Local definition 14.
+	    (Brightness temperature)
+	  */
+	  if ( isec1[36] == 14 )
+	    {
+	      fprintf(grprsm, " Channel number                       %9d\n", isec1[43]);
+	      fprintf(grprsm, " Scale factor applied to frequencies  %9d\n", isec1[44]);
+	      fprintf(grprsm, " Total number of frequencies          %9d\n", isec1[45]);
+	      fprintf(grprsm, " List of frequencies:\n");
+              for (jloop = 1; jloop <= isec1[45]; jloop++)
+		{
+		  value = (float)(isec1[45+jloop])/(float)(isec1[44]);
+		  if ( isec1[43] == jloop )
+		    fprintf(grprsm, " %3d:%15.9f   <-- this channel\n", jloop, value);
+		  else
+		    fprintf(grprsm, " %3d:%15.9f\n", jloop, value);
+		}
+	    }
+	  /*
+	    ECMWF Local definition 15.
+	    (Ocean ensemble seasonal forecast)
+	  */
+	  if ( isec1[36] == 15 )
+	    {
+	      fprintf(grprsm, " Ensemble member number               %9d\n", isec1[41]);
+	      fprintf(grprsm, " System number                        %9d\n", isec1[42]);
+	      fprintf(grprsm, " Method number                        %9d\n", isec1[43]);
+	    }
+	  /*
+	    ECMWF Local definition 16.
+	    (Seasonal forecast monthly mean atmosphere data)
+	  */
+        if ( isec1[36] == 16 )
+	  {
+	    fprintf(grprsm, " Ensemble member number               %9d\n", isec1[41]);
+	    fprintf(grprsm, " System number                        %9d\n", isec1[43]);
+	    fprintf(grprsm, " Method number                        %9d\n", isec1[44]);
+	    fprintf(grprsm, " Verifying month                      %9d\n", isec1[45]);
+	    fprintf(grprsm, " Averaging period                     %9d\n", isec1[46]);
+	  }
+	/*
+	  ECMWF Local definition 17.
+	  (Sst or sea-ice used by analysis)
+	*/
+        if ( isec1[36] == 17 )
+	  {
+	    iyear = isec1[43];
+	    if ( iyear > 100 )
+	      {
+		if ( iyear < 19000000 ) iyear = iyear + 19000000;
+		fprintf(grprsm, " Date of sst/ice field used           %9d\n", iyear);
+	      }
+	    else
+              fprintf(grprsm, " Date of sst/ice field used           Not given\n");
+      
+	    if ( isec1[44] == 0 )
+	      fprintf(grprsm, " Type of sst/ice field (= climatology)%9d\n", isec1[44]);
+	    if ( isec1[44] == 1 )
+	      fprintf(grprsm, " Type of sst/ice field (= 1/1 degree) %9d\n", isec1[44]);
+	    if ( isec1[44] == 2 )
+	      fprintf(grprsm, " Type of sst/ice field (= 2/2 degree) %9d\n", isec1[44]);
+
+	    fprintf(grprsm, " Number of ICE fields used:           %9d\n", isec1[45]);
+
+	    for (jloop = 1; jloop < isec1[45]; jloop++)
+	      {
+		iyear = isec1[44+(jloop*2)];
+		if ( iyear > 100 )
+		  {
+		    if ( iyear < 19000000 ) iyear = iyear + 19000000;
+		    fprintf(grprsm, " Date of ICE field%3d                 %9d\n", jloop,
+			   iyear);
+		    fprintf(grprsm, " Satellite number (ICE field%3d)      %9d\n", jloop,
+			   isec1[45+(jloop*2)]);
+		  }
+		else
+		  fprintf(grprsm, "Date of sst/ice field used           Not given\n");
+	      } 
+	  }
+	}
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 3 . Print Washington ensemble product information.
+    -----------------------------------------------------------------
+  */
+  /*
+    Washington EPS products (but not reformatted Washington EPS
+    products.
+  */
+  if ( (isec1[1] == 7 && isec1[23] == 1) && (! isec1[21] == 98) )
+    {
+      /*   CALL KWPRS1 (iSEC0,iSEC1)*/
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 4 . Print local MPIM information.
+    -----------------------------------------------------------------
+  */
+  if (isec1[ 1] == 252 && isec1[36] == 1)
+    {
+      fprintf(grprsm, " MPIM local usage identifier.         %9d\n", isec1[36]);
+      fprintf(grprsm, " Type of ensemble forecast            %9d\n", isec1[37]);
+      fprintf(grprsm, " Individual ensemble member           %9d\n", isec1[38]);
+      fprintf(grprsm, " Number of forecasts in ensemble      %9d\n", isec1[39]);
+    }
+}
+
+void printQuasi(int *isec2)
+{
+  /*
+
+    Print the qusai-regular information in the Grid Description
+    Section (Section 2) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec2 - Array of decoded integers from Section 2.
+
+    Comments:
+
+       Only data representation types catered for are Gaussian
+       grid, latitude/longitude grid, Spherical Harmonics,
+       Polar stereographic and Space view perspective.
+
+    Converted from EMOS routine PTQUASI.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+
+  char yout[64];
+  int nextlat, nrepeat, latcnt;
+  int j;
+  int ntos;
+
+  /*
+    -----------------------------------------------------------------
+    Section 1. Print quasi-grid data.
+    -----------------------------------------------------------------
+  */
+  /*
+    See if scanning is north->south or south->north
+  */
+  fprintf(grprsm, "  Number of points along a parallel varies.\n");
+
+  ntos = ( fmod((double) isec2[10], 128.) < 64 );
+
+  if ( ntos )
+    fprintf(grprsm, "  Number of points.   Parallel. (North to South)\n");
+  else
+    fprintf(grprsm, "  Number of points.   Parallel. (South to North)\n");
+
+  /*  Display number of points for each latitude */
+  latcnt  = isec2[2];
+  nextlat = 0;
+  memset(yout, ' ', (size_t) 11);
+
+  for ( j = 0; j < latcnt; j++ )
+    {
+      nextlat = nextlat + 1;
+      sprintf(yout, "%4d", nextlat);
+
+      /*       Finished?  */
+      if ( nextlat > latcnt ) break;
+      if ( nextlat == latcnt )
+	{
+	  fprintf(grprsm, " %5d                %-12s\n", isec2[nextlat+21], yout);
+	  break;
+	}
+      /*
+	Look for neighbouring latitudes with same number of points
+      */
+      nrepeat = 0;
+
+    LABEL110:
+      /*
+	If neighbouring latitudes have same number of points
+	increase the repeat count.
+      */
+      if ( isec2[nextlat+21+1] == isec2[nextlat+21] )
+	{
+          nrepeat = nrepeat + 1;
+          nextlat = nextlat + 1;
+	  if ( nextlat < latcnt ) goto LABEL110;
+	}
+      /*
+	Display neighbouring latitudes with same number of points as
+	'nn to mm'.
+      */
+      if ( nrepeat >= 1 )
+	{
+	  strncpy(yout+4, " to", 3);
+	  sprintf(yout+7, "%5d", nextlat);
+        }
+      fprintf(grprsm, " %5d                %-12s\n", isec2[nextlat+21], yout);
+      memset(yout, ' ', (size_t) 11);
+    }
+}
+
+void gribPrintSec2DP(int *isec0, int *isec2, double *fsec2)
+{
+  /*
+
+    Print the information in the Grid Description
+    Section (Section 2) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec0  - Array of decoded integers from Section 0
+
+       isec2  - Array of decoded integers from Section 2
+
+       fsec2  - Array of decoded floats from Section 2
+
+    Comments:
+
+       Only data representation types catered for are Gaussian
+       grid, latitude/longitude grid, Spherical Harmonics,
+       Polar stereographic and Space view perspective.
+
+
+    Converted from EMOS routine GRPRS2.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+
+  int i, ibit, iedit, ierr, iout, iresol;
+
+  grsdef();
+  /*
+    -----------------------------------------------------------------
+    Section 1 . Print GRIB Edition number.
+    -----------------------------------------------------------------
+  */
+  iedit = isec0[1];
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " Section 2 - Grid Description Section.\n");
+  fprintf(grprsm, " -------------------------------------\n");
+  /*
+    -----------------------------------------------------------------
+    Section 2 . Print spherical harmonic data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] == 50 || isec2[0] == 60 || 
+       isec2[0] == 70 || isec2[0] == 80 )
+    {
+      fprintf(grprsm, " Data represent type = spectral     (Table 6) %9d\n", isec2[0]);
+      fprintf(grprsm, " J - Pentagonal resolution parameter.         %9d\n", isec2[1]);
+      fprintf(grprsm, " K - Pentagonal resolution parameter.         %9d\n", isec2[2]);
+      fprintf(grprsm, " M - Pentagonal resolution parameter.         %9d\n", isec2[3]);
+      fprintf(grprsm, " Representation type (Table 9)                %9d\n", isec2[4]);
+      fprintf(grprsm, " Representation mode (Table 10).              %9d\n", isec2[5]);
+      for (i = 7; i <= 11; i++)
+        fprintf(grprsm, " Not used.                                    %9d\n", isec2[i-1]);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 3 . Print Gaussian grid data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] ==  4 || isec2[0] == 14 || 
+       isec2[0] == 24 || isec2[0] == 34 )
+    {
+      fprintf(grprsm, " (Southern latitudes and Western longitudes are negative.)\n");
+      fprintf(grprsm, " Data represent type = gaussian     (Table 6) %9d\n", isec2[0]);
+      /*
+	Quasi-regular grids introduced in Edition 1.
+      */
+      if ( isec2[16] == 0 || iedit < 1 )
+	fprintf(grprsm, " Number of points along a parallel.           %9d\n", isec2[1]);
+      else
+      	printQuasi(isec2);
+
+      fprintf(grprsm, " Number of points along a meridian.           %9d\n", isec2[2]);
+      fprintf(grprsm, " Latitude of first grid point.                %9d\n", isec2[3]);
+      fprintf(grprsm, " Longitude of first grid point.               %9d\n", isec2[4]);
+
+      ibit = 8;
+      iresol = isec2[5] + isec2[17] + isec2[18];
+      prtbin(iresol, ibit, &iout, &ierr);
+
+      fprintf(grprsm, " Resolution and components flag.               %8.8d\n", iout);
+      fprintf(grprsm, " Latitude of last grid point.                 %9d\n", isec2[6]);
+      fprintf(grprsm, " Longitude of last grid point.                %9d\n", isec2[7]);
+      /*
+	Print increment if given.
+      */
+      if ( isec2[5] == 128 )
+	fprintf(grprsm, " i direction (East-West) increment.           %9d\n", isec2[8]);
+      else
+	fprintf(grprsm, " i direction (East-West) increment            Not given\n");
+
+      fprintf(grprsm, " Number of parallels between pole and equator.%9d\n", isec2[9]);
+
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 4 . Print Latitude / longitude grid data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] ==  0 || isec2[0] == 10 || 
+       isec2[0] == 20 || isec2[0] == 30 )
+    {
+      fprintf(grprsm, " (Southern latitudes and Western longitudes are negative.)\n");
+      fprintf(grprsm, " Data represent type = lat/long     (Table 6) %9d\n", isec2[0]);
+      /*
+	Quasi-regular lat/long grids also possible.
+      */
+      if ( isec2[16] == 0 )
+	fprintf(grprsm, " Number of points along a parallel.           %9d\n", isec2[1]);
+      else
+        printQuasi(isec2);
+
+      fprintf(grprsm, " Number of points along a meridian.           %9d\n", isec2[2]);
+      fprintf(grprsm, " Latitude of first grid point.                %9d\n", isec2[3]);
+      fprintf(grprsm, " Longitude of first grid point.               %9d\n", isec2[4]);
+
+      ibit = 8;
+      iresol = isec2[5] + isec2[17] + isec2[18];
+      prtbin(iresol, ibit, &iout, &ierr);
+
+      fprintf(grprsm, " Resolution and components flag.               %8.8d\n", iout);
+      fprintf(grprsm, " Latitude of last grid point.                 %9d\n", isec2[6]);
+      fprintf(grprsm, " Longitude of last grid point.                %9d\n", isec2[7]);
+      /*
+	Print increment if given.
+      */
+      if ( isec2[8] < 0 )
+	fprintf(grprsm, " i direction (East-West) increment            Not given\n");
+      else
+	fprintf(grprsm, " i direction (East-West) increment.           %9d\n", isec2[8]);
+
+      if ( isec2[9] < 0 )
+	fprintf(grprsm, " j direction (North-South) increment          Not given\n");
+      else
+	fprintf(grprsm, " j direction (North-South) increment.         %9d\n", isec2[9]);
+    
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 5 . Print polar stereographic data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] == 5 )
+    {
+      fprintf(grprsm, " (Southern latitudes and Western longitudes are negative.)\n");
+      fprintf(grprsm, " Data represent type = polar stereo (Table 6) %9d\n", isec2[0]);
+      fprintf(grprsm, " Number of points along X axis.               %9d\n", isec2[1]);
+      fprintf(grprsm, " Number of points along Y axis.               %9d\n", isec2[2]);
+      fprintf(grprsm, " Latitude of first grid point.                %9d\n", isec2[3]);
+      fprintf(grprsm, " Longitude of first grid point.               %9d\n", isec2[4]);
+      ibit = 8;
+      iresol = isec2[17] + isec2[18];
+      prtbin(iresol, ibit, &iout, &ierr);
+      fprintf(grprsm, " Resolution and components flag.               %8.8d\n", iout);
+      fprintf(grprsm, " Orientation of the grid.                     %9d\n", isec2[6]);
+      fprintf(grprsm, " X direction increment.                       %9d\n", isec2[8]);
+      fprintf(grprsm, " Y direction increment.                       %9d\n", isec2[9]);
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      fprintf(grprsm, " Projection centre flag.                      %9d\n", isec2[12]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 6 . Print Lambert conformal data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] == 3 )
+    {
+      fprintf(grprsm, " (Southern latitudes and Western longitudes are negative.)\n");
+      fprintf(grprsm, " Data represent type = Lambert      (Table 6) %9d\n", isec2[0]);
+      fprintf(grprsm, " Number of points along X axis.               %9d\n", isec2[1]);
+      fprintf(grprsm, " Number of points along Y axis.               %9d\n", isec2[2]);
+      fprintf(grprsm, " Latitude of first grid point.                %9d\n", isec2[3]);
+      fprintf(grprsm, " Longitude of first grid point.               %9d\n", isec2[4]);
+      ibit = 8;
+      iresol = isec2[17] + isec2[18] + isec2[5];
+      prtbin(iresol, ibit, &iout, &ierr);
+      fprintf(grprsm, " Resolution and components flag.               %8.8d\n", iout);
+      fprintf(grprsm, " Orientation of the grid.                     %9d\n", isec2[6]);
+      fprintf(grprsm, " X direction increment.                       %9d\n", isec2[8]);
+      fprintf(grprsm, " Y direction increment.                       %9d\n", isec2[9]);
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      fprintf(grprsm, " Projection centre flag.                      %9d\n", isec2[12]);
+      fprintf(grprsm, " Latitude intersection 1 - Latin 1 -.         %9d\n", isec2[13]);
+      fprintf(grprsm, " Latitude intersection 2 - Latin 2 -.         %9d\n", isec2[14]);
+      fprintf(grprsm, " Latitude of Southern Pole.                   %9d\n", isec2[19]);
+      fprintf(grprsm, " Longitude of Southern Pole.                  %9d\n", isec2[20]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 7 . Print space view perspective or orthographic data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] == 90 )
+    {
+      fprintf(grprsm, " (Southern latitudes and Western longitudes are negative.)\n");
+      fprintf(grprsm, " Data represent type = space/ortho  (Table 6) %9d\n", isec2[0]);
+      fprintf(grprsm, " Number of points along X axis.               %9d\n", isec2[1]);
+      fprintf(grprsm, " Number of points along Y axis.               %9d\n", isec2[2]);
+      fprintf(grprsm, " Latitude of sub-satellite point.             %9d\n", isec2[3]);
+      fprintf(grprsm, " Longitude of sub-satellite point.            %9d\n", isec2[4]);
+      iresol = isec2[17] + isec2[18];
+      fprintf(grprsm, " Diameter of the earth in x direction.        %9d\n", isec2[6]);
+      fprintf(grprsm, " Y coordinate of sub-satellite point.         %9d\n", isec2[9]);
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      fprintf(grprsm, " Orientation of the grid.                     %9d\n", isec2[6]);
+      fprintf(grprsm, " Altitude of the camera.                      %9d\n", isec2[13]);
+      fprintf(grprsm, " Y coordinate of origin of sector image.      %9d\n", isec2[14]);
+      fprintf(grprsm, " X coordinate of origin of sector image.      %9d\n", isec2[15]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 7.5 . Print ocean data
+    -----------------------------------------------------------------
+  */
+  /*
+  if ( isec2[0] == 192 && isec1[1] == 98 )
+    {
+      fprintf(grprsm, " Data represent type = ECMWF ocean  (Table 6) %9d\n", isec2[0]);
+      if ( isec2[1] ==  32767 )
+	fprintf(grprsm, " Number of points along the first axis.       Not used\n");
+      else
+	fprintf(grprsm, " Number of points along the first axis.       %9d\n", isec2[1]);
+
+      if ( isec2[2] ==  32767 )
+	fprintf(grprsm, " Number of points along the second axis.      Not used\n");
+      else
+	fprintf(grprsm, " Number of points along the second axis.      %9d\n", isec2[2]);
+
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      goto LABEL800;
+    }
+    */
+  /*
+    -----------------------------------------------------------------
+    Section 7.6 . Print triangular data
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] == 192 /* && isec1[1] == 78 */ )
+    {
+      fprintf(grprsm, " Data represent type = triangular   (Table 6) %9d\n", isec2[0]);
+      fprintf(grprsm, " Number of factor 2 in factorisation of Ni.   %9d\n", isec2[1]);
+      fprintf(grprsm, " Number of factor 3 in factorisation of Ni.   %9d\n", isec2[2]);
+      fprintf(grprsm, " Number of diamonds (Nd).                     %9d\n", isec2[3]);
+      fprintf(grprsm, " Number of triangular subdivisions of the\n");
+      fprintf(grprsm, "           icosahedron (Ni).                  %9d\n", isec2[4]);
+      fprintf(grprsm, " Flag for orientation of diamonds (Table A).  %9d\n", isec2[5]);
+      fprintf(grprsm, " Latitude of pole point.                      %9d\n", isec2[6]);
+      fprintf(grprsm, " Longitude of pole point.                     %9d\n", isec2[7]);
+      fprintf(grprsm, " Longitude of the first diamond.              %9d\n", isec2[8]);
+      fprintf(grprsm, " Flag for storage sequence (Table B).         %9d\n", isec2[9]);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Drop through to here => representation type not catered for.
+    -----------------------------------------------------------------
+  */
+  fprintf(grprsm, "GRPRS2 :Data representation type not catered for -%d\n", isec2[0]);
+
+  goto LABEL900;
+  /*
+    -----------------------------------------------------------------
+    Section 8 . Print vertical coordinate parameters,
+                rotated grid information,
+                stretched grid information, if any.
+    -----------------------------------------------------------------
+  */
+ LABEL800:;
+  /*
+    Vertical coordinate parameters ...
+  */
+  if ( isec2[11] != 0 )
+    {
+      fprintf(grprsm, " \n");
+      fprintf(grprsm, " Vertical Coordinate Parameters.\n");
+      fprintf(grprsm, " -------------------------------\n");
+      for ( i = 10; i < isec2[11]+10; i++ )
+	fprintf(grprsm, "    %20.12f\n", fsec2[i]);
+    }
+  /*
+    Rotated and stretched grids introduced in Edition 1.
+  */
+  if ( iedit < 1 ) goto LABEL900;
+  /*
+    Rotated grid information ...
+  */
+  if ( isec2[0] == 10 || isec2[0] == 30 || 
+       isec2[0] == 14 || isec2[0] == 34 || 
+       isec2[0] == 60 || isec2[0] == 80 || 
+       isec2[0] == 30 )
+    {
+      fprintf(grprsm, " \n");
+      fprintf(grprsm, " Latitude of southern pole of rotation.       %9d\n", isec2[12]);
+      fprintf(grprsm, " Longitude of southern pole of rotation.      %9d\n", isec2[13]);
+      fprintf(grprsm, " Angle of rotation.                     %20.10f\n", fsec2[0]);
+    }
+  /*
+    Stretched grid information ...
+  */
+  if ( isec2[0] == 20 || isec2[0] == 30 || 
+       isec2[0] == 24 || isec2[0] == 34 || 
+       isec2[0] == 70 || isec2[0] == 80 )
+    {
+      fprintf(grprsm, " \n");
+      fprintf(grprsm, " Latitude of pole of stretching.              %9d\n", isec2[14]);
+      fprintf(grprsm, " Longitude of pole of stretching.             %9d\n", isec2[15]);
+      fprintf(grprsm, " Stretching factor.                     %20.10f\n", fsec2[1]);
+    }
+
+ LABEL900:;
+
+  return;
+}
+
+void gribPrintSec2SP(int *isec0, int *isec2, float  *fsec2sp)
+{
+  int inum;
+  int j;
+  double *fsec2;
+
+  inum = 10 + isec2[11];
+
+  fsec2 = (double *) malloc(inum*sizeof(double));
+  if ( fsec2 == NULL ) SysError("No Memory!");
+
+  for ( j = 0; j < inum; j++ )
+     fsec2[j] = fsec2sp[j];
+  
+  gribPrintSec2DP(isec0, isec2, fsec2);
+
+  free(fsec2);
+}
+
+void gribPrintSec3DP(int *isec0, int *isec3, double *fsec3)
+{
+  /*
+
+    Print the information in the Bit-Map Section
+    (Section 3) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec0  - Array of decoded integers from Section 0
+
+       isec3  - Array of decoded integers from Section 3
+
+       fsec3  - Array of decoded floats from Section 3
+
+
+    Converted from EMOS routine GRPRS3.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+
+  grsdef();
+
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " Section 3 - Bit-map Section.\n");
+  fprintf(grprsm, " -------------------------------------\n");
+
+  if ( isec3[0] != 0 )
+    fprintf(grprsm, " Predetermined bit-map number.                %9d\n", isec3[0]);
+  else
+    fprintf(grprsm, " No predetermined bit-map.\n");
+
+  fprintf(grprsm, " Missing data value for integer data.    %14d\n", isec3[1]);
+
+  fprintf(grprsm, " Missing data value for real data. %20.6g\n", fsec3[1]);
+}
+
+void gribPrintSec3SP(int *isec0, int *isec3, float  *fsec3sp)
+{
+  double fsec3[2];
+
+  fsec3[0] = fsec3sp[0];
+  fsec3[1] = fsec3sp[1];
+  
+  gribPrintSec3DP(isec0, isec3, fsec3);
+}
+
+void gribPrintSec4DP(int *isec0, int *isec4, double *fsec4)
+{
+  /*
+
+    Print the information in the Binary Data Section
+    (Section 4) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec0  - Array of decoded integers from Section 0
+
+       isec4  - Array of decoded integers from Section 4
+
+       fsec4  - Array of decoded floats from Section 4
+
+
+    Converted from EMOS routine GRPRS4.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+  int inum;
+  int j;
+
+  grsdef();
+
+  /*
+    -----------------------------------------------------------------
+    Section 1 . Print integer information from isec4.
+    -----------------------------------------------------------------
+  */
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " Section 4 - Binary Data  Section.\n");
+  fprintf(grprsm, " -------------------------------------\n");
+
+  fprintf(grprsm, " Number of data values coded/decoded.         %9d\n", isec4[0]);
+  fprintf(grprsm, " Number of bits per data value.               %9d\n", isec4[1]);
+  fprintf(grprsm, " Type of data       (0=grid pt, 128=spectral).%9d\n", isec4[2]);
+  fprintf(grprsm, " Type of packing    (0=simple, 64=complex).   %9d\n", isec4[3]);
+  fprintf(grprsm, " Type of data       (0=float, 32=integer).    %9d\n", isec4[4]);
+  fprintf(grprsm, " Additional flags   (0=none, 16=present).     %9d\n", isec4[5]);
+  fprintf(grprsm, " Reserved.                                    %9d\n", isec4[6]);
+  fprintf(grprsm, " Number of values   (0=single, 64=matrix).    %9d\n", isec4[7]);
+  fprintf(grprsm, " Secondary bit-maps (0=none, 32=present).     %9d\n", isec4[8]);
+  fprintf(grprsm, " Values width       (0=constant, 16=variable).%9d\n", isec4[9]);
+  /*
+    If complex packing ..
+  */
+  if ( isec4[3] == 64 )
+    {
+      if ( isec4[2] == 128 )
+	{
+	  fprintf(grprsm, " Byte offset of start of packed data (N).     %9d\n", isec4[15]);
+	  fprintf(grprsm, " Power (P * 1000).                            %9d\n", isec4[16]);
+	  fprintf(grprsm, " Pentagonal resolution parameter J for subset.%9d\n", isec4[17]);
+	  fprintf(grprsm, " Pentagonal resolution parameter K for subset.%9d\n", isec4[18]);
+	  fprintf(grprsm, " Pentagonal resolution parameter M for subset.%9d\n", isec4[19]);
+	}
+      else
+	{
+	  fprintf(grprsm, " Bits number of 2nd order values    (none=>0).%9d\n", isec4[10]);
+	  fprintf(grprsm, " General extend. 2-order packing (0=no,8=yes).%9d\n", isec4[11]);
+	  fprintf(grprsm, " Boustrophedonic ordering        (0=no,4=yes).%9d\n", isec4[12]);
+	  fprintf(grprsm, " Spatial differencing order          (0=none).%9d\n", isec4[13]+isec4[14]);
+        }
+    }
+  /*
+    Number of non-missing values
+  */
+  if ( isec4[20] != 0 )
+    fprintf(grprsm, " Number of non-missing values                 %9d\n", isec4[20]);
+  /*
+    Information on matrix of values , if present.
+  */
+  if ( isec4[7] == 64 )
+    {
+      fprintf(grprsm, " First dimension (rows) of each matrix.       %9d\n", isec4[49]);
+      fprintf(grprsm, " Second dimension (columns) of each matrix.   %9d\n", isec4[50]);
+      fprintf(grprsm, " First dimension coordinate values definition.%9d\n", isec4[51]);
+      fprintf(grprsm, " (Code Table 12)\n");
+      fprintf(grprsm, " NC1 - Number of coefficients for 1st dimension.%7d\n", isec4[52]);
+      fprintf(grprsm, " Second dimension coordinate values definition.%8d\n", isec4[53]);
+      fprintf(grprsm, " (Code Table 12)\n");
+      fprintf(grprsm, " NC2 - Number of coefficients for 2nd dimension.%7d\n", isec4[54]);
+      fprintf(grprsm, " 1st dimension physical signifance (Table 13). %8d\n", isec4[55]);
+      fprintf(grprsm, " 2nd dimension physical signifance (Table 13).%8d\n", isec4[56]);
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 2. Print values from fsec4.
+    -----------------------------------------------------------------
+  */
+
+  inum = isec4[0];
+  if ( inum <  0 ) inum = - inum;
+  if ( inum > 20 ) inum = 20;
+  /*
+    Print first inum values.
+  */
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " First %4d data values.\n", inum);
+
+  if ( isec4[4] == 0 )
+    {
+      /*
+	Print real values ...
+      */
+      for ( j = 0; j < inum; j++ )
+	{
+	  if ( fabs(fsec4[j]) > 0 )
+	    {
+	      if ( fabs(fsec4[j]) >= 0.1 && fabs(fsec4[j]) <= 1.e8 )
+		fprintf(grprsm, " %#16.8G    \n", fsec4[j]);
+	      else
+		fprintf(grprsm, " %#20.8E\n", fsec4[j]);
+	    }
+	  else
+	    fprintf(grprsm, " %#16.0f    \n", fabs(fsec4[j]));
+	}
+    }
+  else
+    {
+      /*
+	Print integer values ...
+      */
+      fprintf(grprsm, " Print of integer values not supported\n");
+      /*
+        CALL SETPAR(IBIT,IDUM,IDUM)
+        DO 212 J=1,INUM
+           INSPT = 0
+           CALL INXBIT(IVALUE,1,INSPT,FSEC4(J),1,IBIT,IBIT,'C',IRET)
+           WRITE (*,9033) IVALUE
+ 9033 FORMAT(' ',I15)
+  212   CONTINUE
+      ENDIF
+      */
+    }
+}
+
+void gribPrintSec4SP(int *isec0, int *isec4, float  *fsec4sp)
+{
+  int inum;
+  int j;
+  double fsec4[20];
+
+  inum = isec4[0];
+  if ( inum <  0 ) inum = -inum;
+  if ( inum > 20 ) inum = 20;
+
+  for ( j = 0; j < inum; j++ ) fsec4[j] = fsec4sp[j];
+  
+  gribPrintSec4DP(isec0, isec4, fsec4);
+}
+
+void gribPrintSec4Wave(int *isec4)
+{
+  /*
+
+    Print the wave coordinate information in the Binary Data
+    Section (Section 4) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec4 - Array of decoded integers from Section 4
+
+    Comments:
+
+       Wave coordinate information held in isec4 are 32-bit floats,
+       hence the PTEMP and NTEMP used for printing are 4-byte variables.
+
+
+    Converted from EMOS routine GRPRS4W.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+  int    jloop;
+  int    ntemp[100];
+  float *ptemp;
+
+  grsdef();
+
+  /*
+    -----------------------------------------------------------------
+    Section 1 . Print integer information from isec4.
+    -----------------------------------------------------------------
+  */
+  fprintf(grprsm, " Coefficients defining first dimension coordinates:\n");
+  for ( jloop = 0; jloop < isec4[52]; jloop++ )
+    {
+      ntemp[jloop] = isec4[59 + jloop];
+      ptemp = (float *) &ntemp[jloop];
+      fprintf(grprsm, "%20.10f\n", *ptemp);
+    }
+  fprintf(grprsm, " Coefficients defining second dimension coordinates:\n");
+  for ( jloop = 0; jloop < isec4[54]; jloop++ )
+    {
+      ntemp[jloop] = isec4[59 + isec4[52] + jloop];
+      ptemp = (float *) &ntemp[jloop];
+      fprintf(grprsm, "%20.10f\n", *ptemp);
+    }
+}
+#include <string.h>
+
+int  BitsPerInt = (int) (sizeof(int) * 8);
+
+
+
+/* GRIB block 0 - indicator block */
+static
+void encodeIS(GRIBPACK *lGrib, long *gribLen)
+{
+  long z = *gribLen;
+
+  lGrib[0] = 'G';
+  lGrib[1] = 'R';
+  lGrib[2] = 'I';
+  lGrib[3] = 'B';
+
+  /* 
+   * lGrib[4]-lGrib[6] contains full length of grib record. 
+   * included before finished CODEGB
+   */
+
+  z = 7;   
+  Put1Byte(1); /* grib version */
+  z = 8;
+
+  *gribLen = z;
+}
+
+/* GRIB block 5 - end block */
+static
+void encodeES(GRIBPACK *lGrib, long *gribLen, long bdsstart)
+{
+  long z = *gribLen;
+
+  lGrib[z++] = '7';
+  lGrib[z++] = '7';
+  lGrib[z++] = '7';
+  lGrib[z++] = '7';
+
+  if ( z > JP23SET )
+    {
+      long itemp;
+      long bdslen = z - 4;
+      /*
+      fprintf(stderr, "Abort: GRIB record too large (max = %d)!\n", JP23SET);
+      exit(1);
+      */
+      /*
+	If a very large product, the section 4 length field holds
+	the number of bytes in the product after section 4 upto
+	the end of the padding bytes.
+	This is a fixup to get round the restriction on product lengths
+	due to the count being only 24 bits. It is only possible because
+	the (default) rounding for GRIB products is 120 bytes.
+      */
+      while ( z%120 ) lGrib[z++] = 0;
+
+      if ( z > JP23SET*120 )
+	{
+	  fprintf(stderr, "Abort: GRIB record too large (max = %d)!\n", JP23SET*120);
+	  exit(1);
+	}
+
+      itemp = z / (-120);
+      itemp = JP23SET - itemp + 1;
+
+      lGrib[4] = itemp >> 16;
+      lGrib[5] = itemp >>  8;
+      lGrib[6] = itemp;
+
+      bdslen = z - bdslen;
+      lGrib[bdsstart  ] = bdslen >> 16;
+      lGrib[bdsstart+1] = bdslen >>  8;
+      lGrib[bdsstart+2] = bdslen;
+    }
+  else
+    {
+      lGrib[4] = z >> 16;
+      lGrib[5] = z >>  8;
+      lGrib[6] = z;
+
+      while ( z%8 ) lGrib[z++] = 0;
+    }
+
+  *gribLen = z;
+}
+
+/* GRIB block 1 - product definition block. */
+
+#define DWD_extension_253_len 38
+#define DWD_extension_254_len 26
+#define ECMWF_extension_1_len 24
+#define MCH_extension_254_len 19
+#define MPIM_extension_1_len  18
+
+static
+long getLocalExtLen(int *isec1)
+{
+  long extlen = 0;
+
+  if ( ISEC1_LocalFLag )
+    {
+      if ( ISEC1_CenterID == 78 ) 
+	{
+	  if      ( isec1[36] == 254 ) extlen = DWD_extension_254_len;
+	  else if ( isec1[36] == 253 ) extlen = DWD_extension_253_len;
+	}
+      else if ( ISEC1_CenterID == 98 )
+        {
+	  if ( isec1[36] == 1 )   extlen = ECMWF_extension_1_len;
+        }
+      else if ( ISEC1_CenterID == 215 )
+        {
+	  if ( isec1[36] == 254 ) extlen = MCH_extension_254_len;
+        }
+      else if ( ISEC1_CenterID == 252 )
+        {
+	  if ( isec1[36] == 1 ) extlen = MPIM_extension_1_len;
+        }
+    }
+
+  return (extlen);
+}
+
+static
+long getPdsLen(int *isec1)
+{
+  long pdslen = 28;
+
+  pdslen += getLocalExtLen(isec1);
+
+  return (pdslen);
+}
+
+static
+void encodePDS_DWD_local_Extension_254(GRIBPACK *lGrib, long *zs, int *isec1)
+{
+  int isvn;
+  long localextlen, i;
+  long z = *zs;
+
+  localextlen = getLocalExtLen(isec1);
+  for ( i = 0; i < localextlen-2; i++ )
+    {
+      Put1Byte(isec1[24+i]);
+    }
+
+  isvn = isec1[49] << 15 | isec1[48]; /* DWD experiment identifier    */
+  Put2Byte(isvn);             /* DWD run type (0=main, 2=ass, 3=test) */
+
+  *zs = z;
+}
+
+static
+void encodePDS_DWD_local_Extension_253(GRIBPACK *lGrib, long *zs, int *isec1)
+{
+  int isvn;
+  long localextlen, i;
+  long z = *zs;
+
+  localextlen = DWD_extension_254_len;
+  for ( i = 0; i < localextlen-2; i++ )
+    {
+      Put1Byte(isec1[24+i]);
+    }
+
+  isvn = isec1[49] << 15 | isec1[48]; /* DWD experiment identifier    */
+  Put2Byte(isvn);             /* DWD run type (0=main, 2=ass, 3=test) */
+  Put1Byte(isec1[50]);        /* 55 User id, specified by table       */
+  Put2Byte(isec1[51]);        /* 56 Experiment identifier             */
+  Put2Byte(isec1[52]);        /* 58 Ensemble identification by table  */
+  Put2Byte(isec1[53]);        /* 60 Number of ensemble members        */
+  Put2Byte(isec1[54]);        /* 62 Actual number of ensemble member  */
+  Put1Byte(isec1[55]);        /* 64 Model major version number        */ 
+  Put1Byte(isec1[56]);        /* 65 Model minor version number        */ 
+  Put1Byte(0);                /* 66 Blank for even buffer length      */
+
+  *zs = z;
+}
+
+static
+void encodePDS_ECMWF_local_Extension_1(GRIBPACK *lGrib, long *zs, int *isec1)
+{
+  // int isvn;
+  long localextlen, i;
+  long z = *zs;
+
+  localextlen = getLocalExtLen(isec1);
+  for ( i = 0; i < localextlen-12; i++ )
+    {
+      Put1Byte(isec1[24+i]);
+    }
+                              /* 12 bytes explicitly encoded below:         */
+  Put1Byte(isec1[36]);        /* ECMWF local GRIB use definition identifier */
+                              /*    1=MARS labelling or ensemble fcst. data */
+  Put1Byte(isec1[37]);        /* Class                                      */
+  Put1Byte(isec1[38]);        /* Type                                       */
+  Put2Byte(isec1[39]);        /* Stream                                     */
+
+  /* Version number or experiment identifier    */
+  Put1Byte(((unsigned char*) &isec1[40])[0]);
+  Put1Byte(((unsigned char*) &isec1[40])[1]);
+  Put1Byte(((unsigned char*) &isec1[40])[2]);
+  Put1Byte(((unsigned char*) &isec1[40])[3]);
+
+  Put1Byte(isec1[41]);        /* Ensemble forecast number                   */
+  Put1Byte(isec1[42]);        /* Total number of forecasts in ensemble      */
+  Put1Byte(0);                /* (Spare)                                    */
+
+  *zs = z;
+}
+
+static
+void encodePDS_MPIM_local_Extension_1(GRIBPACK *lGrib, long *zs, int *isec1)
+{
+  // int isvn;
+  long localextlen, i;
+  long z = *zs;
+
+  localextlen = getLocalExtLen(isec1);
+  for ( i = 0; i < localextlen-6; i++ )
+    {
+      Put1Byte(isec1[24+i]);
+    }
+                              /* 6 bytes explicitly encoded below:          */
+  Put1Byte(isec1[36]);        /* MPIM local GRIB use definition identifier  */
+                              /*    (extension identifier)                  */
+  Put1Byte(isec1[37]);        /* type of ensemble forecast                  */
+  Put2Byte(isec1[38]);        /* individual ensemble member                 */
+  Put2Byte(isec1[39]);        /* number of forecasts in ensemble            */
+
+  *zs = z;
+}
+
+/* GRIB BLOCK 1 - PRODUCT DESCRIPTION SECTION */
+static
+void encodePDS(GRIBPACK *lpds, long pdsLen, int *isec1)
+{
+  GRIBPACK *lGrib = lpds;
+  long z = 0;
+  int ival, century, year;
+
+  century = ISEC1_Century;
+  year    = ISEC1_Year;
+
+  if ( century < 0 )
+    {
+      century = -century;
+      year    = -year;
+    }
+
+  Put3Byte(pdsLen);               /*  0 Length of Block 1        */
+  Put1Byte(ISEC1_CodeTable);      /*  3 Local table number       */
+  Put1Byte(ISEC1_CenterID);       /*  4 Identification of centre */
+  Put1Byte(ISEC1_ModelID);        /*  5 Identification of model  */
+  Put1Byte(ISEC1_GridDefinition); /*  6 Grid definition          */
+  Put1Byte(ISEC1_Sec2Or3Flag);    /*  7 Block 2 included         */
+  Put1Byte(ISEC1_Parameter);      /*  8 Parameter Code           */
+  Put1Byte(ISEC1_LevelType);      /*  9 Type of level            */
+  if ( (ISEC1_LevelType !=  20) &&
+       (ISEC1_LevelType != GRIB1_LTYPE_99)         &&
+       (ISEC1_LevelType != GRIB1_LTYPE_ISOBARIC)   &&
+       (ISEC1_LevelType != GRIB1_LTYPE_ALTITUDE)   &&
+       (ISEC1_LevelType != GRIB1_LTYPE_HEIGHT)     &&
+       (ISEC1_LevelType != GRIB1_LTYPE_SIGMA)      &&
+       (ISEC1_LevelType != GRIB1_LTYPE_HYBRID)     &&
+       (ISEC1_LevelType != GRIB1_LTYPE_LANDDEPTH)  &&
+       (ISEC1_LevelType != GRIB1_LTYPE_ISENTROPIC) &&
+       (ISEC1_LevelType != 115) &&
+       (ISEC1_LevelType != 117) &&
+       (ISEC1_LevelType != 125) &&
+       (ISEC1_LevelType != 127) &&
+       (ISEC1_LevelType != 160) &&
+       (ISEC1_LevelType != 210) )
+    {
+      Put1Byte(ISEC1_Level1);
+      Put1Byte(ISEC1_Level2);
+    }
+  else
+    {
+      Put2Byte(ISEC1_Level1);     /* 10 Level                    */    
+    }
+
+  Put1Int(year);                  /* 12 Year of Century          */
+  Put1Byte(ISEC1_Month);          /* 13 Month                    */
+  Put1Byte(ISEC1_Day);            /* 14 Day                      */
+  Put1Byte(ISEC1_Hour);           /* 15 Hour                     */
+  Put1Byte(ISEC1_Minute);         /* 16 Minute                   */
+
+  Put1Byte(ISEC1_TimeUnit);       /* 17 Time unit                */
+  if ( ISEC1_TimeRange == 10 )
+    {
+      Put1Byte(ISEC1_TimePeriod1);
+      Put1Byte(ISEC1_TimePeriod2);
+    }
+  else if ( ISEC1_TimeRange == 113 || ISEC1_TimeRange ==   0 )
+    {
+      Put1Byte(ISEC1_TimePeriod1);
+      Put1Byte(0);
+    }
+  else if ( ISEC1_TimeRange ==   5 || ISEC1_TimeRange ==   4 || 
+	    ISEC1_TimeRange ==   3 || ISEC1_TimeRange ==   2 )
+    {
+      Put1Byte(0);
+      Put1Byte(ISEC1_TimePeriod2);
+    }
+  else
+    {
+      Put1Byte(0);
+      Put1Byte(0); 
+    }
+  Put1Byte(ISEC1_TimeRange);      /* 20 Timerange flag           */
+  Put2Byte(ISEC1_AvgNum);         /* 21 Average                  */
+
+  Put1Byte(ISEC1_AvgMiss);        /* 23 Missing from averages    */
+  Put1Byte(century);              /* 24 Century                  */
+  Put1Byte(ISEC1_SubCenterID);    /* 25 Subcenter                */
+  Put2Byte(ISEC1_DecScaleFactor); /* 26 Decimal scale factor     */
+
+  if ( ISEC1_LocalFLag )
+    {
+      if ( ISEC1_CenterID == 78 ) 
+	{
+	  if ( isec1[36] == 254 ) 
+	    {
+	      encodePDS_DWD_local_Extension_254(lGrib, &z, isec1);
+	    }
+	  else if ( isec1[36] == 253 )
+	    { 
+	      encodePDS_DWD_local_Extension_253(lGrib, &z, isec1);
+	    }
+	}
+      else if ( ISEC1_CenterID == 98 )
+	{
+	  if ( isec1[36] == 1 )
+	    {
+	      encodePDS_ECMWF_local_Extension_1(lGrib, &z, isec1);
+	    }
+	}
+      else if ( ISEC1_CenterID == 252 )
+	{
+	  if ( isec1[36] == 1 )
+	    {
+	      encodePDS_MPIM_local_Extension_1(lGrib, &z, isec1);
+	    }
+	}
+      else
+	{
+	  long i, localextlen;
+	  localextlen = getLocalExtLen(isec1);
+	  for ( i = 0; i < localextlen; i++ )
+	    {
+	      Put1Byte(isec1[24+i]);
+	    }
+	}
+    }
+}
+
+/* GRIB BLOCK 2 - GRID DESCRIPTION SECTION */
+static
+void encodeGDS(GRIBPACK *lGrib, long *gribLen, int *isec2, double *fsec2)
+{
+  long z = *gribLen;
+  int exponent, mantissa;
+  long i;
+  int ival;
+  int pvoffset = 0xFF;
+  int gdslen = 32;
+  unsigned lonIncr, latIncr;
+
+  if ( ISEC2_GridType == GRIB1_GTYPE_LCC ) gdslen += 10;
+
+  if ( ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )  gdslen += 10;
+
+  if ( ISEC2_NumVCP || ISEC2_Reduced ) pvoffset = gdslen + 1;
+
+  if ( ISEC2_Reduced ) gdslen += 2 * ISEC2_NumLat;
+
+  gdslen += ISEC2_NumVCP * 4;
+
+  Put3Byte(gdslen);             /*  0- 2 Length of Block 2 Byte 0 */
+  Put1Byte(ISEC2_NumVCP);       /*  3    NV */
+  Put1Byte(pvoffset);           /*  4    PV */
+  Put1Byte(ISEC2_GridType);     /*  5    LatLon=0 Gauss=4 Spectral=50 */
+
+  if ( ISEC2_GridType == GRIB1_GTYPE_SPECTRAL )
+    {
+      Put2Byte(ISEC2_PentaJ);   /*  6- 7 Pentagonal resolution J  */
+      Put2Byte(ISEC2_PentaK);   /*  8- 9 Pentagonal resolution K  */
+      Put2Byte(ISEC2_PentaM);   /* 10-11 Pentagonal resolution M  */
+      Put1Byte(ISEC2_RepType);  /* 12    Representation type      */
+      Put1Byte(ISEC2_RepMode);  /* 13    Representation mode      */
+      PutnZero(18);             /* 14-31 reserved                 */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_GME )
+    {
+      Put2Byte(ISEC2_GME_NI2);
+      Put2Byte(ISEC2_GME_NI3);
+      Put3Byte(ISEC2_GME_ND);
+      Put3Byte(ISEC2_GME_NI);
+      Put1Byte(ISEC2_GME_AFlag);
+      Put3Int(ISEC2_GME_LatPP);
+      Put3Int(ISEC2_GME_LonPP);
+      Put3Int(ISEC2_GME_LonMPL);
+      Put1Byte(ISEC2_GME_BFlag);
+      PutnZero(5);
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_LCC )
+    {
+      Put2Byte(ISEC2_NumLon);          /*  6- 7 Longitudes               */
+
+      Put2Byte(ISEC2_NumLat);          /*  8- 9 Latitudes                */
+      Put3Int(ISEC2_FirstLat);
+      Put3Int(ISEC2_FirstLon);
+      Put1Byte(ISEC2_ResFlag);         /* 16    Resolution flag          */
+      Put3Int(ISEC2_Lambert_Lov);      /* 17-19 */
+      Put3Int(ISEC2_Lambert_dx);       /* 20-22 */
+      Put3Int(ISEC2_Lambert_dy);       /* 23-25 */
+      Put1Byte(ISEC2_Lambert_ProjFlag);/* 26    Projection flag          */
+      Put1Byte(ISEC2_ScanFlag);        /* 27    Scanning mode            */
+      Put3Int(ISEC2_Lambert_LatS1);    /* 28-30 */  
+      Put3Int(ISEC2_Lambert_LatS2);    /* 31-33 */
+      Put3Int(ISEC2_Lambert_LatSP);    /* 34-36 */  
+      Put3Int(ISEC2_Lambert_LonSP);    /* 37-39 */
+      PutnZero(2);                     /* 34-41 */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_LATLON    ||
+	    ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN  ||
+	    ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )
+    {
+      int numlon;
+      if ( ISEC2_Reduced )
+	numlon = 0xFFFF;
+      else
+	numlon = ISEC2_NumLon;
+
+      Put2Byte(numlon);                /*  6- 7 Number of Longitudes     */
+
+      Put2Byte(ISEC2_NumLat);          /*  8- 9 Number of Latitudes      */
+      Put3Int(ISEC2_FirstLat);
+      Put3Int(ISEC2_FirstLon);
+      Put1Byte(ISEC2_ResFlag);         /* 16    Resolution flag          */
+      Put3Int(ISEC2_LastLat);
+      Put3Int(ISEC2_LastLon);
+      if ( ISEC2_ResFlag == 0 )
+	{
+	  lonIncr = 0xFFFF;
+	  latIncr = 0xFFFF;
+	}
+      else
+	{
+	  lonIncr = ISEC2_LonIncr;
+	  latIncr = ISEC2_LatIncr;
+	}
+      Put2Byte(lonIncr);               /* 23-24 i - direction increment  */
+      if ( ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN )
+	Put2Byte(ISEC2_NumPar);        /* 25-26 Latitudes Pole->Equator  */
+      else
+	Put2Byte(latIncr);             /* 25-26 j - direction increment  */
+
+      Put1Byte(ISEC2_ScanFlag);        /* 27    Scanning mode            */
+      PutnZero(4);                     /* 28-31 reserved                 */
+
+      if ( ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )
+	{
+	  Put3Int(ISEC2_LatSP);
+	  Put3Int(ISEC2_LonSP);
+	  Put1Real(FSEC2_RotAngle);
+	}
+    }
+  else
+    {
+      Error("Unsupported grid type %d", ISEC2_GridType);
+    }
+
+#if defined (SX)
+#pragma vdir novector     /* vectorization gives wrong results on NEC */
+#endif
+  for ( i = 0; i < ISEC2_NumVCP; ++i )
+    {
+      Put1Real(fsec2[10+i]);
+    }
+
+  if ( ISEC2_Reduced )
+    for ( i = 0; i < ISEC2_NumLat; i++ ) Put2Byte(ISEC2_RowLon(i));
+
+  *gribLen = z;
+}
+
+/* GRIB BLOCK 3 - BIT MAP SECTION */
+static
+void encodeBMS(GRIBPACK *lGrib, long *gribLen, double *fsec3, int *isec4, double *data, long *datasize)
+{
+  GRIBPACK *bitmap;
+  long bitmapSize;
+  long imaskSize;
+  long i;
+  long bmsLen, bmsUnusedBits;
+  long fsec4size;
+  long z = *gribLen;
+#if defined (VECTORCODE)
+  unsigned int *imask;
+#endif
+  static int lmissvalinfo = 1;
+  /*  unsigned int c, imask; */
+
+  if ( DBL_IS_NAN(FSEC3_MissVal) && lmissvalinfo)
+    {
+      lmissvalinfo = 0;
+      Message("Missing value = NaN is unsupported!");
+    }
+
+  bitmapSize = ISEC4_NumValues;
+  imaskSize = ((bitmapSize+7)>>3)<<3;
+  bitmap = &lGrib[z+6];
+  fsec4size = 0;
+
+#if defined (VECTORCODE)
+  imask = (unsigned int *) malloc(imaskSize*sizeof(int));
+  memset(imask, 0, imaskSize*sizeof(int));
+
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+  for ( i = 0; i < bitmapSize; i++ )
+    {
+      if ( IS_NOT_EQUAL(data[i], FSEC3_MissVal) )
+	{
+	  data[fsec4size++] = data[i];
+	  imask[i] = 1;
+	}
+    }
+
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+  for ( i = 0; i < imaskSize/8; i++ )
+    {
+      bitmap[i] = (imask[i*8+0] << 7) | (imask[i*8+1] << 6) |
+	          (imask[i*8+2] << 5) | (imask[i*8+3] << 4) |
+	          (imask[i*8+4] << 3) | (imask[i*8+5] << 2) |
+	          (imask[i*8+6] << 1) | (imask[i*8+7]);
+    }
+
+  free(imask);
+#else
+  for ( i = 0; i < imaskSize/8; i++ ) bitmap[i] = 0;
+
+  for ( i = 0; i < bitmapSize; i++ )
+    {
+      if ( IS_NOT_EQUAL(data[i], FSEC3_MissVal) )
+	{
+	  data[fsec4size++] = data[i];
+	  bitmap[i/8] |= 1<<(7-(i&7));
+	}
+    }
+#endif
+
+  bmsLen = imaskSize/8 + 6;
+  bmsUnusedBits = imaskSize - bitmapSize;
+
+  Put3Byte(bmsLen);   /*  0- 2 Length of Block 3 Byte 0 */
+  Put1Byte(bmsUnusedBits);
+  Put2Byte(0);
+
+  *gribLen += bmsLen;
+
+  *datasize = fsec4size;
+}
+
+
+/* GRIB BLOCK 4 - BINARY DATA SECTION */
+static
+int encodeBDS(GRIBPACK *lGrib, long *gribLen, int decscale, int *isec2, int *isec4, long datasize, double *data,
+	      long *datstart, long *datsize, int code)
+{
+  /* Uwe Schulzweida, 11/04/2003 : Check that number of bits per value is not exceeded */
+  /* Uwe Schulzweida,  6/05/2003 : Copy result to fpval to prevent integer overflow */
+
+  size_t z = *gribLen;
+  long i, jloop;
+  int numBits;
+  int ival;
+  int blockLength, PackStart = 0, Flag = 0;
+  int binscale = 0;
+  int nbpv;
+  int bds_head = 11;
+  int bds_ext = 0;
+  /* ibits = BitsPerInt; */
+  unsigned int max_nbpv_pow2;
+  int exponent, mantissa;
+  int unused_bits = 0;
+  int lspherc = FALSE, lcomplex = FALSE;
+  int isubset = 0, itemp = 0, itrunc = 0;
+  double factor = 1, fmin, fmax, zref;
+  double range, rangec;
+  double jpepsln = 1.0e-12;     /* -----> tolerance used to check equality     */
+                                /*        of floating point numbers - needed   */
+		                /*        on some platforms (eg vpp700, linux) */
+  extern double _pow2tab[158];
+  extern int CGRIBEX_Const;         /* 1: Don't pack constant fields on regular grids */
+
+  if ( isec2 )
+    {
+      /* If section 2 is present, it says if data is spherical harmonic */
+
+      if ( isec2[0] == 50 || isec2[0] == 60 || 
+	   isec2[0] == 70 || isec2[0] == 80 ) lspherc = TRUE;
+
+      if ( lspherc )
+	isec4[2] = 128;
+      else
+	isec4[2] = 0;
+    }
+  else
+    {
+      /* Section 4 says if it's spherical harmonic data.. */
+
+      lspherc = ( isec4[2] == 128 );
+    }
+
+  /* Complex packing supported for spherical harmonics. */
+
+  lcomplex = ( lspherc && ( isec4[3] == 64 ) ) ||
+             ( lspherc && isec2 && ( isec2[5] == 2 ) );
+
+  /* Check input specification is consistent */
+
+  if ( lcomplex && isec2 )
+    {
+      if ( ( isec4[3] != 64 ) && ( isec2[5] == 2 ) )
+	{
+	  gprintf(__func__, "  COMPLEX mismatch. isec4[3] = %d\n", isec4[3]);
+	  gprintf(__func__, "  COMPLEX mismatch. isec2[5] = %d\n", isec2[5]);
+	  return (807);
+	}
+      else if ( ( isec4[3] == 64 ) && ( isec2[5] != 2 ) )
+	{
+	  gprintf(__func__, "  COMPLEX mismatch. isec4[3] = %d\n", isec4[3]);
+	  gprintf(__func__, "  COMPLEX mismatch. isec2[5] = %d\n", isec2[5]);
+	  return (807);
+        }
+      else if ( lcomplex )
+	{
+	  /*
+	    Truncation of full spectrum, which is supposed triangular,
+	    has to be diagnosed. Define also sub-set truncation.
+	  */
+	  isubset = isec4[17];
+	  /* When encoding, use the total number of data. */
+	  itemp   = isec4[0];
+	  itrunc  = (int) (sqrt(itemp*4 + 1.) - 3) / 2;
+	}
+    }
+
+  if ( decscale )
+    {
+      double scale = pow(10.0, (double) decscale);
+      for ( i = 0; i < datasize; ++i ) data[i] *= scale;
+    }
+
+  if ( lspherc )
+    {
+      if ( lcomplex )
+	{
+	  int jup, ioff;
+	  jup  = isubset;
+	  ioff = (jup+1)*(jup+2);
+	  bds_ext = 4 + 3 + 4*ioff;
+	  PackStart = ioff;
+	  Flag = 192;
+	}
+      else
+	{
+	  bds_ext = 4;
+	  PackStart = 1;
+	  Flag = 128;
+	}
+    }
+
+  *datstart = bds_head + bds_ext;
+
+  nbpv = numBits = ISEC4_NumBits;
+
+  if ( lspherc && lcomplex )
+    {
+      int pcStart, pcScale;
+      pcStart = isubset;
+      pcScale = isec4[16];
+      scaleComplex(data, pcStart, pcScale, itrunc, 0);
+      gatherComplex(data, pcStart, itrunc, datasize);
+    }
+
+  fmin = fmax = data[PackStart];
+
+  minmax_val(data+PackStart+1, datasize-PackStart-1, &fmin, &fmax);
+
+  zref = fmin;
+
+
+  if ( CGRIBEX_Const && !lspherc )
+    {
+      if ( IS_EQUAL(fmin, fmax) ) nbpv = 0;
+    }
+
+
+  blockLength = (*datstart) + (nbpv*(datasize - PackStart) + 7)/8;
+  if ( (blockLength%2) == 1 ) blockLength++;
+
+  unused_bits = blockLength*8 - (*datstart)*8 - nbpv*(datasize - PackStart);
+
+  Flag += unused_bits;
+
+
+  /*
+    Adjust number of bits per value if full integer length to
+    avoid hitting most significant bit (sign bit).
+  */
+  /* if( nbpv == ibits ) nbpv = nbpv - 1; */
+  /*
+    Calculate the binary scaling factor to spread the range of
+    values over the number of bits per value.
+    Limit scaling to 2**-126 to 2**127 (using IEEE 32-bit floats
+    as a guideline).           
+  */
+  range = fabs(fmax - fmin);
+
+  if ( fabs(fmin) < FLT_MIN ) fmin = 0;
+  /*
+    Have to allow tolerance in comparisons on some platforms
+    (eg vpp700 and linux), such as 0.9999999999999999 = 1.0,
+    to avoid clipping ranges which are a power of 2.
+  */
+  if ( range <= jpepsln )
+    {
+      binscale = 0;
+    }
+  else if ( IS_NOT_EQUAL(fmin, 0.0) && (fabs(range/fmin) <= jpepsln) )
+    {
+      binscale = 0;
+    }
+  else if ( fabs(range-1.0) <= jpepsln )
+    {
+      binscale = 1 - nbpv;
+    }
+  else if ( range > 1.0 )
+    {
+      rangec = range + jpepsln;
+      for ( jloop = 1; jloop < 128; jloop++ )
+	{
+	  if ( _pow2tab[jloop] > rangec ) break;
+	}
+      if ( jloop == 128 )
+	{
+	  gprintf(__func__, "Problem calculating binary scale value for encode code %d!", code);
+	  gprintf(__func__, "> range %g rangec %g fmin %g fmax %g", range, rangec, fmin, fmax);
+	  return (707);
+	}
+      else
+	{
+	  binscale = jloop - nbpv;
+	}
+    }
+  else
+    {
+      rangec = range - jpepsln;
+      for ( jloop = 1; jloop < 127; jloop++ )
+	{
+	  if ( 1.0/_pow2tab[jloop] < rangec ) break;
+	}
+      if ( jloop == 127 )
+	{
+	  gprintf(__func__, "Problem calculating binary scale value for encode code %d!", code);
+	  gprintf(__func__, "< range %g rangec %g fmin %g fmax %g", range, rangec, fmin, fmax);
+	  return (707);
+	}
+      else
+	{
+	  binscale = 1 - jloop - nbpv;
+	}
+    }
+
+  max_nbpv_pow2 = (unsigned int) (intpow2(nbpv) - 1);
+
+  if ( binscale != 0 )
+    {
+      if ( binscale < 0 )
+	{
+	  if ( (unsigned int)(range*intpow2(-binscale)+0.5) > max_nbpv_pow2 )
+	    binscale++;
+	}
+      else
+	{
+	  if ( (unsigned int)(range/intpow2(binscale)+0.5) > max_nbpv_pow2 )
+	    binscale--;
+	}
+
+      if ( binscale < 0 ) factor =     intpow2(-binscale);
+      else                factor = 1.0/intpow2( binscale);
+    }
+
+  ref2ibm(&zref, BitsPerInt);
+
+  Put3Byte(blockLength);      /*  0-2 Length of Block 4        */
+  Put1Byte(Flag);             /*  3   Flag & Unused bits       */
+  if ( binscale < 0 ) binscale = 32768 - binscale;
+  Put2Byte(binscale);         /*  4-5 Scale factor             */
+  Put1Real(zref);             /*  6-9 Reference value          */
+  Put1Byte(nbpv);             /*   10 Packing size             */
+
+  if ( lspherc )
+    {
+      if ( lcomplex )
+	{
+	  int jup = isubset;
+	  int ioff = z + bds_ext;
+	  if ( ioff > 0xFFFF ) ioff = 0;
+	  Put2Byte(ioff);
+	  Put2Int(isec4[16]);
+	  Put1Byte(jup);
+	  Put1Byte(jup);
+	  Put1Byte(jup);
+	  for ( i = 0; i < ((jup+1)*(jup+2)); i++ ) Put1Real(data[i]);
+	}
+      else
+	{
+	  Put1Real(data[0]);
+	}
+    }
+
+  *datsize  = ((datasize-PackStart)*nbpv + 7)/8;
+
+#if  defined  (_ARCH_PWR6)
+  encode_double_array_unrolled(nbpv, PackStart, datasize, lGrib, data, zref, factor, &z);
+#else
+  encode_double_array_byte    (nbpv, PackStart, datasize, lGrib, data, zref, factor, &z);
+#endif
+
+  if ( unused_bits >= 8 ) Put1Byte(0);  /*  Fillbyte                     */
+
+  *gribLen = z;
+
+  return (0);
+}
+
+
+void gribEncode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+		double *fsec3, int *isec4, double *fsec4, int klenp, int *kgrib,
+		int kleng, int *kword, int efunc, int *kret)
+{
+  long gribLen = 0; /* Counter of GRIB length for output */
+  long isLen, pdsLen;
+  GRIBPACK *lpds;
+  unsigned char *CGrib;
+  long fsec4size = 0;
+  int numBytes;
+  int bmsIncluded;
+  size_t len;
+  GRIBPACK *lGrib;
+  long datstart, datsize, bdsstart;
+  int status = 0;
+
+  grsdef();
+
+  CGrib = (unsigned char *) kgrib;
+
+  bmsIncluded = ISEC1_Sec2Or3Flag & 64;
+
+  /* set max header len */
+  len = 16384;
+
+  /* add data len */
+  numBytes = (ISEC4_NumBits+7)>>3;
+
+  len += numBytes*klenp;
+
+  /* add bitmap len */
+  if ( bmsIncluded ) len += (klenp+7)>>3;
+
+#if defined (VECTORCODE)
+  lGrib = (GRIBPACK *) malloc(len*sizeof(GRIBPACK));
+  if ( lGrib == NULL ) SysError("No Memory!");
+#else
+  lGrib = CGrib;
+#endif
+
+  isLen = 8;
+  encodeIS(lGrib, &gribLen);
+  lpds = &lGrib[isLen];
+  pdsLen = getPdsLen(isec1);
+
+  encodePDS(lpds, pdsLen,  isec1);
+  gribLen += pdsLen;
+  /*
+  if ( ( isec4[3] == 64 ) && ( isec2[5] == 2 ) )
+    {
+      static int lwarn_cplx = TRUE;
+
+      if ( lwarn_cplx )
+	Message("Complex packing of spectral data unsupported, using simple packing!");
+
+      isec2[5] = 1;
+      isec4[3] = 0;
+
+      lwarn_cplx = FALSE;
+    }
+  */
+  encodeGDS(lGrib, &gribLen, isec2, fsec2);
+  /*
+    ----------------------------------------------------------------
+    BMS Bit-Map Section Section (Section 3)
+    ----------------------------------------------------------------
+  */ 
+  if ( bmsIncluded )
+    {
+      encodeBMS(lGrib, &gribLen, fsec3, isec4, fsec4, &fsec4size);
+    }
+  else
+    {
+      fsec4size = ISEC4_NumValues;
+    }
+
+  bdsstart = gribLen;
+  status = encodeBDS(lGrib, &gribLen, ISEC1_DecScaleFactor, isec2,
+		     isec4, fsec4size, fsec4, &datstart, &datsize, ISEC1_Parameter);
+  if ( status )
+    {
+      *kret = status;
+      return;
+    }
+
+  encodeES(lGrib, &gribLen, bdsstart);
+
+  if ( (size_t) gribLen > kleng*sizeof(int) )
+    Error("kgrib buffer too small! kleng = %d  gribLen = %d", kleng, gribLen);
+
+#if defined (VECTORCODE)
+  if ( (size_t) gribLen > len )
+    Error("lGrib buffer too small! len = %d  gribLen = %d", len, gribLen);
+
+  (void) PACK_GRIB(lGrib, (unsigned char *)CGrib, gribLen, -1L);
+
+  free(lGrib);
+#endif
+
+  ISEC0_GRIB_Len     = gribLen;
+  ISEC0_GRIB_Version = 1;
+
+  *kword = gribLen / sizeof(int);
+  if ( (size_t) gribLen != *kword * sizeof(int) ) *kword += 1;
+
+  *kret = status;
+}
+#include <string.h>
+
+
+
+int gribVersion(unsigned char *is, size_t buffersize)
+{
+  if ( buffersize < 8 )
+    Error("Buffer too small (current size %d)!", (int) buffersize);
+
+  return (GRIB_EDITION(is));
+}
+
+static 
+double GET_Real(unsigned char *grib)
+{
+  int iexp, imant;
+
+  iexp  = GET_UINT1(grib[0]);
+  imant = GET_UINT3(grib[1], grib[2], grib[3]);
+
+  return (decfp2(iexp, imant));
+}
+
+static 
+int decodeIS(unsigned char *is, int *isec0, int *iret)
+{
+  int isLen = 0;
+  int grib1offset;
+  int lgrib = FALSE, lbudg = FALSE, ltide = FALSE;
+
+  /*
+    Octets 1 - 4 : The letters G R I B.
+    Four 8 bit fields.
+  */
+  /*
+    Check letters -> GRIB, BUDG or TIDE.
+  */
+  /*
+    Check that 'GRIB' is found where expected.
+  */
+  if ( GRIB_START(is) ) lgrib = TRUE;
+  /*
+    ECMWF pseudo-grib data uses 'BUDG' and 'TIDE'.
+  */
+  if ( BUDG_START(is) ) lbudg = TRUE;
+  if ( TIDE_START(is) ) ltide = TRUE;
+  /*
+    Data is not GRIB or pseudo-grib.
+  */
+  if ( lgrib == FALSE && lbudg == FALSE && ltide == FALSE )
+    {
+      *iret = 305;
+      gprintf(__func__, "Input data is not GRIB or pseudo-grib.");
+      gprintf(__func__, "Return code = %d", *iret);
+    }
+  if ( lbudg == TRUE || ltide == TRUE )
+    {
+      *iret = 305;
+      gprintf(__func__, "Pseudo-grib data unsupported.");
+      gprintf(__func__, "Return code = %d", *iret);
+    }
+
+  /*
+    Octets 5 - 7 : Length of message.
+    One 24 bit field.
+  */
+  ISEC0_GRIB_Len = GRIB1_SECLEN(is);
+  /*
+    Octet 8 : GRIB Edition Number.
+    One 8 bit field.
+  */
+  ISEC0_GRIB_Version = GRIB_EDITION(is);
+
+  if ( ISEC0_GRIB_Version > 1 )
+    Error("GRIB version %d unsupported!", ISEC0_GRIB_Version);
+
+  grib1offset = ISEC0_GRIB_Version * 4;
+
+  isLen = 4 + grib1offset;
+
+  return (isLen);
+}
+
+static 
+void decodePDS_ECMWF_local_Extension_1(unsigned char *pds, int *isec1)
+{
+  isec1[36] = GET_UINT1(pds[40]);         /* extension identifier       */
+  isec1[37] = GET_UINT1(pds[41]);         /* Class                      */
+  isec1[38] = GET_UINT1(pds[42]);         /* Type                       */
+  isec1[39] = GET_UINT2(pds[43],pds[44]); /* Stream                     */
+  /* isec1[40] = GET_UINT4(pds[45],pds[46],pds[47],pds[48]); */
+  memcpy((char*) &isec1[40], &pds[45], 4);
+  isec1[41] = GET_UINT1(pds[49]);         /* Forecast number            */
+  isec1[42] = GET_UINT1(pds[50]);         /* Total number of forecasts  */
+}
+
+static 
+void decodePDS_DWD_local_Extension_254(unsigned char *pds, int *isec1)
+{
+  long i;
+  int isvn;
+
+  isec1[36] = GET_UINT1(pds[40]); /* extension identifier */
+  for ( i = 0; i < 11; i++ ) 
+    { 
+      isec1[37+i] =  GET_UINT1(pds[41+i]);
+    } 
+
+  isvn = GET_UINT2(pds[52],pds[53]);
+  
+  isec1[48] =  isvn % 0x8000;              /* DWD experiment identifier            */
+  isec1[49] =  isvn >> 15;                 /* DWD run type (0=main, 2=ass, 3=test) */
+
+}
+
+static 
+void decodePDS_DWD_local_Extension_253(unsigned char *pds, int *isec1)
+{
+  long i;
+  int isvn;
+
+  isec1[36] = GET_UINT1(pds[40]); /* extension identifier */
+  for ( i = 0; i < 11; i++ ) 
+    { 
+      isec1[37+i] =  GET_UINT1(pds[41+i]);
+    } 
+
+  isvn = GET_UINT2(pds[52],pds[53]);
+  
+  isec1[48] =  isvn % 0x8000;              /* DWD experiment identifier            */
+  isec1[49] =  isvn >> 15;                 /* DWD run type (0=main, 2=ass, 3=test) */
+  isec1[50] =  GET_UINT1(pds[54]);         /* User id, specified by table          */
+  isec1[51] =  GET_UINT2(pds[55],pds[56]); /* Experiment identifier                */
+  isec1[52] =  GET_UINT2(pds[57],pds[58]); /* Ensemble identification by table     */
+  isec1[53] =  GET_UINT2(pds[59],pds[60]); /* Number of ensemble members           */
+  isec1[54] =  GET_UINT2(pds[61],pds[62]); /* Actual number of ensemble member     */
+  isec1[55] =  GET_UINT1(pds[63]);         /* Model major version number           */
+  isec1[56] =  GET_UINT1(pds[64]);         /* Model minor version number           */
+
+}
+
+static 
+void decodePDS_MPIM_local_Extension_1(unsigned char *pds, int *isec1)
+{
+  isec1[36] = GET_UINT1(pds[40]);         /* extension identifier            */
+  isec1[37] = GET_UINT1(pds[41]);         /* type of ensemble forecast       */
+  isec1[38] = GET_UINT2(pds[42],pds[43]); /* individual ensemble member      */
+  isec1[39] = GET_UINT2(pds[44],pds[45]); /* number of forecasts in ensemble */
+}
+
+static 
+int decodePDS(unsigned char *pds, int *isec0, int *isec1)
+{
+  int pdsLen;
+
+  pdsLen = PDS_Len;
+
+  ISEC1_CodeTable      = PDS_CodeTable;
+  ISEC1_CenterID       = PDS_CenterID;
+  ISEC1_ModelID        = PDS_ModelID;
+  ISEC1_GridDefinition = PDS_GridDefinition;
+  ISEC1_Sec2Or3Flag    = PDS_Sec2Or3Flag;
+  ISEC1_Parameter      = PDS_Parameter;
+  ISEC1_LevelType      = PDS_LevelType;
+
+  if ( (ISEC1_LevelType !=  20) && 
+       (ISEC1_LevelType != GRIB1_LTYPE_99)        && 
+       (ISEC1_LevelType != GRIB1_LTYPE_ISOBARIC)  && 
+       (ISEC1_LevelType != GRIB1_LTYPE_ALTITUDE)  && 
+       (ISEC1_LevelType != GRIB1_LTYPE_HEIGHT)    && 
+       (ISEC1_LevelType != GRIB1_LTYPE_SIGMA)     && 
+       (ISEC1_LevelType != GRIB1_LTYPE_HYBRID)    && 
+       (ISEC1_LevelType != GRIB1_LTYPE_LANDDEPTH) && 
+       (ISEC1_LevelType != GRIB1_LTYPE_ISENTROPIC) && 
+       (ISEC1_LevelType != 115) && 
+       (ISEC1_LevelType != 117) && 
+       (ISEC1_LevelType != 125) && 
+       (ISEC1_LevelType != 127) && 
+       (ISEC1_LevelType != GRIB1_LTYPE_SEADEPTH)  && 
+       (ISEC1_LevelType != 210) )
+    {
+      ISEC1_Level1 = PDS_Level1;
+      ISEC1_Level2 = PDS_Level2;
+    }
+  else
+    {
+      ISEC1_Level1 = PDS_Level;
+      ISEC1_Level2 = 0;
+    }
+
+  /* ISEC1_Year        = PDS_Year; */
+  ISEC1_Month          = PDS_Month;
+  ISEC1_Day            = PDS_Day;
+  ISEC1_Hour           = PDS_Hour;
+  ISEC1_Minute         = PDS_Minute;
+  ISEC1_TimeUnit       = PDS_TimeUnit;
+  ISEC1_TimePeriod1    = PDS_TimePeriod1;
+  ISEC1_TimePeriod2    = PDS_TimePeriod2;
+  ISEC1_TimeRange      = PDS_TimeRange;
+  ISEC1_AvgNum         = PDS_AvgNum;
+  ISEC1_AvgMiss        = PDS_AvgMiss;
+
+  if ( ISEC0_GRIB_Version == 1 )
+    {
+      ISEC1_Year           = PDS_Year;
+      ISEC1_Century        = PDS_Century;
+      ISEC1_SubCenterID    = PDS_Subcenter;
+      ISEC1_DecScaleFactor = PDS_DecimalScale;
+    }
+  else
+    {
+      int year;
+      year                 = GET_UINT1(pds[12]);
+      if ( year <= 100 )
+	{
+	  ISEC1_Year       = year;
+	  ISEC1_Century    = 1;
+	}
+      else
+	{
+	  ISEC1_Year       = year%100;
+	  ISEC1_Century    = 1 + (year-ISEC1_Year)/100;
+	}
+      ISEC1_SubCenterID    = 0;
+      ISEC1_DecScaleFactor = 0;
+    }
+
+  if ( ISEC1_Year < 0 )
+    {
+      ISEC1_Year    = -ISEC1_Year;
+      ISEC1_Century = -ISEC1_Century;
+    }
+
+  ISEC1_LocalFLag = 0;
+  if ( pdsLen > 28 )
+    {
+      int localextlen;
+      localextlen = pdsLen-28;
+
+      if ( localextlen > 4000 )
+	{
+	  Warning("PDS larger than 4000 bytes not supported!");
+	}
+      else
+	{
+	  ISEC1_LocalFLag = 1;
+
+	  if ( ISEC1_CenterID == 78 )
+	    {
+	      if ( pds[40] == 254 ) 
+		{
+		  decodePDS_DWD_local_Extension_254(pds, isec1);
+		}
+	      else if ( pds[40] == 253 )
+		{ 
+		  decodePDS_DWD_local_Extension_253(pds, isec1);
+		}
+	    }
+	  else if ( (ISEC1_CenterID    == 98 && ISEC1_LocalFLag ==  1) ||
+		    (ISEC1_SubCenterID == 98 && ISEC1_LocalFLag ==  1) ||
+		    (ISEC1_CenterID    ==  7 && ISEC1_SubCenterID == 98) )
+	    {
+	      if ( pds[40] == 1 )
+		decodePDS_ECMWF_local_Extension_1(pds, isec1);
+	    }
+	  else if ( ISEC1_CenterID    == 252 && ISEC1_LocalFLag ==  1 )
+	    {
+	      if ( pds[40] == 1 )
+		decodePDS_MPIM_local_Extension_1(pds, isec1);	      
+	    }
+	  else
+	    {
+	      long i;
+	      for ( i = 0; i < localextlen; i++ )
+		{
+		  isec1[24+i] = pds[28+i];
+		}
+	    }
+	}
+    }
+
+  return (pdsLen);
+}
+
+static 
+int decodeGDS(unsigned char  *gds, int *isec0, int *isec2, double *fsec2, int *numGridVals, int dfunc)
+{
+  /* int imisng = 0; */
+  int  ReducedGrid = FALSE, VertCoorTab = FALSE;
+  int  locnv = 0, locnl;
+  int  jlenl;
+  long i;
+  int iexp, imant;
+  int ipvpl, ipl;
+  int gdsLen = 0;
+#if defined (VECTORCODE)
+  unsigned char *igrib;
+  GRIBPACK *lgrib = NULL;
+  size_t lGribLen = 0;
+#endif
+
+  *numGridVals = 0;
+
+  memset(isec2, 0, 22*sizeof(int));
+
+  gdsLen = GDS_Len;
+
+  ipvpl = GDS_PVPL;
+  if ( ipvpl == 0 ) ipvpl = 0xFF;
+
+  if ( ipvpl != 0xFF )
+    { /* Either vct or reduced grid */
+      if ( GDS_NV != 0 )
+	{ /* we have vct */
+	  VertCoorTab = TRUE;
+	  ipl =  4*GDS_NV + ipvpl - 1;
+	  if ( ipl < gdsLen )
+	    {
+	      ReducedGrid = TRUE;
+	    }
+	}
+      else
+	{
+	  VertCoorTab = FALSE;
+	  ReducedGrid = TRUE;
+	}
+      /*	  ReducedGrid = (gdsLen - 32 - 4*GDS_NV); */
+    }
+ 
+  if ( ISEC0_GRIB_Version == 0 )
+    {
+      if ((gdsLen - 32) > 0) VertCoorTab = TRUE;
+      else                   VertCoorTab = FALSE;
+    }
+  
+  if ( ReducedGrid )
+    {
+      locnl = GDS_PVPL - 1 + (VertCoorTab * 4 * GDS_NV);
+      jlenl = (gdsLen - locnl)  >> 1;
+      if ( jlenl == GDS_NumLat )
+	{
+	  *numGridVals = 0;
+	  ISEC2_Reduced = TRUE;
+	  for ( i = 0; i < jlenl; i++ )
+	    {
+	      ISEC2_RowLon(i) = GET_UINT2(gds[locnl+2*i], gds[locnl+2*i+1]);
+	      *numGridVals += ISEC2_RowLon(i);
+	    }
+	}
+      else
+	{
+	  ReducedGrid = FALSE;
+	}
+    }
+
+  ISEC2_GridType = GDS_GridType;
+
+  /*
+     Gaussian grid definition.
+  */
+  if ( ISEC2_GridType == GRIB1_GTYPE_LATLON    ||
+       ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN  ||
+       ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )
+    {
+      ISEC2_NumLat    = GDS_NumLat;
+      if ( ! ReducedGrid )
+	{
+	  ISEC2_NumLon = GDS_NumLon;
+	  *numGridVals  = ISEC2_NumLon*ISEC2_NumLat;
+	}
+      ISEC2_FirstLat  = GDS_FirstLat;
+      ISEC2_FirstLon  = GDS_FirstLon;
+      ISEC2_ResFlag   = GDS_ResFlag;
+      ISEC2_LastLat   = GDS_LastLat;
+      ISEC2_LastLon   = GDS_LastLon;
+      ISEC2_LonIncr   = GDS_LonIncr;
+
+      ISEC2_NumPar    = GDS_NumPar;
+      ISEC2_ScanFlag  = GDS_ScanFlag;
+      if ( ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )
+	{
+	  ISEC2_LatSP     = GDS_LatSP;
+	  ISEC2_LonSP     = GDS_LonSP;
+	  FSEC2_RotAngle  = GDS_RotAngle;
+	}
+      /*
+	if ( Lons != Longitudes || Lats != Latitudes )
+	Error("Latitude/Longitude Conflict");
+      */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN     ||
+	    ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN_ROT ||
+	    ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN_STR ||
+	    ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN_ROTSTR )
+    {
+      /*
+      iret = decodeGDS_GG(gds, gdspos, isec0, isec2, imisng);
+      */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_LATLON     ||
+	    ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT ||
+	    ISEC2_GridType == GRIB1_GTYPE_LATLON_STR ||
+	    ISEC2_GridType == GRIB1_GTYPE_LATLON_ROTSTR )
+    {
+      /*
+      iret = decodeGDS_LL(gds, gdspos, isec0, isec2, imisng);
+      */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_LCC )
+    {
+      ISEC2_NumLon    = GDS_NumLon;
+      ISEC2_NumLat    = GDS_NumLat;
+      *numGridVals  = ISEC2_NumLon*ISEC2_NumLat;
+      ISEC2_FirstLat  = GDS_FirstLat;
+      ISEC2_FirstLon  = GDS_FirstLon;
+      ISEC2_ResFlag   = GDS_ResFlag;
+      ISEC2_Lambert_Lov   = GDS_Lambert_Lov;
+      ISEC2_Lambert_dx    = GDS_Lambert_dx;
+      ISEC2_Lambert_dy    = GDS_Lambert_dy;
+      ISEC2_Lambert_LatS1 = GDS_Lambert_LatS1;
+      ISEC2_Lambert_LatS2 = GDS_Lambert_LatS2;
+      ISEC2_Lambert_LatSP = GDS_Lambert_LatSP;
+      ISEC2_Lambert_LonSP = GDS_Lambert_LonSP;
+      ISEC2_Lambert_ProjFlag = GDS_Lambert_ProjFlag;
+      ISEC2_ScanFlag      = GDS_ScanFlag;
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_SPECTRAL )
+    {
+      ISEC2_PentaJ  = GDS_PentaJ; /* Truncation */
+      ISEC2_PentaK  = GDS_PentaK;
+      ISEC2_PentaM  = GDS_PentaM;
+      ISEC2_RepType = GDS_RepType;
+      ISEC2_RepMode = GDS_RepMode;
+      *numGridVals  = (ISEC2_PentaJ+1)*(ISEC2_PentaJ+2);
+      isec2[ 6] = 0;
+      isec2[ 7] = 0;
+      isec2[ 8] = 0;
+      isec2[ 9] = 0;
+      isec2[10] = 0;
+      /*
+      iret = decodeGDS_SH(gds, gdspos, isec0, isec2, imisng);
+      */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_GME )
+    {
+      ISEC2_GME_NI2    = GDS_GME_NI2;
+      ISEC2_GME_NI3    = GDS_GME_NI3;
+      ISEC2_GME_ND     = GDS_GME_ND;
+      ISEC2_GME_NI     = GDS_GME_NI;
+      ISEC2_GME_AFlag  = GDS_GME_AFlag;
+      ISEC2_GME_LatPP  = GDS_GME_LatPP;
+      ISEC2_GME_LonPP  = GDS_GME_LonPP;
+      ISEC2_GME_LonMPL = GDS_GME_LonMPL;
+      ISEC2_GME_BFlag  = GDS_GME_BFlag;
+      *numGridVals  = (ISEC2_GME_NI+1)*(ISEC2_GME_NI+1)*10;
+      /*
+      iret = decodeGDS_TR(gds, gdspos, isec0, isec2, imisng);
+      */
+    }
+  else
+    {
+      ISEC2_NumLon = GDS_NumLon;
+      ISEC2_NumLat = GDS_NumLat;
+      *numGridVals  = ISEC2_NumLon*ISEC2_NumLat;
+      Message("Gridtype %d unsupported", ISEC2_GridType);
+    }
+
+  /*    vertical coordinate parameters for hybrid levels.     */
+  /*    get number of vertical coordinate parameters, if any. */
+
+  ISEC2_NumVCP = 0;
+
+  isec2[17] = 0;
+  isec2[18] = 0;
+
+  if ( VertCoorTab == TRUE )
+    {
+      if ( ISEC0_GRIB_Version  == 0 )
+	{
+	  locnv = 32;
+	  ISEC2_NumVCP = (gdsLen - 32) >> 2;
+	}
+      else
+	{
+	  locnv = GDS_PVPL - 1;
+	  ISEC2_NumVCP = GDS_NV;
+	}
+#if defined (SX)
+      lGribLen = 4*ISEC2_NumVCP;	      
+      lgrib    = (GRIBPACK *) malloc(lGribLen*sizeof(GRIBPACK));
+
+      igrib = &gds[locnv];
+      if ( ISEC2_NumVCP > 0 ) (void) UNPACK_GRIB(igrib, lgrib, lGribLen, -1L);
+      for ( i = 0; i < ISEC2_NumVCP; i++ )
+	{
+	  iexp   = (lgrib[4*i  ]);
+	  imant  =((lgrib[4*i+1]) << 16) +
+	          ((lgrib[4*i+2]) <<  8) +
+	           (lgrib[4*i+3]);
+	  fsec2[10+i] = POW_2_M24 * imant * pow(16.0, (double)(iexp - 64));
+	}
+
+      free(lgrib);
+#else
+      for ( i = 0; i < ISEC2_NumVCP; i++ )
+	{
+	  iexp   = (gds[locnv+4*i  ]);
+	  imant  =((gds[locnv+4*i+1]) << 16) +
+	          ((gds[locnv+4*i+2]) <<  8) +
+	           (gds[locnv+4*i+3]);
+	  fsec2[10+i] = decfp2(iexp,imant);
+	}
+#endif
+    }
+
+  return (gdsLen);
+}
+
+static 
+void decode_double_array_common(unsigned char *igrib, long jlend, int NumBits, 
+				double fmin, double zscale, double *fpdata)
+{
+  /* code from wgrib routine BDS_unpack */
+  unsigned char *bits = igrib;
+  unsigned int jmask;
+  long i;
+  unsigned int tbits = 0;
+  int n_bits = NumBits;
+  int t_bits = 0;
+      
+  jmask = (1 << n_bits) - 1;
+  for ( i = 0; i < jlend; i++ )
+    {
+      if (n_bits - t_bits > 8)
+	{
+	  tbits = (tbits << 16) | (bits[0] << 8) | (bits[1]);
+	  bits += 2;
+	  t_bits += 16;
+	}
+
+      while ( t_bits < n_bits )
+	{
+	  tbits = (tbits * 256) + *bits++;
+	  t_bits += 8;
+	}
+      t_bits -= n_bits;
+      fpdata[i] = (tbits >> t_bits) & jmask;
+    }
+  /* at least this vectorizes :) */
+  for ( i = 0; i < jlend; i++ )
+    fpdata[i] = fmin + zscale*fpdata[i];
+}
+
+static unsigned int mask[] = {0,1,3,7,15,31,63,127,255};
+static double shift[9] = {1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0};
+
+static 
+void decode_double_array_common2(unsigned char *igrib, long jlend, int NumBits, 
+				 double fmin, double zscale, double *fpdata)
+{
+  /* code from wgrib routine BDS_unpack */
+  unsigned char *bits = igrib;
+  long i;
+  int n_bits = NumBits;
+  int c_bits, j_bits;
+  double jj;
+
+  /* older unoptimized code, not often used */
+  c_bits = 8;
+  for ( i = 0; i < jlend; i++ )
+    {
+      jj = 0.0;
+      j_bits = n_bits;
+      while (c_bits <= j_bits)
+	{
+	  if (c_bits == 8)
+	    {
+	      jj = jj * 256.0  + (double) (*bits++);
+	      j_bits -= 8;
+	    }
+	  else
+	    {
+	      jj = (jj * shift[c_bits]) + (double) (*bits & mask[c_bits]);
+	      bits++;
+	      j_bits -= c_bits;
+	      c_bits = 8;
+	    }
+	}
+
+      if (j_bits)
+	{
+	  c_bits -= j_bits;
+	  jj = (jj * shift[j_bits]) + (double) ((*bits >> c_bits) & mask[j_bits]);
+	}
+      
+      fpdata[i] = fmin + zscale*jj;
+    }
+} 
+
+static 
+void decode_double_array(unsigned char *igrib, long jlend, int numBits, 
+			 double fmin, double zscale, double *fpdata)
+{
+  long i;
+  double dval;
+#if defined (VECTORCODE)
+  GRIBPACK *lgrib = NULL;
+
+  if ( numBits ==  8 || numBits == 16 ||
+       numBits == 24 || numBits == 32 )
+    {
+      long jlenc = jlend * numBits / 8;
+      if ( jlenc > 0 ) 
+	{
+	  lgrib = (GRIBPACK *) malloc(jlenc*sizeof(GRIBPACK));
+	  if ( lgrib == NULL ) SysError("No Memory!");
+
+	  (void) UNPACK_GRIB(igrib, lgrib, jlenc, -1L);
+	}
+    }
+
+  if ( numBits ==  0 )
+    {
+      for ( i = 0; i < jlend; i++ )
+	fpdata[i] = fmin;
+    }
+  else if ( numBits ==  8 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (int)lgrib[i];
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 16 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((int)lgrib[2*i  ] <<  8) +  (int)lgrib[2*i+1]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 24 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((int)lgrib[3*i  ] << 16) + ((int)lgrib[3*i+1] <<  8) +
+	  	 (int)lgrib[3*i+2]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 32 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((unsigned int)lgrib[4*i  ] << 24) + ((unsigned int)lgrib[4*i+1] << 16) +
+		((unsigned int)lgrib[4*i+2] <<  8) +  (unsigned int)lgrib[4*i+3]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits <= 25 )
+    {
+      decode_double_array_common(igrib, jlend, numBits, fmin, zscale, fpdata);
+    }
+  else if ( numBits > 25 && numBits < 32 )
+    {
+      decode_double_array_common2(igrib, jlend, numBits, fmin, zscale, fpdata);
+    }
+  else
+    {
+      fprintf(stderr," Unimplemented packing factor %d!\n", numBits);
+      exit(EXIT_FAILURE);
+    }
+
+  if ( lgrib ) free(lgrib);
+
+#else
+  if ( numBits ==  0 )
+    {
+      for ( i = 0; i < jlend; i++ )
+	fpdata[i] = fmin;
+    }
+  else if ( numBits ==  8 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (int)igrib[i];
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 16 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((int)igrib[2*i  ] <<  8) |  (int)igrib[2*i+1]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 24 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((int)igrib[3*i  ] << 16) + ((int)igrib[3*i+1] <<  8) +
+		 (int)igrib[3*i+2]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 32 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((unsigned int)igrib[4*i  ] << 24) + ((unsigned int)igrib[4*i+1] << 16) +
+		((unsigned int)igrib[4*i+2] <<  8) +  (unsigned int)igrib[4*i+3]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits <= 25 )
+    {
+      decode_double_array_common(igrib, jlend, numBits, fmin, zscale, fpdata);
+    }
+  else if ( numBits > 25 && numBits < 32 )
+    {
+      decode_double_array_common2(igrib, jlend, numBits, fmin, zscale, fpdata);
+    }
+  else
+    {
+      fprintf(stderr, "Unimplemented packing factor %d!\n", numBits);
+      exit(EXIT_FAILURE);
+    }
+#endif
+}
+
+static
+int decodeBDS(int decscale, unsigned char *bds, int *isec2, int *isec4, 
+	      double *fsec4, int fsec4len, int dfunc, int bdsLenIn, int numGridVals, int llarge, int *iret)
+{
+  unsigned char *igrib;
+  int lspherc = FALSE, lcomplex = FALSE;
+  int lcompress;
+  int jup, kup, mup;
+  int locnd;
+  int jlend;
+  long i;
+  int bds_flag, jscale, imiss;
+  int bds_ubits;
+  int ioff = 0;
+  int iexp, imant;
+  int zoff;
+  int bds_head = 11;
+  double fmin = 0., zscale = 0.;
+  double *fpdata = fsec4;
+  int bdsLen;
+  extern int CGRIBEX_Fix_ZSE;
+
+  *iret = 0;
+  igrib = bds;
+
+  memset(isec4, 0, 42*sizeof(int));
+
+  /* get length of binary data block. */
+
+  bdsLen = BDS_Len;
+  /*
+    If a very large product, the section 4 length field holds
+    the number of bytes in the product after section 4 upto
+    the end of the padding bytes.
+    This is a fixup to get round the restriction on product lengths
+    due to the count being only 24 bits. It is only possible because
+    the (default) rounding for GRIB products is 120 bytes.
+  */
+  if ( llarge ) bdsLen = bdsLenIn - bdsLen;
+
+  /* 4 bit flag / 4 bit count of unused bits at end of block octet. */
+
+  bds_flag = BDS_Flag;
+
+  /* 0------- grid point           */
+  /* 1------- spherical harmonics  */
+
+  lspherc = bds_flag >> 7;
+
+  if ( lspherc ) isec4[2] = 128;
+  else           isec4[2] = 0;
+
+  /* -0------  simple packing */
+  /* -1------ complex packing */
+
+  lcomplex = (bds_flag >> 6)&1;
+
+  if ( lcomplex ) isec4[3] = 64;
+  else            isec4[3] =  0;
+
+  /* ---0---- No additional flags */
+  /* ---1---- No additional flags */
+
+  lcompress = (bds_flag >> 4)&1; /* compress */
+
+  if ( lcompress )
+    { isec4[5] = 16; isec4[6] = BDS_Z; zoff = 12; }
+  else
+    { isec4[5] =  0; isec4[6] = 0;     zoff =  0; }
+
+  /* ----++++ number of unused bits at end of section) */
+
+  bds_ubits = bds_flag & 0xF;
+  
+  /* scale factor (2 bytes) */;
+
+  jscale = BDS_BinScale;
+
+  /* check for missing data indicators. */
+
+  iexp  = bds[ 6];
+  imant = GET_UINT3(bds[ 7], bds[ 8], bds[ 9]);
+
+  imiss = (jscale == 0xFFFF && iexp == 0xFF && imant == 0xFFFFFF);
+
+  /* convert reference value and scale factor. */
+
+  if ( ! (dfunc == 'J') )
+    if ( imiss == 0 )
+      {
+	fmin = BDS_RefValue;
+	
+	if ( jscale < 0 )
+	  zscale = 1.0/intpow2(-jscale);
+	else
+	  zscale = intpow2(jscale);
+      }
+
+  /* get number of bits in each data value. */
+
+  ISEC4_NumBits = BDS_NumBits;
+
+  /* octet number of start of packed data */
+  /* calculated from start of block 4 - 1 */
+
+  locnd = zoff + bds_head;
+
+  /* if data is in spherical harmonic form, distinguish   */
+  /* between simple/complex packing (lcomplex = 0/1)      */
+
+  if ( lspherc )
+    {
+      if ( !lcomplex )
+	{
+	  /*    no unpacked binary data present */
+
+	  jup = kup = mup = 0;
+
+	  /*    octet number of start of packed data */
+	  /*    calculated from start of block 4 - 1 */
+
+	  ioff   = 1;
+	  locnd += 4*ioff;  /* RealCoef */
+
+	  /*    get real (0,0) coefficient in grib format and     */
+	  /*    convert to floating point.                        */
+
+	  if ( dfunc != 'J' )
+	    {
+	      if ( imiss ) *fpdata++ = 0.0;
+	      else         *fpdata++ = BDS_RealCoef;
+	    }
+	}
+      else /* complex packed spherical harmonics */
+	{
+	  isec4[15] = BDS_PackData;
+	  /*    scaling factor */
+	  isec4[16] = BDS_Power;
+
+	  /*    pentagonal resolution parameters of the */
+	  /*    unpacked section of data field          */
+
+	  jup = bds[zoff+15];
+	  kup = bds[zoff+16];
+	  mup = bds[zoff+17];
+
+	  isec4[zoff+17] = jup;
+	  isec4[zoff+18] = kup;
+	  isec4[zoff+19] = mup;
+
+	  /*    unpacked binary data */
+
+	  locnd += 4; /* 2 + power */
+	  locnd += 3; /* j, k, m   */
+	  ioff   = (jup+1)*(jup+2);
+
+	  if ( dfunc != 'J' )
+	    for ( i = 0; i < ioff; i++ )
+	      {
+		iexp   = (bds[locnd+4*i  ]);
+		imant  =((bds[locnd+4*i+1]) << 16) +
+		        ((bds[locnd+4*i+2]) <<  8) +
+		         (bds[locnd+4*i+3]);
+
+		if ( imiss ) *fpdata++ = 0.0;
+		else         *fpdata++ = decfp2(iexp,imant);
+	      }
+	  
+	  locnd += 4*ioff;  /* RealCoef */
+	}
+    }
+
+  /* Decode data values to floating point and store in fsec4.  */
+  /* First calculate the number of data values.                */
+  /* Take into account that spherical harmonics can be packed  */
+  /* simple (lcomplex = 0) or complex (lcomplex = 1)           */
+
+  jlend = bdsLen - locnd;
+
+  if ( ISEC4_NumBits == 0 )
+    {
+      if ( jlend > 1 )
+	{
+	  *iret = 2001;
+	  gprintf(__func__, " Number of bits per data value = 0!");
+	  gprintf(__func__, " Return code =  %d", *iret);
+	  return (0);
+	}
+
+      if ( numGridVals == 0 )
+	{
+	  *iret = 2002;
+	  gprintf(__func__, " Constant field unsupported for this grid type!");
+	  gprintf(__func__, " Return code =  %d", *iret);
+	  return (0);
+	}
+
+      jlend = numGridVals;
+      jlend -= ioff;
+    }
+  else
+    {
+      jlend = (jlend*8 - bds_ubits) / ISEC4_NumBits;
+    }
+
+  ISEC4_NumValues        = jlend + ioff;
+  ISEC4_NumNonMissValues = 0;
+
+  if ( lcompress )
+    {
+      size_t len;
+
+      if ( gribrec_len(bds[14], bds[15], bds[16]) > JP23SET )
+	len = ((size_t) ((bds[17]<<24)+(bds[18]<<16)+(bds[19]<<8)+bds[20]));
+      else
+        len = ((size_t) ((bds[17]<<16)+(bds[18]<<8)+bds[19]));
+
+      ISEC4_NumValues = len*8/ISEC4_NumBits;
+
+      if ( lspherc )
+	{
+	  if ( lcomplex )
+	    ISEC4_NumValues += ioff;
+	  else
+	    ISEC4_NumValues++;
+	}
+    }
+
+  if ( dfunc == 'J' ) return (bdsLen);
+
+  /* check length of output array. */
+  
+  if ( jlend+ioff > fsec4len )
+    {
+      *iret = 710;
+      gprintf(__func__, " Output array too small. Length = %d", fsec4len);
+      gprintf(__func__, " Number of values = %d", jlend+ioff);
+      gprintf(__func__, " Return code =  %d", *iret);
+      return (0);
+    }
+
+  if ( imiss ) memset((char *)fpdata, 0, jlend*sizeof(double));
+  else
+    {
+      igrib += locnd;
+
+      decode_double_array(igrib, jlend, ISEC4_NumBits, fmin, zscale, fpdata);
+    }
+
+  if ( lspherc && lcomplex )
+    {
+      int pcStart, pcScale;
+      pcStart = isec4[19];
+      pcScale = isec4[16];
+      scatterComplex(fsec4, pcStart, ISEC2_PentaJ, ISEC4_NumValues);
+      scaleComplex(fsec4, pcStart, pcScale, ISEC2_PentaJ, 1);
+    }
+
+  if ( CGRIBEX_Fix_ZSE )  /* Fix ZeroShiftError of simple packed spherical harmonics */
+    if ( lspherc && !lcomplex )
+      {
+        /* 20100705: Fix ZeroShiftError - Edi Kirk */
+	if ( fsec4[1] != 0.0 )
+	  {
+	    double zserr = fsec4[1];
+	    for ( i = 1; i < ISEC4_NumValues; i++ ) fsec4[i] -= zserr;
+	  }
+      }
+
+  if ( decscale )
+    {
+      double scale = pow(10.0, (double)-decscale);
+      for ( i = 0; i < ISEC4_NumValues; i++ ) fsec4[i] *= scale;
+    }
+
+  return (bdsLen);
+}
+
+
+void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+		double *fsec3, int *isec4, double *fsec4, int fsec4len, int *kgrib,
+		int kleng, int *kword, int dfunc, int *iret)
+{
+  UCHAR *is = NULL, *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  int isLen = 0, pdsLen = 0, gdsLen = 0, bmsLen = 0, bdsLen = 0, esLen = 0;
+  int gribLen = 0;
+  int gdsIncluded = FALSE;
+  int bmsIncluded = FALSE;
+  int bitmapSize = 0;
+  int imaskSize = 0;
+  int ldebug = FALSE;
+  int llarge = FALSE, l_iorj = FALSE;
+  int lsect2 = FALSE, lsect3 = FALSE;
+  int numGridVals = 0;
+  static int lmissvalinfo = 1;
+
+  *iret = 0;
+
+  grsdef();
+
+  ISEC2_Reduced = FALSE;
+
+  /*
+    ----------------------------------------------------------------
+    IS Indicator Section (Section 0)
+    ----------------------------------------------------------------
+  */
+  is = (unsigned char *) &kgrib[0];
+
+  isLen = decodeIS(is, isec0, iret);
+
+  /*
+    If count is negative, have to rescale by factor of -120.
+    This is a fixup to get round the restriction on product lengths
+    due to the count being only 24 bits. It is only possible because
+    the (default) rounding for GRIB products is 120 bytes.
+  */
+  if ( ISEC0_GRIB_Len < 0 )
+    {
+      if ( ldebug )
+	gprintf(__func__, "Special case, negative length multiplied by -120");
+      llarge = TRUE;
+      ISEC0_GRIB_Len *= (-120);
+    }
+  /*
+    When decoding or calculating length, previous editions
+    of the GRIB code must be taken into account.
+
+    In the table below, covering sections 0 and 1 of the GRIB
+    code, octet numbering is from the beginning of the GRIB
+    message;
+    * indicates that the value is not available in the code edition;
+    R indicates reserved, should be set to 0;
+    Experimental edition is considered as edition -1.
+
+    GRIB code edition -1 has fixed length of 20 octets for
+    section 1, the length not included in the message.
+    GRIB code edition 0 has fixed length of 24 octets for
+    section 1, the length being included in the message.
+    GRIB code edition 1 can have different lengths for section
+    1, the minimum being 28 octets, length being included in
+    the message.
+
+                                         Octet numbers for code
+                                                  editions
+
+                 Contents.                   -1      0      1
+                 ---------                ----------------------
+       Letters GRIB                          1-4    1-4    1-4
+       Total length of GRIB message.          *      *     5-7
+       GRIB code edition number               *      *      8
+       Length of Section 1.                   *     5-7    9-11
+       Reserved octet (R).                    *      8(R)   *
+       Version no. of Code Table 2.           *      *     12
+       Identification of centre.              5      9     13
+       Generating process.                    6     10     14
+       Grid definition .                      7     11     15
+       Flag (Code Table 1).                   8     12     16
+       Indicator of parameter.                9     13     17
+       Indicator of type of level.           10     14     18
+       Height, pressure etc of levels.      11-12  15-16  19-20
+       Year of century.                      13     17     21
+       Month.                                14     18     22
+       Day.                                  15     19     23
+       Hour.                                 16     20     24
+       Minute.                               17     21     25
+       Indicator of unit of time.            18     22     26
+       P1 - Period of time.                  19     23     27
+       P2 - Period of time                  20(R)   24     28
+       or reserved octet (R).
+       Time range indicator.                21(R)   25     29
+       or reserved octet (R).
+       Number included in average.       22-23(R)  26-27  30-31
+       or reserved octet (R).
+       Number missing from average.         24(R)  28(R)   32
+       or reserved octet (R).
+       Century of data.                       *      *     33
+       Designates sub-centre if not 0.        *      *     34
+       Decimal scale factor.                  *      *    35-36
+       Reserved. Set to 0.                    *      *    37-48
+       (Need not be present)
+       For originating centre use only.       *      *    49-nn
+       (Need not be present)
+
+    Identify which GRIB code edition is being decoded.
+
+    In GRIB edition 1, the edition number is in octet 8.
+    In GRIB edition 0, octet 8 is reserved and set to 0.
+    In GRIB edition -1, octet 8 is a flag field and can have a
+    a valid value of 0, 1, 2 or 3.
+
+    However, GRIB edition number 0 has a fixed
+    length of 24, included in the message, for section 1, so
+    if the value extracted from octets 5-7 is 24 and that from
+    octet 8 is 0, it is safe to assume edition 0 of the code.
+
+  */
+  if ( ISEC0_GRIB_Len == 24 && ISEC0_GRIB_Version == 0 )
+    {
+      /*
+	Set length of GRIB message to missing data value.
+      */
+      ISEC0_GRIB_Len = 0;
+    }
+  /*
+    If Grib Edition 1 and only length is required, go to section 9.
+  */
+  if ( dfunc == 'L' ) goto LABEL900;
+
+  /*
+    ----------------------------------------------------------------
+    PDS Product Definition Section (Section 1)
+    ----------------------------------------------------------------
+  */ 
+  pds = is + isLen;
+
+  pdsLen = decodePDS(pds, isec0, isec1);
+
+  /*
+    ----------------------------------------------------------------
+    GDS Grid Description Section (Section 2)
+    ----------------------------------------------------------------
+  */
+  gdsIncluded = ISEC1_Sec2Or3Flag & 128;
+
+  if ( gdsIncluded )
+    {
+      gds = is + isLen + pdsLen;
+
+      gdsLen = decodeGDS(gds, isec0, isec2, fsec2, &numGridVals, dfunc);
+    }
+
+  /*
+    ----------------------------------------------------------------
+    BMS Bit-Map Section Section (Section 3)
+    ----------------------------------------------------------------
+  */ 
+  bmsIncluded = ISEC1_Sec2Or3Flag & 64;
+
+  isec3[0] = 0;
+  if ( bmsIncluded )
+    {
+      bms = is + isLen + pdsLen + gdsLen;
+
+      bmsLen = BMS_Len;
+      imaskSize = (bmsLen - 6)<<3;
+      bitmapSize = imaskSize - BMS_UnusedBits;
+      /*
+      fprintf(stderr," bitmapSize = %d %d %d\n", bitmapSize, imaskSize, BMS_UnusedBits);
+      */
+    }
+
+  /*
+    ----------------------------------------------------------------
+    BDS Binary Data Section (Section 4)
+    ----------------------------------------------------------------
+  */
+  bds = is + isLen + pdsLen + gdsLen + bmsLen;
+
+  bdsLen = ISEC0_GRIB_Len - (isLen + pdsLen + gdsLen + bmsLen);
+
+  bdsLen = decodeBDS(ISEC1_DecScaleFactor, bds, isec2, isec4, 
+		     fsec4, fsec4len, dfunc, bdsLen, numGridVals, llarge, iret);
+
+  if ( *iret != 0 ) return;
+
+  ISEC4_NumNonMissValues = ISEC4_NumValues;
+
+  if ( bitmapSize > 0 )
+    {
+      if ( dfunc != 'L' && dfunc != 'J' )
+	if ( DBL_IS_NAN(FSEC3_MissVal) && lmissvalinfo )
+	  {
+	    lmissvalinfo = 0;
+	    FSEC3_MissVal = GRIB_MISSVAL;
+	    Message("Missing value = NaN is unsupported, set to %g!", GRIB_MISSVAL);
+	  }
+
+      /* ISEC4_NumNonMissValues = ISEC4_NumValues; */
+      ISEC4_NumValues        = bitmapSize;
+
+      if ( dfunc != 'J' || bitmapSize == ISEC4_NumNonMissValues )
+	{
+	  long i, j;
+	  GRIBPACK *pbitmap;
+	  GRIBPACK bitmap;
+	  GRIBPACK *imask;
+
+	  /*
+	  unsigned char *bitmap;
+	  bitmap = BMS_Bitmap;
+	  j = ISEC4_NumNonMissValues;
+	  for ( i = ISEC4_NumValues-1; i >= 0; i-- )
+	    {
+	      if ( (bitmap[i/8]>>(7-(i&7)))&1 )
+		fsec4[i] = fsec4[--j];
+	      else
+		fsec4[i] = FSEC3_MissVal;
+	    }
+	  */
+
+	  imask = (GRIBPACK *) malloc(imaskSize*sizeof(GRIBPACK));
+
+#if defined (VECTORCODE)
+	  (void) UNPACK_GRIB(BMS_Bitmap, imask, imaskSize/8, -1L);
+	  pbitmap = imask;
+#else
+	  pbitmap = BMS_Bitmap;
+#endif
+
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+	  for ( i = imaskSize/8-1; i >= 0; i-- )
+	    {
+	      bitmap = pbitmap[i];
+	      imask[i*8+0] = 1 & (bitmap >> 7);
+	      imask[i*8+1] = 1 & (bitmap >> 6);
+	      imask[i*8+2] = 1 & (bitmap >> 5);
+	      imask[i*8+3] = 1 & (bitmap >> 4);
+	      imask[i*8+4] = 1 & (bitmap >> 3);
+	      imask[i*8+5] = 1 & (bitmap >> 2);
+	      imask[i*8+6] = 1 & (bitmap >> 1);
+	      imask[i*8+7] = 1 & (bitmap);
+	    }
+
+	  j = 0;
+	  for ( i = 0; i < ISEC4_NumValues; i++ )
+	    if ( imask[i] ) j++;
+
+	  if ( ISEC4_NumNonMissValues != j )
+	    {
+	      if ( dfunc != 'J' && ISEC4_NumBits != 0 )
+		Warning("Bitmap (%d) and data (%d) section differ, using bitmap section!",
+			j, ISEC4_NumNonMissValues);
+
+	      ISEC4_NumNonMissValues = j;
+	    }
+
+	  if ( dfunc != 'J' )
+	    {
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+	      for ( i = ISEC4_NumValues-1; i >= 0; i-- )
+		fsec4[i] = imask[i] ? fsec4[--j] : FSEC3_MissVal;
+	    }
+
+	  free(imask);
+	}
+    }
+
+  if ( ISEC2_Reduced )
+    {
+      int nlon, nlat;
+      int lsect3, lperio = 1, lveggy;
+      int ilat;
+      int nvalues = 0;
+      int dlon;
+
+      nlat = ISEC2_NumLat;
+      nlon = ISEC2_RowLonPtr[0];
+      for ( ilat = 0; ilat < nlat; ++ilat ) nvalues += ISEC2_RowLon(ilat);
+      for ( ilat = 1; ilat < nlat; ++ilat )
+	if ( ISEC2_RowLon(ilat) > nlon ) nlon = ISEC2_RowLon(ilat);
+
+      dlon = ISEC2_LastLon-ISEC2_FirstLon;
+      if ( dlon < 0 ) dlon += 360000;
+	  
+      if ( nvalues != ISEC4_NumValues )
+	{
+	  *iret = -801;
+	}
+
+      if ( dfunc == 'R' && *iret == -801 )
+	  gprintf(__func__, "Number of values (%d) and sum of lons per row (%d) differ, abort conversion to regular grid!", ISEC4_NumValues, nvalues);
+      
+      if ( dfunc == 'R' && *iret != -801 )
+	{
+	  ISEC2_Reduced = 0;
+	  ISEC2_NumLon = nlon;
+	  ISEC4_NumValues = nlon*nlat;
+
+	  lsect3 = bitmapSize > 0;
+	  lveggy = (ISEC1_CodeTable == 128) && (ISEC1_CenterID == 98) && 
+	    ((ISEC1_Parameter == 27) || (ISEC1_Parameter == 28) || 
+	     (ISEC1_Parameter == 29) || (ISEC1_Parameter == 30));
+	      
+	  (void) qu2reg3(fsec4, ISEC2_RowLonPtr, nlat, nlon, FSEC3_MissVal, iret,
+			 lsect3, lperio, lveggy);
+	      
+	  if ( bitmapSize > 0 )
+	    {
+	      long i;
+	      int j = 0;
+	      
+	      for ( i = 0; i < ISEC4_NumValues; i++ )
+		if ( IS_NOT_EQUAL(fsec4[i], FSEC3_MissVal) ) j++;
+		  
+	      ISEC4_NumNonMissValues = j;
+	    }
+	}
+    }
+
+
+  if ( ISEC0_GRIB_Version == 1 ) isLen = 8;
+  esLen = 4;
+
+  gribLen = isLen + pdsLen + gdsLen + bmsLen + bdsLen + esLen;
+
+  if ( ISEC0_GRIB_Len )
+    if ( gribLen > ISEC0_GRIB_Len )
+      {
+	Warning("grib1Len = %d gribLen = %d", ISEC0_GRIB_Len, gribLen);
+      }
+
+  ISEC0_GRIB_Len = gribLen;
+
+  *kword = gribLen / sizeof(int);
+  if ( (size_t) gribLen != *kword * sizeof(int) ) *kword += 1;
+
+  /*
+    ----------------------------------------------------------------
+    Section 9 . Abort/return to calling routine.
+    ----------------------------------------------------------------
+  */
+ LABEL900:;
+
+  if ( ldebug )
+    {
+      gprintf(__func__, "Section 9.");
+      gprintf(__func__, "Output values set -");
+
+      gribPrintSec0(isec0);
+      gribPrintSec1(isec0, isec1);
+      /*
+	Print section 2 if present.
+      */
+      if ( lsect2 ) gribPrintSec2DP(isec0, isec2, fsec2);
+
+      if ( ! l_iorj )
+	{
+	  /*
+	    Print section 3 if present.
+	  */
+	  if ( lsect3 ) gribPrintSec3DP(isec0, isec3, fsec3);
+
+	  gribPrintSec4DP(isec0, isec4, fsec4);
+	  /*
+	    Special print for 2D spectra wave field real values in
+	    section 4
+	  */
+	  if ( (isec1[ 0] ==  140) && 
+	       (isec1[ 1] ==   98) && 
+	       (isec1[23] ==    1) && 
+	       ((isec1[39] == 1045) || (isec1[39] == 1081))  && 
+	       ((isec1[ 5] ==  250) || (isec1[ 5] ==  251)) )
+	    gribPrintSec4Wave(isec4);
+	}
+    }
+}
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <string.h>
+#include <ctype.h>
+
+
+
+int gribOpen(const char *filename, const char *mode)
+{
+  int fileID;
+
+  fileID = fileOpen(filename, mode);
+
+#if defined (__sun)
+  if ( fileID != FILE_UNDEFID && tolower(*mode) == 'r' )
+    {
+      fileSetBufferType(fileID, FILE_BUFTYPE_MMAP);
+    }
+#endif
+
+  return (fileID);  
+}
+
+
+void gribClose(int fileID)
+{
+  fileClose(fileID);
+}
+
+
+off_t gribGetPos(int fileID)
+{
+  return (fileGetPos(fileID));
+}
+
+
+int gribCheckFiletype(int fileID)
+{
+  int ierr;
+  int found = 0;
+  char buffer[4];
+
+  if ( fileRead(fileID, buffer, 4) != 4 ) return(found);
+
+  if ( memcmp(buffer, "GRIB", 4) == 0 )
+    {
+      found = 1;
+      if ( CGRIBEX_Debug ) Message("found GRIB file = %s", fileInqName(fileID));
+    }
+  else
+    {
+      long offset;
+
+      ierr = gribFileSeek(fileID, &offset);
+      fileRewind(fileID);
+      if ( !ierr )
+	{
+	  found = 1;
+	  if ( CGRIBEX_Debug ) Message("found seek GRIB file = %s", fileInqName(fileID));
+	}
+    }
+
+  return (found);
+}
+
+
+int gribCheckSeek(int fileID, long *offset, int *version)
+{
+  int ierr;
+  char buffer[4];
+
+  ierr = gribFileSeek(fileID, offset);
+
+  *version = -1;
+  if ( !ierr )
+    {
+      if ( fileRead(fileID, buffer, 4) == 4 )
+	*version = buffer[3];
+    }
+
+  return (ierr);
+}
+
+
+int gribFileSeekOld(int fileID, long *offset)
+{
+  /* position file pointer after GRIB */
+  int ch;
+  int buffersize = 4096;
+  unsigned char buffer[4096];
+  int retry = 4096;
+  int i;
+  void *fileptr;
+
+  *offset = 0;
+
+  fileptr = filePtr(fileID);
+
+  ch = filePtrGetc(fileptr); if ( ch == EOF ) return (-1); buffer[0] = ch;
+  ch = filePtrGetc(fileptr); if ( ch == EOF ) return (-1); buffer[1] = ch;
+  ch = filePtrGetc(fileptr); if ( ch == EOF ) return (-1); buffer[2] = ch;
+  ch = filePtrGetc(fileptr); if ( ch == EOF ) return (-1); buffer[3] = ch;
+  /*
+  fileRead(fileID, buffer, 4);
+  */
+
+  while ( retry-- )
+    {
+      for ( i = 0; i < buffersize-4; ++i )
+	{
+	  if (buffer[i  ] == 'G' && 
+	      buffer[i+1] == 'R' &&
+	      buffer[i+2] == 'I' &&
+	      buffer[i+3] == 'B')
+	    {
+	      if ( CGRIBEX_Debug )
+		Message("record offset = %d", (int) *offset);
+	      return (0);
+	    }
+	  else
+	    {
+	      ch = filePtrGetc(fileptr); if ( ch == EOF ) return (-1); buffer[i+4] = ch;
+	      (*offset)++;
+	    }
+	}
+      buffer[0] = buffer[i  ];
+      buffer[1] = buffer[i+1];
+      buffer[2] = buffer[i+2];
+      buffer[3] = buffer[i+3];
+    }
+
+  if ( CGRIBEX_Debug )
+    Message("record offset = %d", (int) *offset);
+
+  return (1);
+}
+
+
+int gribFileSeek(int fileID, long *offset)
+{
+  /* position file pointer after GRIB */
+  const long GRIB = 0x47524942;
+  long code = 0;
+  int ch;
+  int retry = 4096*4096;
+  void *fileptr;
+
+  *offset = 0;
+
+  fileptr = filePtr(fileID);
+
+  while ( retry-- )
+    {
+      ch = filePtrGetc(fileptr);
+      if ( ch == EOF ) return (-1);
+    
+      code = ( (code << 8) + ch ) & 0xFFFFFFFF;
+
+      if ( code == GRIB )
+	{
+	  if ( CGRIBEX_Debug )
+	    Message("record offset = %d", (int) *offset);
+	  return (0);
+	}
+
+      (*offset)++;
+    }
+
+  if ( CGRIBEX_Debug )
+    Message("record offset = %d", (int) *offset);
+
+  return (1);
+}
+
+
+int gribFileSeekTest(int fileID, long *offset)
+{
+  /* position file pointer after GRIB */
+  const long GRIB = 0x47524942;
+  long code = 0;
+  int ch;
+  int i = 0;
+  const int buffersize = 8;
+  unsigned char buffer[8];
+  int retry = 4096*4096;
+  void *fileptr;
+  int nread = 0;
+
+  *offset = 0;
+
+  fileptr = filePtr(fileID);
+
+  while ( retry-- )
+    {
+      if ( i >= nread )
+	{
+	  nread = (int) filePtrRead(fileptr, buffer, buffersize);
+	  if ( nread == 0 ) return (-1);
+	  i = 0;
+	}
+
+      ch = buffer[i++];
+      code = ( (code << 8) + ch ) & 0xFFFFFFFF;
+
+      if ( code == GRIB )
+	{
+	  /* printf("end: %d %d\n", nread, i); */
+	  if ( CGRIBEX_Debug )
+	    Message("record offset = %d", (int) *offset);
+
+	  if ( i != nread ) fileSetPos(fileID, (off_t) i-nread, SEEK_CUR);
+
+	  return (0);
+	}
+
+      (*offset)++;
+    }
+
+  if ( CGRIBEX_Debug )
+    Message("record offset = %d", (int) *offset);
+
+  return (1);
+}
+
+
+int gribReadSize(int fileID)
+{
+  int gribversion, gribsize;
+  int b1, b2, b3;
+  off_t pos;
+  void *fileptr;
+  /*
+  const int buffersize = 4;
+  unsigned char buffer[4];
+  */
+  fileptr = filePtr(fileID);
+
+  pos = fileGetPos(fileID); 
+  /* bug: order of functions calls!
+     gribsize = (filePtrGetc(fileptr) << 16) + (filePtrGetc(fileptr) << 8) + filePtrGetc(fileptr);
+  */
+  b1 = filePtrGetc(fileptr);
+  b2 = filePtrGetc(fileptr);
+  b3 = filePtrGetc(fileptr);
+  // gribsize = (b1 << 16) + (b2 << 8) + b3;
+  gribsize = gribrec_len(b1, b2, b3);
+
+  gribversion = filePtrGetc(fileptr);
+  /*
+  filePtrRead(fileptr, buffer, buffersize);
+
+  gribsize = (buffer[0] << 16) + (buffer[1] << 8) + buffer[2];
+
+  gribversion = buffer[3];
+  */
+  if ( gribsize == 24 )
+    {
+      if ( gribversion != 1 && gribversion != 2 ) gribversion = 0;
+    }
+
+  if ( CGRIBEX_Debug )
+    Message("gribversion = %d", gribversion);
+
+  if ( gribversion == 0 )
+    {
+      int pdssize = 0, gdssize = 0, bmssize = 0, bdssize = 0;
+      int issize = 4, essize = 4;
+      int flag;
+
+      pdssize = gribsize;
+      fileSetPos(fileID, (off_t) 3, SEEK_CUR);
+      if ( CGRIBEX_Debug ) Message("pdssize     = %d", pdssize);
+      flag = filePtrGetc(fileptr);
+      if ( CGRIBEX_Debug ) Message("flag        = %d", flag);
+  
+      fileSetPos(fileID, (off_t) pdssize-8, SEEK_CUR);
+
+      if ( flag & 128 )
+	{
+	  b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	  gdssize = (b1 << 16) + (b2 << 8) + b3;
+	  fileSetPos(fileID, (off_t) gdssize-3, SEEK_CUR);
+	  if ( CGRIBEX_Debug ) Message("gdssize     = %d", gdssize);
+	}
+
+      if ( flag & 64 )
+	{
+	  b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	  bmssize = (b1 << 16) + (b2 << 8) + b3;
+	  fileSetPos(fileID, (off_t) bmssize-3, SEEK_CUR);
+	  if ( CGRIBEX_Debug ) Message("bmssize     = %d", bmssize);
+	}
+
+      b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+      bdssize = (b1 << 16) + (b2 << 8) + b3;
+      if ( CGRIBEX_Debug ) Message("bdssize     = %d", bdssize);
+
+      gribsize = issize + pdssize + gdssize + bmssize + bdssize + essize;
+    }
+  else if ( gribversion == 1 )
+    {
+      if ( gribsize > JP23SET ) /* Large GRIB record */
+	{
+	  int pdssize = 0, gdssize = 0, bmssize = 0, bdssize = 0;
+	  int issize = 4, essize = 4;
+	  int flag;
+
+	  b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	  pdssize = (b1 << 16) + (b2 << 8) + b3;
+	  if ( CGRIBEX_Debug ) Message("pdssize     = %d", pdssize);
+
+	  for ( int i = 0; i < 5; ++i ) flag = filePtrGetc(fileptr);
+	  if ( CGRIBEX_Debug ) Message("flag        = %d", flag);
+  
+	  fileSetPos(fileID, (off_t) pdssize-8, SEEK_CUR);
+
+	  if ( flag & 128 )
+	    {
+	      b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	      gdssize = (b1 << 16) + (b2 << 8) + b3;
+	      fileSetPos(fileID, (off_t) gdssize-3, SEEK_CUR);
+	      if ( CGRIBEX_Debug ) Message("gdssize     = %d", gdssize);
+	    }
+	  
+	  if ( flag & 64 )
+	    {
+	      b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	      bmssize = (b1 << 16) + (b2 << 8) + b3;
+	      fileSetPos(fileID, (off_t) bmssize-3, SEEK_CUR);
+	      if ( CGRIBEX_Debug ) Message("bmssize     = %d", bmssize);
+	    }
+
+	  b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	  bdssize = (b1 << 16) + (b2 << 8) + b3;
+	  bdssize = correct_bdslen(bdssize, gribsize, issize+pdssize+gdssize+bmssize);
+	  if ( CGRIBEX_Debug ) Message("bdssize     = %d", bdssize);
+
+	  gribsize = issize+pdssize+gdssize+bmssize+bdssize+essize;
+	}
+    }
+  else if ( gribversion == 2 )
+    {
+      int i;
+      /* we set gribsize the following way because it doesn't matter then
+	 whether int is 4 or 8 bytes long - we don't have to care if the size
+	 really fits: if it does not, the record can not be read at all */
+      gribsize = 0;
+      for ( i = 0; i < 8; i++ ) gribsize = (gribsize << 8) | filePtrGetc(fileptr);
+    }
+  else
+    {
+      gribsize = 0;
+      Warning("GRIB version %d unsupported!", gribversion);
+    }
+
+  if ( filePtrEOF(fileptr) ) gribsize = 0;
+
+  if ( CGRIBEX_Debug )
+    Message("gribsize    = %d", gribsize);
+
+  fileSetPos(fileID, pos, SEEK_SET);
+
+  return (gribsize);
+}
+
+
+int gribGetSize(int fileID)
+{
+  int recsize;
+  long offset;
+  int ierr;
+
+  ierr = gribFileSeek(fileID, &offset); /* position file pointer after GRIB */
+  if ( ierr > 0 )
+    {
+      Warning("GRIB record not found!");
+      return (0);
+    }
+
+  if ( ierr == -1 )
+    return (0);
+  else if ( ierr == 1 )
+    return (0);
+
+  recsize = gribReadSize(fileID);
+
+  if ( CGRIBEX_Debug ) Message("recsize = %d", recsize);
+
+  fileSetPos(fileID, (off_t) -4, SEEK_CUR);
+
+  return (recsize);
+}
+
+
+int gribRead(int fileID, unsigned char *buffer, size_t *buffersize)
+{
+  long offset;
+  int ierr = 0;
+  size_t nread, recsize, recsize0;
+
+  ierr = gribFileSeek(fileID, &offset); /* position file pointer after GRIB */
+  if ( ierr > 0 )
+    {
+      Warning("GRIB record not found!");
+      return (-2);
+    }
+
+  if ( ierr == -1 )
+    {
+      *buffersize = 0;
+      return (-1);
+    }
+  else if ( ierr == 1 )
+    {
+      *buffersize = 0;
+      return (-2);
+    }
+
+  recsize = gribReadSize(fileID);
+
+  buffer[0] = 'G';
+  buffer[1] = 'R';
+  buffer[2] = 'I';
+  buffer[3] = 'B';
+
+  recsize0 = recsize;
+
+  if ( recsize > *buffersize )
+    {
+      recsize = *buffersize;
+      ierr = -3;
+    }
+
+  *buffersize = recsize0;
+
+  nread = fileRead(fileID, &buffer[4], recsize-4);
+
+  if ( nread != recsize-4 ) ierr = 1;
+
+  return (ierr);
+}
+
+
+int gribWrite(int fileID, unsigned char *buffer, size_t buffersize)
+{
+  int  nwrite = 0;
+
+  if( (nwrite = fileWrite(fileID, buffer, buffersize)) != (int) buffersize )
+    {
+      perror(__func__);
+      nwrite = -1;
+    }
+
+  return ((int) nwrite);
+}
+
+
+int gribrec_len(int b1, int b2, int b3)
+{
+  int gribsize;
+
+  gribsize = (1-(int) ((unsigned) (b1&128) >> 6)) * (int) (((b1&127) << 16)+(b2<<8) + b3);
+  /*
+    If count is negative, have to rescale by factor of -120.
+    This is a fixup to get round the restriction on product lengths
+    due to the count being only 24 bits. It is only possible because
+    the (default) rounding for GRIB products is 120 bytes.
+  */
+  if ( gribsize < 0 ) gribsize *= (-120);
+
+  return (gribsize);
+}
+
+#include <stdio.h>
+#include <math.h>
+
+
+/* calculate_pfactor: source code from grib_api-1.8.0 */
+double calculate_pfactor(const double* spectralField, long fieldTruncation, long subsetTruncation)
+{
+  /*long n_vals = ((fieldTruncation+1)*(fieldTruncation+2));*/
+  long loop, index, m, n = 0;
+  double pFactor, zeps = 1.0e-15;
+  long ismin = (subsetTruncation+1), ismax = (fieldTruncation+1);
+  double* weights, range, * norms;
+  double weightedSumOverX = 0.0, weightedSumOverY = 0.0, sumOfWeights = 0.0, x, y;
+  double numerator = 0.0, denominator = 0.0, slope;
+
+  /*
+  // Setup the weights
+   */
+
+  range = (double) (ismax - ismin +1);
+
+  weights = (double*) malloc((ismax+1)*sizeof(double));
+  for( loop = ismin; loop <= ismax; loop++ )
+    weights[loop] = range / (double) (loop-ismin+1);
+  /*
+  // Compute norms
+  // Handle values 2 at a time (real and imaginary parts).
+   */
+  norms = (double*) malloc((ismax+1)*sizeof(double));
+
+  for( loop = 0; loop < ismax+1; loop++ ) norms[loop] = 0.0;
+  /*
+  // Form norms for the rows which contain part of the unscaled subset.
+   */
+
+  index = -2;
+  for( m = 0; m < subsetTruncation; m++ )
+    for( n = m; n <= fieldTruncation; n++ ) {
+      index += 2;
+      if( n >= subsetTruncation ) {
+        double tval = spectralField[index];
+        tval=tval<0?-tval:tval;
+        norms[n] = norms[n] > tval ? norms[n] : tval;
+        tval = spectralField[index+1];
+        tval=tval<0?-tval:tval;
+        norms[n] = norms[n] > tval ? norms[n] : tval;
+      }
+    }
+  /*
+  // Form norms for the rows which do not contain part of the unscaled subset.
+   */
+
+  for( m = subsetTruncation; m <= fieldTruncation; m++ )
+    for( n = m; n <= fieldTruncation; n++ ) {
+      double tval = spectralField[index];
+      index += 2;
+      tval=tval<0?-tval:tval;
+      norms[n] = norms[n] > tval ? norms[n] : tval;
+      tval = spectralField[index+1];
+      tval=tval<0?-tval:tval;
+      norms[n] = norms[n] > tval ? norms[n] : tval;
+    }
+
+  /*
+  // Ensure the norms have a value which is not too small in case of
+  // problems with math functions (e.g. LOG).
+   */
+
+  for( loop = ismin; loop <= ismax; loop++ ) {
+    norms[n] = norms[n] > zeps ? norms[n] : zeps;
+    if( norms[n] == zeps ) weights[n] = 100.0 * zeps;
+  }
+
+  /*
+  // Do linear fit to find the slope
+   */
+
+  for( loop = ismin; loop <= ismax; loop++ ) {
+    x = log( (double) (loop*(loop+1)) );
+    y = log( norms[loop] );
+    weightedSumOverX = weightedSumOverX + x * weights[loop];
+    weightedSumOverY = weightedSumOverY + y * weights[loop];
+    sumOfWeights = sumOfWeights + weights[loop];
+  }
+  weightedSumOverX = weightedSumOverX / sumOfWeights;
+  weightedSumOverY = weightedSumOverY / sumOfWeights;
+
+  /*
+  // Perform a least square fit for the equation
+   */
+
+  for( loop = ismin; loop <= ismax; loop++ ) {
+
+    x = log( (double)(loop*(loop+1)) );
+    y = log( norms[loop] );
+    numerator =
+      numerator + weights[loop] * (y-weightedSumOverY) * (x-weightedSumOverX);
+    denominator =
+      denominator + weights[loop] * ((x-weightedSumOverX) * (x-weightedSumOverX));
+  }
+  slope = numerator / denominator;
+
+  free(weights);
+  free(norms);
+
+  pFactor = -slope;
+  if( pFactor < -9999.9 ) pFactor = -9999.9;
+  if( pFactor > 9999.9 )  pFactor = 9999.9;
+
+  return pFactor;
+}
+
+
+void scaleComplex(double *fpdata, int pcStart, int pcScale, int trunc, int inv)
+{
+  double power;
+  double *scale = (double *) malloc((trunc+1)*sizeof(double));
+  int  n, m;
+  int  index;
+
+  if ( scale == NULL ) SysError("No Memory!");
+
+  if ( pcScale < -10000 || pcScale > 10000 )
+    {
+      fprintf(stderr, " scaleComplex: Invalid power given %6d\n", pcScale);
+      return;
+   }
+
+  /* Setup scaling factors = n(n+1)^^p for n = 1 to truncation */
+
+  if ( pcScale == 0 ) return;
+
+  power = (double) pcScale / 1000.;
+  scale[0] = 1.0;
+
+  for ( n = 1; n <= trunc; n++ )
+    {
+      if (pcScale != 1000)
+         scale[n] = pow((double) (n*(n+1)), power);
+      else
+         scale[n] =     (double) (n*(n+1));
+    }
+
+  if ( inv )
+    for ( n = 1; n <= trunc; n++ ) scale[n] = 1.0 / scale[n];
+
+  /* Scale the values */
+
+  index = 0;
+
+  for ( m = 0;   m < pcStart; m++ )
+    for ( n = m; n <= trunc; n++ )
+      {
+	if ( n >= pcStart )
+	  {
+	    fpdata[index  ] *= scale[n];
+	    fpdata[index+1] *= scale[n];
+	  }
+	index += 2;
+      }
+
+  for ( m = pcStart; m <= trunc; m++ )
+    for ( n = m;     n <= trunc; n++ )
+      {
+	fpdata[index  ] *= scale[n];
+	fpdata[index+1] *= scale[n];
+	index += 2;
+      }
+
+  free(scale);
+}
+
+
+void scatterComplex(double *fpdata, int pcStart, int trunc, int nsp)
+{
+  double *fphelp = (double *) malloc(nsp*sizeof(double));
+  int  m, n;
+  int  index, inext;
+
+  if ( fphelp == NULL ) SysError("No Memory!");
+
+  index = inext = 0;
+
+  for ( m = 0;   m <= pcStart; m++ )
+    for ( n = m; n <= trunc; n++ )
+      {
+	if ( pcStart >= n )
+	  {
+	    fphelp[index  ] = fpdata[inext++];
+	    fphelp[index+1] = fpdata[inext++];
+	  }
+	index += 2;
+      }
+
+  index = 0;
+  for ( m = 0;   m <= trunc; m++ )
+    for ( n = m; n <= trunc; n++ )
+      {
+	if ( n > pcStart )
+	  {
+	    fphelp[index  ] = fpdata[inext++];
+	    fphelp[index+1] = fpdata[inext++];
+	  }
+	index += 2;
+      }
+
+  for ( m = 0; m < nsp; m++ ) fpdata[m] = fphelp[m];
+
+  free(fphelp);
+}
+
+
+void gatherComplex(double *fpdata, int pcStart, int trunc, int nsp)
+{
+  double *fphelp = (double *) malloc(nsp*sizeof(double));
+  int  m, n;
+  int  index, inext;
+
+  if ( fphelp == NULL ) SysError("No Memory!");
+
+  index = inext = 0;
+
+  for ( m = 0;   m <= pcStart; m++ )
+    for ( n = m; n <= trunc; n++ )
+      {
+	if ( pcStart >= n )
+	  {
+	    fphelp[inext++] = fpdata[index];
+	    fphelp[inext++] = fpdata[index+1];
+	  }
+	index += 2;
+      }
+
+  index = 0;
+  for ( m = 0;   m <= trunc; m++ )
+    for ( n = m; n <= trunc; n++ )
+      {
+	if ( n > pcStart )
+	  {
+	    fphelp[inext++] = fpdata[index];
+	    fphelp[inext++] = fpdata[index+1];
+	  }
+	index += 2;
+      }
+
+  for ( m = 0; m < nsp; m++ ) fpdata[m] = fphelp[m];
+
+  free(fphelp);
+}
+
+
+void scm0(double *pdl, double *pdr, double *pfl, double *pfr, int klg)
+{
+  /* System generated locals */
+  double r_1;
+
+  /* Local variables */
+  double zfac, zeps, zbeta;
+  int jl;
+  double zalpha;
+
+  /* **** SCM0   - Apply SCM0 limiter to derivative estimates. */
+  /* output: */
+  /*   pdl   = the limited derivative at the left edge of the interval */
+  /*   pdr   = the limited derivative at the right edge of the interval */
+  /* inputs */
+  /*   pdl   = the original derivative at the left edge */
+  /*   pdr   = the original derivative at the right edge */
+  /*   pfl   = function value at the left edge of the interval */
+  /*   pfr   = function value at the right edge of the interval */
+  /*   klg   = number of intervals where the derivatives are limited */
+
+  /*  define constants */
+
+  zeps = 1.0e-12;
+  zfac = (1.0 - zeps) * 3.0;
+
+  for ( jl = 0; jl < klg; ++jl )
+    {
+      if ( (r_1 = pfr[jl] - pfl[jl], fabs(r_1)) > zeps )
+	{
+	  zalpha = pdl[jl] / (pfr[jl] - pfl[jl]);
+	  zbeta  = pdr[jl] / (pfr[jl] - pfl[jl]);
+	  if ( zalpha <= 0.0 ) pdl[jl] = 0.0;
+	  if ( zbeta  <= 0.0 ) pdr[jl] = 0.0;
+	  if ( zalpha > zfac ) pdl[jl] = zfac * (pfr[jl] - pfl[jl]);
+	  if ( zbeta  > zfac ) pdr[jl] = zfac * (pfr[jl] - pfl[jl]);
+	}
+      else
+	{
+	  pdl[jl] = 0.0;
+	  pdr[jl] = 0.0;
+	}
+    }
+} /* scm0 */
+
+
+int rowina2(double *p, int ko, int ki, double *pw,
+	    int kcode, double msval, int *kret)
+{
+  /* System generated locals */
+  int pw_dim1, pw_offset, i_1;
+
+  /* Local variables */
+  double zwt1, zrdi, zpos;
+  int jl, ip;
+  double zdo, zwt;
+
+  /* Parameter adjustments */
+  --p;
+  pw_dim1 = ko + 3;
+  pw_offset = pw_dim1;
+  pw -= pw_offset;
+
+  /* **** ROWINA2 - Interpolation of row of values. */
+  /*     Input Parameters. */
+  /*     ----------------- */
+  /*     P      - Row of values to be interpolated. */
+  /*              Dimension must be at least KO. */
+  /*     KO     - Number of values required. */
+  /*     KI     - Number of values in P on input. */
+  /*     PW     - Working array. */
+  /*              Dimension must be at least (0:KO+2,3). */
+  /*     KCODE  - Interpolation required. */
+  /*              1 , linear. */
+  /*              3 , cubic. */
+  /*     PMSVAL - Value used for missing data indicator. */
+
+  /*     Output Parameters. */
+  /*     ------------------ */
+  /*     P     - Now contains KO values. */
+  /*     KRET  - Return code */
+  /*             0, OK */
+  /*             Non-zero, error */
+
+  /*     Author. */
+  /*     ------- */
+  /*     J.D.Chambers    ECMWF     22.07.94 */
+
+  /*     ********************************    */
+  /*     Section 1.  Linear interpolation .. */
+  /*     ********************************    */
+
+  *kret = 0;
+
+  if ( kcode == 1 )
+    {
+      /*    Move input values to work array */
+      for ( jl = 1; jl <= ki; ++jl )
+	pw[jl + pw_dim1] = p[jl];
+
+      /*    Arrange wrap-around value in work array */
+      pw[ki + 1 + pw_dim1] = p[1];
+
+      /*    Set up constants to be used to figure out weighting for */
+      /*    values in interpolation. */
+      zrdi = (double) ki;
+      zdo = 1.0 / (double) ko;
+
+      /*    Loop through the output points */
+      for ( jl = 1; jl <= ko; ++jl )
+	{
+
+	  /*    Calculate weight from the start of row */
+	  zpos = (jl - 1) * zdo;
+	  zwt = zpos * zrdi;
+
+	  /*    Get the current array position(minus 1) from the weight - */
+	  /*    note the implicit truncation. */
+	  ip = (int) zwt;
+
+	  /*    If the left value is missing, use the right value */
+	  if ( IS_EQUAL(pw[ip + 1 + pw_dim1], msval) )
+	    {
+	      p[jl] = pw[ip + 2 + pw_dim1];
+	    }
+	  /*    If the right value is missing, use the left value */
+	  else if ( IS_EQUAL(pw[ip + 2 + pw_dim1], msval) )
+	    {
+	      p[jl] = pw[ip + 1 + pw_dim1];
+	    }
+	  /*    If neither missing, interpolate ... */
+	  else
+	    {
+
+	      /*       Adjust the weight to range (0.0 to 1.0) */
+	      zwt -= ip;
+
+	      /*       Interpolate using the weighted values on either side */
+	      /*       of the output point position */
+	      p[jl] = (1.0 - zwt) * pw[ip + 1 + pw_dim1] +
+		zwt * pw[ip + 2 + pw_dim1];
+	    }
+	}
+
+      /*     *******************************    */
+      /*     Section 2.  Cubic interpolation .. */
+      /*     *******************************    */
+
+    }
+  else if ( kcode == 3 )
+    {
+      i_1 = ki;
+      for ( jl = 1; jl <= i_1; ++jl )
+	{
+          if ( IS_EQUAL(p[jl], msval) )
+	    {
+	      fprintf(stderr," ROWINA2: ");
+	      fprintf(stderr," Cubic interpolation not supported");
+	      fprintf(stderr," for fields containing missing data.\n");
+	      *kret = 1;
+	      goto L900;
+	    }
+          pw[jl + pw_dim1] = p[jl];
+	}
+      pw[pw_dim1] = p[ki];
+      pw[ki + 1 + pw_dim1] = p[1];
+      pw[ki + 2 + pw_dim1] = p[2];
+      i_1 = ki;
+      for ( jl = 1; jl <= i_1; ++jl )
+	{
+          pw[jl + (pw_dim1 << 1)] =
+	        - pw[jl - 1 + pw_dim1] / 3.0 -
+	          pw[jl     + pw_dim1] * 0.5 +
+	          pw[jl + 1 + pw_dim1] - pw[jl + 2 + pw_dim1] / 6.0;
+          pw[jl + 1 + pw_dim1 * 3] =
+                  pw[jl - 1 + pw_dim1] / 6.0 -
+                  pw[jl     + pw_dim1] +
+                  pw[jl + 1 + pw_dim1] * 0.5 +
+                  pw[jl + 2 + pw_dim1] / 3.0;
+	}
+
+      scm0(&pw[(pw_dim1 << 1) + 1], &pw[pw_dim1 * 3 + 2],
+	   &pw[pw_dim1 + 1], &pw[pw_dim1 + 2], ki);
+
+      zrdi = (double) ki;
+      zdo = 1.0 / (double) ko;
+      for ( jl = 1; jl <= ko; ++jl )
+	{
+          zpos = (jl - 1) * zdo;
+          zwt = zpos * zrdi;
+          ip = (int) zwt + 1;
+          zwt = zwt + 1.0 - ip;
+          zwt1 = 1.0 - zwt;
+          p[jl] = ((3.0 - zwt1 * 2.0) * pw[ip + pw_dim1] +
+                  zwt * pw[ip + (pw_dim1 << 1)]) * zwt1 * zwt1 +
+                  ((3.0 - zwt * 2.0) * pw[ip + 1 + pw_dim1] -
+                  zwt1 * pw[ip + 1 + pw_dim1 * 3]) * zwt * zwt;
+	}
+
+    }
+  else
+    {
+      /*    **************************************    */
+      /*    Section 3.  Invalid interpolation code .. */
+      /*    **************************************    */
+      fprintf(stderr," ROWINA2:");
+      fprintf(stderr," Invalid interpolation code = %2d\n",kcode);
+      *kret = 2;
+    }
+
+L900:
+    return 0;
+} /* rowina2 */
+
+
+int rowina3(double *p, int ko, int ki, double *pw,
+	    int kcode, double msval, int *kret, int omisng, int operio, int oveggy)
+{
+  /*
+C---->
+C**** ROWINA3 - Interpolation of row of values.
+C
+C     Purpose.
+C     --------
+C
+C     Interpolate a row of values.
+C
+C
+C**   Interface.
+C     ----------
+C
+C     CALL ROWINA3( P, KO, KI, PW, KCODE, PMSVAL, KRET, OMISNG, OPERIO)
+C
+C
+C     Input Parameters.
+C     -----------------
+C
+C     P      - Row of values to be interpolated.
+C              Dimension must be at least KO.
+C
+C     KO     - Number of values required.
+C
+C     KI     - Number of values in P on input.
+C
+C     PW     - Working array.
+C              Dimension must be at least (0:KO+2,3).
+C
+C     KCODE  - Interpolation required.
+C              1 , linear.
+C              3 , cubic.
+C
+C     PMSVAL - Value used for missing data indicator.
+C
+C     OMISNG - True if missing values are present in field.
+C
+C     OPERIO - True if input field is periodic.
+C
+C     OVEGGY - True if 'nearest neighbour' processing must be used
+C              for interpolation
+C
+C     Output Parameters.
+C     ------------------
+C
+C     P     - Now contains KO values.
+C     KRET  - Return code
+C             0, OK
+C             Non-zero, error
+C
+C
+C     Method.
+C     -------
+C
+C     Linear or cubic interpolation performed as required.
+C
+C     Comments.
+C     ---------
+C
+C     This is a version of ROWINA which allows for missing data
+C     values and hence for bitmapped fields.
+C
+C
+C     Author.
+C     -------
+C
+C     J.D.Chambers    ECMWF     22.07.94
+C
+C
+C     Modifications.
+C     --------------
+C
+C     J.D.Chambers    ECMWF     13.09.94
+C     Add return code KRET and remove calls to ABORT.
+C
+C     J. Clochard, Meteo France, for ECMWF - January 1998.
+C     Addition of OMISNG and OPERIO arguments.
+C
+C
+C     -----------------------------------------------------------------
+*/
+  /* System generated locals */
+  int pw_dim1, pw_offset, i_1;
+
+  /* Local variables */
+  double zwt1, zrdi, zpos;
+  int jl, ip;
+  double zdo, zwt;
+
+  /* Parameter adjustments */
+  --p;
+  pw_dim1 = ko + 3;
+  pw_offset = pw_dim1;
+  pw -= pw_offset;
+
+  *kret = 0;
+
+  if ( kcode == 1 )
+    {
+      /*    Move input values to work array */
+      for ( jl = 1; jl <= ki; ++jl )
+	pw[jl + pw_dim1] = p[jl];
+
+      if ( operio )
+	{
+	  /* Arrange wrap-around value in work array */
+	  pw[ki + 1 + pw_dim1] = p[1];
+
+	  /* Set up constants to be used to figure out weighting for */
+	  /* values in interpolation. */
+	  zrdi = (double) ki;
+	  zdo = 1.0 / (double) ko;
+	}
+      else
+	{
+	  /* Repeat last value, to cope with "implicit truncation" below */
+	  pw[ki + 1 + pw_dim1] = p[ki];
+
+	  /* Set up constants to be used to figure out weighting for */
+	  /* values in interpolation. */
+	  zrdi = (double) (ki-1);
+	  zdo = 1.0 / (double) (ko-1);
+ 	}
+
+      /*    Loop through the output points */
+      for ( jl = 1; jl <= ko; ++jl )
+	{
+
+	  /* Calculate weight from the start of row */
+	  zpos = (jl - 1) * zdo;
+	  zwt = zpos * zrdi;
+
+	  /* Get the current array position(minus 1) from the weight - */
+	  /* note the implicit truncation. */
+	  ip = (int) zwt;
+		  
+	  /* Adjust the weight to range (0.0 to 1.0) */
+	  zwt -= ip;
+
+          /* If 'nearest neighbour' processing must be used */
+	  if ( oveggy )
+	    {
+              if ( zwt < 0.5 )
+                p[jl] = pw[ip + 1 + pw_dim1];
+	      else
+		p[jl] = pw[ip + 2 + pw_dim1];
+	    }
+	  else
+	    {
+	      /*    If the left value is missing, use the right value */
+	      if ( IS_EQUAL(pw[ip + 1 + pw_dim1], msval) )
+		{
+		  p[jl] = pw[ip + 2 + pw_dim1];
+		}
+	      /*    If the right value is missing, use the left value */
+	      else if ( IS_EQUAL(pw[ip + 2 + pw_dim1], msval) )
+		{
+		  p[jl] = pw[ip + 1 + pw_dim1];
+		}
+	      /*    If neither missing, interpolate ... */
+	      else
+		{
+		  /*       Interpolate using the weighted values on either side */
+		  /*       of the output point position */
+		  p[jl] = (1.0 - zwt) * pw[ip + 1 + pw_dim1] +
+		    zwt * pw[ip + 2 + pw_dim1];
+		}
+	    }
+	}
+
+      /*     *******************************    */
+      /*     Section 2.  Cubic interpolation .. */
+      /*     *******************************    */
+
+    }
+  else if ( kcode == 3 )
+    {
+      i_1 = ki;
+      for ( jl = 1; jl <= i_1; ++jl )
+	{
+          if ( IS_EQUAL(p[jl], msval) )
+	    {
+	      fprintf(stderr," ROWINA2: ");
+	      fprintf(stderr," Cubic interpolation not supported");
+	      fprintf(stderr," for fields containing missing data.\n");
+	      *kret = 1;
+	      goto L900;
+	    }
+          pw[jl + pw_dim1] = p[jl];
+	}
+      pw[pw_dim1] = p[ki];
+      pw[ki + 1 + pw_dim1] = p[1];
+      pw[ki + 2 + pw_dim1] = p[2];
+      i_1 = ki;
+      for ( jl = 1; jl <= i_1; ++jl )
+	{
+          pw[jl + (pw_dim1 << 1)] =
+	        - pw[jl - 1 + pw_dim1] / 3.0 -
+	          pw[jl     + pw_dim1] * 0.5 +
+	          pw[jl + 1 + pw_dim1] - pw[jl + 2 + pw_dim1] / 6.0;
+          pw[jl + 1 + pw_dim1 * 3] =
+                  pw[jl - 1 + pw_dim1] / 6.0 -
+                  pw[jl     + pw_dim1] +
+                  pw[jl + 1 + pw_dim1] * 0.5 +
+                  pw[jl + 2 + pw_dim1] / 3.0;
+	}
+
+      scm0(&pw[(pw_dim1 << 1) + 1], &pw[pw_dim1 * 3 + 2],
+	   &pw[pw_dim1 + 1], &pw[pw_dim1 + 2], ki);
+
+      zrdi = (double) ki;
+      zdo = 1.0 / (double) ko;
+      for ( jl = 1; jl <= ko; ++jl )
+	{
+          zpos = (jl - 1) * zdo;
+          zwt = zpos * zrdi;
+          ip = (int) zwt + 1;
+          zwt = zwt + 1.0 - ip;
+          zwt1 = 1.0 - zwt;
+          p[jl] = ((3.0 - zwt1 * 2.0) * pw[ip + pw_dim1] +
+                  zwt * pw[ip + (pw_dim1 << 1)]) * zwt1 * zwt1 +
+                  ((3.0 - zwt * 2.0) * pw[ip + 1 + pw_dim1] -
+                  zwt1 * pw[ip + 1 + pw_dim1 * 3]) * zwt * zwt;
+	}
+
+    }
+  else
+    {
+      /*    **************************************    */
+      /*    Section 3.  Invalid interpolation code .. */
+      /*    **************************************    */
+      fprintf(stderr," ROWINA2:");
+      fprintf(stderr," Invalid interpolation code = %2d\n",kcode);
+      *kret = 2;
+    }
+
+L900:
+    return 0;
+} /* rowina3 */
+
+
+int qu2reg2(double *pfield, int *kpoint, int klat, int klon,
+	    double *ztemp, double msval, int *kret)
+{
+   /* System generated locals */
+   int i_1, i_2;
+   int kcode = 1;
+
+   /* Local variables */
+   int ilii, ilio, icode;
+   double *zline = NULL;
+   double *zwork = NULL;
+   int iregno, iquano, j210, j220, j230, j240, j225;
+
+
+   zline = (double *) malloc(2*klon*sizeof(double));
+   if ( zline == NULL ) SysError("No Memory!");
+
+   zwork = (double *) malloc(3*(2*klon+3)*sizeof(double));
+   if ( zwork == NULL ) SysError("No Memory!");
+
+   /* Parameter adjustments */
+   --pfield;
+   --kpoint;
+
+/* **** QU2REG - Convert quasi-regular grid data to regular. */
+/*     Input Parameters. */
+/*     ----------------- */
+/*     PFIELD     - Array containing quasi-regular grid */
+/*                  data. */
+/*     KPOINT     - Array containing list of the number of */
+/*                  points on each latitude (or longitude) of */
+/*                  the quasi-regular grid. */
+/*     KLAT       - Number of latitude lines */
+/*     KLON       - Number of longitude lines */
+/*     KCODE      - Interpolation required. */
+/*                  1 , linear - data quasi-regular on */
+/*                               latitude lines. */
+/*                  3 , cubic -  data quasi-regular on */
+/*                               latitude lines. */
+/*                  11, linear - data quasi-regular on */
+/*                               longitude lines. */
+/*                  13, cubic -  data quasi-regular on */
+/*                               longitude lines. */
+/*     PMSVAL     - Value used for missing data indicator. */
+/*     Output Parameters. */
+/*     ------------------ */
+/*     KRET       - return code */
+/*                  0 = OK */
+/*                  non-zero indicates fatal error */
+/*     PFIELD     - Array containing regular grid data. */
+/*     Author. */
+/*     ------- */
+/*     J.D.Chambers     ECMWF      22.07.94 */
+/*     J.D.Chambers     ECMWF      13.09.94 */
+/*     Add return code KRET and remove calls to ABORT. */
+
+
+/* ------------------------------ */
+/* Section 1. Set initial values. */
+/* ------------------------------ */
+
+   *kret = 0;
+
+/* Check input parameters. */
+
+   if (kcode != 1 && kcode != 3 && kcode != 11 && kcode != 13) {
+      fprintf(stderr," QU2REG :");
+      fprintf(stderr," Invalid interpolation type code = %2d\n",kcode);
+      *kret = 1;
+      goto L900;
+   }
+
+/* Set array indices to 0. */
+
+   ilii = 0;
+   ilio = 0;
+
+/* Establish values of loop parameters. */
+
+   if (kcode > 10) {
+
+/*    Quasi-regular along longitude lines. */
+
+      iquano = klon;
+      iregno = klat;
+      icode = kcode - 10;
+   } else {
+
+/*    Quasi-regular along latitude lines. */
+
+      iquano = klat;
+      iregno = klon;
+      icode = kcode;
+   }
+
+/*     -------------------------------------------------------- */
+/**    Section 2. Interpolate field from quasi to regular grid. */
+/*     -------------------------------------------------------- */
+
+   i_1 = iquano;
+   for (j230 = 1; j230 <= i_1; ++j230) {
+
+      if (iregno != kpoint[j230]) {
+
+/*       Line contains less values than required,so */
+/*       extract quasi-regular grid values for a line */
+
+         i_2 = kpoint[j230];
+         for (j210 = 1; j210 <= i_2; ++j210) {
+            ++ilii;
+            zline[j210 - 1] = pfield[ilii];
+         }
+
+/*       and interpolate this line. */
+
+         rowina2(zline, iregno, kpoint[j230], zwork, icode, msval, kret);
+         if (*kret != 0) goto L900;
+
+/*       Add regular grid values for this line to the
+         temporary array. */
+
+         i_2 = iregno;
+         for (j220 = 1; j220 <= i_2; ++j220) {
+            ++ilio;
+            ztemp[ilio - 1] = zline[j220 - 1];
+         }
+
+      } else {
+
+/*       Line contains the required number of values, so add */
+/*       this line to the temporary array. */
+
+         i_2 = iregno;
+         for (j225 = 1; j225 <= i_2; ++j225) {
+            ++ilio;
+            ++ilii;
+            ztemp[ilio - 1] = pfield[ilii];
+         }
+      }
+   }
+
+/* Copy temporary array to user array. */
+
+   i_1 = klon * klat;
+   for (j240 = 1; j240 <= i_1; ++j240) {
+      pfield[j240] = ztemp[j240 - 1];
+   }
+
+/* -------------------------------------------------------- */
+/* Section 9. Return to calling routine. Format statements. */
+/* -------------------------------------------------------- */
+
+L900:
+
+   free(zline);
+   free(zwork);
+
+   return 0;
+} /* qu2reg2 */
+
+
+int qu2reg3(double *pfield, int *kpoint, int klat, int klon,
+	    double msval, int *kret, int omisng, int operio, int oveggy)
+{
+  /*
+C**** QU2REG3 - Convert quasi-regular grid data to regular.
+C
+C     Purpose.
+C     --------
+C
+C     Convert quasi-regular grid data to regular,
+C     using either a linear or cubic interpolation.
+C
+C
+C**   Interface.
+C     ----------
+C
+C     CALL QU2REG3(PFIELD,KPOINT,KLAT,KLON,KCODE,PMSVAL,OMISNG,OPERIO,
+C    X            OVEGGY)
+C
+C
+C     Input Parameters.
+C     -----------------
+C
+C     PFIELD     - Array containing quasi-regular grid data.
+C
+C     KPOINT     - Array containing list of the number of
+C                  points on each latitude (or longitude) of
+C                  the quasi-regular grid.
+C
+C     KLAT       - Number of latitude lines
+C
+C     KLON       - Number of longitude lines
+C
+C     KCODE      - Interpolation required.
+C                  1 , linear - data quasi-regular on latitude lines.
+C                  3 , cubic -  data quasi-regular on latitude lines.
+C                  11, linear - data quasi-regular on longitude lines.
+C                  13, cubic -  data quasi-regular on longitude lines.
+C
+C     PMSVAL     - Value used for missing data indicator.
+C
+C     OMISNG     - True if missing values are present in field.
+C
+C     OPERIO     - True if input field is periodic.
+C
+C     OVEGGY     - True if 'nearest neighbour' processing must be used
+C                  for interpolation
+C
+C
+C     Output Parameters.
+C     ------------------
+C
+C     KRET       - return code
+C                  0 = OK
+C                  non-zero indicates fatal error
+C
+C
+C     Output Parameters.
+C     ------------------
+C
+C     PFIELD     - Array containing regular grid data.
+C
+C
+C     Method.
+C     -------
+C
+C     Data is interpolated and expanded into a temporary array,
+C     which is then copied back into the user's array.
+C     Returns an error code if an invalid interpolation is requested
+C     or field size exceeds array dimensions.
+C
+C     Comments.
+C     ---------
+C
+C     This routine is an adaptation of QU2REG to allow missing data
+C     values, and hence bit mapped fields.
+C
+C
+C     Author.
+C     -------
+C
+C     J.D.Chambers     ECMWF      22.07.94
+C
+C
+C     Modifications.
+C     --------------
+C
+C     J.D.Chambers     ECMWF      13.09.94
+C     Add return code KRET and remove calls to ABORT.
+C
+C     J.D.Chambers     ECMWF        Feb 1997
+C     Allow for 64-bit pointers
+C
+C     J. Clochard, Meteo France, for ECMWF - January 1998.
+C     Addition of OMISNG and OPERIO arguments.
+C     Fix message for longitude number out of bounds, and routine
+C     name in title and formats.
+C
+*/
+   /* System generated locals */
+   int i_1, i_2;
+   int kcode = 1;
+
+   /* Local variables */
+   int ilii, ilio, icode;
+   double *ztemp = NULL;
+   double *zline = NULL;
+   double *zwork = NULL;
+   int iregno, iquano, j210, j220, j230, j240, j225;
+
+   ztemp = (double *) malloc(klon*klat*sizeof(double));
+   if ( ztemp == NULL ) SysError("No Memory!");
+
+   zline = (double *) malloc(2*klon*sizeof(double));
+   if ( zline == NULL ) SysError("No Memory!");
+
+   zwork = (double *) malloc(3*(2*klon+3)*sizeof(double));
+   if ( zwork == NULL ) SysError("No Memory!");
+
+   /* Parameter adjustments */
+   --pfield;
+   --kpoint;
+
+/* ------------------------------ */
+/* Section 1. Set initial values. */
+/* ------------------------------ */
+
+   *kret = 0;
+
+/* Check input parameters. */
+
+   if (kcode != 1 && kcode != 3 && kcode != 11 && kcode != 13) {
+      fprintf(stderr," QU2REG :");
+      fprintf(stderr," Invalid interpolation type code = %2d\n",kcode);
+      *kret = 1;
+      goto L900;
+   }
+
+/* Set array indices to 0. */
+
+   ilii = 0;
+   ilio = 0;
+
+/* Establish values of loop parameters. */
+
+   if (kcode > 10) {
+
+/*    Quasi-regular along longitude lines. */
+
+      iquano = klon;
+      iregno = klat;
+      icode = kcode - 10;
+   } else {
+
+/*    Quasi-regular along latitude lines. */
+
+      iquano = klat;
+      iregno = klon;
+      icode = kcode;
+   }
+
+/*     -------------------------------------------------------- */
+/**    Section 2. Interpolate field from quasi to regular grid. */
+/*     -------------------------------------------------------- */
+
+   i_1 = iquano;
+   for (j230 = 1; j230 <= i_1; ++j230) {
+
+      if (iregno != kpoint[j230]) {
+
+/*       Line contains less values than required,so */
+/*       extract quasi-regular grid values for a line */
+
+         i_2 = kpoint[j230];
+         for (j210 = 1; j210 <= i_2; ++j210) {
+            ++ilii;
+            zline[j210 - 1] = pfield[ilii];
+         }
+
+/*       and interpolate this line. */
+
+         rowina3(zline, iregno, kpoint[j230], zwork, icode, msval, kret, omisng, operio , oveggy);
+         if (*kret != 0) goto L900;
+
+/*       Add regular grid values for this line to the
+         temporary array. */
+
+         i_2 = iregno;
+         for (j220 = 1; j220 <= i_2; ++j220) {
+            ++ilio;
+            ztemp[ilio - 1] = zline[j220 - 1];
+         }
+
+      } else {
+
+/*       Line contains the required number of values, so add */
+/*       this line to the temporary array. */
+
+         i_2 = iregno;
+         for (j225 = 1; j225 <= i_2; ++j225) {
+            ++ilio;
+            ++ilii;
+            ztemp[ilio - 1] = pfield[ilii];
+         }
+      }
+   }
+
+/* Copy temporary array to user array. */
+
+   i_1 = klon * klat;
+   for (j240 = 1; j240 <= i_1; ++j240) {
+      pfield[j240] = ztemp[j240 - 1];
+   }
+
+/* -------------------------------------------------------- */
+/* Section 9. Return to calling routine. Format statements. */
+/* -------------------------------------------------------- */
+
+L900:
+
+   free(zwork);
+   free(zline);
+   free(ztemp);
+
+   return 0;
+} /* qu2reg3 */
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+
+FILE *grprsm = NULL;
+double fref;
+double fmaxval;
+int nfref;
+int nfmaxval;
+int nrnd;
+int ndbg;
+int nvck;
+int nonoff;
+int noabort;
+int num2ok;
+int next2o;
+int nloc2o;
+int nsubce;
+int grib_calendar = -1;
+
+
+void gribSetCalendar(int calendar)
+{
+  grib_calendar = calendar;
+}
+
+
+void grsdef(void)
+{
+  /*
+C---->
+C**** GRSDEF - Initial (default) setting of common area variables
+C              for GRIBEX package.
+C
+C     Purpose.
+C     --------
+C
+C     Sets initial values for common area variables for all
+C     routines of GRIBEX package, if not already done.
+C
+C**   Interface.
+C     ----------
+C
+C     CALL GRSDEF
+C
+C     Input Parameters.
+C     -----------------
+C
+C     None.
+C
+C     Output Parameters.
+C     ------------------
+C
+C     None.
+C
+C     Method.
+C     -------
+C
+C     Self-explanatory.
+C
+C     Externals.
+C     ----------
+C
+C     None.
+C
+C     Reference.
+C     ----------
+C
+C     See subroutine GRIBEX.
+C
+C     Comments.
+C     ---------
+C
+C     None
+C
+C     Author.
+C     -------
+C
+C     J. Clochard, Meteo France, for ECMWF - March 1998.
+C
+C     Modifications.
+C     --------------
+C
+C     J. Clochard, Meteo France, for ECMWF - June 1999.
+C     Add variable NSUBCE.
+C     Use a static variable to determine if initialisation has already
+C     been done. NUSER removed .
+C     Reverse defaults for NEXT2O and NLOC2O, for consistency with
+C     version 13.023 of software .
+C
+  */
+  /*
+C     ----------------------------------------------------------------
+C*    Section 0 . Definition of variables.
+C     ----------------------------------------------------------------
+  */
+  char *envString;
+  char *env_stream;
+  static int lfirst = TRUE;
+  extern int CGRIBEX_Const;
+
+  if ( ! lfirst ) return;
+
+  /*
+    ----------------------------------------------------------------
+    Section 1 . Set values, conditionally.
+    ----------------------------------------------------------------
+  */
+  /*
+    Common area variables have not been set. Set them.
+    
+    User supplied reference value.
+  */
+  fref   = 0.0;
+  /*
+    Reference value supplied by user flag. Set to off.
+  */
+  nfref  = 0;
+  /*
+    User supplied maximum value.
+  */
+  fmaxval   = 0.0;
+  /*
+    Maximum value supplied by user flag. Set to off.
+  */
+  nfmaxval  = 0;
+  /*
+    Set rounding to 120 bytes on.
+  */
+  nrnd   = 1;
+  /*
+    Set GRIB calendar.
+  */
+  if ( grib_calendar == -1 )
+    {
+      grib_calendar = CALENDAR_PROLEPTIC;
+  
+      envString = getenv("GRIB_CALENDAR");
+      if ( envString )
+	{
+	  if      ( strncmp(envString, "standard", 8) == 0 )
+	    grib_calendar = CALENDAR_STANDARD;
+	  else if ( strncmp(envString, "proleptic", 9) == 0 )
+	    grib_calendar = CALENDAR_PROLEPTIC;
+	  else if ( strncmp(envString, "360days", 7) == 0 )
+	    grib_calendar = CALENDAR_360DAYS;
+	  else if ( strncmp(envString, "365days", 7) == 0 )
+	    grib_calendar = CALENDAR_365DAYS;
+	  else if ( strncmp(envString, "366days", 7) == 0 )
+	    grib_calendar = CALENDAR_366DAYS;
+	  else if ( strncmp(envString, "none", 4) == 0 )
+	    grib_calendar = CALENDAR_NONE;
+	}
+    }
+  /*
+    Set debug print off.
+  */
+  ndbg   = 0;
+  
+  envString = getenv("GRIBEX_DEBUG");
+  if ( envString != NULL )
+    {
+      if ( !strncmp(envString, "ON", 2) )
+        ndbg = 1;
+      else if( *envString == '1')
+        ndbg = 1;
+      else if( *envString == '2')
+        ndbg = 2;
+      else
+        ndbg = 0;
+    }
+  /*
+    Set GRIBEX compatibility mode.
+  */
+  envString = getenv("GRIB_GRIBEX_MODE_ON");
+  if ( envString != NULL )
+    {
+      if ( atoi(envString) == 1 ) CGRIBEX_Const = 0;
+    }
+
+  /*
+    Set GRIB value checking on.
+  */
+  nvck   = 1;
+  
+  envString = getenv("GRIBEX_CHECK");
+  if ( envString )
+    {
+      if ( !strncmp(envString, "OFF", 3) )
+        nvck = 0;
+      else
+        nvck = 1;
+    }
+  /*
+    See if output stream needs changing
+  */
+  grprsm = stdout;
+  env_stream = getenv("GRPRS_STREAM");
+  if ( env_stream )
+    {
+      if ( isdigit((int) env_stream[0]) )
+	{
+	  int unit;
+	  unit = atoi(env_stream);
+	  if ( unit < 1 || unit > 99 )
+	    Warning("Invalid number for GRPRS_STREAM: %d", unit);
+	  else if ( unit == 2 )
+	    grprsm = stderr;
+	  else if ( unit == 6 )
+	    grprsm = stdout;
+	  else
+	    {
+	      char filename[] = "unit.00";
+	      sprintf(filename, "%2.2d", unit);
+	      grprsm = fopen(filename, "w");
+	      if ( ! grprsm )
+		SysError("GRPRS_STREAM = %d", unit);
+	    }
+	}
+      else
+	{
+	  if ( env_stream[0] )
+	    {
+	      grprsm = fopen(env_stream, "w");
+	      if ( ! grprsm )
+		SysError("GRPRS_STREAM = %s", env_stream);
+	    }
+	}
+    }
+  /*
+    Set P factor switch to default, user supplies the P factor.
+  */
+  nonoff = 0;
+  /*
+    Set abort flag to NO abort
+  */
+  noabort = 1;
+  /*
+    Mark common area values set by user.
+  */
+  lfirst = FALSE;
+  /*
+    Exhaustive use of all possible second-order packing methods
+    for HOPER='K'. Set to off.
+  */
+  num2ok  = 0;
+  /*
+    Use of extended second-order packing methods for grid-point
+    encoding (HOPER='C' and 'K'). Set to on.
+  */
+  next2o  = 1;
+  /*
+    Use of non-local second-order packing methods for grid-point
+    encoding (HOPER='C' and 'K'). Set to on.
+  */
+  nloc2o  = 1;
+  /*
+    Use of (all valid) sub-centre values for ECMWF fields encoding .
+    encoding. Set to off.
+  */
+  nsubce  = 0;
+}
+
+/* pack 8-bit bytes from 64-bit words to a packed buffer */
+/* same as : for ( int i = 0; i < bc; ++i ) cp[i] = (unsigned char) up[i]; */
+
+long packInt64(unsigned INT64 *up, unsigned char *cp, long bc, long tc)
+{
+#if defined (CRAY)
+  (void) _pack(up, cp, bc, tc);
+#else
+  U_BYTEORDER;
+  unsigned char *cp0;
+  unsigned INT64 upi, *up0, *ip0, *ip1, *ip2, *ip3, *ip4, *ip5, *ip6, *ip7;
+  long head, trail, inner, i, j;
+  long ipack = sizeof(INT64);
+  
+  /* Bytes until first word boundary in destination buffer */
+
+  head = ( (long) cp ) & (ipack-1);
+  if ( head != 0 ) head = ipack - head;
+
+  inner = bc - head;
+
+  /* Trailing bytes which do not make a full word */
+
+  trail = inner & (ipack-1);
+
+  /* Number of bytes/words to be processed in fast loop */
+
+  inner -= trail;
+  inner /= ipack;
+
+  ip0 = up + head;
+  ip1 = ip0 + 1;
+  ip2 = ip0 + 2;
+  ip3 = ip0 + 3;
+  ip4 = ip0 + 4;
+  ip5 = ip0 + 5;
+  ip6 = ip0 + 6;
+  ip7 = ip0 + 7;
+
+  up0 = (unsigned INT64 *) (cp + head);
+
+  /* Here we should process any bytes until the first word boundary 
+   * of our destination buffer 
+   * That code is missing so far  because our output buffer is 
+   * word aligned by FORTRAN 
+   */
+
+  j = 0;
+
+  if ( IS_BIGENDIAN() )
+    {
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  upi =             (   ip0[j]          << 56 ) 
+	                 |  ( ( ip1[j] & 0xFF ) << 48 )
+	                 |  ( ( ip2[j] & 0xFF ) << 40 )
+	                 |  ( ( ip3[j] & 0xFF ) << 32 )
+	                 |  ( ( ip4[j] & 0xFF ) << 24 ) ;
+	  up0[i] = upi   |  ( ( ip5[j] & 0xFF ) << 16 )
+	                 |  ( ( ip6[j] & 0xFF ) <<  8 )
+	                 |    ( ip7[j] & 0xFF ) ;
+	  j += ipack;
+	}
+    }
+  else
+    {
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  upi =             (   ip7[j]          << 56 ) 
+	                 |  ( ( ip6[j] & 0xFF ) << 48 )
+                         |  ( ( ip5[j] & 0xFF ) << 40 )
+                         |  ( ( ip4[j] & 0xFF ) << 32 )
+                         |  ( ( ip3[j] & 0xFF ) << 24 ) ;
+	  up0[i] = upi   |  ( ( ip2[j] & 0xFF ) << 16 )
+                         |  ( ( ip1[j] & 0xFF ) <<  8 )
+                         |    ( ip0[j] & 0xFF ) ;
+	  j += ipack;
+	}
+    }
+
+  cp0 = (unsigned char *) ( up0 + inner );
+  if ( trail > 0 )
+    {
+      up0[inner] = 0;
+      for ( i = 0 ; i < trail ; i ++ )
+	{
+	  *cp0 = (unsigned char) ip0[ipack*inner+i];
+	  cp0++;
+	}
+    }
+
+  if ( tc != -1 )
+    {
+      bc++;
+      *cp0 = (unsigned char) tc;
+    }
+#endif
+  return (bc);
+}
+
+/* unpack 8-bit bytes from a packed buffer with 64-bit words */
+/* same as : for ( int i = 0; i < bc; ++i ) up[i] = (INT64) cp[i]; */
+
+long unpackInt64(unsigned char *cp, unsigned INT64 *up, long bc, long tc)
+{
+  U_BYTEORDER;
+  unsigned char *cp0;
+  unsigned INT64 *up0;
+  unsigned INT64 *ip0, *ip1, *ip2, *ip3, *ip4, *ip5, *ip6, *ip7;
+  long head, trail, inner, i, j;
+  long offset;
+  long ipack = sizeof(INT64);
+
+  /* Bytes until first word boundary in source buffer */
+
+  head = ( (long) cp ) & (ipack-1);
+  if ( head != 0 ) head = ipack - head;
+  if ( head > bc ) head = bc;
+
+  inner = bc - head;
+
+  /* Trailing bytes which do not make a full word */
+ 
+  trail = inner & (ipack-1);
+ 
+  /* Number of bytes/words to be processed in fast loop */
+
+  inner -= trail;
+  inner /= ipack;
+
+  ip0 = up + head;
+  ip1 = ip0 + 1;
+  ip2 = ip0 + 2;
+  ip3 = ip0 + 3;
+  ip4 = ip0 + 4;
+  ip5 = ip0 + 5;
+  ip6 = ip0 + 6;
+  ip7 = ip0 + 7;
+
+  up0 = (unsigned INT64 *) (cp + head);
+
+  /* Process any bytes until the first word boundary 
+   * of our source buffer 
+   */
+  for ( i = 0 ; i < head ; i++ ) up[i] = (unsigned INT64) cp[i];
+
+  j = 0;
+
+  if ( IS_BIGENDIAN() )
+    {
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  ip0[j] = (up0[i] >> 56) & 0xFF;
+	  ip1[j] = (up0[i] >> 48) & 0xFF;
+	  ip2[j] = (up0[i] >> 40) & 0xFF;
+	  ip3[j] = (up0[i] >> 32) & 0xFF;
+	  ip4[j] = (up0[i] >> 24) & 0xFF;
+	  ip5[j] = (up0[i] >> 16) & 0xFF;
+	  ip6[j] = (up0[i] >>  8) & 0xFF;
+	  ip7[j] = (up0[i])       & 0xFF;
+
+	  j += ipack;
+	}
+    }
+  else
+    {
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  ip7[j] = (up0[i] >> 56) & 0xFF;
+	  ip6[j] = (up0[i] >> 48) & 0xFF;
+	  ip5[j] = (up0[i] >> 40) & 0xFF;
+	  ip4[j] = (up0[i] >> 32) & 0xFF;
+	  ip3[j] = (up0[i] >> 24) & 0xFF;
+	  ip2[j] = (up0[i] >> 16) & 0xFF;
+	  ip1[j] = (up0[i] >>  8) & 0xFF;
+	  ip0[j] = (up0[i])       & 0xFF;
+
+	  j += ipack;
+	}
+    }
+
+  if ( trail > 0 )
+    {
+      offset = head + ipack*inner;
+      cp0 = cp + offset;
+      for ( i = 0 ; i < trail ; i++ ) up[i+offset] = (unsigned INT64) cp0[i];
+    }
+  /*
+  if ( tc != -1 ) {
+    bc++;
+    *cp0 = (unsigned char) tc;
+  }
+  */
+  return (bc);
+}
+
+/* pack 8-bit bytes from 32-bit words to a packed buffer */
+/* same as : for ( int i = 0; i < bc; ++i ) cp[i] = (char) up[i]; */
+
+#if  defined  (INT32)
+long packInt32(unsigned INT32 *up, unsigned char *cp, long bc, long tc)
+{
+  U_BYTEORDER;
+  unsigned char *cp0;
+  unsigned INT32 *up0, *ip0, *ip1, *ip2, *ip3;
+  long head, trail, inner, i, j;
+  long ipack = sizeof(INT32);
+  
+  /* Bytes until first word boundary in destination buffer */
+
+  head = ( (long) cp ) & (ipack-1);
+  if ( head != 0 ) head = ipack - head;
+
+  inner = bc - head;
+
+  /* Trailing bytes which do not make a full word */
+
+  trail = inner & (ipack-1);
+
+  /* Number of bytes/words to be processed in fast loop */
+
+  inner -= trail;
+  inner /= ipack;
+
+  ip0 = up + head;
+  ip1 = ip0 + 1;
+  ip2 = ip0 + 2;
+  ip3 = ip0 + 3;
+
+  up0 = (unsigned INT32 *) (cp + head);
+
+  /* Here we should process any bytes until the first word boundary 
+   * of our destination buffer 
+   * That code is missing so far  because our output buffer is 
+   * word aligned by FORTRAN 
+   */
+
+  j = 0;
+
+  if ( IS_BIGENDIAN() )
+    {
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  up0[i] =          (   ip0[j]          << 24 ) 
+	                 |  ( ( ip1[j] & 0xFF ) << 16 )
+	                 |  ( ( ip2[j] & 0xFF ) <<  8 )
+	                 |    ( ip3[j] & 0xFF ) ;
+	  j += ipack;
+	}
+    }
+  else
+    {
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  up0[i] =          (   ip3[j]          << 24 ) 
+	                 |  ( ( ip2[j] & 0xFF ) << 16 )
+                         |  ( ( ip1[j] & 0xFF ) <<  8 )
+                         |    ( ip0[j] & 0xFF ) ;
+	  j += ipack;
+	}
+    }
+
+  cp0 = (unsigned char *) ( up0 + inner );
+  if ( trail > 0 )
+    {
+      up0[inner] = 0;
+      for ( i = 0 ; i < trail ; i ++ )
+	{
+	  *cp0 = (unsigned char) ip0[ipack*inner+i];
+	  cp0++;
+	}
+    }
+
+  if ( tc != -1 )
+    {
+      bc++;
+      *cp0 = (unsigned char) tc;
+    }
+
+  return (bc);
+}
+#endif
+
+/* unpack 8-bit bytes from a packed buffer with 32-bit words */
+/* same as : for ( int i = 0; i < bc; ++i ) up[i] = (INT32) cp[i]; */
+
+#if  defined  (INT32)
+long unpackInt32(unsigned char *cp, unsigned INT32 *up, long bc, long tc)
+{
+  U_BYTEORDER;
+  unsigned char *cp0;
+  unsigned INT32 *up0;
+  unsigned INT32 *ip0, *ip1, *ip2, *ip3;
+  long head, trail, inner, i, j;
+  long offset;
+  long ipack = sizeof(INT32);
+
+  /* Bytes until first word boundary in source buffer */
+
+  head = ( (long) cp ) & (ipack-1);
+  if ( head != 0 ) head = ipack - head;
+  if ( head > bc ) head = bc;
+
+  inner = bc - head;
+
+  /* Trailing bytes which do not make a full word */
+ 
+  trail = inner & (ipack-1);
+ 
+  /* Number of bytes/words to be processed in fast loop */
+
+  inner -= trail;
+  inner /= ipack;
+
+  ip0 = up + head;
+  ip1 = ip0 + 1;
+  ip2 = ip0 + 2;
+  ip3 = ip0 + 3;
+
+  up0 = (unsigned INT32 *) (cp + head);
+
+  /* Process any bytes until the first word boundary 
+   * of our source buffer 
+   */
+  for ( i = 0 ; i < head ; i++ ) up[i] = (unsigned INT32) cp[i];
+
+  j = 0;
+
+  if ( IS_BIGENDIAN() )
+    {
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  ip0[j] = (up0[i] >> 24) & 0xFF;
+	  ip1[j] = (up0[i] >> 16) & 0xFF;
+	  ip2[j] = (up0[i] >>  8) & 0xFF;
+	  ip3[j] = (up0[i])       & 0xFF;
+
+	  j += ipack;
+	}
+    }
+  else
+    {
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  ip3[j] = (up0[i] >> 24) & 0xFF;
+	  ip2[j] = (up0[i] >> 16) & 0xFF;
+	  ip1[j] = (up0[i] >>  8) & 0xFF;
+	  ip0[j] = (up0[i])       & 0xFF;
+
+	  j += ipack;
+	}
+    }
+
+  if ( trail > 0 )
+    {
+      offset = head + ipack*inner;
+      cp0 = cp + offset;
+      for ( i = 0 ; i < trail ; i++ ) up[i+offset] = (unsigned INT32) cp0[i];
+    }
+  /*
+  if ( tc != -1 ) {
+    bc++;
+    *cp0 = (unsigned char) tc;
+  }
+  */
+
+  return (bc);
+}
+#endif
+#include <stdio.h>
+
+void prtbin(int kin, int knbit, int *kout, int *kerr)
+{
+  /*
+
+    Produces a decimal number with ones and zeroes
+    corresponding to the ones and zeroes of the input
+    binary number.
+    eg input number 1011 binary, output number 1011 decimal.
+
+
+    Input Parameters:
+    
+       kin   - Integer variable containing binary number.
+
+       knbit - Number of bits in binary number.
+
+    Output Parameters:
+
+       kout  - Integer variable containing decimal value
+               with ones and zeroes corresponding to those of
+	       the input binary number.
+
+       kerr  - 0, If no error.
+               1, Number of bits in binary number exceeds
+	          maximum allowed or is less than 1.
+
+
+    Converted from EMOS routine PRTBIN.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+  int idec;
+  int ik;
+  int itemp;
+  int j;
+
+  /*
+    Check length of binary number to ensure decimal number
+    generated will fit in the computer word - in this case will
+    it fit in a Cray 48 bit integer?
+  */
+  if ( knbit < 1 || knbit > 14 )
+    {
+      *kerr = 1;
+      printf(" prtbin : Error in binary number length - %3d bits.\n", knbit);
+      return;
+    }
+  else
+    *kerr = 0;
+  /*
+    -----------------------------------------------------------------
+    Section 1. Generate required number.
+    -----------------------------------------------------------------
+  */
+  *kout = 0;
+  ik    = kin;
+  idec  = 1;
+
+  for ( j = 0; j < knbit; j++ )
+    {
+      itemp = ik - ( (ik/2)*2 );
+      *kout = (*kout) + itemp * idec;
+      ik    = ik / 2;
+      idec  = idec * 10;
+    }
+
+  return;
+}
+
+
+void ref2ibm(double *pref, int kbits)
+{
+  /*
+
+    Purpose:
+    --------
+
+    Code and check reference value in IBM format
+
+    Input Parameters:
+    -----------------
+
+    pref       - Reference value
+    kbits      - Number of bits per computer word.
+
+    Output Parameters:
+    ------------------
+
+    pref       - Reference value
+
+    Method:
+    -------
+
+    Codes in IBM format, then decides to ensure that reference 
+    value used for packing is not different from that stored
+    because of packing differences.
+
+    Externals.
+    ----------
+
+    confp3    - Encode into IBM floating point format.
+    decfp2    - Decode from IBM floating point format.
+
+    Reference:
+    ----------
+
+    None.
+
+    Comments:
+    --------
+
+    None.
+
+    Author:
+    -------
+
+    J.D.Chambers     ECMWF      17:05:94
+
+    Modifications:
+    --------------
+
+    Uwe Schulzweida   MPIfM   01/04/2001
+
+    Convert to C from EMOS library version 130
+
+  */
+
+  static int itrnd;
+  static int kexp, kmant;
+  static double ztemp, zdumm;
+  extern int CGRIBEX_Debug;
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 1. Convert to and from IBM format.                      */
+  /* ----------------------------------------------------------------- */
+
+  /*  Convert floating point reference value to IBM representation. */
+
+  itrnd = 1;
+  zdumm = ztemp = *pref;
+  confp3(zdumm, &kexp, &kmant, kbits, itrnd);
+
+  if ( kexp == 0 && kmant == 0 ) return;
+
+  /*  Set reference value to that actually stored in the GRIB code. */
+
+  *pref = decfp2(kexp, kmant);
+
+  /*  If the nearest number which can be represented in */
+  /*  GRIB format is greater than the reference value,  */
+  /*  find the nearest number in GRIB format lower      */
+  /*  than the reference value.                         */
+
+  if ( ztemp < *pref )
+    {
+      /*  Convert floating point to GRIB representation */
+      /*  using truncation to ensure that the converted */
+      /*  number is smaller than the original one.      */
+
+      itrnd = 0;
+      zdumm = *pref = ztemp;
+      confp3(zdumm, &kexp, &kmant, kbits, itrnd);
+
+      /*  Set reference value to that stored in the GRIB code. */
+
+      *pref = decfp2(kexp, kmant);
+
+      if ( ztemp < *pref )
+	{
+	  if ( CGRIBEX_Debug )
+	    {
+	      Message("Reference value error.");
+	      Message("Notify Met.Applications Section.");
+	      Message("ZTEMP = ", ztemp);
+	      Message("PREF = ", pref);
+	    }
+	  *pref = ztemp;
+	}
+    }
+
+  return;
+} /* ref2ibm */
+#include <string.h>
+
+
+int correct_bdslen(int bdslen, long recsize, long gribpos)
+{
+  /*
+    If a very large product, the section 4 length field holds
+    the number of bytes in the product after section 4 upto
+    the end of the padding bytes.
+    This is a fixup to get round the restriction on product lengths
+    due to the count being only 24 bits. It is only possible because
+    the (default) rounding for GRIB products is 120 bytes.
+  */
+  if ( recsize > JP23SET ) bdslen = recsize - gribpos - bdslen;
+  return (bdslen);
+}
+
+
+int grib1Sections(unsigned char *gribbuffer, long bufsize, unsigned char **pdsp,
+		  unsigned char **gdsp, unsigned char **bmsp, unsigned char **bdsp)
+{
+  unsigned char *pds, *gds, *bms, *bds;
+  unsigned char *bufpointer, *is, *section;
+  int gribversion, grib1offset;
+  long gribsize = 0, recsize;
+  int bdslen;
+
+  section = gribbuffer;
+  is = gribbuffer;
+  if ( ! GRIB_START(section) )
+    {
+      fprintf(stderr, "Wrong indicator section >%c%c%c%c<\n",
+	      section[0], section[1], section[2], section[3]);
+      return (-1);
+    }
+
+  recsize = gribrec_len(section[4], section[5], section[6]);
+
+  gribversion = GRIB_EDITION(section);
+  if ( GRIB1_SECLEN(section) == 24 && gribversion == 0 ) gribversion = 0;
+
+  if ( gribversion == 1 )
+    grib1offset = 4;
+  else
+    grib1offset = 0;
+
+  pds = is + 4 + grib1offset;
+  bufpointer = pds + PDS_Len;
+  gribsize += 4 + grib1offset + PDS_Len;
+
+  if ( PDS_HAS_GDS )
+    {
+      gds = bufpointer;
+      bufpointer += GDS_Len;
+      gribsize += GDS_Len;
+    }
+  else
+    {
+      gds = NULL;
+    }
+
+  if ( PDS_HAS_BMS )
+    {
+      bms = bufpointer;
+      bufpointer += BMS_Len;
+      gribsize += BMS_Len;
+    }
+  else
+    {
+      bms = NULL;
+    }
+
+  bds = bufpointer;
+  bdslen = BDS_Len;
+  bdslen = correct_bdslen(bdslen, recsize, gribsize);
+  bufpointer += bdslen;
+  gribsize += bdslen;
+  gribsize += 4;
+
+  if ( gribsize > bufsize )
+    {
+      fprintf(stderr, "GRIB buffer size %ld too small! Min size = %ld\n", bufsize, gribsize);
+      return (1);
+    }
+
+  *pdsp = pds;
+  *gdsp = gds;
+  *bmsp = bms;
+  *bdsp = bds;
+
+  /* end section - "7777" in ascii */
+  if ( !GRIB_FIN(bufpointer) )
+    {
+      fprintf(stderr, "Missing end section >%2x %2x %2x %2x<\n",
+	      bufpointer[0], bufpointer[1], bufpointer[2], bufpointer[3]);
+    }
+
+  return (0);
+}
+
+
+int grib2Sections(unsigned char *gribbuffer, long bufsize, unsigned char **idsp,
+		  unsigned char **lusp, unsigned char **gdsp, unsigned char **pdsp,
+		  unsigned char **drsp, unsigned char **bmsp, unsigned char **bdsp)
+{
+  unsigned char *section;
+  long sec_len;
+  int sec_num;
+  int gribversion;
+  int i, msec;
+  long gribsize;
+  long grib_len = 0;
+
+  *idsp = NULL;
+  *lusp = NULL;
+  *gdsp = NULL;
+  *pdsp = NULL;
+  *drsp = NULL;
+  *bmsp = NULL;
+  *bdsp = NULL;
+
+  section = gribbuffer;
+  sec_len = 16;
+
+  if ( !GRIB_START(section) )
+    {
+      fprintf(stderr, "wrong indicator section >%c%c%c%c<\n",
+	      section[0], section[1], section[2], section[3]);
+      return (-1);
+    }
+
+  gribversion = GRIB_EDITION(section);
+  if ( gribversion != 2 )
+    {
+      fprintf(stderr, "wrong GRIB version %d\n", gribversion);
+      return (-1);      
+    }
+
+  gribsize = 0;
+  for ( i = 0; i < 8; i++ ) gribsize = (gribsize << 8) | section[8+i];
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 1 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "ids %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num != 1 )
+    {
+      fprintf(stderr, "Unexpected section1 number %d\n", sec_num);
+      return (-1);
+    }
+
+  *idsp = section;
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 2 and 3 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "lus %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num == 2 )
+    {
+      *lusp = section;
+
+      grib_len += sec_len;
+      section  += sec_len;
+
+      /* section 3 */
+      sec_len = GRIB2_SECLEN(section);
+      sec_num = GRIB2_SECNUM(section);
+      //fprintf(stderr, "gds %d %ld\n", sec_num, sec_len);
+
+      *gdsp = section;
+    }
+  else if ( sec_num == 3 )
+    {
+      *gdsp = section;
+    }
+  else
+    {
+      fprintf(stderr, "Unexpected section3 number %d\n", sec_num);
+      return (-1);
+    }
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 4 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "pds %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num != 4 )
+    {
+      fprintf(stderr, "Unexpected section4 number %d\n", sec_num);
+      return (-1);
+    }
+
+  *pdsp = section;
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 5 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "drs %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num != 5 )
+    {
+      fprintf(stderr, "Unexpected section5 number %d\n", sec_num);
+      return (-1);
+    }
+
+  *drsp = section;
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 6 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "bms %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num != 6 )
+    {
+      fprintf(stderr, "Unexpected section6 number %d\n", sec_num);
+      return (-1);
+    }
+
+  *bmsp = section;
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 7 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "bds %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num != 7 )
+    {
+      fprintf(stderr, "Unexpected section7 number %d\n", sec_num);
+      return (-1);
+    }
+
+  *bdsp = section;
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* skip multi GRIB sections */
+  msec = 1;
+  while ( !GRIB_FIN(section) )
+    {
+      sec_len = GRIB2_SECLEN(section);
+      sec_num = GRIB2_SECNUM(section);
+
+      if ( sec_num < 1 || sec_num > 7 ) break;
+
+      if ( sec_num == 7 )
+	fprintf(stderr, "Skipped unsupported multi GRIB section %d!\n", ++msec);
+
+      if ( (grib_len + sec_len) > gribsize ) break;
+
+      grib_len += sec_len;
+      section  += sec_len;
+    }
+
+  /* end section - "7777" in ASCII */
+  if ( !GRIB_FIN(section) )
+    {
+      fprintf(stderr, "Missing end section >%2x %2x %2x %2x<\n",
+	      section[0], section[1], section[2], section[3]);
+    }
+
+  return (0);
+}
+
+
+int gribGinfo(long recpos, long recsize, unsigned char *gribbuffer,
+	      int *intnum, float *fltnum)
+{
+  unsigned char *pds, *gds, *bms, *bds;
+  unsigned char *bufpointer, *is, *section;
+  int gribversion, grib1offset;
+  long gribsize = 0;
+  int dpos, bpos = 0;
+  int bdslen;
+  float bsf;
+
+  section = gribbuffer;
+  is = gribbuffer;
+  if ( ! GRIB_START(section) )
+    {
+      fprintf(stderr, "wrong indicator section >%c%c%c%c<\n",
+	      section[0], section[1], section[2], section[3]);
+      return (-1);
+    }
+
+  gribversion = GRIB_EDITION(section);
+  if ( GRIB1_SECLEN(section) == 24 && gribversion == 0 ) gribversion = 0;
+
+  if ( gribversion == 1 )
+    grib1offset = 4;
+  else
+    grib1offset = 0;
+
+  pds = is + 4 + grib1offset;
+  bufpointer = pds + PDS_Len;
+  gribsize += 4 + grib1offset + PDS_Len;
+
+  if ( PDS_HAS_GDS )
+    {
+      gds = bufpointer;
+      bufpointer += GDS_Len;
+      gribsize += GDS_Len;
+    }
+  else
+    {
+      gds = NULL;
+    }
+
+  if ( PDS_HAS_BMS )
+    {
+      bms = bufpointer;
+      bufpointer += BMS_Len;
+
+      bpos = recpos + gribsize + 6;
+
+      gribsize += BMS_Len;
+    }
+  else
+    {
+      bms = NULL;
+    }
+
+  bds = bufpointer;
+
+  dpos = recpos + gribsize + 11;
+
+  bdslen = BDS_Len;
+  bdslen = correct_bdslen(bdslen, recsize, bds-gribbuffer);
+  bufpointer += bdslen;
+  gribsize += bdslen;
+  gribsize += 4;
+
+  if ( gribsize > recsize )
+    {
+      fprintf(stderr, "GRIB buffer size %ld too small! Min size = %ld\n", recsize, gribsize);
+      return (1);
+    }
+
+  /* end section - "7777" in ascii */
+  if ( !GRIB_FIN(bufpointer) )
+    {
+      fprintf(stderr, "Missing end section >%2x %2x %2x %2x<\n",
+	      bufpointer[0], bufpointer[1], bufpointer[2], bufpointer[3]);
+    }
+
+  bsf = BDS_BinScale;
+  if ( bsf > 32767 ) bsf = 32768-bsf;
+  bsf = pow(2.0,(double)bsf);
+
+  intnum[0] = dpos;
+  if ( bms ) intnum[1] = bpos;
+  else       intnum[1] = -999;
+  intnum[2] = BDS_NumBits;
+
+  /*  fltnum[0] = 1.0; */
+  fltnum[0] = pow(10.0, (double)PDS_DecimalScale);
+  fltnum[1] = bsf;
+  fltnum[2] = BDS_RefValue;
+  /*
+  printf("intnum %d %d %d\n", intnum[0], intnum[1], intnum[2]);
+  printf("fltnum %g %g %g\n", fltnum[0], fltnum[1], fltnum[2]);
+  */
+  return (0);
+}
+
+
+void grib1PrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  int GridType, level, nerr;
+  unsigned char *is = NULL, *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  double cr = 1;
+  int bdslen;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : Off Position   Size : V PDS  GDS    BMS    BDS : Code Level :  LType GType: CR\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  is = gribbuffer;
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d :%4ld %8ld %6ld : error\n", nrec, offset, recpos, recsize);
+      return;
+    }
+
+  if ( gds == NULL )
+    GridType = -1;
+  else
+    GridType = GDS_GridType;
+
+  if ( PDS_LevelType == 100 )
+    level = PDS_Level * 100;
+  else if ( PDS_LevelType == 99 )
+    level = PDS_Level;
+  else if ( PDS_LevelType == 109 )
+    level = PDS_Level;
+  else
+    level = PDS_Level1;
+
+  bdslen = BDS_Len;
+  bdslen = correct_bdslen(bdslen, recsize, bds-gribbuffer);
+
+  if ( (BDS_Flag >> 4)&1 && BDS_Z == 128 )
+    {
+      int s1, s2;
+      s1 = gribrec_len(bds[14], bds[15], bds[16]);
+      s2 = gribrec_len(gribbuffer[4], gribbuffer[5], gribbuffer[6]);
+      cr = ((double)s1)/s2;
+    }
+
+  fprintf(stdout, "%5d :%4ld %8ld %6ld :%2d%4d%5d%7d%7d : %3d%7d : %5d %5d %6.4g\n",
+	  nrec, offset, recpos, recsize, GRIB_EDITION(is),
+	  PDS_Len, GDS_Len, BMS_Len, bdslen,
+	  PDS_Parameter, level, PDS_LevelType, GridType, cr);
+}
+
+
+void grib2PrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  int nerr;
+  unsigned char *is  = NULL, *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  unsigned char *ids = NULL, *lus = NULL, *drs = NULL;
+  long ids_len = 0, lus_len = 0, gds_len = 0, pds_len = 0, drs_len = 0, bms_len = 0, bds_len = 0;
+  int gridtype, paramnum, level1type /*, level2type*/;
+  int level1 /*, level1sf*/;
+  /* int level2, level2sf; */
+  double cr = 1;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : Off Position   Size : V IDS LUS GDS PDS  DRS    BMS    BDS : Code Level :  LType GType: CR\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  is = gribbuffer;
+
+  nerr = grib2Sections(gribbuffer, recsize, &ids, &lus, &gds, &pds, &drs, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d :%4ld %8ld %6ld : error\n", nrec, offset, recpos, recsize);
+      return;
+    }
+
+  if ( ids ) ids_len = GRIB2_SECLEN(ids);
+  if ( lus ) lus_len = GRIB2_SECLEN(lus);
+  if ( gds ) gds_len = GRIB2_SECLEN(gds);
+  if ( pds ) pds_len = GRIB2_SECLEN(pds);
+  if ( drs ) drs_len = GRIB2_SECLEN(drs);
+  if ( bms ) bms_len = GRIB2_SECLEN(bms);
+  if ( bds ) bds_len = GRIB2_SECLEN(bds);
+
+  /*
+  if ( (BDS_Flag >> 4)&1 && BDS_Z == 128 )
+    {
+      int s1, s2;
+      s1 = ((int) ((bds[14]<<16)+(bds[15]<<8)+bds[16]));
+      s2 = ((int) ((gribbuffer[4]<<16)+(gribbuffer[5]<<8)+gribbuffer[6]));
+      cr = ((double)s1)/s2;
+    }
+  */
+  gridtype   = GET_UINT2(gds[12],gds[13]);
+  paramnum   = GET_UINT1(pds[10]);
+  level1type = GET_UINT1(pds[22]);
+  /* level1sf   = GET_UINT1(pds[23]); */
+  level1     = GET_UINT4(pds[24],pds[25],pds[26],pds[27]);
+  /* level2type = GET_UINT1(pds[28]); */
+  /* level2sf   = GET_UINT1(pds[29]); */
+  /* level2     = GET_UINT4(pds[30],pds[31],pds[32],pds[33]); */
+  /*
+  printf("level %d %d %d %d %d %d %d\n", level1type, level1sf, level1, level1*level1sf, level2sf, level2, level2*level2sf);
+  */
+  fprintf(stdout, "%5d :%4ld %8ld %6ld :%2d %3ld %3ld %3ld %3ld %4ld %6ld %6ld : %3d%7d : %5d %5d %6.4g\n",
+	  nrec, offset, recpos, recsize, GRIB_EDITION(is),
+	  ids_len, lus_len, gds_len, pds_len, drs_len, bms_len, bds_len,
+	  paramnum, level1, level1type, gridtype, cr);
+}
+
+
+void gribPrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 0 || gribversion == 1 )
+    grib1PrintALL(nrec, offset, recpos, recsize, gribbuffer);
+  else if ( gribversion == 2 )
+    grib2PrintALL(nrec, offset, recpos, recsize, gribbuffer);
+  else
+    {
+      fprintf(stdout, "%5d :%4ld%9ld%7ld : GRIB version %d unsupported\n",
+	      nrec, offset, recpos, recsize, gribversion); 
+    }
+}
+
+
+void grib1PrintPDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  unsigned char *is = NULL, *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  int century, subcenter, decimalscale, nerr;
+  int fc_num = 0;
+  int year = 0, date;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : PDS Tab Cen Sub Ver Grid Code LTyp Level1 Level2    Date  Time P1 P2 TU TR NAVE Scale FCnum CT\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  is = gribbuffer;
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  switch(GRIB_EDITION(is))
+    {   
+    case 0:
+      year                = GET_UINT1(pds[12]);
+      century             = 1;
+      subcenter           = 0;
+      decimalscale        = 0;
+      break;
+    case 1:
+      year                = PDS_Year;
+      century             = PDS_Century;
+      subcenter           = PDS_Subcenter;
+      decimalscale        = PDS_DecimalScale;
+      break;
+    default:
+      fprintf(stderr, "Grib version %d not supported!", GRIB_EDITION(is));
+      exit(EXIT_FAILURE);
+    }
+
+  if ( PDS_Len > 28 )
+    if ( PDS_CenterID    == 98 || PDS_Subcenter == 98 ||
+	(PDS_CenterID    ==  7 && PDS_Subcenter == 98) )
+      if ( pds[40] == 1 )
+	fc_num = GET_UINT1(pds[49]);
+
+  if ( year < 0 )
+    {
+      date = (-year)*10000+PDS_Month*100+PDS_Day;
+      century = -century;
+    }
+  else
+    {
+      date =    year*10000+PDS_Month*100+PDS_Day;
+    }
+      
+  fprintf(stdout, "%5d :%4d%4d%4d%4d%4d %4d %4d%4d%7d%7d %8d%6d%3d%3d%3d%3d%5d%6d%5d%4d\n", nrec,
+	  PDS_Len,  PDS_CodeTable,   PDS_CenterID, subcenter, PDS_ModelID,
+	  PDS_GridDefinition, PDS_Parameter, PDS_LevelType, PDS_Level1, PDS_Level2,
+	  date, PDS_Time, PDS_TimePeriod1, PDS_TimePeriod2, PDS_TimeUnit, PDS_TimeRange,
+	  PDS_AvgNum, decimalscale, fc_num, century);
+}
+
+
+void gribPrintPDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 0 || gribversion == 1 )
+    grib1PrintPDS(nrec, recpos, recsize, gribbuffer);
+  /*
+  else if ( gribversion == 2 )
+    grib2PrintPDS(nrec, recpos, recsize, gribbuffer);
+  */
+  else
+    {
+      fprintf(stdout, "%5d :%4ld%9ld%7ld : GRIB version %d unsupported\n",
+	      nrec, 0L, recpos, recsize, gribversion); 
+    }
+}
+
+
+void grib1PrintGDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  int nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : GDS  NV PVPL Typ : xsize ysize   Lat1   Lon1   Lat2   Lon2    dx    dy\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  if ( gds )
+    fprintf(stdout, "%5d :%4d%4d%4d %4d :%6d%6d%7d%7d%7d%7d%6d%6d\n", nrec,
+	    GDS_Len,  GDS_NV,   GDS_PVPL, GDS_GridType,
+	    GDS_NumLon,   GDS_NumLat,
+	    GDS_FirstLat, GDS_FirstLon,
+	    GDS_LastLat,  GDS_LastLon,
+	    GDS_LonIncr,  GDS_LatIncr);
+  else
+    fprintf(stdout, "%5d : Grid Description Section not defined\n", nrec);
+}
+
+
+void gribPrintGDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 0 || gribversion == 1 )
+    grib1PrintGDS(nrec, recpos, recsize, gribbuffer);
+  /*
+  else if ( gribversion == 2 )
+    grib2PrintGDS(nrec, recpos, recsize, gribbuffer);
+  */
+  else
+    {
+      fprintf(stdout, "%5d :%4ld%9ld%7ld : GRIB version %d unsupported\n",
+	      nrec, 0L, recpos, recsize, gribversion); 
+    }
+}
+
+
+void grib1PrintBMS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  int level, nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : Code Level     BMS    Size\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  if ( PDS_LevelType == 100 )
+    level = PDS_Level * 100;
+  else if ( PDS_LevelType == 99 )
+    level = PDS_Level;
+  else
+    level = PDS_Level1;
+
+  if ( bms )
+    fprintf(stdout, "%5d :%4d%7d %7d %7d\n", nrec,
+	    PDS_Parameter, level,
+	    BMS_Len, BMS_BitmapSize);
+  else
+    fprintf(stdout, "%5d :%4d%7d Bit Map Section not defined\n", nrec,
+	    PDS_Parameter, level);
+}
+
+
+void gribPrintBMS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 0 || gribversion == 1 )
+    grib1PrintBMS(nrec, recpos, recsize, gribbuffer);
+  /*
+  else if ( gribversion == 2 )
+    grib2PrintBMS(nrec, recpos, recsize, gribbuffer);
+  */
+  else
+    {
+      fprintf(stdout, "%5d :%4ld%9ld%7ld : GRIB version %d unsupported\n",
+	      nrec, 0L, recpos, recsize, gribversion); 
+    }
+}
+
+
+void grib1PrintBDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  int level, nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  double cr = 1;
+  double refval, scale;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : Code Level     BDS Flag     Scale   RefValue Bits  CR\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  if ( PDS_LevelType == 100 )
+    level = PDS_Level * 100;
+  else if ( PDS_LevelType == 99 )
+    level = PDS_Level;
+  else
+    level = PDS_Level1;
+
+  if ( (BDS_Flag >> 4)&1 && BDS_Z == 128 )
+    {
+      int s1, s2;
+      s1 = ((int) ((bds[17]<<16)+(bds[18]<<8)+bds[19]));
+      s2 = ((int) ((bds[20]<<16)+(bds[21]<<8)+bds[22]));
+      cr = ((double)s1)/s2;
+    }
+
+  refval = BDS_RefValue;
+
+  if ( BDS_BinScale < 0 )
+    scale = 1.0/pow(2.0, (double) -BDS_BinScale);
+  else
+    scale = pow(2.0, (double) BDS_BinScale);
+
+  if ( PDS_DecimalScale )
+    {
+      double decscale;
+      decscale = pow(10.0, (double)-PDS_DecimalScale);
+      refval *= decscale;
+      scale  *= decscale;
+    }
+
+  fprintf(stdout, "%5d :%4d%7d %7d %4d %8.5g %11.5g%4d %6.4g\n", nrec,
+	  PDS_Parameter, level,
+	  BDS_Len, BDS_Flag, scale, refval, BDS_NumBits, cr);
+}
+
+
+void gribPrintBDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 0 || gribversion == 1 )
+    grib1PrintBDS(nrec, recpos, recsize, gribbuffer);
+  /*
+  else if ( gribversion == 2 )
+    grib2PrintBDS(nrec, recpos, recsize, gribbuffer);
+  */
+  else
+    {
+      fprintf(stdout, "%5d :%4ld%9ld%7ld : GRIB version %d unsupported\n",
+	      nrec, 0L, recpos, recsize, gribversion); 
+    }
+}
+
+
+void gribCheck1(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int level, nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  double cr = 1;
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  if ( PDS_LevelType == 100 )
+    level = PDS_Level * 100;
+  else if ( PDS_LevelType == 99 )
+    level = PDS_Level;
+  else
+    level = PDS_Level1;
+
+  if ( (BDS_Flag >> 4)&1 && BDS_Z == 128 )
+    {
+      int s1, s2;
+      s1 = ((int) ((bds[17]<<16)+(bds[18]<<8)+bds[19]));
+      s2 = ((int) ((bds[20]<<16)+(bds[21]<<8)+bds[22]));
+      cr = ((double)s1)/s2;
+    }
+
+  if ( cr == 1 && BDS_NumBits == 24 )
+    {
+      fprintf(stdout, "GRIB record %5d : code = %4d   level = %7d\n", nrec, PDS_Parameter, level);
+    }
+}
+
+
+static
+void repair1(unsigned char *gbuf, long gbufsize)
+{
+  long i;
+  int nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  /* int recLen; */
+  unsigned char *source;
+  size_t sourceLen;
+  int bds_len, bds_nbits, bds_flag, lspherc, lcomplex /*, lcompress */;
+  int bds_head = 11;
+  int bds_ext = 0, bds_ubits;
+  int datstart = 0;
+  /* int llarge = FALSE; */
+
+  nerr = grib1Sections(gbuf, gbufsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "grib1Sections error\n");
+    }
+
+  /* recLen = gribrec_len(gbuf[4], gbuf[5], gbuf[6]); */
+  /* if ( recLen > JP23SET ) llarge = TRUE; */
+
+  bds_len   = BDS_Len;
+  bds_nbits = BDS_NumBits;
+  bds_flag  = BDS_Flag;
+  bds_ubits = bds_flag & 15;
+  lspherc   =  bds_flag >> 7;
+  lcomplex  = (bds_flag >> 6)&1;
+  /* lcompress = (bds_flag >> 4)&1; */
+
+  if ( lspherc )
+    {
+      if ( lcomplex  )
+	{
+	  int jup, ioff;
+	  jup  = bds[15];
+	  ioff = (jup+1)*(jup+2);
+	  bds_ext = 4 + 3 + 4*ioff;
+	}
+      else
+	{
+	  bds_ext = 4;
+	}
+    }
+
+  datstart = bds_head + bds_ext;
+
+  source = bds + datstart;
+
+  sourceLen = ((((bds_len - datstart)*8-bds_ubits)/bds_nbits)*bds_nbits)/8;
+
+  if ( bds_nbits == 24 )
+    {
+      long nelem;
+      unsigned char *pbuf;
+      nelem = sourceLen/3;
+      pbuf = (unsigned char *) malloc(sourceLen);
+      for ( i = 0; i < nelem; i++ )
+	{
+	  pbuf[3*i  ] = source[        i];
+	  pbuf[3*i+1] = source[  nelem+i];
+	  pbuf[3*i+2] = source[2*nelem+i];
+	}
+      memcpy(source, pbuf, sourceLen);
+      free(pbuf);
+    }
+}
+
+
+void gribRepair1(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int level, nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  double cr = 1;
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  if ( PDS_LevelType == 100 )
+    level = PDS_Level * 100;
+  else if ( PDS_LevelType == 99 )
+    level = PDS_Level;
+  else
+    level = PDS_Level1;
+
+  if ( (BDS_Flag >> 4)&1 && BDS_Z == 128 )
+    {
+      int s1, s2;
+      s1 = ((int) ((bds[17]<<16)+(bds[18]<<8)+bds[19]));
+      s2 = ((int) ((bds[20]<<16)+(bds[21]<<8)+bds[22]));
+      cr = ((double)s1)/s2;
+    }
+
+  if ( cr == 1 && BDS_NumBits == 24 )
+    {
+      fprintf(stdout, "Repair GRIB record %5d : code = %4d   level = %7d\n", nrec, PDS_Parameter, level);
+      repair1(gribbuffer, recsize);
+    }
+}
+#include <stdio.h>
+#include <string.h>
+
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#if  defined  (HAVE_LIBSZ)
+#if defined(__cplusplus)
+extern "C" {
+#endif
+#  include <szlib.h>
+#if defined (__cplusplus)
+}
+#endif
+
+#  define OPTIONS_MASK        (SZ_RAW_OPTION_MASK | SZ_MSB_OPTION_MASK | SZ_NN_OPTION_MASK)
+#  define PIXELS_PER_BLOCK    (8)
+#  define PIXELS_PER_SCANLINE (PIXELS_PER_BLOCK*128)
+
+#  define MIN_COMPRESS        (0.95)
+#  define MIN_SIZE            (256)
+#endif
+
+
+int gribGetZip(long recsize, unsigned char *gribbuffer, long *urecsize)
+{
+  /* urecsize : uncompressed record size  */
+  int compress = 0;
+  int nerr;
+  /* int  bds_len, bds_nbits, lspherc, lcomplex; */
+  int bds_flag, lcompress;
+  long gribsize = 0;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 2 ) return (compress);
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "grib1Sections error\n");
+      return (compress);
+    }
+
+  /* bds_len   = BDS_Len; */
+  /* bds_nbits = BDS_NumBits; */
+  bds_flag  = BDS_Flag;
+  /* lspherc   =  bds_flag >> 7; */
+  /* lcomplex  = (bds_flag >> 6)&1; */
+  lcompress = (bds_flag >> 4)&1;
+
+  *urecsize = 0;
+  if ( lcompress )
+    {
+      compress = BDS_Z;
+      if ( compress == 128 )
+	{
+	  gribsize = gribrec_len(bds[14], bds[15], bds[16]);
+	}
+    }
+
+  *urecsize = gribsize;
+
+  return (compress);
+}
+
+
+int  gribZip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufsize)
+{
+  int nerr;
+  int gribLen;
+  int rec_len;
+  int llarge = FALSE;
+#if ! defined  (HAVE_LIBSZ)
+  static int libszwarn = 1;
+#endif
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+
+  gribLen = gribrec_len(dbuf[4], dbuf[5], dbuf[6]);
+  if ( gribLen > JP23SET ) llarge = TRUE;
+
+  rec_len = gribLen;
+
+  nerr = grib1Sections(dbuf, dbufsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "grib1Sections error\n");
+      return (rec_len);
+    }
+
+#if  defined  (HAVE_LIBSZ)
+
+  {
+    long i;
+    int bdsLen;
+    int gribLenOld = 0;
+    int status;
+    int datstart, datsize;
+    SZ_com_t sz_param;          /* szip parameter block */
+    unsigned char *dest, *source;
+    size_t destLen, sourceLen;
+    int bds_len, bds_nbits, bds_flag, lspherc, lcomplex,/* lcompress,*/ bds_ubits;
+    int bds_head = 11;
+    int bds_ext = 0;
+    int bds_zoffset = 12;
+    unsigned char *pbuf = NULL;
+
+    if ( llarge ) bds_zoffset = 14;
+
+    bds_len   = BDS_Len;
+    bds_len   = correct_bdslen(bds_len, gribLen, bds-dbuf);
+    bds_nbits = BDS_NumBits;
+    bds_flag  = BDS_Flag;
+    bds_ubits = bds_flag & 15;
+    lspherc   =  bds_flag >> 7;
+    lcomplex  = (bds_flag >> 6)&1;
+    /* lcompress = (bds_flag >> 4)&1; */
+    
+    if ( bds_nbits != 8 && bds_nbits != 16 && bds_nbits != 24 && bds_nbits != 32 )
+      {
+	static int linfo = 1;
+	if ( linfo && bds_nbits != 0 )
+	  {
+	    linfo = 0;
+	    fprintf(stderr, "GRIB szip only supports 8, 16, 24 and 32 bit data!\n");
+	  }
+	return (rec_len);
+      }
+    
+    sz_param.options_mask        = OPTIONS_MASK;
+
+    if ( bds_nbits == 24 )
+      sz_param.bits_per_pixel    = 8;
+    else
+      sz_param.bits_per_pixel    = bds_nbits;
+
+    sz_param.pixels_per_block    = PIXELS_PER_BLOCK;
+    sz_param.pixels_per_scanline = PIXELS_PER_SCANLINE;
+
+    if ( lspherc )
+      {
+	if ( lcomplex  )
+	  {
+	    int jup, ioff;
+	    jup  = bds[15];
+	    ioff = (jup+1)*(jup+2);
+	    bds_ext = 4 + 3 + 4*ioff;
+	  }
+	else
+	  {
+	    bds_ext = 4;
+	  }
+      }
+
+    datstart = bds_head + bds_ext;
+
+    datsize = ((((bds_len - datstart)*8-bds_ubits)/bds_nbits)*bds_nbits)/8;
+
+    if ( datsize < MIN_SIZE ) return (rec_len);
+    /*
+    fprintf(stderr, "%d %d %d %d\n", bds_len, datstart, bds_len - datstart, datsize);
+    */
+    sourceLen = datsize;
+    destLen   = sbufsize;
+    
+    source = bds + datstart;
+    dest = sbuf;
+
+    if ( bds_nbits == 24 )
+      {
+	long nelem;
+	nelem = sourceLen/3;
+	pbuf = (unsigned char *) malloc(sourceLen);
+	for ( i = 0; i < nelem; i++ )
+	  {
+	    pbuf[        i] = source[3*i  ];
+	    pbuf[  nelem+i] = source[3*i+1];
+	    pbuf[2*nelem+i] = source[3*i+2];
+	  }
+	source = pbuf;
+      }
+
+    status = SZ_BufftoBuffCompress(dest, &destLen, source, sourceLen, &sz_param);
+    if ( status != SZ_OK )
+      {
+	if ( status == SZ_NO_ENCODER_ERROR )
+	  Warning("SZ_NO_ENCODER_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_PARAM_ERROR )
+	  Warning("SZ_PARAM_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_MEM_ERROR )
+	  Warning("SZ_MEM_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_OUTBUFF_FULL )
+	  /*Warning("SZ_OUTBUFF_FULL code %3d level %3d", PDS_Parameter, PDS_Level2)*/;
+	else
+	  Warning("SZ ERROR: %d code %3d level %3d", status, PDS_Parameter, PDS_Level2);
+      }
+    
+    if ( pbuf ) free(pbuf);
+    /*
+    fprintf(stderr, "sourceLen, destLen %d %d\n", sourceLen, destLen);
+    */
+    
+    if ( destLen < MIN_COMPRESS*sourceLen )
+      {
+	source = bds + datstart + bds_zoffset;
+	memcpy(source, dest, destLen);
+	
+	/* ----++++ number of unused bits at end of section) */
+
+	BDS_Flag -= bds_ubits;
+    
+	gribLenOld = gribLen;
+
+	if ( bds_ext )
+	  for ( i = bds_ext-1; i >= 0; --i )
+	    bds[bds_zoffset+bds_head+i] = bds[bds_head+i];
+
+	/*
+	fprintf(stderr, "destLen, datsize, datstart %d %d %d\n", destLen, datsize, datstart);
+	*/
+	/*	memcpy(bds + datstart + bds_zoffset, source, destLen); */
+	/*
+    fprintf(stderr, "z>>> %d %d %d %d <<<\n", (int) bds[0+datstart+bds_zoffset],
+	    (int)bds[1+datstart+bds_zoffset], (int)bds[2+datstart+bds_zoffset], (int)bds[3+datstart+bds_zoffset]);
+	*/
+	if ( llarge )
+	  {
+	    if ( gribLenOld%120 )
+	      {
+		fprintf(stderr, "Internal problem, record length not multiple of 120!");
+		while ( gribLenOld%120 ) gribLenOld++;
+	      }
+	    gribLenOld = gribLenOld / (-120);
+	    gribLenOld = JP23SET - gribLenOld + 1;
+	    bds[14] = 0xFF & (gribLenOld >> 16);
+	    bds[15] = 0xFF & (gribLenOld >>  8);
+	    bds[16] = 0xFF & (gribLenOld);
+
+	    bds[17] = 0xFF & (sourceLen >> 24);
+	    bds[18] = 0xFF & (sourceLen >> 16);
+	    bds[19] = 0xFF & (sourceLen >>  8);
+	    bds[20] = 0xFF & (sourceLen);
+
+	    bds[21] = 0xFF & (destLen >> 24);
+	    bds[22] = 0xFF & (destLen >> 16);
+	    bds[23] = 0xFF & (destLen >>  8);
+	    bds[24] = 0xFF & (destLen);
+	  }
+	else
+	  {
+	    bds[14] = 0xFF & (gribLenOld >> 16);
+	    bds[15] = 0xFF & (gribLenOld >>  8);
+	    bds[16] = 0xFF & (gribLenOld);
+
+	    bds[17] = 0xFF & (sourceLen >> 16);
+	    bds[18] = 0xFF & (sourceLen >>  8);
+	    bds[19] = 0xFF & (sourceLen);
+
+	    bds[20] = 0xFF & (destLen >> 16);
+	    bds[21] = 0xFF & (destLen >>  8);
+	    bds[22] = 0xFF & (destLen);
+	  }
+
+	bdsLen = datstart + bds_zoffset + destLen;
+
+	bds[11] = 0;
+	bds[12] = 0;
+	BDS_Z   = 128;
+
+	BDS_Flag += 16;
+	if ( (bdsLen%2) == 1 )
+	  {
+	    BDS_Flag += 8;
+	    bds[bdsLen++] = 0;
+	  }
+
+	bds[0] = 0xFF & (bdsLen >> 16);
+	bds[1] = 0xFF & (bdsLen >>  8);
+	bds[2] = 0xFF & (bdsLen);
+
+	gribLen = (bds - dbuf) + bdsLen;
+
+	dbuf[gribLen++] = '7';
+	dbuf[gribLen++] = '7';
+	dbuf[gribLen++] = '7';
+	dbuf[gribLen++] = '7';
+
+	if ( llarge )
+	  {
+	    long itemp;
+	    long bdslen = gribLen - 4;
+
+	    /*
+	      If a very large product, the section 4 length field holds
+	      the number of bytes in the product after section 4 upto
+	      the end of the padding bytes.
+	      This is a fixup to get round the restriction on product lengths
+	      due to the count being only 24 bits. It is only possible because
+	      the (default) rounding for GRIB products is 120 bytes.
+	    */
+	    while ( gribLen%120 ) dbuf[gribLen++] = 0;
+
+	    itemp = gribLen / (-120);
+	    itemp = JP23SET - itemp + 1;
+
+	    dbuf[4] = 0xFF & (itemp >> 16);
+	    dbuf[5] = 0xFF & (itemp >>  8);
+	    dbuf[6] = 0xFF & (itemp);
+
+	    bdslen = gribLen - bdslen;
+
+	    bds[0] = 0xFF & (bdsLen >> 16);
+	    bds[1] = 0xFF & (bdsLen >>  8);
+	    bds[2] = 0xFF & (bdsLen);
+	  }
+	else
+	  {
+	    dbuf[4] = 0xFF & (gribLen >> 16);
+	    dbuf[5] = 0xFF & (gribLen >>  8);
+	    dbuf[6] = 0xFF & (gribLen);
+	  }
+      }
+    /*
+    fprintf(stderr, "%3d %3d griblen in %6d  out %6d  CR %g   slen %6d dlen %6d  CR %g\n",
+	    PDS_Parameter, PDS_Level1, gribLenOld, gribLen,
+	    ((double)gribLenOld)/gribLen, sourceLen, destLen,
+	    ((double)sourceLen)/destLen);
+    */
+  }
+
+#else
+  if ( libszwarn )
+    {
+      Warning("Compression disabled, szlib not available!");
+      libszwarn = 0;
+    }
+#endif
+
+  while ( gribLen & 7 ) dbuf[gribLen++] = 0;
+
+  rec_len = gribLen;
+
+  return (rec_len);
+}
+
+
+int  gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufsize)
+{
+#if ! defined  (HAVE_LIBSZ)
+  static int libszwarn = 1;
+#endif
+  int nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  int bdsLen, recLen, gribLen = 0;
+  char *dest, *source;
+  size_t destLen, sourceLen;
+  int /* bds_len, */ bds_nbits, bds_flag, lspherc, lcomplex /*, lcompress*/;
+  int bds_head = 11;
+  int bds_ext = 0;
+  int bds_zoffset = 12;
+  int datstart = 0;
+  int llarge = FALSE;
+
+  nerr = grib1Sections(sbuf, sbufsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "grib1Sections error\n");
+      return (0);
+    }
+
+  recLen = gribrec_len(bds[14], bds[15], bds[16]);
+  if ( recLen > JP23SET ) llarge = TRUE;
+
+  if ( llarge ) bds_zoffset = 14;
+
+  /* bds_len   = BDS_Len; */
+  bds_nbits = BDS_NumBits;
+  bds_flag  = BDS_Flag;
+  lspherc   =  bds_flag >> 7;
+  lcomplex  = (bds_flag >> 6)&1;
+  /* lcompress = (bds_flag >> 4)&1; */
+
+  if ( lspherc )
+    {
+      if ( lcomplex  )
+	{
+	  int jup, ioff;
+	  jup  = bds[bds_zoffset+15];
+	  ioff = (jup+1)*(jup+2);
+	  bds_ext = 4 + 3 + 4*ioff;
+	}
+      else
+	{
+	  bds_ext = 4;
+	}
+    }
+
+  datstart = bds_head + bds_ext;
+
+  source = (char *) bds + datstart + bds_zoffset;
+  if ( llarge )
+    sourceLen = ((size_t) ((bds[21]<<24)+(bds[22]<<16)+(bds[23]<<8)+bds[24]));
+  else
+    sourceLen = ((size_t) ((bds[20]<<16)+(bds[21]<<8)+bds[22]));
+
+  nerr = grib1Sections(dbuf, sbufsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "grib1Sections error\n");
+      return (0);
+    }
+
+  dest = (char *) bds + datstart;
+  if ( llarge )
+    destLen = ((size_t) ((bds[17]<<24)+(bds[18]<<16)+(bds[19]<<8)+bds[20]));
+  else
+    destLen = ((size_t) ((bds[17]<<16)+(bds[18]<<8)+bds[19]));
+
+  BDS_Flag -= 16;
+
+  bdsLen = datstart + destLen;
+
+#if  defined  (HAVE_LIBSZ)
+  {
+    int status;
+    long i;
+    size_t tmpLen;
+    int bds_ubits;
+    SZ_com_t sz_param;          /* szip parameter block */
+
+    sz_param.options_mask        = OPTIONS_MASK;
+
+    if ( bds_nbits == 24 )
+      sz_param.bits_per_pixel    = 8;
+    else
+      sz_param.bits_per_pixel    = bds_nbits;
+
+    sz_param.pixels_per_block    = PIXELS_PER_BLOCK;
+    sz_param.pixels_per_scanline = PIXELS_PER_SCANLINE;
+
+    if ( bds_ext )
+      for ( i = 0; i < bds_ext; ++i )
+	bds[bds_head+i] = bds[bds_zoffset+bds_head+i];
+
+    /*
+    fprintf(stderr, "gribUnzip: sourceLen %ld; destLen %ld\n", (long)sourceLen, (long)destLen);
+    fprintf(stderr, "gribUnzip: sourceOff %d; destOff %d\n", bds[12], bds[11]);
+    fprintf(stderr, "gribUnzip: reclen %d; bdslen %d\n", recLen, bdsLen);
+    */
+
+    tmpLen = destLen;
+    status = SZ_BufftoBuffDecompress(dest, &tmpLen, source, sourceLen, &sz_param);
+    if ( status != SZ_OK )
+      {
+	if ( status == SZ_NO_ENCODER_ERROR )
+	  Warning("SZ_NO_ENCODER_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_PARAM_ERROR )
+	  Warning("SZ_PARAM_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_MEM_ERROR )
+	  Warning("SZ_MEM_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_OUTBUFF_FULL )
+	  Warning("SZ_OUTBUFF_FULL code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else
+	  Warning("SZ ERROR: %d code %3d level %3d", status, PDS_Parameter, PDS_Level2);
+      }
+    /*
+    fprintf(stderr, "gribUnzip: sl = %ld  dl = %ld   tl = %ld\n",
+	    (long)sourceLen, (long)destLen,(long) tmpLen);
+    */
+    if ( tmpLen != destLen )
+      Warning("unzip size differ: code %3d level %3d  ibuflen %ld ubuflen %ld",
+	      PDS_Parameter, PDS_Level2, (long) destLen, (long) tmpLen);
+ 
+    if ( bds_nbits == 24 )
+      {
+	long nelem;
+	unsigned char *pbuf;
+	nelem = tmpLen/3;
+	pbuf = (unsigned char *) malloc(tmpLen);
+	for ( i = 0; i < nelem; i++ )
+	  {
+	    pbuf[3*i  ] = dest[        i];
+	    pbuf[3*i+1] = dest[  nelem+i];
+	    pbuf[3*i+2] = dest[2*nelem+i];
+	  }
+	memcpy(dest, pbuf, tmpLen);
+	free(pbuf);
+      }
+  
+    bds_ubits = BDS_Flag & 15;
+    BDS_Flag -= bds_ubits;
+
+    if ( (bdsLen%2) == 1 )
+      {
+	BDS_Flag += 8;
+	bds[bdsLen++] = 0;
+      }
+
+    bds[0] = 0xFF & (bdsLen >> 16);
+    bds[1] = 0xFF & (bdsLen >>  8);
+    bds[2] = 0xFF & (bdsLen);
+
+    gribLen = (bds - dbuf) + bdsLen;
+    
+    dbuf[gribLen++] = '7';
+    dbuf[gribLen++] = '7';
+    dbuf[gribLen++] = '7';
+    dbuf[gribLen++] = '7';
+
+    if ( llarge )
+      {
+	long itemp;
+        bdsLen = gribLen - 4;
+	/*
+	  If a very large product, the section 4 length field holds
+	  the number of bytes in the product after section 4 upto
+	  the end of the padding bytes.
+	  This is a fixup to get round the restriction on product lengths
+	  due to the count being only 24 bits. It is only possible because
+	  the (default) rounding for GRIB products is 120 bytes.
+	*/
+	while ( gribLen%120 ) dbuf[gribLen++] = 0;
+
+	if ( gribLen != recLen )
+	  fprintf(stderr, "Internal problem, recLen and gribLen differ!\n");
+	
+	itemp = gribLen / (-120);
+	itemp = JP23SET - itemp + 1;
+	
+	dbuf[4] = 0xFF & (itemp >> 16);
+	dbuf[5] = 0xFF & (itemp >>  8);
+	dbuf[6] = 0xFF & (itemp);
+	
+	bdsLen = gribLen - bdsLen;
+	    
+	bds[0] = 0xFF & (bdsLen >> 16);
+	bds[1] = 0xFF & (bdsLen >>  8);
+	bds[2] = 0xFF & (bdsLen);
+      }
+    else
+      {
+	dbuf[4] = 0xFF & (recLen >> 16);
+	dbuf[5] = 0xFF & (recLen >>  8);
+	dbuf[6] = 0xFF & (recLen);
+      }
+    /*
+    fprintf(stderr, "recLen, gribLen, bdsLen %d %d %d\n", recLen, gribLen, bdsLen);
+    */
+    while ( gribLen & 7 ) dbuf[gribLen++] = 0;
+    /*
+    fprintf(stderr, "recLen, gribLen, bdsLen %d %d %d\n", recLen, gribLen, bdsLen);
+    */
+  }
+#else
+  if ( libszwarn )
+    {
+      Warning("Decompression disabled, szlib not available!");
+      libszwarn = 0;
+    }
+#endif
+
+  return (gribLen);
+}
+static const char grb_libvers[] = "1.5.6" " of ""Dec 17 2012"" ""13:44:05";
+const char *
+cgribexLibraryVersion(void)
+{
+  return (grb_libvers);
+}
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#if  defined  (HAVE_LIBGRIB_API)
+#  include <grib_api.h>
+#endif
+
+#include <stdio.h>
+
+
+#define XSTRING(x)	#x
+#define STRING(x)	XSTRING(x)
+
+static char gribapi_libvers[64] = "";
+
+const char *gribapiLibraryVersion(void)
+{
+#if  defined  (HAVE_LIBGRIB_API)
+  long version = grib_get_api_version();
+  int major_version, minor_version, revision_version;
+
+  major_version    = version/10000;
+  minor_version    = (version-major_version*10000)/100;
+  revision_version = (version-major_version*10000-minor_version*100);
+
+  sprintf(gribapi_libvers, "%d.%d.%d",
+	  major_version, minor_version, revision_version);
+#endif
+
+  return (gribapi_libvers);
+}
+
+
+void gribContainersNew(int streamID)
+{
+  stream_t *streamptr;
+  int editionNumber = 2;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->filetype == FILETYPE_GRB ) editionNumber = 1;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( streamptr->filetype == FILETYPE_GRB )
+    {
+    }
+  else
+#endif
+    {
+      int nvars = streamptr->nvars;
+
+#if defined (GRIBCONTAINER2D)
+      gribContainer_t **gribContainers;
+      gribContainers = (gribContainer_t **) malloc(nvars*sizeof(gribContainer_t *));
+
+      for ( int varID = 0; varID < nvars; ++varID )
+        {
+          int nlevs = streamptr->vars[varID].nlevs;
+          gribContainers[varID] = (gribContainer_t *) malloc(nlevs*sizeof(gribContainer_t));
+
+          for ( int levelID = 0; levelID < nlevs; ++levelID )
+            {
+              gribContainers[varID][levelID].gribHandle = gribHandleNew(editionNumber);
+              gribContainers[varID][levelID].init = FALSE;
+            }
+	}
+
+      streamptr->gribContainers = (void **) gribContainers;
+#else
+      gribContainer_t *gribContainers;
+      gribContainers = (gribContainer_t *) malloc(nvars*sizeof(gribContainer_t));
+
+      for ( int varID = 0; varID < nvars; ++varID )
+        {
+          gribContainers[varID].gribHandle = gribHandleNew(editionNumber);
+          gribContainers[varID].init = FALSE;
+	}
+
+      streamptr->gribContainers = (void *) gribContainers;
+#endif
+    }
+}
+
+
+void gribContainersDelete(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->gribContainers )
+    {
+      int nvars = streamptr->nvars;
+
+#if defined (GRIBCONTAINER2D)
+      gribContainer_t **gribContainers = (gribContainer_t **) streamptr->gribContainers;
+
+      for ( int varID = 0; varID < nvars; ++varID )
+	{
+          int nlevs = streamptr->vars[varID].nlevs;
+          for ( int levelID = 0; levelID < nlevs; ++levelID )
+            {
+              gribHandleDelete(gribContainers[varID][levelID].gribHandle);
+            }
+          free(gribContainers[varID]);
+	}
+#else
+      gribContainer_t *gribContainers = (gribContainer_t *) streamptr->gribContainers;
+
+      for ( int varID = 0; varID < nvars; ++varID )
+	{
+          gribHandleDelete(gribContainers[varID].gribHandle);
+	}
+#endif
+
+      free(gribContainers);
+
+      streamptr->gribContainers = NULL;
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+
+
+void swap4byte(void *ptr, size_t size)
+{
+  INT32 *ptrtmp;
+  int nval;
+
+  nval = size;
+  if ( nval < 0 ) nval = 0;
+  ptrtmp = (INT32 *) ptr;
+
+  if ( sizeof(INT32) == 4 )
+    {
+      while ( nval-- )
+	{
+	  *ptrtmp = (((*ptrtmp >> 24) & 0x00ff) | ((*ptrtmp & 0x00ff) << 24) |
+		     ((*ptrtmp >>  8) & 0xff00) | ((*ptrtmp & 0xff00) <<  8));
+	  ptrtmp++;
+	}
+    }
+  else
+    {
+      Error("not implemented for %d byte data", sizeof(INT32));
+    }
+}
+
+void swap8byte(void *ptr, size_t size)
+{
+  INT64 *ptrtmp;
+  int nval;
+
+  nval = size;
+  if ( nval < 0 ) nval = 0;
+  ptrtmp = (INT64 *) ptr;
+
+  if ( sizeof(INT64) == 8 )
+    {
+      while ( nval-- )
+	{
+	  *ptrtmp = (((*ptrtmp >> 56) & 0x000000ff) | ((*ptrtmp & 0x000000ff) << 56) |
+		     ((*ptrtmp >> 40) & 0x0000ff00) | ((*ptrtmp & 0x0000ff00) << 40) |
+		     ((*ptrtmp >> 24) & 0x00ff0000) | ((*ptrtmp & 0x00ff0000) << 24) |
+		     ((*ptrtmp >>  8) & 0xff000000) | ((*ptrtmp & 0xff000000) <<  8));
+	  ptrtmp++;
+	}
+    }
+  else
+    {
+      Error("not implemented for %d byte data", sizeof(INT64));
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+
+
+#undef  IsBigendian
+#define IsBigendian()  ( u_byteorder.c[sizeof(long) - 1] )
+
+
+UINT32 get_UINT32(unsigned char *x)
+{
+  /* IsBigendian returns 1 for big endian byte order */
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+
+  if ( IsBigendian() )
+    return((UINT32)(((UINT32)x[0]<<24)+((UINT32)x[1]<<16)+((UINT32)x[2]<< 8)+ (UINT32)x[3]));
+  else
+    return((UINT32)(((UINT32)x[3]<<24)+((UINT32)x[2]<<16)+((UINT32)x[1]<< 8)+ (UINT32)x[0]));
+}
+
+
+UINT32 get_SUINT32(unsigned char *x)
+{
+  /* IsBigendian returns 1 for big endian byte order */
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+
+  if ( IsBigendian() )
+    return((UINT32)(((UINT32)x[3]<<24)+((UINT32)x[2]<<16)+((UINT32)x[1]<< 8)+ (UINT32)x[0]));
+  else
+    return((UINT32)(((UINT32)x[0]<<24)+((UINT32)x[1]<<16)+((UINT32)x[2]<< 8)+ (UINT32)x[3]));
+}
+
+
+UINT64 get_UINT64(unsigned char *x)
+{
+  /* IsBigendian returns 1 for big endian byte order */
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+
+  if ( IsBigendian() )
+    return((UINT64)(((UINT64)x[0]<<56)+((UINT64)x[1]<<48)+((UINT64)x[2]<<40)+((UINT64)x[3]<<32)+
+		    ((UINT64)x[4]<<24)+((UINT64)x[5]<<16)+((UINT64)x[6]<< 8)+ (UINT64)x[7]));
+  else
+    return((UINT64)(((UINT64)x[7]<<56)+((UINT64)x[6]<<48)+((UINT64)x[5]<<40)+((UINT64)x[4]<<32)+
+		    ((UINT64)x[3]<<24)+((UINT64)x[2]<<16)+((UINT64)x[1]<< 8)+ (UINT64)x[0]));
+}
+
+
+UINT64 get_SUINT64(unsigned char *x)
+{
+  /* IsBigendian returns 1 for big endian byte order */
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+
+  if ( IsBigendian() )
+    return((UINT64)(((UINT64)x[7]<<56)+((UINT64)x[6]<<48)+((UINT64)x[5]<<40)+((UINT64)x[4]<<32)+
+		    ((UINT64)x[3]<<24)+((UINT64)x[2]<<16)+((UINT64)x[1]<< 8)+ (UINT64)x[0]));
+  else
+    return((UINT64)(((UINT64)x[0]<<56)+((UINT64)x[1]<<48)+((UINT64)x[2]<<40)+((UINT64)x[3]<<32)+
+		    ((UINT64)x[4]<<24)+((UINT64)x[5]<<16)+((UINT64)x[6]<< 8)+ (UINT64)x[7]));
+}
+
+
+size_t binReadF77Block(int fileID, int byteswap)
+{
+  unsigned char f77block[4];
+  size_t blocklen = 0;
+
+  if ( fileRead(fileID, f77block, 4) == 4 )
+    {
+      if ( byteswap )
+	blocklen = get_SUINT32(f77block);
+      else
+	blocklen =  get_UINT32(f77block);
+    }
+
+  return (blocklen);
+}
+
+
+void binWriteF77Block(int fileID, int byteswap, size_t blocksize)
+{
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+  unsigned char f77block[4];
+
+  if ( IsBigendian() )
+    {
+      if ( byteswap )
+	{
+	  f77block[0] = (unsigned char) (blocksize);
+	  f77block[1] = (unsigned char) (blocksize >>  8);
+	  f77block[2] = (unsigned char) (blocksize >> 16);
+	  f77block[3] = (unsigned char) (blocksize >> 24);
+	}
+      else
+	{
+	  f77block[3] = (unsigned char) (blocksize);
+	  f77block[2] = (unsigned char) (blocksize >>  8);
+	  f77block[1] = (unsigned char) (blocksize >> 16);
+	  f77block[0] = (unsigned char) (blocksize >> 24);
+	}
+    }
+  else
+    {
+      if ( byteswap )
+	{
+	  f77block[3] = (unsigned char) (blocksize);
+	  f77block[2] = (unsigned char) (blocksize >>  8);
+	  f77block[1] = (unsigned char) (blocksize >> 16);
+	  f77block[0] = (unsigned char) (blocksize >> 24);
+	}
+      else
+	{
+	  f77block[0] = (unsigned char) (blocksize);
+	  f77block[1] = (unsigned char) (blocksize >>  8);
+	  f77block[2] = (unsigned char) (blocksize >> 16);
+	  f77block[3] = (unsigned char) (blocksize >> 24);
+	}
+    }
+
+  if ( fileWrite(fileID, f77block, 4) != 4 )
+    Error("write failed on %s", fileInqName(fileID));
+}
+
+
+int binReadInt32(int fileID, int byteswap, size_t size, INT32 *ptr)
+{
+  if ( sizeof(INT32) == 4 )
+    {
+      fileRead(fileID, (void *) ptr, 4*size);
+      if ( byteswap ) swap4byte(ptr, size);
+    }
+  else
+    {
+      Error("not implemented for %d byte integer", sizeof(INT32));
+    }
+
+  return (0);
+}
+
+
+int binReadInt64(int fileID, int byteswap, size_t size, INT64 *ptr)
+{
+  if ( sizeof(INT64) == 8 )
+    {
+      fileRead(fileID, (void *) ptr, 8*size);
+      if ( byteswap ) swap8byte(ptr, size);
+    }
+  else
+    {
+      Error("not implemented for %d byte integer", sizeof(INT64));
+    }
+
+  return (0);
+}
+
+
+int binReadFlt32(int fileID, int byteswap, size_t size, FLT32 *ptr)
+{
+  if ( sizeof(FLT32) == 4 )
+    {
+      fileRead(fileID, (void *) ptr, 4*size);
+      if ( byteswap ) swap4byte(ptr, size);
+    }
+  else
+    {
+      Error("not implemented for %d byte float", sizeof(FLT32));
+    }
+
+  return (0);
+}
+
+
+int binReadFlt64(int fileID, int byteswap, size_t size, FLT64 *ptr)
+{
+  if ( sizeof(FLT64) == 8 )
+    {
+      fileRead(fileID, (void *) ptr, 8*size);
+      if ( byteswap ) swap8byte(ptr, size);
+    }
+  else
+    {
+      Error("not implemented for %d byte float", sizeof(FLT64));
+    }
+
+  return (0);
+}
+
+
+int binWriteInt32(int fileID, int byteswap, size_t size, INT32 *ptr)
+{
+  if ( sizeof(INT32) == 4 )
+    {
+      if ( byteswap ) swap4byte(ptr, size);
+      fileWrite(fileID, (void *) ptr, 4*size);
+    }
+  else
+    {
+      Error("not implemented for %d byte integer", sizeof(INT32));
+    }
+
+  return (0);
+}
+
+
+int binWriteInt64(int fileID, int byteswap, size_t size, INT64 *ptr)
+{
+  if ( sizeof(INT64) == 8 )
+    {
+      if ( byteswap ) swap8byte(ptr, size);
+      fileWrite(fileID, (void *) ptr, 8*size);
+    }
+  else
+    {
+      Error("not implemented for %d byte integer", sizeof(INT64));
+    }
+
+  return (0);
+}
+
+
+int binWriteFlt32(int fileID, int byteswap, size_t size, FLT32 *ptr)
+{
+  if ( sizeof(FLT32) == 4 )
+    {
+      if ( byteswap ) swap4byte(ptr, size);
+      fileWrite(fileID, (void *) ptr, 4*size);
+    }
+  else
+    {
+      Error("not implemented for %d byte float", sizeof(FLT32));
+    }
+
+  return (0);
+}
+
+
+int binWriteFlt64(int fileID, int byteswap, size_t size, FLT64 *ptr)
+{
+  if ( sizeof(FLT64) == 8 )
+    {
+      if ( byteswap ) swap8byte(ptr, size);
+      fileWrite(fileID, (void *) ptr, 8*size);
+    }
+  else
+    {
+      Error("not implemented for %d byte float", sizeof(FLT64));
+    }
+
+  return (0);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+
+
+
+const char *cdfLibraryVersion(void)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  return (nc_inq_libvers());
+#else
+  return ("library undefined");
+#endif
+}
+
+#if  defined(HAVE_LIBHDF5)
+#if defined(__cplusplus)
+extern "C" {
+#endif
+  int H5get_libversion(unsigned *, unsigned *, unsigned *);
+#if defined(__cplusplus)
+}
+#endif
+#endif
+
+const char *hdfLibraryVersion(void)
+{
+#if  defined(HAVE_LIBHDF5)
+  static char hdf_libvers[256];
+  unsigned majnum, minnum, relnum;
+
+  H5get_libversion(&majnum, &minnum, &relnum);
+
+  sprintf(hdf_libvers, "%u.%u.%u", majnum, minnum, relnum);
+
+  return (hdf_libvers);
+#else
+  return ("library undefined");
+#endif
+}
+
+
+int CDF_Debug   = 0;    /* If set to 1, debugging           */
+
+
+void cdfDebug(int debug)
+{
+  CDF_Debug = debug;
+
+  if ( CDF_Debug )
+    Message("debug level %d", debug);
+}
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfComment(int ncid)
+{
+  static char comment[256] = "Climate Data Interface version ";
+  static int init = 0;
+  char *blank;
+  int size = 0;
+
+  if ( ! init )
+    {
+      init = 1;
+      blank = strchr(cdiLibraryVersion(), ' ');
+      if ( blank ) size = blank - cdiLibraryVersion();
+
+      if ( size == 0 || ! isdigit((int) *cdiLibraryVersion()) )
+	strcat(comment, "??");
+      else
+	strncat(comment, cdiLibraryVersion(), size);
+      strcat(comment, " (http://code.zmaw.de/projects/cdi)");
+    }
+
+  cdf_put_att_text(ncid, NC_GLOBAL, "CDI", strlen(comment), comment);
+  cdf_put_att_text(ncid, NC_GLOBAL, "Conventions", 6, "CF-1.4");
+}
+#endif
+
+int cdfOpenFile(const char *filename, const char *mode, int *filetype)
+{
+  int ncid = -1;
+#if  defined  (HAVE_LIBNETCDF)
+  int fmode = tolower(*mode);
+  int writemode = NC_CLOBBER;
+  int readmode = NC_NOWRITE;
+  int status;
+
+  if ( filename == NULL )
+    ncid = CDI_EINVAL;
+  else
+    {
+      switch (fmode)
+	{
+	case 'r':
+	  status = cdf_open(filename, readmode, &ncid);
+	  if ( status > 0 && ncid < 0 ) ncid = CDI_ESYSTEM;
+#if  defined  (HAVE_NETCDF4)
+	  else
+	    {
+	      int format;
+	      (void) nc_inq_format(ncid, &format);
+	      if ( format == NC_FORMAT_NETCDF4_CLASSIC )
+		{
+		  *filetype = FILETYPE_NC4C;
+		}
+	    }
+#endif
+	  break;
+	case 'w':
+#if  defined  (NC_64BIT_OFFSET)
+	  if      ( *filetype == FILETYPE_NC2  ) writemode |= NC_64BIT_OFFSET;
+#endif
+#if  defined  (HAVE_NETCDF4)
+	  if      ( *filetype == FILETYPE_NC4  ) writemode |= NC_NETCDF4;
+	  else if ( *filetype == FILETYPE_NC4C ) writemode |= NC_NETCDF4 | NC_CLASSIC_MODEL;
+#endif
+	  cdf_create(filename, writemode, &ncid);
+	  cdfComment(ncid);
+	  break;
+	case 'a':
+	  cdf_open(filename, NC_WRITE, &ncid);
+	  break;
+	default:
+	  ncid = CDI_EINVAL;
+	}
+    }
+#endif
+
+  return (ncid);
+}
+
+
+int cdfOpen(const char *filename, const char *mode)
+{
+  int fileID = 0;
+  int filetype = FILETYPE_NC;
+
+  if ( CDF_Debug )
+    Message("Open %s with mode %c", filename, *mode);
+
+  fileID = cdfOpenFile(filename, mode, &filetype);
+
+  if ( CDF_Debug )
+    Message("File %s opened with id %d", filename, fileID);
+
+  return (fileID);
+}
+
+
+int cdfOpen64(const char *filename, const char *mode)
+{
+  int fileID = -1;
+  int open_file = TRUE;
+  int filetype = FILETYPE_NC2;
+
+  if ( CDF_Debug )
+    Message("Open %s with mode %c", filename, *mode);
+
+#if  defined  (HAVE_LIBNETCDF)
+#if  ! defined  (NC_64BIT_OFFSET)
+  open_file = FALSE;
+#endif
+#endif
+
+  if ( open_file )
+    {
+      fileID = cdfOpenFile(filename, mode, &filetype);
+
+      if ( CDF_Debug )
+	Message("File %s opened with id %d", filename, fileID);
+    }
+  else
+    {
+      fileID = CDI_ELIBNAVAIL;
+    }
+
+  return (fileID);
+}
+
+
+int cdf4Open(const char *filename, const char *mode, int *filetype)
+{
+  int fileID = -1;
+  int open_file = FALSE;
+
+  if ( CDF_Debug )
+    Message("Open %s with mode %c", filename, *mode);
+
+#if  defined  (HAVE_NETCDF4)
+  open_file = TRUE;
+#endif
+
+  if ( open_file )
+    {
+      fileID = cdfOpenFile(filename, mode, filetype);
+
+      if ( CDF_Debug )
+	Message("File %s opened with id %d", filename, fileID);
+    }
+  else
+    {
+      fileID = CDI_ELIBNAVAIL;
+    }
+
+  return (fileID);
+}
+
+
+void cdfCloseFile(int fileID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  cdf_close(fileID);
+#endif
+}
+
+void cdfClose(int fileID)
+{
+  cdfCloseFile(fileID);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+
+static int nNamespaces = 1;
+static int activeNamespace = 0;
+static int serialHLF = 1;
+static int * hasLocalFiles = &serialHLF;
+static int serialRS = STAGE_DEFINITION;
+static statusCode * resStatus = (statusCode *) &serialRS;
+
+enum {
+  intbits = sizeof(int) * CHAR_BIT,
+  nspbits = 4,
+  idxbits = intbits - nspbits,
+  nspmask = (( 1 << nspbits ) - 1) << idxbits,
+  idxmask = ( 1 << idxbits ) - 1,
+};
+
+enum {
+  NUM_NAMESPACES = 1 << nspbits,
+  NUM_IDX = 1 << idxbits,
+};
+
+
+void namespaceShowbits ( int n, char *name )
+{
+  int i;
+  unsigned mask;
+  char bitvalues[intbits + 1];
+
+  mask = 1;
+  for ( i = 0; i < intbits; i++ )
+    {
+      bitvalues[i] = ((unsigned)n & mask) ? '1':'0';
+      mask <<= 1;
+    }
+  bitvalues[intbits] = '\0';
+  fprintf (stdout, "%s: %s\n", name, bitvalues );
+}
+
+
+int namespaceIdxEncode ( namespaceTuple_t tin )
+{
+  xassert ( tin.nsp < NUM_NAMESPACES && tin.idx < NUM_IDX);
+  return ( tin.nsp << idxbits ) + tin.idx;
+}
+
+int namespaceIdxEncode2 ( int nsp, int idx )
+{
+  xassert(nsp < NUM_NAMESPACES && idx < NUM_IDX);
+  return ( nsp << idxbits ) + idx;
+}
+
+
+namespaceTuple_t namespaceResHDecode ( int resH )
+{
+  namespaceTuple_t tin;
+
+  tin.idx = resH & idxmask;
+  tin.nsp = (int)(((unsigned)( resH & nspmask )) >> idxbits);
+
+  return tin;
+}
+
+
+void namespaceInit ( int nspn, int * argHasLocalFile )
+{
+  /* FIXME: this should not be PIO-only */
+#ifdef USE_MPI
+  int nspID;
+
+  xassert(nspn <= NUM_NAMESPACES && nspn >= 1 );
+
+  nNamespaces = nspn;
+  if ( nspn >= 1 )
+    {
+      hasLocalFiles = xmalloc ( nspn * sizeof ( hasLocalFiles[0] ));
+      for ( nspID = 0; nspID < nspn; nspID++ )
+	hasLocalFiles[nspID] = argHasLocalFile[nspID];
+      resStatus = xmalloc ( nspn * sizeof ( resStatus[0] ));
+    }
+#endif
+}
+
+
+void namespaceCleanup ( void )
+{
+  if ( nNamespaces > 1 )
+    {
+      free ( hasLocalFiles );
+      hasLocalFiles = NULL;
+      free ( resStatus );
+    }
+}
+
+
+int namespaceGetNumber ()
+{
+  return nNamespaces;
+}
+
+
+void pioNamespaceSetActive ( int nId )
+{
+  /* FIXME: this should not be PIO-only */
+#ifdef USE_MPI
+  xassert ( nId < nNamespaces && nId >= 0 );
+
+  activeNamespace = nId;
+#endif
+}
+
+
+int namespaceGetActive ()
+{
+  return activeNamespace;
+}
+
+
+int namespaceHasLocalFile ( int nId )
+{
+  xassert ( nId < nNamespaces && nId >= 0 );
+
+  return hasLocalFiles ? hasLocalFiles[nId] : 0;
+}
+
+
+int namespaceAdaptKey ( int key, int nspTarget )
+{
+  namespaceTuple_t tin;
+  int nsp;
+
+  if ( key == CDI_UNDEFID ) return CDI_UNDEFID;
+
+  tin.idx = key & idxmask;
+  tin.nsp = (int)(((unsigned)( key & nspmask )) >> idxbits);
+
+  xassert ( tin.nsp == nspTarget );
+
+  nsp = namespaceGetActive ();
+
+  return namespaceIdxEncode2 ( nsp, tin.idx );
+}
+
+
+int namespaceAdaptKey2 ( int key )
+{
+  namespaceTuple_t tin;
+  int nsp;
+
+  if ( key == CDI_UNDEFID ) return CDI_UNDEFID;
+
+  tin.idx = key & idxmask;
+  tin.nsp = (int)(((unsigned)( key & nspmask )) >> idxbits);
+
+  nsp = namespaceGetActive ();
+
+  return namespaceIdxEncode2 ( nsp, tin.idx );
+}
+
+
+void namespaceDefResStatus ( statusCode argResStatus )
+{
+  int nsp = namespaceGetActive ();
+  resStatus[nsp] = argResStatus;
+}
+
+
+statusCode namespaceInqResStatus ( void )
+{
+  int nsp = namespaceGetActive ();
+  return resStatus[nsp];
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#if defined (HAVE_CONFIG_H)
+#endif
+
+#define _XOPEN_SOURCE 600 /* PTHREAD_MUTEX_RECURSIVE */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+
+#ifdef USE_MPI
+#endif
+
+
+enum { MIN_LIST_SIZE = 128 };
+
+static int *listSizeAllocated;
+
+static void listInitialize(void);
+
+// ATTENTION: not thread safe yet, namespaces are set in model!
+
+#if  defined  (HAVE_LIBPTHREAD)
+#  include <pthread.h>
+
+static pthread_once_t  listInitThread = PTHREAD_ONCE_INIT;
+static pthread_mutex_t listMutex;
+
+#  define LIST_LOCK()         pthread_mutex_lock(&listMutex)
+#  define LIST_UNLOCK()       pthread_mutex_unlock(&listMutex)
+#  define LIST_INIT()         pthread_once(&listInitThread, listInitialize)
+
+#else
+
+static int listInit = 0;
+
+#  define LIST_LOCK()
+#  define LIST_UNLOCK()
+#  define LIST_INIT()        do {                               \
+  if ( !listInit )                                              \
+    {                                                           \
+      listInitialize();                                         \
+      listInit = 1;                                             \
+    }                                                           \
+  } while(0)
+
+#endif
+
+
+typedef struct listElem {
+  cdiResH       resH;//idx
+  struct listElem * next;
+  resOps      * ops;
+  void        * val;//ptr
+  int           status;
+} listElem_t;
+
+
+static listElem_t **listResources;
+static listElem_t **freeListHead;
+
+/**************************************************************/
+
+static
+void listNew ( void )
+{
+  int nnsp, i;
+
+  nnsp = namespaceGetNumber ();
+
+  listSizeAllocated = xcalloc ( nnsp, sizeof( listSizeAllocated[0]));
+  listResources     = xcalloc ( nnsp, sizeof( listResources[0]));
+  freeListHead      = xcalloc ( nnsp, sizeof( freeListHead[0]));
+
+  for ( i = 0; i < nnsp; i++ )
+    {
+      listSizeAllocated[i] = MIN_LIST_SIZE;
+
+      xassert ( listResources[i] == NULL);
+
+      listResources[i] = xcalloc ( listSizeAllocated[i], sizeof ( listElem_t ));
+    }
+}
+
+/**************************************************************/
+
+static
+void listInitPointer ( void )
+{
+  int nnsp, i, j;
+
+  nnsp = namespaceGetNumber ();
+
+  for ( i = 0; i < nnsp; i++ )
+    {
+      for ( j = 0; j < listSizeAllocated[i]; j++ )
+        {
+          listResources[i][j].resH   = namespaceIdxEncode2 ( i, j );
+          listResources[i][j].next   = listResources[i] + j + 1;
+          listResources[i][j].ops    = NULL;
+          listResources[i][j].val    = NULL;
+          listResources[i][j].status = RESH_UNDEFID;
+        }
+
+      listResources[i][listSizeAllocated[i]-1].next = NULL;
+
+      freeListHead[i] = listResources[i];
+    }
+}
+
+/**************************************************************/
+
+static
+void listDestroy ( void )
+{
+  listElem_t * listElem;
+  int i, j, nnsp;
+
+  if ( listResources )
+    {
+      nnsp = namespaceGetNumber ();
+      for ( i = 0; i < nnsp; i++ )
+	{
+	  pioNamespaceSetActive ( i );
+          if ( listResources[i] )
+            {
+              if ( listSizeAllocated )
+                for ( j = 0; j < listSizeAllocated[i]; j++ )
+                  {
+                    listElem = listResources[i] + j;
+                    if  ( listElem->val )
+                      listElem->ops->valDestroy ( listElem->val );
+                  }
+              free ( listResources[i] );
+              listResources[i] = NULL;
+            }
+	}
+      free ( listResources );
+      listResources = NULL;
+    }
+
+  if ( freeListHead )
+    {
+      free ( freeListHead );
+      freeListHead = NULL;
+    }
+  if ( listSizeAllocated )
+    {
+      free ( listSizeAllocated );
+      listSizeAllocated = NULL;
+    }
+}
+
+/**************************************************************/
+
+static
+void listInitialize ( void )
+{
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_mutexattr_t ma;
+  pthread_mutexattr_init(&ma);
+  pthread_mutexattr_settype(&ma, PTHREAD_MUTEX_RECURSIVE);
+  /* initialize global API mutex lock */
+  pthread_mutex_init ( &listMutex, &ma);
+  pthread_mutexattr_destroy(&ma);
+#endif
+
+  listNew ();
+  /* file is special and has its own table, which needs to be
+   * created, before we register the listDestroy exit handler */
+  {
+    int null_id;
+    null_id = fileOpen("/dev/null", "r");
+    if (null_id != -1)
+      fileClose(null_id);
+  }
+  atexit ( listDestroy );
+
+  LIST_LOCK();
+
+  listInitPointer ();
+
+  LIST_UNLOCK();
+
+}
+
+/**************************************************************/
+
+static
+void listSizeExtend()
+{
+  int newListSize;
+  int i, nsp;
+
+  nsp = namespaceGetActive ();
+
+  newListSize = listSizeAllocated[nsp] + MIN_LIST_SIZE;
+
+  listResources[nsp] =
+    xrealloc(listResources[nsp], newListSize * sizeof (listResources[0][0]));
+
+  for ( i = listSizeAllocated[nsp]; i < newListSize; ++i )
+    {
+      listResources[nsp][i].resH   = namespaceIdxEncode2 ( nsp, i );
+      listResources[nsp][i].next   = listResources[nsp] + i + 1;
+      listResources[nsp][i].ops    = NULL;
+      listResources[nsp][i].val    = NULL;
+      listResources[nsp][i].status = RESH_UNDEFID;
+    }
+
+  listResources[nsp][newListSize-1].next = freeListHead[nsp];
+  freeListHead[nsp] = listResources[nsp] + listSizeAllocated[nsp];
+  listSizeAllocated[nsp] = newListSize;
+}
+
+/**************************************************************/
+
+int reshPut ( void *p, resOps *ops )
+{
+  cdiResH resH = -1, nsp;
+  listElem_t * newListElem;
+
+  xassert ( p && ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  if ( !freeListHead[nsp] ) listSizeExtend();
+  newListElem               = freeListHead[nsp];
+  freeListHead[nsp]         = freeListHead[nsp]->next;
+  newListElem->next         = NULL;
+  resH                      = newListElem->resH;
+  newListElem->val          = p;
+  newListElem->ops          = ops;
+  newListElem->status       = ASSIGNED;
+
+  LIST_UNLOCK();
+
+  return resH;
+}
+
+/**************************************************************/
+
+void reshRemove ( cdiResH resH, resOps * ops )
+{
+  int nsp;
+  namespaceTuple_t nspT;
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  nspT = namespaceResHDecode ( resH );
+
+  xassert ( nspT.nsp == nsp &&
+            nspT.idx >= 0 &&
+            nspT.idx < listSizeAllocated[nsp] &&
+            listResources[nsp][nspT.idx].ops &&
+            listResources[nsp][nspT.idx].ops == ops );
+
+  listResources[nsp][nspT.idx].next   = freeListHead[nsp];
+  listResources[nsp][nspT.idx].ops    = NULL;
+  listResources[nsp][nspT.idx].val    = NULL;
+  listResources[nsp][nspT.idx].status = RESH_UNDEFID;
+  freeListHead[nsp]                   = listResources[nsp] + nspT.idx;
+
+  LIST_UNLOCK();
+}
+
+/**************************************************************/
+
+void *reshGetVal ( cdiResH resH, resOps * ops  )
+{
+  int nsp;
+  namespaceTuple_t nspT;
+  listElem_t * listElem;
+
+  xassert ( ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  nspT = namespaceResHDecode ( resH );
+
+  if (nspT.nsp == nsp &&
+      nspT.idx >= 0 &&
+      nspT.idx < listSizeAllocated[nsp])
+    {
+      listElem = listResources[nsp] + nspT.idx;
+      LIST_UNLOCK();
+    }
+  else
+    {
+      LIST_UNLOCK();
+      xabort("Invalid namespace %d or index %d for resH %d!", nspT.nsp, nspT.idx, (int)resH);
+    }
+
+  xassert(listElem && listElem->ops == ops);
+
+  return listElem->val;
+}
+
+/**************************************************************/
+
+void reshGetResHListOfType ( int c, int * resHs, resOps * ops )
+{
+  int i, j = 0, nsp;
+
+  xassert ( resHs && ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  for ( i = 0; i < listSizeAllocated[nsp]; i++ )
+    if ( listResources[nsp][i].val && listResources[nsp][i].ops )
+      if ( listResources[nsp][i].ops == ops )
+        {
+          resHs[j++] = namespaceIdxEncode2 ( nsp, i );
+          if ( j == c ) break;
+        }
+
+  LIST_UNLOCK();
+}
+
+/**************************************************************/
+
+int reshCountType ( resOps * ops )
+{
+  int i, nsp, countType = 0;
+
+  xassert ( ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  for ( i = 0; i < listSizeAllocated[nsp]; i++ )
+    if ( listResources[nsp][i].val )
+      if ( listResources[nsp][i].ops == ops )
+        countType++;
+
+  LIST_UNLOCK();
+
+  return countType;
+}
+
+/**************************************************************/
+
+#ifdef USE_MPI
+static
+int  getPackBufferSize ( MPI_Comm comm )
+{
+  int nsp, i;
+  int packBufferSize = 0;
+  int intpacksize;
+  listElem_t * curr;
+
+  nsp = namespaceGetActive ();
+
+  xmpi ( MPI_Pack_size ( 1, MPI_INT, comm, &intpacksize ));
+
+  /* pack start marker, namespace and sererator marker */
+  packBufferSize += 3 * intpacksize;
+
+  /* pack resources, type marker and seperator marker */
+  for ( i = 0; i < listSizeAllocated[nsp]; i++ )
+    if ( listResources[nsp][i].val )
+      if ( listResources[nsp][i].status == ASSIGNED )
+        {
+          curr = listResources[nsp] + i;
+          xassert ( curr->ops );
+
+          /* message plus frame of 2 ints */
+          packBufferSize += curr->ops->valGetPackSize ( curr->val, comm )
+            + 2 * intpacksize;
+        }
+
+  /* end marker */
+  packBufferSize += intpacksize;
+
+  return packBufferSize;
+}
+
+/**************************************************************/
+
+void reshPackBufferDestroy ( char ** buffer )
+{
+  if ( buffer ) free ( *buffer );
+}
+
+/**************************************************************/
+
+void reshPackBufferCreate ( char ** packBuffer, int * packBufferSize, MPI_Comm comm )
+{
+  int i, nsp, packBufferPos = 0;
+  int start = START, end = END, sep = SEPARATOR, type;
+  listElem_t * curr;
+
+  xassert ( packBuffer );
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  * packBufferSize = getPackBufferSize ( comm );
+  * packBuffer = xcalloc ( 1, * packBufferSize );
+
+  xmpi ( MPI_Pack ( &start, 1,  MPI_INT,
+		    * packBuffer, * packBufferSize, &packBufferPos, comm ));
+
+  xmpi ( MPI_Pack ( &nsp, 1,  MPI_INT,
+		    * packBuffer, * packBufferSize, &packBufferPos, comm ));
+
+  xmpi ( MPI_Pack ( &sep, 1,  MPI_INT,
+		    * packBuffer, * packBufferSize, &packBufferPos, comm ));
+
+  for ( i = 0; i < listSizeAllocated[nsp]; i++ )
+    if ( listResources[nsp][i].val )
+      if ( listResources[nsp][i].status == ASSIGNED )
+        {
+          curr = listResources[nsp] + i;
+          xassert ( curr->ops );
+
+          type = curr->ops->valTxCode ();
+
+          if ( ! type ) continue;
+
+          xmpi ( MPI_Pack ( &type, 1, MPI_INT, * packBuffer,
+			    * packBufferSize, &packBufferPos, comm ));
+
+          curr->ops->valPack ( curr->val,
+                               * packBuffer ,
+                               * packBufferSize,
+                               &packBufferPos,
+                               comm );
+
+          xmpi ( MPI_Pack ( &sep, 1,  MPI_INT, * packBuffer,
+			    * packBufferSize, &packBufferPos, comm ));
+
+          curr->status = CLOSED;
+        }
+
+  LIST_UNLOCK();
+
+  xmpi ( MPI_Pack ( &end, 1,  MPI_INT,
+                  * packBuffer, * packBufferSize, &packBufferPos, comm ));
+}
+
+#endif
+
+/**************************************************************/
+
+/* for thread safety this feature would have to be integrated in reshPut */
+
+void reshSetStatus ( cdiResH resH, resOps * ops, int status )
+{
+  int nsp;
+  namespaceTuple_t nspT;
+  listElem_t * listElem;
+
+  xassert ( ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  nspT = namespaceResHDecode ( resH );
+
+  xassert ( nspT.nsp == nsp &&
+            nspT.idx >= 0 &&
+            nspT.idx < listSizeAllocated[nsp] );
+
+  listElem = listResources[nsp] + nspT.idx;
+
+  xassert ( listElem &&
+            listElem->ops == ops );
+
+  listElem->status = status;
+
+  LIST_UNLOCK();
+}
+
+/**************************************************************/
+
+int reshGetStatus ( cdiResH resH, resOps * ops )
+{
+  int nsp;
+  namespaceTuple_t nspT;
+  listElem_t * listElem;
+
+  xassert ( ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  nspT = namespaceResHDecode ( resH );
+
+  xassert ( nspT.nsp == nsp &&
+            nspT.idx >= 0 &&
+            nspT.idx < listSizeAllocated[nsp] );
+
+  listElem = listResources[nsp] + nspT.idx;
+
+  LIST_UNLOCK();
+
+  xassert ( listElem &&
+            listElem->ops == ops );
+
+  return listElem->status;
+}
+
+/**************************************************************/
+
+void reshLock ()
+{
+  LIST_LOCK();
+}
+
+/**************************************************************/
+
+void reshUnlock ()
+{
+  LIST_UNLOCK();
+}
+
+/**************************************************************/
+
+int reshListCompare ( int nsp0, int nsp1 )
+{
+  const int equal  = 0;
+#ifdef USE_MPI
+  const int differ = -1;
+  int i, valCompare;
+  listElem_t * listElem0, * listElem1;
+
+
+  LIST_INIT();
+
+  xassert(namespaceGetNumber () > xmaxInt ( nsp0, nsp1 ) &&
+          xminInt ( nsp0, nsp1 ) >= 0 );
+
+  for ( i = 0; i < listSizeAllocated[nsp0]; i++ )
+    {
+      listElem0 = listResources[nsp0] + i;
+      if ( listElem0->val )
+	{
+	  if ( i >= listSizeAllocated[nsp1] )
+	    {
+	      xdebug("%s", "");
+	      return differ;
+	    }
+
+	  listElem1 = listResources[nsp1] + i;
+	  if ( !listElem1->val )
+	    {
+	      xdebug("%s", "");
+	      return differ;
+	    }
+
+	  xassert ( listElem0->ops && listElem1->ops );
+	  if ( listElem0->ops != listElem1->ops )
+	    {
+	      xdebug("%s", "");
+	      return differ;
+	    }
+
+	  valCompare =  listElem0->ops->valCompare ( listElem0->val, listElem1->val );
+	  printf ( "type %d, values resH0=%d and resH1=%d %s\n", 
+		   listElem0->ops->valTxCode (), 
+		   listElem0->resH, 
+		   listElem1->resH,
+		   valCompare == equal ? "are equal" : "differ" );
+	  if ( valCompare != equal ) return differ;
+	}
+      else if ( listResources[nsp1][i].val )
+	return differ;
+    }
+
+  for ( ; i < listSizeAllocated[nsp1]; i++ )
+    if ( listResources[nsp1][i].val )
+      {
+	xdebug("%s", "");
+	return differ;
+      }
+
+#endif
+
+  return equal;
+}
+
+/**************************************************************/
+
+void reshListPrint ( char * filename )
+{
+  int i, j, temp;
+  listElem_t * curr;
+  FILE * fp;
+
+  LIST_INIT();
+
+#ifdef USE_MPI
+  {
+    int root = 0;
+    if ( commInqIsProcIO () == 0 )
+      {
+        if (  commInqRankModel () != root )  return;
+      }
+    else if ( commInqRankPio () != root ) return;
+  }
+#endif
+
+  if ( filename )
+    {
+      fp = fopen ( filename, "w" );
+      if ( ! fp )
+	{
+	  xdebug("%s", "could not open file" );
+	  fp = stdout;
+	}
+    }
+  else
+    fp = stdout;
+
+  temp = namespaceGetActive ();
+
+  fprintf ( fp, "\n\n##########################################\n#\n#  print " \
+            "global resource list \n#\n" );
+
+  for ( i = 0; i < namespaceGetNumber (); i++ )
+    {
+      pioNamespaceSetActive ( i );
+
+      fprintf ( fp, "\n" );
+      fprintf ( fp, "##################################\n" );
+      fprintf ( fp, "#\n" );
+      fprintf ( fp, "# namespace=%d\n", i );
+      fprintf ( fp, "#\n" );
+      fprintf ( fp, "##################################\n\n" );
+
+      fprintf ( fp, "listSizeAllocated[%d]=%d\n", i, listSizeAllocated[i] );
+
+      for ( j = 0; j < listSizeAllocated[i]; j++ )
+        {
+          curr = listResources[i] + j;
+          if ( curr->ops && curr->val )
+            {
+              curr->ops->valPrint (( void * ) curr->val, fp );
+              fprintf ( fp, "\n" );
+            }
+        }
+    }
+  fprintf ( fp, "#\n#  end global resource list" \
+            "\n#\n##########################################\n\n" );
+
+  fclose ( fp );;
+  pioNamespaceSetActive ( temp );
+}
+
+
+void cdiReset(void)
+{
+  LIST_LOCK();
+
+  listDestroy();
+
+  listNew ();
+
+  listInitPointer ();
+
+  LIST_UNLOCK();
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifdef HAVE_CONFIG_H
+#endif
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+static
+char commands[][13] = { "FINALIZE\0",
+                        "RESOURCES\0",
+                        "WINCREATE\0",
+                        "WRITETS\0"};
+
+
+void pcdiAssert   ( bool assumption, const char * filename,
+                    const char * functionname, int line )
+{
+  if ( !assumption )
+    {
+#ifdef USE_MPI
+      int rank = -1, init_flag = 0;
+      if (MPI_Initialized(&init_flag) == MPI_SUCCESS && init_flag)
+        MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+      fprintf ( stderr, "ERROR, FALSE ASSUMPTION: PE%d in %s, %s, line %d\n",
+                rank, functionname, filename, line );
+      fflush ( stderr );
+      if (init_flag)
+        MPI_Abort ( MPI_COMM_WORLD, 1 );
+      else
+        abort();
+#else
+      fprintf ( stderr, "ERROR, FALSE ASSUMPTION, %s, %s, line %d\n",
+                functionname, filename, line );
+      fflush ( stderr );
+      abort();
+#endif
+    }
+}
+
+/****************************************************/
+
+void pcdiAbort(const char * filename, const char *functionname, int line,
+               const char * errorString, ... )
+{
+  va_list ap;
+  va_start(ap, errorString);
+#ifdef USE_MPI
+  {
+    int rank;
+    MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+    fprintf(stderr, "ERROR, pe%d in %s, %s, line %d, errorString: \"",
+            rank, functionname, filename, line);
+  }
+  vfprintf(stderr, errorString, ap);
+  fputs("\"\n", stderr);
+  MPI_Abort ( MPI_COMM_WORLD, 1 );
+#else
+  fprintf(stderr, "ERROR, %s, %s, line %d, errorString: \"",
+          functionname, filename, line);
+  vfprintf(stderr, errorString, ap);
+  fputs("\"\n", stderr);
+#endif
+  exit ( EXIT_FAILURE );
+  va_end(ap);
+}
+
+/*****************************************************************************/
+
+void * pcdiXmalloc ( size_t size, const char *filename, const char *functionname,
+		     int line )
+{
+  void * value = calloc (1, size );
+
+  if ( value == NULL )
+    pcdiAbort (filename, functionname, line, "malloc failed: %s",
+               strerror(errno));
+
+  return value;
+}
+
+void * pcdiXcalloc ( size_t nmemb, size_t size, const char *filename,
+		     const char *functionname, int line )
+{
+  void * value = calloc ( nmemb, size );
+
+  if ( value == NULL )
+    pcdiAbort (filename, functionname, line, "calloc failed: %s",
+               strerror(errno) );
+
+  return value;
+}
+
+void * pcdiXrealloc ( void *p, size_t size, const char *functionname,
+		      const char *filename, int line )
+{
+  void * value = realloc ( p, size );
+
+  if ( value == NULL )
+    pcdiAbort(filename, functionname, line, "realloc failed: %s",
+              strerror(errno));
+
+  return value;
+}
+
+/***************************************************************/
+
+#ifdef USE_MPI
+void pcdiXMPI ( int iret, const char *filename, int line )
+{
+  char errorString[2][MPI_MAX_ERROR_STRING + 1];
+  int len, errorClass, rank;
+
+  if ( iret != MPI_SUCCESS )
+    {
+      MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+
+      MPI_Error_class ( iret, &errorClass );
+      MPI_Error_string ( errorClass, errorString[0], &len );
+      errorString[0][len] = '\0';
+      MPI_Error_string ( iret, errorString[1], &len);
+      errorString[1][len] = '\0';
+
+      fprintf ( stderr, "MPI ERROR, pe%d, %s, line %d,"
+                "errorClass: \"%s\""
+                "errorString: \"%s\"\n",
+                rank, filename, line,
+                errorString[0], errorString[1]);
+
+      MPI_Abort ( MPI_COMM_WORLD, iret );
+    }
+}
+
+/*****************************************************************************/
+
+void pcdiXMPIStat ( int iret, const char *filename, int line, MPI_Status *status )
+{
+  char errorString[MPI_MAX_ERROR_STRING + 1];
+  int len, rank;
+
+  MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+
+  if ( iret == MPI_ERR_IN_STATUS )
+    {
+      switch ( status->MPI_ERROR )
+        {
+          fprintf ( stderr, "------- checking error in request ----------\n" );
+        case MPI_SUCCESS :
+          fprintf ( stderr, "-------- mpi_success -----------\n" );
+          break;
+        case MPI_ERR_PENDING:
+          fprintf ( stderr, "-------- mpi_err_pending ----------\n");
+          break;
+        default:
+          MPI_Error_string ( status->MPI_ERROR, errorString, &len );
+          errorString[len] = '\0';
+          fprintf ( stderr,"MPI ERROR in request, pe%d, %s, line %d,"
+                    "return value: %d, error_string: %s\n",
+                    rank, filename, line, iret, errorString );
+          MPI_Abort ( MPI_COMM_WORLD, iret );
+        }
+    }
+  else
+    xmpi ( iret );
+
+  return;
+}
+#endif
+
+/****************************************************/
+
+#ifdef USE_MPI
+void pcdiDebugComm ( const char *filename, const char *functionname, int line, MPI_Comm *comm )
+{
+  int rank, size, len, rankGlob;
+  char *name;
+
+  name = ( char * ) xmalloc ( MPI_MAX_OBJECT_NAME );
+  memset ( name, 0, ( MPI_MAX_OBJECT_NAME ) * sizeof ( char ));
+  MPI_Comm_get_name ( * comm, name, &len );
+  MPI_Comm_size ( * comm, &size );
+  MPI_Comm_rank ( * comm, &rank );
+  MPI_Comm_rank ( MPI_COMM_WORLD, &rankGlob );
+  fprintf ( stdout,
+            "pe%d in %s, %s, line %d: comm: name=%s, size=%d, rank=%d\n",
+            rankGlob, functionname, filename, line,
+            name, size, rank );
+  free ( name );
+
+}
+#endif
+
+/****************************************************/
+
+#ifdef USE_MPI
+void pcdiDebugMsg ( const char * cdiPioDebugString, const char *filename,
+                    const char *functionname, int line, int tag, int source,
+                    int nfinished )
+{
+  int rank;
+
+  MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+
+  fprintf ( stdout,
+            "%s pe%d in %s, %s, line %d: command %s, source %d, finalized=%d\n",
+            cdiPioDebugString, rank, functionname, filename, line,
+            &commands[tag][0], source, nfinished );
+}
+#endif
+/****************************************************/
+
+#ifdef USE_MPI
+void pcdiDebugMsg2 ( const char *filename, const char *functionname, int line,
+                   int tag, int source, char * text )
+{
+  int rank;
+
+  MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+
+  fprintf ( stdout,
+            "pe%d in %s, %s, line %d: command %s, source %d, %s\n",
+            rank, functionname, filename, line,
+            &commands[tag][0], source, text );
+}
+#endif
+
+
+/****************************************************/
+
+
+int xmaxInt ( int a, int b )
+{
+  return a >= b ? a : b;
+}
+
+
+/****************************************************/
+
+
+int xminInt ( int a, int b )
+{
+  return a <= b ? a : b;
+}
+
+
+/****************************************************/
+
+
+int xsum ( int n, int * argarray )
+{
+  int i, sum = 0;
+
+  for ( i = 0; i < n; i++ )
+    sum += * ( argarray + i );
+
+  return sum;
+}
+
+
+/****************************************************/
+
+
+double xchecksum ( int type, int count, void * buffer )
+{
+  return 0.0;
+}
+
+
+/****************************************************/
+
+void printArray ( const char * cdiPioDebugString, char * ps, const void * array, int n,
+                  int datatype, const char * funname, const char * filename, int line )
+{
+  int i, rank;
+  int * iArray;
+  double * dArray;
+
+#ifdef USE_MPI
+  {
+    int init_flag;
+    if (MPI_Initialized(&init_flag) == MPI_SUCCESS && init_flag)
+      MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+    else
+      rank = -1;
+  }
+  fprintf ( stdout, "%s pe%d in %s, %s, line %d: %s = ",
+	    cdiPioDebugString, rank, funname, filename, line, ps );
+#else
+  fprintf ( stdout, "%s %s, %s, line %d: %s = ",
+	    cdiPioDebugString, funname, filename, line, ps );
+#endif
+
+  switch ( datatype )
+    {
+    case DATATYPE_INT:
+      iArray = ( int * ) array;
+      for ( i = 0; i < n-1; i++ )
+	fprintf ( stdout, "%d ", * ( iArray + i ));
+      fprintf ( stdout, "%d\n", * ( iArray + n - 1 ));
+      break;
+    case DATATYPE_FLT:
+      dArray = ( double * ) array;
+      for ( i = 0; i < n-1; i++ )
+	fprintf ( stdout, "%.2f ", * ( dArray + i ));
+      fprintf ( stdout, "%.2f\n", * ( dArray + n-1 ));
+      break;
+    default:
+      fprintf ( stdout, " ... no datatype defined\n" );
+    }
+
+  return;
+}
+
+/****************************************************/
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+#ifdef USE_MPI
+
+
+char * command2charP[6] = {"IO_Open_file", "IO_Close_file",
+                           "IO_Get_fp","IO_Set_fp",
+                           "IO_Send_buffer", "IO_Finalize"};
+
+long initial_buffersize = 16 * 1024 * 1024;
+/*  4 KB <= x < 256 MB */
+/* 16 * 1024 * 1024; */
+/* 16 * 1024; */
+/* 4 * 1024; */
+
+enum {
+  tagKey = 100,
+};
+
+double accumProbe   = 0.0;
+double accumRecv    = 0.0;
+double accumSend    = 0.0;
+double accumSuspend = 0.0;
+double accumWait    = 0.0;
+double accumWrite   = 0.0;
+
+char *token = "%";
+
+/***************************************************************/
+
+int encodeFileOpTag(int ID, int sc)
+{
+  return ID * tagKey + sc;
+}
+
+/***************************************************************/
+
+struct fileOpTag decodeFileOpTag(int tag)
+{
+  struct fileOpTag rtag;
+
+  rtag.id = tag / tagKey;
+  rtag.command = tag % tagKey;
+
+  return rtag;
+}
+
+/***************************************************************/
+
+size_t pioFileWrite ( int fileID, int tsID, const void *buffer, size_t len )
+{
+  size_t iret = CDI_UNDEFID;
+
+  switch ( commInqIOMode ())
+    {
+    case PIO_MPI:
+      iret = fwMPINONB ( fileID, tsID, buffer, len );
+      break;
+#ifndef _SX
+    case PIO_ASYNCH:
+#endif
+    case PIO_WRITER:
+      iret = pioSendWrite(fileID, tsID, buffer, len);
+      break;
+    case PIO_FPGUARD:
+      iret = fwPOSIXFPGUARDSENDRECV ( fileID, tsID, buffer, len );
+      break;
+    }
+
+  return iret;
+}
+
+/***************************************************************/
+
+int pioFileClose ( int id )
+{
+  int iret = CDI_UNDEFID;
+  switch ( commInqIOMode ())
+    {
+    case PIO_MPI:
+      iret = fcMPINONB ( id );
+      break;
+#ifndef _SX
+    case PIO_ASYNCH:
+#endif
+    case PIO_WRITER:
+      iret = pioSendClose(id);
+      break;
+    case PIO_FPGUARD:
+      iret = fcPOSIXFPGUARDSENDRECV ( id );
+      break;
+    }
+
+  return iret;
+}
+
+/***************************************************************/
+
+int pioFileOpenW ( const char *filename )
+{
+  int iret = CDI_UNDEFID;
+
+  switch ( commInqIOMode ())
+    {
+    case PIO_MPI:
+      iret = fowMPINONB ( filename );
+      break;
+#ifndef _SX
+    case PIO_ASYNCH:
+#endif
+    case PIO_WRITER:
+      iret = pioSendOpen(filename);
+      break;
+    case PIO_FPGUARD:
+      iret = fowPOSIXFPGUARDSENDRECV ( filename );
+      break;
+    }
+
+  return iret;
+}
+
+/***************************************************************/
+
+void backendInit ( void )
+{
+  int IOMode = commInqIOMode ();
+
+  commDefCommNode ();
+
+  xassert ( IOMode != PIO_NONE  || commInqSizeNode () == 1 );
+
+  switch ( IOMode )
+    {
+    case PIO_NONE:
+      commDefCommColl ( 1 );
+      commSendNodeInfo ();
+      commRecvNodeMap ();
+      commDefCommsIO ();
+      break;
+    case PIO_MPI:
+      initMPINONB ();
+      break;
+#ifndef _SX
+    case PIO_ASYNCH:
+#endif
+    case PIO_WRITER:
+      pioSendInitialize();
+      break;
+    case PIO_FPGUARD:
+      initPOSIXFPGUARDSENDRECV ();
+      break;
+    }
+}
+
+/***************************************************************/
+
+void backendCleanup ( void )
+{
+  int IOMode = commInqIOMode ();
+  switch ( IOMode )
+    {
+    case PIO_NONE:
+      break;
+    case PIO_MPI:
+      finalizeMPINONB ();
+      break;
+#ifndef _SX
+    case PIO_ASYNCH:
+#endif
+    case PIO_WRITER:
+      pioSendFinalize();
+      break;
+    case PIO_FPGUARD:
+      finalizePOSIXFPGUARDSENDRECV ();
+      break;
+    default:
+      xdebug("%s", " BACKENDCLEANUP FUNCTION NOT IMPLEMENTED YET.");
+    }
+}
+
+/***************************************************************/
+
+void backendFinalize ( void )
+{
+  commDestroy ();
+  MPI_Finalize ();
+  exit ( EXIT_SUCCESS );
+}
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifdef HAVE_CONFIG_H
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+
+#ifdef USE_MPI
+extern resOps streamOps;
+
+
+static struct rdmaWin
+{
+  size_t size;
+  unsigned char *buffer, *head;
+  MPI_Win win;
+  int postSet, refuseFuncCall;
+  MPI_Group ioGroup;
+} *txWin = NULL;
+
+
+char * funcMap[nFuncs] = {"streamOpen", "streamDefVlist", "streamClose" };
+
+
+/****************************************************/
+
+static int cmp ( const void * va, const void * vb )
+{
+    const int ** a, ** b;
+
+  a = ( const int ** ) va;
+  b = ( const int ** ) vb;
+
+  return (( **a < **b ) - ( **a > **b ));
+}
+
+/****************************************************/
+
+static void
+mapProblems(int problemSizes[], int * problemMapping, int nProblems,
+            int nWriter, double * w)
+{
+  int *ip[nProblems];
+  int dummy[nProblems];
+  int buckets[nWriter];
+  int currCapacity, nextCapacity;
+  double meanBucket[nWriter];
+  int sum = 0;
+  int writerIdx = 0;
+  int i, j;
+
+
+  for ( i = 0; i < nProblems; i++ )
+    {
+      ip[i] = &problemSizes[i];
+      sum += problemSizes[i];
+    }
+
+  qsort ( ip, nProblems, sizeof ( int * ), cmp );
+
+  for ( i = 0; i < nProblems; i++ )
+    dummy[i] = ip[i] - problemSizes;
+
+  for ( j = 0; j < nWriter; j++ )
+    meanBucket[j] = ( double ) sum * ( * ( w + j ));
+
+  for ( i = 0; i < nProblems; i++ )
+    {
+      currCapacity = INT_MIN;
+
+      for ( j = 0; j < nWriter; j++ )
+	{
+	  if ( !i ) buckets[j] = 0.0;
+	  nextCapacity = meanBucket[j] - ( buckets[j] + ( *ip[i] ));
+
+	  if ( nextCapacity > currCapacity )
+	    {
+	      currCapacity = nextCapacity;
+	      writerIdx = j;
+	    }
+	}
+      problemMapping[ dummy[i] ] = writerIdx;
+      buckets[writerIdx] +=  *ip[i];
+    }
+
+  xprintArray3 (  "problemSizes = ", problemSizes, nProblems, DATATYPE_INT );
+  xprintArray3 ( "vector of indices, qsort of problemSizes", dummy,
+                nProblems, DATATYPE_INT );
+  xprintArray3 ( "problemMapping", problemMapping, nProblems, DATATYPE_INT );
+  xprintArray3 ( "meanBucket", meanBucket, nWriter, DATATYPE_FLT );
+  xprintArray3 ( "actual buckets", buckets, nWriter, DATATYPE_INT );
+}
+
+/****************************************************/
+
+/**
+   @brief is encapsulated in CDI library.
+
+   @param vSizes array with number of levels for all var_t 's in order of streams
+
+   @param sSizes array with number of var_t for all stream_t 's
+
+   @param varMapping return value, array with ranks of I/O PEs assigned to var_t 's
+in order of vSizes
+
+   @param nStreams number of stream_t 's
+
+   @param nodeSizes array of number of I/O PEs on each physical nodes, increasing
+   order of ranks assumed
+
+   @param nNodes number of physical nodes hosting I/O PEs
+
+   @return
+*/
+
+static void
+varMapGen(int *vSizes, int *sSizes, int *varMapping,
+          int nStreams, int *nodeSizes, int nNodes)
+{
+
+  int weightsStreams[nStreams];
+  int streamMapping[nStreams];
+  int nPEs = 0, nVars = 0;
+  int i, j, k, offset = 0, offsetN = 0;
+  double * w;
+
+  int * weightsVarsNode;
+  int * varMappingNode;
+  int nVarsNode, summandRank = 0;
+  int nProcsColl = commInqNProcsColl ();
+
+  int buckets[nProcsColl];
+
+  for ( i = 0; i < nStreams; i++ )
+    {
+      nVars += * ( sSizes + i );
+      weightsStreams[i] = 0;
+      for ( j = 0; j < * ( sSizes + i ); j++ )
+	weightsStreams[i] += * ( vSizes + offset++ );
+    }
+
+  w = ( double * ) xmalloc ( nNodes * sizeof ( double ));
+  for ( j = 0; j < nNodes; j++ )
+    nPEs += * ( nodeSizes + j );
+
+  for ( j = 0; j < nNodes; j++ )
+    w[j] = ( double ) * ( nodeSizes + j ) / ( double ) nPEs;
+
+  mapProblems ( weightsStreams, streamMapping, nStreams, nNodes, w );
+  free ( w );
+
+  for ( i = 0; i < nNodes; i++ )
+    {
+      nVarsNode = 0;
+      for ( j = 0; j < nStreams; j++ )
+	if ( * ( streamMapping + j ) == i )
+	  nVarsNode += * ( sSizes + j );
+
+      weightsVarsNode = ( int * ) xmalloc ( nVarsNode * sizeof ( int ));
+      varMappingNode = ( int * ) xmalloc ( nVarsNode * sizeof ( int ));
+      w = ( double * ) xmalloc ( * ( nodeSizes + i ) * sizeof ( double ));
+      offset = 0;
+      offsetN = 0;
+
+      for ( j = 0; j < nStreams; j++ )
+	if ( * ( streamMapping + j ) == i )
+	  for ( k = 0; k < * ( sSizes + j ); k ++ )
+	    * ( weightsVarsNode + offsetN++ ) = * ( vSizes + offset++ );
+	else
+	  offset += * ( sSizes + j );
+
+      for ( j = 0; j < * ( nodeSizes + i ); j ++ )
+	w[j] = 1.0 / ( double ) * ( nodeSizes + i );
+
+      mapProblems ( weightsVarsNode, varMappingNode, nVarsNode,
+		    * ( nodeSizes + i ),  w );
+
+      offset = 0;
+      offsetN = 0;
+
+      for ( j = 0; j < nStreams; j++ )
+	if ( * ( streamMapping + j ) == i )
+	  for ( k = 0; k < * ( sSizes + j ); k ++ )
+	    * ( varMapping + offset ++ ) =
+              commCollID2RankGlob ( * ( varMappingNode + offsetN ++ ) +
+                                    summandRank );
+	else
+	  offset += * ( sSizes + j );
+
+      summandRank += * ( nodeSizes + i );
+
+      free ( w );
+      free ( varMappingNode );
+      free ( weightsVarsNode );
+    }
+
+  if ( ddebug )
+    {
+      xprintArray ( "varMapping", varMapping, nVars, DATATYPE_INT  );
+      for ( i = 0; i < nProcsColl; i++ )
+	buckets[i] = 0;
+      for ( i = 0; i < nVars; i ++ )
+	buckets[commRankGlob2CollID ( *(varMapping + i ))] += * ( vSizes + i );
+      xprintArray ( "buckets", buckets, nProcsColl, DATATYPE_INT );
+    }
+}
+
+/************************************************************************/
+
+static void
+defVarDeco(int vlistID, int varID)
+{
+  int varSize, cRank, lChunk, rem, lOffset;
+  int nProcsModel = commInqNProcsModel ();
+  deco_t deco[nProcsModel];
+
+  varSize = vlistInqVarSize ( vlistID, varID );
+
+  for ( cRank = 0; cRank < nProcsModel; cRank++ )
+    {
+      lChunk = varSize / nProcsModel;
+      lOffset = cRank * lChunk;
+      rem = varSize % nProcsModel;
+      if ( cRank < rem )
+        {
+          lChunk++;
+          lOffset += cRank;
+        }
+      else
+        lOffset += rem;
+
+      deco[cRank].rank   = cRank;
+      deco[cRank].offset = lOffset;
+      deco[cRank].chunk  = lChunk;
+    }
+  vlistDefVarDeco ( vlistID, varID, nProcsModel, &deco[0] );
+}
+
+/************************************************************************/
+
+
+static void
+varsMapNDeco(int nNodes, int *nodeSizes)
+{
+  int nStreams, nVars, * resHs, * streamSizes, * varSizes, * varMapping,
+    * collectsData;
+  int i, j, k = 0;
+  int nProcsColl = commInqNProcsColl ();
+  char text[1024];
+
+  xdebug ( "START, nProcsColl=%d", nProcsColl );
+
+  nStreams = streamSize ();
+
+  resHs       = xmalloc ( nStreams * sizeof ( resHs[0] ));
+  streamSizes = xmalloc ( nStreams * sizeof ( streamSizes[0] ));
+  collectsData = xmalloc ( nProcsColl * sizeof ( collectsData[0] ));
+  streamGetIndexList ( nStreams, resHs );
+
+  for ( i = 0; i < nStreams; i++ )
+    streamSizes[i] = streamInqNvars ( * ( resHs + i ));
+
+  nVars = xsum ( nStreams, streamSizes );
+  varSizes   = xmalloc ( nVars * sizeof ( varSizes[0] ));
+  varMapping = xmalloc ( nVars * sizeof ( varMapping[0] ));
+
+  for ( i = 0; i < nStreams; i++ )
+    for ( j = 0; j < * ( streamSizes + i ); j++ )
+      varSizes[k++] += vlistInqVarSize ( streamInqVlist ( * ( resHs + i )), j );
+
+  xassert ( k == nVars );
+
+  varMapGen ( varSizes, streamSizes, varMapping,
+	      nStreams, nodeSizes, nNodes );
+
+  k = 0;
+  for ( i = 0; i < nStreams; i++ )
+    for ( j = 0; j < * ( streamSizes + i ); j++ )
+      {
+        defVarDeco ( streamInqVlist ( *( resHs + i )), j );
+        defVarDeco ( streamInqVlistIDorig ( * ( resHs + i )), j );
+        vlistDefVarIOrank ( streamInqVlist ( * ( resHs + i )), j,
+                            * ( varMapping + k ));
+        vlistDefVarIOrank ( streamInqVlistIDorig ( * ( resHs + i )), j,
+                            * ( varMapping + k ));
+        collectsData[commRankGlob2CollID ( varMapping[k++] )] = 1;
+      }
+
+  for ( j = 0; j < nProcsColl; j++ )
+    if ( collectsData[j] == 0 )
+      {
+        sprintf ( text,
+                  "\nAT LEAST ONE COLLECTOR PROCESS IDLES, "
+                  "CURRENTLY NOT COVERED: "
+                  "PE%d collects no data",
+                  commCollID2RankGlob ( j ));
+        xabort ( text );
+      }
+
+  if ( varMapping )   free ( varMapping );
+  if ( varSizes )     free ( varSizes );
+  if ( collectsData ) free ( collectsData );
+  if ( streamSizes )  free ( streamSizes );
+  if ( resHs )        free ( resHs );
+
+  xdebug("%s", "RETURN");
+}
+
+/************************************************************************/
+
+static
+void modelWinCleanup ( void )
+{
+  int collID;
+
+  xdebug("%s", "START");
+  if (txWin != NULL)
+    for ( collID = 0; collID < commInqNProcsColl (); collID ++ )
+      {
+        if (txWin[collID].postSet)
+          xmpi(MPI_Win_wait(txWin[collID].win));
+        xmpi(MPI_Win_free(&txWin[collID].win));
+        xmpi ( MPI_Free_mem ( txWin[collID].buffer ));
+        xmpi(MPI_Group_free(&txWin[collID].ioGroup));
+      }
+
+  if (txWin) free(txWin);
+
+  xdebug("%s", "RETURN. CLEANED UP MPI_WIN'S");
+}
+
+/************************************************************************/
+
+static void
+modelWinDefBufferSizes(void)
+{
+  int collID, nstreams, * streamIndexList, streamNo, vlistID, nvars, varID;
+  int collIDchunk = 0, sumWinBufferSize = 0;
+  int nProcsColl  = commInqNProcsColl ();
+  int rankGlob    = commInqRankGlob ();
+  int rankModel   = commInqRankModel ();
+  int root = commInqRootGlob ();
+
+  xdebug("%s", "START");
+  xassert(txWin != NULL);
+
+  nstreams = reshCountType ( &streamOps );
+  streamIndexList = xmalloc ( nstreams * sizeof ( streamIndexList[0] ));
+  reshGetResHListOfType ( nstreams, streamIndexList, &streamOps );
+  for ( streamNo = 0; streamNo < nstreams; streamNo++ )
+    {
+      // space required for data
+      vlistID = streamInqVlist ( streamIndexList[streamNo] );
+      nvars = vlistNvars ( vlistID );
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          collID = CDI_UNDEFID;
+          collID = commRankGlob2CollID ( vlistInqVarIOrank ( vlistID, varID ));
+          collIDchunk = vlistInqVarDecoChunk ( vlistID, varID, rankModel );
+          xassert ( collID != CDI_UNDEFID && collIDchunk > 0 );
+          txWin[collID].size += collIDchunk * sizeof (double) +
+            winBufferOverheadChunk * sizeof (int);
+        }
+
+      // space required for the 3 function calls streamOpen, streamDefVlist, streamClose
+      // once per stream and timestep for all collprocs only on the modelproc root
+      if ( rankGlob == root )
+        for ( collID = 0; collID < nProcsColl; collID++ )
+          txWin[collID].size += 3 * winBufferOverheadFuncCall * sizeof (int)
+            + 5 * sizeof (int) + MAXDATAFILENAME;
+    }
+  free ( streamIndexList );
+
+  for ( collID = 0; collID < nProcsColl; collID++ )
+    {
+      txWin[collID].size += winBufferOverhead * sizeof (int);
+      sumWinBufferSize += txWin[collID].size;
+    }
+  xdebug("sumWinBufferSize=%zu, MAXWINBUFFERSIZE=%zu", (size_t)sumWinBufferSize,
+         (size_t)MAXWINBUFFERSIZE);
+  xassert ( sumWinBufferSize <= MAXWINBUFFERSIZE );
+  /* xprintArray("txWin.size", txWin, nProcsColl, DATATYPE_INT); */
+  xdebug("%s", "RETURN");
+}
+
+
+/************************************************************************/
+
+
+static
+  void modelWinFlushBuffer ( int collID )
+{
+  int nProcsColl = commInqNProcsColl ();
+
+  xassert ( collID                >= 0         &&
+            collID                < nProcsColl &&
+            txWin[collID].buffer     != NULL      &&
+            txWin != NULL      &&
+            txWin[collID].size >= 0         &&
+            txWin[collID].size <= MAXWINBUFFERSIZE);
+  memset(txWin[collID].buffer, 0, txWin[collID].size);
+  txWin[collID].head = txWin[collID].buffer;
+  txWin[collID].refuseFuncCall = 0;
+}
+
+
+/************************************************************************/
+
+
+static
+void modelWinCreate ( void )
+{
+  int collID, ranks[1];
+  int nProcsColl = commInqNProcsColl ();
+
+  xdebug("%s", "START");
+  txWin = xmalloc(nProcsColl * sizeof (txWin[0]));
+
+  modelWinDefBufferSizes ();
+  ranks[0] = commInqNProcsModel ();
+
+  for ( collID = 0; collID < nProcsColl; collID ++ )
+    {
+      xassert(txWin[collID].size > 0);
+      txWin[collID].buffer = NULL;
+      xmpi(MPI_Alloc_mem((MPI_Aint)txWin[collID].size, MPI_INFO_NULL,
+                         &txWin[collID].buffer));
+      xassert ( txWin[collID].buffer != NULL );
+      txWin[collID].head = txWin[collID].buffer;
+      xmpi(MPI_Win_create(txWin[collID].buffer, (MPI_Aint)txWin[collID].size, 1,
+                          MPI_INFO_NULL, commInqCommsIO(collID),
+                          &txWin[collID].win));
+      xmpi(MPI_Comm_group(commInqCommsIO(collID), &txWin[collID].ioGroup));
+      xmpi(MPI_Group_incl(txWin[collID].ioGroup, 1, ranks,
+                          &txWin[collID].ioGroup ));
+    }
+  xdebug("%s", "RETURN, CREATED MPI_WIN'S");
+}
+
+/************************************************************************/
+
+static void
+modelWinBufferPutAtEnd(const char * caller,
+                       int collID, const void * argBuffer, size_t size)
+{
+  /*
+    xdebug ( "collID=%d, size=%d, newBufferHead=%d, oldBufferSize=%d",
+    collID, size, txWin[collID].head - txWin[collID].buffer + size,
+    txWin[collID].size );
+  */
+  if ( txWin == NULL ||
+       argBuffer     == NULL ||
+       size           < 0    ||
+       collID         < 0    ||
+       collID        >= commInqNProcsColl () ||
+       txWin[collID].head - txWin[collID].buffer + size > txWin[collID].size)
+    xabort("caller: %s", caller);
+
+  memcpy ( txWin[collID].head, argBuffer, size );
+  txWin[collID].head += size;
+}
+
+/************************************************************************/
+
+void pioBufferData ( const int streamID, const int varID, const double *data, int nmiss )
+{
+  int chunk, vlistID, collID = CDI_UNDEFID;
+  int tokenSep = SEPARATOR, tokenData = DATATOKEN;
+  size_t size;
+  int rankModel = commInqRankModel ();
+
+  vlistID  = streamInqVlist ( streamID );
+  collID   = commRankGlob2CollID ( vlistInqVarIOrank ( vlistID, varID ));
+  chunk    = vlistInqVarDecoChunk ( vlistID, varID, rankModel );
+  xassert ( collID         >= 0                    &&
+            collID         <  commInqNProcsColl () &&
+            chunk          >= 0                    &&
+            txWin != NULL);
+
+  if (txWin[collID].postSet)
+    {
+      xmpi(MPI_Win_wait(txWin[collID].win));
+      txWin[collID].postSet = 0;
+      modelWinFlushBuffer ( collID );
+    }
+
+  size = chunk * sizeof ( double ) + winBufferOverheadChunk * sizeof ( int );
+  xassert(txWin[collID].head - txWin[collID].buffer + size < txWin[collID].size);
+
+  modelWinBufferPutAtEnd ( __func__, collID, &tokenData, sizeof ( tokenData ));
+  modelWinBufferPutAtEnd ( __func__, collID, &streamID , sizeof ( streamID ));
+  modelWinBufferPutAtEnd ( __func__, collID, &varID    , sizeof ( varID ));
+  modelWinBufferPutAtEnd ( __func__, collID, data      , chunk * sizeof ( double ));
+  modelWinBufferPutAtEnd ( __func__, collID, &nmiss    , sizeof ( nmiss ));
+  modelWinBufferPutAtEnd ( __func__, collID, &tokenSep , sizeof ( tokenSep ));
+
+  txWin[collID].refuseFuncCall = 1;
+}
+
+/************************************************************************/
+
+void pioBufferFuncCall(int funcID, int argc, ... )
+{
+  va_list ap;
+  int rankGlob = commInqRankGlob ();
+  int root = commInqRootGlob ();
+  int collID, nProcsColl = commInqNProcsColl ();
+  int tokenSep = SEPARATOR, tokenFuncCall = FUNCCALL;
+  size_t size = 0;
+
+  xassert(funcID >= 0 && funcID < nFuncs);
+  xdebug("%s, func: %s", "START", funcMap[funcID]);
+
+  if ( rankGlob != root ) return;
+
+  xassert (argc          >= 1                    &&
+           argc          <= 2                    &&
+           txWin != NULL);
+
+  va_start ( ap, argc );
+
+  switch ( funcID )
+    {
+    case STREAMCLOSE:
+      {
+        int streamID;
+
+        xassert ( argc == 1 );
+        streamID  = va_arg ( ap, int );
+
+        for ( collID = 0; collID < nProcsColl; collID++ )
+          {
+            size = ( winBufferOverheadFuncCall + 1 ) * sizeof ( int );
+            xassert(txWin[collID].head - txWin[collID].buffer + size <
+                    txWin[collID].size);
+
+            if (txWin[collID].postSet)
+              {
+                xmpi(MPI_Win_wait(txWin[collID].win));
+                txWin[collID].postSet = 0;
+                modelWinFlushBuffer ( collID );
+              }
+
+            xassert(txWin[collID].refuseFuncCall == 0);
+
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenFuncCall,
+                                     sizeof ( tokenFuncCall));
+            modelWinBufferPutAtEnd ( __func__, collID, &funcID,
+                                     sizeof ( funcID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &streamID,
+                                     sizeof ( streamID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenSep,
+                                     sizeof ( tokenSep ));
+          }
+      xdebug ( "WROTE FUNCTION CALL IN BUFFER OF WINS:  %s, streamID=%d",
+               funcMap[funcID], streamID );
+      }
+      break;
+    case STREAMOPEN:
+      {
+        char * filename;
+        int    filetype;
+        size_t filenamesz;
+
+        xassert ( argc == 2 );
+        filename  = va_arg ( ap, char * );
+        filenamesz = strlen ( filename );
+        xassert ( filenamesz > 0 &&
+                  filenamesz < MAXDATAFILENAME );
+        filetype  = va_arg ( ap, int );
+
+        for ( collID = 0; collID < nProcsColl; collID++ )
+          {
+            size = ( winBufferOverheadFuncCall + 2 ) * sizeof ( int ) +
+              MAXDATAFILENAME;
+            xassert(txWin[collID].head - txWin[collID].buffer + size <
+                    txWin[collID].size);
+
+            if (txWin[collID].postSet)
+              {
+                xmpi(MPI_Win_wait(txWin[collID].win));
+                txWin[collID].postSet = 0;
+                modelWinFlushBuffer ( collID );
+              }
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenFuncCall,
+                                     sizeof ( tokenFuncCall));
+            modelWinBufferPutAtEnd ( __func__, collID, &funcID,
+                                     sizeof ( funcID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &filenamesz,
+                                     sizeof ( filenamesz ));
+            modelWinBufferPutAtEnd ( __func__, collID, filename,
+                                     filenamesz );
+            modelWinBufferPutAtEnd ( __func__, collID, &filetype,
+                                     sizeof ( filetype ));
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenSep,
+                                     sizeof ( tokenSep ));
+          }
+
+        xdebug("WROTE FUNCTION CALL IN BUFFER OF WINS:  %s, filenamesz=%zu,"
+               " filename=%s, filetype=%d",
+               funcMap[funcID], filenamesz, filename, filetype );
+      }
+      break;
+    case STREAMDEFVLIST:
+      {
+        int streamID, vlistID;
+
+        xassert ( argc == 2 );
+        streamID  = va_arg ( ap, int );
+        vlistID   = va_arg ( ap, int );
+
+        for ( collID = 0; collID < nProcsColl; collID++ )
+          {
+            size = ( winBufferOverheadFuncCall + 2 ) * sizeof ( int );
+            xassert(txWin[collID].head - txWin[collID].buffer + size <
+                    txWin[collID].size);
+
+            if (txWin[collID].postSet)
+              {
+                xmpi(MPI_Win_wait(txWin[collID].win));
+                txWin[collID].postSet = 0;
+                modelWinFlushBuffer ( collID );
+              }
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenFuncCall,
+                                     sizeof ( tokenFuncCall));
+            modelWinBufferPutAtEnd ( __func__, collID, &funcID,
+                                     sizeof ( funcID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &streamID,
+                                     sizeof ( streamID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &vlistID,
+                                     sizeof ( streamID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenSep,
+                                     sizeof ( tokenSep ));
+          }
+
+        xdebug ( "WROTE FUNCTION CALL IN BUFFER OF WINS:  %s, streamID=%d,"
+                 " vlistID=%d",
+                 funcMap[funcID], streamID, vlistID );
+      }
+      break;
+    default:
+      xabort ( "FUNCTION NOT MAPPED!" );
+    }
+
+  va_end ( ap );
+
+  xdebug("%s", "RETURN");
+}
+
+#endif
+
+/*****************************************************************************/
+
+int pioInqVarDecoChunk ( int vlistID, int varID )
+{
+#ifdef USE_MPI
+   int rankModel = commInqRankModel ();
+   xassert ( rankModel != CDI_UNDEFID );
+   return vlistInqVarDecoChunk ( vlistID, varID, rankModel );
+#endif
+   return vlistInqVarDecoChunk ( vlistID, varID, CDI_UNDEFID );
+}
+
+/*****************************************************************************/
+
+int pioInqVarDecoOff ( int vlistID, int varID )
+{
+#ifdef USE_MPI
+   int rankModel = commInqRankModel ();
+   xassert ( rankModel != CDI_UNDEFID );
+   return vlistInqVarDecoOff ( vlistID, varID, rankModel );
+#else
+   return vlistInqVarDecoOff ( vlistID, varID, CDI_UNDEFID );
+#endif
+}
+
+/*****************************************************************************/
+/**
+   @brief initializes the MPI_Communicators needed for the
+  communication between the calculator PEs and the I/O PEs and within the
+  group of I/O PEs.
+
+  commGlob: all PEs
+
+  commPIO: I/O PEs, PEs with highest ranks in commGlob
+
+  commModel: calculating PEs, no I/O PEs
+
+  commsIO[i]:
+
+  Collective call
+
+  @param comm MPI_Communicator of all calling PEs
+  @param nIOP number of I/O PEs
+  @return int indicating wether the calling PE is a calcutator (1) or not (0)
+*/
+
+#ifdef USE_MPI
+MPI_Comm pioInit_c ( MPI_Comm commGlob, int nProcsIO, int IOMode,
+                     int nNamespaces, int * hasLocalFile )
+{
+  int sizeGlob;
+
+  if ( IOMode < PIO_MINIOMODE || IOMode > PIO_MAXIOMODE )
+    xabort ( "IOMODE IS NOT VALID." );
+
+#ifdef _SX
+  if ( IOMode ==  PIO_ASYNCH )
+    xabort ( "PIO_ASYNCH DOES NOT WORK ON SX." );
+#endif
+
+  commInit ();
+  commDefCommGlob ( commGlob );
+  sizeGlob = commInqSizeGlob ();
+
+  if ( nProcsIO <= 0 || nProcsIO > sizeGlob - 1 )
+    xabort ( "DISTRIBUTION OF TASKS ON PROCS IS NOT VALID." );
+
+  commDefNProcsIO ( nProcsIO );
+  commDefIOMode   ( IOMode, PIO_MAXIOMODE, PIO_MINIOMODEWITHSPECIALPROCS );
+  commDefCommPio  ();
+
+  // JUST FOR TEST CASES WITH ONLY ONE MPI TASK
+  if ( commInqSizeGlob () == 1 )
+    {
+      namespaceInit ( nNamespaces, hasLocalFile );
+      return commInqCommGlob ();
+    }
+
+  if ( commInqIsProcIO ())
+    {
+      IOServer ();
+      commDestroy ();
+      MPI_Finalize ();
+      exit ( EXIT_SUCCESS );
+    }
+  else
+    {
+      commEvalPhysNodes ();
+      commDefCommsIO ();
+      namespaceInit ( nNamespaces, hasLocalFile );
+    }
+
+  xdebug ( "nProcsGlob=%d, RETURN", sizeGlob );
+  return commInqCommModel ();
+}
+#endif
+
+/*****************************************************************************/
+
+int pioInit ( int commGlobArg, int nProcsIO, int IOMode, int nNamespaces,
+              int * hasLocalFile )
+{
+#ifdef USE_MPI
+  xdebug("START: %s, nProcsIO=%d, IOMode=%d, nNamespaces=%d",
+         "cdi parallel",
+         nProcsIO, IOMode, nNamespaces );
+#else
+  xdebug("START: %s, nProcsIO=%d, IOMode=%d, nNamespaces=%d",
+         "cdi serial",
+         nProcsIO, IOMode, nNamespaces );
+#endif
+
+#ifdef USE_MPI
+  MPI_Comm commGlob;
+
+  commGlob = MPI_COMM_NULL;
+  commGlob = MPI_Comm_f2c (( MPI_Fint ) commGlobArg );
+  xassert ( commGlob != MPI_COMM_NULL );
+
+  return MPI_Comm_c2f ( pioInit_c ( commGlob, nProcsIO, IOMode, nNamespaces,
+                                    hasLocalFile ));
+#endif
+  xdebug("%s", "RETURN" );
+  return 0;
+}
+
+/************************************************************************/
+
+void  pioEndDef ( void )
+{
+#ifdef USE_MPI
+  char   * buffer;
+  int bufferSize;
+  int rankGlob = commInqRankGlob ();
+
+  xdebug("%s", "START");
+
+  varsMapNDeco ( commInqNNodes (), commInqNodeSizes ());
+
+  reshListPrint ( "reshListModel" );
+  
+  if ( rankGlob < commInqNProcsColl ())
+    {
+      reshPackBufferCreate ( &buffer, &bufferSize, commInqCommsIO ( rankGlob ));
+
+      xmpi ( MPI_Send ( buffer, bufferSize, MPI_PACKED, commInqNProcsModel (),
+                        RESOURCES, commInqCommsIO ( rankGlob )));
+
+      xdebug("%s", "SENT MESSAGE WITH TAG \"RESOURCES\"");
+
+      reshPackBufferDestroy ( &buffer );
+    }
+
+  modelWinCreate ();
+  namespaceDefResStatus ( STAGE_TIMELOOP );
+  xdebug("%s", "RETURN");
+#endif
+}
+
+/************************************************************************/
+
+void  pioEndTimestepping ( void )
+{
+#ifdef USE_MPI
+  xdebug("%s", "START");
+  namespaceDefResStatus ( STAGE_CLEANUP );
+  xdebug("%s", "RETURN");
+#endif
+}
+
+
+/****************************************************/
+
+
+/**
+  @brief is invoked by the calculator PEs, to inform
+  the I/O PEs that no more data will be written.
+
+  @param
+
+  @return
+*/
+
+void pioFinalize ( void )
+{
+#ifdef USE_MPI
+  int collID, ibuffer = 1111;
+  xdebug("%s", "START");
+  namespaceCleanup ();
+  for ( collID = 0; collID < commInqNProcsColl (); collID++ )
+    {
+      xmpi ( MPI_Send ( &ibuffer, 1, MPI_INT, commInqNProcsModel (),
+                        FINALIZE, commInqCommsIO ( collID )));
+      xdebug("%s", "SENT MESSAGE WITH TAG \"FINALIZE\"");
+    }
+  modelWinCleanup ();
+  commDestroy ();
+  xdebug("%s", "RETURN");
+#endif
+}
+
+ /************************************************************************/
+
+void pioWriteTimestep ( int tsID, int vdate, int vtime )
+{
+#ifdef USE_MPI
+  int collID, buffer[timestepSize], iAssert = 0;
+  int tokenEnd = END;
+  int rankGlob = commInqRankGlob ();
+  int nProcsColl = commInqNProcsColl ();
+  int nProcsModel = commInqNProcsModel ();
+
+  xdebug("%s", "START");
+
+  xassert ( tsID       >= 0     &&
+            vdate      >= 0     &&
+            vtime      >= 0     &&
+            txWin != NULL);
+
+  buffer[0] = tsID;
+  buffer[1] = vdate;
+  buffer[2] = vtime;
+
+  if ( rankGlob < nProcsColl )
+    {
+      xmpi ( MPI_Send ( &buffer[0], timestepSize, MPI_INTEGER, nProcsModel,
+                        WRITETS, commInqCommsIO ( rankGlob )));
+      xdebug("%s", "SENT MESSAGE WITH TAG \"WRITETS\"");
+    }
+
+  for ( collID = 0; collID < nProcsColl; collID++ )
+    {
+      if (txWin[collID].postSet)
+        {
+          xmpi(MPI_Win_wait(txWin[collID].win));
+          txWin[collID].postSet = 0;
+          modelWinFlushBuffer ( collID );
+        }
+      modelWinBufferPutAtEnd ( __func__, collID, &tokenEnd, 
+                               sizeof ( tokenEnd ));
+      xmpi(MPI_Win_post(txWin[collID].ioGroup, iAssert, txWin[collID].win));
+      txWin[collID].postSet = 1;
+    }
+
+  xdebug ( "RETURN. messages sent, windows posted: tsID=%d, vdate=%d, vtime=%d", 
+           tsID, vdate, vtime );
+
+#endif
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#define _XOPEN_SOURCE 600
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+
+#ifdef USE_MPI
+
+bool localDebug    =false;
+
+
+int dbuffer_init ( struct dBuffer **dbuffer, size_t size )
+{
+  struct dBuffer *db;
+  int status;
+  size_t pagesize;
+
+
+#ifndef _SX
+  pagesize = ( size_t ) sysconf ( _SC_PAGESIZE );
+
+  if ( localDebug ) 
+    fprintf ( stdout, "dbuffer_init(): pagesize = %zu bytes, size = %zu \n", pagesize, size );
+
+  if ( dbuffer == NULL || size < pagesize )
+    {
+
+      fprintf ( stdout, "dbuffer_init: dbuffer=NULL\n" );
+      return 1;
+    }
+  db = ( struct dBuffer * ) malloc ( sizeof ( struct dBuffer ));
+
+  if ( db == NULL )
+    {
+      perror ( "Not enough memory" );
+      return 1;
+    }
+  
+  db->size = pagesize;
+  while ( db->size < size )
+    {
+      db->size <<= 1;
+      if ( localDebug ) 
+	fprintf ( stdout,"size correction: %zu\n", db->size );
+    }
+  
+  db->wr_pointer = 0;
+
+  if ( ( status = posix_memalign ( ( void ** ) &db->buffer, pagesize, 
+				   sizeof ( char ) * ( db->size ))) != 0 ) 
+    {
+      switch ( status )
+	{
+	case EINVAL:
+	  fprintf ( stderr, 
+		    "The alignment argument was not a power of two, or was not a multiple of sizeof(void *).\n" );
+	  break;
+	case ENOMEM:
+	  fprintf ( stderr, 
+		    "There was insufficient memory to fulfill the allocation request.\n" );
+	  break;
+	}
+    }
+#else
+
+  if ( dbuffer == NULL )
+    {
+      fprintf ( stdout, "dbuffer_init: dbuffer=NULL\n" );
+      return 1;
+    }
+
+  db = ( struct dBuffer * ) malloc ( sizeof ( struct dBuffer ));
+  
+  if ( db == NULL )
+    {
+      perror ( "Not enough memory" );
+      return 1;
+    }
+  
+  db->size = size;
+  
+  db->wr_pointer = 0;
+
+  db->buffer = ( unsigned char * ) malloc ( sizeof ( unsigned char ) * ( db->size ));
+  if ( db->buffer == NULL )
+  {
+      perror ( "Not enough memory" );
+      return 1 ;
+  }
+#endif
+
+  *dbuffer = db;
+  
+  return 0;
+}
+
+void dbuffer_cleanup ( struct dBuffer **dbuffer )
+{
+  struct dBuffer *db;
+
+  db = *dbuffer;
+
+  free ( db->buffer );
+  free ( db );
+
+  return;
+}
+
+size_t dbuffer_data_size ( struct dBuffer *dbuffer )
+{
+  size_t data_size;
+
+  data_size = ( size_t )( dbuffer->wr_pointer & ( dbuffer->size-1 ));
+
+  return data_size;
+}
+
+static size_t
+dbuffer_freesize(struct dBuffer *dbuffer)
+{
+  size_t free_size;
+
+  free_size = ( size_t )( dbuffer->size - 1 - dbuffer_data_size ( dbuffer ));
+
+  return free_size;
+}
+
+int dbuffer_reset ( struct dBuffer *dbuffer )
+{
+  dbuffer->wr_pointer = 0;
+  
+  return 0;
+}
+
+int
+dbuffer_push(struct dBuffer *dbuffer, const void *buffer, size_t len)
+{
+  size_t space_left;
+  size_t wr_ptr;
+
+  space_left = dbuffer_freesize(dbuffer);
+  if ( len > space_left )
+    {
+      return 1; /* not enough space left */
+    }
+  
+  wr_ptr = dbuffer->wr_pointer;
+  memcpy ( dbuffer->buffer + wr_ptr, buffer, len );
+  dbuffer->wr_pointer = wr_ptr + len;
+
+  return 0;
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifdef HAVE_CONFIG_H
+#endif
+
+#ifdef USE_MPI
+
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <mpi.h>
+
+
+extern char * command2charP[6];
+
+extern long initial_buffersize;
+
+extern double accumWait;
+
+typedef struct
+{
+  size_t size;
+  struct dBuffer *db1;
+  struct dBuffer *db2;
+  struct dBuffer *db;
+  MPI_File fh;
+  MPI_Request request;
+  int fileID;
+  int tsID;
+  bool finished;
+  char name[];
+} aFiledataM;
+
+static listSet *bibAFiledataM;
+
+static int
+fileIDTest(void *a, void *fileID)
+{
+  return ((aFiledataM *)a)->fileID == (int)(intptr_t)fileID;
+}
+
+
+/***************************************************************/
+
+static aFiledataM *initAFiledataMPINONB ( const char *filename, size_t bs )
+{
+  aFiledataM *of = NULL;
+  int iret;
+  MPI_Comm commNode = commInqCommNode ();
+
+  of = xmalloc(sizeof (*of) + strlen(filename) + 1);
+
+  strcpy(of->name, filename);
+  of->size = bs;
+  of->db1 = NULL;
+  of->db2 = NULL;
+
+  /* init output buffer */
+   
+  iret = dbuffer_init ( &( of->db1 ), of->size );
+  iret += dbuffer_init ( &( of->db2 ), of->size );
+
+  if ( iret > 0 ) xabort ( "dbuffer_init did not succeed" );
+
+  of->db = of->db1;
+
+  of->tsID = CDI_UNDEFID;
+
+  /* open file */
+  xmpi(MPI_File_open(commNode, of->name, MPI_MODE_CREATE|MPI_MODE_WRONLY,
+                     MPI_INFO_NULL, &( of->fh )));
+  of->request = MPI_REQUEST_NULL;
+  of->finished = false;
+  
+  return of;
+}
+
+/***************************************************************/
+
+int destroyAFiledataMPINONB ( void *v )
+{
+  int iret = 0;
+  aFiledataM *of;
+  MPI_Status status;
+  int rankNode = commInqRankNode ();
+  double startTime;
+  MPI_Offset endpos;
+
+  of = (aFiledataM * ) v;
+
+  xdebug ( "IOPE%d: name=%s, close file, in", 
+           rankNode, of->name );
+  
+  /* close file */
+
+  startTime = MPI_Wtime ();
+  xmpi ( MPI_Wait ( & ( of->request ), &status )); 
+  xmpi(MPI_Barrier(commInqCommNode()));
+  accumWait += ( MPI_Wtime () - startTime );
+  xmpi(MPI_File_get_position_shared(of->fh, &endpos));
+  xmpi(MPI_File_set_size(of->fh, endpos));
+  iret = MPI_File_close ( & ( of->fh ));
+
+  /* file closed, cleanup */
+  
+  dbuffer_cleanup ( & ( of->db1 ));
+  dbuffer_cleanup ( & ( of->db2 ));
+
+  free ( of );
+
+  xdebug ( "IOPE%d: closed file, cleaned up, return", 
+           rankNode );
+
+  return iret == MPI_SUCCESS ? 0 : -1;
+}
+
+/***************************************************************/
+
+static bool
+compareNamesMPINONB(void *v1, void *v2)
+{
+  aFiledataM *afm1 = v1, *afm2 = v2;
+  return !strcmp(afm1->name, afm2->name);
+}
+
+/***************************************************************/
+
+void writeMPINONB(aFiledataM *of)
+{
+  int amount;
+  MPI_Status status;
+  int rankNode = commInqRankNode ();
+  int fileID = of->fileID;
+
+  /* write buffer */
+  
+  amount = ( int ) dbuffer_data_size ( of->db );
+
+  if ( amount == 0 ) return;
+
+  xdebug3 ( "IOPI%d: Write buffer, size %d bytes, in", 
+           rankNode, amount );
+  
+  xmpi ( MPI_Wait ( & ( of->request ), &status ));
+  xmpi ( MPI_File_iwrite_shared ( of->fh, of->db->buffer, amount, MPI_CHAR, 
+                                  & ( of->request )));
+  xdebug ( "%d bytes written for fileID=%d", amount, fileID );
+
+  /* change outputBuffer */
+  
+  dbuffer_reset ( of->db );
+  
+  if ( of->db == of->db1 )
+    {
+        xdebug3 ( "IOPE%d: fileID=%d, change to buffer 2 ...", 
+                 rankNode, fileID );
+      of->db =  of->db2;
+    }
+  else 
+    {
+        xdebug3 ( "IOPE%d: fileID=%d, change to buffer 1 ...", 
+		  rankNode, fileID );
+      of->db =  of->db1;
+    }
+
+  return;
+}
+
+/***************************************************************/
+
+size_t fwMPINONB ( int fileID, int tsID, const void *buffer, size_t len )
+{  
+  int error = 0;
+  int filled = 0;
+  aFiledataM *of;
+  int rankNode = commInqRankNode ();
+
+  of = listSetGet(bibAFiledataM, fileIDTest, (void *)(intptr_t)fileID);
+  xassert(of);
+
+  bool flush = tsID != of->tsID;
+
+  if (flush)
+    {
+      xdebug3("IOPE%d: tsID = %d, flush buffer", rankNode, tsID);
+      writeMPINONB(of);
+      of->tsID = tsID;
+      MPI_Status status;
+      xmpi(MPI_Wait(&(of->request), &status));
+      xmpi(MPI_Barrier(commInqCommNode()));
+    }
+
+  filled = dbuffer_push ( of->db, ( unsigned char * ) buffer, len );
+
+  xdebug3 ( "IOPE%d: fileID = %d, tsID = %d,"
+           " pushed data on buffer, filled = %d", 
+           rankNode, fileID, tsID, filled ); 
+
+  if ( filled == 1 ) 
+    {
+      if ( flush )
+	error = filled;
+      else
+	{
+	  writeMPINONB(of);
+     
+	  error = dbuffer_push ( of->db, ( unsigned char * ) buffer, len );
+	}
+    }
+  
+  if ( error == 1 )
+    xabort("did not succeed filling output buffer, fileID=%d", fileID);
+
+  return len;
+}
+
+/***************************************************************/
+
+int fcMPINONB ( int fileID )
+{
+  aFiledataM *of;
+  int iret;
+  double accumWaitMax;
+  MPI_Comm commNode = commInqCommNode ();
+  int rankNode = commInqRankNode ();
+
+  xdebug("IOPE%d: write buffer, close file and cleanup, in %d",
+         rankNode, fileID );
+
+  if (!(of = listSetGet(bibAFiledataM, fileIDTest, (void *)(intptr_t)fileID)))
+    xabort("listSet, fileID=%d not found", fileID);
+
+  writeMPINONB(of);
+
+  /* remove file element */
+  iret = listSetRemove(bibAFiledataM, fileIDTest, (void *)(intptr_t)fileID);
+
+  /* timer output */
+
+  if ( ddebug == MAXDEBUG )
+    {
+      xmpi ( MPI_Reduce ( &accumWait, &accumWaitMax, 
+                          1, MPI_DOUBLE, MPI_MAX, 0, commNode  ));
+      xdebug ( "IOPE%d: Wait time %15.10lf s",
+               rankNode, accumWait );
+      if ( rankNode == 0 )
+          xdebug ( "IOPE%d: Max wait time %15.10lf s",
+                   rankNode, accumWaitMax );
+    }
+
+  return iret;
+}
+
+/***************************************************************/
+static void
+elemCheck(void *q, void *nm)
+{
+  aFiledataM *afm = q;
+  const char *name = nm;
+
+  if (!strcmp(name, afm->name))
+    xabort("Filename %s has already been added to set\n", name);
+}
+
+
+int fowMPINONB ( const char *filename )
+{
+  static aFiledataM *of;
+  static long buffersize = 0; 
+  int id, bcastRank = 0; 
+  MPI_Comm commNode = commInqCommNode ();
+  int rankNode = commInqRankNode ();
+
+  /* broadcast buffersize to collectors ( just once, for all files )*/
+  
+  if ( ! buffersize )
+    {
+        xdebug ( "IOPE%d: Broadcast buffersize to collectors ...", 
+		  rankNode );
+      
+      if  ( rankNode == bcastRank )
+	{ 
+	  if ( getenv( "BUFSIZE" ) != NULL )
+	    buffersize = atol ( getenv ( "BUFSIZE" ));
+	  if ( buffersize < initial_buffersize )
+	    buffersize = initial_buffersize;
+	}
+      
+      xmpi ( MPI_Bcast ( &buffersize, 1, MPI_LONG, bcastRank, commNode ));
+    }
+
+  xdebug("buffersize=%ld", buffersize);
+
+  listSetForeach(bibAFiledataM, elemCheck, (void *)filename);
+  of = initAFiledataMPINONB(filename, buffersize);
+
+  if ((id = listSetAdd(bibAFiledataM, of)) < 0 )
+    xabort("filename %s not unique", of->name);
+
+  xdebug("IOPE%d: name=%s, init and added aFiledataM, return id = %d",
+         rankNode, filename, id);
+  
+  return id;
+}
+
+/***************************************************************/
+
+void finalizeMPINONB(void)
+{
+  if (!listSetIsEmpty(bibAFiledataM))
+    xabort("set bibAFiledataM not empty");
+  else
+    {
+      xdebug("%s", "destroy set");
+      listSetDelete(bibAFiledataM);
+    }
+}
+
+/***************************************************************/
+
+void initMPINONB ( void )
+{
+  commDefCommColl ( 1 );
+  commSendNodeInfo ();
+  commRecvNodeMap ();
+  commDefCommsIO ();
+
+  bibAFiledataM = listSetNew( destroyAFiledataMPINONB, compareNamesMPINONB );
+  
+  if ( bibAFiledataM == NULL )
+    xabort ( "listSetNew did not succeed" );   
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+/* 
+   todo  
+   README: specialRank Pe closes down, when all output files are closed    
+*/
+#ifdef HAVE_CONFIG_H
+#endif
+
+
+#ifdef USE_MPI
+#ifndef _SX
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <aio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+
+extern char * command2charP[6];
+
+extern char *token;
+
+extern double accumSuspend;
+extern double accumWrite;
+
+
+typedef struct
+{
+  struct dBuffer *fb;
+  struct aiocb *ctrlBlks;
+  off_t offset;
+  int currOpIndex;
+  int nextOpIndex;
+  int prefIndex;
+  int activeCollectors;
+  int handle, fileID;
+  char name[];
+} bFiledataPA;
+
+static int
+fileIDTest(void *a, void *fileID)
+{
+  return ((bFiledataPA *)a)->fileID == (int)(intptr_t)fileID;
+}
+
+int nPrefStreams = 4;
+
+/***************************************************************/
+
+static bFiledataPA *
+initBFiledataPA(char *filename, size_t bs, int nc)
+{
+  bFiledataPA *bfd;
+  int i;
+
+  xdebug ( "filename=%s, buffersize=%zu, ncollectors=%d, nPrefetchStreams=%d",
+           filename, bs, nc, nPrefStreams );
+
+  bfd = xmalloc( sizeof (*bfd) + strlen(filename) + 1);
+  strcpy(bfd->name, filename);
+
+  if (( bfd->handle = open ( bfd->name, O_CREAT | O_WRONLY, 0666 )) == -1 )
+    xabort("Failed to open %s", bfd->name);
+
+  dbuffer_init(&(bfd->fb), (size_t)(nPrefStreams * bs));
+
+  bfd->ctrlBlks = xcalloc(nPrefStreams, sizeof (bfd->ctrlBlks[0]));
+
+  for ( i = 0; i < nPrefStreams; i++ )
+    {
+      bfd->ctrlBlks[i].aio_fildes     = bfd->handle;
+      bfd->ctrlBlks[i].aio_buf = bfd->fb->buffer + i * bs;
+      bfd->ctrlBlks[i].aio_reqprio    = 0;
+      bfd->ctrlBlks[i].aio_sigevent.sigev_notify = SIGEV_NONE;   
+    }
+  
+  bfd->nextOpIndex = 0;
+  bfd->prefIndex = 0; 
+  bfd->offset = 0;
+  bfd->activeCollectors = nc;
+
+  xdebug ( "filename=%s, opened file, return", bfd->name );
+
+  return bfd;
+}
+
+/***************************************************************/
+
+static int
+destroyBFiledataPA ( void *v )
+{
+  bFiledataPA *bfd = (bFiledataPA * ) v;
+  const struct aiocb *ccBP[1];
+  int iret = 0;
+  ssize_t ssiret;
+  int nextFinishOp = (bfd->nextOpIndex - bfd->prefIndex + nPrefStreams)
+    % nPrefStreams;
+  double startTime;
+
+  xdebug ( "filename=%s, cleanup and close file", bfd->name );
+
+  /* close file */
+
+  for (; bfd->prefIndex > 0 ; --(bfd->prefIndex))
+    {
+      xdebug("file: %s, prefIndex=%d", bfd->name, (int)bfd->prefIndex);
+      ccBP[0] = ( bfd->ctrlBlks + nextFinishOp );
+
+      if ( ddebug )
+	startTime = MPI_Wtime ();
+
+      do
+	{
+	  iret = aio_suspend ( ccBP, 1, NULL );
+	  if ( iret < 0 && errno != EINTR ) xabort ( "aio_suspend () failed" );
+	}
+      while ( iret != 0 );
+
+      if ( ddebug )
+	accumSuspend += ( MPI_Wtime () - startTime);
+
+      iret = aio_error(bfd->ctrlBlks + nextFinishOp);
+      if (( ssiret = aio_return ( bfd->ctrlBlks + nextFinishOp )) == -1 )
+	xabort("aio_return () failed: %s", strerror(iret));
+
+      nextFinishOp = ( nextFinishOp + 1 ) % nPrefStreams;
+    }
+
+  if ((iret = ftruncate(bfd->handle, bfd->offset)) == -1)
+    xabort("failed to truncate file %s: %s", bfd->name, strerror(errno));
+  if (( iret = close ( bfd->handle )) == -1 )
+    xabort("failed to close %s", bfd->name);
+
+  /* file closed, cleanup */
+
+  dbuffer_cleanup ( &( bfd->fb ));
+
+  free(bfd->ctrlBlks);
+  free(bfd);
+
+  xdebug("%s", "closed file and cleaned up, return");
+
+  return iret;
+}
+
+/***************************************************************/
+
+static bool
+compareNamesBPA(void *v1, void *v2)
+{
+  bFiledataPA *bfd1 = v1, *bfd2 = v2;
+
+  return !strcmp(bfd1->name, bfd2->name);
+}
+
+/***************************************************************/
+
+static void
+writePA(bFiledataPA *bfd, long amount)
+{
+  const struct aiocb *ccBP[1];
+  int iret;
+  double startTime;
+
+  xdebug ( "file %s, in", bfd->name );
+  
+  bfd->ctrlBlks[bfd->currOpIndex].aio_nbytes = amount;
+  bfd->ctrlBlks[bfd->currOpIndex].aio_offset = bfd->offset;
+
+  xdebug ( " before aio_write(), file %s, aio_nbytes=%zu, aio_offset=%zu",
+           bfd->name, bfd->ctrlBlks[bfd->currOpIndex].aio_nbytes,
+           bfd->ctrlBlks[bfd->currOpIndex].aio_offset );
+
+  if ( ddebug ) startTime = MPI_Wtime ();
+
+  iret = aio_write ( bfd->ctrlBlks + bfd->currOpIndex );
+
+  if ( ddebug ) accumWrite += ( MPI_Wtime () - startTime);
+
+  xdebug ( "after aio_write(), file %s, aio_nbytes=%zu, aio_offset=%zu,"
+           "iret=aio_write()=%d",
+           bfd->name, bfd->ctrlBlks[bfd->currOpIndex].aio_nbytes,
+           bfd->ctrlBlks[bfd->currOpIndex].aio_offset, iret );
+   
+  if ( iret == -1 ) 
+    {
+      xabort ( "did not succeed writing buffer" );
+    }
+  else
+    xdebug ( "buffer written to %s",  bfd->name );
+     
+  bfd->offset += ( off_t ) amount;
+  bfd->prefIndex ++;
+
+  if ( bfd->prefIndex >= nPrefStreams ) 
+    {
+      ccBP[0] = ( bfd->ctrlBlks + bfd->nextOpIndex );
+
+      if ( ddebug )
+	startTime = MPI_Wtime ();
+
+      do
+	{
+	  iret = aio_suspend ( ccBP, 1, NULL );
+	  if ( iret < 0 && errno != EINTR )
+	    xabort ( "aio_suspend () failed" );
+	} while ( iret != 0 );
+
+      if ( ddebug )
+	accumSuspend += ( MPI_Wtime () - startTime);
+	      
+      if (( iret = aio_return ( bfd->ctrlBlks + bfd->nextOpIndex )) == -1 ) 
+	xabort ( "aio_return () failed" );
+
+      bfd->prefIndex --;
+    }
+
+  xdebug ( "filename=%s, prefIndex=%d, return", bfd->name, bfd->prefIndex );
+}
+
+/***************************************************************/
+static void
+elemCheck(void *q, void *nm)
+{
+  bFiledataPA *bfd = q;
+  const char *name = nm;
+
+  if (!strcmp(name, bfd->name))
+    xabort("Filename %s has already been inserted\n", name);
+}
+
+/***************************************************************/
+
+void pioWriterAIO(void)
+{
+  bFiledataPA *bfd; 
+  listSet * bibBFiledataPA;
+  long amount, buffersize;
+  char *messageBuffer, *pMB, *filename, *temp;
+  int messagesize, source, tag, id;
+  struct fileOpTag rtag;
+  MPI_Status status;
+  MPI_Comm commNode = commInqCommNode ();
+  int nProcsCollNode = commInqSizeNode () - commInqSizeColl ();
+  bool * sentFinalize, doFinalize;
+
+  if ( nPrefStreams < 1 ) xabort("USAGE: # PREFETCH STREAMS >= 1");
+  xdebug ( "nProcsCollNode=%d on this node", nProcsCollNode );
+ 
+  bibBFiledataPA = listSetNew(destroyBFiledataPA, compareNamesBPA);
+  sentFinalize = xmalloc ( nProcsCollNode * sizeof ( sentFinalize ));
+  
+  for ( ;; )
+    {   
+      xmpiStat ( MPI_Probe ( MPI_ANY_SOURCE, MPI_ANY_TAG, commNode, 
+                             &status ), &status );
+
+      source = status.MPI_SOURCE;
+      tag    = status.MPI_TAG;
+      rtag = decodeFileOpTag(tag);
+
+      xmpi ( MPI_Get_count ( &status, MPI_CHAR, &messagesize ));
+
+      xdebug ( "receive message from source=%d, id=%d, command=%d ( %s ), "
+               "messagesize=%d", source, rtag.id, rtag.command,
+               command2charP[rtag.command], messagesize);
+
+      switch (rtag.command)
+	{
+      	case IO_Open_file:
+
+	  messageBuffer = ( char *) xmalloc ( messagesize * 
+                                              sizeof ( messageBuffer[0] ));
+	  pMB = messageBuffer;
+
+	  xmpi ( MPI_Recv ( messageBuffer, messagesize, MPI_CHAR, source, 
+                            tag, commNode, &status ));
+
+	  filename = strtok ( pMB, token );
+	  pMB += ( strlen ( filename ) + 1 );
+	  temp =  strtok ( pMB, token );
+	  buffersize =  strtol ( temp, NULL, 16 );
+	  pMB += ( strlen ( temp ) + 1 );
+	  amount = ( long ) ( messageBuffer + messagesize - pMB );
+
+	  xdebug("command  %s, filename=%s, buffersize=%ld, amount=%ld",
+                 command2charP[rtag.command], filename, buffersize, amount);
+
+          if (!(bfd = listSetGet(bibBFiledataPA, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+	    {
+              listSetForeach(bibBFiledataPA, elemCheck, filename);
+	      bfd = initBFiledataPA(filename, buffersize, nProcsCollNode);
+              if ((id = listSetAdd(bibBFiledataPA, bfd)) < 0)
+                xabort("fileID=%d not unique", rtag.id);
+	    }
+	  else
+	    if (strcmp(filename, bfd->name) != 0)
+              xabort("filename is not consistent, fileID=%d", rtag.id);
+
+	  bfd->currOpIndex = bfd->nextOpIndex;
+	  bfd->nextOpIndex = ( bfd->nextOpIndex + 1 ) % nPrefStreams;
+
+          xassert(amount >= 0);
+	  memcpy((void *)bfd->ctrlBlks[bfd->currOpIndex].aio_buf,
+                 pMB, (size_t)amount);
+
+	  writePA ( bfd, amount );
+
+	  free ( messageBuffer );
+
+	  break;
+
+	case IO_Send_buffer:
+
+          if (!(bfd = listSetGet(bibBFiledataPA, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileID=%d is not in set", rtag.id);
+
+	  amount = messagesize;
+
+	  xdebug("command: %s, id=%d, name=%s",
+                 command2charP[rtag.command], rtag.id, bfd->name );
+
+	  bfd->currOpIndex = bfd->nextOpIndex;
+	  bfd->nextOpIndex = ( bfd->nextOpIndex + 1 ) % nPrefStreams;
+	  
+	  xmpi(MPI_Recv((void *)bfd->ctrlBlks[bfd->currOpIndex].aio_buf,
+                        amount, MPI_CHAR, source, tag, commNode, &status ));
+
+	  writePA ( bfd, amount );
+	  
+	  break;
+
+	case IO_Close_file:
+
+          if (!(bfd = listSetGet(bibBFiledataPA, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileID=%d is not in set", rtag.id);
+
+	  amount = messagesize;
+
+	  xdebug(" command %s, id=%d, name=%s",
+                 command2charP[rtag.command], rtag.id, bfd->name);
+
+	  bfd->currOpIndex = bfd->nextOpIndex;
+
+	  bfd->nextOpIndex = ( bfd->nextOpIndex + 1 ) % nPrefStreams;
+
+	  MPI_Recv((void *)bfd->ctrlBlks[bfd->currOpIndex].aio_buf,
+                   amount, MPI_CHAR, source, tag, commNode, &status);
+
+	  writePA ( bfd, amount );
+
+	  if ( ! --(bfd->activeCollectors))
+	    {
+              xdebug ( "all are finished with file %d, delete node", rtag.id);
+              listSetRemove(bibBFiledataPA, fileIDTest,
+                            (void *)(intptr_t)rtag.id);
+	    }
+          break;
+        case IO_Finalize:
+          {
+            int buffer = CDI_UNDEFID, collID;
+
+            xmpi ( MPI_Recv ( &buffer, 1, MPI_INT, source, tag, commNode, &status ));
+            sentFinalize[source] = true;
+            doFinalize = true;
+            for ( collID = 0; collID < nProcsCollNode; collID++ )
+              if ( !sentFinalize[collID] ) 
+                {
+                  doFinalize = false;
+                  break;
+                }
+            if ( doFinalize )
+              {
+                if (!listSetIsEmpty(bibBFiledataPA))
+                  xabort("Set bibBfiledataP is not empty.");
+                else
+                  {
+                    xdebug("%s", "all files are finished, destroy set,"
+                           " return");
+                    listSetDelete(bibBFiledataPA);
+                  }
+                return;
+              }
+          }
+
+          break;
+        default:
+          xabort ( "COMMAND NOT IMPLEMENTED" );
+	}
+    }
+}
+
+
+
+/***************************************************************/
+
+/***************************************************************/
+
+
+#endif
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+/* 
+   todo 
+   build in control, for consistance of pairs filename / filenumber 
+   ( pioOpenFile member name, recv in tmpbuffer, if(!uniqueName(q,v,n))abort )
+*/
+
+#ifdef HAVE_CONFIG_H
+#endif
+
+#ifdef USE_MPI
+
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
+
+
+
+extern char * command2charP[6];
+
+extern long initial_buffersize;
+
+typedef struct
+{
+  struct dBuffer *db1;
+  struct dBuffer *db2;
+  struct dBuffer *db;
+  FILE *fp;
+  IO_Server_command command;
+  int tsID, fileID;
+  char name[];
+} aFiledataPF;
+
+static int
+fileIDTestA(void *a, void *fileID)
+{
+  return ((aFiledataPF *)a)->fileID == (int)(intptr_t)fileID;
+}
+
+typedef struct
+{
+  long offset;
+  bool finished;
+  bool *nfinished;
+  int fileID;
+} bFiledataPF;
+
+static int
+fileIDTestB(void *a, void *fileID)
+{
+  return ((bFiledataPF *)a)->fileID == (int)(intptr_t)fileID;
+}
+
+static bool
+fileIDCmpB(void *a, void *b)
+{
+  return ((bFiledataPF *)a)->fileID == ((bFiledataPF *)b)->fileID;
+}
+
+static listSet *bibAFiledataPF;
+
+/***************************************************************/
+  
+static aFiledataPF *initAFiledataPF ( const char *key, size_t bs)
+{
+  aFiledataPF *afd;
+  size_t len;
+  int iret;
+
+  len = strlen(key);
+  afd = xcalloc(1, sizeof (*afd) + len + 1);
+  strcpy(afd->name, key);
+  afd->tsID = 0;
+
+  /* init output buffer */
+
+  xdebug ( " name=%s, init output buffer",  afd->name );
+   
+  iret = dbuffer_init(&(afd->db1), bs);
+  iret += dbuffer_init(&(afd->db2), bs);
+
+  if ( iret > 0 )
+    xabort("dbuffer_init did not succeed");
+
+  afd->db = afd->db1;
+
+  /* open file */ 
+  xdebug ( "name=%s, open file",  afd->name );
+
+  if ( ( afd->fp = fopen ( afd->name, "w" )) == NULL ) 
+    xabort("Failed to open %s", afd->name);
+
+  afd->command = IO_Open_file;
+  
+  return afd;
+}
+
+/***************************************************************/
+static bFiledataPF *
+initBFiledataPF(int key, int nc)
+{
+  bFiledataPF *bfd;
+  int i;
+
+  bfd = ( bFiledataPF * ) xmalloc ( sizeof ( bFiledataPF ));
+  memset ( bfd, 0, sizeof ( bFiledataPF ));
+  bfd->offset = 0;
+  bfd->finished = false;
+  bfd->nfinished = ( bool * ) xmalloc ( nc * sizeof ( bool ));
+
+  for ( i = 0; i < nc; i++ )
+    *( bfd->nfinished + i ) = true;
+
+  return bfd;
+}
+
+/***************************************************************/
+
+static int
+destroyAFiledataPF(void *v)
+{
+  int iret = 0;
+  aFiledataPF *afd = ( aFiledataPF * ) v;
+
+  /* close file */
+  xdebug("name=%s, close file", afd->name);
+  if ((iret = fclose(afd->fp)) == EOF)
+    xabort("Failed to close %s", afd->name);
+
+  /* file closed, cleanup */
+  xdebug("name=%s, file closed, cleanup ...",  afd->name);
+  dbuffer_cleanup(&(afd->db1));
+  dbuffer_cleanup(&(afd->db2));
+
+  free(afd);
+
+  return iret;
+}
+
+/***************************************************************/
+
+static int
+destroyBFiledataPF(void *v)
+{
+  int iret = 0;
+  bFiledataPF *bfd = (bFiledataPF * ) v;
+  
+  free ( bfd->nfinished );
+  free ( bfd );
+
+  return iret;
+}
+
+/***************************************************************/
+
+static bool
+compareNamesAPF(void *v1, void *v2)
+{
+  aFiledataPF *afd1 = v1, *afd2 = v2;
+
+  return !strcmp(afd1->name, afd2->name);
+}
+
+/***************************************************************/
+
+void fpgPOSIXFPGUARDSENDRECV ( void )
+{
+  int i, source, iret;
+  struct fileOpTag rtag;
+  MPI_Status status;
+  bFiledataPF *bfd; 
+  listSet *bibBFiledataPF;
+  long amount;
+  MPI_Comm commNode = commInqCommNode ();
+  int nProcsCollNode =  commInqSizeNode () - commInqSizeColl ();
+  bool * sentFinalize, doFinalize = false;
+
+  xdebug ( "ncollectors=%d on this node", nProcsCollNode );
+  
+  bibBFiledataPF = listSetNew( destroyBFiledataPF, fileIDCmpB);
+  sentFinalize = xmalloc ( nProcsCollNode * sizeof ( sentFinalize[0] ));
+
+  for ( ;; )
+    {
+      xmpi ( MPI_Probe ( MPI_ANY_SOURCE, MPI_ANY_TAG, commNode, &status ));
+      source = status.MPI_SOURCE;
+      rtag = decodeFileOpTag(status.MPI_TAG);
+      
+      xdebug("receive message from source=%d, id=%d, command=%d ( %s )",
+             source, rtag.id, rtag.command, command2charP[rtag.command]);
+      
+      switch (rtag.command)
+      	{
+      	case IO_Open_file:
+
+          if (!(bfd = listSetGet(bibBFiledataPF, fileIDTestB,
+                               (void *)(intptr_t)rtag.id)))
+	    {
+	      bfd = initBFiledataPF(rtag.id, nProcsCollNode);
+
+	      if ((iret = listSetAdd(bibBFiledataPF, bfd)) < 0)
+		xabort("fileID=%d not unique", rtag.id);
+	    }
+
+	  *( bfd->nfinished + source ) = false;
+
+          xdebug("id=%d, command=%d ( %s ), send offset=%ld", rtag.id,
+                 rtag.command, command2charP[rtag.command], bfd->offset);
+	  
+	  xmpi ( MPI_Sendrecv ( &( bfd->offset ), 1, MPI_LONG, source,  status.MPI_TAG,
+                                &amount, 1, MPI_LONG, source,  status.MPI_TAG,
+                                commNode, &status ));
+
+	  bfd->offset += amount; 
+ 
+          xdebug("id=%d, command=%d ( %s ), recv amount=%ld, set offset=%ld",
+                 rtag.id, rtag.command, command2charP[rtag.command], amount,
+                 bfd->offset);
+
+	  break;
+
+	case IO_Set_fp:
+
+          if (!(bfd = listSetGet(bibBFiledataPF, fileIDTestB,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileId=%d not in set", rtag.id);
+
+          xdebug("id=%d, command=%d ( %s ), send offset=%ld", rtag.id,
+                 rtag.command, command2charP[rtag.command], bfd->offset);
+
+	  xmpi ( MPI_Sendrecv ( &( bfd->offset ), 1, MPI_LONG, source,  status.MPI_TAG,
+                                &amount, 1, MPI_LONG, source,  status.MPI_TAG,
+                                commNode, &status ));
+
+	  bfd->offset += amount;
+
+          xdebug("id=%d, command=%d ( %s ), recv amount=%ld, set offset=%ld",
+                 rtag.id, rtag.command, command2charP[rtag.command], amount,
+                 bfd->offset);
+
+	  break;
+
+	case IO_Close_file:
+
+          if (!(bfd = listSetGet(bibBFiledataPF, fileIDTestB,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileId=%d not in set", rtag.id);
+
+          xdebug("id=%d, command=%d ( %s )), send offset=%ld", rtag.id,
+                 rtag.command, command2charP[rtag.command], bfd->offset);
+
+	  xmpi ( MPI_Sendrecv ( &( bfd->offset ), 1, MPI_LONG, source,  status.MPI_TAG,
+                                &amount, 1, MPI_LONG, source,  status.MPI_TAG,
+                                commNode, &status ));
+
+	  bfd->offset += amount;
+
+          xdebug("id=%d, command=%d ( %s ), recv amount=%ld, set offset=%ld",
+                 rtag.id, rtag.command, command2charP[rtag.command], amount,
+                 bfd->offset);
+
+
+	  bfd->nfinished[source] = true;  
+	  bfd->finished          = true;
+	  
+	  for ( i = 0; i < nProcsCollNode; i++ )
+	    if ( !( bfd->nfinished[i] ))
+	      {
+		bfd->finished = false;
+		break;
+	      }
+
+	  if ( bfd->finished )
+            listSetRemove(bibBFiledataPF, fileIDTestB,
+                          (void *)(intptr_t)rtag.id);
+          break;
+        case IO_Finalize:
+          {  
+            int buffer = CDI_UNDEFID, collID; 
+
+            xmpi ( MPI_Recv ( &buffer, 1, MPI_INT, source, status.MPI_TAG,
+                              commNode, &status ));
+            sentFinalize[source] = true;
+            doFinalize = true;
+            for ( collID = 0; collID < nProcsCollNode; collID++ )
+              if ( !sentFinalize[collID] ) 
+                {
+                  doFinalize = false;
+                  break;
+                }
+            if ( doFinalize )
+              {
+                if (!listSetIsEmpty(bibBFiledataPF))
+                  xabort("set bibBFiledataM not empty");
+                else
+                  {
+                    xdebug("%s", "destroy set");
+                    listSetDelete(bibBFiledataPF);
+                  }
+                return;
+              }
+          }
+          break;
+        default:
+          xabort ( "COMMAND NOT IMPLEMENTED" );
+	}
+    }
+}   
+
+//*******************************************************
+
+static void
+writePF(aFiledataPF *afd)
+{
+  size_t amount, written;
+  long offset;
+  long amountL;
+  int error, tag;
+  MPI_Status status;
+  int specialRank = commInqSpecialRankNode ();
+  MPI_Comm commNode = commInqCommNode ();
+  
+  /* send buffersize, recv offset */
+
+  amount = dbuffer_data_size ( afd->db );
+  amountL = ( long ) amount;
+  int id = afd->fileID;
+  tag = encodeFileOpTag(id, afd->command);
+  
+  xmpi ( MPI_Sendrecv ( &amountL, 1, MPI_LONG, specialRank, tag,
+                        &offset, 1, MPI_LONG, specialRank, tag,
+                        commNode, &status ));
+  xdebug ( "id=%d, command=%d, amount=%zu, send amountL=%ld, recv offset=%ld", 
+           id, afd->command, amount, amountL, offset );
+  
+  /* write buffer */
+  
+  if (( error = fseek ( afd->fp, offset, SEEK_SET )) != 0 )
+    xabort ( "did not succeed seeking fp" );
+
+  if (( written = 
+	fwrite ( afd->db->buffer, sizeof ( char ), amount, afd->fp )) !=
+      amount )
+    xabort("fileId=%d, expect to write %zu byte, written %zu byte",
+           id, amount, written);
+ 
+  xdebug("written %zu bytes in file %d with offset %ld",
+         written, id, offset);
+  
+  /* change outputBuffer */
+  
+  dbuffer_reset ( afd->db );
+  
+  if ( afd->db == afd->db1 )
+    {
+      xdebug ( "id=%d, change to buffer 2 ...", id );
+      afd->db =  afd->db2;
+    }
+  else 
+    {
+      xdebug ( "id=%d, change to buffer 1 ...", id );
+      afd->db =  afd->db1;
+    }
+  
+  afd->command = IO_Set_fp;
+}
+
+
+/***************************************************************/
+
+static void
+defTimestepPF(aFiledataPF *afd, int tsID)
+{
+  if ( afd == NULL || tsID < 0 || tsID != afd->tsID + 1 ) 
+    xabort ( " defTimestepPF() didn't succeed." );
+  afd->tsID = tsID;
+}
+
+
+/***************************************************************/
+
+static void
+flushOp(aFiledataPF *a, int tsID)
+{
+  writePF(a);
+  defTimestepPF(a, tsID);
+}
+
+
+size_t fwPOSIXFPGUARDSENDRECV( int fileID, int tsID, const void *buffer, size_t len )
+{
+  int error = 0;
+  int filled = 0;
+  aFiledataPF *afd
+    = listSetGet(bibAFiledataPF, fileIDTestA, (void *)(intptr_t)fileID);
+
+  bool flush = tsID != afd->tsID;
+
+  if (flush)
+    {
+      xdebug("fileID %d, tsID = %d, flush buffer", fileID, tsID);
+      flushOp(afd, tsID);
+      xmpi ( MPI_Barrier ( commInqCommColl ())); 
+    }
+
+  filled = dbuffer_push(afd->db, ( unsigned char * ) buffer, len);
+
+  xdebug ( "fileID = %d, tsID = %d, pushed data on buffer, filled = %d", 
+           fileID, tsID, filled ); 
+
+  if ( filled == 1 ) 
+    {
+      if ( flush )
+	error = filled;
+      else
+	{
+	  writePF(afd);
+     
+	  error = dbuffer_push ( afd->db, ( unsigned char * ) buffer, len );
+	}
+    }
+  
+  if ( error == 1 )
+    xabort("did not succeed filling output buffer, fileID=%d", fileID);
+  
+  return len;
+}
+
+/***************************************************************/
+
+int fcPOSIXFPGUARDSENDRECV ( int id )
+{
+  aFiledataPF *afd;
+  int iret;
+
+  xdebug("write buffer, close file %d and cleanup", id);
+
+  afd = listSetGet(bibAFiledataPF, fileIDTestA, (void *)(intptr_t)id);
+
+  afd->command = IO_Close_file;
+
+  writePF(afd);
+
+  /* remove file element */
+  iret = listSetRemove(bibAFiledataPF, fileIDTestA, (void *)(intptr_t)id);
+  /* make sure the file is closed on all collectors before proceeding */
+  xmpi(MPI_Barrier(commInqCommColl()));
+  return iret;
+}
+
+/***************************************************************/
+static void
+elemCheck(void *q, void *nm)
+{
+  aFiledataPF *afd = q;
+  const char *name = nm;
+
+  if (!strcmp(name, afd->name))
+    xabort("Filename %s has already been added to set\n", name);
+}
+
+int fowPOSIXFPGUARDSENDRECV ( const char *filename )
+{
+  int root = 0, id;
+  aFiledataPF *afd;
+  static long buffersize = 0;
+
+  /* broadcast buffersize to collectors */
+  if (!buffersize)
+    {
+      if (commInqRankColl() == root)
+	{
+          xdebug("name=%s, broadcast buffersize to collectors ...",
+                 filename);
+	  if ( getenv( "BUFSIZE" ) != NULL )
+	    buffersize = atol ( getenv ( "BUFSIZE" ));
+	  if ( buffersize < initial_buffersize )
+	    buffersize = initial_buffersize;
+	}
+      xmpi(MPI_Bcast(&buffersize, 1, MPI_LONG, root, commInqCommColl()));
+    }
+
+  /* init and add file element */
+  listSetForeach(bibAFiledataPF, elemCheck, (void *)filename);
+
+  afd = initAFiledataPF ( filename, buffersize );
+
+  if ((id = listSetAdd(bibAFiledataPF, afd)) < 0)
+    xabort("filename %s not unique", afd->name);
+
+  xdebug("name=%s, init and add aFiledataPF, return id = %d",
+         filename, id);
+  return id;
+}
+
+/***************************************************************/
+
+void
+finalizePOSIXFPGUARDSENDRECV(void)
+{
+  int buffer = 0, tag = encodeFileOpTag(0, IO_Finalize);
+
+  xmpi(MPI_Send(&buffer, 1, MPI_INT, commInqSpecialRankNode(),
+                tag, commInqCommNode()));
+
+  if (!listSetIsEmpty(bibAFiledataPF))
+    xabort("set bibAFiledataM not empty");
+  else
+    {
+      xdebug("%s", "destroy set");
+      listSetDelete(bibAFiledataPF);
+    }
+}
+
+/***************************************************************/
+
+void initPOSIXFPGUARDSENDRECV ( void )
+{
+  if ( commInqSizeNode () < 2 ) 
+    xabort ( "USAGE: # IO PROCESSES ON A PHYSICAL NODE >= 2" );
+  
+  if ( commInqRankNode () == commInqSpecialRankNode ()) 
+    {
+      commDefCommColl ( 0 );
+      commSendNodeInfo ();
+      commRecvNodeMap ();
+      commDefCommsIO ();
+      fpgPOSIXFPGUARDSENDRECV ();
+    }
+  else
+    {
+      commDefCommColl ( 1 );
+      commSendNodeInfo ();
+      commRecvNodeMap ();
+      commDefCommsIO ();
+      bibAFiledataPF = listSetNew( destroyAFiledataPF, compareNamesAPF );
+    }
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifdef HAVE_CONFIG_H
+#endif
+
+#ifdef USE_MPI
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+
+extern char * command2charP[6];
+
+extern char *token;
+
+typedef struct
+{
+  struct dBuffer *fb;
+  FILE *fp;
+  int fileID;
+  int activeCollectors;
+  char name[];
+} bFiledataP;
+
+static int
+fileIDTest(void *a, void *fileID)
+{
+  return ((bFiledataP *)a)->fileID == (int)(intptr_t)fileID;
+}
+
+/***************************************************************/
+
+static bFiledataP *
+initBFiledataP(char *filename, size_t bs, int nc, int fileID)
+{
+  bFiledataP * bfp;
+
+  xdebug ( "filename=%s, buffersize=%lu, ncollectors=%d", filename, bs, nc );
+
+  bfp = xmalloc(sizeof (*bfp) + strlen(filename) + 1);
+  strcpy(bfp->name, filename);
+
+  if (( bfp->fp = fopen ( filename, "w" )) == NULL ) 
+    xabort("Failed to open %s", bfp->name);
+  int fd = fileno(bfp->fp);
+  ftruncate(fd, (off_t)0);
+  dbuffer_init(&bfp->fb, bs);
+
+  bfp->activeCollectors = nc;
+
+  bfp->fileID = fileID;
+
+  xdebug ( "filename=%s, opened file, return", bfp->name );
+
+  return bfp;
+}
+
+/***************************************************************/
+
+static int
+destroyBFiledataP(void *v)
+{
+  int iret = 0;
+  bFiledataP *bfp = ( bFiledataP * ) v;
+
+  xdebug ( "filename=%s, cleanup, in",  bfp->name );
+
+  /* close file */
+  if (( iret = fclose ( bfp->fp )) == EOF )
+    xabort("Failed to close %s", bfp->name);
+
+  /* file closed, cleanup */
+
+  dbuffer_cleanup ( &( bfp->fb ));
+
+  free(bfp);
+
+  xdebug("%s", "cleaned up, return");
+
+  return iret;
+}
+
+/***************************************************************/
+
+static bool
+compareNamesBP(void *v1, void *v2)
+{
+  bFiledataP *bfd1 = v1, *bfd2 = v2;
+
+  return !strcmp(bfd1->name, bfd2->name);
+}
+
+/***************************************************************/
+
+static void
+writeP(bFiledataP *bfd, long amount)
+{
+  long written;
+
+  xdebug ( "filename=%s, amount=%ld, in", bfd->name, amount );
+
+  if (( written = fwrite ( bfd->fb->buffer, 1, amount,
+			   bfd->fp )) != amount )
+    xabort("did not succeed writing buffer in %s", bfd->name);
+
+  xdebug ( "filename=%s, written=%ld, amount=%ld, return",
+           bfd->name, written, amount );
+}
+
+/***************************************************************/
+static void
+elemCheck(void *q, void *nm)
+{
+  bFiledataP *bfd = q;
+  const char *name = nm;
+
+  if (!strcmp(name, bfd->name))
+    xabort("Filename %s has already been added to the set\n", name);
+}
+
+void
+pioWriterStdIO(void)
+{
+  bFiledataP *bfd; 
+  listSet * bibBFiledataP;
+  size_t amount, buffersize;
+  char *messageBuffer = NULL;
+  char *pMB, *filename, *temp;
+  int messagesize, source, tag, id;
+  struct fileOpTag rtag;
+  MPI_Status status;
+  MPI_Comm commNode = commInqCommNode ();
+  int nProcsCollNode = commInqSizeNode () - commInqSizeColl ();
+  bool * sentFinalize, doFinalize;
+
+  xdebug ( "ncollectors=%d on this node", nProcsCollNode );
+
+  bibBFiledataP = listSetNew(destroyBFiledataP, compareNamesBP);
+  sentFinalize = xmalloc ( nProcsCollNode * sizeof ( sentFinalize ));
+  
+  for ( ;; )
+    {  
+        
+      xmpiStat ( MPI_Probe ( MPI_ANY_SOURCE, MPI_ANY_TAG, commNode, 
+                             &status ), &status );
+      
+      
+      source = status.MPI_SOURCE;
+      tag    = status.MPI_TAG;
+      
+      rtag = decodeFileOpTag(tag);
+      
+      xmpi ( MPI_Get_count ( &status, MPI_CHAR, &messagesize ));
+
+      xdebug ( "RECEIVE MESSAGE FROM SOURCE=%d, ID=%d, COMMAND=%d ( %s ),"
+               "MESSAGESIZE=%d", source, rtag.id, rtag.command,
+               command2charP[rtag.command], messagesize);
+
+      switch (rtag.command)
+	{
+      	case IO_Open_file:
+
+	  messageBuffer = xmalloc ( messagesize  * sizeof ( messageBuffer[0] ));
+    	  pMB = messageBuffer;
+
+	  xmpi ( MPI_Recv ( messageBuffer, messagesize, MPI_CHAR, source, 
+                            tag, commNode, &status ));
+
+	  xdebug("%s", "after recv, in loop");
+	  
+	  filename = strtok ( pMB, token );
+	  pMB += ( strlen ( filename ) + 1 );
+	  temp =  strtok ( pMB, token );
+          buffersize =  strtol ( temp, NULL, 16 );
+	  pMB += ( strlen ( temp ) + 1 );
+	  amount = (size_t)(messageBuffer + messagesize - pMB);
+	  
+	  xdebug("command %s, filename=%s, buffersize=%zu, amount=%zu",
+                 command2charP[rtag.command], filename, buffersize, amount);
+	  
+	  
+          if (!(bfd = listSetGet(bibBFiledataP, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+	    {
+	      listSetForeach(bibBFiledataP, elemCheck, filename);
+	      bfd = initBFiledataP(filename, buffersize, nProcsCollNode,
+                                   rtag.id);
+	      
+	      if ((id = listSetAdd(bibBFiledataP, bfd)) < 0)
+                xabort("fileID=%d not unique", rtag.id);
+	    }
+	  else
+	    if (strcmp(filename, bfd->name) != 0)
+              xabort("filename is not consistent, fileID=%d", rtag.id);
+
+	  memcpy(bfd->fb->buffer, pMB, amount);
+
+	  writeP(bfd, amount);
+	  
+	  free ( messageBuffer );
+
+	  break;
+
+	case IO_Send_buffer:
+
+          if (!(bfd = listSetGet(bibBFiledataP, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileID=%d is not in set", rtag.id );
+
+	  amount = messagesize;
+
+	  xdebug("COMMAND %s, ID=%d, NAME=%s", command2charP[rtag.command],
+                 rtag.id, bfd->name);
+	  
+	  xmpi ( MPI_Recv (  bfd->fb->buffer, amount, MPI_CHAR, source, tag, 
+                             commNode, &status ));
+
+	  writeP ( bfd, amount );
+	  
+	  break;
+
+	case IO_Close_file:
+	  
+	  xdebug("COMMAND %s,  FILE%d, SOURCE%d",
+                 command2charP[rtag.command], rtag.id, source);
+
+          if (!(bfd = listSetGet(bibBFiledataP, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileID=%d is not in set", rtag.id);
+
+          amount = messagesize;
+
+	  xdebug("COMMAND %s, ID=%d, NAME=%s, AMOUNT=%zu",
+                 command2charP[rtag.command], rtag.id, bfd->name, amount);
+	  
+	  xmpi(MPI_Recv(bfd->fb->buffer, amount, MPI_CHAR, source, tag,
+                        commNode, &status ));
+
+	  writeP ( bfd, amount );
+
+	  if ( ! --(bfd->activeCollectors))
+	    {
+	      xdebug("all are finished with file %d, delete node", rtag.id);
+	      listSetRemove(bibBFiledataP, fileIDTest,
+                            (void *)(intptr_t)rtag.id);
+	    }
+          break;
+        case IO_Finalize:
+          {
+            int buffer = CDI_UNDEFID, collID;
+
+            xmpi ( MPI_Recv ( &buffer, 1, MPI_INT, source, tag, commNode, &status ));
+            
+            sentFinalize[source] = true;
+            doFinalize = true;
+            
+            for ( collID = 0; collID < nProcsCollNode; collID++ )
+              if ( !sentFinalize[collID] ) 
+                {
+                  doFinalize = false;
+                  break;
+                }
+            
+            if ( doFinalize )
+              {
+                if (!listSetIsEmpty(bibBFiledataP))
+                  xabort("set bibBfiledataP is not empty.");
+                else
+                  {
+                    xdebug("%s", "all files are finished, destroy file set,"
+                           " return");
+                    listSetDelete(bibBFiledataP);
+                  }
+                return;
+              }
+          }
+          break;
+        default:
+          xabort ( "COMMAND NOT IMPLEMENTED" );
+	}
+    }
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#ifdef HAVE_CONFIG_H
+#endif
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+
+
+#ifdef USE_MPI
+
+struct cons
+{
+  void * val;
+  struct cons * next;
+};
+
+struct listSet {
+  struct cons *head, *tail;
+  valDestroyFunction valDestroy;
+  eqPredicate keyCompare;
+  int count;
+};
+
+listSet *listSetNew( valDestroyFunction vD, eqPredicate kC )
+{
+  listSet *myq;
+
+  myq = xmalloc ( sizeof ( listSet ));
+
+  myq->head = NULL;
+  myq->tail = NULL;
+  myq->valDestroy = vD;
+  myq->keyCompare = kC;
+  myq->count = 0;
+
+  return myq;
+}
+
+void
+listSetDelete(listSet *q)
+{
+  struct cons *curr, *succ;
+
+  if ( q->head )
+    {
+      curr = q->head;
+
+      while ( curr )
+        {
+          succ = curr->next;
+          ( *( q->valDestroy )) ( curr->val );
+          free ( curr );
+          curr = succ;
+        }
+    }
+
+  free ( q );
+
+  return;
+}
+
+int
+listSetAdd(listSet *q, void *v)
+{
+  struct cons *newCons;
+
+  {
+    struct cons *p;
+    for (p = q->head; p; p = p->next)
+      // ensure unique keys
+      if (q->keyCompare(v, p->val))
+        return -1;
+  }
+
+  if ((newCons = malloc(sizeof(struct cons))) == NULL)
+    {
+      perror ( "pio_listSet: listSetAdd (): Not enough memory" );
+      /* FIXME: why not abort? */
+      return 1;
+    }
+
+  newCons->val = v;
+  newCons->next = NULL;
+
+
+  if ( q->tail != NULL)
+    q->tail->next = newCons;
+  else
+    q->head = newCons;
+
+  q->tail = newCons;
+  q->count  ++;
+
+  return 0;
+}
+
+int
+listSetRemove(listSet *q, int (*predicate)(void *, void *),
+              void *data)
+{
+  struct cons **p;
+
+  for (p = &q->head; *p; p = &(*p)->next)
+    if (predicate((*p)->val, data))
+      {
+        struct cons *rem = *p;
+        if (rem == q->tail) q->tail = NULL;
+        int iret = q->valDestroy(rem->val);
+        *p = rem->next;
+        free(rem);
+        return iret;
+      }
+  return -1;
+}
+
+void *
+listSetGet(listSet *q, int (*predicate)(void *, void *), void *data)
+{
+  struct cons *p;
+  xassert(q && predicate);
+  for (p = q->head; p; p = p->next)
+    if (predicate(p->val, data))
+      return p->val;
+  return NULL;
+}
+
+bool
+listSetIsEmpty(listSet *q)
+{
+  return q->head == NULL;
+}
+
+
+void
+listSetForeach(listSet *q, void (*func)(void *elem, void *data), void *data)
+{
+  struct cons *p;
+  for (p = q->head; p; p = p->next)
+    func(p->val, data);
+}
+
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+   static char cdi_libvers[] = "1.5.9" " of ""Dec 17 2012"" ""13:48:03";
+char *cdiLibraryVersion(void);
+char *cdiLibraryVersion(void)
+{
+  return (cdi_libvers);
+}
+#if defined (HAVE_CF_INTERFACE)
+#undef realloc
+#undef malloc
+#undef calloc
+#undef free
+#undef DOUBLE_PRECISION
+/* cfortran.h  4.3 */
+/* http://www-zeus.desy.de/~burow/cfortran/                   */
+/* Burkhard Burow  burow at desy.de                 1990 - 2001. */
+
+/* 02/12/2002 Uwe Schulzweida : UXP Fortran support           */
+/* 02/05/2003 Uwe Schulzweida : Linux Fortran support on i386 */
+/* 09/09/2005 Uwe Schulzweida : Linux Fortran support on ia64 */
+
+#ifndef __CFORTRAN_LOADED
+#define __CFORTRAN_LOADED
+
+/* 
+   THIS FILE IS PROPERTY OF BURKHARD BUROW. IF YOU ARE USING THIS FILE YOU
+   SHOULD ALSO HAVE ACCESS TO CFORTRAN.DOC WHICH PROVIDES TERMS FOR USING,
+   MODIFYING, COPYING AND DISTRIBUTING THE CFORTRAN.H PACKAGE.
+*/
+
+/* 
+  Avoid symbols already used by compilers and system *.h:
+  __ - OSF1 zukal06 V3.0 347 alpha, cc -c -std1 cfortest.c
+
+ */
+
+
+/* First prepare for the C compiler. */
+
+#ifndef ANSI_C_preprocessor /* i.e. user can override. */
+#ifdef __CF__KnR
+#define ANSI_C_preprocessor 0
+#else
+#ifdef __STDC__
+#define ANSI_C_preprocessor 1
+#else
+#define _cfleft             1
+#define _cfright 
+#define _cfleft_cfright     0
+#define ANSI_C_preprocessor _cfleft/**/_cfright
+#endif
+#endif
+#endif
+
+#if ANSI_C_preprocessor
+#define _0(A,B)   A##B
+#define  _(A,B)   _0(A,B)  /* see cat,xcat of K&R ANSI C p. 231 */
+#define _2(A,B)   A##B     /* K&R ANSI C p.230: .. identifier is not replaced */
+#define _3(A,B,C) _(A,_(B,C))
+#else                      /* if it turns up again during rescanning.         */
+#define  _(A,B)   A/**/B
+#define _2(A,B)   A/**/B
+#define _3(A,B,C) A/**/B/**/C
+#endif
+
+#if (defined(vax)&&defined(unix)) || (defined(__vax__)&&defined(__unix__))
+#define VAXUltrix
+#endif
+
+#include <stdio.h>     /* NULL [in all machines stdio.h]                      */
+#include <string.h>    /* strlen, memset, memcpy, memchr.                     */
+#if !( defined(VAXUltrix) || defined(sun) || (defined(apollo)&&!defined(__STDCPP__)) )
+#include <stdlib.h>    /* malloc,free                                         */
+#else
+#include <malloc.h>    /* Had to be removed for DomainOS h105 10.4 sys5.3 425t*/
+#ifdef apollo
+#define __CF__APOLLO67 /* __STDCPP__ is in Apollo 6.8 (i.e. ANSI) and onwards */
+#endif
+#endif
+
+#if !defined(__GNUC__) && !defined(__sun) && (defined(sun)||defined(VAXUltrix)||defined(lynx))
+#define __CF__KnR     /* Sun, LynxOS and VAX Ultrix cc only supports K&R.     */
+                      /* Manually define __CF__KnR for HP if desired/required.*/
+#endif                /*       i.e. We will generate Kernighan and Ritchie C. */
+/* Note that you may define __CF__KnR before #include cfortran.h, in order to
+generate K&R C instead of the default ANSI C. The differences are mainly in the
+function prototypes and declarations. All machines, except the Apollo, work
+with either style. The Apollo's argument promotion rules require ANSI or use of
+the obsolete std_$call which we have not implemented here. Hence on the Apollo,
+only C calling FORTRAN subroutines will work using K&R style.*/
+
+
+/* Remainder of cfortran.h depends on the Fortran compiler. */
+
+#if defined(CLIPPERFortran) || defined(pgiFortran)
+#define f2cFortran
+#endif
+
+/* VAX/VMS does not let us \-split long #if lines. */ 
+/* Split #if into 2 because some HP-UX can't handle long #if */
+#if !(defined(NAGf90Fortran)||defined(f2cFortran)||defined(hpuxFortran)||defined(apolloFortran)||defined(sunFortran)||defined(IBMR2Fortran)||defined(CRAYFortran))
+#if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)||defined(SXFortran))
+/* If no Fortran compiler is given, we choose one for the machines we know.   */
+#if defined(__linux__) && defined(__i386__)
+#define f2cFortran
+#endif
+#if defined(__linux__) && defined(__ia64__)
+#define f2cFortran
+#endif
+#if defined(__linux__) && defined(__x86_64__)
+#define f2cFortran
+#endif
+#if defined(lynx) || defined(VAXUltrix)
+#define f2cFortran    /* Lynx:      Only support f2c at the moment.
+                         VAXUltrix: f77 behaves like f2c.
+                           Support f2c or f77 with gcc, vcc with f2c. 
+                           f77 with vcc works, missing link magic for f77 I/O.*/
+#endif
+#if defined(__hpux)             /* 921107: Use __hpux instead of __hp9000s300 */
+#define       hpuxFortran       /*         Should also allow hp9000s7/800 use.*/
+#endif
+#if       defined(apollo)
+#define           apolloFortran /* __CF__APOLLO67 also defines some behavior. */
+#endif
+#if          defined(sun) || defined(__sun) 
+#define              sunFortran
+#endif
+#if       defined(_IBMR2)
+#define            IBMR2Fortran
+#endif
+#if        defined(_CRAY)
+#define             CRAYFortran /*       _CRAYT3E also defines some behavior. */
+#endif
+#if        defined(_SX)
+#define               SXFortran
+#endif
+#if        defined(__uxp__)
+#define               UXPFortran
+#endif
+#if         defined(mips) || defined(__mips)
+#define             mipsFortran
+#endif
+#if          defined(vms) || defined(__vms)
+#define              vmsFortran
+#endif
+#if      defined(__alpha) && defined(__unix__)
+#define              DECFortran
+#endif
+#if   defined(__convex__)
+#define           CONVEXFortran
+#endif
+#if   defined(VISUAL_CPLUSPLUS)
+#define     PowerStationFortran
+#endif
+#endif /* ...Fortran */
+#endif /* ...Fortran */
+
+/* Split #if into 2 because some HP-UX can't handle long #if */
+#if !(defined(NAGf90Fortran)||defined(f2cFortran)||defined(hpuxFortran)||defined(apolloFortran)||defined(sunFortran)||defined(IBMR2Fortran)||defined(CRAYFortran))
+#if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)||defined(SXFortran)||defined(UXPFortran))
+/* If your compiler barfs on ' #error', replace # with the trigraph for #     */
+ #error "cfortran.h:  Can't find your environment among:\
+    - MIPS cc and f77 2.0. (e.g. Silicon Graphics, DECstations, ...)     \
+    - IBM AIX XL C and FORTRAN Compiler/6000 Version 01.01.0000.0000     \
+    - VAX   VMS CC 3.1 and FORTRAN 5.4.                                  \
+    - Alpha VMS DEC C 1.3 and DEC FORTRAN 6.0.                           \
+    - Alpha OSF DEC C and DEC Fortran for OSF/1 AXP Version 1.2          \
+    - Apollo DomainOS 10.2 (sys5.3) with f77 10.7 and cc 6.7.            \
+    - CRAY                                                               \
+    - NEC SX-4 SUPER-UX                                                  \
+    - CONVEX                                                             \
+    - Sun                                                                \
+    - PowerStation Fortran with Visual C++                               \
+    - HP9000s300/s700/s800 Latest test with: HP-UX A.08.07 A 9000/730    \
+    - LynxOS: cc or gcc with f2c.                                        \
+    - VAXUltrix: vcc,cc or gcc with f2c. gcc or cc with f77.             \
+    -            f77 with vcc works; but missing link magic for f77 I/O. \
+    -            NO fort. None of gcc, cc or vcc generate required names.\
+    - f2c    : Use #define    f2cFortran, or cc -Df2cFortran             \
+    - NAG f90: Use #define NAGf90Fortran, or cc -DNAGf90Fortran          \
+    - Absoft UNIX F77: Use #define AbsoftUNIXFortran or cc -DAbsoftUNIXFortran \
+    - Absoft Pro Fortran: Use #define AbsoftProFortran \
+    - Portland Group Fortran: Use #define pgiFortran"
+/* Compiler must throw us out at this point! */
+#endif
+#endif
+
+
+#if defined(VAXC) && !defined(__VAXC)
+#define OLD_VAXC
+#pragma nostandard                       /* Prevent %CC-I-PARAMNOTUSED.       */
+#endif
+
+/* Throughout cfortran.h we use: UN = Uppercase Name.  LN = Lowercase Name.   */
+
+#if defined(f2cFortran) || defined(NAGf90Fortran) || defined(DECFortran) || defined(mipsFortran) || defined(apolloFortran) || defined(sunFortran) || defined(CONVEXFortran) || defined(SXFortran) || defined(UXPFortran) || defined(extname)
+#define CFC_(UN,LN)            _(LN,_)      /* Lowercase FORTRAN symbols.     */
+#define orig_fcallsc(UN,LN)    CFC_(UN,LN)
+#else 
+#if defined(CRAYFortran) || defined(PowerStationFortran) || defined(AbsoftProFortran)
+#ifdef _CRAY          /* (UN), not UN, circumvents CRAY preprocessor bug.     */
+#define CFC_(UN,LN)            (UN)         /* Uppercase FORTRAN symbols.     */
+#else                 /* At least VISUAL_CPLUSPLUS barfs on (UN), so need UN. */
+#define CFC_(UN,LN)            UN           /* Uppercase FORTRAN symbols.     */
+#endif
+#define orig_fcallsc(UN,LN)    CFC_(UN,LN)  /* CRAY insists on arg.'s here.   */
+#else  /* For following machines one may wish to change the fcallsc default.  */
+#define CF_SAME_NAMESPACE
+#ifdef vmsFortran
+#define CFC_(UN,LN)            LN           /* Either case FORTRAN symbols.   */
+     /* BUT we usually use UN for C macro to FORTRAN routines, so use LN here,*/
+     /* because VAX/VMS doesn't do recursive macros.                          */
+#define orig_fcallsc(UN,LN)    UN
+#else      /* HP-UX without +ppu or IBMR2 without -qextname. NOT reccomended. */
+#define CFC_(UN,LN)            LN           /* Lowercase FORTRAN symbols.     */
+#define orig_fcallsc(UN,LN)    CFC_(UN,LN)
+#endif /*  vmsFortran */
+#endif /* CRAYFortran PowerStationFortran */
+#endif /* ....Fortran */
+
+#define fcallsc(UN,LN)               orig_fcallsc(UN,LN)
+#define preface_fcallsc(P,p,UN,LN)   CFC_(_(P,UN),_(p,LN))
+#define  append_fcallsc(P,p,UN,LN)   CFC_(_(UN,P),_(LN,p))
+
+#define C_FUNCTION(UN,LN)            fcallsc(UN,LN)      
+#define FORTRAN_FUNCTION(UN,LN)      CFC_(UN,LN)
+
+#ifndef COMMON_BLOCK
+#ifndef CONVEXFortran
+#ifndef CLIPPERFortran
+#if     !(defined(AbsoftUNIXFortran)||defined(AbsoftProFortran))
+#define COMMON_BLOCK(UN,LN)          CFC_(UN,LN)
+#else
+#define COMMON_BLOCK(UN,LN)          _(_C,LN)
+#endif  /* AbsoftUNIXFortran or AbsoftProFortran */
+#else
+#define COMMON_BLOCK(UN,LN)          _(LN,__)
+#endif  /* CLIPPERFortran */
+#else
+#define COMMON_BLOCK(UN,LN)          _3(_,LN,_)
+#endif  /* CONVEXFortran */
+#endif  /* COMMON_BLOCK */
+
+#ifndef DOUBLE_PRECISION
+#if defined(CRAYFortran) && !defined(_CRAYT3E)
+#define DOUBLE_PRECISION long double
+#else
+#define DOUBLE_PRECISION double
+#endif
+#endif
+
+#ifndef FORTRAN_REAL
+#if defined(CRAYFortran) &&  defined(_CRAYT3E)
+#define FORTRAN_REAL double
+#else
+#define FORTRAN_REAL float
+#endif
+#endif
+
+#ifdef CRAYFortran
+#ifdef _CRAY
+#include <fortran.h>
+#else
+#include "fortran.h"  /* i.e. if crosscompiling assume user has file. */
+#endif
+#define FLOATVVVVVVV_cfPP (FORTRAN_REAL *)   /* Used for C calls FORTRAN.     */
+/* CRAY's double==float but CRAY says pointers to doubles and floats are diff.*/
+#define VOIDP  (void *)  /* When FORTRAN calls C, we don't know if C routine 
+                            arg.'s have been declared float *, or double *.   */
+#else
+#define FLOATVVVVVVV_cfPP
+#define VOIDP
+#endif
+
+#ifdef vmsFortran
+#if    defined(vms) || defined(__vms)
+#include <descrip.h>
+#else
+#include "descrip.h"  /* i.e. if crosscompiling assume user has file. */
+#endif
+#endif
+
+#ifdef sunFortran
+#if defined(sun) || defined(__sun)
+#include <math.h>     /* Sun's FLOATFUNCTIONTYPE, ASSIGNFLOAT, RETURNFLOAT.  */
+#else
+#include "math.h"     /* i.e. if crosscompiling assume user has file. */
+#endif
+/* At least starting with the default C compiler SC3.0.1 of SunOS 5.3,
+ * FLOATFUNCTIONTYPE, ASSIGNFLOAT, RETURNFLOAT are not required and not in
+ * <math.h>, since sun C no longer promotes C float return values to doubles.
+ * Therefore, only use them if defined.
+ * Even if gcc is being used, assume that it exhibits the Sun C compiler
+ * behavior in order to be able to use *.o from the Sun C compiler.
+ * i.e. If FLOATFUNCTIONTYPE, etc. are in math.h, they required by gcc.
+ */
+#endif
+
+#ifndef apolloFortran
+#define COMMON_BLOCK_DEF(DEFINITION, NAME) extern DEFINITION NAME
+#define CF_NULL_PROTO
+#else                                         /* HP doesn't understand #elif. */
+/* Without ANSI prototyping, Apollo promotes float functions to double.    */
+/* Note that VAX/VMS, IBM, Mips choke on 'type function(...);' prototypes. */
+#define CF_NULL_PROTO ...
+#ifndef __CF__APOLLO67
+#define COMMON_BLOCK_DEF(DEFINITION, NAME) \
+ DEFINITION NAME __attribute((__section(NAME)))
+#else
+#define COMMON_BLOCK_DEF(DEFINITION, NAME) \
+ DEFINITION NAME #attribute[section(NAME)]
+#endif
+#endif
+
+#ifdef __cplusplus
+#undef  CF_NULL_PROTO
+#define CF_NULL_PROTO  ...
+#endif
+
+
+#ifndef USE_NEW_DELETE
+#ifdef __cplusplus
+#define USE_NEW_DELETE 1
+#else
+#define USE_NEW_DELETE 0
+#endif
+#endif
+#if USE_NEW_DELETE
+#define _cf_malloc(N) new char[N]
+#define _cf_free(P)   delete[] P
+#else
+#define _cf_malloc(N) (char *)malloc(N)
+#define _cf_free(P)   free(P)
+#endif
+
+#ifdef mipsFortran
+#define CF_DECLARE_GETARG         int f77argc; char **f77argv
+#define CF_SET_GETARG(ARGC,ARGV)  f77argc = ARGC; f77argv = ARGV
+#else
+#define CF_DECLARE_GETARG
+#define CF_SET_GETARG(ARGC,ARGV)
+#endif
+
+#ifdef OLD_VAXC                          /* Allow %CC-I-PARAMNOTUSED.         */
+#pragma standard                         
+#endif
+
+#define AcfCOMMA ,
+#define AcfCOLON ;
+
+/*-------------------------------------------------------------------------*/
+
+/*               UTILITIES USED WITHIN CFORTRAN.H                          */
+
+#define _cfMIN(A,B) (A<B?A:B)
+
+/* 970211 - XIX.145:
+   firstindexlength  - better name is all_but_last_index_lengths
+   secondindexlength - better name is         last_index_length
+ */
+#define  firstindexlength(A) (sizeof(A[0])==1 ? 1 : (sizeof(A) / sizeof(A[0])) )
+#define secondindexlength(A) (sizeof(A[0])==1 ?      sizeof(A) : sizeof(A[0])  )
+
+/* Behavior of FORTRAN LOGICAL. All machines' LOGICAL is same size as C's int.
+Conversion is automatic except for arrays which require F2CLOGICALV/C2FLOGICALV.
+f2c, MIPS f77 [DECstation, SGI], VAX Ultrix f77,
+HP-UX f77                                        : as in C.
+VAX/VMS FORTRAN, VAX Ultrix fort,
+Absoft Unix Fortran, IBM RS/6000 xlf             : LS Bit = 0/1 = TRUE/FALSE.
+Apollo                                           : neg.   = TRUE, else FALSE. 
+[Apollo accepts -1 as TRUE for function values, but NOT all other neg. values.]
+[DECFortran for Ultrix RISC is also called f77 but is the same as VAX/VMS.]   
+[MIPS f77 treats .eqv./.neqv. as .eq./.ne. and hence requires LOGICAL_STRICT.]*/
+
+#if defined(NAGf90Fortran) || defined(f2cFortran) || defined(mipsFortran) || defined(PowerStationFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran) || defined(AbsoftProFortran) || defined(SXFortran) || defined(UXPFortran)
+/* SX/PowerStationFortran have 0 and 1 defined, others are neither T nor F.   */
+/* hpuxFortran800 has 0 and 0x01000000 defined. Others are unknown.           */
+#define LOGICAL_STRICT      /* Other Fortran have .eqv./.neqv. == .eq./.ne.   */
+#endif
+
+#define C2FLOGICALV(A,I) \
+ do {int __i; for(__i=0;__i<I;__i++) A[__i]=C2FLOGICAL(A[__i]); } while (0)
+#define F2CLOGICALV(A,I) \
+ do {int __i; for(__i=0;__i<I;__i++) A[__i]=F2CLOGICAL(A[__i]); } while (0)
+
+#if defined(apolloFortran)
+#define C2FLOGICAL(L) ((L)?-1:(L)&~((unsigned)1<<sizeof(int)*8-1))
+#define F2CLOGICAL(L) ((L)<0?(L):0) 
+#else
+#if defined(CRAYFortran)
+#define C2FLOGICAL(L) _btol(L)
+#define F2CLOGICAL(L) _ltob(&(L))     /* Strangely _ltob() expects a pointer. */
+#else
+#if defined(IBMR2Fortran) || defined(vmsFortran) || defined(DECFortran) || defined(AbsoftUNIXFortran)
+/* How come no AbsoftProFortran ? */
+#define C2FLOGICAL(L) ((L)?(L)|1:(L)&~(int)1)
+#define F2CLOGICAL(L) ((L)&1?(L):0)
+#else
+#if defined(CONVEXFortran)
+#define C2FLOGICAL(L) ((L) ? ~0 : 0 )
+#define F2CLOGICAL(L) (L)
+#else   /* others evaluate LOGICALs as for C. */
+#define C2FLOGICAL(L) (L)
+#define F2CLOGICAL(L) (L)
+#ifndef LOGICAL_STRICT
+#undef  C2FLOGICALV
+#undef  F2CLOGICALV
+#define C2FLOGICALV(A,I)
+#define F2CLOGICALV(A,I)
+#endif  /* LOGICAL_STRICT                     */
+#endif  /* CONVEXFortran || All Others        */
+#endif  /* IBMR2Fortran vmsFortran DECFortran AbsoftUNIXFortran */
+#endif  /* CRAYFortran                        */
+#endif  /* apolloFortran                      */
+
+/* 970514 - In addition to CRAY, there may be other machines
+            for which LOGICAL_STRICT makes no sense. */
+#if defined(LOGICAL_STRICT) && !defined(CRAYFortran)
+/* Force C2FLOGICAL to generate only the values for either .TRUE. or .FALSE.
+   SX/PowerStationFortran only have 0 and 1 defined.
+   Elsewhere, only needed if you want to do:
+     logical lvariable
+     if (lvariable .eq.  .true.) then       ! (1)
+   instead of
+     if (lvariable .eqv. .true.) then       ! (2)
+   - (1) may not even be FORTRAN/77 and that Apollo's f77 and IBM's xlf
+     refuse to compile (1), so you are probably well advised to stay away from 
+     (1) and from LOGICAL_STRICT.
+   - You pay a (slight) performance penalty for using LOGICAL_STRICT. */
+#undef  C2FLOGICAL
+#ifdef hpuxFortran800
+#define C2FLOGICAL(L) ((L)?0x01000000:0)
+#else
+#if defined(apolloFortran) || defined(vmsFortran) || defined(DECFortran)
+#define C2FLOGICAL(L) ((L)?-1:0) /* These machines use -1/0 for .true./.false.*/
+#else
+#define C2FLOGICAL(L) ((L)? 1:0) /* All others     use +1/0 for .true./.false.*/
+#endif
+#endif
+#endif /* LOGICAL_STRICT */
+
+/* Convert a vector of C strings into FORTRAN strings. */
+#ifndef __CF__KnR
+static char *c2fstrv(char* cstr, char *fstr, int elem_len, int sizeofcstr)
+#else
+static char *c2fstrv(      cstr,       fstr,     elem_len,     sizeofcstr)
+                     char* cstr; char *fstr; int elem_len; int sizeofcstr;
+#endif
+{ int i,j;
+/* elem_len includes \0 for C strings. Fortran strings don't have term. \0.
+   Useful size of string must be the same in both languages. */
+for (i=0; i<sizeofcstr/elem_len; i++) {
+  for (j=1; j<elem_len && *cstr; j++) *fstr++ = *cstr++;
+  cstr += 1+elem_len-j;
+  for (; j<elem_len; j++) *fstr++ = ' ';
+} /* 95109 - Seems to be returning the original fstr. */
+return fstr-sizeofcstr+sizeofcstr/elem_len; }
+
+/* Convert a vector of FORTRAN strings into C strings. */
+#ifndef __CF__KnR
+static char *f2cstrv(char *fstr, char* cstr, int elem_len, int sizeofcstr)
+#else
+static char *f2cstrv(      fstr,       cstr,     elem_len,     sizeofcstr)
+                     char *fstr; char* cstr; int elem_len; int sizeofcstr; 
+#endif
+{ int i,j;
+/* elem_len includes \0 for C strings. Fortran strings don't have term. \0.
+   Useful size of string must be the same in both languages. */
+cstr += sizeofcstr;
+fstr += sizeofcstr - sizeofcstr/elem_len;
+for (i=0; i<sizeofcstr/elem_len; i++) {
+  *--cstr = '\0';
+  for (j=1; j<elem_len; j++) *--cstr = *--fstr;
+} return cstr; }
+
+/* kill the trailing char t's in string s. */
+#ifndef __CF__KnR
+static char *kill_trailing(char *s, char t)
+#else
+static char *kill_trailing(      s,      t) char *s; char t;
+#endif
+{char *e; 
+e = s + strlen(s);
+if (e>s) {                           /* Need this to handle NULL string.*/
+  while (e>s && *--e==t);            /* Don't follow t's past beginning. */
+  e[*e==t?0:1] = '\0';               /* Handle s[0]=t correctly.       */
+} return s; }
+
+/* kill_trailingn(s,t,e) will kill the trailing t's in string s. e normally 
+points to the terminating '\0' of s, but may actually point to anywhere in s.
+s's new '\0' will be placed at e or earlier in order to remove any trailing t's.
+If e<s string s is left unchanged. */ 
+#ifndef __CF__KnR
+static char *kill_trailingn(char *s, char t, char *e)
+#else
+static char *kill_trailingn(      s,      t,       e) char *s; char t; char *e;
+#endif
+{ 
+if (e==s) *e = '\0';                 /* Kill the string makes sense here.*/
+else if (e>s) {                      /* Watch out for neg. length string.*/
+  while (e>s && *--e==t);            /* Don't follow t's past beginning. */
+  e[*e==t?0:1] = '\0';               /* Handle s[0]=t correctly.       */
+} return s; }
+
+/* Note the following assumes that any element which has t's to be chopped off,
+does indeed fill the entire element. */
+#ifndef __CF__KnR
+static char *vkill_trailing(char* cstr, int elem_len, int sizeofcstr, char t)
+#else
+static char *vkill_trailing(      cstr,     elem_len,     sizeofcstr,      t)
+                            char* cstr; int elem_len; int sizeofcstr; char t;
+#endif
+{ int i;
+for (i=0; i<sizeofcstr/elem_len; i++) /* elem_len includes \0 for C strings. */
+  kill_trailingn(cstr+elem_len*i,t,cstr+elem_len*(i+1)-1);
+return cstr; }
+
+#ifdef vmsFortran
+typedef struct dsc$descriptor_s fstring;
+#define DSC$DESCRIPTOR_A(DIMCT)  		                               \
+struct {                                                                       \
+  unsigned short dsc$w_length;	        unsigned char	 dsc$b_dtype;	       \
+  unsigned char	 dsc$b_class;	                 char	*dsc$a_pointer;	       \
+           char	 dsc$b_scale;	        unsigned char	 dsc$b_digits;         \
+  struct {                                                                     \
+    unsigned		       : 3;	  unsigned dsc$v_fl_binscale : 1;      \
+    unsigned dsc$v_fl_redim    : 1;       unsigned dsc$v_fl_column   : 1;      \
+    unsigned dsc$v_fl_coeff    : 1;       unsigned dsc$v_fl_bounds   : 1;      \
+  } dsc$b_aflags;	                                                       \
+  unsigned char	 dsc$b_dimct;	        unsigned long	 dsc$l_arsize;	       \
+           char	*dsc$a_a0;	                 long	 dsc$l_m [DIMCT];      \
+  struct {                                                                     \
+    long dsc$l_l;                         long dsc$l_u;                        \
+  } dsc$bounds [DIMCT];                                                        \
+}
+typedef DSC$DESCRIPTOR_A(1) fstringvector;
+/*typedef DSC$DESCRIPTOR_A(2) fstringarrarr;
+  typedef DSC$DESCRIPTOR_A(3) fstringarrarrarr;*/
+#define initfstr(F,C,ELEMNO,ELEMLEN)                                           \
+( (F).dsc$l_arsize=  ( (F).dsc$w_length                        =(ELEMLEN) )    \
+                    *( (F).dsc$l_m[0]=(F).dsc$bounds[0].dsc$l_u=(ELEMNO)  ),   \
+  (F).dsc$a_a0    =  ( (F).dsc$a_pointer=(C) ) - (F).dsc$w_length          ,(F))
+
+#else
+#define _NUM_ELEMS      -1
+#define _NUM_ELEM_ARG   -2
+#define NUM_ELEMS(A)    A,_NUM_ELEMS
+#define NUM_ELEM_ARG(B) *_2(A,B),_NUM_ELEM_ARG
+#define TERM_CHARS(A,B) A,B
+#ifndef __CF__KnR
+static int num_elem(char *strv, unsigned elem_len, int term_char, int num_term)
+#else
+static int num_elem(      strv,          elem_len,     term_char,     num_term)
+                    char *strv; unsigned elem_len; int term_char; int num_term;
+#endif
+/* elem_len is the number of characters in each element of strv, the FORTRAN
+vector of strings. The last element of the vector must begin with at least
+num_term term_char characters, so that this routine can determine how 
+many elements are in the vector. */
+{
+unsigned num,i;
+if (num_term == _NUM_ELEMS || num_term == _NUM_ELEM_ARG) 
+  return term_char;
+if (num_term <=0) num_term = (int)elem_len;
+for (num=0; ; num++) {
+  for (i=0; i<(unsigned)num_term && *strv==term_char; i++,strv++);
+  if (i==(unsigned)num_term) break;
+  else strv += elem_len-i;
+}
+return (int)num;
+}
+#endif
+/*-------------------------------------------------------------------------*/
+
+/*           UTILITIES FOR C TO USE STRINGS IN FORTRAN COMMON BLOCKS       */
+
+/* C string TO Fortran Common Block STRing. */
+/* DIM is the number of DIMensions of the array in terms of strings, not
+   characters. e.g. char a[12] has DIM = 0, char a[12][4] has DIM = 1, etc. */
+#define C2FCBSTR(CSTR,FSTR,DIM)                                                \
+ c2fstrv((char *)CSTR, (char *)FSTR, sizeof(FSTR)/cfelementsof(FSTR,DIM)+1,    \
+         sizeof(FSTR)+cfelementsof(FSTR,DIM))
+
+/* Fortran Common Block string TO C STRing. */
+#define FCB2CSTR(FSTR,CSTR,DIM)                                                \
+ vkill_trailing(f2cstrv((char *)FSTR, (char *)CSTR,                            \
+                        sizeof(FSTR)/cfelementsof(FSTR,DIM)+1,                 \
+                        sizeof(FSTR)+cfelementsof(FSTR,DIM)),                  \
+                sizeof(FSTR)/cfelementsof(FSTR,DIM)+1,                         \
+                sizeof(FSTR)+cfelementsof(FSTR,DIM), ' ')
+
+#define cfDEREFERENCE0
+#define cfDEREFERENCE1 *
+#define cfDEREFERENCE2 **
+#define cfDEREFERENCE3 ***
+#define cfDEREFERENCE4 ****
+#define cfDEREFERENCE5 *****
+#define cfelementsof(A,D) (sizeof(A)/sizeof(_(cfDEREFERENCE,D)(A)))
+
+/*-------------------------------------------------------------------------*/
+
+/*               UTILITIES FOR C TO CALL FORTRAN SUBROUTINES               */
+
+/* Define lookup tables for how to handle the various types of variables.  */
+
+#ifdef OLD_VAXC                                /* Prevent %CC-I-PARAMNOTUSED. */
+#pragma nostandard
+#endif
+
+#define ZTRINGV_NUM(I)       I
+#define ZTRINGV_ARGFP(I) (*(_2(A,I))) /* Undocumented. For PINT, etc. */
+#define ZTRINGV_ARGF(I) _2(A,I)
+#ifdef CFSUBASFUN
+#define ZTRINGV_ARGS(I) ZTRINGV_ARGF(I)
+#else
+#define ZTRINGV_ARGS(I) _2(B,I)
+#endif
+
+#define    PBYTE_cfVP(A,B) PINT_cfVP(A,B)
+#define  PDOUBLE_cfVP(A,B)
+#define   PFLOAT_cfVP(A,B)
+#ifdef ZTRINGV_ARGS_allows_Pvariables
+/* This allows Pvariables for ARGS. ARGF machinery is above ARGFP.
+ * B is not needed because the variable may be changed by the Fortran routine,
+ * but because B is the only way to access an arbitrary macro argument.       */
+#define     PINT_cfVP(A,B) int  B = (int)A;              /* For ZSTRINGV_ARGS */
+#else
+#define     PINT_cfVP(A,B)
+#endif
+#define PLOGICAL_cfVP(A,B) int *B;      /* Returning LOGICAL in FUNn and SUBn */
+#define    PLONG_cfVP(A,B) PINT_cfVP(A,B)
+#define   PSHORT_cfVP(A,B) PINT_cfVP(A,B)
+
+#define        VCF_INT_S(T,A,B) _(T,VVVVVVV_cfTYPE) B = A;
+#define        VCF_INT_F(T,A,B) _(T,_cfVCF)(A,B)
+/* _cfVCF table is directly mapped to _cfCCC table. */
+#define     BYTE_cfVCF(A,B)
+#define   DOUBLE_cfVCF(A,B)
+#if !defined(__CF__KnR)
+#define    FLOAT_cfVCF(A,B)
+#else
+#define    FLOAT_cfVCF(A,B) FORTRAN_REAL B = A;
+#endif
+#define      INT_cfVCF(A,B)
+#define  LOGICAL_cfVCF(A,B)
+#define     LONG_cfVCF(A,B)
+#define    SHORT_cfVCF(A,B)
+
+/* 980416
+   Cast (void (*)(CF_NULL_PROTO)) causes SunOS CC 4.2 occasionally to barf,
+   while the following equivalent typedef is fine.
+   For consistency use the typedef on all machines.
+ */
+typedef void (*cfCAST_FUNCTION)(CF_NULL_PROTO);
+
+#define VCF(TN,I)       _Icf4(4,V,TN,_(A,I),_(B,I),F)
+#define VVCF(TN,AI,BI)  _Icf4(4,V,TN,AI,BI,S)
+#define        INT_cfV(T,A,B,F) _(VCF_INT_,F)(T,A,B)
+#define       INTV_cfV(T,A,B,F)
+#define      INTVV_cfV(T,A,B,F)
+#define     INTVVV_cfV(T,A,B,F)
+#define    INTVVVV_cfV(T,A,B,F)
+#define   INTVVVVV_cfV(T,A,B,F)
+#define  INTVVVVVV_cfV(T,A,B,F)
+#define INTVVVVVVV_cfV(T,A,B,F)
+#define PINT_cfV(      T,A,B,F) _(T,_cfVP)(A,B)
+#define PVOID_cfV(     T,A,B,F)
+#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
+#define    ROUTINE_cfV(T,A,B,F) void (*B)(CF_NULL_PROTO) = (cfCAST_FUNCTION)A;
+#else
+#define    ROUTINE_cfV(T,A,B,F)
+#endif
+#define     SIMPLE_cfV(T,A,B,F)
+#ifdef vmsFortran
+#define     STRING_cfV(T,A,B,F) static struct {fstring f; unsigned clen;} B =  \
+                                       {{0,DSC$K_DTYPE_T,DSC$K_CLASS_S,NULL},0};
+#define    PSTRING_cfV(T,A,B,F) static fstring B={0,DSC$K_DTYPE_T,DSC$K_CLASS_S,NULL};
+#define    STRINGV_cfV(T,A,B,F) static fstringvector B =                       \
+  {sizeof(A),DSC$K_DTYPE_T,DSC$K_CLASS_A,NULL,0,0,{0,0,1,1,1},1,0,NULL,0,{1,0}};
+#define   PSTRINGV_cfV(T,A,B,F) static fstringvector B =                       \
+          {0,DSC$K_DTYPE_T,DSC$K_CLASS_A,NULL,0,0,{0,0,1,1,1},1,0,NULL,0,{1,0}};
+#else
+#define     STRING_cfV(T,A,B,F) struct {unsigned int clen, flen;} B;
+#define    STRINGV_cfV(T,A,B,F) struct {char *s, *fs; unsigned flen;} B;
+#define    PSTRING_cfV(T,A,B,F) int     B;
+#define   PSTRINGV_cfV(T,A,B,F) struct{char *fs; unsigned int sizeofA,flen;}B;
+#endif
+#define    ZTRINGV_cfV(T,A,B,F)  STRINGV_cfV(T,A,B,F)
+#define   PZTRINGV_cfV(T,A,B,F) PSTRINGV_cfV(T,A,B,F)
+
+/* Note that the actions of the A table were performed inside the AA table.
+   VAX Ultrix vcc, and HP-UX cc, didn't evaluate arguments to functions left to
+   right, so we had to split the original table into the current robust two. */
+#define ACF(NAME,TN,AI,I)      _(TN,_cfSTR)(4,A,NAME,I,AI,_(B,I),0)
+#define   DEFAULT_cfA(M,I,A,B)
+#define   LOGICAL_cfA(M,I,A,B) B=C2FLOGICAL(B);
+#define  PLOGICAL_cfA(M,I,A,B) A=C2FLOGICAL(A);
+#define    STRING_cfA(M,I,A,B)  STRING_cfC(M,I,A,B,sizeof(A))
+#define   PSTRING_cfA(M,I,A,B) PSTRING_cfC(M,I,A,B,sizeof(A))
+#ifdef vmsFortran
+#define  AATRINGV_cfA(    A,B, sA,filA,silA)                                   \
+ initfstr(B,_cf_malloc((sA)-(filA)),(filA),(silA)-1),                          \
+          c2fstrv(A,B.dsc$a_pointer,(silA),(sA));
+#define APATRINGV_cfA(    A,B, sA,filA,silA)                                   \
+ initfstr(B,A,(filA),(silA)-1),c2fstrv(A,A,(silA),(sA));
+#else
+#define  AATRINGV_cfA(    A,B, sA,filA,silA)                                   \
+     (B.s=_cf_malloc((sA)-(filA)),B.fs=c2fstrv(A,B.s,(B.flen=(silA)-1)+1,(sA)));
+#define APATRINGV_cfA(    A,B, sA,filA,silA)                                   \
+ B.fs=c2fstrv(A,A,(B.flen=(silA)-1)+1,B.sizeofA=(sA));
+#endif
+#define   STRINGV_cfA(M,I,A,B)                                                 \
+    AATRINGV_cfA((char *)A,B,sizeof(A),firstindexlength(A),secondindexlength(A))
+#define  PSTRINGV_cfA(M,I,A,B)                                                 \
+   APATRINGV_cfA((char *)A,B,sizeof(A),firstindexlength(A),secondindexlength(A))
+#define   ZTRINGV_cfA(M,I,A,B)  AATRINGV_cfA( (char *)A,B,                     \
+                    (_3(M,_ELEMS_,I))*(( _3(M,_ELEMLEN_,I))+1),                \
+                              (_3(M,_ELEMS_,I)),(_3(M,_ELEMLEN_,I))+1)
+#define  PZTRINGV_cfA(M,I,A,B) APATRINGV_cfA( (char *)A,B,                     \
+                    (_3(M,_ELEMS_,I))*(( _3(M,_ELEMLEN_,I))+1),                \
+                              (_3(M,_ELEMS_,I)),(_3(M,_ELEMLEN_,I))+1)
+
+#define    PBYTE_cfAAP(A,B) &A
+#define  PDOUBLE_cfAAP(A,B) &A
+#define   PFLOAT_cfAAP(A,B) FLOATVVVVVVV_cfPP &A
+#define     PINT_cfAAP(A,B) &A
+#define PLOGICAL_cfAAP(A,B) B= &A         /* B used to keep a common W table. */
+#define    PLONG_cfAAP(A,B) &A
+#define   PSHORT_cfAAP(A,B) &A
+
+#define AACF(TN,AI,I,C) _SEP_(TN,C,cfCOMMA) _Icf(3,AA,TN,AI,_(B,I))
+#define        INT_cfAA(T,A,B) &B
+#define       INTV_cfAA(T,A,B) _(T,VVVVVV_cfPP) A
+#define      INTVV_cfAA(T,A,B) _(T,VVVVV_cfPP)  A[0]
+#define     INTVVV_cfAA(T,A,B) _(T,VVVV_cfPP)   A[0][0]
+#define    INTVVVV_cfAA(T,A,B) _(T,VVV_cfPP)    A[0][0][0]
+#define   INTVVVVV_cfAA(T,A,B) _(T,VV_cfPP)     A[0][0][0][0]
+#define  INTVVVVVV_cfAA(T,A,B) _(T,V_cfPP)      A[0][0][0][0][0]
+#define INTVVVVVVV_cfAA(T,A,B) _(T,_cfPP)       A[0][0][0][0][0][0]
+#define       PINT_cfAA(T,A,B) _(T,_cfAAP)(A,B)
+#define      PVOID_cfAA(T,A,B) (void *) A
+#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran)
+#define    ROUTINE_cfAA(T,A,B) &B
+#else
+#define    ROUTINE_cfAA(T,A,B) (cfCAST_FUNCTION)A
+#endif
+#define     STRING_cfAA(T,A,B)  STRING_cfCC(T,A,B)
+#define    PSTRING_cfAA(T,A,B) PSTRING_cfCC(T,A,B)
+#ifdef vmsFortran
+#define    STRINGV_cfAA(T,A,B) &B
+#else
+#ifdef CRAYFortran
+#define    STRINGV_cfAA(T,A,B) _cptofcd(B.fs,B.flen)
+#else
+#define    STRINGV_cfAA(T,A,B) B.fs
+#endif
+#endif
+#define   PSTRINGV_cfAA(T,A,B) STRINGV_cfAA(T,A,B)
+#define    ZTRINGV_cfAA(T,A,B) STRINGV_cfAA(T,A,B)
+#define   PZTRINGV_cfAA(T,A,B) STRINGV_cfAA(T,A,B)
+
+#if defined(vmsFortran) || defined(CRAYFortran)
+#define JCF(TN,I)
+#define KCF(TN,I)
+#else
+#define JCF(TN,I)    _(TN,_cfSTR)(1,J,_(B,I), 0,0,0,0)
+#if defined(AbsoftUNIXFortran)
+#define  DEFAULT_cfJ(B) ,0
+#else
+#define  DEFAULT_cfJ(B)
+#endif
+#define  LOGICAL_cfJ(B) DEFAULT_cfJ(B)
+#define PLOGICAL_cfJ(B) DEFAULT_cfJ(B)
+#define   STRING_cfJ(B) ,B.flen
+#define  PSTRING_cfJ(B) ,B
+#define  STRINGV_cfJ(B) STRING_cfJ(B)
+#define PSTRINGV_cfJ(B) STRING_cfJ(B)
+#define  ZTRINGV_cfJ(B) STRING_cfJ(B)
+#define PZTRINGV_cfJ(B) STRING_cfJ(B)
+
+/* KCF is identical to DCF, except that KCF ZTRING is not empty. */
+#define KCF(TN,I)    _(TN,_cfSTR)(1,KK,_(B,I), 0,0,0,0)
+#if defined(AbsoftUNIXFortran)
+#define  DEFAULT_cfKK(B) , unsigned B
+#else
+#define  DEFAULT_cfKK(B)
+#endif
+#define  LOGICAL_cfKK(B) DEFAULT_cfKK(B)
+#define PLOGICAL_cfKK(B) DEFAULT_cfKK(B)
+#define   STRING_cfKK(B) , unsigned B
+#define  PSTRING_cfKK(B) STRING_cfKK(B)
+#define  STRINGV_cfKK(B) STRING_cfKK(B)
+#define PSTRINGV_cfKK(B) STRING_cfKK(B)
+#define  ZTRINGV_cfKK(B) STRING_cfKK(B)
+#define PZTRINGV_cfKK(B) STRING_cfKK(B)
+#endif
+
+#define WCF(TN,AN,I)      _(TN,_cfSTR)(2,W,AN,_(B,I), 0,0,0)
+#define  DEFAULT_cfW(A,B)
+#define  LOGICAL_cfW(A,B)
+#define PLOGICAL_cfW(A,B) *B=F2CLOGICAL(*B);
+#define   STRING_cfW(A,B) (A[B.clen]!='\0'?A[B.clen]='\0':0); /* A?="constnt"*/
+#define  PSTRING_cfW(A,B) kill_trailing(A,' ');
+#ifdef vmsFortran
+#define  STRINGV_cfW(A,B) _cf_free(B.dsc$a_pointer);
+#define PSTRINGV_cfW(A,B)                                                      \
+  vkill_trailing(f2cstrv((char*)A, (char*)A,                                   \
+                           B.dsc$w_length+1, B.dsc$l_arsize+B.dsc$l_m[0]),     \
+                   B.dsc$w_length+1, B.dsc$l_arsize+B.dsc$l_m[0], ' ');
+#else
+#define  STRINGV_cfW(A,B) _cf_free(B.s);
+#define PSTRINGV_cfW(A,B) vkill_trailing(                                      \
+         f2cstrv((char*)A,(char*)A,B.flen+1,B.sizeofA), B.flen+1,B.sizeofA,' ');
+#endif
+#define  ZTRINGV_cfW(A,B)      STRINGV_cfW(A,B)
+#define PZTRINGV_cfW(A,B)     PSTRINGV_cfW(A,B)
+
+#define   NCF(TN,I,C)       _SEP_(TN,C,cfCOMMA) _Icf(2,N,TN,_(A,I),0) 
+#define  NNCF(TN,I,C)        UUCF(TN,I,C)
+#define NNNCF(TN,I,C)       _SEP_(TN,C,cfCOLON) _Icf(2,N,TN,_(A,I),0) 
+#define        INT_cfN(T,A) _(T,VVVVVVV_cfTYPE) * A
+#define       INTV_cfN(T,A) _(T,VVVVVV_cfTYPE)  * A
+#define      INTVV_cfN(T,A) _(T,VVVVV_cfTYPE)   * A
+#define     INTVVV_cfN(T,A) _(T,VVVV_cfTYPE)    * A
+#define    INTVVVV_cfN(T,A) _(T,VVV_cfTYPE)     * A
+#define   INTVVVVV_cfN(T,A) _(T,VV_cfTYPE)      * A
+#define  INTVVVVVV_cfN(T,A) _(T,V_cfTYPE)       * A
+#define INTVVVVVVV_cfN(T,A) _(T,_cfTYPE)        * A
+#define       PINT_cfN(T,A) _(T,_cfTYPE)        * A
+#define      PVOID_cfN(T,A) void *                A
+#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran)
+#define    ROUTINE_cfN(T,A) void (**A)(CF_NULL_PROTO)
+#else
+#define    ROUTINE_cfN(T,A) void ( *A)(CF_NULL_PROTO)
+#endif
+#ifdef vmsFortran
+#define     STRING_cfN(T,A) fstring *             A
+#define    STRINGV_cfN(T,A) fstringvector *       A
+#else
+#ifdef CRAYFortran
+#define     STRING_cfN(T,A) _fcd                  A
+#define    STRINGV_cfN(T,A) _fcd                  A
+#else
+#define     STRING_cfN(T,A) char *                A
+#define    STRINGV_cfN(T,A) char *                A
+#endif
+#endif
+#define    PSTRING_cfN(T,A)   STRING_cfN(T,A) /* CRAY insists on arg.'s here. */
+#define   PNSTRING_cfN(T,A)   STRING_cfN(T,A) /* CRAY insists on arg.'s here. */
+#define   PPSTRING_cfN(T,A)   STRING_cfN(T,A) /* CRAY insists on arg.'s here. */
+#define   PSTRINGV_cfN(T,A)  STRINGV_cfN(T,A)
+#define    ZTRINGV_cfN(T,A)  STRINGV_cfN(T,A)
+#define   PZTRINGV_cfN(T,A) PSTRINGV_cfN(T,A)
+
+
+/* Apollo 6.7, CRAY, old Sun, VAX/Ultrix vcc/cc and new ultrix
+   can't hack more than 31 arg's.
+   e.g. ultrix >= 4.3 gives message:
+       zow35> cc -c -DDECFortran cfortest.c
+       cfe: Fatal: Out of memory: cfortest.c
+       zow35>
+   Old __hpux had the problem, but new 'HP-UX A.09.03 A 9000/735' is fine
+   if using -Aa, otherwise we have a problem.
+ */
+#ifndef MAX_PREPRO_ARGS
+#if !defined(__GNUC__) && (defined(VAXUltrix) || defined(__CF__APOLLO67) || (defined(sun)&&!defined(__sun)) || defined(_CRAY) || defined(__ultrix__) || (defined(__hpux)&&defined(__CF__KnR)))
+#define MAX_PREPRO_ARGS 31
+#else
+#define MAX_PREPRO_ARGS 99
+#endif
+#endif
+
+#if defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
+/* In addition to explicit Absoft stuff, only Absoft requires:
+   - DEFAULT coming from _cfSTR.
+     DEFAULT could have been called e.g. INT, but keep it for clarity.
+   - M term in CFARGT14 and CFARGT14FS.
+ */
+#define ABSOFT_cf1(T0) _(T0,_cfSTR)(0,ABSOFT1,0,0,0,0,0)
+#define ABSOFT_cf2(T0) _(T0,_cfSTR)(0,ABSOFT2,0,0,0,0,0)
+#define ABSOFT_cf3(T0) _(T0,_cfSTR)(0,ABSOFT3,0,0,0,0,0)
+#define DEFAULT_cfABSOFT1
+#define LOGICAL_cfABSOFT1
+#define  STRING_cfABSOFT1 ,MAX_LEN_FORTRAN_FUNCTION_STRING
+#define DEFAULT_cfABSOFT2
+#define LOGICAL_cfABSOFT2
+#define  STRING_cfABSOFT2 ,unsigned D0
+#define DEFAULT_cfABSOFT3
+#define LOGICAL_cfABSOFT3
+#define  STRING_cfABSOFT3 ,D0
+#else
+#define ABSOFT_cf1(T0)
+#define ABSOFT_cf2(T0)
+#define ABSOFT_cf3(T0)
+#endif
+
+/* _Z introduced to cicumvent IBM and HP silly preprocessor warning.
+   e.g. "Macro CFARGT14 invoked with a null argument."
+ */
+#define _Z
+
+#define  CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)                \
+ S(T1,1)   S(T2,2)   S(T3,3)    S(T4,4)    S(T5,5)    S(T6,6)    S(T7,7)       \
+ S(T8,8)   S(T9,9)   S(TA,10)   S(TB,11)   S(TC,12)   S(TD,13)   S(TE,14)
+#define  CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ S(T1,1)   S(T2,2)   S(T3,3)    S(T4,4)    S(T5,5)    S(T6,6)    S(T7,7)       \
+ S(T8,8)   S(T9,9)   S(TA,10)   S(TB,11)   S(TC,12)   S(TD,13)   S(TE,14)      \
+ S(TF,15)  S(TG,16)  S(TH,17)   S(TI,18)   S(TJ,19)   S(TK,20)   S(TL,21)      \
+ S(TM,22)  S(TN,23)  S(TO,24)   S(TP,25)   S(TQ,26)   S(TR,27)
+
+#define  CFARGT14FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)           \
+ F(T1,1,0) F(T2,2,1) F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)     \
+ F(T8,8,1) F(T9,9,1) F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)    \
+ M       CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define  CFARGT27FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ F(T1,1,0)  F(T2,2,1)  F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)   \
+ F(T8,8,1)  F(T9,9,1)  F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)  \
+ F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1) F(TL,21,1)  \
+ F(TM,22,1) F(TN,23,1) F(TO,24,1) F(TP,25,1) F(TQ,26,1) F(TR,27,1)             \
+ M       CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+
+#if !(defined(PowerStationFortran)||defined(hpuxFortran800))
+/*  Old CFARGT14 -> CFARGT14FS as seen below, for Absoft cross-compile yields:
+      SunOS> cc -c -Xa -DAbsoftUNIXFortran c.c
+      "c.c", line 406: warning: argument mismatch
+    Haven't checked if this is ANSI C or a SunOS bug. SunOS -Xs works ok.
+    Behavior is most clearly seen in example:
+      #define A 1 , 2
+      #define  C(X,Y,Z) x=X. y=Y. z=Z.
+      #define  D(X,Y,Z) C(X,Y,Z)
+      D(x,A,z)
+    Output from preprocessor is: x = x . y = 1 . z = 2 .
+ #define CFARGT14(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
+       CFARGT14FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+*/
+#define  CFARGT14(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)             \
+ F(T1,1,0) F(T2,2,1) F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)     \
+ F(T8,8,1) F(T9,9,1) F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)    \
+ M       CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define  CFARGT27(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ F(T1,1,0)  F(T2,2,1)  F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)   \
+ F(T8,8,1)  F(T9,9,1)  F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)  \
+ F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1) F(TL,21,1)  \
+ F(TM,22,1) F(TN,23,1) F(TO,24,1) F(TP,25,1) F(TQ,26,1) F(TR,27,1)             \
+ M       CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+
+#define  CFARGT20(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+ F(T1,1,0)  F(T2,2,1)  F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)   \
+ F(T8,8,1)  F(T9,9,1)  F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)  \
+ F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1)             \
+ S(T1,1)    S(T2,2)    S(T3,3)    S(T4,4)    S(T5,5)    S(T6,6)    S(T7,7)     \
+ S(T8,8)    S(T9,9)    S(TA,10)   S(TB,11)   S(TC,12)   S(TD,13)   S(TE,14)    \
+ S(TF,15)   S(TG,16)   S(TH,17)   S(TI,18)   S(TJ,19)   S(TK,20)
+#define CFARGTA14(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) \
+ F(T1,A1,1,0)  F(T2,A2,2,1)  F(T3,A3,3,1) F(T4,A4,4,1)  F(T5,A5,5,1)  F(T6,A6,6,1)  \
+ F(T7,A7,7,1)  F(T8,A8,8,1)  F(T9,A9,9,1) F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \
+ F(TD,AD,13,1) F(TE,AE,14,1) S(T1,1)      S(T2,2)       S(T3,3)       S(T4,4)       \
+ S(T5,5)       S(T6,6)       S(T7,7)      S(T8,8)       S(T9,9)       S(TA,10)      \
+ S(TB,11)      S(TC,12)      S(TD,13)     S(TE,14)
+#if MAX_PREPRO_ARGS>31
+#define CFARGTA20(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
+ F(T1,A1,1,0)  F(T2,A2,2,1)  F(T3,A3,3,1)  F(T4,A4,4,1)  F(T5,A5,5,1)  F(T6,A6,6,1)  \
+ F(T7,A7,7,1)  F(T8,A8,8,1)  F(T9,A9,9,1)  F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \
+ F(TD,AD,13,1) F(TE,AE,14,1) F(TF,AF,15,1) F(TG,AG,16,1) F(TH,AH,17,1) F(TI,AI,18,1) \
+ F(TJ,AJ,19,1) F(TK,AK,20,1) S(T1,1)       S(T2,2)       S(T3,3)       S(T4,4)       \
+ S(T5,5)       S(T6,6)       S(T7,7)       S(T8,8)       S(T9,9)       S(TA,10)      \
+ S(TB,11)      S(TC,12)      S(TD,13)      S(TE,14)      S(TF,15)      S(TG,16)      \
+ S(TH,17)      S(TI,18)      S(TJ,19)      S(TK,20)
+#define CFARGTA27(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+ F(T1,A1,1,0)  F(T2,A2,2,1)  F(T3,A3,3,1)  F(T4,A4,4,1)  F(T5,A5,5,1)  F(T6,A6,6,1)  \
+ F(T7,A7,7,1)  F(T8,A8,8,1)  F(T9,A9,9,1)  F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \
+ F(TD,AD,13,1) F(TE,AE,14,1) F(TF,AF,15,1) F(TG,AG,16,1) F(TH,AH,17,1) F(TI,AI,18,1) \
+ F(TJ,AJ,19,1) F(TK,AK,20,1) F(TL,AL,21,1) F(TM,AM,22,1) F(TN,AN,23,1) F(TO,AO,24,1) \
+ F(TP,AP,25,1) F(TQ,AQ,26,1) F(TR,AR,27,1) S(T1,1)       S(T2,2)       S(T3,3)       \
+ S(T4,4)       S(T5,5)       S(T6,6)       S(T7,7)       S(T8,8)       S(T9,9)       \
+ S(TA,10)      S(TB,11)      S(TC,12)      S(TD,13)      S(TE,14)      S(TF,15)      \
+ S(TG,16)      S(TH,17)      S(TI,18)      S(TJ,19)      S(TK,20)      S(TL,21)      \
+ S(TM,22)      S(TN,23)      S(TO,24)      S(TP,25)      S(TQ,26)      S(TR,27)
+#endif
+#else
+#define  CFARGT14(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)             \
+ F(T1,1,0) S(T1,1) F(T2,2,1)  S(T2,2)  F(T3,3,1)  S(T3,3)  F(T4,4,1)  S(T4,4)  \
+ F(T5,5,1) S(T5,5) F(T6,6,1)  S(T6,6)  F(T7,7,1)  S(T7,7)  F(T8,8,1)  S(T8,8)  \
+ F(T9,9,1) S(T9,9) F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \
+ F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14)
+#define  CFARGT27(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ F(T1,1,0)  S(T1,1)  F(T2,2,1)  S(T2,2)  F(T3,3,1)  S(T3,3)  F(T4,4,1)  S(T4,4)  \
+ F(T5,5,1)  S(T5,5)  F(T6,6,1)  S(T6,6)  F(T7,7,1)  S(T7,7)  F(T8,8,1)  S(T8,8)  \
+ F(T9,9,1)  S(T9,9)  F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \
+ F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14) F(TF,15,1) S(TF,15) F(TG,16,1) S(TG,16) \
+ F(TH,17,1) S(TH,17) F(TI,18,1) S(TI,18) F(TJ,19,1) S(TJ,19) F(TK,20,1) S(TK,20) \
+ F(TL,21,1) S(TL,21) F(TM,22,1) S(TM,22) F(TN,23,1) S(TN,23) F(TO,24,1) S(TO,24) \
+ F(TP,25,1) S(TP,25) F(TQ,26,1) S(TQ,26) F(TR,27,1) S(TR,27)
+
+#define  CFARGT20(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+ F(T1,1,0)  S(T1,1)  F(T2,2,1)  S(T2,2)  F(T3,3,1)  S(T3,3)  F(T4,4,1)  S(T4,4)  \
+ F(T5,5,1)  S(T5,5)  F(T6,6,1)  S(T6,6)  F(T7,7,1)  S(T7,7)  F(T8,8,1)  S(T8,8)  \
+ F(T9,9,1)  S(T9,9)  F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \
+ F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14) F(TF,15,1) S(TF,15) F(TG,16,1) S(TG,16) \
+ F(TH,17,1) S(TH,17) F(TI,18,1) S(TI,18) F(TJ,19,1) S(TJ,19) F(TK,20,1) S(TK,20)
+#define CFARGTA14(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) \
+ F(T1,A1,1,0)  S(T1,1)  F(T2,A2,2,1)  S(T2,2)  F(T3,A3,3,1)  S(T3,3)           \
+ F(T4,A4,4,1)  S(T4,4)  F(T5,A5,5,1)  S(T5,5)  F(T6,A6,6,1)  S(T6,6)           \
+ F(T7,A7,7,1)  S(T7,7)  F(T8,A8,8,1)  S(T8,8)  F(T9,A9,9,1)  S(T9,9)           \
+ F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12)          \
+ F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14)
+#if MAX_PREPRO_ARGS>31
+#define CFARGTA20(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
+ F(T1,A1,1,0)  S(T1,1)  F(T2,A2,2,1)  S(T2,2)  F(T3,A3,3,1)  S(T3,3)           \
+ F(T4,A4,4,1)  S(T4,4)  F(T5,A5,5,1)  S(T5,5)  F(T6,A6,6,1)  S(T6,6)           \
+ F(T7,A7,7,1)  S(T7,7)  F(T8,A8,8,1)  S(T8,8)  F(T9,A9,9,1)  S(T9,9)           \
+ F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12)          \
+ F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14) F(TF,AF,15,1) S(TF,15)          \
+ F(TG,AG,16,1) S(TG,16) F(TH,AH,17,1) S(TH,17) F(TI,AI,18,1) S(TI,18)          \
+ F(TJ,AJ,19,1) S(TJ,19) F(TK,AK,20,1) S(TK,20)                
+#define CFARGTA27(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+ F(T1,A1,1,0)  S(T1,1)  F(T2,A2,2,1)  S(T2,2)  F(T3,A3,3,1)  S(T3,3)           \
+ F(T4,A4,4,1)  S(T4,4)  F(T5,A5,5,1)  S(T5,5)  F(T6,A6,6,1)  S(T6,6)           \
+ F(T7,A7,7,1)  S(T7,7)  F(T8,A8,8,1)  S(T8,8)  F(T9,A9,9,1)  S(T9,9)           \
+ F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12)          \
+ F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14) F(TF,AF,15,1) S(TF,15)          \
+ F(TG,AG,16,1) S(TG,16) F(TH,AH,17,1) S(TH,17) F(TI,AI,18,1) S(TI,18)          \
+ F(TJ,AJ,19,1) S(TJ,19) F(TK,AK,20,1) S(TK,20) F(TL,AL,21,1) S(TL,21)          \
+ F(TM,AM,22,1) S(TM,22) F(TN,AN,23,1) S(TN,23) F(TO,AO,24,1) S(TO,24)          \
+ F(TP,AP,25,1) S(TP,25) F(TQ,AQ,26,1) S(TQ,26) F(TR,AR,27,1) S(TR,27)
+#endif
+#endif
+
+
+#define PROTOCCALLSFSUB1( UN,LN,T1) \
+        PROTOCCALLSFSUB14(UN,LN,T1,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB2( UN,LN,T1,T2) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB3( UN,LN,T1,T2,T3) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB4( UN,LN,T1,T2,T3,T4) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB5( UN,LN,T1,T2,T3,T4,T5) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB6( UN,LN,T1,T2,T3,T4,T5,T6) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB7( UN,LN,T1,T2,T3,T4,T5,T6,T7) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB8( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB9( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB11(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB12(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0)
+#define PROTOCCALLSFSUB13(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0)
+
+
+#define PROTOCCALLSFSUB15(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB16(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB17(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB18(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,CF_0,CF_0)
+#define PROTOCCALLSFSUB19(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,CF_0)
+
+#define PROTOCCALLSFSUB21(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB22(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB23(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB24(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB25(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0)
+#define PROTOCCALLSFSUB26(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0)
+
+
+#ifndef FCALLSC_QUALIFIER
+#ifdef VISUAL_CPLUSPLUS
+#define FCALLSC_QUALIFIER __stdcall
+#else
+#define FCALLSC_QUALIFIER
+#endif
+#endif
+
+#ifdef __cplusplus
+#define CFextern extern "C"
+#else
+#define CFextern extern
+#endif
+
+
+#ifdef CFSUBASFUN
+#define PROTOCCALLSFSUB0(UN,LN) \
+   PROTOCCALLSFFUN0( VOID,UN,LN)
+#define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
+   PROTOCCALLSFFUN14(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)\
+   PROTOCCALLSFFUN20(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)\
+   PROTOCCALLSFFUN27(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+#else
+/* Note: Prevent compiler warnings, null #define PROTOCCALLSFSUB14/20 after 
+   #include-ing cfortran.h if calling the FORTRAN wrapper within the same 
+   source code where the wrapper is created. */
+#define PROTOCCALLSFSUB0(UN,LN)     _(VOID,_cfPU)(CFC_(UN,LN))();
+#ifndef __CF__KnR
+#define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
+ _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT14(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) );
+#define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)\
+ _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT20(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) );
+#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)\
+ _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT27(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) );
+#else
+#define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)     \
+         PROTOCCALLSFSUB0(UN,LN)
+#define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+         PROTOCCALLSFSUB0(UN,LN)
+#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+         PROTOCCALLSFSUB0(UN,LN)
+#endif
+#endif
+
+
+#ifdef OLD_VAXC                                  /* Allow %CC-I-PARAMNOTUSED. */
+#pragma standard
+#endif
+
+
+#define CCALLSFSUB1( UN,LN,T1,                        A1)         \
+        CCALLSFSUB5 (UN,LN,T1,CF_0,CF_0,CF_0,CF_0,A1,0,0,0,0)
+#define CCALLSFSUB2( UN,LN,T1,T2,                     A1,A2)      \
+        CCALLSFSUB5 (UN,LN,T1,T2,CF_0,CF_0,CF_0,A1,A2,0,0,0)
+#define CCALLSFSUB3( UN,LN,T1,T2,T3,                  A1,A2,A3)   \
+        CCALLSFSUB5 (UN,LN,T1,T2,T3,CF_0,CF_0,A1,A2,A3,0,0)
+#define CCALLSFSUB4( UN,LN,T1,T2,T3,T4,               A1,A2,A3,A4)\
+        CCALLSFSUB5 (UN,LN,T1,T2,T3,T4,CF_0,A1,A2,A3,A4,0)
+#define CCALLSFSUB5( UN,LN,T1,T2,T3,T4,T5,            A1,A2,A3,A4,A5)          \
+        CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,0,0,0,0,0)
+#define CCALLSFSUB6( UN,LN,T1,T2,T3,T4,T5,T6,         A1,A2,A3,A4,A5,A6)       \
+        CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,0,0,0,0)
+#define CCALLSFSUB7( UN,LN,T1,T2,T3,T4,T5,T6,T7,      A1,A2,A3,A4,A5,A6,A7)    \
+        CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,0,0,0)
+#define CCALLSFSUB8( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,   A1,A2,A3,A4,A5,A6,A7,A8) \
+        CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,0,0)
+#define CCALLSFSUB9( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,A1,A2,A3,A4,A5,A6,A7,A8,A9)\
+        CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,0)
+#define CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA)\
+        CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,0,0,0,0)
+#define CCALLSFSUB11(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB)\
+        CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,0,0,0)
+#define CCALLSFSUB12(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC)\
+        CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,0,0)
+#define CCALLSFSUB13(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD)\
+        CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,0)
+
+#ifdef __cplusplus
+#define CPPPROTOCLSFSUB0( UN,LN)
+#define CPPPROTOCLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+#else
+#define CPPPROTOCLSFSUB0(UN,LN) \
+        PROTOCCALLSFSUB0(UN,LN)
+#define CPPPROTOCLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)     \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+#endif
+
+#ifdef CFSUBASFUN
+#define CCALLSFSUB0(UN,LN) CCALLSFFUN0(UN,LN)
+#define CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)\
+        CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)
+#else
+/* do{...}while(0) allows if(a==b) FORT(); else BORT(); */
+#define CCALLSFSUB0( UN,LN) do{CPPPROTOCLSFSUB0(UN,LN) CFC_(UN,LN)();}while(0)
+#define CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)\
+do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
+   VVCF(T6,A6,B6) VVCF(T7,A7,B7) VVCF(T8,A8,B8) VVCF(T9,A9,B9) VVCF(TA,AA,B10) \
+   VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14)             \
+   CPPPROTOCLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)          \
+   ACF(LN,T1,A1,1)  ACF(LN,T2,A2,2)  ACF(LN,T3,A3,3)                           \
+   ACF(LN,T4,A4,4)  ACF(LN,T5,A5,5)  ACF(LN,T6,A6,6)  ACF(LN,T7,A7,7)          \
+   ACF(LN,T8,A8,8)  ACF(LN,T9,A9,9)  ACF(LN,TA,AA,10) ACF(LN,TB,AB,11)         \
+   ACF(LN,TC,AC,12) ACF(LN,TD,AD,13) ACF(LN,TE,AE,14)                          \
+   CFC_(UN,LN)( CFARGTA14(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) );\
+   WCF(T1,A1,1)  WCF(T2,A2,2)  WCF(T3,A3,3)  WCF(T4,A4,4)  WCF(T5,A5,5)        \
+   WCF(T6,A6,6)  WCF(T7,A7,7)  WCF(T8,A8,8)  WCF(T9,A9,9)  WCF(TA,AA,10)       \
+   WCF(TB,AB,11) WCF(TC,AC,12) WCF(TD,AD,13) WCF(TE,AE,14)      }while(0)
+#endif
+
+
+#if MAX_PREPRO_ARGS>31
+#define CCALLSFSUB15(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF)\
+        CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,0,0,0,0,0)
+#define CCALLSFSUB16(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG)\
+        CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,0,0,0,0)
+#define CCALLSFSUB17(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH)\
+        CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,0,0,0)
+#define CCALLSFSUB18(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI)\
+        CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,0,0)
+#define CCALLSFSUB19(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ)\
+        CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,0)
+
+#ifdef CFSUBASFUN
+#define CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH, \
+        TI,TJ,TK, A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
+        CCALLSFFUN20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH, \
+        TI,TJ,TK, A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK)
+#else
+#define CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH, \
+        TI,TJ,TK, A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
+do{VVCF(T1,A1,B1)  VVCF(T2,A2,B2)  VVCF(T3,A3,B3)  VVCF(T4,A4,B4)  VVCF(T5,A5,B5)   \
+   VVCF(T6,A6,B6)  VVCF(T7,A7,B7)  VVCF(T8,A8,B8)  VVCF(T9,A9,B9)  VVCF(TA,AA,B10)  \
+   VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14) VVCF(TF,AF,B15)  \
+   VVCF(TG,AG,B16) VVCF(TH,AH,B17) VVCF(TI,AI,B18) VVCF(TJ,AJ,B19) VVCF(TK,AK,B20)  \
+   CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)  \
+   ACF(LN,T1,A1,1)  ACF(LN,T2,A2,2)  ACF(LN,T3,A3,3)  ACF(LN,T4,A4,4)          \
+   ACF(LN,T5,A5,5)  ACF(LN,T6,A6,6)  ACF(LN,T7,A7,7)  ACF(LN,T8,A8,8)          \
+   ACF(LN,T9,A9,9)  ACF(LN,TA,AA,10) ACF(LN,TB,AB,11) ACF(LN,TC,AC,12)         \
+   ACF(LN,TD,AD,13) ACF(LN,TE,AE,14) ACF(LN,TF,AF,15) ACF(LN,TG,AG,16)         \
+   ACF(LN,TH,AH,17) ACF(LN,TI,AI,18) ACF(LN,TJ,AJ,19) ACF(LN,TK,AK,20)         \
+   CFC_(UN,LN)( CFARGTA20(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) ); \
+ WCF(T1,A1,1)  WCF(T2,A2,2)  WCF(T3,A3,3)  WCF(T4,A4,4)  WCF(T5,A5,5)  WCF(T6,A6,6)  \
+ WCF(T7,A7,7)  WCF(T8,A8,8)  WCF(T9,A9,9)  WCF(TA,AA,10) WCF(TB,AB,11) WCF(TC,AC,12) \
+ WCF(TD,AD,13) WCF(TE,AE,14) WCF(TF,AF,15) WCF(TG,AG,16) WCF(TH,AH,17) WCF(TI,AI,18) \
+ WCF(TJ,AJ,19) WCF(TK,AK,20) }while(0)
+#endif
+#endif         /* MAX_PREPRO_ARGS */
+
+#if MAX_PREPRO_ARGS>31
+#define CCALLSFSUB21(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,0,0,0,0,0,0)
+#define CCALLSFSUB22(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,0,0,0,0,0)
+#define CCALLSFSUB23(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,0,0,0,0)
+#define CCALLSFSUB24(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,0,0,0)
+#define CCALLSFSUB25(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,0,0)
+#define CCALLSFSUB26(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,0)
+
+#ifdef CFSUBASFUN
+#define CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \
+                           A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+        CCALLSFFUN27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \
+                           A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR)
+#else
+#define CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \
+                           A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+do{VVCF(T1,A1,B1)  VVCF(T2,A2,B2)  VVCF(T3,A3,B3)  VVCF(T4,A4,B4)  VVCF(T5,A5,B5)   \
+   VVCF(T6,A6,B6)  VVCF(T7,A7,B7)  VVCF(T8,A8,B8)  VVCF(T9,A9,B9)  VVCF(TA,AA,B10)  \
+   VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14) VVCF(TF,AF,B15)  \
+   VVCF(TG,AG,B16) VVCF(TH,AH,B17) VVCF(TI,AI,B18) VVCF(TJ,AJ,B19) VVCF(TK,AK,B20)  \
+   VVCF(TL,AL,B21) VVCF(TM,AM,B22) VVCF(TN,AN,B23) VVCF(TO,AO,B24) VVCF(TP,AP,B25)  \
+   VVCF(TQ,AQ,B26) VVCF(TR,AR,B27)                                                  \
+   CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+   ACF(LN,T1,A1,1)  ACF(LN,T2,A2,2)  ACF(LN,T3,A3,3)  ACF(LN,T4,A4,4)          \
+   ACF(LN,T5,A5,5)  ACF(LN,T6,A6,6)  ACF(LN,T7,A7,7)  ACF(LN,T8,A8,8)          \
+   ACF(LN,T9,A9,9)  ACF(LN,TA,AA,10) ACF(LN,TB,AB,11) ACF(LN,TC,AC,12)         \
+   ACF(LN,TD,AD,13) ACF(LN,TE,AE,14) ACF(LN,TF,AF,15) ACF(LN,TG,AG,16)         \
+   ACF(LN,TH,AH,17) ACF(LN,TI,AI,18) ACF(LN,TJ,AJ,19) ACF(LN,TK,AK,20)         \
+   ACF(LN,TL,AL,21) ACF(LN,TM,AM,22) ACF(LN,TN,AN,23) ACF(LN,TO,AO,24)         \
+   ACF(LN,TP,AP,25) ACF(LN,TQ,AQ,26) ACF(LN,TR,AR,27)                          \
+   CFC_(UN,LN)( CFARGTA27(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,\
+                                   A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) ); \
+ WCF(T1,A1,1)  WCF(T2,A2,2)  WCF(T3,A3,3)  WCF(T4,A4,4)  WCF(T5,A5,5)  WCF(T6,A6,6)  \
+ WCF(T7,A7,7)  WCF(T8,A8,8)  WCF(T9,A9,9)  WCF(TA,AA,10) WCF(TB,AB,11) WCF(TC,AC,12) \
+ WCF(TD,AD,13) WCF(TE,AE,14) WCF(TF,AF,15) WCF(TG,AG,16) WCF(TH,AH,17) WCF(TI,AI,18) \
+ WCF(TJ,AJ,19) WCF(TK,AK,20) WCF(TL,AL,21) WCF(TM,AM,22) WCF(TN,AN,23) WCF(TO,AO,24) \
+ WCF(TP,AP,25) WCF(TQ,AQ,26) WCF(TR,AR,27) }while(0)
+#endif
+#endif         /* MAX_PREPRO_ARGS */
+
+/*-------------------------------------------------------------------------*/
+
+/*               UTILITIES FOR C TO CALL FORTRAN FUNCTIONS                 */
+
+/*N.B. PROTOCCALLSFFUNn(..) generates code, whether or not the FORTRAN
+  function is called. Therefore, especially for creator's of C header files
+  for large FORTRAN libraries which include many functions, to reduce
+  compile time and object code size, it may be desirable to create
+  preprocessor directives to allow users to create code for only those
+  functions which they use.                                                */
+
+/* The following defines the maximum length string that a function can return.
+   Of course it may be undefine-d and re-define-d before individual
+   PROTOCCALLSFFUNn(..) as required. It would also be nice to have this derived
+   from the individual machines' limits.                                      */
+#define MAX_LEN_FORTRAN_FUNCTION_STRING 0x4FE
+
+/* The following defines a character used by CFORTRAN.H to flag the end of a
+   string coming out of a FORTRAN routine.                                 */
+#define CFORTRAN_NON_CHAR 0x7F
+
+#ifdef OLD_VAXC                                /* Prevent %CC-I-PARAMNOTUSED. */
+#pragma nostandard
+#endif
+
+#define _SEP_(TN,C,cfCOMMA)     _(__SEP_,C)(TN,cfCOMMA)
+#define __SEP_0(TN,cfCOMMA)  
+#define __SEP_1(TN,cfCOMMA)     _Icf(2,SEP,TN,cfCOMMA,0)
+#define        INT_cfSEP(T,B) _(A,B)
+#define       INTV_cfSEP(T,B) INT_cfSEP(T,B)
+#define      INTVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define     INTVVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define    INTVVVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define   INTVVVVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define  INTVVVVVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define INTVVVVVVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define       PINT_cfSEP(T,B) INT_cfSEP(T,B)
+#define      PVOID_cfSEP(T,B) INT_cfSEP(T,B)
+#define    ROUTINE_cfSEP(T,B) INT_cfSEP(T,B)
+#define     SIMPLE_cfSEP(T,B) INT_cfSEP(T,B)
+#define       VOID_cfSEP(T,B) INT_cfSEP(T,B)    /* For FORTRAN calls C subr.s.*/
+#define     STRING_cfSEP(T,B) INT_cfSEP(T,B)
+#define    STRINGV_cfSEP(T,B) INT_cfSEP(T,B)
+#define    PSTRING_cfSEP(T,B) INT_cfSEP(T,B)
+#define   PSTRINGV_cfSEP(T,B) INT_cfSEP(T,B)
+#define   PNSTRING_cfSEP(T,B) INT_cfSEP(T,B)
+#define   PPSTRING_cfSEP(T,B) INT_cfSEP(T,B)
+#define    ZTRINGV_cfSEP(T,B) INT_cfSEP(T,B)
+#define   PZTRINGV_cfSEP(T,B) INT_cfSEP(T,B)
+                         
+#if defined(SIGNED_BYTE) || !defined(UNSIGNED_BYTE)
+#ifdef OLD_VAXC
+#define INTEGER_BYTE               char    /* Old VAXC barfs on 'signed char' */
+#else
+#define INTEGER_BYTE        signed char    /* default */
+#endif
+#else
+#define INTEGER_BYTE        unsigned char
+#endif
+#define    BYTEVVVVVVV_cfTYPE INTEGER_BYTE
+#define  DOUBLEVVVVVVV_cfTYPE DOUBLE_PRECISION 
+#define   FLOATVVVVVVV_cfTYPE FORTRAN_REAL
+#define     INTVVVVVVV_cfTYPE int
+#define LOGICALVVVVVVV_cfTYPE int
+#define    LONGVVVVVVV_cfTYPE long
+#define   SHORTVVVVVVV_cfTYPE short
+#define          PBYTE_cfTYPE INTEGER_BYTE
+#define        PDOUBLE_cfTYPE DOUBLE_PRECISION 
+#define         PFLOAT_cfTYPE FORTRAN_REAL
+#define           PINT_cfTYPE int
+#define       PLOGICAL_cfTYPE int
+#define          PLONG_cfTYPE long
+#define         PSHORT_cfTYPE short
+
+#define CFARGS0(A,T,V,W,X,Y,Z) _3(T,_cf,A)
+#define CFARGS1(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V)
+#define CFARGS2(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W)
+#define CFARGS3(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W,X)
+#define CFARGS4(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W,X,Y)
+#define CFARGS5(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W,X,Y,Z)
+
+#define  _Icf(N,T,I,X,Y)                 _(I,_cfINT)(N,T,I,X,Y,0)
+#define _Icf4(N,T,I,X,Y,Z)               _(I,_cfINT)(N,T,I,X,Y,Z)
+#define           BYTE_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define         DOUBLE_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INT,B,X,Y,Z,0)
+#define          FLOAT_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define            INT_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define        LOGICAL_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define           LONG_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define          SHORT_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define          PBYTE_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define        PDOUBLE_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,PINT,B,X,Y,Z,0)
+#define         PFLOAT_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define           PINT_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define       PLOGICAL_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define          PLONG_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define         PSHORT_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define          BYTEV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define         BYTEVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define        BYTEVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define       BYTEVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define      BYTEVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define     BYTEVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define    BYTEVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define        DOUBLEV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTV,B,X,Y,Z,0)
+#define       DOUBLEVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVV,B,X,Y,Z,0)
+#define      DOUBLEVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVV,B,X,Y,Z,0)
+#define     DOUBLEVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVV,B,X,Y,Z,0)
+#define    DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVVV,B,X,Y,Z,0)
+#define   DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVVVV,B,X,Y,Z,0)
+#define  DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVVVVV,B,X,Y,Z,0)
+#define         FLOATV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define        FLOATVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define       FLOATVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define      FLOATVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define     FLOATVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define    FLOATVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define   FLOATVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define           INTV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define          INTVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define         INTVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define        INTVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define       INTVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define      INTVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define     INTVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define       LOGICALV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define      LOGICALVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define     LOGICALVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define    LOGICALVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define   LOGICALVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define  LOGICALVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define LOGICALVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define          LONGV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define         LONGVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define        LONGVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define       LONGVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define      LONGVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define     LONGVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define    LONGVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define         SHORTV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define        SHORTVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define       SHORTVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define      SHORTVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define     SHORTVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define    SHORTVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define   SHORTVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define          PVOID_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,B,B,X,Y,Z,0)
+#define        ROUTINE_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+/*CRAY coughs on the first,
+  i.e. the usual trouble of not being able to
+  define macros to macros with arguments. 
+  New ultrix is worse, it coughs on all such uses.
+ */
+/*#define       SIMPLE_cfINT                    PVOID_cfINT*/
+#define         SIMPLE_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define           VOID_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define         STRING_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define        STRINGV_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define        PSTRING_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define       PSTRINGV_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define       PNSTRING_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define       PPSTRING_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define        ZTRINGV_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define       PZTRINGV_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define           CF_0_cfINT(N,A,B,X,Y,Z)
+                         
+
+#define   UCF(TN,I,C)  _SEP_(TN,C,cfCOMMA) _Icf(2,U,TN,_(A,I),0)
+#define  UUCF(TN,I,C)  _SEP_(TN,C,cfCOMMA) _SEP_(TN,1,I) 
+#define UUUCF(TN,I,C)  _SEP_(TN,C,cfCOLON) _Icf(2,U,TN,_(A,I),0)
+#define        INT_cfU(T,A) _(T,VVVVVVV_cfTYPE)   A
+#define       INTV_cfU(T,A) _(T,VVVVVV_cfTYPE)  * A
+#define      INTVV_cfU(T,A) _(T,VVVVV_cfTYPE)   * A
+#define     INTVVV_cfU(T,A) _(T,VVVV_cfTYPE)    * A
+#define    INTVVVV_cfU(T,A) _(T,VVV_cfTYPE)     * A
+#define   INTVVVVV_cfU(T,A) _(T,VV_cfTYPE)      * A
+#define  INTVVVVVV_cfU(T,A) _(T,V_cfTYPE)       * A
+#define INTVVVVVVV_cfU(T,A) _(T,_cfTYPE)        * A
+#define       PINT_cfU(T,A) _(T,_cfTYPE)        * A
+#define      PVOID_cfU(T,A) void  *A 
+#define    ROUTINE_cfU(T,A) void (*A)(CF_NULL_PROTO) 
+#define       VOID_cfU(T,A) void   A    /* Needed for C calls FORTRAN sub.s.  */
+#define     STRING_cfU(T,A) char  *A    /*            via VOID and wrapper.   */
+#define    STRINGV_cfU(T,A) char  *A
+#define    PSTRING_cfU(T,A) char  *A
+#define   PSTRINGV_cfU(T,A) char  *A
+#define    ZTRINGV_cfU(T,A) char  *A
+#define   PZTRINGV_cfU(T,A) char  *A
+
+/* VOID breaks U into U and UU. */
+#define       INT_cfUU(T,A) _(T,VVVVVVV_cfTYPE) A
+#define      VOID_cfUU(T,A)             /* Needed for FORTRAN calls C sub.s.  */
+#define    STRING_cfUU(T,A) char *A 
+
+
+#define      BYTE_cfPU(A)   CFextern INTEGER_BYTE      FCALLSC_QUALIFIER A
+#define    DOUBLE_cfPU(A)   CFextern DOUBLE_PRECISION  FCALLSC_QUALIFIER A
+#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
+#define     FLOAT_cfPU(A)   CFextern FORTRAN_REAL      FCALLSC_QUALIFIER A
+#else				   	                   
+#define     FLOAT_cfPU(A)   CFextern FLOATFUNCTIONTYPE FCALLSC_QUALIFIER A
+#endif				   	                   
+#define       INT_cfPU(A)   CFextern int   FCALLSC_QUALIFIER   A
+#define   LOGICAL_cfPU(A)   CFextern int   FCALLSC_QUALIFIER   A
+#define      LONG_cfPU(A)   CFextern long  FCALLSC_QUALIFIER   A
+#define     SHORT_cfPU(A)   CFextern short FCALLSC_QUALIFIER   A
+#define    STRING_cfPU(A)   CFextern void  FCALLSC_QUALIFIER   A
+#define      VOID_cfPU(A)   CFextern void  FCALLSC_QUALIFIER   A
+
+#define    BYTE_cfE INTEGER_BYTE     A0;
+#define  DOUBLE_cfE DOUBLE_PRECISION A0;
+#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
+#define   FLOAT_cfE FORTRAN_REAL  A0;
+#else
+#define   FLOAT_cfE FORTRAN_REAL AA0;   FLOATFUNCTIONTYPE A0;
+#endif
+#define     INT_cfE int    A0;
+#define LOGICAL_cfE int    A0;
+#define    LONG_cfE long   A0;
+#define   SHORT_cfE short  A0;
+#define    VOID_cfE
+#ifdef vmsFortran
+#define  STRING_cfE static char AA0[1+MAX_LEN_FORTRAN_FUNCTION_STRING];        \
+                       static fstring A0 =                                     \
+             {MAX_LEN_FORTRAN_FUNCTION_STRING,DSC$K_DTYPE_T,DSC$K_CLASS_S,AA0};\
+               memset(AA0, CFORTRAN_NON_CHAR, MAX_LEN_FORTRAN_FUNCTION_STRING);\
+                                    *(AA0+MAX_LEN_FORTRAN_FUNCTION_STRING)='\0';
+#else
+#ifdef CRAYFortran
+#define  STRING_cfE static char AA0[1+MAX_LEN_FORTRAN_FUNCTION_STRING];        \
+                   static _fcd A0; *(AA0+MAX_LEN_FORTRAN_FUNCTION_STRING)='\0';\
+                memset(AA0,CFORTRAN_NON_CHAR, MAX_LEN_FORTRAN_FUNCTION_STRING);\
+                            A0 = _cptofcd(AA0,MAX_LEN_FORTRAN_FUNCTION_STRING);
+#else
+/* 'cc: SC3.0.1 13 Jul 1994' barfs on char A0[0x4FE+1]; 
+ * char A0[0x4FE +1]; char A0[1+0x4FE]; are both OK.     */
+#define STRING_cfE static char A0[1+MAX_LEN_FORTRAN_FUNCTION_STRING];          \
+                       memset(A0, CFORTRAN_NON_CHAR,                           \
+                              MAX_LEN_FORTRAN_FUNCTION_STRING);                \
+                       *(A0+MAX_LEN_FORTRAN_FUNCTION_STRING)='\0';
+#endif
+#endif
+/* ESTRING must use static char. array which is guaranteed to exist after
+   function returns.                                                     */
+
+/* N.B.i) The diff. for 0 (Zero) and >=1 arguments.
+       ii)That the following create an unmatched bracket, i.e. '(', which
+          must of course be matched in the call.
+       iii)Commas must be handled very carefully                         */
+#define    INT_cfGZ(T,UN,LN) A0=CFC_(UN,LN)(
+#define   VOID_cfGZ(T,UN,LN)    CFC_(UN,LN)(
+#ifdef vmsFortran
+#define STRING_cfGZ(T,UN,LN)    CFC_(UN,LN)(&A0
+#else
+#if defined(CRAYFortran) || defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
+#define STRING_cfGZ(T,UN,LN)    CFC_(UN,LN)( A0
+#else
+#define STRING_cfGZ(T,UN,LN)    CFC_(UN,LN)( A0,MAX_LEN_FORTRAN_FUNCTION_STRING
+#endif
+#endif
+
+#define     INT_cfG(T,UN,LN)    INT_cfGZ(T,UN,LN)
+#define    VOID_cfG(T,UN,LN)   VOID_cfGZ(T,UN,LN)
+#define  STRING_cfG(T,UN,LN) STRING_cfGZ(T,UN,LN), /*, is only diff. from _cfG*/
+
+#define    BYTEVVVVVVV_cfPP
+#define     INTVVVVVVV_cfPP     /* These complement FLOATVVVVVVV_cfPP. */
+#define  DOUBLEVVVVVVV_cfPP
+#define LOGICALVVVVVVV_cfPP
+#define    LONGVVVVVVV_cfPP
+#define   SHORTVVVVVVV_cfPP
+#define          PBYTE_cfPP
+#define           PINT_cfPP
+#define        PDOUBLE_cfPP
+#define       PLOGICAL_cfPP
+#define          PLONG_cfPP
+#define         PSHORT_cfPP
+#define         PFLOAT_cfPP FLOATVVVVVVV_cfPP
+
+#define BCF(TN,AN,C)        _SEP_(TN,C,cfCOMMA) _Icf(2,B,TN,AN,0)
+#define        INT_cfB(T,A) (_(T,VVVVVVV_cfTYPE)) A
+#define       INTV_cfB(T,A)            A
+#define      INTVV_cfB(T,A)           (A)[0]
+#define     INTVVV_cfB(T,A)           (A)[0][0]
+#define    INTVVVV_cfB(T,A)           (A)[0][0][0]
+#define   INTVVVVV_cfB(T,A)           (A)[0][0][0][0]
+#define  INTVVVVVV_cfB(T,A)           (A)[0][0][0][0][0]
+#define INTVVVVVVV_cfB(T,A)           (A)[0][0][0][0][0][0]
+#define       PINT_cfB(T,A) _(T,_cfPP)&A
+#define     STRING_cfB(T,A) (char *)   A
+#define    STRINGV_cfB(T,A) (char *)   A
+#define    PSTRING_cfB(T,A) (char *)   A
+#define   PSTRINGV_cfB(T,A) (char *)   A
+#define      PVOID_cfB(T,A) (void *)   A
+#define    ROUTINE_cfB(T,A) (cfCAST_FUNCTION)A
+#define    ZTRINGV_cfB(T,A) (char *)   A
+#define   PZTRINGV_cfB(T,A) (char *)   A
+                                                              	
+#define SCF(TN,NAME,I,A)    _(TN,_cfSTR)(3,S,NAME,I,A,0,0)
+#define  DEFAULT_cfS(M,I,A)
+#define  LOGICAL_cfS(M,I,A)
+#define PLOGICAL_cfS(M,I,A)
+#define   STRING_cfS(M,I,A) ,sizeof(A)
+#define  STRINGV_cfS(M,I,A) ,( (unsigned)0xFFFF*firstindexlength(A) \
+                              +secondindexlength(A))
+#define  PSTRING_cfS(M,I,A) ,sizeof(A)
+#define PSTRINGV_cfS(M,I,A) STRINGV_cfS(M,I,A)
+#define  ZTRINGV_cfS(M,I,A)
+#define PZTRINGV_cfS(M,I,A)
+
+#define   HCF(TN,I)         _(TN,_cfSTR)(3,H,cfCOMMA, H,_(C,I),0,0)
+#define  HHCF(TN,I)         _(TN,_cfSTR)(3,H,cfCOMMA,HH,_(C,I),0,0)
+#define HHHCF(TN,I)         _(TN,_cfSTR)(3,H,cfCOLON, H,_(C,I),0,0)
+#define  H_CF_SPECIAL       unsigned
+#define HH_CF_SPECIAL
+#define  DEFAULT_cfH(M,I,A)
+#define  LOGICAL_cfH(S,U,B)
+#define PLOGICAL_cfH(S,U,B)
+#define   STRING_cfH(S,U,B) _(A,S) _(U,_CF_SPECIAL) B
+#define  STRINGV_cfH(S,U,B) STRING_cfH(S,U,B)
+#define  PSTRING_cfH(S,U,B) STRING_cfH(S,U,B)
+#define PSTRINGV_cfH(S,U,B) STRING_cfH(S,U,B)
+#define PNSTRING_cfH(S,U,B) STRING_cfH(S,U,B)
+#define PPSTRING_cfH(S,U,B) STRING_cfH(S,U,B)
+#define  ZTRINGV_cfH(S,U,B)
+#define PZTRINGV_cfH(S,U,B)
+
+/* Need VOID_cfSTR because Absoft forced function types go through _cfSTR. */
+/* No spaces inside expansion. They screws up macro catenation kludge.     */
+#define           VOID_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define           BYTE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         DOUBLE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          FLOAT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define            INT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        LOGICAL_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,LOGICAL,A,B,C,D,E)
+#define           LONG_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          SHORT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          BYTEV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         BYTEVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        BYTEVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       BYTEVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      BYTEVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     BYTEVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    BYTEVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        DOUBLEV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       DOUBLEVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      DOUBLEVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     DOUBLEVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    DOUBLEVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define   DOUBLEVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define  DOUBLEVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         FLOATV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        FLOATVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       FLOATVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      FLOATVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     FLOATVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    FLOATVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define   FLOATVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define           INTV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          INTVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         INTVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        INTVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       INTVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      INTVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     INTVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       LOGICALV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      LOGICALVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     LOGICALVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    LOGICALVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define   LOGICALVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define  LOGICALVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define LOGICALVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          LONGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         LONGVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        LONGVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       LONGVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      LONGVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     LONGVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    LONGVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         SHORTV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        SHORTVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       SHORTVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      SHORTVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     SHORTVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    SHORTVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define   SHORTVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          PBYTE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        PDOUBLE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         PFLOAT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define           PINT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       PLOGICAL_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PLOGICAL,A,B,C,D,E)
+#define          PLONG_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         PSHORT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         STRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,STRING,A,B,C,D,E)
+#define        PSTRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PSTRING,A,B,C,D,E)
+#define        STRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,STRINGV,A,B,C,D,E)
+#define       PSTRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PSTRINGV,A,B,C,D,E)
+#define       PNSTRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PNSTRING,A,B,C,D,E)
+#define       PPSTRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PPSTRING,A,B,C,D,E)
+#define          PVOID_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        ROUTINE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         SIMPLE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        ZTRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,ZTRINGV,A,B,C,D,E)
+#define       PZTRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PZTRINGV,A,B,C,D,E)
+#define           CF_0_cfSTR(N,T,A,B,C,D,E)
+
+/* See ACF table comments, which explain why CCF was split into two. */
+#define CCF(NAME,TN,I)     _(TN,_cfSTR)(5,C,NAME,I,_(A,I),_(B,I),_(C,I))
+#define  DEFAULT_cfC(M,I,A,B,C)
+#define  LOGICAL_cfC(M,I,A,B,C)  A=C2FLOGICAL( A);
+#define PLOGICAL_cfC(M,I,A,B,C) *A=C2FLOGICAL(*A);
+#ifdef vmsFortran
+#define   STRING_cfC(M,I,A,B,C) (B.clen=strlen(A),B.f.dsc$a_pointer=A,         \
+        C==sizeof(char*)||C==(unsigned)(B.clen+1)?B.f.dsc$w_length=B.clen:     \
+          (memset((A)+B.clen,' ',C-B.clen-1),A[B.f.dsc$w_length=C-1]='\0'));
+      /* PSTRING_cfC to beware of array A which does not contain any \0.      */
+#define  PSTRING_cfC(M,I,A,B,C) (B.dsc$a_pointer=A, C==sizeof(char*) ?         \
+             B.dsc$w_length=strlen(A):  (A[C-1]='\0',B.dsc$w_length=strlen(A), \
+       memset((A)+B.dsc$w_length,' ',C-B.dsc$w_length-1), B.dsc$w_length=C-1));
+#else
+#define   STRING_cfC(M,I,A,B,C) (B.clen=strlen(A),                             \
+                C==sizeof(char*)||C==(unsigned)(B.clen+1)?B.flen=B.clen:       \
+                        (memset((A)+B.clen,' ',C-B.clen-1),A[B.flen=C-1]='\0'));
+#define  PSTRING_cfC(M,I,A,B,C) (C==sizeof(char*)? B=strlen(A):                \
+                    (A[C-1]='\0',B=strlen(A),memset((A)+B,' ',C-B-1),B=C-1));
+#endif
+          /* For CRAYFortran for (P)STRINGV_cfC, B.fs is set, but irrelevant. */
+#define  STRINGV_cfC(M,I,A,B,C) \
+        AATRINGV_cfA(    A,B,(C/0xFFFF)*(C%0xFFFF),C/0xFFFF,C%0xFFFF)
+#define PSTRINGV_cfC(M,I,A,B,C) \
+       APATRINGV_cfA(    A,B,(C/0xFFFF)*(C%0xFFFF),C/0xFFFF,C%0xFFFF)
+#define  ZTRINGV_cfC(M,I,A,B,C) \
+        AATRINGV_cfA(    A,B, (_3(M,_ELEMS_,I))*((_3(M,_ELEMLEN_,I))+1),       \
+                              (_3(M,_ELEMS_,I)), (_3(M,_ELEMLEN_,I))+1   )
+#define PZTRINGV_cfC(M,I,A,B,C) \
+       APATRINGV_cfA(    A,B, (_3(M,_ELEMS_,I))*((_3(M,_ELEMLEN_,I))+1),       \
+                              (_3(M,_ELEMS_,I)), (_3(M,_ELEMLEN_,I))+1   )
+
+#define     BYTE_cfCCC(A,B) &A
+#define   DOUBLE_cfCCC(A,B) &A
+#if !defined(__CF__KnR)
+#define    FLOAT_cfCCC(A,B) &A
+                               /* Although the VAX doesn't, at least the      */
+#else                          /* HP and K&R mips promote float arg.'s of     */
+#define    FLOAT_cfCCC(A,B) &B /* unprototyped functions to double. Cannot    */
+#endif                         /* use A here to pass the argument to FORTRAN. */
+#define      INT_cfCCC(A,B) &A
+#define  LOGICAL_cfCCC(A,B) &A
+#define     LONG_cfCCC(A,B) &A
+#define    SHORT_cfCCC(A,B) &A
+#define    PBYTE_cfCCC(A,B)  A
+#define  PDOUBLE_cfCCC(A,B)  A
+#define   PFLOAT_cfCCC(A,B)  A
+#define     PINT_cfCCC(A,B)  A
+#define PLOGICAL_cfCCC(A,B)  B=A       /* B used to keep a common W table. */
+#define    PLONG_cfCCC(A,B)  A
+#define   PSHORT_cfCCC(A,B)  A
+
+#define CCCF(TN,I,M)           _SEP_(TN,M,cfCOMMA) _Icf(3,CC,TN,_(A,I),_(B,I))
+#define        INT_cfCC(T,A,B) _(T,_cfCCC)(A,B) 
+#define       INTV_cfCC(T,A,B)  A
+#define      INTVV_cfCC(T,A,B)  A
+#define     INTVVV_cfCC(T,A,B)  A
+#define    INTVVVV_cfCC(T,A,B)  A
+#define   INTVVVVV_cfCC(T,A,B)  A
+#define  INTVVVVVV_cfCC(T,A,B)  A
+#define INTVVVVVVV_cfCC(T,A,B)  A
+#define       PINT_cfCC(T,A,B) _(T,_cfCCC)(A,B) 
+#define      PVOID_cfCC(T,A,B)  A
+#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran)
+#define    ROUTINE_cfCC(T,A,B) &A
+#else
+#define    ROUTINE_cfCC(T,A,B)  A
+#endif
+#define     SIMPLE_cfCC(T,A,B)  A
+#ifdef vmsFortran
+#define     STRING_cfCC(T,A,B) &B.f
+#define    STRINGV_cfCC(T,A,B) &B
+#define    PSTRING_cfCC(T,A,B) &B
+#define   PSTRINGV_cfCC(T,A,B) &B
+#else
+#ifdef CRAYFortran
+#define     STRING_cfCC(T,A,B) _cptofcd(A,B.flen)
+#define    STRINGV_cfCC(T,A,B) _cptofcd(B.s,B.flen)
+#define    PSTRING_cfCC(T,A,B) _cptofcd(A,B)
+#define   PSTRINGV_cfCC(T,A,B) _cptofcd(A,B.flen)
+#else
+#define     STRING_cfCC(T,A,B)  A
+#define    STRINGV_cfCC(T,A,B)  B.fs
+#define    PSTRING_cfCC(T,A,B)  A
+#define   PSTRINGV_cfCC(T,A,B)  B.fs
+#endif
+#endif
+#define    ZTRINGV_cfCC(T,A,B)   STRINGV_cfCC(T,A,B)
+#define   PZTRINGV_cfCC(T,A,B)  PSTRINGV_cfCC(T,A,B)
+
+#define    BYTE_cfX  return A0;
+#define  DOUBLE_cfX  return A0;
+#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
+#define   FLOAT_cfX  return A0;
+#else
+#define   FLOAT_cfX  ASSIGNFLOAT(AA0,A0); return AA0;
+#endif
+#define     INT_cfX  return A0;
+#define LOGICAL_cfX  return F2CLOGICAL(A0);
+#define    LONG_cfX  return A0;
+#define   SHORT_cfX  return A0;
+#define    VOID_cfX  return   ;
+#if defined(vmsFortran) || defined(CRAYFortran)
+#define  STRING_cfX  return kill_trailing(                                     \
+                                      kill_trailing(AA0,CFORTRAN_NON_CHAR),' ');
+#else
+#define  STRING_cfX  return kill_trailing(                                     \
+                                      kill_trailing( A0,CFORTRAN_NON_CHAR),' ');
+#endif
+
+#define CFFUN(NAME) _(__cf__,NAME)
+
+/* Note that we don't use LN here, but we keep it for consistency. */
+#define CCALLSFFUN0(UN,LN) CFFUN(UN)()
+
+#ifdef OLD_VAXC                                  /* Allow %CC-I-PARAMNOTUSED. */
+#pragma standard
+#endif
+
+#define CCALLSFFUN1( UN,LN,T1,                        A1)         \
+        CCALLSFFUN5 (UN,LN,T1,CF_0,CF_0,CF_0,CF_0,A1,0,0,0,0)
+#define CCALLSFFUN2( UN,LN,T1,T2,                     A1,A2)      \
+        CCALLSFFUN5 (UN,LN,T1,T2,CF_0,CF_0,CF_0,A1,A2,0,0,0)
+#define CCALLSFFUN3( UN,LN,T1,T2,T3,                  A1,A2,A3)   \
+        CCALLSFFUN5 (UN,LN,T1,T2,T3,CF_0,CF_0,A1,A2,A3,0,0)
+#define CCALLSFFUN4( UN,LN,T1,T2,T3,T4,               A1,A2,A3,A4)\
+        CCALLSFFUN5 (UN,LN,T1,T2,T3,T4,CF_0,A1,A2,A3,A4,0)
+#define CCALLSFFUN5( UN,LN,T1,T2,T3,T4,T5,            A1,A2,A3,A4,A5)          \
+        CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,0,0,0,0,0)
+#define CCALLSFFUN6( UN,LN,T1,T2,T3,T4,T5,T6,         A1,A2,A3,A4,A5,A6)       \
+        CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,0,0,0,0)
+#define CCALLSFFUN7( UN,LN,T1,T2,T3,T4,T5,T6,T7,      A1,A2,A3,A4,A5,A6,A7)    \
+        CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,0,0,0)
+#define CCALLSFFUN8( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,   A1,A2,A3,A4,A5,A6,A7,A8) \
+        CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,0,0)
+#define CCALLSFFUN9( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,A1,A2,A3,A4,A5,A6,A7,A8,A9)\
+        CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,0)
+#define CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA)\
+        CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,0,0,0,0)
+#define CCALLSFFUN11(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB)\
+        CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,0,0,0)
+#define CCALLSFFUN12(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC)\
+        CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,0,0)
+#define CCALLSFFUN13(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD)\
+        CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,0)
+
+#define CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)\
+((CFFUN(UN)(  BCF(T1,A1,0) BCF(T2,A2,1) BCF(T3,A3,1) BCF(T4,A4,1) BCF(T5,A5,1) \
+              BCF(T6,A6,1) BCF(T7,A7,1) BCF(T8,A8,1) BCF(T9,A9,1) BCF(TA,AA,1) \
+              BCF(TB,AB,1) BCF(TC,AC,1) BCF(TD,AD,1) BCF(TE,AE,1)              \
+           SCF(T1,LN,1,A1)  SCF(T2,LN,2,A2)  SCF(T3,LN,3,A3)  SCF(T4,LN,4,A4)  \
+           SCF(T5,LN,5,A5)  SCF(T6,LN,6,A6)  SCF(T7,LN,7,A7)  SCF(T8,LN,8,A8)  \
+           SCF(T9,LN,9,A9)  SCF(TA,LN,10,AA) SCF(TB,LN,11,AB) SCF(TC,LN,12,AC) \
+           SCF(TD,LN,13,AD) SCF(TE,LN,14,AE))))
+
+/*  N.B. Create a separate function instead of using (call function, function
+value here) because in order to create the variables needed for the input
+arg.'s which may be const.'s one has to do the creation within {}, but these
+can never be placed within ()'s. Therefore one must create wrapper functions.
+gcc, on the other hand may be able to avoid the wrapper functions. */
+
+/* Prototypes are needed to correctly handle the value returned correctly. N.B.
+Can only have prototype arg.'s with difficulty, a la G... table since FORTRAN
+functions returning strings have extra arg.'s. Don't bother, since this only
+causes a compiler warning to come up when one uses FCALLSCFUNn and CCALLSFFUNn
+for the same function in the same source code. Something done by the experts in
+debugging only.*/    
+
+#define PROTOCCALLSFFUN0(F,UN,LN)                                              \
+_(F,_cfPU)( CFC_(UN,LN))(CF_NULL_PROTO);                                       \
+static _Icf(2,U,F,CFFUN(UN),0)() {_(F,_cfE) _Icf(3,GZ,F,UN,LN) ABSOFT_cf1(F));_(F,_cfX)}
+
+#define PROTOCCALLSFFUN1( T0,UN,LN,T1)                                         \
+        PROTOCCALLSFFUN5 (T0,UN,LN,T1,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN2( T0,UN,LN,T1,T2)                                      \
+        PROTOCCALLSFFUN5 (T0,UN,LN,T1,T2,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN3( T0,UN,LN,T1,T2,T3)                                   \
+        PROTOCCALLSFFUN5 (T0,UN,LN,T1,T2,T3,CF_0,CF_0)
+#define PROTOCCALLSFFUN4( T0,UN,LN,T1,T2,T3,T4)                                \
+        PROTOCCALLSFFUN5 (T0,UN,LN,T1,T2,T3,T4,CF_0)
+#define PROTOCCALLSFFUN5( T0,UN,LN,T1,T2,T3,T4,T5)                             \
+        PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN6( T0,UN,LN,T1,T2,T3,T4,T5,T6)                          \
+        PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN7( T0,UN,LN,T1,T2,T3,T4,T5,T6,T7)                       \
+        PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN8( T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8)                    \
+        PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0)
+#define PROTOCCALLSFFUN9( T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9)                 \
+        PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0)
+#define PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA)              \
+        PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN11(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB)           \
+        PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN12(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC)        \
+        PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0)
+#define PROTOCCALLSFFUN13(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD)     \
+        PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0)
+
+/* HP/UX 9.01 cc requires the blank between '_Icf(3,G,T0,UN,LN) CCCF(T1,1,0)' */
+
+#ifndef __CF__KnR
+#define PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)  \
+ _(T0,_cfPU)(CFC_(UN,LN))(CF_NULL_PROTO); static _Icf(2,U,T0,CFFUN(UN),0)(     \
+   CFARGT14FS(UCF,HCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) )          \
+{       CFARGT14S(VCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    _(T0,_cfE) \
+ CCF(LN,T1,1)  CCF(LN,T2,2)  CCF(LN,T3,3)  CCF(LN,T4,4)  CCF(LN,T5,5)          \
+ CCF(LN,T6,6)  CCF(LN,T7,7)  CCF(LN,T8,8)  CCF(LN,T9,9)  CCF(LN,TA,10)         \
+ CCF(LN,TB,11) CCF(LN,TC,12) CCF(LN,TD,13) CCF(LN,TE,14)    _Icf(3,G,T0,UN,LN) \
+ CFARGT14(CCCF,JCF,ABSOFT_cf1(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)); \
+ WCF(T1,A1,1)   WCF(T2,A2,2)   WCF(T3,A3,3)   WCF(T4,A4,4)  WCF(T5,A5,5)       \
+ WCF(T6,A6,6)   WCF(T7,A7,7)   WCF(T8,A8,8)   WCF(T9,A9,9)  WCF(TA,A10,10)     \
+ WCF(TB,A11,11) WCF(TC,A12,12) WCF(TD,A13,13) WCF(TE,A14,14) _(T0,_cfX)}
+#else
+#define PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)  \
+ _(T0,_cfPU)(CFC_(UN,LN))(CF_NULL_PROTO); static _Icf(2,U,T0,CFFUN(UN),0)(     \
+   CFARGT14FS(UUCF,HHCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) )        \
+ CFARGT14FS(UUUCF,HHHCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ;        \
+{       CFARGT14S(VCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    _(T0,_cfE) \
+ CCF(LN,T1,1)  CCF(LN,T2,2)  CCF(LN,T3,3)  CCF(LN,T4,4)  CCF(LN,T5,5)          \
+ CCF(LN,T6,6)  CCF(LN,T7,7)  CCF(LN,T8,8)  CCF(LN,T9,9)  CCF(LN,TA,10)         \
+ CCF(LN,TB,11) CCF(LN,TC,12) CCF(LN,TD,13) CCF(LN,TE,14)    _Icf(3,G,T0,UN,LN) \
+ CFARGT14(CCCF,JCF,ABSOFT_cf1(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)); \
+ WCF(T1,A1,1)   WCF(T2,A2,2)   WCF(T3,A3,3)   WCF(T4,A4,4)   WCF(T5,A5,5)      \
+ WCF(T6,A6,6)   WCF(T7,A7,7)   WCF(T8,A8,8)   WCF(T9,A9,9)   WCF(TA,A10,10)    \
+ WCF(TB,A11,11) WCF(TC,A12,12) WCF(TD,A13,13) WCF(TE,A14,14) _(T0,_cfX)}
+#endif
+
+/*-------------------------------------------------------------------------*/
+
+/*               UTILITIES FOR FORTRAN TO CALL C ROUTINES                  */
+
+#ifdef OLD_VAXC                                /* Prevent %CC-I-PARAMNOTUSED. */
+#pragma nostandard
+#endif
+
+#if defined(vmsFortran) || defined(CRAYFortran)
+#define   DCF(TN,I)
+#define  DDCF(TN,I)
+#define DDDCF(TN,I)
+#else
+#define   DCF(TN,I)          HCF(TN,I)
+#define  DDCF(TN,I)         HHCF(TN,I)
+#define DDDCF(TN,I)        HHHCF(TN,I)
+#endif
+
+#define QCF(TN,I)       _(TN,_cfSTR)(1,Q,_(B,I), 0,0,0,0)
+#define  DEFAULT_cfQ(B)
+#define  LOGICAL_cfQ(B)
+#define PLOGICAL_cfQ(B)
+#define  STRINGV_cfQ(B) char *B; unsigned int _(B,N);
+#define   STRING_cfQ(B) char *B=NULL;
+#define  PSTRING_cfQ(B) char *B=NULL;
+#define PSTRINGV_cfQ(B) STRINGV_cfQ(B)
+#define PNSTRING_cfQ(B) char *B=NULL;
+#define PPSTRING_cfQ(B)
+
+#ifdef     __sgi   /* Else SGI gives warning 182 contrary to its C LRM A.17.7 */
+#define ROUTINE_orig    *(void**)& 
+#else
+#define ROUTINE_orig     (void *)  
+#endif
+
+#define ROUTINE_1     ROUTINE_orig   
+#define ROUTINE_2     ROUTINE_orig   
+#define ROUTINE_3     ROUTINE_orig   
+#define ROUTINE_4     ROUTINE_orig   
+#define ROUTINE_5     ROUTINE_orig   
+#define ROUTINE_6     ROUTINE_orig   
+#define ROUTINE_7     ROUTINE_orig   
+#define ROUTINE_8     ROUTINE_orig   
+#define ROUTINE_9     ROUTINE_orig   
+#define ROUTINE_10    ROUTINE_orig   
+#define ROUTINE_11    ROUTINE_orig   
+#define ROUTINE_12    ROUTINE_orig   
+#define ROUTINE_13    ROUTINE_orig   
+#define ROUTINE_14    ROUTINE_orig   
+#define ROUTINE_15    ROUTINE_orig   
+#define ROUTINE_16    ROUTINE_orig   
+#define ROUTINE_17    ROUTINE_orig   
+#define ROUTINE_18    ROUTINE_orig   
+#define ROUTINE_19    ROUTINE_orig   
+#define ROUTINE_20    ROUTINE_orig   
+#define ROUTINE_21    ROUTINE_orig   
+#define ROUTINE_22    ROUTINE_orig   
+#define ROUTINE_23    ROUTINE_orig   
+#define ROUTINE_24    ROUTINE_orig   
+#define ROUTINE_25    ROUTINE_orig   
+#define ROUTINE_26    ROUTINE_orig   
+#define ROUTINE_27    ROUTINE_orig   
+
+#define TCF(NAME,TN,I,M)              _SEP_(TN,M,cfCOMMA) _(TN,_cfT)(NAME,I,_(A,I),_(B,I),_(C,I))
+#define           BYTE_cfT(M,I,A,B,D) *A
+#define         DOUBLE_cfT(M,I,A,B,D) *A
+#define          FLOAT_cfT(M,I,A,B,D) *A
+#define            INT_cfT(M,I,A,B,D) *A
+#define        LOGICAL_cfT(M,I,A,B,D)  F2CLOGICAL(*A)
+#define           LONG_cfT(M,I,A,B,D) *A
+#define          SHORT_cfT(M,I,A,B,D) *A
+#define          BYTEV_cfT(M,I,A,B,D)  A
+#define        DOUBLEV_cfT(M,I,A,B,D)  A
+#define         FLOATV_cfT(M,I,A,B,D)  VOIDP A
+#define           INTV_cfT(M,I,A,B,D)  A
+#define       LOGICALV_cfT(M,I,A,B,D)  A
+#define          LONGV_cfT(M,I,A,B,D)  A
+#define         SHORTV_cfT(M,I,A,B,D)  A
+#define         BYTEVV_cfT(M,I,A,B,D)  (void *)A /* We have to cast to void *,*/
+#define        BYTEVVV_cfT(M,I,A,B,D)  (void *)A /* since we don't know the   */
+#define       BYTEVVVV_cfT(M,I,A,B,D)  (void *)A /* dimensions of the array.  */
+#define      BYTEVVVVV_cfT(M,I,A,B,D)  (void *)A /* i.e. Unfortunately, can't */
+#define     BYTEVVVVVV_cfT(M,I,A,B,D)  (void *)A /* check that the type       */
+#define    BYTEVVVVVVV_cfT(M,I,A,B,D)  (void *)A /* matches the prototype.    */
+#define       DOUBLEVV_cfT(M,I,A,B,D)  (void *)A
+#define      DOUBLEVVV_cfT(M,I,A,B,D)  (void *)A
+#define     DOUBLEVVVV_cfT(M,I,A,B,D)  (void *)A
+#define    DOUBLEVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define   DOUBLEVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define  DOUBLEVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define        FLOATVV_cfT(M,I,A,B,D)  (void *)A
+#define       FLOATVVV_cfT(M,I,A,B,D)  (void *)A
+#define      FLOATVVVV_cfT(M,I,A,B,D)  (void *)A
+#define     FLOATVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define    FLOATVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define   FLOATVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define          INTVV_cfT(M,I,A,B,D)  (void *)A  
+#define         INTVVV_cfT(M,I,A,B,D)  (void *)A  
+#define        INTVVVV_cfT(M,I,A,B,D)  (void *)A  
+#define       INTVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define      INTVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define     INTVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define      LOGICALVV_cfT(M,I,A,B,D)  (void *)A
+#define     LOGICALVVV_cfT(M,I,A,B,D)  (void *)A
+#define    LOGICALVVVV_cfT(M,I,A,B,D)  (void *)A
+#define   LOGICALVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define  LOGICALVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define LOGICALVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define         LONGVV_cfT(M,I,A,B,D)  (void *)A
+#define        LONGVVV_cfT(M,I,A,B,D)  (void *)A
+#define       LONGVVVV_cfT(M,I,A,B,D)  (void *)A
+#define      LONGVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define     LONGVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define    LONGVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define        SHORTVV_cfT(M,I,A,B,D)  (void *)A
+#define       SHORTVVV_cfT(M,I,A,B,D)  (void *)A
+#define      SHORTVVVV_cfT(M,I,A,B,D)  (void *)A
+#define     SHORTVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define    SHORTVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define   SHORTVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define          PBYTE_cfT(M,I,A,B,D)  A
+#define        PDOUBLE_cfT(M,I,A,B,D)  A
+#define         PFLOAT_cfT(M,I,A,B,D)  VOIDP A
+#define           PINT_cfT(M,I,A,B,D)  A
+#define       PLOGICAL_cfT(M,I,A,B,D)  ((*A=F2CLOGICAL(*A)),A)
+#define          PLONG_cfT(M,I,A,B,D)  A
+#define         PSHORT_cfT(M,I,A,B,D)  A
+#define          PVOID_cfT(M,I,A,B,D)  A
+#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran)
+#define        ROUTINE_cfT(M,I,A,B,D)  _(ROUTINE_,I)  (*A)
+#else
+#define        ROUTINE_cfT(M,I,A,B,D)  _(ROUTINE_,I)    A
+#endif
+/* A == pointer to the characters
+   D == length of the string, or of an element in an array of strings
+   E == number of elements in an array of strings                             */
+#define TTSTR(    A,B,D)                                                       \
+           ((B=_cf_malloc(D+1))[D]='\0', memcpy(B,A,D), kill_trailing(B,' '))
+#define TTTTSTR(  A,B,D)   (!(D<4||A[0]||A[1]||A[2]||A[3]))?NULL:              \
+                            memchr(A,'\0',D)                 ?A   : TTSTR(A,B,D)
+#define TTTTSTRV( A,B,D,E) (_(B,N)=E,B=_cf_malloc(_(B,N)*(D+1)), (void *)      \
+  vkill_trailing(f2cstrv(A,B,D+1, _(B,N)*(D+1)), D+1,_(B,N)*(D+1),' '))
+#ifdef vmsFortran
+#define         STRING_cfT(M,I,A,B,D)  TTTTSTR( A->dsc$a_pointer,B,A->dsc$w_length)
+#define        STRINGV_cfT(M,I,A,B,D)  TTTTSTRV(A->dsc$a_pointer, B,           \
+                                             A->dsc$w_length , A->dsc$l_m[0])
+#define        PSTRING_cfT(M,I,A,B,D)    TTSTR( A->dsc$a_pointer,B,A->dsc$w_length)
+#define       PPSTRING_cfT(M,I,A,B,D)           A->dsc$a_pointer
+#else
+#ifdef CRAYFortran
+#define         STRING_cfT(M,I,A,B,D)  TTTTSTR( _fcdtocp(A),B,_fcdlen(A))
+#define        STRINGV_cfT(M,I,A,B,D)  TTTTSTRV(_fcdtocp(A),B,_fcdlen(A),      \
+                              num_elem(_fcdtocp(A),_fcdlen(A),_3(M,_STRV_A,I)))
+#define        PSTRING_cfT(M,I,A,B,D)    TTSTR( _fcdtocp(A),B,_fcdlen(A))
+#define       PPSTRING_cfT(M,I,A,B,D)           _fcdtocp(A)
+#else
+#define         STRING_cfT(M,I,A,B,D)  TTTTSTR( A,B,D)
+#define        STRINGV_cfT(M,I,A,B,D)  TTTTSTRV(A,B,D, num_elem(A,D,_3(M,_STRV_A,I)))
+#define        PSTRING_cfT(M,I,A,B,D)    TTSTR( A,B,D)
+#define       PPSTRING_cfT(M,I,A,B,D)           A
+#endif
+#endif
+#define       PNSTRING_cfT(M,I,A,B,D)    STRING_cfT(M,I,A,B,D)
+#define       PSTRINGV_cfT(M,I,A,B,D)   STRINGV_cfT(M,I,A,B,D)
+#define           CF_0_cfT(M,I,A,B,D)
+
+#define RCF(TN,I)           _(TN,_cfSTR)(3,R,_(A,I),_(B,I),_(C,I),0,0)
+#define  DEFAULT_cfR(A,B,D)
+#define  LOGICAL_cfR(A,B,D)
+#define PLOGICAL_cfR(A,B,D) *A=C2FLOGICAL(*A);
+#define   STRING_cfR(A,B,D) if (B) _cf_free(B);
+#define  STRINGV_cfR(A,B,D) _cf_free(B);
+/* A and D as defined above for TSTRING(V) */
+#define RRRRPSTR( A,B,D)    if (B) memcpy(A,B, _cfMIN(strlen(B),D)),           \
+                  (D>strlen(B)?memset(A+strlen(B),' ', D-strlen(B)):0), _cf_free(B);
+#define RRRRPSTRV(A,B,D)    c2fstrv(B,A,D+1,(D+1)*_(B,N)), _cf_free(B);
+#ifdef vmsFortran
+#define  PSTRING_cfR(A,B,D) RRRRPSTR( A->dsc$a_pointer,B,A->dsc$w_length)
+#define PSTRINGV_cfR(A,B,D) RRRRPSTRV(A->dsc$a_pointer,B,A->dsc$w_length)
+#else
+#ifdef CRAYFortran
+#define  PSTRING_cfR(A,B,D) RRRRPSTR( _fcdtocp(A),B,_fcdlen(A))
+#define PSTRINGV_cfR(A,B,D) RRRRPSTRV(_fcdtocp(A),B,_fcdlen(A))
+#else
+#define  PSTRING_cfR(A,B,D) RRRRPSTR( A,B,D)
+#define PSTRINGV_cfR(A,B,D) RRRRPSTRV(A,B,D)
+#endif
+#endif
+#define PNSTRING_cfR(A,B,D) PSTRING_cfR(A,B,D)
+#define PPSTRING_cfR(A,B,D)
+
+#define    BYTE_cfFZ(UN,LN) INTEGER_BYTE     FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define  DOUBLE_cfFZ(UN,LN) DOUBLE_PRECISION FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define     INT_cfFZ(UN,LN) int   FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define LOGICAL_cfFZ(UN,LN) int   FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define    LONG_cfFZ(UN,LN) long  FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define   SHORT_cfFZ(UN,LN) short FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define    VOID_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#ifndef __CF__KnR
+/* The void is req'd by the Apollo, to make this an ANSI function declaration.
+   The Apollo promotes K&R float functions to double. */
+#define   FLOAT_cfFZ(UN,LN) FORTRAN_REAL FCALLSC_QUALIFIER fcallsc(UN,LN)(void
+#ifdef vmsFortran
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(fstring *AS
+#else
+#ifdef CRAYFortran
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(_fcd     AS
+#else
+#if  defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(char    *AS
+#else
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(char    *AS, unsigned D0
+#endif
+#endif
+#endif
+#else
+#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
+#define   FLOAT_cfFZ(UN,LN) FORTRAN_REAL      FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#else
+#define   FLOAT_cfFZ(UN,LN) FLOATFUNCTIONTYPE FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#endif
+#if defined(vmsFortran) || defined(CRAYFortran) || defined(AbsoftUNIXFortran)
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(AS
+#else
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(AS, D0
+#endif
+#endif
+
+#define    BYTE_cfF(UN,LN)     BYTE_cfFZ(UN,LN)
+#define  DOUBLE_cfF(UN,LN)   DOUBLE_cfFZ(UN,LN)
+#ifndef __CF_KnR
+#define   FLOAT_cfF(UN,LN)  FORTRAN_REAL FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#else
+#define   FLOAT_cfF(UN,LN)    FLOAT_cfFZ(UN,LN)
+#endif
+#define     INT_cfF(UN,LN)      INT_cfFZ(UN,LN)
+#define LOGICAL_cfF(UN,LN)  LOGICAL_cfFZ(UN,LN)
+#define    LONG_cfF(UN,LN)     LONG_cfFZ(UN,LN)
+#define   SHORT_cfF(UN,LN)    SHORT_cfFZ(UN,LN)
+#define    VOID_cfF(UN,LN)     VOID_cfFZ(UN,LN)
+#define  STRING_cfF(UN,LN)   STRING_cfFZ(UN,LN),
+
+#define     INT_cfFF
+#define    VOID_cfFF
+#ifdef vmsFortran
+#define  STRING_cfFF           fstring *AS; 
+#else
+#ifdef CRAYFortran
+#define  STRING_cfFF           _fcd     AS;
+#else
+#define  STRING_cfFF           char    *AS; unsigned D0;
+#endif
+#endif
+
+#define     INT_cfL            A0=
+#define  STRING_cfL            A0=
+#define    VOID_cfL                        
+
+#define    INT_cfK
+#define   VOID_cfK
+/* KSTRING copies the string into the position provided by the caller. */
+#ifdef vmsFortran
+#define STRING_cfK                                                             \
+ memcpy(AS->dsc$a_pointer,A0,_cfMIN(AS->dsc$w_length,(A0==NULL?0:strlen(A0))));\
+ AS->dsc$w_length>(A0==NULL?0:strlen(A0))?                                     \
+  memset(AS->dsc$a_pointer+(A0==NULL?0:strlen(A0)),' ',                        \
+         AS->dsc$w_length-(A0==NULL?0:strlen(A0))):0;
+#else
+#ifdef CRAYFortran
+#define STRING_cfK                                                             \
+ memcpy(_fcdtocp(AS),A0, _cfMIN(_fcdlen(AS),(A0==NULL?0:strlen(A0))) );        \
+ _fcdlen(AS)>(A0==NULL?0:strlen(A0))?                                          \
+  memset(_fcdtocp(AS)+(A0==NULL?0:strlen(A0)),' ',                             \
+         _fcdlen(AS)-(A0==NULL?0:strlen(A0))):0;
+#else
+#define STRING_cfK         memcpy(AS,A0, _cfMIN(D0,(A0==NULL?0:strlen(A0))) ); \
+                 D0>(A0==NULL?0:strlen(A0))?memset(AS+(A0==NULL?0:strlen(A0)), \
+                                            ' ', D0-(A0==NULL?0:strlen(A0))):0;
+#endif
+#endif
+
+/* Note that K.. and I.. can't be combined since K.. has to access data before
+R.., in order for functions returning strings which are also passed in as
+arguments to work correctly. Note that R.. frees and hence may corrupt the
+string. */
+#define    BYTE_cfI  return A0;
+#define  DOUBLE_cfI  return A0;
+#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
+#define   FLOAT_cfI  return A0;
+#else
+#define   FLOAT_cfI  RETURNFLOAT(A0);
+#endif
+#define     INT_cfI  return A0;
+#ifdef hpuxFortran800
+/* Incredibly, functions must return true as 1, elsewhere .true.==0x01000000. */
+#define LOGICAL_cfI  return ((A0)?1:0);
+#else
+#define LOGICAL_cfI  return C2FLOGICAL(A0);
+#endif
+#define    LONG_cfI  return A0;
+#define   SHORT_cfI  return A0;
+#define  STRING_cfI  return   ;
+#define    VOID_cfI  return   ;
+
+#ifdef OLD_VAXC                                  /* Allow %CC-I-PARAMNOTUSED. */
+#pragma standard
+#endif
+
+#define FCALLSCSUB0( CN,UN,LN)             FCALLSCFUN0(VOID,CN,UN,LN)
+#define FCALLSCSUB1( CN,UN,LN,T1)          FCALLSCFUN1(VOID,CN,UN,LN,T1)
+#define FCALLSCSUB2( CN,UN,LN,T1,T2)       FCALLSCFUN2(VOID,CN,UN,LN,T1,T2)
+#define FCALLSCSUB3( CN,UN,LN,T1,T2,T3)    FCALLSCFUN3(VOID,CN,UN,LN,T1,T2,T3)
+#define FCALLSCSUB4( CN,UN,LN,T1,T2,T3,T4) \
+    FCALLSCFUN4(VOID,CN,UN,LN,T1,T2,T3,T4)
+#define FCALLSCSUB5( CN,UN,LN,T1,T2,T3,T4,T5) \
+    FCALLSCFUN5(VOID,CN,UN,LN,T1,T2,T3,T4,T5)
+#define FCALLSCSUB6( CN,UN,LN,T1,T2,T3,T4,T5,T6) \
+    FCALLSCFUN6(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6)       
+#define FCALLSCSUB7( CN,UN,LN,T1,T2,T3,T4,T5,T6,T7) \
+    FCALLSCFUN7(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7)
+#define FCALLSCSUB8( CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8) \
+    FCALLSCFUN8(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8)
+#define FCALLSCSUB9( CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9) \
+    FCALLSCFUN9(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9)
+#define FCALLSCSUB10(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA) \
+   FCALLSCFUN10(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA)
+#define FCALLSCSUB11(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB) \
+   FCALLSCFUN11(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB)
+#define FCALLSCSUB12(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC) \
+   FCALLSCFUN12(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC)
+#define FCALLSCSUB13(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) \
+   FCALLSCFUN13(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD)
+#define FCALLSCSUB14(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
+   FCALLSCFUN14(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define FCALLSCSUB15(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) \
+   FCALLSCFUN15(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF)
+#define FCALLSCSUB16(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) \
+   FCALLSCFUN16(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG)
+#define FCALLSCSUB17(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) \
+   FCALLSCFUN17(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH)
+#define FCALLSCSUB18(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) \
+   FCALLSCFUN18(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI)
+#define FCALLSCSUB19(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \
+   FCALLSCFUN19(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ)
+#define FCALLSCSUB20(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+   FCALLSCFUN20(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define FCALLSCSUB21(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \
+   FCALLSCFUN21(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL)
+#define FCALLSCSUB22(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \
+   FCALLSCFUN22(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM)
+#define FCALLSCSUB23(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \
+   FCALLSCFUN23(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN)
+#define FCALLSCSUB24(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \
+   FCALLSCFUN24(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO)
+#define FCALLSCSUB25(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \
+   FCALLSCFUN25(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP)
+#define FCALLSCSUB26(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \
+   FCALLSCFUN26(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ)
+#define FCALLSCSUB27(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+   FCALLSCFUN27(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+
+
+#define FCALLSCFUN1( T0,CN,UN,LN,T1) \
+        FCALLSCFUN5 (T0,CN,UN,LN,T1,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN2( T0,CN,UN,LN,T1,T2) \
+        FCALLSCFUN5 (T0,CN,UN,LN,T1,T2,CF_0,CF_0,CF_0)
+#define FCALLSCFUN3( T0,CN,UN,LN,T1,T2,T3) \
+        FCALLSCFUN5 (T0,CN,UN,LN,T1,T2,T3,CF_0,CF_0)
+#define FCALLSCFUN4( T0,CN,UN,LN,T1,T2,T3,T4) \
+        FCALLSCFUN5 (T0,CN,UN,LN,T1,T2,T3,T4,CF_0)
+#define FCALLSCFUN5( T0,CN,UN,LN,T1,T2,T3,T4,T5) \
+        FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN6( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6) \
+        FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN7( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7) \
+        FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0)
+#define FCALLSCFUN8( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8) \
+        FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0)
+#define FCALLSCFUN9( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9) \
+        FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0)
+#define FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA) \
+        FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN11(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB) \
+        FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0)
+#define FCALLSCFUN12(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC) \
+        FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0)
+#define FCALLSCFUN13(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) \
+        FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0)
+
+
+#define FCALLSCFUN15(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN16(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN17(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,CF_0,CF_0,CF_0)
+#define FCALLSCFUN18(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,CF_0,CF_0)
+#define FCALLSCFUN19(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,CF_0)
+#define FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN21(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN22(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN23(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN24(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0)
+#define FCALLSCFUN25(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0)
+#define FCALLSCFUN26(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0)
+
+
+#ifndef __CF__KnR
+#define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf2(T0))   \
+        {_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) _(T0,_cfI)}
+
+#define FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    \
+                                 CFextern _(T0,_cfF)(UN,LN)                    \
+ CFARGT14(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) )  \
+ {                 CFARGT14S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    \
+  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(    TCF(LN,T1,1,0)  TCF(LN,T2,2,1) \
+    TCF(LN,T3,3,1)  TCF(LN,T4,4,1) TCF(LN,T5,5,1)  TCF(LN,T6,6,1)  TCF(LN,T7,7,1) \
+    TCF(LN,T8,8,1)  TCF(LN,T9,9,1) TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) );                          _Icf(0,K,T0,0,0) \
+                   CFARGT14S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)  _(T0,_cfI) }
+
+#define FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)   \
+                                 CFextern _(T0,_cfF)(UN,LN)                    \
+ CFARGT27(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) ) \
+ {                 CFARGT27S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)   \
+  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(     TCF(LN,T1,1,0)  TCF(LN,T2,2,1)  \
+    TCF(LN,T3,3,1)  TCF(LN,T4,4,1)  TCF(LN,T5,5,1)  TCF(LN,T6,6,1)  TCF(LN,T7,7,1)  \
+    TCF(LN,T8,8,1)  TCF(LN,T9,9,1)  TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) TCF(LN,TF,15,1) TCF(LN,TG,16,1) TCF(LN,TH,17,1) \
+    TCF(LN,TI,18,1) TCF(LN,TJ,19,1) TCF(LN,TK,20,1) TCF(LN,TL,21,1) TCF(LN,TM,22,1) \
+    TCF(LN,TN,23,1) TCF(LN,TO,24,1) TCF(LN,TP,25,1) TCF(LN,TQ,26,1) TCF(LN,TR,27,1) ); _Icf(0,K,T0,0,0) \
+                   CFARGT27S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  _(T0,_cfI) }
+
+#else
+#define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf3(T0)) _Icf(0,FF,T0,0,0)\
+        {_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) _(T0,_cfI)}
+
+#define FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    \
+                                 CFextern _(T0,_cfF)(UN,LN)                    \
+ CFARGT14(NNCF,DDCF,ABSOFT_cf3(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)) _Icf(0,FF,T0,0,0) \
+       CFARGT14FS(NNNCF,DDDCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE);   \
+ {                 CFARGT14S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    \
+  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(  TCF(LN,T1,1,0) TCF(LN,T2,2,1) \
+    TCF(LN,T3,3,1) TCF(LN,T4,4,1) TCF(LN,T5,5,1) TCF(LN,T6,6,1) TCF(LN,T7,7,1) \
+    TCF(LN,T8,8,1) TCF(LN,T9,9,1) TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) );                          _Icf(0,K,T0,0,0) \
+                   CFARGT14S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)  _(T0,_cfI)}
+
+#define FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  \
+                                 CFextern _(T0,_cfF)(UN,LN)                    \
+ CFARGT27(NNCF,DDCF,ABSOFT_cf3(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)) _Icf(0,FF,T0,0,0) \
+       CFARGT27FS(NNNCF,DDDCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR); \
+ {                 CFARGT27S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  \
+  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(     TCF(LN,T1,1,0)  TCF(LN,T2,2,1)  \
+    TCF(LN,T3,3,1)  TCF(LN,T4,4,1)  TCF(LN,T5,5,1)  TCF(LN,T6,6,1)  TCF(LN,T7,7,1)  \
+    TCF(LN,T8,8,1)  TCF(LN,T9,9,1)  TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) TCF(LN,TF,15,1) TCF(LN,TG,16,1) TCF(LN,TH,17,1) \
+    TCF(LN,TI,18,1) TCF(LN,TJ,19,1) TCF(LN,TK,20,1) TCF(LN,TL,21,1) TCF(LN,TM,22,1) \
+    TCF(LN,TN,23,1) TCF(LN,TO,24,1) TCF(LN,TP,25,1) TCF(LN,TQ,26,1) TCF(LN,TR,27,1) ); _Icf(0,K,T0,0,0) \
+                   CFARGT27S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  _(T0,_cfI)}
+
+#endif
+
+
+#endif	 /* __CFORTRAN_LOADED */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
+#endif
+/* Automatically generated by make_fint.c, don't edit! */
+
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if ! defined (_CDI_H)
+#  include "cdi.h"
+#endif
+
+#if defined (HAVE_CF_INTERFACE)
+
+#if ! defined (__CFORTRAN_LOADED)
+#  include "cfortran.h"
+#endif
+
+
+/*  Byte order  */
+
+
+/*  Error identifier  */
+
+
+/*  File types  */
+
+
+/*  Compress types  */
+
+
+/*  external data types  */
+
+
+/*  internal data types  */
+
+
+/*  Chunks  */
+
+
+/*  GRID types  */
+
+
+/*  ZAXIS types  */
+
+
+/*  TIME types  */
+
+
+/*  TSTEP types  */
+
+
+/*  TAXIS types  */
+
+
+/*  TUNIT types  */
+
+
+/*  CALENDAR types  */
+
+
+/*  parallel IO IOMode  */
+
+
+/*  parallel IO routines  */
+
+FCALLSCSUB0 (pioEndDef, PIOENDDEF, pioenddef)
+FCALLSCSUB0 (pioEndTimestepping, PIOENDTIMESTEPPING, pioendtimestepping)
+FCALLSCSUB0 (pioFinalize, PIOFINALIZE, piofinalize)
+FCALLSCFUN5 (INT, pioInit, PIOINIT, pioinit, INT, INT, INT, INT, PINT)
+FCALLSCFUN2 (INT, pioInqVarDecoChunk, PIOINQVARDECOCHUNK, pioinqvardecochunk, INT, INT)
+FCALLSCFUN2 (INT, pioInqVarDecoOff, PIOINQVARDECOOFF, pioinqvardecooff, INT, INT)
+FCALLSCSUB1 (pioNamespaceSetActive, PIONAMESPACESETACTIVE, pionamespacesetactive, INT)
+FCALLSCSUB3 (pioWriteTimestep, PIOWRITETIMESTEP, piowritetimestep, INT, INT, INT)
+
+/*  CDI control routines  */
+
+FCALLSCSUB0 (cdiReset, CDIRESET, cdireset)
+FCALLSCFUN1 (STRING, cdiStringError, CDISTRINGERROR, cdistringerror, INT)
+FCALLSCSUB1 (cdiDebug, CDIDEBUG, cdidebug, INT)
+FCALLSCFUN0 (STRING, cdiLibraryVersion, CDILIBRARYVERSION, cdilibraryversion)
+FCALLSCSUB0 (cdiPrintVersion, CDIPRINTVERSION, cdiprintversion)
+FCALLSCSUB1 (cdiDefMissval, CDIDEFMISSVAL, cdidefmissval, DOUBLE)
+FCALLSCFUN0 (DOUBLE, cdiInqMissval, CDIINQMISSVAL, cdiinqmissval)
+FCALLSCSUB2 (cdiDefGlobal, CDIDEFGLOBAL, cdidefglobal, STRING, INT)
+
+/*  CDI converter routines  */
+
+
+/*  parameter  */
+
+FCALLSCSUB3 (cdiParamToString, CDIPARAMTOSTRING, cdiparamtostring, INT, PSTRING, INT)
+FCALLSCSUB4 (cdiDecodeParam, CDIDECODEPARAM, cdidecodeparam, INT, PINT, PINT, PINT)
+FCALLSCFUN3 (INT, cdiEncodeParam, CDIENCODEPARAM, cdiencodeparam, INT, INT, INT)
+FCALLSCSUB4 (cdiDecodeDate, CDIDECODEDATE, cdidecodedate, INT, PINT, PINT, PINT)
+FCALLSCFUN3 (INT, cdiEncodeDate, CDIENCODEDATE, cdiencodedate, INT, INT, INT)
+FCALLSCSUB4 (cdiDecodeTime, CDIDECODETIME, cdidecodetime, INT, PINT, PINT, PINT)
+FCALLSCFUN3 (INT, cdiEncodeTime, CDIENCODETIME, cdiencodetime, INT, INT, INT)
+
+/*  STREAM control routines  */
+
+FCALLSCFUN1 (INT, streamOpenRead, STREAMOPENREAD, streamopenread, STRING)
+FCALLSCFUN2 (INT, streamOpenWrite, STREAMOPENWRITE, streamopenwrite, STRING, INT)
+FCALLSCFUN1 (INT, streamOpenAppend, STREAMOPENAPPEND, streamopenappend, STRING)
+FCALLSCSUB1 (streamClose, STREAMCLOSE, streamclose, INT)
+FCALLSCSUB1 (streamSync, STREAMSYNC, streamsync, INT)
+FCALLSCSUB2 (streamDefVlist, STREAMDEFVLIST, streamdefvlist, INT, INT)
+FCALLSCFUN1 (INT, streamInqVlist, STREAMINQVLIST, streaminqvlist, INT)
+FCALLSCFUN1 (INT, streamInqVlistIDorig, STREAMINQVLISTIDORIG, streaminqvlistidorig, INT)
+FCALLSCFUN1 (INT, streamInqFiletype, STREAMINQFILETYPE, streaminqfiletype, INT)
+FCALLSCSUB2 (streamDefByteorder, STREAMDEFBYTEORDER, streamdefbyteorder, INT, INT)
+FCALLSCFUN1 (INT, streamInqByteorder, STREAMINQBYTEORDER, streaminqbyteorder, INT)
+FCALLSCSUB2 (streamDefCompType, STREAMDEFCOMPTYPE, streamdefcomptype, INT, INT)
+FCALLSCSUB2 (streamDefCompLevel, STREAMDEFCOMPLEVEL, streamdefcomplevel, INT, INT)
+FCALLSCFUN1 (INT, streamInqCompType, STREAMINQCOMPTYPE, streaminqcomptype, INT)
+FCALLSCFUN1 (INT, streamInqCompLevel, STREAMINQCOMPLEVEL, streaminqcomplevel, INT)
+FCALLSCFUN2 (INT, streamDefTimestep, STREAMDEFTIMESTEP, streamdeftimestep, INT, INT)
+FCALLSCFUN2 (INT, streamInqTimestep, STREAMINQTIMESTEP, streaminqtimestep, INT, INT)
+FCALLSCFUN1 (STRING, streamFilename, STREAMFILENAME, streamfilename, INT)
+FCALLSCFUN1 (STRING, streamFilesuffix, STREAMFILESUFFIX, streamfilesuffix, INT)
+FCALLSCFUN1 (INT, streamNtsteps, STREAMNTSTEPS, streamntsteps, INT)
+FCALLSCFUN1 (INT, streamInqNvars, STREAMINQNVARS, streaminqnvars, INT)
+
+/*  STREAM var I/O routines  */
+
+FCALLSCSUB4 (streamReadVar, STREAMREADVAR, streamreadvar, INT, INT, PDOUBLE, PINT)
+FCALLSCSUB4 (streamWriteVar, STREAMWRITEVAR, streamwritevar, INT, INT, PDOUBLE, INT)
+FCALLSCSUB4 (streamWriteVarF, STREAMWRITEVARF, streamwritevarf, INT, INT, PFLOAT, INT)
+FCALLSCSUB5 (streamReadVarSlice, STREAMREADVARSLICE, streamreadvarslice, INT, INT, INT, PDOUBLE, PINT)
+FCALLSCSUB5 (streamWriteVarSlice, STREAMWRITEVARSLICE, streamwritevarslice, INT, INT, INT, PDOUBLE, INT)
+FCALLSCSUB5 (streamWriteVarSliceF, STREAMWRITEVARSLICEF, streamwritevarslicef, INT, INT, INT, PFLOAT, INT)
+
+/*  STREAM record I/O routines  */
+
+FCALLSCSUB3 (streamInqRecord, STREAMINQRECORD, streaminqrecord, INT, PINT, PINT)
+FCALLSCSUB3 (streamDefRecord, STREAMDEFRECORD, streamdefrecord, INT, INT, INT)
+FCALLSCSUB3 (streamReadRecord, STREAMREADRECORD, streamreadrecord, INT, PDOUBLE, PINT)
+FCALLSCSUB3 (streamWriteRecord, STREAMWRITERECORD, streamwriterecord, INT, PDOUBLE, INT)
+FCALLSCSUB3 (streamWriteRecordF, STREAMWRITERECORDF, streamwriterecordf, INT, PFLOAT, INT)
+FCALLSCSUB2 (streamCopyRecord, STREAMCOPYRECORD, streamcopyrecord, INT, INT)
+FCALLSCSUB3 (streamInqGinfo, STREAMINQGINFO, streaminqginfo, INT, PINT, PFLOAT)
+
+/*  VLIST routines  */
+
+FCALLSCFUN0 (INT, vlistCreate, VLISTCREATE, vlistcreate)
+FCALLSCSUB1 (vlistDestroy, VLISTDESTROY, vlistdestroy, INT)
+FCALLSCFUN1 (INT, vlistDuplicate, VLISTDUPLICATE, vlistduplicate, INT)
+FCALLSCSUB2 (vlistCopy, VLISTCOPY, vlistcopy, INT, INT)
+FCALLSCSUB2 (vlistCopyFlag, VLISTCOPYFLAG, vlistcopyflag, INT, INT)
+FCALLSCSUB1 (vlistClearFlag, VLISTCLEARFLAG, vlistclearflag, INT)
+FCALLSCSUB2 (vlistCat, VLISTCAT, vlistcat, INT, INT)
+FCALLSCSUB2 (vlistMerge, VLISTMERGE, vlistmerge, INT, INT)
+FCALLSCSUB1 (vlistPrint, VLISTPRINT, vlistprint, INT)
+FCALLSCFUN1 (INT, vlistNumber, VLISTNUMBER, vlistnumber, INT)
+FCALLSCFUN1 (INT, vlistNvars, VLISTNVARS, vlistnvars, INT)
+FCALLSCFUN1 (INT, vlistNgrids, VLISTNGRIDS, vlistngrids, INT)
+FCALLSCFUN1 (INT, vlistNzaxis, VLISTNZAXIS, vlistnzaxis, INT)
+FCALLSCSUB2 (vlistDefNtsteps, VLISTDEFNTSTEPS, vlistdefntsteps, INT, INT)
+FCALLSCFUN1 (INT, vlistNtsteps, VLISTNTSTEPS, vlistntsteps, INT)
+FCALLSCFUN1 (INT, vlistGridsizeMax, VLISTGRIDSIZEMAX, vlistgridsizemax, INT)
+FCALLSCFUN2 (INT, vlistGrid, VLISTGRID, vlistgrid, INT, INT)
+FCALLSCFUN2 (INT, vlistGridIndex, VLISTGRIDINDEX, vlistgridindex, INT, INT)
+FCALLSCSUB3 (vlistChangeGridIndex, VLISTCHANGEGRIDINDEX, vlistchangegridindex, INT, INT, INT)
+FCALLSCSUB3 (vlistChangeGrid, VLISTCHANGEGRID, vlistchangegrid, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistZaxis, VLISTZAXIS, vlistzaxis, INT, INT)
+FCALLSCFUN2 (INT, vlistZaxisIndex, VLISTZAXISINDEX, vlistzaxisindex, INT, INT)
+FCALLSCSUB3 (vlistChangeZaxisIndex, VLISTCHANGEZAXISINDEX, vlistchangezaxisindex, INT, INT, INT)
+FCALLSCSUB3 (vlistChangeZaxis, VLISTCHANGEZAXIS, vlistchangezaxis, INT, INT, INT)
+FCALLSCFUN1 (INT, vlistNrecs, VLISTNRECS, vlistnrecs, INT)
+FCALLSCSUB2 (vlistDefTaxis, VLISTDEFTAXIS, vlistdeftaxis, INT, INT)
+FCALLSCFUN1 (INT, vlistInqTaxis, VLISTINQTAXIS, vlistinqtaxis, INT)
+FCALLSCSUB2 (vlistDefTable, VLISTDEFTABLE, vlistdeftable, INT, INT)
+FCALLSCFUN1 (INT, vlistInqTable, VLISTINQTABLE, vlistinqtable, INT)
+FCALLSCSUB2 (vlistDefInstitut, VLISTDEFINSTITUT, vlistdefinstitut, INT, INT)
+FCALLSCFUN1 (INT, vlistInqInstitut, VLISTINQINSTITUT, vlistinqinstitut, INT)
+FCALLSCSUB2 (vlistDefModel, VLISTDEFMODEL, vlistdefmodel, INT, INT)
+FCALLSCFUN1 (INT, vlistInqModel, VLISTINQMODEL, vlistinqmodel, INT)
+
+/*  VLIST VAR routines  */
+
+FCALLSCFUN4 (INT, vlistDefVar, VLISTDEFVAR, vlistdefvar, INT, INT, INT, INT)
+FCALLSCSUB3 (vlistChangeVarGrid, VLISTCHANGEVARGRID, vlistchangevargrid, INT, INT, INT)
+FCALLSCSUB3 (vlistChangeVarZaxis, VLISTCHANGEVARZAXIS, vlistchangevarzaxis, INT, INT, INT)
+FCALLSCSUB5 (vlistInqVar, VLISTINQVAR, vlistinqvar, INT, INT, PINT, PINT, PINT)
+FCALLSCFUN2 (INT, vlistInqVarGrid, VLISTINQVARGRID, vlistinqvargrid, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarZaxis, VLISTINQVARZAXIS, vlistinqvarzaxis, INT, INT)
+
+/*  used in MPIOM  */
+
+FCALLSCFUN2 (INT, vlistInqVarID, VLISTINQVARID, vlistinqvarid, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarTsteptype, VLISTINQVARTSTEPTYPE, vlistinqvartsteptype, INT, INT)
+FCALLSCSUB3 (vlistDefVarTsteptype, VLISTDEFVARTSTEPTYPE, vlistdefvartsteptype, INT, INT, INT)
+FCALLSCSUB3 (vlistDefVarCompType, VLISTDEFVARCOMPTYPE, vlistdefvarcomptype, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarCompType, VLISTINQVARCOMPTYPE, vlistinqvarcomptype, INT, INT)
+FCALLSCSUB3 (vlistDefVarCompLevel, VLISTDEFVARCOMPLEVEL, vlistdefvarcomplevel, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarCompLevel, VLISTINQVARCOMPLEVEL, vlistinqvarcomplevel, INT, INT)
+FCALLSCSUB3 (vlistDefVarParam, VLISTDEFVARPARAM, vlistdefvarparam, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarParam, VLISTINQVARPARAM, vlistinqvarparam, INT, INT)
+FCALLSCSUB3 (vlistDefVarCode, VLISTDEFVARCODE, vlistdefvarcode, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarCode, VLISTINQVARCODE, vlistinqvarcode, INT, INT)
+FCALLSCSUB3 (vlistDefVarDatatype, VLISTDEFVARDATATYPE, vlistdefvardatatype, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarDatatype, VLISTINQVARDATATYPE, vlistinqvardatatype, INT, INT)
+FCALLSCSUB3 (vlistDefVarChunkType, VLISTDEFVARCHUNKTYPE, vlistdefvarchunktype, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarChunkType, VLISTINQVARCHUNKTYPE, vlistinqvarchunktype, INT, INT)
+FCALLSCSUB3 (vlistDefVarXYZ, VLISTDEFVARXYZ, vlistdefvarxyz, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarXYZ, VLISTINQVARXYZ, vlistinqvarxyz, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarNumber, VLISTINQVARNUMBER, vlistinqvarnumber, INT, INT)
+FCALLSCSUB3 (vlistDefVarInstitut, VLISTDEFVARINSTITUT, vlistdefvarinstitut, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarInstitut, VLISTINQVARINSTITUT, vlistinqvarinstitut, INT, INT)
+FCALLSCSUB3 (vlistDefVarModel, VLISTDEFVARMODEL, vlistdefvarmodel, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarModel, VLISTINQVARMODEL, vlistinqvarmodel, INT, INT)
+FCALLSCSUB3 (vlistDefVarTable, VLISTDEFVARTABLE, vlistdefvartable, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarTable, VLISTINQVARTABLE, vlistinqvartable, INT, INT)
+FCALLSCSUB3 (vlistDefVarName, VLISTDEFVARNAME, vlistdefvarname, INT, INT, STRING)
+FCALLSCSUB3 (vlistInqVarName, VLISTINQVARNAME, vlistinqvarname, INT, INT, PSTRING)
+FCALLSCSUB3 (vlistDefVarStdname, VLISTDEFVARSTDNAME, vlistdefvarstdname, INT, INT, STRING)
+FCALLSCSUB3 (vlistInqVarStdname, VLISTINQVARSTDNAME, vlistinqvarstdname, INT, INT, PSTRING)
+FCALLSCSUB3 (vlistDefVarLongname, VLISTDEFVARLONGNAME, vlistdefvarlongname, INT, INT, STRING)
+FCALLSCSUB3 (vlistInqVarLongname, VLISTINQVARLONGNAME, vlistinqvarlongname, INT, INT, PSTRING)
+FCALLSCSUB3 (vlistDefVarUnits, VLISTDEFVARUNITS, vlistdefvarunits, INT, INT, STRING)
+FCALLSCSUB3 (vlistInqVarUnits, VLISTINQVARUNITS, vlistinqvarunits, INT, INT, PSTRING)
+FCALLSCSUB3 (vlistDefVarMissval, VLISTDEFVARMISSVAL, vlistdefvarmissval, INT, INT, DOUBLE)
+FCALLSCFUN2 (DOUBLE, vlistInqVarMissval, VLISTINQVARMISSVAL, vlistinqvarmissval, INT, INT)
+FCALLSCSUB3 (vlistDefVarScalefactor, VLISTDEFVARSCALEFACTOR, vlistdefvarscalefactor, INT, INT, DOUBLE)
+FCALLSCFUN2 (DOUBLE, vlistInqVarScalefactor, VLISTINQVARSCALEFACTOR, vlistinqvarscalefactor, INT, INT)
+FCALLSCSUB3 (vlistDefVarAddoffset, VLISTDEFVARADDOFFSET, vlistdefvaraddoffset, INT, INT, DOUBLE)
+FCALLSCFUN2 (DOUBLE, vlistInqVarAddoffset, VLISTINQVARADDOFFSET, vlistinqvaraddoffset, INT, INT)
+FCALLSCSUB3 (vlistDefVarTimave, VLISTDEFVARTIMAVE, vlistdefvartimave, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarTimave, VLISTINQVARTIMAVE, vlistinqvartimave, INT, INT)
+FCALLSCSUB3 (vlistDefVarTimaccu, VLISTDEFVARTIMACCU, vlistdefvartimaccu, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarTimaccu, VLISTINQVARTIMACCU, vlistinqvartimaccu, INT, INT)
+FCALLSCFUN2 (INT, vlistInqVarSize, VLISTINQVARSIZE, vlistinqvarsize, INT, INT)
+FCALLSCSUB4 (vlistDefIndex, VLISTDEFINDEX, vlistdefindex, INT, INT, INT, INT)
+FCALLSCFUN3 (INT, vlistInqIndex, VLISTINQINDEX, vlistinqindex, INT, INT, INT)
+FCALLSCSUB4 (vlistDefFlag, VLISTDEFFLAG, vlistdefflag, INT, INT, INT, INT)
+FCALLSCFUN3 (INT, vlistInqFlag, VLISTINQFLAG, vlistinqflag, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistFindVar, VLISTFINDVAR, vlistfindvar, INT, INT)
+FCALLSCFUN3 (INT, vlistFindLevel, VLISTFINDLEVEL, vlistfindlevel, INT, INT, INT)
+FCALLSCFUN2 (INT, vlistMergedVar, VLISTMERGEDVAR, vlistmergedvar, INT, INT)
+FCALLSCFUN3 (INT, vlistMergedLevel, VLISTMERGEDLEVEL, vlistmergedlevel, INT, INT, INT)
+
+/*  Ensemble info routines  */
+
+FCALLSCSUB5 (vlistDefVarEnsemble, VLISTDEFVARENSEMBLE, vlistdefvarensemble, INT, INT, INT, INT, INT)
+FCALLSCFUN5 (INT, vlistInqVarEnsemble, VLISTINQVARENSEMBLE, vlistinqvarensemble, INT, INT, PINT, PINT, PINT)
+
+/*  VLIST attributes  */
+
+FCALLSCFUN3 (INT, vlistInqNatts, VLISTINQNATTS, vlistinqnatts, INT, INT, PINT)
+FCALLSCFUN6 (INT, vlistInqAtt, VLISTINQATT, vlistinqatt, INT, INT, INT, PSTRING, PINT, PINT)
+FCALLSCFUN3 (INT, vlistDelAtt, VLISTDELATT, vlistdelatt, INT, INT, STRING)
+FCALLSCFUN6 (INT, vlistDefAttInt, VLISTDEFATTINT, vlistdefattint, INT, INT, STRING, INT, INT, PINT)
+FCALLSCFUN6 (INT, vlistDefAttFlt, VLISTDEFATTFLT, vlistdefattflt, INT, INT, STRING, INT, INT, PDOUBLE)
+FCALLSCFUN5 (INT, vlistDefAttTxt, VLISTDEFATTTXT, vlistdefatttxt, INT, INT, STRING, INT, STRING)
+FCALLSCFUN5 (INT, vlistInqAttInt, VLISTINQATTINT, vlistinqattint, INT, INT, STRING, INT, PINT)
+FCALLSCFUN5 (INT, vlistInqAttFlt, VLISTINQATTFLT, vlistinqattflt, INT, INT, STRING, INT, PDOUBLE)
+FCALLSCFUN5 (INT, vlistInqAttTxt, VLISTINQATTTXT, vlistinqatttxt, INT, INT, STRING, INT, PSTRING)
+
+/*  GRID routines  */
+
+FCALLSCSUB2 (gridName, GRIDNAME, gridname, INT, PSTRING)
+FCALLSCFUN1 (STRING, gridNamePtr, GRIDNAMEPTR, gridnameptr, INT)
+FCALLSCSUB1 (gridCompress, GRIDCOMPRESS, gridcompress, INT)
+FCALLSCSUB2 (gridDefMaskGME, GRIDDEFMASKGME, griddefmaskgme, INT, PINT)
+FCALLSCFUN2 (INT, gridInqMaskGME, GRIDINQMASKGME, gridinqmaskgme, INT, PINT)
+FCALLSCSUB2 (gridDefMask, GRIDDEFMASK, griddefmask, INT, PINT)
+FCALLSCFUN2 (INT, gridInqMask, GRIDINQMASK, gridinqmask, INT, PINT)
+FCALLSCSUB2 (gridPrint, GRIDPRINT, gridprint, INT, INT)
+FCALLSCFUN0 (INT, gridSize, GRIDSIZE, gridsize)
+FCALLSCFUN2 (INT, gridCreate, GRIDCREATE, gridcreate, INT, INT)
+FCALLSCSUB1 (gridDestroy, GRIDDESTROY, griddestroy, INT)
+FCALLSCFUN1 (INT, gridDuplicate, GRIDDUPLICATE, gridduplicate, INT)
+FCALLSCFUN1 (INT, gridInqType, GRIDINQTYPE, gridinqtype, INT)
+FCALLSCFUN1 (INT, gridInqSize, GRIDINQSIZE, gridinqsize, INT)
+FCALLSCSUB2 (gridDefXsize, GRIDDEFXSIZE, griddefxsize, INT, INT)
+FCALLSCFUN1 (INT, gridInqXsize, GRIDINQXSIZE, gridinqxsize, INT)
+FCALLSCSUB2 (gridDefYsize, GRIDDEFYSIZE, griddefysize, INT, INT)
+FCALLSCFUN1 (INT, gridInqYsize, GRIDINQYSIZE, gridinqysize, INT)
+FCALLSCSUB2 (gridDefNP, GRIDDEFNP, griddefnp, INT, INT)
+FCALLSCFUN1 (INT, gridInqNP, GRIDINQNP, gridinqnp, INT)
+FCALLSCSUB2 (gridDefXvals, GRIDDEFXVALS, griddefxvals, INT, PDOUBLE)
+FCALLSCFUN2 (INT, gridInqXvals, GRIDINQXVALS, gridinqxvals, INT, PDOUBLE)
+FCALLSCSUB2 (gridDefYvals, GRIDDEFYVALS, griddefyvals, INT, PDOUBLE)
+FCALLSCFUN2 (INT, gridInqYvals, GRIDINQYVALS, gridinqyvals, INT, PDOUBLE)
+FCALLSCSUB2 (gridDefXname, GRIDDEFXNAME, griddefxname, INT, STRING)
+FCALLSCSUB2 (gridDefXlongname, GRIDDEFXLONGNAME, griddefxlongname, INT, STRING)
+FCALLSCSUB2 (gridDefXunits, GRIDDEFXUNITS, griddefxunits, INT, STRING)
+FCALLSCSUB2 (gridDefYname, GRIDDEFYNAME, griddefyname, INT, STRING)
+FCALLSCSUB2 (gridDefYlongname, GRIDDEFYLONGNAME, griddefylongname, INT, STRING)
+FCALLSCSUB2 (gridDefYunits, GRIDDEFYUNITS, griddefyunits, INT, STRING)
+FCALLSCSUB2 (gridInqXname, GRIDINQXNAME, gridinqxname, INT, PSTRING)
+FCALLSCSUB2 (gridInqXlongname, GRIDINQXLONGNAME, gridinqxlongname, INT, PSTRING)
+FCALLSCSUB2 (gridInqXstdname, GRIDINQXSTDNAME, gridinqxstdname, INT, PSTRING)
+FCALLSCSUB2 (gridInqXunits, GRIDINQXUNITS, gridinqxunits, INT, PSTRING)
+FCALLSCSUB2 (gridInqYname, GRIDINQYNAME, gridinqyname, INT, PSTRING)
+FCALLSCSUB2 (gridInqYlongname, GRIDINQYLONGNAME, gridinqylongname, INT, PSTRING)
+FCALLSCSUB2 (gridInqYstdname, GRIDINQYSTDNAME, gridinqystdname, INT, PSTRING)
+FCALLSCSUB2 (gridInqYunits, GRIDINQYUNITS, gridinqyunits, INT, PSTRING)
+FCALLSCSUB2 (gridDefPrec, GRIDDEFPREC, griddefprec, INT, INT)
+FCALLSCFUN1 (INT, gridInqPrec, GRIDINQPREC, gridinqprec, INT)
+FCALLSCFUN2 (DOUBLE, gridInqXval, GRIDINQXVAL, gridinqxval, INT, INT)
+FCALLSCFUN2 (DOUBLE, gridInqYval, GRIDINQYVAL, gridinqyval, INT, INT)
+FCALLSCFUN1 (DOUBLE, gridInqXinc, GRIDINQXINC, gridinqxinc, INT)
+FCALLSCFUN1 (DOUBLE, gridInqYinc, GRIDINQYINC, gridinqyinc, INT)
+FCALLSCFUN1 (INT, gridIsCircular, GRIDISCIRCULAR, gridiscircular, INT)
+FCALLSCFUN1 (INT, gridIsRotated, GRIDISROTATED, gridisrotated, INT)
+FCALLSCFUN1 (DOUBLE, gridInqXpole, GRIDINQXPOLE, gridinqxpole, INT)
+FCALLSCSUB2 (gridDefXpole, GRIDDEFXPOLE, griddefxpole, INT, DOUBLE)
+FCALLSCFUN1 (DOUBLE, gridInqYpole, GRIDINQYPOLE, gridinqypole, INT)
+FCALLSCSUB2 (gridDefYpole, GRIDDEFYPOLE, griddefypole, INT, DOUBLE)
+FCALLSCFUN1 (DOUBLE, gridInqAngle, GRIDINQANGLE, gridinqangle, INT)
+FCALLSCSUB2 (gridDefAngle, GRIDDEFANGLE, griddefangle, INT, DOUBLE)
+FCALLSCSUB2 (gridDefTrunc, GRIDDEFTRUNC, griddeftrunc, INT, INT)
+FCALLSCFUN1 (INT, gridInqTrunc, GRIDINQTRUNC, gridinqtrunc, INT)
+
+/*  Hexagonal GME grid  */
+
+FCALLSCFUN1 (INT, gridInqGMEnd, GRIDINQGMEND, gridinqgmend, INT)
+FCALLSCSUB2 (gridDefGMEnd, GRIDDEFGMEND, griddefgmend, INT, INT)
+FCALLSCFUN1 (INT, gridInqGMEni, GRIDINQGMENI, gridinqgmeni, INT)
+FCALLSCSUB2 (gridDefGMEni, GRIDDEFGMENI, griddefgmeni, INT, INT)
+FCALLSCFUN1 (INT, gridInqGMEni2, GRIDINQGMENI2, gridinqgmeni2, INT)
+FCALLSCSUB2 (gridDefGMEni2, GRIDDEFGMENI2, griddefgmeni2, INT, INT)
+FCALLSCFUN1 (INT, gridInqGMEni3, GRIDINQGMENI3, gridinqgmeni3, INT)
+FCALLSCSUB2 (gridDefGMEni3, GRIDDEFGMENI3, griddefgmeni3, INT, INT)
+
+/*  Reference grid  */
+
+FCALLSCFUN1 (INT, gridInqNumber, GRIDINQNUMBER, gridinqnumber, INT)
+FCALLSCSUB2 (gridDefNumber, GRIDDEFNUMBER, griddefnumber, INT, INT)
+FCALLSCFUN1 (INT, gridInqPosition, GRIDINQPOSITION, gridinqposition, INT)
+FCALLSCSUB2 (gridDefPosition, GRIDDEFPOSITION, griddefposition, INT, INT)
+FCALLSCFUN2 (INT, gridInqReference, GRIDINQREFERENCE, gridinqreference, INT, PSTRING)
+FCALLSCSUB2 (gridDefReference, GRIDDEFREFERENCE, griddefreference, INT, STRING)
+FCALLSCFUN2 (STRING, gridInqUUID, GRIDINQUUID, gridinquuid, INT, PSTRING)
+FCALLSCSUB2 (gridDefUUID, GRIDDEFUUID, griddefuuid, INT, STRING)
+
+/*  Lambert Conformal Conic grid (GRIB version)  */
+
+FCALLSCSUB10 (gridDefLCC, GRIDDEFLCC, griddeflcc, INT, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE, INT, INT)
+FCALLSCSUB10 (gridInqLCC, GRIDINQLCC, gridinqlcc, INT, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PINT, PINT)
+
+/*  Lambert Conformal Conic 2 grid (PROJ version)  */
+
+FCALLSCSUB6 (gridDefLcc2, GRIDDEFLCC2, griddeflcc2, INT, DOUBLE, DOUBLE, DOUBLE, DOUBLE, DOUBLE)
+FCALLSCSUB6 (gridInqLcc2, GRIDINQLCC2, gridinqlcc2, INT, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE, PDOUBLE)
+
+/*  Lambert Azimuthal Equal Area grid  */
+
+FCALLSCSUB4 (gridDefLaea, GRIDDEFLAEA, griddeflaea, INT, DOUBLE, DOUBLE, DOUBLE)
+FCALLSCSUB4 (gridInqLaea, GRIDINQLAEA, gridinqlaea, INT, PDOUBLE, PDOUBLE, PDOUBLE)
+FCALLSCSUB2 (gridDefArea, GRIDDEFAREA, griddefarea, INT, PDOUBLE)
+FCALLSCSUB2 (gridInqArea, GRIDINQAREA, gridinqarea, INT, PDOUBLE)
+FCALLSCFUN1 (INT, gridHasArea, GRIDHASAREA, gridhasarea, INT)
+FCALLSCSUB2 (gridDefNvertex, GRIDDEFNVERTEX, griddefnvertex, INT, INT)
+FCALLSCFUN1 (INT, gridInqNvertex, GRIDINQNVERTEX, gridinqnvertex, INT)
+FCALLSCSUB2 (gridDefXbounds, GRIDDEFXBOUNDS, griddefxbounds, INT, PDOUBLE)
+FCALLSCFUN2 (INT, gridInqXbounds, GRIDINQXBOUNDS, gridinqxbounds, INT, PDOUBLE)
+FCALLSCSUB2 (gridDefYbounds, GRIDDEFYBOUNDS, griddefybounds, INT, PDOUBLE)
+FCALLSCFUN2 (INT, gridInqYbounds, GRIDINQYBOUNDS, gridinqybounds, INT, PDOUBLE)
+FCALLSCSUB3 (gridDefRowlon, GRIDDEFROWLON, griddefrowlon, INT, INT, PINT)
+FCALLSCSUB2 (gridInqRowlon, GRIDINQROWLON, gridinqrowlon, INT, PINT)
+FCALLSCSUB2 (gridChangeType, GRIDCHANGETYPE, gridchangetype, INT, INT)
+FCALLSCSUB2 (gridDefComplexPacking, GRIDDEFCOMPLEXPACKING, griddefcomplexpacking, INT, INT)
+FCALLSCFUN1 (INT, gridInqComplexPacking, GRIDINQCOMPLEXPACKING, gridinqcomplexpacking, INT)
+
+/*  ZAXIS routines  */
+
+FCALLSCSUB2 (zaxisName, ZAXISNAME, zaxisname, INT, PSTRING)
+FCALLSCFUN2 (INT, zaxisCreate, ZAXISCREATE, zaxiscreate, INT, INT)
+FCALLSCSUB1 (zaxisDestroy, ZAXISDESTROY, zaxisdestroy, INT)
+FCALLSCFUN1 (INT, zaxisInqType, ZAXISINQTYPE, zaxisinqtype, INT)
+FCALLSCFUN1 (INT, zaxisInqSize, ZAXISINQSIZE, zaxisinqsize, INT)
+FCALLSCFUN1 (INT, zaxisDuplicate, ZAXISDUPLICATE, zaxisduplicate, INT)
+FCALLSCSUB2 (zaxisResize, ZAXISRESIZE, zaxisresize, INT, INT)
+FCALLSCSUB1 (zaxisPrint, ZAXISPRINT, zaxisprint, INT)
+FCALLSCFUN0 (INT, zaxisSize, ZAXISSIZE, zaxissize)
+FCALLSCSUB2 (zaxisDefLevels, ZAXISDEFLEVELS, zaxisdeflevels, INT, PDOUBLE)
+FCALLSCSUB2 (zaxisInqLevels, ZAXISINQLEVELS, zaxisinqlevels, INT, PDOUBLE)
+FCALLSCSUB3 (zaxisDefLevel, ZAXISDEFLEVEL, zaxisdeflevel, INT, INT, DOUBLE)
+FCALLSCFUN2 (DOUBLE, zaxisInqLevel, ZAXISINQLEVEL, zaxisinqlevel, INT, INT)
+FCALLSCSUB2 (zaxisDefReference, ZAXISDEFREFERENCE, zaxisdefreference, INT, INT)
+FCALLSCSUB2 (zaxisDefUUID, ZAXISDEFUUID, zaxisdefuuid, INT, STRING)
+FCALLSCFUN2 (STRING, zaxisInqUUID, ZAXISINQUUID, zaxisinquuid, INT, PSTRING)
+FCALLSCFUN1 (INT, zaxisInqReference, ZAXISINQREFERENCE, zaxisinqreference, INT)
+FCALLSCSUB2 (zaxisDefName, ZAXISDEFNAME, zaxisdefname, INT, STRING)
+FCALLSCSUB2 (zaxisDefLongname, ZAXISDEFLONGNAME, zaxisdeflongname, INT, STRING)
+FCALLSCSUB2 (zaxisDefUnits, ZAXISDEFUNITS, zaxisdefunits, INT, STRING)
+FCALLSCSUB2 (zaxisInqName, ZAXISINQNAME, zaxisinqname, INT, PSTRING)
+FCALLSCSUB2 (zaxisInqLongname, ZAXISINQLONGNAME, zaxisinqlongname, INT, PSTRING)
+FCALLSCSUB2 (zaxisInqStdname, ZAXISINQSTDNAME, zaxisinqstdname, INT, PSTRING)
+FCALLSCSUB2 (zaxisInqUnits, ZAXISINQUNITS, zaxisinqunits, INT, PSTRING)
+FCALLSCSUB2 (zaxisDefPrec, ZAXISDEFPREC, zaxisdefprec, INT, INT)
+FCALLSCFUN1 (INT, zaxisInqPrec, ZAXISINQPREC, zaxisinqprec, INT)
+FCALLSCFUN1 (INT, zaxisInqPositive, ZAXISINQPOSITIVE, zaxisinqpositive, INT)
+FCALLSCSUB2 (zaxisDefLtype, ZAXISDEFLTYPE, zaxisdefltype, INT, INT)
+FCALLSCFUN1 (INT, zaxisInqLtype, ZAXISINQLTYPE, zaxisinqltype, INT)
+FCALLSCSUB3 (zaxisDefVct, ZAXISDEFVCT, zaxisdefvct, INT, INT, PDOUBLE)
+FCALLSCSUB2 (zaxisInqVct, ZAXISINQVCT, zaxisinqvct, INT, PDOUBLE)
+FCALLSCFUN1 (INT, zaxisInqVctSize, ZAXISINQVCTSIZE, zaxisinqvctsize, INT)
+FCALLSCFUN2 (INT, zaxisInqLbounds, ZAXISINQLBOUNDS, zaxisinqlbounds, INT, PDOUBLE)
+FCALLSCFUN2 (INT, zaxisInqUbounds, ZAXISINQUBOUNDS, zaxisinqubounds, INT, PDOUBLE)
+FCALLSCFUN2 (INT, zaxisInqWeights, ZAXISINQWEIGHTS, zaxisinqweights, INT, PDOUBLE)
+FCALLSCFUN2 (DOUBLE, zaxisInqLbound, ZAXISINQLBOUND, zaxisinqlbound, INT, INT)
+FCALLSCFUN2 (DOUBLE, zaxisInqUbound, ZAXISINQUBOUND, zaxisinqubound, INT, INT)
+FCALLSCSUB2 (zaxisDefLbounds, ZAXISDEFLBOUNDS, zaxisdeflbounds, INT, PDOUBLE)
+FCALLSCSUB2 (zaxisDefUbounds, ZAXISDEFUBOUNDS, zaxisdefubounds, INT, PDOUBLE)
+FCALLSCSUB2 (zaxisDefWeights, ZAXISDEFWEIGHTS, zaxisdefweights, INT, PDOUBLE)
+FCALLSCSUB2 (zaxisChangeType, ZAXISCHANGETYPE, zaxischangetype, INT, INT)
+
+/*  TAXIS routines  */
+
+FCALLSCFUN1 (INT, taxisCreate, TAXISCREATE, taxiscreate, INT)
+FCALLSCSUB1 (taxisDestroy, TAXISDESTROY, taxisdestroy, INT)
+FCALLSCFUN1 (INT, taxisDuplicate, TAXISDUPLICATE, taxisduplicate, INT)
+FCALLSCSUB2 (taxisCopyTimestep, TAXISCOPYTIMESTEP, taxiscopytimestep, INT, INT)
+FCALLSCSUB2 (taxisDefType, TAXISDEFTYPE, taxisdeftype, INT, INT)
+FCALLSCSUB2 (taxisDefVdate, TAXISDEFVDATE, taxisdefvdate, INT, INT)
+FCALLSCSUB2 (taxisDefVtime, TAXISDEFVTIME, taxisdefvtime, INT, INT)
+FCALLSCSUB2 (taxisDefRdate, TAXISDEFRDATE, taxisdefrdate, INT, INT)
+FCALLSCSUB2 (taxisDefRtime, TAXISDEFRTIME, taxisdefrtime, INT, INT)
+FCALLSCFUN1 (INT, taxisHasBounds, TAXISHASBOUNDS, taxishasbounds, INT)
+FCALLSCSUB1 (taxisDeleteBounds, TAXISDELETEBOUNDS, taxisdeletebounds, INT)
+FCALLSCSUB3 (taxisDefVdateBounds, TAXISDEFVDATEBOUNDS, taxisdefvdatebounds, INT, INT, INT)
+FCALLSCSUB3 (taxisDefVtimeBounds, TAXISDEFVTIMEBOUNDS, taxisdefvtimebounds, INT, INT, INT)
+FCALLSCSUB3 (taxisInqVdateBounds, TAXISINQVDATEBOUNDS, taxisinqvdatebounds, INT, PINT, PINT)
+FCALLSCSUB3 (taxisInqVtimeBounds, TAXISINQVTIMEBOUNDS, taxisinqvtimebounds, INT, PINT, PINT)
+FCALLSCSUB2 (taxisDefCalendar, TAXISDEFCALENDAR, taxisdefcalendar, INT, INT)
+FCALLSCSUB2 (taxisDefTunit, TAXISDEFTUNIT, taxisdeftunit, INT, INT)
+FCALLSCSUB2 (taxisDefNumavg, TAXISDEFNUMAVG, taxisdefnumavg, INT, INT)
+FCALLSCFUN1 (INT, taxisInqType, TAXISINQTYPE, taxisinqtype, INT)
+FCALLSCFUN1 (INT, taxisInqVdate, TAXISINQVDATE, taxisinqvdate, INT)
+FCALLSCFUN1 (INT, taxisInqVtime, TAXISINQVTIME, taxisinqvtime, INT)
+FCALLSCFUN1 (INT, taxisInqRdate, TAXISINQRDATE, taxisinqrdate, INT)
+FCALLSCFUN1 (INT, taxisInqRtime, TAXISINQRTIME, taxisinqrtime, INT)
+FCALLSCFUN1 (INT, taxisInqCalendar, TAXISINQCALENDAR, taxisinqcalendar, INT)
+FCALLSCFUN1 (INT, taxisInqTunit, TAXISINQTUNIT, taxisinqtunit, INT)
+FCALLSCFUN1 (INT, taxisInqNumavg, TAXISINQNUMAVG, taxisinqnumavg, INT)
+FCALLSCFUN1 (STRING, tunitNamePtr, TUNITNAMEPTR, tunitnameptr, INT)
+
+/*  Institut routines  */
+
+FCALLSCFUN4 (INT, institutDef, INSTITUTDEF, institutdef, INT, INT, STRING, STRING)
+FCALLSCFUN4 (INT, institutInq, INSTITUTINQ, institutinq, INT, INT, STRING, STRING)
+FCALLSCFUN0 (INT, institutInqNumber, INSTITUTINQNUMBER, institutinqnumber)
+FCALLSCFUN1 (INT, institutInqCenter, INSTITUTINQCENTER, institutinqcenter, INT)
+FCALLSCFUN1 (INT, institutInqSubcenter, INSTITUTINQSUBCENTER, institutinqsubcenter, INT)
+FCALLSCFUN1 (STRING, institutInqNamePtr, INSTITUTINQNAMEPTR, institutinqnameptr, INT)
+FCALLSCFUN1 (STRING, institutInqLongnamePtr, INSTITUTINQLONGNAMEPTR, institutinqlongnameptr, INT)
+
+/*  Model routines  */
+
+FCALLSCFUN3 (INT, modelDef, MODELDEF, modeldef, INT, INT, STRING)
+FCALLSCFUN3 (INT, modelInq, MODELINQ, modelinq, INT, INT, PSTRING)
+FCALLSCFUN1 (INT, modelInqInstitut, MODELINQINSTITUT, modelinqinstitut, INT)
+FCALLSCFUN1 (INT, modelInqGribID, MODELINQGRIBID, modelinqgribid, INT)
+FCALLSCFUN1 (STRING, modelInqNamePtr, MODELINQNAMEPTR, modelinqnameptr, INT)
+
+/*  Table routines  */
+
+FCALLSCSUB2 (tableWriteC, TABLEWRITEC, tablewritec, STRING, INT)
+FCALLSCSUB2 (tableWrite, TABLEWRITE, tablewrite, STRING, INT)
+FCALLSCFUN1 (INT, tableRead, TABLEREAD, tableread, STRING)
+FCALLSCFUN3 (INT, tableDef, TABLEDEF, tabledef, INT, INT, STRING)
+FCALLSCFUN1 (STRING, tableInqNamePtr, TABLEINQNAMEPTR, tableinqnameptr, INT)
+FCALLSCSUB5 (tableDefEntry, TABLEDEFENTRY, tabledefentry, INT, INT, STRING, STRING, STRING)
+FCALLSCFUN3 (INT, tableInq, TABLEINQ, tableinq, INT, INT, STRING)
+FCALLSCFUN0 (INT, tableInqNumber, TABLEINQNUMBER, tableinqnumber)
+FCALLSCFUN1 (INT, tableInqNum, TABLEINQNUM, tableinqnum, INT)
+FCALLSCFUN1 (INT, tableInqModel, TABLEINQMODEL, tableinqmodel, INT)
+FCALLSCSUB5 (tableInqPar, TABLEINQPAR, tableinqpar, INT, INT, PSTRING, PSTRING, PSTRING)
+FCALLSCFUN3 (INT, tableInqParCode, TABLEINQPARCODE, tableinqparcode, INT, PSTRING, PINT)
+FCALLSCFUN3 (INT, tableInqParName, TABLEINQPARNAME, tableinqparname, INT, INT, PSTRING)
+FCALLSCFUN3 (INT, tableInqParLongname, TABLEINQPARLONGNAME, tableinqparlongname, INT, INT, PSTRING)
+FCALLSCFUN3 (INT, tableInqParUnits, TABLEINQPARUNITS, tableinqparunits, INT, INT, PSTRING)
+FCALLSCFUN2 (STRING, tableInqParNamePtr, TABLEINQPARNAMEPTR, tableinqparnameptr, INT, INT)
+FCALLSCFUN2 (STRING, tableInqParLongnamePtr, TABLEINQPARLONGNAMEPTR, tableinqparlongnameptr, INT, INT)
+FCALLSCFUN2 (STRING, tableInqParUnitsPtr, TABLEINQPARUNITSPTR, tableinqparunitsptr, INT, INT)
+
+/*  History routines  */
+
+FCALLSCSUB3 (streamDefHistory, STREAMDEFHISTORY, streamdefhistory, INT, INT, STRING)
+FCALLSCFUN1 (INT, streamInqHistorySize, STREAMINQHISTORYSIZE, streaminqhistorysize, INT)
+FCALLSCSUB2 (streamInqHistoryString, STREAMINQHISTORYSTRING, streaminqhistorystring, INT, PSTRING)
+
+#endif
diff --git a/libcdi/src/cfortran.doc b/libcdi/src/cfortran.doc
new file mode 100644
index 0000000..280cb2b
--- /dev/null
+++ b/libcdi/src/cfortran.doc
@@ -0,0 +1,2049 @@
+cfortran.doc  4.3
+http://www-zeus.desy.de/~burow/cfortran/
+Burkhard Burow  burow at ifh.de                  1990 - 2000.
+
+              cfortran.h :  Interfacing C or C++ and FORTRAN
+
+Supports: Alpha and VAX VMS, Alpha OSF, DECstation and VAX Ultrix, IBM RS/6000, 
+          Silicon Graphics, Sun, CRAY, Apollo, HP9000, LynxOS, Convex, Absoft,
+          f2c, g77, NAG f90, PowerStation Fortran with Visual C++, NEC SX-4,
+          Portland Group.
+
+C and C++ are generally equivalent as far as cfortran.h is concerned.
+Unless explicitly noted otherwise, mention of C implicitly includes C++.
+C++ compilers tested include: 
+  SunOS> CC +p +w      # Clean compiles.
+  IRIX>  CC            # Clean compiles.
+  IRIX>  CC -fullwarn  # Still some warnings to be overcome.
+  GNU>   g++ -Wall     # Compiles are clean, other than warnings for unused
+                       #   cfortran.h static routines.
+
+N.B.: The best documentation on interfacing C or C++ and Fortran is in
+      the chapter named something like 'Interfacing C and Fortran'
+      to be found in the user's guide of almost every Fortran compiler.
+      Understanding this information for one or more Fortran compilers
+      greatly clarifies the aims and actions of cfortran.h.
+      Such a chapter generally also addresses issues orthogonal to cfortran.h,
+      for example the order of array indices, the index of the first element,
+      as well as compiling and linking issues.
+
+
+0 Short Summary of the Syntax Required to Create the Interface
+--------------------------------------------------------------
+
+e.g. Prototyping a FORTRAN subroutine for C:
+
+/* PROTOCCALLSFSUBn is optional for C, but mandatory for C++. */
+
+                 PROTOCCALLSFSUB2(SUB_NAME,sub_name,STRING,PINT)
+#define SUB_NAME(A,B) CCALLSFSUB2(SUB_NAME,sub_name,STRING,PINT, A,B)
+
+                                ^     -                                       -
+       number of arguments _____|    |   STRING   BYTE    PBYTE       BYTEV(..)|
+                                  /  |   STRINGV  DOUBLE  PDOUBLE   DOUBLEV(..)|
+                                 /   |  PSTRING   FLOAT   PFLOAT     FLOATV(..)|
+        types of arguments ____ /    | PNSTRING   INT     PINT         INTV(..)|
+                                \    | PPSTRING   LOGICAL PLOGICAL LOGICALV(..)|
+                                 \   |  PSTRINGV  LONG    PLONG       LONGV(..)|
+                                  \  |   ZTRINGV  SHORT   PSHORT     SHORTV(..)|
+                                     |  PZTRINGV  ROUTINE PVOID      SIMPLE    |
+                                      -                                       -
+
+
+e.g. Prototyping a FORTRAN function for C:
+/* PROTOCCALLSFFUNn is mandatory for both C and C++. */
+PROTOCCALLSFFUN1(INT,FUN_NAME,fun_name,STRING)
+#define FUN_NAME(A)  CCALLSFFUN1(FUN_NAME,fun_name,STRING, A)
+
+e.g. calling FUN_NAME from C:    {int a; a = FUN_NAME("hello");}
+
+
+e.g. Creating a FORTRAN-callable wrapper for
+     a C function returning void, with a 7 dimensional integer array argument:
+     [Not supported from C++.]
+FCALLSCSUB1(csub_name,CSUB_NAME,csub_name,INTVVVVVVV)
+
+
+e.g. Creating a FORTRAN-callable wrapper for other C functions:
+FCALLSCFUN1(STRING,cfun_name,CFUN_NAME,cfun_name,INT)
+           [ ^-- BYTE, DOUBLE, FLOAT, INT, LOGICAL, LONG, SHORT, VOID  
+             are other types returned by functions.       ]
+       
+
+e.g. COMMON BLOCKs:
+FORTRAN:                         common /fcb/  v,w,x
+                                 character *(13) v, w(4), x(3,2)
+C:
+typedef struct { char v[13],w[4][13],x[2][3][13]; } FCB_DEF;
+#define FCB COMMON_BLOCK(FCB,fcb)
+COMMON_BLOCK_DEF(FCB_DEF,FCB);
+FCB_DEF FCB;    /* Define, i.e. allocate memory, in exactly one *.c file. */
+
+e.g. accessing FCB in C:          printf("%.13s",FCB.v);
+
+
+
+I Introduction
+--------------
+
+cfortran.h is an easy-to-use powerful bridge between C and FORTRAN.
+It provides a completely transparent, machine independent interface between
+C and FORTRAN routines (= subroutines and/or functions) and global data,
+i.e. structures and COMMON blocks.
+
+The complete cfortran.h package consists of 4 files: the documentation in
+cfortran.doc, the engine cfortran.h, examples in cfortest.c and 
+cfortex.f/or. [cfortex.for under VMS, cfortex.f on other machines.]
+
+The cfortran.h package continues to be developed. The most recent version is
+available via www at http://www-zeus.desy.de/~burow/cfortran/
+
+The examples may be run using one of the following sets of instructions:
+
+N.B. Unlike earlier versions, cfortran.h 3.0 and later versions
+     automatically uses the correct ANSI ## or pre-ANSI /**/
+     preprocessor operator as required by the C compiler.
+
+N.B. As a general rule when trying to determine how to link C and Fortran,
+     link a trivial Fortran program using the Fortran compilers verbose option,
+     in order to see how the Fortran compiler drives the linker. e.g.
+       unix> cat f.f
+                END
+       unix> f77 -v f.f
+       .. lots of info. follows ...
+
+N.B. If using a C main(), i.e. Fortran PROGRAM is not entry of the executable,
+     and if the link bombs with a complaint about
+     a missing "MAIN" (e.g. MAIN__, MAIN_, f90_main or similar),
+     then Fortran has hijacked the entry point to the executable
+     and wishes to call the rest of the executable via "MAIN".
+     This can usually be satisfied by doing e.g. 'cc -Dmain=MAIN__ ...'
+     but often kills the command line arguments in argv and argc.
+     The f77 verbose option, usually -v, may point to a solution.
+     
+
+RS/6000> # Users are strongly urged to use f77 -qextname and cc -Dextname
+RS/6000> # Use -Dextname=extname if extname is a symbol used in the C code.
+RS/6000> xlf -c -qextname cfortex.f
+RS/6000> cc  -c -Dextname cfortest.c
+RS/6000> xlf -o cfortest cfortest.o cfortex.o && cfortest 
+
+DECFortran> #Only DECstations with DECFortran for Ultrix RISC Systems.
+DECFortran> cc -c -DDECFortran cfortest.c
+DECFortran> f77 -o cfortest cfortest.o cfortex.f  &&  cfortest
+
+IRIX xxxxxx 5.2 02282015 IP20 mips
+MIPS> # DECstations and Silicon Graphics using the MIPS compilers.
+MIPS> cc -o cfortest cfortest.c cfortex.f -lI77 -lU77 -lF77  &&  cfortest
+MIPS> # Can also let f77 drive linking, e.g.
+MIPS> cc -c cfortest.c
+MIPS> f77 -o cfortest cfortest.o cfortex.f  &&  cfortest
+
+Apollo> # Some 'C compiler 68K Rev6.8' break. [See Section II o) Notes: Apollo]
+Apollo> f77 -c cfortex.f && cc -o cfortest cfortest.c cfortex.o  &&  cfortest
+
+VMS> define lnk$library sys$library:vaxcrtl
+VMS> cc cfortest.c
+VMS> fortran cfortex.for
+VMS> link/exec=cfortest cfortest,cfortex
+VMS> run cfortest
+
+OSF1 xxxxxx V3.0 347 alpha
+Alpha/OSF> # Probably better to let cc drive linking, e.g.
+Alpha/OSF> f77 -c cfortex.f
+Alpha/OSF> cc  -o cfortest cfortest.c cfortex.o -lUfor -lfor -lFutil -lots -lm
+Alpha/OSF> cfortest
+Alpha/OSF> # Else may need 'cc -Dmain=MAIN__' to let f77 drive linking.
+
+Sun> # Some old cc(1) need a little help. [See Section II o) Notes: Sun]
+Sun> f77 -o cfortest cfortest.c cfortex.f -lc -lm  &&  cfortest
+Sun> # Some older f77 may require 'cc -Dmain=MAIN_'.
+
+CRAY> cft77 cfortex.f
+CRAY> cc -c cfortest.c
+CRAY> segldr -o cfortest.e cfortest.o cfortex.o
+CRAY> ./cfortest.e
+
+NEC> cc -c -Xa cfortest.c
+NEC> f77 -o cfortest cfortest.o cfortex.f  &&  cfortest
+
+VAX/Ultrix/cc> # For cc on VAX Ultrix only, do the following once to cfortran.h.
+VAX/Ultrix/cc> mv cfortran.h cftmp.h && grep -v "^#pragma" <cftmp.h >cfortran.h
+                                            
+VAX/Ultrix/f77> # In the following, 'CC' is either 'cc' or 'gcc -ansi'. NOT'vcc'
+VAX/Ultrix/f77> CC -c -Dmain=MAIN_ cfortest.c
+VAX/Ultrix/f77> f77 -o cfortest cfortex.f cfortest.o  &&  cfortest
+
+LynxOS> # In the following, 'CC' is either 'cc' or 'gcc -ansi'.
+LynxOS> # Unfortunately cc is easily overwhelmed by cfortran.h,
+LynxOS> #  and won't compile some of the cfortest.c demos.
+LynxOS> f2c -R cfortex.f
+LynxOS> CC -Dlynx -o cfortest cfortest.c cfortex.c -lf2c  &&  cfortest
+
+HP9000> # Tested with HP-UX 7.05 B 9000/380 and with A.08.07 A 9000/730
+HP9000> # CC may be either 'c89 -Aa' or 'cc -Aa'
+HP9000> #    Depending on the compiler version, you may need to include the
+HP9000> #    option '-tp,/lib/cpp' or worse, you'll have to stick to the K&R C.
+HP9000> #    [See Section II o) Notes: HP9000]
+HP9000> # Users are strongly urged to use f77 +ppu and cc -Dextname
+HP9000> # Use -Dextname=extname if extname is a symbol used in the C code.
+HP9000> CC  -Dextname -c cfortest.c
+HP9000> f77 +ppu         cfortex.f  -o cfortest cfortest.o && cfortest
+HP9000> # Older f77 may need
+HP9000> f77 -c cfortex.f
+HP9000> CC -o cfortest cfortest.c cfortex.o -lI77 -lF77 && cfortest
+
+HP0000> # If old-style f77 +800 compiled objects are required:
+HP9000> # #define hpuxFortran800
+HP9000> cc -c -Aa -DhpuxFortran800 cfortest.c
+HP9000> f77 +800 -o cfortest cfortest.o cfortex.f
+
+f2c> # In the following, 'CC' is any C compiler.
+f2c> f2c -R cfortex.f
+f2c> CC -o cfortest -Df2cFortran cfortest.c cfortex.c -lf2c  &&  cfortest
+
+Portland Group $ # Presumably other C compilers also work.
+Portland Group $ pgcc -DpgiFortran -c cfortest.c
+Portland Group $ pgf77 -o cfortest cfortex.f cfortest.o && cfortest
+
+NAGf90> # cfortex.f is distributed with Fortran 77 style comments.
+NAGf90> # To convert to f90 style comments do the following once to cfortex.f: 
+NAGf90> mv cfortex.f cf_temp.f && sed 's/^C/\!/g' cf_temp.f > cfortex.f
+NAGf90> # In the following, 'CC' is any C compiler.
+NAGf90> CC -c -DNAGf90Fortran cfortest.c
+NAGf90> f90 -o cfortest cfortest.o cfortex.f &&  cfortest
+
+PC> # On a PC with PowerStation Fortran and Visual_C++
+PC> cl /c cftest.c
+PC> fl32  cftest.obj cftex.for
+
+GNU> # GNU Fortran
+GNU> # See Section VI caveat on using 'gcc -traditional'.
+GNU> gcc -ansi -Wall -O -c -Df2cFortran cfortest.c
+GNU> g77 -ff2c -o cfortest cfortest.o cfortex.f &&  cfortest
+
+AbsoftUNIX> # Absoft Fortran for all UNIX based operating systems.
+AbsoftUNIX> # e.g. Linux or Next on Intel or Motorola68000.
+AbsoftUNIX> # Absoft f77 -k allows Fortran routines to be safely called from C.
+AbsoftUNIX> gcc -ansi -Wall -O -c -DAbsoftUNIXFortran cfortest.c
+AbsoftUNIX> f77 -k -o cfortest cfortest.o cfortex.f && cfortest
+
+AbsoftPro> # Absoft Pro Fortran for MacOS
+AbsoftPro> # Use #define AbsoftProFortran
+
+CLIPPER> # INTERGRAPH CLIX using CLIPPER C and Fortran compilers.
+CLIPPER> # N.B. - User, not cfortran.h, is responsible for
+CLIPPER> #        f77initio() and f77uninitio() if required.
+CLIPPER> #      - LOGICAL values are not mentioned in CLIPPER doc.s,
+CLIPPER> #        so they may not yet be correct in cfortran.h.
+CLIPPER> #      - K&R mode (-knr or Ac=knr) breaks FLOAT functions
+CLIPPER> #        (see CLIPPER doc.s) and cfortran.h does not fix it up.
+CLIPPER> #        [cfortran.h ok for old sun C which made the same mistake.]
+CLIPPER> acc cfortest.c -c -DCLIPPERFortran
+CLIPPER> af77 cfortex.f cfortest.o -o cfortest
+
+
+By changing the SELECTion ifdef of cfortest.c and recompiling one can try out
+a few dozen different few-line examples.
+
+
+
+The benefits of using cfortran.h include:
+1. Machine/OS/compiler independent mixing of C and FORTRAN.
+
+2. Identical (within syntax) calls across languages, e.g.
+C FORTRAN
+      CALL HBOOK1(1,'pT spectrum of pi+',100,0.,5.,0.)
+/* C*/
+           HBOOK1(1,"pT spectrum of pi+",100,0.,5.,0.);
+
+3. Each routine need only be set up once in its lifetime. e.g.
+/* Setting up a FORTRAN routine to be called by C.
+   ID,...,VMX are merely the names of arguments.
+   These tags must be unique w.r.t. each other but are otherwise arbitrary. */
+PROTOCCALLSFSUB6(HBOOK1,hbook1,INT,STRING,INT,FLOAT,FLOAT,FLOAT)
+#define HBOOK1(ID,CHTITLE,NX,XMI,XMA,VMX)                        \
+     CCALLSFSUB6(HBOOK1,hbook1,INT,STRING,INT,FLOAT,FLOAT,FLOAT, \
+               ID,CHTITLE,NX,XMI,XMA,VMX) 
+
+4. Source code is NOT required for the C routines exported to FORTRAN, nor for
+   the FORTRAN routines imported to C. In fact, routines are most easily
+   prototyped using the information in the routines' documentation.
+
+5. Routines, and the code calling them, can be coded naturally in the language
+   of choice. C routines may be coded with the natural assumption of being 
+   called only by C code. cfortran.h does all the required work for FORTRAN 
+   code to call C routines. Similarly it also does all the work required for C
+   to call FORTRAN routines. Therefore:
+     - C programmers need not embed FORTRAN argument passing mechanisms into 
+       their code.
+     - FORTRAN code need not be converted into C code. i.e. The honed and 
+       time-honored FORTRAN routines are called by C.
+
+6. cfortran.h is a single ~1700 line C include file; portable to most
+   remaining, if not all, platforms.
+
+7. STRINGS and VECTORS of STRINGS along with the usual simple arguments to 
+   routines are supported as are functions returning STRINGS or numbers. Arrays
+   of pointers to strings and values of structures as C arguments, will soon be
+   implemented. After learning the machinery of cfortran.h, users can expand 
+   it to create custom types of arguments. [This requires no modification to
+   cfortran.h, all the preprocessor directives required to implement the
+   custom types can be defined outside cfortran.h]
+
+8. cfortran.h requires each routine to be exported to be explicitly set up. 
+   While is usually only be done once in a header file it would be best if
+   applications were required to do no work at all in order to cross languages.
+   cfortran.h's simple syntax could be a convenient back-end for a program
+   which would export FORTRAN or C routines directly from the source code. 
+
+
+                                    -----
+
+Example 1 - cfortran.h has been used to make the C header file hbook.h, 
+            which then gives any C programmer, e.g. example.c, full and 
+            completely transparent access to CERN's HBOOK library of routines.
+            Each HBOOK routine required about 3 lines of simple code in
+            hbook.h. The example also demonstrates how FORTRAN common blocks
+            are defined and used.
+
+/* hbook.h */
+#include "cfortran.h"
+        :
+PROTOCCALLSFSUB6(HBOOK1,hbook1,INT,STRING,INT,FLOAT,FLOAT,FLOAT)
+#define HBOOK1(ID,CHTITLE,NX,XMI,XMA,VMX)                        \
+     CCALLSFSUB6(HBOOK1,hbook1,INT,STRING,INT,FLOAT,FLOAT,FLOAT, \
+               ID,CHTITLE,NX,XMI,XMA,VMX) 
+        :
+/* end hbook.h */
+
+/* example.c */
+#include "hbook.h"
+        :
+typedef struct {
+  int lines;  
+  int status[SIZE];
+  float p[SIZE];  /* momentum */
+} FAKE_DEF;
+#define FAKE COMMON_BLOCK(FAKE,fake)
+COMMON_BLOCK_DEF(FAKE_DEF,FAKE);
+        :
+main ()
+{
+        :
+           HBOOK1(1,"pT spectrum of pi+",100,0.,5.,0.);
+/* c.f. the call in FORTRAN:
+      CALL HBOOK1(1,'pT spectrum of pi+',100,0.,5.,0.)
+*/
+        :
+  FAKE.p[7]=1.0;
+	:
+}           
+
+N.B. i) The routine is language independent.
+    ii) hbook.h is machine independent.  
+   iii) Applications using routines via cfortran.h are machine independent.
+
+                                    -----
+
+Example 2 - Many VMS System calls are most easily called from FORTRAN, but
+            cfortran.h now gives that ease in C.
+
+#include "cfortran.h"
+
+PROTOCCALLSFSUB3(LIB$SPAWN,lib$spawn,STRING,STRING,STRING)
+#define LIB$SPAWN(command,input_file,output_file)          \
+     CCALLSFSUB3(LIB$SPAWN,lib$spawn,STRING,STRING,STRING, \
+                  command,input_file,output_file)
+
+main ()
+{
+LIB$SPAWN("set term/width=132","","");
+}
+
+Obviously the cfortran.h command above could be put into a header file along
+with the description of the other system calls, but as this example shows, it's
+not much hassle to set up cfortran.h for even a single call.
+
+                                    -----
+
+Example 3 - cfortran.h and the source cstring.c create the cstring.obj library 
+            which gives FORTRAN access to all the functions in C's system 
+            library described by the system's C header file string.h.
+
+C     EXAMPLE.FOR
+      PROGRAM EXAMPLE
+      DIMENSION I(20), J(30)
+        :
+      CALL MEMCPY(I,J,7)
+        :
+      END
+
+/* cstring.c */
+#include <string.h>             /* string.h prototypes memcpy() */
+#include "cfortran.h"
+
+        :
+FCALLSCSUB3(memcpy,MEMCPY,memcpy,PVOID,PVOID,INT)
+        :
+
+
+The simplicity exhibited in the above example exists for many but not all
+machines. Note 4. of Section II ii) details the limitations and describes tools
+which try to maintain the best possible interface when FORTRAN calls C
+routines.
+
+                                    -----
+
+
+II Using cfortran.h
+-------------------
+
+The user is asked to look at the source files cfortest.c and cfortex.f
+for clarification by example.
+
+o) Notes: 
+
+o Specifying the Fortran compiler
+  cfortran.h generates interfaces for the default Fortran compiler. The default
+can be overridden by defining, 
+     . in the code,              e.g.: #define    NAGf90Fortran
+  OR . in the compile directive, e.g.: unix> cc -DNAGf90Fortran
+one of the following before including cfortran.h:
+ NAGf90Fortran   f2cFortran  hpuxFortran  apolloFortran  sunFortran
+  IBMR2Fortran  CRAYFortran  mipsFortran     DECFortran  vmsFortran
+ CONVEXFortran       PowerStationFortran          AbsoftUNIXFortran
+     SXFortran   pgiFortran                        AbsoftProFortran
+This also allows crosscompilation.
+If wanted, NAGf90Fortran, f2cFortran, DECFortran, AbsoftUNIXFortran,
+AbsoftProFortran and pgiFortran must be requested by the user.
+
+o /**/
+  cfortran.h (ab)uses the comment kludge /**/ when the ANSI C preprocessor
+catenation operator ## doesn't exist. In at least MIPS C, this kludge is
+sensitive to  blanks surrounding arguments to macros.
+  Therefore, for applications using non-ANSI C compilers, the argtype_i,
+routine_name, routine_type and common_block_name arguments to the
+PROTOCCALLSFFUNn, CCALLSFSUB/FUNn, FCALLSCSUB/FUNn and COMMON_BLOCK macros 
+--- MUST NOT --- be followed by any white space characters such as
+blanks, tabs or newlines.
+
+o LOGICAL
+  FORTRAN LOGICAL values of .TRUE. and .FALSE. do not agree with the C
+representation of TRUE and FALSE on all machines. cfortran.h does the
+conversion for LOGICAL and PLOGICAL arguments and for functions returning
+LOGICAL. Users must convert arrays of LOGICALs from C to FORTRAN with the 
+C2FLOGICALV(array_name, elements_in_array); macro. Similarly, arrays of LOGICAL
+values may be converted from the FORTRAN into C representation by using
+F2CLOGICALV(array_name, elements_in_array);
+
+  When C passes or returns LOGICAL values to FORTRAN, by default cfortran.h 
+only makes the minimal changes required to the value. [e.g. Set/Unset the 
+single relevant bit or do nothing for FORTRAN compilers which use 0 as FALSE
+and treat all other values as TRUE.] Therefore cfortran.h will pass LOGICALs
+to FORTRAN which do not have an identical representation to .TRUE. or .FALSE.
+This is fine except for abuses of FORTRAN/77 in the style of:
+       logical l
+       if (l .eq. .TRUE.)     ! (1)
+instead of the correct:
+       if (l .eqv. .TRUE.)    ! (2)
+or:
+       if (l)                 ! (3)
+For FORTRAN code which treats LOGICALs from C in the method of (1),
+LOGICAL_STRICT must be defined before including cfortran.h, either in the
+code, "#define LOGICAL_STRICT", or compile with "cc -DLOGICAL_STRICT".
+There is no reason to use LOGICAL_STRICT for FORTRAN code which does not do (1).
+At least the IBM's xlf and the Apollo's f77 do not even allow code along the
+lines of (1).
+
+  DECstations' DECFortran and MIPS FORTRAN compilers use different internal
+representations for LOGICAL values. [Both compilers are usually called f77,
+although when both are installed on a single machine the MIPS' one is usually
+renamed. (e.g. f772.1 for version 2.10.)] cc doesn't know which FORTRAN
+compiler is present, so cfortran.h assumes MIPS f77. To use cc with DECFortran
+define the preprocessor constant 'DECFortran'.
+e.g.        i)  cc -DDECFortran -c the_code.c
+        or  ii) #define DECFortran  /* in the C code or add to cfortran.h. */
+
+  MIPS f77 [SGI and DECstations], f2c, and f77 on VAX Ultrix treat
+.eqv./.neqv. as .eq./.ne.. Therefore, for these compilers, LOGICAL_STRICT is
+defined by default in cfortran.h. [The Sun and HP compilers have not been
+tested, so they may also require LOGICAL_STRICT as the default.]
+
+o SHORT and BYTE 
+  They are irrelevant for the CRAY where FORTRAN has no equivalent to C's short.
+Similarly BYTE is irrelevant for f2c and for VAX Ultrix f77 and fort. The
+author has tested SHORT and BYTE with a modified cfortest.c/cfortex.f on all
+machines supported except for the HP9000 and the Sun.
+
+  BYTE is a signed 8-bit quantity, i.e. values are -128 to 127, on all machines
+except for the SGI [at least for MIPS Computer Systems 2.0.] On the SGI it is
+an unsigned 8-bit quantity, i.e. values are 0 to 255, although the SGI 'FORTRAN
+77 Programmers Guide' claims BYTE is signed. Perhaps MIPS 2.0 is dated, since
+the DECstations using MIPS 2.10 f77 have a signed BYTE.
+
+  To minimize the difficulties of signed and unsigned BYTE, cfortran.h creates
+the type 'INTEGER_BYTE' to agree with FORTRAN's BYTE. Users may define 
+SIGNED_BYTE or UNSIGNED_BYTE, before including cfortran.h, to specify FORTRAN's
+BYTE. If neither is defined, cfortran.h assumes SIGNED_BYTE.
+
+o CRAY
+  The type DOUBLE in cfortran.h corresponds to FORTRAN's DOUBLE PRECISION.
+  The type FLOAT  in cfortran.h corresponds to FORTRAN's REAL.
+
+On a classic CRAY [i.e. all models except for the t3e]:
+( 64 bit) C float       == C double == Fortran REAL
+(128 bit) C long double             == Fortran DOUBLE PRECISION
+Therefore when moving a mixed C and FORTRAN app. to/from a classic CRAY,
+either the C code will have to change,
+or the FORTRAN code and cfortran.h declarations will have to change.
+DOUBLE_PRECISION is a cfortran.h macro which provides the former option,
+i.e. the C code is automatically changed.
+DOUBLE_PRECISION is 'long double' on classic CRAY and 'double' elsewhere.
+DOUBLE_PRECISION thus corresponds to FORTRAN's DOUBLE PRECISION
+on all machines, including classic CRAY.
+
+On a classic CRAY with the fortran compiler flag '-dp':
+Fortran DOUBLE PRECISION thus is also the faster 64bit type.
+(This switch is often used since the application is usually satisfied by
+ 64 bit precision and the application needs the speed.)
+DOUBLE_PRECISION is thus not required in this case,
+since the classic CRAY behaves like all other machines.
+If DOUBLE_PRECISION is used nonetheless, then on the classic CRAY
+the default cfortran.h behavior must be overridden,
+for example by the C compiler option '-DDOUBLE_PRECISION=double'.
+
+On a CRAY t3e:
+(32 bit) C float                   == Fortran Unavailable
+(64 bit) C double == C long double == Fortran REAL == Fortran DOUBLE PRECISION
+Notes:
+- (32 bit) is available as Fortran REAL*4 and
+  (64 bit) is available as Fortran REAL*8.
+  Since cfortran.h is all about more portability, not about less portability,
+  the use of the nonstandard REAL*4 and REAL*8 is strongly discouraged.
+- Fortran DOUBLE PRECISION is folded to REAL with the following warning:
+    'DOUBLE PRECISION is not supported on this platform.  REAL will be used.'
+  Similarly, Fortran REAL*16 is mapped to REAL*8 with a warning.
+This behavior differs from that of other machines, including the classic CRAY.
+FORTRAN_REAL is thus introduced for the t3e,
+just as DOUBLE_PRECISION is introduced for the classic CRAY.
+FORTRAN_REAL is 'double' on t3e and 'float' elsewhere.
+FORTRAN_REAL thus corresponds to FORTRAN's REAL on all machines, including t3e.
+
+
+o f2c
+  f2c, by default promotes REAL functions to double. cfortran.h does not (yet)
+support this, so the f2c -R option must be used to turn this promotion off.
+
+o f2c
+[Thanks to Dario Autiero for pointing out the following.]
+f2c has a strange feature in that either one or two underscores are appended
+to a Fortran name of a routine or common block,
+depending on whether or not the original name contains an underscore.
+
+   S.I. Feldman et al., "A fortran to C converter",
+   Computing Science Technical Report No. 149.
+
+   page 2, chapter 2: INTERLANGUAGE conventions
+   ...........
+   To avoid conflict with the names of library routines and with names that
+   f2c generates,
+   Fortran names may have one or two underscores appended. Fortran names are
+   forced to lower case (unless the -U option described in Appendix B is in
+   effect); external names, i.e. the names of fortran procedures and common
+   blocks, have a single underscore appended if they do not contain any
+   underscore and have a pair of underscores appended if they do contain
+   underscores. Thus fortran subroutines names ABC, A_B_C and A_B_C_ result
+   in C functions named abc_, a_b_c__ and a_b_c___.
+   ...........
+
+cfortran.h is unable to change the naming convention on a name by name basis.
+Fortran routine and common block names which do not contain an underscore
+are unaffected by this feature.
+Names which do contain an underscore may use the following work-around:
+
+/* First 2 lines are a completely standard cfortran.h interface
+   to the Fortran routine E_ASY . */
+                  PROTOCCALLSFSUB2(E_ASY,e_asy, PINT, INT)
+#define E_ASY(A,B)     CCALLSFSUB2(E_ASY,e_asy, PINT, INT, A, B)
+#ifdef f2cFortran
+#define e_asy_ e_asy__
+#endif
+/* Last three lines are a work-around for the strange f2c naming feature. */
+
+o NAG f90
+  The Fortran 77 subset of Fortran 90 is supported. Extending cfortran.h to 
+interface C with all of Fortran 90 has not yet been examined.
+  The NAG f90 library hijacks the main() of any program and starts the user's 
+program with a call to: void f90_main(void);
+While this in itself is only a minor hassle, a major problem arises because
+NAG f90 provides no mechanism to access command line arguments.
+  At least version 'NAGWare f90 compiler Version 1.1(334)' appended _CB to
+common block names instead of the usual _. To fix, add this to cfortran.h:
+#ifdef old_NAG_f90_CB_COMMON
+#define COMMON_BLOCK                 CFC_  /* for all other Fortran compilers */
+#else
+#define COMMON_BLOCK(UN,LN)          _(LN,_CB)
+#endif
+
+o RS/6000
+  Using "xlf -qextname ...", which appends an underscore, '_', to all FORTRAN
+external references, requires "cc -Dextname ..." so that cfortran.h also
+generates these underscores.
+Use -Dextname=extname if extname is a symbol used in the C code.
+The use of "xlf -qextname" is STRONGLY ENCOURAGED, since it allows for
+transparent naming schemes when mixing C and Fortran.
+
+o HP9000
+  Using "f77 +ppu      ...", which appends an underscore, '_', to all FORTRAN
+external references, requires "cc -Dextname ..." so that cfortran.h also
+generates these underscores.
+Use -Dextname=extname if extname is a symbol used in the C code.
+The use of "f77 +ppu"      is STRONGLY ENCOURAGED, since it allows for
+transparent naming schemes when mixing C and Fortran.
+
+  At least one release of the HP /lib/cpp.ansi preprocessor is broken and will
+go into an infinite loop when trying to process cfortran.h with the
+## catenation operator. The K&R version of cfortran.h must then be used and the
+K&R preprocessor must be specified. e.g.
+                                         HP9000> cc -Aa -tp,/lib/cpp -c source.c
+The same problem with a similar solution exists on the Apollo.
+An irrelevant error message '0: extraneous name /usr/include' will appear for
+each source file due to another HP bug, and can be safely ignored.
+e.g. 'cc -v -c -Aa -tp,/lib/cpp cfortest.c' will show that the driver passes
+'-I /usr/include' instead of '-I/usr/include' to /lib/cpp
+
+On some machines the above error causes compilation to stop; one must then use
+K&R C, as with old HP compilers which don't support function prototyping.
+cfortran.h has to be informed that K&R C is to being used, e.g.
+HP9000> cc -D__CF__KnR -c source.c
+
+o AbsoftUNIXFortran
+By default, cfortran.h follows the default AbsoftUNIX/ProFortran and prepends _C
+to each COMMON BLOCK name. To override the cfortran.h behavior
+#define COMMON_BLOCK(UN,LN) before #including cfortran.h.
+[Search for COMMON_BLOCK in cfortran.h for examples.]
+
+o Apollo
+On at least one release, 'C compiler 68K Rev6.8(168)', the default C 
+preprocessor, from cc -A xansi or cc -A ansi, enters an infinite loop when 
+using cfortran.h. This Apollo bug can be circumvented by using:
+     . cc -DANSI_C_preprocessor=0 to force use of /**/, instead of '##'.
+ AND . The pre-ANSI preprocessor, i.e. use cc -Yp,/usr/lib
+The same problem with a similar solution exists on the HP.
+
+o Sun
+Old versions of cc(1), say <~1986, may require help for cfortran.h applications:
+ . #pragma may not be understood, hence cfortran.h and cfortest.c may require
+   sun> mv cfortran.h cftmp.h && grep -v "^#pragma" <cftmp.h >cfortran.h
+   sun> mv cfortest.c cftmp.c && grep -v "^#pragma" <cftmp.c >cfortest.c
+ . Old copies of math.h may not include the following from a newer math.h.
+   [For an ancient math.h on a 386 or sparc, get similar from a new math.h.]
+   #ifdef mc68000     /* 5 lines Copyright (c) 1988 by Sun Microsystems, Inc. */
+   #define FLOATFUNCTIONTYPE	int
+   #define RETURNFLOAT(x) 		return (*(int *)(&(x)))
+   #define ASSIGNFLOAT(x,y)	*(int *)(&x) = y
+   #endif
+
+o CRAY, Sun, Apollo [pre 6.8 cc], VAX Ultrix and HP9000
+  Only FORTRAN routines with less than 15 arguments can be prototyped for C,
+since these compilers don't allow more than 31 arguments to a C macro. This can
+be overcome, [see Section IV], with access to any C compiler without this
+limitation, e.g. gcc, on ANY machine.
+
+o VAX Ultrix
+  vcc (1) with f77 is not supported. Although: 
+VAXUltrix> f77 -c cfortex.f
+VAXUltrix> vcc -o cfortest cfortest.c cfortex.o -lI77 -lU77 -lF77  &&  cfortest
+will link and run. However, the FORTRAN standard I/O is NOT merged with the
+stdin and stdout of C, and instead uses the files fort.6 and fort.5. For vcc,
+f77 can't drive the linking, as for gcc and cc, since vcc objects must be
+linked using lk (1).  f77 -v doesn't tell much, and without VAX Ultrix manuals,
+the author can only wait for the info. required.
+
+  fort (1) is not supported. Without VAX Ultrix manuals the author cannot 
+convince vcc/gcc/cc and fort to generate names of routines and COMMON blocks
+that match at the linker, lk (1). i.e. vcc/gcc/cc prepend a single underscore
+to external references, e.g. NAME becomes _NAME, while fort does not modify the
+references. So ... either fort has prepend an underscore to external
+references, or vcc/gcc/cc have to generate unmodified names. man 1 fort
+mentions JBL, is JBL the only way?
+
+o VAX VMS C
+  The compiler 'easily' exhausts its table space and generates:
+%CC-F-BUGCHECK, Compiler bug check during parser phase    .
+                Submit an SPR with a problem description.
+                At line number 777 in DISK:[DIR]FILE.C;1.
+where the line given, '777', includes a call across C and FORTRAN via
+cfortran.h, usually with >7 arguments and/or very long argument expressions.
+This SPR can be staved off, with the simple modification to cfortran.h, such
+that the relevant CCALLSFSUBn (or CCALLSFFUNn or FCALLSCFUNn) is not
+cascaded up to CCALLSFSUB14, and instead has its own copy of the contents of 
+CCALLSFSUB14. [If these instructions are not obvious after examining cfortran.h
+please contact the author.]
+[Thanks go to Mark Kyprianou (kyp at stsci.edu) for this solution.]
+
+o Mips compilers
+  e.g. DECstations and SGI, require applications with a C main() and calls to
+GETARG(3F), i.e. FORTRAN routines returning the command line arguments, to use
+two macros as shown:
+        :
+CF_DECLARE_GETARG;              /* This must be external to all routines.     */
+        :
+main(int argc, char *argv[])
+{
+        :
+CF_SET_GETARG(argc,argv);       /* This must precede any calls to GETARG(3F). */
+        :
+}
+The macros are null and benign on all other systems. Sun's GETARG(3F) also
+doesn't work with a generic C main() and perhaps a workaround similar to the
+Mips' one exists.
+
+o Alpha/OSF
+Using the DEC Fortran and the DEC C compilers of DEC OSF/1 [RT] V1.2 (Rev. 10),
+Fortran, when called from C, has occasional trouble using a routine received as
+a dummy argument.
+
+e.g. In the following the Fortran routine 'e' will crash when it tries to use
+     the C routine 'c' or the Fortran routine 'f'.
+     The example works on other systems.
+
+C FORTRAN                           /* C */
+      integer function f()          #include <stdio.h>
+      f = 2                         int f_();
+      return                        int e_(int (*u)());
+      end
+                                    int c(){ return 1;}
+      integer function e(u)         int d (int (*u)()) { return u();}
+      integer u
+      external u                    main()
+      e=u()                         {         /* Calls to d  work.  */
+      return                        printf("d (c ) returns %d.\n",d (c ));
+      end                           printf("d (f_) returns %d.\n",d (f_));
+                                              /* Calls to e_ crash. */
+                                    printf("e_(c ) returns %d.\n",e_(c ));
+                                    printf("e_(f_) returns %d.\n",e_(f_));
+                                    }
+
+Solutions to the problem are welcomed!
+A kludge which allows the above example to work correctly, requires an extra
+argument to be given when calling the dummy argument function.
+i.e. Replacing 'e=u()' by 'e=u(1)' allows the above example to work.
+
+
+o The FORTRAN routines are called using macro expansions, therefore the usual
+caveats for expressions in arguments apply. The expressions to the routines may
+be evaluated more than once, leading to lower performance and in the worst case
+bizarre bugs.
+
+o For those who wish to use cfortran.h in large applications. [See Section IV.]
+This release is intended to make it easy to get applications up and running. 
+This implies that applications are not as efficient as they could be:
+- The current mechanism is inefficient if a single header file is used to
+  describe a large library of FORTRAN functions. Code for a static wrapper fn.
+  is generated in each piece of C source code for each FORTRAN function 
+  specified with the CCALLSFFUNn statement, irrespective of whether or not the
+  function is ever called. 
+- Code for several static utility routines internal to cfortran.h is placed 
+  into any source code which #includes cfortran.h. These routines should
+  probably be in a library.
+
+
+i) Calling FORTRAN routines from C:
+   --------------------------------
+
+The FORTRAN routines are defined by one of the following two instructions:
+
+for a SUBROUTINE:
+/* PROTOCCALLSFSUBn is optional for C, but mandatory for C++. */
+PROTOCCALLSFSUBn(ROUTINE_NAME,routine_name,argtype_1,...,argtype_n)
+#define     Routine_name(argname_1,..,argname_n)               \
+CCALLSFSUBn(ROUTINE_NAME,routine_name,argtype_1,...,argtype_n, \
+                         argname_1,..,argname_n) 
+
+for a FUNCTION:
+PROTOCCALLSFFUNn(routine_type,ROUTINE_NAME,routine_name,argtype_1,...,argtype_n)
+#define     Routine_name(argname_1,..,argname_n)               \
+CCALLSFFUNn(ROUTINE_NAME,routine_name,argtype_1,...,argtype_n, \
+                         argname_1,..,argname_n) 
+
+Where:
+'n' = 0->14 [SUBROUTINE's ->27] (easily expanded in cfortran.h to > 14 [27]) is 
+    the number of arguments to the routine.
+Routine_name = C       name of the routine (IN UPPER CASE LETTERS).[see 2.below]
+ROUTINE_NAME = FORTRAN name of the routine (IN UPPER CASE LETTERS).
+routine_name = FORTRAN name of the routine (IN lower case LETTERS).
+routine_type = the type of argument returned by FORTRAN functions.
+             = BYTE, DOUBLE, FLOAT, INT, LOGICAL, LONG, SHORT, STRING, VOID.
+               [Instead of VOID one would usually use CCALLSFSUBn.
+                VOID forces a wrapper function to be used.]
+argtype_i    = the type of argument passed to the FORTRAN routine and must be
+               consistent in the definition and prototyping of the routine s.a.
+             = BYTE, DOUBLE, FLOAT, INT, LOGICAL, LONG, SHORT, STRING.
+             For vectors, i.e. 1 dim. arrays use 
+             = BYTEV, DOUBLEV, FLOATV, INTV, LOGICALV, LONGV, SHORTV, 
+               STRINGV, ZTRINGV.
+             For vectors of vectors, i.e. 2 dim. arrays use
+             = BYTEVV, DOUBLEVV, FLOATVV, INTVV, LOGICALVV, LONGVV, SHORTVV.
+             For n-dim. arrays, 1<=n<=7 [7 is the maximum in Fortran 77],
+             = BYTEV..nV's..V, DOUBLEV..V, FLOATV..V, INTV..V, LOGICALV..V, 
+               LONGV..V, SHORTV..V.
+                N.B. Array dimensions and types are checked by the C compiler.
+             For routines changing the values of an argument, the keyword is 
+                  prepended by a 'P'.
+             = PBYTE, PDOUBLE, PFLOAT, PINT, PLOGICAL, PLONG, PSHORT,
+               PSTRING, PSTRINGV, PZTRINGV.
+             For EXTERNAL procedures passed as arguments use
+             = ROUTINE.
+             For exceptional arguments which require no massaging to fit the
+                  argument passing mechanisms use
+             = PVOID.
+                The argument is cast and passed as (void *).
+                Although PVOID could be used to describe all array arguments on
+                most (all?) machines , it shouldn't be because the C compiler
+                can no longer check the type and dimension of the array.
+argname_i    = any valid unique C tag, but must be consistent in the definition 
+               as shown.
+
+Notes:
+
+1. cfortran.h may be expanded to handle a more argument type. To suppport new
+arguments requiring complicated massaging when passed  between Fortran and C,
+the user will have to understand cfortran.h and follow its code and mechanisms.
+
+To define types requiring little or no massaging when passed between Fortran 
+and C, the pseudo argument type SIMPLE may be used.
+For a user defined type called 'newtype', the definitions required are:
+
+/* The following 7 lines are required verbatim.
+   'newtype' is the name of the new user defined argument type.
+*/
+#define newtype_cfV(  T,A,B,F)       SIMPLE_cfV(T,A,B,F)
+#define newtype_cfSEP(T,  B)         SIMPLE_cfSEP(T,B)
+#define newtype_cfINT(N,A,B,X,Y,Z)   SIMPLE_cfINT(N,A,B,X,Y,Z)
+#define newtype_cfSTR(N,T,A,B,C,D,E) SIMPLE_cfSTR(N,T,A,B,C,D,E)
+#define newtype_cfCC( T,A,B)         SIMPLE_cfCC(T,A,B)
+#define newtype_cfAA( T,A,B)         newtype_cfB(T,A) /* Argument B not used. */
+#define newtype_cfU(  T,A)           newtype_cfN(T,A)
+
+/* 'parameter_type(A)' is a declaration for 'A' and describes the type of the 
+parameter expected by the Fortran function.  This type will be used in the
+prototype for the function, if  using ANSI C, and to declare the argument used
+by the intermediate function if calling a Fortran FUNCTION.
+Valid 'parameter_type(A)' include: int A
+                                   void (*A)()
+                                   double A[17]
+*/
+#define newtype_cfN(  T,A)     parameter_type(A)      /* Argument T not used. */
+
+/* Before any argument of the new type is passed to the Fortran routine, it may
+be massaged as given by 'massage(A)'.
+*/
+#define newtype_cfB(  T,A)     massage(A)             /* Argument T not used. */
+
+An example of a simple user defined type is given cfortex.f and cfortest.c.
+Two uses of SIMPLE user defined types are [don't show the 7 verbatim #defines]:
+
+/* Pass the address of a structure, using a type called PSTRUCT */
+#define PSTRUCT_cfN(  T,A)        void *A
+#define PSTRUCT_cfB(  T,A)       (void *) &(A)
+
+/* Pass an integer by value, (not standard F77 ), using a type called INTVAL */
+#define INTVAL_cfN(   T,A)      int A
+#define INTVAL_cfB(   T,A)         (A)
+
+[If using VAX VMS, surrounding the #defines with "#pragma (no)standard" allows
+ the %CC-I-PARAMNOTUSED messages to be avoided.]
+
+Upgrades to cfortran.h try to be, and have been, backwards compatible. This
+compatibility cannot be offered to user defined types. SIMPLE user defined 
+types are less of a risk since they require so little effort in their creation.
+If a user defined type is required in more than one C header file of interfaces
+to libraries of Fortran routines, good programming practice, and ease of code
+maintenance, suggests keeping any user defined type within a single file which
+is #included as required. To date, changes to the SIMPLE macros were introduced
+in versions 2.6, 3.0 and 3.2 of cfortran.h.
+
+
+2. Routine_name is the name of the macro which the C programmer will use in
+order to call a FORTRAN routine. In theory Routine_name could be any valid and
+unique name, but in practice, the name of the FORTRAN routine in UPPER CASE
+works everywhere and would seem to be an obvious choice.
+
+
+3. <BYTE|DOUBLE|BYTE|DOUBLE|FLOAT|INT|LOGICAL|LONG|SHORT><V|VV|VVV|...>
+
+cfortran.h encourages the exact specification of the type and dimension of
+array parameters because it allows the C compiler to detect errors in the
+arguments when calling the routine.
+
+cfortran.h does not strictly require the exact specification since the argument 
+is merely the address of the array and is passed on to the calling routine.
+Any array parameter could be declared as PVOID, but this circumvents
+C's compiletime ability to check the correctness of arguments and is therefore
+discouraged.
+
+Passing the address of these arguments implies that PBYTEV, PFLOATV, ... ,
+PDOUBLEVV, ... don't exist in cfortran.h, since by default the routine and the
+calling code share the same array, i.e. the same values at the same memory
+location.
+
+These comments do NOT apply to arrays of (P)S/ZTRINGV. For these parameters,
+cfortran.h passes a massaged copy of the array to the routine. When the routine
+returns, S/ZTRINGV ignores the copy, while PS/ZTRINGV replaces the calling
+code's original array with copy, which may have been modified by the called
+routine.
+
+
+4. (P)STRING(V):
+- STRING - If the argument is a fixed length character array, e.g. char ar[8];,
+the string is blank, ' ', padded on the right to fill out the array before
+being passed to the FORTRAN routine. The useful size of the string is the same
+in both languages, e.g. ar[8] is passed as character*7. If the argument is a
+pointer, the string cannot be blank padded, so the length is passed as
+strlen(argument). On return from the FORTRAN routine, pointer arguments are not
+disturbed, but arrays have the terminating '\0' replaced to its original
+position. i.e. The padding blanks are never visible to the C code.
+
+- PSTRING - The argument is massaged as with STRING before being passed to the
+FORTRAN routine. On return, the argument has all trailing blanks removed,
+regardless of whether the argument was a pointer or an array.
+
+- (P)STRINGV - Passes a 1- or 2-dimensional char array. e.g. char a[7],b[6][8];
+STRINGV may thus also pass a string constant, e.g. "hiho".
+(P)STRINGV does NOT pass a pointer, e.g. char *, to either a 1- or a
+2-dimensional array, since it cannot determine the array dimensions.
+A pointer can only be passed using (P)ZTRINGV.
+N.B. If a C routine receives a character array argument, e.g. char a[2][3],
+     such an argument is actually a pointer and my thus not be passed by
+     (P)STRINGV. Instead (P)ZTRINGV must be used.
+
+- STRINGV - The elements of the argument are copied into space malloc'd, and
+each element is padded with blanks. The useful size of each element is the same
+in both languages. Therefore char bb[6][8]; is equivalent to character*7 bb(6).
+On return from the routine the malloc'd space is simply released.
+
+- PSTRINGV - Since FORTRAN has no trailing '\0', elements in an array of
+strings are contiguous. Therefore each element of the C array is padded with
+blanks and strip out C's trailing '\0'. After returning from the routine, the
+trailing '\0' is reinserted and kill the trailing blanks in each element.
+
+- SUMMARY: STRING(V) arguments are blank padded during the call to the FORTRAN
+routine, but remain original in the C code. (P)STRINGV arguments are blank
+padded for the FORTRAN call, and after returning from FORTRAN trailing blanks
+are stripped off.
+
+
+5. (P)ZTRINGV:
+- (P)ZTRINGV - is identical to (P)STRINGV,
+except that the dimensions of the array of strings is explicitly specified,
+which thus also allows a pointer to be passed.
+(P)ZTRINGV can thus pass a 1- or 2-dimensional char array, e.g. char b[6][8],
+or it can pass a pointer to such an array, e.g. char *p;.
+ZTRINGV may thus also pass a string constant, e.g. "hiho".
+If passing a 1-dimensional array, routine_name_ELEMS_j (see below) must be 1.
+[Users of (P)ZTRINGV should examine cfortest.c for examples.]:
+
+- (P)ZTRINGV must thus be used instead of (P)STRINGV whenever sizeof()
+can't be used to determine the dimensions of the array of string or strings.
+e.g. when calling FORTRAN from C with a char * received by C as an argument.
+
+- There is no (P)ZTRING type, since (P)ZTRINGV can pass a 1-dimensional
+array or a pointer to such an array, e.g. char a[7], *b;
+If passing a 1-dimensional array, routine_name_ELEMS_j (see below) must be 1.
+
+- To specify the numbers of elements,
+routine_name_ELEMS_j and routine_name_ELEMLEN_j must be defined as shown below
+before interfacing the routine with CCALLSFSUBn, PROTOCCALLSFFUNn, etc.
+
+#define routine_name_ELEMS_j   ZTRINGV_ARGS(k)       
+                                 [..ARGS for subroutines, ..ARGF for functions.]
+or
+#define routine_name_ELEMS_j   ZTRINGV_NUM(l)
+Where: routine_name is as above.
+       j            [1-n], is the argument being specifying.
+       k            [1-n], the value of the k'th argument is the dynamic number
+                    of elements for argument j. The k'th argument must be
+                    of type BYTE, DOUBLE, FLOAT, INT, LONG or SHORT.
+       l            the number of elements for argument j. This must be an
+                    integer constant available at compile time.
+                    i.e. it is static.
+
+- Similarly to specify the useful length, [i.e. don't count C's trailing '\0',]
+of each element:
+#define routine_name_ELEMLEN_j ZTRINGV_ARGS(m)
+                                 [..ARGS for subroutines, ..ARGF for functions.]
+or
+#define routine_name_ELEMLEN_j ZTRINGV_NUM(q)
+Where: m            [1-n], as for k but this is the length of each element. 
+       q            as for l but this is the length of each element. 
+
+
+6. ROUTINE
+The argument is an EXTERNAL procedure.
+
+When C passes a routine to Fortran, the language of the function must be
+specified as follows:  [The case of some_*_function must be given as shown.]
+
+When C passes a C routine to a Fortran: 
+    FORTRAN_ROUTINE(arg1, .... ,       
+                    C_FUNCTION(SOME_C_FUNCTION,some_c_function),
+                    ...., argn);
+
+and similarly when C passes a Fortran routine to Fortran:
+    FORTRAN_ROUTINE(arg1, .... ,
+                    FORTRAN_FUNCTION(SOME_FORT_FUNCTION,some_fort_function),
+                    ...., argn);
+
+If fcallsc has been redefined; the same definition of fcallsc used when creating
+the wrapper for 'some_c_function' must also be defined when C_FUNCTION is used.
+See ii) 4. of this section for when and how to redefine fcallsc.
+
+ROUTINE was introduced with cfortran.h version 2.6. Earlier versions of
+cfortran.h used PVOID to pass external procedures as arguments. Using PVOID for
+this purpose is no longer recommended since it won't work 'as is' for
+apolloFortran, hpuxFortran800, AbsoftUNIXFortran, AbsoftProFortran.
+
+7. CRAY only: 
+In a given piece of source code, where FFUNC is any FORTRAN routine,
+FORTRAN_FUNCTION(FFUNC,ffunc)
+disallows a previous 
+#define FFUNC(..) CCALLSFSUBn(FFUNC,ffunc,...) [ or CCALLSFFUNn]
+in order to make the UPPER CASE FFUNC callable from C.
+#define Ffunc(..) ... is OK though, as are obviously any other names.
+
+
+ii) Calling C routines from FORTRAN:
+    --------------------------------
+
+Each of the following two statements to export a C routine to FORTRAN create
+FORTRAN 'wrappers', written in C, which must be compiled and linked along with
+the original C routines and with the FORTRAN calling code.
+
+FORTRAN callable 'wrappers' may also be created for C macros. i.e. in this
+section, the term 'C function' may be replaced by 'C macro'.
+
+for C functions returning void:
+FCALLSCSUBn(             Routine_name,ROUTINE_NAME,routine_name,argtype_1,...,argtype_n)
+
+for all other C functions:
+FCALLSCFUNn(routine_type,Routine_name,ROUTINE_NAME,routine_name,argtype_1,...,argtype_n)
+
+Where:
+'n' = 0->27 (easily expanded to > 27) stands for the number of arguments to the 
+    routine.
+Routine_name = the C       name of the routine. [see 9. below]
+ROUTINE_NAME = the FORTRAN name of the routine (IN UPPER CASE LETTERS).
+routine_name = the FORTRAN name of the routine (IN lower case LETTERS).
+routine_type = the type of argument returned by C functions.
+             = BYTE, DOUBLE, FLOAT, INT, LOGICAL, LONG, SHORT, STRING, VOID.
+               [Instead of VOID, FCALLSCSUBn is recommended.]
+argtype_i    = the type of argument passed to the FORTRAN routine and must be
+               consistent in the definition and prototyping of the routine
+             = BYTE, DOUBLE, FLOAT, INT, LOGICAL, LONG, SHORT, STRING.
+             For vectors, i.e. 1 dim. arrays use 
+             = BYTEV, DOUBLEV, FLOATV, INTV, LOGICALV, LONGV, SHORTV, STRINGV.
+             For vectors of vectors, 2 dim. arrays use
+             = BYTEVV, DOUBLEVV, FLOATVV, INTVV, LOGICALVV, LONGVV, SHORTVV.
+             For n-dim. arrays use
+             = BYTEV..nV's..V, DOUBLEV..V, FLOATV..V, INTV..V, LOGICALV..V, 
+               LONGV..V, SHORTV..V.
+             For routines changing the values of an argument, the keyword is 
+                  prepended by a 'P'.
+             = PBYTE, PDOUBLE, PFLOAT, PINT, PLOGICAL, PLONG, PSHORT, 
+               PSTRING, PNSTRING, PPSTRING, PSTRINGV.
+             For EXTERNAL procedures passed as arguments use
+             = ROUTINE.
+             For exceptional arguments which require no massaging to fit the
+                  argument passing mechanisms use
+             = PVOID.
+                The argument is cast and passed as (void *).
+
+
+Notes:
+
+0. For Fortran calling C++ routines, C++ does NOT easily allow support for: 
+   STRINGV.
+   BYTEVV, DOUBLEVV, FLOATVV, INTVV, LOGICALVV, LONGVV, SHORTVV.
+   BYTEV..V, DOUBLEV..V, FLOATV..V, INTV..V, LOGICALV..V, LONGV..V, SHORTV..V.
+Though there are ways to get around this restriction,
+the restriction is not serious since these types are unlikely to be used as
+arguments for a C++ routine.
+
+1. FCALLSCSUB/FUNn expect that the routine to be 'wrapped' has been properly
+prototyped, or at least declared.
+
+
+2. cfortran.h may be expanded to handle a new argument type not already among
+the above. 
+
+
+3. <BYTE|DOUBLE|BYTE|DOUBLE|FLOAT|INT|LOGICAL|LONG|SHORT><V|VV|VVV|...>
+
+cfortran.h encourages the exact specification of the type and dimension of
+array parameters because it allows the C compiler to detect errors in the
+arguments when declaring the routine using FCALLSCSUB/FUNn, assuming the
+routine to be 'wrapped' has been properly prototyped.
+
+cfortran.h does not strictly require the exact specification since the argument 
+is merely the address of the array and is passed on to the calling routine.
+Any array parameter could be declared as PVOID, but this circumvents
+C's compiletime ability to check the correctness of arguments and is therefore
+discouraged.
+
+Passing the address of these arguments implies that PBYTEV, PFLOATV, ... ,
+PDOUBLEVV, ... don't exist in cfortran.h, since by default the routine and the
+calling code share the same array, i.e. the same values at the same memory
+location.
+
+These comments do NOT apply to arrays of (P)STRINGV. For these parameters,
+cfortran.h passes a massaged copy of the array to the routine. When the routine
+returns, STRINGV ignores the copy, while PSTRINGV replaces the calling
+code's original array with copy, which may have been modified by the called
+routine.
+
+
+4. (P(N))STRING arguments have any trailing blanks removed before being passed
+to C, the same holds true for each element in (P)STRINGV. Space is malloc'd in
+all cases big enough to hold the original string (elements) as well as C's
+terminating '\0'. i.e. The useful size of the string (elements) is the same in
+both languages. P(N)STRING(V) => the string (elements) will be copied from the
+malloc'd space back into the FORTRAN bytes. If one of the two escape mechanisms
+mentioned below for PNSTRING has been used, the copying back to FORTRAN is
+obviously not relevant.
+
+
+5. (PN)STRING's, [NOT PSTRING's nor (P)STRINGV's,] behavior may be overridden
+in two cases.  In both cases PNSTRING and STRING behave identically.
+
+a) If a (PN)STRING argument's first 4 bytes are all the NUL character,
+i.e. '\0\0\0\0' the NULL pointer is passed to the C routine.
+
+b) If the characters of a (PN)STRING argument contain at least one HEX-00, i.e.
+the NUL character, i.e. C strings' terminating '\0', the address of the string
+is simply passed to the C routine. i.e. The argument is treated in this case as
+it would be with PPSTRING, to which we refer the reader for more detail.
+
+Mechanism a) overrides b). Therefore, to use this mechanism to pass the NULL
+string, "", to C, the first character of the string must obviously be the NUL
+character, but of the first 4 characters in the string, at least one must not
+be HEX-00.
+
+Example:
+C FORTRAN                         /* C */
+      character*40 str            #include "cfortran.h"
+C Set up a NULL as :              void cs(char *s) {if (s) printf("%s.\n",s);}
+C    i)  4 NUL characters.        FCALLSCSUB1(cs,CS,cs,STRING)
+C    ii) NULL pointer.
+      character*4 NULL        
+      NULL = CHAR(0)//CHAR(0)//CHAR(0)//CHAR(0)
+
+      data str/'just some string'/
+
+C Passing the NULL pointer to cs.
+      call cs(NULL)
+C Passing a copy of 'str' to cs.
+      call cs(str)
+C Passing address of 'str' to cs. Trailing blanks NOT killed.
+      str(40:) = NULL
+      call cs(str)
+      end
+
+Strings passed from Fortran to C via (PN)STRING must not have undefined
+contents, otherwise undefined behavior will result, since one of the above two
+escape mechanisms may occur depending on the contents of the string.
+
+This is not be a problem for STRING arguments, which are read-only in the C
+routine and hence must have a well defined value when being passed in.
+
+PNSTRING arguments require special care. Even if they are write-only in the C
+routine, PNSTRING's above two escape mechanisms require that the value of the
+argument be well defined when being passed in from Fortran to C. Therefore,
+unless one or both of PNSTRING's escape mechanisms are required, PSTRING should
+be used instead of PNSTRING.
+Prior to version 2.8, PSTRING did have the above two escape mechanisms,
+but they were removed from PSTRING to allow strings with undefined contents to
+be passed in. PNSTRING behaves like the old PSTRING.
+[Thanks go to Paul Dubois (dubios at icf.llnl.gov) for pointing out that PSTRING
+ must allow for strings with undefined contents to be passed in.]
+
+Example:
+C FORTRAN                         /* C */
+      character*10 s,sn           #include "cfortran.h"
+                                  void ps(char *s) {strcpy(s,"hello");}
+C Can   call ps  with undef. s.   FCALLSCSUB1(ps,PS,ps,PSTRING)
+      call ps(s)                  FCALLSCSUB1(ps,PNS,pns,PNSTRING)
+      print *,s,'=s'
+                              
+C Can't call pns with undef. s.
+C e.g. If first 4 bytes of s were
+C      "\0\0\0\0", ps would try
+C      to copy to NULL because
+C      of PNSTRING mechanism.
+      sn = ""
+      call pns(sn)
+      print *,sn,'=sn'
+                                               
+      end
+
+
+6. PPSTRING
+The address of the string argument is simply passed to the C routine. Therefore
+the C routine and the FORTRAN calling code share the same string at the same
+memory location. If the C routine modifies the string, the string will also be
+modified for the FORTRAN calling code.
+The user is responsible for negociating the differences in representation of a
+string in Fortran and in C, i.e. the differences are not automatically resolved
+as they are for (P(N)STRING(V).
+This mechanism is provided for two reasons:
+   - Some C routines require the string to exist at the given memory location, 
+     after the C routine has exited. Recall that for the usual (P(N)STRING(V)
+     mechanism, a copy of the FORTRAN string is given to the C routine, and this
+     copy ceases to exist after returning to the FORTRAN calling code.
+   - This mechanism can save runtime CPU cycles over (P(N)STRING(V), since it
+     does not perform their malloc, copy and kill trailing blanks of the string
+     to be passed.
+     Only in a small minority of cases does the potential benefit of the saved
+     CPU cycles outweigh the programming effort required to manually resolve
+     the differences in representation of a string in Fortran and in C.
+
+For arguments passed via PPSTRING, the argument passed may also be an array of
+strings.
+
+
+7. ROUTINE
+ANSI C requires that the type of the value returned by the routine be known,
+For all ROUTINE arguments passed from Fortran to C, the type of ROUTINE is
+specified by defining a cast as follows:
+
+#undef  ROUTINE_j
+#define ROUTINE_j   (cast)
+where:
+       j            [1-n], is the argument being specifying.
+       (cast)       is a cast matching that of the argument expected by the C
+                    function protoytpe for which a wrapper is being defined.
+
+e.g. To create a Fortran wrapper for qsort(3C):
+#undef  ROUTINE_4
+#define ROUTINE_4 (int (*)(void *,void *))
+FCALLSCSUB4(qsort,FQSORT,fqsort,PVOID,INT,INT,ROUTINE)
+
+In order to maintain backward compatibility, cfortran.h defines a generic cast
+for ROUTINE_1, ROUTINE_2, ..., ROUTINE_27. The user's definition is therefore
+strictly required only for DEC C, which at the moment is the only compiler
+which insists on the correct cast for pointers to functions.
+
+When using the ROUTINE argument inside some Fortran code:
+- it is difficult to pass a C routine as the parameter,
+  since in many Fortran implementations,
+  Fortran has no access to the normal C namespace.
+  e.g. For most UNIX,
+       Fortran implicitly only has access to C routines ending in _.
+  If the calling Fortran code receives the routine as a parameter
+  it can of course easily pass it along.
+- if a Fortran routine is passed directly as the parameter,
+  the called C routine must call the parameter routine
+  using the Fortran argument passing conventions.
+- if a Fortran routine is to be passed as the parameter,
+  but if Fortran can be made to pass a C routine as the parameter,
+  then it may be best to pass a C-callable wrapper for the Fortran routine.
+  The called C routine is thus spared all Fortran argument passing conventions.
+  cfortran.h can be used to create such a C-callable wrapper
+  to the parameter Fortran routine.
+
+ONLY PowerStationFortran:
+This Fortran provides no easy way to pass a Fortran routine as an argument to a
+C routine. The problem arises because in Fortran the stack is cleared by the
+called routine, while in C/C++ it is cleared by the caller.
+The C/C++ stack clearing behavior can be changed to that of Fortran by using
+stdcall__ in the function prototype. The stdcall__ cannot be applied in this
+case since the called C routine expects the ROUTINE parameter to be a C routine
+and does not know that it should apply stdcall__.
+In principle the cfortran.h generated Fortran callable wrapper for the called C
+routine should be able to massage the ROUTINE argument such that stdcall__ is
+performed, but it is not yet known how this could be easily done.
+
+
+8. THE FOLLOWING INSTRUCTIONS ARE NOT REQUIRED FOR VAX VMS
+                                  ------------
+(P)STRINGV information [NOT required for VAX VMS]: cfortran.h cannot convert
+the FORTRAN vector of STRINGS to the required C vector of STRINGS without
+explicitly knowing the number of elements in the vector. The application must
+do one of the following for each (P)STRINGV argument in a routine before that
+routine's FCALLSCFUNn/SUBn is called:
+
+#define routine_name_STRV_Ai NUM_ELEMS(j)
+ or
+#define routine_name_STRV_Ai NUM_ELEM_ARG(k)
+ or
+#define routine_name_STRV_Ai TERM_CHARS(l,m)
+
+where: routine_name     is as above.
+       i [i=1->n.]      specifies the argument number of a STRING VECTOR.
+       j                would specify a fixed number of elements. 
+       k [k=1->n. k!=i] would specify an integer argument which specifies the
+                        number of elements.
+       l [char]         the terminating character at the beginning of an
+                        element, indicating to cfortran.h that the preceding
+                        elements in the vector are the valid ones.
+       m [m=1-...]      the number of terminating characters required to appear
+                        at the beginning of the terminating string element.
+                        The terminating element is NOT passed on to 
+                        the C routine.
+
+e.g.      #define ce_STRV_A1 TERM_CHARS(' ',2)
+          FCALLSCSUB1(ce,CE,ce,STRINGV)
+
+cfortran.h will pass on all elements, in the 1st and only argument to the C
+routine ce, of the STRING VECTOR until, but not including, the first string
+element beginning with 2 blank, ' ', characters.
+
+
+9. INSTRUCTIONS REQUIRED ONLY FOR FORTRAN COMPILERS WHICH GENERATE
+                -------------     
+   ROUTINE NAMES WHICH ARE UNDISTINGUISHABLE FROM C ROUTINE NAMES
+   i.e. VAX VMS
+        AbsoftUNIXFortran (AbsoftProFortran ok, since it uses Uppercase names.)
+        HP9000      if not using the +ppu      option of f77
+        IBM RS/6000 if not using the -qextname option of xlf
+   Call them the same_namespace compilers.
+
+FCALLSCSUBn(...) and FCALLSCFUNn(...), when compiled, are expanded into
+'wrapper' functions, so called because they wrap around the original C 
+functions and interface the format of the original C functions' arguments and
+return values with the format of the FORTRAN call.
+
+Ideally one wants to be able to call the C routine from FORTRAN using the same
+name as the original C name. This is not a problem for FORTRAN compilers which
+append an underscore, '_', to the names of routines, since the original C
+routine has the name 'name', and the FORTRAN wrapper is called 'name_'.
+Similarly, if the FORTRAN compiler generates upper case names for routines, the
+original C routine 'name' can have a wrapper called 'NAME', [Assuming the C
+routine name is not in upper case.] For these compilers, e.g. Mips, CRAY, IBM
+RS/6000 'xlf -qextname', HP-UX 'f77 +ppu', the naming of the wrappers is done
+automatically.
+
+For same_namespace compilers things are not as simple, but cfortran.h tries to
+provide tools and guidelines to minimize the costs involved in meeting their
+constraints. The following two options can provide same_namespace compilers
+with distinct names for the wrapper and the original C function.
+
+These compilers are flagged by cfortran.h with the CF_SAME_NAMESPACE  constant,
+so that the change in the C name occurs only when required.
+
+For the remainder of the discussion, routine names generated by FORTRAN
+compilers are referred to in lower case, these names should be read as upper
+case for the appropriate compilers.
+
+
+HP9000: (When f77 +ppu is not used.)
+f77 has a -U option which forces uppercase external names to be generated.
+Unfortunately, cc does not handle recursive macros. Hence, if one wished to use
+-U for separate C and FORTRAN namespaces, one would have to adopt a different
+convention of naming the macros which allow C to call FORTRAN subroutines.
+(Functions are not a problem.) The macros are currently the uppercase of the
+original FORTRAN name, and would have to be changed to lower case or mixed
+case, or to a different name. (Lower case would of course cause conflicts on
+many other machines.) Therefore, it is suggested that f77 -U  not be used, and
+instead that Option a) or Option b) outlined below be used.
+
+
+VAX/VMS:
+For the name used by FORTRAN in calling a C routine to be the same as that of
+the C routine, the source code of the C routine is required. A preprocessor
+directive can then force the C compiler to generate a different name for the C
+routine. 
+e.g.                #if defined(vms)
+                    #define name name_
+                    #endif
+                    void name() {printf("name: was called.\n");}
+                    FCALLSCSUB0(name,NAME,name)
+
+In the above, the C compiler generates the original routine with the name
+'name_' and a wrapper called 'NAME'. This assumes that the name of the routine,
+as seen by the C programmer, is not in upper case. The VAX VMS linker is not
+case sensitive, allowing cfortran.h to export the upper case name as the
+wrapper, which then doesn't conflict with the routine name in C. Since the IBM,
+HP and AbsoftUNIXFortran platforms have case sensitive linkers
+this technique is not available to them.
+
+The above technique is required even if the C name is in mixed case, see 
+Option a) for the other compilers, but is obviously not required when 
+Option b) is used.
+
+
+Option a) Mixed Case names for the C routines to be called by FORTRAN.
+
+If the original C routines have mixed case names, there are no name space
+conflicts.
+
+Nevertheless for VAX/VMS, the technique outlined above must also used.
+
+
+Option b) Modifying the names of C routines when used by FORTRAN:
+
+The more robust naming mechanism, which guarantees portability to all machines, 
+'renames' C routines when called by FORTRAN. Indeed, one must change the names
+on same_namespace compilers when FORTRAN calls C routines for which the source
+is unavailable. [Even when the source is available, renaming may be preferable
+to Option a) for large libraries of C routines.]
+
+Obviously, if done for a single type of machine, it must be done for all
+machines since the names of routines used in FORTRAN code cannot be easily
+redefined for different machines.
+
+The simplest way to achieve this end is to do explicitly give the modified
+FORTRAN name in the FCALLSCSUBn(...) and FCALLSCFUNn(...) declarations. e.g.
+
+FCALLSCSUB0(name,CFNAME,cfname)
+
+This allows FORTRAN to call the C routine 'name' as 'cfname'. Any name can of
+course be used for a given routine when it is called from FORTRAN, although
+this is discouraged due to the confusion it is sure to cause.  e.g. Bizarre,
+but valid and allowing C's 'call_back' routine to be called from FORTRAN as
+'abcd':
+
+FCALLSCSUB0(call_back,ABCD,abcd)
+
+
+cfortran.h also provides preprocessor directives for a systematic 'renaming' of
+the C routines when they are called from FORTRAN. This is done by redefining
+the fcallsc macro before the FCALLSCSUB/FUN/n declarations as follows:
+
+#undef  fcallsc
+#define fcallsc(UN,LN) preface_fcallsc(CF,cf,UN,LN)
+
+FCALLSCSUB0(hello,HELLO,hello)
+
+Will cause C's routine 'hello' to be known in FORTRAN as 'cfhello'. Similarly
+all subsequent FCALLSCSUB/FUN/n declarations will generate wrappers to allow
+FORTRAN to call C with the C routine's name prefaced by 'cf'. The following has
+the same effect, with subsequent FCALLSCSUB/FUN/n's appending the modifier to
+the original C routines name.
+
+#undef  fcallsc
+#define fcallsc(UN,LN) append_fcallsc(Y,y,UN,LN)
+
+FCALLSCSUB0(Xroutine,ROUTINE,routine)
+
+Hence, C's Xroutine is called from FORTRAN as:
+       CALL XROUTINEY()
+
+The original behavior of FCALLSCSUB/FUN/n, where FORTRAN routine names are left
+identical to those of C, is returned using:
+
+#undef  fcallsc
+#define fcallsc(UN,LN) orig_fcallsc(UN,LN)
+
+
+In C, when passing a C routine, i.e. its wrapper, as an argument to a FORTRAN
+routine, the FORTRAN name declared is used and the correct fcallsc must be in
+effect. E.g. Passing 'name' and 'routine' of the above examples to the FORTRAN
+routines, FT1 and FT2, respectively:
+
+/* This might not be needed if fcallsc is already orig_fcallsc. */
+#undef  fcallsc
+#define fcallsc(UN,LN) orig_fcallsc(UN,LN)
+FT1(C_FUNCTION(CFNAME,cfname));
+
+#undef  fcallsc
+#define fcallsc(UN,LN) append_fcallsc(Y,y,UN,LN)
+FT1(C_FUNCTION(XROUTINE,xroutine));
+
+If the names of C routines are modified when used by FORTRAN, fcallsc would
+usually be defined once in a header_file.h for the application. This definition
+would then be used and be valid for the entire application and fcallsc would at
+no point need to be redefined.
+
+
+ONCE AGAIN: THE DEFINITIONS, INSTRUCTIONS, DECLARATIONS AND DIFFICULTIES
+DESCRIBED HERE, NOTE 9. of II ii), 
+APPLY ONLY FOR VAX VMS,
+               IBM RS/6000 WITHOUT THE -qextname OPTION FOR xlf, OR
+               HP-UX       WITHOUT THE +ppu      OPTION FOR f77
+               AbsoftUNIXFortran
+AND APPLY ONLY WHEN CREATING WRAPPERS WHICH ENABLE FORTRAN TO CALL C ROUTINES.
+
+
+
+iii) Using C to manipulate FORTRAN COMMON BLOCKS:
+     -------------------------------------------------------
+
+FORTRAN common blocks are set up with the following three constructs:
+
+1.
+#define Common_block_name COMMON_BLOCK(COMMON_BLOCK_NAME,common_block_name)
+
+Common_block_name is in UPPER CASE. 
+COMMON_BLOCK_NAME is in UPPER CASE.
+common_block_name is in lower case. 
+[Common_block_name actually follows the same 'rules' as Routine_name in Note 2.
+ of II i).] This construct exists to ensure that C code accessing the common
+block is machine independent.
+
+2.
+COMMON_BLOCK_DEF(TYPEDEF_OF_STRUCT, Common_block_name);
+
+where 
+typedef { ... } TYPEDEF_OF_STRUCT;
+declares the structure which maps on to the common block. The #define of
+Common_block_name must come before the use of COMMON_BLOCK_DEF.
+
+3.
+In exactly one of the C source files, storage should be set aside for the
+common block with the definition: 
+
+TYPEDEF_OF_STRUCT  Common_block_name;
+
+The above definition may have to be omitted on some machines for a common block
+which is initialized by Fortran BLOCK DATA or is declared with a smaller size
+in the C routines than in the Fortran routines.
+
+The rules for common blocks are not well defined when linking/loading a mixture
+of C and Fortran, but the following information may help resolve problems.
+
+From the 2nd or ANSI ed. of K&R C, p.31, last paragraph:
+i)
+ An external variable must be defined, exactly once, outside of any function;
+ this sets aside storage for it.
+ii)
+ The variable must also be declared in each function that wants to access it;
+ ...
+ The declaration ... may be implicit from context.
+
+In Fortran, every routine says 'common /bar/ foo',
+i.e. part ii) of the above, but there's no part i) requirement.
+cc/ld on some machines don't require i) either.
+Therefore, when handling Fortran, and sometimes C,
+the loader/linker must automagically set aside storage for common blocks.
+
+Some loaders, including at least one for the CRAY, turn off the
+'automagically set aside storage' capability for Fortran common blocks,
+if any C object declares that common block.
+Therefore, C code should define, i.e. set aside storage,
+for the the common block as shown above.
+
+e.g.
+C Fortran
+      common /fcb/  v,w,x
+      character *(13) v, w(4), x(3,2)
+
+/* C */
+typedef struct { char v[13],w[4][13],x[2][3][13]; } FCB_DEF;
+#define Fcb COMMON_BLOCK(FCB,fcb)
+COMMON_BLOCK_DEF(FCB_DEF,Fcb);
+FCB_DEF Fcb;      /* Definition, which sets aside storage for Fcb, */
+                  /* may appear in at most one C source file.      */
+
+
+C programs can place a string (or a multidimensional array of strings) into a
+FORTRAN common block using the following call:
+
+C2FCBSTR( CSTR, FSTR,DIMENSIONS);
+
+where:
+
+CSTR is a pointer to the first element of C's copy of the string (array). 
+     The C code must use a duplicate of, not the original, common block string,
+     because the FORTRAN common block does not allocate space for C strings'
+     terminating '\0'.
+
+FSTR is a pointer to the first element of the string (array) in the common
+     block.
+
+DIMENSIONS is the number of dimensions of string array. 
+     e.g. char a[10]      has DIMENSIONS=0.
+          char aa[10][17] has DIMENSIONS=1.
+          etc...
+
+C2FCBSTR will copy the string (array) from CSTR to FSTR, padding with blanks, 
+' ', the trailing characters as required. C2FCBSTR uses DIMENSIONS and FSTR to
+determine the lengths of the individual string elements and the total number of
+elements in the string array.
+
+Note that:
+- the number of string elements in CSTR and FSTR are identical.
+- for arrays of strings, the useful lengths of strings in CSTR and FSTR must be
+  the same. i.e. CSTR elements each have 1 extra character to accommodate the
+  terminating '\0'.
+- On most non-ANSI compilers, the DIMENSION argument cannot be prepended by any
+  blanks.
+
+
+FCB2CSTR( FSTR, CSTR,DIMENSIONS)
+
+is the inverse of C2FCBSTR, and shares the same arguments and caveats.
+FCB2CSTR copies each string element of FSTR to CSTR, minus FORTRAN strings'
+trailing blanks.
+
+
+cfortran.h USERS ARE STRONGLY URGED TO EXAMINE THE COMMON BLOCK EXAMPLES IN
+cfortest.c AND cfortex.f. The use of strings in common blocks is
+demonstrated, along with a suggested way for C to imitate FORTRAN EQUIVALENCE'd
+variables.
+
+
+              ===> USERS OF CFORTRAN.H NEED READ NO FURTHER <===
+
+
+III Some Musings
+----------------
+
+cfortran.h is simple enough to be used by the most basic of applications, i.e.
+making a single C/FORTRAN routine available to the FORTRAN/C programmers. Yet
+cfortran.h is powerful enough to easily make entire C/FORTRAN libraries
+available to FORTRAN/C programmers. 
+
+
+cfortran.h is the ideal tool for FORTRAN libraries which are being (re)written
+in C, but are to (continue to) support FORTRAN users. It allows the routines to
+be written in 'natural C', without having to consider the FORTRAN argument
+passing mechanisms of any machine. It also allows C code accessing these
+rewritten routines, to use the C entry point. Without cfortran.h, one risks the
+perverse practice of C code calling a C function using FORTRAN argument passing
+mechanisms!
+
+
+Perhaps the philosophy and mechanisms of cfortran.h could be used and extended
+to create other language bridges such as ADAFORTRAN, CPASCAL, COCCAM, etc.
+
+
+The code generation machinery inside cfortran.h, i.e. the global structure is
+quite good, being clean and workable as seen by its ability to meet the needs
+and constraints of many different compilers. Though the individual instructions
+of the A..., C..., T..., R... and K... tables deserve to be cleaned up.
+
+
+
+IV  Getting Serious with cfortran.h
+-----------------------------------
+
+cfortran.h is set up to be as simple as possible for the casual user. While
+this ease of use will always be present, 'hooks', i.e. preprocessor directives,
+are required in cfortran.h so that some of the following 'inefficiencies' can
+be eliminated if they cause difficulties:
+
+o cfortran.h contains a few small routines for string manipulation. These
+routines are declared static and are included and compiled in all source code
+which uses cfortran.h. Hooks should be provided in cfortran.h to create an
+object file of these routines, allowing cfortran.h to merely prototypes
+these routines in the application source code. This is the only 'problem' which
+afflicts both halves of cfortran.h. The remaining discussion refers to the C
+calls FORTRAN half only.
+
+o Similar to the above routines, cfortran.h generates code for a 'wrapper'
+routine for each FUNCTION exported from FORTRAN. Again cfortran.h needs
+preprocessor directives to create a single object file of these routines,
+and to merely prototype them in the applications.
+
+o Libraries often contain hundreds of routines. While the preprocessor makes
+quick work of generating the required interface code from cfortran.h and the
+application.h's, it may be convenient for very large stable libraries to have
+final_application.h's which already contain the interface code, i.e. these
+final_application.h's would not require cfortran.h. [The convenience can be
+imagined for the VAX VMS CC compiler which has a fixed amount of memory for
+preprocessor directives. Not requiring cfortran.h, with its hundreds of
+directives, could help prevent this compiler from choking on its internal
+limits quite so often.]
+
+With a similar goal in mind, cfortran.h defines 100's of preprocessor
+directives. There is always the potential that these will clash with other tags
+in the users code, so final_applications.h, which don't require cfortran.h,
+also provide the solution.
+
+In the same vein, routines with more than 14 arguments can not be interfaced by
+cfortran.h with compilers which limit C macros to 31 arguments. To resolve this
+difficulty, final_application.h's can be created on a compiler without this
+limitation.
+
+Therefore, new machinery is required to do:
+
+application.h + cfortran.h => final_application.h
+
+The following example may help clarify the means and ends:
+
+If the following definition of the HBOOK1 routine, the /*commented_out_part*/,
+is passed through the preprocessor [perhaps #undefing and #defining preprocessor
+constants if creating an application.h for compiler other than that of the
+preprocessor being used, e.g. cpp -Umips -DCRAY ... ] :
+
+#include "cfortran.h"
+PROTOCCALLSFSUB6(HBOOK1,hbook1,INT,STRING,INT,FLOAT,FLOAT,FLOAT)
+/*#define HBOOK1(ID,CHTITLE,NX,XMI,XMA,VMX)                 \*/
+     CCALLSFSUB6(HBOOK1,hbook1,INT,STRING,INT,FLOAT,FLOAT,FLOAT, \
+                 ID,CHTITLE,NX,XMI,XMA,VMX) 
+
+A function prototype is produced by the PROTOCCALLSFSUB6(...).
+Interface code is produced, based on the 'variables', 
+ID,CHTITLE,NX,XMI,XMA,VMX, which will correctly massage a HBOOK1 call.
+Therefore, adding the #define line:
+
+'prototype code'
+#define HBOOK1(ID,CHTITLE,NX,XMI,XMA,VMX)                 \
+ 'interface code'(ID,CHTITLE,NX,XMI,XMA,VMX)
+
+which is placed into final_application.h.
+
+The only known limitation of the above method does not allow the 'variable'
+names to include B1,B2,...,B9,BA,BB,... 
+
+Obviously the machinery to automatically generate final_applications.h from
+cfortran.h and applications.h needs more than just some preprocessor
+directives, but a fairly simple unix shell script should be sufficient. Any
+takers?
+
+
+
+V Machine Dependencies of cfortran.h
+------------------------------------
+
+Porting cfortran.h applications, e.g. the hbook.h and cstring.c mentioned
+above, to other machines is trivial since they are machine independent. Porting
+cfortran.h requires a solid knowledge of the new machines C preprocessor, and
+its FORTRAN argument passing mechanisms. Logically cfortran.h exists as two
+halves, a "C CALLS FORTRAN" and a "FORTRAN CALLS C" utility. In some cases it
+may be perfectly reasonable to port only 'one half' of cfortran.h onto a new
+system.
+
+
+The lucky programmer porting cfortran.h to a new machine, must discover the
+FORTRAN argument passing mechanisms. A safe starting point is to assume that
+variables and arrays are simply passed by reference, but nothing is guaranteed.
+Strings, and n-dimensional arrays of strings are a different story. It is
+doubtful that any systems do it quite like VAX VMS does it, so that a UNIX or
+f2c versions may provide an easier starting point.
+
+
+cfortran.h uses and abuses the preprocessor's ## operator. Although the ##
+operator does not exist in many compilers, many kludges do. cfortran.h uses
+/**/ with no space allowed between the slashes, '/', and the macros or tags
+to be concatenated. e.g.
+#define concat(a,b) a/**/b   /* works*/
+main()
+{
+  concat(pri,ntf)("hello");           /* e.g. */
+}
+N.B. On some compilers without ##, /**/ may also not work. The author may be
+able to offer alternate kludges.
+
+
+
+VI Bugs in vendors C compilers and other curiosities
+----------------------------------------------------
+
+1. ULTRIX xxxxxx 4.3 1 RISC
+
+Condolences to long suffering ultrix users!
+DEC supplies a working C front end for alpha/OSF, but not for ultrix.
+
+From K&R ANSI C p. 231:
+   ultrix> cat cat.c
+   #define cat(x, y) x ## y
+   #define xcat(x,y) cat(x,y)
+   cat(cat(1,2),3)
+   xcat(xcat(1,2),3)
+   ultrix> cc -E cat.c
+   123                  <---- Should be: cat(1,2)3
+   123                  <---- Correct.
+   ultrix> 
+
+The problem for cfortran.h, preventing use of -std and -std1:
+   ultrix> cat c.c
+   #define cat(x, y) x ## y
+   #define xcat(x,y) cat(x,y)
+   #define AB(X) X+X
+   #define C(E,F,G)  cat(E,F)(G)
+   #define X(E,F,G) xcat(E,F)(G)
+   C(A,B,2)
+   X(A,B,2)
+   ultrix> cc -std1 -E c.c
+   2+2  
+   AB  (2)              <---- ?????????????
+   ultrix>
+   ultrix> cc -std0 -E c.c
+   2+2  
+   AB(2)                <---- ?????????????
+   ultrix>
+
+Due to further ultrix preprocessor problems,
+for all definitions of definitions with arguments,
+cfortran.h >= 3.0 includes the arguments and recommends the same,
+even though it is not required by ANSI C.
+e.g. Users are advised to do
+   #define fcallsc(UN,LN) orig_fcallsc(UN,LN)
+instead of
+   #define fcallsc        orig_fcallsc
+since ultrix fails to properly preprocess the latter example.
+CRAY used to (still does?) occasionally trip up on this problem.
+
+
+2. ConvexOS convex C210 11.0 convex
+
+In a program with a C main, output to LUN=6=* from Fortran goes into
+$pwd/fort.6 instead of stdout. Presumably, a magic incantation can be called
+from the C main in order to properly initialize the Fortran I/O.
+
+
+3. SunOS 5.3 Generic_101318-69 sun4m sparc
+
+The default data and code alignments produced by cc, gcc and f77 are compatible.
+If deviating from the defaults, consistent alignment options must be used
+across all objects compiled by cc and f77. [Does gcc provide such options?]
+
+
+4. SunOS 5.3 Generic_101318-69 sun4m sparc with cc: SC3.0.1 13 Jul 1994
+   or equivalently
+   ULTRIX 4.4 0 RISC using cc -oldc
+   are K&R C preprocessors that suffer from infinite loop macros, e.g.
+
+  zedy03> cat src.c
+  #include "cfortran.h"
+                            PROTOCCALLSFFUN1(INT,FREV,frev, INTV)
+  #define FREV(A1)               CCALLSFFUN1(    FREV,frev, INTV, A1)
+  /* To avoid the problem, deletete these ---^^^^--- spaces.    */
+  main() { static int a[] = {1,2}; FREV(a); return EXIT_SUCCESS; }
+
+  zedy03> cc -c -Xs -v -DMAX_PREPRO_ARGS=31 -D__CF__KnR src.c
+  "src.c", line 4: FREV: actuals too long
+  "src.c", line 4: FREV: actuals too long
+  .... 3427 more lines of the same message
+  "src.c", line 4: FREV: actuals too long
+  cc : Fatal error in /usr/ccs/lib/cpp
+  Segmentation fault (core dumped) 
+
+
+5. Older sun C compilers
+
+To link to f77 objects, older sun C compilers require the math.h macros:
+
+#define RETURNFLOAT(x)   { union {double _d; float _f; } _kluge; \
+                           _kluge._f = (x); return _kluge._d;   }
+#define ASSIGNFLOAT(x,y) { union {double _d; float _f; } _kluge; \
+                           _kluge._d = (y); x = _kluge._f;      }
+
+Unfortunately, in at least some copies of the sun math.h, the semi-colon
+for 'float _f;' is left out, leading to compiler warnings.
+
+The solution is to correct math.h, or to change cfortran.h to #define 
+RETURNFLOAT(x) and ASSIGNFLOAT(x,y) instead of including math.h.
+
+
+6. gcc version 2.6.3 and probably all other versions as well
+
+Unlike all other C compilers supported by cfortran.h,
+'gcc -traditional' promotes to double all functions returning float
+as demonstrated bu the following example.
+
+/* m.c */
+#include <stdio.h>
+int main() { FLOAT_FUNCTION d(); float f; f = d(); printf("%f\n",f); return 0; }
+
+/* d.c */
+float d() { return -123.124; }
+
+burow[29] gcc -c -traditional d.c
+burow[30] gcc -DFLOAT_FUNCTION=float m.c d.o && a.out
+0.000000
+burow[31] gcc -DFLOAT_FUNCTION=double m.c d.o && a.out
+-123.124001
+burow[32]
+
+Thus, 'gcc -traditional' is not supported by cfortran.h.
+Support would require the same RETURNFLOAT, etc. macro machinery
+present in old sun math.h, before sun gave up the same promotion.
+
+
+7. CRAY
+
+At least some versions of the t3e and t3d C preprocessor are broken
+in the fashion described below.
+At least some versions of the t90 C preprocessor do not have this problem.
+
+On the CRAY, all Fortran names are converted to uppercase.
+Generally the uppercase name is also used for the macro interface
+created by cfortran.h.
+
+For example, in the following interface,
+EASY is both the name of the macro in the original C code
+and EASY is the name of the resulting function to be called.
+
+#define EASY(A,B)      CCALLSFSUB2(EASY,easy, PINT, INTV, A, B)
+
+The fact that a macro called EASY() expands to a function called EASY()
+is not a problem for a working C preprocessor.
+From Kernighan and Ritchie, 2nd edition, p.230:
+
+    In both kinds of macro, the replacement token sequence is repeatedly
+  rescanned for more identifiers. However, once a given identifier has been
+  replaced in a given expansion, it is not replaced if it turns up again during
+  rescanning; instead it is left unchanged.
+
+Unfortunately, some CRAY preprocessors are broken and don't obey the above rule.
+A work-around is for the user to NOT use the uppercase name
+of the name of the macro interface provided by cfortran.h. For example:
+
+#define Easy(A,B)      CCALLSFSUB2(EASY,easy, PINT, INTV, A, B)
+
+Luckily, the above work-around is not required since the following
+work-around within cfortran.h also circumvents the bug:
+
+   /* (UN), not UN, is required in order to get around  CRAY preprocessor bug.*/
+   #define CFC_(UN,LN)            (UN)      /* Uppercase FORTRAN symbols.     */
+
+Aside: The Visual C++ compiler is happy with UN, but barfs on (UN),
+       so either (UN) causes nonstandard C/C++ or Visual C++ is broken.
+
+
+VII History and Acknowledgements
+--------------------------------
+
+1.0 - Supports VAX VMS using C 3.1 and FORTRAN 5.4.                    Oct. '90.
+1.0 - Supports Silicon Graphics w. Mips Computer 2.0 f77 and cc.       Feb. '91.
+          [Port of C calls FORTRAN half only.]
+1.1 - Supports Mips Computer System 2.0 f77 and cc.                    Mar. '91.
+          [Runs on at least: Silicon Graphics IRIX 3.3.1
+                             DECstations with Ultrix V4.1]
+1.2 - Internals made simpler, smaller, faster, stronger.               May  '91.
+    - Mips version works on IBM RS/6000, this is now called the unix version.
+1.3 - UNIX and VAX VMS versions are merged into a single cfortran.h.   July '91.
+    - C can help manipulate (arrays of) strings in FORTRAN common blocks.
+    - Dimensions of string arrays arguments can be explicit.
+    - Supports Apollo DomainOS 10.2 (sys5.3) with f77 10.7 and cc 6.7.
+
+2.0 - Improved code generation machinery creates K&R or ANSI C.        Aug. '91.
+    - Supports Sun, CRAY. f2c with vcc on VAX Ultrix.
+    - cfortran.h macros now require routine and COMMON block names in both 
+      upper and lower case. No changes required to applications though.
+    - PROTOCCALLSFSUBn is eliminated, with no loss to cfortran.h performance.
+    - Improved tools and guidelines for naming C routines called by FORTRAN.
+2.1 - LOGICAL correctly supported across all machines.                 Oct. '91.
+    - Improved support for DOUBLE PRECISION on the CRAY.
+    - HP9000 fully supported.
+    - VAX Ultrix cc or gcc with f77 now supported.
+2.2 - SHORT, i.e. INTEGER*2, and BYTE now supported.                   Dec. '91.
+    - LOGICAL_STRICT introduced. More compact and robust internal tables.
+    - typeV and typeVV for type = BYTE, DOUBLE, FLOAT, INT, LOGICAL, LONG,SHORT.
+    - FORTRAN passing strings and NULL pointer to C routines improved. 
+2.3 - Extraneous arguments removed from many internal tables.          May  '92.
+    - Introduce pseudo argument type SIMPLE for user defined types.
+    - LynxOS using f2c supported. (Tested with LynxOS 2.0 386/AT.)
+2.4 - Separation of internal C and Fortran compilation directives.     Oct. '92.
+    - f2c and NAG f90 supported on all machines.
+2.5 - Minor mod.s to source and/or doc for HP9000, f2c, and NAG f90.   Nov. '92.
+2.6 - Support external procedures as arguments with type ROUTINE.      Dec. '92.
+2.7 - Support Alpha VMS. Support HP9000 f77 +ppu                       Jan. '93.
+    - Support arrays with up to 7 dimensions.
+    - Minor mod. of Fortran NULL to C via (P)STRING.
+    - Specify the type of ROUTINE passed from Fortran to C [ANSI C requirement.]
+    - Macros never receive a null parameter [RS/6000 requirement.]
+2.8 - PSTRING for Fortran calls C no longer provides escape to pass    April'93.
+      NULL pointer nor to pass address of original string.
+      PNSTRING introduced with old PSTRING's behavior.
+      PPSTRING introduced to always pass original address of string.
+    - Support Alpha/OSF.
+    - Document that common blocks used in C should be declared AND defined.
+
+3.0 - Automagic handling of ANSI ## versus K&R /**/ preprocessor op.   March'95.
+    - Less chance of name space collisions between cfortran.h and other codes.
+    - SIMPLE macros, supporting user defined types, have changed names.
+3.1 - Internal macro name _INT not used. Conflicted with IRIX 5.3.     May  '95.
+    - SunOS, all versions, should work out of the box.
+    - ZTRINGV_ARGS|F(k) may no longer point to a PDOUBLE or PFLOAT argument.
+    - ConvexOS 11.0 supported.
+3.2 - __hpux no longer needs to be restricted to MAX_PREPRO_ARGS=31.   Oct. '95.
+    - PSTRING bug fixed.
+    - ZTRINGV_ARGS|F(k) may not point to a PBYTE,PINT,PLONG or PSHORT argument.
+    - (P)ZTRINGV machinery improved. Should lead to fewer compiler warnings.
+      (P)ZTRINGV no longer limits recursion or the nesting of routines.
+    - SIMPLE macros, supporting user defined types, have changed slightly.
+3.3 - Supports PowerStation Fortran with Visual C++.                   Nov. '95.
+    - g77 should work using f2cFortran, though no changes made for it.
+    - (PROTO)CCALLSFFUN10 extended to (PROTO)CCALLSFFUN14.
+    - FCALLSCFUN10 and SUB10 extended to FCALLSCFUN14 and SUB14.
+3.4 - C++ supported,                                                   Dec. '95.
+      but it required the reintroduction of PROTOCCALLSFSUBn for users.
+    - HP-UX f77 +800 supported.
+3.5 - Absoft UNIX Fortran supported.                                   Sept.'96.
+3.6 - Minor corrections to cfortran.doc.                               Oct. '96.
+    - Fixed bug for 15th argument. [Thanks to Tom Epperly at Aspen Tech.]
+    - For AbsoftUNIXFortran, obey default of prepending _C to COMMON BLOCK name.
+    - Fortran calling C with ROUTINE argument fixed and cleaned up.
+3.7 - Circumvent IBM and HP "null argument" preprocessor warning.      Oct. '96
+3.8 - (P)STRINGV and (P)ZTRINGV can pass a 1- or 2-dim. char array.    Feb. '97
+      (P)ZTRINGV thus effectively also provides (P)ZTRING.
+    - (P)ZTRINGV accepts a (char *) pointer.
+3.9 - Bug fixed for *VVVVV.                                            May  '97
+    - f2c: Work-around for strange underscore-dependent naming feature.
+    - NEC SX-4 supported.
+    - CRAY: LOGICAL conversion uses _btol and _ltob from CRAY's fortran.h.
+    - CRAY: Avoid bug of some versions of the C preprocessor.
+    - CRAY T3E: FORTRAN_REAL introduced.
+
+4.0 - new/delete now used for C++. malloc/free still used for C.       Jan. '98
+    - FALSE no longer is defined by cfortran.h .
+    - Absoft Pro Fortran for MacOS supported.
+4.1 - COMMA and COLON no longer are defined by cfortran.h .            April'98
+    - Bug fixed when 10th arg. or beyond is a string.
+      [Rob Lucchesi of NASA-Goddard pointed out this bug.]
+    - CCALLSFSUB/FUN extended from 14 to 27 arguments.
+    - Workaround SunOS CC 4.2 cast bug. [Thanks to Savrak SAR of CERN.]
+4.2 - Portland Group needs -DpgiFortran . [Thank George Lai of NASA.]  June '98
+4.3 - (PROTO)CCALLSFSUB extended from 20 to 27 arguments.              July '98
+
+
+['Support' implies these and more recent releases of the respective
+ OS/compilers/linkers can be used with cfortran.h. 
+ Earlier releases may also work.]
+
+
+Acknowledgements:
+- CERN very generously sponsored a week in 1994 for me to work on cfortran.h.
+- M.L.Luvisetto (Istituto Nazionale Fisica Nucleare - Centro Nazionale
+  Analisi Fotogrammi, Bologna, Italy) provided all the support for the port to
+  the CRAY. Marisa's encouragement and enthusiasm was also much appreciated.
+- J.Bunn (CERN) supported the port to PowerStation Fortran with Visual C++.
+- Paul Schenk (UC Riverside, CERN PPE/OPAL) in June 1993 extended cfortran.h 2.7
+  to have C++ call Fortran. This was the starting point for full C++ in 3.4.
+- Glenn P.Davis of University Corp. for Atmospheric Research (UCAR) / Unidata
+  supported the NEC SX-4 port and helped understand the CRAY.
+- Tony Goelz of Absoft Corporation ported cfortran.h to Absoft.
+- Though cfortran.h has been created in my 'copious' free time, I thank 
+  NSERC for their generous support of my grad. student and postdoc years.
+- Univ.Toronto, DESY, CERN and others have provided time on their computers.
+
+
+THIS PACKAGE, I.E. CFORTRAN.H, THIS DOCUMENT, AND THE CFORTRAN.H EXAMPLE
+PROGRAMS ARE PROPERTY OF THE AUTHOR WHO RESERVES ALL RIGHTS. THIS PACKAGE AND
+THE CODE IT PRODUCES MAY BE FREELY DISTRIBUTED WITHOUT FEES, SUBJECT TO THE
+FOLLOWING RESTRICTIONS:
+- YOU MUST ACCOMPANY ANY COPIES OR DISTRIBUTION WITH THIS (UNALTERED) NOTICE.
+- YOU MAY NOT RECEIVE MONEY FOR THE DISTRIBUTION OR FOR ITS MEDIA 
+  (E.G. TAPE, DISK, COMPUTER, PAPER.)
+- YOU MAY NOT PREVENT OTHERS FROM COPYING IT FREELY.
+- YOU MAY NOT DISTRIBUTE MODIFIED VERSIONS WITHOUT CLEARLY DOCUMENTING YOUR
+  CHANGES AND NOTIFYING THE AUTHOR.
+- YOU MAY NOT MISREPRESENTED THE ORIGIN OF THIS SOFTWARE, EITHER BY EXPLICIT
+  CLAIM OR BY OMISSION.
+
+THE INTENT OF THE ABOVE TERMS IS TO ENSURE THAT THE CFORTRAN.H PACKAGE NOT BE
+USED FOR PROFIT MAKING ACTIVITIES UNLESS SOME ROYALTY ARRANGEMENT IS ENTERED
+INTO WITH ITS AUTHOR.
+              
+THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
+EXPRESSED OR IMPLIED. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+SOFTWARE IS WITH YOU. SHOULD THE SOFTWARE PROVE DEFECTIVE, YOU ASSUME THE COST
+OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. THE AUTHOR IS NOT RESPONSIBLE
+FOR ANY SUPPORT OR SERVICE OF THE CFORTRAN.H PACKAGE.
+
+                                              Burkhard Burow 
+                                              burow at ifh.de
+
+P.S. Your comments and questions are welcomed and usually promptly answered.
+
+VAX VMS and Ultrix, Alpha, OSF, Silicon Graphics (SGI), DECstation, Mips RISC,
+Sun, CRAY, Convex, IBM RS/6000, Apollo DomainOS, HP, LynxOS, f2c, NAG, Absoft,
+NEC SX-4, PowerStation and Visual C++ are registered trademarks of their
+respective owners.
+        
+/* end: cfortran.doc */
diff --git a/libcdi/src/cfortran.h b/libcdi/src/cfortran.h
new file mode 100644
index 0000000..ea0b0e9
--- /dev/null
+++ b/libcdi/src/cfortran.h
@@ -0,0 +1,2388 @@
+/* cfortran.h  4.3 */
+/* http://www-zeus.desy.de/~burow/cfortran/                   */
+/* Burkhard Burow  burow at desy.de                 1990 - 2001. */
+
+/* 02/12/2002 Uwe Schulzweida : UXP Fortran support           */
+/* 02/05/2003 Uwe Schulzweida : Linux Fortran support on i386 */
+/* 09/09/2005 Uwe Schulzweida : Linux Fortran support on ia64 */
+
+#ifndef __CFORTRAN_LOADED
+#define __CFORTRAN_LOADED
+
+/* 
+   THIS FILE IS PROPERTY OF BURKHARD BUROW. IF YOU ARE USING THIS FILE YOU
+   SHOULD ALSO HAVE ACCESS TO CFORTRAN.DOC WHICH PROVIDES TERMS FOR USING,
+   MODIFYING, COPYING AND DISTRIBUTING THE CFORTRAN.H PACKAGE.
+*/
+
+/* 
+  Avoid symbols already used by compilers and system *.h:
+  __ - OSF1 zukal06 V3.0 347 alpha, cc -c -std1 cfortest.c
+
+ */
+
+
+/* First prepare for the C compiler. */
+
+#ifndef ANSI_C_preprocessor /* i.e. user can override. */
+#ifdef __CF__KnR
+#define ANSI_C_preprocessor 0
+#else
+#ifdef __STDC__
+#define ANSI_C_preprocessor 1
+#else
+#define _cfleft             1
+#define _cfright 
+#define _cfleft_cfright     0
+#define ANSI_C_preprocessor _cfleft/**/_cfright
+#endif
+#endif
+#endif
+
+#if ANSI_C_preprocessor
+#define _0(A,B)   A##B
+#define  _(A,B)   _0(A,B)  /* see cat,xcat of K&R ANSI C p. 231 */
+#define _2(A,B)   A##B     /* K&R ANSI C p.230: .. identifier is not replaced */
+#define _3(A,B,C) _(A,_(B,C))
+#else                      /* if it turns up again during rescanning.         */
+#define  _(A,B)   A/**/B
+#define _2(A,B)   A/**/B
+#define _3(A,B,C) A/**/B/**/C
+#endif
+
+#if (defined(vax)&&defined(unix)) || (defined(__vax__)&&defined(__unix__))
+#define VAXUltrix
+#endif
+
+#include <stdio.h>     /* NULL [in all machines stdio.h]                      */
+#include <string.h>    /* strlen, memset, memcpy, memchr.                     */
+#if !( defined(VAXUltrix) || defined(sun) || (defined(apollo)&&!defined(__STDCPP__)) )
+#include <stdlib.h>    /* malloc,free                                         */
+#else
+#include <malloc.h>    /* Had to be removed for DomainOS h105 10.4 sys5.3 425t*/
+#ifdef apollo
+#define __CF__APOLLO67 /* __STDCPP__ is in Apollo 6.8 (i.e. ANSI) and onwards */
+#endif
+#endif
+
+#if !defined(__GNUC__) && !defined(__sun) && (defined(sun)||defined(VAXUltrix)||defined(lynx))
+#define __CF__KnR     /* Sun, LynxOS and VAX Ultrix cc only supports K&R.     */
+                      /* Manually define __CF__KnR for HP if desired/required.*/
+#endif                /*       i.e. We will generate Kernighan and Ritchie C. */
+/* Note that you may define __CF__KnR before #include cfortran.h, in order to
+generate K&R C instead of the default ANSI C. The differences are mainly in the
+function prototypes and declarations. All machines, except the Apollo, work
+with either style. The Apollo's argument promotion rules require ANSI or use of
+the obsolete std_$call which we have not implemented here. Hence on the Apollo,
+only C calling FORTRAN subroutines will work using K&R style.*/
+
+
+/* Remainder of cfortran.h depends on the Fortran compiler. */
+
+#if defined(CLIPPERFortran) || defined(pgiFortran)
+#define f2cFortran
+#endif
+
+/* VAX/VMS does not let us \-split long #if lines. */ 
+/* Split #if into 2 because some HP-UX can't handle long #if */
+#if !(defined(NAGf90Fortran)||defined(f2cFortran)||defined(hpuxFortran)||defined(apolloFortran)||defined(sunFortran)||defined(IBMR2Fortran)||defined(CRAYFortran))
+#if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)||defined(SXFortran))
+/* If no Fortran compiler is given, we choose one for the machines we know.   */
+#if defined(__linux__) && defined(__i386__)
+#define f2cFortran
+#endif
+#if defined(__linux__) && defined(__ia64__)
+#define f2cFortran
+#endif
+#if defined(__linux__) && defined(__x86_64__)
+#define f2cFortran
+#endif
+#if defined(lynx) || defined(VAXUltrix)
+#define f2cFortran    /* Lynx:      Only support f2c at the moment.
+                         VAXUltrix: f77 behaves like f2c.
+                           Support f2c or f77 with gcc, vcc with f2c. 
+                           f77 with vcc works, missing link magic for f77 I/O.*/
+#endif
+#if defined(__hpux)             /* 921107: Use __hpux instead of __hp9000s300 */
+#define       hpuxFortran       /*         Should also allow hp9000s7/800 use.*/
+#endif
+#if       defined(apollo)
+#define           apolloFortran /* __CF__APOLLO67 also defines some behavior. */
+#endif
+#if          defined(sun) || defined(__sun) 
+#define              sunFortran
+#endif
+#if       defined(_IBMR2)
+#define            IBMR2Fortran
+#endif
+#if        defined(_CRAY)
+#define             CRAYFortran /*       _CRAYT3E also defines some behavior. */
+#endif
+#if        defined(_SX)
+#define               SXFortran
+#endif
+#if        defined(__uxp__)
+#define               UXPFortran
+#endif
+#if         defined(mips) || defined(__mips)
+#define             mipsFortran
+#endif
+#if          defined(vms) || defined(__vms)
+#define              vmsFortran
+#endif
+#if      defined(__alpha) && defined(__unix__)
+#define              DECFortran
+#endif
+#if   defined(__convex__)
+#define           CONVEXFortran
+#endif
+#if   defined(VISUAL_CPLUSPLUS)
+#define     PowerStationFortran
+#endif
+#endif /* ...Fortran */
+#endif /* ...Fortran */
+
+/* Split #if into 2 because some HP-UX can't handle long #if */
+#if !(defined(NAGf90Fortran)||defined(f2cFortran)||defined(hpuxFortran)||defined(apolloFortran)||defined(sunFortran)||defined(IBMR2Fortran)||defined(CRAYFortran))
+#if !(defined(mipsFortran)||defined(DECFortran)||defined(vmsFortran)||defined(CONVEXFortran)||defined(PowerStationFortran)||defined(AbsoftUNIXFortran)||defined(AbsoftProFortran)||defined(SXFortran)||defined(UXPFortran))
+/* If your compiler barfs on ' #error', replace # with the trigraph for #     */
+ #error "cfortran.h:  Can't find your environment among:\
+    - MIPS cc and f77 2.0. (e.g. Silicon Graphics, DECstations, ...)     \
+    - IBM AIX XL C and FORTRAN Compiler/6000 Version 01.01.0000.0000     \
+    - VAX   VMS CC 3.1 and FORTRAN 5.4.                                  \
+    - Alpha VMS DEC C 1.3 and DEC FORTRAN 6.0.                           \
+    - Alpha OSF DEC C and DEC Fortran for OSF/1 AXP Version 1.2          \
+    - Apollo DomainOS 10.2 (sys5.3) with f77 10.7 and cc 6.7.            \
+    - CRAY                                                               \
+    - NEC SX-4 SUPER-UX                                                  \
+    - CONVEX                                                             \
+    - Sun                                                                \
+    - PowerStation Fortran with Visual C++                               \
+    - HP9000s300/s700/s800 Latest test with: HP-UX A.08.07 A 9000/730    \
+    - LynxOS: cc or gcc with f2c.                                        \
+    - VAXUltrix: vcc,cc or gcc with f2c. gcc or cc with f77.             \
+    -            f77 with vcc works; but missing link magic for f77 I/O. \
+    -            NO fort. None of gcc, cc or vcc generate required names.\
+    - f2c    : Use #define    f2cFortran, or cc -Df2cFortran             \
+    - NAG f90: Use #define NAGf90Fortran, or cc -DNAGf90Fortran          \
+    - Absoft UNIX F77: Use #define AbsoftUNIXFortran or cc -DAbsoftUNIXFortran \
+    - Absoft Pro Fortran: Use #define AbsoftProFortran \
+    - Portland Group Fortran: Use #define pgiFortran"
+/* Compiler must throw us out at this point! */
+#endif
+#endif
+
+
+#if defined(VAXC) && !defined(__VAXC)
+#define OLD_VAXC
+#pragma nostandard                       /* Prevent %CC-I-PARAMNOTUSED.       */
+#endif
+
+/* Throughout cfortran.h we use: UN = Uppercase Name.  LN = Lowercase Name.   */
+
+#if defined(f2cFortran) || defined(NAGf90Fortran) || defined(DECFortran) || defined(mipsFortran) || defined(apolloFortran) || defined(sunFortran) || defined(CONVEXFortran) || defined(SXFortran) || defined(UXPFortran) || defined(extname)
+#define CFC_(UN,LN)            _(LN,_)      /* Lowercase FORTRAN symbols.     */
+#define orig_fcallsc(UN,LN)    CFC_(UN,LN)
+#else 
+#if defined(CRAYFortran) || defined(PowerStationFortran) || defined(AbsoftProFortran)
+#ifdef _CRAY          /* (UN), not UN, circumvents CRAY preprocessor bug.     */
+#define CFC_(UN,LN)            (UN)         /* Uppercase FORTRAN symbols.     */
+#else                 /* At least VISUAL_CPLUSPLUS barfs on (UN), so need UN. */
+#define CFC_(UN,LN)            UN           /* Uppercase FORTRAN symbols.     */
+#endif
+#define orig_fcallsc(UN,LN)    CFC_(UN,LN)  /* CRAY insists on arg.'s here.   */
+#else  /* For following machines one may wish to change the fcallsc default.  */
+#define CF_SAME_NAMESPACE
+#ifdef vmsFortran
+#define CFC_(UN,LN)            LN           /* Either case FORTRAN symbols.   */
+     /* BUT we usually use UN for C macro to FORTRAN routines, so use LN here,*/
+     /* because VAX/VMS doesn't do recursive macros.                          */
+#define orig_fcallsc(UN,LN)    UN
+#else      /* HP-UX without +ppu or IBMR2 without -qextname. NOT reccomended. */
+#define CFC_(UN,LN)            LN           /* Lowercase FORTRAN symbols.     */
+#define orig_fcallsc(UN,LN)    CFC_(UN,LN)
+#endif /*  vmsFortran */
+#endif /* CRAYFortran PowerStationFortran */
+#endif /* ....Fortran */
+
+#define fcallsc(UN,LN)               orig_fcallsc(UN,LN)
+#define preface_fcallsc(P,p,UN,LN)   CFC_(_(P,UN),_(p,LN))
+#define  append_fcallsc(P,p,UN,LN)   CFC_(_(UN,P),_(LN,p))
+
+#define C_FUNCTION(UN,LN)            fcallsc(UN,LN)      
+#define FORTRAN_FUNCTION(UN,LN)      CFC_(UN,LN)
+
+#ifndef COMMON_BLOCK
+#ifndef CONVEXFortran
+#ifndef CLIPPERFortran
+#if     !(defined(AbsoftUNIXFortran)||defined(AbsoftProFortran))
+#define COMMON_BLOCK(UN,LN)          CFC_(UN,LN)
+#else
+#define COMMON_BLOCK(UN,LN)          _(_C,LN)
+#endif  /* AbsoftUNIXFortran or AbsoftProFortran */
+#else
+#define COMMON_BLOCK(UN,LN)          _(LN,__)
+#endif  /* CLIPPERFortran */
+#else
+#define COMMON_BLOCK(UN,LN)          _3(_,LN,_)
+#endif  /* CONVEXFortran */
+#endif  /* COMMON_BLOCK */
+
+#ifndef DOUBLE_PRECISION
+#if defined(CRAYFortran) && !defined(_CRAYT3E)
+#define DOUBLE_PRECISION long double
+#else
+#define DOUBLE_PRECISION double
+#endif
+#endif
+
+#ifndef FORTRAN_REAL
+#if defined(CRAYFortran) &&  defined(_CRAYT3E)
+#define FORTRAN_REAL double
+#else
+#define FORTRAN_REAL float
+#endif
+#endif
+
+#ifdef CRAYFortran
+#ifdef _CRAY
+#include <fortran.h>
+#else
+#include "fortran.h"  /* i.e. if crosscompiling assume user has file. */
+#endif
+#define FLOATVVVVVVV_cfPP (FORTRAN_REAL *)   /* Used for C calls FORTRAN.     */
+/* CRAY's double==float but CRAY says pointers to doubles and floats are diff.*/
+#define VOIDP  (void *)  /* When FORTRAN calls C, we don't know if C routine 
+                            arg.'s have been declared float *, or double *.   */
+#else
+#define FLOATVVVVVVV_cfPP
+#define VOIDP
+#endif
+
+#ifdef vmsFortran
+#if    defined(vms) || defined(__vms)
+#include <descrip.h>
+#else
+#include "descrip.h"  /* i.e. if crosscompiling assume user has file. */
+#endif
+#endif
+
+#ifdef sunFortran
+#if defined(sun) || defined(__sun)
+#include <math.h>     /* Sun's FLOATFUNCTIONTYPE, ASSIGNFLOAT, RETURNFLOAT.  */
+#else
+#include "math.h"     /* i.e. if crosscompiling assume user has file. */
+#endif
+/* At least starting with the default C compiler SC3.0.1 of SunOS 5.3,
+ * FLOATFUNCTIONTYPE, ASSIGNFLOAT, RETURNFLOAT are not required and not in
+ * <math.h>, since sun C no longer promotes C float return values to doubles.
+ * Therefore, only use them if defined.
+ * Even if gcc is being used, assume that it exhibits the Sun C compiler
+ * behavior in order to be able to use *.o from the Sun C compiler.
+ * i.e. If FLOATFUNCTIONTYPE, etc. are in math.h, they required by gcc.
+ */
+#endif
+
+#ifndef apolloFortran
+#define COMMON_BLOCK_DEF(DEFINITION, NAME) extern DEFINITION NAME
+#define CF_NULL_PROTO
+#else                                         /* HP doesn't understand #elif. */
+/* Without ANSI prototyping, Apollo promotes float functions to double.    */
+/* Note that VAX/VMS, IBM, Mips choke on 'type function(...);' prototypes. */
+#define CF_NULL_PROTO ...
+#ifndef __CF__APOLLO67
+#define COMMON_BLOCK_DEF(DEFINITION, NAME) \
+ DEFINITION NAME __attribute((__section(NAME)))
+#else
+#define COMMON_BLOCK_DEF(DEFINITION, NAME) \
+ DEFINITION NAME #attribute[section(NAME)]
+#endif
+#endif
+
+#ifdef __cplusplus
+#undef  CF_NULL_PROTO
+#define CF_NULL_PROTO  ...
+#endif
+
+
+#ifndef USE_NEW_DELETE
+#ifdef __cplusplus
+#define USE_NEW_DELETE 1
+#else
+#define USE_NEW_DELETE 0
+#endif
+#endif
+#if USE_NEW_DELETE
+#define _cf_malloc(N) new char[N]
+#define _cf_free(P)   delete[] P
+#else
+#define _cf_malloc(N) (char *)malloc(N)
+#define _cf_free(P)   free(P)
+#endif
+
+#ifdef mipsFortran
+#define CF_DECLARE_GETARG         int f77argc; char **f77argv
+#define CF_SET_GETARG(ARGC,ARGV)  f77argc = ARGC; f77argv = ARGV
+#else
+#define CF_DECLARE_GETARG
+#define CF_SET_GETARG(ARGC,ARGV)
+#endif
+
+#ifdef OLD_VAXC                          /* Allow %CC-I-PARAMNOTUSED.         */
+#pragma standard                         
+#endif
+
+#define AcfCOMMA ,
+#define AcfCOLON ;
+
+/*-------------------------------------------------------------------------*/
+
+/*               UTILITIES USED WITHIN CFORTRAN.H                          */
+
+#define _cfMIN(A,B) (A<B?A:B)
+
+/* 970211 - XIX.145:
+   firstindexlength  - better name is all_but_last_index_lengths
+   secondindexlength - better name is         last_index_length
+ */
+#define  firstindexlength(A) (sizeof(A[0])==1 ? 1 : (sizeof(A) / sizeof(A[0])) )
+#define secondindexlength(A) (sizeof(A[0])==1 ?      sizeof(A) : sizeof(A[0])  )
+
+/* Behavior of FORTRAN LOGICAL. All machines' LOGICAL is same size as C's int.
+Conversion is automatic except for arrays which require F2CLOGICALV/C2FLOGICALV.
+f2c, MIPS f77 [DECstation, SGI], VAX Ultrix f77,
+HP-UX f77                                        : as in C.
+VAX/VMS FORTRAN, VAX Ultrix fort,
+Absoft Unix Fortran, IBM RS/6000 xlf             : LS Bit = 0/1 = TRUE/FALSE.
+Apollo                                           : neg.   = TRUE, else FALSE. 
+[Apollo accepts -1 as TRUE for function values, but NOT all other neg. values.]
+[DECFortran for Ultrix RISC is also called f77 but is the same as VAX/VMS.]   
+[MIPS f77 treats .eqv./.neqv. as .eq./.ne. and hence requires LOGICAL_STRICT.]*/
+
+#if defined(NAGf90Fortran) || defined(f2cFortran) || defined(mipsFortran) || defined(PowerStationFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran) || defined(AbsoftProFortran) || defined(SXFortran) || defined(UXPFortran)
+/* SX/PowerStationFortran have 0 and 1 defined, others are neither T nor F.   */
+/* hpuxFortran800 has 0 and 0x01000000 defined. Others are unknown.           */
+#define LOGICAL_STRICT      /* Other Fortran have .eqv./.neqv. == .eq./.ne.   */
+#endif
+
+#define C2FLOGICALV(A,I) \
+ do {int __i; for(__i=0;__i<I;__i++) A[__i]=C2FLOGICAL(A[__i]); } while (0)
+#define F2CLOGICALV(A,I) \
+ do {int __i; for(__i=0;__i<I;__i++) A[__i]=F2CLOGICAL(A[__i]); } while (0)
+
+#if defined(apolloFortran)
+#define C2FLOGICAL(L) ((L)?-1:(L)&~((unsigned)1<<sizeof(int)*8-1))
+#define F2CLOGICAL(L) ((L)<0?(L):0) 
+#else
+#if defined(CRAYFortran)
+#define C2FLOGICAL(L) _btol(L)
+#define F2CLOGICAL(L) _ltob(&(L))     /* Strangely _ltob() expects a pointer. */
+#else
+#if defined(IBMR2Fortran) || defined(vmsFortran) || defined(DECFortran) || defined(AbsoftUNIXFortran)
+/* How come no AbsoftProFortran ? */
+#define C2FLOGICAL(L) ((L)?(L)|1:(L)&~(int)1)
+#define F2CLOGICAL(L) ((L)&1?(L):0)
+#else
+#if defined(CONVEXFortran)
+#define C2FLOGICAL(L) ((L) ? ~0 : 0 )
+#define F2CLOGICAL(L) (L)
+#else   /* others evaluate LOGICALs as for C. */
+#define C2FLOGICAL(L) (L)
+#define F2CLOGICAL(L) (L)
+#ifndef LOGICAL_STRICT
+#undef  C2FLOGICALV
+#undef  F2CLOGICALV
+#define C2FLOGICALV(A,I)
+#define F2CLOGICALV(A,I)
+#endif  /* LOGICAL_STRICT                     */
+#endif  /* CONVEXFortran || All Others        */
+#endif  /* IBMR2Fortran vmsFortran DECFortran AbsoftUNIXFortran */
+#endif  /* CRAYFortran                        */
+#endif  /* apolloFortran                      */
+
+/* 970514 - In addition to CRAY, there may be other machines
+            for which LOGICAL_STRICT makes no sense. */
+#if defined(LOGICAL_STRICT) && !defined(CRAYFortran)
+/* Force C2FLOGICAL to generate only the values for either .TRUE. or .FALSE.
+   SX/PowerStationFortran only have 0 and 1 defined.
+   Elsewhere, only needed if you want to do:
+     logical lvariable
+     if (lvariable .eq.  .true.) then       ! (1)
+   instead of
+     if (lvariable .eqv. .true.) then       ! (2)
+   - (1) may not even be FORTRAN/77 and that Apollo's f77 and IBM's xlf
+     refuse to compile (1), so you are probably well advised to stay away from 
+     (1) and from LOGICAL_STRICT.
+   - You pay a (slight) performance penalty for using LOGICAL_STRICT. */
+#undef  C2FLOGICAL
+#ifdef hpuxFortran800
+#define C2FLOGICAL(L) ((L)?0x01000000:0)
+#else
+#if defined(apolloFortran) || defined(vmsFortran) || defined(DECFortran)
+#define C2FLOGICAL(L) ((L)?-1:0) /* These machines use -1/0 for .true./.false.*/
+#else
+#define C2FLOGICAL(L) ((L)? 1:0) /* All others     use +1/0 for .true./.false.*/
+#endif
+#endif
+#endif /* LOGICAL_STRICT */
+
+/* Convert a vector of C strings into FORTRAN strings. */
+#ifndef __CF__KnR
+static char *c2fstrv(char* cstr, char *fstr, int elem_len, int sizeofcstr)
+#else
+static char *c2fstrv(      cstr,       fstr,     elem_len,     sizeofcstr)
+                     char* cstr; char *fstr; int elem_len; int sizeofcstr;
+#endif
+{ int i,j;
+/* elem_len includes \0 for C strings. Fortran strings don't have term. \0.
+   Useful size of string must be the same in both languages. */
+for (i=0; i<sizeofcstr/elem_len; i++) {
+  for (j=1; j<elem_len && *cstr; j++) *fstr++ = *cstr++;
+  cstr += 1+elem_len-j;
+  for (; j<elem_len; j++) *fstr++ = ' ';
+} /* 95109 - Seems to be returning the original fstr. */
+return fstr-sizeofcstr+sizeofcstr/elem_len; }
+
+/* Convert a vector of FORTRAN strings into C strings. */
+#ifndef __CF__KnR
+static char *f2cstrv(char *fstr, char* cstr, int elem_len, int sizeofcstr)
+#else
+static char *f2cstrv(      fstr,       cstr,     elem_len,     sizeofcstr)
+                     char *fstr; char* cstr; int elem_len; int sizeofcstr; 
+#endif
+{ int i,j;
+/* elem_len includes \0 for C strings. Fortran strings don't have term. \0.
+   Useful size of string must be the same in both languages. */
+cstr += sizeofcstr;
+fstr += sizeofcstr - sizeofcstr/elem_len;
+for (i=0; i<sizeofcstr/elem_len; i++) {
+  *--cstr = '\0';
+  for (j=1; j<elem_len; j++) *--cstr = *--fstr;
+} return cstr; }
+
+/* kill the trailing char t's in string s. */
+#ifndef __CF__KnR
+static char *kill_trailing(char *s, char t)
+#else
+static char *kill_trailing(      s,      t) char *s; char t;
+#endif
+{char *e; 
+e = s + strlen(s);
+if (e>s) {                           /* Need this to handle NULL string.*/
+  while (e>s && *--e==t);            /* Don't follow t's past beginning. */
+  e[*e==t?0:1] = '\0';               /* Handle s[0]=t correctly.       */
+} return s; }
+
+/* kill_trailingn(s,t,e) will kill the trailing t's in string s. e normally 
+points to the terminating '\0' of s, but may actually point to anywhere in s.
+s's new '\0' will be placed at e or earlier in order to remove any trailing t's.
+If e<s string s is left unchanged. */ 
+#ifndef __CF__KnR
+static char *kill_trailingn(char *s, char t, char *e)
+#else
+static char *kill_trailingn(      s,      t,       e) char *s; char t; char *e;
+#endif
+{ 
+if (e==s) *e = '\0';                 /* Kill the string makes sense here.*/
+else if (e>s) {                      /* Watch out for neg. length string.*/
+  while (e>s && *--e==t);            /* Don't follow t's past beginning. */
+  e[*e==t?0:1] = '\0';               /* Handle s[0]=t correctly.       */
+} return s; }
+
+/* Note the following assumes that any element which has t's to be chopped off,
+does indeed fill the entire element. */
+#ifndef __CF__KnR
+static char *vkill_trailing(char* cstr, int elem_len, int sizeofcstr, char t)
+#else
+static char *vkill_trailing(      cstr,     elem_len,     sizeofcstr,      t)
+                            char* cstr; int elem_len; int sizeofcstr; char t;
+#endif
+{ int i;
+for (i=0; i<sizeofcstr/elem_len; i++) /* elem_len includes \0 for C strings. */
+  kill_trailingn(cstr+elem_len*i,t,cstr+elem_len*(i+1)-1);
+return cstr; }
+
+#ifdef vmsFortran
+typedef struct dsc$descriptor_s fstring;
+#define DSC$DESCRIPTOR_A(DIMCT)  		                               \
+struct {                                                                       \
+  unsigned short dsc$w_length;	        unsigned char	 dsc$b_dtype;	       \
+  unsigned char	 dsc$b_class;	                 char	*dsc$a_pointer;	       \
+           char	 dsc$b_scale;	        unsigned char	 dsc$b_digits;         \
+  struct {                                                                     \
+    unsigned		       : 3;	  unsigned dsc$v_fl_binscale : 1;      \
+    unsigned dsc$v_fl_redim    : 1;       unsigned dsc$v_fl_column   : 1;      \
+    unsigned dsc$v_fl_coeff    : 1;       unsigned dsc$v_fl_bounds   : 1;      \
+  } dsc$b_aflags;	                                                       \
+  unsigned char	 dsc$b_dimct;	        unsigned long	 dsc$l_arsize;	       \
+           char	*dsc$a_a0;	                 long	 dsc$l_m [DIMCT];      \
+  struct {                                                                     \
+    long dsc$l_l;                         long dsc$l_u;                        \
+  } dsc$bounds [DIMCT];                                                        \
+}
+typedef DSC$DESCRIPTOR_A(1) fstringvector;
+/*typedef DSC$DESCRIPTOR_A(2) fstringarrarr;
+  typedef DSC$DESCRIPTOR_A(3) fstringarrarrarr;*/
+#define initfstr(F,C,ELEMNO,ELEMLEN)                                           \
+( (F).dsc$l_arsize=  ( (F).dsc$w_length                        =(ELEMLEN) )    \
+                    *( (F).dsc$l_m[0]=(F).dsc$bounds[0].dsc$l_u=(ELEMNO)  ),   \
+  (F).dsc$a_a0    =  ( (F).dsc$a_pointer=(C) ) - (F).dsc$w_length          ,(F))
+
+#else
+#define _NUM_ELEMS      -1
+#define _NUM_ELEM_ARG   -2
+#define NUM_ELEMS(A)    A,_NUM_ELEMS
+#define NUM_ELEM_ARG(B) *_2(A,B),_NUM_ELEM_ARG
+#define TERM_CHARS(A,B) A,B
+#ifndef __CF__KnR
+static int num_elem(char *strv, unsigned elem_len, int term_char, int num_term)
+#else
+static int num_elem(      strv,          elem_len,     term_char,     num_term)
+                    char *strv; unsigned elem_len; int term_char; int num_term;
+#endif
+/* elem_len is the number of characters in each element of strv, the FORTRAN
+vector of strings. The last element of the vector must begin with at least
+num_term term_char characters, so that this routine can determine how 
+many elements are in the vector. */
+{
+unsigned num,i;
+if (num_term == _NUM_ELEMS || num_term == _NUM_ELEM_ARG) 
+  return term_char;
+if (num_term <=0) num_term = (int)elem_len;
+for (num=0; ; num++) {
+  for (i=0; i<(unsigned)num_term && *strv==term_char; i++,strv++);
+  if (i==(unsigned)num_term) break;
+  else strv += elem_len-i;
+}
+return (int)num;
+}
+#endif
+/*-------------------------------------------------------------------------*/
+
+/*           UTILITIES FOR C TO USE STRINGS IN FORTRAN COMMON BLOCKS       */
+
+/* C string TO Fortran Common Block STRing. */
+/* DIM is the number of DIMensions of the array in terms of strings, not
+   characters. e.g. char a[12] has DIM = 0, char a[12][4] has DIM = 1, etc. */
+#define C2FCBSTR(CSTR,FSTR,DIM)                                                \
+ c2fstrv((char *)CSTR, (char *)FSTR, sizeof(FSTR)/cfelementsof(FSTR,DIM)+1,    \
+         sizeof(FSTR)+cfelementsof(FSTR,DIM))
+
+/* Fortran Common Block string TO C STRing. */
+#define FCB2CSTR(FSTR,CSTR,DIM)                                                \
+ vkill_trailing(f2cstrv((char *)FSTR, (char *)CSTR,                            \
+                        sizeof(FSTR)/cfelementsof(FSTR,DIM)+1,                 \
+                        sizeof(FSTR)+cfelementsof(FSTR,DIM)),                  \
+                sizeof(FSTR)/cfelementsof(FSTR,DIM)+1,                         \
+                sizeof(FSTR)+cfelementsof(FSTR,DIM), ' ')
+
+#define cfDEREFERENCE0
+#define cfDEREFERENCE1 *
+#define cfDEREFERENCE2 **
+#define cfDEREFERENCE3 ***
+#define cfDEREFERENCE4 ****
+#define cfDEREFERENCE5 *****
+#define cfelementsof(A,D) (sizeof(A)/sizeof(_(cfDEREFERENCE,D)(A)))
+
+/*-------------------------------------------------------------------------*/
+
+/*               UTILITIES FOR C TO CALL FORTRAN SUBROUTINES               */
+
+/* Define lookup tables for how to handle the various types of variables.  */
+
+#ifdef OLD_VAXC                                /* Prevent %CC-I-PARAMNOTUSED. */
+#pragma nostandard
+#endif
+
+#define ZTRINGV_NUM(I)       I
+#define ZTRINGV_ARGFP(I) (*(_2(A,I))) /* Undocumented. For PINT, etc. */
+#define ZTRINGV_ARGF(I) _2(A,I)
+#ifdef CFSUBASFUN
+#define ZTRINGV_ARGS(I) ZTRINGV_ARGF(I)
+#else
+#define ZTRINGV_ARGS(I) _2(B,I)
+#endif
+
+#define    PBYTE_cfVP(A,B) PINT_cfVP(A,B)
+#define  PDOUBLE_cfVP(A,B)
+#define   PFLOAT_cfVP(A,B)
+#ifdef ZTRINGV_ARGS_allows_Pvariables
+/* This allows Pvariables for ARGS. ARGF machinery is above ARGFP.
+ * B is not needed because the variable may be changed by the Fortran routine,
+ * but because B is the only way to access an arbitrary macro argument.       */
+#define     PINT_cfVP(A,B) int  B = (int)A;              /* For ZSTRINGV_ARGS */
+#else
+#define     PINT_cfVP(A,B)
+#endif
+#define PLOGICAL_cfVP(A,B) int *B;      /* Returning LOGICAL in FUNn and SUBn */
+#define    PLONG_cfVP(A,B) PINT_cfVP(A,B)
+#define   PSHORT_cfVP(A,B) PINT_cfVP(A,B)
+
+#define        VCF_INT_S(T,A,B) _(T,VVVVVVV_cfTYPE) B = A;
+#define        VCF_INT_F(T,A,B) _(T,_cfVCF)(A,B)
+/* _cfVCF table is directly mapped to _cfCCC table. */
+#define     BYTE_cfVCF(A,B)
+#define   DOUBLE_cfVCF(A,B)
+#if !defined(__CF__KnR)
+#define    FLOAT_cfVCF(A,B)
+#else
+#define    FLOAT_cfVCF(A,B) FORTRAN_REAL B = A;
+#endif
+#define      INT_cfVCF(A,B)
+#define  LOGICAL_cfVCF(A,B)
+#define     LONG_cfVCF(A,B)
+#define    SHORT_cfVCF(A,B)
+
+/* 980416
+   Cast (void (*)(CF_NULL_PROTO)) causes SunOS CC 4.2 occasionally to barf,
+   while the following equivalent typedef is fine.
+   For consistency use the typedef on all machines.
+ */
+typedef void (*cfCAST_FUNCTION)(CF_NULL_PROTO);
+
+#define VCF(TN,I)       _Icf4(4,V,TN,_(A,I),_(B,I),F)
+#define VVCF(TN,AI,BI)  _Icf4(4,V,TN,AI,BI,S)
+#define        INT_cfV(T,A,B,F) _(VCF_INT_,F)(T,A,B)
+#define       INTV_cfV(T,A,B,F)
+#define      INTVV_cfV(T,A,B,F)
+#define     INTVVV_cfV(T,A,B,F)
+#define    INTVVVV_cfV(T,A,B,F)
+#define   INTVVVVV_cfV(T,A,B,F)
+#define  INTVVVVVV_cfV(T,A,B,F)
+#define INTVVVVVVV_cfV(T,A,B,F)
+#define PINT_cfV(      T,A,B,F) _(T,_cfVP)(A,B)
+#define PVOID_cfV(     T,A,B,F)
+#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
+#define    ROUTINE_cfV(T,A,B,F) void (*B)(CF_NULL_PROTO) = (cfCAST_FUNCTION)A;
+#else
+#define    ROUTINE_cfV(T,A,B,F)
+#endif
+#define     SIMPLE_cfV(T,A,B,F)
+#ifdef vmsFortran
+#define     STRING_cfV(T,A,B,F) static struct {fstring f; unsigned clen;} B =  \
+                                       {{0,DSC$K_DTYPE_T,DSC$K_CLASS_S,NULL},0};
+#define    PSTRING_cfV(T,A,B,F) static fstring B={0,DSC$K_DTYPE_T,DSC$K_CLASS_S,NULL};
+#define    STRINGV_cfV(T,A,B,F) static fstringvector B =                       \
+  {sizeof(A),DSC$K_DTYPE_T,DSC$K_CLASS_A,NULL,0,0,{0,0,1,1,1},1,0,NULL,0,{1,0}};
+#define   PSTRINGV_cfV(T,A,B,F) static fstringvector B =                       \
+          {0,DSC$K_DTYPE_T,DSC$K_CLASS_A,NULL,0,0,{0,0,1,1,1},1,0,NULL,0,{1,0}};
+#else
+#define     STRING_cfV(T,A,B,F) struct {unsigned int clen, flen;} B;
+#define    STRINGV_cfV(T,A,B,F) struct {char *s, *fs; unsigned flen;} B;
+#define    PSTRING_cfV(T,A,B,F) int     B;
+#define   PSTRINGV_cfV(T,A,B,F) struct{char *fs; unsigned int sizeofA,flen;}B;
+#endif
+#define    ZTRINGV_cfV(T,A,B,F)  STRINGV_cfV(T,A,B,F)
+#define   PZTRINGV_cfV(T,A,B,F) PSTRINGV_cfV(T,A,B,F)
+
+/* Note that the actions of the A table were performed inside the AA table.
+   VAX Ultrix vcc, and HP-UX cc, didn't evaluate arguments to functions left to
+   right, so we had to split the original table into the current robust two. */
+#define ACF(NAME,TN,AI,I)      _(TN,_cfSTR)(4,A,NAME,I,AI,_(B,I),0)
+#define   DEFAULT_cfA(M,I,A,B)
+#define   LOGICAL_cfA(M,I,A,B) B=C2FLOGICAL(B);
+#define  PLOGICAL_cfA(M,I,A,B) A=C2FLOGICAL(A);
+#define    STRING_cfA(M,I,A,B)  STRING_cfC(M,I,A,B,sizeof(A))
+#define   PSTRING_cfA(M,I,A,B) PSTRING_cfC(M,I,A,B,sizeof(A))
+#ifdef vmsFortran
+#define  AATRINGV_cfA(    A,B, sA,filA,silA)                                   \
+ initfstr(B,_cf_malloc((sA)-(filA)),(filA),(silA)-1),                          \
+          c2fstrv(A,B.dsc$a_pointer,(silA),(sA));
+#define APATRINGV_cfA(    A,B, sA,filA,silA)                                   \
+ initfstr(B,A,(filA),(silA)-1),c2fstrv(A,A,(silA),(sA));
+#else
+#define  AATRINGV_cfA(    A,B, sA,filA,silA)                                   \
+     (B.s=_cf_malloc((sA)-(filA)),B.fs=c2fstrv(A,B.s,(B.flen=(silA)-1)+1,(sA)));
+#define APATRINGV_cfA(    A,B, sA,filA,silA)                                   \
+ B.fs=c2fstrv(A,A,(B.flen=(silA)-1)+1,B.sizeofA=(sA));
+#endif
+#define   STRINGV_cfA(M,I,A,B)                                                 \
+    AATRINGV_cfA((char *)A,B,sizeof(A),firstindexlength(A),secondindexlength(A))
+#define  PSTRINGV_cfA(M,I,A,B)                                                 \
+   APATRINGV_cfA((char *)A,B,sizeof(A),firstindexlength(A),secondindexlength(A))
+#define   ZTRINGV_cfA(M,I,A,B)  AATRINGV_cfA( (char *)A,B,                     \
+                    (_3(M,_ELEMS_,I))*(( _3(M,_ELEMLEN_,I))+1),                \
+                              (_3(M,_ELEMS_,I)),(_3(M,_ELEMLEN_,I))+1)
+#define  PZTRINGV_cfA(M,I,A,B) APATRINGV_cfA( (char *)A,B,                     \
+                    (_3(M,_ELEMS_,I))*(( _3(M,_ELEMLEN_,I))+1),                \
+                              (_3(M,_ELEMS_,I)),(_3(M,_ELEMLEN_,I))+1)
+
+#define    PBYTE_cfAAP(A,B) &A
+#define  PDOUBLE_cfAAP(A,B) &A
+#define   PFLOAT_cfAAP(A,B) FLOATVVVVVVV_cfPP &A
+#define     PINT_cfAAP(A,B) &A
+#define PLOGICAL_cfAAP(A,B) B= &A         /* B used to keep a common W table. */
+#define    PLONG_cfAAP(A,B) &A
+#define   PSHORT_cfAAP(A,B) &A
+
+#define AACF(TN,AI,I,C) _SEP_(TN,C,cfCOMMA) _Icf(3,AA,TN,AI,_(B,I))
+#define        INT_cfAA(T,A,B) &B
+#define       INTV_cfAA(T,A,B) _(T,VVVVVV_cfPP) A
+#define      INTVV_cfAA(T,A,B) _(T,VVVVV_cfPP)  A[0]
+#define     INTVVV_cfAA(T,A,B) _(T,VVVV_cfPP)   A[0][0]
+#define    INTVVVV_cfAA(T,A,B) _(T,VVV_cfPP)    A[0][0][0]
+#define   INTVVVVV_cfAA(T,A,B) _(T,VV_cfPP)     A[0][0][0][0]
+#define  INTVVVVVV_cfAA(T,A,B) _(T,V_cfPP)      A[0][0][0][0][0]
+#define INTVVVVVVV_cfAA(T,A,B) _(T,_cfPP)       A[0][0][0][0][0][0]
+#define       PINT_cfAA(T,A,B) _(T,_cfAAP)(A,B)
+#define      PVOID_cfAA(T,A,B) (void *) A
+#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran)
+#define    ROUTINE_cfAA(T,A,B) &B
+#else
+#define    ROUTINE_cfAA(T,A,B) (cfCAST_FUNCTION)A
+#endif
+#define     STRING_cfAA(T,A,B)  STRING_cfCC(T,A,B)
+#define    PSTRING_cfAA(T,A,B) PSTRING_cfCC(T,A,B)
+#ifdef vmsFortran
+#define    STRINGV_cfAA(T,A,B) &B
+#else
+#ifdef CRAYFortran
+#define    STRINGV_cfAA(T,A,B) _cptofcd(B.fs,B.flen)
+#else
+#define    STRINGV_cfAA(T,A,B) B.fs
+#endif
+#endif
+#define   PSTRINGV_cfAA(T,A,B) STRINGV_cfAA(T,A,B)
+#define    ZTRINGV_cfAA(T,A,B) STRINGV_cfAA(T,A,B)
+#define   PZTRINGV_cfAA(T,A,B) STRINGV_cfAA(T,A,B)
+
+#if defined(vmsFortran) || defined(CRAYFortran)
+#define JCF(TN,I)
+#define KCF(TN,I)
+#else
+#define JCF(TN,I)    _(TN,_cfSTR)(1,J,_(B,I), 0,0,0,0)
+#if defined(AbsoftUNIXFortran)
+#define  DEFAULT_cfJ(B) ,0
+#else
+#define  DEFAULT_cfJ(B)
+#endif
+#define  LOGICAL_cfJ(B) DEFAULT_cfJ(B)
+#define PLOGICAL_cfJ(B) DEFAULT_cfJ(B)
+#define   STRING_cfJ(B) ,B.flen
+#define  PSTRING_cfJ(B) ,B
+#define  STRINGV_cfJ(B) STRING_cfJ(B)
+#define PSTRINGV_cfJ(B) STRING_cfJ(B)
+#define  ZTRINGV_cfJ(B) STRING_cfJ(B)
+#define PZTRINGV_cfJ(B) STRING_cfJ(B)
+
+/* KCF is identical to DCF, except that KCF ZTRING is not empty. */
+#define KCF(TN,I)    _(TN,_cfSTR)(1,KK,_(B,I), 0,0,0,0)
+#if defined(AbsoftUNIXFortran)
+#define  DEFAULT_cfKK(B) , unsigned B
+#else
+#define  DEFAULT_cfKK(B)
+#endif
+#define  LOGICAL_cfKK(B) DEFAULT_cfKK(B)
+#define PLOGICAL_cfKK(B) DEFAULT_cfKK(B)
+#define   STRING_cfKK(B) , unsigned B
+#define  PSTRING_cfKK(B) STRING_cfKK(B)
+#define  STRINGV_cfKK(B) STRING_cfKK(B)
+#define PSTRINGV_cfKK(B) STRING_cfKK(B)
+#define  ZTRINGV_cfKK(B) STRING_cfKK(B)
+#define PZTRINGV_cfKK(B) STRING_cfKK(B)
+#endif
+
+#define WCF(TN,AN,I)      _(TN,_cfSTR)(2,W,AN,_(B,I), 0,0,0)
+#define  DEFAULT_cfW(A,B)
+#define  LOGICAL_cfW(A,B)
+#define PLOGICAL_cfW(A,B) *B=F2CLOGICAL(*B);
+#define   STRING_cfW(A,B) (A[B.clen]!='\0'?A[B.clen]='\0':0); /* A?="constnt"*/
+#define  PSTRING_cfW(A,B) kill_trailing(A,' ');
+#ifdef vmsFortran
+#define  STRINGV_cfW(A,B) _cf_free(B.dsc$a_pointer);
+#define PSTRINGV_cfW(A,B)                                                      \
+  vkill_trailing(f2cstrv((char*)A, (char*)A,                                   \
+                           B.dsc$w_length+1, B.dsc$l_arsize+B.dsc$l_m[0]),     \
+                   B.dsc$w_length+1, B.dsc$l_arsize+B.dsc$l_m[0], ' ');
+#else
+#define  STRINGV_cfW(A,B) _cf_free(B.s);
+#define PSTRINGV_cfW(A,B) vkill_trailing(                                      \
+         f2cstrv((char*)A,(char*)A,B.flen+1,B.sizeofA), B.flen+1,B.sizeofA,' ');
+#endif
+#define  ZTRINGV_cfW(A,B)      STRINGV_cfW(A,B)
+#define PZTRINGV_cfW(A,B)     PSTRINGV_cfW(A,B)
+
+#define   NCF(TN,I,C)       _SEP_(TN,C,cfCOMMA) _Icf(2,N,TN,_(A,I),0) 
+#define  NNCF(TN,I,C)        UUCF(TN,I,C)
+#define NNNCF(TN,I,C)       _SEP_(TN,C,cfCOLON) _Icf(2,N,TN,_(A,I),0) 
+#define        INT_cfN(T,A) _(T,VVVVVVV_cfTYPE) * A
+#define       INTV_cfN(T,A) _(T,VVVVVV_cfTYPE)  * A
+#define      INTVV_cfN(T,A) _(T,VVVVV_cfTYPE)   * A
+#define     INTVVV_cfN(T,A) _(T,VVVV_cfTYPE)    * A
+#define    INTVVVV_cfN(T,A) _(T,VVV_cfTYPE)     * A
+#define   INTVVVVV_cfN(T,A) _(T,VV_cfTYPE)      * A
+#define  INTVVVVVV_cfN(T,A) _(T,V_cfTYPE)       * A
+#define INTVVVVVVV_cfN(T,A) _(T,_cfTYPE)        * A
+#define       PINT_cfN(T,A) _(T,_cfTYPE)        * A
+#define      PVOID_cfN(T,A) void *                A
+#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran)
+#define    ROUTINE_cfN(T,A) void (**A)(CF_NULL_PROTO)
+#else
+#define    ROUTINE_cfN(T,A) void ( *A)(CF_NULL_PROTO)
+#endif
+#ifdef vmsFortran
+#define     STRING_cfN(T,A) fstring *             A
+#define    STRINGV_cfN(T,A) fstringvector *       A
+#else
+#ifdef CRAYFortran
+#define     STRING_cfN(T,A) _fcd                  A
+#define    STRINGV_cfN(T,A) _fcd                  A
+#else
+#define     STRING_cfN(T,A) char *                A
+#define    STRINGV_cfN(T,A) char *                A
+#endif
+#endif
+#define    PSTRING_cfN(T,A)   STRING_cfN(T,A) /* CRAY insists on arg.'s here. */
+#define   PNSTRING_cfN(T,A)   STRING_cfN(T,A) /* CRAY insists on arg.'s here. */
+#define   PPSTRING_cfN(T,A)   STRING_cfN(T,A) /* CRAY insists on arg.'s here. */
+#define   PSTRINGV_cfN(T,A)  STRINGV_cfN(T,A)
+#define    ZTRINGV_cfN(T,A)  STRINGV_cfN(T,A)
+#define   PZTRINGV_cfN(T,A) PSTRINGV_cfN(T,A)
+
+
+/* Apollo 6.7, CRAY, old Sun, VAX/Ultrix vcc/cc and new ultrix
+   can't hack more than 31 arg's.
+   e.g. ultrix >= 4.3 gives message:
+       zow35> cc -c -DDECFortran cfortest.c
+       cfe: Fatal: Out of memory: cfortest.c
+       zow35>
+   Old __hpux had the problem, but new 'HP-UX A.09.03 A 9000/735' is fine
+   if using -Aa, otherwise we have a problem.
+ */
+#ifndef MAX_PREPRO_ARGS
+#if !defined(__GNUC__) && (defined(VAXUltrix) || defined(__CF__APOLLO67) || (defined(sun)&&!defined(__sun)) || defined(_CRAY) || defined(__ultrix__) || (defined(__hpux)&&defined(__CF__KnR)))
+#define MAX_PREPRO_ARGS 31
+#else
+#define MAX_PREPRO_ARGS 99
+#endif
+#endif
+
+#if defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
+/* In addition to explicit Absoft stuff, only Absoft requires:
+   - DEFAULT coming from _cfSTR.
+     DEFAULT could have been called e.g. INT, but keep it for clarity.
+   - M term in CFARGT14 and CFARGT14FS.
+ */
+#define ABSOFT_cf1(T0) _(T0,_cfSTR)(0,ABSOFT1,0,0,0,0,0)
+#define ABSOFT_cf2(T0) _(T0,_cfSTR)(0,ABSOFT2,0,0,0,0,0)
+#define ABSOFT_cf3(T0) _(T0,_cfSTR)(0,ABSOFT3,0,0,0,0,0)
+#define DEFAULT_cfABSOFT1
+#define LOGICAL_cfABSOFT1
+#define  STRING_cfABSOFT1 ,MAX_LEN_FORTRAN_FUNCTION_STRING
+#define DEFAULT_cfABSOFT2
+#define LOGICAL_cfABSOFT2
+#define  STRING_cfABSOFT2 ,unsigned D0
+#define DEFAULT_cfABSOFT3
+#define LOGICAL_cfABSOFT3
+#define  STRING_cfABSOFT3 ,D0
+#else
+#define ABSOFT_cf1(T0)
+#define ABSOFT_cf2(T0)
+#define ABSOFT_cf3(T0)
+#endif
+
+/* _Z introduced to cicumvent IBM and HP silly preprocessor warning.
+   e.g. "Macro CFARGT14 invoked with a null argument."
+ */
+#define _Z
+
+#define  CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)                \
+ S(T1,1)   S(T2,2)   S(T3,3)    S(T4,4)    S(T5,5)    S(T6,6)    S(T7,7)       \
+ S(T8,8)   S(T9,9)   S(TA,10)   S(TB,11)   S(TC,12)   S(TD,13)   S(TE,14)
+#define  CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ S(T1,1)   S(T2,2)   S(T3,3)    S(T4,4)    S(T5,5)    S(T6,6)    S(T7,7)       \
+ S(T8,8)   S(T9,9)   S(TA,10)   S(TB,11)   S(TC,12)   S(TD,13)   S(TE,14)      \
+ S(TF,15)  S(TG,16)  S(TH,17)   S(TI,18)   S(TJ,19)   S(TK,20)   S(TL,21)      \
+ S(TM,22)  S(TN,23)  S(TO,24)   S(TP,25)   S(TQ,26)   S(TR,27)
+
+#define  CFARGT14FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)           \
+ F(T1,1,0) F(T2,2,1) F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)     \
+ F(T8,8,1) F(T9,9,1) F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)    \
+ M       CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define  CFARGT27FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ F(T1,1,0)  F(T2,2,1)  F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)   \
+ F(T8,8,1)  F(T9,9,1)  F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)  \
+ F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1) F(TL,21,1)  \
+ F(TM,22,1) F(TN,23,1) F(TO,24,1) F(TP,25,1) F(TQ,26,1) F(TR,27,1)             \
+ M       CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+
+#if !(defined(PowerStationFortran)||defined(hpuxFortran800))
+/*  Old CFARGT14 -> CFARGT14FS as seen below, for Absoft cross-compile yields:
+      SunOS> cc -c -Xa -DAbsoftUNIXFortran c.c
+      "c.c", line 406: warning: argument mismatch
+    Haven't checked if this is ANSI C or a SunOS bug. SunOS -Xs works ok.
+    Behavior is most clearly seen in example:
+      #define A 1 , 2
+      #define  C(X,Y,Z) x=X. y=Y. z=Z.
+      #define  D(X,Y,Z) C(X,Y,Z)
+      D(x,A,z)
+    Output from preprocessor is: x = x . y = 1 . z = 2 .
+ #define CFARGT14(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
+       CFARGT14FS(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+*/
+#define  CFARGT14(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)             \
+ F(T1,1,0) F(T2,2,1) F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)     \
+ F(T8,8,1) F(T9,9,1) F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)    \
+ M       CFARGT14S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define  CFARGT27(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ F(T1,1,0)  F(T2,2,1)  F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)   \
+ F(T8,8,1)  F(T9,9,1)  F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)  \
+ F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1) F(TL,21,1)  \
+ F(TM,22,1) F(TN,23,1) F(TO,24,1) F(TP,25,1) F(TQ,26,1) F(TR,27,1)             \
+ M       CFARGT27S(S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+
+#define  CFARGT20(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+ F(T1,1,0)  F(T2,2,1)  F(T3,3,1)  F(T4,4,1)  F(T5,5,1)  F(T6,6,1)  F(T7,7,1)   \
+ F(T8,8,1)  F(T9,9,1)  F(TA,10,1) F(TB,11,1) F(TC,12,1) F(TD,13,1) F(TE,14,1)  \
+ F(TF,15,1) F(TG,16,1) F(TH,17,1) F(TI,18,1) F(TJ,19,1) F(TK,20,1)             \
+ S(T1,1)    S(T2,2)    S(T3,3)    S(T4,4)    S(T5,5)    S(T6,6)    S(T7,7)     \
+ S(T8,8)    S(T9,9)    S(TA,10)   S(TB,11)   S(TC,12)   S(TD,13)   S(TE,14)    \
+ S(TF,15)   S(TG,16)   S(TH,17)   S(TI,18)   S(TJ,19)   S(TK,20)
+#define CFARGTA14(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) \
+ F(T1,A1,1,0)  F(T2,A2,2,1)  F(T3,A3,3,1) F(T4,A4,4,1)  F(T5,A5,5,1)  F(T6,A6,6,1)  \
+ F(T7,A7,7,1)  F(T8,A8,8,1)  F(T9,A9,9,1) F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \
+ F(TD,AD,13,1) F(TE,AE,14,1) S(T1,1)      S(T2,2)       S(T3,3)       S(T4,4)       \
+ S(T5,5)       S(T6,6)       S(T7,7)      S(T8,8)       S(T9,9)       S(TA,10)      \
+ S(TB,11)      S(TC,12)      S(TD,13)     S(TE,14)
+#if MAX_PREPRO_ARGS>31
+#define CFARGTA20(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
+ F(T1,A1,1,0)  F(T2,A2,2,1)  F(T3,A3,3,1)  F(T4,A4,4,1)  F(T5,A5,5,1)  F(T6,A6,6,1)  \
+ F(T7,A7,7,1)  F(T8,A8,8,1)  F(T9,A9,9,1)  F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \
+ F(TD,AD,13,1) F(TE,AE,14,1) F(TF,AF,15,1) F(TG,AG,16,1) F(TH,AH,17,1) F(TI,AI,18,1) \
+ F(TJ,AJ,19,1) F(TK,AK,20,1) S(T1,1)       S(T2,2)       S(T3,3)       S(T4,4)       \
+ S(T5,5)       S(T6,6)       S(T7,7)       S(T8,8)       S(T9,9)       S(TA,10)      \
+ S(TB,11)      S(TC,12)      S(TD,13)      S(TE,14)      S(TF,15)      S(TG,16)      \
+ S(TH,17)      S(TI,18)      S(TJ,19)      S(TK,20)
+#define CFARGTA27(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+ F(T1,A1,1,0)  F(T2,A2,2,1)  F(T3,A3,3,1)  F(T4,A4,4,1)  F(T5,A5,5,1)  F(T6,A6,6,1)  \
+ F(T7,A7,7,1)  F(T8,A8,8,1)  F(T9,A9,9,1)  F(TA,AA,10,1) F(TB,AB,11,1) F(TC,AC,12,1) \
+ F(TD,AD,13,1) F(TE,AE,14,1) F(TF,AF,15,1) F(TG,AG,16,1) F(TH,AH,17,1) F(TI,AI,18,1) \
+ F(TJ,AJ,19,1) F(TK,AK,20,1) F(TL,AL,21,1) F(TM,AM,22,1) F(TN,AN,23,1) F(TO,AO,24,1) \
+ F(TP,AP,25,1) F(TQ,AQ,26,1) F(TR,AR,27,1) S(T1,1)       S(T2,2)       S(T3,3)       \
+ S(T4,4)       S(T5,5)       S(T6,6)       S(T7,7)       S(T8,8)       S(T9,9)       \
+ S(TA,10)      S(TB,11)      S(TC,12)      S(TD,13)      S(TE,14)      S(TF,15)      \
+ S(TG,16)      S(TH,17)      S(TI,18)      S(TJ,19)      S(TK,20)      S(TL,21)      \
+ S(TM,22)      S(TN,23)      S(TO,24)      S(TP,25)      S(TQ,26)      S(TR,27)
+#endif
+#else
+#define  CFARGT14(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)             \
+ F(T1,1,0) S(T1,1) F(T2,2,1)  S(T2,2)  F(T3,3,1)  S(T3,3)  F(T4,4,1)  S(T4,4)  \
+ F(T5,5,1) S(T5,5) F(T6,6,1)  S(T6,6)  F(T7,7,1)  S(T7,7)  F(T8,8,1)  S(T8,8)  \
+ F(T9,9,1) S(T9,9) F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \
+ F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14)
+#define  CFARGT27(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+ F(T1,1,0)  S(T1,1)  F(T2,2,1)  S(T2,2)  F(T3,3,1)  S(T3,3)  F(T4,4,1)  S(T4,4)  \
+ F(T5,5,1)  S(T5,5)  F(T6,6,1)  S(T6,6)  F(T7,7,1)  S(T7,7)  F(T8,8,1)  S(T8,8)  \
+ F(T9,9,1)  S(T9,9)  F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \
+ F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14) F(TF,15,1) S(TF,15) F(TG,16,1) S(TG,16) \
+ F(TH,17,1) S(TH,17) F(TI,18,1) S(TI,18) F(TJ,19,1) S(TJ,19) F(TK,20,1) S(TK,20) \
+ F(TL,21,1) S(TL,21) F(TM,22,1) S(TM,22) F(TN,23,1) S(TN,23) F(TO,24,1) S(TO,24) \
+ F(TP,25,1) S(TP,25) F(TQ,26,1) S(TQ,26) F(TR,27,1) S(TR,27)
+
+#define  CFARGT20(F,S,M,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+ F(T1,1,0)  S(T1,1)  F(T2,2,1)  S(T2,2)  F(T3,3,1)  S(T3,3)  F(T4,4,1)  S(T4,4)  \
+ F(T5,5,1)  S(T5,5)  F(T6,6,1)  S(T6,6)  F(T7,7,1)  S(T7,7)  F(T8,8,1)  S(T8,8)  \
+ F(T9,9,1)  S(T9,9)  F(TA,10,1) S(TA,10) F(TB,11,1) S(TB,11) F(TC,12,1) S(TC,12) \
+ F(TD,13,1) S(TD,13) F(TE,14,1) S(TE,14) F(TF,15,1) S(TF,15) F(TG,16,1) S(TG,16) \
+ F(TH,17,1) S(TH,17) F(TI,18,1) S(TI,18) F(TJ,19,1) S(TJ,19) F(TK,20,1) S(TK,20)
+#define CFARGTA14(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) \
+ F(T1,A1,1,0)  S(T1,1)  F(T2,A2,2,1)  S(T2,2)  F(T3,A3,3,1)  S(T3,3)           \
+ F(T4,A4,4,1)  S(T4,4)  F(T5,A5,5,1)  S(T5,5)  F(T6,A6,6,1)  S(T6,6)           \
+ F(T7,A7,7,1)  S(T7,7)  F(T8,A8,8,1)  S(T8,8)  F(T9,A9,9,1)  S(T9,9)           \
+ F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12)          \
+ F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14)
+#if MAX_PREPRO_ARGS>31
+#define CFARGTA20(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
+ F(T1,A1,1,0)  S(T1,1)  F(T2,A2,2,1)  S(T2,2)  F(T3,A3,3,1)  S(T3,3)           \
+ F(T4,A4,4,1)  S(T4,4)  F(T5,A5,5,1)  S(T5,5)  F(T6,A6,6,1)  S(T6,6)           \
+ F(T7,A7,7,1)  S(T7,7)  F(T8,A8,8,1)  S(T8,8)  F(T9,A9,9,1)  S(T9,9)           \
+ F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12)          \
+ F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14) F(TF,AF,15,1) S(TF,15)          \
+ F(TG,AG,16,1) S(TG,16) F(TH,AH,17,1) S(TH,17) F(TI,AI,18,1) S(TI,18)          \
+ F(TJ,AJ,19,1) S(TJ,19) F(TK,AK,20,1) S(TK,20)                
+#define CFARGTA27(F,S,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+ F(T1,A1,1,0)  S(T1,1)  F(T2,A2,2,1)  S(T2,2)  F(T3,A3,3,1)  S(T3,3)           \
+ F(T4,A4,4,1)  S(T4,4)  F(T5,A5,5,1)  S(T5,5)  F(T6,A6,6,1)  S(T6,6)           \
+ F(T7,A7,7,1)  S(T7,7)  F(T8,A8,8,1)  S(T8,8)  F(T9,A9,9,1)  S(T9,9)           \
+ F(TA,AA,10,1) S(TA,10) F(TB,AB,11,1) S(TB,11) F(TC,AC,12,1) S(TC,12)          \
+ F(TD,AD,13,1) S(TD,13) F(TE,AE,14,1) S(TE,14) F(TF,AF,15,1) S(TF,15)          \
+ F(TG,AG,16,1) S(TG,16) F(TH,AH,17,1) S(TH,17) F(TI,AI,18,1) S(TI,18)          \
+ F(TJ,AJ,19,1) S(TJ,19) F(TK,AK,20,1) S(TK,20) F(TL,AL,21,1) S(TL,21)          \
+ F(TM,AM,22,1) S(TM,22) F(TN,AN,23,1) S(TN,23) F(TO,AO,24,1) S(TO,24)          \
+ F(TP,AP,25,1) S(TP,25) F(TQ,AQ,26,1) S(TQ,26) F(TR,AR,27,1) S(TR,27)
+#endif
+#endif
+
+
+#define PROTOCCALLSFSUB1( UN,LN,T1) \
+        PROTOCCALLSFSUB14(UN,LN,T1,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB2( UN,LN,T1,T2) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB3( UN,LN,T1,T2,T3) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB4( UN,LN,T1,T2,T3,T4) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB5( UN,LN,T1,T2,T3,T4,T5) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB6( UN,LN,T1,T2,T3,T4,T5,T6) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB7( UN,LN,T1,T2,T3,T4,T5,T6,T7) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB8( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB9( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB11(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB12(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0)
+#define PROTOCCALLSFSUB13(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0)
+
+
+#define PROTOCCALLSFSUB15(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB16(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB17(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB18(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,CF_0,CF_0)
+#define PROTOCCALLSFSUB19(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,CF_0)
+
+#define PROTOCCALLSFSUB21(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB22(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB23(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB24(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFSUB25(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0)
+#define PROTOCCALLSFSUB26(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0)
+
+
+#ifndef FCALLSC_QUALIFIER
+#ifdef VISUAL_CPLUSPLUS
+#define FCALLSC_QUALIFIER __stdcall
+#else
+#define FCALLSC_QUALIFIER
+#endif
+#endif
+
+#ifdef __cplusplus
+#define CFextern extern "C"
+#else
+#define CFextern extern
+#endif
+
+
+#ifdef CFSUBASFUN
+#define PROTOCCALLSFSUB0(UN,LN) \
+   PROTOCCALLSFFUN0( VOID,UN,LN)
+#define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
+   PROTOCCALLSFFUN14(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)\
+   PROTOCCALLSFFUN20(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)\
+   PROTOCCALLSFFUN27(VOID,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+#else
+/* Note: Prevent compiler warnings, null #define PROTOCCALLSFSUB14/20 after 
+   #include-ing cfortran.h if calling the FORTRAN wrapper within the same 
+   source code where the wrapper is created. */
+#define PROTOCCALLSFSUB0(UN,LN)     _(VOID,_cfPU)(CFC_(UN,LN))();
+#ifndef __CF__KnR
+#define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
+ _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT14(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) );
+#define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)\
+ _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT20(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) );
+#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)\
+ _(VOID,_cfPU)(CFC_(UN,LN))( CFARGT27(NCF,KCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) );
+#else
+#define PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)     \
+         PROTOCCALLSFSUB0(UN,LN)
+#define PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+         PROTOCCALLSFSUB0(UN,LN)
+#define PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+         PROTOCCALLSFSUB0(UN,LN)
+#endif
+#endif
+
+
+#ifdef OLD_VAXC                                  /* Allow %CC-I-PARAMNOTUSED. */
+#pragma standard
+#endif
+
+
+#define CCALLSFSUB1( UN,LN,T1,                        A1)         \
+        CCALLSFSUB5 (UN,LN,T1,CF_0,CF_0,CF_0,CF_0,A1,0,0,0,0)
+#define CCALLSFSUB2( UN,LN,T1,T2,                     A1,A2)      \
+        CCALLSFSUB5 (UN,LN,T1,T2,CF_0,CF_0,CF_0,A1,A2,0,0,0)
+#define CCALLSFSUB3( UN,LN,T1,T2,T3,                  A1,A2,A3)   \
+        CCALLSFSUB5 (UN,LN,T1,T2,T3,CF_0,CF_0,A1,A2,A3,0,0)
+#define CCALLSFSUB4( UN,LN,T1,T2,T3,T4,               A1,A2,A3,A4)\
+        CCALLSFSUB5 (UN,LN,T1,T2,T3,T4,CF_0,A1,A2,A3,A4,0)
+#define CCALLSFSUB5( UN,LN,T1,T2,T3,T4,T5,            A1,A2,A3,A4,A5)          \
+        CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,0,0,0,0,0)
+#define CCALLSFSUB6( UN,LN,T1,T2,T3,T4,T5,T6,         A1,A2,A3,A4,A5,A6)       \
+        CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,0,0,0,0)
+#define CCALLSFSUB7( UN,LN,T1,T2,T3,T4,T5,T6,T7,      A1,A2,A3,A4,A5,A6,A7)    \
+        CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,0,0,0)
+#define CCALLSFSUB8( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,   A1,A2,A3,A4,A5,A6,A7,A8) \
+        CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,0,0)
+#define CCALLSFSUB9( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,A1,A2,A3,A4,A5,A6,A7,A8,A9)\
+        CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,0)
+#define CCALLSFSUB10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA)\
+        CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,0,0,0,0)
+#define CCALLSFSUB11(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB)\
+        CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,0,0,0)
+#define CCALLSFSUB12(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC)\
+        CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,0,0)
+#define CCALLSFSUB13(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD)\
+        CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,0)
+
+#ifdef __cplusplus
+#define CPPPROTOCLSFSUB0( UN,LN)
+#define CPPPROTOCLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+#else
+#define CPPPROTOCLSFSUB0(UN,LN) \
+        PROTOCCALLSFSUB0(UN,LN)
+#define CPPPROTOCLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)     \
+        PROTOCCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+        PROTOCCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+        PROTOCCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+#endif
+
+#ifdef CFSUBASFUN
+#define CCALLSFSUB0(UN,LN) CCALLSFFUN0(UN,LN)
+#define CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)\
+        CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)
+#else
+/* do{...}while(0) allows if(a==b) FORT(); else BORT(); */
+#define CCALLSFSUB0( UN,LN) do{CPPPROTOCLSFSUB0(UN,LN) CFC_(UN,LN)();}while(0)
+#define CCALLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)\
+do{VVCF(T1,A1,B1) VVCF(T2,A2,B2) VVCF(T3,A3,B3) VVCF(T4,A4,B4) VVCF(T5,A5,B5)  \
+   VVCF(T6,A6,B6) VVCF(T7,A7,B7) VVCF(T8,A8,B8) VVCF(T9,A9,B9) VVCF(TA,AA,B10) \
+   VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14)             \
+   CPPPROTOCLSFSUB14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)          \
+   ACF(LN,T1,A1,1)  ACF(LN,T2,A2,2)  ACF(LN,T3,A3,3)                           \
+   ACF(LN,T4,A4,4)  ACF(LN,T5,A5,5)  ACF(LN,T6,A6,6)  ACF(LN,T7,A7,7)          \
+   ACF(LN,T8,A8,8)  ACF(LN,T9,A9,9)  ACF(LN,TA,AA,10) ACF(LN,TB,AB,11)         \
+   ACF(LN,TC,AC,12) ACF(LN,TD,AD,13) ACF(LN,TE,AE,14)                          \
+   CFC_(UN,LN)( CFARGTA14(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE) );\
+   WCF(T1,A1,1)  WCF(T2,A2,2)  WCF(T3,A3,3)  WCF(T4,A4,4)  WCF(T5,A5,5)        \
+   WCF(T6,A6,6)  WCF(T7,A7,7)  WCF(T8,A8,8)  WCF(T9,A9,9)  WCF(TA,AA,10)       \
+   WCF(TB,AB,11) WCF(TC,AC,12) WCF(TD,AD,13) WCF(TE,AE,14)      }while(0)
+#endif
+
+
+#if MAX_PREPRO_ARGS>31
+#define CCALLSFSUB15(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF)\
+        CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,0,0,0,0,0)
+#define CCALLSFSUB16(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG)\
+        CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,0,0,0,0)
+#define CCALLSFSUB17(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH)\
+        CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,0,0,0)
+#define CCALLSFSUB18(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI)\
+        CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,0,0)
+#define CCALLSFSUB19(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ)\
+        CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,0)
+
+#ifdef CFSUBASFUN
+#define CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH, \
+        TI,TJ,TK, A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
+        CCALLSFFUN20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH, \
+        TI,TJ,TK, A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK)
+#else
+#define CCALLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH, \
+        TI,TJ,TK, A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) \
+do{VVCF(T1,A1,B1)  VVCF(T2,A2,B2)  VVCF(T3,A3,B3)  VVCF(T4,A4,B4)  VVCF(T5,A5,B5)   \
+   VVCF(T6,A6,B6)  VVCF(T7,A7,B7)  VVCF(T8,A8,B8)  VVCF(T9,A9,B9)  VVCF(TA,AA,B10)  \
+   VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14) VVCF(TF,AF,B15)  \
+   VVCF(TG,AG,B16) VVCF(TH,AH,B17) VVCF(TI,AI,B18) VVCF(TJ,AJ,B19) VVCF(TK,AK,B20)  \
+   CPPPROTOCLSFSUB20(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)  \
+   ACF(LN,T1,A1,1)  ACF(LN,T2,A2,2)  ACF(LN,T3,A3,3)  ACF(LN,T4,A4,4)          \
+   ACF(LN,T5,A5,5)  ACF(LN,T6,A6,6)  ACF(LN,T7,A7,7)  ACF(LN,T8,A8,8)          \
+   ACF(LN,T9,A9,9)  ACF(LN,TA,AA,10) ACF(LN,TB,AB,11) ACF(LN,TC,AC,12)         \
+   ACF(LN,TD,AD,13) ACF(LN,TE,AE,14) ACF(LN,TF,AF,15) ACF(LN,TG,AG,16)         \
+   ACF(LN,TH,AH,17) ACF(LN,TI,AI,18) ACF(LN,TJ,AJ,19) ACF(LN,TK,AK,20)         \
+   CFC_(UN,LN)( CFARGTA20(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK) ); \
+ WCF(T1,A1,1)  WCF(T2,A2,2)  WCF(T3,A3,3)  WCF(T4,A4,4)  WCF(T5,A5,5)  WCF(T6,A6,6)  \
+ WCF(T7,A7,7)  WCF(T8,A8,8)  WCF(T9,A9,9)  WCF(TA,AA,10) WCF(TB,AB,11) WCF(TC,AC,12) \
+ WCF(TD,AD,13) WCF(TE,AE,14) WCF(TF,AF,15) WCF(TG,AG,16) WCF(TH,AH,17) WCF(TI,AI,18) \
+ WCF(TJ,AJ,19) WCF(TK,AK,20) }while(0)
+#endif
+#endif         /* MAX_PREPRO_ARGS */
+
+#if MAX_PREPRO_ARGS>31
+#define CCALLSFSUB21(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,0,0,0,0,0,0)
+#define CCALLSFSUB22(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,0,0,0,0,0)
+#define CCALLSFSUB23(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,0,0,0,0)
+#define CCALLSFSUB24(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,0,0,0)
+#define CCALLSFSUB25(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,0,0)
+#define CCALLSFSUB26(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ)\
+        CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,0)
+
+#ifdef CFSUBASFUN
+#define CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \
+                           A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+        CCALLSFFUN27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \
+                           A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR)
+#else
+#define CCALLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR, \
+                           A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) \
+do{VVCF(T1,A1,B1)  VVCF(T2,A2,B2)  VVCF(T3,A3,B3)  VVCF(T4,A4,B4)  VVCF(T5,A5,B5)   \
+   VVCF(T6,A6,B6)  VVCF(T7,A7,B7)  VVCF(T8,A8,B8)  VVCF(T9,A9,B9)  VVCF(TA,AA,B10)  \
+   VVCF(TB,AB,B11) VVCF(TC,AC,B12) VVCF(TD,AD,B13) VVCF(TE,AE,B14) VVCF(TF,AF,B15)  \
+   VVCF(TG,AG,B16) VVCF(TH,AH,B17) VVCF(TI,AI,B18) VVCF(TJ,AJ,B19) VVCF(TK,AK,B20)  \
+   VVCF(TL,AL,B21) VVCF(TM,AM,B22) VVCF(TN,AN,B23) VVCF(TO,AO,B24) VVCF(TP,AP,B25)  \
+   VVCF(TQ,AQ,B26) VVCF(TR,AR,B27)                                                  \
+   CPPPROTOCLSFSUB27(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+   ACF(LN,T1,A1,1)  ACF(LN,T2,A2,2)  ACF(LN,T3,A3,3)  ACF(LN,T4,A4,4)          \
+   ACF(LN,T5,A5,5)  ACF(LN,T6,A6,6)  ACF(LN,T7,A7,7)  ACF(LN,T8,A8,8)          \
+   ACF(LN,T9,A9,9)  ACF(LN,TA,AA,10) ACF(LN,TB,AB,11) ACF(LN,TC,AC,12)         \
+   ACF(LN,TD,AD,13) ACF(LN,TE,AE,14) ACF(LN,TF,AF,15) ACF(LN,TG,AG,16)         \
+   ACF(LN,TH,AH,17) ACF(LN,TI,AI,18) ACF(LN,TJ,AJ,19) ACF(LN,TK,AK,20)         \
+   ACF(LN,TL,AL,21) ACF(LN,TM,AM,22) ACF(LN,TN,AN,23) ACF(LN,TO,AO,24)         \
+   ACF(LN,TP,AP,25) ACF(LN,TQ,AQ,26) ACF(LN,TR,AR,27)                          \
+   CFC_(UN,LN)( CFARGTA27(AACF,JCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR,\
+                                   A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE,AF,AG,AH,AI,AJ,AK,AL,AM,AN,AO,AP,AQ,AR) ); \
+ WCF(T1,A1,1)  WCF(T2,A2,2)  WCF(T3,A3,3)  WCF(T4,A4,4)  WCF(T5,A5,5)  WCF(T6,A6,6)  \
+ WCF(T7,A7,7)  WCF(T8,A8,8)  WCF(T9,A9,9)  WCF(TA,AA,10) WCF(TB,AB,11) WCF(TC,AC,12) \
+ WCF(TD,AD,13) WCF(TE,AE,14) WCF(TF,AF,15) WCF(TG,AG,16) WCF(TH,AH,17) WCF(TI,AI,18) \
+ WCF(TJ,AJ,19) WCF(TK,AK,20) WCF(TL,AL,21) WCF(TM,AM,22) WCF(TN,AN,23) WCF(TO,AO,24) \
+ WCF(TP,AP,25) WCF(TQ,AQ,26) WCF(TR,AR,27) }while(0)
+#endif
+#endif         /* MAX_PREPRO_ARGS */
+
+/*-------------------------------------------------------------------------*/
+
+/*               UTILITIES FOR C TO CALL FORTRAN FUNCTIONS                 */
+
+/*N.B. PROTOCCALLSFFUNn(..) generates code, whether or not the FORTRAN
+  function is called. Therefore, especially for creator's of C header files
+  for large FORTRAN libraries which include many functions, to reduce
+  compile time and object code size, it may be desirable to create
+  preprocessor directives to allow users to create code for only those
+  functions which they use.                                                */
+
+/* The following defines the maximum length string that a function can return.
+   Of course it may be undefine-d and re-define-d before individual
+   PROTOCCALLSFFUNn(..) as required. It would also be nice to have this derived
+   from the individual machines' limits.                                      */
+#define MAX_LEN_FORTRAN_FUNCTION_STRING 0x4FE
+
+/* The following defines a character used by CFORTRAN.H to flag the end of a
+   string coming out of a FORTRAN routine.                                 */
+#define CFORTRAN_NON_CHAR 0x7F
+
+#ifdef OLD_VAXC                                /* Prevent %CC-I-PARAMNOTUSED. */
+#pragma nostandard
+#endif
+
+#define _SEP_(TN,C,cfCOMMA)     _(__SEP_,C)(TN,cfCOMMA)
+#define __SEP_0(TN,cfCOMMA)  
+#define __SEP_1(TN,cfCOMMA)     _Icf(2,SEP,TN,cfCOMMA,0)
+#define        INT_cfSEP(T,B) _(A,B)
+#define       INTV_cfSEP(T,B) INT_cfSEP(T,B)
+#define      INTVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define     INTVVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define    INTVVVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define   INTVVVVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define  INTVVVVVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define INTVVVVVVV_cfSEP(T,B) INT_cfSEP(T,B)
+#define       PINT_cfSEP(T,B) INT_cfSEP(T,B)
+#define      PVOID_cfSEP(T,B) INT_cfSEP(T,B)
+#define    ROUTINE_cfSEP(T,B) INT_cfSEP(T,B)
+#define     SIMPLE_cfSEP(T,B) INT_cfSEP(T,B)
+#define       VOID_cfSEP(T,B) INT_cfSEP(T,B)    /* For FORTRAN calls C subr.s.*/
+#define     STRING_cfSEP(T,B) INT_cfSEP(T,B)
+#define    STRINGV_cfSEP(T,B) INT_cfSEP(T,B)
+#define    PSTRING_cfSEP(T,B) INT_cfSEP(T,B)
+#define   PSTRINGV_cfSEP(T,B) INT_cfSEP(T,B)
+#define   PNSTRING_cfSEP(T,B) INT_cfSEP(T,B)
+#define   PPSTRING_cfSEP(T,B) INT_cfSEP(T,B)
+#define    ZTRINGV_cfSEP(T,B) INT_cfSEP(T,B)
+#define   PZTRINGV_cfSEP(T,B) INT_cfSEP(T,B)
+                         
+#if defined(SIGNED_BYTE) || !defined(UNSIGNED_BYTE)
+#ifdef OLD_VAXC
+#define INTEGER_BYTE               char    /* Old VAXC barfs on 'signed char' */
+#else
+#define INTEGER_BYTE        signed char    /* default */
+#endif
+#else
+#define INTEGER_BYTE        unsigned char
+#endif
+#define    BYTEVVVVVVV_cfTYPE INTEGER_BYTE
+#define  DOUBLEVVVVVVV_cfTYPE DOUBLE_PRECISION 
+#define   FLOATVVVVVVV_cfTYPE FORTRAN_REAL
+#define     INTVVVVVVV_cfTYPE int
+#define LOGICALVVVVVVV_cfTYPE int
+#define    LONGVVVVVVV_cfTYPE long
+#define   SHORTVVVVVVV_cfTYPE short
+#define          PBYTE_cfTYPE INTEGER_BYTE
+#define        PDOUBLE_cfTYPE DOUBLE_PRECISION 
+#define         PFLOAT_cfTYPE FORTRAN_REAL
+#define           PINT_cfTYPE int
+#define       PLOGICAL_cfTYPE int
+#define          PLONG_cfTYPE long
+#define         PSHORT_cfTYPE short
+
+#define CFARGS0(A,T,V,W,X,Y,Z) _3(T,_cf,A)
+#define CFARGS1(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V)
+#define CFARGS2(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W)
+#define CFARGS3(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W,X)
+#define CFARGS4(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W,X,Y)
+#define CFARGS5(A,T,V,W,X,Y,Z) _3(T,_cf,A)(V,W,X,Y,Z)
+
+#define  _Icf(N,T,I,X,Y)                 _(I,_cfINT)(N,T,I,X,Y,0)
+#define _Icf4(N,T,I,X,Y,Z)               _(I,_cfINT)(N,T,I,X,Y,Z)
+#define           BYTE_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define         DOUBLE_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INT,B,X,Y,Z,0)
+#define          FLOAT_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define            INT_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define        LOGICAL_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define           LONG_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define          SHORT_cfINT(N,A,B,X,Y,Z)        DOUBLE_cfINT(N,A,B,X,Y,Z)
+#define          PBYTE_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define        PDOUBLE_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,PINT,B,X,Y,Z,0)
+#define         PFLOAT_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define           PINT_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define       PLOGICAL_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define          PLONG_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define         PSHORT_cfINT(N,A,B,X,Y,Z)       PDOUBLE_cfINT(N,A,B,X,Y,Z)
+#define          BYTEV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define         BYTEVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define        BYTEVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define       BYTEVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define      BYTEVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define     BYTEVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define    BYTEVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define        DOUBLEV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTV,B,X,Y,Z,0)
+#define       DOUBLEVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVV,B,X,Y,Z,0)
+#define      DOUBLEVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVV,B,X,Y,Z,0)
+#define     DOUBLEVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVV,B,X,Y,Z,0)
+#define    DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVVV,B,X,Y,Z,0)
+#define   DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVVVV,B,X,Y,Z,0)
+#define  DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,INTVVVVVVV,B,X,Y,Z,0)
+#define         FLOATV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define        FLOATVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define       FLOATVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define      FLOATVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define     FLOATVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define    FLOATVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define   FLOATVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define           INTV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define          INTVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define         INTVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define        INTVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define       INTVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define      INTVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define     INTVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define       LOGICALV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define      LOGICALVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define     LOGICALVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define    LOGICALVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define   LOGICALVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define  LOGICALVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define LOGICALVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define          LONGV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define         LONGVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define        LONGVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define       LONGVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define      LONGVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define     LONGVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define    LONGVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define         SHORTV_cfINT(N,A,B,X,Y,Z)       DOUBLEV_cfINT(N,A,B,X,Y,Z)
+#define        SHORTVV_cfINT(N,A,B,X,Y,Z)      DOUBLEVV_cfINT(N,A,B,X,Y,Z)
+#define       SHORTVVV_cfINT(N,A,B,X,Y,Z)     DOUBLEVVV_cfINT(N,A,B,X,Y,Z)
+#define      SHORTVVVV_cfINT(N,A,B,X,Y,Z)    DOUBLEVVVV_cfINT(N,A,B,X,Y,Z)
+#define     SHORTVVVVV_cfINT(N,A,B,X,Y,Z)   DOUBLEVVVVV_cfINT(N,A,B,X,Y,Z)
+#define    SHORTVVVVVV_cfINT(N,A,B,X,Y,Z)  DOUBLEVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define   SHORTVVVVVVV_cfINT(N,A,B,X,Y,Z) DOUBLEVVVVVVV_cfINT(N,A,B,X,Y,Z)
+#define          PVOID_cfINT(N,A,B,X,Y,Z) _(CFARGS,N)(A,B,B,X,Y,Z,0)
+#define        ROUTINE_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+/*CRAY coughs on the first,
+  i.e. the usual trouble of not being able to
+  define macros to macros with arguments. 
+  New ultrix is worse, it coughs on all such uses.
+ */
+/*#define       SIMPLE_cfINT                    PVOID_cfINT*/
+#define         SIMPLE_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define           VOID_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define         STRING_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define        STRINGV_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define        PSTRING_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define       PSTRINGV_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define       PNSTRING_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define       PPSTRING_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define        ZTRINGV_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define       PZTRINGV_cfINT(N,A,B,X,Y,Z)         PVOID_cfINT(N,A,B,X,Y,Z)
+#define           CF_0_cfINT(N,A,B,X,Y,Z)
+                         
+
+#define   UCF(TN,I,C)  _SEP_(TN,C,cfCOMMA) _Icf(2,U,TN,_(A,I),0)
+#define  UUCF(TN,I,C)  _SEP_(TN,C,cfCOMMA) _SEP_(TN,1,I) 
+#define UUUCF(TN,I,C)  _SEP_(TN,C,cfCOLON) _Icf(2,U,TN,_(A,I),0)
+#define        INT_cfU(T,A) _(T,VVVVVVV_cfTYPE)   A
+#define       INTV_cfU(T,A) _(T,VVVVVV_cfTYPE)  * A
+#define      INTVV_cfU(T,A) _(T,VVVVV_cfTYPE)   * A
+#define     INTVVV_cfU(T,A) _(T,VVVV_cfTYPE)    * A
+#define    INTVVVV_cfU(T,A) _(T,VVV_cfTYPE)     * A
+#define   INTVVVVV_cfU(T,A) _(T,VV_cfTYPE)      * A
+#define  INTVVVVVV_cfU(T,A) _(T,V_cfTYPE)       * A
+#define INTVVVVVVV_cfU(T,A) _(T,_cfTYPE)        * A
+#define       PINT_cfU(T,A) _(T,_cfTYPE)        * A
+#define      PVOID_cfU(T,A) void  *A 
+#define    ROUTINE_cfU(T,A) void (*A)(CF_NULL_PROTO) 
+#define       VOID_cfU(T,A) void   A    /* Needed for C calls FORTRAN sub.s.  */
+#define     STRING_cfU(T,A) char  *A    /*            via VOID and wrapper.   */
+#define    STRINGV_cfU(T,A) char  *A
+#define    PSTRING_cfU(T,A) char  *A
+#define   PSTRINGV_cfU(T,A) char  *A
+#define    ZTRINGV_cfU(T,A) char  *A
+#define   PZTRINGV_cfU(T,A) char  *A
+
+/* VOID breaks U into U and UU. */
+#define       INT_cfUU(T,A) _(T,VVVVVVV_cfTYPE) A
+#define      VOID_cfUU(T,A)             /* Needed for FORTRAN calls C sub.s.  */
+#define    STRING_cfUU(T,A) char *A 
+
+
+#define      BYTE_cfPU(A)   CFextern INTEGER_BYTE      FCALLSC_QUALIFIER A
+#define    DOUBLE_cfPU(A)   CFextern DOUBLE_PRECISION  FCALLSC_QUALIFIER A
+#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
+#define     FLOAT_cfPU(A)   CFextern FORTRAN_REAL      FCALLSC_QUALIFIER A
+#else				   	                   
+#define     FLOAT_cfPU(A)   CFextern FLOATFUNCTIONTYPE FCALLSC_QUALIFIER A
+#endif				   	                   
+#define       INT_cfPU(A)   CFextern int   FCALLSC_QUALIFIER   A
+#define   LOGICAL_cfPU(A)   CFextern int   FCALLSC_QUALIFIER   A
+#define      LONG_cfPU(A)   CFextern long  FCALLSC_QUALIFIER   A
+#define     SHORT_cfPU(A)   CFextern short FCALLSC_QUALIFIER   A
+#define    STRING_cfPU(A)   CFextern void  FCALLSC_QUALIFIER   A
+#define      VOID_cfPU(A)   CFextern void  FCALLSC_QUALIFIER   A
+
+#define    BYTE_cfE INTEGER_BYTE     A0;
+#define  DOUBLE_cfE DOUBLE_PRECISION A0;
+#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
+#define   FLOAT_cfE FORTRAN_REAL  A0;
+#else
+#define   FLOAT_cfE FORTRAN_REAL AA0;   FLOATFUNCTIONTYPE A0;
+#endif
+#define     INT_cfE int    A0;
+#define LOGICAL_cfE int    A0;
+#define    LONG_cfE long   A0;
+#define   SHORT_cfE short  A0;
+#define    VOID_cfE
+#ifdef vmsFortran
+#define  STRING_cfE static char AA0[1+MAX_LEN_FORTRAN_FUNCTION_STRING];        \
+                       static fstring A0 =                                     \
+             {MAX_LEN_FORTRAN_FUNCTION_STRING,DSC$K_DTYPE_T,DSC$K_CLASS_S,AA0};\
+               memset(AA0, CFORTRAN_NON_CHAR, MAX_LEN_FORTRAN_FUNCTION_STRING);\
+                                    *(AA0+MAX_LEN_FORTRAN_FUNCTION_STRING)='\0';
+#else
+#ifdef CRAYFortran
+#define  STRING_cfE static char AA0[1+MAX_LEN_FORTRAN_FUNCTION_STRING];        \
+                   static _fcd A0; *(AA0+MAX_LEN_FORTRAN_FUNCTION_STRING)='\0';\
+                memset(AA0,CFORTRAN_NON_CHAR, MAX_LEN_FORTRAN_FUNCTION_STRING);\
+                            A0 = _cptofcd(AA0,MAX_LEN_FORTRAN_FUNCTION_STRING);
+#else
+/* 'cc: SC3.0.1 13 Jul 1994' barfs on char A0[0x4FE+1]; 
+ * char A0[0x4FE +1]; char A0[1+0x4FE]; are both OK.     */
+#define STRING_cfE static char A0[1+MAX_LEN_FORTRAN_FUNCTION_STRING];          \
+                       memset(A0, CFORTRAN_NON_CHAR,                           \
+                              MAX_LEN_FORTRAN_FUNCTION_STRING);                \
+                       *(A0+MAX_LEN_FORTRAN_FUNCTION_STRING)='\0';
+#endif
+#endif
+/* ESTRING must use static char. array which is guaranteed to exist after
+   function returns.                                                     */
+
+/* N.B.i) The diff. for 0 (Zero) and >=1 arguments.
+       ii)That the following create an unmatched bracket, i.e. '(', which
+          must of course be matched in the call.
+       iii)Commas must be handled very carefully                         */
+#define    INT_cfGZ(T,UN,LN) A0=CFC_(UN,LN)(
+#define   VOID_cfGZ(T,UN,LN)    CFC_(UN,LN)(
+#ifdef vmsFortran
+#define STRING_cfGZ(T,UN,LN)    CFC_(UN,LN)(&A0
+#else
+#if defined(CRAYFortran) || defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
+#define STRING_cfGZ(T,UN,LN)    CFC_(UN,LN)( A0
+#else
+#define STRING_cfGZ(T,UN,LN)    CFC_(UN,LN)( A0,MAX_LEN_FORTRAN_FUNCTION_STRING
+#endif
+#endif
+
+#define     INT_cfG(T,UN,LN)    INT_cfGZ(T,UN,LN)
+#define    VOID_cfG(T,UN,LN)   VOID_cfGZ(T,UN,LN)
+#define  STRING_cfG(T,UN,LN) STRING_cfGZ(T,UN,LN), /*, is only diff. from _cfG*/
+
+#define    BYTEVVVVVVV_cfPP
+#define     INTVVVVVVV_cfPP     /* These complement FLOATVVVVVVV_cfPP. */
+#define  DOUBLEVVVVVVV_cfPP
+#define LOGICALVVVVVVV_cfPP
+#define    LONGVVVVVVV_cfPP
+#define   SHORTVVVVVVV_cfPP
+#define          PBYTE_cfPP
+#define           PINT_cfPP
+#define        PDOUBLE_cfPP
+#define       PLOGICAL_cfPP
+#define          PLONG_cfPP
+#define         PSHORT_cfPP
+#define         PFLOAT_cfPP FLOATVVVVVVV_cfPP
+
+#define BCF(TN,AN,C)        _SEP_(TN,C,cfCOMMA) _Icf(2,B,TN,AN,0)
+#define        INT_cfB(T,A) (_(T,VVVVVVV_cfTYPE)) A
+#define       INTV_cfB(T,A)            A
+#define      INTVV_cfB(T,A)           (A)[0]
+#define     INTVVV_cfB(T,A)           (A)[0][0]
+#define    INTVVVV_cfB(T,A)           (A)[0][0][0]
+#define   INTVVVVV_cfB(T,A)           (A)[0][0][0][0]
+#define  INTVVVVVV_cfB(T,A)           (A)[0][0][0][0][0]
+#define INTVVVVVVV_cfB(T,A)           (A)[0][0][0][0][0][0]
+#define       PINT_cfB(T,A) _(T,_cfPP)&A
+#define     STRING_cfB(T,A) (char *)   A
+#define    STRINGV_cfB(T,A) (char *)   A
+#define    PSTRING_cfB(T,A) (char *)   A
+#define   PSTRINGV_cfB(T,A) (char *)   A
+#define      PVOID_cfB(T,A) (void *)   A
+#define    ROUTINE_cfB(T,A) (cfCAST_FUNCTION)A
+#define    ZTRINGV_cfB(T,A) (char *)   A
+#define   PZTRINGV_cfB(T,A) (char *)   A
+                                                              	
+#define SCF(TN,NAME,I,A)    _(TN,_cfSTR)(3,S,NAME,I,A,0,0)
+#define  DEFAULT_cfS(M,I,A)
+#define  LOGICAL_cfS(M,I,A)
+#define PLOGICAL_cfS(M,I,A)
+#define   STRING_cfS(M,I,A) ,sizeof(A)
+#define  STRINGV_cfS(M,I,A) ,( (unsigned)0xFFFF*firstindexlength(A) \
+                              +secondindexlength(A))
+#define  PSTRING_cfS(M,I,A) ,sizeof(A)
+#define PSTRINGV_cfS(M,I,A) STRINGV_cfS(M,I,A)
+#define  ZTRINGV_cfS(M,I,A)
+#define PZTRINGV_cfS(M,I,A)
+
+#define   HCF(TN,I)         _(TN,_cfSTR)(3,H,cfCOMMA, H,_(C,I),0,0)
+#define  HHCF(TN,I)         _(TN,_cfSTR)(3,H,cfCOMMA,HH,_(C,I),0,0)
+#define HHHCF(TN,I)         _(TN,_cfSTR)(3,H,cfCOLON, H,_(C,I),0,0)
+#define  H_CF_SPECIAL       unsigned
+#define HH_CF_SPECIAL
+#define  DEFAULT_cfH(M,I,A)
+#define  LOGICAL_cfH(S,U,B)
+#define PLOGICAL_cfH(S,U,B)
+#define   STRING_cfH(S,U,B) _(A,S) _(U,_CF_SPECIAL) B
+#define  STRINGV_cfH(S,U,B) STRING_cfH(S,U,B)
+#define  PSTRING_cfH(S,U,B) STRING_cfH(S,U,B)
+#define PSTRINGV_cfH(S,U,B) STRING_cfH(S,U,B)
+#define PNSTRING_cfH(S,U,B) STRING_cfH(S,U,B)
+#define PPSTRING_cfH(S,U,B) STRING_cfH(S,U,B)
+#define  ZTRINGV_cfH(S,U,B)
+#define PZTRINGV_cfH(S,U,B)
+
+/* Need VOID_cfSTR because Absoft forced function types go through _cfSTR. */
+/* No spaces inside expansion. They screws up macro catenation kludge.     */
+#define           VOID_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define           BYTE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         DOUBLE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          FLOAT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define            INT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        LOGICAL_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,LOGICAL,A,B,C,D,E)
+#define           LONG_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          SHORT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          BYTEV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         BYTEVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        BYTEVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       BYTEVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      BYTEVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     BYTEVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    BYTEVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        DOUBLEV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       DOUBLEVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      DOUBLEVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     DOUBLEVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    DOUBLEVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define   DOUBLEVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define  DOUBLEVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         FLOATV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        FLOATVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       FLOATVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      FLOATVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     FLOATVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    FLOATVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define   FLOATVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define           INTV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          INTVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         INTVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        INTVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       INTVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      INTVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     INTVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       LOGICALV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      LOGICALVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     LOGICALVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    LOGICALVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define   LOGICALVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define  LOGICALVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define LOGICALVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          LONGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         LONGVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        LONGVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       LONGVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      LONGVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     LONGVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    LONGVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         SHORTV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        SHORTVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       SHORTVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define      SHORTVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define     SHORTVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define    SHORTVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define   SHORTVVVVVVV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define          PBYTE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        PDOUBLE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         PFLOAT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define           PINT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define       PLOGICAL_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PLOGICAL,A,B,C,D,E)
+#define          PLONG_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         PSHORT_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         STRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,STRING,A,B,C,D,E)
+#define        PSTRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PSTRING,A,B,C,D,E)
+#define        STRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,STRINGV,A,B,C,D,E)
+#define       PSTRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PSTRINGV,A,B,C,D,E)
+#define       PNSTRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PNSTRING,A,B,C,D,E)
+#define       PPSTRING_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PPSTRING,A,B,C,D,E)
+#define          PVOID_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        ROUTINE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define         SIMPLE_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,DEFAULT,A,B,C,D,E)
+#define        ZTRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,ZTRINGV,A,B,C,D,E)
+#define       PZTRINGV_cfSTR(N,T,A,B,C,D,E) _(CFARGS,N)(T,PZTRINGV,A,B,C,D,E)
+#define           CF_0_cfSTR(N,T,A,B,C,D,E)
+
+/* See ACF table comments, which explain why CCF was split into two. */
+#define CCF(NAME,TN,I)     _(TN,_cfSTR)(5,C,NAME,I,_(A,I),_(B,I),_(C,I))
+#define  DEFAULT_cfC(M,I,A,B,C)
+#define  LOGICAL_cfC(M,I,A,B,C)  A=C2FLOGICAL( A);
+#define PLOGICAL_cfC(M,I,A,B,C) *A=C2FLOGICAL(*A);
+#ifdef vmsFortran
+#define   STRING_cfC(M,I,A,B,C) (B.clen=strlen(A),B.f.dsc$a_pointer=A,         \
+        C==sizeof(char*)||C==(unsigned)(B.clen+1)?B.f.dsc$w_length=B.clen:     \
+          (memset((A)+B.clen,' ',C-B.clen-1),A[B.f.dsc$w_length=C-1]='\0'));
+      /* PSTRING_cfC to beware of array A which does not contain any \0.      */
+#define  PSTRING_cfC(M,I,A,B,C) (B.dsc$a_pointer=A, C==sizeof(char*) ?         \
+             B.dsc$w_length=strlen(A):  (A[C-1]='\0',B.dsc$w_length=strlen(A), \
+       memset((A)+B.dsc$w_length,' ',C-B.dsc$w_length-1), B.dsc$w_length=C-1));
+#else
+#define   STRING_cfC(M,I,A,B,C) (B.clen=strlen(A),                             \
+                C==sizeof(char*)||C==(unsigned)(B.clen+1)?B.flen=B.clen:       \
+                        (memset((A)+B.clen,' ',C-B.clen-1),A[B.flen=C-1]='\0'));
+#define  PSTRING_cfC(M,I,A,B,C) (C==sizeof(char*)? B=strlen(A):                \
+                    (A[C-1]='\0',B=strlen(A),memset((A)+B,' ',C-B-1),B=C-1));
+#endif
+          /* For CRAYFortran for (P)STRINGV_cfC, B.fs is set, but irrelevant. */
+#define  STRINGV_cfC(M,I,A,B,C) \
+        AATRINGV_cfA(    A,B,(C/0xFFFF)*(C%0xFFFF),C/0xFFFF,C%0xFFFF)
+#define PSTRINGV_cfC(M,I,A,B,C) \
+       APATRINGV_cfA(    A,B,(C/0xFFFF)*(C%0xFFFF),C/0xFFFF,C%0xFFFF)
+#define  ZTRINGV_cfC(M,I,A,B,C) \
+        AATRINGV_cfA(    A,B, (_3(M,_ELEMS_,I))*((_3(M,_ELEMLEN_,I))+1),       \
+                              (_3(M,_ELEMS_,I)), (_3(M,_ELEMLEN_,I))+1   )
+#define PZTRINGV_cfC(M,I,A,B,C) \
+       APATRINGV_cfA(    A,B, (_3(M,_ELEMS_,I))*((_3(M,_ELEMLEN_,I))+1),       \
+                              (_3(M,_ELEMS_,I)), (_3(M,_ELEMLEN_,I))+1   )
+
+#define     BYTE_cfCCC(A,B) &A
+#define   DOUBLE_cfCCC(A,B) &A
+#if !defined(__CF__KnR)
+#define    FLOAT_cfCCC(A,B) &A
+                               /* Although the VAX doesn't, at least the      */
+#else                          /* HP and K&R mips promote float arg.'s of     */
+#define    FLOAT_cfCCC(A,B) &B /* unprototyped functions to double. Cannot    */
+#endif                         /* use A here to pass the argument to FORTRAN. */
+#define      INT_cfCCC(A,B) &A
+#define  LOGICAL_cfCCC(A,B) &A
+#define     LONG_cfCCC(A,B) &A
+#define    SHORT_cfCCC(A,B) &A
+#define    PBYTE_cfCCC(A,B)  A
+#define  PDOUBLE_cfCCC(A,B)  A
+#define   PFLOAT_cfCCC(A,B)  A
+#define     PINT_cfCCC(A,B)  A
+#define PLOGICAL_cfCCC(A,B)  B=A       /* B used to keep a common W table. */
+#define    PLONG_cfCCC(A,B)  A
+#define   PSHORT_cfCCC(A,B)  A
+
+#define CCCF(TN,I,M)           _SEP_(TN,M,cfCOMMA) _Icf(3,CC,TN,_(A,I),_(B,I))
+#define        INT_cfCC(T,A,B) _(T,_cfCCC)(A,B) 
+#define       INTV_cfCC(T,A,B)  A
+#define      INTVV_cfCC(T,A,B)  A
+#define     INTVVV_cfCC(T,A,B)  A
+#define    INTVVVV_cfCC(T,A,B)  A
+#define   INTVVVVV_cfCC(T,A,B)  A
+#define  INTVVVVVV_cfCC(T,A,B)  A
+#define INTVVVVVVV_cfCC(T,A,B)  A
+#define       PINT_cfCC(T,A,B) _(T,_cfCCC)(A,B) 
+#define      PVOID_cfCC(T,A,B)  A
+#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran)
+#define    ROUTINE_cfCC(T,A,B) &A
+#else
+#define    ROUTINE_cfCC(T,A,B)  A
+#endif
+#define     SIMPLE_cfCC(T,A,B)  A
+#ifdef vmsFortran
+#define     STRING_cfCC(T,A,B) &B.f
+#define    STRINGV_cfCC(T,A,B) &B
+#define    PSTRING_cfCC(T,A,B) &B
+#define   PSTRINGV_cfCC(T,A,B) &B
+#else
+#ifdef CRAYFortran
+#define     STRING_cfCC(T,A,B) _cptofcd(A,B.flen)
+#define    STRINGV_cfCC(T,A,B) _cptofcd(B.s,B.flen)
+#define    PSTRING_cfCC(T,A,B) _cptofcd(A,B)
+#define   PSTRINGV_cfCC(T,A,B) _cptofcd(A,B.flen)
+#else
+#define     STRING_cfCC(T,A,B)  A
+#define    STRINGV_cfCC(T,A,B)  B.fs
+#define    PSTRING_cfCC(T,A,B)  A
+#define   PSTRINGV_cfCC(T,A,B)  B.fs
+#endif
+#endif
+#define    ZTRINGV_cfCC(T,A,B)   STRINGV_cfCC(T,A,B)
+#define   PZTRINGV_cfCC(T,A,B)  PSTRINGV_cfCC(T,A,B)
+
+#define    BYTE_cfX  return A0;
+#define  DOUBLE_cfX  return A0;
+#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
+#define   FLOAT_cfX  return A0;
+#else
+#define   FLOAT_cfX  ASSIGNFLOAT(AA0,A0); return AA0;
+#endif
+#define     INT_cfX  return A0;
+#define LOGICAL_cfX  return F2CLOGICAL(A0);
+#define    LONG_cfX  return A0;
+#define   SHORT_cfX  return A0;
+#define    VOID_cfX  return   ;
+#if defined(vmsFortran) || defined(CRAYFortran)
+#define  STRING_cfX  return kill_trailing(                                     \
+                                      kill_trailing(AA0,CFORTRAN_NON_CHAR),' ');
+#else
+#define  STRING_cfX  return kill_trailing(                                     \
+                                      kill_trailing( A0,CFORTRAN_NON_CHAR),' ');
+#endif
+
+#define CFFUN(NAME) _(__cf__,NAME)
+
+/* Note that we don't use LN here, but we keep it for consistency. */
+#define CCALLSFFUN0(UN,LN) CFFUN(UN)()
+
+#ifdef OLD_VAXC                                  /* Allow %CC-I-PARAMNOTUSED. */
+#pragma standard
+#endif
+
+#define CCALLSFFUN1( UN,LN,T1,                        A1)         \
+        CCALLSFFUN5 (UN,LN,T1,CF_0,CF_0,CF_0,CF_0,A1,0,0,0,0)
+#define CCALLSFFUN2( UN,LN,T1,T2,                     A1,A2)      \
+        CCALLSFFUN5 (UN,LN,T1,T2,CF_0,CF_0,CF_0,A1,A2,0,0,0)
+#define CCALLSFFUN3( UN,LN,T1,T2,T3,                  A1,A2,A3)   \
+        CCALLSFFUN5 (UN,LN,T1,T2,T3,CF_0,CF_0,A1,A2,A3,0,0)
+#define CCALLSFFUN4( UN,LN,T1,T2,T3,T4,               A1,A2,A3,A4)\
+        CCALLSFFUN5 (UN,LN,T1,T2,T3,T4,CF_0,A1,A2,A3,A4,0)
+#define CCALLSFFUN5( UN,LN,T1,T2,T3,T4,T5,            A1,A2,A3,A4,A5)          \
+        CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,0,0,0,0,0)
+#define CCALLSFFUN6( UN,LN,T1,T2,T3,T4,T5,T6,         A1,A2,A3,A4,A5,A6)       \
+        CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,0,0,0,0)
+#define CCALLSFFUN7( UN,LN,T1,T2,T3,T4,T5,T6,T7,      A1,A2,A3,A4,A5,A6,A7)    \
+        CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,0,0,0)
+#define CCALLSFFUN8( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,   A1,A2,A3,A4,A5,A6,A7,A8) \
+        CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,0,0)
+#define CCALLSFFUN9( UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,A1,A2,A3,A4,A5,A6,A7,A8,A9)\
+        CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,0)
+#define CCALLSFFUN10(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA)\
+        CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,0,0,0,0)
+#define CCALLSFFUN11(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB)\
+        CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,0,0,0)
+#define CCALLSFFUN12(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC)\
+        CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,0,0)
+#define CCALLSFFUN13(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD)\
+        CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,0)
+
+#define CCALLSFFUN14(UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,A1,A2,A3,A4,A5,A6,A7,A8,A9,AA,AB,AC,AD,AE)\
+((CFFUN(UN)(  BCF(T1,A1,0) BCF(T2,A2,1) BCF(T3,A3,1) BCF(T4,A4,1) BCF(T5,A5,1) \
+              BCF(T6,A6,1) BCF(T7,A7,1) BCF(T8,A8,1) BCF(T9,A9,1) BCF(TA,AA,1) \
+              BCF(TB,AB,1) BCF(TC,AC,1) BCF(TD,AD,1) BCF(TE,AE,1)              \
+           SCF(T1,LN,1,A1)  SCF(T2,LN,2,A2)  SCF(T3,LN,3,A3)  SCF(T4,LN,4,A4)  \
+           SCF(T5,LN,5,A5)  SCF(T6,LN,6,A6)  SCF(T7,LN,7,A7)  SCF(T8,LN,8,A8)  \
+           SCF(T9,LN,9,A9)  SCF(TA,LN,10,AA) SCF(TB,LN,11,AB) SCF(TC,LN,12,AC) \
+           SCF(TD,LN,13,AD) SCF(TE,LN,14,AE))))
+
+/*  N.B. Create a separate function instead of using (call function, function
+value here) because in order to create the variables needed for the input
+arg.'s which may be const.'s one has to do the creation within {}, but these
+can never be placed within ()'s. Therefore one must create wrapper functions.
+gcc, on the other hand may be able to avoid the wrapper functions. */
+
+/* Prototypes are needed to correctly handle the value returned correctly. N.B.
+Can only have prototype arg.'s with difficulty, a la G... table since FORTRAN
+functions returning strings have extra arg.'s. Don't bother, since this only
+causes a compiler warning to come up when one uses FCALLSCFUNn and CCALLSFFUNn
+for the same function in the same source code. Something done by the experts in
+debugging only.*/    
+
+#define PROTOCCALLSFFUN0(F,UN,LN)                                              \
+_(F,_cfPU)( CFC_(UN,LN))(CF_NULL_PROTO);                                       \
+static _Icf(2,U,F,CFFUN(UN),0)() {_(F,_cfE) _Icf(3,GZ,F,UN,LN) ABSOFT_cf1(F));_(F,_cfX)}
+
+#define PROTOCCALLSFFUN1( T0,UN,LN,T1)                                         \
+        PROTOCCALLSFFUN5 (T0,UN,LN,T1,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN2( T0,UN,LN,T1,T2)                                      \
+        PROTOCCALLSFFUN5 (T0,UN,LN,T1,T2,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN3( T0,UN,LN,T1,T2,T3)                                   \
+        PROTOCCALLSFFUN5 (T0,UN,LN,T1,T2,T3,CF_0,CF_0)
+#define PROTOCCALLSFFUN4( T0,UN,LN,T1,T2,T3,T4)                                \
+        PROTOCCALLSFFUN5 (T0,UN,LN,T1,T2,T3,T4,CF_0)
+#define PROTOCCALLSFFUN5( T0,UN,LN,T1,T2,T3,T4,T5)                             \
+        PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN6( T0,UN,LN,T1,T2,T3,T4,T5,T6)                          \
+        PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN7( T0,UN,LN,T1,T2,T3,T4,T5,T6,T7)                       \
+        PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN8( T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8)                    \
+        PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0)
+#define PROTOCCALLSFFUN9( T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9)                 \
+        PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0)
+#define PROTOCCALLSFFUN10(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA)              \
+        PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN11(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB)           \
+        PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0)
+#define PROTOCCALLSFFUN12(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC)        \
+        PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0)
+#define PROTOCCALLSFFUN13(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD)     \
+        PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0)
+
+/* HP/UX 9.01 cc requires the blank between '_Icf(3,G,T0,UN,LN) CCCF(T1,1,0)' */
+
+#ifndef __CF__KnR
+#define PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)  \
+ _(T0,_cfPU)(CFC_(UN,LN))(CF_NULL_PROTO); static _Icf(2,U,T0,CFFUN(UN),0)(     \
+   CFARGT14FS(UCF,HCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) )          \
+{       CFARGT14S(VCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    _(T0,_cfE) \
+ CCF(LN,T1,1)  CCF(LN,T2,2)  CCF(LN,T3,3)  CCF(LN,T4,4)  CCF(LN,T5,5)          \
+ CCF(LN,T6,6)  CCF(LN,T7,7)  CCF(LN,T8,8)  CCF(LN,T9,9)  CCF(LN,TA,10)         \
+ CCF(LN,TB,11) CCF(LN,TC,12) CCF(LN,TD,13) CCF(LN,TE,14)    _Icf(3,G,T0,UN,LN) \
+ CFARGT14(CCCF,JCF,ABSOFT_cf1(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)); \
+ WCF(T1,A1,1)   WCF(T2,A2,2)   WCF(T3,A3,3)   WCF(T4,A4,4)  WCF(T5,A5,5)       \
+ WCF(T6,A6,6)   WCF(T7,A7,7)   WCF(T8,A8,8)   WCF(T9,A9,9)  WCF(TA,A10,10)     \
+ WCF(TB,A11,11) WCF(TC,A12,12) WCF(TD,A13,13) WCF(TE,A14,14) _(T0,_cfX)}
+#else
+#define PROTOCCALLSFFUN14(T0,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)  \
+ _(T0,_cfPU)(CFC_(UN,LN))(CF_NULL_PROTO); static _Icf(2,U,T0,CFFUN(UN),0)(     \
+   CFARGT14FS(UUCF,HHCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) )        \
+ CFARGT14FS(UUUCF,HHHCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) ;        \
+{       CFARGT14S(VCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    _(T0,_cfE) \
+ CCF(LN,T1,1)  CCF(LN,T2,2)  CCF(LN,T3,3)  CCF(LN,T4,4)  CCF(LN,T5,5)          \
+ CCF(LN,T6,6)  CCF(LN,T7,7)  CCF(LN,T8,8)  CCF(LN,T9,9)  CCF(LN,TA,10)         \
+ CCF(LN,TB,11) CCF(LN,TC,12) CCF(LN,TD,13) CCF(LN,TE,14)    _Icf(3,G,T0,UN,LN) \
+ CFARGT14(CCCF,JCF,ABSOFT_cf1(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)); \
+ WCF(T1,A1,1)   WCF(T2,A2,2)   WCF(T3,A3,3)   WCF(T4,A4,4)   WCF(T5,A5,5)      \
+ WCF(T6,A6,6)   WCF(T7,A7,7)   WCF(T8,A8,8)   WCF(T9,A9,9)   WCF(TA,A10,10)    \
+ WCF(TB,A11,11) WCF(TC,A12,12) WCF(TD,A13,13) WCF(TE,A14,14) _(T0,_cfX)}
+#endif
+
+/*-------------------------------------------------------------------------*/
+
+/*               UTILITIES FOR FORTRAN TO CALL C ROUTINES                  */
+
+#ifdef OLD_VAXC                                /* Prevent %CC-I-PARAMNOTUSED. */
+#pragma nostandard
+#endif
+
+#if defined(vmsFortran) || defined(CRAYFortran)
+#define   DCF(TN,I)
+#define  DDCF(TN,I)
+#define DDDCF(TN,I)
+#else
+#define   DCF(TN,I)          HCF(TN,I)
+#define  DDCF(TN,I)         HHCF(TN,I)
+#define DDDCF(TN,I)        HHHCF(TN,I)
+#endif
+
+#define QCF(TN,I)       _(TN,_cfSTR)(1,Q,_(B,I), 0,0,0,0)
+#define  DEFAULT_cfQ(B)
+#define  LOGICAL_cfQ(B)
+#define PLOGICAL_cfQ(B)
+#define  STRINGV_cfQ(B) char *B; unsigned int _(B,N);
+#define   STRING_cfQ(B) char *B=NULL;
+#define  PSTRING_cfQ(B) char *B=NULL;
+#define PSTRINGV_cfQ(B) STRINGV_cfQ(B)
+#define PNSTRING_cfQ(B) char *B=NULL;
+#define PPSTRING_cfQ(B)
+
+#ifdef     __sgi   /* Else SGI gives warning 182 contrary to its C LRM A.17.7 */
+#define ROUTINE_orig    *(void**)& 
+#else
+#define ROUTINE_orig     (void *)  
+#endif
+
+#define ROUTINE_1     ROUTINE_orig   
+#define ROUTINE_2     ROUTINE_orig   
+#define ROUTINE_3     ROUTINE_orig   
+#define ROUTINE_4     ROUTINE_orig   
+#define ROUTINE_5     ROUTINE_orig   
+#define ROUTINE_6     ROUTINE_orig   
+#define ROUTINE_7     ROUTINE_orig   
+#define ROUTINE_8     ROUTINE_orig   
+#define ROUTINE_9     ROUTINE_orig   
+#define ROUTINE_10    ROUTINE_orig   
+#define ROUTINE_11    ROUTINE_orig   
+#define ROUTINE_12    ROUTINE_orig   
+#define ROUTINE_13    ROUTINE_orig   
+#define ROUTINE_14    ROUTINE_orig   
+#define ROUTINE_15    ROUTINE_orig   
+#define ROUTINE_16    ROUTINE_orig   
+#define ROUTINE_17    ROUTINE_orig   
+#define ROUTINE_18    ROUTINE_orig   
+#define ROUTINE_19    ROUTINE_orig   
+#define ROUTINE_20    ROUTINE_orig   
+#define ROUTINE_21    ROUTINE_orig   
+#define ROUTINE_22    ROUTINE_orig   
+#define ROUTINE_23    ROUTINE_orig   
+#define ROUTINE_24    ROUTINE_orig   
+#define ROUTINE_25    ROUTINE_orig   
+#define ROUTINE_26    ROUTINE_orig   
+#define ROUTINE_27    ROUTINE_orig   
+
+#define TCF(NAME,TN,I,M)              _SEP_(TN,M,cfCOMMA) _(TN,_cfT)(NAME,I,_(A,I),_(B,I),_(C,I))
+#define           BYTE_cfT(M,I,A,B,D) *A
+#define         DOUBLE_cfT(M,I,A,B,D) *A
+#define          FLOAT_cfT(M,I,A,B,D) *A
+#define            INT_cfT(M,I,A,B,D) *A
+#define        LOGICAL_cfT(M,I,A,B,D)  F2CLOGICAL(*A)
+#define           LONG_cfT(M,I,A,B,D) *A
+#define          SHORT_cfT(M,I,A,B,D) *A
+#define          BYTEV_cfT(M,I,A,B,D)  A
+#define        DOUBLEV_cfT(M,I,A,B,D)  A
+#define         FLOATV_cfT(M,I,A,B,D)  VOIDP A
+#define           INTV_cfT(M,I,A,B,D)  A
+#define       LOGICALV_cfT(M,I,A,B,D)  A
+#define          LONGV_cfT(M,I,A,B,D)  A
+#define         SHORTV_cfT(M,I,A,B,D)  A
+#define         BYTEVV_cfT(M,I,A,B,D)  (void *)A /* We have to cast to void *,*/
+#define        BYTEVVV_cfT(M,I,A,B,D)  (void *)A /* since we don't know the   */
+#define       BYTEVVVV_cfT(M,I,A,B,D)  (void *)A /* dimensions of the array.  */
+#define      BYTEVVVVV_cfT(M,I,A,B,D)  (void *)A /* i.e. Unfortunately, can't */
+#define     BYTEVVVVVV_cfT(M,I,A,B,D)  (void *)A /* check that the type       */
+#define    BYTEVVVVVVV_cfT(M,I,A,B,D)  (void *)A /* matches the prototype.    */
+#define       DOUBLEVV_cfT(M,I,A,B,D)  (void *)A
+#define      DOUBLEVVV_cfT(M,I,A,B,D)  (void *)A
+#define     DOUBLEVVVV_cfT(M,I,A,B,D)  (void *)A
+#define    DOUBLEVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define   DOUBLEVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define  DOUBLEVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define        FLOATVV_cfT(M,I,A,B,D)  (void *)A
+#define       FLOATVVV_cfT(M,I,A,B,D)  (void *)A
+#define      FLOATVVVV_cfT(M,I,A,B,D)  (void *)A
+#define     FLOATVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define    FLOATVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define   FLOATVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define          INTVV_cfT(M,I,A,B,D)  (void *)A  
+#define         INTVVV_cfT(M,I,A,B,D)  (void *)A  
+#define        INTVVVV_cfT(M,I,A,B,D)  (void *)A  
+#define       INTVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define      INTVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define     INTVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define      LOGICALVV_cfT(M,I,A,B,D)  (void *)A
+#define     LOGICALVVV_cfT(M,I,A,B,D)  (void *)A
+#define    LOGICALVVVV_cfT(M,I,A,B,D)  (void *)A
+#define   LOGICALVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define  LOGICALVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define LOGICALVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define         LONGVV_cfT(M,I,A,B,D)  (void *)A
+#define        LONGVVV_cfT(M,I,A,B,D)  (void *)A
+#define       LONGVVVV_cfT(M,I,A,B,D)  (void *)A
+#define      LONGVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define     LONGVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define    LONGVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define        SHORTVV_cfT(M,I,A,B,D)  (void *)A
+#define       SHORTVVV_cfT(M,I,A,B,D)  (void *)A
+#define      SHORTVVVV_cfT(M,I,A,B,D)  (void *)A
+#define     SHORTVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define    SHORTVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define   SHORTVVVVVVV_cfT(M,I,A,B,D)  (void *)A
+#define          PBYTE_cfT(M,I,A,B,D)  A
+#define        PDOUBLE_cfT(M,I,A,B,D)  A
+#define         PFLOAT_cfT(M,I,A,B,D)  VOIDP A
+#define           PINT_cfT(M,I,A,B,D)  A
+#define       PLOGICAL_cfT(M,I,A,B,D)  ((*A=F2CLOGICAL(*A)),A)
+#define          PLONG_cfT(M,I,A,B,D)  A
+#define         PSHORT_cfT(M,I,A,B,D)  A
+#define          PVOID_cfT(M,I,A,B,D)  A
+#if defined(apolloFortran) || defined(hpuxFortran800) || defined(AbsoftUNIXFortran)
+#define        ROUTINE_cfT(M,I,A,B,D)  _(ROUTINE_,I)  (*A)
+#else
+#define        ROUTINE_cfT(M,I,A,B,D)  _(ROUTINE_,I)    A
+#endif
+/* A == pointer to the characters
+   D == length of the string, or of an element in an array of strings
+   E == number of elements in an array of strings                             */
+#define TTSTR(    A,B,D)                                                       \
+           ((B=_cf_malloc(D+1))[D]='\0', memcpy(B,A,D), kill_trailing(B,' '))
+#define TTTTSTR(  A,B,D)   (!(D<4||A[0]||A[1]||A[2]||A[3]))?NULL:              \
+                            memchr(A,'\0',D)                 ?A   : TTSTR(A,B,D)
+#define TTTTSTRV( A,B,D,E) (_(B,N)=E,B=_cf_malloc(_(B,N)*(D+1)), (void *)      \
+  vkill_trailing(f2cstrv(A,B,D+1, _(B,N)*(D+1)), D+1,_(B,N)*(D+1),' '))
+#ifdef vmsFortran
+#define         STRING_cfT(M,I,A,B,D)  TTTTSTR( A->dsc$a_pointer,B,A->dsc$w_length)
+#define        STRINGV_cfT(M,I,A,B,D)  TTTTSTRV(A->dsc$a_pointer, B,           \
+                                             A->dsc$w_length , A->dsc$l_m[0])
+#define        PSTRING_cfT(M,I,A,B,D)    TTSTR( A->dsc$a_pointer,B,A->dsc$w_length)
+#define       PPSTRING_cfT(M,I,A,B,D)           A->dsc$a_pointer
+#else
+#ifdef CRAYFortran
+#define         STRING_cfT(M,I,A,B,D)  TTTTSTR( _fcdtocp(A),B,_fcdlen(A))
+#define        STRINGV_cfT(M,I,A,B,D)  TTTTSTRV(_fcdtocp(A),B,_fcdlen(A),      \
+                              num_elem(_fcdtocp(A),_fcdlen(A),_3(M,_STRV_A,I)))
+#define        PSTRING_cfT(M,I,A,B,D)    TTSTR( _fcdtocp(A),B,_fcdlen(A))
+#define       PPSTRING_cfT(M,I,A,B,D)           _fcdtocp(A)
+#else
+#define         STRING_cfT(M,I,A,B,D)  TTTTSTR( A,B,D)
+#define        STRINGV_cfT(M,I,A,B,D)  TTTTSTRV(A,B,D, num_elem(A,D,_3(M,_STRV_A,I)))
+#define        PSTRING_cfT(M,I,A,B,D)    TTSTR( A,B,D)
+#define       PPSTRING_cfT(M,I,A,B,D)           A
+#endif
+#endif
+#define       PNSTRING_cfT(M,I,A,B,D)    STRING_cfT(M,I,A,B,D)
+#define       PSTRINGV_cfT(M,I,A,B,D)   STRINGV_cfT(M,I,A,B,D)
+#define           CF_0_cfT(M,I,A,B,D)
+
+#define RCF(TN,I)           _(TN,_cfSTR)(3,R,_(A,I),_(B,I),_(C,I),0,0)
+#define  DEFAULT_cfR(A,B,D)
+#define  LOGICAL_cfR(A,B,D)
+#define PLOGICAL_cfR(A,B,D) *A=C2FLOGICAL(*A);
+#define   STRING_cfR(A,B,D) if (B) _cf_free(B);
+#define  STRINGV_cfR(A,B,D) _cf_free(B);
+/* A and D as defined above for TSTRING(V) */
+#define RRRRPSTR( A,B,D)    if (B) memcpy(A,B, _cfMIN(strlen(B),D)),           \
+                  (D>strlen(B)?memset(A+strlen(B),' ', D-strlen(B)):0), _cf_free(B);
+#define RRRRPSTRV(A,B,D)    c2fstrv(B,A,D+1,(D+1)*_(B,N)), _cf_free(B);
+#ifdef vmsFortran
+#define  PSTRING_cfR(A,B,D) RRRRPSTR( A->dsc$a_pointer,B,A->dsc$w_length)
+#define PSTRINGV_cfR(A,B,D) RRRRPSTRV(A->dsc$a_pointer,B,A->dsc$w_length)
+#else
+#ifdef CRAYFortran
+#define  PSTRING_cfR(A,B,D) RRRRPSTR( _fcdtocp(A),B,_fcdlen(A))
+#define PSTRINGV_cfR(A,B,D) RRRRPSTRV(_fcdtocp(A),B,_fcdlen(A))
+#else
+#define  PSTRING_cfR(A,B,D) RRRRPSTR( A,B,D)
+#define PSTRINGV_cfR(A,B,D) RRRRPSTRV(A,B,D)
+#endif
+#endif
+#define PNSTRING_cfR(A,B,D) PSTRING_cfR(A,B,D)
+#define PPSTRING_cfR(A,B,D)
+
+#define    BYTE_cfFZ(UN,LN) INTEGER_BYTE     FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define  DOUBLE_cfFZ(UN,LN) DOUBLE_PRECISION FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define     INT_cfFZ(UN,LN) int   FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define LOGICAL_cfFZ(UN,LN) int   FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define    LONG_cfFZ(UN,LN) long  FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define   SHORT_cfFZ(UN,LN) short FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#define    VOID_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#ifndef __CF__KnR
+/* The void is req'd by the Apollo, to make this an ANSI function declaration.
+   The Apollo promotes K&R float functions to double. */
+#define   FLOAT_cfFZ(UN,LN) FORTRAN_REAL FCALLSC_QUALIFIER fcallsc(UN,LN)(void
+#ifdef vmsFortran
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(fstring *AS
+#else
+#ifdef CRAYFortran
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(_fcd     AS
+#else
+#if  defined(AbsoftUNIXFortran) || defined(AbsoftProFortran)
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(char    *AS
+#else
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(char    *AS, unsigned D0
+#endif
+#endif
+#endif
+#else
+#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
+#define   FLOAT_cfFZ(UN,LN) FORTRAN_REAL      FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#else
+#define   FLOAT_cfFZ(UN,LN) FLOATFUNCTIONTYPE FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#endif
+#if defined(vmsFortran) || defined(CRAYFortran) || defined(AbsoftUNIXFortran)
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(AS
+#else
+#define  STRING_cfFZ(UN,LN) void  FCALLSC_QUALIFIER fcallsc(UN,LN)(AS, D0
+#endif
+#endif
+
+#define    BYTE_cfF(UN,LN)     BYTE_cfFZ(UN,LN)
+#define  DOUBLE_cfF(UN,LN)   DOUBLE_cfFZ(UN,LN)
+#ifndef __CF_KnR
+#define   FLOAT_cfF(UN,LN)  FORTRAN_REAL FCALLSC_QUALIFIER fcallsc(UN,LN)(
+#else
+#define   FLOAT_cfF(UN,LN)    FLOAT_cfFZ(UN,LN)
+#endif
+#define     INT_cfF(UN,LN)      INT_cfFZ(UN,LN)
+#define LOGICAL_cfF(UN,LN)  LOGICAL_cfFZ(UN,LN)
+#define    LONG_cfF(UN,LN)     LONG_cfFZ(UN,LN)
+#define   SHORT_cfF(UN,LN)    SHORT_cfFZ(UN,LN)
+#define    VOID_cfF(UN,LN)     VOID_cfFZ(UN,LN)
+#define  STRING_cfF(UN,LN)   STRING_cfFZ(UN,LN),
+
+#define     INT_cfFF
+#define    VOID_cfFF
+#ifdef vmsFortran
+#define  STRING_cfFF           fstring *AS; 
+#else
+#ifdef CRAYFortran
+#define  STRING_cfFF           _fcd     AS;
+#else
+#define  STRING_cfFF           char    *AS; unsigned D0;
+#endif
+#endif
+
+#define     INT_cfL            A0=
+#define  STRING_cfL            A0=
+#define    VOID_cfL                        
+
+#define    INT_cfK
+#define   VOID_cfK
+/* KSTRING copies the string into the position provided by the caller. */
+#ifdef vmsFortran
+#define STRING_cfK                                                             \
+ memcpy(AS->dsc$a_pointer,A0,_cfMIN(AS->dsc$w_length,(A0==NULL?0:strlen(A0))));\
+ AS->dsc$w_length>(A0==NULL?0:strlen(A0))?                                     \
+  memset(AS->dsc$a_pointer+(A0==NULL?0:strlen(A0)),' ',                        \
+         AS->dsc$w_length-(A0==NULL?0:strlen(A0))):0;
+#else
+#ifdef CRAYFortran
+#define STRING_cfK                                                             \
+ memcpy(_fcdtocp(AS),A0, _cfMIN(_fcdlen(AS),(A0==NULL?0:strlen(A0))) );        \
+ _fcdlen(AS)>(A0==NULL?0:strlen(A0))?                                          \
+  memset(_fcdtocp(AS)+(A0==NULL?0:strlen(A0)),' ',                             \
+         _fcdlen(AS)-(A0==NULL?0:strlen(A0))):0;
+#else
+#define STRING_cfK         memcpy(AS,A0, _cfMIN(D0,(A0==NULL?0:strlen(A0))) ); \
+                 D0>(A0==NULL?0:strlen(A0))?memset(AS+(A0==NULL?0:strlen(A0)), \
+                                            ' ', D0-(A0==NULL?0:strlen(A0))):0;
+#endif
+#endif
+
+/* Note that K.. and I.. can't be combined since K.. has to access data before
+R.., in order for functions returning strings which are also passed in as
+arguments to work correctly. Note that R.. frees and hence may corrupt the
+string. */
+#define    BYTE_cfI  return A0;
+#define  DOUBLE_cfI  return A0;
+#if ! (defined(FLOATFUNCTIONTYPE)&&defined(ASSIGNFLOAT)&&defined(RETURNFLOAT))
+#define   FLOAT_cfI  return A0;
+#else
+#define   FLOAT_cfI  RETURNFLOAT(A0);
+#endif
+#define     INT_cfI  return A0;
+#ifdef hpuxFortran800
+/* Incredibly, functions must return true as 1, elsewhere .true.==0x01000000. */
+#define LOGICAL_cfI  return ((A0)?1:0);
+#else
+#define LOGICAL_cfI  return C2FLOGICAL(A0);
+#endif
+#define    LONG_cfI  return A0;
+#define   SHORT_cfI  return A0;
+#define  STRING_cfI  return   ;
+#define    VOID_cfI  return   ;
+
+#ifdef OLD_VAXC                                  /* Allow %CC-I-PARAMNOTUSED. */
+#pragma standard
+#endif
+
+#define FCALLSCSUB0( CN,UN,LN)             FCALLSCFUN0(VOID,CN,UN,LN)
+#define FCALLSCSUB1( CN,UN,LN,T1)          FCALLSCFUN1(VOID,CN,UN,LN,T1)
+#define FCALLSCSUB2( CN,UN,LN,T1,T2)       FCALLSCFUN2(VOID,CN,UN,LN,T1,T2)
+#define FCALLSCSUB3( CN,UN,LN,T1,T2,T3)    FCALLSCFUN3(VOID,CN,UN,LN,T1,T2,T3)
+#define FCALLSCSUB4( CN,UN,LN,T1,T2,T3,T4) \
+    FCALLSCFUN4(VOID,CN,UN,LN,T1,T2,T3,T4)
+#define FCALLSCSUB5( CN,UN,LN,T1,T2,T3,T4,T5) \
+    FCALLSCFUN5(VOID,CN,UN,LN,T1,T2,T3,T4,T5)
+#define FCALLSCSUB6( CN,UN,LN,T1,T2,T3,T4,T5,T6) \
+    FCALLSCFUN6(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6)       
+#define FCALLSCSUB7( CN,UN,LN,T1,T2,T3,T4,T5,T6,T7) \
+    FCALLSCFUN7(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7)
+#define FCALLSCSUB8( CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8) \
+    FCALLSCFUN8(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8)
+#define FCALLSCSUB9( CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9) \
+    FCALLSCFUN9(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9)
+#define FCALLSCSUB10(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA) \
+   FCALLSCFUN10(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA)
+#define FCALLSCSUB11(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB) \
+   FCALLSCFUN11(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB)
+#define FCALLSCSUB12(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC) \
+   FCALLSCFUN12(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC)
+#define FCALLSCSUB13(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) \
+   FCALLSCFUN13(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD)
+#define FCALLSCSUB14(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) \
+   FCALLSCFUN14(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)
+#define FCALLSCSUB15(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) \
+   FCALLSCFUN15(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF)
+#define FCALLSCSUB16(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) \
+   FCALLSCFUN16(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG)
+#define FCALLSCSUB17(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) \
+   FCALLSCFUN17(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH)
+#define FCALLSCSUB18(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) \
+   FCALLSCFUN18(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI)
+#define FCALLSCSUB19(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \
+   FCALLSCFUN19(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ)
+#define FCALLSCSUB20(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+   FCALLSCFUN20(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK)
+#define FCALLSCSUB21(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \
+   FCALLSCFUN21(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL)
+#define FCALLSCSUB22(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \
+   FCALLSCFUN22(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM)
+#define FCALLSCSUB23(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \
+   FCALLSCFUN23(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN)
+#define FCALLSCSUB24(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \
+   FCALLSCFUN24(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO)
+#define FCALLSCSUB25(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \
+   FCALLSCFUN25(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP)
+#define FCALLSCSUB26(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \
+   FCALLSCFUN26(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ)
+#define FCALLSCSUB27(CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) \
+   FCALLSCFUN27(VOID,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)
+
+
+#define FCALLSCFUN1( T0,CN,UN,LN,T1) \
+        FCALLSCFUN5 (T0,CN,UN,LN,T1,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN2( T0,CN,UN,LN,T1,T2) \
+        FCALLSCFUN5 (T0,CN,UN,LN,T1,T2,CF_0,CF_0,CF_0)
+#define FCALLSCFUN3( T0,CN,UN,LN,T1,T2,T3) \
+        FCALLSCFUN5 (T0,CN,UN,LN,T1,T2,T3,CF_0,CF_0)
+#define FCALLSCFUN4( T0,CN,UN,LN,T1,T2,T3,T4) \
+        FCALLSCFUN5 (T0,CN,UN,LN,T1,T2,T3,T4,CF_0)
+#define FCALLSCFUN5( T0,CN,UN,LN,T1,T2,T3,T4,T5) \
+        FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN6( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6) \
+        FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN7( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7) \
+        FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,CF_0,CF_0,CF_0)
+#define FCALLSCFUN8( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8) \
+        FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,CF_0,CF_0)
+#define FCALLSCFUN9( T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9) \
+        FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,CF_0)
+#define FCALLSCFUN10(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA) \
+        FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN11(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB) \
+        FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,CF_0,CF_0,CF_0)
+#define FCALLSCFUN12(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC) \
+        FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,CF_0,CF_0)
+#define FCALLSCFUN13(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD) \
+        FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,CF_0)
+
+
+#define FCALLSCFUN15(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN16(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN17(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,CF_0,CF_0,CF_0)
+#define FCALLSCFUN18(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,CF_0,CF_0)
+#define FCALLSCFUN19(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ) \
+        FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,CF_0)
+#define FCALLSCFUN20(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN21(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,CF_0,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN22(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,CF_0,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN23(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,CF_0,CF_0,CF_0,CF_0)
+#define FCALLSCFUN24(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,CF_0,CF_0,CF_0)
+#define FCALLSCFUN25(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,CF_0,CF_0)
+#define FCALLSCFUN26(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ) \
+        FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,CF_0)
+
+
+#ifndef __CF__KnR
+#define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf2(T0))   \
+        {_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) _(T0,_cfI)}
+
+#define FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    \
+                                 CFextern _(T0,_cfF)(UN,LN)                    \
+ CFARGT14(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE) )  \
+ {                 CFARGT14S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    \
+  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(    TCF(LN,T1,1,0)  TCF(LN,T2,2,1) \
+    TCF(LN,T3,3,1)  TCF(LN,T4,4,1) TCF(LN,T5,5,1)  TCF(LN,T6,6,1)  TCF(LN,T7,7,1) \
+    TCF(LN,T8,8,1)  TCF(LN,T9,9,1) TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) );                          _Icf(0,K,T0,0,0) \
+                   CFARGT14S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)  _(T0,_cfI) }
+
+#define FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)   \
+                                 CFextern _(T0,_cfF)(UN,LN)                    \
+ CFARGT27(NCF,DCF,ABSOFT_cf2(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR) ) \
+ {                 CFARGT27S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)   \
+  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(     TCF(LN,T1,1,0)  TCF(LN,T2,2,1)  \
+    TCF(LN,T3,3,1)  TCF(LN,T4,4,1)  TCF(LN,T5,5,1)  TCF(LN,T6,6,1)  TCF(LN,T7,7,1)  \
+    TCF(LN,T8,8,1)  TCF(LN,T9,9,1)  TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) TCF(LN,TF,15,1) TCF(LN,TG,16,1) TCF(LN,TH,17,1) \
+    TCF(LN,TI,18,1) TCF(LN,TJ,19,1) TCF(LN,TK,20,1) TCF(LN,TL,21,1) TCF(LN,TM,22,1) \
+    TCF(LN,TN,23,1) TCF(LN,TO,24,1) TCF(LN,TP,25,1) TCF(LN,TQ,26,1) TCF(LN,TR,27,1) ); _Icf(0,K,T0,0,0) \
+                   CFARGT27S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  _(T0,_cfI) }
+
+#else
+#define FCALLSCFUN0(T0,CN,UN,LN) CFextern _(T0,_cfFZ)(UN,LN) ABSOFT_cf3(T0)) _Icf(0,FF,T0,0,0)\
+        {_Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0) CN(); _Icf(0,K,T0,0,0) _(T0,_cfI)}
+
+#define FCALLSCFUN14(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    \
+                                 CFextern _(T0,_cfF)(UN,LN)                    \
+ CFARGT14(NNCF,DDCF,ABSOFT_cf3(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)) _Icf(0,FF,T0,0,0) \
+       CFARGT14FS(NNNCF,DDDCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE);   \
+ {                 CFARGT14S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)    \
+  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(  TCF(LN,T1,1,0) TCF(LN,T2,2,1) \
+    TCF(LN,T3,3,1) TCF(LN,T4,4,1) TCF(LN,T5,5,1) TCF(LN,T6,6,1) TCF(LN,T7,7,1) \
+    TCF(LN,T8,8,1) TCF(LN,T9,9,1) TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) );                          _Icf(0,K,T0,0,0) \
+                   CFARGT14S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE)  _(T0,_cfI)}
+
+#define FCALLSCFUN27(T0,CN,UN,LN,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  \
+                                 CFextern _(T0,_cfF)(UN,LN)                    \
+ CFARGT27(NNCF,DDCF,ABSOFT_cf3(T0),T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)) _Icf(0,FF,T0,0,0) \
+       CFARGT27FS(NNNCF,DDDCF,_Z,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR); \
+ {                 CFARGT27S(QCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  \
+  _Icf(2,UU,T0,A0,0); _Icf(0,L,T0,0,0)      CN(     TCF(LN,T1,1,0)  TCF(LN,T2,2,1)  \
+    TCF(LN,T3,3,1)  TCF(LN,T4,4,1)  TCF(LN,T5,5,1)  TCF(LN,T6,6,1)  TCF(LN,T7,7,1)  \
+    TCF(LN,T8,8,1)  TCF(LN,T9,9,1)  TCF(LN,TA,10,1) TCF(LN,TB,11,1) TCF(LN,TC,12,1) \
+    TCF(LN,TD,13,1) TCF(LN,TE,14,1) TCF(LN,TF,15,1) TCF(LN,TG,16,1) TCF(LN,TH,17,1) \
+    TCF(LN,TI,18,1) TCF(LN,TJ,19,1) TCF(LN,TK,20,1) TCF(LN,TL,21,1) TCF(LN,TM,22,1) \
+    TCF(LN,TN,23,1) TCF(LN,TO,24,1) TCF(LN,TP,25,1) TCF(LN,TQ,26,1) TCF(LN,TR,27,1) ); _Icf(0,K,T0,0,0) \
+                   CFARGT27S(RCF,T1,T2,T3,T4,T5,T6,T7,T8,T9,TA,TB,TC,TD,TE,TF,TG,TH,TI,TJ,TK,TL,TM,TN,TO,TP,TQ,TR)  _(T0,_cfI)}
+
+#endif
+
+
+#endif	 /* __CFORTRAN_LOADED */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/cgribex.h b/libcdi/src/cgribex.h
new file mode 100644
index 0000000..35b9fe6
--- /dev/null
+++ b/libcdi/src/cgribex.h
@@ -0,0 +1,246 @@
+#ifndef _CGRIBEX_H
+#define _CGRIBEX_H
+
+#include <stdio.h>
+#include <sys/types.h>
+
+#define  GRIB_MISSVAL  -9.E33
+
+/* GRIB1 Level Types */
+#define  GRIB1_LTYPE_SURFACE               1
+#define  GRIB1_LTYPE_TOA                   8
+#define  GRIB1_LTYPE_SEA_BOTTOM            9
+#define  GRIB1_LTYPE_ATMOSPHERE           10
+#define  GRIB1_LTYPE_99                   99
+#define  GRIB1_LTYPE_ISOBARIC            100
+#define  GRIB1_LTYPE_MEANSEA             102
+#define  GRIB1_LTYPE_ALTITUDE            103
+#define  GRIB1_LTYPE_HEIGHT              105
+#define  GRIB1_LTYPE_SIGMA               107
+#define  GRIB1_LTYPE_SIGMA_LAYER         108
+#define  GRIB1_LTYPE_HYBRID              109
+#define  GRIB1_LTYPE_HYBRID_LAYER        110
+#define  GRIB1_LTYPE_LANDDEPTH           111
+#define  GRIB1_LTYPE_LANDDEPTH_LAYER     112
+#define  GRIB1_LTYPE_ISENTROPIC          113
+#define  GRIB1_LTYPE_SEADEPTH            160
+#define  GRIB1_LTYPE_99_MARGIN          1000
+
+/* GRIB1 Data representation type (Grid Type) [Table 6] */
+#define  GRIB1_GTYPE_LATLON                0  /*  latitude/longitude                       */
+#define  GRIB1_GTYPE_LATLON_ROT           10  /*  rotated latitude/longitude               */
+#define  GRIB1_GTYPE_LATLON_STR           20  /*  stretched latitude/longitude             */
+#define  GRIB1_GTYPE_LATLON_ROTSTR        30  /*  rotated and stretched latitude/longitude */
+#define  GRIB1_GTYPE_GAUSSIAN              4  /*  gaussian grid                            */
+#define  GRIB1_GTYPE_GAUSSIAN_ROT         14  /*  rotated gaussian grid                    */
+#define  GRIB1_GTYPE_GAUSSIAN_STR         24  /*  stretched gaussian grid                  */
+#define  GRIB1_GTYPE_GAUSSIAN_ROTSTR      34  /*  rotated and stretched gaussian grid      */
+#define  GRIB1_GTYPE_LCC                   3  /*  Lambert conformal                        */
+#define  GRIB1_GTYPE_SPECTRAL             50  /*  spherical harmonics                      */
+#define  GRIB1_GTYPE_GME                 192  /*  hexagonal GME grid                       */
+
+/*
+ *  Macros for the indicator section ( Section 0 )
+ */
+#define  ISEC0_GRIB_Len             (isec0[ 0])  /*  Number of octets in the GRIB message         */
+#define  ISEC0_GRIB_Version         (isec0[ 1])  /*  GRIB edition number                          */
+
+
+/*
+ *  Macros for the product definition section ( Section 1 )
+ */
+#define  ISEC1_TABLE4_MINUTE    0
+#define  ISEC1_TABLE4_HOUR      1
+#define  ISEC1_TABLE4_DAY       2
+#define  ISEC1_TABLE4_3HOURS   10
+#define  ISEC1_TABLE4_6HOURS   11
+#define  ISEC1_TABLE4_12HOURS  12
+#define  ISEC1_TABLE4_QUARTER  13
+
+
+#define  ISEC1_CodeTable            (isec1[ 0])  /*  Version number of code table                 */
+#define  ISEC1_CenterID             (isec1[ 1])  /*  Identification of centre                     */
+#define  ISEC1_ModelID              (isec1[ 2])  /*  Identification of model                      */
+#define  ISEC1_GridDefinition       (isec1[ 3])  /*  Grid definition                              */
+#define  ISEC1_Sec2Or3Flag          (isec1[ 4])  /*  Section 2 or 3 included                      */
+#define  ISEC1_Parameter            (isec1[ 5])  /*  Parameter indicator                          */
+#define  ISEC1_LevelType            (isec1[ 6])  /*  Type of level indicator                      */
+#define  ISEC1_Level1               (isec1[ 7])  /*  Level 1                                      */
+#define  ISEC1_Level2               (isec1[ 8])  /*  Level 2                                      */
+#define  ISEC1_Year                 (isec1[ 9])  /*  Year of century (YY)                         */
+#define  ISEC1_Month                (isec1[10])  /*  Month (MM)                                   */
+#define  ISEC1_Day                  (isec1[11])  /*  Day (DD)                                     */
+#define  ISEC1_Hour                 (isec1[12])  /*  Hour (HH)                                    */
+#define  ISEC1_Minute               (isec1[13])  /*  Minute (MM)                                  */
+#define  ISEC1_TimeUnit             (isec1[14])  /*  Time unit indicator                          */
+#define  ISEC1_TimePeriod1          (isec1[15])  /*  P1 Time period                               */
+#define  ISEC1_TimePeriod2          (isec1[16])  /*  P2 Time period                               */
+#define  ISEC1_TimeRange            (isec1[17])  /*  Time range indicator                         */
+#define  ISEC1_AvgNum               (isec1[18])  /*  Number of products included in an average    */
+#define  ISEC1_AvgMiss              (isec1[19])  /*  Number of products missing from an average   */
+#define  ISEC1_Century              (isec1[20])  /*  Century                                      */
+#define  ISEC1_SubCenterID          (isec1[21])  /*  Subcenter identifier                         */
+#define  ISEC1_DecScaleFactor       (isec1[22])  /*  Decimal scale factor                         */
+#define  ISEC1_LocalFLag            (isec1[23])  /*  Flag field to indicate local use in isec1    */
+
+#define  ISEC1_ECMWF_LocalExtension (isec1[36])
+#define  ISEC1_ECMWF_Class          (isec1[37])
+
+
+/*
+ *  Macros for the grid definition section ( Section 2 )
+ */
+#define  ISEC2_GridType             (isec2[ 0])  /* Data representation type */
+
+/* Triangular grids */
+
+#define  ISEC2_GME_NI2              (isec2[ 1])  /*  Number of factor 2 in factorisation of Ni    */
+#define  ISEC2_GME_NI3              (isec2[ 2])  /*  Number of factor 3 in factorisation of Ni    */
+#define  ISEC2_GME_ND               (isec2[ 3])  /*  Nubmer of diamonds                           */
+#define  ISEC2_GME_NI               (isec2[ 4])  /*  Number of tri. subdiv. of the icosahedron    */
+#define  ISEC2_GME_AFlag            (isec2[ 5])  /*  Flag for orientation of diamonds (Table A)   */
+#define  ISEC2_GME_LatPP            (isec2[ 6])  /*  Latitude of pole point                       */
+#define  ISEC2_GME_LonPP            (isec2[ 7])  /*  Longitude of pole point                      */
+#define  ISEC2_GME_LonMPL           (isec2[ 8])  /*  Longitude of the first diamond               */
+#define  ISEC2_GME_BFlag            (isec2[ 9])  /*  Flag for storage sequence (Table B)          */
+
+/* Spherical harmonic coeficients */
+
+#define  ISEC2_PentaJ               (isec2[ 1])  /*  J pentagonal resolution parameter            */
+#define  ISEC2_PentaK               (isec2[ 2])  /*  K pentagonal resolution parameter            */
+#define  ISEC2_PentaM               (isec2[ 3])  /*  M pentagonal resolution parameter            */
+#define  ISEC2_RepType              (isec2[ 4])  /*  Representation type                          */
+#define  ISEC2_RepMode              (isec2[ 5])  /*  Representation mode                          */
+
+/* Gaussian grids */
+
+#define  ISEC2_NumLon               (isec2[ 1])  /*  Number of points along a parallel (Ni)       */
+#define  ISEC2_NumLat               (isec2[ 2])  /*  Number of points along a meridian (Nj)       */
+#define  ISEC2_FirstLat             (isec2[ 3])  /*  Latitude of the first grid point             */
+#define  ISEC2_FirstLon             (isec2[ 4])  /*  Longitude of the first grid point            */
+#define  ISEC2_ResFlag              (isec2[ 5])  /*  Resolution flag: 128 regular grid            */
+#define  ISEC2_LastLat              (isec2[ 6])  /*  Latitude of the last grid point              */
+#define  ISEC2_LastLon              (isec2[ 7])  /*  Longitude of the last grid point             */
+#define  ISEC2_LonIncr              (isec2[ 8])  /*  i direction increment                        */
+#define  ISEC2_LatIncr              (isec2[ 9])  /*  j direction increment                        */
+#define  ISEC2_NumPar               (isec2[ 9])  /*  Number of parallels between a pole and the E.*/
+#define  ISEC2_ScanFlag             (isec2[10])  /*  Scanning mode flags                          */
+#define  ISEC2_NumVCP               (isec2[11])  /*  Number of vertical coordinate parameters     */
+
+/* Lambert */
+#define  ISEC2_Lambert_Lov          (isec2[ 6])  /*  Orientation of the grid                      */
+#define  ISEC2_Lambert_dx           (isec2[ 8])  /*  X-direction grid length                      */
+#define  ISEC2_Lambert_dy           (isec2[ 9])  /*  Y-direction grid length                      */
+#define  ISEC2_Lambert_ProjFlag     (isec2[12])  /*  Projection centre flag                       */
+#define  ISEC2_Lambert_LatS1        (isec2[13])  /*  First lat at which the secant cone cuts the sphere */
+#define  ISEC2_Lambert_LatS2        (isec2[14])  /*  Second lat at which the secant cone cuts the sphere */
+#define  ISEC2_Lambert_LatSP        (isec2[19])  /*  Latitude of the southern pole                */
+#define  ISEC2_Lambert_LonSP        (isec2[20])  /*  Longitude of the southern pole               */
+
+
+#define  ISEC2_Reduced              (isec2[16])  /* 0: regular, 1: reduced grid                   */
+
+#define  ISEC2_RowLonPtr            (&isec2[22])
+#define  ISEC2_RowLon(i)            (isec2[22+i]) /* Number of points along each parallel         */
+
+/* */
+
+#define  ISEC2_LatSP                (isec2[12])  /* Latitude of the southern pole of rotation     */
+#define  ISEC2_LonSP                (isec2[13])  /* Longitude of the southern pole of rotation    */
+
+#define  FSEC2_RotAngle             (fsec2[ 0])  /* Angle of rotation                             */
+#define  FSEC2_StrFact              (fsec2[ 1])  /* Stretching factor                             */
+
+/*
+ *  Macros for the bit map section ( Section 3 )
+ */
+#define  ISEC3_PredefBitmap         (isec3[ 0])  /* Predefined bitmap                             */
+#define  ISEC3_MissVal              (isec3[ 1])  /* Missing data value for integers               */
+#define  FSEC3_MissVal              (fsec3[ 1])  /* Missing data value for floats                 */
+
+/*
+ *  Macros for the binary data section ( Section 4 )
+ */
+#define  ISEC4_NumValues            (isec4[ 0])  /* Number of data values for encode/decode       */
+#define  ISEC4_NumBits              (isec4[ 1])  /* Number of bits used for each encoded value    */
+#define  ISEC4_NumNonMissValues     (isec4[20])  /* Number of non-missing values                  */
+
+
+
+
+void  gribFixZSE(int flag);     /* 1: Fix ZeroShiftError of simple packed spherical harmonics */
+void  gribSetConst(int flag);   /* 1: Don't pack constant fields on regular grids */
+void  gribSetDebug(int debug);  /* 1: Debugging */
+void  gribSetRound(int round);
+void  gribSetRefDP(double refval);
+void  gribSetRefSP(float  refval);
+void  gribSetValueCheck(int vcheck);
+
+
+void  gribExSP(int *isec0, int *isec1, int *isec2, float *fsec2, int *isec3,
+               float *fsec3, int *isec4, float *fsec4, int klenp, int *kgrib,
+               int kleng, int *kword, char *hoper, int *kret);
+
+void  gribExDP(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+               double *fsec3, int *isec4, double *fsec4, int klenp, int *kgrib,
+               int kleng, int *kword, char *hoper, int *kret);
+
+
+const char *cgribexLibraryVersion(void);
+
+void  gribDebug(int debug);
+void  gribSetCalendar(int calendar);
+
+void  gribDateTime(int *isec1, int *date, int *time);
+int   gribRefDate(int *isec1);
+int   gribRefTime(int *isec1);
+int   gribTimeIsFC(int *isec1);
+
+void  gribPrintSec0(int *isec0);
+void  gribPrintSec1(int *isec0, int *isec1);
+void  gribPrintSec2DP(int *isec0, int *isec2, double *fsec2);
+void  gribPrintSec2SP(int *isec0, int *isec2, float  *fsec2);
+void  gribPrintSec3DP(int *isec0, int *isec3, double *fsec3);
+void  gribPrintSec3SP(int *isec0, int *isec3, float  *fsec3);
+void  gribPrintSec4DP(int *isec0, int *isec4, double *fsec4);
+void  gribPrintSec4SP(int *isec0, int *isec4, float  *fsec4);
+void  gribPrintSec4Wave(int *isec4);
+
+void  gribPrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribPrintPDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribPrintGDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribPrintBMS(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribPrintBDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribCheck1(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+void  gribRepair1(int nrec, long recpos, long recsize, unsigned char *gribbuffer);
+
+int grib1Sections(unsigned char *gribbuffer, long recsize, unsigned char **pdsp,
+		  unsigned char **gdsp, unsigned char **bmsp, unsigned char **bdsp);
+int grib2Sections(unsigned char *gribbuffer, long recsize, unsigned char **idsp,
+		  unsigned char **lusp, unsigned char **gdsp, unsigned char **pdsp,
+		  unsigned char **drsp, unsigned char **bmsp, unsigned char **bdsp);
+
+int   gribGetZip(long recsize, unsigned char *gribbuffer, long *urecsize);
+
+int   gribBzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufsize);
+int   gribZip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufsize);
+int   gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufsize);
+
+int   gribOpen(const char *filename, const char *mode);
+void  gribClose(int fileID);
+
+int   gribRead(int fileID, unsigned char *buffer, size_t *buffersize);
+int   gribWrite(int fileID, unsigned char *buffer, size_t buffersize);
+off_t gribGetPos(int fileID);
+int   gribGetSize(int fileID);
+int   gribCheckSeek(int fileID, long *offset, int *version);
+int   gribFileSeek(int fileID, long *offset);
+int   gribReadSize(int fileID);
+int   gribVersion(unsigned char *buffer, size_t buffersize);
+
+int   gribGinfo(long recpos, long recsize, unsigned char *gribbuffer, int *intnum, float *fltnum);
+
+double calculate_pfactor(const double* spectralField, long fieldTruncation, long subsetTruncation);
+
+#endif  /* _CGRIBEX_H */ 
+
diff --git a/libcdi/src/cgribexlib.c b/libcdi/src/cgribexlib.c
new file mode 100644
index 0000000..9ee2628
--- /dev/null
+++ b/libcdi/src/cgribexlib.c
@@ -0,0 +1,10184 @@
+
+/* Automatically generated by m214003 at 2012-12-17, do not edit */
+
+/* CGRIBEXLIB_VERSION="1.5.6" */
+
+#ifdef _ARCH_PWR6
+#pragma options nostrict
+#endif
+
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <string.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <sys/types.h>
+
+
+#include "file.h"
+#include "dmemory.h"
+#include "dtypes.h"
+#include "calendar.h"
+#include "timebase.h"
+
+#ifndef _GRIB_INT_H
+#define _GRIB_INT_H
+
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <float.h>
+
+
+#if ! defined   (_CGRIBEX_H)
+#  include "cgribex.h"
+#endif
+#if ! defined   (_ERROR_H)
+#  include "error.h"
+#endif
+#if ! defined   (_DTYPES_H)
+#  include "dtypes.h"
+#endif
+
+#if ! defined   (FALSE)
+#  define  FALSE  0
+#endif
+
+#if ! defined   (TRUE)
+#  define  TRUE  1
+#endif
+
+#if ! defined   (UCHAR)
+#  define  UCHAR  unsigned char
+#endif
+
+
+#if defined (CRAY) || defined (SX) || defined (__uxpch__)
+#  define VECTORCODE
+#endif
+
+#if defined (VECTORCODE)
+#if  defined  (INT32)
+#  define  GRIBPACK     unsigned INT32
+#  define  PACK_GRIB    packInt32
+#  define  UNPACK_GRIB  unpackInt32
+#else
+#  define  GRIBPACK     unsigned INT64
+#  define  PACK_GRIB    packInt64
+#  define  UNPACK_GRIB  unpackInt64
+#endif
+#else
+#  define  GRIBPACK     unsigned char
+#endif
+
+#define  U_BYTEORDER     static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1}
+#define  IS_BIGENDIAN()  (u_byteorder.c[sizeof(long) - 1])
+
+#if defined (__xlC__) /* performance problems on IBM */
+#ifndef DBL_IS_NAN
+#  define DBL_IS_NAN(x)     ((x) != (x))
+#endif
+#else
+#ifndef DBL_IS_NAN
+#if  defined  (HAVE_DECL_ISNAN)
+#  define DBL_IS_NAN(x)     (isnan(x))
+#elif  defined  (FP_NAN)
+#  define DBL_IS_NAN(x)     (fpclassify(x) == FP_NAN)
+#else
+#  define DBL_IS_NAN(x)     ((x) != (x))
+#endif
+#endif
+#endif
+
+#ifndef DBL_IS_EQUAL
+/*#define DBL_IS_EQUAL(x,y) (!(x < y || y < x)) */
+#  define DBL_IS_EQUAL(x,y) (DBL_IS_NAN(x)||DBL_IS_NAN(y)?(DBL_IS_NAN(x)&&DBL_IS_NAN(y)?1:0):!(x < y || y < x))
+#endif
+
+#ifndef IS_EQUAL
+#  define IS_NOT_EQUAL(x,y) (x < y || y < x)
+#  define IS_EQUAL(x,y)     (!IS_NOT_EQUAL(x,y))
+#endif
+
+
+#define  JP23SET    0x7FFFFF  /* 2**23 - 1 (---> 8388607)  */
+
+#define  POW_2_M24  0.000000059604644775390625  /*  pow(2.0, -24.0) */
+
+double intpow2(int x);
+
+int gribrec_len(int b1, int b2, int b3);
+int correct_bdslen(int bdslen, long recsize, long gribpos);
+
+/* CDI converter routines */
+
+/* param format:  DDDCCCNNN */
+
+void    cdiDecodeParam(int param, int *dis, int *cat, int *num);
+int     cdiEncodeParam(int dis, int cat, int num);
+
+/* date format:  YYYYMMDD */
+/* time format:  hhmmss   */
+
+void    cdiDecodeDate(int date, int *year, int *month, int *day);
+int     cdiEncodeDate(int year, int month, int day);
+
+void    cdiDecodeTime(int time, int *hour, int *minute, int *second);
+int     cdiEncodeTime(int hour, int minute, int second);
+
+/* CALENDAR types */
+
+#define  CALENDAR_STANDARD        0  /* don't change this value (used also in cgribexlib)! */
+#define  CALENDAR_PROLEPTIC       1
+#define  CALENDAR_360DAYS         2
+#define  CALENDAR_365DAYS         3
+#define  CALENDAR_366DAYS         4
+#define  CALENDAR_NONE            5
+
+extern FILE *grprsm;
+
+extern int  CGRIBEX_Debug;
+
+void   gprintf(const char *caller, const char *fmt, ...);
+
+void   grsdef(void);
+
+void   prtbin(int kin, int knbit, int *kout, int *kerr);
+void   confp3(double pval, int *kexp, int *kmant, int kbits, int kround);
+double decfp2(int kexp, int kmant);
+void   ref2ibm(double *pref, int kbits);
+
+void   scaleComplex(double *fpdata, int pcStart, int pcScale, int trunc, int inv);
+void   scatterComplex(double *fpdata, int pcStart, int trunc, int nsp);
+void   gatherComplex(double *fpdata, int pcStart, int trunc, int nsp);
+
+void   scm0(double *pdl, double *pdr, double *pfl, double *pfr, int klg);
+int    rowina2(double *p, int ko, int ki, double *pw,
+	       int kcode, double msval, int *kret);
+int    rowina3(double *p, int ko, int ki, double *pw,
+	       int kcode, double msval, int *kret, int omisng, int operio, int oveggy);
+int    qu2reg2(double *pfield, int *kpoint, int klat, int klon,
+	       double *ztemp, double msval, int *kret);
+int    qu2reg3(double *pfield, int *kpoint, int klat, int klon,
+	       double msval, int *kret, int omisng, int operio, int oveggy);
+
+#if  defined  (INT32)
+long   packInt32(unsigned INT32 *up, unsigned char *cp, long bc, long tc);
+#endif
+long   packInt64(unsigned INT64 *up, unsigned char *cp, long bc, long tc);
+#if  defined  (INT32)
+long   unpackInt32(unsigned char *cp, unsigned INT32 *up, long bc, long tc);
+#endif
+long   unpackInt64(unsigned char *cp, unsigned INT64 *up, long bc, long tc);
+
+void  gribEncode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+		 double *fsec3, int *isec4, double *fsec4, int klenp, int *kgrib,
+		 int kleng, int *kword, int efunc, int *kret);
+
+void  gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+		 double *fsec3, int *isec4, double *fsec4, int klenp, int *kgrib,
+		 int kleng, int *kword, int dfunc, int *kret);
+
+#endif  /* _GRIB_INT_H */
+#ifndef _GRIBDECODE_H
+#define _GRIBDECODE_H
+
+#define  UNDEFINED          9.999e20
+
+
+#define  GET_INT3(a,b,c)    ((1-(int) ((unsigned) (a & 128) >> 6)) * (int) (((a & 127) << 16)+(b<<8)+c))
+#define  GET_INT2(a,b)      ((1-(int) ((unsigned) (a & 128) >> 6)) * (int) (((a & 127) << 8) + b))
+#define  GET_INT1(a)        ((1-(int) ((unsigned) (a & 128) >> 6)) * (int) (a&127))
+
+/* this requires a 32-bit default integer machine */
+#define  GET_UINT4(a,b,c,d) ((int) ((a << 24) + (b << 16) + (c << 8) + (d)))
+#define  GET_UINT3(a,b,c)   ((int) ((a << 16) + (b << 8)  + (c)))
+#define  GET_UINT2(a,b)     ((int) ((a << 8)  + (b)))
+#define  GET_UINT1(a)       ((int)  (a))
+
+#define  BUDG_START(s)      (s[0]=='B' && s[1]=='U' && s[2]=='D' && s[3]=='G')
+#define  TIDE_START(s)      (s[0]=='T' && s[1]=='I' && s[2]=='D' && s[3]=='E')
+#define  GRIB_START(s)      (s[0]=='G' && s[1]=='R' && s[2]=='I' && s[3]=='B')
+#define  GRIB_FIN(s)        (s[0]=='7' && s[1]=='7' && s[2]=='7' && s[3]=='7')
+
+/* GRIB1 Section 0: Indicator Section (IS) */
+
+#define  GRIB1_SECLEN(s)     GET_INT3(s[ 4], s[ 5], s[ 6])
+#define  GRIB_EDITION(s)     GET_UINT1(s[ 7])
+
+/* GRIB1 Section 1: Product Definition Section (PDS) */
+
+#define  PDS_Len             GET_UINT3(pds[ 0], pds[ 1], pds[ 2])
+#define  PDS_CodeTable       GET_UINT1(pds[ 3])
+#define  PDS_CenterID        GET_UINT1(pds[ 4])
+#define  PDS_ModelID         GET_UINT1(pds[ 5])
+#define  PDS_GridDefinition  GET_UINT1(pds[ 6])
+#define  PDS_Sec2Or3Flag     GET_UINT1(pds[ 7])
+#define  PDS_HAS_GDS         ((pds[7] & 128) != 0)
+#define  PDS_HAS_BMS         ((pds[7] &  64) != 0)
+#define  PDS_Parameter       GET_UINT1(pds[ 8])
+#define  PDS_LevelType       GET_UINT1(pds[ 9])
+#define  PDS_Level1          (pds[10])
+#define  PDS_Level2	     (pds[11])
+#define  PDS_Level	     GET_UINT2(pds[10], pds[11])
+#define  PDS_Year            GET_INT1(pds[12])
+#define  PDS_Month           GET_UINT1(pds[13])
+#define  PDS_Day             GET_UINT1(pds[14])
+#define  PDS_Hour            GET_UINT1(pds[15])
+#define  PDS_Minute          GET_UINT1(pds[16])
+#define  PDS_Date            (PDS_Year*10000+PDS_Month*100+PDS_Day)
+#define  PDS_Time            (PDS_Hour*100+PDS_Minute)
+#define  PDS_TimeUnit        GET_UINT1(pds[17])
+#define  PDS_TimePeriod1     GET_UINT1(pds[18])
+#define  PDS_TimePeriod2     GET_UINT1(pds[19])
+#define  PDS_TimeRange       GET_UINT1(pds[20])
+#define  PDS_AvgNum          GET_UINT2(pds[21], pds[22])
+#define  PDS_AvgMiss         GET_UINT1(pds[23])
+#define  PDS_Century         GET_UINT1(pds[24])
+#define  PDS_Subcenter       GET_UINT1(pds[25])
+#define  PDS_DecimalScale    GET_INT2(pds[26],pds[27])
+
+
+/* GRIB1 Section 2: Grid Description Section (GDS) */
+
+#define  GDS_Len             ((gds) == NULL ? 0 : GET_UINT3(gds[ 0], gds[ 1], gds[ 2]))
+#define  GDS_NV              GET_UINT1(gds[ 3])
+#define  GDS_PVPL            GET_UINT1(gds[ 4])
+#define  GDS_PV	             ((gds[3] ==    0) ? -1 : (int) gds[4] - 1)
+#define  GDS_PL	             ((gds[4] == 0xFF) ? -1 : (int) gds[3] * 4 + (int) gds[4] - 1)
+#define  GDS_GridType        GET_UINT1(gds[ 5])
+
+
+/* GRIB1 Triangular grid of DWD */
+#define  GDS_GME_NI2         GET_UINT2(gds[ 6], gds[ 7])
+#define  GDS_GME_NI3         GET_UINT2(gds[ 8], gds[ 9])
+#define  GDS_GME_ND          GET_UINT3(gds[10], gds[11], gds[12])
+#define  GDS_GME_NI          GET_UINT3(gds[13], gds[14], gds[15])
+#define  GDS_GME_AFlag       GET_UINT1(gds[16])
+#define  GDS_GME_LatPP       GET_INT3(gds[17], gds[18], gds[19])
+#define  GDS_GME_LonPP       GET_INT3(gds[20], gds[21], gds[22])
+#define  GDS_GME_LonMPL      GET_INT3(gds[23], gds[24], gds[25])
+#define  GDS_GME_BFlag       GET_UINT1(gds[27])
+
+/* GRIB1 Spectral */
+#define  GDS_PentaJ          GET_UINT2(gds[ 6], gds[ 7])
+#define  GDS_PentaK          GET_UINT2(gds[ 8], gds[ 9])
+#define  GDS_PentaM          GET_UINT2(gds[10], gds[11])
+#define  GDS_RepType         GET_UINT1(gds[12])
+#define  GDS_RepMode         GET_UINT1(gds[13])
+
+/* GRIB1 Regular grid */
+#define  GDS_NumLon          GET_UINT2(gds[ 6], gds[ 7])
+#define  GDS_NumLat          GET_UINT2(gds[ 8], gds[ 9])
+#define  GDS_FirstLat        GET_INT3(gds[10], gds[11], gds[12])
+#define  GDS_FirstLon        GET_INT3(gds[13], gds[14], gds[15])
+#define  GDS_ResFlag         GET_UINT1(gds[16])
+#define  GDS_LastLat         GET_INT3(gds[17], gds[18], gds[19])
+#define  GDS_LastLon         GET_INT3(gds[20], gds[21], gds[22])
+#define  GDS_LonIncr         GET_UINT2(gds[23], gds[24])
+#define  GDS_LatIncr         GET_UINT2(gds[25], gds[26])
+#define  GDS_NumPar          GET_UINT2(gds[25], gds[26])
+#define  GDS_ScanFlag        GET_UINT1(gds[27])
+#define  GDS_LatSP           GET_INT3(gds[32], gds[33], gds[34])
+#define  GDS_LonSP           GET_INT3(gds[35], gds[36], gds[37])
+#define  GDS_RotAngle        GET_Real(&(gds[38]))
+
+/* GRIB1 Lambert */
+#define  GDS_Lambert_Lov     GET_INT3(gds[17], gds[18], gds[19])
+#define  GDS_Lambert_dx	     GET_INT3(gds[20], gds[21], gds[22])
+#define  GDS_Lambert_dy	     GET_INT3(gds[23], gds[24], gds[25])
+#define  GDS_Lambert_ProjFlag GET_UINT1(gds[26])
+#define  GDS_Lambert_LatS1   GET_INT3(gds[28], gds[29], gds[30])
+#define  GDS_Lambert_LatS2   GET_INT3(gds[31], gds[32], gds[33])
+#define  GDS_Lambert_LatSP   GET_INT3(gds[34], gds[35], gds[36])
+#define  GDS_Lambert_LonSP   GET_INT3(gds[37], gds[37], gds[37])
+
+/* GRIB1 Section 3: Bit Map Section (BMS) */
+
+#define  BMS_Len	     ((bms) == NULL ? 0 : (int) (bms[0]<<16)+(bms[1]<<8)+bms[2])
+#define  BMS_UnusedBits      (bms[3])
+#define  BMS_Numeric         
+#define  BMS_Bitmap	     ((bms) == NULL ? NULL : (bms)+6)
+#define  BMS_BitmapSize      (((((bms[0]<<16)+(bms[1]<<8)+bms[2]) - 6)<<3) - bms[3])
+
+/* GRIB1 Section 4: Binary Data Section (BDS) */
+
+#define  BDS_Len	    ((int) ((bds[0]<<16)+(bds[1]<<8)+bds[2]))
+#define  BDS_Flag	    (bds[3])
+#define  BDS_BinScale       GET_INT2(bds[ 4], bds[ 5])
+#define  BDS_RefValue       decfp2((int)bds[ 6], GET_UINT3(bds[ 7], bds[ 8], bds[ 9]))
+#define  BDS_NumBits        ((int) bds[10])
+#define  BDS_RealCoef       decfp2((int)bds[zoff+11], GET_UINT3(bds[zoff+12], bds[zoff+13], bds[zoff+14]))
+#define  BDS_PackData       ((int) ((bds[zoff+11]<<8) + bds[zoff+12]))
+#define  BDS_Power          GET_INT2(bds[zoff+13], bds[zoff+14])
+#define  BDS_Z              (bds[13])
+
+/* GRIB1 Section 5: End Section (ES) */
+
+/* GRIB2 */
+
+#define  GRIB2_SECLEN(section)   (GET_UINT4(section[0], section[1], section[2], section[3]))
+#define  GRIB2_SECNUM(section)   (GET_UINT1(section[4]))
+
+#endif  /* _GRIBDECODE_H */
+#ifndef _GRIBENCODE_H
+#define _GRIBENCODE_H
+
+
+#define PutnZero(n) \
+{ \
+  int i; \
+  for ( i = z; i < z+n; i++ ) lGrib[i] = 0; \
+  z += n; \
+}
+
+#define Put1Byte(Value)  (lGrib[z++] = (Value))
+#define Put2Byte(Value) ((lGrib[z++] = (Value) >>  8), \
+                         (lGrib[z++] = (Value)))
+#define Put3Byte(Value) ((lGrib[z++] = (Value) >> 16), \
+                         (lGrib[z++] = (Value) >>  8), \
+                         (lGrib[z++] = (Value)))
+#define Put4Byte(Value) ((lGrib[z++] = (Value) >> 24), \
+                         (lGrib[z++] = (Value) >> 16), \
+                         (lGrib[z++] = (Value) >>  8), \
+                         (lGrib[z++] = (Value)))
+
+#define Put1Int(Value)  {ival = Value; if ( ival < 0 ) ival =     0x80 - ival; Put1Byte(ival);}
+#define Put2Int(Value)  {ival = Value; if ( ival < 0 ) ival =   0x8000 - ival; Put2Byte(ival);}
+#define Put3Int(Value)  {ival = Value; if ( ival < 0 ) ival = 0x800000 - ival; Put3Byte(ival);}
+
+#define Put1Real(Value)          \
+{                                \
+  confp3(Value, &exponent, &mantissa, BitsPerInt, 1); \
+  Put1Byte(exponent);            \
+  Put3Byte(mantissa);            \
+}
+
+#endif  /* _GRIBENCODE_H */
+#include <stdio.h>
+#include <math.h>
+
+
+double _pow2tab[158] = {
+ /* pow(2.0,  0.0) */  1.0,
+ /* pow(2.0,  1.0) */  2.0,
+ /* pow(2.0,  2.0) */  4.0,
+ /* pow(2.0,  3.0) */  8.0,
+ /* pow(2.0,  4.0) */  16.0,
+ /* pow(2.0,  5.0) */  32.0,
+ /* pow(2.0,  6.0) */  64.0,
+ /* pow(2.0,  7.0) */  128.0,
+ /* pow(2.0,  8.0) */  256.0,
+ /* pow(2.0,  9.0) */  512.0,
+ /* pow(2.0, 10.0) */  1024.0,
+ /* pow(2.0, 11.0) */  2048.0,
+ /* pow(2.0, 12.0) */  4096.0,
+ /* pow(2.0, 13.0) */  8192.0,
+ /* pow(2.0, 14.0) */  16384.0,
+ /* pow(2.0, 15.0) */  32768.0,
+ /* pow(2.0, 16.0) */  65536.0,
+ /* pow(2.0, 17.0) */  131072.0,
+ /* pow(2.0, 18.0) */  262144.0,
+ /* pow(2.0, 19.0) */  524288.0,
+ /* pow(2.0, 20.0) */  1048576.0,
+ /* pow(2.0, 21.0) */  2097152.0,
+ /* pow(2.0, 22.0) */  4194304.0,
+ /* pow(2.0, 23.0) */  8388608.0,
+ /* pow(2.0, 24.0) */  16777216.0,
+ /* pow(2.0, 25.0) */  33554432.0,
+ /* pow(2.0, 26.0) */  67108864.0,
+ /* pow(2.0, 27.0) */  134217728.0,
+ /* pow(2.0, 28.0) */  268435456.0,
+ /* pow(2.0, 29.0) */  536870912.0,
+ /* pow(2.0, 30.0) */  1073741824.0,
+ /* pow(2.0, 31.0) */  2147483648.0,
+ /* pow(2.0, 32.0) */  4294967296.0,
+ /* pow(2.0, 33.0) */  8589934592.0,
+ /* pow(2.0, 34.0) */  17179869184.0,
+ /* pow(2.0, 35.0) */  34359738368.0,
+ /* pow(2.0, 36.0) */  68719476736.0,
+ /* pow(2.0, 37.0) */  137438953472.0,
+ /* pow(2.0, 38.0) */  274877906944.0,
+ /* pow(2.0, 39.0) */  549755813888.0,
+ /* pow(2.0, 40.0) */  1099511627776.0,
+ /* pow(2.0, 41.0) */  2199023255552.0,
+ /* pow(2.0, 42.0) */  4398046511104.0,
+ /* pow(2.0, 43.0) */  8796093022208.0,
+ /* pow(2.0, 44.0) */  17592186044416.0,
+ /* pow(2.0, 45.0) */  35184372088832.0,
+ /* pow(2.0, 46.0) */  70368744177664.0,
+ /* pow(2.0, 47.0) */  140737488355328.0,
+ /* pow(2.0, 48.0) */  281474976710656.0,
+ /* pow(2.0, 49.0) */  562949953421312.0,
+ /* pow(2.0, 50.0) */  1125899906842624.0,
+ /* pow(2.0, 51.0) */  2251799813685248.0,
+ /* pow(2.0, 52.0) */  4503599627370496.0,
+ /* pow(2.0, 53.0) */  9007199254740992.0,
+ /* pow(2.0, 54.0) */  18014398509481984.0,
+ /* pow(2.0, 55.0) */  36028797018963968.0,
+ /* pow(2.0, 56.0) */  72057594037927936.0,
+ /* pow(2.0, 57.0) */  144115188075855872.0,
+ /* pow(2.0, 58.0) */  288230376151711744.0,
+ /* pow(2.0, 59.0) */  576460752303423488.0,
+ /* pow(2.0, 60.0) */  1152921504606846976.0,
+ /* pow(2.0, 61.0) */  2305843009213693952.0,
+ /* pow(2.0, 62.0) */  4611686018427387904.0,
+ /* pow(2.0, 63.0) */  9223372036854775808.0,
+ /* pow(2.0, 64.0) */  18446744073709551616.0,
+ /* pow(2.0, 65.0) */  36893488147419103232.0,
+ /* pow(2.0, 66.0) */  73786976294838206464.0,
+ /* pow(2.0, 67.0) */  147573952589676412928.0,
+ /* pow(2.0, 68.0) */  295147905179352825856.0,
+ /* pow(2.0, 69.0) */  590295810358705651712.0,
+ /* pow(2.0, 70.0) */  1180591620717411303424.0,
+ /* pow(2.0, 71.0) */  2361183241434822606848.0,
+ /* pow(2.0, 72.0) */  4722366482869645213696.0,
+ /* pow(2.0, 73.0) */  9444732965739290427392.0,
+ /* pow(2.0, 74.0) */  18889465931478580854784.0,
+ /* pow(2.0, 75.0) */  37778931862957161709568.0,
+ /* pow(2.0, 76.0) */  75557863725914323419136.0,
+ /* pow(2.0, 77.0) */  151115727451828646838272.0,
+ /* pow(2.0, 78.0) */  302231454903657293676544.0,
+ /* pow(2.0, 79.0) */  604462909807314587353088.0,
+ /* pow(2.0, 80.0) */  1208925819614629174706176.0,
+ /* pow(2.0, 81.0) */  2417851639229258349412352.0,
+ /* pow(2.0, 82.0) */  4835703278458516698824704.0,
+ /* pow(2.0, 83.0) */  9671406556917033397649408.0,
+ /* pow(2.0, 84.0) */  19342813113834066795298816.0,
+ /* pow(2.0, 85.0) */  38685626227668133590597632.0,
+ /* pow(2.0, 86.0) */  77371252455336267181195264.0,
+ /* pow(2.0, 87.0) */  154742504910672534362390528.0,
+ /* pow(2.0, 88.0) */  309485009821345068724781056.0,
+ /* pow(2.0, 89.0) */  618970019642690137449562112.0,
+ /* pow(2.0, 90.0) */  1237940039285380274899124224.0,
+ /* pow(2.0, 91.0) */  2475880078570760549798248448.0,
+ /* pow(2.0, 92.0) */  4951760157141521099596496896.0,
+ /* pow(2.0, 93.0) */  9903520314283042199192993792.0,
+ /* pow(2.0, 94.0) */  19807040628566084398385987584.0,
+ /* pow(2.0, 95.0) */  39614081257132168796771975168.0,
+ /* pow(2.0, 96.0) */  79228162514264337593543950336.0,
+ /* pow(2.0, 97.0) */  158456325028528675187087900672.0,
+ /* pow(2.0, 98.0) */  316912650057057350374175801344.0,
+ /* pow(2.0, 99.0) */  633825300114114700748351602688.0,
+ /* pow(2.0, 100.0) */  1267650600228229401496703205376.0,
+ /* pow(2.0, 101.0) */  2535301200456458802993406410752.0,
+ /* pow(2.0, 102.0) */  5070602400912917605986812821504.0,
+ /* pow(2.0, 103.0) */  10141204801825835211973625643008.0,
+ /* pow(2.0, 104.0) */  20282409603651670423947251286016.0,
+ /* pow(2.0, 105.0) */  40564819207303340847894502572032.0,
+ /* pow(2.0, 106.0) */  81129638414606681695789005144064.0,
+ /* pow(2.0, 107.0) */  162259276829213363391578010288128.0,
+ /* pow(2.0, 108.0) */  324518553658426726783156020576256.0,
+ /* pow(2.0, 109.0) */  649037107316853453566312041152512.0,
+ /* pow(2.0, 110.0) */  1298074214633706907132624082305024.0,
+ /* pow(2.0, 111.0) */  2596148429267413814265248164610048.0,
+ /* pow(2.0, 112.0) */  5192296858534827628530496329220096.0,
+ /* pow(2.0, 113.0) */  10384593717069655257060992658440192.0,
+ /* pow(2.0, 114.0) */  20769187434139310514121985316880384.0,
+ /* pow(2.0, 115.0) */  41538374868278621028243970633760768.0,
+ /* pow(2.0, 116.0) */  83076749736557242056487941267521536.0,
+ /* pow(2.0, 117.0) */  166153499473114484112975882535043072.0,
+ /* pow(2.0, 118.0) */  332306998946228968225951765070086144.0,
+ /* pow(2.0, 119.0) */  664613997892457936451903530140172288.0,
+ /* pow(2.0, 120.0) */  1329227995784915872903807060280344576.0,
+ /* pow(2.0, 121.0) */  2658455991569831745807614120560689152.0,
+ /* pow(2.0, 122.0) */  5316911983139663491615228241121378304.0,
+ /* pow(2.0, 123.0) */  10633823966279326983230456482242756608.0,
+ /* pow(2.0, 124.0) */  21267647932558653966460912964485513216.0,
+ /* pow(2.0, 125.0) */  42535295865117307932921825928971026432.0,
+ /* pow(2.0, 126.0) */  85070591730234615865843651857942052864.0,
+ /* pow(2.0, 127.0) */  170141183460469231731687303715884105728.0,
+ /* pow(2.0, 128.0) */  340282366920938463463374607431768211456.0,
+ /* pow(2.0, 129.0) */  680564733841876926926749214863536422912.0,
+ /* pow(2.0, 130.0) */  1361129467683753853853498429727072845824.0,
+ /* pow(2.0, 131.0) */  2722258935367507707706996859454145691648.0,
+ /* pow(2.0, 132.0) */  5444517870735015415413993718908291383296.0,
+ /* pow(2.0, 133.0) */  10889035741470030830827987437816582766592.0,
+ /* pow(2.0, 134.0) */  21778071482940061661655974875633165533184.0,
+ /* pow(2.0, 135.0) */  43556142965880123323311949751266331066368.0,
+ /* pow(2.0, 136.0) */  87112285931760246646623899502532662132736.0,
+ /* pow(2.0, 137.0) */  174224571863520493293247799005065324265472.0,
+ /* pow(2.0, 138.0) */  348449143727040986586495598010130648530944.0,
+ /* pow(2.0, 139.0) */  696898287454081973172991196020261297061888.0,
+ /* pow(2.0, 140.0) */  1393796574908163946345982392040522594123776.0,
+ /* pow(2.0, 141.0) */  2787593149816327892691964784081045188247552.0,
+ /* pow(2.0, 142.0) */  5575186299632655785383929568162090376495104.0,
+ /* pow(2.0, 143.0) */  11150372599265311570767859136324180752990208.0,
+ /* pow(2.0, 144.0) */  22300745198530623141535718272648361505980416.0,
+ /* pow(2.0, 145.0) */  44601490397061246283071436545296723011960832.0,
+ /* pow(2.0, 146.0) */  89202980794122492566142873090593446023921664.0,
+ /* pow(2.0, 147.0) */  178405961588244985132285746181186892047843328.0,
+ /* pow(2.0, 148.0) */  356811923176489970264571492362373784095686656.0,
+ /* pow(2.0, 149.0) */  713623846352979940529142984724747568191373312.0,
+ /* pow(2.0, 150.0) */  1427247692705959881058285969449495136382746624.0,
+ /* pow(2.0, 151.0) */  2854495385411919762116571938898990272765493248.0,
+ /* pow(2.0, 152.0) */  5708990770823839524233143877797980545530986496.0,
+ /* pow(2.0, 153.0) */  11417981541647679048466287755595961091061972992.0,
+ /* pow(2.0, 154.0) */  22835963083295358096932575511191922182123945984.0,
+ /* pow(2.0, 155.0) */  45671926166590716193865151022383844364247891968.0,
+ /* pow(2.0, 156.0) */  91343852333181432387730302044767688728495783936.0,
+ /* pow(2.0, 157.0) */  182687704666362864775460604089535377456991567872.0,
+};
+
+
+double _pow16tab[71] = {
+ /* pow(16.0,  0.0) */  1.0,
+ /* pow(16.0,  1.0) */  16.0,
+ /* pow(16.0,  2.0) */  256.0,
+ /* pow(16.0,  3.0) */  4096.0,
+ /* pow(16.0,  4.0) */  65536.0,
+ /* pow(16.0,  5.0) */  1048576.0,
+ /* pow(16.0,  6.0) */  16777216.0,
+ /* pow(16.0,  7.0) */  268435456.0,
+ /* pow(16.0,  8.0) */  4294967296.0,
+ /* pow(16.0,  9.0) */  68719476736.0,
+ /* pow(16.0, 10.0) */  1099511627776.0,
+ /* pow(16.0, 11.0) */  17592186044416.0,
+ /* pow(16.0, 12.0) */  281474976710656.0,
+ /* pow(16.0, 13.0) */  4503599627370496.0,
+ /* pow(16.0, 14.0) */  72057594037927936.0,
+ /* pow(16.0, 15.0) */  1152921504606846976.0,
+ /* pow(16.0, 16.0) */  18446744073709551616.0,
+ /* pow(16.0, 17.0) */  295147905179352825856.0,
+ /* pow(16.0, 18.0) */  4722366482869645213696.0,
+ /* pow(16.0, 19.0) */  75557863725914323419136.0,
+ /* pow(16.0, 20.0) */  1208925819614629174706176.0,
+ /* pow(16.0, 21.0) */  19342813113834066795298816.0,
+ /* pow(16.0, 22.0) */  309485009821345068724781056.0,
+ /* pow(16.0, 23.0) */  4951760157141521099596496896.0,
+ /* pow(16.0, 24.0) */  79228162514264337593543950336.0,
+ /* pow(16.0, 25.0) */  1267650600228229401496703205376.0,
+ /* pow(16.0, 26.0) */  20282409603651670423947251286016.0,
+ /* pow(16.0, 27.0) */  324518553658426726783156020576256.0,
+ /* pow(16.0, 28.0) */  5192296858534827628530496329220096.0,
+ /* pow(16.0, 29.0) */  83076749736557242056487941267521536.0,
+ /* pow(16.0, 30.0) */  1329227995784915872903807060280344576.0,
+ /* pow(16.0, 31.0) */  21267647932558653966460912964485513216.0,
+ /* pow(16.0, 32.0) */  340282366920938463463374607431768211456.0,
+ /* pow(16.0, 33.0) */  5444517870735015415413993718908291383296.0,
+ /* pow(16.0, 34.0) */  87112285931760246646623899502532662132736.0,
+ /* pow(16.0, 35.0) */  1393796574908163946345982392040522594123776.0,
+ /* pow(16.0, 36.0) */  22300745198530623141535718272648361505980416.0,
+ /* pow(16.0, 37.0) */  356811923176489970264571492362373784095686656.0,
+ /* pow(16.0, 38.0) */  5708990770823839524233143877797980545530986496.0,
+ /* pow(16.0, 39.0) */  91343852333181432387730302044767688728495783936.0,
+ /* pow(16.0, 40.0) */  1461501637330902918203684832716283019655932542976.0,
+ /* pow(16.0, 41.0) */  23384026197294446691258957323460528314494920687616.0,
+ /* pow(16.0, 42.0) */  374144419156711147060143317175368453031918731001856.0,
+ /* pow(16.0, 43.0) */  5986310706507378352962293074805895248510699696029696.0,
+ /* pow(16.0, 44.0) */  95780971304118053647396689196894323976171195136475136.0,
+ /* pow(16.0, 45.0) */  1532495540865888858358347027150309183618739122183602176.0,
+ /* pow(16.0, 46.0) */  24519928653854221733733552434404946937899825954937634816.0,
+ /* pow(16.0, 47.0) */  392318858461667547739736838950479151006397215279002157056.0,
+ /* pow(16.0, 48.0) */  6277101735386680763835789423207666416102355444464034512896.0,
+ /* pow(16.0, 49.0) */  100433627766186892221372630771322662657637687111424552206336.0,
+ /* pow(16.0, 50.0) */  1606938044258990275541962092341162602522202993782792835301376.0,
+ /* pow(16.0, 51.0) */  25711008708143844408671393477458601640355247900524685364822016.0,
+ /* pow(16.0, 52.0) */  411376139330301510538742295639337626245683966408394965837152256.0,
+ /* pow(16.0, 53.0) */  6582018229284824168619876730229402019930943462534319453394436096.0,
+ /* pow(16.0, 54.0) */  105312291668557186697918027683670432318895095400549111254310977536.0,
+ /* pow(16.0, 55.0) */  1684996666696914987166688442938726917102321526408785780068975640576.0,
+ /* pow(16.0, 56.0) */  26959946667150639794667015087019630673637144422540572481103610249216.0,
+ /* pow(16.0, 57.0) */  431359146674410236714672241392314090778194310760649159697657763987456.0,
+ /* pow(16.0, 58.0) */  6901746346790563787434755862277025452451108972170386555162524223799296.0,
+ /* pow(16.0, 59.0) */  110427941548649020598956093796432407239217743554726184882600387580788736.0,
+ /* pow(16.0, 60.0) */  1766847064778384329583297500742918515827483896875618958121606201292619776.0,
+ /* pow(16.0, 61.0) */  28269553036454149273332760011886696253239742350009903329945699220681916416.0,
+ /* pow(16.0, 62.0) */  452312848583266388373324160190187140051835877600158453279131187530910662656.0,
+ /* pow(16.0, 63.0) */  7237005577332262213973186563042994240829374041602535252466099000494570602496.0,
+ /* pow(16.0, 64.0) */  115792089237316195423570985008687907853269984665640564039457584007913129639936.0,
+ /* pow(16.0, 65.0) */  1852673427797059126777135760139006525652319754650249024631321344126610074238976.0,
+ /* pow(16.0, 66.0) */  29642774844752946028434172162224104410437116074403984394101141506025761187823616.0,
+ /* pow(16.0, 67.0) */  474284397516047136454946754595585670566993857190463750305618264096412179005177856.0,
+ /* pow(16.0, 68.0) */  7588550360256754183279148073529370729071901715047420004889892225542594864082845696.0,
+ /* pow(16.0, 69.0) */  121416805764108066932466369176469931665150427440758720078238275608681517825325531136.0,
+ /* pow(16.0, 70.0) */  1942668892225729070919461906823518906642406839052139521251812409738904285205208498176.0,
+};
+
+static int _pow2tab_size = sizeof(_pow2tab)/sizeof(double);
+
+void gen_pow2tab(void)
+{
+  int jloop;
+
+  for ( jloop = 0; jloop < 158; jloop++ )
+    printf(" /* pow(2.0, %2d.0) */  %.1f,\n", jloop,  pow(2.0, (double) jloop));
+}
+
+
+void gen_pow16tab(void)
+{
+  double pval;
+  int iexp;
+
+  for ( iexp = 0; iexp < 71; iexp++ )
+    {
+      pval = pow(16.0, (double)(iexp));
+      printf(" /* pow(16.0, %2d.0) */  %.1f,\n", iexp, pval);
+    }
+}
+
+
+double intpow2(int x)
+{
+  if ( x < _pow2tab_size )
+    return (_pow2tab[x]);
+  else
+    return (pow(2.0, (double) x));
+}
+//#undef _GET_X86_COUNTER
+//#undef _GET_IBM_COUNTER
+//#undef _GET_MACH_COUNTER
+//#undef _ARCH_PWR6
+
+#if   defined(__GNUC__) && (__GNUC__ >= 4)
+#elif defined(__ICC)    && (__ICC >= 1100)
+#elif defined(__clang__)
+#else
+#define DISABLE_SIMD
+#endif
+
+#if defined _GET_IBM_COUNTER
+#include <libhpc.h>
+#elif defined _GET_X86_COUNTER
+#include <x86intrin.h>
+#elif defined _GET_MACH_COUNTER
+#include <mach/mach_time.h>
+#endif
+
+//#define DISABLE_SIMD
+
+#ifdef DISABLE_SIMD
+#ifndef ENABLE_AVX
+#undef __AVX__
+#endif
+#ifndef ENABLE_SSE2
+#undef __SSE2__
+#endif
+#endif
+
+#if defined __AVX__
+#include <float.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <immintrin.h>
+#elif defined __SSE2__
+#include <float.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <emmintrin.h>
+#endif
+
+#if defined __AVX__
+
+static
+void avx_minmax_val(const double *restrict buf, size_t nframes, double *min, double *max)
+{
+  double fmin[4], fmax[4];
+  __m256d current_max, current_min, work;
+
+  // load max and min values into all four slots of the YMM registers
+  current_min = _mm256_set1_pd(*min);
+  current_max = _mm256_set1_pd(*max);
+
+  // Work input until "buf" reaches 32 byte alignment
+  while ( ((unsigned long)buf) % 32 != 0 && nframes > 0) {
+
+    // Load the next double into the work buffer
+    work = _mm256_set1_pd(*buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf++;
+    nframes--;
+  }
+
+  while (nframes >= 16) {
+
+    (void) _mm_prefetch(buf+8, _MM_HINT_NTA);
+
+    work = _mm256_load_pd(buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf += 4;
+
+    work = _mm256_load_pd(buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf += 4;
+
+    (void) _mm_prefetch(buf+8, _MM_HINT_NTA);
+
+    work = _mm256_load_pd(buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf += 4;
+
+    work = _mm256_load_pd(buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf += 4;
+    nframes -= 16;
+  }
+
+  // work through aligned buffers
+  while (nframes >= 4) {
+    work = _mm256_load_pd(buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf += 4;
+    nframes -= 4;
+  }
+
+  // work through the remainung values
+  while ( nframes > 0) {
+    work = _mm256_set1_pd(*buf);
+    current_min = _mm256_min_pd(current_min, work);
+    current_max = _mm256_max_pd(current_max, work);
+    buf++;
+    nframes--;
+  }
+
+  // find min & max value through shuffle tricks
+
+  work = current_min;
+  work = _mm256_shuffle_pd(work, work, 5);
+  work = _mm256_min_pd (work, current_min);
+  current_min = work;
+  work = _mm256_permute2f128_pd(work, work, 1);
+  work = _mm256_min_pd (work, current_min);
+  _mm256_storeu_pd(fmin, work);
+
+  work = current_max;
+  work = current_max;
+  work = _mm256_shuffle_pd(work, work, 5);
+  work = _mm256_max_pd (work, current_max);
+  current_max = work;
+  work = _mm256_permute2f128_pd(work, work, 1);
+  work = _mm256_max_pd (work, current_max);
+  _mm256_storeu_pd(fmax, work);
+
+  *min = fmin[0];
+  *max = fmax[0];
+
+  return;
+}
+
+#elif defined __SSE2__
+
+static
+void sse2_minmax_val(const double *restrict buf, size_t nframes, double *min, double *max)
+{
+  __m128d current_max, current_min, work;
+  
+  // load starting max and min values into all slots of the XMM registers
+  current_min = _mm_set1_pd(*min);
+  current_max = _mm_set1_pd(*max);
+  
+  // work on input until buf reaches 16 byte alignment
+  while ( ((unsigned long)buf) % 16 != 0 && nframes > 0) {
+    
+    // load one double and replicate
+    work = _mm_set1_pd(*buf);    
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);    
+    buf++;
+    nframes--;
+  }
+  
+  while (nframes >= 8) {
+    // use 64 byte prefetch for double octetts
+    // __builtin_prefetch(buf+64,0,0); // for GCC 4.3.2 +
+
+    work = _mm_load_pd(buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf += 2;
+    work = _mm_load_pd(buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf += 2;
+    work = _mm_load_pd(buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf += 2;
+    work = _mm_load_pd(buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf += 2;
+    nframes -= 8;
+  }
+
+  // work through smaller chunks of aligned buffers without prefetching
+  while (nframes >= 2) {
+    work = _mm_load_pd(buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf += 2;
+    nframes -= 2;
+  }
+
+  // work through the remaining value
+  while ( nframes > 0) {
+    // load the last double and replicate
+    work = _mm_set1_pd(*buf);
+    current_min = _mm_min_pd(current_min, work);
+    current_max = _mm_max_pd(current_max, work);
+    buf++;
+    nframes--;
+  }
+
+  // find final min and max value through shuffle tricks
+  work = current_min;
+  work = _mm_shuffle_pd(work, work, _MM_SHUFFLE2(0, 1));
+  work = _mm_min_pd (work, current_min);
+  _mm_store_sd(min, work);
+  work = current_max;
+  work = _mm_shuffle_pd(work, work, _MM_SHUFFLE2(0, 1));
+  work = _mm_max_pd (work, current_max);
+  _mm_store_sd(max, work);
+
+  return;
+}
+
+#endif
+
+static
+void minmax_val(const double *restrict data, long idatasize, double *fmin, double *fmax)
+{
+#if defined _GET_X86_COUNTER || defined _GET_MACH_COUNTER 
+  uint64_t start_minmax, end_minmax;
+#endif
+  size_t datasize = idatasize;
+
+  if ( idatasize < 1 ) return;
+
+#ifdef _GET_X86_COUNTER 
+  start_minmax = _rdtsc();
+#endif
+#ifdef _GET_MACH_COUNTER 
+  start_minmax = mach_absolute_time();
+#endif
+
+#if defined __AVX__
+
+  avx_minmax_val(data, datasize, fmin, fmax);
+
+#elif defined __SSE2__
+
+  sse2_minmax_val(data, datasize, fmin, fmax);
+
+#else
+
+#ifdef _ARCH_PWR6
+#define __UNROLL_DEPTH_1 6
+
+  // to allow pipelining we have to unroll 
+
+#ifdef _GET_IBM_COUNTER 
+  hpmStart(1, "minmax fsel");
+#endif
+  {
+    size_t i, j;
+    size_t residual =  datasize % __UNROLL_DEPTH_1;
+    size_t ofs = datasize - residual;
+    double register dmin[__UNROLL_DEPTH_1];
+    double register dmax[__UNROLL_DEPTH_1];
+
+    for ( j = 0; j < __UNROLL_DEPTH_1; j++) 
+      {
+	dmin[j] = data[0];
+	dmax[j] = data[0];
+      }
+    
+    for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_1 ) 
+      {
+	for (j = 0; j < __UNROLL_DEPTH_1; j++) 
+	  {
+	    dmin[j] = __fsel(dmin[j] - data[i+j], data[i+j], dmin[j]);
+	    dmax[j] = __fsel(data[i+j] - dmax[j], data[i+j], dmax[j]);
+	  }
+      }
+
+    for (j = 0; j < residual; j++) 
+      {
+	dmin[j] = __fsel(dmin[j] - data[ofs+j], data[ofs+j], dmin[j]);
+	dmax[j] = __fsel(data[ofs+j] - dmax[j], data[ofs+j], dmax[j]);
+      }
+
+    for ( j = 0; j < __UNROLL_DEPTH_1; j++) 
+      {
+	*fmin = __fsel(*fmin - dmin[j], dmin[j], *fmin);
+	*fmax = __fsel(dmax[j] - *fmax, dmax[j], *fmax);
+      }
+  }
+#ifdef _GET_IBM_COUNTER 
+  hpmStop(1);
+#endif
+
+#undef __UNROLL_DEPTH_1
+
+#else // original loop
+
+#ifdef _GET_IBM_COUNTER 
+  hpmStart(1, "minmax base");
+#endif
+  {
+    size_t i;
+
+#if   defined (CRAY)
+#pragma _CRI ivdep
+#elif defined (SX)
+#pragma vdir nodep
+#elif defined (__uxp__)
+#pragma loop novrec
+#endif
+    for ( i = 0; i < datasize; ++i )
+      {
+	if ( *fmin > data[i] ) *fmin = data[i];
+	if ( *fmax < data[i] ) *fmax = data[i];
+	/*
+	 *fmin = *fmin < data[i] ? *fmin : data[i];
+	 *fmax = *fmax > data[i] ? *fmax : data[i];
+	 */
+      }
+  }
+#ifdef _GET_IBM_COUNTER 
+  hpmStop(1);
+#endif
+
+#endif // _ARCH_PWR6 && original loop
+#endif // SIMD
+
+#if defined _GET_X86_COUNTER || defined _GET_MACH_COUNTER
+#ifdef _GET_X86_COUNTER 
+  end_minmax = _rdtsc();
+#endif
+#ifdef _GET_MACH_COUNTER 
+  end_minmax = mach_absolute_time();
+#endif
+#if defined __AVX__
+  printf("AVX minmax cycles:: %" PRIu64 "\n", 
+	 end_minmax-start_minmax);
+  fprintf (stderr, "AVX min: %lf max: %lf\n", *fmin, *fmax);
+#elif defined __SSE2__
+  printf("SSE2 minmax cycles:: %" PRIu64 "\n", 
+	 end_minmax-start_minmax);
+  fprintf (stderr, "SSE2 min: %lf max: %lf\n", *fmin, *fmax);
+#else
+  printf("loop minmax cycles:: %" PRIu64 "\n", 
+	 end_minmax-start_minmax);
+  fprintf (stderr, "loop min: %lf max: %lf\n", *fmin, *fmax);
+#endif
+#endif
+
+  return;
+}
+//#undef _GET_X86_COUNTER
+//#undef _GET_MACH_COUNTER
+//#undef _GET_IBM_COUNTER
+//#undef _ARCH_PWR6
+
+#include <stdint.h>
+
+#if   defined(__GNUC__) && (__GNUC__ >= 4)
+#elif defined(__ICC)    && (__ICC >= 1100)
+#elif defined(__clang__)
+#else
+#define DISABLE_SIMD
+#endif
+
+#if defined _GET_IBM_COUNTER
+#include <libhpc.h>
+#elif defined _GET_X86_COUNTER
+#include <x86intrin.h>
+#elif defined _GET_MACH_COUNTER
+#include <mach/mach_time.h>
+#endif
+
+//#define DISABLE_SIMD
+
+#ifdef DISABLE_SIMD
+#ifndef ENABLE_AVX
+#undef __AVX__
+#endif
+#ifndef ENABLE_SSE4_1
+#undef __SSE4_1__
+#endif
+#endif
+
+#if defined __AVX__
+#include <immintrin.h>
+#elif defined __SSE4_1__
+#include <smmintrin.h>
+#endif
+
+#if defined __AVX__
+
+static
+void avx_encode_double_array_2byte(size_t datasize, 
+				   unsigned char * restrict lGrib,
+				   const double * restrict data, 
+				   double zref, double factor, size_t *gz) 
+{
+  size_t i, j;
+  const double *dval = data;
+  __m128i *sgrib = (__m128i *) (lGrib+(*gz));
+
+  const __m128i swap = _mm_set_epi8(14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1);
+
+  const __m256d c0 = _mm256_set1_pd(zref);
+  const __m256d c1 = _mm256_set1_pd(factor);
+  const __m256d c2 = _mm256_set1_pd(0.5);
+  
+  __m256d d0, d3, d2, d1;
+  __m128i i0, i1, i2, i3;
+  __m128i s0, s1;  
+
+  for (i = 0; i < datasize; i += 16)
+    {
+      (void) _mm_prefetch(dval+8, _MM_HINT_NTA);
+      //_____________________________________________________________________________
+
+      d0 = _mm256_loadu_pd (dval);
+      d0 = _mm256_sub_pd (d0, c0);
+      d0 = _mm256_mul_pd (d0, c1);
+      d0 = _mm256_add_pd (d0, c2);
+
+      i0 = _mm256_cvttpd_epi32 (d0);
+      
+      //_____________________________________________________________________________
+      
+      d1 = _mm256_loadu_pd (dval+4);
+      d1 = _mm256_sub_pd (d1, c0);
+      d1 = _mm256_mul_pd (d1, c1);
+      d1 = _mm256_add_pd (d1, c2);
+      
+      i1 = _mm256_cvttpd_epi32 (d1);
+
+      //_____________________________________________________________________________
+
+      s0 = _mm_packus_epi32(i0, i1);
+      s0 = _mm_shuffle_epi8 (s0, swap);
+      (void) _mm_storeu_si128 (sgrib, s0);
+
+      //_____________________________________________________________________________
+
+      (void) _mm_prefetch(dval+16, _MM_HINT_NTA);
+
+      //_____________________________________________________________________________
+      
+      d2 = _mm256_loadu_pd (dval+8);
+      d2 = _mm256_sub_pd (d2, c0);
+      d2 = _mm256_mul_pd (d2, c1);
+      d2 = _mm256_add_pd (d2, c2);
+      
+      i2 = _mm256_cvttpd_epi32 (d2);
+
+      //_____________________________________________________________________________
+      
+      d3 = _mm256_loadu_pd (dval+12);
+      d3 = _mm256_sub_pd (d3, c0);
+      d3 = _mm256_mul_pd (d3, c1);
+      d3 = _mm256_add_pd (d3, c2);
+      
+      i3 = _mm256_cvttpd_epi32 (d3);
+
+      //_____________________________________________________________________________
+
+      s1 = _mm_packus_epi32(i2, i3);
+      s1 = _mm_shuffle_epi8 (s1, swap);
+      (void) _mm_storeu_si128 (sgrib+1, s1);
+
+      //_____________________________________________________________________________
+           
+      dval += 16;
+      sgrib += 2;
+    }
+
+  if (i != datasize)
+    {
+      uint16_t ui16;
+      i -= 16;
+      for ( j = i; j < datasize; j++ )
+	{
+	  ui16 = (uint16_t) ((data[j] - zref) * factor + 0.5);
+	  lGrib[*gz+2*j  ] = ui16 >>  8;
+	  lGrib[*gz+2*j+1] = ui16;
+	}
+    }
+  
+  *gz += 2*datasize;
+
+  return;
+}
+
+#elif defined __SSE4_1__
+
+static
+void sse41_encode_double_array_2byte(size_t datasize, 
+				     unsigned char * restrict lGrib,
+				     const double * restrict data, 
+				     double zref, double factor, size_t *gz) 
+{
+  size_t i, j;
+  const double *dval = data;
+  __m128i *sgrib = (__m128i *) (lGrib+(*gz));
+
+  const __m128i swap = _mm_set_epi8(14, 15, 12, 13, 10, 11, 8, 9, 6, 7, 4, 5, 2, 3, 0, 1);
+
+  const __m128d c0 = _mm_set1_pd(zref);
+  const __m128d c1 = _mm_set1_pd(factor);
+  const __m128d c2 = _mm_set1_pd(0.5);
+  
+  __m128d d0, d4, d3, d2, d1;
+  __m128i i0, i1, i2, i3, i4;
+  __m128i s0, s1;  
+
+  for (i = 0; i < datasize; i += 16)
+    {
+      (void) _mm_prefetch(dval+8, _MM_HINT_NTA);
+      //_____________________________________________________________________________
+
+      d0 = _mm_loadu_pd (dval);
+      d0 = _mm_sub_pd (d0, c0);
+      d0 = _mm_mul_pd (d0, c1);
+      d0 = _mm_add_pd (d0, c2);
+      
+      d4 = _mm_loadu_pd (dval+2);
+      d4 = _mm_sub_pd (d4, c0);
+      d4 = _mm_mul_pd (d4, c1);
+      d4 = _mm_add_pd (d4, c2);
+
+      i0 = _mm_cvttpd_epi32 (d0);
+      i4 = _mm_cvttpd_epi32 (d4);  
+      i0 = _mm_unpacklo_epi64 (i0, i4);
+
+      //_____________________________________________________________________________
+      
+      d1 = _mm_loadu_pd (dval+4);
+      d1 = _mm_sub_pd (d1, c0);
+      d1 = _mm_mul_pd (d1, c1);
+      d1 = _mm_add_pd (d1, c2);
+      
+      d4 = _mm_loadu_pd (dval+6);
+      d4 = _mm_sub_pd (d4, c0);
+      d4 = _mm_mul_pd (d4, c1);
+      d4 = _mm_add_pd (d4, c2);
+      
+      i1 = _mm_cvttpd_epi32 (d1);
+      i4 = _mm_cvttpd_epi32 (d4);  
+      i1 = _mm_unpacklo_epi64 (i1, i4);
+
+      //_____________________________________________________________________________
+
+      s0 = _mm_packus_epi32(i0, i1);
+      s0 = _mm_shuffle_epi8 (s0, swap);
+      (void) _mm_storeu_si128 (sgrib, s0);
+
+      //_____________________________________________________________________________
+
+      (void) _mm_prefetch(dval+16, _MM_HINT_NTA);
+
+      //_____________________________________________________________________________
+      
+      d2 = _mm_loadu_pd (dval+8);
+      d2 = _mm_sub_pd (d2, c0);
+      d2 = _mm_mul_pd (d2, c1);
+      d2 = _mm_add_pd (d2, c2);
+      
+      d4 = _mm_loadu_pd (dval+10);
+      d4 = _mm_sub_pd (d4, c0);
+      d4 = _mm_mul_pd (d4, c1);
+      d4 = _mm_add_pd (d4, c2);
+      
+      i2 = _mm_cvttpd_epi32 (d2);
+      i4  = _mm_cvttpd_epi32 (d4);  
+      i2 = _mm_unpacklo_epi64 (i2, i4);
+
+      //_____________________________________________________________________________
+      
+      d3 = _mm_loadu_pd (dval+12);
+      d3 = _mm_sub_pd (d3, c0);
+      d3 = _mm_mul_pd (d3, c1);
+      d3 = _mm_add_pd (d3, c2);
+      
+      d4 = _mm_loadu_pd (dval+14);
+      d4 = _mm_sub_pd (d4, c0);
+      d4 = _mm_mul_pd (d4, c1);
+      d4 = _mm_add_pd (d4, c2);
+      
+      i3 = _mm_cvttpd_epi32 (d3);
+      i4 = _mm_cvttpd_epi32 (d4);  
+      i3 = _mm_unpacklo_epi64 (i3, i4);
+
+      //_____________________________________________________________________________
+
+      s1 = _mm_packus_epi32(i2, i3);
+      s1 = _mm_shuffle_epi8 (s1, swap);
+      (void) _mm_storeu_si128 (sgrib+1, s1);
+
+      //_____________________________________________________________________________
+           
+      dval += 16;
+      sgrib += 2;
+    }
+
+  if (i != datasize) 
+    {
+      uint16_t ui16;
+      i -= 16;  
+      for ( j = i; j < datasize; j++ )
+	{
+	  ui16 = (uint16_t) ((data[j] - zref) * factor + 0.5);
+	  lGrib[*gz+2*j  ] = ui16 >>  8;
+	  lGrib[*gz+2*j+1] = ui16;
+	}
+    }
+
+  *gz += 2*datasize;
+  
+  return;
+}
+
+#endif // SIMD variants
+
+static
+void encode_double_array_common(int numBits, size_t packStart, size_t datasize, GRIBPACK *lGrib,
+				const double *data, double zref, double factor, size_t *gz)
+{
+  size_t i, z = *gz;
+  unsigned int ival;
+  int cbits, jbits;
+  unsigned int c;
+  static unsigned int mask[] = {0,1,3,7,15,31,63,127,255};
+    
+  /* code from gribw routine flist2bitstream */
+
+  cbits = 8;
+  c = 0;
+  for ( i = packStart; i < datasize; i++ )
+    {
+      /* note float -> unsigned int .. truncate */
+      ival = (unsigned int) ((data[i] - zref) * factor + 0.5);
+      /*
+	if ( ival > max_nbpv_pow2 ) ival = max_nbpv_pow2;
+	if ( ival < 0 ) ival = 0;
+      */
+      jbits = numBits;
+      while ( cbits <= jbits ) 
+	{
+	  if ( cbits == 8 )
+	    {
+	      jbits -= 8;
+	      lGrib[z++] = (ival >> jbits) & 0xFF;
+	    }
+	  else
+	    {
+	      jbits -= cbits;
+	      lGrib[z++] = (c << cbits) + ((ival >> jbits) & mask[cbits]);
+	      cbits = 8;
+	      c = 0;
+	    }
+	}
+      /* now jbits < cbits */
+      if ( jbits )
+	{
+	  c = (c << jbits) + (ival & mask[jbits]);
+	  cbits -= jbits;
+	}
+    }
+  if ( cbits != 8 ) lGrib[z++] = c << cbits;
+
+  *gz = z;
+}
+
+static
+void encode_double_array_byte(int numBits, size_t packStart, size_t datasize, 
+			      GRIBPACK *restrict lGrib,
+			      const double *restrict data, 
+			      double zref, double factor, size_t *gz)
+{
+#if defined _GET_X86_COUNTER || defined _GET_MACH_COUNTER 
+  uint64_t start_minmax, end_minmax;
+#endif
+
+  uint32_t ui32;
+  size_t i, z = *gz;
+  double tmp;
+
+  data += packStart;
+  datasize -= packStart;
+
+  if      ( numBits ==  8 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(2, "pack 8 bit base");
+#endif
+
+#if defined (CRAY)
+#pragma _CRI ivdep
+#elif defined (SX)
+#pragma vdir nodep
+#elif defined (__uxp__)
+#pragma loop novrec
+#endif
+      for ( i = 0; i < datasize; i++ )
+	{
+	  tmp = ((data[i] - zref) * factor + 0.5);
+	  lGrib[z  ] = (uint16_t) tmp;
+          z++;
+	}
+
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(2);
+#endif
+    }
+  else if ( numBits == 16 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(3, "pack 16 bit base");
+#elif defined _GET_X86_COUNTER 
+  start_minmax = _rdtsc();
+#elif defined _GET_MACH_COUNTER 
+  start_minmax = mach_absolute_time();
+#endif
+
+#if defined __AVX__
+
+      avx_encode_double_array_2byte(datasize, lGrib, data, zref, factor, &z);
+
+#elif defined __SSE4_1__
+
+      sse41_encode_double_array_2byte(datasize, lGrib, data, zref, factor, &z);
+
+#else
+
+      uint16_t ui16;
+
+#if   defined (CRAY)
+#pragma _CRI ivdep
+#elif defined (SX)
+#pragma vdir nodep
+#elif defined (__uxp__)
+#pragma loop novrec
+#endif
+      for ( i = 0; i < datasize; i++ )
+      	{
+      	  tmp = ((data[i] - zref) * factor + 0.5);
+          ui16 = (uint16_t) tmp;
+          lGrib[z  ] = ui16 >>  8;
+          lGrib[z+1] = ui16;
+          z += 2;
+      	}
+#endif
+
+#if defined _GET_X86_COUNTER || defined _GET_MACH_COUNTER
+#if defined _GET_X86_COUNTER 
+      end_minmax = _rdtsc();
+#elif defined _GET_MACH_COUNTER 
+      end_minmax = mach_absolute_time();
+#endif
+#if defined __AVX__
+      printf("AVX encoding cycles:: %" PRIu64 "\n", 
+	     end_minmax-start_minmax);
+#elif defined __SSE4_1__
+      printf("SSE 4.1 encoding cycles:: %" PRIu64 "\n", 
+	     end_minmax-start_minmax);
+#else
+      printf("loop encoding cycles:: %" PRIu64 "\n", 
+	     end_minmax-start_minmax);
+#endif  
+#endif
+      
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(3);
+#endif
+    }
+  else if ( numBits == 24 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(4, "pack 24 bit base");
+#endif
+
+#if   defined (CRAY)
+#pragma _CRI ivdep
+#elif defined (SX)
+#pragma vdir nodep
+#elif defined (__uxp__)
+#pragma loop novrec
+#endif
+      for ( i = 0; i < datasize; i++ )
+	{
+	  tmp = ((data[i] - zref) * factor + 0.5);
+          ui32 = (uint32_t) tmp;
+          lGrib[z  ] =  ui32 >> 16;
+          lGrib[z+1] =  ui32 >>  8;
+          lGrib[z+2] =  ui32;
+          z += 3;
+	}
+
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(4);
+#endif
+    }
+  else if ( numBits == 32 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(5, "pack 32 bit base");
+#endif
+
+#if   defined (CRAY)
+#pragma _CRI ivdep
+#elif defined (SX)
+#pragma vdir nodep
+#elif defined (__uxp__)
+#pragma loop novrec
+#endif
+      for ( i = 0; i < datasize; i++ )
+	{
+	  tmp = ((data[i] - zref) * factor + 0.5);
+          ui32 = (uint32_t) tmp;
+          lGrib[z  ] =  ui32 >> 24;
+          lGrib[z+1] =  ui32 >> 16;
+          lGrib[z+2] =  ui32 >>  8;
+          lGrib[z+3] =  ui32;
+          z += 4;
+	}
+
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(5);
+#endif
+    }
+  else if ( numBits > 0 && numBits <= 32 )
+    {
+      encode_double_array_common(numBits, 0, datasize, lGrib, 
+				 data, zref, factor, &z);
+    }
+  else if ( numBits == 0 )
+    {
+    }
+  else
+    {
+      Error("Unimplemented packing factor %d!", numBits);
+    }
+
+  *gz = z;
+}
+
+static
+void encode_double_array_unrolled(int numBits, size_t packStart, size_t datasize, 
+				  GRIBPACK *restrict lGrib,
+				  const double *restrict data, 
+				  double zref, double factor, size_t *gz)
+{
+  U_BYTEORDER;
+  size_t i, j, z = *gz;
+#ifdef _ARCH_PWR6
+#define __UNROLL_DEPTH_2 8
+#else
+#define __UNROLL_DEPTH_2 8
+#endif
+  size_t residual =  datasize % __UNROLL_DEPTH_2;
+  size_t ofs = datasize - residual;
+  double dval[__UNROLL_DEPTH_2];
+  unsigned long ival;
+
+  data += packStart;
+  datasize -= packStart;
+
+  // reducing FP operations to single FMA is slowing down on pwr6 ...
+
+  if      ( numBits ==  8 )
+    {
+      unsigned char *cgrib = (unsigned char *) (lGrib + z);
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(2, "pack 8 bit unrolled");
+#endif
+      for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) 
+	{
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      dval[j] = ((data[i+j] - zref) * factor + 0.5);
+	    }
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      *cgrib++ =  (unsigned long) dval[j];
+	    }
+	  z += __UNROLL_DEPTH_2;
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  dval[j] = ((data[ofs+j] - zref) * factor + 0.5);
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  *cgrib++ = (unsigned long) dval[j];
+	}
+      z += residual;
+
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(2);
+#endif
+    }
+  else if ( numBits == 16 )
+    {
+      unsigned short *sgrib = (unsigned short *) (lGrib + z);
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(3, "pack 16 bit unrolled");
+#endif
+      for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) 
+	{
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      dval[j] = ((data[i+j] - zref) * factor + 0.5);
+	    }
+	  if ( IS_BIGENDIAN() )
+	    {
+	      for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+		{
+		  *sgrib++ = (unsigned long) dval[j];
+		}
+	      z += 2*__UNROLL_DEPTH_2;
+	    }
+	  else
+	    {
+	      for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+		{
+		  ival = (unsigned long) dval[j];
+		  lGrib[z  ] = ival >>  8;
+		  lGrib[z+1] = ival;
+		  z += 2;
+		}
+	    }
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  dval[j] = ((data[ofs+j] - zref) * factor + 0.5);
+	}
+      if ( IS_BIGENDIAN() )
+	{
+	  for (j = 0; j < residual; j++) 
+	    {
+	      *sgrib++ = (unsigned long) dval[j];
+	    }
+	  z += 2*residual;
+	}
+      else
+	{
+	  for (j = 0; j < residual; j++) 
+	    {
+	      ival = (unsigned long) dval[j];
+	      lGrib[z  ] = ival >>  8;
+	      lGrib[z+1] = ival;
+	      z += 2;
+	    }
+	}
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(3);
+#endif
+    }
+  else if ( numBits == 24 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(4, "pack 24 bit unrolled");
+#endif
+      for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) 
+	{
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      dval[j] = ((data[i+j] - zref) * factor + 0.5);
+	    }
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      ival = (unsigned long) dval[j];
+	      lGrib[z  ] =  ival >> 16;
+	      lGrib[z+1] =  ival >>  8;
+	      lGrib[z+2] =  ival;
+	      z += 3;
+	    }
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  dval[j] = ((data[ofs+j] - zref) * factor + 0.5);
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  ival = (unsigned long) dval[j];
+	  lGrib[z  ] =  ival >> 16;
+	  lGrib[z+1] =  ival >>  8;
+	  lGrib[z+2] =  ival;
+	  z += 3;
+	}
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(4);
+#endif
+    }
+  else if ( numBits == 32 )
+    {
+#ifdef _GET_IBM_COUNTER 
+      hpmStart(5, "pack 32 bit unrolled");
+#endif
+      unsigned int *igrib = (unsigned int *) (lGrib + z);
+      for ( i = 0; i < datasize - residual; i += __UNROLL_DEPTH_2 ) 
+	{
+	  for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+	    {
+	      dval[j] = ((data[i+j] - zref) * factor + 0.5);
+	    }
+	  if ( IS_BIGENDIAN() )
+	    {
+	      for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+		{
+		  *igrib = (unsigned long) dval[j];
+		  igrib++;
+		  z += 4;
+		}
+	    }
+	  else
+	    {
+	      for (j = 0; j < __UNROLL_DEPTH_2; j++) 
+		{
+		  ival = (unsigned long) dval[j];
+		  lGrib[z  ] =  ival >> 24;
+		  lGrib[z+1] =  ival >> 16;
+		  lGrib[z+2] =  ival >>  8;
+		  lGrib[z+3] =  ival;
+		  z += 4;
+		}
+	    }
+	}
+      for (j = 0; j < residual; j++) 
+	{
+	  dval[j] = ((data[ofs+j] - zref) * factor + 0.5);
+	}
+      if ( IS_BIGENDIAN() )
+	{
+	  for (j = 0; j < residual; j++) 
+	    {
+	      *igrib = (unsigned long) dval[j];
+	      igrib++;
+	      z += 4;
+	    }
+	}
+      else
+	{
+	  for (j = 0; j < residual; j++) 
+	    {
+	      ival = (unsigned long) dval[j];
+	      lGrib[z  ] =  ival >> 24;
+	      lGrib[z+1] =  ival >> 16;
+	      lGrib[z+2] =  ival >>  8;
+	      lGrib[z+3] =  ival;
+	      z += 4;
+	    }
+	}
+#ifdef _GET_IBM_COUNTER 
+      hpmStop(5);
+#endif
+    }
+  else if ( numBits > 0 && numBits <= 32 )
+    {
+      encode_double_array_common(numBits, 0, datasize, lGrib, data, zref, factor, &z);
+    }
+  else if ( numBits == 0 )
+    {
+    }
+  else
+    {
+      Error("Unimplemented packing factor %d!", numBits);
+    }
+
+  *gz = z;
+#undef __UNROLL_DEPTH_2
+}
+
+#define  NINT(x)  ((x) < 0 ? (int)((x)-.5) : (int)((x)+.5))
+
+
+void confp3(double pval, int *kexp, int *kmant, int kbits, int kround)
+{
+  /*
+
+    Purpose:
+    --------
+
+    Convert floating point number from machine
+    representation to GRIB representation.
+
+    Input Parameters:
+    -----------------
+
+       pval    - Floating point number to be converted.
+       kbits   - Number of bits in computer word.
+       kround  - Conversion type.
+                 0 , Closest number in GRIB format less than
+                     original number.
+                 1 , Closest number in GRIB format to the
+                     original number (equal to, greater than or
+                     less than original number).
+
+    Output Parameters:
+    ------------------
+
+       kexp    - 8 Bit signed exponent.
+       kmant   - 24 Bit mantissa.
+
+    Method:
+    -------
+
+    Floating point number represented as 8 bit signed
+    exponent and 24 bit mantissa in integer values.
+
+    Externals.
+    ----------
+
+    decfp2    - Decode from IBM floating point format.
+
+    Reference:
+    ----------
+
+    WMO Manual on Codes re GRIB representation.
+
+    Comments:
+    ---------
+
+    Routine aborts if an invalid conversion type parameter
+    is used or if a 24 bit mantissa is not produced.
+
+    Author:
+    -------
+     
+    John Hennessy   ECMWF   18.06.91
+
+    Modifications:
+    --------------
+
+    Uwe Schulzweida   MPIfM   01/04/2001
+
+    Convert to C from EMOS library version 130
+
+    Uwe Schulzweida   MPIfM   02/08/2002
+
+     - speed up by factor 1.6 on NEC SX6
+        - replace 1.0 / pow(16.0, (double)(iexp - 70)) by rpow16m70tab[iexp]
+  */
+
+  double zval, rpowref;
+  double zref, zeps;
+  int iexp, isign;
+  int iround;
+  extern int CGRIBEX_Debug;
+  extern double _pow16tab[71];
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 1 . Initialise                                          */
+  /* ----------------------------------------------------------------- */
+
+  /*  Check conversion type parameter. */
+
+  iround = kround;
+  if ( iround != 0 && iround != 1 )
+    {
+      Error("Invalid conversion type = %d", iround);
+
+      /*  If not aborting, arbitrarily set rounding to 'up'. */
+     iround = 1;
+    }
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 2 . Convert value of zero.                              */
+  /* ----------------------------------------------------------------- */
+
+  if ( ! (fabs(pval) > 0))
+    {
+      *kexp  = 0;
+      *kmant = 0;
+      iexp   = 0;
+      isign  = 0;
+      goto LABEL900;
+    }
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 3 . Convert other values.                               */
+  /* ----------------------------------------------------------------- */
+
+  zeps = 1.0e-12;
+  if ( kbits == 32 ) zeps = 1.0e-8;
+  zref = pval;
+
+  /*  Sign of value. */
+
+  isign = 0;
+  if ( zref < 0.0 )
+    {
+      isign = 128;
+      zref  = - zref;
+    }
+
+  /*  Exponent. */
+
+  iexp = (int) (log(zref)/log(16.0) + 65.0 + zeps);
+
+  /* only ANSI C99 has log2 */
+  /* iexp = (int) (log2(zref) * 0.25 + 65.0 + zeps); */
+
+  if ( iexp < 0   ) iexp = 0;
+  if ( iexp > 127 ) iexp = 127;
+
+  /*
+  rpowref = zref / pow(16.0, (double)(iexp - 70));
+  */
+
+  if ( (iexp - 70) < 0 )
+    rpowref = zref * _pow16tab[-(iexp - 70)];
+  else
+    rpowref = zref / _pow16tab[(iexp - 70)];
+
+  /*  Mantissa. */
+
+  if ( iround == 0 )
+    {
+      /*  Closest number in GRIB format less than original number. */
+      /*  Truncate for positive numbers. */
+      /*  Round up for negative numbers. */
+
+      if ( isign == 0 )
+	*kmant = (int) rpowref;
+      else
+	*kmant = NINT(rpowref + 0.5);
+    }
+  else
+    {
+      /*  Closest number in GRIB format to the original number   */
+      /*  (equal to, greater than or less than original number). */
+
+      *kmant = NINT(rpowref);
+    }
+
+  /*  Check that mantissa value does not exceed 24 bits. */
+  /*  If it does, adjust the exponent upwards and recalculate */
+  /*  the mantissa. */
+  /*  16777215 = 2**24 - 1 */
+
+  if ( *kmant > 16777215 )
+    {
+
+    LABEL350:
+
+      ++iexp;
+
+      /*  Check for exponent overflow during adjustment  */
+
+      if ( iexp > 127 )
+	{
+          Message("Exponent overflow");
+          Message("Original number = %30.20f", pval);
+          Message("Sign = %3d, Exponent = %3d, Mantissa = %12d",
+		  isign, iexp, *kmant);
+
+	  Error("Exponent overflow");
+
+	  /*  If not aborting, arbitrarily set value to zero  */
+
+          Message("Value arbitrarily set to zero.");
+          *kexp  = 0;
+          *kmant = 0;
+          iexp  = 0;
+          isign = 0;
+          goto LABEL900;
+	}
+
+      if ( (iexp - 70) < 0 )
+	rpowref = zref * _pow16tab[-(iexp - 70)];
+      else
+	rpowref = zref / _pow16tab[(iexp - 70)];
+
+      if ( iround == 0 )
+	{
+	  /*  Closest number in GRIB format less than original number. */
+	  /*  Truncate for positive numbers. */
+	  /*  Round up for negative numbers. */
+
+	  if ( isign == 0 )
+	    *kmant = (int) rpowref;
+	  else
+	    *kmant = NINT(rpowref + 0.5);
+	}
+      else
+	{
+	  /*  Closest number in GRIB format to the original number */
+	  /*  (equal to, greater or less than original number). */
+
+	  *kmant = NINT(rpowref);
+	}
+
+      /*  Repeat calculation (with modified exponent) if still have */
+      /*  mantissa overflow. */
+
+      if ( *kmant > 16777215 ) goto LABEL350;
+    }
+
+  /*  Add sign bit to exponent. */
+
+  *kexp = iexp + isign;
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 9. Return                                               */
+  /* ----------------------------------------------------------------- */
+
+LABEL900:
+
+  if ( CGRIBEX_Debug )
+    {
+      Message("Conversion type parameter = %4d", kround);
+      Message("Original number = %30.20f", pval);
+
+      zval = decfp2(*kexp, *kmant);
+
+      Message("Converted to      %30.20f", zval);
+      Message("Sign = %3d, Exponent = %3d, Mantissa = %12d",
+	      isign, iexp, *kmant);
+    }
+
+  return;
+} /* confp3 */
+
+
+double decfp2(int kexp, int kmant)
+{
+  /*
+
+    Purpose:
+    --------
+
+    Convert GRIB representation of a floating point
+    number to machine representation.
+
+    Input Parameters:
+    -----------------
+
+    kexp    - 8 Bit signed exponent.
+    kmant   - 24 Bit mantissa.
+
+    Output Parameters:
+    ------------------
+
+    Return value   - Floating point number represented
+                     by kexp and kmant.
+
+    Method:
+    -------
+
+    Floating point number represented as 8 bit exponent
+    and 24 bit mantissa in integer values converted to
+    machine floating point format.
+
+    Externals:
+    ----------
+
+    None.
+
+    Reference:
+    ----------
+
+    WMO Manual on Codes re GRIB representation.
+
+    Comments:
+    ---------
+
+    Rewritten from DECFP, to conform to programming standards.
+    Sign bit on 0 value now ignored, if present.
+    If using 32 bit reals, check power of 16 is not so small as to
+    cause overflows (underflows!); this causes warning to be given
+    on Fujitsus.
+
+    Author:
+    -------
+
+    John Hennessy   ECMWF   18.06.91
+
+    Modifications:
+    --------------
+
+    Uwe Schulzweida   MPIfM   01/04/2001
+
+     - Convert to C from EMOS library version 130
+     
+    Uwe Schulzweida   MPIfM   02/08/2002
+
+     - speed up by factor 2 on NEC SX6
+        - replace pow(2.0, -24.0) by constant POW_2_M24
+        - replace pow(16.0, (double)(iexp - 64)) by pow16m64tab[iexp]
+  */
+
+  double pval;
+  int iexp, isign;
+  extern int CGRIBEX_Debug;
+  extern double _pow16tab[71];
+  
+  /* ----------------------------------------------------------------- */
+  /*   Section 1 . Convert value of 0.0. Ignore sign bit.              */
+  /* ----------------------------------------------------------------- */
+
+  if ( CGRIBEX_Debug ) Message("KEXP = %d  KMANT = %d", kexp, kmant);
+  /*
+  if ( (kexp == 128 || kexp == 0) && kmant == 0 )
+  */
+  if ( (kexp == 128) || (kexp == 0) || (kexp == 255) )
+    {
+      pval = 0.0;
+      goto LABEL900;
+    }
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 2 . Convert other values.                               */
+  /* ----------------------------------------------------------------- */
+
+  /*  Sign of value. */
+
+  iexp  = kexp;
+  isign = 1;
+
+  if ( iexp >= 128 )
+    {
+      iexp -= 128;
+      isign = -1;
+    }
+
+  /*  Decode value. */
+
+  /* pval = isign * pow(2.0, -24.0) * kmant * pow(16.0, (double)(iexp - 64)); */
+
+  iexp -= 64;
+
+  if ( iexp < 0 )
+    pval = 1./_pow16tab[-iexp];
+  else
+    pval = _pow16tab[iexp];
+
+  pval *= isign * POW_2_M24 * kmant;
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 9. Return to calling routine.                           */
+  /* ----------------------------------------------------------------- */
+
+LABEL900:
+
+  if ( CGRIBEX_Debug ) Message("Returned value = %f", pval);
+
+  return (pval);
+} /* decfp2 */
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+
+
+
+int gribRefDate(int *isec1)
+{
+  int date, ryear, rmonth, rday;
+  int century;
+
+  century = ISEC1_Century;
+  if ( century < 0 ) century = -century;
+  century -= 1;
+
+  ryear   = ISEC1_Year;
+
+  /* if ( century != 0 ) */
+    {
+      if ( ryear == 100 )
+	{
+	  ryear = 0;
+	  century += 1;
+	}
+
+      if ( ryear != 255 )
+	{
+	  ryear = century*100 + ryear;
+	  if ( ISEC1_Century < 0 ) ryear = -ryear;
+	}
+      else
+	ryear = 1;
+    }
+
+  rmonth  = ISEC1_Month;
+  rday    = ISEC1_Day;
+
+  date = cdiEncodeDate(ryear, rmonth, rday);
+
+  return (date) ;
+}
+
+
+int gribRefTime(int *isec1)
+{
+  int time, rhour, rminute;
+
+  rhour   = ISEC1_Hour;
+  rminute = ISEC1_Minute;
+
+  time = cdiEncodeTime(rhour, rminute, 0);
+
+  return (time) ;
+}
+
+
+int gribTimeIsFC(int *isec1)
+{
+  int isFC = FALSE;
+  int time_period;
+
+  if ( ISEC1_TimeRange == 10 )
+    time_period = (ISEC1_TimePeriod1<<8) + ISEC1_TimePeriod2;
+  else
+    time_period = ISEC1_TimePeriod1;
+
+  if ( time_period > 0 && ISEC1_Day > 0 )
+    {
+      if ( ISEC1_TimeRange == 0 || ISEC1_TimeRange == 10 ) isFC = TRUE;
+    }
+
+  return (isFC);
+}
+
+
+void gribDateTime(int *isec1, int *date, int *time)
+{
+  static int lprint = TRUE;
+  int ryear, rmonth, rday, rhour, rminute, second;
+  int time_period = 0;
+  int julday, secofday, addsec;
+  int century;
+  extern int grib_calendar;
+
+  century = ISEC1_Century;
+  if ( century < 0 ) century = -century;
+  century -= 1;
+
+  ryear   = ISEC1_Year;
+
+  /* if ( century != 0 ) */
+    {
+      if ( ryear == 100 )
+	{
+	  ryear = 0;
+	  century += 1;
+	}
+
+      if ( ryear != 255 )
+	{
+	  ryear = century*100 + ryear;
+	  if ( ISEC1_Century < 0 ) ryear = -ryear;
+	}
+      else
+	ryear = 1;
+    }
+
+  rmonth  = ISEC1_Month;
+  rday    = ISEC1_Day;
+
+  rhour   = ISEC1_Hour;
+  rminute = ISEC1_Minute;
+  second  = 0;
+
+  /* printf("ref %d/%d/%d %d:%d\n", ryear, rmonth, rday, rhour, rminute); */
+
+  if ( ISEC1_TimeRange == 10 )
+    time_period = (ISEC1_TimePeriod1<<8) + ISEC1_TimePeriod2;
+  else if ( ISEC1_TimeRange >=2 && ISEC1_TimeRange <= 5 )
+    time_period = ISEC1_TimePeriod2;
+  else if ( ISEC1_TimeRange == 0 )
+    time_period = ISEC1_TimePeriod1;
+
+  if ( time_period > 0 && rday > 0 )
+    {
+      encode_caldaysec(grib_calendar, ryear, rmonth, rday, rhour, rminute, second, &julday, &secofday);
+
+      addsec = 0;
+      switch ( ISEC1_TimeUnit )
+	{
+	case ISEC1_TABLE4_MINUTE:  addsec =    60 * time_period; break;
+	case ISEC1_TABLE4_QUARTER: addsec =   900 * time_period; break;
+	case ISEC1_TABLE4_HOUR:    addsec =  3600 * time_period; break;
+	case ISEC1_TABLE4_3HOURS:  addsec = 10800 * time_period; break;
+	case ISEC1_TABLE4_6HOURS:  addsec = 21600 * time_period; break;
+	case ISEC1_TABLE4_12HOURS: addsec = 43200 * time_period; break;
+	case ISEC1_TABLE4_DAY:     addsec = 86400 * time_period; break;
+	default:
+	  if ( lprint )
+	    {
+	      gprintf(__func__, "Time unit %d unsupported", ISEC1_TimeUnit);
+	      lprint = FALSE;
+	    }
+	}
+
+      julday_add_seconds(addsec, &julday, &secofday);
+
+      decode_caldaysec(grib_calendar, julday, secofday, &ryear, &rmonth, &rday, &rhour, &rminute, &second);
+    }
+  /*
+  printf("new %d/%d/%d %d:%d\n", ryear, rmonth, rday, rhour, rminute);
+  */
+  *date = cdiEncodeDate(ryear, rmonth, rday);
+  *time = cdiEncodeTime(rhour, rminute, 0);
+
+  return;
+}
+
+
+void gprintf(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+
+  if ( grprsm == NULL ) Error("GRIBEX initialization missing!");
+	
+  va_start(args, fmt);
+
+   fprintf(grprsm, "%-18s : ", caller);
+  vfprintf(grprsm, fmt, args);
+   fprintf(grprsm, "\n");
+
+  va_end(args);
+}
+
+
+void
+gribExDP(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+	 double *fsec3, int *isec4, double *fsec4, int klenp, int *kgrib,
+	 int kleng, int *kword, char *hoper, int *kret)
+{
+  int yfunc = *hoper;
+
+  if ( yfunc == 'D' || yfunc == 'J' || yfunc == 'R' )
+    gribDecode(isec0, isec1, isec2, fsec2, isec3,
+	       fsec3, isec4, fsec4, klenp, kgrib,
+	       kleng, kword, yfunc, kret);
+  else if ( yfunc == 'C' )
+    gribEncode(isec0, isec1, isec2, fsec2, isec3,
+	       fsec3, isec4, fsec4, klenp, kgrib,
+	       kleng, kword, yfunc, kret);
+  else if ( yfunc == 'V' )
+    fprintf(stderr, "  cgribex: Version is %s\n", cgribexLibraryVersion());
+  else
+    {
+      Error("oper %c unsupported!", yfunc);
+      *kret=-9;
+    }
+}
+
+
+void
+gribExSP(int *isec0, int *isec1, int *isec2, float *fsec2sp, int *isec3,
+	 float *fsec3sp, int *isec4, float *fsec4sp, int klenp, int *kgrib,
+	 int kleng, int *kword, char *hoper, int *kret)
+{
+  int inum, j;
+  double fsec2dp[1024];
+  double fsec3dp[2];
+  double *fsec4dp = NULL;
+  int yfunc = *hoper;
+
+  if ( yfunc == 'C' )
+    {
+      inum = 10 + isec2[11];
+      for ( j = 0; j < inum; j++ ) fsec2dp[j] = fsec2sp[j];
+
+      fsec3dp[0] = fsec3sp[0];
+      fsec3dp[1] = fsec3sp[1];
+
+      inum = isec4[0];
+      fsec4dp = (double *) malloc(inum*sizeof(double));
+      if ( fsec4dp == NULL ) SysError("No Memory!");
+
+      for ( j = 0; j < inum; j++ ) fsec4dp[j] = fsec4sp[j];
+
+      gribExDP(isec0, isec1, isec2, fsec2dp, isec3,
+	       fsec3dp, isec4, fsec4dp, klenp, kgrib,
+	       kleng, kword, hoper, kret);
+
+      free(fsec4dp);
+    }
+  else if ( yfunc == 'D' || yfunc == 'J' || yfunc == 'R' )
+    {
+      fsec4dp = (double *) malloc(klenp*sizeof(double));
+      if ( fsec4dp == NULL ) SysError("No Memory!");
+
+      for ( j = 0; j < 10; j++ ) fsec2dp[j] = 0.0;
+      for ( j = 0; j <  2; j++ ) fsec3dp[j] = 0.0;
+
+      gribExDP(isec0, isec1, isec2, fsec2dp, isec3,
+	       fsec3dp, isec4, fsec4dp, klenp, kgrib,
+	       kleng, kword, hoper, kret);
+
+      inum = 10 + isec2[11];
+      for ( j = 0; j < inum; j++ ) fsec2sp[j] = fsec2dp[j];
+
+      fsec3sp[0] = fsec3dp[0];
+      fsec3sp[1] = fsec3dp[1];
+
+      inum = isec4[0];
+      for ( j = 0; j < inum; j++ )
+	{
+	  if ( fsec4dp[j] > -FLT_MIN && fsec4dp[j] < FLT_MIN )
+	    fsec4sp[j] = 0;
+	  else if ( fsec4dp[j] > FLT_MAX )
+	    fsec4sp[j] = FLT_MAX;
+	  else if ( fsec4dp[j] < -FLT_MAX )
+	    fsec4sp[j] = -FLT_MAX;
+	  else
+	    fsec4sp[j] = fsec4dp[j];
+	}
+
+      free(fsec4dp);
+    }
+  else if ( yfunc == 'V' )
+    fprintf(stderr, " c-gribex: Version is %s\n", cgribexLibraryVersion());
+  else
+    {
+      Error("oper %c unsupported!", yfunc);
+      *kret=-9;
+    }
+}
+
+int CGRIBEX_Fix_ZSE  = 0;    /* 1: Fix ZeroShiftError of simple packed spherical harmonics */
+int CGRIBEX_Const    = 0;    /* 1: Don't pack constant fields on regular grids */
+int CGRIBEX_Debug    = 0;    /* 1: Debugging */
+
+void gribSetDebug(int debug)
+{
+  CGRIBEX_Debug = debug;
+
+  if ( CGRIBEX_Debug )
+    Message("debug level %d", debug);
+}
+
+
+void gribFixZSE(int flag)
+{
+  CGRIBEX_Fix_ZSE = flag;
+
+  if ( CGRIBEX_Debug )
+    Message("Fix ZeroShiftError set to %d", flag);
+}
+
+
+void gribSetConst(int flag)
+{
+  CGRIBEX_Const = flag;
+
+  if ( CGRIBEX_Debug )
+    Message("Const set to %d", flag);
+}
+
+
+void gribSetRound(int round)
+{
+}
+
+
+void gribSetRefDP(double refval)
+{
+}
+
+
+void gribSetRefSP(float refval)
+{
+  gribSetRefDP((double) refval);
+}
+
+
+void gribSetValueCheck(int vcheck)
+{
+}
+#include <string.h>
+#include <math.h>
+
+
+
+void gribPrintSec0(int *isec0)
+{
+  /*
+
+    Print the information in the Indicator
+    Section (Section 0) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec0 - Array of decoded integers from Section 0
+
+
+    Converted from EMOS routine GRPRS0.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+
+  grsdef();
+
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " Section 0 - Indicator Section.       \n");
+  fprintf(grprsm, " -------------------------------------\n");
+  fprintf(grprsm, " Length of GRIB message (octets).     %9d\n", ISEC0_GRIB_Len);
+  fprintf(grprsm, " GRIB Edition Number.                 %9d\n", ISEC0_GRIB_Version);
+}
+
+void gribPrintSec1(int *isec0, int *isec1)
+{
+  /*
+
+    Print the information in the Product Definition
+    Section (Section 1) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec0 - Array of decoded integers from Section 0
+
+       isec1 - Array of decoded integers from Section 1
+
+    Comments:
+
+       When decoding data from Experimental Edition or Edition 0,
+       routine GRIBEX adds the additional fields available in
+       Edition 1.
+
+
+    Converted from EMOS routine GRPRS1.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+
+  int iprev, icurr, icount, ioffset;
+  int ibit, ierr, iout, iyear;
+  int jloop, jiloop;
+  float value;
+
+  char hversion[9];
+  /*
+  char hfirst[121], hsecond[121], hthird[121], hfourth[121];
+  */
+
+  grsdef();
+
+  /*
+    -----------------------------------------------------------------
+    Section 0 . Print required information.
+    -----------------------------------------------------------------
+  */
+
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " Section 1 - Product Definition Section.\n");
+  fprintf(grprsm, " ---------------------------------------\n");
+
+  fprintf(grprsm, " Code Table 2 Version Number.         %9d\n", isec1[0]);
+  fprintf(grprsm, " Originating centre identifier.       %9d\n", isec1[1]);
+  fprintf(grprsm, " Model identification.                %9d\n", isec1[2]);
+  fprintf(grprsm, " Grid definition.                     %9d\n", isec1[3]);
+
+  ibit = 8;
+  prtbin(isec1[4], ibit, &iout, &ierr);
+  fprintf(grprsm, " Flag (Code Table 1)                   %8.8d\n", iout);
+  fprintf(grprsm, " Parameter identifier (Code Table 2). %9d\n", isec1[5]);
+
+  /*
+      IERR = CHKTAB2(ISEC1,HFIRST,HSECOND,HTHIRD,HFOURTH)
+      IF( IERR .EQ. 0 ) THEN
+       DO JLOOP = 121, 1, -1
+          IF( HSECOND(JLOOP:JLOOP).NE.' ' ) THEN
+            IOFFSET = JLOOP
+            GOTO 110
+          ENDIF
+        ENDDO
+        GOTO 120
+ 110    CONTINUE
+        WRITE(*,'(2H ",A,1H")') HSECOND(1:IOFFSET)
+ 120    CONTINUE
+      ENDIF
+  */
+
+  if ( isec1[5] != 127 )
+    {
+      fprintf(grprsm, " Type of level (Code Table 3).        %9d\n", isec1[6]);
+      fprintf(grprsm, " Value 1 of level (Code Table 3).     %9d\n", isec1[7]);
+      fprintf(grprsm, " Value 2 of level (Code Table 3).     %9d\n", isec1[8]);
+    }
+  else
+    {
+      fprintf(grprsm, " Satellite identifier.                %9d\n", isec1[6]);
+      fprintf(grprsm, " Spectral band.                       %9d\n", isec1[7]);
+    }
+
+  iyear = isec1[9];
+  if ( iyear != 255 )
+    {
+      int date, time;
+      /* iyear  = ((isec1[20]-1)*100 + isec1[9]); */
+      gribDateTime(isec1, &date, &time);
+      iyear = date/10000;
+      fprintf(grprsm, " Year of reference time of data.      %9d  (%4d)\n", isec1[9], iyear);
+    }
+  else
+    {
+      fprintf(grprsm, " Year of reference time of data MISSING  (=255)\n");
+    }
+
+  fprintf(grprsm, " Month of reference time of data.     %9d\n", isec1[10]);
+  fprintf(grprsm, " Day of reference time of data.       %9d\n", isec1[11]);
+  fprintf(grprsm, " Hour of reference time of data.      %9d\n", isec1[12]);
+  fprintf(grprsm, " Minute of reference time of data.    %9d\n", isec1[13]);
+  fprintf(grprsm, " Time unit (Code Table 4).            %9d\n", isec1[14]);
+  fprintf(grprsm, " Time range one.                      %9d\n", isec1[15]);
+  fprintf(grprsm, " Time range two.                      %9d\n", isec1[16]);
+  fprintf(grprsm, " Time range indicator (Code Table 5)  %9d\n", isec1[17]);
+  fprintf(grprsm, " Number averaged.                     %9d\n", isec1[18]);
+  fprintf(grprsm, " Number missing from average.         %9d\n", isec1[19]);
+  /*
+     All ECMWF data in GRIB Editions before Edition 1 is decoded
+     as 20th century data. Other centres are decoded as missing.
+  */
+  if ( isec0[1] < 1 && isec1[1] != 98 )
+    fprintf(grprsm, " Century of reference time of data.   Not given\n");
+  else
+    fprintf(grprsm, " Century of reference time of data.   %9d\n", isec1[20]);
+
+  /*   Print sub-centre  */
+  fprintf(grprsm, " Sub-centre identifier.               %9d\n", isec1[21]);
+
+  /*   Decimal scale factor  */
+  fprintf(grprsm, " Units decimal scaling factor.        %9d\n", isec1[22]);
+
+  /*
+    -----------------------------------------------------------------
+    Section 1 . Print local DWD information.
+    -----------------------------------------------------------------
+  */
+  if ( (isec1[ 1] == 78 && isec1[36] == 253) ||
+       (isec1[ 1] == 78 && isec1[36] == 254) )
+    {
+      fprintf(grprsm, " DWD local usage identifier.          %9d\n", isec1[36]);
+      if ( isec1[36] == 253 )
+	fprintf(grprsm, " (Database labelling and ensemble forecast)\n");
+      if ( isec1[36] == 254 )
+	fprintf(grprsm, " (Database labelling)\n");
+
+      fprintf(grprsm, " Year of database entry                     %3d  (%4d)\n", isec1[43], 1900+isec1[43]);
+      fprintf(grprsm, " Month of database entry                    %3d\n", isec1[44]);
+      fprintf(grprsm, " Day of database entry                      %3d\n", isec1[45]);
+      fprintf(grprsm, " Hour of database entry                     %3d\n", isec1[46]);
+      fprintf(grprsm, " Minute of database entry                   %3d\n", isec1[47]);
+      fprintf(grprsm, " DWD experiment number                %9d\n",isec1[48]);
+      fprintf(grprsm, " DWD run type                         %9d\n",isec1[49]);
+      if ( isec1[36] == 253 ) 
+	{
+	  fprintf(grprsm, " User id                              %9d\n",isec1[50]);
+	  fprintf(grprsm, " Experiment identifier                %9d\n",isec1[51]);
+	  fprintf(grprsm, " Ensemble identification type         %9d\n",isec1[52]);
+	  fprintf(grprsm, " Number of ensemble members           %9d\n",isec1[53]);
+	  fprintf(grprsm, " Actual number of ensemble member     %9d\n",isec1[54]);
+	  fprintf(grprsm, " Model version                            %2d.%2.2d\n",isec1[55],isec1[56]);
+	}
+    }
+
+  /*
+    -----------------------------------------------------------------
+    Section 2 . Print local ECMWF information.
+    -----------------------------------------------------------------
+  */
+  /*
+    Regular MARS labelling, or reformatted Washington EPS products.
+  */
+  if ( (ISEC1_CenterID    == 98 && ISEC1_LocalFLag ==  1) ||
+       (ISEC1_SubCenterID == 98 && ISEC1_LocalFLag ==  1) ||
+       (ISEC1_CenterID    ==  7 && ISEC1_SubCenterID == 98) )
+    {
+      /*   Parameters common to all definitions.  */
+
+      fprintf(grprsm, " ECMWF local usage identifier.        %9d\n", isec1[36]);
+      if ( isec1[36] == 1 )
+	fprintf(grprsm, " (Mars labelling or ensemble forecast)\n");
+      if ( isec1[36] == 2 )
+        fprintf(grprsm, " (Cluster means and standard deviations)\n");
+      if ( isec1[36] == 3 )
+        fprintf(grprsm, " (Satellite image data)\n");
+      if ( isec1[36] == 4 )
+        fprintf(grprsm, " (Ocean model data)\n");
+      if ( isec1[36] == 5 )
+        fprintf(grprsm, " (Forecast probability data)\n");
+      if ( isec1[36] == 6 )
+        fprintf(grprsm, " (Surface temperature data)\n");
+      if ( isec1[36] == 7 )
+        fprintf(grprsm, " (Sensitivity data)\n");
+      if ( isec1[36] == 8 )
+        fprintf(grprsm, " (ECMWF re-analysis data)\n");
+      if ( isec1[36] == 9 )
+        fprintf(grprsm, " (Singular vectors and ensemble perturbations)\n");
+      if ( isec1[36] == 10 )
+        fprintf(grprsm, " (EPS tubes)\n");
+      if ( isec1[36] == 11 )
+        fprintf(grprsm, " (Supplementary data used by analysis)\n");
+      if ( isec1[36] == 13 )
+        fprintf(grprsm, " (Wave 2D spectra direction and frequency)\n");
+
+      fprintf(grprsm, " Class.                               %9d\n", isec1[37]);
+      fprintf(grprsm, " Type.                                %9d\n", isec1[38]);
+      fprintf(grprsm, " Stream.                              %9d\n", isec1[39]);
+      sprintf(hversion, "%4s", (char*)&isec1[40]); hversion[4] = 0;
+      fprintf(grprsm, " Version number or Experiment identifier.  %4s\n", hversion);
+      /*
+	ECMWF Local definition 1.
+	(MARS labelling or ensemble forecast data)
+      */
+      if ( isec1[36] == 1 )
+	{
+	  fprintf(grprsm, " Forecast number.                     %9d\n", isec1[41]);
+	  if ( isec1[39] != 1090 )
+	    fprintf(grprsm, " Total number of forecasts.           %9d\n", isec1[42]);
+
+	  return;
+	}
+      /*
+	ECMWF Local definition 2.
+	(Cluster means and standard deviations)
+      */
+      if ( isec1[36] == 2 )
+	{
+	  fprintf(grprsm, " Cluster number.                      %9d\n", isec1[41]);
+	  fprintf(grprsm, " Total number of clusters.            %9d\n", isec1[42]);
+	  fprintf(grprsm, " Clustering method.                   %9d\n", isec1[43]);
+	  fprintf(grprsm, " Start time step when clustering.     %9d\n", isec1[44]);
+	  fprintf(grprsm, " End time step when clustering.       %9d\n", isec1[45]);
+	  fprintf(grprsm, " Northern latitude of domain.         %9d\n", isec1[46]);
+	  fprintf(grprsm, " Western longitude of domain.         %9d\n", isec1[47]);
+	  fprintf(grprsm, " Southern latitude of domain.         %9d\n", isec1[48]);
+	  fprintf(grprsm, " Eastern longitude of domain.         %9d\n", isec1[49]);
+	  fprintf(grprsm, " Operational forecast in cluster      %9d\n", isec1[50]);
+	  fprintf(grprsm, " Control forecast in cluster          %9d\n", isec1[51]);
+	  fprintf(grprsm, " Number of forecasts in cluster.      %9d\n", isec1[52]);
+
+	  for (jloop = 0; jloop < isec1[52]; jloop++)
+	    fprintf(grprsm, " Forecast number                      %9d\n", isec1[jloop+53]);
+
+	  return;
+	}
+      /*
+	ECMWF Local definition 3.
+	(Satellite image data)
+      */
+      if ( isec1[36] == 3 )
+	{
+	  fprintf(grprsm, " Satellite spectral band.             %9d\n", isec1[41]);
+	  fprintf(grprsm, " Function code.                       %9d\n", isec1[42]);
+	  return;
+	}
+      /*
+	ECMWF Local definition 4.
+	(Ocean model data)
+      */
+      if ( isec1[36] == 4 )
+	{
+	  fprintf(grprsm, " Satellite spectral band.             %9d\n", isec1[41]);
+	  if ( isec1[39] != 1090 )
+	    fprintf(grprsm, " Function code.                       %9d\n", isec1[42]);
+	  fprintf(grprsm, " Coordinate structure definition.\n");
+	  fprintf(grprsm, " Fundamental spatial reference system.%9d\n", isec1[43]);
+	  fprintf(grprsm, " Fundamental time reference.          %9d\n", isec1[44]);
+	  fprintf(grprsm, " Space unit flag.                     %9d\n", isec1[45]);
+	  fprintf(grprsm, " Vertical coordinate definition.      %9d\n", isec1[46]);
+	  fprintf(grprsm, " Horizontal coordinate definition.    %9d\n", isec1[47]);
+	  fprintf(grprsm, " Time unit flag.                      %9d\n", isec1[48]);
+	  fprintf(grprsm, " Time coordinate definition.          %9d\n", isec1[49]);
+	  fprintf(grprsm, " Position definition.     \n");
+	  fprintf(grprsm, " Mixed coordinate field flag.         %9d\n", isec1[50]);
+	  fprintf(grprsm, " Coordinate 1 flag.                   %9d\n", isec1[51]);
+	  fprintf(grprsm, " Averaging flag.                      %9d\n", isec1[52]);
+	  fprintf(grprsm, " Position of level 1.                 %9d\n", isec1[53]);
+	  fprintf(grprsm, " Position of level 2.                 %9d\n", isec1[54]);
+	  fprintf(grprsm, " Coordinate 2 flag.                   %9d\n", isec1[55]);
+	  fprintf(grprsm, " Averaging flag.                      %9d\n", isec1[56]);
+	  fprintf(grprsm, " Position of level 1.                 %9d\n", isec1[57]);
+	  fprintf(grprsm, " Position of level 2.                 %9d\n", isec1[58]);
+	  fprintf(grprsm, " Grid Definition.\n");
+	  fprintf(grprsm, " Coordinate 3 flag (x-axis)           %9d\n", isec1[59]);
+	  fprintf(grprsm, " Coordinate 4 flag (y-axis)           %9d\n", isec1[60]);
+	  fprintf(grprsm, " Coordinate 4 of first grid point.    %9d\n", isec1[61]);
+	  fprintf(grprsm, " Coordinate 3 of first grid point.    %9d\n", isec1[62]);
+	  fprintf(grprsm, " Coordinate 4 of last grid point.     %9d\n", isec1[63]);
+	  fprintf(grprsm, " Coordinate 3 of last grid point.     %9d\n", isec1[64]);
+	  fprintf(grprsm, " i - increment.                       %9d\n", isec1[65]);
+	  fprintf(grprsm, " j - increment.                       %9d\n", isec1[66]);
+	  fprintf(grprsm, " Flag for irregular grid coordinates. %9d\n", isec1[67]);
+	  fprintf(grprsm, " Flag for normal or staggered grids.  %9d\n", isec1[68]);
+	  fprintf(grprsm, " Further information.\n");
+	  fprintf(grprsm, " Further information flag.            %9d\n", isec1[69]);
+	  fprintf(grprsm, " Auxiliary information.\n");
+	  fprintf(grprsm, " No. entries in horizontal coordinate %9d\n", isec1[70]);
+	  fprintf(grprsm, " No. entries in mixed coordinate defn.%9d\n", isec1[71]);
+	  fprintf(grprsm, " No. entries in grid coordinate list. %9d\n", isec1[72]);
+	  fprintf(grprsm, " No. entries in auxiliary array.      %9d\n", isec1[73]);
+	  /*
+	    Horizontal coordinate supplement.
+	  */
+	  fprintf(grprsm, " Horizontal coordinate supplement.\n");
+	  if ( isec1[70] == 0 )
+	    {
+	      fprintf(grprsm, "(None).\n");
+	    }
+	  else
+	    {
+	      fprintf(grprsm, "Number of items = %d\n", isec1[70]);
+	      for (jloop = 0; jloop < isec1[70]; jloop++)
+		fprintf(grprsm, "         %12d\n", isec1[74+jloop]);
+	    }
+	  /*
+	    Mixed coordinate definition.
+	  */
+	  fprintf(grprsm, " Mixed coordinate definition.\n");
+	  if ( isec1[71] == 0 )
+	    {
+	      fprintf(grprsm, "(None).\n");
+	    }
+	  else
+	    {
+	      fprintf(grprsm, "Number of items = %d\n", isec1[71]);
+	      ioffset = 74 + isec1[70];
+	      for (jloop = 0; jloop < isec1[71]; jloop++)
+		fprintf(grprsm, "         %12d\n", isec1[ioffset+jloop]);
+	    }
+	  /*
+	    Grid coordinate list.
+	  */
+	  fprintf(grprsm, " Grid coordinate list. \n");
+	  if ( isec1[72] == 0 )
+	    {
+	      fprintf(grprsm, "(None).\n");
+	    }
+	  else
+	    {
+	      fprintf(grprsm, "Number of items = %d\n", isec1[72]);
+	      ioffset = 74 + isec1[70] + isec1[71];
+	      for (jloop = 0; jloop < isec1[72]; jloop++)
+		fprintf(grprsm, "         %12d\n", isec1[ioffset+jloop]);
+	    }
+	  /*
+	    Auxiliary array.
+	  */
+	  fprintf(grprsm, " Auxiliary array.      \n");
+	  if ( isec1[73] == 0 )
+	    {
+	      fprintf(grprsm, "(None).\n");
+	    }
+	  else
+	    {
+	      fprintf(grprsm, "Number of items = %d\n", isec1[73]);
+	      ioffset = 74 + isec1[70] + isec1[71] + isec1[72];
+	      for (jloop = 0; jloop < isec1[73]; jloop++)
+		fprintf(grprsm, "         %12d\n", isec1[ioffset+jloop]);
+	    }
+	  /*
+	    Post-auxiliary array.
+	  */
+	  fprintf(grprsm, " Post-auxiliary array. \n");
+	  ioffset = 74 + isec1[70] + isec1[71] + isec1[72] + isec1[73];
+	  if ( isec1[ioffset] == 0 )
+	    {
+	      fprintf(grprsm, "(None).\n");
+	    }
+	  else
+	    {
+	      fprintf(grprsm, "Number of items = %d\n", isec1[ioffset]);
+	      for (jloop = 1; jloop < isec1[ioffset]; jloop++)
+		fprintf(grprsm, "         %12d\n", isec1[ioffset+jloop]);
+	    }
+
+	  return;
+	}
+      /*
+	ECMWF Local definition 5.
+	(Forecast probability data)
+      */
+      if ( isec1[36] == 5 )
+	{
+	  fprintf(grprsm, " Forecast probability number          %9d\n", isec1[41]);
+	  fprintf(grprsm, " Total number of forecast probabilities %7d\n", isec1[42]);
+	  fprintf(grprsm, " Threshold units decimal scale factor %9d\n", isec1[43]);
+	  fprintf(grprsm, " Threshold indicator(1=lower,2=upper,3=both) %2d\n", isec1[44]);
+	  if ( isec1[44]  !=  2 )
+	    fprintf(grprsm, " Lower threshold value                %9d\n", isec1[45]);
+	  if ( isec1[44]  !=  1 )
+	    fprintf(grprsm, " Upper threshold value                %9d\n", isec1[46]);
+	  return;
+	}
+      /*
+	ECMWF Local definition 6.
+	(Surface temperature data)
+      */
+      if ( isec1[36] == 6 )
+	{
+	  iyear = isec1[43];
+	  if ( iyear > 100 )
+	    {
+	      if ( iyear < 19000000 ) iyear = iyear + 19000000;
+	      fprintf(grprsm, " Date of SST field used               %9d\n", iyear);
+	    }
+	  else
+	    fprintf(grprsm, "Date of SST field used               Not given\n");
+	}
+      if ( isec1[44] == 0 )
+	fprintf(grprsm, " Type of SST field (= climatology)    %9d\n", isec1[44]);
+      if ( isec1[44] == 1 )
+	fprintf(grprsm, " Type of SST field (= 1/1 degree)     %9d\n", isec1[44]);
+      if ( isec1[44] == 2 )
+	fprintf(grprsm, " Type of SST field (= 2/2 degree)     %9d\n", isec1[44]);
+
+      fprintf(grprsm, " Number of ICE fields used:           %9d\n", isec1[45]);
+
+      for (jloop = 1; jloop <= isec1[45]; jloop++)
+	{
+	  iyear = isec1[44+(jloop*2)];
+	  if ( iyear > 100 )
+	    {
+              if ( iyear < 19000000 ) iyear = iyear + 19000000;
+	      fprintf(grprsm, " Date of ICE field%3d                 %9d\n", jloop, iyear);
+	      fprintf(grprsm, " Satellite number (ICE field%3d)      %9d\n", jloop,
+		     isec1[45+(jloop*2)]);
+	    }
+	  else
+	    fprintf(grprsm, "Date of SST field used               Not given\n");
+	}
+      /*
+	ECMWF Local definition 7.
+	(Sensitivity data)
+      */
+      if ( isec1[36] == 7 )
+	{
+	  if ( isec1[38]  ==  51 )
+	    fprintf(grprsm, " Forecast number                      %9d\n", isec1[41]);
+	  if ( isec1[38]  !=  51 )
+	    fprintf(grprsm, " Iteration number                     %9d\n", isec1[41]);
+	  if ( isec1[38]  !=  52 )
+	    fprintf(grprsm, " Total number of diagnostics          %9d\n", isec1[42]);
+	  if ( isec1[38]  ==  52 )
+	    fprintf(grprsm, " No.interations in diag. minimisation %9d\n", isec1[42]);
+	  fprintf(grprsm, " Domain(0=Global,1=Europe,2=N.Hem.,3=S.Hem.) %2d\n", isec1[43]);
+	  fprintf(grprsm, " Diagnostic number                    %9d\n", isec1[44]);
+	}
+      /*
+	ECMWF Local definition 8.
+	(ECMWF re-analysis data)
+      */
+      if ( isec1[36] == 8 )
+	{
+	  if ( (isec1[39] == 1043) ||
+	       (isec1[39] == 1070) ||
+	       (isec1[39] == 1071) )
+	    {
+	      fprintf(grprsm, " Interval between reference times     %9d\n", isec1[41]);
+	      for (jloop = 43; jloop <= 54; jloop++)
+		{
+		  jiloop = jloop + 8;
+		  fprintf(grprsm, " ERA section 1 octet %2d.              %9d\n",
+			 jiloop, isec1[jloop-1]);
+		}
+	    }
+	  else
+	    {
+	      for (jloop = 42; jloop <= 54; jloop++)
+		{
+		  jiloop = jloop + 8;
+		  fprintf(grprsm, " ERA section 1 octet %2d.              %9d\n",
+			 jiloop, isec1[jloop-1]);
+		}
+	    }
+	  return;
+	}
+
+      if ( isec1[38] > 4  && isec1[38] < 9 )
+	{
+	  fprintf(grprsm, " Simulation number.                   %9d\n", isec1[41]);
+	  fprintf(grprsm, " Total number of simulations.         %9d\n", isec1[42]);
+	}
+      /*
+	ECMWF Local definition 9.
+	(Singular vectors and ensemble perturbations)
+      */
+      if ( isec1[36] == 9 )
+	{
+	  if ( isec1[38] == 60 )
+	    fprintf(grprsm, " Perturbed ensemble forecast number   %9d\n", isec1[41]);
+	  if ( isec1[38] == 61 )
+	    fprintf(grprsm, " Initial state perturbation number    %9d\n", isec1[41]);
+	  if ( isec1[38] == 62 )
+	    fprintf(grprsm, " Singular vector number               %9d\n", isec1[41]);
+	  if ( isec1[38] == 62 )
+	    {
+	      fprintf(grprsm, " Number of iterations                 %9d\n", isec1[42]);
+	      fprintf(grprsm, " Number of singular vectors computed  %9d\n", isec1[43]);
+	      fprintf(grprsm, " Norm used at initial time            %9d\n", isec1[44]);
+	      fprintf(grprsm, " Norm used at final time              %9d\n", isec1[45]);
+	      fprintf(grprsm, " Multiplication factor                %9d\n", isec1[46]);
+    	      fprintf(grprsm, " Latitude of north-west corner        %9d\n", isec1[47]);
+    	      fprintf(grprsm, " Longitude of north-west corner       %9d\n", isec1[48]);
+	      fprintf(grprsm, " Latitude of south-east corner        %9d\n", isec1[49]);
+	      fprintf(grprsm, " Longitude of south-east corner       %9d\n", isec1[50]);
+	      fprintf(grprsm, " Accuracy                             %9d\n", isec1[51]);
+	      fprintf(grprsm, " Number of singular vectors evolved   %9d\n", isec1[52]);
+	      fprintf(grprsm, " Ritz number one                      %9d\n", isec1[53]);
+	      fprintf(grprsm, " Ritz number two                      %9d\n", isec1[54]);
+	    }
+	}
+      /*
+	ECMWF Local definition 10.
+	(EPS tubes)
+      */
+      if ( isec1[36] == 10 )
+	{
+	  fprintf(grprsm, " Tube number                          %9d\n", isec1[41]);
+          fprintf(grprsm, " Total number of tubes                %9d\n", isec1[42]);
+          fprintf(grprsm, " Central cluster definition           %9d\n", isec1[43]);
+          fprintf(grprsm, " Parameter                            %9d\n", isec1[44]);
+          fprintf(grprsm, " Type of level                        %9d\n", isec1[45]);
+          fprintf(grprsm, " Northern latitude of domain of tubing%9d\n", isec1[46]);
+          fprintf(grprsm, " Western longitude of domain of tubing%9d\n", isec1[47]);
+          fprintf(grprsm, " Southern latitude of domain of tubing%9d\n", isec1[48]);
+          fprintf(grprsm, " Eastern longitude of domain of tubing%9d\n", isec1[49]);
+          fprintf(grprsm, " Tube number of operational forecast  %9d\n", isec1[50]);
+          fprintf(grprsm, " Tube number of control forecast      %9d\n", isec1[51]);
+          fprintf(grprsm, " Height/pressure of level             %9d\n", isec1[52]);
+          fprintf(grprsm, " Reference step                       %9d\n", isec1[53]);
+          fprintf(grprsm, " Radius of central cluster            %9d\n", isec1[54]);
+          fprintf(grprsm, " Ensemble standard deviation          %9d\n", isec1[55]);
+          fprintf(grprsm, " Dist.of tube extreme to ensemble mean%9d\n", isec1[56]);
+          fprintf(grprsm, " Number of forecasts in the tube      %9d\n", isec1[57]);
+
+          fprintf(grprsm, " List of ensemble forecast numbers:\n");
+          for (jloop = 1; jloop <=  isec1[57]; jloop++)
+	    fprintf(grprsm, "    %9d\n", isec1[57+jloop]);
+	}
+      /*
+	ECMWF Local definition 11.
+	(Supplementary data used by the analysis)
+      */
+      if ( isec1[36] == 11 )
+	{
+	  fprintf(grprsm, " Details of analysis which used the supplementary data:\n");
+	  fprintf(grprsm, "   Class                              %9d\n", isec1[41]);
+	  fprintf(grprsm, "   Type                               %9d\n", isec1[42]);
+	  fprintf(grprsm, "   Stream                             %9d\n", isec1[43]);
+	  /*
+	  sprintf(hversion, "%8d", isec1[44]);
+	  fprintf(grprsm, "   Version number/experiment identifier:   %4s\n", &hversion[4]);
+	  */
+	  iyear = isec1[45];
+	  if ( iyear > 50 )
+	    iyear = iyear + 1900;
+	  else
+	    iyear = iyear + 2000;
+
+	  fprintf(grprsm, "   Year                               %9d\n", iyear);
+	  fprintf(grprsm, "   Month                              %9d\n", isec1[46]);
+	  fprintf(grprsm, "   Day                                %9d\n", isec1[47]);
+	  fprintf(grprsm, "   Hour                               %9d\n", isec1[48]);
+	  fprintf(grprsm, "   Minute                             %9d\n", isec1[49]);
+	  fprintf(grprsm, "   Century                            %9d\n", isec1[50]);
+	  fprintf(grprsm, "   Originating centre                 %9d\n", isec1[51]);
+	  fprintf(grprsm, "   Sub-centre                         %9d\n", isec1[52]);
+	}
+      /*
+	ECMWF Local definition 12.
+      */
+      if ( isec1[36] == 12 )
+	{
+	  fprintf(grprsm, " (Mean, average, etc)\n");
+          fprintf(grprsm, " Start date of the period              %8d\n", isec1[41]);
+          fprintf(grprsm, " Start time of the period                  %4.4d\n", isec1[42]);
+          fprintf(grprsm, " Finish date of the period             %8d\n", isec1[43]);
+          fprintf(grprsm, " Finish time of the period                 %4.4d\n", isec1[44]);
+          fprintf(grprsm, " Verifying date of the period          %8d\n", isec1[45]);
+          fprintf(grprsm, " Verifying time of the period              %4.4d\n", isec1[46]);
+          fprintf(grprsm, " Code showing method                   %8d\n", isec1[47]);
+          fprintf(grprsm, " Number of different time intervals used  %5d\n", isec1[48]);
+          fprintf(grprsm, " List of different time intervals used:\n");
+          iprev  = isec1[49];
+          icurr  = 0;
+          icount = 0;
+          for (jloop = 1; jloop <= isec1[48]; jloop++)
+	    {
+	      icurr = isec1[48+jloop];
+	      if ( icurr != iprev )
+		{
+		  if ( icount == 1 )
+		    fprintf(grprsm, "  - interval %5.4d used       once\n", iprev);
+		  if ( icount == 2 )
+		    fprintf(grprsm, "  - interval %5.4d used       twice\n", iprev);
+		  if ( icount > 2 )
+		    fprintf(grprsm, "  - interval %5.4d used %5d times\n",  iprev, icount);
+		  iprev  = icurr;
+		  icount = 1;
+		}
+	      else
+		icount = icount + 1;
+	    }
+	  if ( icount == 1 )
+	    fprintf(grprsm, "  - interval %5.4d used       once\n", iprev);
+	  if ( icount == 2 )
+	    fprintf(grprsm, "  - interval %5.4d used       twice\n", iprev);
+	  if ( icount > 2 )
+	    fprintf(grprsm, "  - interval %5.4d used %5d times\n",  iprev, icount);
+	}
+      /*
+	ECMWF Local definition 13.
+	(Wave 2D spectra direction and frequency)
+      */
+      if ( isec1[36] == 13 )
+	{
+          fprintf(grprsm, " Direction number                     %9d\n", isec1[43]);
+	  fprintf(grprsm, " Frequency number                     %9d\n", isec1[44]);
+	  fprintf(grprsm, " Total number of directions           %9d\n", isec1[45]);
+	  fprintf(grprsm, " Total number of frequencies          %9d\n", isec1[46]);
+	  fprintf(grprsm, " Scale factor applied to directions   %9d\n", isec1[47]);
+	  fprintf(grprsm, " Scale factor applied to frequencies  %9d\n", isec1[48]);
+	  fprintf(grprsm, " List of directions:\n");
+          for (jloop = 1; jloop <= isec1[45]; jloop++)
+            {
+	      value = (float)(isec1[48+jloop])/(float)(isec1[47]);
+	      if ( isec1[43] == jloop )
+		fprintf(grprsm, " %2.2d:%15.7f   <-- this field value\n",  jloop, value);
+	      else
+		fprintf(grprsm, "%2.2d:%15.7f\n",  jloop, value);
+            }
+	  fprintf(grprsm, " List of frequencies:\n");
+          for (jloop = 1; jloop <= isec1[46]; jloop++)
+	    {
+	      value = (float)(isec1[48+isec1[45]+jloop])/(float)(isec1[48]);
+	      if ( isec1[44] == jloop )
+		fprintf(grprsm, " %2.2d:%15.7f   <-- this field value\n",  jloop, value);
+	      else
+		fprintf(grprsm, "%2.2d:%15.7f\n",  jloop, value);
+
+	      if ( isec1[49+isec1[45]+isec1[46]] != 0 )
+		{
+		  fprintf(grprsm, " System number (65535 = missing)      %9d\n",
+			 isec1[49+isec1[45]+isec1[46]]);
+		  fprintf(grprsm, " Method number (65535 = missing)      %9d\n",
+			 isec1[50+isec1[45]+isec1[46]]);
+		}
+	    }
+	  /*
+	    ECMWF Local definition 14.
+	    (Brightness temperature)
+	  */
+	  if ( isec1[36] == 14 )
+	    {
+	      fprintf(grprsm, " Channel number                       %9d\n", isec1[43]);
+	      fprintf(grprsm, " Scale factor applied to frequencies  %9d\n", isec1[44]);
+	      fprintf(grprsm, " Total number of frequencies          %9d\n", isec1[45]);
+	      fprintf(grprsm, " List of frequencies:\n");
+              for (jloop = 1; jloop <= isec1[45]; jloop++)
+		{
+		  value = (float)(isec1[45+jloop])/(float)(isec1[44]);
+		  if ( isec1[43] == jloop )
+		    fprintf(grprsm, " %3d:%15.9f   <-- this channel\n", jloop, value);
+		  else
+		    fprintf(grprsm, " %3d:%15.9f\n", jloop, value);
+		}
+	    }
+	  /*
+	    ECMWF Local definition 15.
+	    (Ocean ensemble seasonal forecast)
+	  */
+	  if ( isec1[36] == 15 )
+	    {
+	      fprintf(grprsm, " Ensemble member number               %9d\n", isec1[41]);
+	      fprintf(grprsm, " System number                        %9d\n", isec1[42]);
+	      fprintf(grprsm, " Method number                        %9d\n", isec1[43]);
+	    }
+	  /*
+	    ECMWF Local definition 16.
+	    (Seasonal forecast monthly mean atmosphere data)
+	  */
+        if ( isec1[36] == 16 )
+	  {
+	    fprintf(grprsm, " Ensemble member number               %9d\n", isec1[41]);
+	    fprintf(grprsm, " System number                        %9d\n", isec1[43]);
+	    fprintf(grprsm, " Method number                        %9d\n", isec1[44]);
+	    fprintf(grprsm, " Verifying month                      %9d\n", isec1[45]);
+	    fprintf(grprsm, " Averaging period                     %9d\n", isec1[46]);
+	  }
+	/*
+	  ECMWF Local definition 17.
+	  (Sst or sea-ice used by analysis)
+	*/
+        if ( isec1[36] == 17 )
+	  {
+	    iyear = isec1[43];
+	    if ( iyear > 100 )
+	      {
+		if ( iyear < 19000000 ) iyear = iyear + 19000000;
+		fprintf(grprsm, " Date of sst/ice field used           %9d\n", iyear);
+	      }
+	    else
+              fprintf(grprsm, " Date of sst/ice field used           Not given\n");
+      
+	    if ( isec1[44] == 0 )
+	      fprintf(grprsm, " Type of sst/ice field (= climatology)%9d\n", isec1[44]);
+	    if ( isec1[44] == 1 )
+	      fprintf(grprsm, " Type of sst/ice field (= 1/1 degree) %9d\n", isec1[44]);
+	    if ( isec1[44] == 2 )
+	      fprintf(grprsm, " Type of sst/ice field (= 2/2 degree) %9d\n", isec1[44]);
+
+	    fprintf(grprsm, " Number of ICE fields used:           %9d\n", isec1[45]);
+
+	    for (jloop = 1; jloop < isec1[45]; jloop++)
+	      {
+		iyear = isec1[44+(jloop*2)];
+		if ( iyear > 100 )
+		  {
+		    if ( iyear < 19000000 ) iyear = iyear + 19000000;
+		    fprintf(grprsm, " Date of ICE field%3d                 %9d\n", jloop,
+			   iyear);
+		    fprintf(grprsm, " Satellite number (ICE field%3d)      %9d\n", jloop,
+			   isec1[45+(jloop*2)]);
+		  }
+		else
+		  fprintf(grprsm, "Date of sst/ice field used           Not given\n");
+	      } 
+	  }
+	}
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 3 . Print Washington ensemble product information.
+    -----------------------------------------------------------------
+  */
+  /*
+    Washington EPS products (but not reformatted Washington EPS
+    products.
+  */
+  if ( (isec1[1] == 7 && isec1[23] == 1) && (! isec1[21] == 98) )
+    {
+      /*   CALL KWPRS1 (iSEC0,iSEC1)*/
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 4 . Print local MPIM information.
+    -----------------------------------------------------------------
+  */
+  if (isec1[ 1] == 252 && isec1[36] == 1)
+    {
+      fprintf(grprsm, " MPIM local usage identifier.         %9d\n", isec1[36]);
+      fprintf(grprsm, " Type of ensemble forecast            %9d\n", isec1[37]);
+      fprintf(grprsm, " Individual ensemble member           %9d\n", isec1[38]);
+      fprintf(grprsm, " Number of forecasts in ensemble      %9d\n", isec1[39]);
+    }
+}
+
+void printQuasi(int *isec2)
+{
+  /*
+
+    Print the qusai-regular information in the Grid Description
+    Section (Section 2) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec2 - Array of decoded integers from Section 2.
+
+    Comments:
+
+       Only data representation types catered for are Gaussian
+       grid, latitude/longitude grid, Spherical Harmonics,
+       Polar stereographic and Space view perspective.
+
+    Converted from EMOS routine PTQUASI.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+
+  char yout[64];
+  int nextlat, nrepeat, latcnt;
+  int j;
+  int ntos;
+
+  /*
+    -----------------------------------------------------------------
+    Section 1. Print quasi-grid data.
+    -----------------------------------------------------------------
+  */
+  /*
+    See if scanning is north->south or south->north
+  */
+  fprintf(grprsm, "  Number of points along a parallel varies.\n");
+
+  ntos = ( fmod((double) isec2[10], 128.) < 64 );
+
+  if ( ntos )
+    fprintf(grprsm, "  Number of points.   Parallel. (North to South)\n");
+  else
+    fprintf(grprsm, "  Number of points.   Parallel. (South to North)\n");
+
+  /*  Display number of points for each latitude */
+  latcnt  = isec2[2];
+  nextlat = 0;
+  memset(yout, ' ', (size_t) 11);
+
+  for ( j = 0; j < latcnt; j++ )
+    {
+      nextlat = nextlat + 1;
+      sprintf(yout, "%4d", nextlat);
+
+      /*       Finished?  */
+      if ( nextlat > latcnt ) break;
+      if ( nextlat == latcnt )
+	{
+	  fprintf(grprsm, " %5d                %-12s\n", isec2[nextlat+21], yout);
+	  break;
+	}
+      /*
+	Look for neighbouring latitudes with same number of points
+      */
+      nrepeat = 0;
+
+    LABEL110:
+      /*
+	If neighbouring latitudes have same number of points
+	increase the repeat count.
+      */
+      if ( isec2[nextlat+21+1] == isec2[nextlat+21] )
+	{
+          nrepeat = nrepeat + 1;
+          nextlat = nextlat + 1;
+	  if ( nextlat < latcnt ) goto LABEL110;
+	}
+      /*
+	Display neighbouring latitudes with same number of points as
+	'nn to mm'.
+      */
+      if ( nrepeat >= 1 )
+	{
+	  strncpy(yout+4, " to", 3);
+	  sprintf(yout+7, "%5d", nextlat);
+        }
+      fprintf(grprsm, " %5d                %-12s\n", isec2[nextlat+21], yout);
+      memset(yout, ' ', (size_t) 11);
+    }
+}
+
+void gribPrintSec2DP(int *isec0, int *isec2, double *fsec2)
+{
+  /*
+
+    Print the information in the Grid Description
+    Section (Section 2) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec0  - Array of decoded integers from Section 0
+
+       isec2  - Array of decoded integers from Section 2
+
+       fsec2  - Array of decoded floats from Section 2
+
+    Comments:
+
+       Only data representation types catered for are Gaussian
+       grid, latitude/longitude grid, Spherical Harmonics,
+       Polar stereographic and Space view perspective.
+
+
+    Converted from EMOS routine GRPRS2.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+
+  int i, ibit, iedit, ierr, iout, iresol;
+
+  grsdef();
+  /*
+    -----------------------------------------------------------------
+    Section 1 . Print GRIB Edition number.
+    -----------------------------------------------------------------
+  */
+  iedit = isec0[1];
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " Section 2 - Grid Description Section.\n");
+  fprintf(grprsm, " -------------------------------------\n");
+  /*
+    -----------------------------------------------------------------
+    Section 2 . Print spherical harmonic data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] == 50 || isec2[0] == 60 || 
+       isec2[0] == 70 || isec2[0] == 80 )
+    {
+      fprintf(grprsm, " Data represent type = spectral     (Table 6) %9d\n", isec2[0]);
+      fprintf(grprsm, " J - Pentagonal resolution parameter.         %9d\n", isec2[1]);
+      fprintf(grprsm, " K - Pentagonal resolution parameter.         %9d\n", isec2[2]);
+      fprintf(grprsm, " M - Pentagonal resolution parameter.         %9d\n", isec2[3]);
+      fprintf(grprsm, " Representation type (Table 9)                %9d\n", isec2[4]);
+      fprintf(grprsm, " Representation mode (Table 10).              %9d\n", isec2[5]);
+      for (i = 7; i <= 11; i++)
+        fprintf(grprsm, " Not used.                                    %9d\n", isec2[i-1]);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 3 . Print Gaussian grid data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] ==  4 || isec2[0] == 14 || 
+       isec2[0] == 24 || isec2[0] == 34 )
+    {
+      fprintf(grprsm, " (Southern latitudes and Western longitudes are negative.)\n");
+      fprintf(grprsm, " Data represent type = gaussian     (Table 6) %9d\n", isec2[0]);
+      /*
+	Quasi-regular grids introduced in Edition 1.
+      */
+      if ( isec2[16] == 0 || iedit < 1 )
+	fprintf(grprsm, " Number of points along a parallel.           %9d\n", isec2[1]);
+      else
+      	printQuasi(isec2);
+
+      fprintf(grprsm, " Number of points along a meridian.           %9d\n", isec2[2]);
+      fprintf(grprsm, " Latitude of first grid point.                %9d\n", isec2[3]);
+      fprintf(grprsm, " Longitude of first grid point.               %9d\n", isec2[4]);
+
+      ibit = 8;
+      iresol = isec2[5] + isec2[17] + isec2[18];
+      prtbin(iresol, ibit, &iout, &ierr);
+
+      fprintf(grprsm, " Resolution and components flag.               %8.8d\n", iout);
+      fprintf(grprsm, " Latitude of last grid point.                 %9d\n", isec2[6]);
+      fprintf(grprsm, " Longitude of last grid point.                %9d\n", isec2[7]);
+      /*
+	Print increment if given.
+      */
+      if ( isec2[5] == 128 )
+	fprintf(grprsm, " i direction (East-West) increment.           %9d\n", isec2[8]);
+      else
+	fprintf(grprsm, " i direction (East-West) increment            Not given\n");
+
+      fprintf(grprsm, " Number of parallels between pole and equator.%9d\n", isec2[9]);
+
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 4 . Print Latitude / longitude grid data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] ==  0 || isec2[0] == 10 || 
+       isec2[0] == 20 || isec2[0] == 30 )
+    {
+      fprintf(grprsm, " (Southern latitudes and Western longitudes are negative.)\n");
+      fprintf(grprsm, " Data represent type = lat/long     (Table 6) %9d\n", isec2[0]);
+      /*
+	Quasi-regular lat/long grids also possible.
+      */
+      if ( isec2[16] == 0 )
+	fprintf(grprsm, " Number of points along a parallel.           %9d\n", isec2[1]);
+      else
+        printQuasi(isec2);
+
+      fprintf(grprsm, " Number of points along a meridian.           %9d\n", isec2[2]);
+      fprintf(grprsm, " Latitude of first grid point.                %9d\n", isec2[3]);
+      fprintf(grprsm, " Longitude of first grid point.               %9d\n", isec2[4]);
+
+      ibit = 8;
+      iresol = isec2[5] + isec2[17] + isec2[18];
+      prtbin(iresol, ibit, &iout, &ierr);
+
+      fprintf(grprsm, " Resolution and components flag.               %8.8d\n", iout);
+      fprintf(grprsm, " Latitude of last grid point.                 %9d\n", isec2[6]);
+      fprintf(grprsm, " Longitude of last grid point.                %9d\n", isec2[7]);
+      /*
+	Print increment if given.
+      */
+      if ( isec2[8] < 0 )
+	fprintf(grprsm, " i direction (East-West) increment            Not given\n");
+      else
+	fprintf(grprsm, " i direction (East-West) increment.           %9d\n", isec2[8]);
+
+      if ( isec2[9] < 0 )
+	fprintf(grprsm, " j direction (North-South) increment          Not given\n");
+      else
+	fprintf(grprsm, " j direction (North-South) increment.         %9d\n", isec2[9]);
+    
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 5 . Print polar stereographic data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] == 5 )
+    {
+      fprintf(grprsm, " (Southern latitudes and Western longitudes are negative.)\n");
+      fprintf(grprsm, " Data represent type = polar stereo (Table 6) %9d\n", isec2[0]);
+      fprintf(grprsm, " Number of points along X axis.               %9d\n", isec2[1]);
+      fprintf(grprsm, " Number of points along Y axis.               %9d\n", isec2[2]);
+      fprintf(grprsm, " Latitude of first grid point.                %9d\n", isec2[3]);
+      fprintf(grprsm, " Longitude of first grid point.               %9d\n", isec2[4]);
+      ibit = 8;
+      iresol = isec2[17] + isec2[18];
+      prtbin(iresol, ibit, &iout, &ierr);
+      fprintf(grprsm, " Resolution and components flag.               %8.8d\n", iout);
+      fprintf(grprsm, " Orientation of the grid.                     %9d\n", isec2[6]);
+      fprintf(grprsm, " X direction increment.                       %9d\n", isec2[8]);
+      fprintf(grprsm, " Y direction increment.                       %9d\n", isec2[9]);
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      fprintf(grprsm, " Projection centre flag.                      %9d\n", isec2[12]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 6 . Print Lambert conformal data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] == 3 )
+    {
+      fprintf(grprsm, " (Southern latitudes and Western longitudes are negative.)\n");
+      fprintf(grprsm, " Data represent type = Lambert      (Table 6) %9d\n", isec2[0]);
+      fprintf(grprsm, " Number of points along X axis.               %9d\n", isec2[1]);
+      fprintf(grprsm, " Number of points along Y axis.               %9d\n", isec2[2]);
+      fprintf(grprsm, " Latitude of first grid point.                %9d\n", isec2[3]);
+      fprintf(grprsm, " Longitude of first grid point.               %9d\n", isec2[4]);
+      ibit = 8;
+      iresol = isec2[17] + isec2[18] + isec2[5];
+      prtbin(iresol, ibit, &iout, &ierr);
+      fprintf(grprsm, " Resolution and components flag.               %8.8d\n", iout);
+      fprintf(grprsm, " Orientation of the grid.                     %9d\n", isec2[6]);
+      fprintf(grprsm, " X direction increment.                       %9d\n", isec2[8]);
+      fprintf(grprsm, " Y direction increment.                       %9d\n", isec2[9]);
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      fprintf(grprsm, " Projection centre flag.                      %9d\n", isec2[12]);
+      fprintf(grprsm, " Latitude intersection 1 - Latin 1 -.         %9d\n", isec2[13]);
+      fprintf(grprsm, " Latitude intersection 2 - Latin 2 -.         %9d\n", isec2[14]);
+      fprintf(grprsm, " Latitude of Southern Pole.                   %9d\n", isec2[19]);
+      fprintf(grprsm, " Longitude of Southern Pole.                  %9d\n", isec2[20]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 7 . Print space view perspective or orthographic data.
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] == 90 )
+    {
+      fprintf(grprsm, " (Southern latitudes and Western longitudes are negative.)\n");
+      fprintf(grprsm, " Data represent type = space/ortho  (Table 6) %9d\n", isec2[0]);
+      fprintf(grprsm, " Number of points along X axis.               %9d\n", isec2[1]);
+      fprintf(grprsm, " Number of points along Y axis.               %9d\n", isec2[2]);
+      fprintf(grprsm, " Latitude of sub-satellite point.             %9d\n", isec2[3]);
+      fprintf(grprsm, " Longitude of sub-satellite point.            %9d\n", isec2[4]);
+      iresol = isec2[17] + isec2[18];
+      fprintf(grprsm, " Diameter of the earth in x direction.        %9d\n", isec2[6]);
+      fprintf(grprsm, " Y coordinate of sub-satellite point.         %9d\n", isec2[9]);
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      fprintf(grprsm, " Orientation of the grid.                     %9d\n", isec2[6]);
+      fprintf(grprsm, " Altitude of the camera.                      %9d\n", isec2[13]);
+      fprintf(grprsm, " Y coordinate of origin of sector image.      %9d\n", isec2[14]);
+      fprintf(grprsm, " X coordinate of origin of sector image.      %9d\n", isec2[15]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 7.5 . Print ocean data
+    -----------------------------------------------------------------
+  */
+  /*
+  if ( isec2[0] == 192 && isec1[1] == 98 )
+    {
+      fprintf(grprsm, " Data represent type = ECMWF ocean  (Table 6) %9d\n", isec2[0]);
+      if ( isec2[1] ==  32767 )
+	fprintf(grprsm, " Number of points along the first axis.       Not used\n");
+      else
+	fprintf(grprsm, " Number of points along the first axis.       %9d\n", isec2[1]);
+
+      if ( isec2[2] ==  32767 )
+	fprintf(grprsm, " Number of points along the second axis.      Not used\n");
+      else
+	fprintf(grprsm, " Number of points along the second axis.      %9d\n", isec2[2]);
+
+      ibit = 8;
+      prtbin(isec2[10], ibit, &iout, &ierr);
+      fprintf(grprsm, " Scanning mode flags (Code Table 8)            %8.8d\n", iout);
+      goto LABEL800;
+    }
+    */
+  /*
+    -----------------------------------------------------------------
+    Section 7.6 . Print triangular data
+    -----------------------------------------------------------------
+  */
+  if ( isec2[0] == 192 /* && isec1[1] == 78 */ )
+    {
+      fprintf(grprsm, " Data represent type = triangular   (Table 6) %9d\n", isec2[0]);
+      fprintf(grprsm, " Number of factor 2 in factorisation of Ni.   %9d\n", isec2[1]);
+      fprintf(grprsm, " Number of factor 3 in factorisation of Ni.   %9d\n", isec2[2]);
+      fprintf(grprsm, " Number of diamonds (Nd).                     %9d\n", isec2[3]);
+      fprintf(grprsm, " Number of triangular subdivisions of the\n");
+      fprintf(grprsm, "           icosahedron (Ni).                  %9d\n", isec2[4]);
+      fprintf(grprsm, " Flag for orientation of diamonds (Table A).  %9d\n", isec2[5]);
+      fprintf(grprsm, " Latitude of pole point.                      %9d\n", isec2[6]);
+      fprintf(grprsm, " Longitude of pole point.                     %9d\n", isec2[7]);
+      fprintf(grprsm, " Longitude of the first diamond.              %9d\n", isec2[8]);
+      fprintf(grprsm, " Flag for storage sequence (Table B).         %9d\n", isec2[9]);
+      fprintf(grprsm, " Number of vertical coordinate parameters.    %9d\n", isec2[11]);
+      goto LABEL800;
+    }
+  /*
+    -----------------------------------------------------------------
+    Drop through to here => representation type not catered for.
+    -----------------------------------------------------------------
+  */
+  fprintf(grprsm, "GRPRS2 :Data representation type not catered for -%d\n", isec2[0]);
+
+  goto LABEL900;
+  /*
+    -----------------------------------------------------------------
+    Section 8 . Print vertical coordinate parameters,
+                rotated grid information,
+                stretched grid information, if any.
+    -----------------------------------------------------------------
+  */
+ LABEL800:;
+  /*
+    Vertical coordinate parameters ...
+  */
+  if ( isec2[11] != 0 )
+    {
+      fprintf(grprsm, " \n");
+      fprintf(grprsm, " Vertical Coordinate Parameters.\n");
+      fprintf(grprsm, " -------------------------------\n");
+      for ( i = 10; i < isec2[11]+10; i++ )
+	fprintf(grprsm, "    %20.12f\n", fsec2[i]);
+    }
+  /*
+    Rotated and stretched grids introduced in Edition 1.
+  */
+  if ( iedit < 1 ) goto LABEL900;
+  /*
+    Rotated grid information ...
+  */
+  if ( isec2[0] == 10 || isec2[0] == 30 || 
+       isec2[0] == 14 || isec2[0] == 34 || 
+       isec2[0] == 60 || isec2[0] == 80 || 
+       isec2[0] == 30 )
+    {
+      fprintf(grprsm, " \n");
+      fprintf(grprsm, " Latitude of southern pole of rotation.       %9d\n", isec2[12]);
+      fprintf(grprsm, " Longitude of southern pole of rotation.      %9d\n", isec2[13]);
+      fprintf(grprsm, " Angle of rotation.                     %20.10f\n", fsec2[0]);
+    }
+  /*
+    Stretched grid information ...
+  */
+  if ( isec2[0] == 20 || isec2[0] == 30 || 
+       isec2[0] == 24 || isec2[0] == 34 || 
+       isec2[0] == 70 || isec2[0] == 80 )
+    {
+      fprintf(grprsm, " \n");
+      fprintf(grprsm, " Latitude of pole of stretching.              %9d\n", isec2[14]);
+      fprintf(grprsm, " Longitude of pole of stretching.             %9d\n", isec2[15]);
+      fprintf(grprsm, " Stretching factor.                     %20.10f\n", fsec2[1]);
+    }
+
+ LABEL900:;
+
+  return;
+}
+
+void gribPrintSec2SP(int *isec0, int *isec2, float  *fsec2sp)
+{
+  int inum;
+  int j;
+  double *fsec2;
+
+  inum = 10 + isec2[11];
+
+  fsec2 = (double *) malloc(inum*sizeof(double));
+  if ( fsec2 == NULL ) SysError("No Memory!");
+
+  for ( j = 0; j < inum; j++ )
+     fsec2[j] = fsec2sp[j];
+  
+  gribPrintSec2DP(isec0, isec2, fsec2);
+
+  free(fsec2);
+}
+
+void gribPrintSec3DP(int *isec0, int *isec3, double *fsec3)
+{
+  /*
+
+    Print the information in the Bit-Map Section
+    (Section 3) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec0  - Array of decoded integers from Section 0
+
+       isec3  - Array of decoded integers from Section 3
+
+       fsec3  - Array of decoded floats from Section 3
+
+
+    Converted from EMOS routine GRPRS3.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+
+  grsdef();
+
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " Section 3 - Bit-map Section.\n");
+  fprintf(grprsm, " -------------------------------------\n");
+
+  if ( isec3[0] != 0 )
+    fprintf(grprsm, " Predetermined bit-map number.                %9d\n", isec3[0]);
+  else
+    fprintf(grprsm, " No predetermined bit-map.\n");
+
+  fprintf(grprsm, " Missing data value for integer data.    %14d\n", isec3[1]);
+
+  fprintf(grprsm, " Missing data value for real data. %20.6g\n", fsec3[1]);
+}
+
+void gribPrintSec3SP(int *isec0, int *isec3, float  *fsec3sp)
+{
+  double fsec3[2];
+
+  fsec3[0] = fsec3sp[0];
+  fsec3[1] = fsec3sp[1];
+  
+  gribPrintSec3DP(isec0, isec3, fsec3);
+}
+
+void gribPrintSec4DP(int *isec0, int *isec4, double *fsec4)
+{
+  /*
+
+    Print the information in the Binary Data Section
+    (Section 4) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec0  - Array of decoded integers from Section 0
+
+       isec4  - Array of decoded integers from Section 4
+
+       fsec4  - Array of decoded floats from Section 4
+
+
+    Converted from EMOS routine GRPRS4.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+  int inum;
+  int j;
+
+  grsdef();
+
+  /*
+    -----------------------------------------------------------------
+    Section 1 . Print integer information from isec4.
+    -----------------------------------------------------------------
+  */
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " Section 4 - Binary Data  Section.\n");
+  fprintf(grprsm, " -------------------------------------\n");
+
+  fprintf(grprsm, " Number of data values coded/decoded.         %9d\n", isec4[0]);
+  fprintf(grprsm, " Number of bits per data value.               %9d\n", isec4[1]);
+  fprintf(grprsm, " Type of data       (0=grid pt, 128=spectral).%9d\n", isec4[2]);
+  fprintf(grprsm, " Type of packing    (0=simple, 64=complex).   %9d\n", isec4[3]);
+  fprintf(grprsm, " Type of data       (0=float, 32=integer).    %9d\n", isec4[4]);
+  fprintf(grprsm, " Additional flags   (0=none, 16=present).     %9d\n", isec4[5]);
+  fprintf(grprsm, " Reserved.                                    %9d\n", isec4[6]);
+  fprintf(grprsm, " Number of values   (0=single, 64=matrix).    %9d\n", isec4[7]);
+  fprintf(grprsm, " Secondary bit-maps (0=none, 32=present).     %9d\n", isec4[8]);
+  fprintf(grprsm, " Values width       (0=constant, 16=variable).%9d\n", isec4[9]);
+  /*
+    If complex packing ..
+  */
+  if ( isec4[3] == 64 )
+    {
+      if ( isec4[2] == 128 )
+	{
+	  fprintf(grprsm, " Byte offset of start of packed data (N).     %9d\n", isec4[15]);
+	  fprintf(grprsm, " Power (P * 1000).                            %9d\n", isec4[16]);
+	  fprintf(grprsm, " Pentagonal resolution parameter J for subset.%9d\n", isec4[17]);
+	  fprintf(grprsm, " Pentagonal resolution parameter K for subset.%9d\n", isec4[18]);
+	  fprintf(grprsm, " Pentagonal resolution parameter M for subset.%9d\n", isec4[19]);
+	}
+      else
+	{
+	  fprintf(grprsm, " Bits number of 2nd order values    (none=>0).%9d\n", isec4[10]);
+	  fprintf(grprsm, " General extend. 2-order packing (0=no,8=yes).%9d\n", isec4[11]);
+	  fprintf(grprsm, " Boustrophedonic ordering        (0=no,4=yes).%9d\n", isec4[12]);
+	  fprintf(grprsm, " Spatial differencing order          (0=none).%9d\n", isec4[13]+isec4[14]);
+        }
+    }
+  /*
+    Number of non-missing values
+  */
+  if ( isec4[20] != 0 )
+    fprintf(grprsm, " Number of non-missing values                 %9d\n", isec4[20]);
+  /*
+    Information on matrix of values , if present.
+  */
+  if ( isec4[7] == 64 )
+    {
+      fprintf(grprsm, " First dimension (rows) of each matrix.       %9d\n", isec4[49]);
+      fprintf(grprsm, " Second dimension (columns) of each matrix.   %9d\n", isec4[50]);
+      fprintf(grprsm, " First dimension coordinate values definition.%9d\n", isec4[51]);
+      fprintf(grprsm, " (Code Table 12)\n");
+      fprintf(grprsm, " NC1 - Number of coefficients for 1st dimension.%7d\n", isec4[52]);
+      fprintf(grprsm, " Second dimension coordinate values definition.%8d\n", isec4[53]);
+      fprintf(grprsm, " (Code Table 12)\n");
+      fprintf(grprsm, " NC2 - Number of coefficients for 2nd dimension.%7d\n", isec4[54]);
+      fprintf(grprsm, " 1st dimension physical signifance (Table 13). %8d\n", isec4[55]);
+      fprintf(grprsm, " 2nd dimension physical signifance (Table 13).%8d\n", isec4[56]);
+    }
+  /*
+    -----------------------------------------------------------------
+    Section 2. Print values from fsec4.
+    -----------------------------------------------------------------
+  */
+
+  inum = isec4[0];
+  if ( inum <  0 ) inum = - inum;
+  if ( inum > 20 ) inum = 20;
+  /*
+    Print first inum values.
+  */
+  fprintf(grprsm, " \n");
+  fprintf(grprsm, " First %4d data values.\n", inum);
+
+  if ( isec4[4] == 0 )
+    {
+      /*
+	Print real values ...
+      */
+      for ( j = 0; j < inum; j++ )
+	{
+	  if ( fabs(fsec4[j]) > 0 )
+	    {
+	      if ( fabs(fsec4[j]) >= 0.1 && fabs(fsec4[j]) <= 1.e8 )
+		fprintf(grprsm, " %#16.8G    \n", fsec4[j]);
+	      else
+		fprintf(grprsm, " %#20.8E\n", fsec4[j]);
+	    }
+	  else
+	    fprintf(grprsm, " %#16.0f    \n", fabs(fsec4[j]));
+	}
+    }
+  else
+    {
+      /*
+	Print integer values ...
+      */
+      fprintf(grprsm, " Print of integer values not supported\n");
+      /*
+        CALL SETPAR(IBIT,IDUM,IDUM)
+        DO 212 J=1,INUM
+           INSPT = 0
+           CALL INXBIT(IVALUE,1,INSPT,FSEC4(J),1,IBIT,IBIT,'C',IRET)
+           WRITE (*,9033) IVALUE
+ 9033 FORMAT(' ',I15)
+  212   CONTINUE
+      ENDIF
+      */
+    }
+}
+
+void gribPrintSec4SP(int *isec0, int *isec4, float  *fsec4sp)
+{
+  int inum;
+  int j;
+  double fsec4[20];
+
+  inum = isec4[0];
+  if ( inum <  0 ) inum = -inum;
+  if ( inum > 20 ) inum = 20;
+
+  for ( j = 0; j < inum; j++ ) fsec4[j] = fsec4sp[j];
+  
+  gribPrintSec4DP(isec0, isec4, fsec4);
+}
+
+void gribPrintSec4Wave(int *isec4)
+{
+  /*
+
+    Print the wave coordinate information in the Binary Data
+    Section (Section 4) of decoded GRIB data.
+
+    Input Parameters:
+
+       isec4 - Array of decoded integers from Section 4
+
+    Comments:
+
+       Wave coordinate information held in isec4 are 32-bit floats,
+       hence the PTEMP and NTEMP used for printing are 4-byte variables.
+
+
+    Converted from EMOS routine GRPRS4W.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+  int    jloop;
+  int    ntemp[100];
+  float *ptemp;
+
+  grsdef();
+
+  /*
+    -----------------------------------------------------------------
+    Section 1 . Print integer information from isec4.
+    -----------------------------------------------------------------
+  */
+  fprintf(grprsm, " Coefficients defining first dimension coordinates:\n");
+  for ( jloop = 0; jloop < isec4[52]; jloop++ )
+    {
+      ntemp[jloop] = isec4[59 + jloop];
+      ptemp = (float *) &ntemp[jloop];
+      fprintf(grprsm, "%20.10f\n", *ptemp);
+    }
+  fprintf(grprsm, " Coefficients defining second dimension coordinates:\n");
+  for ( jloop = 0; jloop < isec4[54]; jloop++ )
+    {
+      ntemp[jloop] = isec4[59 + isec4[52] + jloop];
+      ptemp = (float *) &ntemp[jloop];
+      fprintf(grprsm, "%20.10f\n", *ptemp);
+    }
+}
+#include <string.h>
+
+int  BitsPerInt = (int) (sizeof(int) * 8);
+
+
+
+/* GRIB block 0 - indicator block */
+static
+void encodeIS(GRIBPACK *lGrib, long *gribLen)
+{
+  long z = *gribLen;
+
+  lGrib[0] = 'G';
+  lGrib[1] = 'R';
+  lGrib[2] = 'I';
+  lGrib[3] = 'B';
+
+  /* 
+   * lGrib[4]-lGrib[6] contains full length of grib record. 
+   * included before finished CODEGB
+   */
+
+  z = 7;   
+  Put1Byte(1); /* grib version */
+  z = 8;
+
+  *gribLen = z;
+}
+
+/* GRIB block 5 - end block */
+static
+void encodeES(GRIBPACK *lGrib, long *gribLen, long bdsstart)
+{
+  long z = *gribLen;
+
+  lGrib[z++] = '7';
+  lGrib[z++] = '7';
+  lGrib[z++] = '7';
+  lGrib[z++] = '7';
+
+  if ( z > JP23SET )
+    {
+      long itemp;
+      long bdslen = z - 4;
+      /*
+      fprintf(stderr, "Abort: GRIB record too large (max = %d)!\n", JP23SET);
+      exit(1);
+      */
+      /*
+	If a very large product, the section 4 length field holds
+	the number of bytes in the product after section 4 upto
+	the end of the padding bytes.
+	This is a fixup to get round the restriction on product lengths
+	due to the count being only 24 bits. It is only possible because
+	the (default) rounding for GRIB products is 120 bytes.
+      */
+      while ( z%120 ) lGrib[z++] = 0;
+
+      if ( z > JP23SET*120 )
+	{
+	  fprintf(stderr, "Abort: GRIB record too large (max = %d)!\n", JP23SET*120);
+	  exit(1);
+	}
+
+      itemp = z / (-120);
+      itemp = JP23SET - itemp + 1;
+
+      lGrib[4] = itemp >> 16;
+      lGrib[5] = itemp >>  8;
+      lGrib[6] = itemp;
+
+      bdslen = z - bdslen;
+      lGrib[bdsstart  ] = bdslen >> 16;
+      lGrib[bdsstart+1] = bdslen >>  8;
+      lGrib[bdsstart+2] = bdslen;
+    }
+  else
+    {
+      lGrib[4] = z >> 16;
+      lGrib[5] = z >>  8;
+      lGrib[6] = z;
+
+      while ( z%8 ) lGrib[z++] = 0;
+    }
+
+  *gribLen = z;
+}
+
+/* GRIB block 1 - product definition block. */
+
+#define DWD_extension_253_len 38
+#define DWD_extension_254_len 26
+#define ECMWF_extension_1_len 24
+#define MCH_extension_254_len 19
+#define MPIM_extension_1_len  18
+
+static
+long getLocalExtLen(int *isec1)
+{
+  long extlen = 0;
+
+  if ( ISEC1_LocalFLag )
+    {
+      if ( ISEC1_CenterID == 78 ) 
+	{
+	  if      ( isec1[36] == 254 ) extlen = DWD_extension_254_len;
+	  else if ( isec1[36] == 253 ) extlen = DWD_extension_253_len;
+	}
+      else if ( ISEC1_CenterID == 98 )
+        {
+	  if ( isec1[36] == 1 )   extlen = ECMWF_extension_1_len;
+        }
+      else if ( ISEC1_CenterID == 215 )
+        {
+	  if ( isec1[36] == 254 ) extlen = MCH_extension_254_len;
+        }
+      else if ( ISEC1_CenterID == 252 )
+        {
+	  if ( isec1[36] == 1 ) extlen = MPIM_extension_1_len;
+        }
+    }
+
+  return (extlen);
+}
+
+static
+long getPdsLen(int *isec1)
+{
+  long pdslen = 28;
+
+  pdslen += getLocalExtLen(isec1);
+
+  return (pdslen);
+}
+
+static
+void encodePDS_DWD_local_Extension_254(GRIBPACK *lGrib, long *zs, int *isec1)
+{
+  int isvn;
+  long localextlen, i;
+  long z = *zs;
+
+  localextlen = getLocalExtLen(isec1);
+  for ( i = 0; i < localextlen-2; i++ )
+    {
+      Put1Byte(isec1[24+i]);
+    }
+
+  isvn = isec1[49] << 15 | isec1[48]; /* DWD experiment identifier    */
+  Put2Byte(isvn);             /* DWD run type (0=main, 2=ass, 3=test) */
+
+  *zs = z;
+}
+
+static
+void encodePDS_DWD_local_Extension_253(GRIBPACK *lGrib, long *zs, int *isec1)
+{
+  int isvn;
+  long localextlen, i;
+  long z = *zs;
+
+  localextlen = DWD_extension_254_len;
+  for ( i = 0; i < localextlen-2; i++ )
+    {
+      Put1Byte(isec1[24+i]);
+    }
+
+  isvn = isec1[49] << 15 | isec1[48]; /* DWD experiment identifier    */
+  Put2Byte(isvn);             /* DWD run type (0=main, 2=ass, 3=test) */
+  Put1Byte(isec1[50]);        /* 55 User id, specified by table       */
+  Put2Byte(isec1[51]);        /* 56 Experiment identifier             */
+  Put2Byte(isec1[52]);        /* 58 Ensemble identification by table  */
+  Put2Byte(isec1[53]);        /* 60 Number of ensemble members        */
+  Put2Byte(isec1[54]);        /* 62 Actual number of ensemble member  */
+  Put1Byte(isec1[55]);        /* 64 Model major version number        */ 
+  Put1Byte(isec1[56]);        /* 65 Model minor version number        */ 
+  Put1Byte(0);                /* 66 Blank for even buffer length      */
+
+  *zs = z;
+}
+
+static
+void encodePDS_ECMWF_local_Extension_1(GRIBPACK *lGrib, long *zs, int *isec1)
+{
+  // int isvn;
+  long localextlen, i;
+  long z = *zs;
+
+  localextlen = getLocalExtLen(isec1);
+  for ( i = 0; i < localextlen-12; i++ )
+    {
+      Put1Byte(isec1[24+i]);
+    }
+                              /* 12 bytes explicitly encoded below:         */
+  Put1Byte(isec1[36]);        /* ECMWF local GRIB use definition identifier */
+                              /*    1=MARS labelling or ensemble fcst. data */
+  Put1Byte(isec1[37]);        /* Class                                      */
+  Put1Byte(isec1[38]);        /* Type                                       */
+  Put2Byte(isec1[39]);        /* Stream                                     */
+
+  /* Version number or experiment identifier    */
+  Put1Byte(((unsigned char*) &isec1[40])[0]);
+  Put1Byte(((unsigned char*) &isec1[40])[1]);
+  Put1Byte(((unsigned char*) &isec1[40])[2]);
+  Put1Byte(((unsigned char*) &isec1[40])[3]);
+
+  Put1Byte(isec1[41]);        /* Ensemble forecast number                   */
+  Put1Byte(isec1[42]);        /* Total number of forecasts in ensemble      */
+  Put1Byte(0);                /* (Spare)                                    */
+
+  *zs = z;
+}
+
+static
+void encodePDS_MPIM_local_Extension_1(GRIBPACK *lGrib, long *zs, int *isec1)
+{
+  // int isvn;
+  long localextlen, i;
+  long z = *zs;
+
+  localextlen = getLocalExtLen(isec1);
+  for ( i = 0; i < localextlen-6; i++ )
+    {
+      Put1Byte(isec1[24+i]);
+    }
+                              /* 6 bytes explicitly encoded below:          */
+  Put1Byte(isec1[36]);        /* MPIM local GRIB use definition identifier  */
+                              /*    (extension identifier)                  */
+  Put1Byte(isec1[37]);        /* type of ensemble forecast                  */
+  Put2Byte(isec1[38]);        /* individual ensemble member                 */
+  Put2Byte(isec1[39]);        /* number of forecasts in ensemble            */
+
+  *zs = z;
+}
+
+/* GRIB BLOCK 1 - PRODUCT DESCRIPTION SECTION */
+static
+void encodePDS(GRIBPACK *lpds, long pdsLen, int *isec1)
+{
+  GRIBPACK *lGrib = lpds;
+  long z = 0;
+  int ival, century, year;
+
+  century = ISEC1_Century;
+  year    = ISEC1_Year;
+
+  if ( century < 0 )
+    {
+      century = -century;
+      year    = -year;
+    }
+
+  Put3Byte(pdsLen);               /*  0 Length of Block 1        */
+  Put1Byte(ISEC1_CodeTable);      /*  3 Local table number       */
+  Put1Byte(ISEC1_CenterID);       /*  4 Identification of centre */
+  Put1Byte(ISEC1_ModelID);        /*  5 Identification of model  */
+  Put1Byte(ISEC1_GridDefinition); /*  6 Grid definition          */
+  Put1Byte(ISEC1_Sec2Or3Flag);    /*  7 Block 2 included         */
+  Put1Byte(ISEC1_Parameter);      /*  8 Parameter Code           */
+  Put1Byte(ISEC1_LevelType);      /*  9 Type of level            */
+  if ( (ISEC1_LevelType !=  20) &&
+       (ISEC1_LevelType != GRIB1_LTYPE_99)         &&
+       (ISEC1_LevelType != GRIB1_LTYPE_ISOBARIC)   &&
+       (ISEC1_LevelType != GRIB1_LTYPE_ALTITUDE)   &&
+       (ISEC1_LevelType != GRIB1_LTYPE_HEIGHT)     &&
+       (ISEC1_LevelType != GRIB1_LTYPE_SIGMA)      &&
+       (ISEC1_LevelType != GRIB1_LTYPE_HYBRID)     &&
+       (ISEC1_LevelType != GRIB1_LTYPE_LANDDEPTH)  &&
+       (ISEC1_LevelType != GRIB1_LTYPE_ISENTROPIC) &&
+       (ISEC1_LevelType != 115) &&
+       (ISEC1_LevelType != 117) &&
+       (ISEC1_LevelType != 125) &&
+       (ISEC1_LevelType != 127) &&
+       (ISEC1_LevelType != 160) &&
+       (ISEC1_LevelType != 210) )
+    {
+      Put1Byte(ISEC1_Level1);
+      Put1Byte(ISEC1_Level2);
+    }
+  else
+    {
+      Put2Byte(ISEC1_Level1);     /* 10 Level                    */    
+    }
+
+  Put1Int(year);                  /* 12 Year of Century          */
+  Put1Byte(ISEC1_Month);          /* 13 Month                    */
+  Put1Byte(ISEC1_Day);            /* 14 Day                      */
+  Put1Byte(ISEC1_Hour);           /* 15 Hour                     */
+  Put1Byte(ISEC1_Minute);         /* 16 Minute                   */
+
+  Put1Byte(ISEC1_TimeUnit);       /* 17 Time unit                */
+  if ( ISEC1_TimeRange == 10 )
+    {
+      Put1Byte(ISEC1_TimePeriod1);
+      Put1Byte(ISEC1_TimePeriod2);
+    }
+  else if ( ISEC1_TimeRange == 113 || ISEC1_TimeRange ==   0 )
+    {
+      Put1Byte(ISEC1_TimePeriod1);
+      Put1Byte(0);
+    }
+  else if ( ISEC1_TimeRange ==   5 || ISEC1_TimeRange ==   4 || 
+	    ISEC1_TimeRange ==   3 || ISEC1_TimeRange ==   2 )
+    {
+      Put1Byte(0);
+      Put1Byte(ISEC1_TimePeriod2);
+    }
+  else
+    {
+      Put1Byte(0);
+      Put1Byte(0); 
+    }
+  Put1Byte(ISEC1_TimeRange);      /* 20 Timerange flag           */
+  Put2Byte(ISEC1_AvgNum);         /* 21 Average                  */
+
+  Put1Byte(ISEC1_AvgMiss);        /* 23 Missing from averages    */
+  Put1Byte(century);              /* 24 Century                  */
+  Put1Byte(ISEC1_SubCenterID);    /* 25 Subcenter                */
+  Put2Byte(ISEC1_DecScaleFactor); /* 26 Decimal scale factor     */
+
+  if ( ISEC1_LocalFLag )
+    {
+      if ( ISEC1_CenterID == 78 ) 
+	{
+	  if ( isec1[36] == 254 ) 
+	    {
+	      encodePDS_DWD_local_Extension_254(lGrib, &z, isec1);
+	    }
+	  else if ( isec1[36] == 253 )
+	    { 
+	      encodePDS_DWD_local_Extension_253(lGrib, &z, isec1);
+	    }
+	}
+      else if ( ISEC1_CenterID == 98 )
+	{
+	  if ( isec1[36] == 1 )
+	    {
+	      encodePDS_ECMWF_local_Extension_1(lGrib, &z, isec1);
+	    }
+	}
+      else if ( ISEC1_CenterID == 252 )
+	{
+	  if ( isec1[36] == 1 )
+	    {
+	      encodePDS_MPIM_local_Extension_1(lGrib, &z, isec1);
+	    }
+	}
+      else
+	{
+	  long i, localextlen;
+	  localextlen = getLocalExtLen(isec1);
+	  for ( i = 0; i < localextlen; i++ )
+	    {
+	      Put1Byte(isec1[24+i]);
+	    }
+	}
+    }
+}
+
+/* GRIB BLOCK 2 - GRID DESCRIPTION SECTION */
+static
+void encodeGDS(GRIBPACK *lGrib, long *gribLen, int *isec2, double *fsec2)
+{
+  long z = *gribLen;
+  int exponent, mantissa;
+  long i;
+  int ival;
+  int pvoffset = 0xFF;
+  int gdslen = 32;
+  unsigned lonIncr, latIncr;
+
+  if ( ISEC2_GridType == GRIB1_GTYPE_LCC ) gdslen += 10;
+
+  if ( ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )  gdslen += 10;
+
+  if ( ISEC2_NumVCP || ISEC2_Reduced ) pvoffset = gdslen + 1;
+
+  if ( ISEC2_Reduced ) gdslen += 2 * ISEC2_NumLat;
+
+  gdslen += ISEC2_NumVCP * 4;
+
+  Put3Byte(gdslen);             /*  0- 2 Length of Block 2 Byte 0 */
+  Put1Byte(ISEC2_NumVCP);       /*  3    NV */
+  Put1Byte(pvoffset);           /*  4    PV */
+  Put1Byte(ISEC2_GridType);     /*  5    LatLon=0 Gauss=4 Spectral=50 */
+
+  if ( ISEC2_GridType == GRIB1_GTYPE_SPECTRAL )
+    {
+      Put2Byte(ISEC2_PentaJ);   /*  6- 7 Pentagonal resolution J  */
+      Put2Byte(ISEC2_PentaK);   /*  8- 9 Pentagonal resolution K  */
+      Put2Byte(ISEC2_PentaM);   /* 10-11 Pentagonal resolution M  */
+      Put1Byte(ISEC2_RepType);  /* 12    Representation type      */
+      Put1Byte(ISEC2_RepMode);  /* 13    Representation mode      */
+      PutnZero(18);             /* 14-31 reserved                 */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_GME )
+    {
+      Put2Byte(ISEC2_GME_NI2);
+      Put2Byte(ISEC2_GME_NI3);
+      Put3Byte(ISEC2_GME_ND);
+      Put3Byte(ISEC2_GME_NI);
+      Put1Byte(ISEC2_GME_AFlag);
+      Put3Int(ISEC2_GME_LatPP);
+      Put3Int(ISEC2_GME_LonPP);
+      Put3Int(ISEC2_GME_LonMPL);
+      Put1Byte(ISEC2_GME_BFlag);
+      PutnZero(5);
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_LCC )
+    {
+      Put2Byte(ISEC2_NumLon);          /*  6- 7 Longitudes               */
+
+      Put2Byte(ISEC2_NumLat);          /*  8- 9 Latitudes                */
+      Put3Int(ISEC2_FirstLat);
+      Put3Int(ISEC2_FirstLon);
+      Put1Byte(ISEC2_ResFlag);         /* 16    Resolution flag          */
+      Put3Int(ISEC2_Lambert_Lov);      /* 17-19 */
+      Put3Int(ISEC2_Lambert_dx);       /* 20-22 */
+      Put3Int(ISEC2_Lambert_dy);       /* 23-25 */
+      Put1Byte(ISEC2_Lambert_ProjFlag);/* 26    Projection flag          */
+      Put1Byte(ISEC2_ScanFlag);        /* 27    Scanning mode            */
+      Put3Int(ISEC2_Lambert_LatS1);    /* 28-30 */  
+      Put3Int(ISEC2_Lambert_LatS2);    /* 31-33 */
+      Put3Int(ISEC2_Lambert_LatSP);    /* 34-36 */  
+      Put3Int(ISEC2_Lambert_LonSP);    /* 37-39 */
+      PutnZero(2);                     /* 34-41 */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_LATLON    ||
+	    ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN  ||
+	    ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )
+    {
+      int numlon;
+      if ( ISEC2_Reduced )
+	numlon = 0xFFFF;
+      else
+	numlon = ISEC2_NumLon;
+
+      Put2Byte(numlon);                /*  6- 7 Number of Longitudes     */
+
+      Put2Byte(ISEC2_NumLat);          /*  8- 9 Number of Latitudes      */
+      Put3Int(ISEC2_FirstLat);
+      Put3Int(ISEC2_FirstLon);
+      Put1Byte(ISEC2_ResFlag);         /* 16    Resolution flag          */
+      Put3Int(ISEC2_LastLat);
+      Put3Int(ISEC2_LastLon);
+      if ( ISEC2_ResFlag == 0 )
+	{
+	  lonIncr = 0xFFFF;
+	  latIncr = 0xFFFF;
+	}
+      else
+	{
+	  lonIncr = ISEC2_LonIncr;
+	  latIncr = ISEC2_LatIncr;
+	}
+      Put2Byte(lonIncr);               /* 23-24 i - direction increment  */
+      if ( ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN )
+	Put2Byte(ISEC2_NumPar);        /* 25-26 Latitudes Pole->Equator  */
+      else
+	Put2Byte(latIncr);             /* 25-26 j - direction increment  */
+
+      Put1Byte(ISEC2_ScanFlag);        /* 27    Scanning mode            */
+      PutnZero(4);                     /* 28-31 reserved                 */
+
+      if ( ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )
+	{
+	  Put3Int(ISEC2_LatSP);
+	  Put3Int(ISEC2_LonSP);
+	  Put1Real(FSEC2_RotAngle);
+	}
+    }
+  else
+    {
+      Error("Unsupported grid type %d", ISEC2_GridType);
+    }
+
+#if defined (SX)
+#pragma vdir novector     /* vectorization gives wrong results on NEC */
+#endif
+  for ( i = 0; i < ISEC2_NumVCP; ++i )
+    {
+      Put1Real(fsec2[10+i]);
+    }
+
+  if ( ISEC2_Reduced )
+    for ( i = 0; i < ISEC2_NumLat; i++ ) Put2Byte(ISEC2_RowLon(i));
+
+  *gribLen = z;
+}
+
+/* GRIB BLOCK 3 - BIT MAP SECTION */
+static
+void encodeBMS(GRIBPACK *lGrib, long *gribLen, double *fsec3, int *isec4, double *data, long *datasize)
+{
+  GRIBPACK *bitmap;
+  long bitmapSize;
+  long imaskSize;
+  long i;
+  long bmsLen, bmsUnusedBits;
+  long fsec4size;
+  long z = *gribLen;
+#if defined (VECTORCODE)
+  unsigned int *imask;
+#endif
+  static int lmissvalinfo = 1;
+  /*  unsigned int c, imask; */
+
+  if ( DBL_IS_NAN(FSEC3_MissVal) && lmissvalinfo)
+    {
+      lmissvalinfo = 0;
+      Message("Missing value = NaN is unsupported!");
+    }
+
+  bitmapSize = ISEC4_NumValues;
+  imaskSize = ((bitmapSize+7)>>3)<<3;
+  bitmap = &lGrib[z+6];
+  fsec4size = 0;
+
+#if defined (VECTORCODE)
+  imask = (unsigned int *) malloc(imaskSize*sizeof(int));
+  memset(imask, 0, imaskSize*sizeof(int));
+
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+  for ( i = 0; i < bitmapSize; i++ )
+    {
+      if ( IS_NOT_EQUAL(data[i], FSEC3_MissVal) )
+	{
+	  data[fsec4size++] = data[i];
+	  imask[i] = 1;
+	}
+    }
+
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+  for ( i = 0; i < imaskSize/8; i++ )
+    {
+      bitmap[i] = (imask[i*8+0] << 7) | (imask[i*8+1] << 6) |
+	          (imask[i*8+2] << 5) | (imask[i*8+3] << 4) |
+	          (imask[i*8+4] << 3) | (imask[i*8+5] << 2) |
+	          (imask[i*8+6] << 1) | (imask[i*8+7]);
+    }
+
+  free(imask);
+#else
+  for ( i = 0; i < imaskSize/8; i++ ) bitmap[i] = 0;
+
+  for ( i = 0; i < bitmapSize; i++ )
+    {
+      if ( IS_NOT_EQUAL(data[i], FSEC3_MissVal) )
+	{
+	  data[fsec4size++] = data[i];
+	  bitmap[i/8] |= 1<<(7-(i&7));
+	}
+    }
+#endif
+
+  bmsLen = imaskSize/8 + 6;
+  bmsUnusedBits = imaskSize - bitmapSize;
+
+  Put3Byte(bmsLen);   /*  0- 2 Length of Block 3 Byte 0 */
+  Put1Byte(bmsUnusedBits);
+  Put2Byte(0);
+
+  *gribLen += bmsLen;
+
+  *datasize = fsec4size;
+}
+
+
+/* GRIB BLOCK 4 - BINARY DATA SECTION */
+static
+int encodeBDS(GRIBPACK *lGrib, long *gribLen, int decscale, int *isec2, int *isec4, long datasize, double *data,
+	      long *datstart, long *datsize, int code)
+{
+  /* Uwe Schulzweida, 11/04/2003 : Check that number of bits per value is not exceeded */
+  /* Uwe Schulzweida,  6/05/2003 : Copy result to fpval to prevent integer overflow */
+
+  size_t z = *gribLen;
+  long i, jloop;
+  int numBits;
+  int ival;
+  int blockLength, PackStart = 0, Flag = 0;
+  int binscale = 0;
+  int nbpv;
+  int bds_head = 11;
+  int bds_ext = 0;
+  /* ibits = BitsPerInt; */
+  unsigned int max_nbpv_pow2;
+  int exponent, mantissa;
+  int unused_bits = 0;
+  int lspherc = FALSE, lcomplex = FALSE;
+  int isubset = 0, itemp = 0, itrunc = 0;
+  double factor = 1, fmin, fmax, zref;
+  double range, rangec;
+  double jpepsln = 1.0e-12;     /* -----> tolerance used to check equality     */
+                                /*        of floating point numbers - needed   */
+		                /*        on some platforms (eg vpp700, linux) */
+  extern double _pow2tab[158];
+  extern int CGRIBEX_Const;         /* 1: Don't pack constant fields on regular grids */
+
+  if ( isec2 )
+    {
+      /* If section 2 is present, it says if data is spherical harmonic */
+
+      if ( isec2[0] == 50 || isec2[0] == 60 || 
+	   isec2[0] == 70 || isec2[0] == 80 ) lspherc = TRUE;
+
+      if ( lspherc )
+	isec4[2] = 128;
+      else
+	isec4[2] = 0;
+    }
+  else
+    {
+      /* Section 4 says if it's spherical harmonic data.. */
+
+      lspherc = ( isec4[2] == 128 );
+    }
+
+  /* Complex packing supported for spherical harmonics. */
+
+  lcomplex = ( lspherc && ( isec4[3] == 64 ) ) ||
+             ( lspherc && isec2 && ( isec2[5] == 2 ) );
+
+  /* Check input specification is consistent */
+
+  if ( lcomplex && isec2 )
+    {
+      if ( ( isec4[3] != 64 ) && ( isec2[5] == 2 ) )
+	{
+	  gprintf(__func__, "  COMPLEX mismatch. isec4[3] = %d\n", isec4[3]);
+	  gprintf(__func__, "  COMPLEX mismatch. isec2[5] = %d\n", isec2[5]);
+	  return (807);
+	}
+      else if ( ( isec4[3] == 64 ) && ( isec2[5] != 2 ) )
+	{
+	  gprintf(__func__, "  COMPLEX mismatch. isec4[3] = %d\n", isec4[3]);
+	  gprintf(__func__, "  COMPLEX mismatch. isec2[5] = %d\n", isec2[5]);
+	  return (807);
+        }
+      else if ( lcomplex )
+	{
+	  /*
+	    Truncation of full spectrum, which is supposed triangular,
+	    has to be diagnosed. Define also sub-set truncation.
+	  */
+	  isubset = isec4[17];
+	  /* When encoding, use the total number of data. */
+	  itemp   = isec4[0];
+	  itrunc  = (int) (sqrt(itemp*4 + 1.) - 3) / 2;
+	}
+    }
+
+  if ( decscale )
+    {
+      double scale = pow(10.0, (double) decscale);
+      for ( i = 0; i < datasize; ++i ) data[i] *= scale;
+    }
+
+  if ( lspherc )
+    {
+      if ( lcomplex )
+	{
+	  int jup, ioff;
+	  jup  = isubset;
+	  ioff = (jup+1)*(jup+2);
+	  bds_ext = 4 + 3 + 4*ioff;
+	  PackStart = ioff;
+	  Flag = 192;
+	}
+      else
+	{
+	  bds_ext = 4;
+	  PackStart = 1;
+	  Flag = 128;
+	}
+    }
+
+  *datstart = bds_head + bds_ext;
+
+  nbpv = numBits = ISEC4_NumBits;
+
+  if ( lspherc && lcomplex )
+    {
+      int pcStart, pcScale;
+      pcStart = isubset;
+      pcScale = isec4[16];
+      scaleComplex(data, pcStart, pcScale, itrunc, 0);
+      gatherComplex(data, pcStart, itrunc, datasize);
+    }
+
+  fmin = fmax = data[PackStart];
+
+  minmax_val(data+PackStart+1, datasize-PackStart-1, &fmin, &fmax);
+
+  zref = fmin;
+
+
+  if ( CGRIBEX_Const && !lspherc )
+    {
+      if ( IS_EQUAL(fmin, fmax) ) nbpv = 0;
+    }
+
+
+  blockLength = (*datstart) + (nbpv*(datasize - PackStart) + 7)/8;
+  if ( (blockLength%2) == 1 ) blockLength++;
+
+  unused_bits = blockLength*8 - (*datstart)*8 - nbpv*(datasize - PackStart);
+
+  Flag += unused_bits;
+
+
+  /*
+    Adjust number of bits per value if full integer length to
+    avoid hitting most significant bit (sign bit).
+  */
+  /* if( nbpv == ibits ) nbpv = nbpv - 1; */
+  /*
+    Calculate the binary scaling factor to spread the range of
+    values over the number of bits per value.
+    Limit scaling to 2**-126 to 2**127 (using IEEE 32-bit floats
+    as a guideline).           
+  */
+  range = fabs(fmax - fmin);
+
+  if ( fabs(fmin) < FLT_MIN ) fmin = 0;
+  /*
+    Have to allow tolerance in comparisons on some platforms
+    (eg vpp700 and linux), such as 0.9999999999999999 = 1.0,
+    to avoid clipping ranges which are a power of 2.
+  */
+  if ( range <= jpepsln )
+    {
+      binscale = 0;
+    }
+  else if ( IS_NOT_EQUAL(fmin, 0.0) && (fabs(range/fmin) <= jpepsln) )
+    {
+      binscale = 0;
+    }
+  else if ( fabs(range-1.0) <= jpepsln )
+    {
+      binscale = 1 - nbpv;
+    }
+  else if ( range > 1.0 )
+    {
+      rangec = range + jpepsln;
+      for ( jloop = 1; jloop < 128; jloop++ )
+	{
+	  if ( _pow2tab[jloop] > rangec ) break;
+	}
+      if ( jloop == 128 )
+	{
+	  gprintf(__func__, "Problem calculating binary scale value for encode code %d!", code);
+	  gprintf(__func__, "> range %g rangec %g fmin %g fmax %g", range, rangec, fmin, fmax);
+	  return (707);
+	}
+      else
+	{
+	  binscale = jloop - nbpv;
+	}
+    }
+  else
+    {
+      rangec = range - jpepsln;
+      for ( jloop = 1; jloop < 127; jloop++ )
+	{
+	  if ( 1.0/_pow2tab[jloop] < rangec ) break;
+	}
+      if ( jloop == 127 )
+	{
+	  gprintf(__func__, "Problem calculating binary scale value for encode code %d!", code);
+	  gprintf(__func__, "< range %g rangec %g fmin %g fmax %g", range, rangec, fmin, fmax);
+	  return (707);
+	}
+      else
+	{
+	  binscale = 1 - jloop - nbpv;
+	}
+    }
+
+  max_nbpv_pow2 = (unsigned int) (intpow2(nbpv) - 1);
+
+  if ( binscale != 0 )
+    {
+      if ( binscale < 0 )
+	{
+	  if ( (unsigned int)(range*intpow2(-binscale)+0.5) > max_nbpv_pow2 )
+	    binscale++;
+	}
+      else
+	{
+	  if ( (unsigned int)(range/intpow2(binscale)+0.5) > max_nbpv_pow2 )
+	    binscale--;
+	}
+
+      if ( binscale < 0 ) factor =     intpow2(-binscale);
+      else                factor = 1.0/intpow2( binscale);
+    }
+
+  ref2ibm(&zref, BitsPerInt);
+
+  Put3Byte(blockLength);      /*  0-2 Length of Block 4        */
+  Put1Byte(Flag);             /*  3   Flag & Unused bits       */
+  if ( binscale < 0 ) binscale = 32768 - binscale;
+  Put2Byte(binscale);         /*  4-5 Scale factor             */
+  Put1Real(zref);             /*  6-9 Reference value          */
+  Put1Byte(nbpv);             /*   10 Packing size             */
+
+  if ( lspherc )
+    {
+      if ( lcomplex )
+	{
+	  int jup = isubset;
+	  int ioff = z + bds_ext;
+	  if ( ioff > 0xFFFF ) ioff = 0;
+	  Put2Byte(ioff);
+	  Put2Int(isec4[16]);
+	  Put1Byte(jup);
+	  Put1Byte(jup);
+	  Put1Byte(jup);
+	  for ( i = 0; i < ((jup+1)*(jup+2)); i++ ) Put1Real(data[i]);
+	}
+      else
+	{
+	  Put1Real(data[0]);
+	}
+    }
+
+  *datsize  = ((datasize-PackStart)*nbpv + 7)/8;
+
+#if  defined  (_ARCH_PWR6)
+  encode_double_array_unrolled(nbpv, PackStart, datasize, lGrib, data, zref, factor, &z);
+#else
+  encode_double_array_byte    (nbpv, PackStart, datasize, lGrib, data, zref, factor, &z);
+#endif
+
+  if ( unused_bits >= 8 ) Put1Byte(0);  /*  Fillbyte                     */
+
+  *gribLen = z;
+
+  return (0);
+}
+
+
+void gribEncode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+		double *fsec3, int *isec4, double *fsec4, int klenp, int *kgrib,
+		int kleng, int *kword, int efunc, int *kret)
+{
+  long gribLen = 0; /* Counter of GRIB length for output */
+  long isLen, pdsLen;
+  GRIBPACK *lpds;
+  unsigned char *CGrib;
+  long fsec4size = 0;
+  int numBytes;
+  int bmsIncluded;
+  size_t len;
+  GRIBPACK *lGrib;
+  long datstart, datsize, bdsstart;
+  int status = 0;
+
+  grsdef();
+
+  CGrib = (unsigned char *) kgrib;
+
+  bmsIncluded = ISEC1_Sec2Or3Flag & 64;
+
+  /* set max header len */
+  len = 16384;
+
+  /* add data len */
+  numBytes = (ISEC4_NumBits+7)>>3;
+
+  len += numBytes*klenp;
+
+  /* add bitmap len */
+  if ( bmsIncluded ) len += (klenp+7)>>3;
+
+#if defined (VECTORCODE)
+  lGrib = (GRIBPACK *) malloc(len*sizeof(GRIBPACK));
+  if ( lGrib == NULL ) SysError("No Memory!");
+#else
+  lGrib = CGrib;
+#endif
+
+  isLen = 8;
+  encodeIS(lGrib, &gribLen);
+  lpds = &lGrib[isLen];
+  pdsLen = getPdsLen(isec1);
+
+  encodePDS(lpds, pdsLen,  isec1);
+  gribLen += pdsLen;
+  /*
+  if ( ( isec4[3] == 64 ) && ( isec2[5] == 2 ) )
+    {
+      static int lwarn_cplx = TRUE;
+
+      if ( lwarn_cplx )
+	Message("Complex packing of spectral data unsupported, using simple packing!");
+
+      isec2[5] = 1;
+      isec4[3] = 0;
+
+      lwarn_cplx = FALSE;
+    }
+  */
+  encodeGDS(lGrib, &gribLen, isec2, fsec2);
+  /*
+    ----------------------------------------------------------------
+    BMS Bit-Map Section Section (Section 3)
+    ----------------------------------------------------------------
+  */ 
+  if ( bmsIncluded )
+    {
+      encodeBMS(lGrib, &gribLen, fsec3, isec4, fsec4, &fsec4size);
+    }
+  else
+    {
+      fsec4size = ISEC4_NumValues;
+    }
+
+  bdsstart = gribLen;
+  status = encodeBDS(lGrib, &gribLen, ISEC1_DecScaleFactor, isec2,
+		     isec4, fsec4size, fsec4, &datstart, &datsize, ISEC1_Parameter);
+  if ( status )
+    {
+      *kret = status;
+      return;
+    }
+
+  encodeES(lGrib, &gribLen, bdsstart);
+
+  if ( (size_t) gribLen > kleng*sizeof(int) )
+    Error("kgrib buffer too small! kleng = %d  gribLen = %d", kleng, gribLen);
+
+#if defined (VECTORCODE)
+  if ( (size_t) gribLen > len )
+    Error("lGrib buffer too small! len = %d  gribLen = %d", len, gribLen);
+
+  (void) PACK_GRIB(lGrib, (unsigned char *)CGrib, gribLen, -1L);
+
+  free(lGrib);
+#endif
+
+  ISEC0_GRIB_Len     = gribLen;
+  ISEC0_GRIB_Version = 1;
+
+  *kword = gribLen / sizeof(int);
+  if ( (size_t) gribLen != *kword * sizeof(int) ) *kword += 1;
+
+  *kret = status;
+}
+#include <string.h>
+
+
+
+int gribVersion(unsigned char *is, size_t buffersize)
+{
+  if ( buffersize < 8 )
+    Error("Buffer too small (current size %d)!", (int) buffersize);
+
+  return (GRIB_EDITION(is));
+}
+
+static 
+double GET_Real(unsigned char *grib)
+{
+  int iexp, imant;
+
+  iexp  = GET_UINT1(grib[0]);
+  imant = GET_UINT3(grib[1], grib[2], grib[3]);
+
+  return (decfp2(iexp, imant));
+}
+
+static 
+int decodeIS(unsigned char *is, int *isec0, int *iret)
+{
+  int isLen = 0;
+  int grib1offset;
+  int lgrib = FALSE, lbudg = FALSE, ltide = FALSE;
+
+  /*
+    Octets 1 - 4 : The letters G R I B.
+    Four 8 bit fields.
+  */
+  /*
+    Check letters -> GRIB, BUDG or TIDE.
+  */
+  /*
+    Check that 'GRIB' is found where expected.
+  */
+  if ( GRIB_START(is) ) lgrib = TRUE;
+  /*
+    ECMWF pseudo-grib data uses 'BUDG' and 'TIDE'.
+  */
+  if ( BUDG_START(is) ) lbudg = TRUE;
+  if ( TIDE_START(is) ) ltide = TRUE;
+  /*
+    Data is not GRIB or pseudo-grib.
+  */
+  if ( lgrib == FALSE && lbudg == FALSE && ltide == FALSE )
+    {
+      *iret = 305;
+      gprintf(__func__, "Input data is not GRIB or pseudo-grib.");
+      gprintf(__func__, "Return code = %d", *iret);
+    }
+  if ( lbudg == TRUE || ltide == TRUE )
+    {
+      *iret = 305;
+      gprintf(__func__, "Pseudo-grib data unsupported.");
+      gprintf(__func__, "Return code = %d", *iret);
+    }
+
+  /*
+    Octets 5 - 7 : Length of message.
+    One 24 bit field.
+  */
+  ISEC0_GRIB_Len = GRIB1_SECLEN(is);
+  /*
+    Octet 8 : GRIB Edition Number.
+    One 8 bit field.
+  */
+  ISEC0_GRIB_Version = GRIB_EDITION(is);
+
+  if ( ISEC0_GRIB_Version > 1 )
+    Error("GRIB version %d unsupported!", ISEC0_GRIB_Version);
+
+  grib1offset = ISEC0_GRIB_Version * 4;
+
+  isLen = 4 + grib1offset;
+
+  return (isLen);
+}
+
+static 
+void decodePDS_ECMWF_local_Extension_1(unsigned char *pds, int *isec1)
+{
+  isec1[36] = GET_UINT1(pds[40]);         /* extension identifier       */
+  isec1[37] = GET_UINT1(pds[41]);         /* Class                      */
+  isec1[38] = GET_UINT1(pds[42]);         /* Type                       */
+  isec1[39] = GET_UINT2(pds[43],pds[44]); /* Stream                     */
+  /* isec1[40] = GET_UINT4(pds[45],pds[46],pds[47],pds[48]); */
+  memcpy((char*) &isec1[40], &pds[45], 4);
+  isec1[41] = GET_UINT1(pds[49]);         /* Forecast number            */
+  isec1[42] = GET_UINT1(pds[50]);         /* Total number of forecasts  */
+}
+
+static 
+void decodePDS_DWD_local_Extension_254(unsigned char *pds, int *isec1)
+{
+  long i;
+  int isvn;
+
+  isec1[36] = GET_UINT1(pds[40]); /* extension identifier */
+  for ( i = 0; i < 11; i++ ) 
+    { 
+      isec1[37+i] =  GET_UINT1(pds[41+i]);
+    } 
+
+  isvn = GET_UINT2(pds[52],pds[53]);
+  
+  isec1[48] =  isvn % 0x8000;              /* DWD experiment identifier            */
+  isec1[49] =  isvn >> 15;                 /* DWD run type (0=main, 2=ass, 3=test) */
+
+}
+
+static 
+void decodePDS_DWD_local_Extension_253(unsigned char *pds, int *isec1)
+{
+  long i;
+  int isvn;
+
+  isec1[36] = GET_UINT1(pds[40]); /* extension identifier */
+  for ( i = 0; i < 11; i++ ) 
+    { 
+      isec1[37+i] =  GET_UINT1(pds[41+i]);
+    } 
+
+  isvn = GET_UINT2(pds[52],pds[53]);
+  
+  isec1[48] =  isvn % 0x8000;              /* DWD experiment identifier            */
+  isec1[49] =  isvn >> 15;                 /* DWD run type (0=main, 2=ass, 3=test) */
+  isec1[50] =  GET_UINT1(pds[54]);         /* User id, specified by table          */
+  isec1[51] =  GET_UINT2(pds[55],pds[56]); /* Experiment identifier                */
+  isec1[52] =  GET_UINT2(pds[57],pds[58]); /* Ensemble identification by table     */
+  isec1[53] =  GET_UINT2(pds[59],pds[60]); /* Number of ensemble members           */
+  isec1[54] =  GET_UINT2(pds[61],pds[62]); /* Actual number of ensemble member     */
+  isec1[55] =  GET_UINT1(pds[63]);         /* Model major version number           */
+  isec1[56] =  GET_UINT1(pds[64]);         /* Model minor version number           */
+
+}
+
+static 
+void decodePDS_MPIM_local_Extension_1(unsigned char *pds, int *isec1)
+{
+  isec1[36] = GET_UINT1(pds[40]);         /* extension identifier            */
+  isec1[37] = GET_UINT1(pds[41]);         /* type of ensemble forecast       */
+  isec1[38] = GET_UINT2(pds[42],pds[43]); /* individual ensemble member      */
+  isec1[39] = GET_UINT2(pds[44],pds[45]); /* number of forecasts in ensemble */
+}
+
+static 
+int decodePDS(unsigned char *pds, int *isec0, int *isec1)
+{
+  int pdsLen;
+
+  pdsLen = PDS_Len;
+
+  ISEC1_CodeTable      = PDS_CodeTable;
+  ISEC1_CenterID       = PDS_CenterID;
+  ISEC1_ModelID        = PDS_ModelID;
+  ISEC1_GridDefinition = PDS_GridDefinition;
+  ISEC1_Sec2Or3Flag    = PDS_Sec2Or3Flag;
+  ISEC1_Parameter      = PDS_Parameter;
+  ISEC1_LevelType      = PDS_LevelType;
+
+  if ( (ISEC1_LevelType !=  20) && 
+       (ISEC1_LevelType != GRIB1_LTYPE_99)        && 
+       (ISEC1_LevelType != GRIB1_LTYPE_ISOBARIC)  && 
+       (ISEC1_LevelType != GRIB1_LTYPE_ALTITUDE)  && 
+       (ISEC1_LevelType != GRIB1_LTYPE_HEIGHT)    && 
+       (ISEC1_LevelType != GRIB1_LTYPE_SIGMA)     && 
+       (ISEC1_LevelType != GRIB1_LTYPE_HYBRID)    && 
+       (ISEC1_LevelType != GRIB1_LTYPE_LANDDEPTH) && 
+       (ISEC1_LevelType != GRIB1_LTYPE_ISENTROPIC) && 
+       (ISEC1_LevelType != 115) && 
+       (ISEC1_LevelType != 117) && 
+       (ISEC1_LevelType != 125) && 
+       (ISEC1_LevelType != 127) && 
+       (ISEC1_LevelType != GRIB1_LTYPE_SEADEPTH)  && 
+       (ISEC1_LevelType != 210) )
+    {
+      ISEC1_Level1 = PDS_Level1;
+      ISEC1_Level2 = PDS_Level2;
+    }
+  else
+    {
+      ISEC1_Level1 = PDS_Level;
+      ISEC1_Level2 = 0;
+    }
+
+  /* ISEC1_Year        = PDS_Year; */
+  ISEC1_Month          = PDS_Month;
+  ISEC1_Day            = PDS_Day;
+  ISEC1_Hour           = PDS_Hour;
+  ISEC1_Minute         = PDS_Minute;
+  ISEC1_TimeUnit       = PDS_TimeUnit;
+  ISEC1_TimePeriod1    = PDS_TimePeriod1;
+  ISEC1_TimePeriod2    = PDS_TimePeriod2;
+  ISEC1_TimeRange      = PDS_TimeRange;
+  ISEC1_AvgNum         = PDS_AvgNum;
+  ISEC1_AvgMiss        = PDS_AvgMiss;
+
+  if ( ISEC0_GRIB_Version == 1 )
+    {
+      ISEC1_Year           = PDS_Year;
+      ISEC1_Century        = PDS_Century;
+      ISEC1_SubCenterID    = PDS_Subcenter;
+      ISEC1_DecScaleFactor = PDS_DecimalScale;
+    }
+  else
+    {
+      int year;
+      year                 = GET_UINT1(pds[12]);
+      if ( year <= 100 )
+	{
+	  ISEC1_Year       = year;
+	  ISEC1_Century    = 1;
+	}
+      else
+	{
+	  ISEC1_Year       = year%100;
+	  ISEC1_Century    = 1 + (year-ISEC1_Year)/100;
+	}
+      ISEC1_SubCenterID    = 0;
+      ISEC1_DecScaleFactor = 0;
+    }
+
+  if ( ISEC1_Year < 0 )
+    {
+      ISEC1_Year    = -ISEC1_Year;
+      ISEC1_Century = -ISEC1_Century;
+    }
+
+  ISEC1_LocalFLag = 0;
+  if ( pdsLen > 28 )
+    {
+      int localextlen;
+      localextlen = pdsLen-28;
+
+      if ( localextlen > 4000 )
+	{
+	  Warning("PDS larger than 4000 bytes not supported!");
+	}
+      else
+	{
+	  ISEC1_LocalFLag = 1;
+
+	  if ( ISEC1_CenterID == 78 )
+	    {
+	      if ( pds[40] == 254 ) 
+		{
+		  decodePDS_DWD_local_Extension_254(pds, isec1);
+		}
+	      else if ( pds[40] == 253 )
+		{ 
+		  decodePDS_DWD_local_Extension_253(pds, isec1);
+		}
+	    }
+	  else if ( (ISEC1_CenterID    == 98 && ISEC1_LocalFLag ==  1) ||
+		    (ISEC1_SubCenterID == 98 && ISEC1_LocalFLag ==  1) ||
+		    (ISEC1_CenterID    ==  7 && ISEC1_SubCenterID == 98) )
+	    {
+	      if ( pds[40] == 1 )
+		decodePDS_ECMWF_local_Extension_1(pds, isec1);
+	    }
+	  else if ( ISEC1_CenterID    == 252 && ISEC1_LocalFLag ==  1 )
+	    {
+	      if ( pds[40] == 1 )
+		decodePDS_MPIM_local_Extension_1(pds, isec1);	      
+	    }
+	  else
+	    {
+	      long i;
+	      for ( i = 0; i < localextlen; i++ )
+		{
+		  isec1[24+i] = pds[28+i];
+		}
+	    }
+	}
+    }
+
+  return (pdsLen);
+}
+
+static 
+int decodeGDS(unsigned char  *gds, int *isec0, int *isec2, double *fsec2, int *numGridVals, int dfunc)
+{
+  /* int imisng = 0; */
+  int  ReducedGrid = FALSE, VertCoorTab = FALSE;
+  int  locnv = 0, locnl;
+  int  jlenl;
+  long i;
+  int iexp, imant;
+  int ipvpl, ipl;
+  int gdsLen = 0;
+#if defined (VECTORCODE)
+  unsigned char *igrib;
+  GRIBPACK *lgrib = NULL;
+  size_t lGribLen = 0;
+#endif
+
+  *numGridVals = 0;
+
+  memset(isec2, 0, 22*sizeof(int));
+
+  gdsLen = GDS_Len;
+
+  ipvpl = GDS_PVPL;
+  if ( ipvpl == 0 ) ipvpl = 0xFF;
+
+  if ( ipvpl != 0xFF )
+    { /* Either vct or reduced grid */
+      if ( GDS_NV != 0 )
+	{ /* we have vct */
+	  VertCoorTab = TRUE;
+	  ipl =  4*GDS_NV + ipvpl - 1;
+	  if ( ipl < gdsLen )
+	    {
+	      ReducedGrid = TRUE;
+	    }
+	}
+      else
+	{
+	  VertCoorTab = FALSE;
+	  ReducedGrid = TRUE;
+	}
+      /*	  ReducedGrid = (gdsLen - 32 - 4*GDS_NV); */
+    }
+ 
+  if ( ISEC0_GRIB_Version == 0 )
+    {
+      if ((gdsLen - 32) > 0) VertCoorTab = TRUE;
+      else                   VertCoorTab = FALSE;
+    }
+  
+  if ( ReducedGrid )
+    {
+      locnl = GDS_PVPL - 1 + (VertCoorTab * 4 * GDS_NV);
+      jlenl = (gdsLen - locnl)  >> 1;
+      if ( jlenl == GDS_NumLat )
+	{
+	  *numGridVals = 0;
+	  ISEC2_Reduced = TRUE;
+	  for ( i = 0; i < jlenl; i++ )
+	    {
+	      ISEC2_RowLon(i) = GET_UINT2(gds[locnl+2*i], gds[locnl+2*i+1]);
+	      *numGridVals += ISEC2_RowLon(i);
+	    }
+	}
+      else
+	{
+	  ReducedGrid = FALSE;
+	}
+    }
+
+  ISEC2_GridType = GDS_GridType;
+
+  /*
+     Gaussian grid definition.
+  */
+  if ( ISEC2_GridType == GRIB1_GTYPE_LATLON    ||
+       ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN  ||
+       ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )
+    {
+      ISEC2_NumLat    = GDS_NumLat;
+      if ( ! ReducedGrid )
+	{
+	  ISEC2_NumLon = GDS_NumLon;
+	  *numGridVals  = ISEC2_NumLon*ISEC2_NumLat;
+	}
+      ISEC2_FirstLat  = GDS_FirstLat;
+      ISEC2_FirstLon  = GDS_FirstLon;
+      ISEC2_ResFlag   = GDS_ResFlag;
+      ISEC2_LastLat   = GDS_LastLat;
+      ISEC2_LastLon   = GDS_LastLon;
+      ISEC2_LonIncr   = GDS_LonIncr;
+
+      ISEC2_NumPar    = GDS_NumPar;
+      ISEC2_ScanFlag  = GDS_ScanFlag;
+      if ( ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )
+	{
+	  ISEC2_LatSP     = GDS_LatSP;
+	  ISEC2_LonSP     = GDS_LonSP;
+	  FSEC2_RotAngle  = GDS_RotAngle;
+	}
+      /*
+	if ( Lons != Longitudes || Lats != Latitudes )
+	Error("Latitude/Longitude Conflict");
+      */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN     ||
+	    ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN_ROT ||
+	    ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN_STR ||
+	    ISEC2_GridType == GRIB1_GTYPE_GAUSSIAN_ROTSTR )
+    {
+      /*
+      iret = decodeGDS_GG(gds, gdspos, isec0, isec2, imisng);
+      */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_LATLON     ||
+	    ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT ||
+	    ISEC2_GridType == GRIB1_GTYPE_LATLON_STR ||
+	    ISEC2_GridType == GRIB1_GTYPE_LATLON_ROTSTR )
+    {
+      /*
+      iret = decodeGDS_LL(gds, gdspos, isec0, isec2, imisng);
+      */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_LCC )
+    {
+      ISEC2_NumLon    = GDS_NumLon;
+      ISEC2_NumLat    = GDS_NumLat;
+      *numGridVals  = ISEC2_NumLon*ISEC2_NumLat;
+      ISEC2_FirstLat  = GDS_FirstLat;
+      ISEC2_FirstLon  = GDS_FirstLon;
+      ISEC2_ResFlag   = GDS_ResFlag;
+      ISEC2_Lambert_Lov   = GDS_Lambert_Lov;
+      ISEC2_Lambert_dx    = GDS_Lambert_dx;
+      ISEC2_Lambert_dy    = GDS_Lambert_dy;
+      ISEC2_Lambert_LatS1 = GDS_Lambert_LatS1;
+      ISEC2_Lambert_LatS2 = GDS_Lambert_LatS2;
+      ISEC2_Lambert_LatSP = GDS_Lambert_LatSP;
+      ISEC2_Lambert_LonSP = GDS_Lambert_LonSP;
+      ISEC2_Lambert_ProjFlag = GDS_Lambert_ProjFlag;
+      ISEC2_ScanFlag      = GDS_ScanFlag;
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_SPECTRAL )
+    {
+      ISEC2_PentaJ  = GDS_PentaJ; /* Truncation */
+      ISEC2_PentaK  = GDS_PentaK;
+      ISEC2_PentaM  = GDS_PentaM;
+      ISEC2_RepType = GDS_RepType;
+      ISEC2_RepMode = GDS_RepMode;
+      *numGridVals  = (ISEC2_PentaJ+1)*(ISEC2_PentaJ+2);
+      isec2[ 6] = 0;
+      isec2[ 7] = 0;
+      isec2[ 8] = 0;
+      isec2[ 9] = 0;
+      isec2[10] = 0;
+      /*
+      iret = decodeGDS_SH(gds, gdspos, isec0, isec2, imisng);
+      */
+    }
+  else if ( ISEC2_GridType == GRIB1_GTYPE_GME )
+    {
+      ISEC2_GME_NI2    = GDS_GME_NI2;
+      ISEC2_GME_NI3    = GDS_GME_NI3;
+      ISEC2_GME_ND     = GDS_GME_ND;
+      ISEC2_GME_NI     = GDS_GME_NI;
+      ISEC2_GME_AFlag  = GDS_GME_AFlag;
+      ISEC2_GME_LatPP  = GDS_GME_LatPP;
+      ISEC2_GME_LonPP  = GDS_GME_LonPP;
+      ISEC2_GME_LonMPL = GDS_GME_LonMPL;
+      ISEC2_GME_BFlag  = GDS_GME_BFlag;
+      *numGridVals  = (ISEC2_GME_NI+1)*(ISEC2_GME_NI+1)*10;
+      /*
+      iret = decodeGDS_TR(gds, gdspos, isec0, isec2, imisng);
+      */
+    }
+  else
+    {
+      ISEC2_NumLon = GDS_NumLon;
+      ISEC2_NumLat = GDS_NumLat;
+      *numGridVals  = ISEC2_NumLon*ISEC2_NumLat;
+      Message("Gridtype %d unsupported", ISEC2_GridType);
+    }
+
+  /*    vertical coordinate parameters for hybrid levels.     */
+  /*    get number of vertical coordinate parameters, if any. */
+
+  ISEC2_NumVCP = 0;
+
+  isec2[17] = 0;
+  isec2[18] = 0;
+
+  if ( VertCoorTab == TRUE )
+    {
+      if ( ISEC0_GRIB_Version  == 0 )
+	{
+	  locnv = 32;
+	  ISEC2_NumVCP = (gdsLen - 32) >> 2;
+	}
+      else
+	{
+	  locnv = GDS_PVPL - 1;
+	  ISEC2_NumVCP = GDS_NV;
+	}
+#if defined (SX)
+      lGribLen = 4*ISEC2_NumVCP;	      
+      lgrib    = (GRIBPACK *) malloc(lGribLen*sizeof(GRIBPACK));
+
+      igrib = &gds[locnv];
+      if ( ISEC2_NumVCP > 0 ) (void) UNPACK_GRIB(igrib, lgrib, lGribLen, -1L);
+      for ( i = 0; i < ISEC2_NumVCP; i++ )
+	{
+	  iexp   = (lgrib[4*i  ]);
+	  imant  =((lgrib[4*i+1]) << 16) +
+	          ((lgrib[4*i+2]) <<  8) +
+	           (lgrib[4*i+3]);
+	  fsec2[10+i] = POW_2_M24 * imant * pow(16.0, (double)(iexp - 64));
+	}
+
+      free(lgrib);
+#else
+      for ( i = 0; i < ISEC2_NumVCP; i++ )
+	{
+	  iexp   = (gds[locnv+4*i  ]);
+	  imant  =((gds[locnv+4*i+1]) << 16) +
+	          ((gds[locnv+4*i+2]) <<  8) +
+	           (gds[locnv+4*i+3]);
+	  fsec2[10+i] = decfp2(iexp,imant);
+	}
+#endif
+    }
+
+  return (gdsLen);
+}
+
+static 
+void decode_double_array_common(unsigned char *igrib, long jlend, int NumBits, 
+				double fmin, double zscale, double *fpdata)
+{
+  /* code from wgrib routine BDS_unpack */
+  unsigned char *bits = igrib;
+  unsigned int jmask;
+  long i;
+  unsigned int tbits = 0;
+  int n_bits = NumBits;
+  int t_bits = 0;
+      
+  jmask = (1 << n_bits) - 1;
+  for ( i = 0; i < jlend; i++ )
+    {
+      if (n_bits - t_bits > 8)
+	{
+	  tbits = (tbits << 16) | (bits[0] << 8) | (bits[1]);
+	  bits += 2;
+	  t_bits += 16;
+	}
+
+      while ( t_bits < n_bits )
+	{
+	  tbits = (tbits * 256) + *bits++;
+	  t_bits += 8;
+	}
+      t_bits -= n_bits;
+      fpdata[i] = (tbits >> t_bits) & jmask;
+    }
+  /* at least this vectorizes :) */
+  for ( i = 0; i < jlend; i++ )
+    fpdata[i] = fmin + zscale*fpdata[i];
+}
+
+static unsigned int mask[] = {0,1,3,7,15,31,63,127,255};
+static double shift[9] = {1.0, 2.0, 4.0, 8.0, 16.0, 32.0, 64.0, 128.0, 256.0};
+
+static 
+void decode_double_array_common2(unsigned char *igrib, long jlend, int NumBits, 
+				 double fmin, double zscale, double *fpdata)
+{
+  /* code from wgrib routine BDS_unpack */
+  unsigned char *bits = igrib;
+  long i;
+  int n_bits = NumBits;
+  int c_bits, j_bits;
+  double jj;
+
+  /* older unoptimized code, not often used */
+  c_bits = 8;
+  for ( i = 0; i < jlend; i++ )
+    {
+      jj = 0.0;
+      j_bits = n_bits;
+      while (c_bits <= j_bits)
+	{
+	  if (c_bits == 8)
+	    {
+	      jj = jj * 256.0  + (double) (*bits++);
+	      j_bits -= 8;
+	    }
+	  else
+	    {
+	      jj = (jj * shift[c_bits]) + (double) (*bits & mask[c_bits]);
+	      bits++;
+	      j_bits -= c_bits;
+	      c_bits = 8;
+	    }
+	}
+
+      if (j_bits)
+	{
+	  c_bits -= j_bits;
+	  jj = (jj * shift[j_bits]) + (double) ((*bits >> c_bits) & mask[j_bits]);
+	}
+      
+      fpdata[i] = fmin + zscale*jj;
+    }
+} 
+
+static 
+void decode_double_array(unsigned char *igrib, long jlend, int numBits, 
+			 double fmin, double zscale, double *fpdata)
+{
+  long i;
+  double dval;
+#if defined (VECTORCODE)
+  GRIBPACK *lgrib = NULL;
+
+  if ( numBits ==  8 || numBits == 16 ||
+       numBits == 24 || numBits == 32 )
+    {
+      long jlenc = jlend * numBits / 8;
+      if ( jlenc > 0 ) 
+	{
+	  lgrib = (GRIBPACK *) malloc(jlenc*sizeof(GRIBPACK));
+	  if ( lgrib == NULL ) SysError("No Memory!");
+
+	  (void) UNPACK_GRIB(igrib, lgrib, jlenc, -1L);
+	}
+    }
+
+  if ( numBits ==  0 )
+    {
+      for ( i = 0; i < jlend; i++ )
+	fpdata[i] = fmin;
+    }
+  else if ( numBits ==  8 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (int)lgrib[i];
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 16 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((int)lgrib[2*i  ] <<  8) +  (int)lgrib[2*i+1]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 24 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((int)lgrib[3*i  ] << 16) + ((int)lgrib[3*i+1] <<  8) +
+	  	 (int)lgrib[3*i+2]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 32 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((unsigned int)lgrib[4*i  ] << 24) + ((unsigned int)lgrib[4*i+1] << 16) +
+		((unsigned int)lgrib[4*i+2] <<  8) +  (unsigned int)lgrib[4*i+3]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits <= 25 )
+    {
+      decode_double_array_common(igrib, jlend, numBits, fmin, zscale, fpdata);
+    }
+  else if ( numBits > 25 && numBits < 32 )
+    {
+      decode_double_array_common2(igrib, jlend, numBits, fmin, zscale, fpdata);
+    }
+  else
+    {
+      fprintf(stderr," Unimplemented packing factor %d!\n", numBits);
+      exit(EXIT_FAILURE);
+    }
+
+  if ( lgrib ) free(lgrib);
+
+#else
+  if ( numBits ==  0 )
+    {
+      for ( i = 0; i < jlend; i++ )
+	fpdata[i] = fmin;
+    }
+  else if ( numBits ==  8 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (int)igrib[i];
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 16 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((int)igrib[2*i  ] <<  8) |  (int)igrib[2*i+1]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 24 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((int)igrib[3*i  ] << 16) + ((int)igrib[3*i+1] <<  8) +
+		 (int)igrib[3*i+2]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits == 32 )
+    for ( i = 0; i < jlend; i++ )
+      {
+	dval = (((unsigned int)igrib[4*i  ] << 24) + ((unsigned int)igrib[4*i+1] << 16) +
+		((unsigned int)igrib[4*i+2] <<  8) +  (unsigned int)igrib[4*i+3]);
+	fpdata[i] = fmin + zscale * dval;
+      }
+  else if ( numBits <= 25 )
+    {
+      decode_double_array_common(igrib, jlend, numBits, fmin, zscale, fpdata);
+    }
+  else if ( numBits > 25 && numBits < 32 )
+    {
+      decode_double_array_common2(igrib, jlend, numBits, fmin, zscale, fpdata);
+    }
+  else
+    {
+      fprintf(stderr, "Unimplemented packing factor %d!\n", numBits);
+      exit(EXIT_FAILURE);
+    }
+#endif
+}
+
+static
+int decodeBDS(int decscale, unsigned char *bds, int *isec2, int *isec4, 
+	      double *fsec4, int fsec4len, int dfunc, int bdsLenIn, int numGridVals, int llarge, int *iret)
+{
+  unsigned char *igrib;
+  int lspherc = FALSE, lcomplex = FALSE;
+  int lcompress;
+  int jup, kup, mup;
+  int locnd;
+  int jlend;
+  long i;
+  int bds_flag, jscale, imiss;
+  int bds_ubits;
+  int ioff = 0;
+  int iexp, imant;
+  int zoff;
+  int bds_head = 11;
+  double fmin = 0., zscale = 0.;
+  double *fpdata = fsec4;
+  int bdsLen;
+  extern int CGRIBEX_Fix_ZSE;
+
+  *iret = 0;
+  igrib = bds;
+
+  memset(isec4, 0, 42*sizeof(int));
+
+  /* get length of binary data block. */
+
+  bdsLen = BDS_Len;
+  /*
+    If a very large product, the section 4 length field holds
+    the number of bytes in the product after section 4 upto
+    the end of the padding bytes.
+    This is a fixup to get round the restriction on product lengths
+    due to the count being only 24 bits. It is only possible because
+    the (default) rounding for GRIB products is 120 bytes.
+  */
+  if ( llarge ) bdsLen = bdsLenIn - bdsLen;
+
+  /* 4 bit flag / 4 bit count of unused bits at end of block octet. */
+
+  bds_flag = BDS_Flag;
+
+  /* 0------- grid point           */
+  /* 1------- spherical harmonics  */
+
+  lspherc = bds_flag >> 7;
+
+  if ( lspherc ) isec4[2] = 128;
+  else           isec4[2] = 0;
+
+  /* -0------  simple packing */
+  /* -1------ complex packing */
+
+  lcomplex = (bds_flag >> 6)&1;
+
+  if ( lcomplex ) isec4[3] = 64;
+  else            isec4[3] =  0;
+
+  /* ---0---- No additional flags */
+  /* ---1---- No additional flags */
+
+  lcompress = (bds_flag >> 4)&1; /* compress */
+
+  if ( lcompress )
+    { isec4[5] = 16; isec4[6] = BDS_Z; zoff = 12; }
+  else
+    { isec4[5] =  0; isec4[6] = 0;     zoff =  0; }
+
+  /* ----++++ number of unused bits at end of section) */
+
+  bds_ubits = bds_flag & 0xF;
+  
+  /* scale factor (2 bytes) */;
+
+  jscale = BDS_BinScale;
+
+  /* check for missing data indicators. */
+
+  iexp  = bds[ 6];
+  imant = GET_UINT3(bds[ 7], bds[ 8], bds[ 9]);
+
+  imiss = (jscale == 0xFFFF && iexp == 0xFF && imant == 0xFFFFFF);
+
+  /* convert reference value and scale factor. */
+
+  if ( ! (dfunc == 'J') )
+    if ( imiss == 0 )
+      {
+	fmin = BDS_RefValue;
+	
+	if ( jscale < 0 )
+	  zscale = 1.0/intpow2(-jscale);
+	else
+	  zscale = intpow2(jscale);
+      }
+
+  /* get number of bits in each data value. */
+
+  ISEC4_NumBits = BDS_NumBits;
+
+  /* octet number of start of packed data */
+  /* calculated from start of block 4 - 1 */
+
+  locnd = zoff + bds_head;
+
+  /* if data is in spherical harmonic form, distinguish   */
+  /* between simple/complex packing (lcomplex = 0/1)      */
+
+  if ( lspherc )
+    {
+      if ( !lcomplex )
+	{
+	  /*    no unpacked binary data present */
+
+	  jup = kup = mup = 0;
+
+	  /*    octet number of start of packed data */
+	  /*    calculated from start of block 4 - 1 */
+
+	  ioff   = 1;
+	  locnd += 4*ioff;  /* RealCoef */
+
+	  /*    get real (0,0) coefficient in grib format and     */
+	  /*    convert to floating point.                        */
+
+	  if ( dfunc != 'J' )
+	    {
+	      if ( imiss ) *fpdata++ = 0.0;
+	      else         *fpdata++ = BDS_RealCoef;
+	    }
+	}
+      else /* complex packed spherical harmonics */
+	{
+	  isec4[15] = BDS_PackData;
+	  /*    scaling factor */
+	  isec4[16] = BDS_Power;
+
+	  /*    pentagonal resolution parameters of the */
+	  /*    unpacked section of data field          */
+
+	  jup = bds[zoff+15];
+	  kup = bds[zoff+16];
+	  mup = bds[zoff+17];
+
+	  isec4[zoff+17] = jup;
+	  isec4[zoff+18] = kup;
+	  isec4[zoff+19] = mup;
+
+	  /*    unpacked binary data */
+
+	  locnd += 4; /* 2 + power */
+	  locnd += 3; /* j, k, m   */
+	  ioff   = (jup+1)*(jup+2);
+
+	  if ( dfunc != 'J' )
+	    for ( i = 0; i < ioff; i++ )
+	      {
+		iexp   = (bds[locnd+4*i  ]);
+		imant  =((bds[locnd+4*i+1]) << 16) +
+		        ((bds[locnd+4*i+2]) <<  8) +
+		         (bds[locnd+4*i+3]);
+
+		if ( imiss ) *fpdata++ = 0.0;
+		else         *fpdata++ = decfp2(iexp,imant);
+	      }
+	  
+	  locnd += 4*ioff;  /* RealCoef */
+	}
+    }
+
+  /* Decode data values to floating point and store in fsec4.  */
+  /* First calculate the number of data values.                */
+  /* Take into account that spherical harmonics can be packed  */
+  /* simple (lcomplex = 0) or complex (lcomplex = 1)           */
+
+  jlend = bdsLen - locnd;
+
+  if ( ISEC4_NumBits == 0 )
+    {
+      if ( jlend > 1 )
+	{
+	  *iret = 2001;
+	  gprintf(__func__, " Number of bits per data value = 0!");
+	  gprintf(__func__, " Return code =  %d", *iret);
+	  return (0);
+	}
+
+      if ( numGridVals == 0 )
+	{
+	  *iret = 2002;
+	  gprintf(__func__, " Constant field unsupported for this grid type!");
+	  gprintf(__func__, " Return code =  %d", *iret);
+	  return (0);
+	}
+
+      jlend = numGridVals;
+      jlend -= ioff;
+    }
+  else
+    {
+      jlend = (jlend*8 - bds_ubits) / ISEC4_NumBits;
+    }
+
+  ISEC4_NumValues        = jlend + ioff;
+  ISEC4_NumNonMissValues = 0;
+
+  if ( lcompress )
+    {
+      size_t len;
+
+      if ( gribrec_len(bds[14], bds[15], bds[16]) > JP23SET )
+	len = ((size_t) ((bds[17]<<24)+(bds[18]<<16)+(bds[19]<<8)+bds[20]));
+      else
+        len = ((size_t) ((bds[17]<<16)+(bds[18]<<8)+bds[19]));
+
+      ISEC4_NumValues = len*8/ISEC4_NumBits;
+
+      if ( lspherc )
+	{
+	  if ( lcomplex )
+	    ISEC4_NumValues += ioff;
+	  else
+	    ISEC4_NumValues++;
+	}
+    }
+
+  if ( dfunc == 'J' ) return (bdsLen);
+
+  /* check length of output array. */
+  
+  if ( jlend+ioff > fsec4len )
+    {
+      *iret = 710;
+      gprintf(__func__, " Output array too small. Length = %d", fsec4len);
+      gprintf(__func__, " Number of values = %d", jlend+ioff);
+      gprintf(__func__, " Return code =  %d", *iret);
+      return (0);
+    }
+
+  if ( imiss ) memset((char *)fpdata, 0, jlend*sizeof(double));
+  else
+    {
+      igrib += locnd;
+
+      decode_double_array(igrib, jlend, ISEC4_NumBits, fmin, zscale, fpdata);
+    }
+
+  if ( lspherc && lcomplex )
+    {
+      int pcStart, pcScale;
+      pcStart = isec4[19];
+      pcScale = isec4[16];
+      scatterComplex(fsec4, pcStart, ISEC2_PentaJ, ISEC4_NumValues);
+      scaleComplex(fsec4, pcStart, pcScale, ISEC2_PentaJ, 1);
+    }
+
+  if ( CGRIBEX_Fix_ZSE )  /* Fix ZeroShiftError of simple packed spherical harmonics */
+    if ( lspherc && !lcomplex )
+      {
+        /* 20100705: Fix ZeroShiftError - Edi Kirk */
+	if ( fsec4[1] != 0.0 )
+	  {
+	    double zserr = fsec4[1];
+	    for ( i = 1; i < ISEC4_NumValues; i++ ) fsec4[i] -= zserr;
+	  }
+      }
+
+  if ( decscale )
+    {
+      double scale = pow(10.0, (double)-decscale);
+      for ( i = 0; i < ISEC4_NumValues; i++ ) fsec4[i] *= scale;
+    }
+
+  return (bdsLen);
+}
+
+
+void gribDecode(int *isec0, int *isec1, int *isec2, double *fsec2, int *isec3,
+		double *fsec3, int *isec4, double *fsec4, int fsec4len, int *kgrib,
+		int kleng, int *kword, int dfunc, int *iret)
+{
+  UCHAR *is = NULL, *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  int isLen = 0, pdsLen = 0, gdsLen = 0, bmsLen = 0, bdsLen = 0, esLen = 0;
+  int gribLen = 0;
+  int gdsIncluded = FALSE;
+  int bmsIncluded = FALSE;
+  int bitmapSize = 0;
+  int imaskSize = 0;
+  int ldebug = FALSE;
+  int llarge = FALSE, l_iorj = FALSE;
+  int lsect2 = FALSE, lsect3 = FALSE;
+  int numGridVals = 0;
+  static int lmissvalinfo = 1;
+
+  *iret = 0;
+
+  grsdef();
+
+  ISEC2_Reduced = FALSE;
+
+  /*
+    ----------------------------------------------------------------
+    IS Indicator Section (Section 0)
+    ----------------------------------------------------------------
+  */
+  is = (unsigned char *) &kgrib[0];
+
+  isLen = decodeIS(is, isec0, iret);
+
+  /*
+    If count is negative, have to rescale by factor of -120.
+    This is a fixup to get round the restriction on product lengths
+    due to the count being only 24 bits. It is only possible because
+    the (default) rounding for GRIB products is 120 bytes.
+  */
+  if ( ISEC0_GRIB_Len < 0 )
+    {
+      if ( ldebug )
+	gprintf(__func__, "Special case, negative length multiplied by -120");
+      llarge = TRUE;
+      ISEC0_GRIB_Len *= (-120);
+    }
+  /*
+    When decoding or calculating length, previous editions
+    of the GRIB code must be taken into account.
+
+    In the table below, covering sections 0 and 1 of the GRIB
+    code, octet numbering is from the beginning of the GRIB
+    message;
+    * indicates that the value is not available in the code edition;
+    R indicates reserved, should be set to 0;
+    Experimental edition is considered as edition -1.
+
+    GRIB code edition -1 has fixed length of 20 octets for
+    section 1, the length not included in the message.
+    GRIB code edition 0 has fixed length of 24 octets for
+    section 1, the length being included in the message.
+    GRIB code edition 1 can have different lengths for section
+    1, the minimum being 28 octets, length being included in
+    the message.
+
+                                         Octet numbers for code
+                                                  editions
+
+                 Contents.                   -1      0      1
+                 ---------                ----------------------
+       Letters GRIB                          1-4    1-4    1-4
+       Total length of GRIB message.          *      *     5-7
+       GRIB code edition number               *      *      8
+       Length of Section 1.                   *     5-7    9-11
+       Reserved octet (R).                    *      8(R)   *
+       Version no. of Code Table 2.           *      *     12
+       Identification of centre.              5      9     13
+       Generating process.                    6     10     14
+       Grid definition .                      7     11     15
+       Flag (Code Table 1).                   8     12     16
+       Indicator of parameter.                9     13     17
+       Indicator of type of level.           10     14     18
+       Height, pressure etc of levels.      11-12  15-16  19-20
+       Year of century.                      13     17     21
+       Month.                                14     18     22
+       Day.                                  15     19     23
+       Hour.                                 16     20     24
+       Minute.                               17     21     25
+       Indicator of unit of time.            18     22     26
+       P1 - Period of time.                  19     23     27
+       P2 - Period of time                  20(R)   24     28
+       or reserved octet (R).
+       Time range indicator.                21(R)   25     29
+       or reserved octet (R).
+       Number included in average.       22-23(R)  26-27  30-31
+       or reserved octet (R).
+       Number missing from average.         24(R)  28(R)   32
+       or reserved octet (R).
+       Century of data.                       *      *     33
+       Designates sub-centre if not 0.        *      *     34
+       Decimal scale factor.                  *      *    35-36
+       Reserved. Set to 0.                    *      *    37-48
+       (Need not be present)
+       For originating centre use only.       *      *    49-nn
+       (Need not be present)
+
+    Identify which GRIB code edition is being decoded.
+
+    In GRIB edition 1, the edition number is in octet 8.
+    In GRIB edition 0, octet 8 is reserved and set to 0.
+    In GRIB edition -1, octet 8 is a flag field and can have a
+    a valid value of 0, 1, 2 or 3.
+
+    However, GRIB edition number 0 has a fixed
+    length of 24, included in the message, for section 1, so
+    if the value extracted from octets 5-7 is 24 and that from
+    octet 8 is 0, it is safe to assume edition 0 of the code.
+
+  */
+  if ( ISEC0_GRIB_Len == 24 && ISEC0_GRIB_Version == 0 )
+    {
+      /*
+	Set length of GRIB message to missing data value.
+      */
+      ISEC0_GRIB_Len = 0;
+    }
+  /*
+    If Grib Edition 1 and only length is required, go to section 9.
+  */
+  if ( dfunc == 'L' ) goto LABEL900;
+
+  /*
+    ----------------------------------------------------------------
+    PDS Product Definition Section (Section 1)
+    ----------------------------------------------------------------
+  */ 
+  pds = is + isLen;
+
+  pdsLen = decodePDS(pds, isec0, isec1);
+
+  /*
+    ----------------------------------------------------------------
+    GDS Grid Description Section (Section 2)
+    ----------------------------------------------------------------
+  */
+  gdsIncluded = ISEC1_Sec2Or3Flag & 128;
+
+  if ( gdsIncluded )
+    {
+      gds = is + isLen + pdsLen;
+
+      gdsLen = decodeGDS(gds, isec0, isec2, fsec2, &numGridVals, dfunc);
+    }
+
+  /*
+    ----------------------------------------------------------------
+    BMS Bit-Map Section Section (Section 3)
+    ----------------------------------------------------------------
+  */ 
+  bmsIncluded = ISEC1_Sec2Or3Flag & 64;
+
+  isec3[0] = 0;
+  if ( bmsIncluded )
+    {
+      bms = is + isLen + pdsLen + gdsLen;
+
+      bmsLen = BMS_Len;
+      imaskSize = (bmsLen - 6)<<3;
+      bitmapSize = imaskSize - BMS_UnusedBits;
+      /*
+      fprintf(stderr," bitmapSize = %d %d %d\n", bitmapSize, imaskSize, BMS_UnusedBits);
+      */
+    }
+
+  /*
+    ----------------------------------------------------------------
+    BDS Binary Data Section (Section 4)
+    ----------------------------------------------------------------
+  */
+  bds = is + isLen + pdsLen + gdsLen + bmsLen;
+
+  bdsLen = ISEC0_GRIB_Len - (isLen + pdsLen + gdsLen + bmsLen);
+
+  bdsLen = decodeBDS(ISEC1_DecScaleFactor, bds, isec2, isec4, 
+		     fsec4, fsec4len, dfunc, bdsLen, numGridVals, llarge, iret);
+
+  if ( *iret != 0 ) return;
+
+  ISEC4_NumNonMissValues = ISEC4_NumValues;
+
+  if ( bitmapSize > 0 )
+    {
+      if ( dfunc != 'L' && dfunc != 'J' )
+	if ( DBL_IS_NAN(FSEC3_MissVal) && lmissvalinfo )
+	  {
+	    lmissvalinfo = 0;
+	    FSEC3_MissVal = GRIB_MISSVAL;
+	    Message("Missing value = NaN is unsupported, set to %g!", GRIB_MISSVAL);
+	  }
+
+      /* ISEC4_NumNonMissValues = ISEC4_NumValues; */
+      ISEC4_NumValues        = bitmapSize;
+
+      if ( dfunc != 'J' || bitmapSize == ISEC4_NumNonMissValues )
+	{
+	  long i, j;
+	  GRIBPACK *pbitmap;
+	  GRIBPACK bitmap;
+	  GRIBPACK *imask;
+
+	  /*
+	  unsigned char *bitmap;
+	  bitmap = BMS_Bitmap;
+	  j = ISEC4_NumNonMissValues;
+	  for ( i = ISEC4_NumValues-1; i >= 0; i-- )
+	    {
+	      if ( (bitmap[i/8]>>(7-(i&7)))&1 )
+		fsec4[i] = fsec4[--j];
+	      else
+		fsec4[i] = FSEC3_MissVal;
+	    }
+	  */
+
+	  imask = (GRIBPACK *) malloc(imaskSize*sizeof(GRIBPACK));
+
+#if defined (VECTORCODE)
+	  (void) UNPACK_GRIB(BMS_Bitmap, imask, imaskSize/8, -1L);
+	  pbitmap = imask;
+#else
+	  pbitmap = BMS_Bitmap;
+#endif
+
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+	  for ( i = imaskSize/8-1; i >= 0; i-- )
+	    {
+	      bitmap = pbitmap[i];
+	      imask[i*8+0] = 1 & (bitmap >> 7);
+	      imask[i*8+1] = 1 & (bitmap >> 6);
+	      imask[i*8+2] = 1 & (bitmap >> 5);
+	      imask[i*8+3] = 1 & (bitmap >> 4);
+	      imask[i*8+4] = 1 & (bitmap >> 3);
+	      imask[i*8+5] = 1 & (bitmap >> 2);
+	      imask[i*8+6] = 1 & (bitmap >> 1);
+	      imask[i*8+7] = 1 & (bitmap);
+	    }
+
+	  j = 0;
+	  for ( i = 0; i < ISEC4_NumValues; i++ )
+	    if ( imask[i] ) j++;
+
+	  if ( ISEC4_NumNonMissValues != j )
+	    {
+	      if ( dfunc != 'J' && ISEC4_NumBits != 0 )
+		Warning("Bitmap (%d) and data (%d) section differ, using bitmap section!",
+			j, ISEC4_NumNonMissValues);
+
+	      ISEC4_NumNonMissValues = j;
+	    }
+
+	  if ( dfunc != 'J' )
+	    {
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+	      for ( i = ISEC4_NumValues-1; i >= 0; i-- )
+		fsec4[i] = imask[i] ? fsec4[--j] : FSEC3_MissVal;
+	    }
+
+	  free(imask);
+	}
+    }
+
+  if ( ISEC2_Reduced )
+    {
+      int nlon, nlat;
+      int lsect3, lperio = 1, lveggy;
+      int ilat;
+      int nvalues = 0;
+      int dlon;
+
+      nlat = ISEC2_NumLat;
+      nlon = ISEC2_RowLonPtr[0];
+      for ( ilat = 0; ilat < nlat; ++ilat ) nvalues += ISEC2_RowLon(ilat);
+      for ( ilat = 1; ilat < nlat; ++ilat )
+	if ( ISEC2_RowLon(ilat) > nlon ) nlon = ISEC2_RowLon(ilat);
+
+      dlon = ISEC2_LastLon-ISEC2_FirstLon;
+      if ( dlon < 0 ) dlon += 360000;
+	  
+      if ( nvalues != ISEC4_NumValues )
+	{
+	  *iret = -801;
+	}
+
+      if ( dfunc == 'R' && *iret == -801 )
+	  gprintf(__func__, "Number of values (%d) and sum of lons per row (%d) differ, abort conversion to regular grid!", ISEC4_NumValues, nvalues);
+      
+      if ( dfunc == 'R' && *iret != -801 )
+	{
+	  ISEC2_Reduced = 0;
+	  ISEC2_NumLon = nlon;
+	  ISEC4_NumValues = nlon*nlat;
+
+	  lsect3 = bitmapSize > 0;
+	  lveggy = (ISEC1_CodeTable == 128) && (ISEC1_CenterID == 98) && 
+	    ((ISEC1_Parameter == 27) || (ISEC1_Parameter == 28) || 
+	     (ISEC1_Parameter == 29) || (ISEC1_Parameter == 30));
+	      
+	  (void) qu2reg3(fsec4, ISEC2_RowLonPtr, nlat, nlon, FSEC3_MissVal, iret,
+			 lsect3, lperio, lveggy);
+	      
+	  if ( bitmapSize > 0 )
+	    {
+	      long i;
+	      int j = 0;
+	      
+	      for ( i = 0; i < ISEC4_NumValues; i++ )
+		if ( IS_NOT_EQUAL(fsec4[i], FSEC3_MissVal) ) j++;
+		  
+	      ISEC4_NumNonMissValues = j;
+	    }
+	}
+    }
+
+
+  if ( ISEC0_GRIB_Version == 1 ) isLen = 8;
+  esLen = 4;
+
+  gribLen = isLen + pdsLen + gdsLen + bmsLen + bdsLen + esLen;
+
+  if ( ISEC0_GRIB_Len )
+    if ( gribLen > ISEC0_GRIB_Len )
+      {
+	Warning("grib1Len = %d gribLen = %d", ISEC0_GRIB_Len, gribLen);
+      }
+
+  ISEC0_GRIB_Len = gribLen;
+
+  *kword = gribLen / sizeof(int);
+  if ( (size_t) gribLen != *kword * sizeof(int) ) *kword += 1;
+
+  /*
+    ----------------------------------------------------------------
+    Section 9 . Abort/return to calling routine.
+    ----------------------------------------------------------------
+  */
+ LABEL900:;
+
+  if ( ldebug )
+    {
+      gprintf(__func__, "Section 9.");
+      gprintf(__func__, "Output values set -");
+
+      gribPrintSec0(isec0);
+      gribPrintSec1(isec0, isec1);
+      /*
+	Print section 2 if present.
+      */
+      if ( lsect2 ) gribPrintSec2DP(isec0, isec2, fsec2);
+
+      if ( ! l_iorj )
+	{
+	  /*
+	    Print section 3 if present.
+	  */
+	  if ( lsect3 ) gribPrintSec3DP(isec0, isec3, fsec3);
+
+	  gribPrintSec4DP(isec0, isec4, fsec4);
+	  /*
+	    Special print for 2D spectra wave field real values in
+	    section 4
+	  */
+	  if ( (isec1[ 0] ==  140) && 
+	       (isec1[ 1] ==   98) && 
+	       (isec1[23] ==    1) && 
+	       ((isec1[39] == 1045) || (isec1[39] == 1081))  && 
+	       ((isec1[ 5] ==  250) || (isec1[ 5] ==  251)) )
+	    gribPrintSec4Wave(isec4);
+	}
+    }
+}
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <string.h>
+#include <ctype.h>
+
+
+
+int gribOpen(const char *filename, const char *mode)
+{
+  int fileID;
+
+  fileID = fileOpen(filename, mode);
+
+#if defined (__sun)
+  if ( fileID != FILE_UNDEFID && tolower(*mode) == 'r' )
+    {
+      fileSetBufferType(fileID, FILE_BUFTYPE_MMAP);
+    }
+#endif
+
+  return (fileID);  
+}
+
+
+void gribClose(int fileID)
+{
+  fileClose(fileID);
+}
+
+
+off_t gribGetPos(int fileID)
+{
+  return (fileGetPos(fileID));
+}
+
+
+int gribCheckFiletype(int fileID)
+{
+  int ierr;
+  int found = 0;
+  char buffer[4];
+
+  if ( fileRead(fileID, buffer, 4) != 4 ) return(found);
+
+  if ( memcmp(buffer, "GRIB", 4) == 0 )
+    {
+      found = 1;
+      if ( CGRIBEX_Debug ) Message("found GRIB file = %s", fileInqName(fileID));
+    }
+  else
+    {
+      long offset;
+
+      ierr = gribFileSeek(fileID, &offset);
+      fileRewind(fileID);
+      if ( !ierr )
+	{
+	  found = 1;
+	  if ( CGRIBEX_Debug ) Message("found seek GRIB file = %s", fileInqName(fileID));
+	}
+    }
+
+  return (found);
+}
+
+
+int gribCheckSeek(int fileID, long *offset, int *version)
+{
+  int ierr;
+  char buffer[4];
+
+  ierr = gribFileSeek(fileID, offset);
+
+  *version = -1;
+  if ( !ierr )
+    {
+      if ( fileRead(fileID, buffer, 4) == 4 )
+	*version = buffer[3];
+    }
+
+  return (ierr);
+}
+
+
+int gribFileSeekOld(int fileID, long *offset)
+{
+  /* position file pointer after GRIB */
+  int ch;
+  int buffersize = 4096;
+  unsigned char buffer[4096];
+  int retry = 4096;
+  int i;
+  void *fileptr;
+
+  *offset = 0;
+
+  fileptr = filePtr(fileID);
+
+  ch = filePtrGetc(fileptr); if ( ch == EOF ) return (-1); buffer[0] = ch;
+  ch = filePtrGetc(fileptr); if ( ch == EOF ) return (-1); buffer[1] = ch;
+  ch = filePtrGetc(fileptr); if ( ch == EOF ) return (-1); buffer[2] = ch;
+  ch = filePtrGetc(fileptr); if ( ch == EOF ) return (-1); buffer[3] = ch;
+  /*
+  fileRead(fileID, buffer, 4);
+  */
+
+  while ( retry-- )
+    {
+      for ( i = 0; i < buffersize-4; ++i )
+	{
+	  if (buffer[i  ] == 'G' && 
+	      buffer[i+1] == 'R' &&
+	      buffer[i+2] == 'I' &&
+	      buffer[i+3] == 'B')
+	    {
+	      if ( CGRIBEX_Debug )
+		Message("record offset = %d", (int) *offset);
+	      return (0);
+	    }
+	  else
+	    {
+	      ch = filePtrGetc(fileptr); if ( ch == EOF ) return (-1); buffer[i+4] = ch;
+	      (*offset)++;
+	    }
+	}
+      buffer[0] = buffer[i  ];
+      buffer[1] = buffer[i+1];
+      buffer[2] = buffer[i+2];
+      buffer[3] = buffer[i+3];
+    }
+
+  if ( CGRIBEX_Debug )
+    Message("record offset = %d", (int) *offset);
+
+  return (1);
+}
+
+
+int gribFileSeek(int fileID, long *offset)
+{
+  /* position file pointer after GRIB */
+  const long GRIB = 0x47524942;
+  long code = 0;
+  int ch;
+  int retry = 4096*4096;
+  void *fileptr;
+
+  *offset = 0;
+
+  fileptr = filePtr(fileID);
+
+  while ( retry-- )
+    {
+      ch = filePtrGetc(fileptr);
+      if ( ch == EOF ) return (-1);
+    
+      code = ( (code << 8) + ch ) & 0xFFFFFFFF;
+
+      if ( code == GRIB )
+	{
+	  if ( CGRIBEX_Debug )
+	    Message("record offset = %d", (int) *offset);
+	  return (0);
+	}
+
+      (*offset)++;
+    }
+
+  if ( CGRIBEX_Debug )
+    Message("record offset = %d", (int) *offset);
+
+  return (1);
+}
+
+
+int gribFileSeekTest(int fileID, long *offset)
+{
+  /* position file pointer after GRIB */
+  const long GRIB = 0x47524942;
+  long code = 0;
+  int ch;
+  int i = 0;
+  const int buffersize = 8;
+  unsigned char buffer[8];
+  int retry = 4096*4096;
+  void *fileptr;
+  int nread = 0;
+
+  *offset = 0;
+
+  fileptr = filePtr(fileID);
+
+  while ( retry-- )
+    {
+      if ( i >= nread )
+	{
+	  nread = (int) filePtrRead(fileptr, buffer, buffersize);
+	  if ( nread == 0 ) return (-1);
+	  i = 0;
+	}
+
+      ch = buffer[i++];
+      code = ( (code << 8) + ch ) & 0xFFFFFFFF;
+
+      if ( code == GRIB )
+	{
+	  /* printf("end: %d %d\n", nread, i); */
+	  if ( CGRIBEX_Debug )
+	    Message("record offset = %d", (int) *offset);
+
+	  if ( i != nread ) fileSetPos(fileID, (off_t) i-nread, SEEK_CUR);
+
+	  return (0);
+	}
+
+      (*offset)++;
+    }
+
+  if ( CGRIBEX_Debug )
+    Message("record offset = %d", (int) *offset);
+
+  return (1);
+}
+
+
+int gribReadSize(int fileID)
+{
+  int gribversion, gribsize;
+  int b1, b2, b3;
+  off_t pos;
+  void *fileptr;
+  /*
+  const int buffersize = 4;
+  unsigned char buffer[4];
+  */
+  fileptr = filePtr(fileID);
+
+  pos = fileGetPos(fileID); 
+  /* bug: order of functions calls!
+     gribsize = (filePtrGetc(fileptr) << 16) + (filePtrGetc(fileptr) << 8) + filePtrGetc(fileptr);
+  */
+  b1 = filePtrGetc(fileptr);
+  b2 = filePtrGetc(fileptr);
+  b3 = filePtrGetc(fileptr);
+  // gribsize = (b1 << 16) + (b2 << 8) + b3;
+  gribsize = gribrec_len(b1, b2, b3);
+
+  gribversion = filePtrGetc(fileptr);
+  /*
+  filePtrRead(fileptr, buffer, buffersize);
+
+  gribsize = (buffer[0] << 16) + (buffer[1] << 8) + buffer[2];
+
+  gribversion = buffer[3];
+  */
+  if ( gribsize == 24 )
+    {
+      if ( gribversion != 1 && gribversion != 2 ) gribversion = 0;
+    }
+
+  if ( CGRIBEX_Debug )
+    Message("gribversion = %d", gribversion);
+
+  if ( gribversion == 0 )
+    {
+      int pdssize = 0, gdssize = 0, bmssize = 0, bdssize = 0;
+      int issize = 4, essize = 4;
+      int flag;
+
+      pdssize = gribsize;
+      fileSetPos(fileID, (off_t) 3, SEEK_CUR);
+      if ( CGRIBEX_Debug ) Message("pdssize     = %d", pdssize);
+      flag = filePtrGetc(fileptr);
+      if ( CGRIBEX_Debug ) Message("flag        = %d", flag);
+  
+      fileSetPos(fileID, (off_t) pdssize-8, SEEK_CUR);
+
+      if ( flag & 128 )
+	{
+	  b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	  gdssize = (b1 << 16) + (b2 << 8) + b3;
+	  fileSetPos(fileID, (off_t) gdssize-3, SEEK_CUR);
+	  if ( CGRIBEX_Debug ) Message("gdssize     = %d", gdssize);
+	}
+
+      if ( flag & 64 )
+	{
+	  b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	  bmssize = (b1 << 16) + (b2 << 8) + b3;
+	  fileSetPos(fileID, (off_t) bmssize-3, SEEK_CUR);
+	  if ( CGRIBEX_Debug ) Message("bmssize     = %d", bmssize);
+	}
+
+      b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+      bdssize = (b1 << 16) + (b2 << 8) + b3;
+      if ( CGRIBEX_Debug ) Message("bdssize     = %d", bdssize);
+
+      gribsize = issize + pdssize + gdssize + bmssize + bdssize + essize;
+    }
+  else if ( gribversion == 1 )
+    {
+      if ( gribsize > JP23SET ) /* Large GRIB record */
+	{
+	  int pdssize = 0, gdssize = 0, bmssize = 0, bdssize = 0;
+	  int issize = 4, essize = 4;
+	  int flag;
+
+	  b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	  pdssize = (b1 << 16) + (b2 << 8) + b3;
+	  if ( CGRIBEX_Debug ) Message("pdssize     = %d", pdssize);
+
+	  for ( int i = 0; i < 5; ++i ) flag = filePtrGetc(fileptr);
+	  if ( CGRIBEX_Debug ) Message("flag        = %d", flag);
+  
+	  fileSetPos(fileID, (off_t) pdssize-8, SEEK_CUR);
+
+	  if ( flag & 128 )
+	    {
+	      b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	      gdssize = (b1 << 16) + (b2 << 8) + b3;
+	      fileSetPos(fileID, (off_t) gdssize-3, SEEK_CUR);
+	      if ( CGRIBEX_Debug ) Message("gdssize     = %d", gdssize);
+	    }
+	  
+	  if ( flag & 64 )
+	    {
+	      b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	      bmssize = (b1 << 16) + (b2 << 8) + b3;
+	      fileSetPos(fileID, (off_t) bmssize-3, SEEK_CUR);
+	      if ( CGRIBEX_Debug ) Message("bmssize     = %d", bmssize);
+	    }
+
+	  b1 = filePtrGetc(fileptr); b2 = filePtrGetc(fileptr); b3 = filePtrGetc(fileptr);
+	  bdssize = (b1 << 16) + (b2 << 8) + b3;
+	  bdssize = correct_bdslen(bdssize, gribsize, issize+pdssize+gdssize+bmssize);
+	  if ( CGRIBEX_Debug ) Message("bdssize     = %d", bdssize);
+
+	  gribsize = issize+pdssize+gdssize+bmssize+bdssize+essize;
+	}
+    }
+  else if ( gribversion == 2 )
+    {
+      int i;
+      /* we set gribsize the following way because it doesn't matter then
+	 whether int is 4 or 8 bytes long - we don't have to care if the size
+	 really fits: if it does not, the record can not be read at all */
+      gribsize = 0;
+      for ( i = 0; i < 8; i++ ) gribsize = (gribsize << 8) | filePtrGetc(fileptr);
+    }
+  else
+    {
+      gribsize = 0;
+      Warning("GRIB version %d unsupported!", gribversion);
+    }
+
+  if ( filePtrEOF(fileptr) ) gribsize = 0;
+
+  if ( CGRIBEX_Debug )
+    Message("gribsize    = %d", gribsize);
+
+  fileSetPos(fileID, pos, SEEK_SET);
+
+  return (gribsize);
+}
+
+
+int gribGetSize(int fileID)
+{
+  int recsize;
+  long offset;
+  int ierr;
+
+  ierr = gribFileSeek(fileID, &offset); /* position file pointer after GRIB */
+  if ( ierr > 0 )
+    {
+      Warning("GRIB record not found!");
+      return (0);
+    }
+
+  if ( ierr == -1 )
+    return (0);
+  else if ( ierr == 1 )
+    return (0);
+
+  recsize = gribReadSize(fileID);
+
+  if ( CGRIBEX_Debug ) Message("recsize = %d", recsize);
+
+  fileSetPos(fileID, (off_t) -4, SEEK_CUR);
+
+  return (recsize);
+}
+
+
+int gribRead(int fileID, unsigned char *buffer, size_t *buffersize)
+{
+  long offset;
+  int ierr = 0;
+  size_t nread, recsize, recsize0;
+
+  ierr = gribFileSeek(fileID, &offset); /* position file pointer after GRIB */
+  if ( ierr > 0 )
+    {
+      Warning("GRIB record not found!");
+      return (-2);
+    }
+
+  if ( ierr == -1 )
+    {
+      *buffersize = 0;
+      return (-1);
+    }
+  else if ( ierr == 1 )
+    {
+      *buffersize = 0;
+      return (-2);
+    }
+
+  recsize = gribReadSize(fileID);
+
+  buffer[0] = 'G';
+  buffer[1] = 'R';
+  buffer[2] = 'I';
+  buffer[3] = 'B';
+
+  recsize0 = recsize;
+
+  if ( recsize > *buffersize )
+    {
+      recsize = *buffersize;
+      ierr = -3;
+    }
+
+  *buffersize = recsize0;
+
+  nread = fileRead(fileID, &buffer[4], recsize-4);
+
+  if ( nread != recsize-4 ) ierr = 1;
+
+  return (ierr);
+}
+
+
+int gribWrite(int fileID, unsigned char *buffer, size_t buffersize)
+{
+  int  nwrite = 0;
+
+  if( (nwrite = fileWrite(fileID, buffer, buffersize)) != (int) buffersize )
+    {
+      perror(__func__);
+      nwrite = -1;
+    }
+
+  return ((int) nwrite);
+}
+
+
+int gribrec_len(int b1, int b2, int b3)
+{
+  int gribsize;
+
+  gribsize = (1-(int) ((unsigned) (b1&128) >> 6)) * (int) (((b1&127) << 16)+(b2<<8) + b3);
+  /*
+    If count is negative, have to rescale by factor of -120.
+    This is a fixup to get round the restriction on product lengths
+    due to the count being only 24 bits. It is only possible because
+    the (default) rounding for GRIB products is 120 bytes.
+  */
+  if ( gribsize < 0 ) gribsize *= (-120);
+
+  return (gribsize);
+}
+
+#include <stdio.h>
+#include <math.h>
+
+
+/* calculate_pfactor: source code from grib_api-1.8.0 */
+double calculate_pfactor(const double* spectralField, long fieldTruncation, long subsetTruncation)
+{
+  /*long n_vals = ((fieldTruncation+1)*(fieldTruncation+2));*/
+  long loop, index, m, n = 0;
+  double pFactor, zeps = 1.0e-15;
+  long ismin = (subsetTruncation+1), ismax = (fieldTruncation+1);
+  double* weights, range, * norms;
+  double weightedSumOverX = 0.0, weightedSumOverY = 0.0, sumOfWeights = 0.0, x, y;
+  double numerator = 0.0, denominator = 0.0, slope;
+
+  /*
+  // Setup the weights
+   */
+
+  range = (double) (ismax - ismin +1);
+
+  weights = (double*) malloc((ismax+1)*sizeof(double));
+  for( loop = ismin; loop <= ismax; loop++ )
+    weights[loop] = range / (double) (loop-ismin+1);
+  /*
+  // Compute norms
+  // Handle values 2 at a time (real and imaginary parts).
+   */
+  norms = (double*) malloc((ismax+1)*sizeof(double));
+
+  for( loop = 0; loop < ismax+1; loop++ ) norms[loop] = 0.0;
+  /*
+  // Form norms for the rows which contain part of the unscaled subset.
+   */
+
+  index = -2;
+  for( m = 0; m < subsetTruncation; m++ )
+    for( n = m; n <= fieldTruncation; n++ ) {
+      index += 2;
+      if( n >= subsetTruncation ) {
+        double tval = spectralField[index];
+        tval=tval<0?-tval:tval;
+        norms[n] = norms[n] > tval ? norms[n] : tval;
+        tval = spectralField[index+1];
+        tval=tval<0?-tval:tval;
+        norms[n] = norms[n] > tval ? norms[n] : tval;
+      }
+    }
+  /*
+  // Form norms for the rows which do not contain part of the unscaled subset.
+   */
+
+  for( m = subsetTruncation; m <= fieldTruncation; m++ )
+    for( n = m; n <= fieldTruncation; n++ ) {
+      double tval = spectralField[index];
+      index += 2;
+      tval=tval<0?-tval:tval;
+      norms[n] = norms[n] > tval ? norms[n] : tval;
+      tval = spectralField[index+1];
+      tval=tval<0?-tval:tval;
+      norms[n] = norms[n] > tval ? norms[n] : tval;
+    }
+
+  /*
+  // Ensure the norms have a value which is not too small in case of
+  // problems with math functions (e.g. LOG).
+   */
+
+  for( loop = ismin; loop <= ismax; loop++ ) {
+    norms[n] = norms[n] > zeps ? norms[n] : zeps;
+    if( norms[n] == zeps ) weights[n] = 100.0 * zeps;
+  }
+
+  /*
+  // Do linear fit to find the slope
+   */
+
+  for( loop = ismin; loop <= ismax; loop++ ) {
+    x = log( (double) (loop*(loop+1)) );
+    y = log( norms[loop] );
+    weightedSumOverX = weightedSumOverX + x * weights[loop];
+    weightedSumOverY = weightedSumOverY + y * weights[loop];
+    sumOfWeights = sumOfWeights + weights[loop];
+  }
+  weightedSumOverX = weightedSumOverX / sumOfWeights;
+  weightedSumOverY = weightedSumOverY / sumOfWeights;
+
+  /*
+  // Perform a least square fit for the equation
+   */
+
+  for( loop = ismin; loop <= ismax; loop++ ) {
+
+    x = log( (double)(loop*(loop+1)) );
+    y = log( norms[loop] );
+    numerator =
+      numerator + weights[loop] * (y-weightedSumOverY) * (x-weightedSumOverX);
+    denominator =
+      denominator + weights[loop] * ((x-weightedSumOverX) * (x-weightedSumOverX));
+  }
+  slope = numerator / denominator;
+
+  free(weights);
+  free(norms);
+
+  pFactor = -slope;
+  if( pFactor < -9999.9 ) pFactor = -9999.9;
+  if( pFactor > 9999.9 )  pFactor = 9999.9;
+
+  return pFactor;
+}
+
+
+void scaleComplex(double *fpdata, int pcStart, int pcScale, int trunc, int inv)
+{
+  double power;
+  double *scale = (double *) malloc((trunc+1)*sizeof(double));
+  int  n, m;
+  int  index;
+
+  if ( scale == NULL ) SysError("No Memory!");
+
+  if ( pcScale < -10000 || pcScale > 10000 )
+    {
+      fprintf(stderr, " scaleComplex: Invalid power given %6d\n", pcScale);
+      return;
+   }
+
+  /* Setup scaling factors = n(n+1)^^p for n = 1 to truncation */
+
+  if ( pcScale == 0 ) return;
+
+  power = (double) pcScale / 1000.;
+  scale[0] = 1.0;
+
+  for ( n = 1; n <= trunc; n++ )
+    {
+      if (pcScale != 1000)
+         scale[n] = pow((double) (n*(n+1)), power);
+      else
+         scale[n] =     (double) (n*(n+1));
+    }
+
+  if ( inv )
+    for ( n = 1; n <= trunc; n++ ) scale[n] = 1.0 / scale[n];
+
+  /* Scale the values */
+
+  index = 0;
+
+  for ( m = 0;   m < pcStart; m++ )
+    for ( n = m; n <= trunc; n++ )
+      {
+	if ( n >= pcStart )
+	  {
+	    fpdata[index  ] *= scale[n];
+	    fpdata[index+1] *= scale[n];
+	  }
+	index += 2;
+      }
+
+  for ( m = pcStart; m <= trunc; m++ )
+    for ( n = m;     n <= trunc; n++ )
+      {
+	fpdata[index  ] *= scale[n];
+	fpdata[index+1] *= scale[n];
+	index += 2;
+      }
+
+  free(scale);
+}
+
+
+void scatterComplex(double *fpdata, int pcStart, int trunc, int nsp)
+{
+  double *fphelp = (double *) malloc(nsp*sizeof(double));
+  int  m, n;
+  int  index, inext;
+
+  if ( fphelp == NULL ) SysError("No Memory!");
+
+  index = inext = 0;
+
+  for ( m = 0;   m <= pcStart; m++ )
+    for ( n = m; n <= trunc; n++ )
+      {
+	if ( pcStart >= n )
+	  {
+	    fphelp[index  ] = fpdata[inext++];
+	    fphelp[index+1] = fpdata[inext++];
+	  }
+	index += 2;
+      }
+
+  index = 0;
+  for ( m = 0;   m <= trunc; m++ )
+    for ( n = m; n <= trunc; n++ )
+      {
+	if ( n > pcStart )
+	  {
+	    fphelp[index  ] = fpdata[inext++];
+	    fphelp[index+1] = fpdata[inext++];
+	  }
+	index += 2;
+      }
+
+  for ( m = 0; m < nsp; m++ ) fpdata[m] = fphelp[m];
+
+  free(fphelp);
+}
+
+
+void gatherComplex(double *fpdata, int pcStart, int trunc, int nsp)
+{
+  double *fphelp = (double *) malloc(nsp*sizeof(double));
+  int  m, n;
+  int  index, inext;
+
+  if ( fphelp == NULL ) SysError("No Memory!");
+
+  index = inext = 0;
+
+  for ( m = 0;   m <= pcStart; m++ )
+    for ( n = m; n <= trunc; n++ )
+      {
+	if ( pcStart >= n )
+	  {
+	    fphelp[inext++] = fpdata[index];
+	    fphelp[inext++] = fpdata[index+1];
+	  }
+	index += 2;
+      }
+
+  index = 0;
+  for ( m = 0;   m <= trunc; m++ )
+    for ( n = m; n <= trunc; n++ )
+      {
+	if ( n > pcStart )
+	  {
+	    fphelp[inext++] = fpdata[index];
+	    fphelp[inext++] = fpdata[index+1];
+	  }
+	index += 2;
+      }
+
+  for ( m = 0; m < nsp; m++ ) fpdata[m] = fphelp[m];
+
+  free(fphelp);
+}
+
+
+void scm0(double *pdl, double *pdr, double *pfl, double *pfr, int klg)
+{
+  /* System generated locals */
+  double r_1;
+
+  /* Local variables */
+  double zfac, zeps, zbeta;
+  int jl;
+  double zalpha;
+
+  /* **** SCM0   - Apply SCM0 limiter to derivative estimates. */
+  /* output: */
+  /*   pdl   = the limited derivative at the left edge of the interval */
+  /*   pdr   = the limited derivative at the right edge of the interval */
+  /* inputs */
+  /*   pdl   = the original derivative at the left edge */
+  /*   pdr   = the original derivative at the right edge */
+  /*   pfl   = function value at the left edge of the interval */
+  /*   pfr   = function value at the right edge of the interval */
+  /*   klg   = number of intervals where the derivatives are limited */
+
+  /*  define constants */
+
+  zeps = 1.0e-12;
+  zfac = (1.0 - zeps) * 3.0;
+
+  for ( jl = 0; jl < klg; ++jl )
+    {
+      if ( (r_1 = pfr[jl] - pfl[jl], fabs(r_1)) > zeps )
+	{
+	  zalpha = pdl[jl] / (pfr[jl] - pfl[jl]);
+	  zbeta  = pdr[jl] / (pfr[jl] - pfl[jl]);
+	  if ( zalpha <= 0.0 ) pdl[jl] = 0.0;
+	  if ( zbeta  <= 0.0 ) pdr[jl] = 0.0;
+	  if ( zalpha > zfac ) pdl[jl] = zfac * (pfr[jl] - pfl[jl]);
+	  if ( zbeta  > zfac ) pdr[jl] = zfac * (pfr[jl] - pfl[jl]);
+	}
+      else
+	{
+	  pdl[jl] = 0.0;
+	  pdr[jl] = 0.0;
+	}
+    }
+} /* scm0 */
+
+
+int rowina2(double *p, int ko, int ki, double *pw,
+	    int kcode, double msval, int *kret)
+{
+  /* System generated locals */
+  int pw_dim1, pw_offset, i_1;
+
+  /* Local variables */
+  double zwt1, zrdi, zpos;
+  int jl, ip;
+  double zdo, zwt;
+
+  /* Parameter adjustments */
+  --p;
+  pw_dim1 = ko + 3;
+  pw_offset = pw_dim1;
+  pw -= pw_offset;
+
+  /* **** ROWINA2 - Interpolation of row of values. */
+  /*     Input Parameters. */
+  /*     ----------------- */
+  /*     P      - Row of values to be interpolated. */
+  /*              Dimension must be at least KO. */
+  /*     KO     - Number of values required. */
+  /*     KI     - Number of values in P on input. */
+  /*     PW     - Working array. */
+  /*              Dimension must be at least (0:KO+2,3). */
+  /*     KCODE  - Interpolation required. */
+  /*              1 , linear. */
+  /*              3 , cubic. */
+  /*     PMSVAL - Value used for missing data indicator. */
+
+  /*     Output Parameters. */
+  /*     ------------------ */
+  /*     P     - Now contains KO values. */
+  /*     KRET  - Return code */
+  /*             0, OK */
+  /*             Non-zero, error */
+
+  /*     Author. */
+  /*     ------- */
+  /*     J.D.Chambers    ECMWF     22.07.94 */
+
+  /*     ********************************    */
+  /*     Section 1.  Linear interpolation .. */
+  /*     ********************************    */
+
+  *kret = 0;
+
+  if ( kcode == 1 )
+    {
+      /*    Move input values to work array */
+      for ( jl = 1; jl <= ki; ++jl )
+	pw[jl + pw_dim1] = p[jl];
+
+      /*    Arrange wrap-around value in work array */
+      pw[ki + 1 + pw_dim1] = p[1];
+
+      /*    Set up constants to be used to figure out weighting for */
+      /*    values in interpolation. */
+      zrdi = (double) ki;
+      zdo = 1.0 / (double) ko;
+
+      /*    Loop through the output points */
+      for ( jl = 1; jl <= ko; ++jl )
+	{
+
+	  /*    Calculate weight from the start of row */
+	  zpos = (jl - 1) * zdo;
+	  zwt = zpos * zrdi;
+
+	  /*    Get the current array position(minus 1) from the weight - */
+	  /*    note the implicit truncation. */
+	  ip = (int) zwt;
+
+	  /*    If the left value is missing, use the right value */
+	  if ( IS_EQUAL(pw[ip + 1 + pw_dim1], msval) )
+	    {
+	      p[jl] = pw[ip + 2 + pw_dim1];
+	    }
+	  /*    If the right value is missing, use the left value */
+	  else if ( IS_EQUAL(pw[ip + 2 + pw_dim1], msval) )
+	    {
+	      p[jl] = pw[ip + 1 + pw_dim1];
+	    }
+	  /*    If neither missing, interpolate ... */
+	  else
+	    {
+
+	      /*       Adjust the weight to range (0.0 to 1.0) */
+	      zwt -= ip;
+
+	      /*       Interpolate using the weighted values on either side */
+	      /*       of the output point position */
+	      p[jl] = (1.0 - zwt) * pw[ip + 1 + pw_dim1] +
+		zwt * pw[ip + 2 + pw_dim1];
+	    }
+	}
+
+      /*     *******************************    */
+      /*     Section 2.  Cubic interpolation .. */
+      /*     *******************************    */
+
+    }
+  else if ( kcode == 3 )
+    {
+      i_1 = ki;
+      for ( jl = 1; jl <= i_1; ++jl )
+	{
+          if ( IS_EQUAL(p[jl], msval) )
+	    {
+	      fprintf(stderr," ROWINA2: ");
+	      fprintf(stderr," Cubic interpolation not supported");
+	      fprintf(stderr," for fields containing missing data.\n");
+	      *kret = 1;
+	      goto L900;
+	    }
+          pw[jl + pw_dim1] = p[jl];
+	}
+      pw[pw_dim1] = p[ki];
+      pw[ki + 1 + pw_dim1] = p[1];
+      pw[ki + 2 + pw_dim1] = p[2];
+      i_1 = ki;
+      for ( jl = 1; jl <= i_1; ++jl )
+	{
+          pw[jl + (pw_dim1 << 1)] =
+	        - pw[jl - 1 + pw_dim1] / 3.0 -
+	          pw[jl     + pw_dim1] * 0.5 +
+	          pw[jl + 1 + pw_dim1] - pw[jl + 2 + pw_dim1] / 6.0;
+          pw[jl + 1 + pw_dim1 * 3] =
+                  pw[jl - 1 + pw_dim1] / 6.0 -
+                  pw[jl     + pw_dim1] +
+                  pw[jl + 1 + pw_dim1] * 0.5 +
+                  pw[jl + 2 + pw_dim1] / 3.0;
+	}
+
+      scm0(&pw[(pw_dim1 << 1) + 1], &pw[pw_dim1 * 3 + 2],
+	   &pw[pw_dim1 + 1], &pw[pw_dim1 + 2], ki);
+
+      zrdi = (double) ki;
+      zdo = 1.0 / (double) ko;
+      for ( jl = 1; jl <= ko; ++jl )
+	{
+          zpos = (jl - 1) * zdo;
+          zwt = zpos * zrdi;
+          ip = (int) zwt + 1;
+          zwt = zwt + 1.0 - ip;
+          zwt1 = 1.0 - zwt;
+          p[jl] = ((3.0 - zwt1 * 2.0) * pw[ip + pw_dim1] +
+                  zwt * pw[ip + (pw_dim1 << 1)]) * zwt1 * zwt1 +
+                  ((3.0 - zwt * 2.0) * pw[ip + 1 + pw_dim1] -
+                  zwt1 * pw[ip + 1 + pw_dim1 * 3]) * zwt * zwt;
+	}
+
+    }
+  else
+    {
+      /*    **************************************    */
+      /*    Section 3.  Invalid interpolation code .. */
+      /*    **************************************    */
+      fprintf(stderr," ROWINA2:");
+      fprintf(stderr," Invalid interpolation code = %2d\n",kcode);
+      *kret = 2;
+    }
+
+L900:
+    return 0;
+} /* rowina2 */
+
+
+int rowina3(double *p, int ko, int ki, double *pw,
+	    int kcode, double msval, int *kret, int omisng, int operio, int oveggy)
+{
+  /*
+C---->
+C**** ROWINA3 - Interpolation of row of values.
+C
+C     Purpose.
+C     --------
+C
+C     Interpolate a row of values.
+C
+C
+C**   Interface.
+C     ----------
+C
+C     CALL ROWINA3( P, KO, KI, PW, KCODE, PMSVAL, KRET, OMISNG, OPERIO)
+C
+C
+C     Input Parameters.
+C     -----------------
+C
+C     P      - Row of values to be interpolated.
+C              Dimension must be at least KO.
+C
+C     KO     - Number of values required.
+C
+C     KI     - Number of values in P on input.
+C
+C     PW     - Working array.
+C              Dimension must be at least (0:KO+2,3).
+C
+C     KCODE  - Interpolation required.
+C              1 , linear.
+C              3 , cubic.
+C
+C     PMSVAL - Value used for missing data indicator.
+C
+C     OMISNG - True if missing values are present in field.
+C
+C     OPERIO - True if input field is periodic.
+C
+C     OVEGGY - True if 'nearest neighbour' processing must be used
+C              for interpolation
+C
+C     Output Parameters.
+C     ------------------
+C
+C     P     - Now contains KO values.
+C     KRET  - Return code
+C             0, OK
+C             Non-zero, error
+C
+C
+C     Method.
+C     -------
+C
+C     Linear or cubic interpolation performed as required.
+C
+C     Comments.
+C     ---------
+C
+C     This is a version of ROWINA which allows for missing data
+C     values and hence for bitmapped fields.
+C
+C
+C     Author.
+C     -------
+C
+C     J.D.Chambers    ECMWF     22.07.94
+C
+C
+C     Modifications.
+C     --------------
+C
+C     J.D.Chambers    ECMWF     13.09.94
+C     Add return code KRET and remove calls to ABORT.
+C
+C     J. Clochard, Meteo France, for ECMWF - January 1998.
+C     Addition of OMISNG and OPERIO arguments.
+C
+C
+C     -----------------------------------------------------------------
+*/
+  /* System generated locals */
+  int pw_dim1, pw_offset, i_1;
+
+  /* Local variables */
+  double zwt1, zrdi, zpos;
+  int jl, ip;
+  double zdo, zwt;
+
+  /* Parameter adjustments */
+  --p;
+  pw_dim1 = ko + 3;
+  pw_offset = pw_dim1;
+  pw -= pw_offset;
+
+  *kret = 0;
+
+  if ( kcode == 1 )
+    {
+      /*    Move input values to work array */
+      for ( jl = 1; jl <= ki; ++jl )
+	pw[jl + pw_dim1] = p[jl];
+
+      if ( operio )
+	{
+	  /* Arrange wrap-around value in work array */
+	  pw[ki + 1 + pw_dim1] = p[1];
+
+	  /* Set up constants to be used to figure out weighting for */
+	  /* values in interpolation. */
+	  zrdi = (double) ki;
+	  zdo = 1.0 / (double) ko;
+	}
+      else
+	{
+	  /* Repeat last value, to cope with "implicit truncation" below */
+	  pw[ki + 1 + pw_dim1] = p[ki];
+
+	  /* Set up constants to be used to figure out weighting for */
+	  /* values in interpolation. */
+	  zrdi = (double) (ki-1);
+	  zdo = 1.0 / (double) (ko-1);
+ 	}
+
+      /*    Loop through the output points */
+      for ( jl = 1; jl <= ko; ++jl )
+	{
+
+	  /* Calculate weight from the start of row */
+	  zpos = (jl - 1) * zdo;
+	  zwt = zpos * zrdi;
+
+	  /* Get the current array position(minus 1) from the weight - */
+	  /* note the implicit truncation. */
+	  ip = (int) zwt;
+		  
+	  /* Adjust the weight to range (0.0 to 1.0) */
+	  zwt -= ip;
+
+          /* If 'nearest neighbour' processing must be used */
+	  if ( oveggy )
+	    {
+              if ( zwt < 0.5 )
+                p[jl] = pw[ip + 1 + pw_dim1];
+	      else
+		p[jl] = pw[ip + 2 + pw_dim1];
+	    }
+	  else
+	    {
+	      /*    If the left value is missing, use the right value */
+	      if ( IS_EQUAL(pw[ip + 1 + pw_dim1], msval) )
+		{
+		  p[jl] = pw[ip + 2 + pw_dim1];
+		}
+	      /*    If the right value is missing, use the left value */
+	      else if ( IS_EQUAL(pw[ip + 2 + pw_dim1], msval) )
+		{
+		  p[jl] = pw[ip + 1 + pw_dim1];
+		}
+	      /*    If neither missing, interpolate ... */
+	      else
+		{
+		  /*       Interpolate using the weighted values on either side */
+		  /*       of the output point position */
+		  p[jl] = (1.0 - zwt) * pw[ip + 1 + pw_dim1] +
+		    zwt * pw[ip + 2 + pw_dim1];
+		}
+	    }
+	}
+
+      /*     *******************************    */
+      /*     Section 2.  Cubic interpolation .. */
+      /*     *******************************    */
+
+    }
+  else if ( kcode == 3 )
+    {
+      i_1 = ki;
+      for ( jl = 1; jl <= i_1; ++jl )
+	{
+          if ( IS_EQUAL(p[jl], msval) )
+	    {
+	      fprintf(stderr," ROWINA2: ");
+	      fprintf(stderr," Cubic interpolation not supported");
+	      fprintf(stderr," for fields containing missing data.\n");
+	      *kret = 1;
+	      goto L900;
+	    }
+          pw[jl + pw_dim1] = p[jl];
+	}
+      pw[pw_dim1] = p[ki];
+      pw[ki + 1 + pw_dim1] = p[1];
+      pw[ki + 2 + pw_dim1] = p[2];
+      i_1 = ki;
+      for ( jl = 1; jl <= i_1; ++jl )
+	{
+          pw[jl + (pw_dim1 << 1)] =
+	        - pw[jl - 1 + pw_dim1] / 3.0 -
+	          pw[jl     + pw_dim1] * 0.5 +
+	          pw[jl + 1 + pw_dim1] - pw[jl + 2 + pw_dim1] / 6.0;
+          pw[jl + 1 + pw_dim1 * 3] =
+                  pw[jl - 1 + pw_dim1] / 6.0 -
+                  pw[jl     + pw_dim1] +
+                  pw[jl + 1 + pw_dim1] * 0.5 +
+                  pw[jl + 2 + pw_dim1] / 3.0;
+	}
+
+      scm0(&pw[(pw_dim1 << 1) + 1], &pw[pw_dim1 * 3 + 2],
+	   &pw[pw_dim1 + 1], &pw[pw_dim1 + 2], ki);
+
+      zrdi = (double) ki;
+      zdo = 1.0 / (double) ko;
+      for ( jl = 1; jl <= ko; ++jl )
+	{
+          zpos = (jl - 1) * zdo;
+          zwt = zpos * zrdi;
+          ip = (int) zwt + 1;
+          zwt = zwt + 1.0 - ip;
+          zwt1 = 1.0 - zwt;
+          p[jl] = ((3.0 - zwt1 * 2.0) * pw[ip + pw_dim1] +
+                  zwt * pw[ip + (pw_dim1 << 1)]) * zwt1 * zwt1 +
+                  ((3.0 - zwt * 2.0) * pw[ip + 1 + pw_dim1] -
+                  zwt1 * pw[ip + 1 + pw_dim1 * 3]) * zwt * zwt;
+	}
+
+    }
+  else
+    {
+      /*    **************************************    */
+      /*    Section 3.  Invalid interpolation code .. */
+      /*    **************************************    */
+      fprintf(stderr," ROWINA2:");
+      fprintf(stderr," Invalid interpolation code = %2d\n",kcode);
+      *kret = 2;
+    }
+
+L900:
+    return 0;
+} /* rowina3 */
+
+
+int qu2reg2(double *pfield, int *kpoint, int klat, int klon,
+	    double *ztemp, double msval, int *kret)
+{
+   /* System generated locals */
+   int i_1, i_2;
+   int kcode = 1;
+
+   /* Local variables */
+   int ilii, ilio, icode;
+   double *zline = NULL;
+   double *zwork = NULL;
+   int iregno, iquano, j210, j220, j230, j240, j225;
+
+
+   zline = (double *) malloc(2*klon*sizeof(double));
+   if ( zline == NULL ) SysError("No Memory!");
+
+   zwork = (double *) malloc(3*(2*klon+3)*sizeof(double));
+   if ( zwork == NULL ) SysError("No Memory!");
+
+   /* Parameter adjustments */
+   --pfield;
+   --kpoint;
+
+/* **** QU2REG - Convert quasi-regular grid data to regular. */
+/*     Input Parameters. */
+/*     ----------------- */
+/*     PFIELD     - Array containing quasi-regular grid */
+/*                  data. */
+/*     KPOINT     - Array containing list of the number of */
+/*                  points on each latitude (or longitude) of */
+/*                  the quasi-regular grid. */
+/*     KLAT       - Number of latitude lines */
+/*     KLON       - Number of longitude lines */
+/*     KCODE      - Interpolation required. */
+/*                  1 , linear - data quasi-regular on */
+/*                               latitude lines. */
+/*                  3 , cubic -  data quasi-regular on */
+/*                               latitude lines. */
+/*                  11, linear - data quasi-regular on */
+/*                               longitude lines. */
+/*                  13, cubic -  data quasi-regular on */
+/*                               longitude lines. */
+/*     PMSVAL     - Value used for missing data indicator. */
+/*     Output Parameters. */
+/*     ------------------ */
+/*     KRET       - return code */
+/*                  0 = OK */
+/*                  non-zero indicates fatal error */
+/*     PFIELD     - Array containing regular grid data. */
+/*     Author. */
+/*     ------- */
+/*     J.D.Chambers     ECMWF      22.07.94 */
+/*     J.D.Chambers     ECMWF      13.09.94 */
+/*     Add return code KRET and remove calls to ABORT. */
+
+
+/* ------------------------------ */
+/* Section 1. Set initial values. */
+/* ------------------------------ */
+
+   *kret = 0;
+
+/* Check input parameters. */
+
+   if (kcode != 1 && kcode != 3 && kcode != 11 && kcode != 13) {
+      fprintf(stderr," QU2REG :");
+      fprintf(stderr," Invalid interpolation type code = %2d\n",kcode);
+      *kret = 1;
+      goto L900;
+   }
+
+/* Set array indices to 0. */
+
+   ilii = 0;
+   ilio = 0;
+
+/* Establish values of loop parameters. */
+
+   if (kcode > 10) {
+
+/*    Quasi-regular along longitude lines. */
+
+      iquano = klon;
+      iregno = klat;
+      icode = kcode - 10;
+   } else {
+
+/*    Quasi-regular along latitude lines. */
+
+      iquano = klat;
+      iregno = klon;
+      icode = kcode;
+   }
+
+/*     -------------------------------------------------------- */
+/**    Section 2. Interpolate field from quasi to regular grid. */
+/*     -------------------------------------------------------- */
+
+   i_1 = iquano;
+   for (j230 = 1; j230 <= i_1; ++j230) {
+
+      if (iregno != kpoint[j230]) {
+
+/*       Line contains less values than required,so */
+/*       extract quasi-regular grid values for a line */
+
+         i_2 = kpoint[j230];
+         for (j210 = 1; j210 <= i_2; ++j210) {
+            ++ilii;
+            zline[j210 - 1] = pfield[ilii];
+         }
+
+/*       and interpolate this line. */
+
+         rowina2(zline, iregno, kpoint[j230], zwork, icode, msval, kret);
+         if (*kret != 0) goto L900;
+
+/*       Add regular grid values for this line to the
+         temporary array. */
+
+         i_2 = iregno;
+         for (j220 = 1; j220 <= i_2; ++j220) {
+            ++ilio;
+            ztemp[ilio - 1] = zline[j220 - 1];
+         }
+
+      } else {
+
+/*       Line contains the required number of values, so add */
+/*       this line to the temporary array. */
+
+         i_2 = iregno;
+         for (j225 = 1; j225 <= i_2; ++j225) {
+            ++ilio;
+            ++ilii;
+            ztemp[ilio - 1] = pfield[ilii];
+         }
+      }
+   }
+
+/* Copy temporary array to user array. */
+
+   i_1 = klon * klat;
+   for (j240 = 1; j240 <= i_1; ++j240) {
+      pfield[j240] = ztemp[j240 - 1];
+   }
+
+/* -------------------------------------------------------- */
+/* Section 9. Return to calling routine. Format statements. */
+/* -------------------------------------------------------- */
+
+L900:
+
+   free(zline);
+   free(zwork);
+
+   return 0;
+} /* qu2reg2 */
+
+
+int qu2reg3(double *pfield, int *kpoint, int klat, int klon,
+	    double msval, int *kret, int omisng, int operio, int oveggy)
+{
+  /*
+C**** QU2REG3 - Convert quasi-regular grid data to regular.
+C
+C     Purpose.
+C     --------
+C
+C     Convert quasi-regular grid data to regular,
+C     using either a linear or cubic interpolation.
+C
+C
+C**   Interface.
+C     ----------
+C
+C     CALL QU2REG3(PFIELD,KPOINT,KLAT,KLON,KCODE,PMSVAL,OMISNG,OPERIO,
+C    X            OVEGGY)
+C
+C
+C     Input Parameters.
+C     -----------------
+C
+C     PFIELD     - Array containing quasi-regular grid data.
+C
+C     KPOINT     - Array containing list of the number of
+C                  points on each latitude (or longitude) of
+C                  the quasi-regular grid.
+C
+C     KLAT       - Number of latitude lines
+C
+C     KLON       - Number of longitude lines
+C
+C     KCODE      - Interpolation required.
+C                  1 , linear - data quasi-regular on latitude lines.
+C                  3 , cubic -  data quasi-regular on latitude lines.
+C                  11, linear - data quasi-regular on longitude lines.
+C                  13, cubic -  data quasi-regular on longitude lines.
+C
+C     PMSVAL     - Value used for missing data indicator.
+C
+C     OMISNG     - True if missing values are present in field.
+C
+C     OPERIO     - True if input field is periodic.
+C
+C     OVEGGY     - True if 'nearest neighbour' processing must be used
+C                  for interpolation
+C
+C
+C     Output Parameters.
+C     ------------------
+C
+C     KRET       - return code
+C                  0 = OK
+C                  non-zero indicates fatal error
+C
+C
+C     Output Parameters.
+C     ------------------
+C
+C     PFIELD     - Array containing regular grid data.
+C
+C
+C     Method.
+C     -------
+C
+C     Data is interpolated and expanded into a temporary array,
+C     which is then copied back into the user's array.
+C     Returns an error code if an invalid interpolation is requested
+C     or field size exceeds array dimensions.
+C
+C     Comments.
+C     ---------
+C
+C     This routine is an adaptation of QU2REG to allow missing data
+C     values, and hence bit mapped fields.
+C
+C
+C     Author.
+C     -------
+C
+C     J.D.Chambers     ECMWF      22.07.94
+C
+C
+C     Modifications.
+C     --------------
+C
+C     J.D.Chambers     ECMWF      13.09.94
+C     Add return code KRET and remove calls to ABORT.
+C
+C     J.D.Chambers     ECMWF        Feb 1997
+C     Allow for 64-bit pointers
+C
+C     J. Clochard, Meteo France, for ECMWF - January 1998.
+C     Addition of OMISNG and OPERIO arguments.
+C     Fix message for longitude number out of bounds, and routine
+C     name in title and formats.
+C
+*/
+   /* System generated locals */
+   int i_1, i_2;
+   int kcode = 1;
+
+   /* Local variables */
+   int ilii, ilio, icode;
+   double *ztemp = NULL;
+   double *zline = NULL;
+   double *zwork = NULL;
+   int iregno, iquano, j210, j220, j230, j240, j225;
+
+   ztemp = (double *) malloc(klon*klat*sizeof(double));
+   if ( ztemp == NULL ) SysError("No Memory!");
+
+   zline = (double *) malloc(2*klon*sizeof(double));
+   if ( zline == NULL ) SysError("No Memory!");
+
+   zwork = (double *) malloc(3*(2*klon+3)*sizeof(double));
+   if ( zwork == NULL ) SysError("No Memory!");
+
+   /* Parameter adjustments */
+   --pfield;
+   --kpoint;
+
+/* ------------------------------ */
+/* Section 1. Set initial values. */
+/* ------------------------------ */
+
+   *kret = 0;
+
+/* Check input parameters. */
+
+   if (kcode != 1 && kcode != 3 && kcode != 11 && kcode != 13) {
+      fprintf(stderr," QU2REG :");
+      fprintf(stderr," Invalid interpolation type code = %2d\n",kcode);
+      *kret = 1;
+      goto L900;
+   }
+
+/* Set array indices to 0. */
+
+   ilii = 0;
+   ilio = 0;
+
+/* Establish values of loop parameters. */
+
+   if (kcode > 10) {
+
+/*    Quasi-regular along longitude lines. */
+
+      iquano = klon;
+      iregno = klat;
+      icode = kcode - 10;
+   } else {
+
+/*    Quasi-regular along latitude lines. */
+
+      iquano = klat;
+      iregno = klon;
+      icode = kcode;
+   }
+
+/*     -------------------------------------------------------- */
+/**    Section 2. Interpolate field from quasi to regular grid. */
+/*     -------------------------------------------------------- */
+
+   i_1 = iquano;
+   for (j230 = 1; j230 <= i_1; ++j230) {
+
+      if (iregno != kpoint[j230]) {
+
+/*       Line contains less values than required,so */
+/*       extract quasi-regular grid values for a line */
+
+         i_2 = kpoint[j230];
+         for (j210 = 1; j210 <= i_2; ++j210) {
+            ++ilii;
+            zline[j210 - 1] = pfield[ilii];
+         }
+
+/*       and interpolate this line. */
+
+         rowina3(zline, iregno, kpoint[j230], zwork, icode, msval, kret, omisng, operio , oveggy);
+         if (*kret != 0) goto L900;
+
+/*       Add regular grid values for this line to the
+         temporary array. */
+
+         i_2 = iregno;
+         for (j220 = 1; j220 <= i_2; ++j220) {
+            ++ilio;
+            ztemp[ilio - 1] = zline[j220 - 1];
+         }
+
+      } else {
+
+/*       Line contains the required number of values, so add */
+/*       this line to the temporary array. */
+
+         i_2 = iregno;
+         for (j225 = 1; j225 <= i_2; ++j225) {
+            ++ilio;
+            ++ilii;
+            ztemp[ilio - 1] = pfield[ilii];
+         }
+      }
+   }
+
+/* Copy temporary array to user array. */
+
+   i_1 = klon * klat;
+   for (j240 = 1; j240 <= i_1; ++j240) {
+      pfield[j240] = ztemp[j240 - 1];
+   }
+
+/* -------------------------------------------------------- */
+/* Section 9. Return to calling routine. Format statements. */
+/* -------------------------------------------------------- */
+
+L900:
+
+   free(zwork);
+   free(zline);
+   free(ztemp);
+
+   return 0;
+} /* qu2reg3 */
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+
+FILE *grprsm = NULL;
+double fref;
+double fmaxval;
+int nfref;
+int nfmaxval;
+int nrnd;
+int ndbg;
+int nvck;
+int nonoff;
+int noabort;
+int num2ok;
+int next2o;
+int nloc2o;
+int nsubce;
+int grib_calendar = -1;
+
+
+void gribSetCalendar(int calendar)
+{
+  grib_calendar = calendar;
+}
+
+
+void grsdef(void)
+{
+  /*
+C---->
+C**** GRSDEF - Initial (default) setting of common area variables
+C              for GRIBEX package.
+C
+C     Purpose.
+C     --------
+C
+C     Sets initial values for common area variables for all
+C     routines of GRIBEX package, if not already done.
+C
+C**   Interface.
+C     ----------
+C
+C     CALL GRSDEF
+C
+C     Input Parameters.
+C     -----------------
+C
+C     None.
+C
+C     Output Parameters.
+C     ------------------
+C
+C     None.
+C
+C     Method.
+C     -------
+C
+C     Self-explanatory.
+C
+C     Externals.
+C     ----------
+C
+C     None.
+C
+C     Reference.
+C     ----------
+C
+C     See subroutine GRIBEX.
+C
+C     Comments.
+C     ---------
+C
+C     None
+C
+C     Author.
+C     -------
+C
+C     J. Clochard, Meteo France, for ECMWF - March 1998.
+C
+C     Modifications.
+C     --------------
+C
+C     J. Clochard, Meteo France, for ECMWF - June 1999.
+C     Add variable NSUBCE.
+C     Use a static variable to determine if initialisation has already
+C     been done. NUSER removed .
+C     Reverse defaults for NEXT2O and NLOC2O, for consistency with
+C     version 13.023 of software .
+C
+  */
+  /*
+C     ----------------------------------------------------------------
+C*    Section 0 . Definition of variables.
+C     ----------------------------------------------------------------
+  */
+  char *envString;
+  char *env_stream;
+  static int lfirst = TRUE;
+  extern int CGRIBEX_Const;
+
+  if ( ! lfirst ) return;
+
+  /*
+    ----------------------------------------------------------------
+    Section 1 . Set values, conditionally.
+    ----------------------------------------------------------------
+  */
+  /*
+    Common area variables have not been set. Set them.
+    
+    User supplied reference value.
+  */
+  fref   = 0.0;
+  /*
+    Reference value supplied by user flag. Set to off.
+  */
+  nfref  = 0;
+  /*
+    User supplied maximum value.
+  */
+  fmaxval   = 0.0;
+  /*
+    Maximum value supplied by user flag. Set to off.
+  */
+  nfmaxval  = 0;
+  /*
+    Set rounding to 120 bytes on.
+  */
+  nrnd   = 1;
+  /*
+    Set GRIB calendar.
+  */
+  if ( grib_calendar == -1 )
+    {
+      grib_calendar = CALENDAR_PROLEPTIC;
+  
+      envString = getenv("GRIB_CALENDAR");
+      if ( envString )
+	{
+	  if      ( strncmp(envString, "standard", 8) == 0 )
+	    grib_calendar = CALENDAR_STANDARD;
+	  else if ( strncmp(envString, "proleptic", 9) == 0 )
+	    grib_calendar = CALENDAR_PROLEPTIC;
+	  else if ( strncmp(envString, "360days", 7) == 0 )
+	    grib_calendar = CALENDAR_360DAYS;
+	  else if ( strncmp(envString, "365days", 7) == 0 )
+	    grib_calendar = CALENDAR_365DAYS;
+	  else if ( strncmp(envString, "366days", 7) == 0 )
+	    grib_calendar = CALENDAR_366DAYS;
+	  else if ( strncmp(envString, "none", 4) == 0 )
+	    grib_calendar = CALENDAR_NONE;
+	}
+    }
+  /*
+    Set debug print off.
+  */
+  ndbg   = 0;
+  
+  envString = getenv("GRIBEX_DEBUG");
+  if ( envString != NULL )
+    {
+      if ( !strncmp(envString, "ON", 2) )
+        ndbg = 1;
+      else if( *envString == '1')
+        ndbg = 1;
+      else if( *envString == '2')
+        ndbg = 2;
+      else
+        ndbg = 0;
+    }
+  /*
+    Set GRIBEX compatibility mode.
+  */
+  envString = getenv("GRIB_GRIBEX_MODE_ON");
+  if ( envString != NULL )
+    {
+      if ( atoi(envString) == 1 ) CGRIBEX_Const = 0;
+    }
+
+  /*
+    Set GRIB value checking on.
+  */
+  nvck   = 1;
+  
+  envString = getenv("GRIBEX_CHECK");
+  if ( envString )
+    {
+      if ( !strncmp(envString, "OFF", 3) )
+        nvck = 0;
+      else
+        nvck = 1;
+    }
+  /*
+    See if output stream needs changing
+  */
+  grprsm = stdout;
+  env_stream = getenv("GRPRS_STREAM");
+  if ( env_stream )
+    {
+      if ( isdigit((int) env_stream[0]) )
+	{
+	  int unit;
+	  unit = atoi(env_stream);
+	  if ( unit < 1 || unit > 99 )
+	    Warning("Invalid number for GRPRS_STREAM: %d", unit);
+	  else if ( unit == 2 )
+	    grprsm = stderr;
+	  else if ( unit == 6 )
+	    grprsm = stdout;
+	  else
+	    {
+	      char filename[] = "unit.00";
+	      sprintf(filename, "%2.2d", unit);
+	      grprsm = fopen(filename, "w");
+	      if ( ! grprsm )
+		SysError("GRPRS_STREAM = %d", unit);
+	    }
+	}
+      else
+	{
+	  if ( env_stream[0] )
+	    {
+	      grprsm = fopen(env_stream, "w");
+	      if ( ! grprsm )
+		SysError("GRPRS_STREAM = %s", env_stream);
+	    }
+	}
+    }
+  /*
+    Set P factor switch to default, user supplies the P factor.
+  */
+  nonoff = 0;
+  /*
+    Set abort flag to NO abort
+  */
+  noabort = 1;
+  /*
+    Mark common area values set by user.
+  */
+  lfirst = FALSE;
+  /*
+    Exhaustive use of all possible second-order packing methods
+    for HOPER='K'. Set to off.
+  */
+  num2ok  = 0;
+  /*
+    Use of extended second-order packing methods for grid-point
+    encoding (HOPER='C' and 'K'). Set to on.
+  */
+  next2o  = 1;
+  /*
+    Use of non-local second-order packing methods for grid-point
+    encoding (HOPER='C' and 'K'). Set to on.
+  */
+  nloc2o  = 1;
+  /*
+    Use of (all valid) sub-centre values for ECMWF fields encoding .
+    encoding. Set to off.
+  */
+  nsubce  = 0;
+}
+
+/* pack 8-bit bytes from 64-bit words to a packed buffer */
+/* same as : for ( int i = 0; i < bc; ++i ) cp[i] = (unsigned char) up[i]; */
+
+long packInt64(unsigned INT64 *up, unsigned char *cp, long bc, long tc)
+{
+#if defined (CRAY)
+  (void) _pack(up, cp, bc, tc);
+#else
+  U_BYTEORDER;
+  unsigned char *cp0;
+  unsigned INT64 upi, *up0, *ip0, *ip1, *ip2, *ip3, *ip4, *ip5, *ip6, *ip7;
+  long head, trail, inner, i, j;
+  long ipack = sizeof(INT64);
+  
+  /* Bytes until first word boundary in destination buffer */
+
+  head = ( (long) cp ) & (ipack-1);
+  if ( head != 0 ) head = ipack - head;
+
+  inner = bc - head;
+
+  /* Trailing bytes which do not make a full word */
+
+  trail = inner & (ipack-1);
+
+  /* Number of bytes/words to be processed in fast loop */
+
+  inner -= trail;
+  inner /= ipack;
+
+  ip0 = up + head;
+  ip1 = ip0 + 1;
+  ip2 = ip0 + 2;
+  ip3 = ip0 + 3;
+  ip4 = ip0 + 4;
+  ip5 = ip0 + 5;
+  ip6 = ip0 + 6;
+  ip7 = ip0 + 7;
+
+  up0 = (unsigned INT64 *) (cp + head);
+
+  /* Here we should process any bytes until the first word boundary 
+   * of our destination buffer 
+   * That code is missing so far  because our output buffer is 
+   * word aligned by FORTRAN 
+   */
+
+  j = 0;
+
+  if ( IS_BIGENDIAN() )
+    {
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  upi =             (   ip0[j]          << 56 ) 
+	                 |  ( ( ip1[j] & 0xFF ) << 48 )
+	                 |  ( ( ip2[j] & 0xFF ) << 40 )
+	                 |  ( ( ip3[j] & 0xFF ) << 32 )
+	                 |  ( ( ip4[j] & 0xFF ) << 24 ) ;
+	  up0[i] = upi   |  ( ( ip5[j] & 0xFF ) << 16 )
+	                 |  ( ( ip6[j] & 0xFF ) <<  8 )
+	                 |    ( ip7[j] & 0xFF ) ;
+	  j += ipack;
+	}
+    }
+  else
+    {
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  upi =             (   ip7[j]          << 56 ) 
+	                 |  ( ( ip6[j] & 0xFF ) << 48 )
+                         |  ( ( ip5[j] & 0xFF ) << 40 )
+                         |  ( ( ip4[j] & 0xFF ) << 32 )
+                         |  ( ( ip3[j] & 0xFF ) << 24 ) ;
+	  up0[i] = upi   |  ( ( ip2[j] & 0xFF ) << 16 )
+                         |  ( ( ip1[j] & 0xFF ) <<  8 )
+                         |    ( ip0[j] & 0xFF ) ;
+	  j += ipack;
+	}
+    }
+
+  cp0 = (unsigned char *) ( up0 + inner );
+  if ( trail > 0 )
+    {
+      up0[inner] = 0;
+      for ( i = 0 ; i < trail ; i ++ )
+	{
+	  *cp0 = (unsigned char) ip0[ipack*inner+i];
+	  cp0++;
+	}
+    }
+
+  if ( tc != -1 )
+    {
+      bc++;
+      *cp0 = (unsigned char) tc;
+    }
+#endif
+  return (bc);
+}
+
+/* unpack 8-bit bytes from a packed buffer with 64-bit words */
+/* same as : for ( int i = 0; i < bc; ++i ) up[i] = (INT64) cp[i]; */
+
+long unpackInt64(unsigned char *cp, unsigned INT64 *up, long bc, long tc)
+{
+  U_BYTEORDER;
+  unsigned char *cp0;
+  unsigned INT64 *up0;
+  unsigned INT64 *ip0, *ip1, *ip2, *ip3, *ip4, *ip5, *ip6, *ip7;
+  long head, trail, inner, i, j;
+  long offset;
+  long ipack = sizeof(INT64);
+
+  /* Bytes until first word boundary in source buffer */
+
+  head = ( (long) cp ) & (ipack-1);
+  if ( head != 0 ) head = ipack - head;
+  if ( head > bc ) head = bc;
+
+  inner = bc - head;
+
+  /* Trailing bytes which do not make a full word */
+ 
+  trail = inner & (ipack-1);
+ 
+  /* Number of bytes/words to be processed in fast loop */
+
+  inner -= trail;
+  inner /= ipack;
+
+  ip0 = up + head;
+  ip1 = ip0 + 1;
+  ip2 = ip0 + 2;
+  ip3 = ip0 + 3;
+  ip4 = ip0 + 4;
+  ip5 = ip0 + 5;
+  ip6 = ip0 + 6;
+  ip7 = ip0 + 7;
+
+  up0 = (unsigned INT64 *) (cp + head);
+
+  /* Process any bytes until the first word boundary 
+   * of our source buffer 
+   */
+  for ( i = 0 ; i < head ; i++ ) up[i] = (unsigned INT64) cp[i];
+
+  j = 0;
+
+  if ( IS_BIGENDIAN() )
+    {
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  ip0[j] = (up0[i] >> 56) & 0xFF;
+	  ip1[j] = (up0[i] >> 48) & 0xFF;
+	  ip2[j] = (up0[i] >> 40) & 0xFF;
+	  ip3[j] = (up0[i] >> 32) & 0xFF;
+	  ip4[j] = (up0[i] >> 24) & 0xFF;
+	  ip5[j] = (up0[i] >> 16) & 0xFF;
+	  ip6[j] = (up0[i] >>  8) & 0xFF;
+	  ip7[j] = (up0[i])       & 0xFF;
+
+	  j += ipack;
+	}
+    }
+  else
+    {
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  ip7[j] = (up0[i] >> 56) & 0xFF;
+	  ip6[j] = (up0[i] >> 48) & 0xFF;
+	  ip5[j] = (up0[i] >> 40) & 0xFF;
+	  ip4[j] = (up0[i] >> 32) & 0xFF;
+	  ip3[j] = (up0[i] >> 24) & 0xFF;
+	  ip2[j] = (up0[i] >> 16) & 0xFF;
+	  ip1[j] = (up0[i] >>  8) & 0xFF;
+	  ip0[j] = (up0[i])       & 0xFF;
+
+	  j += ipack;
+	}
+    }
+
+  if ( trail > 0 )
+    {
+      offset = head + ipack*inner;
+      cp0 = cp + offset;
+      for ( i = 0 ; i < trail ; i++ ) up[i+offset] = (unsigned INT64) cp0[i];
+    }
+  /*
+  if ( tc != -1 ) {
+    bc++;
+    *cp0 = (unsigned char) tc;
+  }
+  */
+  return (bc);
+}
+
+/* pack 8-bit bytes from 32-bit words to a packed buffer */
+/* same as : for ( int i = 0; i < bc; ++i ) cp[i] = (char) up[i]; */
+
+#if  defined  (INT32)
+long packInt32(unsigned INT32 *up, unsigned char *cp, long bc, long tc)
+{
+  U_BYTEORDER;
+  unsigned char *cp0;
+  unsigned INT32 *up0, *ip0, *ip1, *ip2, *ip3;
+  long head, trail, inner, i, j;
+  long ipack = sizeof(INT32);
+  
+  /* Bytes until first word boundary in destination buffer */
+
+  head = ( (long) cp ) & (ipack-1);
+  if ( head != 0 ) head = ipack - head;
+
+  inner = bc - head;
+
+  /* Trailing bytes which do not make a full word */
+
+  trail = inner & (ipack-1);
+
+  /* Number of bytes/words to be processed in fast loop */
+
+  inner -= trail;
+  inner /= ipack;
+
+  ip0 = up + head;
+  ip1 = ip0 + 1;
+  ip2 = ip0 + 2;
+  ip3 = ip0 + 3;
+
+  up0 = (unsigned INT32 *) (cp + head);
+
+  /* Here we should process any bytes until the first word boundary 
+   * of our destination buffer 
+   * That code is missing so far  because our output buffer is 
+   * word aligned by FORTRAN 
+   */
+
+  j = 0;
+
+  if ( IS_BIGENDIAN() )
+    {
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  up0[i] =          (   ip0[j]          << 24 ) 
+	                 |  ( ( ip1[j] & 0xFF ) << 16 )
+	                 |  ( ( ip2[j] & 0xFF ) <<  8 )
+	                 |    ( ip3[j] & 0xFF ) ;
+	  j += ipack;
+	}
+    }
+  else
+    {
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  up0[i] =          (   ip3[j]          << 24 ) 
+	                 |  ( ( ip2[j] & 0xFF ) << 16 )
+                         |  ( ( ip1[j] & 0xFF ) <<  8 )
+                         |    ( ip0[j] & 0xFF ) ;
+	  j += ipack;
+	}
+    }
+
+  cp0 = (unsigned char *) ( up0 + inner );
+  if ( trail > 0 )
+    {
+      up0[inner] = 0;
+      for ( i = 0 ; i < trail ; i ++ )
+	{
+	  *cp0 = (unsigned char) ip0[ipack*inner+i];
+	  cp0++;
+	}
+    }
+
+  if ( tc != -1 )
+    {
+      bc++;
+      *cp0 = (unsigned char) tc;
+    }
+
+  return (bc);
+}
+#endif
+
+/* unpack 8-bit bytes from a packed buffer with 32-bit words */
+/* same as : for ( int i = 0; i < bc; ++i ) up[i] = (INT32) cp[i]; */
+
+#if  defined  (INT32)
+long unpackInt32(unsigned char *cp, unsigned INT32 *up, long bc, long tc)
+{
+  U_BYTEORDER;
+  unsigned char *cp0;
+  unsigned INT32 *up0;
+  unsigned INT32 *ip0, *ip1, *ip2, *ip3;
+  long head, trail, inner, i, j;
+  long offset;
+  long ipack = sizeof(INT32);
+
+  /* Bytes until first word boundary in source buffer */
+
+  head = ( (long) cp ) & (ipack-1);
+  if ( head != 0 ) head = ipack - head;
+  if ( head > bc ) head = bc;
+
+  inner = bc - head;
+
+  /* Trailing bytes which do not make a full word */
+ 
+  trail = inner & (ipack-1);
+ 
+  /* Number of bytes/words to be processed in fast loop */
+
+  inner -= trail;
+  inner /= ipack;
+
+  ip0 = up + head;
+  ip1 = ip0 + 1;
+  ip2 = ip0 + 2;
+  ip3 = ip0 + 3;
+
+  up0 = (unsigned INT32 *) (cp + head);
+
+  /* Process any bytes until the first word boundary 
+   * of our source buffer 
+   */
+  for ( i = 0 ; i < head ; i++ ) up[i] = (unsigned INT32) cp[i];
+
+  j = 0;
+
+  if ( IS_BIGENDIAN() )
+    {
+#if defined (CRAY)
+#pragma _CRI ivdep
+#endif
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#ifdef __uxpch__
+#pragma loop novrec
+#endif
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  ip0[j] = (up0[i] >> 24) & 0xFF;
+	  ip1[j] = (up0[i] >> 16) & 0xFF;
+	  ip2[j] = (up0[i] >>  8) & 0xFF;
+	  ip3[j] = (up0[i])       & 0xFF;
+
+	  j += ipack;
+	}
+    }
+  else
+    {
+      for ( i = 0 ; i < inner ; i++ )
+	{
+	  ip3[j] = (up0[i] >> 24) & 0xFF;
+	  ip2[j] = (up0[i] >> 16) & 0xFF;
+	  ip1[j] = (up0[i] >>  8) & 0xFF;
+	  ip0[j] = (up0[i])       & 0xFF;
+
+	  j += ipack;
+	}
+    }
+
+  if ( trail > 0 )
+    {
+      offset = head + ipack*inner;
+      cp0 = cp + offset;
+      for ( i = 0 ; i < trail ; i++ ) up[i+offset] = (unsigned INT32) cp0[i];
+    }
+  /*
+  if ( tc != -1 ) {
+    bc++;
+    *cp0 = (unsigned char) tc;
+  }
+  */
+
+  return (bc);
+}
+#endif
+#include <stdio.h>
+
+void prtbin(int kin, int knbit, int *kout, int *kerr)
+{
+  /*
+
+    Produces a decimal number with ones and zeroes
+    corresponding to the ones and zeroes of the input
+    binary number.
+    eg input number 1011 binary, output number 1011 decimal.
+
+
+    Input Parameters:
+    
+       kin   - Integer variable containing binary number.
+
+       knbit - Number of bits in binary number.
+
+    Output Parameters:
+
+       kout  - Integer variable containing decimal value
+               with ones and zeroes corresponding to those of
+	       the input binary number.
+
+       kerr  - 0, If no error.
+               1, Number of bits in binary number exceeds
+	          maximum allowed or is less than 1.
+
+
+    Converted from EMOS routine PRTBIN.
+
+       Uwe Schulzweida   MPIfM   01/04/2001
+
+  */
+  int idec;
+  int ik;
+  int itemp;
+  int j;
+
+  /*
+    Check length of binary number to ensure decimal number
+    generated will fit in the computer word - in this case will
+    it fit in a Cray 48 bit integer?
+  */
+  if ( knbit < 1 || knbit > 14 )
+    {
+      *kerr = 1;
+      printf(" prtbin : Error in binary number length - %3d bits.\n", knbit);
+      return;
+    }
+  else
+    *kerr = 0;
+  /*
+    -----------------------------------------------------------------
+    Section 1. Generate required number.
+    -----------------------------------------------------------------
+  */
+  *kout = 0;
+  ik    = kin;
+  idec  = 1;
+
+  for ( j = 0; j < knbit; j++ )
+    {
+      itemp = ik - ( (ik/2)*2 );
+      *kout = (*kout) + itemp * idec;
+      ik    = ik / 2;
+      idec  = idec * 10;
+    }
+
+  return;
+}
+
+
+void ref2ibm(double *pref, int kbits)
+{
+  /*
+
+    Purpose:
+    --------
+
+    Code and check reference value in IBM format
+
+    Input Parameters:
+    -----------------
+
+    pref       - Reference value
+    kbits      - Number of bits per computer word.
+
+    Output Parameters:
+    ------------------
+
+    pref       - Reference value
+
+    Method:
+    -------
+
+    Codes in IBM format, then decides to ensure that reference 
+    value used for packing is not different from that stored
+    because of packing differences.
+
+    Externals.
+    ----------
+
+    confp3    - Encode into IBM floating point format.
+    decfp2    - Decode from IBM floating point format.
+
+    Reference:
+    ----------
+
+    None.
+
+    Comments:
+    --------
+
+    None.
+
+    Author:
+    -------
+
+    J.D.Chambers     ECMWF      17:05:94
+
+    Modifications:
+    --------------
+
+    Uwe Schulzweida   MPIfM   01/04/2001
+
+    Convert to C from EMOS library version 130
+
+  */
+
+  static int itrnd;
+  static int kexp, kmant;
+  static double ztemp, zdumm;
+  extern int CGRIBEX_Debug;
+
+  /* ----------------------------------------------------------------- */
+  /*   Section 1. Convert to and from IBM format.                      */
+  /* ----------------------------------------------------------------- */
+
+  /*  Convert floating point reference value to IBM representation. */
+
+  itrnd = 1;
+  zdumm = ztemp = *pref;
+  confp3(zdumm, &kexp, &kmant, kbits, itrnd);
+
+  if ( kexp == 0 && kmant == 0 ) return;
+
+  /*  Set reference value to that actually stored in the GRIB code. */
+
+  *pref = decfp2(kexp, kmant);
+
+  /*  If the nearest number which can be represented in */
+  /*  GRIB format is greater than the reference value,  */
+  /*  find the nearest number in GRIB format lower      */
+  /*  than the reference value.                         */
+
+  if ( ztemp < *pref )
+    {
+      /*  Convert floating point to GRIB representation */
+      /*  using truncation to ensure that the converted */
+      /*  number is smaller than the original one.      */
+
+      itrnd = 0;
+      zdumm = *pref = ztemp;
+      confp3(zdumm, &kexp, &kmant, kbits, itrnd);
+
+      /*  Set reference value to that stored in the GRIB code. */
+
+      *pref = decfp2(kexp, kmant);
+
+      if ( ztemp < *pref )
+	{
+	  if ( CGRIBEX_Debug )
+	    {
+	      Message("Reference value error.");
+	      Message("Notify Met.Applications Section.");
+	      Message("ZTEMP = ", ztemp);
+	      Message("PREF = ", pref);
+	    }
+	  *pref = ztemp;
+	}
+    }
+
+  return;
+} /* ref2ibm */
+#include <string.h>
+
+
+int correct_bdslen(int bdslen, long recsize, long gribpos)
+{
+  /*
+    If a very large product, the section 4 length field holds
+    the number of bytes in the product after section 4 upto
+    the end of the padding bytes.
+    This is a fixup to get round the restriction on product lengths
+    due to the count being only 24 bits. It is only possible because
+    the (default) rounding for GRIB products is 120 bytes.
+  */
+  if ( recsize > JP23SET ) bdslen = recsize - gribpos - bdslen;
+  return (bdslen);
+}
+
+
+int grib1Sections(unsigned char *gribbuffer, long bufsize, unsigned char **pdsp,
+		  unsigned char **gdsp, unsigned char **bmsp, unsigned char **bdsp)
+{
+  unsigned char *pds, *gds, *bms, *bds;
+  unsigned char *bufpointer, *is, *section;
+  int gribversion, grib1offset;
+  long gribsize = 0, recsize;
+  int bdslen;
+
+  section = gribbuffer;
+  is = gribbuffer;
+  if ( ! GRIB_START(section) )
+    {
+      fprintf(stderr, "Wrong indicator section >%c%c%c%c<\n",
+	      section[0], section[1], section[2], section[3]);
+      return (-1);
+    }
+
+  recsize = gribrec_len(section[4], section[5], section[6]);
+
+  gribversion = GRIB_EDITION(section);
+  if ( GRIB1_SECLEN(section) == 24 && gribversion == 0 ) gribversion = 0;
+
+  if ( gribversion == 1 )
+    grib1offset = 4;
+  else
+    grib1offset = 0;
+
+  pds = is + 4 + grib1offset;
+  bufpointer = pds + PDS_Len;
+  gribsize += 4 + grib1offset + PDS_Len;
+
+  if ( PDS_HAS_GDS )
+    {
+      gds = bufpointer;
+      bufpointer += GDS_Len;
+      gribsize += GDS_Len;
+    }
+  else
+    {
+      gds = NULL;
+    }
+
+  if ( PDS_HAS_BMS )
+    {
+      bms = bufpointer;
+      bufpointer += BMS_Len;
+      gribsize += BMS_Len;
+    }
+  else
+    {
+      bms = NULL;
+    }
+
+  bds = bufpointer;
+  bdslen = BDS_Len;
+  bdslen = correct_bdslen(bdslen, recsize, gribsize);
+  bufpointer += bdslen;
+  gribsize += bdslen;
+  gribsize += 4;
+
+  if ( gribsize > bufsize )
+    {
+      fprintf(stderr, "GRIB buffer size %ld too small! Min size = %ld\n", bufsize, gribsize);
+      return (1);
+    }
+
+  *pdsp = pds;
+  *gdsp = gds;
+  *bmsp = bms;
+  *bdsp = bds;
+
+  /* end section - "7777" in ascii */
+  if ( !GRIB_FIN(bufpointer) )
+    {
+      fprintf(stderr, "Missing end section >%2x %2x %2x %2x<\n",
+	      bufpointer[0], bufpointer[1], bufpointer[2], bufpointer[3]);
+    }
+
+  return (0);
+}
+
+
+int grib2Sections(unsigned char *gribbuffer, long bufsize, unsigned char **idsp,
+		  unsigned char **lusp, unsigned char **gdsp, unsigned char **pdsp,
+		  unsigned char **drsp, unsigned char **bmsp, unsigned char **bdsp)
+{
+  unsigned char *section;
+  long sec_len;
+  int sec_num;
+  int gribversion;
+  int i, msec;
+  long gribsize;
+  long grib_len = 0;
+
+  *idsp = NULL;
+  *lusp = NULL;
+  *gdsp = NULL;
+  *pdsp = NULL;
+  *drsp = NULL;
+  *bmsp = NULL;
+  *bdsp = NULL;
+
+  section = gribbuffer;
+  sec_len = 16;
+
+  if ( !GRIB_START(section) )
+    {
+      fprintf(stderr, "wrong indicator section >%c%c%c%c<\n",
+	      section[0], section[1], section[2], section[3]);
+      return (-1);
+    }
+
+  gribversion = GRIB_EDITION(section);
+  if ( gribversion != 2 )
+    {
+      fprintf(stderr, "wrong GRIB version %d\n", gribversion);
+      return (-1);      
+    }
+
+  gribsize = 0;
+  for ( i = 0; i < 8; i++ ) gribsize = (gribsize << 8) | section[8+i];
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 1 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "ids %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num != 1 )
+    {
+      fprintf(stderr, "Unexpected section1 number %d\n", sec_num);
+      return (-1);
+    }
+
+  *idsp = section;
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 2 and 3 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "lus %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num == 2 )
+    {
+      *lusp = section;
+
+      grib_len += sec_len;
+      section  += sec_len;
+
+      /* section 3 */
+      sec_len = GRIB2_SECLEN(section);
+      sec_num = GRIB2_SECNUM(section);
+      //fprintf(stderr, "gds %d %ld\n", sec_num, sec_len);
+
+      *gdsp = section;
+    }
+  else if ( sec_num == 3 )
+    {
+      *gdsp = section;
+    }
+  else
+    {
+      fprintf(stderr, "Unexpected section3 number %d\n", sec_num);
+      return (-1);
+    }
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 4 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "pds %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num != 4 )
+    {
+      fprintf(stderr, "Unexpected section4 number %d\n", sec_num);
+      return (-1);
+    }
+
+  *pdsp = section;
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 5 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "drs %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num != 5 )
+    {
+      fprintf(stderr, "Unexpected section5 number %d\n", sec_num);
+      return (-1);
+    }
+
+  *drsp = section;
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 6 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "bms %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num != 6 )
+    {
+      fprintf(stderr, "Unexpected section6 number %d\n", sec_num);
+      return (-1);
+    }
+
+  *bmsp = section;
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* section 7 */
+  sec_len = GRIB2_SECLEN(section);
+  sec_num = GRIB2_SECNUM(section);
+  //fprintf(stderr, "bds %d %ld\n", sec_num, sec_len);
+
+  if ( sec_num != 7 )
+    {
+      fprintf(stderr, "Unexpected section7 number %d\n", sec_num);
+      return (-1);
+    }
+
+  *bdsp = section;
+
+  grib_len += sec_len;
+  section  += sec_len;
+
+  /* skip multi GRIB sections */
+  msec = 1;
+  while ( !GRIB_FIN(section) )
+    {
+      sec_len = GRIB2_SECLEN(section);
+      sec_num = GRIB2_SECNUM(section);
+
+      if ( sec_num < 1 || sec_num > 7 ) break;
+
+      if ( sec_num == 7 )
+	fprintf(stderr, "Skipped unsupported multi GRIB section %d!\n", ++msec);
+
+      if ( (grib_len + sec_len) > gribsize ) break;
+
+      grib_len += sec_len;
+      section  += sec_len;
+    }
+
+  /* end section - "7777" in ASCII */
+  if ( !GRIB_FIN(section) )
+    {
+      fprintf(stderr, "Missing end section >%2x %2x %2x %2x<\n",
+	      section[0], section[1], section[2], section[3]);
+    }
+
+  return (0);
+}
+
+
+int gribGinfo(long recpos, long recsize, unsigned char *gribbuffer,
+	      int *intnum, float *fltnum)
+{
+  unsigned char *pds, *gds, *bms, *bds;
+  unsigned char *bufpointer, *is, *section;
+  int gribversion, grib1offset;
+  long gribsize = 0;
+  int dpos, bpos = 0;
+  int bdslen;
+  float bsf;
+
+  section = gribbuffer;
+  is = gribbuffer;
+  if ( ! GRIB_START(section) )
+    {
+      fprintf(stderr, "wrong indicator section >%c%c%c%c<\n",
+	      section[0], section[1], section[2], section[3]);
+      return (-1);
+    }
+
+  gribversion = GRIB_EDITION(section);
+  if ( GRIB1_SECLEN(section) == 24 && gribversion == 0 ) gribversion = 0;
+
+  if ( gribversion == 1 )
+    grib1offset = 4;
+  else
+    grib1offset = 0;
+
+  pds = is + 4 + grib1offset;
+  bufpointer = pds + PDS_Len;
+  gribsize += 4 + grib1offset + PDS_Len;
+
+  if ( PDS_HAS_GDS )
+    {
+      gds = bufpointer;
+      bufpointer += GDS_Len;
+      gribsize += GDS_Len;
+    }
+  else
+    {
+      gds = NULL;
+    }
+
+  if ( PDS_HAS_BMS )
+    {
+      bms = bufpointer;
+      bufpointer += BMS_Len;
+
+      bpos = recpos + gribsize + 6;
+
+      gribsize += BMS_Len;
+    }
+  else
+    {
+      bms = NULL;
+    }
+
+  bds = bufpointer;
+
+  dpos = recpos + gribsize + 11;
+
+  bdslen = BDS_Len;
+  bdslen = correct_bdslen(bdslen, recsize, bds-gribbuffer);
+  bufpointer += bdslen;
+  gribsize += bdslen;
+  gribsize += 4;
+
+  if ( gribsize > recsize )
+    {
+      fprintf(stderr, "GRIB buffer size %ld too small! Min size = %ld\n", recsize, gribsize);
+      return (1);
+    }
+
+  /* end section - "7777" in ascii */
+  if ( !GRIB_FIN(bufpointer) )
+    {
+      fprintf(stderr, "Missing end section >%2x %2x %2x %2x<\n",
+	      bufpointer[0], bufpointer[1], bufpointer[2], bufpointer[3]);
+    }
+
+  bsf = BDS_BinScale;
+  if ( bsf > 32767 ) bsf = 32768-bsf;
+  bsf = pow(2.0,(double)bsf);
+
+  intnum[0] = dpos;
+  if ( bms ) intnum[1] = bpos;
+  else       intnum[1] = -999;
+  intnum[2] = BDS_NumBits;
+
+  /*  fltnum[0] = 1.0; */
+  fltnum[0] = pow(10.0, (double)PDS_DecimalScale);
+  fltnum[1] = bsf;
+  fltnum[2] = BDS_RefValue;
+  /*
+  printf("intnum %d %d %d\n", intnum[0], intnum[1], intnum[2]);
+  printf("fltnum %g %g %g\n", fltnum[0], fltnum[1], fltnum[2]);
+  */
+  return (0);
+}
+
+
+void grib1PrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  int GridType, level, nerr;
+  unsigned char *is = NULL, *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  double cr = 1;
+  int bdslen;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : Off Position   Size : V PDS  GDS    BMS    BDS : Code Level :  LType GType: CR\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  is = gribbuffer;
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d :%4ld %8ld %6ld : error\n", nrec, offset, recpos, recsize);
+      return;
+    }
+
+  if ( gds == NULL )
+    GridType = -1;
+  else
+    GridType = GDS_GridType;
+
+  if ( PDS_LevelType == 100 )
+    level = PDS_Level * 100;
+  else if ( PDS_LevelType == 99 )
+    level = PDS_Level;
+  else if ( PDS_LevelType == 109 )
+    level = PDS_Level;
+  else
+    level = PDS_Level1;
+
+  bdslen = BDS_Len;
+  bdslen = correct_bdslen(bdslen, recsize, bds-gribbuffer);
+
+  if ( (BDS_Flag >> 4)&1 && BDS_Z == 128 )
+    {
+      int s1, s2;
+      s1 = gribrec_len(bds[14], bds[15], bds[16]);
+      s2 = gribrec_len(gribbuffer[4], gribbuffer[5], gribbuffer[6]);
+      cr = ((double)s1)/s2;
+    }
+
+  fprintf(stdout, "%5d :%4ld %8ld %6ld :%2d%4d%5d%7d%7d : %3d%7d : %5d %5d %6.4g\n",
+	  nrec, offset, recpos, recsize, GRIB_EDITION(is),
+	  PDS_Len, GDS_Len, BMS_Len, bdslen,
+	  PDS_Parameter, level, PDS_LevelType, GridType, cr);
+}
+
+
+void grib2PrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  int nerr;
+  unsigned char *is  = NULL, *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  unsigned char *ids = NULL, *lus = NULL, *drs = NULL;
+  long ids_len = 0, lus_len = 0, gds_len = 0, pds_len = 0, drs_len = 0, bms_len = 0, bds_len = 0;
+  int gridtype, paramnum, level1type /*, level2type*/;
+  int level1 /*, level1sf*/;
+  /* int level2, level2sf; */
+  double cr = 1;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : Off Position   Size : V IDS LUS GDS PDS  DRS    BMS    BDS : Code Level :  LType GType: CR\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  is = gribbuffer;
+
+  nerr = grib2Sections(gribbuffer, recsize, &ids, &lus, &gds, &pds, &drs, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d :%4ld %8ld %6ld : error\n", nrec, offset, recpos, recsize);
+      return;
+    }
+
+  if ( ids ) ids_len = GRIB2_SECLEN(ids);
+  if ( lus ) lus_len = GRIB2_SECLEN(lus);
+  if ( gds ) gds_len = GRIB2_SECLEN(gds);
+  if ( pds ) pds_len = GRIB2_SECLEN(pds);
+  if ( drs ) drs_len = GRIB2_SECLEN(drs);
+  if ( bms ) bms_len = GRIB2_SECLEN(bms);
+  if ( bds ) bds_len = GRIB2_SECLEN(bds);
+
+  /*
+  if ( (BDS_Flag >> 4)&1 && BDS_Z == 128 )
+    {
+      int s1, s2;
+      s1 = ((int) ((bds[14]<<16)+(bds[15]<<8)+bds[16]));
+      s2 = ((int) ((gribbuffer[4]<<16)+(gribbuffer[5]<<8)+gribbuffer[6]));
+      cr = ((double)s1)/s2;
+    }
+  */
+  gridtype   = GET_UINT2(gds[12],gds[13]);
+  paramnum   = GET_UINT1(pds[10]);
+  level1type = GET_UINT1(pds[22]);
+  /* level1sf   = GET_UINT1(pds[23]); */
+  level1     = GET_UINT4(pds[24],pds[25],pds[26],pds[27]);
+  /* level2type = GET_UINT1(pds[28]); */
+  /* level2sf   = GET_UINT1(pds[29]); */
+  /* level2     = GET_UINT4(pds[30],pds[31],pds[32],pds[33]); */
+  /*
+  printf("level %d %d %d %d %d %d %d\n", level1type, level1sf, level1, level1*level1sf, level2sf, level2, level2*level2sf);
+  */
+  fprintf(stdout, "%5d :%4ld %8ld %6ld :%2d %3ld %3ld %3ld %3ld %4ld %6ld %6ld : %3d%7d : %5d %5d %6.4g\n",
+	  nrec, offset, recpos, recsize, GRIB_EDITION(is),
+	  ids_len, lus_len, gds_len, pds_len, drs_len, bms_len, bds_len,
+	  paramnum, level1, level1type, gridtype, cr);
+}
+
+
+void gribPrintALL(int nrec, long offset, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 0 || gribversion == 1 )
+    grib1PrintALL(nrec, offset, recpos, recsize, gribbuffer);
+  else if ( gribversion == 2 )
+    grib2PrintALL(nrec, offset, recpos, recsize, gribbuffer);
+  else
+    {
+      fprintf(stdout, "%5d :%4ld%9ld%7ld : GRIB version %d unsupported\n",
+	      nrec, offset, recpos, recsize, gribversion); 
+    }
+}
+
+
+void grib1PrintPDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  unsigned char *is = NULL, *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  int century, subcenter, decimalscale, nerr;
+  int fc_num = 0;
+  int year = 0, date;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : PDS Tab Cen Sub Ver Grid Code LTyp Level1 Level2    Date  Time P1 P2 TU TR NAVE Scale FCnum CT\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  is = gribbuffer;
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  switch(GRIB_EDITION(is))
+    {   
+    case 0:
+      year                = GET_UINT1(pds[12]);
+      century             = 1;
+      subcenter           = 0;
+      decimalscale        = 0;
+      break;
+    case 1:
+      year                = PDS_Year;
+      century             = PDS_Century;
+      subcenter           = PDS_Subcenter;
+      decimalscale        = PDS_DecimalScale;
+      break;
+    default:
+      fprintf(stderr, "Grib version %d not supported!", GRIB_EDITION(is));
+      exit(EXIT_FAILURE);
+    }
+
+  if ( PDS_Len > 28 )
+    if ( PDS_CenterID    == 98 || PDS_Subcenter == 98 ||
+	(PDS_CenterID    ==  7 && PDS_Subcenter == 98) )
+      if ( pds[40] == 1 )
+	fc_num = GET_UINT1(pds[49]);
+
+  if ( year < 0 )
+    {
+      date = (-year)*10000+PDS_Month*100+PDS_Day;
+      century = -century;
+    }
+  else
+    {
+      date =    year*10000+PDS_Month*100+PDS_Day;
+    }
+      
+  fprintf(stdout, "%5d :%4d%4d%4d%4d%4d %4d %4d%4d%7d%7d %8d%6d%3d%3d%3d%3d%5d%6d%5d%4d\n", nrec,
+	  PDS_Len,  PDS_CodeTable,   PDS_CenterID, subcenter, PDS_ModelID,
+	  PDS_GridDefinition, PDS_Parameter, PDS_LevelType, PDS_Level1, PDS_Level2,
+	  date, PDS_Time, PDS_TimePeriod1, PDS_TimePeriod2, PDS_TimeUnit, PDS_TimeRange,
+	  PDS_AvgNum, decimalscale, fc_num, century);
+}
+
+
+void gribPrintPDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 0 || gribversion == 1 )
+    grib1PrintPDS(nrec, recpos, recsize, gribbuffer);
+  /*
+  else if ( gribversion == 2 )
+    grib2PrintPDS(nrec, recpos, recsize, gribbuffer);
+  */
+  else
+    {
+      fprintf(stdout, "%5d :%4ld%9ld%7ld : GRIB version %d unsupported\n",
+	      nrec, 0L, recpos, recsize, gribversion); 
+    }
+}
+
+
+void grib1PrintGDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  int nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : GDS  NV PVPL Typ : xsize ysize   Lat1   Lon1   Lat2   Lon2    dx    dy\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  if ( gds )
+    fprintf(stdout, "%5d :%4d%4d%4d %4d :%6d%6d%7d%7d%7d%7d%6d%6d\n", nrec,
+	    GDS_Len,  GDS_NV,   GDS_PVPL, GDS_GridType,
+	    GDS_NumLon,   GDS_NumLat,
+	    GDS_FirstLat, GDS_FirstLon,
+	    GDS_LastLat,  GDS_LastLon,
+	    GDS_LonIncr,  GDS_LatIncr);
+  else
+    fprintf(stdout, "%5d : Grid Description Section not defined\n", nrec);
+}
+
+
+void gribPrintGDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 0 || gribversion == 1 )
+    grib1PrintGDS(nrec, recpos, recsize, gribbuffer);
+  /*
+  else if ( gribversion == 2 )
+    grib2PrintGDS(nrec, recpos, recsize, gribbuffer);
+  */
+  else
+    {
+      fprintf(stdout, "%5d :%4ld%9ld%7ld : GRIB version %d unsupported\n",
+	      nrec, 0L, recpos, recsize, gribversion); 
+    }
+}
+
+
+void grib1PrintBMS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  int level, nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : Code Level     BMS    Size\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  if ( PDS_LevelType == 100 )
+    level = PDS_Level * 100;
+  else if ( PDS_LevelType == 99 )
+    level = PDS_Level;
+  else
+    level = PDS_Level1;
+
+  if ( bms )
+    fprintf(stdout, "%5d :%4d%7d %7d %7d\n", nrec,
+	    PDS_Parameter, level,
+	    BMS_Len, BMS_BitmapSize);
+  else
+    fprintf(stdout, "%5d :%4d%7d Bit Map Section not defined\n", nrec,
+	    PDS_Parameter, level);
+}
+
+
+void gribPrintBMS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 0 || gribversion == 1 )
+    grib1PrintBMS(nrec, recpos, recsize, gribbuffer);
+  /*
+  else if ( gribversion == 2 )
+    grib2PrintBMS(nrec, recpos, recsize, gribbuffer);
+  */
+  else
+    {
+      fprintf(stdout, "%5d :%4ld%9ld%7ld : GRIB version %d unsupported\n",
+	      nrec, 0L, recpos, recsize, gribversion); 
+    }
+}
+
+
+void grib1PrintBDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  static int header = 1;
+  int level, nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  double cr = 1;
+  double refval, scale;
+
+  if ( header )
+    {
+      fprintf(stdout, 
+      "  Rec : Code Level     BDS Flag     Scale   RefValue Bits  CR\n");
+/*     ----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+ */
+      header = 0;
+    }
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  if ( PDS_LevelType == 100 )
+    level = PDS_Level * 100;
+  else if ( PDS_LevelType == 99 )
+    level = PDS_Level;
+  else
+    level = PDS_Level1;
+
+  if ( (BDS_Flag >> 4)&1 && BDS_Z == 128 )
+    {
+      int s1, s2;
+      s1 = ((int) ((bds[17]<<16)+(bds[18]<<8)+bds[19]));
+      s2 = ((int) ((bds[20]<<16)+(bds[21]<<8)+bds[22]));
+      cr = ((double)s1)/s2;
+    }
+
+  refval = BDS_RefValue;
+
+  if ( BDS_BinScale < 0 )
+    scale = 1.0/pow(2.0, (double) -BDS_BinScale);
+  else
+    scale = pow(2.0, (double) BDS_BinScale);
+
+  if ( PDS_DecimalScale )
+    {
+      double decscale;
+      decscale = pow(10.0, (double)-PDS_DecimalScale);
+      refval *= decscale;
+      scale  *= decscale;
+    }
+
+  fprintf(stdout, "%5d :%4d%7d %7d %4d %8.5g %11.5g%4d %6.4g\n", nrec,
+	  PDS_Parameter, level,
+	  BDS_Len, BDS_Flag, scale, refval, BDS_NumBits, cr);
+}
+
+
+void gribPrintBDS(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 0 || gribversion == 1 )
+    grib1PrintBDS(nrec, recpos, recsize, gribbuffer);
+  /*
+  else if ( gribversion == 2 )
+    grib2PrintBDS(nrec, recpos, recsize, gribbuffer);
+  */
+  else
+    {
+      fprintf(stdout, "%5d :%4ld%9ld%7ld : GRIB version %d unsupported\n",
+	      nrec, 0L, recpos, recsize, gribversion); 
+    }
+}
+
+
+void gribCheck1(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int level, nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  double cr = 1;
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  if ( PDS_LevelType == 100 )
+    level = PDS_Level * 100;
+  else if ( PDS_LevelType == 99 )
+    level = PDS_Level;
+  else
+    level = PDS_Level1;
+
+  if ( (BDS_Flag >> 4)&1 && BDS_Z == 128 )
+    {
+      int s1, s2;
+      s1 = ((int) ((bds[17]<<16)+(bds[18]<<8)+bds[19]));
+      s2 = ((int) ((bds[20]<<16)+(bds[21]<<8)+bds[22]));
+      cr = ((double)s1)/s2;
+    }
+
+  if ( cr == 1 && BDS_NumBits == 24 )
+    {
+      fprintf(stdout, "GRIB record %5d : code = %4d   level = %7d\n", nrec, PDS_Parameter, level);
+    }
+}
+
+
+static
+void repair1(unsigned char *gbuf, long gbufsize)
+{
+  long i;
+  int nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  /* int recLen; */
+  unsigned char *source;
+  size_t sourceLen;
+  int bds_len, bds_nbits, bds_flag, lspherc, lcomplex /*, lcompress */;
+  int bds_head = 11;
+  int bds_ext = 0, bds_ubits;
+  int datstart = 0;
+  /* int llarge = FALSE; */
+
+  nerr = grib1Sections(gbuf, gbufsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "grib1Sections error\n");
+    }
+
+  /* recLen = gribrec_len(gbuf[4], gbuf[5], gbuf[6]); */
+  /* if ( recLen > JP23SET ) llarge = TRUE; */
+
+  bds_len   = BDS_Len;
+  bds_nbits = BDS_NumBits;
+  bds_flag  = BDS_Flag;
+  bds_ubits = bds_flag & 15;
+  lspherc   =  bds_flag >> 7;
+  lcomplex  = (bds_flag >> 6)&1;
+  /* lcompress = (bds_flag >> 4)&1; */
+
+  if ( lspherc )
+    {
+      if ( lcomplex  )
+	{
+	  int jup, ioff;
+	  jup  = bds[15];
+	  ioff = (jup+1)*(jup+2);
+	  bds_ext = 4 + 3 + 4*ioff;
+	}
+      else
+	{
+	  bds_ext = 4;
+	}
+    }
+
+  datstart = bds_head + bds_ext;
+
+  source = bds + datstart;
+
+  sourceLen = ((((bds_len - datstart)*8-bds_ubits)/bds_nbits)*bds_nbits)/8;
+
+  if ( bds_nbits == 24 )
+    {
+      long nelem;
+      unsigned char *pbuf;
+      nelem = sourceLen/3;
+      pbuf = (unsigned char *) malloc(sourceLen);
+      for ( i = 0; i < nelem; i++ )
+	{
+	  pbuf[3*i  ] = source[        i];
+	  pbuf[3*i+1] = source[  nelem+i];
+	  pbuf[3*i+2] = source[2*nelem+i];
+	}
+      memcpy(source, pbuf, sourceLen);
+      free(pbuf);
+    }
+}
+
+
+void gribRepair1(int nrec, long recpos, long recsize, unsigned char *gribbuffer)
+{
+  int level, nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  double cr = 1;
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "%5d : error\n", nrec);
+      return;
+    }
+
+  if ( PDS_LevelType == 100 )
+    level = PDS_Level * 100;
+  else if ( PDS_LevelType == 99 )
+    level = PDS_Level;
+  else
+    level = PDS_Level1;
+
+  if ( (BDS_Flag >> 4)&1 && BDS_Z == 128 )
+    {
+      int s1, s2;
+      s1 = ((int) ((bds[17]<<16)+(bds[18]<<8)+bds[19]));
+      s2 = ((int) ((bds[20]<<16)+(bds[21]<<8)+bds[22]));
+      cr = ((double)s1)/s2;
+    }
+
+  if ( cr == 1 && BDS_NumBits == 24 )
+    {
+      fprintf(stdout, "Repair GRIB record %5d : code = %4d   level = %7d\n", nrec, PDS_Parameter, level);
+      repair1(gribbuffer, recsize);
+    }
+}
+#include <stdio.h>
+#include <string.h>
+
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if  defined  (HAVE_LIBSZ)
+#if defined(__cplusplus)
+extern "C" {
+#endif
+#  include <szlib.h>
+#if defined (__cplusplus)
+}
+#endif
+
+#  define OPTIONS_MASK        (SZ_RAW_OPTION_MASK | SZ_MSB_OPTION_MASK | SZ_NN_OPTION_MASK)
+#  define PIXELS_PER_BLOCK    (8)
+#  define PIXELS_PER_SCANLINE (PIXELS_PER_BLOCK*128)
+
+#  define MIN_COMPRESS        (0.95)
+#  define MIN_SIZE            (256)
+#endif
+
+
+int gribGetZip(long recsize, unsigned char *gribbuffer, long *urecsize)
+{
+  /* urecsize : uncompressed record size  */
+  int compress = 0;
+  int nerr;
+  /* int  bds_len, bds_nbits, lspherc, lcomplex; */
+  int bds_flag, lcompress;
+  long gribsize = 0;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  int gribversion;
+
+  gribversion = gribVersion(gribbuffer, recsize);
+
+  if ( gribversion == 2 ) return (compress);
+
+  nerr = grib1Sections(gribbuffer, recsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "grib1Sections error\n");
+      return (compress);
+    }
+
+  /* bds_len   = BDS_Len; */
+  /* bds_nbits = BDS_NumBits; */
+  bds_flag  = BDS_Flag;
+  /* lspherc   =  bds_flag >> 7; */
+  /* lcomplex  = (bds_flag >> 6)&1; */
+  lcompress = (bds_flag >> 4)&1;
+
+  *urecsize = 0;
+  if ( lcompress )
+    {
+      compress = BDS_Z;
+      if ( compress == 128 )
+	{
+	  gribsize = gribrec_len(bds[14], bds[15], bds[16]);
+	}
+    }
+
+  *urecsize = gribsize;
+
+  return (compress);
+}
+
+
+int  gribZip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufsize)
+{
+  int nerr;
+  int gribLen;
+  int rec_len;
+  int llarge = FALSE;
+#if ! defined  (HAVE_LIBSZ)
+  static int libszwarn = 1;
+#endif
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+
+  gribLen = gribrec_len(dbuf[4], dbuf[5], dbuf[6]);
+  if ( gribLen > JP23SET ) llarge = TRUE;
+
+  rec_len = gribLen;
+
+  nerr = grib1Sections(dbuf, dbufsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "grib1Sections error\n");
+      return (rec_len);
+    }
+
+#if  defined  (HAVE_LIBSZ)
+
+  {
+    long i;
+    int bdsLen;
+    int gribLenOld = 0;
+    int status;
+    int datstart, datsize;
+    SZ_com_t sz_param;          /* szip parameter block */
+    unsigned char *dest, *source;
+    size_t destLen, sourceLen;
+    int bds_len, bds_nbits, bds_flag, lspherc, lcomplex,/* lcompress,*/ bds_ubits;
+    int bds_head = 11;
+    int bds_ext = 0;
+    int bds_zoffset = 12;
+    unsigned char *pbuf = NULL;
+
+    if ( llarge ) bds_zoffset = 14;
+
+    bds_len   = BDS_Len;
+    bds_len   = correct_bdslen(bds_len, gribLen, bds-dbuf);
+    bds_nbits = BDS_NumBits;
+    bds_flag  = BDS_Flag;
+    bds_ubits = bds_flag & 15;
+    lspherc   =  bds_flag >> 7;
+    lcomplex  = (bds_flag >> 6)&1;
+    /* lcompress = (bds_flag >> 4)&1; */
+    
+    if ( bds_nbits != 8 && bds_nbits != 16 && bds_nbits != 24 && bds_nbits != 32 )
+      {
+	static int linfo = 1;
+	if ( linfo && bds_nbits != 0 )
+	  {
+	    linfo = 0;
+	    fprintf(stderr, "GRIB szip only supports 8, 16, 24 and 32 bit data!\n");
+	  }
+	return (rec_len);
+      }
+    
+    sz_param.options_mask        = OPTIONS_MASK;
+
+    if ( bds_nbits == 24 )
+      sz_param.bits_per_pixel    = 8;
+    else
+      sz_param.bits_per_pixel    = bds_nbits;
+
+    sz_param.pixels_per_block    = PIXELS_PER_BLOCK;
+    sz_param.pixels_per_scanline = PIXELS_PER_SCANLINE;
+
+    if ( lspherc )
+      {
+	if ( lcomplex  )
+	  {
+	    int jup, ioff;
+	    jup  = bds[15];
+	    ioff = (jup+1)*(jup+2);
+	    bds_ext = 4 + 3 + 4*ioff;
+	  }
+	else
+	  {
+	    bds_ext = 4;
+	  }
+      }
+
+    datstart = bds_head + bds_ext;
+
+    datsize = ((((bds_len - datstart)*8-bds_ubits)/bds_nbits)*bds_nbits)/8;
+
+    if ( datsize < MIN_SIZE ) return (rec_len);
+    /*
+    fprintf(stderr, "%d %d %d %d\n", bds_len, datstart, bds_len - datstart, datsize);
+    */
+    sourceLen = datsize;
+    destLen   = sbufsize;
+    
+    source = bds + datstart;
+    dest = sbuf;
+
+    if ( bds_nbits == 24 )
+      {
+	long nelem;
+	nelem = sourceLen/3;
+	pbuf = (unsigned char *) malloc(sourceLen);
+	for ( i = 0; i < nelem; i++ )
+	  {
+	    pbuf[        i] = source[3*i  ];
+	    pbuf[  nelem+i] = source[3*i+1];
+	    pbuf[2*nelem+i] = source[3*i+2];
+	  }
+	source = pbuf;
+      }
+
+    status = SZ_BufftoBuffCompress(dest, &destLen, source, sourceLen, &sz_param);
+    if ( status != SZ_OK )
+      {
+	if ( status == SZ_NO_ENCODER_ERROR )
+	  Warning("SZ_NO_ENCODER_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_PARAM_ERROR )
+	  Warning("SZ_PARAM_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_MEM_ERROR )
+	  Warning("SZ_MEM_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_OUTBUFF_FULL )
+	  /*Warning("SZ_OUTBUFF_FULL code %3d level %3d", PDS_Parameter, PDS_Level2)*/;
+	else
+	  Warning("SZ ERROR: %d code %3d level %3d", status, PDS_Parameter, PDS_Level2);
+      }
+    
+    if ( pbuf ) free(pbuf);
+    /*
+    fprintf(stderr, "sourceLen, destLen %d %d\n", sourceLen, destLen);
+    */
+    
+    if ( destLen < MIN_COMPRESS*sourceLen )
+      {
+	source = bds + datstart + bds_zoffset;
+	memcpy(source, dest, destLen);
+	
+	/* ----++++ number of unused bits at end of section) */
+
+	BDS_Flag -= bds_ubits;
+    
+	gribLenOld = gribLen;
+
+	if ( bds_ext )
+	  for ( i = bds_ext-1; i >= 0; --i )
+	    bds[bds_zoffset+bds_head+i] = bds[bds_head+i];
+
+	/*
+	fprintf(stderr, "destLen, datsize, datstart %d %d %d\n", destLen, datsize, datstart);
+	*/
+	/*	memcpy(bds + datstart + bds_zoffset, source, destLen); */
+	/*
+    fprintf(stderr, "z>>> %d %d %d %d <<<\n", (int) bds[0+datstart+bds_zoffset],
+	    (int)bds[1+datstart+bds_zoffset], (int)bds[2+datstart+bds_zoffset], (int)bds[3+datstart+bds_zoffset]);
+	*/
+	if ( llarge )
+	  {
+	    if ( gribLenOld%120 )
+	      {
+		fprintf(stderr, "Internal problem, record length not multiple of 120!");
+		while ( gribLenOld%120 ) gribLenOld++;
+	      }
+	    gribLenOld = gribLenOld / (-120);
+	    gribLenOld = JP23SET - gribLenOld + 1;
+	    bds[14] = 0xFF & (gribLenOld >> 16);
+	    bds[15] = 0xFF & (gribLenOld >>  8);
+	    bds[16] = 0xFF & (gribLenOld);
+
+	    bds[17] = 0xFF & (sourceLen >> 24);
+	    bds[18] = 0xFF & (sourceLen >> 16);
+	    bds[19] = 0xFF & (sourceLen >>  8);
+	    bds[20] = 0xFF & (sourceLen);
+
+	    bds[21] = 0xFF & (destLen >> 24);
+	    bds[22] = 0xFF & (destLen >> 16);
+	    bds[23] = 0xFF & (destLen >>  8);
+	    bds[24] = 0xFF & (destLen);
+	  }
+	else
+	  {
+	    bds[14] = 0xFF & (gribLenOld >> 16);
+	    bds[15] = 0xFF & (gribLenOld >>  8);
+	    bds[16] = 0xFF & (gribLenOld);
+
+	    bds[17] = 0xFF & (sourceLen >> 16);
+	    bds[18] = 0xFF & (sourceLen >>  8);
+	    bds[19] = 0xFF & (sourceLen);
+
+	    bds[20] = 0xFF & (destLen >> 16);
+	    bds[21] = 0xFF & (destLen >>  8);
+	    bds[22] = 0xFF & (destLen);
+	  }
+
+	bdsLen = datstart + bds_zoffset + destLen;
+
+	bds[11] = 0;
+	bds[12] = 0;
+	BDS_Z   = 128;
+
+	BDS_Flag += 16;
+	if ( (bdsLen%2) == 1 )
+	  {
+	    BDS_Flag += 8;
+	    bds[bdsLen++] = 0;
+	  }
+
+	bds[0] = 0xFF & (bdsLen >> 16);
+	bds[1] = 0xFF & (bdsLen >>  8);
+	bds[2] = 0xFF & (bdsLen);
+
+	gribLen = (bds - dbuf) + bdsLen;
+
+	dbuf[gribLen++] = '7';
+	dbuf[gribLen++] = '7';
+	dbuf[gribLen++] = '7';
+	dbuf[gribLen++] = '7';
+
+	if ( llarge )
+	  {
+	    long itemp;
+	    long bdslen = gribLen - 4;
+
+	    /*
+	      If a very large product, the section 4 length field holds
+	      the number of bytes in the product after section 4 upto
+	      the end of the padding bytes.
+	      This is a fixup to get round the restriction on product lengths
+	      due to the count being only 24 bits. It is only possible because
+	      the (default) rounding for GRIB products is 120 bytes.
+	    */
+	    while ( gribLen%120 ) dbuf[gribLen++] = 0;
+
+	    itemp = gribLen / (-120);
+	    itemp = JP23SET - itemp + 1;
+
+	    dbuf[4] = 0xFF & (itemp >> 16);
+	    dbuf[5] = 0xFF & (itemp >>  8);
+	    dbuf[6] = 0xFF & (itemp);
+
+	    bdslen = gribLen - bdslen;
+
+	    bds[0] = 0xFF & (bdsLen >> 16);
+	    bds[1] = 0xFF & (bdsLen >>  8);
+	    bds[2] = 0xFF & (bdsLen);
+	  }
+	else
+	  {
+	    dbuf[4] = 0xFF & (gribLen >> 16);
+	    dbuf[5] = 0xFF & (gribLen >>  8);
+	    dbuf[6] = 0xFF & (gribLen);
+	  }
+      }
+    /*
+    fprintf(stderr, "%3d %3d griblen in %6d  out %6d  CR %g   slen %6d dlen %6d  CR %g\n",
+	    PDS_Parameter, PDS_Level1, gribLenOld, gribLen,
+	    ((double)gribLenOld)/gribLen, sourceLen, destLen,
+	    ((double)sourceLen)/destLen);
+    */
+  }
+
+#else
+  if ( libszwarn )
+    {
+      Warning("Compression disabled, szlib not available!");
+      libszwarn = 0;
+    }
+#endif
+
+  while ( gribLen & 7 ) dbuf[gribLen++] = 0;
+
+  rec_len = gribLen;
+
+  return (rec_len);
+}
+
+
+int  gribUnzip(unsigned char *dbuf, long dbufsize, unsigned char *sbuf, long sbufsize)
+{
+#if ! defined  (HAVE_LIBSZ)
+  static int libszwarn = 1;
+#endif
+  int nerr;
+  unsigned char *pds = NULL, *gds = NULL, *bms = NULL, *bds = NULL;
+  int bdsLen, recLen, gribLen = 0;
+  char *dest, *source;
+  size_t destLen, sourceLen;
+  int /* bds_len, */ bds_nbits, bds_flag, lspherc, lcomplex /*, lcompress*/;
+  int bds_head = 11;
+  int bds_ext = 0;
+  int bds_zoffset = 12;
+  int datstart = 0;
+  int llarge = FALSE;
+
+  nerr = grib1Sections(sbuf, sbufsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "grib1Sections error\n");
+      return (0);
+    }
+
+  recLen = gribrec_len(bds[14], bds[15], bds[16]);
+  if ( recLen > JP23SET ) llarge = TRUE;
+
+  if ( llarge ) bds_zoffset = 14;
+
+  /* bds_len   = BDS_Len; */
+  bds_nbits = BDS_NumBits;
+  bds_flag  = BDS_Flag;
+  lspherc   =  bds_flag >> 7;
+  lcomplex  = (bds_flag >> 6)&1;
+  /* lcompress = (bds_flag >> 4)&1; */
+
+  if ( lspherc )
+    {
+      if ( lcomplex  )
+	{
+	  int jup, ioff;
+	  jup  = bds[bds_zoffset+15];
+	  ioff = (jup+1)*(jup+2);
+	  bds_ext = 4 + 3 + 4*ioff;
+	}
+      else
+	{
+	  bds_ext = 4;
+	}
+    }
+
+  datstart = bds_head + bds_ext;
+
+  source = (char *) bds + datstart + bds_zoffset;
+  if ( llarge )
+    sourceLen = ((size_t) ((bds[21]<<24)+(bds[22]<<16)+(bds[23]<<8)+bds[24]));
+  else
+    sourceLen = ((size_t) ((bds[20]<<16)+(bds[21]<<8)+bds[22]));
+
+  nerr = grib1Sections(dbuf, sbufsize, &pds, &gds, &bms, &bds);
+  if ( nerr )
+    {
+      fprintf(stdout, "grib1Sections error\n");
+      return (0);
+    }
+
+  dest = (char *) bds + datstart;
+  if ( llarge )
+    destLen = ((size_t) ((bds[17]<<24)+(bds[18]<<16)+(bds[19]<<8)+bds[20]));
+  else
+    destLen = ((size_t) ((bds[17]<<16)+(bds[18]<<8)+bds[19]));
+
+  BDS_Flag -= 16;
+
+  bdsLen = datstart + destLen;
+
+#if  defined  (HAVE_LIBSZ)
+  {
+    int status;
+    long i;
+    size_t tmpLen;
+    int bds_ubits;
+    SZ_com_t sz_param;          /* szip parameter block */
+
+    sz_param.options_mask        = OPTIONS_MASK;
+
+    if ( bds_nbits == 24 )
+      sz_param.bits_per_pixel    = 8;
+    else
+      sz_param.bits_per_pixel    = bds_nbits;
+
+    sz_param.pixels_per_block    = PIXELS_PER_BLOCK;
+    sz_param.pixels_per_scanline = PIXELS_PER_SCANLINE;
+
+    if ( bds_ext )
+      for ( i = 0; i < bds_ext; ++i )
+	bds[bds_head+i] = bds[bds_zoffset+bds_head+i];
+
+    /*
+    fprintf(stderr, "gribUnzip: sourceLen %ld; destLen %ld\n", (long)sourceLen, (long)destLen);
+    fprintf(stderr, "gribUnzip: sourceOff %d; destOff %d\n", bds[12], bds[11]);
+    fprintf(stderr, "gribUnzip: reclen %d; bdslen %d\n", recLen, bdsLen);
+    */
+
+    tmpLen = destLen;
+    status = SZ_BufftoBuffDecompress(dest, &tmpLen, source, sourceLen, &sz_param);
+    if ( status != SZ_OK )
+      {
+	if ( status == SZ_NO_ENCODER_ERROR )
+	  Warning("SZ_NO_ENCODER_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_PARAM_ERROR )
+	  Warning("SZ_PARAM_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_MEM_ERROR )
+	  Warning("SZ_MEM_ERROR code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else if ( status == SZ_OUTBUFF_FULL )
+	  Warning("SZ_OUTBUFF_FULL code %3d level %3d", PDS_Parameter, PDS_Level2);
+	else
+	  Warning("SZ ERROR: %d code %3d level %3d", status, PDS_Parameter, PDS_Level2);
+      }
+    /*
+    fprintf(stderr, "gribUnzip: sl = %ld  dl = %ld   tl = %ld\n",
+	    (long)sourceLen, (long)destLen,(long) tmpLen);
+    */
+    if ( tmpLen != destLen )
+      Warning("unzip size differ: code %3d level %3d  ibuflen %ld ubuflen %ld",
+	      PDS_Parameter, PDS_Level2, (long) destLen, (long) tmpLen);
+ 
+    if ( bds_nbits == 24 )
+      {
+	long nelem;
+	unsigned char *pbuf;
+	nelem = tmpLen/3;
+	pbuf = (unsigned char *) malloc(tmpLen);
+	for ( i = 0; i < nelem; i++ )
+	  {
+	    pbuf[3*i  ] = dest[        i];
+	    pbuf[3*i+1] = dest[  nelem+i];
+	    pbuf[3*i+2] = dest[2*nelem+i];
+	  }
+	memcpy(dest, pbuf, tmpLen);
+	free(pbuf);
+      }
+  
+    bds_ubits = BDS_Flag & 15;
+    BDS_Flag -= bds_ubits;
+
+    if ( (bdsLen%2) == 1 )
+      {
+	BDS_Flag += 8;
+	bds[bdsLen++] = 0;
+      }
+
+    bds[0] = 0xFF & (bdsLen >> 16);
+    bds[1] = 0xFF & (bdsLen >>  8);
+    bds[2] = 0xFF & (bdsLen);
+
+    gribLen = (bds - dbuf) + bdsLen;
+    
+    dbuf[gribLen++] = '7';
+    dbuf[gribLen++] = '7';
+    dbuf[gribLen++] = '7';
+    dbuf[gribLen++] = '7';
+
+    if ( llarge )
+      {
+	long itemp;
+        bdsLen = gribLen - 4;
+	/*
+	  If a very large product, the section 4 length field holds
+	  the number of bytes in the product after section 4 upto
+	  the end of the padding bytes.
+	  This is a fixup to get round the restriction on product lengths
+	  due to the count being only 24 bits. It is only possible because
+	  the (default) rounding for GRIB products is 120 bytes.
+	*/
+	while ( gribLen%120 ) dbuf[gribLen++] = 0;
+
+	if ( gribLen != recLen )
+	  fprintf(stderr, "Internal problem, recLen and gribLen differ!\n");
+	
+	itemp = gribLen / (-120);
+	itemp = JP23SET - itemp + 1;
+	
+	dbuf[4] = 0xFF & (itemp >> 16);
+	dbuf[5] = 0xFF & (itemp >>  8);
+	dbuf[6] = 0xFF & (itemp);
+	
+	bdsLen = gribLen - bdsLen;
+	    
+	bds[0] = 0xFF & (bdsLen >> 16);
+	bds[1] = 0xFF & (bdsLen >>  8);
+	bds[2] = 0xFF & (bdsLen);
+      }
+    else
+      {
+	dbuf[4] = 0xFF & (recLen >> 16);
+	dbuf[5] = 0xFF & (recLen >>  8);
+	dbuf[6] = 0xFF & (recLen);
+      }
+    /*
+    fprintf(stderr, "recLen, gribLen, bdsLen %d %d %d\n", recLen, gribLen, bdsLen);
+    */
+    while ( gribLen & 7 ) dbuf[gribLen++] = 0;
+    /*
+    fprintf(stderr, "recLen, gribLen, bdsLen %d %d %d\n", recLen, gribLen, bdsLen);
+    */
+  }
+#else
+  if ( libszwarn )
+    {
+      Warning("Decompression disabled, szlib not available!");
+      libszwarn = 0;
+    }
+#endif
+
+  return (gribLen);
+}
+static const char grb_libvers[] = "1.5.6" " of ""Dec 17 2012"" ""13:44:05";
+const char *
+cgribexLibraryVersion(void)
+{
+  return (grb_libvers);
+}
diff --git a/libcdi/src/config.h.in b/libcdi/src/config.h.in
new file mode 100644
index 0000000..c51482d
--- /dev/null
+++ b/libcdi/src/config.h.in
@@ -0,0 +1,196 @@
+/* src/config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define if C / Fortran interface cfortran.h works */
+#undef HAVE_CF_INTERFACE
+
+/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
+   */
+#undef HAVE_DECL_ISNAN
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the <grib_api.h> header file. */
+#undef HAVE_GRIB_API_H
+
+/* Define to 1 if you have the <hdf5.h> header file. */
+#undef HAVE_HDF5_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <jasper.h> header file. */
+#undef HAVE_JASPER_H
+
+/* Define to 1 for GRIB1 decoding/encoding with cgribex */
+#undef HAVE_LIBCGRIBEX
+
+/* Define to 1 for EXTRA interface */
+#undef HAVE_LIBEXTRA
+
+/* Define to 1 for GRIB support */
+#undef HAVE_LIBGRIB
+
+/* GRIB_API library is present if defined to 1 */
+#undef HAVE_LIBGRIB_API
+
+/* Define to 1 for HDF5 support */
+#undef HAVE_LIBHDF5
+
+/* Define to 1 for IEG interface */
+#undef HAVE_LIBIEG
+
+/* Define to 1 for JPEG compression for GRIB2 */
+#undef HAVE_LIBJASPER
+
+/* Define to 1 for PNG compression for GRIB2 */
+#undef HAVE_LIBLIBPNG
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 if you have the `malloc' library (-lmalloc). */
+#undef HAVE_LIBMALLOC
+
+/* Define to 1 for NETCDF OpenDAP */
+#undef HAVE_LIBNC_DAP
+
+/* Define to 1 for NETCDF support */
+#undef HAVE_LIBNETCDF
+
+/* Define to 1 for JPEG compression for GRIB2 */
+#undef HAVE_LIBOPENJPEG
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#undef HAVE_LIBPTHREAD
+
+/* Define to 1 for SERVICE interface */
+#undef HAVE_LIBSERVICE
+
+/* Define to 1 for SZIP support */
+#undef HAVE_LIBSZ
+
+/* Define 1 for ZLIB support */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the `mallinfo' function. */
+#undef HAVE_MALLINFO
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define to 1 for NETCDF2 support */
+#undef HAVE_NETCDF2
+
+/* Define to 1 for NETCDF4 support */
+#undef HAVE_NETCDF4
+
+/* Define to 1 if you have the <netcdf.h> header file. */
+#undef HAVE_NETCDF_H
+
+/* Define to 1 if you have the <openjpeg.h> header file. */
+#undef HAVE_OPENJPEG_H
+
+/* Define to 1 if you have the <png.h> header file. */
+#undef HAVE_PNG_H
+
+/* Define if you have POSIX threads libraries and header files. */
+#undef HAVE_PTHREAD
+
+/* Define to 1 if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <szlib.h> header file. */
+#undef HAVE_SZLIB_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <zlib.h> header file. */
+#undef HAVE_ZLIB_H
+
+/* Host name */
+#undef HOST_NAME
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+   your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* System type */
+#undef SYSTEM_TYPE
+
+/* User name */
+#undef USER_NAME
+
+/* parallel I/O requested and available */
+#undef USE_MPI
+
+/* Version number of package */
+#undef VERSION
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
diff --git a/libcdi/src/datetime.h b/libcdi/src/datetime.h
new file mode 100644
index 0000000..10a2174
--- /dev/null
+++ b/libcdi/src/datetime.h
@@ -0,0 +1,15 @@
+typedef struct
+{
+  long date;
+  long time;
+}
+DateTime;
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/dmemory.c b/libcdi/src/dmemory.c
new file mode 100644
index 0000000..e656fad
--- /dev/null
+++ b/libcdi/src/dmemory.c
@@ -0,0 +1,574 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <stdarg.h>
+#include <errno.h>
+
+
+#if ! defined (HAVE_CONFIG_H)
+#if ! defined (HAVE_MALLOC_H)
+#  if defined (SX)
+#    define  HAVE_MALLOC_H
+#  endif
+#endif
+#endif
+
+#if  defined  (HAVE_MALLOC_H)
+#    include <malloc.h>
+#endif
+
+
+#define  MALLOC_FUNC   0
+#define  CALLOC_FUNC   1
+#define  REALLOC_FUNC  2
+#define  FREE_FUNC     3
+
+#undef   UNDEFID
+#define  UNDEFID  -1
+
+#define  MAXNAME  32   /* Min = 8, for  "unknown" ! */
+
+int dmemory_ExitOnError = 0;
+
+typedef struct
+{
+  void     *ptr;
+  int       item;
+  size_t    size;
+  size_t    nobj;
+  int       mtype;
+  int       line;
+  char      file[MAXNAME];
+  char      caller[MAXNAME];
+}
+MemTable;
+
+static MemTable *memTable;
+static int     memTableSize  = 0;
+static long    memAccess     = 0;
+
+static size_t  MemObjs       = 0;
+static size_t  MaxMemObjs    = 0;
+static size_t  MemUsed       = 0;
+static size_t  MaxMemUsed    = 0;
+
+static int     MEM_Debug     = 0;   /* If set to 1, debugging */
+
+void memDebug(int debug)
+{
+  MEM_Debug = debug;
+}
+
+static
+void memInternalProblem(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+  printf("\n");
+   fprintf(stderr, "Internal problem (%s) : ", caller);
+  vfprintf(stderr, fmt, args);
+   fprintf(stderr, "\n");
+
+  va_end(args);
+
+  exit(EXIT_FAILURE);
+}
+
+static
+void memError(const char *caller, const char *file, int line, size_t size)
+{
+  printf("\n");
+  fprintf(stderr, "Error (%s) : Allocation of %lu bytes failed. [ line %d file %s ]\n",
+	  caller, (unsigned long) size, line, file);
+
+  if ( errno )
+    perror("System error message ");
+	
+  exit(EXIT_FAILURE);
+}
+
+static
+void memListPrintEntry(int mtype, int item, size_t size, void *ptr,
+		       const char *caller, const char *file, int line)
+{
+  switch (mtype)
+    {
+    case MALLOC_FUNC:
+      fprintf(stderr, "[%-7s ", "Malloc");
+      break;
+    case CALLOC_FUNC:
+      fprintf(stderr, "[%-7s ", "Calloc");
+      break;
+    case REALLOC_FUNC:
+      fprintf(stderr, "[%-7s ", "Realloc");
+      break;
+    case FREE_FUNC:
+      fprintf(stderr, "[%-7s ", "Free");
+      break;
+    }
+
+   fprintf(stderr, "memory item %3d ", item);
+   fprintf(stderr, "(%6lu byte) ", (unsigned long) size);
+   fprintf(stderr, "at %p", ptr);
+   if ( file != NULL )
+     {
+       fprintf(stderr, " line %4d", line);
+       fprintf(stderr, " file %s", file);
+     }    
+   if ( caller != NULL )
+     fprintf(stderr, " (%s)", caller);     
+   fprintf(stderr, "]\n");
+}
+
+static
+void memListPrintTable(void)
+{
+  int memID, item, item1, item2 = 0;
+
+  if ( MemObjs ) fprintf(stderr, "\nMemory table:\n");
+
+  /* find maximum item */
+  for ( memID = 0; memID < memTableSize; memID++ )
+    if ( memTable[memID].item != UNDEFID )
+      if ( memTable[memID].item > item2 ) item2 = memTable[memID].item;
+
+  /* find minimum item */
+  item1 = item2;
+  for ( memID = 0; memID < memTableSize; memID++ )
+    if ( memTable[memID].item != UNDEFID )
+      if ( memTable[memID].item < item1 ) item1 = memTable[memID].item;
+
+  for ( item = item1; item <= item2; item++ )
+    for ( memID = 0; memID < memTableSize; memID++ )
+      {
+	if ( memTable[memID].item == item )
+	  memListPrintEntry(memTable[memID].mtype, memTable[memID].item,
+			    memTable[memID].size*memTable[memID].nobj,
+			    memTable[memID].ptr, memTable[memID].caller,
+			    memTable[memID].file, memTable[memID].line);
+      }
+
+  if ( MemObjs )
+    {
+      fprintf(stderr, "  Memory access             : %6u\n", (unsigned) memAccess);
+      fprintf(stderr, "  Maximum objects           : %6u\n", (unsigned) memTableSize);
+      fprintf(stderr, "  Objects used              : %6u\n", (unsigned) MaxMemObjs);
+      fprintf(stderr, "  Objects in use            : %6u\n", (unsigned) MemObjs);
+      fprintf(stderr, "  Memory allocated          : ");
+      if (MemUsed > 1024*1024*1024)
+	fprintf(stderr, " %5d GB\n",   (int) (MemUsed/(1024*1024*1024)));
+      else if (MemUsed > 1024*1024)
+	fprintf(stderr, " %5d MB\n",   (int) (MemUsed/(1024*1024)));
+      else if (MemUsed > 1024)
+	fprintf(stderr, " %5d KB\n",   (int) (MemUsed/(1024)));
+      else
+	fprintf(stderr, " %5d Byte\n", (int)  MemUsed);
+    }
+
+  if ( MaxMemUsed )
+    {
+      fprintf(stderr, "  Maximum memory allocated  : ");
+      if (MaxMemUsed > 1024*1024*1024)
+	fprintf(stderr, " %5d GB\n",   (int) (MaxMemUsed/(1024*1024*1024)));
+      else if (MaxMemUsed > 1024*1024)
+	fprintf(stderr, " %5d MB\n",   (int) (MaxMemUsed/(1024*1024)));
+      else if (MaxMemUsed > 1024)
+	fprintf(stderr, " %5d KB\n",   (int) (MaxMemUsed/(1024)));
+      else
+	fprintf(stderr, " %5d Byte\n", (int)  MaxMemUsed);
+    }
+}
+
+static
+void memGetDebugLevel(void)
+{
+  char *debugLevel;
+
+  debugLevel = getenv("MEMORY_DEBUG");
+
+  if ( debugLevel )
+    {
+      if ( isdigit((int) debugLevel[0]) )
+	MEM_Debug = atoi(debugLevel);
+
+      if ( MEM_Debug )
+	atexit(memListPrintTable);
+    }
+}
+
+static
+void memInit(void)
+{
+  static int initDebugLevel = 0;
+
+  if ( ! initDebugLevel )
+    {
+      memGetDebugLevel();
+      initDebugLevel = 1;
+    }  
+}
+
+static
+int memListDeleteEntry(void *ptr, size_t *size)
+{
+  int memID = 0;
+  int item = UNDEFID;
+
+  for ( memID = 0; memID < memTableSize; memID++ )
+    {
+      if ( memTable[memID].item == UNDEFID ) continue;
+      if ( memTable[memID].ptr == ptr ) break;
+    }
+
+  if ( memID != memTableSize )
+    {
+      MemObjs--;
+      MemUsed -= memTable[memID].size * memTable[memID].nobj;
+      *size = memTable[memID].size * memTable[memID].nobj;
+       item = memTable[memID].item;
+       memTable[memID].item   = UNDEFID;
+    }
+
+  return (item);
+}
+
+static
+void memTableInitEntry(int memID)
+{
+  if ( memID < 0 || memID >= memTableSize )
+    memInternalProblem(__func__, "memID %d undefined!", memID);
+
+  memTable[memID].ptr    = NULL;
+  memTable[memID].item   = UNDEFID;
+  memTable[memID].size   = 0;
+  memTable[memID].nobj   = 0;
+  memTable[memID].mtype  = UNDEFID;
+  memTable[memID].line   = UNDEFID;
+}
+
+static
+int memListNewEntry(int mtype, void *ptr, size_t size, size_t nobj,
+		    const char *caller, const char *file, int line)
+{
+  static int item = 0;
+  size_t memSize = 0;
+  int memID = 0;
+  size_t len;
+  int i;
+
+  /*
+    Look for a free slot in memTable.
+    (Create the table the first time through).
+  */
+  if ( memTableSize == 0 )
+    {
+      memTableSize = 8;
+      memSize  = memTableSize*sizeof(MemTable);
+      memTable = (MemTable *) malloc(memSize);
+      if( memTable == NULL ) memError(__func__, __FILE__, __LINE__, memSize);
+
+      for( i = 0; i < memTableSize; i++ )
+	memTableInitEntry(i);
+    }
+  else
+    {
+      while( memID < memTableSize )
+	{
+	  if ( memTable[memID].item == UNDEFID ) break;
+	  memID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if ( memID == memTableSize )
+    {
+      memTableSize = 2*memTableSize;
+      memSize  = memTableSize*sizeof(MemTable);
+      memTable = (MemTable *) realloc(memTable, memSize);
+      if( memTable == NULL ) memError(__func__, __FILE__, __LINE__, memSize);
+
+      for( i = memID; i < memTableSize; i++ )
+	memTableInitEntry(i);
+    }
+
+  memTable[memID].item  = item;
+  memTable[memID].ptr   = ptr;
+  memTable[memID].size  = size;
+  memTable[memID].nobj  = nobj;
+  memTable[memID].mtype = mtype;
+  memTable[memID].line  = line;
+
+  if ( file )
+    {
+      len = strlen(file);
+      if ( len > MAXNAME-1 ) len = MAXNAME-1;
+    
+      (void) memcpy(memTable[memID].file, file, len);
+      memTable[memID].file[len] = '\0';
+    }
+  else
+    {
+      (void) strcpy(memTable[memID].file, "unknown");
+    }
+
+  if ( caller )
+    {
+      len = strlen(caller);
+      if ( len > MAXNAME-1 ) len = MAXNAME-1;
+
+      (void) memcpy(memTable[memID].caller, caller, len);
+      memTable[memID].caller[len] = '\0';
+    }
+  else
+    {
+      (void) strcpy(memTable[memID].caller, "unknown");
+    }
+
+  MaxMemObjs++;
+  MemObjs++;
+  MemUsed += size*nobj;
+  if ( MemUsed > MaxMemUsed ) MaxMemUsed = MemUsed;
+
+  return (item++);
+}
+
+static
+int memListChangeEntry(void *ptrold, void *ptr, size_t size,
+		       const char *caller, const char *file, int line)
+{
+  int item = UNDEFID;
+  int memID = 0;
+  size_t len;
+  size_t sizeold;
+
+  while( memID < memTableSize )
+    {
+      if ( memTable[memID].item != UNDEFID )
+	if ( memTable[memID].ptr == ptrold ) break;
+      memID++;
+    }
+
+  if ( memID == memTableSize )
+    {
+      if ( ptrold != NULL )
+	memInternalProblem(__func__, "Item at %p not found.", ptrold);
+    }
+  else
+    {
+      item = memTable[memID].item;
+
+      sizeold = memTable[memID].size*memTable[memID].nobj;
+      
+      memTable[memID].ptr   = ptr;
+      memTable[memID].size  = size;
+      memTable[memID].nobj  = 1;
+      memTable[memID].mtype = REALLOC_FUNC;
+      memTable[memID].line  = line;
+
+      if ( file )
+	{
+	  len = strlen(file);
+	  if ( len > MAXNAME-1 ) len = MAXNAME-1;
+
+	  (void) memcpy(memTable[memID].file, file, len);
+	  memTable[memID].file[len] = '\0';
+	}
+      else
+	{
+	  (void) strcpy(memTable[memID].file, "unknown");
+	}
+
+      if ( caller )
+	{
+	  len = strlen(caller);
+	  if ( len > MAXNAME-1 ) len = MAXNAME-1;
+
+	  (void) memcpy(memTable[memID].caller, caller, len);
+	  memTable[memID].caller[len] = '\0';
+	}
+      else
+	{
+	  (void) strcpy(memTable[memID].caller, "unknown");
+	}
+
+      MemUsed -= sizeold;
+      MemUsed += size;
+      if ( MemUsed > MaxMemUsed ) MaxMemUsed = MemUsed;
+    }
+
+  return (item);
+}
+
+
+void *Calloc(const char *caller, const char *file, int line, size_t nobjs, size_t size)
+{
+  void *ptr = NULL;
+  int item = UNDEFID;
+
+  memInit();
+
+  if ( nobjs*size > 0 )
+    {
+      ptr = calloc(nobjs, size);
+
+      if ( MEM_Debug )
+	{
+	  memAccess++;
+
+	  if ( ptr )
+	    item = memListNewEntry(CALLOC_FUNC, ptr, size, nobjs, caller, file, line);
+
+	  memListPrintEntry(CALLOC_FUNC, item, size*nobjs, ptr, caller, file, line);
+	}
+
+      if ( ptr == NULL && dmemory_ExitOnError )
+	memError(caller, file, line, size*nobjs);
+    }
+  else
+    fprintf(stderr, "Warning (%s) : Allocation of 0 bytes! [ line %d file %s ]\n", caller, line, file);
+
+  return(ptr);
+}
+
+
+void *Malloc(const char *caller, const char *file, int line, size_t size)
+{
+  void *ptr = NULL;
+  int item = UNDEFID;
+
+  memInit();
+
+  if ( size > 0 )
+    {
+      ptr = malloc(size);
+
+      if ( MEM_Debug )
+	{
+	  memAccess++;
+
+	  if ( ptr )
+	    item = memListNewEntry(MALLOC_FUNC, ptr, size, 1, caller, file, line);
+
+	  memListPrintEntry(MALLOC_FUNC, item, size, ptr, caller, file, line);
+	}
+
+      if ( ptr == NULL && dmemory_ExitOnError )
+	memError(caller, file, line, size);
+    }
+  else
+    fprintf(stderr, "Warning (%s) : Allocation of 0 bytes! [ line %d file %s ]\n", caller, line, file);
+
+  return (ptr);
+}
+
+
+void *Realloc(const char *caller, const char *file, int line, void *ptrold, size_t size)
+{
+  void *ptr = NULL;
+  int item = UNDEFID;
+
+  memInit();
+
+  if ( size > 0 )
+    {
+      ptr = realloc(ptrold, size);
+
+      if ( MEM_Debug )
+	{
+	  memAccess++;
+
+	  if ( ptr )
+	    {
+	      item = memListChangeEntry(ptrold, ptr, size, caller, file, line);
+
+	      if ( item == UNDEFID )
+		item = memListNewEntry(REALLOC_FUNC, ptr, size, 1, caller, file, line);
+	    }
+
+	  memListPrintEntry(REALLOC_FUNC, item, size, ptr, caller, file, line);
+	}
+
+      if ( ptr == NULL && dmemory_ExitOnError )
+	memError(caller, file, line, size);
+    }
+  else
+    fprintf(stderr, "Warning (%s) : Allocation of 0 bytes! [ line %d file %s ]\n", caller, line, file);
+
+  return (ptr);
+}
+
+
+void Free(const char *caller, const char *file, int line, void *ptr)
+{
+  int item;
+  size_t size;
+
+  memInit();
+
+  if ( MEM_Debug )
+    {
+      if ( (item = memListDeleteEntry(ptr, &size)) >= 0 )
+	{
+	  memListPrintEntry(FREE_FUNC, item, size, ptr, caller, file, line);
+	}
+      else
+	{
+	  if ( ptr )
+	    fprintf(stderr, "%s info: memory entry at %p not found. [line %4d file %s (%s)]\n",
+		    __func__, ptr, line, file, caller);
+	}
+    }
+
+  free(ptr);
+}
+
+
+size_t memTotal(void)
+{
+  size_t memtotal = 0;
+#if  defined  (HAVE_MALLINFO)
+  struct mallinfo meminfo = mallinfo();
+  if ( MEM_Debug )
+    {
+      fprintf(stderr, "arena      %8ld (non-mmapped space allocated from system)\n", (unsigned long) meminfo.arena);
+      fprintf(stderr, "ordblks    %8ld (number of free chunks)\n", (unsigned long) meminfo.ordblks);
+      fprintf(stderr, "smblks     %8ld (number of fastbin blocks)\n", (unsigned long) meminfo.smblks);
+      fprintf(stderr, "hblks      %8ld (number of mmapped regions)\n", (unsigned long) meminfo.hblks);
+      fprintf(stderr, "hblkhd     %8ld (space in mmapped regions)\n", (unsigned long) meminfo.hblkhd);
+      fprintf(stderr, "usmblks    %8ld (maximum total allocated space)\n", (unsigned long) meminfo.usmblks);
+      fprintf(stderr, "fsmblks    %8ld (maximum total allocated space)\n", (unsigned long) meminfo.fsmblks);
+      fprintf(stderr, "uordblks   %8ld (total allocated space)\n", (unsigned long) meminfo.uordblks);
+      fprintf(stderr, "fordblks   %8ld (total free space)\n", (unsigned long) meminfo.fordblks);
+      fprintf(stderr, "Memory in use:   %8ld bytes\n", (unsigned long) meminfo.usmblks + meminfo.uordblks);
+      fprintf(stderr, "Total heap size: %8ld bytes\n", (unsigned long) meminfo.arena);
+
+      /* malloc_stats(); */
+    }
+  memtotal = meminfo.arena;
+#endif
+
+  return (memtotal);
+}
+
+
+void memExitOnError(void)
+{
+  dmemory_ExitOnError = 1;
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/dmemory.h b/libcdi/src/dmemory.h
new file mode 100644
index 0000000..0ade0cc
--- /dev/null
+++ b/libcdi/src/dmemory.h
@@ -0,0 +1,54 @@
+#ifndef _DMEMORY_H
+#define _DMEMORY_H
+
+#include <stdlib.h>
+
+/*
+ * if DEBUG_MEMORY is defined setenv MEMORY_DEBUG to debug memory
+ */
+
+#define  DEBUG_MEMORY
+
+#ifndef  WITH_CALLER_NAME
+#define  WITH_CALLER_NAME
+#endif
+
+extern size_t  memTotal(void);
+extern void    memDebug(int debug);
+extern void    memExitOnError(void);
+
+#if  defined  DEBUG_MEMORY
+
+extern void   *Realloc(const char *caller, const char *file, int line, void *ptr, size_t size);
+extern void   *Calloc (const char *caller, const char *file, int line, size_t nmemb, size_t size);
+extern void   *Malloc (const char *caller, const char *file, int line, size_t size);
+extern void    Free   (const char *caller, const char *file, int line, void *ptr);
+
+#if  defined  calloc
+#  undef  calloc
+#endif
+
+#if  defined  WITH_CALLER_NAME
+#  define  realloc(p, s)  Realloc(__func__, __FILE__, __LINE__, p, (size_t)s)
+#  define   calloc(n, s)   Calloc(__func__, __FILE__, __LINE__, n, (size_t)s)
+#  define   malloc(s)      Malloc(__func__, __FILE__, __LINE__, (size_t)s)
+#  define     free(p)        Free(__func__, __FILE__, __LINE__, p)
+#else
+#  define  realloc(p, s)  Realloc((void *) NULL, __FILE__, __LINE__, p, (size_t)s)
+#  define   calloc(n, s)   Calloc((void *) NULL, __FILE__, __LINE__, n, (size_t)s)
+#  define   malloc(s)      Malloc((void *) NULL, __FILE__, __LINE__, (size_t)s)
+#  define     free(p)        Free((void *) NULL, __FILE__, __LINE__, p)
+#endif
+
+#endif /* DEBUG_MEMORY */
+
+#endif /* _DMEMORY_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/dtypes.h b/libcdi/src/dtypes.h
new file mode 100644
index 0000000..f69ea49
--- /dev/null
+++ b/libcdi/src/dtypes.h
@@ -0,0 +1,57 @@
+#ifndef _DTYPES_H
+#define _DTYPES_H
+
+#include <stdio.h>
+#include <limits.h>
+
+/* INT32 */
+
+#if ! defined (INT_MAX)
+#  error INT_MAX undefined
+#endif
+
+#undef  INT32
+#if  INT_MAX == 2147483647L
+#  define  INT32  int
+#elif LONG_MAX == 2147483647L
+#  define  INT32  long
+#endif
+
+/* INT64 */
+
+#if ! defined (LONG_MAX)
+#  error LONG_MAX undefined
+#endif
+
+#undef  INT64
+#if  LONG_MAX > 2147483647L
+#  define  INT64  long
+#else
+#  define  INT64  long long
+#endif
+
+/* FLT32 */
+
+#undef   FLT32
+#define  FLT32  float
+
+/* FLT64 */
+
+#undef   FLT64
+#define  FLT64  double
+
+/* UINT32 and UINT64 */
+
+#define  UINT32   unsigned INT32
+#define  UINT64   unsigned INT64
+
+#endif  /* _DTYPES_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/error.c b/libcdi/src/error.c
new file mode 100644
index 0000000..b04009d
--- /dev/null
+++ b/libcdi/src/error.c
@@ -0,0 +1,90 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <errno.h>
+
+
+int _ExitOnError   = 1;	/* If set to 1, exit on error       */
+int _Verbose = 1;	/* If set to 1, errors are reported */
+int _Debug   = 0;       /* If set to 1, debugging           */
+
+
+void SysError_(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+  printf("\n");
+   fprintf(stderr, "Error (%s) : ", caller);
+  vfprintf(stderr, fmt, args);
+   fprintf(stderr, "\n");
+
+  va_end(args);
+
+  if ( errno )
+    perror("System error message ");
+	
+  exit(EXIT_FAILURE);
+}
+
+
+void Error_(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+  printf("\n");
+   fprintf(stderr, "Error (%s) : ", caller);
+  vfprintf(stderr, fmt, args);
+   fprintf(stderr, "\n");
+
+  va_end(args);
+
+  if ( _ExitOnError ) exit(EXIT_FAILURE);
+}
+
+
+void Warning_(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+  if ( _Verbose )
+    {
+       fprintf(stderr, "Warning (%s) : ", caller);
+      vfprintf(stderr, fmt, args);
+       fprintf(stderr, "\n");
+    }
+
+  va_end(args);
+}
+
+
+void Message_(const char *caller, const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+   fprintf(stdout, "%-18s : ", caller);
+  vfprintf(stdout, fmt, args);
+   fprintf(stdout, "\n");
+
+  va_end(args);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/error.h b/libcdi/src/error.h
new file mode 100644
index 0000000..1759e5e
--- /dev/null
+++ b/libcdi/src/error.h
@@ -0,0 +1,46 @@
+#ifndef _ERROR_H
+#define _ERROR_H
+
+#ifndef  WITH_CALLER_NAME
+#define  WITH_CALLER_NAME
+#endif
+
+#define  _FATAL     1     /* Error flag: exit on error  */
+#define  _VERBOSE   2     /* Error flag: report errors  */
+#define  _DEBUG     4     /* Error flag: debug          */
+
+extern int _ExitOnError;  /* If set to 1, exit on error (default 1)       */
+extern int _Verbose;      /* If set to 1, errors are reported (default 1) */
+extern int _Debug;        /* If set to 1, debuggig (default 0)            */
+
+void SysError_(const char *caller, const char *fmt, ...);
+void    Error_(const char *caller, const char *fmt, ...);
+void  Warning_(const char *caller, const char *fmt, ...);
+void  Message_(const char *caller, const char *fmt, ...);
+
+#if  defined  WITH_CALLER_NAME
+#  define  SysError(...)  SysError_(__func__, __VA_ARGS__)
+#  define    Errorc(...)     Error_(  caller, __VA_ARGS__)
+#  define     Error(...)     Error_(__func__, __VA_ARGS__)
+#  define   Warning(...)   Warning_(__func__, __VA_ARGS__)
+#  define  Messagec(...)   Message_(  caller, __VA_ARGS__)
+#  define   Message(...)   Message_(__func__, __VA_ARGS__)
+#else
+#  define  SysError(...)  SysError_((void *), __VA_ARGS__)
+#  define    Errorc(...)     Error_((void *), __VA_ARGS__)
+#  define     Error(...)     Error_((void *), __VA_ARGS__)
+#  define   Warning(...)   Warning_((void *), __VA_ARGS__)
+#  define  Messagec(...)   Message_((void *), __VA_ARGS__)
+#  define   Message(...)   Message_((void *), __VA_ARGS__)
+#endif
+
+#endif  /* _ERROR_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/extra.h b/libcdi/src/extra.h
new file mode 100644
index 0000000..dd62750
--- /dev/null
+++ b/libcdi/src/extra.h
@@ -0,0 +1,50 @@
+#ifndef _EXTRA_H
+#define _EXTRA_H
+
+#define  EXT_REAL   1
+#define  EXT_COMP   2
+
+
+typedef struct {
+  int    checked;
+  int    byteswap;
+  int    header[4];
+  int    prec;      /* single or double precison */
+  int    number;    /* real or complex */
+  size_t datasize;
+  size_t buffersize;
+  void  *buffer;
+}
+extrec_t;
+
+
+const char *extLibraryVersion(void);
+
+void extDebug(int debug);
+
+int  extCheckFiletype(int fileID, int *swap);
+
+void *extNew(void);
+void extDelete(void *ext);
+
+int  extRead(int fileID, void *ext);
+int  extWrite(int fileID, void *ext);
+
+int  extInqHeader(void *ext, int *header);
+int  extInqDataSP(void *ext, float *data);
+int  extInqDataDP(void *ext, double *data);
+
+int  extDefHeader(void *ext, const int *header);
+int  extDefDataSP(void *ext, const float *data);
+int  extDefDataDP(void *ext, const double *data);
+
+#endif  /* _EXTRA_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/extralib.c b/libcdi/src/extralib.c
new file mode 100644
index 0000000..30b535f
--- /dev/null
+++ b/libcdi/src/extralib.c
@@ -0,0 +1,605 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "dmemory.h"
+
+#include "extra.h"
+#include "error.h"
+#include "file.h"
+#include "binary.h"
+#include "swap.h"
+
+
+#define  SINGLE_PRECISION    4
+#define  DOUBLE_PRECISION    8
+
+#define  EXT_HEADER_LEN      4
+
+
+static int initExtLib       = 0;
+static int extDefaultPrec   = 0;
+static int extDefaultNumber = EXT_REAL;
+
+
+/*
+ * A version string.
+ */
+
+#undef  LIBVERSION
+#define LIBVERSION      1.3.1
+#define XSTRING(x)	#x
+#define STRING(x)	XSTRING(x)
+static const char ext_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
+
+const char *extLibraryVersion(void)
+{
+  return (ext_libvers);
+}
+
+
+int EXT_Debug = 0;    /* If set to 1, debugging */
+
+
+void extDebug(int debug)
+{
+  EXT_Debug = debug;
+
+  if ( EXT_Debug )
+    Message("debug level %d", debug);
+}
+
+
+void extLibInit()
+{
+  char *envString;
+  char *envName = "EXT_PRECISION";
+
+
+  envString = getenv(envName);
+  if ( envString )
+    {
+      int pos = 0;
+
+      if ( strlen(envString) == 2  )
+	{
+	  switch ( tolower((int) envString[pos]) )
+	    {
+	    case 'r':
+	      {
+		extDefaultNumber = EXT_REAL;
+		switch ( (int) envString[pos+1] )
+		  {
+		  case '4': extDefaultPrec = SINGLE_PRECISION; break;
+		  case '8': extDefaultPrec = DOUBLE_PRECISION; break;
+		  default:
+		    Message("Invalid digit in %s: %s", envName, envString);
+		  }
+		break;		
+	      }
+	    case 'c':
+	      {
+		extDefaultNumber = EXT_COMP;
+		switch ( (int) envString[pos+1] )
+		  {
+		  case '4': extDefaultPrec = SINGLE_PRECISION; break;
+		  case '8': extDefaultPrec = DOUBLE_PRECISION; break;
+		  default:
+		    Message("Invalid digit in %s: %s", envName, envString);
+		  }
+		break;		
+	      }
+	    default:
+	      Message("Invalid character in %s: %s", envName, envString);
+	    }
+	}
+    }
+
+  initExtLib = 1;
+}
+
+static
+void extInit(extrec_t *extp)
+{
+  extp->checked    = 0;
+  extp->byteswap   = 0;
+  extp->prec       = 0;
+  extp->number     = extDefaultNumber;
+  extp->datasize   = 0;
+  extp->buffersize = 0;
+  extp->buffer     = NULL;
+}
+
+
+void *extNew(void)
+{
+  extrec_t *extp;
+
+  if ( ! initExtLib ) extLibInit();
+
+  extp = (extrec_t *) malloc(sizeof(extrec_t));
+
+  extInit(extp);
+
+  return ((void*)extp);
+}
+
+
+void extDelete(void *ext)
+{
+  extrec_t *extp = (extrec_t *) ext;
+
+  if ( extp )
+    {
+      if ( extp->buffer ) free(extp->buffer);
+      free(extp);
+    }
+}
+
+
+int extCheckFiletype(int fileID, int *swap)
+{
+  size_t blocklen = 0;
+  size_t sblocklen = 0;
+  size_t data =  0;
+  size_t dimxy = 0;
+  int fact = 0, found = 0;
+  unsigned char buffer[40], *pbuf;
+
+  if ( fileRead(fileID, buffer, 4) != 4 ) return (found);
+
+  blocklen  = (size_t) get_UINT32(buffer);
+  sblocklen = (size_t) get_SUINT32(buffer);
+
+  if ( EXT_Debug )
+    Message("blocklen = %d sblocklen = %d", blocklen, sblocklen);
+
+  if ( blocklen == 16 )
+    {
+     *swap = 0;
+      fact = blocklen/4;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+3*fact;      dimxy = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+blocklen+4;  data  = (size_t) get_UINT32(pbuf);
+    }
+  else if ( blocklen == 32 )
+    {
+     *swap = 0;
+      fact = blocklen/4;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+3*fact;      dimxy = (size_t) get_UINT64(pbuf);
+      pbuf = buffer+blocklen+4;  data  = (size_t) get_UINT32(pbuf);
+    }
+  else if ( sblocklen == 16 )
+    {
+     *swap = 1;
+      fact = sblocklen/4;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+3*fact;       dimxy = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+sblocklen+4;  data  = (size_t) get_SUINT32(pbuf);
+    }
+  else if ( sblocklen == 32 )
+    {
+     *swap = 1;
+      fact = sblocklen/4;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+3*fact;       dimxy = (size_t) get_SUINT64(pbuf);
+      pbuf = buffer+sblocklen+4;  data  = (size_t) get_SUINT32(pbuf);
+    }
+
+  fileRewind(fileID);
+
+  if      ( data && dimxy*fact   == data ) found = 1;
+  else if ( data && dimxy*fact*2 == data ) found = 1;
+
+  if ( EXT_Debug )
+    {
+      Message("swap = %d fact = %d", *swap, fact);
+      Message("dimxy = %lu data = %lu", dimxy, data);
+    }
+
+  return (found);
+}
+
+
+int extInqHeader(void *ext, int *header)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t i;
+
+  for ( i = 0; i < EXT_HEADER_LEN; i++ )
+    header[i] = extp->header[i];
+  
+  if ( EXT_Debug ) Message("datasize = %lu", extp->datasize);
+
+  return (0);
+}
+
+
+int extDefHeader(void *ext, const int *header)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t i;
+
+  for ( i = 0; i < EXT_HEADER_LEN; i++ )
+    extp->header[i] = header[i];
+  
+  extp->datasize = header[3];
+  if ( extp->number == EXT_COMP ) extp->datasize *= 2;
+
+  if ( EXT_Debug ) Message("datasize = %lu", extp->datasize);
+
+  return (0);
+}
+
+
+int extInqData(void *ext, int prec, void *data)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t datasize;
+  size_t i;
+  int ierr = 0;
+  int rprec;
+  void *buffer;
+  int byteswap = extp->byteswap;
+
+  datasize = extp->datasize;
+  buffer   = extp->buffer;
+  rprec    = extp->prec;
+
+  switch ( rprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( sizeof(FLT32) == 4 )
+	  {
+	    if ( byteswap ) swap4byte(buffer, datasize);
+
+	    if ( rprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT32));
+	    else
+	      for ( i = 0; i < datasize; ++i )
+		((double *) data)[i] = (double) ((float *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT32));
+	  }	
+	break;
+      }
+    case DOUBLE_PRECISION:
+	if ( sizeof(FLT64) == 8 )
+	  {
+	    if ( byteswap ) swap8byte(buffer, datasize);
+
+	    if ( rprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT64));
+	    else
+	      for ( i = 0; i < datasize; ++i )
+		((float *) data)[i] = (float) ((double *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT64));
+	  }	
+	break;
+    default:
+      {
+	Error("unexpected data precision %d", rprec);
+      }
+    }
+
+  return (ierr);
+}
+
+
+int extInqDataSP(void *ext, float *data)
+{
+  return (extInqData(ext, SINGLE_PRECISION, (void *) data));
+}
+
+
+int extInqDataDP(void *ext, double *data)
+{
+  return (extInqData(ext, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int extDefData(void *ext, int prec, const void *data)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t datasize;
+  size_t blocklen;
+  size_t buffersize;
+  size_t i;
+  int rprec;
+  int *header;
+  void *buffer;
+
+  if ( extDefaultPrec ) rprec = extDefaultPrec;
+  else                  rprec = extp->prec;
+
+  if ( ! rprec ) rprec = prec;
+
+  extp->prec = rprec;
+
+  header = extp->header;
+
+  datasize = header[3];
+  if ( extp->number == EXT_COMP ) datasize *= 2;
+  blocklen = datasize * rprec;
+
+  extp->datasize = datasize;
+
+  buffersize = extp->buffersize;
+
+  if ( buffersize != blocklen )
+    {
+      buffersize = blocklen;
+      buffer = extp->buffer;
+      buffer = realloc(buffer, buffersize);
+      extp->buffer = buffer;
+      extp->buffersize = buffersize;
+    }
+  else
+    buffer = extp->buffer;
+
+  switch ( rprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( rprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT32));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((float *) buffer)[i] = (float) ((double *) data)[i];
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	if ( rprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT64));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((double *) buffer)[i] = (double) ((float *) data)[i];
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", rprec);
+      }
+    }
+
+  return (0);
+}
+
+
+int extDefDataSP(void *ext, const float *data)
+{
+  return (extDefData(ext, SINGLE_PRECISION, (void *) data));
+}
+
+
+int extDefDataDP(void *ext, const double *data)
+{
+  return (extDefData(ext, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int extRead(int fileID, void *ext)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t blocklen, blocklen2;
+  size_t i;
+  char tempheader[32];
+  int hprec, dprec;
+  void *buffer;
+  int buffersize;
+  int byteswap;
+  int status;
+
+  if ( ! extp->checked )
+    {
+      status = extCheckFiletype(fileID, &extp->byteswap);
+      if ( status == 0 ) Error("Not a EXTRA file!");
+      extp->checked = 1;
+    }
+
+  byteswap = extp->byteswap;
+
+  /* read header record */
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  if ( fileEOF(fileID) ) return (-1);
+
+  if ( EXT_Debug )
+    Message("blocklen = %lu", blocklen);
+
+  hprec = blocklen / EXT_HEADER_LEN;
+
+  extp->prec = hprec;
+
+  switch ( hprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	binReadInt32(fileID, byteswap, EXT_HEADER_LEN, (INT32 *) tempheader);
+
+	for ( i = 0; i < EXT_HEADER_LEN; i++ )
+          extp->header[i] = (int) ((INT32 *) tempheader)[i];
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	binReadInt64(fileID, byteswap, EXT_HEADER_LEN, (INT64 *) tempheader);
+
+	for ( i = 0; i < EXT_HEADER_LEN; i++ )
+          extp->header[i] = (int) ((INT64 *) tempheader)[i];
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected header precision %d", hprec);
+      }
+    }
+
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("header blocklen differ!");
+      return (-1);
+    }
+
+  extp->datasize = extp->header[3];
+
+  if ( EXT_Debug ) Message("datasize = %lu", extp->datasize);
+
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  buffersize = extp->buffersize;
+
+  if ( buffersize < (int) blocklen )
+    {
+      buffersize = blocklen;
+      buffer = extp->buffer;
+      buffer = realloc(buffer, buffersize);
+      extp->buffer = buffer;
+      extp->buffersize = buffersize;
+    }
+  else
+    buffer = extp->buffer;
+
+  dprec = blocklen / extp->datasize;
+
+  if ( dprec == hprec )
+    {
+      extp->number = EXT_REAL;
+    }
+  else if ( dprec == 2*hprec )
+    {
+      dprec /= 2;
+      extp->datasize *= 2;
+      extp->number = EXT_COMP;
+    }
+
+  if ( dprec != SINGLE_PRECISION && dprec != DOUBLE_PRECISION )
+    {
+      Warning("unexpected data precision %d", dprec);
+      return (-1);
+    }
+
+  fileRead(fileID, buffer, blocklen);
+
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("data blocklen differ!");
+      return (-1);
+    }
+
+  return (0);
+}
+
+
+int extWrite(int fileID, void *ext)
+{
+  extrec_t *extp = (extrec_t *) ext;
+  size_t datasize;
+  size_t blocklen;
+  size_t i;
+  int rprec, number;
+  char tempheader[32];
+  int *header;
+  void *buffer;
+  int byteswap = extp->byteswap;
+
+
+  rprec  = extp->prec;
+  number = extp->number;
+  header = extp->header;
+
+  /* write header record */
+  blocklen = EXT_HEADER_LEN * rprec;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  switch ( rprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	for (i = 0; i < EXT_HEADER_LEN; i++)
+          ((INT32 *) tempheader)[i] = (INT32) header[i];
+
+	binWriteInt32(fileID, byteswap, EXT_HEADER_LEN, (INT32 *) tempheader);
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	for (i = 0; i < EXT_HEADER_LEN; i++)
+          ((INT64 *) tempheader)[i] = (INT64) header[i];
+
+	binWriteInt64(fileID, byteswap, EXT_HEADER_LEN, (INT64 *) tempheader);
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected header precision %d", rprec);
+      }
+    }
+  
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  datasize = header[3];
+  if ( number == EXT_COMP ) datasize *= 2;
+  blocklen = datasize * rprec;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  extp->datasize = datasize;
+
+  buffer = extp->buffer;
+
+  switch ( rprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	binWriteFlt32(fileID, byteswap, datasize, (FLT32 *) buffer);
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	binWriteFlt64(fileID, byteswap, datasize, (FLT64 *) buffer);
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", rprec);
+      }
+    }
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  return (0);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/file.c b/libcdi/src/file.c
new file mode 100644
index 0000000..3822729
--- /dev/null
+++ b/libcdi/src/file.c
@@ -0,0 +1,1421 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <assert.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include <ctype.h>
+#include <unistd.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+/*
+size_t getpagesize(void);
+*/
+#include "dmemory.h"
+#include "error.h"
+#include "file.h"
+
+#ifdef USE_MPI
+#include "cdi.h"
+#include "namespace.h"
+#include "pio.h"
+#include "pio_comm.h"
+#include "pio_util.h"
+#endif
+
+#if ! defined(O_BINARY)
+#define O_BINARY 0
+#endif
+
+#ifndef strdupx
+#ifndef strdup
+char *strdup(const char *s);
+#endif
+#define strdupx  strdup
+/*
+#define strdupx(s)                                \
+({                                                \
+   const char *__old = (s);                       \
+   size_t __len = strlen(__old) + 1;              \
+   char *__new = (char *) malloc(__len);          \
+   (char *) memcpy(__new, __old, __len);          \
+})
+*/
+#endif
+
+
+#if defined (HAVE_MMAP)
+#  include <sys/mman.h> /* mmap() is defined in this header */
+#endif
+
+
+#if ! defined   (FALSE)
+#  define  FALSE  0
+#endif
+
+#if ! defined   (TRUE)
+#  define  TRUE   1
+#endif
+
+/* #define  MAX_FILES  FOPEN_MAX */
+#define  MAX_FILES  4096
+
+static int _file_max = MAX_FILES;
+
+static void file_initialize(void);
+
+static int _file_init = FALSE;
+
+#if  defined  (HAVE_LIBPTHREAD)
+#include <pthread.h>
+
+static pthread_once_t  _file_init_thread = PTHREAD_ONCE_INIT;
+static pthread_mutex_t _file_mutex;
+
+#  define FILE_LOCK()         pthread_mutex_lock(&_file_mutex)
+#  define FILE_UNLOCK()       pthread_mutex_unlock(&_file_mutex)
+#  define FILE_INIT()        \
+   if ( _file_init == FALSE ) pthread_once(&_file_init_thread, file_initialize)
+
+#else
+
+#  define FILE_LOCK()
+#  define FILE_UNLOCK()
+#  define FILE_INIT()        \
+   if ( _file_init == FALSE ) file_initialize()
+
+#endif
+
+
+typedef struct
+{
+  int        self;
+  int        flag;           /* access and error flag         */
+  int        eof;            /* end of file flag              */
+  int        fd;             /* file descriptor used for read */
+  FILE      *fp;             /* FILE pointer used for write   */
+  int        mode;           /* file access mode              */
+  char      *name;           /* file name                     */
+  off_t      size;           /* file size                     */
+  off_t      position;       /* file position                 */
+  long       access;         /* file access                   */
+  off_t      byteTrans;      /*                               */
+  size_t     blockSize;      /* file block size               */
+  int        type;           /* file type ( 1:open 2:fopen )  */
+  int        bufferType;     /* buffer type ( 1:std 2:mmap )  */
+  size_t     bufferSize;     /* file buffer size              */
+  size_t     mappedSize;     /* mmap buffer size              */
+  char      *buffer;         /* file buffer                   */
+  long       bufferNumFill;  /* number of buffer fill         */
+  char      *bufferPtr;      /* file buffer pointer           */
+  off_t      bufferPos;
+  off_t      bufferStart;
+  off_t      bufferEnd;
+  size_t     bufferCnt;
+}
+bfile_t;
+
+
+enum F_I_L_E_Flags
+  {
+    FILE_READ  =  01,
+    FILE_WRITE =  02,
+    FILE_UNBUF =  04,
+    FILE_EOF   = 010,
+    FILE_ERROR = 020
+  };
+
+
+static int FileInfo = FALSE;
+
+
+#if ! defined (MIN_BUF_SIZE)
+#  define  MIN_BUF_SIZE  131072L
+#endif
+
+
+static size_t FileBufferSizeMin = MIN_BUF_SIZE;
+static long   FileBufferSizeEnv = -1;
+static int    FileBufferTypeEnv =  0;
+
+static int    FileTypeEnv =  0;
+
+static int    FILE_Debug = 0;   /* If set to 1, debugging */
+
+
+static void file_table_print(void);
+
+/*
+ * A version string.
+ */
+#undef   LIBVERSION
+#define  LIBVERSION      1.8.1
+#define  XSTRING(x)	 #x
+#define  STRING(x) 	 XSTRING(x)
+const char file_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
+
+/*
+  21/05/2004  1.3.2 set min I/O Buffersize to 128k
+  31/05/2005  1.4.0 replace fileTable by _fileList
+  26/08/2005  1.4.1 fileClose with return value
+                    checks for all fileptr
+  01/09/2005  1.5.0 thread safe version
+  06/11/2005  1.5.1 add filePtrEOF, filePtr, filePtrGetc
+  03/02/2006  1.5.2 ansi C: define getpagesize and strdupx
+  27/12/2007  1.6.0 add FILE_TYPE_FOPEN
+  24/03/2008  1.6.1 add O_BINARY if available
+                    remove default HAVE_MMAP
+                    use HAVE_STRUCT_STAT_ST_BLKSIZE
+  22/08/2010  1.7.0 refactor
+  11/11/2010  1.7.1 update for changed interface of error.h
+  02/02/2012  1.8.0 cleanup
+  16/11/2012  1.8.1 added support for unbuffered write
+ */
+
+
+typedef struct _filePtrToIdx {
+  int idx;
+  bfile_t *ptr;
+  struct _filePtrToIdx *next;
+} filePtrToIdx;
+
+
+static filePtrToIdx *_fileList  = NULL;
+static filePtrToIdx *_fileAvail = NULL;
+
+static
+void file_list_new(void)
+{
+  assert(_fileList == NULL);
+
+  _fileList = (filePtrToIdx *) malloc(_file_max*sizeof(filePtrToIdx));
+}
+
+static
+void file_list_delete(void)
+{
+  if ( _fileList )
+    {
+      free(_fileList);
+      _fileList = NULL;
+    }
+}
+
+static
+void file_init_pointer(void)
+{
+  int  i;
+
+  for ( i = 0; i < _file_max; i++ )
+    {
+      _fileList[i].next = _fileList + i + 1;
+      _fileList[i].idx  = i;
+      _fileList[i].ptr  = 0;
+    }
+
+  _fileList[_file_max-1].next = 0;
+
+  _fileAvail = _fileList;
+}
+
+static
+bfile_t *file_to_pointer(int idx)
+{
+  bfile_t *fileptr = NULL;
+
+  FILE_INIT();
+
+  if ( idx >= 0 && idx < _file_max )
+    {
+      FILE_LOCK();
+
+      fileptr = _fileList[idx].ptr;
+
+      FILE_UNLOCK();
+    }
+  else
+    Error("file index %d undefined!", idx);
+
+  return (fileptr);
+}
+
+/* Create an index from a pointer */
+static
+int file_from_pointer(bfile_t *ptr)
+{
+  int      idx = -1;
+  filePtrToIdx *newptr;
+
+  if ( ptr )
+    {
+      FILE_LOCK();
+
+      if ( _fileAvail )
+	{
+	  newptr       = _fileAvail;
+	  _fileAvail   = _fileAvail->next;
+	  newptr->next = 0;
+	  idx	       = newptr->idx;
+	  newptr->ptr  = ptr;
+
+	  if ( FILE_Debug )
+	    Message("Pointer %p has idx %d from file list", ptr, idx);
+	}
+      else
+	Warning("Too many open files (limit is %d)!", _file_max);
+
+      FILE_UNLOCK();
+    }
+  else
+    Error("Internal problem (pointer %p undefined)", ptr);
+
+  return (idx);
+}
+
+static
+void file_init_entry(bfile_t *fileptr)
+{
+  fileptr->self          = file_from_pointer(fileptr);
+
+  fileptr->flag          = 0;
+  fileptr->fd            = -1;
+  fileptr->fp            = NULL;
+  fileptr->mode          = 0;
+  fileptr->size          = 0;
+  fileptr->name          = NULL;
+  fileptr->access        = 0;
+  fileptr->position      = 0;
+  fileptr->byteTrans     = 0;
+  fileptr->type          = 0;
+  fileptr->bufferType    = 0;
+  fileptr->bufferSize    = 0;
+  fileptr->mappedSize    = 0;
+  fileptr->buffer        = NULL;
+  fileptr->bufferNumFill = 0;
+  fileptr->bufferStart   = 0;
+  fileptr->bufferEnd     = -1;
+  fileptr->bufferPos     = 0;
+  fileptr->bufferCnt     = 0;
+  fileptr->bufferPtr     = NULL;
+}
+
+static
+bfile_t *file_new_entry(void)
+{
+  bfile_t *fileptr;
+
+  fileptr = (bfile_t *) malloc(sizeof(bfile_t));
+
+  if ( fileptr ) file_init_entry(fileptr);
+
+  return (fileptr);
+}
+
+static
+void file_delete_entry(bfile_t *fileptr)
+{
+  int idx;
+
+  idx = fileptr->self;
+
+  FILE_LOCK();
+
+  free(fileptr);
+
+  _fileList[idx].next = _fileAvail;
+  _fileList[idx].ptr  = 0;
+  _fileAvail   	      = &_fileList[idx];
+
+  FILE_UNLOCK();
+
+  if ( FILE_Debug )
+    Message("Removed idx %d from file list", idx);
+}
+
+
+const char *fileLibraryVersion(void)
+{
+  return (file_libvers);
+}
+
+
+#ifndef POSIXIO_DEFAULT_PAGESIZE
+#define POSIXIO_DEFAULT_PAGESIZE 4096
+#endif
+
+static
+int pagesize(void)
+{
+#if defined (HAVE_MMAP)
+  return ((int) getpagesize());
+#else
+  return ((int) POSIXIO_DEFAULT_PAGESIZE);
+#endif
+}
+
+
+void fileDebug(int debug)
+{
+  FILE_Debug = debug;
+
+  if ( FILE_Debug )
+    Message("Debug level %d", debug);
+}
+
+
+void *filePtr(int fileID)
+{
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  return (fileptr);
+}
+
+static
+void file_pointer_info(const char *caller, int fileID)
+{
+  if ( FILE_Debug )
+    {
+      fprintf(stdout, "%-18s : ", caller);
+      fprintf(stdout, "The fileID %d underlying pointer is not valid!", fileID);
+      fprintf(stdout, "\n");
+    }
+}
+
+
+int fileSetBufferType(int fileID, int type)
+{
+  int ret = 0;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr )
+    {
+      switch (type)
+	{
+	case FILE_BUFTYPE_STD:
+	case FILE_BUFTYPE_MMAP:
+	  fileptr->bufferType = type;
+	  break;
+	default:
+	  Error("File type %d not implemented!", type);
+	}
+    }
+
+#if ! defined (HAVE_MMAP)
+  if ( type == FILE_BUFTYPE_MMAP ) ret = 1;
+#endif
+
+  return (ret);
+}
+
+
+int fileGetBufferType(int fileID)
+{
+  bfile_t *fileptr;
+  int bufferType = 0;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) bufferType = fileptr->bufferType;
+
+  return (bufferType);
+}
+
+
+int fileFlush(int fileID)
+{
+  bfile_t *fileptr;
+  int retval = 0;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) retval = fflush(fileptr->fp);
+
+  return (retval);
+}
+
+
+void fileClearerr(int fileID)
+{
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr )
+    {
+      if ( fileptr->mode != 'r' )
+	clearerr(fileptr->fp);
+    }
+}
+
+
+int filePtrEOF(void *vfileptr)
+{
+  bfile_t *fileptr = (bfile_t *) vfileptr;
+  int retval = 0;
+
+  if ( fileptr ) retval = (fileptr->flag & FILE_EOF) != 0;
+
+  return (retval);
+}
+
+
+int fileEOF(int fileID)
+{
+  bfile_t *fileptr;
+  int retval = 0;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) retval = (fileptr->flag & FILE_EOF) != 0;
+
+  return (retval);
+}
+
+
+int fileError(int fileID)
+{
+  bfile_t *fileptr;
+  int retval = 0;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) retval = (fileptr->flag & FILE_ERROR) != 0;
+
+  return (retval);
+}
+
+
+void fileRewind(int fileID)
+{
+  fileSetPos(fileID, (off_t) 0, SEEK_SET);
+  fileClearerr(fileID);
+}
+
+
+off_t fileGetPos(int fileID)
+{
+  off_t filepos = 0;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr )
+    {
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	filepos = fileptr->position;
+      else
+	filepos = ftell(fileptr->fp);
+    }
+
+  if ( FILE_Debug ) Message("Position %ld", filepos);
+
+  return (filepos);
+}
+
+
+int fileSetPos(int fileID, off_t offset, int whence)
+{
+  int status = 0;
+  off_t position;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( FILE_Debug ) Message("Offset %8ld  Whence %3d", (long) offset, whence);
+
+  if ( fileptr == 0 )
+    {
+      file_pointer_info(__func__, fileID);
+      return (1);
+    }
+
+  switch (whence)
+    {
+    case SEEK_SET:
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	{
+	  position = offset;
+	  fileptr->position = position;
+	  if ( position < fileptr->bufferStart || position > fileptr->bufferEnd )
+	    {
+	      if ( fileptr->bufferType == FILE_BUFTYPE_STD )
+		fileptr->bufferPos = position;
+	      else
+		fileptr->bufferPos = position - position % pagesize();
+
+	      fileptr->bufferCnt = 0;
+	      fileptr->bufferPtr = NULL;
+	    }
+	  else
+	    {
+	      if ( fileptr->bufferPos != fileptr->bufferEnd + 1 )
+		{
+		  if ( FILE_Debug )
+		    Message("Reset buffer pos from %ld to %ld",
+			    fileptr->bufferPos, fileptr->bufferEnd + 1);
+
+		  fileptr->bufferPos = fileptr->bufferEnd + 1;
+		}
+	      fileptr->bufferCnt = fileptr->bufferEnd - position + 1;
+	      fileptr->bufferPtr = fileptr->buffer + position - fileptr->bufferStart;
+	    }
+	}
+      else
+	{
+	  status = fseek(fileptr->fp, offset, whence);
+	}
+      break;
+    case SEEK_CUR:
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	{
+	  fileptr->position += offset;
+	  position = fileptr->position;
+	  if ( position < fileptr->bufferStart || position > fileptr->bufferEnd )
+	    {
+	      if ( fileptr->bufferType == FILE_BUFTYPE_STD )
+		fileptr->bufferPos = position;
+	      else
+		fileptr->bufferPos = position - position % pagesize();
+
+	      fileptr->bufferCnt = 0;
+	      fileptr->bufferPtr = NULL;
+	    }
+	  else
+	    {
+	      if ( fileptr->bufferPos != fileptr->bufferEnd + 1 )
+		{
+		  if ( FILE_Debug )
+		    Message("Reset buffer pos from %ld to %ld",
+			    fileptr->bufferPos, fileptr->bufferEnd + 1);
+
+		  fileptr->bufferPos = fileptr->bufferEnd + 1;
+		}
+	      fileptr->bufferCnt -= offset;
+	      fileptr->bufferPtr += offset;
+	    }
+	}
+      else
+	{
+	  status = fseek(fileptr->fp, offset, whence);
+	}
+      break;
+    default:
+      Error("Whence = %d not implemented", whence);
+    }
+
+  if ( fileptr->position < fileptr->size )
+    if ( (fileptr->flag & FILE_EOF) != 0 )
+      fileptr->flag -= FILE_EOF;
+
+  return (status);
+}
+
+static
+void file_table_print(void)
+{
+  int fileID;
+  int lprintHeader = 1;
+  bfile_t *fileptr;
+
+  for ( fileID = 0; fileID < _file_max; fileID++ )
+    {
+      fileptr = file_to_pointer(fileID);
+
+      if ( fileptr )
+	{
+	  if ( lprintHeader )
+	    {
+	      fprintf(stderr, "\nFile table:\n");
+	      fprintf(stderr, "+-----+---------+");
+	      fprintf(stderr, "----------------------------------------------------+\n");
+	      fprintf(stderr, "|  ID |  Mode   |");
+	      fprintf(stderr, "  Name                                              |\n");
+	      fprintf(stderr, "+-----+---------+");
+	      fprintf(stderr, "----------------------------------------------------+\n");
+	      lprintHeader = 0;
+	    }
+
+	  fprintf(stderr, "| %3d | ", fileID);
+
+	  switch ( fileptr->mode )
+	    {
+	    case 'r':
+	      fprintf(stderr, "read   ");
+	      break;
+	    case 'w':
+	      fprintf(stderr, "write  ");
+	      break;
+	    case 'a':
+	      fprintf(stderr, "append ");
+	      break;
+	    default:
+	      fprintf(stderr, "unknown");
+	    }
+
+          fprintf(stderr, " | %-51s|\n", fileptr->name);
+	}
+    }
+
+  if ( lprintHeader == 0 )
+    {
+      fprintf(stderr, "+-----+---------+");
+      fprintf(stderr, "----------------------------------------------------+\n");
+    }
+}
+
+
+char *fileInqName(int fileID)
+{
+  bfile_t *fileptr;
+  char *name = NULL;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) name = fileptr->name;
+
+  return (name);
+}
+
+
+int fileInqMode(int fileID)
+{
+  bfile_t *fileptr;
+  int mode = 0;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) mode = fileptr->mode;
+
+  return (mode);
+}
+
+static
+long file_getenv(const char *envName)
+{
+  char *envString;
+  long envValue = -1;
+  long fact = 1;
+
+  envString = getenv(envName);
+
+  if ( envString )
+    {
+      int loop;
+
+      for ( loop = 0; loop < (int) strlen(envString); loop++ )
+	{
+	  if ( ! isdigit((int) envString[loop]) )
+	    {
+	      switch ( tolower((int) envString[loop]) )
+		{
+		case 'k':  fact =       1024;  break;
+		case 'm':  fact =    1048576;  break;
+		case 'g':  fact = 1073741824;  break;
+		default:
+		  fact = 0;
+		  Message("Invalid number string in %s: %s", envName, envString);
+		  Warning("%s must comprise only digits [0-9].",envName);
+		}
+	      break;
+	    }
+	}
+
+      if ( fact ) envValue = fact*atol(envString);
+
+      if ( FILE_Debug ) Message("Set %s to %ld", envName, envValue);
+    }
+
+  return (envValue);
+}
+
+static
+void file_initialize(void)
+{
+  long value;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  /* initialize global API mutex lock */
+  pthread_mutex_init(&_file_mutex, NULL);
+#endif
+
+  value = file_getenv("FILE_DEBUG");
+  if ( value >= 0 ) FILE_Debug = (int) value;
+
+  value = file_getenv("FILE_MAX");
+  if ( value >= 0 ) _file_max = (int) value;
+
+  if ( FILE_Debug )
+    Message("FILE_MAX = %d", _file_max);
+
+  FileInfo = (int) file_getenv("FILE_INFO");
+
+  value  = file_getenv("FILE_BUFSIZE");
+  if ( value >= 0 ) FileBufferSizeEnv = value;
+  else
+    {
+      value  = file_getenv("GRIB_API_IO_BUFFER_SIZE");
+      if ( value >= 0 ) FileBufferSizeEnv = value;
+    }
+
+  value = file_getenv("FILE_TYPE");
+  if ( value > 0 )
+    {
+      switch (value)
+	{
+	case FILE_TYPE_OPEN:
+	case FILE_TYPE_FOPEN:
+	  FileTypeEnv = value;
+	  break;
+	default:
+	  Warning("File type %d not implemented!", value);
+	}
+    }
+
+  value = file_getenv("FILE_BUFTYPE");
+#if ! defined (HAVE_MMAP)
+  if ( value == FILE_BUFTYPE_MMAP )
+    {
+      Warning("MMAP not available!");
+      value = 0;
+    }
+#endif
+  if ( value > 0 )
+    {
+      switch (value)
+	{
+	case FILE_BUFTYPE_STD:
+	case FILE_BUFTYPE_MMAP:
+	  FileBufferTypeEnv = value;
+	  break;
+	default:
+	  Warning("File buffer type %d not implemented!", value);
+	}
+    }
+
+  file_list_new();
+  atexit(file_list_delete);
+
+  FILE_LOCK();
+
+  file_init_pointer();
+
+  FILE_UNLOCK();
+
+  if ( FILE_Debug ) atexit(file_table_print);
+
+  _file_init = TRUE;
+}
+
+static
+void file_set_buffer(bfile_t *fileptr)
+{
+  size_t buffersize = 0;
+
+  if ( fileptr->mode == 'r' )
+    {
+      if ( FileBufferTypeEnv )
+	fileptr->bufferType = FileBufferTypeEnv;
+      else if ( fileptr->bufferType == 0 )
+	fileptr->bufferType = FILE_BUFTYPE_STD;
+
+      if ( FileBufferSizeEnv >= 0 )
+	buffersize = (size_t) FileBufferSizeEnv;
+      else if ( fileptr->bufferSize > 0 )
+	buffersize = fileptr->bufferSize;
+      else
+	{
+	  buffersize = fileptr->blockSize * 4;
+	  if ( buffersize < FileBufferSizeMin ) buffersize = FileBufferSizeMin;
+	}
+
+      if ( (size_t) fileptr->size < buffersize )
+	buffersize = (size_t) fileptr->size;
+
+      if ( fileptr->bufferType == FILE_BUFTYPE_MMAP )
+	{
+	  size_t blocksize = (size_t) pagesize();
+	  size_t minblocksize = 4 * blocksize;
+	  buffersize = buffersize - buffersize % minblocksize;
+
+	  if ( buffersize < (size_t) fileptr->size && buffersize < minblocksize )
+	    buffersize = minblocksize;
+	}
+
+      if ( buffersize == 0 ) buffersize = 1;
+    }
+  else
+    {
+      fileptr->bufferType = FILE_BUFTYPE_STD;
+
+      if ( FileBufferSizeEnv >= 0 )
+	buffersize = (size_t) FileBufferSizeEnv;
+      else if ( fileptr->bufferSize > 0 )
+	buffersize = fileptr->bufferSize;
+      else
+	{
+	  buffersize = fileptr->blockSize * 4;
+	  if ( buffersize < FileBufferSizeMin ) buffersize = FileBufferSizeMin;
+	}
+    }
+
+  if ( fileptr->bufferType == FILE_BUFTYPE_STD || fileptr->type == FILE_TYPE_FOPEN )
+    {
+      if ( buffersize > 0 )
+        {
+          fileptr->buffer = (char *) malloc(buffersize);
+          if ( fileptr->buffer == NULL )
+            SysError("Allocation of file buffer failed!");
+        }
+    }
+
+  if ( fileptr->type == FILE_TYPE_FOPEN )
+    if ( setvbuf(fileptr->fp, fileptr->buffer, fileptr->buffer ? _IOFBF : _IONBF, buffersize) )
+      SysError("setvbuf failed!");
+
+  fileptr->bufferSize = buffersize;
+}
+
+static
+int file_fill_buffer(bfile_t *fileptr)
+{
+  long nread;
+  int fd;
+  int ret;
+  long offset = 0;
+  off_t retseek;
+
+  if ( FILE_Debug )
+    Message("file ptr = %p  Cnt = %ld", fileptr, fileptr->bufferCnt);
+
+  if ( (fileptr->flag & FILE_EOF) != 0 ) return (EOF);
+
+  if ( fileptr->buffer == NULL ) file_set_buffer(fileptr);
+
+  if ( fileptr->bufferSize == 0 ) return (EOF);
+
+  fd = fileptr->fd;
+
+#if defined (HAVE_MMAP)
+  if ( fileptr->bufferType == FILE_BUFTYPE_MMAP )
+    {
+      if ( fileptr->bufferPos >= fileptr->size )
+	{
+	  nread = 0;
+	}
+      else
+	{
+	  nread = fileptr->bufferSize;
+	  if ( (nread + fileptr->bufferPos) > fileptr->size )
+	    nread = fileptr->size - fileptr->bufferPos;
+
+	  if ( fileptr->buffer )
+	    {
+	      ret = munmap(fileptr->buffer, fileptr->mappedSize);
+	      if ( ret == -1 )
+		SysError("munmap error for read %s", fileptr->name);
+	      fileptr->buffer = NULL;
+	    }
+
+	  fileptr->mappedSize = (size_t) nread;
+
+	  fileptr->buffer =
+            (char *) mmap(0, (size_t) nread, PROT_READ, MAP_SHARED, fd, fileptr->bufferPos);
+
+	  if ( fileptr->buffer == (void *)-1 )
+	    SysError("mmap error for read %s", fileptr->name);
+
+	  offset = fileptr->position - fileptr->bufferPos;
+	}
+    }
+  else
+#endif
+    {
+      retseek = lseek(fileptr->fd, fileptr->bufferPos, SEEK_SET);
+      if ( retseek == (off_t)-1 )
+	SysError("lseek error at pos %ld file %s", (long) fileptr->bufferPos, fileptr->name);
+
+      nread = (long) read(fd, fileptr->buffer, fileptr->bufferSize);
+    }
+
+  if ( nread <= 0 )
+    {
+      if ( nread == 0 )
+	fileptr->flag |= FILE_EOF;
+      else
+	fileptr->flag |= FILE_ERROR;
+
+      fileptr->bufferCnt = 0;
+      return (EOF);
+    }
+
+  fileptr->bufferPtr = fileptr->buffer;
+  fileptr->bufferCnt = nread;
+
+  fileptr->bufferStart = fileptr->bufferPos;
+  fileptr->bufferPos  += nread;
+  fileptr->bufferEnd   = fileptr->bufferPos - 1;
+
+  if ( FILE_Debug )
+    {
+      Message("fileID = %d  Val     = %d",  fileptr->self, (int) fileptr->buffer[0]);
+      Message("fileID = %d  Start   = %ld", fileptr->self, fileptr->bufferStart);
+      Message("fileID = %d  End     = %ld", fileptr->self, fileptr->bufferEnd);
+      Message("fileID = %d  nread   = %ld", fileptr->self, nread);
+      Message("fileID = %d  offset  = %ld", fileptr->self, offset);
+      Message("fileID = %d  Pos     = %ld", fileptr->self, fileptr->bufferPos);
+      Message("fileID = %d  postion = %ld", fileptr->self, fileptr->position);
+    }
+
+  if ( offset > 0 )
+    {
+      if ( offset > nread )
+	Error("Internal problem with buffer handling. nread = %d offset = %d", nread, offset);
+
+      fileptr->bufferPtr += offset;
+      fileptr->bufferCnt -= offset;
+    }
+
+  fileptr->bufferNumFill++;
+
+  return ((unsigned char) *fileptr->bufferPtr);
+}
+
+static
+void file_copy_from_buffer(bfile_t *fileptr, void *ptr, size_t size)
+{
+  if ( FILE_Debug )
+    Message("size = %ld  Cnt = %ld", size, fileptr->bufferCnt);
+
+  if ( fileptr->bufferCnt < size )
+    Error("Buffer too small. bufferCnt = %d", fileptr->bufferCnt);
+
+  if ( size == 1 )
+    {
+      ((char *)ptr)[0] = fileptr->bufferPtr[0];
+
+      fileptr->bufferPtr++;
+      fileptr->bufferCnt--;
+    }
+  else
+    {
+      memcpy(ptr, fileptr->bufferPtr, size);
+
+      fileptr->bufferPtr += size;
+      fileptr->bufferCnt -= size;
+    }
+}
+
+static
+size_t file_read_from_buffer(bfile_t *fileptr, void *ptr, size_t size)
+{
+  size_t nread, rsize;
+  size_t offset = 0;
+
+  if ( FILE_Debug )
+    Message("size = %ld  Cnt = %d", size, (int) fileptr->bufferCnt);
+
+  if ( ((int)fileptr->bufferCnt) < 0 )
+    Error("Internal problem. bufferCnt = %d", (int) fileptr->bufferCnt);
+
+  rsize = size;
+
+  while ( fileptr->bufferCnt < rsize )
+    {
+      nread = fileptr->bufferCnt;
+      /*
+      fprintf(stderr, "rsize = %d nread = %d\n", (int) rsize, (int) nread);
+      */
+      if ( nread > (size_t) 0 )
+	file_copy_from_buffer(fileptr, (char *)ptr+offset, nread);
+      offset += nread;
+      if ( nread < rsize )
+	rsize -= nread;
+      else
+	rsize = 0;
+
+      if ( file_fill_buffer(fileptr) == EOF ) break;
+    }
+
+  nread = size - offset;
+
+  if ( fileptr->bufferCnt < nread ) nread = fileptr->bufferCnt;
+
+  if ( nread > (unsigned) 0 )
+    file_copy_from_buffer(fileptr, (char *)ptr+offset, nread);
+
+  return (nread+offset);
+}
+
+
+void fileSetBufferSize(int fileID, long buffersize)
+{
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr ) fileptr->bufferSize = buffersize;
+}
+
+/*
+ *   Open a file. Returns file ID, or -1 on error
+ */
+int fileOpen(const char *filename, const char *mode)
+{
+  FILE *fp = NULL;    /* file pointer    (used for write) */
+  int fd = -1;        /* file descriptor (used for read)  */
+  int fileID = FILE_UNDEFID;
+  int fmode = 0;
+  struct stat filestat;
+  bfile_t *fileptr = NULL;
+
+#ifdef USE_MPI
+  if ( mode[0] == 'w' && commInqIOMode () != PIO_NONE )
+      return pioFileOpenW ( filename );
+#endif
+
+  FILE_INIT();
+
+  fmode = tolower((int) mode[0]);
+
+  switch ( fmode )
+    {
+    case 'r':
+      if ( FileTypeEnv == FILE_TYPE_FOPEN )
+	fp = fopen(filename, "rb");
+      else
+	fd =  open(filename, O_RDONLY | O_BINARY);
+      break;
+    case 'x':  fp = fopen(filename, "rb");      break;
+    case 'w':  fp = fopen(filename, "wb");      break;
+    case 'a':  fp = fopen(filename, "ab");      break;
+    default:   Error("Mode %c unexpected!", fmode);
+    }
+
+  if ( FILE_Debug )
+    if ( fp == NULL && fd == -1 )
+      Message("Open failed on %s mode %c errno %d", filename, fmode, errno);
+
+  if ( fp )
+    {
+      if ( stat(filename, &filestat) != 0 ) return (fileID);
+
+      fileptr = file_new_entry();
+      if ( fileptr )
+	{
+	  fileID = fileptr->self;
+	  fileptr->fp = fp;
+	}
+    }
+  else if ( fd >= 0 )
+    {
+      if ( fstat(fd, &filestat) != 0 ) return (fileID);
+
+      fileptr = file_new_entry();
+      if ( fileptr )
+	{
+	  fileID = fileptr->self;
+	  fileptr->fd = fd;
+	}
+    }
+
+  if ( fileID >= 0 )
+    {
+      fileptr->mode = fmode;
+      fileptr->name = strdupx(filename);
+
+#if defined (HAVE_STRUCT_STAT_ST_BLKSIZE)
+      fileptr->blockSize = (size_t) filestat.st_blksize;
+#else
+      fileptr->blockSize = (size_t) 4096;
+#endif
+
+      if ( fmode == 'r' )
+	{
+	  if ( FileTypeEnv == FILE_TYPE_FOPEN )
+	    fileptr->type = FILE_TYPE_FOPEN;
+	  else
+	    fileptr->type = FILE_TYPE_OPEN;
+	}
+      else
+	fileptr->type = FILE_TYPE_FOPEN;
+
+      if ( fmode == 'r' ) fileptr->size = filestat.st_size;
+
+      if ( fileptr->type == FILE_TYPE_FOPEN ) file_set_buffer(fileptr);
+
+      if ( FILE_Debug )
+	Message("File %s opened with ID %d", filename, fileID);
+    }
+
+  return (fileID);
+}
+
+/*
+ *   Close a file.
+ */
+int fileClose(int fileID)
+{
+  char *name;
+  int ret;
+  char *fbtname[] = {"unknown", "standard", "mmap"};
+  char *ftname[] = {"unknown", "open", "fopen"};
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+#ifdef USE_MPI
+  if (((fileptr && fileptr->mode == 'w') || !fileptr)
+      && commInqIOMode () != PIO_NONE )
+    return pioFileClose ( fileID );
+#endif
+
+  if ( fileptr == NULL )
+    {
+      file_pointer_info(__func__, fileID);
+      return (1);
+    }
+
+  name = fileptr->name;
+
+  if ( FILE_Debug )
+    Message("fileID = %d  filename = %s", fileID, name);
+
+  if ( FileInfo > 0 )
+    {
+      fprintf(stderr, "____________________________________________\n");
+      fprintf(stderr, " file ID          : %d\n",  fileID);
+      fprintf(stderr, " file name        : %s\n",  fileptr->name);
+      fprintf(stderr, " file type        : %d (%s)\n", fileptr->type, ftname[fileptr->type]);
+
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	fprintf(stderr, " file descriptor  : %d\n",  fileptr->fd);
+      else
+	fprintf(stderr, " file pointer     : %p\n",  (void *) fileptr->fp);
+
+      fprintf(stderr, " file mode        : %c\n",  fileptr->mode);
+
+      if ( sizeof(off_t) > sizeof(long) )
+	{
+#if defined (_WIN32)
+	  fprintf(stderr, " file size        : %I64d\n", (long long) fileptr->size);
+	  if ( fileptr->type == FILE_TYPE_OPEN )
+	    fprintf(stderr, " file position    : %I64d\n", (long long) fileptr->position);
+	  fprintf(stderr, " bytes transfered : %I64d\n", (long long) fileptr->byteTrans);
+#else
+	  fprintf(stderr, " file size        : %lld\n", (long long) fileptr->size);
+	  if ( fileptr->type == FILE_TYPE_OPEN )
+	    fprintf(stderr, " file position    : %lld\n", (long long) fileptr->position);
+	  fprintf(stderr, " bytes transfered : %lld\n", (long long) fileptr->byteTrans);
+#endif
+	}
+      else
+	{
+	  fprintf(stderr, " file size        : %ld\n", (long) fileptr->size);
+	  if ( fileptr->type == FILE_TYPE_OPEN )
+	    fprintf(stderr, " file position    : %ld\n", (long) fileptr->position);
+	  fprintf(stderr, " bytes transfered : %ld\n", (long) fileptr->byteTrans);
+	}
+
+      fprintf(stderr, " file access      : %ld\n", fileptr->access);
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	{
+	  fprintf(stderr, " buffer type      : %d (%s)\n", fileptr->bufferType, fbtname[fileptr->bufferType]);
+	  fprintf(stderr, " num buffer fill  : %ld\n", fileptr->bufferNumFill);
+	}
+      fprintf(stderr, " buffer size      : %lu\n", (unsigned long) fileptr->bufferSize);
+      fprintf(stderr, " block size       : %lu\n", (unsigned long) fileptr->blockSize);
+#if defined (HAVE_MMAP)
+      fprintf(stderr, " page size        : %d\n",  pagesize());
+#endif
+      fprintf(stderr, "--------------------------------------------\n");
+    }
+
+  if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+    {
+#if defined (HAVE_MMAP)
+      if ( fileptr->buffer && fileptr->mappedSize )
+	{
+	  ret = munmap(fileptr->buffer, fileptr->mappedSize);
+	  if ( ret == -1 )
+	    SysError("munmap error for close %s", fileptr->name);
+	  fileptr->buffer = NULL;
+	}
+#endif
+      ret = close(fileptr->fd);
+      if ( ret == -1 )
+	SysError("EOF returned for close of %s!", name);
+    }
+  else
+    {
+      ret = fclose(fileptr->fp);
+      if ( ret == EOF )
+	SysError("EOF returned for close of %s!", name);
+    }
+
+  if ( fileptr->name )    free((void*) fileptr->name);
+  if ( fileptr->buffer )  free((void*) fileptr->buffer);
+
+  file_delete_entry(fileptr);
+
+  return (0);
+}
+
+
+int filePtrGetc(void *vfileptr)
+{
+  int ivalue = EOF;
+  int fillret = 0;
+  bfile_t *fileptr = (bfile_t *) vfileptr;
+
+  if ( fileptr )
+    {
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	{
+	  if ( fileptr->bufferCnt == 0 ) fillret = file_fill_buffer(fileptr);
+
+	  if ( fillret >= 0 )
+	    {
+	      ivalue = (unsigned char) *fileptr->bufferPtr++;
+	      fileptr->bufferCnt--;
+	      fileptr->position++;
+
+	      fileptr->byteTrans++;
+	      fileptr->access++;
+	    }
+	}
+      else
+	{
+	  ivalue = fgetc(fileptr->fp);
+	  if ( ivalue >= 0 )
+	    {
+	      fileptr->byteTrans++;
+	      fileptr->access++;
+	    }
+	  else
+	    fileptr->flag |= FILE_EOF;
+	}
+    }
+
+  return (ivalue);
+}
+
+
+int fileGetc(int fileID)
+{
+  int ivalue;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  ivalue = filePtrGetc((void *)fileptr);
+
+  return (ivalue);
+}
+
+
+size_t filePtrRead(void *vfileptr, void *restrict ptr, size_t size)
+{
+  size_t nread = 0;
+  bfile_t *fileptr = (bfile_t *) vfileptr;
+
+  if ( fileptr )
+    {
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	nread = file_read_from_buffer(fileptr, ptr, size);
+      else
+	{
+	  nread = fread(ptr, 1, size, fileptr->fp);
+	  if ( nread != size )
+	    {
+	      if ( nread == 0 )
+		fileptr->flag |= FILE_EOF;
+	      else
+		fileptr->flag |= FILE_ERROR;
+	    }
+	}
+
+      fileptr->position  += nread;
+      fileptr->byteTrans += nread;
+      fileptr->access++;
+    }
+
+  if ( FILE_Debug ) Message("size %ld  nread %ld", size, nread);
+
+  return (nread);
+}
+
+
+size_t fileRead(int fileID, void *restrict ptr, size_t size)
+{
+  size_t nread = 0;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr )
+    {
+      if ( fileptr->mode == 'r' && fileptr->type == FILE_TYPE_OPEN )
+	nread = file_read_from_buffer(fileptr, ptr, size);
+      else
+	{
+	  nread = fread(ptr, 1, size, fileptr->fp);
+	  if ( nread != size )
+	    {
+	      if ( nread == 0 )
+		fileptr->flag |= FILE_EOF;
+	      else
+		fileptr->flag |= FILE_ERROR;
+	    }
+	}
+
+      fileptr->position  += nread;
+      fileptr->byteTrans += nread;
+      fileptr->access++;
+    }
+
+  if ( FILE_Debug ) Message("size %ld  nread %ld", size, nread);
+
+  return (nread);
+}
+
+
+size_t fileWrite(int fileID, const void *restrict ptr, size_t size)
+{
+  size_t nwrite = 0;
+  FILE *fp;
+  bfile_t *fileptr;
+
+  fileptr = file_to_pointer(fileID);
+
+  if ( fileptr )
+    {
+      /* if ( fileptr->buffer == NULL ) file_set_buffer(fileptr); */
+
+      fp = fileptr->fp;
+
+      nwrite = fwrite(ptr, 1, size, fp);
+
+      fileptr->position  += nwrite;
+      fileptr->byteTrans += nwrite;
+      fileptr->access++;
+    }
+
+  return (nwrite);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/file.h b/libcdi/src/file.h
new file mode 100644
index 0000000..086b588
--- /dev/null
+++ b/libcdi/src/file.h
@@ -0,0 +1,58 @@
+#ifndef _FILE_H
+#define _FILE_H
+
+#include <stdio.h>
+#include <sys/types.h>
+
+
+#define  FILE_UNDEFID      -1
+
+#define  FILE_TYPE_OPEN     1
+#define  FILE_TYPE_FOPEN    2
+
+/* buffer types for FILE_TYPE_OPEN */
+#define  FILE_BUFTYPE_STD   1
+#define  FILE_BUFTYPE_MMAP  2
+
+const
+char  *fileLibraryVersion(void);
+
+void   fileDebug(int debug);
+
+void  *filePtr(int fileID);
+
+int    fileSetBufferType(int fileID, int type);
+void   fileSetBufferSize(int fileID, long buffersize);
+
+int    fileOpen(const char *filename, const char *mode);
+int    fileClose(int fileID);
+
+char  *fileInqName(int fileID);
+int    fileInqMode(int fileID);
+
+int    fileFlush(int fileID);
+void   fileClearerr(int fileID);
+int    fileEOF(int fileID);
+int    filePtrEOF(void *fileptr);
+void   fileRewind(int fileID);
+
+off_t  fileGetPos(int fileID);
+int    fileSetPos(int fileID, off_t offset, int whence);
+
+int    fileGetc(int fileID);
+int    filePtrGetc(void *fileptr);
+
+size_t filePtrRead(void *fileptr, void *restrict ptr, size_t size);
+size_t fileRead(int fileID, void *restrict ptr, size_t size);
+size_t fileWrite(int fileID, const void *restrict ptr, size_t size);
+
+#endif  /* _FILE_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/gaussgrid.c b/libcdi/src/gaussgrid.c
new file mode 100644
index 0000000..485a848
--- /dev/null
+++ b/libcdi/src/gaussgrid.c
@@ -0,0 +1,341 @@
+#include <math.h>
+#include <float.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "dmemory.h"
+
+#ifndef  M_PI
+#define  M_PI        3.14159265358979323846  /* pi */
+#endif
+
+#ifndef  M_SQRT2
+#define  M_SQRT2     1.41421356237309504880
+#endif
+
+
+static
+void cpledn(int kn, int kodd, double *pfn, double pdx, int kflag, 
+            double *pw, double *pdxn, double *pxmod)
+{
+  double zdlk;
+  double zdlldn;
+  double zdlx;
+  double zdlmod;
+  double zdlxn;
+
+  int ik, jn;
+
+  /* 1.0 Newton iteration step */
+
+  zdlx = pdx;
+  zdlk = 0.0;
+  if (kodd == 0) 
+    {
+      zdlk = 0.5*pfn[0];
+    }
+  zdlxn  = 0.0;
+  zdlldn = 0.0;
+
+  ik = 1;
+
+  if (kflag == 0) 
+    {
+      for(jn = 2-kodd; jn <= kn; jn += 2) 
+	{
+	  /* normalised ordinary Legendre polynomial == \overbar{p_n}^0 */
+	  zdlk   = zdlk + pfn[ik]*cos((double)(jn)*zdlx);
+	  /* normalised derivative == d/d\theta(\overbar{p_n}^0) */
+	  zdlldn = zdlldn - pfn[ik]*(double)(jn)*sin((double)(jn)*zdlx);
+	  ik++;
+	}
+      /* Newton method */
+      zdlmod = -(zdlk/zdlldn);
+      zdlxn = zdlx + zdlmod;
+      *pdxn = zdlxn;
+      *pxmod = zdlmod;
+    }
+
+  /* 2.0 Compute weights */
+
+  if (kflag == 1) 
+    {
+      for(jn = 2-kodd; jn <= kn; jn += 2) 
+	{
+	  /* normalised derivative */
+	  zdlldn = zdlldn - pfn[ik]*(double)(jn)*sin((double)(jn)*zdlx);
+	  ik++;
+	}
+      *pw = (double)(2*kn+1)/(zdlldn*zdlldn);
+    }
+
+  return;
+}
+
+static
+void gawl(double *pfn, double *pl, double *pw, int kn, int *kiter)
+{
+  int iodd;
+  double pmod = 0;
+  int iflag;
+  int itemax;
+  int jter;
+  double zw = 0;
+  double zdlx;
+  double zdlxn = 0;
+
+  /* 1.0 Initizialization */
+
+  iflag  =  0;
+  itemax = 20;
+
+  iodd   = (kn % 2);
+
+  zdlx   =  *pl;
+
+  /* 2.0 Newton iteration */
+
+  for (jter = 1; jter <= itemax+1; jter++) 
+    {
+      *kiter = jter;
+      cpledn(kn, iodd, pfn, zdlx, iflag, &zw, &zdlxn, &pmod);
+      zdlx = zdlxn;
+      if (iflag == 1) break;
+      if (fabs(pmod) <= DBL_EPSILON*1000.0) iflag = 1;
+    }
+
+  *pl = zdlxn;
+  *pw = zw;
+
+  return;
+}
+
+static
+void gauaw(int kn, double *pl, double *pw)
+{
+  /*
+   * 1.0 Initialize Fourier coefficients for ordinary Legendre polynomials
+   *
+   * Belousov, Swarztrauber, and ECHAM use zfn(0,0) = sqrt(2)
+   * IFS normalisation chosen to be 0.5*Integral(Pnm**2) = 1 (zfn(0,0) = 2.0)
+   */
+  double *zfn, *zfnlat;
+
+  double z, zfnn;
+
+  int *iter;
+
+  int ik, ins2, isym, jgl, jglm1, jn, iodd;
+
+  iter   = (int *)    malloc(kn*sizeof(int));
+  zfn    = (double *) malloc((kn+1)*(kn+1)*sizeof(double));
+  zfnlat = (double *) malloc((kn/2+1+1)*sizeof(double));  
+
+  zfn[0] = M_SQRT2;
+  for (jn = 1; jn <= kn; jn++)
+    {
+      zfnn = zfn[0];
+      for (jgl = 1; jgl <= jn; jgl++)
+	{
+	  zfnn *= sqrt(1.0-0.25/((double)(jgl*jgl))); 
+	}
+
+      zfn[jn*(kn+1)+jn] = zfnn;
+
+      iodd = jn % 2;
+      for (jgl = 2; jgl <= jn-iodd; jgl += 2) 
+	{
+	  zfn[jn*(kn+1)+jn-jgl] = zfn[jn*(kn+1)+jn-jgl+2]
+	    *((double)((jgl-1)*(2*jn-jgl+2)))/((double)(jgl*(2*jn-jgl+1)));
+	}
+    }
+
+
+  /* 2.0 Gaussian latitudes and weights */
+
+  iodd = kn % 2;
+  ik = iodd;
+  for (jgl = iodd; jgl <= kn; jgl += 2)
+    {
+      zfnlat[ik] = zfn[kn*(kn+1)+jgl];
+      ik++;
+    } 
+
+  /*
+   * 2.1 Find first approximation of the roots of the
+   *     Legendre polynomial of degree kn.
+   */
+
+  ins2 = kn/2+(kn % 2);
+
+  for (jgl = 1; jgl <= ins2; jgl++) 
+    {
+      z = ((double)(4*jgl-1))*M_PI/((double)(4*kn+2)); 
+      pl[jgl-1] = z+1.0/(tan(z)*((double)(8*kn*kn)));
+    }
+
+  /* 2.2 Computes roots and weights for transformed theta */
+
+  for (jgl = ins2; jgl >= 1 ; jgl--) 
+    {
+      jglm1 = jgl-1;
+      gawl(zfnlat, &(pl[jglm1]), &(pw[jglm1]), kn, &(iter[jglm1]));
+    }
+
+  /* convert to physical latitude */
+
+  for (jgl = 0; jgl < ins2; jgl++) 
+    {
+      pl[jgl] = cos(pl[jgl]);
+    }
+
+  for (jgl = 1; jgl <= kn/2; jgl++) 
+    {
+      jglm1 = jgl-1;
+      isym =  kn-jgl;
+      pl[isym] =  -pl[jglm1];
+      pw[isym] =  pw[jglm1];
+    }
+
+  free(zfnlat);
+  free(zfn);
+  free(iter);
+
+  return;
+}
+
+#if 0
+static
+void gauaw_old(double *pa, double *pw, int nlat)
+{
+  /*
+   * Compute Gaussian latitudes.  On return pa contains the
+   * sine of the latitudes starting closest to the north pole and going
+   * toward the south
+   *
+   */
+
+  const int itemax = 20;
+
+  int isym, iter, ins2, jn, j;
+  double za, zw, zan;
+  double z, zk, zkm1, zkm2, zx, zxn, zldn, zmod;
+
+  /*
+   * Perform the Newton loop
+   * Find 0 of Legendre polynomial with Newton loop
+   */
+
+  ins2 = nlat/2 + nlat%2;
+
+  for ( j = 0; j < ins2; j++ )
+    {
+      z = (double) (4*(j+1)-1)*M_PI / (double) (4*nlat+2);
+      pa[j] = cos(z + 1.0/(tan(z)*(double)(8*nlat*nlat)));
+    }
+
+  for ( j = 0; j < ins2; j++ )
+    {
+
+      za = pa[j];
+
+      iter = 0;
+      do
+	{
+	  iter++;
+	  zk = 0.0;
+
+	  /* Newton iteration step */
+
+	  zkm2 = 1.0;
+	  zkm1 = za;
+	  zx = za;
+	  for ( jn = 2; jn <= nlat; jn++ )
+	    {
+	      zk = ((double) (2*jn-1)*zx*zkm1-(double)(jn-1)*zkm2) / (double)(jn);
+	      zkm2 = zkm1;
+	      zkm1 = zk;
+	    }
+	  zkm1 = zkm2;
+	  zldn = ((double) (nlat)*(zkm1-zx*zk)) / (1.-zx*zx);
+	  zmod = -zk/zldn;
+	  zxn = zx+zmod;
+	  zan = zxn;
+
+	  /* computes weight */
+
+	  zkm2 = 1.0;
+	  zkm1 = zxn;
+	  zx = zxn;
+	  for ( jn = 2; jn <= nlat; jn++ )
+	    {
+	      zk = ((double) (2*jn-1)*zx*zkm1-(double)(jn-1)*zkm2) / (double) (jn);
+	      zkm2 = zkm1;
+	      zkm1 = zk;
+	    }
+	  zkm1 = zkm2;
+	  zw = (1.0-zx*zx) / ((double) (nlat*nlat)*zkm1*zkm1);
+	  za = zan;
+	}
+      while ( iter <= itemax && fabs(zmod) >= DBL_EPSILON );
+
+      pa[j] = zan;
+      pw[j] = 2.0*zw;
+    }
+
+#if defined (SX)
+#pragma vdir nodep
+#endif
+  for (j = 0; j < nlat/2; j++)
+    {
+      isym = nlat-(j+1);
+      pa[isym] = -pa[j];
+      pw[isym] =  pw[j];
+    }
+
+  return;
+}
+#endif
+
+void gaussaw(double *pa, double *pw, int nlat)
+{
+  //gauaw_old(pa, pw, nlat);
+  gauaw(nlat, pa, pw);
+}
+
+/*
+#define NGL  48
+
+int main (int rgc, char *argv[])
+{
+  int ngl = NGL;
+  double plo[NGL], pwo[NGL];
+  double pl[NGL], pw[NGL];
+
+  int i;
+
+  gauaw(ngl, pl, pw);
+  gauaw_old(plo, pwo, ngl);
+  for (i = 0; i < ngl; i++)
+    {
+      pl[i]  = asin(pl[i])/M_PI*180.0;
+      plo[i] = asin(plo[i])/M_PI*180.0;
+    }
+
+  for (i = 0; i < ngl; i++)
+    {
+      fprintf(stderr, "%4d%25.18f%25.18f%25.18f%25.18f\n", i+1, pl[i], pw[i], pl[i]-plo[i], pw[i]-pwo[i]);
+    }
+
+  return 0;
+}
+*/
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/gaussgrid.h b/libcdi/src/gaussgrid.h
new file mode 100644
index 0000000..b0a0c47
--- /dev/null
+++ b/libcdi/src/gaussgrid.h
@@ -0,0 +1,15 @@
+#ifndef _GAUSSGRID_H
+#define _GAUSSGRID_H
+
+void   gaussaw(double *pa, double *pw, int nlat);
+
+#endif  /* _GAUSSGRID_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/gribapi.c b/libcdi/src/gribapi.c
new file mode 100644
index 0000000..c037c29
--- /dev/null
+++ b/libcdi/src/gribapi.c
@@ -0,0 +1,134 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if  defined  (HAVE_LIBGRIB_API)
+#  include <grib_api.h>
+#endif
+
+#include <stdio.h>
+
+#include "cdi.h"
+#include "stream_int.h"
+#include "gribapi.h"
+#include "dmemory.h"
+
+#define XSTRING(x)	#x
+#define STRING(x)	XSTRING(x)
+
+static char gribapi_libvers[64] = "";
+
+const char *gribapiLibraryVersion(void)
+{
+#if  defined  (HAVE_LIBGRIB_API)
+  long version = grib_get_api_version();
+  int major_version, minor_version, revision_version;
+
+  major_version    = version/10000;
+  minor_version    = (version-major_version*10000)/100;
+  revision_version = (version-major_version*10000-minor_version*100);
+
+  sprintf(gribapi_libvers, "%d.%d.%d",
+	  major_version, minor_version, revision_version);
+#endif
+
+  return (gribapi_libvers);
+}
+
+
+void gribContainersNew(int streamID)
+{
+  stream_t *streamptr;
+  int editionNumber = 2;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->filetype == FILETYPE_GRB ) editionNumber = 1;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( streamptr->filetype == FILETYPE_GRB )
+    {
+    }
+  else
+#endif
+    {
+      int nvars = streamptr->nvars;
+
+#if defined (GRIBCONTAINER2D)
+      gribContainer_t **gribContainers;
+      gribContainers = (gribContainer_t **) malloc(nvars*sizeof(gribContainer_t *));
+
+      for ( int varID = 0; varID < nvars; ++varID )
+        {
+          int nlevs = streamptr->vars[varID].nlevs;
+          gribContainers[varID] = (gribContainer_t *) malloc(nlevs*sizeof(gribContainer_t));
+
+          for ( int levelID = 0; levelID < nlevs; ++levelID )
+            {
+              gribContainers[varID][levelID].gribHandle = gribHandleNew(editionNumber);
+              gribContainers[varID][levelID].init = FALSE;
+            }
+	}
+
+      streamptr->gribContainers = (void **) gribContainers;
+#else
+      gribContainer_t *gribContainers;
+      gribContainers = (gribContainer_t *) malloc(nvars*sizeof(gribContainer_t));
+
+      for ( int varID = 0; varID < nvars; ++varID )
+        {
+          gribContainers[varID].gribHandle = gribHandleNew(editionNumber);
+          gribContainers[varID].init = FALSE;
+	}
+
+      streamptr->gribContainers = (void *) gribContainers;
+#endif
+    }
+}
+
+
+void gribContainersDelete(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->gribContainers )
+    {
+      int nvars = streamptr->nvars;
+
+#if defined (GRIBCONTAINER2D)
+      gribContainer_t **gribContainers = (gribContainer_t **) streamptr->gribContainers;
+
+      for ( int varID = 0; varID < nvars; ++varID )
+	{
+          int nlevs = streamptr->vars[varID].nlevs;
+          for ( int levelID = 0; levelID < nlevs; ++levelID )
+            {
+              gribHandleDelete(gribContainers[varID][levelID].gribHandle);
+            }
+          free(gribContainers[varID]);
+	}
+#else
+      gribContainer_t *gribContainers = (gribContainer_t *) streamptr->gribContainers;
+
+      for ( int varID = 0; varID < nvars; ++varID )
+	{
+          gribHandleDelete(gribContainers[varID].gribHandle);
+	}
+#endif
+
+      free(gribContainers);
+
+      streamptr->gribContainers = NULL;
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/gribapi.h b/libcdi/src/gribapi.h
new file mode 100644
index 0000000..8d59aad
--- /dev/null
+++ b/libcdi/src/gribapi.h
@@ -0,0 +1,57 @@
+#ifndef _GRIBAPI_H
+#define _GRIBAPI_H
+
+#define  GRIBAPI_MISSVAL  -9.E33
+
+/* GRIB2 Level Types */
+#define  GRIB2_LTYPE_SURFACE               1
+#define  GRIB2_LTYPE_TOA                   8
+#define  GRIB2_LTYPE_SEA_BOTTOM            9
+#define  GRIB2_LTYPE_ATMOSPHERE           10
+#define  GRIB2_LTYPE_ISOBARIC            100
+#define  GRIB2_LTYPE_MEANSEA             101
+#define  GRIB2_LTYPE_ALTITUDE            102
+#define  GRIB2_LTYPE_HEIGHT              103
+#define  GRIB2_LTYPE_SIGMA               104
+#define  GRIB2_LTYPE_HYBRID              105
+#define  GRIB2_LTYPE_LANDDEPTH           106
+#define  GRIB2_LTYPE_ISENTROPIC          107
+#define  GRIB2_LTYPE_REFERENCE           150
+#define  GRIB2_LTYPE_SEADEPTH            160
+
+/* GRIB2 Data representation type (Grid Type) */
+#define  GRIB2_GTYPE_LATLON                0  /*  latitude/longitude                       */
+#define  GRIB2_GTYPE_LATLON_ROT            1  /*  rotated latitude/longitude               */
+#define  GRIB2_GTYPE_LATLON_STR            2  /*  stretched latitude/longitude             */
+#define  GRIB2_GTYPE_LATLON_ROTSTR         3  /*  rotated and stretched latitude/longitude */
+#define  GRIB2_GTYPE_GAUSSIAN             40  /*  gaussian grid                            */
+#define  GRIB2_GTYPE_GAUSSIAN_ROT         41  /*  rotated gaussian grid                    */
+#define  GRIB2_GTYPE_GAUSSIAN_STR         42  /*  stretched gaussian grid                  */
+#define  GRIB2_GTYPE_GAUSSIAN_ROTSTR      43  /*  rotated and stretched gaussian grid      */
+#define  GRIB2_GTYPE_LCC                  30  /*  Lambert conformal                        */
+#define  GRIB2_GTYPE_SPECTRAL             50  /*  spherical harmonics                      */
+#define  GRIB2_GTYPE_GME                 100  /*  hexagonal GME grid                       */
+#define  GRIB2_GTYPE_NUMBER              101  /*  General Unstructured Grid                */
+
+const char *gribapiLibraryVersion(void);
+void gribContainersNew(int streamID);
+void gribContainersDelete(int streamID);
+void *gribHandleNew(int editionNumber);
+void gribHandleDelete(void *gh);
+
+typedef struct {
+  int init;
+  void *gribHandle;
+}
+gribContainer_t;
+
+#endif  /* _GRIBAPI_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/grid.c b/libcdi/src/grid.c
new file mode 100644
index 0000000..d79e111
--- /dev/null
+++ b/libcdi/src/grid.c
@@ -0,0 +1,4845 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <string.h>
+#include <float.h>  /* FLT_EPSILON */
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+#include "dmemory.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "grid.h"
+#include "gaussgrid.h"
+#include "pio_util.h"
+#include "resource_handle.h"
+#include "pio_rpc.h"
+#include "namespace.h"
+
+#ifndef  RAD2DEG
+#define  RAD2DEG  (180./M_PI)   /* conversion for rad to deg */
+#endif
+
+#ifndef  DEG2RAD
+#define  DEG2RAD  (M_PI/180.)   /* conversion for deg to rad */
+#endif
+
+
+char *Grids[] = {
+  /*  0 */  "undefined",
+  /*  1 */  "generic",
+  /*  2 */  "gaussian",
+  /*  3 */  "gaussian reduced",
+  /*  4 */  "lonlat",
+  /*  5 */  "spectral",
+  /*  6 */  "fourier",
+  /*  7 */  "gme",
+  /*  8 */  "trajectory",
+  /*  9 */  "unstructured",
+  /* 10 */  "curvilinear",
+  /* 11 */  "lcc",
+  /* 12 */  "lcc2",
+  /* 13 */  "laea",
+  /* 14 */  "sinusoidal",
+  /* 15 */  "reference",
+  /* 16 */  "projection",
+};
+
+
+static int    gridCompareP    ( void * gridptr1, void * gridptr2 );
+static void   gridDestroyP    ( void * gridptr );
+static void   gridPrintP      ( void * gridptr, FILE * fp );
+#ifdef USE_MPI
+static int    gridGetPackSize ( void * gridptr, MPI_Comm comm );
+static void   gridPack        ( void * gridptr, void * buff, int size,
+				int *position, MPI_Comm comm );
+static int    gridTxCode      ( void );
+#endif
+
+resOps gridOps = { gridCompareP, gridDestroyP, gridPrintP
+#ifdef USE_MPI
+                   , gridGetPackSize, gridPack, gridTxCode
+#endif
+};
+
+
+static int  GRID_Debug = 0;   /* If set to 1, debugging */
+
+
+void grid_init(grid_t *gridptr)
+{
+  gridptr->self         = CDI_UNDEFID;
+  gridptr->type         = CDI_UNDEFID;
+  gridptr->proj         = CDI_UNDEFID;
+  gridptr->mask         = NULL;
+  gridptr->mask_gme     = NULL;
+  gridptr->xvals        = NULL;
+  gridptr->yvals        = NULL;
+  gridptr->area         = NULL;
+  gridptr->xbounds      = NULL;
+  gridptr->ybounds      = NULL;
+  gridptr->rowlon       = NULL;
+  gridptr->nrowlon      = 0;
+  gridptr->xinc         = 0.0;
+  gridptr->yinc         = 0.0;
+  gridptr->lcc_originLon = 0.0;
+  gridptr->lcc_originLat = 0.0;
+  gridptr->lcc_lonParY  = 0.0;
+  gridptr->lcc_lat1     = 0.0;
+  gridptr->lcc_lat2     = 0.0;
+  gridptr->lcc_xinc     = 0.0;
+  gridptr->lcc_yinc     = 0.0;
+  gridptr->lcc_projflag = 0;
+  gridptr->lcc_scanflag = 0;
+  gridptr->lcc_defined  = FALSE;
+  gridptr->lcc2_lon_0   = 0.0;
+  gridptr->lcc2_lat_0   = 0.0;
+  gridptr->lcc2_lat_1   = 0.0;
+  gridptr->lcc2_lat_2   = 0.0;
+  gridptr->lcc2_a       = 0.0;
+  gridptr->lcc2_defined = FALSE;
+  gridptr->laea_lon_0   = 0.0;
+  gridptr->laea_lat_0   = 0.0;
+  gridptr->laea_a       = 0.0;
+  gridptr->laea_defined = FALSE;
+  gridptr->trunc        = 0;
+  gridptr->nvertex      = 0;
+  gridptr->nd           = 0;
+  gridptr->ni           = 0;
+  gridptr->ni2          = 0;
+  gridptr->ni3          = 0;
+  gridptr->number       = 0;
+  gridptr->position     = 0;
+  gridptr->reference    = NULL;
+  gridptr->prec         = 0;
+  gridptr->size         = 0;
+  gridptr->xsize        = 0;
+  gridptr->ysize        = 0;
+  gridptr->np           = 0;
+  gridptr->xdef         = 0;
+  gridptr->ydef         = 0;
+  gridptr->isCyclic     = CDI_UNDEFID;
+  gridptr->isRotated    = FALSE;
+  gridptr->xpole        = 0.0;
+  gridptr->ypole        = 0.0;
+  gridptr->angle        = 0.0;
+  gridptr->locked       = FALSE;
+  gridptr->lcomplex     = 0;
+  gridptr->xname[0]     = 0;
+  gridptr->yname[0]     = 0;
+  gridptr->xlongname[0] = 0;
+  gridptr->ylongname[0] = 0;
+  gridptr->xunits[0]    = 0;
+  gridptr->yunits[0]    = 0;
+  gridptr->xstdname[0]  = 0;
+  gridptr->ystdname[0]  = 0;
+  gridptr->uuid[0]      = 0;
+  gridptr->name         = NULL;
+}
+
+
+void grid_free(grid_t *gridptr)
+{
+  if ( gridptr->mask      ) free(gridptr->mask);
+  if ( gridptr->mask_gme  ) free(gridptr->mask_gme);
+  if ( gridptr->xvals     ) free(gridptr->xvals);
+  if ( gridptr->yvals     ) free(gridptr->yvals);
+  if ( gridptr->area      ) free(gridptr->area);
+  if ( gridptr->xbounds   ) free(gridptr->xbounds);
+  if ( gridptr->ybounds   ) free(gridptr->ybounds);
+  if ( gridptr->rowlon    ) free(gridptr->rowlon);
+  if ( gridptr->reference ) free(gridptr->reference);
+  if ( gridptr->name      ) free(gridptr->name);
+
+  grid_init(gridptr);
+}
+
+static
+grid_t *gridNewEntry ( void )
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) xmalloc ( sizeof ( grid_t ));
+  grid_init ( gridptr );
+  gridptr->self = reshPut (( void * ) gridptr, &gridOps );
+
+  return gridptr;
+}
+
+static
+void gridInit (void)
+{
+  static int gridInitialized = 0;
+  char *env;
+
+  if ( gridInitialized ) return;
+
+  gridInitialized = 1;
+
+  env = getenv("GRID_DEBUG");
+  if ( env ) GRID_Debug = atoi(env);
+}
+
+static
+void grid_copy(grid_t *gridptr2, grid_t *gridptr1)
+{
+  int gridID2;
+
+  gridID2 = gridptr2->self;
+  memcpy(gridptr2, gridptr1, sizeof(grid_t));
+  gridptr2->self = gridID2;
+}
+
+static
+void gridCheckPtr(const char *caller, int gridID, grid_t *gridptr)
+{
+  if ( gridptr == NULL )
+    Errorc("grid %d undefined!", gridID);
+}
+
+#define  grid_check_ptr(gridID, gridptr)  gridCheckPtr(__func__, gridID, gridptr)
+
+
+int gridSize(void)
+{
+  return reshCountType ( &gridOps );
+}
+
+
+void gridGenXvals(int xsize, double xfirst, double xlast, double xinc, double *xvals)
+{
+  if ( (! (fabs(xinc) > 0)) && xsize > 1 )
+    {
+      if ( xfirst >= xlast )
+        {
+          while ( xfirst >= xlast ) xlast += 360;
+          xinc = (xlast-xfirst)/(xsize);
+        }
+      else
+        {
+          xinc = (xlast-xfirst)/(xsize-1);
+        }
+    }
+
+  for ( int i = 0; i < xsize; ++i )
+    xvals[i] = xfirst + i*xinc;
+}
+
+static
+void calc_gaussgrid(double *yvals, int ysize, double yfirst, double ylast)
+{
+  double *yw;
+  long yhsize;
+  long i;
+
+  yw = (double *) malloc(ysize*sizeof(double));
+  gaussaw(yvals, yw, ysize);
+  free(yw);
+  for ( i = 0; i < ysize; i++ )
+    yvals[i] = asin(yvals[i])/M_PI*180.0;
+
+  if ( yfirst < ylast && yfirst > -90.0 && ylast < 90.0 )
+    {
+      double ytmp;
+      yhsize = ysize/2;
+      for ( i = 0; i < yhsize; i++ )
+        {
+          ytmp = yvals[i];
+          yvals[i] = yvals[ysize-i-1];
+          yvals[ysize-i-1] = ytmp;
+        }
+    }
+}
+
+
+void gridGenYvals(int gridtype, int ysize, double yfirst, double ylast, double yinc, double *yvals)
+{
+  long i;
+  double deleps = 0.002;
+
+  if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
+    {
+      if ( ysize > 2 )
+	{
+	  calc_gaussgrid(yvals, ysize, yfirst, ylast);
+
+	  if ( ! (IS_EQUAL(yfirst, 0) && IS_EQUAL(ylast, 0)) )
+	    if ( fabs(yvals[0] - yfirst) > deleps || fabs(yvals[ysize-1] - ylast) > deleps )
+	      {
+		double yinc = fabs(ylast-yfirst)/(ysize-1);
+		double *ytmp = NULL;
+		int nstart, lfound = 0;
+		int ny = (int) (180./yinc + 0.5);
+		ny -= ny%2;
+		/* printf("%g %g %g %g %g %d\n", ylast, yfirst, ylast-yfirst,yinc, 180/yinc, ny); */
+		if ( ny > ysize && ny < 4096 )
+		  {
+		    ytmp = (double *) malloc(ny*sizeof(double));
+		    calc_gaussgrid(ytmp, ny, yfirst, ylast);
+		    for ( i = 0; i < (ny-ysize); i++ )
+		      if ( fabs(ytmp[i] - yfirst) < deleps ) break;
+
+		    nstart = i;
+
+		    if ( (nstart+ysize-1) < ny )
+		      if ( fabs(ytmp[nstart+ysize-1] - ylast) < deleps ) lfound = 1;
+		  }
+
+		if ( lfound )
+		  {
+		    for ( i = 0; i < ysize; i++ ) yvals[i] = ytmp[i+nstart];
+		  }
+		else
+		  {
+		    Warning("Cannot calculate gaussian latitudes for lat1 = %g latn = %g!", yfirst, ylast);
+		    for ( i = 0; i < ysize; i++ ) yvals[i] = 0;
+		    yvals[0] = yfirst;
+		    yvals[ysize-1] = ylast;
+		  }
+
+		if ( ytmp ) free(ytmp);
+	      }
+	}
+      else
+        {
+          yvals[0] = yfirst;
+          yvals[ysize-1] = ylast;
+        }
+    }
+  /*     else if ( gridtype == GRID_LONLAT || gridtype == GRID_GENERIC ) */
+  else
+    {
+      if ( (! (fabs(yinc) > 0)) && ysize > 1 )
+        {
+          if ( IS_EQUAL(yfirst, ylast) && IS_NOT_EQUAL(yfirst, 0) ) ylast *= -1;
+
+          if ( yfirst > ylast )
+            yinc = (yfirst-ylast)/(ysize-1);
+          else if ( yfirst < ylast )
+            yinc = (ylast-yfirst)/(ysize-1);
+          else
+            {
+              if ( ysize%2 != 0 )
+                {
+                  yinc = 180.0/(ysize-1);
+                  yfirst = -90;
+                }
+              else
+                {
+                  yinc = 180.0/ysize;
+                  yfirst = -90 + yinc/2;
+                }
+            }
+        }
+
+      if ( yfirst > ylast && yinc > 0 ) yinc = -yinc;
+
+      for ( i = 0; i < ysize; i++ )
+        yvals[i] = yfirst + i*yinc;
+    }
+  /*
+    else
+    Error("unable to calculate values for %s grid!", gridNamePtr(gridtype));
+  */
+}
+
+/*
+ at Function  gridCreate
+ at Title     Create a horizontal Grid
+
+ at Prototype int gridCreate(int gridtype, int size)
+ at Parameter
+    @Item  gridtype  The type of the grid, one of the set of predefined CDI grid types.
+                     The valid CDI grid types are @func{GRID_GENERIC}, @func{GRID_GAUSSIAN},
+                     @func{GRID_LONLAT}, @func{GRID_LCC}, @func{GRID_SPECTRAL},
+                     @func{GRID_GME}, @func{GRID_CURVILINEAR}, @func{GRID_UNSTRUCTURED} and
+                     @func{GRID_REFERENCE}.
+    @Item  size      Number of gridpoints.
+
+ at Description
+The function @func{gridCreate} creates a horizontal Grid.
+
+ at Result
+ at func{gridCreate} returns an identifier to the Grid.
+
+ at Example
+Here is an example using @func{gridCreate} to create a regular lon/lat Grid:
+
+ at Source
+#include "cdi.h"
+   ...
+#define  nlon  12
+#define  nlat   6
+   ...
+double lons[nlon] = {0, 30, 60, 90, 120, 150, 180, 210, 240, 270, 300, 330};
+double lats[nlat] = {-75, -45, -15, 15, 45, 75};
+int gridID;
+   ...
+gridID = gridCreate(GRID_LONLAT, nlon*nlat);
+gridDefXsize(gridID, nlon);
+gridDefYsize(gridID, nlat);
+gridDefXvals(gridID, lons);
+gridDefYvals(gridID, lats);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int gridCreate(int gridtype, int size)
+{
+  int gridID;
+  grid_t *gridptr;
+
+  if ( CDI_Debug )
+    Message("gridtype: %d size: %d", gridtype, size);
+
+  gridInit ();
+
+  gridptr = gridNewEntry();
+  if ( ! gridptr ) Error("No memory");
+
+  gridID = gridptr->self;
+
+  if ( CDI_Debug ) Message("gridID: %d", gridID);
+
+  gridptr->type = gridtype;
+  gridptr->size = size;
+
+  /*  if ( gridtype == GRID_GENERIC )     gridptr->xsize = size; */
+  if ( gridtype == GRID_UNSTRUCTURED )  gridptr->xsize = size;
+  if ( gridtype == GRID_CURVILINEAR  )  gridptr->nvertex = 4;
+
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_GAUSSIAN_REDUCED:
+    case GRID_CURVILINEAR:
+    case GRID_TRAJECTORY:
+      {
+        if ( gridtype == GRID_TRAJECTORY )
+          {
+            gridDefXname(gridID, "tlon");
+            gridDefYname(gridID, "tlat");
+          }
+        else
+          {
+            gridDefXname(gridID, "lon");
+            gridDefYname(gridID, "lat");
+          }
+        gridDefXlongname(gridID, "longitude");
+        gridDefYlongname(gridID, "latitude");
+
+        /*
+        if ( gridtype == GRID_CURVILINEAR )
+          {
+            strcpy(gridptr->xstdname, "grid_longitude");
+            strcpy(gridptr->ystdname, "grid_latitude");
+            gridDefXunits(gridID, "degrees");
+            gridDefYunits(gridID, "degrees");
+          }
+        else
+        */
+          {
+            strcpy(gridptr->xstdname, "longitude");
+            strcpy(gridptr->ystdname, "latitude");
+            gridDefXunits(gridID, "degrees_east");
+            gridDefYunits(gridID, "degrees_north");
+          }
+
+        break;
+      }
+    case GRID_GME:
+    case GRID_UNSTRUCTURED:
+      {
+        gridDefXname(gridID, "lon");
+        gridDefYname(gridID, "lat");
+        strcpy(gridptr->xstdname, "longitude");
+        strcpy(gridptr->ystdname, "latitude");
+        gridDefXunits(gridID, "degrees_east");
+        gridDefYunits(gridID, "degrees_north");
+        break;
+      }
+    case GRID_GENERIC:
+      {
+        gridDefXname(gridID, "x");
+        gridDefYname(gridID, "y");
+        strcpy(gridptr->xstdname, "grid_longitude");
+        strcpy(gridptr->ystdname, "grid_latitude");
+        gridDefXunits(gridID, "degrees");
+        gridDefYunits(gridID, "degrees");
+        break;
+      }
+    case GRID_LCC2:
+    case GRID_SINUSOIDAL:
+    case GRID_LAEA:
+      {
+        gridDefXname(gridID, "x");
+        gridDefYname(gridID, "y");
+        strcpy(gridptr->xstdname, "projection_x_coordinate");
+        strcpy(gridptr->ystdname, "projection_y_coordinate");
+        gridDefXunits(gridID, "m");
+        gridDefYunits(gridID, "m");
+        break;
+      }
+    }
+
+  return (gridID);
+}
+
+static
+void gridDestroyKernel( grid_t * gridptr )
+{
+  int id;
+
+  xassert ( gridptr );
+
+  id = gridptr->self;
+
+  if ( gridptr->mask      ) free(gridptr->mask);
+  if ( gridptr->mask_gme  ) free(gridptr->mask_gme);
+  if ( gridptr->xvals     ) free(gridptr->xvals);
+  if ( gridptr->yvals     ) free(gridptr->yvals);
+  if ( gridptr->area      ) free(gridptr->area);
+  if ( gridptr->xbounds   ) free(gridptr->xbounds);
+  if ( gridptr->ybounds   ) free(gridptr->ybounds);
+  if ( gridptr->rowlon    ) free(gridptr->rowlon);
+  if ( gridptr->reference ) free(gridptr->reference);
+
+  free ( gridptr );
+
+  reshRemove ( id, &gridOps );
+}
+
+/*
+ at Function  gridDestroy
+ at Title     Destroy a horizontal Grid
+
+ at Prototype void gridDestroy(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at EndFunction
+*/
+void gridDestroy(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  gridDestroyKernel ( gridptr );
+}
+
+void gridDestroyP ( void * gridptr )
+{
+  gridDestroyKernel (( grid_t * ) gridptr );
+}
+
+
+char *gridNamePtr(int gridtype)
+{
+  char *name;
+  int size = (int) (sizeof(Grids)/sizeof(char *));
+
+  if ( gridtype >= 0 && gridtype < size )
+    name = Grids[gridtype];
+  else
+    name = Grids[GRID_GENERIC];
+
+  return (name);
+}
+
+
+void gridName(int gridtype, char *gridname)
+{
+  strcpy(gridname, gridNamePtr(gridtype));
+}
+
+/*
+ at Function  gridDefXname
+ at Title     Define the name of a X-axis
+
+ at Prototype void gridDefXname(int gridID, const char *name)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  name     Name of the X-axis.
+
+ at Description
+The function @func{gridDefXname} defines the name of a X-axis.
+
+ at EndFunction
+*/
+void gridDefXname(int gridID, const char *xname)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning ("%s", "Operation not executed." );
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( xname )
+    strcpy(gridptr->xname, xname);
+}
+
+/*
+ at Function  gridDefXlongname
+ at Title     Define the longname of a X-axis
+
+ at Prototype void gridDefXlongname(int gridID, const char *longname)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  longname Longname of the X-axis.
+
+ at Description
+The function @func{gridDefXlongname} defines the longname of a X-axis.
+
+ at EndFunction
+*/
+void gridDefXlongname(int gridID, const char *xlongname)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning ("%s", "Operation not executed." );
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  if ( xlongname )
+    strcpy(gridptr->xlongname, xlongname);
+}
+
+/*
+ at Function  gridDefXunits
+ at Title     Define the units of a X-axis
+
+ at Prototype void gridDefXunits(int gridID, const char *units)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  units    Units of the X-axis.
+
+ at Description
+The function @func{gridDefXunits} defines the units of a X-axis.
+
+ at EndFunction
+*/
+void gridDefXunits(int gridID, const char *xunits)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( xunits )
+    strcpy(gridptr->xunits, xunits);
+}
+
+/*
+ at Function  gridDefYname
+ at Title     Define the name of a Y-axis
+
+ at Prototype void gridDefYname(int gridID, const char *name)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  name     Name of the Y-axis.
+
+ at Description
+The function @func{gridDefYname} defines the name of a Y-axis.
+
+ at EndFunction
+*/
+void gridDefYname(int gridID, const char *yname)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( yname )
+    strcpy(gridptr->yname, yname);
+}
+
+/*
+ at Function  gridDefYlongname
+ at Title     Define the longname of a Y-axis
+
+ at Prototype void gridDefYlongname(int gridID, const char *longname)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  longname Longname of the Y-axis.
+
+ at Description
+The function @func{gridDefYlongname} defines the longname of a Y-axis.
+
+ at EndFunction
+*/
+void gridDefYlongname(int gridID, const char *ylongname)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( ylongname )
+    strcpy(gridptr->ylongname, ylongname);
+}
+
+/*
+ at Function  gridDefYunits
+ at Title     Define the units of a Y-axis
+
+ at Prototype void gridDefYunits(int gridID, const char *units)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  units    Units of the Y-axis.
+
+ at Description
+The function @func{gridDefYunits} defines the units of a Y-axis.
+
+ at EndFunction
+*/
+void gridDefYunits(int gridID, const char *yunits)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( yunits )
+    strcpy(gridptr->yunits, yunits);
+}
+
+/*
+ at Function  gridInqXname
+ at Title     Get the name of a X-axis
+
+ at Prototype void gridInqXname(int gridID, char *name)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  name     Name of the X-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqXname} returns the name of a X-axis.
+
+ at Result
+ at func{gridInqXname} returns the name of the X-axis to the parameter name.
+
+ at EndFunction
+*/
+void gridInqXname(int gridID, char *xname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(xname, gridptr->xname);
+}
+
+/*
+ at Function  gridInqXlongname
+ at Title     Get the longname of a X-axis
+
+ at Prototype void gridInqXlongname(int gridID, char *longname)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  longname Longname of the X-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqXlongname} returns the longname of a X-axis.
+
+ at Result
+ at func{gridInqXlongname} returns the longname of the X-axis to the parameter longname.
+
+ at EndFunction
+*/
+void gridInqXlongname(int gridID, char *xlongname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(xlongname, gridptr->xlongname);
+}
+
+/*
+ at Function  gridInqXunits
+ at Title     Get the units of a X-axis
+
+ at Prototype void gridInqXunits(int gridID, char *units)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  units    Units of the X-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqXunits} returns the units of a X-axis.
+
+ at Result
+ at func{gridInqXunits} returns the units of the X-axis to the parameter units.
+
+ at EndFunction
+*/
+void gridInqXunits(int gridID, char *xunits)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(xunits, gridptr->xunits);
+}
+
+
+void gridInqXstdname(int gridID, char *xstdname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(xstdname, gridptr->xstdname);
+}
+
+/*
+ at Function  gridInqYname
+ at Title     Get the name of a Y-axis
+
+ at Prototype void gridInqYname(int gridID, char *name)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  name     Name of the Y-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqYname} returns the name of a Y-axis.
+
+ at Result
+ at func{gridInqYname} returns the name of the Y-axis to the parameter name.
+
+ at EndFunction
+*/
+void gridInqYname(int gridID, char *yname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(yname, gridptr->yname);
+}
+
+/*
+ at Function  gridInqYlongname
+ at Title     Get the longname of a Y-axis
+
+ at Prototype void gridInqXlongname(int gridID, char *longname)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  longname Longname of the Y-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqYlongname} returns the longname of a Y-axis.
+
+ at Result
+ at func{gridInqYlongname} returns the longname of the Y-axis to the parameter longname.
+
+ at EndFunction
+*/
+void gridInqYlongname(int gridID, char *ylongname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(ylongname, gridptr->ylongname);
+}
+
+/*
+ at Function  gridInqYunits
+ at Title     Get the units of a Y-axis
+
+ at Prototype void gridInqYunits(int gridID, char *units)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  units    Units of the Y-axis. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{gridInqYunits} returns the units of a Y-axis.
+
+ at Result
+ at func{gridInqYunits} returns the units of the Y-axis to the parameter units.
+
+ at EndFunction
+*/
+void gridInqYunits(int gridID, char *yunits)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(yunits, gridptr->yunits);
+}
+
+void gridInqYstdname(int gridID, char *ystdname)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strcpy(ystdname, gridptr->ystdname);
+}
+
+/*
+ at Function  gridInqType
+ at Title     Get the type of a Grid
+
+ at Prototype int gridInqType(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at Description
+The function @func{gridInqType} returns the type of a Grid.
+
+ at Result
+ at func{gridInqType} returns the type of the grid,
+one of the set of predefined CDI grid types.
+The valid CDI grid types are @func{GRID_GENERIC}, @func{GRID_GAUSSIAN},
+ at func{GRID_LONLAT}, @func{GRID_LCC}, @func{GRID_SPECTRAL}, @func{GRID_GME},
+ at func{GRID_CURVILINEAR}, @func{GRID_UNSTRUCTURED} and @func{GRID_REFERENCE}.
+
+ at EndFunction
+*/
+int gridInqType(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->type);
+}
+
+
+/*
+ at Function  gridInqSize
+ at Title     Get the size of a Grid
+
+ at Prototype int gridInqSize(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at Description
+The function @func{gridInqSize} returns the size of a Grid.
+
+ at Result
+ at func{gridInqSize} returns the number of grid points of a Grid.
+
+ at EndFunction
+*/
+int gridInqSize(int gridID)
+{
+  int size = 0;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( ! size )
+    {
+      int xsize, ysize;
+
+      xsize = gridptr->xsize;
+      ysize = gridptr->ysize;
+
+      if ( ysize )
+        size = xsize *ysize;
+      else
+        size = xsize;
+
+      gridptr->size = size;
+    }
+
+  return (size);
+}
+
+static
+int nsp2trunc(int nsp)
+{
+  /*  nsp = (trunc+1)*(trunc+1)              */
+  /*      => trunc^2 + 3*trunc - (x-2) = 0   */
+  /*                                         */
+  /*  with:  y^2 + p*y + q = 0               */
+  /*         y = -p/2 +- sqrt((p/2)^2 - q)   */
+  /*         p = 3 and q = - (x-2)           */
+  int trunc;
+
+  trunc = (int) (sqrt(nsp*4 + 1.) - 3) / 2;
+
+  return (trunc);
+}
+
+
+int gridInqTrunc(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->trunc == 0 )
+    {
+      if ( gridptr->type == GRID_SPECTRAL )
+        gridptr->trunc = nsp2trunc(gridptr->size);
+      /*
+      else if      ( gridptr->type == GRID_GAUSSIAN )
+        gridptr->trunc = nlat2trunc(gridptr->ysize);
+      */
+    }
+
+  return (gridptr->trunc);
+}
+
+
+void gridDefTrunc(int gridID, int trunc)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->trunc = trunc;
+}
+
+/*
+ at Function  gridDefXsize
+ at Title     Define the number of values of a X-axis
+
+ at Prototype void gridDefXsize(int gridID, int xsize)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  xsize    Number of values of a X-axis.
+
+ at Description
+The function @func{gridDefXsize} defines the number of values of a X-axis.
+
+ at EndFunction
+*/
+void gridDefXsize(int gridID, int xsize)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( xsize > gridInqSize(gridID) )
+    Error("xsize %d is greater then gridsize %d", xsize, gridInqSize(gridID));
+
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED && xsize != gridInqSize(gridID) )
+    Error("xsize %d must be equal to gridsize %d for gridtype: UNSTRUCTURED", xsize, gridInqSize(gridID));
+
+  gridptr->xsize = xsize;
+
+  if ( gridInqType(gridID) != GRID_UNSTRUCTURED )
+    {
+      long gridsize = gridptr->xsize*gridptr->ysize;
+      if ( gridsize > 0 && gridsize != gridInqSize(gridID) )
+        Error("Inconsistent grid declaration! (xsize=%d ysize=%d gridsize=%d)",
+              gridptr->xsize, gridptr->ysize, gridInqSize(gridID));
+    }
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefPrec(int gridID, int prec)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->prec = prec;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+int gridInqPrec(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->prec);
+}
+
+/*
+ at Function  gridInqXsize
+ at Title     Get the number of values of a X-axis
+
+ at Prototype int gridInqXsize(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at Description
+The function @func{gridInqXsize} returns the number of values of a X-axis.
+
+ at Result
+ at func{gridInqXsize} returns the number of values of a X-axis.
+
+ at EndFunction
+*/
+int gridInqXsize(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->xsize);
+}
+
+/*
+ at Function  gridDefYsize
+ at Title     Define the number of values of a Y-axis
+
+ at Prototype void gridDefYsize(int gridID, int ysize)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  ysize    Number of values of a Y-axis.
+
+ at Description
+The function @func{gridDefYsize} defines the number of values of a Y-axis.
+
+ at EndFunction
+*/
+void gridDefYsize(int gridID, int ysize)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( ysize > gridInqSize(gridID) )
+    Error("ysize %d is greater then gridsize %d", ysize, gridInqSize(gridID));
+
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED && ysize != gridInqSize(gridID) )
+    Error("ysize %d must be equal gridsize %d for gridtype: UNSTRUCTURED", ysize, gridInqSize(gridID));
+
+  gridptr->ysize = ysize;
+
+  if ( gridInqType(gridID) != GRID_UNSTRUCTURED )
+    {
+      long gridsize = gridptr->xsize*gridptr->ysize;
+      if ( gridsize > 0 && gridsize != gridInqSize(gridID) )
+        Error("Inconsistent grid declaration! (xsize=%d ysize=%d gridsize=%d)",
+              gridptr->xsize, gridptr->ysize, gridInqSize(gridID));
+    }
+}
+
+/*
+ at Function  gridInqYsize
+ at Title     Get the number of values of a Y-axis
+
+ at Prototype int gridInqYsize(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at Description
+The function @func{gridInqYsize} returns the number of values of a Y-axis.
+
+ at Result
+ at func{gridInqYsize} returns the number of values of a Y-axis.
+
+ at EndFunction
+*/
+int gridInqYsize(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ysize);
+}
+
+/*
+ at Function  gridDefNP
+ at Title     Define the number of parallels between a pole and the equator
+
+ at Prototype void gridDefNP(int gridID, int np)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  np       Number of parallels between a pole and the equator.
+
+ at Description
+The function @func{gridDefNP} defines the number of parallels between a pole and the equator
+of a Gaussian grid.
+
+ at EndFunction
+*/
+void gridDefNP(int gridID, int np)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning ("%s", "Operation not executed." );
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->np = np;
+}
+
+/*
+ at Function  gridInqNP
+ at Title     Get the number of parallels between a pole and the equator
+
+ at Prototype int gridInqNP(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+
+ at Description
+The function @func{gridInqNP} returns the number of parallels between a pole and the equator
+of a Gaussian grid.
+
+ at Result
+ at func{gridInqNP} returns the number of parallels between a pole and the equator.
+
+ at EndFunction
+*/
+int gridInqNP(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->np);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefRowlon(int gridID, int nrowlon, const int *rowlon)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->rowlon = (int *) malloc(nrowlon*sizeof(int));
+  gridptr->nrowlon = nrowlon;
+
+  memcpy(gridptr->rowlon, rowlon, nrowlon*sizeof(int));
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridInqRowlon(int gridID, int *rowlon)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->rowlon == 0 )  Error("undefined pointer!");
+
+  memcpy(rowlon, gridptr->rowlon, gridptr->nrowlon*sizeof(int));
+}
+
+
+int gridInqMask(int gridID, int *mask)
+{
+  long size, i;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("Size undefined for gridID = %d", gridID);
+
+  if ( mask && gridptr->mask )
+    for ( i = 0; i < size; ++i )
+      mask[i] = gridptr->mask[i];
+
+  if ( gridptr->mask == NULL ) size = 0;
+
+  return (size);
+}
+
+
+void gridDefMask(int gridID, const int *mask)
+{
+  long size, i;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  size = gridptr->size;
+
+  if ( size == 0 )
+    Error("Size undefined for gridID = %d", gridID);
+
+  if ( mask == NULL )
+    {
+      if ( gridptr->mask )
+	{
+	  free(gridptr->mask);
+	  gridptr->mask = NULL;
+	}
+    }
+  else
+    {
+      if ( gridptr->mask == NULL )
+	gridptr->mask = (mask_t *) malloc(size*sizeof(mask_t));
+      else if ( CDI_Debug )
+	Warning("grid mask already defined!");
+
+      for ( i = 0; i < size; ++i )
+	gridptr->mask[i] = mask[i];
+    }
+}
+
+
+int gridInqMaskGME(int gridID, int *mask)
+{
+  long size, i;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("Size undefined for gridID = %d", gridID);
+
+  if ( mask && gridptr->mask_gme )
+    for ( i = 0; i < size; ++i )
+      mask[i] = gridptr->mask_gme[i];
+
+  if ( gridptr->mask_gme == NULL ) size = 0;
+
+  return (size);
+}
+
+
+void gridDefMaskGME(int gridID, const int *mask)
+{
+  long size, i;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( size == 0 )
+    Error("Size undefined for gridID = %d", gridID);
+
+  if ( gridptr->mask_gme == NULL )
+    gridptr->mask_gme = (mask_t *) malloc(size*sizeof(mask_t));
+  else if ( CDI_Debug )
+    Warning("mask already defined!");
+
+  for ( i = 0; i < size; ++i )
+    gridptr->mask_gme[i] = mask[i];
+}
+
+/*
+ at Function  gridInqXvals
+ at Title     Get all values of a X-axis
+
+ at Prototype int gridInqXvals(int gridID, double *xvals)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  xvals    Pointer to the location into which the X-values are read.
+                    The caller must allocate space for the returned values.
+
+ at Description
+The function @func{gridInqXvals} returns all values of the X-axis.
+
+ at Result
+Upon successful completion @func{gridInqXvals} returns the number of values and
+the values are stored in @func{xvals}.
+Otherwise, 0 is returned and @func{xvals} is empty.
+
+ at EndFunction
+*/
+int gridInqXvals(int gridID, double *xvals)
+{
+  long size;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = gridptr->size;
+  else
+    size = gridptr->xsize;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("Size undefined for gridID = %d", gridID);
+
+  if ( xvals && gridptr->xvals )
+    memcpy(xvals, gridptr->xvals, size*sizeof(double));
+
+  if ( gridptr->xvals == NULL ) size = 0;
+
+  return (size);
+}
+
+/*
+ at Function  gridDefXvals
+ at Title     Define the values of a X-axis
+
+ at Prototype void gridDefXvals(int gridID, const double *xvals)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  xvals    X-values of the grid.
+
+ at Description
+The function @func{gridDefXvals} defines all values of the X-axis.
+
+ at EndFunction
+*/
+void gridDefXvals(int gridID, const double *xvals)
+{
+  int gridtype;
+  long size;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridtype = gridptr->type;
+
+  if ( gridtype == GRID_UNSTRUCTURED || gridtype == GRID_CURVILINEAR )
+    size = gridptr->size;
+  else
+    size = gridptr->xsize;
+
+  if ( size == 0 )
+    Error("Size undefined for gridID = %d", gridID);
+
+  if ( gridptr->xvals == NULL )
+    gridptr->xvals = (double *) malloc(size*sizeof(double));
+  else if ( CDI_Debug )
+    Warning("values already defined!");
+
+  memcpy(gridptr->xvals, xvals, size*sizeof(double));
+}
+
+/*
+ at Function  gridInqYvals
+ at Title     Get all values of a Y-axis
+
+ at Prototype int gridInqYvals(int gridID, double *yvals)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  yvals    Pointer to the location into which the Y-values are read.
+                    The caller must allocate space for the returned values.
+
+ at Description
+The function @func{gridInqYvals} returns all values of the Y-axis.
+
+ at Result
+Upon successful completion @func{gridInqYvals} returns the number of values and
+the values are stored in @func{yvals}.
+Otherwise, 0 is returned and @func{yvals} is empty.
+
+ at EndFunction
+*/
+int gridInqYvals(int gridID, double *yvals)
+{
+  long size;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = gridptr->size;
+  else
+    size = gridptr->ysize;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("Size undefined for gridID = %d!", gridID);
+
+  if ( yvals && gridptr->yvals )
+    memcpy(yvals, gridptr->yvals, size*sizeof(double));
+
+  if ( gridptr->yvals == NULL ) size = 0;
+
+  return (size);
+}
+
+/*
+ at Function  gridDefYvals
+ at Title     Define the values of a Y-axis
+
+ at Prototype void gridDefYvals(int gridID, const double *yvals)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  yvals    Y-values of the grid.
+
+ at Description
+The function @func{gridDefYvals} defines all values of the Y-axis.
+
+ at EndFunction
+*/
+void gridDefYvals(int gridID, const double *yvals)
+{
+  int gridtype;
+  long size;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridtype = gridptr->type;
+
+  if ( gridtype == GRID_UNSTRUCTURED || gridtype == GRID_CURVILINEAR )
+    size = gridptr->size;
+  else
+    size = gridptr->ysize;
+
+  if ( size == 0 )
+    Error("Size undefined for gridID = %d!", gridID);
+
+  if ( gridptr->yvals == NULL )
+    gridptr->yvals = (double *) malloc(size*sizeof(double));
+  else if ( CDI_Debug )
+    Warning("Values already defined!");
+
+  memcpy(gridptr->yvals, yvals, size*sizeof(double));
+}
+
+
+double gridInqXval(int gridID, int index)
+{
+  double xval = 0;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->xvals )
+    xval = gridptr->xvals[index];
+
+  return (xval);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqYval(int gridID, int index)
+{
+  double yval = 0;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->yvals )
+    yval = gridptr->yvals[index];
+
+  return (yval);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqXinc(int gridID)
+{
+  double xinc;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  xinc = gridptr->xinc;
+
+  if ( (! (fabs(xinc) > 0)) && gridptr->xvals )
+    {
+      int xsize;
+      double *xvals;
+
+      xsize = gridptr->xsize;
+      xvals = gridptr->xvals;
+
+      if ( xsize > 1 )
+        {
+          long i;
+          xinc = fabs(xvals[xsize-1] - xvals[0])/(xsize-1);
+          for ( i = 2; i < xsize; i++ )
+            if ( fabs(fabs(xvals[i-1] - xvals[i]) - xinc) > 0.01*xinc ) break;
+
+          if ( i < xsize ) xinc = 0;
+        }
+    }
+
+  return (xinc);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqYinc(int gridID)
+{
+  double yinc;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  yinc = gridptr->yinc;
+
+  if ( (! (fabs(yinc) > 0)) && gridptr->yvals )
+    {
+      int ysize;
+      double *yvals;
+
+      ysize = gridptr->ysize;
+      yvals = gridptr->yvals;
+
+      if ( ysize > 1 )
+        {
+          long i;
+          yinc = fabs(yvals[1] - yvals[0]);
+          for ( i = 2; i < ysize; i++ )
+            if ( fabs(fabs(yvals[i] - yvals[i-1]) - yinc) > (yinc/1000) ) break;
+
+          if ( i < ysize ) yinc = 0;
+          else             yinc = yvals[1] - yvals[0];
+        }
+    }
+
+  return (yinc);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqXpole(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->xpole);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefXpole(int gridID, double xpole)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( memcmp(gridptr->xstdname, "grid", 4) != 0 )
+    strcpy(gridptr->xstdname, "grid_longitude");
+
+  gridptr->isRotated = TRUE;
+  gridptr->xpole = xpole;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqYpole(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ypole);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefYpole(int gridID, double ypole)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( memcmp(gridptr->ystdname, "grid", 4) != 0 )
+    strcpy(gridptr->ystdname, "grid_latitude");
+
+  gridptr->isRotated = TRUE;
+  gridptr->ypole = ypole;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+double gridInqAngle(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->angle);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefAngle(int gridID, double angle)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->isRotated = TRUE;
+  gridptr->angle = angle;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+int gridInqGMEnd(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->nd);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefGMEnd(int gridID, int nd)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->nd = nd;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+int gridInqGMEni(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ni);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefGMEni(int gridID, int ni)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->ni = ni;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+int gridInqGMEni2(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ni2);
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridDefGMEni2(int gridID, int ni2)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->ni2 = ni2;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+int gridInqGMEni3(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ni3);
+}
+
+void gridDefGMEni3(int gridID, int ni3)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->ni3 = ni3;
+}
+
+/*
+ at Function
+ at Title
+
+ at Prototype
+ at Parameter
+    @Item  Grid identifier
+
+ at EndFunction
+*/
+void gridChangeType(int gridID, int gridtype)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  Message("Changed grid type from %s to %s",
+          gridNamePtr(gridptr->type),
+          gridNamePtr(gridtype));
+
+  gridptr->type = gridtype;
+}
+
+static
+void grid_check_cyclic(grid_t *gridptr)
+{
+  int xsize, ysize;
+  long i1, i2, in, j, k1, k2, nc;
+  double xinc, x0;
+  const double *xvals, *xbounds;
+
+  gridptr->isCyclic = FALSE;
+
+  xsize = gridptr->xsize;
+  ysize = gridptr->ysize;
+  xvals = gridptr->xvals;
+  xbounds = gridptr->xbounds;
+
+  if ( gridptr->type == GRID_GAUSSIAN || gridptr->type == GRID_LONLAT )
+    {
+      if ( xvals && xsize > 1 )
+        {
+          xinc = xvals[1] - xvals[0];
+          if ( IS_EQUAL(xinc, 0) )
+            xinc = (xvals[xsize-1] - xvals[0])/(xsize-1);
+          x0 = 2*xvals[xsize-1]-xvals[xsize-2]-360;
+          if ( IS_NOT_EQUAL(xvals[0], xvals[xsize-1]) )
+            if ( fabs(x0 - xvals[0]) < 0.01*xinc ) gridptr->isCyclic = TRUE;
+        }
+    }
+  else if ( gridptr->type == GRID_CURVILINEAR )
+    {
+      if ( xvals && xsize > 1 )
+        {
+          double val1, val2, valn;
+
+          nc = 0;
+          gridptr->isCyclic = FALSE;
+          for ( j = 0; j < ysize; ++j )
+            {
+              i1 = j*xsize;
+              i2 = j*xsize+1;
+              in = j*xsize+(xsize-1);
+              val1 = xvals[i1];
+              val2 = xvals[i2];
+              valn = xvals[in];
+
+              xinc = fabs(val2-val1);
+
+	      if ( val1 <    1 && valn > 300 ) val1 += 360;
+	      if ( valn <    1 && val1 > 300 ) valn += 360;
+	      if ( val1 < -179 && valn > 120 ) val1 += 360;
+	      if ( valn < -179 && val1 > 120 ) valn += 360;
+
+              if ( valn > val1 ) x0 = valn - xinc;
+              else               x0 = valn + xinc;
+
+              if ( fabs(x0-val1) < 0.5*xinc ) nc++;
+            }
+
+          if ( nc > 0.5*ysize ) gridptr->isCyclic = TRUE;
+        }
+
+      if ( xbounds && xsize > 1 )
+	{
+	  double val1, val2;
+
+	  gridptr->isCyclic = TRUE;
+	  for ( j = 0; j < ysize; ++j )
+	    {
+	      i1 = j*xsize*4;
+	      i2 = j*xsize*4+(xsize-1)*4;
+	      nc = 0;
+	      for ( k1 = 0; k1 < 4; ++k1 )
+		{
+		  val1 = xbounds[i1+k1];
+		  for ( k2 = 0; k2 < 4; ++k2 )
+		    {
+		      val2 = xbounds[i2+k2];
+
+		      if ( val1 <    1 && val2 > 300 ) val1 += 360;
+		      if ( val2 <    1 && val1 > 300 ) val2 += 360;
+		      if ( val1 < -179 && val2 > 120 ) val1 += 360;
+		      if ( val2 < -179 && val1 > 120 ) val2 += 360;
+
+		      if ( fabs(val1-val2) < 0.001 )
+			{
+			  nc++;
+			  break;
+			}
+		    }
+		}
+
+	      if ( nc < 1 )
+		{
+		  gridptr->isCyclic = FALSE;
+		  break;
+		}
+	    }
+	}
+    }
+}
+
+
+int gridIsCircular(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->isCyclic == CDI_UNDEFID ) grid_check_cyclic(gridptr);
+
+  return ( gridptr->isCyclic );
+}
+
+
+int gridIsRotated(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return ( gridptr->isRotated );
+}
+
+static
+int compareXYvals(int gridID, long xsize, long ysize, double *xvals0, double *yvals0)
+{
+  long i;
+  int differ = 0;
+
+  if ( !differ && xsize == gridInqXvals(gridID, NULL) )
+    {
+      double *xvals;
+
+      xvals = (double *) malloc(xsize*sizeof(double));
+
+      gridInqXvals(gridID, xvals);
+
+      for ( i = 0; i < xsize; ++i )
+	if ( fabs(xvals0[i] - xvals[i]) > 1.e-10 )
+	  {
+	    differ = 1;
+	    break;
+	  }
+
+      free(xvals);
+    }
+
+  if ( !differ && ysize == gridInqYvals(gridID, NULL) )
+    {
+      double *yvals;
+
+      yvals = (double *) malloc(ysize*sizeof(double));
+
+      gridInqYvals(gridID, yvals);
+
+      for ( i = 0; i < ysize; ++i )
+	if ( fabs(yvals0[i] - yvals[i]) > 1.e-10 )
+	  {
+	    differ = 1;
+	    break;
+	  }
+
+      free(yvals);
+    }
+
+  return (differ);
+}
+
+static
+int compareXYvals2(int gridID, long gridsize, double *xvals, double *yvals)
+{
+  int differ = 0;
+
+  if ( !differ && xvals && gridInqXvalsPtr(gridID) )
+    {
+      if ( fabs(xvals[0] - gridInqXval(gridID, 0)) > 1.e-9 ||
+	   fabs(xvals[gridsize-1] - gridInqXval(gridID, gridsize-1)) > 1.e-9 )
+	differ = 1;
+    }
+
+  if ( !differ && yvals && gridInqYvalsPtr(gridID) )
+    {
+      if ( fabs(yvals[0] - gridInqYval(gridID, 0)) > 1.e-9 ||
+	   fabs(yvals[gridsize-1] - gridInqYval(gridID, gridsize-1)) > 1.e-9 )
+	differ = 1;
+    }
+
+  return (differ);
+}
+
+
+int gridCompare(int gridID, grid_t grid)
+{
+  int differ = 1;
+
+  if ( grid.type == gridInqType(gridID) || grid.type == GRID_GENERIC )
+    {
+      if ( grid.size == gridInqSize(gridID) )
+	{
+	  differ = 0;
+	  if ( grid.type == GRID_LONLAT )
+	    {
+	      /*
+	      printf("gridID      %d\n", gridID);
+	      printf("grid.xdef   %d\n", grid.xdef);
+	      printf("grid.ydef   %d\n", grid.ydef);
+	      printf("grid.xsize  %d\n", grid.xsize);
+	      printf("grid.ysize  %d\n", grid.ysize);
+	      printf("grid.xfirst %f\n", grid.xfirst);
+	      printf("grid.yfirst %f\n", grid.yfirst);
+	      printf("grid.xfirst %f\n", gridInqXval(gridID, 0));
+	      printf("grid.yfirst %f\n", gridInqYval(gridID, 0));
+	      printf("grid.xinc   %f\n", grid.xinc);
+	      printf("grid.yinc   %f\n", grid.yinc);
+	      printf("grid.xinc   %f\n", gridInqXinc(gridID));
+	      printf("grid.yinc   %f\n", gridInqYinc(gridID));
+	      */
+	      if ( grid.xsize == gridInqXsize(gridID) && grid.ysize == gridInqYsize(gridID) )
+		{
+		  if ( grid.xdef == 2 && grid.ydef == 2 )
+		    {
+		      if ( ! (IS_EQUAL(grid.xfirst, 0) && IS_EQUAL(grid.xlast, 0) && IS_EQUAL(grid.xinc, 0)) &&
+			   ! (IS_EQUAL(grid.yfirst, 0) && IS_EQUAL(grid.ylast, 0) && IS_EQUAL(grid.yinc, 0)) &&
+			   IS_NOT_EQUAL(grid.xfirst, grid.xlast) && IS_NOT_EQUAL(grid.yfirst, grid.ylast) )
+			{
+			  if ( IS_NOT_EQUAL(grid.xfirst, gridInqXval(gridID, 0)) ||
+			       IS_NOT_EQUAL(grid.yfirst, gridInqYval(gridID, 0)))
+			    {
+			      differ = 1;
+			    }
+			  if ( !differ && fabs(grid.xinc) > 0 &&
+			       fabs(fabs(grid.xinc) - fabs(gridInqXinc(gridID))) > fabs(grid.xinc/1000))
+			    {
+			      differ = 1;
+			    }
+			  if ( !differ && fabs(grid.yinc) > 0 &&
+			       fabs(fabs(grid.yinc) - fabs(gridInqYinc(gridID))) > fabs(grid.yinc/1000))
+			    {
+			      differ = 1;
+			    }
+			}
+		    }
+		  else
+		    {
+		      if ( grid.xvals && grid.yvals )
+			differ = compareXYvals(gridID, grid.xsize, grid.ysize, grid.xvals, grid.yvals);
+		    }
+		}
+	      else
+		differ = 1;
+	    }
+	  else if ( grid.type == GRID_GENERIC )
+	    {
+	      if ( grid.xsize == gridInqXsize(gridID) && grid.ysize == gridInqYsize(gridID) )
+		{
+		  if ( grid.xdef == 1 && grid.ydef == 1 )
+		    {
+		      if ( grid.xvals && grid.yvals )
+			differ = compareXYvals(gridID, grid.xsize, grid.ysize, grid.xvals, grid.yvals);
+		    }
+		}
+	      else if ( (grid.ysize == 0 || grid.ysize == 1) &&
+			grid.xsize == gridInqXsize(gridID)*gridInqYsize(gridID) )
+		{
+		}
+	      else
+		differ = 1;
+	    }
+	  else if ( grid.type == GRID_GAUSSIAN )
+	    {
+	      if ( grid.xsize == gridInqXsize(gridID) && grid.ysize == gridInqYsize(gridID) )
+		{
+		  if ( grid.xdef == 2 && grid.ydef == 2 )
+		    {
+		      if ( ! (IS_EQUAL(grid.xfirst, 0) && IS_EQUAL(grid.xlast, 0) && IS_EQUAL(grid.xinc, 0)) &&
+			   ! (IS_EQUAL(grid.yfirst, 0) && IS_EQUAL(grid.ylast, 0)) )
+			if ( fabs(grid.xfirst - gridInqXval(gridID, 0)) > 0.001 ||
+			     fabs(grid.yfirst - gridInqYval(gridID, 0)) > 0.001 ||
+			     (fabs(grid.xinc)>0 && fabs(fabs(grid.xinc) - fabs(gridInqXinc(gridID))) > fabs(grid.xinc/1000)) )
+			  {
+			    differ = 1;
+			  }
+		    }
+		  else
+		    {
+		      if ( grid.xvals && grid.yvals )
+			differ = compareXYvals(gridID, grid.xsize, grid.ysize, grid.xvals, grid.yvals);
+		    }
+		}
+	      else
+		differ = 1;
+	    }
+	  else if ( grid.type == GRID_CURVILINEAR )
+	    {
+	      /*
+	      printf("gridID      %d\n", gridID);
+	      printf("grid.xsize  %d\n", grid.xsize);
+	      printf("grid.ysize  %d\n", grid.ysize);
+	      printf("grid.xfirst %f\n", grid.xvals[0]);
+	      printf("grid.yfirst %f\n", grid.yvals[0]);
+	      printf("grid xfirst %f\n", gridInqXval(gridID, 0));
+	      printf("grid yfirst %f\n", gridInqYval(gridID, 0));
+	      printf("grid.xlast  %f\n", grid.xvals[grid.size-1]);
+	      printf("grid.ylast  %f\n", grid.yvals[grid.size-1]);
+	      printf("grid xlast  %f\n", gridInqXval(gridID, grid.size-1));
+	      printf("grid ylast  %f\n", gridInqYval(gridID, grid.size-1));
+	      printf("grid.nv     %d\n", grid.nvertex);
+	      printf("grid nv     %d\n", gridInqNvertex(gridID));
+	      */
+	      if ( grid.xsize == gridInqXsize(gridID) && grid.ysize == gridInqYsize(gridID) )
+		differ = compareXYvals2(gridID, grid.size, grid.xvals, grid.yvals);
+	    }
+	  else if ( grid.type == GRID_UNSTRUCTURED )
+	    {
+	      if ( grid.nvertex == gridInqNvertex(gridID) )
+		differ = compareXYvals2(gridID, grid.size, grid.xvals, grid.yvals);
+	    }
+	}
+    }
+
+  return (differ);
+}
+
+
+int gridCompareP ( void * gridptr1, void * gridptr2 )
+{
+  grid_t * g1 = ( grid_t * ) gridptr1;
+  grid_t * g2 = ( grid_t * ) gridptr2;
+  int differ = -1;
+  int equal  = 0;
+  int i, size;
+
+  xassert ( g1 );
+  xassert ( g2 );
+
+  if ( g1->type          != g2->type         ) return differ;
+  if ( g1->prec          != g2->prec         ) return differ;
+  if ( g1->lcc_projflag  != g2->lcc_projflag ) return differ;
+  if ( g1->lcc_scanflag  != g2->lcc_scanflag ) return differ;
+  if ( g1->lcc_defined   != g2->lcc_defined  ) return differ;
+  if ( g1->lcc2_defined  != g2->lcc2_defined ) return differ;
+  if ( g1->laea_defined  != g2->laea_defined ) return differ;
+  if ( g1->isCyclic      != g2->isCyclic     ) return differ;
+  if ( g1->isRotated     != g2->isRotated    ) return differ;
+  if ( g1->xdef          != g2->xdef         ) return differ;
+  if ( g1->ydef          != g2->ydef         ) return differ;
+  if ( g1->nd            != g2->nd           ) return differ;
+  if ( g1->ni            != g2->ni           ) return differ;
+  if ( g1->ni2           != g2->ni2          ) return differ;
+  if ( g1->ni3           != g2->ni3          ) return differ;
+  if ( g1->number        != g2->number       ) return differ;
+  if ( g1->position      != g2->position     ) return differ;
+  if ( g1->trunc         != g2->trunc        ) return differ;
+  if ( g1->nvertex       != g2->nvertex      ) return differ;
+  if ( g1->nrowlon       != g2->nrowlon      ) return differ;
+  if ( g1->size          != g2->size         ) return differ;
+  if ( g1->xsize         != g2->xsize        ) return differ;
+  if ( g1->ysize         != g2->ysize        ) return differ;
+  if ( g1->locked        != g2->locked       ) return differ;
+  if ( g1->lcomplex      != g2->lcomplex     ) return differ;
+
+  if ( g1->rowlon )
+    {
+      for ( i = 0; i < g1->nrowlon; i++ )
+	if ( g1->rowlon[i] != g2->rowlon[i] ) return differ; 
+    } 
+  else if ( g2->rowlon )
+    return differ;
+
+  if ( g1->xfirst        != g2->xfirst        ) return differ;       
+  if ( g1->yfirst	 != g2->yfirst        ) return differ;
+  if ( g1->xlast         != g2->xlast         ) return differ;
+  if ( g1->ylast         != g2->ylast         ) return differ;
+  if ( g1->xinc	         != g2->xinc          ) return differ;
+  if ( g1->yinc	         != g2->yinc          ) return differ;
+  if ( g1->lcc_originLon != g2->lcc_originLon ) return differ;         
+  if ( g1->lcc_originLat != g2->lcc_originLat ) return differ;
+  if ( g1->lcc_lonParY   != g2->lcc_lonParY   ) return differ;
+  if ( g1->lcc_lat1      != g2->lcc_lat1      ) return differ;
+  if ( g1->lcc_lat2      != g2->lcc_lat2      ) return differ;
+  if ( g1->lcc_xinc      != g2->lcc_xinc      ) return differ;
+  if ( g1->lcc_yinc      != g2->lcc_yinc      ) return differ;
+  if ( g1->lcc2_lon_0    != g2->lcc2_lon_0    ) return differ;         
+  if ( g1->lcc2_lat_0    != g2->lcc2_lat_0    ) return differ;
+  if ( g1->lcc2_lat_1    != g2->lcc2_lat_1    ) return differ;
+  if ( g1->lcc2_lat_2    != g2->lcc2_lat_2    ) return differ;
+  if ( g1->lcc2_a        != g2->lcc2_a        ) return differ;
+  if ( g1->laea_lon_0    != g2->laea_lon_0    ) return differ;         
+  if ( g1->laea_lat_0    != g2->laea_lat_0    ) return differ;
+  if ( g1->laea_a        != g2->laea_a        ) return differ;
+  if ( g1->xpole         != g2->xpole         ) return differ;
+  if ( g1->ypole         != g2->ypole         ) return differ;
+  if ( g1->angle         != g2->angle         ) return differ; 
+
+  
+  if ( g1->xvals )
+    {
+      if ( g1->type == GRID_UNSTRUCTURED || g1->type == GRID_CURVILINEAR )
+	size = g1->size;
+      else
+	size = g1->xsize;
+      xassert ( size );
+
+      if ( !g2->xvals ) return differ;
+
+      for ( i = 0; i < size; i++ )
+	if ( g1->xvals[i] != g2->xvals[i] ) return differ; 
+    } 
+  else if ( g2->xvals )
+    return differ;
+  
+  if ( g1->yvals )
+    {
+      if ( g1->type == GRID_UNSTRUCTURED || g1->type == GRID_CURVILINEAR )
+	size = g1->size;
+      else
+	size = g1->ysize;
+      xassert ( size );
+
+      if ( !g2->yvals ) return differ;
+
+      for ( i = 0; i < size; i++ )
+	  if ( g1->yvals[i] != g2->yvals[i] ) return differ;
+    } 
+  else if ( g2->yvals )
+    return differ;
+  
+  if ( g1->area )
+    {
+      xassert ( g1->size );
+
+      if ( !g2->area ) return differ;
+
+      for ( i = 0; i < g1->size; i++ )
+	if ( g1->area[i] != g2->area[i] ) return differ;
+    } 
+  else if ( g2->area )
+    return differ;
+
+  if ( g1->xbounds )
+    {
+      xassert ( g1->nvertex );
+      if ( g1->type == GRID_CURVILINEAR || g1->type == GRID_UNSTRUCTURED )
+	size = g1->nvertex * g1->size;
+      else
+	size = g1->nvertex * g1->xsize;
+      xassert ( size );
+
+      if ( !g2->xbounds ) return differ;
+
+      for ( i = 0; i < size; i++ )
+	if ( g1->xbounds[i] != g2->xbounds[i] ) return differ;
+    } 
+  else if ( g2->xbounds )
+    return differ;
+
+  if ( g1->ybounds )
+    {
+      xassert ( g1->nvertex );
+      if ( g1->type == GRID_CURVILINEAR || g1->type == GRID_UNSTRUCTURED )
+	size = g1->nvertex * g1->size;
+      else
+	size = g1->nvertex * g1->ysize;
+      xassert ( size );
+
+      if ( !g2->ybounds ) return differ;
+
+      for ( i = 0; i < size; i++ )
+	if ( g1->ybounds[i] != g2->ybounds[i] ) return differ;
+    } 
+  else if ( g2->ybounds )
+    return differ;
+
+  if ( memcmp ( &g1->xname    ,&g2->xname    ,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->yname    ,&g2->yname    ,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->xlongname,&g2->xlongname,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->ylongname,&g2->ylongname,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->xstdname ,&g2->xstdname ,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->ystdname ,&g2->ystdname ,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->xunits   ,&g2->xunits   ,CDI_MAX_NAME )) 
+    return differ;
+  if ( memcmp ( &g1->yunits   ,&g2->yunits   ,CDI_MAX_NAME )) 
+    return differ; 
+
+  if ( g1->reference )
+    {
+      if ( !g2->reference ) return differ;
+      size = strlen ( g1->reference ) + 1;
+      if ( memcmp ( g1->reference, g2->reference, size )) 
+	return differ;
+    }
+  else if ( g2->reference )
+    return differ;
+
+  if ( g1->mask )
+    {
+      xassert ( g1->size );
+      if ( !g2->mask ) return differ;
+      if ( memcmp ( g1->mask, g2->mask, g1->size * sizeof ( unsigned char ))) 
+	return differ;
+    }
+  else if ( g2->mask )
+    return differ;
+
+  if ( g1->mask_gme )
+    {
+      xassert ( g1->size );
+      if ( !g2->mask_gme ) return differ;
+      if ( memcmp ( g1->mask_gme, g2->mask_gme, 
+		    g1->size * sizeof ( unsigned char ))) return differ;
+    }
+  else if ( g2->mask_gme )
+    return differ;
+
+  return equal;
+}
+
+
+int gridGenerate(grid_t grid)
+{
+  int gridID;
+  grid_t *gridptr;
+
+  gridID = gridCreate(grid.type, grid.size);
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridDefPrec(gridID, grid.prec);
+
+  switch (grid.type)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_UNSTRUCTURED:
+    case GRID_CURVILINEAR:
+    case GRID_GENERIC:
+    case GRID_LCC:
+    case GRID_LCC2:
+    case GRID_SINUSOIDAL:
+    case GRID_LAEA:
+    case GRID_PROJECTION:
+      {
+	if ( grid.xsize > 0 ) gridDefXsize(gridID, grid.xsize);
+	if ( grid.ysize > 0 ) gridDefYsize(gridID, grid.ysize);
+
+        if ( grid.type == GRID_GAUSSIAN ) gridDefNP(gridID, grid.np);
+
+	if ( grid.nvertex > 0 )
+	  gridDefNvertex(gridID, grid.nvertex);
+
+	if ( grid.xdef == 1 )
+	  {
+	    gridDefXvals(gridID, grid.xvals);
+	    if ( grid.xbounds )
+	      gridDefXbounds(gridID, grid.xbounds);
+	  }
+	else if ( grid.xdef == 2 )
+	  {
+	    double *xvals = (double *) malloc(grid.xsize*sizeof(double));
+	    gridGenXvals(grid.xsize, grid.xfirst, grid.xlast, grid.xinc, xvals);
+	    gridDefXvals(gridID, xvals);
+	    free(xvals);
+	    /*
+	    gridDefXinc(gridID, grid.xinc);
+	    */
+	  }
+
+	if ( grid.ydef == 1 )
+	  {
+	    gridDefYvals(gridID, grid.yvals);
+	    if ( grid.ybounds && grid.nvertex )
+	      gridDefYbounds(gridID, grid.ybounds);
+	  }
+	else if ( grid.ydef == 2 )
+	  {
+	    double *yvals = (double *) malloc(grid.ysize*sizeof(double));
+	    gridGenYvals(grid.type, grid.ysize, grid.yfirst, grid.ylast, grid.yinc, yvals);
+	    gridDefYvals(gridID, yvals);
+	    free(yvals);
+	    /*
+	    gridDefYinc(gridID, grid.yinc);
+	    */
+	  }
+
+	if ( grid.isRotated )
+	  {
+	    gridDefXname(gridID, "rlon");
+	    gridDefYname(gridID, "rlat");
+	    gridDefXlongname(gridID, "longitude in rotated pole grid");
+	    gridDefYlongname(gridID, "latitude in rotated pole grid");
+	    strcpy(gridptr->xstdname, "grid_longitude");
+	    strcpy(gridptr->ystdname, "grid_latitude");
+	    gridDefXunits(gridID, "degrees");
+	    gridDefYunits(gridID, "degrees");
+
+	    gridDefXpole(gridID, grid.xpole);
+	    gridDefYpole(gridID, grid.ypole);
+	    gridDefAngle(gridID, grid.angle);
+	  }
+
+	if ( grid.area )
+	  {
+	    gridDefArea(gridID, grid.area);
+	  }
+
+	if ( grid.type == GRID_LAEA )
+	  gridDefLaea(gridID, grid.laea_a, grid.laea_lon_0, grid.laea_lat_0);
+
+	if ( grid.type == GRID_LCC2 )
+	  gridDefLcc2(gridID, grid.lcc2_a, grid.lcc2_lon_0, grid.lcc2_lat_0, grid.lcc2_lat_1, grid.lcc2_lat_2);
+
+	if ( grid.type == GRID_LCC )
+	  gridDefLCC(gridID, grid.lcc_originLon, grid.lcc_originLat, grid.lcc_lonParY,
+		     grid.lcc_lat1, grid.lcc_lat2, grid.lcc_xinc, grid.lcc_yinc,
+		     grid.lcc_projflag, grid.lcc_scanflag);
+
+	if ( grid.type == GRID_PROJECTION )
+	  {
+	    gridptr->name = strdup(grid.name);
+	  }
+
+	break;
+      }
+    case GRID_GAUSSIAN_REDUCED:
+      {
+	gridDefNP(gridID, grid.np);
+	gridDefYsize(gridID, grid.ysize);
+	gridDefRowlon(gridID, grid.ysize, grid.rowlon);
+
+	if ( grid.ydef == 1 )
+	  {
+	    gridDefYvals(gridID, grid.yvals);
+	    if ( grid.ybounds && grid.nvertex )
+	      gridDefYbounds(gridID, grid.ybounds);
+	  }
+	else if ( grid.ydef == 2 )
+	  {
+	    double *yvals = (double *) malloc(grid.ysize*sizeof(double));
+	    gridGenYvals(grid.type, grid.ysize, grid.yfirst, grid.ylast, grid.yinc, yvals);
+	    gridDefYvals(gridID, yvals);
+	    free(yvals);
+	    /*
+	    gridDefYinc(gridID, grid.yinc);
+	    */
+	  }
+	break;
+      }
+    case GRID_SPECTRAL:
+      {
+        gridDefTrunc(gridID, grid.trunc);
+        if ( grid.lcomplex ) gridDefComplexPacking(gridID, 1);
+        break;
+      }
+    case GRID_FOURIER:
+      {
+	gridDefTrunc(gridID, grid.trunc);
+	break;
+      }
+    case GRID_GME:
+      {
+        gridDefGMEnd(gridID, grid.nd);
+        gridDefGMEni(gridID, grid.ni);
+        gridDefGMEni2(gridID, grid.ni2);
+        gridDefGMEni3(gridID, grid.ni3);
+        break;
+      }
+    case GRID_REFERENCE:
+      {
+        gridDefNumber(gridID, grid.number);
+        gridDefPosition(gridID, grid.position);
+        gridDefUUID(gridID, grid.uuid);
+        if ( grid.reference ) gridDefReference(gridID, grid.reference);
+        break;
+      }
+      /*
+    case GRID_GENERIC:
+      {
+        if ( grid.xsize > 0 && grid.ysize > 0 )
+          {
+            gridDefXsize(gridID, grid.xsize);
+            gridDefYsize(gridID, grid.ysize);
+            if ( grid.xvals ) gridDefXvals(gridID, grid.xvals);
+            if ( grid.yvals ) gridDefYvals(gridID, grid.yvals);
+          }
+        break;
+      }
+      */
+    case GRID_TRAJECTORY:
+      {
+        gridDefXsize(gridID, 1);
+        gridDefYsize(gridID, 1);
+        break;
+      }
+    default:
+      {
+	Error("Gridtype %s unsupported!", gridNamePtr(grid.type));
+	break;
+      }
+    }
+
+  if ( grid.xname[0]     ) gridDefXname(gridID, grid.xname);
+  if ( grid.xlongname[0] ) gridDefXlongname(gridID, grid.xlongname);
+  if ( grid.xunits[0]    ) gridDefXunits(gridID, grid.xunits);
+  if ( grid.yname[0]     ) gridDefYname(gridID, grid.yname);
+  if ( grid.ylongname[0] ) gridDefYlongname(gridID, grid.ylongname);
+  if ( grid.yunits[0]    ) gridDefYunits(gridID, grid.yunits);
+
+  return (gridID);
+}
+
+/*
+ at Function  gridDuplicate
+ at Title     Duplicate a horizontal Grid
+
+ at Prototype int gridDuplicate(int gridID)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate},
+                    @fref{gridDuplicate} or @fref{vlistInqVarGrid}.
+
+ at Description
+The function @func{gridDuplicate} duplicates a horizontal Grid.
+
+ at Result
+ at func{gridDuplicate} returns an identifier to the duplicated Grid.
+
+ at EndFunction
+*/
+int gridDuplicate(int gridID)
+{
+  int gridIDnew;
+  int gridtype, gridsize;
+  int nrowlon;
+  int size;
+  grid_t *gridptr, *gridptrnew;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridtype = gridInqType(gridID);
+  gridsize = gridInqSize(gridID);
+
+  gridIDnew = gridCreate(gridtype, gridsize);
+  gridptrnew = ( grid_t *) reshGetVal ( gridIDnew, &gridOps );
+
+  grid_copy(gridptrnew, gridptr);
+
+  strcpy(gridptrnew->xname, gridptr->xname);
+  strcpy(gridptrnew->yname, gridptr->yname);
+  strcpy(gridptrnew->xlongname, gridptr->xlongname);
+  strcpy(gridptrnew->ylongname, gridptr->ylongname);
+  strcpy(gridptrnew->xunits, gridptr->xunits);
+  strcpy(gridptrnew->yunits, gridptr->yunits);
+  strcpy(gridptrnew->xstdname, gridptr->xstdname);
+  strcpy(gridptrnew->ystdname, gridptr->ystdname);
+
+  nrowlon = gridptr->nrowlon;
+  if ( nrowlon )
+    {
+      gridptrnew->rowlon = (int *) malloc(nrowlon*sizeof(int));
+      memcpy(gridptrnew->rowlon, gridptr->rowlon, nrowlon*sizeof(int));
+    }
+
+  if ( gridptr->xvals != NULL )
+    {
+      if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED )
+	size = gridsize;
+      else
+        size = gridptr->xsize;
+
+      gridptrnew->xvals = (double *) malloc(size*sizeof(double));
+      memcpy(gridptrnew->xvals, gridptr->xvals, size*sizeof(double));
+    }
+
+  if ( gridptr->yvals != NULL )
+    {
+      if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED )
+	size = gridsize;
+      else
+        size = gridptr->ysize;
+
+      gridptrnew->yvals = (double *) malloc(size*sizeof(double));
+      memcpy(gridptrnew->yvals, gridptr->yvals, size*sizeof(double));
+    }
+
+  if ( gridptr->xbounds != NULL )
+    {
+      if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED )
+	size = gridsize;
+      else
+        size = gridptr->xsize;
+
+      size *= gridptr->nvertex;
+
+      gridptrnew->xbounds = (double *) malloc(size*sizeof(double));
+      memcpy(gridptrnew->xbounds, gridptr->xbounds, size*sizeof(double));
+    }
+
+  if ( gridptr->ybounds != NULL )
+    {
+      if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED )
+	size = gridsize;
+      else
+        size = gridptr->ysize;
+
+      size *= gridptr->nvertex;
+
+      gridptrnew->ybounds = (double *) malloc(size*sizeof(double));
+      memcpy(gridptrnew->ybounds, gridptr->ybounds, size*sizeof(double));
+    }
+
+  if ( gridptr->area != NULL )
+    {
+      size = gridsize;
+
+      gridptrnew->area = (double *) malloc(size*sizeof(double));
+      memcpy(gridptrnew->area, gridptr->area, size*sizeof(double));
+    }
+
+  if ( gridptr->mask != NULL )
+    {
+      size = gridsize;
+
+      gridptrnew->mask = (mask_t *) malloc(size*sizeof(mask_t));
+      memcpy(gridptrnew->mask, gridptr->mask, size*sizeof(mask_t));
+    }
+
+  if ( gridptr->mask_gme != NULL )
+    {
+      size = gridsize;
+
+      gridptrnew->mask_gme = (mask_t *) malloc(size*sizeof(mask_t));
+      memcpy(gridptrnew->mask_gme, gridptr->mask_gme, size*sizeof(mask_t));
+    }
+
+  return (gridIDnew);
+}
+
+
+void gridCompress(int gridID)
+{
+  int gridtype, gridsize;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridtype = gridInqType(gridID);
+  gridsize = gridInqSize(gridID);
+
+  if ( gridtype == GRID_UNSTRUCTURED )
+    {
+      if ( gridptr->mask_gme != NULL )
+	{
+	  long i, j, iv, nv;
+
+	  nv = gridptr->nvertex;
+
+	  j = 0;
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+	      if ( gridptr->mask_gme[i] )
+		{
+		  if ( gridptr->xvals != NULL ) gridptr->xvals[j] = gridptr->xvals[i];
+		  if ( gridptr->yvals != NULL ) gridptr->yvals[j] = gridptr->yvals[i];
+		  if ( gridptr->area  != NULL ) gridptr->area[j]  = gridptr->area[i];
+		  if ( gridptr->xbounds != NULL )
+		    for ( iv = 0; iv < nv; iv++ )
+		      gridptr->xbounds[j*nv+iv] = gridptr->xbounds[i*nv+iv];
+		  if ( gridptr->ybounds != NULL )
+		    for ( iv = 0; iv < nv; iv++ )
+		      gridptr->ybounds[j*nv+iv] = gridptr->ybounds[i*nv+iv];
+
+		  j++;
+		}
+	    }
+
+	  /* fprintf(stderr, "grid compress %d %d %d\n", i, j, gridsize); */
+	  gridsize = j;
+	  gridptr->size  = gridsize;
+	  gridptr->xsize = gridsize;
+	  gridptr->ysize = gridsize;
+
+	  if ( gridptr->xvals )
+	    gridptr->xvals = (double *) realloc(gridptr->xvals, gridsize*sizeof(double));
+
+	  if ( gridptr->yvals )
+	    gridptr->yvals = (double *) realloc(gridptr->yvals, gridsize*sizeof(double));
+
+	  if ( gridptr->area )
+	    gridptr->area  = (double *) realloc(gridptr->area, gridsize*sizeof(double));
+
+	  if ( gridptr->xbounds )
+	    gridptr->xbounds = (double *) realloc(gridptr->xbounds, nv*gridsize*sizeof(double));
+
+	  if ( gridptr->ybounds )
+	    gridptr->ybounds = (double *) realloc(gridptr->ybounds, nv*gridsize*sizeof(double));
+
+	  free(gridptr->mask_gme);
+	  gridptr->mask_gme = NULL;
+	}
+    }
+  else
+    Warning("Unsupported grid type: %s", gridNamePtr(gridtype));
+}
+
+
+void gridDefArea(int gridID, const double *area)
+{
+  long size;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( size == 0 )
+    Error("size undefined for gridID = %d", gridID);
+
+  if ( gridptr->area == NULL )
+    gridptr->area = (double *) malloc(size*sizeof(double));
+  else if ( CDI_Debug )
+    Warning("values already defined!");
+
+  memcpy(gridptr->area, area, size*sizeof(double));
+}
+
+
+void gridInqArea(int gridID, double *area)
+{
+  long size;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  size = gridptr->size;
+
+  if ( gridptr->area )
+    memcpy(area, gridptr->area, size*sizeof(double));
+}
+
+
+int gridHasArea(int gridID)
+{
+  int hasArea = FALSE;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->area != NULL ) hasArea = TRUE;
+
+  return (hasArea);
+}
+
+
+const double *gridInqAreaPtr(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->area);
+}
+
+
+void gridDefNvertex(int gridID, int nvertex)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->nvertex = nvertex;
+}
+
+
+int gridInqNvertex(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->nvertex);
+}
+
+/*
+ at Function  gridDefXbounds
+ at Title     Define the bounds of a X-axis
+
+ at Prototype void gridDefXbounds(int gridID, const double *xbounds)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  xbounds  X-bounds of the grid.
+
+ at Description
+The function @func{gridDefXbounds} defines all bounds of the X-axis.
+
+ at EndFunction
+*/
+void gridDefXbounds(int gridID, const double *xbounds)
+{
+  long size;
+  long nvertex;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning ("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  nvertex = gridptr->nvertex;
+  if ( nvertex == 0 )
+    {
+      Warning("nvertex undefined for gridID = %d. Cannot define bounds!", gridID);
+      return;
+    }
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = nvertex*gridptr->size;
+  else
+    size = nvertex*gridptr->xsize;
+
+  if ( size == 0 )
+    Error("size undefined for gridID = %d", gridID);
+
+  if ( gridptr->xbounds == NULL )
+    gridptr->xbounds = (double *) malloc(size*sizeof(double));
+  else if ( CDI_Debug )
+    Warning("values already defined!");
+
+  memcpy(gridptr->xbounds, xbounds, size*sizeof(double));
+}
+
+/*
+ at Function  gridInqXbounds
+ at Title     Get the bounds of a X-axis
+
+ at Prototype int gridInqXbounds(int gridID, double *xbounds)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  xbounds  Pointer to the location into which the X-bounds are read.
+                    The caller must allocate space for the returned values.
+
+ at Description
+The function @func{gridInqXbounds} returns the bounds of the X-axis.
+
+ at Result
+Upon successful completion @func{gridInqXbounds} returns the number of bounds and
+the bounds are stored in @func{xbounds}.
+Otherwise, 0 is returned and @func{xbounds} is empty.
+
+ at EndFunction
+*/
+int gridInqXbounds(int gridID, double *xbounds)
+{
+  long size;
+  long nvertex;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  nvertex = gridptr->nvertex;
+  if ( CDI_Debug && nvertex == 0 )
+    Warning("nvertex undefined for gridID = %d", gridID);
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = nvertex*gridptr->size;
+  else
+    size = nvertex*gridptr->xsize;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("size undefined for gridID = %d", gridID);
+
+  if ( xbounds && gridptr->xbounds )
+    memcpy(xbounds, gridptr->xbounds, size*sizeof(double));
+
+  if ( gridptr->xbounds == NULL ) size = 0;
+
+  return ((int)size);
+}
+
+
+double *gridInqXboundsPtr(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->xbounds);
+}
+
+/*
+ at Function  gridDefYbounds
+ at Title     Define the bounds of a Y-axis
+
+ at Prototype void gridDefYbounds(int gridID, const double *ybounds)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  ybounds  Y-bounds of the grid.
+
+ at Description
+The function @func{gridDefYbounds} defines all bounds of the Y-axis.
+
+ at EndFunction
+*/
+void gridDefYbounds(int gridID, const double *ybounds)
+{
+  long size;
+  long nvertex;
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  nvertex = gridptr->nvertex;
+  if ( nvertex == 0 )
+    {
+      Warning("nvertex undefined for gridID = %d. Cannot define bounds!", gridID);
+      return;
+    }
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = nvertex*gridptr->size;
+  else
+    size = nvertex*gridptr->ysize;
+
+  if ( size == 0 )
+    Error("size undefined for gridID = %d", gridID);
+
+  if ( gridptr->ybounds == NULL )
+    gridptr->ybounds = (double *) malloc(size*sizeof(double));
+  else if ( CDI_Debug )
+    Warning("values already defined!");
+
+  memcpy(gridptr->ybounds, ybounds, size*sizeof(double));
+}
+
+/*
+ at Function  gridInqYbounds
+ at Title     Get the bounds of a Y-axis
+
+ at Prototype int gridInqYbounds(int gridID, double *ybounds)
+ at Parameter
+    @Item  gridID   Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  ybounds  Pointer to the location into which the Y-bounds are read.
+                    The caller must allocate space for the returned values.
+
+ at Description
+The function @func{gridInqYbounds} returns the bounds of the Y-axis.
+
+ at Result
+Upon successful completion @func{gridInqYbounds} returns the number of bounds and
+the bounds are stored in @func{ybounds}.
+Otherwise, 0 is returned and @func{ybounds} is empty.
+
+ at EndFunction
+*/
+int gridInqYbounds(int gridID, double *ybounds)
+{
+  long size;
+  long nvertex;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  nvertex = gridptr->nvertex;
+  if ( CDI_Debug && nvertex == 0 )
+    Warning("nvertex undefined for gridID = %d", gridID);
+
+  if ( gridptr->type == GRID_CURVILINEAR || gridptr->type == GRID_UNSTRUCTURED )
+    size = nvertex*gridptr->size;
+  else
+    size = nvertex*gridptr->ysize;
+
+  if ( CDI_Debug && size == 0 )
+    Warning("size undefined for gridID = %d", gridID);
+
+  if ( ybounds && gridptr->ybounds )
+    memcpy(ybounds, gridptr->ybounds, size*sizeof(double));
+
+  if ( gridptr->ybounds == NULL ) size = 0;
+
+  return ((int)size);
+}
+
+
+double *gridInqYboundsPtr(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->ybounds);
+}
+
+
+void gridPrintKernel(grid_t * gridptr, int opt, FILE *fp)
+{
+  int type;
+  int gridsize, xsize, ysize, xdim, ydim;
+  int trunc;
+  int nbyte0, nbyte;
+  int i;
+  int nvertex, iv;
+  char uuid[17];
+  int gridID = gridptr->self;
+  const double *area    = gridInqAreaPtr(gridID);
+  const double *xvals   = gridInqXvalsPtr(gridID);
+  const double *yvals   = gridInqYvalsPtr(gridID);
+  const double *xbounds = gridInqXboundsPtr(gridID);
+  const double *ybounds = gridInqYboundsPtr(gridID);
+
+  grid_check_ptr(gridID, gridptr);
+
+  type     = gridInqType(gridID);
+  trunc    = gridInqTrunc(gridID);
+  gridsize = gridInqSize(gridID);
+  xsize    = gridInqXsize(gridID);
+  ysize    = gridInqYsize(gridID);
+  nvertex  = gridInqNvertex(gridID);
+
+  nbyte0 = 0;
+  fprintf(fp, "#\n");
+  fprintf(fp, "# gridID %d\n", gridID);
+  fprintf(fp, "#\n");
+  fprintf(fp, "gridtype  = %s\n", gridNamePtr(type));
+  fprintf(fp, "gridsize  = %d\n", gridsize);
+
+  if ( type != GRID_GME )
+    {
+      if ( gridptr->xname[0]     )     fprintf(fp, "xname     = %s\n", gridptr->xname);
+      if ( gridptr->xlongname[0] )     fprintf(fp, "xlongname = %s\n", gridptr->xlongname);
+      if ( gridptr->xunits[0]    )     fprintf(fp, "xunits    = %s\n", gridptr->xunits);
+      if ( gridptr->yname[0]     )     fprintf(fp, "yname     = %s\n", gridptr->yname);
+      if ( gridptr->ylongname[0] )     fprintf(fp, "ylongname = %s\n", gridptr->ylongname);
+      if ( gridptr->yunits[0]    )     fprintf(fp, "yunits    = %s\n", gridptr->yunits);
+      if ( type == GRID_UNSTRUCTURED ) fprintf(fp, "nvertex   = %d\n", nvertex);
+    }
+
+  switch (type)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_GENERIC:
+    case GRID_LCC2:
+    case GRID_SINUSOIDAL:
+    case GRID_LAEA:
+    case GRID_CURVILINEAR:
+    case GRID_UNSTRUCTURED:
+      {
+        if ( type == GRID_GAUSSIAN ) fprintf(fp, "np        = %d\n", gridptr->np);
+
+	if ( type == GRID_CURVILINEAR || type == GRID_UNSTRUCTURED )
+	  {
+	    xdim = gridsize;
+	    ydim = gridsize;
+	  }
+	else
+	  {
+	    xdim = xsize;
+	    ydim = ysize;
+	  }
+
+	if ( type != GRID_UNSTRUCTURED )
+	  {
+	    if ( xsize > 0 ) fprintf(fp, "xsize     = %d\n", xsize);
+	    if ( ysize > 0 ) fprintf(fp, "ysize     = %d\n", ysize);
+	  }
+
+	if ( type == GRID_LAEA )
+	  {
+	    double a, lon_0, lat_0;
+	    gridInqLaea(gridID, &a, &lon_0, &lat_0);
+	    fprintf(fp, "a         = %g\n", a);
+	    fprintf(fp, "lon_0     = %g\n", lon_0);
+	    fprintf(fp, "lat_0     = %g\n", lat_0);
+	  }
+
+	if ( type == GRID_LCC2 )
+	  {
+	    double a, lon_0, lat_0, lat_1, lat_2;
+	    gridInqLcc2(gridID, &a, &lon_0, &lat_0, &lat_1, &lat_2);
+	    fprintf(fp, "a         = %g\n", a);
+	    fprintf(fp, "lon_0     = %g\n", lon_0);
+	    fprintf(fp, "lat_0     = %g\n", lat_0);
+	    fprintf(fp, "lat_1     = %g\n", lat_1);
+	    fprintf(fp, "lat_2     = %g\n", lat_2);
+	  }
+
+	if ( gridptr->isRotated )
+	  {
+	    if ( xsize > 0 ) fprintf(fp, "xnpole    = %g\n", gridptr->xpole);
+	    if ( ysize > 0 ) fprintf(fp, "ynpole    = %g\n", gridptr->ypole);
+	    if ( gridptr->angle > 0 ) fprintf(fp, "angle     = %g\n", gridptr->angle);
+ 	  }
+
+	if ( xvals )
+	  {
+	    double xfirst = 0.0, xinc = 0.0;
+
+	    if ( type == GRID_LONLAT     || type == GRID_GAUSSIAN || 
+		 type == GRID_GENERIC    || type == GRID_LCC2     || 
+                 type == GRID_SINUSOIDAL || type == GRID_LAEA )
+	      {
+		xfirst = gridInqXval(gridID, 0);
+		xinc   = gridInqXinc(gridID);
+	      }
+
+	    if ( IS_NOT_EQUAL(xinc, 0) && opt )
+	      {
+	  	fprintf(fp, "xfirst    = %g\n", xfirst);
+		fprintf(fp, "xinc      = %g\n", xinc);
+	      }
+	    else
+	      {
+		nbyte0 = fprintf(fp, "xvals     = ");
+		nbyte = nbyte0;
+		for ( i = 0; i < xdim; i++ )
+		  {
+		    if ( nbyte > 80 )
+		      {
+			fprintf(fp, "\n");
+			fprintf(fp, "%*s", nbyte0, "");
+			nbyte = nbyte0;
+		      }
+		    nbyte += fprintf(fp, "%.9g ", xvals[i]);
+		  }
+		fprintf(fp, "\n");
+	      }
+	  }
+
+	if ( xbounds )
+	  {
+	    nbyte0 = fprintf(fp, "xbounds   = ");
+	    for ( i = 0; i < xdim; i++ )
+	      {
+		if ( i ) fprintf(fp, "%*s", nbyte0, "");
+
+		for ( iv = 0; iv < nvertex; iv++ )
+		  fprintf(fp, "%.9g ", xbounds[i*nvertex+iv]);
+		fprintf(fp, "\n");
+	      }
+	  }
+
+	if ( yvals )
+	  {
+	    double yfirst = 0.0, yinc = 0.0;
+
+	    if ( type == GRID_LONLAT || type == GRID_GENERIC || type == GRID_LCC2 ||
+		 type == GRID_SINUSOIDAL || type == GRID_LAEA )
+	      {
+		yfirst = gridInqYval(gridID, 0);
+		yinc   = gridInqYinc(gridID);
+	      }
+
+	    if ( IS_NOT_EQUAL(yinc, 0) && opt )
+	      {
+	  	fprintf(fp, "yfirst    = %g\n", yfirst);
+		fprintf(fp, "yinc      = %g\n", yinc);
+	      }
+	    else
+	      {
+		nbyte0 = fprintf(fp, "yvals     = ");
+		nbyte = nbyte0;
+		for ( i = 0; i < ydim; i++ )
+		  {
+		    if ( nbyte > 80 )
+		      {
+			fprintf(fp, "\n");
+			fprintf(fp, "%*s", nbyte0, "");
+			nbyte = nbyte0;
+		      }
+		    nbyte += fprintf(fp, "%.9g ", yvals[i]);
+		  }
+		fprintf(fp, "\n");
+	      }
+	  }
+
+	if ( ybounds )
+	  {
+	    nbyte0 = fprintf(fp, "ybounds   = ");
+	    for ( i = 0; i < ydim; i++ )
+	      {
+		if ( i ) fprintf(fp, "%*s", nbyte0, "");
+
+		for ( iv = 0; iv < nvertex; iv++ )
+		  fprintf(fp, "%.9g ", ybounds[i*nvertex+iv]);
+		fprintf(fp, "\n");
+	      }
+	  }
+
+	if ( area )
+	  {
+	    nbyte0 = fprintf(fp, "area      = ");
+	    nbyte  = nbyte0;
+	    for ( i = 0; i < gridsize; i++ )
+	      {
+		if ( nbyte > 80 )
+		  {
+		    fprintf(fp, "\n");
+		    fprintf(fp, "%*s", nbyte0, "");
+		    nbyte = nbyte0;
+		  }
+		nbyte += fprintf(fp, "%.9g ", area[i]);
+	      }
+	    fprintf(fp, "\n");
+	  }
+	break;
+      }
+   case GRID_GAUSSIAN_REDUCED:
+      {
+	int *rowlon;
+	fprintf(fp, "ysize = %d\n", ysize);
+	nbyte0 = fprintf(fp, "rowlon = %d  ", ysize);
+	nbyte  = nbyte0;
+	rowlon = (int *) malloc(ysize*sizeof(int));
+	gridInqRowlon(gridID, rowlon);
+	for ( i = 0; i < ysize; i++ )
+	  {
+	    if ( nbyte > 80 )
+	      {
+		fprintf(fp, "\n");
+		fprintf(fp, "%*s", nbyte0, "");
+		nbyte = nbyte0;
+	      }
+	    nbyte += fprintf(fp, "%d ", rowlon[i]);
+	  }
+	fprintf(fp, "\n");
+	free(rowlon);
+	break;
+      }
+    case GRID_LCC:
+      {
+	double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
+	int projflag, scanflag;
+	gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm,
+		   &projflag, &scanflag);
+
+	fprintf(fp, "xsize     = %d\n", xsize);
+	fprintf(fp, "ysize     = %d\n", ysize);
+
+	fprintf(fp, "originLon = %g\n", originLon);
+	fprintf(fp, "originLat = %g\n", originLat);
+	fprintf(fp, "lonParY   = %g\n", lonParY);
+	fprintf(fp, "lat1      = %g\n", lat1);
+	fprintf(fp, "lat2      = %g\n", lat2);
+	fprintf(fp, "xinc      = %g\n", xincm);
+	fprintf(fp, "yinc      = %g\n", yincm);
+	if ( (projflag & 128) == 0 )
+	  fprintf(fp, "projection = northpole\n");
+	else
+	  fprintf(fp, "projection = southpole\n");
+
+	break;
+      }
+    case GRID_SPECTRAL:
+      {
+        fprintf(fp, "truncation = %d\n", trunc);
+        fprintf(fp, "complexpacking = %d\n", gridptr->lcomplex );
+        break;
+      }
+    case GRID_FOURIER:
+      {
+	fprintf(fp, "truncation = %d\n", trunc);
+	break;
+      }
+    case GRID_GME:
+      {
+        fprintf(fp, "ni        = %d\n", gridptr->ni );
+        break;
+      }
+    case GRID_REFERENCE:
+      {
+        const unsigned char *d;
+	fprintf(fp, "number    = %d\n", gridInqNumber(gridID));
+	fprintf(fp, "position  = %d\n", gridInqPosition(gridID));
+        gridInqUUID(gridID, uuid);
+        d = (unsigned char *) &uuid;
+	fprintf(fp, "uuid      = %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n", 
+                d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7],
+                d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]);
+	if ( gridInqReference(gridID, NULL) )
+	  {
+	    char reference_link[8192];
+	    gridInqReference(gridID, reference_link);
+	    fprintf(fp, "path      = %s\n", reference_link);
+	  }
+	break;
+      }
+   default:
+      {
+	fprintf(stderr, "Unsupported grid type: %s\n", gridNamePtr(type));
+      }
+    }
+
+  if ( gridptr->mask )
+    {
+      nbyte0 = fprintf(fp, "mask      = ");
+      nbyte  = nbyte0;
+      for ( i = 0; i < gridsize; i++ )
+        {
+          if ( nbyte > 80 )
+            {
+              fprintf(fp, "\n");
+              fprintf(fp, "%*s", nbyte0, "");
+              nbyte = nbyte0;
+            }
+          nbyte += fprintf(fp, "%d ", (int) gridptr->mask[i]);
+        }
+      fprintf(fp, "\n");
+    }
+}
+
+void gridPrint ( int gridID, int opt )
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridPrintKernel ( gridptr, opt, stdout );
+}
+
+
+
+void gridPrintP ( void * voidptr, FILE * fp )
+{
+  grid_t * gridptr = ( grid_t * ) voidptr;
+  int nbyte0, nbyte, i;
+
+  xassert ( gridptr );
+
+  gridPrintKernel ( gridptr , 0, fp );
+
+  fprintf ( fp, "precision = %d\n", gridptr->prec);
+  fprintf ( fp, "nd        = %d\n", gridptr->nd );
+  fprintf ( fp, "ni        = %d\n", gridptr->ni );
+  fprintf ( fp, "ni2       = %d\n", gridptr->ni2 );
+  fprintf ( fp, "ni3       = %d\n", gridptr->ni3 ); 
+  fprintf ( fp, "number    = %d\n", gridptr->number );
+  fprintf ( fp, "position  = %d\n", gridptr->position );
+  fprintf ( fp, "trunc     = %d\n", gridptr->trunc );
+  fprintf ( fp, "lcomplex  = %d\n", gridptr->lcomplex );
+  fprintf ( fp, "nrowlon   = %d\n", gridptr->nrowlon );
+
+  if ( gridptr->rowlon )
+    {
+      nbyte0 = fprintf(fp, "rowlon    = ");
+      nbyte  = nbyte0;
+      for ( i = 0; i < gridptr->nrowlon; i++ )
+        {
+          if ( nbyte > 80 )
+            {
+              fprintf(fp, "\n");
+              fprintf(fp, "%*s", nbyte0, "");
+              nbyte = nbyte0;
+            }
+          nbyte += fprintf(fp, "%d ", gridptr->rowlon[i]);
+        }
+      fprintf(fp, "\n");
+    }
+
+  if ( gridptr->mask_gme )
+    {
+      nbyte0 = fprintf(fp, "mask_gme  = ");
+      nbyte  = nbyte0;
+      for ( i = 0; i < gridptr->size; i++ )
+        {
+          if ( nbyte > 80 )
+            {
+              fprintf(fp, "\n");
+              fprintf(fp, "%*s", nbyte0, "");
+              nbyte = nbyte0;
+            }
+          nbyte += fprintf(fp, "%d ", (int) gridptr->mask_gme[i]);
+        }
+      fprintf(fp, "\n");
+    }
+}
+
+
+const double *gridInqXvalsPtr(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return ( gridptr->xvals );
+}
+
+
+const double *gridInqYvalsPtr(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return ( gridptr->yvals );
+}
+
+/*
+ at Function  gridDefLCC
+ at Title     Define the parameter of a Lambert Conformal Conic grid
+
+ at Prototype void gridDefLCC(int gridID, double originLon, double originLat, double lonParY, double lat1, double lat2, double xinc, double yinc, int projflag, int scanflag)
+ at Parameter
+    @Item  gridID    Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  originLon Longitude of the first grid point.
+    @Item  originLat Latitude of the first grid point.
+    @Item  lonParY   The East longitude of the meridian which is parallel to the Y-axis.
+    @Item  lat1      First latitude from the pole at which the secant cone cuts the sphere.
+    @Item  lat2      Second latitude at which the secant cone cuts the sphere.
+    @Item  xinc      X-direction grid lenght in meter.
+    @Item  yinc      Y-direction grid lenght in meter.
+    @Item  projflag  Projection centre flag.
+    @Item  scanflag  Scanning mode flag.
+ 
+ at Description
+The function @func{gridDefLCC} defines the parameter of a Lambert Conformal Conic grid.
+
+ at EndFunction
+*/
+void gridDefLCC(int gridID, double originLon, double originLat, double lonParY,
+                double lat1, double lat2, double xinc, double yinc,
+                int projflag, int scanflag)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LCC )
+    Warning("Definition of LCC grid for %s grid not allowed!",
+	    gridNamePtr(gridptr->type));
+  else
+    {
+      gridptr->lcc_originLon = originLon;
+      gridptr->lcc_originLat = originLat;
+      gridptr->lcc_lonParY   = lonParY;
+      gridptr->lcc_lat1      = lat1;
+      gridptr->lcc_lat2      = lat2;
+      gridptr->lcc_xinc      = xinc;
+      gridptr->lcc_yinc      = yinc;
+      gridptr->lcc_projflag  = projflag;
+      gridptr->lcc_scanflag  = scanflag;
+      gridptr->lcc_defined   = TRUE;
+    }
+}
+
+/*
+ at Function  gridInqLCC
+ at Title     Get the parameter of a Lambert Conformal Conic grid
+
+ at Prototype void gridInqLCC(int gridID, double *originLon, double *originLat, double *lonParY, double *lat1, double *lat2, double *xinc, double *yinc, int *projflag, int *scanflag)
+ at Parameter
+    @Item  gridID    Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  originLon Longitude of the first grid point.
+    @Item  originLat Latitude of the first grid point.
+    @Item  lonParY   The East longitude of the meridian which is parallel to the Y-axis.
+    @Item  lat1      First latitude from the pole at which the secant cone cuts the sphere.
+    @Item  lat2      Second latitude at which the secant cone cuts the sphere.
+    @Item  xinc      X-direction grid lenght in meter.
+    @Item  yinc      Y-direction grid lenght in meter.
+    @Item  projflag  Projection centre flag.
+    @Item  scanflag  Scanning mode flag.
+ 
+ at Description
+The function @func{gridInqLCC} returns the parameter of a Lambert Conformal Conic grid.
+
+ at EndFunction
+*/
+void gridInqLCC(int gridID, double *originLon, double *originLat, double *lonParY,
+                double *lat1, double *lat2, double *xinc, double *yinc,
+                int *projflag, int *scanflag)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LCC )
+    Warning("Inquire of LCC grid definition for %s grid not allowed!",
+	    gridNamePtr(gridptr->type));
+  else
+    {
+      if ( gridptr->lcc_defined )
+        {
+          *originLon = gridptr->lcc_originLon;
+          *originLat = gridptr->lcc_originLat;
+          *lonParY   = gridptr->lcc_lonParY;
+          *lat1      = gridptr->lcc_lat1;
+          *lat2      = gridptr->lcc_lat2;
+          *xinc      = gridptr->lcc_xinc;
+          *yinc      = gridptr->lcc_yinc;
+          *projflag  = gridptr->lcc_projflag;
+          *scanflag  = gridptr->lcc_scanflag;
+        }
+      else
+	Warning("Lambert Conformal grid undefined (gridID = %d)", gridID);
+    }
+}
+
+void gridDefLcc2(int gridID, double earth_radius, double lon_0, double lat_0, double lat_1, double lat_2)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LCC2 )
+    Warning("Definition of LCC2 grid for %s grid not allowed!",
+	    gridNamePtr(gridptr->type));
+  else
+    {
+      gridptr->lcc2_a       = earth_radius;
+      gridptr->lcc2_lon_0   = lon_0;
+      gridptr->lcc2_lat_0   = lat_0;
+      gridptr->lcc2_lat_1   = lat_1;
+      gridptr->lcc2_lat_2   = lat_2;
+      gridptr->lcc2_defined = TRUE;
+    }
+}
+
+
+void gridInqLcc2(int gridID, double *earth_radius, double *lon_0, double *lat_0, double *lat_1, double *lat_2)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LCC2 )
+    Warning("Inquire of LCC2 grid definition for %s grid not allowed!",
+	    gridNamePtr(gridptr->type));
+  else
+    {
+      if ( gridptr->lcc2_defined )
+        {
+          *earth_radius = gridptr->lcc2_a;
+          *lon_0        = gridptr->lcc2_lon_0;
+          *lat_0        = gridptr->lcc2_lat_0;
+          *lat_1        = gridptr->lcc2_lat_1;
+          *lat_2        = gridptr->lcc2_lat_2;
+        }
+      else
+        Warning("LCC2 grid undefined (gridID = %d)", gridID);
+    }
+}
+
+void gridDefLaea(int gridID, double earth_radius, double lon_0, double lat_0)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LAEA )
+    Warning("Definition of LAEA grid for %s grid not allowed!",
+            gridNamePtr(gridptr->type));
+  else
+    {
+      gridptr->laea_a       = earth_radius;
+      gridptr->laea_lon_0   = lon_0;
+      gridptr->laea_lat_0   = lat_0;
+      gridptr->laea_defined = TRUE;
+    }
+}
+
+
+void gridInqLaea(int gridID, double *earth_radius, double *lon_0, double *lat_0)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->type != GRID_LAEA )
+    Warning("Inquire of LAEA grid definition for %s grid not allowed!",
+            gridNamePtr(gridptr->type));
+  else
+    {
+      if ( gridptr->laea_defined )
+        {
+          *earth_radius = gridptr->laea_a;
+          *lon_0        = gridptr->laea_lon_0;
+          *lat_0        = gridptr->laea_lat_0;
+        }
+      else
+        Warning("LAEA grid undefined (gridID = %d)", gridID);
+    }
+}
+
+
+void gridDefComplexPacking(int gridID, int lcomplex)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->lcomplex = lcomplex;
+}
+
+
+int gridInqComplexPacking(int gridID)
+{
+  int lcomplex;
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  lcomplex = gridptr->lcomplex;
+
+  return (lcomplex);
+}
+
+
+int gridInqNumber(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->number);
+}
+
+
+void gridDefNumber(int gridID, int number)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->number = number;
+}
+
+
+int gridInqPosition(int gridID)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  return (gridptr->position);
+}
+
+
+void gridDefPosition(int gridID, int position)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  gridptr->position = position;
+}
+
+
+int gridInqReference(int gridID, char *reference)
+{
+  grid_t *gridptr;
+  int len = 0;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( gridptr->reference )
+    {
+      len = (int) strlen(gridptr->reference);
+
+      if ( reference )
+        strcpy(reference, gridptr->reference);
+    }
+
+  return (len);
+}
+
+
+void gridDefReference(int gridID, const char *reference)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  if ( reference )
+    {
+      if ( gridptr->reference )
+        {
+          free(gridptr->reference);
+          gridptr->reference = NULL;
+        }
+
+      gridptr->reference = strdupx(reference);
+    }
+}
+
+
+void gridGetIndexList ( int ngrids, int * gridIndexList )
+{
+  reshGetResHListOfType ( ngrids, gridIndexList, &gridOps );
+}
+
+char *gridInqUUID(int gridID, char *uuid)
+{
+  grid_t *gridptr;
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strncpy(uuid, gridptr->uuid, 16);
+
+  return (uuid);
+}
+
+
+void gridDefUUID(int gridID, const char *uuid)
+{
+  grid_t *gridptr;
+
+  if ( reshGetStatus ( gridID, &gridOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  gridptr = ( grid_t *) reshGetVal ( gridID, &gridOps );
+
+  grid_check_ptr(gridID, gridptr);
+
+  strncpy(gridptr->uuid, uuid, 16);
+
+  return;
+}
+
+
+#ifdef USE_MPI
+
+static int
+gridTxCode ()
+{
+  return GRID;
+}
+
+enum { gridNint    = 26, 
+       gridNdouble = 24,
+       gridNstrings= 8,
+       mask        = 1 << 0,
+       mask_gme    = 1 << 1,
+       xvals       = 1 << 2,
+       yvals       = 1 << 3,
+       area        = 1 << 4,
+       xbounds     = 1 << 5,
+       ybounds     = 1 << 6,
+       reference   = 1 << 7,
+       rowlon      = 1 << 8
+};
+
+
+static int getMemberMask ( grid_t * gridP )
+{
+  int memberMask = 0;
+
+  if ( gridP->mask )       memberMask |= mask;
+  if ( gridP->mask_gme )   memberMask |= mask_gme;
+  if ( gridP->xvals )      memberMask |= xvals;
+  if ( gridP->yvals )      memberMask |= yvals; 
+  if ( gridP->area )       memberMask |= area;
+  if ( gridP->xbounds )    memberMask |= xbounds;
+  if ( gridP->ybounds )    memberMask |= ybounds;
+  if ( gridP->reference )  memberMask |= reference;
+  if ( gridP->rowlon )     memberMask |= rowlon;
+
+  return memberMask;
+}
+
+
+static
+int gridGetPackSize ( void * voidP, MPI_Comm comm )
+{
+  grid_t * gridP = ( grid_t * ) voidP;
+  int packBuffSize = 0, size, count;
+
+  xmpi ( MPI_Pack_size ( gridNint + 1, MPI_INT, comm, &size ));
+  packBuffSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBuffSize += size;
+
+  if ( gridP->rowlon )
+    {
+      xassert ( gridP->nrowlon );
+
+      xmpi ( MPI_Pack_size ( gridP->nrowlon, MPI_INT, comm, &size ));
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }  
+
+  xmpi ( MPI_Pack_size ( gridNdouble + 1, MPI_DOUBLE, comm, &size ));
+  packBuffSize += size;  
+
+  if ( gridP->xvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	count =  gridP->size;
+      else
+	count =  gridP->xsize;
+      xassert ( count );
+      
+      xmpi ( MPI_Pack_size ( count, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  if ( gridP->yvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	count =  gridP->size;
+      else
+	count =  gridP->ysize;
+      xassert ( count );
+      
+      xmpi ( MPI_Pack_size ( count, MPI_DOUBLE, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  if ( gridP->area )
+    {
+      xassert ( gridP->size );
+      
+      xmpi ( MPI_Pack_size ( gridP->size, MPI_DOUBLE, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  if ( gridP->xbounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	count = gridP->nvertex * gridP->size;
+      else
+	count = gridP->nvertex * gridP->xsize;
+      xassert ( count );
+      
+      xmpi ( MPI_Pack_size ( count, MPI_DOUBLE, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  if ( gridP->ybounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	count = gridP->nvertex * gridP->size;
+      else
+	count = gridP->nvertex * gridP->ysize;
+      xassert ( count );
+      
+      xmpi ( MPI_Pack_size ( count, MPI_DOUBLE, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  xmpi ( MPI_Pack_size ( gridNstrings * CDI_MAX_NAME , MPI_CHAR, comm, &size ));
+  packBuffSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBuffSize += size;
+
+  if ( gridP->reference )
+    {
+      count = strlen ( gridP->reference ) + 1;
+      xmpi ( MPI_Pack_size ( 1, MPI_INT, comm, &size ));
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( count, MPI_CHAR, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+ 
+  if ( gridP->mask )
+    {
+      xassert ( gridP->size );
+      xmpi ( MPI_Pack_size ( gridP->size, MPI_UNSIGNED_CHAR, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+
+  if ( gridP->mask_gme )
+    {
+      xassert ( gridP->size );
+      xmpi ( MPI_Pack_size ( gridP->size, MPI_UNSIGNED_CHAR, comm, &size ));     
+      packBuffSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBuffSize += size;
+    }
+  
+  return packBuffSize; 
+}
+
+
+void gridUnpack ( char * unpackBuffer, int unpackBufferSize, 
+		  int * unpackBufferPos, int nspTarget, MPI_Comm comm )
+{
+  grid_t * gridP;
+  int intBuffer[gridNint + 1], memberMask, size, referenceSize;
+  double doubleBuffer[gridNdouble + 1], d;
+  char charBuffer[gridNstrings * CDI_MAX_NAME];
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      intBuffer, gridNint + 1, MPI_INT, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      &d, 1, MPI_DOUBLE, comm ));
+
+  xassert ( xchecksum ( DATATYPE_INT , gridNint + 1, intBuffer ) == d );
+
+  gridInit ();
+
+  gridP = gridNewEntry();
+  xassert ( gridP );
+
+  xassert ( namespaceAdaptKey ( intBuffer[0], nspTarget ) == gridP->self );
+
+  gridP->type          =   intBuffer[1] ;
+  gridP->prec          =   intBuffer[2] ;
+  gridP->lcc_projflag  =   intBuffer[3] ;
+  gridP->lcc_scanflag  =   intBuffer[4] ;
+  gridP->lcc_defined   =   intBuffer[5] ;
+  gridP->lcc2_defined  =   intBuffer[6] ;
+  gridP->laea_defined  =   intBuffer[7] ;
+  gridP->isCyclic      =   intBuffer[8] ;
+  gridP->isRotated     =   intBuffer[9] ;
+  gridP->xdef          =   intBuffer[10] ;
+  gridP->ydef          =   intBuffer[11];
+  gridP->nd            =   intBuffer[12];
+  gridP->ni            =   intBuffer[13];
+  gridP->ni2           =   intBuffer[14];
+  gridP->ni3           =   intBuffer[15];
+  gridP->number        =   intBuffer[16];
+  gridP->position      =   intBuffer[17];
+  gridP->trunc         =   intBuffer[18];
+  gridP->nvertex       =   intBuffer[19];
+  gridP->nrowlon       =   intBuffer[20];
+  gridP->size          =   intBuffer[21];
+  gridP->xsize         =   intBuffer[22];
+  gridP->ysize         =   intBuffer[23];
+  gridP->locked        =   intBuffer[24];
+  gridP->lcomplex      =   intBuffer[25];
+  memberMask           =   intBuffer[26];
+
+  if ( memberMask & rowlon )
+    {
+      xassert ( gridP->nrowlon );
+      gridP->rowlon = xmalloc ( gridP->nrowlon * sizeof ( int ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			gridP->rowlon, gridP->nrowlon , MPI_INT, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_INT , gridP->nrowlon, gridP->rowlon ) == d );
+    } 
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      doubleBuffer, gridNdouble + 1, MPI_DOUBLE, comm ));
+
+  xassert ( doubleBuffer[24] == xchecksum ( DATATYPE_FLT, gridNdouble, 
+                                            doubleBuffer ));
+
+  gridP->xfirst        =   doubleBuffer[0] ;       
+  gridP->yfirst	       =   doubleBuffer[1] ;
+  gridP->xlast	       =   doubleBuffer[2] ;
+  gridP->ylast	       =   doubleBuffer[3] ;
+  gridP->xinc	       =   doubleBuffer[4] ;
+  gridP->yinc	       =   doubleBuffer[5] ;
+  gridP->lcc_originLon =   doubleBuffer[6] ;         
+  gridP->lcc_originLat =   doubleBuffer[7] ;
+  gridP->lcc_lonParY   =   doubleBuffer[8] ;
+  gridP->lcc_lat1      =   doubleBuffer[9] ;
+  gridP->lcc_lat2      =   doubleBuffer[10];
+  gridP->lcc_xinc      =   doubleBuffer[11];
+  gridP->lcc_yinc      =   doubleBuffer[12];
+  gridP->lcc2_lon_0    =   doubleBuffer[13];         
+  gridP->lcc2_lat_0    =   doubleBuffer[14];
+  gridP->lcc2_lat_1    =   doubleBuffer[15];
+  gridP->lcc2_lat_2    =   doubleBuffer[16];
+  gridP->lcc2_a	       =   doubleBuffer[17];
+  gridP->laea_lon_0    =   doubleBuffer[18];         
+  gridP->laea_lat_0    =   doubleBuffer[19];
+  gridP->laea_a	       =   doubleBuffer[20];
+  gridP->xpole 	       =   doubleBuffer[21];
+  gridP->ypole	       =   doubleBuffer[22];
+  gridP->angle         =   doubleBuffer[23]; 
+
+  if ( memberMask & xvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	size = gridP->size;
+      else
+	size = gridP->xsize;
+      
+      gridP->xvals =  xmalloc( size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->xvals, size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, size, gridP->xvals ) == d );
+    }
+
+  if ( memberMask & yvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	size = gridP->size;
+      else
+	size = gridP->ysize;
+      
+      gridP->yvals =  xmalloc( size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->yvals, size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, size, gridP->yvals ) == d );
+    }
+
+  if ( memberMask & area )
+    {
+      xassert ( gridP->size );
+      
+      gridP->area =  xmalloc( gridP->size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->area, gridP->size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, gridP->size, gridP->area ) == d );
+    }
+
+  if ( memberMask & xbounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	size = gridP->nvertex * gridP->size;
+      else
+	size = gridP->nvertex * gridP->xsize;
+      xassert ( size );
+      
+      gridP->xbounds =  xmalloc( size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->xbounds, size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, size, gridP->xbounds ) == d );
+    }
+
+  if ( memberMask & ybounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	size = gridP->nvertex * gridP->size;
+      else
+	size = gridP->nvertex * gridP->ysize;
+      xassert ( size );
+      
+      gridP->ybounds =  xmalloc( size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->ybounds, size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, size, gridP->ybounds ) == d );
+    }
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      charBuffer, gridNstrings * CDI_MAX_NAME, MPI_CHAR, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      &d, 1, MPI_DOUBLE, comm ));
+
+  xassert ( d == xchecksum ( DATATYPE_TXT, gridNstrings * CDI_MAX_NAME, 
+                             charBuffer ));
+
+  memcpy ( gridP->xname    , &charBuffer[CDI_MAX_NAME * 0], CDI_MAX_NAME );
+  memcpy ( gridP->yname    , &charBuffer[CDI_MAX_NAME * 1], CDI_MAX_NAME );
+  memcpy ( gridP->xlongname, &charBuffer[CDI_MAX_NAME * 2], CDI_MAX_NAME );
+  memcpy ( gridP->ylongname, &charBuffer[CDI_MAX_NAME * 3], CDI_MAX_NAME );
+  memcpy ( gridP->xstdname , &charBuffer[CDI_MAX_NAME * 4], CDI_MAX_NAME );
+  memcpy ( gridP->ystdname , &charBuffer[CDI_MAX_NAME * 5], CDI_MAX_NAME );
+  memcpy ( gridP->xunits   , &charBuffer[CDI_MAX_NAME * 6], CDI_MAX_NAME );
+  memcpy ( gridP->yunits   , &charBuffer[CDI_MAX_NAME * 7], CDI_MAX_NAME );
+
+  if ( memberMask & reference )
+    {
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &referenceSize, 1, MPI_INT, comm ));
+      gridP->reference = xmalloc ( referenceSize );
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->reference, referenceSize, MPI_CHAR, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_TXT, referenceSize, 
+                            gridP->reference ) == d );
+    }
+
+  if ( memberMask & mask )
+    {
+      xassert ( gridP->size );
+      gridP->mask = xmalloc ( gridP->size * sizeof ( mask_t ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->mask, gridP->size, MPI_UNSIGNED_CHAR, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_TXT, gridP->size, gridP->mask ) == d );
+    }
+
+  if ( memberMask & mask_gme )
+    {
+      xassert ( gridP->size );
+      gridP->mask_gme = xmalloc ( gridP->size * sizeof ( mask_t ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  gridP->mask_gme, gridP->size, MPI_UNSIGNED_CHAR, 
+                          comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+			  &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_TXT, gridP->size, gridP->mask_gme ) == d );
+    }
+} 							       
+
+
+static
+void gridPack ( void * voidP, void * packBuffer, int packBufferSize, 
+		int * packBufferPos, MPI_Comm comm )
+{
+  grid_t   * gridP = ( grid_t * )   voidP;
+  int intBuffer[gridNint + 1], size;
+  double doubleBuffer[gridNdouble + 1], d;
+  char charBuffer[gridNstrings * CDI_MAX_NAME];
+
+  intBuffer[0]  = gridP->self;
+  intBuffer[1]  = gridP->type;
+  intBuffer[2]  = gridP->prec;
+  intBuffer[3]  = gridP->lcc_projflag;
+  intBuffer[4]  = gridP->lcc_scanflag;
+  intBuffer[5]  = gridP->lcc_defined;
+  intBuffer[6]  = gridP->lcc2_defined;
+  intBuffer[7]  = gridP->laea_defined;
+  intBuffer[8]  = gridP->isCyclic;
+  intBuffer[9]  = gridP->isRotated; 
+  intBuffer[10] = gridP->xdef; 
+  intBuffer[11] = gridP->ydef;
+  intBuffer[12] = gridP->nd;
+  intBuffer[13] = gridP->ni;
+  intBuffer[14] = gridP->ni2;
+  intBuffer[15] = gridP->ni3; 
+  intBuffer[16] = gridP->number;
+  intBuffer[17] = gridP->position;
+  intBuffer[18] = gridP->trunc;
+  intBuffer[19] = gridP->nvertex;
+  intBuffer[20] = gridP->nrowlon;
+  intBuffer[21] = gridP->size;
+  intBuffer[22] = gridP->xsize;
+  intBuffer[23] = gridP->ysize;
+  intBuffer[24] = gridP->locked;
+  intBuffer[25] = gridP->lcomplex;
+  intBuffer[26] = getMemberMask ( gridP );
+  
+  xmpi ( MPI_Pack ( intBuffer, gridNint + 1, MPI_INT, 
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+  d = xchecksum ( DATATYPE_INT , gridNint + 1, intBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  if ( gridP->rowlon )
+    {
+      xassert ( gridP->nrowlon );
+      xmpi ( MPI_Pack ( gridP->rowlon, gridP->nrowlon, MPI_INT,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_INT , gridP->nrowlon, gridP->rowlon );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }  
+
+  doubleBuffer[0]  = gridP->xfirst;         
+  doubleBuffer[1]  = gridP->yfirst;
+  doubleBuffer[2]  = gridP->xlast;
+  doubleBuffer[3]  = gridP->ylast;
+  doubleBuffer[4]  = gridP->xinc;
+  doubleBuffer[5]  = gridP->yinc;
+  doubleBuffer[6]  = gridP->lcc_originLon;          
+  doubleBuffer[7]  = gridP->lcc_originLat;
+  doubleBuffer[8]  = gridP->lcc_lonParY;
+  doubleBuffer[9]  = gridP->lcc_lat1;
+  doubleBuffer[10] = gridP->lcc_lat2;
+  doubleBuffer[11] = gridP->lcc_xinc;
+  doubleBuffer[12] = gridP->lcc_yinc;
+  doubleBuffer[13] = gridP->lcc2_lon_0;             
+  doubleBuffer[14] = gridP->lcc2_lat_0;
+  doubleBuffer[15] = gridP->lcc2_lat_1;
+  doubleBuffer[16] = gridP->lcc2_lat_2;
+  doubleBuffer[17] = gridP->lcc2_a;
+  doubleBuffer[18] = gridP->laea_lon_0;             
+  doubleBuffer[19] = gridP->laea_lat_0;
+  doubleBuffer[20] = gridP->laea_a;
+  doubleBuffer[21] = gridP->xpole; 
+  doubleBuffer[22] = gridP->ypole;
+  doubleBuffer[23] = gridP->angle;
+  doubleBuffer[24] = xchecksum ( DATATYPE_FLT, gridNdouble - 1, doubleBuffer );
+
+  xmpi ( MPI_Pack ( doubleBuffer, gridNdouble + 1, MPI_DOUBLE, 
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  if ( gridP->xvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	size = gridP->size;
+      else
+	size = gridP->xsize;
+      xassert ( size );
+      
+      xmpi ( MPI_Pack ( gridP->xvals, size, MPI_DOUBLE, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, size, gridP->xvals );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( gridP->yvals )
+    {
+      if ( gridP->type == GRID_UNSTRUCTURED || gridP->type == GRID_CURVILINEAR )
+	size = gridP->size;
+      else
+	size = gridP->ysize;
+      xassert ( size );
+      
+      xmpi ( MPI_Pack ( gridP->yvals, size, MPI_DOUBLE, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, size, gridP->yvals );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( gridP->area )
+    {
+      xassert ( gridP->size );
+
+      xmpi ( MPI_Pack ( gridP->area, gridP->size, MPI_DOUBLE, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, gridP->size, gridP->area );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( gridP->xbounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	size = gridP->nvertex * gridP->size;
+      else
+	size = gridP->nvertex * gridP->xsize;
+      xassert ( size );
+
+      xmpi ( MPI_Pack ( gridP->xbounds, size, MPI_DOUBLE, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, size, gridP->xbounds );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( gridP->ybounds )
+    {
+      xassert ( gridP->nvertex );
+      if ( gridP->type == GRID_CURVILINEAR || gridP->type == GRID_UNSTRUCTURED )
+	size = gridP->nvertex * gridP->size;
+      else
+	size = gridP->nvertex * gridP->ysize;
+      xassert ( size );
+
+      xmpi ( MPI_Pack ( gridP->ybounds, size, MPI_DOUBLE, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, size, gridP->ybounds );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  memcpy ( &charBuffer[CDI_MAX_NAME * 0], gridP->xname,     CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 1], gridP->yname,     CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 2], gridP->xlongname, CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 3], gridP->ylongname, CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 4], gridP->xstdname,  CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 5], gridP->ystdname,  CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 6], gridP->xunits,    CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 7], gridP->yunits,    CDI_MAX_NAME );
+
+  xmpi ( MPI_Pack ( charBuffer, gridNstrings * CDI_MAX_NAME, MPI_CHAR, 
+		    packBuffer, packBufferSize, packBufferPos, comm )); 
+  d = xchecksum  ( DATATYPE_TXT, gridNstrings * CDI_MAX_NAME, charBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  if ( gridP->reference )
+    {
+      size = strlen ( gridP->reference ) + 1;
+      xmpi ( MPI_Pack ( &size, 1, MPI_INT, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      xmpi ( MPI_Pack ( gridP->reference, size, MPI_CHAR, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_TXT, size, gridP->reference );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm )); 
+    }
+ 
+  if ( gridP->mask )
+    {
+      xassert ( gridP->size );
+      xmpi ( MPI_Pack ( gridP->mask, gridP->size, MPI_UNSIGNED_CHAR, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_TXT, gridP->size, gridP->mask );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm )); 
+    }
+
+  if ( gridP->mask_gme )
+    {
+      xassert ( gridP->size );
+
+      xmpi ( MPI_Pack ( gridP->mask_gme, gridP->size, MPI_UNSIGNED_CHAR, 
+			packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_TXT, gridP->size, gridP->mask );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+			packBuffer, packBufferSize, packBufferPos, comm )); 
+    }
+}
+
+#endif
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/grid.h b/libcdi/src/grid.h
new file mode 100644
index 0000000..83748a9
--- /dev/null
+++ b/libcdi/src/grid.h
@@ -0,0 +1,97 @@
+#ifndef _GRID_H
+#define _GRID_H
+
+typedef unsigned char mask_t;
+
+typedef struct {
+  int     self;
+  int     type;                   /* grid type                      */
+  int     prec;                   /* grid precision                 */
+  int     proj;                   /* grid projection                */
+  mask_t *mask;
+  mask_t *mask_gme;
+  double *xvals;
+  double *yvals;
+  double *area;
+  double *xbounds;
+  double *ybounds;
+  double  xfirst, yfirst;
+  double  xlast, ylast;
+  double  xinc, yinc;
+  double  lcc_originLon;          /* Lambert Conformal Conic        */
+  double  lcc_originLat;
+  double  lcc_lonParY;
+  double  lcc_lat1;
+  double  lcc_lat2;
+  double  lcc_xinc;
+  double  lcc_yinc;
+  int     lcc_projflag;
+  int     lcc_scanflag;
+  int     lcc_defined;
+  double  lcc2_lon_0;             /* Lambert Conformal Conic 2      */
+  double  lcc2_lat_0;
+  double  lcc2_lat_1;
+  double  lcc2_lat_2;
+  double  lcc2_a;
+  int     lcc2_defined;
+  double  laea_lon_0;             /* Lambert Azimuthal Equal Area   */
+  double  laea_lat_0;
+  double  laea_a;
+  int     laea_defined;
+  double  xpole, ypole, angle;    /* rotated north pole             */
+  int     isCyclic;               /* TRUE for global cyclic grids   */
+  int     isRotated;              /* TRUE for rotated grids         */
+  int     xdef;                   /* 0: undefined 1:xvals 2:x0+xinc */
+  int     ydef;                   /* 0: undefined 1:yvals 2:y0+yinc */
+  int     nd, ni, ni2, ni3;       /* parameter for GRID_GME         */
+  int     number, position;       /* parameter for GRID_REFERENCE   */
+  char   *reference;
+  char    uuid[17];               /* uuid for grid reference        */
+  int     trunc;                  /* parameter for GRID_SPECTEAL    */
+  int     nvertex;
+  int    *rowlon;
+  int     nrowlon;
+  int     size;
+  int     xsize;                  /* number of values along X */
+  int     ysize;                  /* number of values along Y */
+  int     np;                     /* number of parallels between a pole and the equator */
+  int     locked;
+  int     lcomplex;
+  char    xname[CDI_MAX_NAME];
+  char    yname[CDI_MAX_NAME];
+  char    xlongname[CDI_MAX_NAME];
+  char    ylongname[CDI_MAX_NAME];
+  char    xstdname[CDI_MAX_NAME];
+  char    ystdname[CDI_MAX_NAME];
+  char    xunits[CDI_MAX_NAME];
+  char    yunits[CDI_MAX_NAME];
+  char   *name;
+}
+grid_t;
+
+
+void grid_init(grid_t *gridptr);
+void grid_free(grid_t *gridptr);
+
+const double *gridInqXvalsPtr(int gridID);
+const double *gridInqYvalsPtr(int gridID);
+
+double *gridInqXboundsPtr(int gridID);
+double *gridInqYboundsPtr(int gridID);
+const double *gridInqAreaPtr(int gridID);
+
+int gridCompare(int gridID, grid_t grid);
+int gridGenerate(grid_t grid);
+
+void     gridGetIndexList    ( int, int * );
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/ieg.h b/libcdi/src/ieg.h
new file mode 100644
index 0000000..ccee9ac
--- /dev/null
+++ b/libcdi/src/ieg.h
@@ -0,0 +1,103 @@
+#ifndef _IEG_H
+#define _IEG_H
+
+/* Level Types */
+#define  IEG_LTYPE_SURFACE               1
+#define  IEG_LTYPE_99                   99
+#define  IEG_LTYPE_ISOBARIC            100
+#define  IEG_LTYPE_MEANSEA             102
+#define  IEG_LTYPE_ALTITUDE            103
+#define  IEG_LTYPE_HEIGHT              105
+#define  IEG_LTYPE_SIGMA               107
+#define  IEG_LTYPE_HYBRID              109
+#define  IEG_LTYPE_HYBRID_LAYER        110
+#define  IEG_LTYPE_LANDDEPTH           111
+#define  IEG_LTYPE_LANDDEPTH_LAYER     112
+#define  IEG_LTYPE_SEADEPTH            160
+#define  IEG_LTYPE_99_MARGIN          1000
+
+/*
+ *  Data representation type (Grid Type) [Table 6]
+ */
+#define  IEG_GTYPE_LATLON             0  /*  latitude/longitude                       */
+#define  IEG_GTYPE_LATLON_ROT        10  /*  rotated latitude/longitude               */
+
+#define  IEG_P_CodeTable(x)   (x[ 5])  /*  Version number of code table                 */
+#define  IEG_P_Parameter(x)   (x[ 6])  /*  Parameter indicator                          */
+#define  IEG_P_LevelType(x)   (x[ 7])  /*  Type of level indicator                      */
+#define  IEG_P_Level1(x)      (x[ 8])  /*  Level 1                                      */
+#define  IEG_P_Level2(x)      (x[ 9])  /*  Level 2                                      */
+#define  IEG_P_Year(x)        (x[10])  /*  Year of century (YY)                         */
+#define  IEG_P_Month(x)       (x[11])  /*  Month (MM)                                   */
+#define  IEG_P_Day(x)         (x[12])  /*  Day (DD)                                     */
+#define  IEG_P_Hour(x)        (x[13])  /*  Hour (HH)                                    */
+#define  IEG_P_Minute(x)      (x[14])  /*  Minute (MM)                                  */
+
+/*
+ *  Macros for the grid definition section ( Section 2 )
+ */
+#define  IEG_G_Size(x)        (x[ 0])
+#define  IEG_G_NumVCP(x)      (x[3] == 10 ? (x[0]-42)/4 : (x[0]-32)/4)
+#define  IEG_G_GridType(x)    (x[ 3])  /*  Data representation type */
+#define  IEG_G_NumLon(x)      (x[ 4])  /*  Number of points along a parallel (Ni)       */
+#define  IEG_G_NumLat(x)      (x[ 5])  /*  Number of points along a meridian (Nj)       */
+#define  IEG_G_FirstLat(x)    (x[ 6])  /*  Latitude of the first grid point             */
+#define  IEG_G_FirstLon(x)    (x[ 7])  /*  Longitude of the first grid point            */
+#define  IEG_G_ResFlag(x)     (x[ 8])  /*  Resolution flag: 128 regular grid            */
+#define  IEG_G_LastLat(x)     (x[ 9])  /*  Latitude of the last grid point              */
+#define  IEG_G_LastLon(x)     (x[10])  /*  Longitude of the last grid point             */
+#define  IEG_G_LonIncr(x)     (x[11])  /*  i direction increment                        */
+#define  IEG_G_LatIncr(x)     (x[12])  /*  j direction increment                        */
+#define  IEG_G_ScanFlag(x)    (x[13])
+#define  IEG_G_LatSP(x)       (x[16])  /*  Latitude of the southern pole of rotation    */
+#define  IEG_G_LonSP(x)       (x[17])  /*  Longitude of the southern pole of rotation   */
+
+
+typedef struct {
+  int    checked;
+  int    byteswap;
+  int    dprec;      /* data   precision */
+  double refval;
+  int    ipdb[37];
+  int    igdb[22];
+  double vct[100];
+  size_t datasize;
+  size_t buffersize;
+  void  *buffer;
+}
+iegrec_t;
+
+
+const char *iegLibraryVersion(void);
+
+void iegDebug(int debug);
+int  iegCheckFiletype(int fileID, int *swap);
+
+iegrec_t *iegNew(void);
+void iegDelete(iegrec_t *iegp);
+void iegInit(iegrec_t *iegp);
+void iegInitMem(iegrec_t *iegp);
+
+int  iegRead(int fileID, iegrec_t *iegp);
+int  iegWrite(int fileID, iegrec_t *iegp);
+
+void iegCopyMeta(iegrec_t *diegp, iegrec_t *siegp);
+int  iegInqHeader(iegrec_t *iegp, int *header);
+int  iegInqDataSP(iegrec_t *iegp, float *data);
+int  iegInqDataDP(iegrec_t *iegp, double *data);
+
+int  iegDefHeader(iegrec_t *iegp, const int *header);
+int  iegDefDataSP(iegrec_t *iegp, const float *data);
+int  iegDefDataDP(iegrec_t *iegp, const double *data);
+
+
+#endif  /* _IEG_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/ieglib.c b/libcdi/src/ieglib.c
new file mode 100644
index 0000000..6cfca94
--- /dev/null
+++ b/libcdi/src/ieglib.c
@@ -0,0 +1,610 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "dmemory.h"
+
+#include "ieg.h"
+#include "error.h"
+#include "file.h"
+#include "binary.h"
+#include "swap.h"
+
+
+#define SINGLE_PRECISION  4
+#define DOUBLE_PRECISION  8
+
+
+static int initIegLib      = 0;
+static int iegDefaultDprec = 0;
+
+
+/*
+ * A version string.
+ */
+
+#undef  LIBVERSION
+#define LIBVERSION      1.3.1
+#define XSTRING(x)	#x
+#define STRING(x)	XSTRING(x)
+static const char ieg_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
+
+const char *iegLibraryVersion(void)
+{
+  return (ieg_libvers);
+}
+
+
+int IEG_Debug = 0;    /* If set to 1, debugging */
+
+
+
+void iegLibInit()
+{
+  char *envString;
+  char *envName = "IEG_PRECISION";
+
+
+  envString = getenv(envName);
+  if ( envString )
+    {
+      int pos;
+      int nrun;
+      if ( strlen(envString) == 2 ) nrun = 1;
+      else                          nrun = 2;
+
+      pos = 0;
+      while ( nrun-- )
+	{
+	  switch ( tolower((int) envString[pos]) )
+	    {
+	    case 'r':
+	      {
+		switch ( (int) envString[pos+1] )
+		  {
+		  case '4': iegDefaultDprec = SINGLE_PRECISION; break;
+		  case '8': iegDefaultDprec = DOUBLE_PRECISION; break;
+		  default:
+		    Message("Invalid digit in %s: %s", envName, envString);
+		  }
+		break;		
+	      }
+	    default:
+	      Message("Invalid character in %s: %s", envName, envString);
+	    }
+	  pos += 2;
+	}
+    }
+
+  initIegLib = 1;
+}
+
+
+void iegDebug(int debug)
+{
+  IEG_Debug = debug;
+
+  if ( IEG_Debug )
+    Message("debug level %d", debug);
+}
+
+
+void iegInit(iegrec_t *iegp)
+{
+  iegp->checked    = 0;
+  iegp->byteswap   = 0;
+  iegp->dprec      = 0;
+  iegp->refval     = 0;
+  iegp->datasize   = 0;
+  iegp->buffersize = 0;
+  iegp->buffer     = NULL;
+}
+
+
+void iegInitMem(iegrec_t *iegp)
+{
+  memset(iegp->ipdb, 0, sizeof(iegp->ipdb));
+  memset(iegp->igdb, 0, sizeof(iegp->igdb));
+  memset(iegp->vct,  0, sizeof(iegp->vct));
+}
+
+
+iegrec_t *iegNew(void)
+{
+  iegrec_t *iegp;
+
+  if ( ! initIegLib ) iegLibInit();
+
+  iegp = (iegrec_t *) malloc(sizeof(iegrec_t));
+
+  iegInit(iegp);
+  iegInitMem(iegp);
+
+  return (iegp);
+}
+
+
+void iegDelete(iegrec_t *iegp)
+{
+  if ( iegp )
+    {
+      if ( iegp->buffer ) free(iegp->buffer);
+      free(iegp);
+    }
+}
+
+
+int iegCheckFiletype(int fileID, int *swap)
+{
+  size_t blocklen = 0;
+  size_t sblocklen = 0;
+  size_t data = 0;
+  size_t dimx = 0, dimy = 0;
+  int fact = 0, found = 0;
+  unsigned char buffer[1048], *pbuf;
+
+  if ( fileRead(fileID, buffer, 4) != 4 ) return (found);
+
+  blocklen  = get_UINT32(buffer);
+  sblocklen = get_SUINT32(buffer);
+
+  if ( IEG_Debug )
+    Message("blocklen = %d sblocklen = %d", blocklen, sblocklen);
+
+  if ( blocklen == 636 || blocklen == 640 )
+    {
+     *swap = 0;
+      fact = 4;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+(37+4)*4;    dimx = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+(37+5)*4;    dimy = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+blocklen+4;  data = (size_t) get_UINT32(pbuf);
+    }
+  else if ( blocklen == 1040 || blocklen == 1036 )
+    {
+     *swap = 0;
+      fact = 8;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+(37+4)*4;    dimx = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+(37+5)*4;    dimy = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+blocklen+4;  data = (size_t) get_UINT32(pbuf);
+    }
+  else if ( sblocklen == 636 || sblocklen == 640 )
+    {
+     *swap = 1;
+      fact = 4;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+(37+4)*4;     dimx = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+(37+5)*4;     dimy = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+sblocklen+4;  data = (size_t) get_SUINT32(pbuf);
+    }
+  else if ( sblocklen == 1040 || sblocklen == 1036 )
+    {
+     *swap = 1;
+      fact = 8;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+(37+4)*4;     dimx = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+(37+5)*4;     dimy = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+sblocklen+4;  data = (size_t) get_SUINT32(pbuf);
+    }
+
+  fileRewind(fileID);
+
+  if      ( data && dimx*dimy*fact == data ) found = 1;
+  else if ( data && dimx*dimy*8    == data ) found = 1;
+
+  if ( IEG_Debug )
+    {
+      Message("swap = %d fact = %d", *swap, fact);
+      Message("dimx = %lu dimy = %lu data = %lu", dimx, dimy, data);
+    }
+
+  return (found);
+}
+
+
+void iegCopyMeta(iegrec_t *diegp, iegrec_t *siegp)
+{
+  /*  diegp->byteswap = siegp->byteswap; */
+  diegp->dprec    = siegp->dprec;
+  diegp->refval   = siegp->refval;
+
+  memcpy(diegp->ipdb, siegp->ipdb, sizeof(siegp->ipdb));
+  memcpy(diegp->igdb, siegp->igdb, sizeof(siegp->igdb));
+  memcpy(diegp->vct,  siegp->vct,  sizeof(siegp->vct));
+}
+
+
+int iegInqData(iegrec_t *iegp, int prec, void *data)
+{
+  size_t datasize;
+  size_t i;
+  int ierr = 0;
+  int dprec;
+  void *buffer;
+  int byteswap = iegp->byteswap;
+
+
+  datasize = iegp->datasize;
+
+  buffer = iegp->buffer;
+
+  dprec = iegp->dprec;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( sizeof(FLT32) == 4 )
+	  {
+	    if ( byteswap ) swap4byte(buffer, datasize);
+
+	    if ( dprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT32));
+	    else
+	      for (i = 0; i < datasize; i++)
+		((double *) data)[i] = (double) ((float *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT32));
+	  }	
+	break;
+      }
+    case DOUBLE_PRECISION:
+	if ( sizeof(FLT64) == 8 )
+	  {
+	    if ( byteswap ) swap8byte(buffer, datasize);
+
+	    if ( dprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT64));
+	    else
+	      for (i = 0; i < datasize; i++)
+		((float *) data)[i] = (float) ((double *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT64));
+	  }	
+	break;
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  return (ierr);
+}
+
+
+int iegInqDataSP(iegrec_t *iegp, float *data)
+{
+  return (iegInqData(iegp, SINGLE_PRECISION, (void *) data));
+}
+
+
+int iegInqDataDP(iegrec_t *iegp, double *data)
+{
+  return (iegInqData(iegp, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int iegDefData(iegrec_t *iegp, int prec, const void *data)
+{
+  size_t datasize;
+  size_t blocklen;
+  size_t buffersize;
+  size_t i;
+  int dprec;
+  void *buffer;
+
+
+  if ( iegDefaultDprec ) dprec = iegDefaultDprec;
+  else                   dprec = iegp->dprec;
+
+  if ( ! dprec ) dprec = prec;
+
+  iegp->dprec = dprec;
+
+  datasize = IEG_G_NumLon(iegp->igdb)*IEG_G_NumLat(iegp->igdb);
+  blocklen = datasize * dprec;
+
+  iegp->datasize = datasize;
+
+  buffersize = iegp->buffersize;
+
+  if ( buffersize != blocklen )
+    {
+      buffersize = blocklen;
+      buffer = iegp->buffer;
+      buffer = realloc(buffer, buffersize);
+      iegp->buffer = buffer;
+      iegp->buffersize = buffersize;
+    }
+  else
+    buffer = iegp->buffer;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( dprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT32));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((float *) buffer)[i] = (float) ((double *) data)[i];
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	if ( dprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT64));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((double *) buffer)[i] = (double) ((float *) data)[i];
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  return (0);
+}
+
+
+int iegDefDataSP(iegrec_t *iegp, const float *data)
+{
+  return (iegDefData(iegp, SINGLE_PRECISION, (void *) data));
+}
+
+
+int iegDefDataDP(iegrec_t *iegp, const double *data)
+{
+  return (iegDefData(iegp, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int iegRead(int fileID, iegrec_t *iegp)
+{
+  size_t datasize;
+  size_t blocklen, blocklen2;
+  size_t i;
+  char tmpbuffer[800], *tmpbuf = tmpbuffer;
+  int dprec = 0;
+  void *buffer;
+  int buffersize;
+  int byteswap;
+  int status;
+
+  if ( ! iegp->checked )
+    {
+      status = iegCheckFiletype(fileID, &iegp->byteswap);
+      if ( status == 0 ) Error("Not a IEG file!");
+      iegp->checked = 1;
+    }
+
+  byteswap = iegp->byteswap;
+
+  /* read header record */
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  if ( fileEOF(fileID) ) return (-1);
+
+  if ( IEG_Debug )
+    Message("blocklen = %lu", blocklen);
+
+  if ( blocklen == 636 || blocklen == 640 )
+    dprec = 4;
+  else if ( blocklen == 1040 || blocklen == 1036 )
+    dprec = 8;
+  else
+    {
+      Warning("unexpecteted header size %d!", (int) blocklen);
+      return (-1);
+    }
+
+  iegp->dprec = dprec;
+
+  binReadInt32(fileID, byteswap, 37, (INT32 *) tmpbuf);
+  for ( i = 0; i < 37; i++ ) iegp->ipdb[i] = (int) ((INT32 *) tmpbuf)[i];
+
+  binReadInt32(fileID, byteswap, 18, (INT32 *) tmpbuf);
+  for ( i = 0; i < 18; i++ ) iegp->igdb[i] = (int) ((INT32 *) tmpbuf)[i];
+
+  if ( blocklen == 636 || blocklen == 1036 )
+    {
+      fileRead(fileID, tmpbuf, 4);
+      if ( byteswap ) swap4byte(tmpbuf, 1);
+      iegp->refval = (double) ((float *) tmpbuf)[0];
+    }
+  else
+    {
+      fileRead(fileID, tmpbuf, 8);
+      if ( byteswap ) swap8byte(tmpbuf, 1);
+      iegp->refval = (double) ((double *) tmpbuf)[0];
+    }
+
+  binReadInt32(fileID, byteswap, 3, (INT32 *) tmpbuf);
+  for ( i = 0; i < 3; i++ ) iegp->igdb[18+i] = (int) ((INT32 *) tmpbuf)[i];
+
+  if ( dprec == SINGLE_PRECISION )
+    {
+      fileRead(fileID, tmpbuf, 400);
+      if ( byteswap ) swap4byte(tmpbuf, 100);
+      for ( i = 0; i < 100; i++ )
+	iegp->vct[i] = (double) ((float *) tmpbuf)[i];
+    }
+  else
+    {
+      fileRead(fileID, tmpbuf, 800);
+      if ( byteswap ) swap8byte(tmpbuf, 100);
+      for ( i = 0; i < 100; i++ )
+	iegp->vct[i] = (double) ((double *) tmpbuf)[i];
+    }
+  
+  /*
+  fprintf(stderr, "refval %g\n", iegp->refval);
+
+  for ( i = 0; i < 100; i++ )
+    fprintf(stderr, "%3d %g\n", i, iegp->vct[i]);
+  
+  {
+    int i;
+    for ( i = 0; i < 37; i++ )
+      fprintf(stderr, "pdb: %d %d\n", i, iegp->ipdb[i]);
+    for ( i = 0; i < 22; i++ )
+      fprintf(stderr, "gdb: %d %d\n", i, iegp->igdb[i]);
+  }
+  */
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("header blocklen differ!");
+      return (-1);
+    }
+
+  iegp->datasize = IEG_G_NumLon(iegp->igdb)*IEG_G_NumLat(iegp->igdb);
+
+  if ( IEG_Debug )
+    Message("datasize = %lu", iegp->datasize);
+
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  buffersize = iegp->buffersize;
+
+  if ( buffersize < (int) blocklen )
+    {
+      buffersize = blocklen;
+      buffer = iegp->buffer;
+      buffer = realloc(buffer, buffersize);
+      iegp->buffer = buffer;
+      iegp->buffersize = buffersize;
+    }
+  else
+    buffer = iegp->buffer;
+
+  datasize = iegp->datasize;
+
+  if ( dprec != (int) (blocklen/datasize) )
+    {
+      Warning("data precision differ! (h = %d; d = %d)",
+	      (int) dprec, (int) (blocklen/datasize));
+      return (-1);
+    }
+
+  fileRead(fileID, buffer, blocklen);
+
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("data blocklen differ!");
+      return (-1);
+    }
+
+  return (0);
+}
+
+
+int iegWrite(int fileID, iegrec_t *iegp)
+{
+  size_t datasize;
+  size_t blocklen;
+  size_t i;
+  int dprec;
+  float refvalf;
+  double refval;
+  char tmpbuf[800];
+  float fvct[100];
+  void *buffer;
+  int byteswap = iegp->byteswap;
+
+
+  dprec  = iegp->dprec;
+
+  /* write header record */
+  if ( dprec == SINGLE_PRECISION )
+    blocklen = 636;
+  else
+    blocklen = 1040;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  for ( i = 0; i < 37; i++ ) ((INT32 *) tmpbuf)[i] = (INT32) iegp->ipdb[i];
+  binWriteInt32(fileID, byteswap, 37, (INT32 *) tmpbuf);
+
+  for ( i = 0; i < 18; i++ ) ((INT32 *) tmpbuf)[i] = (INT32) iegp->igdb[i];
+  binWriteInt32(fileID, byteswap, 18, (INT32 *) tmpbuf);
+
+  refval = iegp->refval;
+  refvalf = (float) refval;
+  if ( dprec == SINGLE_PRECISION )
+    binWriteFlt32(fileID, byteswap, 1, (FLT32 *) &refvalf);
+  else
+    binWriteFlt64(fileID, byteswap, 1, (FLT64 *) &refval);
+
+  for ( i = 0; i < 3; i++ ) ((INT32 *) tmpbuf)[i] = (INT32) iegp->igdb[18+i];
+  binWriteInt32(fileID, byteswap, 3, (INT32 *) tmpbuf);
+
+  if ( dprec == SINGLE_PRECISION )
+    {
+      for ( i = 0; i < 100; i++ ) fvct[i] = (float) iegp->vct[i];
+      binWriteFlt32(fileID, byteswap, 100, fvct);
+    }
+  else
+    {
+      binWriteFlt64(fileID, byteswap, 100, iegp->vct);
+    }
+  
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  datasize = iegp->igdb[4]*iegp->igdb[5];
+  blocklen = datasize * dprec;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  iegp->datasize = datasize;
+
+  buffer = iegp->buffer;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	binWriteFlt32(fileID, byteswap, datasize, (FLT32 *) buffer);
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	binWriteFlt64(fileID, byteswap, datasize, (FLT64 *) buffer);
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  return (0);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/institution.c b/libcdi/src/institution.c
new file mode 100644
index 0000000..0b41a39
--- /dev/null
+++ b/libcdi/src/institution.c
@@ -0,0 +1,420 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include "dmemory.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "resource_handle.h"
+#include "pio_util.h"
+#include "resource_handle.h"
+#include "pio_rpc.h"
+#include "namespace.h"
+
+#undef  UNDEFID
+#define UNDEFID  -1
+
+int ECMWF  = UNDEFID;
+int MPIMET = UNDEFID;
+int DWD    = UNDEFID;
+int MCH    = UNDEFID;
+
+typedef struct
+{
+  int    self;
+  int    used;
+  int    center;
+  int    subcenter;
+  char  *name;
+  char  *longname;
+}
+institute_t;
+
+
+static int    instituteCompareP ( void * instituteptr1, void * instituteptr2 );
+static void   instituteDestroyP ( void * instituteptr );
+static void   institutePrintP   ( void * instituteptr, FILE * fp );
+#ifdef USE_MPI
+static int    instituteGetSizeP ( void * instituteptr, MPI_Comm comm );
+static void   institutePackP    ( void * instituteptr, void *buf, int size, int *position, MPI_Comm comm );
+static int    instituteTxCode   ( void );
+#endif
+
+resOps instituteOps = { instituteCompareP, instituteDestroyP, institutePrintP
+#ifdef USE_MPI
+                        ,instituteGetSizeP, institutePackP, instituteTxCode
+#endif
+ };
+
+static int * instituteInitializedNsp;
+
+static
+void instituteDefaultValue ( institute_t * instituteptr )
+{
+  instituteptr->self       = UNDEFID;
+  instituteptr->used       = 0;
+  instituteptr->center     = UNDEFID;
+  instituteptr->subcenter  = UNDEFID;
+  instituteptr->name       = NULL;
+  instituteptr->longname   = NULL;
+}
+
+static
+institute_t * instituteNewEntry ( void )
+{
+  institute_t *instituteptr;
+
+  instituteptr = ( institute_t * ) xmalloc ( sizeof ( institute_t ));
+
+  instituteDefaultValue ( instituteptr );
+  instituteptr->self = reshPut (( void * ) instituteptr, &instituteOps );
+  instituteptr->used = 1;
+
+  return  instituteptr;
+}
+
+static
+void instituteDefaultEntries ( void )
+{
+  cdiResH resH[12];
+  int i;
+
+  resH[0]  = ECMWF   = institutDef( 98,   0, "ECMWF",     "European Centre for Medium-Range Weather Forecasts");
+  resH[1]  = MPIMET  = institutDef( 98, 232, "MPIMET",    "Max-Planck-Institute for Meteorology");
+  resH[2]  =           institutDef( 98, 255, "MPIMET",    "Max-Planck-Institute for Meteorology");
+  resH[3]  =           institutDef( 98, 232, "MPIMET",    "Max-Planck Institute for Meteorology");
+  resH[4]  =           institutDef( 78, 255, "DWD",       "Deutscher Wetterdienst");
+  resH[5]  = MCH     = institutDef(215, 255, "MCH",       "MeteoSwiss");
+  resH[6]  =           institutDef(  7,   0, "NCEP",      "National Centers for Environmental Prediction");
+  resH[7]  =           institutDef(  7,   1, "NCEP",      "National Centers for Environmental Prediction");
+  resH[8]  =           institutDef( 60,   0, "NCAR",      "National Center for Atmospheric Research");
+  resH[9]  =           institutDef( 74,   0, "METOFFICE", "U.K. Met Office");
+  resH[10] =           institutDef( 97,   0, "ESA",       "European Space Agency ");
+  resH[11] =           institutDef( 99,   0, "KNMI",      "Royal Netherlands Meteorological Institute");
+  /*     (void) institutDef(  0,   0, "IPSL", "IPSL (Institut Pierre Simon Laplace, Paris, France)"); */
+
+  if ( ! namespaceHasLocalFile ( namespaceGetActive ()))
+    for ( i = 0; i < 12 ; i++ )
+      reshSetStatus ( resH[i], &instituteOps, SUSPENDED );
+}
+
+static
+void instituteFinalize ( void )
+{
+  free ( instituteInitializedNsp );
+}
+
+static
+void instituteInit (void)
+{
+  static int instituteInitialized = 0;
+  int nsp, nspc;
+
+  nspc = namespaceGetNumber ();
+
+  if ( !instituteInitialized )
+    {
+      instituteInitialized = 1;
+      instituteInitializedNsp = xcalloc ( 1, nspc * sizeof ( int ));
+      atexit ( instituteFinalize );
+    }
+
+  nsp = namespaceGetActive ();
+  if ( instituteInitializedNsp[nsp] ) return;
+  instituteInitializedNsp[nsp] = 1;
+
+  instituteDefaultEntries();
+}
+
+
+int instituteCount ( void )
+{
+  return reshCountType ( &instituteOps );
+}
+
+
+int instituteCompareKernel ( institute_t *  ip1, institute_t * ip2 )
+{
+  int differ = 0;
+  size_t len;
+
+  if ( ip1->name )
+    {
+      if ( ip1->center    > 0 && ip2->center    != ip1->center )    differ = 1;
+      if ( ip1->subcenter > 0 && ip2->subcenter != ip1->subcenter ) differ = 1;
+
+      if ( !differ )
+        {
+          if ( ip2->name )
+            {
+              len = strlen(ip2->name);
+              if ( memcmp(ip2->name, ip1->name, len)) differ = 1;
+            }
+        }
+    }
+  else if ( ip1->longname )
+    {
+      if ( ip2->longname )
+        {
+          len = strlen(ip2->longname);
+          if ( memcmp(ip2->longname, ip1->longname, len)) differ = 1;
+        }
+    }
+  else
+    {
+      if ( !( ip2->center    == ip1->center &&
+              ip2->subcenter == ip1->subcenter )) differ = 1;
+    }
+
+  return differ;
+}
+
+
+static int instituteCompareP ( void *  instituteptr1, void * instituteptr2 )
+{
+  institute_t * i1, * i2;
+
+  i1 = ( institute_t * ) instituteptr1;
+  i2 = ( institute_t * ) instituteptr2;
+
+  xassert(i1);
+  xassert(i2);
+
+  return instituteCompareKernel ( i1, i2 );
+}
+
+
+int institutInq(int center, int subcenter, const char *name, const char *longname)
+{
+  int instID = UNDEFID, instCount, * instResHs, i;
+  institute_t * ip1;
+  institute_t * ip2;
+
+  instituteInit ();
+
+  ip1 = xmalloc ( sizeof ( institute_t ));
+
+  ip1->self       = UNDEFID;
+  ip1->used       = 0;
+  ip1->center     = center;
+  ip1->subcenter  = subcenter;
+  ip1->name       = ( char * ) name;
+  ip1->longname   = ( char * ) longname;
+
+  instCount = instituteCount ();
+  instResHs = xmalloc ( instCount * sizeof ( int ));
+  reshGetResHListOfType ( instCount, instResHs, &instituteOps );
+
+  for ( i = 0; i < instCount; i++ )
+    {
+      ip2 = ( institute_t * ) reshGetVal ( instResHs[i], &instituteOps );
+      xassert ( ip2 );
+
+      if ( ip2->used && ! instituteCompareKernel ( ip1, ip2 ))
+        {
+          instID = ip2->self;
+          break;
+        }
+    }
+
+  free ( instResHs );
+  free ( ip1 );
+
+  return  (instID);
+}
+
+
+int institutDef(int center, int subcenter, const char *name, const char *longname)
+{
+  institute_t * instituteptr;
+
+  instituteInit ();
+
+  instituteptr = instituteNewEntry();
+
+  instituteptr->center    = center;
+  instituteptr->subcenter = subcenter;
+  if ( name )     instituteptr->name     = strdupx(name);
+  if ( longname ) instituteptr->longname = strdupx(longname);
+
+  return instituteptr->self;
+}
+
+
+int institutInqCenter(int instID)
+{
+  institute_t * instituteptr = NULL;
+
+  instituteInit ();
+
+  if ( instID != UNDEFID )
+    instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
+
+  return  instituteptr ? instituteptr->center : UNDEFID;
+}
+
+
+int institutInqSubcenter(int instID)
+{
+  institute_t * instituteptr = NULL;
+
+  instituteInit ();
+
+  if ( instID != UNDEFID )
+    instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
+
+  return instituteptr ? instituteptr->subcenter: UNDEFID;
+}
+
+
+char *institutInqNamePtr(int instID)
+{
+  institute_t * instituteptr = NULL;
+
+  instituteInit ();
+
+  if ( instID != UNDEFID )
+    instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
+
+  return instituteptr ? instituteptr->name : NULL;
+}
+
+
+char *institutInqLongnamePtr(int instID)
+{
+  institute_t * instituteptr = NULL;
+
+  instituteInit ();
+
+  if ( instID != UNDEFID )
+    instituteptr = ( institute_t * ) reshGetVal ( instID, &instituteOps );
+
+  return instituteptr ? instituteptr->longname : NULL;
+}
+
+
+int institutInqNumber(void)
+{
+  int i, instCount, * instResHs, instNum = 0;
+  institute_t * instituteptr;
+
+  instituteInit ();
+
+  instCount = reshCountType ( &instituteOps );
+  instResHs = xmalloc ( instCount * sizeof ( int ));
+  reshGetResHListOfType ( instCount, instResHs, &instituteOps );
+
+  for ( i = 0; i < instCount; i++ )
+    {
+      instituteptr = ( institute_t * ) reshGetVal ( instResHs[i], &instituteOps );
+      if ( instituteptr && instituteptr->used )
+        instNum++;
+    }
+
+  if ( instResHs ) free ( instResHs );
+
+  return instNum;
+}
+
+
+void instituteDestroyP ( void * instituteptr )
+{
+  int id;
+  institute_t * i1 = ( institute_t * ) instituteptr;
+
+  xassert ( i1 );
+
+  id = i1->self;
+
+  if ( instituteptr ) free ( instituteptr );
+
+  reshRemove ( id, &instituteOps );
+}
+
+
+void institutePrintP   ( void * instituteptr, FILE * fp )
+{
+  institute_t * ip = ( institute_t * ) instituteptr;
+
+  if ( !ip ) return;
+
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "# instituteID %d\n", ip->self);
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "self          = %d\n", ip->self );
+  fprintf ( fp, "used          = %d\n", ip->used );
+  fprintf ( fp, "center        = %d\n", ip->center );
+  fprintf ( fp, "subcenter     = %d\n", ip->subcenter );
+  fprintf ( fp, "name          = %s\n", ip->name ? ip->name : "NN" );
+  fprintf ( fp, "longname      = %s\n", ip->longname ? ip->longname : "NN" );
+}
+
+
+#ifdef USE_MPI
+static int
+instituteTxCode ( void )
+{
+  return INSTITUTE;
+}
+
+enum {
+  institute_nints = 5,
+};
+
+static
+int instituteGetSizeP ( void * instituteptr, MPI_Comm comm )
+{
+  institute_t *p = instituteptr;
+  int txsize = 0, txinc;
+  xmpi(MPI_Pack_size(institute_nints, MPI_INT, comm, &txsize));
+  xmpi(MPI_Pack_size(strlen(p->name) + 1, MPI_CHAR, comm, &txinc));
+  txsize += txinc;
+  xmpi(MPI_Pack_size(strlen(p->longname) + 1, MPI_CHAR, comm, &txinc));
+  txsize += txinc;
+  return txsize;
+}
+
+static
+void institutePackP ( void * instituteptr, void *buf, int size,
+                      int *position, MPI_Comm comm )
+{
+  institute_t *p = instituteptr;
+  int tempbuf[institute_nints];
+  tempbuf[0] = p->self;
+  tempbuf[1] = p->center;
+  tempbuf[2] = p->subcenter;
+  tempbuf[3] = (int)strlen(p->name) + 1;
+  tempbuf[4] = (int)strlen(p->longname) + 1;
+  xmpi(MPI_Pack(tempbuf, institute_nints, MPI_INT, buf, size, position, comm));
+  xmpi(MPI_Pack(p->name, tempbuf[3], MPI_CHAR, buf, size, position, comm));
+  xmpi(MPI_Pack(p->longname, tempbuf[4], MPI_CHAR, buf, size, position, comm));
+}
+
+int
+instituteUnpack(void *buf, int size, int *position, int nspTarget,
+                MPI_Comm comm)
+{
+  int tempbuf[institute_nints];
+  int instituteID;
+  char *name, *longname;
+  xmpi(MPI_Unpack(buf, size, position, tempbuf, institute_nints, MPI_INT, comm));
+  name = xmalloc(tempbuf[3]);
+  longname = xmalloc(tempbuf[4]);
+  xmpi(MPI_Unpack(buf, size, position, name, tempbuf[3], MPI_CHAR, comm));
+  xmpi(MPI_Unpack(buf, size, position, longname, tempbuf[4], MPI_CHAR, comm));
+  instituteID = institutDef(tempbuf[1], tempbuf[2], name, longname);
+  // FIXME: this should work, once all types are transferred
+  //xassert(instituteID == tempbuf[0]);
+  return instituteID;
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/institution.h b/libcdi/src/institution.h
new file mode 100644
index 0000000..08deab1
--- /dev/null
+++ b/libcdi/src/institution.h
@@ -0,0 +1,20 @@
+#ifndef INSTITUTION_H
+#define INSTITUTION_H
+
+#ifdef USE_MPI
+int
+instituteUnpack(void *buf, int size, int *position, int,
+                MPI_Comm comm);
+#endif
+
+#endif
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/mo_cdi.f90 b/libcdi/src/mo_cdi.f90
new file mode 100644
index 0000000..c0e7b71
--- /dev/null
+++ b/libcdi/src/mo_cdi.f90
@@ -0,0 +1,3148 @@
+
+module mo_cdi
+      use, intrinsic :: iso_c_binding
+
+      implicit none
+
+      private
+  
+      integer :: CDI_UNDEFID = -1
+      integer :: CDI_GLOBAL = -1
+      integer :: CDI_BIGENDIAN = 0
+      integer :: CDI_LITTLEENDIAN = 1
+      integer :: CDI_REAL = 1
+      integer :: CDI_COMP = 2
+      integer :: CDI_BOTH = 3
+      integer :: CDI_ESYSTEM = -10
+      integer :: CDI_EINVAL = -20
+      integer :: CDI_EUFTYPE = -21
+      integer :: CDI_ELIBNAVAIL = -22
+      integer :: CDI_EUFSTRUCT = -23
+      integer :: CDI_EUNC4 = -24
+      integer :: CDI_ELIMIT = -99
+      integer :: FILETYPE_GRB = 1
+      integer :: FILETYPE_GRB2 = 2
+      integer :: FILETYPE_NC = 3
+      integer :: FILETYPE_NC2 = 4
+      integer :: FILETYPE_NC4 = 5
+      integer :: FILETYPE_SRV = 6
+      integer :: FILETYPE_EXT = 7
+      integer :: FILETYPE_IEG = 8
+      integer :: COMPRESS_NONE = 0
+      integer :: COMPRESS_SZIP = 1
+      integer :: COMPRESS_GZIP = 2
+      integer :: COMPRESS_BZIP2 = 3
+      integer :: COMPRESS_ZIP = 4
+      integer :: COMPRESS_JPEG = 5
+      integer :: DATATYPE_PACK = 0
+      integer :: DATATYPE_PACK1 = 1
+      integer :: DATATYPE_PACK2 = 2
+      integer :: DATATYPE_PACK3 = 3
+      integer :: DATATYPE_PACK4 = 4
+      integer :: DATATYPE_PACK5 = 5
+      integer :: DATATYPE_PACK6 = 6
+      integer :: DATATYPE_PACK7 = 7
+      integer :: DATATYPE_PACK8 = 8
+      integer :: DATATYPE_PACK9 = 9
+      integer :: DATATYPE_PACK10 = 10
+      integer :: DATATYPE_PACK11 = 11
+      integer :: DATATYPE_PACK12 = 12
+      integer :: DATATYPE_PACK13 = 13
+      integer :: DATATYPE_PACK14 = 14
+      integer :: DATATYPE_PACK15 = 15
+      integer :: DATATYPE_PACK16 = 16
+      integer :: DATATYPE_PACK17 = 17
+      integer :: DATATYPE_PACK18 = 18
+      integer :: DATATYPE_PACK19 = 19
+      integer :: DATATYPE_PACK20 = 20
+      integer :: DATATYPE_PACK21 = 21
+      integer :: DATATYPE_PACK22 = 22
+      integer :: DATATYPE_PACK23 = 23
+      integer :: DATATYPE_PACK24 = 24
+      integer :: DATATYPE_PACK25 = 25
+      integer :: DATATYPE_PACK26 = 26
+      integer :: DATATYPE_PACK27 = 27
+      integer :: DATATYPE_PACK28 = 28
+      integer :: DATATYPE_PACK29 = 29
+      integer :: DATATYPE_PACK30 = 30
+      integer :: DATATYPE_PACK31 = 31
+      integer :: DATATYPE_PACK32 = 32
+      integer :: DATATYPE_CPX32 = 64
+      integer :: DATATYPE_CPX64 = 128
+      integer :: DATATYPE_FLT32 = 132
+      integer :: DATATYPE_FLT64 = 164
+      integer :: DATATYPE_INT8 = 208
+      integer :: DATATYPE_INT16 = 216
+      integer :: DATATYPE_INT32 = 232
+      integer :: DATATYPE_UINT8 = 308
+      integer :: DATATYPE_UINT16 = 316
+      integer :: DATATYPE_UINT32 = 332
+      integer :: DATATYPE_INT = 251
+      integer :: DATATYPE_FLT = 252
+      integer :: DATATYPE_TXT = 253
+      integer :: DATATYPE_CPX = 254
+      integer :: GRID_GENERIC = 1
+      integer :: GRID_GAUSSIAN = 2
+      integer :: GRID_GAUSSIAN_REDUCED = 3
+      integer :: GRID_LONLAT = 4
+      integer :: GRID_SPECTRAL = 5
+      integer :: GRID_FOURIER = 6
+      integer :: GRID_GME = 7
+      integer :: GRID_TRAJECTORY = 8
+      integer :: GRID_UNSTRUCTURED = 9
+      integer :: GRID_CURVILINEAR = 10
+      integer :: GRID_LCC = 11
+      integer :: GRID_LCC2 = 12
+      integer :: GRID_LAEA = 13
+      integer :: GRID_SINUSOIDAL = 14
+      integer :: ZAXIS_SURFACE = 0
+      integer :: ZAXIS_GENERIC = 1
+      integer :: ZAXIS_HYBRID = 2
+      integer :: ZAXIS_HYBRID_HALF = 3
+      integer :: ZAXIS_PRESSURE = 4
+      integer :: ZAXIS_HEIGHT = 5
+      integer :: ZAXIS_DEPTH_BELOW_SEA = 6
+      integer :: ZAXIS_DEPTH_BELOW_LAND = 7
+      integer :: ZAXIS_ISENTROPIC = 8
+      integer :: ZAXIS_TRAJECTORY = 9
+      integer :: ZAXIS_ALTITUDE = 10
+      integer :: ZAXIS_SIGMA = 11
+      integer :: ZAXIS_MEANSEA = 12
+      integer :: TAXIS_ABSOLUTE = 1
+      integer :: TAXIS_RELATIVE = 2
+      integer :: TIME_CONSTANT = 1
+      integer :: TIME_VARIABLE = 2
+      integer :: TUNIT_SECOND = 1
+      integer :: TUNIT_MINUTE = 2
+      integer :: TUNIT_HOUR = 3
+      integer :: TUNIT_DAY = 4
+      integer :: TUNIT_MONTH = 5
+      integer :: TUNIT_YEAR = 6
+      integer :: TUNIT_QUARTER = 7
+      integer :: TUNIT_3HOURS = 8
+      integer :: TUNIT_6HOURS = 9
+      integer :: TUNIT_12HOURS = 10
+      integer :: TSTEP_INSTANT = 1
+      integer :: TSTEP_AVG = 2
+      integer :: TSTEP_ACCUM = 3
+      integer :: TSTEP_MAX = 4
+      integer :: TSTEP_MIN = 5
+      integer :: TSTEP_DIFF = 6
+      integer :: TSTEP_RANGE = 7
+      integer :: TSTEP_INSTANT2 = 8
+      integer :: TSTEP_INSTANT3 = 9
+      integer :: CALENDAR_STANDARD = 0
+      integer :: CALENDAR_PROLEPTIC = 1
+      integer :: CALENDAR_360DAYS = 2
+      integer :: CALENDAR_365DAYS = 3
+      integer :: CALENDAR_366DAYS = 4
+      integer :: CALENDAR_NONE = 5
+
+      interface
+        character(c_char) function cdiStringError(cdiErrno) bind(c,name='cdiStringError')
+          import :: c_int,c_char
+          integer(c_int), value :: cdiErrno
+       end function cdiStringError
+      end interface
+  
+      interface
+        subroutine cdiDebug(debug) bind(c,name='cdiDebug')
+          import :: c_int
+          integer(c_int), value :: debug
+       end subroutine cdiDebug
+      end interface
+  
+      interface
+        character(c_char) function cdiLibraryVersion() bind(c,name='cdiLibraryVersion')
+          import :: c_char
+       end function cdiLibraryVersion
+      end interface
+  
+      interface
+        subroutine cdiPrintVersion() bind(c,name='cdiPrintVersion')
+       end subroutine cdiPrintVersion
+      end interface
+  
+      interface
+        subroutine cdiDefMissval(missval) bind(c,name='cdiDefMissval')
+          import :: c_double
+          real(c_double), value :: missval
+       end subroutine cdiDefMissval
+      end interface
+  
+      interface
+        real(c_double) function cdiInqMissval() bind(c,name='cdiInqMissval')
+          import :: c_double
+       end function cdiInqMissval
+      end interface
+  
+      interface
+        subroutine cdiDefGlobal(string,val) bind(c,name='cdiDefGlobal')
+          import :: c_char,c_int
+          character(c_char), dimension(*) :: string
+          integer(c_int), value :: val
+       end subroutine cdiDefGlobal
+      end interface
+  
+      interface
+        subroutine cdiParamToString(param,paramstr,maxlen) bind(c,name='cdiParamToString')
+          import :: c_int,c_char
+          integer(c_int), value :: param
+          character(c_char), dimension(*) :: paramstr
+          integer(c_int), value :: maxlen
+       end subroutine cdiParamToString
+      end interface
+  
+      interface
+        subroutine cdiDecodeParam(param,pnum,pcat,pdis) bind(c,name='cdiDecodeParam')
+          import :: c_int
+          integer(c_int), value :: param
+          integer(c_int), intent(out) :: pnum
+          integer(c_int), intent(out) :: pcat
+          integer(c_int), intent(out) :: pdis
+       end subroutine cdiDecodeParam
+      end interface
+  
+      interface
+        integer(c_int) function cdiEncodeParam(pnum,pcat,pdis) bind(c,name='cdiEncodeParam')
+          import :: c_int
+          integer(c_int), value :: pnum
+          integer(c_int), value :: pcat
+          integer(c_int), value :: pdis
+       end function cdiEncodeParam
+      end interface
+  
+      interface
+        subroutine cdiDecodeDate(date,year,month,day) bind(c,name='cdiDecodeDate')
+          import :: c_int
+          integer(c_int), value :: date
+          integer(c_int), intent(out) :: year
+          integer(c_int), intent(out) :: month
+          integer(c_int), intent(out) :: day
+       end subroutine cdiDecodeDate
+      end interface
+  
+      interface
+        integer(c_int) function cdiEncodeDate(year,month,day) bind(c,name='cdiEncodeDate')
+          import :: c_int
+          integer(c_int), value :: year
+          integer(c_int), value :: month
+          integer(c_int), value :: day
+       end function cdiEncodeDate
+      end interface
+  
+      interface
+        subroutine cdiDecodeTime(time,hour,minute,second) bind(c,name='cdiDecodeTime')
+          import :: c_int
+          integer(c_int), value :: time
+          integer(c_int), intent(out) :: hour
+          integer(c_int), intent(out) :: minute
+          integer(c_int), intent(out) :: second
+       end subroutine cdiDecodeTime
+      end interface
+  
+      interface
+        integer(c_int) function cdiEncodeTime(hour,minute,second) bind(c,name='cdiEncodeTime')
+          import :: c_int
+          integer(c_int), value :: hour
+          integer(c_int), value :: minute
+          integer(c_int), value :: second
+       end function cdiEncodeTime
+      end interface
+  
+      interface
+        integer(c_int) function streamOpenRead(path) bind(c,name='streamOpenRead')
+          import :: c_char,c_int
+          character(c_char), dimension(*) :: path
+       end function streamOpenRead
+      end interface
+  
+      interface
+        integer(c_int) function streamOpenWrite(path,filetype) bind(c,name='streamOpenWrite')
+          import :: c_char,c_int
+          character(c_char), dimension(*) :: path
+          integer(c_int), value :: filetype
+       end function streamOpenWrite
+      end interface
+  
+      interface
+        integer(c_int) function streamOpenAppend(path) bind(c,name='streamOpenAppend')
+          import :: c_char,c_int
+          character(c_char), dimension(*) :: path
+       end function streamOpenAppend
+      end interface
+  
+      interface
+        subroutine streamClose(streamID) bind(c,name='streamClose')
+          import :: c_int
+          integer(c_int), value :: streamID
+       end subroutine streamClose
+      end interface
+  
+      interface
+        subroutine streamSync(streamID) bind(c,name='streamSync')
+          import :: c_int
+          integer(c_int), value :: streamID
+       end subroutine streamSync
+      end interface
+  
+      interface
+        subroutine streamDefVlist(streamID,vlistID) bind(c,name='streamDefVlist')
+          import :: c_int
+          integer(c_int), value :: streamID
+          integer(c_int), value :: vlistID
+       end subroutine streamDefVlist
+      end interface
+  
+      interface
+        integer(c_int) function streamInqVlist(streamID) bind(c,name='streamInqVlist')
+          import :: c_int
+          integer(c_int), value :: streamID
+       end function streamInqVlist
+      end interface
+  
+      interface
+        integer(c_int) function streamInqFiletype(streamID) bind(c,name='streamInqFiletype')
+          import :: c_int
+          integer(c_int), value :: streamID
+       end function streamInqFiletype
+      end interface
+  
+      interface
+        subroutine streamDefByteorder(streamID,byteorder) bind(c,name='streamDefByteorder')
+          import :: c_int
+          integer(c_int), value :: streamID
+          integer(c_int), value :: byteorder
+       end subroutine streamDefByteorder
+      end interface
+  
+      interface
+        integer(c_int) function streamInqByteorder(streamID) bind(c,name='streamInqByteorder')
+          import :: c_int
+          integer(c_int), value :: streamID
+       end function streamInqByteorder
+      end interface
+  
+      interface
+        subroutine streamDefZtype(streamID,ztype) bind(c,name='streamDefZtype')
+          import :: c_int
+          integer(c_int), value :: streamID
+          integer(c_int), value :: ztype
+       end subroutine streamDefZtype
+      end interface
+  
+      interface
+        subroutine streamDefZlevel(streamID,zlevel) bind(c,name='streamDefZlevel')
+          import :: c_int
+          integer(c_int), value :: streamID
+          integer(c_int), value :: zlevel
+       end subroutine streamDefZlevel
+      end interface
+  
+      interface
+        integer(c_int) function streamInqZtype(streamID) bind(c,name='streamInqZtype')
+          import :: c_int
+          integer(c_int), value :: streamID
+       end function streamInqZtype
+      end interface
+  
+      interface
+        integer(c_int) function streamInqZlevel(streamID) bind(c,name='streamInqZlevel')
+          import :: c_int
+          integer(c_int), value :: streamID
+       end function streamInqZlevel
+      end interface
+  
+      interface
+        integer(c_int) function streamDefTimestep(streamID,tsID) bind(c,name='streamDefTimestep')
+          import :: c_int
+          integer(c_int), value :: streamID
+          integer(c_int), value :: tsID
+       end function streamDefTimestep
+      end interface
+  
+      interface
+        integer(c_int) function streamInqTimestep(streamID,tsID) bind(c,name='streamInqTimestep')
+          import :: c_int
+          integer(c_int), value :: streamID
+          integer(c_int), value :: tsID
+       end function streamInqTimestep
+      end interface
+  
+      interface
+        character(c_char) function streamFilename(streamID) bind(c,name='streamFilename')
+          import :: c_int,c_char
+          integer(c_int), value :: streamID
+       end function streamFilename
+      end interface
+  
+      interface
+        character(c_char) function streamFilesuffix(filetype) bind(c,name='streamFilesuffix')
+          import :: c_int,c_char
+          integer(c_int), value :: filetype
+       end function streamFilesuffix
+      end interface
+  
+      interface
+        integer(c_int) function streamNtsteps(streamID) bind(c,name='streamNtsteps')
+          import :: c_int
+          integer(c_int), value :: streamID
+       end function streamNtsteps
+      end interface
+  
+      interface
+        subroutine streamReadVar(streamID,varID,data_vec,nmiss) bind(c,name='streamReadVar')
+          import :: c_int,c_double
+          integer(c_int), value :: streamID
+          integer(c_int), value :: varID
+          real(c_double), intent(out),dimension(*) :: data_vec
+          integer(c_int), intent(out) :: nmiss
+       end subroutine streamReadVar
+      end interface
+  
+      interface
+        subroutine streamWriteVar(streamID,varID,data_vec,nmiss) bind(c,name='streamWriteVar')
+          import :: c_int,c_double
+          integer(c_int), value :: streamID
+          integer(c_int), value :: varID
+          real(c_double), intent(in),dimension(*) :: data_vec
+          integer(c_int), value :: nmiss
+       end subroutine streamWriteVar
+      end interface
+  
+      interface
+        subroutine streamReadVarSlice(streamID,varID,levelID,data_vec,nmiss) bind(c,name='streamReadVarSlice')
+          import :: c_int,c_double
+          integer(c_int), value :: streamID
+          integer(c_int), value :: varID
+          integer(c_int), value :: levelID
+          real(c_double), intent(out),dimension(*) :: data_vec
+          integer(c_int), intent(out) :: nmiss
+       end subroutine streamReadVarSlice
+      end interface
+  
+      interface
+        subroutine streamWriteVarSlice(streamID,varID,levelID,data_vec,nmiss) bind(c,name='streamWriteVarSlice')
+          import :: c_int,c_double
+          integer(c_int), value :: streamID
+          integer(c_int), value :: varID
+          integer(c_int), value :: levelID
+          real(c_double), intent(in),dimension(*) :: data_vec
+          integer(c_int), value :: nmiss
+       end subroutine streamWriteVarSlice
+      end interface
+  
+      interface
+        subroutine streamInqRecord(streamID,varID,levelID) bind(c,name='streamInqRecord')
+          import :: c_int
+          integer(c_int), value :: streamID
+          integer(c_int), intent(out) :: varID
+          integer(c_int), intent(out) :: levelID
+       end subroutine streamInqRecord
+      end interface
+  
+      interface
+        subroutine streamDefRecord(streamID,varID,levelID) bind(c,name='streamDefRecord')
+          import :: c_int
+          integer(c_int), value :: streamID
+          integer(c_int), value :: varID
+          integer(c_int), value :: levelID
+       end subroutine streamDefRecord
+      end interface
+  
+      interface
+        subroutine streamReadRecord(streamID,data_vec,nmiss) bind(c,name='streamReadRecord')
+          import :: c_int,c_double
+          integer(c_int), value :: streamID
+          real(c_double), intent(out),dimension(*) :: data_vec
+          integer(c_int), intent(out) :: nmiss
+       end subroutine streamReadRecord
+      end interface
+  
+      interface
+        subroutine streamWriteRecord(streamID,data_vec,nmiss) bind(c,name='streamWriteRecord')
+          import :: c_int,c_double
+          integer(c_int), value :: streamID
+          real(c_double), intent(in),dimension(*) :: data_vec
+          integer(c_int), value :: nmiss
+       end subroutine streamWriteRecord
+      end interface
+  
+      interface
+        subroutine streamCopyRecord(streamIDdest,streamIDsrc) bind(c,name='streamCopyRecord')
+          import :: c_int
+          integer(c_int), value :: streamIDdest
+          integer(c_int), value :: streamIDsrc
+       end subroutine streamCopyRecord
+      end interface
+  
+      interface
+        subroutine streamInqGinfo(streamID,intnum,fltnum) bind(c,name='streamInqGinfo')
+          import :: c_int,c_float
+          integer(c_int), value :: streamID
+          integer(c_int), intent(out) :: intnum
+          real(c_float), intent(out) :: fltnum
+       end subroutine streamInqGinfo
+      end interface
+  
+      interface
+        integer(c_int) function vlistCreate() bind(c,name='vlistCreate')
+          import :: c_int
+       end function vlistCreate
+      end interface
+  
+      interface
+        subroutine vlistDestroy(vlistID) bind(c,name='vlistDestroy')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end subroutine vlistDestroy
+      end interface
+  
+      interface
+        integer(c_int) function vlistDuplicate(vlistID) bind(c,name='vlistDuplicate')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistDuplicate
+      end interface
+  
+      interface
+        subroutine vlistCopy(vlistID2,vlistID1) bind(c,name='vlistCopy')
+          import :: c_int
+          integer(c_int), value :: vlistID2
+          integer(c_int), value :: vlistID1
+       end subroutine vlistCopy
+      end interface
+  
+      interface
+        subroutine vlistCopyFlag(vlistID2,vlistID1) bind(c,name='vlistCopyFlag')
+          import :: c_int
+          integer(c_int), value :: vlistID2
+          integer(c_int), value :: vlistID1
+       end subroutine vlistCopyFlag
+      end interface
+  
+      interface
+        subroutine vlistClearFlag(vlistID) bind(c,name='vlistClearFlag')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end subroutine vlistClearFlag
+      end interface
+  
+      interface
+        subroutine vlistCat(vlistID2,vlistID1) bind(c,name='vlistCat')
+          import :: c_int
+          integer(c_int), value :: vlistID2
+          integer(c_int), value :: vlistID1
+       end subroutine vlistCat
+      end interface
+  
+      interface
+        subroutine vlistMerge(vlistID2,vlistID1) bind(c,name='vlistMerge')
+          import :: c_int
+          integer(c_int), value :: vlistID2
+          integer(c_int), value :: vlistID1
+       end subroutine vlistMerge
+      end interface
+  
+      interface
+        subroutine vlistPrint(vlistID) bind(c,name='vlistPrint')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end subroutine vlistPrint
+      end interface
+  
+      interface
+        integer(c_int) function vlistNumber(vlistID) bind(c,name='vlistNumber')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistNumber
+      end interface
+  
+      interface
+        integer(c_int) function vlistNvars(vlistID) bind(c,name='vlistNvars')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistNvars
+      end interface
+  
+      interface
+        integer(c_int) function vlistNgrids(vlistID) bind(c,name='vlistNgrids')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistNgrids
+      end interface
+  
+      interface
+        integer(c_int) function vlistNzaxis(vlistID) bind(c,name='vlistNzaxis')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistNzaxis
+      end interface
+  
+      interface
+        subroutine vlistDefNtsteps(vlistID,nts) bind(c,name='vlistDefNtsteps')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: nts
+       end subroutine vlistDefNtsteps
+      end interface
+  
+      interface
+        integer(c_int) function vlistNtsteps(vlistID) bind(c,name='vlistNtsteps')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistNtsteps
+      end interface
+  
+      interface
+        integer(c_int) function vlistGridsizeMax(vlistID) bind(c,name='vlistGridsizeMax')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistGridsizeMax
+      end interface
+  
+      interface
+        integer(c_int) function vlistGrid(vlistID,index) bind(c,name='vlistGrid')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: index
+       end function vlistGrid
+      end interface
+  
+      interface
+        integer(c_int) function vlistGridIndex(vlistID,gridID) bind(c,name='vlistGridIndex')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: gridID
+       end function vlistGridIndex
+      end interface
+  
+      interface
+        subroutine vlistChangeGridIndex(vlistID,index,gridID) bind(c,name='vlistChangeGridIndex')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: index
+          integer(c_int), value :: gridID
+       end subroutine vlistChangeGridIndex
+      end interface
+  
+      interface
+        subroutine vlistChangeGrid(vlistID,gridID1,gridID2) bind(c,name='vlistChangeGrid')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: gridID1
+          integer(c_int), value :: gridID2
+       end subroutine vlistChangeGrid
+      end interface
+  
+      interface
+        integer(c_int) function vlistZaxis(vlistID,index) bind(c,name='vlistZaxis')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: index
+       end function vlistZaxis
+      end interface
+  
+      interface
+        integer(c_int) function vlistZaxisIndex(vlistID,zaxisID) bind(c,name='vlistZaxisIndex')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: zaxisID
+       end function vlistZaxisIndex
+      end interface
+  
+      interface
+        subroutine vlistChangeZaxisIndex(vlistID,index,zaxisID) bind(c,name='vlistChangeZaxisIndex')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: index
+          integer(c_int), value :: zaxisID
+       end subroutine vlistChangeZaxisIndex
+      end interface
+  
+      interface
+        subroutine vlistChangeZaxis(vlistID,zaxisID1,zaxisID2) bind(c,name='vlistChangeZaxis')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: zaxisID1
+          integer(c_int), value :: zaxisID2
+       end subroutine vlistChangeZaxis
+      end interface
+  
+      interface
+        integer(c_int) function vlistNrecs(vlistID) bind(c,name='vlistNrecs')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistNrecs
+      end interface
+  
+      interface
+        subroutine vlistDefTaxis(vlistID,taxisID) bind(c,name='vlistDefTaxis')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: taxisID
+       end subroutine vlistDefTaxis
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqTaxis(vlistID) bind(c,name='vlistInqTaxis')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistInqTaxis
+      end interface
+  
+      interface
+        subroutine vlistDefTable(vlistID,tableID) bind(c,name='vlistDefTable')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: tableID
+       end subroutine vlistDefTable
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqTable(vlistID) bind(c,name='vlistInqTable')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistInqTable
+      end interface
+  
+      interface
+        subroutine vlistDefInstitut(vlistID,instID) bind(c,name='vlistDefInstitut')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: instID
+       end subroutine vlistDefInstitut
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqInstitut(vlistID) bind(c,name='vlistInqInstitut')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistInqInstitut
+      end interface
+  
+      interface
+        subroutine vlistDefModel(vlistID,modelID) bind(c,name='vlistDefModel')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: modelID
+       end subroutine vlistDefModel
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqModel(vlistID) bind(c,name='vlistInqModel')
+          import :: c_int
+          integer(c_int), value :: vlistID
+       end function vlistInqModel
+      end interface
+  
+      interface
+        integer(c_int) function vlistDefVar(vlistID,gridID,zaxisID,timeID) bind(c,name='vlistDefVar')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: gridID
+          integer(c_int), value :: zaxisID
+          integer(c_int), value :: timeID
+       end function vlistDefVar
+      end interface
+  
+      interface
+        subroutine vlistChangeVarGrid(vlistID,varID,gridID) bind(c,name='vlistChangeVarGrid')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: gridID
+       end subroutine vlistChangeVarGrid
+      end interface
+  
+      interface
+        subroutine vlistChangeVarZaxis(vlistID,varID,zaxisID) bind(c,name='vlistChangeVarZaxis')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: zaxisID
+       end subroutine vlistChangeVarZaxis
+      end interface
+  
+      interface
+        subroutine vlistInqVar(vlistID,varID,gridID,zaxisID,timeID) bind(c,name='vlistInqVar')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), intent(out) :: gridID
+          integer(c_int), intent(out) :: zaxisID
+          integer(c_int), intent(out) :: timeID
+       end subroutine vlistInqVar
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarGrid(vlistID,varID) bind(c,name='vlistInqVarGrid')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarGrid
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarZaxis(vlistID,varID) bind(c,name='vlistInqVarZaxis')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarZaxis
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarTime(vlistID,varID) bind(c,name='vlistInqVarTime')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarTime
+      end interface
+  
+      interface
+        subroutine vlistDefVarZtype(vlistID,varID,ztype) bind(c,name='vlistDefVarZtype')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: ztype
+       end subroutine vlistDefVarZtype
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarZtype(vlistID,varID) bind(c,name='vlistInqVarZtype')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarZtype
+      end interface
+  
+      interface
+        subroutine vlistDefVarZlevel(vlistID,varID,zlevel) bind(c,name='vlistDefVarZlevel')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: zlevel
+       end subroutine vlistDefVarZlevel
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarZlevel(vlistID,varID) bind(c,name='vlistInqVarZlevel')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarZlevel
+      end interface
+  
+      interface
+        subroutine vlistDefVarParam(vlistID,varID,param) bind(c,name='vlistDefVarParam')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: param
+       end subroutine vlistDefVarParam
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarParam(vlistID,varID) bind(c,name='vlistInqVarParam')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarParam
+      end interface
+  
+      interface
+        subroutine vlistDefVarCode(vlistID,varID,code) bind(c,name='vlistDefVarCode')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: code
+       end subroutine vlistDefVarCode
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarCode(vlistID,varID) bind(c,name='vlistInqVarCode')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarCode
+      end interface
+  
+      interface
+        subroutine vlistDefVarDatatype(vlistID,varID,datatype) bind(c,name='vlistDefVarDatatype')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: datatype
+       end subroutine vlistDefVarDatatype
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarDatatype(vlistID,varID) bind(c,name='vlistInqVarDatatype')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarDatatype
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarNumber(vlistID,varID) bind(c,name='vlistInqVarNumber')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarNumber
+      end interface
+  
+      interface
+        subroutine vlistDefVarInstitut(vlistID,varID,instID) bind(c,name='vlistDefVarInstitut')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: instID
+       end subroutine vlistDefVarInstitut
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarInstitut(vlistID,varID) bind(c,name='vlistInqVarInstitut')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarInstitut
+      end interface
+  
+      interface
+        subroutine vlistDefVarModel(vlistID,varID,modelID) bind(c,name='vlistDefVarModel')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: modelID
+       end subroutine vlistDefVarModel
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarModel(vlistID,varID) bind(c,name='vlistInqVarModel')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarModel
+      end interface
+  
+      interface
+        subroutine vlistDefVarTable(vlistID,varID,tableID) bind(c,name='vlistDefVarTable')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: tableID
+       end subroutine vlistDefVarTable
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarTable(vlistID,varID) bind(c,name='vlistInqVarTable')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarTable
+      end interface
+  
+      interface
+        subroutine vlistDefVarName(vlistID,varID,name) bind(c,name='vlistDefVarName')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: name
+       end subroutine vlistDefVarName
+      end interface
+  
+      interface
+        subroutine vlistInqVarName(vlistID,varID,name) bind(c,name='vlistInqVarName')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: name
+       end subroutine vlistInqVarName
+      end interface
+  
+      interface
+        subroutine vlistDefVarStdname(vlistID,varID,stdname) bind(c,name='vlistDefVarStdname')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: stdname
+       end subroutine vlistDefVarStdname
+      end interface
+  
+      interface
+        subroutine vlistInqVarStdname(vlistID,varID,stdname) bind(c,name='vlistInqVarStdname')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: stdname
+       end subroutine vlistInqVarStdname
+      end interface
+  
+      interface
+        subroutine vlistDefVarLongname(vlistID,varID,longname) bind(c,name='vlistDefVarLongname')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: longname
+       end subroutine vlistDefVarLongname
+      end interface
+  
+      interface
+        subroutine vlistInqVarLongname(vlistID,varID,longname) bind(c,name='vlistInqVarLongname')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: longname
+       end subroutine vlistInqVarLongname
+      end interface
+  
+      interface
+        subroutine vlistDefVarUnits(vlistID,varID,units) bind(c,name='vlistDefVarUnits')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: units
+       end subroutine vlistDefVarUnits
+      end interface
+  
+      interface
+        subroutine vlistInqVarUnits(vlistID,varID,units) bind(c,name='vlistInqVarUnits')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: units
+       end subroutine vlistInqVarUnits
+      end interface
+  
+      interface
+        subroutine vlistDefVarMissval(vlistID,varID,missval) bind(c,name='vlistDefVarMissval')
+          import :: c_int,c_double
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          real(c_double), value :: missval
+       end subroutine vlistDefVarMissval
+      end interface
+  
+      interface
+        real(c_double) function vlistInqVarMissval(vlistID,varID) bind(c,name='vlistInqVarMissval')
+          import :: c_int,c_double
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarMissval
+      end interface
+  
+      interface
+        subroutine vlistDefVarScalefactor(vlistID,varID,scalefactor) bind(c,name='vlistDefVarScalefactor')
+          import :: c_int,c_double
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          real(c_double), value :: scalefactor
+       end subroutine vlistDefVarScalefactor
+      end interface
+  
+      interface
+        real(c_double) function vlistInqVarScalefactor(vlistID,varID) bind(c,name='vlistInqVarScalefactor')
+          import :: c_int,c_double
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarScalefactor
+      end interface
+  
+      interface
+        subroutine vlistDefVarAddoffset(vlistID,varID,addoffset) bind(c,name='vlistDefVarAddoffset')
+          import :: c_int,c_double
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          real(c_double), value :: addoffset
+       end subroutine vlistDefVarAddoffset
+      end interface
+  
+      interface
+        real(c_double) function vlistInqVarAddoffset(vlistID,varID) bind(c,name='vlistInqVarAddoffset')
+          import :: c_int,c_double
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarAddoffset
+      end interface
+  
+      interface
+        subroutine vlistDefVarTsteptype(vlistID,varID,tsteptype) bind(c,name='vlistDefVarTsteptype')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: tsteptype
+       end subroutine vlistDefVarTsteptype
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarTsteptype(vlistID,varID) bind(c,name='vlistInqVarTsteptype')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarTsteptype
+      end interface
+  
+      interface
+        subroutine vlistDefVarTimave(vlistID,varID,timave) bind(c,name='vlistDefVarTimave')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: timave
+       end subroutine vlistDefVarTimave
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarTimave(vlistID,varID) bind(c,name='vlistInqVarTimave')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarTimave
+      end interface
+  
+      interface
+        subroutine vlistDefVarTimaccu(vlistID,varID,timaccu) bind(c,name='vlistDefVarTimaccu')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: timaccu
+       end subroutine vlistDefVarTimaccu
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarTimaccu(vlistID,varID) bind(c,name='vlistInqVarTimaccu')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarTimaccu
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarSize(vlistID,varID) bind(c,name='vlistInqVarSize')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistInqVarSize
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqVarID(vlistID,code) bind(c,name='vlistInqVarID')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: code
+       end function vlistInqVarID
+      end interface
+  
+      interface
+        subroutine vlistDefIndex(vlistID,varID,levID,index) bind(c,name='vlistDefIndex')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: levID
+          integer(c_int), value :: index
+       end subroutine vlistDefIndex
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqIndex(vlistID,varID,levID) bind(c,name='vlistInqIndex')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: levID
+       end function vlistInqIndex
+      end interface
+  
+      interface
+        subroutine vlistDefFlag(vlistID,varID,levID,flag) bind(c,name='vlistDefFlag')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: levID
+          integer(c_int), value :: flag
+       end subroutine vlistDefFlag
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqFlag(vlistID,varID,levID) bind(c,name='vlistInqFlag')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: levID
+       end function vlistInqFlag
+      end interface
+  
+      interface
+        integer(c_int) function vlistFindVar(vlistID,fvarID) bind(c,name='vlistFindVar')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: fvarID
+       end function vlistFindVar
+      end interface
+  
+      interface
+        integer(c_int) function vlistFindLevel(vlistID,fvarID,flevelID) bind(c,name='vlistFindLevel')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: fvarID
+          integer(c_int), value :: flevelID
+       end function vlistFindLevel
+      end interface
+  
+      interface
+        integer(c_int) function vlistMergedVar(vlistID,varID) bind(c,name='vlistMergedVar')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+       end function vlistMergedVar
+      end interface
+  
+      interface
+        integer(c_int) function vlistMergedLevel(vlistID,varID,levelID) bind(c,name='vlistMergedLevel')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: levelID
+       end function vlistMergedLevel
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqNatts(vlistID,varID,nattsp) bind(c,name='vlistInqNatts')
+          import :: c_int
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), intent(out) :: nattsp
+       end function vlistInqNatts
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqAtt(vlistID,varID,attrnum,name,typep,lenp) bind(c,name='vlistInqAtt')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          integer(c_int), value :: attrnum
+          character(c_char), dimension(*) :: name
+          integer(c_int), intent(out) :: typep
+          integer(c_int), intent(out) :: lenp
+       end function vlistInqAtt
+      end interface
+  
+      interface
+        integer(c_int) function vlistDelAtt(vlistID,varID,name) bind(c,name='vlistDelAtt')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: name
+       end function vlistDelAtt
+      end interface
+  
+      interface
+        integer(c_int) function vlistDefAttInt(vlistID,varID,name,len,ip_vec) bind(c,name='vlistDefAttInt')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: name
+          integer(c_int), value :: len
+          integer(c_int), intent(in),dimension(*) :: ip_vec
+       end function vlistDefAttInt
+      end interface
+  
+      interface
+        integer(c_int) function vlistDefAttFlt(vlistID,varID,name,len,dp_vec) bind(c,name='vlistDefAttFlt')
+          import :: c_int,c_char,c_double
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: name
+          integer(c_int), value :: len
+          real(c_double), intent(in),dimension(*) :: dp_vec
+       end function vlistDefAttFlt
+      end interface
+  
+      interface
+        integer(c_int) function vlistDefAttTxt(vlistID,varID,name,len,tp) bind(c,name='vlistDefAttTxt')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: name
+          integer(c_int), value :: len
+          character(c_char), dimension(*) :: tp
+       end function vlistDefAttTxt
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqAttInt(vlistID,varID,name,mlen,ip_vec) bind(c,name='vlistInqAttInt')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: name
+          integer(c_int), value :: mlen
+          integer(c_int), intent(out),dimension(*) :: ip_vec
+       end function vlistInqAttInt
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqAttFlt(vlistID,varID,name,mlen,dp_vec) bind(c,name='vlistInqAttFlt')
+          import :: c_int,c_char,c_double
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: name
+          integer(c_int), value :: mlen
+          real(c_double), intent(out),dimension(*) :: dp_vec
+       end function vlistInqAttFlt
+      end interface
+  
+      interface
+        integer(c_int) function vlistInqAttTxt(vlistID,varID,name,mlen,tp) bind(c,name='vlistInqAttTxt')
+          import :: c_int,c_char
+          integer(c_int), value :: vlistID
+          integer(c_int), value :: varID
+          character(c_char), dimension(*) :: name
+          integer(c_int), value :: mlen
+          character(c_char), dimension(*) :: tp
+       end function vlistInqAttTxt
+      end interface
+  
+      interface
+        subroutine gridName(gridtype,gridnamev) bind(c,name='gridName')
+          import :: c_int,c_char
+          integer(c_int), value :: gridtype
+          character(c_char), dimension(*) :: gridnamev
+       end subroutine gridName
+      end interface
+  
+      interface
+        character(c_char) function gridNamePtr(gridtype) bind(c,name='gridNamePtr')
+          import :: c_int,c_char
+          integer(c_int), value :: gridtype
+       end function gridNamePtr
+      end interface
+  
+      interface
+        subroutine gridCompress(gridID) bind(c,name='gridCompress')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end subroutine gridCompress
+      end interface
+  
+      interface
+        subroutine gridDefMask(gridID,mask_vec) bind(c,name='gridDefMask')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), intent(in),dimension(*) :: mask_vec
+       end subroutine gridDefMask
+      end interface
+  
+      interface
+        integer(c_int) function gridInqMask(gridID,mask_vec) bind(c,name='gridInqMask')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), intent(out),dimension(*) :: mask_vec
+       end function gridInqMask
+      end interface
+  
+      interface
+        subroutine gridPrint(gridID,opt) bind(c,name='gridPrint')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: opt
+       end subroutine gridPrint
+      end interface
+  
+      interface
+        integer(c_int) function gridSize() bind(c,name='gridSize')
+          import :: c_int
+       end function gridSize
+      end interface
+  
+      interface
+        integer(c_int) function gridCreate(gridtype,size) bind(c,name='gridCreate')
+          import :: c_int
+          integer(c_int), value :: gridtype
+          integer(c_int), value :: size
+       end function gridCreate
+      end interface
+  
+      interface
+        subroutine gridDestroy(gridID) bind(c,name='gridDestroy')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end subroutine gridDestroy
+      end interface
+  
+      interface
+        integer(c_int) function gridDuplicate(gridID) bind(c,name='gridDuplicate')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridDuplicate
+      end interface
+  
+      interface
+        integer(c_int) function gridInqType(gridID) bind(c,name='gridInqType')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqType
+      end interface
+  
+      interface
+        integer(c_int) function gridInqSize(gridID) bind(c,name='gridInqSize')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqSize
+      end interface
+  
+      interface
+        subroutine gridDefXsize(gridID,xsize) bind(c,name='gridDefXsize')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: xsize
+       end subroutine gridDefXsize
+      end interface
+  
+      interface
+        integer(c_int) function gridInqXsize(gridID) bind(c,name='gridInqXsize')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqXsize
+      end interface
+  
+      interface
+        subroutine gridDefYsize(gridID,ysize) bind(c,name='gridDefYsize')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: ysize
+       end subroutine gridDefYsize
+      end interface
+  
+      interface
+        integer(c_int) function gridInqYsize(gridID) bind(c,name='gridInqYsize')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqYsize
+      end interface
+  
+      interface
+        subroutine gridDefXvals(gridID,xvals_vec) bind(c,name='gridDefXvals')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(in),dimension(*) :: xvals_vec
+       end subroutine gridDefXvals
+      end interface
+  
+      interface
+        integer(c_int) function gridInqXvals(gridID,xvals_vec) bind(c,name='gridInqXvals')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(out),dimension(*) :: xvals_vec
+       end function gridInqXvals
+      end interface
+  
+      interface
+        subroutine gridDefYvals(gridID,yvals_vec) bind(c,name='gridDefYvals')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(in),dimension(*) :: yvals_vec
+       end subroutine gridDefYvals
+      end interface
+  
+      interface
+        integer(c_int) function gridInqYvals(gridID,yvals_vec) bind(c,name='gridInqYvals')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(out),dimension(*) :: yvals_vec
+       end function gridInqYvals
+      end interface
+  
+      interface
+        subroutine gridDefXname(gridID,xname) bind(c,name='gridDefXname')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: xname
+       end subroutine gridDefXname
+      end interface
+  
+      interface
+        subroutine gridDefXlongname(gridID,xlongname) bind(c,name='gridDefXlongname')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: xlongname
+       end subroutine gridDefXlongname
+      end interface
+  
+      interface
+        subroutine gridDefXunits(gridID,xunits) bind(c,name='gridDefXunits')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: xunits
+       end subroutine gridDefXunits
+      end interface
+  
+      interface
+        subroutine gridDefYname(gridID,yname) bind(c,name='gridDefYname')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: yname
+       end subroutine gridDefYname
+      end interface
+  
+      interface
+        subroutine gridDefYlongname(gridID,ylongname) bind(c,name='gridDefYlongname')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: ylongname
+       end subroutine gridDefYlongname
+      end interface
+  
+      interface
+        subroutine gridDefYunits(gridID,yunits) bind(c,name='gridDefYunits')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: yunits
+       end subroutine gridDefYunits
+      end interface
+  
+      interface
+        subroutine gridInqXname(gridID,xname) bind(c,name='gridInqXname')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: xname
+       end subroutine gridInqXname
+      end interface
+  
+      interface
+        subroutine gridInqXlongname(gridID,xlongname) bind(c,name='gridInqXlongname')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: xlongname
+       end subroutine gridInqXlongname
+      end interface
+  
+      interface
+        subroutine gridInqXstdname(gridID,xstdname) bind(c,name='gridInqXstdname')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: xstdname
+       end subroutine gridInqXstdname
+      end interface
+  
+      interface
+        subroutine gridInqXunits(gridID,xunits) bind(c,name='gridInqXunits')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: xunits
+       end subroutine gridInqXunits
+      end interface
+  
+      interface
+        subroutine gridInqYname(gridID,yname) bind(c,name='gridInqYname')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: yname
+       end subroutine gridInqYname
+      end interface
+  
+      interface
+        subroutine gridInqYlongname(gridID,ylongname) bind(c,name='gridInqYlongname')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: ylongname
+       end subroutine gridInqYlongname
+      end interface
+  
+      interface
+        subroutine gridInqYstdname(gridID,ystdname) bind(c,name='gridInqYstdname')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: ystdname
+       end subroutine gridInqYstdname
+      end interface
+  
+      interface
+        subroutine gridInqYunits(gridID,yunits) bind(c,name='gridInqYunits')
+          import :: c_int,c_char
+          integer(c_int), value :: gridID
+          character(c_char), dimension(*) :: yunits
+       end subroutine gridInqYunits
+      end interface
+  
+      interface
+        subroutine gridDefPrec(gridID,prec) bind(c,name='gridDefPrec')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: prec
+       end subroutine gridDefPrec
+      end interface
+  
+      interface
+        integer(c_int) function gridInqPrec(gridID) bind(c,name='gridInqPrec')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqPrec
+      end interface
+  
+      interface
+        real(c_double) function gridInqXval(gridID,index) bind(c,name='gridInqXval')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          integer(c_int), value :: index
+       end function gridInqXval
+      end interface
+  
+      interface
+        real(c_double) function gridInqYval(gridID,index) bind(c,name='gridInqYval')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          integer(c_int), value :: index
+       end function gridInqYval
+      end interface
+  
+      interface
+        real(c_double) function gridInqXinc(gridID) bind(c,name='gridInqXinc')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+       end function gridInqXinc
+      end interface
+  
+      interface
+        real(c_double) function gridInqYinc(gridID) bind(c,name='gridInqYinc')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+       end function gridInqYinc
+      end interface
+  
+      interface
+        integer(c_int) function gridIsCircular(gridID) bind(c,name='gridIsCircular')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridIsCircular
+      end interface
+  
+      interface
+        integer(c_int) function gridIsRotated(gridID) bind(c,name='gridIsRotated')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridIsRotated
+      end interface
+  
+      interface
+        real(c_double) function gridInqXpole(gridID) bind(c,name='gridInqXpole')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+       end function gridInqXpole
+      end interface
+  
+      interface
+        subroutine gridDefXpole(gridID,xpole) bind(c,name='gridDefXpole')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), value :: xpole
+       end subroutine gridDefXpole
+      end interface
+  
+      interface
+        real(c_double) function gridInqYpole(gridID) bind(c,name='gridInqYpole')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+       end function gridInqYpole
+      end interface
+  
+      interface
+        subroutine gridDefYpole(gridID,ypole) bind(c,name='gridDefYpole')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), value :: ypole
+       end subroutine gridDefYpole
+      end interface
+  
+      interface
+        real(c_double) function gridInqAngle(gridID) bind(c,name='gridInqAngle')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+       end function gridInqAngle
+      end interface
+  
+      interface
+        subroutine gridDefAngle(gridID,angle) bind(c,name='gridDefAngle')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), value :: angle
+       end subroutine gridDefAngle
+      end interface
+  
+      interface
+        subroutine gridDefTrunc(gridID,trunc) bind(c,name='gridDefTrunc')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: trunc
+       end subroutine gridDefTrunc
+      end interface
+  
+      interface
+        integer(c_int) function gridInqTrunc(gridID) bind(c,name='gridInqTrunc')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqTrunc
+      end interface
+  
+      interface
+        integer(c_int) function gridInqGMEnd(gridID) bind(c,name='gridInqGMEnd')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqGMEnd
+      end interface
+  
+      interface
+        subroutine gridDefGMEnd(gridID,nd) bind(c,name='gridDefGMEnd')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: nd
+       end subroutine gridDefGMEnd
+      end interface
+  
+      interface
+        integer(c_int) function gridInqGMEni(gridID) bind(c,name='gridInqGMEni')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqGMEni
+      end interface
+  
+      interface
+        subroutine gridDefGMEni(gridID,ni) bind(c,name='gridDefGMEni')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: ni
+       end subroutine gridDefGMEni
+      end interface
+  
+      interface
+        integer(c_int) function gridInqGMEni2(gridID) bind(c,name='gridInqGMEni2')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqGMEni2
+      end interface
+  
+      interface
+        subroutine gridDefGMEni2(gridID,ni2) bind(c,name='gridDefGMEni2')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: ni2
+       end subroutine gridDefGMEni2
+      end interface
+  
+      interface
+        integer(c_int) function gridInqGMEni3(gridID) bind(c,name='gridInqGMEni3')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqGMEni3
+      end interface
+  
+      interface
+        subroutine gridDefGMEni3(gridID,ni3) bind(c,name='gridDefGMEni3')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: ni3
+       end subroutine gridDefGMEni3
+      end interface
+  
+      interface
+        subroutine gridDefLCC(gridID,originLon,originLat,lonParY,lat1,lat2,xinc,yinc,projflag,scanflag) bind(c,name='gridDefLCC')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), value :: originLon
+          real(c_double), value :: originLat
+          real(c_double), value :: lonParY
+          real(c_double), value :: lat1
+          real(c_double), value :: lat2
+          real(c_double), value :: xinc
+          real(c_double), value :: yinc
+          integer(c_int), value :: projflag
+          integer(c_int), value :: scanflag
+       end subroutine gridDefLCC
+      end interface
+  
+      interface
+        subroutine gridInqLCC(gridID,originLon,originLat,lonParY,lat1,lat2,xinc,yinc,projflag,scanflag) bind(c,name='gridInqLCC')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(out) :: originLon
+          real(c_double), intent(out) :: originLat
+          real(c_double), intent(out) :: lonParY
+          real(c_double), intent(out) :: lat1
+          real(c_double), intent(out) :: lat2
+          real(c_double), intent(out) :: xinc
+          real(c_double), intent(out) :: yinc
+          integer(c_int), intent(out) :: projflag
+          integer(c_int), intent(out) :: scanflag
+       end subroutine gridInqLCC
+      end interface
+  
+      interface
+        subroutine gridDefLcc2(gridID,earth_radius,lon_0,lat_0,lat_1,lat_2) bind(c,name='gridDefLcc2')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), value :: earth_radius
+          real(c_double), value :: lon_0
+          real(c_double), value :: lat_0
+          real(c_double), value :: lat_1
+          real(c_double), value :: lat_2
+       end subroutine gridDefLcc2
+      end interface
+  
+      interface
+        subroutine gridInqLcc2(gridID,earth_radius,lon_0,lat_0,lat_1,lat_2) bind(c,name='gridInqLcc2')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(out) :: earth_radius
+          real(c_double), intent(out) :: lon_0
+          real(c_double), intent(out) :: lat_0
+          real(c_double), intent(out) :: lat_1
+          real(c_double), intent(out) :: lat_2
+       end subroutine gridInqLcc2
+      end interface
+  
+      interface
+        subroutine gridDefLaea(gridID,earth_radius,lon_0,lat_0) bind(c,name='gridDefLaea')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), value :: earth_radius
+          real(c_double), value :: lon_0
+          real(c_double), value :: lat_0
+       end subroutine gridDefLaea
+      end interface
+  
+      interface
+        subroutine gridInqLaea(gridID,earth_radius,lon_0,lat_0) bind(c,name='gridInqLaea')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(out) :: earth_radius
+          real(c_double), intent(out) :: lon_0
+          real(c_double), intent(out) :: lat_0
+       end subroutine gridInqLaea
+      end interface
+  
+      interface
+        subroutine gridDefArea(gridID,area_vec) bind(c,name='gridDefArea')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(in),dimension(*) :: area_vec
+       end subroutine gridDefArea
+      end interface
+  
+      interface
+        subroutine gridInqArea(gridID,area_vec) bind(c,name='gridInqArea')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(out),dimension(*) :: area_vec
+       end subroutine gridInqArea
+      end interface
+  
+      interface
+        integer(c_int) function gridHasArea(gridID) bind(c,name='gridHasArea')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridHasArea
+      end interface
+  
+      interface
+        subroutine gridDefNvertex(gridID,nvertex) bind(c,name='gridDefNvertex')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: nvertex
+       end subroutine gridDefNvertex
+      end interface
+  
+      interface
+        integer(c_int) function gridInqNvertex(gridID) bind(c,name='gridInqNvertex')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqNvertex
+      end interface
+  
+      interface
+        subroutine gridDefXbounds(gridID,xbounds_vec) bind(c,name='gridDefXbounds')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(in),dimension(*) :: xbounds_vec
+       end subroutine gridDefXbounds
+      end interface
+  
+      interface
+        integer(c_int) function gridInqXbounds(gridID,xbounds_vec) bind(c,name='gridInqXbounds')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(out),dimension(*) :: xbounds_vec
+       end function gridInqXbounds
+      end interface
+  
+      interface
+        subroutine gridDefYbounds(gridID,ybounds_vec) bind(c,name='gridDefYbounds')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(in),dimension(*) :: ybounds_vec
+       end subroutine gridDefYbounds
+      end interface
+  
+      interface
+        integer(c_int) function gridInqYbounds(gridID,ybounds_vec) bind(c,name='gridInqYbounds')
+          import :: c_int,c_double
+          integer(c_int), value :: gridID
+          real(c_double), intent(out),dimension(*) :: ybounds_vec
+       end function gridInqYbounds
+      end interface
+  
+      interface
+        subroutine gridDefRowlon(gridID,nrowlon,rowlon_vec) bind(c,name='gridDefRowlon')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: nrowlon
+          integer(c_int), intent(in),dimension(*) :: rowlon_vec
+       end subroutine gridDefRowlon
+      end interface
+  
+      interface
+        subroutine gridInqRowlon(gridID,rowlon_vec) bind(c,name='gridInqRowlon')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), intent(out),dimension(*) :: rowlon_vec
+       end subroutine gridInqRowlon
+      end interface
+  
+      interface
+        subroutine gridChangeType(gridID,gridtype) bind(c,name='gridChangeType')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: gridtype
+       end subroutine gridChangeType
+      end interface
+  
+      interface
+        subroutine gridDefComplexPacking(gridID,lpack) bind(c,name='gridDefComplexPacking')
+          import :: c_int
+          integer(c_int), value :: gridID
+          integer(c_int), value :: lpack
+       end subroutine gridDefComplexPacking
+      end interface
+  
+      interface
+        integer(c_int) function gridInqComplexPacking(gridID) bind(c,name='gridInqComplexPacking')
+          import :: c_int
+          integer(c_int), value :: gridID
+       end function gridInqComplexPacking
+      end interface
+  
+      interface
+        subroutine zaxisName(zaxistype,zaxisnamev) bind(c,name='zaxisName')
+          import :: c_int,c_char
+          integer(c_int), value :: zaxistype
+          character(c_char), dimension(*) :: zaxisnamev
+       end subroutine zaxisName
+      end interface
+  
+      interface
+        integer(c_int) function zaxisCreate(zaxistype,size) bind(c,name='zaxisCreate')
+          import :: c_int
+          integer(c_int), value :: zaxistype
+          integer(c_int), value :: size
+       end function zaxisCreate
+      end interface
+  
+      interface
+        subroutine zaxisDestroy(zaxisID) bind(c,name='zaxisDestroy')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+       end subroutine zaxisDestroy
+      end interface
+  
+      interface
+        integer(c_int) function zaxisInqType(zaxisID) bind(c,name='zaxisInqType')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+       end function zaxisInqType
+      end interface
+  
+      interface
+        integer(c_int) function zaxisInqSize(zaxisID) bind(c,name='zaxisInqSize')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+       end function zaxisInqSize
+      end interface
+  
+      interface
+        integer(c_int) function zaxisDuplicate(zaxisID) bind(c,name='zaxisDuplicate')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+       end function zaxisDuplicate
+      end interface
+  
+      interface
+        subroutine zaxisResize(zaxisID,size) bind(c,name='zaxisResize')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+          integer(c_int), value :: size
+       end subroutine zaxisResize
+      end interface
+  
+      interface
+        subroutine zaxisPrint(zaxisID) bind(c,name='zaxisPrint')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+       end subroutine zaxisPrint
+      end interface
+  
+      interface
+        integer(c_int) function zaxisSize() bind(c,name='zaxisSize')
+          import :: c_int
+       end function zaxisSize
+      end interface
+  
+      interface
+        subroutine zaxisDefLevels(zaxisID,levels_vec) bind(c,name='zaxisDefLevels')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          real(c_double), intent(in),dimension(*) :: levels_vec
+       end subroutine zaxisDefLevels
+      end interface
+  
+      interface
+        subroutine zaxisInqLevels(zaxisID,levels_vec) bind(c,name='zaxisInqLevels')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          real(c_double), intent(out),dimension(*) :: levels_vec
+       end subroutine zaxisInqLevels
+      end interface
+  
+      interface
+        subroutine zaxisDefLevel(zaxisID,levelID,levels) bind(c,name='zaxisDefLevel')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          integer(c_int), value :: levelID
+          real(c_double), value :: levels
+       end subroutine zaxisDefLevel
+      end interface
+  
+      interface
+        real(c_double) function zaxisInqLevel(zaxisID,levelID) bind(c,name='zaxisInqLevel')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          integer(c_int), value :: levelID
+       end function zaxisInqLevel
+      end interface
+  
+      interface
+        subroutine zaxisDefName(zaxisID,name) bind(c,name='zaxisDefName')
+          import :: c_int,c_char
+          integer(c_int), value :: zaxisID
+          character(c_char), dimension(*) :: name
+       end subroutine zaxisDefName
+      end interface
+  
+      interface
+        subroutine zaxisDefLongname(zaxisID,longname) bind(c,name='zaxisDefLongname')
+          import :: c_int,c_char
+          integer(c_int), value :: zaxisID
+          character(c_char), dimension(*) :: longname
+       end subroutine zaxisDefLongname
+      end interface
+  
+      interface
+        subroutine zaxisDefUnits(zaxisID,units) bind(c,name='zaxisDefUnits')
+          import :: c_int,c_char
+          integer(c_int), value :: zaxisID
+          character(c_char), dimension(*) :: units
+       end subroutine zaxisDefUnits
+      end interface
+  
+      interface
+        subroutine zaxisInqName(zaxisID,name) bind(c,name='zaxisInqName')
+          import :: c_int,c_char
+          integer(c_int), value :: zaxisID
+          character(c_char), dimension(*) :: name
+       end subroutine zaxisInqName
+      end interface
+  
+      interface
+        subroutine zaxisInqLongname(zaxisID,longname) bind(c,name='zaxisInqLongname')
+          import :: c_int,c_char
+          integer(c_int), value :: zaxisID
+          character(c_char), dimension(*) :: longname
+       end subroutine zaxisInqLongname
+      end interface
+  
+      interface
+        subroutine zaxisInqUnits(zaxisID,units) bind(c,name='zaxisInqUnits')
+          import :: c_int,c_char
+          integer(c_int), value :: zaxisID
+          character(c_char), dimension(*) :: units
+       end subroutine zaxisInqUnits
+      end interface
+  
+      interface
+        subroutine zaxisDefPrec(zaxisID,prec) bind(c,name='zaxisDefPrec')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+          integer(c_int), value :: prec
+       end subroutine zaxisDefPrec
+      end interface
+  
+      interface
+        integer(c_int) function zaxisInqPrec(zaxisID) bind(c,name='zaxisInqPrec')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+       end function zaxisInqPrec
+      end interface
+  
+      interface
+        subroutine zaxisDefLtype(zaxisID,ltype) bind(c,name='zaxisDefLtype')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+          integer(c_int), value :: ltype
+       end subroutine zaxisDefLtype
+      end interface
+  
+      interface
+        integer(c_int) function zaxisInqLtype(zaxisID) bind(c,name='zaxisInqLtype')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+       end function zaxisInqLtype
+      end interface
+  
+      interface
+        real(c_double) function zaxisInqLevelsPtr(zaxisID) bind(c,name='zaxisInqLevelsPtr')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+       end function zaxisInqLevelsPtr
+      end interface
+  
+      interface
+        subroutine zaxisDefVct(zaxisID,size,vct_vec) bind(c,name='zaxisDefVct')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          integer(c_int), value :: size
+          real(c_double), intent(in),dimension(*) :: vct_vec
+       end subroutine zaxisDefVct
+      end interface
+  
+      interface
+        integer(c_int) function zaxisInqVctSize(zaxisID) bind(c,name='zaxisInqVctSize')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+       end function zaxisInqVctSize
+      end interface
+  
+      interface
+        real(c_double) function zaxisInqVctPtr(zaxisID) bind(c,name='zaxisInqVctPtr')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+       end function zaxisInqVctPtr
+      end interface
+  
+      interface
+        integer(c_int) function zaxisInqLbounds(zaxisID,lbounds_vec) bind(c,name='zaxisInqLbounds')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          real(c_double), intent(out),dimension(*) :: lbounds_vec
+       end function zaxisInqLbounds
+      end interface
+  
+      interface
+        integer(c_int) function zaxisInqUbounds(zaxisID,ubounds_vec) bind(c,name='zaxisInqUbounds')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          real(c_double), intent(out),dimension(*) :: ubounds_vec
+       end function zaxisInqUbounds
+      end interface
+  
+      interface
+        integer(c_int) function zaxisInqWeights(zaxisID,weights_vec) bind(c,name='zaxisInqWeights')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          real(c_double), intent(out),dimension(*) :: weights_vec
+       end function zaxisInqWeights
+      end interface
+  
+      interface
+        real(c_double) function zaxisInqLbound(zaxisID,index) bind(c,name='zaxisInqLbound')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          integer(c_int), value :: index
+       end function zaxisInqLbound
+      end interface
+  
+      interface
+        real(c_double) function zaxisInqUbound(zaxisID,index) bind(c,name='zaxisInqUbound')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          integer(c_int), value :: index
+       end function zaxisInqUbound
+      end interface
+  
+      interface
+        subroutine zaxisDefLbounds(zaxisID,lbounds_vec) bind(c,name='zaxisDefLbounds')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          real(c_double), intent(in),dimension(*) :: lbounds_vec
+       end subroutine zaxisDefLbounds
+      end interface
+  
+      interface
+        subroutine zaxisDefUbounds(zaxisID,ubounds_vec) bind(c,name='zaxisDefUbounds')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          real(c_double), intent(in),dimension(*) :: ubounds_vec
+       end subroutine zaxisDefUbounds
+      end interface
+  
+      interface
+        subroutine zaxisDefWeights(zaxisID,weights_vec) bind(c,name='zaxisDefWeights')
+          import :: c_int,c_double
+          integer(c_int), value :: zaxisID
+          real(c_double), intent(in),dimension(*) :: weights_vec
+       end subroutine zaxisDefWeights
+      end interface
+  
+      interface
+        subroutine zaxisChangeType(zaxisID,zaxistype) bind(c,name='zaxisChangeType')
+          import :: c_int
+          integer(c_int), value :: zaxisID
+          integer(c_int), value :: zaxistype
+       end subroutine zaxisChangeType
+      end interface
+  
+      interface
+        integer(c_int) function taxisCreate(timetype) bind(c,name='taxisCreate')
+          import :: c_int
+          integer(c_int), value :: timetype
+       end function taxisCreate
+      end interface
+  
+      interface
+        subroutine taxisDestroy(taxisID) bind(c,name='taxisDestroy')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end subroutine taxisDestroy
+      end interface
+  
+      interface
+        integer(c_int) function taxisDuplicate(taxisID) bind(c,name='taxisDuplicate')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end function taxisDuplicate
+      end interface
+  
+      interface
+        subroutine taxisCopyTimestep(taxisIDdes,taxisIDsrc) bind(c,name='taxisCopyTimestep')
+          import :: c_int
+          integer(c_int), value :: taxisIDdes
+          integer(c_int), value :: taxisIDsrc
+       end subroutine taxisCopyTimestep
+      end interface
+  
+      interface
+        subroutine taxisDefType(taxisID,type) bind(c,name='taxisDefType')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), value :: type
+       end subroutine taxisDefType
+      end interface
+  
+      interface
+        subroutine taxisDefVdate(taxisID,date) bind(c,name='taxisDefVdate')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), value :: date
+       end subroutine taxisDefVdate
+      end interface
+  
+      interface
+        subroutine taxisDefVtime(taxisID,time) bind(c,name='taxisDefVtime')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), value :: time
+       end subroutine taxisDefVtime
+      end interface
+  
+      interface
+        subroutine taxisDefRdate(taxisID,date) bind(c,name='taxisDefRdate')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), value :: date
+       end subroutine taxisDefRdate
+      end interface
+  
+      interface
+        subroutine taxisDefRtime(taxisID,time) bind(c,name='taxisDefRtime')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), value :: time
+       end subroutine taxisDefRtime
+      end interface
+  
+      interface
+        integer(c_int) function taxisHasBounds(taxisID) bind(c,name='taxisHasBounds')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end function taxisHasBounds
+      end interface
+  
+      interface
+        subroutine taxisDeleteBounds(taxisID) bind(c,name='taxisDeleteBounds')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end subroutine taxisDeleteBounds
+      end interface
+  
+      interface
+        subroutine taxisDefVdateBounds(taxisID,vdate_lb,vdate_ub) bind(c,name='taxisDefVdateBounds')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), value :: vdate_lb
+          integer(c_int), value :: vdate_ub
+       end subroutine taxisDefVdateBounds
+      end interface
+  
+      interface
+        subroutine taxisDefVtimeBounds(taxisID,vtime_lb,vtime_ub) bind(c,name='taxisDefVtimeBounds')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), value :: vtime_lb
+          integer(c_int), value :: vtime_ub
+       end subroutine taxisDefVtimeBounds
+      end interface
+  
+      interface
+        subroutine taxisInqVdateBounds(taxisID,vdate_lb,vdate_ub) bind(c,name='taxisInqVdateBounds')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), intent(out) :: vdate_lb
+          integer(c_int), intent(out) :: vdate_ub
+       end subroutine taxisInqVdateBounds
+      end interface
+  
+      interface
+        subroutine taxisInqVtimeBounds(taxisID,vtime_lb,vtime_ub) bind(c,name='taxisInqVtimeBounds')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), intent(out) :: vtime_lb
+          integer(c_int), intent(out) :: vtime_ub
+       end subroutine taxisInqVtimeBounds
+      end interface
+  
+      interface
+        subroutine taxisDefCalendar(taxisID,calendar) bind(c,name='taxisDefCalendar')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), value :: calendar
+       end subroutine taxisDefCalendar
+      end interface
+  
+      interface
+        subroutine taxisDefTunit(taxisID,tunit) bind(c,name='taxisDefTunit')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), value :: tunit
+       end subroutine taxisDefTunit
+      end interface
+  
+      interface
+        subroutine taxisDefNumavg(taxisID,numavg) bind(c,name='taxisDefNumavg')
+          import :: c_int
+          integer(c_int), value :: taxisID
+          integer(c_int), value :: numavg
+       end subroutine taxisDefNumavg
+      end interface
+  
+      interface
+        integer(c_int) function taxisInqType(taxisID) bind(c,name='taxisInqType')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end function taxisInqType
+      end interface
+  
+      interface
+        integer(c_int) function taxisInqVdate(taxisID) bind(c,name='taxisInqVdate')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end function taxisInqVdate
+      end interface
+  
+      interface
+        integer(c_int) function taxisInqVtime(taxisID) bind(c,name='taxisInqVtime')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end function taxisInqVtime
+      end interface
+  
+      interface
+        integer(c_int) function taxisInqRdate(taxisID) bind(c,name='taxisInqRdate')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end function taxisInqRdate
+      end interface
+  
+      interface
+        integer(c_int) function taxisInqRtime(taxisID) bind(c,name='taxisInqRtime')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end function taxisInqRtime
+      end interface
+  
+      interface
+        integer(c_int) function taxisInqCalendar(taxisID) bind(c,name='taxisInqCalendar')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end function taxisInqCalendar
+      end interface
+  
+      interface
+        integer(c_int) function taxisInqTunit(taxisID) bind(c,name='taxisInqTunit')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end function taxisInqTunit
+      end interface
+  
+      interface
+        integer(c_int) function taxisInqNumavg(taxisID) bind(c,name='taxisInqNumavg')
+          import :: c_int
+          integer(c_int), value :: taxisID
+       end function taxisInqNumavg
+      end interface
+  
+      interface
+        character(c_char) function tunitNamePtr(tunitID) bind(c,name='tunitNamePtr')
+          import :: c_int,c_char
+          integer(c_int), value :: tunitID
+       end function tunitNamePtr
+      end interface
+  
+      interface
+        integer(c_int) function institutDef(center,subcenter,name,longname) bind(c,name='institutDef')
+          import :: c_int,c_char
+          integer(c_int), value :: center
+          integer(c_int), value :: subcenter
+          character(c_char), dimension(*) :: name
+          character(c_char), dimension(*) :: longname
+       end function institutDef
+      end interface
+  
+      interface
+        integer(c_int) function institutInq(center,subcenter,name,longname) bind(c,name='institutInq')
+          import :: c_int,c_char
+          integer(c_int), value :: center
+          integer(c_int), value :: subcenter
+          character(c_char), dimension(*) :: name
+          character(c_char), dimension(*) :: longname
+       end function institutInq
+      end interface
+  
+      interface
+        integer(c_int) function institutInqNumber() bind(c,name='institutInqNumber')
+          import :: c_int
+       end function institutInqNumber
+      end interface
+  
+      interface
+        integer(c_int) function institutInqCenter(instID) bind(c,name='institutInqCenter')
+          import :: c_int
+          integer(c_int), value :: instID
+       end function institutInqCenter
+      end interface
+  
+      interface
+        integer(c_int) function institutInqSubcenter(instID) bind(c,name='institutInqSubcenter')
+          import :: c_int
+          integer(c_int), value :: instID
+       end function institutInqSubcenter
+      end interface
+  
+      interface
+        character(c_char) function institutInqNamePtr(instID) bind(c,name='institutInqNamePtr')
+          import :: c_int,c_char
+          integer(c_int), value :: instID
+       end function institutInqNamePtr
+      end interface
+  
+      interface
+        character(c_char) function institutInqLongnamePtr(instID) bind(c,name='institutInqLongnamePtr')
+          import :: c_int,c_char
+          integer(c_int), value :: instID
+       end function institutInqLongnamePtr
+      end interface
+  
+      interface
+        integer(c_int) function modelDef(instID,modelgribID,name) bind(c,name='modelDef')
+          import :: c_int,c_char
+          integer(c_int), value :: instID
+          integer(c_int), value :: modelgribID
+          character(c_char), dimension(*) :: name
+       end function modelDef
+      end interface
+  
+      interface
+        integer(c_int) function modelInq(instID,modelgribID,name) bind(c,name='modelInq')
+          import :: c_int,c_char
+          integer(c_int), value :: instID
+          integer(c_int), value :: modelgribID
+          character(c_char), dimension(*) :: name
+       end function modelInq
+      end interface
+  
+      interface
+        integer(c_int) function modelInqInstitut(modelID) bind(c,name='modelInqInstitut')
+          import :: c_int
+          integer(c_int), value :: modelID
+       end function modelInqInstitut
+      end interface
+  
+      interface
+        integer(c_int) function modelInqGribID(modelID) bind(c,name='modelInqGribID')
+          import :: c_int
+          integer(c_int), value :: modelID
+       end function modelInqGribID
+      end interface
+  
+      interface
+        character(c_char) function modelInqNamePtr(modelID) bind(c,name='modelInqNamePtr')
+          import :: c_int,c_char
+          integer(c_int), value :: modelID
+       end function modelInqNamePtr
+      end interface
+  
+      interface
+        subroutine tableWriteC(filename,tableID) bind(c,name='tableWriteC')
+          import :: c_char,c_int
+          character(c_char), dimension(*) :: filename
+          integer(c_int), value :: tableID
+       end subroutine tableWriteC
+      end interface
+  
+      interface
+        subroutine tableWrite(filename,tableID) bind(c,name='tableWrite')
+          import :: c_char,c_int
+          character(c_char), dimension(*) :: filename
+          integer(c_int), value :: tableID
+       end subroutine tableWrite
+      end interface
+  
+      interface
+        integer(c_int) function tableRead(tablefile) bind(c,name='tableRead')
+          import :: c_char,c_int
+          character(c_char), dimension(*) :: tablefile
+       end function tableRead
+      end interface
+  
+      interface
+        integer(c_int) function tableDef(modelID,tablenum,tablename) bind(c,name='tableDef')
+          import :: c_int,c_char
+          integer(c_int), value :: modelID
+          integer(c_int), value :: tablenum
+          character(c_char), dimension(*) :: tablename
+       end function tableDef
+      end interface
+  
+      interface
+        character(c_char) function tableInqNamePtr(tableID) bind(c,name='tableInqNamePtr')
+          import :: c_int,c_char
+          integer(c_int), value :: tableID
+       end function tableInqNamePtr
+      end interface
+  
+      interface
+        subroutine tableDefEntry(tableID,code,name,longname,units) bind(c,name='tableDefEntry')
+          import :: c_int,c_char
+          integer(c_int), value :: tableID
+          integer(c_int), value :: code
+          character(c_char), dimension(*) :: name
+          character(c_char), dimension(*) :: longname
+          character(c_char), dimension(*) :: units
+       end subroutine tableDefEntry
+      end interface
+  
+      interface
+        integer(c_int) function tableInq(modelID,tablenum,tablename) bind(c,name='tableInq')
+          import :: c_int,c_char
+          integer(c_int), value :: modelID
+          integer(c_int), value :: tablenum
+          character(c_char), dimension(*) :: tablename
+       end function tableInq
+      end interface
+  
+      interface
+        integer(c_int) function tableInqNumber() bind(c,name='tableInqNumber')
+          import :: c_int
+       end function tableInqNumber
+      end interface
+  
+      interface
+        integer(c_int) function tableInqNum(tableID) bind(c,name='tableInqNum')
+          import :: c_int
+          integer(c_int), value :: tableID
+       end function tableInqNum
+      end interface
+  
+      interface
+        integer(c_int) function tableInqModel(tableID) bind(c,name='tableInqModel')
+          import :: c_int
+          integer(c_int), value :: tableID
+       end function tableInqModel
+      end interface
+  
+      interface
+        subroutine tableInqPar(tableID,code,name,longname,units) bind(c,name='tableInqPar')
+          import :: c_int,c_char
+          integer(c_int), value :: tableID
+          integer(c_int), value :: code
+          character(c_char), dimension(*) :: name
+          character(c_char), dimension(*) :: longname
+          character(c_char), dimension(*) :: units
+       end subroutine tableInqPar
+      end interface
+  
+      interface
+        integer(c_int) function tableInqParCode(tableID,name,code) bind(c,name='tableInqParCode')
+          import :: c_int,c_char
+          integer(c_int), value :: tableID
+          character(c_char), dimension(*) :: name
+          integer(c_int), intent(out) :: code
+       end function tableInqParCode
+      end interface
+  
+      interface
+        integer(c_int) function tableInqParName(tableID,code,name) bind(c,name='tableInqParName')
+          import :: c_int,c_char
+          integer(c_int), value :: tableID
+          integer(c_int), value :: code
+          character(c_char), dimension(*) :: name
+       end function tableInqParName
+      end interface
+  
+      interface
+        integer(c_int) function tableInqParLongname(tableID,code,longname) bind(c,name='tableInqParLongname')
+          import :: c_int,c_char
+          integer(c_int), value :: tableID
+          integer(c_int), value :: code
+          character(c_char), dimension(*) :: longname
+       end function tableInqParLongname
+      end interface
+  
+      interface
+        integer(c_int) function tableInqParUnits(tableID,code,units) bind(c,name='tableInqParUnits')
+          import :: c_int,c_char
+          integer(c_int), value :: tableID
+          integer(c_int), value :: code
+          character(c_char), dimension(*) :: units
+       end function tableInqParUnits
+      end interface
+  
+      interface
+        character(c_char) function tableInqParNamePtr(tableID,parID) bind(c,name='tableInqParNamePtr')
+          import :: c_int,c_char
+          integer(c_int), value :: tableID
+          integer(c_int), value :: parID
+       end function tableInqParNamePtr
+      end interface
+  
+      interface
+        character(c_char) function tableInqParLongnamePtr(tableID,parID) bind(c,name='tableInqParLongnamePtr')
+          import :: c_int,c_char
+          integer(c_int), value :: tableID
+          integer(c_int), value :: parID
+       end function tableInqParLongnamePtr
+      end interface
+  
+      interface
+        character(c_char) function tableInqParUnitsPtr(tableID,parID) bind(c,name='tableInqParUnitsPtr')
+          import :: c_int,c_char
+          integer(c_int), value :: tableID
+          integer(c_int), value :: parID
+       end function tableInqParUnitsPtr
+      end interface
+  
+      interface
+        subroutine streamDefHistory(streamID,size,history) bind(c,name='streamDefHistory')
+          import :: c_int,c_char
+          integer(c_int), value :: streamID
+          integer(c_int), value :: size
+          character(c_char), dimension(*) :: history
+       end subroutine streamDefHistory
+      end interface
+  
+      interface
+        integer(c_int) function streamInqHistorySize(streamID) bind(c,name='streamInqHistorySize')
+          import :: c_int
+          integer(c_int), value :: streamID
+       end function streamInqHistorySize
+      end interface
+  
+      interface
+        subroutine streamInqHistoryString(streamID,history) bind(c,name='streamInqHistoryString')
+          import :: c_int,c_char
+          integer(c_int), value :: streamID
+          character(c_char), dimension(*) :: history
+       end subroutine streamInqHistoryString
+      end interface
+  
+      public :: cdiStringError
+      public :: cdiDebug
+      public :: cdiLibraryVersion
+      public :: cdiPrintVersion
+      public :: cdiDefMissval
+      public :: cdiInqMissval
+      public :: cdiDefGlobal
+      public :: cdiParamToString
+      public :: cdiDecodeParam
+      public :: cdiEncodeParam
+      public :: cdiDecodeDate
+      public :: cdiEncodeDate
+      public :: cdiDecodeTime
+      public :: cdiEncodeTime
+      public :: streamOpenRead
+      public :: streamOpenWrite
+      public :: streamOpenAppend
+      public :: streamClose
+      public :: streamSync
+      public :: streamDefVlist
+      public :: streamInqVlist
+      public :: streamInqFiletype
+      public :: streamDefByteorder
+      public :: streamInqByteorder
+      public :: streamDefZtype
+      public :: streamDefZlevel
+      public :: streamInqZtype
+      public :: streamInqZlevel
+      public :: streamDefTimestep
+      public :: streamInqTimestep
+      public :: streamFilename
+      public :: streamFilesuffix
+      public :: streamNtsteps
+      public :: streamReadVar
+      public :: streamWriteVar
+      public :: streamReadVarSlice
+      public :: streamWriteVarSlice
+      public :: streamInqRecord
+      public :: streamDefRecord
+      public :: streamReadRecord
+      public :: streamWriteRecord
+      public :: streamCopyRecord
+      public :: streamInqGinfo
+      public :: vlistCreate
+      public :: vlistDestroy
+      public :: vlistDuplicate
+      public :: vlistCopy
+      public :: vlistCopyFlag
+      public :: vlistClearFlag
+      public :: vlistCat
+      public :: vlistMerge
+      public :: vlistPrint
+      public :: vlistNumber
+      public :: vlistNvars
+      public :: vlistNgrids
+      public :: vlistNzaxis
+      public :: vlistDefNtsteps
+      public :: vlistNtsteps
+      public :: vlistGridsizeMax
+      public :: vlistGrid
+      public :: vlistGridIndex
+      public :: vlistChangeGridIndex
+      public :: vlistChangeGrid
+      public :: vlistZaxis
+      public :: vlistZaxisIndex
+      public :: vlistChangeZaxisIndex
+      public :: vlistChangeZaxis
+      public :: vlistNrecs
+      public :: vlistDefTaxis
+      public :: vlistInqTaxis
+      public :: vlistDefTable
+      public :: vlistInqTable
+      public :: vlistDefInstitut
+      public :: vlistInqInstitut
+      public :: vlistDefModel
+      public :: vlistInqModel
+      public :: vlistDefVar
+      public :: vlistChangeVarGrid
+      public :: vlistChangeVarZaxis
+      public :: vlistInqVar
+      public :: vlistInqVarGrid
+      public :: vlistInqVarZaxis
+      public :: vlistInqVarTime
+      public :: vlistDefVarZtype
+      public :: vlistInqVarZtype
+      public :: vlistDefVarZlevel
+      public :: vlistInqVarZlevel
+      public :: vlistDefVarParam
+      public :: vlistInqVarParam
+      public :: vlistDefVarCode
+      public :: vlistInqVarCode
+      public :: vlistDefVarDatatype
+      public :: vlistInqVarDatatype
+      public :: vlistInqVarNumber
+      public :: vlistDefVarInstitut
+      public :: vlistInqVarInstitut
+      public :: vlistDefVarModel
+      public :: vlistInqVarModel
+      public :: vlistDefVarTable
+      public :: vlistInqVarTable
+      public :: vlistDefVarName
+      public :: vlistInqVarName
+      public :: vlistDefVarStdname
+      public :: vlistInqVarStdname
+      public :: vlistDefVarLongname
+      public :: vlistInqVarLongname
+      public :: vlistDefVarUnits
+      public :: vlistInqVarUnits
+      public :: vlistDefVarMissval
+      public :: vlistInqVarMissval
+      public :: vlistDefVarScalefactor
+      public :: vlistInqVarScalefactor
+      public :: vlistDefVarAddoffset
+      public :: vlistInqVarAddoffset
+      public :: vlistDefVarTsteptype
+      public :: vlistInqVarTsteptype
+      public :: vlistDefVarTimave
+      public :: vlistInqVarTimave
+      public :: vlistDefVarTimaccu
+      public :: vlistInqVarTimaccu
+      public :: vlistInqVarSize
+      public :: vlistInqVarID
+      public :: vlistDefIndex
+      public :: vlistInqIndex
+      public :: vlistDefFlag
+      public :: vlistInqFlag
+      public :: vlistFindVar
+      public :: vlistFindLevel
+      public :: vlistMergedVar
+      public :: vlistMergedLevel
+      public :: vlistInqNatts
+      public :: vlistInqAtt
+      public :: vlistDelAtt
+      public :: vlistDefAttInt
+      public :: vlistDefAttFlt
+      public :: vlistDefAttTxt
+      public :: vlistInqAttInt
+      public :: vlistInqAttFlt
+      public :: vlistInqAttTxt
+      public :: gridName
+      public :: gridNamePtr
+      public :: gridCompress
+      public :: gridDefMask
+      public :: gridInqMask
+      public :: gridPrint
+      public :: gridSize
+      public :: gridCreate
+      public :: gridDestroy
+      public :: gridDuplicate
+      public :: gridInqType
+      public :: gridInqSize
+      public :: gridDefXsize
+      public :: gridInqXsize
+      public :: gridDefYsize
+      public :: gridInqYsize
+      public :: gridDefXvals
+      public :: gridInqXvals
+      public :: gridDefYvals
+      public :: gridInqYvals
+      public :: gridDefXname
+      public :: gridDefXlongname
+      public :: gridDefXunits
+      public :: gridDefYname
+      public :: gridDefYlongname
+      public :: gridDefYunits
+      public :: gridInqXname
+      public :: gridInqXlongname
+      public :: gridInqXstdname
+      public :: gridInqXunits
+      public :: gridInqYname
+      public :: gridInqYlongname
+      public :: gridInqYstdname
+      public :: gridInqYunits
+      public :: gridDefPrec
+      public :: gridInqPrec
+      public :: gridInqXval
+      public :: gridInqYval
+      public :: gridInqXinc
+      public :: gridInqYinc
+      public :: gridIsCircular
+      public :: gridIsRotated
+      public :: gridInqXpole
+      public :: gridDefXpole
+      public :: gridInqYpole
+      public :: gridDefYpole
+      public :: gridInqAngle
+      public :: gridDefAngle
+      public :: gridDefTrunc
+      public :: gridInqTrunc
+      public :: gridInqGMEnd
+      public :: gridDefGMEnd
+      public :: gridInqGMEni
+      public :: gridDefGMEni
+      public :: gridInqGMEni2
+      public :: gridDefGMEni2
+      public :: gridInqGMEni3
+      public :: gridDefGMEni3
+      public :: gridDefLCC
+      public :: gridInqLCC
+      public :: gridDefLcc2
+      public :: gridInqLcc2
+      public :: gridDefLaea
+      public :: gridInqLaea
+      public :: gridDefArea
+      public :: gridInqArea
+      public :: gridHasArea
+      public :: gridDefNvertex
+      public :: gridInqNvertex
+      public :: gridDefXbounds
+      public :: gridInqXbounds
+      public :: gridDefYbounds
+      public :: gridInqYbounds
+      public :: gridDefRowlon
+      public :: gridInqRowlon
+      public :: gridChangeType
+      public :: gridDefComplexPacking
+      public :: gridInqComplexPacking
+      public :: zaxisName
+      public :: zaxisCreate
+      public :: zaxisDestroy
+      public :: zaxisInqType
+      public :: zaxisInqSize
+      public :: zaxisDuplicate
+      public :: zaxisResize
+      public :: zaxisPrint
+      public :: zaxisSize
+      public :: zaxisDefLevels
+      public :: zaxisInqLevels
+      public :: zaxisDefLevel
+      public :: zaxisInqLevel
+      public :: zaxisDefName
+      public :: zaxisDefLongname
+      public :: zaxisDefUnits
+      public :: zaxisInqName
+      public :: zaxisInqLongname
+      public :: zaxisInqUnits
+      public :: zaxisDefPrec
+      public :: zaxisInqPrec
+      public :: zaxisDefLtype
+      public :: zaxisInqLtype
+      public :: zaxisInqLevelsPtr
+      public :: zaxisDefVct
+      public :: zaxisInqVctSize
+      public :: zaxisInqVctPtr
+      public :: zaxisInqLbounds
+      public :: zaxisInqUbounds
+      public :: zaxisInqWeights
+      public :: zaxisInqLbound
+      public :: zaxisInqUbound
+      public :: zaxisDefLbounds
+      public :: zaxisDefUbounds
+      public :: zaxisDefWeights
+      public :: zaxisChangeType
+      public :: taxisCreate
+      public :: taxisDestroy
+      public :: taxisDuplicate
+      public :: taxisCopyTimestep
+      public :: taxisDefType
+      public :: taxisDefVdate
+      public :: taxisDefVtime
+      public :: taxisDefRdate
+      public :: taxisDefRtime
+      public :: taxisHasBounds
+      public :: taxisDeleteBounds
+      public :: taxisDefVdateBounds
+      public :: taxisDefVtimeBounds
+      public :: taxisInqVdateBounds
+      public :: taxisInqVtimeBounds
+      public :: taxisDefCalendar
+      public :: taxisDefTunit
+      public :: taxisDefNumavg
+      public :: taxisInqType
+      public :: taxisInqVdate
+      public :: taxisInqVtime
+      public :: taxisInqRdate
+      public :: taxisInqRtime
+      public :: taxisInqCalendar
+      public :: taxisInqTunit
+      public :: taxisInqNumavg
+      public :: tunitNamePtr
+      public :: institutDef
+      public :: institutInq
+      public :: institutInqNumber
+      public :: institutInqCenter
+      public :: institutInqSubcenter
+      public :: institutInqNamePtr
+      public :: institutInqLongnamePtr
+      public :: modelDef
+      public :: modelInq
+      public :: modelInqInstitut
+      public :: modelInqGribID
+      public :: modelInqNamePtr
+      public :: tableWriteC
+      public :: tableWrite
+      public :: tableRead
+      public :: tableDef
+      public :: tableInqNamePtr
+      public :: tableDefEntry
+      public :: tableInq
+      public :: tableInqNumber
+      public :: tableInqNum
+      public :: tableInqModel
+      public :: tableInqPar
+      public :: tableInqParCode
+      public :: tableInqParName
+      public :: tableInqParLongname
+      public :: tableInqParUnits
+      public :: tableInqParNamePtr
+      public :: tableInqParLongnamePtr
+      public :: tableInqParUnitsPtr
+      public :: streamDefHistory
+      public :: streamInqHistorySize
+      public :: streamInqHistoryString
+      public :: ctrim
+
+      public :: CDI_UNDEFID
+      public :: CDI_GLOBAL
+      public :: CDI_BIGENDIAN
+      public :: CDI_LITTLEENDIAN
+      public :: CDI_REAL
+      public :: CDI_COMP
+      public :: CDI_BOTH
+      public :: CDI_ESYSTEM
+      public :: CDI_EINVAL
+      public :: CDI_EUFTYPE
+      public :: CDI_ELIBNAVAIL
+      public :: CDI_EUFSTRUCT
+      public :: CDI_EUNC4
+      public :: CDI_ELIMIT
+      public :: FILETYPE_GRB
+      public :: FILETYPE_GRB2
+      public :: FILETYPE_NC
+      public :: FILETYPE_NC2
+      public :: FILETYPE_NC4
+      public :: FILETYPE_SRV
+      public :: FILETYPE_EXT
+      public :: FILETYPE_IEG
+      public :: COMPRESS_NONE
+      public :: COMPRESS_SZIP
+      public :: COMPRESS_GZIP
+      public :: COMPRESS_BZIP2
+      public :: COMPRESS_ZIP
+      public :: COMPRESS_JPEG
+      public :: DATATYPE_PACK
+      public :: DATATYPE_PACK1
+      public :: DATATYPE_PACK2
+      public :: DATATYPE_PACK3
+      public :: DATATYPE_PACK4
+      public :: DATATYPE_PACK5
+      public :: DATATYPE_PACK6
+      public :: DATATYPE_PACK7
+      public :: DATATYPE_PACK8
+      public :: DATATYPE_PACK9
+      public :: DATATYPE_PACK10
+      public :: DATATYPE_PACK11
+      public :: DATATYPE_PACK12
+      public :: DATATYPE_PACK13
+      public :: DATATYPE_PACK14
+      public :: DATATYPE_PACK15
+      public :: DATATYPE_PACK16
+      public :: DATATYPE_PACK17
+      public :: DATATYPE_PACK18
+      public :: DATATYPE_PACK19
+      public :: DATATYPE_PACK20
+      public :: DATATYPE_PACK21
+      public :: DATATYPE_PACK22
+      public :: DATATYPE_PACK23
+      public :: DATATYPE_PACK24
+      public :: DATATYPE_PACK25
+      public :: DATATYPE_PACK26
+      public :: DATATYPE_PACK27
+      public :: DATATYPE_PACK28
+      public :: DATATYPE_PACK29
+      public :: DATATYPE_PACK30
+      public :: DATATYPE_PACK31
+      public :: DATATYPE_PACK32
+      public :: DATATYPE_CPX32
+      public :: DATATYPE_CPX64
+      public :: DATATYPE_FLT32
+      public :: DATATYPE_FLT64
+      public :: DATATYPE_INT8
+      public :: DATATYPE_INT16
+      public :: DATATYPE_INT32
+      public :: DATATYPE_UINT8
+      public :: DATATYPE_UINT16
+      public :: DATATYPE_UINT32
+      public :: DATATYPE_INT
+      public :: DATATYPE_FLT
+      public :: DATATYPE_TXT
+      public :: DATATYPE_CPX
+      public :: GRID_GENERIC
+      public :: GRID_GAUSSIAN
+      public :: GRID_GAUSSIAN_REDUCED
+      public :: GRID_LONLAT
+      public :: GRID_SPECTRAL
+      public :: GRID_FOURIER
+      public :: GRID_GME
+      public :: GRID_TRAJECTORY
+      public :: GRID_UNSTRUCTURED
+      public :: GRID_CURVILINEAR
+      public :: GRID_LCC
+      public :: GRID_LCC2
+      public :: GRID_LAEA
+      public :: GRID_SINUSOIDAL
+      public :: ZAXIS_SURFACE
+      public :: ZAXIS_GENERIC
+      public :: ZAXIS_HYBRID
+      public :: ZAXIS_HYBRID_HALF
+      public :: ZAXIS_PRESSURE
+      public :: ZAXIS_HEIGHT
+      public :: ZAXIS_DEPTH_BELOW_SEA
+      public :: ZAXIS_DEPTH_BELOW_LAND
+      public :: ZAXIS_ISENTROPIC
+      public :: ZAXIS_TRAJECTORY
+      public :: ZAXIS_ALTITUDE
+      public :: ZAXIS_SIGMA
+      public :: ZAXIS_MEANSEA
+      public :: TAXIS_ABSOLUTE
+      public :: TAXIS_RELATIVE
+      public :: TIME_CONSTANT
+      public :: TIME_VARIABLE
+      public :: TUNIT_SECOND
+      public :: TUNIT_MINUTE
+      public :: TUNIT_HOUR
+      public :: TUNIT_DAY
+      public :: TUNIT_MONTH
+      public :: TUNIT_YEAR
+      public :: TUNIT_QUARTER
+      public :: TUNIT_3HOURS
+      public :: TUNIT_6HOURS
+      public :: TUNIT_12HOURS
+      public :: TSTEP_INSTANT
+      public :: TSTEP_AVG
+      public :: TSTEP_ACCUM
+      public :: TSTEP_MAX
+      public :: TSTEP_MIN
+      public :: TSTEP_DIFF
+      public :: TSTEP_RANGE
+      public :: TSTEP_INSTANT2
+      public :: TSTEP_INSTANT3
+      public :: CALENDAR_STANDARD
+      public :: CALENDAR_PROLEPTIC
+      public :: CALENDAR_360DAYS
+      public :: CALENDAR_365DAYS
+      public :: CALENDAR_366DAYS
+      public :: CALENDAR_NONE
+
+contains
+
+    subroutine ctrim(str)
+    use iso_c_binding
+    character(kind=c_char, len=*)  :: str
+    character                      :: c
+    integer                        :: i
+
+    do i=1,len(str)
+      c = str(i:i)
+      if (c == c_null_char) then
+        str(i:len(str)) = ' '
+      end if
+    end do
+
+    end subroutine ctrim
+  
+
+end module mo_cdi
+  
diff --git a/libcdi/src/model.c b/libcdi/src/model.c
new file mode 100644
index 0000000..fbf3137
--- /dev/null
+++ b/libcdi/src/model.c
@@ -0,0 +1,355 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include "dmemory.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "pio_util.h"
+#include "resource_handle.h"
+#include "pio_rpc.h"
+#include "namespace.h"
+
+#undef  UNDEFID
+#define UNDEFID -1
+
+int ECHAM4 = UNDEFID;
+int ECHAM5 = UNDEFID;
+int COSMO  = UNDEFID;
+
+typedef struct
+{
+  int      self;
+  int      used;
+  int      instID;
+  int      modelgribID;
+  char    *name;
+}
+model_t;
+
+
+static int  MODEL_Debug = 0;   /* If set to 1, debugging */
+static int * modelInitializedNsp;
+
+static void modelInit(void);
+
+
+static int    modelCompareP ( void * modelptr1, void * modelptr2 );
+static void   modelDestroyP ( void * modelptr );
+static void   modelPrintP   ( void * modelptr, FILE * fp );
+#ifdef USE_MPI
+static int    modelGetSizeP ( void * modelptr, MPI_Comm comm );
+static void   modelPackP    ( void * modelptr, void * buff, int size, int *position, MPI_Comm comm);
+static int    modelTxCode   ( void );
+#endif
+
+resOps modelOps = { modelCompareP, modelDestroyP, modelPrintP
+#ifdef USE_MPI
+                    , modelGetSizeP, modelPackP, modelTxCode
+#endif
+};
+
+static
+void modelDefaultValue ( model_t *modelptr )
+{
+  modelptr->self        = UNDEFID;
+  modelptr->used        = 0;
+  modelptr->instID      = UNDEFID;
+  modelptr->modelgribID = UNDEFID;
+  modelptr->name        = NULL;
+}
+
+static
+model_t *modelNewEntry ( void )
+{
+  model_t *modelptr;
+
+  modelptr = (model_t *) xmalloc(sizeof(model_t));
+  modelDefaultValue ( modelptr );
+  modelptr->self = reshPut (( void * ) modelptr, &modelOps );
+  modelptr->used = 1;
+
+  return (modelptr);
+}
+
+
+int modelDef(int instID, int modelgribID, const char *name);
+
+static
+void modelDefaultEntries ( void )
+{
+  int instID, i;
+  cdiResH resH[10];
+
+  instID  = institutInq(  0,   0, "ECMWF", NULL);
+  /* (void)    modelDef(instID, 131, "ERA15"); */
+  /* (void)    modelDef(instID, 199, "ERA40"); */
+  instID  = institutInq(  0,   0, "MPIMET", NULL);
+
+  resH[0] = ECHAM5  = modelDef(instID,  64, "ECHAM5.4");
+  resH[1] = modelDef(instID,  63, "ECHAM5.3");
+  resH[2] = modelDef(instID,  62, "ECHAM5.2");
+  resH[3] = modelDef(instID,  61, "ECHAM5.1");
+
+  instID  = institutInq( 98, 255, "MPIMET", NULL);
+  resH[4] = modelDef(instID,  60, "ECHAM5.0");
+  resH[5] = ECHAM4  = modelDef(instID,  50, "ECHAM4");
+  resH[6] = modelDef(instID, 110, "MPIOM1");
+
+  instID  = institutInq(  0,   0, "DWD", NULL);
+  resH[7] = modelDef(instID, 149, "GME");
+
+  instID  = institutInq(  0,   0, "MCH", NULL);
+  //(void)  = modelDef(instID, 137, "COSMO");
+  resH[8] = COSMO   = modelDef(instID, 255, "COSMO");
+
+  instID  = institutInq(  0,   1, "NCEP", NULL);
+  resH[9] = modelDef(instID,  80, "T62L28MRF");
+  
+  if ( ! namespaceHasLocalFile ( namespaceGetActive ()))
+    for ( i = 0; i < 10 ; i++ )
+      reshSetStatus ( resH[i], &modelOps, SUSPENDED );  
+}
+
+static
+void modelFinalize ( void )
+{
+  free (   modelInitializedNsp );
+}
+
+static
+void modelInit(void)
+{
+  static int modelInitialized = 0;
+  int nsp, nspc;
+  char *env;
+
+  nspc = namespaceGetNumber ();
+  
+  if ( !modelInitialized )
+    {
+      modelInitialized = 1;
+      modelInitializedNsp = xcalloc ( 1, nspc * sizeof ( int ));
+      atexit ( modelFinalize );
+      env = getenv("MODEL_DEBUG");
+      if ( env ) MODEL_Debug = atoi(env);  
+    }
+
+  nsp = namespaceGetActive ();
+  
+  if ( modelInitializedNsp[nsp] ) return;
+  
+  modelInitializedNsp[nsp] = 1;
+  
+  modelDefaultEntries ();
+}
+
+int modelSize ( void )
+{
+  return reshCountType ( &modelOps );
+}
+
+
+int modelInq(int instID, int modelgribID, char *name)
+{
+  int modelID = UNDEFID;
+  size_t len;
+  int found;
+  int modelCount;
+  model_t *modelptr;
+  int i, * modelResHs;
+
+  modelInit ();
+
+  modelCount = modelSize();
+  modelResHs = xmalloc ( modelCount * sizeof ( int ));
+  reshGetResHListOfType ( modelCount, modelResHs, &modelOps );
+
+  for( i = 0; i < modelCount; i++ )
+    {
+      modelID = modelResHs[i];
+      modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
+
+      if ( modelptr->used )
+        {
+          if ( name )
+            {
+              found = 1;
+              if ( instID      != -1 && modelptr->instID      != instID )      found = 0;
+              if ( modelgribID !=  0 && modelptr->modelgribID != modelgribID ) found = 0;
+
+              if ( found )
+                {
+                  if ( modelptr->name )
+                    {
+                      len = strlen(modelptr->name);
+                      if ( memcmp(modelptr->name, name, len) == 0 ) break;
+                      len = strlen(name);
+                      if ( memcmp(modelptr->name, name, len) == 0 ) break;
+                    }
+                }
+            }
+          else
+            {
+              if ( modelptr->instID      == instID &&
+                   modelptr->modelgribID == modelgribID ) break;
+            }
+        }
+    }
+
+  if ( i == modelCount ) modelID = UNDEFID;
+
+  if ( modelResHs ) free ( modelResHs );
+
+  return (modelID);
+}
+
+
+int modelDef(int instID, int modelgribID, const char *name)
+{
+  model_t *modelptr;
+
+  modelInit ();
+
+  modelptr = modelNewEntry();
+
+  modelptr->instID      = instID;
+  modelptr->modelgribID = modelgribID;
+  if ( name ) modelptr->name = strdupx(name);
+
+  return modelptr->self;
+}
+
+
+int modelInqInstitut(int modelID)
+{
+  model_t *modelptr = NULL;
+
+  modelInit ();
+
+  if ( modelID != UNDEFID )
+    modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
+
+  return modelptr ? modelptr->instID : UNDEFID;
+}
+
+
+int modelInqGribID(int modelID)
+{
+  model_t *modelptr = NULL;
+
+  modelInit ();
+
+  if ( modelID != UNDEFID )
+    modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
+
+  return modelptr ? modelptr->modelgribID : UNDEFID;
+}
+
+
+char *modelInqNamePtr(int modelID)
+{
+  model_t *modelptr = NULL;
+
+  modelInit ();
+
+  if ( modelID != UNDEFID )
+    modelptr = ( model_t * ) reshGetVal ( modelID, &modelOps );
+
+  return modelptr ? modelptr->name : NULL;
+}
+
+
+int  modelCompareP ( void * modelptr1, void * modelptr2 )
+{
+  return 0;
+}
+
+
+void modelDestroyP ( void * modelptr )
+{
+}
+
+
+void modelPrintP   ( void * modelptr, FILE * fp )
+{
+  model_t * mp = ( model_t * ) modelptr;
+
+  if ( !mp ) return;
+
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "# modelID %d\n", mp->self);
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "self          = %d\n", mp->self );
+  fprintf ( fp, "used          = %d\n", mp->used );
+  fprintf ( fp, "instID        = %d\n", mp->instID );
+  fprintf ( fp, "modelgribID   = %d\n", mp->modelgribID );
+  fprintf ( fp, "name          = %s\n", mp->name ? mp->name : "NN" );
+}
+
+
+#ifdef USE_MPI
+
+static int
+modelTxCode ( void )
+{
+  return MODEL;
+}
+
+enum {
+  model_nints = 4,
+};
+
+
+static
+int modelGetSizeP ( void * modelptr, MPI_Comm comm )
+{
+  model_t *p = modelptr;
+  int txsize = 0, txinc;
+  xmpi(MPI_Pack_size(model_nints, MPI_INT, comm, &txsize));
+  xmpi(MPI_Pack_size(strlen(p->name) + 1, MPI_CHAR, comm, &txinc));
+  txsize += txinc;
+  return txsize;
+}
+
+
+static
+void modelPackP ( void * modelptr, void * buf, int size,
+                  int *position, MPI_Comm comm )
+{
+  model_t *p = modelptr;
+  int tempbuf[model_nints];
+  tempbuf[0] = p->self;
+  tempbuf[1] = p->instID;
+  tempbuf[2] = p->modelgribID;
+  tempbuf[3] = (int)strlen(p->name) + 1;
+  xmpi(MPI_Pack(tempbuf, model_nints, MPI_INT, buf, size, position, comm));
+  xmpi(MPI_Pack(p->name, tempbuf[3], MPI_CHAR, buf, size, position, comm));
+}
+
+int
+modelUnpack(void *buf, int size, int *position, int nspTarget,
+            MPI_Comm comm)
+{
+  int tempbuf[model_nints];
+  int modelID;
+  char *name;
+  xmpi(MPI_Unpack(buf, size, position, tempbuf, model_nints, MPI_INT, comm));
+  name = xmalloc(tempbuf[3]);
+  xmpi(MPI_Unpack(buf, size, position, name, tempbuf[3], MPI_CHAR, comm));
+  modelID = modelDef( namespaceAdaptKey ( tempbuf[1], nspTarget ), tempbuf[2], name);
+  // FIXME: this should work, once all types are transferred
+  //assert(modelID == tempbuf[0]);
+  return modelID;
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/model.h b/libcdi/src/model.h
new file mode 100644
index 0000000..8df7253
--- /dev/null
+++ b/libcdi/src/model.h
@@ -0,0 +1,19 @@
+#ifndef MODEL_H
+#define MODEL_H
+
+#ifdef USE_MPI
+int
+modelUnpack(void *buf, int size, int *position,
+            int, MPI_Comm comm);
+#endif
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/namespace.c b/libcdi/src/namespace.c
new file mode 100644
index 0000000..7d53462
--- /dev/null
+++ b/libcdi/src/namespace.c
@@ -0,0 +1,188 @@
+#include <limits.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include "cdi.h"
+#include "namespace.h"
+#include "pio_util.h"
+
+
+static int nNamespaces = 1;
+static int activeNamespace = 0;
+static int serialHLF = 1;
+static int * hasLocalFiles = &serialHLF;
+static int serialRS = STAGE_DEFINITION;
+static statusCode * resStatus = (statusCode *) &serialRS;
+
+enum {
+  intbits = sizeof(int) * CHAR_BIT,
+  nspbits = 4,
+  idxbits = intbits - nspbits,
+  nspmask = (( 1 << nspbits ) - 1) << idxbits,
+  idxmask = ( 1 << idxbits ) - 1,
+};
+
+enum {
+  NUM_NAMESPACES = 1 << nspbits,
+  NUM_IDX = 1 << idxbits,
+};
+
+
+void namespaceShowbits ( int n, char *name )
+{
+  int i;
+  unsigned mask;
+  char bitvalues[intbits + 1];
+
+  mask = 1;
+  for ( i = 0; i < intbits; i++ )
+    {
+      bitvalues[i] = ((unsigned)n & mask) ? '1':'0';
+      mask <<= 1;
+    }
+  bitvalues[intbits] = '\0';
+  fprintf (stdout, "%s: %s\n", name, bitvalues );
+}
+
+
+int namespaceIdxEncode ( namespaceTuple_t tin )
+{
+  xassert ( tin.nsp < NUM_NAMESPACES && tin.idx < NUM_IDX);
+  return ( tin.nsp << idxbits ) + tin.idx;
+}
+
+int namespaceIdxEncode2 ( int nsp, int idx )
+{
+  xassert(nsp < NUM_NAMESPACES && idx < NUM_IDX);
+  return ( nsp << idxbits ) + idx;
+}
+
+
+namespaceTuple_t namespaceResHDecode ( int resH )
+{
+  namespaceTuple_t tin;
+
+  tin.idx = resH & idxmask;
+  tin.nsp = (int)(((unsigned)( resH & nspmask )) >> idxbits);
+
+  return tin;
+}
+
+
+void namespaceInit ( int nspn, int * argHasLocalFile )
+{
+  /* FIXME: this should not be PIO-only */
+#ifdef USE_MPI
+  int nspID;
+
+  xassert(nspn <= NUM_NAMESPACES && nspn >= 1 );
+
+  nNamespaces = nspn;
+  if ( nspn >= 1 )
+    {
+      hasLocalFiles = xmalloc ( nspn * sizeof ( hasLocalFiles[0] ));
+      for ( nspID = 0; nspID < nspn; nspID++ )
+	hasLocalFiles[nspID] = argHasLocalFile[nspID];
+      resStatus = xmalloc ( nspn * sizeof ( resStatus[0] ));
+    }
+#endif
+}
+
+
+void namespaceCleanup ( void )
+{
+  if ( nNamespaces > 1 )
+    {
+      free ( hasLocalFiles );
+      hasLocalFiles = NULL;
+      free ( resStatus );
+    }
+}
+
+
+int namespaceGetNumber ()
+{
+  return nNamespaces;
+}
+
+
+void pioNamespaceSetActive ( int nId )
+{
+  /* FIXME: this should not be PIO-only */
+#ifdef USE_MPI
+  xassert ( nId < nNamespaces && nId >= 0 );
+
+  activeNamespace = nId;
+#endif
+}
+
+
+int namespaceGetActive ()
+{
+  return activeNamespace;
+}
+
+
+int namespaceHasLocalFile ( int nId )
+{
+  xassert ( nId < nNamespaces && nId >= 0 );
+
+  return hasLocalFiles ? hasLocalFiles[nId] : 0;
+}
+
+
+int namespaceAdaptKey ( int key, int nspTarget )
+{
+  namespaceTuple_t tin;
+  int nsp;
+
+  if ( key == CDI_UNDEFID ) return CDI_UNDEFID;
+
+  tin.idx = key & idxmask;
+  tin.nsp = (int)(((unsigned)( key & nspmask )) >> idxbits);
+
+  xassert ( tin.nsp == nspTarget );
+
+  nsp = namespaceGetActive ();
+
+  return namespaceIdxEncode2 ( nsp, tin.idx );
+}
+
+
+int namespaceAdaptKey2 ( int key )
+{
+  namespaceTuple_t tin;
+  int nsp;
+
+  if ( key == CDI_UNDEFID ) return CDI_UNDEFID;
+
+  tin.idx = key & idxmask;
+  tin.nsp = (int)(((unsigned)( key & nspmask )) >> idxbits);
+
+  nsp = namespaceGetActive ();
+
+  return namespaceIdxEncode2 ( nsp, tin.idx );
+}
+
+
+void namespaceDefResStatus ( statusCode argResStatus )
+{
+  int nsp = namespaceGetActive ();
+  resStatus[nsp] = argResStatus;
+}
+
+
+statusCode namespaceInqResStatus ( void )
+{
+  int nsp = namespaceGetActive ();
+  return resStatus[nsp];
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/namespace.h b/libcdi/src/namespace.h
new file mode 100644
index 0000000..e5de439
--- /dev/null
+++ b/libcdi/src/namespace.h
@@ -0,0 +1,39 @@
+#ifndef NAMESPACE_H
+#define NAMESPACE_H
+
+typedef enum {
+  STAGE_DEFINITION = 0,
+  STAGE_TIMELOOP   = 1,
+  STAGE_CLEANUP    = 2
+} statusCode;
+
+typedef struct {
+  int idx;
+  int nsp;
+  statusCode resStatus;
+} namespaceTuple_t;
+
+void             namespaceCleanup      ( void );
+void             namespaceInit         ( int, int * );
+void             namespaceShowbits     ( int, char * );
+int              namespaceGetNumber    ( void );
+int              namespaceGetActive    ( void );
+int              namespaceIdxEncode    ( namespaceTuple_t );
+int              namespaceIdxEncode2   ( int, int );
+namespaceTuple_t namespaceResHDecode   ( int );
+int              namespaceHasLocalFile ( int );
+int              namespaceAdaptKey     ( int, int );
+int              namespaceAdaptKey2    ( int );
+void             namespaceDefResStatus ( statusCode );
+statusCode       namespaceInqResStatus ( void );
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio.c b/libcdi/src/pio.c
new file mode 100644
index 0000000..1dd918f
--- /dev/null
+++ b/libcdi/src/pio.c
@@ -0,0 +1,206 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+
+#ifdef USE_MPI
+
+#include "pio.h"
+#include "cdi.h"
+#include "pio_comm.h"
+#include "pio_impl.h"
+#include "pio_util.h"
+
+char * command2charP[6] = {"IO_Open_file", "IO_Close_file",
+                           "IO_Get_fp","IO_Set_fp",
+                           "IO_Send_buffer", "IO_Finalize"};
+
+long initial_buffersize = 16 * 1024 * 1024;
+/*  4 KB <= x < 256 MB */
+/* 16 * 1024 * 1024; */
+/* 16 * 1024; */
+/* 4 * 1024; */
+
+enum {
+  tagKey = 100,
+};
+
+double accumProbe   = 0.0;
+double accumRecv    = 0.0;
+double accumSend    = 0.0;
+double accumSuspend = 0.0;
+double accumWait    = 0.0;
+double accumWrite   = 0.0;
+
+char *token = "%";
+
+/***************************************************************/
+
+int encodeFileOpTag(int ID, int sc)
+{
+  return ID * tagKey + sc;
+}
+
+/***************************************************************/
+
+struct fileOpTag decodeFileOpTag(int tag)
+{
+  struct fileOpTag rtag;
+
+  rtag.id = tag / tagKey;
+  rtag.command = tag % tagKey;
+
+  return rtag;
+}
+
+/***************************************************************/
+
+size_t pioFileWrite ( int fileID, int tsID, const void *buffer, size_t len )
+{
+  size_t iret = CDI_UNDEFID;
+
+  switch ( commInqIOMode ())
+    {
+    case PIO_MPI:
+      iret = fwMPINONB ( fileID, tsID, buffer, len );
+      break;
+#ifndef _SX
+    case PIO_ASYNCH:
+#endif
+    case PIO_WRITER:
+      iret = pioSendWrite(fileID, tsID, buffer, len);
+      break;
+    case PIO_FPGUARD:
+      iret = fwPOSIXFPGUARDSENDRECV ( fileID, tsID, buffer, len );
+      break;
+    }
+
+  return iret;
+}
+
+/***************************************************************/
+
+int pioFileClose ( int id )
+{
+  int iret = CDI_UNDEFID;
+  switch ( commInqIOMode ())
+    {
+    case PIO_MPI:
+      iret = fcMPINONB ( id );
+      break;
+#ifndef _SX
+    case PIO_ASYNCH:
+#endif
+    case PIO_WRITER:
+      iret = pioSendClose(id);
+      break;
+    case PIO_FPGUARD:
+      iret = fcPOSIXFPGUARDSENDRECV ( id );
+      break;
+    }
+
+  return iret;
+}
+
+/***************************************************************/
+
+int pioFileOpenW ( const char *filename )
+{
+  int iret = CDI_UNDEFID;
+
+  switch ( commInqIOMode ())
+    {
+    case PIO_MPI:
+      iret = fowMPINONB ( filename );
+      break;
+#ifndef _SX
+    case PIO_ASYNCH:
+#endif
+    case PIO_WRITER:
+      iret = pioSendOpen(filename);
+      break;
+    case PIO_FPGUARD:
+      iret = fowPOSIXFPGUARDSENDRECV ( filename );
+      break;
+    }
+
+  return iret;
+}
+
+/***************************************************************/
+
+void backendInit ( void )
+{
+  int IOMode = commInqIOMode ();
+
+  commDefCommNode ();
+
+  xassert ( IOMode != PIO_NONE  || commInqSizeNode () == 1 );
+
+  switch ( IOMode )
+    {
+    case PIO_NONE:
+      commDefCommColl ( 1 );
+      commSendNodeInfo ();
+      commRecvNodeMap ();
+      commDefCommsIO ();
+      break;
+    case PIO_MPI:
+      initMPINONB ();
+      break;
+#ifndef _SX
+    case PIO_ASYNCH:
+#endif
+    case PIO_WRITER:
+      pioSendInitialize();
+      break;
+    case PIO_FPGUARD:
+      initPOSIXFPGUARDSENDRECV ();
+      break;
+    }
+}
+
+/***************************************************************/
+
+void backendCleanup ( void )
+{
+  int IOMode = commInqIOMode ();
+  switch ( IOMode )
+    {
+    case PIO_NONE:
+      break;
+    case PIO_MPI:
+      finalizeMPINONB ();
+      break;
+#ifndef _SX
+    case PIO_ASYNCH:
+#endif
+    case PIO_WRITER:
+      pioSendFinalize();
+      break;
+    case PIO_FPGUARD:
+      finalizePOSIXFPGUARDSENDRECV ();
+      break;
+    default:
+      xdebug("%s", " BACKENDCLEANUP FUNCTION NOT IMPLEMENTED YET.");
+    }
+}
+
+/***************************************************************/
+
+void backendFinalize ( void )
+{
+  commDestroy ();
+  MPI_Finalize ();
+  exit ( EXIT_SUCCESS );
+}
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio.h b/libcdi/src/pio.h
new file mode 100644
index 0000000..c6f6716
--- /dev/null
+++ b/libcdi/src/pio.h
@@ -0,0 +1,30 @@
+#ifndef _PIO_H
+#define _PIO_H
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include <stdlib.h>
+#include <mpi.h>
+
+void   backendCleanup  ( void );
+void   backendInit     ( void );
+void   backendFinalize ( void );
+int    pioFileOpenW    ( const char* );
+int    pioFileClose    ( int );
+size_t pioFileWrite    ( int, int, const void*, size_t );
+
+#endif
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_c_temp.h b/libcdi/src/pio_c_temp.h
new file mode 100644
index 0000000..d621364
--- /dev/null
+++ b/libcdi/src/pio_c_temp.h
@@ -0,0 +1,25 @@
+#ifndef PIO_C_TEMP
+#define PIO_C_TEMP
+
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include "mpi.h"
+#else
+typedef int MPI_Comm; 
+#endif
+
+MPI_Comm pioInit_c ( MPI_Comm, int, int, int, int * );
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_comm.c b/libcdi/src/pio_comm.c
new file mode 100644
index 0000000..a5ce345
--- /dev/null
+++ b/libcdi/src/pio_comm.c
@@ -0,0 +1,836 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "pio_comm.h"
+#include "cdi.h"
+#include "pio_util.h"
+
+#ifdef USE_MPI
+
+typedef struct {
+  int IOMode;
+  int maxIOMode;
+  int minIOModeWithSpecialProcs;
+  int nProcsIO;
+  int nProcsModel;
+  int isProcIO;
+
+  MPI_Comm commGlob;
+  int sizeGlob;
+  int rankGlob;
+  int root;
+
+  MPI_Comm commPio;
+  int sizePio;
+  int rankPio;
+
+  MPI_Comm commNode;
+  int sizeNode;
+  int rankNode;
+  char hostname [ MPI_MAX_PROCESSOR_NAME + 1 ];
+  nodeInfo_t nodeInfo;
+  int specialRankNode;
+
+  MPI_Comm commColl;
+  int sizeColl;
+  int rankColl;
+
+  MPI_Comm commCalc;
+
+  MPI_Comm * commsIO;
+  int nProcsColl;
+  int * procsCollMap;
+  int * nodeSizes;
+  int * nodeMap;
+} pioInfo_t;
+
+
+static pioInfo_t * info = NULL;
+
+
+static
+void pioInfoInit ( pioInfo_t * p )
+{
+  p->IOMode               = CDI_UNDEFID;
+  p->maxIOMode            = CDI_UNDEFID;
+  p->minIOModeWithSpecialProcs = CDI_UNDEFID;
+  p->nProcsIO             = CDI_UNDEFID;
+  p->nProcsModel          = CDI_UNDEFID;
+  p->isProcIO             = CDI_UNDEFID;
+                          
+  p->commGlob             = MPI_COMM_NULL;
+  p->sizeGlob             = CDI_UNDEFID;
+  p->rankGlob             = CDI_UNDEFID;
+  p->root                 = CDI_UNDEFID;
+                          
+  p->commPio              = MPI_COMM_NULL;
+  p->sizePio              = CDI_UNDEFID;
+  p->rankPio              = CDI_UNDEFID;
+                          
+  p->commNode             = MPI_COMM_NULL;
+  p->sizeNode             = CDI_UNDEFID;
+  p->rankNode             = CDI_UNDEFID;
+  p->hostname[0]          = 0;
+  p->specialRankNode      = CDI_UNDEFID;
+                          
+  p->commColl             = MPI_COMM_NULL;
+  p->sizeColl             = CDI_UNDEFID;
+  p->rankColl             = CDI_UNDEFID;
+                          
+  p->commCalc             = MPI_COMM_NULL;
+                          
+  p->commsIO              = NULL;
+  p->nodeInfo.hostID      = CDI_UNDEFID;
+  p->nodeInfo.isProcColl  = CDI_UNDEFID;
+  p->nodeInfo.nNodes      = CDI_UNDEFID;
+  p->nProcsColl           = CDI_UNDEFID;
+  p->procsCollMap         = NULL;
+  p->nodeSizes            = NULL;
+  p->nodeMap              = NULL;
+}
+
+
+void commInit ( void )
+{
+  xassert ( info == 0 );
+  info = xmalloc ( sizeof ( pioInfo_t ));
+  pioInfoInit ( info );
+}
+
+
+void commDestroy ( void )
+{
+  int collID;
+
+  xassert ( info != NULL );
+
+  if ( info->nodeMap   != NULL ) free ( info->nodeMap );
+  if ( info->nodeSizes != NULL ) free ( info->nodeSizes );
+
+  if ( info->commsIO != NULL ) 
+    {
+      for ( collID = 0; collID < info->nProcsColl; collID++ )
+	if ( info->commsIO[collID] != MPI_COMM_NULL )
+	  xmpi ( MPI_Comm_free ( &info->commsIO[collID] ));
+      free ( info->commsIO ); 
+      info->commsIO = NULL;
+    }
+
+  if ( info->commColl != MPI_COMM_NULL )
+    {
+      xmpi ( MPI_Comm_free ( &info->commColl )); 
+      info->commColl = MPI_COMM_NULL;
+    }
+  
+  if ( info->commNode != MPI_COMM_NULL )
+    {
+      xmpi ( MPI_Comm_free ( &info->commNode )); 
+      info->commNode = MPI_COMM_NULL;
+    }
+  
+  if ( info->commPio != MPI_COMM_NULL )
+    {
+      xmpi ( MPI_Comm_free ( &info->commPio )); 
+      info->commPio = MPI_COMM_NULL;
+    }
+  
+  free ( info );
+  info = NULL;
+}
+
+
+void commDefCommGlob ( MPI_Comm c )
+{
+  xassert ( info != NULL &&
+	   c != MPI_COMM_NULL );
+
+  info->commGlob = c;
+  xmpi ( MPI_Comm_size ( c, &info->sizeGlob ));
+  xmpi ( MPI_Comm_rank ( c, &info->rankGlob ));
+  info->root = 0;
+}
+ 
+
+MPI_Comm commInqCommGlob ( void )
+{
+  xassert ( info != NULL &&
+           info->commGlob != MPI_COMM_NULL );
+  return info->commGlob;
+}
+
+
+int commInqSizeGlob ( void )
+{
+  xassert ( info != NULL  &&
+           info->sizeGlob != CDI_UNDEFID );
+  return info->sizeGlob;
+}
+
+
+int commInqRankGlob ( void )
+{
+  xassert ( info != NULL &&
+           info->rankGlob != CDI_UNDEFID );
+  return info->rankGlob;
+}
+
+
+int commInqRootGlob ( void )
+{
+  xassert ( info != NULL &&
+           info->root != CDI_UNDEFID );
+  return info->root;
+}
+
+
+void commDefNProcsIO ( int n )
+{
+  xassert ( info != NULL &&
+	   n >= 0 &&
+	   n < MAXNPROCSIO &&
+           info->commGlob != MPI_COMM_NULL );
+  info->nProcsIO = n;
+  info->nProcsModel = info->sizeGlob - info->nProcsIO;
+}
+
+
+int commInqNProcsIO ( void )
+{
+  xassert ( info != NULL &&
+           info->nProcsIO != CDI_UNDEFID );
+  return info->nProcsIO;
+}
+
+
+int      commInqIsProcIO     ( void )
+{
+  xassert ( info != NULL &&
+           info->isProcIO != CDI_UNDEFID );
+  return info->isProcIO;
+}
+
+
+int commInqNProcsModel ( void )
+{
+  xassert ( info != NULL &&
+           info->nProcsModel != CDI_UNDEFID );
+  return info->nProcsModel;
+}
+
+
+void     commDefIOMode  ( int IOMode, int maxIOMode, int minIOModeWithSpecialProcs )
+{
+  xassert ( info != NULL &&
+	   IOMode >= 0 &&
+           maxIOMode >= IOMode &&
+           minIOModeWithSpecialProcs > 0 &&
+           minIOModeWithSpecialProcs <= maxIOMode );
+  info->IOMode = IOMode;
+  info->maxIOMode = maxIOMode;
+  info->minIOModeWithSpecialProcs = minIOModeWithSpecialProcs;
+}
+
+
+int      commInqIOMode  ( void )
+{
+  if (info != NULL)
+    {
+      xassert ( info->IOMode != CDI_UNDEFID );
+      return info->IOMode;
+    }
+  else
+    return PIO_NONE;
+}
+
+
+void     commDefCommPio  ( void )
+{
+  int nProcsModel;
+
+  xassert ( info != NULL &&
+           info->commGlob != MPI_COMM_NULL &&
+           info->IOMode  != CDI_UNDEFID &&
+           info->nProcsIO != CDI_UNDEFID );
+
+  nProcsModel = info->sizeGlob - info->nProcsIO;
+
+  info->isProcIO = info->rankGlob >= nProcsModel ? 1 : 0;
+
+  xmpi ( MPI_Comm_split ( info->commGlob, info->isProcIO, 0, 
+                          &info->commPio ));
+  xmpi ( MPI_Comm_size ( info->commPio, &info->sizePio ));
+  xmpi ( MPI_Comm_rank ( info->commPio, &info->rankPio )); 
+}
+
+
+MPI_Comm commInqCommPio  ( void )
+{
+  xassert ( info != NULL &&
+           info->commPio != MPI_COMM_NULL &&
+           info->isProcIO == 1 );
+  return info->commPio;
+}
+
+
+MPI_Comm commInqCommModel ( void )
+{
+  xassert ( info != NULL &&
+           info->commPio != MPI_COMM_NULL &&
+           info->isProcIO == 0 );
+  return info->commPio;
+}
+
+
+int      commInqRankPio       ( void )
+{ 
+  xassert ( info != NULL &&
+           info->rankPio != CDI_UNDEFID &&
+           info->isProcIO == 1 );
+  return info->rankPio;
+}
+
+
+int      commInqRankModel       ( void )
+{ 
+  xassert ( info != NULL &&
+           info->rankPio != CDI_UNDEFID &&
+           info->isProcIO == 0 );
+  return info->rankPio;
+}
+
+
+void     commDefCommColl  ( int isProcColl )
+{
+  xassert ( info != NULL &&
+           info->commNode != MPI_COMM_NULL &&
+           info->commColl == MPI_COMM_NULL );
+
+  info->nodeInfo.isProcColl = isProcColl;  
+  xmpi ( MPI_Comm_split ( info->commNode, info->nodeInfo.isProcColl, 0, 
+                          &info->commColl ));
+  xmpi ( MPI_Comm_size ( info->commColl, &info->sizeColl ));
+  xmpi ( MPI_Comm_rank ( info->commColl, &info->rankColl )); 
+}
+
+
+MPI_Comm commInqCommColl    ( void )
+{
+  xassert ( info != NULL &&
+           info->commColl != MPI_COMM_NULL );
+  return info->commColl;
+}
+
+
+int      commInqSizeColl    ( void )
+{
+  xassert ( info != NULL &&
+           info->sizeColl != CDI_UNDEFID );
+  return info->sizeColl; 
+}
+
+
+int      commInqRankColl    ( void )
+{
+  xassert ( info != NULL &&
+           info->rankColl != CDI_UNDEFID );
+  return info->rankColl; 
+}
+
+
+static int cmpr ( const void *a, const void *b )
+{
+  return strcmp ( *( char ** ) a, *( char ** ) b);
+}
+
+
+void commDefCommNode ( void )
+{
+  int size, len, i, j, test;
+  char * myHost, ** allHosts, * allHosts0, * curr;
+
+  xassert ( info != NULL &&
+           info->commPio != MPI_COMM_NULL );
+
+  size = info->sizePio;
+
+  myHost = xmalloc ( MPI_MAX_PROCESSOR_NAME * sizeof ( myHost[0] ));
+  xmpi ( MPI_Get_processor_name ( myHost, &len ));
+  xassert ( myHost[0] != '\0' );
+  strncpy ( info->hostname, myHost, len );
+  info->hostname[len] = '\0';
+
+  allHosts    = xmalloc ( size * sizeof ( allHosts[0] ));
+  allHosts[0] = xmalloc ( size * MPI_MAX_PROCESSOR_NAME *
+                          sizeof ( allHosts[0][0] ));
+  allHosts0 = allHosts[0];
+  for ( i = 1; i < size; i++ )
+    allHosts[i] = allHosts[0] + i * MPI_MAX_PROCESSOR_NAME;
+
+  xmpi ( MPI_Allgather ( myHost, MPI_MAX_PROCESSOR_NAME, MPI_CHAR,
+                         & ( allHosts[0][0] ), MPI_MAX_PROCESSOR_NAME,
+                         MPI_CHAR, info->commPio ));
+
+  qsort ( allHosts, size, sizeof ( char * ), cmpr );
+
+  i = 0;
+  j = 0;
+
+  while ( i < size )
+    {
+      curr = allHosts[i];
+      j++;
+      if (( test = strcmp ( myHost, curr )) == 0 ) info->nodeInfo.hostID = j;
+
+      while ( ++i < size )
+        if (( test = strcmp ( allHosts[i], curr )) != 0)
+          break;
+    }
+
+  info->nodeInfo.nNodes = j;
+
+  xassert ( info->nodeInfo.hostID != CDI_UNDEFID );
+
+  xmpi ( MPI_Comm_split ( info->commPio, info->nodeInfo.hostID, 0, 
+                          &info->commNode ));
+  xmpi ( MPI_Comm_size ( info->commNode, &info->sizeNode ));
+  xmpi ( MPI_Comm_rank ( info->commNode, &info->rankNode ));
+  if ( info->IOMode >= info->minIOModeWithSpecialProcs )
+    info->specialRankNode = info->sizeNode - 1;
+
+  free ( allHosts0 );
+  free ( allHosts );
+  free ( myHost );
+
+  return;
+}
+
+
+MPI_Comm commInqCommNode    ( void )
+{
+  xassert ( info != NULL &&
+           info->commNode != MPI_COMM_NULL );
+  return info->commNode;
+} 
+
+
+int commInqSizeNode ( void )
+{
+  xassert ( info != NULL &&
+           info->sizeNode != CDI_UNDEFID );
+  return info->sizeNode;
+}
+
+
+int commInqRankNode ( void )
+{
+  xassert ( info != NULL &&
+           info->rankNode != CDI_UNDEFID );
+  return info->rankNode;
+}
+
+
+int commInqSpecialRankNode ( void )
+{
+  xassert ( info != NULL );
+  return info->specialRankNode;
+}
+
+
+void commSendNodeInfo ( void )
+{
+  xassert ( info != NULL &&
+           info->root                != CDI_UNDEFID &&
+           info->nodeInfo.hostID     != CDI_UNDEFID &&
+           info->nodeInfo.isProcColl != CDI_UNDEFID &&
+           info->nodeInfo.nNodes     != CDI_UNDEFID &&
+           info->commGlob            != MPI_COMM_NULL );
+  
+  xmpi ( MPI_Send ( &info->nodeInfo, sizeNodeInfo, MPI_INTEGER, 
+                    info->root, NODEINFO, info->commGlob ));
+}
+
+
+void     commRecvNodeMap    ( void )
+{
+  MPI_Status status;
+  int source; 
+
+  xassert ( info != NULL &&
+           info->commGlob    != MPI_COMM_NULL &&
+           info->rankGlob    != CDI_UNDEFID &&
+           info->nProcsModel != CDI_UNDEFID &&
+           info->nodeMap     == NULL );
+
+  source = info->root;
+
+  xmpi ( MPI_Probe ( source, NODEMAP, info->commGlob, &status ));
+  xmpi ( MPI_Get_count ( &status, MPI_INTEGER, &info->nProcsColl ));
+
+  xdebug ( "info->nProcsColl=%d", info->nProcsColl );
+
+  info->nodeMap = xmalloc ( info->nProcsColl * 
+                                sizeof ( info->nodeMap[0] )); 
+
+  xmpi ( MPI_Recv ( info->nodeMap, info->nProcsColl, MPI_INTEGER, 
+                    source, NODEMAP, info->commGlob, &status ));
+}
+
+
+void     commDefNNodes      ( int nNodes )
+{
+  xassert ( info != NULL );
+  info->nodeInfo.nNodes = nNodes;
+}
+
+
+int      commInqNNodes      ( void )
+{
+  xassert ( info != NULL &&
+           info->nodeInfo.nNodes != CDI_UNDEFID );
+  return info->nodeInfo.nNodes;
+}
+
+
+void     commEvalPhysNodes  ( void )
+{
+  nodeInfo_t * nodeInfo;
+  MPI_Status status;
+  int i, IOID, collID, size, nNodes = CDI_UNDEFID;
+  int ** p1, ** p2,  idx;
+
+  xassert ( info != NULL &&
+           info->root        != CDI_UNDEFID &&
+           info->nProcsIO    != CDI_UNDEFID &&
+           info->nProcsModel != CDI_UNDEFID &&
+           info->sizeGlob    != CDI_UNDEFID &&
+           info->rankGlob    != CDI_UNDEFID &&
+           info->commGlob    != MPI_COMM_NULL );
+
+  size = info->nProcsIO * sizeNodeInfo;
+
+  nodeInfo = xmalloc ( size * sizeof ( int ));
+
+  if ( info->rankGlob == info->root )
+    {
+      xassert ( info->rankPio == info->root );
+ 
+      for ( i = info->nProcsModel; i < info->sizeGlob; i++ )
+        {
+          IOID = i - info->nProcsModel;
+          xmpi ( MPI_Recv ( nodeInfo + IOID, sizeNodeInfo, MPI_INTEGER, i, 
+                            NODEINFO, info->commGlob, &status ));
+        }
+    }
+
+  xmpi ( MPI_Bcast ( nodeInfo, size, MPI_INTEGER, info->root, 
+                     info->commPio ));
+
+  // consistency check, count collectors
+  for ( IOID = 0; IOID < info->nProcsIO; IOID++ )
+    {
+      if ( IOID == 0 )
+        {
+          xassert ( nodeInfo[IOID].nNodes > 0 &&
+                   nodeInfo[IOID].nNodes <= info->nProcsIO );
+          nNodes = nodeInfo[IOID].nNodes;
+        }
+      else xassert ( nodeInfo[IOID].nNodes == nNodes );         
+      xassert ( nodeInfo[IOID].hostID > 0 &&
+               nodeInfo[IOID].hostID <= nNodes );
+      if ( nodeInfo[IOID].isProcColl ) 
+        {
+          if ( info->nProcsColl == CDI_UNDEFID ) info->nProcsColl = 0;
+          info->nProcsColl++;
+        }
+    }
+
+  xdebug ( "info->nProcsColl=%d", info->nProcsColl );
+
+  xassert ( info->nProcsColl <= info->nProcsModel );
+
+  info->procsCollMap = xmalloc ( info->nProcsColl * 
+                                 sizeof ( info->procsCollMap[0] )); 
+
+  // define nodeSizes
+  info->nodeInfo.nNodes = nNodes; 
+  info->nodeSizes = xmalloc ( info->nodeInfo.nNodes * 
+                                  sizeof ( info->nodeSizes[0] ));
+  collID = 0;
+  for ( IOID = 0; IOID < info->nProcsIO; IOID++ )
+    if ( nodeInfo[IOID].isProcColl )
+      {
+        info->nodeSizes[nodeInfo[IOID].hostID - 1]++;
+        info->procsCollMap[collID++] = IOID + info->nProcsModel;
+      }
+
+  // define nodeMap
+  info->nodeMap   = xmalloc ( info->nProcsColl * 
+                                  sizeof ( info->nodeMap[0] ));
+  // helpers
+  p1 = xmalloc ( info->nodeInfo.nNodes * sizeof ( p1[0] ));
+  p2 = xmalloc ( info->nodeInfo.nNodes * sizeof ( p2[0] ));
+  idx = 0;
+  for ( i = 0; i < info->nodeInfo.nNodes; i++ )
+    {
+      xassert ( idx >= 0 && idx < info->nProcsColl );
+      p1[i] = &info->nodeMap[idx];
+      p2[i] = p1[i] + info->nodeSizes[i]; 
+      idx += info->nodeSizes[i];
+    }
+  xassert ( idx == info->nProcsColl );
+
+  // rankGlob in nodeMap
+  for ( IOID = 0; IOID < info->nProcsIO; IOID++ )
+    {
+      if ( nodeInfo[IOID].isProcColl )
+        {
+          xassert ( p1[nodeInfo[IOID].hostID - 1] <  
+                   p2[nodeInfo[IOID].hostID - 1] );
+          * p1[nodeInfo[IOID].hostID - 1]++ = IOID + info->nProcsModel;
+        }
+    }
+
+  if ( info->rankGlob == info->root )
+    for ( IOID = info->nProcsModel; IOID < info->sizeGlob; IOID++ )
+      xmpi ( MPI_Send ( info->nodeMap, info->nProcsColl, MPI_INTEGER, 
+                        IOID, NODEMAP, info->commGlob ));
+  free ( p2 );
+  free ( p1 );
+  free ( nodeInfo );
+}
+
+
+int      commCollID2RankGlob      ( int collID ) 
+{
+  xassert ( info != NULL &&
+           info->nProcsColl != CDI_UNDEFID &&
+           collID >= 0 &&
+           collID < info->nProcsColl &&
+           info->nodeMap != NULL );
+  return info->nodeMap[collID];
+}
+
+
+int      commRankGlob2CollID      ( int rankGlob)
+{
+  int out = CDI_UNDEFID, collID;
+
+  xassert ( info != NULL &&
+           info->nProcsColl != CDI_UNDEFID &&
+           info->nProcsModel != CDI_UNDEFID &&
+           info->sizeGlob != CDI_UNDEFID &&
+           rankGlob >= info->nProcsModel &&
+           rankGlob <= info->sizeGlob );
+
+  for ( collID = 0; collID < info->nProcsColl; collID++ )
+    if ( info->nodeMap[collID] == rankGlob ) out = collID;
+
+  return out;
+} 
+
+
+int *    commInqNodeSizes   ( void )
+{
+  xassert ( info != NULL &&
+           info->nodeSizes != NULL );
+  return info->nodeSizes;
+}
+
+
+// collective call
+void     commDefCommsIO     ( void )
+{
+  MPI_Group groupGlob, currGroupIO;
+  int collID, * ranks, i, currIORank;
+  char name[MAXCOMMIONAME];
+
+  xassert ( info != NULL &&
+           info->nProcsColl != CDI_UNDEFID &&
+           info->commsIO == NULL &&
+           info->nProcsModel != CDI_UNDEFID &&
+           info->commGlob != MPI_COMM_NULL );
+
+  info->commsIO = xmalloc ( info->nProcsColl * 
+                                sizeof ( info->commsIO[0] ));
+  for ( collID = 0; collID < info->nProcsColl; collID++ )
+    info->commsIO[collID] = MPI_COMM_NULL;
+
+  strncpy ( name, "COMMSIO_", 8 ); 
+  name[MAXCOMMIONAME - 1] = '\0';
+  
+  ranks = xmalloc (( info->nProcsModel + 1 ) * sizeof ( ranks[0] ));
+  for ( i = 0; i < info->nProcsModel; i++ )
+    * ( ranks + i ) = i;
+  
+  xmpi ( MPI_Comm_group ( info->commGlob, &groupGlob )); 
+
+  for ( collID = 0; collID < info->nProcsColl; collID++ )
+    {
+      currIORank = info->nodeMap[collID];
+      * ( ranks + info->nProcsModel ) = currIORank;
+      xmpi ( MPI_Group_incl ( groupGlob, info->nProcsModel + 1, 
+                              ranks, &currGroupIO ));
+      xmpi ( MPI_Comm_create ( info->commGlob, currGroupIO,  
+                               info->commsIO + collID ));
+      if ( info->rankGlob == currIORank )
+	info->commCalc = info->commsIO[collID];
+
+      // set names for debugging
+      if ( info->rankGlob < info->nProcsModel || 
+           info->rankGlob == currIORank )
+	{
+	  sprintf ( &name[8], "%d", collID ); 
+	  xmpi ( MPI_Comm_set_name ( info->commsIO[collID], name ));
+	}
+    }
+
+  if ( ddebug >= 2 )
+    {
+      if ( info->rankGlob < info->nProcsModel )
+	for ( collID = 0; collID < info->nProcsColl; collID++ ) 
+          xdebugComm ( info->commsIO + collID );
+      else if ( info->nodeInfo.isProcColl )
+	xdebugComm ( &info->commCalc );
+    }
+
+  xmpi ( MPI_Group_free ( &currGroupIO ));
+  xmpi ( MPI_Group_free ( &groupGlob ));
+  free ( ranks );
+
+  commPrint ( stdout );
+}
+
+
+MPI_Comm commInqCommsIO     ( int collID )
+{
+  xassert ( collID >= 0 &&
+           info != NULL &&
+           info->nProcsColl != CDI_UNDEFID &&
+           collID < info->nProcsColl &&
+           info->commsIO != NULL &&
+           info->commsIO[collID] != MPI_COMM_NULL );
+
+  return info->commsIO[collID];
+}
+
+
+MPI_Comm commInqCommCalc    ( void )
+{
+  xassert ( info != NULL &&
+           info->commCalc != MPI_COMM_NULL );
+  return info->commCalc;
+}
+
+
+int      commInqNProcsColl  ( void )
+{
+  xassert ( info != NULL &&
+           info->nProcsColl != CDI_UNDEFID );
+  return info->nProcsColl;
+}
+
+
+void commPrint ( FILE * fp )
+{
+  int i;
+
+  if ( ddebug == 0 ) return;
+
+  xassert ( info != NULL );
+
+  fprintf ( fp, "\n" );
+  fprintf ( fp, "######## pioinfo PE%d ###########\n", info->rankGlob );
+  fprintf ( fp, "#\n" );
+  fprintf ( fp, "# IOMode      = %d\n", info->IOMode );
+  fprintf ( fp, "# maxIOMode   = %d\n", info->maxIOMode );
+  fprintf ( fp, "# minIOModeWithSpecialProcs  = %d\n", info->minIOModeWithSpecialProcs );
+  fprintf ( fp, "# nProcsIO    = %d\n", info->nProcsIO );
+  fprintf ( fp, "# nProcsModel = %d\n", info->nProcsModel );
+  fprintf ( fp, "# isProcIO    = %d\n", info->isProcIO );
+  fprintf ( fp, "#\n" );
+  fprintf ( fp, "# commGlob    = %d\n", (int)MPI_Comm_c2f(info->commGlob));
+  fprintf ( fp, "# sizeGlob    = %d\n", info->sizeGlob );
+  fprintf ( fp, "# rankGlob    = %d\n", info->rankGlob );
+  fprintf ( fp, "# root        = %d\n", info->root );
+  fprintf ( fp, "#\n" );
+  fprintf ( fp, "# commPio     = %d\n", (int)MPI_Comm_c2f(info->commPio));
+  fprintf ( fp, "# sizePio     = %d\n", info->sizePio );
+  fprintf ( fp, "# rankPio     = %d\n", info->rankPio );
+  fprintf ( fp, "#\n" );
+  fprintf ( fp, "# commNode    = %d\n", (int)MPI_Comm_c2f(info->commNode));
+  fprintf ( fp, "# sizeNode    = %d\n", info->sizeNode );
+  fprintf ( fp, "# rankNode    = %d\n", info->rankNode );
+  fprintf ( fp, "# hostname    = %s\n", info->hostname[0] == 0 ? "nn" : 
+	    info->hostname );
+  fprintf ( fp, "# specialRankNode = %d\n", info->specialRankNode );
+  fprintf ( fp, "#\n" );
+  fprintf ( fp, "# commColl    = %d\n", (int)MPI_Comm_c2f(info->commColl));
+  fprintf ( fp, "# sizeColl    = %d\n", info->sizeColl );
+  fprintf ( fp, "# rankColl    = %d\n", info->rankColl );
+  fprintf ( fp, "#\n" );
+  fprintf ( fp, "# commCalc    = %d\n", (int)MPI_Comm_c2f(info->commCalc));
+  if ( info->commsIO != NULL )
+    {
+      fprintf ( fp, "#\n" );
+      for ( i = 0; i < info->nProcsColl; i++ )
+	fprintf(fp, "# commsIO[%d]  = %d\n", i,
+                (int)MPI_Comm_c2f(info->commsIO[i]));
+    }
+  else
+    fprintf ( fp, "# commsIO     = NULL\n" );
+  fprintf ( fp, "# hostID      = %d\n", info->nodeInfo.hostID );
+  fprintf ( fp, "# isProcColl  = %d\n", info->nodeInfo.isProcColl );
+  fprintf ( fp, "# nNodes      = %d\n", info->nodeInfo.nNodes );
+  fprintf ( fp, "# nProcsColl  = %d\n", info->nProcsColl );
+  if ( info->procsCollMap != NULL )
+    {
+      fprintf ( fp, "# procsCollMap   = " );
+      xassert ( info->nProcsColl != CDI_UNDEFID );
+      for ( i = 0; i < info->nProcsColl; i++ )
+        fprintf ( fp, "%d ", info->procsCollMap[i] );
+      fprintf ( fp, "\n" );
+    }
+  else     
+    fprintf ( fp, "# procsCollMap   = NULL\n" );
+  if ( info->nodeSizes != NULL )
+    {
+      fprintf ( fp, "# nodeSizes   = " );
+      xassert ( info->nodeInfo.nNodes != CDI_UNDEFID );
+      for ( i = 0; i < info->nodeInfo.nNodes; i++ )
+        fprintf ( fp, "%d ", info->nodeSizes[i] );
+      fprintf ( fp, "\n" );
+    }
+  else     
+    fprintf ( fp, "# nodeSizes   = NULL\n" );
+  if ( info->nodeMap != NULL )
+    {
+      fprintf ( fp, "# nodeMap     = " );
+      xassert ( info->nProcsColl != CDI_UNDEFID );
+      for ( i = 0; i < info->nProcsColl; i++ )
+        fprintf ( fp, "%d ", info->nodeMap[i] );
+      fprintf ( fp, "\n" );
+    }
+  else     
+    fprintf ( fp, "# nodeMap     = NULL\n" );
+  fprintf ( fp, "#\n" );
+  fprintf ( fp, "############################\n" );
+  fprintf ( fp, "\n" );
+}
+
+#endif
+
+
+/************************************************************************/
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_comm.h b/libcdi/src/pio_comm.h
new file mode 100644
index 0000000..6e014ec
--- /dev/null
+++ b/libcdi/src/pio_comm.h
@@ -0,0 +1,84 @@
+#ifndef PIO_INFO_
+#define PIO_INFO_
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+
+#include <mpi.h>
+#include <stdio.h>
+#include "cdi.h"
+
+typedef struct {
+  int hostID;
+  int isProcColl;
+  int nNodes;
+} nodeInfo_t;
+
+enum { MAXNPROCSIO   = 256,
+       MAXCOMMIONAME = 12 };
+
+enum { sizeNodeInfo  = 3,
+       NODEINFO      = 1111, 
+       NODEMAP       = 2222};
+
+void     commInit               ( void );
+void     commDestroy            ( void );
+
+void     commDefCommGlob        ( MPI_Comm ); 
+MPI_Comm commInqCommGlob        ( void );
+int      commInqSizeGlob        ( void );
+int      commInqRankGlob        ( void );
+int      commInqRootGlob        ( void );
+
+void     commDefNProcsIO        ( int );
+int      commInqNProcsIO        ( void );
+int      commInqNProcsModel     ( void );
+int      commInqIsProcIO        ( void );
+void     commDefIOMode          ( int, int, int );
+int      commInqIOMode          ( void );
+
+void     commDefCommPio         ( void );
+MPI_Comm commInqCommPio         ( void );
+MPI_Comm commInqCommModel       ( void );
+int      commInqRankPio         ( void );
+int      commInqRankModel       ( void );
+
+void     commDefCommNode        ( void );
+MPI_Comm commInqCommNode        ( void );
+int      commInqSizeNode        ( void );
+int      commInqRankNode        ( void );
+int      commInqSpecialRankNode ( void );
+
+void     commDefCommColl        ( int ); 
+MPI_Comm commInqCommColl        ( void );
+int      commInqSizeColl        ( void ); 
+int      commInqRankColl        ( void ); 
+                                
+void     commSendNodeInfo       ( void );
+void     commRecvNodeMap        ( void );// todo switch to gatherNodeInfo inside commpio
+int *    commInqNodeSizes       ( void );
+int      commInqNNodes          ( void );
+void     commEvalPhysNodes      ( void );
+int      commCollID2RankGlob    ( int );
+int      commRankGlob2CollID    ( int );
+void     commDefCommsIO         ( void ); 
+MPI_Comm commInqCommsIO         ( int );
+MPI_Comm commInqCommCalc        ( void );
+int      commInqNProcsColl      ( void );
+
+void     commPrint              ( FILE * );
+
+#endif
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_dbuffer.c b/libcdi/src/pio_dbuffer.c
new file mode 100644
index 0000000..95b85f3
--- /dev/null
+++ b/libcdi/src/pio_dbuffer.c
@@ -0,0 +1,172 @@
+#define _XOPEN_SOURCE 600
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <errno.h>
+#include <unistd.h>
+#include <string.h>
+
+#ifdef USE_MPI
+#include "pio_impl.h"
+#include "pio_util.h"
+
+bool localDebug    =false;
+
+
+int dbuffer_init ( struct dBuffer **dbuffer, size_t size )
+{
+  struct dBuffer *db;
+  int status;
+  size_t pagesize;
+
+
+#ifndef _SX
+  pagesize = ( size_t ) sysconf ( _SC_PAGESIZE );
+
+  if ( localDebug ) 
+    fprintf ( stdout, "dbuffer_init(): pagesize = %zu bytes, size = %zu \n", pagesize, size );
+
+  if ( dbuffer == NULL || size < pagesize )
+    {
+
+      fprintf ( stdout, "dbuffer_init: dbuffer=NULL\n" );
+      return 1;
+    }
+  db = ( struct dBuffer * ) malloc ( sizeof ( struct dBuffer ));
+
+  if ( db == NULL )
+    {
+      perror ( "Not enough memory" );
+      return 1;
+    }
+  
+  db->size = pagesize;
+  while ( db->size < size )
+    {
+      db->size <<= 1;
+      if ( localDebug ) 
+	fprintf ( stdout,"size correction: %zu\n", db->size );
+    }
+  
+  db->wr_pointer = 0;
+
+  if ( ( status = posix_memalign ( ( void ** ) &db->buffer, pagesize, 
+				   sizeof ( char ) * ( db->size ))) != 0 ) 
+    {
+      switch ( status )
+	{
+	case EINVAL:
+	  fprintf ( stderr, 
+		    "The alignment argument was not a power of two, or was not a multiple of sizeof(void *).\n" );
+	  break;
+	case ENOMEM:
+	  fprintf ( stderr, 
+		    "There was insufficient memory to fulfill the allocation request.\n" );
+	  break;
+	}
+    }
+#else
+
+  if ( dbuffer == NULL )
+    {
+      fprintf ( stdout, "dbuffer_init: dbuffer=NULL\n" );
+      return 1;
+    }
+
+  db = ( struct dBuffer * ) malloc ( sizeof ( struct dBuffer ));
+  
+  if ( db == NULL )
+    {
+      perror ( "Not enough memory" );
+      return 1;
+    }
+  
+  db->size = size;
+  
+  db->wr_pointer = 0;
+
+  db->buffer = ( unsigned char * ) malloc ( sizeof ( unsigned char ) * ( db->size ));
+  if ( db->buffer == NULL )
+  {
+      perror ( "Not enough memory" );
+      return 1 ;
+  }
+#endif
+
+  *dbuffer = db;
+  
+  return 0;
+}
+
+void dbuffer_cleanup ( struct dBuffer **dbuffer )
+{
+  struct dBuffer *db;
+
+  db = *dbuffer;
+
+  free ( db->buffer );
+  free ( db );
+
+  return;
+}
+
+size_t dbuffer_data_size ( struct dBuffer *dbuffer )
+{
+  size_t data_size;
+
+  data_size = ( size_t )( dbuffer->wr_pointer & ( dbuffer->size-1 ));
+
+  return data_size;
+}
+
+static size_t
+dbuffer_freesize(struct dBuffer *dbuffer)
+{
+  size_t free_size;
+
+  free_size = ( size_t )( dbuffer->size - 1 - dbuffer_data_size ( dbuffer ));
+
+  return free_size;
+}
+
+int dbuffer_reset ( struct dBuffer *dbuffer )
+{
+  dbuffer->wr_pointer = 0;
+  
+  return 0;
+}
+
+int
+dbuffer_push(struct dBuffer *dbuffer, const void *buffer, size_t len)
+{
+  size_t space_left;
+  size_t wr_ptr;
+
+  space_left = dbuffer_freesize(dbuffer);
+  if ( len > space_left )
+    {
+      return 1; /* not enough space left */
+    }
+  
+  wr_ptr = dbuffer->wr_pointer;
+  memcpy ( dbuffer->buffer + wr_ptr, buffer, len );
+  dbuffer->wr_pointer = wr_ptr + len;
+
+  return 0;
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_impl.h b/libcdi/src/pio_impl.h
new file mode 100644
index 0000000..089f218
--- /dev/null
+++ b/libcdi/src/pio_impl.h
@@ -0,0 +1,106 @@
+#ifndef _PIO_IMPL_H
+#define _PIO_IMPL_H
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <stdbool.h>
+
+#ifdef USE_MPI
+#include "mpi.h"
+
+typedef enum 
+{
+  IO_Open_file,
+  IO_Close_file,
+  IO_Get_fp,
+  IO_Set_fp,
+  IO_Send_buffer,
+  IO_Finalize
+} IO_Server_command;
+
+struct dBuffer
+{
+  size_t wr_pointer;
+  size_t size;
+  unsigned char * buffer;
+};
+
+typedef int ( * valDestroyFunction ) ( void * );
+typedef bool (*eqPredicate)(void *, void *);
+
+typedef struct listSet listSet;
+
+struct fileOpTag
+{
+  int id;
+  int command;
+};
+
+/* pio.c */
+int encodeFileOpTag(int fileID, int command);
+struct fileOpTag decodeFileOpTag(int);
+
+/* pio_dbuffer.c */
+int       dbuffer_init ( struct dBuffer **, size_t );
+int       dbuffer_push(struct dBuffer *, const void *, size_t);
+size_t    dbuffer_data_size ( struct dBuffer * );
+int       dbuffer_reset ( struct dBuffer * );
+void      dbuffer_cleanup ( struct dBuffer ** );
+
+/* pio_list_set.c */
+listSet *listSetNew(valDestroyFunction, eqPredicate);
+void listSetDelete(listSet *);
+int listSetAdd(listSet *, void *);
+bool listSetIsEmpty(listSet *);
+int listSetRemove(listSet *, int (*predicate)(void *, void *),
+                  void *data);
+void *listSetGet(listSet *q, int (*predicate)(void *, void *), void *data);
+
+typedef void (*elemOp)(void *elem, void *data);
+void listSetForeach(listSet *q, elemOp func, void *data);
+
+/* pio_mpinonb.c */
+int       fowMPINONB ( const char * );
+int       fcMPINONB ( int );
+size_t    fwMPINONB( int, int, const void *, size_t );
+void      initMPINONB ( void );
+void      finalizeMPINONB ( void );
+
+
+/* common functionality for file split between collectors and writer(s) */
+int pioSendClose(int);
+int pioSendOpen(const char *);
+size_t pioSendWrite(int, int, const void *, size_t);
+void pioSendInitialize(void);
+void pioSendFinalize(void);
+
+
+/* pio_posixasynch.c */
+#ifndef _SX
+void pioWriterAIO(void);
+#endif
+
+/* pio_posixfpguardsendrecv.c */
+void      fpgPOSIXFPGUARDSENDRECV ( void );
+int       fowPOSIXFPGUARDSENDRECV ( const char * );
+int       fcPOSIXFPGUARDSENDRECV ( int );
+size_t    fwPOSIXFPGUARDSENDRECV ( int, int, const void *, size_t );
+void      initPOSIXFPGUARDSENDRECV ( void );
+void      finalizePOSIXFPGUARDSENDRECV ( void );
+
+/* pio_posixnonb.c */
+void pioWriterStdIO(void);
+
+#endif
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_interface.c b/libcdi/src/pio_interface.c
new file mode 100644
index 0000000..a976dbf
--- /dev/null
+++ b/libcdi/src/pio_interface.c
@@ -0,0 +1,922 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <stdlib.h>
+#include <stdio.h>
+#include <stdarg.h>
+#include "cdi.h"
+#include "limits.h"
+#include "pio_util.h"
+#include "vlist_var.h"
+
+#ifdef USE_MPI
+#include "namespace.h"
+#include "pio_interface.h"
+#include "pio_comm.h"
+#include "pio_rpc.h"
+#include "pio_server.h"
+#include "resource_handle.h"
+#include "stream_int.h"
+#include "vlist.h"
+extern resOps streamOps;
+
+
+static struct rdmaWin
+{
+  size_t size;
+  unsigned char *buffer, *head;
+  MPI_Win win;
+  int postSet, refuseFuncCall;
+  MPI_Group ioGroup;
+} *txWin = NULL;
+
+
+char * funcMap[nFuncs] = {"streamOpen", "streamDefVlist", "streamClose" };
+
+
+/****************************************************/
+
+static int cmp ( const void * va, const void * vb )
+{
+    const int ** a, ** b;
+
+  a = ( const int ** ) va;
+  b = ( const int ** ) vb;
+
+  return (( **a < **b ) - ( **a > **b ));
+}
+
+/****************************************************/
+
+static void
+mapProblems(int problemSizes[], int * problemMapping, int nProblems,
+            int nWriter, double * w)
+{
+  int *ip[nProblems];
+  int dummy[nProblems];
+  int buckets[nWriter];
+  int currCapacity, nextCapacity;
+  double meanBucket[nWriter];
+  int sum = 0;
+  int writerIdx = 0;
+  int i, j;
+
+
+  for ( i = 0; i < nProblems; i++ )
+    {
+      ip[i] = &problemSizes[i];
+      sum += problemSizes[i];
+    }
+
+  qsort ( ip, nProblems, sizeof ( int * ), cmp );
+
+  for ( i = 0; i < nProblems; i++ )
+    dummy[i] = ip[i] - problemSizes;
+
+  for ( j = 0; j < nWriter; j++ )
+    meanBucket[j] = ( double ) sum * ( * ( w + j ));
+
+  for ( i = 0; i < nProblems; i++ )
+    {
+      currCapacity = INT_MIN;
+
+      for ( j = 0; j < nWriter; j++ )
+	{
+	  if ( !i ) buckets[j] = 0.0;
+	  nextCapacity = meanBucket[j] - ( buckets[j] + ( *ip[i] ));
+
+	  if ( nextCapacity > currCapacity )
+	    {
+	      currCapacity = nextCapacity;
+	      writerIdx = j;
+	    }
+	}
+      problemMapping[ dummy[i] ] = writerIdx;
+      buckets[writerIdx] +=  *ip[i];
+    }
+
+  xprintArray3 (  "problemSizes = ", problemSizes, nProblems, DATATYPE_INT );
+  xprintArray3 ( "vector of indices, qsort of problemSizes", dummy,
+                nProblems, DATATYPE_INT );
+  xprintArray3 ( "problemMapping", problemMapping, nProblems, DATATYPE_INT );
+  xprintArray3 ( "meanBucket", meanBucket, nWriter, DATATYPE_FLT );
+  xprintArray3 ( "actual buckets", buckets, nWriter, DATATYPE_INT );
+}
+
+/****************************************************/
+
+/**
+   @brief is encapsulated in CDI library.
+
+   @param vSizes array with number of levels for all var_t 's in order of streams
+
+   @param sSizes array with number of var_t for all stream_t 's
+
+   @param varMapping return value, array with ranks of I/O PEs assigned to var_t 's
+in order of vSizes
+
+   @param nStreams number of stream_t 's
+
+   @param nodeSizes array of number of I/O PEs on each physical nodes, increasing
+   order of ranks assumed
+
+   @param nNodes number of physical nodes hosting I/O PEs
+
+   @return
+*/
+
+static void
+varMapGen(int *vSizes, int *sSizes, int *varMapping,
+          int nStreams, int *nodeSizes, int nNodes)
+{
+
+  int weightsStreams[nStreams];
+  int streamMapping[nStreams];
+  int nPEs = 0, nVars = 0;
+  int i, j, k, offset = 0, offsetN = 0;
+  double * w;
+
+  int * weightsVarsNode;
+  int * varMappingNode;
+  int nVarsNode, summandRank = 0;
+  int nProcsColl = commInqNProcsColl ();
+
+  int buckets[nProcsColl];
+
+  for ( i = 0; i < nStreams; i++ )
+    {
+      nVars += * ( sSizes + i );
+      weightsStreams[i] = 0;
+      for ( j = 0; j < * ( sSizes + i ); j++ )
+	weightsStreams[i] += * ( vSizes + offset++ );
+    }
+
+  w = ( double * ) xmalloc ( nNodes * sizeof ( double ));
+  for ( j = 0; j < nNodes; j++ )
+    nPEs += * ( nodeSizes + j );
+
+  for ( j = 0; j < nNodes; j++ )
+    w[j] = ( double ) * ( nodeSizes + j ) / ( double ) nPEs;
+
+  mapProblems ( weightsStreams, streamMapping, nStreams, nNodes, w );
+  free ( w );
+
+  for ( i = 0; i < nNodes; i++ )
+    {
+      nVarsNode = 0;
+      for ( j = 0; j < nStreams; j++ )
+	if ( * ( streamMapping + j ) == i )
+	  nVarsNode += * ( sSizes + j );
+
+      weightsVarsNode = ( int * ) xmalloc ( nVarsNode * sizeof ( int ));
+      varMappingNode = ( int * ) xmalloc ( nVarsNode * sizeof ( int ));
+      w = ( double * ) xmalloc ( * ( nodeSizes + i ) * sizeof ( double ));
+      offset = 0;
+      offsetN = 0;
+
+      for ( j = 0; j < nStreams; j++ )
+	if ( * ( streamMapping + j ) == i )
+	  for ( k = 0; k < * ( sSizes + j ); k ++ )
+	    * ( weightsVarsNode + offsetN++ ) = * ( vSizes + offset++ );
+	else
+	  offset += * ( sSizes + j );
+
+      for ( j = 0; j < * ( nodeSizes + i ); j ++ )
+	w[j] = 1.0 / ( double ) * ( nodeSizes + i );
+
+      mapProblems ( weightsVarsNode, varMappingNode, nVarsNode,
+		    * ( nodeSizes + i ),  w );
+
+      offset = 0;
+      offsetN = 0;
+
+      for ( j = 0; j < nStreams; j++ )
+	if ( * ( streamMapping + j ) == i )
+	  for ( k = 0; k < * ( sSizes + j ); k ++ )
+	    * ( varMapping + offset ++ ) =
+              commCollID2RankGlob ( * ( varMappingNode + offsetN ++ ) +
+                                    summandRank );
+	else
+	  offset += * ( sSizes + j );
+
+      summandRank += * ( nodeSizes + i );
+
+      free ( w );
+      free ( varMappingNode );
+      free ( weightsVarsNode );
+    }
+
+  if ( ddebug )
+    {
+      xprintArray ( "varMapping", varMapping, nVars, DATATYPE_INT  );
+      for ( i = 0; i < nProcsColl; i++ )
+	buckets[i] = 0;
+      for ( i = 0; i < nVars; i ++ )
+	buckets[commRankGlob2CollID ( *(varMapping + i ))] += * ( vSizes + i );
+      xprintArray ( "buckets", buckets, nProcsColl, DATATYPE_INT );
+    }
+}
+
+/************************************************************************/
+
+static void
+defVarDeco(int vlistID, int varID)
+{
+  int varSize, cRank, lChunk, rem, lOffset;
+  int nProcsModel = commInqNProcsModel ();
+  deco_t deco[nProcsModel];
+
+  varSize = vlistInqVarSize ( vlistID, varID );
+
+  for ( cRank = 0; cRank < nProcsModel; cRank++ )
+    {
+      lChunk = varSize / nProcsModel;
+      lOffset = cRank * lChunk;
+      rem = varSize % nProcsModel;
+      if ( cRank < rem )
+        {
+          lChunk++;
+          lOffset += cRank;
+        }
+      else
+        lOffset += rem;
+
+      deco[cRank].rank   = cRank;
+      deco[cRank].offset = lOffset;
+      deco[cRank].chunk  = lChunk;
+    }
+  vlistDefVarDeco ( vlistID, varID, nProcsModel, &deco[0] );
+}
+
+/************************************************************************/
+
+
+static void
+varsMapNDeco(int nNodes, int *nodeSizes)
+{
+  int nStreams, nVars, * resHs, * streamSizes, * varSizes, * varMapping,
+    * collectsData;
+  int i, j, k = 0;
+  int nProcsColl = commInqNProcsColl ();
+  char text[1024];
+
+  xdebug ( "START, nProcsColl=%d", nProcsColl );
+
+  nStreams = streamSize ();
+
+  resHs       = xmalloc ( nStreams * sizeof ( resHs[0] ));
+  streamSizes = xmalloc ( nStreams * sizeof ( streamSizes[0] ));
+  collectsData = xmalloc ( nProcsColl * sizeof ( collectsData[0] ));
+  streamGetIndexList ( nStreams, resHs );
+
+  for ( i = 0; i < nStreams; i++ )
+    streamSizes[i] = streamInqNvars ( * ( resHs + i ));
+
+  nVars = xsum ( nStreams, streamSizes );
+  varSizes   = xmalloc ( nVars * sizeof ( varSizes[0] ));
+  varMapping = xmalloc ( nVars * sizeof ( varMapping[0] ));
+
+  for ( i = 0; i < nStreams; i++ )
+    for ( j = 0; j < * ( streamSizes + i ); j++ )
+      varSizes[k++] += vlistInqVarSize ( streamInqVlist ( * ( resHs + i )), j );
+
+  xassert ( k == nVars );
+
+  varMapGen ( varSizes, streamSizes, varMapping,
+	      nStreams, nodeSizes, nNodes );
+
+  k = 0;
+  for ( i = 0; i < nStreams; i++ )
+    for ( j = 0; j < * ( streamSizes + i ); j++ )
+      {
+        defVarDeco ( streamInqVlist ( *( resHs + i )), j );
+        defVarDeco ( streamInqVlistIDorig ( * ( resHs + i )), j );
+        vlistDefVarIOrank ( streamInqVlist ( * ( resHs + i )), j,
+                            * ( varMapping + k ));
+        vlistDefVarIOrank ( streamInqVlistIDorig ( * ( resHs + i )), j,
+                            * ( varMapping + k ));
+        collectsData[commRankGlob2CollID ( varMapping[k++] )] = 1;
+      }
+
+  for ( j = 0; j < nProcsColl; j++ )
+    if ( collectsData[j] == 0 )
+      {
+        sprintf ( text,
+                  "\nAT LEAST ONE COLLECTOR PROCESS IDLES, "
+                  "CURRENTLY NOT COVERED: "
+                  "PE%d collects no data",
+                  commCollID2RankGlob ( j ));
+        xabort ( text );
+      }
+
+  if ( varMapping )   free ( varMapping );
+  if ( varSizes )     free ( varSizes );
+  if ( collectsData ) free ( collectsData );
+  if ( streamSizes )  free ( streamSizes );
+  if ( resHs )        free ( resHs );
+
+  xdebug("%s", "RETURN");
+}
+
+/************************************************************************/
+
+static
+void modelWinCleanup ( void )
+{
+  int collID;
+
+  xdebug("%s", "START");
+  if (txWin != NULL)
+    for ( collID = 0; collID < commInqNProcsColl (); collID ++ )
+      {
+        if (txWin[collID].postSet)
+          xmpi(MPI_Win_wait(txWin[collID].win));
+        xmpi(MPI_Win_free(&txWin[collID].win));
+        xmpi ( MPI_Free_mem ( txWin[collID].buffer ));
+        xmpi(MPI_Group_free(&txWin[collID].ioGroup));
+      }
+
+  if (txWin) free(txWin);
+
+  xdebug("%s", "RETURN. CLEANED UP MPI_WIN'S");
+}
+
+/************************************************************************/
+
+static void
+modelWinDefBufferSizes(void)
+{
+  int collID, nstreams, * streamIndexList, streamNo, vlistID, nvars, varID;
+  int collIDchunk = 0, sumWinBufferSize = 0;
+  int nProcsColl  = commInqNProcsColl ();
+  int rankGlob    = commInqRankGlob ();
+  int rankModel   = commInqRankModel ();
+  int root = commInqRootGlob ();
+
+  xdebug("%s", "START");
+  xassert(txWin != NULL);
+
+  nstreams = reshCountType ( &streamOps );
+  streamIndexList = xmalloc ( nstreams * sizeof ( streamIndexList[0] ));
+  reshGetResHListOfType ( nstreams, streamIndexList, &streamOps );
+  for ( streamNo = 0; streamNo < nstreams; streamNo++ )
+    {
+      // space required for data
+      vlistID = streamInqVlist ( streamIndexList[streamNo] );
+      nvars = vlistNvars ( vlistID );
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          collID = CDI_UNDEFID;
+          collID = commRankGlob2CollID ( vlistInqVarIOrank ( vlistID, varID ));
+          collIDchunk = vlistInqVarDecoChunk ( vlistID, varID, rankModel );
+          xassert ( collID != CDI_UNDEFID && collIDchunk > 0 );
+          txWin[collID].size += collIDchunk * sizeof (double) +
+            winBufferOverheadChunk * sizeof (int);
+        }
+
+      // space required for the 3 function calls streamOpen, streamDefVlist, streamClose
+      // once per stream and timestep for all collprocs only on the modelproc root
+      if ( rankGlob == root )
+        for ( collID = 0; collID < nProcsColl; collID++ )
+          txWin[collID].size += 3 * winBufferOverheadFuncCall * sizeof (int)
+            + 5 * sizeof (int) + MAXDATAFILENAME;
+    }
+  free ( streamIndexList );
+
+  for ( collID = 0; collID < nProcsColl; collID++ )
+    {
+      txWin[collID].size += winBufferOverhead * sizeof (int);
+      sumWinBufferSize += txWin[collID].size;
+    }
+  xdebug("sumWinBufferSize=%zu, MAXWINBUFFERSIZE=%zu", (size_t)sumWinBufferSize,
+         (size_t)MAXWINBUFFERSIZE);
+  xassert ( sumWinBufferSize <= MAXWINBUFFERSIZE );
+  /* xprintArray("txWin.size", txWin, nProcsColl, DATATYPE_INT); */
+  xdebug("%s", "RETURN");
+}
+
+
+/************************************************************************/
+
+
+static
+  void modelWinFlushBuffer ( int collID )
+{
+  int nProcsColl = commInqNProcsColl ();
+
+  xassert ( collID                >= 0         &&
+            collID                < nProcsColl &&
+            txWin[collID].buffer     != NULL      &&
+            txWin != NULL      &&
+            txWin[collID].size >= 0         &&
+            txWin[collID].size <= MAXWINBUFFERSIZE);
+  memset(txWin[collID].buffer, 0, txWin[collID].size);
+  txWin[collID].head = txWin[collID].buffer;
+  txWin[collID].refuseFuncCall = 0;
+}
+
+
+/************************************************************************/
+
+
+static
+void modelWinCreate ( void )
+{
+  int collID, ranks[1];
+  int nProcsColl = commInqNProcsColl ();
+
+  xdebug("%s", "START");
+  txWin = xmalloc(nProcsColl * sizeof (txWin[0]));
+
+  modelWinDefBufferSizes ();
+  ranks[0] = commInqNProcsModel ();
+
+  for ( collID = 0; collID < nProcsColl; collID ++ )
+    {
+      xassert(txWin[collID].size > 0);
+      txWin[collID].buffer = NULL;
+      xmpi(MPI_Alloc_mem((MPI_Aint)txWin[collID].size, MPI_INFO_NULL,
+                         &txWin[collID].buffer));
+      xassert ( txWin[collID].buffer != NULL );
+      txWin[collID].head = txWin[collID].buffer;
+      xmpi(MPI_Win_create(txWin[collID].buffer, (MPI_Aint)txWin[collID].size, 1,
+                          MPI_INFO_NULL, commInqCommsIO(collID),
+                          &txWin[collID].win));
+      xmpi(MPI_Comm_group(commInqCommsIO(collID), &txWin[collID].ioGroup));
+      xmpi(MPI_Group_incl(txWin[collID].ioGroup, 1, ranks,
+                          &txWin[collID].ioGroup ));
+    }
+  xdebug("%s", "RETURN, CREATED MPI_WIN'S");
+}
+
+/************************************************************************/
+
+static void
+modelWinBufferPutAtEnd(const char * caller,
+                       int collID, const void * argBuffer, size_t size)
+{
+  /*
+    xdebug ( "collID=%d, size=%d, newBufferHead=%d, oldBufferSize=%d",
+    collID, size, txWin[collID].head - txWin[collID].buffer + size,
+    txWin[collID].size );
+  */
+  if ( txWin == NULL ||
+       argBuffer     == NULL ||
+       size           < 0    ||
+       collID         < 0    ||
+       collID        >= commInqNProcsColl () ||
+       txWin[collID].head - txWin[collID].buffer + size > txWin[collID].size)
+    xabort("caller: %s", caller);
+
+  memcpy ( txWin[collID].head, argBuffer, size );
+  txWin[collID].head += size;
+}
+
+/************************************************************************/
+
+void pioBufferData ( const int streamID, const int varID, const double *data, int nmiss )
+{
+  int chunk, vlistID, collID = CDI_UNDEFID;
+  int tokenSep = SEPARATOR, tokenData = DATATOKEN;
+  size_t size;
+  int rankModel = commInqRankModel ();
+
+  vlistID  = streamInqVlist ( streamID );
+  collID   = commRankGlob2CollID ( vlistInqVarIOrank ( vlistID, varID ));
+  chunk    = vlistInqVarDecoChunk ( vlistID, varID, rankModel );
+  xassert ( collID         >= 0                    &&
+            collID         <  commInqNProcsColl () &&
+            chunk          >= 0                    &&
+            txWin != NULL);
+
+  if (txWin[collID].postSet)
+    {
+      xmpi(MPI_Win_wait(txWin[collID].win));
+      txWin[collID].postSet = 0;
+      modelWinFlushBuffer ( collID );
+    }
+
+  size = chunk * sizeof ( double ) + winBufferOverheadChunk * sizeof ( int );
+  xassert(txWin[collID].head - txWin[collID].buffer + size < txWin[collID].size);
+
+  modelWinBufferPutAtEnd ( __func__, collID, &tokenData, sizeof ( tokenData ));
+  modelWinBufferPutAtEnd ( __func__, collID, &streamID , sizeof ( streamID ));
+  modelWinBufferPutAtEnd ( __func__, collID, &varID    , sizeof ( varID ));
+  modelWinBufferPutAtEnd ( __func__, collID, data      , chunk * sizeof ( double ));
+  modelWinBufferPutAtEnd ( __func__, collID, &nmiss    , sizeof ( nmiss ));
+  modelWinBufferPutAtEnd ( __func__, collID, &tokenSep , sizeof ( tokenSep ));
+
+  txWin[collID].refuseFuncCall = 1;
+}
+
+/************************************************************************/
+
+void pioBufferFuncCall(int funcID, int argc, ... )
+{
+  va_list ap;
+  int rankGlob = commInqRankGlob ();
+  int root = commInqRootGlob ();
+  int collID, nProcsColl = commInqNProcsColl ();
+  int tokenSep = SEPARATOR, tokenFuncCall = FUNCCALL;
+  size_t size = 0;
+
+  xassert(funcID >= 0 && funcID < nFuncs);
+  xdebug("%s, func: %s", "START", funcMap[funcID]);
+
+  if ( rankGlob != root ) return;
+
+  xassert (argc          >= 1                    &&
+           argc          <= 2                    &&
+           txWin != NULL);
+
+  va_start ( ap, argc );
+
+  switch ( funcID )
+    {
+    case STREAMCLOSE:
+      {
+        int streamID;
+
+        xassert ( argc == 1 );
+        streamID  = va_arg ( ap, int );
+
+        for ( collID = 0; collID < nProcsColl; collID++ )
+          {
+            size = ( winBufferOverheadFuncCall + 1 ) * sizeof ( int );
+            xassert(txWin[collID].head - txWin[collID].buffer + size <
+                    txWin[collID].size);
+
+            if (txWin[collID].postSet)
+              {
+                xmpi(MPI_Win_wait(txWin[collID].win));
+                txWin[collID].postSet = 0;
+                modelWinFlushBuffer ( collID );
+              }
+
+            xassert(txWin[collID].refuseFuncCall == 0);
+
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenFuncCall,
+                                     sizeof ( tokenFuncCall));
+            modelWinBufferPutAtEnd ( __func__, collID, &funcID,
+                                     sizeof ( funcID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &streamID,
+                                     sizeof ( streamID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenSep,
+                                     sizeof ( tokenSep ));
+          }
+      xdebug ( "WROTE FUNCTION CALL IN BUFFER OF WINS:  %s, streamID=%d",
+               funcMap[funcID], streamID );
+      }
+      break;
+    case STREAMOPEN:
+      {
+        char * filename;
+        int    filetype;
+        size_t filenamesz;
+
+        xassert ( argc == 2 );
+        filename  = va_arg ( ap, char * );
+        filenamesz = strlen ( filename );
+        xassert ( filenamesz > 0 &&
+                  filenamesz < MAXDATAFILENAME );
+        filetype  = va_arg ( ap, int );
+
+        for ( collID = 0; collID < nProcsColl; collID++ )
+          {
+            size = ( winBufferOverheadFuncCall + 2 ) * sizeof ( int ) +
+              MAXDATAFILENAME;
+            xassert(txWin[collID].head - txWin[collID].buffer + size <
+                    txWin[collID].size);
+
+            if (txWin[collID].postSet)
+              {
+                xmpi(MPI_Win_wait(txWin[collID].win));
+                txWin[collID].postSet = 0;
+                modelWinFlushBuffer ( collID );
+              }
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenFuncCall,
+                                     sizeof ( tokenFuncCall));
+            modelWinBufferPutAtEnd ( __func__, collID, &funcID,
+                                     sizeof ( funcID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &filenamesz,
+                                     sizeof ( filenamesz ));
+            modelWinBufferPutAtEnd ( __func__, collID, filename,
+                                     filenamesz );
+            modelWinBufferPutAtEnd ( __func__, collID, &filetype,
+                                     sizeof ( filetype ));
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenSep,
+                                     sizeof ( tokenSep ));
+          }
+
+        xdebug("WROTE FUNCTION CALL IN BUFFER OF WINS:  %s, filenamesz=%zu,"
+               " filename=%s, filetype=%d",
+               funcMap[funcID], filenamesz, filename, filetype );
+      }
+      break;
+    case STREAMDEFVLIST:
+      {
+        int streamID, vlistID;
+
+        xassert ( argc == 2 );
+        streamID  = va_arg ( ap, int );
+        vlistID   = va_arg ( ap, int );
+
+        for ( collID = 0; collID < nProcsColl; collID++ )
+          {
+            size = ( winBufferOverheadFuncCall + 2 ) * sizeof ( int );
+            xassert(txWin[collID].head - txWin[collID].buffer + size <
+                    txWin[collID].size);
+
+            if (txWin[collID].postSet)
+              {
+                xmpi(MPI_Win_wait(txWin[collID].win));
+                txWin[collID].postSet = 0;
+                modelWinFlushBuffer ( collID );
+              }
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenFuncCall,
+                                     sizeof ( tokenFuncCall));
+            modelWinBufferPutAtEnd ( __func__, collID, &funcID,
+                                     sizeof ( funcID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &streamID,
+                                     sizeof ( streamID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &vlistID,
+                                     sizeof ( streamID ));
+            modelWinBufferPutAtEnd ( __func__, collID, &tokenSep,
+                                     sizeof ( tokenSep ));
+          }
+
+        xdebug ( "WROTE FUNCTION CALL IN BUFFER OF WINS:  %s, streamID=%d,"
+                 " vlistID=%d",
+                 funcMap[funcID], streamID, vlistID );
+      }
+      break;
+    default:
+      xabort ( "FUNCTION NOT MAPPED!" );
+    }
+
+  va_end ( ap );
+
+  xdebug("%s", "RETURN");
+}
+
+#endif
+
+/*****************************************************************************/
+
+int pioInqVarDecoChunk ( int vlistID, int varID )
+{
+#ifdef USE_MPI
+   int rankModel = commInqRankModel ();
+   xassert ( rankModel != CDI_UNDEFID );
+   return vlistInqVarDecoChunk ( vlistID, varID, rankModel );
+#endif
+   return vlistInqVarDecoChunk ( vlistID, varID, CDI_UNDEFID );
+}
+
+/*****************************************************************************/
+
+int pioInqVarDecoOff ( int vlistID, int varID )
+{
+#ifdef USE_MPI
+   int rankModel = commInqRankModel ();
+   xassert ( rankModel != CDI_UNDEFID );
+   return vlistInqVarDecoOff ( vlistID, varID, rankModel );
+#else
+   return vlistInqVarDecoOff ( vlistID, varID, CDI_UNDEFID );
+#endif
+}
+
+/*****************************************************************************/
+/**
+   @brief initializes the MPI_Communicators needed for the
+  communication between the calculator PEs and the I/O PEs and within the
+  group of I/O PEs.
+
+  commGlob: all PEs
+
+  commPIO: I/O PEs, PEs with highest ranks in commGlob
+
+  commModel: calculating PEs, no I/O PEs
+
+  commsIO[i]:
+
+  Collective call
+
+  @param comm MPI_Communicator of all calling PEs
+  @param nIOP number of I/O PEs
+  @return int indicating wether the calling PE is a calcutator (1) or not (0)
+*/
+
+#ifdef USE_MPI
+MPI_Comm pioInit_c ( MPI_Comm commGlob, int nProcsIO, int IOMode,
+                     int nNamespaces, int * hasLocalFile )
+{
+  int sizeGlob;
+
+  if ( IOMode < PIO_MINIOMODE || IOMode > PIO_MAXIOMODE )
+    xabort ( "IOMODE IS NOT VALID." );
+
+#ifdef _SX
+  if ( IOMode ==  PIO_ASYNCH )
+    xabort ( "PIO_ASYNCH DOES NOT WORK ON SX." );
+#endif
+
+  commInit ();
+  commDefCommGlob ( commGlob );
+  sizeGlob = commInqSizeGlob ();
+
+  if ( nProcsIO <= 0 || nProcsIO > sizeGlob - 1 )
+    xabort ( "DISTRIBUTION OF TASKS ON PROCS IS NOT VALID." );
+
+  commDefNProcsIO ( nProcsIO );
+  commDefIOMode   ( IOMode, PIO_MAXIOMODE, PIO_MINIOMODEWITHSPECIALPROCS );
+  commDefCommPio  ();
+
+  // JUST FOR TEST CASES WITH ONLY ONE MPI TASK
+  if ( commInqSizeGlob () == 1 )
+    {
+      namespaceInit ( nNamespaces, hasLocalFile );
+      return commInqCommGlob ();
+    }
+
+  if ( commInqIsProcIO ())
+    {
+      IOServer ();
+      commDestroy ();
+      MPI_Finalize ();
+      exit ( EXIT_SUCCESS );
+    }
+  else
+    {
+      commEvalPhysNodes ();
+      commDefCommsIO ();
+      namespaceInit ( nNamespaces, hasLocalFile );
+    }
+
+  xdebug ( "nProcsGlob=%d, RETURN", sizeGlob );
+  return commInqCommModel ();
+}
+#endif
+
+/*****************************************************************************/
+
+int pioInit ( int commGlobArg, int nProcsIO, int IOMode, int nNamespaces,
+              int * hasLocalFile )
+{
+#ifdef USE_MPI
+  xdebug("START: %s, nProcsIO=%d, IOMode=%d, nNamespaces=%d",
+         "cdi parallel",
+         nProcsIO, IOMode, nNamespaces );
+#else
+  xdebug("START: %s, nProcsIO=%d, IOMode=%d, nNamespaces=%d",
+         "cdi serial",
+         nProcsIO, IOMode, nNamespaces );
+#endif
+
+#ifdef USE_MPI
+  MPI_Comm commGlob;
+
+  commGlob = MPI_COMM_NULL;
+  commGlob = MPI_Comm_f2c (( MPI_Fint ) commGlobArg );
+  xassert ( commGlob != MPI_COMM_NULL );
+
+  return MPI_Comm_c2f ( pioInit_c ( commGlob, nProcsIO, IOMode, nNamespaces,
+                                    hasLocalFile ));
+#endif
+  xdebug("%s", "RETURN" );
+  return 0;
+}
+
+/************************************************************************/
+
+void  pioEndDef ( void )
+{
+#ifdef USE_MPI
+  char   * buffer;
+  int bufferSize;
+  int rankGlob = commInqRankGlob ();
+
+  xdebug("%s", "START");
+
+  varsMapNDeco ( commInqNNodes (), commInqNodeSizes ());
+
+  reshListPrint ( "reshListModel" );
+  
+  if ( rankGlob < commInqNProcsColl ())
+    {
+      reshPackBufferCreate ( &buffer, &bufferSize, commInqCommsIO ( rankGlob ));
+
+      xmpi ( MPI_Send ( buffer, bufferSize, MPI_PACKED, commInqNProcsModel (),
+                        RESOURCES, commInqCommsIO ( rankGlob )));
+
+      xdebug("%s", "SENT MESSAGE WITH TAG \"RESOURCES\"");
+
+      reshPackBufferDestroy ( &buffer );
+    }
+
+  modelWinCreate ();
+  namespaceDefResStatus ( STAGE_TIMELOOP );
+  xdebug("%s", "RETURN");
+#endif
+}
+
+/************************************************************************/
+
+void  pioEndTimestepping ( void )
+{
+#ifdef USE_MPI
+  xdebug("%s", "START");
+  namespaceDefResStatus ( STAGE_CLEANUP );
+  xdebug("%s", "RETURN");
+#endif
+}
+
+
+/****************************************************/
+
+
+/**
+  @brief is invoked by the calculator PEs, to inform
+  the I/O PEs that no more data will be written.
+
+  @param
+
+  @return
+*/
+
+void pioFinalize ( void )
+{
+#ifdef USE_MPI
+  int collID, ibuffer = 1111;
+  xdebug("%s", "START");
+  namespaceCleanup ();
+  for ( collID = 0; collID < commInqNProcsColl (); collID++ )
+    {
+      xmpi ( MPI_Send ( &ibuffer, 1, MPI_INT, commInqNProcsModel (),
+                        FINALIZE, commInqCommsIO ( collID )));
+      xdebug("%s", "SENT MESSAGE WITH TAG \"FINALIZE\"");
+    }
+  modelWinCleanup ();
+  commDestroy ();
+  xdebug("%s", "RETURN");
+#endif
+}
+
+ /************************************************************************/
+
+void pioWriteTimestep ( int tsID, int vdate, int vtime )
+{
+#ifdef USE_MPI
+  int collID, buffer[timestepSize], iAssert = 0;
+  int tokenEnd = END;
+  int rankGlob = commInqRankGlob ();
+  int nProcsColl = commInqNProcsColl ();
+  int nProcsModel = commInqNProcsModel ();
+
+  xdebug("%s", "START");
+
+  xassert ( tsID       >= 0     &&
+            vdate      >= 0     &&
+            vtime      >= 0     &&
+            txWin != NULL);
+
+  buffer[0] = tsID;
+  buffer[1] = vdate;
+  buffer[2] = vtime;
+
+  if ( rankGlob < nProcsColl )
+    {
+      xmpi ( MPI_Send ( &buffer[0], timestepSize, MPI_INTEGER, nProcsModel,
+                        WRITETS, commInqCommsIO ( rankGlob )));
+      xdebug("%s", "SENT MESSAGE WITH TAG \"WRITETS\"");
+    }
+
+  for ( collID = 0; collID < nProcsColl; collID++ )
+    {
+      if (txWin[collID].postSet)
+        {
+          xmpi(MPI_Win_wait(txWin[collID].win));
+          txWin[collID].postSet = 0;
+          modelWinFlushBuffer ( collID );
+        }
+      modelWinBufferPutAtEnd ( __func__, collID, &tokenEnd, 
+                               sizeof ( tokenEnd ));
+      xmpi(MPI_Win_post(txWin[collID].ioGroup, iAssert, txWin[collID].win));
+      txWin[collID].postSet = 1;
+    }
+
+  xdebug ( "RETURN. messages sent, windows posted: tsID=%d, vdate=%d, vtime=%d", 
+           tsID, vdate, vtime );
+
+#endif
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_interface.h b/libcdi/src/pio_interface.h
new file mode 100644
index 0000000..1319d8f
--- /dev/null
+++ b/libcdi/src/pio_interface.h
@@ -0,0 +1,26 @@
+#ifndef PIO_INTERFACE_
+#define PIO_INTERFACE_
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+
+#include <mpi.h>
+
+void pioBufferData ( int, int, const double *, int );
+void pioBufferFuncCall(int, int, ... );
+
+#endif
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_list_set.c b/libcdi/src/pio_list_set.c
new file mode 100644
index 0000000..c0344b8
--- /dev/null
+++ b/libcdi/src/pio_list_set.c
@@ -0,0 +1,158 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+
+#include "cdi.h"
+
+#ifdef USE_MPI
+#include "pio_impl.h"
+#include "pio_util.h"
+
+struct cons
+{
+  void * val;
+  struct cons * next;
+};
+
+struct listSet {
+  struct cons *head, *tail;
+  valDestroyFunction valDestroy;
+  eqPredicate keyCompare;
+  int count;
+};
+
+listSet *listSetNew( valDestroyFunction vD, eqPredicate kC )
+{
+  listSet *myq;
+
+  myq = xmalloc ( sizeof ( listSet ));
+
+  myq->head = NULL;
+  myq->tail = NULL;
+  myq->valDestroy = vD;
+  myq->keyCompare = kC;
+  myq->count = 0;
+
+  return myq;
+}
+
+void
+listSetDelete(listSet *q)
+{
+  struct cons *curr, *succ;
+
+  if ( q->head )
+    {
+      curr = q->head;
+
+      while ( curr )
+        {
+          succ = curr->next;
+          ( *( q->valDestroy )) ( curr->val );
+          free ( curr );
+          curr = succ;
+        }
+    }
+
+  free ( q );
+
+  return;
+}
+
+int
+listSetAdd(listSet *q, void *v)
+{
+  struct cons *newCons;
+
+  {
+    struct cons *p;
+    for (p = q->head; p; p = p->next)
+      // ensure unique keys
+      if (q->keyCompare(v, p->val))
+        return -1;
+  }
+
+  if ((newCons = malloc(sizeof(struct cons))) == NULL)
+    {
+      perror ( "pio_listSet: listSetAdd (): Not enough memory" );
+      /* FIXME: why not abort? */
+      return 1;
+    }
+
+  newCons->val = v;
+  newCons->next = NULL;
+
+
+  if ( q->tail != NULL)
+    q->tail->next = newCons;
+  else
+    q->head = newCons;
+
+  q->tail = newCons;
+  q->count  ++;
+
+  return 0;
+}
+
+int
+listSetRemove(listSet *q, int (*predicate)(void *, void *),
+              void *data)
+{
+  struct cons **p;
+
+  for (p = &q->head; *p; p = &(*p)->next)
+    if (predicate((*p)->val, data))
+      {
+        struct cons *rem = *p;
+        if (rem == q->tail) q->tail = NULL;
+        int iret = q->valDestroy(rem->val);
+        *p = rem->next;
+        free(rem);
+        return iret;
+      }
+  return -1;
+}
+
+void *
+listSetGet(listSet *q, int (*predicate)(void *, void *), void *data)
+{
+  struct cons *p;
+  xassert(q && predicate);
+  for (p = q->head; p; p = p->next)
+    if (predicate(p->val, data))
+      return p->val;
+  return NULL;
+}
+
+bool
+listSetIsEmpty(listSet *q)
+{
+  return q->head == NULL;
+}
+
+
+void
+listSetForeach(listSet *q, void (*func)(void *elem, void *data), void *data)
+{
+  struct cons *p;
+  for (p = q->head; p; p = p->next)
+    func(p->val, data);
+}
+
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_mpinonb.c b/libcdi/src/pio_mpinonb.c
new file mode 100644
index 0000000..f2a8f80
--- /dev/null
+++ b/libcdi/src/pio_mpinonb.c
@@ -0,0 +1,348 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+
+#include <inttypes.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <mpi.h>
+
+#include "cdi.h"
+#include "pio.h"
+#include "pio_comm.h"
+#include "pio_impl.h"
+#include "pio_util.h"
+
+extern char * command2charP[6];
+
+extern long initial_buffersize;
+
+extern double accumWait;
+
+typedef struct
+{
+  size_t size;
+  struct dBuffer *db1;
+  struct dBuffer *db2;
+  struct dBuffer *db;
+  MPI_File fh;
+  MPI_Request request;
+  int fileID;
+  int tsID;
+  bool finished;
+  char name[];
+} aFiledataM;
+
+static listSet *bibAFiledataM;
+
+static int
+fileIDTest(void *a, void *fileID)
+{
+  return ((aFiledataM *)a)->fileID == (int)(intptr_t)fileID;
+}
+
+
+/***************************************************************/
+
+static aFiledataM *initAFiledataMPINONB ( const char *filename, size_t bs )
+{
+  aFiledataM *of = NULL;
+  int iret;
+  MPI_Comm commNode = commInqCommNode ();
+
+  of = xmalloc(sizeof (*of) + strlen(filename) + 1);
+
+  strcpy(of->name, filename);
+  of->size = bs;
+  of->db1 = NULL;
+  of->db2 = NULL;
+
+  /* init output buffer */
+   
+  iret = dbuffer_init ( &( of->db1 ), of->size );
+  iret += dbuffer_init ( &( of->db2 ), of->size );
+
+  if ( iret > 0 ) xabort ( "dbuffer_init did not succeed" );
+
+  of->db = of->db1;
+
+  of->tsID = CDI_UNDEFID;
+
+  /* open file */
+  xmpi(MPI_File_open(commNode, of->name, MPI_MODE_CREATE|MPI_MODE_WRONLY,
+                     MPI_INFO_NULL, &( of->fh )));
+  of->request = MPI_REQUEST_NULL;
+  of->finished = false;
+  
+  return of;
+}
+
+/***************************************************************/
+
+int destroyAFiledataMPINONB ( void *v )
+{
+  int iret = 0;
+  aFiledataM *of;
+  MPI_Status status;
+  int rankNode = commInqRankNode ();
+  double startTime;
+  MPI_Offset endpos;
+
+  of = (aFiledataM * ) v;
+
+  xdebug ( "IOPE%d: name=%s, close file, in", 
+           rankNode, of->name );
+  
+  /* close file */
+
+  startTime = MPI_Wtime ();
+  xmpi ( MPI_Wait ( & ( of->request ), &status )); 
+  xmpi(MPI_Barrier(commInqCommNode()));
+  accumWait += ( MPI_Wtime () - startTime );
+  xmpi(MPI_File_get_position_shared(of->fh, &endpos));
+  xmpi(MPI_File_set_size(of->fh, endpos));
+  iret = MPI_File_close ( & ( of->fh ));
+
+  /* file closed, cleanup */
+  
+  dbuffer_cleanup ( & ( of->db1 ));
+  dbuffer_cleanup ( & ( of->db2 ));
+
+  free ( of );
+
+  xdebug ( "IOPE%d: closed file, cleaned up, return", 
+           rankNode );
+
+  return iret == MPI_SUCCESS ? 0 : -1;
+}
+
+/***************************************************************/
+
+static bool
+compareNamesMPINONB(void *v1, void *v2)
+{
+  aFiledataM *afm1 = v1, *afm2 = v2;
+  return !strcmp(afm1->name, afm2->name);
+}
+
+/***************************************************************/
+
+void writeMPINONB(aFiledataM *of)
+{
+  int amount;
+  MPI_Status status;
+  int rankNode = commInqRankNode ();
+  int fileID = of->fileID;
+
+  /* write buffer */
+  
+  amount = ( int ) dbuffer_data_size ( of->db );
+
+  if ( amount == 0 ) return;
+
+  xdebug3 ( "IOPI%d: Write buffer, size %d bytes, in", 
+           rankNode, amount );
+  
+  xmpi ( MPI_Wait ( & ( of->request ), &status ));
+  xmpi ( MPI_File_iwrite_shared ( of->fh, of->db->buffer, amount, MPI_CHAR, 
+                                  & ( of->request )));
+  xdebug ( "%d bytes written for fileID=%d", amount, fileID );
+
+  /* change outputBuffer */
+  
+  dbuffer_reset ( of->db );
+  
+  if ( of->db == of->db1 )
+    {
+        xdebug3 ( "IOPE%d: fileID=%d, change to buffer 2 ...", 
+                 rankNode, fileID );
+      of->db =  of->db2;
+    }
+  else 
+    {
+        xdebug3 ( "IOPE%d: fileID=%d, change to buffer 1 ...", 
+		  rankNode, fileID );
+      of->db =  of->db1;
+    }
+
+  return;
+}
+
+/***************************************************************/
+
+size_t fwMPINONB ( int fileID, int tsID, const void *buffer, size_t len )
+{  
+  int error = 0;
+  int filled = 0;
+  aFiledataM *of;
+  int rankNode = commInqRankNode ();
+
+  of = listSetGet(bibAFiledataM, fileIDTest, (void *)(intptr_t)fileID);
+  xassert(of);
+
+  bool flush = tsID != of->tsID;
+
+  if (flush)
+    {
+      xdebug3("IOPE%d: tsID = %d, flush buffer", rankNode, tsID);
+      writeMPINONB(of);
+      of->tsID = tsID;
+      MPI_Status status;
+      xmpi(MPI_Wait(&(of->request), &status));
+      xmpi(MPI_Barrier(commInqCommNode()));
+    }
+
+  filled = dbuffer_push ( of->db, ( unsigned char * ) buffer, len );
+
+  xdebug3 ( "IOPE%d: fileID = %d, tsID = %d,"
+           " pushed data on buffer, filled = %d", 
+           rankNode, fileID, tsID, filled ); 
+
+  if ( filled == 1 ) 
+    {
+      if ( flush )
+	error = filled;
+      else
+	{
+	  writeMPINONB(of);
+     
+	  error = dbuffer_push ( of->db, ( unsigned char * ) buffer, len );
+	}
+    }
+  
+  if ( error == 1 )
+    xabort("did not succeed filling output buffer, fileID=%d", fileID);
+
+  return len;
+}
+
+/***************************************************************/
+
+int fcMPINONB ( int fileID )
+{
+  aFiledataM *of;
+  int iret;
+  double accumWaitMax;
+  MPI_Comm commNode = commInqCommNode ();
+  int rankNode = commInqRankNode ();
+
+  xdebug("IOPE%d: write buffer, close file and cleanup, in %d",
+         rankNode, fileID );
+
+  if (!(of = listSetGet(bibAFiledataM, fileIDTest, (void *)(intptr_t)fileID)))
+    xabort("listSet, fileID=%d not found", fileID);
+
+  writeMPINONB(of);
+
+  /* remove file element */
+  iret = listSetRemove(bibAFiledataM, fileIDTest, (void *)(intptr_t)fileID);
+
+  /* timer output */
+
+  if ( ddebug == MAXDEBUG )
+    {
+      xmpi ( MPI_Reduce ( &accumWait, &accumWaitMax, 
+                          1, MPI_DOUBLE, MPI_MAX, 0, commNode  ));
+      xdebug ( "IOPE%d: Wait time %15.10lf s",
+               rankNode, accumWait );
+      if ( rankNode == 0 )
+          xdebug ( "IOPE%d: Max wait time %15.10lf s",
+                   rankNode, accumWaitMax );
+    }
+
+  return iret;
+}
+
+/***************************************************************/
+static void
+elemCheck(void *q, void *nm)
+{
+  aFiledataM *afm = q;
+  const char *name = nm;
+
+  if (!strcmp(name, afm->name))
+    xabort("Filename %s has already been added to set\n", name);
+}
+
+
+int fowMPINONB ( const char *filename )
+{
+  static aFiledataM *of;
+  static long buffersize = 0; 
+  int id, bcastRank = 0; 
+  MPI_Comm commNode = commInqCommNode ();
+  int rankNode = commInqRankNode ();
+
+  /* broadcast buffersize to collectors ( just once, for all files )*/
+  
+  if ( ! buffersize )
+    {
+        xdebug ( "IOPE%d: Broadcast buffersize to collectors ...", 
+		  rankNode );
+      
+      if  ( rankNode == bcastRank )
+	{ 
+	  if ( getenv( "BUFSIZE" ) != NULL )
+	    buffersize = atol ( getenv ( "BUFSIZE" ));
+	  if ( buffersize < initial_buffersize )
+	    buffersize = initial_buffersize;
+	}
+      
+      xmpi ( MPI_Bcast ( &buffersize, 1, MPI_LONG, bcastRank, commNode ));
+    }
+
+  xdebug("buffersize=%ld", buffersize);
+
+  listSetForeach(bibAFiledataM, elemCheck, (void *)filename);
+  of = initAFiledataMPINONB(filename, buffersize);
+
+  if ((id = listSetAdd(bibAFiledataM, of)) < 0 )
+    xabort("filename %s not unique", of->name);
+
+  xdebug("IOPE%d: name=%s, init and added aFiledataM, return id = %d",
+         rankNode, filename, id);
+  
+  return id;
+}
+
+/***************************************************************/
+
+void finalizeMPINONB(void)
+{
+  if (!listSetIsEmpty(bibAFiledataM))
+    xabort("set bibAFiledataM not empty");
+  else
+    {
+      xdebug("%s", "destroy set");
+      listSetDelete(bibAFiledataM);
+    }
+}
+
+/***************************************************************/
+
+void initMPINONB ( void )
+{
+  commDefCommColl ( 1 );
+  commSendNodeInfo ();
+  commRecvNodeMap ();
+  commDefCommsIO ();
+
+  bibAFiledataM = listSetNew( destroyAFiledataMPINONB, compareNamesMPINONB );
+  
+  if ( bibAFiledataM == NULL )
+    xabort ( "listSetNew did not succeed" );   
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_posixasynch.c b/libcdi/src/pio_posixasynch.c
new file mode 100644
index 0000000..6fe3dad
--- /dev/null
+++ b/libcdi/src/pio_posixasynch.c
@@ -0,0 +1,424 @@
+/* 
+   todo  
+   README: specialRank Pe closes down, when all output files are closed    
+*/
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+
+#ifdef USE_MPI
+#ifndef _SX
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <errno.h>
+
+#include <aio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#include "mpi.h"
+#include "pio.h"
+#include "pio_comm.h"
+#include "pio_impl.h"
+#include "pio_util.h"
+
+extern char * command2charP[6];
+
+extern char *token;
+
+extern double accumSuspend;
+extern double accumWrite;
+
+
+typedef struct
+{
+  struct dBuffer *fb;
+  struct aiocb *ctrlBlks;
+  off_t offset;
+  int currOpIndex;
+  int nextOpIndex;
+  int prefIndex;
+  int activeCollectors;
+  int handle, fileID;
+  char name[];
+} bFiledataPA;
+
+static int
+fileIDTest(void *a, void *fileID)
+{
+  return ((bFiledataPA *)a)->fileID == (int)(intptr_t)fileID;
+}
+
+int nPrefStreams = 4;
+
+/***************************************************************/
+
+static bFiledataPA *
+initBFiledataPA(char *filename, size_t bs, int nc)
+{
+  bFiledataPA *bfd;
+  int i;
+
+  xdebug ( "filename=%s, buffersize=%zu, ncollectors=%d, nPrefetchStreams=%d",
+           filename, bs, nc, nPrefStreams );
+
+  bfd = xmalloc( sizeof (*bfd) + strlen(filename) + 1);
+  strcpy(bfd->name, filename);
+
+  if (( bfd->handle = open ( bfd->name, O_CREAT | O_WRONLY, 0666 )) == -1 )
+    xabort("Failed to open %s", bfd->name);
+
+  dbuffer_init(&(bfd->fb), (size_t)(nPrefStreams * bs));
+
+  bfd->ctrlBlks = xcalloc(nPrefStreams, sizeof (bfd->ctrlBlks[0]));
+
+  for ( i = 0; i < nPrefStreams; i++ )
+    {
+      bfd->ctrlBlks[i].aio_fildes     = bfd->handle;
+      bfd->ctrlBlks[i].aio_buf = bfd->fb->buffer + i * bs;
+      bfd->ctrlBlks[i].aio_reqprio    = 0;
+      bfd->ctrlBlks[i].aio_sigevent.sigev_notify = SIGEV_NONE;   
+    }
+  
+  bfd->nextOpIndex = 0;
+  bfd->prefIndex = 0; 
+  bfd->offset = 0;
+  bfd->activeCollectors = nc;
+
+  xdebug ( "filename=%s, opened file, return", bfd->name );
+
+  return bfd;
+}
+
+/***************************************************************/
+
+static int
+destroyBFiledataPA ( void *v )
+{
+  bFiledataPA *bfd = (bFiledataPA * ) v;
+  const struct aiocb *ccBP[1];
+  int iret = 0;
+  ssize_t ssiret;
+  int nextFinishOp = (bfd->nextOpIndex - bfd->prefIndex + nPrefStreams)
+    % nPrefStreams;
+  double startTime;
+
+  xdebug ( "filename=%s, cleanup and close file", bfd->name );
+
+  /* close file */
+
+  for (; bfd->prefIndex > 0 ; --(bfd->prefIndex))
+    {
+      xdebug("file: %s, prefIndex=%d", bfd->name, (int)bfd->prefIndex);
+      ccBP[0] = ( bfd->ctrlBlks + nextFinishOp );
+
+      if ( ddebug )
+	startTime = MPI_Wtime ();
+
+      do
+	{
+	  iret = aio_suspend ( ccBP, 1, NULL );
+	  if ( iret < 0 && errno != EINTR ) xabort ( "aio_suspend () failed" );
+	}
+      while ( iret != 0 );
+
+      if ( ddebug )
+	accumSuspend += ( MPI_Wtime () - startTime);
+
+      iret = aio_error(bfd->ctrlBlks + nextFinishOp);
+      if (( ssiret = aio_return ( bfd->ctrlBlks + nextFinishOp )) == -1 )
+	xabort("aio_return () failed: %s", strerror(iret));
+
+      nextFinishOp = ( nextFinishOp + 1 ) % nPrefStreams;
+    }
+
+  if ((iret = ftruncate(bfd->handle, bfd->offset)) == -1)
+    xabort("failed to truncate file %s: %s", bfd->name, strerror(errno));
+  if (( iret = close ( bfd->handle )) == -1 )
+    xabort("failed to close %s", bfd->name);
+
+  /* file closed, cleanup */
+
+  dbuffer_cleanup ( &( bfd->fb ));
+
+  free(bfd->ctrlBlks);
+  free(bfd);
+
+  xdebug("%s", "closed file and cleaned up, return");
+
+  return iret;
+}
+
+/***************************************************************/
+
+static bool
+compareNamesBPA(void *v1, void *v2)
+{
+  bFiledataPA *bfd1 = v1, *bfd2 = v2;
+
+  return !strcmp(bfd1->name, bfd2->name);
+}
+
+/***************************************************************/
+
+static void
+writePA(bFiledataPA *bfd, long amount)
+{
+  const struct aiocb *ccBP[1];
+  int iret;
+  double startTime;
+
+  xdebug ( "file %s, in", bfd->name );
+  
+  bfd->ctrlBlks[bfd->currOpIndex].aio_nbytes = amount;
+  bfd->ctrlBlks[bfd->currOpIndex].aio_offset = bfd->offset;
+
+  xdebug ( " before aio_write(), file %s, aio_nbytes=%zu, aio_offset=%zu",
+           bfd->name, bfd->ctrlBlks[bfd->currOpIndex].aio_nbytes,
+           bfd->ctrlBlks[bfd->currOpIndex].aio_offset );
+
+  if ( ddebug ) startTime = MPI_Wtime ();
+
+  iret = aio_write ( bfd->ctrlBlks + bfd->currOpIndex );
+
+  if ( ddebug ) accumWrite += ( MPI_Wtime () - startTime);
+
+  xdebug ( "after aio_write(), file %s, aio_nbytes=%zu, aio_offset=%zu,"
+           "iret=aio_write()=%d",
+           bfd->name, bfd->ctrlBlks[bfd->currOpIndex].aio_nbytes,
+           bfd->ctrlBlks[bfd->currOpIndex].aio_offset, iret );
+   
+  if ( iret == -1 ) 
+    {
+      xabort ( "did not succeed writing buffer" );
+    }
+  else
+    xdebug ( "buffer written to %s",  bfd->name );
+     
+  bfd->offset += ( off_t ) amount;
+  bfd->prefIndex ++;
+
+  if ( bfd->prefIndex >= nPrefStreams ) 
+    {
+      ccBP[0] = ( bfd->ctrlBlks + bfd->nextOpIndex );
+
+      if ( ddebug )
+	startTime = MPI_Wtime ();
+
+      do
+	{
+	  iret = aio_suspend ( ccBP, 1, NULL );
+	  if ( iret < 0 && errno != EINTR )
+	    xabort ( "aio_suspend () failed" );
+	} while ( iret != 0 );
+
+      if ( ddebug )
+	accumSuspend += ( MPI_Wtime () - startTime);
+	      
+      if (( iret = aio_return ( bfd->ctrlBlks + bfd->nextOpIndex )) == -1 ) 
+	xabort ( "aio_return () failed" );
+
+      bfd->prefIndex --;
+    }
+
+  xdebug ( "filename=%s, prefIndex=%d, return", bfd->name, bfd->prefIndex );
+}
+
+/***************************************************************/
+static void
+elemCheck(void *q, void *nm)
+{
+  bFiledataPA *bfd = q;
+  const char *name = nm;
+
+  if (!strcmp(name, bfd->name))
+    xabort("Filename %s has already been inserted\n", name);
+}
+
+/***************************************************************/
+
+void pioWriterAIO(void)
+{
+  bFiledataPA *bfd; 
+  listSet * bibBFiledataPA;
+  long amount, buffersize;
+  char *messageBuffer, *pMB, *filename, *temp;
+  int messagesize, source, tag, id;
+  struct fileOpTag rtag;
+  MPI_Status status;
+  MPI_Comm commNode = commInqCommNode ();
+  int nProcsCollNode = commInqSizeNode () - commInqSizeColl ();
+  bool * sentFinalize, doFinalize;
+
+  if ( nPrefStreams < 1 ) xabort("USAGE: # PREFETCH STREAMS >= 1");
+  xdebug ( "nProcsCollNode=%d on this node", nProcsCollNode );
+ 
+  bibBFiledataPA = listSetNew(destroyBFiledataPA, compareNamesBPA);
+  sentFinalize = xmalloc ( nProcsCollNode * sizeof ( sentFinalize ));
+  
+  for ( ;; )
+    {   
+      xmpiStat ( MPI_Probe ( MPI_ANY_SOURCE, MPI_ANY_TAG, commNode, 
+                             &status ), &status );
+
+      source = status.MPI_SOURCE;
+      tag    = status.MPI_TAG;
+      rtag = decodeFileOpTag(tag);
+
+      xmpi ( MPI_Get_count ( &status, MPI_CHAR, &messagesize ));
+
+      xdebug ( "receive message from source=%d, id=%d, command=%d ( %s ), "
+               "messagesize=%d", source, rtag.id, rtag.command,
+               command2charP[rtag.command], messagesize);
+
+      switch (rtag.command)
+	{
+      	case IO_Open_file:
+
+	  messageBuffer = ( char *) xmalloc ( messagesize * 
+                                              sizeof ( messageBuffer[0] ));
+	  pMB = messageBuffer;
+
+	  xmpi ( MPI_Recv ( messageBuffer, messagesize, MPI_CHAR, source, 
+                            tag, commNode, &status ));
+
+	  filename = strtok ( pMB, token );
+	  pMB += ( strlen ( filename ) + 1 );
+	  temp =  strtok ( pMB, token );
+	  buffersize =  strtol ( temp, NULL, 16 );
+	  pMB += ( strlen ( temp ) + 1 );
+	  amount = ( long ) ( messageBuffer + messagesize - pMB );
+
+	  xdebug("command  %s, filename=%s, buffersize=%ld, amount=%ld",
+                 command2charP[rtag.command], filename, buffersize, amount);
+
+          if (!(bfd = listSetGet(bibBFiledataPA, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+	    {
+              listSetForeach(bibBFiledataPA, elemCheck, filename);
+	      bfd = initBFiledataPA(filename, buffersize, nProcsCollNode);
+              if ((id = listSetAdd(bibBFiledataPA, bfd)) < 0)
+                xabort("fileID=%d not unique", rtag.id);
+	    }
+	  else
+	    if (strcmp(filename, bfd->name) != 0)
+              xabort("filename is not consistent, fileID=%d", rtag.id);
+
+	  bfd->currOpIndex = bfd->nextOpIndex;
+	  bfd->nextOpIndex = ( bfd->nextOpIndex + 1 ) % nPrefStreams;
+
+          xassert(amount >= 0);
+	  memcpy((void *)bfd->ctrlBlks[bfd->currOpIndex].aio_buf,
+                 pMB, (size_t)amount);
+
+	  writePA ( bfd, amount );
+
+	  free ( messageBuffer );
+
+	  break;
+
+	case IO_Send_buffer:
+
+          if (!(bfd = listSetGet(bibBFiledataPA, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileID=%d is not in set", rtag.id);
+
+	  amount = messagesize;
+
+	  xdebug("command: %s, id=%d, name=%s",
+                 command2charP[rtag.command], rtag.id, bfd->name );
+
+	  bfd->currOpIndex = bfd->nextOpIndex;
+	  bfd->nextOpIndex = ( bfd->nextOpIndex + 1 ) % nPrefStreams;
+	  
+	  xmpi(MPI_Recv((void *)bfd->ctrlBlks[bfd->currOpIndex].aio_buf,
+                        amount, MPI_CHAR, source, tag, commNode, &status ));
+
+	  writePA ( bfd, amount );
+	  
+	  break;
+
+	case IO_Close_file:
+
+          if (!(bfd = listSetGet(bibBFiledataPA, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileID=%d is not in set", rtag.id);
+
+	  amount = messagesize;
+
+	  xdebug(" command %s, id=%d, name=%s",
+                 command2charP[rtag.command], rtag.id, bfd->name);
+
+	  bfd->currOpIndex = bfd->nextOpIndex;
+
+	  bfd->nextOpIndex = ( bfd->nextOpIndex + 1 ) % nPrefStreams;
+
+	  MPI_Recv((void *)bfd->ctrlBlks[bfd->currOpIndex].aio_buf,
+                   amount, MPI_CHAR, source, tag, commNode, &status);
+
+	  writePA ( bfd, amount );
+
+	  if ( ! --(bfd->activeCollectors))
+	    {
+              xdebug ( "all are finished with file %d, delete node", rtag.id);
+              listSetRemove(bibBFiledataPA, fileIDTest,
+                            (void *)(intptr_t)rtag.id);
+	    }
+          break;
+        case IO_Finalize:
+          {
+            int buffer = CDI_UNDEFID, collID;
+
+            xmpi ( MPI_Recv ( &buffer, 1, MPI_INT, source, tag, commNode, &status ));
+            sentFinalize[source] = true;
+            doFinalize = true;
+            for ( collID = 0; collID < nProcsCollNode; collID++ )
+              if ( !sentFinalize[collID] ) 
+                {
+                  doFinalize = false;
+                  break;
+                }
+            if ( doFinalize )
+              {
+                if (!listSetIsEmpty(bibBFiledataPA))
+                  xabort("Set bibBfiledataP is not empty.");
+                else
+                  {
+                    xdebug("%s", "all files are finished, destroy set,"
+                           " return");
+                    listSetDelete(bibBFiledataPA);
+                  }
+                return;
+              }
+          }
+
+          break;
+        default:
+          xabort ( "COMMAND NOT IMPLEMENTED" );
+	}
+    }
+}
+
+
+
+/***************************************************************/
+
+/***************************************************************/
+
+
+#endif
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_posixfpguardsendrecv.c b/libcdi/src/pio_posixfpguardsendrecv.c
new file mode 100644
index 0000000..9b067e8
--- /dev/null
+++ b/libcdi/src/pio_posixfpguardsendrecv.c
@@ -0,0 +1,555 @@
+/* 
+   todo 
+   build in control, for consistance of pairs filename / filenumber 
+   ( pioOpenFile member name, recv in tmpbuffer, if(!uniqueName(q,v,n))abort )
+*/
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+
+#include <inttypes.h>
+#include <stdio.h>
+#include <stdbool.h>
+#include <string.h>
+
+#include "mpi.h"
+#include "pio.h"
+#include "pio_comm.h"
+#include "pio_impl.h"
+#include "pio_util.h"
+
+
+extern char * command2charP[6];
+
+extern long initial_buffersize;
+
+typedef struct
+{
+  struct dBuffer *db1;
+  struct dBuffer *db2;
+  struct dBuffer *db;
+  FILE *fp;
+  IO_Server_command command;
+  int tsID, fileID;
+  char name[];
+} aFiledataPF;
+
+static int
+fileIDTestA(void *a, void *fileID)
+{
+  return ((aFiledataPF *)a)->fileID == (int)(intptr_t)fileID;
+}
+
+typedef struct
+{
+  long offset;
+  bool finished;
+  bool *nfinished;
+  int fileID;
+} bFiledataPF;
+
+static int
+fileIDTestB(void *a, void *fileID)
+{
+  return ((bFiledataPF *)a)->fileID == (int)(intptr_t)fileID;
+}
+
+static bool
+fileIDCmpB(void *a, void *b)
+{
+  return ((bFiledataPF *)a)->fileID == ((bFiledataPF *)b)->fileID;
+}
+
+static listSet *bibAFiledataPF;
+
+/***************************************************************/
+  
+static aFiledataPF *initAFiledataPF ( const char *key, size_t bs)
+{
+  aFiledataPF *afd;
+  size_t len;
+  int iret;
+
+  len = strlen(key);
+  afd = xcalloc(1, sizeof (*afd) + len + 1);
+  strcpy(afd->name, key);
+  afd->tsID = 0;
+
+  /* init output buffer */
+
+  xdebug ( " name=%s, init output buffer",  afd->name );
+   
+  iret = dbuffer_init(&(afd->db1), bs);
+  iret += dbuffer_init(&(afd->db2), bs);
+
+  if ( iret > 0 )
+    xabort("dbuffer_init did not succeed");
+
+  afd->db = afd->db1;
+
+  /* open file */ 
+  xdebug ( "name=%s, open file",  afd->name );
+
+  if ( ( afd->fp = fopen ( afd->name, "w" )) == NULL ) 
+    xabort("Failed to open %s", afd->name);
+
+  afd->command = IO_Open_file;
+  
+  return afd;
+}
+
+/***************************************************************/
+static bFiledataPF *
+initBFiledataPF(int key, int nc)
+{
+  bFiledataPF *bfd;
+  int i;
+
+  bfd = ( bFiledataPF * ) xmalloc ( sizeof ( bFiledataPF ));
+  memset ( bfd, 0, sizeof ( bFiledataPF ));
+  bfd->offset = 0;
+  bfd->finished = false;
+  bfd->nfinished = ( bool * ) xmalloc ( nc * sizeof ( bool ));
+
+  for ( i = 0; i < nc; i++ )
+    *( bfd->nfinished + i ) = true;
+
+  return bfd;
+}
+
+/***************************************************************/
+
+static int
+destroyAFiledataPF(void *v)
+{
+  int iret = 0;
+  aFiledataPF *afd = ( aFiledataPF * ) v;
+
+  /* close file */
+  xdebug("name=%s, close file", afd->name);
+  if ((iret = fclose(afd->fp)) == EOF)
+    xabort("Failed to close %s", afd->name);
+
+  /* file closed, cleanup */
+  xdebug("name=%s, file closed, cleanup ...",  afd->name);
+  dbuffer_cleanup(&(afd->db1));
+  dbuffer_cleanup(&(afd->db2));
+
+  free(afd);
+
+  return iret;
+}
+
+/***************************************************************/
+
+static int
+destroyBFiledataPF(void *v)
+{
+  int iret = 0;
+  bFiledataPF *bfd = (bFiledataPF * ) v;
+  
+  free ( bfd->nfinished );
+  free ( bfd );
+
+  return iret;
+}
+
+/***************************************************************/
+
+static bool
+compareNamesAPF(void *v1, void *v2)
+{
+  aFiledataPF *afd1 = v1, *afd2 = v2;
+
+  return !strcmp(afd1->name, afd2->name);
+}
+
+/***************************************************************/
+
+void fpgPOSIXFPGUARDSENDRECV ( void )
+{
+  int i, source, iret;
+  struct fileOpTag rtag;
+  MPI_Status status;
+  bFiledataPF *bfd; 
+  listSet *bibBFiledataPF;
+  long amount;
+  MPI_Comm commNode = commInqCommNode ();
+  int nProcsCollNode =  commInqSizeNode () - commInqSizeColl ();
+  bool * sentFinalize, doFinalize = false;
+
+  xdebug ( "ncollectors=%d on this node", nProcsCollNode );
+  
+  bibBFiledataPF = listSetNew( destroyBFiledataPF, fileIDCmpB);
+  sentFinalize = xmalloc ( nProcsCollNode * sizeof ( sentFinalize[0] ));
+
+  for ( ;; )
+    {
+      xmpi ( MPI_Probe ( MPI_ANY_SOURCE, MPI_ANY_TAG, commNode, &status ));
+      source = status.MPI_SOURCE;
+      rtag = decodeFileOpTag(status.MPI_TAG);
+      
+      xdebug("receive message from source=%d, id=%d, command=%d ( %s )",
+             source, rtag.id, rtag.command, command2charP[rtag.command]);
+      
+      switch (rtag.command)
+      	{
+      	case IO_Open_file:
+
+          if (!(bfd = listSetGet(bibBFiledataPF, fileIDTestB,
+                               (void *)(intptr_t)rtag.id)))
+	    {
+	      bfd = initBFiledataPF(rtag.id, nProcsCollNode);
+
+	      if ((iret = listSetAdd(bibBFiledataPF, bfd)) < 0)
+		xabort("fileID=%d not unique", rtag.id);
+	    }
+
+	  *( bfd->nfinished + source ) = false;
+
+          xdebug("id=%d, command=%d ( %s ), send offset=%ld", rtag.id,
+                 rtag.command, command2charP[rtag.command], bfd->offset);
+	  
+	  xmpi ( MPI_Sendrecv ( &( bfd->offset ), 1, MPI_LONG, source,  status.MPI_TAG,
+                                &amount, 1, MPI_LONG, source,  status.MPI_TAG,
+                                commNode, &status ));
+
+	  bfd->offset += amount; 
+ 
+          xdebug("id=%d, command=%d ( %s ), recv amount=%ld, set offset=%ld",
+                 rtag.id, rtag.command, command2charP[rtag.command], amount,
+                 bfd->offset);
+
+	  break;
+
+	case IO_Set_fp:
+
+          if (!(bfd = listSetGet(bibBFiledataPF, fileIDTestB,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileId=%d not in set", rtag.id);
+
+          xdebug("id=%d, command=%d ( %s ), send offset=%ld", rtag.id,
+                 rtag.command, command2charP[rtag.command], bfd->offset);
+
+	  xmpi ( MPI_Sendrecv ( &( bfd->offset ), 1, MPI_LONG, source,  status.MPI_TAG,
+                                &amount, 1, MPI_LONG, source,  status.MPI_TAG,
+                                commNode, &status ));
+
+	  bfd->offset += amount;
+
+          xdebug("id=%d, command=%d ( %s ), recv amount=%ld, set offset=%ld",
+                 rtag.id, rtag.command, command2charP[rtag.command], amount,
+                 bfd->offset);
+
+	  break;
+
+	case IO_Close_file:
+
+          if (!(bfd = listSetGet(bibBFiledataPF, fileIDTestB,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileId=%d not in set", rtag.id);
+
+          xdebug("id=%d, command=%d ( %s )), send offset=%ld", rtag.id,
+                 rtag.command, command2charP[rtag.command], bfd->offset);
+
+	  xmpi ( MPI_Sendrecv ( &( bfd->offset ), 1, MPI_LONG, source,  status.MPI_TAG,
+                                &amount, 1, MPI_LONG, source,  status.MPI_TAG,
+                                commNode, &status ));
+
+	  bfd->offset += amount;
+
+          xdebug("id=%d, command=%d ( %s ), recv amount=%ld, set offset=%ld",
+                 rtag.id, rtag.command, command2charP[rtag.command], amount,
+                 bfd->offset);
+
+
+	  bfd->nfinished[source] = true;  
+	  bfd->finished          = true;
+	  
+	  for ( i = 0; i < nProcsCollNode; i++ )
+	    if ( !( bfd->nfinished[i] ))
+	      {
+		bfd->finished = false;
+		break;
+	      }
+
+	  if ( bfd->finished )
+            listSetRemove(bibBFiledataPF, fileIDTestB,
+                          (void *)(intptr_t)rtag.id);
+          break;
+        case IO_Finalize:
+          {  
+            int buffer = CDI_UNDEFID, collID; 
+
+            xmpi ( MPI_Recv ( &buffer, 1, MPI_INT, source, status.MPI_TAG,
+                              commNode, &status ));
+            sentFinalize[source] = true;
+            doFinalize = true;
+            for ( collID = 0; collID < nProcsCollNode; collID++ )
+              if ( !sentFinalize[collID] ) 
+                {
+                  doFinalize = false;
+                  break;
+                }
+            if ( doFinalize )
+              {
+                if (!listSetIsEmpty(bibBFiledataPF))
+                  xabort("set bibBFiledataM not empty");
+                else
+                  {
+                    xdebug("%s", "destroy set");
+                    listSetDelete(bibBFiledataPF);
+                  }
+                return;
+              }
+          }
+          break;
+        default:
+          xabort ( "COMMAND NOT IMPLEMENTED" );
+	}
+    }
+}   
+
+//*******************************************************
+
+static void
+writePF(aFiledataPF *afd)
+{
+  size_t amount, written;
+  long offset;
+  long amountL;
+  int error, tag;
+  MPI_Status status;
+  int specialRank = commInqSpecialRankNode ();
+  MPI_Comm commNode = commInqCommNode ();
+  
+  /* send buffersize, recv offset */
+
+  amount = dbuffer_data_size ( afd->db );
+  amountL = ( long ) amount;
+  int id = afd->fileID;
+  tag = encodeFileOpTag(id, afd->command);
+  
+  xmpi ( MPI_Sendrecv ( &amountL, 1, MPI_LONG, specialRank, tag,
+                        &offset, 1, MPI_LONG, specialRank, tag,
+                        commNode, &status ));
+  xdebug ( "id=%d, command=%d, amount=%zu, send amountL=%ld, recv offset=%ld", 
+           id, afd->command, amount, amountL, offset );
+  
+  /* write buffer */
+  
+  if (( error = fseek ( afd->fp, offset, SEEK_SET )) != 0 )
+    xabort ( "did not succeed seeking fp" );
+
+  if (( written = 
+	fwrite ( afd->db->buffer, sizeof ( char ), amount, afd->fp )) !=
+      amount )
+    xabort("fileId=%d, expect to write %zu byte, written %zu byte",
+           id, amount, written);
+ 
+  xdebug("written %zu bytes in file %d with offset %ld",
+         written, id, offset);
+  
+  /* change outputBuffer */
+  
+  dbuffer_reset ( afd->db );
+  
+  if ( afd->db == afd->db1 )
+    {
+      xdebug ( "id=%d, change to buffer 2 ...", id );
+      afd->db =  afd->db2;
+    }
+  else 
+    {
+      xdebug ( "id=%d, change to buffer 1 ...", id );
+      afd->db =  afd->db1;
+    }
+  
+  afd->command = IO_Set_fp;
+}
+
+
+/***************************************************************/
+
+static void
+defTimestepPF(aFiledataPF *afd, int tsID)
+{
+  if ( afd == NULL || tsID < 0 || tsID != afd->tsID + 1 ) 
+    xabort ( " defTimestepPF() didn't succeed." );
+  afd->tsID = tsID;
+}
+
+
+/***************************************************************/
+
+static void
+flushOp(aFiledataPF *a, int tsID)
+{
+  writePF(a);
+  defTimestepPF(a, tsID);
+}
+
+
+size_t fwPOSIXFPGUARDSENDRECV( int fileID, int tsID, const void *buffer, size_t len )
+{
+  int error = 0;
+  int filled = 0;
+  aFiledataPF *afd
+    = listSetGet(bibAFiledataPF, fileIDTestA, (void *)(intptr_t)fileID);
+
+  bool flush = tsID != afd->tsID;
+
+  if (flush)
+    {
+      xdebug("fileID %d, tsID = %d, flush buffer", fileID, tsID);
+      flushOp(afd, tsID);
+      xmpi ( MPI_Barrier ( commInqCommColl ())); 
+    }
+
+  filled = dbuffer_push(afd->db, ( unsigned char * ) buffer, len);
+
+  xdebug ( "fileID = %d, tsID = %d, pushed data on buffer, filled = %d", 
+           fileID, tsID, filled ); 
+
+  if ( filled == 1 ) 
+    {
+      if ( flush )
+	error = filled;
+      else
+	{
+	  writePF(afd);
+     
+	  error = dbuffer_push ( afd->db, ( unsigned char * ) buffer, len );
+	}
+    }
+  
+  if ( error == 1 )
+    xabort("did not succeed filling output buffer, fileID=%d", fileID);
+  
+  return len;
+}
+
+/***************************************************************/
+
+int fcPOSIXFPGUARDSENDRECV ( int id )
+{
+  aFiledataPF *afd;
+  int iret;
+
+  xdebug("write buffer, close file %d and cleanup", id);
+
+  afd = listSetGet(bibAFiledataPF, fileIDTestA, (void *)(intptr_t)id);
+
+  afd->command = IO_Close_file;
+
+  writePF(afd);
+
+  /* remove file element */
+  iret = listSetRemove(bibAFiledataPF, fileIDTestA, (void *)(intptr_t)id);
+  /* make sure the file is closed on all collectors before proceeding */
+  xmpi(MPI_Barrier(commInqCommColl()));
+  return iret;
+}
+
+/***************************************************************/
+static void
+elemCheck(void *q, void *nm)
+{
+  aFiledataPF *afd = q;
+  const char *name = nm;
+
+  if (!strcmp(name, afd->name))
+    xabort("Filename %s has already been added to set\n", name);
+}
+
+int fowPOSIXFPGUARDSENDRECV ( const char *filename )
+{
+  int root = 0, id;
+  aFiledataPF *afd;
+  static long buffersize = 0;
+
+  /* broadcast buffersize to collectors */
+  if (!buffersize)
+    {
+      if (commInqRankColl() == root)
+	{
+          xdebug("name=%s, broadcast buffersize to collectors ...",
+                 filename);
+	  if ( getenv( "BUFSIZE" ) != NULL )
+	    buffersize = atol ( getenv ( "BUFSIZE" ));
+	  if ( buffersize < initial_buffersize )
+	    buffersize = initial_buffersize;
+	}
+      xmpi(MPI_Bcast(&buffersize, 1, MPI_LONG, root, commInqCommColl()));
+    }
+
+  /* init and add file element */
+  listSetForeach(bibAFiledataPF, elemCheck, (void *)filename);
+
+  afd = initAFiledataPF ( filename, buffersize );
+
+  if ((id = listSetAdd(bibAFiledataPF, afd)) < 0)
+    xabort("filename %s not unique", afd->name);
+
+  xdebug("name=%s, init and add aFiledataPF, return id = %d",
+         filename, id);
+  return id;
+}
+
+/***************************************************************/
+
+void
+finalizePOSIXFPGUARDSENDRECV(void)
+{
+  int buffer = 0, tag = encodeFileOpTag(0, IO_Finalize);
+
+  xmpi(MPI_Send(&buffer, 1, MPI_INT, commInqSpecialRankNode(),
+                tag, commInqCommNode()));
+
+  if (!listSetIsEmpty(bibAFiledataPF))
+    xabort("set bibAFiledataM not empty");
+  else
+    {
+      xdebug("%s", "destroy set");
+      listSetDelete(bibAFiledataPF);
+    }
+}
+
+/***************************************************************/
+
+void initPOSIXFPGUARDSENDRECV ( void )
+{
+  if ( commInqSizeNode () < 2 ) 
+    xabort ( "USAGE: # IO PROCESSES ON A PHYSICAL NODE >= 2" );
+  
+  if ( commInqRankNode () == commInqSpecialRankNode ()) 
+    {
+      commDefCommColl ( 0 );
+      commSendNodeInfo ();
+      commRecvNodeMap ();
+      commDefCommsIO ();
+      fpgPOSIXFPGUARDSENDRECV ();
+    }
+  else
+    {
+      commDefCommColl ( 1 );
+      commSendNodeInfo ();
+      commRecvNodeMap ();
+      commDefCommsIO ();
+      bibAFiledataPF = listSetNew( destroyAFiledataPF, compareNamesAPF );
+    }
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_posixnonb.c b/libcdi/src/pio_posixnonb.c
new file mode 100644
index 0000000..33e80f2
--- /dev/null
+++ b/libcdi/src/pio_posixnonb.c
@@ -0,0 +1,299 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "mpi.h"
+#include "pio.h"
+#include "pio_comm.h"
+#include "pio_impl.h"
+#include "pio_util.h"
+
+extern char * command2charP[6];
+
+extern char *token;
+
+typedef struct
+{
+  struct dBuffer *fb;
+  FILE *fp;
+  int fileID;
+  int activeCollectors;
+  char name[];
+} bFiledataP;
+
+static int
+fileIDTest(void *a, void *fileID)
+{
+  return ((bFiledataP *)a)->fileID == (int)(intptr_t)fileID;
+}
+
+/***************************************************************/
+
+static bFiledataP *
+initBFiledataP(char *filename, size_t bs, int nc, int fileID)
+{
+  bFiledataP * bfp;
+
+  xdebug ( "filename=%s, buffersize=%lu, ncollectors=%d", filename, bs, nc );
+
+  bfp = xmalloc(sizeof (*bfp) + strlen(filename) + 1);
+  strcpy(bfp->name, filename);
+
+  if (( bfp->fp = fopen ( filename, "w" )) == NULL ) 
+    xabort("Failed to open %s", bfp->name);
+  int fd = fileno(bfp->fp);
+  ftruncate(fd, (off_t)0);
+  dbuffer_init(&bfp->fb, bs);
+
+  bfp->activeCollectors = nc;
+
+  bfp->fileID = fileID;
+
+  xdebug ( "filename=%s, opened file, return", bfp->name );
+
+  return bfp;
+}
+
+/***************************************************************/
+
+static int
+destroyBFiledataP(void *v)
+{
+  int iret = 0;
+  bFiledataP *bfp = ( bFiledataP * ) v;
+
+  xdebug ( "filename=%s, cleanup, in",  bfp->name );
+
+  /* close file */
+  if (( iret = fclose ( bfp->fp )) == EOF )
+    xabort("Failed to close %s", bfp->name);
+
+  /* file closed, cleanup */
+
+  dbuffer_cleanup ( &( bfp->fb ));
+
+  free(bfp);
+
+  xdebug("%s", "cleaned up, return");
+
+  return iret;
+}
+
+/***************************************************************/
+
+static bool
+compareNamesBP(void *v1, void *v2)
+{
+  bFiledataP *bfd1 = v1, *bfd2 = v2;
+
+  return !strcmp(bfd1->name, bfd2->name);
+}
+
+/***************************************************************/
+
+static void
+writeP(bFiledataP *bfd, long amount)
+{
+  long written;
+
+  xdebug ( "filename=%s, amount=%ld, in", bfd->name, amount );
+
+  if (( written = fwrite ( bfd->fb->buffer, 1, amount,
+			   bfd->fp )) != amount )
+    xabort("did not succeed writing buffer in %s", bfd->name);
+
+  xdebug ( "filename=%s, written=%ld, amount=%ld, return",
+           bfd->name, written, amount );
+}
+
+/***************************************************************/
+static void
+elemCheck(void *q, void *nm)
+{
+  bFiledataP *bfd = q;
+  const char *name = nm;
+
+  if (!strcmp(name, bfd->name))
+    xabort("Filename %s has already been added to the set\n", name);
+}
+
+void
+pioWriterStdIO(void)
+{
+  bFiledataP *bfd; 
+  listSet * bibBFiledataP;
+  size_t amount, buffersize;
+  char *messageBuffer = NULL;
+  char *pMB, *filename, *temp;
+  int messagesize, source, tag, id;
+  struct fileOpTag rtag;
+  MPI_Status status;
+  MPI_Comm commNode = commInqCommNode ();
+  int nProcsCollNode = commInqSizeNode () - commInqSizeColl ();
+  bool * sentFinalize, doFinalize;
+
+  xdebug ( "ncollectors=%d on this node", nProcsCollNode );
+
+  bibBFiledataP = listSetNew(destroyBFiledataP, compareNamesBP);
+  sentFinalize = xmalloc ( nProcsCollNode * sizeof ( sentFinalize ));
+  
+  for ( ;; )
+    {  
+        
+      xmpiStat ( MPI_Probe ( MPI_ANY_SOURCE, MPI_ANY_TAG, commNode, 
+                             &status ), &status );
+      
+      
+      source = status.MPI_SOURCE;
+      tag    = status.MPI_TAG;
+      
+      rtag = decodeFileOpTag(tag);
+      
+      xmpi ( MPI_Get_count ( &status, MPI_CHAR, &messagesize ));
+
+      xdebug ( "RECEIVE MESSAGE FROM SOURCE=%d, ID=%d, COMMAND=%d ( %s ),"
+               "MESSAGESIZE=%d", source, rtag.id, rtag.command,
+               command2charP[rtag.command], messagesize);
+
+      switch (rtag.command)
+	{
+      	case IO_Open_file:
+
+	  messageBuffer = xmalloc ( messagesize  * sizeof ( messageBuffer[0] ));
+    	  pMB = messageBuffer;
+
+	  xmpi ( MPI_Recv ( messageBuffer, messagesize, MPI_CHAR, source, 
+                            tag, commNode, &status ));
+
+	  xdebug("%s", "after recv, in loop");
+	  
+	  filename = strtok ( pMB, token );
+	  pMB += ( strlen ( filename ) + 1 );
+	  temp =  strtok ( pMB, token );
+          buffersize =  strtol ( temp, NULL, 16 );
+	  pMB += ( strlen ( temp ) + 1 );
+	  amount = (size_t)(messageBuffer + messagesize - pMB);
+	  
+	  xdebug("command %s, filename=%s, buffersize=%zu, amount=%zu",
+                 command2charP[rtag.command], filename, buffersize, amount);
+	  
+	  
+          if (!(bfd = listSetGet(bibBFiledataP, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+	    {
+	      listSetForeach(bibBFiledataP, elemCheck, filename);
+	      bfd = initBFiledataP(filename, buffersize, nProcsCollNode,
+                                   rtag.id);
+	      
+	      if ((id = listSetAdd(bibBFiledataP, bfd)) < 0)
+                xabort("fileID=%d not unique", rtag.id);
+	    }
+	  else
+	    if (strcmp(filename, bfd->name) != 0)
+              xabort("filename is not consistent, fileID=%d", rtag.id);
+
+	  memcpy(bfd->fb->buffer, pMB, amount);
+
+	  writeP(bfd, amount);
+	  
+	  free ( messageBuffer );
+
+	  break;
+
+	case IO_Send_buffer:
+
+          if (!(bfd = listSetGet(bibBFiledataP, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileID=%d is not in set", rtag.id );
+
+	  amount = messagesize;
+
+	  xdebug("COMMAND %s, ID=%d, NAME=%s", command2charP[rtag.command],
+                 rtag.id, bfd->name);
+	  
+	  xmpi ( MPI_Recv (  bfd->fb->buffer, amount, MPI_CHAR, source, tag, 
+                             commNode, &status ));
+
+	  writeP ( bfd, amount );
+	  
+	  break;
+
+	case IO_Close_file:
+	  
+	  xdebug("COMMAND %s,  FILE%d, SOURCE%d",
+                 command2charP[rtag.command], rtag.id, source);
+
+          if (!(bfd = listSetGet(bibBFiledataP, fileIDTest,
+                               (void *)(intptr_t)rtag.id)))
+            xabort("fileID=%d is not in set", rtag.id);
+
+          amount = messagesize;
+
+	  xdebug("COMMAND %s, ID=%d, NAME=%s, AMOUNT=%zu",
+                 command2charP[rtag.command], rtag.id, bfd->name, amount);
+	  
+	  xmpi(MPI_Recv(bfd->fb->buffer, amount, MPI_CHAR, source, tag,
+                        commNode, &status ));
+
+	  writeP ( bfd, amount );
+
+	  if ( ! --(bfd->activeCollectors))
+	    {
+	      xdebug("all are finished with file %d, delete node", rtag.id);
+	      listSetRemove(bibBFiledataP, fileIDTest,
+                            (void *)(intptr_t)rtag.id);
+	    }
+          break;
+        case IO_Finalize:
+          {
+            int buffer = CDI_UNDEFID, collID;
+
+            xmpi ( MPI_Recv ( &buffer, 1, MPI_INT, source, tag, commNode, &status ));
+            
+            sentFinalize[source] = true;
+            doFinalize = true;
+            
+            for ( collID = 0; collID < nProcsCollNode; collID++ )
+              if ( !sentFinalize[collID] ) 
+                {
+                  doFinalize = false;
+                  break;
+                }
+            
+            if ( doFinalize )
+              {
+                if (!listSetIsEmpty(bibBFiledataP))
+                  xabort("set bibBfiledataP is not empty.");
+                else
+                  {
+                    xdebug("%s", "all files are finished, destroy file set,"
+                           " return");
+                    listSetDelete(bibBFiledataP);
+                  }
+                return;
+              }
+          }
+          break;
+        default:
+          xabort ( "COMMAND NOT IMPLEMENTED" );
+	}
+    }
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_record_send.c b/libcdi/src/pio_record_send.c
new file mode 100644
index 0000000..8af2815
--- /dev/null
+++ b/libcdi/src/pio_record_send.c
@@ -0,0 +1,362 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+
+#include <inttypes.h>
+#include <stdlib.h>
+
+#include "pio_comm.h"
+#include "pio_impl.h"
+#include "pio_util.h"
+
+extern char *command2charP[];
+extern double accumWait;
+extern char *token;
+extern long initial_buffersize;
+
+typedef struct
+{
+  size_t size;
+  struct dBuffer *db1;
+  struct dBuffer *db2;
+  struct dBuffer *db;
+  IO_Server_command command;
+  MPI_Request request;
+  int tsID, fileID;
+  char name[];
+} remoteFileBuf;
+
+static listSet * bibRemoteFileBuf;
+
+static int
+fileIDTest(void *a, void *fileID)
+{
+  return ((remoteFileBuf *)a)->fileID == (int)(intptr_t)fileID;
+}
+
+static remoteFileBuf *
+initRemoteFileBuf(const char *filename, size_t bs)
+{
+  remoteFileBuf *afp;
+  size_t len;
+  int iret;
+
+  xdebug ( "filename=%s, buffersize=%zu, in", filename, bs );
+
+  len = strlen(filename);
+  afp = xmalloc(sizeof (remoteFileBuf) + len + 1);
+  strcpy(afp->name, filename);
+  afp->size = bs;
+  afp->tsID = 0;
+
+  /* init output buffer */
+
+  xdebug ( "filename=%s, init output buffer",  afp->name );
+
+  iret = dbuffer_init ( &( afp->db1 ), afp->size );
+  iret += dbuffer_init ( &( afp->db2 ), afp->size );
+
+  if ( iret > 0 ) xabort ( "dbuffer_init did not succeed" );
+
+  afp->db = afp->db1;
+
+  afp->command = IO_Open_file;
+  afp->request = MPI_REQUEST_NULL;
+
+  xdebug ( "added name=%s, return", afp->name );
+  return afp;
+}
+
+static int
+destroyRemoteFileBuf(void *v)
+{
+  remoteFileBuf *afp = ( remoteFileBuf * ) v;
+  MPI_Status status;
+
+  xdebug ( "filename=%s, cleanup, in", afp->name );
+
+  xmpiStat(MPI_Wait(&afp->request, &status), &status);
+  dbuffer_cleanup(&afp->db1);
+  dbuffer_cleanup(&afp->db2);
+
+  free(afp);
+
+  xdebug("%s", "cleaned up, return");
+
+  return 0;
+}
+
+static bool
+compareNames(void *v1, void *v2)
+{
+  remoteFileBuf *afd1 = v1, *afd2 = v2;
+
+  return !strcmp(afd1->name, afd2->name);
+}
+
+/***************************************************************/
+/* send buffer to writer and swap buffer for filling */
+static void
+sendP(remoteFileBuf *afd, int id)
+{
+  int tag;
+  size_t amount;
+  MPI_Status status;
+  double startTime;
+
+  amount = dbuffer_data_size ( afd->db );
+  tag = encodeFileOpTag(id, afd->command);
+
+  xdebug("send buffer for %s, size: %zu bytes, command=%s, in",
+         afd->name, amount, command2charP[afd->command]);
+
+  if ( ddebug ) startTime = MPI_Wtime ();
+
+  xmpiStat(MPI_Wait(&(afd->request), &status), &status);
+
+  if ( ddebug ) accumWait +=  ( MPI_Wtime () - startTime );
+
+  xmpi(MPI_Issend(afd->db->buffer, amount, MPI_CHAR, commInqSpecialRankNode(),
+                  tag, commInqCommNode(), &( afd->request )));
+
+  /* change outputBuffer */
+  dbuffer_reset ( afd->db );
+  if ( afd->db == afd->db1 )
+    {
+      xdebug("%s", "Change to buffer 2 ...");
+      afd->db =  afd->db2;
+    }
+  else
+    {
+      xdebug("%s", "Change to buffer 1 ...");
+      afd->db =  afd->db1;
+    }
+  afd->command = IO_Send_buffer;
+
+  return;
+}
+
+static void
+defTimestep(remoteFileBuf *afd, int tsID)
+{
+  if ( afd == NULL || tsID != afd->tsID + 1 )
+    xabort ( " defTimestepPA () didn't succeed." );
+  afd->tsID = tsID;
+}
+
+static void
+flushOp(void *b, void *tsID)
+{
+  remoteFileBuf *fb = b;
+  sendP(fb, fb->fileID);
+  defTimestep(fb, (int)(intptr_t)tsID);
+}
+
+
+size_t
+pioSendWrite(int id, int tsID, const void *buffer, size_t len)
+{
+  int error = 0;
+  int flush = 0;
+  int filled;
+  remoteFileBuf *afd;
+
+  afd = listSetGet(bibRemoteFileBuf, fileIDTest, (void *)(intptr_t)id);
+
+  flush = ( tsID != afd->tsID ) ? 1 : 0;
+
+  if ( flush == 1 )
+    {
+      xdebug ( "tsID = %d, flush buffer", tsID );
+
+      listSetForeach(bibRemoteFileBuf, flushOp, (void *)(intptr_t)tsID);
+
+      {
+        double startTime;
+        MPI_Status status;
+        if (ddebug) startTime = MPI_Wtime();
+        xmpiStat(MPI_Wait(&(afd->request), &status), &status);
+        if (ddebug) accumWait +=  MPI_Wtime() - startTime;
+      }
+      xmpi(MPI_Barrier(commInqCommColl()));
+    }
+
+  filled = dbuffer_push(afd->db, buffer, len);
+
+  xdebug ( "id = %d, tsID = %d, pushed %lu byte data on buffer, filled = %d",
+           id, tsID, len, filled);
+
+  if (filled == 1)
+    {
+      if ( flush )
+        error = filled;
+      else
+        {
+          sendP(afd, id);
+          error = dbuffer_push(afd->db, buffer, len);
+        }
+    }
+
+  if ( error == 1 )
+    xabort("did not succeed filling output buffer, id=%d", id);
+
+  return len;
+}
+
+
+int
+pioSendClose(int id)
+{
+  double accumWaitMax;
+  remoteFileBuf *afd;
+  int iret;
+
+  xdebug ( "fileID %d: send buffer, close file and cleanup",id );
+
+  afd = listSetGet(bibRemoteFileBuf, fileIDTest, (void *)(intptr_t)id);
+
+  afd->command = IO_Close_file;
+
+  sendP(afd, id);
+  /* wait for other collectors to also close the file
+   * this prevents one process from re-using the file ID before
+   * another has sent the close */
+  xmpi(MPI_Barrier(commInqCommColl()));
+
+  /* remove file element */
+  iret = listSetRemove(bibRemoteFileBuf, fileIDTest, (void *)(intptr_t)id);
+
+  /* timer output */
+  if ( ddebug )
+    {
+      enum { root = 0 };
+      xmpi(MPI_Reduce(&accumWait, &accumWaitMax,
+                      1, MPI_DOUBLE, MPI_MAX, root, commInqCommColl()));
+      xdebug ( "Wait time %15.10lf s", accumWait );
+      if ( commInqRankColl () == root )
+	xdebug ( "Max wait time %15.10lf s", accumWaitMax );
+    }
+  return iret;
+}
+
+int
+pioSendOpen(const char *filename)
+{
+  remoteFileBuf *afd;
+  static long buffersize = 0;
+  int root = 0, id, iret, messageLength = 32;
+  char message[messageLength];
+
+  /* broadcast buffersize to collectors */
+  if (!buffersize)
+    {
+      if  (commInqRankColl() == root)
+	{
+	  if (getenv("BUFSIZE") != NULL)
+	    buffersize = atol(getenv("BUFSIZE"));
+	  if (buffersize < initial_buffersize)
+	    buffersize = initial_buffersize;
+          xdebug("filename=%s, broadcast buffersize=%ld to collectors ...",
+                 filename, buffersize);
+	}
+      xmpi(MPI_Bcast(&buffersize, 1, MPI_LONG, root, commInqCommColl()));
+    }
+
+  /* init and add remoteFileBuf */
+  afd = initRemoteFileBuf(filename, buffersize);
+  if ((id = listSetAdd(bibRemoteFileBuf, afd)) < 0)
+    xabort("filename %s is not unique", afd->name);
+
+  xdebug("filename=%s, init and added remoteFileBuf, return id = %d",
+         filename, id);
+
+  /* put filename, id and buffersize on buffer */
+  iret = dbuffer_push ( afd->db, filename, strlen ( filename ));
+  xassert(iret == 0);
+  iret = dbuffer_push ( afd->db, token, 1);
+  xassert(iret == 0);
+  sprintf ( message,"%lX", buffersize);
+  iret = dbuffer_push ( afd->db, message, strlen ( message ));
+  xassert(iret == 0);
+  iret = dbuffer_push ( afd->db, token, 1);
+  xassert(iret == 0);
+
+  if ( ddebug )
+    {
+      size_t l = strlen(filename) + strlen(message) + 2;
+      char *temp = xmalloc(l + 1);
+      strncpy(temp, (char *)afd->db->buffer, l);
+      temp[l] = '\0';
+      xdebug("filename=%s, put Open file message on buffer:\n%s,\t return",
+             filename, temp);
+      free(temp);
+    }
+
+  return id;
+}
+
+void
+pioSendFinalize(void)
+{
+  int buffer = 0, tag, specialRank = commInqSpecialRankNode ();
+  MPI_Comm commNode = commInqCommNode ();
+
+  tag = encodeFileOpTag(0, IO_Finalize);
+
+  xmpi(MPI_Send(&buffer, 1, MPI_INT, specialRank, tag, commNode));
+  xdebug("%s", "SENT MESSAGE WITH TAG \"IO_FINALIZE\" TO SPECIAL PROCESS");
+
+  if (!listSetIsEmpty(bibRemoteFileBuf))
+    xabort("set bibRemoteFileBuf not empty.");
+  else
+    {
+      xdebug("%s", "destroy set");
+      listSetDelete(bibRemoteFileBuf);
+    }
+}
+
+void
+pioSendInitialize(void)
+{
+  if (commInqSizeNode() < 2)
+    xabort ( "USAGE: # IO PROCESSES ON A PHYSICAL NODE >= 2" );
+
+
+  if ( commInqRankNode () == commInqSpecialRankNode ())
+    {
+      commDefCommColl ( 0 );
+      commSendNodeInfo ();
+      commRecvNodeMap ();
+      commDefCommsIO ();
+      switch ( commInqIOMode ())
+        {
+        case PIO_WRITER:
+          pioWriterStdIO();
+          break;
+        case PIO_ASYNCH:
+          pioWriterAIO();
+          break;
+        }
+    }
+  else
+    {
+      commDefCommColl ( 1 );
+      commSendNodeInfo ();
+      commRecvNodeMap ();
+      commDefCommsIO ();
+      bibRemoteFileBuf = listSetNew(destroyRemoteFileBuf, compareNames);
+    }
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_rpc.c b/libcdi/src/pio_rpc.c
new file mode 100644
index 0000000..1197092
--- /dev/null
+++ b/libcdi/src/pio_rpc.c
@@ -0,0 +1,140 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include "pio_rpc.h"
+#include "cdi.h"
+#include "pio_comm.h"
+#include "pio_util.h"
+#include "institution.h"
+#include "model.h"
+#include "vlist.h"
+#include "namespace.h"
+
+
+extern void   gridUnpack ( char *, int, int *, int, MPI_Comm );
+extern void  zaxisUnpack ( char *, int, int *, int, MPI_Comm );
+extern void  taxisUnpack ( char *, int, int *, int, MPI_Comm );
+extern double cdiDefaultMissval;  
+extern int streamNint;
+
+
+/*****************************************************************************/
+
+static
+void streamUnpack ( char * unpackBuffer, int unpackBufferSize, 
+		   int * unpackBufferPos, int nspTarget, MPI_Comm comm )
+{
+  int intBuffer[streamNint], streamID;
+  double d;
+  char filename[CDI_MAX_NAME];
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      intBuffer, streamNint, MPI_INT, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      &d, 1, MPI_DOUBLE, comm ));
+  xassert ( xchecksum ( DATATYPE_INT, streamNint, intBuffer ) == d );
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      &cdiDefaultMissval, 1, MPI_DOUBLE, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      &filename, intBuffer[2], MPI_CHAR, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos, 
+		      &d, 1, MPI_DOUBLE, comm ));
+  xassert ( d == xchecksum ( DATATYPE_TXT, intBuffer[2], filename ));
+  streamID = streamOpenWrite ( filename, intBuffer[1] );
+  xdebug ("streamID=%d, intBuffer[0]=%d, nspTarget=%d,"
+          " namespaceAdaptKey(a,b)=%d",
+          streamID, intBuffer[0], nspTarget,  
+          namespaceAdaptKey ( intBuffer[0], nspTarget ));
+  xassert ( streamID >= 0 &&
+            namespaceAdaptKey ( intBuffer[0], nspTarget ) == streamID );
+  xdebug ("streamID=%d, vlistID=%d", streamID, namespaceAdaptKey ( intBuffer[4], nspTarget ));
+
+  streamDefVlist ( streamID, namespaceAdaptKey ( intBuffer[4], nspTarget ));
+  xassert ( streamInqVlist ( streamID ) == 
+            namespaceAdaptKey ( intBuffer[3], nspTarget ));
+
+  streamDefByteorder ( streamID, intBuffer[5] );
+  streamDefCompType  ( streamID, intBuffer[6] );
+  streamDefCompLevel ( streamID, intBuffer[7] ); 
+  cdiDefGlobal  ( "REGULARGRID", intBuffer[8] );
+  cdiDefGlobal     ( "SORTNAME", intBuffer[9] ); 
+  cdiDefGlobal ( "HAVE_MISSVAL", intBuffer[10] );
+}
+
+
+/*****************************************************************************/
+
+
+void rpcUnpackResources ( char * unpackBuffer, int unpackBufferSize, 
+			  MPI_Comm comm )
+{ 
+  int token1, token2, nspTarget;
+  int unpackBufferPos = 0;
+
+  xdebug("%s", "START");
+	  
+  while ( unpackBufferPos < unpackBufferSize )
+    {
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, &unpackBufferPos, 
+			  &token1, 1, MPI_INT, comm ));
+      
+      switch ( token1 )
+	{
+	case END:
+	  return;
+	case START:
+	  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, &unpackBufferPos, 
+			      &nspTarget, 1, MPI_INT, comm ));
+	  break;
+	case GRID:
+	  gridUnpack      ( unpackBuffer, unpackBufferSize, &unpackBufferPos, 
+			    nspTarget, comm );
+	  break;
+	case ZAXIS: 
+	  zaxisUnpack     ( unpackBuffer, unpackBufferSize, &unpackBufferPos, 
+			    nspTarget, comm );
+	  break;
+	case TAXIS:
+	  taxisUnpack     ( unpackBuffer, unpackBufferSize, &unpackBufferPos, 
+			    nspTarget, comm );
+	  break;
+	case INSTITUTE:
+          instituteUnpack ( unpackBuffer, unpackBufferSize, &unpackBufferPos, 
+			    nspTarget, comm);
+	  break;
+	case MODEL:
+          modelUnpack     ( unpackBuffer, unpackBufferSize, &unpackBufferPos, 
+			    nspTarget, comm);
+	  break;
+	case STREAM:
+	  streamUnpack    ( unpackBuffer, unpackBufferSize, &unpackBufferPos, 
+			    nspTarget, comm );
+	  break;
+	case VLIST:
+          vlistUnpack     (unpackBuffer, unpackBufferSize, &unpackBufferPos, 
+			   nspTarget, comm);
+	  break;
+	default: 
+	  xabort ( "TOKEN MAPS NO VALID DATATYPE" );
+	}
+
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, &unpackBufferPos, 
+			  &token2, 1, MPI_INT, comm ));
+      xassert ( token2 == SEPARATOR );
+    }
+  xdebug("%s", "RETURN");
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_rpc.h b/libcdi/src/pio_rpc.h
new file mode 100644
index 0000000..1c35843
--- /dev/null
+++ b/libcdi/src/pio_rpc.h
@@ -0,0 +1,62 @@
+#ifndef PIO_RPC_H
+#define PIO_RPC_H
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+
+#include <mpi.h>
+
+typedef enum
+  {
+    FINALIZE,
+    RESOURCES,
+    WINCREATE,
+    WRITETS
+  } command;
+
+enum 
+{ GRID      = 1,
+  ZAXIS     = 2,
+  TAXIS     = 3,
+  INSTITUTE = 4,
+  MODEL     = 5,
+  STREAM    = 6,
+  VLIST     = 7,
+  START     = 55555555,
+  SEPARATOR = 66666666,
+  DATATOKEN = 77777777,
+  FUNCCALL  = 88888888,
+  END       = 99999999 
+};
+
+enum
+{
+  winBufferOverhead = 1,
+  winBufferOverheadChunk = 5,
+  winBufferOverheadFuncCall = 3,
+  timestepSize = 3
+};
+
+#define MAXWINBUFFERSIZE ((size_t)512 * 1024 * 1024)
+
+enum { nFuncs = 3, STREAMOPEN = 0, STREAMDEFVLIST = 1, STREAMCLOSE = 2 };
+enum { MAXDATAFILENAME = 256, MINFUNCID = STREAMOPEN, MAXFUNCID = STREAMCLOSE };
+extern char * funcMap[nFuncs];
+
+void rpcUnpackResources ( char *, int, MPI_Comm );
+
+#endif
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_server.c b/libcdi/src/pio_server.c
new file mode 100644
index 0000000..c0a7888
--- /dev/null
+++ b/libcdi/src/pio_server.c
@@ -0,0 +1,504 @@
+/** @file ioServer.c
+*/
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+
+#include "pio_server.h"
+
+
+#include <stdlib.h>
+#include <stdio.h>
+#include "limits.h"
+#include "cdi.h"
+#include "pio.h"
+#include "pio_comm.h"
+#include "pio_rpc.h"
+#include "pio_util.h"
+#include "stream_int.h"
+#include "resource_handle.h"
+#include "vlist_var.h"
+
+extern resOps streamOps;
+extern void arrayDestroy ( void );
+
+static struct
+{
+  size_t size;
+  unsigned char *buffer, *head;
+} *rxWin = NULL;
+
+static MPI_Win getWin = MPI_WIN_NULL;
+static MPI_Group groupModel = MPI_GROUP_NULL;
+
+
+/************************************************************************/
+
+static
+void serverWinCleanup ()
+{
+  int i;
+  int nProcsCalc = commInqNProcsModel ();
+  
+  if ( getWin != MPI_WIN_NULL )
+    xmpi ( MPI_Win_free ( &getWin ));
+  
+  if (rxWin)
+    {
+      for ( i = 0; i < nProcsCalc; i++ )
+        free(rxWin[i].buffer);
+      free(rxWin);
+    }
+
+  xdebug("%s", "cleaned up mpi_win");
+}
+ 
+ /************************************************************************/
+
+static 
+  void collDefBufferSizes ()
+{
+  int nstreams, * streamIndexList, streamNo, vlistID, nvars, varID, iorank;
+  int modelID, decoChunk, sumGetBufferSizes = 0;
+  int rankGlob = commInqRankGlob ();
+  int nProcsModel = commInqNProcsModel ();
+  int root = commInqRootGlob ();
+
+  xassert(rxWin != NULL);
+
+  nstreams = reshCountType ( &streamOps );
+  streamIndexList = xmalloc ( nstreams * sizeof ( streamIndexList[0] ));
+  reshGetResHListOfType ( nstreams, streamIndexList, &streamOps );
+  for ( streamNo = 0; streamNo < nstreams; streamNo++ )
+    {
+      // space required for data
+      vlistID = streamInqVlist ( streamIndexList[streamNo] );
+      nvars = vlistNvars ( vlistID );
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          iorank = vlistInqVarIOrank ( vlistID, varID );
+          xassert ( iorank != CDI_UNDEFID );
+          if ( iorank == rankGlob )
+            {
+              for ( modelID = 0; modelID < nProcsModel; modelID++ )
+                {
+                  decoChunk =  vlistInqVarDecoChunk ( vlistID, varID, modelID );
+                  xassert ( decoChunk > 0 );
+                  rxWin[modelID].size += decoChunk * sizeof (double)
+                    + winBufferOverheadChunk * sizeof (int);
+                }
+            }
+    }
+      // space required for the 3 function calls streamOpen, streamDefVlist, streamClose 
+      // once per stream and timestep for all collprocs only on the modelproc root
+      rxWin[root].size += 3 * winBufferOverheadFuncCall * sizeof (int)
+        + 5 * sizeof (int) + MAXDATAFILENAME;
+    }
+  free ( streamIndexList );
+
+  for ( modelID = 0; modelID < nProcsModel; modelID++ )
+    {
+      rxWin[modelID].size += winBufferOverhead * sizeof (int);
+      sumGetBufferSizes += rxWin[modelID].size;
+    }
+  xassert ( sumGetBufferSizes <= MAXWINBUFFERSIZE );
+  /* xprintArray ( "getBufferSize", getBufferSize, nProcsModel, DATATYPE_INT ); */
+}
+
+ /************************************************************************/
+
+static 
+ void serverWinCreate ()
+{ 
+  int ranks[1], modelID;
+  MPI_Comm commCalc = commInqCommCalc ();
+  MPI_Group groupCalc;
+  int nProcsModel = commInqNProcsModel ();
+
+  xmpi ( MPI_Win_create ( MPI_BOTTOM, 0, 1, MPI_INFO_NULL,
+                          commCalc, &getWin ));
+
+  /* target group */
+  ranks[0] = nProcsModel;
+  xmpi ( MPI_Comm_group ( commCalc, &groupCalc ));
+  xmpi ( MPI_Group_excl ( groupCalc, 1, ranks, &groupModel ));
+
+  rxWin = xmalloc(nProcsModel * sizeof (rxWin[0]));
+  collDefBufferSizes ();
+  /* xprintArray ( "getBufferSizes", getBufferSize, nProcsModel, DATATYPE_INT ); */
+
+  for ( modelID = 0; modelID < nProcsModel; modelID++ )
+    {
+      rxWin[modelID].buffer = xmalloc(rxWin[modelID].size);
+      rxWin[modelID].head = rxWin[modelID].buffer;
+    }
+
+  xdebug("%s", "created mpi_win, allocated getBuffer");
+}
+
+/************************************************************************/
+
+static
+  void getBufferGetFromEnd ( const char * caller, int line,  
+                             int ID, void * argBuffer, size_t size )
+{
+  if (rxWin == NULL ||
+      argBuffer     == NULL ||
+      size           < 0    ||
+      ID             < 0    ||
+      ID             >= commInqNProcsModel () ||
+      rxWin[ID].head - rxWin[ID].buffer + size > rxWin[ID].size)
+    xabort("caller: %s, line %d, ID = %d, nProcsModel=%d,"
+           " size = %lu, rxWin[%d].head = %ld, rxWin[%d].size = %lu",
+           caller, line, ID, (unsigned long)size, ID,
+           commInqNProcsModel(), rxWin[ID].head - rxWin[ID].buffer,
+           ID, (unsigned long)rxWin[ID].size);
+  memcpy ( argBuffer, rxWin[ID].head, size );
+  rxWin[ID].head += size;
+}
+
+/************************************************************************/
+
+static
+  void readFuncCall ( void )
+{
+  int funcID, tokenID;
+  int root = commInqRootGlob ();
+
+  getBufferGetFromEnd ( __func__, __LINE__, 
+                        root, &funcID, sizeof ( funcID ));
+  xassert ( funcID >= MINFUNCID && funcID <= MAXFUNCID );
+  
+  switch ( funcID )
+    {
+    case STREAMCLOSE:
+      {
+        int streamID;
+
+        getBufferGetFromEnd ( __func__, __LINE__, 
+                              root, &streamID, sizeof ( streamID ));
+        streamClose ( streamID );
+        xdebug ( "READ FUNCTION CALL FROM WIN:  %s, streamID=%d,"
+                 " closed stream", 
+                 funcMap[funcID], streamID );
+      }
+      break;
+    case STREAMOPEN:
+      {
+        char *filename;
+        size_t filenamesz;
+        int filetype, streamID;
+
+        getBufferGetFromEnd ( __func__, __LINE__, 
+                              root, &filenamesz, sizeof ( filenamesz ));
+        xassert ( filenamesz > 0 && filenamesz < MAXDATAFILENAME );
+        filename = xmalloc(filenamesz + 1);
+        getBufferGetFromEnd ( __func__, __LINE__, 
+                              root, filename, filenamesz );
+        filename[filenamesz] = '\0';
+        getBufferGetFromEnd ( __func__, __LINE__, 
+                              root, &filetype, sizeof ( filetype ));
+        xassert ( filetype >= MINFILETYPE && filetype <= MAXFILETYPE );
+        streamID = streamOpenWrite ( filename, filetype );
+        xdebug("READ FUNCTION CALL FROM WIN:  %s, filenamesz=%zu,"
+               " filename=%s, filetype=%d, OPENED STREAM %d",
+               funcMap[funcID], filenamesz, filename,
+               filetype, streamID);
+        free(filename);
+      }
+      break; 
+    case STREAMDEFVLIST:
+      {
+        int streamID, vlistID;
+
+        getBufferGetFromEnd ( __func__, __LINE__, 
+                              root, &streamID, sizeof ( vlistID ));
+        getBufferGetFromEnd ( __func__, __LINE__, 
+                              root, &vlistID, sizeof ( vlistID ));
+        streamDefVlist ( streamID, vlistID );
+        xdebug ( "READ FUNCTION CALL FROM WIN:  %s, streamID=%d,"
+                 " vlistID=%d, called streamDefVlist ().", 
+                 funcMap[funcID], streamID, vlistID );
+      }
+      break;
+    default:
+      xabort ( "REMOTE FUNCTIONCALL NOT IMPLEMENTED!" );
+    }
+  getBufferGetFromEnd ( __func__, __LINE__, 
+                        root, &tokenID, sizeof ( tokenID ));
+  xassert ( tokenID == SEPARATOR );
+}
+
+/************************************************************************/
+
+static
+void readGetBuffers ( int tsID, int vdate, int vtime )
+{
+  int modelID;
+  double * data = NULL, * dataHead = NULL;
+  int streamID = CDI_UNDEFID, streamIDNew = CDI_UNDEFID;
+  int varID, vlistID = CDI_UNDEFID, taxisID;
+  int size, chunk;
+  int tokenID, tokenID2;
+  
+  int nmiss = 0;
+  char text[1024];
+  int nProcsModel = commInqNProcsModel ();
+  int root        = commInqRootGlob ();
+  
+  xdebug("%s", "START");
+  
+  getBufferGetFromEnd ( __func__, __LINE__, 
+                        root, &tokenID, sizeof ( tokenID ));
+
+  while ( tokenID != END )
+    {
+      switch ( tokenID )
+        {
+        case DATATOKEN:
+          getBufferGetFromEnd ( __func__, __LINE__, 
+                                root, &streamIDNew, sizeof ( streamID ));
+          if ( streamIDNew != streamID )
+            {
+              streamID = streamIDNew;
+              vlistID = streamInqVlist ( streamID );
+              taxisID = vlistInqTaxis ( vlistID );
+              taxisDefVdate ( taxisID, vdate );
+              taxisDefVtime ( taxisID, vtime );
+              streamDefTimestep ( streamID, tsID );
+            }
+          getBufferGetFromEnd(__func__, __LINE__, root, &varID, sizeof (varID));
+          size = vlistInqVarSize ( vlistID, varID );
+          data = xmalloc ( size * sizeof ( double ));
+          dataHead = data;
+          
+          for ( modelID = 0; modelID < nProcsModel; modelID++ )
+            {
+              if ( modelID != root )
+                {
+                  int tempID;
+                  getBufferGetFromEnd ( __func__, __LINE__, 
+                                        modelID, &tempID, sizeof ( tempID ));
+                  xassert ( tempID == DATATOKEN );
+                  getBufferGetFromEnd ( __func__, __LINE__, 
+                                        modelID, &tempID, sizeof ( tempID ));
+                  xassert ( tempID == streamID );
+                  getBufferGetFromEnd ( __func__, __LINE__, 
+                                        modelID, &tempID, sizeof ( tempID ));
+                  xassert ( tempID == varID );
+                }
+              chunk  = vlistInqVarDecoChunk ( vlistID, varID, modelID );
+              getBufferGetFromEnd ( __func__, __LINE__, 
+                                    modelID, dataHead, chunk * sizeof ( double ));
+              dataHead += chunk;
+              getBufferGetFromEnd ( __func__, __LINE__, 
+                                    modelID, &nmiss   , sizeof ( nmiss ));
+              getBufferGetFromEnd ( __func__, __LINE__, 
+                                    modelID, &tokenID2, sizeof ( tokenID2 ));
+              xassert ( tokenID2 == SEPARATOR );
+            }
+          
+          streamWriteVar ( streamID, varID, data, nmiss );
+          
+          if ( ddebug > 2 )
+            {
+              sprintf ( text, "streamID=%d, var[%d], size=%d", streamID, varID, size );
+              xprintArray ( text, data, size, DATATYPE_FLT );
+            }
+          
+          free ( data );
+          break;
+        case FUNCCALL:
+          readFuncCall ();
+          break;
+        default:
+          xabort ( "BUFFER NOT READABLE!" );           
+        }
+      getBufferGetFromEnd ( __func__, __LINE__, 
+                            root, &tokenID, sizeof ( tokenID ));
+    }
+  xdebug("%s", "RETURN");
+} 
+
+/************************************************************************/
+
+
+static 
+  void getFlushBuffer ( int modelID )
+{
+  int nProcsModel = commInqNProcsModel ();
+
+  xassert ( modelID                >= 0           &&
+            modelID                 < nProcsModel &&
+            rxWin != NULL && rxWin[modelID].buffer != NULL &&
+            rxWin[modelID].size > 0 &&
+            rxWin[modelID].size <= MAXWINBUFFERSIZE );
+  memset(rxWin[modelID].buffer, 0, rxWin[modelID].size);
+  rxWin[modelID].head = rxWin[modelID].buffer;
+}
+
+
+/************************************************************************/
+
+
+static
+void getData ( int tsID, int vdate, int vtime )
+{
+  int modelID;
+  char text[1024];
+  int nProcsModel = commInqNProcsModel ();
+  void *getWinBaseAddr;
+  int attrFound;
+          
+  xdebug("%s", "START");
+
+  // todo put in correct lbs and ubs
+  xassert ( tsID >= 0 && vdate >= 0 && vtime >= 0 );
+  xmpi(MPI_Win_start(groupModel, 0, getWin));
+  xmpi(MPI_Win_get_attr(getWin, MPI_WIN_BASE, &getWinBaseAddr, &attrFound));
+  xassert(attrFound);
+  for ( modelID = 0; modelID < nProcsModel; modelID++ )
+    {
+      getFlushBuffer ( modelID );
+      xdebug("modelID=%d, nProcsModel=%d, rxWin[%d].size=%zu,"
+             " getWin=%p, sizeof(int)=%u",
+             modelID, nProcsModel, modelID, rxWin[modelID].size,
+             getWinBaseAddr, (unsigned)sizeof(int));
+      xmpi(MPI_Get(rxWin[modelID].buffer, rxWin[modelID].size,
+                   MPI_UNSIGNED_CHAR, modelID, 0,
+                   rxWin[modelID].size, MPI_UNSIGNED_CHAR, getWin));
+    }
+  xmpi ( MPI_Win_complete ( getWin ));
+
+  if ( ddebug > 2 )
+    for ( modelID = 0; modelID < nProcsModel; modelID++ )
+      {
+        sprintf(text, "rxWin[%d].size=%zu from PE%d rxWin[%d].buffer",
+                modelID, rxWin[modelID].size, modelID, modelID);
+        xprintArray(text, rxWin[modelID].buffer,
+                    rxWin[modelID].size / sizeof (double),
+                    DATATYPE_FLT);
+      }
+  readGetBuffers ( tsID, vdate, vtime );
+          
+  xdebug("%s", "RETURN");
+}
+
+/************************************************************************/
+
+/**
+  @brief is encapsulated in CDI library and run on I/O PEs.
+
+  @param
+
+  @return
+*/
+
+void IOServer ()
+{
+  int source, tag, *iBuffer, size, nProcsModel=commInqNProcsModel();
+  static int nfinished = 0;
+  char * buffer;
+  MPI_Comm commCalc;
+  MPI_Status status;
+
+  xdebug("%s", "START");
+
+  backendInit ();
+  if ( commInqRankNode () == commInqSpecialRankNode ()) 
+    backendFinalize ();
+  commCalc = commInqCommCalc ();
+
+  for ( ;; )
+    {
+      xmpi ( MPI_Probe ( MPI_ANY_SOURCE, MPI_ANY_TAG, commCalc, &status ));
+      
+      source = status.MPI_SOURCE;
+      tag    = status.MPI_TAG;
+      
+      switch ( tag )
+        {
+        case FINALIZE:
+          {
+            int i;
+            xdebugMsg(tag, source, nfinished);
+            xmpi(MPI_Recv(&i, 1, MPI_INTEGER, source,
+                          tag, commCalc, &status));
+          }
+          xdebug("%s", "RECEIVED MESSAGE WITH TAG \"FINALIZE\"");
+          nfinished++;
+          xdebug("nfinished=%d, nProcsModel=%d", nfinished, nProcsModel);
+          if ( nfinished == nProcsModel )
+            {
+              {
+                int nStreams = streamSize ();
+
+                if ( nStreams > 0 )
+                  {
+                    int streamNo;
+                    int * resHs;
+
+                    resHs       = xmalloc ( nStreams * sizeof ( resHs[0] ));
+                    streamGetIndexList ( nStreams, resHs );
+                    for ( streamNo = 0; streamNo < nStreams; streamNo++ )
+                      streamClose ( resHs[streamNo] );
+                    free ( resHs );
+                  }
+              }
+              backendCleanup();
+              serverWinCleanup();
+              /* listDestroy(); */
+              xdebug("%s", "RETURN");
+              return;
+            }
+	  
+          break;
+          
+	case RESOURCES:
+	  xdebugMsg (  tag, source, nfinished );
+	  xmpi ( MPI_Get_count ( &status, MPI_CHAR, &size ));
+	  buffer = xmalloc ( size * sizeof ( char ));
+	  xmpi ( MPI_Recv ( buffer, size, MPI_PACKED, source,
+                            tag, commCalc, &status ));
+          xdebug("%s", "RECEIVED MESSAGE WITH TAG \"RESOURCES\"");
+	  rpcUnpackResources ( buffer, size, commCalc );
+          xdebug("%s", "");
+	  free ( buffer );
+          if ( ddebug > 0 && commInqRankGlob () == nProcsModel ) 
+            reshListPrint ( "reshListIOServer" );
+	  serverWinCreate ();
+	  break;
+
+	case WRITETS:
+	  xdebugMsg (  tag, source, nfinished );
+          xmpi ( MPI_Get_count ( &status, MPI_INTEGER, &size ));     
+          xassert ( size == timestepSize );
+          iBuffer = xmalloc ( size * sizeof ( int ));
+          xmpi ( MPI_Recv ( iBuffer, size, MPI_INTEGER, source,
+                            tag, commCalc, &status ));
+          xdebug ( "RECEIVED MESSAGE WITH TAG \"WRITETS\": "
+                   "tsID=%d, vdate=%d, vtime=%d, source=%d", 
+                   iBuffer[0], iBuffer[1], iBuffer[2], source );
+          
+          getData ( iBuffer[0], iBuffer[1], iBuffer[2] );                
+          free ( iBuffer );
+	  break;
+
+	default:
+	  xabort ( "TAG NOT DEFINED!" );
+	}
+    }
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_server.h b/libcdi/src/pio_server.h
new file mode 100644
index 0000000..396ef9b
--- /dev/null
+++ b/libcdi/src/pio_server.h
@@ -0,0 +1,25 @@
+#ifndef PIO_SERVER_
+#define PIO_SERVER_
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#ifdef USE_MPI
+
+#include <mpi.h>
+
+void IOServer ();
+
+#endif
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_util.c b/libcdi/src/pio_util.c
new file mode 100644
index 0000000..1465471
--- /dev/null
+++ b/libcdi/src/pio_util.c
@@ -0,0 +1,328 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <errno.h>
+#include <stdarg.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "pio_util.h"
+#include "cdi.h"
+
+static
+char commands[][13] = { "FINALIZE\0",
+                        "RESOURCES\0",
+                        "WINCREATE\0",
+                        "WRITETS\0"};
+
+
+void pcdiAssert   ( bool assumption, const char * filename,
+                    const char * functionname, int line )
+{
+  if ( !assumption )
+    {
+#ifdef USE_MPI
+      int rank = -1, init_flag = 0;
+      if (MPI_Initialized(&init_flag) == MPI_SUCCESS && init_flag)
+        MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+      fprintf ( stderr, "ERROR, FALSE ASSUMPTION: PE%d in %s, %s, line %d\n",
+                rank, functionname, filename, line );
+      fflush ( stderr );
+      if (init_flag)
+        MPI_Abort ( MPI_COMM_WORLD, 1 );
+      else
+        abort();
+#else
+      fprintf ( stderr, "ERROR, FALSE ASSUMPTION, %s, %s, line %d\n",
+                functionname, filename, line );
+      fflush ( stderr );
+      abort();
+#endif
+    }
+}
+
+/****************************************************/
+
+void pcdiAbort(const char * filename, const char *functionname, int line,
+               const char * errorString, ... )
+{
+  va_list ap;
+  va_start(ap, errorString);
+#ifdef USE_MPI
+  {
+    int rank;
+    MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+    fprintf(stderr, "ERROR, pe%d in %s, %s, line %d, errorString: \"",
+            rank, functionname, filename, line);
+  }
+  vfprintf(stderr, errorString, ap);
+  fputs("\"\n", stderr);
+  MPI_Abort ( MPI_COMM_WORLD, 1 );
+#else
+  fprintf(stderr, "ERROR, %s, %s, line %d, errorString: \"",
+          functionname, filename, line);
+  vfprintf(stderr, errorString, ap);
+  fputs("\"\n", stderr);
+#endif
+  exit ( EXIT_FAILURE );
+  va_end(ap);
+}
+
+/*****************************************************************************/
+
+void * pcdiXmalloc ( size_t size, const char *filename, const char *functionname,
+		     int line )
+{
+  void * value = calloc (1, size );
+
+  if ( value == NULL )
+    pcdiAbort (filename, functionname, line, "malloc failed: %s",
+               strerror(errno));
+
+  return value;
+}
+
+void * pcdiXcalloc ( size_t nmemb, size_t size, const char *filename,
+		     const char *functionname, int line )
+{
+  void * value = calloc ( nmemb, size );
+
+  if ( value == NULL )
+    pcdiAbort (filename, functionname, line, "calloc failed: %s",
+               strerror(errno) );
+
+  return value;
+}
+
+void * pcdiXrealloc ( void *p, size_t size, const char *functionname,
+		      const char *filename, int line )
+{
+  void * value = realloc ( p, size );
+
+  if ( value == NULL )
+    pcdiAbort(filename, functionname, line, "realloc failed: %s",
+              strerror(errno));
+
+  return value;
+}
+
+/***************************************************************/
+
+#ifdef USE_MPI
+void pcdiXMPI ( int iret, const char *filename, int line )
+{
+  char errorString[2][MPI_MAX_ERROR_STRING + 1];
+  int len, errorClass, rank;
+
+  if ( iret != MPI_SUCCESS )
+    {
+      MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+
+      MPI_Error_class ( iret, &errorClass );
+      MPI_Error_string ( errorClass, errorString[0], &len );
+      errorString[0][len] = '\0';
+      MPI_Error_string ( iret, errorString[1], &len);
+      errorString[1][len] = '\0';
+
+      fprintf ( stderr, "MPI ERROR, pe%d, %s, line %d,"
+                "errorClass: \"%s\""
+                "errorString: \"%s\"\n",
+                rank, filename, line,
+                errorString[0], errorString[1]);
+
+      MPI_Abort ( MPI_COMM_WORLD, iret );
+    }
+}
+
+/*****************************************************************************/
+
+void pcdiXMPIStat ( int iret, const char *filename, int line, MPI_Status *status )
+{
+  char errorString[MPI_MAX_ERROR_STRING + 1];
+  int len, rank;
+
+  MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+
+  if ( iret == MPI_ERR_IN_STATUS )
+    {
+      switch ( status->MPI_ERROR )
+        {
+          fprintf ( stderr, "------- checking error in request ----------\n" );
+        case MPI_SUCCESS :
+          fprintf ( stderr, "-------- mpi_success -----------\n" );
+          break;
+        case MPI_ERR_PENDING:
+          fprintf ( stderr, "-------- mpi_err_pending ----------\n");
+          break;
+        default:
+          MPI_Error_string ( status->MPI_ERROR, errorString, &len );
+          errorString[len] = '\0';
+          fprintf ( stderr,"MPI ERROR in request, pe%d, %s, line %d,"
+                    "return value: %d, error_string: %s\n",
+                    rank, filename, line, iret, errorString );
+          MPI_Abort ( MPI_COMM_WORLD, iret );
+        }
+    }
+  else
+    xmpi ( iret );
+
+  return;
+}
+#endif
+
+/****************************************************/
+
+#ifdef USE_MPI
+void pcdiDebugComm ( const char *filename, const char *functionname, int line, MPI_Comm *comm )
+{
+  int rank, size, len, rankGlob;
+  char *name;
+
+  name = ( char * ) xmalloc ( MPI_MAX_OBJECT_NAME );
+  memset ( name, 0, ( MPI_MAX_OBJECT_NAME ) * sizeof ( char ));
+  MPI_Comm_get_name ( * comm, name, &len );
+  MPI_Comm_size ( * comm, &size );
+  MPI_Comm_rank ( * comm, &rank );
+  MPI_Comm_rank ( MPI_COMM_WORLD, &rankGlob );
+  fprintf ( stdout,
+            "pe%d in %s, %s, line %d: comm: name=%s, size=%d, rank=%d\n",
+            rankGlob, functionname, filename, line,
+            name, size, rank );
+  free ( name );
+
+}
+#endif
+
+/****************************************************/
+
+#ifdef USE_MPI
+void pcdiDebugMsg ( const char * cdiPioDebugString, const char *filename,
+                    const char *functionname, int line, int tag, int source,
+                    int nfinished )
+{
+  int rank;
+
+  MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+
+  fprintf ( stdout,
+            "%s pe%d in %s, %s, line %d: command %s, source %d, finalized=%d\n",
+            cdiPioDebugString, rank, functionname, filename, line,
+            &commands[tag][0], source, nfinished );
+}
+#endif
+/****************************************************/
+
+#ifdef USE_MPI
+void pcdiDebugMsg2 ( const char *filename, const char *functionname, int line,
+                   int tag, int source, char * text )
+{
+  int rank;
+
+  MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+
+  fprintf ( stdout,
+            "pe%d in %s, %s, line %d: command %s, source %d, %s\n",
+            rank, functionname, filename, line,
+            &commands[tag][0], source, text );
+}
+#endif
+
+
+/****************************************************/
+
+
+int xmaxInt ( int a, int b )
+{
+  return a >= b ? a : b;
+}
+
+
+/****************************************************/
+
+
+int xminInt ( int a, int b )
+{
+  return a <= b ? a : b;
+}
+
+
+/****************************************************/
+
+
+int xsum ( int n, int * argarray )
+{
+  int i, sum = 0;
+
+  for ( i = 0; i < n; i++ )
+    sum += * ( argarray + i );
+
+  return sum;
+}
+
+
+/****************************************************/
+
+
+double xchecksum ( int type, int count, void * buffer )
+{
+  return 0.0;
+}
+
+
+/****************************************************/
+
+void printArray ( const char * cdiPioDebugString, char * ps, const void * array, int n,
+                  int datatype, const char * funname, const char * filename, int line )
+{
+  int i, rank;
+  int * iArray;
+  double * dArray;
+
+#ifdef USE_MPI
+  {
+    int init_flag;
+    if (MPI_Initialized(&init_flag) == MPI_SUCCESS && init_flag)
+      MPI_Comm_rank ( MPI_COMM_WORLD, &rank );
+    else
+      rank = -1;
+  }
+  fprintf ( stdout, "%s pe%d in %s, %s, line %d: %s = ",
+	    cdiPioDebugString, rank, funname, filename, line, ps );
+#else
+  fprintf ( stdout, "%s %s, %s, line %d: %s = ",
+	    cdiPioDebugString, funname, filename, line, ps );
+#endif
+
+  switch ( datatype )
+    {
+    case DATATYPE_INT:
+      iArray = ( int * ) array;
+      for ( i = 0; i < n-1; i++ )
+	fprintf ( stdout, "%d ", * ( iArray + i ));
+      fprintf ( stdout, "%d\n", * ( iArray + n - 1 ));
+      break;
+    case DATATYPE_FLT:
+      dArray = ( double * ) array;
+      for ( i = 0; i < n-1; i++ )
+	fprintf ( stdout, "%.2f ", * ( dArray + i ));
+      fprintf ( stdout, "%.2f\n", * ( dArray + n-1 ));
+      break;
+    default:
+      fprintf ( stdout, " ... no datatype defined\n" );
+    }
+
+  return;
+}
+
+/****************************************************/
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pio_util.h b/libcdi/src/pio_util.h
new file mode 100644
index 0000000..282d4cb
--- /dev/null
+++ b/libcdi/src/pio_util.h
@@ -0,0 +1,198 @@
+#ifndef PIO_UTIL_
+#define PIO_UTIL_
+
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <stdbool.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <string.h>
+
+#ifdef USE_MPI
+#include "mpi.h"
+#endif
+
+
+#define MAXSTRLNNETCDF    32
+#define MAXBUFFERSIZE     32
+#define MAXVALUE          10
+#define MAXDEBUG           3
+#define MAXLEVELINFOS     10
+#define MAXVARS           10
+
+#define MAXLEVEL          10
+#define MAXLEVELIDX       10
+#define MAXRECORDS        10
+#define MAXRECIDS         10
+#define MAXVARS           10
+#define MAXTSTEPS         10
+#define MAXFNAMES         10
+#define MAXGHBUFFERSIZE_0 10
+#define MAXGHBUFFERSIZE_1 10
+
+#define MAXSTRING        256
+#define MINFILETYPE        1
+#define MAXFILETYPE        9
+
+#define ddebug             0
+
+#define debugString "#####"
+
+/* If we're not using GNU C, elide __attribute__ */
+#ifndef __GNUC__
+#  define  __attribute__(x)  /*NOTHING*/
+#endif
+
+void pcdiAssert   ( bool, const char *, const char *, int );
+#define xassert(arg) do {                               \
+    if ((arg)) {                                        \
+    } else {                                            \
+      pcdiAssert(0, __FILE__, __func__, __LINE__ );     \
+    }                                                   \
+  } while(0)
+
+#ifdef USE_MPI
+#define xdebug(fmt, ...)                                                \
+  if ( ddebug ){                                                        \
+    int rank;                                                           \
+    {                                                                   \
+      int init_flag;                                                    \
+      if (MPI_Initialized(&init_flag) == MPI_SUCCESS && init_flag)      \
+        MPI_Comm_rank ( MPI_COMM_WORLD, &rank );                        \
+      else                                                              \
+        rank = -1;                                                      \
+    }                                                                   \
+    fprintf ( stderr, "%s pe%d in %s, %s, line %d: " fmt "\n",          \
+              debugString, rank,  __func__, __FILE__,  __LINE__,        \
+              __VA_ARGS__ );                                            \
+  }
+
+#else
+#define xdebug(fmt, ...)                                           \
+  if ( ddebug ){                                                   \
+    fprintf ( stderr, "%s %s, %s, line %d: " fmt "\n",             \
+              debugString, __func__, __FILE__,  __LINE__,          \
+              __VA_ARGS__ );                                       \
+  }
+#endif
+
+
+#ifdef USE_MPI
+#define xdebug3(fmt, ...)					\
+  if ( ddebug == MAXDEBUG ){                                    \
+    int rank;                                                   \
+    MPI_Comm_rank ( MPI_COMM_WORLD, &rank );                    \
+    fprintf ( stderr, "pe%d in %s, %s, line %d: " fmt "\n",     \
+              rank,  __func__, __FILE__,  __LINE__,             \
+              __VA_ARGS__ );                                    \
+  }
+
+#else
+#define xdebug3(fmt, ...)					\
+  if ( ddebug == MAXDEBUG ){                                    \
+    fprintf ( stderr, "%s, %s, line %d: " fmt "\n",             \
+              __func__, __FILE__,  __LINE__,                    \
+              __VA_ARGS__ );                                 \
+  }
+#endif
+/*
+#ifdef USE_MPI
+char * outTextComm ( MPI_Comm * );
+
+#define xdebugComm(comm,fmt, ...)				\
+  if ( ddebug ){						\
+    fprintf ( stderr, "%s%s, %s, line %d%s: " fmt "\n",		\
+	      outTextRank (),  __func__, __FILE__,  __LINE__,	\
+	      outTextComm ( comm ),				\
+	      ## __VA_ARGS__  );				\
+    }
+#endif
+*/
+
+#ifdef USE_MPI
+#define xwarning(fmt, ...)						\
+  if ( ddebug ){							\
+    int rank;								\
+    MPI_Comm_rank ( MPI_COMM_WORLD, &rank );				\
+    fprintf ( stderr, "WARNING: pe%d in %s, %s, line %d: " fmt "\n",	\
+              rank,  __func__, __FILE__,  __LINE__,			\
+              __VA_ARGS__ );						\
+  }
+#else
+#define xwarning(fmt, ...)					\
+  if ( ddebug ){                                                \
+    fprintf ( stderr, "WARNING: %s, %s, line %d: " fmt "\n",    \
+              __func__, __FILE__,  __LINE__,                    \
+              __VA_ARGS__ );                                 \
+  }
+#endif
+
+void pcdiAbort (const char *, const char *, int, const char *, ... )
+  __attribute__((noreturn));
+#define xabort(...) pcdiAbort(__FILE__, __func__, __LINE__, __VA_ARGS__ )
+
+void * pcdiXmalloc ( size_t, const char *, const char *, int );
+#define xmalloc(size) pcdiXmalloc ( size, __FILE__, __func__,  __LINE__ )
+
+void * pcdiXcalloc ( size_t, size_t, const char *, const char *, int );
+#define xcalloc(nmemb,size) pcdiXcalloc(nmemb, size,            \
+                                        __FILE__, __func__, __LINE__)
+
+void * pcdiXrealloc ( void *, size_t, const char *, const char *, int );
+#define xrealloc(p,size) pcdiXrealloc(p, size,            \
+                                      __FILE__, __func__, __LINE__)
+
+void pcdiXMPI ( int, const char *, int );
+#define xmpi(ret) pcdiXMPI ( ret, __FILE__, __LINE__ )
+
+#ifdef USE_MPI
+void pcdiXMPIStat ( int, const char *, int, MPI_Status * );
+#define xmpiStat(ret,stat) pcdiXMPIStat ( ret, __FILE__, __LINE__, stat )
+
+void pcdiDebugComm ( const char *filename, const char *functionname, int line, \
+                     MPI_Comm *comm );
+#define xdebugComm(comm)\
+  if ( ddebug ) pcdiDebugComm (  __FILE__, __func__, __LINE__, comm )
+#endif
+
+void pcdiDebugMsg ( const char * cdiDebugString, const char *filename, const char *functionname, int line, \
+                    int tag, int source, int nfinished );
+#define xdebugMsg(tag,source,nfinished) \
+  if ( ddebug ) \
+      pcdiDebugMsg ( debugString, __FILE__, __func__, __LINE__, tag, source, nfinished )
+
+void pcdiDebugMsg2 ( const char *filename, const char *functionname, int line, \
+                    int tag, int source, char * text );
+#define xdebugMsg2(tag,source,text) \
+  if ( ddebug ) pcdiDebugMsg ( __FILE__, __func__,  __LINE__, tag, source, text )
+
+int xmaxInt ( int, int );
+int xminInt ( int, int );
+int xsum ( int, int * );
+
+double xchecksum ( int, int, void * );
+ 
+void printArray ( const char *, char *, const void *, int, int, const char *, const char *, int );
+#define xprintArray(ps,array,n,datatype)                                \
+  if ( ddebug )                                                         \
+      printArray ( debugString, ps, array, n, datatype,  __func__, __FILE__, __LINE__ )
+ 
+#define xprintArray3(ps,array,n,datatype)                                \
+  if ( ddebug == MAXDEBUG )                                                         \
+      printArray ( debugString, ps, array, n, datatype,  __func__, __FILE__, __LINE__ )
+
+
+void reshListPrint ( char * );
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/pkgconfig/cdi.pc.in b/libcdi/src/pkgconfig/cdi.pc.in
new file mode 100644
index 0000000..19a2ae8
--- /dev/null
+++ b/libcdi/src/pkgconfig/cdi.pc.in
@@ -0,0 +1,48 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+cflags=-I at includedir@
+fcflags=@FPP_INCOPT@@includedir@ @CDI_F90_INTERFACE_FCFLAGS@
+libs=-L at libdir@ -lcdi @GRIB_API_LIBS@ @JASPER_LIBS@ @NETCDF_LIBS@ @HDF5_LIBS@ @SZLIB_LIBS@ @ZLIB_LIBS@ @THREADS_LIBS@
+threads_libs=@THREADS_LIBS@
+threads_cflags=@THREADS_INCLUDE@
+zlib_cflags=@ZLIB_INCLUDE@
+zlib_libs=@ZLIB_LIBS@
+szlib_cflags=@SZLIB_INCLUDE@
+szlib_libs=@SZLIB_LIBS@
+hdf5_root=@HDF5_ROOT@
+hdf5_cflags=@HDF5_INCLUDE@
+hdf5_libs=@HDF5_LIBS@
+netcdf_root=@NETCDF_ROOT@
+netcdf_cflags=@NETCDF_INCLUDE@
+netcdf_libs=@NETCDF_LIBS@
+jasper_libs=@JASPER_LIBS@
+grib_api_cflags=@GRIB_API_INCLUDE@
+grib_api_libs=@GRIB_API_LIBS@
+cdi_build_cc=@CC@
+cdi_build_cflags=@CFLAGS@
+cdi_build_cppflags=@CPPFLAGS@
+cdi_build_ldflags=@LDFLAGS@
+cdi_build_libs=@LIBS@
+cdi_build_fc=@FC@
+cdi_build_fcflags=@FCFLAGS@
+cdi_build_f77=@F77@
+cdi_build_fflags=@FFLAGS@
+cdi_build_cxx=@CXX@
+cdi_build_cxxflags=@CXXFLAGS@
+cdi_build_enable_grib=@ENABLE_GRIB@
+cdi_build_enable_cgribex=@ENABLE_CGRIBEX@
+cdi_build_enable_service=@ENABLE_SERVICE@
+cdi_build_enable_extra=@ENABLE_EXTRA@
+cdi_build_enable_ieg=@ENABLE_IEG@
+
+Name: @PACKAGE_NAME@
+Description: CDI is an Interface to access Climate and NWP model Data.
+URL: @PACKAGE_URL@
+Version: @VERSION@
+Requires: 
+Libs: ${libs}
+Cflags: ${cflags}
+FCflags: ${fcflags}
+
diff --git a/libcdi/src/resource_handle.c b/libcdi/src/resource_handle.c
new file mode 100644
index 0000000..43164c9
--- /dev/null
+++ b/libcdi/src/resource_handle.c
@@ -0,0 +1,706 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#define _XOPEN_SOURCE 600 /* PTHREAD_MUTEX_RECURSIVE */
+
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "resource_handle.h"
+#include "pio_util.h"
+#include "namespace.h"
+#include "cdi.h"
+#include "error.h"
+#include "file.h"
+
+#ifdef USE_MPI
+#include "pio_comm.h"
+#include "pio_rpc.h"
+#endif
+
+
+enum { MIN_LIST_SIZE = 128 };
+
+static int *listSizeAllocated;
+
+static void listInitialize(void);
+
+// ATTENTION: not thread safe yet, namespaces are set in model!
+
+#if  defined  (HAVE_LIBPTHREAD)
+#  include <pthread.h>
+
+static pthread_once_t  listInitThread = PTHREAD_ONCE_INIT;
+static pthread_mutex_t listMutex;
+
+#  define LIST_LOCK()         pthread_mutex_lock(&listMutex)
+#  define LIST_UNLOCK()       pthread_mutex_unlock(&listMutex)
+#  define LIST_INIT()         pthread_once(&listInitThread, listInitialize)
+
+#else
+
+static int listInit = 0;
+
+#  define LIST_LOCK()
+#  define LIST_UNLOCK()
+#  define LIST_INIT()        do {                               \
+  if ( !listInit )                                              \
+    {                                                           \
+      listInitialize();                                         \
+      listInit = 1;                                             \
+    }                                                           \
+  } while(0)
+
+#endif
+
+
+typedef struct listElem {
+  cdiResH       resH;//idx
+  struct listElem * next;
+  resOps      * ops;
+  void        * val;//ptr
+  int           status;
+} listElem_t;
+
+
+static listElem_t **listResources;
+static listElem_t **freeListHead;
+
+/**************************************************************/
+
+static
+void listNew ( void )
+{
+  int nnsp, i;
+
+  nnsp = namespaceGetNumber ();
+
+  listSizeAllocated = xcalloc ( nnsp, sizeof( listSizeAllocated[0]));
+  listResources     = xcalloc ( nnsp, sizeof( listResources[0]));
+  freeListHead      = xcalloc ( nnsp, sizeof( freeListHead[0]));
+
+  for ( i = 0; i < nnsp; i++ )
+    {
+      listSizeAllocated[i] = MIN_LIST_SIZE;
+
+      xassert ( listResources[i] == NULL);
+
+      listResources[i] = xcalloc ( listSizeAllocated[i], sizeof ( listElem_t ));
+    }
+}
+
+/**************************************************************/
+
+static
+void listInitPointer ( void )
+{
+  int nnsp, i, j;
+
+  nnsp = namespaceGetNumber ();
+
+  for ( i = 0; i < nnsp; i++ )
+    {
+      for ( j = 0; j < listSizeAllocated[i]; j++ )
+        {
+          listResources[i][j].resH   = namespaceIdxEncode2 ( i, j );
+          listResources[i][j].next   = listResources[i] + j + 1;
+          listResources[i][j].ops    = NULL;
+          listResources[i][j].val    = NULL;
+          listResources[i][j].status = RESH_UNDEFID;
+        }
+
+      listResources[i][listSizeAllocated[i]-1].next = NULL;
+
+      freeListHead[i] = listResources[i];
+    }
+}
+
+/**************************************************************/
+
+static
+void listDestroy ( void )
+{
+  listElem_t * listElem;
+  int i, j, nnsp;
+
+  if ( listResources )
+    {
+      nnsp = namespaceGetNumber ();
+      for ( i = 0; i < nnsp; i++ )
+	{
+	  pioNamespaceSetActive ( i );
+          if ( listResources[i] )
+            {
+              if ( listSizeAllocated )
+                for ( j = 0; j < listSizeAllocated[i]; j++ )
+                  {
+                    listElem = listResources[i] + j;
+                    if  ( listElem->val )
+                      listElem->ops->valDestroy ( listElem->val );
+                  }
+              free ( listResources[i] );
+              listResources[i] = NULL;
+            }
+	}
+      free ( listResources );
+      listResources = NULL;
+    }
+
+  if ( freeListHead )
+    {
+      free ( freeListHead );
+      freeListHead = NULL;
+    }
+  if ( listSizeAllocated )
+    {
+      free ( listSizeAllocated );
+      listSizeAllocated = NULL;
+    }
+}
+
+/**************************************************************/
+
+static
+void listInitialize ( void )
+{
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_mutexattr_t ma;
+  pthread_mutexattr_init(&ma);
+  pthread_mutexattr_settype(&ma, PTHREAD_MUTEX_RECURSIVE);
+  /* initialize global API mutex lock */
+  pthread_mutex_init ( &listMutex, &ma);
+  pthread_mutexattr_destroy(&ma);
+#endif
+
+  listNew ();
+  /* file is special and has its own table, which needs to be
+   * created, before we register the listDestroy exit handler */
+  {
+    int null_id;
+    null_id = fileOpen("/dev/null", "r");
+    if (null_id != -1)
+      fileClose(null_id);
+  }
+  atexit ( listDestroy );
+
+  LIST_LOCK();
+
+  listInitPointer ();
+
+  LIST_UNLOCK();
+
+}
+
+/**************************************************************/
+
+static
+void listSizeExtend()
+{
+  int newListSize;
+  int i, nsp;
+
+  nsp = namespaceGetActive ();
+
+  newListSize = listSizeAllocated[nsp] + MIN_LIST_SIZE;
+
+  listResources[nsp] =
+    xrealloc(listResources[nsp], newListSize * sizeof (listResources[0][0]));
+
+  for ( i = listSizeAllocated[nsp]; i < newListSize; ++i )
+    {
+      listResources[nsp][i].resH   = namespaceIdxEncode2 ( nsp, i );
+      listResources[nsp][i].next   = listResources[nsp] + i + 1;
+      listResources[nsp][i].ops    = NULL;
+      listResources[nsp][i].val    = NULL;
+      listResources[nsp][i].status = RESH_UNDEFID;
+    }
+
+  listResources[nsp][newListSize-1].next = freeListHead[nsp];
+  freeListHead[nsp] = listResources[nsp] + listSizeAllocated[nsp];
+  listSizeAllocated[nsp] = newListSize;
+}
+
+/**************************************************************/
+
+int reshPut ( void *p, resOps *ops )
+{
+  cdiResH resH = -1, nsp;
+  listElem_t * newListElem;
+
+  xassert ( p && ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  if ( !freeListHead[nsp] ) listSizeExtend();
+  newListElem               = freeListHead[nsp];
+  freeListHead[nsp]         = freeListHead[nsp]->next;
+  newListElem->next         = NULL;
+  resH                      = newListElem->resH;
+  newListElem->val          = p;
+  newListElem->ops          = ops;
+  newListElem->status       = ASSIGNED;
+
+  LIST_UNLOCK();
+
+  return resH;
+}
+
+/**************************************************************/
+
+void reshRemove ( cdiResH resH, resOps * ops )
+{
+  int nsp;
+  namespaceTuple_t nspT;
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  nspT = namespaceResHDecode ( resH );
+
+  xassert ( nspT.nsp == nsp &&
+            nspT.idx >= 0 &&
+            nspT.idx < listSizeAllocated[nsp] &&
+            listResources[nsp][nspT.idx].ops &&
+            listResources[nsp][nspT.idx].ops == ops );
+
+  listResources[nsp][nspT.idx].next   = freeListHead[nsp];
+  listResources[nsp][nspT.idx].ops    = NULL;
+  listResources[nsp][nspT.idx].val    = NULL;
+  listResources[nsp][nspT.idx].status = RESH_UNDEFID;
+  freeListHead[nsp]                   = listResources[nsp] + nspT.idx;
+
+  LIST_UNLOCK();
+}
+
+/**************************************************************/
+
+void *reshGetVal ( cdiResH resH, resOps * ops  )
+{
+  int nsp;
+  namespaceTuple_t nspT;
+  listElem_t * listElem;
+
+  xassert ( ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  nspT = namespaceResHDecode ( resH );
+
+  if (nspT.nsp == nsp &&
+      nspT.idx >= 0 &&
+      nspT.idx < listSizeAllocated[nsp])
+    {
+      listElem = listResources[nsp] + nspT.idx;
+      LIST_UNLOCK();
+    }
+  else
+    {
+      LIST_UNLOCK();
+      xabort("Invalid namespace %d or index %d for resH %d!", nspT.nsp, nspT.idx, (int)resH);
+    }
+
+  xassert(listElem && listElem->ops == ops);
+
+  return listElem->val;
+}
+
+/**************************************************************/
+
+void reshGetResHListOfType ( int c, int * resHs, resOps * ops )
+{
+  int i, j = 0, nsp;
+
+  xassert ( resHs && ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  for ( i = 0; i < listSizeAllocated[nsp]; i++ )
+    if ( listResources[nsp][i].val && listResources[nsp][i].ops )
+      if ( listResources[nsp][i].ops == ops )
+        {
+          resHs[j++] = namespaceIdxEncode2 ( nsp, i );
+          if ( j == c ) break;
+        }
+
+  LIST_UNLOCK();
+}
+
+/**************************************************************/
+
+int reshCountType ( resOps * ops )
+{
+  int i, nsp, countType = 0;
+
+  xassert ( ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  for ( i = 0; i < listSizeAllocated[nsp]; i++ )
+    if ( listResources[nsp][i].val )
+      if ( listResources[nsp][i].ops == ops )
+        countType++;
+
+  LIST_UNLOCK();
+
+  return countType;
+}
+
+/**************************************************************/
+
+#ifdef USE_MPI
+static
+int  getPackBufferSize ( MPI_Comm comm )
+{
+  int nsp, i;
+  int packBufferSize = 0;
+  int intpacksize;
+  listElem_t * curr;
+
+  nsp = namespaceGetActive ();
+
+  xmpi ( MPI_Pack_size ( 1, MPI_INT, comm, &intpacksize ));
+
+  /* pack start marker, namespace and sererator marker */
+  packBufferSize += 3 * intpacksize;
+
+  /* pack resources, type marker and seperator marker */
+  for ( i = 0; i < listSizeAllocated[nsp]; i++ )
+    if ( listResources[nsp][i].val )
+      if ( listResources[nsp][i].status == ASSIGNED )
+        {
+          curr = listResources[nsp] + i;
+          xassert ( curr->ops );
+
+          /* message plus frame of 2 ints */
+          packBufferSize += curr->ops->valGetPackSize ( curr->val, comm )
+            + 2 * intpacksize;
+        }
+
+  /* end marker */
+  packBufferSize += intpacksize;
+
+  return packBufferSize;
+}
+
+/**************************************************************/
+
+void reshPackBufferDestroy ( char ** buffer )
+{
+  if ( buffer ) free ( *buffer );
+}
+
+/**************************************************************/
+
+void reshPackBufferCreate ( char ** packBuffer, int * packBufferSize, MPI_Comm comm )
+{
+  int i, nsp, packBufferPos = 0;
+  int start = START, end = END, sep = SEPARATOR, type;
+  listElem_t * curr;
+
+  xassert ( packBuffer );
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  * packBufferSize = getPackBufferSize ( comm );
+  * packBuffer = xcalloc ( 1, * packBufferSize );
+
+  xmpi ( MPI_Pack ( &start, 1,  MPI_INT,
+		    * packBuffer, * packBufferSize, &packBufferPos, comm ));
+
+  xmpi ( MPI_Pack ( &nsp, 1,  MPI_INT,
+		    * packBuffer, * packBufferSize, &packBufferPos, comm ));
+
+  xmpi ( MPI_Pack ( &sep, 1,  MPI_INT,
+		    * packBuffer, * packBufferSize, &packBufferPos, comm ));
+
+  for ( i = 0; i < listSizeAllocated[nsp]; i++ )
+    if ( listResources[nsp][i].val )
+      if ( listResources[nsp][i].status == ASSIGNED )
+        {
+          curr = listResources[nsp] + i;
+          xassert ( curr->ops );
+
+          type = curr->ops->valTxCode ();
+
+          if ( ! type ) continue;
+
+          xmpi ( MPI_Pack ( &type, 1, MPI_INT, * packBuffer,
+			    * packBufferSize, &packBufferPos, comm ));
+
+          curr->ops->valPack ( curr->val,
+                               * packBuffer ,
+                               * packBufferSize,
+                               &packBufferPos,
+                               comm );
+
+          xmpi ( MPI_Pack ( &sep, 1,  MPI_INT, * packBuffer,
+			    * packBufferSize, &packBufferPos, comm ));
+
+          curr->status = CLOSED;
+        }
+
+  LIST_UNLOCK();
+
+  xmpi ( MPI_Pack ( &end, 1,  MPI_INT,
+                  * packBuffer, * packBufferSize, &packBufferPos, comm ));
+}
+
+#endif
+
+/**************************************************************/
+
+/* for thread safety this feature would have to be integrated in reshPut */
+
+void reshSetStatus ( cdiResH resH, resOps * ops, int status )
+{
+  int nsp;
+  namespaceTuple_t nspT;
+  listElem_t * listElem;
+
+  xassert ( ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  nspT = namespaceResHDecode ( resH );
+
+  xassert ( nspT.nsp == nsp &&
+            nspT.idx >= 0 &&
+            nspT.idx < listSizeAllocated[nsp] );
+
+  listElem = listResources[nsp] + nspT.idx;
+
+  xassert ( listElem &&
+            listElem->ops == ops );
+
+  listElem->status = status;
+
+  LIST_UNLOCK();
+}
+
+/**************************************************************/
+
+int reshGetStatus ( cdiResH resH, resOps * ops )
+{
+  int nsp;
+  namespaceTuple_t nspT;
+  listElem_t * listElem;
+
+  xassert ( ops );
+
+  LIST_INIT();
+
+  LIST_LOCK();
+
+  nsp = namespaceGetActive ();
+
+  nspT = namespaceResHDecode ( resH );
+
+  xassert ( nspT.nsp == nsp &&
+            nspT.idx >= 0 &&
+            nspT.idx < listSizeAllocated[nsp] );
+
+  listElem = listResources[nsp] + nspT.idx;
+
+  LIST_UNLOCK();
+
+  xassert ( listElem &&
+            listElem->ops == ops );
+
+  return listElem->status;
+}
+
+/**************************************************************/
+
+void reshLock ()
+{
+  LIST_LOCK();
+}
+
+/**************************************************************/
+
+void reshUnlock ()
+{
+  LIST_UNLOCK();
+}
+
+/**************************************************************/
+
+int reshListCompare ( int nsp0, int nsp1 )
+{
+  const int equal  = 0;
+#ifdef USE_MPI
+  const int differ = -1;
+  int i, valCompare;
+  listElem_t * listElem0, * listElem1;
+
+
+  LIST_INIT();
+
+  xassert(namespaceGetNumber () > xmaxInt ( nsp0, nsp1 ) &&
+          xminInt ( nsp0, nsp1 ) >= 0 );
+
+  for ( i = 0; i < listSizeAllocated[nsp0]; i++ )
+    {
+      listElem0 = listResources[nsp0] + i;
+      if ( listElem0->val )
+	{
+	  if ( i >= listSizeAllocated[nsp1] )
+	    {
+	      xdebug("%s", "");
+	      return differ;
+	    }
+
+	  listElem1 = listResources[nsp1] + i;
+	  if ( !listElem1->val )
+	    {
+	      xdebug("%s", "");
+	      return differ;
+	    }
+
+	  xassert ( listElem0->ops && listElem1->ops );
+	  if ( listElem0->ops != listElem1->ops )
+	    {
+	      xdebug("%s", "");
+	      return differ;
+	    }
+
+	  valCompare =  listElem0->ops->valCompare ( listElem0->val, listElem1->val );
+	  printf ( "type %d, values resH0=%d and resH1=%d %s\n", 
+		   listElem0->ops->valTxCode (), 
+		   listElem0->resH, 
+		   listElem1->resH,
+		   valCompare == equal ? "are equal" : "differ" );
+	  if ( valCompare != equal ) return differ;
+	}
+      else if ( listResources[nsp1][i].val )
+	return differ;
+    }
+
+  for ( ; i < listSizeAllocated[nsp1]; i++ )
+    if ( listResources[nsp1][i].val )
+      {
+	xdebug("%s", "");
+	return differ;
+      }
+
+#endif
+
+  return equal;
+}
+
+/**************************************************************/
+
+void reshListPrint ( char * filename )
+{
+  int i, j, temp;
+  listElem_t * curr;
+  FILE * fp;
+
+  LIST_INIT();
+
+#ifdef USE_MPI
+  {
+    int root = 0;
+    if ( commInqIsProcIO () == 0 )
+      {
+        if (  commInqRankModel () != root )  return;
+      }
+    else if ( commInqRankPio () != root ) return;
+  }
+#endif
+
+  if ( filename )
+    {
+      fp = fopen ( filename, "w" );
+      if ( ! fp )
+	{
+	  xdebug("%s", "could not open file" );
+	  fp = stdout;
+	}
+    }
+  else
+    fp = stdout;
+
+  temp = namespaceGetActive ();
+
+  fprintf ( fp, "\n\n##########################################\n#\n#  print " \
+            "global resource list \n#\n" );
+
+  for ( i = 0; i < namespaceGetNumber (); i++ )
+    {
+      pioNamespaceSetActive ( i );
+
+      fprintf ( fp, "\n" );
+      fprintf ( fp, "##################################\n" );
+      fprintf ( fp, "#\n" );
+      fprintf ( fp, "# namespace=%d\n", i );
+      fprintf ( fp, "#\n" );
+      fprintf ( fp, "##################################\n\n" );
+
+      fprintf ( fp, "listSizeAllocated[%d]=%d\n", i, listSizeAllocated[i] );
+
+      for ( j = 0; j < listSizeAllocated[i]; j++ )
+        {
+          curr = listResources[i] + j;
+          if ( curr->ops && curr->val )
+            {
+              curr->ops->valPrint (( void * ) curr->val, fp );
+              fprintf ( fp, "\n" );
+            }
+        }
+    }
+  fprintf ( fp, "#\n#  end global resource list" \
+            "\n#\n##########################################\n\n" );
+
+  fclose ( fp );;
+  pioNamespaceSetActive ( temp );
+}
+
+
+void cdiReset(void)
+{
+  LIST_LOCK();
+
+  listDestroy();
+
+  listNew ();
+
+  listInitPointer ();
+
+  LIST_UNLOCK();
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/resource_handle.h b/libcdi/src/resource_handle.h
new file mode 100644
index 0000000..d11072c
--- /dev/null
+++ b/libcdi/src/resource_handle.h
@@ -0,0 +1,74 @@
+#ifndef RESOURCE_HANDLE_H
+#define RESOURCE_HANDLE_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include <mpi.h>
+#include <stdlib.h>
+#endif
+
+/*
+ * CDI internal handling of resource handles given to user code
+ */
+
+/*
+ * for reasons of compatibility with cfortran.h, the handle type is: int
+ */
+typedef int cdiResH;
+
+/* return 0 on equality, not 0 otherwise */
+typedef int    ( * valCompareFunc     )( void *, void * );
+typedef void   ( * valDestroyFunc     )( void * );
+typedef void   ( * valPrintFunc       )( void *, FILE * );
+#ifdef USE_MPI
+typedef int    ( * valGetPackSizeFunc )( void *, MPI_Comm comm );
+typedef void   ( * valPackFunc        )( void *, void *buf, int size, int *pos, MPI_Comm comm );
+typedef int    ( * valTxCodeFunc      )( void );
+#endif
+
+typedef struct {
+  valCompareFunc     valCompare;
+  valDestroyFunc     valDestroy;
+  valPrintFunc       valPrint;
+#ifdef USE_MPI
+  valGetPackSizeFunc valGetPackSize;
+  valPackFunc        valPack;
+  valTxCodeFunc      valTxCode;
+#endif
+}resOps;
+
+enum { RESH_UNDEFID, ASSIGNED, SUSPENDED, CLOSED };
+
+int    reshPut ( void *, resOps * );
+void   reshRemove ( cdiResH, resOps * );
+
+int    reshCountType ( resOps * );
+
+void * reshGetVal ( cdiResH, resOps * );
+
+void   reshGetResHListOfType ( int, int *, resOps * );
+
+#ifdef USE_MPI
+void   reshPackBufferCreate ( char **, int *, MPI_Comm );
+void   reshPackBufferDestroy ( char ** );
+#endif
+
+void   reshSetStatus ( cdiResH, resOps *, int );
+int    reshGetStatus ( cdiResH, resOps * );
+
+void   reshLock   ( void );
+void   reshUnlock ( void );
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/service.h b/libcdi/src/service.h
new file mode 100644
index 0000000..8ef4f38
--- /dev/null
+++ b/libcdi/src/service.h
@@ -0,0 +1,48 @@
+#ifndef _SERVICE_H
+#define _SERVICE_H
+
+
+typedef struct {
+  int    checked;
+  int    byteswap;
+  int    header[8];
+  int    hprec;      /* header precision */
+  int    dprec;      /* data   precision */
+  size_t datasize;
+  size_t buffersize;
+  void  *buffer;
+}
+srvrec_t;
+
+
+const char *srvLibraryVersion(void);
+
+void srvDebug(int debug);
+
+int  srvCheckFiletype(int fileID, int *swap);
+
+srvrec_t *srvNew(void);
+void srvDelete(srvrec_t *srvp);
+
+int  srvRead(int fileID, srvrec_t *srvp);
+int  srvWrite(int fileID, srvrec_t *srvp);
+
+int  srvInqHeader(srvrec_t *srvp, int *header);
+int  srvInqDataSP(srvrec_t *srvp, float *data);
+int  srvInqDataDP(srvrec_t *srvp, double *data);
+
+int  srvDefHeader(srvrec_t *srvp, const int *header);
+int  srvDefDataSP(srvrec_t *srvp, const float *data);
+int  srvDefDataDP(srvrec_t *srvp, const double *data);
+
+
+#endif  /* _SERVICE_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/servicelib.c b/libcdi/src/servicelib.c
new file mode 100644
index 0000000..ded17f0
--- /dev/null
+++ b/libcdi/src/servicelib.c
@@ -0,0 +1,606 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <ctype.h>
+
+#include "dmemory.h"
+
+#include "service.h"
+#include "error.h"
+#include "file.h"
+#include "binary.h"
+#include "swap.h"
+
+
+#define SINGLE_PRECISION  4
+#define DOUBLE_PRECISION  8
+
+#define SRV_HEADER_LEN    8
+
+
+static int initSrvLib      = 0;
+static int srvDefaultHprec = 0;
+static int srvDefaultDprec = 0;
+
+
+/*
+ * A version string.
+ */
+
+#undef  LIBVERSION
+#define LIBVERSION      1.3.1
+#define XSTRING(x)	#x
+#define STRING(x)	XSTRING(x)
+static const char srv_libvers[] = STRING(LIBVERSION) " of "__DATE__" "__TIME__;
+
+const char *srvLibraryVersion(void)
+{
+  return (srv_libvers);
+}
+
+
+int SRV_Debug = 0;    /* If set to 1, debugging */
+
+
+void srvDebug(int debug)
+{
+  SRV_Debug = debug;
+
+  if ( SRV_Debug )
+    Message("debug level %d", debug);
+}
+
+
+void srvLibInit()
+{
+  char *envString;
+  char *envName = "SRV_PRECISION";
+
+
+  envString = getenv(envName);
+  if ( envString )
+    {
+      int pos;
+      int nrun;
+      if ( strlen(envString) == 2 ) nrun = 1;
+      else                          nrun = 2;
+
+      pos = 0;
+      while ( nrun-- )
+	{
+	  switch ( tolower((int) envString[pos]) )
+	    {
+	    case 'i':
+	      {
+		switch ( (int) envString[pos+1] )
+		  {
+		  case '4': srvDefaultHprec = SINGLE_PRECISION; break;
+		  case '8': srvDefaultHprec = DOUBLE_PRECISION; break;
+		  default:
+		    Message("Invalid digit in %s: %s", envName, envString);
+		  }
+		break;
+	      }
+	    case 'r':
+	      {
+		switch ( (int) envString[pos+1] )
+		  {
+		  case '4': srvDefaultDprec = SINGLE_PRECISION; break;
+		  case '8': srvDefaultDprec = DOUBLE_PRECISION; break;
+		  default:
+		    Message("Invalid digit in %s: %s", envName, envString);
+		  }
+		break;		
+	      }
+	    default:
+	      Message("Invalid character in %s: %s", envName, envString);
+	    }
+	  pos += 2;
+	}
+    }
+
+  initSrvLib = 1;
+}
+
+
+void srvInit(srvrec_t *srvp)
+{
+  srvp->checked    = 0;
+  srvp->byteswap   = 0;
+  srvp->hprec      = 0;
+  srvp->dprec      = 0;
+  srvp->datasize   = 0;
+  srvp->buffersize = 0;
+  srvp->buffer     = NULL;
+}
+
+
+srvrec_t *srvNew(void)
+{
+  srvrec_t *srvp;
+
+  if ( ! initSrvLib ) srvLibInit();
+
+  srvp = (srvrec_t *) malloc(sizeof(srvrec_t));
+
+  srvInit(srvp);
+
+  return (srvp);
+}
+
+
+void srvDelete(srvrec_t *srvp)
+{
+  if ( srvp )
+    {
+      if ( srvp->buffer ) free(srvp->buffer);
+      free(srvp);
+    }
+}
+
+
+int srvCheckFiletype(int fileID, int *swap)
+{
+  size_t blocklen = 0;
+  size_t sblocklen = 0;
+  size_t data = 0;
+  size_t dimx = 0, dimy = 0;
+  int fact = 0, found = 0;
+  unsigned char buffer[72], *pbuf;
+
+  if ( fileRead(fileID, buffer, 4) != 4 ) return (found);
+
+  blocklen  = (size_t) get_UINT32(buffer);
+  sblocklen = (size_t) get_SUINT32(buffer);
+
+  if ( SRV_Debug )
+    Message("blocklen = %d sblocklen = %d", blocklen, sblocklen);
+
+  if ( blocklen == 32 )
+    {
+     *swap = 0;
+      fact = blocklen>>3;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+4*fact;      dimx = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+5*fact;      dimy = (size_t) get_UINT32(pbuf);
+      pbuf = buffer+blocklen+4;  data = (size_t) get_UINT32(pbuf);
+    }
+  else if ( blocklen == 64 )
+    {
+     *swap = 0;
+      fact = blocklen>>3;
+      if ( fileRead(fileID, buffer, blocklen+8) != blocklen+8 ) return (found);
+      pbuf = buffer+4*fact;      dimx = (size_t) get_UINT64(pbuf);
+      pbuf = buffer+5*fact;      dimy = (size_t) get_UINT64(pbuf);
+      pbuf = buffer+blocklen+4;  data = (size_t) get_UINT32(pbuf);
+    }
+  else if ( sblocklen == 32 )
+    {
+     *swap = 1;
+      fact = sblocklen>>3;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+4*fact;       dimx = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+5*fact;       dimy = (size_t) get_SUINT32(pbuf);
+      pbuf = buffer+sblocklen+4;  data = (size_t) get_SUINT32(pbuf);
+    }
+  else if ( sblocklen == 64 )
+    {
+     *swap = 1;
+      fact = sblocklen>>3;
+      if ( fileRead(fileID, buffer, sblocklen+8) != sblocklen+8 ) return (found);
+      pbuf = buffer+4*fact;       dimx = (size_t) get_SUINT64(pbuf);
+      pbuf = buffer+5*fact;       dimy = (size_t) get_SUINT64(pbuf);
+      pbuf = buffer+sblocklen+4;  data = (size_t) get_SUINT32(pbuf);
+    }
+
+  fileRewind(fileID);
+
+  if      ( data && dimx*dimy*fact == data ) found = 1;
+  else if ( data && dimx*dimy*8    == data ) found = 1;
+
+  if ( SRV_Debug )
+    {
+      Message("swap = %d fact = %d", *swap, fact);
+      Message("dimx = %lu dimy = %lu data = %lu", dimx, dimy, data);
+    }
+
+  return (found);
+}
+
+
+int srvInqHeader(srvrec_t *srvp, int *header)
+{
+  size_t i;
+
+  for ( i = 0; i < SRV_HEADER_LEN; i++ )
+    header[i] = srvp->header[i];
+  
+  if ( SRV_Debug )
+    Message("datasize = %lu", srvp->datasize);
+
+  return (0);
+}
+
+
+int srvDefHeader(srvrec_t *srvp, const int *header)
+{
+  size_t i;
+
+  for ( i = 0; i < SRV_HEADER_LEN; i++ )
+    srvp->header[i] = header[i];
+  
+  srvp->datasize = header[4]*header[5];
+
+  if ( SRV_Debug )
+    Message("datasize = %lu", srvp->datasize);
+
+  return (0);
+}
+
+
+int srvInqData(srvrec_t *srvp, int prec, void *data)
+{
+  size_t datasize;
+  size_t i;
+  int ierr = 0;
+  int dprec;
+  void *buffer;
+  int byteswap = srvp->byteswap;
+
+  datasize = srvp->datasize;
+
+  buffer = srvp->buffer;
+
+  dprec = srvp->dprec;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( sizeof(FLT32) == 4 )
+	  {
+	    if ( byteswap ) swap4byte(buffer, datasize);
+
+	    if ( dprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT32));
+	    else
+	      for (i = 0; i < datasize; i++)
+		((double *) data)[i] = (double) ((float *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT32));
+	  }	
+	break;
+      }
+    case DOUBLE_PRECISION:
+	if ( sizeof(FLT64) == 8 )
+	  {
+	    if ( byteswap ) swap8byte(buffer, datasize);
+
+	    if ( dprec == prec )
+	      memcpy(data, buffer, datasize*sizeof(FLT64));
+	    else
+	      for (i = 0; i < datasize; i++)
+		((float *) data)[i] = (float) ((double *) buffer)[i];
+	  }
+	else
+	  {
+	    Error("not implemented for %d byte float", sizeof(FLT64));
+	  }	
+	break;
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  return (ierr);
+}
+
+
+int srvInqDataSP(srvrec_t *srvp, float *data)
+{
+  return (srvInqData(srvp, SINGLE_PRECISION, (void *) data));
+}
+
+
+int srvInqDataDP(srvrec_t *srvp, double *data)
+{
+  return (srvInqData(srvp, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int srvDefData(srvrec_t *srvp, int prec, const void *data)
+{
+  size_t datasize;
+  size_t blocklen;
+  size_t buffersize;
+  size_t i;
+  int dprec, hprec;
+  int *header;
+  void *buffer;
+
+  if ( srvDefaultDprec ) dprec = srvDefaultDprec;
+  else                   dprec = srvp->dprec;
+
+  if ( ! dprec ) dprec = prec;
+
+  srvp->dprec = dprec;
+
+  if ( srvDefaultHprec ) hprec = srvDefaultHprec;
+  else                   hprec = srvp->hprec;
+
+  if ( ! hprec ) hprec = dprec;
+  
+  srvp->hprec = hprec;
+
+  header = srvp->header;
+
+  datasize = header[4]*header[5];
+  blocklen = datasize * dprec;
+
+  srvp->datasize = datasize;
+
+  buffersize = srvp->buffersize;
+
+  if ( buffersize != blocklen )
+    {
+      buffersize = blocklen;
+      buffer = srvp->buffer;
+      buffer = realloc(buffer, buffersize);
+      srvp->buffer = buffer;
+      srvp->buffersize = buffersize;
+    }
+  else
+    buffer = srvp->buffer;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	if ( dprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT32));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((float *) buffer)[i] = (float) ((double *) data)[i];
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	if ( dprec == prec )
+	  memcpy(buffer, data, datasize*sizeof(FLT64));
+	else
+	  for (i = 0; i < datasize; i++)
+	    ((double *) buffer)[i] = (double) ((float *) data)[i];
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  return (0);
+}
+
+
+int srvDefDataSP(srvrec_t *srvp, const float *data)
+{
+  return (srvDefData(srvp, SINGLE_PRECISION, (void *) data));
+}
+
+
+int srvDefDataDP(srvrec_t *srvp, const double *data)
+{
+  return (srvDefData(srvp, DOUBLE_PRECISION, (void *) data));
+}
+
+
+int srvRead(int fileID, srvrec_t *srvp)
+{
+  size_t datasize;
+  size_t blocklen, blocklen2;
+  size_t i;
+  char tempheader[64];
+  int hprec, dprec;
+  void *buffer;
+  int buffersize;
+  int byteswap;
+  int status;
+
+  if ( ! srvp->checked )
+    {
+      status = srvCheckFiletype(fileID, &srvp->byteswap);
+      if ( status == 0 ) Error("Not a SERVICE file!");
+      srvp->checked = 1;
+    }
+
+  byteswap = srvp->byteswap;
+
+  /* read header record */
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  if ( fileEOF(fileID) ) return (-1);
+
+  if ( SRV_Debug )
+    Message("blocklen = %lu", blocklen);
+
+  hprec = blocklen / SRV_HEADER_LEN;
+
+  srvp->hprec = hprec;
+
+  switch ( hprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	binReadInt32(fileID, byteswap, SRV_HEADER_LEN, (INT32 *) tempheader);
+
+	for ( i = 0; i < SRV_HEADER_LEN; i++ )
+          srvp->header[i] = (int) ((INT32 *) tempheader)[i];
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	binReadInt64(fileID, byteswap, SRV_HEADER_LEN, (INT64 *) tempheader);
+
+	for ( i = 0; i < SRV_HEADER_LEN; i++ )
+          srvp->header[i] = (int) ((INT64 *) tempheader)[i];
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected header precision %d", hprec);
+      }
+    }
+
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("header blocklen differ!");
+      return (-1);
+    }
+
+  srvp->datasize = srvp->header[4]*srvp->header[5];
+
+  if ( SRV_Debug )
+    Message("datasize = %lu", srvp->datasize);
+
+  blocklen = binReadF77Block(fileID, byteswap);
+
+  buffersize = srvp->buffersize;
+
+  if ( buffersize < (int) blocklen )
+    {
+      buffersize = blocklen;
+      buffer = srvp->buffer;
+      buffer = realloc(buffer, buffersize);
+      srvp->buffer = buffer;
+      srvp->buffersize = buffersize;
+    }
+  else
+    buffer = srvp->buffer;
+
+  datasize = srvp->datasize;
+
+  dprec = blocklen / datasize;
+
+  srvp->dprec = dprec;
+
+  if ( dprec != SINGLE_PRECISION && dprec != DOUBLE_PRECISION )
+    {
+      Warning("unexpected data precision %d", dprec);
+      return (-1);
+    }
+
+  fileRead(fileID, buffer, blocklen);
+
+  blocklen2 = binReadF77Block(fileID, byteswap);
+
+  if ( blocklen2 != blocklen )
+    {
+      Warning("data blocklen differ!");
+      return (-1);
+    }
+
+  return (0);
+}
+
+
+int srvWrite(int fileID, srvrec_t *srvp)
+{
+  size_t datasize;
+  size_t blocklen;
+  size_t i;
+  int dprec, hprec;
+  char tempheader[64];
+  int *header;
+  void *buffer;
+  int byteswap = srvp->byteswap;
+
+  dprec  = srvp->dprec;
+  hprec  = srvp->hprec;
+  header = srvp->header;
+
+  /* write header record */
+  blocklen = SRV_HEADER_LEN * hprec;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  switch ( hprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	for (i = 0; i < SRV_HEADER_LEN; i++)
+          ((INT32 *) tempheader)[i] = (INT32) header[i];
+
+	binWriteInt32(fileID, byteswap, SRV_HEADER_LEN, (INT32 *) tempheader);
+
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	for (i = 0; i < SRV_HEADER_LEN; i++)
+          ((INT64 *) tempheader)[i] = (INT64) header[i];
+
+	binWriteInt64(fileID, byteswap, SRV_HEADER_LEN, (INT64 *) tempheader);
+
+	break;
+      }
+    default:
+      {
+	Error("unexpected header precision %d", hprec);
+      }
+    }
+  
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  datasize = header[4]*header[5];
+  blocklen = datasize * dprec;
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  srvp->datasize = datasize;
+
+  buffer = srvp->buffer;
+
+  switch ( dprec )
+    {
+    case SINGLE_PRECISION:
+      {
+	binWriteFlt32(fileID, byteswap, datasize, (FLT32 *) buffer);
+	break;
+      }
+    case DOUBLE_PRECISION:
+      {
+	binWriteFlt64(fileID, byteswap, datasize, (FLT64 *) buffer);
+	break;
+      }
+    default:
+      {
+	Error("unexpected data precision %d", dprec);
+      }
+    }
+
+  binWriteF77Block(fileID, byteswap, blocklen);
+
+  return (0);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream.c b/libcdi/src/stream.c
new file mode 100644
index 0000000..4befe82
--- /dev/null
+++ b/libcdi/src/stream.c
@@ -0,0 +1,2347 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <ctype.h>
+
+#include "dmemory.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "cdf.h"
+#include "stream_grb.h"
+#include "stream_cdf.h"
+#include "stream_srv.h"
+#include "stream_ext.h"
+#include "stream_ieg.h"
+#include "file.h"
+#include "cgribex.h"
+#include "gribapi.h"
+#include "cdf.h"
+#include "service.h"
+#include "extra.h"
+#include "ieg.h"
+#include "vlist.h"
+#include "resource_handle.h"
+#include "pio_util.h"
+
+#include "namespace.h"
+#include "pio_interface.h"
+#include "pio_rpc.h"
+#include "pio_comm.h"
+
+#include <string.h>
+
+#define  MAX_FNAMES  3
+
+extern resOps streamOps;
+
+
+FILE *popen(const char *command, const char *type);
+int pclose(FILE *stream);
+
+void cdiPrintDefaults(void)
+{
+  fprintf (stderr, "default instID     :  %d\n", cdiDefaultInstID);
+  fprintf (stderr, "default modelID    :  %d\n", cdiDefaultModelID);
+  fprintf (stderr, "default tableID    :  %d\n", cdiDefaultTableID);
+  fprintf (stderr, "default missval    :  %g\n", cdiDefaultMissval);
+}
+
+
+void cdiDebug(int level)
+{
+  if ( level == 1 || level &  2 ) CDI_Debug = 1;
+
+  if ( CDI_Debug ) Message("debug level %d", level);
+
+  if ( level == 1 || level &  4 ) memDebug(1);
+
+  if ( level == 1 || level &  8 ) fileDebug(1);
+
+  if ( level == 1 || level & 16 )
+    {
+#if  defined  (HAVE_LIBGRIB)
+      gribSetDebug(1);
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+      cdfDebug(1);
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+      srvDebug(1);
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+      extDebug(1);
+#endif
+#if  defined  (HAVE_LIBIEG)
+      iegDebug(1);
+#endif
+    }
+
+  if ( CDI_Debug )
+    {
+      cdiPrintDefaults();
+      cdiPrintDatatypes();
+    }
+}
+
+
+#undef  IsBigendian
+#define IsBigendian()  ( u_byteorder.c[sizeof(long) - 1] )
+
+
+static
+int getByteorder(int byteswap)
+{
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+  int byteorder = -1;
+
+  if ( IsBigendian() )
+    {
+      if ( byteswap ) byteorder = CDI_LITTLEENDIAN;
+      else            byteorder = CDI_BIGENDIAN;
+    }
+  else
+    {
+      if ( byteswap ) byteorder = CDI_BIGENDIAN;
+      else            byteorder = CDI_LITTLEENDIAN;
+    }
+
+  return (byteorder);
+}
+
+
+static
+int getFiletype(const char *filename, int *byteorder)
+{
+  int filetype = CDI_EUFTYPE;
+  int fileID;
+  int swap = 0;
+  int version;
+  long recpos;
+  char buffer[8];
+
+  fileID = fileOpen(filename, "r");
+
+  if ( fileID == CDI_UNDEFID )
+    {
+      if ( memcmp(filename, "http:", 5) == 0 )
+	return (FILETYPE_NC);
+      else
+	return (CDI_ESYSTEM);
+    }
+
+  if ( fileRead(fileID, buffer, 8) != 8 ) return (CDI_EUFTYPE);
+
+  fileRewind(fileID);
+
+  if ( memcmp(buffer, "GRIB", 4) == 0 )
+    {
+      version = buffer[7];
+      if ( version <= 1 )
+	{
+	  filetype = FILETYPE_GRB;
+	  if ( CDI_Debug ) Message("found GRIB file = %s, version %d", filename, version);
+	}
+      else if ( version == 2 )
+	{
+	  filetype = FILETYPE_GRB2;
+	  if ( CDI_Debug ) Message("found GRIB2 file = %s", filename);
+	}
+    }
+  else if ( memcmp(buffer, "CDF\001", 4) == 0 )
+    {
+      filetype = FILETYPE_NC;
+      if ( CDI_Debug ) Message("found CDF1 file = %s", filename);
+    }
+  else if ( memcmp(buffer, "CDF\002", 4) == 0 )
+    {
+      filetype = FILETYPE_NC2;
+      if ( CDI_Debug ) Message("found CDF2 file = %s", filename);
+    }
+  else if ( memcmp(buffer+1, "HDF", 3) == 0 )
+    {
+      filetype = FILETYPE_NC4;
+      if ( CDI_Debug ) Message("found HDF file = %s", filename);
+    }
+#if  defined  (HAVE_LIBSERVICE)
+  else if ( srvCheckFiletype(fileID, &swap) )
+    {
+      filetype = FILETYPE_SRV;
+      if ( CDI_Debug ) Message("found SRV file = %s", filename);
+    }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+  else if ( extCheckFiletype(fileID, &swap) )
+    {
+      filetype = FILETYPE_EXT;
+      if ( CDI_Debug ) Message("found EXT file = %s", filename);
+    }
+#endif
+#if  defined  (HAVE_LIBIEG)
+  else if ( iegCheckFiletype(fileID, &swap) )
+    {
+      filetype = FILETYPE_IEG;
+      if ( CDI_Debug ) Message("found IEG file = %s", filename);
+    }
+#endif
+  else if ( gribCheckSeek(fileID, &recpos, &version) == 0 )
+    {
+      if ( version <= 1 )
+	{
+	  filetype = FILETYPE_GRB;
+	  if ( CDI_Debug ) Message("found seeked GRIB file = %s", filename);
+	}
+      else if ( version == 2 )
+	{
+	  filetype = FILETYPE_GRB2;
+	  if ( CDI_Debug ) Message("found seeked GRIB2 file = %s", filename);
+	}
+    }
+
+  fileClose(fileID);
+
+  *byteorder = getByteorder(swap);
+
+  return (filetype);
+}
+
+
+int _readline_(FILE *fp, char *line, int len)
+{
+  int ichar, ipos = 0;
+
+  while ( (ichar = fgetc(fp)) != EOF )
+    {
+      if ( ichar == '\n' ) break;
+      line[ipos++] = ichar;
+      if ( ipos >= len )
+        {
+          fprintf(stderr, "readline Warning: end of line not found (maxlen = %d)!\n", len);
+          break;
+        }
+    }
+  line[ipos] = 0;
+
+  if ( feof(fp) && ipos == 0 ) return (0);
+
+  return (1);
+}
+
+#define  MAX_LINE  4096
+
+int get_fnames(const char *argument, char *fnames[], int max_fnames)
+{
+  int num_fnames = 0;
+  int len;
+  int nfiles = 0;
+  int i, j;
+  const char *pch;
+  char line[MAX_LINE];
+
+  len = (int) strlen(argument);
+  for ( i = 0; i < len; ++i )
+    if ( argument[i] == ':' ) break;
+
+  if ( i < len )
+    {
+      pch = &argument[i+1];
+      len -= (i+1);
+      if ( len && ( memcmp(argument, "filelist:", i) == 0 ||
+		    memcmp(argument, "flist:", i) == 0 ) )
+	{
+	  for ( i = 0; i < len; ++i ) if ( pch[i] == ',' ) nfiles++;
+
+	  if ( nfiles == 0 )
+	    {
+	      FILE *fp;
+	      fp = fopen(pch, "r");
+	      if ( fp == NULL ) Error("Open failed on %s", pch);
+
+	      if ( CDI_Debug )
+		Message("Reading file names from %s", pch);
+
+	      rewind(fp);
+
+	      nfiles = 0;
+	      while ( _readline_(fp, line, MAX_LINE) )
+		{
+		  if ( line[0] == '#' || line[0] == '\0' ||
+		       line[0] == ' ' ) continue;
+
+		  if ( nfiles >= max_fnames )
+		    {
+		      Warning("Too many input files (limit: %d)", max_fnames);
+		      break;
+		    }
+		  fnames[nfiles] = strdupx(line);
+		  nfiles++;
+		}
+
+	      fclose(fp);
+
+	      if ( nfiles == 0 ) Error("No input file found in %s", pch);
+	    }
+	  else
+	    {
+	      char xline[65536];
+
+	      strcpy(xline, pch);
+	      for ( i = 0; i < len; i++ ) if ( xline[i] == ',' ) xline[i] = 0;
+
+	      nfiles++;
+	      if ( nfiles >= max_fnames )
+		{
+		  Warning("Too many input files (limit: %d)", max_fnames);
+		  nfiles = max_fnames;
+		}
+
+	      i = 0;
+	      for ( j = 0; j < nfiles; j++ )
+		{
+		  fnames[j] = strdupx(&xline[i]);
+		  i += strlen(&xline[i]) + 1;
+		}
+	    }
+	}
+      else if ( len && memcmp(argument, "ls:", i) == 0 )
+	{
+	  char command[4096];
+	  FILE *pfp;
+
+	  strcpy(command, "ls ");
+	  strcat(command, pch);
+
+	  pfp = popen(command, "r");
+	  if ( pfp == NULL ) SysError("popen %s failed", command);
+
+	  nfiles = 0;
+	  while ( _readline_(pfp, line, MAX_LINE) )
+	    {
+	      if ( nfiles >= max_fnames )
+		{
+		  Warning("Too many input files (limit: %d)", max_fnames);
+		  break;
+		}
+	      fnames[nfiles++] = strdupx(line);
+	    }
+
+	  pclose(pfp);
+	  /*
+	  for ( j = 0; j < nfiles; j++ )
+	    fnames[j] = fnames[j];
+	  */
+	}
+    }
+
+  num_fnames = nfiles;
+
+  return (num_fnames);
+}
+
+/*
+ at Function  streamInqFiletype
+ at Title     Get the filetype
+
+ at Prototype int streamInqFiletype(int streamID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead} or @fref{streamOpenWrite}.
+
+ at Description
+The function @func{streamInqFiletype} returns the filetype of a stream.
+
+ at Result
+ at func{streamInqFiletype} returns the type of the file format,
+one of the set of predefined CDI file format types.
+The valid CDI file format types are @func{FILETYPE_GRB}, @func{FILETYPE_GRB2}, @func{FILETYPE_NC}, @func{FILETYPE_NC2},
+ at func{FILETYPE_NC4}, @func{FILETYPE_NC4C}, @func{FILETYPE_SRV}, @func{FILETYPE_EXT} and @func{FILETYPE_IEG}.
+
+ at EndFunction
+*/
+int streamInqFiletype(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->filetype);
+}
+
+
+int getByteswap(int byteorder)
+{
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+  int byteswap = 0;
+
+  if ( IsBigendian() )
+    {
+      if ( byteorder == CDI_LITTLEENDIAN ) byteswap = TRUE;
+    }
+  else
+    {
+      if ( byteorder == CDI_BIGENDIAN ) byteswap = TRUE;
+    }
+
+  return (byteswap);
+}
+
+/*
+ at Function  streamDefByteorder
+ at Title     Define the byte order
+
+ at Prototype void streamDefByteorder(int streamID, int byteorder)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  byteorder The byte order of a dataset, one of the CDI constants @func{CDI_BIGENDIAN} and
+                     @func{CDI_LITTLEENDIAN}.
+
+ at Description
+The function @func{streamDefByteorder} defines the byte order of a binary dataset
+with the file format type @func{FILETYPE_SRV}, @func{FILETYPE_EXT} or @func{FILETYPE_IEG}.
+
+ at EndFunction
+*/
+void streamDefByteorder(int streamID, int byteorder)
+{
+  int filetype;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( reshGetStatus ( streamID, &streamOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  streamptr->byteorder = byteorder;
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+	srvrec_t *srvp = streamptr->record->srvp;
+	srvp->byteswap = getByteswap(byteorder);
+
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+	extrec_t *extp = streamptr->record->extp;
+	extp->byteswap = getByteswap(byteorder);
+
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+	iegrec_t *iegp = streamptr->record->iegp;
+	iegp->byteswap = getByteswap(byteorder);
+
+	break;
+      }
+#endif
+    }
+}
+
+/*
+ at Function  streamInqByteorder
+ at Title     Get the byte order
+
+ at Prototype int streamInqByteorder(int streamID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead} or @fref{streamOpenWrite}.
+
+ at Description
+The function @func{streamInqByteorder} returns the byte order of a binary dataset
+with the file format type @func{FILETYPE_SRV}, @func{FILETYPE_EXT} or @func{FILETYPE_IEG}.
+
+ at Result
+ at func{streamInqByteorder} returns the type of the byte order.
+The valid CDI byte order types are @func{CDI_BIGENDIAN} and @func{CDI_LITTLEENDIAN}
+
+ at EndFunction
+*/
+int streamInqByteorder(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->byteorder);
+}
+
+
+char *streamFilesuffix(int filetype)
+{
+  static char *fileSuffix[] = {"", ".grb", ".g2", ".nc", ".nc2", ".nc4", ".nc4", ".srv", ".ext", ".ieg", ".h5"};
+  int size = (int) (sizeof(fileSuffix)/sizeof(char *));
+
+  if ( filetype > 0 && filetype < size )
+    return (fileSuffix[filetype]);
+  else
+    return (fileSuffix[0]);
+}
+
+
+char *streamFilename(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->filename);
+}
+
+
+int cdiInqTimeSize(int streamID)
+{
+  int ntsteps;
+  int tsID = 0, nrecs;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  ntsteps = streamptr->ntsteps;
+
+  if ( ntsteps == CDI_UNDEFID )
+    while ( (nrecs = streamInqTimestep(streamID, tsID++)) )
+
+  ntsteps = streamptr->ntsteps;
+
+  return (ntsteps);
+}
+
+
+int cdiInqContents(int streamID)
+{
+  int filetype;
+  int vlistID;
+  int taxisID;
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        status = grbInqContents(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        status = srvInqContents(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        status = extInqContents(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        status = iegInqContents(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+        status = cdfInqContents(streamID);
+	break;
+      }
+#endif
+    default:
+      {
+	if ( CDI_Debug )
+	  Message("%s support not compiled in!", strfiletype(filetype));
+
+	status = CDI_ELIBNAVAIL;
+      }
+    }
+
+  if ( status == 0 )
+    {
+      vlistID = streamInqVlist(streamID);
+      taxisID = vlistInqTaxis(vlistID);
+      if ( taxisID != -1 )
+        {
+          taxis_t *taxisptr1 = &streamptr->tsteps[0].taxis;
+          taxis_t *taxisptr2 = taxisPtr(taxisID);
+          ptaxisCopy(taxisptr2, taxisptr1);
+          if ( taxisptr1->name     ) taxisptr2->name = taxisptr1->name;
+          if ( taxisptr1->longname ) taxisptr2->longname = taxisptr1->longname;
+        }
+    }
+
+  return (status);
+}
+
+
+int streamOpen(const char *filename, const char *filemode, int filetype)
+{
+  int fileID = CDI_UNDEFID;
+  int streamID = CDI_ESYSTEM;
+  int status;
+  Record *record = NULL;
+  stream_t *streamptr = NULL;
+  int hasLocalFile = namespaceHasLocalFile ( namespaceGetActive ());
+
+  if ( CDI_Debug )
+    Message("Open %s mode %c file %s", strfiletype(filetype), (int) *filemode, filename);
+
+  if ( ! filename || ! filemode || filetype < 0 ) return (CDI_EINVAL);
+
+  xdebug("START, filename = %s, filemode = %s, filetype = %d, "
+         "namespaceHasLocalFile(%d)=%s",
+         filename, filemode, filetype, namespaceGetActive(),
+	 namespaceHasLocalFile ( namespaceGetActive ()) ? "true":"false");
+
+  if ( hasLocalFile )
+    {
+      switch (filetype)
+	{
+#if  defined  (HAVE_LIBGRIB)
+	case FILETYPE_GRB:
+	case FILETYPE_GRB2:
+	  {
+	    fileID = gribOpen(filename, filemode);
+            if ( fileID < 0 ) fileID = CDI_ESYSTEM;
+            xdebug("%s OPENED, fileID=%d", filename, fileID);
+	    record = (Record *) malloc(sizeof(Record));
+	    record->buffer = NULL;
+	    break;
+	  }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+	case FILETYPE_SRV:
+	  {
+	    fileID = fileOpen(filename, filemode);
+            if ( fileID < 0 ) fileID = CDI_ESYSTEM;
+	    record = (Record *) malloc(sizeof(Record));
+	    record->buffer = NULL;
+	    record->srvp   = srvNew();
+	    break;
+	  }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+	case FILETYPE_EXT:
+	  {
+	    fileID = fileOpen(filename, filemode);
+            if ( fileID < 0 ) fileID = CDI_ESYSTEM;
+	    record = (Record *) malloc(sizeof(Record));
+	    record->buffer = NULL;
+	    record->extp   = extNew();
+	    break;
+	  }
+#endif
+#if  defined  (HAVE_LIBIEG)
+	case FILETYPE_IEG:
+	  {
+	    fileID = fileOpen(filename, filemode);
+            if ( fileID < 0 ) fileID = CDI_ESYSTEM;
+	    record = (Record *) malloc(sizeof(Record));
+	    record->buffer = NULL;
+	    record->iegp   = iegNew();
+	    break;
+	  }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+	case FILETYPE_NC:
+	  {
+	    fileID = cdfOpen(filename, filemode);
+	    break;
+	  }
+	case FILETYPE_NC2:
+	  {
+	    fileID = cdfOpen64(filename, filemode);
+	    break;
+	  }
+	case FILETYPE_NC4:
+	case FILETYPE_NC4C:
+	  {
+	    fileID = cdf4Open(filename, filemode, &filetype);
+	    break;
+	  }
+#endif
+	default:
+	  {
+	    if ( CDI_Debug ) Message("%s support not compiled in!", strfiletype(filetype));
+	    return (CDI_ELIBNAVAIL);
+	  }
+	}
+    }
+#ifdef USE_MPI
+  else if ( tolower ( * filemode ) == 'w' )
+    {
+      statusCode nspStatus = namespaceInqResStatus ();
+      switch ( nspStatus )
+        {
+        case STAGE_DEFINITION:
+          break;
+        case STAGE_TIMELOOP:
+          pioBufferFuncCall(STREAMOPEN, 2, filename, filetype);
+          break;
+        case STAGE_CLEANUP:
+          xabort ( "TRANSITION TO IO PROCESSES ALREADY FINISHED." );
+        break;
+        default:
+          xabort ( "INTERNAL ERROR" );
+        }
+    }
+#endif
+
+  if ( fileID < 0 && hasLocalFile )
+    {
+      streamID = fileID;
+    }
+  else
+    {
+      streamptr = stream_new_entry();
+      streamID  = streamptr->self;
+
+      if ( streamID < 0 ) return (CDI_ELIMIT);
+
+      streamptr->record   = record;
+      streamptr->filetype = filetype;
+      streamptr->filemode = tolower(*filemode);
+      streamptr->filename = strdupx(filename);
+      streamptr->fileID   = fileID;
+
+      if ( streamptr->filemode == 'r' )
+	{
+	  vlist_t *vlistptr;
+	  int vlistID;
+	  vlistID = vlistCreate();
+	  if ( vlistID < 0 ) return(CDI_ELIMIT);
+
+	  streamptr->vlistID = vlistID;
+	  /* cdiReadByteorder(streamID); */
+	  status = cdiInqContents(streamID);
+	  if ( status < 0 ) return (status);
+	  vlistptr = vlist_to_pointer(streamptr->vlistID);
+	  vlistptr->ntsteps = streamNtsteps(streamID);
+	}
+    }
+
+  return (streamID);
+}
+
+
+int streamOpenA(const char *filename, const char *filemode, int filetype)
+{
+  int fileID = CDI_UNDEFID;
+  int streamID = CDI_ESYSTEM;
+  int status;
+  Record *record = NULL;
+  stream_t *streamptr = NULL;
+
+  if ( CDI_Debug )
+    Message("Open %s mode %c file %s", strfiletype(filetype), (int) *filemode, filename);
+
+  if ( ! filename || ! filemode || filetype < 0 ) return (CDI_EINVAL);
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        fileID = gribOpen(filename, "r");
+	record = (Record *) malloc(sizeof(Record));
+	record->buffer = NULL;
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        fileID = fileOpen(filename, "r");
+	record = (Record *) malloc(sizeof(Record));
+	record->buffer = NULL;
+	record->srvp   = srvNew();
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        fileID = fileOpen(filename, "r");
+	record = (Record *) malloc(sizeof(Record));
+	record->buffer = NULL;
+	record->extp   = extNew();
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        fileID = fileOpen(filename, "r");
+	record = (Record *) malloc(sizeof(Record));
+	record->buffer = NULL;
+	record->iegp   = iegNew();
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+      {
+	fileID = cdfOpen(filename, "r");
+	break;
+      }
+    case FILETYPE_NC2:
+      {
+	fileID = cdfOpen64(filename, "r");
+	break;
+      }
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	fileID = cdf4Open(filename, "r", &filetype);
+	break;
+      }
+#endif
+    default:
+      {
+	if ( CDI_Debug ) Message("%s support not compiled in!", strfiletype(filetype));
+	return (CDI_ELIBNAVAIL);
+      }
+    }
+
+  if ( fileID == CDI_UNDEFID || fileID == CDI_ELIBNAVAIL )
+    {
+      streamID = fileID;
+      return (streamID);
+    }
+  else
+    {
+      vlist_t *vlistptr;
+      streamptr = stream_new_entry();
+      streamID = streamptr->self;
+
+      streamptr->record   = record;
+      streamptr->filetype = filetype;
+      streamptr->filemode = tolower(*filemode);
+      streamptr->filename = strdupx(filename);
+      streamptr->fileID   = fileID;
+
+      streamptr->vlistID = vlistCreate();
+      /* cdiReadByteorder(streamID); */
+      status = cdiInqContents(streamID);
+      if ( status < 0 ) return (status);
+      vlistptr = vlist_to_pointer(streamptr->vlistID);
+      vlistptr->ntsteps = cdiInqTimeSize(streamID);
+    }
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+	gribClose(fileID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+	fileClose(fileID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+	fileClose(fileID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+	fileClose(fileID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	cdfClose(fileID);
+	break;
+      }
+#endif
+    default:
+      {
+	if ( CDI_Debug ) Message("%s support not compiled in!", strfiletype(filetype));
+	return (CDI_ELIBNAVAIL);
+      }
+    }
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        fileID = gribOpen(filename, filemode);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        fileID = fileOpen(filename, filemode);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        fileID = fileOpen(filename, filemode);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        fileID = fileOpen(filename, filemode);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+      {
+	fileID = cdfOpen(filename, filemode);
+	streamptr->ncmode = 2;
+	break;
+      }
+    case FILETYPE_NC2:
+      {
+	fileID = cdfOpen64(filename, filemode);
+	streamptr->ncmode = 2;
+	break;
+      }
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	fileID = cdf4Open(filename, filemode, &filetype);
+	streamptr->ncmode = 2;
+	break;
+      }
+#endif
+    default:
+      {
+	if ( CDI_Debug ) Message("%s support not compiled in!", strfiletype(filetype));
+	return (CDI_ELIBNAVAIL);
+      }
+    }
+
+  if ( fileID == CDI_UNDEFID )
+    streamID = CDI_UNDEFID;
+  else
+    streamptr->fileID   = fileID;
+
+  return (streamID);
+}
+
+/*
+ at Function  streamOpenRead
+ at Title     Open a dataset for reading
+
+ at Prototype int streamOpenRead(const char *path)
+ at Parameter
+    @Item  path  The name of the dataset to be read.
+
+ at Description
+The function @func{streamOpenRead} opens an existing dataset for reading.
+
+ at Result
+Upon successful completion @func{streamOpenRead} returns an identifier to the
+open stream. Otherwise, a negative number with the error status is returned.
+
+ at Errors
+ at List
+   @Item  CDI_ESYSTEM     Operating system error.
+   @Item  CDI_EINVAL      Invalid argument.
+   @Item  CDI_EUFILETYPE  Unsupported file type.
+   @Item  CDI_ELIBNAVAIL  Library support not compiled in.
+ at EndList
+
+ at Example
+Here is an example using @func{streamOpenRead} to open an existing netCDF
+file named @func{foo.nc} for reading:
+
+ at Source
+#include "cdi.h"
+   ...
+int streamID;
+   ...
+streamID = streamOpenRead("foo.nc");
+if ( streamID < 0 ) handle_error(streamID);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int streamOpenRead(const char *filenames)
+{
+  int filetype, byteorder;
+  int streamID;
+  int num_fnames = 0;
+  char *fnames[MAX_FNAMES];
+  const char *filename;
+  stream_t *streamptr = NULL;
+
+  cdiInitialize();
+
+  //num_fnames = get_fnames(filenames, fnames, MAX_FNAMES);
+
+  if ( num_fnames == 0 )
+    filename = filenames;
+  else
+    {
+      int i;
+      for ( i = 0; i < num_fnames; ++i ) printf("fnames: %d %s\n", i, fnames[i]);
+      filename = fnames[0];
+    }
+
+  filetype = getFiletype(filename, &byteorder);
+
+  if ( filetype < 0 ) return (filetype);
+
+  streamID = streamOpen(filename, "r", filetype);
+
+  if ( streamID >= 0 )
+    {
+      streamptr = stream_to_pointer(streamID);
+      streamptr->byteorder = byteorder;
+
+      if ( num_fnames > 0 )
+	{
+	  int i;
+	  streamptr->nfiles = num_fnames;
+	  streamptr->fnames = (char **) malloc(num_fnames*sizeof(char *));
+	  for ( i = 0; i < num_fnames; ++i )
+	    streamptr->fnames[i] = fnames[i];
+	}
+    }
+
+  return (streamID);
+}
+
+
+int streamOpenAppend(const char *filename)
+{
+  int filetype, byteorder;
+  int streamID;
+  stream_t *streamptr;
+
+  cdiInitialize();
+
+  filetype = getFiletype(filename, &byteorder);
+
+  if ( filetype < 0 ) return (filetype);
+
+  streamID = streamOpenA(filename, "a", filetype);
+
+  if ( streamID >= 0 )
+    {
+      streamptr = stream_to_pointer(streamID);
+      streamptr->byteorder = byteorder;
+    }
+
+  return (streamID);
+}
+
+/*
+ at Function  streamOpenWrite
+ at Title     Create a new dataset
+
+ at Prototype int streamOpenWrite(const char *path, int filetype)
+ at Parameter
+    @Item  path      The name of the new dataset.
+    @Item  filetype  The type of the file format, one of the set of predefined CDI file format types.
+                     The valid CDI file format types are @func{FILETYPE_GRB}, @func{FILETYPE_GRB2}, @func{FILETYPE_NC},
+                     @func{FILETYPE_NC2}, @func{FILETYPE_NC4}, @func{FILETYPE_NC4C}, @func{FILETYPE_SRV},
+                     @func{FILETYPE_EXT} and @func{FILETYPE_IEG}.
+
+ at Description
+The function @func{streamOpenWrite} creates a new datset.
+ at Result
+Upon successful completion @func{streamOpenWrite} returns an identifier to the
+open stream. Otherwise, a negative number with the error status is returned.
+
+ at Errors
+ at List
+   @Item  CDI_ESYSTEM     Operating system error.
+   @Item  CDI_EINVAL      Invalid argument.
+   @Item  CDI_EUFILETYPE  Unsupported file type.
+   @Item  CDI_ELIBNAVAIL  Library support not compiled in.
+ at EndList
+
+ at Example
+Here is an example using @func{streamOpenWrite} to create a new netCDF file
+named @func{foo.nc} for writing:
+
+ at Source
+#include "cdi.h"
+   ...
+int streamID;
+   ...
+streamID = streamOpenWrite("foo.nc", FILETYPE_NC);
+if ( streamID < 0 ) handle_error(streamID);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int streamOpenWrite(const char *filename, int filetype)
+{
+  cdiInitialize();
+
+  return (streamOpen(filename, "w", filetype));
+}
+
+/*
+ at Function  streamClose
+ at Title     Close an open dataset
+
+ at Prototype  void streamClose(int streamID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead} or @fref{streamOpenWrite}.
+
+ at Description
+The function @func{streamClose} closes an open dataset.
+
+ at EndFunction
+*/
+void streamClose(int streamID)
+{
+  int filetype;
+  int fileID;
+  int index;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( CDI_Debug )
+    Message("fileID = %d filename = %s", streamID, streamptr->filename);
+
+  fileID   = streamptr->fileID;
+  filetype = streamptr->filetype;
+  vlistID  = streamptr->vlistID;
+
+  if ( namespaceHasLocalFile ( namespaceGetActive ()))
+    {
+      if ( fileID == CDI_UNDEFID )
+        Warning("File %s not open!", streamptr->filename);
+      else
+	switch (filetype)
+	  {
+#if  defined  (HAVE_LIBGRIB)
+	  case FILETYPE_GRB:
+	  case FILETYPE_GRB2:
+	    {
+	      gribClose(fileID);
+	      gribContainersDelete(streamID);
+	      break;
+	    }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+	  case FILETYPE_SRV:
+	    {
+	      fileClose(fileID);
+	      srvDelete(streamptr->record->srvp);
+	      break;
+	    }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+	  case FILETYPE_EXT:
+	    {
+	      fileClose(fileID);
+	      extDelete(streamptr->record->extp);
+	      break;
+	    }
+#endif
+#if  defined  (HAVE_LIBIEG)
+	  case FILETYPE_IEG:
+	    {
+	      fileClose(fileID);
+	      iegDelete(streamptr->record->iegp);
+	      break;
+	    }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+	  case FILETYPE_NC:
+	  case FILETYPE_NC2:
+	  case FILETYPE_NC4:
+	  case FILETYPE_NC4C:
+	    {
+	      cdfClose(fileID);
+	      break;
+	    }
+#endif
+	  default:
+	    {
+	      Error("%s support not compiled in!", strfiletype(filetype));
+	      break;
+	    }
+	  }
+    }
+#ifdef USE_MPI
+  else
+    {
+      statusCode nspStatus = namespaceInqResStatus ();
+      switch ( nspStatus )
+        {
+        case STAGE_DEFINITION:
+          break;
+        case STAGE_TIMELOOP:
+          pioBufferFuncCall(STREAMCLOSE, 1, streamID);
+          break;
+        case STAGE_CLEANUP:
+        break;
+        default:
+          xabort ( "INTERNAL ERROR" );
+        }
+    }
+#endif
+
+  if ( streamptr->record )
+      {
+	  if ( streamptr->record->buffer )
+              free(streamptr->record->buffer);
+
+	  free(streamptr->record);
+      }
+
+  streamptr->filetype = 0;
+  if ( streamptr->filename ) free(streamptr->filename);
+
+  for ( index = 0; index < streamptr->nvars; index++ )
+    {
+      if ( streamptr->vars[index].level )
+	free(streamptr->vars[index].level);
+      if ( streamptr->vars[index].lindex )
+	free(streamptr->vars[index].lindex);
+    }
+  free(streamptr->vars);
+
+  for ( index = 0; index < streamptr->ntsteps; ++index )
+    {
+      if ( streamptr->tsteps[index].records )
+	free(streamptr->tsteps[index].records);
+      if ( streamptr->tsteps[index].recIDs )
+	free(streamptr->tsteps[index].recIDs);
+    }
+
+  if ( streamptr->tsteps ) free(streamptr->tsteps);
+
+  if ( streamptr->nfiles > 0 )
+    {
+      for ( index = 0; index < streamptr->nfiles; ++index )
+	free(streamptr->fnames[index]);
+
+      free(streamptr->fnames);
+    }
+
+  if ( vlistID != -1 )
+    {
+      if ( streamptr->filemode != 'w' )
+	if ( vlistInqTaxis(vlistID) != -1 )
+	  {
+	    taxisDestroy(vlistInqTaxis(vlistID));
+	  }
+
+      vlistDestroy(vlistID);
+    }
+
+  stream_delete_entry(streamptr);
+}
+
+/*
+ at Function  streamSync
+ at Title     Synchronize an Open Dataset to Disk
+
+ at Prototype  void streamSync(int streamID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+
+ at Description
+The function @func{streamSync} offers a way to synchronize the disk copy of a dataset with in-memory buffers.
+
+ at EndFunction
+*/
+void streamSync(int streamID)
+{
+  int filetype;
+  int fileID;
+  int vlistID;
+  int nvars;
+  stream_t *streamptr;
+
+  if ( !namespaceHasLocalFile ( namespaceGetActive ())) return;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID   = streamptr->fileID;
+  filetype = streamptr->filetype;
+  vlistID  = streamInqVlist(streamID);
+  nvars    = vlistNvars(vlistID);
+
+  if ( fileID == CDI_UNDEFID )
+    Warning("File %s not open!", streamptr->filename);
+  else if ( vlistID == CDI_UNDEFID )
+    Warning("Vlist undefined for file %s!", streamptr->filename);
+  else if ( nvars == 0 )
+    Warning("No variables defined!");
+  else
+    {
+      if ( streamptr->filemode == 'w' || streamptr->filemode == 'a' )
+	{
+	  switch (filetype)
+	    {
+#if  defined  (HAVE_LIBNETCDF)
+	    case FILETYPE_NC:
+	    case FILETYPE_NC2:
+	    case FILETYPE_NC4:
+	    case FILETYPE_NC4C:
+	      {
+		void cdf_sync(int ncid);
+		if ( streamptr->ncmode == 2 ) cdf_sync(fileID);
+		break;
+	      }
+#endif
+	    default:
+	      {
+		fileFlush(fileID);
+		break;
+	      }
+	    }
+	}
+    }
+}
+
+/*
+ at Function  streamDefTimestep
+ at Title     Define time step
+
+ at Prototype int streamDefTimestep(int streamID, int tsID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  tsID      Timestep identifier.
+
+ at Description
+The function @func{streamDefTimestep} defines the time step of a stream.
+
+ at Result
+ at func{streamDefTimestep} returns the number of records of the time step.
+
+ at EndFunction
+*/
+int streamDefTimestep(int streamID, int tsID)
+{
+  int newtsID;
+  int taxisID;
+  int vlistID;
+  int time_is_varying;
+  stream_t *streamptr;
+  taxis_t *taxisptr1;
+  taxis_t *taxisptr2;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  tsID = %d", streamID, tsID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+
+  time_is_varying = vlistHasTime(vlistID);
+
+  if ( time_is_varying )
+    {
+      taxisID = vlistInqTaxis(vlistID);
+      if ( taxisID == CDI_UNDEFID )
+        {
+          Warning("taxisID undefined for fileID = %d! Using absolute time axis.", streamID);
+          taxisID = taxisCreate(TAXIS_ABSOLUTE);
+          vlistDefTaxis(vlistID, taxisID);
+        }
+    }
+
+  newtsID = tstepsNewEntry(streamID);
+
+  if ( tsID != newtsID )
+    Error("Internal problem: tsID = %d newtsID = %d", tsID, newtsID);
+
+  streamptr->curTsID = tsID;
+
+  if ( time_is_varying )
+    {
+      taxisptr1 = taxisPtr(taxisID);
+      taxisptr2 = &streamptr->tsteps[tsID].taxis;
+      ptaxisCopy(taxisptr2, taxisptr1);
+      if ( tsID == 0 )
+        {
+          if ( taxisptr1->name     ) taxisptr2->name = taxisptr1->name;
+          if ( taxisptr1->longname ) taxisptr2->longname = taxisptr1->longname;
+        }
+    }
+
+  streamptr->ntsteps = tsID + 1;
+
+  if ( namespaceHasLocalFile(namespaceGetActive())
+       && (streamptr->filetype == FILETYPE_NC  ||
+           streamptr->filetype == FILETYPE_NC2 ||
+           streamptr->filetype == FILETYPE_NC4 ||
+           streamptr->filetype == FILETYPE_NC4C)
+       && time_is_varying )
+    cdfDefTimestep(streamID, tsID);
+
+  cdiCreateRecords(streamID, tsID);
+
+  return (streamptr->ntsteps);
+}
+
+/*
+ at Function  streamInqTimestep
+ at Title     Get time step
+
+ at Prototype int streamInqTimestep(int streamID, int tsID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead} or @fref{streamOpenWrite}.
+    @Item  tsID      Timestep identifier.
+
+ at Description
+The function @func{streamInqTimestep} returns the time step of a stream.
+
+ at Result
+ at func{streamInqTimestep} returns the number of records of the time step.
+
+ at EndFunction
+*/
+int streamInqTimestep(int streamID, int tsID)
+{
+  int filetype;
+  int nrecs = 0;
+  int taxisID;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+
+  if ( tsID < streamptr->rtsteps )
+    {
+      streamptr->curTsID = tsID;
+      nrecs = streamptr->tsteps[tsID].nrecs;
+      streamptr->tsteps[tsID].curRecID = CDI_UNDEFID;
+      taxisID = vlistInqTaxis(vlistID);
+      if ( taxisID == -1 )
+	Error("Timestep undefined for fileID = %d", streamID);
+      ptaxisCopy(taxisPtr(taxisID), &streamptr->tsteps[tsID].taxis);
+
+      return (nrecs);
+    }
+
+  if ( tsID >= streamptr->ntsteps && streamptr->ntsteps != CDI_UNDEFID )
+    {
+      return (0);
+    }
+
+  filetype = streamptr->filetype;
+
+  if ( CDI_Debug )
+    Message("streamID = %d  tsID = %d  filetype = %d", streamID, tsID, filetype);
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        nrecs = grbInqTimestep(streamID, tsID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        nrecs = srvInqTimestep(streamID, tsID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        nrecs = extInqTimestep(streamID, tsID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        nrecs = iegInqTimestep(streamID, tsID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+        nrecs = cdfInqTimestep(streamID, tsID);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+
+  taxisID = vlistInqTaxis(vlistID);
+  if ( taxisID == -1 )
+    Error("Timestep undefined for fileID = %d", streamID);
+
+  ptaxisCopy(taxisPtr(taxisID), &streamptr->tsteps[tsID].taxis);
+
+  return (nrecs);
+}
+
+/*
+ at Function  streamReadVar
+ at Title     Read a variable
+
+ at Prototype void streamReadVar(int streamID, int varID, double *data, int *nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead}.
+    @Item  varID     Variable identifier.
+    @Item  data      Pointer to the location into which the data values are read.
+                     The caller must allocate space for the returned values.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamReadVar reads all the values of one time step of a variable
+from an open dataset.
+ at EndFunction
+*/
+void streamReadVar(int streamID, int varID, double *data, int *nmiss)
+{
+  int filetype;
+  stream_t *streamptr;
+
+  if ( CDI_Debug ) Message("streamID = %d  varID = %d", streamID, varID);
+
+  check_parg(data);
+  check_parg(nmiss);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  *nmiss = 0;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        grbReadVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        srvReadVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        extReadVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        iegReadVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+        cdfReadVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+
+void stream_write_var(int streamID, int varID, int memtype, const void *data, int nmiss)
+{
+  int filetype;
+  stream_t *streamptr;
+
+  if ( CDI_Debug ) Message("streamID = %d varID = %d", streamID, varID);
+
+  check_parg(data);
+
+  /* begin deike */
+#ifdef USE_MPI
+  if ( ! namespaceHasLocalFile ( namespaceGetActive ()))
+    {
+      statusCode nspStatus = namespaceInqResStatus ();
+      switch ( nspStatus )
+        {
+        case STAGE_DEFINITION:
+          xabort ( "DEFINITION STAGE: PARALLEL WRITING NOT POSSIBLE." );
+          break;
+        case STAGE_TIMELOOP:
+          pioBufferData ( streamID, varID, data, nmiss );
+          return;
+        case STAGE_CLEANUP:
+          xabort ( "CLEANUP STAGE: PARALLEL WRITING NOT POSSIBLE." );
+          break;
+        default:
+          xabort ( "INTERNAL ERROR" );
+        }
+    }
+#endif
+  /* end deike */
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  // streamDefineTaxis(streamID);
+
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("grbWriteVar not implemented for memtype float!");
+        grbWriteVarDP(streamID, varID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("srvWriteVar not implemented for memtype float!");
+        srvWriteVarDP(streamID, varID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("extWriteVar not implemented for memtype float!");
+        extWriteVarDP(streamID, varID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("iegWriteVar not implemented for memtype float!");
+        iegWriteVarDP(streamID, varID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	if ( streamptr->accessmode == 0 ) cdfEndDef(streamID);
+        cdf_write_var(streamID, varID, memtype, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+/*
+ at Function  streamWriteVar
+ at Title     Write a variable
+
+ at Prototype void streamWriteVar(int streamID, int varID, const double *data, int nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  varID     Variable identifier.
+    @Item  data      Pointer to a block of double precision floating point data values to be written.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamWriteVar writes the values of one time step of a variable to an open dataset.
+The values are converted to the external data type of the variable, if necessary.
+ at EndFunction
+*/
+void streamWriteVar(int streamID, int varID, const double *data, int nmiss)
+{
+  stream_write_var(streamID, varID, MEMTYPE_DOUBLE, data, nmiss);
+}
+
+/*
+ at Function  streamWriteVarF
+ at Title     Write a variable
+
+ at Prototype void streamWriteVarF(int streamID, int varID, const float *data, int nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  varID     Variable identifier.
+    @Item  data      Pointer to a block of single precision floating point data values to be written.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamWriteVarF writes the values of one time step of a variable to an open dataset.
+The values are converted to the external data type of the variable, if necessary.
+Only support for netCDF was implemented in this function.
+ at EndFunction
+*/
+void streamWriteVarF(int streamID, int varID, const float *data, int nmiss)
+{
+  stream_write_var(streamID, varID, MEMTYPE_FLOAT, data, nmiss);
+}
+
+/*
+ at Function  streamReadVarSlice
+ at Title     Read a horizontal slice of a variable
+
+ at Prototype void streamReadVarSlice(int streamID, int varID, int levelID, double *data, int *nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead}.
+    @Item  varID     Variable identifier.
+    @Item  levelID   Level identifier.
+    @Item  data      Pointer to the location into which the data values are read.
+                     The caller must allocate space for the returned values.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamReadVar reads all the values of a horizontal slice of a variable
+from an open dataset.
+ at EndFunction
+*/
+void streamReadVarSlice(int streamID, int varID, int levelID, double *data, int *nmiss)
+{
+  int filetype;
+  stream_t *streamptr;
+
+  if ( CDI_Debug ) Message("streamID = %d  varID = %d", streamID, varID);
+
+  check_parg(data);
+  check_parg(nmiss);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  *nmiss = 0;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        grbReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        srvReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        extReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        iegReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+        /* FIXME: status value ignored */
+        int ierr = cdfReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+
+void stream_write_var_slice(int streamID, int varID, int levelID, int memtype, const void *data, int nmiss)
+{
+  int filetype;
+  stream_t *streamptr;
+
+  if ( CDI_Debug ) Message("streamID = %d varID = %d", streamID, varID);
+
+  check_parg(data);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("grbWriteVarSlice not implemented for memtype float!");
+        grbWriteVarSliceDP(streamID, varID, levelID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("srvWriteVarSlice not implemented for memtype float!");
+        srvWriteVarSliceDP(streamID, varID, levelID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("extWriteVarSlice not implemented for memtype float!");
+        extWriteVarSliceDP(streamID, varID, levelID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("iegWriteVarSlice not implemented for memtype float!");
+        iegWriteVarSliceDP(streamID, varID, levelID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+        int ierr = 0;
+	if ( streamptr->accessmode == 0 ) cdfEndDef(streamID);
+        ierr = cdf_write_var_slice(streamID, varID, levelID, memtype, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+/*
+ at Function  streamWriteVarSlice
+ at Title     Write a horizontal slice of a variable
+
+ at Prototype void streamWriteVarSlice(int streamID, int varID, int levelID, const double *data, int nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  varID     Variable identifier.
+    @Item  levelID   Level identifier.
+    @Item  data      Pointer to a block of double precision floating point data values to be written.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamWriteVarSlice writes the values of a horizontal slice of a variable to an open dataset.
+The values are converted to the external data type of the variable, if necessary.
+ at EndFunction
+*/
+void streamWriteVarSlice(int streamID, int varID, int levelID, const double *data, int nmiss)
+{
+  stream_write_var_slice(streamID, varID, levelID, MEMTYPE_DOUBLE, data, nmiss);
+}
+
+/*
+ at Function  streamWriteVarSliceF
+ at Title     Write a horizontal slice of a variable
+
+ at Prototype void streamWriteVarSliceF(int streamID, int varID, int levelID, const float *data, int nmiss)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  varID     Variable identifier.
+    @Item  levelID   Level identifier.
+    @Item  data      Pointer to a block of single precision floating point data values to be written.
+    @Item  nmiss     Number of missing values.
+
+ at Description
+The function streamWriteVarSliceF writes the values of a horizontal slice of a variable to an open dataset.
+The values are converted to the external data type of the variable, if necessary.
+Only support for netCDF was implemented in this function.
+ at EndFunction
+*/
+void streamWriteVarSliceF(int streamID, int varID, int levelID, const float *data, int nmiss)
+{
+  stream_write_var_slice(streamID, varID, levelID, MEMTYPE_FLOAT, data, nmiss);
+}
+
+
+void streamWriteContents(int streamID, char *cname)
+{
+  FILE *cnp;
+  int tsID, recID, varID, levelID;
+  long recsize;
+  int nrecs, nvars;
+  int code, gridID, zaxisID, tsteptype, datatype;
+  int ngrids;
+  int filetype, gridtype;
+  int xsize, ysize;
+  int date, time;
+  int i;
+  off_t recpos, position;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+
+  cnp = fopen(cname, "w");
+
+  if ( cnp == NULL ) SysError(cname);
+
+  fprintf(cnp, "#CDI library version %s\n", cdiLibraryVersion());
+  fprintf(cnp, "#\n");
+
+  fprintf(cnp, "filename: %s\n", streamptr->filename);
+  filetype = streamptr->filetype;
+  fprintf(cnp, "filetype: %s\n", strfiletype(filetype));
+
+  fprintf(cnp, "#\n");
+  fprintf(cnp, "#grids:\n");
+
+  ngrids = vlistNgrids(vlistID);
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID   = vlistGrid(vlistID, i);
+      gridtype = gridInqType(gridID);
+      xsize    = gridInqXsize(gridID);
+      ysize    = gridInqYsize(gridID);
+      fprintf(cnp, "%4d:%4d:%4d:%4d\n", i+1, gridtype, xsize, ysize);
+    }
+
+  fprintf(cnp, "#\n");
+
+  fprintf(cnp, "varID:code:gridID:zaxisID:tsteptype:datatype\n");
+
+  nvars = vlistNvars(vlistID);
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      code      = vlistInqVarCode(vlistID, varID);
+      gridID    = vlistInqVarGrid(vlistID, varID);
+      zaxisID   = vlistInqVarZaxis(vlistID, varID);
+      tsteptype = vlistInqVarTsteptype(vlistID, varID);
+      datatype  = vlistInqVarDatatype(vlistID, varID);
+      fprintf(cnp, "%4d:%4d:%4d:%4d:%4d:%4d:\n",
+	      varID+1, code, gridID, zaxisID, tsteptype, datatype);
+    }
+
+  fprintf(cnp, "#\n");
+
+  fprintf(cnp, "tsID:nrecs:date:time\n");
+
+  tsID = 0;
+  while (1)
+    {
+      nrecs = streamptr->tsteps[tsID].nallrecs;
+      date  = streamptr->tsteps[tsID].taxis.vdate;
+      time  = streamptr->tsteps[tsID].taxis.vtime;
+      position = streamptr->tsteps[tsID].position;
+
+      fprintf(cnp, "%4d:%4d:%4d:%4d:%ld\n",
+	      tsID, nrecs, date, time, (long) position);
+
+      if ( streamptr->tsteps[tsID].next )
+	tsID++;
+      else
+	break;
+    }
+
+  fprintf(cnp, "#\n");
+
+  fprintf(cnp, "tsID:recID:varID:levID:size:pos\n");
+
+  tsID = 0;
+  while (1)
+    {
+      nrecs = streamptr->tsteps[tsID].nallrecs;
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  varID   = streamptr->tsteps[tsID].records[recID].varID;
+	  levelID = streamptr->tsteps[tsID].records[recID].levelID;
+	  recpos  = streamptr->tsteps[tsID].records[recID].position;
+	  recsize = (long)streamptr->tsteps[tsID].records[recID].size;
+	  fprintf(cnp, "%4d:%4d:%4d:%4d:%4ld:%ld\n",
+		  tsID, recID, varID, levelID, recsize, (long) recpos);
+	}
+
+      if ( streamptr->tsteps[tsID].next )
+	tsID++;
+      else
+	break;
+    }
+
+  fclose(cnp);
+}
+
+
+void cdiDefTableID(int tableID)
+{
+  int modelID, instID;
+
+  cdiDefaultTableID = tableID;
+
+  modelID = tableInqModel(tableID);
+  cdiDefaultModelID = modelID;
+
+  instID = modelInqInstitut(modelID);
+  cdiDefaultInstID = instID;
+}
+
+
+void cdiPrintVersion(void)
+{
+  fprintf(stderr, "     CDI library version : %s\n", cdiLibraryVersion());
+#if  defined  (HAVE_LIBCGRIBEX)
+  fprintf(stderr, " CGRIBEX library version : %s\n", cgribexLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBGRIB_API)
+  fprintf(stderr, "GRIB_API library version : %s\n", gribapiLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+  fprintf(stderr, "  netCDF library version : %s\n", cdfLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBHDF5)
+  fprintf(stderr, "    HDF5 library version : %s\n", hdfLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+  fprintf(stderr, " SERVICE library version : %s\n", srvLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+  fprintf(stderr, "   EXTRA library version : %s\n", extLibraryVersion());
+#endif
+#if  defined  (HAVE_LIBIEG)
+  fprintf(stderr, "     IEG library version : %s\n", iegLibraryVersion());
+#endif
+  fprintf(stderr, "    FILE library version : %s\n", fileLibraryVersion());
+}
+
+
+int streamNtsteps(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->ntsteps);
+}
+
+
+off_t   streamNvals(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->numvals);
+}
+
+/*
+ at Function  streamDefVlist
+ at Title     Define the variable list
+
+ at Prototype void streamDefVlist(int streamID, int vlistID)
+ at Parameter
+    @Item  streamID Stream ID, from a previous call to @fref{streamOpenWrite}.
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+
+ at Description
+The function @func{streamDefVlist} defines the variable list of a stream.
+
+ at EndFunction
+*/
+void streamDefVlist(int streamID, int vlistID)
+{
+  int nvars, varID;
+  int gridID, zaxisID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+#ifdef USE_MPI
+  if (!namespaceHasLocalFile(namespaceGetActive()))
+  {
+    statusCode nspStatus = namespaceInqResStatus ();
+    switch ( nspStatus )
+      {
+      case STAGE_DEFINITION:
+        break;
+      case STAGE_TIMELOOP:
+        pioBufferFuncCall(STREAMDEFVLIST, 2, streamID, vlistID);
+        break;
+      case STAGE_CLEANUP:
+        xabort ( "TRANSITION TO IO PROCESSES ALREADY FINISHED." );
+        break;
+      default:
+        xabort ( "INTERNAL ERROR" );
+      }
+  }
+
+#endif
+
+  if ( streamptr->vlistID == CDI_UNDEFID )
+    {
+      streamptr->vlistID = vlistDuplicate(vlistID);
+      streamptr->vlistIDorig = vlistID ;
+
+      nvars = vlistNvars(vlistID);
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridID  = vlistInqVarGrid(vlistID, varID);
+	  zaxisID = vlistInqVarZaxis(vlistID, varID);
+	  streamNewVar(streamID, gridID, zaxisID);
+	  if ( streamptr->have_missval )
+	    vlistDefVarMissval(streamptr->vlistID, varID, 
+                               vlistInqVarMissval(vlistID, varID));
+	}
+
+      if (namespaceHasLocalFile(namespaceGetActive())
+          && streamptr->filemode == 'w' )
+	{
+	  if ( streamptr->filetype == FILETYPE_NC  ||
+	       streamptr->filetype == FILETYPE_NC2 ||
+	       streamptr->filetype == FILETYPE_NC4 ||
+	       streamptr->filetype == FILETYPE_NC4C )
+	    {
+	      cdfDefVars(streamID);
+	    }
+	  else if ( streamptr->filetype == FILETYPE_GRB  ||
+		    streamptr->filetype == FILETYPE_GRB2 )
+	    {
+	      gribContainersNew(streamID);
+	    }
+	}
+    }
+  else
+    {
+      Warning("vlist already defined for %s!", streamptr->filename);
+    }
+}
+
+/*
+ at Function  streamInqVlist
+ at Title     Get the variable list
+
+ at Prototype int streamInqVlist(int streamID)
+ at Parameter
+    @Item  streamID  Stream ID, from a previous call to @fref{streamOpenRead} or @fref{streamOpenWrite}.
+
+ at Description
+The function @func{streamInqVlist} returns the variable list of a stream.
+
+ at Result
+ at func{streamInqVlist} returns an identifier to the variable list.
+
+ at EndFunction
+*/
+int streamInqVlist(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->vlistID);
+}
+
+
+int streamInqVlistIDorig(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->vlistIDorig);
+}
+
+
+void streamDefCompType(int streamID, int comptype)
+{
+  stream_t *streamptr;
+
+  if ( reshGetStatus ( streamID, &streamOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->comptype = comptype;
+}
+
+
+void streamDefCompLevel(int streamID, int complevel)
+{
+  stream_t *streamptr;
+
+  if ( reshGetStatus ( streamID, &streamOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->complevel = complevel;
+}
+
+
+int streamInqCompType(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->comptype);
+}
+
+
+int streamInqCompLevel(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (streamptr->complevel);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_cdf.c b/libcdi/src/stream_cdf.c
new file mode 100644
index 0000000..9d40679
--- /dev/null
+++ b/libcdi/src/stream_cdf.c
@@ -0,0 +1,7283 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+//#define TEST_GROUPS 1
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <math.h>
+#include <float.h>
+
+#include "dmemory.h"
+
+#include "cdi.h"
+#include "basetime.h"
+#include "gaussgrid.h"
+#include "stream_int.h"
+#include "stream_cdf.h"
+#include "cdf_int.h"
+#include "varscan.h"
+#include "vlist.h"
+
+
+#if  defined  (HAVE_LIBNETCDF)
+#  include "netcdf.h"
+#endif
+
+//#define PROJECTION_TEST
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+
+void cdfDefGlobalAtts(int streamID);
+void cdfDefLocalAtts(int streamID);
+
+
+#define  X_AXIS  1
+#define  Y_AXIS  2
+#define  Z_AXIS  3
+#define  T_AXIS  4
+
+typedef struct {
+  int     ncvarid;
+  int     dimtype;
+  size_t  len;
+  char    name[CDI_MAX_NAME];
+}
+ncdim_t;
+
+typedef struct {
+  int      ncid;
+  int      ignore;
+  int      isvar;
+  int      islon;
+  int      islat;
+  int      islev;
+  int      istime;
+  int      warn;
+  int      tsteptype;
+  int      param;
+  int      code;
+  int      tabnum;
+  int      bounds;
+  int      gridID;
+  int      zaxisID;
+  int      gridtype;
+  int      zaxistype;
+  int      xdim;
+  int      ydim;
+  int      zdim;
+  int      xvarid;
+  int      yvarid;
+  int      zvarid;
+  int      tvarid;
+  int      ncoordvars;
+  int      coordvarids[4];
+  int      cellarea;
+  int      calendar;
+  int      tableID;
+  int      truncation;
+  int      defmiss;
+  int      xtype;
+  int      ndims;
+  int      gmapid;
+  int      positive;
+  int      dimids[8];
+  int      dimtype[8];
+  int      chunks[8];
+  int      chunked;
+  int      chunktype;
+  int      natts;
+  int     *atts;
+  int      deflate;
+  int      lunsigned;
+  int      lvalidrange;
+  size_t   vlen;
+  double  *vdata;
+  double   missval;
+  double   addoffset;
+  double   scalefactor;
+  double   validrange[2];
+  char     name[CDI_MAX_NAME];
+  char     longname[CDI_MAX_NAME];
+  char     stdname[CDI_MAX_NAME];
+  char     units[CDI_MAX_NAME];
+  ensinfo_t   *ensdata;    /* Ensemble information */
+}
+ncvar_t;
+
+#ifdef HAVE_LIBNETCDF
+static
+void strtolower(char *str)
+{
+  int i, len;
+
+  if ( str )
+    {
+      len = (int) strlen(str);
+      for ( i = 0; i < len; i++ )
+        str[i] = tolower((int) str[i]);
+    }
+}
+
+static
+int get_timeunit(int len, char *ptu)
+{
+  int timeunit = -1;
+
+  if ( len > 2 )
+    {
+      if      ( memcmp(ptu, "sec",    3) == 0 )          timeunit = TUNIT_SECOND;
+      else if ( memcmp(ptu, "minute", 6) == 0 )          timeunit = TUNIT_MINUTE;
+      else if ( memcmp(ptu, "hour",   4) == 0 )          timeunit = TUNIT_HOUR;
+      else if ( memcmp(ptu, "day",    3) == 0 )          timeunit = TUNIT_DAY;
+      else if ( memcmp(ptu, "month",  5) == 0 )          timeunit = TUNIT_MONTH;
+      else if ( memcmp(ptu, "calendar_month", 14) == 0 ) timeunit = TUNIT_MONTH;
+      else if ( memcmp(ptu, "year",   4) == 0 )          timeunit = TUNIT_YEAR;
+    }
+  else if ( len == 1 )
+    {
+      if ( ptu[0] == 's' ) timeunit = TUNIT_SECOND;
+    }
+
+  return (timeunit);
+}
+
+static
+int isTimeUnits(const char *timeunits)
+{
+  int len, i;
+  char *ptu, *tu;
+  int timetype = -1;
+  int timeunit;
+  int status = FALSE;
+
+  len = (int) strlen(timeunits);
+  tu = (char *) malloc((len+1)*sizeof(char));
+  memcpy(tu, timeunits, (len+1)*sizeof(char));
+  ptu = tu;
+
+  for ( i = 0; i < len; i++ ) ptu[i] = tolower((int) ptu[i]);
+
+  timeunit = get_timeunit(len, ptu);
+  if ( timeunit != -1 )
+    {
+
+      while ( ! isspace(*ptu) && *ptu != 0 ) ptu++;
+      if ( *ptu )
+        {
+          while ( isspace(*ptu) ) ptu++;
+
+          if ( memcmp(ptu, "as", 2) == 0 )
+            timetype = TAXIS_ABSOLUTE;
+          else if ( memcmp(ptu, "since", 5) == 0 )
+            timetype = TAXIS_RELATIVE;
+
+          if ( timetype != -1 ) status = TRUE;
+        }
+    }
+
+  free(tu);
+
+  return (status);
+}
+
+static
+int splitBasetime(const char *timeunits, taxis_t *taxis)
+{
+  int len, i;
+  char *ptu, *tu;
+  int year, month, day;
+  int hour = 0, minute = 0, second = 0;
+  int timetype = TAXIS_ABSOLUTE;
+  int rdate = -1, rtime = -1;
+  int timeunit;
+
+  len = (int) strlen(timeunits);
+  tu = (char *) malloc((len+1)*sizeof(char));
+  memcpy(tu, timeunits, (len+1)*sizeof(char));
+  ptu = tu;
+
+  for ( i = 0; i < len; i++ ) ptu[i] = tolower((int) ptu[i]);
+
+  timeunit = get_timeunit(len, ptu);
+  if ( timeunit == -1 )
+    {
+      Message("Unsupported TIMEUNIT: %s!", timeunits);
+      return (1);
+    }
+
+  while ( ! isspace(*ptu) && *ptu != 0 ) ptu++;
+  if ( *ptu )
+    {
+      while ( isspace(*ptu) ) ptu++;
+
+      if ( memcmp(ptu, "as", 2) == 0 )
+        timetype = TAXIS_ABSOLUTE;
+      else if ( memcmp(ptu, "since", 5) == 0 )
+        timetype = TAXIS_RELATIVE;
+
+      while ( ! isspace(*ptu) && *ptu != 0 ) ptu++;
+      if ( *ptu )
+        {
+          while ( isspace(*ptu) ) ptu++;
+
+          if ( timetype == TAXIS_ABSOLUTE )
+            {
+              if ( memcmp(ptu, "%y%m%d.%f", 9) != 0 && timeunit == TUNIT_DAY )
+                {
+                  Message("Unsupported format %s for TIMEUNIT day!", ptu);
+                  timeunit = -1;
+                }
+              else if ( memcmp(ptu, "%y%m.%f", 7) != 0 && timeunit == TUNIT_MONTH )
+                {
+                  Message("Unsupported format %s for TIMEUNIT month!", ptu);
+                  timeunit = -1;
+                }
+            }
+          else if ( timetype == TAXIS_RELATIVE )
+            {
+              int v1, v2, v3;
+              v1 = atoi(ptu);
+              if ( v1 < 0 ) ptu++;
+              while ( isdigit((int) *ptu) ) ptu++;
+              v2 = atoi(++ptu);
+              while ( isdigit((int) *ptu) ) ptu++;
+              v3 = atoi(++ptu);
+              while ( isdigit((int) *ptu) ) ptu++;
+
+              if ( v3 > 999 && v1 < 32 )
+                { year = v3; month = v2; day = v1; }
+              else
+                { year = v1; month = v2; day = v3; }
+
+              while ( isspace((int) *ptu) ) ptu++;
+
+              if ( *ptu )
+                {
+                  while ( ! isdigit((int) *ptu) ) ptu++;
+
+                  hour = atoi(ptu);
+                  while ( isdigit((int) *ptu) ) ptu++;
+                  if ( *ptu == ':' )
+                    {
+                      ptu++;
+                      minute = atoi(ptu);
+                      while ( isdigit((int) *ptu) ) ptu++;
+                      if ( *ptu == ':' )
+                        {
+                          ptu++;
+                          second = atoi(ptu);
+                          /*
+                          if ( second != 0 )
+                            Message("Seconds not supported in time units!");
+                          */
+                        }
+                    }
+                }
+
+              rdate = cdiEncodeDate(year, month, day);
+              rtime = cdiEncodeTime(hour, minute, second);
+              (*taxis).rdate = rdate;
+              (*taxis).rtime = rtime;
+
+              if ( CDI_Debug )
+                Message("rdate = %d  rtime = %d", rdate, rtime);
+            }
+        }
+    }
+
+  (*taxis).type = timetype;
+  (*taxis).unit = timeunit;
+
+  free(tu);
+
+  if ( CDI_Debug )
+    Message("timetype = %d  unit = %d", timetype, timeunit);
+
+  return (0);
+}
+
+static
+void cdfGetAttInt(int fileID, int ncvarid, char *attname, int attlen, int *attint)
+{
+  size_t nc_attlen;
+  int *pintatt;
+
+  cdf_inq_attlen(fileID, ncvarid, attname, &nc_attlen);
+
+  if ( (int)nc_attlen > attlen )
+    pintatt = (int *) malloc(nc_attlen*sizeof(int));
+  else
+    pintatt = attint;
+
+  cdf_get_att_int(fileID, ncvarid, attname, pintatt);
+
+  if ( (int)nc_attlen > attlen )
+    {
+      memcpy(attint, pintatt, attlen*sizeof(int));
+      free(pintatt);
+    }
+}
+
+static
+void cdfGetAttDouble(int fileID, int ncvarid, char *attname, int attlen, double *attdouble)
+{
+  size_t nc_attlen;
+  double *pdoubleatt;
+
+  cdf_inq_attlen(fileID, ncvarid, attname, &nc_attlen);
+
+  if ( (int)nc_attlen > attlen )
+    pdoubleatt = (double *) malloc(nc_attlen*sizeof(double));
+  else
+    pdoubleatt = attdouble;
+
+  cdf_get_att_double(fileID, ncvarid, attname, pdoubleatt);
+
+  if ( (int)nc_attlen > attlen )
+    {
+      memcpy(attdouble, pdoubleatt, attlen*sizeof(double));
+      free(pdoubleatt);
+    }
+}
+
+static
+void cdfGetAttText(int fileID, int ncvarid, char *attname, int attlen, char *atttext)
+{
+  size_t nc_attlen;
+  char attbuf[65636];
+
+  cdf_inq_attlen(fileID, ncvarid, attname, &nc_attlen);
+
+  if ( nc_attlen < sizeof(attbuf) )
+    {
+      cdf_get_att_text(fileID, ncvarid, attname, attbuf);
+
+      attbuf[nc_attlen++] = 0;
+
+      if ( (int) nc_attlen > attlen ) nc_attlen = attlen;
+      memcpy(atttext, attbuf, nc_attlen);
+    }
+  else
+    {
+      atttext[0] = 0;
+    }
+}
+
+static
+int cdfInqDatatype(int xtype, int lunsigned)
+{
+  int datatype = -1;
+
+#if  defined  (HAVE_NETCDF4)
+  if ( xtype == NC_BYTE && lunsigned ) xtype = NC_UBYTE;
+#endif
+
+  if      ( xtype == NC_BYTE   )  datatype = DATATYPE_INT8;
+  /* else if ( xtype == NC_CHAR   )  datatype = DATATYPE_UINT8; */
+  else if ( xtype == NC_SHORT  )  datatype = DATATYPE_INT16;
+  else if ( xtype == NC_INT    )  datatype = DATATYPE_INT32;
+  else if ( xtype == NC_FLOAT  )  datatype = DATATYPE_FLT32;
+  else if ( xtype == NC_DOUBLE )  datatype = DATATYPE_FLT64;
+#if  defined  (HAVE_NETCDF4)
+  else if ( xtype == NC_UBYTE  )  datatype = DATATYPE_UINT8;
+  else if ( xtype == NC_LONG   )  datatype = DATATYPE_INT32;
+  else if ( xtype == NC_USHORT )  datatype = DATATYPE_UINT16;
+  else if ( xtype == NC_UINT   )  datatype = DATATYPE_UINT32;
+  else if ( xtype == NC_INT64  )  datatype = DATATYPE_FLT64;
+  else if ( xtype == NC_UINT64 )  datatype = DATATYPE_FLT64;
+#endif
+
+  return (datatype);
+}
+
+static
+int cdfDefDatatype(int datatype, int filetype)
+{
+  int xtype;
+
+  if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    Error("CDI/netCDF library does not support complex numbers!");
+
+  if ( filetype == FILETYPE_NC4 )
+    {
+      if      ( datatype == DATATYPE_INT8   ) xtype = NC_BYTE;
+      else if ( datatype == DATATYPE_INT16  ) xtype = NC_SHORT;
+      else if ( datatype == DATATYPE_INT32  ) xtype = NC_INT;
+#if  defined  (HAVE_NETCDF4)
+      else if ( datatype == DATATYPE_UINT8  ) xtype = NC_UBYTE;
+      else if ( datatype == DATATYPE_UINT16 ) xtype = NC_USHORT;
+      else if ( datatype == DATATYPE_UINT32 ) xtype = NC_UINT;
+#else
+      else if ( datatype == DATATYPE_UINT8  ) xtype = NC_SHORT;
+      else if ( datatype == DATATYPE_UINT16 ) xtype = NC_INT;
+      else if ( datatype == DATATYPE_UINT32 ) xtype = NC_INT;
+#endif
+      else if ( datatype == DATATYPE_FLT64  ) xtype = NC_DOUBLE;
+      else                                    xtype = NC_FLOAT;
+    }
+  else
+    {
+      if      ( datatype == DATATYPE_INT8   ) xtype = NC_BYTE;
+      else if ( datatype == DATATYPE_INT16  ) xtype = NC_SHORT;
+      else if ( datatype == DATATYPE_INT32  ) xtype = NC_INT;
+      else if ( datatype == DATATYPE_UINT8  ) xtype = NC_SHORT;
+      else if ( datatype == DATATYPE_UINT16 ) xtype = NC_INT;
+      else if ( datatype == DATATYPE_UINT32 ) xtype = NC_INT;
+      else if ( datatype == DATATYPE_FLT64  ) xtype = NC_DOUBLE;
+      else                                    xtype = NC_FLOAT;
+    }
+
+  return (xtype);
+}
+
+static
+void defineAttributes(int vlistID, int varID, int fileID, int ncvarID)
+{
+  int natts, iatt;
+  int atttype, attlen;
+  size_t len;
+  char attname[1024];
+
+  vlistInqNatts(vlistID, varID, &natts);
+
+  for ( iatt = 0; iatt < natts; iatt++ )
+    {
+      vlistInqAtt(vlistID, varID, iatt, attname, &atttype, &attlen);
+
+      if ( attlen == 0 ) continue;
+
+      if ( atttype == DATATYPE_TXT )
+        {
+          char *atttxt;
+          atttxt = (char *) malloc(attlen*sizeof(char));
+          vlistInqAttTxt(vlistID, varID, attname, attlen, atttxt);
+          len = attlen;
+          cdf_put_att_text(fileID, ncvarID, attname, len, atttxt);
+          free(atttxt);
+        }
+      else if ( atttype == DATATYPE_INT16 || atttype == DATATYPE_INT32 )
+        {
+          int *attint;
+          attint = (int *) malloc(attlen*sizeof(int));
+          vlistInqAttInt(vlistID, varID, attname, attlen, &attint[0]);
+          len = attlen;
+          if ( atttype == DATATYPE_INT16 )
+            cdf_put_att_int(fileID, ncvarID, attname, NC_SHORT, len, attint);
+          else
+            cdf_put_att_int(fileID, ncvarID, attname, NC_INT, len, attint);
+          free(attint);
+        }
+      else if ( atttype == DATATYPE_FLT32 || atttype == DATATYPE_FLT64 )
+        {
+          double *attflt;
+          attflt = (double *) malloc(attlen*sizeof(double));
+          vlistInqAttFlt(vlistID, varID, attname, attlen, attflt);
+          len = attlen;
+          if ( atttype == DATATYPE_FLT32 )
+            cdf_put_att_double(fileID, ncvarID, attname, NC_FLOAT, len, attflt);
+          else
+            cdf_put_att_double(fileID, ncvarID, attname, NC_DOUBLE, len, attflt);
+          free(attflt);
+        }
+    }
+}
+#endif
+
+int cdfCopyRecord(int streamID2, int streamID1)
+{
+  double *data;
+  int datasize;
+  int tsID1, recID1;
+  int ivarID, gridID;
+  int nmiss;
+  int ierr = 0;
+  int memtype = MEMTYPE_DOUBLE;
+  int vlistID1;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  vlistID1 = streamptr1->vlistID;
+
+  tsID1 = streamptr1->curTsID;
+
+  recID1 = streamptr1->tsteps[tsID1].curRecID;
+
+  ivarID = streamptr1->tsteps[tsID1].records[recID1].varID;
+
+  gridID = vlistInqVarGrid(vlistID1, ivarID);
+
+  datasize = gridInqSize(gridID);
+  /* bug fix for constant netCDF fields */
+  if ( datasize < 1048576 ) datasize = 1048576;
+
+  data = (double *) malloc(datasize*sizeof(double));
+
+  streamReadRecord(streamID1, data, &nmiss);
+  stream_write_record(streamID2, memtype, data, nmiss);
+
+  free(data);
+
+  return (ierr);
+}
+
+/* not used
+int cdfInqRecord(int streamID, int *varID, int *levelID)
+{
+  int tsID, recID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  recID = streamptr->tsteps[0].curRecID++;
+  printf("cdfInqRecord recID %d %d\n", recID, streamptr->tsteps[0].curRecID);
+  printf("cdfInqRecord tsID %d\n", streamptr->curTsID);
+
+  if ( streamptr->tsteps[0].curRecID >= 
+       streamptr->tsteps[0].nrecs )
+    {
+      streamptr->tsteps[0].curRecID = 0;
+    }
+
+  *varID   = streamptr->tsteps[0].records[recID].varID;
+  *levelID = streamptr->tsteps[0].records[recID].levelID;
+
+  streamptr->record->varID   = *varID;
+  streamptr->record->levelID = *levelID;
+
+  if ( CDI_Debug )
+    Message("recID = %d  varID = %d  levelID = %d", recID, *varID, *levelID);
+  
+  return (recID+1);
+}
+*/
+int cdfDefRecord(int streamID)
+{
+  int ierr = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d", streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (ierr);
+}
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfWriteGridTraj(int streamID, int gridID)
+{
+  int tsID, fileID;
+  int lonID, latID, gridindex;
+  size_t index;
+  double xlon, xlat;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  lonID = streamptr->xdimID[gridindex];
+  latID = streamptr->ydimID[gridindex];
+
+  xlon = gridInqXval(gridID, 0);
+  xlat = gridInqYval(gridID, 0);
+  tsID = streamptr->curTsID;
+  index = tsID;
+
+  cdf_put_var1_double(fileID, lonID, &index, &xlon);
+  cdf_put_var1_double(fileID, latID, &index, &xlat);
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfReadGridTraj(int streamID, int gridID)
+{
+  int tsID, fileID;
+  int lonID, latID, gridindex;
+  size_t index;
+  double xlon, xlat;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  lonID = streamptr->xdimID[gridindex];
+  latID = streamptr->ydimID[gridindex];
+
+  tsID = streamptr->curTsID;
+  index = tsID;
+
+  cdf_get_var1_double(fileID, lonID, &index, &xlon);
+  cdf_get_var1_double(fileID, latID, &index, &xlat);
+
+  gridDefXvals(gridID, &xlon);
+  gridDefYvals(gridID, &xlat);
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefVarDeflate(int ncid, int ncvarid, int deflate_level)
+{
+#if  defined  (HAVE_NETCDF4)
+  int retval;
+  /* Set chunking, shuffle, and deflate. */
+  int shuffle = 1;
+  int deflate = 1;
+
+  if ( deflate_level < 1 || deflate_level > 9 ) deflate_level = 1;
+
+  if ((retval = nc_def_var_deflate(ncid, ncvarid, shuffle, deflate, deflate_level)))
+    {
+      Error("nc_def_var_deflate failed, status = %d", retval);
+    }
+#else
+  static int lwarn = TRUE;
+
+  if ( lwarn )
+    {
+      lwarn = FALSE;
+      Warning("Deflate compression failed, netCDF4 not available!");
+    }
+#endif
+}
+#endif
+
+#if  defined(HAVE_LIBNETCDF) && defined(NC_SZIP_NN_OPTION_MASK)
+static
+void cdfDefVarSzip(int ncid, int ncvarid)
+{
+  int retval;
+  /* Set options_mask and bits_per_pixel. */
+  int options_mask = NC_SZIP_NN_OPTION_MASK;
+  int bits_per_pixel = 16;
+
+  if ((retval = nc_def_var_szip(ncid, ncvarid, options_mask, bits_per_pixel)))
+    {
+      if ( retval == NC_EINVAL )
+        {
+          static int lwarn = TRUE;
+
+          if ( lwarn )
+            {
+              lwarn = FALSE;
+              Warning("netCDF4/Szip compression not compiled in!");
+            }
+        }
+      else
+        Error("nc_def_var_szip failed, status = %d", retval);
+    }
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefVarMissval(int streamID, int varID, int dtype, int lcheck)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->vars[varID].defmiss == FALSE )
+    {
+      int fileID;
+      int ncvarid;
+      double missval;
+      int vlistID;
+      int xtype;
+
+      vlistID = streamInqVlist(streamID);
+      fileID  = streamInqFileID(streamID);
+      ncvarid = streamptr->vars[varID].ncvarid;
+      missval = vlistInqVarMissval(vlistID, varID);
+      if ( lcheck && streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      xtype = cdfDefDatatype(dtype, streamptr->filetype);
+
+      cdf_put_att_double(fileID, ncvarid, "_FillValue", (nc_type) xtype, 1, &missval);
+
+      if ( cdiNcMissingValue == 1 )
+        cdf_put_att_double(fileID, ncvarid, "missing_value", (nc_type) xtype, 1, &missval);
+
+      if ( lcheck && streamptr->ncmode == 2 ) cdf_enddef(fileID);
+
+      streamptr->vars[varID].defmiss = TRUE;
+    }
+}
+#endif
+
+void cdf_write_record(int streamID, int memtype, const void *data, int nmiss)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int varID;
+  int levelID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  varID   = streamptr->record->varID;
+  levelID = streamptr->record->levelID;
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  cdf_write_var_slice(streamID, varID, levelID, memtype, data, nmiss);
+#endif
+}
+
+
+int cdfReadRecord(int streamID, double *data, int *nmiss)
+{
+  int ierr = 0;
+  int levelID, varID, tsID, recID, vrecID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug ) Message("streamID = %d", streamID);
+
+  tsID    = streamptr->curTsID;
+  vrecID  = streamptr->tsteps[tsID].curRecID;
+  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+  varID   = streamptr->tsteps[tsID].records[recID].varID;
+  levelID = streamptr->tsteps[tsID].records[recID].levelID;
+
+  cdfReadVarSliceDP(streamID, varID, levelID, data, nmiss);
+
+  return (ierr);
+}
+
+static
+void cdfDefTimeValue(int streamID, int tsID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  double timevalue;
+  int ncvarid;
+  size_t index;
+  taxis_t *taxis;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  fileID = streamInqFileID(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d, fileID = %d", streamID, fileID);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->ncmode == 1 )
+    {
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  index = tsID;
+
+  timevalue = cdiEncodeTimeval(taxis->vdate, taxis->vtime, &streamptr->tsteps[0].taxis);
+  if ( CDI_Debug ) Message("tsID = %d  timevalue = %f", tsID, timevalue);
+
+  ncvarid = streamptr->basetime.ncvarid;
+  cdf_put_var1_double(fileID, ncvarid, &index, &timevalue);
+
+  if ( taxis->has_bounds )
+    {
+      size_t start[2], count[2];
+
+      ncvarid = streamptr->basetime.ncvarboundsid;
+
+      timevalue = cdiEncodeTimeval(taxis->vdate_lb, taxis->vtime_lb, &streamptr->tsteps[0].taxis);
+      start[0] = tsID; count[0] = 1; start[1] = 0; count[1] = 1;
+      cdf_put_vara_double(fileID, ncvarid, start, count, &timevalue);
+
+      timevalue = cdiEncodeTimeval(taxis->vdate_ub, taxis->vtime_ub, &streamptr->tsteps[0].taxis);
+      start[0] = tsID; count[0] = 1; start[1] = 1; count[1] = 1;
+      cdf_put_vara_double(fileID, ncvarid, start, count, &timevalue);
+    }
+  /*
+printf("fileID = %d %d %d %f\n", fileID, time_varid, index, timevalue);
+  */
+#endif
+}
+
+static
+void cdfDefTime(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  int time_varid;
+  int time_bndsid;
+  int dims[2];
+  int year, month, day, hour, minute, second;
+  char unitstr[80];
+  char calstr[80];
+  char tmpstr[CDI_MAX_NAME];
+  char default_name[] = "time";
+  char *taxis_name = default_name;
+  size_t len;
+  taxis_t *taxis;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->basetime.ncvarid != UNDEFID ) return;
+
+  fileID = streamInqFileID(streamID);
+
+  if ( streamptr->ncmode == 0 ) streamptr->ncmode = 1;
+
+  if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+  taxis = &streamptr->tsteps[0].taxis;
+
+  if ( taxis->name && taxis->name[0] ) taxis_name = taxis->name;
+
+  cdf_def_dim(fileID, taxis_name, NC_UNLIMITED, &streamptr->basetime.ncdimid);
+
+  dims[0] = streamptr->basetime.ncdimid;
+  cdf_def_var(fileID, taxis_name, NC_DOUBLE, 1, dims, &time_varid);
+
+  streamptr->basetime.ncvarid = time_varid;
+
+  strcpy(tmpstr, "time");
+  cdf_put_att_text(fileID, time_varid, "standard_name", strlen(tmpstr), tmpstr);
+
+  if ( taxis->longname && taxis->longname[0] )
+    cdf_put_att_text(fileID, time_varid, "long_name", strlen(taxis->longname), taxis->longname);
+
+  if ( taxis->has_bounds )
+    {
+      /* fprintf(stderr, "time has bounds\n"); */
+
+      if ( nc_inq_dimid(fileID, "nb2", &dims[1]) != NC_NOERR )
+	cdf_def_dim(fileID, "nb2", 2, &dims[1]);
+
+      strcpy(tmpstr, taxis_name);
+      strcat(tmpstr, "_bnds");
+      cdf_def_var(fileID, tmpstr, NC_DOUBLE, 2, dims, &time_bndsid);
+
+      streamptr->basetime.ncvarboundsid = time_bndsid;
+
+      cdf_put_att_text(fileID, time_varid, "bounds", strlen(tmpstr), tmpstr);
+    }
+
+  unitstr[0] = 0;
+  if ( streamptr->tsteps[0].taxis.type == TAXIS_ABSOLUTE )
+    {
+      if ( streamptr->tsteps[0].taxis.unit == TUNIT_YEAR )
+        sprintf(unitstr, "year as %s", "%Y.%f");
+      else if ( streamptr->tsteps[0].taxis.unit == TUNIT_MONTH )
+        sprintf(unitstr, "month as %s", "%Y%m.%f");
+      else
+        sprintf(unitstr, "day as %s", "%Y%m%d.%f");
+    }
+  else
+    {
+      int rdate, rtime;
+      int timeunit;
+
+      timeunit = taxis->unit;
+      if ( timeunit == -1 ) timeunit = TUNIT_HOUR;
+      rdate    = taxis->rdate;
+      rtime    = taxis->rtime;
+      if ( rdate == -1 )
+        {
+          rdate  = taxis->vdate;
+          rtime  = taxis->vtime;
+        }
+
+      cdiDecodeDate(rdate, &year, &month, &day);
+      cdiDecodeTime(rtime, &hour, &minute, &second);
+
+      if ( timeunit == TUNIT_QUARTER ) timeunit = TUNIT_MINUTE;
+      if ( timeunit == TUNIT_3HOURS  ||
+	   timeunit == TUNIT_6HOURS  ||
+	   timeunit == TUNIT_12HOURS ) timeunit = TUNIT_HOUR;
+
+      sprintf(unitstr, "%s since %d-%02d-%02d %02d:%02d:%02d",
+              tunitNamePtr(timeunit), year, month, day, hour, minute, second);
+    }
+
+  len = strlen(unitstr);
+  if ( len )
+    cdf_put_att_text(fileID, time_varid, "units", len, unitstr);
+
+  if ( taxis->has_bounds )
+    if ( len )
+      cdf_put_att_text(fileID, time_bndsid, "units", len, unitstr);
+
+  if ( taxis->calendar != -1 )
+    {
+      calstr[0] = 0;
+
+      if      ( taxis->calendar == CALENDAR_STANDARD )  strcpy(calstr, "standard");
+      else if ( taxis->calendar == CALENDAR_PROLEPTIC ) strcpy(calstr, "proleptic_gregorian");
+      else if ( taxis->calendar == CALENDAR_NONE )      strcpy(calstr, "none");
+      else if ( taxis->calendar == CALENDAR_360DAYS )   strcpy(calstr, "360_day");
+      else if ( taxis->calendar == CALENDAR_365DAYS )   strcpy(calstr, "365_day");
+      else if ( taxis->calendar == CALENDAR_366DAYS )   strcpy(calstr, "366_day");
+
+      len = strlen(calstr);
+      if ( len )
+        {
+          cdf_put_att_text(fileID, time_varid, "calendar", len, calstr);
+
+          if ( taxis->has_bounds )
+            cdf_put_att_text(fileID, time_bndsid, "calendar", len, calstr);
+        }
+    }
+
+  if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
+#endif
+}
+
+
+void cdfDefTimestep(int streamID, int tsID)
+{
+  int vlistID;
+
+  vlistID = streamInqVlist(streamID);
+
+  if ( vlistHasTime(vlistID) ) cdfDefTime(streamID);
+
+  cdfDefTimeValue(streamID, tsID);
+}
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefComplex(int streamID, int gridID)
+{
+  char axisname[] = "nc2";
+  int index;
+  int dimID = UNDEFID;
+  int gridID0, gridtype0, gridindex;
+  int ngrids;
+  int fileID;
+  int dimlen;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->xdimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_SPECTRAL || gridtype0 == GRID_FOURIER )
+            {
+              dimID = streamptr->xdimID[index];
+              break;
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      dimlen = 2;
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  streamptr->xdimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefSP(int streamID, int gridID)
+{
+  /*
+  char longname[] = "Spherical harmonic coefficient";
+  */
+  char axisname[5] = "nspX";
+  int index, iz = 0;
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqSize(gridID)/2;
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->ydimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_SPECTRAL )
+            {
+              dimlen0 = gridInqSize(gridID0)/2;
+              if ( dimlen == dimlen0 )
+                {
+                  dimID = streamptr->ydimID[index];
+                  break;
+                }
+              else
+                iz++;
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      if ( iz == 0 ) axisname[3] = '\0';
+      else           sprintf(&axisname[3], "%1d", iz+1);
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  streamptr->ydimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefFC(int streamID, int gridID)
+{
+  char axisname[5] = "nfcX";
+  int index, iz = 0;
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqSize(gridID)/2;
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->ydimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_FOURIER )
+            {
+              dimlen0 = gridInqSize(gridID0)/2;
+              if ( dimlen == dimlen0 )
+                {
+                  dimID = streamptr->ydimID[index];
+                  break;
+                }
+              else
+                iz++;
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      if ( iz == 0 ) axisname[3] = '\0';
+      else           sprintf(&axisname[3], "%1d", iz+1);
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  streamptr->ydimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefTrajLon(int streamID, int gridID)
+{
+  char units[CDI_MAX_NAME];
+  char longname[CDI_MAX_NAME];
+  char stdname[CDI_MAX_NAME];
+  char axisname[CDI_MAX_NAME];
+  int gridtype, gridindex;
+  int dimID = UNDEFID;
+  int fileID;
+  int dimlen;
+  size_t len;
+  int ncvarid;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  gridtype = gridInqType(gridID);
+  dimlen = gridInqXsize(gridID);
+  if ( dimlen != 1 ) Error("Xsize isn't 1 for %s grid!", gridNamePtr(gridtype));
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  ncvarid = streamptr->xdimID[gridindex];
+
+  gridInqXname(gridID, axisname);
+  gridInqXlongname(gridID, longname);
+  gridInqXstdname(gridID, stdname);
+  gridInqXunits(gridID, units);
+
+  if ( ncvarid == UNDEFID )
+    {
+      dimID = streamptr->basetime.ncvarid;
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID, &ncvarid);
+
+      if ( (len = strlen(stdname)) )
+        cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname);
+      if ( (len = strlen(longname)) )
+        cdf_put_att_text(fileID, ncvarid, "long_name", len, longname);
+      if ( (len = strlen(units)) )
+        cdf_put_att_text(fileID, ncvarid, "units", len, units);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  streamptr->xdimID[gridindex] = ncvarid; /* var ID for trajectory !!! */
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefTrajLat(int streamID, int gridID)
+{
+  char units[] = "degrees_north";
+  char longname[] = "latitude";
+  char stdname[] = "latitude";
+  char axisname[] = "tlat";
+  int gridtype, gridindex;
+  int dimID = UNDEFID;
+  int fileID;
+  int dimlen;
+  size_t len;
+  int ncvarid;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID = streamInqFileID(streamID);
+
+  gridtype = gridInqType(gridID);
+  dimlen = gridInqYsize(gridID);
+  if ( dimlen != 1 ) Error("Ysize isn't 1 for %s grid!", gridNamePtr(gridtype));
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  ncvarid = streamptr->ydimID[gridindex];
+
+  gridInqYname(gridID, axisname);
+  gridInqYlongname(gridID, longname);
+  gridInqYstdname(gridID, stdname);
+  gridInqYunits(gridID, units);
+
+  if ( ncvarid == UNDEFID )
+    {
+      dimID = streamptr->basetime.ncvarid;
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID, &ncvarid);
+
+      if ( (len = strlen(stdname)) )
+        cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname);
+      if ( (len = strlen(longname)) )
+        cdf_put_att_text(fileID, ncvarid, "long_name", len, longname);
+      if ( (len = strlen(units)) )
+        cdf_put_att_text(fileID, ncvarid, "units", len, units);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  streamptr->ydimID[gridindex] = ncvarid; /* var ID for trajectory !!! */
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+int checkGridName(int type, char *axisname, int fileID, int vlistID, int gridID, int ngrids, int mode)
+{
+  int iz, index;
+  int gridID0;
+  int ncdimid;
+  char axisname0[CDI_MAX_NAME];
+  char axisname2[CDI_MAX_NAME];
+  int checkname;
+  int status;
+
+  /* check that the name is not already defined */
+  checkname = TRUE;
+  iz = 0;
+
+  while ( checkname ) 
+    {
+      strcpy(axisname2, axisname);
+      if ( iz ) sprintf(&axisname2[strlen(axisname2)], "_%d", iz+1);
+
+      //status = nc_inq_varid(fileID, axisname2, &ncvarid);
+      if ( type == 'V' ) /* type Var oder Dim */
+        status = nc_inq_varid(fileID, axisname2, &ncdimid);
+      else
+        status = nc_inq_dimid(fileID, axisname2, &ncdimid);
+
+      if ( status != NC_NOERR )
+        {
+          if ( iz )
+            {
+              /* check that the name does not exist for other grids */
+              for ( index = 0; index < ngrids; index++ )
+                {
+                  gridID0 = vlistGrid(vlistID, index);
+                  if ( gridID != gridID0 )
+                    {
+                      if ( mode == 'X' ) /* mode X or Y */
+                        gridInqXname(gridID0, axisname0);
+                      else
+                        gridInqYname(gridID0, axisname0);
+
+                      if ( strcmp(axisname0, axisname2) == 0 ) break;
+                    }
+                }
+              if ( index == ngrids ) checkname = FALSE;
+            }
+          else
+            {
+              checkname = FALSE;
+            }
+        }
+
+      if ( checkname ) iz++;
+
+      if ( iz > 99 ) break;
+    }
+
+  if ( iz ) sprintf(&axisname[strlen(axisname)], "_%d", iz+1);
+
+  return (iz);
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefXaxis(int streamID, int gridID)
+{
+  char units[CDI_MAX_NAME];
+  char longname[CDI_MAX_NAME];
+  char stdname[CDI_MAX_NAME];
+  char axisname[CDI_MAX_NAME];
+  int index;
+  /*  int index2; */
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int dimIDs[2];
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  size_t len;
+  int ncvarid = UNDEFID, ncbvarid = UNDEFID;
+  int nvertex = 2, nvdimID = UNDEFID;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqXsize(gridID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+
+  gridInqXname(gridID, axisname);
+  gridInqXlongname(gridID, longname);
+  gridInqXstdname(gridID, stdname);
+  gridInqXunits(gridID, units);
+
+  if ( axisname[0] == 0 ) Error("axis name undefined!");
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->xdimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_GAUSSIAN    ||
+               gridtype0 == GRID_LONLAT      ||
+               gridtype0 == GRID_CURVILINEAR ||
+               gridtype0 == GRID_GENERIC )
+            {
+              dimlen0 = gridInqXsize(gridID0);
+              if ( dimlen == dimlen0 )
+                if ( IS_EQUAL(gridInqXval(gridID0, 0), gridInqXval(gridID, 0)) &&
+                     IS_EQUAL(gridInqXval(gridID0, dimlen-1), gridInqXval(gridID, dimlen-1)) )
+                  {
+                    dimID = streamptr->xdimID[index];
+                    break;
+                  }
+              /*
+              for ( index2 = 0; index2 < index; index2++ )
+                if ( streamptr->xdimID[index] == streamptr->xdimID[index2] )
+                  break;
+              if ( index2 == index ) iz++;
+              */
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      int status;
+      status = checkGridName('V', axisname, fileID, vlistID, gridID, ngrids, 'X');
+      if ( status == 0 )
+        status = checkGridName('D', axisname, fileID, vlistID, gridID, ngrids, 'X');
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      if ( gridInqXboundsPtr(gridID) || gridInqYboundsPtr(gridID) )
+        {
+          if ( nc_inq_dimid(fileID, "nb2", &nvdimID) != NC_NOERR )
+            cdf_def_dim(fileID, "nb2", nvertex, &nvdimID);
+        }
+
+      if ( gridInqXvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID, &ncvarid);
+
+          if ( (len = strlen(stdname)) )
+            cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname);
+          if ( (len = strlen(longname)) )
+            cdf_put_att_text(fileID, ncvarid, "long_name", len, longname);
+          if ( (len = strlen(units)) )
+            cdf_put_att_text(fileID, ncvarid, "units", len, units);
+
+          cdf_put_att_text(fileID, ncvarid, "axis", 1, "X");
+
+          if ( gridInqXboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              strcat(axisname, "_bnds");
+              dimIDs[0] = dimID;
+              dimIDs[1] = nvdimID;
+              cdf_def_var(fileID, axisname, (nc_type) xtype, 2, dimIDs, &ncbvarid);
+              cdf_put_att_text(fileID, ncvarid, "bounds", strlen(axisname), axisname);
+            }
+          /*
+          if ( gridIsRotated(gridID) )
+            {
+              double north_pole = gridInqXpole(gridID);
+              cdf_put_att_double(fileID, ncvarid, "north_pole", NC_DOUBLE, 1, &north_pole);
+            }
+          */
+        }
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+
+      if ( ncvarid  != UNDEFID ) cdf_put_var_double(fileID, ncvarid, gridInqXvalsPtr(gridID));
+      if ( ncbvarid != UNDEFID ) cdf_put_var_double(fileID, ncbvarid, gridInqXboundsPtr(gridID));
+    }
+
+  streamptr->xdimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefYaxis(int streamID, int gridID)
+{
+  char units[CDI_MAX_NAME];
+  char longname[CDI_MAX_NAME];
+  char stdname[CDI_MAX_NAME];
+  char axisname[CDI_MAX_NAME];
+  int index;
+  /*  int index2; */
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int dimIDs[2];
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  size_t len;
+  int ncvarid = UNDEFID, ncbvarid = UNDEFID;
+  int nvertex = 2, nvdimID = UNDEFID;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqYsize(gridID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+
+  gridInqYname(gridID, axisname);
+  gridInqYlongname(gridID, longname);
+  gridInqYstdname(gridID, stdname);
+  gridInqYunits(gridID, units);
+
+  if ( axisname[0] == 0 ) Error("axis name undefined!");
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->ydimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_GAUSSIAN    ||
+               gridtype0 == GRID_LONLAT      ||
+               gridtype0 == GRID_CURVILINEAR ||
+               gridtype0 == GRID_GENERIC )
+            {
+              dimlen0 = gridInqYsize(gridID0);
+              if ( dimlen == dimlen0 )
+                if ( IS_EQUAL(gridInqYval(gridID0, 0), gridInqYval(gridID, 0)) &&
+                     IS_EQUAL(gridInqYval(gridID0, dimlen-1), gridInqYval(gridID, dimlen-1)) )
+                  {
+                    dimID = streamptr->ydimID[index];
+                    break;
+                  }
+              /*
+              for ( index2 = 0; index2 < index; index2++ )
+                if ( streamptr->ydimID[index] == streamptr->ydimID[index2] )
+                  break;
+              if ( index2 == index ) iz++;
+              */
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      int status;
+      status = checkGridName('V', axisname, fileID, vlistID, gridID, ngrids, 'Y');
+      if ( status == 0 )
+        status = checkGridName('D', axisname, fileID, vlistID, gridID, ngrids, 'Y');
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      if ( gridInqXboundsPtr(gridID) || gridInqYboundsPtr(gridID) )
+        {
+          if ( nc_inq_dimid(fileID, "nb2", &nvdimID) != NC_NOERR )
+            cdf_def_dim(fileID, "nb2", nvertex, &nvdimID);
+        }
+
+      if ( gridInqYvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID, &ncvarid);
+
+          if ( (len = strlen(stdname)) )
+            cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname);
+          if ( (len = strlen(longname)) )
+            cdf_put_att_text(fileID, ncvarid, "long_name", len, longname);
+          if ( (len = strlen(units)) )
+            cdf_put_att_text(fileID, ncvarid, "units", len, units);
+
+          cdf_put_att_text(fileID, ncvarid, "axis", 1, "Y");
+
+          if ( gridInqYboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              strcat(axisname, "_bnds");
+              dimIDs[0] = dimID;
+              dimIDs[1] = nvdimID;
+              cdf_def_var(fileID, axisname, (nc_type) xtype, 2, dimIDs, &ncbvarid);
+              cdf_put_att_text(fileID, ncvarid, "bounds", strlen(axisname), axisname);
+            }
+          /*
+          if ( gridIsRotated(gridID) )
+            {
+              double north_pole = gridInqYpole(gridID);
+              cdf_put_att_double(fileID, ncvarid, "north_pole", NC_DOUBLE, 1, &north_pole);
+            }
+          */
+        }
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+
+      if ( ncvarid  != UNDEFID ) cdf_put_var_double(fileID, ncvarid, gridInqYvalsPtr(gridID));
+      if ( ncbvarid != UNDEFID ) cdf_put_var_double(fileID, ncbvarid, gridInqYboundsPtr(gridID));
+    }
+
+  streamptr->ydimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfGridCompress(int fileID, int ncvarid, int gridsize, int filetype, int comptype)
+{
+#if  defined  (HAVE_NETCDF4)
+  if ( gridsize > 1 && comptype == COMPRESS_ZIP && (filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C) )
+    {
+      nc_def_var_chunking(fileID, ncvarid, NC_CHUNKED, NULL);
+      cdfDefVarDeflate(fileID, ncvarid, 1);
+    }
+#endif
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefCurvilinear(int streamID, int gridID)
+{
+  char xunits[CDI_MAX_NAME];
+  char xlongname[CDI_MAX_NAME];
+  char xstdname[CDI_MAX_NAME];
+  char yunits[CDI_MAX_NAME];
+  char ylongname[CDI_MAX_NAME];
+  char ystdname[CDI_MAX_NAME];
+  char xaxisname[CDI_MAX_NAME];
+  char yaxisname[CDI_MAX_NAME];
+  char xdimname[4] = "x";
+  char ydimname[4] = "y";
+  int index;
+  int gridID0, gridtype0, gridindex;
+  int xdimID = UNDEFID;
+  int ydimID = UNDEFID;
+  int dimIDs[3];
+  int ngrids;
+  int fileID;
+  int xdimlen, ydimlen, dimlen0;
+  size_t len;
+  int ncxvarid = UNDEFID, ncyvarid = UNDEFID;
+  int ncbxvarid = UNDEFID, ncbyvarid = UNDEFID, ncavarid = UNDEFID;
+  int nvertex = 4, nvdimID = UNDEFID;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  xdimlen = gridInqXsize(gridID);
+  ydimlen = gridInqYsize(gridID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+
+  gridInqXname(gridID, xaxisname);
+  gridInqXlongname(gridID, xlongname);
+  gridInqXstdname(gridID, xstdname);
+  gridInqXunits(gridID, xunits);
+  gridInqYname(gridID, yaxisname);
+  gridInqYlongname(gridID, ylongname);
+  gridInqYstdname(gridID, ystdname);
+  gridInqYunits(gridID, yunits);
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->xdimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_GAUSSIAN    ||
+               gridtype0 == GRID_LONLAT      ||
+               gridtype0 == GRID_CURVILINEAR ||
+               gridtype0 == GRID_GENERIC )
+            {
+              dimlen0 = gridInqXsize(gridID0);
+              if ( xdimlen == dimlen0 )
+                if ( IS_EQUAL(gridInqXval(gridID0, 0), gridInqXval(gridID, 0)) &&
+                     IS_EQUAL(gridInqXval(gridID0, xdimlen-1), gridInqXval(gridID, xdimlen-1)) )
+                  {
+                    xdimID = streamptr->xdimID[index];
+                    break;
+                  }
+              dimlen0 = gridInqYsize(gridID0);
+              if ( ydimlen == dimlen0 )
+                if ( IS_EQUAL(gridInqYval(gridID0, 0), gridInqYval(gridID, 0)) &&
+                     IS_EQUAL(gridInqYval(gridID0, xdimlen-1), gridInqYval(gridID, xdimlen-1)) )
+                  {
+                    ydimID = streamptr->ydimID[index];
+                    break;
+                  }
+            }
+        }
+    }
+
+  if ( xdimID == UNDEFID || ydimID == UNDEFID )
+    {
+      int status;
+      status = checkGridName('V', xaxisname, fileID, vlistID, gridID, ngrids, 'X');
+      status = checkGridName('V', yaxisname, fileID, vlistID, gridID, ngrids, 'Y');
+      status = checkGridName('D', xdimname, fileID, vlistID, gridID, ngrids, 'X');
+      status = checkGridName('D', ydimname, fileID, vlistID, gridID, ngrids, 'Y');
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, xdimname, xdimlen, &xdimID);
+      cdf_def_dim(fileID, ydimname, ydimlen, &ydimID);
+
+      if ( gridInqXboundsPtr(gridID) || gridInqYboundsPtr(gridID) )
+        {
+          if ( nc_inq_dimid(fileID, "nv4", &nvdimID) != NC_NOERR )
+            cdf_def_dim(fileID, "nv4", nvertex, &nvdimID);
+        }
+
+      dimIDs[0] = ydimID;
+      dimIDs[1] = xdimID;
+
+      if ( gridInqXvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, xaxisname, (nc_type) xtype, 2, dimIDs, &ncxvarid);
+          cdfGridCompress(fileID, ncxvarid, xdimlen*ydimlen, streamptr->filetype, streamptr->comptype);
+
+          if ( (len = strlen(xstdname)) )
+            cdf_put_att_text(fileID, ncxvarid, "standard_name", len, xstdname);
+          if ( (len = strlen(xlongname)) )
+            cdf_put_att_text(fileID, ncxvarid, "long_name", len, xlongname);
+          if ( (len = strlen(xunits)) )
+            cdf_put_att_text(fileID, ncxvarid, "units", len, xunits);
+
+          /* attribute for Panoply */
+          cdf_put_att_text(fileID, ncxvarid, "_CoordinateAxisType", 3, "Lon");
+
+          streamptr->ncxvarID[gridindex] = ncxvarid;
+
+          if ( gridInqXboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              strcat(xaxisname, "_bnds");
+              dimIDs[0] = ydimID;
+              dimIDs[1] = xdimID;
+              dimIDs[2] = nvdimID;
+              cdf_def_var(fileID, xaxisname, (nc_type) xtype, 3, dimIDs, &ncbxvarid);
+              cdfGridCompress(fileID, ncbxvarid, xdimlen*ydimlen, streamptr->filetype, streamptr->comptype);
+
+              cdf_put_att_text(fileID, ncxvarid, "bounds", strlen(xaxisname), xaxisname);
+            }
+        }
+
+      if ( gridInqYvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, yaxisname, (nc_type) xtype, 2, dimIDs, &ncyvarid);
+          cdfGridCompress(fileID, ncyvarid, xdimlen*ydimlen, streamptr->filetype, streamptr->comptype);
+
+          if ( (len = strlen(ystdname)) )
+            cdf_put_att_text(fileID, ncyvarid, "standard_name", len, ystdname);
+          if ( (len = strlen(ylongname)) )
+            cdf_put_att_text(fileID, ncyvarid, "long_name", len, ylongname);
+          if ( (len = strlen(yunits)) )
+            cdf_put_att_text(fileID, ncyvarid, "units", len, yunits);
+
+          /* attribute for Panoply */
+          cdf_put_att_text(fileID, ncyvarid, "_CoordinateAxisType", 3, "Lat");
+
+          streamptr->ncyvarID[gridindex] = ncyvarid;
+
+          if ( gridInqYboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              strcat(yaxisname, "_bnds");
+              dimIDs[0] = ydimID;
+              dimIDs[1] = xdimID;
+              dimIDs[2] = nvdimID;
+              cdf_def_var(fileID, yaxisname, (nc_type) xtype, 3, dimIDs, &ncbyvarid);
+              cdfGridCompress(fileID, ncbyvarid, xdimlen*ydimlen, streamptr->filetype, streamptr->comptype);
+
+              cdf_put_att_text(fileID, ncyvarid, "bounds", strlen(yaxisname), yaxisname);
+            }
+        }
+
+      if ( gridInqAreaPtr(gridID) )
+        {
+          char yaxisname[] = "cell_area";
+          char units[] = "m2";
+          char longname[] = "area of grid cell";
+          char stdname[] = "cell_area";
+
+          cdf_def_var(fileID, yaxisname, (nc_type) xtype, 2, dimIDs, &ncavarid);
+
+          cdf_put_att_text(fileID, ncavarid, "standard_name", strlen(stdname), stdname);
+          cdf_put_att_text(fileID, ncavarid, "long_name", strlen(longname), longname);
+          cdf_put_att_text(fileID, ncavarid, "units", strlen(units), units);
+
+          streamptr->ncavarID[gridindex] = ncavarid;
+        }
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+
+      if ( ncxvarid  != UNDEFID ) cdf_put_var_double(fileID, ncxvarid,  gridInqXvalsPtr(gridID));
+      if ( ncbxvarid != UNDEFID ) cdf_put_var_double(fileID, ncbxvarid, gridInqXboundsPtr(gridID));
+      if ( ncyvarid  != UNDEFID ) cdf_put_var_double(fileID, ncyvarid,  gridInqYvalsPtr(gridID));
+      if ( ncbyvarid != UNDEFID ) cdf_put_var_double(fileID, ncbyvarid, gridInqYboundsPtr(gridID));
+      if ( ncavarid  != UNDEFID ) cdf_put_var_double(fileID, ncavarid,  gridInqAreaPtr(gridID));
+    }
+
+  streamptr->xdimID[gridindex] = xdimID;
+  streamptr->ydimID[gridindex] = ydimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefRgrid(int streamID, int gridID)
+{
+  char axisname[7] = "rgridX";
+  int index, iz = 0;
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  int vlistID;
+  int lwarn = TRUE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqSize(gridID);
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->xdimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_GAUSSIAN_REDUCED )
+            {
+              dimlen0 = gridInqSize(gridID0);
+
+              if ( dimlen == dimlen0 )
+                {
+                  dimID = streamptr->xdimID[index];
+                  break;
+                }
+              else
+                iz++;
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      if ( lwarn )
+        {
+          Warning("Creating a netCDF file with data on a gaussian reduced grid.");
+          Warning("The further processing of the resulting file is unsupported!");
+          lwarn = FALSE;
+        }
+
+      if ( iz == 0 ) axisname[5] = '\0';
+      else           sprintf(&axisname[5], "%1d", iz+1);
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  streamptr->xdimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefGdim(int streamID, int gridID)
+{
+  char axisname[7] = "gsizeX";
+  int index, iz = 0;
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqSize(gridID);
+
+  if ( gridInqYsize(gridID) == 0 )
+    for ( index = 0; index < ngrids; index++ )
+      {
+        if ( streamptr->xdimID[index] != UNDEFID )
+          {
+            gridID0 = vlistGrid(vlistID, index);
+            gridtype0 = gridInqType(gridID0);
+            if ( gridtype0 == GRID_GENERIC )
+              {
+                dimlen0 = gridInqSize(gridID0);
+                if ( dimlen == dimlen0 )
+                  {
+                    dimID = streamptr->xdimID[index];
+                    break;
+                  }
+                else
+                  iz++; 
+              }
+          }
+      }
+
+  if ( gridInqXsize(gridID) == 0 )
+    for ( index = 0; index < ngrids; index++ )
+      {
+        if ( streamptr->ydimID[index] != UNDEFID )
+          {
+            gridID0 = vlistGrid(vlistID, index);
+            gridtype0 = gridInqType(gridID0);
+            if ( gridtype0 == GRID_GENERIC )
+              {
+                dimlen0 = gridInqSize(gridID0);
+                if ( dimlen == dimlen0 )
+                  {
+                    dimID = streamptr->ydimID[index];
+                    break;
+                  }
+                else
+                  iz++; 
+              }
+          }
+      }
+
+  if ( dimID == UNDEFID )
+    {
+      if ( iz == 0 ) axisname[5] = '\0';
+      else           sprintf(&axisname[5], "%1d", iz+1);
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  streamptr->xdimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefUnstructured(int streamID, int gridID)
+{
+  char xunits[CDI_MAX_NAME];
+  char xlongname[CDI_MAX_NAME];
+  char xstdname[CDI_MAX_NAME];
+  char yunits[CDI_MAX_NAME];
+  char ylongname[CDI_MAX_NAME];
+  char ystdname[CDI_MAX_NAME];
+  char xaxisname[CDI_MAX_NAME];
+  char yaxisname[CDI_MAX_NAME];
+  int index;
+  int gridID0, gridtype0, gridindex;
+  int dimID = UNDEFID;
+  int ngrids;
+  int fileID;
+  int dimlen, dimlen0;
+  size_t len;
+  int ncxvarid = UNDEFID, ncyvarid = UNDEFID;
+  int ncbxvarid = UNDEFID, ncbyvarid = UNDEFID, ncavarid = UNDEFID;
+  int nvertex, nvdimID = UNDEFID;
+  int vlistID;
+  int xtype = NC_DOUBLE;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ngrids = vlistNgrids(vlistID);
+
+  dimlen = gridInqSize(gridID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+
+  gridInqXname(gridID, xaxisname);
+  gridInqXlongname(gridID, xlongname);
+  gridInqXstdname(gridID, xstdname);
+  gridInqXunits(gridID, xunits);
+  gridInqYname(gridID, yaxisname);
+  gridInqYlongname(gridID, ylongname);
+  gridInqYstdname(gridID, ystdname);
+  gridInqYunits(gridID, yunits);
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( streamptr->xdimID[index] != UNDEFID )
+        {
+          gridID0 = vlistGrid(vlistID, index);
+          gridtype0 = gridInqType(gridID0);
+          if ( gridtype0 == GRID_UNSTRUCTURED )
+            {
+              dimlen0 = gridInqSize(gridID0);
+              if ( dimlen == dimlen0 )
+		if ( gridInqNvertex(gridID0) == gridInqNvertex(gridID) &&
+		     IS_EQUAL(gridInqXval(gridID0, 0), gridInqXval(gridID, 0)) &&
+                     IS_EQUAL(gridInqXval(gridID0, dimlen-1), gridInqXval(gridID, dimlen-1)) )
+		  {
+		    dimID = streamptr->xdimID[index];
+		    break;
+		  }
+            }
+        }
+    }
+
+  if ( dimID == UNDEFID )
+    {
+      int status;
+      char axisname[CDI_MAX_NAME];
+      char vertname[CDI_MAX_NAME];
+      strcpy(axisname, "ncells");
+      strcpy(vertname, "nv");
+
+      status = checkGridName('V', xaxisname, fileID, vlistID, gridID, ngrids, 'X');
+      status = checkGridName('V', yaxisname, fileID, vlistID, gridID, ngrids, 'Y');
+      status = checkGridName('D', axisname, fileID, vlistID, gridID, ngrids, 'X');
+      status = checkGridName('D', vertname, fileID, vlistID, gridID, ngrids, 'X');
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+      nvertex = gridInqNvertex(gridID);
+      if ( nvertex > 0 ) cdf_def_dim(fileID, vertname, nvertex, &nvdimID);
+
+      if ( gridInqXvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, xaxisname, (nc_type) xtype, 1, &dimID, &ncxvarid);
+          cdfGridCompress(fileID, ncxvarid, dimlen, streamptr->filetype, streamptr->comptype);
+
+          if ( (len = strlen(xstdname)) )
+            cdf_put_att_text(fileID, ncxvarid, "standard_name", len, xstdname);
+          if ( (len = strlen(xlongname)) )
+            cdf_put_att_text(fileID, ncxvarid, "long_name", len, xlongname);
+          if ( (len = strlen(xunits)) )
+            cdf_put_att_text(fileID, ncxvarid, "units", len, xunits);
+
+          streamptr->ncxvarID[gridindex] = ncxvarid;
+
+          if ( gridInqXboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              int dimIDs[2];
+              dimIDs[0] = dimID;
+              dimIDs[1] = nvdimID;
+              strcat(xaxisname, "_vertices");
+              cdf_def_var(fileID, xaxisname, (nc_type) xtype, 2, dimIDs, &ncbxvarid);
+              cdfGridCompress(fileID, ncbxvarid, dimlen, streamptr->filetype, streamptr->comptype);
+
+              cdf_put_att_text(fileID, ncxvarid, "bounds", strlen(xaxisname), xaxisname);
+            }
+        }
+
+      if ( gridInqYvalsPtr(gridID) )
+        {
+          cdf_def_var(fileID, yaxisname, (nc_type) xtype, 1, &dimID, &ncyvarid);
+          cdfGridCompress(fileID, ncyvarid, dimlen, streamptr->filetype, streamptr->comptype);
+
+          if ( (len = strlen(ystdname)) )
+            cdf_put_att_text(fileID, ncyvarid, "standard_name", len, ystdname);
+          if ( (len = strlen(ylongname)) )
+            cdf_put_att_text(fileID, ncyvarid, "long_name", len, ylongname);
+          if ( (len = strlen(yunits)) )
+            cdf_put_att_text(fileID, ncyvarid, "units", len, yunits);
+
+          streamptr->ncyvarID[gridindex] = ncyvarid;
+
+          if ( gridInqYboundsPtr(gridID) && nvdimID != UNDEFID )
+            {
+              int dimIDs[2];
+              dimIDs[0] = dimID;
+              dimIDs[1] = nvdimID;
+              strcat(yaxisname, "_vertices");
+              cdf_def_var(fileID, yaxisname, (nc_type) xtype, 2, dimIDs, &ncbyvarid);
+              cdfGridCompress(fileID, ncbyvarid, dimlen, streamptr->filetype, streamptr->comptype);
+
+              cdf_put_att_text(fileID, ncyvarid, "bounds", strlen(yaxisname), yaxisname);
+            }
+        }
+
+      if ( gridInqAreaPtr(gridID) )
+        {
+          char yaxisname[] = "cell_area";
+          char units[] = "m2";
+          char longname[] = "area of grid cell";
+          char stdname[] = "cell_area";
+
+          cdf_def_var(fileID, yaxisname, (nc_type) xtype, 1, &dimID, &ncavarid);
+
+          cdf_put_att_text(fileID, ncavarid, "standard_name", strlen(stdname), stdname);
+          cdf_put_att_text(fileID, ncavarid, "long_name", strlen(longname), longname);
+          cdf_put_att_text(fileID, ncavarid, "units", strlen(units), units);
+
+          streamptr->ncavarID[gridindex] = ncavarid;
+        }
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+
+      if ( ncxvarid  != UNDEFID ) cdf_put_var_double(fileID, ncxvarid,  gridInqXvalsPtr(gridID));
+      if ( ncbxvarid != UNDEFID ) cdf_put_var_double(fileID, ncbxvarid, gridInqXboundsPtr(gridID));
+      if ( ncyvarid  != UNDEFID ) cdf_put_var_double(fileID, ncyvarid,  gridInqYvalsPtr(gridID));
+      if ( ncbyvarid != UNDEFID ) cdf_put_var_double(fileID, ncbyvarid, gridInqYboundsPtr(gridID));
+      if ( ncavarid  != UNDEFID ) cdf_put_var_double(fileID, ncavarid,  gridInqAreaPtr(gridID));
+    }
+
+  streamptr->xdimID[gridindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefVCT(int streamID, int zaxisID)
+{
+  int type;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  type = zaxisInqType(zaxisID);
+  if ( type == ZAXIS_HYBRID || type == ZAXIS_HYBRID_HALF )
+    {
+      int i;
+      int fileID;
+      int ilev = zaxisInqVctSize(zaxisID)/2;
+      int mlev = ilev - 1;
+      size_t start;
+      size_t count = 1;
+      int ncdimid, ncdimid2;
+      int hyaiid, hybiid, hyamid, hybmid;
+      double mval;
+      char tmpname[CDI_MAX_NAME];
+
+      if ( streamptr->vct.ilev > 0 )
+        {
+          if ( streamptr->vct.ilev != ilev )
+            Error("more than one VCT for each file unsupported!");
+          return;
+        }
+
+      if ( ilev == 0 )
+        {
+          Warning("VCT missing");
+          return;
+        }
+
+      fileID = streamInqFileID(streamID);
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      cdf_def_dim(fileID, "nhym", mlev, &ncdimid);
+      cdf_def_dim(fileID, "nhyi", ilev, &ncdimid2);
+
+      streamptr->vct.mlev   = mlev;
+      streamptr->vct.ilev   = ilev;
+      streamptr->vct.mlevID = ncdimid;
+      streamptr->vct.ilevID = ncdimid2;
+
+      cdf_def_var(fileID, "hyai", NC_DOUBLE, 1, &ncdimid2, &hyaiid);
+      cdf_def_var(fileID, "hybi", NC_DOUBLE, 1, &ncdimid2, &hybiid);
+      cdf_def_var(fileID, "hyam", NC_DOUBLE, 1, &ncdimid,  &hyamid);
+      cdf_def_var(fileID, "hybm", NC_DOUBLE, 1, &ncdimid,  &hybmid);
+
+      strcpy(tmpname, "hybrid A coefficient at layer interfaces");
+      cdf_put_att_text(fileID, hyaiid, "long_name", strlen(tmpname), tmpname);
+      strcpy(tmpname, "Pa");
+      cdf_put_att_text(fileID, hyaiid, "units", strlen(tmpname), tmpname);
+      strcpy(tmpname, "hybrid B coefficient at layer interfaces");
+      cdf_put_att_text(fileID, hybiid, "long_name", strlen(tmpname), tmpname);
+      strcpy(tmpname, "1");
+      cdf_put_att_text(fileID, hybiid, "units", strlen(tmpname), tmpname);
+      strcpy(tmpname, "hybrid A coefficient at layer midpoints");
+      cdf_put_att_text(fileID, hyamid, "long_name", strlen(tmpname), tmpname);
+      strcpy(tmpname, "Pa");
+      cdf_put_att_text(fileID, hyamid, "units", strlen(tmpname), tmpname);
+      strcpy(tmpname, "hybrid B coefficient at layer midpoints");
+      cdf_put_att_text(fileID, hybmid, "long_name", strlen(tmpname), tmpname);
+      strcpy(tmpname, "1");
+      cdf_put_att_text(fileID, hybmid, "units", strlen(tmpname), tmpname);
+
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+
+      const double *vctptr = zaxisInqVctPtr(zaxisID);
+
+      cdf_put_var_double(fileID, hyaiid, vctptr);
+      cdf_put_var_double(fileID, hybiid, vctptr+ilev);
+
+      for ( i = 0; i < mlev; i++ )
+        {
+          start = i;
+          mval = (vctptr[i] + vctptr[i+1]) * 0.5;
+          cdf_put_vara_double(fileID, hyamid, &start, &count, &mval);
+          mval = (vctptr[ilev+i] + vctptr[ilev+i+1]) * 0.5;
+          cdf_put_vara_double(fileID, hybmid, &start, &count, &mval);
+        }
+    }
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefZaxis(int streamID, int zaxisID)
+{
+  /*  char zaxisname0[CDI_MAX_NAME]; */
+  char axisname[CDI_MAX_NAME];
+  char stdname[CDI_MAX_NAME];
+  char longname[CDI_MAX_NAME];
+  char units[CDI_MAX_NAME];
+  char tmpname[CDI_MAX_NAME];
+  int index;
+  int zaxisID0;
+  int dimID = UNDEFID;
+  int dimIDs[2];
+  int fileID;
+  int dimlen;
+  size_t len;
+  int ncvarid = UNDEFID, ncbvarid = UNDEFID;
+  int nvertex = 2, nvdimID = UNDEFID;
+  int type;
+  int nzaxis;
+  int ilevel = 0;
+  int vlistID;
+  int zaxisindex;
+  int xtype = NC_DOUBLE;
+  int positive;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( zaxisInqPrec(zaxisID) == DATATYPE_FLT32 ) xtype = NC_FLOAT;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+
+  nzaxis = vlistNzaxis(vlistID);
+
+  dimlen = zaxisInqSize(zaxisID);
+  type   = zaxisInqType(zaxisID);
+
+  if ( dimlen == 1 && type == ZAXIS_SURFACE     ) return;
+  if ( dimlen == 1 && type == ZAXIS_TOA         ) return;
+  if ( dimlen == 1 && type == ZAXIS_SEA_BOTTOM  ) return;
+  if ( dimlen == 1 && type == ZAXIS_ATMOSPHERE  ) return;
+  if ( dimlen == 1 && type == ZAXIS_MEANSEA     ) return;
+
+  zaxisInqName(zaxisID, axisname);
+  /*
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      if ( streamptr->zaxisID[index] != UNDEFID )
+        {
+          zaxisID0 = vlistZaxis(vlistID, index);
+          zaxisInqName(zaxisID0, zaxisname0);
+          if ( strcmp(zaxisname0, axisname) == 0 ) ilevel++;
+        }
+    }
+  */
+  if ( dimID == UNDEFID )
+    {
+      char axisname0[CDI_MAX_NAME];
+      char axisname2[CDI_MAX_NAME];
+      int checkname = FALSE;
+      int status;
+
+      /* check that the name is not already defined */
+      checkname = TRUE;
+      ilevel = 0;
+
+      while ( checkname ) 
+        {
+          strcpy(axisname2, axisname);
+          if ( ilevel ) sprintf(&axisname2[strlen(axisname2)], "_%d", ilevel+1);
+
+          status = nc_inq_varid(fileID, axisname2, &ncvarid);
+          if ( status != NC_NOERR )
+            {
+              if ( ilevel )
+                {
+                  /* check that the name does not exist for other grids */
+                  for ( index = 0; index < nzaxis; index++ )
+                    {
+                      zaxisID0 = vlistZaxis(vlistID, index);
+                      if ( zaxisID != zaxisID0 )
+                        {
+                          zaxisInqName(zaxisID0, axisname0);
+                          if ( strcmp(axisname0, axisname2) == 0 ) break;
+                        }
+                    }
+                  if ( index == nzaxis ) checkname = FALSE;
+                }
+              else
+                {
+                  checkname = FALSE;
+                }
+            }
+
+          if ( checkname ) ilevel++;
+
+          if ( ilevel > 99 ) break;
+        }
+
+      if ( ilevel ) sprintf(&axisname[strlen(axisname)], "_%1d", ilevel+1);
+
+      if ( type == ZAXIS_HYBRID || type == ZAXIS_HYBRID_HALF )
+        {
+          if ( type == ZAXIS_HYBRID )
+            {
+	      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+	      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+	      cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID,  &ncvarid);
+
+	      strcpy(tmpname, "hybrid_sigma_pressure");
+	      cdf_put_att_text(fileID, ncvarid, "standard_name", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "hybrid level at layer midpoints");
+	      cdf_put_att_text(fileID, ncvarid, "long_name", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "level");
+	      cdf_put_att_text(fileID, ncvarid, "units", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "down");
+	      cdf_put_att_text(fileID, ncvarid, "positive", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "hyam hybm (mlev=hyam+hybm*aps)");
+	      cdf_put_att_text(fileID, ncvarid, "formula", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "ap: hyam b: hybm ps: aps");
+	      cdf_put_att_text(fileID, ncvarid, "formula_terms", strlen(tmpname), tmpname);
+	      /*
+	      strcpy(tmpname, "ilev");
+	      cdf_put_att_text(fileID, ncvarid, "borders", strlen(tmpname), tmpname);
+	      */
+	      cdf_enddef(fileID);
+	      streamptr->ncmode = 2;
+
+	      cdf_put_var_double(fileID, ncvarid, zaxisInqLevelsPtr(zaxisID));
+            }
+
+          if ( type == ZAXIS_HYBRID_HALF )
+            {
+	      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+	      cdf_def_dim(fileID, axisname, dimlen, &dimID);
+	      cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID,  &ncvarid);
+
+	      strcpy(tmpname, "hybrid_sigma_pressure");
+	      cdf_put_att_text(fileID, ncvarid, "standard_name", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "hybrid level at layer interfaces");
+	      cdf_put_att_text(fileID, ncvarid, "long_name", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "level");
+	      cdf_put_att_text(fileID, ncvarid, "units", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "down");
+	      cdf_put_att_text(fileID, ncvarid, "positive", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "hyai hybi (ilev=hyai+hybi*aps)");
+	      cdf_put_att_text(fileID, ncvarid, "formula", strlen(tmpname), tmpname);
+	      strcpy(tmpname, "ap: hyai b: hybi ps: aps");
+	      cdf_put_att_text(fileID, ncvarid, "formula_terms", strlen(tmpname), tmpname);
+
+	      cdf_enddef(fileID);
+	      streamptr->ncmode = 2;
+
+	      cdf_put_var_double(fileID, ncvarid, zaxisInqLevelsPtr(zaxisID));
+            }
+
+          cdfDefVCT(streamID, zaxisID);
+
+          if ( dimID == UNDEFID )
+            {
+              if ( type == ZAXIS_HYBRID )
+                streamptr->zaxisID[zaxisindex] = streamptr->vct.mlevID;
+              else
+                streamptr->zaxisID[zaxisindex] = streamptr->vct.ilevID;
+            }
+        }
+      else
+        {
+          if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+          cdf_def_dim(fileID, axisname, dimlen, &dimID);
+
+          zaxisInqLongname(zaxisID, longname);
+          zaxisInqUnits(zaxisID, units);
+          zaxisInqStdname(zaxisID, stdname);
+
+          cdf_def_var(fileID, axisname, (nc_type) xtype, 1, &dimID, &ncvarid);
+
+          if ( (len = strlen(stdname)) )
+            cdf_put_att_text(fileID, ncvarid, "standard_name", len, stdname);
+          if ( (len = strlen(longname)) )
+            cdf_put_att_text(fileID, ncvarid, "long_name", len, longname);
+          if ( (len = strlen(units)) )
+            cdf_put_att_text(fileID, ncvarid, "units", len, units);
+
+	  positive = zaxisInqPositive(zaxisID);
+	  if ( positive == 1 )
+	    {
+	      strcpy(tmpname, "up");
+	      cdf_put_att_text(fileID, ncvarid, "positive", strlen(tmpname), tmpname);
+	    }
+	  else if ( positive == 2 )
+	    {
+	      strcpy(tmpname, "down");
+	      cdf_put_att_text(fileID, ncvarid, "positive", strlen(tmpname), tmpname);
+	    }
+
+          cdf_put_att_text(fileID, ncvarid, "axis", 1, "Z");
+
+	  if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+            {
+	      if ( nc_inq_dimid(fileID, "nb2", &nvdimID) != NC_NOERR )
+		cdf_def_dim(fileID, "nb2", nvertex, &nvdimID);
+
+	      if ( nvdimID != UNDEFID )
+		{
+		  strcat(axisname, "_bnds");
+		  dimIDs[0] = dimID;
+		  dimIDs[1] = nvdimID;
+		  cdf_def_var(fileID, axisname, (nc_type) xtype, 2, dimIDs, &ncbvarid);
+		  cdf_put_att_text(fileID, ncvarid, "bounds", strlen(axisname), axisname);
+		}
+	    }
+
+          cdf_enddef(fileID);
+          streamptr->ncmode = 2;
+
+          cdf_put_var_double(fileID, ncvarid, zaxisInqLevelsPtr(zaxisID));
+
+          if ( ncbvarid != UNDEFID )
+	    {
+	      int i;
+	      double *zbounds, *lbounds, *ubounds;
+
+	      lbounds = (double *) malloc(dimlen*sizeof(double));
+	      ubounds = (double *) malloc(dimlen*sizeof(double));
+	      zbounds = (double *) malloc(2*dimlen*sizeof(double));
+
+	      zaxisInqLbounds(zaxisID, lbounds);
+	      zaxisInqUbounds(zaxisID, ubounds);
+
+	      for ( i = 0; i < dimlen; ++i )
+		{
+		  zbounds[2*i  ] = lbounds[i];
+		  zbounds[2*i+1] = ubounds[i];
+		}
+
+	      cdf_put_var_double(fileID, ncbvarid, zbounds);
+
+	      free(zbounds);
+	      free(ubounds);
+	      free(lbounds);
+	    }
+        }
+    }
+
+  if ( dimID != UNDEFID )
+    streamptr->zaxisID[zaxisindex] = dimID;
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefPole(int streamID, int gridID)
+{
+  int fileID;
+  int ncvarid = UNDEFID;
+  int ncerr;
+  double xpole, ypole, angle;
+  char varname[] = "rotated_pole";
+  char mapname[] = "rotated_latitude_longitude";
+
+  fileID  = streamInqFileID(streamID);
+
+  ypole = gridInqYpole(gridID);
+  xpole = gridInqXpole(gridID);
+  angle = gridInqAngle(gridID);
+
+  cdf_redef(fileID);
+
+  ncerr = nc_def_var(fileID, varname, (nc_type) NC_CHAR, 0, NULL, &ncvarid);
+  if ( ncerr == NC_NOERR )
+    {
+      cdf_put_att_text(fileID, ncvarid, "grid_mapping_name", strlen(mapname), mapname);
+      cdf_put_att_double(fileID, ncvarid, "grid_north_pole_latitude", NC_DOUBLE, 1, &ypole);
+      cdf_put_att_double(fileID, ncvarid, "grid_north_pole_longitude", NC_DOUBLE, 1, &xpole);
+      if ( angle > 0 )
+        cdf_put_att_double(fileID, ncvarid, "north_pole_grid_longitude", NC_DOUBLE, 1, &angle);
+    }
+
+  cdf_enddef(fileID);
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefMapping(int streamID, int gridID)
+{
+  int fileID;
+  int ncvarid = UNDEFID;
+  int ncerr;
+
+  if ( gridInqType(gridID) == GRID_SINUSOIDAL )
+    {
+      char varname[] = "sinusoidal";
+      char mapname[] = "sinusoidal";
+
+      fileID  = streamInqFileID(streamID);
+
+      cdf_redef(fileID);
+
+      ncerr = nc_def_var(fileID, varname, (nc_type) NC_CHAR, 0, NULL, &ncvarid);
+      if ( ncerr == NC_NOERR )
+        {
+          cdf_put_att_text(fileID, ncvarid, "grid_mapping_name", strlen(mapname), mapname);
+          /*
+          cdf_put_att_double(fileID, ncvarid, "grid_north_pole_latitude", NC_DOUBLE, 1, &ypole);
+          cdf_put_att_double(fileID, ncvarid, "grid_north_pole_longitude", NC_DOUBLE, 1, &xpole);
+          */
+        }
+
+      cdf_enddef(fileID);
+    }
+  else if ( gridInqType(gridID) == GRID_LAEA )
+    {
+      char varname[] = "laea";
+      char mapname[] = "lambert_azimuthal_equal_area";
+
+      fileID  = streamInqFileID(streamID);
+
+      cdf_redef(fileID);
+
+      ncerr = nc_def_var(fileID, varname, (nc_type) NC_CHAR, 0, NULL, &ncvarid);
+      if ( ncerr == NC_NOERR )
+        {
+          double a, lon_0, lat_0;
+
+          gridInqLaea(gridID, &a, &lon_0, &lat_0);
+
+          cdf_put_att_text(fileID, ncvarid, "grid_mapping_name", strlen(mapname), mapname);
+          cdf_put_att_double(fileID, ncvarid, "earth_radius", NC_DOUBLE, 1, &a);
+          cdf_put_att_double(fileID, ncvarid, "longitude_of_projection_origin", NC_DOUBLE, 1, &lon_0);
+          cdf_put_att_double(fileID, ncvarid, "latitude_of_projection_origin", NC_DOUBLE, 1, &lat_0);
+        }
+
+      cdf_enddef(fileID);
+    }
+  else if ( gridInqType(gridID) == GRID_LCC2 )
+    {
+      char varname[] = "Lambert_Conformal";
+      char mapname[] = "lambert_conformal_conic";
+
+      fileID  = streamInqFileID(streamID);
+
+      cdf_redef(fileID);
+
+      ncerr = nc_def_var(fileID, varname, (nc_type) NC_CHAR, 0, NULL, &ncvarid);
+      if ( ncerr == NC_NOERR )
+        {
+          double radius, lon_0, lat_0, lat_1, lat_2;
+
+          gridInqLcc2(gridID, &radius, &lon_0, &lat_0, &lat_1, &lat_2);
+
+          cdf_put_att_text(fileID, ncvarid, "grid_mapping_name", strlen(mapname), mapname);
+          if ( radius > 0 )
+            cdf_put_att_double(fileID, ncvarid, "earth_radius", NC_DOUBLE, 1, &radius);
+          cdf_put_att_double(fileID, ncvarid, "longitude_of_central_meridian", NC_DOUBLE, 1, &lon_0);
+          cdf_put_att_double(fileID, ncvarid, "latitude_of_projection_origin", NC_DOUBLE, 1, &lat_0);
+          if ( IS_EQUAL(lat_1, lat_2) )
+            cdf_put_att_double(fileID, ncvarid, "standard_parallel", NC_DOUBLE, 1, &lat_1);
+          else
+            {
+              double lat_1_2[2];
+              lat_1_2[0] = lat_1;
+              lat_1_2[1] = lat_2;
+              cdf_put_att_double(fileID, ncvarid, "standard_parallel", NC_DOUBLE, 2, lat_1_2);
+            }
+        }
+
+      cdf_enddef(fileID);
+    }
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void cdfDefGrid(int streamID, int gridID)
+{
+  int gridtype, size;
+  int gridindex;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( streamptr->xdimID[gridindex] != UNDEFID ) return;
+
+  gridtype = gridInqType(gridID);
+  size     = gridInqSize(gridID);
+
+  if ( CDI_Debug )
+    Message("gridtype = %d  size = %d", gridtype, size);
+
+  if ( gridtype == GRID_GAUSSIAN ||
+       gridtype == GRID_LONLAT   ||
+       gridtype == GRID_GENERIC )
+    {
+      if ( gridtype == GRID_GENERIC && size == 1 && 
+           gridInqXsize(gridID) == 0 && gridInqYsize(gridID) == 0 )
+        {
+          /* no grid information */
+        }
+      else if ( gridtype == GRID_GENERIC && (gridInqXsize(gridID) == 0 || gridInqYsize(gridID) == 0) )
+        {
+          cdfDefGdim(streamID, gridID);
+        }
+      else
+        {
+          if ( gridInqXsize(gridID) > 0 ) cdfDefXaxis(streamID, gridID);
+          if ( gridInqYsize(gridID) > 0 ) cdfDefYaxis(streamID, gridID);
+        }
+
+      if ( gridIsRotated(gridID) ) cdfDefPole(streamID, gridID);
+    }
+  else if ( gridtype == GRID_CURVILINEAR )
+    {
+      cdfDefCurvilinear(streamID, gridID);
+    }
+  else if ( gridtype == GRID_UNSTRUCTURED )
+    {
+      cdfDefUnstructured(streamID, gridID);
+    }
+  else if ( gridtype == GRID_GAUSSIAN_REDUCED )
+    {
+      cdfDefRgrid(streamID, gridID);
+    }
+  else if ( gridtype == GRID_SPECTRAL )
+    {
+      cdfDefComplex(streamID, gridID);
+      cdfDefSP(streamID, gridID);
+    }
+  else if ( gridtype == GRID_FOURIER )
+    {
+      cdfDefComplex(streamID, gridID);
+      cdfDefFC(streamID, gridID);
+    }
+  else if ( gridtype == GRID_TRAJECTORY )
+    {
+      cdfDefTrajLon(streamID, gridID);
+      cdfDefTrajLat(streamID, gridID);
+    }
+  else if ( gridtype == GRID_SINUSOIDAL || gridtype == GRID_LAEA || gridtype == GRID_LCC2 )
+    {
+      cdfDefXaxis(streamID, gridID);
+      cdfDefYaxis(streamID, gridID);
+
+      cdfDefMapping(streamID, gridID);
+    }
+  /*
+  else if ( gridtype == GRID_LCC )
+    {
+      cdfDefLcc(streamID, gridID);
+    }
+  */
+  else
+    {
+      Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+    }
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+int cdfDefVar(int streamID, int varID)
+{
+  int ncvarid = -1;
+  int fileID;
+  int xid = UNDEFID, yid = UNDEFID, zid = UNDEFID, tid = UNDEFID;
+  size_t xsize = 0, ysize = 0;
+  int code, param, gridID, zaxisID;
+  int pnum, pcat, pdis;
+  char varname[CDI_MAX_NAME];
+  const char *name = NULL;
+  const char *longname = NULL;
+  const char *stdname = NULL;
+  const char *units = NULL;
+  int dims[4];
+  int lchunk = FALSE;
+  int chunktype;
+  size_t chunks[4] = {0,0,0,0};
+  int tableID;
+  int ndims = 0;
+  int len;
+  int tsteptype;
+  int xtype, dtype;
+  int gridtype, gridsize;
+  int gridindex, zaxisindex;
+  int tablenum;
+  int vlistID;
+  int dimorder[3];
+  int ixyz;
+  int iax = 0;
+  char axis[5];
+  stream_t *streamptr;
+  int ensID, ensCount, forecast_type;
+  int retval;
+
+  streamptr = stream_to_pointer(streamID);
+
+  fileID  = streamInqFileID(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d, fileID = %d, varID = %d", streamID, fileID, varID);
+
+  if ( streamptr->vars[varID].ncvarid != UNDEFID )
+    return (streamptr->vars[varID].ncvarid);
+
+  vlistID   = streamInqVlist(streamID);
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+  code      = vlistInqVarCode(vlistID, varID);
+  param     = vlistInqVarParam(vlistID, varID);
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+
+  chunktype = vlistInqVarChunkType(vlistID, varID);
+
+  ixyz    = vlistInqVarXYZ(vlistID, varID);
+  if ( ixyz == 0 ) ixyz = 321; // ZYX
+
+  gridsize  = gridInqSize(gridID);
+  if ( gridsize > 1 ) lchunk = TRUE;
+  gridtype  = gridInqType(gridID);
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( gridtype != GRID_TRAJECTORY )
+    {
+      xid = streamptr->xdimID[gridindex];
+      yid = streamptr->ydimID[gridindex];
+      if ( xid != UNDEFID ) cdf_inq_dimlen(fileID, xid, &xsize);
+      if ( yid != UNDEFID ) cdf_inq_dimlen(fileID, yid, &ysize);
+    }
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+  zid = streamptr->zaxisID[zaxisindex];
+
+  dimorder[0] = ixyz/100;
+  dimorder[1] = (ixyz-dimorder[0]*100)/10;
+  dimorder[2] = (ixyz-dimorder[0]*100-dimorder[1]*10);
+  if ( dimorder[0] != 3 ) lchunk = FALSE; /* ZYX and ZXY */
+
+  if ( ((dimorder[0]>0)+(dimorder[1]>0)+(dimorder[2]>0)) < ((xid!=UNDEFID)+(yid!=UNDEFID)+(zid!=UNDEFID)) )
+    {
+      printf("xyz=%d  zid=%d  yid=%d  xid=%d\n", ixyz, zid, yid, xid);
+      Error("Internal problem, dimension order missing!");
+    }
+
+  tid = streamptr->basetime.ncdimid;
+
+  if ( tsteptype != TSTEP_CONSTANT )
+    {
+      if ( tid == UNDEFID ) Error("Internal problem, time undefined!");
+      chunks[ndims] = 1;
+      dims[ndims++] = tid;
+      axis[iax++] = 'T';
+    }
+  /*
+  if ( zid != UNDEFID ) axis[iax++] = 'Z';
+  if ( zid != UNDEFID ) chunks[ndims] = 1;
+  if ( zid != UNDEFID ) dims[ndims++] = zid;
+
+  if ( yid != UNDEFID ) chunks[ndims] = ysize;
+  if ( yid != UNDEFID ) dims[ndims++] = yid;
+
+  if ( xid != UNDEFID ) chunks[ndims] = xsize;
+  if ( xid != UNDEFID ) dims[ndims++] = xid;
+  */
+  for ( int id = 0; id < 3; ++id )
+    {
+      if ( dimorder[id] == 3 && zid != UNDEFID )
+        {
+          axis[iax++] = 'Z';
+          chunks[ndims] = 1;
+          dims[ndims] = zid;
+          ndims++;
+        }
+      else if ( dimorder[id] == 2 && yid != UNDEFID )
+        {
+          if ( chunktype == CHUNK_LINES )
+            chunks[ndims] = 1;
+          else
+            chunks[ndims] = ysize;
+          dims[ndims] = yid;
+          ndims++;
+        }
+      else if ( dimorder[id] == 1 && xid != UNDEFID )
+        {
+          chunks[ndims] = xsize;
+          dims[ndims] = xid;
+          ndims++;
+        }
+    }
+
+  if ( CDI_Debug )
+    fprintf(stderr, "chunktype %d  chunks %d %d %d %d\n", chunktype, (int)chunks[0], (int)chunks[1], (int)chunks[2], (int)chunks[3]);
+
+  tableID  = vlistInqVarTable(vlistID, varID);
+
+  name     = vlistInqVarNamePtr(vlistID, varID);
+  longname = vlistInqVarLongnamePtr(vlistID, varID);
+  stdname  = vlistInqVarStdnamePtr(vlistID, varID);
+  units    = vlistInqVarUnitsPtr(vlistID, varID);
+
+  if ( name     == NULL )     name = tableInqParNamePtr(tableID, code);
+  if ( longname == NULL ) longname = tableInqParLongnamePtr(tableID, code);
+  if ( units    == NULL )    units = tableInqParUnitsPtr(tableID, code);
+  if ( name )
+    {
+      int checkname;
+      int iz;
+      int status;
+
+      sprintf(varname, "%s", name);
+
+      checkname = TRUE;
+      iz = 0;
+
+      while ( checkname ) 
+        {
+          if ( iz ) sprintf(varname, "%s_%d", name, iz+1);
+
+          status = nc_inq_varid(fileID, varname, &ncvarid);
+          if ( status != NC_NOERR )
+            {
+              checkname = FALSE;
+            }
+
+          if ( checkname ) iz++;
+
+          if ( iz >= CDI_MAX_NAME ) Error("Double entry of variable name '%s'!", name);
+        }
+
+      if ( strcmp(name, varname) != 0 )
+        {
+          if ( iz == 1 )
+            Warning("Changed double entry of variable name '%s' to '%s'!", name, varname);
+          else
+            Warning("Changed multiple entry of variable name '%s' to '%s'!", name, varname);
+        }
+
+      name = varname;
+    }
+  else
+    {
+      int checkname;
+      int iz;
+      int status;
+      char *varname2;
+
+      if ( code < 0 ) code = -code;
+      if ( pnum < 0 ) pnum = -pnum;
+
+      if ( pdis == 255 )
+	sprintf(varname, "var%d", code);
+      else
+	sprintf(varname, "param%d.%d.%d", pnum, pcat, pdis);
+
+      varname2 = varname+strlen(varname);
+
+      checkname = TRUE;
+      iz = 0;
+
+      while ( checkname )
+        {
+          if ( iz ) sprintf(varname2, "_%d", iz+1);
+
+          status = nc_inq_varid(fileID, varname, &ncvarid);
+          if ( status != NC_NOERR ) checkname = FALSE;
+
+          if ( checkname ) iz++;
+
+          if ( iz >= CDI_MAX_NAME ) break;
+        }
+
+      name = varname;
+      code = 0;
+      pdis = 255;
+    }
+
+  /* if ( streamptr->ncmode == 2 ) cdf_redef(fileID); */
+
+  dtype = vlistInqVarDatatype(vlistID, varID);
+  xtype = cdfDefDatatype(dtype, streamptr->filetype);
+
+  cdf_def_var(fileID, name, (nc_type) xtype, ndims, dims, &ncvarid);
+
+#if  defined  (HAVE_NETCDF4)
+  if ( lchunk && (streamptr->filetype == FILETYPE_NC4 || streamptr->filetype == FILETYPE_NC4C) )
+    {
+      if ( chunktype == CHUNK_AUTO )
+        retval = nc_def_var_chunking(fileID, ncvarid, NC_CHUNKED, NULL);
+      else
+        retval = nc_def_var_chunking(fileID, ncvarid, NC_CHUNKED, chunks);
+
+      if ( retval ) Error("nc_def_var_chunking failed, status = %d", retval);
+    }
+#endif
+
+  if ( streamptr->comptype == COMPRESS_ZIP )
+    {
+      if ( lchunk && (streamptr->filetype == FILETYPE_NC4 || streamptr->filetype == FILETYPE_NC4C) )
+        {
+          cdfDefVarDeflate(fileID, ncvarid, streamptr->complevel);
+        }
+      else
+        {
+          if ( lchunk )
+            {
+              static int lwarn = TRUE;
+
+              if ( lwarn )
+                {
+                  lwarn = FALSE;
+                  Warning("Deflate compression is only available for netCDF4!");
+                }
+            }
+        }
+    }
+
+  if ( streamptr->comptype == COMPRESS_SZIP )
+    {
+      if ( lchunk && (streamptr->filetype == FILETYPE_NC4 || streamptr->filetype == FILETYPE_NC4C) )
+        {
+#if defined (NC_SZIP_NN_OPTION_MASK)
+          cdfDefVarSzip(fileID, ncvarid);
+#else
+          static int lwarn = TRUE;
+
+          if ( lwarn )
+            {
+              lwarn = FALSE;
+              Warning("netCDF4/SZIP compression not available!");
+            }
+#endif
+        }
+      else
+        {
+          static int lwarn = TRUE;
+
+          if ( lwarn )
+            {
+              lwarn = FALSE;
+              Warning("SZIP compression is only available for netCDF4!");
+            }
+        }
+    }
+
+  if ( stdname && *stdname )
+    cdf_put_att_text(fileID, ncvarid, "standard_name", strlen(stdname), stdname);
+
+  if ( longname && *longname )
+    cdf_put_att_text(fileID, ncvarid, "long_name", strlen(longname), longname);
+
+  if ( units && *units )
+    cdf_put_att_text(fileID, ncvarid, "units", strlen(units), units);
+
+  if ( code > 0 && pdis == 255 )
+    cdf_put_att_int(fileID, ncvarid, "code", NC_INT, 1, &code);
+
+  if ( pdis != 255 )
+    {
+      char paramstr[32];
+      cdiParamToString(param, paramstr, sizeof(paramstr));
+      cdf_put_att_text(fileID, ncvarid, "param", strlen(paramstr), paramstr);
+    }
+
+  if ( tableID != UNDEFID )
+    {
+      tablenum = tableInqNum(tableID);
+      if ( tablenum > 0 )
+        cdf_put_att_int(fileID, ncvarid, "table", NC_INT, 1, &tablenum);
+    }
+
+  if ( gridtype != GRID_GENERIC && gridtype != GRID_LONLAT  &&
+       gridtype != GRID_CURVILINEAR )
+    {
+      len = strlen(gridNamePtr(gridtype));
+      if ( len > 0 )
+        cdf_put_att_text(fileID, ncvarid, "grid_type", len, gridNamePtr(gridtype));
+    }
+
+  if ( gridIsRotated(gridID) )
+    {
+      char mapping[] = "rotated_pole";
+      cdf_put_att_text(fileID, ncvarid, "grid_mapping", strlen(mapping), mapping);
+    }
+
+  if ( gridtype == GRID_SINUSOIDAL )
+    {
+      char mapping[] = "sinusoidal";
+      cdf_put_att_text(fileID, ncvarid, "grid_mapping", strlen(mapping), mapping);
+    }
+  else if ( gridtype == GRID_LAEA )
+    {
+      char mapping[] = "laea";
+      cdf_put_att_text(fileID, ncvarid, "grid_mapping", strlen(mapping), mapping);
+    }
+  else if ( gridtype == GRID_LCC2 )
+    {
+      char mapping[] = "Lambert_Conformal";
+      cdf_put_att_text(fileID, ncvarid, "grid_mapping", strlen(mapping), mapping);
+    }
+  else if ( gridtype == GRID_TRAJECTORY )
+    {
+      cdf_put_att_text(fileID, ncvarid, "coordinates", 9, "tlon tlat" );
+    }
+  else if ( gridtype == GRID_UNSTRUCTURED || gridtype == GRID_CURVILINEAR )
+    {
+      char coordinates[CDI_MAX_NAME] = "";
+      char cellarea[CDI_MAX_NAME] = "area: ";
+      int ncxvarID, ncyvarID, ncavarID;
+      int gridindex;
+      size_t len;
+
+      gridindex = vlistGridIndex(vlistID, gridID);
+      ncxvarID = streamptr->ncxvarID[gridindex];
+      ncyvarID = streamptr->ncyvarID[gridindex];
+      ncavarID = streamptr->ncavarID[gridindex];
+      if ( ncxvarID != CDI_UNDEFID )
+        cdf_inq_varname(fileID, ncxvarID, coordinates);
+      len = strlen(coordinates);
+      if ( ncyvarID != CDI_UNDEFID )
+        {
+          if ( len ) coordinates[len++] = ' ';
+          cdf_inq_varname(fileID, ncyvarID, coordinates+len);
+        }
+      len = strlen(coordinates);
+      if ( len )
+        cdf_put_att_text(fileID, ncvarid, "coordinates", len, coordinates);
+
+      if ( ncavarID != CDI_UNDEFID )
+        {
+          len = strlen(cellarea);
+          cdf_inq_varname(fileID, ncavarID, cellarea+len);
+          len = strlen(cellarea);
+          cdf_put_att_text(fileID, ncvarid, "cell_measures", len, cellarea);
+        }
+    }
+  else if ( gridtype == GRID_SPECTRAL || gridtype == GRID_FOURIER )
+    {
+      int gridTruncation = gridInqTrunc(gridID);
+
+      axis[iax++] = '-';
+      axis[iax++] = '-';
+      cdf_put_att_text(fileID, ncvarid, "axis", iax, axis);
+      cdf_put_att_int(fileID, ncvarid, "truncation", NC_INT, 1, &gridTruncation);
+    }
+
+  /*  if ( xtype == NC_BYTE || xtype == NC_SHORT || xtype == NC_INT ) */
+    {
+      int laddoffset, lscalefactor;
+      double addoffset, scalefactor;
+      int astype = NC_DOUBLE;
+
+      addoffset    = vlistInqVarAddoffset(vlistID, varID);
+      scalefactor  = vlistInqVarScalefactor(vlistID, varID);
+      laddoffset   = IS_NOT_EQUAL(addoffset, 0);
+      lscalefactor = IS_NOT_EQUAL(scalefactor, 1);
+
+      if ( laddoffset || lscalefactor )
+        {
+          if ( IS_EQUAL(addoffset,   (double) ((float) addoffset)) &&
+               IS_EQUAL(scalefactor, (double) ((float) scalefactor)) )
+            {
+              astype = NC_FLOAT;
+            }
+
+          if ( xtype == (int) NC_FLOAT ) astype = NC_FLOAT;
+
+          cdf_put_att_double(fileID, ncvarid, "add_offset",   (nc_type) astype, 1, &addoffset);
+          cdf_put_att_double(fileID, ncvarid, "scale_factor", (nc_type) astype, 1, &scalefactor);
+        }
+    }
+
+  if ( dtype == DATATYPE_UINT8 && xtype == NC_BYTE )
+    {
+      int validrange[2] = {0, 255};
+      cdf_put_att_int(fileID, ncvarid, "valid_range", NC_SHORT, 2, validrange);
+      cdf_put_att_text(fileID, ncvarid, "_Unsigned", 4, "true");
+    }
+
+  streamptr->vars[varID].ncvarid = ncvarid;
+
+  if ( vlistInqVarMissvalUsed(vlistID, varID) )
+    cdfDefVarMissval(streamID, varID, vlistInqVarDatatype(vlistID, varID), 0);
+
+  if ( zid == -1 )
+    {
+      if ( zaxisInqType(zaxisID) == ZAXIS_TOA         || 
+           zaxisInqType(zaxisID) == ZAXIS_SEA_BOTTOM  ||
+           zaxisInqType(zaxisID) == ZAXIS_ATMOSPHERE )
+        {
+          zaxisInqName(zaxisID, varname);
+          cdf_put_att_text(fileID, ncvarid, "level_type", strlen(varname), varname);
+        }
+    }
+
+  if( vlistInqVarEnsemble( vlistID,  varID, &ensID, &ensCount, &forecast_type ) )
+    {
+      /* void cdf_put_att_int(  int ncid, int varid, const char *name, nc_type xtype,
+	                        size_t len, const int *ip )
+       */
+
+	cdf_put_att_int(fileID, ncvarid, "realization", NC_INT, 1, &ensID);
+	cdf_put_att_int(fileID, ncvarid, "ensemble_members", NC_INT, 1, &ensCount);
+	cdf_put_att_int(fileID, ncvarid, "forecast_init_type", NC_INT, 1, &forecast_type);
+
+#ifdef DBG
+	if( DBG )
+	  {
+	    fprintf( stderr, "cdfDefVar :\n EnsID  %d\n Enscount %d\n Forecast init type %d\n",  ensID,
+		     ensCount,  forecast_type );
+	  }
+#endif
+    }
+
+  /* Attributes */
+  defineAttributes(vlistID, varID, fileID, ncvarid);
+
+  /* if ( streamptr->ncmode == 2 ) cdf_enddef(fileID); */
+
+  return (ncvarid);
+}
+
+static
+void scale_add(long size, double *data, double addoffset, double scalefactor)
+{
+  long i;
+  int laddoffset;
+  int lscalefactor;
+
+  laddoffset   = IS_NOT_EQUAL(addoffset, 0);
+  lscalefactor = IS_NOT_EQUAL(scalefactor, 1);
+
+  if ( laddoffset || lscalefactor )
+    {
+      for ( i = 0; i < size; ++i )
+        {
+          if ( lscalefactor ) data[i] *= scalefactor;
+          if ( laddoffset )   data[i] += addoffset;
+        }
+    }
+}
+#endif
+
+void cdfReadVarDP(int streamID, int varID, double *data, int *nmiss)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  int gridID;
+  int zaxisID;
+  int xid = UNDEFID, yid = UNDEFID, zid = UNDEFID;
+  int ncvarid;
+  int tsID;
+  size_t size;
+  size_t start[4];
+  size_t count[4];
+  int ndims = 0;
+  int idim;
+  int tsteptype;
+  int gridindex, zaxisindex;
+  int vlistID;
+  int i;
+  double missval;
+  int laddoffset, lscalefactor;
+  double addoffset, scalefactor;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  tsID = streamptr->curTsID;
+
+  if ( CDI_Debug ) Message("tsID = %d", tsID);
+
+  ncvarid = streamptr->vars[varID].ncvarid;
+
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( gridInqType(gridID) == GRID_TRAJECTORY )
+    {
+      cdfReadGridTraj(streamID, gridID);
+    }
+  else
+    {
+      xid = streamptr->xdimID[gridindex];
+      yid = streamptr->ydimID[gridindex];
+    }
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+  zid = streamptr->zaxisID[zaxisindex];
+
+  if ( tsteptype != TSTEP_CONSTANT )
+    {
+      start[ndims] = tsID;
+      count[ndims] = 1;
+      ndims++;
+    }
+  if ( zid != UNDEFID )
+    {
+      start[ndims] = 0;
+      count[ndims] = zaxisInqSize(zaxisID);
+      ndims++;
+    }
+  if ( yid != UNDEFID )
+    {
+      start[ndims] = 0;
+      count[ndims] = gridInqYsize(gridID);
+      ndims++;
+    }
+  if ( xid != UNDEFID )
+    {
+      start[ndims] = 0;
+      count[ndims] = gridInqXsize(gridID);
+      ndims++;
+    }
+
+  if ( CDI_Debug )
+    for (idim = 0; idim < ndims; idim++)
+      Message("dim = %d  start = %d  count = %d", idim, start[idim], count[idim]);
+
+  cdf_get_vara_double(fileID, ncvarid, start, count, data);
+
+  *nmiss = 0;
+  if ( vlistInqVarMissvalUsed(vlistID, varID) == TRUE  )
+    {
+      size    = gridInqSize(gridID)*zaxisInqSize(zaxisID);
+      missval = vlistInqVarMissval(vlistID, varID);
+
+      for ( i = 0; i < (int) size; i++ )
+        if ( DBL_IS_EQUAL(data[i], missval) ) *nmiss += 1;
+    }
+
+  addoffset    = vlistInqVarAddoffset(vlistID, varID);
+  scalefactor  = vlistInqVarScalefactor(vlistID, varID);
+  laddoffset   = IS_NOT_EQUAL(addoffset, 0);
+  lscalefactor = IS_NOT_EQUAL(scalefactor, 1);
+
+  if ( laddoffset || lscalefactor )
+    {
+      size    = gridInqSize(gridID)*zaxisInqSize(zaxisID);
+      missval = vlistInqVarMissval(vlistID, varID);
+
+      if ( *nmiss > 0 )
+        {
+          for ( i = 0; i < (int) size; i++ )
+            {
+              if ( !DBL_IS_EQUAL(data[i], missval) )
+                {
+                  if ( lscalefactor ) data[i] *= scalefactor;
+                  if ( laddoffset )   data[i] += addoffset;
+                }
+            }
+        }
+      else
+        {
+          for ( i = 0; i < (int) size; i++ )
+            {
+              if ( lscalefactor ) data[i] *= scalefactor;
+              if ( laddoffset )   data[i] += addoffset;
+            }
+        }
+    }
+#endif
+}
+
+#if defined(HAVE_LIBNETCDF)
+static
+int cdf_write_var_data(int fileID, int vlistID, int varID, int ncvarid, int dtype, long nvals, size_t xsize, size_t ysize, int swapxy, size_t *start, size_t *count, int memtype, const void *data, int nmiss)
+{
+  long i, j;
+  const double *pdata_dp = (const double *) data;
+  double *mdata_dp = NULL;
+  double *sdata_dp = NULL;
+  const float *pdata_sp = (const float *) data;
+  float *mdata_sp = NULL;
+  float *sdata_sp = NULL;
+  extern int CDF_Debug;
+
+  /*  if ( dtype == DATATYPE_INT8 || dtype == DATATYPE_INT16 || dtype == DATATYPE_INT32 ) */
+    {
+      int laddoffset, lscalefactor;
+      double addoffset, scalefactor;
+      double missval;
+
+      addoffset    = vlistInqVarAddoffset(vlistID, varID);
+      scalefactor  = vlistInqVarScalefactor(vlistID, varID);
+      laddoffset   = IS_NOT_EQUAL(addoffset, 0);
+      lscalefactor = IS_NOT_EQUAL(scalefactor, 1);
+
+      missval      = vlistInqVarMissval(vlistID, varID);
+
+      if ( laddoffset || lscalefactor )
+        {
+          if ( memtype == MEMTYPE_FLOAT )
+            {
+              mdata_sp = (float *) malloc(nvals*sizeof(float));
+              memcpy(mdata_sp, pdata_sp, nvals*sizeof(float));
+              pdata_sp = mdata_sp;
+
+              if ( nmiss > 0 )
+                {
+                  for ( i = 0; i < nvals; i++ )
+                    {
+                      if ( !DBL_IS_EQUAL(mdata_sp[i], missval) )
+                        {
+                          if ( laddoffset )   mdata_sp[i] -= addoffset;
+                          if ( lscalefactor ) mdata_sp[i] /= scalefactor;
+                        }
+                    }
+                }
+              else
+                {
+                  for ( i = 0; i < nvals; i++ )
+                    {
+                      if ( laddoffset )   mdata_sp[i] -= addoffset;
+                      if ( lscalefactor ) mdata_sp[i] /= scalefactor;
+                    }
+                }
+            }
+          else
+            {
+              mdata_dp = (double *) malloc(nvals*sizeof(double));
+              memcpy(mdata_dp, pdata_dp, nvals*sizeof(double));
+              pdata_dp = mdata_dp;
+
+              if ( nmiss > 0 )
+                {
+                  for ( i = 0; i < nvals; i++ )
+                    {
+                      if ( !DBL_IS_EQUAL(mdata_dp[i], missval) )
+                        {
+                          if ( laddoffset )   mdata_dp[i] -= addoffset;
+                          if ( lscalefactor ) mdata_dp[i] /= scalefactor;
+                        }
+                    }
+                }
+              else
+                {
+                  for ( i = 0; i < nvals; i++ )
+                    {
+                      if ( laddoffset )   mdata_dp[i] -= addoffset;
+                      if ( lscalefactor ) mdata_dp[i] /= scalefactor;
+                    }
+                }
+            }
+        }
+
+      if ( dtype == DATATYPE_UINT8 || dtype == DATATYPE_INT8 ||
+           dtype == DATATYPE_INT16 || dtype == DATATYPE_INT32 )
+        {
+          if ( memtype == MEMTYPE_FLOAT )
+            {
+              if ( mdata_sp == NULL )
+                {
+                  mdata_sp = (float *) malloc(nvals*sizeof(float));
+                  memcpy(mdata_sp, pdata_sp, nvals*sizeof(float));
+                  pdata_sp = mdata_sp;
+                }
+
+              for ( i = 0; i < nvals; i++ ) mdata_sp[i] = NINT(mdata_sp[i]);
+
+              if ( dtype == DATATYPE_UINT8 )
+                {
+                  nc_type xtype;
+                  cdf_inq_vartype(fileID, ncvarid, &xtype);
+                  if ( xtype == NC_BYTE )
+                    {
+                      for ( i = 0; i < nvals; ++i )
+                        if ( mdata_sp[i] > 127 ) mdata_sp[i] -= 256;
+                    }
+                }
+            }
+          else
+            {
+              if ( mdata_dp == NULL )
+                {
+                  mdata_dp = (double *) malloc(nvals*sizeof(double));
+                  memcpy(mdata_dp, pdata_dp, nvals*sizeof(double));
+                  pdata_dp = mdata_dp;
+                }
+
+              for ( i = 0; i < nvals; i++ ) mdata_dp[i] = NINT(mdata_dp[i]);
+
+              if ( dtype == DATATYPE_UINT8 )
+                {
+                  nc_type xtype;
+                  cdf_inq_vartype(fileID, ncvarid, &xtype);
+                  if ( xtype == NC_BYTE )
+                    {
+                      for ( i = 0; i < nvals; ++i )
+                        if ( mdata_dp[i] > 127 ) mdata_dp[i] -= 256;
+                    }
+                }
+            }
+        }
+
+      if ( CDF_Debug && memtype != MEMTYPE_FLOAT )
+        {
+          double fmin, fmax;
+          fmin =  1.0e200;
+          fmax = -1.0e200;
+          for ( i = 0; i < nvals; ++i )
+            {
+              if ( !DBL_IS_EQUAL(pdata_dp[i], missval) )
+                {
+                  if ( pdata_dp[i] < fmin ) fmin = pdata_dp[i];
+                  if ( pdata_dp[i] > fmax ) fmax = pdata_dp[i];
+                }
+            }
+          Message("nvals = %d, nmiss = %d, missval = %g, minval = %g, maxval = %g",
+                  nvals, nmiss, missval, fmin, fmax);
+        }
+    }
+
+  if ( swapxy )
+    {
+      if ( memtype == MEMTYPE_FLOAT )
+        {
+          sdata_sp = (float *) malloc(nvals*sizeof(float));
+          for ( j = 0; j < (long)ysize; ++j )
+            for ( i = 0; i < (long)xsize; ++i )
+              sdata_sp[i*ysize+j] = pdata_sp[j*xsize+i];
+          pdata_sp = sdata_sp;
+        }
+      else
+        {
+          sdata_dp = (double *) malloc(nvals*sizeof(double));
+          for ( j = 0; j < (long)ysize; ++j )
+            for ( i = 0; i < (long)xsize; ++i )
+              sdata_dp[i*ysize+j] = pdata_dp[j*xsize+i];
+          pdata_dp = sdata_dp;
+        }
+    }
+
+  if ( memtype == MEMTYPE_FLOAT )
+    cdf_put_vara_float(fileID, ncvarid, start, count, pdata_sp);
+  else
+    cdf_put_vara_double(fileID, ncvarid, start, count, pdata_dp);
+
+  if ( mdata_dp ) free(mdata_dp);
+  if ( sdata_dp ) free(sdata_dp);
+  if ( mdata_sp ) free(mdata_sp);
+  if ( sdata_sp ) free(sdata_sp);
+
+  return (0);
+}
+#endif
+
+void cdf_write_var(int streamID, int varID, int memtype, const void *data, int nmiss)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  int gridID;
+  int zaxisID;
+  int xid = UNDEFID, yid = UNDEFID, zid = UNDEFID;
+  int ncvarid;
+  int ntsteps;
+  size_t xsize = 0, ysize = 0;
+  size_t size;
+  size_t start[4];
+  size_t count[4];
+  long nvals;
+  int swapxy = FALSE;
+  int ndims = 0;
+  int idim;
+  int tsteptype;
+  int gridindex, zaxisindex;
+  int dtype;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ntsteps = streamptr->ntsteps;
+  if ( CDI_Debug )
+    Message("ntsteps = %d", ntsteps); 
+
+  if ( vlistHasTime(vlistID) ) cdfDefTime(streamID);
+
+  ncvarid = cdfDefVar(streamID, varID);
+
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( gridInqType(gridID) == GRID_TRAJECTORY )
+    {
+      cdfWriteGridTraj(streamID, gridID);
+    }
+  else
+    {
+      xid = streamptr->xdimID[gridindex];
+      yid = streamptr->ydimID[gridindex];
+    }
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+  zid = streamptr->zaxisID[zaxisindex];
+
+  if ( tsteptype != TSTEP_CONSTANT )
+    {
+      start[ndims] = ntsteps - 1;
+      count[ndims] = 1;
+      ndims++;
+    }
+  if ( zid != UNDEFID )
+    {
+      start[ndims] = 0;
+      count[ndims] = zaxisInqSize(zaxisID);
+      ndims++;
+    }
+  if ( yid != UNDEFID )
+    {
+      start[ndims] = 0;
+      cdf_inq_dimlen(fileID, yid, &size);
+      /*      count[ndims] = gridInqYsize(gridID); */
+      count[ndims] = size;
+      ndims++;
+    }
+  if ( xid != UNDEFID )
+    {
+      start[ndims] = 0;
+      cdf_inq_dimlen(fileID, xid, &size);
+      /*      count[ndims] = gridInqXsize(gridID); */
+      count[ndims] = size;
+      ndims++;
+    }
+
+  if ( CDI_Debug )
+    for (idim = 0; idim < ndims; idim++)
+      Message("dim = %d  start = %d  count = %d", idim, start[idim], count[idim]);
+
+  if ( streamptr->ncmode == 1 )
+    {
+      cdf_enddef(fileID);
+      streamptr->ncmode = 2;
+    }
+
+  dtype = vlistInqVarDatatype(vlistID, varID);
+
+  if ( nmiss > 0 ) cdfDefVarMissval(streamID, varID, dtype, 1);
+
+  nvals = gridInqSize(gridID)*zaxisInqSize(zaxisID);
+
+  cdf_write_var_data(fileID, vlistID, varID, ncvarid, dtype, nvals, xsize, ysize, swapxy, start, count, memtype, data, nmiss);
+
+#endif
+}
+
+
+int cdfReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *nmiss)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  int gridID;
+  int zaxisID;
+  int xid = UNDEFID, yid = UNDEFID, zid = UNDEFID;
+  int ncvarid;
+  int tsID;
+  int gridsize, xsize, ysize;
+  size_t size;
+  size_t start[4];
+  size_t count[4];
+  int ndims = 0;
+  int idim;
+  int tsteptype;
+  int gridindex;
+  int zaxisindex;
+  int vlistID;
+  int i, j;
+  int dimorder[3];
+  int ixyz;
+  int swapxy = FALSE;
+  int lvalidrange;
+  double validrange[2];
+  double missval;
+  int laddoffset, lscalefactor;
+  double addoffset, scalefactor;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d  levelID = %d", streamID, varID, levelID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  tsID = streamptr->curTsID;
+  if ( CDI_Debug )
+    Message("tsID = %d", tsID);
+
+  ncvarid = streamptr->vars[varID].ncvarid;
+
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+  ixyz      = vlistInqVarXYZ(vlistID, varID);
+  if ( ixyz == 0 ) ixyz = 321; // ZYX
+
+  gridsize = gridInqSize(gridID);
+  xsize = gridInqXsize(gridID);
+  ysize = gridInqYsize(gridID);
+
+  streamptr->numvals += gridsize;
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( gridInqType(gridID) == GRID_TRAJECTORY )
+    {
+      cdfReadGridTraj(streamID, gridID);
+    }
+  else if ( gridInqType(gridID) == GRID_UNSTRUCTURED )
+    {
+      xid = streamptr->xdimID[gridindex];
+    }
+  else
+    {
+      xid = streamptr->xdimID[gridindex];
+      yid = streamptr->ydimID[gridindex];
+    }
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+  zid = streamptr->zaxisID[zaxisindex];
+  /*
+  printf("2 %d %d %d %s\n", streamID, zaxisindex, streamptr->zaxisID[zaxisindex], vlistInqVarNamePtr(vlistID, varID));
+  */
+  dimorder[0] = ixyz/100;
+  dimorder[1] = (ixyz-dimorder[0]*100)/10;
+  dimorder[2] = (ixyz-dimorder[0]*100-dimorder[1]*10);
+
+  if ( (dimorder[2] == 2 || dimorder[0] == 1) && xid != UNDEFID && yid != UNDEFID ) swapxy = TRUE;
+  /*
+  printf("swapxy %d\n", swapxy);
+  printf("ixyz %d\n", ixyz);
+  printf("dimorder: %d %d %d\n", dimorder[0], dimorder[1], dimorder[2]);
+  */
+
+  if ( tsteptype != TSTEP_CONSTANT )
+    {
+      start[ndims] = tsID;
+      count[ndims] = 1;
+      ndims++;
+    }
+
+  for ( int id = 0; id < 3; ++id )
+    {
+      if ( dimorder[id] == 3 && zid != UNDEFID )
+        {
+          start[ndims] = levelID;
+          count[ndims] = 1;
+          ndims++;
+        }
+      else if ( dimorder[id] == 2 && yid != UNDEFID )
+        {
+          start[ndims] = 0;
+          cdf_inq_dimlen(fileID, yid, &size);
+          count[ndims] = size;
+          ndims++;
+        }
+      else if ( dimorder[id] == 1 && xid != UNDEFID )
+        {
+          start[ndims] = 0;
+          cdf_inq_dimlen(fileID, xid, &size);
+          count[ndims] = size;
+          ndims++;
+        }
+    }
+
+  if ( CDI_Debug )
+    for (idim = 0; idim < ndims; idim++)
+      Message("dim = %d  start = %d  count = %d", idim, start[idim], count[idim]);
+
+  if ( vlistInqVarDatatype(vlistID, varID) == DATATYPE_FLT32 )
+    {
+      float *data_fp = (float *) data;
+      cdf_get_vara_float(fileID, ncvarid, start, count, data_fp);
+      for ( i = gridsize-1; i >=0; i-- )
+        data[i] = (double) data_fp[i];
+    }
+  else
+    cdf_get_vara_double(fileID, ncvarid, start, count, data);
+
+  if ( swapxy )
+    {
+      double *tdata;
+      tdata = (double *) malloc(gridsize*sizeof(double));
+      memcpy(tdata, data, gridsize*sizeof(double));
+      for ( j = 0; j < ysize; ++j )
+        for ( i = 0; i < xsize; ++i )
+          data[j*xsize+i] = tdata[i*ysize+j];
+      free(tdata);
+    }
+
+  if ( vlistInqVarDatatype(vlistID, varID) == DATATYPE_UINT8 )
+    {
+      nc_type xtype;
+      cdf_inq_vartype(fileID, ncvarid, &xtype);
+      if ( xtype == NC_BYTE )
+        {
+          for ( i = 0; i < gridsize; i++ )
+            if ( data[i] < 0 ) data[i] += 256;
+        }
+    }
+
+  *nmiss = 0;
+  if ( vlistInqVarMissvalUsed(vlistID, varID) == TRUE )
+    {
+      missval = vlistInqVarMissval(vlistID, varID);
+
+      lvalidrange = vlistInqVarValidrange(vlistID, varID, validrange);
+      // printf("readvarslice: validrange %d %g %g\n", lvalidrange, validrange[0], validrange[1]);
+      if ( lvalidrange )
+        for ( i = 0; i < gridsize; i++ )
+          {
+            if ( IS_NOT_EQUAL(validrange[0], VALIDMISS) && data[i] < validrange[0] ) data[i] = missval;
+            if ( IS_NOT_EQUAL(validrange[1], VALIDMISS) && data[i] > validrange[1] ) data[i] = missval;
+          }
+
+      // printf("XXX %31.0f %31.0f %31.0f %31.0f\n", missval, (float)data[0]);
+      for ( i = 0; i < gridsize; i++ )
+        if ( DBL_IS_EQUAL(data[i], missval) ) *nmiss += 1;
+    }
+
+  addoffset    = vlistInqVarAddoffset(vlistID, varID);
+  scalefactor  = vlistInqVarScalefactor(vlistID, varID);
+  laddoffset   = IS_NOT_EQUAL(addoffset, 0);
+  lscalefactor = IS_NOT_EQUAL(scalefactor, 1);
+
+  if ( laddoffset || lscalefactor )
+    {
+      missval = vlistInqVarMissval(vlistID, varID);
+
+      if ( *nmiss > 0 )
+        {
+          for ( i = 0; i < gridsize; i++ )
+            {
+              if ( !DBL_IS_EQUAL(data[i], missval) )
+                {
+                  if ( lscalefactor ) data[i] *= scalefactor;
+                  if ( laddoffset )   data[i] += addoffset;
+                }
+            }
+        }
+      else
+        {
+          for ( i = 0; i < gridsize; i++ )
+            {
+              if ( lscalefactor ) data[i] *= scalefactor;
+              if ( laddoffset )   data[i] += addoffset;
+            }
+        }
+    }
+
+#endif
+  return (0);
+}
+
+
+int cdf_write_var_slice(int streamID, int varID, int levelID, int memtype, const void *data, int nmiss)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID;
+  int gridID;
+  int zaxisID;
+  int xid = UNDEFID, yid = UNDEFID, zid = UNDEFID;
+  int ncvarid;
+  int ntsteps;
+  long nvals;
+  size_t xsize = 0, ysize = 0;
+  size_t start[4];
+  size_t count[4];
+  int ndims = 0;
+  int idim;
+  int tsteptype;
+  int gridindex, zaxisindex;
+  int dimorder[3];
+  int ixyz;
+  int swapxy = FALSE;
+  int dtype;
+  int vlistID;
+  stream_t *streamptr;
+  extern int CDF_Debug;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  ntsteps = streamptr->ntsteps;
+  if ( CDI_Debug ) Message("ntsteps = %d", ntsteps);
+
+  if ( vlistHasTime(vlistID) ) cdfDefTime(streamID);
+
+  ncvarid = cdfDefVar(streamID, varID);
+
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+  ixyz      = vlistInqVarXYZ(vlistID, varID);
+  if ( ixyz == 0 ) ixyz = 321; // ZYX
+
+  gridindex = vlistGridIndex(vlistID, gridID);
+  if ( gridInqType(gridID) == GRID_TRAJECTORY )
+    {
+      cdfWriteGridTraj(streamID, gridID);
+    }
+  else
+    {
+      xid = streamptr->xdimID[gridindex];
+      yid = streamptr->ydimID[gridindex];
+    }
+
+  zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+  zid = streamptr->zaxisID[zaxisindex];
+
+  dimorder[0] = ixyz/100;
+  dimorder[1] = (ixyz-dimorder[0]*100)/10;
+  dimorder[2] = (ixyz-dimorder[0]*100-dimorder[1]*10);
+
+  if ( (dimorder[2] == 2 || dimorder[0] == 1) && xid != UNDEFID && yid != UNDEFID ) swapxy = TRUE;
+  /*
+  printf("swapxy %d\n", swapxy);
+  printf("ixyz %d\n", ixyz);
+  printf("dimorder: %d %d %d\n", dimorder[0], dimorder[1], dimorder[2]);
+  */
+
+  if ( tsteptype != TSTEP_CONSTANT )
+    {
+      start[ndims] = ntsteps - 1;
+      count[ndims] = 1;
+      ndims++;
+    }
+
+  for ( int id = 0; id < 3; ++id )
+    {
+      if ( dimorder[id] == 3 && zid != UNDEFID )
+        {
+          start[ndims] = levelID;
+          count[ndims] = 1;
+          ndims++;
+        }
+      else if ( dimorder[id] == 2 && yid != UNDEFID )
+        {
+          start[ndims] = 0;
+          cdf_inq_dimlen(fileID, yid, &ysize);
+          count[ndims] = ysize;
+          ndims++;
+        }
+      else if ( dimorder[id] == 1 && xid != UNDEFID )
+        {
+          start[ndims] = 0;
+          cdf_inq_dimlen(fileID, xid, &xsize);
+          count[ndims] = xsize;
+          ndims++;
+        }
+    }
+
+  if ( CDI_Debug )
+    for (idim = 0; idim < ndims; idim++)
+      Message("dim = %d  start = %d  count = %d", idim, start[idim], count[idim]);
+
+  dtype = vlistInqVarDatatype(vlistID, varID);
+
+  if ( nmiss > 0 ) cdfDefVarMissval(streamID, varID, dtype, 1);
+
+  nvals = gridInqSize(gridID);
+
+  cdf_write_var_data(fileID, vlistID, varID, ncvarid, dtype, nvals, xsize, ysize, swapxy, start, count, memtype, data, nmiss);
+
+#endif
+  return (0);
+}
+
+
+void cdfCreateRecords(int streamID, int tsID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int varID, levelID, recID, vrecID, zaxisID;
+  int nvars, nlev, nrecs, nvrecs;
+  record_t *records = NULL;
+  int *recIDs = NULL;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID  = streamInqVlist(streamID);
+
+  if ( tsID < 0 || (tsID >= streamptr->ntsteps && tsID > 0) ) return;
+
+  if ( streamptr->tsteps[tsID].nallrecs > 0 ) return;
+
+  if ( tsID == 0 )
+    {
+      nvars = vlistNvars(vlistID);
+      nrecs = vlistNrecs(vlistID);
+
+      streamptr->nrecs += nrecs;
+
+      if ( nrecs > 0 ) records = (record_t *) malloc(nrecs*sizeof(record_t));
+      streamptr->tsteps[tsID].records    = records;
+      streamptr->tsteps[tsID].nrecs      = nrecs;
+      streamptr->tsteps[tsID].nallrecs   = nrecs;
+      streamptr->tsteps[tsID].recordSize = nrecs;
+      streamptr->tsteps[tsID].curRecID   = UNDEFID;
+
+      nvrecs = nrecs; /* use all records at first timestep */
+      if ( nvrecs > 0 ) recIDs = (int *) malloc(nvrecs*sizeof(int));
+      streamptr->tsteps[tsID].recIDs     = recIDs;
+      for ( recID = 0; recID < nvrecs; recID++ )
+        recIDs[recID] = recID;
+
+      recID = 0;
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          zaxisID = vlistInqVarZaxis(vlistID, varID);
+          nlev    = zaxisInqSize(zaxisID);
+          for ( levelID = 0; levelID < nlev; levelID++ )
+            {
+              recordInitEntry(&records[recID]);
+              records[recID].varID   = varID;
+              records[recID].levelID = levelID;
+              recID++;
+            }
+        }
+    }
+  else if ( tsID == 1 )
+    {
+      nvars = vlistNvars(vlistID);
+      nrecs = vlistNrecs(vlistID);
+
+      nvrecs = 0;
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          if ( vlistInqVarTsteptype(vlistID, varID) != TSTEP_CONSTANT )
+            {
+              zaxisID = vlistInqVarZaxis(vlistID, varID);
+              nvrecs += zaxisInqSize(zaxisID);
+            }
+        }
+
+      streamptr->nrecs += nvrecs;
+
+      records = (record_t *) malloc(nrecs*sizeof(record_t));
+      streamptr->tsteps[tsID].records    = records;
+      streamptr->tsteps[tsID].nrecs      = nvrecs;
+      streamptr->tsteps[tsID].nallrecs   = nrecs;
+      streamptr->tsteps[tsID].recordSize = nrecs;
+      streamptr->tsteps[tsID].curRecID   = UNDEFID;
+
+      memcpy(streamptr->tsteps[tsID].records,
+             streamptr->tsteps[0].records,
+             nrecs*sizeof(record_t));
+
+      if ( nvrecs )
+        {
+          recIDs = (int *) malloc(nvrecs*sizeof(int));
+          streamptr->tsteps[tsID].recIDs     = recIDs;
+          vrecID = 0;
+          for ( recID = 0; recID < nrecs; recID++ )
+            {
+              varID = records[recID].varID;
+              if ( vlistInqVarTsteptype(vlistID, varID) != TSTEP_CONSTANT )
+                {
+                  recIDs[vrecID++] = recID;
+                }
+            }
+        }
+    }
+  else
+    {
+      nvars = vlistNvars(vlistID);
+      nrecs = vlistNrecs(vlistID);
+
+      nvrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->nrecs += nvrecs;
+
+      records = (record_t *) malloc(nrecs*sizeof(record_t));
+      streamptr->tsteps[tsID].records    = records;
+      streamptr->tsteps[tsID].nrecs      = nvrecs;
+      streamptr->tsteps[tsID].nallrecs   = nrecs;
+      streamptr->tsteps[tsID].recordSize = nrecs;
+      streamptr->tsteps[tsID].curRecID   = UNDEFID;
+
+      memcpy(streamptr->tsteps[tsID].records,
+             streamptr->tsteps[0].records,
+             nrecs*sizeof(record_t));
+
+      recIDs = (int *) malloc(nvrecs*sizeof(int));
+      streamptr->tsteps[tsID].recIDs     = recIDs;
+
+      memcpy(streamptr->tsteps[tsID].recIDs,
+             streamptr->tsteps[1].recIDs,
+             nvrecs*sizeof(int));
+    }
+#endif
+}
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+int cdfTimeDimID(int fileID, int ndims, int nvars)
+{
+  int dimid = 0;
+  char dimname[80];
+  char timeunits[CDI_MAX_NAME];
+  char attname[CDI_MAX_NAME];
+  char name[CDI_MAX_NAME];
+  nc_type xtype;
+  int nvdims, nvatts;
+  int dimids[9];
+  int varid, iatt;
+
+  for ( dimid = 0; dimid < ndims; dimid++ )
+    {
+      cdf_inq_dimname(fileID, dimid, dimname);
+      if ( memcmp(dimname, "time", 4) == 0 ) break;
+    }
+
+  if ( dimid == ndims ) dimid = UNDEFID;
+
+  for ( varid = 0; varid < nvars; varid++ )
+    {
+      if ( dimid != UNDEFID ) break;
+
+      cdf_inq_var(fileID, varid, name, &xtype, &nvdims, dimids, &nvatts);
+      if ( nvdims == 1 )
+        {
+          for ( iatt = 0; iatt < nvatts; iatt++ )
+            {
+              cdf_inq_attname(fileID, varid, iatt, attname);
+              if ( memcmp(attname, "units", 5) == 0 )
+                {
+                  cdfGetAttText(fileID, varid, "units", sizeof(timeunits), timeunits);
+                  strtolower(timeunits);
+
+                  if ( memcmp(timeunits, "sec",    3) == 0 ||
+                       memcmp(timeunits, "minute", 6) == 0 ||
+                       memcmp(timeunits, "hour",   4) == 0 ||
+                       memcmp(timeunits, "day",    3) == 0 ||
+                       memcmp(timeunits, "month",  5) == 0 )
+                    {
+                      dimid = dimids[0];
+                      break;
+                    }
+                }
+            }
+        }
+    }
+
+  return (dimid);
+}
+
+static
+void init_ncdims(long ndims, ncdim_t *ncdims)
+{
+  long ncdimid;
+
+  for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+    {
+      ncdims[ncdimid].ncvarid      = UNDEFID;
+      ncdims[ncdimid].dimtype      = UNDEFID;
+      ncdims[ncdimid].len          = 0;
+      ncdims[ncdimid].name[0]      = 0;
+    }
+}
+
+static
+void init_ncvars(long nvars, ncvar_t *ncvars)
+{
+  long ncvarid;
+
+  for ( ncvarid = 0; ncvarid < nvars; ++ncvarid )
+    {
+      ncvars[ncvarid].ncid            = UNDEFID;
+      ncvars[ncvarid].ignore          = FALSE;
+      ncvars[ncvarid].isvar           = UNDEFID;
+      ncvars[ncvarid].islon           = FALSE;
+      ncvars[ncvarid].islat           = FALSE;
+      ncvars[ncvarid].islev           = FALSE;
+      ncvars[ncvarid].istime          = FALSE;
+      ncvars[ncvarid].warn            = FALSE;
+      ncvars[ncvarid].tsteptype       = TSTEP_CONSTANT;
+      ncvars[ncvarid].param           = UNDEFID;
+      ncvars[ncvarid].code            = UNDEFID;
+      ncvars[ncvarid].tabnum          = 0;
+      ncvars[ncvarid].calendar        = FALSE;
+      ncvars[ncvarid].bounds          = UNDEFID;
+      ncvars[ncvarid].gridID          = UNDEFID;
+      ncvars[ncvarid].zaxisID         = UNDEFID;
+      ncvars[ncvarid].gridtype        = UNDEFID;
+      ncvars[ncvarid].zaxistype       = UNDEFID;
+      ncvars[ncvarid].xdim            = UNDEFID;
+      ncvars[ncvarid].ydim            = UNDEFID;
+      ncvars[ncvarid].zdim            = UNDEFID;
+      ncvars[ncvarid].xvarid          = UNDEFID;
+      ncvars[ncvarid].yvarid          = UNDEFID;
+      ncvars[ncvarid].zvarid          = UNDEFID;
+      ncvars[ncvarid].tvarid          = UNDEFID;
+      ncvars[ncvarid].ncoordvars      = 0;
+      ncvars[ncvarid].coordvarids[0]  = UNDEFID;
+      ncvars[ncvarid].coordvarids[1]  = UNDEFID;
+      ncvars[ncvarid].coordvarids[2]  = UNDEFID;
+      ncvars[ncvarid].coordvarids[3]  = UNDEFID;
+      ncvars[ncvarid].cellarea        = UNDEFID;
+      ncvars[ncvarid].tableID         = UNDEFID;
+      ncvars[ncvarid].xtype           = 0;
+      ncvars[ncvarid].ndims           = 0;
+      ncvars[ncvarid].gmapid          = UNDEFID;
+      ncvars[ncvarid].vlen            = 0;
+      ncvars[ncvarid].vdata           = NULL;
+      ncvars[ncvarid].truncation      = 0;
+      ncvars[ncvarid].positive        = 0;
+      ncvars[ncvarid].chunked         = 0;
+      ncvars[ncvarid].chunktype       = UNDEFID;
+      ncvars[ncvarid].defmiss         = 0;
+      ncvars[ncvarid].missval         = 0;
+      ncvars[ncvarid].addoffset       = 0;
+      ncvars[ncvarid].scalefactor     = 1;
+      ncvars[ncvarid].name[0]         = 0;
+      ncvars[ncvarid].longname[0]     = 0;
+      ncvars[ncvarid].stdname[0]      = 0;
+      ncvars[ncvarid].units[0]        = 0;
+      ncvars[ncvarid].natts           = 0;
+      ncvars[ncvarid].atts            = NULL;
+      ncvars[ncvarid].deflate         = 0;
+      ncvars[ncvarid].lunsigned       = 0;
+      ncvars[ncvarid].lvalidrange     = 0;
+      ncvars[ncvarid].validrange[0]   = VALIDMISS;
+      ncvars[ncvarid].validrange[1]   = VALIDMISS;
+      ncvars[ncvarid].ensdata         = NULL;
+    }
+}
+
+static
+int isLonAxis(const char *units, const char *stdname)
+{
+  int status = FALSE;
+
+  if ( memcmp(units, "degrees_east", 12) == 0 ||
+       memcmp(units, "degree_east", 11)  == 0 ||
+       memcmp(units, "degree_E", 8)      == 0 ||
+       memcmp(units, "degrees_E", 9)     == 0 ||
+       memcmp(units, "degreeE", 7)       == 0 ||
+       memcmp(units, "degreesE", 8)      == 0 ||
+       memcmp(stdname, "longitude", 9)   == 0 ||
+       (memcmp(units, "degree", 6)            == 0 &&
+        memcmp(stdname, "grid_longitude", 14) == 0) ||
+       (memcmp(units, "radian", 6)            == 0 &&
+        memcmp(stdname, "grid_longitude", 14) == 0) )
+    {
+      status = TRUE;
+    }
+
+  return (status);
+}
+
+static
+int isLatAxis(const char *units, const char *stdname)
+{
+  int status = FALSE;
+
+  if ( memcmp(units, "degrees_north", 13) == 0 ||
+       memcmp(units, "degree_north", 12)  == 0 ||
+       memcmp(units, "degree_N", 8)       == 0 ||
+       memcmp(units, "degrees_N", 9)      == 0 ||
+       memcmp(units, "degreeN", 7)        == 0 ||
+       memcmp(units, "degreesN", 8)       == 0 ||
+       memcmp(stdname, "latitude", 8)     == 0 ||
+       (memcmp(units, "degree", 6)           == 0 &&
+        memcmp(stdname, "grid_latitude", 13) == 0) ||
+       (memcmp(units, "radian", 6)           == 0 &&
+        memcmp(stdname, "grid_latitude", 13) == 0) )
+    {
+      status = TRUE;
+    }
+
+  return (status);
+}
+
+static
+int isDBLAxis(const char *units, const char *longname)
+{
+  int status = FALSE;
+
+  if ( strcmp(longname, "depth below land")         == 0 ||
+       strcmp(longname, "depth_below_land")         == 0 ||
+       strcmp(longname, "levels below the surface") == 0 )
+    {
+      /*
+      if ( strcmp(ncvars[ncvarid].units, "cm") == 0 ||
+           strcmp(ncvars[ncvarid].units, "dm") == 0 ||
+           strcmp(ncvars[ncvarid].units, "m")  == 0 )
+      */
+        status = TRUE;
+    }
+
+  return (status);
+}
+
+static
+int isDepthAxis(const char *stdname, const char *longname)
+{
+  int status = FALSE;
+
+  if ( strcmp(stdname, "depth") == 0 ) status = TRUE;
+ 
+  if ( status == FALSE )
+    if ( strcmp(longname, "depth_below_sea") == 0 ||
+         strcmp(longname, "depth below sea") == 0 )
+      {
+        status = TRUE;
+      }
+
+  return (status);
+}
+
+static
+int isHeightAxis(const char *stdname, const char *longname)
+{
+  int status = FALSE;
+
+  if ( strcmp(stdname, "height") == 0 ) status = TRUE;
+
+  if ( status == FALSE )
+    if ( strcmp(longname, "height") == 0 ||
+         strcmp(longname, "height above the surface") == 0 )
+      {
+        status = TRUE;
+      }
+
+  return (status);
+}
+
+static
+int unitsIsPressure(const char *units)
+{
+  int status = FALSE;
+
+  if ( memcmp(units, "millibar", 8) == 0 ||
+       memcmp(units, "mb", 2)       == 0 ||
+       memcmp(units, "hectopas", 8) == 0 ||
+       memcmp(units, "hPa", 3)      == 0 ||
+       memcmp(units, "Pa", 2)       == 0 )
+    {
+      status = TRUE;
+    }
+
+  return (status);
+}
+
+static
+int isGaussGrid(long ysize, double yinc, double *yvals)
+{
+  int lgauss = FALSE;
+  long i;
+  double *yv, *yw;
+
+  if ( IS_EQUAL(yinc, 0) && ysize > 2 ) /* check if gaussian */
+    {
+      yv = (double *) malloc(ysize*sizeof(double));
+      yw = (double *) malloc(ysize*sizeof(double));
+      gaussaw(yv, yw, ysize);
+      free(yw);
+      for ( i = 0; i < ysize; i++ )
+        yv[i] = asin(yv[i])/M_PI*180.0;
+
+      for ( i = 0; i < ysize; i++ )
+        if ( fabs(yv[i] - yvals[i]) >
+             ((yv[0] - yv[1])/500) ) break;
+
+      if ( i == ysize ) lgauss = TRUE;
+
+      /* check S->N */
+      if ( lgauss == FALSE )
+        {
+          for ( i = 0; i < ysize; i++ )
+            if ( fabs(yv[i] - yvals[ysize-i-1]) >
+                 ((yv[0] - yv[1])/500) ) break;
+
+          if ( i == ysize ) lgauss = TRUE;
+        }
+
+      free(yv);
+    }
+
+  return (lgauss);
+}
+
+static
+void cdfSetVar(ncvar_t *ncvars, int ncvarid, int isvar)
+{
+  if ( isvar != TRUE && isvar != FALSE )
+    Error("Internal problem! var %s undefined", ncvars[ncvarid].name);
+
+  if ( ncvars[ncvarid].isvar != UNDEFID &&
+       ncvars[ncvarid].isvar != isvar   &&
+       ncvars[ncvarid].warn  == FALSE )
+    {
+      if ( ! ncvars[ncvarid].ignore )
+        Warning("Inconsistent variable definition for %s!", ncvars[ncvarid].name);
+
+      ncvars[ncvarid].warn = TRUE;
+      isvar = FALSE;
+    }
+
+  ncvars[ncvarid].isvar = isvar;
+}
+
+static
+void cdfSetDim(ncvar_t *ncvars, int ncvarid, int dimid, int dimtype)
+{
+  if ( ncvars[ncvarid].dimtype[dimid] != UNDEFID &&
+       ncvars[ncvarid].dimtype[dimid] != dimtype )
+    {
+      Warning("Inconsistent dimension definition for %s! dimid = %d;  type = %d;  newtype = %d",
+              ncvars[ncvarid].name, dimid, ncvars[ncvarid].dimtype[dimid], dimtype);
+    }
+
+  ncvars[ncvarid].dimtype[dimid] = dimtype;
+}
+
+static
+void printNCvars(ncvar_t *ncvars, int nvars, const char *oname)
+{
+  char axis[7];
+  int ncvarid, i;
+  int ndim;
+  int iaxis[] = {'t', 'z', 'y', 'x'};
+
+  fprintf(stderr, "%s:\n", oname);
+
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      ndim = 0;
+      if ( ncvars[ncvarid].isvar )
+        {
+          axis[ndim++] = 'v';
+          axis[ndim++] = ':';
+          for ( i = 0; i < ncvars[ncvarid].ndims; i++ )
+            {/*
+              if      ( ncvars[ncvarid].tvarid != -1 ) axis[ndim++] = iaxis[0];
+              else if ( ncvars[ncvarid].zvarid != -1 ) axis[ndim++] = iaxis[1];
+              else if ( ncvars[ncvarid].yvarid != -1 ) axis[ndim++] = iaxis[2];
+              else if ( ncvars[ncvarid].xvarid != -1 ) axis[ndim++] = iaxis[3];
+              else
+             */
+              if      ( ncvars[ncvarid].dimtype[i] == T_AXIS ) axis[ndim++] = iaxis[0];
+              else if ( ncvars[ncvarid].dimtype[i] == Z_AXIS ) axis[ndim++] = iaxis[1];
+              else if ( ncvars[ncvarid].dimtype[i] == Y_AXIS ) axis[ndim++] = iaxis[2];
+              else if ( ncvars[ncvarid].dimtype[i] == X_AXIS ) axis[ndim++] = iaxis[3];
+              else                                             axis[ndim++] = '?';
+            }
+        }
+      else
+        {
+          axis[ndim++] = 'c';
+          axis[ndim++] = ':';
+          if      ( ncvars[ncvarid].istime ) axis[ndim++] = iaxis[0];
+          else if ( ncvars[ncvarid].islev  ) axis[ndim++] = iaxis[1];
+          else if ( ncvars[ncvarid].islat  ) axis[ndim++] = iaxis[2];
+          else if ( ncvars[ncvarid].islon  ) axis[ndim++] = iaxis[3];
+          else                               axis[ndim++] = '?';
+        }
+
+      axis[ndim++] = 0;
+
+      fprintf(stderr, "%3d %3d  %-6s %s\n", ncvarid, ndim-3, axis, ncvars[ncvarid].name);
+    }
+}
+#endif
+
+typedef struct
+{
+  int      ncvarid;
+  char     name[CDI_MAX_NAME];
+}
+varinfo_t;
+
+
+#ifdef HAVE_LIBNETCDF
+static
+int cmpvarname(const void *s1, const void *s2)
+{
+  varinfo_t *x = (varinfo_t *) s1;
+  varinfo_t *y = (varinfo_t *) s2;
+
+  return (strcmp(x->name, y->name));
+}
+
+static
+void cdfScanVarAttributes(int nvars, ncvar_t *ncvars, ncdim_t *ncdims,
+                          int timedimid, int modelID, int format)
+{
+  int ncid;
+  int ncvarid;
+  int ncdimid;
+  int nvdims, nvatts;
+  int *dimidsp;
+  nc_type xtype, atttype;
+  size_t attlen;
+  char name[CDI_MAX_NAME];
+  char attname[CDI_MAX_NAME];
+  const int attstringlen = 8192; char attstring[8192];
+  int iatt;
+  int i;
+  int tablenum;
+
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      ncid    = ncvars[ncvarid].ncid;
+      dimidsp = ncvars[ncvarid].dimids;
+
+      cdf_inq_var(ncid, ncvarid, name, &xtype, &nvdims, dimidsp, &nvatts);
+      strcpy(ncvars[ncvarid].name, name);
+
+      for ( ncdimid = 0; ncdimid < nvdims; ncdimid++ )
+        ncvars[ncvarid].dimtype[ncdimid] = -1;
+
+      ncvars[ncvarid].xtype = xtype;
+      ncvars[ncvarid].ndims = nvdims;
+
+#if  defined  (HAVE_NETCDF4)
+      if ( format == NC_FORMAT_NETCDF4_CLASSIC || format == NC_FORMAT_NETCDF4 )
+        {
+          int shuffle, deflate, deflate_level;
+          size_t chunks[nvdims];
+          int storage_in;
+          nc_inq_var_deflate(ncid, ncvarid, &shuffle, &deflate, &deflate_level);
+          if ( deflate > 0 ) ncvars[ncvarid].deflate = 1;
+
+          if ( nc_inq_var_chunking(ncid, ncvarid, &storage_in, chunks) == NC_NOERR )
+            {
+              if ( storage_in == NC_CHUNKED )
+                {
+                  ncvars[ncvarid].chunked = 1;
+                  for ( int i = 0; i < nvdims; ++i ) ncvars[ncvarid].chunks[i] = chunks[i];
+                  /*
+                  printf("storage %d %d %d\n", storage_in, NC_CONTIGUOUS, NC_CHUNKED);
+                  for ( int i = 0; i < nvdims; ++i ) printf("chunk %d %d\n", i, chunks[i]);
+                  */
+                }
+            }
+        }
+#endif
+
+      if ( nvdims > 0 )
+        if ( timedimid == dimidsp[0] )
+          {
+            ncvars[ncvarid].tsteptype = TSTEP_INSTANT;
+            cdfSetDim(ncvars, ncvarid, 0, T_AXIS);
+          }
+
+      for ( iatt = 0; iatt < nvatts; iatt++ )
+        {
+          cdf_inq_attname(ncid, ncvarid, iatt, attname);
+          cdf_inq_atttype(ncid, ncvarid, attname, &atttype);
+          cdf_inq_attlen(ncid, ncvarid, attname, &attlen);
+
+          if ( strcmp(attname, "long_name") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, CDI_MAX_NAME, ncvars[ncvarid].longname);
+            }
+          else if ( strcmp(attname, "standard_name") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, CDI_MAX_NAME, ncvars[ncvarid].stdname);
+            }
+          else if ( strcmp(attname, "units") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, CDI_MAX_NAME, ncvars[ncvarid].units);
+            }
+          else if ( strcmp(attname, "calendar") == 0 )
+            {
+              ncvars[ncvarid].calendar = TRUE;
+            }
+          else if ( strcmp(attname, "param") == 0 && atttype == NC_CHAR )
+            {
+	      char paramstr[32];
+	      int pnum = 0, pcat = 255, pdis = 255;
+              cdfGetAttText(ncid, ncvarid, attname, sizeof(paramstr), paramstr);
+	      sscanf(paramstr, "%d.%d.%d", &pnum, &pcat, &pdis);
+	      ncvars[ncvarid].param = cdiEncodeParam(pnum, pcat, pdis);
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "code") == 0 && atttype != NC_CHAR )
+            {
+              cdfGetAttInt(ncid, ncvarid, attname, 1, &ncvars[ncvarid].code);
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "table") == 0 && atttype != NC_CHAR )
+            {
+              cdfGetAttInt(ncid, ncvarid, attname, 1, &tablenum);
+              if ( tablenum > 0 )
+                {
+                  ncvars[ncvarid].tabnum = tablenum;
+                  ncvars[ncvarid].tableID = tableInq(modelID, tablenum, NULL);
+                  if ( ncvars[ncvarid].tableID == CDI_UNDEFID )
+                    ncvars[ncvarid].tableID = tableDef(modelID, tablenum, NULL);
+                }
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "trunc_type") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              if ( memcmp(attstring, "Triangular", attlen) == 0 )
+                ncvars[ncvarid].gridtype = GRID_SPECTRAL;
+            }
+          else if ( strcmp(attname, "grid_type") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              strtolower(attstring);
+
+              if      ( strcmp(attstring, "gaussian reduced") == 0 )
+                ncvars[ncvarid].gridtype = GRID_GAUSSIAN_REDUCED;
+              else if ( strcmp(attstring, "gaussian") == 0 )
+                ncvars[ncvarid].gridtype = GRID_GAUSSIAN;
+              else if ( strncmp(attstring, "spectral", 8) == 0 )
+                ncvars[ncvarid].gridtype = GRID_SPECTRAL;
+              else if ( strncmp(attstring, "fourier", 7) == 0 )
+                ncvars[ncvarid].gridtype = GRID_FOURIER;
+              else if ( strcmp(attstring, "trajectory") == 0 )
+                ncvars[ncvarid].gridtype = GRID_TRAJECTORY;
+              else if ( strcmp(attstring, "generic") == 0 )
+                ncvars[ncvarid].gridtype = GRID_GENERIC;
+              else if ( strcmp(attstring, "cell") == 0 )
+                ncvars[ncvarid].gridtype = GRID_UNSTRUCTURED;
+              else if ( strcmp(attstring, "unstructured") == 0 )
+                ncvars[ncvarid].gridtype = GRID_UNSTRUCTURED;
+              else if ( strcmp(attstring, "curvilinear") == 0 )
+                ncvars[ncvarid].gridtype = GRID_CURVILINEAR;
+              else if ( strcmp(attstring, "sinusoidal") == 0 )
+                ;
+              else if ( strcmp(attstring, "laea") == 0 )
+                ;
+              else if ( strcmp(attstring, "lcc2") == 0 )
+                ;
+              else if ( strcmp(attstring, "linear") == 0 ) // ignore grid type linear
+                ;
+              else
+                {
+                  static int warn = TRUE;
+                  if ( warn )
+                    {
+                      warn = FALSE;
+                      Warning("netCDF attribute grid_type='%s' unsupported!", attstring);
+                    }
+                }
+
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "level_type") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              strtolower(attstring);
+
+              if      ( strcmp(attstring, "toa") == 0 )
+                ncvars[ncvarid].zaxistype = ZAXIS_TOA;
+              else if ( strcmp(attstring, "seabottom") == 0 )
+                ncvars[ncvarid].zaxistype = ZAXIS_SEA_BOTTOM;
+              else if ( strcmp(attstring, "atmosphere") == 0 )
+                ncvars[ncvarid].zaxistype = ZAXIS_ATMOSPHERE;
+              else
+                { 
+                  static int warn = TRUE;
+                  if ( warn )
+                    {
+                      warn = FALSE;
+                      Warning("netCDF attribute level_type='%s' unsupported!", attstring);
+                    }
+                }
+
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "trunc_count") == 0 && atttype != NC_CHAR )
+            {
+              cdfGetAttInt(ncid, ncvarid, attname, 1, &ncvars[ncvarid].truncation);
+            }
+          else if ( strcmp(attname, "truncation") == 0 && atttype != NC_CHAR )
+            {
+              cdfGetAttInt(ncid, ncvarid, attname, 1, &ncvars[ncvarid].truncation);
+            }
+          else if ( strcmp(attname, "add_offset") == 0 && atttype != NC_CHAR )
+            {
+	      cdfGetAttDouble(ncid, ncvarid, attname, 1, &ncvars[ncvarid].addoffset);
+	      /*
+		if ( atttype != NC_BYTE && atttype != NC_SHORT && atttype != NC_INT )
+		if ( ncvars[ncvarid].addoffset != 0 )
+		Warning("attribute add_offset not supported for atttype %d", atttype);
+	      */
+	      /* (also used for lon/lat) cdfSetVar(ncvars, ncvarid, TRUE); */
+            }
+          else if ( strcmp(attname, "scale_factor") == 0 && atttype != NC_CHAR )
+            {
+	      cdfGetAttDouble(ncid, ncvarid, attname, 1, &ncvars[ncvarid].scalefactor);
+	      /*
+		if ( atttype != NC_BYTE && atttype != NC_SHORT && atttype != NC_INT )
+		if ( ncvars[ncvarid].scalefactor != 1 )
+		Warning("attribute scale_factor not supported for atttype %d", atttype);
+	      */
+	      /* (also used for lon/lat) cdfSetVar(ncvars, ncvarid, TRUE); */
+            }
+          else if ( strcmp(attname, "bounds") == 0 && atttype == NC_CHAR )
+            {
+              int status, ncboundsid;
+
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+
+              status = nc_inq_varid(ncid, attstring, &ncboundsid);
+
+              if ( status == NC_NOERR )
+                {
+                  ncvars[ncvarid].bounds = ncboundsid;
+                  cdfSetVar(ncvars, ncvars[ncvarid].bounds, FALSE);
+                  cdfSetVar(ncvars, ncvarid, FALSE);
+                }
+              else
+                Warning("%s - %s", nc_strerror(status), attstring);
+            }
+          else if ( strcmp(attname, "cell_measures") == 0 && atttype == NC_CHAR )
+            {
+              char *pstring, *cell_measures = NULL, *cell_var = NULL;
+
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              pstring = attstring;
+
+              while ( isspace((int) *pstring) ) pstring++;
+              cell_measures = pstring;
+              while ( isalnum((int) *pstring) ) pstring++;
+              *pstring++ = 0;
+              while ( isspace((int) *pstring) ) pstring++;
+              cell_var = pstring;
+              while ( ! isspace((int) *pstring) && *pstring != 0 ) pstring++;
+              *pstring++ = 0;
+              /*
+              printf("cell_measures >%s<\n", cell_measures);
+              printf("cell_var >%s<\n", cell_var);
+              */
+              if ( memcmp(cell_measures, "area", 4) == 0 )
+                {
+                  int status;
+                  int nc_cell_id;
+
+                  status = nc_inq_varid(ncid, cell_var, &nc_cell_id);
+                  if ( status == NC_NOERR )
+                    {
+                      ncvars[ncvarid].cellarea = nc_cell_id;
+                      /* ncvars[nc_cell_id].isvar = UNDEFID; */
+                      cdfSetVar(ncvars, nc_cell_id, FALSE);
+                    }
+                  else
+                    Warning("%s - %s", nc_strerror(status), cell_var);
+                }
+              else
+                {
+                  Warning("%s has an unexpected contents: %s", attname, cell_measures);
+                }
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          /*
+          else if ( strcmp(attname, "coordinates") == 0 )
+            {
+              char *pstring, *xvarname = NULL, *yvarname = NULL;
+
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              pstring = attstring;
+
+              while ( isspace((int) *pstring) ) pstring++;
+              xvarname = pstring;
+              while ( isgraph((int) *pstring) ) pstring++;
+              *pstring++ = 0;
+              while ( isspace((int) *pstring) ) pstring++;
+              yvarname = pstring;
+              while ( isgraph((int) *pstring) ) pstring++;
+              *pstring++ = 0;
+
+              cdf_inq_varid(ncid, xvarname, &ncvars[ncvarid].xvarid);
+              cdf_inq_varid(ncid, yvarname, &ncvars[ncvarid].yvarid);
+
+              cdfSetVar(ncvars, ncvars[ncvarid].xvarid, FALSE);
+              cdfSetVar(ncvars, ncvars[ncvarid].yvarid, FALSE);
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          */
+          else if ( (strcmp(attname, "associate")  == 0 || strcmp(attname, "coordinates") == 0) &&
+		    atttype == NC_CHAR )
+            {
+              int status;
+              char *pstring, *varname = NULL;
+              int lstop = FALSE;
+              int dimvarid;
+              extern int cdiIgnoreAttCoordinates;
+
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              pstring = attstring;
+
+              for ( i = 0; i < 4; i++ )
+                {
+                  while ( isspace((int) *pstring) ) pstring++;
+                  if ( *pstring == 0 ) break;
+                  varname = pstring;
+                  while ( !isspace((int) *pstring) && *pstring != 0 ) pstring++;
+                  if ( *pstring == 0 ) lstop = TRUE;
+                  *pstring++ = 0;
+
+                  status = nc_inq_varid(ncid, varname, &dimvarid);
+                  if ( status == NC_NOERR )
+                    {
+                      cdfSetVar(ncvars, dimvarid, FALSE);
+                      if ( cdiIgnoreAttCoordinates == FALSE )
+                        {
+                          ncvars[ncvarid].coordvarids[i] = dimvarid;
+                          ncvars[ncvarid].ncoordvars++;
+                        }
+                    }
+                  else
+                    Warning("%s - %s", nc_strerror(status), varname);
+
+                  if ( lstop ) break;
+                }
+
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "grid_mapping") == 0 && atttype == NC_CHAR )
+            {
+              int status;
+              int nc_gmap_id;
+
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+
+              status = nc_inq_varid(ncid, attstring, &nc_gmap_id);
+              if ( status == NC_NOERR )
+                {
+                  ncvars[ncvarid].gmapid = nc_gmap_id;
+                  cdfSetVar(ncvars, ncvars[ncvarid].gmapid, FALSE);
+                }
+              else
+                Warning("%s - %s", nc_strerror(status), attstring);
+
+              cdfSetVar(ncvars, ncvarid, TRUE);
+            }
+          else if ( strcmp(attname, "positive") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              strtolower(attstring);
+
+              if    ( memcmp(attstring, "down", 4) == 0 ) ncvars[ncvarid].positive = -1;
+              else if ( memcmp(attstring, "up", 2) == 0 ) ncvars[ncvarid].positive = 1;
+
+              if ( ncvars[ncvarid].ndims == 1 )
+                {
+                  cdfSetVar(ncvars, ncvarid, FALSE);
+                  cdfSetDim(ncvars, ncvarid, 0, Z_AXIS);
+                  ncdims[ncvars[ncvarid].dimids[0]].dimtype = Z_AXIS;
+                }
+            }
+          else if ( (strcmp(attname, "_FillValue") == 0 || strcmp(attname, "missing_value") == 0) &&
+		    atttype != NC_CHAR )
+            {
+	      cdfGetAttDouble(ncid, ncvarid, attname, 1, &ncvars[ncvarid].missval);
+	      ncvars[ncvarid].defmiss = TRUE;
+	      /* cdfSetVar(ncvars, ncvarid, TRUE); */
+            }
+          else if ( strcmp(attname, "valid_range") == 0 && attlen == 2 )
+            {
+              if ( ncvars[ncvarid].lvalidrange == FALSE )
+                {
+                  cdfGetAttDouble(ncid, ncvarid, attname, 2, ncvars[ncvarid].validrange);
+                  ncvars[ncvarid].lvalidrange = TRUE;
+                  if ( ((int)ncvars[ncvarid].validrange[0]) == 0 && ((int)ncvars[ncvarid].validrange[1]) == 255 )
+                    ncvars[ncvarid].lunsigned = TRUE;
+                  /* cdfSetVar(ncvars, ncvarid, TRUE); */
+                }
+            }
+          else if ( strcmp(attname, "valid_min") == 0 && attlen == 1 )
+            {
+              cdfGetAttDouble(ncid, ncvarid, attname, 1, &(ncvars[ncvarid].validrange)[0]);
+              ncvars[ncvarid].lvalidrange = TRUE;
+            }
+          else if ( strcmp(attname, "valid_max") == 0 && attlen == 1 )
+            {
+              cdfGetAttDouble(ncid, ncvarid, attname, 1, &(ncvars[ncvarid].validrange)[1]);
+              ncvars[ncvarid].lvalidrange = TRUE;
+            }
+          else if ( strcmp(attname, "_Unsigned") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+              strtolower(attstring);
+
+              if ( memcmp(attstring, "true", 4) == 0 )
+                {
+                  ncvars[ncvarid].lunsigned = TRUE;
+                  /*
+                  ncvars[ncvarid].lvalidrange = TRUE;
+                  ncvars[ncvarid].validrange[0] = 0;
+                  ncvars[ncvarid].validrange[1] = 255;
+                  */
+                }
+	      /* cdfSetVar(ncvars, ncvarid, TRUE); */
+            }
+          else if ( strcmp(attname, "cdi") == 0 && atttype == NC_CHAR )
+            {
+	      cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+	      strtolower(attstring);
+
+	      if ( memcmp(attstring, "ignore", 6) == 0 )
+		{
+		  ncvars[ncvarid].ignore = TRUE;
+		  cdfSetVar(ncvars, ncvarid, FALSE);
+		}
+            }
+          else if ( strcmp(attname, "axis") == 0 && atttype == NC_CHAR )
+            {
+              cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+	      attlen = strlen(attstring);
+
+	      if ( (int) attlen > nvdims )
+		{
+		  if ( nvdims > 0 )
+		    Warning("Unexpected axis attribute length for %s, ignored!", name);
+		}
+	      else
+		{
+		  strtolower(attstring);
+		  for ( i = 0; i < (int)attlen; ++i )
+		    {
+		      if ( attstring[i] != '-' && attstring[i] != 't' && attstring[i] != 'z' &&
+			   attstring[i] != 'y' && attstring[i] != 'x' )
+			{
+			  Warning("Unexpected character in axis attribute for %s, ignored!", name);
+			  break;
+			}
+		    }
+
+		  if ( i == (int) attlen && (int) attlen == nvdims)
+		    {
+		      while ( attlen-- )
+			{
+			  if ( (int) attstring[attlen] == 't' )
+			    {
+			      if ( attlen != 0 ) Warning("axis attribute 't' not on first position");
+			      cdfSetDim(ncvars, ncvarid, attlen, T_AXIS);
+			    }
+			  else if ( (int) attstring[attlen] == 'z' )
+			    {
+			      ncvars[ncvarid].zdim = dimidsp[attlen];
+			      cdfSetDim(ncvars, ncvarid, attlen, Z_AXIS);
+
+			      if ( ncvars[ncvarid].ndims == 1 )
+				{
+				  cdfSetVar(ncvars, ncvarid, FALSE);
+				  ncdims[ncvars[ncvarid].dimids[0]].dimtype = Z_AXIS;
+				}
+			    }
+			  else if ( (int) attstring[attlen] == 'y' )
+			    {
+			      ncvars[ncvarid].ydim = dimidsp[attlen];
+			      cdfSetDim(ncvars, ncvarid, attlen, Y_AXIS);
+
+			      if ( ncvars[ncvarid].ndims == 1 )
+				{
+				  cdfSetVar(ncvars, ncvarid, FALSE);
+				  ncdims[ncvars[ncvarid].dimids[0]].dimtype = Y_AXIS;
+				}
+			    }
+			  else if ( (int) attstring[attlen] == 'x' )
+			    {
+			      ncvars[ncvarid].xdim = dimidsp[attlen];
+			      cdfSetDim(ncvars, ncvarid, attlen, X_AXIS);
+
+			      if ( ncvars[ncvarid].ndims == 1 )
+				{
+				  cdfSetVar(ncvars, ncvarid, FALSE);
+				  ncdims[ncvars[ncvarid].dimids[0]].dimtype = X_AXIS;
+				}
+			    }
+			}
+		    }
+		}
+	    }
+	  else if ( ( strcmp(attname, "realization") == 0 )         ||
+	            ( strcmp(attname, "ensemble_members") == 0 )    ||
+	            ( strcmp(attname, "forecast_init_type") == 0 )    )
+	    {
+	      int temp;
+
+	      if( ncvars[ncvarid].ensdata == NULL )
+		ncvars[ncvarid].ensdata = (ensinfo_t *) malloc( sizeof( ensinfo_t ) );
+
+	      cdfGetAttInt(ncid, ncvarid, attname, 1, &temp);
+
+	      if( strcmp(attname, "realization") == 0 )
+		ncvars[ncvarid].ensdata->ens_index = temp;
+	      else if( strcmp(attname, "ensemble_members") == 0 )
+		ncvars[ncvarid].ensdata->ens_count = temp;
+	      else if( strcmp(attname, "forecast_init_type") == 0 )
+		ncvars[ncvarid].ensdata->forecast_init_type = temp;
+
+	      cdfSetVar(ncvars, ncvarid, TRUE);
+	    }
+	  else
+	    {
+	      if ( ncvars[ncvarid].natts == 0 )
+		ncvars[ncvarid].atts = (int *) malloc(nvatts*sizeof(int));
+
+	      ncvars[ncvarid].atts[ncvars[ncvarid].natts++] = iatt;
+	      /*
+	      int attrint;
+	      double attrflt;
+	      nc_type attrtype;
+	      cdf_inq_attlen(ncid, ncvarid, attname, &attlen);
+	      cdf_inq_atttype(ncid, ncvarid, attname, &attrtype);
+	      if ( attlen == 1 && (attrtype == NC_INT || attrtype == NC_SHORT) )
+		{
+		  cdfGetAttInt(ncid, ncvarid, attname, 1, &attrint);
+		  printf("int: %s.%s = %d\n", ncvars[ncvarid].name, attname, attrint);
+		}
+	      else if ( attlen == 1 && (attrtype == NC_FLOAT || attrtype == NC_DOUBLE) )
+		{
+		  cdfGetAttDouble(ncid, ncvarid, attname, 1, &attrflt);
+		  printf("flt: %s.%s = %g\n", ncvars[ncvarid].name, attname, attrflt);
+		}
+	      else if ( attrtype == NC_CHAR )
+		{
+		  cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+		  attstring[attlen] = 0;
+		  printf("txt: %s.%s = %s\n", ncvars[ncvarid].name, attname, attstring);
+		}
+	      else
+		printf("att: %s.%s = unknown\n", ncvars[ncvarid].name, attname);
+	      */
+	    }
+	}
+    }
+}
+
+static
+void setDimType(int nvars, ncvar_t *ncvars, ncdim_t *ncdims)
+{
+  int ndims;
+  int ncvarid, ncdimid;
+  int i;
+
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( ncvars[ncvarid].isvar == TRUE )
+	{
+	  int lxdim = 0, lydim = 0, lzdim = 0/* , ltdim = 0 */;
+	  ndims = ncvars[ncvarid].ndims;
+	  for ( i = 0; i < ndims; i++ )
+	    {
+	      ncdimid = ncvars[ncvarid].dimids[i];
+	      if      ( ncdims[ncdimid].dimtype == X_AXIS ) cdfSetDim(ncvars, ncvarid, i, X_AXIS);
+	      else if ( ncdims[ncdimid].dimtype == Y_AXIS ) cdfSetDim(ncvars, ncvarid, i, Y_AXIS);
+	      else if ( ncdims[ncdimid].dimtype == Z_AXIS ) cdfSetDim(ncvars, ncvarid, i, Z_AXIS);
+	      else if ( ncdims[ncdimid].dimtype == T_AXIS ) cdfSetDim(ncvars, ncvarid, i, T_AXIS);
+	    }
+
+	  if ( CDI_Debug )
+	    {
+	      Message("var %d %s", ncvarid, ncvars[ncvarid].name);
+	      for ( i = 0; i < ndims; i++ )
+		printf("  dim %d type %d  ", i, ncvars[ncvarid].dimtype[i]);
+	      printf("\n");
+	    }
+
+	  for ( i = 0; i < ndims; i++ )
+	    {
+	      if      ( ncvars[ncvarid].dimtype[i] == X_AXIS ) lxdim = TRUE;
+	      else if ( ncvars[ncvarid].dimtype[i] == Y_AXIS ) lydim = TRUE;
+	      else if ( ncvars[ncvarid].dimtype[i] == Z_AXIS ) lzdim = TRUE;
+	      /* else if ( ncvars[ncvarid].dimtype[i] == T_AXIS ) ltdim = TRUE; */
+	    }
+
+          //   if ( ndims > 1 )
+            for ( i = ndims-1; i >= 0; i-- )
+              {
+                if ( ncvars[ncvarid].dimtype[i] == -1 )
+                  {
+                    if ( lxdim == FALSE )
+                      {
+                        cdfSetDim(ncvars, ncvarid, i, X_AXIS);
+                        lxdim = TRUE;
+                      }
+                    else if ( lydim == FALSE && ncvars[ncvarid].gridtype != GRID_UNSTRUCTURED )
+                      {
+                        cdfSetDim(ncvars, ncvarid, i, Y_AXIS);
+                        lydim = TRUE;
+                      }
+                    else if ( lzdim == FALSE )
+                      {
+                        cdfSetDim(ncvars, ncvarid, i, Z_AXIS);
+                        lzdim = TRUE;
+                      }
+                  }
+              }
+	}
+    }
+}
+
+/* verify coordinate vars - first scan (dimname == varname) */
+static
+void verify_coordinate_vars_1(int ndims, ncdim_t *ncdims, ncvar_t *ncvars, int timedimid)
+{
+  int ncdimid, ncvarid;
+
+  for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+    {
+      ncvarid = ncdims[ncdimid].ncvarid;
+      if ( ncvarid != -1 )
+	{
+	  if ( ncvars[ncvarid].dimids[0] == timedimid )
+	    {
+              ncvars[ncvarid].istime = TRUE;
+	      ncdims[ncdimid].dimtype = T_AXIS;
+	      continue;
+	    }
+
+	  if ( ncvars[ncvarid].longname[0] != 0 && ncvars[ncvarid].longname[1] != 0 )
+	    {
+	      if ( memcmp(ncvars[ncvarid].longname+1, "ongitude", 8) == 0 )
+		{
+		  ncvars[ncvarid].islon = TRUE;
+		  cdfSetVar(ncvars, ncvarid, FALSE);
+		  cdfSetDim(ncvars, ncvarid, 0, X_AXIS);
+		  ncdims[ncdimid].dimtype = X_AXIS;
+		  continue;
+		}
+	      else if ( memcmp(ncvars[ncvarid].longname+1, "atitude", 7) == 0 )
+		{
+		  ncvars[ncvarid].islat = TRUE;
+		  cdfSetVar(ncvars, ncvarid, FALSE);
+		  cdfSetDim(ncvars, ncvarid, 0, Y_AXIS);
+		  ncdims[ncdimid].dimtype = Y_AXIS;
+		  continue;
+		}
+	    }
+
+	  if ( ncvars[ncvarid].units[0] != 0 )
+	    {
+	      if ( isLonAxis(ncvars[ncvarid].units, ncvars[ncvarid].stdname) )
+		{
+		  ncvars[ncvarid].islon = TRUE;
+		  cdfSetVar(ncvars, ncvarid, FALSE);
+		  cdfSetDim(ncvars, ncvarid, 0, X_AXIS);
+		  ncdims[ncdimid].dimtype = X_AXIS;
+		}
+	      else if ( isLatAxis(ncvars[ncvarid].units, ncvars[ncvarid].stdname) )
+		{
+		  ncvars[ncvarid].islat = TRUE;
+		  cdfSetVar(ncvars, ncvarid, FALSE);
+		  cdfSetDim(ncvars, ncvarid, 0, Y_AXIS);
+		  ncdims[ncdimid].dimtype = Y_AXIS;
+		}
+	      else if ( unitsIsPressure(ncvars[ncvarid].units) )
+		{
+		  ncvars[ncvarid].zaxistype = ZAXIS_PRESSURE;
+		}
+	      else if ( strcmp(ncvars[ncvarid].units, "level") == 0 || strcmp(ncvars[ncvarid].units, "1") == 0 )
+		{
+		  if      ( strcmp(ncvars[ncvarid].longname, "hybrid level at layer midpoints") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID;
+		  else if ( memcmp(ncvars[ncvarid].longname, "hybrid level at midpoints", 25) == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID;
+		  else if ( strcmp(ncvars[ncvarid].longname, "hybrid level at layer interfaces") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID_HALF;
+		  else if ( memcmp(ncvars[ncvarid].longname, "hybrid level at interfaces", 26) == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID_HALF;
+		  else if ( strcmp(ncvars[ncvarid].units, "level") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_GENERIC;
+		}
+	      else if ( isDBLAxis(ncvars[ncvarid].units, ncvars[ncvarid].longname) )
+                {
+                  ncvars[ncvarid].zaxistype = ZAXIS_DEPTH_BELOW_LAND;
+		}
+	      else if ( strcmp(ncvars[ncvarid].units, "m")   == 0 )
+		{
+		  if ( isDepthAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
+		    ncvars[ncvarid].zaxistype = ZAXIS_DEPTH_BELOW_SEA;
+		  else if ( isHeightAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HEIGHT;
+		}
+	    }
+
+	  if ( ncvars[ncvarid].zaxistype != UNDEFID )
+	    {
+              ncvars[ncvarid].islev = TRUE;
+	      cdfSetVar(ncvars, ncvarid, FALSE);
+	      cdfSetDim(ncvars, ncvarid, 0, Z_AXIS);
+	      ncdims[ncdimid].dimtype = Z_AXIS;
+	    }
+	}
+    }
+}
+
+/* verify coordinate vars - second scan (all other variables) */
+static
+void verify_coordinate_vars_2(int nvars, ncvar_t *ncvars)
+{
+  int ncvarid;
+
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( ncvars[ncvarid].isvar == 0 )
+	{
+	  /* not needed anymore for rotated grids */
+	  if ( ncvars[ncvarid].longname[0] != 0 && ncvars[ncvarid].longname[1] != 0 )
+	    {
+	      if ( memcmp(ncvars[ncvarid].longname+1, "ongitude", 8) == 0 )
+		{
+		  ncvars[ncvarid].islon = TRUE;
+		  continue;
+		}
+	      else if ( memcmp(ncvars[ncvarid].longname+1, "atitude", 7) == 0 )
+		{
+		  ncvars[ncvarid].islat = TRUE;
+		  continue;
+		}
+	    }
+
+	  if ( ncvars[ncvarid].units[0] != 0 )
+	    {
+	      if ( isLonAxis(ncvars[ncvarid].units, ncvars[ncvarid].stdname) )
+		{
+		  ncvars[ncvarid].islon = TRUE;
+		  continue;
+		}
+	      else if ( isLatAxis(ncvars[ncvarid].units, ncvars[ncvarid].stdname) )
+		{
+		  ncvars[ncvarid].islat = TRUE;
+		  continue;
+		}
+	      else if ( unitsIsPressure(ncvars[ncvarid].units) )
+		{
+		  ncvars[ncvarid].zaxistype = ZAXIS_PRESSURE;
+		  continue;
+		}
+	      else if ( strcmp(ncvars[ncvarid].units, "level") == 0 || strcmp(ncvars[ncvarid].units, "1") == 0 )
+		{
+		  if      ( strcmp(ncvars[ncvarid].longname, "hybrid level at layer midpoints") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID;
+		  else if ( memcmp(ncvars[ncvarid].longname, "hybrid level at midpoints", 25) == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID;
+		  else if ( strcmp(ncvars[ncvarid].longname, "hybrid level at layer interfaces") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID_HALF;
+		  else if ( memcmp(ncvars[ncvarid].longname, "hybrid level at interfaces", 26) == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HYBRID_HALF;
+		  else if ( strcmp(ncvars[ncvarid].units, "level") == 0 )
+		    ncvars[ncvarid].zaxistype = ZAXIS_GENERIC;
+		  continue;
+		}
+	      else if ( isDBLAxis(ncvars[ncvarid].units, ncvars[ncvarid].longname) )
+		{
+                  ncvars[ncvarid].zaxistype = ZAXIS_DEPTH_BELOW_LAND;
+		  continue;
+		}
+	      else if ( strcmp(ncvars[ncvarid].units, "m")   == 0 )
+		{
+		  if ( isDepthAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
+		    ncvars[ncvarid].zaxistype = ZAXIS_DEPTH_BELOW_SEA;
+		  else if ( isHeightAxis(ncvars[ncvarid].stdname, ncvars[ncvarid].longname) )
+		    ncvars[ncvarid].zaxistype = ZAXIS_HEIGHT;
+		  continue;
+		}
+	    }
+	}
+    }
+}
+
+static
+void copy_numeric_projatts(int gridID, int ncvarID, int ncfileID)
+{
+  int iatt, nvatts;
+  size_t attlen;
+  char attname[CDI_MAX_NAME];
+  nc_type xtype;
+
+  cdf_inq_varnatts(ncfileID, ncvarID, &nvatts);
+
+  for ( iatt = 0; iatt < nvatts; iatt++ )
+    {
+      cdf_inq_attname(ncfileID, ncvarID, iatt, attname);
+      cdf_inq_atttype(ncfileID, ncvarID, attname, &xtype);
+      cdf_inq_attlen(ncfileID, ncvarID, attname, &attlen);
+
+      //  printf("%s %d\n", attname, (int)attlen);
+    }
+
+}
+
+/* define all input grids */
+static
+void define_all_grids(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nvars, ncvar_t *ncvars, int timedimid)
+{
+  int ncvarid, ncvarid2;
+  int ndims;
+  int nbdims;
+  int i;
+  int nvatts;
+  size_t nvertex;
+  grid_t grid;
+  grid_t proj;
+  int gridindex;
+  size_t size = 0, xsize, ysize, np;
+  char name[CDI_MAX_NAME];
+  int iatt;
+  int ltwarn = TRUE;
+  size_t attlen;
+  char attname[CDI_MAX_NAME];
+  const int attstringlen = 8192; char attstring[8192];
+  double datt;
+
+  for ( ncvarid = 0; ncvarid < nvars; ++ncvarid )
+    {
+      if ( ncvars[ncvarid].isvar && ncvars[ncvarid].gridID == UNDEFID )
+	{
+	  int xdimids[2] = {-1,-1}, ydimids[2] = {-1,-1};
+	  int xdimid = -1, ydimid = -1;
+	  int xvarid = -1, yvarid = -1;
+	  int islon = 0, islat = 0;
+	  int nxdims = 0, nydims = 0;
+	  double xinc = 0, yinc = 0;
+
+	  xsize = 0;
+	  ysize = 0;
+          np    = 0;
+
+	  ndims = ncvars[ncvarid].ndims;
+	  for ( i = 0; i < ndims; i++ )
+	    {
+	      if ( ncvars[ncvarid].dimtype[i] == X_AXIS && nxdims < 2 )
+		{
+		  xdimids[nxdims] = ncvars[ncvarid].dimids[i];
+		  nxdims++;
+		}
+	      else if ( ncvars[ncvarid].dimtype[i] == Y_AXIS && nydims < 2 )
+		{
+		  ydimids[nydims] = ncvars[ncvarid].dimids[i];
+		  nydims++;
+		}
+	    }
+
+	  if ( nxdims == 2 )
+	    {
+	      xdimid = xdimids[1];
+	      ydimid = xdimids[0];
+	    }
+	  else if ( nydims == 2 )
+	    {
+	      xdimid = ydimids[1];
+	      ydimid = ydimids[0];
+	    }
+	  else
+	    {
+	      xdimid = xdimids[0];
+	      ydimid = ydimids[0];
+	    }
+
+	  if ( ncvars[ncvarid].xvarid != UNDEFID )
+	    xvarid = ncvars[ncvarid].xvarid;
+	  else if ( xdimid != UNDEFID )
+	    xvarid = ncdims[xdimid].ncvarid;
+
+	  if ( ncvars[ncvarid].yvarid != UNDEFID )
+	    yvarid = ncvars[ncvarid].yvarid;
+	  else if ( ydimid != UNDEFID )
+	    yvarid = ncdims[ydimid].ncvarid;
+
+	  /*
+	  if ( xdimid != UNDEFID )
+	    xvarid = ncdims[xdimid].ncvarid;
+	  if ( xvarid == UNDEFID && ncvars[ncvarid].xvarid != UNDEFID )
+	    xvarid = ncvars[ncvarid].xvarid;
+
+	  if ( ydimid != UNDEFID )
+	    yvarid = ncdims[ydimid].ncvarid;
+	  if ( yvarid == UNDEFID && ncvars[ncvarid].yvarid != UNDEFID )
+	    yvarid = ncvars[ncvarid].yvarid;
+	  */
+
+	  if ( xdimid != UNDEFID ) xsize = ncdims[xdimid].len;
+	  if ( ydimid != UNDEFID ) ysize = ncdims[ydimid].len;
+
+	  if ( ydimid == UNDEFID && yvarid != UNDEFID )
+	    {
+	      if ( ncvars[yvarid].ndims == 1 )
+		{
+		  ydimid = ncvars[yvarid].dimids[0];
+		  ysize  = ncdims[ydimid].len;
+		}
+	    }
+
+	  if ( ncvars[ncvarid].gridtype == UNDEFID || ncvars[ncvarid].gridtype == GRID_GENERIC )
+	    if ( ydimid == xdimid ) ncvars[ncvarid].gridtype = GRID_UNSTRUCTURED;
+
+	  grid_init(&grid);
+	  grid_init(&proj);
+
+	  grid.prec  = DATATYPE_FLT64;
+	  grid.trunc = ncvars[ncvarid].truncation;
+
+	  if ( ncvars[ncvarid].gridtype == GRID_TRAJECTORY )
+	    {
+	      if ( ncvars[ncvarid].xvarid == UNDEFID )
+		Error("Longitude coordinate undefined for %s!", name);
+	      if ( ncvars[ncvarid].yvarid == UNDEFID )
+		Error("Latitude coordinate undefined for %s!", name);
+	    }
+	  else
+	    {
+	      size_t start[3], count[3];
+	      int ltgrid = FALSE;
+
+	      if ( xvarid != UNDEFID && yvarid != UNDEFID )
+		{
+		  if ( ncvars[xvarid].ndims != ncvars[yvarid].ndims )
+		    {
+		      Warning("Inconsistent grid structure for variable %s!",
+			      ncvars[ncvarid].name);
+		      ncvars[ncvarid].xvarid = UNDEFID;
+		      ncvars[ncvarid].yvarid = UNDEFID;
+		      xvarid = UNDEFID;
+		      yvarid = UNDEFID;
+		    }
+
+		  if ( ncvars[xvarid].ndims > 2 || ncvars[yvarid].ndims > 2 )
+		    {
+		      if ( ncvars[xvarid].ndims == 3 && ncvars[xvarid].dimids[0] == timedimid &&
+			   ncvars[yvarid].ndims == 3 && ncvars[yvarid].dimids[0] == timedimid )
+			{
+			  if ( ltwarn )
+			    Warning("Time varying grids unsupported, using grid at time step 1!");
+			  ltgrid = TRUE;
+			  ltwarn = FALSE;
+			  start[0] = start[1] = start[2] = 0;
+			  count[0] = 1; count[1] = ysize; count[2] = xsize;
+			}
+		      else
+			{
+			  Warning("Unsupported grid structure for variable %s (grid dims > 2)!", ncvars[ncvarid].name);
+			  ncvars[ncvarid].xvarid = UNDEFID;
+			  ncvars[ncvarid].yvarid = UNDEFID;
+			  xvarid = UNDEFID;
+			  yvarid = UNDEFID;
+			}
+		    }
+		}
+
+	      if ( xvarid != UNDEFID )
+		{
+		  islon = ncvars[xvarid].islon;
+		  ndims = ncvars[xvarid].ndims;
+		  if ( ndims == 2 || ndims == 3 )
+		    {
+		      ncvars[ncvarid].gridtype = GRID_CURVILINEAR;
+		      size = xsize*ysize;
+		      /* Check size of 2 dimensional coordinate variables */
+		      {
+			int dimid;
+			size_t dimsize1, dimsize2;
+			dimid = ncvars[xvarid].dimids[ndims-2];
+			dimsize1 = ncdims[dimid].len;
+			dimid = ncvars[xvarid].dimids[ndims-1];
+			dimsize2 = ncdims[dimid].len;
+			if ( dimsize1*dimsize2 != size )
+			  {
+			    Warning("Unsupported array structure, skipped variable %s!", ncvars[ncvarid].name);
+			    ncvars[ncvarid].isvar = -1;
+			    continue;
+			  }
+		      }
+		    }
+		  else
+		    {
+		      size = xsize;
+		      /* Check size of 1 dimensional coordinate variables */
+		      {
+			int dimid;
+			size_t dimsize;
+			dimid = ncvars[xvarid].dimids[0];
+			dimsize = ncdims[dimid].len;
+			if ( dimsize != size )
+			  {
+			    Warning("Unsupported array structure, skipped variable %s!", ncvars[ncvarid].name);
+			    ncvars[ncvarid].isvar = -1;
+			    continue;
+			  }
+		      }
+		    }
+
+		  if ( ncvars[xvarid].xtype == NC_FLOAT ) grid.prec = DATATYPE_FLT32;
+		  grid.xvals = (double *) malloc(size*sizeof(double));
+
+		  if ( ltgrid )
+		    cdf_get_vara_double(ncvars[xvarid].ncid, xvarid, start, count, grid.xvals);
+		  else
+		    cdf_get_var_double(ncvars[xvarid].ncid, xvarid, grid.xvals);
+
+                  scale_add(size, grid.xvals, ncvars[xvarid].addoffset, ncvars[xvarid].scalefactor);
+
+		  strcpy(grid.xname, ncvars[xvarid].name);
+		  strcpy(grid.xlongname, ncvars[xvarid].longname);
+		  strcpy(grid.xunits, ncvars[xvarid].units);
+		  /* don't change the name !!! */
+		  /*
+		  if ( (len = strlen(grid.xname)) > 2 )
+		    if ( grid.xname[len-2] == '_' && isdigit((int) grid.xname[len-1]) )
+		      grid.xname[len-2] = 0;
+		  */
+		  if ( islon && xsize > 1 )
+		    {
+		      xinc = fabs(grid.xvals[0] - grid.xvals[1]);
+		      for ( i = 2; i < (int) xsize; i++ )
+			if ( (fabs(grid.xvals[i-1] - grid.xvals[i]) - xinc) > (xinc/1000) ) break;
+
+		      if ( i < (int) xsize ) xinc = 0;
+		    }
+		}
+
+	      if ( yvarid != UNDEFID )
+		{
+		  islat = ncvars[yvarid].islat;
+		  ndims = ncvars[yvarid].ndims;
+		  if ( ndims == 2 || ndims == 3 )
+		    {
+		      ncvars[ncvarid].gridtype = GRID_CURVILINEAR;
+		      size = xsize*ysize;
+		      /* Check size of 2 dimensional coordinate variables */
+		      {
+			int dimid;
+			size_t dimsize1, dimsize2;
+			dimid = ncvars[yvarid].dimids[ndims-2];
+			dimsize1 = ncdims[dimid].len;
+			dimid = ncvars[yvarid].dimids[ndims-1];
+			dimsize2 = ncdims[dimid].len;
+			if ( dimsize1*dimsize2 != size )
+			  {
+			    Warning("Unsupported array structure, skipped variable %s!", ncvars[ncvarid].name);
+			    ncvars[ncvarid].isvar = -1;
+			    continue;
+			  }
+		      }
+		    }
+		  else
+		    {
+		      if ( (int) ysize == 0 ) size = xsize;
+		      else                    size = ysize;
+
+		      /* Check size of 1 dimensional coordinate variables */
+		      {
+			int dimid;
+			size_t dimsize;
+			dimid = ncvars[yvarid].dimids[0];
+			dimsize = ncdims[dimid].len;
+			if ( dimsize != size )
+			  {
+			    Warning("Unsupported array structure, skipped variable %s!", ncvars[ncvarid].name);
+			    ncvars[ncvarid].isvar = -1;
+			    continue;
+			  }
+		      }
+		    }
+
+		  if ( ncvars[yvarid].xtype == NC_FLOAT ) grid.prec = DATATYPE_FLT32;
+		  grid.yvals = (double *) malloc(size*sizeof(double));
+
+		  if ( ltgrid )
+		    cdf_get_vara_double(ncvars[yvarid].ncid, yvarid, start, count, grid.yvals);
+		  else
+		    cdf_get_var_double(ncvars[yvarid].ncid, yvarid, grid.yvals);
+
+                  scale_add(size, grid.yvals, ncvars[yvarid].addoffset, ncvars[yvarid].scalefactor);
+
+		  strcpy(grid.yname, ncvars[yvarid].name);
+		  strcpy(grid.ylongname, ncvars[yvarid].longname);
+		  strcpy(grid.yunits, ncvars[yvarid].units);
+		  /* don't change the name !!! */
+		  /*
+		  if ( (len = strlen(grid.yname)) > 2 )
+		    if ( grid.yname[len-2] == '_' && isdigit((int) grid.yname[len-1]) )
+		      grid.yname[len-2] = 0;
+		  */
+		  if ( islon && (int) ysize > 1 )
+		    {
+		      yinc = fabs(grid.yvals[0] - grid.yvals[1]);
+		      for ( i = 2; i < (int) ysize; i++ )
+			if ( (fabs(grid.yvals[i-1] - grid.yvals[i]) - yinc) > (yinc/1000) ) break;
+
+		      if ( i < (int) ysize ) yinc = 0;
+		    }
+		}
+
+	      if      ( (int) ysize == 0 ) size = xsize;
+	      else if ( (int) xsize == 0 ) size = ysize;
+	      else if ( ncvars[ncvarid].gridtype == GRID_UNSTRUCTURED ) size = xsize; 
+	      else                         size = xsize*ysize;
+	    }
+
+	  if ( ncvars[ncvarid].gridtype == UNDEFID ||
+	       ncvars[ncvarid].gridtype == GRID_GENERIC )
+	    {
+	      if ( islat && islon )
+		{
+		  if ( isGaussGrid(ysize, yinc, grid.yvals) )
+                    {
+                      ncvars[ncvarid].gridtype = GRID_GAUSSIAN;
+                      np = ysize/2;
+                    }
+                  else
+		    ncvars[ncvarid].gridtype = GRID_LONLAT;
+		}
+	      else if ( islat && !islon && xsize == 0 )
+		{
+		  if ( isGaussGrid(ysize, yinc, grid.yvals) )
+                    {
+                      ncvars[ncvarid].gridtype = GRID_GAUSSIAN;
+                      np = ysize/2;
+                    }
+                  else
+		    ncvars[ncvarid].gridtype = GRID_LONLAT;
+		}
+	      else if ( islon && !islat && ysize == 0 )
+		{
+		  ncvars[ncvarid].gridtype = GRID_LONLAT;
+		}
+	      else
+		ncvars[ncvarid].gridtype = GRID_GENERIC;
+	    }
+
+	  switch (ncvars[ncvarid].gridtype)
+	    {
+	    case GRID_GENERIC:
+	    case GRID_LONLAT:
+	    case GRID_GAUSSIAN:
+	    case GRID_UNSTRUCTURED:
+	    case GRID_CURVILINEAR:
+	      {
+		grid.size  = size;
+		grid.xsize = xsize;
+		grid.ysize = ysize;
+                grid.np    = np;
+		if ( xvarid != UNDEFID )
+		  {
+		    grid.xdef  = 1;
+		    if ( ncvars[xvarid].bounds != UNDEFID )
+		      {
+			nbdims = ncvars[ncvars[xvarid].bounds].ndims;
+			if ( nbdims == 2 || nbdims == 3 )
+			  {
+			    nvertex = ncdims[ncvars[ncvars[xvarid].bounds].dimids[nbdims-1]].len;
+			    grid.nvertex = (int) nvertex;
+			    grid.xbounds = (double *) malloc(nvertex*size*sizeof(double));
+			    cdf_get_var_double(ncvars[xvarid].ncid, ncvars[xvarid].bounds, grid.xbounds);
+			  }
+		      }
+		  }
+		if ( yvarid != UNDEFID )
+		  {
+		    grid.ydef  = 1;
+		    if ( ncvars[yvarid].bounds != UNDEFID )
+		      {
+			nbdims = ncvars[ncvars[yvarid].bounds].ndims;
+			if ( nbdims == 2 || nbdims == 3 )
+			  {
+			    nvertex = ncdims[ncvars[ncvars[yvarid].bounds].dimids[nbdims-1]].len;
+			    /*
+			    if ( nvertex != grid.nvertex )
+			      Warning("nvertex problem! nvertex x %d, nvertex y %d",
+				      grid.nvertex, (int) nvertex);
+			    */
+			    grid.ybounds = (double *) malloc(nvertex*size*sizeof(double));
+			    cdf_get_var_double(ncvars[yvarid].ncid, ncvars[yvarid].bounds, grid.ybounds);
+			  }
+		      }
+		  }
+
+		if ( ncvars[ncvarid].cellarea != UNDEFID )
+		  {
+		    grid.area = (double *) malloc(size*sizeof(double));
+		    cdf_get_var_double(ncvars[ncvarid].ncid, ncvars[ncvarid].cellarea, grid.area);
+		  }
+
+		break;
+	      }
+	    case GRID_SPECTRAL:
+	      {
+		grid.size = size;
+		grid.lcomplex = 1;
+		break;
+	      }
+	    case GRID_FOURIER:
+	      {
+		grid.size = size;
+		break;
+	      }
+	    case GRID_TRAJECTORY:
+	      {
+		grid.size = 1;
+		break;
+	      }
+	    }
+
+	  grid.type = ncvars[ncvarid].gridtype;
+
+	  if ( grid.size == 0 )
+	    {
+	      if ( (ncvars[ncvarid].ndims == 1 && ncvars[ncvarid].dimtype[0] == T_AXIS) ||
+		   (ncvars[ncvarid].ndims == 2 && ncvars[ncvarid].dimtype[0] == T_AXIS &&
+		    ncvars[ncvarid].dimtype[1] == Z_AXIS) )
+		{
+		  grid.type  = GRID_GENERIC;
+		  grid.size  = 1;
+		  grid.xsize = 0;
+		  grid.ysize = 0;
+		}
+	      else
+		{
+		  Warning("Variable %s has an unsupported grid, skipped!", ncvars[ncvarid].name);
+		  ncvars[ncvarid].isvar = -1;
+		  continue;
+		}
+	    }
+
+	  if ( ncvars[ncvarid].gmapid >= 0 && ncvars[ncvarid].gridtype != GRID_CURVILINEAR )
+	    {
+	      cdf_inq_varnatts(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, &nvatts);
+
+	      for ( iatt = 0; iatt < nvatts; iatt++ )
+		{
+		  cdf_inq_attname(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, iatt, attname);
+		  cdf_inq_attlen(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, &attlen);
+
+		  if ( strcmp(attname, "grid_mapping_name") == 0 )
+		    {
+		      cdfGetAttText(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, attstringlen-1, attstring);
+		      strtolower(attstring);
+
+		      if ( strcmp(attstring, "rotated_latitude_longitude") == 0 )
+			grid.isRotated = TRUE;
+		      else if ( strcmp(attstring, "sinusoidal") == 0 )
+			grid.type = GRID_SINUSOIDAL;
+		      else if ( strcmp(attstring, "lambert_azimuthal_equal_area") == 0 )
+			grid.type = GRID_LAEA;
+		      else if ( strcmp(attstring, "lambert_conformal_conic") == 0 )
+			grid.type = GRID_LCC2;
+		      else if ( strcmp(attstring, "lambert_cylindrical_equal_area") == 0 )
+			{
+			  proj.type = GRID_PROJECTION;
+			  proj.name = strdup(attstring);
+			}
+		    }
+		  else if ( strcmp(attname, "earth_radius") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &datt);
+		      grid.laea_a = datt;
+		      grid.lcc2_a = datt;
+		    }
+		  else if ( strcmp(attname, "longitude_of_projection_origin") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &grid.laea_lon_0);
+		    }
+		  else if ( strcmp(attname, "longitude_of_central_meridian") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &grid.lcc2_lon_0);
+		    }
+		  else if ( strcmp(attname, "latitude_of_projection_origin") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &datt);
+		      grid.laea_lat_0 = datt;
+		      grid.lcc2_lat_0 = datt;
+		    }
+		  else if ( strcmp(attname, "standard_parallel") == 0 )
+		    {
+		      if ( attlen == 1 )
+			{
+			  cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &datt);
+			  grid.lcc2_lat_1 = datt;
+			  grid.lcc2_lat_2 = datt;
+			}
+		      else
+			{
+			  double datt2[2];
+			  cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 2, datt2);
+			  grid.lcc2_lat_1 = datt2[0];
+			  grid.lcc2_lat_2 = datt2[1];
+			}
+		    }
+		  else if ( strcmp(attname, "grid_north_pole_latitude") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &grid.ypole);
+		    }
+		  else if ( strcmp(attname, "grid_north_pole_longitude") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &grid.xpole);
+		    }
+		  else if ( strcmp(attname, "north_pole_grid_longitude") == 0 )
+		    {
+		      cdfGetAttDouble(ncvars[ncvarid].ncid, ncvars[ncvarid].gmapid, attname, 1, &grid.angle);
+		    }
+		}
+	    }
+
+#if defined (PROJECTION_TEST)
+	  if ( proj.type == GRID_PROJECTION )
+	    {
+	      if ( grid.type == GRID_GENERIC )
+		{
+		  grid.type = GRID_CURVILINEAR;
+		}
+
+	      if ( grid.type == GRID_CURVILINEAR )
+		{
+		  proj.size  = grid.size;
+		  proj.xsize = grid.xsize;
+                  proj.ysize = grid.ysize;
+		}
+
+	      //  grid.proj = gridGenerate(proj);
+	    }
+#endif
+
+	  if ( CDI_Debug )
+	    {
+	      Message("grid: type = %d, size = %d, nx = %d, ny %d",
+		      grid.type, grid.size, grid.xsize, grid.ysize);
+	      Message("proj: type = %d, size = %d, nx = %d, ny %d",
+		      proj.type, proj.size, proj.xsize, proj.ysize);
+	    }
+
+#if defined (PROJECTION_TEST)
+	  if ( proj.type == GRID_PROJECTION )
+	    {
+	      ncvars[ncvarid].gridID = varDefGrid(vlistID, proj, 1);
+	      copy_numeric_projatts(ncvars[ncvarid].gridID, ncvars[ncvarid].gmapid, ncvars[ncvarid].ncid);
+	    }
+	  else
+#endif
+	    ncvars[ncvarid].gridID = varDefGrid(vlistID, grid, 1);
+
+          if ( ncvars[ncvarid].chunked )
+            {
+              ndims = ncvars[ncvarid].ndims;
+
+              if ( grid.type == GRID_UNSTRUCTURED )
+                {
+                  if ( ncvars[ncvarid].chunks[ndims-1] == grid.size )
+                    ncvars[ncvarid].chunktype = CHUNK_GRID;
+                  else
+                    ncvars[ncvarid].chunktype = CHUNK_AUTO;
+                }
+              else
+                {
+                  if ( grid.xsize > 1 && grid.ysize > 1 && ndims > 1 &&
+                       grid.xsize == ncvars[ncvarid].chunks[ndims-1] &&
+                       grid.ysize == ncvars[ncvarid].chunks[ndims-2] ) 
+                    ncvars[ncvarid].chunktype = CHUNK_GRID;
+                  else if ( grid.xsize > 1 && grid.xsize == ncvars[ncvarid].chunks[ndims-1] )
+                    ncvars[ncvarid].chunktype = CHUNK_LINES;
+                  else
+                    ncvars[ncvarid].chunktype = CHUNK_AUTO;
+                }
+            }
+
+	  gridindex = vlistGridIndex(vlistID, ncvars[ncvarid].gridID);
+	  streamptr->xdimID[gridindex] = xdimid;
+	  streamptr->ydimID[gridindex] = ydimid;
+
+	  grid_free(&grid);
+	  grid_free(&proj);
+
+	  if ( CDI_Debug )
+	    Message("gridID %d %d %s", ncvars[ncvarid].gridID, ncvarid, ncvars[ncvarid].name);
+
+	  for ( ncvarid2 = ncvarid+1; ncvarid2 < nvars; ncvarid2++ )
+	    if ( ncvars[ncvarid2].isvar == TRUE && ncvars[ncvarid2].gridID == UNDEFID )
+	      {
+		int xdimid2 = -1, ydimid2 = -1;
+		ndims = ncvars[ncvarid2].ndims;
+		for ( i = 0; i < ndims; i++ )
+		  {
+		    if ( ncvars[ncvarid2].dimtype[i] == X_AXIS )
+		      xdimid2 = ncvars[ncvarid2].dimids[i];
+		    else if ( ncvars[ncvarid2].dimtype[i] == Y_AXIS )
+		      ydimid2 = ncvars[ncvarid2].dimids[i];
+		  }
+
+		if ( xdimid == xdimid2 &&
+		    (ydimid == ydimid2 || (xdimid == ydimid && ydimid2 == UNDEFID)) )
+		  {
+		    int same_grid = TRUE;
+                    /*
+		    if ( xvarid != -1 && ncvars[ncvarid2].xvarid != UNDEFID &&
+			 xvarid != ncvars[ncvarid2].xvarid ) same_grid = FALSE;
+
+		    if ( yvarid != -1 && ncvars[ncvarid2].yvarid != UNDEFID &&
+			 yvarid != ncvars[ncvarid2].yvarid ) same_grid = FALSE;
+                    */
+		    if ( ncvars[ncvarid].xvarid != ncvars[ncvarid2].xvarid ) same_grid = FALSE;
+		    if ( ncvars[ncvarid].yvarid != ncvars[ncvarid2].yvarid ) same_grid = FALSE;
+
+		    if ( same_grid )
+		      {
+			if ( CDI_Debug )
+			  Message("Same gridID %d %d %s",
+				  ncvars[ncvarid].gridID, ncvarid2, ncvars[ncvarid2].name);
+			ncvars[ncvarid2].gridID = ncvars[ncvarid].gridID;
+			ncvars[ncvarid2].chunktype = ncvars[ncvarid].chunktype;
+		      }
+		  }
+	      }
+	}
+    }
+}
+
+/* define all input zaxes */
+static
+void define_all_zaxes(stream_t *streamptr, int vlistID, ncdim_t *ncdims, int nvars, ncvar_t *ncvars,
+		      size_t vctsize, double *vct)
+{
+  int ncvarid, ncvarid2;
+  int i, ilev, ndims;
+  int zaxisindex;
+  int zprec;
+  int nbdims, nvertex, nlevel;
+  char *pname, *plongname, *punits;
+
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( ncvars[ncvarid].isvar == TRUE && ncvars[ncvarid].zaxisID == UNDEFID )
+	{
+	  int with_bounds = FALSE;
+	  int zdimid = UNDEFID;
+	  int zvarid = UNDEFID;
+	  int zsize = 1;
+	  double *zvar = NULL;
+	  double *lbounds = NULL;
+	  double *ubounds = NULL;
+	  int zaxisType;
+
+	  ndims = ncvars[ncvarid].ndims;
+	  for ( i = 0; i < ndims; i++ )
+	    {
+	      if ( ncvars[ncvarid].dimtype[i] == Z_AXIS )
+		zdimid = ncvars[ncvarid].dimids[i];
+	    }
+
+	  if ( zdimid != UNDEFID )
+	    {
+	      zvarid = ncdims[zdimid].ncvarid;
+	      zsize  = ncdims[zdimid].len;
+	    }
+
+	  if ( CDI_Debug ) Message("nlevs = %d", zsize);
+
+	  zvar = (double *) malloc(zsize*sizeof(double));
+
+	  zaxisType = UNDEFID;
+
+	  if ( zvarid != UNDEFID ) zaxisType = ncvars[zvarid].zaxistype;
+
+	  if ( zaxisType == UNDEFID )  zaxisType = ZAXIS_GENERIC;
+
+	  zprec = DATATYPE_FLT64;
+
+	  if ( zvarid != UNDEFID )
+	    {
+	      pname     = ncvars[zvarid].name;
+	      plongname = ncvars[zvarid].longname;
+	      punits    = ncvars[zvarid].units;
+	      if ( ncvars[zvarid].xtype == NC_FLOAT ) zprec = DATATYPE_FLT32;
+	      /* don't change the name !!! */
+	      /*
+	      if ( (len = strlen(pname)) > 2 )
+		if ( pname[len-2] == '_' && isdigit((int) pname[len-1]) )
+		  pname[len-2] = 0;
+	      */
+	      cdf_get_var_double(ncvars[zvarid].ncid, zvarid, zvar);
+
+	      if ( ncvars[zvarid].bounds != UNDEFID )
+		{
+		  nbdims = ncvars[ncvars[zvarid].bounds].ndims;
+		  if ( nbdims == 2 )
+		    {
+		      nlevel  = ncdims[ncvars[ncvars[zvarid].bounds].dimids[0]].len;
+		      nvertex = ncdims[ncvars[ncvars[zvarid].bounds].dimids[1]].len;
+		      if ( nlevel == zsize && nvertex == 2 )
+			{
+			  double *zbounds;
+			  with_bounds = TRUE;
+			  zbounds = (double *) malloc(2*nlevel*sizeof(double));
+			  lbounds = (double *) malloc(nlevel*sizeof(double));
+			  ubounds = (double *) malloc(nlevel*sizeof(double));
+			  cdf_get_var_double(ncvars[zvarid].ncid, ncvars[zvarid].bounds, zbounds);
+			  for ( i = 0; i < nlevel; ++i )
+			    {
+			      lbounds[i] = zbounds[i*2];
+			      ubounds[i] = zbounds[i*2+1];
+			    }
+			  free(zbounds);
+			}
+		    }
+		}
+	    }
+	  else
+	    {
+	      pname     = NULL;
+	      plongname = NULL;
+	      punits    = NULL;
+
+	      if ( zsize == 1 )
+		{
+                  if ( ncvars[ncvarid].zaxistype != UNDEFID )
+                    zaxisType = ncvars[ncvarid].zaxistype;
+                  else
+                    zaxisType = ZAXIS_SURFACE;
+
+		  zvar[0] = 0;
+		  /*
+		  if ( zdimid == UNDEFID )
+		    zvar[0] = 9999;
+		  else
+		    zvar[0] = 0;
+		  */
+		}
+	      else
+		{
+		  for ( ilev = 0; ilev < (int)zsize; ilev++ ) zvar[ilev] = ilev + 1;
+		}
+	    }
+
+      	  ncvars[ncvarid].zaxisID = varDefZaxis(vlistID, zaxisType, (int) zsize, zvar, with_bounds, lbounds, ubounds,
+						vctsize, vct, pname, plongname, punits, zprec, 1, 0);
+	  free(zvar);
+	  free(lbounds);
+	  free(ubounds);
+
+	  zaxisindex = vlistZaxisIndex(vlistID, ncvars[ncvarid].zaxisID);
+	  streamptr->zaxisID[zaxisindex]  = zdimid;
+
+	  if ( CDI_Debug )
+	    Message("zaxisID %d %d %s", ncvars[ncvarid].zaxisID, ncvarid, ncvars[ncvarid].name);
+
+	  for ( ncvarid2 = ncvarid+1; ncvarid2 < nvars; ncvarid2++ )
+	    if ( ncvars[ncvarid2].isvar == TRUE && ncvars[ncvarid2].zaxisID == UNDEFID )
+	      {
+		int zdimid2 = -1;
+		ndims = ncvars[ncvarid2].ndims;
+		for ( i = 0; i < ndims; i++ )
+		  {
+		    if ( ncvars[ncvarid2].dimtype[i] == Z_AXIS )
+		      zdimid2 = ncvars[ncvarid2].dimids[i];
+		  }
+		if ( zdimid == zdimid2 )
+		  {
+		    if ( CDI_Debug )
+		      Message("zaxisID %d %d %s",
+			      ncvars[ncvarid].zaxisID, ncvarid2, ncvars[ncvarid2].name);
+		    ncvars[ncvarid2].zaxisID = ncvars[ncvarid].zaxisID;
+		  }
+	      }
+	}
+    }
+}
+
+/* define all input data variables */
+static
+void define_all_vars(int streamID, int vlistID, int instID, int modelID, int *varids, int nvars, ncvar_t *ncvars)
+{
+  int ncid;
+  int varID1, varID, ncvarid;
+  int code;
+  int tableID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( streamptr->sortname )
+    {
+      int index;
+      varinfo_t **varInfo;
+      varInfo    = (varinfo_t **) malloc(nvars*sizeof(varinfo_t *));
+      varInfo[0] = (varinfo_t *)  malloc(nvars*sizeof(varinfo_t));
+
+      for ( index = 1; index < nvars; index++ )
+	varInfo[index] = varInfo[0] + index;
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  ncvarid = varids[varID];
+	  varInfo[varID]->ncvarid = ncvarid;
+	  strcpy(varInfo[varID]->name, ncvars[ncvarid].name);
+	}
+      qsort(varInfo[0], nvars, sizeof(varinfo_t), cmpvarname);
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  varids[varID] = varInfo[varID]->ncvarid;
+	}
+      free(varInfo[0]);
+      free(varInfo);
+    }
+
+  for ( varID1 = 0; varID1 < nvars; varID1++ )
+    {
+      int gridID, zaxisID;
+
+      ncvarid = varids[varID1];
+      gridID  = ncvars[ncvarid].gridID;
+      zaxisID = ncvars[ncvarid].zaxisID;
+
+      varID = streamNewVar(streamID, gridID, zaxisID);
+      varID = vlistDefVar(vlistID, gridID, zaxisID, ncvars[ncvarid].tsteptype);
+
+#if  defined  (HAVE_NETCDF4)
+      if ( ncvars[ncvarid].deflate )
+	vlistDefVarCompType(vlistID, varID, COMPRESS_ZIP);
+
+      if ( ncvars[ncvarid].chunked && ncvars[ncvarid].chunktype != UNDEFID )
+        vlistDefVarChunkType(vlistID, varID, ncvars[ncvarid].chunktype);
+#endif
+
+      streamptr->vars[varID1].level   = NULL;
+      streamptr->vars[varID1].defmiss = 0;
+      streamptr->vars[varID1].nlevs   = zaxisInqSize(ncvars[ncvarid].zaxisID);
+      streamptr->vars[varID1].ncvarid = ncvarid;
+
+      vlistDefVarName(vlistID, varID, ncvars[ncvarid].name);
+      if ( ncvars[ncvarid].param != UNDEFID ) vlistDefVarParam(vlistID, varID, ncvars[ncvarid].param);
+      if ( ncvars[ncvarid].code != UNDEFID )  vlistDefVarCode(vlistID, varID, ncvars[ncvarid].code);
+      if ( ncvars[ncvarid].code != UNDEFID )
+	{
+	  int param;
+	  param = cdiEncodeParam(ncvars[ncvarid].code, ncvars[ncvarid].tabnum, 255);
+	  vlistDefVarParam(vlistID, varID, param);
+	}
+      if ( ncvars[ncvarid].longname[0] )      vlistDefVarLongname(vlistID, varID, ncvars[ncvarid].longname);
+      if ( ncvars[ncvarid].stdname[0] )       vlistDefVarStdname(vlistID, varID, ncvars[ncvarid].stdname);
+      if ( ncvars[ncvarid].units[0] )         vlistDefVarUnits(vlistID, varID, ncvars[ncvarid].units);
+
+      if ( ncvars[ncvarid].lvalidrange )
+        vlistDefVarValidrange(vlistID, varID, ncvars[ncvarid].validrange);
+
+      if ( IS_NOT_EQUAL(ncvars[ncvarid].addoffset, 0) )
+	vlistDefVarAddoffset(vlistID, varID, ncvars[ncvarid].addoffset);
+      if ( IS_NOT_EQUAL(ncvars[ncvarid].scalefactor, 1) )
+	vlistDefVarScalefactor(vlistID, varID, ncvars[ncvarid].scalefactor);
+
+      vlistDefVarDatatype(vlistID, varID, cdfInqDatatype(ncvars[ncvarid].xtype, ncvars[ncvarid].lunsigned));
+
+      vlistDefVarInstitut(vlistID, varID, instID);
+      vlistDefVarModel(vlistID, varID, modelID);
+      if ( ncvars[ncvarid].tableID != UNDEFID )
+	vlistDefVarTable(vlistID, varID, ncvars[ncvarid].tableID);
+
+      if ( ncvars[ncvarid].defmiss == TRUE ) vlistDefVarMissval(vlistID, varID, ncvars[ncvarid].missval);
+
+      if ( CDI_Debug )
+	Message("varID = %d  gridID = %d  zaxisID = %d", varID,
+		vlistInqVarGrid(vlistID, varID), vlistInqVarZaxis(vlistID, varID));
+
+      int gridindex = vlistGridIndex(vlistID, gridID);
+      int xdimid = streamptr->xdimID[gridindex];
+      int ydimid = streamptr->ydimID[gridindex];
+
+      int zaxisindex = vlistZaxisIndex(vlistID, zaxisID);
+      int zdimid = streamptr->zaxisID[zaxisindex];
+
+      int ndims = ncvars[ncvarid].ndims;
+      int iodim = 0;
+      int ixyz = 0;
+      int ipow10[4] = {1, 10, 100, 1000};
+
+      if ( ncvars[ncvarid].tsteptype != TSTEP_CONSTANT ) iodim++;
+
+      if ( gridInqType(gridID) == GRID_UNSTRUCTURED && ndims-iodim <= 2 && ydimid == xdimid )
+        {
+          if ( xdimid == ncvars[ncvarid].dimids[ndims-1] )
+            {
+              ixyz = 321;
+            }
+          else
+            {
+              ixyz = 213;
+            }
+        }
+      else
+        {
+          for ( int idim = iodim; idim < ndims; idim++ )
+            {
+              if      ( xdimid == ncvars[ncvarid].dimids[idim] )
+                ixyz += 1*ipow10[ndims-idim-1];
+              else if ( ydimid == ncvars[ncvarid].dimids[idim] )
+                ixyz += 2*ipow10[ndims-idim-1];
+              else if ( zdimid == ncvars[ncvarid].dimids[idim] )
+                ixyz += 3*ipow10[ndims-idim-1];
+            }
+        }
+
+      vlistDefVarXYZ(vlistID, varID, ixyz);
+      /*
+      printf("ixyz %d\n", ixyz);
+      printf("ndims %d\n", ncvars[ncvarid].ndims);
+      for ( int i = 0; i < ncvars[ncvarid].ndims; ++i )
+        printf("dimids: %d %d\n", i, ncvars[ncvarid].dimids[i]);
+      printf("xdimid, ydimid %d %d\n", xdimid, ydimid);
+      */
+      if ( ncvars[ncvarid].ensdata != NULL )
+        {
+          vlistDefVarEnsemble( vlistID, varID, ncvars[ncvarid].ensdata->ens_index,
+                               ncvars[ncvarid].ensdata->ens_count,
+                               ncvars[ncvarid].ensdata->forecast_init_type );
+          free(ncvars[ncvarid].ensdata);
+          ncvars[ncvarid].ensdata = NULL;
+        }
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      ncvarid = varids[varID];
+      ncid = ncvars[ncvarid].ncid;
+
+      if ( ncvars[ncvarid].natts )
+	{
+	  int nvatts;
+	  int attnum;
+	  int iatt;
+	  nc_type attrtype;
+	  size_t attlen;
+	  char attname[CDI_MAX_NAME];
+	  const int attstringlen = 8192; char attstring[8192];
+
+	  nvatts = ncvars[ncvarid].natts;
+	  for ( iatt = 0; iatt < nvatts; iatt++ )
+	    {
+	      attnum = ncvars[ncvarid].atts[iatt];
+	      cdf_inq_attname(ncid, ncvarid, attnum, attname);
+	      cdf_inq_attlen(ncid, ncvarid, attname, &attlen);
+	      cdf_inq_atttype(ncid, ncvarid, attname, &attrtype);
+	      if ( attrtype == NC_SHORT || attrtype == NC_INT )
+		{
+		  int *attint;
+		  attint = (int *) malloc(attlen*sizeof(int));
+		  cdfGetAttInt(ncid, ncvarid, attname, attlen, attint);
+		  if ( attrtype == NC_SHORT )
+		    vlistDefAttInt(vlistID, varID, attname, DATATYPE_INT16, (int)attlen, attint);
+		  else
+		    vlistDefAttInt(vlistID, varID, attname, DATATYPE_INT32, (int)attlen, attint);
+		  if ( CDI_Debug )
+		    printf("int: %s.%s = %d\n", ncvars[ncvarid].name, attname, attint[0]);
+		  free(attint);
+		}
+	      else if ( attrtype == NC_FLOAT || attrtype == NC_DOUBLE )
+		{
+		  double *attflt;
+		  attflt = (double *) malloc(attlen*sizeof(double));
+		  cdfGetAttDouble(ncid, ncvarid, attname, attlen, attflt);
+		  if ( attrtype == NC_FLOAT )
+		    vlistDefAttFlt(vlistID, varID, attname, DATATYPE_FLT32, (int)attlen, attflt);
+		  else
+		    vlistDefAttFlt(vlistID, varID, attname, DATATYPE_FLT64, (int)attlen, attflt);
+		  if ( CDI_Debug )
+		    printf("flt: %s.%s = %g\n", ncvars[ncvarid].name, attname, attflt[0]);
+		  free(attflt);
+		}
+	      else if ( attrtype == NC_CHAR )
+		{
+		  cdfGetAttText(ncid, ncvarid, attname, attstringlen-1, attstring);
+		  vlistDefAttTxt(vlistID, varID, attname, (int)attlen, attstring);
+		  if ( CDI_Debug )
+		    printf("txt: %s.%s = %s\n", ncvars[ncvarid].name, attname, attstring);
+		}
+	      else
+		{
+		  if ( CDI_Debug )
+		    printf("att: %s.%s = unknown\n", ncvars[ncvarid].name, attname);
+		}
+	    }
+
+	  free(ncvars[ncvarid].atts);
+	}
+    }
+
+  if ( varids ) free(varids);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( vlistInqVarCode(vlistID, varID) == -varID-1 )
+	{
+	  const char *pname = vlistInqVarNamePtr(vlistID, varID);
+	  size_t len = strlen(pname);
+	  if ( len > 3 && isdigit((int) pname[3]) )
+	    {
+	      if ( memcmp("var", pname, 3) == 0 )
+		{
+		  vlistDefVarCode(vlistID, varID, atoi(pname+3));
+		  vlistDestroyVarName(vlistID, varID);
+		}
+	    }
+	  else if ( len > 4 && isdigit((int) pname[4]) )
+	    {
+	      if ( memcmp("code", pname, 4) == 0 )
+		{
+		  vlistDefVarCode(vlistID, varID, atoi(pname+4));
+		  vlistDestroyVarName(vlistID, varID);
+		}
+	    }
+	  else if ( len > 5 && isdigit((int) pname[5]) )
+	    {
+	      if ( memcmp("param", pname, 5) == 0 )
+		{
+		  int pnum = -1, pcat = 255, pdis = 255;
+		  sscanf(pname+5, "%d.%d.%d", &pnum, &pcat, &pdis);
+		  vlistDefVarParam(vlistID, varID, cdiEncodeParam(pnum, pcat, pdis));
+		  vlistDestroyVarName(vlistID, varID);
+		}
+	    }
+	}
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      instID  = vlistInqVarInstitut(vlistID, varID);
+      modelID = vlistInqVarModel(vlistID, varID);
+      tableID = vlistInqVarTable(vlistID, varID);
+      code    = vlistInqVarCode(vlistID, varID);
+      if ( cdiDefaultTableID != UNDEFID )
+	{
+	  if ( tableInqParNamePtr(cdiDefaultTableID, code) )
+	    {
+	      vlistDestroyVarName(vlistID, varID);
+	      vlistDestroyVarLongname(vlistID, varID);
+	      vlistDestroyVarUnits(vlistID, varID);
+
+	      if ( tableID != UNDEFID )
+		{
+		  vlistDefVarName(vlistID, varID, tableInqParNamePtr(cdiDefaultTableID, code));
+		  if ( tableInqParLongnamePtr(cdiDefaultTableID, code) )
+		    vlistDefVarLongname(vlistID, varID, tableInqParLongnamePtr(cdiDefaultTableID, code));
+		  if ( tableInqParUnitsPtr(cdiDefaultTableID, code) )
+		    vlistDefVarUnits(vlistID, varID, tableInqParUnitsPtr(cdiDefaultTableID, code));
+		}
+	      else
+		{
+		  tableID = cdiDefaultTableID;
+		}
+	    }
+	  if ( cdiDefaultModelID != UNDEFID )
+	    modelID = cdiDefaultModelID;
+	  if ( cdiDefaultInstID != UNDEFID )
+	    instID = cdiDefaultInstID;
+	}
+      if ( instID  != UNDEFID ) vlistDefVarInstitut(vlistID, varID, instID);
+      if ( modelID != UNDEFID ) vlistDefVarModel(vlistID, varID, modelID);
+      if ( tableID != UNDEFID ) vlistDefVarTable(vlistID, varID, tableID);
+    }
+}
+
+static
+void read_global_attributtes(int fileID, int vlistID, stream_t *streamptr, int ngatts,
+                               int *instID, int *modelID, int *ucla_les)
+{
+  nc_type xtype;
+  size_t attlen;
+  char attname[CDI_MAX_NAME];
+  const int attstringlen = 8192; char attstring[8192];
+  int iatt;
+
+  for ( iatt = 0; iatt < ngatts; iatt++ )
+    {
+      cdf_inq_attname(fileID, NC_GLOBAL, iatt, attname);
+      cdf_inq_atttype(fileID, NC_GLOBAL, attname, &xtype);
+      cdf_inq_attlen(fileID, NC_GLOBAL, attname, &attlen);
+
+      if ( xtype == NC_CHAR )
+	{
+	  cdfGetAttText(fileID, NC_GLOBAL, attname, attstringlen-1, attstring);
+
+	  if ( attlen > 0 && attstring[0] != 0 )
+	    {
+	      if ( strcmp(attname, "history") == 0 )
+		{
+		  streamptr->historyID = iatt;
+		}
+	      else if ( strcmp(attname, "institution") == 0 )
+		{
+		  *instID = institutInq(0, 0, NULL, attstring);
+		  if ( *instID == UNDEFID )
+		    *instID = institutDef(0, 0, NULL, attstring);
+		}
+	      else if ( strcmp(attname, "source") == 0 )
+		{
+		  *modelID = modelInq(-1, 0, attstring);
+		}
+	      else if ( strcmp(attname, "Source") == 0 )
+		{
+		  if ( strncmp(attstring, "UCLA-LES", 8) == 0 )
+		    *ucla_les = TRUE;
+		}
+	      /*
+	      else if ( strcmp(attname, "Conventions") == 0 )
+		{
+		}
+	      */
+	      else if ( strcmp(attname, "CDI") == 0 )
+		{
+		}
+	      else if ( strcmp(attname, "CDO") == 0 )
+		{
+		}
+	      else
+		{
+		  vlistDefAttTxt(vlistID, CDI_GLOBAL, attname, (int)attlen, attstring);
+		}
+	    }
+	}
+      else if ( xtype == NC_SHORT || xtype == NC_INT )
+	{
+	  int *attint;
+	  attint = (int *) malloc(attlen*sizeof(int));
+	  cdfGetAttInt(fileID, NC_GLOBAL, attname, attlen, attint);
+	  if ( xtype == NC_SHORT )
+	    vlistDefAttInt(vlistID, CDI_GLOBAL, attname, DATATYPE_INT16, (int)attlen, attint);
+	  else
+	    vlistDefAttInt(vlistID, CDI_GLOBAL, attname, DATATYPE_INT32, (int)attlen, attint);
+	  free(attint);
+	}
+      else if ( xtype == NC_FLOAT || xtype == NC_DOUBLE )
+	{
+	  double *attflt;
+	  attflt = (double *) malloc(attlen*sizeof(double));
+	  cdfGetAttDouble(fileID, NC_GLOBAL, attname, attlen, attflt);
+	  if ( xtype == NC_FLOAT )
+	    vlistDefAttFlt(vlistID, CDI_GLOBAL, attname, DATATYPE_FLT32, (int)attlen, attflt);
+	  else
+	    vlistDefAttFlt(vlistID, CDI_GLOBAL, attname, DATATYPE_FLT64, (int)attlen, attflt);
+	  free(attflt);
+	}
+    }
+}
+#endif
+
+int cdfInqContents(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int ndims, nvars, ngatts, unlimdimid;
+  int ncvarid;
+  int ncdimid;
+  int fileID;
+  size_t ntsteps;
+  int timedimid = -1;
+  int *varids;
+  int nvarids;
+  const int attstringlen = 8192; char attstring[8192];
+  int timehasunits = FALSE;
+  int time_has_bounds = FALSE;
+  size_t len;
+  int nvars_data;
+  int nvcth_id = UNDEFID, vcta_id = UNDEFID, vctb_id = UNDEFID;
+  size_t vctsize = 0;
+  double *vct = NULL;
+  int instID  = UNDEFID;
+  int modelID = UNDEFID;
+  int taxisID;
+  int i;
+  int nbdims;
+  int calendar = UNDEFID;
+  ncdim_t *ncdims;
+  ncvar_t *ncvars = NULL;
+  int vlistID;
+  stream_t *streamptr;
+  int format = 0;
+  int ucla_les = FALSE;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d, fileID = %d", streamID, fileID);
+
+#if  defined  (HAVE_NETCDF4)
+  nc_inq_format(fileID, &format);
+#endif
+
+  cdf_inq(fileID, &ndims , &nvars, &ngatts, &unlimdimid);
+
+  if ( CDI_Debug )
+    Message("root: ndims %d, nvars %d, ngatts %d", ndims, nvars, ngatts);
+
+  if ( ndims == 0 )
+    {
+      Warning("ndims = %d", ndims);
+      return (CDI_EUFSTRUCT);
+    }
+
+  /* alloc ncdims */
+  ncdims = (ncdim_t *) malloc(ndims*sizeof(ncdim_t));
+  init_ncdims(ndims, ncdims);
+
+  if ( nvars > 0 )
+    {
+      /* alloc ncvars */
+      ncvars = (ncvar_t *) malloc(nvars*sizeof(ncvar_t));
+      init_ncvars(nvars, ncvars);
+
+      for ( ncvarid = 0; ncvarid < nvars; ++ncvarid )
+        ncvars[ncvarid].ncid = fileID;
+    }
+
+#if  defined  (TEST_GROUPS)
+#if  defined  (HAVE_NETCDF4)
+  if ( format == NC_FORMAT_NETCDF4 )
+    {
+      int ncid;
+      int numgrps;
+      int ncids[NC_MAX_VARS];
+      char name1[CDI_MAX_NAME];
+      int gndims, gnvars, gngatts, gunlimdimid;
+      nc_inq_grps(fileID, &numgrps, ncids);
+      for ( int i = 0; i < numgrps; ++i )
+        {
+          ncid = ncids[i];
+          nc_inq_grpname (ncid, name1);
+          cdf_inq(ncid, &gndims , &gnvars, &gngatts, &gunlimdimid);
+
+          if ( CDI_Debug )
+            Message("%s: ndims %d, nvars %d, ngatts %d", name1, gndims, gnvars, gngatts);
+
+          if ( gndims == 0 )
+            {
+            }
+        }
+    }
+#endif
+#endif
+
+  if ( nvars == 0 )
+    {
+      Warning("nvars = %d", nvars);
+      return (CDI_EUFSTRUCT);
+    }
+
+  /* read global attributtes */
+  read_global_attributtes(fileID, vlistID, streamptr, ngatts, &instID, &modelID, &ucla_les);
+
+  /* find time dim */
+  if ( unlimdimid >= 0 )
+    timedimid = unlimdimid;
+  else
+    timedimid = cdfTimeDimID(fileID, ndims, nvars);
+
+  streamptr->basetime.ncdimid = timedimid;
+
+  if ( timedimid != UNDEFID )
+    cdf_inq_dimlen(fileID, timedimid, &ntsteps);
+  else
+    ntsteps = 0;
+
+  if ( CDI_Debug ) Message("Number of timesteps = %d", ntsteps);
+  if ( CDI_Debug ) Message("Time dimid = %d", streamptr->basetime.ncdimid);
+
+  /* read ncdims */
+  for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+    {
+      cdf_inq_dimlen(fileID, ncdimid, &ncdims[ncdimid].len);
+      cdf_inq_dimname(fileID, ncdimid, ncdims[ncdimid].name);
+      if ( timedimid == ncdimid )
+	ncdims[ncdimid].dimtype = T_AXIS;
+    }
+
+  if ( CDI_Debug ) printNCvars(ncvars, nvars, "cdfScanVarAttributes");
+
+  /* scan attributes of all variables */
+  cdfScanVarAttributes(nvars, ncvars, ncdims, timedimid, modelID, format);
+
+
+  if ( CDI_Debug ) printNCvars(ncvars, nvars, "find coordinate vars");
+
+  /* find coordinate vars */
+  for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+    {
+      for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+	{
+	  if ( ncvars[ncvarid].ndims == 1 )
+	    {
+	      if ( timedimid != UNDEFID && timedimid == ncvars[ncvarid].dimids[0] )
+		{
+		  if ( ncvars[ncvarid].isvar != FALSE ) cdfSetVar(ncvars, ncvarid, TRUE);
+		}
+	      else
+		{
+                  //  if ( ncvars[ncvarid].isvar != TRUE ) cdfSetVar(ncvars, ncvarid, FALSE);
+		}
+	      // if ( ncvars[ncvarid].isvar != TRUE ) cdfSetVar(ncvars, ncvarid, FALSE);
+
+	      if ( ncdimid == ncvars[ncvarid].dimids[0] && ncdims[ncdimid].ncvarid == UNDEFID )
+		if ( strcmp(ncvars[ncvarid].name, ncdims[ncdimid].name) == 0 )
+		  {
+		    ncdims[ncdimid].ncvarid = ncvarid;
+		    ncvars[ncvarid].isvar = FALSE;
+		  }
+	    }
+	}
+    }
+
+  /* find time vars */
+  if ( timedimid != UNDEFID )
+    {
+      int ltimevar = FALSE;
+
+      if ( ncdims[timedimid].ncvarid != UNDEFID )
+	{
+	  streamptr->basetime.ncvarid = ncdims[timedimid].ncvarid;
+	  ltimevar = TRUE;
+	}
+
+      for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+	if ( ncvarid != streamptr->basetime.ncvarid &&
+	     ncvars[ncvarid].ndims == 1 &&
+	     timedimid == ncvars[ncvarid].dimids[0] &&
+	     ncvars[ncvarid].xtype != NC_CHAR &&
+	     isTimeUnits(ncvars[ncvarid].units) )
+	  {
+	    ncvars[ncvarid].isvar = FALSE;
+
+	    if ( !ltimevar )
+	      {
+		streamptr->basetime.ncvarid = ncvarid;
+		ltimevar = TRUE;
+		if ( CDI_Debug ) 
+		  fprintf(stderr, "timevar %s\n", ncvars[ncvarid].name);
+	      }
+	    else
+	      {
+		if ( CDI_Debug )
+		  fprintf(stderr, "skip timevar %s\n", ncvars[ncvarid].name);
+	      }
+	  }
+
+      if ( ltimevar == FALSE ) /* search for WRF time description */
+	{
+	  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+	    if ( ncvarid != streamptr->basetime.ncvarid &&
+		 ncvars[ncvarid].ndims == 2 &&
+		 timedimid == ncvars[ncvarid].dimids[0] &&
+		 ncvars[ncvarid].xtype == NC_CHAR &&
+		 ncdims[ncvars[ncvarid].dimids[1]].len == 19 )
+	      {
+		streamptr->basetime.ncvarid = ncvarid;
+		streamptr->basetime.lwrf    = TRUE;
+		break;
+	      }
+	}
+
+      /* time varID */
+      ncvarid = streamptr->basetime.ncvarid;
+
+      if ( ncvarid == UNDEFID )
+	Warning("Variable >time< not found!");
+      else if ( streamptr->basetime.lwrf == FALSE )
+	{
+	  if ( ncvars[ncvarid].units[0] != 0 )
+	    timehasunits = TRUE;
+
+	  if ( ncvars[ncvarid].bounds != UNDEFID )
+	    {
+	      nbdims = ncvars[ncvars[ncvarid].bounds].ndims;
+	      if ( nbdims == 2 )
+		{
+		  len = ncdims[ncvars[ncvars[ncvarid].bounds].dimids[nbdims-1]].len;
+		  if ( (int)len == 2 && timedimid == ncvars[ncvars[ncvarid].bounds].dimids[0] )
+		    {
+		      time_has_bounds = TRUE;
+		      streamptr->basetime.ncvarboundsid = ncvars[ncvarid].bounds;
+		    }
+		}
+	    }
+	}
+    }
+
+  /* check ncvars */
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( timedimid != UNDEFID )
+	if ( ncvars[ncvarid].isvar == -1 &&
+	     ncvars[ncvarid].ndims > 1   &&
+	     timedimid == ncvars[ncvarid].dimids[0] )
+	  cdfSetVar(ncvars, ncvarid, TRUE);
+
+      if ( ncvars[ncvarid].isvar == -1 && ncvars[ncvarid].ndims == 0 )
+	cdfSetVar(ncvars, ncvarid, FALSE);
+
+      //if ( ncvars[ncvarid].isvar == -1 && ncvars[ncvarid].ndims > 1 )
+      if ( ncvars[ncvarid].isvar == -1 && ncvars[ncvarid].ndims >= 1 )
+	cdfSetVar(ncvars, ncvarid, TRUE);
+
+      if ( ncvars[ncvarid].isvar == -1 )
+	{
+	  ncvars[ncvarid].isvar = 0;
+	  Warning("Variable %s has an unknown type, skipped!", ncvars[ncvarid].name);
+	  continue;
+	}
+
+      if ( ncvars[ncvarid].ndims > 4 )
+	{
+	  ncvars[ncvarid].isvar = 0;
+	  Warning("%d dimensional variables unsupported, skipped variable %s!",
+		ncvars[ncvarid].ndims, ncvars[ncvarid].name);
+	  continue;
+	}
+
+      if ( ncvars[ncvarid].xtype == NC_CHAR )
+	{
+	  ncvars[ncvarid].isvar = 0;
+	  continue;
+	}
+
+      if ( cdfInqDatatype(ncvars[ncvarid].xtype, ncvars[ncvarid].lunsigned) == -1 )
+	{
+	  ncvars[ncvarid].isvar = 0;
+	  Warning("Variable %s has an unsupported data type, skipped!", ncvars[ncvarid].name);
+	  continue;
+	}
+
+      if ( timedimid != UNDEFID && ntsteps == 0 && ncvars[ncvarid].ndims > 0 )
+	{
+	  if ( timedimid == ncvars[ncvarid].dimids[0] )
+	    {
+	      ncvars[ncvarid].isvar = 0;
+	      Warning("Number of time steps undefined, skipped variable %s!", ncvars[ncvarid].name);
+	      continue;
+	    }
+	}
+    }
+
+
+  /* verify coordinate vars - first scan (dimname == varname) */
+  verify_coordinate_vars_1(ndims, ncdims, ncvars, timedimid);
+
+  /* verify coordinate vars - second scan (all other variables) */
+  verify_coordinate_vars_2(nvars, ncvars);
+
+  if ( CDI_Debug ) printNCvars(ncvars, nvars, "verify_coordinate_vars");
+
+  if ( ucla_les == TRUE )
+    {
+      for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+	{
+	  ncvarid = ncdims[ncdimid].ncvarid;
+	  if ( ncvarid != -1 )
+	    {
+	      if ( ncdims[ncdimid].dimtype == UNDEFID && ncvars[ncvarid].units[0] == 'm' )
+		{
+		  if      ( ncvars[ncvarid].name[0] == 'x' ) ncdims[ncdimid].dimtype = X_AXIS;
+		  else if ( ncvars[ncvarid].name[0] == 'y' ) ncdims[ncdimid].dimtype = Y_AXIS;
+		  else if ( ncvars[ncvarid].name[0] == 'z' ) ncdims[ncdimid].dimtype = Z_AXIS;
+		}
+	    }
+	}
+    }
+  /*
+  for ( ncdimid = 0; ncdimid < ndims; ncdimid++ )
+    {
+      ncvarid = ncdims[ncdimid].ncvarid;
+      if ( ncvarid != -1 )
+	{
+	  printf("coord var %d %s %s\n", ncvarid, ncvars[ncvarid].name, ncvars[ncvarid].units);
+	  if ( ncdims[ncdimid].dimtype == X_AXIS )
+	    printf("coord var %d %s is x dim\n", ncvarid, ncvars[ncvarid].name);
+	  if ( ncdims[ncdimid].dimtype == Y_AXIS )
+	    printf("coord var %d %s is y dim\n", ncvarid, ncvars[ncvarid].name);
+	  if ( ncdims[ncdimid].dimtype == Z_AXIS )
+	    printf("coord var %d %s is z dim\n", ncvarid, ncvars[ncvarid].name);
+	  if ( ncdims[ncdimid].dimtype == T_AXIS )
+	    printf("coord var %d %s is t dim\n", ncvarid, ncvars[ncvarid].name);
+
+	  if ( ncvars[ncvarid].islon )
+	    printf("coord var %d %s is lon\n", ncvarid, ncvars[ncvarid].name);
+	  if ( ncvars[ncvarid].islat )
+	    printf("coord var %d %s is lat\n", ncvarid, ncvars[ncvarid].name);
+	  if ( ncvars[ncvarid].islev )
+	    printf("coord var %d %s is lev\n", ncvarid, ncvars[ncvarid].name);
+	}
+    }
+  */
+  /* set dim type */
+  setDimType(nvars, ncvars, ncdims);
+
+  /* Set coordinate varids (att: associate)  */
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( ncvars[ncvarid].isvar == TRUE && ncvars[ncvarid].ncoordvars )
+	{
+	  /* ndims = ncvars[ncvarid].ndims; */
+	  ndims = ncvars[ncvarid].ncoordvars;
+	  for ( i = 0; i < ndims; i++ )
+	    {
+	      if ( ncvars[ncvars[ncvarid].coordvarids[i]].islon )
+		ncvars[ncvarid].xvarid = ncvars[ncvarid].coordvarids[i];
+	      else if ( ncvars[ncvars[ncvarid].coordvarids[i]].islat )
+		ncvars[ncvarid].yvarid = ncvars[ncvarid].coordvarids[i];
+	      else if ( ncvars[ncvars[ncvarid].coordvarids[i]].islev )
+		ncvars[ncvarid].zvarid = ncvars[ncvarid].coordvarids[i];
+	    }
+	}
+    }
+
+  /* find VCT */
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {
+      if ( ncvars[ncvarid].ndims == 1 )
+	{
+	  if ( memcmp(ncvars[ncvarid].name, "hyai", 4) == 0 )
+	    {
+	      vcta_id = ncvarid;
+	      nvcth_id = ncvars[ncvarid].dimids[0];
+              ncvars[ncvarid].isvar = FALSE;
+	      continue;
+	    }
+	  if ( memcmp(ncvars[ncvarid].name, "hybi", 4) == 0 )
+	    {
+	      vctb_id = ncvarid;
+	      nvcth_id = ncvars[ncvarid].dimids[0];
+              ncvars[ncvarid].isvar = FALSE;
+	      continue;
+	    }
+
+	  if      ( memcmp(ncvars[ncvarid].name, "hyam", 4) == 0 ) ncvars[ncvarid].isvar = FALSE;
+	  else if ( memcmp(ncvars[ncvarid].name, "hybm", 4) == 0 ) ncvars[ncvarid].isvar = FALSE;
+	}
+    }
+
+  if ( CDI_Debug ) printNCvars(ncvars, nvars, "define_all_grids");
+
+
+  /* define all grids */
+  define_all_grids(streamptr, vlistID, ncdims, nvars, ncvars, timedimid);
+
+
+  /* read VCT */
+  if ( nvcth_id != UNDEFID && vcta_id != UNDEFID && vctb_id != UNDEFID )
+    {
+      vctsize = ncdims[nvcth_id].len;
+      vctsize *= 2;
+      vct = (double *) malloc(vctsize*sizeof(double));
+      cdf_get_var_double(fileID, vcta_id, vct);
+      cdf_get_var_double(fileID, vctb_id, vct+vctsize/2);
+    }
+
+
+  /* define all zaxes */
+  define_all_zaxes(streamptr, vlistID, ncdims, nvars, ncvars, vctsize, vct);
+
+
+  if ( vct ) free(vct);
+
+  /* select vars */
+  varids = (int *) malloc(nvars*sizeof(int));
+  nvarids = 0;
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    if ( ncvars[ncvarid].isvar == TRUE ) varids[nvarids++] = ncvarid;
+
+  nvars_data = nvarids;
+
+  if ( CDI_Debug ) Message("time varid = %d", streamptr->basetime.ncvarid);
+  if ( CDI_Debug ) Message("ntsteps = %d", ntsteps);
+  if ( CDI_Debug ) Message("nvars_data = %d", nvars_data);
+
+
+  if ( nvars_data == 0 )
+    {
+      streamptr->ntsteps = 0;
+      return (CDI_EUFSTRUCT);
+    }
+
+  streamptr->ntsteps = ntsteps;
+
+  /* define all data variables */
+  define_all_vars(streamID, vlistID, instID, modelID, varids, nvars_data, ncvars);
+
+
+  cdiCreateTimesteps(streamID);
+
+  /* time varID */
+  ncvarid = streamptr->basetime.ncvarid;
+
+  if ( timehasunits )
+    {
+      taxis_t *taxis;
+      taxis = &streamptr->tsteps[0].taxis;
+
+      cdfGetAttText(fileID, ncvarid, "units", attstringlen-1, attstring);
+      if ( splitBasetime(attstring, taxis) == 1 )
+	streamptr->basetime.ncvarid = UNDEFID;
+    }
+
+  if ( time_has_bounds )
+    streamptr->tsteps[0].taxis.has_bounds = TRUE;
+
+  if ( ncvarid != -1 )
+    {
+      taxis_t *taxis;
+      taxis = &streamptr->tsteps[0].taxis;
+
+      taxis->name = strdup(ncvars[ncvarid].name);
+      if ( ncvars[ncvarid].longname[0] )
+        taxis->longname = strdup(ncvars[ncvarid].longname);
+    }
+
+  if ( ncvarid != -1 )
+    if ( ncvars[ncvarid].calendar == TRUE )
+      {
+	cdfGetAttText(fileID, ncvarid, "calendar", attstringlen-1, attstring);
+	strtolower(attstring);
+
+	if ( memcmp(attstring, "standard", 8)  == 0 ||
+	     memcmp(attstring, "gregorian", 9) == 0 )
+	  calendar = CALENDAR_STANDARD;
+	else if ( memcmp(attstring, "none", 4) == 0 )
+	  calendar = CALENDAR_NONE;
+	else if ( memcmp(attstring, "proleptic", 9) == 0 )
+	  calendar = CALENDAR_PROLEPTIC;
+	else if ( memcmp(attstring, "360", 3) == 0 )
+	  calendar = CALENDAR_360DAYS;
+	else if ( memcmp(attstring, "365", 3) == 0 ||
+		  memcmp(attstring, "noleap", 6)  == 0 )
+	  calendar = CALENDAR_365DAYS;
+	else if ( memcmp(attstring, "366", 3)  == 0 ||
+		  memcmp(attstring, "all_leap", 8) == 0 )
+	  calendar = CALENDAR_366DAYS;
+	else
+	  Warning("calendar >%s< unsupported!", attstring);
+      }
+
+  if ( streamptr->tsteps[0].taxis.type == TAXIS_RELATIVE )
+    taxisID = taxisCreate(TAXIS_RELATIVE);
+  else
+    {
+      taxisID = taxisCreate(TAXIS_ABSOLUTE);
+      if ( !timehasunits )
+	{
+	  taxisDefTunit(taxisID, TUNIT_DAY);
+	  streamptr->tsteps[0].taxis.unit = TUNIT_DAY;
+	}
+    }
+
+  if ( calendar != UNDEFID )
+    {
+      taxis_t *taxis;
+      taxis = &streamptr->tsteps[0].taxis;
+
+      taxis->calendar = calendar;
+      taxisDefCalendar(taxisID, calendar);
+    }
+  else if ( streamptr->tsteps[0].taxis.type == TAXIS_RELATIVE )
+    {
+      taxis_t *taxis;
+
+      calendar = CALENDAR_STANDARD;
+
+      taxis = &streamptr->tsteps[0].taxis;
+
+      taxis->calendar = calendar;
+      taxisDefCalendar(taxisID, calendar);
+    }
+
+  vlistDefTaxis(vlistID, taxisID);
+
+  streamptr->curTsID = 0;
+  streamptr->rtsteps = 1;
+
+  (void) cdfInqTimestep(streamID, 0);
+
+  cdfCreateRecords(streamID, 0);
+
+  /* free ncdims */
+  free (ncdims);
+
+  /* free ncvars */
+  free (ncvars);
+
+#endif
+
+  return (0);
+}
+
+
+int cdfInqTimestep(int streamID, int tsID)
+{
+  long nrecs = 0;
+#if  defined  (HAVE_LIBNETCDF)
+  double timevalue;
+  int nctimevarid;
+  int nctimeboundsid;
+  int fileID;
+  size_t index;
+  taxis_t *taxis;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  tsID = %d", streamID, tsID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( tsID < 0 ) Error("unexpected tsID = %d", tsID);
+
+  if ( tsID < streamptr->ntsteps && streamptr->ntsteps > 0 )
+    {
+      cdfCreateRecords(streamID, tsID);
+
+      taxis = &streamptr->tsteps[tsID].taxis;
+      if ( tsID > 0 )
+	ptaxisCopy(taxis, &streamptr->tsteps[0].taxis);
+
+      timevalue = tsID;
+
+      nctimevarid = streamptr->basetime.ncvarid;
+      if ( nctimevarid != UNDEFID )
+	{
+	  fileID = streamInqFileID(streamID);
+	  index  = tsID;
+
+	  if ( streamptr->basetime.lwrf )
+	    {
+	      size_t start[2], count[2];
+	      char stvalue[32];
+	      start[0] = index; start[1] = 0;
+	      count[0] = 1; count[1] = 19;
+	      stvalue[0] = 0;
+	      cdf_get_vara_text(fileID, nctimevarid, start, count, stvalue);
+	      stvalue[19] = 0;
+	      {
+		int year = 1, month = 1, day = 1 , hour = 0, minute = 0, second = 0;
+		if ( strlen(stvalue) == 19 )
+		  sscanf(stvalue, "%d-%d-%d_%d:%d:%d", &year, &month, &day, &hour, &minute, &second);
+		taxis->vdate = cdiEncodeDate(year, month, day);
+		taxis->vtime = cdiEncodeTime(hour, minute, second);
+		taxis->type = TAXIS_ABSOLUTE;
+	      }
+	    }
+	  else
+	    {
+	      cdf_get_var1_double(fileID, nctimevarid, &index, &timevalue);
+              if ( timevalue >= NC_FILL_DOUBLE ) timevalue = 0;
+
+	      cdiDecodeTimeval(timevalue, taxis, &taxis->vdate, &taxis->vtime);
+	    }
+
+	  nctimeboundsid = streamptr->basetime.ncvarboundsid;
+	  if ( nctimeboundsid != UNDEFID )
+	    {
+	      size_t start[2], count[2];
+	      start[0] = tsID; count[0] = 1; start[1] = 0; count[1] = 1;
+	      cdf_get_vara_double(fileID, nctimeboundsid, start, count, &timevalue);
+              if ( timevalue >= NC_FILL_DOUBLE ) timevalue = 0;
+
+	      cdiDecodeTimeval(timevalue, taxis, &taxis->vdate_lb, &taxis->vtime_lb);
+
+	      start[0] = tsID; count[0] = 1; start[1] = 1; count[1] = 1;
+	      cdf_get_vara_double(fileID, nctimeboundsid, start, count, &timevalue);
+              if ( timevalue >= NC_FILL_DOUBLE ) timevalue = 0;
+
+	      cdiDecodeTimeval(timevalue, taxis, &taxis->vdate_ub, &taxis->vtime_ub);
+	    }
+	}
+    }
+
+  streamptr->curTsID = tsID;
+  nrecs = streamptr->tsteps[tsID].nrecs;
+
+#endif
+  return ((int) nrecs);
+}
+
+
+void cdfEndDef(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int varID;
+  int nvars;
+  int fileID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  fileID  = streamInqFileID(streamID);
+
+  cdfDefGlobalAtts(streamID);
+  cdfDefLocalAtts(streamID);
+  if ( streamptr->accessmode == 0 )
+    {
+      nvars =  streamptr->nvars;
+
+      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	cdfDefVar(streamID, varID);
+
+      if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
+
+      streamptr->accessmode = 1;
+    }
+#endif
+}
+
+
+void cdfDefInstitut(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID, instID;
+  char *longname;
+  size_t len;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  instID  = vlistInqInstitut(vlistID);
+
+  if ( instID != UNDEFID )
+    {
+      longname = institutInqLongnamePtr(instID);
+      if ( longname )
+	{
+	  len = strlen(longname);
+	  if ( len > 0 )
+	    {
+	      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+	      cdf_put_att_text(fileID, NC_GLOBAL, "institution", len, longname);
+	      if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
+	    }
+	}
+    }
+#endif
+}
+
+void cdfDefSource(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID, modelID;
+  char *longname;
+  size_t len;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  modelID = vlistInqModel(vlistID);
+
+  if ( modelID != UNDEFID )
+    {
+      longname = modelInqNamePtr(modelID);
+      if ( longname )
+	{
+	  len = strlen(longname);
+	  if ( len > 0 )
+	    {
+	      if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+	      cdf_put_att_text(fileID, NC_GLOBAL, "source", len, longname);
+	      if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
+	    }
+	}
+    }
+#endif
+}
+
+
+void cdfDefGlobalAtts(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int fileID, vlistID;
+  stream_t *streamptr;
+  int natts;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->globalatts ) return;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  cdfDefSource(streamID);
+  cdfDefInstitut(streamID);
+
+  vlistInqNatts(vlistID, CDI_GLOBAL, &natts);
+
+  if ( natts > 0 && streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+  defineAttributes(vlistID, CDI_GLOBAL, fileID, NC_GLOBAL);
+
+  if ( natts > 0 && streamptr->ncmode == 2 ) cdf_enddef(fileID);
+
+  streamptr->globalatts = 1;
+#endif
+}
+
+
+void cdfDefLocalAtts(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int varID, instID, fileID;
+  char *name;
+  size_t len;
+  int ncvarid;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+
+  if ( streamptr->localatts ) return;
+  if ( vlistInqInstitut(vlistID) != UNDEFID ) return;
+
+  streamptr->localatts = 1;
+
+  if ( streamptr->ncmode == 2 ) cdf_redef(fileID);
+
+  for ( varID = 0; varID < streamptr->nvars; varID++ )
+    {
+      instID = vlistInqVarInstitut(vlistID, varID);
+      if ( instID != UNDEFID )
+	{
+          ncvarid = streamptr->vars[varID].ncvarid;
+  	  name = institutInqNamePtr(instID);
+	  if ( name )
+	    {
+	      len = strlen(name);
+	      cdf_put_att_text(fileID, ncvarid, "institution", len, name);
+	    }
+	}
+      }
+
+  if ( streamptr->ncmode == 2 ) cdf_enddef(fileID);
+#endif
+}
+
+void cdfDefHistory(int streamID, int size, char *history)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int ncid;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  ncid = streamptr->fileID;
+  cdf_put_att_text(ncid, NC_GLOBAL, "history", (size_t) size, history);
+#endif
+}
+
+int cdfInqHistorySize(int streamID)
+{
+  size_t size = 0;
+#if  defined  (HAVE_LIBNETCDF)
+  int ncid;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  ncid = streamptr->fileID;
+  if ( streamptr->historyID != UNDEFID )
+    cdf_inq_attlen(ncid, NC_GLOBAL, "history", &size);
+
+#endif
+  return ((int) size);
+}
+
+
+void cdfInqHistoryString(int streamID, char *history)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int ncid;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  ncid = streamptr->fileID;
+  if ( streamptr->historyID != UNDEFID )
+    cdf_get_att_text(ncid, NC_GLOBAL, "history", history);
+
+#endif
+}
+
+
+void cdfDefVars(int streamID)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int index, gridID, zaxisID, vlistID;
+  int ngrids, nzaxis;
+  /* int  nvars, ncvarid; */
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  if ( vlistID == UNDEFID )
+    Error("Internal problem! vlist undefined for streamID %d", streamID);
+
+  /* nvars  = vlistNvars(vlistID); */
+  ngrids = vlistNgrids(vlistID);
+  nzaxis = vlistNzaxis(vlistID);
+  /*
+  if ( vlistHasTime(vlistID) ) cdfDefTime(streamID);
+  */
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID = vlistGrid(vlistID, index);
+      cdfDefGrid(streamID, gridID);
+    }
+
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      zaxisID = vlistZaxis(vlistID, index);
+      if ( streamptr->zaxisID[index] == UNDEFID ) cdfDefZaxis(streamID, zaxisID);
+    }
+  /*
+    define time first!!!
+  for (varID = 0; varID < nvars; varID++ )
+    {
+      ncvarid = cdfDefVar(streamID, varID);
+    }
+  */
+#endif
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_cdf.h b/libcdi/src/stream_cdf.h
new file mode 100644
index 0000000..c00652e
--- /dev/null
+++ b/libcdi/src/stream_cdf.h
@@ -0,0 +1,35 @@
+#ifndef _STREAM_CDF_H
+#define _STREAM_CDF_H
+
+void   cdfDefVars(int streamID);
+void   cdfDefTimestep(int streamID, int tsID);
+int    cdfInqTimestep(int streamID, int tsID);
+int    cdfInqContents(int streamID);
+void   cdfDefHistory(int streamID, int size, char *history);
+int    cdfInqHistorySize(int streamID);
+void   cdfInqHistoryString(int streamID, char *history);
+
+void   cdfEndDef(int streamID);
+int    cdfDefRecord(int streamID);
+
+int    cdfCopyRecord(int streamIDdest, int streamIDsrc);
+
+int    cdfReadRecord(int streamID, double *data, int *nmiss);
+void   cdf_write_record(int streamID, int memtype, const void *data, int nmiss);
+
+void   cdfReadVarDP(int streamID, int varID, double *data, int *nmiss);
+void   cdf_write_var(int streamID, int varID, int memtype, const void *data, int nmiss);
+
+int    cdfReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *nmiss);
+int    cdf_write_var_slice(int streamID, int varID, int levelID, int memtype, const void *data, int nmiss);
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_cgribex.c b/libcdi/src/stream_cgribex.c
new file mode 100644
index 0000000..b473af0
--- /dev/null
+++ b/libcdi/src/stream_cgribex.c
@@ -0,0 +1,2270 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+// #include <float.h>  /* FLT_EPSILON */
+
+#include "dmemory.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "file.h"
+#include "varscan.h"
+#include "datetime.h"
+#include "vlist.h"
+#include "stream_grb.h"
+
+#if  defined  (HAVE_LIBCGRIBEX)
+#  include "cgribex.h"
+#endif
+
+extern int cdiInventoryMode;
+
+typedef struct {
+  int param;
+  int level1;
+  int level2;
+  int ltype;
+} compvar_t;
+
+
+#if  defined  (HAVE_LIBCGRIBEX)
+static
+int cgribexGetGridType(int *isec2)
+{
+  int gridtype = GRID_GENERIC;
+
+  switch (ISEC2_GridType)
+    {
+    case  GRIB1_GTYPE_LATLON:     { if ( ISEC2_Reduced )      break; }
+    case  GRIB1_GTYPE_LATLON_ROT: { gridtype = GRID_LONLAT;   break; }
+    case  GRIB1_GTYPE_LCC:        { gridtype = GRID_LCC;      break; }
+    case  GRIB1_GTYPE_GAUSSIAN:   { if ( ISEC2_Reduced )
+	                              gridtype = GRID_GAUSSIAN_REDUCED;
+                         	    else
+				      gridtype = GRID_GAUSSIAN;
+          	                    break;
+                                  }
+    case  GRIB1_GTYPE_SPECTRAL:   { gridtype = GRID_SPECTRAL; break; }
+    case  GRIB1_GTYPE_GME:        { gridtype = GRID_GME;      break; }
+    }
+
+  return (gridtype);
+}
+
+static
+int cgribexGetIsRotated(int *isec2)
+{
+  int isRotated = 0;
+
+  if ( ISEC2_GridType == GRIB1_GTYPE_LATLON_ROT )
+    {
+      isRotated = 1;
+    }
+ 
+  return (isRotated);
+}
+
+static
+int cgribexGetZaxisHasBounds(int grb_ltype)
+{
+  int lbounds = 0;
+
+  switch (grb_ltype)
+    {
+    case GRIB1_LTYPE_SIGMA_LAYER:
+    case GRIB1_LTYPE_HYBRID_LAYER:
+    case GRIB1_LTYPE_LANDDEPTH_LAYER:
+      {
+	lbounds = 1;
+	break;
+      }
+    }
+
+  return (lbounds);
+}
+
+static
+int cgribexGetTimeUnit(int *isec1)
+{
+  int timeunit = TUNIT_HOUR;
+  static int lprint = TRUE;
+
+  switch ( ISEC1_TimeUnit )
+    {
+    case ISEC1_TABLE4_MINUTE:  timeunit = TUNIT_MINUTE;  break;
+    case ISEC1_TABLE4_QUARTER: timeunit = TUNIT_QUARTER; break;
+    case ISEC1_TABLE4_HOUR:    timeunit = TUNIT_HOUR;    break;
+    case ISEC1_TABLE4_3HOURS:  timeunit = TUNIT_3HOURS;  break;
+    case ISEC1_TABLE4_6HOURS:  timeunit = TUNIT_6HOURS;  break;
+    case ISEC1_TABLE4_12HOURS: timeunit = TUNIT_12HOURS; break;
+    case ISEC1_TABLE4_DAY:     timeunit = TUNIT_DAY;     break;
+    default:
+      if ( lprint )
+	{
+	  Message("GRIB time unit %d unsupported!", ISEC1_TimeUnit);
+	  lprint = FALSE;
+	}
+    }
+
+  return (timeunit);
+}
+
+static
+int cgribexTimeIsFC(int *isec1)
+{
+  int isFC = TRUE;
+
+  if ( ISEC1_TimeRange == 10 && ISEC1_TimePeriod1 == 0 && ISEC1_TimePeriod2 == 0 )
+    isFC = FALSE;
+
+  return (isFC);
+}
+
+static
+int cgribexGetTsteptype(int timerange)
+{
+  int tsteptype = 0;
+  static int lprint = TRUE;
+
+  switch ( timerange )
+    {
+    case  0:  tsteptype = TSTEP_INSTANT;  break;
+    case  1:  tsteptype = TSTEP_INSTANT2; break;
+    case  2:  tsteptype = TSTEP_RANGE;    break;
+    case  3:  tsteptype = TSTEP_AVG;      break;
+    case  4:  tsteptype = TSTEP_ACCUM;    break;
+    case  5:  tsteptype = TSTEP_DIFF;     break;
+    case 10:  tsteptype = TSTEP_INSTANT3; break;
+    default:
+      if ( lprint )
+	{
+	  Message("GRIB time range %d unsupported!", timerange);
+	  lprint = FALSE;
+	}
+    }
+
+  return (tsteptype);
+}
+
+static
+void cgribexGetGrid(stream_t *streamptr, int *isec2, int *isec4, grid_t *grid, int iret)
+{
+  int gridtype;
+
+  gridtype = cgribexGetGridType(isec2);
+
+  if ( streamptr->unreduced && gridtype == GRID_GAUSSIAN_REDUCED && iret != -801 )
+    {
+      int ilat, nlon = 0;
+      for ( ilat = 0; ilat < ISEC2_NumLat; ++ilat )
+        if ( ISEC2_RowLon(ilat) > nlon ) nlon = ISEC2_RowLon(ilat);
+      gridtype = GRID_GAUSSIAN;
+      ISEC2_NumLon = nlon;
+      ISEC4_NumValues = nlon*ISEC2_NumLat;
+    }
+
+  memset(grid, 0, sizeof(grid_t));
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+      {
+	if ( ISEC4_NumValues != ISEC2_NumLon*ISEC2_NumLat )
+	  Error("numberOfPoints (%d) and gridSize (%d) differ!",
+		ISEC4_NumValues, ISEC2_NumLon*ISEC2_NumLat);
+	grid->size  = ISEC4_NumValues;
+	grid->xsize = ISEC2_NumLon;
+	grid->ysize = ISEC2_NumLat;
+        if ( gridtype == GRID_GAUSSIAN ) grid->np = ISEC2_NumPar;
+	grid->xinc  = 0;
+	grid->yinc  = 0;
+	grid->xdef  = 0;
+	/* if ( ISEC2_FirstLon != 0 || ISEC2_LastLon != 0 ) */
+	  {
+	    if ( grid->xsize > 1 )
+	      {
+                int recompinc = TRUE;
+
+		if ( ISEC2_ResFlag && ISEC2_LonIncr > 0 )
+                  {
+                    if ( abs(ISEC2_LastLon - (ISEC2_FirstLon+ISEC2_LonIncr*(grid->xsize-1))) <= 2 )
+                      {
+                        recompinc = FALSE;
+                        grid->xinc = ISEC2_LonIncr * 0.001;
+                      }
+                  }
+
+		/* recompute xinc if necessary */
+                if ( recompinc ) grid->xinc = (ISEC2_LastLon - ISEC2_FirstLon) * 0.001 / (grid->xsize-1);
+
+		/* correct xinc if necessary */
+		if ( ISEC2_FirstLon == 0 && ISEC2_LastLon > 354000 && ISEC2_LastLon < 360000 )
+		  {
+		    double xinc = 360. / grid->xsize;
+
+		    if ( fabs(grid->xinc-xinc) > 0.0 )
+		      {
+			grid->xinc = xinc;
+			if ( CDI_Debug ) Message("set xinc to %g", grid->xinc);
+		      }
+		  }
+	      }
+	    grid->xfirst = ISEC2_FirstLon * 0.001;
+	    grid->xlast  = ISEC2_LastLon  * 0.001;
+	    grid->xdef   = 2;
+	  }
+	grid->ydef  = 0;
+	/* if ( ISEC2_FirstLat != 0 || ISEC2_LastLat != 0 ) */
+	  {
+	    if ( grid->ysize > 1 )
+	      {
+                int recompinc = TRUE;
+
+		if ( ISEC2_ResFlag && ISEC2_LatIncr > 0 )
+                  {
+                    if ( abs(ISEC2_LastLat - (ISEC2_FirstLat+ISEC2_LatIncr*(grid->ysize-1))) <= 2 )
+                      {
+                        recompinc = FALSE;
+                        grid->yinc = ISEC2_LatIncr * 0.001;
+                      }
+                  }
+
+		/* recompute yinc if necessary */
+                if ( recompinc ) grid->yinc = (ISEC2_LastLat - ISEC2_FirstLat) * 0.001 / (grid->ysize - 1);
+	      }
+	    grid->yfirst = ISEC2_FirstLat * 0.001;
+	    grid->ylast  = ISEC2_LastLat  * 0.001;
+	    grid->ydef   = 2;
+	  }
+	break;
+      }
+    case GRID_GAUSSIAN_REDUCED:
+      {
+        grid->np     = ISEC2_NumPar;
+	grid->size   = ISEC4_NumValues;
+        grid->rowlon = ISEC2_RowLonPtr;
+	grid->ysize  = ISEC2_NumLat;
+	grid->xinc   = 0;
+	grid->yinc   = 0;
+	grid->xdef   = 0;
+	/* if ( ISEC2_FirstLon != 0 || ISEC2_LastLon != 0 ) */
+	  {
+	    if ( grid->xsize > 1 )
+	      {
+		if ( ISEC2_ResFlag && ISEC2_LonIncr > 0 )
+		  grid->xinc = ISEC2_LonIncr * 0.001;
+		else
+		  grid->xinc = (ISEC2_LastLon - ISEC2_FirstLon) * 0.001 / (grid->xsize - 1);
+	      }
+	    grid->xfirst = ISEC2_FirstLon * 0.001;
+	    grid->xlast  = ISEC2_LastLon  * 0.001;
+	    grid->xdef   = 2;
+	  }
+	grid->ydef  = 0;
+	/* if ( ISEC2_FirstLat != 0 || ISEC2_LastLat != 0 ) */
+	  {
+	    if ( grid->ysize > 1 )
+	      {
+		if ( ISEC2_ResFlag && ISEC2_LatIncr > 0 )
+		  grid->yinc = ISEC2_LatIncr * 0.001;
+		else
+		  grid->yinc = (ISEC2_LastLat - ISEC2_FirstLat) * 0.001 / (grid->ysize - 1);
+	      }
+	    grid->yfirst = ISEC2_FirstLat * 0.001;
+	    grid->ylast  = ISEC2_LastLat  * 0.001;
+	    grid->ydef   = 2;
+	  }
+	break;
+      }
+    case GRID_LCC:
+      {
+	if ( ISEC4_NumValues != ISEC2_NumLon*ISEC2_NumLat )
+	  Error("numberOfPoints (%d) and gridSize (%d) differ!",
+		ISEC4_NumValues, ISEC2_NumLon*ISEC2_NumLat);
+
+	grid->size  = ISEC4_NumValues;
+	grid->xsize = ISEC2_NumLon;
+	grid->ysize = ISEC2_NumLat;
+
+	grid->lcc_xinc      = ISEC2_Lambert_dx;
+	grid->lcc_yinc      = ISEC2_Lambert_dy;
+	grid->lcc_originLon = ISEC2_FirstLon * 0.001;
+	grid->lcc_originLat = ISEC2_FirstLat * 0.001;
+	grid->lcc_lonParY   = ISEC2_Lambert_Lov * 0.001;
+	grid->lcc_lat1      = ISEC2_Lambert_LatS1 * 0.001;
+	grid->lcc_lat2      = ISEC2_Lambert_LatS2 * 0.001;
+	grid->lcc_projflag  = ISEC2_Lambert_ProjFlag;
+	grid->lcc_scanflag  = ISEC2_ScanFlag;
+
+	grid->xdef   = 0;
+	grid->ydef   = 0;
+
+	break;
+      }
+    case GRID_SPECTRAL:
+      {
+	grid->size  = ISEC4_NumValues;
+	grid->trunc = ISEC2_PentaJ;
+	if ( ISEC2_RepMode == 2 )
+	  grid->lcomplex = 1;
+	else
+	  grid->lcomplex = 0;
+
+	break;
+      }
+    case GRID_GME:
+      {
+	grid->size  = ISEC4_NumValues;
+	grid->nd    = ISEC2_GME_ND;
+	grid->ni    = ISEC2_GME_NI;
+	grid->ni2   = ISEC2_GME_NI2;
+	grid->ni3   = ISEC2_GME_NI3;
+	break;
+      }
+    case GRID_GENERIC:
+      {
+	grid->size  = ISEC4_NumValues;
+	grid->xsize = 0;
+	grid->ysize = 0;
+	break;
+      }
+    default:
+      {
+	Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+	break;
+      }
+    }
+
+  grid->isRotated = FALSE;
+  if ( cgribexGetIsRotated(isec2) )
+    {
+      grid->isRotated = TRUE;
+      grid->ypole     = - ISEC2_LatSP * 0.001;
+      grid->xpole     =   ISEC2_LonSP * 0.001 - 180;
+      grid->angle     = 0;
+    }
+
+  grid->xvals = NULL;
+  grid->yvals = NULL;
+  grid->type  = gridtype;
+}
+
+static
+void cgribexAddRecord(int streamID, int param, int *isec1, int *isec2, double *fsec2, double *fsec3,
+		      int *isec4, long recsize, off_t position, int datatype, int comptype, int lmv, int iret)
+{
+  int zaxistype;
+  int gridID = CDI_UNDEFID, varID;
+  int levelID = 0;
+  int tsID, recID;
+  int level1, level2;
+  int numavg;
+  int tsteptype;
+  int lbounds = 0;
+  record_t *record;
+  grid_t grid;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  tsID    = streamptr->curTsID;
+  recID   = recordNewEntry(streamID, tsID);
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  tsteptype = cgribexGetTsteptype(ISEC1_TimeRange);
+  numavg    = ISEC1_AvgNum;
+
+  level1  = ISEC1_Level1;
+  level2  = ISEC1_Level2;
+
+  /* fprintf(stderr, "param %d %d %d %d\n", param, level1, level2, ISEC1_LevelType); */
+
+  (*record).size     = recsize;
+  (*record).position = position;
+  (*record).param    = param;
+  (*record).ilevel   = level1;
+  (*record).ilevel2  = level2;
+  (*record).ltype    = ISEC1_LevelType;
+
+  cgribexGetGrid(streamptr, isec2, isec4, &grid, iret);
+
+  gridID = varDefGrid(vlistID, grid, 0);
+
+  zaxistype = grib1ltypeToZaxisType(ISEC1_LevelType);
+
+  if ( zaxistype == ZAXIS_HYBRID || zaxistype == ZAXIS_HYBRID_HALF )
+    {
+      int vctsize = ISEC2_NumVCP;
+      double *vctptr = &fsec2[10];
+
+      varDefVCT(vctsize, vctptr);
+    }
+
+  lbounds = cgribexGetZaxisHasBounds(ISEC1_LevelType);
+
+  if ( datatype > 32 ) datatype = DATATYPE_PACK32;
+  if ( datatype <  0 ) datatype = DATATYPE_PACK;
+
+  varAddRecord(recID, param, gridID, zaxistype, lbounds, level1, level2,
+	       datatype, &varID, &levelID, tsteptype, numavg, ISEC1_LevelType, NULL, NULL, NULL);
+
+  (*record).varID   = varID;
+  (*record).levelID = levelID;
+
+  varDefCompType(varID, comptype);
+
+  if ( ISEC1_LocalFLag )
+    {
+      if      ( ISEC1_CenterID == 78  && isec1[36] == 253 ) // DWD local extension
+        varDefEnsembleInfo(varID, isec1[54], isec1[53], isec1[52]);
+      else if ( ISEC1_CenterID == 252 && isec1[36] ==   1 ) // MPIM local extension
+        varDefEnsembleInfo(varID, isec1[38], isec1[39], isec1[37]);
+    }
+
+  if ( lmv ) varDefMissval(varID, FSEC3_MissVal);
+
+  if ( varInqInst(varID) == CDI_UNDEFID )
+    {
+      int center, subcenter, instID;
+      center    = ISEC1_CenterID;
+      subcenter = ISEC1_SubCenterID;
+      instID    = institutInq(center, subcenter, NULL, NULL);
+      if ( instID == CDI_UNDEFID )
+	instID = institutDef(center, subcenter, NULL, NULL);
+      varDefInst(varID, instID);
+    }
+
+  if ( varInqModel(varID) == CDI_UNDEFID )
+    {
+      int modelID;
+      modelID = modelInq(varInqInst(varID), ISEC1_ModelID, NULL);
+      if ( modelID == CDI_UNDEFID )
+	modelID = modelDef(varInqInst(varID), ISEC1_ModelID, NULL);
+      varDefModel(varID, modelID);
+    }
+
+  if ( varInqTable(varID) == CDI_UNDEFID )
+    {
+      int tableID;
+
+      tableID = tableInq(varInqModel(varID), ISEC1_CodeTable, NULL);
+
+      if ( tableID == CDI_UNDEFID )
+	tableID = tableDef(varInqModel(varID), ISEC1_CodeTable, NULL);
+      varDefTable(varID, tableID);
+    }
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+
+  if ( CDI_Debug )
+    Message("varID = %d  param = %d  zaxistype = %d  gridID = %d  levelID = %d",
+	    varID, param, zaxistype, gridID, levelID);
+}
+
+static
+void MCH_get_undef(int *isec1, double *undef_pds, double *undef_eps)
+{
+  /* 2010-01-13: Oliver Fuhrer */
+  if ( ISEC1_CenterID == 215 ) {
+    if (isec1[34] != 0 && isec1[34] != 255) {
+      if (isec1[34] & 2) {
+        if (isec1[34] & 1) {
+          *undef_pds = -0.99*pow(10.0,-isec1[35]);
+        } else {
+          *undef_pds = +0.99*pow(10.0,-isec1[35]);
+        }
+        *undef_eps = pow(10.0,-isec1[35]-1);
+      } else {
+        if (isec1[34] & 1) {
+          *undef_pds = -0.99*pow(10.0,+isec1[35]);
+        } else {
+          *undef_pds = +0.99*pow(10.0,+isec1[35]);
+        }
+        *undef_eps = pow(10.0,isec1[35]-1);
+      }
+    }
+  }
+}
+
+static
+void cgribexDecodeHeader(int *isec0, int *isec1, int *isec2, double *fsec2,
+			 int *isec3, double *fsec3, int *isec4, double *fsec4, 
+			 int *gribbuffer, int recsize, int *lmv, int *iret)
+{
+  int ipunp = 0, iword = 0;
+
+  memset(isec1, 0, 256*sizeof(int));
+
+  gribExDP(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, fsec4,
+	   ipunp, (int *) gribbuffer, recsize, &iword, "J", iret);
+
+  *lmv = 0;
+
+  if ( ISEC1_CenterID == 215 && (isec1[34] != 0 && isec1[34] != 255) )
+    {
+      double undef_pds, undef_eps;
+
+      MCH_get_undef(isec1, &undef_pds, &undef_eps);
+      FSEC3_MissVal = undef_pds;
+      *lmv = 1;
+    }
+}
+#endif
+
+int cgribexScanTimestep1(int streamID)
+{
+#if  defined  (HAVE_LIBCGRIBEX)
+  int *isec0, *isec1, *isec2, *isec3, *isec4;
+  double fsec2[512], fsec3[2], *fsec4 = NULL;
+  int lmv = 0, iret = 0;
+  off_t recpos = 0;
+  unsigned char *gribbuffer = NULL;
+  long buffersize = 0;
+  int rstatus;
+  int fileID;
+  int param = 0;
+  int level1 = 0, level2 = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  size_t readsize;
+  int nrecords, nrecs, recID;
+  int datatype;
+  long recsize = 0;
+  int warn_time = TRUE;
+  int warn_numavg = TRUE;
+  int taxisID = -1;
+  int rdate = 0, rtime = 0, tunit = 0, fcast = 0;
+  taxis_t *taxis;
+  int vlistID;
+  int comptype;
+  long unzipsize;
+  compvar_t compVar, compVar0;
+  stream_t *streamptr;
+  extern int cdiSkipRecords;
+  int nskip = cdiSkipRecords;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 0;
+
+  isec0 = streamptr->record->sec0;
+  isec1 = streamptr->record->sec1;
+  isec2 = streamptr->record->sec2;
+  isec3 = streamptr->record->sec3;
+  isec4 = streamptr->record->sec4;
+
+  tsID  = tstepsNewEntry(streamID);
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( tsID != 0 )
+    Error("Internal problem! tstepsNewEntry returns %d", tsID);
+
+  fileID = streamInqFileID(streamID);
+
+  while ( nskip-- > 0 )
+    {
+      recsize = gribGetSize(fileID);
+      if ( recsize == 0 )
+	Error("Skipping of %d records failed!", cdiSkipRecords);
+
+      recpos  = fileGetPos(fileID);
+      fileSetPos(fileID, recsize, SEEK_CUR);
+    }
+
+  nrecs = 0;
+  while ( TRUE )
+    {
+      recsize = gribGetSize(fileID);
+      recpos  = fileGetPos(fileID);
+
+      if ( recsize == 0 )
+	{
+	  if ( nrecs == 0 )
+	    Error("No GRIB records found!");
+
+	  streamptr->ntsteps = 1;
+	  break;
+	}
+      if ( recsize > buffersize )
+	{
+	  buffersize = recsize;
+	  gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	}
+
+      readsize = recsize;
+      rstatus = gribRead(fileID, gribbuffer, &readsize);
+      if ( rstatus ) break;
+
+      comptype = COMPRESS_NONE;
+      if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	{
+	  comptype = COMPRESS_SZIP;
+	  unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+	  if ( (long) buffersize < unzipsize )
+	    {
+	      buffersize = unzipsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+	}
+
+      cgribexDecodeHeader(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, fsec4,
+			  (int *) gribbuffer, recsize, &lmv, &iret);
+
+      param = cdiEncodeParam(ISEC1_Parameter, ISEC1_CodeTable, 255);
+      if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
+      if ( ISEC1_LevelType ==  99 ) ISEC1_LevelType = 100;
+      level1   = ISEC1_Level1;
+      level2   = ISEC1_Level2;
+
+      gribDateTime(isec1, &vdate, &vtime);
+
+      if ( ISEC4_NumBits > 0 && ISEC4_NumBits <= 32 )
+	datatype = ISEC4_NumBits;
+      else
+        datatype = DATATYPE_PACK;
+
+      if ( nrecs == 0 )
+	{
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	  rdate = gribRefDate(isec1);
+	  rtime = gribRefTime(isec1);
+	  tunit = cgribexGetTimeUnit(isec1);
+	  fcast = cgribexTimeIsFC(isec1);
+	}
+      else
+	{
+	  datetime.date  = vdate;
+	  datetime.time  = vtime;
+	  compVar.param  = param;
+          compVar.level1 = level1;
+          compVar.level2 = level2;
+          compVar.ltype  = ISEC1_LevelType;
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      compVar0.param  = streamptr->tsteps[0].records[recID].param;
+	      compVar0.level1 = streamptr->tsteps[0].records[recID].ilevel;
+	      compVar0.level2 = streamptr->tsteps[0].records[recID].ilevel2;
+	      compVar0.ltype  = streamptr->tsteps[0].records[recID].ltype;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(compvar_t)) == 0 ) break;
+	    }
+
+	  if ( cdiInventoryMode == 1 )
+	    {
+	      if ( recID < nrecs ) break;
+	      if ( warn_time )
+		if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 )
+		  {
+		    char paramstr[32];
+		    cdiParamToString(param, paramstr, sizeof(paramstr));
+		    Warning("Inconsistent verification time (param=%s level=%d)", paramstr, level1);
+		    warn_time = FALSE;
+		  }
+	    }
+	  else
+	    {
+	      if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+	      if ( recID < nrecs )
+		{
+		  char paramstr[32];
+		  cdiParamToString(param, paramstr, sizeof(paramstr));
+		  Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+		  continue;
+		}
+	    }
+	}
+
+      if ( ISEC1_AvgNum )
+	{
+	  if (  taxis->numavg && warn_numavg && (taxis->numavg != ISEC1_AvgNum) )
+	    {
+	      Warning("Changing numavg from %d to %d not supported!",
+		      taxis->numavg, ISEC1_AvgNum);
+	      warn_numavg = FALSE;
+	    }
+	  else
+	    {
+	      taxis->numavg = ISEC1_AvgNum;
+	    }
+	}
+
+      nrecs++;
+
+      if ( CDI_Debug )
+	Message("%4d %8d %4d  %8d %8d %6d", nrecs, (int)recpos, param, level1, vdate, vtime);
+
+      cgribexAddRecord(streamID, param, isec1, isec2, fsec2, fsec3,
+		       isec4, recsize, recpos, datatype, comptype, lmv, iret);
+    }
+
+  streamptr->rtsteps = 1;
+
+  if ( nrecs == 0 ) return (CDI_EUFSTRUCT);
+
+  cdiGenVars(streamID);
+
+  if ( fcast )
+    {
+      taxisID = taxisCreate(TAXIS_RELATIVE);
+      taxis->type  = TAXIS_RELATIVE;
+      taxis->rdate = rdate;
+      taxis->rtime = rtime;
+      taxis->unit  = tunit;
+    }
+  else
+    {
+      taxisID = taxisCreate(TAXIS_ABSOLUTE);
+      taxis->type  = TAXIS_ABSOLUTE;
+      taxis->unit  = tunit;
+    }
+
+  taxis->vdate = datetime0.date;
+  taxis->vtime = datetime0.time;
+
+  vlistID = streamInqVlist(streamID);
+  vlistDefTaxis(vlistID, taxisID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  if ( nrecords < streamptr->tsteps[0].recordSize )
+    {
+      streamptr->tsteps[0].recordSize = nrecords;
+      streamptr->tsteps[0].records =
+      (record_t *) realloc(streamptr->tsteps[0].records, nrecords*sizeof(record_t));
+    }
+
+  streamptr->tsteps[0].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[0].nrecs = nrecords;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[0].recIDs[recID] = recID;
+
+  streamptr->record->buffer     = gribbuffer;
+  streamptr->record->buffersize = buffersize;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( streamptr->ntsteps == 1 )
+    {
+      if ( taxis->vdate == 0 && taxis->vtime == 0 )
+	{
+	  streamptr->ntsteps = 0;
+	  for ( varID = 0; varID < streamptr->nvars; varID++ )
+	    {
+	      vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	    }
+	}
+    }
+#else
+  Error("CGRIBEX support not compiled in!");
+#endif
+
+  return (0);
+}
+
+
+int cgribexScanTimestep2(int streamID)
+{
+  int rstatus = 0;
+#if  defined  (HAVE_LIBCGRIBEX)
+  int *isec0, *isec1, *isec2, *isec3, *isec4;
+  double fsec2[512], fsec3[2], *fsec4 = NULL;
+  int lmv = 0, iret = 0;
+  off_t recpos = 0;
+  unsigned char *gribbuffer = NULL;
+  long buffersize = 0;
+  int fileID;
+  int param = 0;
+  int level1 = 0, level2 = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID, gridID;
+  size_t readsize;
+  int nrecords, nrecs, recID, rindex;
+  long recsize = 0;
+  int warn_numavg = TRUE;
+  int tsteptype;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  long unzipsize;
+  compvar_t compVar, compVar0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 1;
+
+  isec0 = streamptr->record->sec0;
+  isec1 = streamptr->record->sec1;
+  isec2 = streamptr->record->sec2;
+  isec3 = streamptr->record->sec3;
+  isec4 = streamptr->record->sec4;
+
+  fileID  = streamInqFileID(streamID);
+  vlistID = streamInqVlist(streamID);
+  taxisID = vlistInqTaxis(vlistID);
+
+  gribbuffer = (unsigned char *) streamptr->record->buffer;
+  buffersize = streamptr->record->buffersize;
+
+  tsID = streamptr->rtsteps;
+  if ( tsID != 1 )
+    Error("Internal problem! unexpeceted timestep %d", tsID+1);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+  cdiCreateRecords(streamID, tsID);
+
+  nrecords = streamptr->tsteps[tsID].nallrecs;
+  streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[1].nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[1].recIDs[recID] = -1;
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID = streamptr->tsteps[0].records[recID].varID;
+      streamptr->tsteps[tsID].records[recID].position =	streamptr->tsteps[0].records[recID].position;
+      streamptr->tsteps[tsID].records[recID].size     =	streamptr->tsteps[0].records[recID].size;
+    }
+
+  rindex = 0;
+  while ( TRUE )
+    {
+      if ( rindex > nrecords ) break;
+
+      recsize = gribGetSize(fileID);
+      recpos  = fileGetPos(fileID);
+      if ( recsize == 0 )
+	{
+	  streamptr->ntsteps = 2;
+	  break;
+	}
+      if ( recsize > buffersize )
+	{
+	  buffersize = recsize;
+	  gribbuffer = (unsigned char *) realloc(gribbuffer, (size_t)buffersize);
+	}
+
+      readsize = recsize;
+      rstatus = gribRead(fileID, gribbuffer, &readsize);
+      if ( rstatus ) break;
+
+      if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	{
+	  unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+	  if ( (long) buffersize < unzipsize )
+	    {
+	      buffersize = unzipsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+	}
+
+      cgribexDecodeHeader(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, fsec4,
+			  (int *) gribbuffer, recsize, &lmv, &iret);
+
+      param = cdiEncodeParam(ISEC1_Parameter, ISEC1_CodeTable, 255);
+      if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
+      if ( ISEC1_LevelType ==  99 ) ISEC1_LevelType = 100;
+      level1    = ISEC1_Level1;
+      level2    = ISEC1_Level2;
+
+      gribDateTime(isec1, &vdate, &vtime);
+
+      if ( rindex == 0 )
+	{
+	  if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
+	    {
+	      taxis->type  = TAXIS_RELATIVE;
+	      taxis->rdate = gribRefDate(isec1);
+	      taxis->rtime = gribRefTime(isec1);
+	    }
+	  else
+	    {
+	      taxis->type  = TAXIS_ABSOLUTE;
+	    }
+	  taxis->unit  = cgribexGetTimeUnit(isec1);
+	  taxis->vdate = vdate;
+	  taxis->vtime = vtime;
+
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	}
+
+      tsteptype = cgribexGetTsteptype(ISEC1_TimeRange);
+
+      if ( ISEC1_AvgNum )
+	{
+	  if (  taxis->numavg && warn_numavg &&
+        	(taxis->numavg != ISEC1_AvgNum) )
+	    {
+	  /*
+	      Warning("Changing numavg from %d to %d not supported!",
+		      taxis->numavg, ISEC1_AvgNum);
+	  */
+	      warn_numavg = FALSE;
+	    }
+	  else
+	    {
+	      taxis->numavg = ISEC1_AvgNum;
+	    }
+	}
+
+      datetime.date  = vdate;
+      datetime.time  = vtime;
+      compVar.param  = param;
+      compVar.level1 = level1;
+      compVar.level2 = level2;
+      compVar.ltype  = ISEC1_LevelType;
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	  compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	  compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(compvar_t)) == 0 ) break;
+	}
+
+      if ( recID == nrecords )
+	{
+	  char paramstr[32];
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+	  Warning("Param=%s level=%d not defined at timestep 1!", paramstr, level1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      if ( cdiInventoryMode == 1 )
+	{
+	  if ( streamptr->tsteps[tsID].records[recID].used )
+	    {
+	      break;
+	    }
+	  else
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }
+	}
+      else
+	{
+	  if ( streamptr->tsteps[tsID].records[recID].used )
+	    {
+	      char paramstr[32];
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+
+	      if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+	      Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+	      continue;
+	    }
+	  else
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }
+	}
+
+      if ( CDI_Debug )
+	Message("%4d %8d %4d %8d %8d %6d", rindex+1, (int)recpos, param, level1, vdate, vtime);
+
+      streamptr->tsteps[tsID].records[recID].size = recsize;
+
+      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+      compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+      compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+      compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+      if ( memcmp(&compVar0, &compVar, sizeof(compvar_t)) != 0 )
+	{
+	  Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		  tsID, recID,
+		  streamptr->tsteps[tsID].records[recID].param, param,
+		  streamptr->tsteps[tsID].records[recID].ilevel, level1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->tsteps[1].records[recID].position = recpos;
+      varID = streamptr->tsteps[tsID].records[recID].varID;
+      gridID = vlistInqVarGrid(vlistID, varID);
+      if ( gridInqSize(gridID) == 1 && gridInqType(gridID) == GRID_LONLAT )
+	{
+	  if ( IS_NOT_EQUAL(gridInqXval(gridID, 0),ISEC2_FirstLon*0.001) ||
+	       IS_NOT_EQUAL(gridInqYval(gridID, 0),ISEC2_FirstLat*0.001) )
+	    gridChangeType(gridID, GRID_TRAJECTORY);
+	}
+
+      if ( tsteptype != vlistInqVarTsteptype(vlistID, varID) )
+	vlistDefVarTsteptype(vlistID, varID, tsteptype);
+
+      rindex++;
+    }
+
+  nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      if ( ! streamptr->tsteps[tsID].records[recID].used )
+	{
+	  varID = streamptr->tsteps[tsID].records[recID].varID;
+          vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	}
+      else
+	{
+	  nrecs++;
+	}
+    }
+  streamptr->tsteps[tsID].nrecs = nrecs;
+
+  streamptr->rtsteps = 2;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  streamptr->record->buffer     = gribbuffer;
+  streamptr->record->buffersize = buffersize;
+#endif
+
+  return (rstatus);
+}
+
+
+int cgribexScanTimestep(int streamID)
+{
+  int rstatus = 0;
+#if  defined  (HAVE_LIBCGRIBEX)
+  int *isec0, *isec1, *isec2, *isec3, *isec4;
+  double fsec2[512], fsec3[2], *fsec4 = NULL;
+  int lmv = 0, iret = 0;
+  long recsize = 0;
+  off_t recpos = 0;
+  unsigned char *gribbuffer;
+  long buffersize = 0;
+  int fileID;
+  int param = 0;
+  int level1 = 0, level2 = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int vrecID, recID;
+  int warn_numavg = TRUE;
+  size_t readsize;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  int rindex, nrecs = 0;
+  long unzipsize;
+  compvar_t compVar, compVar0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+
+  if ( CDI_Debug )
+    {
+      Message("streamID = %d", streamID);
+      Message("cts = %d", streamptr->curTsID);
+      Message("rts = %d", streamptr->rtsteps);
+      Message("nts = %d", streamptr->ntsteps);
+    }
+
+  isec0 = streamptr->record->sec0;
+  isec1 = streamptr->record->sec1;
+  isec2 = streamptr->record->sec2;
+  isec3 = streamptr->record->sec3;
+  isec4 = streamptr->record->sec4;
+
+  tsID  = streamptr->rtsteps;
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->tsteps[tsID].recordSize == 0 )
+    {
+      gribbuffer = (unsigned char *) streamptr->record->buffer;
+      buffersize = streamptr->record->buffersize;
+
+      cdiCreateRecords(streamID, tsID);
+
+      nrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->tsteps[tsID].nrecs = nrecs;
+      streamptr->tsteps[tsID].recIDs = (int *) malloc(nrecs*sizeof(int));
+      for ( recID = 0; recID < nrecs; recID++ )
+	streamptr->tsteps[tsID].recIDs[recID] = streamptr->tsteps[1].recIDs[recID];
+
+      fileID = streamInqFileID(streamID);
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+      rindex = 0;
+      while ( TRUE )
+	{
+	  if ( rindex > nrecs ) break;
+
+	  recsize = gribGetSize(fileID);
+	  recpos  = fileGetPos(fileID);
+	  if ( recsize == 0 )
+	    {
+	      streamptr->ntsteps = streamptr->rtsteps + 1;
+	      break;
+	    }
+	  if ( recsize > buffersize )
+	    {
+	      buffersize = recsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+
+	  if ( rindex >= nrecs ) break;
+
+	  readsize = recsize;
+	  rstatus = gribRead(fileID, gribbuffer, &readsize);
+	  if ( rstatus )
+	    {
+	      Warning("Inconsistent timestep %d (GRIB record %d/%d)!", tsID+1, rindex+1,
+                      streamptr->tsteps[tsID].recordSize);
+	      break;
+	    }
+
+	  if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	    {
+	      unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+	      if ( (long) buffersize < unzipsize )
+		{
+		  buffersize = unzipsize;
+		  gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+		}
+	    }
+
+	  cgribexDecodeHeader(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, fsec4,
+			      (int *) gribbuffer, recsize, &lmv, &iret);
+
+	  param = cdiEncodeParam(ISEC1_Parameter, ISEC1_CodeTable, 255);
+	  if ( ISEC1_LevelType == 100 ) ISEC1_Level1 *= 100;
+	  if ( ISEC1_LevelType ==  99 ) ISEC1_LevelType = 100;
+	  level1   = ISEC1_Level1;
+	  level2   = ISEC1_Level2;
+
+	  gribDateTime(isec1, &vdate, &vtime);
+
+	  if ( rindex == nrecs ) break;
+
+	  if ( rindex == 0 )
+	    {
+	      taxisID = vlistInqTaxis(vlistID);
+	      if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
+		{
+		  taxis->type  = TAXIS_RELATIVE;
+		  taxis->rdate = gribRefDate(isec1);
+		  taxis->rtime = gribRefTime(isec1);
+		}
+	      else
+		{
+		  taxis->type  = TAXIS_ABSOLUTE;
+		}
+	      taxis->unit  = cgribexGetTimeUnit(isec1);
+	      taxis->vdate = vdate;
+	      taxis->vtime = vtime;
+
+	      datetime0.date = vdate;
+	      datetime0.time = vtime;
+	    }
+
+	  if ( ISEC1_AvgNum )
+	    {
+	      if (  taxis->numavg && warn_numavg &&
+		   (taxis->numavg != ISEC1_AvgNum) )
+		{
+	      /*
+	          Warning("Changing numavg from %d to %d not supported!",
+			  streamptr->tsteps[tsID].taxis.numavg, ISEC1_AvgNum);
+	      */
+		  warn_numavg = FALSE;
+		}
+	      else
+		{
+		  taxis->numavg = ISEC1_AvgNum;
+		}
+	    }
+
+	  datetime.date  = vdate;
+	  datetime.time  = vtime;
+	  compVar.param  = param;
+          compVar.level1 = level1;
+          compVar.level2 = level2;
+          compVar.ltype  = ISEC1_LevelType;
+	  for ( vrecID = 0; vrecID < nrecs; vrecID++ )
+	    {
+	      recID   = streamptr->tsteps[1].recIDs[vrecID];
+	      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	      compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	      compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	      compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(compvar_t)) == 0 ) break;
+	    }
+
+	  if ( vrecID == nrecs )
+	    {
+	      char paramstr[32];
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+	      Warning("Param=%s level=%d not available at timestep %d!", paramstr, level1, tsID+1);
+
+	      if ( cdiInventoryMode == 1 )
+		return (CDI_EUFSTRUCT);
+	      else
+		continue;
+	    }
+
+	  if ( cdiInventoryMode == 1 )
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }
+	  else
+	    {
+	      if ( streamptr->tsteps[tsID].records[recID].used )
+		{
+		  char paramstr[32];
+		  cdiParamToString(param, paramstr, sizeof(paramstr));
+
+		  if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+		  if ( CDI_Debug )
+		    Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+
+		  continue;
+		}
+	      else
+		{
+		  streamptr->tsteps[tsID].records[recID].used = TRUE;
+		  streamptr->tsteps[tsID].recIDs[rindex] = recID;
+		}
+	    }
+
+	  if ( CDI_Debug )
+	    Message("%4d %8d %4d %8d %8d %6d", rindex+1, (int)recpos, param, level1, vdate, vtime);
+
+	  compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	  compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	  compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(compvar_t)) != 0 )
+	    {
+	      Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		      tsID, recID,
+		      streamptr->tsteps[tsID].records[recID].param, param,
+		      streamptr->tsteps[tsID].records[recID].ilevel, level1);
+	      Error("Invalid, unsupported or inconsistent record structure");
+	    }
+
+	  streamptr->tsteps[tsID].records[recID].position = recpos;
+	  streamptr->tsteps[tsID].records[recID].size = recsize;
+
+	  if ( CDI_Debug )
+	    Message("%4d %8d %4d %8d %8d %6d", rindex, (int)recpos, param, level1, vdate, vtime);
+
+	  rindex++;
+	}
+
+      for ( vrecID = 0; vrecID < nrecs; vrecID++ )
+	{
+	  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+	  if ( ! streamptr->tsteps[tsID].records[recID].used ) break;
+	}
+
+      if ( vrecID < nrecs )
+	{
+	  char paramstr[32];
+	  cdiParamToString(streamptr->tsteps[tsID].records[recID].param, paramstr, sizeof(paramstr));
+	  Warning("Param=%s level=%d not found at timestep %d!",
+		  paramstr, streamptr->tsteps[tsID].records[recID].ilevel, tsID+1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->rtsteps++;
+
+      if ( streamptr->ntsteps != streamptr->rtsteps )
+	{
+	  tsID = tstepsNewEntry(streamID);
+	  if ( tsID != streamptr->rtsteps )
+	    Error("Internal error. tsID = %d", tsID);
+
+	  streamptr->tsteps[tsID-1].next   = 1;
+	  streamptr->tsteps[tsID].position = recpos;
+	}
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+      streamptr->tsteps[tsID].position = recpos;
+
+      streamptr->record->buffer     = gribbuffer;
+      streamptr->record->buffersize = buffersize;
+    }
+
+  if ( nrecs > 0 && nrecs < streamptr->tsteps[tsID].nrecs )
+    {
+      Warning("Incomplete timestep. Stop scanning at timestep %d.", tsID);
+      streamptr->ntsteps = tsID;
+    }
+
+  rstatus = streamptr->ntsteps;
+#endif
+
+  return (rstatus);
+}
+
+
+int cgribexDecode(unsigned char *gribbuffer, int gribsize, double *data, int gridsize,
+		  int unreduced, int *nmiss, int *zip, double missval)
+{
+  int status = 0;
+#if  defined  (HAVE_LIBCGRIBEX)
+  int iret = 0, iword = 0;
+  int isec0[2], isec1[4096], isec2[4096], isec3[2], isec4[512];
+  int izip;
+  long unzipsize;
+  double fsec2[512], fsec3[2];
+  char hoper[2];
+
+  *zip = 0;
+
+  if ( unreduced ) strcpy(hoper, "R");
+  else             strcpy(hoper, "D");
+
+  FSEC3_MissVal = missval;
+
+  if ( (izip = gribGetZip(gribsize, gribbuffer, &unzipsize)) > 0 )
+    {
+      *zip = izip;
+      if ( izip == 128 ) /* szip */
+	{
+	  unsigned char *itmpbuffer = NULL;
+	  size_t itmpbuffersize = 0;
+
+	  if ( unzipsize < (long) gribsize )
+	    {
+	      fprintf(stderr, "Decompressed size smaller than compressed size (in %d; out %ld)!\n",
+		      gribsize, unzipsize);
+	      return (status);
+	    }
+
+	  if ( itmpbuffersize < (size_t) gribsize )
+	    {
+	      itmpbuffersize = gribsize;
+	      itmpbuffer = (unsigned char *) realloc(itmpbuffer, itmpbuffersize);
+	    }
+
+	  memcpy(itmpbuffer, gribbuffer, itmpbuffersize);
+
+	  unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+
+	  gribsize = gribUnzip(gribbuffer, unzipsize, itmpbuffer, gribsize);
+
+	  if ( gribsize <= 0 )
+	    Error("Decompression problem!");
+
+	  free(itmpbuffer);
+	}
+      else
+	{
+	  Error("Decompression for %d not implemented!", izip);
+	}
+    }
+
+  gribExDP(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, data,
+	   gridsize, (int *) gribbuffer, gribsize, &iword, hoper, &iret);
+
+  if ( ISEC1_Sec2Or3Flag & 64 )
+    *nmiss = ISEC4_NumValues - ISEC4_NumNonMissValues;
+  else
+    *nmiss = 0;
+
+  if ( ISEC1_CenterID == 215 && (isec1[34] != 0 && isec1[34] != 255) )
+    {
+      double undef_pds, undef_eps;
+      int i;
+
+      MCH_get_undef(isec1, &undef_pds, &undef_eps);
+
+      *nmiss = 0;
+      for ( i = 0; i < gridsize; i++ )
+        if ( (abs(data[i]-undef_pds) < undef_eps) || IS_EQUAL(data[i],FSEC3_MissVal) ) {
+          data[i] = missval;
+          (*nmiss)++;
+        }
+    }
+#else
+  Error("CGRIBEX support not compiled in!");
+#endif
+
+  return (status);
+}
+
+#if  defined  (HAVE_LIBCGRIBEX)
+static
+void cgribexDefInstitut(int *isec1, int vlistID, int varID)
+{
+  int instID;
+
+  if ( vlistInqInstitut(vlistID) != CDI_UNDEFID )
+    instID = vlistInqInstitut(vlistID);
+  else
+    instID = vlistInqVarInstitut(vlistID, varID);
+
+  if ( instID != CDI_UNDEFID )
+    {
+      int center, subcenter;
+      center    = institutInqCenter(instID);
+      subcenter = institutInqSubcenter(instID);
+      ISEC1_CenterID    = center;
+      ISEC1_SubCenterID = subcenter;
+    }
+}
+
+static
+void cgribexDefModel(int *isec1, int vlistID, int varID)
+{
+  int modelID;
+
+  if ( vlistInqModel(vlistID) != CDI_UNDEFID )
+    modelID = vlistInqModel(vlistID);
+  else
+    modelID = vlistInqVarModel(vlistID, varID);
+
+  if ( modelID != CDI_UNDEFID )
+    ISEC1_ModelID = modelInqGribID(modelID);
+}
+
+static
+void cgribexDefParam(int *isec1, int param)
+{
+  int pdis, pcat, pnum;
+
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+
+  if ( pnum < 0 ) pnum = -pnum;
+
+  if ( pdis != 255 )
+    {
+      char paramstr[32];
+      cdiParamToString(param, paramstr, sizeof(paramstr));
+      Warning("Can't convert GRIB2 parameter ID (%s) to GRIB1, set to %d.%d!", paramstr, pnum, pcat);
+    }
+
+  ISEC1_CodeTable = pcat;
+  ISEC1_Parameter = pnum;
+}
+
+static
+int cgribexDefTimerange(int tsteptype, int factor, int calendar,
+			int rdate, int rtime, int vdate, int vtime, int *pip1, int *pip2)
+{
+  int timerange = -1;
+  int year, month, day, hour, minute, second;
+  int julday1, secofday1, julday2, secofday2, days, secs;
+  int ip, ip1 = 0, ip2 = 0;
+
+  cdiDecodeDate(rdate, &year, &month, &day);
+  cdiDecodeTime(rtime, &hour, &minute, &second);
+  encode_juldaysec(calendar, year, month, day, hour, minute, &julday1, &secofday1);
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+  encode_juldaysec(calendar, year, month, day, hour, minute, &julday2, &secofday2);
+
+  (void) julday_sub(julday1, secofday1, julday2, secofday2, &days, &secs);
+
+  if ( !(int) fmod(days*86400.0 + secs, factor) )
+    {
+      ip = (int) ((days*86400.0 + secs)/factor);
+
+      switch ( tsteptype )
+	{
+	case TSTEP_INSTANT:  timerange =  0; ip1 = ip; ip2 = 0;  break;
+	case TSTEP_INSTANT2: timerange =  1; ip1 = 0;  ip2 = 0;  break;
+	case TSTEP_RANGE:    timerange =  2; ip1 = 0;  ip2 = ip; break;
+	case TSTEP_AVG:      timerange =  3; ip1 = 0;  ip2 = ip; break;
+	case TSTEP_ACCUM:    timerange =  4; ip1 = 0;  ip2 = ip; break;
+	case TSTEP_DIFF:     timerange =  5; ip1 = 0;  ip2 = ip; break;
+	case TSTEP_INSTANT3:
+	default:             timerange = 10; ip1 = ip/256; ip2 = ip%256;  break;
+	}
+    }
+
+  *pip1 = ip1;
+  *pip2 = ip2;
+
+  return (timerange);
+}
+
+static
+int cgribexDefDateTime(int *isec1, int timeunit, int date, int time)
+{
+  int year, month, day, hour, minute, second;
+  int century = 0;
+  int factor = 1;
+
+  cdiDecodeDate(date, &year, &month, &day);
+  cdiDecodeTime(time, &hour, &minute, &second);
+
+  century =  year / 100;
+
+  ISEC1_Year = year - century*100;
+
+  if ( year < 0 )
+    {
+      century = -century;
+      ISEC1_Year = -ISEC1_Year;
+    }
+
+  if ( ISEC1_Year == 0 )
+    {
+      century -= 1;
+      ISEC1_Year = 100;
+    }
+
+  century += 1;
+  if ( year < 0 ) century = -century;
+
+  ISEC1_Month  = month;
+  ISEC1_Day    = day;
+  ISEC1_Hour   = hour;
+  ISEC1_Minute = minute;
+
+  ISEC1_Century = century;
+
+  switch (timeunit)
+    {
+    case TUNIT_MINUTE:  factor =    60; ISEC1_TimeUnit = ISEC1_TABLE4_MINUTE;  break;
+    case TUNIT_QUARTER: factor =   900; ISEC1_TimeUnit = ISEC1_TABLE4_QUARTER; break;
+    case TUNIT_HOUR:    factor =  3600; ISEC1_TimeUnit = ISEC1_TABLE4_HOUR;    break;
+    case TUNIT_3HOURS:  factor = 10800; ISEC1_TimeUnit = ISEC1_TABLE4_3HOURS;  break;
+    case TUNIT_6HOURS:  factor = 21600; ISEC1_TimeUnit = ISEC1_TABLE4_6HOURS;  break;
+    case TUNIT_12HOURS: factor = 43200; ISEC1_TimeUnit = ISEC1_TABLE4_12HOURS; break;
+    case TUNIT_DAY:     factor = 86400; ISEC1_TimeUnit = ISEC1_TABLE4_DAY;     break;
+    default:            factor =  3600; ISEC1_TimeUnit = ISEC1_TABLE4_HOUR;    break;
+    }
+
+  return (factor);
+}
+
+static
+void cgribexDefTime(int *isec1, int vdate, int vtime, int tsteptype, int numavg, int taxisID)
+{
+  int timetype = -1;
+  int timerange = 0;
+  int timeunit;
+
+  if ( taxisID != -1 ) timetype = taxisInqType(taxisID);
+
+  timeunit = taxisInqTunit(taxisID);
+
+  if ( timetype == TAXIS_RELATIVE )
+    {
+      int factor = 1;
+      int rdate, rtime;
+      int ip1 = 0, ip2 = 0;
+      int calendar;
+
+      calendar = taxisInqCalendar(taxisID);
+      rdate    = taxisInqRdate(taxisID);
+      rtime    = taxisInqRtime(taxisID);
+
+      factor = cgribexDefDateTime(isec1, timeunit, rdate, rtime);
+
+      timerange = cgribexDefTimerange(tsteptype, factor, calendar,
+				      rdate, rtime, vdate, vtime, &ip1, &ip2);
+
+      if ( timerange == -1 || timerange == 3 )
+	{
+	  timetype = TAXIS_ABSOLUTE;
+	}
+      /*
+      else if ( timerange == 10 )
+	{
+	  if ( ip1 < 0 || ip1 > 0xFFFF ) timetype = TAXIS_ABSOLUTE;
+	  if ( ip2 < 0 || ip2 > 0xFFFF ) timetype = TAXIS_ABSOLUTE;
+	}
+      */
+      else
+	{
+	  if ( ip1 < 0 || ip1 > 0xFF   ) timetype = TAXIS_ABSOLUTE;
+	  if ( ip2 < 0 || ip2 > 0xFF   ) timetype = TAXIS_ABSOLUTE;
+	}
+
+      ISEC1_TimeRange   = timerange;
+      ISEC1_TimePeriod1 = ip1;
+      ISEC1_TimePeriod2 = ip2;
+    }
+
+  if ( timetype == TAXIS_ABSOLUTE )
+    {
+      (void) cgribexDefDateTime(isec1, timeunit, vdate, vtime);
+
+      /*
+      if ( numavg > 0 )
+	ISEC1_TimeRange = 0;
+      else
+      */
+      if ( ISEC1_TimeRange != 3 )
+	ISEC1_TimeRange   = 10;
+
+      ISEC1_TimePeriod1 = 0;
+      ISEC1_TimePeriod2 = 0;
+    }
+
+  ISEC1_AvgNum         = numavg;
+  ISEC1_AvgMiss        = 0;
+  ISEC1_DecScaleFactor = 0;
+}
+
+static
+void cgribexDefGrid(int *isec1, int *isec2, int *isec4, int gridID)
+{
+  int gridtype;
+  int lcurvi = FALSE;
+  static short lwarn = TRUE;
+
+  memset(isec2, 0, 16*sizeof(int));
+
+  ISEC1_Sec2Or3Flag = 128;
+
+  gridtype = gridInqType(gridID);
+
+  ISEC1_GridDefinition = 255;
+
+  if ( gridtype == GRID_GENERIC )
+    {
+      int xsize, ysize, gridsize;
+
+      gridsize = gridInqSize(gridID);
+      xsize = gridInqXsize(gridID);
+      ysize = gridInqYsize(gridID);
+
+      if ( (ysize ==  32 || ysize ==  48 || ysize ==  64 ||
+	    ysize ==  96 || ysize == 160 || ysize == 192 ||
+	    ysize == 240 || ysize == 320 || ysize == 384 ||
+	    ysize == 480 || ysize == 768 ) && 
+	   (xsize == 2*ysize || xsize == 1) )
+	{
+	  gridtype = GRID_GAUSSIAN;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( gridsize == 1 )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( gridInqXvals(gridID, NULL) && gridInqYvals(gridID, NULL) )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+    }
+  else if ( gridtype == GRID_CURVILINEAR )
+    {
+      if ( lwarn && gridInqSize(gridID) > 1 )
+	{
+	  lwarn = FALSE;
+	  Warning("Curvilinear grids are unsupported in GRIB1! Created wrong GDS!");
+	}
+      gridtype = GRID_LONLAT;
+      lcurvi = TRUE;
+    }
+
+  ISEC2_Reduced  = FALSE;
+  ISEC2_ScanFlag = 0;
+
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_GAUSSIAN_REDUCED:
+    case GRID_TRAJECTORY:
+      {
+	int nlon = 0, nlat;
+	double xfirst = 0, xlast = 0, xinc = 0;
+	double yfirst = 0, ylast = 0, yinc = 0;
+
+	if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
+          ISEC2_GridType = GRIB1_GTYPE_GAUSSIAN;
+        else if ( gridtype == GRID_LONLAT && gridIsRotated(gridID) )
+	  ISEC2_GridType = GRIB1_GTYPE_LATLON_ROT;
+	else
+	  ISEC2_GridType = GRIB1_GTYPE_LATLON;
+
+	nlon = gridInqXsize(gridID);
+	nlat = gridInqYsize(gridID);
+
+	if ( gridtype == GRID_GAUSSIAN_REDUCED )
+	  {
+	    ISEC2_Reduced = TRUE;
+	    nlon = 0;
+	    gridInqRowlon(gridID, ISEC2_RowLonPtr);
+	  }
+	else
+	  {
+	    if ( nlon == 0 )
+	      {
+		nlon = 1;
+	      }
+	    else
+	      {
+		xfirst = gridInqXval(gridID,      0);
+		if ( lcurvi )
+		  xlast  = gridInqXval(gridID, nlon*nlat-1);
+		else
+		  xlast  = gridInqXval(gridID, nlon-1);
+		xinc   = gridInqXinc(gridID);
+	      }
+	  }
+
+	if ( nlat == 0 )
+	  {
+	    nlat = 1;
+	  }
+	else
+	  {
+	    yfirst = gridInqYval(gridID,      0);
+	    if ( lcurvi )
+	      ylast  = gridInqYval(gridID, nlon*nlat-1);
+	    else
+	      ylast  = gridInqYval(gridID, nlat-1);
+	    yinc   = gridInqYinc(gridID);
+	    if ( yinc < 0 ) yinc = -yinc;
+	  }
+
+	ISEC2_NumLon   = nlon;
+	ISEC2_NumLat   = nlat;
+	ISEC2_FirstLat = NINT(yfirst*1000);
+	ISEC2_LastLat  = NINT(ylast*1000);
+	if ( gridtype == GRID_GAUSSIAN_REDUCED )
+	  {
+	    ISEC2_FirstLon = 0;
+	    ISEC2_LastLon  = NINT(1000*(360.-360./(nlat*2)));
+	    ISEC2_LonIncr  = NINT(1000*360./(nlat*2));
+	  }
+	else
+	  {
+	    ISEC2_FirstLon = NINT(xfirst*1000);
+	    ISEC2_LastLon  = NINT(xlast*1000);
+	    ISEC2_LonIncr  = NINT(xinc*1000);
+	  }
+
+	// if ( fabs(xinc*1000 - ISEC2_LonIncr) > FLT_EPSILON ) ISEC2_LonIncr = 0;
+
+	if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
+          {
+            int np = gridInqNP(gridID);
+            if ( np == 0 ) np = nlat/2;
+            ISEC2_NumPar = np;
+          }
+	else
+	  {
+	    ISEC2_LatIncr = NINT(yinc*1000);
+	    // if ( fabs(yinc*1000 - ISEC2_LatIncr) > FLT_EPSILON ) ISEC2_LatIncr = 0;
+
+	    if ( ISEC2_LatIncr < 0 ) ISEC2_LatIncr = -ISEC2_LatIncr;
+	  }
+
+	if ( ISEC2_NumLon > 1 && ISEC2_NumLat == 1 )
+	  if ( ISEC2_LonIncr != 0 && ISEC2_LatIncr == 0 ) ISEC2_LatIncr = ISEC2_LonIncr;
+
+	if ( ISEC2_NumLon == 1 && ISEC2_NumLat > 1 )
+	  if ( ISEC2_LonIncr == 0 && ISEC2_LatIncr != 0 ) ISEC2_LonIncr = ISEC2_LatIncr;
+
+	if ( ISEC2_LatIncr == 0 || ISEC2_LonIncr == 0 )
+	  ISEC2_ResFlag = 0;
+	else
+	  ISEC2_ResFlag = 128;
+
+	if ( gridIsRotated(gridID) )
+	  {
+	    ISEC2_LatSP = - NINT(gridInqYpole(gridID) * 1000);
+	    ISEC2_LonSP =   NINT((gridInqXpole(gridID) + 180) * 1000);
+	  }
+
+	/* East -> West */
+	if ( ISEC2_LastLon < ISEC2_FirstLon ) ISEC2_ScanFlag += 128;
+
+	/* South -> North */
+	if ( ISEC2_LastLat > ISEC2_FirstLat ) ISEC2_ScanFlag += 64;
+
+	break;
+      }
+    case GRID_LCC:
+      {
+	double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
+	int xsize, ysize;
+	int projflag, scanflag;
+
+	xsize = gridInqXsize(gridID);
+	ysize = gridInqYsize(gridID);
+
+	gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm,
+		   &projflag, &scanflag);
+
+	ISEC2_GridType = GRIB1_GTYPE_LCC;
+	ISEC2_NumLon   = xsize;
+	ISEC2_NumLat   = ysize;
+	ISEC2_FirstLon = NINT(originLon * 1000);
+	ISEC2_FirstLat = NINT(originLat * 1000);
+	ISEC2_Lambert_Lov    = NINT(lonParY * 1000);
+	ISEC2_Lambert_LatS1  = NINT(lat1 * 1000);
+	ISEC2_Lambert_LatS2  = NINT(lat2 * 1000);
+	ISEC2_Lambert_dx     = NINT(xincm);
+	ISEC2_Lambert_dy     = NINT(yincm);
+	ISEC2_Lambert_LatSP  = 0;
+	ISEC2_Lambert_LatSP  = 0;
+	ISEC2_Lambert_ProjFlag = projflag;
+	ISEC2_ScanFlag = scanflag;
+
+	break;
+      }
+    case GRID_SPECTRAL:
+      {
+	ISEC2_GridType = GRIB1_GTYPE_SPECTRAL;
+	ISEC2_PentaJ   = gridInqTrunc(gridID);
+	ISEC2_PentaK   = ISEC2_PentaJ;
+	ISEC2_PentaM   = ISEC2_PentaJ;
+	ISEC2_RepType  = 1;
+	isec4[2]       = 128;
+	if ( gridInqComplexPacking(gridID) && ISEC2_PentaJ >= 21 )
+	  {
+	    ISEC2_RepMode  = 2;
+	    isec4[3]       = 64;
+	    isec4[16]      = 0;
+	    isec4[17]      = 20;
+	    isec4[18]      = 20;
+	    isec4[19]      = 20;
+	  }
+	else
+	  {
+	    ISEC2_RepMode  = 1;
+	    isec4[3]       = 0;
+	  }
+	break;
+      }
+    case GRID_GME:
+      {
+	ISEC2_GridType   = GRIB1_GTYPE_GME;
+	ISEC2_GME_ND     = gridInqGMEnd(gridID);
+	ISEC2_GME_NI     = gridInqGMEni(gridID);
+	ISEC2_GME_NI2    = gridInqGMEni2(gridID);
+	ISEC2_GME_NI3    = gridInqGMEni3(gridID);
+	ISEC2_GME_AFlag  = 0;
+	ISEC2_GME_LatPP  = 90000;
+	ISEC2_GME_LonPP  = 0;
+	ISEC2_GME_LonMPL = 0;
+	ISEC2_GME_BFlag  = 0;
+	break;
+      }
+    default:
+      {
+	Warning("The CGRIBEX library can not store fields on the used grid!");
+	Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+      }
+    }
+}
+
+static
+void cgribexDefLevel(int *isec1, int *isec2, double *fsec2, int zaxisID, int levelID)
+{
+  double level;
+  int ilevel, zaxistype, ltype;
+  static int warning = 1;
+  static int vct_warning = 1;
+
+  zaxistype = zaxisInqType(zaxisID);
+  ltype = zaxisInqLtype(zaxisID);
+
+  if ( zaxistype == ZAXIS_GENERIC && ltype == 0 )
+    {
+      Message("Changed zaxis type from %s to %s",
+	      zaxisNamePtr(zaxistype),
+	      zaxisNamePtr(ZAXIS_PRESSURE));
+      zaxistype = ZAXIS_PRESSURE;
+      zaxisChangeType(zaxisID, zaxistype);
+      zaxisDefUnits(zaxisID, "Pa");
+    }
+
+  ISEC2_NumVCP = 0;
+
+  switch (zaxistype)
+    {
+    case ZAXIS_SURFACE:
+      {
+	ISEC1_LevelType = GRIB1_LTYPE_SURFACE;
+	ISEC1_Level1    = (int) zaxisInqLevel(zaxisID, levelID);
+	ISEC1_Level2    = 0;
+	break;
+      }
+    case ZAXIS_TOA:
+      {
+	ISEC1_LevelType = GRIB1_LTYPE_TOA;
+	ISEC1_Level1    = 0;
+	ISEC1_Level2    = 0;
+	break;
+      }
+    case ZAXIS_SEA_BOTTOM:
+      {
+	ISEC1_LevelType = GRIB1_LTYPE_SEA_BOTTOM;
+	ISEC1_Level1    = 0;
+	ISEC1_Level2    = 0;
+	break;
+      }
+    case ZAXIS_ATMOSPHERE:
+      {
+	ISEC1_LevelType = GRIB1_LTYPE_ATMOSPHERE;
+	ISEC1_Level1    = 0;
+	ISEC1_Level2    = 0;
+	break;
+      }
+    case ZAXIS_MEANSEA:
+      {
+	ISEC1_LevelType = GRIB1_LTYPE_MEANSEA;
+	ISEC1_Level1    = (int) zaxisInqLevel(zaxisID, levelID);
+	ISEC1_Level2    = 0;
+	break;
+      }
+    case ZAXIS_HYBRID:
+    case ZAXIS_HYBRID_HALF:
+      {
+	int vctsize;
+
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+	    ISEC1_LevelType = GRIB1_LTYPE_HYBRID_LAYER;
+	    ISEC1_Level1    = (int) zaxisInqLbound(zaxisID, levelID);
+	    ISEC1_Level2    = (int) zaxisInqUbound(zaxisID, levelID);
+	  }
+	else
+	  {
+	    ISEC1_LevelType = GRIB1_LTYPE_HYBRID;
+	    ISEC1_Level1    = (int) zaxisInqLevel(zaxisID, levelID);
+	    ISEC1_Level2    = 0;
+	  }
+
+	vctsize = zaxisInqVctSize(zaxisID);
+	if ( vctsize == 0 && warning )
+	  {
+	    Warning("VCT missing. ( param = %d, zaxisID = %d )", ISEC1_Parameter, zaxisID);
+	    warning = 0;
+	  }
+	if ( vctsize > 255 )
+	  {
+	    ISEC2_NumVCP = 0;
+	    if ( vct_warning )
+	      {
+		Warning("VCT size of %d is too large (maximum is 255). Set to 0!", vctsize);
+		vct_warning = 0;
+	      }
+	  }
+	else
+	  {
+	    ISEC2_NumVCP = vctsize;
+	    zaxisInqVct(zaxisID, &fsec2[10]);
+	  }
+	break;
+      }
+    case ZAXIS_PRESSURE:
+      {
+	double dum;
+	char units[128];
+
+	level = zaxisInqLevel(zaxisID, levelID);
+	if ( level < 0 )
+	  Warning("Pressure level of %f Pa is below zero!", level);
+
+	zaxisInqUnits(zaxisID, units);
+	if ( memcmp(units, "Pa", 2) != 0 ) level *= 100;
+
+	ilevel = (int) level;
+	if ( level < 32768 && (level < 100 || modf(level/100, &dum) > 0) )
+	  {
+	    ISEC1_LevelType = GRIB1_LTYPE_99;
+	    ISEC1_Level1    = ilevel;
+	    ISEC1_Level2    = 0;
+	  }
+	else
+	  {
+	    ISEC1_LevelType = GRIB1_LTYPE_ISOBARIC;
+	    ISEC1_Level1    = ilevel/100;
+	    ISEC1_Level2    = 0;
+	  }
+	break;
+      }
+    case ZAXIS_HEIGHT:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	ISEC1_LevelType = GRIB1_LTYPE_HEIGHT;
+	ISEC1_Level1    = ilevel;
+	ISEC1_Level2    = 0;
+
+	break;
+      }
+    case ZAXIS_ALTITUDE:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	ISEC1_LevelType = GRIB1_LTYPE_ALTITUDE;
+	ISEC1_Level1    = ilevel;
+	ISEC1_Level2    = 0;
+
+	break;
+      }
+    case ZAXIS_SIGMA:
+      {
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+	    ISEC1_LevelType = GRIB1_LTYPE_SIGMA_LAYER;
+	    ISEC1_Level1    = (int) zaxisInqLbound(zaxisID, levelID);
+	    ISEC1_Level2    = (int) zaxisInqUbound(zaxisID, levelID);
+	  }
+	else
+	  {
+            level = zaxisInqLevel(zaxisID, levelID);
+
+            ilevel = (int) level;
+            ISEC1_LevelType = GRIB1_LTYPE_SIGMA;
+            ISEC1_Level1    = ilevel;
+            ISEC1_Level2    = 0;
+          }
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_LAND:
+      {
+	char units[128];
+	double factor;
+
+	zaxisInqUnits(zaxisID, units);
+
+        if      ( memcmp(units, "mm", 2) == 0 ) factor =   0.1;
+        else if ( memcmp(units, "cm", 2) == 0 ) factor =   1;
+        else if ( memcmp(units, "dm", 2) == 0 ) factor =  10;
+        else                                    factor = 100; // meter
+
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+            double level1, level2;
+            level1 = zaxisInqLbound(zaxisID, levelID);
+            level2 = zaxisInqUbound(zaxisID, levelID);
+	    ISEC1_LevelType = GRIB1_LTYPE_LANDDEPTH_LAYER;
+	    ISEC1_Level1    = (int) (level1*factor);
+	    ISEC1_Level2    = (int) (level2*factor);
+	  }
+	else
+	  {
+	    level = zaxisInqLevel(zaxisID, levelID);
+
+	    ilevel = (int) (level*factor);
+	    ISEC1_LevelType = GRIB1_LTYPE_LANDDEPTH;
+	    ISEC1_Level1    = ilevel;
+	    ISEC1_Level2    = 0;
+	  }
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_SEA:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	ISEC1_LevelType = GRIB1_LTYPE_SEADEPTH;
+	ISEC1_Level1    = ilevel;
+	ISEC1_Level2    = 0;
+
+	break;
+      }
+    case ZAXIS_ISENTROPIC:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	ISEC1_LevelType = GRIB1_LTYPE_ISENTROPIC;
+	ISEC1_Level1    = ilevel;
+	ISEC1_Level2    = 0;
+
+	break;
+      }
+    case ZAXIS_GENERIC:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	ISEC1_LevelType = ltype;
+	ISEC1_Level1    = ilevel;
+	ISEC1_Level2    = 0;
+
+	break;
+      }
+    default:
+      {
+	Error("Unsupported zaxis type: %s", zaxisNamePtr(zaxistype));
+	break;
+      }
+    }
+}
+
+static
+void cgribexDefMask(int *isec3)
+{
+}
+
+static
+void cgribexDefaultSec0(int *isec0)
+{
+  ISEC0_GRIB_Len     = 0;
+  ISEC0_GRIB_Version = 0;
+}
+
+static
+void cgribexDefaultSec1(int *isec1)
+{
+  ISEC1_CenterID    = 0;
+  ISEC1_SubCenterID = 0;
+  ISEC1_LocalFLag   = 0;
+}
+
+static
+void cgribexDefaultSec4(int *isec4)
+{
+  long i;
+
+  for ( i = 2; i <= 10; ++i ) isec4[i] = 0;
+}
+
+static
+void cgribexDefEnsembleVar(int *isec1, int vlistID, int varID)
+{
+  int ensID, ensCount, forecast_type;
+
+  /* For Ensemble info  */
+
+  //Put1Byte(isec1[36]);        /* MPIM local GRIB use definition identifier  */
+                                /*    (extension identifier)                  */
+  //Put1Byte(isec1[37]);        /* type of ensemble forecast                  */
+  //Put2Byte(isec1[38]);        /* individual ensemble member                 */
+  //Put2Byte(isec1[39]);        /* number of forecasts in ensemble            */
+
+  if ( vlistInqVarEnsemble(vlistID, varID, &ensID, &ensCount, &forecast_type) )
+    {
+      if ( ISEC1_CenterID == 252 )
+        {
+          ISEC1_LocalFLag = 1;
+          isec1[36] = 1;
+
+          isec1[37] =  forecast_type;
+          isec1[38] =  ensID;
+          isec1[39] =  ensCount;
+        }
+    }
+}
+#endif
+
+
+size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisID,
+		     int vdate, int vtime, int tsteptype, int numavg,
+		     long datasize, const double *data, int nmiss, unsigned char *gribbuffer, size_t gribbuffersize)
+{
+  size_t nbytes = 0;
+#if  defined  (HAVE_LIBCGRIBEX)
+  long gribsize;
+  int iret = 0, iword = 0;
+  int isec0[2], isec1[4096], isec2[4096], isec3[2], isec4[512];
+  double fsec2[512], fsec3[2];
+  int datatype;
+  int param;
+
+  memset(isec1, 0, 256*sizeof(int));
+  fsec2[0] = 0; fsec2[1] = 0;
+
+  gribsize = gribbuffersize / sizeof(int);
+  param    = vlistInqVarParam(vlistID, varID);
+
+  cgribexDefaultSec0(isec0);
+  cgribexDefaultSec1(isec1);
+  cgribexDefaultSec4(isec4);
+
+  cgribexDefInstitut(isec1, vlistID, varID);
+  cgribexDefModel(isec1, vlistID, varID);
+
+  datatype = vlistInqVarDatatype(vlistID, varID);
+
+  cgribexDefParam(isec1, param);
+  cgribexDefTime(isec1, vdate, vtime, tsteptype, numavg, vlistInqTaxis(vlistID));
+  cgribexDefGrid(isec1, isec2, isec4, gridID);
+  cgribexDefLevel(isec1, isec2, fsec2, zaxisID, levelID);
+  cgribexDefMask(isec3);
+
+  cgribexDefEnsembleVar(isec1, vlistID, varID);
+
+  ISEC4_NumValues = gridInqSize(gridID);
+  ISEC4_NumBits   = grbBitsPerValue(datatype);
+
+  if ( nmiss > 0 )
+    {
+      FSEC3_MissVal = vlistInqVarMissval(vlistID, varID);
+      ISEC1_Sec2Or3Flag |= 64;
+    }
+
+  if ( isec4[2] == 128 && isec4[3] == 64 )
+    {
+      isec4[16] = (int) (1000*calculate_pfactor(data, ISEC2_PentaJ, isec4[17]));
+      if ( isec4[16] < -10000 ) isec4[16] = -10000;
+      if ( isec4[16] >  10000 ) isec4[16] =  10000;
+    }
+  //printf("isec4[16] %d\n", isec4[16]);
+
+  gribExDP(isec0, isec1, isec2, fsec2, isec3, fsec3, isec4, (double*) data,
+	   datasize, (int *) gribbuffer, gribsize, &iword, "C", &iret);
+
+  if ( iret ) Error("Problem during GRIB encode (errno = %d)!", iret);
+
+  nbytes = iword*sizeof(int);
+#else
+  Error("CGRIBEX support not compiled in!");
+#endif
+
+  return (nbytes);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_cgribex.h b/libcdi/src/stream_cgribex.h
new file mode 100644
index 0000000..de320c1
--- /dev/null
+++ b/libcdi/src/stream_cgribex.h
@@ -0,0 +1,24 @@
+#ifndef _STREAM_CGRIBEX_H
+#define _STREAM_CGRIBEX_H
+
+int cgribexScanTimestep1(int streamID);
+int cgribexScanTimestep2(int streamID);
+int cgribexScanTimestep(int streamID);
+
+int cgribexDecode(unsigned char *gribbuffer, int gribsize, double *data, int gridsize,
+		  int unreduced, int *nmiss, int *zip, double missval);
+
+size_t cgribexEncode(int varID, int levelID, int vlistID, int gridID, int zaxisID,
+		     int vdate, int vtime, int tsteptype, int numavg, 
+		     long datasize, const double *data, int nmiss, unsigned char *gribbuffer, size_t gribbuffersize);
+
+#endif  /* _STREAM_CGRIBEX_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_ext.c b/libcdi/src/stream_ext.c
new file mode 100644
index 0000000..4b32c72
--- /dev/null
+++ b/libcdi/src/stream_ext.c
@@ -0,0 +1,1070 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+#include "dmemory.h"
+
+#include "error.h"
+#include "file.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "varscan.h"
+#include "datetime.h"
+#include "extra.h"
+#include "vlist.h"
+
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+#define SINGLE_PRECISION  4
+#define DOUBLE_PRECISION  8
+
+#if defined (HAVE_LIBEXTRA)
+
+
+typedef struct {
+  int param;
+  int level;
+} extcompvar_t; 
+
+static
+int extInqDatatype(int prec, int number)
+{
+  int datatype;
+
+  if ( number == 2 )
+    {
+      if ( prec == DOUBLE_PRECISION ) datatype = DATATYPE_CPX64;
+      else                            datatype = DATATYPE_CPX32;
+    }
+  else
+    {
+      if ( prec == DOUBLE_PRECISION ) datatype = DATATYPE_FLT64;
+      else                            datatype = DATATYPE_FLT32;
+    }
+
+  return (datatype);
+}
+
+static
+void extDefDatatype(int datatype, int *prec, int *number)
+{
+
+  if ( datatype != DATATYPE_FLT32 && datatype != DATATYPE_FLT64 &&
+       datatype != DATATYPE_CPX32 && datatype != DATATYPE_CPX64 )
+    datatype = DATATYPE_FLT32;
+
+  if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    *number = 2;
+  else
+    *number = 1;
+
+  if ( datatype == DATATYPE_FLT64 || datatype == DATATYPE_CPX64 )
+    *prec = DOUBLE_PRECISION;
+  else 
+    *prec = SINGLE_PRECISION;
+}
+
+/* not used
+int extInqRecord(int streamID, int *varID, int *levelID)
+{
+  int status;
+  int fileID;
+  int icode, ilevel;
+  int zaxisID = -1;
+  int header[4];
+  int vlistID;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  extp    = streamptr->record->extp;
+
+  *varID   = -1;
+  *levelID = -1;
+
+  status = extRead(fileID, extp);
+  if ( status != 0 ) return (0);
+
+  extInqHeader(extp, header);
+
+  icode  = header[1];
+  ilevel = header[2];
+
+  *varID = vlistInqVarID(vlistID, icode);
+
+  if ( *varID == UNDEFID ) Error("Code %d undefined", icode);
+
+  zaxisID = vlistInqVarZaxis(vlistID, *varID);
+
+  *levelID = zaxisInqLevelID(zaxisID, (double) ilevel);
+  
+  return (1);
+}
+*/
+
+int extReadRecord(int streamID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int status;
+  int recID, vrecID, tsID;
+  off_t recpos;
+  int header[4];
+  int varID, gridID;
+  int i, size;
+  double missval;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  tsID    = streamptr->curTsID;
+  vrecID  = streamptr->tsteps[tsID].curRecID;
+  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr->tsteps[tsID].records[recID].position;
+  varID   = streamptr->tsteps[tsID].records[recID].varID;
+  extp    = streamptr->record->extp;
+
+  fileSetPos(fileID, recpos, SEEK_SET);
+
+  status = extRead(fileID, extp);
+  if ( status != 0 ) return (0);
+
+  extInqHeader(extp, header);
+  extInqDataDP(extp, data);
+
+  missval = vlistInqVarMissval(vlistID, varID);
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  size    = gridInqSize(gridID);
+
+  streamptr->numvals += size;
+
+  *nmiss = 0;
+  if ( vlistInqVarNumber(vlistID, varID) == CDI_REAL )
+    {
+      for ( i = 0; i < size; i++ )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+  else
+    {
+      for ( i = 0; i < 2*size; i+=2 )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+
+  return (1);
+}
+
+
+int extCopyRecord(int streamID2, int streamID1)
+{
+  int fileID1, fileID2;
+  int tsID, recID, vrecID;
+  long recsize;
+  off_t recpos;
+  int status = 0;
+  char *buffer;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  fileID1 = streamInqFileID(streamID1);
+  fileID2 = streamInqFileID(streamID2);
+
+  tsID    = streamptr1->curTsID;
+  vrecID  = streamptr1->tsteps[tsID].curRecID;
+  recID   = streamptr1->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr1->tsteps[tsID].records[recID].position;
+  recsize = streamptr1->tsteps[tsID].records[recID].size;
+
+  fileSetPos(fileID1, recpos, SEEK_SET);
+
+  buffer = (char *) malloc(recsize);
+
+  fileRead(fileID1, buffer, recsize);
+
+  fileWrite(fileID2, buffer, recsize);
+
+  free(buffer);
+
+  return (status);
+}
+
+
+int extDefRecord(int streamID)
+{
+  int gridID;
+  int header[4];
+  int status = 0;
+  int pdis, pcat, pnum;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  gridID   = streamptr->record->gridID;
+  extp     = streamptr->record->extp;
+
+  cdiDecodeParam(streamptr->record->param, &pnum, &pcat, &pdis);
+  header[0] = streamptr->record->date;
+  header[1] = pnum;
+  header[2] = streamptr->record->level;
+  header[3] = gridInqSize(gridID);
+
+  extDefDatatype(streamptr->record->prec, &extp->prec, &extp->number);
+
+  extDefHeader(extp, header);
+
+  return (status);
+}
+
+
+int extWriteRecord(int streamID, const double *data)
+{
+  int fileID;
+  int status = 0;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+  extp   = streamptr->record->extp;
+
+  extDefDataDP(extp, data);
+
+  extWrite(fileID, extp);
+
+  return (status);
+}
+
+static
+void extAddRecord(int streamID, int param, int level, int xysize,
+		  long recsize, off_t position, int prec, int number)
+{
+  int leveltype;
+  int gridID = UNDEFID;
+  int levelID = 0;
+  int tsID, recID, varID;
+  record_t *record;
+  grid_t grid;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  tsID    = streamptr->curTsID;
+  recID   = recordNewEntry(streamID, tsID);
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  (*record).size     = recsize;
+  (*record).position = position;
+  (*record).param     = param;
+  (*record).ilevel   = level;
+
+  memset(&grid, 0, sizeof(grid_t));
+  grid.type  = GRID_GENERIC;
+  grid.size  = xysize;
+  grid.xsize = xysize;
+  grid.ysize = 0;
+  grid.xvals = NULL;
+  grid.yvals = NULL;
+  gridID = varDefGrid(vlistID, grid, 0);
+  /*
+  if ( level == 0 ) leveltype = ZAXIS_SURFACE;
+  else              leveltype = ZAXIS_GENERIC;
+  */
+  leveltype = ZAXIS_GENERIC;
+
+  varAddRecord(recID, param, gridID, leveltype, 0, level, 0,
+	       extInqDatatype(prec, number), &varID, &levelID, UNDEFID, 0, 0, NULL, NULL, NULL);
+
+  (*record).varID   = varID;
+  (*record).levelID = levelID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+
+  if ( CDI_Debug )
+    Message("varID = %d gridID = %d levelID = %d",
+	    varID, gridID, levelID);
+}
+
+
+void extCmpRecord(int streamID, int tsID, int recID, off_t position, int param,
+		  int level, int xysize)
+{
+  int varID = 0;
+  int levelID = 0;
+  record_t *record;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  if ( param != (*record).param || level != (*record).ilevel )
+    Error("inconsistent timestep");
+
+  (*record).position = position;
+  /*
+  varID   = (*record).varID;
+  levelID = (*record).levelID;
+
+  streamptr->vars[varID].level[levelID] = recID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+  */
+  if ( CDI_Debug )
+    Message("varID = %d levelID = %d", varID, levelID);
+}
+
+static
+void extScanTimestep1(int streamID)
+{  
+  int header[4];
+  int status;
+  int fileID;
+  int rxysize = 0;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos;
+  int nrecords, nrecs, recID;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  extcompvar_t compVar, compVar0;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 0;
+
+  extp  = streamptr->record->extp;
+  tsID  = tstepsNewEntry(streamID);
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( tsID != 0 )
+    Error("Internal problem! tstepsNewEntry returns %d", tsID);
+
+  fileID = streamInqFileID(streamID);
+
+  nrecs = 0;
+  while ( TRUE )
+    {
+      recpos = fileGetPos(fileID);
+      status = extRead(fileID, extp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 1;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      extInqHeader(extp, header);
+
+      vdate   = header[0];
+      vtime   = 0;
+      rcode   = header[1];
+      rlevel  = header[2];
+      rxysize = header[3];
+
+      param = cdiEncodeParam(rcode, 255, 255);
+
+      if ( nrecs == 0 )
+	{
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	}
+      else
+	{
+	  datetime.date = vdate;
+	  datetime.time = vtime;
+	  compVar.param = param;
+          compVar.level = rlevel;
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      compVar0.param  = streamptr->tsteps[0].records[recID].param;
+	      compVar0.level = streamptr->tsteps[0].records[recID].ilevel;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(extcompvar_t)) == 0 ) break;
+	    }
+	  if ( recID < nrecs ) break;
+	  if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) )
+	    Warning("Inconsistent verification time for code %d level %d", rcode, rlevel);
+	}
+
+      nrecs++;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", nrecs, (int)recpos, rcode, rlevel, vdate, vtime);
+
+      extAddRecord(streamID, param, rlevel, rxysize, recsize, recpos, extp->prec, extp->number);
+    }
+
+  streamptr->rtsteps = 1;
+
+  cdiGenVars(streamID);
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+  taxis->type  = TAXIS_ABSOLUTE;
+  taxis->vdate = datetime0.date;
+  taxis->vtime = datetime0.time;
+
+  vlistID = streamInqVlist(streamID);
+  vlistDefTaxis(vlistID, taxisID);
+
+  cdiCheckContents(streamID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  if ( nrecords < streamptr->tsteps[0].recordSize )
+    {
+      streamptr->tsteps[0].recordSize = nrecords;
+      streamptr->tsteps[0].records =
+      (record_t *) realloc(streamptr->tsteps[0].records, nrecords*sizeof(record_t));
+    }
+
+  streamptr->tsteps[0].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[0].nrecs = nrecords;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[0].recIDs[recID] = recID;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( streamptr->ntsteps == 1 )
+    {
+      if ( taxis->vdate == 0 && taxis->vtime == 0 )
+	{
+	  streamptr->ntsteps = 0;
+	  for ( varID = 0; varID < streamptr->nvars; varID++ )
+	    {
+	      vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	    }
+	}
+    }
+}
+
+static
+int extScanTimestep2(int streamID)
+{  
+  int header[4];
+  int status;
+  int fileID;
+  // int rxysize = 0;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos = 0;
+  int nrecords, nrecs, recID, rindex;
+  int nextstep;
+  taxis_t *taxis;
+  int vlistID;
+  extcompvar_t compVar, compVar0;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 1;
+
+  fileID  = streamInqFileID(streamID);
+  vlistID = streamInqVlist(streamID);
+  extp    = streamptr->record->extp;
+
+  tsID = streamptr->rtsteps;
+  if ( tsID != 1 )
+    Error("Internal problem! unexpeceted timestep %d", tsID+1);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+  cdiCreateRecords(streamID, tsID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[1].nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[1].recIDs[recID] = -1;
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID = streamptr->tsteps[0].records[recID].varID;
+      streamptr->tsteps[tsID].records[recID].position = 
+	streamptr->tsteps[0].records[recID].position;
+      streamptr->tsteps[tsID].records[recID].size     = 
+	streamptr->tsteps[0].records[recID].size;
+    }
+
+  for ( rindex = 0; rindex <= nrecords; rindex++ )
+    {
+      recpos = fileGetPos(fileID);
+      status = extRead(fileID, extp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 2;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      extInqHeader(extp, header);
+
+      vdate  = header[0];
+      vtime  = 0;
+      rcode  = header[1];
+      rlevel = header[2];
+      // rxysize = header[3];
+
+      param = cdiEncodeParam(rcode, 255, 255);
+
+      if ( rindex == 0 )
+	{
+	  taxis->type  = TAXIS_ABSOLUTE;
+	  taxis->vdate = vdate;
+	  taxis->vtime = vtime;
+	}
+
+      compVar.param = param;
+      compVar.level = rlevel;
+      nextstep = FALSE;
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(extcompvar_t)) == 0 )
+	    {
+	      if ( streamptr->tsteps[tsID].records[recID].used )
+		{
+		  nextstep = TRUE;
+		}
+	      else
+		{
+		  streamptr->tsteps[tsID].records[recID].used = TRUE;
+		  streamptr->tsteps[tsID].recIDs[rindex] = recID;
+		}
+	      break;
+	    }
+	}
+      if ( recID == nrecords )
+	{
+	  Warning("Code %d level %d not found at timestep %d", rcode, rlevel, tsID+1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      if ( nextstep ) break;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", rindex+1, (int)recpos, rcode, rlevel, vdate, vtime);
+
+      streamptr->tsteps[tsID].records[recID].size = recsize;
+
+      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+      compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+      if ( memcmp(&compVar0, &compVar, sizeof(extcompvar_t)) != 0 )
+	{
+	  Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		  tsID, recID,
+		  streamptr->tsteps[tsID].records[recID].param, param,
+		  streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->tsteps[1].records[recID].position = recpos;
+    }
+
+  nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      if ( ! streamptr->tsteps[tsID].records[recID].used )
+	{
+	  varID = streamptr->tsteps[tsID].records[recID].varID;
+          vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	}
+      else
+	{
+	  nrecs++;
+	}
+    }
+  streamptr->tsteps[tsID].nrecs = nrecs;
+
+  streamptr->rtsteps = 2;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  return (0);
+}
+
+
+int extInqContents(int streamID)
+{
+  int fileID;
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+
+  streamptr->curTsID = 0;
+
+  extScanTimestep1(streamID);
+ 
+  if ( streamptr->ntsteps == -1 ) status = extScanTimestep2(streamID);
+
+  fileSetPos(fileID, 0, SEEK_SET);
+
+  return (status);
+}
+
+static
+int extScanTimestep(int streamID)
+{
+  int header[4];
+  int status;
+  int fileID;
+  int tsID;
+  // int rxysize = 0;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  long recsize = 0;
+  off_t recpos = 0;
+  int recID;
+  taxis_t *taxis;
+  int rindex, nrecs = 0;
+  extcompvar_t compVar, compVar0;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( CDI_Debug )
+    {
+      Message("streamID = %d", streamID);
+      Message("cts = %d", streamptr->curTsID);
+      Message("rts = %d", streamptr->rtsteps);
+      Message("nts = %d", streamptr->ntsteps);
+    }
+
+  if ( streamptr->rtsteps == 0 )
+    Error("Internal problem! Missing contents.");
+
+  extp  = streamptr->record->extp;
+  tsID  = streamptr->rtsteps;
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->tsteps[tsID].recordSize == 0 )
+    {
+      cdiCreateRecords(streamID, tsID);
+
+      nrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->tsteps[tsID].nrecs = nrecs;
+      streamptr->tsteps[tsID].recIDs = (int *) malloc(nrecs*sizeof(int));
+      for ( recID = 0; recID < nrecs; recID++ )
+	streamptr->tsteps[tsID].recIDs[recID] = streamptr->tsteps[1].recIDs[recID];
+
+      fileID = streamInqFileID(streamID);
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+      for ( rindex = 0; rindex <= nrecs; rindex++ )
+	{
+	  recpos = fileGetPos(fileID);
+	  status = extRead(fileID, extp);
+	  if ( status != 0 )
+	    {
+	      streamptr->ntsteps = streamptr->rtsteps + 1;
+	      break;
+	    }
+	  recsize = fileGetPos(fileID) - recpos;
+
+	  extInqHeader(extp, header);
+
+	  vdate  = header[0];
+	  vtime  = 0;
+	  rcode  = header[1];
+	  rlevel = header[2];
+	  // rxysize = header[3];
+
+	  param = cdiEncodeParam(rcode, 255, 255);
+
+	  // if ( rindex == nrecs ) break; gcc-4.5 internal compiler error
+	  if ( rindex == nrecs ) continue;
+	  recID = streamptr->tsteps[tsID].recIDs[rindex];
+
+	  if ( rindex == 0 )
+	    {
+	      taxis->type  = TAXIS_ABSOLUTE;
+	      taxis->vdate = vdate;
+	      taxis->vtime = vtime;
+	    }
+	  /*
+	  extCmpRecord(streamID, tsID, nrecs, recpos, param, rlevel, rxysize);
+	  */
+	  compVar.param  = param;
+          compVar.level  = rlevel;
+	  compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(extcompvar_t)) != 0 )
+	    {
+	      Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		      tsID, recID,
+		      streamptr->tsteps[tsID].records[recID].param, param,
+		      streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	      Error("Invalid, unsupported or inconsistent record structure");
+	    }
+
+	  streamptr->tsteps[tsID].records[recID].position = recpos;
+	  streamptr->tsteps[tsID].records[recID].size = recsize;
+
+	  if ( CDI_Debug )
+	    Message("%4d%8d%4d%8d%8d%6d", rindex, (int)recpos, rcode, rlevel, vdate, vtime);
+	}
+
+      streamptr->rtsteps++;
+
+      if ( streamptr->ntsteps != streamptr->rtsteps )
+	{
+	  tsID = tstepsNewEntry(streamID);
+	  if ( tsID != streamptr->rtsteps )
+	    Error("Internal error. tsID = %d", tsID);
+
+	  streamptr->tsteps[tsID-1].next   = 1;
+	  streamptr->tsteps[tsID].position = recpos;
+	}
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( nrecs > 0 && nrecs < streamptr->tsteps[tsID].nrecs )
+    {
+      Warning("Incomplete timestep. Stop scanning at timestep %d.", tsID);
+      streamptr->ntsteps = tsID;
+    }
+
+  return (streamptr->ntsteps);
+}
+
+
+int extInqTimestep(int streamID, int tsID)
+{
+  int ntsteps, nrecs;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( tsID == 0 && streamptr->rtsteps == 0 )
+    Error("Call to cdiInqContents missing!");
+
+  if ( CDI_Debug )
+    Message("tsID = %d rtsteps = %d", tsID, streamptr->rtsteps);
+  
+  ntsteps = UNDEFID;
+  while ( ( tsID + 1 ) > streamptr->rtsteps && ntsteps == UNDEFID )
+    ntsteps = extScanTimestep(streamID);
+
+  if ( tsID >= streamptr->ntsteps && streamptr->ntsteps != CDI_UNDEFID )
+    {
+      nrecs = 0;
+    }
+  else
+    {
+      streamptr->curTsID = tsID;
+      nrecs = streamptr->tsteps[tsID].nrecs;
+    }
+
+  return (nrecs);
+}
+
+
+void extReadVarDP(int streamID, int varID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int levID, nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int header[4];
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  extp     = streamptr->record->extp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  for (levID = 0; levID < nlevs; levID++)
+    {
+      recID = streamptr->vars[varID].level[levID];
+      recpos = streamptr->tsteps[tsid].records[recID].position;
+      fileSetPos(fileID, recpos, SEEK_SET);
+      extRead(fileID, extp);
+      extInqHeader(extp, header);
+      extInqDataDP(extp, &data[levID*gridsize]);
+    }
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  if ( vlistInqVarNumber(vlistID, varID) == CDI_REAL )
+    {
+      for ( i = 0; i < nlevs*gridsize; i++ )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+  else
+    {
+      for ( i = 0; i < 2*nlevs*gridsize; i+=2 )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+}
+
+
+void extReadVarSliceDP(int streamID, int varID, int levID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int header[4];
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  extp     = streamptr->record->extp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d",
+	     nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  recID = streamptr->vars[varID].level[levID];
+  recpos = streamptr->tsteps[tsid].records[recID].position;
+  fileSetPos(fileID, recpos, SEEK_SET);
+  extRead(fileID, extp);
+  extInqHeader(extp, header);
+  extInqDataDP(extp, data);
+ 
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  if ( vlistInqVarNumber(vlistID, varID) == CDI_REAL )
+    {
+      for ( i = 0; i < gridsize; i++ )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+  else
+    {
+      for ( i = 0; i < 2*gridsize; i+=2 )
+	if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+	  {
+	    data[i] = missval;
+	    (*nmiss)++;
+	  }
+    }
+}
+
+
+void extWriteVarDP(int streamID, int varID, const double *data)
+{
+  int fileID;
+  int levID, nlevs, gridID, gridsize;
+  int zaxisID;
+  double level;
+  int header[4];
+  int tsID;
+  int vlistID;
+  int pdis, pcat, pnum;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  extp     = streamptr->record->extp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  nlevs    = zaxisInqSize(zaxisID);
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
+
+  header[0] = streamptr->tsteps[tsID].taxis.vdate;
+  header[1] = pnum;
+  header[3] = gridInqSize(gridID);
+
+  extDefDatatype(vlistInqVarDatatype(vlistID, varID), &extp->prec, &extp->number);
+
+  for ( levID = 0;  levID < nlevs; levID++ )
+    {
+      level = zaxisInqLevel(zaxisID, levID);
+
+      header[2] = (int) level;
+      extDefHeader(extp, header);
+      extDefDataDP(extp, &data[levID*gridsize]);
+      extWrite(fileID, extp);
+    }
+}
+
+
+void extWriteVarSliceDP(int streamID, int varID, int levID, const double *data)
+{
+  int fileID;
+  int gridID;
+  int zaxisID;
+  double level;
+  int header[4];
+  int tsID;
+  int vlistID;
+  int pdis, pcat, pnum;
+  extrec_t *extp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  extp     = streamptr->record->extp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  level    = zaxisInqLevel(zaxisID, levID);
+
+  if ( CDI_Debug )
+    Message("gridID = %d zaxisID = %d", gridID, zaxisID);
+
+  cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
+
+  header[0] = streamptr->tsteps[tsID].taxis.vdate;
+  header[1] = pnum;
+  header[2] = (int) level;
+  header[3] = gridInqSize(gridID);
+
+  extDefDatatype(vlistInqVarDatatype(vlistID, varID), &extp->prec, &extp->number);
+
+  extDefHeader(extp, header);
+  extDefDataDP(extp, data);
+  extWrite(fileID, extp);
+}
+
+#endif /* HAVE_LIBEXTRA */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_ext.h b/libcdi/src/stream_ext.h
new file mode 100644
index 0000000..90daf79
--- /dev/null
+++ b/libcdi/src/stream_ext.h
@@ -0,0 +1,32 @@
+#ifndef _STREAM_EXT_H
+#define _STREAM_EXT_H
+
+#ifndef _EXTRA_H
+#  include "extra.h"
+#endif
+
+int    extInqContents(int streamID);
+int    extInqTimestep(int streamID, int tsID);
+
+int    extInqRecord(int streamID, int *varID, int *levelID);
+int    extDefRecord(int streamID);
+int    extCopyRecord(int streamIDdest, int streamIDsrc);
+int    extReadRecord(int streamID, double *data, int *nmiss);
+int    extWriteRecord(int streamID, const double *data);
+
+void   extReadVarDP (int streamID, int varID,       double *data, int *nmiss);
+void   extWriteVarDP(int streamID, int varID, const double *data);
+
+void   extReadVarSliceDP (int streamID, int varID, int levelID,       double *data, int *nmiss);
+void   extWriteVarSliceDP(int streamID, int varID, int levelID, const double *data);
+
+#endif  /* _STREAM_EXT_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_grb.c b/libcdi/src/stream_grb.c
new file mode 100644
index 0000000..fcef7d6
--- /dev/null
+++ b/libcdi/src/stream_grb.c
@@ -0,0 +1,740 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+#include "dmemory.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "stream_cgribex.h"
+#include "stream_gribapi.h"
+#include "file.h"
+#include "cgribex.h"  /* gribZip gribGetZip gribGinfo */
+#include "gribapi.h"
+
+#ifdef USE_MPI
+#include "pio.h"
+#include "pio_comm.h"
+#endif
+
+
+int grib1ltypeToZaxisType(int grib_ltype)
+{
+  int zaxistype = ZAXIS_GENERIC;
+
+  switch ( grib_ltype )
+    {
+    case GRIB1_LTYPE_SURFACE:         { zaxistype = ZAXIS_SURFACE;           break; }
+    case GRIB1_LTYPE_TOA:             { zaxistype = ZAXIS_TOA;               break; }
+    case GRIB1_LTYPE_SEA_BOTTOM:      { zaxistype = ZAXIS_SEA_BOTTOM;        break; }
+    case GRIB1_LTYPE_ATMOSPHERE:      { zaxistype = ZAXIS_ATMOSPHERE;        break; }
+    case GRIB1_LTYPE_MEANSEA:         { zaxistype = ZAXIS_MEANSEA;           break; }
+    case GRIB1_LTYPE_99:
+    case GRIB1_LTYPE_ISOBARIC:        { zaxistype = ZAXIS_PRESSURE;          break; }
+    case GRIB1_LTYPE_HEIGHT:          { zaxistype = ZAXIS_HEIGHT;            break; }
+    case GRIB1_LTYPE_ALTITUDE:        { zaxistype = ZAXIS_ALTITUDE;	     break; }
+    case GRIB1_LTYPE_SIGMA:
+    case GRIB1_LTYPE_SIGMA_LAYER:     { zaxistype = ZAXIS_SIGMA;	     break; }
+    case GRIB1_LTYPE_HYBRID:
+    case GRIB1_LTYPE_HYBRID_LAYER:    { zaxistype = ZAXIS_HYBRID;	     break; }
+    case GRIB1_LTYPE_LANDDEPTH:
+    case GRIB1_LTYPE_LANDDEPTH_LAYER: { zaxistype = ZAXIS_DEPTH_BELOW_LAND;  break; }
+    case GRIB1_LTYPE_ISENTROPIC:      { zaxistype = ZAXIS_ISENTROPIC;	     break; }
+    case GRIB1_LTYPE_SEADEPTH:        { zaxistype = ZAXIS_DEPTH_BELOW_SEA;   break; }
+    }
+
+  return (zaxistype);
+}
+
+
+int grib2ltypeToZaxisType(int grib_ltype)
+{
+  int zaxistype = ZAXIS_GENERIC;
+
+  switch ( grib_ltype )
+    {
+    case GRIB2_LTYPE_SURFACE:            { zaxistype = ZAXIS_SURFACE;           break; }
+    case GRIB2_LTYPE_TOA:                { zaxistype = ZAXIS_TOA;               break; }
+    case GRIB2_LTYPE_SEA_BOTTOM:         { zaxistype = ZAXIS_SEA_BOTTOM;        break; }
+    case GRIB2_LTYPE_ATMOSPHERE:         { zaxistype = ZAXIS_ATMOSPHERE;        break; }
+    case GRIB2_LTYPE_MEANSEA:            { zaxistype = ZAXIS_MEANSEA;           break; }
+    case GRIB2_LTYPE_ISOBARIC:           { zaxistype = ZAXIS_PRESSURE;          break; }
+    case GRIB2_LTYPE_HEIGHT:             { zaxistype = ZAXIS_HEIGHT;            break; }
+    case GRIB2_LTYPE_ALTITUDE:           { zaxistype = ZAXIS_ALTITUDE;          break; }
+    case GRIB2_LTYPE_SIGMA:              { zaxistype = ZAXIS_SIGMA;             break; }
+    case GRIB2_LTYPE_HYBRID:
+ /* case GRIB2_LTYPE_HYBRID_LAYER: */    { zaxistype = ZAXIS_HYBRID;            break; }
+    case GRIB2_LTYPE_LANDDEPTH:
+ /* case GRIB2_LTYPE_LANDDEPTH_LAYER: */ { zaxistype = ZAXIS_DEPTH_BELOW_LAND;  break; }
+    case GRIB2_LTYPE_ISENTROPIC:         { zaxistype = ZAXIS_ISENTROPIC;        break; }
+    case GRIB2_LTYPE_SEADEPTH:           { zaxistype = ZAXIS_DEPTH_BELOW_SEA;   break; }
+    }
+
+  return (zaxistype);
+}
+
+
+int grbBitsPerValue(int datatype)
+{
+  int bitsPerValue = 16;
+
+  if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    Error("CDI/GRIB library does not support complex numbers!");
+
+  if ( datatype != CDI_UNDEFID )
+    {
+      if ( datatype > 0 && datatype <= 32 )
+	bitsPerValue = datatype;
+      else if ( datatype == DATATYPE_FLT64 )
+	bitsPerValue = 24;
+      else
+	bitsPerValue = 16;
+    }
+
+  return (bitsPerValue);
+}
+
+
+/*
+int grbInqRecord(int streamID, int *varID, int *levelID)
+{
+  int status;
+
+  status = cgribexInqRecord(streamID, varID, levelID);
+
+  return (status);
+}
+*/
+
+int grbDefRecord(int streamID)
+{
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  return (status);
+}
+
+static
+int grbDecode(int filetype, unsigned char *gribbuffer, int gribsize, double *data, int gridsize,
+	      int unreduced, int *nmiss, int *zip, double missval)
+{
+  int status = 0;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    status = cgribexDecode(gribbuffer, gribsize, data, gridsize, unreduced, nmiss, zip, missval);
+  else
+#endif
+    status = gribapiDecode(gribbuffer, gribsize, data, gridsize, unreduced, nmiss, zip, missval);
+ 
+  return (status);
+}
+
+
+int grbReadRecord(int streamID, double *data, int *nmiss)
+{
+  int status = 0;
+  unsigned char *gribbuffer;
+  int fileID;
+  int recID, vrecID, tsID, gridID, varID;
+  long recsize;
+  off_t recpos;
+  int gridsize;
+  int vlistID;
+  int zip;
+  int filetype;
+  double missval;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  gribbuffer = (unsigned char *) streamptr->record->buffer;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  tsID    = streamptr->curTsID;
+  vrecID  = streamptr->tsteps[tsID].curRecID;
+  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr->tsteps[tsID].records[recID].position;
+  recsize = streamptr->tsteps[tsID].records[recID].size;
+  varID   = streamptr->tsteps[tsID].records[recID].varID;
+
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+
+  streamptr->numvals += gridsize;
+
+  fileSetPos(fileID, recpos, SEEK_SET);
+
+  fileRead(fileID, gribbuffer, (size_t) recsize);
+
+  missval = vlistInqVarMissval(vlistID, varID);
+
+  grbDecode(filetype, gribbuffer, recsize, data, gridsize, streamptr->unreduced, nmiss, &zip, missval);
+
+  streamptr->tsteps[tsID].records[recID].zip = zip;
+
+  return (status);
+}
+
+static
+int grbScanTimestep1(int streamID)
+{
+  int status;
+  int filetype;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+  filetype  = streamptr->filetype;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    {
+      status = cgribexScanTimestep1(streamID);
+    }
+  else
+#endif
+    {
+      status = gribapiScanTimestep1(streamID);
+    }
+
+  return (status);
+}
+
+static
+int grbScanTimestep2(int streamID)
+{
+  int status;
+  int filetype;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+  filetype  = streamptr->filetype;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    {
+      status = cgribexScanTimestep2(streamID);
+    }
+  else
+#endif
+    {
+      status = gribapiScanTimestep2(streamID);
+    }
+
+  return (status);
+}
+
+static
+int grbScanTimestep(int streamID)
+{
+  int status;
+  int filetype;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+  filetype  = streamptr->filetype;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    {
+      status = cgribexScanTimestep(streamID);
+    }
+  else
+#endif
+    {
+      status = gribapiScanTimestep(streamID);
+    }
+
+  return (status);
+}
+
+
+int grbInqContents(int streamID)
+{
+  int fileID;
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+
+  streamptr->curTsID = 0;
+
+  status = grbScanTimestep1(streamID);
+ 
+  if ( status == 0 && streamptr->ntsteps == -1 ) status = grbScanTimestep2(streamID);
+
+  fileSetPos(fileID, 0, SEEK_SET);
+
+  return (status);
+}
+
+
+int grbInqTimestep(int streamID, int tsID)
+{
+  int ntsteps, nrecs;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( tsID == 0 && streamptr->rtsteps == 0 )
+    Error("Call to cdiInqContents missing!");
+
+  if ( CDI_Debug )
+    Message("tsid = %d rtsteps = %d", tsID, streamptr->rtsteps);
+  
+  ntsteps = CDI_UNDEFID;
+  while ( (tsID + 1) > streamptr->rtsteps && ntsteps == CDI_UNDEFID )
+    {
+      ntsteps = grbScanTimestep(streamID);
+      if ( ntsteps == CDI_EUFSTRUCT )
+	{
+	  streamptr->ntsteps = streamptr->rtsteps;
+	  break;
+	}
+    }
+
+  if ( tsID >= streamptr->ntsteps && streamptr->ntsteps != CDI_UNDEFID )
+    {
+      nrecs = 0;
+    }
+  else
+    {
+      streamptr->curTsID = tsID;
+      nrecs = streamptr->tsteps[tsID].nrecs;
+    }
+
+  return (nrecs);
+}
+
+
+void grbReadVarDP(int streamID, int varID, double *data, int *nmiss)
+{
+  int fileID;
+  int levelID, nlevs, gridID, gridsize;
+  unsigned char *gribbuffer;
+  int tsID, recID;
+  long recsize;
+  off_t recpos, currentfilepos;
+  int imiss;
+  int vlistID;
+  int zip;
+  int filetype;
+  double missval;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  gribbuffer = (unsigned char *) streamptr->record->buffer;
+
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+
+  nlevs    = streamptr->vars[varID].nlevs;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  *nmiss = 0;
+  for ( levelID = 0; levelID < nlevs; levelID++ )
+    {
+      recID   = streamptr->vars[varID].level[levelID];
+      recpos  = streamptr->tsteps[tsID].records[recID].position;
+      recsize = streamptr->tsteps[tsID].records[recID].size;
+
+      fileSetPos(fileID, recpos, SEEK_SET);
+
+      fileRead(fileID, gribbuffer, recsize);
+
+      missval = vlistInqVarMissval(vlistID, varID);
+
+      grbDecode(filetype, gribbuffer, recsize, &data[levelID*gridsize], gridsize, 
+		streamptr->unreduced, &imiss, &zip, missval);
+
+      *nmiss += imiss;
+
+      streamptr->tsteps[tsID].records[recID].zip = zip;
+    }
+
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+}
+
+
+void grbReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *nmiss)
+{
+  int fileID;
+  int gridID, gridsize;
+  unsigned char *gribbuffer;
+  long recsize;
+  off_t recpos, currentfilepos;
+  int tsID, recID;
+  int vlistID;
+  int zip;
+  int filetype;
+  double missval;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  gribbuffer = (unsigned char *) streamptr->record->buffer;
+
+  vlistID  = streamInqVlist(streamID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsID     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("gridID = %d gridsize = %d", gridID, gridsize);
+
+  fileID = streamInqFileID(streamID);
+
+  currentfilepos = fileGetPos(fileID);
+
+  recID   = streamptr->vars[varID].level[levelID];
+  recpos  = streamptr->tsteps[tsID].records[recID].position;
+  recsize = streamptr->tsteps[tsID].records[recID].size;
+
+  if ( recsize == 0 )
+    Error("Internal problem! Recordsize is zero for record %d at timestep %d",
+	  recID+1, tsID+1);
+
+  fileSetPos(fileID, recpos, SEEK_SET);
+
+  fileRead(fileID, gribbuffer, recsize);
+
+  missval = vlistInqVarMissval(vlistID, varID);
+
+  grbDecode(filetype, gribbuffer, recsize, data, gridsize, streamptr->unreduced, nmiss, &zip, missval);
+
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  streamptr->tsteps[tsID].records[recID].zip = zip;
+}
+
+static
+size_t grbEncode(int filetype, int varID, int levelID, int vlistID, int gridID, int zaxisID,
+		 int date, int time, int tsteptype, int numavg, 
+		 long datasize, const double *data, int nmiss, unsigned char **gribbuffer,
+		 int ljpeg, void *gribContainer)
+{
+  size_t nbytes;
+  size_t gribbuffersize;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    {
+      gribbuffersize = datasize*4+3000;
+      *gribbuffer = (unsigned char *) malloc(gribbuffersize);
+
+      nbytes = cgribexEncode(varID, levelID, vlistID, gridID, zaxisID,
+			     date, time, tsteptype, numavg, 
+			     datasize, data, nmiss, *gribbuffer, gribbuffersize);
+    }
+  else
+#endif
+    {
+      nbytes = gribapiEncode(varID, levelID, vlistID, gridID, zaxisID,
+			     date, time, tsteptype, numavg, 
+			     datasize, data, nmiss, gribbuffer, &gribbuffersize,
+			     ljpeg, gribContainer);
+    }
+
+  return (nbytes);
+}
+
+static
+size_t grbSzip(int filetype, unsigned char *gribbuffer, size_t gribbuffersize)
+{
+  size_t nbytes = 0;
+  unsigned char *buffer;
+  size_t buffersize;
+  static int lszip_warn = 1;
+
+  buffersize = gribbuffersize + 1000; /* compressed record can be greater than source record */
+  buffer = (unsigned char *) malloc(buffersize);
+
+  /*  memcpy(buffer, gribbuffer, gribbuffersize); */
+
+  if ( filetype == FILETYPE_GRB )
+    {
+      nbytes = gribZip(gribbuffer, (long) gribbuffersize, buffer, (long) buffersize);
+    }
+  else
+    {
+      if ( lszip_warn ) Warning("Szip compression of GRIB2 records not implemented!");
+      lszip_warn = 0;
+      nbytes = gribbuffersize;
+    }
+
+  free(buffer);
+
+  return (nbytes);
+}
+
+
+int grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data, int nmiss)
+{
+  size_t nwrite;
+  int fileID;
+  int gridID;
+  int zaxisID;
+  unsigned char *gribbuffer = NULL;
+  long datasize;
+  int tsID;
+  int vlistID;
+  int date, time;
+  int tsteptype;
+  int numavg = 0;
+  size_t nbytes;
+  int filetype;
+  stream_t *streamptr;
+  int ljpeg = 0;
+  int ljpeg_warn = 1;
+  void *gc = NULL;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype  = streamptr->filetype;
+
+  fileID    = streamInqFileID(streamID);
+  vlistID   = streamInqVlist(streamID);
+  gridID    = vlistInqVarGrid(vlistID, varID);
+  zaxisID   = vlistInqVarZaxis(vlistID, varID);
+  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+
+  tsID      = streamptr->curTsID;
+  date      = streamptr->tsteps[tsID].taxis.vdate;
+  time      = streamptr->tsteps[tsID].taxis.vtime;
+  if ( vlistInqVarTimave(vlistID, varID) )
+    numavg = streamptr->tsteps[tsID].taxis.numavg;
+
+  if ( CDI_Debug )
+    Message("gridID = %d zaxisID = %d", gridID, zaxisID);
+
+  datasize = gridInqSize(gridID);
+  /*
+  gribbuffersize = datasize*4+3000;
+  gribbuffer = (unsigned char *) malloc(gribbuffersize);
+  */
+#if  defined  (HAVE_LIBCGRIBEX)
+  if ( filetype == FILETYPE_GRB )
+    {
+    }
+  else
+#endif
+    {
+#if defined (GRIBCONTAINER2D)
+      gribContainer_t **gribContainers =  (gribContainer_t **) streamptr->gribContainers;
+      gc = (void *) &gribContainers[varID][levelID];
+#else
+      gribContainer_t *gribContainers =  (gribContainer_t *) streamptr->gribContainers;
+      gc = (void *) &gribContainers[varID];
+#endif
+    }
+
+  if ( streamptr->comptype == COMPRESS_JPEG )
+    {
+      if ( filetype == FILETYPE_GRB2 )
+	{
+	  ljpeg = 1;
+	}
+      else
+	{
+	  if ( ljpeg_warn ) Warning("JPEG compression of GRIB1 records not available!");
+	  ljpeg_warn = 0;
+	}
+    }
+
+  nbytes = grbEncode(filetype, varID, levelID, vlistID, gridID, zaxisID, date, time, tsteptype, numavg, 
+		     datasize, data, nmiss, &gribbuffer, ljpeg, gc);
+
+  if ( streamptr->comptype == COMPRESS_SZIP )
+    nbytes = grbSzip(filetype, gribbuffer, nbytes);
+
+  /* begin deike */
+#ifdef USE_MPI
+  if ( commInqIOMode () != PIO_NONE )
+    nwrite = pioFileWrite ( fileID, tsID, gribbuffer, nbytes );
+  else
+#endif
+  /* end deike */
+    nwrite = fileWrite(fileID, gribbuffer, nbytes);
+
+  if ( nwrite != nbytes ) perror(__func__);
+
+  if ( gribbuffer ) free(gribbuffer);
+
+  return ((int)nwrite);
+}
+
+
+void grbWriteVarDP(int streamID, int varID, const double *data, int nmiss)
+{
+  int vlistID, gridID, zaxisID, levelID, nlevs;
+  int gridsize;
+
+  vlistID  = streamInqVlist(streamID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  nlevs    = zaxisInqSize(zaxisID);
+
+  for ( levelID = 0; levelID < nlevs; levelID++ )
+    {
+      grbWriteVarSliceDP(streamID, varID, levelID, data+levelID*gridsize, nmiss);
+    }
+}
+
+
+int grbCopyRecord(int streamID2, int streamID1)
+{
+  int fileID1, fileID2;
+  int tsID, recID, vrecID;
+  long recsize;
+  size_t gribbuffersize;
+  off_t recpos;
+  size_t nwrite;
+  unsigned char *gribbuffer;
+  int filetype;
+  size_t nbytes;
+  long unzipsize;
+  int izip;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  filetype = streamptr1->filetype;
+
+  fileID1 = streamInqFileID(streamID1);
+  fileID2 = streamInqFileID(streamID2);
+
+  tsID    = streamptr1->curTsID;
+  vrecID  = streamptr1->tsteps[tsID].curRecID;
+  recID   = streamptr1->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr1->tsteps[tsID].records[recID].position;
+  recsize = streamptr1->tsteps[tsID].records[recID].size;
+
+  fileSetPos(fileID1, recpos, SEEK_SET);
+
+  gribbuffersize = recsize == (recsize>>3)<<3 ? recsize : (1+(recsize>>3))<<3;
+
+  gribbuffer = (unsigned char *) malloc(gribbuffersize);
+
+  fileRead(fileID1, gribbuffer, recsize);
+
+  nbytes = recsize;
+
+  izip = gribGetZip(recsize, gribbuffer, &unzipsize);
+
+  if ( izip == 0 )
+    if ( streamptr2->comptype == COMPRESS_SZIP )
+      nbytes = grbSzip(filetype, gribbuffer, nbytes);
+
+  while ( nbytes & 7 ) gribbuffer[nbytes++] = 0;
+
+  nwrite = fileWrite(fileID2, gribbuffer, nbytes);
+  if ( nwrite != nbytes ) perror(__func__);
+
+  free(gribbuffer);
+
+  return ((int)nwrite);
+}
+
+
+int grbWriteRecord(int streamID, const double *data, int nmiss)
+{
+  int status = 0;
+  int varID, levelID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  varID   = streamptr->record->varID;
+  levelID = streamptr->record->levelID;
+
+  status = grbWriteVarSliceDP(streamID, varID, levelID, data, nmiss);
+
+  return (status);
+}
+
+
+void streamInqGinfo(int streamID, int *intnum, float *fltnum)
+{
+  int recID, vrecID, tsID;
+  int filetype;
+  void *gribbuffer;
+  long gribbuffersize;
+  off_t recpos;
+  int zip;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  if ( filetype == FILETYPE_GRB )
+    {
+      tsID    = streamptr->curTsID;
+      vrecID  = streamptr->tsteps[tsID].curRecID;
+      recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+      recpos  = streamptr->tsteps[tsID].records[recID].position;
+      zip     = streamptr->tsteps[tsID].records[recID].zip;
+
+      gribbuffer = streamptr->record->buffer;
+      gribbuffersize = streamptr->record->buffersize;
+
+      if ( zip > 0 )
+	Error("Compressed GRIB records unsupported!");
+      else
+	gribGinfo(recpos, gribbuffersize, (unsigned char *) gribbuffer, intnum, fltnum);
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_grb.h b/libcdi/src/stream_grb.h
new file mode 100644
index 0000000..1d7e3fb
--- /dev/null
+++ b/libcdi/src/stream_grb.h
@@ -0,0 +1,33 @@
+#ifndef _STREAM_GRB_H
+#define _STREAM_GRB_H
+
+int   grbBitsPerValue(int datatype);
+
+int   grbInqContents(int streamID);
+int   grbInqTimestep(int streamID, int tsID);
+
+int   grbInqRecord(int streamID, int *varID, int *levelID);
+int   grbDefRecord(int streamID);
+int   grbWriteRecord(int streamID, const double *data, int nmiss);
+int   grbReadRecord(int streamID, double *data, int *nmiss);
+int   grbCopyRecord(int streamIDdest, int streamIDsrc);
+
+void  grbReadVarDP(int streamID, int varID, double *data, int *nmiss);
+void  grbWriteVarDP(int streamID, int varID, const double *data, int nmiss);
+
+void  grbReadVarSliceDP(int streamID, int varID, int levelID, double *data, int *nmiss);
+int   grbWriteVarSliceDP(int streamID, int varID, int levelID, const double *data, int nmiss);
+
+int   grib1ltypeToZaxisType(int grib_ltype);
+int   grib2ltypeToZaxisType(int grib_ltype);
+
+#endif  /* _STREAM_GRB_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_gribapi.c b/libcdi/src/stream_gribapi.c
new file mode 100644
index 0000000..afd00e7
--- /dev/null
+++ b/libcdi/src/stream_gribapi.c
@@ -0,0 +1,3034 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include "dmemory.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "file.h"
+#include "varscan.h"
+#include "datetime.h"
+#include "vlist.h"
+#include "stream_grb.h"
+#include "calendar.h"
+
+
+#if  defined  (HAVE_LIBGRIB_API)
+#  include "cgribex.h"      /* gribGetSize, gribRead, gribGetZip */
+#  include "gribapi.h"
+#  include "grib_api.h"
+#endif
+
+
+extern int cdiInventoryMode;
+
+typedef struct {
+  int param;
+  int level1;
+  int level2;
+  int ltype;
+} compvar2_t;
+
+
+#if  defined  (HAVE_LIBGRIB_API)
+static
+int gribapiGetGridType(grib_handle *gh)
+{
+  int gridtype = GRID_GENERIC;
+  int gribgridtype;
+  long lpar;
+
+    {
+      GRIB_CHECK(grib_get_long(gh, "gridDefinitionTemplateNumber", &lpar), 0);
+      gribgridtype = (int) lpar;
+
+      switch (gribgridtype)
+	{
+	case  GRIB2_GTYPE_LATLON:     { GRIB_CHECK(grib_get_long(gh, "Ni", &lpar), 0);
+	                                if ( lpar == (long) GRIB_MISSING_LONG ) break;
+                                      }
+	case  GRIB2_GTYPE_LATLON_ROT: { gridtype = GRID_LONLAT;    break; }
+	case  GRIB2_GTYPE_LCC:        { gridtype = GRID_LCC;       break; }
+	case  GRIB2_GTYPE_GAUSSIAN:   { GRIB_CHECK(grib_get_long(gh, "Ni", &lpar), 0);
+	                                if ( lpar == (long) GRIB_MISSING_LONG )
+					  gridtype = GRID_GAUSSIAN_REDUCED;
+					else
+					  gridtype = GRID_GAUSSIAN;
+					break;
+                                      }
+	case  GRIB2_GTYPE_SPECTRAL:   { gridtype = GRID_SPECTRAL;  break; }
+	case  GRIB2_GTYPE_GME:        { gridtype = GRID_GME;       break; }
+	case  GRIB2_GTYPE_NUMBER:     { gridtype = GRID_REFERENCE; break; }
+	}
+    }
+
+  return (gridtype);
+}
+
+static
+int gribapiGetIsRotated(grib_handle *gh)
+{
+  int isRotated = 0;
+  int gribgridtype;
+  long lpar;
+
+    {
+      GRIB_CHECK(grib_get_long(gh, "gridDefinitionTemplateNumber", &lpar), 0);
+      gribgridtype = (int) lpar;
+
+      if ( gribgridtype == GRIB2_GTYPE_LATLON_ROT ) isRotated = 1;
+    }
+
+  return (isRotated);
+}
+
+static
+int gribapiGetZaxisType(long editionNumber, int grib_ltype)
+{
+  int zaxistype = ZAXIS_GENERIC;
+
+  if ( editionNumber <= 1 )
+    {
+      zaxistype = grib1ltypeToZaxisType(grib_ltype);
+    }
+  else
+    {
+      zaxistype = grib2ltypeToZaxisType(grib_ltype);
+    }
+
+  return (zaxistype);
+}
+
+static
+int getTimeunits(long unitsOfTime)
+{
+  int timeunits = -1;
+
+  switch (unitsOfTime)
+    {
+    case 13:  timeunits = TUNIT_SECOND;  break;
+    case  0:  timeunits = TUNIT_MINUTE;  break;
+    case  1:  timeunits = TUNIT_HOUR;    break;
+    case 10:  timeunits = TUNIT_3HOURS;  break;
+    case 11:  timeunits = TUNIT_6HOURS;  break;
+    case 12:  timeunits = TUNIT_12HOURS; break;
+    case  2:  timeunits = TUNIT_DAY;     break;
+    default:  timeunits = TUNIT_HOUR;    break;
+    }
+
+  return (timeunits);
+}
+
+static
+double timeunit_factor(int tu1, int tu2)
+{
+  double factor = 1;
+
+  if ( tu2 == TUNIT_HOUR )
+    {
+      switch (tu1)
+        {
+        case TUNIT_SECOND:  factor = 3600;   break;
+        case TUNIT_MINUTE:  factor = 60;     break;
+        case TUNIT_HOUR:    factor = 1;      break;
+        case TUNIT_3HOURS:  factor = 1./3;   break;
+        case TUNIT_6HOURS:  factor = 1./6;   break;
+        case TUNIT_12HOURS: factor = 1./12;  break;
+        case TUNIT_DAY:     factor = 1./24;  break;
+        }
+    }
+
+  return (factor);
+}
+
+static
+int gribapiGetEndStep(grib_handle *gh, int startStep, int timeunits)
+{
+  int endStep = startStep;
+  int timeunits2;
+  long unitsOfTime;
+  long lpar;
+
+  GRIB_CHECK(grib_get_long(gh, "stepUnits", &unitsOfTime), 0);
+
+  timeunits2 = getTimeunits(unitsOfTime);
+
+  GRIB_CHECK(grib_get_long(gh, "endStep", &lpar), 0);
+
+  endStep = (int)  ((lpar * timeunit_factor(timeunits, timeunits2)) + 0.5);
+
+  return (endStep);
+}
+
+static
+int gribapiGetTimeUnits(grib_handle *gh)
+{
+  int timeunits = -1;
+  long unitsOfTime;
+  // size_t len = 8;
+  //char stepunits[8];
+  //static int lprint = TRUE;
+
+  GRIB_CHECK(grib_get_long(gh, "indicatorOfUnitOfTimeRange", &unitsOfTime), 0);
+
+  timeunits = getTimeunits(unitsOfTime);
+
+  /*
+  GRIB_CHECK(grib_get_string(gh, "stepUnits", stepunits, &len), 0);
+
+  len--;
+
+  if      ( memcmp(stepunits, "s",   len) == 0 ) timeunits = TUNIT_SECOND;
+  else if ( memcmp(stepunits, "m",   len) == 0 ) timeunits = TUNIT_MINUTE;
+  else if ( memcmp(stepunits, "h",   len) == 0 ) timeunits = TUNIT_HOUR;
+  else if ( memcmp(stepunits, "3h",  len) == 0 ) timeunits = TUNIT_3HOURS;
+  else if ( memcmp(stepunits, "6h",  len) == 0 ) timeunits = TUNIT_6HOURS;
+  else if ( memcmp(stepunits, "12h", len) == 0 ) timeunits = TUNIT_12HOURS;
+  else if ( memcmp(stepunits, "D",   len) == 0 ) timeunits = TUNIT_DAY;
+  else if ( memcmp(stepunits, "M",   len) == 0 ) timeunits = TUNIT_MONTH;
+  else if ( memcmp(stepunits, "Y",   len) == 0 ) timeunits = TUNIT_YEAR;
+  else if ( lprint )
+    {
+      Message("Step units >%s< unsupported!", stepunits);
+      lprint = FALSE;
+    }
+  */
+
+  return (timeunits);
+}
+
+static
+int gribapiTimeIsFC(grib_handle *gh)
+{
+  long editionNumber;
+  int isFC = TRUE;
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  if ( editionNumber > 1 )
+    {
+      long sigofrtime;
+
+      GRIB_CHECK(grib_get_long(gh, "significanceOfReferenceTime", &sigofrtime), 0);
+
+      if ( sigofrtime == 3 ) isFC = FALSE;
+    }
+
+  return (isFC);
+}
+
+static
+int gribapiGetTsteptype(grib_handle *gh)
+{
+  int tsteptype = TSTEP_INSTANT;
+  static int lprint = TRUE;
+
+  if ( gribapiTimeIsFC(gh) )
+    {
+      int status;
+      size_t len = 256;
+      char stepType[256];
+
+      status = grib_get_string(gh, "stepType", stepType, &len);
+      if ( status == 0 && len > 1 && len < 256 )
+	{
+	  if      ( strncmp("instant", stepType, len) == 0 ) tsteptype = TSTEP_INSTANT;
+	  else if ( strncmp("avg",     stepType, len) == 0 ) tsteptype = TSTEP_AVG;
+	  else if ( strncmp("accum",   stepType, len) == 0 ) tsteptype = TSTEP_ACCUM;
+	  else if ( strncmp("max",     stepType, len) == 0 ) tsteptype = TSTEP_MAX;
+	  else if ( strncmp("min",     stepType, len) == 0 ) tsteptype = TSTEP_MIN;
+	  else if ( strncmp("diff",    stepType, len) == 0 ) tsteptype = TSTEP_DIFF;
+	  else if ( strncmp("rms",     stepType, len) == 0 ) tsteptype = TSTEP_RMS;
+	  else if ( strncmp("sd",      stepType, len) == 0 ) tsteptype = TSTEP_SD;
+	  else if ( strncmp("cov",     stepType, len) == 0 ) tsteptype = TSTEP_COV;
+	  else if ( strncmp("ratio",   stepType, len) == 0 ) tsteptype = TSTEP_RATIO;
+	  else if ( lprint )
+	    {
+	      Message("stepType %s unsupported, set to instant!", stepType);
+	      lprint = FALSE;
+	    }
+
+	  // printf("stepType: %s %ld %d\n", stepType, len, tsteptype);
+	}
+    }
+
+  return (tsteptype);
+}
+
+static
+int gribapiGetValidityDateTime(grib_handle *gh, int *vdate, int *vtime)
+{
+  int rdate, rtime;
+  int timeUnits, startStep, endStep;
+  int tstepRange = 0;
+  int range;
+  long lpar;
+  long sigofrtime = 3;
+  long editionNumber;
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  if ( editionNumber > 1 )
+    {
+      GRIB_CHECK(grib_get_long(gh, "significanceOfReferenceTime", &sigofrtime), 0);
+    }
+
+  if ( sigofrtime == 3 )
+    {
+      GRIB_CHECK(grib_get_long(gh, "dataDate", &lpar), 0);
+      *vdate = (int) lpar;
+      GRIB_CHECK(grib_get_long(gh, "dataTime", &lpar), 0);
+      *vtime = (int) lpar*100;
+    }
+  else
+    {
+      GRIB_CHECK(grib_get_long(gh, "dataDate", &lpar), 0);
+      rdate = (int) lpar;
+      GRIB_CHECK(grib_get_long(gh, "dataTime", &lpar), 0);
+      rtime = (int) lpar*100;
+      GRIB_CHECK(grib_get_long(gh, "forecastTime", &lpar), 0);
+      startStep = (int) lpar;
+      timeUnits = gribapiGetTimeUnits(gh);
+      endStep = gribapiGetEndStep(gh, startStep, timeUnits);
+
+      range = endStep - startStep;
+
+      if ( range > 0 )
+	{
+	  if ( startStep == 0 ) tstepRange = -1;
+	  else                  tstepRange =  1;
+	}
+
+      {
+	static int lprint = TRUE;
+	extern int grib_calendar;
+	int ryear, rmonth, rday, rhour, rminute, rsecond;
+	int time_period = endStep;
+	int julday, secofday, addsec;
+
+	cdiDecodeDate(rdate, &ryear, &rmonth, &rday);
+	cdiDecodeTime(rtime, &rhour, &rminute, &rsecond);
+
+	encode_caldaysec(grib_calendar, ryear, rmonth, rday, rhour, rminute, rsecond, &julday, &secofday);
+
+	addsec = 0;
+	switch ( timeUnits )
+	  {
+	  case TUNIT_SECOND:  addsec =         time_period; break;
+	  case TUNIT_MINUTE:  addsec =    60 * time_period; break;
+	  case TUNIT_HOUR:    addsec =  3600 * time_period; break;
+	  case TUNIT_3HOURS:  addsec = 10800 * time_period; break;
+	  case TUNIT_6HOURS:  addsec = 21600 * time_period; break;
+	  case TUNIT_12HOURS: addsec = 43200 * time_period; break;
+	  case TUNIT_DAY:     addsec = 86400 * time_period; break;
+	  default:
+	    if ( lprint )
+	      {
+	        Warning("Time unit %d unsupported", timeUnits);
+		lprint = FALSE;
+	      }
+	  }
+
+	julday_add_seconds(addsec, &julday, &secofday);
+
+	decode_caldaysec(grib_calendar, julday, secofday, &ryear, &rmonth, &rday, &rhour, &rminute, &rsecond);
+	/*
+	  printf("new %d/%d/%d %d:%d\n", ryear, rmonth, rday, rhour, rminute);
+	*/
+	*vdate = cdiEncodeDate(ryear, rmonth, rday);
+	*vtime = cdiEncodeTime(rhour, rminute, rsecond);
+      }
+    }
+
+  return (tstepRange);
+}
+
+static
+void gribapiGetGrid(grib_handle *gh, grid_t *grid)
+{
+  long editionNumber;
+  int gridtype;
+  size_t datasize;
+  long numberOfPoints;
+  long lpar;
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  gridtype = gribapiGetGridType(gh);
+  /*
+  if ( streamptr->unreduced && gridtype == GRID_GAUSSIAN_REDUCED )
+    {
+      gridtype = GRID_GAUSSIAN;
+      ISEC2_NumLon = 2*ISEC2_NumLat;
+      ISEC4_NumValues = ISEC2_NumLon*ISEC2_NumLat;
+    }
+  */
+  memset(grid, 0, sizeof(grid_t));
+
+  GRIB_CHECK(grib_get_size(gh, "values", &datasize), 0);
+  GRIB_CHECK(grib_get_long(gh, "numberOfPoints", &numberOfPoints), 0);
+
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+      {
+	int nlon, nlat;
+
+	GRIB_CHECK(grib_get_long(gh, "Ni", &lpar), 0);
+	nlon = lpar;
+	GRIB_CHECK(grib_get_long(gh, "Nj", &lpar), 0);
+	nlat = lpar;
+
+	if ( gridtype == GRID_GAUSSIAN )
+          {
+            GRIB_CHECK(grib_get_long(gh, "numberOfParallelsBetweenAPoleAndTheEquator", &lpar), 0);
+            grid->np = lpar;
+          }
+
+	if ( numberOfPoints != nlon*nlat )
+	  Error("numberOfPoints (%d) and gridSize (%d) differ!",
+		(int)numberOfPoints, nlon*nlat);
+
+	grid->size  = numberOfPoints;
+	grid->xsize = nlon;
+	grid->ysize = nlat;
+	grid->xinc  = 0;
+	grid->yinc  = 0;
+	grid->xdef  = 0;
+	GRIB_CHECK(grib_get_double(gh, "longitudeOfFirstGridPointInDegrees", &grid->xfirst), 0);
+	GRIB_CHECK(grib_get_double(gh, "longitudeOfLastGridPointInDegrees",  &grid->xlast), 0);
+	GRIB_CHECK(grib_get_double(gh, "latitudeOfFirstGridPointInDegrees",  &grid->yfirst), 0);
+	GRIB_CHECK(grib_get_double(gh, "latitudeOfLastGridPointInDegrees",   &grid->ylast), 0);
+	GRIB_CHECK(grib_get_double(gh, "iDirectionIncrementInDegrees", &grid->xinc), 0);
+	if ( gridtype == GRID_LONLAT )
+	  GRIB_CHECK(grib_get_double(gh, "jDirectionIncrementInDegrees", &grid->yinc), 0);
+
+	if ( IS_EQUAL(grid->xinc, GRIB_MISSING_DOUBLE) ) grid->xinc = 0;
+
+	/* if ( IS_NOT_EQUAL(grid->xfirst, 0) || IS_NOT_EQUAL(grid->xlast, 0) ) */
+	  {
+	    if ( grid->xsize > 1 )
+	      {
+		if ( (grid->xfirst >= grid->xlast) && (grid->xfirst >= 180) ) grid->xfirst -= 360;
+
+		if ( editionNumber <= 1 )
+		  {
+		    /* correct xinc if necessary */
+		    if ( IS_EQUAL(grid->xfirst, 0) && grid->xlast > 354 )
+		      {
+			double xinc = 360. / grid->xsize;
+
+			if ( fabs(grid->xinc-xinc) > 0.0 )
+			  {
+			    grid->xinc = xinc;
+			    if ( CDI_Debug ) Message("set xinc to %g", grid->xinc);
+			  }
+		      }
+		  }
+	      }
+	    grid->xdef = 2;
+	  }
+	grid->ydef = 0;
+        /* if ( IS_NOT_EQUAL(grid->yfirst, 0) || IS_NOT_EQUAL(grid->ylast, 0) ) */
+	  {
+	    if ( grid->ysize > 1 )
+	      {
+		if ( editionNumber <= 1 )
+		  {
+		  }
+	      }
+	    grid->ydef = 2;
+	  }
+	break;
+      }
+    case GRID_GAUSSIAN_REDUCED:
+      {
+	int nlat, i;
+	size_t dummy;
+	long *pl;
+
+        GRIB_CHECK(grib_get_long(gh, "numberOfParallelsBetweenAPoleAndTheEquator", &lpar), 0);
+        grid->np = lpar;
+
+	GRIB_CHECK(grib_get_long(gh, "Nj", &lpar), 0);
+	nlat = lpar;
+
+	grid->size   = numberOfPoints;
+
+        grid->rowlon = (int *) malloc(nlat*sizeof(int));
+        pl          = (long *) malloc(nlat*sizeof(long));
+	dummy       = nlat;
+	GRIB_CHECK(grib_get_long_array(gh, "pl", pl, &dummy), 0);
+	for ( i = 0; i < nlat; ++i ) grid->rowlon[i] = pl[i];
+	free(pl);
+
+	grid->ysize  = nlat;
+	grid->xinc   = 0;
+	grid->yinc   = 0;
+	grid->xdef   = 0;
+	GRIB_CHECK(grib_get_double(gh, "longitudeOfFirstGridPointInDegrees", &grid->xfirst), 0);
+	GRIB_CHECK(grib_get_double(gh, "longitudeOfLastGridPointInDegrees",  &grid->xlast), 0);
+	GRIB_CHECK(grib_get_double(gh, "latitudeOfFirstGridPointInDegrees",  &grid->yfirst), 0);
+	GRIB_CHECK(grib_get_double(gh, "latitudeOfLastGridPointInDegrees",   &grid->ylast), 0);
+	GRIB_CHECK(grib_get_double(gh, "iDirectionIncrementInDegrees", &grid->xinc), 0);
+
+	if ( IS_EQUAL(grid->xinc, GRIB_MISSING_DOUBLE) ) grid->xinc = 0;
+
+	/* if ( IS_NOT_EQUAL(grid->xfirst, 0) || IS_NOT_EQUAL(grid->xlast, 0) ) */
+	  {
+	    if ( grid->xsize > 1 )
+	      {
+		if ( (grid->xfirst > grid->xlast) && (grid->xfirst >= 180) ) grid->xfirst -= 360;
+
+		if ( editionNumber <= 1 )
+		  {
+		    /* correct xinc if necessary */
+		    if ( IS_EQUAL(grid->xfirst, 0) && grid->xlast > 354 )
+		      {
+			double xinc = 360. / grid->xsize;
+
+			if ( fabs(grid->xinc-xinc) > 0.0 )
+			  {
+			    grid->xinc = xinc;
+			    if ( CDI_Debug ) Message("set xinc to %g", grid->xinc);
+			  }
+		      }
+		  }
+	      }
+	    grid->xdef = 2;
+	  }
+	grid->ydef  = 0;
+        /* if ( IS_NOT_EQUAL(grid->yfirst, 0) || IS_NOT_EQUAL(grid->ylast, 0) ) */
+	  {
+	    if ( grid->ysize > 1 )
+	      {
+		if ( editionNumber <= 1 )
+		  {
+		  }
+	      }
+	    grid->ydef = 2;
+	  }
+	break;
+      }
+      /*
+    case GRID_LCC:
+      {
+	if ( ISEC4_NumValues != ISEC2_NumLon*ISEC2_NumLat )
+	  Error("numberOfPoints (%d) and gridSize (%d) differ!",
+		ISEC4_NumValues, ISEC2_NumLon*ISEC2_NumLat);
+
+	grid->size  = ISEC4_NumValues;
+	grid->xsize = ISEC2_NumLon;
+	grid->ysize = ISEC2_NumLat;
+
+	grid->lcc_xinc      = ISEC2_Lambert_dx;
+	grid->lcc_yinc      = ISEC2_Lambert_dy;
+	grid->lcc_originLon = ISEC2_FirstLon * 0.001;
+	grid->lcc_originLat = ISEC2_FirstLat * 0.001;
+	grid->lcc_lonParY   = ISEC2_Lambert_Lov * 0.001;
+	grid->lcc_lat1      = ISEC2_Lambert_LatS1 * 0.001;
+	grid->lcc_lat2      = ISEC2_Lambert_LatS2 * 0.001;
+	grid->lcc_projflag  = ISEC2_Lambert_ProjFlag;
+	grid->lcc_scanflag  = ISEC2_ScanFlag;
+
+	grid->xdef   = 0;
+	grid->ydef   = 0;
+
+	break;
+      }
+      */
+    case GRID_SPECTRAL:
+      {
+	size_t len = 256;
+	char typeOfPacking[256];
+	GRIB_CHECK(grib_get_string(gh, "packingType", typeOfPacking, &len), 0);
+	grid->lcomplex = 0;
+	if ( strncmp(typeOfPacking, "spectral_complex", len) == 0 ) grid->lcomplex = 1;
+
+	grid->size  = datasize;
+	GRIB_CHECK(grib_get_long(gh, "J", &lpar), 0);
+	grid->trunc = lpar;
+
+	break;
+      }
+    case GRID_GME:
+      {
+	grid->size  = numberOfPoints;
+	if ( grib_get_long(gh, "nd", &lpar) == 0 ) grid->nd  = lpar;
+	if ( grib_get_long(gh, "Ni", &lpar) == 0 ) grid->ni  = lpar;
+	if ( grib_get_long(gh, "n2", &lpar) == 0 ) grid->ni2 = lpar;
+	if ( grib_get_long(gh, "n3", &lpar) == 0 ) grid->ni3 = lpar;
+
+	break;
+      }
+    case GRID_REFERENCE:
+      {
+        char uuid[17];
+	char reference_link[8192];
+	size_t len = sizeof(reference_link);
+	reference_link[0] = 0;
+
+	grid->size  = numberOfPoints;
+	if ( grib_get_long(gh, "numberOfGridUsed", &lpar) == 0 )
+	  {
+	    grid->number   = lpar;
+	    if ( grib_get_long(gh, "numberOfGridInReference", &lpar) == 0 ) grid->position = lpar;
+	    if ( grib_get_string(gh, "gridDescriptionFile", reference_link, &len) == 0 )
+	      {
+		if ( strncmp(reference_link, "file://", 7) == 0 )
+		  grid->reference = strdupx(reference_link);
+	      }
+            len = (size_t) 16;
+            if ( grib_get_string(gh, "uuidOfHGrid", uuid, &len) == 0)
+              {
+                strncpy(grid->uuid, uuid, 16);
+              }
+	  }
+
+	break;
+      }
+    case GRID_GENERIC:
+      {
+	int nlon = 0, nlat = 0;
+
+	if ( grib_get_long(gh, "Ni", &lpar) == 0 ) nlon = lpar;
+	if ( grib_get_long(gh, "Nj", &lpar) == 0 ) nlat = lpar;
+
+	grid->size  = numberOfPoints;
+
+	if ( nlon > 0 && nlat > 0 && nlon*nlat == grid->size )
+	  {
+	    grid->xsize = nlon;
+	    grid->ysize = nlat;
+	  }
+	else
+	  {
+	    grid->xsize = 0;
+	    grid->ysize = 0;
+	  }
+
+	break;
+      }
+    default:
+      {
+	Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+	break;
+      }
+    }
+
+  grid->isRotated = FALSE;
+  if ( gribapiGetIsRotated(gh) )
+    {
+      grid->isRotated = TRUE;
+      GRIB_CHECK(grib_get_double(gh, "latitudeOfSouthernPoleInDegrees",  &grid->ypole), 0);
+      GRIB_CHECK(grib_get_double(gh, "longitudeOfSouthernPoleInDegrees", &grid->xpole), 0);
+      GRIB_CHECK(grib_get_double(gh, "angleOfRotation", &grid->angle), 0);
+      /* change from south to north pole */
+      grid->ypole = -grid->ypole;
+      grid->xpole =  grid->xpole - 180;
+    }
+
+  grid->xvals = NULL;
+  grid->yvals = NULL;
+  grid->type  = gridtype;
+}
+
+static
+void grib1GetLevel(grib_handle *gh, int *leveltype, int *lbounds, int *level1, int *level2)
+{
+  int status;
+  long lpar;
+  double dlevel;
+
+  *leveltype = 0;
+  *lbounds = 0;
+  *level1  = 0;
+  *level2  = 0;
+
+  status = grib_get_long(gh, "indicatorOfTypeOfLevel", &lpar);
+  if ( status == 0 )
+    {
+      *leveltype = (int) lpar;
+
+      switch (*leveltype)
+	{
+	case GRIB1_LTYPE_SIGMA_LAYER:
+	case GRIB1_LTYPE_HYBRID_LAYER:
+	case GRIB1_LTYPE_LANDDEPTH_LAYER:
+	  { *lbounds = 1; break; }
+	}
+
+      if ( *lbounds == 0 )
+	{
+	  GRIB_CHECK(grib_get_double(gh, "level", &dlevel), 0);
+	  if ( *leveltype == 100 ) dlevel *= 100;
+	  if ( dlevel < -2.e9 || dlevel > 2.e9 ) dlevel = 0;
+	  if ( *leveltype == 99 ) *leveltype = 100;
+
+	  *level1 = (int) dlevel;
+	  *level2 = 0;
+	}
+      else
+	{
+	  GRIB_CHECK(grib_get_long(gh, "topLevel", &lpar), 0);
+	  *level1 = lpar;
+	  GRIB_CHECK(grib_get_long(gh, "bottomLevel", &lpar), 0);
+	  *level2 = lpar;
+	}
+    }
+}
+
+static
+void grib2GetLevel(grib_handle *gh, int *leveltype, int *lbounds, int *level1, int *level2)
+{
+  int status;
+  int leveltype2 = -1;
+  long lpar;
+  long factor;
+  double dlevel;
+
+  *leveltype = 0;
+  *lbounds = 0;
+  *level1  = 0;
+  *level2  = 0;
+
+  status = grib_get_long(gh, "typeOfFirstFixedSurface", &lpar);
+  if ( status == 0 )
+    {
+      *leveltype = (int) lpar;
+
+      status = grib_get_long(gh, "typeOfSecondFixedSurface", &lpar);
+      if ( status == 0 ) leveltype2 = lpar;
+
+      if ( *leveltype == leveltype2 && *leveltype != 255 ) *lbounds = 1;
+
+      if ( *lbounds == 0 )
+	{
+	  if ( *leveltype == GRIB2_LTYPE_LANDDEPTH )
+	    {
+	      GRIB_CHECK(grib_get_long(gh, "scaleFactorOfFirstFixedSurface", &factor), 0);
+	      GRIB_CHECK(grib_get_double(gh, "scaledValueOfFirstFixedSurface", &dlevel), 0);
+	      if      ( factor == 0 ) dlevel *= 100;   //  m to cm
+	      else if ( factor == 1 ) dlevel *=  10;   // dm to cm
+	      else if ( factor == 3 ) dlevel *=   0.1; // mm to cm
+	    }
+	  else
+	    {
+	      GRIB_CHECK(grib_get_double(gh, "level", &dlevel), 0);
+	      if ( *leveltype == GRIB2_LTYPE_ISOBARIC ) dlevel *= 100;
+	      if ( dlevel < -2.e9 || dlevel > 2.e9 ) dlevel = 0;
+	      if ( *leveltype == 99 ) *leveltype = 100;
+	    }
+
+	  *level1 = (int) dlevel;
+	  *level2 = 0;
+	}
+      else
+	{
+	  if ( *leveltype == GRIB2_LTYPE_LANDDEPTH )
+	    {
+	      GRIB_CHECK(grib_get_long(gh, "scaleFactorOfFirstFixedSurface", &factor), 0);
+	      GRIB_CHECK(grib_get_double(gh, "scaledValueOfFirstFixedSurface", &dlevel), 0);
+	      if      ( factor == 0 ) dlevel *= 100;   //  m to cm
+	      else if ( factor == 1 ) dlevel *=  10;   // dm to cm
+	      else if ( factor == 3 ) dlevel *=   0.1; // mm to cm
+	      *level1 = (int) dlevel;
+	      GRIB_CHECK(grib_get_long(gh, "scaleFactorOfSecondFixedSurface", &factor), 0);
+	      GRIB_CHECK(grib_get_double(gh, "scaledValueOfSecondFixedSurface", &dlevel), 0);
+	      if      ( factor == 0 ) dlevel *= 100;   //  m to cm
+	      else if ( factor == 1 ) dlevel *=  10;   // dm to cm
+	      else if ( factor == 3 ) dlevel *=   0.1; // mm to cm
+	      *level2 = (int) dlevel;
+	    }
+	  else
+	    {
+	      GRIB_CHECK(grib_get_long(gh, "topLevel", &lpar), 0);
+	      *level1 = lpar;
+	      GRIB_CHECK(grib_get_long(gh, "bottomLevel", &lpar), 0);
+	      *level2 = lpar;
+	    }
+	}
+    }
+}
+
+static
+void gribapiAddRecord(int streamID, int param, grib_handle *gh,
+		      long recsize, off_t position, int datatype, int comptype)
+{
+  long editionNumber;
+  int zaxistype;
+  int gridID = CDI_UNDEFID, varID;
+  int levelID = 0;
+  int tsID, recID;
+  int level1 = 0, level2 = 0;
+  int numavg;
+  int tsteptype;
+  int lbounds = 0;
+  record_t *record;
+  grid_t grid;
+  int vlistID;
+  stream_t *streamptr;
+  int leveltype;
+  long lpar;
+  int status;
+  char name[256], longname[256], units[256];
+  size_t vlen;
+  long ens_index = 0, ens_count = 0, ens_forecast_type = 0;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  tsID    = streamptr->curTsID;
+  recID   = recordNewEntry(streamID, tsID);
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  tsteptype = gribapiGetTsteptype(gh);
+  // numavg  = ISEC1_AvgNum;
+  numavg  = 0;
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  if ( editionNumber <= 1 )
+    grib1GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+  else
+    grib2GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+
+  // fprintf(stderr, "param %d %d %d %d\n", param, level1, level2, leveltype);
+
+  (*record).size     = recsize;
+  (*record).position = position;
+  (*record).param    = param;
+  (*record).ilevel   = level1;
+  (*record).ilevel2  = level2;
+  (*record).ltype    = leveltype;
+
+  gribapiGetGrid(gh, &grid);
+
+  gridID = varDefGrid(vlistID, grid, 0);
+
+  zaxistype = gribapiGetZaxisType(editionNumber, leveltype);
+
+  switch (zaxistype)
+    {
+    case ZAXIS_HYBRID:
+    case ZAXIS_HYBRID_HALF:
+      {
+        int vctsize;
+        size_t dummy;
+        double *vctptr;
+
+        GRIB_CHECK(grib_get_long(gh, "NV", &lpar), 0);
+        vctsize = lpar;
+        if ( vctsize > 0 )
+          {
+            vctptr = (double *) malloc(vctsize*sizeof(double));
+            dummy = vctsize;
+            GRIB_CHECK(grib_get_double_array(gh, "pv", vctptr, &dummy), 0);
+            varDefVCT(vctsize, vctptr);
+            free(vctptr);
+          }
+        break;
+      }
+    case ZAXIS_REFERENCE:
+      {
+        size_t len;
+        char uuid[17];
+        long nlev, nvgrid;
+
+        GRIB_CHECK(grib_get_long(gh, "NV", &lpar), 0);
+        if ( lpar != 3 )
+          {
+            fprintf(stderr, "Warning ...\n");
+          }
+        GRIB_CHECK(grib_get_long(gh, "nlev", &nlev), 0);
+        GRIB_CHECK(grib_get_long(gh, "numberOfVGridUsed", &nvgrid), 0);
+
+        len = (size_t) 16;
+        uuid[16] = 0;
+        GRIB_CHECK(grib_get_string(gh, "uuidOfVGrid", uuid, &len), 0);
+        varDefZAxisReference((int) nlev, (int) nvgrid, uuid);
+        break;
+      }
+    }
+
+  // if ( datatype > 32 ) datatype = DATATYPE_PACK32;
+  if ( datatype <  0 ) datatype = DATATYPE_PACK;
+
+  name[0] = 0;
+  longname[0] = 0;
+  units[0] = 0;
+
+  vlen = 256;
+  GRIB_CHECK(grib_get_string(gh, "shortName", name, &vlen), 0);
+  if      ( vlen == 8 && memcmp(name, "unknown", vlen) == 0 ) name[0] = 0;
+  else if ( vlen == 2 && memcmp(name, "~", vlen)       == 0 ) name[0] = 0;
+
+  if ( name[0] != 0 )
+    {
+      vlen = 256;
+      GRIB_CHECK(grib_get_string(gh, "name", longname, &vlen), 0);
+      if ( vlen == 8 && memcmp(longname, "unknown", vlen) == 0 ) longname[0] = 0;
+      vlen = 256;
+      GRIB_CHECK(grib_get_string(gh, "units", units, &vlen), 0);
+      if ( vlen == 8 && memcmp(units, "unknown", vlen) == 0 ) units[0] = 0;
+    }
+  // fprintf(stderr, "param %d name %s %s %s\n", param, name, longname, units); 
+
+  varAddRecord(recID, param, gridID, zaxistype, lbounds, level1, level2,
+	       datatype, &varID, &levelID, tsteptype, numavg, leveltype,
+	       name, longname, units);
+
+  (*record).varID   = varID;
+  (*record).levelID = levelID;
+
+  varDefCompType(varID, comptype);
+
+  /*
+    Get the ensemble Info from the grib-2 Tables and update the intermediate datastructure.
+    Further update to the "vlist" is handled in the same way as for GRIB-1 by "cdiGenVars"
+  */
+  {
+    int status;
+    status = grib_get_long(gh, "typeOfEnsembleForecast", &ens_forecast_type );
+    if ( status == 0 )
+      {
+        GRIB_CHECK(grib_get_long(gh, "numberOfForecastsInEnsemble", &ens_count ), 0);
+        GRIB_CHECK(grib_get_long(gh, "perturbationNumber", &ens_index ), 0);
+      }
+  }
+  if ( ens_index > 0 )
+    varDefEnsembleInfo(varID, (int)ens_index, (int)ens_count, (int)ens_forecast_type);
+
+
+  if ( varInqInst(varID) == CDI_UNDEFID )
+    {
+      long center, subcenter;
+      int instID;
+      GRIB_CHECK(grib_get_long(gh, "centre", &center), 0);
+      GRIB_CHECK(grib_get_long(gh, "subCentre", &subcenter), 0);
+      instID    = institutInq((int)center, (int)subcenter, NULL, NULL);
+      if ( instID == CDI_UNDEFID )
+	instID = institutDef((int)center, (int)subcenter, NULL, NULL);
+      varDefInst(varID, instID);
+    }
+
+  if ( varInqModel(varID) == CDI_UNDEFID )
+    {
+      int modelID;
+      long processID;
+      status = grib_get_long(gh, "generatingProcessIdentifier", &processID);
+      if ( status == 0 )
+	{
+	  modelID = modelInq(varInqInst(varID), processID, NULL);
+	  if ( modelID == CDI_UNDEFID )
+	    modelID = modelDef(varInqInst(varID), processID, NULL);
+	  varDefModel(varID, modelID);
+	}
+    }
+
+  if ( varInqTable(varID) == CDI_UNDEFID )
+    {
+      int pdis, pcat, pnum;
+
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+
+      if ( pdis == 255 )
+	{
+	  int tableID;
+	  int tabnum = pcat;
+
+	  tableID = tableInq(varInqModel(varID), tabnum, NULL);
+
+	  if ( tableID == CDI_UNDEFID )
+	    tableID = tableDef(varInqModel(varID), tabnum, NULL);
+	  varDefTable(varID, tableID);
+	}
+    }
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+
+  if ( CDI_Debug )
+    Message("varID = %d  param = %d  zaxistype = %d  gridID = %d  levelID = %d",
+	    varID, param, zaxistype, gridID, levelID);
+}
+#endif
+
+int gribapiScanTimestep1(int streamID)
+{
+#if  defined  (HAVE_LIBGRIB_API)
+  off_t recpos = 0;
+  unsigned char *gribbuffer = NULL;
+  long buffersize = 0;
+  int rstatus;
+  int status;
+  int fileID;
+  int rtabnum = 0;
+  int rcode = 0, level1 = 0, level2 = 0;
+  int vdate = 0, vtime = 0;
+  int param = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  size_t readsize;
+  int nrecords, nrecs, recID;
+  int datatype;
+  long recsize = 0;
+  int warn_time = TRUE;
+  // int warn_numavg = TRUE;
+  int taxisID = -1;
+  int rdate = 0, rtime = 0, tunit = 0, fcast = 0;
+  taxis_t *taxis;
+  int vlistID;
+  int comptype;
+  long unzipsize;
+  compvar2_t compVar, compVar0;
+  stream_t *streamptr;
+  grib_handle *gh = NULL;
+  int leveltype;
+  int pdis = 0, pcat = 0, pnum = 0;
+  long editionNumber;
+  long lpar;
+  int bitsPerValue;
+  int lieee = FALSE;
+  int lbounds;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 0;
+
+  tsID  = tstepsNewEntry(streamID);
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( tsID != 0 )
+    Error("Internal problem! tstepsNewEntry returns %d", tsID);
+
+  fileID = streamInqFileID(streamID);
+
+  nrecs = 0;
+  while ( TRUE )
+    {
+      level1 = 0;
+      level2 = 0;
+      recsize = gribGetSize(fileID);
+      recpos  = fileGetPos(fileID);
+
+      if ( recsize == 0 )
+	{
+	  streamptr->ntsteps = 1;
+	  break;
+	}
+      if ( recsize > buffersize )
+	{
+	  buffersize = recsize;
+	  gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	}
+
+      readsize = recsize;
+      rstatus = gribRead(fileID, gribbuffer, &readsize);
+      if ( rstatus ) break;
+
+      lieee = FALSE;
+
+      comptype = COMPRESS_NONE;
+      if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	{
+	  comptype = COMPRESS_SZIP;
+	  unzipsize += 100;
+	  if ( (long) buffersize < unzipsize )
+	    {
+	      buffersize = unzipsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+	}
+
+      gh = grib_handle_new_from_message(NULL, (void *) gribbuffer, recsize);
+      GRIB_CHECK(grib_set_double(gh, "missingValue", cdiDefaultMissval), 0);
+
+      GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+      if ( editionNumber <= 1 )
+	{
+	  GRIB_CHECK(grib_get_long(gh, "table2Version", &lpar), 0);
+	  rtabnum = (int) lpar;
+	  GRIB_CHECK(grib_get_long(gh, "indicatorOfParameter", &lpar), 0);
+	  rcode = (int) lpar;
+
+	  param = cdiEncodeParam(rcode, rtabnum, 255);
+
+	  grib1GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	}
+      else
+	{
+	  size_t len = 256;
+	  char typeOfPacking[256];
+
+	  status = grib_get_string(gh, "packingType", typeOfPacking, &len);
+	  if ( status == 0 )
+	    {
+	      // fprintf(stderr, "packingType %d %s\n", len, typeOfPacking);
+	      if      ( strncmp(typeOfPacking, "grid_jpeg", len) == 0 ) comptype = COMPRESS_JPEG;
+	      else if ( strncmp(typeOfPacking, "grid_ieee", len) == 0 ) lieee = TRUE;
+	    }
+
+	  GRIB_CHECK(grib_get_long(gh, "discipline", &lpar), 0);
+	  pdis = (int) lpar;
+
+	  GRIB_CHECK(grib_get_long(gh, "parameterCategory", &lpar), 0);
+	  pcat = (int) lpar;
+
+	  GRIB_CHECK(grib_get_long(gh, "parameterNumber", &lpar), 0);
+	  pnum = (int) lpar;
+
+	  param = cdiEncodeParam(pnum, pcat, pdis);
+
+	  grib2GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	}
+
+      gribapiGetValidityDateTime(gh, &vdate, &vtime);
+      /*
+      printf("%d %d %d.%d.%d %d\n", vdate, vtime, pnum, pcat, pdis, leveltype);
+      */
+      if ( lieee )
+        {
+          datatype = DATATYPE_FLT64;
+          status = grib_get_long(gh, "precision", &lpar);
+          if ( status == 0 && lpar == 1 ) datatype = DATATYPE_FLT32;
+        }
+      else
+        {
+          datatype = DATATYPE_PACK;
+          status = grib_get_long(gh, "bitsPerValue", &lpar);
+          if ( status == 0 )
+            {
+              bitsPerValue = (int) lpar;
+              if ( bitsPerValue > 0 && bitsPerValue <= 32 )
+                datatype = bitsPerValue;
+            }
+        }
+
+      if ( nrecs == 0 )
+	{
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	  GRIB_CHECK(grib_get_long(gh, "dataDate", &lpar), 0);
+	  rdate = (int) lpar;
+	  GRIB_CHECK(grib_get_long(gh, "dataTime", &lpar), 0);
+	  rtime = (int) lpar*100;
+	  fcast = gribapiTimeIsFC(gh);
+	  if ( fcast ) tunit = gribapiGetTimeUnits(gh);
+	}
+      else
+	{
+	  datetime.date  = vdate;
+	  datetime.time  = vtime;
+
+	  compVar.param  = param;
+          compVar.level1 = level1;
+          compVar.level2 = level2;
+	  compVar.ltype  = leveltype;
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      compVar0.param  = streamptr->tsteps[0].records[recID].param;
+	      compVar0.level1 = streamptr->tsteps[0].records[recID].ilevel;
+	      compVar0.level2 = streamptr->tsteps[0].records[recID].ilevel2;
+	      compVar0.ltype  = streamptr->tsteps[0].records[recID].ltype;
+	      /*
+	      printf("var0: %d %d %d %d %d\n", recID, compVar0.param, compVar0.level1, compVar0.level2, compVar0.ltype);
+	      printf("var1: %d %d %d %d %d\n", recID, compVar.param, compVar.level1, compVar.level2, compVar.ltype);
+	      */
+	      if ( memcmp(&compVar0, &compVar, sizeof(compvar2_t)) == 0 ) break;
+	    }
+
+	  if ( cdiInventoryMode == 1 )
+	    {
+	      if ( recID < nrecs ) break;
+	      if ( warn_time )
+		if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 )
+		  {
+		    char paramstr[32];
+		    cdiParamToString(param, paramstr, sizeof(paramstr));
+		    Warning("Inconsistent verification time (param=%s level=%d)", paramstr, level1);
+		    warn_time = FALSE;
+		  }
+	    }
+	  else
+	    {
+	      if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+	      if ( recID < nrecs )
+		{
+		  char paramstr[32];
+		  cdiParamToString(param, paramstr, sizeof(paramstr));
+		  Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+		  continue;
+		}
+	    }
+	}
+      /*
+      if ( ISEC1_AvgNum )
+	{
+	  if (  taxis->numavg && warn_numavg && (taxis->numavg != ISEC1_AvgNum) )
+	    {
+	      Message("Change numavg from %d to %d not allowed!",
+		      taxis->numavg, ISEC1_AvgNum);
+	      warn_numavg = FALSE;
+	    }
+	  else
+	    {
+	      taxis->numavg = ISEC1_AvgNum;
+	    }
+	}
+      */
+      nrecs++;
+
+      if ( CDI_Debug )
+	Message("%4d %8d %4d  %8d %8d %6d", nrecs, (int)recpos, param, level1, vdate, vtime);
+
+      gribapiAddRecord(streamID, param, gh, recsize, recpos, datatype, comptype);
+
+      grib_handle_delete(gh);
+      gh = NULL;
+    }
+
+  if ( gh ) grib_handle_delete(gh);
+
+  streamptr->rtsteps = 1;
+
+  if ( nrecs == 0 ) return (CDI_EUFSTRUCT);
+
+  cdiGenVars(streamID);
+
+  if ( fcast )
+    {
+      taxisID = taxisCreate(TAXIS_RELATIVE);
+      taxis->type  = TAXIS_RELATIVE;
+      taxis->rdate = rdate;
+      taxis->rtime = rtime;
+      taxis->unit  = tunit;
+    }
+  else
+    {
+      taxisID = taxisCreate(TAXIS_ABSOLUTE);
+      taxis->type  = TAXIS_ABSOLUTE;
+    }
+
+  taxis->vdate = datetime0.date;
+  taxis->vtime = datetime0.time;
+
+  vlistID = streamInqVlist(streamID);
+  vlistDefTaxis(vlistID, taxisID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  if ( nrecords < streamptr->tsteps[0].recordSize )
+    {
+      streamptr->tsteps[0].recordSize = nrecords;
+      streamptr->tsteps[0].records =
+      (record_t *) realloc(streamptr->tsteps[0].records, nrecords*sizeof(record_t));
+    }
+
+  streamptr->tsteps[0].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[0].nrecs = nrecords;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[0].recIDs[recID] = recID;
+
+  streamptr->record->buffer     = gribbuffer;
+  streamptr->record->buffersize = buffersize;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( streamptr->ntsteps == 1 )
+    {
+      if ( taxis->vdate == 0 && taxis->vtime == 0 )
+	{
+	  streamptr->ntsteps = 0;
+	  for ( varID = 0; varID < streamptr->nvars; varID++ )
+	    {
+	      vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	    }
+	}
+    }
+#else
+  Error("GRIB_API support not compiled in!");
+#endif
+
+  return (0);
+}
+
+
+int gribapiScanTimestep2(int streamID)
+{
+  int rstatus = 0;
+#if  defined  (HAVE_LIBGRIB_API)
+  off_t recpos = 0;
+  unsigned char *gribbuffer = NULL;
+  long buffersize = 0;
+  int fileID;
+  int rtabnum = 0;
+  int rcode = 0, level1 = 0, level2 = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  // int gridID;
+  size_t readsize;
+  int nrecords, nrecs, recID, rindex;
+  long recsize = 0;
+  //  int warn_numavg = TRUE;
+  int tsteptype;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  long unzipsize;
+  compvar2_t compVar, compVar0;
+  stream_t *streamptr;
+  grib_handle *gh = NULL;
+  int leveltype;
+  int pdis = 0, pcat = 0, pnum = 0;
+  int param = 0;
+  long editionNumber;
+  long lpar;
+  int lbounds;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 1;
+
+  fileID  = streamInqFileID(streamID);
+  vlistID = streamInqVlist(streamID);
+  taxisID = vlistInqTaxis(vlistID);
+
+  gribbuffer = (unsigned char *) streamptr->record->buffer;
+  buffersize = streamptr->record->buffersize;
+
+  tsID = streamptr->rtsteps;
+  if ( tsID != 1 )
+    Error("Internal problem! unexpeceted timestep %d", tsID+1);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+  cdiCreateRecords(streamID, tsID);
+
+  nrecords = streamptr->tsteps[tsID].nallrecs;
+  streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[1].nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[1].recIDs[recID] = -1;
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID = streamptr->tsteps[0].records[recID].varID;
+      streamptr->tsteps[tsID].records[recID].position = streamptr->tsteps[0].records[recID].position;
+      streamptr->tsteps[tsID].records[recID].size     = streamptr->tsteps[0].records[recID].size;
+    }
+
+  rindex = 0;
+  while ( TRUE )
+    {
+      if ( rindex > nrecords ) break;
+
+      recsize = gribGetSize(fileID);
+      recpos  = fileGetPos(fileID);
+      if ( recsize == 0 )
+	{
+	  streamptr->ntsteps = 2;
+	  break;
+	}
+      if ( recsize > buffersize )
+	{
+	  buffersize = recsize;
+	  gribbuffer = (unsigned char *) realloc(gribbuffer, (size_t)buffersize);
+	}
+
+      readsize = recsize;
+      rstatus = gribRead(fileID, gribbuffer, &readsize);
+      if ( rstatus ) break;
+
+      if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	{
+	  unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+	  if ( (long) buffersize < unzipsize )
+	    {
+	      buffersize = unzipsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+	}
+
+      gh = grib_handle_new_from_message(NULL, (void *) gribbuffer, recsize);
+      GRIB_CHECK(grib_set_double(gh, "missingValue", cdiDefaultMissval), 0);
+
+      GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+      if ( editionNumber <= 1 )
+	{
+	  GRIB_CHECK(grib_get_long(gh, "table2Version", &lpar), 0);
+	  rtabnum = (int) lpar;
+	  GRIB_CHECK(grib_get_long(gh, "indicatorOfParameter", &lpar), 0);
+	  rcode = (int) lpar;
+
+	  param = cdiEncodeParam(rcode, rtabnum, 255);
+
+	  grib1GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	}
+      else
+	{
+	  GRIB_CHECK(grib_get_long(gh, "discipline", &lpar), 0);
+	  pdis = (int) lpar;
+
+	  GRIB_CHECK(grib_get_long(gh, "parameterCategory", &lpar), 0);
+	  pcat = (int) lpar;
+
+	  GRIB_CHECK(grib_get_long(gh, "parameterNumber", &lpar), 0);
+	  pnum = (int) lpar;
+
+	  param = cdiEncodeParam(pnum, pcat, pdis);
+
+	  grib2GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	}
+
+      gribapiGetValidityDateTime(gh, &vdate, &vtime);
+
+      if ( rindex == 0 )
+	{
+	  if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
+	    {
+	      taxis->type  = TAXIS_RELATIVE;
+	      GRIB_CHECK(grib_get_long(gh, "dataDate", &lpar), 0);
+	      taxis->rdate = (int) lpar;
+	      GRIB_CHECK(grib_get_long(gh, "dataTime", &lpar), 0);
+	      taxis->rtime = (int) lpar*100;
+	      taxis->unit  = gribapiGetTimeUnits(gh);
+	    }
+	  else
+	    {
+	      taxis->type  = TAXIS_ABSOLUTE;
+	    }
+	  taxis->vdate = vdate;
+	  taxis->vtime = vtime;
+
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	}
+
+      tsteptype = gribapiGetTsteptype(gh);
+      /*
+      if ( ISEC1_AvgNum )
+	{
+	  if (  taxis->numavg && warn_numavg &&
+		(taxis->numavg != ISEC1_AvgNum) )
+	    {
+	      warn_numavg = FALSE;
+	    }
+	  else
+	    {
+	      taxis->numavg = ISEC1_AvgNum;
+	    }
+	}
+      */
+      datetime.date  = vdate;
+      datetime.time  = vtime;
+      compVar.param  = param;
+      compVar.level1 = level1;
+      compVar.level2 = level2;
+      compVar.ltype  = leveltype;
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	  compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	  compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(compvar2_t)) == 0 ) break;
+	}
+
+      if ( recID == nrecords )
+	{
+	  char paramstr[32];
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+	  Warning("Param=%s level=%d not defined at timestep 1!", paramstr, level1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      if ( cdiInventoryMode == 1 )
+	{
+	  if ( streamptr->tsteps[tsID].records[recID].used )
+	    {
+	      break;
+	    }
+	  else
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }    
+	}
+      else
+	{
+	  if ( streamptr->tsteps[tsID].records[recID].used )
+	    {
+	      char paramstr[32];
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+
+	      if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+	      Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+	      continue;
+	    }
+	  else
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }    
+	}
+
+      if ( CDI_Debug )
+	Message("%4d %8d %4d %8d %8d %6d", rindex+1, (int)recpos, param, level1, vdate, vtime);
+
+      streamptr->tsteps[tsID].records[recID].size = recsize;
+
+      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+      compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+      compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+      compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+      if ( memcmp(&compVar0, &compVar, sizeof(compvar2_t)) != 0 )
+	{
+	  Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		  tsID, recID,
+		  streamptr->tsteps[tsID].records[recID].param, param,
+		  streamptr->tsteps[tsID].records[recID].ilevel, level1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->tsteps[1].records[recID].position = recpos;
+      varID = streamptr->tsteps[tsID].records[recID].varID;
+      /*
+      gridID = vlistInqVarGrid(vlistID, varID);
+      if ( gridInqSize(gridID) == 1 && gridInqType(gridID) == GRID_LONLAT )
+	{
+	  if ( IS_NOT_EQUAL(gridInqXval(gridID, 0),ISEC2_FirstLon*0.001) ||
+	       IS_NOT_EQUAL(gridInqYval(gridID, 0),ISEC2_FirstLat*0.001) )
+	    gridChangeType(gridID, GRID_TRAJECTORY);
+	}
+      */
+      if ( tsteptype != vlistInqVarTsteptype(vlistID, varID) )
+	vlistDefVarTsteptype(vlistID, varID, tsteptype);
+
+      grib_handle_delete(gh);
+      gh = NULL;
+
+      rindex++;
+    }
+
+  if ( gh ) grib_handle_delete(gh);
+
+  nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      if ( ! streamptr->tsteps[tsID].records[recID].used )
+	{
+	  varID = streamptr->tsteps[tsID].records[recID].varID;
+	  vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	}
+      else
+	{
+	  nrecs++;
+	}
+    }
+  streamptr->tsteps[tsID].nrecs = nrecs;
+
+  streamptr->rtsteps = 2;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  streamptr->record->buffer     = gribbuffer;
+  streamptr->record->buffersize = buffersize;
+#endif
+
+  return (rstatus);
+}
+
+
+int gribapiScanTimestep(int streamID)
+{
+  int rstatus = 0;
+#if  defined  (HAVE_LIBGRIB_API)
+  long recsize = 0;
+  off_t recpos = 0;
+  unsigned char *gribbuffer;
+  long buffersize = 0;
+  int fileID;
+  int rtabnum = 0;
+  int rcode = 0, level1 = 0, level2 = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int vrecID, recID;
+  //int warn_numavg = TRUE;
+  size_t readsize;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  int rindex, nrecs = 0;
+  long unzipsize;
+  compvar2_t compVar, compVar0;
+  stream_t *streamptr;
+  grib_handle *gh = NULL;
+  int leveltype;
+  int pdis = 0, pcat = 0, pnum = 0;
+  int param = 0;
+  long editionNumber;
+  long lpar;
+  int lbounds;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+
+  if ( CDI_Debug )
+    {
+      Message("streamID = %d", streamID);
+      Message("cts = %d", streamptr->curTsID);
+      Message("rts = %d", streamptr->rtsteps);
+      Message("nts = %d", streamptr->ntsteps);
+    }
+
+  tsID  = streamptr->rtsteps;
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->tsteps[tsID].recordSize == 0 )
+    {
+      gribbuffer = (unsigned char *) streamptr->record->buffer;
+      buffersize = streamptr->record->buffersize;
+
+      cdiCreateRecords(streamID, tsID);
+
+      nrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->tsteps[tsID].nrecs = nrecs;
+      streamptr->tsteps[tsID].recIDs = (int *) malloc(nrecs*sizeof(int));
+      for ( recID = 0; recID < nrecs; recID++ )
+	streamptr->tsteps[tsID].recIDs[recID] = streamptr->tsteps[1].recIDs[recID];
+
+      fileID = streamInqFileID(streamID);
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+      rindex = 0;
+      while ( TRUE )
+	{
+	  if ( rindex > nrecs ) break;
+
+	  recsize = gribGetSize(fileID);
+	  recpos  = fileGetPos(fileID);
+	  if ( recsize == 0 )
+	    {
+	      streamptr->ntsteps = streamptr->rtsteps + 1;
+	      break;
+	    }
+
+	  if ( rindex >= nrecs ) break;
+
+	  if ( recsize > buffersize )
+	    {
+	      buffersize = recsize;
+	      gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+	    }
+
+	  readsize = recsize;
+	  rstatus = gribRead(fileID, gribbuffer, &readsize);
+	  if ( rstatus )
+	    {
+	      Warning("Inconsistent timestep %d (GRIB record %d/%d)!", tsID+1, rindex+1,
+		      streamptr->tsteps[tsID].recordSize);
+	      break;
+	    }
+
+	  if ( gribGetZip(recsize, gribbuffer, &unzipsize) > 0 )
+	    {
+	      unzipsize += 100; /* need 0 to 1 bytes for rounding of bds */
+	      if ( (long) buffersize < unzipsize )
+		{
+		  buffersize = unzipsize;
+		  gribbuffer = (unsigned char *) realloc(gribbuffer, buffersize);
+		}
+	    }
+
+	  gh = grib_handle_new_from_message(NULL, (void *) gribbuffer, recsize);
+	  GRIB_CHECK(grib_set_double(gh, "missingValue", cdiDefaultMissval), 0);
+
+	  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+	  if ( editionNumber <= 1 )
+	    {
+	      GRIB_CHECK(grib_get_long(gh, "table2Version", &lpar), 0);
+	      rtabnum = (int) lpar;
+	      GRIB_CHECK(grib_get_long(gh, "indicatorOfParameter", &lpar), 0);
+	      rcode = (int) lpar;
+
+	      param = cdiEncodeParam(rcode, rtabnum, 255);
+
+	      grib1GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	    }
+	  else
+	    {
+	      GRIB_CHECK(grib_get_long(gh, "discipline", &lpar), 0);
+	      pdis = (int) lpar;
+
+	      GRIB_CHECK(grib_get_long(gh, "parameterCategory", &lpar), 0);
+	      pcat = (int) lpar;
+
+	      GRIB_CHECK(grib_get_long(gh, "parameterNumber", &lpar), 0);
+	      pnum = (int) lpar;
+
+	      param = cdiEncodeParam(pnum, pcat, pdis);
+
+	      grib2GetLevel(gh, &leveltype, &lbounds, &level1, &level2);
+	    }
+
+	  gribapiGetValidityDateTime(gh, &vdate, &vtime);
+
+	  if ( rindex == nrecs ) break;
+
+	  if ( rindex == 0 )
+	    {
+	      taxisID = vlistInqTaxis(vlistID);
+	      if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
+		{
+		  taxis->type  = TAXIS_RELATIVE;
+		  GRIB_CHECK(grib_get_long(gh, "dataDate", &lpar), 0);
+		  taxis->rdate = (int) lpar;
+		  GRIB_CHECK(grib_get_long(gh, "dataTime", &lpar), 0);
+		  taxis->rtime = (int) lpar*100;
+		  taxis->unit  = gribapiGetTimeUnits(gh);
+		}
+	      else
+		{
+		  taxis->type  = TAXIS_ABSOLUTE;
+		}
+	      taxis->vdate = vdate;
+	      taxis->vtime = vtime;
+
+	      datetime0.date = vdate;
+	      datetime0.time = vtime;
+	    }
+	  /*
+	  if ( ISEC1_AvgNum )
+	    {
+	      if (  taxis->numavg && warn_numavg &&
+		   (taxis->numavg != ISEC1_AvgNum) )
+		{
+		  warn_numavg = FALSE;
+		}
+	      else
+		{
+		  taxis->numavg = ISEC1_AvgNum;
+		}
+	    }
+	  */
+	  datetime.date  = vdate;
+	  datetime.time  = vtime;
+	  compVar.param  = param;
+          compVar.level1 = level1;
+          compVar.level2 = level2;
+          compVar.ltype  = leveltype;
+	  for ( vrecID = 0; vrecID < nrecs; vrecID++ )
+	    {
+	      recID   = streamptr->tsteps[1].recIDs[vrecID];
+	      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	      compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	      compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	      compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(compvar2_t)) == 0 ) break;
+	    }
+
+	  if ( vrecID == nrecs )
+	    {
+	      char paramstr[32];
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+	      Warning("Param=%s level=%d not available at timestep %d!", paramstr, level1, tsID+1);
+
+	      if ( cdiInventoryMode == 1 )
+		return (CDI_EUFSTRUCT);
+	      else
+		continue;
+	    }
+
+	  if ( cdiInventoryMode == 1 )
+	    {
+	      streamptr->tsteps[tsID].records[recID].used = TRUE;
+	      streamptr->tsteps[tsID].recIDs[rindex] = recID;
+	    }
+	  else
+	    {
+	      if ( streamptr->tsteps[tsID].records[recID].used )
+		{
+		  char paramstr[32];
+		  cdiParamToString(param, paramstr, sizeof(paramstr));
+
+		  if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) != 0 ) break;
+
+		  if ( CDI_Debug )
+		    Warning("Param=%s level=%d already exist, skipped!", paramstr, level1);
+
+		  continue;
+		}
+	      else
+		{
+		  streamptr->tsteps[tsID].records[recID].used = TRUE;
+		  streamptr->tsteps[tsID].recIDs[rindex] = recID;
+		}
+	    }
+
+	  if ( CDI_Debug )
+	    Message("%4d %8d %4d %8d %8d %6d", rindex+1, (int)recpos, param, level1, vdate, vtime);
+
+	  compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level1 = streamptr->tsteps[tsID].records[recID].ilevel;
+	  compVar0.level2 = streamptr->tsteps[tsID].records[recID].ilevel2;
+	  compVar0.ltype  = streamptr->tsteps[tsID].records[recID].ltype;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(compvar2_t)) != 0 )
+	    {
+	      Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		      tsID, recID,
+		      streamptr->tsteps[tsID].records[recID].param, param,
+		      streamptr->tsteps[tsID].records[recID].ilevel, level1);
+	      Error("Invalid, unsupported or inconsistent record structure");
+	    }
+
+	  streamptr->tsteps[tsID].records[recID].position = recpos;
+	  streamptr->tsteps[tsID].records[recID].size = recsize;
+
+	  if ( CDI_Debug )
+	    Message("%4d %8d %4d %8d %8d %6d", rindex, (int)recpos, param, level1, vdate, vtime);
+
+	  grib_handle_delete(gh);
+	  gh = NULL;
+
+	  rindex++;
+	}
+
+      if ( gh ) grib_handle_delete(gh);
+
+      for ( vrecID = 0; vrecID < nrecs; vrecID++ )
+	{
+	  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+	  if ( ! streamptr->tsteps[tsID].records[recID].used ) break;
+	}
+
+      if ( vrecID < nrecs )
+	{
+	  char paramstr[32];
+	  cdiParamToString(streamptr->tsteps[tsID].records[recID].param, paramstr, sizeof(paramstr));
+	  Warning("Param %d level %d not found at timestep %d!",
+		  paramstr, streamptr->tsteps[tsID].records[recID].ilevel, tsID+1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->rtsteps++;
+
+      if ( streamptr->ntsteps != streamptr->rtsteps )
+	{
+	  tsID = tstepsNewEntry(streamID);
+	  if ( tsID != streamptr->rtsteps )
+	    Error("Internal error. tsID = %d", tsID);
+
+	  streamptr->tsteps[tsID-1].next   = 1;
+	  streamptr->tsteps[tsID].position = recpos;
+	}
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+      streamptr->tsteps[tsID].position = recpos;
+
+      streamptr->record->buffer     = gribbuffer;
+      streamptr->record->buffersize = buffersize;
+    }
+
+  if ( nrecs > 0 && nrecs < streamptr->tsteps[tsID].nrecs )
+    {
+      Warning("Incomplete timestep. Stop scanning at timestep %d.", tsID);
+      streamptr->ntsteps = tsID;
+    }
+
+  rstatus = streamptr->ntsteps;
+#else
+  Error("GRIB_API support not compiled in!");
+#endif
+
+  return (rstatus);
+}
+
+
+int gribapiDecode(unsigned char *gribbuffer, int gribsize, double *data, int gridsize,
+		  int unreduced, int *nmiss, int *zip, double missval)
+{
+  int status = 0;
+#if  defined  (HAVE_LIBGRIB_API)
+  long lpar;
+  long editionNumber, numberOfPoints;
+  size_t datasize, dummy, recsize;
+  grib_handle *gh = NULL;
+
+  if ( unreduced )
+    {
+      static int lwarn = 1;
+
+      if ( lwarn )
+	{
+	  lwarn = 0;
+	  Warning("Conversion of gaussian reduced grids unsupported!");
+	}
+    }
+
+  recsize = gribsize;
+  gh = grib_handle_new_from_message(NULL, (void *) gribbuffer, recsize);
+  GRIB_CHECK(grib_set_double(gh, "missingValue", missval), 0);
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  /* get the size of the values array*/
+  GRIB_CHECK(grib_get_size(gh, "values", &datasize), 0);
+  GRIB_CHECK(grib_get_long(gh, "numberOfPoints", &numberOfPoints), 0);
+
+  // printf("values_size = %d  numberOfPoints = %ld\n", datasize, numberOfPoints);
+
+  if ( gridsize != (int) datasize )
+    Error("Internal problem: gridsize(%d) != datasize(%d)!", gridsize, datasize);
+  dummy = datasize;
+  GRIB_CHECK(grib_get_double_array(gh, "values", data, &dummy), 0);
+
+  int gridtype;
+  GRIB_CHECK(grib_get_long(gh, "gridDefinitionTemplateNumber", &lpar), 0);
+  gridtype = (int) lpar;
+
+  *nmiss = 0;
+  if ( gridtype < 50 || gridtype > 53 )
+    {
+      GRIB_CHECK(grib_get_long(gh, "numberOfMissing", &lpar), 0);
+      *nmiss = (int) lpar;
+      // printf("gridtype %d, nmiss %d\n", gridtype, nmiss);
+    }
+
+  grib_handle_delete(gh);
+
+#else
+  Error("GRIB_API support not compiled in!");
+#endif
+
+  return (status);
+}
+
+#if  defined  (HAVE_LIBGRIB_API)
+static
+void gribapiDefInstitut(grib_handle *gh, int vlistID, int varID)
+{
+  int instID;
+
+  if ( vlistInqInstitut(vlistID) != CDI_UNDEFID )
+    instID = vlistInqInstitut(vlistID);
+  else
+    instID = vlistInqVarInstitut(vlistID, varID);
+
+  if ( instID != CDI_UNDEFID )
+    {
+      long center, subcenter;
+      long center0, subcenter0;
+
+      center    = institutInqCenter(instID);
+      subcenter = institutInqSubcenter(instID);
+
+      GRIB_CHECK(grib_get_long(gh, "centre", &center0), 0);
+      GRIB_CHECK(grib_get_long(gh, "subCentre", &subcenter0), 0);
+
+      if ( center != center0 )
+	GRIB_CHECK(grib_set_long(gh, "centre", center), 0);
+      if ( subcenter != subcenter0 )
+	GRIB_CHECK(grib_set_long(gh, "subCentre", subcenter), 0);
+    }
+}
+
+static
+void gribapiDefModel(grib_handle *gh, int vlistID, int varID)
+{
+  int modelID;
+
+  if ( vlistInqModel(vlistID) != CDI_UNDEFID )
+    modelID = vlistInqModel(vlistID);
+  else
+    modelID = vlistInqVarModel(vlistID, varID);
+
+  if ( modelID != CDI_UNDEFID )
+    GRIB_CHECK(grib_set_long(gh, "generatingProcessIdentifier", modelInqGribID(modelID)), 0);
+}
+
+static
+void gribapiDefParam(int editionNumber, grib_handle *gh, int param, const char *name)
+{
+  int pdis, pcat, pnum;
+
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+
+  if ( pnum < 0 )
+    {
+      size_t len;
+      int status;
+      len = strlen(name);
+      status = grib_set_string(gh, "shortName", name, &len);
+      if ( status != 0 )
+	Warning("grib_api: No match for shortName=%s", name);
+    }
+  else
+    {
+      if ( pnum < 0 ) pnum = -pnum;
+
+      if ( editionNumber <= 1 )
+	{
+	  if ( pdis != 255 )
+	    {
+	      char paramstr[32];
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+	      Warning("Can't convert GRIB2 parameter ID (%s) to GRIB1, set to %d.%d!", paramstr, pnum, pcat);
+	    }
+
+	  GRIB_CHECK(grib_set_long(gh, "table2Version",        pcat), 0);
+	  GRIB_CHECK(grib_set_long(gh, "indicatorOfParameter", pnum), 0);
+	}
+      else
+	{
+	  GRIB_CHECK(grib_set_long(gh, "discipline",        pdis), 0);
+	  GRIB_CHECK(grib_set_long(gh, "parameterCategory", pcat), 0);
+	  GRIB_CHECK(grib_set_long(gh, "parameterNumber",   pnum), 0);
+	}
+    }
+
+  // printf("param: %d.%d.%d %s\n", pnum, pcat, pdis, name);
+}
+
+static
+int gribapiDefStepUnits(grib_handle *gh, int timeunit, int gcinit)
+{
+  int factor = 1;
+  long unitsOfTime;
+  char stepunits[8];
+  size_t len;
+
+  switch (timeunit)
+    {
+    case TUNIT_SECOND:  factor =     1;  unitsOfTime = 13;  strcpy(stepunits, "s");   break;
+    case TUNIT_MINUTE:  factor =    60;  unitsOfTime =  0;  strcpy(stepunits, "m");   break;
+    case TUNIT_HOUR:    factor =  3600;  unitsOfTime =  1;  strcpy(stepunits, "h");   break;
+    case TUNIT_3HOURS:  factor = 10800;  unitsOfTime = 10;  strcpy(stepunits, "3h");  break;
+    case TUNIT_6HOURS:  factor = 21600;  unitsOfTime = 11;  strcpy(stepunits, "6h");  break;
+    case TUNIT_12HOURS: factor = 43200;  unitsOfTime = 12;  strcpy(stepunits, "12h"); break;
+    case TUNIT_DAY:     factor = 86400;  unitsOfTime =  2;  strcpy(stepunits, "D");   break;
+    default:            factor =  3600;  unitsOfTime =  1;  strcpy(stepunits, "h");   break;
+    }
+
+  if ( !gcinit )
+    {
+      len = strlen(stepunits) + 1;
+      GRIB_CHECK(grib_set_long(gh, "indicatorOfUnitOfTimeRange", unitsOfTime), 0);
+      GRIB_CHECK(grib_set_string(gh, "stepUnits", stepunits, &len), 0);
+    }
+
+  return (factor);
+}
+
+static
+int gribapiDefSteptype(int editionNumber, grib_handle *gh, int tsteptype, int gcinit)
+{
+  long proDefTempNum = 0;
+  size_t len = 64;
+  char stepType[64];
+
+  switch ( tsteptype )
+    {
+    case TSTEP_AVG:      strcpy(stepType, "avg");     proDefTempNum = 8; break;
+    case TSTEP_ACCUM:    strcpy(stepType, "accum");   proDefTempNum = 8; break;
+    case TSTEP_MAX:      strcpy(stepType, "max");     proDefTempNum = 8; break;
+    case TSTEP_MIN:      strcpy(stepType, "min");     proDefTempNum = 8; break;
+    case TSTEP_DIFF:     strcpy(stepType, "diff");    proDefTempNum = 8; break;
+    case TSTEP_RMS:      strcpy(stepType, "rms");     proDefTempNum = 8; break;
+    case TSTEP_SD:       strcpy(stepType, "sd");      proDefTempNum = 8; break;
+    case TSTEP_COV:      strcpy(stepType, "cov");     proDefTempNum = 8; break;
+    case TSTEP_RATIO:    strcpy(stepType, "ratio");   proDefTempNum = 8; break;
+    case TSTEP_INSTANT:  strcpy(stepType, "instant"); proDefTempNum = 0; break;
+    default:             strcpy(stepType, "instant"); proDefTempNum = 0; break;
+    }
+
+  if ( !gcinit )
+    {
+      if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "productDefinitionTemplateNumber", proDefTempNum), 0);
+      len = strlen(stepType);
+      GRIB_CHECK(grib_set_string(gh, "stepType", stepType, &len), 0);
+    }
+
+  return ((int)proDefTempNum);
+}
+
+static
+void gribapiDefDateTimeAbs(int editionNumber, grib_handle *gh, int date, int time, int tsteptype, int gcinit)
+{
+  if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "significanceOfReferenceTime", 0), 0);
+  if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "stepRange", 0), 0);
+
+  if ( date == 0 ) date = 10101;
+  GRIB_CHECK(grib_set_long(gh, "dataDate", date), 0);
+  GRIB_CHECK(grib_set_long(gh, "dataTime", time/100), 0);
+
+  (void ) gribapiDefSteptype(editionNumber, gh, tsteptype, gcinit);
+}
+
+static
+int gribapiDefDateTimeRel(int editionNumber, grib_handle *gh, int rdate, int rtime, int vdate, int vtime,
+                          int tsteptype, int factor, int calendar, int gcinit)
+{
+  int status = -1;
+  int year, month, day, hour, minute, second;
+  int julday1, secofday1, julday2, secofday2, days, secs;
+  long startStep = 0, endStep;
+  long proDefTempNum = 0;
+
+  cdiDecodeDate(rdate, &year, &month, &day);
+  cdiDecodeTime(rtime, &hour, &minute, &second);
+  encode_juldaysec(calendar, year, month, day, hour, minute, &julday1, &secofday1);
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+  encode_juldaysec(calendar, year, month, day, hour, minute, &julday2, &secofday2);
+
+  (void) julday_sub(julday1, secofday1, julday2, secofday2, &days, &secs);
+
+  if ( !(int) fmod(days*86400.0 + secs, factor) )
+    {
+      endStep = (int) ((days*86400.0 + secs)/factor);
+
+      if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "significanceOfReferenceTime", 1), 0);
+      if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "stepRange", 0), 0);
+
+      if ( rdate == 0 ) rdate = 10101;
+      GRIB_CHECK(grib_set_long(gh, "dataDate", rdate), 0);
+      GRIB_CHECK(grib_set_long(gh, "dataTime", rtime/100), 0);
+
+      // printf(">>>>> tsteptype %d  startStep %d  endStep %d\n", tsteptype, startStep, endStep);
+
+      proDefTempNum = gribapiDefSteptype(editionNumber, gh, tsteptype, gcinit);
+
+      if ( proDefTempNum == 0 ) startStep = endStep;
+
+      if ( editionNumber > 1 ) GRIB_CHECK(grib_set_long(gh, "forecastTime", startStep), 0);
+      GRIB_CHECK(grib_set_long(gh, "endStep", endStep), 0);
+
+      status = 0;
+    }
+
+  return (status);
+}
+
+static
+void gribapiDefTime(int editionNumber, grib_handle *gh , int vdate, int vtime, int tsteptype, int numavg, int taxisID, int gcinit)
+{
+  int taxistype = -1;
+  int timeunit;
+  int factor;
+
+  if ( taxisID != -1 ) taxistype = taxisInqType(taxisID);
+
+  timeunit = taxisInqTunit(taxisID);
+
+  factor = gribapiDefStepUnits(gh, timeunit, gcinit);
+
+  if ( taxistype == TAXIS_RELATIVE )
+    {
+      int status;
+      int calendar = taxisInqCalendar(taxisID);
+      int rdate    = taxisInqRdate(taxisID);
+      int rtime    = taxisInqRtime(taxisID);
+
+      status = gribapiDefDateTimeRel(editionNumber, gh, rdate, rtime, vdate, vtime,
+                                     tsteptype, factor, calendar, gcinit);
+
+      if ( status != 0 ) taxistype = TAXIS_ABSOLUTE;
+    }
+
+  if ( taxistype == TAXIS_ABSOLUTE )
+    {
+      gribapiDefDateTimeAbs(editionNumber, gh, vdate, vtime, tsteptype, gcinit);
+    }
+}
+
+static
+void gribapiDefGrid(int editionNumber, grib_handle *gh, int gridID, int ljpeg, int lieee, int datatype, int nmiss, int gcinit)
+{
+  int gridtype;
+  int status;
+  char uuid[17];
+  static short lwarn = TRUE;
+  size_t len;
+  char *mesg;
+
+  gridtype = gridInqType(gridID);
+
+  if ( editionNumber <= 1 )
+    if ( gridtype == GRID_GME || gridtype == GRID_REFERENCE )
+      gridtype = -1;
+
+  if ( gridtype == GRID_GENERIC )
+    {
+      int xsize, ysize, gridsize;
+
+      gridsize = gridInqSize(gridID);
+      xsize = gridInqXsize(gridID);
+      ysize = gridInqYsize(gridID);
+
+      if ( (ysize ==  32 || ysize ==  48 || ysize ==  64 ||
+	    ysize ==  96 || ysize == 160 || ysize == 192 ||
+	    ysize == 240 || ysize == 320 || ysize == 384 ||
+	    ysize == 480 || ysize == 768 ) &&
+	   (xsize == 2*ysize || xsize == 1) )
+	{
+	  gridtype = GRID_GAUSSIAN;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( gridsize == 1 )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( gridInqXvals(gridID, NULL) && gridInqYvals(gridID, NULL) )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+    }
+  else if ( gridtype == GRID_CURVILINEAR )
+    {
+      if ( lwarn && gridInqSize(gridID) > 1 )
+	{
+	  lwarn = FALSE;
+	  Warning("Curvilinear grids are unsupported in GRIB format! Created wrong GDS!");
+	}
+      gridtype = GRID_LONLAT;
+    }
+
+
+  if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN )
+    {
+      if ( editionNumber != 2 || lieee ) { ljpeg = 0; }
+
+      if ( ljpeg )
+        {
+          if ( nmiss > 0 ) ljpeg = 0;
+
+          if ( ljpeg )
+            {
+              mesg = "grid_jpeg"; len = strlen(mesg);
+              GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+            }
+          else
+            {
+              mesg = "grid_simple"; len = strlen(mesg);
+              GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+            }
+        }
+    }
+
+  if ( gcinit ) return;
+
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_GAUSSIAN_REDUCED:
+    case GRID_TRAJECTORY:
+      {
+	int nlon = 0, nlat;
+	double xfirst = 0, xlast = 0, xinc = 0;
+	double yfirst = 0, ylast = 0, yinc = 0;
+	double latIncr;
+
+	if ( gridtype == GRID_GAUSSIAN )
+	  {
+	    mesg = "regular_gg"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "gridType", mesg, &len), 0);
+	  }
+	else if ( gridtype == GRID_GAUSSIAN_REDUCED )
+	  {
+	    mesg = "reduced_gg"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "gridType", mesg, &len), 0);
+	  }
+	else if ( gridtype == GRID_LONLAT && gridIsRotated(gridID) )
+	  {
+	    mesg = "rotated_ll"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "gridType", mesg, &len), 0);
+	  }
+	else
+	  {
+	    mesg = "regular_ll"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "gridType", mesg, &len), 0);
+	  }
+
+	nlon = gridInqXsize(gridID);
+	nlat = gridInqYsize(gridID);
+
+	if ( gridtype == GRID_GAUSSIAN_REDUCED )
+	  {
+	    int *rowlon, i;
+	    long *pl = NULL;
+
+	    nlon = 0;
+
+	    rowlon = (int *) malloc(nlat*sizeof(int));
+	    pl     = (long *) malloc(nlat*sizeof(long));
+	    gridInqRowlon(gridID, rowlon);
+	    for ( i = 0; i < nlat; ++i ) pl[i] = rowlon[i];
+
+	    // GRIB_CHECK(grib_set_long_array(gh, "pl", pl, nlat), 0);
+
+	    free(pl);
+	    free(rowlon);
+	  }
+	else
+	  {
+	    if ( nlon == 0 )
+	      {
+		nlon = 1;
+	      }
+	    else
+	      {
+		xfirst = gridInqXval(gridID,      0);
+		xlast  = gridInqXval(gridID, nlon-1);
+		xinc   = gridInqXinc(gridID);
+	      }
+	  }
+
+	if ( nlat == 0 )
+	  {
+	    nlat = 1;
+	  }
+	else
+	  {
+	    yfirst = gridInqYval(gridID,      0);
+	    ylast  = gridInqYval(gridID, nlat-1);
+	    yinc   = gridInqYinc(gridID);
+	  }
+
+	GRIB_CHECK(grib_set_long(gh, "Ni", nlon), 0);
+	GRIB_CHECK(grib_set_long(gh, "Nj", nlat), 0);
+	GRIB_CHECK(grib_set_double(gh, "longitudeOfFirstGridPointInDegrees", xfirst), 0);
+	GRIB_CHECK(grib_set_double(gh, "longitudeOfLastGridPointInDegrees",  xlast), 0);
+	GRIB_CHECK(grib_set_double(gh, "latitudeOfFirstGridPointInDegrees",  yfirst), 0);
+	GRIB_CHECK(grib_set_double(gh, "latitudeOfLastGridPointInDegrees",   ylast), 0);
+	GRIB_CHECK(grib_set_double(gh, "iDirectionIncrementInDegrees", xinc), 0);
+
+        {
+          long jscan = 0;
+          if ( yfirst < ylast ) jscan = 1;
+          GRIB_CHECK(grib_set_long(gh, "jScansPositively", jscan), 0);
+        }
+	/*
+	if ( fabs(xinc*1000 - ISEC2_LonIncr) > FLT_EPSILON )
+	  ISEC2_LonIncr = 0;
+	*/
+	if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
+          {
+            int np = gridInqNP(gridID);
+            if ( np == 0 ) np = nlat/2;
+            GRIB_CHECK(grib_set_long(gh, "numberOfParallelsBetweenAPoleAndTheEquator", np), 0);
+          }
+	else
+	  {
+	    latIncr = yinc;
+	    if ( latIncr < 0 ) latIncr = -latIncr;
+	    GRIB_CHECK(grib_set_double(gh, "jDirectionIncrementInDegrees", latIncr), 0);
+	    /*
+	    if ( fabs(yinc*1000 - ISEC2_LatIncr) > FLT_EPSILON )
+	      ISEC2_LatIncr = 0;
+	    */
+	  }
+	/*
+	if ( ISEC2_NumLon > 1 && ISEC2_NumLat == 1 ) 
+	  if ( ISEC2_LonIncr != 0 && ISEC2_LatIncr == 0 ) ISEC2_LatIncr = ISEC2_LonIncr;
+
+	if ( ISEC2_NumLon == 1 && ISEC2_NumLat > 1 ) 
+	  if ( ISEC2_LonIncr == 0 && ISEC2_LatIncr != 0 ) ISEC2_LonIncr = ISEC2_LatIncr;
+
+	if ( ISEC2_LatIncr == 0 || ISEC2_LonIncr == 0 )
+	  ISEC2_ResFlag = 0;
+	else
+	  ISEC2_ResFlag = 128;
+	*/
+	if ( gridIsRotated(gridID) )
+	  {
+	    double xpole, ypole, angle;
+	    xpole = gridInqXpole(gridID);
+	    ypole = gridInqYpole(gridID);
+	    angle = gridInqAngle(gridID);
+	    /* change from noth to south pole */
+	    ypole = -ypole;
+	    xpole =  xpole + 180;
+	    GRIB_CHECK(grib_set_double(gh, "latitudeOfSouthernPoleInDegrees",  ypole), 0);
+	    GRIB_CHECK(grib_set_double(gh, "longitudeOfSouthernPoleInDegrees", xpole), 0);
+	    GRIB_CHECK(grib_set_double(gh, "angleOfRotation", angle), 0);
+	  }
+
+	/* East -> West */
+	//if ( ISEC2_LastLon < ISEC2_FirstLon ) ISEC2_ScanFlag += 128;
+
+	/* South -> North */
+	//if ( ISEC2_LastLat > ISEC2_FirstLat ) ISEC2_ScanFlag += 64;
+
+        if ( editionNumber != 2 ) { lieee = 0; ljpeg = 0; }
+
+        if ( lieee )
+          {
+            mesg = "grid_ieee"; len = strlen(mesg);
+            GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+
+	    if ( datatype == DATATYPE_FLT64 )
+	      GRIB_CHECK(grib_set_long(gh, "precision", 2), 0);
+	    else
+	      GRIB_CHECK(grib_set_long(gh, "precision", 1), 0);
+          }
+        else if ( ljpeg )
+	  {
+            if ( nmiss > 0 ) ljpeg = 0;
+
+            if ( ljpeg )
+              {
+                mesg = "grid_jpeg"; len = strlen(mesg);
+                GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+              }
+            else
+              {
+                mesg = "grid_simple"; len = strlen(mesg);
+                GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+              }
+	  }
+	else
+	  {
+	    mesg = "grid_simple"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+	  }
+
+	break;
+      }
+      /*
+    case GRID_LCC:
+      {
+	double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
+	int xsize, ysize;
+	int projflag, scanflag;
+
+	xsize = gridInqXsize(gridID);
+	ysize = gridInqYsize(gridID);
+
+	gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm,
+		   &projflag, &scanflag);
+
+	ISEC2_GridType = GRIB2_GTYPE_LCC;
+	ISEC2_NumLon   = xsize;
+	ISEC2_NumLat   = ysize;
+	ISEC2_FirstLon = NINT(originLon * 1000);
+	ISEC2_FirstLat = NINT(originLat * 1000);
+	ISEC2_Lambert_Lov    = NINT(lonParY * 1000);
+	ISEC2_Lambert_LatS1  = NINT(lat1 * 1000);
+	ISEC2_Lambert_LatS2  = NINT(lat2 * 1000);
+	ISEC2_Lambert_dx     = NINT(xincm);
+	ISEC2_Lambert_dy     = NINT(yincm);
+	ISEC2_Lambert_LatSP  = 0;
+	ISEC2_Lambert_LatSP  = 0;
+	ISEC2_Lambert_ProjFlag = projflag;
+	ISEC2_ScanFlag = scanflag;
+
+	break;
+      }
+      */
+    case GRID_SPECTRAL:
+      {
+	int trunc = gridInqTrunc(gridID);
+
+	mesg = "sh"; len = strlen(mesg);
+	GRIB_CHECK(grib_set_string(gh, "gridType", mesg, &len), 0);
+
+	GRIB_CHECK(grib_set_long(gh, "J", trunc), 0);
+	GRIB_CHECK(grib_set_long(gh, "K", trunc), 0);
+	GRIB_CHECK(grib_set_long(gh, "M", trunc), 0);
+
+	// GRIB_CHECK(grib_set_long(gh, "numberOfDataPoints", gridInqSize(gridID)), 0);
+        /*
+        if ( lieee )
+          {
+            printf("spectral_ieee\n");
+            if ( editionNumber == 2 ) GRIB_CHECK(grib_set_long(gh, "numberOfValues", gridInqSize(gridID)), 0);
+            mesg = "spectral_ieee"; len = strlen(mesg);
+            GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+          }
+        else */ if ( gridInqComplexPacking(gridID) )
+	  {
+	    if ( editionNumber == 2 ) GRIB_CHECK(grib_set_long(gh, "numberOfValues", gridInqSize(gridID)), 0);
+	    mesg = "spectral_complex"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+	    /*
+	    GRIB_CHECK(grib_set_long(gh, "JS", 20), 0);
+	    GRIB_CHECK(grib_set_long(gh, "KS", 20), 0);
+	    GRIB_CHECK(grib_set_long(gh, "MS", 20), 0);
+	    */
+	  }
+	else
+	  {
+	    mesg = "spectral_simple"; len = strlen(mesg);
+	    GRIB_CHECK(grib_set_string(gh, "packingType", mesg, &len), 0);
+	  }
+
+	break;
+      }
+    case GRID_GME:
+      {
+	GRIB_CHECK(grib_set_long(gh, "gridDefinitionTemplateNumber", GRIB2_GTYPE_GME), 0);
+
+	GRIB_CHECK(grib_set_long(gh, "nd", gridInqGMEnd(gridID)), 0);
+	GRIB_CHECK(grib_set_long(gh, "Ni", gridInqGMEni(gridID)), 0);
+	GRIB_CHECK(grib_set_long(gh, "n2", gridInqGMEni2(gridID)), 0);
+	GRIB_CHECK(grib_set_long(gh, "n3", gridInqGMEni3(gridID)), 0);
+	GRIB_CHECK(grib_set_long(gh, "latitudeOfThePolePoint", 90000), 0);
+	GRIB_CHECK(grib_set_long(gh, "longitudeOfThePolePoint", 0), 0);
+
+	GRIB_CHECK(grib_set_long(gh, "numberOfDataPoints", gridInqSize(gridID)), 0);
+	GRIB_CHECK(grib_set_long(gh, "totalNumberOfGridPoints", gridInqSize(gridID)), 0);
+
+	break;
+      }
+    case GRID_REFERENCE:
+      {
+	static int warning = 1;
+	status = grib_set_long(gh, "gridDefinitionTemplateNumber", GRIB2_GTYPE_NUMBER);
+	if ( status != 0 && warning )
+	  {
+	    warning = 0;
+	    Warning("Can't write reference grid!");
+	    Warning("gridDefinitionTemplateNumber %d not found (grib2/template.3.%d.def)!",
+		    GRIB2_GTYPE_NUMBER, GRIB2_GTYPE_NUMBER);
+	  }
+	else
+	  {
+	    GRIB_CHECK(grib_set_long(gh, "numberOfGridUsed", gridInqNumber(gridID)), 0);
+	    GRIB_CHECK(grib_set_long(gh, "numberOfGridInReference", gridInqPosition(gridID)), 0);
+            len = 16;
+            GRIB_CHECK(grib_set_string(gh, "uuidOfHGrid", gridInqUUID(gridID, uuid), &len), 0);
+	  }
+
+	break;
+      }
+    default:
+      {
+	Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+      }
+    }
+}
+
+static
+void gribapiDefLevel(int editionNumber, grib_handle *gh, int param, int zaxisID, int levelID, int gcinit)
+{
+  double level;
+  int zaxistype, ltype;
+  static int warning = 1;
+  int reference;
+  char uuid[17];
+  size_t len;
+
+  zaxistype = zaxisInqType(zaxisID);
+  ltype = zaxisInqLtype(zaxisID);
+  level = zaxisInqLevel(zaxisID, levelID);
+
+  if ( zaxistype == ZAXIS_GENERIC && ltype == 0 )
+    {
+      Message("Changed zaxis type from %s to %s",
+	      zaxisNamePtr(zaxistype),
+	      zaxisNamePtr(ZAXIS_PRESSURE));
+      zaxistype = ZAXIS_PRESSURE;
+      zaxisChangeType(zaxisID, zaxistype);
+      zaxisDefUnits(zaxisID, "Pa");
+    }
+
+  switch (zaxistype)
+    {
+    case ZAXIS_SURFACE:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_SURFACE), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_SURFACE), 0);
+          }
+
+        GRIB_CHECK(grib_set_long(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_TOA:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_TOA), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_TOA), 0);
+          }
+
+        break;
+      }
+    case ZAXIS_SEA_BOTTOM:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_SEA_BOTTOM), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_SEA_BOTTOM), 0);
+          }
+
+        break;
+      }
+    case ZAXIS_ATMOSPHERE:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_ATMOSPHERE), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_ATMOSPHERE), 0);
+          }
+
+        break;
+      }
+    case ZAXIS_MEANSEA:
+      {
+	if ( editionNumber <= 1 )
+	  {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_MEANSEA), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_MEANSEA), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_HYBRID:
+    case ZAXIS_HYBRID_HALF:
+      {
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+	    long level1, level2;
+
+	    if ( editionNumber <= 1 )
+	      {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_HYBRID_LAYER), 0);
+              }
+            else
+	      {
+		if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_HYBRID), 0);
+		if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfSecondFixedSurface", GRIB2_LTYPE_HYBRID), 0);
+	      }
+
+	    level1 = zaxisInqLbound(zaxisID, levelID);
+	    level2 = zaxisInqUbound(zaxisID, levelID);
+
+	    GRIB_CHECK(grib_set_long(gh, "topLevel", level1), 0);
+	    GRIB_CHECK(grib_set_long(gh, "bottomLevel", level2), 0);
+	  }
+	else
+	  {
+	    if ( editionNumber <= 1 )
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_HYBRID), 0);
+              }
+            else
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_HYBRID), 0);
+              }
+
+	    GRIB_CHECK(grib_set_long(gh, "level", level), 0);
+	  }
+
+        if ( !gcinit )
+          {
+            int vctsize = zaxisInqVctSize(zaxisID);
+            if ( vctsize == 0 && warning )
+              {
+                char paramstr[32];
+                cdiParamToString(param, paramstr, sizeof(paramstr));
+                Warning("VCT missing ( param = %s, zaxisID = %d )", paramstr, zaxisID);
+                warning = 0;
+              }
+            GRIB_CHECK(grib_set_long(gh, "PVPresent", 1), 0);
+            GRIB_CHECK(grib_set_double_array(gh, "pv", zaxisInqVctPtr(zaxisID), vctsize), 0);
+          }
+
+	break;
+      }
+    case ZAXIS_PRESSURE:
+      {
+	double dum;
+	char units[128];
+
+	if ( level < 0 ) Warning("Pressure level of %f Pa is below zero!", level);
+
+	zaxisInqUnits(zaxisID, units);
+	if ( memcmp(units, "Pa", 2) != 0 ) level *= 100;
+
+	if ( level < 32768 && (level < 100 || modf(level/100, &dum) > 0) )
+	  {
+	    if ( editionNumber <= 1 )
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_99), 0);
+              }
+            else
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB1_LTYPE_99), 0);
+              }
+
+	    GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+	  }
+	else
+	  {
+	    if ( editionNumber <= 1 )
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_ISOBARIC), 0);
+              }
+            else
+              {
+                if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_ISOBARIC), 0);
+              }
+            //GRIB_CHECK(grib_set_double(gh, "scaledValueOfFirstFixedSurface", level), 0);
+	    GRIB_CHECK(grib_set_double(gh, "level", level/100), 0);
+	  }
+
+	break;
+      }
+    case ZAXIS_HEIGHT:
+      {
+        if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_HEIGHT), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_HEIGHT), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_ALTITUDE:
+      {
+        if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_ALTITUDE), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_ALTITUDE), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_SIGMA:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_SIGMA), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_SIGMA), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_LAND:
+      {
+	char units[128];
+
+	zaxisInqUnits(zaxisID, units);
+
+	if ( editionNumber <= 1 )
+	  {
+	    double factor;
+	    if      ( memcmp(units, "mm", 2) == 0 ) factor =   0.1;
+	    else if ( memcmp(units, "cm", 2) == 0 ) factor =   1;
+	    else if ( memcmp(units, "dm", 2) == 0 ) factor =  10;
+	    else                                    factor = 100; // meter
+
+	    if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_LANDDEPTH), 0);
+	    GRIB_CHECK(grib_set_double(gh, "level", level*factor), 0);
+	  }
+	else
+	  {
+	    long factor;
+	    if      ( memcmp(units, "mm", 2) == 0 ) factor = 3;
+	    else if ( memcmp(units, "cm", 2) == 0 ) factor = 2;
+	    else if ( memcmp(units, "dm", 2) == 0 ) factor = 1;
+	    else                                    factor = 0; // meter
+
+	    if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	      {
+		double level1, level2;
+		level1 = zaxisInqLbound(zaxisID, levelID);
+		level2 = zaxisInqUbound(zaxisID, levelID);
+
+		if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_LANDDEPTH), 0);
+		GRIB_CHECK(grib_set_long(gh, "scaleFactorOfFirstFixedSurface", factor), 0);
+		GRIB_CHECK(grib_set_double(gh, "scaledValueOfFirstFixedSurface", level1), 0);
+		if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfSecondFixedSurface", GRIB2_LTYPE_LANDDEPTH), 0);
+		GRIB_CHECK(grib_set_long(gh, "scaleFactorOfSecondFixedSurface", factor), 0);
+		GRIB_CHECK(grib_set_double(gh, "scaledValueOfSecondFixedSurface", level2), 0);
+	      }
+	    else
+	      {
+		if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_LANDDEPTH), 0);
+		GRIB_CHECK(grib_set_long(gh, "scaleFactorOfFirstFixedSurface", factor), 0);
+	       	GRIB_CHECK(grib_set_double(gh, "scaledValueOfFirstFixedSurface", level), 0);
+	      }
+	  }
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_SEA:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_SEADEPTH), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_SEADEPTH), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_ISENTROPIC:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", GRIB1_LTYPE_ISENTROPIC), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_ISENTROPIC), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    case ZAXIS_REFERENCE:
+      {
+        if ( editionNumber <= 1 )
+          ; // not available
+        else
+          {
+            reference = zaxisInqReference(zaxisID);
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", GRIB2_LTYPE_REFERENCE), 0);
+            GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+            GRIB_CHECK(grib_set_long(gh, "NV", 3), 0);
+            GRIB_CHECK(grib_set_long(gh, "nlev", (long) zaxisInqSize(zaxisID)), 0);
+            GRIB_CHECK(grib_set_long(gh, "numberOfVGridUsed", reference), 0);
+            len = 16;
+            GRIB_CHECK(grib_set_string(gh, "uuidOfVGrid", zaxisInqUUID(zaxisID, uuid), &len), 0);
+          }
+
+        break;
+      }
+    case ZAXIS_GENERIC:
+      {
+	if ( editionNumber <= 1 )
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "indicatorOfTypeOfLevel", ltype), 0);
+          }
+        else
+          {
+            if ( !gcinit ) GRIB_CHECK(grib_set_long(gh, "typeOfFirstFixedSurface", ltype), 0);
+          }
+
+	GRIB_CHECK(grib_set_double(gh, "level", level), 0);
+
+	break;
+      }
+    default:
+      {
+	Error("Unsupported zaxis type: %s", zaxisNamePtr(zaxistype));
+	break;
+      }
+    }
+}
+#endif
+
+void *gribHandleNew(int editionNumber)
+{
+  void *gh = NULL;
+
+#if  defined  (HAVE_LIBGRIB_API)
+  if ( editionNumber == 1 )
+    gh = (void *) grib_handle_new_from_samples(NULL, "GRIB1");
+  else
+    gh = (void *) grib_handle_new_from_samples(NULL, "GRIB2");
+
+  if ( gh == NULL ) Error("grib_handle_new_from_samples failed!");
+#endif
+
+  return (gh);
+}
+
+
+void gribHandleDelete(void *gh)
+{
+#if  defined  (HAVE_LIBGRIB_API)
+  grib_handle_delete(gh);
+#endif
+}
+
+/* #define GRIBAPIENCODETEST 1 */
+
+size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisID,
+		     int vdate, int vtime, int tsteptype, int numavg, 
+		     long datasize, const double *data, int nmiss, unsigned char **gribbuffer, size_t *gribbuffersize,
+		     int ljpeg, void *gribContainer)
+{
+  size_t nbytes = 0;
+#if  defined  (HAVE_LIBGRIB_API)
+  size_t recsize = 0;
+  void *dummy = NULL;
+  int datatype;
+  int param;
+  int lieee = FALSE;
+  int ensID, ensCount, forecast_type; /* Ensemble Data */
+  long bitsPerValue;
+  long editionNumber = 2;
+  char name[256];
+  grib_handle *gh = NULL;
+  gribContainer_t *gc = (gribContainer_t *) gribContainer;
+  // extern unsigned char _grib_template_GRIB2[];
+
+  param    = vlistInqVarParam(vlistID, varID);
+  datatype = vlistInqVarDatatype(vlistID, varID);
+  vlistInqVarName(vlistID, varID, name);
+
+#if defined(GRIBAPIENCODETEST)
+  gh = (grib_handle *) gribHandleNew(editionNumber);
+#else
+  gh = gc->gribHandle;
+#endif
+
+  GRIB_CHECK(grib_get_long(gh, "editionNumber", &editionNumber), 0);
+
+  if ( ! gc->init ) gribapiDefInstitut(gh, vlistID, varID);
+  if ( ! gc->init ) gribapiDefModel(gh, vlistID, varID);
+
+  if ( ! gc->init ) gribapiDefParam(editionNumber, gh, param, name);
+  /*
+  if( vlistInqVarEnsemble( vlistID,  varID, &ensID, &ensCount, &forecast_type ) )
+    {
+      GRIB_CHECK(grib_set_long(gh, "typeOfEnsembleForecast", forecast_type ), 0);
+      GRIB_CHECK(grib_set_long(gh, "numberOfForecastsInEnsemble", ensCount ), 0);
+      GRIB_CHECK(grib_set_long(gh, "perturbationNumber", ensID ), 0);
+    }
+  */
+  gribapiDefTime(editionNumber, gh, vdate, vtime, tsteptype, numavg, vlistInqTaxis(vlistID), gc->init);
+
+  if ( editionNumber == 2 && (datatype == DATATYPE_FLT32 || datatype == DATATYPE_FLT64) ) lieee = TRUE;
+
+  /* bitsPerValue have to be defined before call to DefGrid (complex packing) */
+  //  if ( lieee == FALSE )
+    {
+      bitsPerValue = grbBitsPerValue(datatype);
+      GRIB_CHECK(grib_set_long(gh, "bitsPerValue", bitsPerValue), 0);
+    }
+
+  gribapiDefGrid(editionNumber, gh, gridID, ljpeg, lieee, datatype, nmiss, gc->init);
+
+  gribapiDefLevel(editionNumber, gh, param, zaxisID, levelID, gc->init);
+
+  if ( nmiss > 0 )
+    {
+      GRIB_CHECK(grib_set_long(gh, "bitmapPresent", 1), 0);
+      GRIB_CHECK(grib_set_double(gh, "missingValue", vlistInqVarMissval(vlistID, varID)), 0);
+    }
+
+  GRIB_CHECK(grib_set_double_array(gh, "values", data, datasize), 0);
+
+  /* get the size of coded message  */
+  GRIB_CHECK(grib_get_message(gh, (const void **)&dummy, &recsize), 0);
+  recsize += 512; /* add some space for possible filling */
+  *gribbuffersize = recsize;
+  *gribbuffer = (unsigned char *) malloc(*gribbuffersize);
+
+  /* get a copy of the coded message */
+  GRIB_CHECK(grib_get_message_copy(gh, *gribbuffer, &recsize), 0);
+
+#if defined(GRIBAPIENCODETEST)
+  gribHandleDelete(gh);
+#endif
+
+  gc->init = TRUE;
+
+  nbytes = recsize;
+#else
+  Error("GRIB_API support not compiled in!");
+#endif
+
+  return (nbytes);
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_gribapi.h b/libcdi/src/stream_gribapi.h
new file mode 100644
index 0000000..b068f3e
--- /dev/null
+++ b/libcdi/src/stream_gribapi.h
@@ -0,0 +1,25 @@
+#ifndef _STREAM_GRIBAPI_H
+#define _STREAM_GRIBAPI_H
+
+int gribapiScanTimestep1(int streamID);
+int gribapiScanTimestep2(int streamID);
+int gribapiScanTimestep(int streamID);
+
+int gribapiDecode(unsigned char *gribbuffer, int gribsize, double *data, int gridsize,
+		  int unreduced, int *nmiss, int *zip, double missval);
+
+size_t gribapiEncode(int varID, int levelID, int vlistID, int gridID, int zaxisID,
+		     int vdate, int vtime, int tsteptype, int numavg, 
+		     long datasize, const double *data, int nmiss, unsigned char **gribbuffer, size_t *gribbuffersize,
+		     int ljpeg, void *gribContainer);
+
+#endif  /* _STREAM_GRIBAPI_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_history.c b/libcdi/src/stream_history.c
new file mode 100644
index 0000000..41e4693
--- /dev/null
+++ b/libcdi/src/stream_history.c
@@ -0,0 +1,79 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include "dmemory.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "stream_cdf.h"
+
+
+void streamDefHistory(int streamID, int length, const char *history)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->filetype == FILETYPE_NC  ||
+       streamptr->filetype == FILETYPE_NC2 ||
+       streamptr->filetype == FILETYPE_NC4 ||
+       streamptr->filetype == FILETYPE_NC4C )
+    {
+      char *histstring;
+      size_t len;
+      if ( history )
+	{
+	  len = strlen(history);
+	  if ( len )
+	    {
+	      histstring = strdupx(history);
+	      cdfDefHistory(streamID, length, histstring);
+	      free(histstring);
+	    }
+	}
+    }
+}
+
+
+int streamInqHistorySize(int streamID)
+{
+  int size = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->filetype == FILETYPE_NC  ||
+       streamptr->filetype == FILETYPE_NC2 ||
+       streamptr->filetype == FILETYPE_NC4 ||
+       streamptr->filetype == FILETYPE_NC4C )
+    {
+      size = cdfInqHistorySize(streamID);
+    }
+
+  return (size);
+}
+
+
+void streamInqHistoryString(int streamID, char *history)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->filetype == FILETYPE_NC  ||
+       streamptr->filetype == FILETYPE_NC2 ||
+       streamptr->filetype == FILETYPE_NC4 ||
+       streamptr->filetype == FILETYPE_NC4C )
+    {
+      cdfInqHistoryString(streamID, history);
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_ieg.c b/libcdi/src/stream_ieg.c
new file mode 100644
index 0000000..40481fe
--- /dev/null
+++ b/libcdi/src/stream_ieg.c
@@ -0,0 +1,1579 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+#include <math.h>
+
+#include "dmemory.h"
+
+#include "error.h"
+#include "file.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "varscan.h"
+#include "datetime.h"
+#include "ieg.h"
+#include "vlist.h"
+
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+#define SINGLE_PRECISION  4
+#define DOUBLE_PRECISION  8
+
+#if defined (HAVE_LIBIEG)
+
+
+typedef struct {
+  int param;
+  int level;
+} IEGCOMPVAR; 
+
+
+int iegInqDatatype(int prec)
+{
+  int datatype;
+
+  if ( prec == DOUBLE_PRECISION ) datatype = DATATYPE_FLT64;
+  else                            datatype = DATATYPE_FLT32;
+
+  return (datatype);
+}
+
+
+int iegDefDatatype(int datatype)
+{
+  int prec;
+
+  if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    Error("CDI/IEG library does not support complex numbers!");
+
+  if ( datatype != DATATYPE_FLT32 && datatype != DATATYPE_FLT64 )
+    datatype = DATATYPE_FLT32;
+
+  if ( datatype == DATATYPE_FLT64 ) prec = DOUBLE_PRECISION;
+  else                              prec = SINGLE_PRECISION;
+
+  return (prec);
+}
+
+/* not used
+int iegInqRecord(int streamID, int *varID, int *levelID)
+{
+  int status;
+  int fileID;
+  int icode, ilevel;
+  int zaxisID = -1;
+  int vlistID;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  iegp    = streamptr->record->iegp;
+
+  *varID   = -1;
+  *levelID = -1;
+
+  status = iegRead(fileID, iegp);
+  if ( status != 0 ) return (0);
+
+  icode  = IEG_P_Parameter(iegp->ipdb);
+  if ( IEG_P_LevelType(iegp->ipdb) == IEG_LTYPE_HYBRID_LAYER )
+    ilevel = IEG_P_Level1(iegp->ipdb);
+  else
+    ilevel = IEG_P_Level2(iegp->ipdb);
+
+  *varID = vlistInqVarID(vlistID, icode);
+
+  if ( *varID == UNDEFID ) Error("Code %d undefined", icode);
+
+  zaxisID = vlistInqVarZaxis(vlistID, *varID);
+
+  *levelID = zaxisInqLevelID(zaxisID, (double) ilevel);
+  
+  return (1);
+}
+*/
+
+int iegReadRecord(int streamID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int status;
+  int recID, vrecID, tsID;
+  off_t recpos;
+  int varID, gridID;
+  int i, size;
+  double missval;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  tsID    = streamptr->curTsID;
+  vrecID  = streamptr->tsteps[tsID].curRecID;
+  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr->tsteps[tsID].records[recID].position;
+  varID   = streamptr->tsteps[tsID].records[recID].varID;
+  iegp    = streamptr->record->iegp;
+
+  fileSetPos(fileID, recpos, SEEK_SET);
+
+  status = iegRead(fileID, iegp);
+  if ( status != 0 ) return (0);
+
+  iegInqDataDP(iegp, data);
+
+  missval = vlistInqVarMissval(vlistID, varID);
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  size    = gridInqSize(gridID);
+
+  streamptr->numvals += size;
+
+  *nmiss = 0;
+  for ( i = 0; i < size; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+
+  return (1);
+}
+
+static
+int iegGetZaxisType(int iegleveltype)
+{
+  int leveltype = 0;
+
+  switch ( iegleveltype )
+    {
+    case IEG_LTYPE_SURFACE:
+      {
+	leveltype = ZAXIS_SURFACE;
+	break;
+      }
+    case IEG_LTYPE_99:
+    case IEG_LTYPE_ISOBARIC:
+      {
+	leveltype = ZAXIS_PRESSURE;
+	break;
+      }
+    case IEG_LTYPE_HEIGHT:
+      {
+	leveltype = ZAXIS_HEIGHT;
+	break;
+      }
+    case IEG_LTYPE_ALTITUDE:
+      {
+	leveltype = ZAXIS_ALTITUDE;
+	break;
+      }
+    case IEG_LTYPE_HYBRID:
+    case IEG_LTYPE_HYBRID_LAYER:
+      {
+	leveltype = ZAXIS_HYBRID;
+	break;
+      }
+    case IEG_LTYPE_LANDDEPTH:
+    case IEG_LTYPE_LANDDEPTH_LAYER:
+      {
+	leveltype = ZAXIS_DEPTH_BELOW_LAND;
+	break;
+      }
+    case IEG_LTYPE_SEADEPTH:
+      {
+	leveltype = ZAXIS_DEPTH_BELOW_SEA;
+	break;
+      }
+    default:
+      {
+	leveltype = ZAXIS_GENERIC;
+	break;
+      }
+    }
+
+  return (leveltype);
+}
+
+
+void iegDefTime(int *pdb, int date, int time, int taxisID)
+{
+  int year, month, day, hour, minute, second;
+  int timetype = -1;
+
+  if ( taxisID != -1 ) timetype = taxisInqType(taxisID);
+
+  if ( timetype == TAXIS_ABSOLUTE || timetype == TAXIS_RELATIVE )
+    {
+      cdiDecodeDate(date, &year, &month, &day);
+      cdiDecodeTime(time, &hour, &minute, &second);
+
+      IEG_P_Year(pdb)     = year;
+      IEG_P_Month(pdb)    = month;
+      IEG_P_Day(pdb)      = day;
+      IEG_P_Hour(pdb)     = hour;
+      IEG_P_Minute(pdb)   = minute;
+
+      pdb[15] = 1;
+      pdb[16] = 0;
+      pdb[17] = 0;
+      pdb[18] = 10;
+      pdb[36] = 1;
+    }
+
+  pdb[5] = 128;
+}
+
+static
+void iegDefGrid(int *gdb, int gridID)
+{
+  int gridtype;
+
+  gridtype = gridInqType(gridID);
+
+  if ( gridtype == GRID_GENERIC )
+    {
+      int xsize, ysize;
+
+      xsize = gridInqXsize(gridID);
+      ysize = gridInqYsize(gridID);
+
+      if ( (ysize == 32  || ysize == 48 || ysize == 64 ||
+	    ysize == 96  || ysize == 160) && 
+	   (xsize == 2*ysize || xsize == 1) )
+	{
+	  gridtype = GRID_GAUSSIAN;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( (xsize == 1 && ysize == 1) || (xsize == 0 && ysize == 0) )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+      else if ( gridInqXvals(gridID, NULL) && gridInqYvals(gridID, NULL) )
+	{
+	  gridtype = GRID_LONLAT;
+	  gridChangeType(gridID, gridtype);
+	}
+    }
+  else if ( gridtype == GRID_CURVILINEAR )
+    {
+      gridtype = GRID_LONLAT;
+    }
+
+  if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN )
+    {
+      int nlon, nlat;
+      double xfirst = 0, xlast = 0, xinc = 0;
+      double yfirst = 0, ylast = 0, yinc = 0;
+
+      nlon = (int) gridInqXsize(gridID);
+      nlat = (int) gridInqYsize(gridID);
+
+      if ( nlon == 0 )
+	{
+	  nlon = 1;
+	}
+      else
+	{
+	  xfirst = gridInqXval(gridID,      0);
+	  xlast  = gridInqXval(gridID, nlon-1);
+	  xinc   = gridInqXinc(gridID);
+	}
+
+      if ( nlat == 0 )
+	{
+	  nlat = 1;
+	}
+      else
+	{
+	  yfirst = gridInqYval(gridID,      0);
+	  ylast  = gridInqYval(gridID, nlat-1);
+	  yinc   = gridInqYinc(gridID);
+	}
+
+      if ( gridtype == GRID_GAUSSIAN )
+	IEG_G_GridType(gdb) = 4;
+      else if ( gridtype == GRID_LONLAT && gridIsRotated(gridID) )
+	IEG_G_GridType(gdb) = 10;
+      else
+	IEG_G_GridType(gdb) = 0;
+
+      IEG_G_NumLon(gdb)   = nlon;
+      IEG_G_NumLat(gdb)   = nlat;
+      IEG_G_FirstLat(gdb) = NINT(yfirst*1000);
+      IEG_G_LastLat(gdb)  = NINT(ylast*1000);
+      IEG_G_FirstLon(gdb) = NINT(xfirst*1000);
+      IEG_G_LastLon(gdb)  = NINT(xlast*1000);
+      IEG_G_LonIncr(gdb)  = NINT(xinc*1000);
+      if ( fabs(xinc*1000 - IEG_G_LonIncr(gdb)) > FLT_EPSILON )
+	IEG_G_LonIncr(gdb) = 0;
+
+      if ( gridtype == GRID_GAUSSIAN )
+	IEG_G_LatIncr(gdb) = nlat/2;
+      else
+	{
+	  IEG_G_LatIncr(gdb) = NINT(yinc*1000);
+	  if ( fabs(yinc*1000 - IEG_G_LatIncr(gdb)) > FLT_EPSILON )
+	    IEG_G_LatIncr(gdb) = 0;
+
+	  if ( IEG_G_LatIncr(gdb) < 0 ) IEG_G_LatIncr(gdb) = -IEG_G_LatIncr(gdb);
+	}
+
+      if ( IEG_G_NumLon(gdb) > 1 && IEG_G_NumLat(gdb) == 1 ) 
+	if ( IEG_G_LonIncr(gdb) != 0 && IEG_G_LatIncr(gdb) == 0 ) IEG_G_LatIncr(gdb) = IEG_G_LonIncr(gdb);
+
+      if ( IEG_G_NumLon(gdb) == 1 && IEG_G_NumLat(gdb) > 1 ) 
+	if ( IEG_G_LonIncr(gdb) == 0 && IEG_G_LatIncr(gdb) != 0 ) IEG_G_LonIncr(gdb) = IEG_G_LatIncr(gdb);
+
+      if ( IEG_G_LatIncr(gdb) == 0 || IEG_G_LonIncr(gdb) == 0 )
+	IEG_G_ResFlag(gdb) = 0;
+      else
+	IEG_G_ResFlag(gdb) = 128;
+
+      if ( gridIsRotated(gridID) )
+	{
+	  IEG_G_LatSP(gdb) = - NINT(gridInqYpole(gridID) * 1000);
+	  IEG_G_LonSP(gdb) =   NINT((gridInqXpole(gridID) + 180) * 1000);
+	  IEG_G_Size(gdb)  = 42;
+	}
+      else
+	{
+	  IEG_G_Size(gdb)  = 32;
+	}
+    }
+  else
+    {
+      Error("Unsupported grid type: %s", gridNamePtr(gridtype));
+    }
+
+  IEG_G_ScanFlag(gdb) = 64;
+}
+
+static
+void iegDefLevel(int *pdb, int *gdb, double *vct, int zaxisID, int levelID)
+{
+  double level;
+  int ilevel, leveltype;
+  static int warning = 1;
+  static int vct_warning = 1;
+
+  leveltype = zaxisInqType(zaxisID);
+
+  if ( leveltype == ZAXIS_GENERIC )
+    {
+      Message("Changed zaxis type from %s to %s",
+	      zaxisNamePtr(leveltype),
+	      zaxisNamePtr(ZAXIS_PRESSURE));
+      leveltype = ZAXIS_PRESSURE;
+      zaxisChangeType(zaxisID, leveltype);
+      zaxisDefUnits(zaxisID, "Pa");
+    }
+
+  /*  IEG_G_NumVCP(gdb) = 0; */
+
+  switch (leveltype)
+    {
+    case ZAXIS_SURFACE:
+      {
+	IEG_P_LevelType(pdb) = IEG_LTYPE_SURFACE;
+	IEG_P_Level1(pdb)    = 0;
+	IEG_P_Level2(pdb)    = (int) zaxisInqLevel(zaxisID, levelID);
+	break;
+      }
+    case ZAXIS_HYBRID:
+      {
+	int vctsize;
+
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_HYBRID_LAYER;
+	    IEG_P_Level1(pdb)    = (int) zaxisInqLbound(zaxisID, levelID);
+	    IEG_P_Level2(pdb)    = (int) zaxisInqUbound(zaxisID, levelID);
+	  }
+	else
+	  {
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_HYBRID;
+	    IEG_P_Level1(pdb)    = 0;
+	    IEG_P_Level2(pdb)    = (int) zaxisInqLevel(zaxisID, levelID);
+	  }
+
+	vctsize = zaxisInqVctSize(zaxisID);
+	if ( vctsize == 0 && warning )
+	  {
+	    Warning("VCT missing. ( code = %d, zaxisID = %d )",
+		    IEG_P_Parameter(pdb), zaxisID);
+	    warning = 0;
+	  }
+	if ( vctsize > 100 )
+	  {
+	    /*	    IEG_G_NumVCP(gdb) = 0; */
+	    if ( vct_warning )
+	      {
+		Warning("VCT size of %d is too large (maximum is 100). Set to 0!", vctsize);
+		vct_warning = 0;
+	      }
+	  }
+	else
+	  {
+	    IEG_G_Size(gdb) += (vctsize*4);
+	    memcpy(vct, zaxisInqVctPtr(zaxisID), vctsize/2*sizeof(double));
+	    memcpy(vct+50, zaxisInqVctPtr(zaxisID)+vctsize/2, vctsize/2*sizeof(double));
+	  }
+	break;
+      }
+    case ZAXIS_PRESSURE:
+      {
+	double dum;
+	char units[128];
+
+	level = zaxisInqLevel(zaxisID, levelID);
+	if ( level < 0 )
+	  Warning("pressure level of %f Pa is below 0.", level);
+
+	zaxisInqUnits(zaxisID, units);
+	if ( memcmp(units, "hPa", 3) == 0 || memcmp(units, "mb",2 ) == 0 )
+	  level = level*100;
+
+	ilevel = (int) level;
+	if ( level < 32768 && (level < 100 || modf(level/100, &dum) > 0) )
+	  {
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_99;
+	    IEG_P_Level1(pdb)    = 0;
+	    IEG_P_Level2(pdb)    = ilevel;
+	  }
+	else
+	  {
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_ISOBARIC;
+	    IEG_P_Level1(pdb)    = 0;
+	    IEG_P_Level2(pdb)    = ilevel/100;
+	  }
+	break;
+      }
+    case ZAXIS_HEIGHT:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	IEG_P_LevelType(pdb) = IEG_LTYPE_HEIGHT;
+	IEG_P_Level1(pdb)    = 0;
+	IEG_P_Level2(pdb)    = ilevel;
+
+	break;
+      }
+    case ZAXIS_ALTITUDE:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	IEG_P_LevelType(pdb) = IEG_LTYPE_ALTITUDE;
+	IEG_P_Level1(pdb)    = 0;
+	IEG_P_Level2(pdb)    = ilevel;
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_LAND:
+      {
+	if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	  {
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_LANDDEPTH_LAYER;
+	    IEG_P_Level1(pdb)    = (int) zaxisInqLbound(zaxisID, levelID);
+	    IEG_P_Level2(pdb)    = (int) zaxisInqUbound(zaxisID, levelID);
+	  }
+	else
+	  {
+	    level = zaxisInqLevel(zaxisID, levelID);
+
+	    ilevel = (int) level;
+	    IEG_P_LevelType(pdb) = IEG_LTYPE_LANDDEPTH;
+	    IEG_P_Level1(pdb)    = 0;
+	    IEG_P_Level2(pdb)    = ilevel;
+	  }
+
+	break;
+      }
+    case ZAXIS_DEPTH_BELOW_SEA:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	IEG_P_LevelType(pdb) = IEG_LTYPE_SEADEPTH;
+	IEG_P_Level1(pdb)    = 0;
+	IEG_P_Level2(pdb)    = ilevel;
+
+	break;
+      }
+    case ZAXIS_ISENTROPIC:
+      {
+	level = zaxisInqLevel(zaxisID, levelID);
+
+	ilevel = (int) level;
+	IEG_P_LevelType(pdb) = 113;
+	IEG_P_Level1(pdb)    = 0;
+	IEG_P_Level2(pdb)    = ilevel;
+
+	break;
+      }
+    default:
+      {
+	Error("Unsupported zaxis type: %s", zaxisNamePtr(leveltype));
+	break;
+      }
+    }
+}
+
+
+int iegCopyRecord(int streamID2, int streamID1)
+{
+  int fileID1, fileID2;
+  int tsID, recID, vrecID;
+  long recsize;
+  off_t recpos;
+  int status = 0;
+  char *buffer;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  fileID1 = streamInqFileID(streamID1);
+  fileID2 = streamInqFileID(streamID2);
+
+  tsID    = streamptr1->curTsID;
+  vrecID  = streamptr1->tsteps[tsID].curRecID;
+  recID   = streamptr1->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr1->tsteps[tsID].records[recID].position;
+  recsize = streamptr1->tsteps[tsID].records[recID].size;
+
+  fileSetPos(fileID1, recpos, SEEK_SET);
+
+  buffer = (char *) malloc(recsize);
+
+  fileRead(fileID1, buffer, recsize);
+
+  fileWrite(fileID2, buffer, recsize);
+
+  free(buffer);
+
+  return (status);
+}
+
+
+int iegDefRecord(int streamID)
+{
+  int status = 0;
+  int vlistID;
+  int gridID;
+  int date, time;
+  int datatype;
+  int i;
+  int param, pdis, pcat, pnum;
+  int varID, levelID, tsID, zaxisID;
+  int byteorder;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  iegp    = streamptr->record->iegp;
+  byteorder = streamptr->byteorder;
+
+  varID   = streamptr->record->varID;
+  levelID = streamptr->record->levelID;
+  tsID    = streamptr->curTsID;
+
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  zaxisID = vlistInqVarZaxis(vlistID, varID);
+  
+  iegInitMem(iegp);
+  for ( i = 0; i < 37; i++ ) iegp->ipdb[i] = -1;
+
+  iegp->byteswap = getByteswap(byteorder);
+
+  param =  vlistInqVarParam(vlistID, varID);
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+  IEG_P_Parameter(iegp->ipdb) = pnum;
+  if ( pdis == 255 ) IEG_P_CodeTable(iegp->ipdb) = pcat;
+  date     = streamptr->tsteps[tsID].taxis.vdate;
+  time     = streamptr->tsteps[tsID].taxis.vtime;
+
+  iegDefTime(iegp->ipdb, date, time, vlistInqTaxis(vlistID));
+  iegDefGrid(iegp->igdb, gridID);
+  iegDefLevel(iegp->ipdb, iegp->igdb, iegp->vct, zaxisID, levelID);
+
+  datatype = streamptr->record->prec;
+
+  iegp->dprec = iegDefDatatype(datatype);
+
+  return (status);
+}
+
+
+int iegWriteRecord(int streamID, const double *data)
+{
+  int fileID;
+  int status = 0;
+  int i, gridsize, gridID;
+  double refval;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+  iegp   = streamptr->record->iegp;
+  gridID = streamptr->record->gridID;
+  
+  gridsize = gridInqSize(gridID);
+
+  refval = data[0];
+  for ( i = 1; i < gridsize; i++ )
+    if ( data[i] < refval ) refval = data[i];
+
+  iegp->refval = refval;
+
+  iegDefDataDP(iegp, data);
+
+  iegWrite(fileID, iegp);
+
+  return (status);
+}
+
+static
+void iegAddRecord(int streamID, int param, int *pdb, int *gdb, double *vct,
+		  long recsize, off_t position, int prec)
+{
+  int leveltype;
+  int gridID = UNDEFID;
+  int levelID = 0;
+  int tsID, recID, varID;
+  int datatype;
+  int level1, level2;
+  int gridtype;
+  int lbounds = 0;
+  record_t *record;
+  grid_t grid;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  tsID    = streamptr->curTsID;
+  recID   = recordNewEntry(streamID, tsID);
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  if ( IEG_P_LevelType(pdb) == IEG_LTYPE_HYBRID_LAYER )
+    {
+      level1 = IEG_P_Level1(pdb);
+      level2 = IEG_P_Level2(pdb);
+    }
+  else
+    {
+      level1 = IEG_P_Level2(pdb);
+      level2 = 0;
+      if ( IEG_P_LevelType(pdb) == 100 ) level1 *= 100;
+    }
+
+  (*record).size     = recsize;
+  (*record).position = position;
+  (*record).param    = param;
+  (*record).ilevel   = level1;
+  (*record).ilevel2  = level2;
+  (*record).ltype    = IEG_P_LevelType(pdb);
+
+  if ( IEG_G_GridType(gdb) == 0 || IEG_G_GridType(gdb) == 10 )
+    gridtype = GRID_LONLAT;
+  else if ( IEG_G_GridType(gdb) == 4 )
+    gridtype = GRID_GAUSSIAN;
+  else
+    gridtype = GRID_GENERIC;
+
+  memset(&grid, 0, sizeof(grid_t));
+  grid.type  = gridtype; 
+  grid.size  = IEG_G_NumLon(gdb)*IEG_G_NumLat(gdb);
+  grid.xsize = IEG_G_NumLon(gdb);
+  grid.ysize = IEG_G_NumLat(gdb);
+  grid.xinc  = 0;
+  grid.yinc  = 0;
+  grid.xdef  = 0;
+  /* if ( IEG_G_FirstLon != 0 || IEG_G_LastLon != 0 ) */
+  {
+    if ( grid.xsize > 1 )
+      {
+	if ( IEG_G_ResFlag(gdb) && IEG_G_LonIncr(gdb) > 0 )
+	  grid.xinc = IEG_G_LonIncr(gdb) * 0.001;
+	else
+	  grid.xinc = (IEG_G_LastLon(gdb) - IEG_G_FirstLon(gdb)) * 0.001 / (grid.xsize - 1);
+
+	/* correct xinc if necessary */
+	if ( IEG_G_FirstLon(gdb) == 0 && IEG_G_LastLon(gdb) > 354000 )
+	  {
+	    double xinc = 360. / grid.xsize;
+	    
+	    if ( fabs(grid.xinc-xinc) > 0.0 )
+	      {
+		grid.xinc = xinc;
+		if ( CDI_Debug ) Message("set xinc to %g", grid.xinc);
+	      }
+	  }
+      }
+    grid.xfirst = IEG_G_FirstLon(gdb) * 0.001;
+    grid.xlast  = IEG_G_LastLon(gdb)  * 0.001;
+    grid.xdef   = 2;	    
+  }
+  grid.ydef  = 0;
+  /* if ( IEG_G_FirstLat != 0 || IEG_G_LastLat != 0 ) */
+  {
+    if ( grid.ysize > 1 )
+      {
+	if ( IEG_G_ResFlag(gdb) && IEG_G_LatIncr(gdb) > 0 )
+	  grid.yinc = IEG_G_LatIncr(gdb) * 0.001;
+	else
+	  grid.yinc = (IEG_G_LastLat(gdb) - IEG_G_FirstLat(gdb)) * 0.001 / (grid.ysize - 1);
+      }
+    grid.yfirst = IEG_G_FirstLat(gdb) * 0.001;
+    grid.ylast  = IEG_G_LastLat(gdb)  * 0.001;
+    grid.ydef   = 2;	    
+  }
+  /*
+  grid.xfirst= IEG_G_FirstLon(gdb) * 0.001;
+  grid.xlast = IEG_G_LastLon(gdb) * 0.001;
+  grid.xinc  = IEG_G_LonIncr(gdb) * 0.001;
+  grid.xdef  = 2;	    
+  grid.yfirst= IEG_G_FirstLat(gdb) * 0.001;
+  grid.ylast = IEG_G_LastLat(gdb) * 0.001;
+  grid.yinc  = IEG_G_LatIncr(gdb) * 0.001;
+  grid.ydef  = 2;
+  */
+  grid.xvals = NULL;
+  grid.yvals = NULL;
+
+  grid.isRotated = FALSE;
+  if ( IEG_G_GridType(gdb) == 10 )
+    {
+      grid.isRotated = TRUE;
+      grid.ypole     = - IEG_G_LatSP(gdb) * 0.001;
+      grid.xpole     =   IEG_G_LonSP(gdb) * 0.001 - 180;
+      grid.angle     = 0;
+    }
+
+  gridID = varDefGrid(vlistID, grid, 0);
+
+  leveltype = iegGetZaxisType(IEG_P_LevelType(pdb));
+  
+  if ( leveltype == ZAXIS_HYBRID )
+    {
+      int i;
+      double tmpvct[100];
+      int vctsize = IEG_G_NumVCP(gdb);
+
+      for ( i = 0; i < vctsize/2; i++ ) tmpvct[i] = vct[i];
+      for ( i = 0; i < vctsize/2; i++ ) tmpvct[i+vctsize/2] = vct[i+50];
+
+      varDefVCT(vctsize, tmpvct);
+    }
+
+  if ( IEG_P_LevelType(pdb) == IEG_LTYPE_HYBRID_LAYER ) lbounds = 1;
+
+  datatype = iegInqDatatype(prec);
+
+  varAddRecord(recID, param, gridID, leveltype, lbounds, level1, level2,
+	       datatype, &varID, &levelID, UNDEFID, 0, 0, NULL, NULL, NULL);
+
+  (*record).varID   = varID;
+  (*record).levelID = levelID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+
+  if ( CDI_Debug )
+    Message("varID = %d gridID = %d levelID = %d",
+	    varID, gridID, levelID);
+}
+
+#if 0
+static
+void iegCmpRecord(int streamID, int tsID, int recID, off_t position, int param,
+		  int level, int xsize, int ysize)
+{
+  int varID = 0;
+  int levelID = 0;
+  record_t *record;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  if ( param != (*record).param || level != (*record).ilevel )
+    Error("inconsistent timestep");
+
+  (*record).position = position;
+  /*
+  varID   = (*record).varID;
+  levelID = (*record).levelID;
+
+  streamptr->vars[varID].level[levelID] = recID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+  */
+  if ( CDI_Debug )
+    Message("varID = %d levelID = %d", varID, levelID);
+}
+#endif
+
+void iegDateTime(int *pdb, int *date, int *time)
+{
+  int ryear, rmonth, rday, rhour, rminute;
+
+  ryear   = IEG_P_Year(pdb);
+
+  rmonth  = IEG_P_Month(pdb);
+  rday    = IEG_P_Day(pdb);
+
+  rhour   = IEG_P_Hour(pdb);
+  rminute = IEG_P_Minute(pdb);
+
+  if ( rminute == -1 ) rminute = 0;
+
+  *date = cdiEncodeDate(ryear, rmonth, rday);
+  *time = cdiEncodeTime(rhour, rminute, 0);
+}
+
+static
+void iegScanTimestep1(int streamID)
+{  
+  int prec = 0;
+  int status;
+  int fileID;
+  int tabnum;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos;
+  int nrecords, nrecs, recID;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  IEGCOMPVAR compVar, compVar0;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 0;
+
+  iegp  = streamptr->record->iegp;
+  tsID  = tstepsNewEntry(streamID);
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( tsID != 0 )
+    Error("Internal problem! tstepsNewEntry returns %d", tsID);
+
+  fileID = streamInqFileID(streamID);
+
+  nrecs = 0;
+  while ( TRUE )
+    {
+      recpos = fileGetPos(fileID);
+      status = iegRead(fileID, iegp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 1;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      prec   = iegp->dprec;
+      rcode  = IEG_P_Parameter(iegp->ipdb);
+      tabnum = IEG_P_CodeTable(iegp->ipdb);
+      param  = cdiEncodeParam(rcode, tabnum, 255);
+
+      if ( IEG_P_LevelType(iegp->ipdb) == IEG_LTYPE_HYBRID_LAYER )
+	rlevel = IEG_P_Level1(iegp->ipdb);
+      else
+	rlevel = IEG_P_Level2(iegp->ipdb);
+
+      if ( IEG_P_LevelType(iegp->ipdb) == 100 ) rlevel *= 100;
+
+      iegDateTime(iegp->ipdb, &vdate, &vtime);
+
+      if ( nrecs == 0 )
+	{
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	}
+      else
+	{
+	  datetime.date = vdate;
+	  datetime.time = vtime;
+	  compVar.param = param;
+          compVar.level = rlevel;
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      compVar0.param = streamptr->tsteps[0].records[recID].param;
+	      compVar0.level = streamptr->tsteps[0].records[recID].ilevel;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(IEGCOMPVAR)) == 0 ) break;
+	    }
+	  if ( recID < nrecs ) break;
+	  if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) )
+	    Warning("Inconsistent verification time for param %d level %d", param, rlevel);
+	}
+
+      nrecs++;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", nrecs, (int)recpos, param, rlevel, vdate, vtime);
+
+      iegAddRecord(streamID, param, iegp->ipdb, iegp->igdb, iegp->vct, recsize, recpos, prec);
+    }
+
+  streamptr->rtsteps = 1;
+
+  cdiGenVars(streamID);
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+  taxis->type  = TAXIS_ABSOLUTE;
+  taxis->vdate = datetime0.date;
+  taxis->vtime = datetime0.time;
+
+  vlistID = streamInqVlist(streamID);
+  vlistDefTaxis(vlistID, taxisID);
+
+  cdiCheckContents(streamID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  if ( nrecords < streamptr->tsteps[0].recordSize )
+    {
+      streamptr->tsteps[0].recordSize = nrecords;
+      streamptr->tsteps[0].records =
+	(record_t *) realloc(streamptr->tsteps[0].records, nrecords*sizeof(record_t));
+    }
+
+  streamptr->tsteps[0].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[0].nrecs = nrecords;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[0].recIDs[recID] = recID;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( streamptr->ntsteps == 1 )
+    {
+      if ( taxis->vdate == 0 && taxis->vtime == 0 )
+	{
+	  streamptr->ntsteps = 0;
+	  for ( varID = 0; varID < streamptr->nvars; varID++ )
+	    {
+	      vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	    }
+	}
+    }
+}
+
+static
+int iegScanTimestep2(int streamID)
+{  
+  int status;
+  int fileID;
+  int tabnum;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos = 0;
+  int nrecords, nrecs, recID, rindex;
+  int nextstep;
+  taxis_t *taxis;
+  int vlistID;
+  IEGCOMPVAR compVar, compVar0;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 1;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  iegp    = streamptr->record->iegp;
+
+  tsID = streamptr->rtsteps;
+  if ( tsID != 1 )
+    Error("Internal problem! unexpeceted timestep %d", tsID+1);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+  cdiCreateRecords(streamID, tsID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[1].nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[1].recIDs[recID] = -1;
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID = streamptr->tsteps[0].records[recID].varID;
+      streamptr->tsteps[tsID].records[recID].position = 
+	streamptr->tsteps[0].records[recID].position;
+      streamptr->tsteps[tsID].records[recID].size     = 
+	streamptr->tsteps[0].records[recID].size;
+    }
+
+  for ( rindex = 0; rindex <= nrecords; rindex++ )
+    {
+      recpos = fileGetPos(fileID);
+      status = iegRead(fileID, iegp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 2;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      rcode  = IEG_P_Parameter(iegp->ipdb);
+      tabnum = IEG_P_CodeTable(iegp->ipdb);
+      param  = cdiEncodeParam(rcode, tabnum, 255);
+
+      if ( IEG_P_LevelType(iegp->ipdb) == IEG_LTYPE_HYBRID_LAYER )
+	rlevel = IEG_P_Level1(iegp->ipdb);
+      else
+	rlevel = IEG_P_Level2(iegp->ipdb);
+
+      if ( IEG_P_LevelType(iegp->ipdb) == 100 ) rlevel *= 100;
+
+      iegDateTime(iegp->ipdb, &vdate, &vtime);
+
+      if ( rindex == 0 )
+	{
+	  taxis->type  = TAXIS_ABSOLUTE;
+	  taxis->vdate = vdate;
+	  taxis->vtime = vtime;
+	}
+
+      compVar.param = param;
+      compVar.level = rlevel;
+      nextstep = FALSE;
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(IEGCOMPVAR)) == 0 )
+	    {
+	      if ( streamptr->tsteps[tsID].records[recID].used )
+		{
+		  nextstep = TRUE;
+		}
+	      else
+		{
+		  streamptr->tsteps[tsID].records[recID].used = TRUE;
+		  streamptr->tsteps[tsID].recIDs[rindex] = recID;
+		}
+	      break;
+	    }
+	}
+      if ( recID == nrecords )
+	{
+	  char paramstr[32];
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+	  Warning("param %s level %d not defined at timestep 1", paramstr, rlevel);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      if ( nextstep ) break;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", rindex+1, (int)recpos, param, rlevel, vdate, vtime);
+
+      streamptr->tsteps[tsID].records[recID].size = recsize;
+
+      compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+      compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+      if ( memcmp(&compVar0, &compVar, sizeof(IEGCOMPVAR)) != 0 )
+	{
+	  Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		  tsID, recID,
+		  streamptr->tsteps[tsID].records[recID].param, param,
+		  streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->tsteps[1].records[recID].position = recpos;
+    }
+
+  nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      if ( ! streamptr->tsteps[tsID].records[recID].used )
+	{
+	  varID = streamptr->tsteps[tsID].records[recID].varID;
+          vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	}
+      else
+	{
+	  nrecs++;
+	}
+    }
+  streamptr->tsteps[tsID].nrecs = nrecs;
+
+  streamptr->rtsteps = 2;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  return (0);
+}
+
+
+int iegInqContents(int streamID)
+{
+  int fileID;
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+
+  streamptr->curTsID = 0;
+
+  iegScanTimestep1(streamID);
+ 
+  if ( streamptr->ntsteps == -1 ) status = iegScanTimestep2(streamID);
+
+  fileSetPos(fileID, 0, SEEK_SET);
+
+  return (status);
+}
+
+static
+int iegScanTimestep(int streamID)
+{
+  int status;
+  int fileID;
+  int tsID;
+  int tabnum;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  long recsize = 0;
+  off_t recpos = 0;
+  int recID;
+  taxis_t *taxis;
+  int rindex, nrecs = 0;
+  IEGCOMPVAR compVar, compVar0;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( CDI_Debug )
+    {
+      Message("streamID = %d", streamID);
+      Message("cts = %d", streamptr->curTsID);
+      Message("rts = %d", streamptr->rtsteps);
+      Message("nts = %d", streamptr->ntsteps);
+    }
+
+  if ( streamptr->rtsteps == 0 )
+    Error("Internal problem! Missing contents.");
+
+  iegp  = streamptr->record->iegp;
+  tsID  = streamptr->rtsteps;
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->tsteps[tsID].recordSize == 0 )
+    {
+      cdiCreateRecords(streamID, tsID);
+
+      nrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->tsteps[tsID].nrecs = nrecs;
+      streamptr->tsteps[tsID].recIDs = (int *) malloc(nrecs*sizeof(int));
+      for ( recID = 0; recID < nrecs; recID++ )
+	streamptr->tsteps[tsID].recIDs[recID] = streamptr->tsteps[1].recIDs[recID];
+
+      fileID = streamInqFileID(streamID);
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+      for ( rindex = 0; rindex <= nrecs; rindex++ )
+	{
+	  recpos = fileGetPos(fileID);
+	  status = iegRead(fileID, iegp);
+	  if ( status != 0 )
+	    {
+	      streamptr->ntsteps = streamptr->rtsteps + 1;
+	      break;
+	    }
+	  recsize = fileGetPos(fileID) - recpos;
+
+	  rcode  = IEG_P_Parameter(iegp->ipdb);
+	  tabnum = IEG_P_CodeTable(iegp->ipdb);
+	  param  = cdiEncodeParam(rcode, tabnum, 255);
+
+	  if ( IEG_P_LevelType(iegp->ipdb) == IEG_LTYPE_HYBRID_LAYER )
+	    rlevel = IEG_P_Level1(iegp->ipdb);
+	  else
+	    rlevel = IEG_P_Level2(iegp->ipdb);
+
+	  if ( IEG_P_LevelType(iegp->ipdb) == 100 ) rlevel *= 100;
+
+	  iegDateTime(iegp->ipdb, &vdate, &vtime);
+
+	  // if ( rindex == nrecs ) break; gcc-4.5 internal compiler error
+	  if ( rindex == nrecs ) continue;
+	  recID = streamptr->tsteps[tsID].recIDs[rindex];
+
+	  if ( rindex == 0 )
+	    {
+	      taxis->type  = TAXIS_ABSOLUTE;
+	      taxis->vdate = vdate;
+	      taxis->vtime = vtime;
+	    }
+
+	  compVar.param = param;
+          compVar.level = rlevel;
+	  compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(IEGCOMPVAR)) != 0 )
+	    {
+	      Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		      tsID, recID,
+		      streamptr->tsteps[tsID].records[recID].param, param,
+		      streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	      Error("Invalid, unsupported or inconsistent record structure");
+	    }
+
+	  streamptr->tsteps[tsID].records[recID].position = recpos;
+	  streamptr->tsteps[tsID].records[recID].size = recsize;
+
+	  if ( CDI_Debug )
+	    Message("%4d%8d%4d%8d%8d%6d", rindex, (int)recpos, param, rlevel, vdate, vtime);
+	}
+
+      streamptr->rtsteps++;
+
+      if ( streamptr->ntsteps != streamptr->rtsteps )
+	{
+	  tsID = tstepsNewEntry(streamID);
+	  if ( tsID != streamptr->rtsteps )
+	    Error("Internal error. tsID = %d", tsID);
+
+	  streamptr->tsteps[tsID-1].next   = 1;
+	  streamptr->tsteps[tsID].position = recpos;
+	}
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( nrecs > 0 && nrecs < streamptr->tsteps[tsID].nrecs )
+    {
+      Warning("Incomplete timestep. Stop scanning at timestep %d.", tsID);
+      streamptr->ntsteps = tsID;
+    }
+
+  return (streamptr->ntsteps);
+}
+
+
+int iegInqTimestep(int streamID, int tsID)
+{
+  int ntsteps, nrecs;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( tsID == 0 && streamptr->rtsteps == 0 )
+    Error("Call to cdiInqContents missing!");
+
+  if ( CDI_Debug )
+    Message("tsID = %d rtsteps = %d", tsID, streamptr->rtsteps);
+  
+  ntsteps = UNDEFID;
+  while ( ( tsID + 1 ) > streamptr->rtsteps && ntsteps == UNDEFID )
+    ntsteps = iegScanTimestep(streamID);
+
+  if ( tsID >= streamptr->ntsteps && streamptr->ntsteps != CDI_UNDEFID )
+    {
+      nrecs = 0;
+    }
+  else
+    {
+      streamptr->curTsID = tsID;
+      nrecs = streamptr->tsteps[tsID].nrecs;
+    }
+
+  return (nrecs);
+}
+
+
+void iegReadVarDP(int streamID, int varID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int levID, nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  iegp     = streamptr->record->iegp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  for (levID = 0; levID < nlevs; levID++)
+    {
+      recID = streamptr->vars[varID].level[levID];
+      recpos = streamptr->tsteps[tsid].records[recID].position;
+      fileSetPos(fileID, recpos, SEEK_SET);
+      iegRead(fileID, iegp);
+      iegInqDataDP(iegp, &data[levID*gridsize]);
+    }
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  for ( i = 0; i < nlevs*gridsize; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+}
+
+
+void iegReadVarSliceDP(int streamID, int varID, int levID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  iegp     = streamptr->record->iegp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d",
+	     nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  recID = streamptr->vars[varID].level[levID];
+  recpos = streamptr->tsteps[tsid].records[recID].position;
+  fileSetPos(fileID, recpos, SEEK_SET);
+  iegRead(fileID, iegp);
+  iegInqDataDP(iegp, data);
+
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  for ( i = 0; i < gridsize; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+}
+
+
+void iegWriteVarDP(int streamID, int varID, const double *data)
+{
+  int fileID;
+  int levID, nlevs, gridID, gridsize;
+  int zaxisID;
+  int datatype;
+  int tsID;
+  int vlistID;
+  int i;
+  int date, time;
+  int param, pdis, pcat, pnum;
+  double refval;
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  iegp     = streamptr->record->iegp;
+
+  iegInitMem(iegp);
+  for ( i = 0; i < 37; i++ ) iegp->ipdb[i] = -1;
+
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  nlevs    = zaxisInqSize(zaxisID);
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  param    = vlistInqVarParam(vlistID, varID);
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+  IEG_P_Parameter(iegp->ipdb) = pnum;
+  if ( pdis == 255 ) IEG_P_CodeTable(iegp->ipdb) = pcat;
+  date     = streamptr->tsteps[tsID].taxis.vdate;
+  time     = streamptr->tsteps[tsID].taxis.vtime;
+
+  iegDefTime(iegp->ipdb, date, time, vlistInqTaxis(vlistID));
+  iegDefGrid(iegp->igdb, gridID);
+
+  datatype = vlistInqVarDatatype(vlistID, varID);
+
+  iegp->dprec = iegDefDatatype(datatype);
+
+  for ( levID = 0;  levID < nlevs; levID++ )
+    {
+      iegDefLevel(iegp->ipdb, iegp->igdb, iegp->vct, zaxisID, levID);
+
+      refval = data[0];
+      for ( i = 1; i < gridsize; i++ )
+	if ( data[levID*gridsize+i] < refval ) refval = data[levID*gridsize+i];
+
+      iegp->refval = refval;
+
+      iegDefDataDP(iegp, &data[levID*gridsize]);
+      iegWrite(fileID, iegp);
+    }
+}
+
+
+void iegWriteVarSliceDP(int streamID, int varID, int levID, const double *data)
+{
+  int fileID;
+  int gridID;
+  int zaxisID;
+  /* double level; */
+  int datatype;
+  /* int tsID; */
+  int vlistID;
+  /* int param, date, time, datasize; */
+  iegrec_t *iegp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  iegp     = streamptr->record->iegp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  /* tsID     = streamptr->curTsID; */
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  /* level    = zaxisInqLevel(zaxisID, levID); */
+
+  if ( CDI_Debug )
+    Message("gridID = %d zaxisID = %d", gridID, zaxisID);
+
+  /* param = vlistInqVarParam(vlistID, varID); */
+  /* date = streamptr->tsteps[tsID].taxis.vdate; */
+  /* time = streamptr->tsteps[tsID].taxis.vtime; */
+  /* datasize = gridInqSize(gridID); */
+
+  datatype = vlistInqVarDatatype(vlistID, varID);
+
+  iegp->dprec = iegDefDatatype(datatype);
+
+  iegDefDataDP(iegp, data);
+  iegWrite(fileID, iegp);
+}
+
+#endif /* HAVE_LIBIEG */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_ieg.h b/libcdi/src/stream_ieg.h
new file mode 100644
index 0000000..7b5c76f
--- /dev/null
+++ b/libcdi/src/stream_ieg.h
@@ -0,0 +1,32 @@
+#ifndef _STREAM_IEG_H
+#define _STREAM_IEG_H
+
+#ifndef _IEG_H
+#  include "ieg.h"
+#endif
+
+int    iegInqContents(int streamID);
+int    iegInqTimestep(int streamID, int tsID);
+
+int    iegInqRecord(int streamID, int *varID, int *levelID);
+int    iegDefRecord(int streamID);
+int    iegCopyRecord(int streamIDdest, int streamIDsrc);
+int    iegReadRecord(int streamID, double *data, int *nmiss);
+int    iegWriteRecord(int streamID, const double *data);
+
+void   iegReadVarDP (int streamID, int varID,       double *data, int *nmiss);
+void   iegWriteVarDP(int streamID, int varID, const double *data);
+
+void   iegReadVarSliceDP (int streamID, int varID, int levelID,       double *data, int *nmiss);
+void   iegWriteVarSliceDP(int streamID, int varID, int levelID, const double *data);
+
+#endif  /* _STREAM_IEG_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_int.c b/libcdi/src/stream_int.c
new file mode 100644
index 0000000..8bcab29
--- /dev/null
+++ b/libcdi/src/stream_int.c
@@ -0,0 +1,742 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdarg.h>
+#include <string.h>
+#include <errno.h>
+#include <math.h>
+#include <ctype.h>
+
+#include "dmemory.h"
+
+#include "cdi.h"
+#include "stream_int.h"
+#include "pio_util.h"
+#include "namespace.h"
+#include "resource_handle.h"
+#include "pio_rpc.h"
+
+#if  defined  (HAVE_LIBCGRIBEX)
+#include "cgribex.h"
+#endif
+
+int cdiDefaultCalendar = CALENDAR_PROLEPTIC;
+
+int cdiDefaultInstID   = CDI_UNDEFID;
+int cdiDefaultModelID  = CDI_UNDEFID;
+int cdiDefaultTableID  = CDI_UNDEFID;
+int cdiNcMissingValue  = CDI_UNDEFID;
+int cdiNcChunksizehint = CDI_UNDEFID;
+int cdiChunkType       = CHUNK_GRID;
+int cdiSplitLtype105   = CDI_UNDEFID;
+
+int cdiIgnoreAttCoordinates = FALSE;
+int cdiSkipRecords          = 0;
+int cdiInventoryMode        = 1;
+
+char *cdiPartabPath   = NULL;
+int   cdiPartabIntern = 1;
+
+double cdiDefaultMissval = -9.E33;
+
+char *Filetypes[] = {
+  "UNKNOWN",
+  "GRIB",
+  "GRIB2",
+  "netCDF",
+  "netCDF2",
+  "netCDF4",
+  "SERVICE",
+  "EXTRA",
+  "IEG",
+  "HDF5",
+};
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+
+int CDI_Debug   = 0;    /* If set to 1, debugging           */
+
+static int  STREAM_Debug = 0;   /* If set to 1, debugging */
+
+int cdiDefaultLeveltype = -1;
+static int cdiDataUnreduced = 0;
+static int cdiSortName = 0;
+static int cdiHaveMissval = 0;
+
+
+static int    streamCompareP ( void * streamptr1, void * streamptr2 );
+static void   streamDestroyP ( void * streamptr );
+static void   streamPrintP   ( void * streamptr, FILE * fp );
+#ifdef USE_MPI
+static int    streamGetPackSize ( void * streamptr, MPI_Comm comm );
+static void   streamPack        ( void * streamptr, void * buff, int size,
+				  int * position, MPI_Comm comm );
+static int    streamTxCode      ( void );
+#endif
+
+resOps streamOps = { streamCompareP, streamDestroyP, streamPrintP,
+#ifdef USE_MPI
+                     streamGetPackSize,
+		     streamPack,
+                     streamTxCode
+#endif
+};
+
+long cdiGetenvInt(char *envName)
+{
+  char *envString;
+  long envValue = -1;
+  long fact = 1;
+
+  envString = getenv(envName);
+
+  if ( envString )
+    {
+      int loop, len;
+
+      len = (int) strlen(envString);
+      for ( loop = 0; loop < len; loop++ )
+	{
+	  if ( ! isdigit((int) envString[loop]) )
+	    {
+	      switch ( tolower((int) envString[loop]) )
+		{
+		case 'k':  fact = 1024;        break;
+		case 'm':  fact = 1048576;     break;
+		case 'g':  fact = 1073741824;  break;
+		default:
+		  fact = 0;
+		  Message("Invalid number string in %s: %s", envName, envString);
+		  Warning("%s must comprise only digits [0-9].",envName);
+		}
+	      break;
+	    }
+	}
+
+      if ( fact ) envValue = fact*atol(envString);
+
+      if ( CDI_Debug ) Message("set %s to %ld", envName, envValue);
+    }
+
+  return (envValue);
+}
+
+static
+void cdiSetChunk(const char *chunkAlgo)
+{
+  char *pch;
+  size_t len = strlen(chunkAlgo);
+  int algo = -1;
+
+  if      ( strcmp("auto",  chunkAlgo)   == 0 ) algo = CHUNK_AUTO;
+  else if ( strcmp("grid",  chunkAlgo)   == 0 ) algo = CHUNK_GRID;
+  else if ( strcmp("lines", chunkAlgo)   == 0 ) algo = CHUNK_LINES;
+  /*
+  else if ( (pch = strstr(chunkAlgo,"x")) != 0 )
+    {
+      int ix, iy;
+      ix = atoi(chunkAlgo);
+      iy = atoi(pch+1);
+      if ( ix > 0 && iy > 0 )
+        {
+          cdiChunkX = ix;
+          cdiChunkY = iy;
+          algo = CHUNK_USER;
+        }
+      else
+        Warning("Invalid environment variable CDI_CHUNK_ALGO: %s", chunkAlgo);
+    }
+  */
+  else
+    Warning("Invalid environment variable CDI_CHUNK_ALGO: %s", chunkAlgo);
+
+  if ( algo != -1 )
+    {
+      cdiChunkType = algo;
+      if ( CDI_Debug ) Message("set ChunkAlgo to %s", chunkAlgo);
+    }
+}
+
+
+void cdiInitialize(void)
+{
+  static int Init_CDI = FALSE;
+  char *envString;
+  long value;
+
+  if ( ! Init_CDI )
+    {
+      Init_CDI = TRUE;
+
+#if  defined  (HAVE_LIBCGRIBEX)
+      gribFixZSE(1);   // 1: Fix ZeroShiftError of simple packed spherical harmonics
+      gribSetConst(1); // 1: Don't pack constant fields on regular grids
+#endif
+
+      value = cdiGetenvInt("CDI_REGULARGRID");
+      if ( value >= 0 ) cdiDataUnreduced = (int) value;
+
+      value = cdiGetenvInt("CDI_SORTNAME");
+      if ( value >= 0 ) cdiSortName = (int) value;
+
+      value = cdiGetenvInt("CDI_HAVE_MISSVAL");
+      if ( value >= 0 ) cdiHaveMissval = (int) value;
+
+      value = cdiGetenvInt("CDI_LEVELTYPE");
+      if ( value >= 0 ) cdiDefaultLeveltype = (int) value;
+
+      envString = getenv("CDI_MISSVAL");
+      if ( envString ) cdiDefaultMissval = atof(envString);
+
+      envString = getenv("NC_MISSING_VALUE");
+      if ( envString ) cdiNcMissingValue = atoi(envString);
+
+      envString = getenv("NC_CHUNKSIZEHINT");
+      if ( envString ) cdiNcChunksizehint = atoi(envString);
+
+      envString = getenv("CDI_CHUNK_ALGO");
+      if ( envString ) cdiSetChunk(envString);
+
+      envString = getenv("SPLIT_LTYPE_105");
+      if ( envString ) cdiSplitLtype105 = atoi(envString);
+
+      envString = getenv("IGNORE_ATT_COORDINATES");
+      if ( envString ) cdiIgnoreAttCoordinates = atoi(envString);
+
+      envString = getenv("CDI_SKIP_RECORDS");
+      if ( envString )
+	{
+	  cdiSkipRecords = atoi(envString);
+	  cdiSkipRecords = cdiSkipRecords > 0 ? cdiSkipRecords : 0;
+	}
+
+      envString = getenv("GRIB_INVENTORY_MODE");
+      if ( envString )
+	{
+	  if ( strncmp(envString, "time", 4) == 0 )
+	    {
+	      cdiInventoryMode = 2;
+	      if ( CDI_Debug )
+		Message("Inventory mode was set to timestep!");
+	    }
+	}
+
+      envString = getenv("CDI_CALENDAR");
+      if ( envString )
+	{
+	  if      ( strncmp(envString, "standard", 8) == 0 )
+	    cdiDefaultCalendar = CALENDAR_STANDARD;
+	  else if ( strncmp(envString, "proleptic", 9) == 0 )
+	    cdiDefaultCalendar = CALENDAR_PROLEPTIC;
+	  else if ( strncmp(envString, "360days", 7) == 0 )
+	    cdiDefaultCalendar = CALENDAR_360DAYS;
+	  else if ( strncmp(envString, "365days", 7) == 0 )
+	    cdiDefaultCalendar = CALENDAR_365DAYS;
+	  else if ( strncmp(envString, "366days", 7) == 0 )
+	    cdiDefaultCalendar = CALENDAR_366DAYS;
+	  else if ( strncmp(envString, "none", 4) == 0 )
+	    cdiDefaultCalendar = CALENDAR_NONE;
+
+	  if ( CDI_Debug )
+	    Message("Default calendar set to %s!", envString);
+	}
+#if  defined  (HAVE_LIBCGRIBEX)
+      gribSetCalendar(cdiDefaultCalendar);
+#endif
+
+      envString = getenv("PARTAB_INTERN");
+      if ( envString ) cdiPartabIntern = atoi(envString);
+
+      envString = getenv("PARTAB_PATH");
+      if ( envString ) cdiPartabPath = strdup(envString);
+
+      envString = getenv("STREAM_DEBUG");
+      if ( envString ) STREAM_Debug = atoi(envString);
+    }
+}
+
+
+char *strfiletype(int filetype)
+{
+  char *name;
+  int size = (int) (sizeof(Filetypes)/sizeof(char *));
+
+  if ( filetype > 0 && filetype < size )
+    name = Filetypes[filetype];
+  else
+    name = Filetypes[0];  
+
+  return (name);
+}
+
+
+stream_t *stream_to_pointer(int idx)
+{
+  return ( stream_t *) reshGetVal ( idx, &streamOps );
+}
+
+static
+void streamDefaultValue ( stream_t * streamptr )
+{
+  int i;
+
+  streamptr->self              = UNDEFID;
+  streamptr->accesstype        = UNDEFID;
+  streamptr->accessmode        = 0;
+  streamptr->filetype          = UNDEFID;
+  streamptr->byteorder         = UNDEFID;
+  streamptr->fileID            = 0;
+  streamptr->dimgroupID        = UNDEFID;
+  streamptr->filemode          = 0;
+  streamptr->numvals           = 0;
+  streamptr->filename          = NULL;
+  streamptr->record            = NULL;
+  streamptr->varsAllocated     = 0;
+  streamptr->nrecs             = 0;
+  streamptr->nvars             = 0;
+  streamptr->vars              = NULL;
+  streamptr->varinit           = 0;
+  streamptr->ncmode            = 0;
+  streamptr->curTsID           = UNDEFID;
+  streamptr->rtsteps           = 0;
+  streamptr->ntsteps           = UNDEFID;
+  streamptr->numTimestep       = 0;
+  streamptr->tsteps            = NULL;
+  streamptr->tstepsTableSize   = 0;
+  streamptr->tstepsNextID      = 0;
+  streamptr->historyID         = UNDEFID;
+  streamptr->vlistID           = UNDEFID;
+  streamptr->globalatts        = 0;
+  streamptr->localatts         = 0;
+  streamptr->vct.ilev          = 0;
+  streamptr->vct.mlev          = 0;
+  streamptr->vct.ilevID        = UNDEFID;
+  streamptr->vct.mlevID        = UNDEFID;
+  streamptr->unreduced         = cdiDataUnreduced;
+  streamptr->sortname          = cdiSortName;
+  streamptr->have_missval      = cdiHaveMissval;
+  streamptr->comptype          = COMPRESS_NONE;
+  streamptr->complevel         = 0;
+
+  basetimeInit(&streamptr->basetime);
+
+  for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->xdimID[i]   = UNDEFID;
+  for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ydimID[i]   = UNDEFID;
+  for ( i = 0; i < MAX_ZAXES_PS; i++ ) streamptr->zaxisID[i]  = UNDEFID;
+  for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ncxvarID[i] = UNDEFID;
+  for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ncyvarID[i] = UNDEFID;
+  for ( i = 0; i < MAX_GRIDS_PS; i++ ) streamptr->ncavarID[i] = UNDEFID;
+
+  streamptr->curfile           = 0;
+  streamptr->nfiles            = 0;
+  streamptr->fnames            = NULL;
+
+  streamptr->gribContainers    = NULL;
+  streamptr->vlistIDorig       = UNDEFID;
+}
+
+
+stream_t *stream_new_entry(void)
+{
+  stream_t *streamptr;
+
+  cdiInitialize(); /* ***************** make MT version !!! */
+
+  streamptr = (stream_t *) xmalloc(sizeof(stream_t));
+  streamDefaultValue ( streamptr );
+  streamptr->self = reshPut (( void * ) streamptr, &streamOps );
+
+  return streamptr;
+}
+
+
+void stream_delete_entry(stream_t *streamptr)
+{
+  int idx;
+
+  xassert ( streamptr );
+
+  idx = streamptr->self;
+  free ( streamptr );
+  reshRemove ( idx, &streamOps );
+
+  if ( STREAM_Debug )
+    Message("Removed idx %d from stream list", idx);
+}
+
+
+void stream_check_ptr(const char *caller, stream_t *streamptr)
+{
+  if ( streamptr == NULL )
+    Errorc("stream undefined!");
+}
+
+
+int streamSize(void)
+{
+  return reshCountType ( &streamOps );
+}
+
+
+void cdiDefGlobal(const char *string, int val)
+{
+  if ( strcmp(string, "REGULARGRID") == 0 )
+    {
+      cdiDataUnreduced = val;
+    }
+  else if ( strcmp(string, "SORTNAME") == 0 )
+    {
+      cdiSortName = val;
+    }
+  else if ( strcmp(string, "HAVE_MISSVAL") == 0 )
+    {
+      cdiHaveMissval = val;
+    }
+  else if ( strcmp(string, "NC_CHUNKSIZEHINT") == 0 )
+    {
+      cdiNcChunksizehint = val;
+    }
+  else
+    {
+      Warning("Unsupported global key: %s", string);
+    }
+}
+
+
+void cdiDefMissval(double missval)
+{
+  cdiInitialize();
+
+  cdiDefaultMissval = missval;
+}
+
+
+double cdiInqMissval(void)
+{
+  cdiInitialize();
+
+  return (cdiDefaultMissval);
+}
+
+
+void cdiCheckContents(int streamID)
+{
+  int index, nzaxis, zaxisID;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  nzaxis = vlistNzaxis(vlistID);
+
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      zaxisID = vlistZaxis(vlistID, index);
+      if ( zaxisInqType(zaxisID) == ZAXIS_GENERIC )
+	cdiCheckZaxis(zaxisID);
+    }
+}
+
+
+int streamInqFileID(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  return (streamptr->fileID);
+}
+
+/* not used anymore */
+/*
+void streamDefineTaxis(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  if ( streamptr->tsteps == NULL )
+    {
+      int varID, nvars;
+      int vlistID;
+
+      vlistID = streamInqVlist(streamID);
+
+      nvars = vlistNvars(vlistID);
+      for ( varID = 0; varID < nvars; varID++ )
+	if ( vlistInqVarTsteptype(vlistID, varID) == TSTEP_CONSTANT ) break;
+
+      if ( varID == nvars )
+	{
+	  int taxisID;
+
+	  taxisID = vlistInqTaxis(vlistID);
+	  if ( taxisID == CDI_UNDEFID )
+	    {
+	      taxisID = taxisCreate(TAXIS_ABSOLUTE);
+	      vlistDefTaxis(vlistID, taxisID);
+	    }
+
+	  (void) streamDefTimestep(streamID, 0);
+	}
+      else
+	Error("time axis undefined");
+    }
+}
+*/
+
+void streamDefDimgroupID(int streamID, int dimgroupID)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  streamptr->dimgroupID = dimgroupID;
+}
+
+
+int streamInqDimgroupID(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  return (streamptr->dimgroupID);
+}
+
+
+void cdiDefAccesstype(int streamID, int type)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  if ( streamptr->accesstype == UNDEFID )
+    {
+      streamptr->accesstype = type;
+    }
+  else
+    {
+      if ( streamptr->accesstype != type )
+	{
+	  if ( streamptr->accesstype == TYPE_REC )
+	    Error("Changing access type from REC to VAR not allowed!");
+	  else
+	    Error("Changing access type from VAR to REC not allowed!");
+	}
+    }
+}
+
+
+int cdiInqAccesstype(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = ( stream_t *) reshGetVal ( streamID, &streamOps );
+
+  return (streamptr->accesstype);
+} 
+
+
+int streamInqNvars ( int streamID )
+{
+  stream_t * streamptr;
+  streamptr = ( stream_t * ) reshGetVal ( streamID, &streamOps );
+  return ( streamptr->nvars );
+}
+
+
+int  streamCompareP ( void * streamptr1, void * streamptr2 )
+{
+  stream_t * s1 = ( stream_t * ) streamptr1;
+  stream_t * s2 = ( stream_t * ) streamptr2;
+  int differ = -1;
+  int equal  = 0;
+  int len;
+
+  xassert ( s1 );
+  xassert ( s2 );
+
+  if ( s1->filetype  != s2->filetype  ) return differ;
+  if (  namespaceAdaptKey2 ( s1->vlistIDorig ) != 			     
+	namespaceAdaptKey2 ( s2->vlistIDorig )) return differ;
+  if ( s1->byteorder != s2->byteorder ) return differ;
+  if ( s1->comptype  != s2->comptype  ) return differ;
+  if ( s1->complevel != s2->complevel ) return differ; 
+
+  if ( s1->filename )
+    {
+      len = strlen ( s1->filename ) + 1;
+      if ( memcmp ( s1->filename, s2->filename, len )) 
+	return differ;
+    }
+  else if ( s2->filename ) 
+    return differ;
+
+  return equal;
+}
+
+
+void streamDestroyP ( void * streamptr )
+{
+  int id;
+  stream_t * sp = ( stream_t * ) streamptr;
+
+  xassert ( sp );
+
+  id = sp->self;
+  streamClose ( id );
+}
+
+
+void streamPrintP   ( void * streamptr, FILE * fp )
+{
+  stream_t * sp = ( stream_t * ) streamptr;
+
+  if ( !sp ) return;
+
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "# streamID %d\n", sp->self);
+  fprintf ( fp, "#\n"); 
+  fprintf ( fp, "self          = %d\n", sp->self );
+  fprintf ( fp, "accesstype    = %d\n", sp->accesstype );
+  fprintf ( fp, "accessmode    = %d\n", sp->accessmode ); 
+  fprintf ( fp, "filetype      = %d\n", sp->filetype );
+  fprintf ( fp, "byteorder     = %d\n", sp->byteorder );
+  fprintf ( fp, "fileID        = %d\n", sp->fileID );
+  fprintf ( fp, "dimgroupID    = %d\n", sp->dimgroupID );
+  fprintf ( fp, "filemode      = %d\n", sp->filemode );
+  fprintf ( fp, "//off_t numvals;\n" );
+  fprintf ( fp, "filename      = %s\n", sp->filename );
+  fprintf ( fp, "//Record   *record;\n" );
+  fprintf ( fp, "nrecs         = %d\n", sp->nrecs );
+  fprintf ( fp, "nvars         = %d\n", sp->nvars );
+  fprintf ( fp, "varlocked     = %d\n", sp->varlocked );
+  fprintf ( fp, "//svarinfo_t *vars;\n" );
+  fprintf ( fp, "varsAllocated = %d\n", sp->varsAllocated );
+  fprintf ( fp, "varinit       = %d\n", sp->varinit );
+  fprintf ( fp, "curTsID       = %d\n", sp->curTsID );
+  fprintf ( fp, "rtsteps       = %d\n", sp->rtsteps );
+  fprintf ( fp, "//long ntsteps;\n" );
+  fprintf ( fp, "numTimestep   = %d\n", sp->numTimestep );
+  fprintf ( fp, "//  tsteps_t   *tsteps;\n" );
+  fprintf ( fp, "tstepsTableSize= %d\n", sp->tstepsTableSize );
+  fprintf ( fp, "tstepsNextID  = %d\n", sp->tstepsNextID );
+  fprintf ( fp, "//BaseTime  basetime;\n" );
+  fprintf ( fp, "ncmode        = %d\n", sp->ncmode );
+  fprintf ( fp, "vlistID       = %d\n", sp->vlistID );
+  fprintf ( fp, "//  int       xdimID[MAX_GRIDS_PS];\n" );
+  fprintf ( fp, "//  int       ydimID[MAX_GRIDS_PS];\n" );
+  fprintf ( fp, "//  int       zaxisID[MAX_ZAXES_PS];\n" );
+  fprintf ( fp, "//  int       ncxvarID[MAX_GRIDS_PS];\n" );
+  fprintf ( fp, "//  int       ncyvarID[MAX_GRIDS_PS];\n" );
+  fprintf ( fp, "//  int       ncavarID[MAX_GRIDS_PS];\n" );
+  fprintf ( fp, "historyID     = %d\n", sp->historyID );
+  fprintf ( fp, "globalatts    = %d\n", sp->globalatts );
+  fprintf ( fp, "localatts     = %d\n", sp->localatts );
+  fprintf ( fp, "//  VCT       vct;\n" );
+  fprintf ( fp, "unreduced     = %d\n", sp->unreduced );
+  fprintf ( fp, "sortname      = %d\n", sp->sortname );
+  fprintf ( fp, "have_missval  = %d\n", sp->have_missval );
+  fprintf ( fp, "ztype         = %d\n", sp->comptype );
+  fprintf ( fp, "zlevel        = %d\n", sp->complevel );
+  fprintf ( fp, "curfile       = %d\n", sp->curfile );
+  fprintf ( fp, "nfiles        = %d\n", sp->nfiles );
+  fprintf ( fp, "//  char    **fnames;\n" );
+  fprintf ( fp, "//  void    **gribContainers;\n" );
+  fprintf ( fp, "vlistIDorig   = %d\n", sp->vlistIDorig );
+}
+
+
+void streamGetIndexList ( int nstreams, int * streamIndexList )
+{
+  reshGetResHListOfType ( nstreams, streamIndexList, &streamOps );
+}
+
+
+#ifdef USE_MPI
+static int
+streamTxCode ( void )
+{
+  return STREAM;
+}
+
+
+int streamNint = 11 ;
+
+
+static
+int streamGetPackSize ( void * voidP, MPI_Comm comm )
+{
+  stream_t * streamP = ( stream_t * ) voidP;
+  int packBufferSize = 0, size;
+
+  xmpi ( MPI_Pack_size ( streamNint, MPI_INT, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBufferSize += 2 * size;
+
+
+  xmpi ( MPI_Pack_size (( int ) strlen ( streamP->filename ) + 1,
+			MPI_CHAR, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBufferSize += size;
+
+  return packBufferSize;
+}
+
+
+static
+void streamPack ( void * streamptr, void * packBuffer, int packBufferSize,
+                  int * packBufferPos, MPI_Comm comm )
+{
+  stream_t * streamP = ( stream_t * ) streamptr;
+  int intBuffer[streamNint];  
+  double d;
+
+  intBuffer[0]  = streamP->self;
+  intBuffer[1]  = streamP->filetype;
+  intBuffer[2]  =  ( int ) strlen ( streamP->filename ) + 1;
+  intBuffer[3]  = streamP->vlistID;
+  intBuffer[4]  = streamP->vlistIDorig;
+  intBuffer[5]  = streamP->byteorder;
+  intBuffer[6]  = streamP->comptype;
+  intBuffer[7]  = streamP->complevel; 
+  intBuffer[8]  = cdiDataUnreduced;
+  intBuffer[9]  = cdiSortName;
+  intBuffer[10] = cdiHaveMissval;
+  
+  xmpi ( MPI_Pack ( intBuffer, streamNint, MPI_INT, 
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+  d = xchecksum ( DATATYPE_INT , streamNint, intBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  xmpi ( MPI_Pack ( &cdiDefaultMissval, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  xmpi ( MPI_Pack ( streamP->filename, intBuffer[2], MPI_CHAR, 
+		    packBuffer, packBufferSize, packBufferPos, comm )); 
+  d = xchecksum  ( DATATYPE_TXT, intBuffer[2], &streamP->filename );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_int.h b/libcdi/src/stream_int.h
new file mode 100644
index 0000000..2559b75
--- /dev/null
+++ b/libcdi/src/stream_int.h
@@ -0,0 +1,336 @@
+#ifndef _STREAM_INT_H
+#define _STREAM_INT_H
+
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <sys/types.h>
+
+#ifndef strdupx
+#ifndef strdup
+char *strdup(const char *s);
+#endif
+#define strdupx  strdup
+/*
+#define strdupx(s)			          \
+({					      	  \
+   const char *__old = (s);			  \
+   size_t __len = strlen(__old) + 1;		  \
+   char *__new = (char *) malloc(__len);	  \
+   (char *) memcpy(__new, __old, __len);	  \
+})
+*/
+#endif
+
+#ifndef  M_PI
+#define  M_PI        3.14159265358979323846  /* pi */
+#endif
+
+
+#ifndef  _ERROR_H
+#  include "error.h"
+#endif
+#ifndef _BASETIME_H
+#  include "basetime.h"
+#endif
+#ifndef _TIMEBASE_H
+#  include "timebase.h"
+#endif
+#ifndef  _TAXIS_H
+#  include "taxis.h"
+#endif
+#ifndef  _CDI_LIMITS_H
+#  include "cdi_limits.h"
+#endif
+#ifndef  _SERVICE_H
+#  include "service.h"
+#endif
+#ifndef  _EXTRA_H
+#  include "extra.h"
+#endif
+#ifndef  _IEG_H
+#  include "ieg.h"
+#endif
+
+
+#define check_parg(arg)  if ( arg == 0 ) Warning("Argument '" #arg "' not allocated!")
+
+#if defined (__xlC__) /* performance problems on IBM */
+#ifndef DBL_IS_NAN
+#  define DBL_IS_NAN(x)     ((x) != (x))
+#endif
+#else
+#ifndef DBL_IS_NAN
+#if  defined  (HAVE_DECL_ISNAN)
+#  define DBL_IS_NAN(x)     (isnan(x))
+#elif  defined  (FP_NAN)
+#  define DBL_IS_NAN(x)     (fpclassify(x) == FP_NAN)
+#else
+#  define DBL_IS_NAN(x)     ((x) != (x))
+#endif
+#endif
+#endif
+
+#ifndef DBL_IS_EQUAL
+/*#define DBL_IS_EQUAL(x,y) (!(x < y || y < x)) */
+#  define DBL_IS_EQUAL(x,y) (DBL_IS_NAN(x)||DBL_IS_NAN(y)?(DBL_IS_NAN(x)&&DBL_IS_NAN(y)?1:0):!(x < y || y < x))
+#endif
+
+#ifndef IS_EQUAL
+#  define IS_NOT_EQUAL(x,y) (x < y || y < x)
+#  define IS_EQUAL(x,y)     (!IS_NOT_EQUAL(x,y))
+#endif
+
+
+#ifndef INT
+#  define  INT(x)  ((int)(x))
+#endif
+
+#ifndef NINT
+#  define  NINT(x)  ((x) < 0 ? (int)((x)-.5) : (int)((x)+.5))
+#endif
+
+#define  FALSE  0
+#define  TRUE   1
+
+#define  TYPE_REC  0
+#define  TYPE_VAR  1
+
+#define  MEMTYPE_DOUBLE  1
+#define  MEMTYPE_FLOAT   2
+
+typedef struct
+{
+  void     *buffer;
+  size_t    buffersize;
+  off_t     position;
+  int       recsize;
+  int       size;
+  int       dataread;
+  int       param;
+  int       level;
+  int       date;
+  int       time;
+  int       gridID;
+  int       zaxisID;
+  int       used;
+  int       nrec;
+  int       varID;
+  int       levelID;
+  int       recid;
+  int       prec;
+  int       sec0[2];
+  int       sec1[1024];
+  int       sec2[4096];
+  int       sec3[2];
+  int       sec4[512];
+#if  defined  (HAVE_LIBSERVICE)
+  srvrec_t   *srvp;
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+  extrec_t   *extp;
+#endif
+#if  defined  (HAVE_LIBIEG)
+  iegrec_t   *iegp;
+#endif
+}
+Record;
+
+
+typedef struct
+{
+  off_t     position;
+  size_t    size;
+  int       zip;
+  int       param;
+  int       ilevel;
+  int       ilevel2;
+  int       ltype;
+  short     used;
+  short     varID;
+  short     levelID;
+}
+record_t;
+
+
+typedef struct {
+  record_t *records;
+  int       recordSize;  /* number of allocated records           */
+  int      *recIDs;      /* IDs of non constant records           */
+  int       nrecs;       /* number of used records                */
+                         /* tsID=0 nallrecs                       */
+                         /* tsID>0 number of non constant records */
+  int       nallrecs;    /* number of all records                 */
+  int       curRecID;    /* current record ID                     */
+  long      next;
+  off_t     position;    /* timestep file position                */
+  taxis_t   taxis;
+}
+tsteps_t;
+
+
+typedef struct {
+  int       ncvarid;
+  int       nlevs;
+  int      *level;       /* record IDs */
+  int      *lindex;      /* level index */
+  int       defmiss;     /* TRUE if missval is defined in file */
+
+  int       isUsed;
+  int       gridID;
+  int       zaxisID;
+  int       tsteptype;   /* TSTEP_* */
+}
+svarinfo_t;
+
+
+typedef struct {
+  int       ilev;
+  int       mlev;
+  int       ilevID;
+  int       mlevID;
+}
+VCT;
+
+
+typedef struct {
+  int         self;
+  int         accesstype;   /* TYPE_REC or TYPE_VAR */
+  int         accessmode;
+  int         filetype;
+  int         byteorder;
+  int         fileID;
+  int         dimgroupID;
+  int         filemode;
+  off_t       numvals;
+  char       *filename;
+  Record     *record;
+  int        nrecs;        /* number of records                  */
+  int         nvars;        /* number of variables                */
+  int         varlocked;    /* variables locked                   */
+  svarinfo_t *vars;
+  int         varsAllocated;
+  int         varinit;
+  int         curTsID;      /* current timestep ID */
+  int         rtsteps;      /* number of tsteps accessed       */
+  long        ntsteps;      /* number of tsteps : only set if all records accessed */
+  int         numTimestep;  /* number of tsteps : only set if all records accessed */
+  tsteps_t   *tsteps;
+  int         tstepsTableSize;
+  int         tstepsNextID;
+  BaseTime    basetime;
+  int         ncmode;
+  int         vlistID;
+  int         xdimID[MAX_GRIDS_PS];
+  int         ydimID[MAX_GRIDS_PS];
+  int         zaxisID[MAX_ZAXES_PS];
+  int         ncxvarID[MAX_GRIDS_PS];
+  int         ncyvarID[MAX_GRIDS_PS];
+  int         ncavarID[MAX_GRIDS_PS];
+  int         historyID;
+  int         globalatts;
+  int         localatts;
+  VCT         vct;
+  int         unreduced;
+  int         sortname;
+  int         have_missval;
+  int         comptype;      // compression type
+  int         complevel;     // compression level
+  int         curfile;
+  int         nfiles;
+  char      **fnames;
+#if defined (GRIBCONTAINER2D)
+  void      **gribContainers;
+#else
+  void       *gribContainers;
+#endif
+  int         vlistIDorig;
+}
+stream_t;
+
+
+extern int CDI_Debug;      /* If set to 1, debuggig (default 0)            */
+extern double cdiDefaultMissval;
+extern int cdiDefaultInstID;
+extern int cdiDefaultModelID;
+extern int cdiDefaultTableID;
+extern int cdiDefaultLeveltype;
+extern int cdiNcMissingValue;
+extern int cdiNcChunksizehint;
+extern int cdiChunkType;
+extern int cdiSplitLtype105;
+
+extern char *cdiPartabPath;
+extern int   cdiPartabIntern;
+
+stream_t *stream_to_pointer(int idx);
+stream_t *stream_new_entry(void);
+void stream_delete_entry(stream_t *streamptr);
+void stream_check_ptr(const char *caller, stream_t *streamptr);
+
+int     streamInqFileID(int streamID);
+
+int     zaxisInqLevelID(int zaxisID, double level);
+char   *gridNamePtr(int gridtype);
+char   *zaxisNamePtr(int leveltype);
+
+void    streamCheckID(const char *caller, int streamID);
+
+void    streamDefineTaxis(int streamID);
+
+int     streamsNewEntry(int filetype);
+void    streamsInitEntry(int streamID);
+int     streamNewVar(int streamID, int gridID, int zaxisID);
+
+int     tstepsNewEntry(int streamID);
+
+char   *strfiletype(int filetype);
+
+void    cdiGenVars(int streamID);
+
+void    cdiCheckContents(int streamID);
+
+void    cdiCreateRecords(int streamID, int tsID);
+
+int     recordNewEntry(int streamID, int tsID);
+
+void    cdiCreateTimesteps(int streamID);
+
+void    recordInitEntry(record_t *record);
+
+void    cdiCheckZaxis(int zaxisID);
+
+void    cdiPrintDatatypes(void);
+
+void    cdiDefAccesstype(int streamID, int type);
+int     cdiInqAccesstype(int streamID);
+
+void    streamDefDimgroupID(int streamID, int dimgroupID);
+int     streamInqDimgroupID(int streamID);
+
+int     getByteswap(int byteorder);
+
+int     streamSize ();
+void    streamGetIndexList ( int, int * );
+
+
+void  cdiInitialize(void);
+
+void stream_write_record(int streamID, int memtype, const void *data, int nmiss);
+
+
+#endif  /* _STREAM_INT_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_record.c b/libcdi/src/stream_record.c
new file mode 100644
index 0000000..46d884d
--- /dev/null
+++ b/libcdi/src/stream_record.c
@@ -0,0 +1,587 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+#include "dmemory.h"
+
+#include "cdi.h"
+#include "cdf_int.h"
+#include "stream_int.h"
+#include "stream_grb.h"
+#include "stream_cdf.h"
+#include "stream_srv.h"
+#include "stream_ext.h"
+#include "stream_ieg.h"
+
+
+void recordInitEntry(record_t *record)
+{
+  (*record).position = CDI_UNDEFID;
+  (*record).size     = 0;
+  (*record).param    = 0;
+  (*record).ilevel   = CDI_UNDEFID;
+  (*record).used     = FALSE;
+  (*record).varID    = CDI_UNDEFID;
+  (*record).levelID  = CDI_UNDEFID;
+}
+
+
+int recordNewEntry(int streamID, int tsID)
+{
+  int recordID = 0;
+  int recordSize;
+  record_t *records;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  recordSize = streamptr->tsteps[tsID].recordSize;
+  records    = streamptr->tsteps[tsID].records;
+  /*
+    Look for a free slot in record.
+    (Create the table the first time through).
+  */
+  if ( ! recordSize )
+    {
+      int i;
+      recordSize = 1;   /*  <<<<----  */
+      records = (record_t *) malloc(recordSize*sizeof(record_t));
+      if ( records == NULL )
+	{
+          Message("recordSize = %d", recordSize);
+	  SysError("Allocation of record_tTABLE failed");
+	}
+
+      for ( i = 0; i < recordSize; i++ )
+	records[i].used = CDI_UNDEFID;
+    }
+  else
+    {
+      while ( recordID < recordSize )
+	{
+	  if ( records[recordID].used == CDI_UNDEFID ) break;
+	  recordID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if ( recordID == recordSize )
+    {
+      int i;
+
+      recordSize = 2*recordSize;
+      records    = (record_t *) realloc(records, recordSize*sizeof(record_t));
+      if ( records == NULL )
+	{
+          Message("recordSize = %d", recordSize);
+	  SysError("Reallocation of record_tTABLE failed");
+	}
+      recordID = recordSize/2;
+
+      for ( i = recordID; i < recordSize; i++ )
+	records[i].used = CDI_UNDEFID;
+    }
+
+
+  recordInitEntry(&records[recordID]);
+
+  records[recordID].used = 1;
+
+  streamptr->tsteps[tsID].recordSize = recordSize;
+  streamptr->tsteps[tsID].records    = records;
+
+  return (recordID);
+}
+
+
+void cdiInitRecord(int streamID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  streamptr->record = (Record *) malloc(sizeof(Record));
+
+  streamptr->record->used       = 0;
+  streamptr->record->nrec       = 0;
+  streamptr->record->dataread   = 1;
+  streamptr->record->param      = 0;
+  streamptr->record->level      = 0;
+  streamptr->record->date       = 0;
+  streamptr->record->time       = 0;
+  streamptr->record->gridID     = 0;
+  streamptr->record->zaxisID    = 0;
+  streamptr->record->buffer     = NULL;
+  streamptr->record->buffersize = 0;
+  streamptr->record->position   = 0;
+  streamptr->record->varID      = 0;
+  streamptr->record->levelID    = CDI_UNDEFID;
+  streamptr->record->recid      = 0;
+}
+
+
+void streamInqRecord(int streamID, int *varID, int *levelID)
+{
+  /* int rec = 0; */
+  int recID, tsID, rindex;
+  int lindex;
+  stream_t *streamptr;
+
+  check_parg(varID);
+  check_parg(levelID);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  cdiDefAccesstype(streamID, TYPE_REC);
+
+  if ( ! streamptr->record ) cdiInitRecord(streamID);
+
+  tsID   = streamptr->curTsID;
+  rindex = streamptr->tsteps[tsID].curRecID + 1;
+
+  if ( rindex >= streamptr->tsteps[tsID].nrecs )
+    Error("record %d not available at timestep %d", rindex+1, tsID+1);
+
+  recID  = streamptr->tsteps[tsID].recIDs[rindex];
+
+  if ( recID == -1 || recID >= streamptr->tsteps[tsID].nallrecs )
+    Error("Internal problem! tsID = %d recID = %d", tsID, recID);
+
+  *varID   = streamptr->tsteps[tsID].records[recID].varID;
+  lindex   = streamptr->tsteps[tsID].records[recID].levelID;
+
+  *levelID = streamptr->vars[*varID].lindex[lindex];
+
+  if ( CDI_Debug )
+    Message("tsID = %d, recID = %d, varID = %d, levelID = %d\n",
+	    tsID, recID, *varID, *levelID);
+
+  streamptr->curTsID = tsID;
+  streamptr->tsteps[tsID].curRecID = rindex;
+
+  /*
+  rec = recID + 1;
+  filetype = streamptr->filetype;
+
+  switch ( filetype )
+    {
+    case FILETYPE_GRB:
+      {
+        rec = grbInqRecord(streamID, varID, levelID);
+	break;
+      }
+    case FILETYPE_SRV:
+      {
+        rec = srvInqRecord(streamID, varID, levelID);
+	break;
+      }
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	rec = cdfInqRecord(streamID, varID, levelID);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+  */
+}
+
+
+void streamDefRecord(int streamID, int varID, int levelID)
+{
+  int status = 0;
+  int filetype;
+  int param, gridID, zaxisID, level;
+  int tsID;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  tsID = streamptr->curTsID;
+
+  if ( tsID == CDI_UNDEFID )
+    {
+      tsID++;
+      streamDefTimestep(streamID, tsID);
+    }
+
+  if ( ! streamptr->record ) cdiInitRecord(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  zaxisID = vlistInqVarZaxis(vlistID, varID);
+  param   = vlistInqVarParam(vlistID, varID);
+  level   = (int) zaxisInqLevel(zaxisID, levelID);
+
+  streamptr->record->varID    = varID;
+  streamptr->record->levelID  = levelID;
+  streamptr->record->param    = param;
+  streamptr->record->level    = level;
+  streamptr->record->date     = streamptr->tsteps[tsID].taxis.vdate;
+  streamptr->record->time     = streamptr->tsteps[tsID].taxis.vtime;
+  streamptr->record->gridID   = gridID;
+  streamptr->record->zaxisID  = zaxisID;
+  streamptr->record->prec     = vlistInqVarDatatype(vlistID, varID);
+
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        status = grbDefRecord(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        status = srvDefRecord(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        status = extDefRecord(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        status = iegDefRecord(streamID);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	if ( streamptr->accessmode == 0 ) cdfEndDef(streamID);
+	status = cdfDefRecord(streamID);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+
+void streamReadRecord(int streamID, double *data, int *nmiss)
+{
+  int status = 0;
+  int filetype;
+  stream_t *streamptr;
+
+  check_parg(data);
+  check_parg(nmiss);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  *nmiss = 0;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        status = grbReadRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        status = srvReadRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        status = extReadRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        status = iegReadRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	status = cdfReadRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+
+void stream_write_record(int streamID, int memtype, const void *data, int nmiss)
+{
+  int status = 0;
+  int filetype;
+  stream_t *streamptr;
+
+  check_parg(data);
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  filetype = streamptr->filetype;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("grbWriteRecord not implemented for memtype float!");
+        status = grbWriteRecord(streamID, data, nmiss);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("srvWriteRecord not implemented for memtype float!");
+        status = srvWriteRecord(streamID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("extWriteRecord not implemented for memtype float!");
+        status = extWriteRecord(streamID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+        if ( memtype == MEMTYPE_FLOAT ) Error("iegWriteRecord not implemented for memtype float!");
+        status = iegWriteRecord(streamID, data);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBNETCDF)
+    case FILETYPE_NC:
+    case FILETYPE_NC2:
+    case FILETYPE_NC4:
+    case FILETYPE_NC4C:
+      {
+	cdf_write_record(streamID, memtype, data, nmiss);
+	break;
+      }
+#endif
+    default:
+      {
+	Error("%s support not compiled in!", strfiletype(filetype));
+	break;
+      }
+    }
+}
+
+
+void streamWriteRecord(int streamID, const double *data, int nmiss)
+{
+  stream_write_record(streamID, MEMTYPE_DOUBLE, (const void *) data, nmiss);
+}
+
+void streamWriteRecordF(int streamID, const float *data, int nmiss)
+{
+  stream_write_record(streamID, MEMTYPE_FLOAT, (const void *) data, nmiss);
+}
+
+
+void streamCopyRecord(int streamID2, int streamID1)
+{
+  int status = 0;
+  int filetype = CDI_UNDEFID, filetype1, filetype2;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  filetype1 = streamptr1->filetype;
+  filetype2 = streamptr2->filetype;
+
+  if ( filetype1 == filetype2 ) filetype = filetype2;
+
+  switch (filetype)
+    {
+#if  defined  (HAVE_LIBGRIB)
+    case FILETYPE_GRB:
+    case FILETYPE_GRB2:
+      {
+	status = grbCopyRecord(streamID2, streamID1);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBSERVICE)
+    case FILETYPE_SRV:
+      {
+	status = srvCopyRecord(streamID2, streamID1);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBEXTRA)
+    case FILETYPE_EXT:
+      {
+	status = extCopyRecord(streamID2, streamID1);
+	break;
+      }
+#endif
+#if  defined  (HAVE_LIBIEG)
+    case FILETYPE_IEG:
+      {
+	status = iegCopyRecord(streamID2, streamID1);
+	break;
+      }
+#endif
+    default:
+      {
+	status = cdfCopyRecord(streamID2, streamID1);
+	break;
+      }
+    }
+}
+
+
+void cdiCreateRecords(int streamID, int tsID)
+{
+  int nrecords, maxrecords;
+  int nvars, varID, recID;
+  record_t *records;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( streamptr->tsteps[tsID].records ) return;
+
+  vlistID  = streamInqVlist(streamID);
+
+  if ( tsID == 0 )
+    {
+      maxrecords = 0;
+      nvars = streamptr->nvars;
+      for ( varID = 0; varID < nvars; varID++)
+	maxrecords += streamptr->vars[varID].nlevs;
+    }
+  else
+    maxrecords = streamptr->tsteps[0].recordSize;
+
+  if ( tsID == 0 )
+    {
+      nrecords = maxrecords;
+    }
+  else if ( tsID == 1 )
+    {
+      nrecords = 0;
+      maxrecords = streamptr->tsteps[0].recordSize;
+      for ( recID = 0; recID < maxrecords; recID++ )
+	{
+	  varID = streamptr->tsteps[0].records[recID].varID;
+	  if ( varID != -1 ) /* varID = -1 for write mode !!! */
+	    if ( vlistInqVarTsteptype(vlistID, varID) == TSTEP_CONSTANT )
+	      continue;
+	  nrecords++;
+	}
+    }
+  else
+    nrecords = streamptr->tsteps[1].nallrecs;
+
+  if ( maxrecords > 0 )
+    records = (record_t *) malloc(maxrecords*sizeof(record_t));
+  else
+    records = NULL;
+
+  streamptr->tsteps[tsID].records    = records;
+  streamptr->tsteps[tsID].recordSize = maxrecords;
+  streamptr->tsteps[tsID].nallrecs   = nrecords;
+
+  if ( tsID == 0 )
+    {
+      for ( recID = 0; recID < maxrecords; recID++ )
+	recordInitEntry(&streamptr->tsteps[tsID].records[recID]);
+    }
+  else
+    {
+      memcpy(streamptr->tsteps[tsID].records,
+	     streamptr->tsteps[0].records,
+	     maxrecords*sizeof(record_t));
+
+      for ( recID = 0; recID < maxrecords; recID++ )
+	{
+	  varID = streamptr->tsteps[0].records[recID].varID;
+	  if ( varID != -1 ) /* varID = -1 for write mode !!! */
+	    if ( vlistInqVarTsteptype(vlistID, varID) != TSTEP_CONSTANT )
+	      {
+		streamptr->tsteps[tsID].records[recID].position = CDI_UNDEFID;
+		streamptr->tsteps[tsID].records[recID].size     = 0;
+		streamptr->tsteps[tsID].records[recID].used     = FALSE;
+	      }
+	}
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_srv.c b/libcdi/src/stream_srv.c
new file mode 100644
index 0000000..1367c33
--- /dev/null
+++ b/libcdi/src/stream_srv.c
@@ -0,0 +1,1089 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+
+#include "dmemory.h"
+
+#include "error.h"
+#include "file.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "varscan.h"
+#include "datetime.h"
+#include "service.h"
+#include "vlist.h"
+
+
+#undef  UNDEFID
+#define UNDEFID  CDI_UNDEFID
+
+#define SINGLE_PRECISION  4
+#define DOUBLE_PRECISION  8
+
+#if defined (HAVE_LIBSERVICE)
+
+
+typedef struct {
+  int param;
+  int level;
+} SRVCOMPVAR; 
+
+
+int srvInqDatatype(int prec)
+{
+  int datatype;
+
+  if ( prec == DOUBLE_PRECISION ) datatype = DATATYPE_FLT64;
+  else                            datatype = DATATYPE_FLT32;
+
+  return (datatype);
+}
+
+
+int srvDefDatatype(int datatype)
+{
+  int prec;
+
+  if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    Error("CDI/SERVICE library does not support complex numbers!");
+
+  if ( datatype != DATATYPE_FLT32 && datatype != DATATYPE_FLT64 )
+    datatype = DATATYPE_FLT32;
+
+  if ( datatype == DATATYPE_FLT64 ) prec = DOUBLE_PRECISION;
+  else                              prec = SINGLE_PRECISION;
+
+  return (prec);
+}
+
+/* not used
+int srvInqRecord(int streamID, int *varID, int *levelID)
+{
+  int status;
+  int fileID;
+  int icode, ilevel;
+  int zaxisID = -1;
+  int header[8];
+  int vlistID;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  srvp    = streamptr->record->srvp;
+
+  *varID   = -1;
+  *levelID = -1;
+
+  status = srvRead(fileID, srvp);
+  if ( status != 0 ) return (0);
+
+  srvInqHeader(srvp, header);
+
+  icode  = header[0];
+  ilevel = header[1];
+
+  *varID = vlistInqVarID(vlistID, icode);
+
+  if ( *varID == UNDEFID ) Error("Code %d undefined", icode);
+
+  zaxisID = vlistInqVarZaxis(vlistID, *varID);
+
+  *levelID = zaxisInqLevelID(zaxisID, (double) ilevel);
+  
+  return (1);
+}
+*/
+
+int srvReadRecord(int streamID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int status;
+  int recID, vrecID, tsID;
+  off_t recpos;
+  int header[8];
+  int varID, gridID;
+  int i, size;
+  double missval;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  tsID    = streamptr->curTsID;
+  vrecID  = streamptr->tsteps[tsID].curRecID;
+  recID   = streamptr->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr->tsteps[tsID].records[recID].position;
+  varID   = streamptr->tsteps[tsID].records[recID].varID;
+  srvp    = streamptr->record->srvp;
+
+  fileSetPos(fileID, recpos, SEEK_SET);
+
+  status = srvRead(fileID, srvp);
+  if ( status != 0 ) return (0);
+
+  srvInqHeader(srvp, header);
+  srvInqDataDP(srvp, data);
+
+  missval = vlistInqVarMissval(vlistID, varID);
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  size    = gridInqSize(gridID);
+
+  streamptr->numvals += size;
+
+  *nmiss = 0;
+  for ( i = 0; i < size; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+
+  return (1);
+}
+
+
+int srvCopyRecord(int streamID2, int streamID1)
+{
+  int fileID1, fileID2;
+  int tsID, recID, vrecID;
+  long recsize;
+  off_t recpos;
+  int status = 0;
+  char *buffer;
+  stream_t *streamptr1;
+  stream_t *streamptr2;
+
+  streamptr1 = stream_to_pointer(streamID1);
+  streamptr2 = stream_to_pointer(streamID2);
+
+  stream_check_ptr(__func__, streamptr1);
+  stream_check_ptr(__func__, streamptr2);
+
+  fileID1 = streamInqFileID(streamID1);
+  fileID2 = streamInqFileID(streamID2);
+
+  tsID    = streamptr1->curTsID;
+  vrecID  = streamptr1->tsteps[tsID].curRecID;
+  recID   = streamptr1->tsteps[tsID].recIDs[vrecID];
+  recpos  = streamptr1->tsteps[tsID].records[recID].position;
+  recsize = streamptr1->tsteps[tsID].records[recID].size;
+
+  fileSetPos(fileID1, recpos, SEEK_SET);
+
+  buffer = (char *) malloc(recsize);
+
+  fileRead(fileID1, buffer, recsize);
+
+  fileWrite(fileID2, buffer, recsize);
+
+  free(buffer);
+
+  return (status);
+}
+
+
+int srvDefRecord(int streamID)
+{
+  int gridID;
+  int header[8];
+  int status = 0;
+  int xsize, ysize;
+  int datatype;
+  int pdis, pcat, pnum;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  gridID = streamptr->record->gridID;
+  srvp   = streamptr->record->srvp;
+
+  cdiDecodeParam(streamptr->record->param, &pnum, &pcat, &pdis);
+  header[0] = pnum;
+  header[1] = streamptr->record->level;
+  header[2] = streamptr->record->date;
+  header[3] = streamptr->record->time;
+
+  xsize = gridInqXsize(gridID);
+  ysize = gridInqYsize(gridID);
+  if ( xsize == 0 || ysize == 0 )
+    {
+      xsize = gridInqSize(gridID);
+      ysize = 1;
+    }
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED ) ysize = 1;
+  if ( gridInqSize(gridID) != xsize*ysize )
+    Error("Internal problem with gridsize!");
+
+  header[4] = xsize;
+  header[5] = ysize;
+  header[6] = 0;
+  header[7] = 0;
+
+  datatype = streamptr->record->prec;
+
+  srvp->dprec = srvDefDatatype(datatype);
+
+  srvDefHeader(srvp, header);
+
+  return (status);
+}
+
+
+int srvWriteRecord(int streamID, const double *data)
+{
+  int fileID;
+  int status = 0;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+  srvp   = streamptr->record->srvp;
+
+  srvDefDataDP(srvp, data);
+
+  srvWrite(fileID, srvp);
+
+  return (status);
+}
+
+
+void srvAddRecord(int streamID, int param, int level, int xsize, int ysize,
+		  long recsize, off_t position, int prec)
+{
+  int leveltype;
+  int gridID = UNDEFID;
+  int levelID = 0;
+  int tsID, recID, varID;
+  int datatype;
+  record_t *record;
+  grid_t grid;
+  int vlistID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID = streamInqVlist(streamID);
+  tsID    = streamptr->curTsID;
+  recID   = recordNewEntry(streamID, tsID);
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  (*record).size     = recsize;
+  (*record).position = position;
+  (*record).param    = param;
+  (*record).ilevel   = level;
+
+  memset(&grid, 0, sizeof(grid_t));
+  grid.type  = GRID_GENERIC; 
+  grid.size  = xsize*ysize;
+  grid.xsize = xsize;
+  grid.ysize = ysize;
+  grid.xvals = NULL;
+  grid.yvals = NULL;
+  gridID = varDefGrid(vlistID, grid, 0);
+  /*
+  if ( level == 0 ) leveltype = ZAXIS_SURFACE;
+  else              leveltype = ZAXIS_GENERIC;
+  */
+  leveltype = ZAXIS_GENERIC;
+
+  datatype = srvInqDatatype(prec);
+
+  varAddRecord(recID, param, gridID, leveltype, 0, level, 0,
+	       datatype, &varID, &levelID, UNDEFID, 0, 0, NULL, NULL, NULL);
+
+  (*record).varID   = varID;
+  (*record).levelID = levelID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+
+  if ( CDI_Debug )
+    Message("varID = %d gridID = %d levelID = %d",
+	    varID, gridID, levelID);
+}
+
+
+void srvCmpRecord(int streamID, int tsID, int recID, off_t position, int param,
+		  int level, int xsize, int ysize)
+{
+  int varID = 0;
+  int levelID = 0;
+  record_t *record;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  record  = &streamptr->tsteps[tsID].records[recID];
+
+  if ( param != (*record).param || level != (*record).ilevel )
+    Error("inconsistent timestep");
+
+  (*record).position = position;
+  /*
+  varID   = (*record).varID;
+  levelID = (*record).levelID;
+
+  streamptr->vars[varID].level[levelID] = recID;
+
+  streamptr->tsteps[tsID].nallrecs++;
+  streamptr->nrecs++;
+  */
+  if ( CDI_Debug )
+    Message("varID = %d levelID = %d", varID, levelID);
+}
+
+static
+void srvScanTimestep1(int streamID)
+{  
+  int header[8];
+  int prec = 0;
+  int status;
+  int fileID;
+  int rxsize = 0, rysize = 0;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  DateTime datetime, datetime0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos;
+  int nrecords, nrecs, recID;
+  int taxisID = -1;
+  taxis_t *taxis;
+  int vlistID;
+  SRVCOMPVAR compVar, compVar0;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 0;
+
+  srvp  = streamptr->record->srvp;
+  tsID  = tstepsNewEntry(streamID);
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( tsID != 0 )
+    Error("Internal problem! tstepsNewEntry returns %d", tsID);
+
+  fileID = streamInqFileID(streamID);
+
+  nrecs = 0;
+  while ( TRUE )
+    {
+      recpos = fileGetPos(fileID);
+      status = srvRead(fileID, srvp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 1;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      srvInqHeader(srvp, header);
+
+      prec   = srvp->dprec;
+      rcode  = header[0];
+      rlevel = header[1];
+      vdate  = header[2];
+      vtime  = header[3];
+      rxsize = header[4];
+      rysize = header[5];
+
+      param = cdiEncodeParam(rcode, 255, 255);
+
+      if ( nrecs == 0 )
+	{
+	  datetime0.date = vdate;
+	  datetime0.time = vtime;
+	}
+      else
+	{
+	  datetime.date = vdate;
+	  datetime.time = vtime;
+	  compVar.param = param;
+          compVar.level = rlevel;
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      compVar0.param = streamptr->tsteps[0].records[recID].param;
+	      compVar0.level = streamptr->tsteps[0].records[recID].ilevel;
+
+	      if ( memcmp(&compVar0, &compVar, sizeof(SRVCOMPVAR)) == 0 ) break;
+	    }
+	  if ( recID < nrecs ) break;
+	  if ( memcmp(&datetime, &datetime0, sizeof(DateTime)) )
+	    Warning("Inconsistent verification time for code %d level %d", rcode, rlevel);
+	}
+
+      nrecs++;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", nrecs, (int)recpos, rcode, rlevel, vdate, vtime);
+
+      srvAddRecord(streamID, param, rlevel, rxsize, rysize, recsize, recpos, prec);
+    }
+
+  streamptr->rtsteps = 1;
+
+  cdiGenVars(streamID);
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+  taxis->type  = TAXIS_ABSOLUTE;
+  taxis->vdate = datetime0.date;
+  taxis->vtime = datetime0.time;
+
+  vlistID = streamInqVlist(streamID);
+  vlistDefTaxis(vlistID, taxisID);
+
+  cdiCheckContents(streamID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  if ( nrecords < streamptr->tsteps[0].recordSize )
+    {
+      streamptr->tsteps[0].recordSize = nrecords;
+      streamptr->tsteps[0].records =
+	(record_t *) realloc(streamptr->tsteps[0].records, nrecords*sizeof(record_t));
+    }
+
+  streamptr->tsteps[0].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[0].nrecs = nrecords;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[0].recIDs[recID] = recID;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( streamptr->ntsteps == 1 )
+    {
+      if ( taxis->vdate == 0 && taxis->vtime == 0 )
+	{
+	  streamptr->ntsteps = 0;
+	  for ( varID = 0; varID < streamptr->nvars; varID++ )
+	    {
+	      vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	    }
+	}
+    }
+}
+
+static
+int srvScanTimestep2(int streamID)
+{  
+  int header[8];
+  int status;
+  int fileID;
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  int tsID;
+  int varID;
+  long recsize;
+  off_t recpos = 0;
+  int nrecords, nrecs, recID, rindex;
+  int nextstep;
+  taxis_t *taxis;
+  int vlistID;
+  SRVCOMPVAR compVar, compVar0;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  streamptr->curTsID = 1;
+
+  vlistID = streamInqVlist(streamID);
+  fileID  = streamInqFileID(streamID);
+  srvp    = streamptr->record->srvp;
+
+  tsID = streamptr->rtsteps;
+  if ( tsID != 1 )
+    Error("Internal problem! unexpeceted timestep %d", tsID+1);
+
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+  cdiCreateRecords(streamID, tsID);
+
+  nrecords = streamptr->tsteps[0].nallrecs;
+  streamptr->tsteps[1].recIDs = (int *) malloc(nrecords*sizeof(int));
+  streamptr->tsteps[1].nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    streamptr->tsteps[1].recIDs[recID] = -1;
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID = streamptr->tsteps[0].records[recID].varID;
+      streamptr->tsteps[tsID].records[recID].position = 
+	streamptr->tsteps[0].records[recID].position;
+      streamptr->tsteps[tsID].records[recID].size     = 
+	streamptr->tsteps[0].records[recID].size;
+    }
+
+  for ( rindex = 0; rindex <= nrecords; rindex++ )
+    {
+      recpos = fileGetPos(fileID);
+      status = srvRead(fileID, srvp);
+      if ( status != 0 )
+	{
+	  streamptr->ntsteps = 2;
+	  break;
+	}
+      recsize = fileGetPos(fileID) - recpos;
+
+      srvInqHeader(srvp, header);
+
+      rcode  = header[0];
+      rlevel = header[1];
+      vdate  = header[2];
+      vtime  = header[3];
+
+      param = cdiEncodeParam(rcode, 255, 255);
+
+      if ( rindex == 0 )
+	{
+	  taxis->type  = TAXIS_ABSOLUTE;
+	  taxis->vdate = vdate;
+	  taxis->vtime = vtime;
+	}
+
+      compVar.param = param;
+      compVar.level = rlevel;
+      nextstep = FALSE;
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(SRVCOMPVAR)) == 0 )
+	    {
+	      if ( streamptr->tsteps[tsID].records[recID].used )
+		{
+		  nextstep = TRUE;
+		}
+	      else
+		{
+		  streamptr->tsteps[tsID].records[recID].used = TRUE;
+		  streamptr->tsteps[tsID].recIDs[rindex] = recID;
+		}
+	      break;
+	    }
+	}
+      if ( recID == nrecords )
+	{
+	  Warning("Code %d level %d not found at timestep %d", rcode, rlevel, tsID+1);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      if ( nextstep ) break;
+
+      if ( CDI_Debug )
+	Message("%4d%8d%4d%8d%8d%6d", rindex+1, (int)recpos, rcode, rlevel, vdate, vtime);
+
+      streamptr->tsteps[tsID].records[recID].size = recsize;
+
+      compVar0.param  = streamptr->tsteps[tsID].records[recID].param;
+      compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+      if ( memcmp(&compVar0, &compVar, sizeof(SRVCOMPVAR)) != 0 )
+	{
+	  Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		  tsID, recID,
+		  streamptr->tsteps[tsID].records[recID].param, param,
+		  streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	  return (CDI_EUFSTRUCT);
+	}
+
+      streamptr->tsteps[1].records[recID].position = recpos;
+    }
+
+  nrecs = 0;
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      if ( ! streamptr->tsteps[tsID].records[recID].used )
+	{
+	  varID = streamptr->tsteps[tsID].records[recID].varID;
+          vlistDefVarTsteptype(vlistID, varID, TSTEP_CONSTANT);
+	}
+      else
+	{
+	  nrecs++;
+	}
+    }
+  streamptr->tsteps[tsID].nrecs = nrecs;
+
+  streamptr->rtsteps = 2;
+
+  if ( streamptr->ntsteps == -1 )
+    {
+      tsID = tstepsNewEntry(streamID);
+      if ( tsID != streamptr->rtsteps )
+	Error("Internal error. tsID = %d", tsID);
+
+      streamptr->tsteps[tsID-1].next   = TRUE;
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  return (0);
+}
+
+
+int srvInqContents(int streamID)
+{
+  int fileID;
+  int status = 0;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  fileID = streamInqFileID(streamID);
+
+  streamptr->curTsID = 0;
+
+  srvScanTimestep1(streamID);
+ 
+  if ( streamptr->ntsteps == -1 ) status = srvScanTimestep2(streamID);
+
+  fileSetPos(fileID, 0, SEEK_SET);
+
+  return (status);
+}
+
+static
+int srvScanTimestep(int streamID)
+{
+  int header[8];
+  int status;
+  int fileID;
+  int tsID;
+  /* int rxsize = 0, rysize = 0; */
+  int param = 0;
+  int rcode = 0, rlevel = 0, vdate = 0, vtime = 0;
+  long recsize = 0;
+  off_t recpos = 0;
+  int recID;
+  taxis_t *taxis;
+  int rindex, nrecs = 0;
+  SRVCOMPVAR compVar, compVar0;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( CDI_Debug )
+    {
+      Message("streamID = %d", streamID);
+      Message("cts = %d", streamptr->curTsID);
+      Message("rts = %d", streamptr->rtsteps);
+      Message("nts = %d", streamptr->ntsteps);
+    }
+
+  if ( streamptr->rtsteps == 0 )
+    Error("Internal problem! Missing contents.");
+
+  srvp  = streamptr->record->srvp;
+  tsID  = streamptr->rtsteps;
+  taxis = &streamptr->tsteps[tsID].taxis;
+
+  if ( streamptr->tsteps[tsID].recordSize == 0 )
+    {
+      cdiCreateRecords(streamID, tsID);
+
+      nrecs = streamptr->tsteps[1].nrecs;
+
+      streamptr->tsteps[tsID].nrecs = nrecs;
+      streamptr->tsteps[tsID].recIDs = (int *) malloc(nrecs*sizeof(int));
+      for ( recID = 0; recID < nrecs; recID++ )
+	streamptr->tsteps[tsID].recIDs[recID] = streamptr->tsteps[1].recIDs[recID];
+
+      fileID = streamInqFileID(streamID);
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+
+      for ( rindex = 0; rindex <= nrecs; rindex++ )
+	{
+	  recpos = fileGetPos(fileID);
+	  status = srvRead(fileID, srvp);
+	  if ( status != 0 )
+	    {
+	      streamptr->ntsteps = streamptr->rtsteps + 1;
+	      break;
+	    }
+	  recsize = fileGetPos(fileID) - recpos;
+
+	  srvInqHeader(srvp, header);
+
+	  rcode  = header[0];
+	  rlevel = header[1];
+	  vdate  = header[2];
+	  vtime  = header[3];
+          /* rxsize = header[4]; */
+          /* rysize = header[5]; */
+
+	  param = cdiEncodeParam(rcode, 255, 255);
+
+	  // if ( rindex == nrecs ) break; gcc-4.5 internal compiler error
+	  if ( rindex == nrecs ) continue;
+	  recID = streamptr->tsteps[tsID].recIDs[rindex];
+
+	  if ( rindex == 0 )
+	    {
+	      taxis->type  = TAXIS_ABSOLUTE;
+	      taxis->vdate = vdate;
+	      taxis->vtime = vtime;
+	    }
+	  /*
+	  srvCmpRecord(streamID, tsID, nrecs, recpos, param, rlevel, rxsize, rysize);
+	  */
+	  compVar.param  = param;
+          compVar.level  = rlevel;
+	  compVar0.param = streamptr->tsteps[tsID].records[recID].param;
+	  compVar0.level = streamptr->tsteps[tsID].records[recID].ilevel;
+
+	  if ( memcmp(&compVar0, &compVar, sizeof(SRVCOMPVAR)) != 0 )
+	    {
+	      Message("tsID = %d recID = %d param = %3d new %3d  level = %3d new %3d",
+		      tsID, recID,
+		      streamptr->tsteps[tsID].records[recID].param, param,
+		      streamptr->tsteps[tsID].records[recID].ilevel, rlevel);
+	      Error("Invalid, unsupported or inconsistent record structure");
+	    }
+
+	  streamptr->tsteps[tsID].records[recID].position = recpos;
+	  streamptr->tsteps[tsID].records[recID].size = recsize;
+
+	  if ( CDI_Debug )
+	    Message("%4d%8d%4d%8d%8d%6d", rindex, (int)recpos, rcode, rlevel, vdate, vtime);
+	}
+
+      streamptr->rtsteps++;
+
+      if ( streamptr->ntsteps != streamptr->rtsteps )
+	{
+	  tsID = tstepsNewEntry(streamID);
+	  if ( tsID != streamptr->rtsteps )
+	    Error("Internal error. tsID = %d", tsID);
+
+	  streamptr->tsteps[tsID-1].next   = 1;
+	  streamptr->tsteps[tsID].position = recpos;
+	}
+
+      fileSetPos(fileID, streamptr->tsteps[tsID].position, SEEK_SET);
+      streamptr->tsteps[tsID].position = recpos;
+    }
+
+  if ( nrecs > 0 && nrecs < streamptr->tsteps[tsID].nrecs )
+    {
+      Warning("Incomplete timestep. Stop scanning at timestep %d.", tsID);
+      streamptr->ntsteps = tsID;
+    }
+
+  return (streamptr->ntsteps);
+}
+
+
+int srvInqTimestep(int streamID, int tsID)
+{
+  int ntsteps, nrecs;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  stream_check_ptr(__func__, streamptr);
+
+  if ( tsID == 0 && streamptr->rtsteps == 0 )
+    Error("Call to cdiInqContents missing!");
+
+  if ( CDI_Debug )
+    Message("tsID = %d rtsteps = %d", tsID, streamptr->rtsteps);
+  
+  ntsteps = UNDEFID;
+  while ( ( tsID + 1 ) > streamptr->rtsteps && ntsteps == UNDEFID )
+    ntsteps = srvScanTimestep(streamID);
+
+  if ( tsID >= streamptr->ntsteps && streamptr->ntsteps != CDI_UNDEFID )
+    {
+      nrecs = 0;
+    }
+  else
+    {
+      streamptr->curTsID = tsID;
+      nrecs = streamptr->tsteps[tsID].nrecs;
+    }
+
+  return (nrecs);
+}
+
+
+void srvReadVarDP(int streamID, int varID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int levID, nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int header[8];
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  srvp     = streamptr->record->srvp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  for (levID = 0; levID < nlevs; levID++)
+    {
+      recID = streamptr->vars[varID].level[levID];
+      recpos = streamptr->tsteps[tsid].records[recID].position;
+      fileSetPos(fileID, recpos, SEEK_SET);
+      srvRead(fileID, srvp);
+      srvInqHeader(srvp, header);
+      srvInqDataDP(srvp, &data[levID*gridsize]);
+    }
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  for ( i = 0; i < nlevs*gridsize; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+}
+
+
+void srvReadVarSliceDP(int streamID, int varID, int levID, double *data, int *nmiss)
+{
+  int vlistID, fileID;
+  int nlevs, gridID, gridsize;
+  off_t recpos, currentfilepos;
+  int header[8];
+  int tsid;
+  int recID;
+  int i;
+  double missval;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  srvp     = streamptr->record->srvp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  nlevs    = streamptr->vars[varID].nlevs;
+  missval  = vlistInqVarMissval(vlistID, varID);
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  tsid     = streamptr->curTsID;
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d",
+	     nlevs, gridID, gridsize);
+
+  currentfilepos = fileGetPos(fileID);
+
+  recID = streamptr->vars[varID].level[levID];
+  recpos = streamptr->tsteps[tsid].records[recID].position;
+  fileSetPos(fileID, recpos, SEEK_SET);
+  srvRead(fileID, srvp);
+  srvInqHeader(srvp, header);
+  srvInqDataDP(srvp, data);
+
+  fileSetPos(fileID, currentfilepos, SEEK_SET);
+
+  *nmiss = 0;
+  for ( i = 0; i < gridsize; i++ )
+    if ( DBL_IS_EQUAL(data[i], missval) || DBL_IS_EQUAL(data[i], (float)missval) )
+      {
+	data[i] = missval;
+	(*nmiss)++;
+      }
+}
+
+
+void srvWriteVarDP(int streamID, int varID, const double *data)
+{
+  int fileID;
+  int levID, nlevs, gridID, gridsize;
+  int zaxisID;
+  double level;
+  int header[8];
+  int xsize, ysize;
+  int datatype;
+  int tsID;
+  int vlistID;
+  int pdis, pcat, pnum;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("streamID = %d  varID = %d", streamID, varID);
+
+  srvp     = streamptr->record->srvp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  gridsize = gridInqSize(gridID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  nlevs    = zaxisInqSize(zaxisID);
+
+  if ( CDI_Debug )
+    Message("nlevs = %d gridID = %d gridsize = %d", nlevs, gridID, gridsize);
+
+  cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
+
+  header[0] = pnum;
+  header[2] = streamptr->tsteps[tsID].taxis.vdate;
+  header[3] = streamptr->tsteps[tsID].taxis.vtime;
+
+  xsize = gridInqXsize(gridID);
+  ysize = gridInqYsize(gridID);
+  if ( xsize == 0 || ysize == 0 )
+    {
+      xsize = gridInqSize(gridID);
+      ysize = 1;
+    }
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED ) ysize = 1;
+  if ( gridInqSize(gridID) != xsize*ysize )
+    Error("Internal problem with gridsize!");
+
+  header[4] = xsize;
+  header[5] = ysize;
+  header[6] = 0;
+  header[7] = 0;
+
+  datatype = vlistInqVarDatatype(vlistID, varID);
+
+  srvp->dprec = srvDefDatatype(datatype);
+
+  for ( levID = 0; levID < nlevs; levID++ )
+    {
+      level = zaxisInqLevel(zaxisID, levID);
+
+      header[1] = (int) level;
+      srvDefHeader(srvp, header);
+      srvDefDataDP(srvp, &data[levID*gridsize]);
+      srvWrite(fileID, srvp);
+    }
+}
+
+
+void srvWriteVarSliceDP(int streamID, int varID, int levID, const double *data)
+{
+  int fileID;
+  int gridID;
+  int zaxisID;
+  double level;
+  int header[8];
+  int xsize, ysize;
+  int datatype;
+  int tsID;
+  int vlistID;
+  int pdis, pcat, pnum;
+  srvrec_t *srvp;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  srvp     = streamptr->record->srvp;
+  vlistID  = streamInqVlist(streamID);
+  fileID   = streamInqFileID(streamID);
+  tsID     = streamptr->curTsID;
+  gridID   = vlistInqVarGrid(vlistID, varID);
+  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+  level    = zaxisInqLevel(zaxisID, levID);
+
+  if ( CDI_Debug )
+    Message("gridID = %d zaxisID = %d", gridID, zaxisID);
+
+  cdiDecodeParam(vlistInqVarParam(vlistID, varID), &pnum, &pcat, &pdis);
+
+  header[0] = pnum;
+  header[1] = (int) level;
+  header[2] = streamptr->tsteps[tsID].taxis.vdate;
+  header[3] = streamptr->tsteps[tsID].taxis.vtime;
+
+  xsize = gridInqXsize(gridID);
+  ysize = gridInqYsize(gridID);
+  if ( xsize == 0 || ysize == 0 )
+    {
+      xsize = gridInqSize(gridID);
+      ysize = 1;
+    }
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED ) ysize = 1;
+  if ( gridInqSize(gridID) != xsize*ysize )
+    Error("Internal problem with gridsize!");
+
+  header[4] = xsize;
+  header[5] = ysize;
+  header[6] = 0;
+  header[7] = 0;
+
+  datatype = vlistInqVarDatatype(vlistID, varID);
+
+  srvp->dprec = srvDefDatatype(datatype);
+
+  srvDefHeader(srvp, header);
+  srvDefDataDP(srvp, data);
+  srvWrite(fileID, srvp);
+}
+
+#endif /* HAVE_LIBSERVICE */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_srv.h b/libcdi/src/stream_srv.h
new file mode 100644
index 0000000..cd45262
--- /dev/null
+++ b/libcdi/src/stream_srv.h
@@ -0,0 +1,32 @@
+#ifndef _STREAM_SRV_H
+#define _STREAM_SRV_H
+
+#ifndef _SERVICE_H
+#  include "service.h"
+#endif
+
+int    srvInqContents(int streamID);
+int    srvInqTimestep(int streamID, int tsID);
+
+int    srvInqRecord(int streamID, int *varID, int *levelID);
+int    srvDefRecord(int streamID);
+int    srvCopyRecord(int streamIDdest, int streamIDsrc);
+int    srvReadRecord(int streamID, double *data, int *nmiss);
+int    srvWriteRecord(int streamID, const double *data);
+
+void   srvReadVarDP (int streamID, int varID,       double *data, int *nmiss);
+void   srvWriteVarDP(int streamID, int varID, const double *data);
+
+void   srvReadVarSliceDP (int streamID, int varID, int levelID,       double *data, int *nmiss);
+void   srvWriteVarSliceDP(int streamID, int varID, int levelID, const double *data);
+
+#endif  /* _STREAM_SRV_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/stream_var.c b/libcdi/src/stream_var.c
new file mode 100644
index 0000000..3dbb92a
--- /dev/null
+++ b/libcdi/src/stream_var.c
@@ -0,0 +1,150 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <string.h>
+
+#include "dmemory.h"
+#include "error.h"
+
+#include "cdi.h"
+#include "stream_int.h"
+
+
+static
+void streamvarInitEntry(int streamID, int varID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  streamptr->vars[varID].ncvarid      = CDI_UNDEFID;
+  streamptr->vars[varID].defmiss      = 0;
+  streamptr->vars[varID].nlevs        = 0;
+  streamptr->vars[varID].level        = NULL;
+  streamptr->vars[varID].lindex       = NULL;
+
+  streamptr->vars[varID].gridID       = CDI_UNDEFID;
+  streamptr->vars[varID].zaxisID      = CDI_UNDEFID;
+  streamptr->vars[varID].tsteptype    = CDI_UNDEFID;
+  streamptr->vars[varID].level        = NULL;
+  streamptr->vars[varID].nlevs        = 0;
+}
+
+static
+int streamvarNewEntry(int streamID)
+{
+  int varID = 0;
+  int streamvarSize;
+  svarinfo_t *streamvar;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  streamvarSize = streamptr->varsAllocated;
+  streamvar     = streamptr->vars;
+  /*
+    Look for a free slot in streamvar.
+    (Create the table the first time through).
+  */
+  if ( ! streamvarSize )
+    {
+      int i;
+
+      streamvarSize = 2;
+      streamvar = (svarinfo_t *) malloc(streamvarSize*sizeof(svarinfo_t));
+      if ( streamvar == NULL )
+	{
+          Message("streamvarSize = %d", streamvarSize);
+	  SysError("Allocation of svarinfo_t failed");
+	}
+
+      for ( i = 0; i < streamvarSize; i++ )
+	streamvar[i].isUsed = FALSE;
+    }
+  else
+    {
+      while ( varID < streamvarSize )
+	{
+	  if ( ! streamvar[varID].isUsed ) break;
+	  varID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if ( varID == streamvarSize )
+    {
+      int i;
+
+      streamvarSize = 2*streamvarSize;
+      streamvar = (svarinfo_t *) realloc(streamvar, streamvarSize*sizeof(svarinfo_t));
+      if ( streamvar == NULL )
+	{
+          Message("streamvarSize = %d", streamvarSize);
+	  SysError("Reallocation of svarinfo_t failed");
+	}
+      varID = streamvarSize/2;
+
+      for ( i = varID; i < streamvarSize; i++ )
+	streamvar[i].isUsed = FALSE;
+    }
+
+  streamptr->varsAllocated = streamvarSize;
+  streamptr->vars          = streamvar;
+
+  streamvarInitEntry(streamID, varID);
+
+  streamptr->vars[varID].isUsed = TRUE;
+
+  return (varID);
+}
+
+
+int streamNewVar(int streamID, int gridID, int zaxisID)
+{
+  int varID;
+  int *level;
+  int *lindex;
+  int nlevs;
+  int levID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( CDI_Debug )
+    Message("gridID = %d  zaxisID = %d", gridID, zaxisID);
+
+  varID = streamvarNewEntry(streamID);
+
+  streamptr->nvars++;
+
+  streamptr->vars[varID].gridID  = gridID;
+  streamptr->vars[varID].zaxisID = zaxisID;
+
+  nlevs = zaxisInqSize(zaxisID);
+
+  level  = (int *) malloc(nlevs*sizeof(int));
+  lindex = (int *) malloc(nlevs*sizeof(int));
+
+  for ( levID = 0; levID < nlevs; levID++ )
+    level[levID] = CDI_UNDEFID;
+
+  for ( levID = 0; levID < nlevs; levID++ )
+    lindex[levID] = levID;
+
+  streamptr->vars[varID].nlevs  = nlevs;
+  streamptr->vars[varID].level  = level;
+  streamptr->vars[varID].lindex = lindex;
+
+  return (varID);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/swap.c b/libcdi/src/swap.c
new file mode 100644
index 0000000..df759b2
--- /dev/null
+++ b/libcdi/src/swap.c
@@ -0,0 +1,67 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+
+#include "error.h"
+#include "binary.h"
+
+void swap4byte(void *ptr, size_t size)
+{
+  INT32 *ptrtmp;
+  int nval;
+
+  nval = size;
+  if ( nval < 0 ) nval = 0;
+  ptrtmp = (INT32 *) ptr;
+
+  if ( sizeof(INT32) == 4 )
+    {
+      while ( nval-- )
+	{
+	  *ptrtmp = (((*ptrtmp >> 24) & 0x00ff) | ((*ptrtmp & 0x00ff) << 24) |
+		     ((*ptrtmp >>  8) & 0xff00) | ((*ptrtmp & 0xff00) <<  8));
+	  ptrtmp++;
+	}
+    }
+  else
+    {
+      Error("not implemented for %d byte data", sizeof(INT32));
+    }
+}
+
+void swap8byte(void *ptr, size_t size)
+{
+  INT64 *ptrtmp;
+  int nval;
+
+  nval = size;
+  if ( nval < 0 ) nval = 0;
+  ptrtmp = (INT64 *) ptr;
+
+  if ( sizeof(INT64) == 8 )
+    {
+      while ( nval-- )
+	{
+	  *ptrtmp = (((*ptrtmp >> 56) & 0x000000ff) | ((*ptrtmp & 0x000000ff) << 56) |
+		     ((*ptrtmp >> 40) & 0x0000ff00) | ((*ptrtmp & 0x0000ff00) << 40) |
+		     ((*ptrtmp >> 24) & 0x00ff0000) | ((*ptrtmp & 0x00ff0000) << 24) |
+		     ((*ptrtmp >>  8) & 0xff000000) | ((*ptrtmp & 0xff000000) <<  8));
+	  ptrtmp++;
+	}
+    }
+  else
+    {
+      Error("not implemented for %d byte data", sizeof(INT64));
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/swap.h b/libcdi/src/swap.h
new file mode 100644
index 0000000..cc6ee62
--- /dev/null
+++ b/libcdi/src/swap.h
@@ -0,0 +1,12 @@
+
+void swap4byte(void *ptr, size_t size);
+void swap8byte(void *ptr, size_t size);
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/table.c b/libcdi/src/table.c
new file mode 100644
index 0000000..90c9e54
--- /dev/null
+++ b/libcdi/src/table.c
@@ -0,0 +1,994 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <ctype.h>
+
+#include "dmemory.h"
+#include "cdi.h"
+#include "stream_int.h"
+
+#undef  UNDEFID
+#define UNDEFID -1
+
+/*int TableDefine = 0; */ /* Define new table also if the entry already exist */
+                          /* This is needed for createtable */
+
+#include "tablepar.h"
+#include "table.h"
+
+#define MAX_TABLE  256
+#define MAX_PARS   1024
+
+typedef struct
+{
+  int    used;  
+  PAR   *pars;
+  int    npars;
+  int    modelID;
+  int    number;
+  char  *name;
+} 
+PARTAB;
+
+static PARTAB parTable[MAX_TABLE];
+static int  parTableSize = MAX_TABLE;
+static int  parTableNum  = 0;
+static int  ParTableInit = 0;
+
+static char *tablePath = NULL;
+
+void tableDefModelID(int tableID, int modelID);
+void tableDefNum(int tableID, int tablenum);
+
+
+void tableDefEntry(int tableID, int id, const char *name,
+		   const char *longname, const char *units)
+{
+  int item;
+
+  item = parTable[tableID].npars++;
+  parTable[tableID].pars[item].id       = id;
+  parTable[tableID].pars[item].name     = NULL;
+  parTable[tableID].pars[item].longname = NULL;
+  parTable[tableID].pars[item].units    = NULL;
+
+  if ( name )
+    if ( strlen(name) > 0 )
+      parTable[tableID].pars[item].name     = strdupx(name);
+  if ( longname )
+    if ( strlen(longname) > 0 )
+      parTable[tableID].pars[item].longname = strdupx(longname);
+  if ( units )
+    if ( strlen(units) > 0 )
+      parTable[tableID].pars[item].units    = strdupx(units);
+}
+
+void tableLink(int tableID, PAR *pars, int npars)
+{
+  int item;
+
+  for ( item = 0; item < npars; item++ )
+    {
+      parTable[tableID].pars[item].id       = pars[item].id;
+      parTable[tableID].pars[item].name     = pars[item].name;
+      parTable[tableID].pars[item].longname = pars[item].longname;
+      parTable[tableID].pars[item].units    = pars[item].units;
+    }
+
+  parTable[tableID].npars = npars;
+}
+
+void parTableInitEntry(int tableID)
+{
+  parTable[tableID].used    = 0;
+  parTable[tableID].pars    = NULL;
+  parTable[tableID].npars   = 0;
+  parTable[tableID].modelID = UNDEFID;
+  parTable[tableID].number  = UNDEFID;
+  parTable[tableID].name    = NULL;
+}
+
+void tableGetPath(void)
+{
+  char *path;
+
+  path = getenv("TABLEPATH");
+
+  if ( path ) tablePath = strdupx(path);
+  /*
+  printf("tablePath = %s\n", tablePath);
+  */
+}
+
+void parTableInit(void)
+{
+  ParTableInit = 1;
+
+  if ( cdiPartabIntern )
+    tableDefault();
+
+  tableGetPath();
+}
+
+int tableNewEntry()
+{
+  int tableID = 0;
+  static int init = 0;
+
+  if ( ! init )
+    {
+      for ( tableID = 0; tableID < parTableSize; tableID++ )
+	parTableInitEntry(tableID);
+      init = 1;
+    }
+
+  /*
+    Look for a free slot in parTable.
+  */
+  for ( tableID = 0; tableID < parTableSize; tableID++ )
+    {
+      if ( ! parTable[tableID].used ) break;
+    }
+
+  if ( tableID == parTableSize )
+    Error("no more entries!");
+
+  parTable[tableID].used = 1;
+  parTableNum++;
+
+  return (tableID);
+}
+
+int decodeForm1(char *pline, char *name, char *longname, char *units)
+{
+  /* Format 1 : code name add mult longname [units] */
+  double add, mult;
+  int level;
+  char *pstart, *pend;
+  long len;
+
+  level = strtol(pline, &pline, 10);
+  while ( isspace((int) *pline) ) pline++;
+
+  pstart = pline;
+  while ( ! (isspace((int) *pline) || *pline == 0) ) pline++;
+  len = pline - pstart;
+  if ( len > 0 )
+    {
+      memcpy(name, pstart, len);
+      name[len] = 0;
+    }
+  else
+    return (0);
+
+  len = strlen(pline);
+  if ( len == 0 ) return (0);
+
+  add  = strtod(pline, &pline);
+  mult = strtod(pline, &pline);
+
+  while ( isspace((int) *pline) ) pline++;
+
+  len = strlen(pline);
+  if ( len > 0)
+    {
+      pstart = pline;
+      pend = strrchr(pline, '[');
+      if ( pend )
+	pend--;
+      else
+	pend = pstart + len;
+      while ( isspace((int) *pend) ) pend--;
+      len = pend - pstart + 1;
+      if ( len > 0 )
+	{
+	  memcpy(longname, pstart, len);
+	  longname[len] = 0;
+	}
+      pstart = strrchr(pline, '[');
+      if ( pstart )
+	{
+	  pstart++;
+	  while ( isspace((int) *pstart) ) pstart++;
+	  pend = strchr(pstart, ']');
+	  if ( ! pend ) return (0);
+	  pend--;
+	  while ( isspace((int) *pend) ) pend--;
+	  len = pend - pstart + 1;
+	  if ( len > 0 )
+	    {
+	      memcpy(units, pstart, len);
+	      units[len] = 0;
+	    }	  
+	}
+    }
+ 
+  return (0);
+}
+
+int decodeForm2(char *pline, char *name, char *longname, char *units)
+{
+  /* Format 2 : code | name | longname | units */
+  char *pend;
+  long len;
+
+  pline = strchr(pline, '|');
+  pline++;
+
+  while ( isspace((int) *pline) ) pline++;
+  pend = strchr(pline, '|');
+  if ( ! pend )
+    {
+      pend = pline;
+      while ( ! isspace((int) *pend) ) pend++;
+      len = pend - pline;
+      if ( len > 0 )
+	{
+	  memcpy(name, pline, len);
+	  name[len] = 0;
+	}
+      return (0);
+    }
+  else
+    {
+      pend--;
+      while ( isspace((int) *pend) ) pend--;
+      len = pend - pline + 1;
+      if ( len > 0 )
+	{
+	  memcpy(name, pline, len);
+	  name[len] = 0;
+	}
+    }
+
+  pline = strchr(pline, '|');
+  pline++;
+  while ( isspace((int) *pline) ) pline++;
+  pend = strchr(pline, '|');
+  if ( !pend ) pend = strchr(pline, 0);
+  pend--;
+  while ( isspace((int) *pend) ) pend--;
+  len = pend - pline + 1;
+  if ( len > 0 )
+    {
+      memcpy(longname, pline, len);
+      longname[len] = 0;
+    }
+
+  pline = strchr(pline, '|');
+  if ( pline )
+    {
+      pline++;
+      while ( isspace((int) *pline) ) pline++;
+      pend = strchr(pline, '|');
+      if ( !pend ) pend = strchr(pline, 0);
+      pend--;
+      while ( isspace((int) *pend) ) pend--;
+      len = pend - pline + 1;
+      if ( len < 0 ) len = 0;
+      memcpy(units, pline, len);
+      units[len] = 0;
+    }
+
+  return (0);
+}
+
+int tableRead(const char *tablefile)
+{
+  char line[1024], *pline;
+  int lnr = 0;
+  long len;
+  int id;
+  char name[256], longname[256], units[256];
+  int tableID = UNDEFID;
+  int err;
+  char *tablename;
+  FILE *tablefp;
+
+  tablefp = fopen(tablefile, "r");
+  if ( tablefp == NULL ) return (tableID);
+
+  tablename = strrchr(tablefile, '/');
+  if ( tablename == 0 ) tablename = (char *) tablefile;
+  else                  tablename++;
+
+  tableID = tableDef(-1, 0, tablename);
+
+  while ( fgets(line, 1023, tablefp) )
+    {
+      len = strlen(line);
+      if ( line[len-1] == '\n' ) line[len-1] = '\0';
+      lnr++;
+      id       = CDI_UNDEFID;
+      name[0]     = 0;
+      longname[0] = 0;
+      units[0]    = 0;
+      if ( line[0] == '#' ) continue;
+      pline = line;
+
+      len = strlen(pline);
+      if ( len < 4 ) continue;
+      while ( isspace((int) *pline) ) pline++;
+      id = atoi(pline);
+      /*
+      if ( id > 255 ) id -= 256;
+      */
+      if ( id == 0 ) continue;
+
+      while ( isdigit((int) *pline) ) pline++; 
+
+      if ( strchr(pline, '|') )
+	err = decodeForm2(pline, name, longname, units);
+      else
+	err = decodeForm1(pline, name, longname, units);
+
+      if ( err ) continue;
+
+      if ( strlen(name) == 0 ) sprintf(name, "var%d", id);
+
+      tableDefEntry(tableID, id, name, longname, units);
+    }
+
+  return (tableID);
+}
+
+int tableFromEnv(int modelID, int tablenum)
+{
+  int tableID = UNDEFID;
+  char tablename[256] = {'\0'};
+  int tablenamefound = 0;
+
+  if ( modelInqNamePtr(modelID) )
+    {
+      strcpy(tablename, modelInqNamePtr(modelID));
+      if ( tablenum )
+	{
+	  int len = strlen(tablename);
+	  sprintf(tablename+len, "_%03d", tablenum);
+	}
+      tablenamefound = 1;
+    }
+  else
+    {
+      int instID = modelInqInstitut(modelID);
+      if ( instID != UNDEFID )
+	{
+	  if ( institutInqNamePtr(instID) )
+	    {
+	      strcpy(tablename, institutInqNamePtr(instID));
+	      if ( tablenum )
+		{
+		  int len = strlen(tablename);
+		  sprintf(tablename+len, "_%03d", tablenum);
+		}
+	      tablenamefound = 1;
+	    }
+	}
+    }
+
+  if ( tablenamefound )
+    {
+      int lenp = 0, lenf;
+      char *tablefile = NULL;
+      if ( tablePath )
+	lenp = strlen(tablePath);
+      lenf = strlen(tablename);
+      /* if (tablePath) printf("tablePath = %s\n", tablePath); */
+      /* if (tablename) printf("tableName = %s\n", tablename); */
+      tablefile = (char *) malloc(lenp+lenf+3);
+      if ( tablePath )
+	{
+	  strcpy(tablefile, tablePath);
+	  strcat(tablefile, "/");
+	}
+      else
+	tablefile[0] = '\0';
+      strcat(tablefile, tablename);
+      /* if (tablefile) printf("tableFile = %s\n", tablefile); */
+
+      tableID = tableRead(tablefile);
+      if ( tableID != UNDEFID )
+	{
+	  tableDefModelID(tableID, modelID);
+	  tableDefNum(tableID, tablenum);
+	}
+      /* printf("tableID = %d %s\n", tableID, tablefile); */
+
+      free(tablefile);
+    }
+
+  return (tableID);
+}
+
+int tableInq(int modelID, int tablenum, const char *tablename)
+{
+  int tableID = UNDEFID;
+  int modelID2 = UNDEFID, i, len;
+  char tablefile[256] = {'\0'};
+
+  if ( ! ParTableInit ) parTableInit();
+
+  if ( tablename )
+    {
+      size_t len;
+      strcpy(tablefile, tablename);
+      /*
+      printf("tableInq: tablefile = >%s<\n", tablefile);
+      */
+      /* search for internal table */
+      for ( tableID = 0; tableID < MAX_TABLE; tableID++ )
+	{
+	  if ( parTable[tableID].used && parTable[tableID].name )
+	    {
+	      /* len = strlen(parTable[tableID].name); */
+	      len = strlen(tablename);
+	      if ( memcmp(parTable[tableID].name, tablename, len) == 0 ) break;
+	    }
+	}
+      if ( tableID == MAX_TABLE ) tableID = UNDEFID;
+      if ( CDI_Debug )
+	Message("tableID = %d tablename = %s", tableID, tablename);
+    }
+  else
+    {
+      for ( tableID = 0; tableID < MAX_TABLE; tableID++ )
+	{
+	  if ( parTable[tableID].used )
+	    {	  
+	      if ( parTable[tableID].modelID == modelID &&
+		   parTable[tableID].number  == tablenum ) break;
+	    }
+	}
+  
+      if ( tableID == MAX_TABLE ) tableID = UNDEFID;
+
+      if ( tableID == UNDEFID )
+	{
+	  if ( modelID != UNDEFID )
+	    {
+	      if ( modelInqNamePtr(modelID) )
+		{
+		  strcpy(tablefile, modelInqNamePtr(modelID));
+		  len = strlen(tablefile);
+		  for ( i = 0; i < len; i++)
+		    if ( tablefile[i] == '.' ) tablefile[i] = '\0';
+		  modelID2 = modelInq(-1, 0, tablefile);
+		}
+	    }
+	  if ( modelID2 != UNDEFID )
+	    for ( tableID = 0; tableID < MAX_TABLE; tableID++ )
+	      {
+		if ( parTable[tableID].used )
+		  {
+		    if ( parTable[tableID].modelID == modelID2 &&
+			 parTable[tableID].number  == tablenum ) break;
+		  }
+	      }
+	}
+
+      if ( tableID == MAX_TABLE ) tableID = UNDEFID;
+
+      if ( tableID == UNDEFID && modelID != UNDEFID )
+	tableID = tableFromEnv(modelID, tablenum);
+
+      if ( CDI_Debug )
+	if ( tablename )
+	  Message("tableID = %d tablename = %s", tableID, tablename);
+    }
+
+  return (tableID);
+}
+
+int tableDef(int modelID, int tablenum, const char *tablename)
+{
+  int tableID = UNDEFID;
+
+  if ( ! ParTableInit ) parTableInit();
+  /*
+  if ( ! (modelID == UNDEFID && tablenum == 0) )
+    tableID = tableInq(modelID, tablenum, tablename);
+    */
+  if ( tableID == UNDEFID )
+    {
+      tableID = tableNewEntry();
+
+      parTable[tableID].modelID = modelID;
+      parTable[tableID].number  = tablenum;
+      if ( tablename ) 
+	parTable[tableID].name = strdupx(tablename);
+
+      parTable[tableID].pars = (PAR *) malloc(MAX_PARS * sizeof(PAR));
+    }
+
+  return (tableID);
+}
+
+void tableDefModelID(int tableID, int modelID)
+{
+  parTable[tableID].modelID = modelID;
+}
+
+void tableDefNum(int tableID, int tablenum)
+{
+  parTable[tableID].number  = tablenum;
+}
+
+int tableInqNum(int tableID)
+{
+  int number = 0;
+
+  if ( tableID >= 0 && tableID < MAX_TABLE )
+    number = parTable[tableID].number;
+
+  return (number);
+}
+
+int tableInqModel(int tableID)
+{
+  int modelID = -1;
+
+  if ( tableID >= 0 && tableID < MAX_TABLE )
+    modelID = parTable[tableID].modelID;
+
+  return (modelID);
+}
+
+void partabCheckID(int item)
+{
+  if ( item < 0 || item >= parTableSize )
+    Error("item %d undefined!", item);
+
+  if ( ! parTable[item].name )
+    Error("item %d name undefined!", item);
+}
+
+char *tableInqNamePtr(int tableID)
+{
+  char *tablename = NULL;
+
+  if ( CDI_Debug )
+    Message("tableID = %d", tableID);
+
+  if ( ! ParTableInit ) parTableInit();
+
+  if ( tableID >= 0 && tableID < parTableSize )
+    if ( parTable[tableID].name )
+      tablename = parTable[tableID].name;
+
+  return (tablename);
+}
+
+void tableWrite(const char *ptfile, int tableID)
+{
+  int item, npars;
+  int lenname, lenlname, lenunits;
+  int maxname = 4, maxlname = 10, maxunits = 2;
+  FILE *ptfp;
+  int tablenum, modelID, instID = CDI_UNDEFID;
+  int center = 0, subcenter = 0;
+  char *name, *longname, *units;
+  char *instnameptr = NULL, *modelnameptr = NULL;
+
+  if ( CDI_Debug )
+    Message("write parameter table %d to %s", tableID, ptfile);
+
+  if ( tableID == UNDEFID )
+    {
+      Warning("parameter table ID undefined");
+      return;
+    }
+
+  partabCheckID(tableID);
+
+  ptfp = fopen(ptfile, "w");
+
+  npars = parTable[tableID].npars;
+
+  for ( item = 0; item < npars; item++)
+    {
+      if ( parTable[tableID].pars[item].name )
+	{
+	  lenname  = strlen(parTable[tableID].pars[item].name);
+	  if ( lenname  > maxname )  maxname  = lenname;
+	}
+
+      if ( parTable[tableID].pars[item].longname )
+	{
+	  lenlname = strlen(parTable[tableID].pars[item].longname);
+	  if ( lenlname > maxlname ) maxlname = lenlname;
+	}
+
+      if ( parTable[tableID].pars[item].units )
+	{
+	  lenunits = strlen(parTable[tableID].pars[item].units);
+	  if ( lenunits > maxunits ) maxunits = lenunits;
+	}
+    }
+
+  tablenum = tableInqNum(tableID);
+  modelID = parTable[tableID].modelID;
+  if ( modelID != CDI_UNDEFID )
+    {
+      modelnameptr = modelInqNamePtr(modelID);
+      instID = modelInqInstitut(modelID);
+    }
+  if ( instID != CDI_UNDEFID )
+    {
+      center = institutInqCenter(instID);
+      subcenter = institutInqSubcenter(instID);
+      instnameptr = institutInqNamePtr(instID);
+    }
+
+  fprintf(ptfp, "# Parameter table\n");
+  fprintf(ptfp, "#\n");
+  if ( tablenum )
+    fprintf(ptfp, "# TABLE_ID=%d\n", tablenum);
+  fprintf(ptfp, "# TABLE_NAME=%s\n", parTable[tableID].name);
+  if ( modelnameptr )
+    fprintf(ptfp, "# TABLE_MODEL=%s\n", modelnameptr);
+  if ( instnameptr )
+    fprintf(ptfp, "# TABLE_INSTITUT=%s\n", instnameptr);
+  if ( center )
+    fprintf(ptfp, "# TABLE_CENTER=%d\n", center);
+  if ( subcenter )
+    fprintf(ptfp, "# TABLE_SUBCENTER=%d\n", subcenter);
+  fprintf(ptfp, "#\n");
+  fprintf(ptfp, "#\n");
+  fprintf(ptfp, "# id       = parameter ID\n");
+  fprintf(ptfp, "# name     = variable name\n");
+  fprintf(ptfp, "# title    = long name (description)\n");
+  fprintf(ptfp, "# units    = variable units\n");
+  fprintf(ptfp, "#\n");
+  fprintf(ptfp, "# The format of each record is:\n");
+  fprintf(ptfp, "#\n");
+  fprintf(ptfp, "# id | %-*s | %-*s | %-*s\n",
+	  maxname,  "name",
+	  maxlname, "title",
+	  maxunits, "units");
+	  
+  for ( item = 0; item < npars; item++)
+    {
+      name = parTable[tableID].pars[item].name;
+      longname = parTable[tableID].pars[item].longname;
+      units = parTable[tableID].pars[item].units;
+      if ( name == NULL ) name = " ";
+      if ( longname == NULL ) longname = " ";
+      if ( units == NULL ) units = " ";
+      fprintf(ptfp, "%4d | %-*s | %-*s | %-*s\n",
+	      parTable[tableID].pars[item].id,
+	      maxname, name,
+	      maxlname, longname,
+	      maxunits, units);
+    }
+
+  fclose(ptfp);
+}
+
+
+void tableWriteC(const char *filename, int tableID)
+{
+  char chelp[] = "";
+  int item, npars;
+  int lenname, lenlname, lenunits;
+  int maxname = 0, maxlname = 0, maxunits = 0;
+  char tablename[256];
+  int len, i;
+  FILE *ptfp;
+
+  if ( CDI_Debug )
+    Message("write parameter table %d to %s", tableID, filename);
+
+  if ( tableID == UNDEFID )
+    {
+      Warning("parameter table ID undefined");
+      return;
+    }
+
+  partabCheckID(tableID);
+
+  ptfp = fopen(filename, "w");
+
+  npars = parTable[tableID].npars;
+
+  for ( item = 0; item < npars; item++)
+    {
+      if ( parTable[tableID].pars[item].name )
+	{
+	  lenname  = strlen(parTable[tableID].pars[item].name);
+	  if ( lenname  > maxname )  maxname  = lenname;
+	}
+
+      if ( parTable[tableID].pars[item].longname )
+	{
+	  lenlname = strlen(parTable[tableID].pars[item].longname);
+	  if ( lenlname > maxlname ) maxlname = lenlname;
+	}
+
+      if ( parTable[tableID].pars[item].units )
+	{
+	  lenunits = strlen(parTable[tableID].pars[item].units);
+	  if ( lenunits > maxunits ) maxunits = lenunits;
+	}
+    }
+
+  strcpy(tablename, parTable[tableID].name);
+  len = strlen(tablename);
+
+  for ( i = 0; i < len; i++ )
+    if ( tablename[i] == '.' ) tablename[i] = '_';
+
+  fprintf(ptfp, "static PAR %s[] = {\n", tablename);
+	  
+  for ( item = 0; item < npars; item++ )
+    {
+      len = strlen(parTable[tableID].pars[item].name);
+      fprintf(ptfp, "  {%4d, \"%s\", %-*s",
+	      parTable[tableID].pars[item].id,
+	      parTable[tableID].pars[item].name, maxname-len, chelp);
+
+      if ( parTable[tableID].pars[item].longname )
+	len = strlen(parTable[tableID].pars[item].longname);
+      else
+	len = 0;
+
+      if ( len == 0 )
+	fprintf(ptfp, " NULL, %-*s", maxlname-3, chelp);
+      else
+	fprintf(ptfp, "\"%s\", %-*s",
+		parTable[tableID].pars[item].longname, maxlname-len, chelp);
+
+      if ( parTable[tableID].pars[item].units )
+	len = strlen(parTable[tableID].pars[item].units);
+      else
+	len = 0;
+
+      if ( len == 0 )
+	fprintf(ptfp, " NULL %-*s},\n", maxunits-3, chelp);
+      else
+	fprintf(ptfp, "\"%s\" %-*s},\n",
+		parTable[tableID].pars[item].units,
+		maxunits-len, chelp);
+    }
+
+  fprintf(ptfp, "};\n\n");
+
+  fclose(ptfp);
+}
+
+
+int tableInqParCode(int tableID, char *varname, int *code)
+{
+  int item, npars;
+  int err = 0;
+
+  npars = parTable[tableID].npars;
+
+  if ( tableID == UNDEFID || varname == NULL )
+    {
+      err = 1;
+    }
+  else
+    {
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].name )
+	    if ( strcmp(parTable[tableID].pars[item].name, varname) == 0 )
+	      {
+		*code = parTable[tableID].pars[item].id;
+		break;
+	      }
+	}
+      if ( item == npars ) err = 1;
+    }
+
+  return (err);
+}
+
+
+int tableInqParName(int tableID, int code, char *varname)
+{
+  int item, npars;
+  int err = 0;
+
+  npars = parTable[tableID].npars;
+
+  if ( tableID == UNDEFID )
+    {
+      err = 1;
+    }
+  else
+    {
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      if ( parTable[tableID].pars[item].name )
+		strcpy(varname, parTable[tableID].pars[item].name);
+	      break;
+	    }
+	}
+      if ( item == npars ) err = 1;
+    }
+
+  return (err);
+}
+
+
+char *tableInqParNamePtr(int tableID, int code)
+{
+  char *name = NULL;
+  int item, npars;
+
+  if ( tableID != UNDEFID )
+    {
+      npars = parTable[tableID].npars;
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      name = parTable[tableID].pars[item].name;
+	      break;
+	    }
+	}
+    }
+
+  return (name);
+}
+
+
+char *tableInqParLongnamePtr(int tableID, int code)
+{
+  char *longname = NULL;
+  int item, npars;
+
+  if ( tableID != UNDEFID )
+    {
+      npars = parTable[tableID].npars;
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      longname = parTable[tableID].pars[item].longname;
+	      break;
+	    }
+	}
+    }
+
+  return (longname);
+}
+
+
+char *tableInqParUnitsPtr(int tableID, int code)
+{
+  char *units = NULL;
+  int item, npars;
+
+  if ( tableID != UNDEFID )
+    {
+      npars = parTable[tableID].npars;
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      units = parTable[tableID].pars[item].units;
+	      break;
+	    }
+	}
+    }
+
+  return (units);
+}
+
+
+int tableInqParLongname(int tableID, int code, char *longname)
+{
+  int item, npars;
+  int err = 0;
+
+  npars = parTable[tableID].npars;
+
+  if ( tableID == UNDEFID )
+    {
+      err = 1;
+    }
+  else
+    {
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      if ( parTable[tableID].pars[item].longname )
+		strcpy(longname, parTable[tableID].pars[item].longname);
+	      break;
+	    }
+	}
+      if ( item == npars ) err = 1;
+    }
+
+  return (err);
+}
+
+
+int tableInqParUnits(int tableID, int code, char *units)
+{
+  int item, npars;
+  int err = 0;
+
+  npars = parTable[tableID].npars;
+
+  if ( tableID == UNDEFID )
+    {
+      err = 1;
+    }
+  else
+    {
+      for ( item = 0; item < npars; item++ )
+	{
+	  if ( parTable[tableID].pars[item].id == code )
+	    {
+	      if ( parTable[tableID].pars[item].units )
+		strcpy(units, parTable[tableID].pars[item].units);
+	      break;
+	    }
+	}
+      if ( item == npars ) err = 1;
+    }
+
+  return (err);
+}
+
+
+void tableInqPar(int tableID, int code, char *name, char *longname, char *units)
+{
+  int item, npars;
+
+  npars = parTable[tableID].npars;
+
+  for ( item = 0; item < npars; item++ )
+    {
+      if ( parTable[tableID].pars[item].id == code )
+	{
+	  if ( parTable[tableID].pars[item].name )
+	    strcpy(name, parTable[tableID].pars[item].name);
+	  if ( parTable[tableID].pars[item].longname )
+	    strcpy(longname, parTable[tableID].pars[item].longname);
+	  if ( parTable[tableID].pars[item].units )
+	    strcpy(units, parTable[tableID].pars[item].units);
+	  break;
+	}
+    }
+}
+
+
+int parInqID(int tableID, int code)
+{
+  int item, npars;
+
+  npars = parTable[tableID].npars;
+
+  for ( item = 0; item < npars; item++ )
+    {
+      if ( parTable[tableID].pars[item].id == code ) break;
+    }
+
+  if ( item == npars ) item = -1;
+
+  return (item);
+}
+
+int tableInqNumber(void)
+{
+  if ( ! ParTableInit ) parTableInit();
+
+  return (parTableNum);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/table.h b/libcdi/src/table.h
new file mode 100644
index 0000000..0d189d4
--- /dev/null
+++ b/libcdi/src/table.h
@@ -0,0 +1,1426 @@
+#ifndef _TABLE_H
+#define _TABLE_H
+
+static PAR echam4[] = {
+  {   4, "precip",      "total precipitation",                      "m/s"      },
+  {  34, "low_cld",     "low cloud",                                 NULL      },
+  {  35, "mid_cld",     "mid cloud",                                 NULL      },
+  {  36, "hih_cld",     "high cloud",                                NULL      },
+  { 129, "geosp",       "surface geopotential (orography)",         "m^2/s^2"  },
+  { 130, "t",           "temperature",                              "K"        },
+  { 131, "u",           "u-velocity",                               "m/s"      },
+  { 132, "v",           "v-velocity",                               "m/s"      },
+  { 133, "sq",          "specific humidity",                        "kg/kg"    },
+  { 134, "aps",         "Surface pressure",                         "Pa"       },
+  { 135, "omega",       "vertical velocity",                        "Pa/s"     },
+  { 138, "svo",         "vorticity",                                "1/s"      },
+  { 139, "ts",          "surface temperature",                      "K"        },
+  { 140, "ws",          "soil wetness",                             "m"        },
+  { 141, "sn",          "snow depth",                               "m"        },
+  { 142, "aprl",        "large scale precipitation",                "m/s"      },
+  { 143, "aprc",        "convective  precipitation",                "m/s"      },
+  { 144, "aprs",        "snow fall",                                "m/s"      },
+  { 145, "vdis",        "boundary layer dissipation",               "W/m^2"    },
+  { 146, "ahfs",        "surface sensible heat flux",               "W/m^2"    },
+  { 147, "ahfl",        "surface latent heat flux",                 "W/m^2"    },
+  { 148, "stream",      "streamfunction",                           "m^2/s"    },
+  { 149, "velopot",     "velocity potential",                       "m^2/s"    },
+  { 151, "slp",         "mean sea level pressure",                  "Pa"       },
+  { 152, "lsp",         "log surface pressure",                      NULL      },
+  { 153, "sx",          "liquid water content",                     "kg/kg"    },
+  { 155, "sd",          "divergence",                               "1/s"      },
+  { 156, "geopoth",     "geopotential height",                      "m"        },
+  { 157, "rhumidity",   "relative humidity",                        "fraction" },
+  { 158, "var158",      "tendency of surface pressure",             "Pa/s"     },
+  { 159, "ustar3",      "ustar3",                                   "m^3/s^3"  },
+  { 160, "runoff",      "surface runoff",                           "m/s"      },
+  { 161, "alwc",        "liquid water content",                     "kg/kg"    },
+  { 162, "aclc",        "cloud cover",                              "fraction" },
+  { 163, "aclcv",       "total cloud cover",                        "fraction" },
+  { 164, "aclcov",      "total cloud cover",                        "fraction" },
+  { 165, "u10",         "10m u-velocity",                           "m/s"      },
+  { 166, "v10",         "10m v-velocity",                           "m/s"      },
+  { 167, "temp2",       "2m temperature",                           "K"        },
+  { 168, "dew2",        "2m dew point temperature",                 "K"        },
+  { 169, "tsurf",       "surface temperature",                      "K"        },
+  { 170, "td",          "deep soil temperature",                    "K"        },
+  { 171, "wind10",      "10m windspeed",                            "m/s"      },
+  { 172, "slm",         "land sea mask",                            "fraction" },
+  { 173, "az0",         "surface roughness length",                 "m"        },
+  { 174, "alb",         "surface background albedo",                "fraction" },
+  { 175, "albedo",      "surface albedo",                           "fraction" },
+  { 176, "srads",       "net surface solar radiation",              "W/m^2"    },
+  { 177, "trads",       "net surface thermal radiation",            "W/m^2"    },
+  { 178, "srad0",       "net top solar radiation",                  "W/m^2"    },
+  { 179, "trad0",       "top thermal radiation (OLR)",              "W/m^2"    },
+  { 180, "ustr",        "surface u-stress",                         "Pa"       },
+  { 181, "vstr",        "surface v-stress",                         "Pa"       },
+  { 182, "evap",        "surface evaporation",                      "m/s"      },
+  { 183, "tdcl",        "soil temperature",                         "K"        },
+  { 185, "srafs",       "net surf. solar radiation   (clear sky)",  "W/m^2"    },
+  { 186, "trafs",       "net surf. thermal radiation (clear sky)",  "W/m^2"    },
+  { 187, "sraf0",       "net top solar radiation     (clear sky)",  "W/m^2"    },
+  { 188, "traf0",       "net top thermal radiation   (clear sky)",  "W/m^2"    },
+  { 189, "sclfs",       "surface solar cloud forcing",              "W/m^2"    },
+  { 190, "tclfs",       "surface thermal cloud forcing",            "W/m^2"    },
+  { 191, "sclf0",       "top solar cloud forcing",                  "W/m^2"    },
+  { 192, "tclf0",       "top thermal cloud forcing",                "W/m^2"    },
+  { 193, "wl",          "skin reservoir content",                   "m"        },
+  { 194, "wlm1",        "skin reservoir content of plants",         "m"        },
+  { 195, "ustrgw",      "u-gravity wave stress",                    "Pa"       },
+  { 196, "vstrgw",      "v-gravity wave stress",                    "Pa"       },
+  { 197, "vdisgw",      "gravity wave dissipation",                 "W/m^2"    },
+  { 198, "vgrat",       "vegetation ratio",                         "fraction" },
+  { 199, "varor",       "orographic variance",                      "m^2"      },
+  { 200, "vlt",         "leaf area index",                           NULL      },
+  { 201, "t2max",       "maximum 2m-temperature",                   "K"        },
+  { 202, "t2min",       "minimum 2m-temperature",                   "K"        },
+  { 203, "srad0u",      "top solar radiation upward",               "W/m^2"    },
+  { 204, "sradsu",      "surface solar radiation upward",           "W/m^2"    },
+  { 205, "tradsu",      "surface thermal radiation upward",         "W/m^2"    },
+  { 206, "tsn",         "snow temperature",                         "K"        },
+  { 207, "td3",         "soil temperature 3",                       "K"        },
+  { 208, "td4",         "soil temperature 4",                       "K"        },
+  { 209, "td5",         "soil temperature 5",                       "K"        },
+  { 210, "seaice",      "sea ice cover",                            "fraction" },
+  { 211, "siced",       "sea ice depth",                            "m"        },
+  { 212, "forest",      "vegetation type",                          "fraction" },
+  { 213, "teff",        "(effective) sea-ice skin temperature",     "K"        },
+  { 214, "tsmax",       "maximum surface temperature",              "K"        },
+  { 215, "tsmin",       "minimum surface temperature",              "K"        },
+  { 216, "wimax",       "maximum 10m-wind speed",                   "m/s"      },
+  { 217, "topmax",      "maximum height of convective cloud tops",  "Pa"       },
+  { 218, "snmel",       "snow melt",                                "m/s"      },
+  { 219, "runtoc",      "surface runoff into ocean",                 NULL      },
+  { 220, "tslin",       "land: residual surface heat budget",       "W/m^2"    },
+  { 221, "dsnac",       "snow depth change",                        "m/s"      },
+  { 222, "alwcac",      "liquid water content",                     "kg/kg"    },
+  { 223, "aclcac",      "cloud cover",                              "fraction" },
+  { 224, "tke",         "turbulent kinetic energy",                  NULL      },
+  { 225, "tkem1",       "turbulent kinetic energy (t-1)",            NULL      },
+  { 226, "fao",         "FAO data set (soil data flags)",            NULL      },
+  { 227, "rgcgn",       "heat capacity of soil",                     NULL      },
+  { 228, "sodif",       "soil diffusivity",                          NULL      },
+  { 229, "wsmx",        "field capacity of soil",                   "m"        },
+  { 230, "qvi",         "vertically integrated specific humidity",  "kg/m^2"   },
+  { 231, "alwcvi",      "vertically integrated liquid water cont.", "kg/m^2"   },
+  { 232, "glac",        "glacier mask",                             "fraction" },
+  { 233, "runlnd",      "surface runoff not running into ocean",     NULL      },
+  { 259, "windspeed",   "windspeed (sqrt(u^2+v^2))",                 NULL      },
+  { 260, "precip",      "total precipitation",                      "m/s"      },
+  { 261, "net_top",     "total top radiation",                       NULL      },
+  { 262, "net_bot",     "total surface radiation",                   NULL      },
+  { 263, "net_heat",    "net surface heat flux",                     NULL      },
+  { 264, "net_water",   "total surface water",                       NULL      },
+  { 268, "sw_atm",       NULL,                                       NULL      },
+  { 269, "lw_atm",       NULL,                                       NULL      },
+  { 270, "net_atm",      NULL,                                       NULL      },
+  { 271, "surf_runoff", "surface runoff",                            NULL      },
+  { 275, "fresh_water",  NULL,                                       NULL      },
+};
+
+static PAR echam5[] = {
+  {   4, "precip",     "total precipitation",                       "kg/m^2s" },
+  {  79, "swnirac",    "net surface NIR flux acc.",                 "W/m^2"   },
+  {  80, "swdifnirac", "fraction of diffuse NIR acc.",              "W/m^2"   },
+  {  81, "swvisac",    "net surface visible flux acc.",             "W/m^2"   },
+  {  82, "swdifvisac", "fraction of diffuse visible acc.",          "W/m^2"   },
+  {  83, "ocu",        "ocean eastw. velocity (coupled mode)",      "m/s"     },
+  {  84, "ocv",        "ocean northw. velocity (coupled mode)",     "m/s"     },
+  {  85, "tradl",      "net LW radiation 200mb",                    "W/m^2"   },
+  {  86, "sradl",      "net SW radiation 200mb",                    "W/m^2"   },
+  {  87, "trafl",      "net LW radiation 200mb (clear sky)",        "W/m^2"   },
+  {  88, "srafl",      "net SW radiation 200mb (clear sky)",        "W/m^2"   },
+  {  89, "amlcorac",   "mixed layer flux correction",               "W/m^2"   },
+  {  90, "amlheatac",  "mixed layer heat content",                  "J/m^2"   },
+  {  91, "trfliac",    "net LW radiation over ice",                 "W/m^2"   },
+  {  92, "trflwac",    "net LW radiation over water",               "W/m^2"   },
+  {  93, "trfllac",    "net LW radiation over land",                "W/m^2"   },
+  {  94, "sofliac",    "net SW radiation over ice",                 "W/m^2"   },
+  {  95, "soflwac",    "net SW radiation over water",               "W/m^2"   },
+  {  96, "sofllac",    "net SW radiation over land",                "W/m^2"   },
+  {  97, "friac",      "ice cover (fraction of grid box)",           NULL     },
+  { 102, "tsi",        "surface temperature of ice",                "K"       },
+  { 103, "tsw",        "surface temperature of water",              "K"       },
+  { 104, "ustri",      "zonal      wind stress over ice",           "Pa"      },
+  { 105, "vstri",      "meridional wind stress over ice",           "Pa"      },
+  { 106, "ustrw",      "zonal      wind stress over water",         "Pa"      },
+  { 107, "vstrw",      "meridional wind stress over water",         "Pa"      },
+  { 108, "ustrl",      "zonal      wind stress over land",          "Pa"      },
+  { 109, "vstrl",      "meridional wind stress over land",          "Pa"      },
+  { 110, "ahfliac",    "latent heat flux over ice",                 "W/m^2"   },
+  { 111, "ahflwac",    "latent heat flux over water",               "W/m^2"   },
+  { 112, "ahfllac",    "latent heat flux over land",                "W/m^2"   },
+  { 113, "evapiac",    "evaporation over ice",                      "kg/m^2s" },
+  { 114, "evapwac",    "evaporation over water",                    "kg/m^2s" },
+  { 115, "evaplac",    "evaporation over land",                     "kg/m^2s" },
+  { 116, "az0i",       "roughness length over ice",                 "m"       },
+  { 117, "az0w",       "roughness length over water",               "m"       },
+  { 118, "az0l",       "roughness length over land",                "m"       },
+  { 119, "ahfsiac",    "sensible heat flux over ice",               "W/m^2"   },
+  { 120, "ahfswac",    "sensible heat flux over water",             "W/m^2"   },
+  { 121, "ahfslac",    "sensible heat flux over land",              "W/m^2"   },
+  { 122, "alsoi",      "albedo of ice",                              NULL     },
+  { 123, "alsow",      "albedo of water",                            NULL     },
+  { 124, "alsol",      "albedo of land",                             NULL     },
+  { 125, "ahfice",     "conductive heat flux through ice",          "W/m^2"   },
+  { 126, "qres",       "residual heat flux for melting sea ice",    "W/m^2"   },
+  { 127, "alake",      "lake fraction",                              NULL     },
+  { 128, "rintop",     "low level inversion",                        NULL     },
+  { 129, "geosp",      "surface geopotential (orography)",          "m^2/s^2" },
+  { 130, "t",          "temperature",                               "K"       },
+  { 131, "u",          "u-velocity",                                "m/s"     },
+  { 132, "v",          "v-velocity",                                "m/s"     },
+  { 133, "q",          "specific humidity",                         "kg/kg"   },
+  { 134, "aps",        "surface pressure",                          "Pa"      },
+  { 135, "omega",      "vertical velocity",                         "Pa/s"    },
+  { 136, "acdnc",      "cloud droplet number concentration",        "1/m^3"   },
+  { 137, "apmeb",      "(P-E) error",                               "kg/m^2s" },
+  { 138, "svo",        "vorticity",                                 "1/s"     },
+  { 139, "tslm1",      "surface temperature of land",               "K"       },
+  { 140, "ws",         "soil wetness",                              "m"       },
+  { 141, "sn",         "water equivalent snow depth",               "m"       },
+  { 142, "aprl",       "large scale precipitation",                 "kg/m^2s" },
+  { 143, "aprc",       "convective  precipitation",                 "kg/m^2s" },
+  { 144, "aprs",       "snow fall",                                 "kg/m^2s" },
+  { 145, "vdis",       "boundary layer dissipation",                "W/m^2"   },
+  { 146, "ahfs",       "sensible heat flux",                        "W/m^2"   },
+  { 147, "ahfl",       "latent heat flux",                          "W/m^2"   },
+  { 148, "stream",     "streamfunction",                            "m^2/s"   },
+  { 149, "velopot",    "velocity potential",                        "m^2/s"   },
+  { 150, "xivi",       "vertically integrated cloud ice",           "kg/m^2"  },
+  { 151, "slp",        "mean sea level pressure",                   "Pa"      },
+  { 152, "lsp",        "log surface pressure",                       NULL     },
+  { 153, "xl",         "cloud water",                               "kg/kg"   },
+  { 154, "xi",         "cloud ice",                                 "kg/kg"   },
+  { 155, "sd",         "divergence",                                "1/s"     },
+  { 156, "geopoth",    "geopotential height",                       "m"       },
+  { 157, "rhumidity",  "relative humidity",                          NULL     },
+  { 159, "wind10w",    "10m windspeed over water",                  "m/s"     },
+  { 160, "runoff",     "surface runoff and drainage",               "kg/m^2s" },
+  { 161, "drain",      "drainage",                                  "kg/m^2s" },
+  { 162, "aclc",       "cloud cover",                                NULL     },
+  { 164, "aclcov",     "total cloud cover",                          NULL     },
+  { 165, "u10",        "10m u-velocity",                            "m/s"     },
+  { 166, "v10",        "10m v-velocity",                            "m/s"     },
+  { 167, "temp2",      "2m temperature",                            "K"       },
+  { 168, "dew2",       "2m dew point temperature",                  "K"       },
+  { 169, "tsurf",      "surface temperature",                       "K"       },
+  { 170, "xvar",       "variance of total water amount",            "kg/kg"   },
+  { 171, "wind10",     "10m windspeed",                             "m/s"     },
+  { 172, "slm",        "land sea mask (1. = land, 0. = sea/lakes)",  NULL     },
+  { 173, "az0",        "roughness length",                          "m"       },
+  { 174, "alb",        "surface background albedo",                  NULL     },
+  { 175, "albedo",     "surface albedo",                             NULL     },
+  { 176, "srads",      "net surface SW radiation",                  "W/m^2"   },
+  { 177, "trads",      "net surface LW radiation",                  "W/m^2"   },
+  { 178, "srad0",      "net top SW radiation",                      "W/m^2"   },
+  { 179, "trad0",      "net top LW radiation (-OLR)",               "W/m^2"   },
+  { 180, "ustr",       "u-stress",                                  "Pa"      },
+  { 181, "vstr",       "v-stress",                                  "Pa"      },
+  { 182, "evap",       "evaporation",                               "kg/m^2s" },
+  { 183, "xskew",      "skewness of total water amount qv+qi+ql",    NULL     },
+  { 184, "srad0d",     "top incoming SW radiation",                 "W/m^2"   },
+  { 185, "srafs",      "net surface SW radiation (clear sky)",      "W/m^2"   },
+  { 186, "trafs",      "net surface LW radiation (clear sky)",      "W/m^2"   },
+  { 187, "sraf0",      "net top SW radiation   (clear sky)",        "W/m^2"   },
+  { 188, "traf0",      "net top LW radiation   (clear sky)",        "W/m^2"   },
+  { 189, "sclfs",      "net surface SW cloud forcing (176-185)",    "W/m^2"   },
+  { 190, "tclfs",      "net surface LW cloud forcing (177-186)",    "W/m^2"   },
+  { 191, "sclf0",      "net SW top cloud forcing (178-187)",        "W/m^2"   },
+  { 192, "tclf0",      "net LW top cloud forcing (179-188)",        "W/m^2"   },
+  { 193, "wl",         "skin reservoir content",                    "m"       },
+  { 194, "slf",        "fractional land cover",                      NULL     },
+  { 195, "ustrgw",     "u-gravity wave stress",                     "Pa"      },
+  { 196, "vstrgw",     "v-gravity wave stress",                     "Pa"      },
+  { 197, "vdisgw",     "gravity wave dissipation",                  "W/m^2"   },
+  { 198, "vgrat",      "vegetation ratio",                           NULL     },
+  { 199, "orostd",     "orographic standard deviation",             "m"       },
+  { 200, "vlt",        "leaf area index",                            NULL     },
+  { 201, "t2max",      "maximum 2m-temperature",                    "K"       },
+  { 202, "t2min",      "minimum 2m-temperature",                    "K"       },
+  { 203, "srad0u",     "top SW radiation upward",                   "W/m^2"   },
+  { 204, "sradsu",     "surface SW radiation upward",               "W/m^2"   },
+  { 205, "tradsu",     "surface LW radiation upward",               "W/m^2"   },
+  { 206, "grndflux",   "surface ground heat flux",                   NULL     },
+  { 207, "tsoil",      "deep soil temperatures (5 layers)",         "K"       },
+  { 208, "ahfcon",     "conductive heat flux through ice",          "W/m^2"   },
+  { 209, "ahfres",     "res. heat flux for melting ice",            "W/m^2"   },
+  { 210, "seaice",     "ice cover (fraction of ice+water)",          NULL     },
+  { 211, "siced",      "ice thickness",                             "m"       },
+  { 212, "forest",     "forest fraction",                            NULL     },
+  { 213, "gld",        "glacier thickness",                         "m"       },
+  { 214, "sni",        "water equivalent of snow on ice",           "m"       },
+  { 215, "rogl",       "glacier runoff",                            "kg/m^2s" },
+  { 216, "wimax",      "maximum 10m-wind speed",                    "m/s"     },
+  { 217, "topmax",     "maximum height of convective cloud tops",   "Pa"      },
+  { 218, "snmel",      "snow melt",                                 "kg/m^2s" },
+  { 219, "runtoc",     "surface runoff into ocean",                 "kg/m^2s" },
+  { 220, "runlnd",     "surface runoff not running into ocean",     "kg/m^2s" },
+  { 221, "apmegl",     "P-E over land ice",                         "kg/m^2s" },
+  { 222, "snacl",      "snow accumulation over land",               "kg/m^2s" },
+  { 223, "aclcac",     "cloud cover",                                NULL     },
+  { 224, "tke",        "turbulent kinetic energy",                  "m^2/s^2" },
+  { 225, "tkem1",      "turbulent kinetic energy (t-1)",            "m^2/s^2" },
+  { 226, "fao",        "FAO data set (soil data flags) 0...5",       NULL     },
+  { 227, "rgcgn",      "heat capacity of soil",                      NULL     },
+  { 228, "sodif",      "soil diffusivity",                          "m^2/s"   },
+  { 229, "wsmx",       "field capacity of soil",                    "m"       },
+  { 230, "qvi",        "vertically integrated water vapor",         "kg/m^2"  },
+  { 231, "xlvi",       "vertically integrated cloud water",         "kg/m^2"  },
+  { 232, "glac",       "fraction of land covered by glaciers",       NULL     },
+  { 233, "snc",        "snow depth at the canopy",                  "m"       },
+  { 234, "rtype",      "type of convection",                        "0...3"   },
+  { 235, "abso4",      "anthropogenic sulfur burden",               "kg/m^2"  },
+  { 236, "ao3",        "ipcc ozone",                                "kg/m^2"  },
+  { 237, "tropo",      "WMO defined tropopause height",             "Pa"      },
+  { 259, "windspeed",  "windspeed (sqrt(u^2+v^2))",                 "m/s"     },
+  { 260, "precip",     "total precipitation  (142+143)",            "kg/m^2s" },
+  { 261, "net_top",    "total top radiation  (178+179)",            "W/m^2"   },
+  { 262, "net_bot",    "total surface radiation (176+177)",         "W/m^2"   },
+  { 272, "mastrfu",    "mass stream function",                      "kg/s"    },
+};
+
+static PAR echam6[] = {
+  {   4, "precip",         "total precipitation",                       "kg m-2 s-1" },
+  {  34, "low_cld",        "low cloud",                                  NULL        },
+  {  35, "mid_cld",        "mid cloud",                                  NULL        },
+  {  36, "hih_cld",        "high cloud",                                 NULL        },
+  {  68, "fage",           "aging factor of snow on ice",                NULL        },
+  {  69, "snifrac",        "fraction of ice covered with snow",          NULL        },
+  {  70, "barefrac",       "bare ice fraction",                          NULL        },
+  {  71, "alsom",          "albedo of melt ponds",                       NULL        },
+  {  72, "alsobs",         "albedo of bare ice and snow",                NULL        },
+  {  73, "sicepdw",        "melt pond depth on sea-ice",                "m"          },
+  {  74, "sicepdi",        "ice thickness on melt pond",                "m"          },
+  {  75, "tsicepdi",       "ice temperature on frozen melt pond",       "K"          },
+  {  76, "sicepres",       "residual heat flux",                        "W m-2"      },
+  {  77, "ameltdepth",     "total melt pond depth",                     "m"          },
+  {  78, "ameltfrac",      "fractional area of melt ponds on sea-ice",   NULL        },
+  {  79, "albedo_vis_dir", "surface albedo visible range direct",        NULL        },
+  {  80, "albedo_nir_dir", "surface albedo NIR range direct",            NULL        },
+  {  81, "albedo_vis_dif", "surface albedo visible range diffuse",       NULL        },
+  {  82, "albedo_nir_dif", "surface albedo NIR range diffuse",           NULL        },
+  {  83, "ocu",            "ocean eastw. velocity (coupled mode)",      "m/s"        },
+  {  84, "ocv",            "ocean northw. velocity (coupled mode)",     "m/s"        },
+  {  85, "tradl",          "thermal radiation 200mb",                   "W m-2"      },
+  {  86, "sradl",          "solar radiation 200mb",                     "W m-2"      },
+  {  87, "trafl",          "thermal radiation 200mb (clear sky)",       "W m-2"      },
+  {  88, "srafl",          "solar radiation 200mb (clear sky)",         "W m-2"      },
+  {  89, "amlcorac",       "mixed layer flux correction",               "W m-2"      },
+  {  90, "amlheatac",      "mixed layer heat content",                  "J m-2"      },
+  {  91, "trfliac",        "LW flux over ice",                          "W m-2"      },
+  {  92, "trflwac",        "LW flux over water",                        "W m-2"      },
+  {  93, "trfllac",        "LW flux over land",                         "W m-2"      },
+  {  94, "sofliac",        "SW flux over ice",                          "W m-2"      },
+  {  95, "soflwac",        "SW flux over water",                        "W m-2"      },
+  {  96, "sofllac",        "SW flux over land",                         "W m-2"      },
+  {  97, "friac",          "ice cover (fraction of grid box)",           NULL        },
+  { 102, "tsi",            "surface temperature of ice",                "K"          },
+  { 103, "tsw",            "surface temperature of water",              "K"          },
+  { 104, "ustri",          "zonal      wind stress over ice",           "Pa"         },
+  { 105, "vstri",          "meridional wind stress over ice",           "Pa"         },
+  { 106, "ustrw",          "zonal      wind stress over water",         "Pa"         },
+  { 107, "vstrw",          "meridional wind stress over water",         "Pa"         },
+  { 108, "ustrl",          "zonal      wind stress over land",          "Pa"         },
+  { 109, "vstrl",          "meridional wind stress over land",          "Pa"         },
+  { 110, "ahfliac",        "latent heat flux over ice",                 "W m-2"      },
+  { 111, "ahflwac",        "latent heat flux over water",               "W m-2"      },
+  { 112, "ahfllac",        "latent heat flux over land",                "W m-2"      },
+  { 113, "evapiac",        "evaporation over ice",                      "kg m-2 s-1" },
+  { 114, "evapwac",        "evaporation over water",                    "kg m-2 s-1" },
+  { 115, "evaplac",        "evaporation over land",                     "kg m-2 s-1" },
+  { 116, "az0i",           "roughness length over ice",                 "m"          },
+  { 117, "az0w",           "roughness length over water",               "m"          },
+  { 118, "az0l",           "roughness length over land",                "m"          },
+  { 119, "ahfsiac",        "sensible heat flux over ice",               "W m-2"      },
+  { 120, "ahfswac",        "sensible heat flux over water",             "W m-2"      },
+  { 121, "ahfslac",        "sensible heat flux over land",              "W m-2"      },
+  { 122, "alsoi",          "albedo of ice",                              NULL        },
+  { 123, "alsow",          "albedo of water",                            NULL        },
+  { 124, "alsol",          "albedo of land",                             NULL        },
+  { 125, "ahfice",         "conductive heat flux",                      "W m-2"      },
+  { 126, "qres",           "residual heat flux for melting sea ice",    "W m-2"      },
+  { 127, "alake",          "lake fraction of grid box",                 "fraction"   },
+  { 128, "rintop",         "low level inversion",                        NULL        },
+  { 129, "geosp",          "surface geopotential (orography)",          "m^2/s^2"    },
+  { 130, "t",              "temperature",                               "K"          },
+  { 131, "u",              "u-velocity",                                "m/s"        },
+  { 132, "v",              "v-velocity",                                "m/s"        },
+  { 133, "q",              "specific humidity",                         "kg/kg"      },
+  { 134, "aps",            "surface pressure",                          "Pa"         },
+  { 135, "omega",          "vertical velocity",                         "Pa/s"       },
+  { 136, "acdnc",          "cloud droplet number concentration",        "1 m-3"      },
+  { 137, "apmeb",          "vert. integr. tendencies of water",         "kg m-2 s-1" },
+  { 138, "svo",            "vorticity",                                 "1/s"        },
+  { 139, "tslm1",          "surface temperature of land",               "K"          },
+  { 140, "ws",             "soil wetness",                              "m"          },
+  { 141, "sn",             "snow depth",                                "m"          },
+  { 142, "aprl",           "large scale precipitation",                 "kg m-2 s-1" },
+  { 143, "aprc",           "convective  precipitation",                 "kg m-2 s-1" },
+  { 144, "aprs",           "snow fall",                                 "kg m-2 s-1" },
+  { 145, "vdis",           "boundary layer dissipation",                "W m-2"      },
+  { 146, "ahfs",           "sensible heat flux",                        "W m-2"      },
+  { 147, "ahfl",           "latent heat flux",                          "W m-2"      },
+  { 148, "stream",         "streamfunction",                            "m^2/s"      },
+  { 149, "velopot",        "velocity potential",                        "m^2/s"      },
+  { 150, "xivi",           "vertically integrated cloud ice",           "kg m-2"     },
+  { 151, "slp",            "mean sea level pressure",                   "Pa"         },
+  { 152, "lsp",            "log surface pressure",                       NULL        },
+  { 153, "xl",             "cloud water",                               "kg/kg"      },
+  { 154, "xi",             "cloud ice",                                 "kg/kg"      },
+  { 155, "sd",             "divergence",                                "1/s"        },
+  { 156, "geopoth",        "geopotential height",                       "m"          },
+  { 157, "rhumidity",      "relative humidity",                         "fraction"   },
+  { 158, "var158",         "tendency of surface pressure",              "Pa/s"       },
+  { 159, "wind10w",        "10m windspeed over water",                  "m/s"        },
+  { 160, "runoff",         "surface runoff and drainage",               "kg m-2 s-1" },
+  { 161, "drain",          "drainage",                                  "kg m-2 s-1" },
+  { 162, "aclc",           "cloud cover",                                NULL        },
+  { 163, "aclcv",          "total cloud cover",                          NULL        },
+  { 164, "aclcov",         "total cloud cover (mean)",                   NULL        },
+  { 165, "u10",            "10m u-velocity",                            "m/s"        },
+  { 166, "v10",            "10m v-velocity",                            "m/s"        },
+  { 167, "temp2",          "2m temperature",                            "K"          },
+  { 168, "dew2",           "2m dew point temperature",                  "K"          },
+  { 169, "tsurf",          "surface temperature",                       "K"          },
+  { 170, "xvar",           "variance of total water amount qv+qi+ql",   "kg/kg"      },
+  { 171, "wind10",         "10m windspeed",                             "m/s"        },
+  { 172, "slm",            "land sea mask (1. = land, 0. = sea/lakes)",  NULL        },
+  { 173, "az0",            "roughness length",                          "m"          },
+  { 174, "alb",            "surface background albedo",                  NULL        },
+  { 175, "albedo",         "surface albedo",                             NULL        },
+  { 176, "srads",          "net surface solar radiation",               "W m-2"      },
+  { 177, "trads",          "net surface thermal radiation",             "W m-2"      },
+  { 178, "srad0",          "net top solar radiation",                   "W m-2"      },
+  { 179, "trad0",          "top thermal radiation (OLR)",               "W m-2"      },
+  { 180, "ustr",           "u-stress",                                  "Pa"         },
+  { 181, "vstr",           "v-stress",                                  "Pa"         },
+  { 182, "evap",           "evaporation",                               "kg m-2 s-1" },
+  { 183, "xskew",          "skewness of total water amount qv+qi+ql",    NULL        },
+  { 184, "srad0d",         "top incoming solar radiation",              "W m-2"      },
+  { 185, "srafs",          "net surf. solar radiation   (clear sky)",   "W m-2"      },
+  { 186, "trafs",          "net surf. thermal radiation (clear sky)",   "W m-2"      },
+  { 187, "sraf0",          "net top solar radiation     (clear sky)",   "W m-2"      },
+  { 188, "traf0",          "net top thermal radiation   (clear sky)",   "W m-2"      },
+  { 189, "sclfs",          "surface solar cloud forcing",               "W m-2"      },
+  { 190, "tclfs",          "surface thermal cloud forcing",             "W m-2"      },
+  { 191, "sclf0",          "SW top cloud forcing (178-187)",            "W m-2"      },
+  { 192, "tclf0",          "LW top cloud forcing (179-188)",            "W m-2"      },
+  { 193, "wl",             "skin reservoir content",                    "m"          },
+  { 194, "slf",            "sea land fraction",                          NULL        },
+  { 195, "ustrgw",         "u-gravity wave stress",                     "Pa"         },
+  { 196, "vstrgw",         "v-gravity wave stress",                     "Pa"         },
+  { 197, "vdisgw",         "gravity wave dissipation",                  "W m-2"      },
+  { 198, "vgrat",          "vegetation ratio",                           NULL        },
+  { 199, "orostd",         "orographic standard deviation",             "m"          },
+  { 200, "vlt",            "leaf area index",                            NULL        },
+  { 201, "t2max",          "maximum 2m-temperature",                    "K"          },
+  { 202, "t2min",          "minimum 2m-temperature",                    "K"          },
+  { 203, "srad0u",         "top solar radiation upward",                "W m-2"      },
+  { 204, "sradsu",         "surface solar radiation upward",            "W m-2"      },
+  { 205, "tradsu",         "surface thermal radiation upward",          "W m-2"      },
+  { 206, "grndflux",       "surface ground heat flux",                   NULL        },
+  { 207, "tsoil",          "deep soil temperatures (5 layers)",         "K"          },
+  { 208, "ahfcon",         "conductive heat flux through ice",          "W m-2"      },
+  { 209, "ahfres",         "melting of ice",                            "W m-2"      },
+  { 210, "seaice",         "ice cover (fraction of 1-SLM)",              NULL        },
+  { 211, "siced",          "ice depth",                                 "m"          },
+  { 212, "forest",         "forest fraction",                            NULL        },
+  { 213, "gld",            "glacier depth",                             "m"          },
+  { 214, "sni",            "water equivalent of snow on ice",           "m"          },
+  { 215, "rogl",           "glacier runoff",                            "kg m-2 s-1" },
+  { 216, "wimax",          "maximum 10m-wind speed",                    "m/s"        },
+  { 217, "topmax",         "maximum height of convective cloud tops",   "Pa"         },
+  { 218, "snmel",          "snow melt",                                 "kg m-2 s-1" },
+  { 219, "runtoc",         "surface runoff into ocean",                 "kg m-2 s-1" },
+  { 220, "runlnd",         "surface runoff not running into ocean",     "kg m-2 s-1" },
+  { 221, "apmegl",         "P-E over land ice",                         "kg m-2 s-1" },
+  { 222, "snacl",          "snow accumulation over land",               "kg m-2 s-1" },
+  { 223, "aclcac",         "cloud cover",                                NULL        },
+  { 224, "tke",            "turbulent kinetic energy",                  "m^2/s^2"    },
+  { 225, "tkem1",          "turbulent kinetic energy (t-1)",            "m^2/s^2"    },
+  { 226, "fao",            "FAO data set (soil data flags)",            "0...5"      },
+  { 227, "rgcgn",          "heat capacity of soil",                      NULL        },
+  { 228, "sodif",          "diffusivity of soil and land ice",          "m^2/s"      },
+  { 229, "wsmx",           "field capacity of soil",                    "m"          },
+  { 230, "qvi",            "vertically integrated water vapor",         "kg m-2"     },
+  { 231, "xlvi",           "vertically integrated cloud water",         "kg m-2"     },
+  { 232, "glac",           "fraction of land covered by glaciers",       NULL        },
+  { 233, "snc",            "snow depth at the canopy",                  "m"          },
+  { 234, "rtype",          "type of convection",                        "0...3"      },
+  { 235, "abso4",          "antropogenic sulfur burden",                "kg m-2"     },
+  { 236, "ao3",            "ipcc ozone",                                "kg m-2"     },
+  { 237, "tropo",          "WMO defined tropopause height",             "Pa"         },
+  { 259, "windspeed",      "windspeed (sqrt(u^2+v^2))",                 "m/s"        },
+  { 260, "precip",         "total precipitation  (142+143)",            "kg m-2 s-1" },
+  { 261, "net_top",        "total top radiation  (178+179)",            "W m-2"      },
+  { 262, "net_bot",        "total surface radiation (176+177)",         "W m-2"      },
+  { 272, "mastfru",        "mass stream function",                      "kg/s"       },
+};
+
+static PAR mpiom1[] = {
+  {   2, "THO",      "temperature",                     "C"        },
+  {   5, "SAO",      "salinity",                        "psu"      },
+  {   3, "UKO",      "zon. velocity",                   "m/s"      },
+  {   4, "VKE",      "mer. velocity",                   "m/s"      },
+  { 303, "UKOMFL",   "zon. velocity (divergence free)", "m/s"      },
+  { 304, "VKEMFL",   "mer. velocity (divergence free)", "m/s"      },
+  {   7, "WO",       "ver. velocity",                   "m/s"      },
+  {   8, "RHO",      "insitu density",                  "kg/m**3"  },
+  {   6, "PO",       "pressure",                        "Pa"       },
+  {  67, "EMINPO",   "freshwaterflux by restoring",     "m/s"      },
+  {  70, "FLUM",     "total heatflux",                  "W/m**2"   },
+  {  79, "PEM",      "total freshwaterflux",            "m/s"      },
+  {  13, "SICTHO",   "ice thickness",                   "m"        },
+  {  15, "SICOMO",   "ice compactness",                 "frac."    },
+  {  35, "SICUO",    "zon. ice velocity",               "m/s"      },
+  {  36, "SICVE",    "mer. ice velocity",               "m/s"      },
+  {  92, "TAFO",     "surface air temperature",         "C"        },
+  { 164, "FCLOU",    "cloud cover",                      NULL      },
+  {  52, "TXO",      "surface u-stress",                "Pa/1025." },
+  {  53, "TYE",      "surface v-stress",                "Pa/1025." },
+  { 260, "FPREC",    "prescr. precipitation",           "m/s"      },
+  {  80, "FSWR",     "downward shortwave rad.",         "W/m**2"   },
+  {  81, "FTDEW",    "dewpoint temperature",            "K"        },
+  { 171, "FU10",     "10m windspeed",                   "m/s"      },
+  { 141, "SICSNO",   "snow thickness",                  "m"        },
+  { 176, "QSWO",     "heat flux shortwave",             "W/m**2"   },
+  { 177, "QLWO",     "heat flux longwave",              "W/m**2"   },
+  { 147, "QLAO",     "heat flux latent",                "W/m**2"   },
+  { 146, "QSEO",     "heat flux sensible",              "W/m**2"   },
+  {  65, "PRECO",    "net freshwater flux + runoff",    "m/s"      },
+  {   1, "ZO",       "sealevel",                        "m"        },
+  {  82, "Z1O",      "sealevel change",                 "m"        },
+  {  69, "KCONDEP",  "depth of convection",             "level"    },
+  {  27, "PSIUWE",   "hor. bar. streamfunction",        "Sv"       },
+  {  83, "AMLD",     "mixed layer depth",               "m"        },
+  { 172, "WETO",     "landseamask (pressure points)",    NULL      },
+  { 507, "AMSUE",    "landseamask (vector points v)",    NULL      },
+  { 508, "AMSUO",    "landseamask (vector points u)",    NULL      },
+  {  84, "DEPTO",    "depth at pressure points",        "m"        },
+  { 484, "DEUTO",    "depth at vector points (u)",      "m"        },
+  { 584, "DEUTE",    "depth at vector points (v)",      "m"        },
+  { 184, "DDUO",     "level thickness (vector u )",     "m"        },
+  { 284, "DDUE",     "level thickness (vector v )",     "m"        },
+  { 384, "DDPO",     "level thickness (pressure )",     "m"        },
+  {  85, "DLXP",     "grid distance x",                 "m"        },
+  {  86, "DLYP",     "grid distance y",                 "m"        },
+  { 185, "DLXU",     "grid distance x  (vector u)",     "m"        },
+  { 186, "DLYU",     "grid distance y  (vector u)",     "m"        },
+  { 285, "DLXV",     "grid distance x  (vector v)",     "m"        },
+  { 286, "DLYV",     "grid distance y  (vector v)",     "m"        },
+  {  54, "GILA",     "latitude in radiants",            "rad"      },
+  {  55, "GIPH",     "longitude in radiants",           "rad"      },
+  { 354, "ALAT",     "latitude in degrees (pressure)",  "deg"      },
+  { 355, "ALON",     "longitude in degrees (pressure)", "deg"      },
+  { 154, "ALATU",    "latitude in degrees (vector u)",  "deg"      },
+  { 155, "ALONU",    "longitude in degrees (vector u)", "deg"      },
+  { 254, "ALATV",    "latitude in degrees (vector v)",  "deg"      },
+  { 255, "ALONV",    "longitude in degrees (vector v)", "deg"      },
+  { 110, "AVO",      "vertical impuls diffusion",       "m**2/s"   },
+  { 111, "DVO",      "vertical T,S diffusion",          "m**2/s"   },
+  { 142, "SICTRU",   "seaice transport x",              "m**2/s"   },
+  { 143, "SICTRV",   "seaice transport y",              "m**2/s"   },
+  { 612, "WTMIX",    "wind mixing",                     "m**2/s"   },
+  { 183, "zmld",     "mixed layer depth (SJ)",          "m"        },
+  { 207, "WGO",      "GM vertical velocity",            "m/s"      },
+  { 305, "rivrun",   "RiverRunoff",                     "m/s"      },
+  { 158, "TMCDO",    "mon. mean depth of convection",   "level"    },
+  { 247, "DQSWO",    "heatflux sw over water",          "W/m**2"   },
+  { 248, "DQLWO",    "heatflux lw over water",          "W/m**2"   },
+  { 249, "DQSEO",    "heatflux se over water",          "W/m**2"   },
+  { 250, "DQLAO",    "heatflux la over water",          "W/m**2"   },
+  { 251, "DQTHO",    "heatflux net over water",         "W/m**2"   },
+  { 252, "DQSWI",    "heatflux sw over seaice",         "W/m**2"   },
+  { 253, "DQLWI",    "heatflux lw over seaice",         "W/m**2"   },
+  { 254, "DQSEI",    "heatflux se over seaice",         "W/m**2"   },
+  { 255, "DQLAI",    "heatflux la over seaice",         "W/m**2"   },
+  { 256, "DQTHI",    "heatflux net over seaice",        "W/m**2"   },
+  { 257, "DTICEO",   "Equi. temp over seaice",          "K"        },
+  { 270, "AOFLNHWO", "oasis net heat flux water",       "W/m**2"   },
+  { 271, "AOFLSHWO", "oasis downward short wave",       "W/m**2"   },
+  { 272, "AOFLRHIO", "oasis residual heat flux ice",    "W/m**2"   },
+  { 273, "AOFLCHIO", "oasis conduct. heat flux ice",    "W/m**2"   },
+  { 274, "AOFLFRWO", "oasis fluid fresh water flux",    "m/s"      },
+  { 275, "AOFLFRIO", "oasis solid fresh water flux",    "m/s"      },
+  { 276, "AOFLTXWO", "oasis wind stress water x",       "Pa/102"   },
+  { 277, "AOFLTYWO", "oasis wind stress water y",       "Pa/102"   },
+  { 278, "AOFLTXIO", "oasis wind stress ice x",         "Pa/102"   },
+  { 279, "AOFLTYIO", "oasis wind stress ice x",         "Pa/102"   },
+  { 280, "AOFLWSVO", "oasis wind speed",                "m/s"      },
+};
+
+static PAR ecmwf[] = {
+  {   1, "STRF",   "Stream function",                                            "m**2 s**-1"            },
+  {   2, "VPOT",   "Velocity potential",                                         "m**2 s**-1"            },
+  {   3, "PT",     "Potential temperature",                                      "K"                     },
+  {   4, "EQPT",   "Equivalent potential temperature",                           "K"                     },
+  {   5, "SEPT",   "Saturated equivalent potential temperature",                 "K"                     },
+  {  11, "UDVW",   "U component of divergent wind",                              "m s**-1"               },
+  {  12, "VDVW",   "V component of divergent wind",                              "m s**-1"               },
+  {  13, "URTW",   "U component of rotational wind",                             "m s**-1"               },
+  {  14, "VRTW",   "V component of rotational wind",                             "m s**-1"               },
+  {  21, "UCTP",   "Unbalanced component of temperature",                        "K"                     },
+  {  22, "UCLN",   "Unbalanced component of logarithm of surface pressure",       NULL                   },
+  {  23, "UCDV",   "Unbalanced component of divergence",                         "s**-1"                 },
+  {  26, "CL",     "Lake cover",                                                  NULL                   },
+  {  27, "CVL",    "Low vegetation cover",                                        NULL                   },
+  {  28, "CVH",    "High vegetation cover",                                       NULL                   },
+  {  29, "TVL",    "Type of low vegetation",                                      NULL                   },
+  {  30, "TVH",    "Type of high vegetation",                                     NULL                   },
+  {  31, "CI",     "Sea-ice cover",                                               NULL                   },
+  {  32, "ASN",    "Snow albedo",                                                 NULL                   },
+  {  33, "RSN",    "Snow density kg",                                            "m**-3"                 },
+  {  34, "SSTK",   "Sea surface temperature",                                    "K"                     },
+  {  35, "ISTL1",  "Ice surface temperature layer 1",                            "K"                     },
+  {  36, "ISTL2",  "Ice surface temperature layer 2",                            "K"                     },
+  {  37, "ISTL3",  "Ice surface temperature layer 3",                            "K"                     },
+  {  38, "ISTL4",  "Ice surface temperature layer 4",                            "K"                     },
+  {  39, "SWVL1",  "Volumetric soil water layer 1",                              "m**3 m**-3"            },
+  {  40, "SWVL2",  "Volumetric soil water layer 2",                              "m**3 m**-3"            },
+  {  41, "SWVL3",  "Volumetric soil water layer 3",                              "m**3 m**-3"            },
+  {  42, "SWVL4",  "Volumetric soil water layer 4",                              "m**3 m**-3"            },
+  {  43, "SLT",    "Soil type",                                                   NULL                   },
+  {  44, "ES",     "Snow evaporation m of water",                                 NULL                   },
+  {  45, "SMLT",   "Snowmelt m of water",                                         NULL                   },
+  {  46, "SDUR",   "Solar duration",                                             "s"                     },
+  {  47, "DSRP",   "Direct solar radiation",                                     "w m**-2"               },
+  {  48, "MAGSS",  "Magnitude of surface stress",                                "N m**-2 s"             },
+  {  49, "WG10",   "Wind gust at 10 metres",                                     "m s**-1"               },
+  {  50, "LSPF",   "Large-scale precipitation fraction",                         "s"                     },
+  {  51, "MX2T24", "Maximum 2 metre temperature",                                "K"                     },
+  {  52, "MN2T24", "Minimum 2 metre temperature",                                "K"                     },
+  {  53, "MONT",   "Montgomery potential",                                       "m**2 s**-2"            },
+  {  54, "PRES",   "Pressure",                                                   "Pa"                    },
+  {  55, "MN2T24", "Mean 2 metre temperature past 24 hours",                     "K"                     },
+  {  56, "MN2D24", "Mean 2 metre dewpoint temperature past 24 hours",            "K"                     },
+  {  60, "PV",     "Potential vorticity",                                        "K m**2 kg**-1 s**-1"   },
+  { 127, "AT",     "Atmospheric tide",                                            NULL                   },
+  { 128, "BV",     "Budget values",                                               NULL                   },
+  { 129, "Z",      "Geopotential",                                               "m**2 s**-2"            },
+  { 130, "T",      "Temperature",                                                "K"                     },
+  { 131, "U",      "U velocity",                                                 "m s**-1"               },
+  { 132, "V",      "V velocity",                                                 "m s**-1"               },
+  { 133, "Q",      "Specific humidity",                                          "kg kg**-1"             },
+  { 134, "SP",     "Surface pressure",                                           "Pa"                    },
+  { 135, "W",      "Vertical velocity",                                          "Pa s**-1"              },
+  { 136, "TCW",    "Total column water",                                         "kg m**-2"              },
+  { 137, "TCWV",   "Total column water vapour",                                  "kg m**-2"              },
+  { 138, "VO",     "Vorticity (relative)",                                       "s**-1"                 },
+  { 139, "STL1",   "Soil temperature level 1",                                   "K"                     },
+  { 140, "SWL1",   "Soil wetness level 1 m of water",                             NULL                   },
+  { 141, "SD",     "Snow depth         1 m of water equivalent",                  NULL                   },
+  { 142, "LSP",    "Stratiform precipitation (Large scale precipitation)",       "m"                     },
+  { 143, "CP",     "Convective precipitation",                                   "m"                     },
+  { 144, "SF",     "Snowfall (convective + stratiform)",                         "m"                     },
+  { 145, "BLD",    "Boundary layer dissipation",                                 "W m**-2 s"             },
+  { 146, "SSHF",   "Surface sensible heat flux",                                 "W m**-2 s"             },
+  { 147, "SLHF",   "Surface latent heat flux",                                   "W m**-2 s"             },
+  { 148, "CHNK",   "Charnock",                                                    NULL                   },
+  { 149, "SNR",    "Surface net radiation",                                      "W m**-2 s"             },
+  { 150, "TNR",    "Top net radiation",                                           NULL                   },
+  { 151, "MSL",    "Mean sea-level pressure",                                    "Pa"                    },
+  { 152, "LNSP",   "Logarithm of surface pressure",                               NULL                   },
+  { 153, "SWHR",   "Short-wave heating rate",                                    "K"                     },
+  { 154, "LWHR",   "Long-wave heating rate",                                     "K"                     },
+  { 155, "D",      "Divergence",                                                 "s**-1"                 },
+  { 156, "GH",     "Height m Geopotential height",                                NULL                   },
+  { 157, "R",      "Relative humidity",                                          "%"                     },
+  { 158, "TSP",    "Tendency of surface pressure",                               "Pa s**-1"              },
+  { 159, "BLH",    "Boundary layer height",                                      "m"                     },
+  { 160, "SDOR",   "Standard deviation of orography",                             NULL                   },
+  { 161, "ISOR",   "Anisotropy of sub-gridscale orography",                       NULL                   },
+  { 162, "ANOR",   "Angle of sub-gridscale orography",                           "rad"                   },
+  { 163, "SLOR",   "Slope of sub-gridscale orography",                            NULL                   },
+  { 164, "TCC",    "Total cloud cover",                                           NULL                   },
+  { 165, "U10M",   "10 metre U wind component",                                  "m s**-1"               },
+  { 166, "V10M",   "10 metre V wind component",                                  "m s**-1"               },
+  { 167, "T2M",    "2 metre temperature",                                        "K"                     },
+  { 168, "D2M",    "2 metre dewpoint temperature",                               "K"                     },
+  { 169, "SSRD",   "Surface solar radiation downwards",                          "W m**-2 s"             },
+  { 170, "STL2",   "Soil temperature level 2",                                   "K"                     },
+  { 171, "SWL2",   "Soil wetness level 2",                                       "m of water"            },
+  { 172, "LSM",    "Land/sea mask",                                               NULL                   },
+  { 173, "SR",     "Surface roughness",                                          "m"                     },
+  { 174, "AL",     "Albedo",                                                      NULL                   },
+  { 175, "STRD",   "Surface thermal radiation downwards",                        "W m**-2 s"             },
+  { 176, "SSR",    "Surface solar radiation",                                    "W m**-2 s"             },
+  { 177, "STR",    "Surface thermal radiation",                                  "W m**-2 s"             },
+  { 178, "TSR",    "Top solar radiation",                                        "W m**-2 s"             },
+  { 179, "TTR",    "Top thermal radiation",                                      "W m**-2 s"             },
+  { 180, "EWSS",   "East/West surface stress",                                   "N m**-2 s"             },
+  { 181, "NSSS",   "North/South surface stress",                                 "N m**-2 s"             },
+  { 182, "E",      "Evaporation",                                                "m of water"            },
+  { 183, "STL3",   "Soil temperature level 3",                                   "K"                     },
+  { 184, "SWL3",   "Soil wetness level 3",                                       "m of water"            },
+  { 185, "CCC",    "Convective cloud cover",                                      NULL                   },
+  { 186, "LCC",    "Low cloud cover",                                             NULL                   },
+  { 187, "MCC",    "Medium cloud cover",                                          NULL                   },
+  { 188, "HCC",    "High cloud cover",                                            NULL                   },
+  { 189, "SUND",   "Sunshine duration",                                          "s"                     },
+  { 190, "EWOV",   "EW component of subgrid orographic variance",                "m**2"                  },
+  { 191, "NSOV",   "NS component of subgrid orographic variance",                "m**2"                  },
+  { 192, "NWOV",   "NWSE component of subgrid orographic variance",              "m**2"                  },
+  { 193, "NEOV",   "NESW component of subgrid orographic variance",              "m**2"                  },
+  { 194, "BTMP",   "Brightness temperature",                                     "K"                     },
+  { 195, "LGWS",   "Lat. component of gravity wave stress",                      "N m**-2 s"             },
+  { 196, "MGWS",   "Meridional component of gravity wave stress",                "N m**-2 s"             },
+  { 197, "GWD",    "Gravity wave dissipation",                                   "W m**-2 s"             },
+  { 198, "SRC",    "Skin reservoir content",                                     "m of water"            },
+  { 199, "VEG",    "Vegetation fraction",                                         NULL                   },
+  { 200, "VSO",    "Variance of sub-gridscale orography",                        "m**2"                  },
+  { 201, "MX2T",   "Maximum 2 metre temperature since previous post-processing", "K"                     },
+  { 202, "MN2T",   "Minimum 2 metre temperature since previous post-processing", "K"                     },
+  { 203, "O3",     "Ozone mass mixing ratio",                                    "kg kg**-1"             },
+  { 204, "PAW",    "Precipiation analysis weights",                               NULL                   },
+  { 205, "RO",     "Runoff",                                                     "m"                     },
+  { 206, "TCO3",   "Total column ozone",                                         "kg m**-2"              },
+  { 207, "WS10",   "10 meter windspeed",                                         "m s**-1"               },
+  { 208, "TSRC",   "Top net solar radiation, clear sky",                         "W m**-2"               },
+  { 209, "TTRC",   "Top net thermal radiation, clear sky",                       "W m**-2"               },
+  { 210, "SSRC",   "Surface net solar radiation, clear sky",                     "W m**-2"               },
+  { 211, "STRC",   "Surface net thermal radiation, clear sky",                   "W m**-2"               },
+  { 212, "SI",     "Solar insolation",                                           "W m**-2"               },
+  { 214, "DHR",    "Diabatic heating by radiation",                              "K"                     },
+  { 215, "DHVD",   "Diabatic heating by vertical diffusion",                     "K"                     },
+  { 216, "DHCC",   "Diabatic heating by cumulus convection",                     "K"                     },
+  { 217, "DHLC",   "Diabatic heating large-scale condensation",                  "K"                     },
+  { 218, "VDZW",   "Vertical diffusion of zonal wind",                           "m s**-1"               },
+  { 219, "VDMW",   "Vertical diffusion of meridional wind",                      "m s**-1"               },
+  { 220, "EWGD",   "EW gravity wave drag tendency",                              "m s**-1"               },
+  { 221, "NSGD",   "NS gravity wave drag tendency",                              "m s**-1"               },
+  { 222, "CTZW",   "Convective tendency of zonal wind",                          "m s**-1"               },
+  { 223, "CTMW",   "Convective tendency of meridional wind",                     "m s**-1"               },
+  { 224, "VDH",    "Vertical diffusion of humidity",                             "kg kg**-1"             },
+  { 225, "HTCC",   "Humidity tendency by cumulus convection",                    "kg kg**-1"             },
+  { 226, "HTLC",   "Humidity tendency large-scale condensation",                 "kg kg**-1"             },
+  { 227, "CRNH",   "Change from removing negative humidity",                     "kg kg**-1"             },
+  { 228, "TP",     "Total precipitation",                                        "m"                     },
+  { 229, "IEWS",   "Instantaneous X surface stress",                             "N m**-2"               },
+  { 230, "INSS",   "Instantaneous Y surface stress",                             "N m**-2"               },
+  { 231, "ISHF",   "Instantaneous surface heat flux",                            "W m**-2"               },
+  { 232, "IE",     "Instantaneous moisture flux",                                "kg m**-2 s"            },
+  { 233, "ASQ",    "Apparent surface humidity",                                  "kg kg**-1"             },
+  { 234, "LSRH",   "Logarithm of surface roughness length for heat",              NULL                   },
+  { 235, "SKT",    "Skin temperature",                                           "K"                     },
+  { 236, "STL4",   "Soil temperature level 4",                                   "K"                     },
+  { 237, "SWL4",   "Soil wetness level 4",                                       "m"                     },
+  { 238, "TSN",    "Temperature of snow layer",                                  "K"                     },
+  { 239, "CSF",    "Convective snowfall",                                        "m of water equivalent" },
+  { 240, "LSF",    "Large-scale snowfall",                                       "m of water equivalent" },
+  { 241, "ACF",    "Accumulated cloud fraction tendency",                         NULL                   },
+  { 242, "ALW",    "Accumulated liquid water tendency",                           NULL                   },
+  { 243, "FAL",    "Forecast albedo",                                             NULL                   },
+  { 244, "FSR",    "Forecast surface roughness",                                 "m"                     },
+  { 245, "FLSR",   "Forecast log of surface roughness for heat",                  NULL                   },
+  { 246, "CLWC",   "Cloud liquid water content",                                 "kg kg**-1"             },
+  { 247, "CIWC",   "Cloud ice water content",                                    "kg kg**-1"             },
+  { 248, "CC",     "Cloud cover",                                                 NULL                   },
+  { 249, "AIW",    "Accumulated ice water tendency",                              NULL                   },
+  { 250, "ICE",    "Ice age",                                                     NULL                   },
+  { 251, "ATTE",   "Adiabatic tendency of temperature",                          "K"                     },
+  { 252, "ATHE",   "Adiabatic tendency of humidity",                             "kg kg**-1"             },
+  { 253, "ATZE",   "Adiabatic tendency of zonal wind",                           "m s**-1"               },
+  { 254, "ATMW",   "Adiabatic tendency of meridional wind",                      "m s**-1"               },
+};
+
+static PAR remo[] = {
+  {  14, "FTKVM",     "turbulent transfer coefficient of momentum in the atmosphere",   NULL           },
+  {  15, "FTKVH",     "turbulent transfer coefficient of heat in the atmosphere",       NULL           },
+  {  38, "U10ER",     "10m u-velocity",                                                "m/s"           },
+  {  39, "V10ER",     "10m v-velocity",                                                "m/s"           },
+  {  40, "CAPE",      "convetive available potential energy",                           NULL           },
+  {  41, "GHPBL",     "height of the planetary boudary layer",                         "gpm"           },
+  {  42, "BETA",      "BETA",                                                           NULL           },
+  {  43, "WMINLOK",   "WMINLOK",                                                        NULL           },
+  {  44, "WMAXLOK",   "WMAXLOK",                                                        NULL           },
+  {  45, "VBM10M",    "maximum of the expected gust velocity near the surface",        "m/s"           },
+  {  46, "BFLHS",     "surface sensible heat flux",                                    "W/m**2"        },
+  {  47, "BFLQDS",    "surface latent heat flux",                                      "W/m**2"        },
+  {  48, "TMCM",      "turbulent transfer coefficient of momentum at the surface",      NULL           },
+  {  49, "TRSOL",     "TRSOL",                                                          NULL           },
+  {  50, "TMCH",      "turbulent transfer coefficient of heat at the surface",          NULL           },
+  {  51, "EMTEF",     "EMTEF",                                                          NULL           },
+  {  52, "TRSOF",     "TRSOF",                                                          NULL           },
+  {  53, "DRAIN",     "drainage",                                                      "mm"            },
+  {  54, "TSL",       "surface temperature (land)",                                    "K"             },
+  {  55, "TSW",       "surface temperature (water)",                                   "K"             },
+  {  56, "TSI",       "surface temperature (ice)",                                     "K"             },
+  {  57, "USTRL",     "surface u-stress (land)",                                       "Pa"            },
+  {  58, "USTRW",     "surface u-stress (water)",                                      "Pa"            },
+  {  59, "USTRI",     "surface u-stress (ice)",                                        "Pa"            },
+  {  60, "VSTRL",     "surface v-stress (land)",                                       "Pa"            },
+  {  61, "VSTRW",     "surface v-stress (water)",                                      "Pa"            },
+  {  62, "VSTRI",     "surface v-stress (ice)",                                        "Pa"            },
+  {  63, "EVAPL",     "surface evaporation (land)",                                    "mm"            },
+  {  64, "EVAPW",     "surface evaporation (water)",                                   "mm"            },
+  {  65, "EVAPI",     "surface evaporation (ice)",                                     "mm"            },
+  {  66, "AHFLL",     "surface latent heat flux (land)",                               "W/m**2"        },
+  {  67, "AHFLW",     "surface latent heat flux (water)",                              "W/m**2"        },
+  {  68, "AHFLI",     "surface latent heat flux (ice)",                                "W/m**2"        },
+  {  69, "AHFSL",     "surface sensible heat flux (land)",                             "W/m**2"        },
+  {  70, "AHFSW",     "surface sensible heat flux (water)",                            "W/m**2"        },
+  {  71, "AHFSI",     "surface sensible heat flux (ice)",                              "W/m**2"        },
+  {  72, "AZ0L",      "surface roughness length (land)",                               "m"             },
+  {  73, "AZ0W",      "surface roughness length (water)",                              "m"             },
+  {  74, "AZ0I",      "surface roughness length (ice)",                                "m"             },
+  {  75, "ALSOL",     "surface albedo (land)",                                         "fract."        },
+  {  76, "ALSOW",     "surface albedo (water)",                                        "fract."        },
+  {  77, "ALSOI",     "surface albedo (ice)",                                          "fract."        },
+  {  81, "TMCHL",     "turbulent transfer coefficient of heat at the surface (land)",   NULL           },
+  {  82, "TMCHW",     "turbulent transfer coefficient of heat at the surface (water)",  NULL           },
+  {  83, "TMCHI",     "turbulent transfer coefficient of heat at the surface (ice)",    NULL           },
+  {  84, "QDBL",      "specific humidity surface (land)",                              "kg/kg"         },
+  {  85, "QDBW",      "specific humidity surface (water)",                             "kg/kg"         },
+  {  86, "QDBI",      "specific humidity surface (ice)",                               "kg/kg"         },
+  {  87, "BFLHSL",    "surface sensible heat flux (land)",                             "W/m**2"        },
+  {  88, "BFLHSW",    "surface sensible heat flux (water)",                            "W/m**2"        },
+  {  89, "BFLHSI",    "surface sensible heat flux (ice)",                              "W/m**2"        },
+  {  90, "BFLQDSL",   "surface latent heat flux (land)",                               "W/m**2"        },
+  {  91, "BFLQDSW",   "surface latent heat flux (water)",                              "W/m**2"        },
+  {  92, "BFLQDSI",   "surface latent heat flux (ice)",                                "W/m**2"        },
+  {  93, "AHFICE",    "sea-ice: conductive heat",                                      "W/m"           },
+  {  94, "QRES",      "residual heat flux for melting sea ice",                        "W/m**2"        },
+  {  95, "SRFL",      "SRFL",                                                           NULL           },
+  {  96, "QDBOXS",    "horizontal transport of water vapour",                          "kg/m**2"       },
+  {  97, "QWBOXS",    "horizontal transport of cloud water",                           "kg/m**2"       },
+  {  98, "EKBOXS",    "horizontal transport of kinetic energy",                        "(3600*J)/m**2" },
+  {  99, "FHBOXS",    "horizontal transport of sensible heat",                         "(3600*J)/m**2" },
+  { 100, "FIBOXS",    "horizontal transport of potential energy",                      "(3600*J)/m**2" },
+  { 101, "TLAMBDA",   "heat conductivity of dry soil",                                 "W/(K*m)"       },
+  { 103, "DLAMBDA",   "parameter for increasing the heat conductivity of the soil",     NULL           },
+  { 104, "PORVOL",    "pore volume",                                                    NULL           },
+  { 105, "FCAP",      "field capacity of soil",                                         NULL           },
+  { 106, "WI3",       "fraction of frozen soil",                                        NULL           },
+  { 107, "WI4",       "fraction of frozen soil",                                        NULL           },
+  { 108, "WI5",       "fraction of frozen soil",                                        NULL           },
+  { 109, "WI",        "fraction of frozen soil",                                        NULL           },
+  { 110, "WICL",      "fraction of frozen soil",                                        NULL           },
+  { 112, "QDB",       "specific humidity surface",                                     "kg/kg"         },
+  { 129, "FIB",       "surface geopotential (orography)",                              "m"             },
+  { 130, "T",         "temperature",                                                   "K"             },
+  { 131, "U",         "u-velocity",                                                    "m/s"           },
+  { 132, "V",         "v-velocity",                                                    "m/s"           },
+  { 133, "QD",        "specific humidity",                                             "kg/kg"         },
+  { 134, "PS",        "Surface pressure",                                              "Pa"            },
+  { 135, "VERVEL",    "Vertical velocity",                                             "Pa/s"          },
+  { 138, "SVO",       "vorticity",                                                     "1/s"           },
+  { 139, "TS",        "surface temperature",                                           "K"             },
+  { 140, "WS",        "soil wetness",                                                  "m"             },
+  { 141, "SN",        "snow depth",                                                    "m"             },
+  { 142, "APRL",      "large scale precipitation",                                     "mm"            },
+  { 143, "APRC",      "convective  precipitation",                                     "mm"            },
+  { 144, "APRS",      "snow fall",                                                     "mm"            },
+  { 145, "VDIS",      "boundary layer dissipation",                                    "W/m**2"        },
+  { 146, "AHFS",      "surface sensible heat flux",                                    "W/m**2"        },
+  { 147, "AHFL",      "surface latent heat flux",                                      "W/m**2"        },
+  { 148, "STREAM",    "streamfunction",                                                "m**2/s"        },
+  { 149, "VELOPOT",   "velocity potential",                                            "m**2/s"        },
+  { 151, "PSRED",     "mean sea level pressure",                                       "Pa"            },
+  { 152, "LSP",       "log surface pressure",                                           NULL           },
+  { 153, "QW",        "liquid water content",                                          "kg/kg"         },
+  { 155, "SD",        "divergence",                                                    "1/s"           },
+  { 156, "FI",        "geopotential height",                                           "gpm"           },
+  { 159, "USTAR3",    "ustar**3",                                                      "m**3/s**3"     },
+  { 160, "RUNOFF",    "surface runoff",                                                "mm"            },
+  { 162, "ACLC",      "cloud cover",                                                   "fract."        },
+  { 163, "ACLCV",     "total cloud cover",                                             "fract."        },
+  { 164, "ACLCOV",    "total cloud cover",                                             "fract."        },
+  { 165, "U10",       "10m u-velocity",                                                "m/s"           },
+  { 166, "V10",       "10m v-velocity",                                                "m/s"           },
+  { 167, "TEMP2",     "2m temperature",                                                "K"             },
+  { 168, "DEW2",      "2m dew point temperature",                                      "K"             },
+  { 169, "TSURF",     "surface temperature (land)",                                    "K"             },
+  { 170, "TD",        "deep soil temperature",                                         "K"             },
+  { 171, "WIND10",    "10m windspeed",                                                 "m/s"           },
+  { 172, "BLA",       "land sea mask",                                                 "fract."        },
+  { 173, "AZ0",       "surface roughness length",                                      "m"             },
+  { 174, "ALB",       "surface background albedo",                                     "fract."        },
+  { 175, "ALBEDO",    "surface albedo",                                                "fract."        },
+  { 176, "SRADS",     "net surface solar radiation",                                   "W/m**2"        },
+  { 177, "TRADS",     "net surface thermal radiation",                                 "W/m**2"        },
+  { 178, "SRAD0",     "net top solar radiation",                                       "W/m**2"        },
+  { 179, "TRAD0",     "top thermal radiation (OLR)",                                   "W/m**2"        },
+  { 180, "USTR",      "surface u-stress",                                              "Pa"            },
+  { 181, "VSTR",      "surface v-stress",                                              "Pa"            },
+  { 182, "EVAP",      "surface evaporation",                                           "mm"            },
+  { 183, "TDCL",      "soil temperature",                                              "K"             },
+  { 185, "SRAFS",     "net surf. solar radiation   (clear sky)",                       "W/m**2"        },
+  { 186, "TRAFS",     "net surf. thermal radiation (clear sky)",                       "W/m**2"        },
+  { 187, "SRAF0",     "net top solar radiation     (clear sky)",                       "W/m**2"        },
+  { 188, "TRAF0",     "net top thermal radiation   (clear sky)",                       "W/m**2"        },
+  { 189, "SCLFS",     "surface solar cloud forcing",                                   "W/m**2"        },
+  { 190, "TCLFS",     "surface thermal cloud forcing",                                 "W/m**2"        },
+  { 191, "SCLF0",     "top solar cloud forcing",                                       "W/m**2"        },
+  { 192, "TCLF0",     "top thermal cloud forcing",                                     "W/m**2"        },
+  { 194, "WL",        "skin reservoir content",                                        "m"             },
+  { 195, "USTRGW",    "u-gravity wave stress",                                         "Pa"            },
+  { 196, "VSTRGW",    "v-gravity wave stress",                                         "Pa"            },
+  { 197, "VDISGW",    "gravity wave dissipation",                                      "W/m**2"        },
+  { 198, "VGRAT",     "vegetation ratio",                                               NULL           },
+  { 199, "VAROR",     "orographic variance (for surface runoff)",                       NULL           },
+  { 200, "VLT",       "leaf area index",                                                NULL           },
+  { 201, "T2MAX",     "maximum 2m-temperature",                                        "K"             },
+  { 202, "T2MIN",     "minimum 2m-temperature",                                        "K"             },
+  { 203, "SRAD0U",    "top solar radiation upward",                                    "W/m**2"        },
+  { 204, "SRADSU",    "surface solar radiation upward",                                "W/m**2"        },
+  { 205, "TRADSU",    "surface thermal radiation upward",                              "W/m**2"        },
+  { 206, "TSN",       "snow temperature",                                              "K"             },
+  { 207, "TD3",       "soil temperature",                                              "K"             },
+  { 208, "TD4",       "soil temperature",                                              "K"             },
+  { 209, "TD5",       "soil temperature",                                              "K"             },
+  { 210, "SEAICE",    "sea ice cover",                                                 "fract."        },
+  { 211, "SICED",     "sea ice depth",                                                 "m"             },
+  { 212, "FOREST",    "vegetation type",                                                NULL           },
+  { 213, "TEFF",      "(effective) sea-ice skin temperature",                          "K"             },
+  { 214, "TSMAX",     "maximum surface temperature",                                   "K"             },
+  { 215, "TSMIN",     "minimum surface temperature",                                   "K"             },
+  { 216, "WIMAX",     "maximum 10m-wind speed",                                        "m/s"           },
+  { 217, "TOPMAX",    "maximum height of convective cloud tops",                       "Pa"            },
+  { 218, "SNMEL",     "snow melt",                                                     "mm"            },
+  { 220, "TSLIN",     "land: residual surface heat budget",                            "W/m**2"        },
+  { 221, "DSNAC",     "snow depth change",                                             "mm"            },
+  { 222, "EMTER",     "EMTER",                                                          NULL           },
+  { 223, "ACLCAC",    "cloud cover",                                                   "fract."        },
+  { 224, "TKE",       "turbulent kinetic energy",                                       NULL           },
+  { 226, "FAO",       "FAO data set (soil data flags)",                                 NULL           },
+  { 227, "RGCGN",     "heat capacity of soil",                                          NULL           },
+  { 229, "WSMX",      "field capacity of soil",                                         NULL           },
+  { 230, "QVI",       "vertically integrated specific humidity",                       "kg/m**2"       },
+  { 231, "ALWCVI",    "vertically integrated liquid water cont.",                      "kg/m**2"       },
+  { 232, "GLAC",      "glacier mask",                                                   NULL           },
+  { 253, "PHI",       "latitude in real coordinates",                                  "degrees_north" },
+  { 254, "RLA",       "longitude in real coordinates",                                 "degrees_east"  },
+  { 259, "WINDSPEED", "windspeed (sqrt(u**2+v**2))",                                    NULL           },
+  { 260, "PRECIP",    "total precipitation",                                            NULL           },
+};
+
+static PAR cosmo002[] = {
+  {   1, "P",         "pressure",                                          "Pa"         },
+  {   2, "PMSL",      "mean sea level pressure",                           "Pa"         },
+  {   3, "DPSDT",     "surface pressure change",                           "Pa s-1"     },
+  {   6, "FI",        "geopotential",                                      "m2 s-2"     },
+  {   8, "HH",        "height",                                            "m"          },
+  {  10, "TO3",       "vertical integrated ozone content",                 "Dobson"     },
+  {  11, "T",         "temperature",                                       "K"          },
+  {  15, "TMAX",      "2m maximum temperature",                            "K"          },
+  {  16, "TMIN",      "2m minimum temperature",                            "K"          },
+  {  17, "TD",        "2m dew point temperature",                          "K"          },
+  {  31, "DD",        "undefined",                                         "undefined"  },
+  {  32, "FF",        "undefined",                                         "undefined"  },
+  {  33, "U",         "U-component of wind",                               "m s-1"      },
+  {  34, "V",         "V-component of wind",                               "m s-1"      },
+  {  39, "OMEGA",     "omega",                                             "Pa s-1"     },
+  {  40, "W",         "vertical wind velocity",                            "m s-1"      },
+  {  51, "QV",        "specific humidity",                                 "kg kg-1"    },
+  {  52, "RELHUM",    "relative humidity",                                 "%"          },
+  {  54, "TQV",       "precipitable water",                                "kg m-2"     },
+  {  57, "AEVAP",     "surface evaporation",                               "kg m-2"     },
+  {  58, "TQI",       "vertical integrated cloud ice",                     "kg m-2"     },
+  {  59, "TOT_PR",    "total precipitation rate",                          "kg m-2 s-1" },
+  {  61, "TOT_PREC",  "total precipitation amount",                        "kg m-2"     },
+  {  65, "W_SNOW",    "surface snow amount",                               "m"          },
+  {  66, "H_SNOW",    "thickness of snow",                                 "m"          },
+  {  71, "CLCT",      "total cloud cover",                                 "1"          },
+  {  72, "CLC_CON",   "convective cloud area fraction",                    "1"          },
+  {  73, "CLCL",      "low cloud cover",                                   "1"          },
+  {  74, "CLCM",      "medium cloud cover",                                "1"          },
+  {  75, "CLCH",      "high cloud cover",                                  "1"          },
+  {  76, "TQC",       "vertical integrated cloud water",                   "kg m-2"     },
+  {  78, "SNOW_CON",  "convective snowfall",                               "kg m-2"     },
+  {  79, "SNOW_GSP",  "large scale snowfall",                              "kg m-2"     },
+  {  81, "FR_LAND",   "land-sea fraction",                                 "1"          },
+  {  83, "Z0",        "surface roughness length",                          "m"          },
+  {  84, "ALB_RAD",   "surface albedo",                                    "1"          },
+  {  85, "TSOIL",     "soil surface temperature",                          "K"          },
+  {  86, "WSOIL",     "water content of 1. soil layer",                    "m"          },
+  {  87, "PLCOV",     "vegetation area fraction",                          "1"          },
+  {  90, "RUNOFF",    "subsurface runoff",                                 "kg m-2"     },
+  {  91, "FR_ICE",    "sea ice area fraction",                             "1"          },
+  {  92, "H_ICE",     "sea ice thickness",                                 "m"          },
+  { 111, "ASOB",      "averaged surface net downward shortwave radiation", "W m-2"      },
+  { 112, "ATHB",      "averaged surface net downward longwave radiation",  "W m-2"      },
+  { 113, "ASOB",      "averaged TOA net downward shortwave radiation",     "W m-2"      },
+  { 114, "ATHB",      "averaged TOA outgoing longwave radiation",          "W m-2"      },
+  { 115, "ASWDIR",    "direct downward sw radiation at the surface",       "W m-2"      },
+  { 116, "ASWDIFD",   "diffuse downward sw radiation at the surface",      "W m-2"      },
+  { 117, "ASWDIFU",   "diffuse upwnward sw radiation at the surface",      "W m-2"      },
+  { 118, "ALWD",      "downward lw radiation at the surface",              "W m-2"      },
+  { 119, "ALWU",      "upward lw radiation at the surface",                "W m-2"      },
+  { 121, "ALHFL",     "averaged surface latent heat flux",                 "W m-2"      },
+  { 122, "ASHFL",     "averaged surface sensible heat flux",               "W m-2"      },
+  { 124, "AUMFL",     "averaged eastward stress",                          "Pa"         },
+  { 125, "AVMFL",     "averaged northward stress",                         "Pa"         },
+  { 128, "SUNSH",     "undefined",                                         "undefined"  },
+  { 129, "SUNSH2",    "undefined",                                         "undefined"  },
+  { 130, "SUN_SUM",   "undefined",                                         "undefined"  },
+  { 131, "SUN_SUM2",  "undefined",                                         "undefined"  },
+  { 133, "FCOR",      "undefined",                                         "undefined"  },
+  { 134, "SKYVIEW",   "sky-view factor",                                   "1"          },
+  { 137, "SWDIR_COR", "topo correction of direct solar radiarion",         "1"          },
+};
+
+static PAR cosmo201[] = {
+  {   5, "APAB",      "&",                                                         "W m-2"      },
+  {  13, "SOHR_RAD",  "&",                                                         "K s-1"      },
+  {  14, "THHR_RAD",  "&",                                                         "K s-1"      },
+  {  20, "DURSUN",    "duration of sunshine",                                      "s"          },
+  {  29, "CLC",       "cloud area fraction",                                       "1"          },
+  {  30, "CLC_SGS",   "grid scale cloud area fraction",                            "1"          },
+  {  31, "QC",        "specific cloud liquid water content",                       "kg kg-1"    },
+  {  33, "QI",        "specific cloud ice content",                                "kg kg-1"    },
+  {  35, "QR",        "specific rain content",                                     "kg kg-1"    },
+  {  36, "QS",        "specific snow content",                                     "kg kg-1"    },
+  {  37, "TQR",       "total rain water content vertically integrated",            "kg m-2"     },
+  {  38, "TQS",       "total snow content vertically integrated",                  "kg m-2"     },
+  {  39, "QG",        "specific graupel content",                                  "kg kg-1"    },
+  {  40, "TQG",       "total graupel content vertically integrated",               "kg m-2"     },
+  {  41, "TWATER",    "cloud condensed water content",                             "kg m-2"     },
+  {  42, "TDIV_HUM",  "atmosphere water divergence",                               "kg m-2"     },
+  {  43, "QC_RAD",    "sub scale specific cloud liquid water content",             "kg kg-1"    },
+  {  44, "QI_RAD",    "sub scale specific cloud ice content",                      "kg kg-1"    },
+  {  61, "CLW_CON",   "convective cloud liquid water",                             "1"          },
+  {  68, "HBAS_CON",  "height of convective cloud base",                           "m"          },
+  {  69, "HTOP_CON",  "height of convective cloud top",                            "m"          },
+  {  70, "HBAS_CONI", "height of convective cloud base",                           "m"          },
+  {  71, "HTOP_CONI", "height of convective cloud top",                            "m"          },
+  {  72, "BAS_CON",   "index of convective cloud base",                            "1"          },
+  {  73, "TOP_CON",   "index of convective cloud top",                             "1"          },
+  {  74, "DT_CON",    "convective tendency of temperature",                        "K s-1"      },
+  {  75, "DQV_CON",   "convective tendency of specific humidity",                  "s-1"        },
+  {  78, "DU_CON",    "convective tendency of u-wind component",                   "m s-2"      },
+  {  79, "DV_CON",    "convective tendency of v-wind component",                   "m s-2"      },
+  {  82, "HTOP_DC",   "height of dry convection top",                              "m"          },
+  {  84, "HZEROCL",   "height of freezing level",                                  "m"          },
+  {  85, "SNOWLMT",   "height of the snow fall limit in m above sea level",        "m"          },
+  {  86, "HCBAS",     "height of cloud base",                                      "m"          },
+  {  87, "HCTOP",     "height of cloud top",                                       "m"          },
+  {  91, "C_T_LK",    "&",                                                         "1"          },
+  {  92, "GAMSO_LK",  "&",                                                         "m-1"        },
+  {  93, "DP_BS_LK",  "&",                                                         "m"          },
+  {  94, "H_B1_LK",   "&",                                                         "m"          },
+  {  95, "H_ML_LK",   "&",                                                         "m"          },
+  {  96, "DEPTH_LK",  "lake depth",                                                "m"          },
+  {  97, "FETCH_LK",  "wind fetch over lake",                                      "m"          },
+  {  99, "QRS",       "precipitation water (water loading)",                       "1"          },
+  { 100, "PRR_GSP",   "mass flux density of large scale rainfall",                 "kg m-2 s-1" },
+  { 101, "PRS_GSP",   "mass flux density of large scale snowfall",                 "kg m-2 s-1" },
+  { 102, "RAIN_GSP",  "large scale rainfall",                                      "kg m-2"     },
+  { 111, "PRR_CON",   "mass flux density of convective rainfall",                  "kg m-2 s-1" },
+  { 112, "PRS_CON",   "mass flux density of convective snowfall",                  "kg m-2 s-1" },
+  { 113, "RAIN_CON",  "convective rainfall",                                       "kg m-2"     },
+  { 129, "FRESHSNW",  "freshness of snow",                                         "undefined"  },
+  { 131, "PRG_GSP",   "mass flux density of large scale graupel",                  "kg m-2 s-1" },
+  { 132, "GRAU_GSP",  "large scale graupel",                                       "kg m-2"     },
+  { 133, "RHO_SNOW",  "density of snow",                                           "kg m-3"     },
+  { 139, "PP",        "deviation from reference pressure",                         "Pa"         },
+  { 140, "RCLD",      "standard deviation of saturation deficit",                  "undefined"  },
+  { 143, "CAPE_MU",   "cape of most unstable parcel",                              "J kg-1"     },
+  { 144, "CIN_MU",    "convective inhibition of most unstable parcel",             "J kg-1"     },
+  { 145, "CAPE_ML",   "cape of mean surface layer parcel",                         "J kg-1"     },
+  { 146, "CIN_ML",    "convective inhibition of mean surface layer parcel",        "J kg-1"     },
+  { 147, "TKE_CON",   "convective turbulent kinetic energy",                       "undefined"  },
+  { 148, "TKETENS",   "tendency of turbulent kinetic energy",                      "undefined"  },
+  { 152, "TKE",       "turbulent kinetic energy",                                  "m2 s-2"     },
+  { 153, "TKVM",      "diffusion coefficient of momentum",                         "m2 s-1"     },
+  { 154, "TKVH",      "diffusion coefficient of heat",                             "m2 s-1"     },
+  { 170, "TCM",       "drag coefficient of momentum",                              "1"          },
+  { 171, "TCH",       "drag coefficient of heat",                                  "1"          },
+  { 187, "VMAX",      "maximum turbulent wind gust in 10m",                        "m s-1"      },
+  { 190, "TSOIL",     "&",                                                         "K"          },
+  { 191, "TSOIL",     "&",                                                         "K"          },
+  { 192, "TSOIL",     "&",                                                         "K"          },
+  { 193, "TSOIL",     "mixed layer temperature",                                   "K"          },
+  { 194, "TSOIL",     "mean temperature of water column",                          "K"          },
+  { 197, "TSOIL",     "soil temperature",                                          "K"          },
+  { 198, "W_SO",      "soil water content",                                        "m"          },
+  { 199, "W_SO_ICE",  "soil frozen water content",                                 "m"          },
+  { 200, "W_I",       "canopy water amount",                                       "m"          },
+  { 203, "TSOIL",     "snow surface temperature",                                  "K"          },
+  { 215, "TSOIL",     "temperature of ice upper surface",                          "K"          },
+  { 230, "dBZ",       "unattenuated radar reflectivity in Rayleigh approximation", "1"          },
+  { 240, "MFLX_CON",  "convective mass flux density",                              "kg m-2 s-1" },
+  { 241, "CAPE_CON",  "&",                                                         "J kg-1"     },
+  { 243, "QCVG_CON",  "&",                                                         "s-1"        },
+};
+
+static PAR cosmo202[] = {
+  {  46, "SSO_STDH",  "standard deviation of subgrid scale height",                "m"         },
+  {  47, "SSO_GAMMA", "anisotropy of topography",                                  "-"         },
+  {  48, "SSO_THETA", "angle between principal axis of orography and global east", "-"         },
+  {  49, "SSO_SIGMA", "mean slope of subgrid scale orography",                     "-"         },
+  {  55, "FR_LAKE",   "fraction of inland lake water",                             "1"         },
+  {  57, "SOILTYP",   "soil type",                                                 "1"         },
+  {  61, "LAI",       "leaf area index",                                           "1"         },
+  {  62, "ROOTDP",    "root depth",                                                "m"         },
+  {  64, "HMO3",      "air pressure at ozone maximum",                             "Pa"        },
+  {  65, "VIO3",      "vertical integrated ozone amount",                          "Pa"        },
+  {  67, "PLCOV_MX",  "vegetation area fraction maximum",                          "1"         },
+  {  68, "PLCOV_MN",  "vegetation area fraction minimum",                          "1"         },
+  {  69, "LAI_MX",    "leaf area index maximum",                                   "1"         },
+  {  70, "LAI_MN",    "leaf area index minimum",                                   "1"         },
+  {  75, "FOR_E",     "ground fraction covered by evergreen forest",               "-"         },
+  {  76, "FOR_D",     "ground fraction covered by deciduous forest",               "-"         },
+  { 104, "DQVDT",     "tendency of water vapor",                                   "s-1"       },
+  { 105, "QVSFLX",    "surface flux of water vapour",                              "s-1m-2"    },
+  { 113, "FC",        "coriolis parameter",                                        "s-1"       },
+  { 114, "RLAT",      "latitude",                                                  "radian"    },
+  { 115, "RLON",      "longitude",                                                 "radian"    },
+  { 121, "ZTD",       "integrated total atmospheric refractivity",                 "undefined" },
+  { 122, "ZWD",       "integrated wet atmospheric refractivity",                   "undefined" },
+  { 123, "ZHD",       "integrated dry atmospheric refractivity",                   "undefined" },
+  { 180, "O3",        "ozone mass mixing ratio",                                   "kg kg-1"   },
+  { 200, "I131a",     "undefined",                                                 "undefined" },
+  { 201, "I131a_DD",  "undefined",                                                 "undefined" },
+  { 202, "I131a_WD",  "undefined",                                                 "undefined" },
+  { 203, "Cs137",     "undefined",                                                 "undefined" },
+  { 204, "Cs137_DD",  "undefined",                                                 "undefined" },
+  { 205, "Cs137_WD",  "undefined",                                                 "undefined" },
+  { 206, "Te132",     "undefined",                                                 "undefined" },
+  { 207, "Te132_DD",  "undefined",                                                 "undefined" },
+  { 208, "Te132_WD",  "undefined",                                                 "undefined" },
+  { 209, "Zr95",      "undefined",                                                 "undefined" },
+  { 210, "Zr95_DD",   "undefined",                                                 "undefined" },
+  { 211, "Zr95_WD",   "undefined",                                                 "undefined" },
+  { 212, "Kr85",      "undefined",                                                 "undefined" },
+  { 213, "Kr85_DD",   "undefined",                                                 "undefined" },
+  { 214, "Kr85_WD",   "undefined",                                                 "undefined" },
+  { 215, "TRACER",    "undefined",                                                 "undefined" },
+  { 216, "TRACER_DD", "undefined",                                                 "undefined" },
+  { 217, "TRACER_WD", "undefined",                                                 "undefined" },
+  { 218, "Xe133",     "undefined",                                                 "undefined" },
+  { 219, "Xe133_DD",  "undefined",                                                 "undefined" },
+  { 220, "Xe133_WD",  "undefined",                                                 "undefined" },
+  { 221, "I131g",     "undefined",                                                 "undefined" },
+  { 222, "I131g_DD",  "undefined",                                                 "undefined" },
+  { 223, "I131g_WD",  "undefined",                                                 "undefined" },
+  { 224, "I131o",     "undefined",                                                 "undefined" },
+  { 225, "I131o_DD",  "undefined",                                                 "undefined" },
+  { 226, "I131o_WD",  "undefined",                                                 "undefined" },
+  { 227, "Ba140",     "undefined",                                                 "undefined" },
+  { 228, "Ba140_DD",  "undefined",                                                 "undefined" },
+  { 229, "Ba140_WD",  "undefined",                                                 "undefined" },
+  { 230, "Sr90",      "undefined",                                                 "undefined" },
+  { 231, "Sr90_DD",   "undefined",                                                 "undefined" },
+  { 232, "Sr90_WD",   "undefined",                                                 "undefined" },
+  { 233, "Ru103",     "undefined",                                                 "undefined" },
+  { 234, "Ru103_DD",  "undefined",                                                 "undefined" },
+  { 235, "Ru103_WD",  "undefined",                                                 "undefined" },
+};
+
+static PAR cosmo203[] = {
+  { 135, "LCL_ML",   "undefined",                  "undefined" },
+  { 136, "LFC_ML",   "undefined",                  "undefined" },
+  { 137, "CAPE_3KM", "undefined",                  "undefined" },
+  { 138, "SWISS00",  "swiss00 index",              "1"         },
+  { 139, "SWISS12",  "swiss12 index",              "1"         },
+  { 147, "SLI",      "surface lifted index",       "K"         },
+  { 149, "SI",       "showalter index",            "K"         },
+  { 155, "BRN",      "undefined",                  "undefined" },
+  { 156, "HPBL",     "undefined",                  "undefined" },
+  { 203, "CLDEPTH",  "normalized cloud depth",     "1"         },
+  { 204, "CLCT_MOD", "modified_total_cloud_cover", "1"         },
+};
+
+static PAR cosmo205[] = {
+  {   1, "SYNME5", "synthetic satellite images Meteosat5", "-" },
+  {   2, "SYNME6", "synthetic satellite images Meteosat6", "-" },
+  {   3, "SYNME7", "synthetic satellite images Meteosat7", "-" },
+  {   4, "SYNMSG", "synthetic satellite images MSG",       "-" },
+};
+
+static PAR cosmo250[] = {
+  {   1, "QNH",       "sea level air pressure",                                         "hPa"                                },
+  {  11, "TSOIL",     "2m temperature",                                                 "K"                                  },
+  {  12, "TSOIL",     "2m temperature",                                                 "K"                                  },
+  {  13, "D_T_2M_K",  "kalman correction to 2m temperature",                            "K"                                  },
+  {  14, "TSOIL",     "2m temperature",                                                 "K"                                  },
+  {  15, "TSOIL",     "2m temperature",                                                 "K"                                  },
+  {  16, "RH_ICE",    "relative humidity over ice",                                     "%"                                  },
+  {  17, "TD",        "dew point temperature",                                          "K"                                  },
+  {  18, "D_TD",      "dew point depression",                                           "K"                                  },
+  {  19, "THETAE",    "equivalent potential temperature",                               "K"                                  },
+  {  20, "TD_2M_K",   "2m dew point temperature",                                       "K"                                  },
+  {  21, "D_TD_2M_K", "kalman correction to 2m dew point temperature",                  "K"                                  },
+  {  22, "TD_2M_OLD", "2m dew point temperature",                                       "K"                                  },
+  {  23, "TD_2M_BUZ", "2m dew point temperature",                                       "K"                                  },
+  {  24, "HI",        "heat index",                                                     "Fahrenheit"                         },
+  {  25, "DURSUN_M",  "maximum duration of sunshine",                                   "s"                                  },
+  {  26, "DURSUN_R",  "relative duration of sunshine",                                  "%"                                  },
+  {  52, "RH_2M_K",   "2m relative humidity",                                           "%"                                  },
+  {  53, "D_RH_2M_K", "kalman correction to 2m relative humidity",                      "%"                                  },
+  {  58, "CLI_RATIO", "cloud ice ratio (Qi/Qc+Qi)",                                     "%"                                  },
+  {  61, "TOT_SNOW",  "total precipitation in snow",                                    "kg/m**2"                            },
+  {  62, "TOT_RAIN",  "total precipitation in rain",                                    "kg/m**2"                            },
+  {  63, "TOT_CON",   "total convective precipitation",                                 "kg/m**2"                            },
+  {  64, "TOT_GSP",   "total large scale precipitation",                                "kg/m**2"                            },
+  {  65, "SNOW_%",    "percentage of precipitation in snow",                            "%"                                  },
+  {  66, "CONV_%",    "percentage of convective precipitation",                         "%"                                  },
+  {  67, "VORTP_ABS", "absolute",                                                       "VORTP_ABS 67 -1 absolute vorticity" },
+  {  68, "VORTP_REL", "relative",                                                       "VORTP_REL 68 -1 relative vorticity" },
+  {  70, "PDIFF_CON", "pressure difference between cloud base and cloud top",           "Pa"                                 },
+  {  71, "TTOP_CON",  "temperature at cloud top",                                       "K"                                  },
+  {  80, "GEM",       "emissivity of the ground",                                       "%"                                  },
+  {  82, "Z0LOC",     "local surface roughness length",                                 "m"                                  },
+  { 110, "LUM",       "luminosity",                                                     "klux"                               },
+  { 111, "GLOB",      "global shortwave radiation at surface",                          "W/m**2"                             },
+  { 112, "LW_IN_TG",  "incoming longwave radiation at surface",                         "W/m**2"                             },
+  { 113, "LW_IN_TS",  "incoming longwave radiation at surface",                         "W/m**2"                             },
+  { 114, "LW_IN_T2M", "incoming longwave radiation at surface",                         "W/m**2"                             },
+  { 115, "SWISS_WE",  "Swiss",                                                          "SWISS_WE 115 1 Swiss coordinates"   },
+  { 116, "SWISS_SN",  "Swiss",                                                          "SWISS_SN 116 1 Swiss coordinates"   },
+  { 150, "KOINDEX",   "KO index",                                                       "K"                                  },
+  { 151, "TTINDEX",   "total-totals index",                                             "K"                                  },
+  { 152, "DCI",       "deep convection index",                                          "K"                                  },
+  { 153, "SWEAT",     "severe weather thread index",                                    "undefined"                          },
+  { 154, "ADEDO2",    "adedokun 2 index",                                               "K"                                  },
+  { 160, "C_TSTORM",  "thunderstorm index using AdaBoost classifier",                   "undefined"                          },
+  { 161, "CN_TSTORM", "thunderstorm probabilty using AdaBoost classifier",              "%"                                  },
+  { 200, "WSHEARL",   "wind shear between surface and 3 km asl",                        "1/s"                                },
+  { 201, "WSHEARM",   "wind shear between surface and 6 km asl",                        "1/s"                                },
+  { 202, "WSHEARU",   "wind shear between 3 km (or surface) and 6 km asl",              "1/s"                                },
+  { 211, "VWIN",      "maximum OLD turbulent wind gust in 10m",                         "m s-1"                              },
+  { 212, "VW10M_20",  "maximum 10m wind speed",                                         "m s-1"                              },
+  { 213, "VW10M_25",  "duration of VWIN_10M above 25 knots",                            "s"                                  },
+  { 214, "VW10M_30",  "duration of VWIN_10M above 30 knots",                            "s"                                  },
+  { 215, "VW10M_35",  "duration of VWIN_10M above 35 knots",                            "s"                                  },
+  { 216, "VW10M_40",  "duration of VWIN_10M above 40 knots",                            "s"                                  },
+  { 217, "VW10M_45",  "duration of VWIN_10M above 45 knots",                            "s"                                  },
+  { 218, "VW10M_50",  "duration of VWIN_10M above 50 knots",                            "s"                                  },
+  { 219, "VOLD",      "maximum turbulent wind gust in 10m",                             "m s-1"                              },
+  { 220, "VJPS",      "maximum turbulent wind gust in 10m",                             "m s-1"                              },
+  { 221, "VBRA",      "maximum Brasseur turbulent wind gust in 10m",                    "m s-1"                              },
+  { 222, "VB10M_20",  "duration of VBRA_10M above 20 knots",                            "s"                                  },
+  { 223, "VB10M_25",  "duration of VBRA_10M above 25 knots",                            "s"                                  },
+  { 224, "VB10M_30",  "duration of VBRA_10M above 30 knots",                            "s"                                  },
+  { 225, "VB10M_35",  "duration of VBRA_10M above 35 knots",                            "s"                                  },
+  { 226, "VB10M_40",  "duration of VBRA_10M above 40 knots",                            "s"                                  },
+  { 227, "VB10M_45",  "duration of VBRA_10M above 45 knots",                            "s"                                  },
+  { 228, "VB10M_50",  "duration of VBRA_10M above 50 knots",                            "s"                                  },
+  { 231, "VCON",      "maximum convective wind gust in 10m",                            "m s-1"                              },
+  { 232, "VC10M_20",  "duration of VCON_10M above 20 knots",                            "s"                                  },
+  { 233, "VC10M_25",  "duration of VCON_10M above 25 knots",                            "s"                                  },
+  { 234, "VC10M_30",  "duration of VCON_10M above 30 knots",                            "s"                                  },
+  { 235, "VC10M_35",  "duration of VCON_10M above 35 knots",                            "s"                                  },
+  { 236, "VC10M_40",  "duration of VCON_10M above 40 knots",                            "s"                                  },
+  { 237, "VC10M_45",  "duration of VCON_10M above 45 knots",                            "s"                                  },
+  { 238, "VC10M_50",  "duration of VCON_10M above 50 knots",                            "s"                                  },
+  { 241, "FMAX",      "maximum wind speed at k=ke",                                     "m s-1"                              },
+  { 242, "USTARMAX",  "maximal u*=SQRT(Drag_coef)*fmax_10m",                            "m s-1"                              },
+  { 243, "GLOB_DIF",  "global diffuse shortwave radiation at the surface",              "W/m**2"                             },
+  { 244, "GLOB_DIR",  "global direct (beam) shortwave radiation at the surface",        "W/m**2"                             },
+  { 245, "GLOB_vE",   "global shortwave radiation on a vertical surface facing east",   "W/m**2"                             },
+  { 246, "GLOB_vS",   "global shortwave radiation on a vertical surface facing south",  "W/m**2"                             },
+  { 247, "GLOB_vW",   "global shortwave radiation on a vertical surface facing west",   "W/m**2"                             },
+  { 248, "GLOB_vN",   "global shortwave radiation on a vertical surface facing north",  "W/m**2"                             },
+  { 249, "LW_TG_vS",  "incoming longwave radiation on a vertical surface facing south", "W/m**2"                             },
+  { 250, "ENTH",      "enthalpy",                                                       "kJ/kg"                              },
+  { 251, "ENTH",      "enthalpy",                                                       "kJ/kg"                              },
+  { 252, "MIXRAT",    "mixing ratio",                                                   "g/kg"                               },
+  { 253, "MIXRAT",    "mixing ratio",                                                   "g/kg"                               },
+  { 254, "TW",        "wet bulb temperature",                                           "degC"                               },
+  { 255, "TW",        "wet bulb temperature",                                           "degC"                               },
+};
+
+
+void
+tableDefault(void)
+{
+  int tableID, instID, modelID;
+
+
+  /*
+   *  define table : echam4
+   */
+
+  instID  = institutInq(98, 255, "MPIMET", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(98, 255, "MPIMET", NULL);
+
+  modelID = modelInq(instID, 0, "ECHAM4");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "ECHAM4");
+
+  tableID = tableDef(modelID, 128, "echam4");
+
+  tableLink(tableID, echam4, sizeof(echam4) / sizeof(PAR));
+
+  /*
+   *  define table : echam5
+   */
+
+  instID  = institutInq(0, 0, "MPIMET", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MPIMET", NULL);
+
+  modelID = modelInq(instID, 0, "ECHAM5");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "ECHAM5");
+
+  tableID = tableDef(modelID, 128, "echam5");
+
+  tableLink(tableID, echam5, sizeof(echam5) / sizeof(PAR));
+
+  /*
+   *  define table : echam6
+   */
+
+  instID  = institutInq(0, 0, "MPIMET", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MPIMET", NULL);
+
+  modelID = modelInq(instID, 0, "ECHAM6");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "ECHAM6");
+
+  tableID = tableDef(modelID, 128, "echam6");
+
+  tableLink(tableID, echam6, sizeof(echam6) / sizeof(PAR));
+
+  /*
+   *  define table : mpiom1
+   */
+
+  instID  = institutInq(0, 0, "MPIMET", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MPIMET", NULL);
+
+  modelID = modelInq(instID, 0, "MPIOM1");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "MPIOM1");
+
+  tableID = tableDef(modelID, 128, "mpiom1");
+
+  tableLink(tableID, mpiom1, sizeof(mpiom1) / sizeof(PAR));
+
+  /*
+   *  define table : ecmwf
+   */
+
+  instID  = institutInq(0, 0, "ECMWF", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "ECMWF", NULL);
+
+  modelID = modelInq(instID, 0, "");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "");
+
+  tableID = tableDef(modelID, 128, "ecmwf");
+
+  tableLink(tableID, ecmwf, sizeof(ecmwf) / sizeof(PAR));
+
+  /*
+   *  define table : remo
+   */
+
+  instID  = institutInq(0, 0, "MPIMET", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MPIMET", NULL);
+
+  modelID = modelInq(instID, 0, "REMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "REMO");
+
+  tableID = tableDef(modelID, 128, "remo");
+
+  tableLink(tableID, remo, sizeof(remo) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo002
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 002, "cosmo002");
+
+  tableLink(tableID, cosmo002, sizeof(cosmo002) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo201
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 201, "cosmo201");
+
+  tableLink(tableID, cosmo201, sizeof(cosmo201) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo202
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 202, "cosmo202");
+
+  tableLink(tableID, cosmo202, sizeof(cosmo202) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo203
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 203, "cosmo203");
+
+  tableLink(tableID, cosmo203, sizeof(cosmo203) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo205
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 205, "cosmo205");
+
+  tableLink(tableID, cosmo205, sizeof(cosmo205) / sizeof(PAR));
+
+  /*
+   *  define table : cosmo250
+   */
+
+  instID  = institutInq(0, 0, "MCH", NULL);
+  if ( instID == -1 )
+    instID  = institutDef(0, 0, "MCH", NULL);
+
+  modelID = modelInq(instID, 0, "COSMO");
+  if ( modelID == -1 )
+    modelID = modelDef(instID, 0, "COSMO");
+
+  tableID = tableDef(modelID, 250, "cosmo250");
+
+  tableLink(tableID, cosmo250, sizeof(cosmo250) / sizeof(PAR));
+}
+
+#endif  /* _TABLE_H */
diff --git a/libcdi/src/tablepar.h b/libcdi/src/tablepar.h
new file mode 100644
index 0000000..3564c63
--- /dev/null
+++ b/libcdi/src/tablepar.h
@@ -0,0 +1,26 @@
+#ifndef _TABLEPAR_H
+#define _TABLEPAR_H
+
+typedef struct
+{
+  int   id;	     /* Parameter number (GRIB) */
+  char *name;	     /* Parameter name */
+  char *longname;    /* Parameter long name */
+  char *units;	     /* Parameter units */
+}
+PAR;
+
+
+void tableLink(int tableID, PAR *pars, int npars);
+int tableDef(int modelID, int tablegribID, const char *tablename);
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/taxis.c b/libcdi/src/taxis.c
new file mode 100644
index 0000000..0ba140c
--- /dev/null
+++ b/libcdi/src/taxis.c
@@ -0,0 +1,1403 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <string.h>
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+#include "dmemory.h"
+
+#include "cdi.h"
+#include "taxis.h"
+#include "stream_int.h"
+#include "calendar.h"
+#include "pio_util.h"
+#include "namespace.h"
+#include "resource_handle.h"
+#include "pio_rpc.h"
+#include "pio_util.h"
+
+extern int cdiDefaultCalendar;
+
+static int DefaultTimeType = TAXIS_ABSOLUTE;
+static int DefaultTimeUnit = TUNIT_HOUR;
+
+
+char *Timeunits[] = {
+  "undefined",
+  "seconds",
+  "minutes",
+  "hours",
+  "days",
+  "months",
+  "years",
+  "quarters",
+  "3hours",
+  "6hours",
+  "12hours",
+};
+
+
+static int    taxisCompareP    ( void * taxisptr1, void * taxisptr2 );
+static void   taxisDestroyP    ( void * taxisptr );
+static void   taxisPrintP      ( void * taxisptr, FILE * fp );
+#ifdef USE_MPI
+static int    taxisGetPackSize ( void * taxisptr, MPI_Comm comm );
+static void   taxisPack        ( void * taxisptr, void *buf, int size,
+				 int *position, MPI_Comm comm );
+static int    taxisTxCode      ( void );
+#endif
+
+resOps taxisOps = { taxisCompareP, taxisDestroyP, taxisPrintP
+#ifdef USE_MPI
+                    , taxisGetPackSize, taxisPack, taxisTxCode
+#endif
+};
+
+
+static int  TAXIS_Debug = 0;   /* If set to 1, debugging */
+
+
+char *tunitNamePtr(int unitID)
+{
+  char *name;
+  int size = sizeof(Timeunits)/sizeof(char *);
+
+  if ( unitID > 0 && unitID < size )
+    name = Timeunits[unitID];
+  else
+    name = Timeunits[0];
+
+  return (name);
+}
+
+#if 0
+static
+void taxis_defaults(void)
+{
+  char *timeunit;
+
+  timeunit = getenv("TIMEUNIT");
+  if ( timeunit )
+    {
+      if ( strcmp(timeunit, "minutes") == 0 )
+	DefaultTimeUnit = TUNIT_MINUTE;
+      else if ( strcmp(timeunit, "hours") == 0 )
+	DefaultTimeUnit = TUNIT_HOUR;
+      else if ( strcmp(timeunit, "3hours") == 0 )
+	DefaultTimeUnit = TUNIT_3HOURS;
+      else if ( strcmp(timeunit, "6hours") == 0 )
+	DefaultTimeUnit = TUNIT_6HOURS;
+      else if ( strcmp(timeunit, "12hours") == 0 )
+	DefaultTimeUnit = TUNIT_12HOURS;
+      else if ( strcmp(timeunit, "days") == 0 )
+	DefaultTimeUnit = TUNIT_DAY;
+      else if ( strcmp(timeunit, "months") == 0 )
+	DefaultTimeUnit = TUNIT_MONTH;
+      else if ( strcmp(timeunit, "years") == 0 )
+	DefaultTimeUnit = TUNIT_YEAR;
+      else
+	Warning("Unsupported TIMEUNIT %s!", timeunit);
+    }
+}
+#endif
+
+static
+void taxisDefaultValue ( taxis_t *taxisptr )
+{
+  taxisptr->self        = CDI_UNDEFID;
+  taxisptr->used        = FALSE;
+  taxisptr->type        = DefaultTimeType;
+  taxisptr->vdate       = 0;
+  taxisptr->vtime       = 0;
+  taxisptr->rdate       = CDI_UNDEFID;
+  taxisptr->rtime       = 0;
+  taxisptr->calendar    = cdiDefaultCalendar;
+  taxisptr->unit        = DefaultTimeUnit;
+  taxisptr->numavg      = 0;
+  taxisptr->has_bounds  = FALSE;
+  taxisptr->vdate_lb    = 0;
+  taxisptr->vtime_lb    = 0;
+  taxisptr->vdate_ub    = 0;
+  taxisptr->vtime_ub    = 0;
+  taxisptr->name        = NULL;
+  taxisptr->longname    = NULL;
+}
+
+static
+taxis_t *taxisNewEntry(void)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = (taxis_t *) xmalloc ( sizeof ( taxis_t ));
+
+  taxisDefaultValue ( taxisptr );
+  taxisptr->self = reshPut (( void * ) taxisptr, &taxisOps );
+
+  return (taxisptr);
+}
+
+static
+void taxisInit (void)
+{
+  static int taxisInitialized = 0;
+  char *env;
+
+  if ( taxisInitialized ) return;
+
+  taxisInitialized = 1; 
+
+  env = getenv("TAXIS_DEBUG");
+  if ( env ) TAXIS_Debug = atoi(env);
+}
+
+#if 0
+static
+void taxis_copy(taxis_t *taxisptr2, taxis_t *taxisptr1)
+{
+  int taxisID2;
+
+  taxisID2 = taxisptr2->self;
+  memcpy(taxisptr2, taxisptr1, sizeof(taxis_t));
+  taxisptr2->self = taxisID2;
+}
+#endif
+
+static
+void taxis_check_ptr(const char *caller, taxis_t *taxisptr)
+{
+  if ( taxisptr == NULL )
+    Errorc("taxis undefined!");
+}
+
+/*
+ at Function  taxisCreate
+ at Title     Create a Time axis
+
+ at Prototype int taxisCreate(int taxistype)
+ at Parameter
+    @Item  taxistype  The type of the Time axis, one of the set of predefined CDI time axis types.
+                      The valid CDI time axis types are @func{TAXIS_ABSOLUTE} and @func{TAXIS_RELATIVE}.
+
+ at Description
+The function @func{taxisCreate} creates a Time axis.
+
+ at Result
+ at func{taxisCreate} returns an identifier to the Time axis.
+
+ at Example
+Here is an example using @func{taxisCreate} to create a relative T-axis
+with a standard calendar.
+
+ at Source
+#include "cdi.h"
+   ...
+int taxisID;
+   ...
+taxisID = taxisCreate(TAXIS_RELATIVE);
+taxisDefCalendar(taxisID, CALENDAR_STANDARD);
+taxisDefRdate(taxisID, 19850101);
+taxisDefRtime(taxisID, 120000);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int taxisCreate(int taxistype)
+{
+  int taxisID;
+  taxis_t *taxisptr;
+
+  if ( CDI_Debug )
+    Message("taxistype: %d", taxistype);
+
+  taxisInit ();
+
+  taxisptr = taxisNewEntry();
+
+  taxisID = taxisptr->self;
+  taxisptr->type = taxistype;
+
+  if ( CDI_Debug )
+    Message("taxisID: %d", taxisID);
+
+  return (taxisID);
+}
+
+static
+void taxisDestroyKernel( taxis_t * taxisptr )
+{
+  int id;
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  id = taxisptr->self;
+
+  free ( taxisptr );
+
+  reshRemove ( id, &taxisOps );
+}
+
+/*
+ at Function  taxisDestroy
+ at Title     Destroy a Time axis
+
+ at Prototype void taxisDestroy(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @func{taxisCreate}
+
+ at EndFunction
+*/
+void taxisDestroy(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  if ( taxisptr->name     ) free(taxisptr->name);
+  if ( taxisptr->longname ) free(taxisptr->longname);
+
+  taxisDestroyKernel ( taxisptr );
+}
+
+
+void taxisDestroyP( void * taxisptr )
+{
+  taxisDestroyKernel (( taxis_t * ) taxisptr );
+}
+
+
+int taxisDuplicate(int taxisID1)
+{
+  int taxisID2;
+  taxis_t *taxisptr1;
+  taxis_t *taxisptr2;
+
+  taxisptr1 = ( taxis_t * ) reshGetVal ( taxisID1, &taxisOps );
+
+  taxisptr2 = taxisNewEntry();
+  if ( ! taxisptr2 ) Error("No memory");
+
+  taxisID2 = taxisptr2->self;
+
+  if ( CDI_Debug )
+    Message("taxisID2: %d", taxisID2);
+
+  ptaxisCopy(taxisptr2, taxisptr1);
+  if ( taxisptr1->name     ) taxisptr2->name = strdup(taxisptr1->name);
+  if ( taxisptr1->longname ) taxisptr2->longname = strdup(taxisptr1->longname);
+
+  // taxisptr2->has_bounds = FALSE;
+
+  return (taxisID2);
+}
+
+
+void taxisDefType(int taxisID, int type)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->type = type;
+}
+
+/*
+ at Function  taxisDefVdate
+ at Title     Define the verification date
+
+ at Prototype void taxisDefVdate(int taxisID, int vdate)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+    @Item  vdate    Verification date (YYYYMMDD)
+
+ at Description
+The function @func{taxisDefVdate} defines the verification date of a Time axis.
+
+ at EndFunction
+*/
+void taxisDefVdate(int taxisID, int vdate)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->vdate = vdate;
+}
+
+/*
+ at Function  taxisDefVtime
+ at Title     Define the verification time
+
+ at Prototype void taxisDefVtime(int taxisID, int vtime)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+    @Item  vtime    Verification time (hhmmss)
+
+ at Description
+The function @func{taxisDefVtime} defines the verification time of a Time axis.
+
+ at EndFunction
+*/
+void taxisDefVtime(int taxisID, int vtime)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->vtime = vtime;
+}
+
+/*
+ at Function  taxisDefRdate
+ at Title     Define the reference date
+
+ at Prototype void taxisDefRdate(int taxisID, int rdate)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+    @Item  rdate    Reference date (YYYYMMDD)
+
+ at Description
+The function @func{taxisDefVdate} defines the reference date of a Time axis.
+
+ at EndFunction
+*/
+void taxisDefRdate(int taxisID, int rdate)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->rdate = rdate;
+}
+
+/*
+ at Function  taxisDefRtime
+ at Title     Define the reference time
+
+ at Prototype void taxisDefRtime(int taxisID, int rtime)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+    @Item  rtime    Reference time (hhmmss)
+
+ at Description
+The function @func{taxisDefVdate} defines the reference time of a Time axis.
+
+ at EndFunction
+*/
+void taxisDefRtime(int taxisID, int rtime)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->rtime = rtime;
+}
+
+/*
+ at Function  taxisDefCalendar
+ at Title     Define the calendar
+
+ at Prototype void taxisDefCalendar(int taxisID, int calendar)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+    @Item  calendar The type of the calendar, one of the set of predefined CDI calendar types.
+                    The valid CDI calendar types are @func{CALENDAR_STANDARD}, @func{CALENDAR_PROLEPTIC}, 
+                    @func{CALENDAR_360DAYS}, @func{CALENDAR_365DAYS} and @func{CALENDAR_366DAYS}.
+
+ at Description
+The function @func{taxisDefCalendar} defines the calendar of a Time axis.
+
+ at EndFunction
+*/
+void taxisDefCalendar(int taxisID, int calendar)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->calendar = calendar;
+}
+
+
+void taxisDefTunit(int taxisID, int unit)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->unit = unit;
+}
+
+
+void taxisDefNumavg(int taxisID, int numavg)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->numavg = numavg;
+}
+
+/*
+The type of the time axis, one of the set of predefined CDI time types.
+The valid CDI time types are TAXIS_ABSOLUTE and TAXIS_RELATIVE.
+*/
+int taxisInqType(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->type);
+}
+
+
+int taxisHasBounds(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->has_bounds);
+}
+
+
+void taxisDeleteBounds(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->has_bounds = FALSE;
+}
+
+
+void taxisCopyTimestep(int taxisID2, int taxisID1)
+{
+  taxis_t *taxisptr1;
+  taxis_t *taxisptr2;
+
+  taxisptr1 = ( taxis_t * ) reshGetVal ( taxisID1, &taxisOps );
+  taxisptr2 = ( taxis_t * ) reshGetVal ( taxisID2, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr1);
+  taxis_check_ptr(__func__, taxisptr2);
+
+  reshLock ();
+
+  taxisptr2->rdate = taxisptr1->rdate;
+  taxisptr2->rtime = taxisptr1->rtime;
+
+  taxisptr2->vdate = taxisptr1->vdate;
+  taxisptr2->vtime = taxisptr1->vtime;
+
+  if ( taxisptr2->has_bounds )
+    {
+      taxisptr2->vdate_lb = taxisptr1->vdate_lb;
+      taxisptr2->vtime_lb = taxisptr1->vtime_lb;
+      taxisptr2->vdate_ub = taxisptr1->vdate_ub;
+      taxisptr2->vtime_ub = taxisptr1->vtime_ub;
+    }
+
+  reshUnlock ();
+}
+
+/*
+ at Function  taxisInqVdate
+ at Title     Get the verification date
+
+ at Prototype int taxisInqVdate(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{taxisInqVdate} returns the verification date of a Time axis.
+
+ at Result
+ at func{taxisInqVdate} returns the verification date.
+
+ at EndFunction
+*/
+int taxisInqVdate(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->vdate);
+}
+
+
+void taxisInqVdateBounds(int taxisID, int *vdate_lb, int *vdate_ub)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  *vdate_lb = taxisptr->vdate_lb;
+  *vdate_ub = taxisptr->vdate_ub;
+}
+
+
+void taxisDefVdateBounds(int taxisID, int vdate_lb, int vdate_ub)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->vdate_lb = vdate_lb;
+  taxisptr->vdate_ub = vdate_ub;
+ 
+  taxisptr->has_bounds = TRUE;
+}
+
+/*
+ at Function  taxisInqVtime
+ at Title     Get the verification time
+
+ at Prototype int taxisInqVtime(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{taxisInqVtime} returns the verification time of a Time axis.
+
+ at Result
+ at func{taxisInqVtime} returns the verification time.
+
+ at EndFunction
+*/
+int taxisInqVtime(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->vtime);
+}
+
+
+void taxisInqVtimeBounds(int taxisID, int *vtime_lb, int *vtime_ub)
+{
+  taxis_t *taxisptr;
+  
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  *vtime_lb = taxisptr->vtime_lb;
+  *vtime_ub = taxisptr->vtime_ub;
+}
+
+
+void taxisDefVtimeBounds(int taxisID, int vtime_lb, int vtime_ub)
+{
+  taxis_t *taxisptr;
+
+  if ( reshGetStatus ( taxisID, &taxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  taxisptr->vtime_lb = vtime_lb;
+  taxisptr->vtime_ub = vtime_ub;
+ 
+  taxisptr->has_bounds = TRUE;
+}
+
+/*
+ at Function  taxisInqRdate
+ at Title     Get the reference date
+
+ at Prototype int taxisInqRdate(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{taxisInqRdate} returns the reference date of a Time axis.
+
+ at Result
+ at func{taxisInqVdate} returns the reference date.
+
+ at EndFunction
+*/
+int taxisInqRdate(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  if ( taxisptr->rdate == -1 )
+    {
+      taxisptr->rdate = taxisptr->vdate;
+      taxisptr->rtime = taxisptr->vtime;
+    }
+
+  return (taxisptr->rdate);
+}
+
+/*
+ at Function  taxisInqRtime
+ at Title     Get the reference time
+
+ at Prototype int taxisInqRtime(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{taxisInqRtime} returns the reference time of a Time axis.
+
+ at Result
+ at func{taxisInqVtime} returns the reference time.
+
+ at EndFunction
+*/
+int taxisInqRtime(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  if ( taxisptr->rdate == -1 )
+    {
+      taxisptr->rdate = taxisptr->vdate;
+      taxisptr->rtime = taxisptr->vtime;
+    }
+
+  return (taxisptr->rtime);
+}
+
+/*
+ at Function  taxisInqCalendar
+ at Title     Get the calendar
+
+ at Prototype int taxisInqCalendar(int taxisID)
+ at Parameter
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{taxisInqCalendar} returns the calendar of a Time axis.
+
+ at Result
+ at func{taxisInqCalendar} returns the type of the calendar,
+one of the set of predefined CDI calendar types.
+The valid CDI calendar types are @func{CALENDAR_STANDARD}, @func{CALENDAR_PROLEPTIC}, 
+ at func{CALENDAR_360DAYS}, @func{CALENDAR_365DAYS} and @func{CALENDAR_366DAYS}.
+
+ at EndFunction
+*/
+int taxisInqCalendar(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->calendar);
+}
+
+
+int taxisInqTunit(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->unit);
+}
+
+
+int taxisInqNumavg(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr->numavg);
+}
+
+
+taxis_t *taxisPtr(int taxisID)
+{
+  taxis_t *taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+
+  taxis_check_ptr(__func__, taxisptr);
+
+  return (taxisptr);
+}
+
+
+void cdiDecodeTimevalue(int timeunit, double timevalue, int *days, int *secs)
+{
+  static int lwarn = TRUE;
+
+  if ( timeunit == TUNIT_MINUTE )
+    {
+      timevalue *= 60;
+      timeunit = TUNIT_SECOND;
+    }
+  else if ( timeunit == TUNIT_HOUR )
+    {
+      timevalue /= 24;
+      timeunit = TUNIT_DAY;
+    }
+
+  if ( timeunit == TUNIT_SECOND )
+    {
+      *days = (int) (timevalue/86400);
+      *secs = (int) (timevalue - *days*86400.);
+      if ( *secs < 0 ) { *days -= 1; *secs += 86400; };
+      /*
+      {
+	double cval = *days*86400. + *secs;
+	if ( cval != timevalue )
+	  printf("TUNIT_SECOND error: %g %g %d %d\n", timevalue, cval, *days, *secs);
+      }
+      */
+    }
+  else if ( timeunit == TUNIT_DAY )
+    {
+      *days = (int) timevalue;
+      *secs = (int) ((timevalue - *days)*86400 + 0.5);
+      if ( *secs < 0 ) { *days -= 1; *secs += 86400; };
+      /*
+      {
+	double cval = *days + *secs/86400.;
+	if ( cval != timevalue )
+	  printf("TUNIT_DAY error: %g %g %d %d\n", timevalue, cval, *days, *secs);
+      }
+      */
+    }
+  else
+    {
+      if ( lwarn )
+	{
+	  Warning("timeunit %s unsupported!", tunitNamePtr(timeunit));
+	  lwarn = FALSE;
+	}
+    }
+}
+
+static
+void cdiEncodeTimevalue(int days, int secs, int timeunit, double *timevalue)
+{
+  static int lwarn = TRUE;
+
+  if ( timeunit == TUNIT_SECOND )
+    {
+      *timevalue = days*86400. + secs;
+    }
+  else if ( timeunit == TUNIT_MINUTE ||
+	    timeunit == TUNIT_QUARTER )
+    {
+      *timevalue = days*1440. + secs/60.;
+    }
+  else if ( timeunit == TUNIT_HOUR   ||
+	    timeunit == TUNIT_3HOURS ||
+	    timeunit == TUNIT_6HOURS ||
+	    timeunit == TUNIT_12HOURS )
+    {
+      *timevalue = days*24. + secs/3600.;
+    }
+  else if ( timeunit == TUNIT_DAY )
+    {
+      *timevalue = days + secs/86400.;
+    }
+  else
+    {
+      if ( lwarn )
+	{
+	  Warning("timeunit %s unsupported!", tunitNamePtr(timeunit));
+	  lwarn = FALSE;
+	}
+    }
+}
+
+int days_per_month(int calendar, int year, int month);
+
+void timeval2vtime(double timevalue, taxis_t *taxis, int *vdate, int *vtime)
+{
+  int year, month, day, hour, minute, second;
+  int rdate, rtime;
+  int timeunit;
+  int calendar;
+  int julday, secofday, days, secs;
+
+  *vdate = 0;
+  *vtime = 0;
+
+  timeunit = (*taxis).unit;
+  calendar = (*taxis).calendar;
+
+  rdate  = (*taxis).rdate;
+  rtime  = (*taxis).rtime;
+
+  if ( rdate == 0 && rtime == 0 && DBL_IS_EQUAL(timevalue, 0.) ) return;
+
+  cdiDecodeDate(rdate, &year, &month, &day);
+  cdiDecodeTime(rtime, &hour, &minute, &second);
+
+  if ( timeunit == TUNIT_MONTH && calendar == CALENDAR_360DAYS )
+    {
+      timeunit = TUNIT_DAY;
+      timevalue *= 30;
+    }
+
+  if ( timeunit == TUNIT_MONTH || timeunit == TUNIT_YEAR )
+    {
+      int nmon, dpm;
+      double fmon;
+
+      if ( timeunit == TUNIT_YEAR ) timevalue *= 12;
+
+      nmon = (int) timevalue;
+      fmon = timevalue - nmon;
+
+      month += nmon;
+
+      while ( month > 12 ) { month -= 12; year++; }
+      while ( month <  1 ) { month += 12; year--; }
+
+      dpm = days_per_month(calendar, year, month);
+      timeunit = TUNIT_DAY;
+      timevalue = fmon*dpm;
+    }
+
+  encode_caldaysec(calendar, year, month, day, hour, minute, second, &julday, &secofday);
+
+  cdiDecodeTimevalue(timeunit, timevalue, &days, &secs);
+
+  julday_add(days, secs, &julday, &secofday);
+
+  decode_caldaysec(calendar, julday, secofday, &year, &month, &day, &hour, &minute, &second);
+
+  *vdate = cdiEncodeDate(year, month, day);
+  *vtime = cdiEncodeTime(hour, minute, second);
+}
+
+
+double vtime2timeval(int vdate, int vtime, taxis_t *taxis)
+{
+  int ryear, rmonth;
+  int year, month, day, hour, minute, second;
+  int rdate, rtime;
+  double value = 0;
+  int timeunit;
+  int timeunit0;
+  int calendar;
+  int julday1, secofday1, julday2, secofday2, days, secs;
+
+  timeunit = (*taxis).unit;
+  calendar = (*taxis).calendar;
+
+  rdate = (*taxis).rdate;
+  rtime = (*taxis).rtime;
+  if ( rdate == -1 )
+    {
+      rdate  = (*taxis).vdate;
+      rtime  = (*taxis).vtime;
+    }
+
+  if ( rdate == 0 && rtime == 0 && vdate == 0 && vtime == 0 ) return(value);
+
+  cdiDecodeDate(rdate, &ryear, &rmonth, &day);
+  cdiDecodeTime(rtime, &hour, &minute, &second);
+
+  encode_caldaysec(calendar, ryear, rmonth, day, hour, minute, second, &julday1, &secofday1);
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+
+  timeunit0 = timeunit;
+
+  if ( timeunit == TUNIT_MONTH && calendar == CALENDAR_360DAYS )
+    {
+      timeunit = TUNIT_DAY;
+    }
+
+  if ( timeunit == TUNIT_MONTH || timeunit == TUNIT_YEAR )
+    {
+      int nmonth, dpm;
+
+      dpm = days_per_month(calendar, year, month);
+
+      value = (year-ryear)*12 - rmonth + month;
+
+      nmonth = (int) value;
+      month -= nmonth;
+
+      while ( month > 12 ) { month -= 12; year++; }
+      while ( month <  1 ) { month += 12; year--; }
+
+      encode_caldaysec(calendar, year, month, day, hour, minute, second, &julday2, &secofday2);
+
+      julday_sub(julday1, secofday1, julday2, secofday2, &days, &secs);
+
+      value += (days+secs/86400.)/dpm;
+
+      if ( timeunit == TUNIT_YEAR ) value = value/12;
+    }
+  else
+    {
+      encode_caldaysec(calendar, year, month, day, hour, minute, second, &julday2, &secofday2);
+
+      julday_sub(julday1, secofday1, julday2, secofday2, &days, &secs);
+
+      cdiEncodeTimevalue(days, secs, timeunit, &value);
+    }
+
+  if ( timeunit0 == TUNIT_MONTH && calendar == CALENDAR_360DAYS )
+    {
+      value /= 30;
+    }
+
+  return (value);
+}
+
+
+void conv_timeval(double timevalue, int *rvdate, int *rvtime)
+{
+  int vdate = 0, vtime = 0;
+  int hour, minute, second;
+  int daysec;
+
+  vdate = (int) timevalue;
+  if ( vdate < 0 )
+    daysec = (int) (-(timevalue - vdate)*86400 + 0.01);
+  else
+    daysec = (int) ( (timevalue - vdate)*86400 + 0.01);
+
+  hour   =  daysec / 3600;
+  minute = (daysec - hour*3600)/60;
+  second =  daysec - hour*3600 - minute*60;
+  vtime  = cdiEncodeTime(hour, minute, second);
+
+  *rvdate = vdate;
+  *rvtime = vtime;
+}
+
+
+void splitTimevalue(double timevalue, int timeunit, int *date, int *time)
+{
+  int vdate = 0, vtime = 0;
+  int hour, minute, second;
+  int year, month, day;
+  static int lwarn = TRUE;
+
+  if ( timeunit == TUNIT_SECOND )
+    {
+      timevalue /= 86400;
+      conv_timeval(timevalue, &vdate, &vtime);
+    }
+  else if ( timeunit == TUNIT_HOUR )
+    {
+      timevalue /= 24;
+      conv_timeval(timevalue, &vdate, &vtime);
+    }
+  else if ( timeunit == TUNIT_DAY )
+    {
+      conv_timeval(timevalue, &vdate, &vtime);
+    }
+  else if ( timeunit == TUNIT_MONTH )
+    {
+      vdate = (int) timevalue*100;
+      vtime = 0;
+    }
+  else if ( timeunit == TUNIT_YEAR )
+    {
+      if ( timevalue < -214700 )
+	{
+	  Warning("Year %g out of range, set to -214700", timevalue);
+	  timevalue = -214700;
+	}
+      else if ( timevalue > 214700 )
+	{
+	  Warning("Year %g out of range, set to 214700", timevalue);
+	  timevalue = 214700;
+	}
+
+      vdate = (int) timevalue*10000;
+      vtime = 0;
+    }
+  else
+    {
+      if ( lwarn )
+	{
+	  Warning("timeunit %s unsupported!", tunitNamePtr(timeunit));
+	  lwarn = FALSE;
+	}
+    }
+
+  /* verify date and time */
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+
+  if ( month > 17 || day > 31 || hour > 23 || minute > 59 || second > 59 )
+    {
+      if ( (month  > 17 || day > 31) && (year < -9999 || year > 9999) ) year = 1;
+      if ( month  > 17 ) month  = 1;
+      if ( day    > 31 ) day    = 1;
+      if ( hour   > 23 ) hour   = 0;
+      if ( minute > 59 ) minute = 0;
+      if ( second > 59 ) second = 0;
+
+      vdate = cdiEncodeDate(year, month, day);
+      vtime = cdiEncodeTime(hour, minute, second);
+
+      Warning("Reset wrong date/time to %4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d!",
+	      year, month, day, hour, minute, second);
+    }
+
+  *date = vdate;
+  *time = vtime;
+}
+
+
+void cdiDecodeTimeval(double timevalue, taxis_t *taxis, int *date, int *time)
+{
+  if ( taxis->type == TAXIS_ABSOLUTE )
+    splitTimevalue(timevalue, taxis->unit, date, time);
+  else
+    timeval2vtime(timevalue, taxis, date, time);
+}
+
+
+double cdiEncodeTimeval(int date, int time, taxis_t *taxis)
+{
+  double timevalue;
+
+  if ( taxis->type == TAXIS_ABSOLUTE )
+    {
+      if ( taxis->unit == TUNIT_YEAR )
+	{
+	  int year, month, day;
+	  cdiDecodeDate(date, &year, &month, &day);
+
+	  timevalue = year;
+	}
+      else if ( taxis->unit == TUNIT_MONTH )
+	{
+	  int year, month, day;
+	  cdiDecodeDate(date, &year, &month, &day);
+	  if ( day == 0 )
+	    timevalue = date/100;
+	  else
+	    timevalue = date/100 + 0.5;
+	}
+      else
+	{
+	  int hour, minute, second;
+	  cdiDecodeTime(time, &hour, &minute, &second);
+	  if ( date < 0 )
+	    timevalue = -(-date + (hour*3600 + minute*60 + second)/86400.);
+	  else
+	    timevalue =    date + (hour*3600 + minute*60 + second)/86400.;
+	}
+    }
+  else
+    timevalue = vtime2timeval(date, time, taxis);
+
+  return (timevalue);
+}
+
+
+void ptaxisInit(taxis_t *taxisptr)
+{
+  taxisDefaultValue ( taxisptr );
+}
+
+
+void ptaxisCopy(taxis_t *dest, taxis_t *source)
+{
+  reshLock ();
+
+  /* memcpy(dest, source, sizeof(taxis_t)); */
+  dest->used       = source->used;
+  dest->type       = source->type;
+  dest->vdate      = source->vdate;
+  dest->vtime      = source->vtime;
+  dest->rdate      = source->rdate;
+  dest->rtime      = source->rtime;
+  dest->calendar   = source->calendar;
+  dest->unit       = source->unit;
+  dest->numavg     = source->numavg;
+  dest->has_bounds = source->has_bounds;
+  dest->vdate_lb   = source->vdate_lb;
+  dest->vtime_lb   = source->vtime_lb;
+  dest->vdate_ub   = source->vdate_ub;
+  dest->vtime_ub   = source->vtime_ub;
+
+  reshUnlock ();
+}
+
+
+void taxisPrintKernel ( taxis_t * taxisptr, FILE * fp )
+{
+  int vdate_lb, vdate_ub;
+  int vtime_lb, vtime_ub;
+
+  taxis_check_ptr ( __func__, taxisptr );
+
+  taxisInqVdateBounds ( taxisptr->self, &vdate_lb, &vdate_ub);
+  taxisInqVtimeBounds ( taxisptr->self, &vtime_lb, &vtime_ub);
+
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "# taxisID %d\n", taxisptr->self);
+  fprintf ( fp, "#\n");
+  fprintf ( fp, "self       = %d\n", taxisptr->self );
+  fprintf ( fp, "used       = %d\n", taxisptr->used );
+  fprintf ( fp, "type       = %d\n", taxisptr->type );
+  fprintf ( fp, "vdate      = %d\n", taxisptr->vdate );
+  fprintf ( fp, "vtime      = %d\n", taxisptr->vtime );
+  fprintf ( fp, "rdate      = %d\n", taxisptr->rdate );
+  fprintf ( fp, "rtime      = %d\n", taxisptr->rtime );
+  fprintf ( fp, "calendar   = %d\n", taxisptr->calendar );
+  fprintf ( fp, "unit       = %d\n", taxisptr->unit );
+  fprintf ( fp, "numavg     = %d\n", taxisptr->numavg );
+  fprintf ( fp, "has_bounds = %d\n", taxisptr->has_bounds );
+  fprintf ( fp, "vdate_lb   = %d\n", vdate_lb );
+  fprintf ( fp, "vtime_lb   = %d\n", vtime_lb );
+  fprintf ( fp, "vdate_ub   = %d\n", vdate_ub );
+  fprintf ( fp, "vtime_ub   = %d\n", vtime_ub );
+  fprintf ( fp, "\n");
+}
+
+void taxisPrint ( int taxisID )
+{
+  taxis_t * taxisptr;
+
+  taxisptr = ( taxis_t * ) reshGetVal ( taxisID, &taxisOps );
+  taxisPrintKernel ( taxisptr, stdout );
+}
+
+void taxisPrintP ( void * taxisptr, FILE * fp )
+{
+  taxisPrintKernel (( taxis_t * ) taxisptr, fp );
+}
+
+int taxisCompareP ( void *  taxisptr1, void * taxisptr2 )
+{
+  taxis_t * t1, * t2;
+
+  t1 = ( taxis_t * ) taxisptr1;
+  t2 = ( taxis_t * ) taxisptr2;
+
+  xassert ( t1 );
+  xassert ( t2 );
+
+  return ! ( t1->used       == t2->used       &&
+	     t1->type       == t2->type       &&
+	     t1->vdate      == t2->vdate      &&
+	     t1->vtime      == t2->vtime      &&
+	     t1->rdate      == t2->rdate      &&
+	     t1->rtime      == t2->rtime      &&
+	     t1->calendar   == t2->calendar   &&
+	     t1->unit       == t2->unit       &&
+	     t1->numavg     == t2->numavg     &&
+	     t1->has_bounds == t2->has_bounds &&
+	     t1->vdate_lb   == t2->vdate_lb   &&
+	     t1->vtime_lb   == t2->vtime_lb   &&
+	     t1->vdate_ub   == t2->vdate_ub   &&
+	     t1->vtime_ub   == t2->vtime_ub );
+}
+
+
+#ifdef USE_MPI
+static int
+taxisTxCode ( void )
+{
+  return TAXIS;
+}
+
+enum { taxisNint = 15 };
+
+static
+int taxisGetPackSize ( void * voidP, MPI_Comm comm )
+{
+  int packBufferSize = 0, size;
+
+  xmpi ( MPI_Pack_size ( taxisNint, MPI_INT, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBufferSize += size;
+
+  return packBufferSize;
+}
+
+
+void taxisUnpack ( char * unpackBuffer, int unpackBufferSize,
+		   int * unpackBufferPos, int nspTarget, MPI_Comm comm )
+{
+  taxis_t * taxisP;
+  int intBuffer[taxisNint];
+  double d;
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+		      intBuffer, taxisNint, MPI_INT, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+		      &d, 1, MPI_DOUBLE, comm ));
+
+  xassert ( xchecksum ( DATATYPE_INT, taxisNint, intBuffer ) == d );
+
+  taxisInit ();
+
+  taxisP = taxisNewEntry();
+  if ( ! taxisP ) Error("No memory");
+
+  xassert ( namespaceAdaptKey ( intBuffer[0], nspTarget ) == taxisP->self );
+
+  taxisP->used       = intBuffer[1];
+  taxisP->type       = intBuffer[2];
+  taxisP->vdate      = intBuffer[3];
+  taxisP->vtime      = intBuffer[4];
+  taxisP->rdate      = intBuffer[5];
+  taxisP->rtime      = intBuffer[6];
+  taxisP->calendar   = intBuffer[7];
+  taxisP->unit       = intBuffer[8];
+  taxisP->numavg     = intBuffer[9];
+  taxisP->has_bounds = intBuffer[10];
+  taxisP->vdate_lb   = intBuffer[11];
+  taxisP->vtime_lb   = intBuffer[12];
+  taxisP->vdate_ub   = intBuffer[13];
+  taxisP->vtime_ub   = intBuffer[14];
+}
+
+
+static
+void taxisPack ( void * voidP, void * packBuffer, int packBufferSize,
+		 int * packBufferPos, MPI_Comm comm )
+{
+  taxis_t   * taxisP = ( taxis_t * ) voidP;
+  int intBuffer[taxisNint];
+  double d;
+
+  intBuffer[0]  = taxisP->self; 
+  intBuffer[1]  = taxisP->used;      
+  intBuffer[2]  = taxisP->type;      
+  intBuffer[3]  = taxisP->vdate;     
+  intBuffer[4]  = taxisP->vtime;     
+  intBuffer[5]  = taxisP->rdate;     
+  intBuffer[6]  = taxisP->rtime;     
+  intBuffer[7]  = taxisP->calendar;  
+  intBuffer[8]  = taxisP->unit;      
+  intBuffer[9]  = taxisP->numavg;    
+  intBuffer[10] = taxisP->has_bounds;
+  intBuffer[11] = taxisP->vdate_lb;  
+  intBuffer[12] = taxisP->vtime_lb;  
+  intBuffer[13] = taxisP->vdate_ub;  
+  intBuffer[14] = taxisP->vtime_ub;  
+  
+  xmpi ( MPI_Pack ( intBuffer, taxisNint, MPI_INT, 
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+  d = xchecksum ( DATATYPE_INT, taxisNint, intBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+		    packBuffer, packBufferSize, packBufferPos, comm ));
+}
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/taxis.h b/libcdi/src/taxis.h
new file mode 100644
index 0000000..a57e090
--- /dev/null
+++ b/libcdi/src/taxis.h
@@ -0,0 +1,46 @@
+#ifndef _TAXIS_H
+#define _TAXIS_H
+
+
+typedef struct {
+  /* Date format  YYYYMMDD */
+  /* Time format    hhmmss */
+  int     self;
+  int     used;
+  int     type;           /* time type             */
+  int     vdate;          /* verification date     */
+  int     vtime;          /* verification time     */
+  int     rdate;          /* reference date        */
+  int     rtime;          /* reference time        */
+  int     calendar;
+  int     unit;           /* time unit             */
+  int     numavg;
+  int     has_bounds;
+  int     vdate_lb;       /* lower bounds of vdate */
+  int     vtime_lb;       /* lower bounds of vtime */
+  int     vdate_ub;       /* upper bounds of vdate */
+  int     vtime_ub;       /* upper bounds of vtime */
+  char   *name;
+  char   *longname;
+}
+taxis_t;
+
+void    ptaxisInit(taxis_t *taxis);
+void    ptaxisCopy(taxis_t *dest, taxis_t *source);
+taxis_t  *taxisPtr(int taxisID);
+void    cdiDecodeTimeval(double timevalue, taxis_t *taxis, int *date, int *time);
+double  cdiEncodeTimeval(int date, int time, taxis_t *taxis);
+void    timeval2vtime(double timevalue, taxis_t *taxis, int *vdate, int *vtime);
+double  vtime2timeval(int vdate, int vtime, taxis_t *taxis);
+
+
+#endif  /* _TAXIS_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/timebase.c b/libcdi/src/timebase.c
new file mode 100644
index 0000000..3c9a86d
--- /dev/null
+++ b/libcdi/src/timebase.c
@@ -0,0 +1,337 @@
+#include <stdio.h>
+#include <math.h>		/* for floor() */
+
+#include "cdi.h"
+
+
+/* convert Julian date into year, months, day */
+void decode_julday(int calendar,
+		   int julday,	/* Julian day number to convert */
+		   int *year,	/* Gregorian year (out)         */
+		   int *mon,	/* Gregorian month (1-12) (out) */
+		   int *day)	/* Gregorian day (1-31) (out)   */
+{
+  int a = julday;
+  double b, c;
+  double d, e, f;
+
+  b = floor((a - 1867216.25)/36524.25);
+  c = a + b - floor(b/4) + 1525;
+
+  if ( calendar == CALENDAR_STANDARD )
+    if ( a < 2299161 )
+      {
+	c = a + 1524;
+      } 
+
+  d = floor((c - 122.1)/365.25);
+  e = floor(365.25*d);
+  f = floor((c - e)/30.6001);
+
+  *day  = (int)(c - e - floor(30.6001*f));
+  *mon  = (int)(f - 1 - 12*floor(f/14));
+  *year = (int)(d - 4715 - floor((7 + *mon)/10));
+}
+
+
+/* convert year, month, day into Julian calendar day */
+int encode_julday(int calendar, int year, int month, int day)
+{
+  int iy;
+  int im;
+  int ib;
+  int julday;
+
+  if ( month <= 2 )
+    {
+      iy = year  - 1;
+      im = month + 12;
+    }
+  else
+    {
+      iy = year;
+      im = month;
+    }
+
+
+  if ( iy < 0 )
+    ib = (int)((iy+1)/400) - (int)((iy+1)/100);
+  else
+    ib = (int)(iy/400) - (int)(iy/100);
+
+  if ( calendar == CALENDAR_STANDARD )
+    {
+      if ( year > 1582 || (year == 1582 && (month > 10 || (month == 10 && day >= 15))) )
+	{
+	  /*
+	  ** 15th October 1582 AD or later
+	  */
+	}
+      else
+	{
+	  /*
+	  ** 4th October 1582 AD or earlier
+	  */
+	  ib = -2;
+	}
+    }
+
+  julday = (int) (floor(365.25*iy) + (int)(30.6001*(im+1)) + ib + 1720996.5 + day + 0.5);
+
+  return (julday);
+}
+
+
+int date_to_julday(int calendar, int date)
+{
+  int julday;
+  int year, month, day;
+
+  cdiDecodeDate(date, &year, &month, &day);
+
+  julday = encode_julday(calendar, year, month, day);
+
+  return (julday);
+}
+
+
+int julday_to_date(int calendar, int julday)
+{
+  int date;
+  int year, month, day;
+
+  decode_julday(calendar, julday, &year, &month, &day);
+
+  date = cdiEncodeDate(year, month, day);
+
+  return (date);
+}
+
+
+int time_to_sec(int time)
+{
+  int secofday;
+  int hour, minute, second;
+
+  cdiDecodeTime(time, &hour, &minute, &second);
+
+  secofday = hour*3600 + minute*60 + second;
+
+  return (secofday);
+}
+
+
+int sec_to_time(int secofday)
+{
+  int time;
+  int hour, minute, second;
+
+  hour   = secofday/3600;
+  minute = secofday/60 - hour*60;
+  second = secofday - hour*3600 - minute*60;
+
+  time = cdiEncodeTime(hour, minute, second);
+
+  return (time);
+}
+
+static
+void adjust_seconds(int *julday, int *secofday)
+{
+  int secperday = 86400;
+
+  while ( *secofday >= secperday ) 
+    { 
+      *secofday -= secperday; 
+      (*julday)++;
+    }
+
+  while ( *secofday <  0 ) 
+    { 
+      *secofday += secperday;
+      (*julday)--;
+    }
+}
+
+
+void julday_add_seconds(int seconds, int *julday, int *secofday)
+{
+  *secofday += seconds;
+
+  adjust_seconds(julday, secofday);
+}
+
+/* add days and secs to julday/secofday */
+void julday_add(int days, int secs, int *julday, int *secofday)
+{
+  *julday   += days;
+  *secofday += secs;
+
+  adjust_seconds(julday, secofday);
+}
+
+/* subtract julday1/secofday1 from julday2/secofday2 and returns the result in seconds */
+double julday_sub(int julday1, int secofday1, int julday2, int secofday2, int *days, int *secs)
+{
+  int seconds;
+
+  *days = julday2 - julday1;
+  *secs = secofday2 - secofday1;
+
+  adjust_seconds(days, secs);
+
+  seconds = *days*86400. + *secs;
+
+  return (seconds);
+}
+
+
+void encode_juldaysec(int calendar, int year, int month, int day, int hour, int minute, int *julday, int *secofday)
+{
+  *julday = encode_julday(calendar, year, month, day);
+
+  *secofday = (hour*60 + minute)*60;
+}
+
+
+void decode_juldaysec(int calendar, int julday, int secofday, int *year, int *month, int *day, int *hour, int *minute)
+{
+  decode_julday(calendar, julday, year, month, day);
+
+  *hour   = secofday/3600;
+  *minute = secofday/60 - *hour*60;
+}
+
+
+#ifdef TEST
+int main(void)
+{
+  int nmin;
+  int vdate0, vtime0;
+  int vdate, vtime;
+  int ijulinc;
+  int i, j = 0;
+  int year, mon, day, hour, minute, second;
+  int julday, secofday;
+
+  /* 1 - Check valid range of years */
+
+  nmin = 11000;
+  vdate0 = -80001201;
+  vtime0 = 120500;
+
+  printf("start time: %8d %4d\n", vdate0, vtime0);
+
+  for ( i = 0; i < nmin; i++ )
+    {
+      cdiDecodeDate(vdate0, &year, &mon, &day);
+      cdiDecodeTime(vtime0, &hour, &minute, &second);
+
+      julday  = date_to_julday(calendar, vdate0);
+      secofday = time_to_sec(vtime0);
+
+      vdate = julday_to_date(calendar, julday);
+      vtime = sec_to_time(secofday);
+
+      if ( vdate0 != vdate || vtime0 != vtime )
+	printf("%4d %8d %4d %8d %4d %9d %9d\n",
+	       ++j, vdate0, vtime0, vdate, vtime, julday, secofday);
+
+      year++;
+      vdate0 = cdiEncodeDate(year, mon, day);
+      vtime0 = cdiEncodeTime(hour, minute, second);
+    }
+
+  printf("stop time: %8d %4d\n", vdate0, vtime0);
+
+  /* 2 - Check time increment of one minute */
+
+  nmin = 120000;
+  ijulinc = 60;
+  vdate0 = 20001201;
+  vtime0 = 0;
+
+  printf("start time: %8d %4d\n", vdate0, vtime0);
+
+  julday = date_to_julday(calendar, vdate0);
+  secofday = time_to_sec(vtime0);
+  for ( i = 0; i < nmin; i++ )
+    {
+      cdiDecodeDate(vdate0, &year, &mon, &day);
+      cdiDecodeTime(vtime0, &hour, &minute, &second);
+
+      if ( ++minute >= 60 )
+	{
+	  minute = 0;
+	  if ( ++hour >= 24 )
+	    {
+	      hour = 0;
+	      if ( ++day >= 32 )
+		{
+		  day = 1;
+		  if ( ++mon >= 13 )
+		    {
+		      mon = 1;
+		      year++;
+		    }
+		}
+	    }
+	}
+
+      vdate0 = cdiEncodeDate(year, mon, day);
+      vtime0 = cdiEncodeTime(hour, minute, second);
+
+      julday_add_seconds(ijulinc, &julday, &secofday);
+
+      vdate = julday_to_date(calendar, julday);
+      vtime = sec_to_time(secofday);
+      if ( vdate0 != vdate || vtime0 != vtime )
+	printf("%4d %8d %4d %8d %4d %9d %9d\n",
+	       ++j, vdate0, vtime0, vdate, vtime, julday, secofday);
+    }
+
+  printf("stop time: %8d %4d\n", vdate0, vtime0);
+
+  return (0);
+}
+#endif
+
+
+#ifdef TEST2
+int main(void)
+{
+  int i;
+  int julday, secofday;
+  int year, month, day, hour, minute;
+  int value = 30;
+  int factor = 86400;
+
+  year=1979; month=1; day=15; hour=12; minute=30;
+
+  printf("%d/%02d/%02d %02d:%02d\n", year, month, day, hour, minute);
+
+  encode_juldaysec(calendar, year, month, day, hour, minute, &julday, &secofday);
+
+  decode_juldaysec(calendar, julday, secofday, &year, &month, &day, &hour, &minute);
+  printf("%d/%02d/%02d %02d:%02d   %d %d\n", year, month, day, hour, minute, julday, secofday);
+
+  for ( i = 0; i < 420; i++ )
+    {
+
+      decode_juldaysec(calendar, julday, secofday, &year, &month, &day, &hour, &minute);
+      printf("%2d %d/%02d/%02d %02d:%02d\n", i, year, month, day, hour, minute);
+      julday_add_seconds(value*factor, &julday, &secofday);
+    }
+
+  return (0);
+}
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/timebase.h b/libcdi/src/timebase.h
new file mode 100644
index 0000000..483a978
--- /dev/null
+++ b/libcdi/src/timebase.h
@@ -0,0 +1,32 @@
+#ifndef  _TIMEBASE_H
+#define  _TIMEBASE_H
+
+/* date format:  YYYYMMDD */
+/* time format:  hhmmss   */
+
+void decode_julday(int calendar, int julday, int *year, int *mon, int *day);
+int  encode_julday(int calendar, int year, int month, int day);
+
+int date_to_julday(int calendar, int date);
+int julday_to_date(int calendar, int julday);
+
+int time_to_sec(int time);
+int sec_to_time(int secofday);
+
+void   julday_add_seconds(int seconds, int *julday, int *secofday);
+void   julday_add(int days, int secs, int *julday, int *secofday);
+double julday_sub(int julday1, int secofday1, int julday2, int secofday2, int *days, int *secs);
+
+void encode_juldaysec(int calendar, int year, int month, int day, int hour, int minute, int *julday, int *secofday);
+void decode_juldaysec(int calendar, int julday, int secofday, int *year, int *month, int *day, int *hour, int *minute);
+
+#endif  /* _TIMEBASE_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/tsteps.c b/libcdi/src/tsteps.c
new file mode 100644
index 0000000..0d33d94
--- /dev/null
+++ b/libcdi/src/tsteps.c
@@ -0,0 +1,102 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include "dmemory.h"
+
+#include "cdi.h"
+#include "stream_int.h"
+
+
+static void tstepsInitEntry(int streamID, int tsID)
+{
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  streamptr->tsteps[tsID].curRecID     = CDI_UNDEFID;
+  streamptr->tsteps[tsID].position     = 0;
+  streamptr->tsteps[tsID].records      = NULL;
+  streamptr->tsteps[tsID].recordSize   = 0;
+  streamptr->tsteps[tsID].nallrecs     = 0;
+  streamptr->tsteps[tsID].recIDs       = NULL;
+  streamptr->tsteps[tsID].nrecs        = 0;
+  streamptr->tsteps[tsID].next         = 0;
+
+  ptaxisInit(&streamptr->tsteps[tsID].taxis);
+}
+
+int tstepsNewEntry(int streamID)
+{
+  int tsID = 0;
+  int tstepsTableSize;
+  tsteps_t *tstepsTable;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  tsID            = streamptr->tstepsNextID++;
+  tstepsTableSize = streamptr->tstepsTableSize;
+  tstepsTable     = streamptr->tsteps;
+
+  /*
+    If the table overflows, double its size.
+  */
+  if ( tsID == tstepsTableSize )
+    {
+      if ( tstepsTableSize == 0 ) tstepsTableSize = 1;
+      tstepsTableSize = 2*tstepsTableSize;
+      tstepsTable = (tsteps_t *) realloc(tstepsTable, tstepsTableSize*sizeof(tsteps_t));
+      if ( tstepsTable == NULL )
+	{
+          Message("tstepsTableSize = %d", tstepsTableSize);
+	  SysError("Reallocation of tsteps_t failed");
+	}
+    }
+
+  streamptr->tstepsTableSize = tstepsTableSize;
+  streamptr->tsteps          = tstepsTable;
+
+  tstepsInitEntry(streamID, tsID);
+
+  streamptr->tsteps[tsID].taxis.used = TRUE;
+
+  return (tsID);
+}
+
+void cdiCreateTimesteps(int streamID)
+{
+  int ntsteps;
+  int tsID;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  if ( streamptr->ntsteps < 0 || streamptr->tstepsTableSize > 0 )
+    return;
+
+  if ( streamptr->ntsteps == 0 ) ntsteps = 1;    /* <<<<<-------- */
+  else ntsteps = streamptr->ntsteps;
+
+  streamptr->tsteps = (tsteps_t *) malloc(ntsteps*sizeof(tsteps_t));
+  if ( streamptr->tsteps == NULL )
+    SysError("Allocation of tsteps_t failed");
+
+  streamptr->tstepsTableSize = ntsteps;
+  streamptr->tstepsNextID    = ntsteps;
+
+  for ( tsID = 0; tsID < ntsteps; tsID++ )
+    {
+      tstepsInitEntry(streamID, tsID);
+      streamptr->tsteps[tsID].taxis.used = TRUE;
+    }
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/util.c b/libcdi/src/util.c
new file mode 100644
index 0000000..4d18c5a
--- /dev/null
+++ b/libcdi/src/util.c
@@ -0,0 +1,63 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <float.h>
+#include <sys/types.h>
+
+#include "stream_int.h"
+#include "dmemory.h"
+#include "binary.h"
+
+
+#undef  IsBigendian
+#define IsBigendian()  ( u_byteorder.c[sizeof(long) - 1] )
+
+void cdiPrintDatatypes(void)
+{
+  /* IsBigendian returns 1 for big endian byte order */
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+
+  fprintf (stderr, "+-------------+-------+\n"); 
+  fprintf (stderr, "| types       | bytes |\n"); 
+  fprintf (stderr, "+-------------+-------+\n"); 
+  fprintf (stderr, "| void *      |   %3d |\n", (int) sizeof(void *));
+  fprintf (stderr, "+-------------+-------+\n"); 
+  fprintf (stderr, "| char        |   %3d |\n", (int) sizeof(char));
+  fprintf (stderr, "+-------------+-------+\n"); 
+  fprintf (stderr, "| short       |   %3d |\n", (int) sizeof(short));
+  fprintf (stderr, "| int         |   %3d |\n", (int) sizeof(int));
+  fprintf (stderr, "| long        |   %3d |\n", (int) sizeof(long));
+  fprintf (stderr, "| long long   |   %3d |\n", (int) sizeof(long long));
+  fprintf (stderr, "| size_t      |   %3d |\n", (int) sizeof(size_t));
+  fprintf (stderr, "| off_t       |   %3d |\n", (int) sizeof(off_t));
+  fprintf (stderr, "+-------------+-------+\n"); 
+  fprintf (stderr, "| float       |   %3d |\n", (int) sizeof(float));
+  fprintf (stderr, "| double      |   %3d |\n", (int) sizeof(double));
+  fprintf (stderr, "| long double |   %3d |\n", (int) sizeof(long double));
+  fprintf (stderr, "+-------------+-------+\n\n"); 
+#define XSTRING(x)	#x
+#define STRING(x)	XSTRING(x)
+  fprintf (stderr, "+-------------+-----------+\n"); 
+  fprintf (stderr, "| INT32       | %-9s |\n", STRING(INT32));
+  fprintf (stderr, "| INT64       | %-9s |\n", STRING(INT64));
+  fprintf (stderr, "| FLT32       | %-9s |\n", STRING(FLT32));
+  fprintf (stderr, "| FLT64       | %-9s |\n", STRING(FLT64));
+  fprintf (stderr, "+-------------+-----------+\n");
+
+  if ( IsBigendian() )
+    fprintf (stderr, "\n  byte ordering is BIGENDIAN\n\n");
+  else
+    fprintf (stderr, "\n  byte ordering is LITTLEENDIAN\n\n");
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/varscan.c b/libcdi/src/varscan.c
new file mode 100644
index 0000000..90c3d53
--- /dev/null
+++ b/libcdi/src/varscan.c
@@ -0,0 +1,941 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <string.h>
+#include <math.h>
+
+#include "cdi.h"
+#include "stream_int.h"
+#include "dmemory.h"
+#include "varscan.h"
+#include "vlist.h"
+#include "grid.h"
+
+
+extern void zaxisGetIndexList ( int, int * );
+
+
+#undef  UNDEFID
+#define UNDEFID -1
+
+static size_t Vctsize = 0;
+static double *Vct = NULL;
+
+static int numberOfVerticalLevels = 0;
+static int numberOfVerticalGrid = 0;
+static char uuidVGrid[17];
+
+typedef struct
+{
+  int      level1;
+  int      level2;
+  int      recID;
+  int      lindex;
+}
+leveltable_t;
+
+typedef struct
+{
+  int         param;
+  int         prec;
+  int         tsteptype;
+  int         timave;
+  int         timaccu;
+  int         gridID;
+  int         zaxistype;
+  int         ltype;     /* GRIB level type */
+  int         lbounds;
+  int         zaxisID;
+  int         nlevels;
+  int         levelTableSize;
+  leveltable_t *levelTable;
+  int         instID;
+  int         modelID;
+  int         tableID;
+  int         comptype;       // compression type
+  int         complevel;      // compression level
+  int         lmissval;
+  double      missval;
+  char       *name;
+  char       *longname;
+  char       *units;
+  ensinfo_t  *ensdata;
+}
+vartable_t;
+
+
+int vartableInit = 0;
+vartable_t *vartable;
+static int varTablesize = 0;
+int nvars = 0;
+
+
+static
+void paramInitEntry(int varID, int param)
+{
+  vartable[varID].param          = param;
+  vartable[varID].prec           = 0;
+  vartable[varID].tsteptype      = TSTEP_INSTANT;
+  vartable[varID].timave         = 0;
+  vartable[varID].timaccu        = 0;
+  vartable[varID].gridID         = UNDEFID;
+  vartable[varID].zaxistype      = 0;
+  vartable[varID].ltype          = 0;
+  vartable[varID].levelTable     = NULL;
+  vartable[varID].levelTableSize = 0;
+  vartable[varID].nlevels        = 0;
+  vartable[varID].instID         = UNDEFID;
+  vartable[varID].modelID        = UNDEFID;
+  vartable[varID].tableID        = UNDEFID;
+  vartable[varID].comptype       = COMPRESS_NONE;
+  vartable[varID].complevel      = 1;
+  vartable[varID].lmissval       = 0;
+  vartable[varID].missval        = 0;
+  vartable[varID].name           = NULL;
+  vartable[varID].longname       = NULL;
+  vartable[varID].units          = NULL;
+  vartable[varID].ensdata        = NULL;
+}
+
+static
+int varGetEntry(int param, int zaxistype, int ltype)
+{
+  int varID;
+
+  for ( varID = 0; varID < varTablesize; varID++ )
+    {
+      if ( vartable[varID].param     == param     &&
+	   vartable[varID].zaxistype == zaxistype &&
+	   vartable[varID].ltype     == ltype )
+	return (varID);
+    }
+
+  return (UNDEFID);
+}
+
+static
+void varFree(void)
+{
+  int varID;
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( vartable[varID].levelTable )
+	free(vartable[varID].levelTable);
+
+      if ( vartable[varID].name )     free(vartable[varID].name);
+      if ( vartable[varID].longname ) free(vartable[varID].longname);
+      if ( vartable[varID].units )    free(vartable[varID].units);
+      if ( vartable[varID].ensdata )  free(vartable[varID].ensdata);
+    }
+
+  if ( vartable )
+    free(vartable);
+
+  vartable = NULL;
+  varTablesize = 0;
+  nvars = 0;
+
+  if ( Vct )
+    free(Vct);
+
+  Vct = NULL;
+  Vctsize = 0;
+}
+
+static
+int levelNewEntry(int varID, int level1, int level2)
+{
+  int levelID = 0;
+  int levelTableSize;
+  leveltable_t *levelTable;
+
+  levelTableSize = vartable[varID].levelTableSize;
+  levelTable     = vartable[varID].levelTable;
+
+  /*
+    Look for a free slot in levelTable.
+    (Create the table the first time through).
+  */
+  if ( ! levelTableSize )
+    {
+      int i;
+
+      levelTableSize = 2;
+      levelTable = (leveltable_t *) malloc(levelTableSize*sizeof(leveltable_t));
+      if( levelTable == NULL )
+	{
+          Message("levelTableSize = %d", levelTableSize);
+	  SysError("Allocation of leveltable failed!");
+	}
+
+      for( i = 0; i < levelTableSize; i++ )
+	levelTable[i].recID = UNDEFID;
+    }
+  else
+    {
+      while( levelID < levelTableSize )
+	{
+	  if ( levelTable[levelID].recID == UNDEFID ) break;
+	  levelID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if( levelID == levelTableSize )
+    {
+      int i;
+
+      levelTableSize = 2*levelTableSize;
+      levelTable = (leveltable_t *) realloc(levelTable, levelTableSize*sizeof(leveltable_t));
+      if( levelTable == NULL )
+	{
+          Message("levelTableSize = %d", levelTableSize);
+	  SysError("Reallocation of leveltable failed");
+	}
+      levelID = levelTableSize/2;
+
+      for( i = levelID; i < levelTableSize; i++ )
+	levelTable[i].recID = UNDEFID;
+    }
+
+  levelTable[levelID].level1 = level1;
+  levelTable[levelID].level2 = level2;
+  levelTable[levelID].lindex = levelID;
+
+  vartable[varID].nlevels = levelID+1;
+  vartable[varID].levelTableSize = levelTableSize;
+  vartable[varID].levelTable = levelTable;
+
+  return (levelID);
+}
+
+#define  UNDEF_PARAM  -4711
+
+static
+int paramNewEntry(int param)
+{
+  int varID = 0;
+
+  /*
+    Look for a free slot in vartable.
+    (Create the table the first time through).
+  */
+  if ( ! varTablesize )
+    {
+      int i;
+
+      varTablesize = 2;
+      vartable = (vartable_t *) malloc(varTablesize*sizeof(vartable_t));
+      if( vartable == NULL )
+	{
+          Message("varTablesize = %d", varTablesize);
+	  SysError("Allocation of vartable failed");
+	}
+
+      for( i = 0; i < varTablesize; i++ )
+	vartable[i].param = UNDEF_PARAM;
+    }
+  else
+    {
+      while( varID < varTablesize )
+	{
+	  if ( vartable[varID].param == UNDEF_PARAM ) break;
+	  varID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if ( varID == varTablesize )
+    {
+      int i;
+
+      varTablesize = 2*varTablesize;
+      vartable = (vartable_t *) realloc(vartable, varTablesize*sizeof(vartable_t));
+      if( vartable == NULL )
+	{
+          Message("varTablesize = %d", varTablesize);
+	  SysError("Reallocation of vartable failed!");
+	}
+      varID = varTablesize/2;
+
+      for( i = varID; i < varTablesize; i++ )
+	vartable[i].param = UNDEF_PARAM;
+    }
+
+  paramInitEntry(varID, param);
+
+  return (varID);
+}
+
+
+void varAddRecord(int recID, int param, int gridID, int zaxistype, int lbounds,
+		  int level1, int level2, int prec,
+		  int *pvarID, int *plevelID, int tsteptype, int numavg, int ltype,
+		  const char *name, const char *longname, const char *units)
+{
+  int varID = UNDEFID;
+  int levelID = -1;
+
+  if ( ! (cdiSplitLtype105 == 1 && zaxistype == ZAXIS_HEIGHT) )
+    varID = varGetEntry(param, zaxistype, ltype);
+
+  if ( varID == UNDEFID )
+    {
+      nvars++;
+      varID = paramNewEntry(param);
+      vartable[varID].gridID    = gridID;
+      vartable[varID].zaxistype = zaxistype;
+      vartable[varID].ltype     = ltype;
+      vartable[varID].lbounds   = lbounds;
+      if ( tsteptype != UNDEFID ) vartable[varID].tsteptype = tsteptype;
+      if ( numavg ) vartable[varID].timave = 1;
+
+      if ( name )     if ( name[0] )     vartable[varID].name     = strdup(name);
+      if ( longname ) if ( longname[0] ) vartable[varID].longname = strdup(longname);
+      if ( units )    if ( units[0] )    vartable[varID].units    = strdup(units);
+    }
+  else
+    {
+      if ( vartable[varID].gridID != gridID )
+	{
+	  char paramstr[32];
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+	  Message("param = %s gridID = %d", paramstr, gridID);
+	  Error("horizontal grid must not change for same param!");
+	}
+      if ( vartable[varID].zaxistype != zaxistype )
+	{
+	  char paramstr[32];
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+	  Message("param = %s zaxistype = %d", paramstr, zaxistype);
+	  Error("zaxistype must not change for same param!");
+	}
+    }
+
+  if ( prec > vartable[varID].prec ) vartable[varID].prec = prec;
+
+  levelID = levelNewEntry(varID, level1, level2);
+  vartable[varID].levelTable[levelID].recID = recID;
+
+  if ( CDI_Debug )
+    Message("varID = %d  levelID = %d", varID, levelID);
+
+  *pvarID   = varID;
+  *plevelID = levelID;
+}
+
+static
+int dblcmp(const void *s1, const void *s2)
+{
+  int cmp = 0;
+
+  if      ( *((double *) s1) < *((double *) s2) ) cmp = -1;
+  else if ( *((double *) s1) > *((double *) s2) ) cmp =  1;
+
+  return (cmp);
+}
+
+static
+int cmpLevelTable(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  leveltable_t *x = (leveltable_t *) s1;
+  leveltable_t *y = (leveltable_t *) s2;
+  /*
+  printf("%g %g  %d %d\n", x->leve11, y->level1, x, y);
+  */
+  if      ( x->level1 < y->level1 ) cmp = -1;
+  else if ( x->level1 > y->level1 ) cmp =  1;
+
+  return (cmp);
+}
+
+
+typedef struct
+{
+  int      varid;
+  int      param;
+  int      ltype;
+}
+param_t;
+
+
+static
+int cmpparam(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  param_t *x = (param_t *) s1;
+  param_t *y = (param_t *) s2;
+
+  if      ( x->param > y->param ) cmp =  1;
+  else if ( x->param < y->param ) cmp = -1;
+
+  return (cmp);
+}
+
+
+static
+int cmpltype(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  param_t *x = (param_t *) s1;
+  param_t *y = (param_t *) s2;
+
+  if      ( x->ltype > y->ltype ) cmp =  1;
+  else if ( x->ltype < y->ltype ) cmp = -1;
+
+  return (cmp);
+}
+
+
+void cdiGenVars(int streamID)
+{
+  int varID, gridID, zaxisID, levelID;
+  int instID, modelID, tableID;
+  int param, nlevels, zaxistype, lindex, ltype;
+  int prec;
+  int tsteptype;
+  int timave, timaccu;
+  int lbounds;
+  int comptype;
+  char name[CDI_MAX_NAME], longname[CDI_MAX_NAME], units[CDI_MAX_NAME];
+  double *dlevels = NULL;
+  double *dlevels1 = NULL;
+  double *dlevels2 = NULL;
+  int vlistID;
+  int *varids, index, varid;
+  stream_t *streamptr;
+
+  streamptr = stream_to_pointer(streamID);
+
+  vlistID =  streamInqVlist(streamID);
+
+  varids = (int *) malloc(nvars*sizeof(int));
+  for ( varID = 0; varID < nvars; varID++ ) varids[varID] = varID;
+
+  if ( streamptr->sortname )
+    {
+      int index;
+      param_t **varInfo;
+      varInfo    = (param_t **) malloc(nvars*sizeof(param_t *));
+      varInfo[0] = (param_t *)  malloc(nvars*sizeof(param_t));
+
+      for ( index = 1; index < nvars; index++ )
+	varInfo[index] = varInfo[0] + index;
+
+      for ( varid = 0; varid < nvars; varid++ )
+	{
+	  varInfo[varid]->varid = varids[varid];
+	  varInfo[varid]->param = vartable[varid].param;
+	  varInfo[varid]->ltype = vartable[varid].ltype;
+	}
+      qsort(varInfo[0], nvars, sizeof(param_t), cmpltype);
+      qsort(varInfo[0], nvars, sizeof(param_t), cmpparam);
+      for ( varid = 0; varid < nvars; varid++ )
+	{
+	  varids[varid] = varInfo[varid]->varid;
+	}
+      free(varInfo[0]);
+      free(varInfo);
+    }
+
+  for ( index = 0; index < nvars; index++ )
+    {
+      varid     = varids[index];
+
+      gridID    = vartable[varid].gridID;
+      param     = vartable[varid].param;
+      nlevels   = vartable[varid].nlevels;
+      ltype     = vartable[varid].ltype;
+      zaxistype = vartable[varid].zaxistype;
+      if ( ltype == 0 && zaxistype == ZAXIS_GENERIC && cdiDefaultLeveltype != -1 )
+	zaxistype = cdiDefaultLeveltype;
+      lbounds   = vartable[varid].lbounds;
+      prec      = vartable[varid].prec;
+      instID    = vartable[varid].instID;
+      modelID   = vartable[varid].modelID;
+      tableID   = vartable[varid].tableID;
+      tsteptype = vartable[varid].tsteptype;
+      timave    = vartable[varid].timave;
+      timaccu   = vartable[varid].timaccu;
+      comptype  = vartable[varid].comptype;
+
+      zaxisID = UNDEFID;
+
+      if ( ltype == 0 && zaxistype == ZAXIS_GENERIC && nlevels == 1 &&
+	   ! (fabs(vartable[varid].levelTable[0].level1)>0) )
+	zaxistype = ZAXIS_SURFACE;
+
+      dlevels = (double *) malloc(nlevels*sizeof(double));
+
+      if ( lbounds && zaxistype != ZAXIS_HYBRID && zaxistype != ZAXIS_HYBRID_HALF )
+	for ( levelID = 0; levelID < nlevels; levelID++ )
+	  dlevels[levelID] = (vartable[varid].levelTable[levelID].level1 +
+	                      vartable[varid].levelTable[levelID].level2)/2;
+      else
+	for ( levelID = 0; levelID < nlevels; levelID++ )
+	  dlevels[levelID] = vartable[varid].levelTable[levelID].level1;
+
+      if ( nlevels > 1 )
+	{
+	  int linc = FALSE, ldec = FALSE;
+	  /* check increasing of levels */
+	  for ( levelID = 1; levelID < nlevels; levelID++ )
+	    if ( dlevels[levelID] < dlevels[levelID-1] ) break;
+
+	  if ( levelID == nlevels ) linc = TRUE;
+
+	  if ( linc == FALSE )
+	    {
+	      /* check decreasing of levels */
+	      for ( levelID = 1; levelID < nlevels; levelID++ )
+		if ( dlevels[levelID] > dlevels[levelID-1] ) break;
+
+	      if ( levelID == nlevels ) ldec = TRUE;
+
+	      if ( ldec == FALSE ||
+		   zaxistype == ZAXIS_HYBRID ||
+		   zaxistype == ZAXIS_DEPTH_BELOW_LAND )
+		{
+		  /*
+		  qsort(dlevels, nlevels, sizeof(double), dblcmp);
+		  */
+		  qsort(vartable[varid].levelTable, nlevels, 
+			sizeof(leveltable_t), cmpLevelTable);
+
+		  if ( lbounds && zaxistype != ZAXIS_HYBRID && zaxistype != ZAXIS_HYBRID_HALF )
+		    for ( levelID = 0; levelID < nlevels; levelID++ )
+		      dlevels[levelID] = (vartable[varid].levelTable[levelID].level1 +
+					  vartable[varid].levelTable[levelID].level2)/2.;
+		  else
+		    for ( levelID = 0; levelID < nlevels; levelID++ )
+		      dlevels[levelID] = vartable[varid].levelTable[levelID].level1;
+		}
+	    }
+	}
+
+      if ( lbounds )
+	{
+	  dlevels1 = (double *) malloc(nlevels*sizeof(double));
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    dlevels1[levelID] = vartable[varid].levelTable[levelID].level1;
+	  dlevels2 = (double *) malloc(nlevels*sizeof(double));
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    dlevels2[levelID] = vartable[varid].levelTable[levelID].level2;
+	}
+
+      zaxisID = varDefZaxis(vlistID, zaxistype, nlevels, dlevels, lbounds, dlevels1, dlevels2,
+			    Vctsize, Vct, NULL, NULL, NULL, 0, 0, ltype);
+
+      if ( lbounds ) free(dlevels1);
+      if ( lbounds ) free(dlevels2);
+      free(dlevels);
+
+      varID = streamNewVar(streamID, gridID, zaxisID);
+      varID = vlistDefVar(vlistID, gridID, zaxisID, tsteptype);
+
+      vlistDefVarParam(vlistID, varID, param);
+      vlistDefVarDatatype(vlistID, varID, prec);
+      vlistDefVarTimave(vlistID, varID, timave);
+      vlistDefVarTimaccu(vlistID, varID, timaccu);
+      vlistDefVarCompType(vlistID, varID, comptype);
+
+      if ( vartable[varid].lmissval ) vlistDefVarMissval(vlistID, varID, vartable[varid].missval);
+
+      if ( vartable[varid].name )     vlistDefVarName(vlistID, varID, vartable[varid].name);
+      if ( vartable[varid].longname ) vlistDefVarLongname(vlistID, varID, vartable[varid].longname);
+      if ( vartable[varid].units )    vlistDefVarUnits(vlistID, varID, vartable[varid].units);
+
+      if ( vartable[varid].ensdata )  vlistDefVarEnsemble(vlistID, varID, vartable[varid].ensdata->ens_index,
+	                                                  vartable[varid].ensdata->ens_count,
+							  vartable[varid].ensdata->forecast_init_type);
+
+      if ( cdiDefaultTableID != UNDEFID )
+	{
+	  int pdis, pcat, pnum;
+	  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+	  if ( tableInqParNamePtr(cdiDefaultTableID, pnum) )
+	    {
+	      if ( tableID != UNDEFID )
+		{
+		  strcpy(name, tableInqParNamePtr(cdiDefaultTableID, pnum));
+		  vlistDefVarName(vlistID, varID, name);
+		  if ( tableInqParLongnamePtr(cdiDefaultTableID, pnum) )
+		    {
+		      strcpy(longname, tableInqParLongnamePtr(cdiDefaultTableID, pnum));
+		      vlistDefVarLongname(vlistID, varID, longname);
+		    }
+		  if ( tableInqParUnitsPtr(cdiDefaultTableID, pnum) )
+		    {
+		      strcpy(units, tableInqParUnitsPtr(cdiDefaultTableID, pnum));
+		      vlistDefVarUnits(vlistID, varID, units);
+		    }
+		}
+	      else
+		tableID = cdiDefaultTableID;
+	    }
+	  if ( cdiDefaultModelID != UNDEFID ) modelID = cdiDefaultModelID;
+	  if ( cdiDefaultInstID  != UNDEFID )  instID = cdiDefaultInstID;
+	}
+
+      if ( instID  != UNDEFID ) vlistDefVarInstitut(vlistID, varID, instID);
+      if ( modelID != UNDEFID ) vlistDefVarModel(vlistID, varID, modelID);
+      if ( tableID != UNDEFID ) vlistDefVarTable(vlistID, varID, tableID);
+    }
+
+  for ( index = 0; index < nvars; index++ )
+    {
+      varID     = index;
+      varid     = varids[index];
+
+      nlevels   = vartable[varid].nlevels;
+      /*
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	{
+	  lindex = vartable[varid].levelTable[levelID].lindex;
+	  printf("%d %d %d %d %d\n", varID, levelID, 
+		 vartable[varid].levelTable[levelID].lindex,
+		 vartable[varid].levelTable[levelID].recID,
+		 vartable[varid].levelTable[levelID].level1);
+	}
+      */
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	{
+	  streamptr->vars[varID].level[levelID] =
+	    vartable[varid].levelTable[levelID].recID;
+	  for ( lindex = 0; lindex < nlevels; lindex++ )
+	    if ( levelID == vartable[varid].levelTable[lindex].lindex ) break;
+
+	  if ( lindex == nlevels )
+	    Error("Internal problem! lindex not found.");
+
+	  streamptr->vars[varID].lindex[levelID] = lindex;
+	}
+    }
+
+  free(varids);
+
+  varFree();
+}
+
+
+void varDefVCT(size_t vctsize, double *vctptr)
+{
+  if ( Vct == NULL && vctptr != NULL && vctsize > 0 )
+    {
+      Vctsize = vctsize;
+      Vct = (double *) malloc(vctsize*sizeof(double));
+      memcpy(Vct, vctptr, vctsize*sizeof(double));
+    }
+}
+
+
+void varDefZAxisReference(int nlev, int nvgrid, char *uuid)
+{
+  numberOfVerticalLevels = nlev;
+  numberOfVerticalGrid = nvgrid;
+  strncpy(uuidVGrid, uuid, 16);
+}
+
+
+int varDefGrid(int vlistID, grid_t grid, int mode)
+{
+  /*
+    mode: 0 search in vlist and grid table
+          1 search in grid table
+   */
+  int gridglobdefined = FALSE;
+  int griddefined;
+  int ngrids;
+  int gridID = UNDEFID;
+  int index;
+  vlist_t *vlistptr;
+  int * gridIndexList, i;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  griddefined = FALSE;
+  ngrids = vlistptr->ngrids;
+
+  if ( mode == 0 )
+    for ( index = 0; index < ngrids; index++ )
+      {
+	gridID = vlistptr->gridIDs[index];
+	if ( gridID == UNDEFID )
+	  Error("Internal problem: undefined gridID %d!", gridID);
+
+	if ( gridCompare(gridID, grid) == 0 )
+	  {
+	    griddefined = TRUE;
+	    break;
+	  }
+      }
+
+  if ( ! griddefined )
+    {
+      ngrids = gridSize();
+      if ( ngrids > 0 )
+        {
+          gridIndexList = malloc(ngrids*sizeof(int));
+          gridGetIndexList ( ngrids, gridIndexList );
+          for ( i = 0; i < ngrids; i++ )
+            {
+              gridID = gridIndexList[i];
+              if ( gridCompare(gridID, grid) == 0 )
+                {
+                  gridglobdefined = TRUE;
+                  break;
+                }
+            }
+          if ( gridIndexList ) free ( gridIndexList );
+        }
+
+      ngrids = vlistptr->ngrids;
+      if ( mode == 1 )
+	for ( index = 0; index < ngrids; index++ )
+	  if ( vlistptr->gridIDs[index] == gridID )
+	    {
+	      gridglobdefined = FALSE;
+	      break;
+	    }
+    }
+
+  if ( ! griddefined )
+    {
+      if ( ! gridglobdefined ) gridID = gridGenerate(grid);
+      ngrids = vlistptr->ngrids;
+      vlistptr->gridIDs[ngrids] = gridID;
+      vlistptr->ngrids++;
+    }
+
+  return (gridID);
+}
+
+
+int zaxisCompare(int zaxisID, int zaxistype, int nlevels, int lbounds, double *levels, char *longname, char *units, int ltype)
+{
+  int differ = 1;
+  int levelID;
+  int zlbounds = 0;
+  int ltype_is_equal = FALSE;
+
+  if ( ltype == zaxisInqLtype(zaxisID) ) ltype_is_equal = TRUE;
+
+  if ( ltype_is_equal && (zaxistype == zaxisInqType(zaxisID) || zaxistype == ZAXIS_GENERIC) )
+    {
+      if ( zaxisInqLbounds(zaxisID, NULL) > 0 ) zlbounds = 1;
+      if ( nlevels == zaxisInqSize(zaxisID) && zlbounds == lbounds )
+	{
+	  const double *dlevels;
+	  char zlongname[CDI_MAX_NAME];
+	  char zunits[CDI_MAX_NAME];
+
+	  dlevels = zaxisInqLevelsPtr(zaxisID);
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    {
+	      if ( fabs(dlevels[levelID] - levels[levelID]) > 1.e-9 )
+		break;
+	    }
+
+	  if ( levelID == nlevels ) differ = 0;
+
+	  if ( ! differ )
+	    {
+	      zaxisInqLongname(zaxisID, zlongname);
+	      zaxisInqUnits(zaxisID, zunits);
+	      if ( longname && zlongname[0] )
+		{
+		  if ( strcmp(longname, zlongname) != 0 ) differ = 1;
+		}
+	      if ( units && zunits[0] )
+		{
+		  if ( strcmp(units, zunits) != 0 ) differ = 1;
+		}
+	    }
+	}
+    }
+
+  return (differ);
+}
+
+
+int varDefZaxis(int vlistID, int zaxistype, int nlevels, double *levels, int lbounds,
+		double *levels1, double *levels2, int vctsize, double *vct, char *name,
+		char *longname, char *units, int prec, int mode, int ltype)
+{
+  /*
+    mode: 0 search in vlist and zaxis table
+          1 search in zaxis table
+   */
+  int zaxisdefined;
+  int nzaxis;
+  int zaxisID = UNDEFID;
+  int index;
+  int zaxisglobdefined = 0;
+  vlist_t *vlistptr;
+  int i;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  zaxisdefined = 0;
+  nzaxis = vlistptr->nzaxis;
+
+  if ( mode == 0 )
+    for ( index = 0; index < nzaxis; index++ )
+      {
+	zaxisID = vlistptr->zaxisIDs[index];
+
+	if ( zaxisCompare(zaxisID, zaxistype, nlevels, lbounds, levels, longname, units, ltype) == 0 )
+	  {
+	    zaxisdefined = 1;
+	    break;
+	  }
+      }
+
+  if ( ! zaxisdefined )
+    {
+      nzaxis = zaxisSize();
+      if ( nzaxis > 0 )
+        {
+          int *zaxisIndexList;
+          zaxisIndexList = (int *) malloc ( nzaxis * sizeof ( int ));
+          zaxisGetIndexList ( nzaxis, zaxisIndexList );
+          for ( i = 0; i < nzaxis; i++ )
+            {
+              zaxisID = zaxisIndexList[i];
+              if ( zaxisCompare(zaxisID, zaxistype, nlevels, lbounds, levels, longname, units, ltype) == 0 )
+                {
+                  zaxisglobdefined = 1;
+                  break;
+                }
+            }
+          if ( zaxisIndexList ) free ( zaxisIndexList );
+        }
+
+      nzaxis = vlistptr->nzaxis;
+      if ( mode == 1 )
+	for ( index = 0; index < nzaxis; index++ )
+	  if ( vlistptr->zaxisIDs[index] == zaxisID )
+	    {
+	      zaxisglobdefined = FALSE;
+	      break;
+	    }
+    }
+
+  if ( ! zaxisdefined )
+    {
+      if ( ! zaxisglobdefined )
+	{
+	  zaxisID = zaxisCreate(zaxistype, nlevels);
+	  zaxisDefLevels(zaxisID, levels);
+	  if ( lbounds )
+	    {
+	      zaxisDefLbounds(zaxisID, levels1);
+	      zaxisDefUbounds(zaxisID, levels2);
+	    }
+
+	  if ( zaxistype == ZAXIS_HYBRID || zaxistype == ZAXIS_HYBRID_HALF )
+	    {
+	      /* if ( vctsize > 0 && vctsize >= 2*(nlevels+1)) */
+	      /* if ( vctsize > 0 && vctsize >= 2*(nlevels)) */
+	      if ( vctsize > 0 )
+		zaxisDefVct(zaxisID, vctsize, vct);
+	      else
+		Warning("VCT missing");
+	    }
+
+	  zaxisDefName(zaxisID, name);
+	  zaxisDefLongname(zaxisID, longname);
+	  zaxisDefUnits(zaxisID, units);
+	  zaxisDefPrec(zaxisID, prec);
+	  zaxisDefLtype(zaxisID, ltype);
+	}
+
+      nzaxis = vlistptr->nzaxis;
+      vlistptr->zaxisIDs[nzaxis] = zaxisID;
+      vlistptr->nzaxis++;
+    }
+
+  return (zaxisID);
+}
+
+
+void varDefMissval(int varID, double missval)
+{
+  vartable[varID].lmissval = 1;
+  vartable[varID].missval = missval;
+}
+
+
+void varDefCompType(int varID, int comptype)
+{
+  if ( vartable[varID].comptype == COMPRESS_NONE )
+    vartable[varID].comptype = comptype;
+}
+
+
+void varDefCompLevel(int varID, int complevel)
+{
+  vartable[varID].complevel = complevel;
+}
+
+
+int varInqInst(int varID)
+{
+  return (vartable[varID].instID);
+}
+
+
+void varDefInst(int varID, int instID)
+{
+  vartable[varID].instID = instID;
+}
+
+
+int varInqModel(int varID)
+{
+  return (vartable[varID].modelID);
+}
+
+
+void varDefModel(int varID, int modelID)
+{
+  vartable[varID].modelID = modelID;
+}
+
+
+int varInqTable(int varID)
+{
+  return (vartable[varID].tableID);
+}
+
+
+void varDefTable(int varID, int tableID)
+{
+  vartable[varID].tableID = tableID;
+}
+
+
+void varDefEnsembleInfo(int varID, int ens_idx, int ens_count, int forecast_type)
+{
+  if ( vartable[varID].ensdata == NULL )
+      vartable[varID].ensdata = (ensinfo_t *) malloc( sizeof( ensinfo_t ) );
+
+  vartable[varID].ensdata->ens_index = ens_idx;
+  vartable[varID].ensdata->ens_count = ens_count;
+  vartable[varID].ensdata->forecast_init_type = forecast_type;
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/varscan.h b/libcdi/src/varscan.h
new file mode 100644
index 0000000..1bb0600
--- /dev/null
+++ b/libcdi/src/varscan.h
@@ -0,0 +1,43 @@
+#ifndef _VARSCAN_H
+#define _VARSCAN_H
+
+#ifndef _GRID_H
+#  include "grid.h"
+#endif
+
+
+void varAddRecord(int recID, int param, int gridID, int zaxistype, int lbounds,
+		  int level1, int level2, int prec,
+		  int *pvarID, int *plevelID, int tsteptype, int numavg, int ltype,
+		  const char *name, const char *longname, const char *units);
+
+void varDefVCT(size_t vctsize, double *vctptr);
+void varDefZAxisReference(int nlev, int nvgrid, char *uuid);
+
+int  varDefGrid(int vlistID, grid_t grid, int mode);
+int  varDefZaxis(int vlistID, int zaxistype, int nlevels, double *levels, int lbounds,
+		 double *levels1, double *levels2, int vctsize, double *vct, char *name,
+		 char *longname, char *units, int prec, int mode, int ltype);
+
+void varDefMissval(int varID, double missval);
+void varDefCompType(int varID, int comptype);
+void varDefInst(int varID, int instID);
+int  varInqInst(int varID);
+void varDefModel(int varID, int modelID);
+int  varInqModel(int varID);
+void varDefTable(int varID, int tableID);
+int  varInqTable(int varID);
+void varDefEnsembleInfo(int varID, int ens_idx, int ens_count, int forecast_type);
+
+int  zaxisCompare(int zaxisID, int zaxistype, int nlevels, int lbounds, double *levels, char *longname, char *units, int ltype);
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/version.c b/libcdi/src/version.c
new file mode 100644
index 0000000..6f0189e
--- /dev/null
+++ b/libcdi/src/version.c
@@ -0,0 +1,37 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+/*
+ * A version string.
+ */
+
+#if defined (VERSION)
+   static char cdi_libvers[] = VERSION " of "__DATE__" "__TIME__;
+#else
+#  error "VERSION undefined"
+#endif
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+char *cdiLibraryVersion(void);
+
+#if defined(__cplusplus)
+}
+#endif
+
+char *cdiLibraryVersion(void)
+{
+  return (cdi_libvers);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/vlist.c b/libcdi/src/vlist.c
new file mode 100644
index 0000000..de4e0e6
--- /dev/null
+++ b/libcdi/src/vlist.c
@@ -0,0 +1,1681 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include "dmemory.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "vlist.h"
+#include "varscan.h"
+#include "namespace.h"
+#include "pio_util.h"
+#include "resource_handle.h"
+#include "vlist_var.h"
+#include "vlist_att.h"
+#include "pio_rpc.h"
+
+extern void zaxisGetIndexList ( int, int * );
+
+static int VLIST_Debug = 0;
+
+static int vlistIsInitialized = 0;
+static void vlist_initialize(void);
+
+#if  defined  (HAVE_LIBPTHREAD)
+#  include <pthread.h>
+
+static pthread_once_t  _vlist_init_thread = PTHREAD_ONCE_INIT;
+
+#  define VLIST_INIT()        \
+  pthread_once(&_vlist_init_thread, vlist_initialize)
+
+#else
+
+#  define VLIST_INIT()               \
+  if ( vlistIsInitialized == FALSE ) vlist_initialize()
+#endif
+
+
+/* FIXME: implementation incomplete, fix once leaf nodes are complete */
+static int
+vlist_compare(vlist_t *a, vlist_t *b)
+{
+  int diff;
+  diff = (a->nvars != b->nvars) || (a->ngrids != b->ngrids)
+    || (a->nzaxis != b->nzaxis) || (a->instID != b->instID)
+    || (a->modelID != b->modelID) || (a->tableID != b->tableID)
+    || (a->ntsteps != b->ntsteps);
+  return diff;
+}
+
+static void
+vlistPrintKernel(vlist_t *vlistptr, FILE * fp );
+#ifdef USE_MPI
+static int  vlistGetSizeP ( void * vlistptr, MPI_Comm comm );
+static void vlistPackP    ( void * vlistptr, void * buff, int size,
+                            int *position, MPI_Comm comm );
+static int  vlistTxCode   ( void );
+#endif
+
+resOps vlist_ops = {
+  (valCompareFunc)vlist_compare,
+  free,
+  (valPrintFunc)vlistPrintKernel
+#ifdef USE_MPI
+  , vlistGetSizeP,
+  vlistPackP,
+  vlistTxCode
+#endif
+};
+
+
+vlist_t *vlist_to_pointer(int code)
+{
+  VLIST_INIT();
+  return reshGetVal(code, &vlist_ops );
+}
+
+static
+void vlist_init_entry(vlist_t *vlistptr)
+{
+  vlistptr->self           = reshPut(vlistptr, &vlist_ops);
+
+  vlistptr->nvars          = 0;
+  vlistptr->vars           = NULL;
+  vlistptr->ngrids         = 0;
+  vlistptr->nzaxis         = 0;
+  vlistptr->taxisID        = CDI_UNDEFID;
+  vlistptr->instID         = cdiDefaultInstID;
+  vlistptr->modelID        = cdiDefaultModelID;
+  vlistptr->tableID        = cdiDefaultTableID;
+  vlistptr->varsAllocated  = 0;
+  vlistptr->ntsteps        = CDI_UNDEFID;
+  vlistptr->atts.nalloc    = MAX_ATTRIBUTES;
+  vlistptr->atts.nelems    = 0;
+}
+
+static
+vlist_t *vlist_new_entry(void)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = (vlist_t *)xmalloc(sizeof(vlist_t));
+
+  vlist_init_entry(vlistptr);
+
+  return (vlistptr);
+}
+
+static
+void vlist_delete_entry(vlist_t *vlistptr)
+{
+  int idx;
+
+  idx = vlistptr->self;
+
+  reshRemove(idx, &vlist_ops );
+
+  free(vlistptr);
+
+  if ( VLIST_Debug )
+    Message("Removed idx %d from vlist list", idx);
+}
+
+static
+void vlist_initialize(void)
+{
+  char *env;
+
+  env = getenv("VLIST_DEBUG");
+  if ( env ) VLIST_Debug = atoi(env);
+
+  vlistIsInitialized = TRUE;
+}
+
+static
+void vlist_copy(vlist_t *vlistptr2, vlist_t *vlistptr1)
+{
+  int vlistID2;
+
+  vlistID2 = vlistptr2->self;
+  memcpy(vlistptr2, vlistptr1, sizeof(vlist_t));
+  vlistptr2->atts.nelems = 0;
+  vlistptr2->self = vlistID2;
+}
+
+static
+void vlist_check_ptr(const char *caller, vlist_t *vlistptr)
+{
+  if ( vlistptr == NULL )
+    Errorc("vlist undefined!");
+}
+
+/*
+ at Function  vlistCreate
+ at Title     Create a variable list
+
+ at Prototype int vlistCreate(void)
+
+ at Example
+Here is an example using @func{vlistCreate} to create a variable list
+and add a variable with @func{vlistDefVar}.
+
+ at Source
+#include "cdi.h"
+   ...
+int vlistID, varID;
+   ...
+vlistID = vlistCreate();
+varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+   ...
+streamDefVlist(streamID, vlistID);
+   ...
+vlistDestroy(vlistID);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int vlistCreate(void)
+{
+  int vlistID = 0;
+  vlist_t *vlistptr;
+
+  cdiInitialize();
+
+  VLIST_INIT();
+
+  vlistptr = vlist_new_entry();
+
+  vlistID = vlistptr->self;
+
+  return (vlistID);
+}
+
+/*
+ at Function  vlistDestroy
+ at Title     Destroy a variable list
+
+ at Prototype void vlistDestroy(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at EndFunction
+*/
+void vlistDestroy(int vlistID)
+{
+  vlist_t *vlistptr;
+  int nvars;
+  int varID;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  vlistDelAtts(vlistID, CDI_GLOBAL);
+
+  nvars = vlistptr->nvars;
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( vlistptr->vars[varID].levinfo )  free(vlistptr->vars[varID].levinfo);
+      if ( vlistptr->vars[varID].name )     free(vlistptr->vars[varID].name);
+      if ( vlistptr->vars[varID].longname ) free(vlistptr->vars[varID].longname);
+      if ( vlistptr->vars[varID].stdname )  free(vlistptr->vars[varID].stdname);
+      if ( vlistptr->vars[varID].units )    free(vlistptr->vars[varID].units);
+
+      if ( vlistptr->vars[varID].ensdata )  free(vlistptr->vars[varID].ensdata);
+
+      vlistDelAtts(vlistID, varID);
+    }
+
+  if ( vlistptr->vars ) free(vlistptr->vars);
+
+  vlist_delete_entry(vlistptr);
+}
+
+/*
+ at Function  vlistCopy
+ at Title     Copy a variable list
+
+ at Prototype void vlistCopy(int vlistID2, int vlistID1)
+ at Parameter
+    @Item  vlistID2  Target variable list ID
+    @Item  vlistID1  Source variable list ID
+
+ at Description
+The function @func{vlistCopy} copies all entries from vlistID1 to vlistID2.
+
+ at EndFunction
+*/
+void vlistCopy(int vlistID2, int vlistID1)
+{
+  vlist_t *vlistptr1, *vlistptr2;
+
+  vlistptr1 = vlist_to_pointer(vlistID1);
+  vlistptr2 = vlist_to_pointer(vlistID2);
+
+  vlist_check_ptr(__func__, vlistptr1);
+  vlist_check_ptr(__func__, vlistptr2);
+
+  vlist_copy(vlistptr2, vlistptr1);
+
+  vlistCopyVarAtts(vlistID1, CDI_GLOBAL, vlistID2, CDI_GLOBAL);
+
+  if ( vlistptr1->vars )
+    {
+      int nvars = vlistptr1->nvars;
+      int nlevs, varID;
+
+      //vlistptr2->varsAllocated = nvars;
+      vlistptr2->vars = (var_t *) malloc(vlistptr2->varsAllocated*sizeof(var_t));
+      memcpy(vlistptr2->vars, vlistptr1->vars, vlistptr2->varsAllocated*sizeof(var_t));
+
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          if ( vlistptr1->vars[varID].name )
+            vlistptr2->vars[varID].name = strdupx(vlistptr1->vars[varID].name);
+
+          if ( vlistptr1->vars[varID].longname )
+            vlistptr2->vars[varID].longname = strdupx(vlistptr1->vars[varID].longname);
+
+          if ( vlistptr1->vars[varID].stdname )
+            vlistptr2->vars[varID].stdname = strdupx(vlistptr1->vars[varID].stdname);
+
+          if ( vlistptr1->vars[varID].units )
+            vlistptr2->vars[varID].units = strdupx(vlistptr1->vars[varID].units);
+
+          if ( vlistptr1->vars[varID].ensdata )
+            {
+              vlistptr2->vars[varID].ensdata = (ensinfo_t *) malloc(sizeof(ensinfo_t));
+              memcpy(vlistptr2->vars[varID].ensdata,
+                     vlistptr1->vars[varID].ensdata, sizeof(ensinfo_t));
+            }
+
+	  vlistptr2->vars[varID].atts.nelems = 0;
+	  vlistCopyVarAtts(vlistID1, varID, vlistID2, varID);
+
+          nlevs = vlistptr1->vars[varID].nlevs;
+          vlistptr2->vars[varID].levinfo = (levinfo_t *) malloc(nlevs*sizeof(levinfo_t));
+          memcpy(vlistptr2->vars[varID].levinfo,
+                 vlistptr1->vars[varID].levinfo, nlevs*sizeof(levinfo_t));
+	}
+    }
+}
+
+/*
+ at Function  vlistDuplicate
+ at Title     Duplicate a variable list
+
+ at Prototype int vlistDuplicate(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at Description
+The function @func{vlistDuplicate} duplicates the variable list from vlistID1.
+
+ at Result
+ at func{vlistDuplicate} returns an identifier to the duplicated variable list.
+
+ at EndFunction
+*/
+int vlistDuplicate(int vlistID)
+{
+  int vlistIDnew;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  vlistIDnew = vlistCreate();
+
+  vlistCopy(vlistIDnew, vlistID);
+
+  if ( ! namespaceHasLocalFile ( namespaceGetActive ()))
+    reshSetStatus ( vlistIDnew, &vlist_ops, SUSPENDED );
+
+  return (vlistIDnew);
+}
+
+
+void vlistClearFlag(int vlistID)
+{
+  int varID, levID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  for ( varID = 0; varID < vlistptr->nvars; varID++ )
+    {
+      vlistptr->vars[varID].flag = FALSE;
+      for ( levID = 0; levID < vlistptr->vars[varID].nlevs; levID++ )
+        {
+          vlistptr->vars[varID].levinfo[levID].flag = FALSE;
+        }
+    }
+}
+
+static
+int vlist_generate_zaxis(int vlistID, int zaxistype, int nlevels, double *levels,
+                         double *lbounds, double *ubounds, int vctsize, const double *vct)
+{
+  int zaxisdefined;
+  int nzaxis;
+  int zaxisID = CDI_UNDEFID;
+  int index;
+  int zaxisglobdefined = 0;
+  int has_bounds = FALSE;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  zaxisdefined = 0;
+  nzaxis = vlistptr->nzaxis;
+
+  if ( lbounds && ubounds ) has_bounds = TRUE;
+
+  for ( index = 0; index < nzaxis; ++index )
+    {
+      zaxisID = vlistptr->zaxisIDs[index];
+
+      if ( zaxisCompare(zaxisID, zaxistype, nlevels, has_bounds, levels, NULL, NULL, 0) == 0 )
+        {
+          zaxisdefined = 1;
+          break;
+        }
+    }
+
+  if ( ! zaxisdefined )
+    {
+      nzaxis = zaxisSize();
+      if ( nzaxis > 0 )
+        {
+          int *zaxisIndexList;
+          zaxisIndexList = (int *) malloc ( nzaxis * sizeof ( int ));
+          zaxisGetIndexList ( nzaxis, zaxisIndexList );
+          for ( index = 0; index < nzaxis; ++index )
+            {
+              zaxisID = zaxisIndexList[index];
+              if ( zaxisCompare(zaxisID, zaxistype, nlevels, has_bounds, levels, NULL, NULL, 0) == 0 )
+                {
+                  zaxisglobdefined = 1;
+                  break;
+                }
+            }
+          if ( zaxisIndexList ) free ( zaxisIndexList );
+        }
+    }
+
+  if ( ! zaxisdefined )
+    {
+      if ( ! zaxisglobdefined )
+	{
+	  zaxisID = zaxisCreate(zaxistype, nlevels);
+	  zaxisDefLevels(zaxisID, levels);
+	  if ( has_bounds )
+	    {
+	      zaxisDefLbounds(zaxisID, lbounds);
+	      zaxisDefUbounds(zaxisID, ubounds);
+	    }
+
+	  if ( zaxistype == ZAXIS_HYBRID )
+	    {
+	      if ( vctsize > 0 )
+		zaxisDefVct(zaxisID, vctsize, vct);
+	      else
+		Warning("VCT missing");
+	    }
+	}
+
+      nzaxis = vlistptr->nzaxis;
+      vlistptr->zaxisIDs[nzaxis] = zaxisID;
+      vlistptr->nzaxis++;
+    }
+
+  return (zaxisID);
+}
+
+/*
+ at Function  vlistCopyFlag
+ at Title     Copy some entries of a variable list
+
+ at Prototype void vlistCopyFlag(int vlistID2, int vlistID1)
+ at Parameter
+    @Item  vlistID2  Target variable list ID
+    @Item  vlistID1  Source variable list ID
+
+ at Description
+The function @func{vlistCopyFlag} copies all entries with a flag from vlistID1 to vlistID2.
+
+ at EndFunction
+*/
+void vlistCopyFlag(int vlistID2, int vlistID1)
+{
+  vlist_t *vlistptr1, *vlistptr2;
+
+  vlistptr1 = vlist_to_pointer(vlistID1);
+  vlistptr2 = vlist_to_pointer(vlistID2);
+
+  vlist_check_ptr(__func__, vlistptr1);
+  vlist_check_ptr(__func__, vlistptr2);
+
+  vlist_copy(vlistptr2, vlistptr1);
+
+  vlistCopyVarAtts(vlistID1, CDI_GLOBAL, vlistID2, CDI_GLOBAL);
+
+  if ( vlistptr1->vars )
+    {
+      int nvars = vlistptr1->nvars;
+      int nvars2 = 0, levID2;
+      int nlevs, nlevs2, levID, varID, varID2;
+      int gridID, zaxisID;
+      int index;
+
+      vlistptr2->ngrids = 0;
+      vlistptr2->nzaxis = 0;
+
+      for ( varID = 0; varID < nvars; varID++ )
+        if ( vlistptr1->vars[varID].flag ) nvars2++;
+
+      vlistptr2->nvars = nvars2;
+      vlistptr2->varsAllocated = nvars2;
+      if ( nvars2 > 0 )
+        vlistptr2->vars  = (var_t *) malloc(nvars2*sizeof(var_t));
+      else
+        vlistptr2->vars  = NULL;
+
+      varID2 = 0;
+      for ( varID = 0; varID < nvars; varID++ )
+	if ( vlistptr1->vars[varID].flag )
+	  {
+	    vlistptr2->vars[varID2].flag = FALSE;
+	    zaxisID = vlistptr1->vars[varID].zaxisID;
+	    gridID  = vlistptr1->vars[varID].gridID;
+
+	    memcpy(&vlistptr2->vars[varID2], &vlistptr1->vars[varID], sizeof(var_t));
+
+	    vlistptr1->vars[varID].fvarID = varID2;
+	    vlistptr2->vars[varID2].fvarID = varID;
+
+	    vlistptr2->vars[varID2].mvarID = varID2;
+
+	    if ( vlistptr1->vars[varID].name )
+	      vlistptr2->vars[varID2].name = strdupx(vlistptr1->vars[varID].name);
+
+	    if ( vlistptr1->vars[varID].longname )
+	      vlistptr2->vars[varID2].longname = strdupx(vlistptr1->vars[varID].longname);
+
+	    if ( vlistptr1->vars[varID].stdname )
+	      vlistptr2->vars[varID2].stdname = strdupx(vlistptr1->vars[varID].stdname);
+
+	    if ( vlistptr1->vars[varID].units )
+	      vlistptr2->vars[varID2].units = strdupx(vlistptr1->vars[varID].units);
+
+            if ( vlistptr1->vars[varID].ensdata )
+              {
+                vlistptr2->vars[varID2].ensdata = (ensinfo_t *) malloc(sizeof(ensinfo_t));
+                memcpy(vlistptr2->vars[varID2].ensdata,
+                       vlistptr1->vars[varID].ensdata, sizeof(ensinfo_t));
+              }
+
+	    vlistptr2->vars[varID2].atts.nelems = 0;
+	    vlistCopyVarAtts(vlistID1, varID, vlistID2, varID2);
+
+	    nlevs  = vlistptr1->vars[varID].nlevs;
+	    nlevs2 = 0;
+	    for ( levID = 0; levID < nlevs; levID++ )
+	      if ( vlistptr1->vars[varID].levinfo[levID].flag ) nlevs2++;
+
+	    vlistptr2->vars[varID2].levinfo = (levinfo_t *) malloc(nlevs2*sizeof(levinfo_t));
+
+	    if ( nlevs != nlevs2 )
+	      {
+		int zaxisType;
+		int zaxisID2;
+		int nvct = 0;
+		double *levels;
+		double *lbounds = NULL, *ubounds = NULL;
+		const double *vct = NULL;
+                char ctemp[CDI_MAX_NAME];
+
+		zaxisID = vlistptr1->vars[varID].zaxisID;
+		levels = (double *) malloc(nlevs2*sizeof(double));
+		levID2 = 0;
+		for ( levID = 0; levID < nlevs; ++levID )
+		  if ( vlistptr1->vars[varID].levinfo[levID].flag )
+		    {
+		      vlistptr1->vars[varID].levinfo[levID].flevelID = levID2;
+		      vlistptr1->vars[varID].levinfo[levID].mlevelID = levID2;
+		      levels[levID2++] = zaxisInqLevel(zaxisID, levID);
+		    }
+
+		zaxisType = zaxisInqType(zaxisID);
+
+		if ( zaxisType == ZAXIS_HYBRID )
+		  {
+		    nvct = zaxisInqVctSize(zaxisID);
+		    vct  = zaxisInqVctPtr(zaxisID);
+		  }
+
+                if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+                  {
+                    double *lbounds1, *ubounds1;
+                    lbounds1 = (double *) malloc(nlevs*sizeof(double));
+                    ubounds1 = (double *) malloc(nlevs*sizeof(double));
+
+                    zaxisInqLbounds(zaxisID, lbounds1);
+                    zaxisInqUbounds(zaxisID, ubounds1);
+
+                    lbounds = (double *) malloc(nlevs2*sizeof(double));
+                    ubounds = (double *) malloc(nlevs2*sizeof(double));
+
+                    levID2 = 0;
+                    for ( levID = 0; levID < nlevs; ++levID )
+                      if ( vlistptr1->vars[varID].levinfo[levID].flag )
+                        {
+                          lbounds[levID2] = lbounds1[levID];
+                          ubounds[levID2] = ubounds1[levID];
+                          levID2++;
+                        }
+
+                    free(lbounds1);
+                    free(ubounds1);
+                  }
+
+		zaxisID2 = vlist_generate_zaxis(vlistID2, zaxisType, nlevs2, levels, lbounds, ubounds, nvct, vct);
+		free(levels);
+                if ( lbounds ) free(lbounds);
+                if ( ubounds ) free(ubounds);
+
+                zaxisInqName(zaxisID, ctemp);
+                zaxisDefName(zaxisID2, ctemp);
+                zaxisInqLongname(zaxisID, ctemp);
+                zaxisDefLongname(zaxisID2, ctemp);
+                zaxisInqUnits(zaxisID, ctemp);
+                zaxisDefUnits(zaxisID2, ctemp);
+
+		zaxisID = zaxisID2;
+		vlistptr2->vars[varID2].zaxisID = zaxisID2;
+		vlistptr2->vars[varID2].nlevs   = nlevs2;
+	      }
+
+	    for ( levID = 0; levID < nlevs2; levID++ )
+	      {
+		vlistptr2->vars[varID2].levinfo[levID].flag  = FALSE;
+		vlistptr2->vars[varID2].levinfo[levID].index = -1;
+	      }
+
+	    levID2 = 0;
+	    for ( levID = 0; levID < nlevs; levID++ )
+	      if ( vlistptr1->vars[varID].levinfo[levID].flag )
+		{
+		  vlistptr2->vars[varID2].levinfo[levID2].flevelID = levID;
+		  vlistptr2->vars[varID2].levinfo[levID2].mlevelID = levID;
+		  levID2++;
+		}
+
+	    for ( index = 0; index <vlistptr2->ngrids; index++ )
+	      if (vlistptr2->gridIDs[index] == gridID ) break;
+
+	    if ( index == vlistptr2->ngrids )
+	      {
+		vlistptr2->gridIDs[vlistptr2->ngrids++] = gridID;
+		if (vlistptr2->ngrids >= MAX_GRIDS_PS )
+		  Error("Internal Problem! More than %d grids.", MAX_GRIDS_PS);
+	      }
+
+	    for ( index = 0; index < vlistptr2->nzaxis; index++ )
+	      if ( vlistptr2->zaxisIDs[index] == zaxisID ) break;
+
+	    if ( index == vlistptr2->nzaxis )
+	      {
+		vlistptr2->zaxisIDs[vlistptr2->nzaxis++] = zaxisID;
+		if (vlistptr2->nzaxis >= MAX_ZAXES_PS )
+		  Error("Internal Problem! More than %d zaxis.", MAX_ZAXES_PS);
+	      }
+
+	    varID2++;
+	  }
+    }
+}
+
+/*
+ at Function  vlistCat
+ at Title     Concatenate two variable lists
+
+ at Prototype void vlistCat(int vlistID2, int vlistID1)
+ at Parameter
+    @Item  vlistID2  Target variable list ID
+    @Item  vlistID1  Source variable list ID
+
+ at Description
+Concatenate the variable list vlistID1 at the end of vlistID2.
+
+ at EndFunction
+*/
+void vlistCat(int vlistID2, int vlistID1)
+{
+  int nvars, nvars1, nvars2;
+  int varID, varID2, nlevs;
+  int index, gridID, zaxisID;
+  vlist_t *vlistptr1, *vlistptr2;
+
+  vlistptr1 = vlist_to_pointer(vlistID1);
+  vlistptr2 = vlist_to_pointer(vlistID2);
+
+  vlist_check_ptr(__func__, vlistptr1);
+  vlist_check_ptr(__func__, vlistptr2);
+
+  nvars1 = vlistptr1->nvars;
+  nvars2 = vlistptr2->nvars;
+  nvars = nvars1 + nvars2;
+  vlistptr2->nvars = nvars;
+
+  if ( nvars > vlistptr2->varsAllocated )
+    {
+      vlistptr2->varsAllocated = nvars;
+      vlistptr2->vars = (var_t *) realloc(vlistptr2->vars, nvars*sizeof(var_t));
+    }
+  memcpy(vlistptr2->vars+nvars2, vlistptr1->vars, nvars1*sizeof(var_t));
+
+  for ( varID = 0; varID < nvars1; varID++ )
+    {
+      varID2 = varID + nvars2;
+      vlistptr1->vars[varID].fvarID = varID2;
+      vlistptr2->vars[varID2].fvarID = varID;
+
+      vlistptr1->vars[varID].mvarID = varID2;
+      vlistptr2->vars[varID2].mvarID = varID;
+
+      if ( vlistptr1->vars[varID].param < 0 )
+	{
+	  int pnum, pcat, pdis;
+	  cdiDecodeParam(vlistptr1->vars[varID].param, &pnum, &pcat, &pdis);
+	  pnum = -(varID2+1);
+	  vlistptr2->vars[varID2].param = cdiEncodeParam(pnum, pcat, pdis);
+	}
+
+      if ( vlistptr1->vars[varID].name )
+        vlistptr2->vars[varID2].name = strdupx(vlistptr1->vars[varID].name);
+
+      if ( vlistptr1->vars[varID].longname )
+        vlistptr2->vars[varID2].longname = strdupx(vlistptr1->vars[varID].longname);
+
+      if ( vlistptr1->vars[varID].stdname )
+        vlistptr2->vars[varID2].stdname = strdupx(vlistptr1->vars[varID].stdname);
+
+      if ( vlistptr1->vars[varID].units )
+        vlistptr2->vars[varID2].units = strdupx(vlistptr1->vars[varID].units);
+
+      nlevs = vlistptr1->vars[varID].nlevs;
+      vlistptr2->vars[varID2].levinfo = (levinfo_t *) malloc(nlevs*sizeof(levinfo_t));
+      memcpy(vlistptr2->vars[varID2].levinfo, vlistptr1->vars[varID].levinfo, nlevs*sizeof(levinfo_t));
+
+      if ( vlistptr1->vars[varID].ensdata )
+        {
+          vlistptr2->vars[varID2].ensdata = (ensinfo_t *) malloc(sizeof(ensinfo_t));
+          memcpy(vlistptr2->vars[varID2].ensdata, vlistptr1->vars[varID].ensdata, sizeof(ensinfo_t));
+        }
+
+      vlistptr2->vars[varID2].atts.nelems = 0;
+      vlistCopyVarAtts(vlistID1, varID, vlistID2, varID2);
+
+      gridID = vlistptr1->vars[varID].gridID;
+      for ( index = 0; index < vlistptr2->ngrids; index++ )
+        if ( gridID == vlistptr2->gridIDs[index] ) break;
+
+      if ( index == vlistptr2->ngrids )
+	{
+	  vlistptr2->gridIDs[vlistptr2->ngrids++] = gridID;
+	  if ( vlistptr2->ngrids >= MAX_GRIDS_PS )
+	    Error("Internal Problem! More than %d grids.", MAX_GRIDS_PS);
+	}
+
+      zaxisID = vlistptr1->vars[varID].zaxisID;
+      for ( index = 0; index < vlistptr2->nzaxis; index++ )
+        if ( zaxisID == vlistptr2->zaxisIDs[index] ) break;
+
+      if ( index == vlistptr2->nzaxis )
+	{
+	  vlistptr2->zaxisIDs[vlistptr2->nzaxis++] = zaxisID;
+	  if ( vlistptr2->nzaxis >= MAX_ZAXES_PS )
+	    Error("Internal Problem! More than %d zaxis.", MAX_ZAXES_PS);
+	}
+    }
+}
+
+/*
+ at Function  vlistMerge
+ at Title     Merge two variable lists
+
+ at Prototype void vlistMerge(int vlistID2, int vlistID1)
+ at Parameter
+    @Item  vlistID2  Target variable list ID
+    @Item  vlistID1  Source variable list ID
+
+ at Description
+Merge the variable list vlistID1 to the variable list vlistID2.
+
+ at EndFunction
+*/
+void vlistMerge(int vlistID2, int vlistID1)
+{
+  int nvars1, nvars2;
+  int varID = 0, varID2, levID, nlevs, nlevs1, nlevs2;
+  int index, zaxisID;
+  int zaxisID1, zaxisID2;
+  int *lvar;
+  double *levels;
+  vlist_t *vlistptr1, *vlistptr2;
+
+  vlistptr1 = vlist_to_pointer(vlistID1);
+  vlistptr2 = vlist_to_pointer(vlistID2);
+
+  vlist_check_ptr(__func__, vlistptr1);
+  vlist_check_ptr(__func__, vlistptr2);
+
+  nvars1 = vlistptr1->nvars;
+  nvars2 = vlistptr2->nvars;
+
+  if ( nvars1 == nvars2 )
+    {
+      for ( varID = 0; varID < nvars2; varID++ )
+	{
+	  if ( vlistptr1->vars[varID].name && vlistptr2->vars[varID].name )
+	    {
+	      if ( strcmp(vlistptr1->vars[varID].name,
+			  vlistptr2->vars[varID].name) != 0 ) break;
+	    }
+	  else
+	    {
+	      if ( vlistptr1->vars[varID].param != vlistptr2->vars[varID].param )
+		break;
+	    }
+	}
+    }
+
+  if ( varID == nvars2 ) /* same variables in vlistID1 and vlistID2 */
+    {
+      for ( varID = 0; varID < nvars2; varID++ )
+        {
+          vlistptr1->vars[varID].fvarID = varID;
+          vlistptr2->vars[varID].fvarID = varID;
+
+          vlistptr1->vars[varID].mvarID = varID;
+          vlistptr2->vars[varID].mvarID = varID;
+
+          nlevs1 = vlistptr1->vars[varID].nlevs;
+          nlevs2 = vlistptr2->vars[varID].nlevs;
+
+          nlevs = nlevs1 + nlevs2;
+
+          vlistptr2->vars[varID].nlevs = nlevs;
+          /*
+          fprintf(stderr, "var %d %d %d %d %d\n", varID, nlevs1, nlevs2, nlevs, sizeof(levinfo_t));
+          */
+          vlistptr2->vars[varID].levinfo =
+            (levinfo_t *) realloc(vlistptr2->vars[varID].levinfo, nlevs*sizeof(levinfo_t));
+
+	  memcpy(vlistptr2->vars[varID].levinfo+nlevs2,
+		 vlistptr1->vars[varID].levinfo, nlevs1*sizeof(levinfo_t));
+
+	  for ( levID = 0; levID < nlevs1; levID++ )
+	    {
+	      vlistptr1->vars[varID].levinfo[levID].mlevelID = nlevs2 + levID;
+	    }
+	}
+
+      lvar = (int *) malloc(nvars2*sizeof(int));
+      for ( varID = 0; varID < nvars2; varID++ ) lvar[varID] = FALSE;
+
+      for ( varID = 0; varID < nvars2; varID++ )
+        {
+          if ( lvar[varID] == TRUE ) continue;
+
+          zaxisID1 = vlistptr1->vars[varID].zaxisID;
+          zaxisID2 = vlistptr2->vars[varID].zaxisID;
+          /*
+          nlevs1 = vlistptr1->vars[varID].nlevs;
+          nlevs2 = vlistptr2->vars[varID].nlevs;
+          */
+          nlevs1 = zaxisInqSize(zaxisID1);
+          nlevs2 = zaxisInqSize(zaxisID2);
+          /*
+          fprintf(stderr, "zaxis %d %d %d %d\n", zaxisID1, zaxisID2, nlevs1, nlevs2);
+          */
+          nlevs = nlevs1 + nlevs2;
+
+          zaxisID = zaxisDuplicate(zaxisID2);
+
+          zaxisResize(zaxisID, nlevs);
+
+          levels = (double *) malloc(nlevs1*sizeof(double));
+
+          zaxisInqLevels(zaxisID1, levels);
+          /*
+          for ( levID = 0; levID < nlevs1; levID++ )
+            fprintf(stderr, "%d %d %d %d %d %g\n", varID, levID, nlevs1, nlevs2, vlistptr2->vars[varID].nlevs, levels[levID]);
+          */
+          for ( levID = 0; levID < nlevs1; levID++ )
+            zaxisDefLevel(zaxisID, nlevs2+levID, levels[levID]);
+
+          free(levels);
+
+          for ( index = 0; index < vlistptr2->nzaxis; index++ )
+            if ( vlistptr2->zaxisIDs[index] == zaxisID2 )
+              vlistptr2->zaxisIDs[index] = zaxisID;
+
+          for ( varID2 = 0; varID2 < nvars2; varID2++ )
+            if ( lvar[varID2] == FALSE && vlistptr2->vars[varID2].zaxisID == zaxisID2 )
+              {
+                vlistptr2->vars[varID2].zaxisID = zaxisID;
+                lvar[varID2] = TRUE;
+              }
+        }
+
+      free(lvar);
+    }
+  else
+    {
+      vlistCat(vlistID2, vlistID1);
+    }
+}
+
+/*
+ at Function  vlistNvars
+ at Title     Number of variables in a variable list
+
+ at Prototype int vlistNvars(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at Description
+The function @func{vlistNvars} returns the number of variables in the variable list vlistID.
+
+ at Result
+ at func{vlistNvars} returns the number of variables in a variable list.
+
+ at EndFunction
+*/
+int vlistNvars(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->nvars);
+}
+
+
+int vlistNrecs(int vlistID)
+{
+  int varID, nrecs = 0;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  for ( varID = 0; varID < vlistptr->nvars; varID++ )
+    nrecs +=  vlistptr->vars[varID].nlevs;
+
+  return (nrecs);
+}
+
+
+int vlistNumber(int vlistID)
+{
+  int varID, number, number2, datatype;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  datatype = vlistptr->vars[0].datatype;
+  if (  datatype== DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+    number = CDI_COMP;
+  else
+    number = CDI_REAL;
+
+  for ( varID = 1; varID < vlistptr->nvars; varID++ )
+    {
+      datatype = vlistptr->vars[varID].datatype;
+      if ( datatype == DATATYPE_CPX32 || datatype == DATATYPE_CPX64 )
+        number2 = CDI_COMP;
+      else
+        number2 = CDI_REAL;
+
+      if ( number2 != number )
+        {
+          number = CDI_BOTH;
+          break;
+        }
+    }
+
+  return (number);
+}
+
+/*
+ at Function  vlistNgrids
+ at Title     Number of grids in a variable list
+
+ at Prototype int vlistNgrids(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at Description
+The function @func{vlistNgrids} returns the number of grids in the variable list vlistID.
+
+ at Result
+ at func{vlistNgrids} returns the number of grids in a variable list.
+
+ at EndFunction
+*/
+int vlistNgrids(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->ngrids);
+}
+
+/*
+ at Function  vlistNzaxis
+ at Title     Number of zaxis in a variable list
+
+ at Prototype int vlistNzaxis(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at Description
+The function @func{vlistNzaxis} returns the number of zaxis in the variable list vlistID.
+
+ at Result
+ at func{vlistNzaxis} returns the number of zaxis in a variable list.
+
+ at EndFunction
+*/
+int vlistNzaxis(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->nzaxis);
+}
+
+
+void vlistDefNtsteps(int vlistID, int nts)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->ntsteps = nts;
+}
+
+
+int vlistNtsteps(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->ntsteps);
+}
+
+static void
+vlistPrintKernel(vlist_t *vlistptr, FILE * fp )
+{
+  int nvars, flag, index;
+  int varID, fvarID, mvarID, flevID, mlevID, levID;
+  int param, gridID, zaxisID, tsteptype, nlevs;
+  int dtype;
+
+  int i, iorank, decoSize, size, rank, offset, chunk;
+
+  char paramstr[32];
+  char *name, *longname, *units;
+  double level;
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  fprintf ( fp, "#\n# vlistID %d\n#\n", vlistptr->self);
+
+  nvars = vlistptr->nvars;
+
+  fprintf ( fp, "nvars   %d\n", nvars);
+  fprintf ( fp, "ngrids  %d\n", vlistptr->ngrids);
+  fprintf ( fp, "nzaxis  %d\n", vlistptr->nzaxis);
+  fprintf ( fp, "taxisID %d\n", vlistptr->taxisID);
+  fprintf ( fp, "instID  %d\n", vlistptr->instID);
+  fprintf ( fp, "modelID %d\n", vlistptr->modelID);
+  fprintf ( fp, "tableID %d\n", vlistptr->tableID);
+
+  if ( nvars > 0 )
+    {
+      fprintf(fp, " varID param    gridID zaxisID tsteptype nlevel flag "
+              " name     longname iorank decosize\n");
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          param    = vlistptr->vars[varID].param;
+          gridID   = vlistptr->vars[varID].gridID;
+          zaxisID  = vlistptr->vars[varID].zaxisID;
+	  tsteptype= vlistptr->vars[varID].tsteptype;
+          nlevs    = vlistptr->vars[varID].nlevs;
+          name     = vlistptr->vars[varID].name;
+          longname = vlistptr->vars[varID].longname;
+          units    = vlistptr->vars[varID].units;
+          flag     = vlistptr->vars[varID].flag;
+          iorank   = vlistptr->vars[varID].iorank;
+          decoSize = vlistptr->vars[varID].decoSize;
+
+          cdiParamToString(param, paramstr, sizeof(paramstr));
+          fprintf(fp, "%6d %-8s %6d %6d %6d %6d %5d %-8s"
+                  " %s %6d %6d",
+                  varID, paramstr, gridID, zaxisID, tsteptype, nlevs, flag,
+                  name ? name : "", longname ? longname : "",
+                  iorank, decoSize);
+
+          if ( units ) fprintf ( fp, "   [%s]", units);
+          fprintf ( fp, "\n");
+        }
+
+      fprintf(fp, "\n");
+      fprintf(fp, " varID  levID fvarID flevID mvarID mlevID  index  dtype  flag  level\n");
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          nlevs    = vlistptr->vars[varID].nlevs;
+          zaxisID  = vlistptr->vars[varID].zaxisID;
+          fvarID   = vlistptr->vars[varID].fvarID;
+          mvarID   = vlistptr->vars[varID].mvarID;
+          dtype    = vlistptr->vars[varID].datatype;
+          for ( levID = 0; levID < nlevs; levID++ )
+            {
+              flevID = vlistptr->vars[varID].levinfo[levID].flevelID;
+              mlevID = vlistptr->vars[varID].levinfo[levID].mlevelID;
+              index  = vlistptr->vars[varID].levinfo[levID].index;
+              flag   = vlistptr->vars[varID].levinfo[levID].flag;
+              level  = zaxisInqLevel(zaxisID, levID);
+              fprintf(fp, "%6d %6d %6d %6d %6d %6d %6d %6d %5d  %.9g\n",
+                      varID, levID, fvarID, flevID, mvarID, mlevID, index,
+                      dtype, flag, level);
+            }
+        }
+
+      fprintf(fp, "\n");
+      fprintf(fp, " varID  size iorank decosize corank offset  chunk\n");
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          iorank    = vlistptr->vars[varID].iorank;
+          decoSize  = vlistptr->vars[varID].decoSize;
+          size      = vlistptr->vars[varID].nlevs *
+            gridInqSize ( vlistptr->vars[varID].gridID );
+
+          for ( i = 0; i < decoSize; i++ )
+            {
+              rank   = vlistptr->vars[varID].deco[i].rank;
+              offset = vlistptr->vars[varID].deco[i].offset;
+              offset = vlistptr->vars[varID].deco[i].offset;
+              chunk  = vlistptr->vars[varID].deco[i].chunk;
+              fprintf ( fp, "%3d %8d %6d %6d %6d %8d %6d\n",
+                        varID, size, iorank, decoSize, rank, offset, chunk );
+            }
+        }
+    }
+}
+
+
+void vlistPrint(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  if ( vlistID == CDI_UNDEFID ) return;
+
+  vlistptr = vlist_to_pointer(vlistID);
+  vlist_check_ptr(__func__, vlistptr);
+  vlistPrintKernel(vlistptr, stdout);
+}
+
+/*
+ at Function  vlistDefTaxis
+ at Title     Define the time axis
+
+ at Prototype void vlistDefTaxis(int vlistID, int taxisID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+    @Item  taxisID  Time axis ID, from a previous call to @fref{taxisCreate}
+
+ at Description
+The function @func{vlistDefTaxis} defines the time axis of a variable list.
+
+ at EndFunction
+*/
+void vlistDefTaxis(int vlistID, int taxisID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->taxisID = taxisID;
+}
+
+/*
+ at Function  vlistInqTaxis
+ at Title     Get the time axis
+
+ at Prototype int vlistInqTaxis(int vlistID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}
+
+ at Description
+The function @func{vlistInqTaxis} returns the time axis of a variable list.
+
+ at Result
+ at func{vlistInqTaxis} returns an identifier to the time axis.
+
+ at EndFunction
+*/
+int vlistInqTaxis(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->taxisID);
+}
+
+
+void  vlistDefTable(int vlistID, int tableID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->tableID = tableID;
+}
+
+
+int vlistInqTable(int vlistID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  return (vlistptr->tableID);
+}
+
+
+void vlistDefInstitut(int vlistID, int instID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+
+      xdebug("%s", "");
+      return;
+    }
+
+  vlistptr->instID = instID;
+}
+
+
+int vlistInqInstitut(int vlistID)
+{
+  int varID, instID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  instID = vlistptr->instID;
+
+  if ( instID == CDI_UNDEFID )
+    {
+      instID  = vlistInqVarInstitut(vlistID, 0);
+
+      for ( varID = 1; varID < vlistptr->nvars; varID++ )
+        if ( instID != vlistInqVarInstitut(vlistID, varID) )
+          {
+            instID = CDI_UNDEFID;
+            break;
+      }
+      vlistDefInstitut(vlistID, instID);
+    }
+
+  return (instID);
+}
+
+
+void vlistDefModel(int vlistID, int modelID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->modelID = modelID;
+}
+
+
+int vlistInqModel(int vlistID)
+{
+  int varID, modelID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  modelID = vlistptr->modelID;
+
+  if ( modelID == CDI_UNDEFID )
+    {
+      modelID = vlistInqVarModel(vlistID, 0);
+
+      for ( varID = 1; varID < vlistptr->nvars; varID++ )
+        if ( modelID != vlistInqVarModel(vlistID, varID) )
+          {
+            modelID = CDI_UNDEFID;
+            break;
+          }
+
+      vlistDefModel(vlistID, modelID);
+    }
+
+  return (modelID);
+}
+
+
+int vlistGridsizeMax(int vlistID)
+{
+  int gridsize, gridsizemax = 0;
+  int gridID, index;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  for ( index = 0 ; index < vlistptr->ngrids ; index++ )
+    {
+      gridID = vlistptr->gridIDs[index];
+      gridsize = gridInqSize(gridID);
+      if ( gridsize > gridsizemax ) gridsizemax = gridsize;
+    }
+
+  return (gridsizemax);
+}
+
+
+int vlistGrid(int vlistID, int index)
+{
+  int gridID = CDI_UNDEFID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( index < vlistptr->ngrids && index >= 0 )
+    gridID = vlistptr->gridIDs[index];
+
+  return (gridID);
+}
+
+
+int vlistGridIndex(int vlistID, int gridID)
+{
+  int index;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  for ( index = 0 ; index < vlistptr->ngrids ; index++ )
+    if ( gridID == vlistptr->gridIDs[index] ) break;
+
+  if ( index == vlistptr->ngrids ) index = -1;
+
+  return (index);
+}
+
+
+void vlistChangeGridIndex(int vlistID, int index, int gridID)
+{
+  int gridIDold;
+  int varID, nvars;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  gridIDold = vlistptr->gridIDs[index];
+  vlistptr->gridIDs[index] = gridID;
+
+  nvars = vlistptr->nvars;
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vlistptr->vars[varID].gridID == gridIDold )
+      vlistptr->vars[varID].gridID = gridID;
+}
+
+
+void vlistChangeGrid(int vlistID, int gridID1, int gridID2)
+{
+  int varID, nvars;
+  int index, ngrids;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  ngrids = vlistptr->ngrids;
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( vlistptr->gridIDs[index] == gridID1 )
+        {
+          vlistptr->gridIDs[index] = gridID2;
+          break;
+        }
+    }
+
+  nvars = vlistptr->nvars;
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vlistptr->vars[varID].gridID == gridID1 )
+      vlistptr->vars[varID].gridID = gridID2;
+}
+
+
+int vlistZaxis(int vlistID, int index)
+{
+  int zaxisID = CDI_UNDEFID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( index < vlistptr->nzaxis && index >= 0 )
+    zaxisID = vlistptr->zaxisIDs[index];
+
+  return (zaxisID);
+}
+
+int vlistZaxisIndex(int vlistID, int zaxisID)
+{
+  int index;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  for ( index = 0 ; index < vlistptr->nzaxis ; index++ )
+    if ( zaxisID == vlistptr->zaxisIDs[index] ) break;
+
+  if ( index == vlistptr->nzaxis ) index = -1;
+
+  return (index);
+}
+
+
+void vlistChangeZaxisIndex(int vlistID, int index, int zaxisID)
+{
+  int zaxisIDold;
+  int varID, nvars;
+  int nlevs, levID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  zaxisIDold = vlistptr->zaxisIDs[index];
+  vlistptr->zaxisIDs[index] = zaxisID;
+
+  nvars = vlistptr->nvars;
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vlistptr->vars[varID].zaxisID == zaxisIDold )
+      {
+        vlistptr->vars[varID].zaxisID = zaxisID;
+
+        nlevs = zaxisInqSize(zaxisID);
+        if ( nlevs != vlistptr->vars[varID].nlevs )
+          {
+            vlistptr->vars[varID].nlevs   = nlevs;
+            vlistptr->vars[varID].levinfo = (levinfo_t *) realloc(vlistptr->vars[varID].levinfo,
+                                                                     nlevs*sizeof(levinfo_t));
+
+            for ( levID = 0; levID < nlevs; levID++ )
+              {
+                vlistptr->vars[varID].levinfo[levID].flevelID = levID;
+                vlistptr->vars[varID].levinfo[levID].mlevelID = levID;
+                vlistptr->vars[varID].levinfo[levID].index    = -1;
+                vlistptr->vars[varID].levinfo[levID].flag     = FALSE;
+              }
+          }
+      }
+}
+
+
+void vlistChangeZaxis(int vlistID, int zaxisID1, int zaxisID2)
+{
+  int varID, nvars;
+  int index, nzaxis;
+  int nlevs, levID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  nzaxis = vlistptr->nzaxis;
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      if ( vlistptr->zaxisIDs[index] == zaxisID1 )
+        {
+          vlistptr->zaxisIDs[index] = zaxisID2;
+          break;
+        }
+    }
+
+  nvars = vlistptr->nvars;
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vlistptr->vars[varID].zaxisID == zaxisID1 )
+      {
+        vlistptr->vars[varID].zaxisID = zaxisID2;
+
+        nlevs = zaxisInqSize(zaxisID2);
+        if ( nlevs != vlistptr->vars[varID].nlevs )
+          {
+            vlistptr->vars[varID].nlevs   = nlevs;
+            vlistptr->vars[varID].levinfo = (levinfo_t *) realloc(vlistptr->vars[varID].levinfo,
+                                                                     nlevs*sizeof(levinfo_t));
+
+            for ( levID = 0; levID < nlevs; levID++ )
+              {
+                vlistptr->vars[varID].levinfo[levID].flevelID = levID;
+                vlistptr->vars[varID].levinfo[levID].mlevelID = levID;
+                vlistptr->vars[varID].levinfo[levID].index    = -1;
+                vlistptr->vars[varID].levinfo[levID].flag     = FALSE;
+              }
+          }
+      }
+}
+
+
+int vlistHasTime(int vlistID)
+{
+  int varID;
+  int hastime = FALSE;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlist_check_ptr(__func__, vlistptr);
+
+  for ( varID = 0; varID <  vlistptr->nvars; varID++ )
+    if ( vlistptr->vars[varID].tsteptype != TSTEP_CONSTANT )
+      {
+        hastime = TRUE;
+        break;
+      }
+
+  return (hastime);
+}
+
+#ifdef USE_MPI
+
+enum {
+  vlist_nints=7,
+};
+
+static int
+vlistTxCode ( void )
+{
+  return VLIST;
+}
+
+
+static
+int  vlistGetSizeP ( void * vlistptr, MPI_Comm comm )
+{
+  int txsize, varID;
+  vlist_t *p = vlistptr;
+  xmpi(MPI_Pack_size(vlist_nints, MPI_INT, comm, &txsize));
+  txsize += vlistAttsGetSize(p, CDI_GLOBAL, comm);
+  for ( varID = 0; varID <  p->nvars; varID++ )
+    txsize += vlistVarGetSize(p, varID, comm);
+  return txsize;
+}
+
+
+static
+void vlistPackP ( void * vlistptr, void * buf, int size, int *position,
+                  MPI_Comm comm )
+{
+  int varID, tempbuf[vlist_nints];
+  vlist_t *p = vlistptr;
+  tempbuf[0] = p->self;
+  tempbuf[1] = p->nvars;
+  tempbuf[2] = p->ntsteps;
+  tempbuf[3] = p->taxisID;
+  tempbuf[4] = p->tableID;
+  tempbuf[5] = p->instID;
+  tempbuf[6] = p->modelID;
+  xmpi(MPI_Pack(tempbuf, vlist_nints, MPI_INT, buf, size, position, comm));
+  vlistAttsPack(p, CDI_GLOBAL, buf, size, position, comm);
+  for ( varID = 0; varID < p->nvars; varID++ )
+    {
+      vlistVarPack(p, varID, buf, size, position, comm);
+    }
+}
+
+void vlistUnpack(char * buf, int size, int *position, int nspTarget, MPI_Comm comm)
+{
+  int newvlist;
+  int varID, tempbuf[vlist_nints];
+  xmpi(MPI_Unpack(buf, size, position, tempbuf, vlist_nints, MPI_INT, comm));
+  newvlist = vlistCreate();
+  /* xassert(newvlist == tempbuf[0]); */
+  vlistDefTaxis ( newvlist, namespaceAdaptKey ( tempbuf[3], nspTarget ));
+  vlistDefTable(newvlist, tempbuf[4]);
+  vlistDefInstitut ( newvlist, namespaceAdaptKey ( tempbuf[5], nspTarget ));
+  vlistDefModel ( newvlist, namespaceAdaptKey ( tempbuf[6], nspTarget ));
+  vlistAttsUnpack(newvlist, CDI_GLOBAL, buf, size, position, comm);
+  for ( varID = 0; varID < tempbuf[1]; varID++ )
+    vlistVarUnpack ( newvlist, buf, size, position, nspTarget, comm );
+}
+
+#endif
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/vlist.h b/libcdi/src/vlist.h
new file mode 100644
index 0000000..db35667
--- /dev/null
+++ b/libcdi/src/vlist.h
@@ -0,0 +1,170 @@
+#ifndef _VLIST_H
+#define _VLIST_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <stddef.h>  /* size_t */
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+#ifndef _CDI_LIMITS_H
+#  include "cdi_limits.h"
+#endif
+
+#define VALIDMISS 1.e+303
+
+/*
+ * CDI attribute
+ */
+typedef struct {
+  size_t    xsz;	  /* amount of space at xvalue                      */
+  size_t    namesz;       /* size of name                                   */
+  char     *name;         /* attribute name                                 */
+  int       indtype;	  /* internal data type of xvalue (INT, FLT or TXT) */
+  int       exdtype;      /* external data type                             */
+                          /* indtype    exdtype                             */
+                          /* TXT        TXT                                 */
+                          /* INT        INT16, INT32                        */
+                          /* FLT        FLT32, FLT64                        */
+  size_t    nelems;    	  /* number of elements                             */
+  void     *xvalue;       /* the actual data                                */
+} cdi_att_t;
+
+
+typedef struct {
+  size_t     nalloc;		/* number allocated >= nelems */
+  size_t     nelems;		/* length of the array */
+  cdi_att_t  value[MAX_ATTRIBUTES];
+} cdi_atts_t;
+
+
+typedef struct
+{
+  int      flag;
+  int      index;
+  int      mlevelID;
+  int      flevelID;
+}
+levinfo_t;
+
+
+typedef struct
+{
+  int      rank;
+  int      offset;
+  int      chunk;
+}
+deco_t;
+
+typedef struct
+{
+  int ens_index;
+  int ens_count;
+  int forecast_init_type;
+}
+ensinfo_t;
+
+
+typedef struct
+{
+  int         flag;
+  int         nlevs;
+  int         isUsed;
+  int         mvarID;
+  int         fvarID;
+  int         param;
+  int         gridID;
+  int         zaxisID;
+  int         tsteptype; /* TSTEP_* */
+  int         datatype;  /* DATATYPE_PACKX for GRIB data, else DATATYPE_FLT32 or DATATYPE_FLT64 */
+  int         instID;
+  int         modelID;
+  int         tableID;
+  int         timave;
+  int         timaccu;
+  int         chunktype;
+  int         xyz;
+  int         missvalused; /* TRUE if missval is defined */
+  int         lvalidrange;
+  char       *name;
+  char       *longname;
+  char       *stdname;
+  char       *units;
+  double      missval;
+  double      scalefactor;
+  double      addoffset;
+  double      validrange[2];
+  levinfo_t  *levinfo;
+  int         comptype;     // compression type
+  int         complevel;    // compression level
+  ensinfo_t  *ensdata;      /* Ensemble information */
+  cdi_atts_t  atts;
+  int         iorank;
+  int         decoSize;
+  deco_t     *deco;
+
+}
+var_t;
+
+
+typedef struct
+{
+  int         self;
+  int         nvars;        /* number of variables                */
+  int         ngrids;
+  int         nzaxis;
+  int         ntsteps;
+  int         taxisID;
+  int         tableID;
+  int         instID;
+  int         modelID;
+  int         varsAllocated;
+  int         gridIDs[MAX_GRIDS_PS];
+  int         zaxisIDs[MAX_ZAXES_PS];
+  var_t      *vars;
+  cdi_atts_t  atts;
+}
+vlist_t;
+
+
+vlist_t *vlist_to_pointer(int vlistID);
+const char *vlistInqVarNamePtr(int vlistID, int varID);
+const char *vlistInqVarLongnamePtr(int vlistID, int varID);
+const char *vlistInqVarStdnamePtr(int vlistID, int varID);
+const char *vlistInqVarUnitsPtr(int vlistID, int varID);
+void     vlistDestroyVarName(int vlistID, int varID);
+void     vlistDestroyVarLongname(int vlistID, int varID);
+void     vlistDestroyVarUnits(int vlistID, int varID);
+void     vlistDefVarTsteptype(int vlistID, int varID, int tsteptype);
+int      vlistInqVarMissvalUsed(int vlistID, int varID);
+int      vlistHasTime(int vlistID);
+
+int      vlistDelAtts(int vlistID, int varID);
+int      vlistCopyVarAtts(int vlistID1, int varID_1, int vlistID2, int varID_2);
+
+#ifdef USE_MPI
+void     vlistUnpack(char * buffer, int bufferSize, int * pos, int, MPI_Comm comm);
+void     vlistDefVarDeco ( int vlistID, int varID, int decoSize, 
+                              deco_t * deco );
+#endif
+
+/*      vlistDefVarValidrange: Define the valid range of a Variable */
+void    vlistDefVarValidrange(int vlistID, int varID, const double *validrange);
+
+/*      vlistInqVarValidrange: Get the valid range of a Variable */
+int     vlistInqVarValidrange(int vlistID, int varID, double *validrange);
+
+#endif  /* _VLIST_H */
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/vlist_att.c b/libcdi/src/vlist_att.c
new file mode 100644
index 0000000..39076cb
--- /dev/null
+++ b/libcdi/src/vlist_att.c
@@ -0,0 +1,647 @@
+#ifdef HAVE_CONFIG_H
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <assert.h>
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+#include "dmemory.h"
+
+#include "cdi.h"
+#include "stream_int.h"
+#include "vlist.h"
+#include "pio_util.h"
+
+
+static
+cdi_atts_t *get_attsp(vlist_t *vlistptr, int varID)
+{
+  cdi_atts_t *attsp = NULL;
+
+  if ( varID == CDI_GLOBAL )
+    {
+      attsp = &vlistptr->atts;
+    }
+  else
+    {
+      if ( varID >= 0 && varID < vlistptr->nvars )
+	attsp = &(vlistptr->vars[varID].atts);
+    }
+
+  return (attsp);
+}
+
+static
+cdi_att_t *find_att(cdi_atts_t *attsp, const char *name)
+{
+  cdi_att_t *attp;
+  size_t attid;
+  size_t slen;
+
+  xassert(attsp != NULL);
+
+  if ( attsp->nelems == 0 ) return NULL;
+
+  slen = strlen(name);
+
+  for ( attid = 0; attid < attsp->nelems; attid++ )
+    {
+      attp = &(attsp->value[attid]);
+      if ( attp->namesz == slen )
+	if ( memcmp(attp->name, name, slen) == 0)
+	  {
+	    return (attp); /* Normal return */
+	  }
+    }
+
+  return (NULL);
+}
+
+static
+cdi_att_t *new_att(cdi_atts_t *attsp, const char *name)
+{
+  cdi_att_t *attp;
+  size_t slen;
+
+  xassert(attsp != NULL);
+  xassert(name  != NULL);
+
+  if ( attsp->nelems == attsp->nalloc ) return (NULL);
+
+  attp = &(attsp->value[attsp->nelems]);
+  attsp->nelems++;
+
+  slen = strlen(name);
+
+  attp->name = (char *) malloc(slen+1);
+  memcpy(attp->name, name, slen+1);
+  attp->namesz = slen;
+  attp->xvalue = NULL;
+
+  return (attp);
+}
+
+static
+void fill_att(cdi_att_t *attp, int indtype, int exdtype, size_t nelems, size_t xsz, const void *xvalue)
+{
+  xassert(attp != NULL);
+
+  attp->xsz = xsz;
+  attp->indtype = indtype;
+  attp->exdtype = exdtype;
+  attp->nelems  = nelems;
+
+  if ( xsz > 0 )
+    {
+      attp->xvalue = xrealloc(attp->xvalue, xsz);
+      memcpy(attp->xvalue, xvalue, xsz);
+    }
+}
+
+/*
+ at Function  vlistInqNatts
+ at Title     Get number of variable attributes
+
+ at Prototype int vlistInqNatts(int vlistID, int varID, int *nattsp)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  nattsp   Pointer to location for returned number of variable attributes.
+
+ at Description
+The function @func{vlistInqNatts} gets the number of variable attributes assigned to this variable.
+
+ at EndFunction
+*/
+int vlistInqNatts(int vlistID, int varID, int *nattsp)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr;
+  cdi_atts_t *attsp;
+
+  vlistptr = vlist_to_pointer(vlistID);
+  
+  attsp = get_attsp(vlistptr, varID);
+  xassert(attsp != NULL);
+
+  *nattsp = attsp->nelems;
+
+  return (status);
+}
+
+/*
+ at Function  vlistInqAtt
+ at Title     Get information about an attribute
+
+ at Prototype int vlistInqAtt(int vlistID, int varID, int attnum, char *name, int *typep, int *lenp)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  attnum   Attribute number (from 0 to natts-1).
+    @Item  name     Pointer to the location for the returned attribute name. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+    @Item  typep    Pointer to location for returned attribute type.
+    @Item  lenp     Pointer to location for returned attribute number.
+
+ at Description
+The function @func{vlistInqAtt} gets information about an attribute.
+
+ at EndFunction
+*/
+int vlistInqAtt(int vlistID, int varID, int attnum, char *name, int *typep, int *lenp)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr;
+  cdi_att_t *attp = NULL;
+  cdi_atts_t *attsp;
+
+  xassert(name != NULL);
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  attsp = get_attsp(vlistptr, varID);
+  xassert(attsp != NULL);
+
+  if ( attnum >= 0 && attnum < (int)attsp->nelems )
+    attp = &(attsp->value[attnum]);
+
+  if ( attp != NULL ) /* name in use */
+    {
+      memcpy(name, attp->name, attp->namesz+1);
+      *typep  = attp->exdtype;
+      *lenp   = attp->nelems;
+    }
+  else
+    {
+      name[0] =  0;
+      *typep  = -1;
+      *lenp   =  0;
+    }
+
+  return (status);
+}
+
+
+int vlistDelAtts(int vlistID, int varID)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr;
+  cdi_att_t *attp = NULL;
+  cdi_atts_t *attsp;
+  int attid;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  attsp = get_attsp(vlistptr, varID);
+  xassert(attsp != NULL);
+
+  for ( attid = 0; attid < (int)attsp->nelems; attid++ )
+    {
+      attp = &(attsp->value[attid]);
+      if ( attp->name   ) free(attp->name);
+      if ( attp->xvalue ) free(attp->xvalue);
+    }
+
+  attsp->nelems = 0;
+
+  return (status);
+}
+
+
+int vlistDelAtt(int vlistID, int varID, const char *name)
+{
+  int status = CDI_NOERR;
+
+  fprintf(stderr, "vlistDelAtt not implemented!\n");
+
+  return (status);
+}
+
+static
+int vlist_def_att(int indtype, int exdtype, int vlistID, int varID, const char *name, size_t len, size_t xsz, const void *xp)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr;
+  cdi_att_t *attp;
+  cdi_atts_t *attsp;
+
+  if ( len != 0 && xp == NULL ) /* Null arg */
+    {
+      return (CDI_EINVAL);
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  attsp = get_attsp(vlistptr, varID);
+  xassert(attsp != NULL);
+
+  attp = find_att(attsp, name);
+  if ( attp == NULL )
+    attp = new_att(attsp, name);
+
+  if ( attp != NULL )
+    fill_att(attp, indtype, exdtype, len, xsz, xp);
+  
+  return (status);
+}
+
+static
+int vlist_inq_att(int indtype, int vlistID, int varID, const char *name, size_t mxsz, void *xp)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr;
+  cdi_att_t *attp;
+  cdi_atts_t *attsp;
+  size_t xsz;
+
+  if ( mxsz != 0 && xp == NULL ) /* Null arg */
+    {
+      return (CDI_EINVAL);
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  attsp = get_attsp(vlistptr, varID);
+  xassert(attsp != NULL);
+
+  attp = find_att(attsp, name);
+  if ( attp != NULL ) /* name in use */
+    {
+      if ( attp->indtype == indtype )
+	{
+	  xsz = attp->xsz;
+	  if ( mxsz < xsz ) xsz = mxsz;
+	  if ( xsz > 0 )
+	    memcpy(xp, attp->xvalue, xsz);
+	}
+      else
+	{
+	  Warning("Attribute %s has wrong data type!", name);
+	}
+    }
+  else
+    {
+      Warning("Internal problem, attribute %s not found!", name);
+    }
+
+  return (status);
+}
+
+
+int vlistCopyVarAtts(int vlistID1, int varID_1, int vlistID2, int varID_2)
+{
+  int status = CDI_NOERR;
+  vlist_t *vlistptr1;
+  cdi_att_t *attp = NULL;
+  cdi_atts_t *attsp1;
+  int attid;
+
+  vlistptr1 = vlist_to_pointer(vlistID1);
+
+  attsp1 = get_attsp(vlistptr1, varID_1);
+  xassert(attsp1 != NULL);
+
+  for ( attid = 0; attid < (int)attsp1->nelems; attid++ )
+    {
+      attp = &(attsp1->value[attid]);
+      vlist_def_att(attp->indtype, attp->exdtype, vlistID2, varID_2, attp->name, attp->nelems, attp->xsz, attp->xvalue);
+    }
+
+  return (status);
+}
+
+/*
+ at Function  vlistDefAttInt
+ at Title     Define an integer attribute
+
+ at Prototype int vlistDefAttInt(int vlistID, int varID, const char *name, int type, int len, const int *ip)
+
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  type     External data type (@func{DATATYPE_INT16} or @func{DATATYPE_INT32}).
+    @Item  len      Number of values provided for the attribute.
+    @Item  ip       Pointer to one or more integer values.
+
+ at Description
+The function @func{vlistDefAttInt} defines an integer attribute.
+
+ at EndFunction
+*/
+int vlistDefAttInt(int vlistID, int varID, const char *name, int type, int len, const int *ip)
+{
+  int status;
+
+  status = vlist_def_att(DATATYPE_INT, type, vlistID, varID, name, (size_t) len, len*sizeof(int), (const void *) ip);
+
+  return (status);
+}
+
+/*
+ at Function  vlistDefAttFlt
+ at Title     Define a floating point attribute
+
+ at Prototype int vlistDefAttFlt(int vlistID, int varID, const char *name, int type, int len, const double *dp)
+
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  type     External data type (@func{DATATYPE_FLT32} or @func{DATATYPE_FLT64}).
+    @Item  len      Number of values provided for the attribute.
+    @Item  dp       Pointer to one or more floating point values.
+
+ at Description
+The function @func{vlistDefAttFlt} defines a floating point attribute.
+
+ at EndFunction
+*/
+int vlistDefAttFlt(int vlistID, int varID, const char *name, int type, int len, const double *dp)
+{
+  int status;
+
+  status = vlist_def_att(DATATYPE_FLT, type, vlistID, varID, name, (size_t) len, len*sizeof(double), (const void *) dp);
+
+  return (status);
+}
+
+/*
+ at Function  vlistDefAttTxt
+ at Title     Define a text attribute
+
+ at Prototype int vlistDefAttTxt(int vlistID, int varID, const char *name, int len, const char *tp)
+
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  len      Number of values provided for the attribute.
+    @Item  tp       Pointer to one or more character values.
+
+ at Description
+The function @func{vlistDefAttTxt} defines a text attribute.
+
+ at EndFunction
+*/
+int vlistDefAttTxt(int vlistID, int varID, const char *name, int len, const char *tp)
+{
+  int status;
+
+  status = vlist_def_att(DATATYPE_TXT, DATATYPE_TXT, vlistID, varID, name, (size_t) len, len*sizeof(char), (const void *) tp);
+
+  return (status);
+}
+
+/*
+ at Function  vlistInqAttInt
+ at Title     Get the value(s) of an integer attribute
+
+ at Prototype int vlistInqAttInt(int vlistID, int varID, const char *name, int mlen, int *ip)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  mlen     Number of allocated values provided for the attribute.
+    @Item  ip       Pointer location for returned integer attribute value(s).
+
+ at Description
+The function @func{vlistInqAttInt} gets the values(s) of an integer attribute.
+
+ at EndFunction
+*/
+int vlistInqAttInt(int vlistID, int varID, const char *name, int mlen, int *ip)
+{
+  int status
+    = vlist_inq_att(DATATYPE_INT, vlistID, varID, name,
+                    mlen*sizeof(int), (void *) ip);
+  return status;
+}
+
+/*
+ at Function  vlistInqAttFlt
+ at Title     Get the value(s) of a floating point attribute
+
+ at Prototype int vlistInqAttFlt(int vlistID, int varID, const char *name, int mlen, int *dp)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  mlen     Number of allocated values provided for the attribute.
+    @Item  dp       Pointer location for returned floating point attribute value(s).
+
+ at Description
+The function @func{vlistInqAttFlt} gets the values(s) of a floating point attribute.
+
+ at EndFunction
+*/
+int vlistInqAttFlt(int vlistID, int varID, const char *name, int mlen, double *dp)
+{
+  int status = CDI_NOERR;
+
+  status = vlist_inq_att(DATATYPE_FLT, vlistID, varID, name, mlen*sizeof(double), (void *) dp);
+
+  return (status);
+}
+
+/*
+ at Function  vlistInqAttTxt
+ at Title     Get the value(s) of a text attribute
+
+ at Prototype int vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen, int *tp)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier, or @func{CDI_GLOBAL} for a global attribute.
+    @Item  name     Attribute name.
+    @Item  mlen     Number of allocated values provided for the attribute.
+    @Item  tp       Pointer location for returned text attribute value(s).
+
+ at Description
+The function @func{vlistInqAttTxt} gets the values(s) of a text attribute.
+
+ at EndFunction
+*/
+int vlistInqAttTxt(int vlistID, int varID, const char *name, int mlen, char *tp)
+{
+  int status = CDI_NOERR;
+
+  status = vlist_inq_att(DATATYPE_TXT, vlistID, varID, name, mlen*sizeof(char), (void *) tp);
+
+  return (status);
+}
+
+#ifdef USE_MPI
+
+enum {
+  vlist_att_nints = 4,          /* namesz, exdtype, indtype, nelems */
+};
+
+static int
+vlistAttGetSize(vlist_t *vlistptr, int varID, int attnum, MPI_Comm comm)
+{
+  int txsize = 0, txinc;
+  cdi_atts_t *attsp;
+  cdi_att_t *attp;
+  char text[1024];
+
+  xassert(attsp = get_attsp(vlistptr, varID));
+  xassert(attnum >= 0 && attnum < (int)attsp->nelems);
+  attp = &(attsp->value[attnum]);
+  xmpi(MPI_Pack_size(vlist_att_nints, MPI_INT, comm, &txsize));
+  xmpi(MPI_Pack_size(attp->namesz, MPI_CHAR, comm, &txinc));
+  txsize += txinc;
+  switch (attp->indtype)
+  {
+  case DATATYPE_FLT:
+    xmpi(MPI_Pack_size((int)attp->nelems, MPI_DOUBLE, comm, &txinc));
+    break;
+  case DATATYPE_INT:
+    xmpi(MPI_Pack_size((int)attp->nelems, MPI_INT, comm, &txinc));
+    break;
+  case DATATYPE_TXT:
+    xmpi(MPI_Pack_size((int)attp->nelems, MPI_CHAR, comm, &txinc));
+    break;
+  default:
+    sprintf( text, "Unknown datatype encountered in attribute %s: %d\n",
+            attp->name, attp->indtype);
+    xabort ( text );
+  }
+  txsize += txinc;
+  return txsize;
+}
+
+int
+vlistAttsGetSize(vlist_t *p, int varID, MPI_Comm comm)
+{
+  int numAtts, i;
+  int txsize;
+  cdi_atts_t *attsp = get_attsp(p, varID);
+  numAtts = attsp->nelems;
+  xmpi(MPI_Pack_size(1, MPI_INT, comm, &txsize));
+  for (i = 0; i < numAtts; ++i)
+  {
+    txsize += vlistAttGetSize(p, varID, i, comm);
+  }
+  return txsize;
+}
+
+static void
+vlistAttPack(vlist_t *vlistptr, int varID, int attnum,
+             void * buf, int size, int *position, MPI_Comm comm)
+{
+  cdi_atts_t *attsp;
+  cdi_att_t *attp;
+  int tempbuf[vlist_att_nints];
+  MPI_Datatype attVMPIDt;
+
+  xassert(attsp = get_attsp(vlistptr, varID));
+  xassert(attnum >= 0 && attnum < (int)attsp->nelems);
+  attp = &(attsp->value[attnum]);
+  tempbuf[0] = attp->namesz;
+  tempbuf[1] = attp->exdtype;
+  tempbuf[2] = attp->indtype;
+  tempbuf[3] = attp->nelems;
+  xmpi(MPI_Pack(tempbuf, vlist_att_nints, MPI_INT, buf, size, position, comm));
+  xmpi(MPI_Pack(attp->name, attp->namesz, MPI_CHAR, buf, size, position, comm));
+  switch (attp->indtype)
+  {
+  case DATATYPE_FLT:
+    attVMPIDt = MPI_DOUBLE;
+    break;
+  case DATATYPE_INT:
+    attVMPIDt = MPI_INT;
+    break;
+  case DATATYPE_TXT:
+    attVMPIDt = MPI_CHAR;
+    break;
+  default:
+    xabort("Unknown datatype encountered in attribute %s: %d\n",
+           attp->name, attp->indtype);
+  }
+  xmpi(MPI_Pack(attp->xvalue, (int)attp->nelems, attVMPIDt,
+                buf, size, position, comm));
+}
+
+void
+vlistAttsPack(vlist_t *p, int varID,
+              void * buf, int size, int *position, MPI_Comm comm)
+{
+  int numAtts, i;
+  cdi_atts_t *attsp = get_attsp(p, varID);
+  numAtts = attsp->nelems;
+  xmpi(MPI_Pack(&numAtts, 1, MPI_INT, buf, size, position, comm));
+  for (i = 0; i < numAtts; ++i)
+    vlistAttPack(p, varID, i, buf, size, position, comm);
+}
+
+static void
+vlistAttUnpack(int vlistID, int varID,
+               void * buf, int size, int *position, MPI_Comm comm)
+{
+  char *attName;
+  int tempbuf[vlist_att_nints];
+  MPI_Datatype attVMPIDt;
+  int elemSize;
+  void *attData;
+
+  xmpi(MPI_Unpack(buf, size, position,
+                  tempbuf, vlist_att_nints, MPI_INT, comm));
+  attName = xmalloc(tempbuf[0] + 1);
+  xmpi(MPI_Unpack(buf, size, position, attName, tempbuf[0], MPI_CHAR, comm));
+  attName[tempbuf[0]] = '\0';
+  switch (tempbuf[2])
+  {
+  case DATATYPE_FLT:
+    attVMPIDt = MPI_DOUBLE;
+    elemSize = sizeof(double);
+    break;
+  case DATATYPE_INT:
+    attVMPIDt = MPI_INT;
+    elemSize = sizeof(int);
+    break;
+  case DATATYPE_TXT:
+    attVMPIDt = MPI_CHAR;
+    elemSize = 1;
+    break;
+  default:
+    xabort("Unknown datatype encountered in attribute %s: %d\n",
+           attName, tempbuf[2]);
+  }
+  attData = xmalloc(elemSize * tempbuf[3]);
+  xmpi(MPI_Unpack(buf, size, position, attData, tempbuf[3], attVMPIDt, comm));
+  vlist_def_att(tempbuf[2], tempbuf[1], vlistID, varID, attName,
+                tempbuf[3], tempbuf[3] * elemSize, attData);
+  free(attName);
+  free(attData);
+}
+
+void
+vlistAttsUnpack(int vlistID, int varID,
+                void * buf, int size, int *position, MPI_Comm comm)
+{
+  int numAtts, i;
+  xmpi(MPI_Unpack(buf, size, position, &numAtts, 1, MPI_INT, comm));
+  for (i = 0; i < numAtts; ++i)
+  {
+    vlistAttUnpack(vlistID, varID, buf, size, position, comm);
+  }
+}
+
+
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/vlist_att.h b/libcdi/src/vlist_att.h
new file mode 100644
index 0000000..0a02a80
--- /dev/null
+++ b/libcdi/src/vlist_att.h
@@ -0,0 +1,37 @@
+#ifndef VLIST_ATT_H
+#define VLIST_ATT_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+#ifdef USE_MPI
+
+int
+vlistAttsGetSize(vlist_t *p, int varID, MPI_Comm comm);
+
+void
+vlistAttsPack(vlist_t *p, int varID,
+              void * buf, int size, int *position, MPI_Comm comm);
+
+void
+vlistAttsUnpack(int vlistID, int varID,
+                void * buf, int size, int *position, MPI_Comm comm);
+
+#endif
+
+#endif
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/vlist_var.c b/libcdi/src/vlist_var.c
new file mode 100644
index 0000000..ad6331e
--- /dev/null
+++ b/libcdi/src/vlist_var.c
@@ -0,0 +1,2173 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <limits.h>
+#ifdef USE_MPI
+#include <mpi.h>
+#include "pio_comm.h"
+#endif
+
+#include "dmemory.h"
+#include "cdi.h"
+#include "stream_int.h"
+#include "vlist.h"
+#include "vlist_var.h"
+#include "resource_handle.h"
+#include "vlist_att.h"
+#include "namespace.h"
+#include "pio_util.h"
+
+extern resOps vlist_ops;
+
+static
+void vlistvarInitEntry(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].fvarID        = varID;
+  vlistptr->vars[varID].mvarID        = varID;
+  vlistptr->vars[varID].flag          = 0;
+  vlistptr->vars[varID].param         = 0;
+  vlistptr->vars[varID].datatype      = CDI_UNDEFID;
+  vlistptr->vars[varID].tsteptype     = TSTEP_INSTANT;
+  vlistptr->vars[varID].timave        = 0;
+  vlistptr->vars[varID].timaccu       = 0;
+  vlistptr->vars[varID].chunktype     = cdiChunkType;
+  vlistptr->vars[varID].xyz           = 0;
+  vlistptr->vars[varID].gridID        = CDI_UNDEFID;
+  vlistptr->vars[varID].zaxisID       = CDI_UNDEFID;
+  vlistptr->vars[varID].instID        = CDI_UNDEFID;
+  vlistptr->vars[varID].modelID       = CDI_UNDEFID;
+  vlistptr->vars[varID].tableID       = CDI_UNDEFID;
+  vlistptr->vars[varID].missvalused   = FALSE;
+  vlistptr->vars[varID].missval       = cdiDefaultMissval;
+  vlistptr->vars[varID].addoffset     = 0.0;
+  vlistptr->vars[varID].scalefactor   = 1.0;
+  vlistptr->vars[varID].name          = NULL;
+  vlistptr->vars[varID].longname      = NULL;
+  vlistptr->vars[varID].stdname       = NULL;
+  vlistptr->vars[varID].units         = NULL;
+  vlistptr->vars[varID].nlevs         = 0;
+  vlistptr->vars[varID].levinfo       = NULL;
+  vlistptr->vars[varID].comptype      = COMPRESS_NONE;
+  vlistptr->vars[varID].complevel     = 1;
+  vlistptr->vars[varID].atts.nalloc   = MAX_ATTRIBUTES;
+  vlistptr->vars[varID].atts.nelems   = 0;
+  vlistptr->vars[varID].lvalidrange   = 0;
+  vlistptr->vars[varID].validrange[0] = VALIDMISS;
+  vlistptr->vars[varID].validrange[1] = VALIDMISS;
+  vlistptr->vars[varID].ensdata       = NULL;
+  vlistptr->vars[varID].iorank        = CDI_UNDEFID;
+  vlistptr->vars[varID].decoSize      = 0;
+  vlistptr->vars[varID].deco          = NULL;
+}
+
+static
+int vlistvarNewEntry(int vlistID)
+{
+  int varID = 0;
+  int vlistvarSize;
+  var_t *vlistvar;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistvarSize = vlistptr->varsAllocated;
+  vlistvar     = vlistptr->vars;
+  /*
+    Look for a free slot in vlistvar.
+    (Create the table the first time through).
+  */
+  if ( ! vlistvarSize )
+    {
+      int i;
+
+      vlistvarSize = 2;
+      vlistvar = (var_t *) malloc(vlistvarSize*sizeof(var_t));
+      if ( vlistvar == NULL )
+	{
+          Message("vlistvarSize = %d", vlistvarSize);
+	  SysError("Allocation of var_t failed");
+	}
+
+      for ( i = 0; i < vlistvarSize; i++ )
+	vlistvar[i].isUsed = FALSE;
+    }
+  else
+    {
+      while ( varID < vlistvarSize )
+	{
+	  if ( ! vlistvar[varID].isUsed ) break;
+	  varID++;
+	}
+    }
+  /*
+    If the table overflows, double its size.
+  */
+  if ( varID == vlistvarSize )
+    {
+      int i;
+
+      vlistvarSize = 2*vlistvarSize;
+      vlistvar = (var_t *) realloc(vlistvar, vlistvarSize*sizeof(var_t));
+      if ( vlistvar == NULL )
+	{
+          Message("vlistvarSize = %d", vlistvarSize);
+	  SysError("Reallocation of var_t failed");
+	}
+      varID = vlistvarSize/2;
+
+      for ( i = varID; i < vlistvarSize; i++ )
+	vlistvar[i].isUsed = FALSE;
+    }
+
+  vlistptr->varsAllocated = vlistvarSize;
+  vlistptr->vars          = vlistvar;
+
+  vlistvarInitEntry(vlistID, varID);
+
+  vlistptr->vars[varID].isUsed = TRUE;
+
+  return (varID);
+}
+
+static
+void vlistCheckVarID(const char *caller, int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( vlistptr == NULL )
+    Errorc("vlist undefined!");
+
+  if ( varID < 0 || varID >= vlistptr->nvars )
+    Errorc("varID %d undefined!", varID);
+
+  if ( ! vlistptr->vars[varID].isUsed )
+    Errorc("varID %d undefined!", varID);
+}
+
+/*
+ at Function  vlistDefVar
+ at Title     Define a Variable
+
+ at Prototype int vlistDefVar(int vlistID, int gridID, int zaxisID, int tsteptype)
+ at Parameter
+    @Item  vlistID   Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  gridID    Grid ID, from a previous call to @fref{gridCreate}.
+    @Item  zaxisID   Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  tsteptype One of the set of predefined CDI timestep types.
+                     The valid CDI timestep types are @func{TSTEP_CONSTANT} and @func{TSTEP_INSTANT}.
+
+ at Description
+The function @func{vlistDefVar} adds a new variable to vlistID.
+
+ at Result
+ at func{vlistDefVar} returns an identifier to the new variable.
+
+ at Example
+Here is an example using @func{vlistCreate} to create a variable list
+and add a variable with @func{vlistDefVar}.
+
+ at Source
+#include "cdi.h"
+   ...
+int vlistID, varID;
+   ...
+vlistID = vlistCreate();
+varID = vlistDefVar(vlistID, gridID, zaxisID, TIME_INSTANT);
+   ...
+streamDefVlist(streamID, vlistID);
+   ...
+vlistDestroy(vlistID);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int vlistDefVar(int vlistID, int gridID, int zaxisID, int tsteptype)
+{
+  int varID;
+  int nlevs;
+  int levID;
+  int index;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return CDI_UNDEFID;
+    }
+
+  if ( CDI_Debug )
+    Message("gridID = %d  zaxisID = %d  tsteptype = %d", gridID, zaxisID, tsteptype);
+
+  varID = vlistvarNewEntry(vlistID);
+
+  vlistptr->nvars++;
+
+  vlistptr->vars[varID].gridID  = gridID;
+  vlistptr->vars[varID].zaxisID = zaxisID;
+  vlistptr->vars[varID].tsteptype = tsteptype;
+
+  if ( tsteptype < 0 )
+    {
+      Message("Unexpected tstep type %d, set to TSTEP_INSTANT!", tsteptype);
+      vlistptr->vars[varID].tsteptype = TSTEP_INSTANT;
+    }
+
+  nlevs = zaxisInqSize(zaxisID);
+
+  vlistptr->vars[varID].levinfo = (levinfo_t *) malloc(nlevs*sizeof(levinfo_t));
+
+  for ( levID = 0; levID < nlevs; levID++ )
+    {
+      vlistptr->vars[varID].levinfo[levID].flag     = 0;
+      vlistptr->vars[varID].levinfo[levID].index    = -1;
+      vlistptr->vars[varID].levinfo[levID].flevelID = levID;
+      vlistptr->vars[varID].levinfo[levID].mlevelID = levID;
+    }
+
+  vlistptr->vars[varID].nlevs = nlevs;
+
+  for ( index = 0; index < vlistptr->ngrids; index++ )
+    if ( gridID == vlistptr->gridIDs[index] ) break;
+
+  if ( index == vlistptr->ngrids )
+    {
+      if ( vlistptr->ngrids + 1 >= MAX_GRIDS_PS )
+	Error("Maximum of %d grids reached", MAX_GRIDS_PS);
+
+      vlistptr->gridIDs[vlistptr->ngrids] = gridID;
+      vlistptr->ngrids++;
+    }
+
+  for ( index = 0; index < vlistptr->nzaxis; index++ )
+    if ( zaxisID == vlistptr->zaxisIDs[index] ) break;
+
+  if ( index == vlistptr->nzaxis )
+    {
+      if ( vlistptr->nzaxis + 1 >= MAX_ZAXES_PS )
+	Error("Maximum of %d zaxis reached", MAX_ZAXES_PS);
+
+      vlistptr->zaxisIDs[vlistptr->nzaxis] = zaxisID;
+      vlistptr->nzaxis++;
+    }
+
+  vlistptr->vars[varID].param = cdiEncodeParam(-(varID + 1), 255, 255);
+
+  return (varID);
+}
+
+/*
+ at Function  vlistDefVarParam
+ at Title     Define the parameter number of a Variable
+
+ at Prototype void vlistDefVarParam(int vlistID, int varID, int param)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  param    Parameter number.
+
+ at Description
+The function @func{vlistDefVarParam} defines the parameter number of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarParam(int vlistID, int varID, int param)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->vars[varID].param = param;
+}
+
+/*
+ at Function  vlistDefVarCode
+ at Title     Define the code number of a Variable
+
+ at Prototype void vlistDefVarCode(int vlistID, int varID, int code)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  code     Code number.
+
+ at Description
+The function @func{vlistDefVarCode} defines the code number of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarCode(int vlistID, int varID, int code)
+{
+  vlist_t *vlistptr;
+  int param, pnum, pcat, pdis;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  param = vlistptr->vars[varID].param;
+
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+  
+  vlistptr->vars[varID].param = cdiEncodeParam(code, pcat, pdis);
+}
+
+
+void vlistInqVar(int vlistID, int varID, int *gridID, int *zaxisID, int *tsteptype)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  *gridID    = vlistptr->vars[varID].gridID;
+  *zaxisID   = vlistptr->vars[varID].zaxisID;
+  *tsteptype = vlistptr->vars[varID].tsteptype;
+
+  return;
+}
+
+/*
+ at Function  vlistInqVarGrid
+ at Title     Get the Grid ID of a Variable
+
+ at Prototype int vlistInqVarGrid(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarGrid} returns the grid ID of a variable.
+
+ at Result
+ at func{vlistInqVarGrid} returns the grid ID of the variable.
+
+ at EndFunction
+*/
+int vlistInqVarGrid(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].gridID);
+}
+
+/*
+ at Function  vlistInqVarZaxis
+ at Title     Get the Zaxis ID of a Variable
+
+ at Prototype int vlistInqVarZaxis(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarZaxis} returns the zaxis ID of a variable.
+
+ at Result
+ at func{vlistInqVarZaxis} returns the zaxis ID of the variable.
+
+ at EndFunction
+*/
+int vlistInqVarZaxis(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].zaxisID);
+}
+
+/*
+ at Function  vlistInqVarParam
+ at Title     Get the parameter number of a Variable
+
+ at Prototype int vlistInqVarParam(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarParam} returns the parameter number of a variable.
+
+ at Result
+ at func{vlistInqVarParam} returns the parameter number of the variable.
+
+ at EndFunction
+*/
+int vlistInqVarParam(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+  int param;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  param = vlistptr->vars[varID].param;
+
+  return (param);
+}
+
+/*
+ at Function  vlistInqVarCode
+ at Title     Get the Code number of a Variable
+
+ at Prototype int vlistInqVarCode(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarCode} returns the code number of a variable.
+
+ at Result
+ at func{vlistInqVarCode} returns the code number of the variable.
+
+ at EndFunction
+*/
+int vlistInqVarCode(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+  int param, code;
+  int pdis, pcat, pnum;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  param = vlistptr->vars[varID].param;
+  cdiDecodeParam(param, &pnum, &pcat, &pdis);
+  code = pnum;
+
+  if ( code < 0 && vlistptr->vars[varID].tableID != -1 && vlistptr->vars[varID].name != NULL )
+    {
+      tableInqParCode(vlistptr->vars[varID].tableID, vlistptr->vars[varID].name, &code);
+    }
+
+  return (code);
+}
+
+
+const char *vlistInqVarNamePtr(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].name);
+}
+
+
+const char *vlistInqVarLongnamePtr(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].longname);
+}
+
+
+const char *vlistInqVarStdnamePtr(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].stdname);
+}
+
+
+const char *vlistInqVarUnitsPtr(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].units);
+}
+
+/*
+ at Function  vlistInqVarName
+ at Title     Get the name of a Variable
+
+ at Prototype void vlistInqVarName(int vlistID, int varID, char *name)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  name     Returned variable name. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{vlistInqVarName} returns the name of a variable.
+
+ at Result
+ at func{vlistInqVarName} returns the name of the variable to the parameter name if available,
+otherwise the result is an empty string.
+
+ at EndFunction
+*/
+void vlistInqVarName(int vlistID, int varID, char *name)
+{
+  int tableID;
+  int param;
+  int pdis, pcat, pnum;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( vlistptr->vars[varID].name == NULL )
+    {
+      param = vlistptr->vars[varID].param;
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+      if ( pdis == 255 )
+	{
+	  int code = pnum;
+	  tableID = vlistptr->vars[varID].tableID;
+	  if ( tableInqParName(tableID, code, name) != 0 )
+	    sprintf(name, "var%d", code);
+	}
+      else
+	{
+	  sprintf(name, "param%d.%d.%d", pnum, pcat, pdis);
+	}
+    }  
+  else
+    strcpy(name, vlistptr->vars[varID].name);
+
+  return;
+}
+
+/*
+ at Function  vlistInqVarLongname
+ at Title     Get the longname of a Variable
+
+ at Prototype void vlistInqVarLongname(int vlistID, int varID, char *longname)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  longname Long name of the variable. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{vlistInqVarLongname} returns the longname of a variable if available,
+otherwise the result is an empty string.
+
+ at Result
+ at func{vlistInqVaeLongname} returns the longname of the variable to the parameter longname.
+
+ at EndFunction
+*/
+void vlistInqVarLongname(int vlistID, int varID, char *longname)
+{
+  int tableID;
+  int param;
+  int pdis, pcat, pnum;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  longname[0] = '\0';
+
+  if ( vlistptr->vars[varID].longname == NULL )
+    {
+      param = vlistptr->vars[varID].param;
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+      if ( pdis == 255 )
+	{
+	  int code = pnum;
+	  tableID = vlistptr->vars[varID].tableID;
+	  if ( tableInqParLongname(tableID, code, longname) != 0 )
+	    longname[0] = '\0';
+	}
+    }  
+  else
+    strcpy(longname, vlistptr->vars[varID].longname);
+
+  return;
+}
+
+/*
+ at Function  vlistInqVarStdname
+ at Title     Get the standard name of a Variable
+
+ at Prototype void vlistInqVarStdname(int vlistID, int varID, char *stdname)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  stdname  Standard name of the variable. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{vlistInqVarStdname} returns the standard name of a variable if available,
+otherwise the result is an empty string.
+
+ at Result
+ at func{vlistInqVarName} returns the standard name of the variable to the parameter stdname.
+
+ at EndFunction
+*/
+void vlistInqVarStdname(int vlistID, int varID, char *stdname)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( vlistptr->vars[varID].stdname == NULL )
+    {
+      stdname[0] = '\0';
+    }  
+  else
+    strcpy(stdname, vlistptr->vars[varID].stdname);
+
+  return;
+}
+
+/*
+ at Function  vlistInqVarUnits
+ at Title     Get the units of a Variable
+
+ at Prototype void vlistInqVarUnits(int vlistID, int varID, char *units)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  units    Units of the variable. The caller must allocate space for the 
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{vlistInqVarUnits} returns the units of a variable if available,
+otherwise the result is an empty string.
+
+ at Result
+ at func{vlistInqVarUnits} returns the units of the variable to the parameter units.
+
+ at EndFunction
+*/
+void vlistInqVarUnits(int vlistID, int varID, char *units)
+{
+  int tableID;
+  int param;
+  int pdis, pcat, pnum;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  units[0] = '\0';
+
+  if ( vlistptr->vars[varID].units == NULL )
+    {
+      param = vlistptr->vars[varID].param;
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+      if ( pdis == 255 )
+	{
+	  int code = pnum;
+	  tableID = vlistptr->vars[varID].tableID;
+	  if ( tableInqParUnits(tableID, code, units) != 0 )
+	    units[0] = '\0';
+	}
+    }
+  else
+    strcpy(units, vlistptr->vars[varID].units);
+
+  return;
+}
+
+/* used in MPIOM ! */
+int vlistInqVarID(int vlistID, int code)
+{
+  int varID;
+  vlist_t *vlistptr;
+  int param, pdis, pcat, pnum;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  for ( varID = 0; varID < vlistptr->nvars; varID++ )
+    {
+      param = vlistptr->vars[varID].param;
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+      if ( pnum == code ) return (varID);
+    }
+
+  return (CDI_UNDEFID);
+}
+
+
+int vlistInqVarSize(int vlistID, int varID)
+{
+  int size;
+  int zaxisID, gridID;
+  int nlevs, gridsize;
+  int tsteptype;
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistInqVar(vlistID, varID, &gridID, &zaxisID, &tsteptype);
+
+  nlevs = zaxisInqSize(zaxisID);
+
+  gridsize = gridInqSize(gridID);
+
+  size = gridsize*nlevs;
+
+  return (size);
+}
+
+/*
+ at Function  vlistInqVarDatatype
+ at Title     Get the data type of a Variable
+
+ at Prototype int vlistInqVarDatatype(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarDatatype} returns the data type of a variable.
+
+ at Result
+ at func{vlistInqVarDatatype} returns an identifier to the data type of the variable.
+The valid CDI data types are @func{DATATYPE_PACK8}, @func{DATATYPE_PACK16}, @func{DATATYPE_PACK24},
+ at func{DATATYPE_FLT32}, @func{DATATYPE_FLT64}, @func{DATATYPE_INT8}, @func{DATATYPE_INT16} and 
+ at func{DATATYPE_INT32}.
+
+ at EndFunction
+*/
+int vlistInqVarDatatype(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].datatype);
+}
+
+
+int vlistInqVarNumber(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+  int number = CDI_REAL;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( vlistptr->vars[varID].datatype == DATATYPE_CPX32 ||
+       vlistptr->vars[varID].datatype == DATATYPE_CPX64 )
+    number = CDI_COMP;
+
+  return (number);
+}
+
+/*
+ at Function  vlistDefVarDatatype
+ at Title     Define the data type of a Variable
+
+ at Prototype void vlistDefVarDatatype(int vlistID, int varID, int datatype)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  datatype The data type identifier.
+                    The valid CDI data types are @func{DATATYPE_PACK8}, @func{DATATYPE_PACK16},
+                    @func{DATATYPE_PACK24}, @func{DATATYPE_FLT32}, @func{DATATYPE_FLT64},
+                    @func{DATATYPE_INT8}, @func{DATATYPE_INT16} and @func{DATATYPE_INT32}.
+
+ at Description
+The function @func{vlistDefVarDatatype} defines the data type of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarDatatype(int vlistID, int varID, int datatype)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->vars[varID].datatype = datatype;
+  
+  if ( vlistptr->vars[varID].missvalused == FALSE )
+    switch (datatype)
+      {
+      case DATATYPE_INT8:   vlistptr->vars[varID].missval = SCHAR_MIN; break;
+      case DATATYPE_UINT8:  vlistptr->vars[varID].missval = UCHAR_MAX; break;
+      case DATATYPE_INT16:  vlistptr->vars[varID].missval = SHRT_MIN;  break;
+      case DATATYPE_UINT16: vlistptr->vars[varID].missval = USHRT_MAX; break;
+      case DATATYPE_INT32:  vlistptr->vars[varID].missval = INT_MIN;   break;
+      case DATATYPE_UINT32: vlistptr->vars[varID].missval = UINT_MAX;  break;
+      }
+}
+
+
+void vlistDefVarInstitut(int vlistID, int varID, int instID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr->vars[varID].instID = instID;
+}
+
+
+int vlistInqVarInstitut(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].instID);
+}
+
+
+void vlistDefVarModel(int vlistID, int varID, int modelID)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].modelID = modelID;
+}
+
+
+int vlistInqVarModel(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].modelID);
+}
+
+
+void vlistDefVarTable(int vlistID, int varID, int tableID)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].tableID = tableID;
+
+  {
+    int param, pnum, pcat, pdis;
+    int tablenum;
+    tablenum = tableInqNum(tableID);
+
+    param = vlistptr->vars[varID].param;
+
+    cdiDecodeParam(param, &pnum, &pcat, &pdis);
+  
+    vlistptr->vars[varID].param = cdiEncodeParam(pnum, tablenum, pdis);
+  }
+}
+
+
+int vlistInqVarTable(int vlistID, int varID)
+{
+  int tableID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  tableID = vlistptr->vars[varID].tableID;
+
+  return (tableID);
+}
+
+/*
+ at Function  vlistDefVarName
+ at Title     Define the name of a Variable
+
+ at Prototype void vlistDefVarName(int vlistID, int varID, const char *name)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  name     Name of the variable.
+
+ at Description
+The function @func{vlistDefVarName} defines the name of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarName(int vlistID, int varID, const char *name)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( name )
+    {
+      if ( vlistptr->vars[varID].name )
+	{
+	  free(vlistptr->vars[varID].name);
+	  vlistptr->vars[varID].name = NULL;
+	}
+
+      vlistptr->vars[varID].name = strdupx(name);
+    }
+}
+
+/*
+ at Function  vlistDefVarLongname
+ at Title     Define the long name of a Variable
+
+ at Prototype void vlistDefVarLongname(int vlistID, int varID, const char *longname)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  longname Long name of the variable.
+
+ at Description
+The function @func{vlistDefVarLongname} defines the long name of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarLongname(int vlistID, int varID, const char *longname)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( longname )
+    {
+      if ( vlistptr->vars[varID].longname )
+	{
+	  free(vlistptr->vars[varID].longname);
+	  vlistptr->vars[varID].longname = 0;
+	}
+
+      vlistptr->vars[varID].longname = strdupx(longname);
+    }
+}
+
+/*
+ at Function  vlistDefVarStdname
+ at Title     Define the standard name of a Variable
+
+ at Prototype void vlistDefVarStdname(int vlistID, int varID, const char *stdname)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  stdname  Standard name of the variable.
+
+ at Description
+The function @func{vlistDefVarStdname} defines the standard name of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarStdname(int vlistID, int varID, const char *stdname)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( stdname )
+    {
+      if ( vlistptr->vars[varID].stdname )
+	{
+	  free(vlistptr->vars[varID].stdname);
+	  vlistptr->vars[varID].stdname = 0;
+	}
+
+      vlistptr->vars[varID].stdname = strdupx(stdname);
+    }
+}
+
+/*
+ at Function  vlistDefVarUnits
+ at Title     Define the units of a Variable
+
+ at Prototype void vlistDefVarUnits(int vlistID, int varID, const char *units)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  units    Units of the variable.
+
+ at Description
+The function @func{vlistDefVarUnits} defines the units of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarUnits(int vlistID, int varID, const char *units)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( units )
+    {
+      if ( vlistptr->vars[varID].units )
+	{
+	  free(vlistptr->vars[varID].units);
+	  vlistptr->vars[varID].units = 0;
+	}
+
+      vlistptr->vars[varID].units = strdupx(units);
+    }
+}
+
+/*
+ at Function  vlistInqVarMissval
+ at Title     Get the missing value of a Variable
+
+ at Prototype double vlistInqVarMissval(int vlistID, int varID)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+
+ at Description
+The function @func{vlistInqVarMissval} returns the missing value of a variable.
+
+ at Result
+ at func{vlistInqVarMissval} returns the missing value of the variable.
+
+ at EndFunction
+*/
+double vlistInqVarMissval(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].missval);
+}
+
+/*
+ at Function  vlistDefVarMissval
+ at Title     Define the missing value of a Variable
+
+ at Prototype void vlistDefVarMissval(int vlistID, int varID, double missval)
+ at Parameter
+    @Item  vlistID  Variable list ID, from a previous call to @fref{vlistCreate}.
+    @Item  varID    Variable identifier.
+    @Item  missval  Missing value.
+
+ at Description
+The function @func{vlistDefVarMissval} defines the missing value of a variable.
+
+ at EndFunction
+*/
+void vlistDefVarMissval(int vlistID, int varID, double missval)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].missval = missval;
+  vlistptr->vars[varID].missvalused = TRUE;
+}
+
+
+int vlistInqVarValidrange(int vlistID, int varID, double *validrange)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( validrange != NULL && vlistptr->vars[varID].lvalidrange )
+    {
+      validrange[0] = vlistptr->vars[varID].validrange[0];
+      validrange[1] = vlistptr->vars[varID].validrange[1];
+    }
+
+  return (vlistptr->vars[varID].lvalidrange);
+}
+
+
+void vlistDefVarValidrange(int vlistID, int varID, const double *validrange)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].validrange[0] = validrange[0];
+  vlistptr->vars[varID].validrange[1] = validrange[1];
+  vlistptr->vars[varID].lvalidrange = TRUE;
+}
+
+
+double vlistInqVarScalefactor(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return 1.0;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].scalefactor);
+}
+
+
+double vlistInqVarAddoffset(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].addoffset);
+}
+
+void vlistDefVarScalefactor(int vlistID, int varID, double scalefactor)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed." );
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].scalefactor = scalefactor;
+}
+
+
+void vlistDefVarAddoffset(int vlistID, int varID, double addoffset)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].addoffset = addoffset;
+}
+
+
+void vlistDefVarTsteptype(int vlistID, int varID, int tsteptype)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].tsteptype = tsteptype;
+}
+
+
+int vlistInqVarTsteptype(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].tsteptype);
+}
+
+
+void vlistDefVarTimave(int vlistID, int varID, int timave)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].timave = timave;
+}
+
+
+int vlistInqVarTimave(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].timave);
+}
+
+
+void vlistDefVarTimaccu(int vlistID, int varID, int timaccu)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].timaccu = timaccu;
+}
+
+
+int vlistInqVarTimaccu(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].timaccu);
+}
+
+
+void vlistDestroyVarName(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( vlistptr->vars[varID].name )
+    {
+      free(vlistptr->vars[varID].name);
+      vlistptr->vars[varID].name = NULL;
+    }
+}
+
+
+void vlistDestroyVarLongname(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( vlistptr->vars[varID].longname )
+    {
+      free(vlistptr->vars[varID].longname);
+      vlistptr->vars[varID].longname = NULL;
+    }
+}
+
+
+void vlistDestroyVarStdname(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( vlistptr->vars[varID].stdname )
+    {
+      free(vlistptr->vars[varID].stdname);
+      vlistptr->vars[varID].stdname = NULL;
+    }
+}
+
+
+void vlistDestroyVarUnits(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  if ( vlistptr->vars[varID].units )
+    {
+      free(vlistptr->vars[varID].units);
+      vlistptr->vars[varID].units = NULL;
+    }
+}
+
+
+int vlistInqVarMissvalUsed(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].missvalused);
+}
+
+
+void vlistDefFlag(int vlistID, int varID, int levID, int flag)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].flag = flag;
+  vlistptr->vars[varID].levinfo[levID].flag = flag;
+}
+
+
+int vlistInqFlag(int vlistID, int varID, int levID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].levinfo[levID].flag);
+}
+
+
+int vlistFindVar(int vlistID, int fvarID)
+{
+  int varID;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  for ( varID = 0; varID < vlistptr->nvars; varID++ )
+    {
+      if ( vlistptr->vars[varID].fvarID == fvarID ) break;
+    }
+
+  if ( varID == vlistptr->nvars )
+    {
+      varID = -1;
+      Message("varID not found for fvarID %d in vlistID %d!", fvarID, vlistID);
+    }
+
+  return (varID);  
+}
+
+
+int vlistFindLevel(int vlistID, int fvarID, int flevelID)
+{
+  int varID;
+  int levelID = -1;
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  varID = vlistFindVar(vlistID, fvarID);
+
+  if ( varID != -1 )
+    {
+      for ( levelID = 0; levelID < vlistptr->vars[varID].nlevs; levelID++ )
+	{
+	  if ( vlistptr->vars[varID].levinfo[levelID].flevelID == flevelID ) break;
+	}
+
+      if ( levelID == vlistptr->vars[varID].nlevs )
+	{
+	  levelID = -1;
+	  Message("levelID not found for fvarID %d and levelID %d in vlistID %d!",
+		  fvarID, flevelID, vlistID);
+	}
+    }
+
+  return (levelID);  
+}
+
+
+int vlistMergedVar(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].mvarID);  
+}
+
+
+int vlistMergedLevel(int vlistID, int varID, int levelID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].levinfo[levelID].mlevelID);  
+}
+
+
+void vlistDefIndex(int vlistID, int varID, int levelID, int index)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistptr->vars[varID].levinfo[levelID].index = index;  
+}
+
+
+int vlistInqIndex(int vlistID, int varID, int levelID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  return (vlistptr->vars[varID].levinfo[levelID].index);  
+}
+
+
+void vlistChangeVarZaxis(int vlistID, int varID, int zaxisID)
+{
+  int nlevs1, nlevs2;
+  int nvars, index;
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  nlevs1 = zaxisInqSize(vlistptr->vars[varID].zaxisID);
+  nlevs2 = zaxisInqSize(zaxisID);
+
+  if ( nlevs1 != nlevs2 ) Error("Number of levels must not change!");
+
+  nvars = vlistptr->nvars;
+  for ( index = 0; index < nvars; index++ )
+    if ( index != varID )
+      if ( vlistptr->vars[index].zaxisID == vlistptr->vars[varID].zaxisID ) break;
+
+  if ( index == nvars )
+    {
+      for ( index = 0; index < vlistptr->nzaxis; index++ )
+	if ( vlistptr->zaxisIDs[index] == vlistptr->vars[varID].zaxisID )
+	  vlistptr->zaxisIDs[index] = zaxisID;
+    }
+  else
+    {
+      for ( index = 0; index < vlistptr->nzaxis; index++ )
+	if ( vlistptr->zaxisIDs[index] == zaxisID ) break;
+
+      if ( index == vlistptr->nzaxis )
+	{
+	  if ( vlistptr->nzaxis + 1 >= MAX_ZAXES_PS )
+	    Error("Maximum of %d zaxis reached", MAX_ZAXES_PS);
+
+	  vlistptr->zaxisIDs[vlistptr->nzaxis] = zaxisID;
+	  vlistptr->nzaxis++;
+	}
+    }
+  
+  vlistptr->vars[varID].zaxisID = zaxisID;
+}
+
+
+void vlistChangeVarGrid(int vlistID, int varID, int gridID)
+{
+  int nvars, index;
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  nvars = vlistptr->nvars;
+  for ( index = 0; index < nvars; index++ )
+    if ( index != varID )
+      if ( vlistptr->vars[index].gridID == vlistptr->vars[varID].gridID ) break;
+
+  if ( index == nvars )
+    {
+      for ( index = 0; index < vlistptr->ngrids; index++ )
+	if ( vlistptr->gridIDs[index] == vlistptr->vars[varID].gridID )
+	  vlistptr->gridIDs[index] = gridID;
+    }
+  else
+    {
+      for ( index = 0; index < vlistptr->ngrids; index++ )
+	if ( vlistptr->gridIDs[index] == gridID ) break;
+
+      if ( index == vlistptr->ngrids )
+	{
+	  if ( vlistptr->ngrids + 1 >= MAX_GRIDS_PS )
+	    Error("Maximum of %d grids reached", MAX_GRIDS_PS);
+
+	  vlistptr->gridIDs[vlistptr->ngrids] = gridID;
+	  vlistptr->ngrids++;
+	}
+    }
+  
+  vlistptr->vars[varID].gridID = gridID;
+}
+
+
+void vlistDefVarCompType(int vlistID, int varID, int comptype)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr->vars[varID].comptype = comptype;
+}
+
+
+int vlistInqVarCompType(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].comptype);
+}
+
+
+void vlistDefVarCompLevel(int vlistID, int varID, int complevel)
+{
+  vlist_t *vlistptr;
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].complevel = complevel;
+}
+
+
+int vlistInqVarCompLevel(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].complevel);
+}
+
+
+void  vlistDefVarChunkType(int vlistID, int varID, int chunktype)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  vlistptr->vars[varID].chunktype = chunktype;
+}
+
+
+int vlistInqVarChunkType(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].chunktype);
+}
+
+
+void  vlistDefVarXYZ(int vlistID, int varID, int xyz)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  /* check xyz dimension order */
+  {
+    int dimorder[3];
+    int dimx = 0, dimy = 0, dimz = 0;
+    dimorder[0] = xyz/100;
+    dimorder[1] = (xyz-dimorder[0]*100)/10;
+    dimorder[2] = (xyz-dimorder[0]*100-dimorder[1]*10);
+    for ( int id = 0; id < 3; ++id )
+      {
+        if      ( dimorder[id] == 3 ) { dimz++; }
+        else if ( dimorder[id] == 2 ) { dimy++; }
+        else if ( dimorder[id] == 1 ) { dimx++; }
+      }
+    if ( dimz > 1 || dimy > 1 || dimx > 1 ) xyz = 321; // ZYX
+    else
+      {
+        int lchanged = 0;
+        if ( dimz == 0 ) for ( int id = 0; id < 3; ++id ) if ( dimorder[id] == 0 ) {dimorder[id] = 3; lchanged++; break;}
+        if ( dimy == 0 ) for ( int id = 0; id < 3; ++id ) if ( dimorder[id] == 0 ) {dimorder[id] = 2; lchanged++; break;}
+        if ( dimx == 0 ) for ( int id = 0; id < 3; ++id ) if ( dimorder[id] == 0 ) {dimorder[id] = 1; lchanged++; break;}
+        if ( lchanged ) xyz = dimorder[0]*100 + dimorder[1]*10 + dimorder[2];
+      }
+  }
+
+  vlistptr->vars[varID].xyz = xyz;
+}
+
+
+int vlistInqVarXYZ(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return (vlistptr->vars[varID].xyz);
+}
+
+
+/* Ensemble Info Routines */
+void vlistDefVarEnsemble(int vlistID, int varID, int ensID, int ensCount, int forecast_type )
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( vlistptr->vars[varID].ensdata == NULL )
+    vlistptr->vars[varID].ensdata = (ensinfo_t *) malloc( sizeof( ensinfo_t ) );
+
+  vlistptr->vars[varID].ensdata->ens_index          = ensID;
+  vlistptr->vars[varID].ensdata->ens_count          = ensCount;
+  vlistptr->vars[varID].ensdata->forecast_init_type = forecast_type;
+}
+
+
+int vlistInqVarEnsemble( int vlistID, int varID, int *ensID, int *ensCount, int *forecast_type )
+{
+  vlist_t *vlistptr;
+  int status = 0;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  if ( vlistptr->vars[varID].ensdata )
+    {
+      *ensID = vlistptr->vars[varID].ensdata->ens_index;
+      *ensCount = vlistptr->vars[varID].ensdata->ens_count;
+      *forecast_type = vlistptr->vars[varID].ensdata->forecast_init_type;
+
+      status = 1;
+    }
+
+  return (status);
+}
+
+
+void vlistDefVarDeco ( int vlistID, int varID, int decoSize, deco_t * deco )
+{
+  vlist_t * vlistptr;
+  int i;
+
+  vlistptr = vlist_to_pointer(vlistID );
+
+  vlistCheckVarID ( __func__, vlistID, varID );
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  xassert ( decoSize && deco );
+ 
+  vlistptr->vars[varID].deco = xmalloc ( decoSize * sizeof ( deco_t )); 
+
+  for ( i = 0; i < decoSize; i++ )
+    {
+      vlistptr->vars[varID].deco[i].rank   = deco[i].rank;
+      vlistptr->vars[varID].deco[i].offset = deco[i].offset;
+      vlistptr->vars[varID].deco[i].chunk  = deco[i].chunk;
+    }
+
+  vlistptr->vars[varID].decoSize = decoSize;
+}
+
+
+int vlistInqVarDecoChunk ( int vlistID, int varID, int rankModel  )
+{
+  vlist_t *vlistptr;
+  int iret = CDI_UNDEFID;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+#ifdef USE_MPI
+  {
+    deco_t * deco;
+    int i, decoSize = 0;
+    xassert ( vlistptr->vars[varID].deco != NULL &&
+             vlistptr->vars[varID].decoSize != CDI_UNDEFID ); 
+    
+    deco  = vlistptr->vars[varID].deco;
+    decoSize = vlistptr->vars[varID].decoSize;
+    if ( decoSize && deco )
+      for ( i = 0; i < decoSize; i++ )
+        if ( deco[i].rank == rankModel ) 
+          {
+            iret = deco[i].chunk;
+            break;
+          }
+  }
+#else
+  iret = vlistInqVarSize ( vlistID, varID );
+#endif
+
+  xassert ( iret != CDI_UNDEFID );
+  return iret;
+}
+
+
+int vlistInqVarDecoOff ( int vlistID, int varID, int rankModel  )
+{
+  vlist_t *vlistptr;
+  int iret = CDI_UNDEFID;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+#ifdef USE_MPI
+  {
+    deco_t * deco;
+    int i, decoSize = 0;
+    
+    xassert ( vlistptr->vars[varID].deco != NULL &&
+             vlistptr->vars[varID].decoSize != CDI_UNDEFID );
+    
+    deco  = vlistptr->vars[varID].deco;
+    decoSize = vlistptr->vars[varID].decoSize;
+    if ( decoSize && deco )
+      for ( i = 0; i < decoSize; i++ )
+        if ( deco[i].rank == rankModel ) 
+          {
+            iret = deco[i].offset;
+            break;
+          }
+  }
+#else
+  iret = 0;
+#endif
+
+  xassert (  iret != CDI_UNDEFID );  
+  return iret;
+}
+
+
+void     vlistDefVarIOrank   ( int vlistID, int varID, int iorank )
+{
+  vlist_t * vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID );
+
+  vlistCheckVarID ( __func__, vlistID, varID );
+
+  if ( reshGetStatus ( vlistID, &vlist_ops ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  vlistptr->vars[varID].iorank = iorank;
+}
+
+
+int vlistInqVarIOrank(int vlistID, int varID)
+{
+  vlist_t *vlistptr;
+
+  vlistptr = vlist_to_pointer(vlistID);
+
+  vlistCheckVarID(__func__, vlistID, varID);
+
+  return vlistptr->vars[varID].iorank;
+}
+
+
+#ifdef USE_MPI
+
+enum {
+  vlistvar_nints = 21,
+  vlistvar_ndbls = 3,
+};
+
+int vlistVarGetSize(vlist_t *p, int varID, MPI_Comm comm)
+{
+  var_t *var = p->vars + varID;
+  int varsize, txinc;
+
+  xmpi(MPI_Pack_size(vlistvar_nints, MPI_INT, comm, &varsize));
+  xmpi(MPI_Pack_size(vlistvar_ndbls, MPI_DOUBLE, comm, &txinc));
+  varsize += txinc;
+  if (var->name)
+  {
+    xmpi(MPI_Pack_size(strlen(var->name), MPI_CHAR, comm, &txinc));
+    varsize += txinc;
+  }
+  if (var->longname)
+  {
+    xmpi(MPI_Pack_size(strlen(var->longname), MPI_CHAR, comm, &txinc));
+    varsize += txinc;
+  }
+  if (var->stdname)
+  {
+    xmpi(MPI_Pack_size(strlen(var->stdname), MPI_CHAR, comm, &txinc));
+    varsize += txinc;
+  }
+  if (var->units)
+  {
+    xmpi(MPI_Pack_size(strlen(var->units), MPI_CHAR, comm, &txinc));
+    varsize += txinc;
+  }
+  xmpi(MPI_Pack_size(4 * var->nlevs, MPI_INT, comm, &txinc));
+  varsize += txinc;
+  if ( var->deco != NULL )
+    {
+      xmpi(MPI_Pack_size(3 * var->decoSize, MPI_INT, comm, &txinc));
+      varsize += txinc;
+    }
+  varsize += vlistAttsGetSize(p, varID, comm);
+  return varsize;
+}
+
+void vlistVarPack(vlist_t *p, int varID, char * buf, int size, int *position,
+                  MPI_Comm comm)
+{
+  double dtempbuf[vlistvar_ndbls];
+  var_t *var = p->vars + varID;
+  int tempbuf[vlistvar_nints], namesz, longnamesz, stdnamesz, unitssz, i;
+
+  tempbuf[0] = var->flag;
+  tempbuf[1] = var->gridID;
+  tempbuf[2] = var->zaxisID;
+  tempbuf[3] = var->tsteptype;
+  tempbuf[4] = namesz = var->name?strlen(var->name):0;
+  tempbuf[5] = longnamesz = var->longname?strlen(var->longname):0;
+  tempbuf[6] = stdnamesz = var->stdname?strlen(var->stdname):0;
+  tempbuf[7] = unitssz = var->units?strlen(var->units):0;
+  tempbuf[8] = var->datatype;
+  tempbuf[9] = var->param;
+  tempbuf[10] = var->instID;
+  tempbuf[11] = var->modelID;
+  tempbuf[12] = var->tableID;
+  tempbuf[13] = var->timave;
+  tempbuf[14] = var->timaccu;
+  tempbuf[15] = var->missvalused;
+  tempbuf[16] = var->comptype;
+  tempbuf[17] = var->complevel;
+  tempbuf[18] = var->nlevs;
+  tempbuf[19] = var->iorank;
+  tempbuf[20] = var->decoSize;
+  dtempbuf[0] = var->missval;
+  dtempbuf[1] = var->scalefactor;
+  dtempbuf[2] = var->addoffset;
+  xmpi(MPI_Pack(tempbuf, vlistvar_nints, MPI_INT,
+                buf, size, position, comm));
+  xmpi(MPI_Pack(dtempbuf, vlistvar_ndbls, MPI_DOUBLE,
+                buf, size, position, comm));
+  if (namesz)
+    xmpi(MPI_Pack(var->name, namesz, MPI_CHAR, buf, size, position, comm));
+  if (longnamesz)
+    xmpi(MPI_Pack(var->longname, longnamesz, MPI_CHAR,
+                  buf, size, position, comm));
+  if (stdnamesz)
+    xmpi(MPI_Pack(var->stdname, stdnamesz, MPI_CHAR,
+                  buf, size, position, comm));
+  if (unitssz)
+    xmpi(MPI_Pack(var->units, unitssz, MPI_CHAR,
+                  buf, size, position, comm));
+  {
+    int levbuf[var->nlevs][4];
+    for (i = 0; i < var->nlevs; ++i)
+    {
+      levbuf[i][0] = var->levinfo[i].flag;
+      levbuf[i][1] = var->levinfo[i].index;
+      levbuf[i][2] = var->levinfo[i].mlevelID;
+      levbuf[i][3] = var->levinfo[i].flevelID;
+    }
+    xmpi(MPI_Pack(levbuf, var->nlevs * 4, MPI_INT,
+                  buf, size, position, comm));
+  }
+  if ( var->deco != NULL )
+    {
+      int deco[var->decoSize][3];
+      for (i = 0; i < var->decoSize; ++i)
+        {
+          deco[i][0] = var->deco[i].rank;
+          deco[i][1] = var->deco[i].offset;
+          deco[i][2] = var->deco[i].chunk;
+        }
+      xmpi(MPI_Pack(deco, var->decoSize * 3, MPI_INT,
+                    buf, size, position, comm));
+    }
+  vlistAttsPack(p, varID, buf, size, position, comm);
+}
+
+static inline int
+imax(int a, int b)
+{
+  return a>=b?a:b;
+}
+
+
+void vlistVarUnpack(int vlistID, char * buf, int size, int *position,
+		    int nspTarget, MPI_Comm comm)
+{
+  double dtempbuf[vlistvar_ndbls];
+  int tempbuf[vlistvar_nints];
+  int newvar;
+  char *varname = NULL;
+  xmpi(MPI_Unpack(buf, size, position,
+                  tempbuf, vlistvar_nints, MPI_INT, comm));
+  xmpi(MPI_Unpack(buf, size, position,
+                  dtempbuf, vlistvar_ndbls, MPI_DOUBLE, comm));
+
+  newvar = vlistDefVar ( vlistID,
+			 namespaceAdaptKey ( tempbuf[1], nspTarget ),
+			 namespaceAdaptKey ( tempbuf[2], nspTarget ),
+			 tempbuf[3]);
+  if (tempbuf[4] || tempbuf[5] || tempbuf[6] || tempbuf[7])
+    varname = xmalloc(imax(imax(imax(tempbuf[4],tempbuf[5]),tempbuf[6]),
+                           tempbuf[7])+ 1);
+  if (tempbuf[4])
+  {
+    xmpi(MPI_Unpack(buf, size, position,
+                    varname, tempbuf[4], MPI_CHAR, comm));
+    varname[tempbuf[4]] = '\0';
+    vlistDefVarName(vlistID, newvar, varname);
+  }
+  if (tempbuf[5])
+  {
+    xmpi(MPI_Unpack(buf, size, position,
+                    varname, tempbuf[5], MPI_CHAR, comm));
+    varname[tempbuf[5]] = '\0';
+    vlistDefVarLongname(vlistID, newvar, varname);
+  }
+  if (tempbuf[6])
+  {
+    xmpi(MPI_Unpack(buf, size, position,
+                    varname, tempbuf[6], MPI_CHAR, comm));
+    varname[tempbuf[6]] = '\0';
+    vlistDefVarStdname(vlistID, newvar, varname);
+  }
+  if (tempbuf[7])
+  {
+    xmpi(MPI_Unpack(buf, size, position,
+                    varname, tempbuf[7], MPI_CHAR, comm));
+    varname[tempbuf[7]] = '\0';
+    vlistDefVarUnits(vlistID, newvar, varname);
+  }
+  if ( varname ) free ( varname );
+  vlistDefVarDatatype(vlistID, newvar, tempbuf[8]);
+  vlistDefVarInstitut ( vlistID, newvar,
+			namespaceAdaptKey ( tempbuf[10], nspTarget ));
+  vlistDefVarModel ( vlistID, newvar,
+		     namespaceAdaptKey ( tempbuf[11], nspTarget ));
+  vlistDefVarTable(vlistID, newvar, tempbuf[12]);
+  /* FIXME: changing the table might change the param code */
+  vlistDefVarParam(vlistID, newvar, tempbuf[9]);
+  vlistDefVarTimave(vlistID, newvar, tempbuf[13]);
+  vlistDefVarTimaccu(vlistID, newvar, tempbuf[14]);
+  if (tempbuf[15])
+    vlistDefVarMissval(vlistID, newvar, dtempbuf[0]);
+  vlistDefVarScalefactor(vlistID, newvar, dtempbuf[1]);
+  vlistDefVarAddoffset(vlistID, newvar, dtempbuf[2]);
+  vlistDefVarCompType(vlistID, newvar, tempbuf[16]);
+  vlistDefVarCompLevel(vlistID, newvar, tempbuf[17]);
+  {
+    int levbuf[tempbuf[18]][4];
+    var_t *var = vlist_to_pointer(vlistID)->vars + newvar;
+    int nlevs=tempbuf[18], i, flagSetLev = 0;
+    xassert(nlevs == var->nlevs);
+    xmpi(MPI_Unpack(buf, size, position,
+                    levbuf, nlevs * 4, MPI_INT, comm));
+    for (i = 0; i < nlevs; ++i)
+    {
+      vlistDefFlag(vlistID, newvar, i, levbuf[i][0]);
+      vlistDefIndex(vlistID, newvar, i, levbuf[i][1]);
+      // FIXME: these lack an accessor function
+      var->levinfo[i].mlevelID = levbuf[i][2];
+      var->levinfo[i].flevelID = levbuf[i][3];
+      if (levbuf[i][0] == tempbuf[0])
+        flagSetLev = i;
+    }
+    vlistDefFlag(vlistID, newvar, flagSetLev, levbuf[flagSetLev][0]);
+  }
+  if ( tempbuf[20] != 0 )
+    {
+      int decoSize = tempbuf[20], i;
+      deco_t deco[decoSize];
+      int decobuf[decoSize][3];
+
+      xmpi ( MPI_Unpack(buf, size, position,
+                        decobuf, decoSize * 3, MPI_INT, comm ));
+      for (i = 0; i < decoSize; ++i)
+        {
+          deco[i].rank   = decobuf[i][0];
+          deco[i].offset = decobuf[i][1];
+          deco[i].chunk  = decobuf[i][2];
+        }
+      vlistDefVarDeco(vlistID, newvar, decoSize, &deco[0]);
+    }
+  vlistDefVarIOrank(vlistID, newvar, tempbuf[19]);
+  vlistAttsUnpack(vlistID, newvar, buf, size, position, comm);
+}
+
+
+#endif
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/vlist_var.h b/libcdi/src/vlist_var.h
new file mode 100644
index 0000000..c152e0d
--- /dev/null
+++ b/libcdi/src/vlist_var.h
@@ -0,0 +1,38 @@
+#ifndef VLIST_VAR_H
+#define VLIST_VAR_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#ifdef USE_MPI
+#include <mpi.h>
+#endif
+
+#ifndef _VLIST_H
+#include "vlist.h"
+#endif
+
+int  vlistInqVarDecoChunk ( int, int, int );
+int  vlistInqVarDecoOff   ( int, int, int );
+
+#ifdef USE_MPI
+int  vlistVarGetSize(vlist_t *p, int varID, MPI_Comm comm);
+void vlistVarPack(vlist_t *p, int varID,
+                  char * buffer, int bufferSize, int * pos, MPI_Comm comm);
+void vlistVarUnpack(int vlistID,
+                    char * buf, int size, int *position, int, MPI_Comm comm);
+void vlistDefVarIOrank    ( int, int, int );
+int  vlistInqVarIOrank    ( int, int );
+#endif
+
+#endif
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/src/zaxis.c b/libcdi/src/zaxis.c
new file mode 100644
index 0000000..276e500
--- /dev/null
+++ b/libcdi/src/zaxis.c
@@ -0,0 +1,1866 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <string.h>
+#include <math.h>
+#include <float.h>
+
+#include "dmemory.h"
+
+#include "cdi.h"
+#include "stream_int.h"
+#include "pio_util.h"
+#include "resource_handle.h"
+#include "pio_rpc.h"
+#include "varscan.h"
+#include "namespace.h"
+
+#define  LevelUp    1
+#define  LevelDown  2
+
+
+static struct {
+  unsigned char positive;
+  char *name;
+  char *longname;
+  char *stdname;
+  char *units;    // 1: up;  2: down
+}
+ZaxistypeEntry[] = {
+  { /*  0 */ 0, "sfc",        "surface",           "",               ""},
+  { /*  1 */ 0, "lev",        "generic",           "",               "level"},
+  { /*  2 */ 2, "lev",        "hybrid",            "",               "level"},
+  { /*  3 */ 2, "lev",        "hybrid_half",       "",               "level"},
+  { /*  4 */ 2, "lev",        "pressure",          "air_pressure",   "Pa"},
+  { /*  5 */ 1, "height",     "height",            "height",         "m"},
+  { /*  6 */ 2, "depth",      "depth_below_sea",   "depth",          "m"},
+  { /*  7 */ 2, "depth",      "depth_below_land",  "",               "cm"},
+  { /*  8 */ 0, "lev",        "isentropic",        "",               "K"},
+  { /*  9 */ 0, "lev",        "trajectory",        "",               ""},
+  { /* 10 */ 1, "alt",        "altitude",          "",               "m"},
+  { /* 11 */ 0, "lev",        "sigma",             "",               "level"},
+  { /* 12 */ 0, "lev",        "meansea",           "",               "level"},
+  { /* 13 */ 0, "toa",        "top_of_atmosphere", "",               ""},
+  { /* 14 */ 0, "seabottom",  "sea_bottom",        "",               ""},
+  { /* 15 */ 0, "atmosphere", "atmosphere",        "",               ""},
+  { /* 16 */ 0, "height",     "generalized height","height",         "m"},
+};
+
+static int CDI_MaxZaxistype = sizeof(ZaxistypeEntry) / sizeof(ZaxistypeEntry[0]);
+
+
+typedef struct {
+  unsigned char positive;
+  char     name[CDI_MAX_NAME];
+  char     longname[CDI_MAX_NAME];
+  char     stdname[CDI_MAX_NAME];
+  char     units[CDI_MAX_NAME];
+  double  *vals;
+  double  *lbounds;
+  double  *ubounds;
+  double  *weights;
+  int      self;
+  int      prec;
+  int      type;
+  int      ltype;    /* GRIB level type */
+  int      size;
+  int      direction;
+  int      vctsize;
+  double  *vct;
+  int      reference;
+  char     uuid[17];
+}
+zaxis_t;
+
+static int    zaxisCompareP    ( void * zaxisptr1, void * zaxisptr2 );
+static void   zaxisDestroyP    ( void * zaxisptr );
+static void   zaxisPrintP      ( void * zaxisptr, FILE * fp );
+#ifdef USE_MPI
+static int    zaxisGetPackSize ( void * zaxisptr, MPI_Comm comm );
+static void   zaxisPack        ( void * zaxisptr, void * buffer, int size,
+                                 int *pos, MPI_Comm comm);
+static int    zaxisTxCode      ( void );
+#endif
+
+resOps zaxisOps = { zaxisCompareP, zaxisDestroyP, zaxisPrintP
+#ifdef USE_MPI
+                    , zaxisGetPackSize, zaxisPack, zaxisTxCode
+#endif
+};
+
+static int  ZAXIS_Debug = 0;   /* If set to 1, debugging */
+
+static
+void zaxisDefaultValue ( zaxis_t *zaxisptr )
+{
+  zaxisptr->self        = CDI_UNDEFID;
+  zaxisptr->name[0]     = 0;
+  zaxisptr->longname[0] = 0;
+  zaxisptr->stdname[0]  = 0;
+  zaxisptr->units[0]    = 0;
+  zaxisptr->vals        = NULL;
+  zaxisptr->ubounds     = NULL;
+  zaxisptr->lbounds     = NULL;
+  zaxisptr->weights     = NULL;
+  zaxisptr->type        = CDI_UNDEFID;
+  zaxisptr->ltype       = 0;
+  zaxisptr->positive    = 0;
+  zaxisptr->direction   = 0;
+  zaxisptr->prec        = 0;
+  zaxisptr->size        = 0;
+  zaxisptr->vctsize     = 0;
+  zaxisptr->vct         = NULL;
+  zaxisptr->reference   = CDI_UNDEFID;
+  zaxisptr->uuid[0]     = 0;
+}
+
+
+static
+zaxis_t *zaxisNewEntry(void)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = (zaxis_t *) xmalloc(sizeof(zaxis_t));
+
+  zaxisDefaultValue ( zaxisptr );
+
+  zaxisptr->self = reshPut (( void * ) zaxisptr, &zaxisOps );
+
+  return (zaxisptr);
+}
+
+static
+void zaxisInit(void)
+{
+  static int zaxisInitialized = 0;
+  char *env;
+
+  if ( zaxisInitialized ) return;
+
+  zaxisInitialized = 1;
+
+  env = getenv("ZAXIS_DEBUG");
+  if ( env ) ZAXIS_Debug = atoi(env);
+}
+
+static
+void zaxis_copy(zaxis_t *zaxisptr2, zaxis_t *zaxisptr1)
+{
+  int zaxisID2;
+
+  zaxisID2 = zaxisptr2->self;
+  memcpy(zaxisptr2, zaxisptr1, sizeof(zaxis_t));
+  zaxisptr2->self = zaxisID2;
+}
+
+static
+void zaxisCheckPtr(const char *caller, int zaxisID, zaxis_t *zaxisptr)
+{
+  if ( zaxisptr == NULL )
+    Errorc("zaxis %d undefined!", zaxisID);
+}
+
+#define  zaxis_check_ptr(zaxisID, zaxisptr)  zaxisCheckPtr(__func__, zaxisID, zaxisptr)
+
+int zaxisSize(void)
+{
+  return reshCountType ( &zaxisOps );
+}
+
+
+/*
+ at Function  zaxisCreate
+ at Title     Create a vertical Z-axis
+
+ at Prototype int zaxisCreate(int zaxistype, int size)
+ at Parameter
+    @Item  zaxistype  The type of the Z-axis, one of the set of predefined CDI Z-axis types.
+                      The valid CDI Z-axis types are @func{ZAXIS_GENERIC}, @func{ZAXIS_SURFACE},
+                      @func{ZAXIS_HYBRID}, @func{ZAXIS_SIGMA}, @func{ZAXIS_PRESSURE}, @func{ZAXIS_HEIGHT},
+                      @func{ZAXIS_DEPTH_BELOW_SEA} and @func{ZAXIS_DEPTH_BELOW_LAND}.
+    @Item  size       Number of levels.
+
+ at Description
+The function @func{zaxisCreate} creates a vertical Z-axis.
+
+ at Result
+ at func{zaxisCreate} returns an identifier to the Z-axis.
+
+ at Example
+Here is an example using @func{zaxisCreate} to create a pressure level Z-axis:
+
+ at Source
+#include "cdi.h"
+   ...
+#define  nlev    5
+   ...
+double levs[nlev] = {101300, 92500, 85000, 50000, 20000};
+int zaxisID;
+   ...
+zaxisID = zaxisCreate(ZAXIS_PRESSURE, nlev);
+zaxisDefLevels(zaxisID, levs);
+   ...
+ at EndSource
+ at EndFunction
+*/
+int zaxisCreate(int zaxistype, int size)
+{
+  int ilev;
+  int zaxisID;
+  double *vals;
+  zaxis_t *zaxisptr;
+
+  if ( CDI_Debug )
+    Message("zaxistype: %d size: %d ", zaxistype, size);
+
+  zaxisInit ();
+
+  zaxisptr = zaxisNewEntry();
+
+  zaxisID = zaxisptr->self;
+
+  zaxisptr->type = zaxistype;
+  zaxisptr->size = size;
+
+  if ( zaxistype > CDI_MaxZaxistype )
+    Error("Internal problem! zaxistype > CDI_MaxZaxistype");
+
+  zaxisDefName(zaxisID, ZaxistypeEntry[zaxistype].name);
+  zaxisDefLongname(zaxisID, ZaxistypeEntry[zaxistype].longname);
+  zaxisDefUnits(zaxisID, ZaxistypeEntry[zaxistype].units);
+
+  if ( *ZaxistypeEntry[zaxistype].stdname )
+    strcpy(zaxisptr->stdname, ZaxistypeEntry[zaxistype].stdname);
+
+  zaxisptr->positive = ZaxistypeEntry[zaxistype].positive;
+
+  vals = (double *) malloc(size*sizeof(double));
+
+  for ( ilev = 0; ilev < size; ilev++ )
+    vals[ilev] = 0.0;
+
+  zaxisptr->vals = vals;
+
+  return (zaxisID);
+}
+
+
+void zaxisDestroyKernel( zaxis_t * zaxisptr )
+{
+  int id;
+
+  xassert ( zaxisptr );
+
+  id = zaxisptr->self;
+
+  if ( zaxisptr->vals )    free ( zaxisptr->vals );
+  if ( zaxisptr->lbounds ) free ( zaxisptr->lbounds );
+  if ( zaxisptr->ubounds ) free ( zaxisptr->ubounds );
+  if ( zaxisptr->weights ) free ( zaxisptr->weights );
+  if ( zaxisptr->vct )     free ( zaxisptr->vct );
+
+  free ( zaxisptr );
+
+  reshRemove ( id, &zaxisOps );
+}
+
+/*
+ at Function  zaxisDestroy
+ at Title     Destroy a vertical Z-axis
+
+ at Prototype void zaxisDestroy(int zaxisID)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+
+ at EndFunction
+*/
+void zaxisDestroy(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxisDestroyKernel ( zaxisptr );
+}
+
+
+static
+void zaxisDestroyP ( void * zaxisptr )
+{
+  zaxisDestroyKernel (( zaxis_t * ) zaxisptr );
+}
+
+
+char *zaxisNamePtr(int zaxistype)
+{
+  char *name;
+
+  if ( zaxistype >= 0 && zaxistype < CDI_MaxZaxistype )
+    name = ZaxistypeEntry[zaxistype].longname;
+  else
+    name = ZaxistypeEntry[ZAXIS_GENERIC].longname;
+
+  return (name);
+}
+
+
+void zaxisName(int zaxistype, char *zaxisname)
+{
+  strcpy(zaxisname, zaxisNamePtr(zaxistype));
+}
+
+/*
+ at Function  zaxisDefName
+ at Title     Define the name of a Z-axis
+
+ at Prototype void zaxisDefName(int zaxisID, const char *name)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  name     Name of the Z-axis.
+
+ at Description
+The function @func{zaxisDefName} defines the name of a Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefName(int zaxisID, const char *name)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( name )
+    strcpy(zaxisptr->name, name);
+}
+
+/*
+ at Function  zaxisDefLongname
+ at Title     Define the longname of a Z-axis
+
+ at Prototype void zaxisDefLongname(int zaxisID, const char *longname)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  longname Longname of the Z-axis.
+
+ at Description
+The function @func{zaxisDefLongname} defines the longname of a Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefLongname(int zaxisID, const char *longname)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( longname )
+    strcpy(zaxisptr->longname, longname);
+}
+
+/*
+ at Function  zaxisDefUnits
+ at Title     Define the units of a Z-axis
+
+ at Prototype void zaxisDefUnits(int zaxisID, const char *units)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  units    Units of the Z-axis.
+
+ at Description
+The function @func{zaxisDefUnits} defines the units of a Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefUnits(int zaxisID, const char *units)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( units )
+    strcpy(zaxisptr->units, units);
+}
+
+/*
+ at Function  zaxisInqName
+ at Title     Get the name of a Z-axis
+
+ at Prototype void zaxisInqName(int zaxisID, char *name)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  name     Name of the Z-axis. The caller must allocate space for the
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{zaxisInqName} returns the name of a Z-axis.
+
+ at Result
+ at func{zaxisInqName} returns the name of the Z-axis to the parameter name.
+
+ at EndFunction
+*/
+void zaxisInqName(int zaxisID, char *name)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strcpy(name, zaxisptr->name);
+}
+
+/*
+ at Function  zaxisInqLongname
+ at Title     Get the longname of a Z-axis
+
+ at Prototype void zaxisInqLongname(int zaxisID, char *longname)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  longname Longname of the Z-axis. The caller must allocate space for the
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{zaxisInqLongname} returns the longname of a Z-axis.
+
+ at Result
+ at func{zaxisInqLongname} returns the longname of the Z-axis to the parameter longname.
+
+ at EndFunction
+*/
+void zaxisInqLongname(int zaxisID, char *longname)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strcpy(longname, zaxisptr->longname);
+}
+
+/*
+ at Function  zaxisInqUnits
+ at Title     Get the units of a Z-axis
+
+ at Prototype void zaxisInqUnits(int zaxisID, char *units)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}
+    @Item  units    Units of the Z-axis. The caller must allocate space for the
+                    returned string. The maximum possible length, in characters, of
+                    the string is given by the predefined constant @func{CDI_MAX_NAME}.
+
+ at Description
+The function @func{zaxisInqUnits} returns the units of a Z-axis.
+
+ at Result
+ at func{zaxisInqUnits} returns the units of the Z-axis to the parameter units.
+
+ at EndFunction
+*/
+void zaxisInqUnits(int zaxisID, char *units)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strcpy(units, zaxisptr->units);
+}
+
+
+void zaxisInqStdname(int zaxisID, char *stdname)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strcpy(stdname, zaxisptr->stdname);
+}
+
+
+void zaxisDefPrec(int zaxisID, int prec)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxisptr->prec = prec;
+}
+
+
+int zaxisInqPrec(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->prec);
+}
+
+
+int zaxisInqPositive(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->positive);
+}
+
+
+void zaxisDefLtype(int zaxisID, int ltype)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxisptr->ltype = ltype;
+}
+
+
+int zaxisInqLtype(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->ltype);
+}
+
+/*
+ at Function  zaxisDefLevels
+ at Title     Define the levels of a Z-axis
+
+ at Prototype void zaxisDefLevels(int zaxisID, const double *levels)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  levels   All levels of the Z-axis.
+
+ at Description
+The function @func{zaxisDefLevels} defines the levels of a Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefLevels(int zaxisID, const double *levels)
+{
+  int ilev;
+  int size;
+  double *vals;
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+
+  vals = zaxisptr->vals;
+
+  for ( ilev = 0; ilev < size; ilev++ )
+    vals[ilev] = levels[ilev];
+}
+
+/*
+ at Function  zaxisDefLevel
+ at Title     Define one level of a Z-axis
+
+ at Prototype void zaxisDefLevel(int zaxisID, int levelID, double level)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  levelID  Level identifier.
+    @Item  level    Level.
+
+ at Description
+The function @func{zaxisDefLevel} defines one level of a Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefLevel(int zaxisID, int levelID, double level)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( levelID >= 0 && levelID < zaxisptr->size )
+    zaxisptr->vals[levelID] = level;
+}
+
+/*
+ at Function  zaxisDefReference
+ at Title     Define the reference for a genralized Z-axis
+
+ at Prototype void zaxisDefReference(int zaxisID, const int reference)
+ at Parameter
+    @Item  zaxisID     Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  reference   Reference for a generalized Z-axis.
+
+ at Description
+The function @func{zaxisDefReference} defines the reference for a generalized  Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefReference(int zaxisID, const int reference)
+{
+  zaxis_t *zaxisptr;
+
+    if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxisptr->reference = reference;
+}
+
+/*
+ at Function  zaxisDefUUID
+ at Title     Define the UUID for a genralized Z-axis
+
+ at Prototype void zaxisDefUUID(int zaxisID, const char *uuid)
+ at Parameter
+    @Item  zaxisID     Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  uuid        UUID for a generalized Z-axis.
+
+ at Description
+The function @func{zaxisDefUUID} defines the UUID for a generalized  Z-axis.
+
+ at EndFunction
+*/
+void zaxisDefUUID(int zaxisID, const char *uuid)
+{
+  zaxis_t *zaxisptr;
+
+    if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strncpy(zaxisptr->uuid, uuid, 16);
+
+  return;
+}
+
+/*
+ at Function  zaxisInqUUID
+ at Title     Get the uuid to a generalized Z-axis.
+
+ at Prototype char *zaxisInqUUID(int zaxisID, char *uuid)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+
+ at Description
+The function @func{zaxisInqUUID} returns the UUID to a generalized Z-axis.
+
+ at Result
+ at func{zaxisInqUUID} returns the UUID to a generalized Z-axis.
+ at EndFunction
+*/
+char *zaxisInqUUID(int zaxisID, char *uuid)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  strncpy(uuid, zaxisptr->uuid, 16);
+
+  return (uuid);
+}
+
+/*
+ at Function  zaxisInqReference
+ at Title     Get the reference to a generalized Z-axis.
+
+ at Prototype int zaxisInqReference(int zaxisID)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+
+ at Description
+The function @func{zaxisInqReference} returns the reference to a generalized Z-axis.
+
+ at Result
+ at func{zaxisInqReference} returns the reference to a generalized Z-axis.
+ at EndFunction
+*/
+int zaxisInqReference(int zaxisID)
+{
+  int reference = -1;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  reference = zaxisptr->reference;
+
+  return (reference);
+}
+
+/*
+ at Function  zaxisInqLevel
+ at Title     Get one level of a Z-axis
+
+ at Prototype double zaxisInqLevel(int zaxisID, int levelID)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  levelID  Level index (range: 0 to nlevel-1).
+
+ at Description
+The function @func{zaxisInqLevel} returns one level of a Z-axis.
+
+ at Result
+ at func{zaxisInqLevel} returns the level of a Z-axis.
+ at EndFunction
+*/
+double zaxisInqLevel(int zaxisID, int levelID)
+{
+  double level = 0;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( levelID >= 0 && levelID < zaxisptr->size )
+    level = zaxisptr->vals[levelID];
+
+  return (level);
+}
+
+double zaxisInqLbound(int zaxisID, int index)
+{
+  double level = 0;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->lbounds )
+    if ( index >= 0 && index < zaxisptr->size )
+      level = zaxisptr->lbounds[index];
+
+  return (level);
+}
+
+
+double zaxisInqUbound(int zaxisID, int index)
+{
+  double level = 0;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->ubounds )
+    if ( index >= 0 && index < zaxisptr->size )
+      level = zaxisptr->ubounds[index];
+
+  return (level);
+}
+
+
+const double *zaxisInqLevelsPtr(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return ( zaxisptr->vals );
+}
+
+/*
+ at Function  zaxisInqLevels
+ at Title     Get all levels of a Z-axis
+
+ at Prototype void zaxisInqLevels(int zaxisID, double *levels)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+    @Item  levels   Pointer to the location into which the levels are read.
+                    The caller must allocate space for the returned values.
+
+ at Description
+The function @func{zaxisInqLevels} returns all levels of a Z-axis.
+
+ at Result
+ at func{zaxisInqLevels} saves all levels to the parameter @func{levels}.
+ at EndFunction
+*/
+void zaxisInqLevels(int zaxisID, double *levels)
+{
+  int size;
+  int i;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+  for ( i = 0; i < size; i++ )
+    levels[i] =  zaxisptr->vals[i];
+}
+
+
+int zaxisInqLbounds(int zaxisID, double *lbounds)
+{
+  int size = 0;
+  int i;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->lbounds )
+    {
+      size = zaxisptr->size;
+
+      if ( lbounds )
+        for ( i = 0; i < size; i++ )
+          lbounds[i] =  zaxisptr->lbounds[i];
+    }
+
+  return (size);
+}
+
+
+int zaxisInqUbounds(int zaxisID, double *ubounds)
+{
+  int size = 0;
+  int i;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->ubounds )
+    {
+      size = zaxisptr->size;
+
+      if ( ubounds )
+        for ( i = 0; i < size; i++ )
+          ubounds[i] =  zaxisptr->ubounds[i];
+    }
+
+  return (size);
+}
+
+
+int zaxisInqWeights(int zaxisID, double *weights)
+{
+  int size = 0;
+  int i;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->weights )
+    {
+      size = zaxisptr->size;
+
+      if ( weights )
+        for ( i = 0; i < size; i++ )
+          weights[i] =  zaxisptr->weights[i];
+    }
+
+  return (size);
+}
+
+
+int zaxisInqLevelID(int zaxisID, double level)
+{
+  int size;
+  int levelID = CDI_UNDEFID;
+  int i;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+  for ( i = 0; i < size; i++ )
+    if ( fabs(level-zaxisptr->vals[i]) < DBL_EPSILON ) break;
+
+  if ( i < size ) levelID = i;
+
+  return (levelID);
+}
+
+/*
+ at Function  zaxisInqType
+ at Title     Get the type of a Z-axis
+
+ at Prototype int zaxisInqType(int zaxisID)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}.
+
+ at Description
+The function @func{zaxisInqType} returns the type of a Z-axis.
+
+ at Result
+ at func{zaxisInqType} returns the type of the Z-axis,
+one of the set of predefined CDI Z-axis types.
+The valid CDI Z-axis types are @func{ZAXIS_GENERIC}, @func{ZAXIS_SURFACE},
+ at func{ZAXIS_HYBRID}, @func{ZAXIS_SIGMA}, @func{ZAXIS_PRESSURE}, @func{ZAXIS_HEIGHT},
+ at func{ZAXIS_DEPTH_BELOW_SEA} and @func{ZAXIS_DEPTH_BELOW_LAND}.
+
+ at EndFunction
+*/
+int zaxisInqType(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->type);
+}
+
+/*
+ at Function  zaxisInqSize
+ at Title     Get the size of a Z-axis
+
+ at Prototype int zaxisInqSize(int zaxisID)
+ at Parameter
+    @Item  zaxisID  Z-axis ID, from a previous call to @fref{zaxisCreate}
+
+ at Description
+The function @func{zaxisInqSize} returns the size of a Z-axis.
+
+ at Result
+ at func{zaxisInqSize} returns the number of levels of a Z-axis.
+
+ at EndFunction
+*/
+int zaxisInqSize(int zaxisID)
+{
+  int size = 1;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+
+  return (size);
+}
+
+
+void cdiCheckZaxis(int zaxisID)
+{
+  int size, i, found;
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisInqType(zaxisID) == ZAXIS_GENERIC )
+    {
+      size = zaxisptr->size;
+      if ( size > 1 )
+        {
+          /* check direction */
+          if ( ! zaxisptr->direction )
+            {
+              found = 0;
+              for ( i = 1; i < size; i++ )
+                if ( zaxisptr->vals[i] > zaxisptr->vals[i-1] )
+                  found++;
+              if ( found == size-1 )
+                {
+                  zaxisptr->direction = LevelUp;
+                }
+              else
+                {
+                  found = 0;
+                  for ( i = 1; i < size; i++ )
+                    if ( zaxisptr->vals[i] < zaxisptr->vals[i-1] )
+                      found++;
+                  if ( found == size-1 )
+                    {
+                      zaxisptr->direction = LevelDown;
+                    }
+                }
+            }
+          /* check consistent */
+          if ( !zaxisptr->direction )
+            {
+              Warning("Direction undefined for zaxisID %d", zaxisID);
+            }
+        }
+    }
+}
+
+
+void zaxisDefVct(int zaxisID, int size, const double *vct)
+{
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  if ( zaxisptr->vct == 0 )
+    {
+      zaxisptr->vctsize = size;
+      zaxisptr->vct = (double *) malloc(size*sizeof(double));
+      memcpy(zaxisptr->vct, vct, size*sizeof(double));
+    }
+  else
+    if ( zaxisptr->vctsize != size )
+      Warning("VCT was already defined");
+}
+
+
+void zaxisInqVct(int zaxisID, double *vct)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  memcpy(vct, zaxisptr->vct, zaxisptr->vctsize*sizeof(double));
+}
+
+
+int zaxisInqVctSize(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->vctsize);
+}
+
+
+const double *zaxisInqVctPtr(int zaxisID)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  return (zaxisptr->vct);
+}
+
+
+void zaxisDefLbounds(int zaxisID, const double *lbounds)
+{
+  size_t size;
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+
+  if ( CDI_Debug )
+    if ( zaxisptr->lbounds != NULL )
+      Warning("Lower bounds already defined for zaxisID = %d", zaxisID);
+
+  if ( zaxisptr->lbounds == NULL )
+    zaxisptr->lbounds = (double *) malloc(size*sizeof(double));
+
+  memcpy(zaxisptr->lbounds, lbounds, size*sizeof(double));
+}
+
+
+void zaxisDefUbounds(int zaxisID, const double *ubounds)
+{
+  size_t size;
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+
+  if ( CDI_Debug )
+    if ( zaxisptr->ubounds != NULL )
+      Warning("Upper bounds already defined for zaxisID = %d", zaxisID);
+
+  if ( zaxisptr->ubounds == NULL )
+    zaxisptr->ubounds = (double *) malloc(size*sizeof(double));
+
+  memcpy(zaxisptr->ubounds, ubounds, size*sizeof(double));
+}
+
+
+void zaxisDefWeights(int zaxisID, const double *weights)
+{
+  size_t size;
+  zaxis_t *zaxisptr;
+
+  if ( reshGetStatus ( zaxisID, &zaxisOps ) == CLOSED )
+    {
+      xwarning("%s", "Operation not executed.");
+      return;
+    }
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  size = zaxisptr->size;
+
+  if ( CDI_Debug )
+    if ( zaxisptr->weights != NULL )
+      Warning("Weights already defined for zaxisID = %d", zaxisID);
+
+  if ( zaxisptr->weights == NULL )
+    zaxisptr->weights = (double *) malloc(size*sizeof(double));
+
+  memcpy(zaxisptr->weights, weights, size*sizeof(double));
+}
+
+
+void zaxisChangeType(int zaxisID, int zaxistype)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxisptr->type = zaxistype;
+}
+
+
+void zaxisResize(int zaxisID, int size)
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxisptr->size = size;
+
+  if ( zaxisptr->vals )
+    zaxisptr->vals = (double *) realloc(zaxisptr->vals, size*sizeof(double));
+}
+
+
+int zaxisDuplicate(int zaxisID)
+{
+  int zaxisIDnew;
+  int zaxistype, zaxissize;
+  int size;
+  zaxis_t *zaxisptr, *zaxisptrnew;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxis_check_ptr(zaxisID, zaxisptr);
+
+  zaxistype = zaxisInqType(zaxisID);
+  zaxissize = zaxisInqSize(zaxisID);
+
+  zaxisIDnew = zaxisCreate(zaxistype, zaxissize);
+  zaxisptrnew = ( zaxis_t * ) reshGetVal ( zaxisIDnew, &zaxisOps );
+
+  zaxis_copy(zaxisptrnew, zaxisptr);
+
+  strcpy(zaxisptrnew->name, zaxisptr->name);
+  strcpy(zaxisptrnew->longname, zaxisptr->longname);
+  strcpy(zaxisptrnew->units, zaxisptr->units);
+
+  if ( zaxisptr->vals != NULL )
+    {
+      size = zaxissize;
+
+      zaxisptrnew->vals = (double *) malloc(size*sizeof(double));
+      memcpy(zaxisptrnew->vals, zaxisptr->vals, size*sizeof(double));
+    }
+
+  if ( zaxisptr->lbounds )
+    {
+      size = zaxissize;
+
+      zaxisptrnew->lbounds = (double *) malloc(size*sizeof(double));
+      memcpy(zaxisptrnew->lbounds, zaxisptr->lbounds, size*sizeof(double));
+    }
+
+  if ( zaxisptr->ubounds )
+    {
+      size = zaxissize;
+
+      zaxisptrnew->ubounds = (double *) malloc(size*sizeof(double));
+      memcpy(zaxisptrnew->ubounds, zaxisptr->ubounds, size*sizeof(double));
+    }
+
+  if ( zaxisptr->vct != NULL )
+    {
+      size = zaxisptr->vctsize;
+
+      if ( size )
+        {
+          zaxisptrnew->vctsize = size;
+          zaxisptrnew->vct = (double *) malloc(size*sizeof(double));
+          memcpy(zaxisptrnew->vct, zaxisptr->vct, size*sizeof(double));
+        }
+    }
+
+  return (zaxisIDnew);
+}
+
+
+void zaxisPrintKernel ( zaxis_t * zaxisptr, FILE * fp )
+{
+  int zaxisID;
+  int type;
+  char uuid[17];
+  int nlevels, levelID;
+  int nbyte0, nbyte;
+  double level;
+
+  xassert ( zaxisptr );
+
+  zaxisID = zaxisptr->self;
+
+  type    = zaxisptr->type;
+  nlevels = zaxisptr->size;
+
+  nbyte0 = 0;
+  fprintf(fp, "#\n");
+  fprintf(fp, "# zaxisID %d\n", zaxisID);
+  fprintf(fp, "#\n");
+  fprintf(fp, "zaxistype = %s\n", zaxisNamePtr(type));
+  fprintf(fp, "size      = %d\n", nlevels);
+  if ( zaxisptr->name[0]     ) fprintf(fp, "name      = %s\n", zaxisptr->name);
+  if ( zaxisptr->longname[0] ) fprintf(fp, "longname  = %s\n", zaxisptr->longname);
+  if ( zaxisptr->units[0]    ) fprintf(fp, "units     = %s\n", zaxisptr->units);
+
+  nbyte0 = fprintf(fp, "levels    = ");
+  nbyte = nbyte0;
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      if ( nbyte > 80 )
+	{
+	  fprintf(fp, "\n");
+	  fprintf(fp, "%*s", nbyte0, "");
+	  nbyte = nbyte0;
+	}
+      level = zaxisInqLevel(zaxisID, levelID);
+      nbyte += fprintf(fp, "%.9g ", level);
+    }
+  fprintf(fp, "\n");
+
+  if ( zaxisptr->lbounds && zaxisptr->ubounds )
+    {
+      double level1, level2;
+      nbyte = nbyte0;
+      nbyte0 = fprintf(fp, "bounds    = ");
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	{
+	  if ( nbyte > 80 )
+	    {
+	      fprintf(fp, "\n");
+	      fprintf(fp, "%*s", nbyte0, "");
+	      nbyte = nbyte0;
+	    }
+	  level1 = zaxisInqLbound(zaxisID, levelID);
+	  level2 = zaxisInqUbound(zaxisID, levelID);
+	  nbyte += fprintf(fp, "%.9g-%.9g ", level1, level2);
+	}
+      fprintf(fp, "\n");
+    }
+
+  if ( type == ZAXIS_HYBRID || type == ZAXIS_HYBRID_HALF )
+    {
+      int i;
+      int vctsize;
+      const double *vct;
+
+      vctsize = zaxisptr->vctsize;
+      vct     = zaxisptr->vct;
+      fprintf(fp, "vctsize   = %d\n", vctsize);
+      if ( vctsize )
+        {
+          nbyte0 = fprintf(fp, "vct       = ");
+          nbyte = nbyte0;
+          for ( i = 0; i < vctsize; i++ )
+            {
+              if ( nbyte > 70 || i == vctsize/2 )
+                {
+                  fprintf(fp, "\n%*s", nbyte0, "");
+                  nbyte = nbyte0;
+                }
+              nbyte += fprintf(fp, "%.9g ", vct[i]);
+            }
+          fprintf(fp, "\n");
+          /*
+          nbyte0 = fprintf(fp, "vct_b     = ");
+          nbyte  = nbyte0;
+          for ( i = 0; i < vctsize/2; i++ )
+            {
+              if ( nbyte > 70 )
+                {
+                  fprintf(fp, "\n%*s", nbyte0, "");
+                  nbyte = nbyte0;
+                }
+              nbyte += fprintf(fp, "%.9g ", vct[vctsize/2+i]);
+            }
+          fprintf(fp, "\n");
+          */
+        }
+    }
+
+  if ( type == ZAXIS_REFERENCE )
+    {
+      const unsigned char *d;
+      zaxisInqUUID(zaxisID, uuid);
+      d = (unsigned char *) &uuid;
+      fprintf(fp, "uuid      = %02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\n",
+              d[0], d[1], d[2], d[3], d[4], d[5], d[6], d[7],
+              d[8], d[9], d[10], d[11], d[12], d[13], d[14], d[15]);
+    }
+}
+
+
+void zaxisPrint ( int zaxisID )
+{
+  zaxis_t *zaxisptr;
+
+  zaxisptr = ( zaxis_t * ) reshGetVal ( zaxisID, &zaxisOps );
+
+  zaxisPrintKernel ( zaxisptr, stdout );
+}
+
+
+static
+void zaxisPrintP ( void * voidptr, FILE * fp )
+{
+  zaxis_t *zaxisptr = ( zaxis_t * ) voidptr;
+
+  xassert ( zaxisptr );
+
+  zaxisPrintKernel(zaxisptr, fp);
+}
+
+
+static
+int  zaxisCompareP ( void * zaxisptr1, void * zaxisptr2 )
+{
+  zaxis_t * z1 = ( zaxis_t * ) zaxisptr1 ;
+  zaxis_t * z2 = ( zaxis_t * ) zaxisptr2 ;
+  static int differ = -1;
+  static int equal  =  0;
+  int i;
+
+  xassert ( z1 );
+  xassert ( z2 );
+
+  if ( z1->type      != z2->type )      return differ;
+  if ( z1->ltype     != z2->ltype )     return differ;
+  if ( z1->direction != z2->direction ) return differ;
+  if ( z1->prec      != z2->prec )      return differ;
+  if ( z1->size      != z2->size )      return differ;
+  if ( z1->vctsize   != z2->vctsize )   return differ;
+
+  if ( z1->vals )
+    {
+      xassert ( z1->size );
+
+      if ( !z2->vals ) return differ;
+
+      for ( i = 0; i < z1->size; i++ )
+        if ( z1->vals[i] != z2->vals[i] ) return differ;
+    }
+  else if ( z2->vals )
+    return differ;
+
+  if ( z1->lbounds )
+    {
+      xassert ( z1->size );
+
+      if ( !z2->lbounds ) return differ;
+
+      for ( i = 0; i < z1->size; i++ )
+        if ( z1->lbounds[i] != z2->lbounds[i] ) return differ;
+    }
+  else if ( z2->lbounds )
+    return differ;
+
+  if ( z1->ubounds )
+    {
+      xassert ( z1->size );
+
+      if ( !z2->ubounds ) return differ;
+
+      for ( i = 0; i < z1->size; i++ )
+        if ( z1->ubounds[i] != z2->ubounds[i] ) return differ;
+    }
+  else if ( z2->ubounds )
+    return differ;
+
+  if ( z1->weights )
+    {
+      xassert ( z1->size );
+
+      if ( !z2->weights ) return differ;
+
+      for ( i = 0; i < z1->size; i++ )
+        if ( z1->weights[i] != z2->weights[i] ) return differ;
+    }
+  else if ( z2->weights )
+    return differ;
+
+ if ( z1->vct )
+    {
+      xassert ( z1->vctsize );
+
+      if ( !z2->vct ) return differ;
+
+      for ( i = 0; i < z1->vctsize; i++ )
+        if ( z1->vct[i] != z2->vct[i] ) return differ;
+    }
+  else if ( z2->vct )
+    return differ;
+
+  if ( memcmp ( &z1->name    , &z2->name    , CDI_MAX_NAME ))
+    return differ;
+  if ( memcmp ( &z1->longname, &z2->longname, CDI_MAX_NAME ))
+    return differ;
+  if ( memcmp ( &z1->stdname , &z2->stdname , CDI_MAX_NAME ))
+    return differ;
+  if ( memcmp ( &z1->units   , &z2->units   , CDI_MAX_NAME ))
+    return differ;
+
+  if ( z1->positive != z2->positive ) return differ;
+
+
+  return equal;
+}
+
+
+#ifdef USE_MPI
+static int
+zaxisTxCode ( void )
+{
+  return ZAXIS;
+}
+
+enum { zaxisNint     = 7,
+       zaxisNstrings = 4,
+       vals     = 1 << 0,
+       lbounds  = 1 << 1,
+       ubounds  = 1 << 2,
+       weights  = 1 << 3,
+       vct      = 1 << 4
+};
+
+
+static
+int zaxisGetMemberMask ( zaxis_t * zaxisP )
+{
+  int memberMask = 0;
+
+  if ( zaxisP->vals )      memberMask |= vals;
+  if ( zaxisP->lbounds )   memberMask |= lbounds;
+  if ( zaxisP->ubounds )   memberMask |= ubounds;
+  if ( zaxisP->weights )   memberMask |= weights;
+  if ( zaxisP->vct )       memberMask |= vct;
+
+  return memberMask;
+}
+
+static
+int zaxisGetPackSize ( void * voidP, MPI_Comm comm )
+{
+  zaxis_t * zaxisP = ( zaxis_t * ) voidP;
+  int packBufferSize = 0, size;
+
+  xmpi ( MPI_Pack_size ( zaxisNint + 1, MPI_INT, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBufferSize += size;
+
+  if ( zaxisP->vals )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack_size ( zaxisP->size, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+    }
+
+  if ( zaxisP->lbounds )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack_size ( zaxisP->size, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+    }
+
+  if ( zaxisP->ubounds )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack_size ( zaxisP->size, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+    }
+
+  if ( zaxisP->weights )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack_size ( zaxisP->size, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+    }
+
+  if ( zaxisP->vct )
+    {
+      xassert ( zaxisP->vctsize );
+
+      xmpi ( MPI_Pack_size ( zaxisP->vctsize, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+      xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+      packBufferSize += size;
+    }
+
+  xmpi ( MPI_Pack_size ( zaxisNstrings * CDI_MAX_NAME , MPI_CHAR, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_DOUBLE, comm, &size ));
+  packBufferSize += size;
+  xmpi ( MPI_Pack_size ( 1, MPI_UNSIGNED_CHAR, comm, &size ));
+  packBufferSize += size;
+
+  return packBufferSize;
+}
+
+
+void zaxisUnpack ( char * unpackBuffer, int unpackBufferSize,
+                   int * unpackBufferPos, int nspTarget, MPI_Comm comm )
+{
+  zaxis_t * zaxisP;
+  int intBuffer[zaxisNint + 1], memberMask;
+  double d;
+  char charBuffer[zaxisNstrings * CDI_MAX_NAME];
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                      intBuffer, zaxisNint + 1, MPI_INT, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                      &d, 1, MPI_DOUBLE, comm ));
+
+  xassert ( xchecksum ( DATATYPE_INT, zaxisNint + 1, intBuffer ) == d );
+
+  zaxisInit ();
+
+  zaxisP = zaxisNewEntry();
+  if ( ! zaxisP ) Error("No memory");
+
+  xassert ( namespaceAdaptKey ( intBuffer[0], nspTarget ) == zaxisP->self );
+
+  zaxisP->prec      = intBuffer[1];
+  zaxisP->type      = intBuffer[2];
+  zaxisP->ltype     = intBuffer[3];
+  zaxisP->size      = intBuffer[4];
+  zaxisP->direction = intBuffer[5];
+  zaxisP->vctsize   = intBuffer[6];
+  memberMask        = intBuffer[7];
+
+  if ( memberMask & vals )
+    {
+      xassert ( zaxisP->size );
+
+      zaxisP->vals = xmalloc ( zaxisP->size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          zaxisP->vals, zaxisP->size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->vals ) == d );
+    }
+
+  if ( memberMask & lbounds )
+    {
+      xassert ( zaxisP->size );
+
+      zaxisP->lbounds = xmalloc ( zaxisP->size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          zaxisP->lbounds, zaxisP->size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->lbounds ) == d );
+    }
+
+  if ( memberMask & ubounds )
+    {
+      xassert ( zaxisP->size );
+
+      zaxisP->ubounds = xmalloc ( zaxisP->size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          zaxisP->ubounds, zaxisP->size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->ubounds ) == d );
+    }
+
+  if ( memberMask & weights )
+    {
+      xassert ( zaxisP->size );
+
+      zaxisP->weights = xmalloc ( zaxisP->size * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          zaxisP->weights, zaxisP->size, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->weights ) == d );
+    }
+
+  if ( memberMask & vct )
+    {
+      xassert ( zaxisP->vctsize );
+
+      zaxisP->vct = xmalloc ( zaxisP->vctsize * sizeof ( double ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          zaxisP->vct, zaxisP->vctsize, MPI_DOUBLE, comm ));
+      xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                          &d, 1, MPI_DOUBLE, comm ));
+      xassert ( xchecksum ( DATATYPE_FLT, zaxisP->vctsize, zaxisP->vct ) == d );
+    }
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                      charBuffer, zaxisNstrings * CDI_MAX_NAME, MPI_CHAR, comm ));
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                      &d, 1, MPI_DOUBLE, comm ));
+
+  xassert ( d == xchecksum ( DATATYPE_TXT, zaxisNstrings * CDI_MAX_NAME, charBuffer ));
+
+  memcpy ( zaxisP->name,     &charBuffer[CDI_MAX_NAME * 0], CDI_MAX_NAME );
+  memcpy ( zaxisP->longname, &charBuffer[CDI_MAX_NAME * 1], CDI_MAX_NAME );
+  memcpy ( zaxisP->stdname,  &charBuffer[CDI_MAX_NAME * 2], CDI_MAX_NAME );
+  memcpy ( zaxisP->units,    &charBuffer[CDI_MAX_NAME * 3], CDI_MAX_NAME );
+
+  xmpi ( MPI_Unpack ( unpackBuffer, unpackBufferSize, unpackBufferPos,
+                      &zaxisP->positive, 1, MPI_UNSIGNED_CHAR, comm ));
+}
+
+static
+void zaxisPack ( void * voidP, void * packBuffer, int packBufferSize,
+                 int * packBufferPos, MPI_Comm comm )
+{
+  zaxis_t   * zaxisP = ( zaxis_t * ) voidP;
+  int intBuffer[zaxisNint + 1];
+  double d;
+  char charBuffer[zaxisNstrings * CDI_MAX_NAME];
+
+  intBuffer[0]  = zaxisP->self;
+  intBuffer[1]  = zaxisP->prec;
+  intBuffer[2]  = zaxisP->type;
+  intBuffer[3]  = zaxisP->ltype;
+  intBuffer[4]  = zaxisP->size;
+  intBuffer[5]  = zaxisP->direction;
+  intBuffer[6]  = zaxisP->vctsize;
+  intBuffer[7]  = zaxisGetMemberMask ( zaxisP );
+
+  xmpi ( MPI_Pack ( intBuffer, zaxisNint + 1, MPI_INT,
+                    packBuffer, packBufferSize, packBufferPos, comm ));
+  d = xchecksum ( DATATYPE_INT, zaxisNint + 1, intBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  if ( zaxisP->vals )
+    {
+
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack ( zaxisP->vals, zaxisP->size, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->vals );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( zaxisP->lbounds )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack ( zaxisP->lbounds, zaxisP->size, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->lbounds );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( zaxisP->ubounds )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack ( zaxisP->ubounds, zaxisP->size, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->ubounds );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( zaxisP->weights )
+    {
+      xassert ( zaxisP->size );
+
+      xmpi ( MPI_Pack ( zaxisP->weights, zaxisP->size, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, zaxisP->size, zaxisP->weights );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  if ( zaxisP->vct )
+    {
+      xassert ( zaxisP->vctsize );
+
+      xmpi ( MPI_Pack ( zaxisP->vct, zaxisP->vctsize, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+      d = xchecksum ( DATATYPE_FLT, zaxisP->vctsize, zaxisP->vct );
+      xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                        packBuffer, packBufferSize, packBufferPos, comm ));
+    }
+
+  memcpy ( &charBuffer[CDI_MAX_NAME * 0], zaxisP->name,     CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 1], zaxisP->longname, CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 2], zaxisP->stdname,  CDI_MAX_NAME );
+  memcpy ( &charBuffer[CDI_MAX_NAME * 3], zaxisP->units,    CDI_MAX_NAME );
+
+  xmpi ( MPI_Pack ( charBuffer, zaxisNstrings * CDI_MAX_NAME, MPI_CHAR,
+                    packBuffer, packBufferSize, packBufferPos, comm ));
+  d = xchecksum  ( DATATYPE_TXT, zaxisNstrings * CDI_MAX_NAME, charBuffer );
+  xmpi ( MPI_Pack ( &d, 1, MPI_DOUBLE,
+                    packBuffer, packBufferSize, packBufferPos, comm ));
+
+  xmpi ( MPI_Pack ( &zaxisP->positive, 1, MPI_UNSIGNED_CHAR,
+                    packBuffer, packBufferSize, packBufferPos, comm ));
+}
+
+#endif
+
+void zaxisGetIndexList ( int nzaxis, int * zaxisResHs )
+{
+  reshGetResHListOfType ( nzaxis, zaxisResHs, &zaxisOps );
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/tests/Makefile.am b/libcdi/tests/Makefile.am
new file mode 100644
index 0000000..bae6aac
--- /dev/null
+++ b/libcdi/tests/Makefile.am
@@ -0,0 +1,23 @@
+## Process this file with automake to produce Makefile.in
+#
+TESTS = test_grib.sh test_cksum_grib test_cksum_nc test_cksum_extra \
+	test_cksum_service test_cksum_nc2 test_cksum_nc4 test_cksum_ieg \
+	pio_write_run pio_cksum_mpinonb pio_cksum_fpguard \
+	pio_cksum_asynch pio_cksum_writer
+check_PROGRAMS = test_grib cksum_write cksum_read pio_write
+#
+test_grib_SOURCES = test_grib.c
+cksum_write_SOURCES = cksum_write.c cksum.c cksum.h
+cksum_read_SOURCES = cksum_read.c \
+	var_cksum.c var_cksum.h \
+	stream_cksum.c stream_cksum.h \
+	cksum.c cksum.h \
+	ensure_array_size.h ensure_array_size.c
+pio_write_SOURCES = pio_write.c cksum.h cksum.c
+#
+LDADD = ../src/libcdi.la -lm
+INCLUDES   = -I$(top_srcdir)/src
+#
+EXTRA_DIST = $(TESTS)
+#
+CLEANFILES  = `ls *~ *.grb *.nc *.srv *.ext example_*.cksum`
diff --git a/libcdi/tests/Makefile.in b/libcdi/tests/Makefile.in
new file mode 100644
index 0000000..d85d84c
--- /dev/null
+++ b/libcdi/tests/Makefile.in
@@ -0,0 +1,752 @@
+# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+check_PROGRAMS = test_grib$(EXEEXT) cksum_write$(EXEEXT) \
+	cksum_read$(EXEEXT) pio_write$(EXEEXT)
+subdir = tests
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(srcdir)/pio_cksum_asynch.in $(srcdir)/pio_cksum_fpguard.in \
+	$(srcdir)/pio_cksum_mpinonb.in $(srcdir)/pio_cksum_writer.in \
+	$(srcdir)/pio_write_run.in $(srcdir)/test_cksum_extra.in \
+	$(srcdir)/test_cksum_grib.in $(srcdir)/test_cksum_ieg.in \
+	$(srcdir)/test_cksum_nc.in $(srcdir)/test_cksum_nc2.in \
+	$(srcdir)/test_cksum_nc4.in $(srcdir)/test_cksum_service.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps =  \
+	$(top_srcdir)/m4/acx_assert_lang_is_fortran_variant.m4 \
+	$(top_srcdir)/m4/acx_lang_other_suffix_conftest.m4 \
+	$(top_srcdir)/m4/acx_options.m4 \
+	$(top_srcdir)/m4/acx_sl_fc_mod_path_flag.m4 \
+	$(top_srcdir)/m4/acx_sl_mod_suffix.m4 \
+	$(top_srcdir)/m4/asx_unset.m4 $(top_srcdir)/m4/ax_pthread.m4 \
+	$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
+	$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
+	$(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/m4/starlink_fpp.m4 $(top_srcdir)/acinclude.m4 \
+	$(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES = test_cksum_grib test_cksum_nc test_cksum_nc2 \
+	test_cksum_nc4 test_cksum_extra test_cksum_service \
+	test_cksum_ieg pio_write_run pio_cksum_mpinonb \
+	pio_cksum_fpguard pio_cksum_asynch pio_cksum_writer
+CONFIG_CLEAN_VPATH_FILES =
+am_cksum_read_OBJECTS = cksum_read.$(OBJEXT) var_cksum.$(OBJEXT) \
+	stream_cksum.$(OBJEXT) cksum.$(OBJEXT) \
+	ensure_array_size.$(OBJEXT)
+cksum_read_OBJECTS = $(am_cksum_read_OBJECTS)
+cksum_read_LDADD = $(LDADD)
+cksum_read_DEPENDENCIES = ../src/libcdi.la
+am_cksum_write_OBJECTS = cksum_write.$(OBJEXT) cksum.$(OBJEXT)
+cksum_write_OBJECTS = $(am_cksum_write_OBJECTS)
+cksum_write_LDADD = $(LDADD)
+cksum_write_DEPENDENCIES = ../src/libcdi.la
+am_pio_write_OBJECTS = pio_write.$(OBJEXT) cksum.$(OBJEXT)
+pio_write_OBJECTS = $(am_pio_write_OBJECTS)
+pio_write_LDADD = $(LDADD)
+pio_write_DEPENDENCIES = ../src/libcdi.la
+am_test_grib_OBJECTS = test_grib.$(OBJEXT)
+test_grib_OBJECTS = $(am_test_grib_OBJECTS)
+test_grib_LDADD = $(LDADD)
+test_grib_DEPENDENCIES = ../src/libcdi.la
+DEFAULT_INCLUDES = -I. at am__isrc@ -I$(top_builddir)/src
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(cksum_read_SOURCES) $(cksum_write_SOURCES) \
+	$(pio_write_SOURCES) $(test_grib_SOURCES)
+DIST_SOURCES = $(cksum_read_SOURCES) $(cksum_write_SOURCES) \
+	$(pio_write_SOURCES) $(test_grib_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CDI_F90_INTERFACE_FCFLAGS = @CDI_F90_INTERFACE_FCFLAGS@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
+ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
+ENABLE_EXTRA = @ENABLE_EXTRA@
+ENABLE_GRIB = @ENABLE_GRIB@
+ENABLE_IEG = @ENABLE_IEG@
+ENABLE_PYTHON = @ENABLE_PYTHON@
+ENABLE_RUBY = @ENABLE_RUBY@
+ENABLE_SERVICE = @ENABLE_SERVICE@
+EXEEXT = @EXEEXT@
+F77 = @F77@
+FC = @FC@
+FCFLAGS = @FCFLAGS@
+FCFLAGS_f90 = @FCFLAGS_f90@
+FCMODCASE = @FCMODCASE@
+FCMODEXT = @FCMODEXT@
+FC_MOD_FLAG = @FC_MOD_FLAG@
+FFLAGS = @FFLAGS@
+FGREP = @FGREP@
+FPP = @FPP@
+FPPFLAGS = @FPPFLAGS@
+FPP_DEFOPT = @FPP_DEFOPT@
+FPP_INCOPT = @FPP_INCOPT@
+GREP = @GREP@
+GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
+GRIB_API_LIBS = @GRIB_API_LIBS@
+HDF5_INCLUDE = @HDF5_INCLUDE@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_ROOT = @HDF5_ROOT@
+HOST_NAME = @HOST_NAME@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JASPER_LIBS = @JASPER_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBPNG_LIBS = @LIBPNG_LIBS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+MPI_LAUNCH = @MPI_LAUNCH@
+NC_CONFIG = @NC_CONFIG@
+NETCDF_INCLUDE = @NETCDF_INCLUDE@
+NETCDF_LIBS = @NETCDF_LIBS@
+NETCDF_ROOT = @NETCDF_ROOT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OPENJPEG_LIBS = @OPENJPEG_LIBS@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+PYTHON = @PYTHON@
+RANLIB = @RANLIB@
+RUBY = @RUBY@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SWIG = @SWIG@
+SYSTEM_TYPE = @SYSTEM_TYPE@
+SZLIB_INCLUDE = @SZLIB_INCLUDE@
+SZLIB_LIBS = @SZLIB_LIBS@
+THREADS_INCLUDE = @THREADS_INCLUDE@
+THREADS_LIBS = @THREADS_LIBS@
+USER_NAME = @USER_NAME@
+USE_MPI = @USE_MPI@
+VERSION = @VERSION@
+ZLIB_INCLUDE = @ZLIB_INCLUDE@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+ac_ct_F77 = @ac_ct_F77@
+ac_ct_FC = @ac_ct_FC@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+openjpeg_LIBS = @openjpeg_LIBS@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+
+#
+TESTS = test_grib.sh test_cksum_grib test_cksum_nc test_cksum_extra \
+	test_cksum_service test_cksum_nc2 test_cksum_nc4 test_cksum_ieg \
+	pio_write_run pio_cksum_mpinonb pio_cksum_fpguard \
+	pio_cksum_asynch pio_cksum_writer
+
+#
+test_grib_SOURCES = test_grib.c
+cksum_write_SOURCES = cksum_write.c cksum.c cksum.h
+cksum_read_SOURCES = cksum_read.c \
+	var_cksum.c var_cksum.h \
+	stream_cksum.c stream_cksum.h \
+	cksum.c cksum.h \
+	ensure_array_size.h ensure_array_size.c
+
+pio_write_SOURCES = pio_write.c cksum.h cksum.c
+#
+LDADD = ../src/libcdi.la -lm
+INCLUDES = -I$(top_srcdir)/src
+#
+EXTRA_DIST = $(TESTS)
+#
+CLEANFILES = `ls *~ *.grb *.nc *.srv *.ext example_*.cksum`
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu tests/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu tests/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+test_cksum_grib: $(top_builddir)/config.status $(srcdir)/test_cksum_grib.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+test_cksum_nc: $(top_builddir)/config.status $(srcdir)/test_cksum_nc.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+test_cksum_nc2: $(top_builddir)/config.status $(srcdir)/test_cksum_nc2.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+test_cksum_nc4: $(top_builddir)/config.status $(srcdir)/test_cksum_nc4.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+test_cksum_extra: $(top_builddir)/config.status $(srcdir)/test_cksum_extra.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+test_cksum_service: $(top_builddir)/config.status $(srcdir)/test_cksum_service.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+test_cksum_ieg: $(top_builddir)/config.status $(srcdir)/test_cksum_ieg.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+pio_write_run: $(top_builddir)/config.status $(srcdir)/pio_write_run.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+pio_cksum_mpinonb: $(top_builddir)/config.status $(srcdir)/pio_cksum_mpinonb.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+pio_cksum_fpguard: $(top_builddir)/config.status $(srcdir)/pio_cksum_fpguard.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+pio_cksum_asynch: $(top_builddir)/config.status $(srcdir)/pio_cksum_asynch.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+pio_cksum_writer: $(top_builddir)/config.status $(srcdir)/pio_cksum_writer.in
+	cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+clean-checkPROGRAMS:
+	@list='$(check_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+cksum_read$(EXEEXT): $(cksum_read_OBJECTS) $(cksum_read_DEPENDENCIES) $(EXTRA_cksum_read_DEPENDENCIES) 
+	@rm -f cksum_read$(EXEEXT)
+	$(LINK) $(cksum_read_OBJECTS) $(cksum_read_LDADD) $(LIBS)
+cksum_write$(EXEEXT): $(cksum_write_OBJECTS) $(cksum_write_DEPENDENCIES) $(EXTRA_cksum_write_DEPENDENCIES) 
+	@rm -f cksum_write$(EXEEXT)
+	$(LINK) $(cksum_write_OBJECTS) $(cksum_write_LDADD) $(LIBS)
+pio_write$(EXEEXT): $(pio_write_OBJECTS) $(pio_write_DEPENDENCIES) $(EXTRA_pio_write_DEPENDENCIES) 
+	@rm -f pio_write$(EXEEXT)
+	$(LINK) $(pio_write_OBJECTS) $(pio_write_LDADD) $(LIBS)
+test_grib$(EXEEXT): $(test_grib_OBJECTS) $(test_grib_DEPENDENCIES) $(EXTRA_test_grib_DEPENDENCIES) 
+	@rm -f test_grib$(EXEEXT)
+	$(LINK) $(test_grib_OBJECTS) $(test_grib_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cksum.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cksum_read.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cksum_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/ensure_array_size.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/pio_write.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/stream_cksum.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/test_grib.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/var_cksum.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=XPASS; \
+	      ;; \
+	      *) \
+		col=$$grn; res=PASS; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		col=$$lgn; res=XFAIL; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=FAIL; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      col=$$blu; res=SKIP; \
+	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) $(check_PROGRAMS)
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-checkPROGRAMS clean-generic clean-libtool \
+	mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-TESTS check-am clean \
+	clean-checkPROGRAMS clean-generic clean-libtool ctags \
+	distclean distclean-compile distclean-generic \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-data \
+	install-data-am install-dvi install-dvi-am install-exec \
+	install-exec-am install-html install-html-am install-info \
+	install-info-am install-man install-pdf install-pdf-am \
+	install-ps install-ps-am install-strip installcheck \
+	installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/libcdi/tests/cksum.c b/libcdi/tests/cksum.c
new file mode 100644
index 0000000..d06b11d
--- /dev/null
+++ b/libcdi/tests/cksum.c
@@ -0,0 +1,125 @@
+#include <inttypes.h>
+#include <stdlib.h>
+#include <sys/types.h>
+
+static const uint32_t crctab[] = {
+  0x00000000,
+  0x04c11db7, 0x09823b6e, 0x0d4326d9, 0x130476dc, 0x17c56b6b,
+  0x1a864db2, 0x1e475005, 0x2608edb8, 0x22c9f00f, 0x2f8ad6d6,
+  0x2b4bcb61, 0x350c9b64, 0x31cd86d3, 0x3c8ea00a, 0x384fbdbd,
+  0x4c11db70, 0x48d0c6c7, 0x4593e01e, 0x4152fda9, 0x5f15adac,
+  0x5bd4b01b, 0x569796c2, 0x52568b75, 0x6a1936c8, 0x6ed82b7f,
+  0x639b0da6, 0x675a1011, 0x791d4014, 0x7ddc5da3, 0x709f7b7a,
+  0x745e66cd, 0x9823b6e0, 0x9ce2ab57, 0x91a18d8e, 0x95609039,
+  0x8b27c03c, 0x8fe6dd8b, 0x82a5fb52, 0x8664e6e5, 0xbe2b5b58,
+  0xbaea46ef, 0xb7a96036, 0xb3687d81, 0xad2f2d84, 0xa9ee3033,
+  0xa4ad16ea, 0xa06c0b5d, 0xd4326d90, 0xd0f37027, 0xddb056fe,
+  0xd9714b49, 0xc7361b4c, 0xc3f706fb, 0xceb42022, 0xca753d95,
+  0xf23a8028, 0xf6fb9d9f, 0xfbb8bb46, 0xff79a6f1, 0xe13ef6f4,
+  0xe5ffeb43, 0xe8bccd9a, 0xec7dd02d, 0x34867077, 0x30476dc0,
+  0x3d044b19, 0x39c556ae, 0x278206ab, 0x23431b1c, 0x2e003dc5,
+  0x2ac12072, 0x128e9dcf, 0x164f8078, 0x1b0ca6a1, 0x1fcdbb16,
+  0x018aeb13, 0x054bf6a4, 0x0808d07d, 0x0cc9cdca, 0x7897ab07,
+  0x7c56b6b0, 0x71159069, 0x75d48dde, 0x6b93dddb, 0x6f52c06c,
+  0x6211e6b5, 0x66d0fb02, 0x5e9f46bf, 0x5a5e5b08, 0x571d7dd1,
+  0x53dc6066, 0x4d9b3063, 0x495a2dd4, 0x44190b0d, 0x40d816ba,
+  0xaca5c697, 0xa864db20, 0xa527fdf9, 0xa1e6e04e, 0xbfa1b04b,
+  0xbb60adfc, 0xb6238b25, 0xb2e29692, 0x8aad2b2f, 0x8e6c3698,
+  0x832f1041, 0x87ee0df6, 0x99a95df3, 0x9d684044, 0x902b669d,
+  0x94ea7b2a, 0xe0b41de7, 0xe4750050, 0xe9362689, 0xedf73b3e,
+  0xf3b06b3b, 0xf771768c, 0xfa325055, 0xfef34de2, 0xc6bcf05f,
+  0xc27dede8, 0xcf3ecb31, 0xcbffd686, 0xd5b88683, 0xd1799b34,
+  0xdc3abded, 0xd8fba05a, 0x690ce0ee, 0x6dcdfd59, 0x608edb80,
+  0x644fc637, 0x7a089632, 0x7ec98b85, 0x738aad5c, 0x774bb0eb,
+  0x4f040d56, 0x4bc510e1, 0x46863638, 0x42472b8f, 0x5c007b8a,
+  0x58c1663d, 0x558240e4, 0x51435d53, 0x251d3b9e, 0x21dc2629,
+  0x2c9f00f0, 0x285e1d47, 0x36194d42, 0x32d850f5, 0x3f9b762c,
+  0x3b5a6b9b, 0x0315d626, 0x07d4cb91, 0x0a97ed48, 0x0e56f0ff,
+  0x1011a0fa, 0x14d0bd4d, 0x19939b94, 0x1d528623, 0xf12f560e,
+  0xf5ee4bb9, 0xf8ad6d60, 0xfc6c70d7, 0xe22b20d2, 0xe6ea3d65,
+  0xeba91bbc, 0xef68060b, 0xd727bbb6, 0xd3e6a601, 0xdea580d8,
+  0xda649d6f, 0xc423cd6a, 0xc0e2d0dd, 0xcda1f604, 0xc960ebb3,
+  0xbd3e8d7e, 0xb9ff90c9, 0xb4bcb610, 0xb07daba7, 0xae3afba2,
+  0xaafbe615, 0xa7b8c0cc, 0xa379dd7b, 0x9b3660c6, 0x9ff77d71,
+  0x92b45ba8, 0x9675461f, 0x8832161a, 0x8cf30bad, 0x81b02d74,
+  0x857130c3, 0x5d8a9099, 0x594b8d2e, 0x5408abf7, 0x50c9b640,
+  0x4e8ee645, 0x4a4ffbf2, 0x470cdd2b, 0x43cdc09c, 0x7b827d21,
+  0x7f436096, 0x7200464f, 0x76c15bf8, 0x68860bfd, 0x6c47164a,
+  0x61043093, 0x65c52d24, 0x119b4be9, 0x155a565e, 0x18197087,
+  0x1cd86d30, 0x029f3d35, 0x065e2082, 0x0b1d065b, 0x0fdc1bec,
+  0x3793a651, 0x3352bbe6, 0x3e119d3f, 0x3ad08088, 0x2497d08d,
+  0x2056cd3a, 0x2d15ebe3, 0x29d4f654, 0xc5a92679, 0xc1683bce,
+  0xcc2b1d17, 0xc8ea00a0, 0xd6ad50a5, 0xd26c4d12, 0xdf2f6bcb,
+  0xdbee767c, 0xe3a1cbc1, 0xe760d676, 0xea23f0af, 0xeee2ed18,
+  0xf0a5bd1d, 0xf464a0aa, 0xf9278673, 0xfde69bc4, 0x89b8fd09,
+  0x8d79e0be, 0x803ac667, 0x84fbdbd0, 0x9abc8bd5, 0x9e7d9662,
+  0x933eb0bb, 0x97ffad0c, 0xafb010b1, 0xab710d06, 0xa6322bdf,
+  0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4
+};
+
+
+uint32_t
+memcrc(const unsigned char *b, size_t n)
+{
+/*  Input arguments:
+ *  const char*   b == byte sequence to checksum
+ *  size_t        n == length of sequence
+ */
+
+
+  register uint32_t i, c, s = 0;
+
+
+  for (i = n; i > 0; --i) {
+    c = (uint32_t)(*b++);
+    s = (s << 8) ^ crctab[(s >> 24) ^ c];
+  }
+
+
+  /* Extend with the length of the string. */
+  while (n != 0) {
+    c = n & 0377;
+    n >>= 8;
+    s = (s << 8) ^ crctab[(s >> 24) ^ c];
+  }
+
+
+  return ~s;
+}
+
+void
+memcrc_r(uint32_t *state, const unsigned char *block, size_t block_len)
+{
+/*  Input arguments:
+ *  const char*   b == byte sequence to checksum
+ *  size_t        n == length of sequence
+ */
+
+
+  register uint32_t i, c, s = *state;
+  register size_t n = block_len;
+  register const unsigned char *b = block;
+
+  for (i = n; i > 0; --i) {
+    c = (uint32_t)(*b++);
+    s = (s << 8) ^ crctab[(s >> 24) ^ c];
+  }
+
+  *state = s;
+}
+
+unsigned long
+memcrc_finish(uint32_t *state, off_t total_size)
+{
+  register uint32_t c, s = *state;
+  register off_t n = total_size;
+
+  /* Extend with the length of the string. */
+  while (n != 0) {
+    c = n & 0377;
+    n >>= 8;
+    s = (s << 8) ^ crctab[(s >> 24) ^ c];
+  }
+
+  return ~s;
+}
diff --git a/libcdi/tests/cksum.h b/libcdi/tests/cksum.h
new file mode 100644
index 0000000..40e17bf
--- /dev/null
+++ b/libcdi/tests/cksum.h
@@ -0,0 +1,15 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <inttypes.h>
+
+void
+memcrc_r(uint32_t *state, const unsigned char *block, size_t block_len);
+
+unsigned long
+memcrc_finish(uint32_t *state, off_t total_size);
+
+uint32_t
+memcrc(const unsigned char *b, size_t n);
+
diff --git a/libcdi/tests/cksum_read.c b/libcdi/tests/cksum_read.c
new file mode 100644
index 0000000..6dff4b9
--- /dev/null
+++ b/libcdi/tests/cksum_read.c
@@ -0,0 +1,81 @@
+#ifndef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include <assert.h>
+#include <inttypes.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "ensure_array_size.h"
+#include "var_cksum.h"
+#include "stream_cksum.h"
+
+static struct cksum_table *
+read_table(const char *table_fname, size_t *table_len)
+{
+  struct cksum_table *table = NULL;
+  FILE *tablefp;
+  size_t table_size = 0, table_used = 0;
+  unsigned long cksum_temp;
+  int code;
+
+  if (!(tablefp = fopen(table_fname, "r")))
+    {
+      perror("failed to open table file");
+      *table_len = -1;
+      return NULL;
+    }
+  while (fscanf(tablefp, "%08lx %d\n", &cksum_temp, &code) == 2)
+    {
+      ENSURE_ARRAY_SIZE(table, table_size, table_used + 1);
+      table[table_used].code = code;
+      table[table_used].cksum = cksum_temp;
+      ++table_used;
+    }
+  fclose(tablefp);
+  *table_len = table_used;
+  return table;
+}
+
+
+int main(int argc, char *argv[])
+{
+  char *fname = "example.grb", *table_fname = "example.cksum";
+
+  if (argc > 1)
+    fname = argv[1];
+  if (argc > 2)
+    table_fname = argv[2];
+
+  // compute checksums from data file
+  size_t nvars;
+  struct cksum_table *file_vars = cksum_stream(fname, &nvars);
+  if (!file_vars)
+    exit(EXIT_FAILURE);
+  // check checksums from table file
+  int retcode;
+  {
+    size_t num_ref_entries;
+    struct cksum_table *ref_var_table
+      = read_table(table_fname, &num_ref_entries);
+    if (num_ref_entries == -1)
+      exit(EXIT_FAILURE);
+    retcode
+      = compare_checksums(file_vars, nvars, "file",
+                          ref_var_table, num_ref_entries, "reference table");
+    free(ref_var_table);
+  }
+
+  return retcode;
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/tests/cksum_write.c b/libcdi/tests/cksum_write.c
new file mode 100644
index 0000000..99cb824
--- /dev/null
+++ b/libcdi/tests/cksum_write.c
@@ -0,0 +1,325 @@
+#include <errno.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <math.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include "cdi.h"
+
+#include "cksum.h"
+
+static int
+parse_intarg(const char msg[])
+{
+  char *end;
+  long temp = strtol(optarg, &end, 0);
+  if ((errno == ERANGE && (temp == LONG_MAX || temp == LONG_MIN))
+      || (errno != 0 && temp == 0)) {
+    perror(msg);
+    exit(EXIT_FAILURE);
+  }
+  if (temp > INT_MAX || temp < INT_MIN)
+  {
+    fprintf(stderr, "range error: %ld\n", temp);
+    exit(EXIT_FAILURE);
+  }
+  return (int)temp;
+}
+
+static inline double
+sign_flat(double v)
+{
+  if (v == 0.0)
+    return 0.0;
+  return v;
+}
+
+static char *
+fname_create(const char *prefix, const char *suffix)
+{
+  size_t prefix_len, suffix_len;
+  char *fname;
+  if (!(fname =malloc((prefix_len = strlen(prefix)) + 1
+                      + (suffix_len = strlen(suffix)) + 1)))
+    {
+      perror("cannot create string");
+      exit(EXIT_FAILURE);
+    }
+  strcpy(fname, prefix);
+  fname[prefix_len] = '.';
+  strcpy(fname + prefix_len + 1, suffix);
+  return fname;
+}
+
+static const struct {
+  char suffix[4];
+  int type, defaultDT, defaultGrid;
+} suffix2type[] = {
+  { "nc", FILETYPE_NC, DATATYPE_FLT64, GRID_LONLAT },
+  { "grb",  FILETYPE_GRB, DATATYPE_PACK24, GRID_LONLAT },
+  { "nc2", FILETYPE_NC2, DATATYPE_FLT64, GRID_LONLAT },
+  { "nc4", FILETYPE_NC4, DATATYPE_FLT64, GRID_LONLAT },
+  { "ext", FILETYPE_EXT, DATATYPE_FLT64, GRID_GENERIC, },
+  { "svc", FILETYPE_SRV, DATATYPE_FLT64, GRID_GENERIC, },
+  { "ieg", FILETYPE_IEG, DATATYPE_FLT64, GRID_LONLAT },
+};
+
+enum {
+  nvars = 2,
+};
+
+static const int varCodes[nvars] = { 42, 55 };
+
+int
+main(int argc, char *argv[])
+{
+  int gridID, zaxisID[nvars], taxisID;
+  int vlistID, varID[nvars], streamID, tsID;
+  int nlon = 12, //!< Number of longitudes
+    nlat = 6, //!< Number of latitudes
+    nlev = 5, //!< Number of levels
+    nts = 3; //!< Number of time steps
+  int i, j, k, nmiss = 0;
+  double *lons, *lats, *var[nvars], *levs, mscale, mrscale;
+  size_t varSize[nvars];
+  char *varName[nvars] = { "varname1", "varname2" };
+  const char *suffix = "grb", *prefix = "example";
+  int grid = GRID_LONLAT;
+  int filetype = FILETYPE_GRB, datatype = DATATYPE_PACK24;
+  {
+    int opt;
+    while ((opt = getopt(argc, argv, "f:m:n:o:t:")) != -1)
+      switch (opt) {
+      case 'f':
+        {
+          int found = 0;
+          for (i = 0;
+               i < sizeof (suffix2type) / sizeof (suffix2type[0]);
+               ++i)
+            if (!strcmp(optarg, suffix2type[i].suffix))
+              {
+                found = 1;
+                filetype = suffix2type[i].type;
+                suffix = suffix2type[i].suffix;
+                datatype = suffix2type[i].defaultDT;
+                break;
+              }
+          if (!found)
+            {
+              fprintf(stderr, "Unsupported format requested: %s\n", optarg);
+              exit(EXIT_FAILURE);
+            }
+        }
+        break;
+      case 'm':
+        nlon = parse_intarg("error parsing number of longitudes");
+        break;
+      case 'n':
+        nlat = parse_intarg("error parsing number of latitudes");
+        break;
+      case 'o':
+        nlev = parse_intarg("error parsing number of levels");
+        break;
+      case 't':
+        nts = parse_intarg("error parsing number of timesteps");
+        break;
+      default: /* '?' */
+        fprintf(stderr, "Usage: %s [-m nlon] [-n nlat] [-o nlev] [-t nts]\n",
+                argv[0]);
+        exit(EXIT_FAILURE);
+      }
+  }
+
+  lons = malloc(nlon * sizeof (lons[0]));
+  for (i = 0; i < nlon; ++i)
+    lons[i] = ((double)(i * 360))/nlon;
+  lats = malloc(nlat * sizeof (lats[0]));
+  for (i = 0; i < nlat; ++i)
+    lats[i] = ((double)(i * 180))/nlat - 90.0;
+  levs = malloc(nlev * sizeof (levs[0]));
+  for (i = 0; i < nlev; ++i)
+    levs[i] = 101300 - 3940.3 * (exp(1.3579 * (double)(i)/(nlev - 1)) - 1.0);
+
+  varSize[0] = nlon * nlat;
+  varSize[1] = nlon * nlat * nlev;
+
+  // Create a regular lon/lat grid
+  gridID = gridCreate(grid, nlon*nlat);
+  gridDefXsize(gridID, nlon);
+  gridDefYsize(gridID, nlat);
+  gridDefXvals(gridID, lons);
+  gridDefYvals(gridID, lats);
+
+  // Create a surface level Z-axis
+  zaxisID[0] = zaxisCreate(ZAXIS_SURFACE, 1);
+
+  // Create a pressure level Z-axis
+  zaxisID[1] = zaxisCreate(ZAXIS_PRESSURE, nlev);
+  zaxisDefLevels(zaxisID[1], levs);
+
+  // Create a Time axis
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+
+  // Create a variable list
+  vlistID = vlistCreate();
+
+  for (i = 0; i < nvars; ++i)
+    {
+      // Define the variables
+      varID[i] = vlistDefVar(vlistID, gridID, zaxisID[i], TIME_VARIABLE);
+      // Define the variable names,
+      vlistDefVarName(vlistID, varID[i], varName[i]);
+      // the codes
+      vlistDefVarCode(vlistID, varID[i], varCodes[i]);
+      // and set the data type
+      vlistDefVarDatatype(vlistID, varID[i], datatype);
+      // create memory for variables
+      var[i] = malloc(varSize[i] * sizeof (var[i][0]));
+
+    }
+
+  {
+    int mant_bits;
+    switch (datatype)
+      {
+      case DATATYPE_PACK8:
+        mant_bits = 7;
+        break;
+      case DATATYPE_PACK16:
+        mant_bits = 15;
+        break;
+      case DATATYPE_PACK24:
+        mant_bits = 23;
+        break;
+      case DATATYPE_FLT32:
+        mant_bits = 24;
+        break;
+      case DATATYPE_FLT64:
+        mant_bits = 53;
+        break;
+      case DATATYPE_INT8:
+      case DATATYPE_INT16:
+      case DATATYPE_INT32:
+      default:
+        fprintf(stderr, "Unexpected or unusable content format: %d\n",
+                datatype);
+        exit(EXIT_FAILURE);
+      }
+    mscale = INT64_C(1) << mant_bits;
+    mrscale = 1.0/mscale;
+  }
+
+  // Assign the Time axis to the variable list
+  vlistDefTaxis(vlistID, taxisID);
+
+  // Create a dataset in netCDF fromat
+  {
+    char *fname = fname_create(prefix, suffix);
+    if ((streamID = streamOpenWrite(fname, filetype)) < 0)
+      {
+        fprintf(stderr, "error opening output file %s: %s\n",
+                fname, cdiStringError(streamID));
+        exit(EXIT_FAILURE);
+      }
+    free(fname);
+  }
+
+  // Assign the variable list to the dataset
+  streamDefVlist(streamID, vlistID);
+
+  {
+    uint32_t checksum_state[nvars] = { 0, 0 };
+    // Loop over the number of time steps
+    for ( tsID = 0; tsID < nts; tsID++ )
+      {
+        // Set the verification date to 1985-01-01 + tsID
+        taxisDefVdate(taxisID, 19850101+tsID);
+        // Set the verification time to 12:00:00
+        taxisDefVtime(taxisID, 120000);
+        // Define the time step
+        streamDefTimestep(streamID, tsID);
+
+        // Init var1 and var2
+        for (j = 0; j < nlat; j++)
+          for (i = 0; i < nlon; i++)
+            var[0][i+j*nlon]
+              = sign_flat(round(
+                   (sin(2.0 * M_PI * (lons[(i + tsID)%nlon] - lons[0])
+                        / (lons[nlon-1] - lons[0]))
+                    * cos(2.0 * M_PI * (lats[j] - lats[0])
+                          / (lons[nlat-1] - lats[0]))
+                    ) * mscale)) * mrscale;
+        for (k = 0; k < nlev; ++k)
+          for (j = 0; j < nlat; j++)
+            for (i = 0; i < nlon; i++)
+              var[1][i+j*nlon+k*nlon*nlat]
+                = sign_flat(round(
+                     (cos(2.0 * M_PI * (lons[(i + tsID)%nlon] - lons[0])
+                          / (lons[nlon-1] - lons[0]))
+                      * sin(2.0 * M_PI * (lats[j] - lats[0])
+                            / (lons[nlat-1] - lats[0]))
+                      ) * mscale)) * mrscale;
+
+        memcrc_r(&checksum_state[0], (const unsigned char *)var[0],
+                 varSize[0] * sizeof (var[0][0]));
+        memcrc_r(&checksum_state[1], (const unsigned char *)var[1],
+                 varSize[1] * sizeof (var[1][0]));
+
+        // Write var1 and var2
+        streamWriteVar(streamID, varID[0], var[0], nmiss);
+        streamWriteVar(streamID, varID[1], var[1], nmiss);
+      }
+    // write checksums to table file
+    {
+      FILE *tablefp;
+      {
+        char *fname = fname_create(prefix, "cksum");
+        if (!(tablefp = fopen(fname, "w")))
+          {
+            perror("failed to open table file");
+            exit(EXIT_FAILURE);
+          }
+        free(fname);
+      }
+      for (i = 0; i < nvars; ++i)
+        {
+          uint32_t cksum;
+          int code;
+          cksum = memcrc_finish(&checksum_state[i],
+                                (off_t)varSize[i] * sizeof (var[i][0]) * nts);
+          code = vlistInqVarCode(vlistID, varID[i]);
+          if (fprintf(tablefp, "%08lx %d\n", (unsigned long)cksum, code) < 0)
+            {
+              perror("failed to write table file");
+              exit(EXIT_FAILURE);
+            }
+        }
+      fclose(tablefp);
+    }
+  }
+
+  // Close the output stream
+  streamClose(streamID);
+
+  // Destroy the objects
+  vlistDestroy(vlistID);
+  taxisDestroy(taxisID);
+  zaxisDestroy(zaxisID[0]);
+  zaxisDestroy(zaxisID[1]);
+  gridDestroy(gridID);
+
+  return 0;
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/tests/ensure_array_size.c b/libcdi/tests/ensure_array_size.c
new file mode 100644
index 0000000..0b03f15
--- /dev/null
+++ b/libcdi/tests/ensure_array_size.c
@@ -0,0 +1,16 @@
+#include <stdlib.h>
+
+#include "ensure_array_size.h"
+#include "pio_util.h"
+
+void
+realloc_array(void **array, size_t elem_size, size_t *curr_array_size,
+              size_t requested_size)
+{
+  const size_t array_inc_size = (1024 + elem_size - 1)/ elem_size;
+  *curr_array_size = array_inc_size
+    * ((requested_size + array_inc_size) / array_inc_size);
+  *array = realloc(*array, *curr_array_size * elem_size);
+  if (!*array)
+    xabort("reallocation failed");
+}
diff --git a/libcdi/tests/ensure_array_size.h b/libcdi/tests/ensure_array_size.h
new file mode 100644
index 0000000..1452d41
--- /dev/null
+++ b/libcdi/tests/ensure_array_size.h
@@ -0,0 +1,21 @@
+#ifndef ENSURE_ARRAY_SIZE_H
+#define ENSURE_ARRAY_SIZE_H
+
+void
+realloc_array(void **array, size_t elem_size, size_t *curr_array_size,
+              size_t requested_size);
+
+#define ENSURE_ARRAY_SIZE(arrayp, curr_array_size, req_size)            \
+  do {                                                                  \
+    if ((req_size) > (curr_array_size))                                 \
+    {                                                                   \
+      size_t casize = (curr_array_size);                                \
+                                                                        \
+      realloc_array((void **)&(arrayp), sizeof(*(arrayp)), &casize,     \
+                    (req_size));                                        \
+      (curr_array_size) = casize;                                       \
+    }                                                                   \
+  }                                                                     \
+  while(0)
+
+#endif
diff --git a/libcdi/tests/pio_cksum_asynch b/libcdi/tests/pio_cksum_asynch
new file mode 100755
index 0000000..ff00756
--- /dev/null
+++ b/libcdi/tests/pio_cksum_asynch
@@ -0,0 +1,9 @@
+#! /bin/sh
+pio_write_args="-p PIO_ASYNCH -w 3"
+mpi_task_num=7
+LOG=pio_cksum_asynch.log
+if [ "" = yes ]; then
+  . ./pio_write_run
+else
+  exit 77
+fi
diff --git a/libcdi/tests/pio_cksum_asynch.in b/libcdi/tests/pio_cksum_asynch.in
new file mode 100644
index 0000000..71db070
--- /dev/null
+++ b/libcdi/tests/pio_cksum_asynch.in
@@ -0,0 +1,9 @@
+#! @SHELL@
+pio_write_args="-p PIO_ASYNCH -w 3"
+mpi_task_num=7
+LOG=pio_cksum_asynch.log
+if [ "@USE_MPI@" = yes ]; then
+  . ./pio_write_run
+else
+  exit 77
+fi
\ No newline at end of file
diff --git a/libcdi/tests/pio_cksum_fpguard b/libcdi/tests/pio_cksum_fpguard
new file mode 100755
index 0000000..cfac274
--- /dev/null
+++ b/libcdi/tests/pio_cksum_fpguard
@@ -0,0 +1,9 @@
+#! /bin/sh
+pio_write_args="-p PIO_FPGUARD -w 3"
+mpi_task_num=6
+LOG=pio_cksum_fpguard.log
+if [ "" = yes ]; then
+  . ./pio_write_run
+else
+  exit 77
+fi
diff --git a/libcdi/tests/pio_cksum_fpguard.in b/libcdi/tests/pio_cksum_fpguard.in
new file mode 100644
index 0000000..a242f12
--- /dev/null
+++ b/libcdi/tests/pio_cksum_fpguard.in
@@ -0,0 +1,9 @@
+#! @SHELL@
+pio_write_args="-p PIO_FPGUARD -w 3"
+mpi_task_num=6
+LOG=pio_cksum_fpguard.log
+if [ "@USE_MPI@" = yes ]; then
+  . ./pio_write_run
+else
+  exit 77
+fi
\ No newline at end of file
diff --git a/libcdi/tests/pio_cksum_mpinonb b/libcdi/tests/pio_cksum_mpinonb
new file mode 100755
index 0000000..38dfeef
--- /dev/null
+++ b/libcdi/tests/pio_cksum_mpinonb
@@ -0,0 +1,9 @@
+#! /bin/sh
+pio_write_args="-p PIO_MPI -w 2"
+mpi_task_num=4
+LOG=pio_cksum_mpinonb.log
+if [ "" = yes ]; then
+  . ./pio_write_run
+else
+  exit 77
+fi
diff --git a/libcdi/tests/pio_cksum_mpinonb.in b/libcdi/tests/pio_cksum_mpinonb.in
new file mode 100644
index 0000000..6b8ec34
--- /dev/null
+++ b/libcdi/tests/pio_cksum_mpinonb.in
@@ -0,0 +1,9 @@
+#! @SHELL@
+pio_write_args="-p PIO_MPI -w 2"
+mpi_task_num=4
+LOG=pio_cksum_mpinonb.log
+if [ "@USE_MPI@" = yes ]; then
+  . ./pio_write_run
+else
+  exit 77
+fi
\ No newline at end of file
diff --git a/libcdi/tests/pio_cksum_writer b/libcdi/tests/pio_cksum_writer
new file mode 100755
index 0000000..0a3c44a
--- /dev/null
+++ b/libcdi/tests/pio_cksum_writer
@@ -0,0 +1,9 @@
+#! /bin/sh
+pio_write_args="-p PIO_WRITER -w 4"
+mpi_task_num=8
+LOG=pio_cksum_writer.log
+if [ "" = yes ]; then
+  . ./pio_write_run
+else
+  exit 77
+fi
diff --git a/libcdi/tests/pio_cksum_writer.in b/libcdi/tests/pio_cksum_writer.in
new file mode 100644
index 0000000..2d284c1
--- /dev/null
+++ b/libcdi/tests/pio_cksum_writer.in
@@ -0,0 +1,9 @@
+#! @SHELL@
+pio_write_args="-p PIO_WRITER -w 4"
+mpi_task_num=8
+LOG=pio_cksum_writer.log
+if [ "@USE_MPI@" = yes ]; then
+  . ./pio_write_run
+else
+  exit 77
+fi
\ No newline at end of file
diff --git a/libcdi/tests/pio_write.c b/libcdi/tests/pio_write.c
new file mode 100644
index 0000000..4cf59cf
--- /dev/null
+++ b/libcdi/tests/pio_write.c
@@ -0,0 +1,526 @@
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <errno.h>
+#include <inttypes.h>
+#include <limits.h>
+#include <math.h>
+#include <stdbool.h>
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+#include <unistd.h>
+
+#ifdef USE_MPI
+#include <mpi.h>
+#include "pio_c_temp.h"
+#else
+typedef int MPI_Comm;
+#endif
+
+#include "cdi.h"
+#include "pio_util.h"
+#include "cksum.h"
+
+struct model_config
+{
+  int nlon, nlat, nts, max_nlev;
+  int filetype, datatype;
+  bool compute_checksum;
+  const char *suffix;
+};
+
+struct model_config default_setup
+  = { .nlon = 12, .nts = 3, .nlat = 6,
+      .filetype = FILETYPE_GRB, .datatype = DATATYPE_PACK24,
+      .compute_checksum = 1,
+      .suffix = "grb",
+      .max_nlev = 5,
+};
+
+static void
+var_scale(int datatype, double *mscale, double *mrscale);
+
+static inline double
+sign_flat(double v)
+{
+  if (v == 0.0)
+    return 0.0;
+  return v;
+}
+
+enum {
+  ntfiles     = 2,
+  nVars       = 5,
+};
+
+static time_t
+cditime2time_t(int date, int timeofday);
+static void
+time_t2cditime(time_t t, int *date, int *timeofday);
+
+
+static void
+modelRegionCompute(double region[], size_t offset, size_t len,
+                   int nlev, int nlat, int nlon,
+                   int tsID, const double lons[], const double lats[],
+                   double mscale, double mrscale)
+{
+  size_t local_pos;
+  for (local_pos = 0; local_pos < len; ++local_pos)
+    {
+      size_t global_pos = offset + local_pos;
+      int k = global_pos / (nlon * nlat);
+      int j = (global_pos % (nlon * nlat))/ nlon;
+      int i = global_pos % nlon;
+      region[local_pos]
+        = sign_flat(round((cos(2.0 * M_PI * (lons[(i + tsID)%nlon] - lons[0])
+                               / (lons[nlon-1] - lons[0]))
+                           * sin(2.0 * M_PI * (lats[(j + k)%nlat] - lats[0])
+                                 / (lats[nlat-1] - lats[0]))
+                           ) * mscale)) * mrscale;
+    }
+}
+
+
+static void
+modelRun(struct model_config setup, MPI_Comm comm)
+{
+
+  static int nlev_scale[nVars]    = {0,0,1,1,1};
+  static int varCodes[nVars] = {129, 130, 131, 132, 133};
+  static char * name        = "example";
+
+  int gridID, zaxisID[nVars], taxisID;
+  int vlistID, varIDs[nVars], streamID, tsID, tfID = 0;
+  int i, varID, nmiss = 0;
+  double *lons, *lats;
+  double *var = NULL, *varslice;
+  double mscale, mrscale;
+  time_t current_time;
+  int vdate = 19850101, vtime = 120000;
+  int start = CDI_UNDEFID, chunk = CDI_UNDEFID, rank = 0, comm_size = 1;
+  char filename[1024];
+  int nlon = setup.nlon, nlat = setup.nlat;
+  uint32_t checksum_state[nVars];
+  size_t varSize[nVars], varslice_size;
+  int *nlev;
+  double *levs;
+#if USE_MPI
+  int *chunks = NULL, *displs = NULL;
+#endif
+
+#if USE_MPI
+  xmpi ( MPI_Comm_rank ( comm, &rank ));
+  xmpi ( MPI_Comm_size ( comm, &comm_size ));
+  if (rank == 0 && setup.compute_checksum)
+    {
+      chunks = xmalloc(comm_size * sizeof (chunks[0]));
+      displs = xmalloc(comm_size * sizeof (displs[0]));
+      var = xmalloc((size_t)nlon * (size_t)nlat
+                    * (size_t)setup.max_nlev * sizeof(var[0]));
+    }
+#endif
+
+  var_scale(setup.datatype, &mscale, &mrscale);
+
+  gridID = gridCreate ( GRID_LONLAT, nlon*nlat );
+  gridDefXsize ( gridID, nlon );
+  gridDefYsize ( gridID, nlat );
+  lons = malloc(nlon * sizeof (lons[0]));
+  for (i = 0; i < nlon; ++i)
+    lons[i] = ((double)(i * 360))/nlon;
+  lats = malloc(nlat * sizeof (lats[0]));
+  for (i = 0; i < nlat; ++i)
+    lats[i] = ((double)(i * 180))/nlat - 90.0;
+  gridDefXvals ( gridID, lons );
+  gridDefYvals ( gridID, lats );
+
+  levs = xmalloc(setup.max_nlev * sizeof (levs[0]));
+  for (i = 0; i < setup.max_nlev; ++i)
+    levs[i] = 101300.0
+      - 3940.3 * (exp(1.3579 * (double)(i)/(setup.max_nlev - 1)) - 1.0);
+
+  nlev = xmalloc(nVars * sizeof (nlev[0]));
+  for ( i = 0; i < nVars; i++ )
+    {
+      nlev[i] = nlev_scale[i] * (setup.max_nlev - 1) + 1;
+      zaxisID[i] = zaxisCreate ( ZAXIS_PRESSURE, nlev[i] );
+      zaxisDefLevels ( zaxisID[i], levs );
+    }
+
+  varslice = NULL;
+  varslice_size = 0;
+
+  vlistID = vlistCreate ();
+
+  for ( i = 0; i < nVars; i++ )
+    {
+      varIDs[i] = vlistDefVar ( vlistID, gridID, zaxisID[i], TIME_VARIABLE );
+      varSize[i] = nlon * nlat * nlev[i];
+      vlistDefVarCode(vlistID, varIDs[i], varCodes[i]);
+      vlistDefVarDatatype(vlistID, varIDs[i], setup.datatype);
+    }
+
+  taxisID = taxisCreate ( TAXIS_ABSOLUTE );
+  vlistDefTaxis ( vlistID, taxisID );
+
+  sprintf ( &filename[0], "%s_%d.%s", name, tfID, setup.suffix );
+  streamID = streamOpenWrite ( filename, setup.filetype );
+  xassert ( streamID >= 0 );
+  streamDefVlist ( streamID, vlistID);
+
+  pioEndDef ();
+
+  for ( tfID = 0; tfID < ntfiles; tfID++ )
+    {
+      memset(checksum_state, 0, sizeof(checksum_state));
+      if ( tfID > 0 )
+	{
+	  streamClose ( streamID );
+	  sprintf ( &filename[0], "%s_%d.%s", name, tfID, setup.suffix );
+	  streamID = streamOpenWrite ( filename, setup.filetype );
+	  xassert ( streamID >= 0 );
+	  streamDefVlist ( streamID, vlistID );
+	}
+      vdate = 19850101;
+      vtime = 120000;
+      current_time = cditime2time_t(vdate, vtime);
+      for ( tsID = 0; tsID < setup.nts; tsID++ )
+	{
+          time_t2cditime(current_time, &vdate, &vtime);
+	  taxisDefVdate ( taxisID, vdate );
+	  taxisDefVtime ( taxisID, vtime );
+	  streamDefTimestep ( streamID, tsID );
+	  for ( varID = 0; varID < nVars; varID++ )
+	    {
+              start = pioInqVarDecoOff(vlistID, varIDs[varID]);
+              chunk = pioInqVarDecoChunk(vlistID, varIDs[varID]);
+              if (varslice_size < chunk)
+                {
+                  varslice = xrealloc(varslice, chunk * sizeof (var[0]));
+                  varslice_size = chunk;
+                }
+              modelRegionCompute(varslice, start, chunk,
+                                 nlev[varID], nlat, nlon,
+                                 tsID, lons, lats,
+                                 mscale, mrscale);
+              if (setup.compute_checksum)
+                {
+#if USE_MPI
+                  xmpi(MPI_Gather(&chunk, 1, MPI_INT,
+                                  chunks, 1, MPI_INT, 0, comm));
+                  if (rank == 0)
+                    {
+                      displs[0] = 0;
+                      for (i = 1; i < comm_size; ++i)
+                        displs[i] = displs[i - 1] + chunks[i - 1];
+                    }
+                  xmpi(MPI_Gatherv(varslice, chunk, MPI_DOUBLE,
+                                   var, chunks, displs, MPI_DOUBLE, 0, comm));
+#else
+                  var = varslice;
+#endif
+                }
+              if (rank == 0 && setup.compute_checksum)
+                {
+                  memcrc_r(&checksum_state[varID], (const unsigned char *)var,
+                           varSize[varID] * sizeof (var[0]));
+                }
+
+	      streamWriteVar ( streamID, varIDs[varID], varslice, nmiss );
+	      start = CDI_UNDEFID;
+	      chunk = CDI_UNDEFID;
+	    }
+          current_time += 86400;
+	  pioWriteTimestep ( tsID, vdate, vtime );
+	}
+      if (rank == 0 && setup.compute_checksum)
+        {
+          FILE *tablefp;
+          {
+            sprintf(filename, "%s_%d.cksum", name, tfID);
+            if (!(tablefp = fopen(filename, "w")))
+              {
+                perror("failed to open table file");
+                exit(EXIT_FAILURE);
+              }
+            for (i = 0; i < nVars; ++i)
+              {
+                uint32_t cksum;
+                int code;
+                cksum = memcrc_finish(&checksum_state[i],
+                                      (off_t)varSize[i]
+                                      * sizeof (var[0]) * setup.nts);
+                code = vlistInqVarCode(vlistID, varIDs[i]);
+                if (fprintf(tablefp, "%08lx %d\n", (unsigned long)cksum,
+                            code) < 0)
+                  {
+                    perror("failed to write table file");
+                    exit(EXIT_FAILURE);
+                  }
+              }
+            fclose(tablefp);
+          }
+        }
+    }
+  pioEndTimestepping ();
+  streamClose ( streamID );
+  vlistDestroy ( vlistID );
+  taxisDestroy ( taxisID );
+  for ( i = 0; i < nVars; i++ )
+    zaxisDestroy ( zaxisID[i] );
+  gridDestroy ( gridID );
+  free(lats);
+  free(lons);
+}
+
+struct {
+  char *text;
+  int mode;
+} mode_map[] = {
+  { "PIO_MPI", PIO_MPI },
+  { "PIO_FPGUARD", PIO_FPGUARD },
+  { "PIO_ASYNCH", PIO_ASYNCH },
+  { "PIO_WRITER", PIO_WRITER }
+};
+
+static const struct {
+  char suffix[4];
+  int type, defaultDT, defaultGrid;
+} suffix2type[] = {
+  { "nc", FILETYPE_NC, DATATYPE_FLT64, GRID_LONLAT },
+  { "grb",  FILETYPE_GRB, DATATYPE_PACK24, GRID_LONLAT },
+  { "nc2", FILETYPE_NC2, DATATYPE_FLT64, GRID_LONLAT },
+  { "nc4", FILETYPE_NC4, DATATYPE_FLT64, GRID_LONLAT },
+  { "ext", FILETYPE_EXT, DATATYPE_FLT64, GRID_GENERIC, },
+  { "svc", FILETYPE_SRV, DATATYPE_FLT64, GRID_GENERIC, },
+  { "ieg", FILETYPE_IEG, DATATYPE_FLT64, GRID_LONLAT },
+};
+
+static int
+parse_intarg(const char msg[])
+{
+  char *end;
+  long temp = strtol(optarg, &end, 0);
+  if ((errno == ERANGE && (temp == LONG_MAX || temp == LONG_MIN))
+      || (errno != 0 && temp == 0)) {
+    perror(msg);
+    exit(EXIT_FAILURE);
+  }
+  if (temp > INT_MAX || temp < INT_MIN)
+  {
+    fprintf(stderr, "range error: %ld\n", temp);
+    exit(EXIT_FAILURE);
+  }
+  return (int)temp;
+}
+
+static void
+var_scale(int datatype, double *mscale, double *mrscale)
+{
+  int mant_bits;
+  switch (datatype)
+    {
+    case DATATYPE_PACK8:
+      mant_bits = 7;
+      break;
+    case DATATYPE_PACK16:
+      mant_bits = 15;
+      break;
+    case DATATYPE_PACK24:
+      mant_bits = 23;
+      break;
+    case DATATYPE_FLT32:
+      mant_bits = 24;
+      break;
+    case DATATYPE_FLT64:
+      mant_bits = 53;
+      break;
+    case DATATYPE_INT8:
+    case DATATYPE_INT16:
+    case DATATYPE_INT32:
+    default:
+      fprintf(stderr, "Unexpected or unusable content format: %d\n",
+              datatype);
+      exit(EXIT_FAILURE);
+    }
+  *mscale = INT64_C(1) << mant_bits;
+  *mrscale = 1.0 / *mscale;
+}
+
+static inline int
+search_iomode_str(const char *modestr)
+{
+  int i, retval = -1;
+  for (i = 0;
+       i < sizeof (mode_map) / sizeof (mode_map[0]);
+       ++i)
+    if (!strcmp(modestr, mode_map[i].text))
+      {
+        retval = i;
+        break;
+      }
+  return retval;
+}
+
+int main (int argc, char *argv[])
+{
+#ifdef USE_MPI
+  enum {
+    nNamespaces = 2 };
+  static int hasLocalFile[nNamespaces] = { 0, 1 };
+#endif
+
+  struct model_config setup = default_setup;
+
+  MPI_Comm commModel;
+#ifdef USE_MPI
+  MPI_Comm commGlob;
+  int sizeGlob;
+  int rankGlob;
+  int IOMode = PIO_MPI;
+  int nProcsIO = 2;
+
+  xmpi ( MPI_Init ( &argc, &argv));
+  xmpi ( MPI_Comm_dup ( MPI_COMM_WORLD, &commGlob ));
+  xmpi ( MPI_Comm_set_errhandler ( commGlob, MPI_ERRORS_RETURN ));
+  xmpi ( MPI_Comm_size ( commGlob, &sizeGlob ));
+  xmpi ( MPI_Comm_rank ( commGlob, &rankGlob ));
+#endif
+
+  {
+    int opt;
+    while ((opt = getopt(argc, argv, "f:m:n:z:t:c"
+#ifdef USE_MPI
+                         "p:w:"
+#endif
+                         )) != -1)
+      switch (opt) {
+#ifdef USE_MPI
+      case 'p':
+        {
+          int entry = search_iomode_str(optarg);
+          if (entry < 0)
+            {
+              fprintf(stderr, "Unsupported PIO mode requested: %s\n", optarg);
+              exit(EXIT_FAILURE);
+            }
+          IOMode = mode_map[entry].mode;
+        }
+        break;
+      case 'w':
+        nProcsIO = strtol(optarg, NULL, 0);
+        break;
+#endif
+      case 'f':
+        {
+          int i, found = 0;
+          for (i = 0;
+               i < sizeof (suffix2type) / sizeof (suffix2type[0]);
+               ++i)
+            if (!strcmp(optarg, suffix2type[i].suffix))
+              {
+                found = 1;
+                setup.filetype = suffix2type[i].type;
+                setup.suffix = suffix2type[i].suffix;
+                setup.datatype = suffix2type[i].defaultDT;
+                break;
+              }
+          if (!found)
+            {
+              fprintf(stderr, "Unsupported format requested: %s\n", optarg);
+              exit(EXIT_FAILURE);
+            }
+        }
+        break;
+      case 'm':
+        setup.nlon = parse_intarg("error parsing number of longitudes");
+        break;
+      case 'n':
+        setup.nlat = parse_intarg("error parsing number of latitudes");
+        break;
+      case 'z':
+        setup.max_nlev = parse_intarg("error parsing number of levels");
+        if (setup.max_nlev < 1)
+          {
+            fputs("number of levels must be greater than zero!\n",
+                  stderr);
+            exit(EXIT_FAILURE);
+          }
+        break;
+      case 't':
+        setup.nts = parse_intarg("error parsing number of timesteps");
+        break;
+      case 'c':
+        setup.compute_checksum = 0;
+        break;
+      default: /* '?' */
+        fprintf(stderr, "Usage: %s "
+                "[-m nlon] [-n nlat] [-z nlev] [-t nts]"
+#ifdef USE_MPI
+                " [-p PIO_MODE] [-w NIOSERVERS] [-c]"
+#endif
+                "\n", argv[0]);
+        exit(EXIT_FAILURE);
+      }
+
+  }
+
+#ifdef USE_MPI
+  commModel = pioInit_c(commGlob, nProcsIO, IOMode,
+                        nNamespaces, hasLocalFile);
+#else
+  commModel = -1;
+#endif
+
+  modelRun (setup, commModel);
+
+#ifdef USE_MPI
+  pioFinalize ();
+  MPI_Finalize ();
+#endif
+  return 0;
+}
+
+static time_t
+cditime2time_t(int date, int timeofday)
+{
+  struct tm t_s;
+  time_t t;
+  t_s.tm_year = date / 10000;
+  t_s.tm_mon = (date - t_s.tm_year * 10000)/100;
+  t_s.tm_mday = date % 100;
+  t_s.tm_year -= 1900;
+  t_s.tm_hour = timeofday/10000;
+  t_s.tm_min = (timeofday%10000)/100;
+  t_s.tm_sec = timeofday%100;
+  t_s.tm_isdst = 0;
+  t = mktime(&t_s);
+  /* 
+   * fprintf(stderr, "converted %d,%d to %s to %lld.\n", date, timeofday,
+   *         asctime(&t_s), (long long)t);
+   */
+  return t;
+}
+
+static void
+time_t2cditime(time_t t, int *date, int *timeofday)
+{
+  struct tm *t_s;
+  t_s = localtime(&t);
+  /* fprintf(stderr, "converted %lld to %s.\n", (long long)t, asctime(t_s)); */
+  *date = (t_s->tm_year + 1900) * 10000 + t_s->tm_mon * 100 + t_s->tm_mday;
+  *timeofday = t_s->tm_hour * 10000 + t_s->tm_min * 100 + t_s->tm_sec;
+}
+
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/tests/pio_write_run b/libcdi/tests/pio_write_run
new file mode 100755
index 0000000..3ad5030
--- /dev/null
+++ b/libcdi/tests/pio_write_run
@@ -0,0 +1,13 @@
+#! /bin/sh
+set -e
+LOG="${LOG-pio_write.log}"
+mpi_task_num="${mpi_task_num-4}"
+exec 5>&1 6>&2 >"$LOG" 2>&1
+../libtool --mode=execute /Users/m214003/cdt/work/cdo/build/gcc/libcdi/util/serialrun -n ${mpi_task_num} \
+  ./pio_write ${pio_write_args}
+exec 2>&6 1>&5 5>&- 6>&-
+../libtool --mode=execute \
+  ./cksum_read example_0.grb example_0.cksum
+../libtool --mode=execute \
+  ./cksum_read example_1.grb example_1.cksum
+\rm "$LOG"
diff --git a/libcdi/tests/pio_write_run.in b/libcdi/tests/pio_write_run.in
new file mode 100644
index 0000000..aafa5d4
--- /dev/null
+++ b/libcdi/tests/pio_write_run.in
@@ -0,0 +1,13 @@
+#! @SHELL@
+set -e
+LOG="${LOG-pio_write.log}"
+mpi_task_num="${mpi_task_num-4}"
+exec 5>&1 6>&2 >"$LOG" 2>&1
+../libtool --mode=execute @MPI_LAUNCH@ -n ${mpi_task_num} \
+  ./pio_write ${pio_write_args}
+exec 2>&6 1>&5 5>&- 6>&-
+../libtool --mode=execute \
+  ./cksum_read example_0.grb example_0.cksum
+../libtool --mode=execute \
+  ./cksum_read example_1.grb example_1.cksum
+\rm "$LOG"
diff --git a/libcdi/tests/stream_cksum.c b/libcdi/tests/stream_cksum.c
new file mode 100644
index 0000000..6b970c5
--- /dev/null
+++ b/libcdi/tests/stream_cksum.c
@@ -0,0 +1,140 @@
+#include "cdi.h"
+#include "cksum.h"
+#include "stream_cksum.h"
+#include "pio_util.h"
+
+
+struct cksum_table *
+cksum_stream(const char *fname, size_t *table_len)
+{
+  int taxisID, vlistID, streamID, tsID;
+  int vdate, vtime, nvars, ngrids, nzaxis;
+  int i;
+  uint32_t *checksum_state = NULL;
+  struct
+  {
+    int x, y, z;
+    size_t chars;
+  } *varSize = NULL;
+  size_t var_size_max_chars = 0;
+  double *buf = NULL;
+  struct cksum_table *file_vars = NULL;
+
+  do {
+    // Open the dataset
+    streamID = streamOpenRead(fname);
+    if ( streamID < 0 )
+      {
+        fprintf(stderr, "Cannot open data input file %s: %s\n",
+                fname, cdiStringError(streamID));
+        nvars = -1;
+        break;
+      }
+
+    // Get the variable list of the dataset
+    vlistID = streamInqVlist(streamID);
+
+    nvars = vlistNvars(vlistID);
+    ngrids = vlistNgrids(vlistID);
+    nzaxis = vlistNzaxis(vlistID);
+    if (nzaxis < 0 || ngrids < 0)
+      {
+        fprintf(stderr, "Error in grid/zaxis count query %d:%d\n",
+                ngrids, nzaxis);
+        nvars = -1;
+        break;
+      }
+    checksum_state = xcalloc(nvars, sizeof (checksum_state[0]));
+    varSize = xmalloc(nvars * sizeof (varSize[0]));
+
+    for (i = 0; i < nvars; ++i)
+      {
+        int grid = vlistInqVarGrid(vlistID, i), gridType;
+        int zaxis = vlistInqVarZaxis(vlistID, i);
+        if (grid == CDI_UNDEFID || zaxis == CDI_UNDEFID)
+          {
+            fputs("error in axis/grid inquiry\n", stderr);
+            nvars = -1;
+            break;
+          }
+      if ((varSize[i].z = zaxisInqSize(zaxis)) <= 0)
+        {
+          fputs("invalid Z-axis found\n", stderr);
+          nvars = -1;
+          break;
+        }
+      if ((gridType = gridInqType(grid)) != GRID_LONLAT
+          && gridType != GRID_GENERIC)
+        {
+          fprintf(stderr, "unexpected non-lonlat grid found: %d\n",
+                  gridType);
+          nvars = -1;
+          break;
+        }
+      if ((varSize[i].x = gridInqXsize(grid)) < 0)
+        {
+          fprintf(stderr, "invalid X-size found: %d\n", varSize[i].x);
+          nvars = -1;
+          break;
+        }
+      if (varSize[i].x == 0) varSize[i].x = 1;
+      if ((varSize[i].y = gridInqYsize(grid)) < 0)
+        {
+          fprintf(stderr, "invalid Y-size found: %d\n", varSize[i].y);
+          nvars = -1;
+          break;
+        }
+      if (varSize[i].y == 0) varSize[i].y = 1;
+      varSize[i].chars = (size_t)varSize[i].x * varSize[i].y * varSize[i].z
+        * sizeof (buf[0]);
+      if (var_size_max_chars < varSize[i].chars)
+        var_size_max_chars = varSize[i].chars;
+    }
+    buf = xmalloc(var_size_max_chars);
+
+    if (nvars == -1)
+      break;
+
+    // Get the Time axis from the variable list
+    taxisID = vlistInqTaxis(vlistID);
+
+    tsID = 0;
+    // Inquire the time step
+    while (streamInqTimestep(streamID, tsID))
+      {
+        // Get the verification date and time
+        vdate = taxisInqVdate(taxisID);
+        vtime = taxisInqVtime(taxisID);
+
+        // Read var1 and var2
+        for (i = 0; i < nvars; ++i)
+          {
+            int nmiss;
+            streamReadVar(streamID, i, buf, &nmiss);
+            memcrc_r(checksum_state + i, (const unsigned char *)buf,
+                     varSize[i].chars);
+          }
+        ++tsID;
+      }
+
+    file_vars = xmalloc(nvars * sizeof (file_vars[0]));
+    for (i = 0; i < nvars; ++i)
+      {
+        file_vars[i].code = vlistInqVarCode(vlistID, i);
+        file_vars[i].cksum = memcrc_finish(checksum_state + i,
+                                           (off_t)varSize[i].chars * tsID);
+      }
+    // Close the input stream
+    streamClose(streamID);
+
+  } while (0);
+
+  // free resources
+  free(checksum_state);
+  free(varSize);
+  free(buf);
+  *table_len = nvars;
+
+  return file_vars;
+}
+
diff --git a/libcdi/tests/stream_cksum.h b/libcdi/tests/stream_cksum.h
new file mode 100644
index 0000000..32e14fc
--- /dev/null
+++ b/libcdi/tests/stream_cksum.h
@@ -0,0 +1,13 @@
+#ifndef STREAM_CKSUM_H
+#define STREAM_CKSUM_H
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "var_cksum.h"
+
+struct cksum_table *
+cksum_stream(const char *fname, size_t *table_len);
+
+#endif
diff --git a/libcdi/tests/test_cksum_extra b/libcdi/tests/test_cksum_extra
new file mode 100755
index 0000000..01e827c
--- /dev/null
+++ b/libcdi/tests/test_cksum_extra
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=ext
+if [ yes = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_extra.in b/libcdi/tests/test_cksum_extra.in
new file mode 100644
index 0000000..2dc92b9
--- /dev/null
+++ b/libcdi/tests/test_cksum_extra.in
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=ext
+if [ @ENABLE_EXTRA@ = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_grib b/libcdi/tests/test_cksum_grib
new file mode 100755
index 0000000..2374062
--- /dev/null
+++ b/libcdi/tests/test_cksum_grib
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=grb
+if [ yes = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_grib.in b/libcdi/tests/test_cksum_grib.in
new file mode 100644
index 0000000..2b9d605
--- /dev/null
+++ b/libcdi/tests/test_cksum_grib.in
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=grb
+if [ @ENABLE_GRIB@ = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_ieg b/libcdi/tests/test_cksum_ieg
new file mode 100755
index 0000000..766b082
--- /dev/null
+++ b/libcdi/tests/test_cksum_ieg
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=ieg
+if [ yes = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_ieg.in b/libcdi/tests/test_cksum_ieg.in
new file mode 100644
index 0000000..9b9ceac
--- /dev/null
+++ b/libcdi/tests/test_cksum_ieg.in
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=ieg
+if [ @ENABLE_IEG@ = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_nc b/libcdi/tests/test_cksum_nc
new file mode 100755
index 0000000..e9adf2c
--- /dev/null
+++ b/libcdi/tests/test_cksum_nc
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=nc
+if [ @ENABLE_NETCDF@ = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_nc.in b/libcdi/tests/test_cksum_nc.in
new file mode 100644
index 0000000..e9adf2c
--- /dev/null
+++ b/libcdi/tests/test_cksum_nc.in
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=nc
+if [ @ENABLE_NETCDF@ = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_nc2 b/libcdi/tests/test_cksum_nc2
new file mode 100755
index 0000000..1e622e8
--- /dev/null
+++ b/libcdi/tests/test_cksum_nc2
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=nc2
+if [ @ENABLE_NC2@ = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_nc2.in b/libcdi/tests/test_cksum_nc2.in
new file mode 100644
index 0000000..1e622e8
--- /dev/null
+++ b/libcdi/tests/test_cksum_nc2.in
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=nc2
+if [ @ENABLE_NC2@ = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_nc4 b/libcdi/tests/test_cksum_nc4
new file mode 100755
index 0000000..3ddad3a
--- /dev/null
+++ b/libcdi/tests/test_cksum_nc4
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=nc4
+if [ @ENABLE_NC4@ = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_nc4.in b/libcdi/tests/test_cksum_nc4.in
new file mode 100644
index 0000000..3ddad3a
--- /dev/null
+++ b/libcdi/tests/test_cksum_nc4.in
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=nc4
+if [ @ENABLE_NC4@ = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_service b/libcdi/tests/test_cksum_service
new file mode 100755
index 0000000..2c05b55
--- /dev/null
+++ b/libcdi/tests/test_cksum_service
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=svc
+if [ yes = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_cksum_service.in b/libcdi/tests/test_cksum_service.in
new file mode 100644
index 0000000..84e15ef
--- /dev/null
+++ b/libcdi/tests/test_cksum_service.in
@@ -0,0 +1,14 @@
+#! /bin/sh
+
+set -e
+format=svc
+if [ @ENABLE_SERVICE@ = yes ]; then
+  exec >test_cksum_$format.log 2>&1
+  ./cksum_write -f $format
+  ./cksum_read example.$format
+  \rm example.cksum example.$format
+  \rm test_cksum_$format.log
+else
+  # skip tests for unsupported formats
+  exit 77
+fi
diff --git a/libcdi/tests/test_grib.c b/libcdi/tests/test_grib.c
new file mode 100644
index 0000000..bd5e112
--- /dev/null
+++ b/libcdi/tests/test_grib.c
@@ -0,0 +1,137 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "cdi.h"
+
+int main(int argc, char *argv[])
+{
+  char fname[] = "test.grb";
+  int filetype = FILETYPE_GRB;
+  int nlat = 18, nlon = 2*nlat;
+  double *data = NULL;
+  double missval;
+  int nlevel;
+  int varID;
+  int datasize = 0;
+  int streamID1, streamID2;
+  int gridID, zaxisID, code, vdate, vtime;
+  int nrecs, nvars;
+  int gridtype, gridsize = 0;
+  int tsID;
+  int timeID = 0;
+  int level, levelID;
+  int offset;
+  int vlistID, taxisID;
+  int nmiss;
+
+
+  datasize = nlon * nlat;
+  data = (double *) malloc(datasize*sizeof(double));
+  memset(data, 0, datasize*sizeof(double));
+
+  gridID = gridCreate(GRID_GAUSSIAN, datasize);
+  gridDefXsize(gridID, nlon);
+  gridDefYsize(gridID, nlat);
+
+  zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
+
+  vlistID = vlistCreate();
+  vlistDefVar(vlistID, gridID, zaxisID, TIME_VARIABLE);
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+  vlistDefTaxis(vlistID, taxisID);
+
+  streamID1 = streamOpenWrite(fname, filetype);
+  if ( streamID1 < 0 )
+    {
+      fprintf(stderr, "Open failed on %s\n", fname);
+      fprintf(stderr, "%s\n", cdiStringError(streamID1));
+      return (-1);
+    }
+
+  streamDefVlist(streamID1, vlistID);
+
+  (void) streamDefTimestep(streamID1, 0);
+
+  streamWriteVar(streamID1, 0, data, 0);
+
+  return (0);
+
+  vlistID = streamInqVlist(streamID1);
+
+  filetype = streamInqFiletype(streamID1);
+
+  streamID2 = streamOpenWrite(fname, filetype);
+  if ( streamID2 < 0 )
+    {
+      fprintf(stderr, "Open failed on %s\n", fname);
+      fprintf(stderr, "%s\n", cdiStringError(streamID2));
+      return (-1);
+    }
+
+  streamDefVlist(streamID2, vlistID);
+
+  nvars = vlistNvars(vlistID);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID, varID);
+      zaxisID  = vlistInqVarZaxis(vlistID, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(zaxisID);
+      if ( gridsize*nlevel > datasize ) datasize = gridsize*nlevel;
+    }
+
+  data = (double *) malloc(datasize*sizeof(double));
+  memset(data, 0, datasize*sizeof(double));
+
+  taxisID = vlistInqTaxis(vlistID);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID);
+      vtime = taxisInqVtime(taxisID);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  streamReadVar(streamID1, varID, data, &nmiss);
+
+	  code     = vlistInqVarCode(vlistID, varID);
+	  gridID   = vlistInqVarGrid(vlistID, varID);
+	  zaxisID  = vlistInqVarZaxis(vlistID, varID);
+	  gridtype = gridInqType(gridID);
+	  gridsize = gridInqSize(gridID);
+	  nlevel   = zaxisInqSize(zaxisID);
+	  missval  = vlistInqVarMissval(vlistID, varID);
+
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      level  = (int) zaxisInqLevel(zaxisID, levelID);
+	      offset = gridsize*levelID;
+	    }
+
+	  streamWriteVar(streamID2, varID, data, nmiss);
+	}
+      tsID++;
+    }
+
+  free(data);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  return (0);
+}
+/*
+ * Local Variables:
+ * c-file-style: "Java"
+ * c-basic-offset: 2
+ * indent-tabs-mode: nil
+ * show-trailing-whitespace: t
+ * require-trailing-newline: t
+ * End:
+ */
diff --git a/libcdi/tests/test_grib.sh b/libcdi/tests/test_grib.sh
new file mode 100755
index 0000000..c66111b
--- /dev/null
+++ b/libcdi/tests/test_grib.sh
@@ -0,0 +1,9 @@
+#! /bin/sh
+
+TEST=test_grib
+
+./${TEST}
+
+result=$?
+
+exit $result
diff --git a/libcdi/tests/var_cksum.c b/libcdi/tests/var_cksum.c
new file mode 100644
index 0000000..da34550
--- /dev/null
+++ b/libcdi/tests/var_cksum.c
@@ -0,0 +1,55 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "var_cksum.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+
+int
+compare_checksums(struct cksum_table a[], size_t a_size, const char *src_a,
+                  struct cksum_table b[], size_t b_size, const char *src_b)
+{
+  int checked_a[a_size], checked_b[b_size];
+  size_t i, j;
+  int retcode = EXIT_SUCCESS;
+
+  for (i = 0; i < a_size; ++i)
+    checked_a[i] = 0;
+  for (j = 0; j < b_size; ++j)
+    checked_b[j] = 0;
+
+  for (j = 0; j < b_size; ++j)
+    for (i = 0; i < a_size; ++i)
+      if (a[i].code == b[j].code)
+      {
+        if (a[i].cksum != b[j].cksum)
+          {
+            fprintf(stderr, "checksum error for varID %d, code %d!\n"
+                    "%08lx != %08lx\n", (int)i, a[i].code,
+                    (unsigned long)a[i].cksum, (unsigned long)b[j].cksum);
+            retcode = EXIT_FAILURE;
+          }
+        checked_a[i] = 1;
+        checked_b[j] = 1;
+        break;
+      }
+
+  for (i = 0; i < a_size; ++i)
+    if (!checked_a[i])
+      {
+        fprintf(stderr, "variable %d, code %d from %s not checked!\n",
+                (int)i, a[i].code, src_a);
+        retcode = EXIT_FAILURE;
+      }
+  for (j = 0; j < b_size; ++j)
+    if (!checked_b[j])
+      {
+        fprintf(stderr, "variable %d, code %d from %s not checked!\n",
+                (int)j, b[j].code, src_b);
+        retcode = EXIT_FAILURE;
+      }
+  return retcode;
+}
+
diff --git a/libcdi/tests/var_cksum.h b/libcdi/tests/var_cksum.h
new file mode 100644
index 0000000..1d18b9b
--- /dev/null
+++ b/libcdi/tests/var_cksum.h
@@ -0,0 +1,19 @@
+#ifndef VAR_CKSUM_H
+#define VAR_CKSUM_H
+
+#include <inttypes.h>
+#include <stdlib.h>
+
+struct cksum_table
+{
+  int code;
+  uint32_t cksum;
+};
+
+/* returns EXIT_SUCCESS if a contains the same entries with the same
+ * checksums as b, EXIT_FAILURE otherwise */
+int
+compare_checksums(struct cksum_table a[], size_t a_size, const char *src_a,
+                  struct cksum_table b[], size_t b_size, const char *src_b);
+
+#endif
diff --git a/libcdi/util/serialrun.in b/libcdi/util/serialrun.in
new file mode 100755
index 0000000..a0fa39d
--- /dev/null
+++ b/libcdi/util/serialrun.in
@@ -0,0 +1,5 @@
+#! @SHELL@
+if [ "$1" = -n ]; then
+   shift ; shift
+fi
+exec "$@"
diff --git a/libcdi/util/sunf95preproc-wrapper b/libcdi/util/sunf95preproc-wrapper
new file mode 100755
index 0000000..49a1d64
--- /dev/null
+++ b/libcdi/util/sunf95preproc-wrapper
@@ -0,0 +1,76 @@
+#! /bin/sh
+if [ "${DEBUG+set}" = set ]; then
+  set -x
+  outputRedir=">&2"
+else
+  outputRedir=">/dev/null 2>&1"
+fi
+while echo "$1" | grep '^-' >/dev/null 2>&1; do
+  FPPFLAGS="${FPPFLAGS+${FPPFLAGS} }\"$1\""
+  shift
+done
+TRAPCMD=':'
+trap 'eval $TRAPCMD' 0
+set -e
+test "${DEBUG+set}" = set && echo "$FPPFLAGS" >&2
+FCFLAGS=${FCFLAGS--EP}
+if [ "${FC+set}" != set ]; then
+  for F90C in sunf95 '' ; do
+    test -n "$F90C" || exit 1
+    set +e
+    F90BIN=`which $F90C 2>/dev/null`
+    set -e
+    test ! -x "$F90BIN" || break
+  done
+fi
+FC=${FC-$F90C}
+# append -fpp if necessary
+IFStr=`echo "$IFS" | sed -n '$!s/$/\\\\n/
+H
+$x
+$s/\n//g
+$P'`
+if echo "$FCFLAGS" \
+  | grep -v '\('"[$IFStr]\\|^\\)-[cf]pp\\([$IFStr]\\|\$\\)" >/dev/null
+then
+  FCFLAGS="${FCFLAGS+$FCFLAGS }-fpp"
+fi
+TMPDIR="${TMPDIR-/tmp}"
+{
+  tmp=`
+  (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
+  ` &&
+  test -n "$tmp" && test -d "$tmp"
+} || {
+  tmp="$TMPDIR/foo$$-$RANDOM"
+  (umask 077 && mkdir "$tmp")
+} || exit $?
+TRAPCMD="$TRAPCMD ; rm -rf \"$tmp\""
+#echo \"$FCFLAGS\"
+for FortranFile in "$@" ; do
+  fppInput=`echo "$FortranFile" | sed 's:.*/::
+s:\.[^./]*:.F90:'`
+  cp "$FortranFile" "$tmp/$fppInput"
+  fppOutput=`echo "$fppInput" | sed 's:.*/::
+s:\.F90:.f90:'`
+  for i in fppOutput ; do
+    if eval test -e \$$i ; then
+      eval backup$i=true
+      eval mv \"\$$i\" \"\$$i.bak\"
+      eval TRAPCMD${i}Save=\"$TRAPCMD\"
+      TRAPCMD="$TRAPCMD ; "`eval echo mv \"\\$$i.bak\" \"\\$$i\"`
+    fi
+  done
+  set +e
+  eval \$FC \$FCFLAGS -F $FPPFLAGS \"\$tmp/\$fppInput\" $outputRedir
+  set -e
+  grep -v '^#' "$fppOutput"
+  test "${DEBUG+set}" = set && cat "$fppOutput" >&2
+  rm "$fppOutput" "$tmp/$fppInput"
+  for i in fppOutput ; do
+    if eval test \"\$backup$i\" = true ; then
+      eval mv \"\$$i.bak\" \"\$$i\"
+      TRAPCMD=`eval echo \\$TRAPCMD\${i}Save`
+    fi
+  done
+done
diff --git a/libcdi/util/sxpreproc-wrapper b/libcdi/util/sxpreproc-wrapper
new file mode 100755
index 0000000..ceae5c9
--- /dev/null
+++ b/libcdi/util/sxpreproc-wrapper
@@ -0,0 +1,59 @@
+#! /bin/sh
+if [ "${DEBUG+set}" = set ]; then
+  set -x
+  outputRedir=">&2"
+else
+  outputRedir=">/dev/null 2>&1"
+fi
+while echo "$1" | grep '^-' >/dev/null 2>&1; do
+  FPPFLAGS="${FPPFLAGS+${FPPFLAGS} }$1"
+  shift
+done
+set -e
+test "${DEBUG+set}" = set && echo "$FPPFLAGS" >&2
+FCFLAGS=${FCFLAGS--EP}
+if [ "${FC+set}" != set ]; then
+  for F90C in sxf90 f90 '' ; do
+    test -n "$F90C" || exit 1
+    set +e
+    F90BIN=`which $F90C 2>/dev/null`
+    set -e
+    test ! -x "$F90BIN" || break
+  done
+fi
+FC=${FC-$F90C}
+IFStr=`echo "$IFS" | sed -n '$!s/$/\\\\n/
+H
+$x
+$s/\n//g
+$P'`
+#translate -Ep to -EP in FCFLAGS
+FCFLAGS=`echo "$FCFLAGS" | sed -e 's/\('"[$IFStr]\\|^\\)-Ep\\([$IFStr]\\|\$\\)"'/\1-EP\2/'`
+# append -EP if necessary
+if echo "$FCFLAGS" \
+  | grep -v '\('"[$IFStr]\\|^\\)-EP\\([$IFStr]\\|\$\\)" >/dev/null
+then
+  FCFLAGS="${FCFLAGS+$FCFLAGS }-EP"
+fi
+TMPDIR="${TMPDIR-/tmp}"
+{
+  tmp=`
+  (umask 077 && mktemp -d "$TMPDIR/fooXXXXXX") 2>/dev/null
+  ` &&
+  test -n "$tmp" && test -d "$tmp"
+} || {
+  tmp=$TMPDIR/foo$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || exit $?
+#echo \"$FCFLAGS\"
+for FortranFile in "$@" ; do
+  fppOutput=`echo "$FortranFile" | sed 's:.*/::
+s:^:'"$tmp/"'i.:'`
+  set +e
+  eval \$FC \$FCFLAGS -ts \"'$tmp'\" \$FPPFLAGS \"\$FortranFile\" $outputRedir
+  set -e
+  cat "$fppOutput" 2>/dev/null
+  test "${DEBUG+set}" = set && cat "$fppOutput" >&2
+  rm "$fppOutput"
+done
+rm -rf "$tmp"
\ No newline at end of file
diff --git a/libcdi/util/xlfpreproc-wrapper b/libcdi/util/xlfpreproc-wrapper
new file mode 100755
index 0000000..647c234
--- /dev/null
+++ b/libcdi/util/xlfpreproc-wrapper
@@ -0,0 +1,22 @@
+#! /bin/sh
+#
+if [ "${DEBUG+set}" = set ]; then
+  set -x
+  outputRedir=">&2"
+else
+  outputRedir=">/dev/null 2>&1"
+fi
+while echo "$1" | grep '^-' >/dev/null 2>&1; do
+  FPPFLAGS="${FPPFLAGS+${FPPFLAGS} }$1"
+  shift
+done
+set -e
+for srcfile in "$@" ; do
+  set +e
+  eval \$FC \$FCFLAGS \$FPPFLAGS -d -qnoobject \"\$srcfile\" $outputRedir
+  set -e
+  FPPOUTNAME=`echo $srcfile | sed -e 's:\(.*/\)*\([^/]*\)\.[^./]*$:F\2.f:'`
+  cat "$FPPOUTNAME" 2>/dev/null
+  test "${DEBUG+set}" = set && cat "$FPPOUTNAME" >&2
+  rm "$FPPOUTNAME"
+done
diff --git a/m4/acx_options.m4 b/m4/acx_options.m4
new file mode 100644
index 0000000..7f339f4
--- /dev/null
+++ b/m4/acx_options.m4
@@ -0,0 +1,466 @@
+AC_DEFUN([ACX_OPTIONS],
+[
+#  ----------------------------------------------------------------------
+#  Checks for multithreaded compiling + linking
+AC_ARG_WITH([threads],
+            [AC_HELP_STRING([--with-threads=<yes/no/directory>],
+                            [Compile + link for multithreading [default=yes]])],
+            [],
+            [with_threads=yes])
+THREADS_INCLUDE=''
+THREADS_LIBS=''
+AS_CASE([$with_threads],
+        [no],[AC_MSG_CHECKING([multithreading])
+              AC_MSG_RESULT([suppressed])],
+        [yes],[AX_PTHREAD([AC_DEFINE([HAVE_LIBPTHREAD],[1],[Define 1 for multithread support])],[AC_MSG_ERROR([multithreaded settings NOT found])])
+               LIBS="$PTHREAD_LIBS $LIBS"
+               CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+               CC="$PTHREAD_CC"
+               AS_ECHO(["CC:$CC CFLAGS:$CFLAGS LIBS:$LIBS"])],
+        [*],[THREADS_ROOT=$with_threads
+             LDFLAGS="-L$THREADS_ROOT/lib $LDFLAGS"
+             CPPFLAGS="-I$THREADS_ROOT/include $CPPFLAGS "
+             AC_CHECK_HEADERS(pthread.h)
+             AC_CHECK_LIB([pthread],[pthread_create])
+             THREADS_LIBS=" -L$THREADS_ROOT/lib -lpthread"
+             THREADS_INCLUDE=" -I$THREADS_ROOT/include"])
+AC_SUBST([THREADS_INCLUDE])
+AC_SUBST([THREADS_LIBS])
+#  ----------------------------------------------------------------------
+#  Link application to ZLIB library, needed for netcdf
+ZLIB_INCLUDE=''
+ZLIB_LIBS=''
+AC_ARG_WITH([zlib],
+            [AS_HELP_STRING([--with-zlib=<yes|no|directory> (default=yes)],[location of ZLIB compression library (lib and include subdirs), nec. for HDF5/NETCDF4])],
+            [AS_CASE(["$with_zlib"],
+                     [no],[AC_MSG_CHECKING([for ZLIB library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS(zlib.h)
+                            AC_SEARCH_LIBS([deflate],[z],[AC_DEFINE([HAVE_LIBZ],[1],[Define 1 for ZLIB support])])
+                            ZLIB_LIBS=" -lz"],
+                     [*],[ZLIB_ROOT=$with_zlib
+                          LDFLAGS="-L$ZLIB_ROOT/lib $LDFLAGS"
+                          CPPFLAGS="-I$ZLIB_ROOT/include $CPPFLAGS"
+                          AC_CHECK_HEADERS(zlib.h)
+                          AC_SEARCH_LIBS([deflate],[z],[AC_DEFINE([HAVE_LIBZ],[1],[Define 1 for ZLIB support])])
+                          ZLIB_INCLUDE=" -I$ZLIB_ROOT/include"
+                          ZLIB_LIBS=" -L$ZLIB_ROOT/lib -lz"])],
+                     [AC_CHECK_HEADERS(zlib.h)
+                      AC_SEARCH_LIBS([deflate],[z],[AC_DEFINE([HAVE_LIBZ],[1],[Define 1 for ZLIB support])])
+              ZLIB_LIBS=" -lz"])
+AC_SUBST([ZLIB_INCLUDE])
+AC_SUBST([ZLIB_LIBS])
+#  ----------------------------------------------------------------------
+#  Compile application with SZLIB library, needed for GRIB1 or for
+#  linking against hdf5/netcdf4
+SZLIB_INCLUDE=''
+SZLIB_LIBS=''
+AC_ARG_WITH([szlib],
+            [AS_HELP_STRING([--with-szlib=<yes|no|directory> (default=no)],[location of szlib library, optional for GRIB1 and NETCDF4 compression])],
+            [AS_CASE(["$with_szlib"],
+                     [no],[AC_MSG_CHECKING([for szlib library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS(szlib.h)
+                            AC_SEARCH_LIBS([SZ_BufftoBuffCompress],
+                                           [sz],
+                                           [AC_DEFINE([HAVE_LIBSZ],[1],[Define to 1 for SZIP support])],
+                                           [AC_MSG_ERROR([Could not link to szlib])])
+                            SZLIB_LIBS=" -lsz"],
+                     [*],[SZLIB_ROOT=$with_szlib
+                          AS_IF([test -d "$SZLIB_ROOT"],
+                                [LDFLAGS="-L$SZLIB_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$SZLIB_ROOT/include $CPPFLAGS"
+                                 AC_CHECK_HEADERS(szlib.h)
+                                 AC_SEARCH_LIBS([SZ_BufftoBuffCompress],
+                                                [sz],
+                                                [AC_DEFINE([HAVE_LIBSZ],[1],[Define to 1 for SZIP support])],
+                                                [AC_MSG_ERROR([Could not link to szlib])])
+                                 SZLIB_LIBS=" -L$SZLIB_ROOT/lib -lsz"
+                                 SZLIB_INCLUDE=" -I$SZLIB_ROOT/include"],
+                                [AC_MSG_NOTICE([$SZLIB_ROOT is not a directory! SZLIB suppressed])])])],
+            [AC_MSG_CHECKING([for szlib library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([SZLIB_INCLUDE])
+AC_SUBST([SZLIB_LIBS])
+#  ----------------------------------------------------------------------
+#  Link application with HDF5 library, required for netcdf4
+HDF5_ROOT=''
+HDF5_INCLUDE=''
+HDF5_LIBS=''
+AC_ARG_WITH([hdf5],
+            [AS_HELP_STRING([--with-hdf5=<yes|no|directory> (default=no)],[location of hdf5 library, NETCDF4 requires hdf5 high level interface])],
+            [AS_CASE(["$with_hdf5"],
+                     [no],[AC_MSG_CHECKING([for hdf5 library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([hdf5.h])
+                            AC_SEARCH_LIBS([H5Fopen],
+                                           [hdf5],
+                                           [AC_DEFINE([HAVE_LIBHDF5],[1],[Define to 1 for HDF5 support])],
+                                           [AC_MSG_ERROR([Cannot link to hdf5 library! It is required for Netcdf4])])
+                            AC_SEARCH_LIBS([H5DSis_scale],
+                                           [hdf5_hl],
+                                           [have_hdf5_hl=yes],
+                                           [AC_MSG_NOTICE([Cannot find hdf5 high level interface! It is required for netCDF4.])
+                                            have_hdf5_hl=no])
+                            AS_IF([test "x$have_libhdf5_hl" = xyes],
+                                  [HDF5_LIBS=" -lhdf5_hl -lhdf5"],
+                                  [HDF5_LIBS=" -lhdf5"])
+                            ],
+                     [*],[AS_IF([test -d "$with_hdf5"],
+                                [HDF5_ROOT="$with_hdf5"
+                                 LDFLAGS="-L$HDF5_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$HDF5_ROOT/include $CPPFLAGS"
+                                 AC_CHECK_HEADERS([hdf5.h])
+                                 AC_SEARCH_LIBS([H5Fopen],
+                                                [hdf5],
+                                                [AC_DEFINE([HAVE_LIBHDF5],[1],[Define to 1 for HDF5 support])],
+                                                [AC_MSG_ERROR([Cannot link to hdf5! It is required for netCDF4.])])
+                                 AC_SEARCH_LIBS([H5DSis_scale],
+                                                [hdf5_hl],
+                                                [have_hdf5_hl=yes],
+                                                [AC_MSG_NOTICE([Cannot link to hdf5 high level interface! It is required for netCDF4.\
+                                                                HDF5 must be built with zlib; the location of zlib must be specified for HDF5 with the \
+                                                                --with-zlib option. If HDF5 was also built with szlib, then the location of szlib must also be \
+                                                                specified with the --with-szlib option..])
+                                                have_hdf5_hl=no])
+                                 AS_IF([test "x$have_libhdf5_hl" = 'xyes'],
+                                       [HDF5_LIBS=" -L$HDF5_ROOT/lib -lhdf5_hl -lhdf5"],
+                                       [HDF5_LIBS=" -L$HDF5_ROOT/lib -lhdf5"])
+                                 HDF5_INCLUDE=" -I$HDF5_ROOT/include"],
+                                [AC_MSG_NOTICE([$with_hdf5 is not a directory! HDF5 suppressed])])])],
+            [AC_MSG_CHECKING([for hdf5 library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([HDF5_ROOT])
+AC_SUBST([HDF5_INCLUDE])
+AC_SUBST([HDF5_LIBS])
+#  ----------------------------------------------------------------------
+#  Compile application with netcdf
+NETCDF_ROOT=''
+NETCDF_INCLUDE=''
+NETCDF_LIBS=''
+AC_ARG_WITH([netcdf],
+            [AS_HELP_STRING([--with-netcdf=<yes|no|directory> (default=yes)],[location of netcdf library (lib and include subdirs)])],
+            [AS_CASE(["$with_netcdf"],
+                     [no],[AC_MSG_CHECKING([for netcdf library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([netcdf.h])
+                            AC_SEARCH_LIBS([nc_open],
+                                           [netcdf],
+                                           [AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NETCDF support])],
+                                           [AC_MSG_ERROR([Could not link to netcdf library])])
+                            NETCDF_LIBS=" -lnetcdf"
+                            AC_CHECK_PROG(NC_CONFIG,nc-config,nc-config)
+                            AS_IF([test "x$NC_CONFIG" != "x"],
+                                  [AC_MSG_CHECKING([netcdf's nc2 support])
+                                   AS_IF([test "x$($NC_CONFIG --has-nc2)" = "xyes"],
+                                         [AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NETCDF2 support])
+                                          AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
+                                   AC_MSG_CHECKING([netcdf's nc4 support])
+                                   AS_IF([test "x$($NC_CONFIG --has-nc4)" = "xyes"],
+                                         [AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NETCDF4 support])
+                                          AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])],
+                                  [AS_ECHO([Could not find nc-config! go on with default configuration])])],
+                     [*],[AS_IF([test -d "$with_netcdf"],
+                                [NETCDF_ROOT=$with_netcdf
+                                 LDFLAGS="-L$NETCDF_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$NETCDF_ROOT/include $CPPFLAGS"
+                                 AC_CHECK_HEADERS([netcdf.h])
+                                 AC_SEARCH_LIBS([nc_open],
+                                                [netcdf],
+                                                [AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NETCDF support])],
+                                                [AC_MSG_ERROR([Could not link to netcdf library])])
+                                 NETCDF_LIBS=" -L$NETCDF_ROOT/lib -lnetcdf"
+                                 NETCDF_INCLUDE=" -I$NETCDF_ROOT/include"
+
+                                 AC_MSG_CHECKING([nc-config script])
+                                 AC_CHECK_PROG(NC_CONFIG,nc-config,[$NETCDF_ROOT/bin/nc-config],,["$NETCDF_ROOT/bin"])
+                                 AS_IF([test "x$NC_CONFIG" != "x"],
+                                   [AC_MSG_CHECKING([netcdf's OpenDAP support])
+                                   AS_IF([test "x$($NC_CONFIG --has-dap)" = "xyes"],
+                                         [AC_DEFINE([HAVE_LIBNC_DAP],[1],[Define to 1 for NETCDF OpenDAP])
+                                          AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])]
+                                   [AC_MSG_CHECKING([netcdf's nc2 support])
+                                   AS_IF([test "x$($NC_CONFIG --has-nc2)" = "xyes"],
+                                         [AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NETCDF2 support])
+                                          AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
+                                   AC_MSG_CHECKING([netcdf's nc4 support])
+                                   AS_IF([test "x$($NC_CONFIG --has-nc4)" = "xyes"],
+                                         [AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NETCDF4 support])
+                                          AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])],
+                                   [AC_MSG_RESULT([Could not find nc-config! go on with default configuration])])],
+                                [AC_MSG_NOTICE([$with_netcdf is not a directory! NETCDF suppressed])])])],
+            [AC_MSG_CHECKING([for NETCDF library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([NETCDF_ROOT])
+AC_SUBST([NETCDF_INCLUDE])
+AC_SUBST([NETCDF_LIBS])
+#  ----------------------------------------------------------------------
+#  Link application with JASPER library (needed for GRIB2 compression)
+JASPER_LIBS=''
+AC_ARG_WITH([jasper],
+            [AS_HELP_STRING([--with-jasper=<directory>],
+                            [Specify location of JASPER library. You must specify its location if GRIB_API was built with JASPER.])],
+            [AS_CASE(["$with_jasper"],
+                     [no],[AC_MSG_CHECKING([for jasper library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([jasper.h])
+                            AC_SEARCH_LIBS([jas_init],[jasper],[AC_DEFINE([HAVE_LIBJASPER],[1],[Define to 1 for JPEG compression for GRIB2])],
+                                           [AC_MSG_ERROR([Could not link to jasper library! Required for GRIB_API])])
+                            AC_SUBST([JASPER_LIBS],[" -ljasper"])],
+                     [*],[JASPER_ROOT=$with_jasper
+                          AS_IF([test -d "$JASPER_ROOT"],
+                                [LDFLAGS="$LDFLAGS -L$JASPER_ROOT/lib"
+                                 CPPFLAGS="$CPPFLAGS -I$JASPER_ROOT/include"
+                                 AC_SEARCH_LIBS([jas_stream_memopen],
+                                                [jasper],
+                                                [AC_DEFINE([HAVE_LIBJASPER],[1],[Define to 1 for JPEG compression for GRIB2])],
+                                                [AC_MSG_ERROR([Could not link to jasper library! Required for GRIB_API])])
+                                 JASPER_LIBS=" -L$JASPER_ROOT/lib -ljasper"],
+                                [AC_MSG_ERROR([$JASPER_ROOT is not a directory! JASPER suppressed])])])],
+            [AC_MSG_CHECKING([for the JASPER library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([JASPER_LIBS])
+#  ----------------------------------------------------------------------
+#  Compile application with GRIB_API library (for GRIB2 support)
+GRIB_API_INCLUDE=''
+GRIB_API_LIBS=''
+AC_ARG_WITH([grib_api],
+            [AS_HELP_STRING([--with-grib_api=<yes|no|directory>],
+                            [library for grib2 compression; if a directory is given, it will be used as a value for --with-jasper-root])],
+            [AS_CASE(["$with_grib_api"],
+                     [no],[AC_MSG_CHECKING([for GRIB_API library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([grib_api.h])
+                            AC_SEARCH_LIBS([grib_get_message],
+                                           [grib_api],
+                                           [AC_DEFINE([HAVE_LIBGRIB_API],[1],[GRIB_API library is present if defined to 1])],
+                                           [AC_MSG_ERROR([Could not link to grib_api library])])],
+                     [*],[GRIB_API_ROOT=$with_grib_api
+                          AS_IF([test -d "$GRIB_API_ROOT"],
+                                [LDFLAGS="-L$GRIB_API_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$GRIB_API_ROOT/include $CPPFLAGS"
+                                 AC_CHECK_HEADERS([grib_api.h])
+                                 AC_SEARCH_LIBS([grib_get_message],
+                                                [grib_api],
+                                                [AC_DEFINE([HAVE_LIBGRIB_API],[1],[GRIB_API library is present if defined to 1])],
+                                                [AC_MSG_ERROR([Could not link to grib_api library])])
+                                 GRIB_API_LIBS=" -L$GRIB_API_ROOT/lib -lgrib_api"
+                                 GRIB_API_INCLUDE=" -I$GRIB_API_ROOT/include"],
+                                [AC_MSG_ERROR([$GRIB_API_ROOT is not a directory! GRIB_API suppressed])])])],
+            [AC_MSG_CHECKING([for the GRIB_API library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([GRIB_API_INCLUDE])
+AC_SUBST([GRIB_API_LIBS])
+#  ----------------------------------------------------------------------
+#  Enable GRIB support
+AC_MSG_CHECKING([for GRIB support])
+AC_ARG_ENABLE([grib],
+              [AS_HELP_STRING([--enable-grib],[GRIB support [default=yes]])],
+              [AS_IF([test "x$enable_grib" != 'xno'],
+                     [AC_DEFINE(HAVE_LIBGRIB, [1], [Define to 1 for GRIB support])
+                      enable_grib=yes])],
+              [AC_DEFINE(HAVE_LIBGRIB, [1], [Define to 1 for GRIB support])
+               enable_grib=yes])
+AC_MSG_RESULT([$enable_grib])
+AC_SUBST([ENABLE_GRIB],[$enable_grib])
+#  ----------------------------------------------------------------------
+#  Compile interface with internal CGRIBEX library
+AC_MSG_CHECKING([for CGRIBEX support])
+AC_ARG_ENABLE([cgribex],
+              [AC_HELP_STRING([--enable-cgribex],[Use the CGRIBEX library [default=yes]])],
+              [AS_IF([test "x$enable_cgribex" != 'xno'],
+                     [AC_DEFINE(HAVE_LIBCGRIBEX,[1],[Define to 1 for GRIB1 decoding/encoding with cgribex])
+                      enable_cgribex=yes])],
+              [AC_DEFINE(HAVE_LIBCGRIBEX,[1],[Define to 1 for GRIB1 decoding/encoding with cgribex])
+               enable_cgribex=yes])
+AC_MSG_RESULT([$enable_cgribex])
+AC_SUBST([ENABLE_CGRIBEX],[$enable_cgribex])
+#  ----------------------------------------------------------------------
+#  Compile interface with internal SERVICE library
+AC_MSG_CHECKING([for SERVICE support])
+AC_ARG_ENABLE([service],
+              [AC_HELP_STRING([--enable-service],[Use the service library [default=yes]])],
+              [AS_IF([test "x$enable_service" != 'xno'],
+                     [AC_DEFINE(HAVE_LIBSERVICE,[1],[Define to 1 for SERVICE interface])
+                      enable_service=yes])],
+              [AC_DEFINE(HAVE_LIBSERVICE,[1],[Define to 1 for SERVICE interface])
+               enable_service=yes])
+AC_MSG_RESULT([$enable_service])
+AC_SUBST([ENABLE_SERVICE],[$enable_service])
+#  ----------------------------------------------------------------------
+#  Compile interface with internal EXTRA library
+AC_MSG_CHECKING([for EXTRA support])
+AC_ARG_ENABLE([extra],
+              [AC_HELP_STRING([--enable-extra],[Use the extra library [default=yes]])],
+              [AS_IF([test "x$enable_extra" != 'xno'],
+                     [AC_DEFINE(HAVE_LIBEXTRA,[1],[Define to 1 for EXTRA interface])
+                      enable_extra=yes])],
+              [AC_DEFINE(HAVE_LIBEXTRA,[1],[Define to 1 for EXTRA interface])
+               enable_extra=yes])
+AC_MSG_RESULT([$enable_extra])
+AC_SUBST([ENABLE_EXTRA],[$enable_extra])
+#  ----------------------------------------------------------------------
+#  Compile interface with internal IEG library
+AC_MSG_CHECKING([for IEG support])
+AC_ARG_ENABLE([ieg],
+              [AC_HELP_STRING([--enable-ieg],[Use the ieg library [default=yes]])],
+              [AS_IF([test "x$enable_ieg" != 'xno'],
+                     [AC_DEFINE(HAVE_LIBIEG,[1],[Define to 1 for IEG interface])
+                      enable_ieg=yes])],
+              [AC_DEFINE(HAVE_LIBIEG,[1],[Define to 1 for IEG interface])
+               enable_ieg=yes])
+AC_MSG_RESULT([$enable_ieg])
+AC_SUBST([ENABLE_IEG],[$enable_ieg])
+#  ----------------------------------------------------------------------
+#  Checks for PROJ.4 library
+AC_ARG_WITH([proj],
+            [AS_HELP_STRING([--with-proj=<directory>],
+                            [Specify location of PROJ library for cartographic projections.])],
+            [AS_CASE(["$with_proj"],
+                     [no],[AC_MSG_CHECKING([for proj library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([proj_api.h])
+                            AC_SEARCH_LIBS([pj_init],[proj],[AC_DEFINE([HAVE_LIBPROJ],[1],[Define to 1 for PROJ support])],
+                                           [AC_MSG_ERROR([Could not link to PROJ library!])])
+                            AC_SUBST([PROJ_LDFLAGS],[" -lproj"])
+                            AC_SUBST([PROJ_INCLUDE],[""])],
+                     [*],[PROJ_ROOT=$with_proj
+                          AS_IF([test -d "$PROJ_ROOT"],
+                                [LDFLAGS="-L$PROJ_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$PROJ_ROOT/include $CPPFLAGS"
+                                 AC_CHECK_HEADERS([proj_api.h])
+                                 AC_SEARCH_LIBS([pj_init],
+                                                [proj],
+                                                [AC_DEFINE([HAVE_LIBPROJ],[1],[Define to 1 for PROJ support])],
+                                                [AC_MSG_ERROR([Could not link to PROJ library!])])
+                                 AC_SUBST([PROJ_LDFLAGS],[" -L$PROJ_ROOT/lib -lproj"])
+                                 AC_SUBST([PROJ_INCLUDE],[" -I$PROJ_ROOT/include"])],
+                                [AC_MSG_ERROR([$PROJ_ROOT is not a directory! PROJ suppressed])])])],
+            [AC_MSG_CHECKING([for the PROJ library])
+             AC_MSG_RESULT([suppressed])])
+#  ----------------------------------------------------------------------
+#  Link application with UDUNITS2 library
+AC_ARG_WITH([udunits2],
+            [AS_HELP_STRING([--with-udunits2=<directory>],
+                            [Specify location of UDUNITS2 library.])],
+            [AS_CASE(["$with_udunits2"],
+                     [no],[AC_MSG_CHECKING([for udunits2 library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([udunits2.h])
+                            AC_SEARCH_LIBS([ut_parse],[udunits2],[AC_DEFINE([HAVE_LIBUDUNITS2],[1],[Define to 1 for UDUNITS2 support])],
+                                           [AC_MSG_ERROR([Could not link to udunits2 library!])])
+                            AC_SUBST([UDUNITS_LDFLAGS],[" -ludunits2"])
+                            AC_SUBST([UDUNITS_INCLUDE],[""])],
+                     [*],[UDUNITS_ROOT=$with_udunits2
+                          AS_IF([test -d "$UDUNITS_ROOT"],
+                                [LDFLAGS="$LDFLAGS -L$UDUNITS_ROOT/lib"
+                                 CPPFLAGS="$CPPFLAGS -I$UDUNITS_ROOT/include"
+                                 AC_CHECK_HEADERS([udunits2.h])
+                                 AC_SEARCH_LIBS([ut_parse],
+                                                [udunits2],
+                                                [AC_DEFINE([HAVE_LIBUDUNITS2],[1],[Define to 1 for UDUNITS2 support])],
+                                                [AC_MSG_ERROR([Could not link to udunits2 library!])])
+                                 AC_SUBST([UDUNITS_LDFLAGS],[" -L$UDUNITS_ROOT/lib -ludunits2"])
+                                 AC_SUBST([UDUNITS_INCLUDE],[" -I$UDUNITS_ROOT/include"])],
+                                [AC_MSG_ERROR([$UDUNITS_ROOT is not a directory! UDUNITS2 suppressed])])])],
+            [AC_MSG_CHECKING([for the UDUNITS2 library])
+             AC_MSG_RESULT([suppressed])])
+#  ----------------------------------------------------------------------
+#  Compile application with MAGICS (xml required)
+MAGICS_ROOT=''
+MAGICS_INCLUDE=''
+MAGICS_LIBS=''
+AC_ARG_WITH([magics],
+            [AS_HELP_STRING([--with-magics=<yes|no|directory>],[location of magics library (lib and include subdirs)])],
+            [AS_CASE(["$with_magics"],
+                     [no],[AC_MSG_CHECKING([for magics library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[AC_CHECK_HEADERS([magics_api.h])
+                            AC_SEARCH_LIBS([mag_open],
+                                           [MagPlus],
+                                           [AC_DEFINE([HAVE_LIBMAGICS],[1],[Define to 1 for MAGICS support])],
+                                           [AC_MSG_ERROR([Could not link to magics library])])
+                            AC_SUBST([MAGICS_LIBS],[" -lMagPlus"])],
+                     [*],[AS_IF([test -d "$with_magics"],
+                                [MAGICS_ROOT=$with_magics
+                                 LDFLAGS="-L$MAGICS_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$MAGICS_ROOT/include/magics $CPPFLAGS"
+                                 AC_CHECK_HEADERS([magics_api.h])
+                                 AC_SEARCH_LIBS([mag_open],
+                                                [MagPlus],
+                                                [AC_DEFINE([HAVE_LIBMAGICS],[1],[Define to 1 for MAGICS support])],
+                                                [AC_MSG_ERROR([Could not link to magics library])])
+                                 MAGICS_LIBS=" -L$MAGICS_ROOT/lib -lMagPlus"
+                                 MAGICS_INCLUDE=" -I$MAGICS_ROOT/include/magics"],
+                                [AC_MSG_NOTICE([$with_magics is not a directory! MAGICS suppressed])])])],
+            [AC_MSG_CHECKING([for MAGICS library])
+             AC_MSG_RESULT([suppressed])])
+AC_SUBST([MAGICS_ROOT])
+AC_SUBST([MAGICS_INCLUDE])
+AC_SUBST([MAGICS_LIBS])
+AC_ARG_WITH([libxml2],
+            [AS_HELP_STRING([--with-libxml2=<yes|no|directory>],[location of libxml2 library (lib and include subdirs)])],
+            [AS_CASE(["$with_libxml2"],
+                     [no],[AC_MSG_CHECKING([for libxml2 library])
+                           AC_MSG_RESULT([suppressed])],
+                     [yes],[CPPFLAGS="$CPPFLAGS -I/usr/include/libxml2"
+                            AC_CHECK_HEADERS([libxml/parser.h])
+                            AC_CHECK_HEADERS([libxml/tree.h])
+                            AC_SEARCH_LIBS([xmlInitMemory],
+                                           [xml2],
+                                           [AC_DEFINE([HAVE_LIBXML2],[1],[Define to 1 for XML2 support])],
+                                           [AC_MSG_ERROR([Could not link to libxml2 library])])
+                            AC_SUBST([XML2_LIBS],[" -lxml2"])],
+                     [*],[AS_IF([test -d "$with_libxml2"],
+                                [XML2_ROOT=$with_libxml2
+                                 LDFLAGS="-L$XML2_ROOT/lib $LDFLAGS"
+                                 CPPFLAGS="-I$XML2_ROOT/include/libxml2 $CPPFLAGS"
+                                 AC_CHECK_HEADERS([libxml/parser.h])
+                                 AC_CHECK_HEADERS([libxml/tree.h])
+                                 AC_SEARCH_LIBS([xmlInitMemory],
+                                                [xml2],
+                                                [AC_DEFINE([HAVE_LIBXML2],[1],[Define to 1 for XML2 support])],
+                                                [AC_MSG_ERROR([Could not link to libxml2 library])])
+                                 XML2_LIBS=" -L$XML2_ROOT/lib -lxml2"
+                                 XML2_INCLUDE=" -I$XML2_ROOT/include/libxml2"],
+                                [AC_MSG_NOTICE([$with_libxml2 is not a directory! XML2 suppressed])])])],
+            [AC_MSG_CHECKING([for XML2 library])
+             AC_MSG_RESULT([suppressed])])
+AM_CONDITIONAL([ENABLE_MAGICS],[test ! x$with_magics = 'x' -a ! x$with_libxml2 = 'x'])
+#  ----------------------------------------------------------------------
+#  How to build CDI into CDO? 
+INTERNAL_CDI_DIR=libcdi
+# At the moment, there are two possible CDI bindings
+# (default)          linking directly to CDI's object files, i.e. a libtool
+#                    convenience library
+# (--enable-cdi-lib) build and link to a shared CDI library
+AC_MSG_CHECKING([for build a separate CDI library and link CDO to it])
+AC_ARG_ENABLE([cdi-lib],
+              [AS_HELP_STRING([--enable-cdi-lib],[build, install and link to a CDI library [default=no]])],
+              [AS_IF([test "x$enable_cdi_lib" != "xno"],
+                     [enable_cdi_lib=yes],
+                     [enable_cdi_lib=no
+                      CDO_DISABLE_CDILIB=1
+                      export CDO_DISABLE_CDILIB])],
+              [enable_cdi_lib=no
+               CDO_DISABLE_CDILIB=1
+               export CDO_DISABLE_CDILIB])
+AC_MSG_RESULT([$enable_cdi_lib])
+# save CDI binding mode for later automake use
+AM_CONDITIONAL([ENABLE_CDI_LIB],[test x$enable_cdi_lib = 'xyes'])
+# create shell variables for the representation of configure results
+AS_IF([test x$enable_cdi_lib = 'xno'],[AC_SUBST([ENABLE_CDI_LIB],[false])],[AC_SUBST([ENABLE_CDI_LIB],[true])])
+# scan for CDI as a subproject
+AC_CONFIG_SUBDIRS([libcdi])
+#  ----------------------------------------------------------------------
+#  Build a static CDO
+AC_MSG_CHECKING([for building an additional static CDO binary])
+AC_ARG_ENABLE([all-static],
+              [AS_HELP_STRING([--enable-all-static],[build a completely statically linked CDO binary [default=no]])],
+              [AS_IF([test "x$enable_all_static" != "xno"],
+                     [enable_all_static=yes],
+                     [enable_all_static=no])],
+              [enable_all_static=no])
+AC_MSG_RESULT([$enable_all_static])
+AM_CONDITIONAL([ENABLE_ALL_STATIC],[test x$enable_all_static = 'xyes'])
+])
diff --git a/m4/ax_pthread.m4 b/m4/ax_pthread.m4
new file mode 100644
index 0000000..2152a80
--- /dev/null
+++ b/m4/ax_pthread.m4
@@ -0,0 +1,283 @@
+# ===========================================================================
+#        http://www.gnu.org/software/autoconf-archive/ax_pthread.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+#
+# DESCRIPTION
+#
+#   This macro figures out how to build C programs using POSIX threads. It
+#   sets the PTHREAD_LIBS output variable to the threads library and linker
+#   flags, and the PTHREAD_CFLAGS output variable to any special C compiler
+#   flags that are needed. (The user can also force certain compiler
+#   flags/libs to be tested by setting these environment variables.)
+#
+#   Also sets PTHREAD_CC to any special C compiler that is needed for
+#   multi-threaded programs (defaults to the value of CC otherwise). (This
+#   is necessary on AIX to use the special cc_r compiler alias.)
+#
+#   NOTE: You are assumed to not only compile your program with these flags,
+#   but also link it with them as well. e.g. you should link with
+#   $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
+#
+#   If you are only building threads programs, you may wish to use these
+#   variables in your default LIBS, CFLAGS, and CC:
+#
+#     LIBS="$PTHREAD_LIBS $LIBS"
+#     CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+#     CC="$PTHREAD_CC"
+#
+#   In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
+#   has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name
+#   (e.g. PTHREAD_CREATE_UNDETACHED on AIX).
+#
+#   ACTION-IF-FOUND is a list of shell commands to run if a threads library
+#   is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it
+#   is not found. If ACTION-IF-FOUND is not specified, the default action
+#   will define HAVE_PTHREAD.
+#
+#   Please let the authors know if this macro fails on any platform, or if
+#   you have any other suggestions or comments. This macro was based on work
+#   by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help
+#   from M. Frigo), as well as ac_pthread and hb_pthread macros posted by
+#   Alejandro Forero Cuervo to the autoconf macro repository. We are also
+#   grateful for the helpful feedback of numerous users.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Steven G. Johnson <stevenj at alum.mit.edu>
+#
+#   This program is free software: you can redistribute it and/or modify it
+#   under the terms of the GNU General Public License as published by the
+#   Free Software Foundation, either version 3 of the License, or (at your
+#   option) any later version.
+#
+#   This program is distributed in the hope that it will be useful, but
+#   WITHOUT ANY WARRANTY; without even the implied warranty of
+#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
+#   Public License for more details.
+#
+#   You should have received a copy of the GNU General Public License along
+#   with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 11
+
+AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
+AC_DEFUN([AX_PTHREAD], [
+AC_REQUIRE([AC_CANONICAL_HOST])
+AC_LANG_SAVE
+AC_LANG_C
+ax_pthread_ok=no
+
+# We used to check for pthread.h first, but this fails if pthread.h
+# requires special compiler flags (e.g. on True64 or Sequent).
+# It gets checked for in the link test anyway.
+
+# First of all, check if the user has set any of the PTHREAD_LIBS,
+# etcetera environment variables, and if threads linking works using
+# them:
+if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS])
+        AC_TRY_LINK_FUNC(pthread_join, ax_pthread_ok=yes)
+        AC_MSG_RESULT($ax_pthread_ok)
+        if test x"$ax_pthread_ok" = xno; then
+                PTHREAD_LIBS=""
+                PTHREAD_CFLAGS=""
+        fi
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+fi
+
+# We must check for the threads library under a number of different
+# names; the ordering is very important because some systems
+# (e.g. DEC) have both -lpthread and -lpthreads, where one of the
+# libraries is broken (non-POSIX).
+
+# Create a list of thread flags to try.  Items starting with a "-" are
+# C compiler flags, and other items are library names, except for "none"
+# which indicates that we try without any flags at all, and "pthread-config"
+# which is a program returning the flags for the Pth emulation library.
+
+ax_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config"
+
+# The ordering *is* (sometimes) important.  Some notes on the
+# individual items follow:
+
+# pthreads: AIX (must check this before -lpthread)
+# none: in case threads are in libc; should be tried before -Kthread and
+#       other compiler flags to prevent continual compiler warnings
+# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h)
+# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able)
+# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread)
+# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads)
+# -pthreads: Solaris/gcc
+# -mthreads: Mingw32/gcc, Lynx/gcc
+# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it
+#      doesn't hurt to check since this sometimes defines pthreads too;
+#      also defines -D_REENTRANT)
+#      ... -mt is also the pthreads flag for HP/aCC
+# pthread: Linux, etcetera
+# --thread-safe: KAI C++
+# pthread-config: use pthread-config program (for GNU Pth library)
+
+case "${host_cpu}-${host_os}" in
+        *solaris*)
+
+        # On Solaris (at least, for some versions), libc contains stubbed
+        # (non-functional) versions of the pthreads routines, so link-based
+        # tests will erroneously succeed.  (We need to link with -pthreads/-mt/
+        # -lpthread.)  (The stubs are missing pthread_cleanup_push, or rather
+        # a function called by this macro, so we could check for that, but
+        # who knows whether they'll stub that too in a future libc.)  So,
+        # we'll just look for -pthreads and -lpthread first:
+
+        ax_pthread_flags="-pthreads pthread -mt -pthread $ax_pthread_flags"
+        ;;
+
+	*-darwin*)
+	ax_pthread_flags="-pthread $ax_pthread_flags"
+	;;
+esac
+
+if test x"$ax_pthread_ok" = xno; then
+for flag in $ax_pthread_flags; do
+
+        case $flag in
+                none)
+                AC_MSG_CHECKING([whether pthreads work without any flags])
+                ;;
+
+                -*)
+                AC_MSG_CHECKING([whether pthreads work with $flag])
+                PTHREAD_CFLAGS="$flag"
+                ;;
+
+		pthread-config)
+		AC_CHECK_PROG(ax_pthread_config, pthread-config, yes, no)
+		if test x"$ax_pthread_config" = xno; then continue; fi
+		PTHREAD_CFLAGS="`pthread-config --cflags`"
+		PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`"
+		;;
+
+                *)
+                AC_MSG_CHECKING([for the pthreads library -l$flag])
+                PTHREAD_LIBS="-l$flag"
+                ;;
+        esac
+
+        save_LIBS="$LIBS"
+        save_CFLAGS="$CFLAGS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Check for various functions.  We must include pthread.h,
+        # since some functions may be macros.  (On the Sequent, we
+        # need a special flag -Kthread to make this header compile.)
+        # We check for pthread_join because it is in -lpthread on IRIX
+        # while pthread_create is in libc.  We check for pthread_attr_init
+        # due to DEC craziness with -lpthreads.  We check for
+        # pthread_cleanup_push because it is one of the few pthread
+        # functions on Solaris that doesn't have a non-functional libc stub.
+        # We try pthread_create on general principles.
+        AC_TRY_LINK([#include <pthread.h>
+		     static void routine(void* a) {a=0;}
+		     static void* start_routine(void* a) {return a;}],
+                    [pthread_t th; pthread_attr_t attr;
+                     pthread_create(&th,0,start_routine,0);
+                     pthread_join(th, 0);
+                     pthread_attr_init(&attr);
+                     pthread_cleanup_push(routine, 0);
+                     pthread_cleanup_pop(0); ],
+                    [ax_pthread_ok=yes])
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        AC_MSG_RESULT($ax_pthread_ok)
+        if test "x$ax_pthread_ok" = xyes; then
+                break;
+        fi
+
+        PTHREAD_LIBS=""
+        PTHREAD_CFLAGS=""
+done
+fi
+
+# Various other checks:
+if test "x$ax_pthread_ok" = xyes; then
+        save_LIBS="$LIBS"
+        LIBS="$PTHREAD_LIBS $LIBS"
+        save_CFLAGS="$CFLAGS"
+        CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
+
+        # Detect AIX lossage: JOINABLE attribute is called UNDETACHED.
+	AC_MSG_CHECKING([for joinable pthread attribute])
+	attr_name=unknown
+	for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do
+	    AC_TRY_LINK([#include <pthread.h>], [int attr=$attr; return attr;],
+                        [attr_name=$attr; break])
+	done
+        AC_MSG_RESULT($attr_name)
+        if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then
+            AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name,
+                               [Define to necessary symbol if this constant
+                                uses a non-standard name on your system.])
+        fi
+
+        AC_MSG_CHECKING([if more special flags are required for pthreads])
+        flag=no
+        case "${host_cpu}-${host_os}" in
+            *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";;
+            *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";;
+        esac
+        AC_MSG_RESULT(${flag})
+        if test "x$flag" != xno; then
+            PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS"
+        fi
+
+        LIBS="$save_LIBS"
+        CFLAGS="$save_CFLAGS"
+
+        # More AIX lossage: must compile with xlc_r or cc_r
+	if test x"$GCC" != xyes; then
+          AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC})
+        else
+          PTHREAD_CC=$CC
+	fi
+else
+        PTHREAD_CC="$CC"
+fi
+
+AC_SUBST(PTHREAD_LIBS)
+AC_SUBST(PTHREAD_CFLAGS)
+AC_SUBST(PTHREAD_CC)
+
+# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
+if test x"$ax_pthread_ok" = xyes; then
+        ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1])
+        :
+else
+        ax_pthread_ok=no
+        $2
+fi
+AC_LANG_RESTORE
+])dnl AX_PTHREAD
diff --git a/m4/libtool.m4 b/m4/libtool.m4
new file mode 100644
index 0000000..22924a8
--- /dev/null
+++ b/m4/libtool.m4
@@ -0,0 +1,7437 @@
+# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
+#
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+#                 Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
+#                 Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+		   [m4_fatal([Libtool version $1 or higher is required],
+		             63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\	*)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+
+_LT_DECL([], [host_alias], [0], [The host system])dnl
+_LT_DECL([], [host], [0])dnl
+_LT_DECL([], [host_os], [0])dnl
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+	[m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+	[lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+	[tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+	   m4_quote(lt_decl_varnames),
+	m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+			lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+					   [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+	dnl If the libtool generation code has been placed in $CONFIG_LT,
+	dnl instead of duplicating it all over again into config.status,
+	dnl then we will have config.status run $CONFIG_LT later, so it
+	dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable.  If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins.  After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script.  The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool at gnu.org>."
+
+lt_cl_version="\
+m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
+m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
+configured by $[0], generated by m4_PACKAGE_STRING.
+
+Copyright (C) 2010 Free Software Foundation, Inc.
+This config.lt script is free software; the Free Software Foundation
+gives unlimited permision to copy, distribute and modify it."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_XSI_SHELLFNS
+
+  sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
+    || (rm -f "$cfgfile"; exit 1)
+
+  mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+m4_case([$1],
+  [C],			[_LT_LANG(C)],
+  [C++],		[_LT_LANG(CXX)],
+  [Java],		[_LT_LANG(GCJ)],
+  [Fortran 77],		[_LT_LANG(F77)],
+  [Fortran],		[_LT_LANG(FC)],
+  [Windows Resource],	[_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _LT_LANG
+
+
+# _LT_LANG_DEFAULT_CONFIG
+# -----------------------
+m4_defun([_LT_LANG_DEFAULT_CONFIG],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+	[m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+	[m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([LT_PROG_GCJ],
+	[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+
+AC_PROVIDE_IFELSE([LT_PROG_RC],
+  [LT_LANG(RC)],
+  [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+	# By default we will add the -single_module flag. You can override
+	# by either setting the environment variable LT_MULTI_MODULE
+	# non-empty at configure time, or by adding -multi_module to the
+	# link flags.
+	rm -rf libconftest.dylib*
+	echo "int foo(void){return 1;}" > conftest.c
+	echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+	$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+	  -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+	if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+	  lt_cv_apple_cc_single_mod=yes
+	else
+	  cat conftest.err >&AS_MESSAGE_LOG_FD
+	fi
+	rm -rf libconftest.dylib*
+	rm -f conftest.*
+      fi])
+    AC_CACHE_CHECK([for -exported_symbols_list linker flag],
+      [lt_cv_ld_exported_symbols_list],
+      [lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+	[lt_cv_ld_exported_symbols_list=yes],
+	[lt_cv_ld_exported_symbols_list=no])
+	LDFLAGS="$save_LDFLAGS"
+    ])
+    AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
+      [lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
+      _lt_result=$?
+      if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+	lt_cv_ld_force_load=yes
+      else
+	cat conftest.err >&AS_MESSAGE_LOG_FD
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+	10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+	10.[[012]]*)
+	  _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+	10.*)
+	  _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES
+# --------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  if test "$lt_cv_ld_force_load" = "yes"; then
+    _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+  else
+    _LT_TAGVAR(whole_archive_flag_spec, $1)=''
+  fi
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX
+# -----------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+AC_LINK_IFELSE(AC_LANG_PROGRAM,[
+lt_aix_libpath_sed='
+    /Import File Strings/,/^$/ {
+	/^0/ {
+	    s/^0  *\(.*\)$/\1/
+	    p
+	}
+    }'
+aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+# Check for a 64-bit object if we didn't find anything.
+if test -z "$aix_libpath"; then
+  aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+fi],[])
+if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`print -r -- -n 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*" 
+}
+
+case "$ECHO" in
+  printf*) AC_MSG_RESULT([printf]) ;;
+  print*) AC_MSG_RESULT([print -r]) ;;
+  *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+	HPUX_IA64_MODE="32"
+	;;
+      *ELF-64*)
+	HPUX_IA64_MODE="64"
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -melf32bsmip"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -melf32bmipn32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -melf64bmip"
+	;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+	*32-bit*)
+	  LD="${LD-ld} -32"
+	  ;;
+	*N32*)
+	  LD="${LD-ld} -n32"
+	  ;;
+	*64-bit*)
+	  LD="${LD-ld} -64"
+	  ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \
+s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_i386_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_i386"
+	    ;;
+	  ppc64-*linux*|powerpc64-*linux*)
+	    LD="${LD-ld} -m elf32ppclinux"
+	    ;;
+	  s390x-*linux*)
+	    LD="${LD-ld} -m elf_s390"
+	    ;;
+	  sparc64-*linux*)
+	    LD="${LD-ld} -m elf32_sparc"
+	    ;;
+	esac
+	;;
+      *64-bit*)
+	case $host in
+	  x86_64-*kfreebsd*-gnu)
+	    LD="${LD-ld} -m elf_x86_64_fbsd"
+	    ;;
+	  x86_64-*linux*)
+	    LD="${LD-ld} -m elf_x86_64"
+	    ;;
+	  ppc*-*linux*|powerpc*-*linux*)
+	    LD="${LD-ld} -m elf64ppc"
+	    ;;
+	  s390*-*linux*|s390*-*tpf*)
+	    LD="${LD-ld} -m elf64_s390"
+	    ;;
+	  sparc*-*linux*)
+	    LD="${LD-ld} -m elf64_sparc"
+	    ;;
+	esac
+	;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+sparc*-*solaris*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      yes*) LD="${LD-ld} -m elf64_sparc" ;;
+      *)
+	if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
+	  LD="${LD-ld} -64"
+	fi
+	;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[AC_CHECK_TOOL(AR, ar, false)
+test -z "$AR" && AR=ar
+test -z "$AR_FLAGS" && AR_FLAGS=cru
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1])
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#		[OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536	# usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    lt_cv_sys_max_cmd_len=196608
+    ;;
+
+  osf*)
+    # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
+    # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[	 ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # If test is not a shell built-in, we'll probably end up computing a
+      # maximum length that is only half of the actual maximum length, but
+      # we can't tell.
+      while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+	         = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+	      test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL		RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL		DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL		0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW		RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW		DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW	RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW	DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW	0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+void fnord () __attribute__((visibility("default")));
+#endif
+
+void fnord () { int i=42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+	  if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+	}
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+	  [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+	    [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+	[AC_CHECK_FUNC([dlopen],
+	      [lt_cv_dlopen="dlopen"],
+	  [AC_CHECK_LIB([dl], [dlopen],
+		[lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+	    [AC_CHECK_LIB([svld], [dlopen],
+		  [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+	      [AC_CHECK_LIB([dld], [dld_link],
+		    [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+	      ])
+	    ])
+	  ])
+	])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+	  lt_cv_dlopen_self, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+	    lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+	  lt_cv_dlopen_self_static, [dnl
+	  _LT_TRY_DLOPEN_SELF(
+	    lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+	    lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+	 [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+	 [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+	 [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+	[Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+	[], [
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+	lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+  shlibpath_var=LIBPATH
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+	   echo ' yes '
+	   echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+	:
+      else
+	can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  version_type=linux
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$host_os in
+  yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    ;;
+
+  *)
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    ;;
+  esac
+  dynamic_linker='Win32 ld.exe'
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+freebsd1*)
+  dynamic_linker=no
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[123]]*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+gnu*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  hardcode_into_libs=yes
+  ;;
+
+haiku*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  dynamic_linker="$host_os runtime_loader"
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[[3-9]]*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+	if test "$lt_cv_prog_gnu_ld" = yes; then
+		version_type=linux
+	else
+		version_type=irix
+	fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+    [lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+	 LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+	 [lt_cv_shlibpath_overrides_runpath=yes])])
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+    ])
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[	 ]*hwcap[	 ]/d;s/[:,	]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*)	need_version=yes ;;
+    *)				need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+	shlibpath_overrides_runpath=no
+	;;
+      *)
+	shlibpath_overrides_runpath=yes
+	;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    version_type=linux
+    library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
+    soname_spec='$libname${shared_ext}.$major'
+    shlibpath_var=LD_LIBRARY_PATH
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+	;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/Linux.
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  version_type=linux
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+	case $deplibs_check_method in
+	"file_magic "*)
+	  file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+	  MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+	  if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+	    $EGREP "$file_magic_regex" > /dev/null; then
+	    :
+	  else
+	    cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool at gnu.org
+
+_LT_EOF
+	  fi ;;
+	esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+	 [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+	[assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+	ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+	test "$with_gnu_ld" != no && break
+	;;
+      *)
+	test "$with_gnu_ld" != yes && break
+	;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be Linux ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method == "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+	# Check to see if the nm accepts a BSD-compat flag.
+	# Adding the `sed 1q' prevents false positives on HP-UX, which says:
+	#   nm: unknown option "B" ignored
+	# Tru64's nm complains that /dev/null is an invalid object file
+	case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+	*/dev/null* | *'Invalid file or object type'*)
+	  lt_cv_path_NM="$tmp_nm -B"
+	  break
+	  ;;
+	*)
+	  case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+	  */dev/null*)
+	    lt_cv_path_NM="$tmp_nm -p"
+	    break
+	    ;;
+	  *)
+	    lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+	    continue # so that we can try to find one that supports BSD flags
+	    ;;
+	  esac
+	  ;;
+	esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+  AC_SUBST([DUMPBIN])
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+  esac
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+	[Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # which start with @ or ?.
+    lt_cv_sys_global_symbol_pipe="$AWK ['"\
+"     {last_section=section; section=\$ 3};"\
+"     /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+"     \$ 0!~/External *\|/{next};"\
+"     / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[	 ]]\($symcode$symcode*\)[[	 ]][[	 ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+	mv -f "$nlist"T "$nlist"
+      else
+	rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+	if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+	  cat <<_LT_EOF > conftest.$ac_ext
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+	  # Now generate the symbol file.
+	  eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+	  cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+const struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+	  $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+	  cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+	  # Now try linking the two files.
+	  mv conftest.$ac_objext conftstm.$ac_objext
+	  lt_save_LIBS="$LIBS"
+	  lt_save_CFLAGS="$CFLAGS"
+	  LIBS="conftstm.$ac_objext"
+	  CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+	  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+	    pipe_works=yes
+	  fi
+	  LIBS="$lt_save_LIBS"
+	  CFLAGS="$lt_save_CFLAGS"
+	else
+	  echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+	fi
+      else
+	echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+AC_MSG_CHECKING([for $compiler option to produce PIC])
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+	# All AIX code is PIC.
+	if test "$host_cpu" = ia64; then
+	  # AIX 5 now supports IA64 processor
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	else
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+	fi
+	;;
+      chorus*)
+	case $cc_basename in
+	cxch68*)
+	  # Green Hills C++ Compiler
+	  # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+	  ;;
+	esac
+	;;
+      dgux*)
+	case $cc_basename in
+	  ec++*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  ghcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      freebsd* | dragonfly*)
+	# FreeBSD uses GNU C++
+	;;
+      hpux9* | hpux10* | hpux11*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    if test "$host_cpu" != ia64; then
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	    fi
+	    ;;
+	  aCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+	    case $host_cpu in
+	    hppa*64*|ia64*)
+	      # +Z the default
+	      ;;
+	    *)
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	      ;;
+	    esac
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      interix*)
+	# This is c89, which is MS Visual C++ (no shared libs)
+	# Anyone wants to do a port?
+	;;
+      irix5* | irix6* | nonstopux*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    # CC pic flag -KPIC is the default.
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+	case $cc_basename in
+	  KCC*)
+	    # KAI C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    ;;
+	  ecpc* )
+	    # old Intel C++ for x86_64 which still supported -KPIC.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  icpc* )
+	    # Intel C++, used to be incompatible with GCC.
+	    # ICC 10 doesn't accept -KPIC any more.
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+	    ;;
+	  pgCC* | pgcpp*)
+	    # Portland Group C++ compiler
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  cxx*)
+	    # Compaq C++
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+	    # IBM XL 8.0, 9.0 on PPC and BlueGene
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+      lynxos*)
+	;;
+      m88k*)
+	;;
+      mvs*)
+	case $cc_basename in
+	  cxx*)
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      netbsd*)
+	;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+	case $cc_basename in
+	  KCC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+	    ;;
+	  RCC*)
+	    # Rational C++ 2.4.1
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  cxx*)
+	    # Digital/Compaq C++
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    # Make sure the PIC flag is empty.  It appears that all Alpha
+	    # Linux and Compaq Tru64 Unix objects are PIC.
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      psos*)
+	;;
+      solaris*)
+	case $cc_basename in
+	  CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+	    ;;
+	  gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sunos4*)
+	case $cc_basename in
+	  CC*)
+	    # Sun C++ 4.x
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	  lcc*)
+	    # Lucid
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+	case $cc_basename in
+	  CC*)
+	    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	    ;;
+	esac
+	;;
+      tandem*)
+	case $cc_basename in
+	  NCC*)
+	    # NonStop-UX NCC 3.20
+	    _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	    ;;
+	  *)
+	    ;;
+	esac
+	;;
+      vxworks*)
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+	;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+	# AIX 5 now supports IA64 processor
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+	[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+	# +Z the default
+	;;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+	;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+	;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+	# which looks to be a dead project)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+	# IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+	;;
+      *)
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ F* | *Sun*Fortran*)
+	  # Sun Fortran 8.3 passes all unrecognized flags to the linker
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)=''
+	  ;;
+	*Sun\ C*)
+	  # Sun C 5.9
+	  _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+	  _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+	  _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+	  ;;
+	esac
+	;;
+      esac
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+	_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+	_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+	_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+	[How to pass a linker flag through the compiler])
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t at m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+	[Additional compiler flags for building library objects])
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+	[Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  case $host_os in
+  aix[[4-9]]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+  ;;
+  cygwin* | mingw* | cegcc*)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  ;;
+  esac
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+	# The AIX port of GNU ld has always aspired to compatibility
+	# with the native linker.  However, as the warning in the GNU ld
+	# block says, versions before 2.19.5* couldn't really create working
+	# shared libraries, regardless of the interface used.
+	case `$LD -v 2>&1` in
+	  *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+	  *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+	  *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+	  *)
+	    lt_use_gnu_ld_interface=yes
+	    ;;
+	esac
+	;;
+      *)
+	lt_use_gnu_ld_interface=yes
+	;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	# support --undefined.  This deserves some investigation.  FIXME
+	_LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+	# If the export-symbols file already is a .def file (1st line
+	# is EXPORTS), use it as is; otherwise, prepend...
+	_LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	  cp $export_symbols $output_objdir/$soname.def;
+	else
+	  echo EXPORTS > $output_objdir/$soname.def;
+	  cat $export_symbols >> $output_objdir/$soname.def;
+	fi~
+	$CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    haiku*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+	case $cc_basename in
+	  diet\ *) tmp_diet=yes;;	# linux-dietlibc with static linking (!diet-dyn)
+	esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+	 && test "$tmp_diet" = no
+      then
+	tmp_addflag=
+	tmp_sharedflag='-shared'
+	case $cc_basename,$host_cpu in
+        pgcc*)				# Portland Group C compiler
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag'
+	  ;;
+	pgf77* | pgf90* | pgf95* | pgfortran*)
+					# Portland Group f77 and f90 compilers
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  tmp_addflag=' $pic_flag -Mnomain' ;;
+	ecc*,ia64* | icc*,ia64*)	# Intel C compiler on ia64
+	  tmp_addflag=' -i_dynamic' ;;
+	efc*,ia64* | ifort*,ia64*)	# Intel Fortran compiler on ia64
+	  tmp_addflag=' -i_dynamic -nofor_main' ;;
+	ifc* | ifort*)			# Intel Fortran compiler
+	  tmp_addflag=' -nofor_main' ;;
+	lf95*)				# Lahey Fortran 8.1
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+	  tmp_sharedflag='--shared' ;;
+	xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+	  tmp_sharedflag='-qmkshrobj'
+	  tmp_addflag= ;;
+	nvcc*)	# Cuda Compiler Driver 2.2
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  ;;
+	esac
+	case `$CC -V 2>&1 | sed 5q` in
+	*Sun\ C*)			# Sun C 5.9
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	  _LT_TAGVAR(compiler_needs_object, $1)=yes
+	  tmp_sharedflag='-G' ;;
+	*Sun\ F*)			# Sun Fortran 8.3
+	  tmp_sharedflag='-G' ;;
+	esac
+	_LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	    cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	    echo "local: *; };" >> $output_objdir/$libname.ver~
+	    $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+	case $cc_basename in
+	xlf* | bgf* | bgxlf* | mpixlf*)
+	  # IBM XL Fortran 10.1 on PPC cannot create shared libs itself
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
+	  if test "x$supports_anon_versioning" = xyes; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+	      cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+	      echo "local: *; };" >> $output_objdir/$libname.ver~
+	      $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+	  fi
+	  ;;
+	esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+	wlarc=
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+	;;
+	*)
+	  # For security reasons, it is highly recommended that you always
+	  # use absolute paths for naming shared libraries, and exclude the
+	  # DT_RUNPATH tag from executables and libraries.  But doing so
+	  # requires that you compile everything twice, which is a pain.
+	  if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+	  else
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	  fi
+	;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+	# Neither direct hardcoding nor static linking is supported with a
+	# broken collect2.
+	_LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test "$host_cpu" = ia64; then
+	# On IA64, the linker does run time linking by default, so we don't
+	# have to do anything special.
+	aix_use_runtimelinking=no
+	exp_sym_flag='-Bexport'
+	no_entry_flag=""
+      else
+	# If we're using GNU nm, then we don't want the "-C" option.
+	# -C means demangle to AIX nm, but means don't demangle with GNU nm
+	# Also, AIX nm treats weak defined symbols like other global
+	# defined symbols, whereas GNU nm marks them as "W".
+	if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	else
+	  _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+	fi
+	aix_use_runtimelinking=no
+
+	# Test if we are trying to use run time linking or normal
+	# AIX style linking. If -brtl is somewhere in LDFLAGS, we
+	# need to do runtime linking.
+	case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	  for ld_flag in $LDFLAGS; do
+	  if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+	    aix_use_runtimelinking=yes
+	    break
+	  fi
+	  done
+	  ;;
+	esac
+
+	exp_sym_flag='-bexport'
+	no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+      if test "$GCC" = yes; then
+	case $host_os in aix4.[[012]]|aix4.[[012]].*)
+	# We only want to do this on AIX 4.2 and lower, the check
+	# below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	   strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	  # We have reworked collect2
+	  :
+	  else
+	  # We have old collect2
+	  _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	  # It fails to find uninstalled libraries when the uninstalled
+	  # path is not listed in the libpath.  Setting hardcode_minus_L
+	  # to unsupported forces relinking
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+	  ;;
+	esac
+	shared_flag='-shared'
+	if test "$aix_use_runtimelinking" = yes; then
+	  shared_flag="$shared_flag "'${wl}-G'
+	fi
+      else
+	# not using gcc
+	if test "$host_cpu" = ia64; then
+	# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	# chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+	else
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag='${wl}-G'
+	  else
+	    shared_flag='${wl}-bM:SRE'
+	  fi
+	fi
+      fi
+
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+	# Warning - without using the other runtime loading flags (-brtl),
+	# -berok will link without error, but may produce a broken library.
+	_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+	if test "$host_cpu" = ia64; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	  _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+	else
+	 # Determine the default libpath from the value encoded in an
+	 # empty executable.
+	 _LT_SYS_MODULE_PATH_AIX
+	 _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	  # Warning - without using the other run time loading flags,
+	  # -berok will link without error, but may produce a broken library.
+	  _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	  _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	  if test "$with_gnu_ld" = yes; then
+	    # We only use this code for GNU lds that support --whole-archive.
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	  else
+	    # Exported symbols can be pulled into shared objects from archives
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	  fi
+	  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  # This is similar to how AIX traditionally builds its shared libraries.
+	  _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+	fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      # Tell ltmain to make .lib files, not .a files.
+      libext=lib
+      # Tell ltmain to make .dll files, not .so files.
+      shrext_cmds=".dll"
+      # FIXME: Setting linknames here is a bad hack.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+      # The linker will automatically build a .lib file if we build a DLL.
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+      # FIXME: Should let the user specify the lib program.
+      _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+      _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    freebsd1*)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+
+    # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
+    # support.  Future versions do this automatically, but an explicit c++rt0.o
+    # does not break anything, and helps significantly (at the cost of a little
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# hardcode_minus_L: Not really in the search PATH,
+	# but as the default location of the library.
+	_LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	esac
+      else
+	case $host_cpu in
+	hppa*64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	ia64*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	m4_if($1, [], [
+	  # Older versions of the 11.00 compiler do not understand -b yet
+	  # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+	  _LT_LINKER_OPTION([if $CC understands -b],
+	    _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+	    [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+	    [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+	  [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+	  ;;
+	esac
+      fi
+      if test "$with_gnu_ld" = no; then
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	case $host_cpu in
+	hppa*64*|ia64*)
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  ;;
+	*)
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+	  # hardcode_minus_L: Not really in the search PATH,
+	  # but as the default location of the library.
+	  _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	  ;;
+	esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	# Try to use the -exported_symbol ld option, if it does not
+	# work, assume that -exports_file does not work either and
+	# implicitly export all symbols.
+        save_LDFLAGS="$LDFLAGS"
+        LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+        AC_LINK_IFELSE(int foo(void) {},
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+        )
+        LDFLAGS="$save_LDFLAGS"
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd*)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+	_LT_TAGVAR(hardcode_direct, $1)=yes
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	else
+	  case $host_os in
+	   openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+	     _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	     ;;
+	   *)
+	     _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+	     _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	     ;;
+	  esac
+	fi
+      else
+	_LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)	# as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+	_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+	$CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+	# Both c and cxx compiler support -rpath directly
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test "$GCC" = yes; then
+	wlarc='${wl}'
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+	case `$CC -V 2>&1` in
+	*"Compilers 5.0"*)
+	  wlarc=''
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+	  ;;
+	*)
+	  wlarc='${wl}'
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	  $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+	  ;;
+	esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+	# The compiler driver will combine and reorder linker options,
+	# but understands `-z linker_flag'.  GCC discards it without `$wl',
+	# but is careful enough not to reorder.
+	# Supported since Solaris 2.6 (maybe 2.5.1?)
+	if test "$GCC" = yes; then
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+	else
+	  _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	fi
+	;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+	# Use $CC to link under sequent, because it throws in some extra .o
+	# files that make .init and .fini sections work.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+	sni)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+	;;
+	siemens)
+	  ## LD is ld it makes a PLAMLIB
+	  ## CC just makes a GrossModule.
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+	  _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+	motorola)
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	  _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+	;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+	_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	runpath_var=LD_RUN_PATH
+	hardcode_runpath_var=yes
+	_LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+	_LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+	;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+	[lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+	[$RM conftest*
+	echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+	if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+	  soname=conftest
+	  lib=conftest
+	  libobjs=conftest.$ac_objext
+	  deplibs=
+	  wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+	  pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+	  compiler_flags=-v
+	  linker_flags=-v
+	  verstring=
+	  output_objdir=.
+	  libname=conftest
+	  lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+	  _LT_TAGVAR(allow_undefined_flag, $1)=
+	  if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+	  then
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	  else
+	    lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	  fi
+	  _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+	else
+	  cat conftest.err 1>&5
+	fi
+	$RM conftest*
+	])
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
+    [Flag to hardcode $libdir into a binary during linking.
+    This must work even if $libdir does not exist])
+_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
+    [[If ld is used when linking, flag to hardcode $libdir into a binary
+    during linking.  This must work even if $libdir does not exist]])
+_LT_TAGDECL([], [hardcode_libdir_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [fix_srcfile_path], [1],
+    [Fix the shell variable $srcfile for the compiler])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report which library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC=$CC
+  lt_save_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+	  $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+	    for ld_flag in $LDFLAGS; do
+	      case $ld_flag in
+	      *-brtl*)
+	        aix_use_runtimelinking=yes
+	        break
+	        ;;
+	      esac
+	    done
+	    ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+	  collect2name=`${CC} -print-prog-name=collect2`
+	  if test -f "$collect2name" &&
+	     strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+	  then
+	    # We have reworked collect2
+	    :
+	  else
+	    # We have old collect2
+	    _LT_TAGVAR(hardcode_direct, $1)=unsupported
+	    # It fails to find uninstalled libraries when the uninstalled
+	    # path is not listed in the libpath.  Setting hardcode_minus_L
+	    # to unsupported forces relinking
+	    _LT_TAGVAR(hardcode_minus_L, $1)=yes
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=
+	  fi
+          esac
+          shared_flag='-shared'
+	  if test "$aix_use_runtimelinking" = yes; then
+	    shared_flag="$shared_flag "'${wl}-G'
+	  fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+	  # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+	  # chokes on -Wl,-G. The following line is correct:
+	  shared_flag='-G'
+          else
+	    if test "$aix_use_runtimelinking" = yes; then
+	      shared_flag='${wl}-G'
+	    else
+	      shared_flag='${wl}-bM:SRE'
+	    fi
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+	# export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+	    _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+	    # Determine the default libpath from the value encoded in an
+	    # empty executable.
+	    _LT_SYS_MODULE_PATH_AIX
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+	    # Warning - without using the other run time loading flags,
+	    # -berok will link without error, but may produce a broken library.
+	    _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+	    _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+	    if test "$with_gnu_ld" = yes; then
+	      # We only use this code for GNU lds that support --whole-archive.
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    else
+	      # Exported symbols can be pulled into shared objects from archives
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+	    fi
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+	    # This is similar to how AIX traditionally builds its shared
+	    # libraries.
+	    _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+	if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+	  _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+	  # Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
+	  # support --undefined.  This deserves some investigation.  FIXME
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+	  # FIXME: insert proper C++ library support
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	  ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+        # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+        # as there is no search path for DLLs.
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+        _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+        _LT_TAGVAR(always_export_symbols, $1)=no
+        _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+        if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+          # If the export-symbols file already is a .def file (1st line
+          # is EXPORTS), use it as is; otherwise, prepend...
+          _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+	    cp $export_symbols $output_objdir/$soname.def;
+          else
+	    echo EXPORTS > $output_objdir/$soname.def;
+	    cat $export_symbols >> $output_objdir/$soname.def;
+          fi~
+          $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+        else
+          _LT_TAGVAR(ld_shlibs, $1)=no
+        fi
+        ;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+	;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          ghcx*)
+	    # Green Hills C++ Compiler
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      freebsd[[12]]*)
+        # C++ shared libraries reported to be fairly broken before
+	# switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      gnu*)
+        ;;
+
+      haiku*)
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+				             # but as the default
+				             # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+	  _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+	      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+					         # but as the default
+					         # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          aCC*)
+	    case $host_cpu in
+	      hppa*64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      ia64*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	      *)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	        ;;
+	    esac
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test $with_gnu_ld = no; then
+	        case $host_cpu in
+	          hppa*64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          ia64*)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	          *)
+	            _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	            ;;
+	        esac
+	      fi
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+	_LT_TAGVAR(hardcode_direct, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+	# Instead, shared libraries are loaded at an image base (0x10000000 by
+	# default) and relocated if they conflict, which is a slow very memory
+	# consuming and fragmenting process.  To avoid this, we pick a random,
+	# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+	# time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	_LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+	;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+	    # SGI C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    if test "$GXX" = yes; then
+	      if test "$with_gnu_ld" = no; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+	      else
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+	      fi
+	    fi
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+	    ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+	    ;;
+	  icpc* | ecpc* )
+	    # Intel C++
+	    with_gnu_ld=yes
+	    # version 8.0 and above of icpc choke on multiply defined symbols
+	    # if we add $predep_objects and $postdep_objects, however 7.1 and
+	    # earlier do not add the objects themselves.
+	    case `$CC -V 2>&1` in
+	      *"Version 7."*)
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	      *)  # Version 8.0 or newer
+	        tmp_idyn=
+	        case $host_cpu in
+		  ia64*) tmp_idyn=' -i_dynamic';;
+		esac
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+		_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+		;;
+	    esac
+	    _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+	    ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+	    case `$CC -V` in
+	    *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+	      _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+		compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+	      _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+		$AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+		$RANLIB $oldlib'
+	      _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+		rm -rf $tpldir~
+		$CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+		$CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    *) # Version 6 and above use weak symbols
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+	      ;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+	  cxx*)
+	    # Compaq C++
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+	    runpath_var=LD_RUN_PATH
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+	    ;;
+	  xl* | mpixl* | bgxl*)
+	    # IBM XL 8.0 on PPC, with GNU ld
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+	    if test "x$supports_anon_versioning" = xyes; then
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+		cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+		echo "local: *; };" >> $output_objdir/$libname.ver~
+		$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+	    fi
+	    ;;
+	  *)
+	    case `$CC -V 2>&1 | sed 5q` in
+	    *Sun\ C*)
+	      # Sun C++ 5.9
+	      _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	      _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	      _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	      _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+	      _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+	      # Not sure whether something based on
+	      # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+	      # would be better.
+	      output_verbose_link_cmd='func_echo_all'
+
+	      # Archives containing C++ object files must be created using
+	      # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	      # necessary to make sure instantiated templates are included
+	      # in the archive.
+	      _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	      ;;
+	    esac
+	    ;;
+	esac
+	;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	  *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+	esac
+	;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+	  _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+	  wlarc=
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	fi
+	# Workaround some broken pre-1.5 toolchains
+	output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+	;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+	;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+	_LT_TAGVAR(ld_shlibs, $1)=no
+	;;
+
+      openbsd*)
+	if test -f /usr/libexec/ld.so; then
+	  _LT_TAGVAR(hardcode_direct, $1)=yes
+	  _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	  _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+	  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	  if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+	    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+	    _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+	  fi
+	  output_verbose_link_cmd=func_echo_all
+	else
+	  _LT_TAGVAR(ld_shlibs, $1)=no
+	fi
+	;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+	    # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+	    # KCC will only create a shared library if the output file
+	    # ends with ".so" (or ".sl" for HP-UX), so rename the library
+	    # to its proper name (with version) after linking.
+	    _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Archives containing C++ object files must be created using
+	    # the KAI C++ compiler.
+	    case $host in
+	      osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+	      *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+	    esac
+	    ;;
+          RCC*)
+	    # Rational C++ 2.4.1
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          cxx*)
+	    case $host in
+	      osf3*)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+		;;
+	      *)
+	        _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+	          echo "-hidden">> $lib.exp~
+	          $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+	          $RM $lib.exp'
+	        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+		;;
+	    esac
+
+	    _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	    # Commands to make compiler produce verbose output that lists
+	    # what "hidden" libraries, object files and flags are used when
+	    # linking a shared library.
+	    #
+	    # There doesn't appear to be a way to prevent this compiler from
+	    # explicitly linking system object files so we need to strip them
+	    # from the output so that they don't get included in the library
+	    # dependencies.
+	    output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+	    ;;
+	  *)
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+	      case $host in
+	        osf3*)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	        *)
+	          _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+		  ;;
+	      esac
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+	      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+	      # Commands to make compiler produce verbose output that lists
+	      # what "hidden" libraries, object files and flags are used when
+	      # linking a shared library.
+	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+	    else
+	      # FIXME: insert proper C++ library support
+	      _LT_TAGVAR(ld_shlibs, $1)=no
+	    fi
+	    ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+	    # Sun C++ 4.x
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          lcc*)
+	    # Lucid
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+	    # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+	    _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+	      $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+	    _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	    case $host_os in
+	      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+	      *)
+		# The compiler driver will combine and reorder linker options,
+		# but understands `-z linker_flag'.
+	        # Supported since Solaris 2.6 (maybe 2.5.1?)
+		_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+	        ;;
+	    esac
+	    _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+	    output_verbose_link_cmd='func_echo_all'
+
+	    # Archives containing C++ object files must be created using
+	    # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+	    # necessary to make sure instantiated templates are included
+	    # in the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+	    ;;
+          gcx*)
+	    # Green Hills C++ Compiler
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+	    # The C++ compiler must be used to create the archive.
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+	    ;;
+          *)
+	    # GNU C++ compiler with Solaris linker
+	    if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+	      _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+	      if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      else
+	        # g++ 2.7 appears to require `-G' NOT `-shared' on this
+	        # platform.
+	        _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+	        _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+		  $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+	        # Commands to make compiler produce verbose output that lists
+	        # what "hidden" libraries, object files and flags are used when
+	        # linking a shared library.
+	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+	      fi
+
+	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+	      case $host_os in
+		solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+		*)
+		  _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+		  ;;
+	      esac
+	    fi
+	    ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+	*)
+	  _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	  ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+	# Note: We can NOT use -z defs as we might desire, because we do not
+	# link with -lc, and that would cause any symbols used from libc to
+	# always be unresolved, which means just about no library would
+	# ever link correctly.  If we're not using GNU ld we use -z text
+	# though, which does catch some bad symbols but isn't as heavy-handed
+	# as -z defs.
+	_LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+	_LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+	_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+	_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+	_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+	_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+	_LT_TAGVAR(link_all_deplibs, $1)=yes
+	_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+	runpath_var='LD_RUN_PATH'
+
+	case $cc_basename in
+          CC*)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+	      '"$_LT_TAGVAR(old_archive_cmds, $1)"
+	    _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+	      '"$_LT_TAGVAR(reload_cmds, $1)"
+	    ;;
+	  *)
+	    _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+	    ;;
+	esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+	    # NonStop-UX NCC 3.20
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+          *)
+	    # FIXME: insert proper C++ library support
+	    _LT_TAGVAR(ld_shlibs, $1)=no
+	    ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_LT_EOF
+])
+dnl Parse the compiler output and extract the necessary
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case $p in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+	 prev=$p
+	 continue
+       else
+	 prev=
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 case $p in
+	 -L* | -R*)
+	   # Internal compiler library paths should come after those
+	   # provided the user.  The postdeps already come after the
+	   # user supplied libs so there is no need to process them.
+	   if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+	   else
+	     _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+	   fi
+	   ;;
+	 # The "-l" case would never come before the object being
+	 # linked, so don't bother handling this case.
+	 esac
+       else
+	 if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+	   _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+	 else
+	   _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+	 fi
+       fi
+       ;;
+
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+	 pre_test_object_deps_done=yes
+	 continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+	 if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+	   _LT_TAGVAR(predep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+	 fi
+       else
+	 if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+	   _LT_TAGVAR(postdep_objects, $1)="$p"
+	 else
+	   _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+	 fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${F77-"f77"}
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(export_dynamic_flag_spec, $1)=
+_LT_TAGVAR(hardcode_direct, $1)=no
+_LT_TAGVAR(hardcode_direct_absolute, $1)=no
+_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
+_LT_TAGVAR(hardcode_libdir_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # ltmain only uses $CC for tagged configurations so make sure $CC is set.
+  _LT_TAG_COMPILER
+
+  # save warnings/boilerplate of simple test code
+  _LT_COMPILER_BOILERPLATE
+  _LT_LINKER_BOILERPLATE
+
+  # Allow CC to be a program name with arguments.
+  lt_save_CC="$CC"
+  lt_save_GCC=$GCC
+  CC=${FC-"f95"}
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+	if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+	  test "$enable_shared" = yes && enable_static=no
+	fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## CAVEAT EMPTOR:
+    ## There is no encapsulation within the following macros, do not change
+    ## the running order or otherwise move them around unless you know exactly
+    ## what you are doing...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GCJ-"gcj"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+  _LT_COMPILER_NO_RTTI($1)
+  _LT_COMPILER_PIC($1)
+  _LT_COMPILER_C_O($1)
+  _LT_COMPILER_FILE_LOCKS($1)
+  _LT_LINKER_SHLIBS($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+
+  _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC="$lt_save_CC"
+])# _LT_LANG_GCJ_CONFIG
+
+
+# _LT_LANG_RC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for the Windows resource compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC="$CC"
+lt_save_GCC=$GCC
+GCC=
+CC=${RC-"windres"}
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC="$lt_save_CC"
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+
+
+# LT_PROG_RC
+# ----------
+AC_DEFUN([LT_PROG_RC],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_XSI_SHELLFNS
+# ---------------------
+# Bourne and XSI compatible variants of some useful shell functions.
+m4_defun([_LT_PROG_XSI_SHELLFNS],
+[case $xsi_shell in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result="${1##*/}"
+}
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+  case ${1} in
+    */*) func_dirname_result="${1%/*}${2}" ;;
+    *  ) func_dirname_result="${3}" ;;
+  esac
+  func_basename_result="${1##*/}"
+}
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+func_stripname ()
+{
+  # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+  # positional parameters, so assign one to ordinary parameter first.
+  func_stripname_result=${3}
+  func_stripname_result=${func_stripname_result#"${1}"}
+  func_stripname_result=${func_stripname_result%"${2}"}
+}
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=${1%%=*}
+  func_opt_split_arg=${1#*=}
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  case ${1} in
+    *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+    *)    func_lo2o_result=${1} ;;
+  esac
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=${1%.*}.lo
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=$(( $[*] ))
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=${#1}
+}
+
+_LT_EOF
+    ;;
+  *) # Bourne compatible functions.
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+  # Extract subdirectory from the argument.
+  func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+  if test "X$func_dirname_result" = "X${1}"; then
+    func_dirname_result="${3}"
+  else
+    func_dirname_result="$func_dirname_result${2}"
+  fi
+}
+
+# func_basename file
+func_basename ()
+{
+  func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+}
+
+dnl func_dirname_and_basename
+dnl A portable version of this function is already defined in general.m4sh
+dnl so there is no need for it here.
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+  case ${2} in
+    .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+    *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+}
+
+# sed scripts:
+my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
+my_sed_long_arg='1s/^-[[^=]]*=//'
+
+# func_opt_split
+func_opt_split ()
+{
+  func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
+  func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
+}
+
+# func_lo2o object
+func_lo2o ()
+{
+  func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+}
+
+# func_xform libobj-or-source
+func_xform ()
+{
+  func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
+}
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+  func_arith_result=`expr "$[@]"`
+}
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+  func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
+}
+
+_LT_EOF
+esac
+
+case $lt_shell_append in
+  yes)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]+=\$[2]"
+}
+_LT_EOF
+    ;;
+  *)
+    cat << \_LT_EOF >> "$cfgfile"
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+  eval "$[1]=\$$[1]\$[2]"
+}
+
+_LT_EOF
+    ;;
+  esac
+])
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
new file mode 100644
index 0000000..17cfd51
--- /dev/null
+++ b/m4/ltoptions.m4
@@ -0,0 +1,369 @@
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+#   Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+	    [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+		      [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+  		   [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+	[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_shared=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+	[Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+	[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_static=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+	[Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+	IFS="$lt_save_ifs"
+	if test "X$pkg" = "X$p"; then
+	  enable_fast_install=yes
+	fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+	 [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# MODE is either `yes' or `no'.  If omitted, it defaults to `both'.
+m4_define([_LT_WITH_PIC],
+[AC_ARG_WITH([pic],
+    [AS_HELP_STRING([--with-pic],
+	[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [pic_mode="$withval"],
+    [pic_mode=default])
+
+test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+		 [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+		 [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+		 [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+		 [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+		 [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/m4/ltsugar.m4 b/m4/ltsugar.m4
new file mode 100644
index 0000000..9000a05
--- /dev/null
+++ b/m4/ltsugar.m4
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 6 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+	   m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+	     [m4_foreach([_Lt_suffix],
+		]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+	[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+	  [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+		 [lt_append([$1], [$2], [$3])$4],
+		 [$5])],
+	  [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+	m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+	[$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+		      [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
new file mode 100644
index 0000000..93fc771
--- /dev/null
+++ b/m4/ltversion.m4
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers			-*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# Generated from ltversion.in.
+
+# serial 3175 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.2.10])
+m4_define([LT_PACKAGE_REVISION], [1.3175])
+
+AC_DEFUN([LTVERSION_VERSION],
+[macro_version='2.2.10'
+macro_revision='1.3175'
+_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
+_LT_DECL(, macro_revision, 0)
+])
diff --git a/m4/lt~obsolete.m4 b/m4/lt~obsolete.m4
new file mode 100644
index 0000000..c573da9
--- /dev/null
+++ b/m4/lt~obsolete.m4
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# This file is free software; the Free Software Foundation gives
+# unlimited permission to copy and/or distribute it, with or without
+# modifications, as long as this notice is preserved.
+
+# serial 5 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],	[AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],		[AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],		[AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],	[AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],		[AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],		[AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],	[AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],		[AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],	[AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],		[AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],	[AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],	[AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],	[AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],		[AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],		[AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],	[AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],		[AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],		[AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],	[AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],	[AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS],	[AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP],	[AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],		[AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],		[AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],		[AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],	[AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],	[AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],		[AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],		[AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],		[AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],	[AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],		[AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],	[AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],		[AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],		[AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],		[AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],	[AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],	[AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],	[AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],	[AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG],	[AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],	[AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],		[AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],	[AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],	[AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP],		[AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],	[AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH],	[AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77],		[AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC],		[AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX],		[AC_DEFUN([_LT_PROG_CXX])])
diff --git a/src/._CdoMagicsMapper.h b/src/._CdoMagicsMapper.h
new file mode 100644
index 0000000..0bda91d
Binary files /dev/null and b/src/._CdoMagicsMapper.h differ
diff --git a/src/._Maggraph.c b/src/._Maggraph.c
new file mode 100644
index 0000000..472aa7d
Binary files /dev/null and b/src/._Maggraph.c differ
diff --git a/src/._Magplot.c b/src/._Magplot.c
new file mode 100644
index 0000000..ef299d7
Binary files /dev/null and b/src/._Magplot.c differ
diff --git a/src/._Magvector.c b/src/._Magvector.c
new file mode 100644
index 0000000..b5a6e81
Binary files /dev/null and b/src/._Magvector.c differ
diff --git a/src/._StringUtilities.c b/src/._StringUtilities.c
new file mode 100644
index 0000000..20e83f7
Binary files /dev/null and b/src/._StringUtilities.c differ
diff --git a/src/._StringUtilities.h b/src/._StringUtilities.h
new file mode 100644
index 0000000..6ce7dd4
Binary files /dev/null and b/src/._StringUtilities.h differ
diff --git a/src/._magics_template_parser.c b/src/._magics_template_parser.c
new file mode 100644
index 0000000..02252b0
Binary files /dev/null and b/src/._magics_template_parser.c differ
diff --git a/src/._results_template_parser.c b/src/._results_template_parser.c
new file mode 100644
index 0000000..9925b5a
Binary files /dev/null and b/src/._results_template_parser.c differ
diff --git a/src/._template_parser.c b/src/._template_parser.c
new file mode 100644
index 0000000..2ef88bc
Binary files /dev/null and b/src/._template_parser.c differ
diff --git a/src/._template_parser.h b/src/._template_parser.h
new file mode 100644
index 0000000..344ec2a
Binary files /dev/null and b/src/._template_parser.h differ
diff --git a/src/Arith.c b/src/Arith.c
new file mode 100644
index 0000000..0aeafb0
--- /dev/null
+++ b/src/Arith.c
@@ -0,0 +1,345 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Arith      add             Add two fields
+      Arith      sub             Subtract two fields
+      Arith      mul             Multiply two fields
+      Arith      div             Divide two fields
+      Arith      min             Minimum of two fields
+      Arith      max             Maximum of two fields
+      Arith      atan2           Arc tangent of two fields
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Arith(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  enum {FILL_NONE, FILL_TS, FILL_VAR, FILL_VARTS, FILL_FILE};
+  int filltype = FILL_NONE;
+  int streamIDx1, streamIDx2, streamID1, streamID2, streamID3;
+  int gridsize;
+  int nrecs, nrecs2, nvars = 0, nlev, recID;
+  int nlevels2 = 1;
+  int tsID, tsID2;
+  int varID, levelID;
+  int varID2, levelID2;
+  int offset;
+  int lfill1, lfill2;
+  int ntsteps1, ntsteps2;
+  int vlistIDx1, vlistIDx2, vlistID1, vlistID2, vlistID3;
+  int taxisIDx1, taxisID1, taxisID2, taxisID3;
+  field_t *fieldx1, *fieldx2, field1, field2;
+  int *varnmiss2 = NULL;
+  int **varnmiss = NULL;
+  double *vardata2 = NULL;
+  double **vardata = NULL;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("add",   func_add,   0, NULL);
+  cdoOperatorAdd("sub",   func_sub,   0, NULL);
+  cdoOperatorAdd("mul",   func_mul,   0, NULL);
+  cdoOperatorAdd("div",   func_div,   0, NULL);
+  cdoOperatorAdd("min",   func_min,   0, NULL);
+  cdoOperatorAdd("max",   func_max,   0, NULL);
+  cdoOperatorAdd("atan2", func_atan2, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  streamIDx1 = streamID1;
+  streamIDx2 = streamID2;
+  fieldx1 = &field1;
+  fieldx2 = &field2;
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistIDx1 = vlistID1;
+  vlistIDx2 = vlistID2;
+
+  if ( cdoVerbose ) vlistPrint(vlistID1);
+  if ( cdoVerbose ) vlistPrint(vlistID2);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisIDx1 = taxisID1;
+
+  ntsteps1 = vlistNtsteps(vlistID1);
+  ntsteps2 = vlistNtsteps(vlistID2);
+  if ( ntsteps1 == 0 ) ntsteps1 = 1;
+  if ( ntsteps2 == 0 ) ntsteps2 = 1;
+
+  if ( vlistNvars(vlistID1) == 1 && vlistNvars(vlistID2) == 1 )
+    {
+      lfill2 = vlistNrecs(vlistID1) != 1 && vlistNrecs(vlistID2) == 1;
+      lfill1 = vlistNrecs(vlistID1) == 1 && vlistNrecs(vlistID2) != 1;
+    }
+  else
+    {
+      lfill2 = vlistNvars(vlistID1) != 1 && vlistNvars(vlistID2) == 1;
+      lfill1 = vlistNvars(vlistID1) == 1 && vlistNvars(vlistID2) != 1;
+    }
+
+  if ( lfill2 )
+    {
+      nlevels2 = vlistCompareX(vlistID1, vlistID2, CMP_DIM);
+
+      if ( ntsteps1 != 1 && ntsteps2 == 1 )
+	{
+	  filltype = FILL_VAR;
+	  cdoPrint("Filling up stream2 >%s< by copying the first variable.", cdoStreamName(1));
+	}
+      else
+	{
+	  filltype = FILL_VARTS;
+	  cdoPrint("Filling up stream2 >%s< by copying the first variable of each timestep.", cdoStreamName(1));
+	}
+    }
+  else if ( lfill1 )
+    {
+      nlevels2 = vlistCompareX(vlistID2, vlistID1, CMP_DIM);
+
+      if ( ntsteps1 == 1 && ntsteps2 != 1 )
+	{
+	  filltype = FILL_VAR;
+	  cdoPrint("Filling up stream1 >%s< by copying the first variable.", cdoStreamName(0));
+	}
+      else
+	{
+	  filltype = FILL_VARTS;
+	  cdoPrint("Filling up stream1 >%s< by copying the first variable of each timestep.", cdoStreamName(0));
+	}
+      streamIDx1 = streamID2;
+      streamIDx2 = streamID1;
+      vlistIDx1 = vlistID2;
+      vlistIDx2 = vlistID1;
+      taxisIDx1 = taxisID2;
+      fieldx1 = &field2;
+      fieldx2 = &field1;
+    }
+
+  if ( filltype == FILL_NONE ) vlistCompare(vlistID1, vlistID2, CMP_ALL);
+
+  gridsize = vlistGridsizeMax(vlistIDx1);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr = (double *) malloc(gridsize*sizeof(double));
+  if ( filltype == FILL_VAR || filltype == FILL_VARTS )
+    {
+      vardata2 = (double *) malloc(gridsize*nlevels2*sizeof(double));
+      varnmiss2 = (int *) malloc(nlevels2*sizeof(int));
+    }
+
+  if ( cdoVerbose ) cdoPrint("Number of timesteps: file1 %d, file2 %d", ntsteps1, ntsteps2);
+
+  if ( filltype == FILL_NONE )
+    {
+      if ( ntsteps1 != 1 && ntsteps2 == 1 )
+	{
+	  filltype = FILL_TS;
+	  cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoStreamName(1));
+	}
+      else if ( ntsteps1 == 1 && ntsteps2 != 1 )
+	{
+	  filltype = FILL_TS;
+	  cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0));
+	  streamIDx1 = streamID2;
+          streamIDx2 = streamID1;
+	  vlistIDx1 = vlistID2;
+	  vlistIDx2 = vlistID1;
+	  taxisIDx1 = taxisID2;
+	  fieldx1 = &field2;
+	  fieldx2 = &field1;
+	}
+
+      if ( filltype == FILL_TS )
+	{
+	  nvars  = vlistNvars(vlistIDx2);
+	  vardata  = (double **) malloc(nvars*sizeof(double *));
+	  varnmiss = (int **) malloc(nvars*sizeof(int *));
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistIDx2, varID));
+	      nlev     = zaxisInqSize(vlistInqVarZaxis(vlistIDx2, varID));
+	      vardata[varID]  = (double *) malloc(nlev*gridsize*sizeof(double));
+	      varnmiss[varID] = (int *) malloc(nlev*sizeof(int));
+	    }
+	}
+    }
+
+  vlistID3 = vlistDuplicate(vlistIDx1);
+  if ( filltype == FILL_TS && vlistIDx1 != vlistID1 )
+    {
+      nvars  = vlistNvars(vlistID1);
+      for ( varID = 0; varID < nvars; varID++ )
+	vlistDefVarMissval(vlistID3, varID, vlistInqVarMissval(vlistID1, varID));
+    }
+
+  taxisID3 = taxisDuplicate(taxisIDx1);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  tsID = 0;
+  tsID2 = 0;
+  while ( (nrecs = streamInqTimestep(streamIDx1, tsID)) )
+    {
+      if ( tsID == 0 || filltype == FILL_NONE || filltype == FILL_FILE || filltype == FILL_VARTS )
+	{
+	  nrecs2 = streamInqTimestep(streamIDx2, tsID2);
+	  if ( nrecs2 == 0 )
+	    {
+	      if ( filltype == FILL_NONE && streamIDx2 == streamID2 )
+		{
+		  filltype = FILL_FILE;
+		  cdoPrint("Filling up stream2 >%s< by copying all timesteps.", cdoStreamName(1));
+		}
+
+	      if ( filltype == FILL_FILE )
+		{
+		  tsID2 = 0;
+		  streamClose(streamID2);
+		  streamID2 = streamOpenRead(cdoStreamName(1));
+		  streamIDx2 = streamID2;
+
+		  vlistID2 = streamInqVlist(streamID2);
+		  vlistIDx2 = vlistID2;
+
+		  vlistCompare(vlistID1, vlistID2, CMP_DIM);
+
+		  nrecs2 = streamInqTimestep(streamIDx2, tsID2);
+		  if ( nrecs2 == 0 )
+		    cdoAbort("Empty input stream %s!", cdoStreamName(1));
+		}
+	      else
+		cdoAbort("Input streams have different number of timesteps!");
+	    }
+	}
+
+      taxisCopyTimestep(taxisID3, taxisIDx1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamIDx1, &varID, &levelID);
+	  streamReadRecord(streamIDx1, fieldx1->ptr, &fieldx1->nmiss);
+
+	  if ( tsID == 0 || filltype == FILL_NONE || filltype == FILL_FILE || filltype == FILL_VARTS )
+	    {
+	      int lstatus = nlevels2 > 1 ? varID == 0 : recID == 0;
+
+	      if ( lstatus || (filltype != FILL_VAR && filltype != FILL_VARTS) )
+		{
+		  streamInqRecord(streamIDx2, &varID2, &levelID2);
+		  streamReadRecord(streamIDx2, fieldx2->ptr, &fieldx2->nmiss);
+		}
+
+	      if ( filltype == FILL_TS )
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistIDx2, varID));
+		  offset   = gridsize*levelID;
+		  memcpy(vardata[varID]+offset, fieldx2->ptr, gridsize*sizeof(double));
+		  varnmiss[varID][levelID] = fieldx2->nmiss;
+		}
+	      else if ( lstatus && (filltype == FILL_VAR || filltype == FILL_VARTS) )
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistIDx2, 0));
+		  offset   = gridsize*levelID2;
+		  memcpy(vardata2+offset, fieldx2->ptr, gridsize*sizeof(double));
+		  varnmiss2[levelID2] = fieldx2->nmiss;
+		}
+	    }
+	  else if ( filltype == FILL_TS )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistIDx2, varID2));
+	      offset   = gridsize*levelID;
+	      memcpy(fieldx2->ptr, vardata[varID]+offset, gridsize*sizeof(double));
+	      fieldx2->nmiss = varnmiss[varID][levelID];
+	    }
+
+	  fieldx1->grid    = vlistInqVarGrid(vlistIDx1, varID);
+	  fieldx1->missval = vlistInqVarMissval(vlistIDx1, varID);
+
+	  if ( filltype == FILL_VAR || filltype == FILL_VARTS )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistIDx2, 0));
+	      levelID2 = 0;
+	      if ( nlevels2 > 1 ) levelID2 = levelID;
+	      offset   = gridsize*levelID2;
+	      memcpy(fieldx2->ptr, vardata2+offset, gridsize*sizeof(double));
+	      fieldx2->nmiss   = varnmiss2[levelID2];
+	      fieldx2->grid    = vlistInqVarGrid(vlistIDx2, 0);
+	      fieldx2->missval = vlistInqVarMissval(vlistIDx2, 0);
+	    }
+	  else
+	    {
+	      fieldx2->grid    = vlistInqVarGrid(vlistIDx2, varID2);
+	      fieldx2->missval = vlistInqVarMissval(vlistIDx2, varID2);
+	    }
+
+	  farfun(&field1, field2, operfunc);
+
+	  streamDefRecord(streamID3, varID, levelID);
+	  streamWriteRecord(streamID3, field1.ptr, field1.nmiss);
+	}
+
+      tsID++;
+      tsID2++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID3);
+
+  if ( vardata )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  free(vardata[varID]);
+	  free(varnmiss[varID]);
+	}
+
+      free(vardata);
+      free(varnmiss);
+    }
+
+  if ( field1.ptr ) free(field1.ptr);
+  if ( field2.ptr ) free(field2.ptr);
+  if ( vardata2   ) free(vardata2);
+  if ( varnmiss2  ) free(varnmiss2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Arithc.c b/src/Arithc.c
new file mode 100644
index 0000000..e627ba1
--- /dev/null
+++ b/src/Arithc.c
@@ -0,0 +1,163 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Arithc     addc            Add by constant
+      Arithc     subc            Subtract by constant
+      Arithc     mulc            Multiply by constant
+      Arithc     divc            Divide by constant
+      Arithc     mod             Modulo operator
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+int *fill_vars(int vlistID)
+{
+  int varID;
+  int nvars = vlistNvars(vlistID);
+  int *vars = (int *) malloc(nvars*sizeof(int));
+
+  if ( cdoNumVarnames )
+    {
+      int nfound = 0;
+      char varname[CDI_MAX_NAME];
+
+      for ( varID = 0; varID < nvars; ++varID )
+	{
+	  vars[varID] = 0;
+
+	  vlistInqVarName(vlistID, varID, varname);
+
+	  for ( int i = 0; i < cdoNumVarnames; ++i )
+	    if ( strcmp(varname, cdoVarnames[i]) == 0 )
+	      {
+		vars[varID] = 1;
+		nfound++;
+		break;
+	      }
+	}
+
+      if ( nfound == 0 )
+	cdoAbort("Variable -n %s%s not found!", cdoVarnames[0], cdoNumVarnames > 1 ? ",..." : "");
+    }
+  else
+    {
+      for ( varID = 0; varID < nvars; ++varID ) vars[varID] = 1;
+    }
+
+  return (vars);
+}
+
+
+void *Arithc(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2;
+  int gridsize, i;
+  int nrecs, recID;
+  int tsID;
+  int varID, levelID;
+  int vlistID1, vlistID2;
+  double rconst;
+  field_t field;
+  int taxisID1, taxisID2;
+  int *vars = NULL;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("addc", func_add, 0, "constant value");
+  cdoOperatorAdd("subc", func_sub, 0, "constant value");
+  cdoOperatorAdd("mulc", func_mul, 0, "constant value");
+  cdoOperatorAdd("divc", func_div, 0, "constant value");
+  cdoOperatorAdd("mod",  func_mod, 0, "divisor");
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+  rconst = atof(operatorArgv()[0]);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  vars = fill_vars(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr    = (double *) malloc(gridsize*sizeof(double));
+  field.weight = NULL;
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field.ptr, &field.nmiss);
+
+	  if ( vars[varID] )
+	    {
+	      field.grid    = vlistInqVarGrid(vlistID1, varID);
+	      field.missval = vlistInqVarMissval(vlistID1, varID);
+
+	      farcfun(&field, rconst, operfunc);
+
+	      /* recalculate number of missing values */
+	      gridsize = gridInqSize(field.grid);
+	      field.nmiss = 0;
+	      for ( i = 0; i < gridsize; ++i )
+		if ( DBL_IS_EQUAL(field.ptr[i], field.missval) ) field.nmiss++;
+	    }
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, field.ptr, field.nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( field.ptr ) free(field.ptr);
+  if ( vars ) free(vars);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Arithdays.c b/src/Arithdays.c
new file mode 100644
index 0000000..ba069dc
--- /dev/null
+++ b/src/Arithdays.c
@@ -0,0 +1,173 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Arithdays  muldpm          Multiply with days per month
+      Arithdays  divdpm          Divide by days per month
+      Arithdays  muldpy          Multiply with days per year
+      Arithdays  divdpy          Divide by days per year
+      Arithdays  muldoy          Multiply with day of year
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+static
+double dayofyear(int calendar, int vdate, int vtime)
+{
+  int month_360[12] = {30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30, 30};
+  int month_365[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+  int month_366[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
+  int *dpm;
+  int im, dpy;
+  int year, month, day;
+  int hour, minute, second;
+  double doy = 0;
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+
+  dpy = days_per_year(calendar, year);
+
+  for ( im = 1; im < month; ++im )
+    {
+      if      ( dpy == 360 ) dpm = month_360;
+      else if ( dpy == 365 ) dpm = month_365;
+      else                   dpm = month_366;
+
+      if ( im >= 1 && im <= 12 ) doy += dpm[im-1];
+    }
+
+  doy += (day-1);
+  doy += (second+minute*60+hour*3600)/86400.;
+
+  if ( cdoVerbose )
+    cdoPrint("%d %d %d %g\n", vdate, vtime, dpy, doy);
+
+  return (doy);
+}
+
+
+void *Arithdays(void *argument)
+{
+  int MULDOY;
+  int operatorID;
+  int operfunc, operfunc2;
+  int streamID1, streamID2;
+  int gridsize;
+  int nrecs, recID;
+  int tsID;
+  int varID, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int vdate, vtime;
+  int year, month, day;
+  int calendar;
+  double rconst;
+  field_t field;
+
+  cdoInitialize(argument);
+
+           cdoOperatorAdd("muldpm", func_mul, func_month, NULL);
+           cdoOperatorAdd("divdpm", func_div, func_month, NULL);
+           cdoOperatorAdd("muldpy", func_mul, func_year,  NULL);
+           cdoOperatorAdd("divdpy", func_div, func_year,  NULL);
+  MULDOY = cdoOperatorAdd("muldoy", func_mul,         0,  NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+  operfunc2 = cdoOperatorF2(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  calendar = taxisInqCalendar(taxisID1);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr    = (double *) malloc(gridsize*sizeof(double));
+  field.weight = NULL;
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      cdiDecodeDate(vdate, &year, &month, &day);
+
+      if ( operatorID == MULDOY )
+	{
+	  rconst = dayofyear(calendar, vdate, vtime);
+	}
+      else
+	{
+	  if ( operfunc2 == func_month )
+	    rconst = days_per_month(calendar, year, month);
+	  else
+	    rconst = days_per_year(calendar, year);
+	}
+
+      if ( cdoVerbose )
+	cdoPrint("calendar %d  year %d  month %d  result %g",
+		 calendar, year, month, rconst);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field.ptr, &field.nmiss);
+
+	  field.grid    = vlistInqVarGrid(vlistID1, varID);
+	  field.missval = vlistInqVarMissval(vlistID1, varID);
+
+	  farcfun(&field, rconst, operfunc);
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, field.ptr, field.nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( field.ptr ) free(field.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Arithlat.c b/src/Arithlat.c
new file mode 100644
index 0000000..5a2cc8d
--- /dev/null
+++ b/src/Arithlat.c
@@ -0,0 +1,167 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Arithlat   mulcoslat       Multiply with cos(lat)
+      Arithlat   divcoslat       Divide by cos(lat)
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+void *Arithlat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2;
+  int gridtype;
+  int gridID, gridID0 = -1;
+  int nrecs, recID;
+  int tsID;
+  int varID, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int nmiss;
+  long gridsize, i;
+  char units[CDI_MAX_NAME];
+  double *scale = NULL;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("mulcoslat", func_mul, 0, NULL);
+  cdoOperatorAdd("divcoslat", func_div, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array, &nmiss);
+	  
+	  gridID = vlistInqVarGrid(vlistID1, varID);
+
+	  if ( gridID != gridID0 )
+	    {
+	      gridID0 = gridID;
+
+	      gridtype = gridInqType(gridID);
+	      if ( gridtype == GRID_LONLAT      ||
+		   gridtype == GRID_GAUSSIAN    ||
+		   gridtype == GRID_LCC )
+		{
+		  gridID = gridToCurvilinear(gridID, 0);
+		}
+	      else if ( gridtype == GRID_CURVILINEAR ||
+			gridtype == GRID_UNSTRUCTURED )
+		{
+		  /* No conversion necessary */
+		}
+	      else if ( gridtype == GRID_GME )
+		{
+		  gridID = gridToUnstructured(gridID, 0);
+		}
+	      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));
+		}
+
+	      gridsize = gridInqSize(gridID);
+
+	      scale = (double *) realloc(scale, gridsize*sizeof(double));
+	      gridInqYvals(gridID, scale);
+
+	      /* Convert lat/lon units if required */
+	      
+	      gridInqXunits(gridID, units);
+
+	      if ( memcmp(units, "degree", 6) == 0 )
+		{
+		  for ( i = 0; i < gridsize; ++i ) scale[i] *= DEG2RAD;
+		}
+	      else if ( memcmp(units, "radian", 6) == 0 )
+		{
+		  /* No conversion necessary */
+		}
+	      else
+		{
+		  cdoWarning("Unknown units supplied for grid1 center lat/lon: proceeding assuming radians");
+		}
+
+	      if ( operfunc == func_mul )
+		for ( i = 0; i < gridsize; ++i ) scale[i] = cos(scale[i]);
+	      else
+		for ( i = 0; i < gridsize; ++i ) scale[i] = 1./cos(scale[i]);
+
+	      if ( cdoVerbose ) for ( i = 0; i < 10; ++i ) cdoPrint("coslat  %3d  %g", i+1, scale[i]);
+	    }
+
+	  for ( i = 0; i < gridsize; ++i ) array[i] *= scale[i];
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array, nmiss);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array ) free(array);
+  if ( scale ) free(scale);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/CDIread.c b/src/CDIread.c
new file mode 100644
index 0000000..75ef5cd
--- /dev/null
+++ b/src/CDIread.c
@@ -0,0 +1,224 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+static
+const char *filetypestr(int filetype)
+{
+  switch ( filetype )
+    {
+    case FILETYPE_GRB:  return ("GRIB");            break;
+    case FILETYPE_GRB2: return ("GRIB2");           break;
+    case FILETYPE_NC:   return ("netCDF");          break;
+    case FILETYPE_NC2:  return ("netCDF2");         break;
+    case FILETYPE_NC4:  return ("netCDF4");         break;
+    case FILETYPE_NC4C: return ("netCDF4 classic"); break;
+    case FILETYPE_SRV:  return ("SERVICE");         break;
+    case FILETYPE_EXT:  return ("EXTRA");           break;
+    case FILETYPE_IEG:  return ("IEG");             break;
+    default:            return ("");
+    }
+}
+
+static
+const char *datatypestr(int datatype)
+{
+  static char str[20];
+
+  str[0] = 0;
+  sprintf(str, "%d bit packed", datatype);
+
+  if      ( datatype == DATATYPE_PACK   ) return ("P0");
+  else if ( datatype > 0 && datatype <= 32 ) return (str);
+  else if ( datatype == DATATYPE_CPX32  ) return ("C32");
+  else if ( datatype == DATATYPE_CPX64  ) return ("C64");
+  else if ( datatype == DATATYPE_FLT32  ) return ("32 bit floats");
+  else if ( datatype == DATATYPE_FLT64  ) return ("64 bit floats");
+  else if ( datatype == DATATYPE_INT8   ) return ("I8");
+  else if ( datatype == DATATYPE_INT16  ) return ("I16");
+  else if ( datatype == DATATYPE_INT32  ) return ("I32");
+  else if ( datatype == DATATYPE_UINT8  ) return ("U8");
+  else if ( datatype == DATATYPE_UINT16 ) return ("U16");
+  else if ( datatype == DATATYPE_UINT32 ) return ("U32");
+  else                                    return ("");
+}
+
+static
+off_t filesize(const char *filename)
+{
+  FILE *fp;
+  off_t pos = 0;
+
+  fp = fopen(filename, "r");
+  if ( fp == NULL )
+    {
+      fprintf(stderr, "Open failed on %s\n", filename);
+    }
+  else
+    {
+      fseek(fp, 0L, SEEK_END);
+      pos = ftello(fp);
+    }
+  
+  return pos;
+}
+
+static
+void print_stat(const char *sinfo, int memtype, int datatype, int filetype, off_t nvalues, double data_size, double file_size, double tw)
+{
+  nvalues /= 1000000;
+  data_size /= 1024.*1024.*1024.;
+  if ( memtype == MEMTYPE_FLOAT )
+    cdoPrint("%s Read %.1f GB of 32 bit floats from %s %s, %.1f MVal/s", sinfo, data_size, datatypestr(datatype), filetypestr(filetype), nvalues/tw);
+  else
+    cdoPrint("%s Read %.1f GB of 64 bit floats from %s %s, %.1f MVal/s", sinfo, data_size, datatypestr(datatype), filetypestr(filetype), nvalues/tw);
+
+  file_size /= 1024.*1024.*1024.;
+  cdoPrint("%s Read %.1f GB in %.1f seconds, total %.1f MB/s", sinfo, file_size, tw, 1024*file_size/tw);
+}
+
+
+void *CDIread(void *argument)
+{
+  int memtype = MEMTYPE_DOUBLE;
+  int streamID;
+  int tsID, varID, levelID;
+  int gridsize, i, nmiss;
+  int recID, nrecs;
+  int vlistID;
+  int filetype = -1, datatype = -1;
+  int irun, nruns = 1;
+  char sinfo[64];
+  char *envstr;
+  off_t nvalues = 0;
+  double file_size = 0, data_size = 0;
+  double tw, tw0, t0, twsum = 0;
+  float *farray = NULL;
+  double *darray = NULL;
+  extern int timer_read;
+
+  sinfo[0] = 0;
+
+  cdoInitialize(argument);
+
+  envstr = getenv("MEMTYPE");
+  if ( envstr )
+    {
+      if      ( strcmp(envstr, "float")  == 0 ) memtype = MEMTYPE_FLOAT;
+      else if ( strcmp(envstr, "double") == 0 ) memtype = MEMTYPE_DOUBLE;
+    }
+
+  if ( cdoVerbose ) cdoPrint("parameter: <nruns>");
+
+  if ( operatorArgc() > 1 ) cdoAbort("Too many arguments!");
+
+  if ( operatorArgc() == 1 ) nruns = atol(operatorArgv()[0]);
+
+  if ( nruns <  0 ) nruns = 0;
+  if ( nruns > 99 ) nruns = 99;
+
+  if ( cdoVerbose )
+    {
+      cdoPrint("nruns      : %d", nruns);
+    } 
+
+
+  // vlistDefNtsteps(vlistID, 1);
+
+  for ( irun = 0; irun < nruns; ++irun )
+    {
+      tw0 = timer_val(timer_read);
+      data_size = 0;
+      nvalues = 0;
+
+      streamID = streamOpenRead(cdoStreamName(0));
+
+      vlistID = streamInqVlist(streamID);
+
+      filetype = streamInqFiletype(streamID);
+      datatype = vlistInqVarDatatype(vlistID, 0);
+	  
+      gridsize = vlistGridsizeMax(vlistID);
+      
+      if ( darray == NULL ) darray = (double *) malloc(gridsize*sizeof(double));
+      if ( farray == NULL && memtype == MEMTYPE_FLOAT ) farray = (float *) malloc(gridsize*sizeof(float));
+
+      t0 = timer_val(timer_read);
+
+      tsID = 0;
+      while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	{
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID, &varID, &levelID);
+
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID, varID));
+	      nvalues += gridsize;
+
+	      if ( memtype == MEMTYPE_FLOAT )
+		{
+		  cdoAbort("streamReadRecordF not implemented!");
+		  // streamReadRecordF(streamID, farray, &nmiss);
+		  for ( i = 0; i < gridsize; ++i ) darray[i] = farray[i];
+		  data_size += gridsize*4;
+		}
+	      else
+		{
+		  streamReadRecord(streamID, darray, &nmiss);
+		  data_size += gridsize*8;
+		}
+	    }
+
+	  if ( cdoVerbose )
+	    {
+	      tw = timer_val(timer_read) - t0;
+	      t0 = timer_val(timer_read);
+	      cdoPrint("Timestep %d: %.2f seconds", tsID+1, tw);
+	    }
+
+	  tsID++;
+	}
+
+      streamClose(streamID);
+
+      tw = timer_val(timer_read) - tw0;
+      twsum += tw;
+
+      file_size = (double) filesize(cdoStreamName(0));
+
+      if ( nruns > 1 ) sprintf(sinfo, "(run %d)", irun+1);
+
+      print_stat(sinfo, memtype, datatype, filetype, nvalues, data_size, file_size, tw);
+    }
+
+  if ( nruns > 1 )
+    print_stat("(mean)", memtype, datatype, filetype, nvalues, data_size, file_size, twsum/nruns);
+
+  if ( darray ) free(darray);
+  if ( farray ) free(farray);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/CDItest.c b/src/CDItest.c
new file mode 100644
index 0000000..2188ef7
--- /dev/null
+++ b/src/CDItest.c
@@ -0,0 +1,134 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *CDItest(void *argument)
+{
+  int NCOPY;
+  int operatorID;
+  int streamID1, streamID2;
+  int n;
+  int nrecs;
+  int tsID1, tsID2, recID, varID, levelID;
+  int lcopy = FALSE;
+  int gridsize;
+  int vlistID1, vlistID2 = -1;
+  int nmiss;
+  int taxisID1, taxisID2 = CDI_UNDEFID;
+  int max_copy = 3;
+  double *array = NULL;
+  double s_utime, s_stime;
+  double e_utime, e_stime;
+  double c_cputime = 0, c_usertime = 0, c_systime = 0;
+
+  cdoInitialize(argument);
+
+  NCOPY = cdoOperatorAdd("ncopy",   0, 0, NULL);
+
+  //  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  operatorID = cdoOperatorID();
+
+  //  operatorInputArg("Number of copies");
+  if ( operatorArgc() == 1 ) max_copy = atoi(operatorArgv()[0]);
+
+  processStartTime(&s_utime, &s_stime);
+
+  n = 0;
+  while ( TRUE )
+    {
+      streamID1 = streamOpenRead(cdoStreamName(0));
+
+      vlistID1 = streamInqVlist(streamID1);
+      taxisID1 = vlistInqTaxis(vlistID1);
+
+      streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+      vlistID2 = vlistDuplicate(vlistID1);
+      taxisID2 = taxisDuplicate(taxisID1);
+      vlistDefTaxis(vlistID2, taxisID2);
+
+      streamDefVlist(streamID2, vlistID2);
+
+      gridsize = vlistGridsizeMax(vlistID1);
+      array = (double *) malloc(gridsize*sizeof(double));
+
+      tsID1 = 0;
+      tsID2 = 0;
+      while ( (nrecs = streamInqTimestep(streamID1, tsID1)) )
+	{
+	  taxisCopyTimestep(taxisID2, taxisID1);
+
+	  streamDefTimestep(streamID2, tsID2);
+	       
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+	      streamDefRecord(streamID2,  varID,  levelID);
+	  
+	      if ( lcopy )
+		{
+		  streamCopyRecord(streamID2, streamID1);
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array, &nmiss);
+		  streamWriteRecord(streamID2, array, nmiss);
+		}
+	    }
+	  tsID1++;
+	  tsID2++;
+	}
+
+      streamClose(streamID1);
+      streamClose(streamID2);
+
+      vlistDestroy(vlistID2);
+      taxisDestroy(taxisID2);
+
+      if ( array ) free(array);
+
+      n++;
+
+      cdoProcessTime(&e_utime, &e_stime);
+
+      c_usertime = e_utime - s_utime;
+      c_systime  = e_stime - s_stime;
+      c_cputime  = c_usertime + c_systime;
+
+      s_utime = e_utime;
+      s_stime = e_stime;
+
+      cdoPrint("Copy number %d: %.2fs %.2fs %.2fs", n, c_usertime, c_systime, c_cputime);
+
+      if ( n == max_copy ) break;
+    }
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/CDIwrite.c b/src/CDIwrite.c
new file mode 100644
index 0000000..a318928
--- /dev/null
+++ b/src/CDIwrite.c
@@ -0,0 +1,306 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+static
+const char *filetypestr(int filetype)
+{
+  switch ( filetype )
+    {
+    case FILETYPE_GRB:  return ("GRIB");            break;
+    case FILETYPE_GRB2: return ("GRIB2");           break;
+    case FILETYPE_NC:   return ("netCDF");          break;
+    case FILETYPE_NC2:  return ("netCDF2");         break;
+    case FILETYPE_NC4:  return ("netCDF4");         break;
+    case FILETYPE_NC4C: return ("netCDF4 classic"); break;
+    case FILETYPE_SRV:  return ("SERVICE");         break;
+    case FILETYPE_EXT:  return ("EXTRA");           break;
+    case FILETYPE_IEG:  return ("IEG");             break;
+    default:            return ("");
+    }
+}
+
+static
+const char *datatypestr(int datatype)
+{
+  static char str[20];
+
+  str[0] = 0;
+  sprintf(str, "%d bit packed", datatype);
+
+  if      ( datatype == DATATYPE_PACK   ) return ("P0");
+  else if ( datatype > 0 && datatype <= 32 ) return (str);
+  else if ( datatype == DATATYPE_CPX32  ) return ("C32");
+  else if ( datatype == DATATYPE_CPX64  ) return ("C64");
+  else if ( datatype == DATATYPE_FLT32  ) return ("32 bit floats");
+  else if ( datatype == DATATYPE_FLT64  ) return ("64 bit floats");
+  else if ( datatype == DATATYPE_INT8   ) return ("I8");
+  else if ( datatype == DATATYPE_INT16  ) return ("I16");
+  else if ( datatype == DATATYPE_INT32  ) return ("I32");
+  else if ( datatype == DATATYPE_UINT8  ) return ("U8");
+  else if ( datatype == DATATYPE_UINT16 ) return ("U16");
+  else if ( datatype == DATATYPE_UINT32 ) return ("U32");
+  else                                    return ("");
+}
+
+static
+off_t filesize(const char *filename)
+{
+  FILE *fp;
+  off_t pos = 0;
+
+  if ( filename[0] == '(' && filename[1] == 'p' )
+    {
+    }
+  else
+    {
+      fp = fopen(filename, "r");
+      if ( fp == NULL )
+	{
+	  fprintf(stderr, "Open failed on %s\n", filename);
+	}
+      else
+	{
+	  fseek(fp, 0L, SEEK_END);
+	  pos = ftello(fp);
+	}
+    }
+  
+  return pos;
+}
+
+static
+void print_stat(const char *sinfo, int memtype, int datatype, int filetype, off_t nvalues, double data_size, double file_size, double tw)
+{
+  double rout;
+
+  nvalues /= 1000000;
+  data_size /= 1024.*1024.*1024.;
+
+  rout = 0;
+  if ( tw > 0 ) rout = nvalues/tw;
+
+  if ( memtype == MEMTYPE_FLOAT )
+    cdoPrint("%s Wrote %.1f GB of 32 bit floats to %s %s, %.1f MVal/s", sinfo, data_size, datatypestr(datatype), filetypestr(filetype), rout);
+  else
+    cdoPrint("%s Wrote %.1f GB of 64 bit floats to %s %s, %.1f MVal/s", sinfo, data_size, datatypestr(datatype), filetypestr(filetype), rout);
+
+  file_size /= 1024.*1024.*1024.;
+
+  rout = 0;
+  if ( tw > 0 ) rout = 1024*file_size/tw;
+
+  cdoPrint("%s Wrote %.1f GB in %.1f seconds, total %.1f MB/s", sinfo, file_size, tw, rout);
+}
+
+
+void *CDIwrite(void *argument)
+{
+  int memtype = MEMTYPE_DOUBLE;
+  int nvars = 10, nlevs = 0, ntimesteps = 30;
+  char *defaultgrid = "global_.2";
+  int streamID;
+  int tsID, varID, levelID;
+  int gridsize, i;
+  int vlistID;
+  int gridID = -1, zaxisID, taxisID;
+  int vdate, vtime, julday;
+  int filetype = -1, datatype = -1;
+  int irun, nruns = 1;
+  unsigned int seed = 1;
+  const char *gridfile;
+  char sinfo[64];
+  char *envstr;
+  off_t nvalues = 0;
+  double file_size = 0, data_size = 0;
+  double tw, tw0, t0, twsum = 0;
+  double ***vars = NULL;
+  float *farray = NULL;
+  extern int timer_write;
+
+  srand(seed);
+  sinfo[0] = 0;
+
+  cdoInitialize(argument);
+
+  envstr = getenv("MEMTYPE");
+  if ( envstr )
+    {
+      if      ( strcmp(envstr, "float")  == 0 ) memtype = MEMTYPE_FLOAT;
+      else if ( strcmp(envstr, "double") == 0 ) memtype = MEMTYPE_DOUBLE;
+    }
+
+  if ( cdoVerbose ) cdoPrint("parameter: <nruns, <grid, <nlevs, <ntimesteps, <nvars>>>>>");
+
+  if ( operatorArgc() > 5 ) cdoAbort("Too many arguments!");
+
+  gridfile = defaultgrid;
+  if ( operatorArgc() >= 1 ) nruns = atol(operatorArgv()[0]);
+  if ( operatorArgc() >= 2 ) gridfile = operatorArgv()[1];
+  if ( operatorArgc() >= 3 ) nlevs = atol(operatorArgv()[2]);
+  if ( operatorArgc() >= 4 ) ntimesteps = atol(operatorArgv()[3]);
+  if ( operatorArgc() >= 5 ) nvars = atol(operatorArgv()[4]);
+
+  if ( nruns <  0 ) nruns = 0;
+  if ( nruns > 99 ) nruns = 99;
+
+
+  if ( nlevs <= 0  ) nlevs = 1;
+  if ( nlevs > 255 ) nlevs = 255;
+  if ( ntimesteps <= 0 ) ntimesteps = 1;
+  if ( nvars <= 0 ) nvars = 1;
+
+  gridID   = cdoDefineGrid(gridfile);
+  gridsize = gridInqSize(gridID);
+
+  if ( nlevs == 1 )
+    zaxisID  = zaxisCreate(ZAXIS_SURFACE, 1);
+  else
+    {
+      double levels[nlevs];
+      for ( i = 0; i < nlevs; ++i ) levels[i] = 100*i; 
+      zaxisID  = zaxisCreate(ZAXIS_HEIGHT, nlevs);
+      zaxisDefLevels(zaxisID, levels);
+    }
+
+  if ( cdoVerbose )
+    {
+      cdoPrint("nruns      : %d", nruns);
+      cdoPrint("gridsize   : %d", gridsize);
+      cdoPrint("nlevs      : %d", nlevs);
+      cdoPrint("ntimesteps : %d", ntimesteps);
+      cdoPrint("nvars      : %d", nvars);
+    } 
+
+  vars = (double ***) malloc(nvars*sizeof(double **));
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      vars[varID] = (double **) malloc(nlevs*sizeof(double *));
+      for ( levelID = 0; levelID < nlevs; levelID++ )
+	{
+	  vars[varID][levelID] = (double *) malloc(gridsize*sizeof(double));
+	  for ( i = 0; i < gridsize; ++i )
+	    vars[varID][levelID][i] = varID + rand()/(RAND_MAX+1.0);
+	}
+    }
+
+  if ( memtype == MEMTYPE_FLOAT ) farray = (float *) malloc(gridsize*sizeof(float));
+
+  vlistID = vlistCreate();
+
+  for ( i = 0; i < nvars; ++i )
+    {
+      varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+      vlistDefVarCode(vlistID, varID, varID+1);
+      //    vlistDefVarName(vlistID, varID, );
+    }
+
+  taxisID = taxisCreate(TAXIS_RELATIVE);
+  vlistDefTaxis(vlistID, taxisID);
+
+  // vlistDefNtsteps(vlistID, 1);
+
+  for ( irun = 0; irun < nruns; ++irun )
+    {
+      tw0 = timer_val(timer_write);
+      data_size = 0;
+      nvalues = 0;
+
+      streamID = streamOpenWrite(cdoStreamName(0), cdoFiletype());
+
+      streamDefVlist(streamID, vlistID);
+
+      filetype = streamInqFiletype(streamID);
+      datatype = vlistInqVarDatatype(vlistID, 0);
+	  
+      julday = date_to_julday(CALENDAR_PROLEPTIC, 19870101);
+
+      t0 = timer_val(timer_write);
+
+      for ( tsID = 0; tsID < ntimesteps; tsID++ )
+	{
+	  vdate = julday_to_date(CALENDAR_PROLEPTIC, julday + tsID);
+	  vtime = 0;
+	  taxisDefVdate(taxisID, vdate);
+	  taxisDefVtime(taxisID, vtime);
+	  streamDefTimestep(streamID, tsID);
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      for ( levelID = 0; levelID < nlevs; levelID++ )
+		{
+		  nvalues += gridsize;
+		  streamDefRecord(streamID, varID, levelID);
+		  if ( memtype == MEMTYPE_FLOAT )
+		    {
+		      double *darray = vars[varID][levelID];
+		      for ( i = 0; i < gridsize; ++i ) farray[i] = darray[i];
+		      streamWriteRecordF(streamID, farray, 0);
+		      data_size += gridsize*4;
+		    }
+		  else
+		    {
+		      streamWriteRecord(streamID, vars[varID][levelID], 0);
+		      data_size += gridsize*8;
+		    }
+		}
+	    }
+
+	  if ( cdoVerbose )
+	    {
+	      tw = timer_val(timer_write) - t0;
+	      t0 = timer_val(timer_write);
+	      cdoPrint("Timestep %d: %.2f seconds", tsID+1, tw);
+	    }
+	}
+
+      streamClose(streamID);
+
+      tw = timer_val(timer_write) - tw0;
+      twsum += tw;
+
+      file_size = (double ) filesize(cdoStreamName(0));
+
+      if ( nruns > 1 ) sprintf(sinfo, "(run %d)", irun+1);
+
+      print_stat(sinfo, memtype, datatype, filetype, nvalues, data_size, file_size, tw);
+    }
+
+  if ( nruns > 1 )
+    print_stat("(mean)", memtype, datatype, filetype, nvalues, data_size, file_size, twsum/nruns);
+
+  vlistDestroy(vlistID);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      for ( levelID = 0; levelID < nlevs; levelID++ ) free(vars[varID][levelID]);
+      free(vars[varID]);
+    }
+  free(vars);
+
+  if ( farray ) free(farray);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Cat.c b/src/Cat.c
new file mode 100644
index 0000000..62e5d08
--- /dev/null
+++ b/src/Cat.c
@@ -0,0 +1,152 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Copy       cat             Concatenate datasets
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+
+void *Cat(void *argument)
+{
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs;
+  int tsID1, tsID2 = 0, recID, varID, levelID;
+  int vlistID1, vlistID2 = CDI_UNDEFID;
+  int streamCnt, nfiles, indf;
+  int taxisID1, taxisID2 = CDI_UNDEFID;
+  int lcopy = FALSE;
+  int gridsize;
+  int nmiss;
+  int ntsteps, nvars;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  streamCnt = cdoStreamCnt();
+  nfiles = streamCnt - 1;
+
+  for ( indf = 0; indf < nfiles; indf++ )
+    {
+      if ( cdoVerbose ) cdoPrint("Process file: %s", cdoStreamName(indf));
+
+      streamID1 = streamOpenRead(cdoStreamName(indf));
+
+      vlistID1 = streamInqVlist(streamID1);
+      taxisID1 = vlistInqTaxis(vlistID1);
+
+      if ( indf == 0 )
+	{
+	  if ( fileExists(cdoStreamName(nfiles)) )
+	    {
+	      streamID2 = streamOpenAppend(cdoStreamName(nfiles));
+
+	      vlistID2 = streamInqVlist(streamID2);
+	      taxisID2 = vlistInqTaxis(vlistID2);
+
+	      vlistCompare(vlistID1, vlistID2, CMP_ALL);
+
+	      tsID2 = vlistNtsteps(vlistID2);
+	      if ( tsID2 == 0 ) tsID2 = 1; /* bug fix for time constant data only */
+	    }
+	  else
+	    {
+	      if ( cdoVerbose )
+		cdoPrint("Output file doesn't exist, creating: %s", cdoStreamName(nfiles));
+
+	      streamID2 = streamOpenWrite(cdoStreamName(nfiles), cdoFiletype());
+
+	      vlistID2 = vlistDuplicate(vlistID1);
+	      taxisID2 = taxisDuplicate(taxisID1);
+	      vlistDefTaxis(vlistID2, taxisID2);
+	  
+	      ntsteps = vlistNtsteps(vlistID1);
+	      nvars   = vlistNvars(vlistID1);
+	      
+	      if ( ntsteps == 1 )
+		{
+		  for ( varID = 0; varID < nvars; ++varID )
+		    if ( vlistInqVarTsteptype(vlistID1, varID) != TSTEP_CONSTANT ) break;
+		  
+		  if ( varID == nvars ) ntsteps = 0;
+		}
+
+	      if ( ntsteps == 0 && nfiles > 1 )
+		{		  
+		  for ( varID = 0; varID < nvars; ++varID )
+		    vlistDefVarTsteptype(vlistID2, varID, TSTEP_INSTANT);
+		}
+
+	      streamDefVlist(streamID2, vlistID2);
+	    }
+
+	  if ( ! lcopy )
+	    {
+	      gridsize = vlistGridsizeMax(vlistID1);
+	      array = (double *) malloc(gridsize*sizeof(double));
+	    }
+	}
+      else
+	{
+	  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+	}
+
+      tsID1 = 0;
+      while ( (nrecs = streamInqTimestep(streamID1, tsID1)) )
+	{
+	  taxisCopyTimestep(taxisID2, taxisID1);
+
+	  streamDefTimestep(streamID2, tsID2);
+	       
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+	      streamDefRecord(streamID2,  varID,  levelID);
+
+	      if ( lcopy )
+		{
+		  streamCopyRecord(streamID2, streamID1); 
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array, &nmiss);
+		  streamWriteRecord(streamID2, array, nmiss);
+		}
+	    }
+	  tsID1++;
+	  tsID2++;
+	}
+      streamClose(streamID1);
+    }
+
+  streamClose(streamID2);
+ 
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/CdoMagicsMapper.c b/src/CdoMagicsMapper.c
new file mode 100644
index 0000000..8802e5e
--- /dev/null
+++ b/src/CdoMagicsMapper.c
@@ -0,0 +1,185 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h" /* HAVE_LIBMAGICS */
+#endif
+
+#include "CdoMagicsMapper.h"
+
+#define PARAM_COUNT  sizeof( mapper ) / sizeof ( CdoMagicsMapper )
+
+/* extern int SetMagicsParameterValue( char *param_name, char *param_type, char *param_value ) */
+
+int Set_magics_param_CCOLS( char *user_name, char *param_value );
+int Reset_magics_param_CCOLS( char *user_name );
+
+int Set_magics_param_CLEVS( char *user_name, char *param_value );
+int Reset_magics_param_CLEVS( char *user_name );
+
+int Set_magics_param_CTABLE( char *user_name, char *param_value );
+int Reset_magics_param_CTABLE( char *user_name );
+
+/* Define an array of Mapper structures to sort. */
+
+typedef struct 
+
+{
+	char *cdo_name;
+	char *magics_name;
+	char *magics_type;
+	int  (*Set_magics_param)( char *user_name, char *param_value );  /* Function to Update the Corresponding Magics parameters */
+	int  (*Reset_magics_param)(char *user_name ); /* Function to Reset the Corresponding Magics parameters  */
+
+} CdoMagicsMapper;
+
+
+CdoMagicsMapper mapper[] =
+
+{
+	{ 
+		"clevs", 
+		"contour_level_list", 
+		"floatarray",
+		&Set_magics_param_CLEVS,
+		&Reset_magics_param_CLEVS 
+	},
+	{ 
+		"ccols",
+		"contour_param_2",
+		"intarray",
+		&Set_magics_param_CCOLS,
+		&Reset_magics_param_CCOLS
+	},
+	{ 
+		"color_table",
+                "contour_param_3",
+                "intarray",
+                &Set_magics_param_CTABLE,
+                &Reset_magics_param_CTABLE
+        }
+};
+
+int Compare( CdoMagicsMapper  *Parameter_one , CdoMagicsMapper *Parameter_two );
+
+void PrintResult ( const CdoMagicsMapper *c );
+
+
+int Set_magics_param_CCOLS( char *user_name, char *param_value )
+
+{
+	if( user_name == NULL )
+		return 1;
+	printf("Setting the CCOLS magics params \n"); 
+        
+        SetMagicsParameterValue( "contour_shade_colour_method", "string", "list" );
+        SetMagicsParameterValue( "contour_shade_colour_list","stringarray", param_value );
+#if 0
+#endif
+	return 0;
+}
+
+
+int Reset_magics_param_CCOLS( char *user_name )
+
+{
+	printf("Re-Setting the CCOLS magics params \n"); 
+	return 0;
+}
+
+
+int Set_magics_param_CLEVS( char *user_name, char *param_value )
+
+{
+	if( user_name == NULL )
+		return 1;
+
+        SetMagicsParameterValue( "contour_level_selection_type","string", "level_list" );
+        SetMagicsParameterValue( "contour_level_list","floatarray", param_value );
+
+	return 0;
+}
+
+
+int Reset_magics_param_CLEVS( char *user_name )
+
+{
+        SetMagicsParameterValue( "contour_level_selection_type","string", "count" );
+	printf("Re-Setting the CLEVS magics params \n"); 
+	return 0;
+}
+
+int Set_magics_param_CTABLE( char *user_name, char *param_value )
+
+{
+	if( user_name == NULL )
+		return 1;
+	printf("Setting the CTABLE magics params \n"); 
+#if 0
+#if  defined  (HAVE_LIBMAGICS)
+        SetMagicsParameterValue( "contour_level_list", "floatarray", param_value );
+#endif
+#endif
+	return 0;
+}
+
+
+int Reset_magics_param_CTABLE( char *user_name )
+
+{
+	printf("Re-Setting the CTABLE magics params \n"); 
+	return 0;
+}
+
+
+/* This is the comparison function used for sorting and searching. */
+     
+int Compare( CdoMagicsMapper *p1, CdoMagicsMapper *p2 )
+
+{
+	return strcmp ( p1->cdo_name, p2->cdo_name );
+}
+     
+     
+/* Print information about a critter. */
+     
+void PrintResult ( const CdoMagicsMapper *c )
+
+{
+	printf ( "CDO Name:%s\t MAGICS Name:%s\t MAGICS Type:%s\n", c->cdo_name, c->magics_name, c->magics_type );
+}
+     
+     
+/* Do the lookup into the sorted array. */
+
+/* int GetMagicsParameterInfo( const char *user_name, char **magics_name, char **magics_type ) */
+
+int GetMagicsParameterInfo( const char *user_name, char *param_value )
+
+{
+       static int once = 1;
+       int ret_flag = 0;
+       CdoMagicsMapper target, *result;
+       target.cdo_name = (char *) user_name; 
+
+       if( once )
+       {
+       		qsort ( mapper, PARAM_COUNT, sizeof ( CdoMagicsMapper ), ( void * )Compare );
+		once = 0;
+       }
+
+       result = bsearch ( &target, mapper, PARAM_COUNT, sizeof ( CdoMagicsMapper ),
+                          ( void * )Compare );
+       if ( result )
+       {
+		result->Set_magics_param( result->cdo_name, param_value );
+
+		/*
+			*magics_name = result->magics_name;
+			*magics_type = result->magics_type;
+		*/
+       }
+       else
+       {
+	 /* Call the Reset functions of all the features to Reset the magics params to default in the calling function */
+         ret_flag = 1;
+       }
+       return ret_flag;
+}
diff --git a/src/CdoMagicsMapper.h b/src/CdoMagicsMapper.h
new file mode 100644
index 0000000..06f5fc1
--- /dev/null
+++ b/src/CdoMagicsMapper.h
@@ -0,0 +1,12 @@
+#ifndef CDO_MAGICS_MAPPER_HH
+#define CDO_MAGICS_MAPPER_HH
+
+#include<stdio.h>
+#include<stdlib.h>
+#include<string.h>
+
+/* void FindMagicsStruct ( const char *user_name ); */
+
+int GetMagicsParameterInfo( const char *user_name, char *param_value );
+
+#endif
diff --git a/src/Change.c b/src/Change.c
new file mode 100644
index 0000000..d418005
--- /dev/null
+++ b/src/Change.c
@@ -0,0 +1,348 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Change     chcode          Change code number
+      Change     chtabnum        Change GRIB1 parameter table number
+      Change     chparam         Change parameter identifier
+      Change     chname          Change variable name
+      Change     chlevel         Change level
+      Change     chlevelc        Change level of one code
+      Change     chlevelv        Change level of one variable
+      Change     chltype         Change GRIB level type 
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+int stringToParam(const char *paramstr);
+
+#define  MAXARG     16384
+
+void *Change(void *argument)
+{
+  int CHCODE, CHTABNUM, CHPARAM, CHNAME, CHUNIT, CHLEVEL, CHLEVELC, CHLEVELV, CHLTYPE;  
+  int operatorID;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs, nvars;
+  int tsID1, recID, varID = 0, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int chints[MAXARG], nch = 0;
+  char *chnames[MAXARG];
+  char varname[CDI_MAX_NAME];
+  char *chname = NULL;
+  int chcode = 0;
+  int param;
+  int code, tabnum, i;
+  int nmiss;
+  int gridsize;
+  int nfound;
+  int nzaxis, zaxisID1, zaxisID2, k, nlevs, index; 
+  double chlevels[MAXARG];
+  int  chltypes[MAXARG];              
+  double *levels = NULL;
+  double *newlevels = NULL;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  CHCODE   = cdoOperatorAdd("chcode",   0, 0, "pairs of old and new code numbers");
+  CHTABNUM = cdoOperatorAdd("chtabnum", 0, 0, "pairs of old and new GRIB1 table numbers");
+  CHPARAM  = cdoOperatorAdd("chparam",  0, 0, "pairs of old and new parameter identifiers");
+  CHNAME   = cdoOperatorAdd("chname",   0, 0, "pairs of old and new variable names");
+  CHUNIT   = cdoOperatorAdd("chunit",   0, 0, "pairs of old and new variable units");
+  CHLEVEL  = cdoOperatorAdd("chlevel",  0, 0, "pairs of old and new levels");
+  CHLEVELC = cdoOperatorAdd("chlevelc", 0, 0, "code number, old and new level");
+  CHLEVELV = cdoOperatorAdd("chlevelv", 0, 0, "variable name, old and new level");
+  CHLTYPE  = cdoOperatorAdd("chltype",  0, 0, "pairs of old and new type");          
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  nch = operatorArgc();
+
+  if ( operatorID == CHCODE || operatorID == CHTABNUM )
+    {
+      if ( nch%2 ) cdoAbort("Odd number of input arguments!");
+      for ( i = 0; i < nch; i++ )
+	chints[i] = atoi(operatorArgv()[i]);
+    }
+  else if ( operatorID == CHPARAM || operatorID == CHNAME || operatorID == CHUNIT )
+    {
+      if ( nch%2 ) cdoAbort("Odd number of input arguments!");
+      for ( i = 0; i < nch; i++ )
+	chnames[i] = operatorArgv()[i];
+    }
+  else if ( operatorID == CHLEVEL )
+    {
+      if ( nch%2 ) cdoAbort("Odd number of input arguments!");
+      for ( i = 0; i < nch; i++ )
+	chlevels[i] = atof(operatorArgv()[i]);
+    }
+  else if ( operatorID == CHLEVELC )
+    {
+      operatorCheckArgc(3);
+      
+      chcode = atoi(operatorArgv()[0]);
+      chlevels[0] = atof(operatorArgv()[1]);
+      chlevels[1] = atof(operatorArgv()[2]);
+    }
+  else if ( operatorID == CHLEVELV )
+    {
+      operatorCheckArgc(3);
+      
+      chname = operatorArgv()[0];
+      chlevels[0] = atof(operatorArgv()[1]);
+      chlevels[1] = atof(operatorArgv()[2]);
+    }
+  else if ( operatorID == CHLTYPE )                  
+    {
+      if ( nch%2 ) cdoAbort("Odd number of input arguments!");
+      for ( i = 0; i < nch; i++ )
+	chltypes[i] = atoi(operatorArgv()[i]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  if ( operatorID == CHCODE )
+    {
+      nvars = vlistNvars(vlistID2);
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  code = vlistInqVarCode(vlistID2, varID);
+	  for ( i = 0; i < nch; i += 2 )
+	    if ( code == chints[i] )
+	      vlistDefVarCode(vlistID2, varID, chints[i+1]);
+	}
+    }
+  else if ( operatorID == CHTABNUM )
+    {
+      int tableID;
+      nvars = vlistNvars(vlistID2);
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  tabnum = tableInqNum(vlistInqVarTable(vlistID2, varID));
+	  for ( i = 0; i < nch; i += 2 )
+	    if ( tabnum == chints[i] )
+	      {
+		tableID = tableDef(-1, chints[i+1], NULL);
+		vlistDefVarTable(vlistID2, varID, tableID);
+	      }
+	}
+    }
+  else if ( operatorID == CHPARAM )
+    {
+      nvars = vlistNvars(vlistID2);
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  param = vlistInqVarParam(vlistID2, varID);
+	  if ( cdoVerbose )
+	    {
+	      int pnum, pcat, pdis;
+	      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+	      cdoPrint("pnum, pcat, pdis: %d.%d.%d", pnum, pcat, pdis);
+	    }
+	  for ( i = 0; i < nch; i += 2 )
+	    if ( param == stringToParam(chnames[i]) )
+	      vlistDefVarParam(vlistID2, varID, stringToParam(chnames[i+1]));
+	}
+    }
+  else if ( operatorID == CHNAME )
+    {
+      nvars = vlistNvars(vlistID2);
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  vlistInqVarName(vlistID2, varID, varname);
+	  for ( i = 0; i < nch; i += 2 )
+	    if ( strcmp(varname, chnames[i]) == 0 )
+	      vlistDefVarName(vlistID2, varID, chnames[i+1]);
+	}
+    }
+  else if ( operatorID == CHUNIT )
+    {
+      nvars = vlistNvars(vlistID2);
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+
+	  vlistInqVarUnits(vlistID2, varID, varname);
+	  for ( i = 0; i < nch; i += 2 )
+	    if ( strcmp(varname, chnames[i]) == 0 )
+	      vlistDefVarUnits(vlistID2, varID, chnames[i+1]);
+	}
+    }
+  else if ( operatorID == CHLEVEL )
+    {
+      nzaxis = vlistNzaxis(vlistID2);
+      for ( index = 0; index < nzaxis; index++ )
+	{
+	  zaxisID1 = vlistZaxis(vlistID2, index);
+	  nlevs = zaxisInqSize(zaxisID1);
+	  levels = (double *) malloc(nlevs*sizeof(double));
+	  newlevels = (double *) malloc(nlevs*sizeof(double));
+	  zaxisInqLevels(zaxisID1, levels);
+
+	  for ( k = 0; k < nlevs; k++ ) newlevels[k] = levels[k];
+
+	  nfound = 0;
+	  for ( i = 0; i < nch; i += 2 )
+	    for ( k = 0; k < nlevs; k++ )
+	      if ( fabs(levels[k] - chlevels[i]) < 0.0001 ) nfound++;
+
+	  if ( nfound )
+	    {
+	      zaxisID2 = zaxisDuplicate(zaxisID1);
+	      for ( i = 0; i < nch; i += 2 )
+		for ( k = 0; k < nlevs; k++ )
+		  if ( fabs(levels[k] - chlevels[i]) < 0.001 )
+		    newlevels[k] = chlevels[i+1];
+
+	      zaxisDefLevels(zaxisID2, newlevels);
+	      vlistChangeZaxis(vlistID2, zaxisID1, zaxisID2);
+	    }
+
+	  free(levels);
+	  free(newlevels);
+	}
+    }
+  else if ( operatorID == CHLEVELC || operatorID == CHLEVELV )
+    {
+      nvars = vlistNvars(vlistID2);
+      if ( operatorID == CHLEVELC )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      code = vlistInqVarCode(vlistID2, varID);
+	      if ( code == chcode ) break;
+	    }
+	  if ( varID == nvars ) cdoAbort("Code %d not found!", chcode);
+	}
+      else
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      vlistInqVarName(vlistID2, varID, varname);
+	      if ( strcmp(varname, chname) == 0 ) break;
+	    }
+	  if ( varID == nvars ) cdoAbort("Variable name %s not found!", chname);
+	}
+
+      zaxisID1 = vlistInqVarZaxis(vlistID2, varID);
+      nlevs = zaxisInqSize(zaxisID1);
+      levels = (double *) malloc(nlevs*sizeof(double));
+      zaxisInqLevels(zaxisID1, levels);
+      nfound = 0;
+      for ( k = 0; k < nlevs; k++ )
+	if ( fabs(levels[k] - chlevels[0]) < 0.0001 ) nfound++;
+
+      if ( nfound )
+	{
+	  zaxisID2 = zaxisDuplicate(zaxisID1);
+	  for ( k = 0; k < nlevs; k++ )
+	    if ( fabs(levels[k] - chlevels[0]) < 0.001 )
+	      levels[k] = chlevels[1];
+
+	  zaxisDefLevels(zaxisID2, levels);
+	  vlistChangeVarZaxis(vlistID2, varID, zaxisID2);
+	}
+      else
+	cdoAbort("Level %g not found!", chlevels[0]);
+
+      free(levels);
+    }
+  else if ( operatorID == CHLTYPE )                
+    {
+      int zaxistype, zaxistype1, zaxistype2, ltype, ltype1, ltype2, sameltype;
+
+      nzaxis = vlistNzaxis(vlistID2);
+      for ( index = 0; index < nzaxis; index++ )
+	{
+	  zaxisID1 = vlistZaxis(vlistID2, index);
+	  zaxisID2 = zaxisDuplicate(zaxisID1);
+
+	  zaxistype = zaxisInqType(zaxisID1);
+	  ltype = zaxisInqLtype(zaxisID1);
+
+	  for ( i = 0; i < nch; i += 2 )
+	    {
+	      sameltype = FALSE;
+	      ltype1 = chltypes[i];
+	      ltype2 = chltypes[i+1];
+
+	      zaxistype1 = ltype2ztype(ltype1);
+	      zaxistype2 = ltype2ztype(ltype2);
+
+	      if ( zaxistype1 == zaxistype ) sameltype = TRUE;
+
+	      if ( !(zaxistype1 == ZAXIS_GENERIC && ltype1 == ltype) ) sameltype = FALSE;
+
+	      if ( sameltype)
+		{
+		  zaxisChangeType(zaxisID2, zaxistype2);
+		  if ( zaxistype == ZAXIS_GENERIC ) zaxisDefLtype(zaxisID2, ltype2);
+		  vlistChangeZaxis(vlistID2, zaxisID1, zaxisID2);
+		}
+	    }
+	}
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID2);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID1 = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID1)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID1);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  
+	  streamReadRecord(streamID1, array, &nmiss);
+	  streamWriteRecord(streamID2, array, nmiss);
+	}
+      tsID1++;
+    }
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Change_e5slm.c b/src/Change_e5slm.c
new file mode 100644
index 0000000..78d8130
--- /dev/null
+++ b/src/Change_e5slm.c
@@ -0,0 +1,192 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied 1warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Change_e5slm      change_e5slm          Change ECHAM5 sea land mask
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Change_e5slm(void *argument)
+{
+  int streamIDslm, streamID1, streamID2;
+  const char *fn_slm;
+  char name[CDI_MAX_NAME];
+  int nrecs, code;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int vlistIDslm, vlistID1, vlistID2 = -1;
+  int nmiss, nvars;
+  int taxisID1, taxisID2;
+  short *codes = NULL;
+  short *lsea = NULL;
+  long i;
+  double minval, maxval;
+  double *array = NULL;
+  double *cland = NULL;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  taxisID1 = vlistInqTaxis(vlistID1);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  vlistID2 = vlistDuplicate(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamDefVlist(streamID2, vlistID2);
+
+
+  /* get filename of SLM */
+  operatorInputArg("filename of the sea land mask");
+  operatorCheckArgc(1);
+  fn_slm = operatorArgv()[0];
+
+  /* read SLM */
+  streamIDslm = streamOpenRead(fn_slm);
+
+  vlistIDslm = streamInqVlist(streamIDslm);
+
+  gridsize = gridInqSize(vlistInqVarGrid(vlistIDslm, 0));
+
+  array = (double *) malloc(gridsize*sizeof(double));
+  cland = (double *) malloc(gridsize*sizeof(double));
+  lsea  = (short *)  malloc(gridsize*sizeof(short));
+
+  streamInqTimestep(streamIDslm, 0);
+
+  streamInqRecord(streamIDslm, &varID, &levelID);
+  streamReadRecord(streamIDslm, cland, &nmiss);
+
+  if ( nmiss > 0 ) cdoAbort("SLM with missing values are unsupported!");
+
+  minmaxval(gridsize, cland, NULL, &minval, &maxval);
+  if ( minval < 0 || maxval > 1 )
+    cdoWarning("Values of SLM out of bounds! (minval=%g, maxval=%g)", minval , maxval);
+
+  streamClose(streamIDslm);
+
+  for ( i = 0; i < gridsize; ++i )
+    {
+      if ( cland[i] > 0 )
+	lsea[i] = FALSE;
+      else
+	lsea[i] = TRUE;
+    }
+
+
+  nvars = vlistNvars(vlistID1);
+  codes = (short *) malloc(nvars*sizeof(short));
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      if ( gridsize != gridInqSize(vlistInqVarGrid(vlistID1, varID)) )
+	cdoAbort("gridsize differ!");
+
+      code = vlistInqVarCode(vlistID1, varID);
+      vlistInqVarName(vlistID1, varID, name);
+
+      if ( code < 0 )
+	{
+	  if      ( strcmp(name, "SLM")       == 0 ) code = 172;
+	  else if ( strcmp(name, "ALAKE")     == 0 ) code = 99;
+	  else if ( strcmp(name, "WS")        == 0 ) code = 140;
+	  else if ( strcmp(name, "AZ0")       == 0 ) code = 173;
+	  else if ( strcmp(name, "ALB")       == 0 ) code = 174;
+	  else if ( strcmp(name, "VGRAT")     == 0 ) code = 198;
+	  else if ( strcmp(name, "FOREST")    == 0 ) code = 212;
+	  else if ( strcmp(name, "FAO")       == 0 ) code = 226;
+	  else if ( strcmp(name, "WSMX")      == 0 ) code = 229;
+	  else if ( strcmp(name, "GLAC")      == 0 ) code = 232;
+	  else if ( strcmp(name, "VLTCLIM")   == 0 ) code = 71;
+	  else if ( strcmp(name, "VGRATCLIM") == 0 ) code = 70;
+	}
+
+      codes[varID] = code;
+    }
+
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+      
+      for ( recID = 0; recID < nrecs; recID++ )
+	{ 
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array, &nmiss);
+
+	  code = codes[varID];
+	  if ( code == 172 )
+	    {
+	      cdoPrint("SLM changed!");
+	      for ( i = 0; i < gridsize; ++i )
+		array[i] = cland[i];
+	    }
+	  else if ( code == 99 )
+	    {
+	      cdoPrint("ALAKE set all values to zero!");
+	      for ( i = 0; i < gridsize; ++i )
+		array[i] = 0;
+	    }
+	  else if ( code == 232 )
+	    {
+	      cdoPrint("GLAC set sea points to %g!", array[0]);
+	      for ( i = 0; i < gridsize; ++i )
+		if ( cland[i] < 0.5 ) array[i] = array[0];
+	    }
+	  else if ( code ==  70 || code ==  71 || code == 140 ||
+		    code == 173 || code == 174 || code == 198 ||
+		    code == 200 || code == 212 || code == 226 ||
+		    code == 229 )
+	    {
+	      cdoPrint("Code %d set sea points to %g!", code, array[0]);
+	      for ( i = 0; i < gridsize; ++i )
+		if ( lsea[i] ) array[i] = array[0];
+	    }
+
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  streamWriteRecord(streamID2, array, nmiss);
+	}
+
+      tsID++;
+    }
+  
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  free(array);
+  free(cland);
+  free(lsea);
+  free(codes);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Cloudlayer.c b/src/Cloudlayer.c
new file mode 100644
index 0000000..eb44993
--- /dev/null
+++ b/src/Cloudlayer.c
@@ -0,0 +1,413 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "vinterp.h"
+
+
+#define  SCALESLP        (101325.0)
+
+
+/* ================================================= */
+/* LayerCloud calculates random overlap cloud cover */
+/* ================================================= */
+
+static
+void layer_cloud(const double *cc, double *ll, long MaxLev, long MinLev, long dimgp)
+{
+  long i, k;
+  double maxval, minval;
+  double ZEPSEC;
+
+  ZEPSEC = 1.-1.0e-12;
+
+  for ( i = 0; i < dimgp; i++ ) ll[i] = 1. - cc[i+MaxLev*dimgp];
+
+  //  printf("maxlev %d minlev %d\n", MaxLev, MinLev);
+
+  for ( k = MaxLev + 1; k <= MinLev; k++ )
+    {
+      for ( i = 0; i < dimgp; i++ )
+	{
+	  maxval = MAX(cc[i+(k-1)*dimgp], cc[i+k*dimgp]);
+	  minval = MIN(cc[i+(k-1)*dimgp], ZEPSEC);
+	  ll[i] *= (1. - maxval) / (1. - minval);
+	}
+    }
+
+  for ( i = 0; i < dimgp; i++ ) ll[i] = 1. - ll[i];
+}
+
+static
+void vct2plev(const double *vct, double *plevs, long nlevs)
+{
+  long k;
+
+  for ( k = 0; k < nlevs; k++ )
+    plevs[k] = vct[k] + vct[k+nlevs] * SCALESLP;
+  /*
+  for ( k = 0; k < nlevs; k++ )
+    printf("plevs %ld %g\n", k, plevs[k]);
+  
+  for ( k = 1; k < nlevs; k++ )
+    printf("plevs %ld %g\n", k-1, (plevs[k]+plevs[k-1])/2);
+  */
+}
+
+static
+void hl_index(int *kmax, int *kmin, double pmax, double pmin, long nhlevs, double *pph)
+{
+  long k;
+  long MaxLev, MinLev;
+   
+  for ( k = 0; k < nhlevs; k++ )
+    if ( pph[k] > pmax ) break;
+  
+  MaxLev = k - 1;
+  
+  for ( k  = nhlevs - 1; k >= 0; k-- )
+    if ( pph[k] < pmin ) break;
+   
+  MinLev = k;
+
+  *kmax = MaxLev;
+  *kmin = MinLev;
+}
+
+static
+void pl_index(int *kmax, int *kmin, double pmax, double pmin, long nlevs, double *plevs)
+{
+  long k;
+  long MaxLev = -1, MinLev = -1;
+   
+  for ( k = 0; k < nlevs; k++ )
+    if ( plevs[k] >= pmax )
+      {
+	MaxLev = k;
+	break;
+      }
+  
+  for ( k  = nlevs - 1; k >= 0; k-- )
+    if ( plevs[k] < pmin )
+      {
+	MinLev = k;
+	break;
+      }
+   
+  *kmax = MaxLev;
+  *kmin = MinLev;
+}
+
+
+#define NVARS  3
+
+void *Cloudlayer(void *argument)
+{
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int gridID, zaxisID, tsID;
+  int surfaceID;
+  int nlevel, nhlev, nlevs, nrecs, recID, code;
+  int varID, levelID;
+  int zrev = FALSE;
+  int nvars;
+  int gridsize, i;
+  int offset;
+  int nmiss;
+  int ngp = 0, ngrids;
+  int aclcac_code;
+  int aclcacID = -1;
+  int nvars2 = 0;
+  int aclcac_code_found = 0;
+  int kmin[NVARS], kmax[NVARS];
+  char varname[CDI_MAX_NAME];
+  double sfclevel = 0;
+  double *plevs = NULL;
+  double *aclcac = NULL;
+  double *cloud[NVARS];
+  double missval;
+  double pmin = 0, pmax = 0;
+
+  cdoInitialize(argument);
+
+  if ( operatorArgc() > 0 )
+    {
+      operatorCheckArgc(2);
+      nvars2 = 1;
+      pmin = atof(operatorArgv()[0]);
+      pmax = atof(operatorArgv()[1]);
+    }
+  else
+    {
+      nvars2 = NVARS;
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  ngrids  = vlistNgrids(vlistID1);
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) != GRID_SPECTRAL )
+	{
+	  ngp = gridInqSize(gridID);
+	  break;
+	}
+    }
+
+  /* check gridsize */
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) != GRID_SPECTRAL )
+	{
+	  if ( ngp != gridInqSize(gridID) )
+	    cdoAbort("Grids have different size!");
+	}
+    }
+
+  aclcac_code = 223;
+
+  nvars = vlistNvars(vlistID1);
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(zaxisID);
+
+      code = vlistInqVarCode(vlistID1, varID);
+
+      if ( code <= 0 )
+	{
+	  vlistInqVarName(vlistID1, varID, varname);
+	  strtolower(varname);
+	  if ( strcmp(varname, "aclcac") == 0 ) code = 223;
+	}
+
+      if  ( code == aclcac_code )
+	{
+	  aclcac_code_found = 1;
+	  if ( zaxisInqType(zaxisID) == ZAXIS_PRESSURE || zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+	    {
+	      aclcacID  = varID;
+	      break;
+	    }
+	}
+    }
+
+  if ( aclcacID == -1 )
+    {
+      if ( aclcac_code_found )
+	cdoAbort("Cloud cover (parameter 223) not found on pressure or hybrid levels!");
+      else
+	cdoAbort("Cloud cover (parameter 223) not found!");
+    }
+
+  missval = vlistInqVarMissval(vlistID1, aclcacID);
+  gridID  = vlistInqVarGrid(vlistID1, aclcacID);
+  zaxisID = vlistInqVarZaxis(vlistID1, aclcacID);
+
+  gridsize = gridInqSize(gridID);
+  nlevel = zaxisInqSize(zaxisID);
+  nhlev  = nlevel+1;
+
+  aclcac = (double *) malloc(gridsize*nlevel*sizeof(double));
+  for ( varID = 0; varID < nvars2; ++varID )
+    cloud[varID] = (double *) malloc(gridsize*sizeof(double));
+
+  if ( zaxisInqType(zaxisID) == ZAXIS_PRESSURE )
+    {
+      plevs = (double *) malloc(nlevel*sizeof(double));
+      zaxisInqLevels(zaxisID, plevs);
+      if ( plevs[0] > plevs[nlevel-1] )
+	{
+	  double ptmp;
+	  zrev = TRUE;
+	  for ( levelID = 0; levelID < nlevel/2; ++levelID )
+	    {
+	      ptmp = plevs[levelID];
+	      plevs[levelID] = plevs[nlevel-1-levelID];
+	      plevs[nlevel-1-levelID] = ptmp;
+	    }
+	}
+      /*
+      for ( levelID = 0; levelID < nlevel; ++levelID )
+	{
+	  printf("level %d %g\n", levelID, plevs[levelID]);
+	}
+      */
+      if ( nvars2 == 1 )
+	{
+	  pl_index(&kmax[0], &kmin[0], pmin, pmax, nlevel, plevs);
+	}
+      else
+	{
+	  pl_index(&kmax[2], &kmin[2],  5000., 44000., nlevel, plevs);
+	  pl_index(&kmax[1], &kmin[1], 46000., 73000., nlevel, plevs);
+	  pl_index(&kmax[0], &kmin[0], 75000.,101300., nlevel, plevs);
+	}
+
+      free(plevs);
+    }
+  else if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+    {
+      int nvct;
+
+      nvct = zaxisInqVctSize(zaxisID);
+      if ( nlevel == (nvct/2 - 1) )
+	{
+	  double *vct;
+
+	  vct = (double *) malloc(nvct*sizeof(double));
+	  zaxisInqVct(zaxisID, vct);
+
+	  nlevs = nlevel + 1;
+	  plevs = (double *) malloc(nlevs*sizeof(double));
+	  vct2plev(vct, plevs, nlevs);
+	  free(vct);
+
+	  if ( nvars2 == 1 )
+	    {
+	      hl_index(&kmax[0], &kmin[0], pmin, pmax, nhlev, plevs);
+	    }
+	  else
+	    {
+	      hl_index(&kmax[2], &kmin[2],  5000., 44000., nhlev, plevs);
+	      hl_index(&kmax[1], &kmin[1], 46000., 73000., nhlev, plevs);
+	      hl_index(&kmax[0], &kmin[0], 75000.,101300., nhlev, plevs);
+	    }
+
+	  free(plevs);
+ 	}
+      else
+	cdoAbort("Unsupported vertical coordinate table format!");
+   }
+  else
+    cdoAbort("Unsupported Z-Axis type!");
+
+
+  surfaceID = zaxisCreate(ZAXIS_SURFACE, 1);
+  zaxisDefLevels(surfaceID, &sfclevel);
+
+  vlistID2 = vlistCreate();
+
+  if ( nvars2 == 1 )
+    {
+      varID = vlistDefVar(vlistID2, gridID, surfaceID, TSTEP_INSTANT);
+      vlistDefVarCode(vlistID2, varID, 33);
+      vlistDefVarName(vlistID2, varID, "cld_lay");
+      vlistDefVarLongname(vlistID2, varID, "cloud layer");
+      vlistDefVarMissval(vlistID2, varID, missval);
+    }
+  else
+    {
+      varID = vlistDefVar(vlistID2, gridID, surfaceID, TSTEP_INSTANT);
+      vlistDefVarCode(vlistID2, varID, 34);
+      vlistDefVarName(vlistID2, varID, "low_cld");
+      vlistDefVarLongname(vlistID2, varID, "low cloud");
+      vlistDefVarMissval(vlistID2, varID, missval);
+
+      varID = vlistDefVar(vlistID2, gridID, surfaceID, TSTEP_INSTANT);
+      vlistDefVarCode(vlistID2, varID, 35);
+      vlistDefVarName(vlistID2, varID, "mid_cld");
+      vlistDefVarLongname(vlistID2, varID, "mid cloud");
+      vlistDefVarMissval(vlistID2, varID, missval);
+
+      varID = vlistDefVar(vlistID2, gridID, surfaceID, TSTEP_INSTANT);
+      vlistDefVarCode(vlistID2, varID, 36);
+      vlistDefVarName(vlistID2, varID, "hih_cld");
+      vlistDefVarLongname(vlistID2, varID, "high cloud");
+      vlistDefVarMissval(vlistID2, varID, missval);
+    }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+     
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( zrev )
+	    offset = (nlevel-1-levelID)*gridsize;
+	  else
+	    offset = levelID*gridsize;
+
+	  if ( varID == aclcacID )
+	    {
+	      streamReadRecord(streamID1, aclcac+offset, &nmiss);
+	      if ( nmiss != 0 ) cdoAbort("Missing values unsupported!");
+	    }
+	}
+
+      for ( varID = 0; varID < nvars2; ++varID )
+	{
+	  for ( i = 0; i < gridsize; i++ ) cloud[varID][i] = missval;
+	}
+
+      for ( varID = 0; varID < nvars2; ++varID )
+	{
+	  if ( kmax[varID] != -1 && kmin[varID] != -1 )
+	    layer_cloud(aclcac, cloud[varID], kmax[varID], kmin[varID], gridsize);
+	}
+
+      for ( varID = 0; varID < nvars2; ++varID )
+	{
+	  nmiss = 0;
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( DBL_IS_EQUAL(cloud[varID][i], missval) ) nmiss++;
+
+	  streamDefRecord(streamID2, varID, 0);
+	  streamWriteRecord(streamID2, cloud[varID], nmiss);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+ 
+  vlistDestroy(vlistID2);
+
+  free(aclcac);
+  for ( varID = 0; varID < nvars2; ++varID )
+    free(cloud[varID]);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Command.c b/src/Command.c
new file mode 100644
index 0000000..74b3462
--- /dev/null
+++ b/src/Command.c
@@ -0,0 +1,389 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+*/
+
+#include <ctype.h>  /* isspace */
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "counter.h"
+
+
+typedef struct
+{
+  int   param;
+  char  name[CDI_MAX_NAME];
+  char  longname[CDI_MAX_NAME];
+  char  units[CDI_MAX_NAME];
+} vars_t;
+
+vars_t *all_vars = NULL;
+
+int gl_streamID = 0;
+int gl_vlistID = 0;
+int gl_varID = 0;
+int gl_nvars = 0;
+int levelID = 0;
+int gl_tsID1 = 0;
+int gl_tsID2 = 0;
+double *gl_data = NULL;
+
+#define MAX_LINE 256
+
+int Done = 0;
+
+int com_help(char *);
+int com_list(char *);
+int com_quit(char *);
+int com_stat(char *);
+int com_set(char *);
+int com_vars(char *);
+//int com_stat(char *);
+
+
+typedef struct {
+  char  *name; /* User printable name of the function. */
+  int  (*func)(char *); /* Function to call to do the job. */
+  char  *doc; /* Documentation for this function. */
+}
+command_t;
+
+command_t commands[] = {
+  { "help", com_help, "Display this text" },
+  { "?",    com_help, "Synonym for 'help'" },
+  { "list", com_list, "List files in DIR" },
+  { "quit", com_quit, "Quit using CDO" },
+  { "stat", com_stat, "Statistic for selected field" },
+  { "set",  com_set,  "set variables" },
+  { "vars", com_vars, "list variables" },
+  //  { "stat", com_stat, "Print out statistics on FILE" },
+  { NULL, NULL, NULL }
+};
+
+
+/* Return non-zero if ARG is a valid argument for CALLER, else print
+an error message and return zero. */
+int valid_argument (char *caller, char *arg)
+{
+  if (!arg || !*arg)
+    {
+      fprintf (stderr, "%s: Argument required.\n", caller);
+      return (0);
+    }
+  return (1);
+}
+
+/* Print out help for ARG, or for all of the commands if ARG is not present. */
+int com_help(char *arg)
+{
+  int i;
+  int printed = 0;
+
+  for ( i = 0; commands[i].name; i++ )
+    {
+      if (!*arg || (strcmp (arg, commands[i].name) == 0))
+	{
+	  printf ("%s\t\t%s.\n", commands[i].name, commands[i].doc);
+	  printed++;
+	}
+    }
+
+  if ( !printed )
+    {
+      printf ("No commands match '%s'. Possibilties are:\n", arg);
+      for (i = 0; commands[i].name; i++)
+	{
+	  /* Print in six columns. */
+	  if ( printed == 6 )
+	    {
+	      printed = 0;
+	      printf ("\n");
+	    }
+	  printf("%s\t", commands[i].name);
+	  printed++;
+	}
+
+      if (printed) printf ("\n");
+    }
+
+  return (0);
+}
+
+
+/* List the file(s) named in arg. */
+int com_list(char *arg)
+{
+  if (!arg)
+    arg = "";
+
+  return (0);
+}
+
+/* The user wishes to quit using this program. Just set DONE non-zero. */
+int com_quit(char *arg)
+{
+  Done = 1;
+
+  return (0);
+}
+
+
+int com_stat(char *arg)
+{
+  int nrecs;
+  int tsID;
+
+  fprintf(stdout, "name=%s\n", all_vars[gl_varID].name);
+
+  for ( tsID = gl_tsID1; tsID <= gl_tsID2; ++tsID )
+    {
+      nrecs = streamInqTimestep(gl_streamID, tsID);
+      if ( nrecs == 0 )
+	{
+	  fprintf(stderr, "Timestep %d out of range!\n", tsID+1);
+	  break;
+	}
+      else
+	{
+	  int i;
+	  int nmiss;
+	  int gridsize;
+	  double fmin = 1.e50 , fmax = -1.e50, fmean = 0;
+	  counter_t counter;
+	  
+	  counter_start(&counter);
+	  streamReadVarSlice(gl_streamID, gl_varID, levelID, gl_data, &nmiss);
+	  gridsize = gridInqSize(vlistInqVarGrid(gl_vlistID, gl_varID));
+	  for ( i = 0; i < gridsize; ++i )
+	    {
+	      if ( gl_data[i] < fmin ) fmin = gl_data[i];
+	      if ( gl_data[i] > fmax ) fmax = gl_data[i];
+	      fmean += gl_data[i];
+	    }
+	  fmean /= gridsize;
+	  counter_stop(&counter);
+	  
+	  fprintf(stdout, "timestep=%d %g %g %g (%gs)\n",
+		  tsID+1, fmin, fmean, fmax,
+		  counter_cputime(counter));
+	}
+    }
+
+  return (0);
+}
+
+
+int com_set(char *arg)
+{
+  printf("com_set: %s\n", arg);
+
+  return (0);
+}
+
+
+int com_vars(char *arg)
+{
+  int varID;
+  char paramstr[32];
+
+  if ( !arg ) arg = "";
+  printf("com_vars: %s %d\n", arg, gl_nvars);
+
+  for ( varID = 0; varID < gl_nvars; ++varID )
+    {
+      cdiParamToString(all_vars[varID].param, paramstr, sizeof(paramstr));
+
+      fprintf(stdout,"varID=%3d, param=%s, name=%s %s %s\n",
+	      varID+1, paramstr, all_vars[varID].name, all_vars[varID].longname, all_vars[varID].units);
+    }
+
+  return (0);
+}
+
+/* Look up NAME as the name of a command, and return a pointer to that
+   command. Return a NULL pointer if NAME isn't a command name. */
+command_t *find_command(char *name)
+{
+  int i;
+
+  for ( i = 0; commands[i].name; i++ )
+    if ( strcmp(name, commands[i].name) == 0)
+      return (&commands[i]);
+
+  return ((command_t *)NULL);
+}
+
+/* Execute a command line. */
+int execute_line(char *line)
+{
+  int i;
+  command_t *command;
+  char *word;
+
+  /* Isolate the command word. */
+  i = 0;
+  while ( line[i] && isspace(line[i]) )  i++;
+  word = line + i;
+  while ( line[i] && !isspace(line[i]) ) i++;
+
+  if ( line[i] ) line[i++] = '\0';
+
+  command = find_command(word);
+  if ( !command )
+    {
+      fprintf (stderr, "%s: No such command!\n", word);
+      return (-1);
+    }
+  /* Get argument to command, if any. */
+  while ( isspace(line[i]) ) i++;
+
+  word = line + i;
+  /* Call the function. */
+  return ((*(command->func)) (word));
+}
+
+/* Strip isspace from the start and end of STRING. Return a pointer into STRING. */
+char *stripwhite(char *string)
+{
+  char *s, *t;
+  for (s = string; isspace(*s); s++)
+    ;
+  if (*s == 0)
+    return (s);
+  t = s + strlen (s) - 1;
+  while (t > s && isspace(*t))
+    t--;
+  *++t = '\0';
+
+  return s;
+}
+
+
+void readcmd(const char *prompt, char *line, int size)
+{
+  fputs(prompt, stdout);
+  fflush(stdout);
+
+  *line = '\0';
+  if ( fgets(line, size, stdin) )
+    {
+      char *newline = strchr(line, '\n'); /* check for trailing '\n' */
+      if ( newline )
+	*newline = '\0'; /* overwrite the '\n' with a terminating null */
+    }
+}
+
+
+void command_init()
+{
+  int gridsize;
+  int taxisID;
+  int varID;
+
+  gl_vlistID = streamInqVlist(gl_streamID);
+  taxisID = vlistInqTaxis(gl_vlistID);
+
+  gridsize = vlistGridsizeMax(gl_vlistID);
+  gl_data = (double *) malloc(gridsize*sizeof(double));
+
+  gl_nvars = vlistNvars(gl_vlistID);
+  all_vars = (vars_t *) malloc(gl_nvars*sizeof(vars_t));
+
+  for ( varID = 0; varID < gl_nvars; ++varID )
+    {
+      all_vars[varID].param   = vlistInqVarParam(gl_vlistID, varID);
+      vlistInqVarName(gl_vlistID, varID, all_vars[varID].name);
+      vlistInqVarLongname(gl_vlistID, varID, all_vars[varID].longname);
+      vlistInqVarUnits(gl_vlistID, varID, all_vars[varID].units);
+    }
+}
+
+
+void *Command(void *argument)
+{
+  int nrecs;
+  int recID, varID, levelID;
+  int nmiss;
+  double s_utime, s_stime;
+  double e_utime, e_stime;
+  double c_cputime = 0, c_usertime = 0, c_systime = 0;
+  char line[MAX_LINE];
+  char *s;
+ 
+  cdoInitialize(argument);
+
+  processStartTime(&s_utime, &s_stime);
+
+  gl_streamID = streamOpenRead(cdoStreamName(0));
+
+  command_init();
+  
+  /* Loop reading and executing lines until the user quits. */
+  while ( !Done )
+    {
+      readcmd("cdo cmd> ", line, MAX_LINE);
+
+      /* Remove leading and trailing whitespace from the line.
+	 Then, if there is anything left, add it to the history list
+	 and execute it. */
+      s = stripwhite(line);
+      if ( *s ) execute_line(s);
+    }
+
+
+/*
+  while ( readline(stdin, line, MAX_LINE) )
+    {
+      linep = line;
+      
+      if      ( strcmp(linep, "exit") == 0 ) break;
+      else if ( strcmp(linep, "vars") == 0 )
+	{
+	  int varID;
+	  int nvars = vlistNvars(gl_vlistID);
+	  for ( varID = 0; varID < nvars; ++nvars )
+	    {
+	      fprintf(stdout,"varID %d\n", varID);
+	    }
+	}
+    }
+*/
+  
+  streamClose(gl_streamID);
+
+  if ( gl_data ) free(gl_data);
+  if ( all_vars ) free(all_vars);
+  
+  cdoProcessTime(&e_utime, &e_stime);
+
+  c_usertime = e_utime - s_utime;
+  c_systime  = e_stime - s_stime;
+  c_cputime  = c_usertime + c_systime;
+
+  s_utime = e_utime;
+  s_stime = e_stime;
+
+  cdoPrint("%.2fs %.2fs %.2fs", c_usertime, c_systime, c_cputime);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Comp.c b/src/Comp.c
new file mode 100644
index 0000000..d636426
--- /dev/null
+++ b/src/Comp.c
@@ -0,0 +1,302 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Comp       eq              Equal
+      Comp       ne              Not equal
+      Comp       le              Less equal
+      Comp       lt              Less than
+      Comp       ge              Greater equal
+      Comp       gt              Greater than
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Comp(void *argument)
+{
+  int EQ, NE, LE, LT, GE, GT;
+  int operatorID;
+  enum {FILL_NONE, FILL_TS, FILL_REC};
+  int filltype = FILL_NONE;
+  int streamIDx1, streamIDx2, streamID1, streamID2, streamID3;
+  int gridsize, gridsize1, gridsize2;
+  int nrecs, nrecs2, nvars = 0, nlev, recID;
+  int tsID;
+  int varID, levelID;
+  int offset;
+  int ntsteps1, ntsteps2;
+  int vlistIDx1, vlistIDx2, vlistID1, vlistID2, vlistID3;
+  int taxisIDx1, taxisID1, taxisID2, taxisID3;
+  int nmiss1, nmiss2, nmiss3;
+  int i;
+  double missval1, missval2 = 0;
+  double *missvalx1, *missvalx2;
+  double *arrayx1, *arrayx2, *array1, *array2, *array3;
+  double **vardata = NULL;
+
+  cdoInitialize(argument);
+
+  EQ = cdoOperatorAdd("eq", 0, 0, NULL);
+  NE = cdoOperatorAdd("ne", 0, 0, NULL);
+  LE = cdoOperatorAdd("le", 0, 0, NULL);
+  LT = cdoOperatorAdd("lt", 0, 0, NULL);
+  GE = cdoOperatorAdd("ge", 0, 0, NULL);
+  GT = cdoOperatorAdd("gt", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  streamIDx1 = streamID1;
+  streamIDx2 = streamID2;
+
+  missvalx1 = &missval1;
+  missvalx2 = &missval2;
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistIDx1 = vlistID1;
+  vlistIDx2 = vlistID2;
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisIDx1 = taxisID1;
+
+  ntsteps1 = vlistNtsteps(vlistID1);
+  ntsteps2 = vlistNtsteps(vlistID2);
+  if ( ntsteps1 == 0 ) ntsteps1 = 1;
+  if ( ntsteps2 == 0 ) ntsteps2 = 1;
+
+  if ( vlistNrecs(vlistID1) != 1 && vlistNrecs(vlistID2) == 1 )
+    {
+      filltype = FILL_REC;
+      cdoPrint("Filling up stream2 >%s< by copying the first record.", cdoStreamName(1));
+    }
+  else if ( vlistNrecs(vlistID1) == 1 && vlistNrecs(vlistID2) != 1 )
+    {
+      filltype = FILL_REC;
+      cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoStreamName(0));
+      streamIDx1 = streamID2;
+      streamIDx2 = streamID1;
+      vlistIDx1 = vlistID2;
+      vlistIDx2 = vlistID1;
+      taxisIDx1 = taxisID2;
+    }
+
+  if ( filltype == FILL_NONE )
+    vlistCompare(vlistID1, vlistID2, CMP_ALL);
+
+  nospec(vlistID1);
+  nospec(vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistIDx1);
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+  array3 = (double *) malloc(gridsize*sizeof(double));
+
+  arrayx1 = array1;
+  arrayx2 = array2;
+
+  if ( cdoVerbose )
+    cdoPrint("Number of timesteps: file1 %d, file2 %d", ntsteps1, ntsteps2);
+
+  if ( filltype == FILL_NONE )
+    {
+      if ( ntsteps1 != 1 && ntsteps2 == 1 )
+	{
+	  filltype = FILL_TS;
+	  cdoPrint("Filling up stream2 >%s< by copying the first timestep.", cdoStreamName(1));
+	}
+      else if ( ntsteps1 == 1 && ntsteps2 != 1 )
+	{
+	  filltype = FILL_TS;
+	  cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0));
+	  streamIDx1 = streamID2;
+          streamIDx2 = streamID1;
+	  vlistIDx1 = vlistID2;
+	  vlistIDx2 = vlistID1;
+	  taxisIDx1 = taxisID2;
+	}
+
+      if ( filltype == FILL_TS )
+	{
+	  nvars  = vlistNvars(vlistIDx2);
+	  vardata  = (double **) malloc(nvars*sizeof(double *));
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistIDx2, varID));
+	      nlev     = zaxisInqSize(vlistInqVarZaxis(vlistIDx2, varID));
+	      vardata[varID]  = (double *) malloc(nlev*gridsize*sizeof(double));
+	    }
+	}
+    }
+
+  if ( filltype != FILL_NONE && ntsteps1 == 1 )
+    {
+      arrayx1 = array2;
+      arrayx2 = array1;
+      missvalx1 = &missval2;
+      missvalx2 = &missval1;
+    }
+
+  vlistID3 = vlistDuplicate(vlistIDx1);
+
+  taxisID3 = taxisDuplicate(taxisIDx1);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamIDx1, tsID)) )
+    {
+      if ( tsID == 0 || filltype == FILL_NONE )
+	{
+	  nrecs2 = streamInqTimestep(streamIDx2, tsID);
+	  if ( nrecs2 == 0 )
+	    cdoAbort("Input streams have different number of timesteps!");
+	}
+	  
+      taxisCopyTimestep(taxisID3, taxisIDx1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamIDx1, &varID, &levelID);
+	  streamReadRecord(streamIDx1, arrayx1, &nmiss1);
+
+	  if ( tsID == 0 || filltype == FILL_NONE )
+	    {
+	      if ( recID == 0 || filltype != FILL_REC )
+		{
+		  streamInqRecord(streamIDx2, &varID, &levelID);
+		  streamReadRecord(streamIDx2, arrayx2, &nmiss2);
+		}
+
+	      if ( filltype == FILL_TS )
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistIDx2, varID));
+		  offset   = gridsize*levelID;
+		  memcpy(vardata[varID]+offset, arrayx2, gridsize*sizeof(double));
+		}
+	    }
+	  else if ( filltype == FILL_TS )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistIDx2, varID));
+	      offset   = gridsize*levelID;
+	      memcpy(arrayx2, vardata[varID]+offset, gridsize*sizeof(double));
+	    }
+
+	  gridsize1 = gridInqSize(vlistInqVarGrid(vlistIDx1, varID));
+	  *missvalx1 = vlistInqVarMissval(vlistIDx1, varID);
+
+	  if ( filltype == FILL_REC )
+	    {
+	      gridsize2 = gridInqSize(vlistInqVarGrid(vlistIDx2, 0));
+	      *missvalx2 = vlistInqVarMissval(vlistIDx2, 0);
+	    }
+	  else
+	    {
+	      gridsize2 = gridInqSize(vlistInqVarGrid(vlistIDx2, varID));
+	      *missvalx2 = vlistInqVarMissval(vlistIDx2, varID);
+	    }
+
+	  if ( gridsize1 != gridsize2 ) cdoAbort("Streams have different gridsize (gridsize1 = %d; gridsize2 = %d!",
+						 gridsize1, gridsize2);
+
+	  gridsize = gridsize1;
+
+	  if ( operatorID == EQ )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array3[i] = (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ?
+			     missval1 : DBL_IS_EQUAL(array1[i], array2[i]));
+	    }
+	  else if ( operatorID == NE )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array3[i] = (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ?
+			     missval1 : !DBL_IS_EQUAL(array1[i], array2[i]));
+	    }
+	  else if ( operatorID == LE )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array3[i] = (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ?
+			     missval1 : array1[i] <= array2[i]);
+	    }
+	  else if ( operatorID == LT )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array3[i] = (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ?
+			     missval1 : array1[i] < array2[i]);
+	    }
+	  else if ( operatorID == GE )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array3[i] = (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ?
+			     missval1 : array1[i] >= array2[i]);
+	    }
+	  else if ( operatorID == GT )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array3[i] = (DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) ?
+			     missval1 : array1[i] > array2[i]);
+	    }
+	  else
+	    {
+	      cdoAbort("Operator not implemented!");
+	    }
+
+	  nmiss3 = 0;
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( DBL_IS_EQUAL(array3[i], missval1) ) nmiss3++;
+
+	  streamDefRecord(streamID3, varID, levelID);
+	  streamWriteRecord(streamID3, array3, nmiss3);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( vardata )
+    {
+      for ( varID = 0; varID < nvars; varID++ ) free(vardata[varID]);
+      free(vardata);
+    }
+
+  if ( array3 ) free(array3);
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Compc.c b/src/Compc.c
new file mode 100644
index 0000000..add89a3
--- /dev/null
+++ b/src/Compc.c
@@ -0,0 +1,159 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Compc      eqc             Equal constant
+      Compc      nec             Not equal constant
+      Compc      lec             Less equal constant
+      Compc      ltc             Less then constant
+      Compc      gec             Greater equal constant
+      Compc      gtc             Greater then constant
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Compc(void *argument)
+{
+  int EQC, NEC, LEC, LTC, GEC, GTC;
+  int operatorID;
+  int streamID1, streamID2;
+  int gridsize;
+  int nrecs, recID;
+  int tsID;
+  int varID, levelID;
+  int vlistID1, vlistID2;
+  int nmiss, nmiss2;
+  int i;
+  double missval;
+  double rc;
+  double *array1, *array2;
+  int taxisID1, taxisID2;
+  int rc_is_missval;
+
+  cdoInitialize(argument);
+
+  EQC = cdoOperatorAdd("eqc", 0, 0, NULL);
+  NEC = cdoOperatorAdd("nec", 0, 0, NULL);
+  LEC = cdoOperatorAdd("lec", 0, 0, NULL);
+  LTC = cdoOperatorAdd("ltc", 0, 0, NULL);
+  GEC = cdoOperatorAdd("gec", 0, 0, NULL);
+  GTC = cdoOperatorAdd("gtc", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg("constant value");
+  rc = atof(operatorArgv()[0]);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nospec(vlistID1);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  rc_is_missval = DBL_IS_EQUAL(rc, missval);
+
+	  if ( operatorID == EQC )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval) || rc_is_missval ? missval : DBL_IS_EQUAL(array1[i], rc);
+	    }
+	  else if ( operatorID == NEC )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval) || rc_is_missval ? missval : !DBL_IS_EQUAL(array1[i], rc);
+	    }
+	  else if ( operatorID == LEC )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval) || rc_is_missval ? missval : array1[i] <= rc;
+	    }
+	  else if ( operatorID == LTC )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval) || rc_is_missval ? missval : array1[i] < rc;
+	    }
+	  else if ( operatorID == GEC )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval) || rc_is_missval ? missval : array1[i] >= rc;
+	    }
+	  else if ( operatorID == GTC )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval) || rc_is_missval ? missval : array1[i] > rc;
+	    }
+	  else
+	    {
+	      cdoAbort("Operator not implemented!");
+	    }
+
+	  nmiss2 = 0;
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss2++;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array2, nmiss2);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Complextorect.c b/src/Complextorect.c
new file mode 100644
index 0000000..4b7c014
--- /dev/null
+++ b/src/Complextorect.c
@@ -0,0 +1,127 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Complextorect(void *argument)
+{
+  // int COMPLEXTORECT;
+  // int operatorID;
+  int streamID1, streamID2, streamID3;
+  int tsID, nrecs;
+  int recID, varID, levelID;
+  int vlistID1, vlistID2, vlistID3;
+  int taxisID1, taxisID2, taxisID3;
+  int i, gridsize;
+  int datatype;
+  int nmiss, nvars;
+  double *array1 = NULL, *array2 = NULL, *array3 = NULL;
+
+  cdoInitialize(argument);
+
+  //  COMPLEXTORECT = cdoOperatorAdd("complextorect", 0, 0, NULL);
+
+  //  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  nvars = vlistNvars(vlistID2);
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      datatype = vlistInqVarDatatype(vlistID2, varID);
+      if ( datatype == DATATYPE_CPX64 )
+	datatype = DATATYPE_FLT64;
+      else
+	datatype = DATATYPE_FLT32;
+
+      vlistDefVarDatatype(vlistID2, varID, datatype);
+      vlistDefVarDatatype(vlistID3, varID, datatype);
+    }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+  streamDefVlist(streamID3, vlistID3);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array1 = (double *) malloc(2*gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+  array3 = (double *) malloc(gridsize*sizeof(double));
+      
+  tsID  = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamDefRecord(streamID3, varID, levelID);
+	      
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  for ( i = 0; i < gridsize; ++i )
+	    {
+	      array2[i] = array1[2*i];
+	      array3[i] = array1[2*i+1];
+	    }
+
+	  streamWriteRecord(streamID2, array2, nmiss);
+	  streamWriteRecord(streamID3, array3, nmiss);
+	}
+       
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+  if ( array3 ) free(array3);
+
+  vlistDestroy(vlistID2);
+  vlistDestroy(vlistID3);
+
+  cdoFinish();
+
+  return (NULL);
+}
diff --git a/src/Cond.c b/src/Cond.c
new file mode 100644
index 0000000..e3066e4
--- /dev/null
+++ b/src/Cond.c
@@ -0,0 +1,224 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Cond       ifthen          If then
+      Cond       ifnotthen       If not then
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Cond(void *argument)
+{
+  int IFTHEN, IFNOTTHEN;
+  int operatorID;
+  enum {FILL_NONE, FILL_TS, FILL_REC};
+  int filltype = FILL_NONE;
+  int streamID1, streamID2, streamID3;
+  int gridsize;
+  int ntsteps1, ntsteps2;
+  int nrecs, nrecs2, nvars = 0, nlev, recID;
+  int tsID;
+  int varID, levelID;
+  int offset;
+  int vlistID1, vlistID2, vlistID3;
+  int nmiss1, nmiss2, nmiss3;
+  int i;
+  double missval1 = -9.E33;
+  double missval2 = -9.E33;
+  double *array1, *array2, *array3;
+  int **varnmiss1 = NULL;
+  double **vardata1 = NULL;
+  int taxisID2, taxisID3;
+
+  cdoInitialize(argument);
+
+  IFTHEN    = cdoOperatorAdd("ifthen",    0, 0, NULL);
+  IFNOTTHEN = cdoOperatorAdd("ifnotthen", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = vlistDuplicate(vlistID2);
+
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = taxisDuplicate(taxisID2);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  ntsteps1 = vlistNtsteps(vlistID1);
+  ntsteps2 = vlistNtsteps(vlistID2);
+  if ( ntsteps1 == 0 ) ntsteps1 = 1;
+  if ( ntsteps2 == 0 ) ntsteps2 = 1;
+
+  if ( vlistNrecs(vlistID1) == 1 && vlistNrecs(vlistID2) != 1 )
+    {
+      filltype = FILL_REC;
+      cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoStreamName(0));
+    }
+
+  if ( filltype == FILL_NONE )
+    vlistCompare(vlistID1, vlistID2, CMP_DIM);
+  
+  nospec(vlistID1);
+  nospec(vlistID2);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  gridsize = vlistGridsizeMax(vlistID2);
+
+  if ( filltype == FILL_REC && gridsize != gridInqSize(vlistGrid(vlistID1, 0)) )
+    cdoAbort("Stream1 >%s< has wrong gridsize!", cdoStreamName(0));
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+  array3 = (double *) malloc(gridsize*sizeof(double));
+
+  if ( cdoVerbose )
+    cdoPrint("Number of timesteps: file1 %d, file2 %d", ntsteps1, ntsteps2);
+
+  if ( filltype == FILL_NONE )
+    {
+      if ( ntsteps1 == 1 && ntsteps2 != 1 )
+	{
+	  filltype = FILL_TS;
+	  cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0));
+
+	  nvars  = vlistNvars(vlistID1);
+	  vardata1  = (double **) malloc(nvars*sizeof(double *));
+	  varnmiss1 = (int **) malloc(nvars*sizeof(int *));
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      nlev     = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      vardata1[varID]  = (double *) malloc(nlev*gridsize*sizeof(double));
+	      varnmiss1[varID] = (int *) malloc(nlev*sizeof(int));
+	    }
+	}
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID2, tsID)) )
+    {
+      if ( tsID == 0 || filltype == FILL_NONE )
+	{
+	  nrecs2 = streamInqTimestep(streamID1, tsID);
+	  if ( nrecs2 == 0 )
+	    cdoAbort("Input streams have different number of timesteps!");
+	}
+
+      taxisCopyTimestep(taxisID3, taxisID2);
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID2, &varID, &levelID);
+	  streamReadRecord(streamID2, array2, &nmiss2);
+
+	  if ( tsID == 0 || filltype == FILL_NONE )
+	    {
+	      if ( recID == 0 || filltype != FILL_REC )
+		{
+		  streamInqRecord(streamID1, &varID, &levelID);
+		  streamReadRecord(streamID1, array1, &nmiss1);
+		}
+
+	      if ( filltype == FILL_TS )
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+		  offset   = gridsize*levelID;
+		  memcpy(vardata1[varID]+offset, array1, gridsize*sizeof(double));
+		  varnmiss1[varID][levelID] = nmiss1;
+		}
+	    }
+	  else if ( filltype == FILL_TS )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      offset   = gridsize*levelID;
+	      memcpy(array1, vardata1[varID]+offset, gridsize*sizeof(double));
+	      nmiss1 = varnmiss1[varID][levelID];
+	    }
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  missval2 = vlistInqVarMissval(vlistID2, varID);
+	  if ( recID == 0 || filltype != FILL_REC )
+	    {
+	      missval1  = vlistInqVarMissval(vlistID1, varID);
+	    }
+
+	  if ( operatorID == IFTHEN )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array3[i] = !DBL_IS_EQUAL(array1[i], missval1) && !DBL_IS_EQUAL(array1[i], 0.) ? array2[i] : missval2;
+	    }
+	  else if ( operatorID == IFNOTTHEN )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array3[i] = !DBL_IS_EQUAL(array1[i], missval1) && DBL_IS_EQUAL(array1[i], 0.) ? array2[i] : missval2;
+	    }
+	  else
+	    {
+	      cdoAbort("Operator not implemented!");
+	    }
+
+	  nmiss3 = 0;
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( DBL_IS_EQUAL(array3[i], missval2) ) nmiss3++;
+
+	  streamDefRecord(streamID3, varID, levelID);
+	  streamWriteRecord(streamID3, array3, nmiss3);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( vardata1 )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  free(vardata1[varID]);
+	  free(varnmiss1[varID]);
+	}
+
+      free(vardata1);
+      free(varnmiss1);
+    }
+
+  if ( array3 ) free(array3);
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Cond2.c b/src/Cond2.c
new file mode 100644
index 0000000..6f82f5f
--- /dev/null
+++ b/src/Cond2.c
@@ -0,0 +1,234 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Cond2      ifthenelse      If then else
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Cond2(void *argument)
+{
+  int IFTHENELSE;
+  int operatorID;
+  enum {FILL_NONE, FILL_TS, FILL_REC};
+  int filltype = FILL_NONE;
+  int streamID1, streamID2, streamID3, streamID4;
+  int gridsize;
+  int nrecs, nrecs2, nvars = 0, nlev, recID;
+  int tsID;
+  int varID, levelID;
+  int offset;
+  int ntsteps1, ntsteps2;
+  int vlistID1, vlistID2, vlistID3, vlistID4;
+  int nmiss1, nmiss2, nmiss3, nmiss4;
+  int i;
+  double missval1 = -9.E33;
+  double missval2 = -9.E33;
+  double *array1, *array2, *array3, *array4;
+  int **varnmiss1 = NULL;
+  double **vardata1 = NULL;
+  int taxisID2, taxisID4;
+
+  cdoInitialize(argument);
+
+  IFTHENELSE = cdoOperatorAdd("ifthenelse",    0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  streamID3 = streamOpenRead(cdoStreamName(2));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = streamInqVlist(streamID3);
+  vlistID4 = vlistDuplicate(vlistID2);
+
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID4 = taxisDuplicate(taxisID2);
+  vlistDefTaxis(vlistID4, taxisID4);
+
+  ntsteps1 = vlistNtsteps(vlistID1);
+  ntsteps2 = vlistNtsteps(vlistID2);
+  if ( ntsteps1 == 0 ) ntsteps1 = 1;
+  if ( ntsteps2 == 0 ) ntsteps2 = 1;
+
+  if ( vlistNrecs(vlistID1) == 1 && vlistNrecs(vlistID2) != 1 )
+    {
+      filltype = FILL_REC;
+      cdoPrint("Filling up stream1 >%s< by copying the first record.", cdoStreamName(0));
+    }
+
+  if ( filltype == FILL_NONE )
+    vlistCompare(vlistID1, vlistID2, CMP_DIM);
+
+  vlistCompare(vlistID2, vlistID3, CMP_DIM);
+
+  nospec(vlistID1);
+  nospec(vlistID2);
+  nospec(vlistID3);
+
+  streamID4 = streamOpenWrite(cdoStreamName(3), cdoFiletype());
+
+  streamDefVlist(streamID4, vlistID4);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  if ( filltype == FILL_REC && gridsize != gridInqSize(vlistGrid(vlistID1, 0)) )
+    cdoAbort("Stream1 >%s< has wrong gridsize!", cdoStreamName(0));
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+  array3 = (double *) malloc(gridsize*sizeof(double));
+  array4 = (double *) malloc(gridsize*sizeof(double));
+
+  if ( cdoVerbose )
+    cdoPrint("Number of timesteps: file1 %d, file2 %d, file3 %d",
+	     ntsteps1, ntsteps2, vlistNtsteps(vlistID3));
+
+  if ( filltype == FILL_NONE )
+    {
+      if ( ntsteps1 == 1 && ntsteps2 != 1 )
+	{
+	  filltype = FILL_TS;
+	  cdoPrint("Filling up stream1 >%s< by copying the first timestep.", cdoStreamName(0));
+
+	  nvars  = vlistNvars(vlistID1);
+	  vardata1  = (double **) malloc(nvars*sizeof(double *));
+	  varnmiss1 = (int **) malloc(nvars*sizeof(int *));
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      nlev     = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      vardata1[varID]  = (double *) malloc(nlev*gridsize*sizeof(double));
+	      varnmiss1[varID] = (int *) malloc(nlev*sizeof(int));
+	    }
+	}
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID2, tsID)) )
+    {
+      nrecs = streamInqTimestep(streamID3, tsID);
+      if ( nrecs == 0 ) cdoAbort("Input streams have different number of timesteps!");
+
+      if ( tsID == 0 || filltype == FILL_NONE )
+	{
+	  nrecs2 = streamInqTimestep(streamID1, tsID);
+	  if ( nrecs2 == 0 )
+	    cdoAbort("Input streams have different number of timesteps!");
+	}
+
+      taxisCopyTimestep(taxisID4, taxisID2);
+
+      streamDefTimestep(streamID4, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID2, &varID, &levelID);
+	  streamReadRecord(streamID2, array2, &nmiss2);
+
+	  streamInqRecord(streamID3, &varID, &levelID);
+	  streamReadRecord(streamID3, array3, &nmiss3);
+
+	  if ( tsID == 0 || filltype == FILL_NONE )
+	    {
+	      if ( recID == 0 || filltype != FILL_REC )
+		{
+		  streamInqRecord(streamID1, &varID, &levelID);
+		  streamReadRecord(streamID1, array1, &nmiss1);
+		}
+
+	      if ( filltype == FILL_TS )
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+		  offset   = gridsize*levelID;
+		  memcpy(vardata1[varID]+offset, array1, gridsize*sizeof(double));
+		  varnmiss1[varID][levelID] = nmiss1;
+		}
+	    }
+	  else if ( filltype == FILL_TS )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      offset   = gridsize*levelID;
+	      memcpy(array1, vardata1[varID]+offset, gridsize*sizeof(double));
+	      nmiss1 = varnmiss1[varID][levelID];
+	    }
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  missval2 = vlistInqVarMissval(vlistID2, varID);
+
+	  if ( recID == 0 || filltype != FILL_REC )
+	    {
+	      missval1  = vlistInqVarMissval(vlistID1, varID);
+	    }
+
+	  if ( operatorID == IFTHENELSE )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array4[i] = DBL_IS_EQUAL(array1[i], missval1) ?
+		  missval2 : !DBL_IS_EQUAL(array1[i], 0.) ? array2[i] : array3[i];
+	    }
+	  else
+	    {
+	      cdoAbort("Operator not implemented!");
+	    }
+
+	  nmiss4 = 0;
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( DBL_IS_EQUAL(array4[i], missval2) ) nmiss4++;
+
+	  streamDefRecord(streamID4, varID, levelID);
+	  streamWriteRecord(streamID4, array4, nmiss4);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID4);
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( vardata1 )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  free(vardata1[varID]);
+	  free(varnmiss1[varID]);
+	}
+
+      free(vardata1);
+      free(varnmiss1);
+    }
+
+  if ( array4 ) free(array4);
+  if ( array3 ) free(array3);
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Condc.c b/src/Condc.c
new file mode 100644
index 0000000..7dc6ea5
--- /dev/null
+++ b/src/Condc.c
@@ -0,0 +1,128 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Condc      ifthenc         If then constant
+      Condc      ifnotthenc      If not then constant
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Condc(void *argument)
+{
+  int IFTHENC, IFNOTTHENC;
+  int operatorID;
+  int streamID1, streamID2;
+  int gridsize;
+  int nrecs, recID;
+  int tsID;
+  int varID, levelID;
+  int vlistID1, vlistID2;
+  int nmiss, nmiss2;
+  int i;
+  double missval;
+  double rc;
+  double *array1, *array2;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  IFTHENC    = cdoOperatorAdd("ifthenc",    0, 0, NULL);
+  IFNOTTHENC = cdoOperatorAdd("ifnotthenc", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg("constant value");
+  rc = atof(operatorArgv()[0]);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nospec(vlistID1);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  if ( operatorID == IFTHENC )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = !DBL_IS_EQUAL(array1[i], missval) && !DBL_IS_EQUAL(array1[i], 0.) ? rc : missval;
+	    }
+	  else if ( operatorID == IFNOTTHENC )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = !DBL_IS_EQUAL(array1[i], missval) && DBL_IS_EQUAL(array1[i], 0.) ? rc : missval;
+	    }
+	  else
+	    {
+	      cdoAbort("Operator not implemented!");
+	    }
+
+	  nmiss2 = 0;
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss2++;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array2, nmiss2);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Consecstat.c b/src/Consecstat.c
new file mode 100644
index 0000000..d8c954b
--- /dev/null
+++ b/src/Consecstat.c
@@ -0,0 +1,314 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Consectstep  consecsum  For each timestep, the current number of 
+                              onsecutive timsteps is counted
+      Consectstep  consects   For each period of consecutive timesteps, only
+                              count its lenght + last contributing timesteps
+
+   =============================================================================
+   Created:  04/08/2010 11:58:01 AM
+    Author:  Ralf Mueller (ram), ralf.mueller at zmaw.de
+   Company:  Max-Planck-Institute for Meteorology
+   =============================================================================
+ */
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+enum {CONSECSUM, CONSECTS};
+#define SWITCHWARN "Hit default case!This should never happen (%s).\n"
+
+static void selEndOfPeriod(field_t *periods, field_t history, field_t current, int isLastTimestep)
+{
+  long   i, len;
+  double pmissval = periods->missval;
+  double  *parray = periods->ptr;
+  double hmissval = history.missval;
+  double  *harray = history.ptr;
+  double cmissval = current.missval;
+  double  *carray = current.ptr;
+
+  len = gridInqSize(periods->grid);
+  if ( len != gridInqSize(current.grid) || (gridInqSize(current.grid) != gridInqSize(history.grid)) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if (!isLastTimestep)
+  {
+    if ( current.nmiss > 0 || history.nmiss > 0 )
+    {
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared)
+#endif
+      for ( i = 0; i < len; i++ )
+      {
+        if ( !DBL_IS_EQUAL(harray[i], hmissval) )
+        {
+          if ( !DBL_IS_EQUAL(carray[i], cmissval) )
+          {
+            parray[i] = ( DBL_IS_EQUAL(carray[i], 0.0)  && IS_NOT_EQUAL(harray[i], 0.0) ) ? harray[i] : pmissval;
+          }
+          else /* DBL_IS_EQUAL(carray[i], cmissval) */
+          {
+            parray[i] = ( IS_NOT_EQUAL(harray[i], 0.0) ) ? harray[i] : pmissval;
+          }
+        }
+        else /* DBL_IS_EQUAL(harray[i], hmissval) */
+        {
+          parray[i] = pmissval;
+        }
+      }
+    }
+    else
+    {
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared)
+#endif
+      for ( i = 0; i < len; i++ )
+        parray[i] = ( DBL_IS_EQUAL(carray[i], 0.0)  && IS_NOT_EQUAL(harray[i], 0.0) ) ? harray[i] : pmissval;
+    }
+  }
+  else
+  {
+    if ( current.nmiss > 0 )
+    {
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared)
+#endif
+      for ( i = 0; i < len; i++ )
+        if ( !DBL_IS_EQUAL(carray[i], cmissval) )
+        {
+          parray[i] = ( DBL_IS_EQUAL(carray[i], 0.0) ) ? pmissval : carray[i];
+        }
+        else /* DBL_IS_EQUAL(carray[i], cmissval) */
+        {
+          parray[i] = pmissval;
+        }
+    }
+    else
+    {
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared)
+#endif
+      for ( i = 0; i < len; i++ )
+        parray[i] = ( DBL_IS_EQUAL(carray[i], 0.0) ) ? pmissval : carray[i];
+    }
+  }
+
+  periods->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(parray[i], pmissval) ) periods->nmiss++;
+}
+
+void *Consecstat (void *argument)
+{
+  int operatorID;
+  int i;
+  int istreamID, itaxisID, ivlistID, itsID;
+  int ostreamID, otaxisID, ovlistID, otsID;
+  int vdate = 0, vtime = 0;
+  int histvdate = 0, histvtime = 0;
+  int recID, nrecs;
+  int varID, nvars;
+  int levelID, nlevels; 
+  int gridID, gridsize;
+  double missval;
+  double refval = 0.0;
+
+  field_t **vars = NULL, **hist = NULL, **periods = NULL;
+  field_t field;
+
+  cdoInitialize(argument);
+  cdoOperatorAdd("consecsum",CONSECSUM, 0, "refval");
+  cdoOperatorAdd("consects" ,CONSECTS , 0, NULL);
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == CONSECSUM )
+    if ( operatorArgc() > 0 ) refval = atof(operatorArgv()[0]);
+
+  istreamID = streamOpenRead(cdoStreamName(0));
+
+  ivlistID = streamInqVlist(istreamID);
+  itaxisID = vlistInqTaxis(ivlistID);
+  ovlistID = vlistDuplicate(ivlistID);
+  otaxisID = taxisDuplicate(itaxisID);
+  vlistDefTaxis(ovlistID, otaxisID);
+
+  field.ptr = (double *) malloc(vlistGridsizeMax(ovlistID)*sizeof(double));
+  nvars     = vlistNvars(ivlistID);
+  vars      = (field_t **) malloc(nvars*sizeof(field_t *));
+  hist      = (field_t **) malloc(nvars*sizeof(field_t *));
+  if ( operatorID == CONSECTS )
+    periods   = (field_t **) malloc(nvars*sizeof(field_t *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+  {
+    gridID      = vlistInqVarGrid(ovlistID, varID);
+    gridsize    = gridInqSize(gridID);
+    missval     = vlistInqVarMissval(ovlistID, varID);
+    nlevels     = zaxisInqSize(vlistInqVarZaxis(ovlistID, varID));
+
+    vars[varID] = (field_t *) malloc(nlevels*sizeof(field_t));
+    if ( operatorID == CONSECTS )
+    {
+      periods[varID] = (field_t *) malloc(nlevels*sizeof(field_t));
+      hist[varID]    = (field_t *) malloc(nlevels*sizeof(field_t));
+    }
+
+
+    for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      vars[varID][levelID].grid    = gridID;
+      vars[varID][levelID].missval = missval;
+      vars[varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+      vars[varID][levelID].nmiss   = 0;
+      if ( operatorID == CONSECTS )
+      {
+        hist[varID][levelID].grid       = gridID;
+        hist[varID][levelID].missval    = missval;
+        hist[varID][levelID].ptr        = (double *) malloc(gridsize*sizeof(double));
+        hist[varID][levelID].nmiss      = 0;
+        periods[varID][levelID].grid    = gridID;
+        periods[varID][levelID].missval = missval;
+        periods[varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+        periods[varID][levelID].nmiss   = 0;
+      }
+    }
+    vlistDefVarUnits(ovlistID, varID, "steps"); /* TODO */
+  }
+
+  ostreamID = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(ostreamID, ovlistID);
+
+  itsID = 0;
+  otsID = 0;
+  while ( (nrecs = streamInqTimestep(istreamID, itsID)) )
+  {
+    vdate = taxisInqVdate(itaxisID);
+    vtime = taxisInqVtime(itaxisID);
+    switch (operatorID)
+    {
+      case CONSECSUM:
+        taxisDefVdate(otaxisID, vdate);
+        taxisDefVtime(otaxisID, vtime);
+        streamDefTimestep(ostreamID, otsID);
+        break;
+      case CONSECTS:
+        if (itsID != 0 )
+        {
+          taxisDefVdate(otaxisID, histvdate);
+          taxisDefVtime(otaxisID, histvtime);
+          streamDefTimestep(ostreamID, otsID-1);
+        }
+        break;
+      default:
+        printf (SWITCHWARN,__func__);
+    }
+
+    for ( recID = 0; recID < nrecs; recID++ )
+    {
+      streamInqRecord(istreamID, &varID, &levelID);
+      streamReadRecord(istreamID, field.ptr, &field.nmiss);
+      field.grid    = vlistInqVarGrid(ovlistID, varID);
+      field.missval = vlistInqVarMissval(ovlistID, varID);
+      farsumtr(&vars[varID][levelID], field, refval);
+      switch (operatorID)
+      {
+        case CONSECSUM:
+          streamDefRecord(ostreamID, varID, levelID);
+          streamWriteRecord(ostreamID, vars[varID][levelID].ptr, vars[varID][levelID].nmiss);
+          break;
+        case CONSECTS:
+          if ( itsID != 0 )
+          {
+            selEndOfPeriod(&periods[varID][levelID], hist[varID][levelID], vars[varID][levelID], FALSE);
+            streamDefRecord(ostreamID, varID, levelID);
+            streamWriteRecord(ostreamID, periods[varID][levelID].ptr, periods[varID][levelID].nmiss);
+          }
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) schedule(static)
+          for ( i = 0; i < gridInqSize(vars[varID][levelID].grid); i++ )
+            hist[varID][levelID].ptr[i] = vars[varID][levelID].ptr[i];
+#else
+          memcpy(hist[varID][levelID].ptr,
+                 vars[varID][levelID].ptr,
+                 gridInqSize(vars[varID][levelID].grid)*sizeof(double));
+#endif
+          break;
+        default:
+          printf (SWITCHWARN,__func__);
+      }
+    }
+    histvdate = vdate;
+    histvtime = vtime;
+    itsID++;
+    otsID++;
+  }
+
+  if ( operatorID == CONSECTS ) /* Save the last timestep */
+  {
+    taxisDefVdate(otaxisID, vdate);
+    taxisDefVtime(otaxisID, vtime);
+    streamDefTimestep(ostreamID, otsID-1);
+    for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevels = zaxisInqSize(vlistInqVarZaxis(ovlistID, varID));
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+      {
+        selEndOfPeriod(&periods[varID][levelID], hist[varID][levelID], vars[varID][levelID], TRUE);
+        streamDefRecord(ostreamID, varID, levelID);
+        streamWriteRecord(ostreamID, periods[varID][levelID].ptr, periods[varID][levelID].nmiss);
+      }
+    }
+  }
+  
+  for ( varID = 0; varID < nvars; varID++ )
+  {
+    nlevels = zaxisInqSize(vlistInqVarZaxis(ovlistID, varID));
+    for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      if ( vars[varID][levelID].ptr ) free(vars[varID][levelID].ptr);
+      if ( operatorID == CONSECTS )
+      {
+        if ( hist[varID][levelID].ptr ) free(hist[varID][levelID].ptr);
+        if ( periods[varID][levelID].ptr ) free(periods[varID][levelID].ptr);
+      }
+    }
+    free(vars[varID]);
+    if ( operatorID == CONSECTS )
+    {
+      free(hist[varID]);
+      free(periods[varID]);
+    }
+  }
+  if ( vars )    free(vars);
+  if ( hist )    free(hist);
+  if ( periods ) free(periods);
+
+  streamClose(istreamID);
+  streamClose(ostreamID);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Copy.c b/src/Copy.c
new file mode 100644
index 0000000..90b7faa
--- /dev/null
+++ b/src/Copy.c
@@ -0,0 +1,173 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Copy       copy            Copy datasets
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "par_io.h"
+#include "pstream.h"
+
+
+void *Copy(void *argument)
+{
+  int COPY, SELALL, SZIP;
+  int operatorID;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs;
+  int tsID1, tsID2, recID, varID, levelID;
+  int lcopy = FALSE;
+  int gridsize;
+  int vlistID1, vlistID2 = -1;
+  int nmiss;
+  int streamCnt, nfiles, indf;
+  int taxisID1, taxisID2 = CDI_UNDEFID;
+  int ntsteps, nvars;
+  double *array = NULL;
+  par_io_t parIO;
+
+  cdoInitialize(argument);
+
+  COPY    = cdoOperatorAdd("copy",   0, 0, NULL);
+  SELALL  = cdoOperatorAdd("selall", 0, 0, NULL);
+  SZIP    = cdoOperatorAdd("szip",   0, 0, NULL);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == SZIP )
+    {
+      cdoCompType  = COMPRESS_SZIP;
+      cdoCompLevel = 0;
+    }
+
+  streamCnt = cdoStreamCnt();
+  nfiles = streamCnt - 1;
+
+  tsID2 = 0;
+  for ( indf = 0; indf < nfiles; indf++ )
+    {
+      if ( cdoVerbose ) cdoPrint("Process file: %s", cdoStreamName(indf));
+
+      streamID1 = streamOpenRead(cdoStreamName(indf));
+
+      vlistID1 = streamInqVlist(streamID1);
+      taxisID1 = vlistInqTaxis(vlistID1);
+
+      if ( indf == 0 )
+	{
+	  streamID2 = streamOpenWrite(cdoStreamName(nfiles), cdoFiletype());
+
+	  vlistID2 = vlistDuplicate(vlistID1);
+	  taxisID2 = taxisDuplicate(taxisID1);
+	  vlistDefTaxis(vlistID2, taxisID2);
+
+	  ntsteps = vlistNtsteps(vlistID1);
+	  nvars   = vlistNvars(vlistID1);
+
+	  if ( ntsteps == 1 )
+	    {
+	      for ( varID = 0; varID < nvars; ++varID )
+		if ( vlistInqVarTsteptype(vlistID1, varID) != TSTEP_CONSTANT ) break;
+	      
+	      if ( varID == nvars ) ntsteps = 0;
+	    }
+
+	  if ( ntsteps == 0 && nfiles > 1 )
+	    {	      
+	      for ( varID = 0; varID < nvars; ++varID )
+		vlistDefVarTsteptype(vlistID2, varID, TSTEP_INSTANT);
+	    }
+
+	  streamDefVlist(streamID2, vlistID2);
+
+	  gridsize = vlistGridsizeMax(vlistID1);
+	  array = (double *) malloc(gridsize*sizeof(double));
+	  if ( cdoParIO )
+	    {
+	      fprintf(stderr, "Parallel reading enabled!\n");
+	      parIO.array = (double *) malloc(gridsize*sizeof(double));
+	      parIO.array_size = gridsize;
+	    }
+	}
+      else
+	{
+	  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+	}
+
+      tsID1 = 0;
+      while ( (nrecs = streamInqTimestep(streamID1, tsID1)) )
+	{
+	  taxisCopyTimestep(taxisID2, taxisID1);
+
+	  streamDefTimestep(streamID2, tsID2);
+	       
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    { 
+	      if ( lcopy && (operatorID == SELALL || operatorID == SZIP) )
+		{
+		  streamInqRecord(streamID1, &varID, &levelID);
+		  streamDefRecord(streamID2,  varID,  levelID);
+		  streamCopyRecord(streamID2, streamID1);
+		}
+	      else
+		{
+		  if ( cdoParIO )
+		    {
+		      parIO.recID = recID; parIO.nrecs = nrecs;
+		      /* fprintf(stderr, "in1 streamID %d varID %d levelID %d\n", streamID1, varID, levelID);*/
+		      parReadRecord(streamID1, &varID, &levelID, array, &nmiss, &parIO);
+		      /* fprintf(stderr, "in2 streamID %d varID %d levelID %d\n", streamID1, varID, levelID);*/
+		    }
+		  else
+		    {
+		      streamInqRecord(streamID1, &varID, &levelID);
+		      streamReadRecord(streamID1, array, &nmiss);
+		    }
+		  /*
+		  if ( cdoParIO )
+		    fprintf(stderr, "out1 %d %d %d\n", streamID2,  varID,  levelID);
+		  */
+		  streamDefRecord(streamID2,  varID,  levelID);
+		  streamWriteRecord(streamID2, array, nmiss);
+		  /*
+		  if ( cdoParIO )
+		    fprintf(stderr, "out2 %d %d %d\n", streamID2,  varID,  levelID);
+		  */
+		}
+	    }
+	  tsID1++;
+	  tsID2++;
+	}
+
+      streamClose(streamID1);
+    }
+
+  streamClose(streamID2);
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Deltime.c b/src/Deltime.c
new file mode 100644
index 0000000..db8937d
--- /dev/null
+++ b/src/Deltime.c
@@ -0,0 +1,165 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Deltime(void *argument)
+{
+  int DELDAY, DEL29FEB;
+  int operatorID;
+  int streamID1, streamID2;
+  int tsID, tsID2, nrecs;
+  int recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int vdate, vtime;
+  int copytimestep;
+  int lcopy = FALSE;
+  int gridsize;
+  int nmiss;
+  int nfound;
+  int year, month, day;
+  int dday, dmon;
+  double *array = NULL;
+  const char *cmons[]={"", "jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"};
+
+  cdoInitialize(argument);
+
+  DELDAY   = cdoOperatorAdd("delday",   0, 0, NULL);
+  DEL29FEB = cdoOperatorAdd("del29feb", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == DEL29FEB )
+    {
+      dday = 29;
+      dmon = 2;
+    }
+  else
+    {
+      int im;
+      int nsel;
+      char *sarg;
+      nsel = operatorArgc();
+      if ( nsel < 1 ) cdoAbort("Too few arguments!");
+      if ( nsel > 1 ) cdoAbort("Too many arguments!");
+      sarg = operatorArgv()[0];
+      dday = atoi(sarg);
+      dmon = 0;
+      while ( isdigit(*sarg) ) *sarg++;
+      if ( isalpha(*sarg) )
+	{
+	  char smon[32];
+	  strncpy(smon, sarg, 32);
+	  strtolower(smon);
+	  for ( im = 0; im < 12; ++im )
+	    if ( memcmp(smon, cmons[im+1], 3) == 0 ) break;
+
+	  if ( im < 12 ) dmon = im + 1;
+	}
+    }
+
+  if ( cdoVerbose ) cdoPrint("delete day %d%s", dday, cmons[dmon]);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  taxisDefCalendar(taxisID2, CALENDAR_365DAYS);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+      
+  nfound = 0;
+  tsID  = 0;
+  tsID2 = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      cdiDecodeDate(vdate, &year, &month, &day);
+
+      if ( day == dday && (month == dmon || dmon == 0) )
+	{
+	  nfound++;
+	  copytimestep = FALSE;
+	  if ( cdoVerbose )
+	    cdoPrint("Delete %4.4d-%2.2d-%2.2d at timestep %d", year, month, day, tsID+1);
+	}
+      else
+	copytimestep = TRUE;
+
+      if ( copytimestep )
+	{
+	  taxisCopyTimestep(taxisID2, taxisID1);
+
+	  streamDefTimestep(streamID2, tsID2++);
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+	      streamDefRecord(streamID2, varID, levelID);
+	      if ( lcopy )
+		{
+		  streamCopyRecord(streamID2, streamID1);
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array, &nmiss);
+		  streamWriteRecord(streamID2, array, nmiss);
+		}
+	    }
+	}
+       
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( nfound == 0 )
+    cdoWarning("Day %d%s not found!", dday, cmons[dmon]);
+
+  if ( ! lcopy )
+    if ( array ) free(array);
+
+  vlistDestroy(vlistID2);
+
+  cdoFinish();
+
+  return (NULL);
+}
diff --git a/src/Derivepar.c b/src/Derivepar.c
new file mode 100644
index 0000000..03b688b
--- /dev/null
+++ b/src/Derivepar.c
@@ -0,0 +1,556 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2007-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Derivepar     geopotheight          geopotential height
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "vinterp.h"
+
+#define  C_RKBOL         (1.380658e-23)     /* Boltzmann constant in J/K   */
+#define  C_RNAVO         (6.0221367e+23)    /* Avogadro constant in 1/mol  */
+#define  C_RMD           (28.9644)          /* molecular weight of dry air */
+#define  C_RMV           (18.0153)          /* molecular weight of water vapor */
+#define  C_R             (C_RKBOL * C_RNAVO)
+#define  C_RV            (1000. * C_R / C_RMV)
+
+#define  C_EARTH_GRAV    (9.80665)
+#define  C_RKBOL         (1.380658e-23)     /* Boltzmann constant in J/K   */
+#define  C_RNAVO         (6.0221367e+23)    /* Avogadro constant in 1/mol  */
+#define  C_RMD           (28.9644)          /* molecular weight of dry air */
+#define  C_R             (C_RKBOL * C_RNAVO)
+#define  C_EARTH_RD      (1000. * C_R / C_RMD)
+
+static double Grav          = C_EARTH_GRAV;
+static double RD            = C_EARTH_RD;
+
+static
+void MakeGeopotHeight(double *geop, double* gt, double *gq, double *ph, int nhor, int nlev)
+{
+  int i, j;
+  double vtmp;
+  double zrg;
+  double z2log2;
+  double *geopl, *gtl, *gql, *phl;
+
+  z2log2 = 2.0 * log(2.0);
+  vtmp   = (C_RV / RD) - 1.0;
+  zrg    = 1.0 / Grav;
+
+  if ( gq ) /* Humidity is present */
+    {
+      for ( j = nlev ; j > 1 ; j-- )
+        {
+          geopl = geop + nhor*(j-1);
+          gtl   = gt   + nhor*(j-1);
+          gql   = gq   + nhor*(j-1);
+          phl   = ph   + nhor*(j-1);
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#if defined (_OPENMP)
+#pragma omp parallel for
+#endif
+          for ( i = 0; i < nhor; i++ )
+            geopl[i] = geopl[i+nhor] + RD * gtl[i] * (1.0 + vtmp * gql[i])
+                     * log(phl[i+nhor] / phl[i]);
+        }
+
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#if defined (_OPENMP)
+#pragma omp parallel for
+#endif
+      for ( i = 0; i < nhor; i++ )
+        geop[i] = geop[i+nhor] + RD * gt[i] * (1.0 + vtmp * gq[i]) * z2log2;
+    }
+  else    /* No humidity */
+    {
+      for ( j = nlev ; j > 1 ; j-- )
+#if defined (SX)
+#pragma vdir nodep
+#endif
+        for ( i = nhor * (j-1) ; i < nhor * j ; i++ )
+          geop[i] = geop[i+nhor] + RD * gt[i] * log(ph[i+nhor] / ph[i]);
+
+#if defined (SX)
+#pragma vdir nodep
+#endif
+      for ( i = 0; i < nhor; i++ )
+        geop[i] = geop[i+nhor] + RD * gt[i] * z2log2;
+    }
+
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#if defined (_OPENMP)
+#pragma omp parallel for
+#endif
+  for ( i = 0; i < nhor * (nlev+1); i++ ) geop[i] *= zrg;
+}
+
+
+void minmaxval(long nvals, double *array, int *imiss, double *minval, double *maxval)
+{
+  long i;
+  double xmin =  DBL_MAX;
+  double xmax = -DBL_MAX;
+
+  if ( imiss )
+    {
+      for ( i = 0; i < nvals; i++ )
+	{
+	  if ( ! imiss[i] )
+	    {
+	      if      ( array[i] > xmax ) xmax = array[i];
+	      else if ( array[i] < xmin ) xmin = array[i];
+	    }
+	}
+    }
+  else
+    {
+      for ( i = 0; i < nvals; i++ )
+	{
+	  if      ( array[i] > xmax ) xmax = array[i];
+	  else if ( array[i] < xmin ) xmin = array[i];
+	}
+    }
+
+  *minval = xmin;
+  *maxval = xmax;
+}
+
+
+void *Derivepar(void *argument)
+{
+  int GEOPOTHEIGHT;
+  int operatorID;
+  int mode;
+  enum {ECHAM_MODE, WMO_MODE};
+  int geop_code = 0, temp_code = 0, ps_code = 0, lsp_code = 0, hum_code = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridsize, ngp = 0;
+  int recID, nrecs;
+  int i, offset, iv;
+  int tsID, varID, levelID;
+  int nvars;
+  int zaxisID2, zaxisIDh = -1, nzaxis, surfaceID;
+  int ngrids, gridID = -1, zaxisID;
+  int nlevel;
+  int nvct;
+  int geopID = -1, tempID = -1, humID = -1, psID = -1, lnpsID = -1, presID = -1;
+  // int clwcID = -1, ciwcID = -1;
+  int code, param;
+  char paramstr[32];
+  char varname[CDI_MAX_NAME];
+  double *single2;
+  int taxisID1, taxisID2;
+  int lhavevct;
+  int nhlevf = 0;
+  double *lev2;
+  double *vct = NULL;
+  double *geop = NULL, *ps = NULL, *temp = NULL, *hum = NULL;
+  // double *lwater = NULL, *iwater = NULL;
+  double *geopotheight = NULL;
+  int nmiss, nmissout = 0;
+  int ltq = FALSE;
+  double *array = NULL;
+  double *half_press = NULL;
+  double minval, maxval;
+  double missval = 0;
+  double cconst = 1.E-6;
+  const char *fname;
+  int instNum, tableNum;
+  int useTable;
+
+  cdoInitialize(argument);
+
+  GEOPOTHEIGHT = cdoOperatorAdd("geopotheight",   0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  ngrids  = vlistNgrids(vlistID1);
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) == GRID_SPECTRAL )
+	{
+	  cdoAbort("Spectral data unsupported!");
+	}
+      else
+	{
+	  ngp = gridInqSize(gridID);
+	  break;
+	}
+    }
+
+  /* check gridsize */
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) != GRID_SPECTRAL )
+	{
+	  if ( ngp != gridInqSize(gridID) )
+	    cdoAbort("Grids have different size!");
+	}
+    }
+
+
+  nzaxis  = vlistNzaxis(vlistID1);
+  lhavevct = FALSE;
+
+  if ( cdoVerbose )
+    cdoPrint("nzaxis: %d", nzaxis);
+
+  for ( i = 0; i < nzaxis; i++ )
+    {
+      zaxisID = vlistZaxis(vlistID1, i);
+      nlevel  = zaxisInqSize(zaxisID);
+      if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+	{
+	  if ( nlevel > 1 )
+	    {
+	      nvct = zaxisInqVctSize(zaxisID);
+
+              if ( cdoVerbose )
+                cdoPrint("i: %d, vct size of zaxisID %d = %d", i, zaxisID, nvct);
+
+	      if ( nlevel == (nvct/2 - 1) )
+		{
+		  if ( lhavevct == FALSE )
+		    {
+		      lhavevct = TRUE;
+		      zaxisIDh = zaxisID;
+		      nhlevf   = nlevel;
+	      
+                      if ( cdoVerbose )
+                        cdoPrint("lhavevct=TRUE  zaxisIDh = %d, nhlevf   = %d", zaxisIDh, nlevel);
+ 
+		      vct = (double *) malloc(nvct*sizeof(double));
+		      zaxisInqVct(zaxisID, vct);
+
+		      if ( cdoVerbose )
+			for ( i = 0; i < nvct/2; ++i )
+			  cdoPrint("vct: %5d %25.17f %25.17f", i, vct[i], vct[nvct/2+i]);
+		    }
+		}
+              else 
+                {
+		  if ( cdoVerbose )
+		    cdoPrint("nlevel /= (nvct/2 - 1): nlevel = %d", nlevel);
+                }
+	    }
+	}
+    }
+
+  if ( zaxisIDh == -1 )
+    cdoAbort("No data on hybrid model level found!");
+
+  nvars = vlistNvars(vlistID1);
+
+  useTable = FALSE;
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      tableNum = tableInqNum(vlistInqVarTable(vlistID1, varID));
+
+      if ( tableNum > 0  && tableNum != 255 )
+	{
+	  useTable = TRUE;
+	  break;
+	}
+    }
+
+  if ( cdoVerbose && useTable ) cdoPrint("Using code tables!");
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+      nlevel   = zaxisInqSize(zaxisID);
+      instNum  = institutInqCenter(vlistInqVarInstitut(vlistID1, varID));
+      tableNum = tableInqNum(vlistInqVarTable(vlistID1, varID));
+
+      code     = vlistInqVarCode(vlistID1, varID);
+      param    = vlistInqVarParam(vlistID1, varID);
+
+      cdiParamToString(param, paramstr, sizeof(paramstr));
+
+      if ( useTable )
+	{
+	  if ( tableNum == 2 )
+	    {
+	      mode = WMO_MODE;
+	      geop_code  =   6;
+	      temp_code  =  11;
+	      hum_code   =  51;
+	      ps_code    =   1;
+	    }
+	  else if ( tableNum == 128 || tableNum == 0 )
+	    {
+	      mode = ECHAM_MODE;
+	      geop_code  = 129;
+	      temp_code  = 130;
+	      hum_code   = 133;
+	      ps_code    = 134;
+	      lsp_code   = 152;
+	    }
+	  else
+	    mode = -1;
+	}
+      else
+	{
+	  mode = ECHAM_MODE;
+	  geop_code  = 129;
+	  temp_code  = 130;
+	  hum_code   = 133;
+	  ps_code    = 134;
+	  lsp_code   = 152;
+	}
+
+      if ( cdoVerbose )
+	cdoPrint("Mode = %d  Center = %d  Param = %s", mode, instNum, paramstr);
+
+      if ( code <= 0 )
+	{
+	  vlistInqVarName(vlistID1, varID, varname);
+
+	  strtolower(varname);
+
+	  if ( nlevel == 1 )
+	    {
+	      if      ( strcmp(varname, "geosp")   == 0 ) code = 129;
+	      else if ( strcmp(varname, "aps")     == 0 ) code = 134;
+	      else if ( strcmp(varname, "ps")      == 0 ) code = 134;
+	      else if ( strcmp(varname, "lsp")     == 0 ) code = 152;
+	    }
+
+	  if ( nlevel == nhlevf )
+	    {
+	      if      ( strcmp(varname, "t")       == 0 ) code = 130;
+	      else if ( strcmp(varname, "q")       == 0 ) code = 133;
+	      // else if ( strcmp(varname, "clwc")    == 0 ) code = 246;
+	      // else if ( strcmp(varname, "ciwc")    == 0 ) code = 247;
+	    }
+	}
+
+      if      ( code == geop_code && nlevel == 1      ) geopID    = varID;
+      else if ( code == temp_code && nlevel == nhlevf ) tempID    = varID;
+      else if ( code == hum_code  && nlevel == nhlevf ) humID     = varID;
+      else if ( code == ps_code   && nlevel == 1      ) psID      = varID;
+      else if ( code == lsp_code  && nlevel == 1      ) lnpsID    = varID;
+      // else if ( code == 246 ) clwcID    = varID;
+      // else if ( code == 247 ) ciwcID    = varID;
+
+      if ( gridInqType(gridID) == GRID_SPECTRAL && zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+	cdoAbort("Spectral data on model level unsupported!");
+
+      if ( gridInqType(gridID) == GRID_SPECTRAL )
+	cdoAbort("Spectral data unsupported!");
+    }
+
+  if ( tempID == -1 ) cdoAbort("Temperature not found!");
+
+  array  = (double *) malloc(ngp*sizeof(double));
+
+  geop   = (double *) malloc(ngp*sizeof(double));
+  ps     = (double *) malloc(ngp*sizeof(double));
+
+  temp   = (double *) malloc(ngp*nhlevf*sizeof(double));
+
+  if ( humID == -1 )
+    cdoWarning("Humidity not found - using algorithm without humidity!");
+  else
+    hum    = (double *) malloc(ngp*nhlevf*sizeof(double));
+
+  // lwater = (double *) malloc(ngp*nhlevf*sizeof(double));
+  // iwater = (double *) malloc(ngp*nhlevf*sizeof(double));
+
+  half_press   = (double *) malloc(ngp*(nhlevf+1)*sizeof(double));
+  geopotheight = (double *) malloc(ngp*(nhlevf+1)*sizeof(double));
+
+  if ( zaxisIDh != -1 && geopID == -1 )
+    {
+      if ( ltq )
+	cdoWarning("Orography (surf. geopotential) not found - using zero orography!");
+
+      memset(geop, 0, ngp*sizeof(double));
+    }
+
+  presID = lnpsID;
+  if ( zaxisIDh != -1 && lnpsID == -1 )
+    {
+      presID = psID;
+      if ( psID != -1 )
+	cdoWarning("LOG surface pressure (lsp) not found - using surface pressure (asp)!");
+      else
+	cdoAbort("Surface pressure not found!");
+    }
+
+
+  vlistID2 = vlistCreate();
+  varID = vlistDefVar(vlistID2, gridID, zaxisIDh, TSTEP_INSTANT);
+  vlistDefVarParam(vlistID2, varID, cdiEncodeParam(156, 128, 255));
+  vlistDefVarName(vlistID2, varID, "geopotheight");
+  vlistDefVarStdname(vlistID2, varID, "geopotental_height");
+  vlistDefVarUnits(vlistID2, varID, "m");
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+	  nlevel   = zaxisInqSize(zaxisID);
+	  offset   = gridsize*levelID;
+	  streamReadRecord(streamID1, array, &nmiss);
+
+	  if ( zaxisIDh != -1 )
+	    {
+	      if ( varID == geopID )
+		{
+		  memcpy(geop, array, ngp*sizeof(double));
+		}
+	      else if ( varID == presID )
+		{
+		  if ( lnpsID != -1 )
+		    for ( i = 0; i < ngp; ++i ) ps[i] = exp(array[i]);
+		  else if ( psID != -1 )
+		    memcpy(ps, array, ngp*sizeof(double));
+		}
+	      else if ( varID == tempID )
+		memcpy(temp+offset, array, ngp*sizeof(double));
+	      else if ( varID == humID )
+		memcpy(hum+offset, array, ngp*sizeof(double));
+	      /*
+	      else if ( varID == clwcID )
+		memcpy(lwater+offset, array, ngp*sizeof(double));
+	      else if ( varID == ciwcID )
+		memcpy(iwater+offset, array, ngp*sizeof(double));
+	      */
+	    }
+	}
+
+      if ( zaxisIDh != -1 )
+	{
+	  /* check range of ps_prog */
+	  minmaxval(ngp, ps, NULL, &minval, &maxval);
+	  if ( minval < MIN_PS || maxval > MAX_PS )
+	    cdoWarning("Surface pressure out of range (min=%g max=%g)!", minval, maxval);
+
+	  /* check range of geop */
+	  minmaxval(ngp, geop, NULL, &minval, &maxval);
+	  if ( minval < MIN_FIS || maxval > MAX_FIS )
+	    cdoWarning("Orography out of range (min=%g max=%g)!", minval, maxval);
+	}
+
+      varID = tempID;
+      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single2  = temp + offset;
+
+	  minmaxval(ngp, single2, NULL, &minval, &maxval);
+	  if ( minval < MIN_T || maxval > MAX_T )
+	    cdoWarning("Input temperature at level %d out of range (min=%g max=%g)!",
+		       levelID+1, minval, maxval);
+	}
+
+      if ( humID != -1 )
+	{
+	  varID = humID;
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      offset   = gridsize*levelID;
+	      single2  = hum + offset;
+
+	      // corr_hum(gridsize, single2, MIN_Q);
+
+	      minmaxval(ngp, single2, NULL, &minval, &maxval);
+	      if ( minval < -0.1 || maxval > MAX_Q )
+		cdoWarning("Input humidity at level %d out of range (min=%g max=%g)!",
+			   levelID+1, minval, maxval);
+	    }
+	}
+
+      presh(NULL, half_press, vct, ps, nhlevf, ngp);
+
+      memcpy(geopotheight+ngp*nhlevf, geop, ngp*sizeof(double));
+      MakeGeopotHeight(geopotheight, temp, hum, half_press, ngp, nhlevf);
+
+      nmissout = 0;
+      varID = 0;
+      nlevel = nhlevf;
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, geopotheight+levelID*ngp, nmissout);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID2);
+
+  free(ps);
+  free(geop);
+  free(temp);
+  free(geopotheight);
+  if ( hum ) free(hum);
+
+  if ( half_press ) free(half_press);
+
+  free(array);
+  if ( vct ) free(vct);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Detrend.c b/src/Detrend.c
new file mode 100644
index 0000000..721efe6
--- /dev/null
+++ b/src/Detrend.c
@@ -0,0 +1,256 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Detrend    detrend         Detrend
+*/
+
+#if defined (_OPENMP)
+#  include <omp.h>
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  NALLOC_INC  1024
+
+
+static
+void detrend(long nts, double missval1, double *array1, double *array2)
+{
+  long n;
+  long j;
+  double zj;
+  double sumj, sumjj;
+  double sumx, sumjx;
+  double work1, work2;
+  double missval2 = missval1;
+
+  sumx = sumjx = 0;
+  sumj = sumjj = 0;
+  n = 0;
+  for ( j = 0; j < nts; j++ )
+    if ( !DBL_IS_EQUAL(array1[j], missval1) )
+      {
+        zj = j;
+	sumx  += array1[j];
+	sumjx += zj * array1[j];
+	sumj  += zj;
+	sumjj += zj * zj;
+	n++;
+      }
+
+  work1 = DIV(SUB(sumjx, DIV(MUL(sumx, sumj), n) ),
+	      SUB(sumjj, DIV(MUL(sumj, sumj), n)) );
+  work2 = SUB(DIV(sumx, n), MUL(work1, DIV(sumj, n)));
+
+  for ( j = 0; j < nts; j++ )
+    array2[j] = SUB(array1[j], ADD(work2, MUL(j, work1)));
+}
+
+
+void taxisInqDTinfo(int taxisID, dtinfo_t *dtinfo)
+{
+  dtinfo->v.date = taxisInqVdate(taxisID);
+  dtinfo->v.time = taxisInqVtime(taxisID);
+  if ( taxisHasBounds(taxisID) )
+    {
+      taxisInqVdateBounds(taxisID, &(dtinfo->b[0].date), &(dtinfo->b[1].date));
+      taxisInqVtimeBounds(taxisID, &(dtinfo->b[0].time), &(dtinfo->b[1].time));
+    }
+}
+
+
+void taxisDefDTinfo(int taxisID, dtinfo_t dtinfo)
+{
+  taxisDefVdate(taxisID, dtinfo.v.date);
+  taxisDefVtime(taxisID, dtinfo.v.time);
+  if ( taxisHasBounds(taxisID) )
+    {
+      taxisDefVdateBounds(taxisID, dtinfo.b[0].date, dtinfo.b[1].date);
+      taxisDefVtimeBounds(taxisID, dtinfo.b[0].time, dtinfo.b[1].time);
+    }
+}
+
+
+void *Detrend(void *argument)
+{
+  int ompthID;
+  int gridsize;
+  int nrecs;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int i;
+  int nts;
+  int nalloc = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  double missval;
+  field_t ***vars = NULL;
+  dtinfo_t *dtinfo = NULL;
+  typedef struct
+  {
+    double *array1;
+    double *array2;
+  } memory_t;
+  memory_t *mem = NULL;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars = vlistNvars(vlistID1);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      if ( tsID >= nalloc )
+	{
+	  nalloc += NALLOC_INC;
+	  dtinfo = (dtinfo_t *) realloc(dtinfo, nalloc*sizeof(dtinfo_t));
+	  vars   = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
+	}
+
+      taxisInqDTinfo(taxisID1, &dtinfo[tsID]);
+
+      vars[tsID] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+
+	  vars[tsID][varID] = (field_t *) malloc(nlevel*sizeof(field_t));
+
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      vars[tsID][varID][levelID].grid    = gridID;
+	      vars[tsID][varID][levelID].missval = missval;
+	      vars[tsID][varID][levelID].ptr     = NULL;
+	    }
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  vars[tsID][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+	  streamReadRecord(streamID1, vars[tsID][varID][levelID].ptr, &nmiss);
+	  vars[tsID][varID][levelID].nmiss = nmiss;
+	}
+
+      tsID++;
+    }
+
+  nts = tsID;
+
+  mem = (memory_t *) malloc(ompNumThreads*sizeof(memory_t));
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      mem[i].array1 = (double *) malloc(nts*sizeof(double));
+      mem[i].array2 = (double *) malloc(nts*sizeof(double));
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      missval  = vlistInqVarMissval(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, ompthID, tsID)
+#endif
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+#if defined (_OPENMP)
+              ompthID = omp_get_thread_num();
+#else
+              ompthID = 0;
+#endif
+	      for ( tsID = 0; tsID < nts; tsID++ )
+		mem[ompthID].array1[tsID] = vars[tsID][varID][levelID].ptr[i];
+
+	      detrend(nts, missval, mem[ompthID].array1, mem[ompthID].array2);
+
+	      for ( tsID = 0; tsID < nts; tsID++ )
+		vars[tsID][varID][levelID].ptr[i] = mem[ompthID].array2[tsID];
+	    }
+	}
+    }
+
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      free(mem[i].array1);
+      free(mem[i].array2);
+    }
+  free(mem);
+
+  for ( tsID = 0; tsID < nts; tsID++ )
+    {
+      taxisDefDTinfo(taxisID2, dtinfo[tsID]);
+      streamDefTimestep(streamID2, tsID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      if ( vars[tsID][varID][levelID].ptr )
+		{
+		  nmiss = vars[tsID][varID][levelID].nmiss;
+		  streamDefRecord(streamID2, varID, levelID);
+		  streamWriteRecord(streamID2, vars[tsID][varID][levelID].ptr, nmiss);
+		  free(vars[tsID][varID][levelID].ptr);
+		}
+	    }
+	  free(vars[tsID][varID]);
+	}
+      free(vars[tsID]);
+    }
+
+  if ( vars  ) free(vars);
+  if ( dtinfo ) free(dtinfo);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Diff.c b/src/Diff.c
new file mode 100644
index 0000000..c911326
--- /dev/null
+++ b/src/Diff.c
@@ -0,0 +1,228 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Diff       diff            Compare two datasets
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Diff(void *argument)
+{
+  int DIFF, DIFF2, DIFFP, DIFFN, DIFFC, SDIFF;
+  int operatorID;
+  int i;
+  int indg;
+  int varID1, varID2, recID;
+  int gridsize;
+  int ndiff;
+  int code, param;
+  int gridID, zaxisID, vdate, vtime;
+  int nrecs, nrecs2;
+  int levelID;
+  int tsID;
+  int dsgn, zero;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int taxisID;
+  int nmiss1, nmiss2;
+  int ndrec = 0, nd2rec = 0, ngrec = 0;
+  char varname[CDI_MAX_NAME];
+  char paramstr[32];
+  char vdatestr[32], vtimestr[32];	  
+  double *array1, *array2;
+  double absm, relm;
+  double missval1, missval2;
+
+  cdoInitialize(argument);
+
+  DIFF  = cdoOperatorAdd("diff",  0, 0, NULL);
+  DIFF2 = cdoOperatorAdd("diff2", 0, 0, NULL);
+  DIFFP = cdoOperatorAdd("diffp", 0, 0, NULL);
+  DIFFN = cdoOperatorAdd("diffn", 0, 0, NULL);
+  DIFFC = cdoOperatorAdd("diffc", 0, 0, NULL);
+  SDIFF = cdoOperatorAdd("sdiff", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+
+  if ( ! cdoSilentMode )
+    {
+      if ( operatorID != SDIFF )
+	{
+	  fprintf(stdout, "               Date     Time   Level Gridsize    Miss ");
+
+	  if ( operatorID == DIFF2 ) fprintf(stdout, "   Diff ");
+
+	  fprintf(stdout, ": S Z  Max_Absdiff Max_Reldiff");
+
+	  if ( operatorID == DIFFN )
+	    fprintf(stdout, " : Parameter name");
+	  else if ( operatorID == DIFF || operatorID == DIFF2 || operatorID == DIFFP )
+	    fprintf(stdout, " : Parameter ID");
+	  else if ( operatorID == DIFFC )
+	    fprintf(stdout, " : Code number");
+
+	  fprintf(stdout, "\n");
+	}
+    }
+
+  indg = 0;
+  tsID = 0;
+  taxisID = vlistInqTaxis(vlistID1);
+  while ( TRUE )
+    {
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs > 0 )
+	{
+	  vdate = taxisInqVdate(taxisID);
+	  vtime = taxisInqVtime(taxisID);
+	  
+	  date2str(vdate, vdatestr, sizeof(vdatestr));
+	  time2str(vtime, vtimestr, sizeof(vtimestr));
+	}
+
+      nrecs2 = streamInqTimestep(streamID2, tsID);
+
+      if ( nrecs == 0 || nrecs2 == 0 ) break;
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID1, &levelID);
+	  streamInqRecord(streamID2, &varID2, &levelID);
+
+	  indg += 1;
+
+	  param    = vlistInqVarParam(vlistID1, varID1);
+	  code     = vlistInqVarCode(vlistID1, varID1);
+	  gridID   = vlistInqVarGrid(vlistID1, varID1);
+	  zaxisID  = vlistInqVarZaxis(vlistID1, varID1);
+	  gridsize = gridInqSize(gridID);
+	  missval1 = vlistInqVarMissval(vlistID1, varID1);
+	  missval2 = vlistInqVarMissval(vlistID2, varID2);
+
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+
+	  if ( ! cdoSilentMode )
+	    if ( operatorID != SDIFF )
+	      {
+		if ( operatorID == DIFFN ) vlistInqVarName(vlistID1, varID1, varname);
+		
+		fprintf(stdout, "%6d :%s %s ", indg, vdatestr, vtimestr);
+
+		fprintf(stdout, "%7g ", zaxisInqLevel(zaxisID, levelID));
+	      }
+
+	  streamReadRecord(streamID1, array1, &nmiss1);
+	  streamReadRecord(streamID2, array2, &nmiss2);
+
+	  ndiff = 0;
+          absm = 0.0;
+	  relm = 0.0;
+	  dsgn = FALSE;
+          zero = FALSE;
+
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+	      if ( !DBL_IS_EQUAL(array1[i], missval1) && !DBL_IS_EQUAL(array2[i], missval2) )
+		{
+		  if ( fabs(array1[i] - array2[i]) > 0 ) ndiff++;
+
+		  absm = MAX(absm, fabs(array1[i]-array2[i]));
+		  if ( array1[i]*array2[i] < 0 )
+		    dsgn = TRUE;
+		  else if ( IS_EQUAL(array1[i]*array2[i], 0) )
+		    zero = TRUE;
+		  else
+		    relm = MAX(relm, fabs(array1[i]-array2[i]) /
+			   MAX(fabs(array1[i]), fabs(array2[i])));
+		}
+	      else if ( (DBL_IS_EQUAL(array1[i], missval1) && !DBL_IS_EQUAL(array2[i], missval2)) || 
+			(!DBL_IS_EQUAL(array1[i], missval1) && DBL_IS_EQUAL(array2[i], missval2)) )
+		{
+		  ndiff++;
+		  relm = 1.0;
+		}
+	    }
+
+	  if ( ! cdoSilentMode )
+	    {
+	      if ( operatorID != SDIFF )
+		{
+		  fprintf(stdout, "%8d %7d ", gridsize, MAX(nmiss1, nmiss2));
+
+		  if ( operatorID == DIFF2 )  fprintf(stdout, "%7d ", ndiff);
+		
+		  fprintf(stdout, ": %c %c ", dsgn ? 'T' : 'F', zero ? 'T' : 'F');
+		  fprintf(stdout, "%#12.5g%#12.5g", absm, relm);
+
+		  if ( operatorID == DIFFN )
+		    fprintf(stdout, " : %-11s", varname);
+		  else if ( operatorID == DIFF || operatorID == DIFF2 || operatorID == DIFFP )
+		    fprintf(stdout, " : %-11s", paramstr);
+		  else if ( operatorID == DIFFC )
+		    fprintf(stdout, " : %4d", code);
+
+		  fprintf(stdout, "\n");
+		}
+	    }
+
+	  ngrec++;
+	  if ( absm > 0     || relm > 0     ) ndrec++;
+	  if ( absm > 1.e-3 || relm > 1.e-3 ) nd2rec++;
+	}
+      tsID++;
+    }
+
+  fprintf(stdout, "  %d of %d records differ\n", ndrec, ngrec);
+  if ( ndrec != nd2rec )
+    fprintf(stdout, "  %d of %d records differ more than 0.001\n", nd2rec, ngrec);
+  /*  fprintf(stdout, "  %d of %d records differ more then one thousandth\n", nprec, ngrec); */
+  if ( nrecs == 0 && nrecs2 > 0 )
+    cdoWarning("stream2 has more time steps than stream1!");
+  if ( nrecs > 0 && nrecs2 == 0 )
+    cdoWarning("stream1 has more time steps than stream2!");
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Duplicate.c b/src/Duplicate.c
new file mode 100644
index 0000000..8ef649f
--- /dev/null
+++ b/src/Duplicate.c
@@ -0,0 +1,179 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  NALLOC_INC  1024
+
+
+void *Duplicate(void *argument)
+{
+  int gridsize;
+  int nrecs;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int nts;
+  int nalloc = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int ntsteps;
+  int *vdate = NULL, *vtime = NULL;
+  int idup, ndup = 1;
+  double missval;
+  field_t ***vars = NULL;
+
+  cdoInitialize(argument);
+
+  if ( operatorArgc() > 1 ) cdoAbort("Too many arguments!");
+  else if ( operatorArgc() == 1 ) ndup = atoi(operatorArgv()[0]);
+
+  if ( cdoVerbose ) cdoPrint("ndup = %d\n", ndup);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ntsteps  = vlistNtsteps(vlistID1);
+  nvars    = vlistNvars(vlistID1);
+
+  if ( ntsteps == 1 )
+    {
+      for ( varID = 0; varID < nvars; ++varID )
+	if ( vlistInqVarTsteptype(vlistID1, varID) != TSTEP_CONSTANT ) break;
+
+      if ( varID == nvars ) ntsteps = 0;
+    }
+
+  if ( ntsteps == 0 )
+    {
+      for ( varID = 0; varID < nvars; ++varID )
+	vlistDefVarTsteptype(vlistID2, varID, TSTEP_INSTANT);
+    }
+ 
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars = vlistNvars(vlistID1);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      if ( tsID >= nalloc )
+	{
+	  nalloc += NALLOC_INC;
+	  vdate = (int *) realloc(vdate, nalloc*sizeof(int));
+	  vtime = (int *) realloc(vtime, nalloc*sizeof(int));
+	  vars  = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
+	}
+
+      vdate[tsID] = taxisInqVdate(taxisID1);
+      vtime[tsID] = taxisInqVtime(taxisID1);
+
+      vars[tsID] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+
+	  vars[tsID][varID] = (field_t *) malloc(nlevel*sizeof(field_t));
+
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      vars[tsID][varID][levelID].grid    = gridID;
+	      vars[tsID][varID][levelID].missval = missval;
+	      vars[tsID][varID][levelID].ptr     = NULL;
+	    }
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  vars[tsID][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+	  streamReadRecord(streamID1, vars[tsID][varID][levelID].ptr, &nmiss);
+	  vars[tsID][varID][levelID].nmiss = nmiss;
+	}
+
+      tsID++;
+    }
+
+  nts = tsID;
+
+  for ( idup = 0; idup < ndup; idup++ )
+    {
+      for ( tsID = 0; tsID < nts; tsID++ )
+	{
+	  taxisDefVdate(taxisID2, vdate[tsID]);
+	  taxisDefVtime(taxisID2, vtime[tsID]);
+	  streamDefTimestep(streamID2, idup*nts+tsID);
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  if ( vars[tsID][varID][levelID].ptr )
+		    {
+		      nmiss = vars[tsID][varID][levelID].nmiss;
+		      streamDefRecord(streamID2, varID, levelID);
+		      streamWriteRecord(streamID2, vars[tsID][varID][levelID].ptr, nmiss);
+		    }
+		}
+	    }
+	}
+    }
+
+  for ( tsID = 0; tsID < nts; tsID++ )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    if ( vars[tsID][varID][levelID].ptr )
+	      free(vars[tsID][varID][levelID].ptr);
+
+	  free(vars[tsID][varID]);
+	}
+      free(vars[tsID]);
+    }
+
+  if ( vars  ) free(vars);
+  if ( vdate ) free(vdate);
+  if ( vtime ) free(vtime);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/EOFs.c b/src/EOFs.c
new file mode 100644
index 0000000..76fd4e7
--- /dev/null
+++ b/src/EOFs.c
@@ -0,0 +1,768 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+     Timeof        eof             EOF in spatial or time space
+     Timeof        eofspatial      EOF in spatial space
+     Timeof        eoftime         EOF in time space
+*/
+/*
+ * TODO: 
+ * Role of the weights for eofs. Should not be mixed up with division with
+ * number of contributing values during summation.
+ */
+
+//#define OLD_IMPLEMENTATION
+#define WEIGHTS 1
+
+#include <limits.h>  // LONG_MAX
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "statistic.h"
+
+enum T_EIGEN_MODE {JACOBI, DANIELSON_LANCZOS};
+
+// NO MISSING VALUE SUPPORT ADDED SO FAR
+
+void *EOFs(void * argument)
+{
+  char *envstr;
+
+  enum {EOF_, EOF_TIME, EOF_SPATIAL};
+
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2, streamID3;
+  long gridsize;
+  long i, ii, j, i1, i2, j1, j2;
+  int vdate = 0, vtime = 0;
+  int nrecs, nvars, nlevs=0 ;
+  int nmiss;
+  int tsID;
+  int varID, recID, levelID;
+  int vlistID1, vlistID2 = -1, vlistID3 = -1;
+  int taxisID1, taxisID2, taxisID3;
+  int gridID1, gridID2, gridID3;
+  int ngrids;
+  int reached_eof;
+  int npack=0, nts=0;
+  int *pack, *miss;
+  int *datacountv;
+  int ***datacounts;
+  int n_eig, n=0;
+  int grid_space=0, time_space=0;
+  int missval_warning=0;
+  int timer_init = 0, timer_alloc = 0, timer_read = 0, timer_cov = 0, timer_eig = 0, timer_post = 0, timer_write = 0, timer_finish = 0;
+
+  int calendar = CALENDAR_STANDARD;
+  juldate_t juldate;
+
+  double *weight;
+  double sum_w;
+  double sum;
+  double missval=0;
+  double xvals, yvals;
+  double **cov, *eigv;
+
+  double *df1p, *df2p;
+  double **datafieldv = NULL;
+  double ****datafields = NULL;
+  double ****eigenvectors = NULL, ****eigenvalues = NULL;
+  double *in = NULL;
+
+  enum T_EIGEN_MODE eigen_mode = JACOBI;
+
+  if ( cdoTimer )
+    {
+      timer_init = timer_new("Timeof init");
+      timer_alloc= timer_new("Timeof alloc");
+      timer_read = timer_new("Timeof read");
+      timer_cov  = timer_new("Timeof cov");
+      timer_eig  = timer_new("Timeof eig");
+      timer_post = timer_new("Timeof post");
+      timer_write= timer_new("Timeof write");
+      timer_finish=timer_new("Timeof finish");
+
+      timer_start(timer_init);
+    }
+  
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("eof",       EOF_,       0, NULL);
+  cdoOperatorAdd("eoftime",   EOF_TIME,   0, NULL);
+  cdoOperatorAdd("eofspatial",EOF_SPATIAL,0, NULL);
+
+  operatorID  = cdoOperatorID();
+  operfunc    = cdoOperatorF1(operatorID);
+
+  operatorInputArg("Number of eigen functions to write out");
+  n_eig       = atoi(operatorArgv()[0]);
+
+  envstr = getenv("CDO_SVD_MODE");
+  
+  if ( envstr && !strncmp(envstr,"danielson_lanczos",17) ) 
+    eigen_mode = DANIELSON_LANCZOS;
+  else if ( envstr && ! strncmp(envstr,"jacobi",6 ) )
+    eigen_mode = JACOBI;
+  else if ( envstr ) {
+    cdoWarning("Unknown environmental setting %s for CDO_SVD_MODE. Available options are",envstr);
+    cdoWarning("  - 'jacobi' for a one-sided parallelized jacobi algorithm");
+    cdoWarning("  - 'danielson_lanzcos' for the D/L algorithm");
+    envstr=NULL;
+  }
+
+  if ( cdoVerbose ) 
+    cdoPrint("Using CDO_SVD_MODE '%s' from %s",
+	     eigen_mode==JACOBI?"jacobi":"danielson_lanczos",
+	     envstr?"Environment":" default");
+  
+
+  streamID1   = streamOpenRead(cdoStreamName(0));
+  vlistID1    = streamInqVlist(streamID1);
+  taxisID1    = vlistInqTaxis(vlistID1);
+  gridID1     = vlistInqVarGrid(vlistID1, 0);
+  gridsize    = vlistGridsizeMax(vlistID1);
+  nvars       = vlistNvars(vlistID1);
+  nrecs       = vlistNrecs(vlistID1);
+
+  weight      = (double*) malloc(gridsize*sizeof(double));
+  if ( WEIGHTS )
+    gridWeights(gridID1, &weight[0]);
+  else
+    for(i=0;i<gridsize;i++) 
+      weight[i]=1;
+
+  /*  eigenvalues */
+
+  reached_eof = 0;
+  tsID        = 0;
+
+  /* COUNT NUMBER OF TIMESTEPS if EOF_ or EOF_TIME */
+  if ( operfunc == EOF_ || operfunc == EOF_TIME)
+    {
+      if ( cdoVerbose ) 
+	cdoPrint("Counting timesteps in ifile");
+      
+      while ( TRUE )
+        {
+          if ( reached_eof ) continue;
+          nrecs = streamInqTimestep(streamID1, tsID);
+          if ( nrecs == 0 ) {
+              reached_eof = 1;
+              break;
+            }
+          tsID++;
+        }
+
+      if ( cdoVerbose ) 
+	cdoPrint("Counted %i timeSteps",tsID);
+
+      nts         = tsID;
+      reached_eof = 0;
+      //TODO close on streamID1 ??  streamClose(streamID1);
+      streamClose(streamID1);
+      streamID1   = streamOpenRead(cdoStreamName(0));
+      vlistID1    = streamInqVlist(streamID1);
+      taxisID1    = vlistInqTaxis(vlistID1);
+      if ( nts < gridsize || operfunc == EOF_TIME) {
+         time_space = 1;
+         grid_space = 0;
+       }
+      else
+        {
+          time_space = 0;
+          grid_space = 1;
+        }
+    }
+  else if ( operfunc == EOF_SPATIAL )
+    {
+      time_space = 0;
+      grid_space = 1;
+    }
+
+  /* reset the requested number of eigen-function to the maximum if neccessary */
+  if ( time_space )
+    {
+      if ( n_eig > nts )
+        {
+          cdoWarning("Solving in time-space:");
+          cdoWarning("Number of eigen-functions to write out is bigger than number of time-steps.");
+          cdoWarning("Setting n_eig to %i.", nts);
+          cdoWarning("If You want to force a solution in grid-space use operator eofspatial");
+          n_eig = nts;
+        }
+      n = nts;
+    }
+  else if ( grid_space )
+    {
+      if ( ((double)gridsize)*gridsize > (double)LONG_MAX )
+	cdoAbort("Grid space to large!");
+
+      if ( n_eig > gridsize )
+        {
+          cdoWarning("Solving in spatial space");
+          cdoWarning("Number of eigen-functions to write out is bigger than grid size");
+          cdoWarning("Setting n_eig to %i", gridsize);
+          cdoWarning("If You want to force a solution in time-space use operator eoftime");
+          n_eig = gridsize;
+        }
+      n = gridsize;
+    }
+
+  if ( cdoVerbose ) 
+    cdoPrint("Calculating %i eigenvectors and %i eigenvalues in %s",
+	     n_eig,n,grid_space==1?"grid_space" : "time_space");
+
+  if ( cdoTimer ) timer_stop(timer_init);
+  
+  if ( cdoTimer ) timer_start(timer_alloc);
+
+  /* allocation of temporary fields and output structures */
+  in           = (double    *) malloc(gridsize*sizeof(double));
+  datafields   = (double ****) malloc(nvars*sizeof(double ***));
+  datacounts   = (int     ***) malloc(nvars*sizeof(int **));
+  eigenvectors = (double ****) malloc(nvars*sizeof(double ***));
+  eigenvalues  = (double ****) malloc(nvars*sizeof(double ***));
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      gridID1             = vlistInqVarGrid(vlistID1, varID);
+      gridsize            = vlistGridsizeMax(vlistID1);
+      nlevs               = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      missval             = vlistInqVarMissval(vlistID1, varID);
+
+      datafields[varID]   = (double ***) malloc(nlevs*sizeof(double **));
+      datacounts[varID]   = (int **)     malloc(nlevs*sizeof(int* ));
+      eigenvectors[varID] = (double ***) malloc(nlevs*sizeof(double **));
+      eigenvalues[varID]  = (double ***) malloc(nlevs*sizeof(double **));
+
+      for ( levelID = 0; levelID < nlevs; ++levelID )
+        {
+          if ( grid_space )
+            {
+              datafields[varID][levelID]            = (double **) malloc(1*sizeof(double *));
+              //datafields[varID][levelID][0].grid    = gridID1;
+              //datafields[varID][levelID][0].nmiss   = 0;
+              //datafields[varID][levelID][0].missval = missval;
+              datafields[varID][levelID][0]     = (double *) malloc(gridsize*gridsize*sizeof(double));
+
+              datacounts[varID][levelID]            = (int *) malloc(gridsize*gridsize*sizeof(int));
+	      for ( i = 0; i<gridsize*gridsize; i++ )
+		{
+		  datacounts[varID][levelID][i] = 0;
+		  datafields[varID][levelID][0][i] = 0;            
+		}
+	    }
+          else if ( time_space )
+            {
+              datafields[varID][levelID] = (double **) malloc(nts*sizeof(double *));
+              for ( tsID = 0; tsID < nts; tsID++ )
+                {
+                  //datafields[varID][levelID][tsID].grid    = gridID1;
+                  //datafields[varID][levelID][tsID].nmiss   = 0;
+                  //datafields[varID][levelID][tsID].missval = missval;
+                  datafields[varID][levelID][tsID]    = (double *) malloc(gridsize*sizeof(double));
+                  for ( i = 0; i < gridsize; ++i )
+                    datafields[varID][levelID][tsID][i] = 0;
+                }
+              datacounts[varID][levelID] = (int *) malloc(gridsize*sizeof(int));	      
+	      for(i=0;i<gridsize;i++)
+		datacounts[varID][levelID][i] = 0;
+            }
+
+          eigenvectors[varID][levelID] = (double **) malloc(n_eig*sizeof(double *));
+          eigenvalues[varID][levelID]  = (double **) malloc(n*sizeof(double *));
+
+          for ( i = 0; i < n; i++ )
+            {
+              if ( i < n_eig )
+                {
+                  eigenvectors[varID][levelID][i] = (double *) malloc(gridsize*sizeof(double));
+                  for ( ii = 0; ii < gridsize; ++ii )
+                    eigenvectors[varID][levelID][i][ii] = missval;
+                }
+
+              eigenvalues[varID][levelID][i] = (double *) malloc(1*sizeof(double));
+              eigenvalues[varID][levelID][i][0]  = missval;
+            }
+        }
+    }
+
+  if ( cdoVerbose )
+    cdoPrint("Allocated eigenvalue/eigenvector structures with nts=%i gridsize=%i", nts, gridsize);
+
+  if ( cdoTimer ) timer_stop(timer_alloc);
+  if ( cdoTimer ) timer_start(timer_read);
+  tsID = 0;
+
+  /* read the data and create covariance matrices for each var & level */
+  while ( TRUE )
+    {
+      if ( reached_eof ) continue;
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 )
+        {
+          reached_eof = 1;
+          break;
+        }
+
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          int i2;
+
+          streamInqRecord(streamID1, &varID, &levelID);
+          gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+          missval = vlistInqVarMissval(vlistID1, varID);
+          streamReadRecord(streamID1, in, &nmiss);
+
+          if ( grid_space )
+            {
+	      // This could be done in parallel to save lots of time
+#if defined (_OPENMP)
+#pragma omp parallel for private(i1,i2) default(shared)
+#endif
+              for ( i1 = 0; i1 < gridsize; i1++ )
+                {
+                  for ( i2 = i1; i2 < gridsize; i2++ )
+                    {
+                      if ( nmiss == 0 ||
+			   (( ! DBL_IS_EQUAL(in[i1], missval) ) &&
+			    ( ! DBL_IS_EQUAL(in[i2], missval) )) )
+                        {
+                          datafields[varID][levelID][0][i1*gridsize+i2] += in[i1]*in[i2];
+                          datacounts[varID][levelID][i1*gridsize+i2]++;
+                        }
+                      else if ( missval_warning == 0 )
+                        {
+			  cdoWarning("Missing value support not checked for this operator!\n");
+			  missval_warning = 1; 
+			}
+                    }
+                }
+            }
+          else if ( time_space )
+	    {
+	      for ( i=0; i<gridsize; ++i )
+		{
+		  if ( ! DBL_IS_EQUAL(in[i], missval ) )
+		    {
+		      datafields[varID][levelID][tsID][i] = in[i];
+		      datacounts[varID][levelID][i]++;
+		    }
+		  else
+		    {
+		      if ( missval_warning == 0 )
+			{
+			  cdoWarning("Missing Value Support not Checked for this Operator!");
+			  cdoWarning("Does not work with changing locations of missing values in time.");
+			  missval_warning = 1;
+			}
+		      datafields[varID][levelID][tsID][i] = 0;
+		    }
+		}
+	    }
+        }
+      tsID++;
+    }
+
+  if ( tsID == 1 )
+    cdoAbort("File consists of only one timestep!");
+
+  if ( grid_space )
+    for ( i1 = 0; i1 < gridsize; ++i1 )
+      for ( i2 = 0; i2 < i1; ++i2 )
+        {
+          datafields[varID][levelID][0][i1*gridsize+i2] = datafields[varID][levelID][0][i2*gridsize+i1];
+          datacounts[varID][levelID][i1*gridsize+i2]    = datacounts[varID][levelID][i2*gridsize+i1];
+        }
+
+  /*
+  pack = (int *) malloc(gridsize*sizeof(int)); //TODO
+  miss = (int *) malloc(gridsize*sizeof(int));
+  */
+
+  if ( cdoTimer ) timer_stop(timer_read);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      char vname[256];
+      vlistInqVarName(vlistID1, varID, vname);
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      nlevs    = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+
+      if ( cdoVerbose )
+	cdoPrint("Calculating cov matrices for %i levels of var%i (%s)", nlevs, varID, vname);
+
+      for ( levelID = 0; levelID < nlevs; levelID++ )
+        {
+	  if ( cdoTimer ) timer_start(timer_cov);
+
+	  if ( cdoVerbose ) cdoPrint("processing level %i",levelID);
+
+          int i2;
+
+	  datafieldv = datafields[varID][levelID];
+	  datacountv = datacounts[varID][levelID];
+
+          cov   = NULL; // TODO covariance matrix / eigenvectors after solving
+          eigv  = NULL; // TODO eigenvalues
+	  pack  = NULL;
+	  miss  = NULL;
+          npack = 0;    // TODO already set to 0
+          sum_w = 0;
+
+          if ( grid_space )
+            {
+	      pack = (int *) malloc(gridsize*sizeof(int));
+	      miss = (int *) malloc(gridsize*sizeof(int));
+
+              for ( i1 = 0; i1 < gridsize; i1++ )
+                {
+		  if ( datacountv[i1*gridsize + i1] > 1 ) 
+		    pack[npack++] = i1;
+		  else
+		    miss[i1] = 1;
+                }
+
+              for ( i1 = 0; i1 < npack; i1++ )
+                sum_w += weight[pack[i1]];
+
+	      n = npack;
+	      if ( npack )
+		{
+		  cov = (double **) malloc(npack*sizeof(double *));
+		  for (i1 = 0; i1 < npack; i1++ )
+		    cov[i1] = (double*) malloc(npack*sizeof(double));
+		  eigv = (double *) malloc(npack*sizeof(double));
+		}
+
+              for (i1 = 0; i1 < npack; i1++)
+		for (i2 = i1; i2 < npack; i2++ )
+		  if ( datacountv[pack[i1]*gridsize+pack[i2]] )
+		    cov[i2][i1] = cov[i1][i2] =
+		      datafieldv[0][pack[i1]*gridsize+pack[i2]]*   // covariance
+		      sqrt(weight[pack[i1]]) * sqrt (weight[pack[i2]]) / sum_w /       // weights
+		      (datacountv[pack[i1]*gridsize+pack[i2]]);   // number of data contributing
+            }
+          else if ( time_space )
+            {
+              sum_w = 0;
+
+	      pack = (int *) malloc ( gridsize * sizeof(int) );
+	      miss = (int *) malloc ( gridsize * sizeof(int) );
+
+              for ( i = 0; i < gridsize ; i++ )
+                {
+		  if ( datacountv[i] )
+		    {
+		      pack[npack] = i;
+		      npack++;
+		      sum_w += weight[i];
+		    }
+		}
+
+	      if ( cdoVerbose )
+		cdoPrint("allocating cov with %i x %i elements | npack=%i",nts,nts,npack);
+
+              cov = (double **) malloc (nts*sizeof(double*));
+              for ( j1 = 0; j1 < nts; j1++)
+                cov[j1] = (double*) malloc(nts*sizeof(double));
+	      eigv = (double *) malloc (nts*sizeof(double));
+
+#if defined (_OPENMP)
+#pragma omp parallel for private(j1,j2,i,sum, df1p, df2p) default(shared) schedule(dynamic)
+#endif
+              for ( j1 = 0; j1 < nts; j1++ )
+		for ( j2 = j1; j2 < nts; j2++ )
+		  {
+		    sum = 0;
+		    df1p = datafieldv[j1];
+		    df2p = datafieldv[j2];
+		    for ( i = 0; i < npack; i++ )
+		      {
+			sum += weight[pack[i]]*df1p[pack[i]]*df2p[pack[i]];
+		      }
+		    cov[j2][j1] = cov[j1][j2] = sum / sum_w / nts;
+		  }
+
+	      if ( cdoVerbose )
+		cdoPrint("finished calculation of cov-matrix for var %s",&vname[0]);
+            }
+
+	  if ( cdoTimer ) timer_stop(timer_cov);
+
+          /* SOLVE THE EIGEN PROBLEM */
+	  if ( cdoTimer ) timer_start(timer_eig);
+	  
+	  if ( eigen_mode == JACOBI ) 
+	    // TODO: use return status (>0 okay, -1 did not converge at all) 
+	    parallel_eigen_solution_of_symmetric_matrix(&cov[0],&eigv[0],n,n,__func__);
+	  else 
+	    eigen_solution_of_symmetric_matrix(&cov[0],&eigv[0],n,n,__func__);
+
+	  if ( cdoTimer ) timer_stop(timer_eig);
+	  /* NOW: cov contains the eigenvectors, eigv the eigenvalues */
+	  
+	  if ( cdoTimer ) timer_start(timer_post);
+          for (i = 0; i < n; i++) 
+            eigenvalues[varID][levelID][i][0] = eigv[i]*sum_w;
+
+          for (i = 0; i < n_eig; i++)
+            {
+              if ( grid_space )
+		{
+		  for(j = 0; j < npack; j++)
+		    eigenvectors[varID][levelID][i][pack[j]] = 
+#ifdef OLD_IMPLEMENTATION
+		      cov[i][j] / sqrt(weight[pack[j]]);
+#else
+		      cov[i][j] /*/ sqrt(weight[pack[j]])*/;
+#endif
+		}
+              else if ( time_space )
+                {
+#if defined (_OPENMP)
+#pragma omp parallel for private(i2,j,sum) shared(datafieldv,eigenvectors)
+#endif
+                  for ( i2 = 0; i2 < npack; i2++ )
+                    {
+                      sum = 0;
+                      for ( j = 0; j < nts; j++ )
+                        sum += datafieldv[j][pack[i2]] * cov[i][j];
+
+                      eigenvectors[varID][levelID][i][pack[i2]] = sum;
+                    }
+                  // NORMALIZING
+                  sum = 0;
+
+#if defined (_OPENMP)
+#pragma omp parallel for private(i2) default(none) reduction(+:sum)	\
+  shared(eigenvectors,weight,pack,varID,levelID,i,npack)
+#endif
+                  for ( i2 = 0; i2 < npack; i2++ )
+		    {
+		      /* 
+		      ** do not need to account for weights as eigenvectors are non-weighted                                   
+		      */ 
+#ifdef OLD_IMPLEMENTATION
+		      sum += weight[pack[i2]] *
+#else
+		      sum += /*weight[pack[i2]] **/
+#endif
+		      eigenvectors[varID][levelID][i][pack[i2]] *
+		      eigenvectors[varID][levelID][i][pack[i2]];
+		    }
+
+                  if ( sum > 0 )
+                    {
+                      sum = sqrt(sum);
+#if defined (_OPENMP)
+#pragma omp parallel for private(i2) default(none) \
+  shared(npack,varID,levelID,i,pack,sum,eigenvectors)
+#endif
+                      for( i2 = 0; i2 < npack; i2++ )
+                        eigenvectors[varID][levelID][i][pack[i2]] /= sum;
+                    }
+                  else
+		    {
+#if defined (_OPENMP)
+#pragma omp parallel for private(i2) default(none) \
+  shared(npack,varID,levelID,i,pack,sum,eigenvectors,missval)
+#endif
+		      for( i2 = 0; i2 < npack; i2++ )
+			eigenvectors[varID][levelID][i][pack[i2]] = missval;
+		    }
+                } // else if ( time_space )
+            } // for ( i = 0; i < n_eig; i++ )
+	  if ( cdoTimer ) timer_stop(timer_post);
+
+	  if ( eigv ) free(eigv);
+	  for ( i=0; i<n; i++ )
+	    if ( cov[i] ) free(cov[i]);
+	  if ( cov ) free(cov);
+	  if ( miss ) free(miss);
+	  if ( pack ) free(pack);
+
+        } // for ( levelID = 0; levelID < nlevs; levelID++ )
+    } // for ( varID = 0; varID < nvars; varID++ )
+
+
+  /* write files with eigenvalues (ID3) and eigenvectors (ID2) */
+
+  /* eigenvalues */
+  streamID2   = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  vlistID2    = vlistDuplicate(vlistID1);
+  taxisID2    = taxisDuplicate(taxisID1);
+  taxisDefRdate(taxisID2, 0);
+  taxisDefRtime(taxisID2, 0);
+  vlistDefTaxis(vlistID2, taxisID2);
+  gridID2     = gridCreate(GRID_LONLAT, 1);
+  gridDefXsize(gridID2, 1);
+  gridDefYsize(gridID2, 1);
+  xvals    = 0;
+  yvals    = 0;
+  gridDefXvals(gridID2, &xvals);
+  gridDefYvals(gridID2, &yvals);
+  ngrids   = vlistNgrids(vlistID2);
+  for ( i = 0; i < ngrids; i++ )
+    vlistChangeGridIndex(vlistID2, i, gridID2);
+
+  /*  eigenvectors */
+  streamID3   = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  vlistID3    = vlistDuplicate(vlistID1);
+  taxisID3    = taxisDuplicate(taxisID1);
+  gridID3     = gridDuplicate(gridID1);
+  taxisDefRdate(taxisID3, 0);
+  taxisDefRtime(taxisID3, 0);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+
+  if ( cdoVerbose )
+    cdoPrint("Initialized streams");
+
+  if ( cdoTimer ) timer_start(timer_write);
+
+  if ( cdoVerbose ) cdoPrint("starting to write results");
+
+  streamDefVlist(streamID2, vlistID2);
+  streamDefVlist(streamID3, vlistID3);
+
+  vdate = 10101;
+  vtime = 0;
+  juldate = juldate_encode(calendar, vdate, vtime);
+  for ( tsID = 0; tsID < n; tsID++ )
+    {
+      juldate = juldate_add_seconds(60, juldate);
+      juldate_decode(calendar, juldate, &vdate, &vtime);
+
+      taxisDefVdate(taxisID2, vdate);
+      taxisDefVtime(taxisID2, vtime);
+      streamDefTimestep(streamID2, tsID);
+
+      if ( tsID < n_eig )
+        {
+          taxisDefVdate(taxisID3, vdate);
+          taxisDefVtime(taxisID3, vtime);
+          streamDefTimestep(streamID3, tsID);
+        }
+
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+          for ( levelID = 0; levelID < nlevs; levelID++ )
+            {
+              if ( tsID < n_eig )
+                {
+                  nmiss = 0;
+                  for ( i = 0; i < gridsize; i++ )
+                    if ( DBL_IS_EQUAL(eigenvectors[varID][levelID][tsID][i], missval) ) nmiss++;
+
+                  streamDefRecord(streamID3, varID, levelID);
+                  streamWriteRecord(streamID3, eigenvectors[varID][levelID][tsID], nmiss);
+                }
+
+              if ( DBL_IS_EQUAL(eigenvalues[varID][levelID][tsID][0], missval) ) nmiss = 1;
+              else nmiss = 0;
+              streamDefRecord(streamID2, varID, levelID);
+              streamWriteRecord(streamID2, eigenvalues[varID][levelID][tsID], nmiss);
+
+            }
+        }
+    }
+
+  if ( cdoVerbose ) cdoPrint("stopping timers");
+
+  if ( cdoTimer ) timer_stop(timer_write);
+
+  if ( cdoTimer ) timer_start(timer_finish);
+
+  if ( cdoVerbose ) cdoPrint("freeing pointers");
+  
+  for ( varID = 0; varID < nvars; varID++)
+    {
+      nlevs    = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      gridsize =  gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      
+      for(levelID = 0; levelID < nlevs; levelID++)
+        {
+	  int n_use = time_space == 1? nts : gridsize;
+          for(i = 0; i < n_use; i++)
+            {
+              if ( i < n_eig ) 
+                if (eigenvectors[varID][levelID][i])
+		  free(eigenvectors[varID][levelID][i]);
+	      if (eigenvalues[varID][levelID][i])
+		free(eigenvalues[varID][levelID][i]);
+	    }
+	  if ( grid_space ) 
+	    free(datafields[varID][levelID][0]);
+	  else if ( time_space )
+	    for (tsID=0; tsID<nts; tsID++ )
+	      free(datafields[varID][levelID][tsID]);
+          free(eigenvectors[varID][levelID]);
+          free(eigenvalues[varID][levelID]);
+          free(datacounts[varID][levelID]);
+	  free(datafields[varID][levelID]);
+        }
+      free(eigenvectors[varID]);
+      free(eigenvalues[varID]);
+      free(datafields[varID]);
+      free(datacounts[varID]);
+
+    }
+
+  free(eigenvectors);
+  free(eigenvalues);
+  free(datafields);
+  free(datacounts);
+  free(in);
+  free(weight);
+
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  //  vlistDestroy(vlistID1);
+  //  vlistDestroy(vlistID2);
+  //  vlistDestroy(vlistID3);
+
+  gridDestroy(gridID1);
+  gridDestroy(gridID2);
+  gridDestroy(gridID3);
+
+  //  taxisDestroy(taxisID1);
+  //  taxisDestroy(taxisID2);
+  //  taxisDestroy(taxisID3);
+
+  if ( cdoTimer ) timer_stop(timer_finish);
+
+  cdoFinish();
+
+  return (0);
+}
+
diff --git a/src/EcaIndices.c b/src/EcaIndices.c
new file mode 100755
index 0000000..48546cb
--- /dev/null
+++ b/src/EcaIndices.c
@@ -0,0 +1,1542 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+      MODULE      OPERATOR     INDEX    DESCRIPTION
+      
+      EcaCfd      eca_cfd      CFD      maximum number of consecutive frost days
+      EcaCsu      eca_csu      CSU      maximum number of consecutive summer days
+      EcaCwdi     eca_cwdi     CWDI     cold wave duration index
+      EcaCwfi     eca_cwfi     CWFI     number of cold-spell days
+      EcaEtr      eca_etr      ETR      intra-period extreme temperature range
+      EcaFd       eca_fd       FD       number of frost days
+      EcaGsl      eca_gsl      GSL      growing season length
+      EcaHd       eca_hd       HD       heating degree days
+      EcaHwdi     eca_hwdi     HWDI     heat wave duration index
+      EcaHwfi     eca_hwfi     HWFI     number of warm-spell days
+      EcaId       eca_id       ID       number of ice days
+      EcaSu       eca_su       SU       number of summer days
+      EcaTg10p    eca_tg10p    TG10p    percent of time TX < 10th percentile of daily mean temperature
+      EcaTg90p    eca_tg90p    TG90p    percent of time TX > 90th percentile of daily mean temperature
+      EcaTn10p    eca_tn10p    TN10p    percent of time TX < 10th percentile of daily minimum temperature   
+      EcaTn90p    eca_tn90p    TN90p    percent of time TX > 90th percentile of daily minimum temperature
+      EcaTr       eca_tr       TR       number of tropical nights
+      EcaTx10p    eca_tx10p    TX10p    percent of time TX < 10th percentile of daily maximum temperature
+      EcaTx90p    eca_tx90p    TX90p    percent of time TX > 90th percentile of daily maximum temperature
+
+      EcaCdd      eca_cdd      CDD      maximum number of consecutive dry days
+      EcaCwd      eca_cwd      CWD      maximum number of consecutive wet days
+      EcaR10mm    eca_r10mm    R10mm    number of days with precipitation >= 10 mm
+      EcaR20mm    eca_r20mm    R20mm    number of days with precipitation >= 20 mm
+      EcaR75p     eca_r75p     R75p     Percent of time RR > 75th percentile of daily precipitation amount 
+      EcaR75ptot  eca_r75ptot  R75pTOT  Percentage of annual total precipitation due to events wit RR > 75th percentile of daily precipitation amount
+      EcaR90p     eca_r90p     R90p     Percent of time RR > 90th percentile of daily precipitation amount
+      EcaR90ptot  eca_r90ptot  R90pTOT  Percentage of annual total precipitation due to events wit RR > 90th percentile of daily precipitation amount
+      EcaR95p     eca_r95p     R95p     Percent of time RR > 95th percentile of daily precipitation amount
+      EcaR95ptot  eca_r95ptot  R95pTOT  Percentage of annual total precipitation due to events wit RR > 95th percentile of daily precipitation amount
+      EcaR99p     eca_r99p     R99p     Percent of time RR > 75th percentile of daily precipitation amount
+      EcaR99ptot  eca_r99ptot  R99pTOT  Percentage of annual total precipitation due to events wit RR > 99th percentile of daily precipitation amount
+      EcaRr1      eca_rr1      RR1      number of wet days
+      EcaSdii     eca_sdii     SDII     simple daily intensity index
+      
+      Fdns        fdns                  frost days without surface snow 
+
+      Strwin      strwin                number of strong-wind days
+      Strbre      strbre                number of strong-breeze days 
+      Strgal      strgal                number of strong-gale days 
+      Hurr        hurr                  number of hurricane days 
+*/
+
+#include "cdo.h"
+#include "cdo_int.h"
+#include "ecacore.h"
+#include "ecautil.h"
+
+
+#define TO_DEG_CELSIUS(x) ((x) - 273.15)
+#define TO_KELVIN(x) ((x) + 273.15)
+
+
+static const char CFD_NAME[]         = "consecutive_frost_days_index_per_time_period";
+static const char CFD_LONGNAME[]     = "Consecutive frost days index is the greatest number of consecutive frost days in a given time period. Frost days is the number of days where minimum of temperature is below 0 degree Celsius. The time period should be defined by the bounds of the time coordinate.";
+static const char CFD_UNITS[]        = "No.";
+
+static const char CSU_NAME[]         = "consecutive_summer_days_index_per_time_period";
+static const char CSU_LONGNAME[]     = "Consecutive summer days index is the greatest number of consecutive summer days in a given time period. Summer days is the number of days where maximum of temperature is above 25 degree Celsius. The time period should be defined by the bounds of the time coordinate.";
+static const char CSU_UNITS[]        = "No.";
+
+static const char CWDI_NAME[]        = "cold_wave_duration_index_wrt_mean_of_reference_period";
+static const char CWDI_LONGNAME[]    = "This is the number of days per time period where in intervals of at least %d consecutive days the daily minimum temperature is more than %1.0f degrees below a reference value. The reference value is calculated  as the mean of minimum temperatures of a five day window centred on each calendar day of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char CWDI_UNITS[]       = "No.";
+static const char CWDI_NAME2[]       = "cold_waves_per_time_period";
+static const char CWDI_LONGNAME2[]   = "Number of cold waves per time period. The time period should be defined by the bounds of the time coordinate.";
+static const char CWDI_UNITS2[]      = "No.";
+
+static const char CWFI_NAME[]        = "cold_spell_days_index_wrt_10th_percentile_of_reference_period";
+static const char CWFI_LONGNAME[]    = "This is the number of days per time period where in intervals of at least %d consecutive days the daily mean temperature is below a reference value. The reference value is calculated  as the 10th percentile of daily mean temperatures of a five day window centred on each calendar day of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char CWFI_UNITS[]       = "No.";
+static const char CWFI_NAME2[]       = "cold_spell_periods_per_time_period";
+static const char CWFI_LONGNAME2[]   = "Number of cold spell periods per time period. The time period should be defined by the bounds of the time coordinate.";
+static const char CWFI_UNITS2[]      = "No.";
+
+static const char ETR_NAME[]         = "intra_period_extreme_temperature_range";
+static const char ETR_LONGNAME[]     = "Difference between the absolute extreme temperatures in observation period. The time period should be defined by the bounds of the time coordinate.";
+static const char ETR_UNITS[]        = "K";
+
+static const char FD_NAME[]          = "frost_days_index_per_time_period";
+static const char FD_LONGNAME[]      = "Frost days index is the number of days where minimum of temperature is below 0 degree Celsius. The time period should be defined by the bounds of the time coordinate.";
+static const char FD_UNITS[]         = "No.";
+
+static const char GSL_NAME[]         = "thermal_growing_season_length";
+static const char GSL_LONGNAME[]     = "Counted are the number of days per calendar year between the first occurrence of at least %d consecutive days where the daily mean temperature is above %1.0f degree Celsius and the first occurrence of at least %d consecutive days after 1st of July where the daily mean temperature is below %1.0f degree Celsius. The time period should be defined by the bounds of the time coordinate.";
+static const char GSL_UNITS[]        = "No.";
+static const char GSL_NAME2[]        = "day_of_year_of_growing_season_start";
+static const char GSL_LONGNAME2[]    = "Day of year of growing season start. The time period should be defined by the bounds of the time coordinate.";
+static const char GSL_UNITS2[]       = "No.";
+
+static const char HD_NAME[]          = "heating_degree_days_per_time_period";
+static const char HD_LONGNAME[]      = "Heating degree days relates the outside temperature with the room temperature during the heating period. It is the sum of the difference between room temperature X and daily mean temperature Y on days where Y is below a given constant A. X is 20 degree Celsius and A is 15 degree Celsius according to VDI guidelines. According to ECAD both X and A are 17 degree Celsius. The time period should be defined by the bounds of the time coordinate.";
+static const char HD_UNITS[]         = "No.";
+
+static const char HWDI_NAME[]        = "heat_wave_duration_index_wrt_mean_of_reference_period";
+static const char HWDI_LONGNAME[]    = "This is the number of days per time period where in intervals of at least %d consecutive days the daily maximum temperature is more than %1.0f degrees above a reference value. The reference value is calculated  as the mean of maximum temperatures of a five day window centred on each calendar day of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char HWDI_UNITS[]       = "No.";
+static const char HWDI_NAME2[]       = "heat_waves_per_time_period";
+static const char HWDI_LONGNAME2[]   = "Number of heat waves per time period. The time period should be defined by the bounds of the time coordinate.";
+static const char HWDI_UNITS2[]      = "No.";
+
+static const char HWFI_NAME[]        = "warm_spell_days_index_wrt_90th_percentile_of_reference_period";
+static const char HWFI_LONGNAME[]    = "This is the number of days per time period where in intervals of at least %d consecutive days the daily mean temperature is above a reference value. The reference value is calculated  as the 90th percentile of daily mean temperatures of a five day window centred on each calendar day of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char HWFI_UNITS[]       = "No.";
+static const char HWFI_NAME2[]       = "warm_spell_periods_per_time_period";
+static const char HWFI_LONGNAME2[]   = "Number of warm spell periods per time period. The time period should be defined by the bounds of the time coordinate.";
+static const char HWFI_UNITS2[]      = "No.";
+
+static const char ID_NAME[]          = "ice_days_index_per_time_period";
+static const char ID_LONGNAME[]      = "Ice days index is the number of days where maximum of temperature is below 0 degree Celsius. The time period should be defined by the bounds of the time coordinate.";
+static const char ID_UNITS[]         = "No.";
+
+static const char SU_NAME[]          = "summer_days_index_per_time_period";
+static const char SU_LONGNAME[]      = "Summer days index is the number of days where maximum of temperature is above %1.0f degree Celsius. The time period should be defined by the bounds of the time coordinate.";
+static const char SU_UNITS[]         = "No.";
+
+static const char TG10P_NAME[]       = "cold_days_percent_wrt_10th_percentile_of_reference_period";
+static const char TG10P_LONGNAME[]   = "This is the percent of time per time period where daily mean temperature is below a reference value. The reference value is calculated  as the 10th percentile of daily mean temperatures of a five day window centred on each calendar day of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char TG10P_UNITS[]      = "Percent";
+
+static const char TG90P_NAME[]       = "warm_days_percent_wrt_90th_percentile_of_reference_period";
+static const char TG90P_LONGNAME[]   = "This is the percent of time per time period where daily mean  temperature is above a reference value. The reference value is calculated  as the 90th percentile of daily mean temperatures of a five day window centred on each calendar day of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char TG90P_UNITS[]      = "Percent";
+
+static const char TN10P_NAME[]       = "cold_nights_percent_wrt_10th_percentile_of_reference_period";
+static const char TN10P_LONGNAME[]   = "This is the percent of time per time period where daily minimum  temperature is below a reference value. The reference value is calculated  as the 10th percentile of daily minimum temperatures of a five day window centred on each calendar day of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char TN10P_UNITS[]      = "Percent";
+
+static const char TN90P_NAME[]       = "warm_nights_percent_wrt_90th_percentile_of_reference_period";
+static const char TN90P_LONGNAME[]   = "This is the percent of time per time period where daily minimum  temperature is above a reference value. The reference value is calculated  as the 90th percentile of daily minimum temperatures of a five day window centred on each calendar day of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char TN90P_UNITS[]      = "Percent";
+
+static const char TR_NAME[]          = "tropical_nights_index_per_time_period";
+static const char TR_LONGNAME[]      = "Tropical nights index is the number of days where minimum of temperature is above %1.0f degree Celsius. The time period should be defined by the bounds of the time coordinate.";
+static const char TR_UNITS[]         = "No.";
+
+static const char TX10P_NAME[]       = "very_cold_days_percent_wrt_10th_percentile_of_reference_period";
+static const char TX10P_LONGNAME[]   = "This is the percent of time per time period where daily maximum temperature is below a reference value. The reference value is calculated  as the 10th percentile of daily maximum temperatures of a five day window centred on each calendar day of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char TX10P_UNITS[]      = "Percent";
+
+static const char TX90P_NAME[]       = "very_warm_days_percent_wrt_90th_percentile_of_reference_period";
+static const char TX90P_LONGNAME[]   = "This is the percent of time per time period where daily maximum  temperature is above a reference value. The reference value is calculated  as the 90th percentile of daily maximum temperatures of a five day window centred on each calendar day of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char TX90P_UNITS[]      = "Percent";
+
+static const char CDD_NAME[]         = "consecutive_dry_days_index_per_time_period";
+static const char CDD_LONGNAME[]     = "Consecutive dry days is the greatest number of consecutive days per time period with daily precipitation amount  below %g mm. The time period should be defined by the bounds of the time coordinate.";
+static const char CDD_UNITS[]        = "No.";
+static const char CDD_NAME2[]        = "number_of_cdd_periods_with_more_than_5days_per_time_period";
+static const char CDD_LONGNAME2[]    = "Number of cdd periods in given time period with more than 5 days. The time period should be defined by the bounds of the time coordinate.";
+static const char CDD_UNITS2[]       = "No.";
+
+static const char CWD_NAME[]         = "consecutive_wet_days_index_per_time_period";
+static const char CWD_LONGNAME[]     = "Consecutive wet days is the greatest number of consecutive days per time period with daily precipitation above %g mm. The time period should be defined by the bounds of the time coordinate.";
+static const char CWD_UNITS[]        = "No.";
+static const char CWD_NAME2[]        = "number_of_cwd_periods_with_more_than_5days_per_time_period";
+static const char CWD_LONGNAME2[]    = "Number of cwd periods in given time period with more than 5 days. The time period should be defined by the bounds of the time coordinate.";
+static const char CWD_UNITS2[]       = "No.";
+
+static const char PD_NAME[]          = "precipitation_days_index_per_time_period";
+static const char PD_LONGNAME[]      = "precipitation days is the number of days per time period with daily precipitation sum exceeding %g mm. The time period should be defined by the bounds of the time coordinate.";
+static const char PD_UNITS[]         = "No.";
+
+static const char R10MM_NAME[]       = "heavy_precipitation_days_index_per_time_period";
+static const char R10MM_LONGNAME[]   = "Heavy precipitation days is the number of days per time period with daily precipitation sum exceeding 10 mm. The time period should be defined by the bounds of the time coordinate.";
+static const char R10MM_UNITS[]      = "No.";
+
+static const char R20MM_NAME[]       = "very_heavy_precipitation_days_index_per_time_period";
+static const char R20MM_LONGNAME[]   = "Very heavy precipitation days is the number of days with daily precipitation sum exceeding 20 mm. The time period should be defined by the bounds of the time coordinate.";
+static const char R20MM_UNITS[]      = "No.";
+
+static const char R75P_NAME[]        = "moderate_wet_days_wrt_75th_percentile_of_reference_period";
+static const char R75P_LONGNAME[]    = "This is the percent of time per time period of wet days (daily sum at least 1 mm / day) where daily precipitation amount of a wet day is above a reference value. The reference value is calculated  as the 75th percentile of all wet days of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char R75P_UNITS[]       = "Percent";
+
+static const char R75PTOT_NAME[]     = "precipitation_percent_due_to_R75p_days";
+static const char R75PTOT_LONGNAME[] = "Percentage of  total precipitation amount per time period due to moderate_wet_days_wrt_75th_percentile_of_reference_period. The time period should be defined by the bounds of the time coordinate.";
+static const char R75PTOT_UNITS[]    = "Percent";
+
+static const char R90P_NAME[]        = "wet_days_wrt_90th_percentile_of_reference_period";
+static const char R90P_LONGNAME[]    = "This is the percent of time per time period of wet days (daily sum at least 1 mm / day) where daily precipitation amount of a wet day is above a reference value. The reference value is calculated  as the 90th percentile of all wet days of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char R90P_UNITS[]       = "Percent";
+
+static const char R90PTOT_NAME[]     = "precipitation_percent_due_to_R90p_days";
+static const char R90PTOT_LONGNAME[] = "Percentage of  total precipitation  amount per time period  due towet_days_wrt_90th_percentile_of_reference_period. The time period should be defined by the bounds of the time coordinate.";
+static const char R90PTOT_UNITS[]    = "Percent";
+
+static const char R95P_NAME[]        = "very_wet_days_wrt_95th_percentile_of_reference_period";
+static const char R95P_LONGNAME[]    = "This is the percent of time per time period of wet days (daily sum at least 1 mm / day) where daily precipitation amount of a wet day is above a reference value. The reference value is calculated  as the 95th percentile of all wet days of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char R95P_UNITS[]       = "Percent";
+
+static const char R95PTOT_NAME[]     = "precipitation_percent_due_to_R95p_days";
+static const char R95PTOT_LONGNAME[] = "Percentage of  total  precipitation amount per time period  due to  very_wet_days_wrt_95th_percentile_of_reference_period. The time period should be defined by the bounds of the time coordinate.";
+static const char R95PTOT_UNITS[]    = "Percent";
+
+static const char R99P_NAME[]        = "extremely_wet_days_wrt_99th_percentile_of_reference_period";
+static const char R99P_LONGNAME[]    = "This is the percent of time per time period of wet days (daily sum at least 1 mm / day) where daily precipitation amount of a wet day is above a reference value. The reference value is calculated  as the 99th percentile of all wet days of a given 30 year climate reference period. The time period should be defined by the bounds of the time coordinate.";
+static const char R99P_UNITS[]       = "Percent";
+
+static const char R99PTOT_NAME[]     = "precipitation_percent_due_to_R99p_days";
+static const char R99PTOT_LONGNAME[] = "percentage of  total  precipitation amount per time period  due to  extremely_wet_days_wrt_99th_percentile_of_reference_period. The time period should be defined by the bounds of the time coordinate.";
+static const char R99PTOT_UNITS[]    = "Percent";
+
+static const char RR1_NAME[]         = "wet_days_index_per_time_period";
+static const char RR1_LONGNAME[]     = "Wet days index is the number of days per time period with daily precipitation of at least %g mm.  The time period should be defined by the bounds of the time coordinate.";
+static const char RR1_UNITS[]        = "No.";
+
+static const char RX1DAY_NAME[]      = "highest_one_day_precipitation_amount_per_time_period";
+static const char RX1DAY_LONGNAME[]  = "Highest one  day precipitation  is the maximum of one day precipitation amount in a given time period. The time period should be defined by the bounds of the time coordinate.";
+static const char RX1DAY_UNITS[]     = "mm per day";
+
+static const char RX5DAY_NAME[]      = "highest_five_day_precipitation_amount_per_time_period";
+static const char RX5DAY_LONGNAME[]  = "Highest precipitation amount  for five day interval (including the calendar day as the last day). The time period should be defined by the bounds of the time coordinate.";
+static const char RX5DAY_UNITS[]     = "mm per 5 day";
+static const char RX5DAY_NAME2[]     = "number_of_5day_heavy_precipitation_periods_per_time_period";
+static const char RX5DAY_LONGNAME2[] = "Number of 5day periods in given time period with precipitation amount exceeding %1.0f mm / 5 days. The time period should be defined by the bounds of the time coordinate.";
+static const char RX5DAY_UNITS2[]    = "No.";
+
+static const char SDII_NAME[]        = "simple_daily_intensitiy_index_per_time_period";
+static const char SDII_LONGNAME[]    = "Simple daily intensity index is the mean of precipitation amount on wet days. A wet day is a day with precipitation sum of at least %g mm. The time period should be defined by the bounds of the time coordinate.";
+static const char SDII_UNITS[]       = "mm";
+
+static const char FDNS_NAME[]        = "frost_days_where_no_snow_index_per_time_period";       
+static const char FDNS_LONGNAME[]    = "Frost days where no snow index is the number of days without snowcover and where the minimum of temperature is below 0 degree Celsius. The time period should be defined by the bounds of the time coordinate.";       
+static const char FDNS_UNITS[]       = "No.";
+
+static const char STRWIN_NAME[]      = "strong_wind_days_index_per_time_period";
+static const char STRWIN_LONGNAME[]  = "Strong wind days index is the number of days per time period where maximum wind speed is above %1.0f m/s. The time period should be defined by the bounds of the time coordinate.";
+static const char STRWIN_UNITS[]     = "No.";
+static const char STRWIN_NAME2[]     = "consecutive_strong_wind_days_index_per_time_period";
+static const char STRWIN_LONGNAME2[] = "Greatest number of consecutive strong wind days per time period. The time period should be defined by the bounds of the time coordinate.";
+static const char STRWIN_UNITS2[]    = "No.";
+
+static const char STRBRE_NAME[]      = "strong_breeze_days_index_per_time_period";
+static const char STRBRE_LONGNAME[]  = "Strong breeze days index is the number of days per time period where maximum wind speed is above 10.5 m/s. The time period should be defined by the bounds of the time coordinate.";
+static const char STRBRE_NAME2[]     = "consecutive_strong_breeze_days_index_per_time_period";
+static const char STRBRE_LONGNAME2[] = "Greatest number of consecutive strong breeze days per time period. The time period should be defined by the bounds of the time coordinate.";
+
+static const char STRGAL_NAME[]      = "strong_gale_days_index_per_time_period";
+static const char STRGAL_LONGNAME[]  = "Strong gale days index is the number of days per time period where maximum wind speed is above 20.5 m/s. The time period should be defined by the bounds of the time coordinate.";
+static const char STRGAL_NAME2[]     = "consecutive_strong_gale_days_index_per_time_period";
+static const char STRGAL_LONGNAME2[] = "Greatest number of consecutive strong gale days per time period. The time period should be defined by the bounds of the time coordinate.";
+
+static const char HURR_NAME[]        = "hurricane_days_index_per_time_period";
+static const char HURR_LONGNAME[]    = "Hurricane days index is the number of days per time period where maximum wind speed is above 32.5 m/s. The time period should be defined by the bounds of the time coordinate.";
+static const char HURR_NAME2[]       = "consecutive_hurricane_days_index_per_time_period";
+static const char HURR_LONGNAME2[]   = "Greatest number of consecutive hurricane days per time period. The time period should be defined by the bounds of the time coordinate.";
+
+
+/* ECA temperature indices */
+
+
+void *EcaCfd(void *argument)
+{
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_cfd", 0, 31, NULL);
+  
+  request.var1.name     = CFD_NAME;
+  request.var1.longname = CFD_LONGNAME;
+  request.var1.units    = NULL;
+  request.var1.f1       = farselltc;
+  request.var1.f1arg    = TO_KELVIN(0.0);
+  request.var1.f2       = farnum2;
+  request.var1.f3       = farmax;
+  request.var1.mulc     = 0.0;
+  request.var1.addc     = 0.0;
+  request.var1.epilog   = NONE;
+  request.var2.h2       = NULL;
+  request.var2.h3       = NULL;
+   
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaCsu(void *argument)
+{
+  double argT = 25.0;
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_csu", 0, 31, NULL);
+
+  if ( operatorArgc() > 0 ) argT = atof(operatorArgv()[0]);
+
+  request.var1.name     = CSU_NAME;
+  request.var1.longname = CSU_LONGNAME;
+  request.var1.units    = NULL;
+  request.var1.f1       = farselgtc;
+  request.var1.f1arg    = TO_KELVIN(argT);
+  request.var1.f2       = farnum2;
+  request.var1.f3       = farmax;
+  request.var1.mulc     = 0.0;
+  request.var1.addc     = 0.0;
+  request.var1.epilog   = NONE;
+  request.var2.h2       = NULL;
+  request.var2.h3       = NULL;
+  
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaCwdi(void *argument)
+{
+  char *longname;
+  int argN = 6;
+  double argT = 5.0;
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_cwdi", 0, 31, NULL);
+
+  if ( operatorArgc() > 0 ) argN = atoi(operatorArgv()[0]);
+  if ( operatorArgc() > 1 ) argT = atof(operatorArgv()[1]);
+  
+  longname = (char *) malloc(strlen(CWDI_LONGNAME) + 80);
+  sprintf(longname, CWDI_LONGNAME, argN, argT);
+
+  request.var1.name     = CWDI_NAME;
+  request.var1.longname = longname;
+  request.var1.units    = CWDI_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = farcsub;
+  request.var1.f2arg    = argT;
+  request.var1.f3       = farsellt;
+  request.var1.f4       = farnum2;
+  request.var1.f5       = farnum3;
+  request.var1.f5arg    = argN;
+  request.var1.epilog   = NONE;
+  request.var2.name     = CWDI_NAME2;
+  request.var2.longname = CWDI_LONGNAME2;
+  request.var2.units    = CWDI_UNITS2;
+  request.var2.h1       = farseleqc;
+  request.var2.h1arg    = argN;
+  request.var2.h2       = farnum;
+   
+  eca2(&request);
+  
+  free(longname);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaCwfi(void *argument)
+{
+  char *longname;
+  int argN = 6;
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_cwfi", 0, 31, NULL);
+
+  if ( operatorArgc() > 0 ) argN = atoi(operatorArgv()[0]);
+
+  longname = (char *) malloc(strlen(CWFI_LONGNAME) + 40);
+  sprintf(longname, CWFI_LONGNAME, argN);
+
+  request.var1.name     = CWFI_NAME;
+  request.var1.longname = longname;
+  request.var1.units    = CWFI_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farsellt;
+  request.var1.f4       = farnum2;
+  request.var1.f5       = farnum3;
+  request.var1.f5arg    = argN;
+  request.var1.epilog   = NONE;
+  request.var2.name     = CWFI_NAME2;
+  request.var2.longname = CWFI_LONGNAME2;
+  request.var2.units    = CWFI_UNITS2;
+  request.var2.h1       = farseleqc;
+  request.var2.h1arg    = argN;
+  request.var2.h2       = farnum;
+   
+  eca2(&request);
+  
+  free(longname);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaEtr(void *argument)
+{
+  ECA_REQUEST_3 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_etr", 0, 31, NULL);
+  
+  request.name     = ETR_NAME;
+  request.longname = ETR_LONGNAME;
+  request.units    = NULL;
+  request.f1       = farmax; 
+  request.f2       = farmin;
+  request.f3       = farsub;
+   
+  eca3(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaFd(void *argument)
+{
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_fd", 0, 31, NULL);
+  
+  request.var1.name     = FD_NAME;
+  request.var1.longname = FD_LONGNAME;
+  request.var1.units    = NULL;
+  request.var1.f1       = farselltc; 
+  request.var1.f1arg    = TO_KELVIN(0.0);
+  request.var1.f2       = farnum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;    
+  request.var1.addc     = 0.0;
+  request.var1.epilog   = NONE;    
+  request.var2.h2       = NULL; 
+  request.var2.h3       = NULL; 
+   
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+/*
+ * Definition of GSL: (Thermal) Growing Season Length start at the first span
+ * of at least 6 (argN) days with T > 5.0°C (argT) in first half of the year
+ * and ends at the first span of ar least 6 (argN) days with T < 5.0°C (argT)
+ * in the second half.
+ * ATTENTION: Year of the northern hemisphere starts in january to
+ * december, whereas for the southern hemisphere is goes from july to june!
+ * Hence, at least 18 Month of data is needed for computing the gsl of the
+ * whole earth.
+*/
+void *EcaGsl(void *argument)
+{
+  char *longname;
+  int argN = 6; 
+  double argT = 5.0;
+  double minLandFraction = 0.5;
+  ECA_REQUEST_4 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_gsl", 0, 10, NULL);
+  
+  if ( operatorArgc() > 0 ) argN = atoi(operatorArgv()[0]);
+  if ( operatorArgc() > 1 ) argT = atof(operatorArgv()[1]);
+  if ( operatorArgc() > 2 ) minLandFraction = atof(operatorArgv()[2]);
+
+  longname = (char *) malloc(strlen(GSL_LONGNAME) + 160);
+  sprintf(longname, GSL_LONGNAME, argN, argT, argN, argT);
+  
+  request.name      = GSL_NAME;
+  request.longname  = longname;
+  request.units     = GSL_UNITS;
+  request.name2     = GSL_NAME2;
+  request.longname2 = GSL_LONGNAME2;
+  request.units2    = GSL_UNITS2;
+  request.s1        = farselgtc; 
+  request.s1arg     = TO_KELVIN(argT);
+  request.s2        = farselltc;
+  request.s2arg     = TO_KELVIN(argT);
+  request.s3        = farselgec;
+  request.s3arg     = minLandFraction;
+  request.consecutiveDays = argN;    
+   
+  eca4(&request);
+  
+  free(longname);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaHd(void *argument)
+{
+  double argX = 17.0;
+  double argA = 17.0;
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_hd", 0, 31, NULL);
+
+  if ( operatorArgc() > 0 ) 
+    {
+      argX = atof(operatorArgv()[0]);
+      argA = argX;
+    }
+  if ( operatorArgc() > 1 ) 
+    argA = atof(operatorArgv()[1]);
+  
+  request.var1.name     = HD_NAME;
+  request.var1.longname = HD_LONGNAME;
+  request.var1.units    = HD_UNITS;
+  request.var1.f1       = farselltc; 
+  request.var1.f1arg    = TO_KELVIN(argA);
+  request.var1.f2       = farsum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = -1.0;    
+  request.var1.addc     = TO_KELVIN(argX);
+  request.var1.epilog   = NONE;    
+  request.var2.h2       = NULL; 
+  request.var2.h3       = NULL; 
+   
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaHwdi(void *argument)
+{
+  char *longname;
+  int argN = 6;
+  double argT = 5.0;
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_hwdi", 0, 31, NULL);
+
+  if ( operatorArgc() > 0 ) argN = atoi(operatorArgv()[0]);
+  if ( operatorArgc() > 1 ) argT = atof(operatorArgv()[1]);
+  
+  longname = (char *) malloc(strlen(HWDI_LONGNAME) + 80);
+  sprintf(longname, HWDI_LONGNAME, argN, argT);
+  
+  request.var1.name     = HWDI_NAME;
+  request.var1.longname = longname;
+  request.var1.units    = HWDI_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = farcadd;
+  request.var1.f2arg    = argT;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farnum2;
+  request.var1.f5       = farnum3;
+  request.var1.f5arg    = argN;
+  request.var1.epilog   = NONE;
+  request.var2.name     = HWDI_NAME2;
+  request.var2.longname = HWDI_LONGNAME2;
+  request.var2.units    = HWDI_UNITS2;
+  request.var2.h1       = farseleqc;
+  request.var2.h1arg    = argN;
+  request.var2.h2       = farnum;
+   
+  eca2(&request);
+  
+  free(longname);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaHwfi(void *argument)
+{
+  char *longname;
+  int argN = 6;
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_hwfi", 0, 31, NULL);
+
+  if ( operatorArgc() > 0 ) argN = atoi(operatorArgv()[0]);
+
+  longname = (char *) malloc(strlen(HWFI_LONGNAME) + 40);
+  sprintf(longname, HWFI_LONGNAME, argN);
+
+  request.var1.name     = HWFI_NAME;
+  request.var1.longname = longname;
+  request.var1.units    = HWFI_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farnum2;
+  request.var1.f5       = farnum3;
+  request.var1.f5arg    = argN;
+  request.var1.epilog   = NONE;
+  request.var2.name     = HWFI_NAME2;
+  request.var2.longname = HWFI_LONGNAME2;
+  request.var2.units    = HWFI_UNITS2;
+  request.var2.h1       = farseleqc;
+  request.var2.h1arg    = argN;
+  request.var2.h2       = farnum;
+   
+  eca2(&request);
+  
+  free(longname);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaId(void *argument)
+{
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_id", 0, 31, NULL);
+
+  request.var1.name     = ID_NAME;
+  request.var1.longname = ID_LONGNAME;
+  request.var1.units    = ID_UNITS;
+  request.var1.f1       = farselltc;
+  request.var1.f1arg    = TO_KELVIN(0.0);
+  request.var1.f2       = farnum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;    
+  request.var1.addc     = 0.0;   
+  request.var1.epilog   = NONE; 
+  request.var2.h2       = NULL; 
+  request.var2.h3       = NULL; 
+    
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaSu(void *argument)
+{
+  char *longname;
+  double argT = 25.0;
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_su", 0, 31, NULL);
+
+  if ( operatorArgc() > 0 ) argT = atof(operatorArgv()[0]);
+  longname = (char *) malloc(strlen(SU_LONGNAME) + 40);
+  sprintf(longname, SU_LONGNAME, argT);
+
+  request.var1.name     = SU_NAME;
+  request.var1.longname = longname;
+  request.var1.units    = NULL;
+  request.var1.f1       = farselgtc;
+  request.var1.f1arg    = TO_KELVIN(argT);
+  request.var1.f2       = farnum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;    
+  request.var1.addc     = 0.0;    
+  request.var1.epilog   = NONE; 
+  request.var2.h2       = NULL; 
+  request.var2.h3       = NULL; 
+ 
+  eca1(&request);
+  
+  free(longname);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaTg10p(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_tg10p", 0, 31, NULL);
+
+  request.var1.name     = TG10P_NAME;
+  request.var1.longname = TG10P_LONGNAME;
+  request.var1.units    = TG10P_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farsellt;
+  request.var1.f4       = farnum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TIME;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaTg90p(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_tg90p", 0, 31, NULL);
+
+  request.var1.name     = TG90P_NAME;
+  request.var1.longname = TG90P_LONGNAME;
+  request.var1.units    = TG90P_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farnum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TIME;
+  request.var2.h2       = NULL;
+  
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaTn10p(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_tn10p", 0, 31, NULL);
+
+  request.var1.name     = TN10P_NAME;
+  request.var1.longname = TN10P_LONGNAME;
+  request.var1.units    = TN10P_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farsellt;
+  request.var1.f4       = farnum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TIME;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaTn90p(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_tn90p", 0, 31, NULL);
+
+  request.var1.name     = TN90P_NAME;
+  request.var1.longname = TN90P_LONGNAME;
+  request.var1.units    = TN90P_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farnum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TIME;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaTr(void *argument)
+{
+  char *longname;
+  double argT = 20.0;
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_tr", 0, 31, NULL);
+
+  if ( operatorArgc() > 0 ) argT = atof(operatorArgv()[0]);
+  longname = (char *) malloc(strlen(TR_LONGNAME) + 40);
+  sprintf(longname, TR_LONGNAME, argT);
+ 
+  request.var1.name     = TR_NAME;
+  request.var1.longname = longname;
+  request.var1.units    = TR_UNITS;
+  request.var1.f1       = farselgtc;
+  request.var1.f1arg    = TO_KELVIN(argT);
+  request.var1.f2       = farnum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;    
+  request.var1.addc     = 0.0;    
+  request.var1.epilog   = NONE; 
+  request.var2.h2       = NULL; 
+  request.var2.h3       = NULL; 
+   
+  eca1(&request);
+  
+  free(longname);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaTx10p(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_tx10p", 0, 31, NULL);
+
+  request.var1.name     = TX10P_NAME;
+  request.var1.longname = TX10P_LONGNAME;
+  request.var1.units    = TX10P_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farsellt;
+  request.var1.f4       = farnum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TIME;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaTx90p(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_tx90p", 0, 31, NULL);
+ 
+  request.var1.name     = TX90P_NAME;
+  request.var1.longname = TX90P_LONGNAME;
+  request.var1.units    = TX90P_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farnum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TIME;
+  request.var2.h2       = NULL;
+   
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+/* ECA precipitation indices */
+
+
+void *EcaCdd(void *argument)
+{
+  ECA_REQUEST_1 request;
+  char lnamebuffer[1024];
+  double threshold = 1;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_cdd", 0, 31, NULL);
+
+  if ( operatorArgc() == 1 ) threshold = atof(operatorArgv()[0]);
+  if ( operatorArgc() > 1 ) cdoAbort("Too many arguments!");
+
+  sprintf(lnamebuffer, CDD_LONGNAME, threshold);
+
+  request.var1.name     = CDD_NAME;
+  request.var1.longname = lnamebuffer;
+  request.var1.units    = CDD_UNITS;
+  request.var1.f1       = farselltc;
+  request.var1.f1arg    = threshold;
+  request.var1.f2       = farnum2;
+  request.var1.f3       = farmax;
+  request.var1.mulc     = 0.0;
+  request.var1.addc     = 0.0;
+  request.var1.epilog   = NONE;
+  request.var2.name     = CDD_NAME2;
+  request.var2.longname = CDD_LONGNAME2;
+  request.var2.units    = CDD_UNITS2;
+  request.var2.h1       = farseleqc;
+  request.var2.h1arg    = 6;
+  request.var2.h2       = NULL;
+  request.var2.h3       = farnum;
+   
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaCwd(void *argument)
+{
+  ECA_REQUEST_1 request;
+  char lnamebuffer[1024];
+  double threshold = 1;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_cwd", 0, 31, NULL);
+
+  if ( operatorArgc() == 1 ) threshold = atof(operatorArgv()[0]);
+  if ( operatorArgc() > 1 ) cdoAbort("Too many arguments!");
+
+  sprintf(lnamebuffer, CWD_LONGNAME, threshold);
+
+  request.var1.name     = CWD_NAME;
+  request.var1.longname = lnamebuffer;
+  request.var1.units    = CWD_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = threshold;
+  request.var1.f2       = farnum2;
+  request.var1.f3       = farmax;
+  request.var1.mulc     = 0.0;
+  request.var1.addc     = 0.0;
+  request.var1.epilog   = NONE;
+  request.var2.name     = CWD_NAME2;
+  request.var2.longname = CWD_LONGNAME2;
+  request.var2.units    = CWD_UNITS2;
+  request.var2.h1       = farseleqc;
+  request.var2.h1arg    = 6;
+  request.var2.h2       = NULL;
+  request.var2.h3       = farnum;
+   
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaPd(void *argument)
+{
+  int ECA_PD, ECA_R10MM, ECA_R20MM;
+  int operatorID;
+  char lnamebuffer[1024];
+  double threshold = 0;
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+
+  ECA_PD      = cdoOperatorAdd("eca_pd",      0, 31, NULL);
+  ECA_R10MM   = cdoOperatorAdd("eca_r10mm",   0, 31, NULL);
+  ECA_R20MM   = cdoOperatorAdd("eca_r20mm",   0, 31, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == ECA_PD )
+    {
+      operatorInputArg("daily precipitation amount threshold in [mm]");
+
+      if ( operatorArgc() < 1 ) cdoAbort("Too few arguments!");
+      if ( operatorArgc() > 1 ) cdoAbort("Too many arguments!");
+
+      threshold = atof(operatorArgv()[0]);
+
+      if ( threshold < 0 ) cdoAbort("Parameter out of range: threshold = %d", threshold);
+
+      sprintf(lnamebuffer, PD_LONGNAME, threshold);
+      request.var1.name     = PD_NAME;
+      request.var1.longname = lnamebuffer;
+      request.var1.units    = PD_UNITS;
+    }
+  else if ( operatorID == ECA_R10MM )
+    {
+      threshold = 10;
+
+      request.var1.name     = R10MM_NAME;
+      request.var1.longname = R10MM_LONGNAME;
+      request.var1.units    = R10MM_UNITS;
+    }
+  else if ( operatorID == ECA_R20MM )
+    {
+      threshold = 20;
+
+      request.var1.name     = R20MM_NAME;
+      request.var1.longname = R20MM_LONGNAME;
+      request.var1.units    = R20MM_UNITS;
+    }
+  
+  if ( cdoVerbose ) cdoPrint("threshold = %g", threshold);
+
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = threshold;
+  request.var1.f2       = farnum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;   
+  request.var1.addc     = 0.0;    
+  request.var1.epilog   = NONE;
+  request.var2.h2       = NULL;
+  request.var2.h3       = NULL;
+  
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaR75p(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_r75p", 0, 31, NULL);
+
+  request.var1.name     = R75P_NAME;
+  request.var1.longname = R75P_LONGNAME;
+  request.var1.units    = R75P_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = 1.0;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farnum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TIME;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaR75ptot(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_r75ptot", 0, 31, NULL);
+
+  request.var1.name     = R75PTOT_NAME;
+  request.var1.longname = R75PTOT_LONGNAME;
+  request.var1.units    = R75PTOT_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = 1.0;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farsum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TOTAL_AMOUNT;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaR90p(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_r90p", 0, 31, NULL);
+
+  request.var1.name     = R90P_NAME;
+  request.var1.longname = R90P_LONGNAME;
+  request.var1.units    = R90P_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = 1.0;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farnum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TIME;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaR90ptot(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_r90ptot", 0, 31, NULL);
+
+  request.var1.name     = R90PTOT_NAME;
+  request.var1.longname = R90PTOT_LONGNAME;
+  request.var1.units    = R90PTOT_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = 1.0;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farsum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TOTAL_AMOUNT;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaR95p(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_r95p", 0, 31, NULL);
+
+  request.var1.name     = R95P_NAME;
+  request.var1.longname = R95P_LONGNAME;
+  request.var1.units    = R95P_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = 1.0;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farnum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TIME;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaR95ptot(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_r95ptot", 0, 31, NULL);
+
+  request.var1.name     = R95PTOT_NAME;
+  request.var1.longname = R95PTOT_LONGNAME;
+  request.var1.units    = R95PTOT_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = 1.0;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farsum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TOTAL_AMOUNT;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaR99p(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_r99p", 0, 31, NULL);
+
+  request.var1.name     = R99P_NAME;
+  request.var1.longname = R99P_LONGNAME;
+  request.var1.units    = R99P_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = 1.0;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farnum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TIME;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaR99ptot(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_r99ptot", 0, 31, NULL);
+
+  request.var1.name     = R99PTOT_NAME;
+  request.var1.longname = R99PTOT_LONGNAME;
+  request.var1.units    = NULL;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = 1.0;
+  request.var1.f2       = NULL;
+  request.var1.f3       = farselgt;
+  request.var1.f4       = farsum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = PERCENT_OF_TOTAL_AMOUNT;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaRr1(void *argument)
+{
+  ECA_REQUEST_1 request;
+  char lnamebuffer[1024];
+  double threshold = 1;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_rr1", 0, 31, NULL);
+
+  if ( operatorArgc() == 1 ) threshold = atof(operatorArgv()[0]);
+  if ( operatorArgc() > 1 ) cdoAbort("Too many arguments!");
+
+  sprintf(lnamebuffer, RR1_LONGNAME, threshold);
+
+  request.var1.name     = RR1_NAME;
+  request.var1.longname = lnamebuffer;
+  request.var1.units    = RR1_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = threshold;
+  request.var1.f2       = farnum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;    
+  request.var1.addc     = 0.0; 
+  request.var1.epilog   = NONE;   
+  request.var2.h2       = NULL;    
+  request.var2.h3       = NULL;    
+   
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaRx1day(void *argument)
+{
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  if ( operatorArgc() > 0 )
+    {
+      if ( 'm' == operatorArgv()[0][0] )
+        cdoOperatorAdd("eca_rx1day", 0, 8,  NULL); /* monthly mode */
+      else
+        cdoWarning("Parameter value '%s' is invalid. The only valid value is 'm' indicating monthly mode. Operating in yearly mode now.");
+    }
+  else 
+    cdoOperatorAdd("eca_rx1day", 0, 31, NULL);
+
+  request.var1.name     = RX1DAY_NAME;
+  request.var1.longname = RX1DAY_LONGNAME;
+  request.var1.units    = RX1DAY_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = farmax;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;    
+  request.var1.addc     = 0.0;    
+  request.var1.epilog   = NONE;
+  request.var2.h2       = NULL;
+  request.var2.h3       = NULL;
+   
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaRx5day(void *argument)
+{
+  char *longname;
+  double argX = 50.0;
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  if ( operatorArgc() > 0 ) argX = atof(operatorArgv()[0]);
+  
+  longname = (char *) malloc(strlen(RX5DAY_LONGNAME2) + 40);
+  sprintf(longname, RX5DAY_LONGNAME2, argX);
+  
+  cdoOperatorAdd("eca_rx5day", 0, 31, NULL);
+
+  request.var1.name     = RX5DAY_NAME;
+  request.var1.longname = RX5DAY_LONGNAME;
+  request.var1.units    = RX5DAY_UNITS;
+  request.var1.f1       = NULL;
+  request.var1.f2       = farmax;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0; 
+  request.var1.addc     = 0.0; 
+  request.var1.epilog   = NONE;
+  request.var2.name     = RX5DAY_NAME2;
+  request.var2.longname = longname;
+  request.var2.units    = RX5DAY_UNITS2;
+  request.var2.h1       = farselgec;
+  request.var2.h1arg    = argX;
+  request.var2.h2       = farnum;
+  request.var2.h3       = NULL;
+   
+  eca1(&request);
+  
+  free(longname);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *EcaSdii(void *argument)
+{
+  ECA_REQUEST_1 request;
+  char lnamebuffer[1024];
+  double threshold = 1;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("eca_sdii", 0, 31, NULL);
+
+  if ( operatorArgc() == 1 ) threshold = atof(operatorArgv()[0]);
+  if ( operatorArgc() > 1 ) cdoAbort("Too many arguments!");
+
+  sprintf(lnamebuffer, SDII_LONGNAME, threshold);
+
+  request.var1.name     = SDII_NAME;
+  request.var1.longname = lnamebuffer;
+  request.var1.units    = SDII_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = threshold;
+  request.var1.f2       = farsum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;    
+  request.var1.addc     = 0.0;    
+  request.var1.epilog   = MEAN;
+  request.var2.h2       = NULL;
+  request.var2.h3       = NULL;
+   
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *Fdns(void *argument)
+{
+  ECA_REQUEST_2 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("fdns", 0, 31, NULL);
+
+  request.var1.name     = FDNS_NAME;
+  request.var1.longname = FDNS_LONGNAME;
+  request.var1.units    = FDNS_UNITS;
+  request.var1.f1       = farsellec;
+  request.var1.f1arg    = TO_KELVIN(0.0);
+  request.var1.f2       = farsellec;
+  request.var1.f2arg    = 0.01;
+  request.var1.f3       = faradd; /* any f with f(a, b) = miss, if a = miss or b = miss will do here */
+  request.var1.f4       = farnum;
+  request.var1.f5       = NULL;
+  request.var1.epilog   = NONE;
+  request.var2.h2       = NULL;
+    
+  eca2(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *Strwin(void *argument)
+{
+  char *longname;
+  double maxWind = 10.5;
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("strwin", 0, 31, NULL);
+
+  if ( operatorArgc() > 0 )
+    maxWind = atof(operatorArgv()[0]);
+
+  longname = (char *) malloc(strlen(STRWIN_LONGNAME) + 40);
+  sprintf(longname, STRWIN_LONGNAME, maxWind);
+         
+  request.var1.name     = STRWIN_NAME;
+  request.var1.longname = longname;
+  request.var1.units    = STRWIN_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = maxWind;
+  request.var1.f2       = farnum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;    
+  request.var1.addc     = 0.0;    
+  request.var1.epilog   = NONE;
+  request.var2.name     = STRWIN_NAME2;
+  request.var2.longname = STRWIN_LONGNAME2;
+  request.var2.units    = STRWIN_UNITS2;
+  request.var2.h1       = farselgec;
+  request.var2.h1arg    = maxWind;
+  request.var2.h2       = farnum2;
+  request.var2.h3       = farmax;
+   
+  eca1(&request);
+  
+  free(longname);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *Strbre(void *argument)
+{
+  static const double maxWind = 10.5;
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("strbre", 0, 31, NULL);
+         
+  request.var1.name     = STRBRE_NAME;
+  request.var1.longname = STRBRE_LONGNAME;
+  request.var1.units    = STRWIN_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = maxWind;
+  request.var1.f2       = farnum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;    
+  request.var1.addc     = 0.0;    
+  request.var1.epilog   = NONE;
+  request.var2.name     = STRBRE_NAME2;
+  request.var2.longname = STRBRE_LONGNAME2;
+  request.var2.units    = STRWIN_UNITS2;
+  request.var2.h1       = farselgec;
+  request.var2.h1arg    = maxWind;
+  request.var2.h2       = farnum2;
+  request.var2.h3       = farmax;
+   
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *Strgal(void *argument)
+{
+  static const double maxWind = 20.5;
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("strgal", 0, 31, NULL);
+         
+  request.var1.name     = STRBRE_NAME;
+  request.var1.longname = STRBRE_LONGNAME;
+  request.var1.units    = STRWIN_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = maxWind;
+  request.var1.f2       = farnum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;    
+  request.var1.addc     = 0.0;    
+  request.var1.epilog   = NONE;
+  request.var2.name     = STRBRE_NAME2;
+  request.var2.longname = STRBRE_LONGNAME2;
+  request.var2.units    = STRWIN_UNITS2;
+  request.var2.h1       = farselgec;
+  request.var2.h1arg    = maxWind;
+  request.var2.h2       = farnum2;
+  request.var2.h3       = farmax;
+   
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
+
+
+void *Hurr(void *argument)
+{
+  static const double maxWind = 32.5;
+  ECA_REQUEST_1 request;
+  
+  cdoInitialize(argument);
+  cdoOperatorAdd("hurr", 0, 31, NULL);
+         
+  request.var1.name     = HURR_NAME;
+  request.var1.longname = HURR_LONGNAME;
+  request.var1.units    = STRWIN_UNITS;
+  request.var1.f1       = farselgec;
+  request.var1.f1arg    = maxWind;
+  request.var1.f2       = farnum;
+  request.var1.f3       = NULL;
+  request.var1.mulc     = 0.0;    
+  request.var1.addc     = 0.0;    
+  request.var1.epilog   = NONE;
+  request.var2.name     = HURR_NAME2;
+  request.var2.longname = HURR_LONGNAME2;
+  request.var2.units    = STRWIN_UNITS2;
+  request.var2.h1       = farselgec;
+  request.var2.h1arg    = maxWind;
+  request.var2.h2       = farnum2;
+  request.var2.h3       = farmax;
+   
+  eca1(&request);
+  cdoFinish();
+  
+  return (0);
+}
diff --git a/src/Echam5ini.c b/src/Echam5ini.c
new file mode 100644
index 0000000..6d23869
--- /dev/null
+++ b/src/Echam5ini.c
@@ -0,0 +1,1628 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <time.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#if  defined  (HAVE_LIBNETCDF)
+#  include "netcdf.h"
+#endif
+
+static int nvars_ml = 4;
+static const char strfiletype_ml[]  = "Initial file spectral";
+static const char strfiletype_res[] = "Restart history file";
+
+
+typedef struct {
+  int  gridtype;
+  int  zaxistype;
+  int  code;
+  char *name;
+  char *longname;
+  char *units;
+  int gridID;
+  int zaxisID;
+  int gridsize;
+  int nlev;
+  double *ptr;
+} VAR;
+
+
+typedef struct {
+  int    naint;
+  int    naflt;
+  int    natxt;
+  char   *aintname[1024];
+  int    *aintentry[1024];
+  char   *afltname[1024];
+  double *afltentry[1024];
+  char   *atxtname[1024];
+  char   *atxtentry[1024];
+} ATTS;
+
+static
+void iniatts(ATTS *atts)
+{
+  atts->naint = 0;
+  atts->naflt = 0;
+  atts->natxt = 0;
+}
+
+static
+void inivar(VAR *var, int gridtype, int zaxistype, int code, const char *name,
+	       const char *longname, const char *units)
+{  
+  var->gridtype  = gridtype;
+  var->zaxistype = zaxistype;
+  var->code      = code;
+  var->name      = NULL;
+  var->longname  = NULL;
+  var->units     = NULL;
+  if ( name )     var->name      = strdup(name);
+  if ( longname ) var->longname  = strdup(longname);
+  if ( units )    var->units     = strdup(units);
+}
+
+static
+void inivars_ml(VAR **vars)
+{
+  *vars = (VAR *) malloc((nvars_ml+1)*sizeof(VAR));
+
+  inivar(&(*vars)[0], GRID_GAUSSIAN, ZAXIS_HYBRID,  133, "Q",   "specific humidity", "kg/kg");
+  inivar(&(*vars)[1], GRID_SPECTRAL, ZAXIS_HYBRID,  138, "SVO", "vorticity", "1/s");
+  inivar(&(*vars)[2], GRID_SPECTRAL, ZAXIS_HYBRID,  155, "SD",  "divergence", "1/s");
+  inivar(&(*vars)[3], GRID_SPECTRAL, ZAXIS_HYBRID,  130, "STP", "temperature", "K");
+  /* Don't change the order (lsp must be the last one)! */
+  inivar(&(*vars)[4], GRID_SPECTRAL, ZAXIS_SURFACE, 152, "LSP", "log surface pressure", "");
+}
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void nce(int istat)
+{
+  /*
+    This routine provides a simple interface to netCDF error message routine.
+  */
+
+  if ( istat != NC_NOERR ) cdoAbort(nc_strerror(istat));
+}
+#endif
+
+static
+int import_e5ml(const char *filename, VAR **vars)
+{
+  int nvars = 0;
+#if  defined  (HAVE_LIBNETCDF)
+  int nc_dim_id, nc_var_id;
+  size_t dimlen, nvals;
+  size_t start[3];
+  size_t count[3];
+  int nlon, nlat, nlev, nlevp1, nvct, nsp, i, iv;
+  int gridIDgp, gridIDsp, zaxisIDml, zaxisIDsfc;
+  int gridtype, zaxistype;
+  int nc_file_id;
+  char filetype[256];
+  size_t attlen;
+  double *xvals, *yvals, *vct, *levs;
+
+  /* open file and check file type */
+  /* nce(nc_open(filename, NC_NOWRITE, &nc_file_id)); */
+  nc_file_id = cdf_openread(filename);
+
+  nce(nc_get_att_text(nc_file_id, NC_GLOBAL, "file_type", filetype));
+  nce(nc_inq_attlen(nc_file_id, NC_GLOBAL, "file_type", &attlen));
+  filetype[attlen] = 0;
+
+  if ( strcmp(filetype, strfiletype_ml) != 0 ) return (0);
+
+  inivars_ml(vars);
+
+  /* read dimensions */
+
+  nce(nc_inq_dimid(nc_file_id, "lon", &nc_dim_id));
+  nce(nc_inq_dimlen(nc_file_id, nc_dim_id, &dimlen));
+  nlon = (int) dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "lat", &nc_dim_id));
+  nce(nc_inq_dimlen(nc_file_id, nc_dim_id, &dimlen));
+  nlat = (int) dimlen;
+
+  gridIDgp = gridCreate(GRID_GAUSSIAN, nlon*nlat);
+  gridDefXsize(gridIDgp, nlon);
+  gridDefYsize(gridIDgp, nlat);
+
+  nce(nc_inq_dimid(nc_file_id, "nsp", &nc_dim_id));
+  nce(nc_inq_dimlen(nc_file_id, nc_dim_id, &dimlen));
+  nsp = (int) dimlen;
+
+  gridIDsp = gridCreate(GRID_SPECTRAL, nsp*2);
+  gridDefComplexPacking(gridIDsp, 1);
+
+  nce(nc_inq_dimid(nc_file_id, "nlev", &nc_dim_id));
+  nce(nc_inq_dimlen(nc_file_id, nc_dim_id, &dimlen));
+  nlev = (int) dimlen;
+  nlevp1 = nlev + 1;
+  nvct = nlevp1*2;
+
+  zaxisIDsfc = zaxisCreate(ZAXIS_SURFACE, 1);
+  zaxisIDml  = zaxisCreate(ZAXIS_HYBRID, nlev);
+
+  levs = (double *) malloc(nlev*sizeof(double));
+  for ( i = 0; i < nlev; i++ ) levs[i] = i+1;
+  zaxisDefLevels(zaxisIDml, levs);
+  free(levs);
+
+  /* read variables */
+
+  xvals = (double *) malloc(nlon*sizeof(double));
+  yvals = (double *) malloc(nlat*sizeof(double));
+
+  nce(nc_inq_varid(nc_file_id, "lon", &nc_var_id));
+  nce(nc_get_var_double(nc_file_id, nc_var_id, xvals));
+
+  nce(nc_inq_varid(nc_file_id, "lat", &nc_var_id));
+  nce(nc_get_var_double(nc_file_id, nc_var_id, yvals));
+
+  gridDefXvals(gridIDgp, xvals);
+  gridDefYvals(gridIDgp, yvals);
+
+  free(xvals);
+  free(yvals);
+
+  vct   = (double *) malloc(nvct*sizeof(double));
+
+  nce(nc_inq_varid(nc_file_id, "vct_a", &nc_var_id));
+  nce(nc_get_var_double(nc_file_id, nc_var_id, vct));
+
+  nce(nc_inq_varid(nc_file_id, "vct_b", &nc_var_id));
+  nce(nc_get_var_double(nc_file_id, nc_var_id, vct+nlevp1));
+
+  zaxisDefVct(zaxisIDml, 2*nlevp1, vct);
+  free(vct);
+
+  for ( iv = 0; iv < nvars_ml; iv++ )
+    {
+      nvals = 0;
+
+      gridtype  = (*vars)[iv].gridtype;
+      zaxistype = (*vars)[iv].zaxistype;
+
+      if ( gridtype == GRID_GAUSSIAN )
+	{
+	  (*vars)[iv].gridID = gridIDgp;
+	  nvals += nlon*nlat;
+	}
+      else
+	{
+	  (*vars)[iv].gridID = gridIDsp;
+	  nvals += nsp*2;
+	}
+
+      (*vars)[iv].zaxisID   = zaxisIDml;
+      (*vars)[iv].gridsize  = nvals;
+      (*vars)[iv].nlev      = nlev;
+
+      (*vars)[iv].ptr = (double *) malloc(nlev*nvals*sizeof(double));
+      
+      for ( i = 0; i < nlev; i++ )
+	{
+	  if ( gridtype == GRID_GAUSSIAN )
+	    {
+	      start[0] = 0;     start[1] = i;  start[2] = 0;
+	      count[0] = nlat;  count[1] = 1;  count[2] = nlon;     
+	    }
+	  else
+	    {
+	      start[0] = 0;     start[1] = 0;  start[2] = i;
+	      count[0] = nsp;   count[1] = 2;  count[2] = 1;
+	    }
+
+	  nce(nc_inq_varid(nc_file_id, (*vars)[iv].name, &nc_var_id));
+	  nce(nc_get_vara_double(nc_file_id, nc_var_id, start, count, (*vars)[iv].ptr+i*nvals));
+	}
+    }
+
+  /* read lsp */
+
+  (*vars)[nvars_ml].gridID    = gridIDsp;
+  (*vars)[nvars_ml].zaxisID   = zaxisIDsfc;
+  (*vars)[nvars_ml].gridsize  = nsp*2;
+  (*vars)[nvars_ml].nlev      = 1;
+
+  start[0] = 0;    start[1] = 0;  start[2] = nlev;
+  count[0] = nsp;  count[1] = 2;  count[2] = 1;
+
+  (*vars)[nvars_ml].ptr = (double *) malloc(nsp*2*sizeof(double));
+
+  nce(nc_inq_varid(nc_file_id, "STP", &nc_var_id));
+  nce(nc_get_vara_double(nc_file_id, nc_var_id, start, count, (*vars)[nvars_ml].ptr));
+
+  /*close input file */
+  nce(nc_close(nc_file_id));
+
+  nvars = nvars_ml + 1;
+
+#else
+  cdoAbort("netCDF support not compiled in!");
+#endif
+
+  return (nvars);
+}
+
+static
+void export_e5ml(const char *filename, VAR *vars, int nvars, int vdate, int vtime, int ntr)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int nc_var_id;
+  size_t nvals;
+  size_t start[3], count[3];
+  int dimidsp[9];
+  int varid, code;
+  int ilev;
+  int lon, lat;
+  int nlon, nlat, nlev, nlevp1, nvct, nsp, n2, i, nvclev;
+  int lat_dimid, lon_dimid, nlev_dimid, nlevp1_dimid, nsp_dimid, nvclev_dimid, n2_dimid;
+  int gridIDgp = -1, gridIDsp, zaxisIDml = -1;
+  int gridtype, zaxistype;
+  int nc_file_id;
+  int nc_stpid, lspid;
+  double *xvals, *yvals;
+  const double *vct;
+  char atttext[1024];
+  size_t attlen;
+  int attint;
+  char *username;
+  char timestr[30];
+  time_t date_and_time_in_sec;
+  struct tm *date_and_time;
+  int writemode = NC_CLOBBER;
+  unsigned long  data_size;
+  
+  date_and_time_in_sec = time(NULL);
+  timestr[0] = 0;
+
+  if ( date_and_time_in_sec != -1 )
+    {
+      date_and_time = localtime(&date_and_time_in_sec);
+      (void) strftime(timestr, sizeof(timestr), "%d/%m/%Y %H:%M", date_and_time);
+    }
+
+  username = getenv("LOGNAME");
+  if ( username == NULL )
+    {
+      username = getenv("USER");
+      if ( username == NULL ) username = "unknown";
+    }
+
+
+  n2 = 2;
+
+  lon = 0; lat = 0; nsp = 0; nlev = 0; nlevp1 = 0; nvclev = 0;
+  for ( varid = 0; varid < nvars; ++varid )
+    {
+      gridtype  = vars[varid].gridtype;
+      zaxistype = vars[varid].zaxistype;
+
+      if ( gridtype == GRID_GAUSSIAN && lat == 0 )
+	{
+	  gridIDgp = vars[varid].gridID;
+	  lon = gridInqXsize(vars[varid].gridID);
+	  lat = gridInqYsize(vars[varid].gridID);
+	}
+      else if ( gridtype == GRID_SPECTRAL && nsp == 0 )
+	{
+	  gridIDsp = vars[varid].gridID;
+	  nsp = gridInqSize(vars[varid].gridID);
+	  nsp = nsp/2;
+	}
+
+      if ( zaxistype == ZAXIS_HYBRID && nlev == 0 )
+	{
+	  zaxisIDml = vars[varid].zaxisID;
+	  nlev = zaxisInqSize(vars[varid].zaxisID);
+	  nlevp1 = nlev + 1;
+	  nvclev = nlev + 1;
+	}
+    }
+
+  if ( lat  == 0 ) cdoAbort("Gaussian grid not found!");
+  if ( nsp  == 0 ) cdoAbort("Spectral data not found!");
+  if ( nlev == 0 ) cdoAbort("Hybrid level not found!");
+
+  nlon = lon;
+  nlat = lat;
+
+
+  data_size = nlon+nlat + 2*nvclev + 2*nsp*2*nlev + nsp*2*nlevp1 + nlon*nlat*nlev;
+
+  if ( data_size*8 > 2147000000 )
+    {
+#if  defined  (NC_64BIT_OFFSET)
+      writemode = NC_CLOBBER | NC_64BIT_OFFSET;
+#else
+      cdoWarning("Datasize > 2GB and NC_64BIT_OFFSET not available!");
+#endif
+    }
+
+  /* create file */
+  nce(nc_create(filename, writemode, &nc_file_id));
+
+  strcpy(atttext, "IEEE");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "source_type", attlen, atttext));
+
+  strcpy(atttext, commandLine());
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "history", attlen, atttext));
+
+  strcpy(atttext, username);
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "user", attlen, atttext));
+
+  strcpy(atttext, timestr);
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "created", attlen, atttext));
+
+  strcpy(atttext, "");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "label_1", attlen, atttext));
+
+  strcpy(atttext, "");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "label_2", attlen, atttext));
+
+  strcpy(atttext, "");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "label_3", attlen, atttext));
+
+  strcpy(atttext, "");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "label_4", attlen, atttext));
+
+  strcpy(atttext, "");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "label_5", attlen, atttext));
+
+  strcpy(atttext, "");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "label_6", attlen, atttext));
+
+  strcpy(atttext, "");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "label_7", attlen, atttext));
+
+  strcpy(atttext, "");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "label_8", attlen, atttext));
+
+  nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "fdate", NC_INT, 1, &vdate));
+  nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "ftime", NC_INT, 1, &vtime));
+
+  nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "vdate", NC_INT, 1, &vdate));
+  nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "vtime", NC_INT, 1, &vtime));
+
+  attint = 31;
+  nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "spherical_truncation_n", NC_INT, 1, &ntr));
+  nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "spherical_truncation_m", NC_INT, 1, &ntr));
+  nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "spherical_truncation_k", NC_INT, 1, &ntr));
+
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "file_type", strlen(strfiletype_ml), strfiletype_ml));
+
+  
+  nce(nc_def_dim(nc_file_id, "lat", lat, &lat_dimid));
+
+  nce(nc_def_dim(nc_file_id, "lon", lon, &lon_dimid));
+
+  nce(nc_def_dim(nc_file_id, "nlev", nlev, &nlev_dimid));
+  nce(nc_def_dim(nc_file_id, "nlevp1", nlevp1, &nlevp1_dimid));
+
+  nce(nc_def_dim(nc_file_id, "nsp", nsp, &nsp_dimid));
+
+  nce(nc_def_dim(nc_file_id, "nvclev", nvclev, &nvclev_dimid));
+
+  nce(nc_def_dim(nc_file_id, "n2", n2, &n2_dimid));
+
+  nce(nc_enddef(nc_file_id));
+
+  /* define gaussian grid */
+
+  xvals = (double *) malloc(nlon*sizeof(double));
+  yvals = (double *) malloc(nlat*sizeof(double));
+
+  gridInqXvals(gridIDgp, xvals);
+  gridInqYvals(gridIDgp, yvals);
+
+  nce(nc_redef(nc_file_id));
+  nce(nc_def_var(nc_file_id, "lat", NC_DOUBLE, 1, &lat_dimid, &nc_var_id));
+  strcpy(atttext, "Gaussian latitude");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, nc_var_id, "long_name", attlen, atttext));
+  strcpy(atttext, "degrees_N");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, nc_var_id, "units", attlen, atttext));
+  nce(nc_enddef(nc_file_id));
+  nce(nc_put_var_double(nc_file_id, nc_var_id, yvals));
+   
+  nce(nc_redef(nc_file_id));
+  nce(nc_def_var(nc_file_id, "lon", NC_DOUBLE, 1, &lon_dimid, &nc_var_id));
+  strcpy(atttext, "longitude");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, nc_var_id, "long_name", attlen, atttext));
+  strcpy(atttext, "degrees_E");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, nc_var_id, "units", attlen, atttext));
+  nce(nc_enddef(nc_file_id));
+  nce(nc_put_var_double(nc_file_id, nc_var_id, xvals));
+
+  free(xvals);
+  free(yvals);
+
+  /* define model level */
+
+  nvct = nvclev*2;
+
+  /* vct   = (double *) malloc(nvct*sizeof(double)); */
+
+  vct = zaxisInqVctPtr(zaxisIDml);
+
+  nce(nc_redef(nc_file_id));
+  nce(nc_def_var(nc_file_id, "vct_a", NC_DOUBLE, 1, &nvclev_dimid, &nc_var_id));
+  strcpy(atttext, "vertical-coordinate parameter set A");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, nc_var_id, "long_name", attlen, atttext));
+  strcpy(atttext, "");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, nc_var_id, "units", attlen, atttext));
+  nce(nc_enddef(nc_file_id));
+  nce(nc_put_var_double(nc_file_id, nc_var_id, vct));
+
+  nce(nc_redef(nc_file_id));
+  nce(nc_def_var(nc_file_id, "vct_b", NC_DOUBLE, 1, &nvclev_dimid, &nc_var_id));
+  strcpy(atttext, "vertical-coordinate parameter set B");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, nc_var_id, "long_name", attlen, atttext));
+  strcpy(atttext, "");
+  attlen = strlen(atttext);
+  nce(nc_put_att_text(nc_file_id, nc_var_id, "units", attlen, atttext));
+  nce(nc_enddef(nc_file_id));
+  nce(nc_put_var_double(nc_file_id, nc_var_id, vct+nlevp1));
+
+  /* free(vct); */
+
+  lspid = -1;
+  nc_stpid = -1;
+
+  for ( varid = 0; varid < nvars; varid++ )
+    {
+      nvals = 0;
+
+      code      = vars[varid].code;
+      gridtype  = vars[varid].gridtype;
+      zaxistype = vars[varid].zaxistype;
+
+      ilev = zaxisInqSize(vars[varid].zaxisID);
+
+      if ( ilev == 1 )
+	{
+	  if ( code == 152 )
+	    {
+	      lspid = varid;
+	      if ( gridtype != GRID_SPECTRAL )
+		cdoAbort("%s has wrong gridtype!", vars[varid].name);
+	    }
+	  continue;
+	}
+
+      if ( nlev != ilev )
+	cdoAbort("Unexpected number of level %d!", ilev);
+
+      if ( gridtype == GRID_GAUSSIAN )
+	{
+	  nvals = nlon*nlat;
+
+	  dimidsp[0] = lat_dimid;
+	  dimidsp[1] = nlev_dimid;
+	  dimidsp[2] = lon_dimid;
+	}
+      else if ( gridtype == GRID_SPECTRAL )
+	{
+	  nvals = nsp*2;
+
+	  dimidsp[0] = nsp_dimid;
+	  dimidsp[1] = n2_dimid;
+
+	  if ( strcmp(vars[varid].name, "STP") == 0 || strcmp(vars[varid].name, "T") == 0 )
+	    dimidsp[2] = nlevp1_dimid;
+	  else
+	    dimidsp[2] = nlev_dimid;
+	}
+      else
+	cdoAbort("Unsupported grid!");
+
+      nce(nc_redef(nc_file_id));
+      nce(nc_def_var(nc_file_id, vars[varid].name, NC_DOUBLE, 3, dimidsp, &nc_var_id));
+      if ( vars[varid].longname && *vars[varid].longname)
+	nce(nc_put_att_text(nc_file_id, nc_var_id, "long_name", strlen(vars[varid].longname), vars[varid].longname));
+      if ( vars[varid].units && *vars[varid].units)
+	nce(nc_put_att_text(nc_file_id, nc_var_id, "units", strlen(vars[varid].units), vars[varid].units));
+      nce(nc_enddef(nc_file_id));
+
+      if (  dimidsp[2] == nlevp1_dimid ) nc_stpid = nc_var_id;
+
+      for ( i = 0; i < nlev; i++ )
+	{
+	  if ( gridtype == GRID_GAUSSIAN )
+	    {
+	      start[0] = 0;     start[1] = i;  start[2] = 0;
+	      count[0] = nlat;  count[1] = 1;  count[2] = nlon;     
+	    }
+	  else
+	    {
+	      start[0] = 0;     start[1] = 0;  start[2] = i;
+	      count[0] = nsp;   count[1] = 2;  count[2] = 1;
+	    }
+	  
+	  nce(nc_put_vara_double(nc_file_id, nc_var_id, start, count, vars[varid].ptr+i*nvals));
+	}
+    }
+
+  if ( lspid == -1 ) cdoAbort("LSP not found!");
+  if ( nc_stpid == -1 ) cdoAbort("STP not found!");
+
+  /* write lsp */
+  start[0] = 0;    start[1] = 0;  start[2] = nlev;
+  count[0] = nsp;  count[1] = 2;  count[2] = 1;
+
+  nce(nc_put_vara_double(nc_file_id, nc_stpid, start, count, vars[lspid].ptr));
+
+  /*close input file */
+  nce(nc_close(nc_file_id));
+
+#else
+  cdoAbort("netCDF support not compiled in!");
+#endif
+}
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void read_gg3d(int nc_file_id, const char *name, VAR *var, int gridID, int zaxisID)
+{
+  int nlev, nlat, nlon, gridsize, i;
+  int gridtype, zaxistype;
+  int nc_var_id;
+  size_t start[3], count[3];
+
+  gridtype = gridInqType(gridID);
+  zaxistype = zaxisInqType(zaxisID);
+
+  inivar(var, gridtype, zaxistype,  0, name, NULL, NULL);
+
+  nlon = gridInqXsize(gridID);
+  nlat = gridInqYsize(gridID);
+  nlev = zaxisInqSize(zaxisID);
+
+  gridsize = nlon*nlat;
+
+  var->gridID    = gridID;
+  var->zaxisID   = zaxisID;
+  var->gridsize  = gridsize;
+  var->nlev      = nlev;
+
+  var->ptr = (double *) malloc(nlev*gridsize*sizeof(double));
+  
+  for ( i = 0; i < nlev; i++ )
+    {
+      start[0] = 0;     start[1] = i;  start[2] = 0;
+      count[0] = nlat;  count[1] = 1;  count[2] = nlon;     
+
+      nce(nc_inq_varid(nc_file_id, name, &nc_var_id));
+      nce(nc_get_vara_double(nc_file_id, nc_var_id, start, count, var->ptr+i*gridsize));
+    }
+}
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void read_fc4d(int nc_file_id, const char *name, VAR *var, int gridID, int zaxisID, int nhgl, int nmp1)
+{
+  int nlev, nfc, i;
+  int gridtype, zaxistype;
+  int nc_var_id;
+  size_t start[4], count[4];
+
+  gridtype = gridInqType(gridID);
+  zaxistype = zaxisInqType(zaxisID);
+
+  inivar(var, gridtype, zaxistype,  0, name, NULL, NULL);
+
+  nfc  = gridInqSize(gridID);
+  nlev = zaxisInqSize(zaxisID);
+
+  if ( nfc != nhgl*nmp1*2 ) cdoAbort("%s: inconsistent dimension length!", __func__);
+
+  var->gridID    = gridID;
+  var->zaxisID   = zaxisID;
+  var->gridsize  = nfc;
+  var->nlev      = nlev;
+
+  var->ptr = (double *) malloc(nlev*nfc*sizeof(double));
+  
+  for ( i = 0; i < nlev; i++ )
+    {
+      start[0] = 0;     start[1] = 0;    start[2] = 0;  start[3] = i;
+      count[0] = nhgl;  count[1] = nmp1; count[2] = 2;  count[3] = 1;     
+
+      nce(nc_inq_varid(nc_file_id, name, &nc_var_id));
+      nce(nc_get_vara_double(nc_file_id, nc_var_id, start, count, var->ptr+i*nfc));
+    }
+}
+#endif
+
+static
+int import_e5res(const char *filename, VAR **vars, ATTS *atts)
+{
+  int nvars = 0;
+#if  defined  (HAVE_LIBNETCDF)
+  int nc_var_id;
+  int varid;
+  size_t nvals;
+  size_t start[3], count[3];
+  int nlon, nlat, nlev, nvct, nfc, i;
+  int gridIDgp, gridIDfc, gridIDhgl, zaxisIDml, zaxisIDmlh, zaxisIDsfc, zaxisIDbsfc, zaxisIDn2;
+  int nc_file_id;
+  char filetype[256];
+  double *xvals, *yvals, *vct, *levs;
+  int ncvarid;
+  int ndims, ngatts, unlimdimid;
+  int nvdims, nvatts;
+  int dimidsp[9];
+  int max_vars = 4096;
+  char name[CDI_MAX_NAME];
+  int lon_dimid, lat_dimid, nhgl_dimid, nlevp1_dimid, spc_dimid, nvclev_dimid;
+  int complex_dimid, nmp1_dimid, belowsurface_dimid, lev_dimid, ilev_dimid;
+  int /* surface_dimid, height2m_dimid, height10m_dimid,*/ n2_dimid;
+  int lon, lat, nhgl, nlevp1, spc, nvclev;
+  int complex, nmp1, belowsurface, lev, ilev;
+  int /* surface, height2m, height10m,*/ n2;
+  int iatt;
+  int attint;
+  double attflt;
+  size_t attlen, dimlen;
+  nc_type xtype;
+  char attname[CDI_MAX_NAME];
+  const int attstringlen = 8192; char attstring[8192];
+
+  /* open file and check file type */
+  /* nce(nc_open(filename, NC_NOWRITE, &nc_file_id)); */
+  nc_file_id = cdf_openread(filename);
+
+  nce(nc_get_att_text(nc_file_id, NC_GLOBAL, "file_type", filetype));
+  nce(nc_inq_attlen(nc_file_id, NC_GLOBAL, "file_type", &attlen));
+  filetype[attlen] = 0;
+
+  if ( memcmp(filetype, strfiletype_res, strlen(strfiletype_res)) != 0 ) return (0);
+
+  /* printf("%s\n", filetype); */
+
+  nce(nc_inq_dimid(nc_file_id, "lon", &lon_dimid));
+  nce(nc_inq_dimlen(nc_file_id, lon_dimid, &dimlen));
+  lon = dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "lat", &lat_dimid));
+  nce(nc_inq_dimlen(nc_file_id, lat_dimid, &dimlen));
+  lat = (int) dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "nhgl", &nhgl_dimid));
+  nce(nc_inq_dimlen(nc_file_id, nhgl_dimid, &dimlen));
+  nhgl = (int) dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "nlevp1", &nlevp1_dimid));
+  nce(nc_inq_dimlen(nc_file_id, nlevp1_dimid, &dimlen));
+  nlevp1 = (int) dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "spc", &spc_dimid));
+  nce(nc_inq_dimlen(nc_file_id, spc_dimid, &dimlen));
+  spc = (int) dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "nvclev", &nvclev_dimid));
+  nce(nc_inq_dimlen(nc_file_id, nvclev_dimid, &dimlen));
+  nvclev = (int) dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "complex", &complex_dimid));
+  nce(nc_inq_dimlen(nc_file_id, complex_dimid, &dimlen));
+  complex = (int) dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "nmp1", &nmp1_dimid));
+  nce(nc_inq_dimlen(nc_file_id, nmp1_dimid, &dimlen));
+  nmp1 = (int) dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "belowsurface", &belowsurface_dimid));
+  nce(nc_inq_dimlen(nc_file_id, belowsurface_dimid, &dimlen));
+  belowsurface = (int) dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "lev", &lev_dimid));
+  nce(nc_inq_dimlen(nc_file_id, lev_dimid, &dimlen));
+  lev = (int) dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "ilev", &ilev_dimid));
+  nce(nc_inq_dimlen(nc_file_id, ilev_dimid, &dimlen));
+  ilev = (int) dimlen;
+
+  /*
+  nce(nc_inq_dimid(nc_file_id, "surface", &surface_dimid));
+  nce(nc_inq_dimlen(nc_file_id, surface_dimid, &surface));
+
+  nce(nc_inq_dimid(nc_file_id, "height2m", &height2m_dimid));
+  nce(nc_inq_dimlen(nc_file_id, height2m_dimid, &height2m));
+
+  nce(nc_inq_dimid(nc_file_id, "height10m", &height10m_dimid));
+  nce(nc_inq_dimlen(nc_file_id, height10m_dimid, &height10m));
+  */
+  nce(nc_inq_dimid(nc_file_id, "n2", &n2_dimid));
+  nce(nc_inq_dimlen(nc_file_id, n2_dimid, &dimlen));
+  n2 = (int) dimlen;
+
+  /* define gaussian grid */
+
+  nlon = lon;
+  nlat = lat;
+
+  gridIDgp = gridCreate(GRID_GAUSSIAN, nlon*nlat);
+  gridDefXsize(gridIDgp, nlon);
+  gridDefYsize(gridIDgp, nlat);
+
+  xvals = (double *) malloc(nlon*sizeof(double));
+  yvals = (double *) malloc(nlat*sizeof(double));
+
+  nce(nc_inq_varid(nc_file_id, "lon", &nc_var_id));
+  nce(nc_get_var_double(nc_file_id, nc_var_id, xvals));
+
+  nce(nc_inq_varid(nc_file_id, "lat", &nc_var_id));
+  nce(nc_get_var_double(nc_file_id, nc_var_id, yvals));
+
+  gridDefXvals(gridIDgp, xvals);
+  gridDefYvals(gridIDgp, yvals);
+
+  free(xvals);
+  free(yvals);
+
+  /* define fourier grid */
+
+  nfc = nhgl*nmp1*complex;
+
+  gridIDfc = gridCreate(GRID_FOURIER, nfc);
+
+  /* define nhgl grid */
+
+  gridIDhgl = gridCreate(GRID_GENERIC, nhgl);
+
+
+  /* define surface level */
+
+  zaxisIDsfc = zaxisCreate(ZAXIS_SURFACE, 1);
+
+  /* define below surface level */
+
+  nlev = belowsurface;
+  zaxisIDbsfc = zaxisCreate(ZAXIS_DEPTH_BELOW_LAND, nlev);
+
+  levs = (double *) malloc(nlev*sizeof(double));
+  for ( i = 0; i < nlev; i++ ) levs[i] = 0;
+  zaxisDefLevels(zaxisIDbsfc, levs);
+  free(levs);
+
+
+  /* define n2 level */
+
+  nlev = n2;
+  zaxisIDn2 = zaxisCreate(ZAXIS_GENERIC, nlev);
+
+  levs = (double *) malloc(nlev*sizeof(double));
+  for ( i = 0; i < nlev; i++ ) levs[i] = 0;
+  zaxisDefLevels(zaxisIDn2, levs);
+  free(levs);
+
+  /* define model level */
+
+  nlev = lev;
+  nvct = nvclev*2;
+
+  vct   = (double *) malloc(nvct*sizeof(double));
+
+  nce(nc_inq_varid(nc_file_id, "vct_a", &nc_var_id));
+  nce(nc_get_var_double(nc_file_id, nc_var_id, vct));
+
+  nce(nc_inq_varid(nc_file_id, "vct_b", &nc_var_id));
+  nce(nc_get_var_double(nc_file_id, nc_var_id, vct+nlevp1));
+
+  /* ZAXIS_HYBRID */ 
+
+  zaxisIDml  = zaxisCreate(ZAXIS_HYBRID, nlev);
+
+  levs = (double *) malloc(nlev*sizeof(double));
+  for ( i = 0; i < nlev; i++ ) levs[i] = i+1;
+  zaxisDefLevels(zaxisIDml, levs);
+  free(levs);
+
+  zaxisDefVct(zaxisIDml, 2*nlevp1, vct);
+
+  /* ZAXIS_HYBRID_HALF */ 
+
+  zaxisIDmlh  = zaxisCreate(ZAXIS_HYBRID_HALF, nlevp1);
+
+  levs = (double *) malloc(nlevp1*sizeof(double));
+  for ( i = 0; i < nlevp1; i++ ) levs[i] = i;
+  zaxisDefLevels(zaxisIDmlh, levs);
+  free(levs);
+
+  zaxisDefVct(zaxisIDmlh, 2*nlevp1, vct);
+
+  free(vct);
+
+
+  nce(nc_inq(nc_file_id, &ndims, &nvars, &ngatts, &unlimdimid));
+
+  /* read global attributtes*/
+  for ( iatt = 0; iatt < ngatts; iatt++ )
+    {
+      nce(nc_inq_attname(nc_file_id, NC_GLOBAL, iatt, attname));
+      nce(nc_inq_atttype(nc_file_id, NC_GLOBAL, attname, &xtype));
+      nce(nc_inq_attlen(nc_file_id, NC_GLOBAL, attname, &attlen));
+
+      if ( xtype == NC_CHAR )
+	{
+	  if ( (int)attlen > attstringlen )
+	    {
+	      fprintf(stderr, "Attribute %s too large, skipped!\n", attname);
+	      continue;
+	    }
+	  nce(nc_get_att_text(nc_file_id, NC_GLOBAL, attname, attstring));
+	  attstring[attlen] = 0;
+
+	  atts->atxtname[atts->natxt]  = strdup(attname);
+	  atts->atxtentry[atts->natxt] = strdup(attstring);
+	  atts->natxt++;
+	}
+      else if ( xtype == NC_INT )
+	{
+	  if ( attlen > 1 )
+	    {
+	      fprintf(stderr, "Attribute %s too large, skipped!\n", attname);
+	      continue;
+	    }
+	  nce(nc_get_att_int(nc_file_id, NC_GLOBAL, attname, &attint));
+	}
+      else if ( xtype == NC_DOUBLE )
+	{
+	  if ( attlen > 1 )
+	    {
+	      fprintf(stderr, "Attribute %s too large, skipped!\n", attname);
+	      continue;
+	    }
+	  nce(nc_get_att_double(nc_file_id, NC_GLOBAL, attname, &attflt));
+	}
+      else
+	{
+	  fprintf(stderr, "Unsupported attribute type for %s\n", attname);
+	}
+    }
+
+  *vars = (VAR *) malloc(max_vars*sizeof(VAR));
+
+  varid = 0;
+  for ( ncvarid = 0; ncvarid < nvars; ncvarid++ )
+    {      
+      nce(nc_inq_var(nc_file_id, ncvarid, name, &xtype, &nvdims, dimidsp, &nvatts));
+
+      if ( varid >= max_vars ) cdoAbort("Too many variables (max = %d)!", max_vars);
+
+      if ( nvdims == 4 )
+	{
+	  if ( dimidsp[0] == nhgl_dimid    && dimidsp[1] == nmp1_dimid &&
+	       dimidsp[2] == complex_dimid && dimidsp[3] == lev_dimid )
+	    {
+	      read_fc4d(nc_file_id, name, &(*vars)[varid], gridIDfc, zaxisIDml, nhgl, nmp1);
+	      varid++;
+	    }
+	  else if ( dimidsp[0] == nhgl_dimid    && dimidsp[1] == nmp1_dimid &&
+	            dimidsp[2] == complex_dimid && dimidsp[3] == ilev_dimid )
+	    {
+	      read_fc4d(nc_file_id, name, &(*vars)[varid], gridIDfc, zaxisIDmlh, nhgl, nmp1);
+	      varid++;
+	    }
+	  else
+	    {
+	      fprintf(stderr, "4D structure of %s unsupported!\n", name);
+	    }
+	}
+      else if ( nvdims == 3 )
+	{
+	  if ( dimidsp[0] == lat_dimid && dimidsp[1] == lev_dimid &&
+	       dimidsp[2] == lon_dimid)
+	    {
+	      read_gg3d(nc_file_id, name, &(*vars)[varid], gridIDgp, zaxisIDml);
+	      varid++;
+	    }
+	  else if ( dimidsp[0] == lat_dimid && dimidsp[1] == ilev_dimid &&
+		    dimidsp[2] == lon_dimid)
+	    {  
+	      read_gg3d(nc_file_id, name, &(*vars)[varid], gridIDgp, zaxisIDmlh);
+	      varid++;
+	    }
+	  else if ( dimidsp[0] == lat_dimid && dimidsp[1] == belowsurface_dimid &&
+		    dimidsp[2] == lon_dimid)
+	    {
+	      read_gg3d(nc_file_id, name, &(*vars)[varid], gridIDgp, zaxisIDbsfc);
+	      varid++;
+	    }
+	  else if ( dimidsp[0] == lat_dimid && dimidsp[1] == n2_dimid &&
+		    dimidsp[2] == lon_dimid)
+	    {
+	      read_gg3d(nc_file_id, name, &(*vars)[varid], gridIDgp, zaxisIDn2);
+	      varid++;
+	    }
+	  else
+	    {
+	      fprintf(stderr, "3D structure of %s unsupported!\n", name);
+	    }
+	}
+      else if ( nvdims == 2 )
+	{
+	  if ( dimidsp[0] == lat_dimid && dimidsp[1] == lon_dimid)
+	    {
+	      nvals = nlon*nlat;
+  
+	      inivar(&(*vars)[varid], GRID_GAUSSIAN, ZAXIS_SURFACE,  0, name, NULL, NULL);
+
+	      (*vars)[varid].gridID    = gridIDgp;
+	      (*vars)[varid].zaxisID   = zaxisIDsfc;
+	      (*vars)[varid].gridsize  = nvals;
+	      (*vars)[varid].nlev      = 1;
+
+	      (*vars)[varid].ptr = (double *) malloc(nvals*sizeof(double));
+
+	      nce(nc_inq_varid(nc_file_id, name, &nc_var_id));
+	      nce(nc_get_var_double(nc_file_id, nc_var_id, (*vars)[varid].ptr));
+
+	      varid++;
+	    }
+	  else if ( dimidsp[0] == nhgl_dimid && dimidsp[1] == lev_dimid)
+	    {
+	      nvals = nhgl;
+  
+	      inivar(&(*vars)[varid], GRID_GENERIC, ZAXIS_HYBRID,  0, name, NULL, NULL);
+
+	      (*vars)[varid].gridID    = gridIDhgl;
+	      (*vars)[varid].zaxisID   = zaxisIDml;
+	      (*vars)[varid].gridsize  = nvals;
+	      (*vars)[varid].nlev      = nlev;
+
+	      (*vars)[varid].ptr = (double *) malloc(nvals*nlev*sizeof(double));
+
+	      for ( i = 0; i < nlev; i++ )
+		{
+		  start[0] = 0;      start[1] = i;
+		  count[0] = nvals;  count[1] = 1;  
+
+		  nce(nc_inq_varid(nc_file_id, name, &nc_var_id));
+		  nce(nc_get_vara_double(nc_file_id, nc_var_id, start, count, (*vars)[varid].ptr+i*nvals));
+		}
+
+	      varid++;
+	    }
+	  else
+	    {
+	      fprintf(stderr, "2D structure of %s unsupported!\n", name);
+	    }
+	}
+      else if ( nvdims == 1 )
+	{
+	  if ( dimidsp[0] == lat_dimid && strcmp(name, "lat") == 0 )
+	    {
+	    }
+	  else if ( dimidsp[0] == lon_dimid && strcmp(name, "lon") == 0 )
+	    {
+	    }
+	  else if ( dimidsp[0] == nvclev_dimid && strcmp(name, "vct_a") == 0 )
+	    {
+	    }
+	  else if ( dimidsp[0] == nvclev_dimid && strcmp(name, "vct_b") == 0 )
+	    {
+	    }
+	  else
+	    {
+	      fprintf(stderr, "1D structure of %s unsupported!\n", name);
+	    }
+	}
+      else
+	{
+	  fprintf(stderr, "structure of %s unsupported!\n", name);
+	}
+    }
+
+  /*close input file */
+  nce(nc_close(nc_file_id));
+
+  nvars = varid;
+
+#else
+  cdoAbort("netCDF support not compiled in!");
+#endif
+
+  return (nvars);
+}
+
+static
+void export_e5res(const char *filename, VAR *vars, int nvars)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int nc_var_id;
+  int varid;
+  size_t nvals;
+  size_t start[4], count[4];
+  int nlon, nlat, nlev, nvct, nfc, i;
+  int gridIDgp = -1, zaxisIDml = -1;
+  int nc_file_id;
+  double *xvals, *yvals;
+  const double *vct;
+  int dimidsp[9];
+  int lon_dimid, lat_dimid, nhgl_dimid, nlevp1_dimid, spc_dimid, nvclev_dimid;
+  int complex_dimid, nmp1_dimid, belowsurface_dimid, lev_dimid, ilev_dimid;
+  int /* surface_dimid, height2m_dimid, height10m_dimid,*/ n2_dimid;
+  int lon = 0, lat = 0, nhgl = 0, nlevp1 = 0, spc = 0, nvclev = 0;
+  int complex, nmp1, belowsurface, lev = 0, ilev = 0;
+  int /* surface, height2m, height10m,*/ n2;
+  int gridtype, zaxistype;
+
+  /* create file */
+  nce(nc_create(filename, NC_CLOBBER, &nc_file_id));
+
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "file_type", strlen(strfiletype_res), strfiletype_res));
+
+  n2 = 2;
+  complex = 2;
+
+  lon = 0; lat = 0; nfc = 0; lev = 0; belowsurface = 0;
+  for ( varid = 0; varid < nvars; ++varid )
+    {
+      gridtype  = vars[varid].gridtype;
+      zaxistype = vars[varid].zaxistype;
+
+      if ( gridtype == GRID_GAUSSIAN && lat == 0 )
+	{
+	  gridIDgp = vars[varid].gridID;
+	  lon = gridInqXsize(vars[varid].gridID);
+	  lat = gridInqYsize(vars[varid].gridID);
+	  nhgl = lat/2;
+	}
+      else if ( gridtype == GRID_FOURIER && nfc == 0 )
+	{
+	  nfc = gridInqSize(vars[varid].gridID);
+	}
+
+      if ( zaxistype == ZAXIS_HYBRID && lev == 0 )
+	{
+	  zaxisIDml = vars[varid].zaxisID;
+	  lev = zaxisInqSize(vars[varid].zaxisID);
+	  nlevp1 = lev + 1;
+	  ilev = lev + 1;
+	  nvclev = ilev;
+	}
+      else if ( zaxistype == ZAXIS_DEPTH_BELOW_LAND && belowsurface == 0 )
+	{
+	  belowsurface = zaxisInqSize(vars[varid].zaxisID);
+	}
+    }
+
+  if ( lat == 0 ) cdoAbort("Gaussian grid not found!");
+  if ( nfc == 0 ) cdoAbort("Fourier data not found!");
+  if ( lev == 0 ) cdoAbort("Hybrid level not found!");
+
+  nmp1 = (nfc/nhgl)/2;
+  spc  = nmp1*(nmp1+1)/2;
+
+  nlon = lon;
+  nlat = lat;
+  nlev = lev;
+  
+  nce(nc_def_dim(nc_file_id, "lon", lon, &lon_dimid));
+
+  nce(nc_def_dim(nc_file_id, "lat", lat, &lat_dimid));
+
+  nce(nc_def_dim(nc_file_id, "nhgl", nhgl, &nhgl_dimid));
+
+  nce(nc_def_dim(nc_file_id, "nlevp1", nlevp1, &nlevp1_dimid));
+
+  nce(nc_def_dim(nc_file_id, "spc", spc, &spc_dimid));
+
+  nce(nc_def_dim(nc_file_id, "nvclev", nvclev, &nvclev_dimid));
+
+  nce(nc_def_dim(nc_file_id, "complex", complex, &complex_dimid));
+
+  nce(nc_def_dim(nc_file_id, "nmp1", nmp1, &nmp1_dimid));
+
+  nce(nc_def_dim(nc_file_id, "belowsurface", belowsurface, &belowsurface_dimid));
+
+  nce(nc_def_dim(nc_file_id, "lev", lev, &lev_dimid));
+
+  nce(nc_def_dim(nc_file_id, "ilev", ilev, &ilev_dimid));
+
+  /*
+  nce(nc_def_dim(nc_file_id, "surface", surface, &surface_dimid));
+
+  nce(nc_def_dim(nc_file_id, "height2m", height2m, &height2m_dimid));
+
+  nce(nc_def_dim(nc_file_id, "height10m", height10m, &height10m_dimid));
+  */
+  nce(nc_def_dim(nc_file_id, "n2", n2, &n2_dimid));
+
+  nce(nc_enddef(nc_file_id));
+
+
+  for ( varid = 0; varid < nvars; varid++ )
+    {
+      gridtype  = vars[varid].gridtype;
+      zaxistype = vars[varid].zaxistype;
+
+      if ( gridtype == GRID_FOURIER && zaxistype == ZAXIS_HYBRID )
+	{
+	  nvals = nfc;
+
+	  dimidsp[0] = nhgl_dimid;
+	  dimidsp[1] = nmp1_dimid;
+	  dimidsp[2] = complex_dimid;
+	  dimidsp[3] = lev_dimid;
+
+	  nce(nc_redef(nc_file_id));
+	  nce(nc_def_var(nc_file_id, vars[varid].name, NC_DOUBLE, 4, dimidsp, &nc_var_id));
+	  nce(nc_enddef(nc_file_id));
+
+	  for ( i = 0; i < nlev; i++ )
+	    {
+	      start[0] = 0;     start[1] = 0;    start[2] = 0;  start[3] = i;
+	      count[0] = nhgl;  count[1] = nmp1; count[2] = 2;  count[3] = 1; 
+
+	      nce(nc_put_vara_double(nc_file_id, nc_var_id, start, count, vars[varid].ptr+i*nvals));
+	    }  
+	}
+      else if ( gridtype == GRID_FOURIER && zaxistype == ZAXIS_HYBRID_HALF )
+	{
+	  nvals = nfc;
+
+	  dimidsp[0] = nhgl_dimid;
+	  dimidsp[1] = nmp1_dimid;
+	  dimidsp[2] = complex_dimid;
+	  dimidsp[3] = ilev_dimid;
+
+	  nce(nc_redef(nc_file_id));
+	  nce(nc_def_var(nc_file_id, vars[varid].name, NC_DOUBLE, 4, dimidsp, &nc_var_id));
+	  nce(nc_enddef(nc_file_id));
+
+	  for ( i = 0; i < ilev; i++ )
+	    {
+	      start[0] = 0;     start[1] = 0;    start[2] = 0;  start[3] = i;
+	      count[0] = nhgl;  count[1] = nmp1; count[2] = 2;  count[3] = 1; 
+
+	      nce(nc_put_vara_double(nc_file_id, nc_var_id, start, count, vars[varid].ptr+i*nvals));
+	    }  
+	}
+      else if ( gridtype == GRID_GAUSSIAN && zaxistype == ZAXIS_HYBRID )
+	{
+	  nvals = lat*lon;
+
+	  dimidsp[0] = lat_dimid;
+	  dimidsp[1] = lev_dimid;
+	  dimidsp[2] = lon_dimid;
+
+	  nce(nc_redef(nc_file_id));
+	  nce(nc_def_var(nc_file_id, vars[varid].name, NC_DOUBLE, 3, dimidsp, &nc_var_id));
+	  nce(nc_enddef(nc_file_id));
+
+	  for ( i = 0; i < nlev; i++ )
+	    {
+	      start[0] = 0;    start[1] = i;  start[2] = 0;
+	      count[0] = lat;  count[1] = 1;  count[2] = lon;
+
+	      nce(nc_put_vara_double(nc_file_id, nc_var_id, start, count, vars[varid].ptr+i*nvals));
+	    }  
+	}
+      else if ( gridtype == GRID_GAUSSIAN && zaxistype == ZAXIS_HYBRID_HALF )
+	{
+	  nvals = lat*lon;
+
+	  dimidsp[0] = lat_dimid;
+	  dimidsp[1] = ilev_dimid;
+	  dimidsp[2] = lon_dimid;
+
+	  nce(nc_redef(nc_file_id));
+	  nce(nc_def_var(nc_file_id, vars[varid].name, NC_DOUBLE, 3, dimidsp, &nc_var_id));
+	  nce(nc_enddef(nc_file_id));
+
+	  for ( i = 0; i < ilev; i++ )
+	    {
+	      start[0] = 0;    start[1] = i;  start[2] = 0;
+	      count[0] = lat;  count[1] = 1;  count[2] = lon;
+
+	      nce(nc_put_vara_double(nc_file_id, nc_var_id, start, count, vars[varid].ptr+i*nvals));
+	    }  
+	}
+      else if ( gridtype == GRID_GAUSSIAN && zaxistype == ZAXIS_DEPTH_BELOW_LAND )
+	{
+	  nvals = lat*lon;
+
+	  dimidsp[0] = lat_dimid;
+	  dimidsp[1] = belowsurface_dimid;
+	  dimidsp[2] = lon_dimid;
+
+	  nce(nc_redef(nc_file_id));
+	  nce(nc_def_var(nc_file_id, vars[varid].name, NC_DOUBLE, 3, dimidsp, &nc_var_id));
+	  nce(nc_enddef(nc_file_id));
+
+	  for ( i = 0; i < belowsurface; i++ )
+	    {
+	      start[0] = 0;    start[1] = i;  start[2] = 0;
+	      count[0] = lat;  count[1] = 1;  count[2] = lon;
+
+	      nce(nc_put_vara_double(nc_file_id, nc_var_id, start, count, vars[varid].ptr+i*nvals));
+	    }  
+	}
+      else if ( gridtype == GRID_GAUSSIAN && zaxistype == ZAXIS_GENERIC )
+	{
+	  nvals = lat*lon;
+
+	  dimidsp[0] = lat_dimid;
+	  dimidsp[1] = n2_dimid;
+	  dimidsp[2] = lon_dimid;
+
+	  nce(nc_redef(nc_file_id));
+	  nce(nc_def_var(nc_file_id, vars[varid].name, NC_DOUBLE, 3, dimidsp, &nc_var_id));
+	  nce(nc_enddef(nc_file_id));
+
+	  for ( i = 0; i < n2; i++ )
+	    {
+	      start[0] = 0;    start[1] = i;  start[2] = 0;
+	      count[0] = lat;  count[1] = 1;  count[2] = lon;
+
+	      nce(nc_put_vara_double(nc_file_id, nc_var_id, start, count, vars[varid].ptr+i*nvals));
+	    }  
+	}
+      else if ( gridtype == GRID_GAUSSIAN && zaxistype == ZAXIS_HYBRID_HALF )
+	{
+	  nvals = lat*lon;
+
+	  dimidsp[0] = lat_dimid;
+	  dimidsp[1] = ilev_dimid;
+	  dimidsp[2] = lon_dimid;
+
+	  nce(nc_redef(nc_file_id));
+	  nce(nc_def_var(nc_file_id, vars[varid].name, NC_DOUBLE, 3, dimidsp, &nc_var_id));
+	  nce(nc_enddef(nc_file_id));
+
+	  for ( i = 0; i < ilev; i++ )
+	    {
+	      start[0] = 0;    start[1] = i;  start[2] = 0;
+	      count[0] = lat;  count[1] = 1;  count[2] = lon;
+
+	      nce(nc_put_vara_double(nc_file_id, nc_var_id, start, count, vars[varid].ptr+i*nvals));
+	    }  
+	}
+      else if ( gridtype == GRID_GAUSSIAN && zaxistype == ZAXIS_SURFACE )
+	{
+	  dimidsp[0] = lat_dimid;
+	  dimidsp[1] = lon_dimid;
+
+	  nce(nc_redef(nc_file_id));
+	  nce(nc_def_var(nc_file_id, vars[varid].name, NC_DOUBLE, 2, dimidsp, &nc_var_id));
+	  nce(nc_enddef(nc_file_id));
+	  nce(nc_put_var_double(nc_file_id, nc_var_id, vars[varid].ptr));
+	}
+      else if ( gridtype == GRID_GENERIC && zaxistype == ZAXIS_HYBRID )
+	{
+	  nvals = nhgl;
+
+	  dimidsp[0] = nhgl_dimid;
+	  dimidsp[1] = lev_dimid;
+
+	  nce(nc_redef(nc_file_id));
+	  nce(nc_def_var(nc_file_id, vars[varid].name, NC_DOUBLE, 2, dimidsp, &nc_var_id));
+	  nce(nc_enddef(nc_file_id));
+
+	  for ( i = 0; i < nlev; i++ )
+	    {
+	      start[0] = 0;      start[1] = i;
+	      count[0] = nvals;  count[1] = 1;
+
+	      nce(nc_put_vara_double(nc_file_id, nc_var_id, start, count, vars[varid].ptr+i*nvals));
+	    }  
+	}
+      else
+	{
+	  fprintf(stderr, "structure of %s unsupported!\n", vars[varid].name);
+	}
+    }
+
+  /* define gaussian grid */
+
+  nlon = lon;
+  nlat = lat;
+
+  xvals = (double *) malloc(nlon*sizeof(double));
+  yvals = (double *) malloc(nlat*sizeof(double));
+
+  gridInqXvals(gridIDgp, xvals);
+  gridInqYvals(gridIDgp, yvals);
+
+
+  nce(nc_redef(nc_file_id));
+  nce(nc_def_var(nc_file_id, "lat", NC_DOUBLE, 1, &lat_dimid, &nc_var_id));
+  nce(nc_enddef(nc_file_id));
+  nce(nc_put_var_double(nc_file_id, nc_var_id, yvals));
+   
+  nce(nc_redef(nc_file_id));
+  nce(nc_def_var(nc_file_id, "lon", NC_DOUBLE, 1, &lon_dimid, &nc_var_id));
+  nce(nc_enddef(nc_file_id));
+  nce(nc_put_var_double(nc_file_id, nc_var_id, xvals));
+
+  free(xvals);
+  free(yvals);
+
+  /* define model level */
+
+  nlev = lev;
+  nvct = nvclev*2;
+
+  /* vct   = (double *) malloc(nvct*sizeof(double)); */
+
+  vct = zaxisInqVctPtr(zaxisIDml);
+
+  nce(nc_redef(nc_file_id));
+  nce(nc_def_var(nc_file_id, "vct_a", NC_DOUBLE, 1, &nvclev_dimid, &nc_var_id));
+  nce(nc_enddef(nc_file_id));
+  nce(nc_put_var_double(nc_file_id, nc_var_id, vct));
+
+  nce(nc_redef(nc_file_id));
+  nce(nc_def_var(nc_file_id, "vct_b", NC_DOUBLE, 1, &nvclev_dimid, &nc_var_id));
+  nce(nc_enddef(nc_file_id));
+  nce(nc_put_var_double(nc_file_id, nc_var_id, vct+nlevp1));
+
+  /* free(vct); */
+
+  /*close input file */
+  nce(nc_close(nc_file_id));
+
+#else
+  cdoAbort("netCDF support not compiled in!");
+#endif
+}
+
+
+void *Echam5ini(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int IMPORT_E5ML, IMPORT_E5RES;
+  int EXPORT_E5ML, EXPORT_E5RES;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs = 0;
+  int recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int nvars = 0;
+  int iv, nlev;
+  int gridsize, nmiss;
+  int taxisID, tsID;
+
+  cdoInitialize(argument);
+
+  IMPORT_E5ML  = cdoOperatorAdd("import_e5ml",  func_read,  0, NULL);
+  IMPORT_E5RES = cdoOperatorAdd("import_e5res", func_read,  0, NULL);
+  EXPORT_E5ML  = cdoOperatorAdd("export_e5ml",  func_write, 0, NULL);
+  EXPORT_E5RES = cdoOperatorAdd("export_e5res", func_write, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  if ( operatorID == EXPORT_E5ML && processSelf() != 0 )
+    cdoAbort("This operator can't be linked with other operators!");
+
+  if ( operfunc == func_read )
+    {
+      VAR *vars = NULL;
+      ATTS atts;
+      int iatt;
+
+      iniatts(&atts);
+
+      if ( operatorID == IMPORT_E5ML )
+	nvars = import_e5ml(cdoStreamName(0), &vars);
+      else if ( operatorID == IMPORT_E5RES )
+	nvars = import_e5res(cdoStreamName(0), &vars, &atts);
+      else
+	cdoAbort("Operator not implemented!");
+
+      if ( nvars == 0 ) cdoAbort("Unsupported file type!");
+      
+      vlistID2 = vlistCreate();
+      vlistDefNtsteps(vlistID2, 0);
+
+      for ( iv = 0; iv < nvars; iv++ )
+	{/*
+	  fprintf(stderr, "%d %s %d %d %d %d\n", iv, vars[iv].name, vars[iv].gridID, vars[iv].zaxisID, gridInqSize(vars[iv].gridID), zaxisInqSize(vars[iv].zaxisID));
+	 */
+	  varID = vlistDefVar(vlistID2, vars[iv].gridID, vars[iv].zaxisID, TSTEP_CONSTANT);
+	  if ( vars[iv].code > 0 ) vlistDefVarCode(vlistID2, varID, vars[iv].code);
+	  if ( vars[iv].name )     vlistDefVarName(vlistID2, varID, vars[iv].name);
+	  if ( vars[iv].longname ) vlistDefVarLongname(vlistID2, varID, vars[iv].longname);
+          if ( vars[iv].units )    vlistDefVarUnits(vlistID2, varID, vars[iv].units);
+	  vlistDefVarDatatype(vlistID2, varID, DATATYPE_FLT64);
+	}
+
+      for ( iatt = 0; iatt < atts.natxt; ++iatt )
+	{
+	  /* printf("%s: %s\n", atts.atxtname[iatt], atts.atxtentry[iatt]); */
+	  vlistDefAttTxt(vlistID2, CDI_GLOBAL, atts.atxtname[iatt],
+			 (int)strlen(atts.atxtentry[iatt])+1, atts.atxtentry[iatt]);
+	}
+
+      taxisID = taxisCreate(TAXIS_ABSOLUTE);
+      vlistDefTaxis(vlistID2, taxisID);
+
+      if ( cdoDefaultFileType == CDI_UNDEFID )
+	cdoDefaultFileType = FILETYPE_NC;
+
+      streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+      streamDefVlist(streamID2, vlistID2);
+
+      tsID = 0;
+      streamDefTimestep(streamID2, tsID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridsize = vars[varID].gridsize;
+	  nlev     = vars[varID].nlev;
+
+	  for ( levelID = 0; levelID < nlev; levelID++ )
+	    {
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, vars[varID].ptr+levelID*gridsize, 0);
+	    }
+	}
+
+      streamClose(streamID2);
+
+      vlistDestroy(vlistID2);
+    }
+  else if ( operfunc == func_write )
+    {
+      VAR *vars = NULL;
+      int code, gridID, zaxisID, gridtype, zaxistype, gridsize, nlev;
+      char name[CDI_MAX_NAME], longname[CDI_MAX_NAME], units[CDI_MAX_NAME];
+      int taxisID, vdate, vtime;
+      int ntr = 0;
+
+      streamID1 = streamOpenRead(cdoStreamName(0));
+
+      vlistID1 = streamInqVlist(streamID1);
+      taxisID = vlistInqTaxis(vlistID1);
+
+      nvars = vlistNvars(vlistID1);
+
+      vars = (VAR *) malloc(nvars*sizeof(VAR));
+
+      for ( varID = 0; varID < nvars; ++varID )
+	{
+	  code = vlistInqVarCode(vlistID1, varID);
+	  vlistInqVarName(vlistID1, varID, name);
+	  vlistInqVarLongname(vlistID1, varID, longname);
+	  vlistInqVarUnits(vlistID1, varID, units);
+
+	  if ( code < 0 ) code = 0;
+	  if ( strncmp(name, "var", 3) == 0 )
+	    {
+	      if ( code > 0 )
+		{
+		  if ( code == 133 )
+		    { strcpy(name, "Q"); strcpy(longname, "specific humidity"); strcpy(units, "kg/kg"); }
+		  if ( code == 138 )
+		    { strcpy(name, "SVO"); strcpy(longname, "vorticity"); strcpy(units, "1/s"); }
+		  if ( code == 155 )
+		    { strcpy(name, "SD"); strcpy(longname, "divergence"); strcpy(units, "1/s"); }
+		  if ( code == 130 )
+		    { strcpy(name, "STP"); strcpy(longname, "temperature"); strcpy(units, "K"); }
+		  if ( code == 152 )
+		    { strcpy(name, "LSP"); strcpy(longname, "log surface pressure"); }
+		}
+	    }
+	  else if ( strncmp(name, "LSP", 3) == 0 ) code = 152;
+
+	  gridID  = vlistInqVarGrid(vlistID1, varID);
+	  zaxisID = vlistInqVarZaxis(vlistID1, varID);
+
+	  gridtype  = gridInqType(gridID);
+	  zaxistype = zaxisInqType(zaxisID);
+
+	  if ( gridtype == GRID_SPECTRAL && ntr == 0 )
+	    {
+	      ntr = gridInqTrunc(gridID);
+	    }
+
+	  gridsize = gridInqSize(gridID);
+	  nlev     = zaxisInqSize(zaxisID);
+
+	  if ( zaxistype == ZAXIS_HYBRID && nlev == 1 ) zaxistype = ZAXIS_SURFACE;
+
+	  inivar(&vars[varID], gridtype, zaxistype, code, name, longname, units);
+	  
+	  vars[varID].gridID    = gridID;
+	  vars[varID].zaxisID   = zaxisID;
+	  vars[varID].gridsize  = gridsize;
+	  vars[varID].nlev      = nlev;
+
+	  vars[varID].ptr = (double *) malloc(nlev*gridsize*sizeof(double));
+	}
+
+      nrecs = streamInqTimestep(streamID1, 0);
+      vdate = taxisInqVdate(taxisID);
+      vtime = taxisInqVtime(taxisID);
+
+      if ( vdate == 0 )
+	{
+	  vdate = 19890101;
+	  vtime = 120000;
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  gridID = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+
+	  streamReadRecord(streamID1, vars[varID].ptr+levelID*gridsize, &nmiss);
+	}
+
+      streamClose(streamID1);
+
+      if ( operatorID == EXPORT_E5ML )
+	export_e5ml(cdoStreamName(1), vars, nvars, vdate, vtime, ntr);
+      else if ( operatorID == EXPORT_E5RES )
+	export_e5res(cdoStreamName(1), vars, nvars);
+      else
+	cdoAbort("Operator not implemented!");
+    }
+  else
+    {
+      cdoAbort("Internal error!");
+    }
+
+  /*
+  vlistDestroy(vlistID2);
+
+  */
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Enlarge.c b/src/Enlarge.c
new file mode 100644
index 0000000..781693c
--- /dev/null
+++ b/src/Enlarge.c
@@ -0,0 +1,160 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Enlarge    enlarge         Enlarge fields
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Enlarge(void *argument)
+{
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridID1, gridID2;
+  int i, index, ngrids;
+  int recID, nrecs;
+  int tsID, varID, levelID;
+  int taxisID1, taxisID2;
+  int nmiss;
+  int gridsize1, gridsize2;
+  int xsize1, ysize1, xsize2, ysize2;
+  int ix, iy;
+  int linfo = TRUE;
+  double missval;
+  double *array1, *array2;
+
+  cdoInitialize(argument);
+
+  operatorCheckArgc(1);
+
+  gridID2 = cdoDefineGrid(operatorArgv()[0]);
+  xsize2 = gridInqXsize(gridID2);
+  ysize2 = gridInqYsize(gridID2);
+
+  if ( cdoVerbose ) fprintf(stderr, "gridID2 %d, xsize2 %d, ysize2 %d\n", gridID2, xsize2, ysize2);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  gridsize2 = gridInqSize(gridID2);
+  if ( gridsize2 < vlistGridsizeMax(vlistID1) )
+    cdoAbort("Gridsize of input stream is greater than new gridsize!");
+
+  ngrids = vlistNgrids(vlistID1);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      vlistChangeGridIndex(vlistID2, index, gridID2);
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  array1 = (double *) malloc(gridsize2*sizeof(double));
+  array2 = (double *) malloc(gridsize2*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  missval = vlistInqVarMissval(vlistID1, varID);
+	  gridID1 = vlistInqVarGrid(vlistID1, varID);
+	  xsize1 = gridInqXsize(gridID1);
+	  ysize1 = gridInqYsize(gridID1);
+	  gridsize1 = gridInqSize(gridID1);
+
+	  if ( xsize1 == 0 ) xsize1 = 1;
+	  if ( ysize1 == 0 ) ysize1 = 1;
+
+	  /* printf("%d %d %d %d\n", xsize1, ysize1, xsize2, ysize2); */
+	  if ( xsize1 == 1 && ysize1 == ysize2 && xsize1*ysize1 == gridsize1 )
+	    {
+	      if ( linfo )
+		{
+		  cdoPrint("Enlarge zonal");
+		  linfo = FALSE;
+		}
+	      
+	      for ( iy = 0; iy < ysize2; iy++ )
+		for ( ix = 0; ix < xsize2; ix++ )
+		  array2[ix+iy*xsize2] = array1[iy];
+
+	      if ( nmiss ) nmiss *= xsize2;
+	    }
+	  else if ( ysize1 == 1 && xsize1 == xsize2 && xsize1*ysize1 == gridsize1 )
+	    {
+	      if ( linfo )
+		{
+		  cdoPrint("Enlarge meridional");
+		  linfo = FALSE;
+		}
+	      
+	      for ( iy = 0; iy < ysize2; iy++ )
+		for ( ix = 0; ix < xsize2; ix++ )
+		  array2[ix+iy*xsize2] = array1[ix];
+
+	      if ( nmiss ) nmiss *= ysize2;
+	    }
+	  else
+	    {
+	      memcpy(array2, array1, gridsize1*sizeof(double));
+	      for ( i = gridsize1; i < gridsize2; i++ )
+		{
+		  array2[i] = array1[gridsize1-1];
+		}
+
+	      if ( nmiss && DBL_IS_EQUAL(array1[gridsize1-1], missval) ) nmiss += (gridsize2 - gridsize1);
+	    }
+	    
+	  streamDefRecord(streamID2, varID,  levelID);
+	  streamWriteRecord(streamID2, array2, nmiss);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Enlargegrid.c b/src/Enlargegrid.c
new file mode 100644
index 0000000..7d6b303
--- /dev/null
+++ b/src/Enlargegrid.c
@@ -0,0 +1,271 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+static
+void gen_index(int gridID1, int gridID2, int *index)
+{
+  int nlat1, nlon1;
+  int nlat2, nlon2;
+  int gridtype1, gridtype2;
+  int gridsize2;
+  int i, j, k, i1, i2;
+  int *xindex = NULL, *yindex = NULL;
+  double *xvals1 = NULL, *yvals1 = NULL;
+  double *xvals2 = NULL, *yvals2 = NULL;
+
+  gridtype1 = gridInqType(gridID1);
+  gridtype2 = gridInqType(gridID2);
+
+  gridsize2 = gridInqSize(gridID2);
+
+  if ( gridtype1 != gridtype2 )
+    cdoAbort("Input streams have different grid types!");
+
+  if ( index == NULL ) cdoAbort("Internal problem, index not allocated!");
+
+  for ( i = 0; i < gridsize2; i++ ) index[i] = -1;
+
+  if ( gridtype1 == GRID_LONLAT || gridtype1 == GRID_GAUSSIAN )
+    {
+      if ( gridIsRotated(gridID1) )
+	cdoAbort("Rotated grids unsupported!");
+
+      nlon1 = gridInqXsize(gridID1);
+      nlat1 = gridInqYsize(gridID1);
+
+      nlon2 = gridInqXsize(gridID2);
+      nlat2 = gridInqYsize(gridID2);
+
+      if ( ! (gridInqXvals(gridID1, NULL) && gridInqYvals(gridID1, NULL)) )
+	cdoAbort("Grid 1 has no values!");
+
+      if ( ! (gridInqXvals(gridID2, NULL) && gridInqYvals(gridID2, NULL)) )
+	cdoAbort("Grid 2 has no values!");
+
+      xvals1 = (double *) malloc(nlon1*sizeof(double));
+      yvals1 = (double *) malloc(nlat1*sizeof(double));
+      xvals2 = (double *) malloc(nlon2*sizeof(double));
+      yvals2 = (double *) malloc(nlat2*sizeof(double));
+
+      xindex = (int *) malloc(nlon2*sizeof(int));
+      yindex = (int *) malloc(nlat2*sizeof(int));
+
+      gridInqXvals(gridID1, xvals1);
+      gridInqYvals(gridID1, yvals1);
+
+      /* Convert lat/lon units if required */
+      {
+	char units[CDI_MAX_NAME];
+	gridInqXunits(gridID1, units);
+	gridToDegree(units, "grid1 center lon", nlon1, xvals1);
+	gridInqYunits(gridID1, units);
+	gridToDegree(units, "grid1 center lat", nlat1, yvals1);
+      }
+
+      gridInqXvals(gridID2, xvals2);
+      gridInqYvals(gridID2, yvals2);
+
+      /* Convert lat/lon units if required */
+      {
+	char units[CDI_MAX_NAME];
+	gridInqXunits(gridID2, units);
+	gridToDegree(units, "grid2 center lon", nlon2, xvals2);
+	gridInqYunits(gridID2, units);
+	gridToDegree(units, "grid2 center lat", nlat2, yvals2);
+      }
+
+      for ( i2 = 0; i2 < nlat2; i2++ )
+	{
+	  for ( i1 = 0; i1 < nlat1; i1++ )
+	    if ( fabs(yvals2[i2]-yvals1[i1]) < 0.001 ) break;
+
+	  if ( i1 == nlat1 )
+	    yindex[i2] = -1;
+	  else
+            yindex[i2] = i1;
+	}
+
+      for ( i2 = 0; i2 < nlon2; i2++ )
+	{
+	  for ( i1 = 0; i1 < nlon1; i1++ )
+	    if ( fabs(xvals2[i2]-xvals1[i1]) < 0.001 ) break;
+
+	  if ( i1 == nlon1 )
+	    {
+	      if ( xvals2[i2] < 0 )
+		{
+		  for ( i1 = 0; i1 < nlon1; i1++ )
+		    if ( fabs(xvals2[i2]+360-xvals1[i1]) < 0.001 ) break;
+		}
+	      else if ( xvals2[i2] > 180 )
+		{
+		  for ( i1 = 0; i1 < nlon1; i1++ )
+		    if ( fabs(xvals2[i2]-360-xvals1[i1]) < 0.001 ) break;
+		}
+	    }
+
+	  if ( i1 == nlon1 )
+	    xindex[i2] = -1;
+	  else
+            xindex[i2] = i1;
+	}
+      /*
+      for ( i2 = 0; i2 < nlon2; i2++ )
+	printf("x %d %d\n", i2, xindex[i2]);
+
+      for ( i2 = 0; i2 < nlat2; i2++ )
+	printf("y %d %d\n", i2, yindex[i2]);
+      */
+      k = 0;
+      for ( j = 0; j < nlat2; j++ )
+	for ( i = 0; i < nlon2; i++ )
+	  {
+	    if ( xindex[i] == -1 || yindex[j] == -1 )
+	      index[k++] = -1;
+	    else
+	      index[k++] = yindex[j]*nlon1 + xindex[i];
+	  }
+
+
+      free(xindex);
+      free(yindex);
+      free(xvals1);
+      free(yvals1);
+      free(xvals2);
+      free(yvals2);
+    }
+  else
+    cdoAbort("Unsupported grid type: %s", gridNamePtr(gridtype1));
+}
+
+
+void *Enlargegrid(void *argument)
+{
+  int varID;
+  int nrecs = 0;
+  int tsID, recID, levelID;
+  int streamID1, streamID2;
+  int vlistID1 , vlistID2;
+  int nmiss1, nmiss2;
+  int gridsize1, gridsize2;
+  int gridID1, gridID2;
+  int taxisID1, taxisID2;
+  int index;
+  int i, *gindex = NULL;
+  int ndiffgrids, ngrids;
+  double missval1;
+  double *array1, *array2;
+
+  cdoInitialize(argument);
+
+  operatorInputArg("grid description file or name");
+  if ( operatorArgc() < 1 ) cdoAbort("Too few arguments!");
+  if ( operatorArgc() > 2 ) cdoAbort("Too many arguments!");
+
+  gridID2 = cdoDefineGrid(operatorArgv()[0]);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+
+  ndiffgrids = 0;
+  for ( index = 1; index < vlistNgrids(vlistID1); index++ )
+    if ( vlistGrid(vlistID1, 0) != vlistGrid(vlistID1, index) )
+      ndiffgrids++;
+
+  if ( ndiffgrids > 0 ) cdoAbort("Too many different grids in %s!", cdoStreamName(0));
+
+  gridID1 = vlistGrid(vlistID1, 0);
+
+  gridsize1 = gridInqSize(gridID1);
+  gridsize2 = gridInqSize(gridID2);
+
+  array1 = (double *) malloc(gridsize1*sizeof(double));
+  array2 = (double *) malloc(gridsize2*sizeof(double));
+  gindex = (int *) malloc(gridsize1*sizeof(int));
+
+  gen_index(gridID2, gridID1, gindex);
+
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  ngrids = vlistNgrids(vlistID1);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      vlistChangeGridIndex(vlistID2, index, gridID2);
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  vlistDefTaxis(vlistID2, taxisID2);
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss1);
+
+	  missval1 = vlistInqVarMissval(vlistID1, varID);
+
+	  for ( i = 0; i < gridsize2; i++ ) array2[i] = missval1;
+	  for ( i = 0; i < gridsize1; i++ )
+	    if ( gindex[i] >= 0 )
+	      array2[gindex[i]] = array1[i];		
+
+	  nmiss2 = 0;
+	  for ( i = 0; i < gridsize2; i++ )
+	    if ( DBL_IS_EQUAL(array2[i], missval1) ) nmiss2++;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array2, nmiss2);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+ 
+  if ( gindex ) free(gindex);
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Ensstat.c b/src/Ensstat.c
new file mode 100644
index 0000000..44fa0ee
--- /dev/null
+++ b/src/Ensstat.c
@@ -0,0 +1,274 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Ensstat    ensmin          Ensemble minimum
+      Ensstat    ensmax          Ensemble maximum
+      Ensstat    enssum          Ensemble sum
+      Ensstat    ensmean         Ensemble mean
+      Ensstat    ensavg          Ensemble average
+      Ensstat    ensstd          Ensemble standard deviation
+      Ensstat    ensvar          Ensemble variance
+      Ensstat    enspctl         Ensemble percentiles
+
+      Ensstat    enscrps         Ensemble cumulative ranked probability score
+      Ensstat    ensbrs          Ensemble brier score
+*/
+
+#if defined (_OPENMP)
+#  include <omp.h>
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+
+void *Ensstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int i;
+  int varID, recID;
+  int gridsize = 0;
+  int gridID;
+  int nrecs, nrecs0;
+  int levelID;
+  int tsID;
+  int streamID = 0, streamID2;
+  int vlistID, vlistID1, vlistID2;
+  int nmiss;
+  int taxisID1, taxisID2;
+  int ompthID;
+  double missval;
+  double *array2 = NULL;
+  field_t *field;
+  int fileID, nfiles;
+  const char *ofilename;
+  typedef struct
+  {
+    int streamID;
+    int vlistID;
+    double *array;
+  } ens_file_t;
+  ens_file_t *ef = NULL;
+  /* RQ */
+  int pn = 0;
+  /* QR */
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("ensmin",  func_min,  0, NULL);
+  cdoOperatorAdd("ensmax",  func_max,  0, NULL);
+  cdoOperatorAdd("enssum",  func_sum,  0, NULL);
+  cdoOperatorAdd("ensmean", func_mean, 0, NULL);
+  cdoOperatorAdd("ensavg",  func_avg,  0, NULL);
+  cdoOperatorAdd("ensvar",  func_var,  0, NULL);
+  cdoOperatorAdd("ensstd",  func_std,  0, NULL);
+  /* RQ */
+  cdoOperatorAdd("enspctl", func_pctl, 0, NULL);
+  /* QR */
+
+  /* >>> Cedrick Ansorge 18.10.2010 */
+  cdoOperatorAdd("enscrps", func_crps, 0, NULL);
+  cdoOperatorAdd("ensbrs",  func_brs,  0, NULL);
+  /* <<< Cedrick Ansorge 18.10.2010 */
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  /* RQ */
+  if ( operfunc == func_pctl )
+    {
+      operatorInputArg("percentile number");
+      pn = atoi(operatorArgv()[0]);
+      
+      if ( pn < 1 || pn > 99 )
+        cdoAbort("Illegal argument: percentile number %d is not in the range 1..99!", pn);
+    }
+  /* QR */
+    
+  nfiles = cdoStreamCnt() - 1;
+
+  if ( cdoVerbose )
+    cdoPrint("Ensemble over %d files.", nfiles);
+
+  ofilename = cdoStreamName(nfiles);
+
+  if ( !cdoSilentMode && !cdoOverwriteMode )
+    if ( fileExists(ofilename) )
+      if ( !userFileOverwrite(ofilename) )
+	cdoAbort("Outputfile %s already exists!", ofilename);
+
+  ef = (ens_file_t *) malloc(nfiles*sizeof(ens_file_t));
+
+  field = (field_t *) malloc(ompNumThreads*sizeof(field_t));
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      field[i].size   = nfiles;
+      field[i].ptr    = (double *) malloc(nfiles*sizeof(double));
+      field[i].weight = (double *) malloc(nfiles*sizeof(double));
+      for ( fileID = 0; fileID < nfiles; fileID++ )
+	field[i].weight[fileID] = 1;
+    }
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      streamID = streamOpenRead(cdoStreamName(fileID));
+
+      vlistID = streamInqVlist(streamID);
+
+      ef[fileID].streamID = streamID;
+      ef[fileID].vlistID = vlistID;
+    }
+
+  /* check that the contents is always the same */
+  for ( fileID = 1; fileID < nfiles; fileID++ )
+    vlistCompare(ef[0].vlistID, ef[fileID].vlistID, CMP_ALL);
+
+  vlistID1 = ef[0].vlistID;
+  vlistID2 = vlistDuplicate(vlistID1);
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(ofilename, cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+	  
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    ef[fileID].array = (double *) malloc(gridsize*sizeof(double));
+
+  array2 = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  do
+    {
+      nrecs0 = streamInqTimestep(ef[0].streamID, tsID);
+      for ( fileID = 1; fileID < nfiles; fileID++ )
+	{
+	  streamID = ef[fileID].streamID;
+	  nrecs = streamInqTimestep(streamID, tsID);
+	  if ( nrecs != nrecs0 )
+	    {
+	      if ( nrecs == 0 )
+		cdoAbort("Inconsistent ensemble file, too few time steps in %s!", cdoStreamName(fileID));
+	      else
+		cdoAbort("Inconsistent ensemble file, number of records at time step %d of %s and %s differ!",
+			 tsID+1, cdoStreamName(0), cdoStreamName(fileID));
+	    }
+	}
+
+      if ( nrecs0 > 0 )
+	{
+	  taxisCopyTimestep(taxisID2, taxisID1);
+	  streamDefTimestep(streamID2, tsID);
+	}
+
+      for ( recID = 0; recID < nrecs0; recID++ )
+	{
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(fileID, streamID, nmiss) \
+                                     lastprivate(varID, levelID)
+#endif
+	  for ( fileID = 0; fileID < nfiles; fileID++ )
+	    {
+	      streamID = ef[fileID].streamID;
+	      streamInqRecord(streamID, &varID, &levelID);
+	      streamReadRecord(streamID, ef[fileID].array, &nmiss);
+	    }
+
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+
+	  nmiss = 0;
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, ompthID, fileID)
+#endif
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+#if defined (_OPENMP)
+	      ompthID = omp_get_thread_num();
+#else
+	      ompthID = 0;
+#endif
+	      field[ompthID].missval = missval;
+	      field[ompthID].nmiss = 0;
+	      for ( fileID = 0; fileID < nfiles; fileID++ )
+		{
+		  field[ompthID].ptr[fileID] = ef[fileID].array[i];
+		  if ( DBL_IS_EQUAL(field[ompthID].ptr[fileID], missval) )
+		    field[ompthID].nmiss++;
+		}
+
+	      /* RQ */
+	      if ( operfunc == func_pctl )
+	        array2[i] = fldpctl(field[ompthID], pn);
+	      else  
+	        array2[i] = fldfun(field[ompthID], operfunc);
+	      /* QR */
+
+	      if ( DBL_IS_EQUAL(array2[i], field[ompthID].missval) )
+		{
+#if defined (_OPENMP)
+#pragma omp atomic
+#endif
+		  nmiss++;
+		}
+	    }
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array2, nmiss);
+	}
+
+      tsID++;
+    }
+  while ( nrecs0 > 0 );
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      streamID = ef[fileID].streamID;
+      streamClose(streamID);
+    }
+
+  streamClose(streamID2);
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    if ( ef[fileID].array ) free(ef[fileID].array);
+
+  if ( ef ) free(ef);
+  if ( array2 ) free(array2);
+
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      if ( field[i].ptr    ) free(field[i].ptr);
+      if ( field[i].weight ) free(field[i].weight);
+    }
+
+  if ( field ) free(field);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Ensstat3.c b/src/Ensstat3.c
new file mode 100644
index 0000000..8ee1828
--- /dev/null
+++ b/src/Ensstat3.c
@@ -0,0 +1,527 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+   Ensstat3       ensrkhist_space  Ensemble ranked histogram averaged over time
+   Ensstat3       ensrkhist_time   Ensemble ranked histogram averaged over space
+   Ensstat3       ensroccurve      Ensamble Receiver Operating Characteristics
+*/
+
+#if defined (_OPENMP)
+#  include <omp.h>
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+// Defines for rank histogram
+enum TDATA_TYPE {TIME, SPACE};
+#define time_data TIME
+#define space_data SPACE
+
+
+// Defines for Receiver Operating Characteristics (ROC)
+#define DEBUG_ROC 0
+enum CONTINGENCY_TYPE {TP, FP, FN, TN};
+/* TP - True positive  ( event     forecast and     occured)  HIT               */
+/* FP - False positive ( event     forecast and not occured)  FALSE ALARM       */
+/* TN - True negative  ( event not forecast and not ocurred)  CORRECT REJECTION */
+/* FN - False negative ( event not forecast and     ocurred)  MISSED            */
+
+enum ROC_ENUM_TYPE {TPR, FPR};
+/* TPR = True Positive Rate = TP / ( TP + FN ) */
+/* FNR = False Negtive Rate = FN / ( FP + TN ) */
+
+double roc_curve_integrate(const double **roc, const int n);
+
+void *Ensstat3(void *argument)
+{
+  int operatorID;
+  int operfunc, datafunc;
+  int i,j;
+  int nvars,nbins, nrecs = 0, nrecs0, nmiss, nens, nfiles;;
+  int cum;
+  int chksum;                  // for check of histogram population 
+  int levelID, varID, recID, tsID, binID = 0, ensID;
+  int gridsize = 0;
+  int gridID, gridID2;
+  int have_miss = 0;
+  int streamID = 0, streamID2 = 0;
+  int vlistID, vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int zaxisID,zaxisID2;
+  int ompthID;
+  int *varID2;
+  int time_mode;
+  int **array2 = NULL;
+  int **ctg_tab = NULL, *hist = NULL;         // contingency table and histogram
+  double missval;
+  double *levs;
+  double *dat;                  // pointer to ensemble data for ROC
+  double *uThresh = NULL, *lThresh = NULL;    // thresholds for histograms
+  double **roc = NULL;                 // receiver operating characteristics table
+  double val;
+  int ival;
+  field_t *field;
+  int fileID;
+  const char *ofilename;
+
+  typedef struct
+  {
+    int streamID;
+    int vlistID;
+    double *array;
+  } ens_file_t;
+  ens_file_t *ef = NULL;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("ensroc",          func_roc,  0,          NULL);
+  cdoOperatorAdd("ensrkhist_space", func_rank, space_data, NULL);
+  cdoOperatorAdd("ensrkhist_time",  func_rank, time_data,  NULL);
+  
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+  datafunc = cdoOperatorF2(operatorID);
+
+
+  if ( operfunc == func_roc ) {
+    operatorInputArg("Number of eigen functions to write out");
+    nbins       = atoi(operatorArgv()[0]);
+  }
+  
+  nfiles = cdoStreamCnt() - 1;
+  nens = nfiles-1;
+
+  if ( cdoVerbose )
+    cdoPrint("Ensemble over %d files.", nfiles);
+
+  ofilename = cdoStreamName(nfiles);
+
+  if ( !cdoSilentMode && !cdoOverwriteMode )
+    if ( fileExists(ofilename) )
+      if ( !userFileOverwrite(ofilename) )
+	cdoAbort("Outputfile %s already exists!", ofilename);
+
+  ef = (ens_file_t *) malloc(nfiles*sizeof(ens_file_t));
+
+  /* *************************************************** */
+  /* should each thread be allocating memory locally???? */
+  /* ("first touch strategy")                            */
+  /* --> #pragma omp parallel for ...                    */
+  /* *************************************************** */
+#if defined (_OPENMP)
+  field = (field_t *) malloc(omp_get_max_threads()*sizeof(field_t));
+  for ( i = 0; i < omp_get_max_threads(); i++ )
+#else
+  field = (field_t *) malloc(1*sizeof(field_t));
+  for ( i = 0; i < 1; i++ )
+#endif
+    {
+      field[i].size   = nfiles;
+      field[i].ptr    = (double *) malloc(nfiles*sizeof(double));
+      field[i].weight = (double *) malloc(nfiles*sizeof(double));
+      for ( fileID = 0; fileID < nfiles; fileID++ )
+	field[i].weight[fileID] = 1;
+    }
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      streamID = streamOpenRead(cdoStreamName(fileID));
+
+      vlistID = streamInqVlist(streamID);
+
+      ef[fileID].streamID = streamID;
+      ef[fileID].vlistID = vlistID;
+    }
+
+  /* check for identical contents of all ensemble members */
+  for ( fileID = 1; fileID < nfiles; fileID++ )
+    vlistCompare(ef[0].vlistID, ef[fileID].vlistID, CMP_ALL);
+
+  vlistID1 = ef[0].vlistID;
+  vlistID2 = vlistCreate();
+  nvars = vlistNvars(vlistID1);
+  varID2 = (int *) malloc( nvars*sizeof(int));
+
+  levs = (double*) calloc ( nfiles, sizeof(double) );
+  zaxisID2 = zaxisCreate(ZAXIS_GENERIC, nfiles);
+  for ( i=0; i<nfiles; i++ )
+    levs[i] = i;
+  zaxisDefLevels(zaxisID2,levs);
+  zaxisDefName(zaxisID2, "histogram_binID");
+
+  time_mode = datafunc == TIME? TSTEP_INSTANT : TSTEP_CONSTANT;
+
+  for ( varID=0; varID<nvars; varID++) {
+
+    /* **************************************************************** */
+    /* nfiles includes the observation, so there are nfiles-1 ensembles */
+    /* and exactly nfiles bins, in which the observation could fall     */
+    /* **************************************************************** */
+
+    if ( datafunc == TIME ) 
+      {
+	val = 0;
+	gridID2 = gridCreate(GRID_LONLAT, 1);
+	gridDefXsize(gridID2, 1);
+	gridDefYsize(gridID2, 1);
+	gridDefXvals(gridID2, &val);
+	gridDefYvals(gridID2, &val);
+      }
+    else // datafunc == SPACE
+      gridID2 = vlistInqVarGrid(vlistID1,varID);
+
+    varID2[varID] = vlistDefVar(vlistID2, gridID2, zaxisID2, time_mode);
+  }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+  
+  for ( varID=0; varID< nvars; varID++ ){
+    if ( zaxisInqSize(vlistInqVarZaxis(vlistID1, varID)) > 1 ) {
+      cdoWarning("More than one level not supported when processing ranked histograms.");
+      cdoWarning("Try to use `cdo splitlevel` to split the dataset into levels and apply");
+      cdoWarning("the operator seperately to each level.");
+      cdoAbort("Exit due to unsupported file structure");
+    }
+  } 
+
+  if ( operfunc != func_roc ) {
+    streamID2 = streamOpenWrite(ofilename, cdoFiletype());
+
+    streamDefVlist(streamID2, vlistID2);
+  }
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    ef[fileID].array = (double *) malloc(gridsize*sizeof(double));
+
+  if ( operfunc == func_rank && datafunc == SPACE ) 
+    { /*need to memorize data for entire grid before writing          */
+      array2 = (int **) malloc((nfiles+1)*sizeof(int*));
+      for ( binID=0; binID<nfiles; binID++ ) 
+	array2[binID] = (int*) calloc ( gridsize, sizeof(int) );
+    }
+  else if ( operfunc == func_rank )
+    {  /* can process data separately for each timestep and only need */
+       /* to cumulate values over the grid                            */
+      array2    = (int**) malloc ( (nfiles+1)*sizeof(int *));
+      for ( binID=0; binID<nfiles; binID++ )
+	array2[binID] = (int *) calloc ( 1, sizeof(int) );
+    }
+
+  if ( operfunc == func_roc ) {
+    ctg_tab = (int **)    malloc ((nbins+1)*sizeof(int*) );
+    hist =    (int *)     malloc ( nbins*sizeof(int) );
+    uThresh = (double *)  malloc ( nbins*sizeof(double) );
+    lThresh = (double *)  malloc ( nbins*sizeof(double) );
+    roc     = (double **) malloc ((nbins+1)*sizeof(double*) );
+    
+    for  ( i=0; i<nbins; i++ ) {
+      ctg_tab[i] = (int *) calloc ( 4,sizeof(int) );
+      roc[i]     = (double*)calloc( 2,sizeof(double));
+      uThresh[i] = ((double)i+1)/nbins;
+      lThresh[i] = (double)i/nbins;
+    }
+    ctg_tab[nbins] = (int *)   calloc (4,sizeof(int));
+    roc[nbins]     = (double*) calloc (2,sizeof(double));
+  }
+  
+  
+  tsID = 0;
+  do
+    {
+      nrecs0 = streamInqTimestep(ef[0].streamID, tsID);
+      for ( fileID = 1; fileID < nfiles; fileID++ )
+	{
+	  streamID = ef[fileID].streamID;
+	  nrecs = streamInqTimestep(streamID, tsID);
+	  if ( nrecs != nrecs0 )
+	    {
+	      if ( nrecs == 0 )
+		cdoAbort("Inconsistent ensemble file, too few time steps in %s!", cdoStreamName(fileID));
+	      else
+		cdoAbort("Inconsistent ensemble file, number of records at time step %d of %s and %s differ!",
+			   tsID+1, cdoStreamName(0), cdoStreamName(fileID));
+	    }
+	}
+
+      if ( operfunc == func_rank && ( datafunc == TIME || tsID == 0 ) )
+	{
+	  taxisCopyTimestep(taxisID2, taxisID1);
+	  if ( nrecs0 > 0 ) streamDefTimestep(streamID2, tsID);
+	}
+
+      //      fprintf(stderr,"TIMESTEP %i varID %i rec %i\n",tsID,varID,recID);
+      
+      for ( recID = 0; recID < nrecs0; recID++ )
+	{
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(fileID, streamID, nmiss) \
+  lastprivate(binID, varID, levelID)
+#endif
+	  for ( fileID = 0; fileID < nfiles; fileID++ )
+	    {
+	      streamID = ef[fileID].streamID;
+	      streamInqRecord(streamID, &varID, &levelID);
+	      streamReadRecord(streamID, ef[fileID].array, &nmiss);
+	    }
+
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+
+	  nmiss = 0;
+	  if ( datafunc == TIME && operfunc == func_rank) 
+	    for ( binID=0;binID<nfiles;binID++ )
+	      array2[binID][0] = 0;
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, ompthID, fileID)
+#endif
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+#if defined (_OPENMP)
+	      ompthID = omp_get_thread_num();
+#else
+	      ompthID = 0;
+#endif
+	      field[ompthID].missval = missval;
+	      field[ompthID].nmiss = 0;
+	      have_miss = 0;
+	      for ( fileID = 0; fileID < nfiles; fileID++ )
+		{
+		  field[ompthID].ptr[fileID] = ef[fileID].array[i];
+		  if ( DBL_IS_EQUAL(field[ompthID].ptr[fileID], missval) ) 
+		    {
+		      have_miss = 1;
+		      break;
+		    }
+		}
+	      
+	      // need to ignore all data for a gridpoint if a single ensemble
+	      // has a missing value at that gridpoint.
+	      if ( ! have_miss )  // only process if no missing value in ensemble
+		{
+		  switch( operfunc ) 
+		    {
+		    case ( func_rank ): 
+		      /* ****************/
+		      /* RANK HISTOGRAM */
+		      /* ************** */
+		      //		      for ( j=0; j<nfiles; j++ )
+		      //			fprintf(stderr,"%5.2g ",field[ompthID].ptr[j]);
+		      //		      binID = (int) fldfun(field[ompthID], operfunc);
+		      //		      fprintf(stderr,"-->%i\n",binID);
+		      
+		      if ( datafunc == SPACE && ! have_miss) 
+			array2[binID][i]++;
+		      else if ( ! have_miss ) 
+			array2[binID][0]++;
+		      break;
+
+		    case ( func_roc ):
+		      /* ********************************** */
+		      /* RECEIVER OPERATING CHARACTERISTICS */
+		      /* ********************************** */
+		      dat = &field[ompthID].ptr[1];
+		      ival = field[ompthID].ptr[0] > 0.5? 1 : 0;
+
+		      for ( binID=0; binID<nbins; binID++ )
+			hist[binID] = 0;
+
+		      for ( j=0; j<nens; j++ ) 
+			for ( binID=0; binID<nbins; binID++ ) 
+			  if ( dat[j] >= lThresh[binID] && dat[j] < uThresh[binID] )
+			    hist[binID]++;
+
+		      chksum = 0;
+		      for ( binID=0; binID<nbins; binID++ )
+			chksum += hist[binID];
+
+		      if ( chksum != nens )  exit(1);
+
+		      cum = 0;
+		      if ( ival == 1 ) 
+			{
+			  // all true positives in first bin
+			  ctg_tab[0][TP] += nens;
+			  
+			  cum += hist[0];
+			  for ( binID=1; binID<nbins; binID++ ) 
+			    {
+			      ctg_tab[binID][TP] += nens-cum;
+			      ctg_tab[binID][FN] += cum;
+			      cum += hist[binID];
+			    }
+			  ctg_tab[binID][TP] += nens-cum;
+			  ctg_tab[binID][FN] += cum;
+			}
+		      else if ( ival == 0 ) 
+			{
+			  // all false positives in first bin
+			  ctg_tab[0][FP] += nens;
+			  cum += hist[0];
+			  for ( binID=1; binID<nbins; binID++ ) 
+			    {
+			      ctg_tab[binID][FP] += nens-cum;
+			      ctg_tab[binID][TN] += cum;
+			      cum += hist[binID];
+			    }
+			  ctg_tab[binID][FP] += nens-cum;
+			  ctg_tab[binID][TN] += cum;
+			}
+		      break;
+		      
+		    }// switch ( operfunc )
+		}    // if ( ! have_miss ) 
+	    }        // for ( i=0; i<gridsize; i++ )
+
+	  if ( datafunc == TIME && operfunc == func_rank ) 
+	    {
+	      for ( binID=0; binID<nfiles; binID++ ) {
+		val = (double)array2[binID][0];
+		//		fprintf(stderr,"%i ",(int)val);
+		streamDefRecord(streamID2, varID2[varID], binID);
+		streamWriteRecord(streamID2,&val, nmiss);
+	      }
+	      fprintf(stderr,"\n");
+	    }
+	  else if ( operfunc == func_roc ) 
+	    {
+	      if ( DEBUG_ROC ) {
+		fprintf(stderr, "#             :     TP     FP     FN     TN         TPR        FPR\n");
+		
+		for ( binID=0; binID<= nbins; binID++ )  {
+		  int p = ctg_tab[binID][TP] + ctg_tab[binID][FN];
+		  int n = ctg_tab[binID][FP] + ctg_tab[binID][TN];
+		  double tpr = ctg_tab[binID][TP]/(double) p;
+		  double fpr = ctg_tab[binID][FP]/(double) n;
+		  chksum += ctg_tab[binID][0] + ctg_tab[binID][1] + ctg_tab[binID][2] + ctg_tab[binID][3];
+		  
+		  roc[binID][TPR] = tpr;
+		  roc[binID][FPR] = fpr;
+		  
+		  fprintf(stderr, "%3i %10.4g: %6i %6i %6i %6i: %10.4g %10.4g\n",
+			  binID,binID<nbins?lThresh[binID]:1,
+			  ctg_tab[binID][0],ctg_tab[binID][1],ctg_tab[binID][2],ctg_tab[binID][3],
+			  tpr,fpr);
+		}
+		fprintf(stderr,"nbins %10i\n",nbins);
+		fprintf(stderr,"#ROC CurveArea: %10.6f\n",
+			roc_curve_integrate((const double **)roc,nbins));
+	      } // if ( DEBUG_ROC )
+	    }   // else if (operfunc == func_roc )
+	}       // for ( recID=0; recID<nrecs; recID++ )
+      tsID++;
+    }           // do [...]
+  while ( nrecs0 > 0 );
+
+
+
+  if ( operfunc == func_rank )
+    for ( binID=0; binID<nfiles; binID++ ) {
+      double *tmpdoub = (double *)malloc (gridsize*sizeof(double));
+      for(i=0; i<gridsize; i++ )
+	tmpdoub[i] = (double) array2[binID][i];
+      streamDefRecord(streamID2,varID2[varID],binID);
+      streamWriteRecord(streamID2,tmpdoub,nmiss);
+    }
+  else if ( operfunc == func_roc ) {
+    fprintf(stdout, "#             :     TP     FP     FN     TN         TPR        FPR\n");
+    
+    for ( i=0; i<= nbins; i++ )  {
+      int sum;
+      int p = ctg_tab[i][TP] + ctg_tab[i][FN];
+      int n = ctg_tab[i][FP] + ctg_tab[i][TN];
+      double tpr = ctg_tab[i][TP]/(double) p;
+      double fpr = ctg_tab[i][FP]/(double) n;
+      chksum += ctg_tab[i][0] + ctg_tab[i][1] + ctg_tab[i][2] + ctg_tab[i][3];
+      
+      roc[i][TPR] = tpr;
+      roc[i][FPR] = fpr;
+      
+      sum = ctg_tab[i][TP] + ctg_tab[i][TN] + ctg_tab[i][FP] + ctg_tab[i][FN];
+
+      fprintf(stdout, "%3i %10.4g: %6i %6i %6i %6i (%6i): %10.4g %10.4g\n",
+	      i,i<nbins?lThresh[i]:1,
+	      ctg_tab[i][0],ctg_tab[i][1],ctg_tab[i][2],ctg_tab[i][3],sum,
+	      tpr,fpr);
+    }
+ 
+    fprintf(stdout,"#ROC CurveArea: %10.6f\n",
+	    roc_curve_integrate((const double **)roc,nbins));
+  }
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      streamID = ef[fileID].streamID;
+      streamClose(streamID);
+    }
+
+  if ( operfunc != func_roc ) 
+    streamClose(streamID2);
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    if ( ef[fileID].array ) free(ef[fileID].array);
+
+  if ( ef ) free(ef);
+  if ( array2 ) {
+    for (binID=0; binID<nfiles; binID++ )
+      free(array2[binID]);
+    free(array2);
+  }
+
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      if ( field[i].ptr    ) free(field[i].ptr);
+      if ( field[i].weight ) free(field[i].weight);
+    }
+  
+  if ( field ) free(field);
+  
+  cdoFinish();
+  
+  return (0);
+}
+
+
+double roc_curve_integrate(const double **roc, const int n) {
+  double y1, y0, x1,x0, dx, dy, area;
+  double step_area;
+  int i=0;
+  area = 0;
+
+  for ( i=1; i<=n; i++ ) {
+    x1 = roc[i][FPR]; x0 = roc[i-1][FPR];
+    y1 = roc[i][TPR]; y0 = roc[i-1][TPR];
+    dx = x1-x0;
+    dy = y1-y0;
+
+    step_area = -0.5*dx*dy - dx*y0;
+    area += step_area;
+  }
+
+  return area-0.5;
+
+}
diff --git a/src/Ensval.c b/src/Ensval.c
new file mode 100644
index 0000000..a6eb3e0
--- /dev/null
+++ b/src/Ensval.c
@@ -0,0 +1,548 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+   Ensval       enscrps          Ensemble cumulative ranked probability score & decomposition
+   Ensval       ensbrs           Ensemble Brier score & decomposition 
+
+   The implementation of the decomposition and score calculation
+   as carried out in this routine follows the paper
+     Hans Hersbach (2000): Decomposition of the Continuous Ranked Probability 
+     Score for Ensemble Prediction Systems, in: Weather and Forecasting (15) 
+     pp. 559-570
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "statistic.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+#include "merge_sort2.h"
+
+enum OPERTYPE {CRPS, BRS};
+
+enum RESTYPE_BRS  { BRS_RES, BRS_RELI, BRS_RESOL, BRS_UNCTY };
+enum RESTYPE_CRPS { CRPS_RES,CRPS_RELI,CRPS_POT };
+
+void *Ensval(void *argument)
+{
+  int operatorID;
+  int operfunc, datafunc;
+  int i,k;
+  int nvars,nrecs = 0, nrecs0, nmiss, nens, nfiles,nlevs,valcount, nostreams = 0, ngrids;
+  int levelID, varID, recID, tsID;
+  int gridsize = 0;
+  int gridID = -1, gridID2;
+  int have_miss = 0;
+  int stream, streamID = 0, *streamID2;
+  int vlistID, vlistID1, *vlistID2;
+  int taxisID1, *taxisID2;
+  int zaxisID1, *zaxisID2;
+  int *varID2;
+  int xsize,ysize;
+  double missval;
+  double *alpha, *beta, *alpha_weights, *beta_weights;
+  double *brs_g, *brs_o, *brs_g_weights, *brs_o_weights;
+  double *r;                      // Pointer to hold results for single time step
+  double xval=0; double yval=0;
+  double xa, *x;
+  double *val;
+  double *weights, sum_weights = 0;
+  double crps_reli, crps_pot, crps;
+  double heavyside0, heavysideN;
+  double brs_reli, brs_resol, brs_uncty, brs_thresh = 0;
+  double g,o,p;
+
+  int fileID;
+  const char *ofilebase;
+  char *ofilename;
+  char file_suffix[32];
+  char type_suffix[10];
+
+  typedef struct
+  {
+    int streamID;
+    int vlistID;
+    double *array;
+  } ens_file_t;
+  ens_file_t *ef = NULL;
+
+
+  // INITIALIZE POINTERS
+  streamID2 = NULL;
+  varID2 = NULL;
+  alpha = NULL; beta = NULL; alpha_weights = NULL; beta_weights = NULL; 
+  brs_g = NULL; brs_o = NULL; brs_g_weights = NULL; brs_o_weights = NULL;
+  r = NULL;
+  x = NULL;
+  val = NULL;
+  weights = NULL; 
+  int vlistCheck, gridsizeCheck;
+  
+  cdoInitialize(argument);
+  
+  cdoOperatorAdd("enscrps",   CRPS,  0,   NULL);
+  cdoOperatorAdd("ensbrs",    BRS,   0,   NULL);
+  
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+  datafunc = cdoOperatorF2(operatorID);
+
+  nfiles = cdoStreamCnt() - 1;
+  nens = nfiles-1;
+
+  if ( operfunc == CRPS ) {
+    nostreams = 3;
+  }
+  else if ( operfunc == BRS )  {
+    operatorInputArg("Threshold for Brier score?");
+    operatorCheckArgc(1);
+    brs_thresh = atof(operatorArgv()[0]);
+    nostreams = 4;
+
+    fprintf(stderr,"brs_thres %10.6f\n",brs_thresh);
+  }
+
+  // allocate array to hold results 
+  r = (double *) malloc ( nostreams*sizeof(double) );
+  
+
+  // one stream for each value of the decomposition
+  streamID2 = (int *) malloc ( nostreams*sizeof(int) );
+  vlistID2 = (int *) malloc ( nostreams*sizeof(int) );
+  taxisID2 = (int *) malloc ( nostreams*sizeof(int) );
+  zaxisID2 = (int *) malloc ( nostreams*sizeof(int) );
+
+  val = (double *) calloc ( nfiles,sizeof(double) );
+  
+  if ( operfunc == CRPS ) {
+    alpha=(double *) calloc ( nens+1,sizeof(double) );
+    beta =(double *) calloc ( nens+1,sizeof(double) );
+    alpha_weights=(double *) calloc ( nens+1,sizeof(double) );
+    beta_weights =(double *) calloc ( nens+1,sizeof(double) );
+  }
+  else if ( operfunc == BRS ) {
+    brs_g = (double *) calloc ( nens+1,sizeof(double) );
+    brs_o = (double *) calloc ( nens+1,sizeof(double) );
+  }
+  if ( cdoVerbose )
+    cdoPrint("Ensemble over %d files (Ensstat5).", nfiles-1);
+
+  ef = (ens_file_t *) malloc(nfiles*sizeof(ens_file_t));
+  
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      streamID = streamOpenRead(cdoStreamName(fileID));
+
+      vlistID = streamInqVlist(streamID);
+      
+      ef[fileID].streamID = streamID;
+      ef[fileID].vlistID  = vlistID;
+      ef[fileID].array    = NULL;
+    }
+
+  if ( cdoVerbose ) 
+    cdoPrint("Opened %i Input Files for Ensemble Operator",nfiles);
+  
+  /* check for identical contents of all ensemble members */
+  nvars = vlistNvars(ef[0].vlistID);
+  if ( cdoVerbose ) 
+    cdoPrint("nvars %i\n",nvars);
+
+  for ( fileID = 1; fileID < nfiles; fileID++ )
+    vlistCompare(ef[0].vlistID, ef[fileID].vlistID, CMP_ALL);
+
+  vlistID1 = ef[0].vlistID;
+  taxisID1 = vlistInqTaxis(vlistID1);
+  zaxisID1 = vlistInqVarZaxis(vlistID1,0);
+  nlevs    = zaxisInqSize(zaxisID1);
+
+  gridID2 = gridCreate(GRID_LONLAT, 1);
+  gridDefXsize(gridID2, 1);
+  gridDefYsize(gridID2, 1);
+  gridDefXvals(gridID2, &xval);
+  gridDefYvals(gridID2, &yval);
+
+  ofilebase = cdoStreamName(nfiles);
+
+  memset(file_suffix, 0, sizeof(file_suffix) );
+  cdoGenFileSuffix(&file_suffix[0], sizeof(file_suffix), 
+		   cdoDefaultFileType, vlistID1);
+
+  for ( stream = 0; stream < nostreams; stream++ ) {
+    int namelen = strlen(ofilebase) 
+      + 9  /*type_suffix*/ 
+      + 32 /*file_suffix*/
+      + 3  /*separating dots and EOS*/;
+    int ntype = 0;
+
+    switch ( operfunc ) {
+    case CRPS: switch ( stream ) {
+      case 0: ntype=4; sprintf(type_suffix,"crps");      break;
+      case 1: ntype=9; sprintf(type_suffix,"crps_reli"); break;
+      case 2: ntype=8; sprintf(type_suffix,"crps_pot");  break; } 
+      break;
+    case BRS: switch ( stream ) {
+      case 0: ntype=3; sprintf(type_suffix,"brs");       break;
+      case 1: ntype=8; sprintf(type_suffix,"brs_reli");  break;
+      case 2: ntype=8; sprintf(type_suffix,"brs_reso");  break;
+      case 3: ntype=8; sprintf(type_suffix,"brs_unct");  break; }
+      break;
+    }
+
+    ofilename = (char *) calloc ( namelen, sizeof(char) );
+
+    sprintf(ofilename,"%s.%s%s",ofilebase,type_suffix,file_suffix);
+    fprintf(stderr,"StreamID %i: %s\n",stream,ofilename);
+
+    if ( !cdoSilentMode && !cdoOverwriteMode )
+      if ( fileExists(ofilename) )
+	if ( !userFileOverwrite(ofilename) )
+	    cdoAbort("Outputfile %s already exists!", ofilename);
+
+    streamID2[stream] = streamOpenWrite(ofilename, cdoFiletype());    
+
+    free(ofilename);
+
+    zaxisID2[stream] = zaxisDuplicate(zaxisID1);
+    taxisID2[stream] = taxisDuplicate(taxisID1);
+    vlistID2[stream] = vlistDuplicate(vlistID1);
+
+    ngrids = vlistNgrids(vlistID2[stream]);
+    fprintf(stderr,"ngrids %i\n",ngrids);
+    for ( i=0; i<ngrids; i++ )
+      vlistChangeGridIndex(vlistID2[stream], i, gridID2);
+
+    vlistDefTaxis(vlistID2[stream], taxisID2[stream]);
+    streamDefVlist(streamID2[stream], vlistID2[stream]);
+
+    vlistCheck = streamInqVlist(streamID2[stream]);
+    gridsizeCheck = vlistGridsizeMax(vlistCheck);
+
+    fprintf(stderr,"stream %i vlist %3i gridsize %4i\n",stream,vlistCheck,gridsizeCheck);
+  }
+
+  if ( cdoVerbose ) 
+    cdoPrint(" sum_weights %10.6f\n",sum_weights);
+  
+  tsID = 0;
+  do
+    {
+      nrecs0 = streamInqTimestep(ef[0].streamID, tsID);
+      for ( fileID = 1; fileID < nfiles; fileID++ )
+	{
+	  streamID = ef[fileID].streamID;
+	  nrecs = streamInqTimestep(streamID, tsID);
+	  if ( nrecs != nrecs0 )
+	    cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoStreamName(0), cdoStreamName(fileID));
+	}
+      
+      for ( stream = 0; stream < nostreams; stream++ ) {
+	taxisCopyTimestep(taxisID2[stream], taxisID1);
+	if ( nrecs0 > 0 ) streamDefTimestep(streamID2[stream], tsID);
+      }
+      
+      for ( recID = 0; recID < nrecs0; recID++ )
+	{
+	  for ( fileID = 0; fileID < nfiles; fileID++ ) 
+	    {
+	      streamInqRecord(fileID, &varID, &levelID);
+	      
+	      if ( fileID == 0 )
+		{
+		  gridID   = vlistInqVarGrid(vlistID1, varID);
+		  gridsize = gridInqSize(gridID);
+		  missval  = vlistInqVarMissval(vlistID1, varID);
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));//vlistGridsizeMax(vlistID1);
+		  if ( weights ) free(weights); 
+		  weights=(double*) malloc (gridsize*sizeof(double));
+		}
+
+	      if (ef[fileID].array ) free(ef[fileID].array);
+	      ef[fileID].array = (double *) malloc(gridsize*sizeof(double));
+
+	      streamID = ef[fileID].streamID;
+	      streamReadRecord(streamID, ef[fileID].array, &nmiss);
+	    }
+
+	  xsize = gridInqXsize(gridID);
+	  ysize = gridInqYsize(gridID);
+	  
+	  /*	  if ( xsize > 1 && ysize > 1 )  {
+	    gridWeights(gridID, weights);
+	    sum_weights=0;
+	    for ( i=0; i<gridsize; i++ )  
+	      sum_weights += weights[i];
+	  }
+	  else*/ {
+	    for ( i=0; i< gridsize; i++ )
+	      weights[i] = 1./gridsize;
+	    sum_weights=1.;
+	  }
+	  
+	  nmiss = 0;
+	  valcount = 0;
+	  heavyside0 = 0;
+	  heavysideN = 0;
+	  
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+	      have_miss = 0;
+	      for ( fileID = 0; fileID < nfiles; fileID++ )
+		{
+		  val[fileID] = ef[fileID].array[i];
+		  if ( DBL_IS_EQUAL(val[fileID], missval) ) 
+		    { have_miss = 1; break; }
+		}
+	      
+	      xa=val[0];                                     /* 1st file contains reference  */
+	      x = &val[1];                                   /* Ensembles start at 2nd   file*/
+	      sort_iter_single(nens,x,1);                    /* Sort The Ensemble Array      */
+	                                                     /* to ascending order           */
+	      // only process if no missing value in ensemble
+
+	      if ( ! have_miss && operfunc == CRPS )  
+		{
+		  
+		  if ( xa < x[0] ) {                             /* Consider outliers            */
+		    beta[0] += (x[0]-xa)*weights[i];
+		    heavyside0 += 1.;
+		  }
+		  if ( xa > x[nens-1] )  {
+		    alpha[nens] += (xa-x[nens-1])*weights[i];
+		    alpha_weights[nens] += weights[i];
+		    heavysideN += 1.;
+		  }
+		  
+		  /* Loop start at zero ==> 1st ensemble (c-indexing) */
+		  for ( k=0; k<nens-1; k++ ) {                   /* Cumulate alpha and beta      */
+		    if ( xa > x[k+1] )                           /* left of heavyside            */
+		      alpha[k+1]+= (x[k+1]-x[k]) * weights[i];   /*                              */
+		    else if ( xa < x[k] )                        /* right of heavyside           */
+		      beta[k+1] += (x[k+1]-x[k]) * weights[i];   /*                              */
+		    else if ( x[k+1] >= xa && xa >= x[k] ) {     /* hitting jump pf heavyside    */
+		      alpha[k+1]+= (xa    -x[k]) * weights[i];   /* (occurs exactly once!)       */
+		      beta[k+1] += (x[k+1]-xa)   * weights[i];   /* **************************** */
+		    }
+		  }
+		}
+	      else if ( operfunc == BRS ) 
+		{
+		  int occ = xa > brs_thresh? 1 : 0;
+
+		  // brs_g[i] - number of enemble members with rank i that forecast event
+		  //          - event: value > brs_thresh
+		  //
+		  if ( x[0] > brs_thresh ) 
+		    brs_g[0] += weights[i];
+		  else if ( x[nens-1] < brs_thresh ) 
+		    brs_g[nens] += weights[i];		  
+		  else
+		    for ( k=0; k<nens-1; k++ ) {
+		      if ( x[k+1] >= brs_thresh && brs_thresh >= x[k] ) {
+			brs_g[k+1] += weights[i];
+			break;
+		      }
+		    }
+		  
+		  // brs_o[i] - number of times that the obs is between
+		  //            Ensemble i-1 and i
+		  if ( 1 ) 
+		    {
+		      if ( x[0] > xa )
+			brs_o[0] += weights[i];
+		      else if ( x[nens-1] < xa ) 
+			brs_o[nens] += weights[i];
+		      else
+			for ( k=0; k<nens-1; k++ ) {
+			  if ( x[k+1] >= xa && xa >= x[k] ) {
+			    brs_o[k+1] += weights[i];
+			    break;
+			  }
+			}
+		    }
+		}
+	    }        // for ( i=0; i<gridsize; i++ )
+	  
+	  if ( operfunc == CRPS ) {
+	    
+	    // First Bin
+	    p=0.; g=0.;
+	    o = heavyside0/gridsize;
+	    if ( o > 0. ) {
+	      g = beta[0]/o;
+	    }
+	    crps_reli= g * (o - p) * (o - p);
+	    crps_pot = g*o*(1.-o);
+	    crps     = g*( (1.-o)*p*p  +  o*(1.-p)*(1.-p) );	  
+	    
+	    // Middle Bins
+	    for ( k=1; k<nens; k++ ) {
+	      p = (double)k/(double)nens;
+	      
+	      if ( ! DBL_IS_EQUAL(sum_weights,1.) ) {
+		alpha[k] /= sum_weights; 
+		beta[k] /= sum_weights;
+	      }
+	      
+	      g = alpha[k]+beta[k];
+	      o = beta[k] / ( alpha[k] + beta[k] ); 
+	      
+	      crps_reli += g * (o - p) * (o - p);
+	      crps_pot  += g*o*(1.-o);
+	      crps      += g*( (1.-o)*p*p  +  o*(1.-p)*(1.-p) );	  
+	    }
+		
+	    // Last Bin
+	    p=1.; g=0.;
+	    o = 1. - heavysideN/gridsize; 
+	    if ( IS_EQUAL(o,1.) ) {
+	      g = alpha[nens] / (1-o);
+	      
+	      crps_reli    += g * (o-p) * (o-p);
+	      crps_pot+= g*o*(1-o);
+	      crps    += g*( (1-o)*p*p  +  o*(1-p)*(1-p) );	  
+	    }
+	    r[CRPS_RES] = crps;
+	    r[CRPS_RELI]= crps_reli;
+	    r[CRPS_POT] = crps_pot;
+	    
+	  } else if ( operfunc == BRS ) {
+	    double gsum=0;
+	    double obar=0; 
+	    double osum=0;
+	    double o,g,p;
+	    
+	    brs_reli=0;
+	    brs_resol=0;
+	    brs_uncty=0;
+	    
+	    for ( k=0; k<=nens; k++ ) {
+	      obar += brs_g[k]*brs_o[k];
+	      gsum += brs_g[k];
+	      osum += brs_o[k];
+	    }
+	    
+	    if ( abs(osum-1) > 1e-06 || abs(gsum-1) > 1e-06 )  {
+	      cdoAbort("Internal error - normalization constraint of problem not fulfilled");
+	      cdoAbort("This is likely due to missing values");
+	    }
+	    o=0; p=0; g=0;
+	    brs_uncty = obar * (1-obar);
+	    
+	    for ( k=0; k<=nens; k++ ) {
+		  
+	      g = brs_g[k];
+	      o = brs_o[k];
+	      p = 1. - k / (float)nens; 
+	      // need p = 1 - k/nens here as k=0 if all members forecast event and k=nens if none does so. 
+	      
+	      brs_reli += g * ( o-p )  * ( o-p );
+	      brs_resol+= g * (o-obar) * (o-obar);
+	     }
+	     
+	    r[BRS_RES]   = brs_reli-brs_resol+brs_uncty;
+	    r[BRS_RELI]  = brs_reli;
+	    r[BRS_RESOL] = brs_resol;
+	    r[BRS_UNCTY] = brs_uncty;
+	    
+	    if ( cdoVerbose ) {
+	      //	      cdoPrint("Brier score for var %i level %i calculated",varID, levelID);
+	      cdoPrint("BRS: obar %12.6g "
+		       "brs  %12.6g reli %12.6g resol %12.6g u %12.6g",
+		       obar,brs_reli-brs_resol+brs_uncty,brs_reli,brs_resol,brs_uncty);  
+
+	    }
+	  }
+	  
+	  
+	  if ( cdoVerbose && operfunc == CRPS ) 
+	    cdoPrint("CRPS:%12.6g reli:%12.6g crps_pot:%12.6g crps:%12.6g", 
+		     crps,crps_reli,crps_pot, crps_reli+crps_pot);
+	  
+	  for ( stream =0; stream<nostreams; stream++ ) {
+	    streamDefRecord(streamID2[stream],varID,levelID);
+	    if ( isnan ( r[stream] )  ) {
+	      r[stream] = missval; 
+	      have_miss = 1;
+	    }
+	    streamWriteRecord(streamID2[stream],&r[stream],have_miss);
+	  }
+	  
+	  switch ( operfunc ) {
+	  case ( CRPS ) :
+	    memset(alpha, 0, (nens+1) * sizeof(double) );
+	    memset(beta,  0, (nens+1) * sizeof(double) ); 
+	    heavyside0=0;
+	    heavysideN=0;	  
+	    break; 
+	  case ( BRS ):
+	    memset(brs_o, 0, (nens+1)*sizeof(double) );
+	    memset(brs_g, 0, (nens+1)*sizeof(double) );
+	    break;
+	  }
+	}   // for ( recID = 0; recID < nrecs; recID++ ) 
+      tsID++;
+    }  while ( nrecs );
+      
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      streamID = ef[fileID].streamID;
+      streamClose(streamID);
+    }
+  
+  for ( stream = 0; stream < nostreams; stream++ )
+    streamClose(streamID2[stream]);
+  
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    if ( ef[fileID].array ) free(ef[fileID].array);
+
+  for ( stream = 0; stream < nostreams; stream++ ) {
+    vlistDestroy(vlistID2[stream]);
+    taxisDestroy(taxisID2[stream]);
+    zaxisDestroy(zaxisID2[stream]);
+  }
+
+  //  vlistDestroy(vlistID1);
+  //  taxisDestroy(taxisID1);
+  //  zaxisDestroy(zaxisID1);
+
+  gridDestroy(gridID);
+  gridDestroy(gridID2);
+
+  if ( ef ) free(ef);
+  if ( weights ) free(weights);
+  if ( r ) free(r);
+  if ( alpha ) free(alpha);
+  if ( beta ) free(beta);
+  if ( alpha_weights ) free(alpha_weights);
+  if ( beta_weights ) free(beta_weights);
+  if ( brs_g ) free(brs_g);
+  if ( brs_o) free(brs_o);
+  if ( brs_g_weights ) free(brs_g_weights);
+  if ( brs_o_weights) free(brs_o_weights);
+  if ( val ) free(val);
+  if ( vlistID2 ) free(vlistID2);
+  if ( streamID2 ) free(streamID2);
+  if ( zaxisID2 ) free(zaxisID2);
+  if ( taxisID2 ) free(taxisID2);  
+  cdoFinish();
+  
+  return (0);
+}
diff --git a/src/Eof3d.c b/src/Eof3d.c
new file mode 100644
index 0000000..f6ecb15
--- /dev/null
+++ b/src/Eof3d.c
@@ -0,0 +1,586 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+     EOF3d        eof3d             3D-EOF in spatial or time space
+     EOF3d        eof3dspatial      3D-EOF in spatial space
+     EOF3d        eof3dtime         3D-EOF in time space
+*/
+/*
+ * TODO: 
+ * Role of the weights for eofs. Should not be mixed up with division with
+ * number of contributing values during summation.
+ */
+
+#if defined (_OPENMP)
+#include <omp.h>
+#endif
+
+#include "cdi.h"
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "statistic.h"
+
+
+enum T_EIGEN_MODE {JACOBI, DANIELSON_LANCZOS};
+
+#define WEIGHTS 1
+
+// NO MISSING VALUE SUPPORT ADDED SO FAR
+
+void *EOF3d(void * argument)
+{
+  char *envstr;
+
+  enum {EOF3D_, EOF3D_TIME, EOF3D_SPATIAL};
+
+  int **datacounts;
+  int gridsize, temp_size = 0;
+  int gridID1, gridID2, gridID3;
+  int i, i2, j, j1, j2, eofID, varID, recID, levelID, tsID;
+  int *miss;
+  int missval_warning=0;
+  int nmiss,ngrids,n_eig,nrecs,nvars,n=0,nlevs=0,npack=0,nts=0;
+  int offset;
+  int operatorID, operfunc;
+  int *pack;
+  int reached_eof;
+  int streamID1, streamID2, streamID3;
+  int taxisID1, taxisID2, taxisID3;
+  int timer_init = 0, timer_alloc = 0, timer_read = 0, timer_cov = 0;
+  int timer_eig = 0, timer_post = 0, timer_write = 0, timer_finish = 0;
+  int *varID2;
+  int vdate=0, vtime=0;
+  int vlistID1, vlistID2 = -1, vlistID3 = -1;
+  int zaxisID2;
+
+  int calendar = CALENDAR_STANDARD;
+  juldate_t juldate;
+
+  double missval=0;
+  double sum_w, sum;
+  double **cov = NULL;                                /* TODO: covariance matrix / eigenvectors after solving */
+  double *eigv;
+  double *weight;
+  double *xvals, *yvals, *zvals;
+  double *df1p, *df2p;
+
+  field_t **datafields;
+  field_t **eigenvectors, **eigenvalues;
+  field_t in;
+
+  enum T_EIGEN_MODE eigen_mode = JACOBI;
+
+
+  if ( cdoTimer ) {
+    timer_init = timer_new("Timeof init");
+    timer_alloc= timer_new("Timeof alloc");
+    timer_read = timer_new("Timeof read");
+    timer_cov  = timer_new("Timeof cov");
+    timer_eig  = timer_new("Timeof eig");
+    timer_post = timer_new("Timeof post");
+    timer_write= timer_new("Timeof write");
+    timer_finish=timer_new("Timeof finish");
+
+    timer_start(timer_init);
+  }
+
+  cdoInitialize(argument);
+  cdoOperatorAdd("eof3d",       EOF3D_,       0, NULL);
+  cdoOperatorAdd("eof3dtime",   EOF3D_TIME,   0, NULL);
+  cdoOperatorAdd("eof3dspatial",EOF3D_SPATIAL,0, NULL);
+
+  operatorID  = cdoOperatorID();
+  operfunc    = cdoOperatorF1(operatorID);
+
+  operatorInputArg("Number of eigen functions to write out");
+  n_eig       = atoi(operatorArgv()[0]);
+
+  envstr = getenv("CDO_SVD_MODE");
+
+  if ( envstr &&! strncmp(envstr,"danielson_lanczos",17) )
+    eigen_mode = DANIELSON_LANCZOS;
+  else if ( envstr && ! strncmp(envstr,"jacobi",6) )
+    eigen_mode = JACOBI;
+  else if ( envstr ) {
+    cdoWarning("Unknown environmental setting %s for CDO_SVD_MODE. Available options are",envstr);
+    cdoWarning("  - 'jacobi' for a one-sided parallelized jacobi algorithm");
+    cdoWarning("  - 'danielson_lanzcos' for the D/L algorithm");
+  }
+
+  if ( cdoVerbose ) 
+    cdoPrint("Set eigen_mode to %s\n",eigen_mode == JACOBI? "jacobi" : "danielson_lanczos");
+
+#if defined (_OPENMP)
+  if ( omp_get_max_threads() > 1 && eigen_mode == DANIELSON_LANCZOS )  {
+    cdoWarning("Requested parallel computation with %i Threads ",omp_get_max_threads());
+    cdoWarning("  but environmental setting CDO_SVD_MODE causes sequential ");
+    cdoWarning("  Singular value decomposition");
+  }
+#endif 
+
+  streamID1   = streamOpenRead(cdoStreamName(0));
+  vlistID1    = streamInqVlist(streamID1);
+  taxisID1    = vlistInqTaxis(vlistID1);
+  gridID1     = vlistInqVarGrid(vlistID1, 0);
+  gridsize    = vlistGridsizeMax(vlistID1);
+  nvars       = vlistNvars(vlistID1);
+  nrecs       = vlistNrecs(vlistID1);
+  taxisID1    = vlistInqTaxis(vlistID1);
+  weight      = (double*) malloc(gridsize*sizeof(double));
+  if ( WEIGHTS )
+      gridWeights(gridID1, &weight[0]);
+  else
+    for(i=0;i<gridsize;i++)
+      weight[i]=1;
+
+
+  /*  eigenvalues */
+  streamID2   = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  taxisID2    = taxisDuplicate(taxisID1);
+
+  gridID2     = gridCreate(GRID_LONLAT, 1);
+  gridDefXsize(gridID2, 1);
+  gridDefYsize(gridID2, 1);
+  xvals       = (double*) malloc(1*sizeof(double));
+  yvals       = (double*) malloc(1*sizeof(double));
+  zvals       = (double*) malloc(1*sizeof(double));
+  xvals[0]    = 0;
+  yvals[0]    = 0;
+  zvals[0]    = 0;
+  gridDefXvals(gridID2, xvals);
+  gridDefYvals(gridID2, yvals);
+
+  zaxisID2 = zaxisCreate(ZAXIS_GENERIC,1);
+  zaxisDefLevels(zaxisID2,zvals);
+  zaxisDefName(zaxisID2,"zaxis_Reduced");
+  zaxisDefLongname(zaxisID2,"Reduced zaxis from EOF3D - only one eigen value per 3D eigen vector");
+
+  vlistID2 = vlistCreate();
+  taxisDefRdate(taxisID2, 0);
+  taxisDefRtime(taxisID2, 0);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  varID2 = (int *) malloc (nvars*sizeof(int));
+  for ( varID=0; varID<nvars; varID++ )
+    varID2[varID] = vlistDefVar(vlistID2, gridID2, zaxisID2, TSTEP_INSTANT);
+  ngrids      = vlistNgrids(vlistID2);
+  for ( i = 0; i < ngrids; i++ )
+    vlistChangeGridIndex(vlistID2, i, gridID2);
+
+  /*  eigenvectors */
+  streamID3   = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  vlistID3    = vlistDuplicate(vlistID1);
+  taxisID3    = taxisDuplicate(taxisID1);
+  gridID3     = gridDuplicate(gridID1);
+  taxisDefRdate(taxisID3, 0);
+  taxisDefRtime(taxisID3, 0);
+  vlistDefTaxis(vlistID3, taxisID3);
+  
+
+  if ( cdoVerbose )
+    cdoPrint("Initialized streams");
+
+  /*  eigenvalues */
+
+  reached_eof = 0;
+  tsID        = 0;
+
+  if ( operfunc == EOF3D_SPATIAL )
+    cdoAbort("Operator not Implemented - use eof3d or eof3dtime instead");
+
+
+  /* COUNT NUMBER OF TIMESTEPS if EOF3D_ or EOF3D_TIME */
+  while ( TRUE )
+    {
+      if ( reached_eof ) continue;
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 ) {
+	reached_eof = 1;
+	break;
+      }
+      tsID++;
+    }
+
+  nts         = tsID;
+  reached_eof = 0;
+  streamID1   = streamOpenRead(cdoStreamName(0));
+
+  /* reset the requested number of eigen-function to the maximum if neccessary */
+  if ( n_eig > nts )
+    {
+      cdoWarning("Solving in time-space:");
+      cdoWarning("Number of eigen-functions to write out is bigger than number of time-steps.");
+      cdoWarning("Setting n_eig to %i.", nts);
+      n_eig = nts;
+    }
+  n = nts;
+
+  if ( cdoVerbose ) 
+    cdoPrint("counted %i timesteps",n);
+
+  if ( cdoTimer ) timer_stop(timer_init);
+  if ( cdoTimer ) timer_start(timer_alloc);
+
+  /* allocation of temporary fields and output structures */
+  in.ptr       = (double *)   malloc(gridsize*sizeof(double));
+  datafields   = (field_t **) malloc(nvars*sizeof(field_t*));
+  datacounts   = (int     **) malloc(nvars*sizeof(int *));
+  eigenvectors = (field_t **) malloc(nvars*sizeof(field_t*));
+  eigenvalues  = (field_t **) malloc(nvars*sizeof(field_t*));
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      gridID1             = vlistInqVarGrid(vlistID1, varID);
+      gridsize            = vlistGridsizeMax(vlistID1);
+      nlevs               = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      temp_size           = gridsize * nlevs;
+      missval             = vlistInqVarMissval(vlistID1, varID);
+
+      datafields[varID]   = (field_t *) malloc(nlevs*sizeof(field_t*));
+      datacounts[varID]   = (int *)     malloc(nlevs*sizeof(int* ));
+      eigenvectors[varID] = (field_t *) malloc(nlevs*sizeof(field_t*));
+
+      datafields[varID] = (field_t *) malloc(nts*sizeof(field_t));
+      for ( tsID = 0; tsID < nts; tsID++ )
+	{
+	  datafields[varID][tsID].grid    = gridID1;
+	  datafields[varID][tsID].nmiss   = 0;
+	  datafields[varID][tsID].missval = missval;
+	  datafields[varID][tsID].ptr     = (double *) malloc(temp_size*sizeof(double));
+	  for ( i = 0; i < temp_size; ++i )
+	    datafields[varID][tsID].ptr[i] = 0;
+	}
+      datacounts[varID] = (int *) malloc(temp_size*sizeof(int));	      
+      for(i=0;i<temp_size;i++)
+	datacounts[varID][i] = 0;
+      
+      eigenvectors[varID] = (field_t *) malloc(n_eig*sizeof(field_t));
+      eigenvalues[varID]  = (field_t *) malloc(nts*sizeof(field_t));
+
+      for ( i = 0; i < n; i++ )
+	{
+	  if ( i < n_eig )
+	    {
+	      eigenvectors[varID][i].grid    = gridID2;
+	      eigenvectors[varID][i].nmiss   = 0;
+	      eigenvectors[varID][i].missval = missval;
+	      eigenvectors[varID][i].ptr     = (double *) malloc(temp_size*sizeof(double));
+	      for ( i2 = 0; i2 < temp_size; ++i2 )
+		eigenvectors[varID][i].ptr[i2] = missval;
+	    }
+	  
+	  eigenvalues[varID][i].grid    = gridID3;
+	  eigenvalues[varID][i].nmiss   = 0;
+	  eigenvalues[varID][i].missval = missval;
+	  eigenvalues[varID][i].ptr     = (double *) malloc(1*sizeof(double));
+	  eigenvalues[varID][i].ptr[0]  = missval;
+	}
+    }
+
+  if ( cdoVerbose)
+    cdoPrint("allocated eigenvalue/eigenvector with nts=%i, n=%i, gridsize=%i for processing in %s",
+	     nts,n,gridsize,"time_space");
+  
+  if ( cdoTimer ) timer_stop(timer_alloc);
+
+  if ( cdoTimer ) timer_start(timer_read);
+  tsID = 0;
+
+  /* read the data and create covariance matrices for each var & level */
+  while ( TRUE )
+    {
+      if ( reached_eof ) continue;
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 )
+        {
+          reached_eof = 1;
+          break;
+        }
+
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID1, &varID, &levelID);
+          gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+          missval  = in.missval = vlistInqVarMissval(vlistID1, varID);
+          streamReadRecord(streamID1, in.ptr, &in.nmiss);
+
+	  offset = gridsize * levelID;
+	  for ( i=0; i<gridsize; ++i )
+	    {
+	      if ( ! DBL_IS_EQUAL(in.ptr[i], missval ) )
+		{
+		  datafields[varID][tsID].ptr[offset + i] = in.ptr[i];
+		  datacounts[varID][offset + i]++;
+		}
+	      else
+		{
+		  if ( missval_warning == 0 )
+		    {
+		      cdoWarning("Missing Value Support not Checked for this Operator!");
+		      cdoWarning("Does not work with changing locations of missing values in time.");
+		      missval_warning = 1;
+		    }
+		  datafields[varID][tsID].ptr[i+offset] = 0;
+		}
+	    }
+        }
+      tsID++;
+    }
+
+  if ( cdoVerbose ) 
+    cdoPrint("Read data for %i variables",nvars);
+  
+  pack = (int *) malloc(temp_size*sizeof(int)); //TODO
+  miss = (int *) malloc(temp_size*sizeof(int));
+
+  if ( cdoTimer ) timer_stop(timer_read);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      nlevs               = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      temp_size = gridsize * nlevs;
+
+      if ( cdoVerbose )  {
+	char vname[64];
+	vlistInqVarName(vlistID1,varID,&vname[0]);
+	cdoPrint("============================================================================");
+	cdoPrint("Calculating covariance matrix and SVD for var%i (%s)",varID,vname);
+      }
+
+      npack        = 0;    // TODO already set to 0
+      sum_w        = 0;
+
+      if ( cdoTimer ) timer_start(timer_cov);
+      
+      sum_w = 0;
+      for ( i = 0; i < temp_size ; i++ )
+	{
+	  if ( datacounts[varID][i] > 1)
+	    {
+	      pack[npack] = i;
+	      npack++;
+	      sum_w += weight[i%gridsize];
+	    }
+	}
+
+      if ( npack < 1 ) {
+	char vname[64];
+	vlistInqVarName(vlistID1,varID,&vname[0]);
+	cdoWarning("Refusing to calculate EOF from a single time step for var%i (%s)",varID,&vname[0]);
+	continue;
+      }
+
+	  
+      cov = (double **) malloc (nts*sizeof(double*));
+      for ( j1 = 0; j1 < nts; j1++)
+	cov[j1] = (double*) malloc(nts*sizeof(double));
+      eigv = (double *) malloc(n*sizeof(double));
+
+      if ( cdoVerbose )  {
+	cdoPrint("varID %i allocated eigv and cov with nts=%i and n=%i",varID,nts,n);
+	cdoPrint("   npack=%i, nts=%i temp_size=%i",npack,nts,temp_size);
+      }
+
+
+#if defined (_OPENMP)
+#pragma omp parallel for private(j1,j2,sum,df1p,df2p) default(shared) schedule(static,2000)
+#endif 
+      for ( j1 = 0; j1 < nts; j1++)
+	for ( j2 = j1; j2 < nts; j2++ )
+	  {
+	    sum = 0;
+	    df1p = datafields[varID][j1].ptr;
+	    df2p = datafields[varID][j2].ptr;
+	    for ( i = 0; i < npack; i++ )
+	      sum += weight[pack[i]%gridsize]*df1p[pack[i]]*df2p[pack[i]];
+	    cov[j2][j1] = cov[j1][j2] = sum / sum_w / nts;
+	  }
+      if ( cdoVerbose ) 
+	cdoPrint("calculated cov-matrix");
+
+      /* SOLVE THE EIGEN PROBLEM */
+      if ( cdoTimer ) timer_stop(timer_cov);
+
+
+      if ( cdoTimer ) timer_start(timer_eig);
+
+      if ( cdoVerbose ) 
+	cdoPrint("Processed correlation matrix for var %2i | npack: %4i",varID,n);
+
+      if ( eigen_mode == JACOBI ) 
+	parallel_eigen_solution_of_symmetric_matrix(&cov[0],&eigv[0],n,n,__func__);
+      else 
+	eigen_solution_of_symmetric_matrix(&cov[0],&eigv[0],n,n,__func__);
+      /* NOW: cov contains the eigenvectors, eigv the eigenvalues */
+
+      if ( cdoVerbose ) 
+	cdoPrint("Processed SVD decomposition for var %i from %i x %i matrix",varID,n,n);
+
+      for( eofID=0; eofID<n; eofID++ )
+	eigenvalues[varID][eofID].ptr[0] = eigv[eofID];
+      
+      if ( cdoTimer ) timer_stop(timer_eig);
+      if ( cdoTimer ) timer_start(timer_post);
+
+      for ( eofID = 0; eofID < n_eig; eofID++ )
+	{
+#if defined (_OPENMP)
+#pragma omp parallel for private(i,j,sum) shared(datafields, eigenvectors)
+#endif 
+	  for ( i = 0; i < npack; i++ )
+	    {
+	      sum = 0;
+	      for ( j = 0; j < nts; j++ )
+		sum += datafields[varID][j].ptr[pack[i]] * cov[eofID][j];
+	      eigenvectors[varID][eofID].ptr[pack[i]] = sum;
+	    }
+	  // NORMALIZING
+	  sum = 0;
+
+#if defined (_OPENMP)
+#pragma omp parallel for private(i) default(none) reduction(+:sum) \
+  shared(eigenvectors,weight,pack,varID,eofID,npack,gridsize)
+#endif 
+	  for ( i = 0; i < npack; i++ )
+	    sum +=  weight[pack[i]%gridsize] *
+	      eigenvectors[varID][eofID].ptr[pack[i]] *
+	      eigenvectors[varID][eofID].ptr[pack[i]];
+
+	  if ( sum > 0 ) {
+	    sum = sqrt(sum);
+#if defined (_OPENMP)
+#pragma omp parallel for private(i) default(none) \
+  shared(sum,npack,eigenvectors,varID,eofID,pack)
+#endif
+	    for( i = 0; i < npack; i++ )
+	      eigenvectors[varID][eofID].ptr[pack[i]] /= sum;
+	  }
+	  else
+#if defined (_OPENMP)
+#pragma omp parallel for private(i) default(none) \
+  shared(eigenvectors,varID,eofID,pack,missval,npack)
+#endif
+	    for( i = 0; i < npack; i++ )
+	      eigenvectors[varID][eofID].ptr[pack[i]] = missval;
+	}     /* for ( eofID = 0; eofID < n_eig; eofID++ )     */
+
+      if ( cdoTimer ) timer_stop(timer_post);
+
+      if ( eigv ) free(eigv);
+      for ( i=0; i<n; i++ )
+	if ( cov[i] ) 
+	  free(cov[i]);
+    }         /* for ( varID = 0; varID < nvars; varID++ )    */
+
+  /* write files with eigenvalues (ID3) and eigenvectors (ID2) */
+
+
+  if ( cdoTimer ) timer_start(timer_write);
+
+  cdoPrint("Started writing");
+  streamDefVlist(streamID2, vlistID2);
+  streamDefVlist(streamID3, vlistID3);
+
+  vdate = 10101;
+  vtime = 0;
+  juldate = juldate_encode(calendar, vdate, vtime);
+  for ( tsID = 0; tsID < n; tsID++ )
+    {
+      juldate = juldate_add_seconds(60, juldate);
+      juldate_decode(calendar, juldate, &vdate, &vtime);
+
+      taxisDefVdate(taxisID2, vdate);
+      taxisDefVtime(taxisID2, vtime);
+      streamDefTimestep(streamID2, tsID);
+
+      if ( tsID < n_eig )
+        {
+          taxisDefVdate(taxisID3, vdate);
+          taxisDefVtime(taxisID3, vtime);
+          streamDefTimestep(streamID3, tsID);
+        }
+
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+          for ( levelID = 0; levelID < nlevs; levelID++ )
+            {
+	      offset = levelID * gridsize;
+              if ( tsID < n_eig )
+                {
+                  nmiss = 0;
+                  for ( i = 0; i < gridsize; i++ )
+                    if ( DBL_IS_EQUAL(eigenvectors[varID][tsID].ptr[offset + i], missval) ) nmiss++;
+
+                  streamDefRecord(streamID3, varID, levelID);
+                  streamWriteRecord(streamID3, &eigenvectors[varID][tsID].ptr[offset], nmiss);
+                }
+	    }
+	  if ( DBL_IS_EQUAL(eigenvalues[varID][tsID].ptr[i], missval) ) nmiss = 1;
+	  else nmiss = 0;
+	  streamDefRecord(streamID2, varID, 0);
+	  streamWriteRecord(streamID2, eigenvalues[varID][tsID].ptr,nmiss);
+        } // for ( varID = 0; ... )
+    } // for ( tsID = 0; ... )
+
+  if ( cdoTimer ) timer_stop(timer_write);
+  
+  if ( cdoTimer ) timer_start(timer_finish);
+
+  cdoPrint("Started cleanup in eof3d");
+  
+  for ( varID = 0; varID < nvars; varID++)
+    {
+      for(i = 0; i < nts; i++)
+	{
+	  if ( i < n_eig )
+	    free(eigenvectors[varID][i].ptr);
+	  free(eigenvalues[varID][i].ptr);
+	}
+      free(eigenvectors[varID]);
+      free(eigenvalues[varID]);
+      free(datacounts[varID]);
+    }
+
+  free(eigenvectors);
+  free(eigenvalues);
+  free(datafields);
+  free(datacounts);
+  free(in.ptr);
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( cdoTimer ) timer_stop(timer_finish);
+  
+  cdoFinish();
+ 
+  return (0);
+}
+
diff --git a/src/Eofcoeff.c b/src/Eofcoeff.c
new file mode 100644
index 0000000..38abe24
--- /dev/null
+++ b/src/Eofcoeff.c
@@ -0,0 +1,255 @@
+/*
+ This file is part of CDO. CDO is a collection of Operators to
+ manipulate and analyse Climate model Data.
+ 
+ Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+ See COPYING file for copying and redistribution conditions.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ */
+
+/*
+ This module contains the following operators:
+ 
+ Eofcoeff             eofcoeff             process eof coefficients
+*/
+#define WEIGHTS 1
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+// NO MISSING VALUE SUPPORT ADDED SO FAR
+
+void *Eofcoeff(void * argument)
+{
+  char eof_name[8], oname[1024], filesuffix[32];
+  double *w;
+  double missval1 = -999, missval2;
+  double *xvals, *yvals;  
+  field_t ***eof;  
+  field_t in;  
+  field_t out;
+  int operatorID, operfunc;  
+  int gridsize;
+  int i, varID, recID, levelID, tsID, eofID;    
+  int gridID1, gridID2, gridID3;
+  int nrecs, nvars, nlevs, neof, nchars, nmiss, ngrids; 
+  int reached_eof;
+  int streamID1, streamID2, *streamIDs;
+  int taxisID1, taxisID2, taxisID3;
+  int vlistID1, vlistID2, vlistID3;
+   
+  cdoInitialize(argument);
+  cdoOperatorAdd("eofcoeff",  0,       0, NULL);
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+     
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = vlistDuplicate(vlistID2);   
+  
+  taxisID1 = vlistInqTaxis(vlistID1);  
+  taxisID2 = vlistInqTaxis(vlistID2); 
+  taxisID3 = taxisDuplicate(taxisID2);
+  
+  gridID1 = vlistInqVarGrid(vlistID1, 0);
+  gridID2 = vlistInqVarGrid(vlistID2, 0);
+  
+  if ( vlistGridsizeMax(vlistID1)==vlistGridsizeMax(vlistID2) )
+    gridsize = vlistGridsizeMax(vlistID1);  
+  else 
+    {
+      gridsize = -1;
+      cdoAbort ("Gridsize of input files does not match");
+    }
+      
+  
+  if ( vlistNgrids(vlistID2) > 1 || vlistNgrids(vlistID1) > 1 )
+    cdoAbort("Too many grids in input");
+  
+  nvars = vlistNvars(vlistID1)==vlistNvars(vlistID2) ? vlistNvars(vlistID1) : -1;
+  nrecs = vlistNrecs(vlistID1); 
+  nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, 0));
+  w = (double*)malloc(gridsize*sizeof(double));
+  gridWeights(gridID2, &w[0]);
+  
+  
+  
+  if (vlistGridsizeMax(vlistID2)   != gridsize ||
+      vlistInqVarGrid(vlistID2, 0) != gridID1 )
+    cdoAbort("EOFs (%s) and data (%s) defined on different grids", cdoStreamName(0), cdoStreamName(1));    
+ 
+  
+  strcpy(oname, cdoStreamName(2));
+  nchars = strlen(oname);
+  
+  filesuffix[0] = 0;
+  cdoGenFileSuffix(filesuffix, sizeof(filesuffix), cdoDefaultFileType, vlistID1);
+  
+  eof = (field_t ***) malloc (nvars * sizeof(field_t**) );
+  for ( varID=0; varID<nvars; varID++)
+    eof[varID] = (field_t **) malloc(nlevs*sizeof(field_t*));
+  reached_eof=0;
+  eofID = 0;
+  while ( 1 )       
+   {     
+     nrecs = streamInqTimestep(streamID1, eofID);
+     if ( nrecs == 0)
+       {
+         reached_eof = 1;
+         break;
+       }
+     for ( recID = 0; recID < nrecs; recID++ )
+       {         
+         streamInqRecord(streamID1, &varID, &levelID);
+         missval1 = vlistInqVarMissval(vlistID1, varID);
+         if ( eofID == 0 )
+           eof[varID][levelID] = (field_t*) malloc (1*sizeof(field_t));
+         else
+           eof[varID][levelID] = (field_t*) realloc (eof[varID][levelID], (eofID+1)*sizeof(field_t));
+         eof[varID][levelID][eofID].grid   = gridID1;
+         eof[varID][levelID][eofID].nmiss  = 0;
+         eof[varID][levelID][eofID].missval= missval1;
+         eof[varID][levelID][eofID].ptr    = (double*)malloc(gridsize*sizeof(double));
+         memset(&eof[varID][levelID][eofID].ptr[0], missval1, gridsize*sizeof(double));
+         if ( varID >= nvars )
+           cdoAbort("Internal error - too high varID");
+         if ( levelID >= nlevs )
+           cdoAbort("Internal error - too high levelID");
+         
+         streamReadRecord(streamID1, eof[varID][levelID][eofID].ptr, 
+                          &eof[varID][levelID][eofID].nmiss);
+       }
+     eofID++;
+   }
+  neof = eofID;  
+  
+  if ( cdoVerbose ) cdoPrint("%s contains %i eof's", cdoStreamName(0), neof);
+  // Create 1x1 Grid for output
+  gridID3 = gridCreate(GRID_LONLAT, 1);
+  gridDefXsize(gridID3, 1);
+  gridDefYsize(gridID3, 1);
+  xvals=(double*)malloc(1*sizeof(double));
+  yvals=(double*)malloc(1*sizeof(double));
+  xvals[0]=0;
+  yvals[0]=0;
+  gridDefXvals(gridID3, xvals);
+  gridDefYvals(gridID3, yvals);
+  
+  // Create var-list and time-axis for output
+      
+  ngrids = vlistNgrids(vlistID3);
+  
+  for ( i = 0; i < ngrids; i++ )
+    vlistChangeGridIndex(vlistID3, i, gridID3);     
+  
+  vlistDefTaxis(vlistID3, taxisID3);
+  for (varID =0; varID<nvars; varID++)
+    vlistDefVarTsteptype(vlistID3, varID, TSTEP_INSTANT);
+  
+  // open streams for eofcoeff output
+  streamIDs = (int *) malloc (neof*sizeof(int)); 
+  eofID = 0;
+  for ( eofID = 0; eofID < neof; eofID++)
+    {
+      oname[nchars] = '\0';                       
+      for(varID=0; varID<nvars; varID++) 
+      sprintf(eof_name, "%5.5i", eofID);
+      strcat(oname, eof_name);
+      if ( filesuffix[0] )
+        strcat(oname, filesuffix);
+      
+      streamIDs[eofID] = streamOpenWrite(oname, cdoFiletype());
+      if (cdoVerbose) 
+        cdoPrint("opened %s ('w')  as stream%i for %i. eof", oname, streamIDs[eofID], eofID+1);
+      
+      streamDefVlist(streamIDs[eofID], vlistID3);
+    
+    }
+  
+  // ALLOCATE temporary fields for data read and write
+  in.ptr = (double*) malloc(gridsize*sizeof(double));
+  in.grid = gridID1;  
+  out.missval = missval1;
+  out.nmiss = 0;
+  out.ptr = (double *) malloc (1*sizeof(double));
+ 
+  // 
+  reached_eof=0;
+  tsID=0;
+  while ( 1 )
+    {      
+      nrecs = streamInqTimestep(streamID2, tsID);
+      if ( nrecs == 0 )
+        {
+          reached_eof=1;
+          break;
+        }
+      
+      taxisCopyTimestep(taxisID3, taxisID2);
+      /*for ( eofID=0; eofID<neof; eofID++)
+        {
+          fprintf(stderr, "defining ts %i\n", tsID);
+          streamDefTimestep(streamIDs[eofID],tsID);
+        }
+      */
+      for ( recID =0; recID< nrecs; recID++ )
+        {
+          streamInqRecord(streamID2, &varID, &levelID);
+          missval2 = vlistInqVarMissval(vlistID2, varID);
+          streamReadRecord(streamID2, in.ptr, &in.nmiss);  
+          
+          for (eofID = 0; eofID < neof; eofID++ )
+            {
+              if ( recID == 0 ) streamDefTimestep(streamIDs[eofID],tsID);
+              //if ( recID == 0 ) fprintf(stderr, "ts%i rec%i eof%i\n", tsID, recID, eofID);
+              out.ptr[0]  = 0;
+              out.grid    = gridID3;
+              out.missval = missval2;            
+              for(i=0;i<gridsize;i++)
+                {                  
+                  if (! DBL_IS_EQUAL(in.ptr[i],missval2) && 
+                      ! DBL_IS_EQUAL(eof[varID][levelID][eofID].ptr[i],missval1 ))
+                    {
+                      double tmp = w[i]*in.ptr[i]*eof[varID][levelID][eofID].ptr[i];
+                      out.ptr[0] += tmp;                   
+                    }
+                }            
+              if ( ! DBL_IS_EQUAL(out.ptr[0],0.) ) nmiss=0;
+              else { nmiss=1; out.ptr[0]=missval2; }
+                      
+              streamDefRecord(streamIDs[eofID], varID, levelID);
+              //fprintf(stderr, "%d %d %d %d %d %g\n", streamIDs[eofID],tsID, recID, varID, levelID,*out.ptr);
+              streamWriteRecord(streamIDs[eofID],out.ptr,nmiss);
+            }
+          if ( varID >= nvars )
+            cdoAbort("Internal error - too high varID");
+          if ( levelID >= nlevs )
+            cdoAbort("Internal error - too high levelID");                              
+        }
+      tsID++;
+    }
+  
+  for ( eofID = 0; eofID < neof; eofID++) streamClose(streamIDs[eofID]);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+  
+  cdoFinish();
+
+  return (0);
+}
+
diff --git a/src/Eofcoeff3d.c b/src/Eofcoeff3d.c
new file mode 100644
index 0000000..2d8d091
--- /dev/null
+++ b/src/Eofcoeff3d.c
@@ -0,0 +1,271 @@
+/*
+ This file is part of CDO. CDO is a collection of Operators to
+ manipulate and analyse Climate model Data.
+ 
+ Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+ See COPYING file for copying and redistribution conditions.
+ 
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; version 2 of the License.
+ 
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ GNU General Public License for more details.
+ */
+
+/*
+ This module contains the following operators:
+ 
+ Eofcoeff             eofcoeff             process eof coefficients
+*/
+#define WEIGHTS 1
+
+#include "cdi.h"
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+// NO MISSING VALUE SUPPORT ADDED SO FAR
+
+void *Eofcoeff3d(void * argument)
+{
+  char eof_name[6], oname[1024], filesuffix[32];
+  double *w;
+  double missval1 = -999, missval2 = -999;
+  double *xvals, *yvals, *zvals;  
+  field_t ***eof;  
+  field_t in;  
+  field_t **out;
+  int operatorID, operfunc;  
+  int gridsize;
+  int i, varID, recID, levelID, tsID, eofID, *varID3;    
+  int gridID1, gridID2, gridID3;
+  int nrecs, nvars, nlevs, neof, nchars, nmiss, ngrids; 
+  int reached_eof;
+  int streamID1, streamID2, *streamIDs;
+  int taxisID1, taxisID2, taxisID3;
+  int vlistID1, vlistID2, vlistID3;
+  int zaxisID3;
+   
+  cdoInitialize(argument);
+  cdoOperatorAdd("eofcoeff3d",  0,       0, NULL);
+  operatorID = cdoOperatorID();
+  //  operfunc = cdoOperatorFunc(operatorID);
+     
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  
+  taxisID1 = vlistInqTaxis(vlistID1);  
+  taxisID2 = vlistInqTaxis(vlistID2); 
+  taxisID3 = taxisDuplicate(taxisID2);
+  
+  gridID1 = vlistInqVarGrid(vlistID1, 0);
+  gridID2 = vlistInqVarGrid(vlistID2, 0);
+  
+  if ( vlistGridsizeMax(vlistID1)==vlistGridsizeMax(vlistID2) )
+    gridsize = vlistGridsizeMax(vlistID1);  
+  else 
+    {
+      gridsize = -1;
+      cdoAbort("Gridsize of input files does not match");
+    }
+      
+  
+  if ( vlistNgrids(vlistID2) > 1 || vlistNgrids(vlistID1) > 1 )
+    cdoAbort("Too many grids in input");
+  
+  nvars = vlistNvars(vlistID1)==vlistNvars(vlistID2) ? vlistNvars(vlistID1) : -1;
+  nrecs = vlistNrecs(vlistID1); 
+  nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, 0));
+  w = (double*)malloc(gridsize*sizeof(double));
+  gridWeights(gridID2, &w[0]);
+  
+  
+  if (vlistGridsizeMax(vlistID2)   != gridsize ||
+      vlistInqVarGrid(vlistID2, 0) != gridID1 )
+    cdoAbort("EOFs (%s) and data (%s) defined on different grids", cdoStreamName(0), cdoStreamName(1));    
+ 
+  strcpy(oname, cdoStreamName(2));
+  nchars = strlen(oname);
+  
+  filesuffix[0] = 0;
+  cdoGenFileSuffix(filesuffix, sizeof(filesuffix), cdoDefaultFileType, vlistID1);
+ 
+  eof = (field_t ***) malloc (nvars * sizeof(field_t**) );
+  for ( varID=0; varID<nvars; varID++)
+    eof[varID] = (field_t **) malloc(nlevs*sizeof(field_t*));
+  reached_eof=0;
+  eofID = 0;
+  while ( 1 )       
+   {     
+     nrecs = streamInqTimestep(streamID1, eofID);
+     if ( nrecs == 0)
+       {
+         reached_eof = 1;
+         break;
+       }
+     for ( recID = 0; recID < nrecs; recID++ )
+       {         
+         streamInqRecord(streamID1, &varID, &levelID);
+         missval1 = vlistInqVarMissval(vlistID1, varID);
+         if ( eofID == 0 )
+           eof[varID][levelID] = (field_t*) malloc (1*sizeof(field_t));
+         else
+           eof[varID][levelID] = (field_t*) realloc (eof[varID][levelID], (eofID+1)*sizeof(field_t));
+         eof[varID][levelID][eofID].grid   = gridID1;
+         eof[varID][levelID][eofID].nmiss  = 0;
+         eof[varID][levelID][eofID].missval= missval1;
+         eof[varID][levelID][eofID].ptr    = (double*)malloc(gridsize*sizeof(double));
+         memset(&eof[varID][levelID][eofID].ptr[0], missval1, gridsize*sizeof(double));
+
+         if ( varID >= nvars )
+           cdoAbort("Internal error - too high varID");
+         if ( levelID >= nlevs )
+           cdoAbort("Internal error - too high levelID");
+         
+         streamReadRecord(streamID1, eof[varID][levelID][eofID].ptr, 
+                          &eof[varID][levelID][eofID].nmiss);
+       }
+     eofID++;
+   }
+  neof = eofID;  
+  
+  if ( cdoVerbose ) cdoPrint("%s contains %i eof's", cdoStreamName(0), neof);
+  // Create 1x1 Grid for output
+  gridID3 = gridCreate(GRID_LONLAT, 1);
+  gridDefXsize(gridID3, 1);
+  gridDefYsize(gridID3, 1);
+  xvals=(double*)malloc(1*sizeof(double));
+  yvals=(double*)malloc(1*sizeof(double));
+  xvals[0]=0;
+  yvals[0]=0;
+  gridDefXvals(gridID3, xvals);
+  gridDefYvals(gridID3, yvals);
+  
+  zvals = (double *) malloc ( 1* sizeof(double ) );
+  zvals[0] = 0.;
+  zaxisID3 = zaxisCreate(ZAXIS_GENERIC,1);
+  zaxisDefLevels(zaxisID3,zvals);
+  zaxisDefName(zaxisID3,"zaxis_Reduced");
+  zaxisDefLongname(zaxisID3,"Reduced zaxis from EOF3D - only one coefficient per 3D eigenvector and time step");
+  
+  vlistID3 = vlistCreate();
+  vlistDefTaxis(vlistID3,taxisID3);
+  varID3 = (int *) malloc ( nvars * sizeof(int) );
+  for ( varID=0; varID<nvars; varID++ )
+    varID3[varID] = vlistDefVar(vlistID3, gridID3, zaxisID3, TSTEP_INSTANT);
+  
+  // open streams for eofcoeff output
+  streamIDs = (int *) malloc (neof*sizeof(int)); 
+  eofID = 0;
+  for ( eofID = 0; eofID < neof; eofID++)
+    {
+      oname[nchars] = '\0';                       
+
+      sprintf(eof_name, "%5.5i", eofID);
+      strcat(oname, eof_name);
+      if ( filesuffix[0] )
+        strcat(oname, filesuffix);
+      
+      streamIDs[eofID] = streamOpenWrite(oname, cdoFiletype());
+      if (cdoVerbose) 
+        cdoPrint("opened %s ('w')  as stream%i for %i. eof", oname, streamIDs[eofID], eofID+1);
+      
+      streamDefVlist(streamIDs[eofID], vlistID3);
+    }
+  
+  // ALLOCATE temporary fields for data read and write
+  in.ptr = (double*) malloc(gridsize*sizeof(double));
+  in.grid = gridID1;  
+  out = (field_t **) malloc (nvars*sizeof(field_t*));
+  for ( varID = 0; varID < nvars; varID++ ) {
+    out[varID] = (field_t*) malloc ( neof * sizeof(field_t) );
+    for ( eofID=0; eofID<neof; eofID++ ) {
+      out[varID][eofID].missval = missval1;
+      out[varID][eofID].nmiss = 0;
+      out[varID][eofID].ptr = (double *) malloc (1*sizeof(double));
+    }
+  }
+
+  reached_eof=0;
+  tsID=0;
+  while ( 1 )
+    {      
+      nrecs = streamInqTimestep(streamID2, tsID);
+      if ( nrecs == 0 )
+        {
+          reached_eof=1;
+          break;
+        }
+
+      for ( varID = 0; varID < nvars; varID++ )
+	for ( eofID = 0; eofID < neof; eofID++ ) {
+	  out[varID][eofID].ptr[0]  = 0;
+	  out[varID][eofID].grid    = gridID3;
+	  out[varID][eofID].missval = missval2;            
+	}
+
+      taxisCopyTimestep(taxisID3, taxisID2);
+
+      for ( recID =0; recID< nrecs; recID++ )
+        {
+          streamInqRecord(streamID2, &varID, &levelID);
+          missval2 = vlistInqVarMissval(vlistID2, varID);
+          streamReadRecord(streamID2, in.ptr, &in.nmiss);  
+
+          
+          for (eofID = 0; eofID < neof; eofID++ )
+            {
+              if ( recID == 0 ) streamDefTimestep(streamIDs[eofID],tsID);
+
+	      nmiss = 0;
+              for(i=0;i<gridsize;i++)
+                {                  
+                  if (! DBL_IS_EQUAL(in.ptr[i],missval2) && 
+                      ! DBL_IS_EQUAL(eof[varID][levelID][eofID].ptr[i],missval1 ) )
+                    {
+                      double tmp = w[i]*in.ptr[i]*eof[varID][levelID][eofID].ptr[i];
+                      out[varID][eofID].ptr[0] += tmp;                   
+                    }
+		  else
+		    nmiss += 1;
+                }            
+
+              if ( nmiss ) {
+		out[varID][eofID].nmiss=1;
+		out[varID][eofID].ptr[0]=missval2;
+	      }
+            }
+
+          if ( varID >= nvars )
+            cdoAbort("Internal error - too high varID");
+          if ( levelID >= nlevs )
+            cdoAbort("Internal error - too high levelID");                              
+        }
+
+      for ( eofID = 0; eofID < neof; eofID++ ) {
+	for ( varID = 0; varID < nvars; varID++ ) {
+	  streamDefRecord(streamIDs[eofID], varID, 0);
+	  streamWriteRecord(streamIDs[eofID],out[varID][eofID].ptr,out[varID][eofID].nmiss);
+	}
+      }
+
+      tsID++;
+    }
+  
+  for ( eofID = 0; eofID < neof; eofID++) streamClose(streamIDs[eofID]);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+  
+  cdoFinish();
+
+  return (0);
+}
+
diff --git a/src/Exprf.c b/src/Exprf.c
new file mode 100644
index 0000000..9691ff7
--- /dev/null
+++ b/src/Exprf.c
@@ -0,0 +1,279 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Exprf      expr            Evaluate expressions
+      Exprf      exprf           Evaluate expressions from script file
+      Exprf      aexpr           Append evaluated expressions
+      Exprf      aexprf          Append evaluated expressions from script file
+*/
+/*
+Operatoren: +, -, *, \, ^
+Functions: sqrt, exp, log, log10, sin, cos, tan, asin, acos, atan
+Functions: min, max, avg, std, var
+Constansts: M_PI, M_E
+*/
+
+#include <sys/types.h> /* stat */
+#include <sys/stat.h>  /* stat */
+#include <unistd.h>    /* stat */
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "expr.h"
+
+
+void *Expr(void *argument)
+{
+  int EXPR, EXPRF, AEXPR, AEXPRF;
+  int operatorID;
+  char *exprs = NULL;
+  const char *exprf = NULL;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int offset;
+  int nrecs, nvars, nvars2;
+  int gridID, zaxisID;
+  int tsID, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int gridsize, nlevel;
+  int nmiss;
+  int taxisID1, taxisID2;
+  int lwarn = TRUE;
+  double missval;
+  double *array = NULL;
+  double *single1, *single2;
+  parse_parm_t parse_arg;
+  void *scanner;
+  int yy_scan_string(const char *str, void *scanner);
+
+  cdoInitialize(argument);
+
+  yylex_init(&scanner);
+  yyset_extra(&parse_arg, scanner);
+
+  EXPR   = cdoOperatorAdd("expr",   0, 0, "expressions");
+  EXPRF  = cdoOperatorAdd("exprf",  0, 0, "expr script filename");
+  AEXPR  = cdoOperatorAdd("aexpr",  0, 0, "expressions");
+  AEXPRF = cdoOperatorAdd("aexprf", 0, 0, "expr script filename");
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  if ( operatorID == EXPR || operatorID == AEXPR )
+    {
+      size_t slen;
+
+      slen = strlen(operatorArgv()[0]);
+      exprs = (char *) malloc(slen+2);
+      strcpy(exprs, operatorArgv()[0]);
+      if ( exprs[slen-1] != ';' )
+	{
+	  exprs[slen]   = ';';
+	  exprs[slen+1] = 0;
+	}
+    }
+  else
+    {
+      int ichar, ipos = 0;
+      FILE *fp;
+      size_t fsize;
+      struct stat filestat;
+
+      exprf = operatorArgv()[0];
+
+      /* Open script file for reading */
+      if( (fp = fopen(exprf, "r")) == NULL ) cdoAbort("Open failed on %s", exprf);
+
+      if ( stat(exprf, &filestat) != 0 ) cdoAbort("Stat failed on %s", exprf);
+
+      fsize = (size_t) filestat.st_size;
+      exprs = (char *) malloc(fsize+1);
+
+      while ( (ichar = fgetc(fp)) != EOF ) exprs[ipos++] = ichar;
+
+      exprs[ipos] = 0;
+
+      if ( ipos == 0 ) cdoAbort("%s is empty!", exprf);
+
+      fclose(fp);
+    }
+
+  if ( cdoVerbose ) cdoPrint(exprs);
+
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  nvars = vlistNvars(vlistID1);
+
+  if ( operatorID == EXPR || operatorID == EXPRF )
+    vlistID2 = vlistCreate();
+  else
+    vlistID2 = vlistDuplicate(vlistID1);
+
+  parse_arg.init = 1;
+  parse_arg.vlistID1 = vlistID1;
+  parse_arg.vlistID2 = vlistID2;
+  parse_arg.nvars1   = 0;
+  parse_arg.debug    = 0;
+  parse_arg.gridID2  = -1;
+  parse_arg.zaxisID2 = -1;
+  parse_arg.tsteptype2  = -1;
+  for ( varID = 0; varID < nvars; varID++ )
+    parse_arg.var_needed[varID] = FALSE;
+
+  yy_scan_string(exprs, scanner);
+  yyparse(&parse_arg, scanner);
+
+  parse_arg.init = 0;
+
+  nvars2 = vlistNvars(vlistID2);
+  if ( nvars2 == 0 ) cdoAbort("No output variable found!");
+
+  if ( cdoVerbose ) vlistPrint(vlistID2);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( parse_arg.var_needed[varID] && cdoVerbose )
+      printf("var_needed: %d %s\n", varID, parse_arg.var[varID]);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  parse_arg.vardata1 = (double **) malloc(nvars*sizeof(double*));
+  parse_arg.vardata2 = (double **) malloc(nvars2*sizeof(double*));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID  = vlistInqVarGrid(vlistID1, varID);
+      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+      /* parse_arg.missval[varID] = vlistInqVarMissval(vlistID1, varID); */
+
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(zaxisID);
+      if ( parse_arg.var_needed[varID] )
+	parse_arg.vardata1[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+      else
+	parse_arg.vardata1[varID] = NULL;
+    }
+
+  for ( varID = 0; varID < nvars2; varID++ )
+    {
+      gridID  = vlistInqVarGrid(vlistID2, varID);
+      zaxisID = vlistInqVarZaxis(vlistID2, varID);
+
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(zaxisID);
+      parse_arg.vardata2[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+    }
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( varID = 0; varID < nvars; varID++ ) parse_arg.nmiss[varID] = 0;
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  if ( parse_arg.var_needed[varID] )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      offset   = gridsize*levelID;
+	      single1  = parse_arg.vardata1[varID] + offset;
+	      streamReadRecord(streamID1, single1, &nmiss);
+	      parse_arg.nmiss[varID] += nmiss;
+	      /*
+	      if ( nmiss && lwarn )
+		{
+		  cdoWarning("Missing values unsupported for this operator!");
+		  lwarn = FALSE;
+		}
+	      */
+	    }
+	}
+
+      for ( varID = 0; varID < nvars2; varID++ )
+	{
+	  gridID   = vlistInqVarGrid(vlistID2, varID);
+	  zaxisID  = vlistInqVarZaxis(vlistID2, varID);
+	  gridsize = gridInqSize(gridID);
+	  nlevel   = zaxisInqSize(zaxisID);
+
+	  memset(parse_arg.vardata2[varID], 0, gridsize*nlevel*sizeof(double));
+	}
+
+      yy_scan_string(exprs, scanner);
+      yyparse(&parse_arg, scanner);
+
+      for ( varID = 0; varID < nvars2; varID++ )
+	{
+	  gridID   = vlistInqVarGrid(vlistID2, varID);
+	  zaxisID  = vlistInqVarZaxis(vlistID2, varID);
+	  missval  = vlistInqVarMissval(vlistID2, varID);
+
+	  gridsize = gridInqSize(gridID);
+	  nlevel   = zaxisInqSize(zaxisID);
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      long i;
+	      offset   = gridsize*levelID;
+	      single2  = parse_arg.vardata2[varID] + offset;
+
+	      nmiss = 0;
+	      for ( i = 0; i < gridsize; i++ )
+		if ( DBL_IS_EQUAL(single2[i], missval) ) nmiss++;
+
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, single2, nmiss);
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID2);
+
+  yylex_destroy(scanner);
+
+  if ( array ) free(array);
+  if ( exprs ) free(exprs);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/FC.c b/src/FC.c
new file mode 100644
index 0000000..8301590
--- /dev/null
+++ b/src/FC.c
@@ -0,0 +1,315 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      FC         fc2sp           Fourier to spectral
+      FC         sp2fc           Spectral to fourier
+      FC         fc2gp           Fourier to gridpoint
+      FC         gp2fc           Gridpoint to fourier
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "specspace.h"
+#include "list.h"
+
+
+void *FC(void *argument)
+{
+  int FC2SP, SP2FC, FC2GP, GP2FC;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs, nvars;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int index, ngrids;
+  int vlistID1, vlistID2;
+  int gridIDsp = -1, gridIDgp = -1, gridIDfc = -1;
+  int gridID1 = -1, gridID2 = -1;
+  int gridID;
+  int nmiss;
+  int *vars;
+  int lcopy = FALSE;
+  int taxisID1, taxisID2;
+  int nlon = 0, nlat = 0, ntr = 0;
+  int nsp = 0, nfc = 0;
+  double *array1 = NULL, *array2 = NULL;
+  SPTRANS *sptrans = NULL;
+
+  cdoInitialize(argument);
+
+  FC2SP  = cdoOperatorAdd("fc2sp",  0, 0, NULL);
+  SP2FC  = cdoOperatorAdd("sp2fc", 0, 0, NULL);
+  FC2GP  = cdoOperatorAdd("fc2gp",  0, 0, NULL);
+  GP2FC  = cdoOperatorAdd("gp2fc", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids = vlistNgrids(vlistID1);
+  /* find first spectral grid */
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID = vlistGrid(vlistID1, index);
+      if ( gridInqType(gridID) == GRID_SPECTRAL )
+	{
+	  gridIDsp = gridID;
+	  break;
+	}
+    }
+  /* find first gaussian grid */
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID = vlistGrid(vlistID1, index);
+      if ( gridInqType(gridID) == GRID_GAUSSIAN )
+	{
+	  gridIDgp = gridID;
+	  break;
+	}
+    }
+  /* find first fourier grid */
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID = vlistGrid(vlistID1, index);
+      if ( gridInqType(gridID) == GRID_FOURIER )
+	{
+	  gridIDfc = gridID;
+	  break;
+	}
+    }
+
+  /* define output grid */
+  if ( operatorID == FC2SP )
+    {
+      if ( gridIDfc == -1 ) cdoWarning("No fourier data found!");
+
+      gridID1 = gridIDfc;
+
+      if ( gridID1 != -1 )
+	{
+	  nfc  = gridInqSize(gridID1);
+	  ntr  = gridInqTrunc(gridID1);
+	  nlat = nfc2nlat(nfc, ntr);
+
+	  if ( gridIDsp != -1 )
+	    if ( ntr != gridInqTrunc(gridIDsp) ) gridIDsp = -1;
+
+	  if ( gridIDsp == -1 )
+	    {
+	      nsp = (ntr+1)*(ntr+2);
+	      gridIDsp = gridCreate(GRID_SPECTRAL, nsp);
+	      gridDefTrunc(gridIDsp, ntr);
+	      gridDefComplexPacking(gridIDsp, 1);
+	    }
+
+	  gridID2 = gridIDsp;
+	  nlon = 2*nlat;
+	  ntr  = gridInqTrunc(gridID2);
+
+	  sptrans = sptrans_new(nlon, nlat, ntr, 0);
+	}
+    }
+  else if ( operatorID == SP2FC )
+    {   
+      if ( gridIDsp == -1 ) cdoWarning("No spectral data found!");
+
+      gridID1 = gridIDsp;
+
+      if ( gridID1 != -1 )
+	{
+	  ntr  = gridInqTrunc(gridID1);
+	  nlat = ntr2nlat(ntr);
+
+	  if ( gridIDfc != -1 )
+	    {
+	      if ( ntr != gridInqTrunc(gridIDfc) ) gridIDfc = -1;
+	    }
+
+	  if ( gridIDfc == -1 )
+	    {
+	      nfc = 2*nlat*(ntr+1);
+              gridIDfc = gridCreate(GRID_FOURIER, nfc);
+	      gridDefTrunc(gridIDfc, ntr);
+	    }
+
+	  gridID2 = gridIDfc;
+	  nlon = 2*nlat;
+      
+	  sptrans = sptrans_new(nlon, nlat, ntr, 0);
+	}
+    }
+  else if ( operatorID == GP2FC )
+    {
+      if ( gridIDgp == -1 ) cdoWarning("No Gaussian grid data found!");
+
+      gridID1 = gridIDgp;
+
+      if ( gridID1 != -1 )
+	{
+	  nlon = gridInqXsize(gridID1);
+	  nlat = gridInqYsize(gridID1);
+	  ntr  = nlat2ntr(nlat);
+
+	  if ( gridIDfc != -1 )
+	    if ( ntr != gridInqTrunc(gridIDfc) ) gridIDfc = -1;
+
+	  if ( gridIDfc == -1 )
+	    {
+	      nfc = 2*nlat*(ntr+1);
+	      gridIDfc = gridCreate(GRID_FOURIER, nfc);
+	      gridDefTrunc(gridIDfc, ntr);
+	    }
+
+	  gridID2 = gridIDfc;
+	  nfc  = gridInqSize(gridID2);
+
+	  sptrans = sptrans_new(nlon, nlat, ntr, 0);
+ 	}
+    }
+  else if ( operatorID == FC2GP )
+    {   
+      if ( gridIDfc == -1 ) cdoWarning("No fourier data found!");
+
+      gridID1 = gridIDfc;
+
+      if ( gridID1 != -1 )
+	{
+	  nfc  = gridInqSize(gridID1);
+	  ntr  = gridInqTrunc(gridID1);
+	  nlat = nfc2nlat(nfc, ntr);
+
+	  if ( gridIDgp != -1 )
+	    {
+	      if ( nlat != gridInqYsize(gridIDgp) ) gridIDgp = -1;
+	    }
+
+	  if ( gridIDgp == -1 )
+	    {
+	      char gridname[20];
+	      sprintf(gridname, "t%dgrid", ntr);
+
+	      gridIDgp = gridFromName(gridname);
+	    }
+
+	  gridID2 = gridIDgp;
+	  nlon = gridInqXsize(gridID2);
+	  nlat = gridInqYsize(gridID2);
+      
+	  sptrans = sptrans_new(nlon, nlat, ntr, 0);
+	}
+    }
+
+  // printf("nfc %d, ntr %d, nlat %d, nlon %d\n", nfc, ntr, nlat, nlon);
+
+  nvars = vlistNvars(vlistID2);
+  vars  = (int *) malloc(nvars*sizeof(int));
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( gridID1 == vlistInqVarGrid(vlistID1, varID) )
+	vars[varID] = TRUE;
+      else
+	vars[varID] = FALSE;
+    }
+
+  if ( gridID1 != -1 ) vlistChangeGrid(vlistID2, gridID1, gridID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array1 = (double *) malloc(gridsize*sizeof(double));
+
+  if ( gridID2 != -1 )
+    {
+      gridsize = gridInqSize(gridID2);
+      array2 = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( vars[varID] )
+	    {
+	      streamReadRecord(streamID1, array1, &nmiss);
+	      if ( nmiss ) cdoAbort("Missing values unsupported for spectral/fourier data!");
+
+	      gridID1 = vlistInqVarGrid(vlistID1, varID);
+	      if ( operatorID == FC2SP )
+		four2spec(sptrans, gridID1, array1, gridID2, array2);	      
+	      else if ( operatorID == SP2FC )
+		spec2four(sptrans, gridID1, array1, gridID2, array2);
+	      else if ( operatorID == FC2GP )
+		four2grid(sptrans, gridID1, array1, gridID2, array2);	      
+	      else if ( operatorID == GP2FC )
+		grid2four(sptrans, gridID1, array1, gridID2, array2);
+
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, array2, nmiss);  
+	    }   
+	  else
+	    {
+	      streamDefRecord(streamID2, varID, levelID);
+	      if ( lcopy )
+		{
+		  streamCopyRecord(streamID2, streamID1);
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array1, &nmiss);
+		  streamWriteRecord(streamID2, array1, nmiss);
+		}
+	    }    
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+  if ( vars )   free(vars);
+
+  sptrans_delete(sptrans);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Filedes.c b/src/Filedes.c
new file mode 100644
index 0000000..3941727
--- /dev/null
+++ b/src/Filedes.c
@@ -0,0 +1,386 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Filedes    pardes          Parameter description
+      Filedes    griddes         Grid description
+      Filedes    vct             Vertical coordinate table
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+
+static
+void printAtts(FILE *fp, int vlistID, int varID)
+{
+#define MAXATT 8192
+  int natts, ia;
+  char attname[1024];
+  int atttype, attlen;
+  char atttxt[MAXATT];
+  int attint[MAXATT];
+  double attflt[MAXATT];
+  int i;
+
+  vlistInqNatts(vlistID, varID, &natts);
+
+  for ( ia = 0; ia < natts; ++ia )
+    {
+      vlistInqAtt(vlistID, varID, ia, attname, &atttype, &attlen);
+      if ( atttype == DATATYPE_INT )
+	{
+	  if ( attlen > MAXATT ) attlen = MAXATT;
+	  vlistInqAttInt(vlistID, varID, attname, attlen, attint);
+	  fprintf(fp, "  %s=", attname);
+	  for ( i = 0; i < attlen; ++i)
+	    {
+	      if ( i > 0 ) fprintf(fp, ", ");
+	      fprintf(fp, "%d", attint[i]);
+	    }
+	  fprintf(fp, "\n");
+	}
+      else if ( atttype == DATATYPE_FLT )
+	{
+	  if ( attlen > MAXATT ) attlen = MAXATT;
+	  vlistInqAttFlt(vlistID, varID, attname, MAXATT, attflt);
+	  fprintf(fp, "  %s=", attname);
+	  for ( i = 0; i < attlen; ++i)
+	    {
+	      if ( i > 0 ) fprintf(fp, ", ");
+	      fprintf(fp, "%g", attflt[i]);
+	    }
+	  fprintf(fp, "\n");
+	}
+      else if ( atttype == DATATYPE_TXT )
+	{
+	  vlistInqAttTxt(vlistID, varID, attname, sizeof(atttxt), atttxt);
+	  atttxt[attlen] = 0;
+	  fprintf(fp, "  %s=\"%s\"\n", attname, atttxt);
+	}
+    }
+}
+
+static
+void partab(FILE *fp, int vlistID, int option)
+{
+  int varID, code, tabnum, tableID, datatype = -1;
+  char pstr[32];
+  char varname[CDI_MAX_NAME], varlongname[CDI_MAX_NAME], varstdname[CDI_MAX_NAME], varunits[CDI_MAX_NAME];
+  int natts;
+  int nvars;
+  int chunktype;
+  double missval;
+      
+  nvars  = vlistNvars(vlistID);
+
+  if ( option == 2 )
+    {
+      vlistInqNatts(vlistID, CDI_GLOBAL, &natts);
+      if ( natts > 0 )
+	{
+	  fprintf(fp, "&parameter\n");
+	  fprintf(fp, "  name=_GLOBAL_\n");
+	  printAtts(fp, vlistID, CDI_GLOBAL);
+	  fprintf(fp, "/\n");
+	}
+    }
+
+  if ( nvars > 1 )
+    {
+      datatype = vlistInqVarDatatype(vlistID, 0);
+      for ( varID = 1; varID < nvars; varID++ )
+	{
+	  if ( datatype != vlistInqVarDatatype(vlistID, varID) )
+	    {
+	      datatype = -1;
+	      break;
+	    }
+	}
+
+      if ( datatype != -1 )
+	{
+	  fprintf(fp, "&parameter\n");
+	  fprintf(fp, "  name=_default_\n");
+	  if ( datatype2str(datatype, pstr) == 0 )
+	    fprintf(fp, "  datatype=%s\n", pstr);
+	  fprintf(fp, "/\n");
+	}
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      fprintf(fp, "&parameter\n");
+      
+      varname[0]     = 0;
+      varlongname[0] = 0;
+      varunits[0]    = 0;
+      code     = vlistInqVarCode(vlistID, varID);
+      tableID  = vlistInqVarTable(vlistID, varID);
+      tabnum   = tableInqNum(tableID);
+      missval  = vlistInqVarMissval(vlistID, varID);
+      vlistInqVarName(vlistID, varID, varname);
+      /* printf("1>%s<\n", varname); */
+      vlistInqVarStdname(vlistID, varID, varstdname);
+      /* printf("2>%s<\n", varname); */
+      vlistInqVarLongname(vlistID, varID, varlongname);
+      /* printf("3>%s<\n", varname); */
+      vlistInqVarUnits(vlistID, varID, varunits);
+            
+      fprintf(fp, "  name=%s\n", varname);
+      if ( code   > 0 ) fprintf(fp, "  code=%d\n", code);
+      if ( tabnum > 0 ) fprintf(fp, "  table=%d\n", tabnum);
+      if ( strlen(varstdname) )
+	fprintf(fp, "  standard_name=%s\n", varstdname);
+      if ( strlen(varlongname) )
+	fprintf(fp, "  long_name=\"%s\"\n", varlongname);
+      if ( strlen(varunits) )
+	fprintf(fp, "  units=\"%s\"\n", varunits);
+      
+      if ( datatype == -1 )
+	if ( datatype2str(vlistInqVarDatatype(vlistID, varID), pstr) == 0 )
+	  fprintf(fp, "  datatype=%s\n", pstr);
+
+      chunktype = vlistInqVarChunkType(vlistID, varID);
+      if ( chunktype == CHUNK_AUTO )
+	fprintf(fp, "  chunktype=auto\n");
+      else if ( chunktype == CHUNK_GRID )
+	fprintf(fp, "  chunktype=grid\n");
+      if ( chunktype == CHUNK_LINES )
+	fprintf(fp, "  chunktype=lines\n");
+	
+      
+      if ( option == 2 ) printAtts(fp, vlistID, varID);
+      if ( option == 2 ) 
+	fprintf(fp, "  missing_value=%g\n", missval);
+      
+      fprintf(fp, "/\n");
+    }   
+}
+
+static
+void filedes(int streamID)
+{
+  int filetype;
+
+  printf("\n");
+  filetype = streamInqFiletype(streamID);
+  switch ( filetype )
+    {
+    case FILETYPE_GRB:
+      printf("  GRIB data\n");
+      break;
+    case FILETYPE_NC:
+      printf("  netCDF data\n");
+      break;
+    case FILETYPE_NC2:
+      printf("  netCDF2 data\n");
+      break;
+    case FILETYPE_NC4:
+      printf("  netCDF4 data\n");
+      break;
+    case FILETYPE_NC4C:
+      printf("  netCDF4 classic data\n");
+      break;
+    case FILETYPE_SRV:
+      printf("  SERVICE data\n");
+      switch ( streamInqByteorder(streamID) )
+	{
+	case CDI_BIGENDIAN:
+	  printf("  byteorder is BIGENDIAN\n"); break;
+	case CDI_LITTLEENDIAN:
+	  printf("  byteorder is LITTLEENDIAN\n"); break;
+	default:
+	  printf("  byteorder %d undefined\n", streamInqByteorder(streamID)); break;
+	}
+      break;
+    case FILETYPE_EXT:
+      printf("  EXTRA data\n");
+      switch ( streamInqByteorder(streamID) )
+	{
+	case CDI_BIGENDIAN:
+	  printf("  byteorder is BIGENDIAN\n"); break;
+	case CDI_LITTLEENDIAN:
+	  printf("  byteorder is LITTLEENDIAN\n"); break;
+	default:
+	  printf("  byteorder %d undefined\n", streamInqByteorder(streamID)); break;
+	}
+      break;
+    case FILETYPE_IEG:
+      printf("  IEG data\n");
+      switch ( streamInqByteorder(streamID) )
+	{
+	case CDI_BIGENDIAN:
+	  printf("  byteorder is BIGENDIAN\n"); break;
+	case CDI_LITTLEENDIAN:
+	  printf("  byteorder is LITTLEENDIAN\n"); break;
+	default:
+	  printf("  byteorder %d undefined\n", streamInqByteorder(streamID)); break;
+	}
+      break;
+    default:
+      printf("  unsupported filetype %d\n" , filetype);
+    }
+  
+  printf("\n");
+}
+
+
+void *Filedes(void *argument)
+{
+  int GRIDDES, GRIDDES2, ZAXISDES, VCT, VCT2, PARDES, FILEDES, VLIST, PARTAB, PARTAB2;
+  int operatorID;
+  int streamID = 0;
+  int zaxisID;
+  int nvars, ngrids, nzaxis;
+  int type, index;
+  int vlistID;
+
+  cdoInitialize(argument);
+
+  GRIDDES  = cdoOperatorAdd("griddes",   0, 0, NULL);
+  GRIDDES2 = cdoOperatorAdd("griddes2",  0, 0, NULL);
+  ZAXISDES = cdoOperatorAdd("zaxisdes",  0, 0, NULL);
+  VCT      = cdoOperatorAdd("vct",       0, 0, NULL);
+  VCT2     = cdoOperatorAdd("vct2",      0, 0, NULL);
+  PARDES   = cdoOperatorAdd("pardes",    0, 0, NULL);
+  FILEDES  = cdoOperatorAdd("filedes",   0, 0, NULL);
+  VLIST    = cdoOperatorAdd("vlist",     0, 0, NULL);
+  PARTAB   = cdoOperatorAdd("partab",    0, 0, NULL);
+  PARTAB2  = cdoOperatorAdd("partab2",   0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID = streamOpenRead(cdoStreamName(0));
+
+  vlistID = streamInqVlist(streamID);
+
+  nvars  = vlistNvars(vlistID);
+  ngrids = vlistNgrids(vlistID);
+  nzaxis = vlistNzaxis(vlistID);
+
+  if ( operatorID == GRIDDES || operatorID == GRIDDES2 )
+    {
+      int opt = 0;
+      if ( operatorID == GRIDDES ) opt = 1;
+      for ( index = 0; index < ngrids; index++ )
+	gridPrint(vlistGrid(vlistID, index), opt);
+    }
+  else if ( operatorID == ZAXISDES )
+    {
+      for ( index = 0; index < nzaxis; index++ )
+	zaxisPrint(vlistZaxis(vlistID, index));
+    }
+  else if ( operatorID == VCT || operatorID == VCT2 )
+    {
+      for ( index = 0; index < nzaxis; index++)
+	{
+	  zaxisID = vlistZaxis(vlistID, index);
+	  type = zaxisInqType(zaxisID);
+	  if ( type == ZAXIS_HYBRID || type == ZAXIS_HYBRID_HALF )
+	    {
+	      int i, vctsize;
+	      const double *vct;
+
+	      vctsize = zaxisInqVctSize(zaxisID);
+	      vct     = zaxisInqVctPtr(zaxisID);
+		
+	      if ( vctsize%2 == 0 )
+		{
+		  if ( operatorID == VCT )
+		    {
+		      for ( i = 0; i < vctsize/2; i++ )
+			fprintf(stdout, "%5d %25.17f %25.17f\n", i, vct[i], vct[vctsize/2+i]);
+		    }
+		  else
+		    {
+		      int nbyte0, nbyte;
+		      fprintf(stdout, "vctsize   = %d\n", vctsize);
+		      nbyte0 = fprintf(stdout, "vct       = ");
+		      nbyte = nbyte0;
+		      for ( i = 0; i < vctsize; i++ )
+			{
+			  if ( nbyte > 70 || i == vctsize/2 )
+			    {
+			      fprintf(stdout, "\n%*s", nbyte0, "");
+			      nbyte = nbyte0;
+			    }
+			  nbyte += fprintf(stdout, "%.9g ", vct[i]);
+			}
+		      fprintf(stdout, "\n");
+		    }
+		}
+	      else
+		for ( i = 0; i < vctsize; i++ )
+		  fprintf(stdout, "%5d %25.17f\n", i, vct[i]);
+
+	      break;
+	    }
+	}
+    }
+  else if ( operatorID == VLIST )
+    {
+      vlistPrint(vlistID);
+    }
+  else if ( operatorID == PARDES )
+    {
+      int varID, code;
+      char varname[CDI_MAX_NAME], varlongname[CDI_MAX_NAME], varunits[CDI_MAX_NAME];
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  varname[0]     = 0;
+	  varlongname[0] = 0;
+	  varunits[0]    = 0;
+	  code     = vlistInqVarCode(vlistID, varID);
+	  vlistInqVarName(vlistID, varID, varname);
+	  vlistInqVarLongname(vlistID, varID, varlongname);
+	  vlistInqVarUnits(vlistID, varID, varunits);
+	  fprintf(stdout, "%4d  %-12s", code, varname);
+	  if ( strlen(varlongname) )
+	    {
+	      fprintf(stdout, "  %s", varlongname);
+	      if ( strlen(varunits) )
+		fprintf(stdout, " [%s]", varunits);
+	    }
+	  fprintf(stdout, "\n");
+	}   
+    }
+  else if ( operatorID == PARTAB || operatorID == PARTAB2 )
+    {
+      int option = 1;
+
+      if ( operatorID == PARTAB2 ) option = 2;
+      
+      partab(stdout, vlistID, option);
+    }
+  else if ( operatorID == FILEDES )
+    {
+      filedes(streamID);
+    }
+
+  streamClose(streamID);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Fillmiss.c b/src/Fillmiss.c
new file mode 100644
index 0000000..25030d7
--- /dev/null
+++ b/src/Fillmiss.c
@@ -0,0 +1,238 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "interpol.h"
+
+
+void fillmiss(field_t *field1, field_t *field2, int nfill)
+{
+  int gridID, nx, ny, i, j;
+  int nmiss1, nmiss2 = 0;
+  int kr, ku, kl, ko;
+  int ir, iu, il, io;
+  int kh, kv, k1, k2, kk;
+  int globgrid = 1;
+  double s1, s2;
+  double xr, xu, xl, xo;
+  double missval;
+  double *array1, *array2;
+  double **matrix1, **matrix2;
+
+  gridID  = field1->grid;
+  nmiss1  = field1->nmiss;
+  missval = field1->missval;
+  array1  = field1->ptr;
+  array2  = field2->ptr;
+
+  nx  = gridInqXsize(gridID);
+  ny  = gridInqYsize(gridID);
+
+  matrix1 = (double **) malloc(ny * sizeof(double *));
+  matrix2 = (double **) malloc(ny * sizeof(double *));
+
+  for ( j = 0; j < ny; j++ )
+    {
+      matrix1[j] = array1 + j*nx;
+      matrix2[j] = array2 + j*nx;
+    }
+
+  for ( j = 0; j < ny; j++ )
+    for ( i = 0; i < nx; i++ )
+      {
+	if ( DBL_IS_EQUAL(matrix1[j][i], missval) )
+	  {
+	    nmiss2++;
+
+	    kr = ku = kl = ko = 0;
+	    xr = xu = xl = xo = 0.;
+
+	    for ( ir = i + 1; ir < nx; ir++ )
+	      if ( !DBL_IS_EQUAL(matrix1[j][ir], missval) )
+		{ kr = ir - i; xr = matrix1[j][ir]; break; }
+
+	    if ( globgrid && ir == nx )
+	      {
+		for ( ir = 0; ir < i; ir++ )
+		  if ( !DBL_IS_EQUAL(matrix1[j][ir], missval) )
+		    { kr = nx + ir - i; xr = matrix1[j][ir]; break; }
+	      }
+
+	    for ( il = i-1; il >= 0; il-- )
+	      if ( !DBL_IS_EQUAL(matrix1[j][il], missval) )
+		{ kl = i - il; xl = matrix1[j][il]; break; }
+
+	    if ( globgrid && il == -1 )
+	      {
+		for ( il = nx-1; il > i; il-- )
+		  if ( !DBL_IS_EQUAL(matrix1[j][il], missval) )
+		    { kl = nx + i - il; xl = matrix1[j][il]; break; }
+	      }
+
+	    for ( iu = j + 1; iu < ny; iu++ )
+	      if ( !DBL_IS_EQUAL(matrix1[iu][i], missval) )
+		{ ku = iu - j; xu = matrix1[iu][i]; break; }
+	    
+	    for ( io = j - 1; io >= 0; io-- )
+	      if ( !DBL_IS_EQUAL(matrix1[io][i], missval) )
+		{ ko = j - io; xo = matrix1[io][i]; break; }
+	    
+	    /*  printf("%d %d %d %d %d %d %g %g %g %g\n", j,i,kr,kl,ku,ko,xr,xl,xu,xo);*/
+
+	    kh = kl + kr;
+	    kv = ko + ku;
+	    if      ( kh == 0 ) { s1 = 0.; k1 = 0; }
+	    else if ( kl == 0 ) { s1 = xr; k1 = 1; }
+	    else if ( kr == 0 ) { s1 = xl; k1 = 1; }
+	    else { s1 = xr*kl/kh + xl*kr/kh; k1 = 2; }
+
+	    if      ( kv == 0 ) { s2 = 0.; k2 = 0; }
+	    else if ( ku == 0 ) { s2 = xo; k2 = 1; }
+	    else if ( ko == 0 ) { s2 = xu; k2 = 1; }
+	    else { s2 = xu*ko/kv + xo*ku/kv; k2 = 2; }
+
+	    kk = k1 + k2;
+	    if ( kk >= nfill )
+	      {
+		if      ( kk == 0 ) cdoAbort("no point found!");
+		else if ( k1 == 0 ) matrix2[j][i] = s2;
+		else if ( k2 == 0 ) matrix2[j][i] = s1;
+		else  matrix2[j][i] = s1*k2/kk + s2*k1/kk;
+	      }
+	    else
+	      matrix2[j][i] = matrix1[j][i];
+
+	    /* matrix1[j][i] = matrix2[j][i]; */
+	  }
+	else
+	  {
+	    matrix2[j][i] = matrix1[j][i];
+	  }
+      }
+
+  if ( nmiss1 != nmiss2 ) cdoAbort("found only %d of %d missing values!", nmiss2, nmiss1);
+
+  free(matrix2);
+  free(matrix1);
+}
+
+
+void *Fillmiss(void *argument)
+{
+  int streamID1, streamID2;
+  int nrecs, ngrids;
+  int index;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2;
+  int gridID1 = -1;
+  field_t field1, field2;
+  int taxisID1, taxisID2;
+  int nmiss, i, nfill = 1;
+
+  cdoInitialize(argument);
+
+  {
+    int oargc = operatorArgc();
+    char **oargv = operatorArgv();
+
+    if ( oargc == 1 )
+      {
+	nfill = atoi(oargv[0]);
+	if ( nfill < 1 || nfill > 4 ) cdoAbort("nfill out of range!");
+      }
+    else if ( oargc > 1 )
+      cdoAbort("Too many arguments!");
+  }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids = vlistNgrids(vlistID1);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID1 = vlistGrid(vlistID1, index);
+
+      if ( gridInqType(gridID1) == GRID_GME ||
+	   gridInqType(gridID1) == GRID_UNSTRUCTURED )
+	cdoAbort("Interpolation of %s data unsupported!", gridNamePtr(gridInqType(gridID1)) );
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  field1.ptr   = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr   = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field1.ptr, &field1.nmiss);
+
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID);
+	  field1.missval = vlistInqVarMissval(vlistID1, varID);
+
+	  field2.grid    = field1.grid;
+	  field2.nmiss   = 0;
+	  field2.missval = field1.missval;
+
+	  fillmiss(&field1, &field2, nfill);
+
+	  gridsize = gridInqSize(field2.grid);
+	  nmiss = 0;
+	  for ( i = 0; i < gridsize; ++i )
+	    if ( DBL_IS_EQUAL(field2.ptr[i], field2.missval) ) nmiss++;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, field2.ptr, nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( field2.ptr ) free(field2.ptr);
+  if ( field1.ptr ) free(field1.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Filter.c b/src/Filter.c
new file mode 100644
index 0000000..c7bea04
--- /dev/null
+++ b/src/Filter.c
@@ -0,0 +1,468 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+ 
+      Filter    highpass
+      Filter    lowpass
+      Filter    bandpass
+*/
+
+#if defined ( _USE_FFTW3 ) 
+#include <fftw3.h>
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+#include "stdlib.h"
+
+
+#define  NALLOC_INC  1000
+#define  PI2         6.2832
+#define  HALF        0.5
+
+/* FAST FOURIER TRANSFORMATION (bare) */
+static
+void fft2(double *real, double *imag, int n, int isign)
+{
+  int nn, mmax, m, j, istep, i;
+  double wtemp, wr, wpr, wpi, wi, theta, tempr, tempi, tmp;   
+  
+  if ( n < 2 || n&(n-1) ) printf("n must be power of 2\n");
+  nn = n << 1;
+  j = 1;
+  
+  /* BIT Reversion of data */
+  for ( i=1; i<nn; i+=2 )
+    {
+      if ( j > i ) 
+        {        
+          /* swap real part */
+          tmp = real[j/2]; 
+          real[j/2] = real[i/2];          
+          real[i/2] = tmp;                    
+          
+          /* swap imaginary part */
+          tmp = imag[j/2]; 
+          imag[j/2] = imag[i/2];
+          imag[i/2] = tmp;         
+        }
+      m = n;
+      while ( m >= 2 && j > m )
+        {
+          j -= m;
+          m >>= 1;
+        }
+      j += m;
+    }
+  
+  /* Danielson-Lanzcos algorithm */
+  mmax = 2;
+  while ( nn > mmax )
+    {
+      istep = mmax << 1;
+      theta = isign*(PI2/mmax);
+      wtemp = sin(HALF*theta);
+      wpr = -2.0*wtemp*wtemp;
+      wpi = sin(theta);
+      wr = 1.0;
+      wi = 0.0;
+      for( m = 1; m<mmax; m+=2 )
+        {
+          for ( i = m; i <= nn; i+=istep)
+            {              
+              j=i+mmax;         
+              tempr = wr*real[j/2]-wi*imag[j/2];
+              tempi = wr*imag[j/2]+wi*real[j/2];
+              real[j/2] = real[i/2]-tempr;
+              imag[j/2] = imag[i/2]-tempi;
+              real[i/2] += tempr;
+              imag[i/2] += tempi;       
+            }
+          wr = (wtemp=wr)*wpr-wi*wpi+wr;
+          wi = wi*wpr+wtemp*wpi+wi;
+        }
+      mmax = istep;      
+    }   
+  if ( isign == -1 )
+    for( i =0; i<n; i++)
+      {
+        real[i]/=n;
+        imag[i]/=n;
+      }
+}
+
+
+/* include from Tinfo.c */
+void getTimeInc(double jdelta, int vdate0, int vdate1, int *incperiod, int *incunit);
+
+static
+void create_fmasc(int nts, double fdata, double fmin, double fmax, int *fmasc)
+{
+  double dimin, dimax;
+  int i, imin, imax;
+  
+  dimin = nts*fmin / fdata;
+  dimax = nts*fmax / fdata;
+ 
+  imin = dimin<0 ? 0 : (int)floor(dimin);  
+  imax = ceil(dimax)>nts/2 ? nts/2 : (int) ceil(dimax);  
+  
+  fmasc[imin] = 1;
+  for ( i = imin+1; i <= imax; i++ )  
+    fmasc[i] = fmasc[nts-i] = 1; 
+  
+}
+
+
+#if defined ( _USE_FFTW3 ) 
+static
+void filter_fftw(int nts, const int *fmasc, 
+	    fftw_complex *fft_in, fftw_complex *fft_out, fftw_plan *p_T2S, fftw_plan *p_S2T)
+{  
+  //  fprintf(stderr,"using fftw filter\n");
+
+  int i;
+
+  fftw_execute(*p_T2S);
+
+  for ( i = 0; i < nts; i++ )
+    if ( ! fmasc[i] )   {
+      fft_out[i][0] = 0;
+      fft_out[i][1] = 0;
+    }
+  
+  fftw_execute(*p_S2T);
+  
+  return;
+}
+
+#else 
+
+static
+void filter_intrinsic(int nts, const int *fmasc, double *array1, double *array2)
+{  
+  int i;
+  
+  fft2(array1, array2, nts, 1);
+  for ( i = 0; i < nts; i++ )
+    if ( ! fmasc[i] )  array1[i] = array2[i] = 0;
+  fft2(array1, array2, nts, -1);
+  
+  return;
+}
+
+#endif
+
+void *Filter(void *argument)
+{
+  enum {BAND, HIGH, LOW};
+  char *tunits[] = {"second", "minute", "hour", "day", "month", "year"};
+  int iunits[] = {31536000, 525600, 8760, 365, 12, 1};
+  int operatorID;
+  int operfunc;
+  int gridsize;
+  int nrecs;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int i;
+  int nts,nts2;
+  int nalloc = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  dtinfo_t *dtinfo = NULL;
+  int tunit;
+  int incperiod0, incunit0, incunit, dpy, calendar;
+  int year0, month0, day0;
+  double missval;
+  double *array1, *array2;
+  double fdata = 0;
+  field_t ***vars = NULL;
+  double fmin = 0, fmax = 0;
+  int *fmasc;
+#if defined ( _USE_FFTW3 ) 
+  fftw_plan p_T2S, p_S2T;
+  fftw_complex *out_fft;
+  fftw_complex *in_fft;
+#endif
+  
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("bandpass",  BAND,  0, NULL);
+  cdoOperatorAdd("highpass",  HIGH,  0, NULL);
+  cdoOperatorAdd("lowpass" ,  LOW,   0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc   = cdoOperatorF1(operatorID);
+  
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  tunit = taxisInqTunit(taxisID1); 
+  calendar = taxisInqCalendar(taxisID1);  
+  dpy = calendar_dpy(calendar); /* should be 365 !!! */
+  
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+  
+  streamDefVlist(streamID2, vlistID2);
+  
+  nvars = vlistNvars(vlistID1);
+  
+  tsID = 0;    
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      if ( tsID >= nalloc )
+        {
+          nalloc += NALLOC_INC;
+	  dtinfo = (dtinfo_t *)  realloc(dtinfo, nalloc*sizeof(dtinfo_t));
+          vars   = (field_t ***) realloc(vars,   nalloc*sizeof(field_t **));
+        }
+                       
+      taxisInqDTinfo(taxisID1, &dtinfo[tsID]);
+   
+      vars[tsID] = (field_t **) malloc(nvars*sizeof(field_t *));
+      
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          gridID   = vlistInqVarGrid(vlistID1, varID);
+          missval  = vlistInqVarMissval(vlistID1, varID);
+          nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+          
+          vars[tsID][varID] = (field_t *) malloc(nlevel*sizeof(field_t));
+          
+          for ( levelID = 0; levelID < nlevel; levelID++ )
+            {
+              vars[tsID][varID][levelID].grid    = gridID;
+              vars[tsID][varID][levelID].missval = missval;
+              vars[tsID][varID][levelID].ptr     = NULL;
+            }
+        }
+      
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID1, &varID, &levelID);
+          gridID   = vlistInqVarGrid(vlistID1, varID);
+          gridsize = gridInqSize(gridID);
+          vars[tsID][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+          streamReadRecord(streamID1, vars[tsID][varID][levelID].ptr, &nmiss);
+          vars[tsID][varID][levelID].nmiss = nmiss;
+          if ( nmiss ) cdoAbort("Missing value support for operators in module Filter not added yet");
+        }
+
+      /* get and check time increment */                   
+      if ( tsID > 0)
+        {    
+	  juldate_t juldate0, juldate;
+	  double jdelta;
+	  int incperiod = 0;
+	  int year, month, day;
+
+          cdiDecodeDate(dtinfo[tsID].v.date,   &year,  &month,  &day);
+	  cdiDecodeDate(dtinfo[tsID-1].v.date, &year0, &month0, &day0);               
+
+          juldate0 = juldate_encode(calendar, dtinfo[tsID-1].v.date, dtinfo[tsID-1].v.time);        
+          juldate  = juldate_encode(calendar, dtinfo[tsID].v.date, dtinfo[tsID].v.time);         
+          jdelta   = juldate_to_seconds(juldate_sub(juldate, juldate0));
+          
+          if ( tsID == 1 ) 
+            {           
+              /*printf("%4i %4.4i-%2.2i-%2.2i\n", tsID, year, month, day);
+              printf("    %4.4i-%2.2i-%2.2i\n",     year0,month0,day0);*/
+              getTimeInc(jdelta, dtinfo[tsID-1].v.date, dtinfo[tsID].v.date, &incperiod0, &incunit0);
+              incperiod = incperiod0; 
+              if ( incperiod == 0 ) cdoAbort("Time step must be different from zero\n");
+              incunit = incunit0;
+              if ( cdoVerbose ) fprintf(stdout, "time step %i %s\n", incperiod, tunits[incunit]);
+              fdata = 1.*iunits[incunit]/incperiod;
+            }
+          else 
+            getTimeInc(jdelta, dtinfo[tsID-1].v.date, dtinfo[tsID].v.date, &incperiod, &incunit);  
+        
+
+	  if ( incunit0 < 4 && month == 2 && day == 29 && 
+	       ( day0 != day || month0 != month || year0 != year ) )
+	    {
+	      cdoWarning("Filtering of multi-year times series only works properly with 365-day-calendar.");
+	      cdoWarning("  Please delete the day %i-02-29 (cdo del29feb)", year);
+	    }
+
+          if ( ! ( incperiod == incperiod0 && incunit == incunit0 ) )
+            cdoWarning("Time increment in step %i (%d%s) differs from step 0 (%d%s)",
+		       tsID, incperiod, tunits[incunit], incperiod0, tunits[incunit0]);        
+        }
+      tsID++;
+    }
+  
+  nts = tsID;
+  /*  round up nts to next power of two for (better) performance 
+   ** of fast fourier transformation */
+#if defined ( _USE_FFTW3 ) 
+  nts2 = nts;
+
+  out_fft = (fftw_complex *) malloc ( nts * sizeof(fftw_complex) );
+  in_fft  = (fftw_complex *) malloc ( nts * sizeof(fftw_complex) );
+
+  p_T2S = fftw_plan_dft_1d(nts,in_fft,out_fft,  1, FFTW_ESTIMATE);
+  p_S2T = fftw_plan_dft_1d(nts,out_fft,in_fft, -1, FFTW_ESTIMATE);
+#else 
+  nts2 = nts-1;
+  nts2 |= nts2 >> 1;  /* handle  2 bit numbers */
+  nts2 |= nts2 >> 2;  /* handle  4 bit numbers */
+  nts2 |= nts2 >> 4;  /* handle  8 bit numbers */
+  nts2 |= nts2 >> 8;  /* handle 16 bit numbers */
+  nts2 |= nts2 >> 16; /* handle 32 bit numbers */
+  nts2++;
+
+  array1 = (double *) malloc(nts2*sizeof(double));
+  array2 = (double *) malloc(nts2*sizeof(double));
+#endif
+
+  fmasc  = (int *) calloc(nts2, sizeof(int));
+   
+  for ( tsID = 0; tsID < nts; tsID++ ) array2[tsID] = 0;
+
+  switch(operfunc)
+  {
+    case BAND: 
+    {
+      operatorInputArg("Lower bound of frequency band:");
+      fmin = atof(operatorArgv()[0]);
+      
+      operatorInputArg("Upper bound of frequency band:");
+      fmax = atof(operatorArgv()[1]);
+      break;
+    }
+    case HIGH: 
+    {              
+      operatorInputArg("Lower bound of frequency pass:");
+      fmin = atof(operatorArgv()[0]);
+      fmax = fdata;
+      break;
+    }
+    case LOW:  
+    {
+      fmin = 0;
+      operatorInputArg("Upper bound of frequency pass:");
+      fmax = atof(operatorArgv()[0]);
+      break;
+    }      
+  }
+  
+  create_fmasc(nts, fdata, fmin, fmax, fmasc); 
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      missval  = vlistInqVarMissval(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+
+#if defined ( _USE_FFTW3 ) 
+      fprintf(stderr," using fftw lib\n");
+#endif
+      
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+        { 
+#if defined ( _USE_FFTW3 ) 
+          for ( i = 0; i < gridsize-1; i++ )
+            {
+              for ( tsID = 0; tsID < nts; tsID++ )                              
+                {
+		  in_fft[tsID][0] = vars[tsID][varID][levelID].ptr[i];
+		  // in_fft[tsID][1] = vars[tsID][varID][levelID].ptr[i+1];
+		  in_fft[tsID][1] = 0;
+		}
+
+	      filter_fftw(nts,fmasc,in_fft,out_fft,&p_T2S,&p_S2T);
+
+              for ( tsID = 0; tsID < nts; tsID++ )
+		{
+		  vars[tsID][varID][levelID].ptr[i]   = in_fft[tsID][0] / nts;  
+		  //		  vars[tsID][varID][levelID].ptr[i+1] = in_fft[tsID][1] / nts;  
+		}
+	    }
+#else 
+	  for ( i = 0; i < gridsize; i++ )  
+	    {
+	      // for some reason, the optimization using the complex transform independent of the 
+	      // real one in order to transform two time series at the same time does not work
+	      // properly here. 
+
+	      memset( array2,0,nts2*sizeof(double) );
+	      for ( tsID = 0; tsID < nts; tsID++ )
+		array1[tsID] = vars[tsID][varID][levelID].ptr[i];                                         
+	      /* zero padding up to next power of to */
+              for ( ; tsID < nts2; tsID++ )                
+		array1[tsID] = 0;       
+
+	      filter_intrinsic(nts2,fmasc,array1,array2);
+              for ( tsID = 0; tsID < nts; tsID++ )
+		vars[tsID][varID][levelID].ptr[i]   = array1[tsID];  
+	    }
+#endif
+	}
+    }
+  
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+
+  for ( tsID = 0; tsID < nts; tsID++ )
+    {
+      taxisDefDTinfo(taxisID2, dtinfo[tsID]);
+      streamDefTimestep(streamID2, tsID);
+    
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+          for ( levelID = 0; levelID < nlevel; levelID++ )
+            {
+              if ( vars[tsID][varID][levelID].ptr )
+                {
+                  nmiss = vars[tsID][varID][levelID].nmiss;
+		  //fprintf(stderr, "%d %d %d %g\n", tsID, varID, levelID, vars[tsID][varID][levelID].ptr[0]);
+		  streamDefRecord(streamID2, varID, levelID);
+                  streamWriteRecord(streamID2, vars[tsID][varID][levelID].ptr, nmiss);
+                  free(vars[tsID][varID][levelID].ptr);
+                }
+            }
+          free(vars[tsID][varID]);
+        }
+      free(vars[tsID]);
+    }
+
+  if ( vars   ) free(vars);
+  if ( dtinfo ) free(dtinfo);
+  
+  streamClose(streamID2);
+  streamClose(streamID1);
+  
+  cdoFinish();
+  
+  return (0);
+}
diff --git a/src/Fldrms.c b/src/Fldrms.c
new file mode 100644
index 0000000..e7ab539
--- /dev/null
+++ b/src/Fldrms.c
@@ -0,0 +1,160 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Fldrms(void *argument)
+{
+  int streamID1, streamID2, streamID3;
+  int vlistID1, vlistID2, vlistID3;
+  int gridID1, gridID2, gridID3, lastgrid = -1;
+  int wstatus = FALSE;
+  int code = 0, oldcode = 0;
+  int index, ngrids;
+  int recID, nrecs;
+  int tsID, varID, levelID;
+  int lim;
+  int ndiffgrids;
+  int needWeights = FALSE;
+  double slon, slat;
+  double sglval;
+  field_t field1, field2, field3;
+  int taxisID1, taxisID3;
+
+  cdoInitialize(argument);
+
+  needWeights = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  slon = 0;
+  slat = 0;
+  gridID3 = gridCreate(GRID_LONLAT, 1);
+  gridDefXsize(gridID3, 1);
+  gridDefYsize(gridID3, 1);
+  gridDefXvals(gridID3, &slon);
+  gridDefYvals(gridID3, &slat);
+
+  ngrids = vlistNgrids(vlistID1);
+  ndiffgrids = 0;
+  for ( index = 1; index < ngrids; index++ )
+    if ( vlistGrid(vlistID1, 0) != vlistGrid(vlistID1, index))
+      ndiffgrids++;
+
+  index = 0;
+  gridID1 = vlistGrid(vlistID1, index);
+  gridID2 = vlistGrid(vlistID2, index);
+
+  if ( gridInqSize(gridID1) != gridInqSize(gridID2) )
+    cdoAbort("Fields have different grid size!");
+  
+  if ( needWeights &&
+       gridInqType(gridID1) != GRID_LONLAT &&
+       gridInqType(gridID1) != GRID_GAUSSIAN )
+    cdoAbort("Unsupported gridtype: %s", gridNamePtr(gridInqType(gridID1)));
+
+  for ( index = 0; index < ngrids; index++ )
+    vlistChangeGridIndex(vlistID3, index, gridID3);
+
+  if ( ndiffgrids > 0 ) cdoAbort("Too many different grids!");
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  lim = vlistGridsizeMax(vlistID1);
+  field1.ptr    = (double *) malloc(lim*sizeof(double));
+  field1.weight = NULL;
+  if ( needWeights )
+    field1.weight = (double *) malloc(lim*sizeof(double));
+
+  field2.ptr    = (double *) malloc(lim*sizeof(double));
+  field2.weight = NULL;
+
+  field3.ptr  = &sglval;
+  field3.grid = gridID3;
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      nrecs = streamInqTimestep(streamID2, tsID);
+
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field1.ptr, &field1.nmiss);
+	  streamInqRecord(streamID2, &varID, &levelID);
+	  streamReadRecord(streamID2, field2.ptr, &field2.nmiss);
+
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID);
+	  field2.grid    = vlistInqVarGrid(vlistID2, varID);
+	  if ( needWeights && field1.grid != lastgrid )
+	    {
+	      lastgrid = field1.grid;
+	      wstatus = gridWeights(field1.grid, field1.weight);
+	    }
+	  code = vlistInqVarCode(vlistID1, varID);
+	  if ( wstatus != 0 && tsID == 0 && code != oldcode )
+	    cdoWarning("Using constant area weights for code %d!", oldcode=code);
+
+	  field1.missval = vlistInqVarMissval(vlistID1, varID);
+	  field2.missval = vlistInqVarMissval(vlistID1, varID);
+	  field3.missval = vlistInqVarMissval(vlistID1, varID);
+
+	  fldrms(field1, field2, &field3);
+
+	  streamDefRecord(streamID3, varID,  levelID);
+	  streamWriteRecord(streamID3, &sglval, field3.nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( field1.ptr )    free(field1.ptr);
+  if ( field1.weight ) free(field1.weight);
+  if ( field2.ptr )    free(field2.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Fldstat.c b/src/Fldstat.c
new file mode 100644
index 0000000..056603c
--- /dev/null
+++ b/src/Fldstat.c
@@ -0,0 +1,245 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Fldstat    fldmin          Field minimum
+      Fldstat    fldmax          Field maximum
+      Fldstat    fldsum          Field sum
+      Fldstat    fldmean         Field mean
+      Fldstat    fldavg          Field average
+      Fldstat    fldstd          Field standard deviation
+      Fldstat    fldvar          Field variance
+      Fldstat    fldpctl         Field percentiles
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+static
+void print_location_LL(int operfunc, int vlistID, int varID, int levelID, int gridID, double sglval, double *fieldptr,
+		       int vdate, int vtime)
+{
+  static int showHeader = TRUE;
+  int year, month, day, hour, minute, second;
+  int code;
+
+  code = vlistInqVarCode(vlistID, varID);
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+
+  if ( gridInqType(gridID) == GRID_GAUSSIAN ||
+       gridInqType(gridID) == GRID_LONLAT )
+    {
+      int i = 0, j, nlon, nlat;
+      double level;
+      level = zaxisInqLevel(vlistInqVarZaxis(vlistID, varID), levelID);
+      nlon  = gridInqXsize(gridID);
+      nlat  = gridInqYsize(gridID);
+      for ( j = 0; j < nlat; ++j )
+	{
+	  for ( i = 0; i < nlon; ++i )
+	    {
+	      if ( DBL_IS_EQUAL(fieldptr[j*nlon+i], sglval) )
+		{
+		  double xval, yval;
+		  xval = gridInqXval(gridID,i);
+		  yval = gridInqYval(gridID,j);
+		  if ( showHeader )
+		    {
+		      if ( operfunc == func_min )
+			fprintf(stdout, "  Date     Time     Code  Level   Lon      Lat          Minval\n");
+		      else
+			fprintf(stdout, "  Date     Time     Code  Level   Lon      Lat          Maxval\n");
+		      
+		      showHeader = FALSE;
+		    }
+		  
+		  fprintf(stdout, "%4.4d-%2.2d-%2.2d %2.2d:%2.2d:%2.2d %3d %7g %9.7g %9.7g %12.5g\n",
+			  year, month, day, hour, minute, second,
+			  code, level, xval, yval, sglval);
+		}
+	    }
+	}
+    }
+}
+
+
+void *Fldstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridID2, lastgrid = -1;
+  int index, ngrids;
+  int recID, nrecs;
+  int tsID, varID, levelID;
+  int lim;
+  int needWeights = FALSE;
+  int nmiss;
+  double slon, slat;
+  double sglval;
+  field_t field;
+  int taxisID1, taxisID2;
+  /* RQ */
+  int pn = 0;
+  /* QR */
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("fldmin",  func_min,  0, NULL);
+  cdoOperatorAdd("fldmax",  func_max,  0, NULL);
+  cdoOperatorAdd("fldsum",  func_sum,  0, NULL);
+  cdoOperatorAdd("fldmean", func_mean, 0, NULL);
+  cdoOperatorAdd("fldavg",  func_avg,  0, NULL);
+  cdoOperatorAdd("fldvar",  func_var,  0, NULL);
+  cdoOperatorAdd("fldstd",  func_std,  0, NULL);
+  /* RQ */
+  cdoOperatorAdd("fldpctl", func_pctl, 0, NULL);
+  /* QR */
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  /* RQ */
+  if ( operfunc == func_pctl )
+    {
+      operatorInputArg("percentile number");
+      pn = atoi(operatorArgv()[0]);
+      
+      if ( pn < 1 || pn > 99 )
+        cdoAbort("Illegal argument: percentile number %d is not in the range 1..99!", pn);
+    }
+  /* QR */
+
+  if ( operfunc == func_mean || operfunc == func_avg ||
+       operfunc == func_var  || operfunc == func_std )
+    needWeights = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  slon = 0;
+  slat = 0;
+  gridID2 = gridCreate(GRID_LONLAT, 1);
+  gridDefXsize(gridID2, 1);
+  gridDefYsize(gridID2, 1);
+  gridDefXvals(gridID2, &slon);
+  gridDefYvals(gridID2, &slat);
+
+  ngrids = vlistNgrids(vlistID1);
+
+  for ( index = 0; index < ngrids; index++ )
+    vlistChangeGridIndex(vlistID2, index, gridID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  lim = vlistGridsizeMax(vlistID1);
+  field.ptr    = (double *) malloc(lim*sizeof(double));
+  field.weight = NULL;
+  if ( needWeights )
+    field.weight = (double *) malloc(lim*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+      streamDefTimestep(streamID2, tsID);
+
+      /* Precompute date + time for later representation in verbose mode */
+      int vdate = 0, vtime = 0;
+      if ( cdoVerbose )
+        {
+          if ( operfunc == func_min || operfunc == func_max )
+            {
+              vdate = taxisInqVdate(taxisID1);
+              vtime = taxisInqVtime(taxisID1);
+            }
+        }
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field.ptr, &field.nmiss);
+
+	  field.grid = vlistInqVarGrid(vlistID1, varID);
+	  field.size = gridInqSize(field.grid);
+
+	  if ( needWeights && field.grid != lastgrid )
+	    {
+	      lastgrid = field.grid;
+	      field.weight[0] = 1;
+	      if ( field.size > 1 )
+		{
+		  int wstatus = gridWeights(field.grid, field.weight);
+		  if ( wstatus != 0 && tsID == 0 && levelID == 0 )
+		    {
+		      char varname[CDI_MAX_NAME];
+		      vlistInqVarName(vlistID1, varID, varname);
+		      cdoWarning("Using constant grid cell area weights for variable %s!", varname);
+		    }
+		}
+	    }
+
+	  field.missval = vlistInqVarMissval(vlistID1, varID);
+
+	  if ( operfunc == func_pctl )
+	    sglval = fldpctl(field, pn);
+	  else  
+	    sglval = fldfun(field, operfunc);
+
+	  if ( cdoVerbose && (operfunc == func_min || operfunc == func_max) )
+	    print_location_LL(operfunc, vlistID1, varID, levelID, field.grid, sglval, field.ptr, vdate, vtime);
+
+	  if ( DBL_IS_EQUAL(sglval, field.missval) )
+	    nmiss = 1;
+	  else
+	    nmiss = 0;
+
+	  streamDefRecord(streamID2, varID,  levelID);
+	  streamWriteRecord(streamID2, &sglval, nmiss);
+	}
+      tsID++;
+    }
+
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID2);
+
+  if ( field.ptr )    free(field.ptr);
+  if ( field.weight ) free(field.weight);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Fldstat2.c b/src/Fldstat2.c
new file mode 100644
index 0000000..cc6276a
--- /dev/null
+++ b/src/Fldstat2.c
@@ -0,0 +1,226 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Fldstat2    fldcor         Correlation of two fields
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+/* routine corr copied from PINGO */
+/* correclation in space */
+static
+double correlation_s(const double * restrict in0, const double * restrict in1,
+		     const double * restrict weight, double missval, long gridsize)
+{
+  long i;
+  double sum0, sum1, sum00, sum01, sum11, wsum0;
+  double out;
+  double missval1 = missval, missval2 = missval;
+
+  sum0 = sum1 = sum00 = sum01 = sum11 = 0;
+  wsum0 = 0;
+	
+  for ( i = 0; i < gridsize; ++i )
+    {
+      if ( weight[i] != missval && in0[i] != missval && in1[i] != missval)
+	    {
+	      sum0  += weight[i] * in0[i];
+	      sum1  += weight[i] * in1[i];
+	      sum00 += weight[i] * in0[i] * in0[i];
+	      sum01 += weight[i] * in0[i] * in1[i];
+	      sum11 += weight[i] * in1[i] * in1[i];
+	      wsum0 += weight[i];
+	    }
+    }
+
+  out = wsum0 ?
+        DIV((sum01 * wsum0 - sum0 * sum1),
+	     SQRT((sum00 * wsum0 - sum0 * sum0) *
+	          (sum11 * wsum0 - sum1 * sum1))) : missval;
+
+  return (out);
+}
+
+/* covariance in space */
+static
+double covariance_s(const double * restrict in0, const double * restrict in1,
+		    const double * restrict weight, double missval, long gridsize)
+{
+  long i;
+  double sum0, sum1, sum01, wsum0, wsum00;
+  double out;
+
+  sum0 = sum1 = sum01 = 0;
+  wsum0 = wsum00 = 0;
+
+  for ( i = 0; i < gridsize; ++i )
+    {
+      if ( weight[i] != missval && in0[i] != missval && in1[i] != missval )
+	{
+	  sum0   += weight[i] * in0[i];
+	  sum1   += weight[i] * in1[i];
+	  sum01  += weight[i] * in0[i] * in1[i];
+	  wsum0  += weight[i];
+	  wsum00 += weight[i] * weight[i];
+	}
+    }
+
+  out = wsum0 ?
+        (sum01 * wsum0 - sum0 * sum1) / (wsum0 * wsum0) : missval;
+
+  return (out);
+}
+
+
+void *Fldstat2(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2, streamID3;
+  int vlistID1, vlistID2, vlistID3;
+  int gridID, lastgridID = -1;
+  int gridID3;
+  int wstatus = FALSE;
+  int code = 0, oldcode = 0;
+  int index, ngrids;
+  int recID, nrecs, nrecs2;
+  int tsID, varID, levelID;
+  long gridsize;
+  int needWeights = TRUE;
+  int nmiss1, nmiss2, nmiss3;
+  double missval;
+  double slon, slat;
+  double sglval;
+  double *array1, *array2, *weight;
+  int taxisID1, taxisID2, taxisID3;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("fldcor",   func_cor,   0, NULL);
+  cdoOperatorAdd("fldcovar", func_covar, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  slon = 0;
+  slat = 0;
+  gridID3 = gridCreate(GRID_LONLAT, 1);
+  gridDefXsize(gridID3, 1);
+  gridDefYsize(gridID3, 1);
+  gridDefXvals(gridID3, &slon);
+  gridDefYvals(gridID3, &slat);
+
+  ngrids = vlistNgrids(vlistID1);
+
+  for ( index = 0; index < ngrids; index++ )
+    vlistChangeGridIndex(vlistID3, index, gridID3);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+  weight = NULL;
+  if ( needWeights )
+    weight = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      nrecs2 = streamInqTimestep(streamID2, tsID);
+
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamInqRecord(streamID2, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss1);
+	  streamReadRecord(streamID2, array2, &nmiss2);
+
+	  gridID = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  if ( needWeights && gridID != lastgridID )
+	    {
+	      lastgridID = gridID;
+	      wstatus = gridWeights(gridID, weight);
+	    }
+	  code = vlistInqVarCode(vlistID1, varID);
+	  if ( wstatus != 0 && tsID == 0 && code != oldcode )
+	    cdoWarning("Using constant grid cell area weights for code %d!", oldcode=code);
+
+	  missval = vlistInqVarMissval(vlistID1, varID);
+
+	  if ( operfunc == func_cor )
+	    {
+	      sglval = correlation_s(array1, array2, weight, missval, gridsize);
+	    }
+	  else if ( operfunc == func_covar )
+	    {
+	      sglval = covariance_s(array1, array2, weight, missval, gridsize);
+	    }
+
+	  if ( DBL_IS_EQUAL(sglval, missval) )
+	    nmiss3 = 1;
+	  else
+	    nmiss3 = 0;
+
+	  streamDefRecord(streamID3, varID,  levelID);
+	  streamWriteRecord(streamID3, &sglval, nmiss3);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+  if ( weight ) free(weight);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Fourier.c b/src/Fourier.c
new file mode 100644
index 0000000..4c6b559
--- /dev/null
+++ b/src/Fourier.c
@@ -0,0 +1,239 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if defined (_OPENMP)
+#  include <omp.h>
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "statistic.h"
+
+
+#define  NALLOC_INC  1024
+
+
+void *Fourier(void *argument)
+{
+  int ompthID;
+  int bit, sign;
+  int gridsize;
+  int nrecs;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int i;
+  int nts;
+  int nalloc = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int *vdate = NULL, *vtime = NULL;
+  double missval;
+  field_t ***vars = NULL;
+  typedef struct
+  {
+    double *real;
+    double *imag;
+    double *work_r;
+    double *work_i;
+  } memory_t;
+  memory_t *mem = NULL;
+
+
+  cdoInitialize(argument);
+
+  operatorInputArg("the sign of the exponent (-1 for normal or 1 for reverse transformation)!");
+  sign = atoi(operatorArgv()[0]);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars = vlistNvars(vlistID1);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      if ( tsID >= nalloc )
+	{
+	  nalloc += NALLOC_INC;
+	  vdate = (int *) realloc(vdate, nalloc*sizeof(int));
+	  vtime = (int *) realloc(vtime, nalloc*sizeof(int));
+	  vars  = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
+	}
+
+      vdate[tsID] = taxisInqVdate(taxisID1);
+      vtime[tsID] = taxisInqVtime(taxisID1);
+
+      vars[tsID] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridID  = vlistInqVarGrid(vlistID1, varID);
+	  missval = vlistInqVarMissval(vlistID1, varID);
+	  nlevel  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+
+	  vars[tsID][varID] = (field_t *) malloc(nlevel*sizeof(field_t));
+
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      vars[tsID][varID][levelID].grid    = gridID;
+	      vars[tsID][varID][levelID].missval = missval;
+	      vars[tsID][varID][levelID].ptr     = NULL;
+	    }
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  vars[tsID][varID][levelID].ptr = (double *) malloc(2*gridsize*sizeof(double));
+	  streamReadRecord(streamID1, vars[tsID][varID][levelID].ptr, &nmiss);
+	  vars[tsID][varID][levelID].nmiss = nmiss;
+	}
+
+      tsID++;
+    }
+
+  nts = tsID;
+
+  for ( bit = nts; !(bit & 1); bit >>= 1 );
+
+  mem = (memory_t *) malloc(ompNumThreads*sizeof(memory_t));
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      mem[i].real = (double *) malloc(nts*sizeof(double));
+      mem[i].imag = (double *) malloc(nts*sizeof(double));
+      if ( bit != 1 )
+	{
+	  mem[i].work_r = (double *) malloc(nts*sizeof(double));
+	  mem[i].work_i = (double *) malloc(nts*sizeof(double));
+	}
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      missval  = vlistInqVarMissval(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, ompthID, tsID)
+#endif
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+	      int lmiss = 0;
+#if defined (_OPENMP)
+              ompthID = omp_get_thread_num();
+#else
+              ompthID = 0;
+#endif
+	      for ( tsID = 0; tsID < nts; tsID++ )
+		{
+		  mem[ompthID].real[tsID] = vars[tsID][varID][levelID].ptr[2*i];
+		  mem[ompthID].imag[tsID] = vars[tsID][varID][levelID].ptr[2*i+1];
+		  if ( DBL_IS_EQUAL(mem[ompthID].real[tsID], missval) ||
+		       DBL_IS_EQUAL(mem[ompthID].imag[tsID], missval) ) lmiss = 1;
+		}
+
+	      if ( lmiss == 0 )
+		{
+		  if ( bit == 1 )	/* nts is a power of 2 */
+		    fft(mem[ompthID].real, mem[ompthID].imag, nts, sign);
+		  else
+		    ft_r(mem[ompthID].real, mem[ompthID].imag, nts, sign, mem[ompthID].work_r, mem[ompthID].work_i);
+
+		  for ( tsID = 0; tsID < nts; tsID++ )
+		    {
+		      vars[tsID][varID][levelID].ptr[2*i]   = mem[ompthID].real[tsID];
+		      vars[tsID][varID][levelID].ptr[2*i+1] = mem[ompthID].imag[tsID];
+		    }
+		}
+	      else
+		{
+		  for ( tsID = 0; tsID < nts; tsID++ )
+		    {
+		      vars[tsID][varID][levelID].ptr[2*i]   = missval;
+		      vars[tsID][varID][levelID].ptr[2*i+1] = missval;
+		    }
+		}
+	    }
+	}
+    }
+
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      free(mem[i].real);
+      free(mem[i].imag);
+      if ( bit != 1 )
+	{
+	  free(mem[i].work_r);
+	  free(mem[i].work_i);
+	}
+    }
+  free(mem);
+
+  for ( tsID = 0; tsID < nts; tsID++ )
+    {
+      taxisDefVdate(taxisID2, vdate[tsID]);
+      taxisDefVtime(taxisID2, vtime[tsID]);
+      streamDefTimestep(streamID2, tsID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      if ( vars[tsID][varID][levelID].ptr )
+		{
+		  nmiss = vars[tsID][varID][levelID].nmiss;
+		  streamDefRecord(streamID2, varID, levelID);
+		  streamWriteRecord(streamID2, vars[tsID][varID][levelID].ptr, nmiss);
+		  free(vars[tsID][varID][levelID].ptr);
+		}
+	    }
+	  free(vars[tsID][varID]);
+	}
+      free(vars[tsID]);
+    }
+
+  if ( vars  ) free(vars);
+  if ( vdate ) free(vdate);
+  if ( vtime ) free(vtime);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (NULL);
+}
diff --git a/src/Gather.c b/src/Gather.c
new file mode 100644
index 0000000..1411539
--- /dev/null
+++ b/src/Gather.c
@@ -0,0 +1,472 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+
+typedef struct
+{
+  int streamID;
+  int vlistID;
+  int gridID;
+  double *array;
+} ens_file_t;
+
+
+typedef struct
+{
+  double x, y;
+  int id;
+}
+xyinfo_t;
+
+static
+int cmpx(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  xyinfo_t *xy1 = (xyinfo_t *) s1;
+  xyinfo_t *xy2 = (xyinfo_t *) s2;
+
+  if      ( xy1->x < xy2->x ) cmp = -1;
+  else if ( xy1->x > xy2->x ) cmp =  1;
+
+  return (cmp);
+}
+
+static
+int cmpxy_lt(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  xyinfo_t *xy1 = (xyinfo_t *) s1;
+  xyinfo_t *xy2 = (xyinfo_t *) s2;
+
+  if      ( xy1->y < xy2->y || (!(fabs(xy1->y - xy2->y) > 0) && xy1->x < xy2->x) ) cmp = -1;
+  else if ( xy1->y > xy2->y || (!(fabs(xy1->y - xy2->y) > 0) && xy1->x > xy2->x) ) cmp =  1;
+
+  return (cmp);
+}
+
+static
+int cmpxy_gt(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  xyinfo_t *xy1 = (xyinfo_t *) s1;
+  xyinfo_t *xy2 = (xyinfo_t *) s2;
+
+  if      ( xy1->y > xy2->y || (!(fabs(xy1->y - xy2->y) > 0) && xy1->x < xy2->x) ) cmp = -1;
+  else if ( xy1->y < xy2->y || (!(fabs(xy1->y - xy2->y) > 0) && xy1->x > xy2->x) ) cmp =  1;
+
+  return (cmp);
+}
+
+static
+int genGrid(int nfiles, ens_file_t *ef, int **gridindex, int igrid)
+{
+  int lsouthnorth = TRUE;
+  int fileID;
+  int gridID;
+  int gridID2 = -1;
+  int gridtype = -1;
+  int *xsize, *ysize;
+  int *xoff, *yoff;
+  int xsize2, ysize2;
+  int idx;
+  int nx, ny, ix, iy, i, j, ij, offset;
+  double **xvals, **yvals;
+  double *xvals2, *yvals2;
+  xyinfo_t *xyinfo;
+
+  gridID   = vlistGrid(ef[0].vlistID, igrid);
+  gridtype = gridInqType(gridID);
+  if ( gridtype == GRID_GENERIC && gridInqXsize(gridID) == 0 && gridInqYsize(gridID) == 0 )
+    return (gridID2);
+
+  xsize = (int *) malloc(nfiles*sizeof(int));
+  ysize = (int *) malloc(nfiles*sizeof(int));
+  xyinfo = (xyinfo_t *) malloc(nfiles*sizeof(xyinfo_t));
+  xvals = (double **) malloc(nfiles*sizeof(double));
+  yvals = (double **) malloc(nfiles*sizeof(double));
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      gridID   = vlistGrid(ef[fileID].vlistID, igrid);
+      gridtype = gridInqType(gridID);
+      if ( !(gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN ||
+	    (gridtype == GRID_GENERIC && gridInqXsize(gridID) > 0 && gridInqYsize(gridID) > 0)) )
+	cdoAbort("Unsupported grid type: %s!", gridNamePtr(gridtype));
+
+      xsize[fileID] = gridInqXsize(gridID);
+      ysize[fileID] = gridInqYsize(gridID);
+      /*
+      if ( xsize == 0 ) xsize = gridInqXsize(gridID);
+      if ( ysize == 0 ) ysize = gridInqYsize(gridID);
+      if ( xsize != gridInqXsize(gridID) ) cdoAbort("xsize differ!");
+      if ( ysize != gridInqYsize(gridID) ) cdoAbort("ysize differ!");
+      */
+      xvals[fileID] = (double *) malloc(xsize[fileID]*sizeof(double));
+      yvals[fileID] = (double *) malloc(ysize[fileID]*sizeof(double));
+      gridInqXvals(gridID, xvals[fileID]);
+      gridInqYvals(gridID, yvals[fileID]);
+
+      // printf("fileID %d, gridID %d\n", fileID, gridID);
+
+      xyinfo[fileID].x  = xvals[fileID][0];
+      xyinfo[fileID].y  = yvals[fileID][0];
+      xyinfo[fileID].id = fileID;
+
+      if ( fileID == 0 && ysize[fileID] > 1 )
+	{
+	  if ( yvals[fileID][0] > yvals[fileID][ysize[fileID]-1] ) lsouthnorth = FALSE;
+	}
+    }
+  
+  if ( cdoVerbose )
+    for ( fileID = 0; fileID < nfiles; fileID++ )
+      printf("1 %d %g %g \n",  xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
+  
+  qsort(xyinfo, nfiles, sizeof(xyinfo_t), cmpx);  	      
+  
+  if ( cdoVerbose )
+    for ( fileID = 0; fileID < nfiles; fileID++ )
+      printf("2 %d %g %g \n",  xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
+  
+  if ( lsouthnorth )
+    qsort(xyinfo, nfiles, sizeof(xyinfo_t), cmpxy_lt);  
+  else
+    qsort(xyinfo, nfiles, sizeof(xyinfo_t), cmpxy_gt);  	      
+
+  if ( cdoVerbose )
+    for ( fileID = 0; fileID < nfiles; fileID++ )
+      printf("3 %d %g %g \n",  xyinfo[fileID].id, xyinfo[fileID].x, xyinfo[fileID].y);
+
+  nx = 1;
+  for ( fileID = 1; fileID < nfiles; fileID++ )
+    {
+      if ( DBL_IS_EQUAL(xyinfo[0].y, xyinfo[fileID].y) ) nx++;
+      else break;
+    }
+  ny = nfiles/nx;
+  if ( cdoVerbose ) cdoPrint("nx %d  ny %d", nx, ny);
+
+  xsize2 = 0;
+  for ( i = 0; i < nx; ++i ) xsize2 += xsize[xyinfo[i].id];
+  ysize2 = 0;
+  for ( j = 0; j < ny; ++j ) ysize2 += ysize[xyinfo[j*nx].id];
+  if ( cdoVerbose ) cdoPrint("xsize2 %d  ysize2 %d", xsize2, ysize2);
+
+  xvals2 = (double *) malloc(xsize2*sizeof(double));
+  yvals2 = (double *) malloc(ysize2*sizeof(double));
+
+  xoff = (int *) malloc((nx+1)*sizeof(int));
+  yoff = (int *) malloc((ny+1)*sizeof(int));
+
+  xoff[0] = 0;
+  for ( i = 0; i < nx; ++i )
+    {
+      idx = xyinfo[i].id;
+      memcpy(xvals2+xoff[i], xvals[idx], xsize[idx]*sizeof(double));
+      xoff[i+1] = xoff[i] + xsize[idx];
+    }
+
+  yoff[0] = 0;
+  for ( j = 0; j < ny; ++j )
+    {
+      idx = xyinfo[j*nx].id;
+      memcpy(yvals2+yoff[j], yvals[idx], ysize[idx]*sizeof(double));
+      yoff[j+1] = yoff[j] + ysize[idx];
+    }
+
+  if ( gridindex != NULL )
+    {
+      for ( fileID = 0; fileID < nfiles; fileID++ )
+	{
+	  idx = xyinfo[fileID].id;
+	  iy = fileID/nx;
+	  ix = fileID - iy*nx;
+
+          offset = yoff[iy]*xsize2 + xoff[ix];
+	  /*
+	  printf("fileID %d %d, iy %d, ix %d, offset %d\n",
+		 fileID, xyinfo[fileID].id, iy, ix, offset);
+	  */
+	  ij = 0;
+	  for ( j = 0; j < ysize[idx]; ++j )
+	    for ( i = 0; i < xsize[idx]; ++i )
+	      {
+		gridindex[idx][ij++] = offset+j*xsize2+i;
+	      }
+	}
+    }
+
+  gridID2 = gridCreate(gridtype, xsize2*ysize2);
+  gridDefXsize(gridID2, xsize2);
+  gridDefYsize(gridID2, ysize2);
+  gridDefXvals(gridID2, xvals2);
+  gridDefYvals(gridID2, yvals2);
+
+  free(xoff);
+  free(yoff);
+  free(xsize);
+  free(ysize);
+  free(xvals2);
+  free(yvals2);
+
+  {
+    char string[1024];
+    string[0] = 0;
+    gridID = vlistGrid(ef[0].vlistID, igrid);
+    gridInqXname(gridID, string);
+    gridDefXname(gridID2, string);
+    gridInqYname(gridID, string);
+    gridDefYname(gridID2, string);
+    gridInqXlongname(gridID, string);
+    gridDefXlongname(gridID2, string);
+    gridInqYlongname(gridID, string);
+    gridDefYlongname(gridID2, string);
+    gridInqXunits(gridID, string);
+    gridDefXunits(gridID2, string);
+    gridInqYunits(gridID, string);
+    gridDefYunits(gridID2, string);
+  }
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      free(xvals[fileID]);
+      free(yvals[fileID]);
+    }
+  free(xvals);
+  free(yvals);
+  free(xyinfo);
+
+  return (gridID2);
+}
+
+
+void *Gather(void *argument)
+{
+  int i;
+  int nvars;
+  int cmpfunc;
+  int varID, recID;
+  int gridsize = 0;
+  int gridsizemax = 0;
+  int gridsize2;
+  int *gridIDs = NULL;
+  int *vars = NULL;
+  int nrecs, nrecs0;
+  int ngrids;
+  int levelID;
+  int tsID;
+  int streamID = 0, streamID2;
+  int vlistID, vlistID1, vlistID2;
+  int nmiss;
+  int taxisID1, taxisID2;
+  int **gridindex;
+  double missval;
+  double *array2 = NULL;
+  int fileID, nfiles;
+  const char *ofilename;
+  ens_file_t *ef = NULL;
+
+  cdoInitialize(argument);
+    
+  nfiles = cdoStreamCnt() - 1;
+
+  ofilename = cdoStreamName(nfiles);
+
+  if ( !cdoSilentMode && !cdoOverwriteMode )
+    if ( fileExists(ofilename) )
+      if ( !userFileOverwrite(ofilename) )
+	cdoAbort("Outputfile %s already exists!", ofilename);
+
+  ef = (ens_file_t *) malloc(nfiles*sizeof(ens_file_t));
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      streamID = streamOpenRead(cdoStreamName(fileID));
+
+      vlistID = streamInqVlist(streamID);
+
+      ef[fileID].streamID = streamID;
+      ef[fileID].vlistID  = vlistID;
+    }
+
+  nvars = vlistNvars(ef[0].vlistID);
+  vars  = (int *) malloc(nvars*sizeof(int));
+  for ( varID = 0; varID < nvars; varID++ ) vars[varID] = FALSE;
+
+  /* check that the contents is always the same */
+  if ( nvars == 1 ) 
+    cmpfunc = CMP_NAME | CMP_NLEVEL;
+  else
+    cmpfunc = CMP_NAME | CMP_NLEVEL;
+
+  for ( fileID = 1; fileID < nfiles; fileID++ )
+    vlistCompare(ef[0].vlistID, ef[fileID].vlistID, cmpfunc);
+
+  vlistID1 = ef[0].vlistID;
+  gridsizemax = vlistGridsizeMax(vlistID1);
+  for ( fileID = 1; fileID < nfiles; fileID++ )
+    {
+      gridsize = vlistGridsizeMax(ef[fileID].vlistID);
+      if ( gridsize > gridsizemax ) gridsizemax = gridsize;
+    }
+  gridsize = gridsizemax;
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    ef[fileID].array = (double *) malloc(gridsizemax*sizeof(double));
+
+  ngrids = vlistNgrids(ef[0].vlistID);
+  gridIDs = (int *) malloc(ngrids*sizeof(int));
+  gridindex = (int **) malloc(nfiles*sizeof(int *));
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    gridindex[fileID] = (int *) malloc(gridsizemax*sizeof(int));
+
+  int ginit = FALSE;
+  for ( i = 0; i < ngrids; ++i )
+    {
+      if ( ginit == FALSE )
+	{
+	  gridIDs[i] = genGrid(nfiles, ef, gridindex, i);
+	  if ( gridIDs[i] != -1 ) ginit = TRUE;
+	}
+      else
+	gridIDs[i] = genGrid(nfiles, ef, NULL, i);
+    }
+
+  vlistID2 = vlistDuplicate(vlistID1);
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  gridsize2 = 0;
+  for ( i = 0; i < ngrids; ++i )
+    {
+      if ( gridIDs[i] != -1 ) 
+	{
+	  if ( gridsize2 == 0 ) gridsize2 = gridInqSize(gridIDs[i]);
+	  if ( gridsize2 != gridInqSize(gridIDs[i]) ) cdoAbort("gridsize differ!");
+	  vlistChangeGridIndex(vlistID2, i, gridIDs[i]);
+	}
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      int gridID = vlistInqVarGrid(ef[0].vlistID, varID);
+
+      for ( i = 0; i < ngrids; ++i )
+	{
+	  if ( gridIDs[i] != -1 ) 
+	    {
+	      if ( gridID == vlistGrid(ef[0].vlistID, i) )
+	      vars[varID] = TRUE;
+	      break;
+	    }
+	}
+    }
+
+  streamID2 = streamOpenWrite(ofilename, cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+	  
+  array2 = (double *) malloc(gridsize2*sizeof(double));
+
+  tsID = 0;
+  do
+    {
+      nrecs0 = streamInqTimestep(ef[0].streamID, tsID);
+      for ( fileID = 1; fileID < nfiles; fileID++ )
+	{
+	  streamID = ef[fileID].streamID;
+	  nrecs = streamInqTimestep(streamID, tsID);
+	  if ( nrecs != nrecs0 )
+	    cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoStreamName(0), cdoStreamName(fileID));
+	}
+
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      if ( nrecs0 > 0 ) streamDefTimestep(streamID2, tsID);
+      
+      for ( recID = 0; recID < nrecs0; recID++ )
+	{
+	  streamID = ef[0].streamID;
+	  streamInqRecord(streamID, &varID, &levelID);
+
+	  missval = vlistInqVarMissval(vlistID1, varID);
+	  for ( i = 0; i < gridsize2; i++ ) array2[i] = missval;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(fileID, streamID, nmiss, i)
+#endif
+	  for ( fileID = 0; fileID < nfiles; fileID++ )
+	    {
+	      int varIDx, levelIDx;
+	      streamID = ef[fileID].streamID;
+	      if ( fileID > 0 ) streamInqRecord(streamID, &varIDx, &levelIDx);
+	      streamReadRecord(streamID, ef[fileID].array, &nmiss);
+
+	      if ( vars[varID] )
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(ef[fileID].vlistID, varID));
+		  for ( i = 0; i < gridsize; ++i )
+		    array2[gridindex[fileID][i]] = ef[fileID].array[i];
+		}
+	    }
+
+	  streamDefRecord(streamID2, varID, levelID);
+
+	  if ( vars[varID] )
+	    {
+	      nmiss = 0;
+	      for ( i = 0; i < gridsize2; i++ )
+		if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
+	      
+	      streamWriteRecord(streamID2, array2, nmiss);
+	    }
+	  else
+	    streamWriteRecord(streamID2, ef[0].array, 0);
+	}
+
+      tsID++;
+    }
+  while ( nrecs0 > 0 );
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      streamID = ef[fileID].streamID;
+      streamClose(streamID);
+    }
+
+  streamClose(streamID2);
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    if ( ef[fileID].array ) free(ef[fileID].array);
+
+  if ( ef ) free(ef);
+  if ( array2 ) free(array2);
+
+  free(gridIDs);
+  if ( vars   ) free(vars);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Gengrid.c b/src/Gengrid.c
new file mode 100644
index 0000000..7cf9004
--- /dev/null
+++ b/src/Gengrid.c
@@ -0,0 +1,165 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Gengrid(void *argument)
+{
+  int streamID1, streamID2, streamID3;
+  int vlistID1, vlistID2, vlistID3;
+  int gridID1, gridID2, gridID3;
+  int zaxisID3;
+  int datatype;
+  int nrecs;
+  int tsID, varID, levelID;
+  int gridsize, i;
+  int xsize, ysize;
+  int nmiss1, nmiss2;
+  int taxisID3;
+  double *array1, *array2, *array3;
+  double missval = 0;
+  double xminval, xmaxval, yminval, ymaxval;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+
+  gridID1 = vlistGrid(vlistID1, 0);
+  gridID2 = vlistGrid(vlistID2, 0);
+
+  if ( gridInqSize(gridID1) != gridInqSize(gridID2) )
+    cdoAbort("Arrays have different grid size!");
+
+  gridsize = gridInqSize(gridID1);
+  xsize = gridInqXsize(gridID1);
+  ysize = gridInqYsize(gridID1);
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+  array3 = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  nrecs = streamInqTimestep(streamID1, tsID);
+  nrecs = streamInqTimestep(streamID2, tsID);
+
+  streamInqRecord(streamID1, &varID, &levelID);
+  streamReadRecord(streamID1, array1, &nmiss1);
+  streamInqRecord(streamID2, &varID, &levelID);
+  streamReadRecord(streamID2, array2, &nmiss2);
+
+  datatype = vlistInqVarDatatype(vlistID1, 0);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( nmiss1 || nmiss2 ) cdoAbort("Missing values unsupported!");
+
+  gridID3 = gridCreate(GRID_CURVILINEAR, gridsize);
+
+  if ( cdoVerbose ) cdoPrint("xsize %d  ysize %d", xsize, ysize);
+  if ( xsize*ysize != gridsize )
+    cdoAbort("xsize*ysize != gridsize");
+
+  gridDefXsize(gridID3, xsize);
+  gridDefYsize(gridID3, ysize);
+  gridDefXvals(gridID3, array1);
+  gridDefYvals(gridID3, array2);
+
+  if ( datatype == DATATYPE_FLT64 )
+    gridDefPrec(gridID3, DATATYPE_FLT64);
+  else
+    gridDefPrec(gridID3, DATATYPE_FLT32);
+
+  xminval = array1[0];
+  xmaxval = array1[0];
+  yminval = array2[0];
+  ymaxval = array2[0];
+  for ( i = 1; i < gridsize; ++i )
+    {
+      if ( array1[i] < xminval ) xminval = array1[i];
+      if ( array1[i] > xmaxval ) xmaxval = array1[i];
+      if ( array2[i] < yminval ) yminval = array2[i];
+      if ( array2[i] > ymaxval ) ymaxval = array2[i];
+    }
+
+  if ( cdoVerbose )
+    cdoPrint("xminval = %g, xmaxval = %g, yminval = %g, ymaxval = %g",
+	     xminval, xmaxval, yminval, ymaxval);
+
+  /* check units */
+  if ( xminval > -4 && xmaxval < 8 && yminval > -2 && ymaxval < 2 )
+    {
+      gridDefXunits(gridID3, "radians");
+      gridDefYunits(gridID3, "radians");
+    }
+  else if ( xminval > -181 && xmaxval < 361 && yminval > -91 && ymaxval < 91 )
+    {
+      /* default is degrees */
+    }
+  else
+    {
+      cdoAbort("Units undefined!");
+    }
+
+  zaxisID3 = zaxisCreate(ZAXIS_SURFACE, 1);
+
+  vlistID3 = vlistCreate();
+  vlistDefVar(vlistID3, gridID3, zaxisID3, TSTEP_CONSTANT);
+  vlistDefVarMissval(vlistID3, 0, missval);
+  vlistDefVarName(vlistID3, 0, "dummy");
+  vlistDefVarDatatype(vlistID3, 0, DATATYPE_INT8);
+
+  taxisID3 = taxisCreate(TAXIS_ABSOLUTE);
+
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  tsID = 0;
+  streamDefTimestep(streamID3, tsID);
+
+  for ( i = 0; i < gridsize; ++i ) array3[i] = missval;
+
+  streamDefRecord(streamID3, 0, 0);
+  streamWriteRecord(streamID3, array3, gridsize);
+
+  streamClose(streamID3);
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+  if ( array3 ) free(array3);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Gradsdes.c b/src/Gradsdes.c
new file mode 100644
index 0000000..6ab2506
--- /dev/null
+++ b/src/Gradsdes.c
@@ -0,0 +1,1262 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Gradsdes   gradsdes1       GrADS data descriptor file (version 1 map)
+      Gradsdes   gradsdes2       GrADS data descriptor file (version 2 map)
+*/
+
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h" /* VERSION */
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+/*
+  Values output into the grib map file:
+
+  Header:
+
+  hipnt info:  0 - version number (1)
+               1 - number of times in file
+               2 - number of records per time
+               3 - Grid type
+                 255 - user defined grid.  descriptor
+                       describes grid exactly; one record
+                       per grid.
+                  29 - Predefined grid set 29 and 30.
+                       Two records per grid.
+
+  hfpnt info:  None
+
+  Info:
+
+  intpnt info (for each mapped grib record) :
+                 0 - position of start of data in file
+                 1 - position of start of bit map in file
+                 2 - number of bits per data element
+
+  fltpnt info :
+                 0 - decimal scale factor for this record
+                 1 - binary scale factor
+                 2 - reference value
+
+*/
+struct gaindx {
+  int    type;      /* Indexing file type             */
+  int    hinum;     /* Number of ints in header       */
+  int    hfnum;     /* Number of floats in header     */
+  int    intnum;    /* Number of index ints (long)    */
+  int    fltnum;    /* Number of index floats         */
+  int   *hipnt;     /* Pointer to header int values   */
+  float *hfpnt;     /* Pointer to header float values */
+  int   *intpnt;    /* Pointer to int index values    */
+  float *fltpnt;    /* Pointer to float index values  */
+};
+
+
+/* Byte swap requested number of 4 byte elements */
+
+static
+void gabswp (void *r, int cnt) {
+int i;
+char *ch1,*ch2,*ch3,*ch4,cc1,cc2;
+
+  ch1 = (char *)r;
+  ch2 = ch1+1;
+  ch3 = ch2+1;
+  ch4 = ch3+1;
+  for (i=0; i<cnt; i++) {
+    cc1 = *ch1;
+    cc2 = *ch2;
+    *ch1 = *ch4;
+    *ch2 = *ch3;
+    *ch3 = cc2;
+    *ch4 = cc1;
+    ch1+=4; ch2+=4; ch3+=4; ch4+=4;
+  }
+}
+
+/*
+ * convert an IBM float to single precision number v1.0
+ *
+ *                      Wesley Ebisuzaki
+ */
+static
+float ibm2flt(unsigned char *ibm) {
+
+	int positive, power;
+	unsigned int abspower;
+	long int mant;
+	double value, exp;
+
+	positive = (ibm[0] & 0x80) == 0;
+	mant = (ibm[1] << 16) + (ibm[2] << 8) + ibm[3];
+	power = (int) (ibm[0] & 0x7f) - 64;
+	abspower = power > 0 ? power : -power;
+
+
+	/* calc exp */
+	exp = 16.0;
+	value = 1.0;
+	while (abspower) {
+		if (abspower & 1) {
+			value *= exp;
+		}
+		exp = exp * exp;
+		abspower >>= 1;
+	}
+
+	if (power < 0) value = 1.0 / value;
+	value = value * mant / 16777216.0;
+	if (positive == 0) value = -value;
+	return (float)value;
+}
+
+/*
+ * convert a float to an IBM single precision number v1.0
+ *
+ *                      Wesley Ebisuzaki
+ *
+ * doesn't handle subnormal numbers
+ */
+static
+int flt2ibm(float x, unsigned char *ibm) {
+
+	int sign, exp, i;
+	double mant;
+
+	if ( !(fabs((double)x) > 0) ) {
+		ibm[0] = ibm[1] = ibm[2] = ibm[3] = 0;
+		return 0;
+	}
+
+	/* sign bit */
+	if (x < 0.0) {
+		sign = 128;
+		x = -x;
+	}
+	else sign = 0;
+
+	mant = frexp((double) x, &exp);
+
+	/* round up by adding 2**-24 */
+	/* mant = mant + 1.0/16777216.0; */
+
+	if (mant >= 1.0) {
+		mant = 0.5;
+		exp++;
+	}
+	while (exp & 3) {
+		mant *= 0.5;
+		exp++;
+	}
+	
+	exp = exp/4 + 64;
+
+	if (exp < 0) {
+		fprintf(stderr,"underflow in flt2ibm\n");
+		ibm[0] = ibm[1] = ibm[2] = ibm[3] = 0;
+		return 0;
+	}
+	if (exp > 127) {
+		fprintf(stderr,"overflow in flt2ibm\n");
+		ibm[0] = sign | 127;
+		ibm[1] = ibm[2] = ibm[3] = 255;
+		return -1;
+	}
+
+	/* normal number */
+
+	ibm[0] = sign | exp;
+
+	mant = mant * 256.0;
+	i = (int) floor(mant);
+	mant = mant - i;
+	ibm[1] = i;
+
+	mant = mant * 256.0;
+	i = (int) floor(mant);
+	mant = mant - i;
+	ibm[2] = i;
+
+	ibm[3] = (int) floor(mant*256.0);
+
+	return 0;
+}
+
+#define  GET_UINT4(a,b,c,d) ((int) ((a << 24) + (b << 16) + (c << 8) + (d)))
+#define  Put1Byte(buf, cnt, ival)  (buf[cnt++] = (ival))
+#define  Put2Byte(buf, cnt, ival) ((buf[cnt++] = (ival) >>  8), \
+                                   (buf[cnt++] = (ival)))
+#define  Put4Byte(buf, cnt, ival) ((buf[cnt++] = (ival) >> 24), \
+                                   (buf[cnt++] = (ival) >> 16), \
+                                   (buf[cnt++] = (ival) >>  8), \
+                                   (buf[cnt++] = (ival)))
+
+#define  PutInt(buf, cnt, ival)   (ival < 0 ? Put4Byte(buf, cnt, 0x7fffffff - ival + 1) : Put4Byte(buf, cnt, ival))
+
+static
+void dumpmap()
+{
+  unsigned char urec[4];
+  unsigned char vermap;
+  unsigned char mrec[512];
+  int swpflg = 0;
+  int i;
+  struct gaindx indx;
+  size_t nbytes;
+  FILE *mapfp;
+
+  indx.hipnt = NULL;
+  indx.hfpnt = NULL;
+  indx.intpnt = NULL;
+  indx.fltpnt = NULL;
+
+  mapfp = fopen(cdoStreamName(0), "r");
+  if ( mapfp == NULL ) cdoAbort("Open failed on %s", cdoStreamName(0));
+
+  /* check the version number */
+
+  fseek(mapfp, 1, 0);
+  nbytes = fread(&vermap, sizeof(unsigned char), 1, mapfp);
+
+  if ( vermap == 2 )
+    {
+      printf("gribmap version = %d\n", vermap);
+      fseek(mapfp, 2, 0);
+
+      nbytes = fread(mrec, sizeof(unsigned char), 4, mapfp);
+      indx.hinum = GET_UINT4(mrec[0],mrec[1],mrec[2],mrec[3]);
+      
+      nbytes = fread(mrec, sizeof(unsigned char), 4, mapfp);
+      indx.hfnum = GET_UINT4(mrec[0],mrec[1],mrec[2],mrec[3]);
+
+      nbytes = fread(mrec, sizeof(unsigned char), 4, mapfp);
+      indx.intnum = GET_UINT4(mrec[0],mrec[1],mrec[2],mrec[3]);
+
+      nbytes = fread(mrec, sizeof(unsigned char), 4, mapfp);
+      indx.fltnum = GET_UINT4(mrec[0],mrec[1],mrec[2],mrec[3]);
+
+      nbytes = fread(mrec, sizeof(unsigned char), 7, mapfp);
+
+      if ( indx.hinum > 0 )
+	{
+	  indx.hipnt = (int *) malloc(sizeof(int)*indx.hinum);
+	  for ( i = 0; i < indx.hinum; i++ )
+	    {
+	      nbytes = fread(mrec, sizeof(unsigned char), 4, mapfp);
+	      indx.hipnt[i] = GET_UINT4(mrec[0],mrec[1],mrec[2],mrec[3]);
+	    }
+	}
+      if ( indx.hfnum > 0 )
+	{
+	  indx.hfpnt = (float *) malloc(sizeof(float)*indx.hfnum);
+	  nbytes = fread (indx.hfpnt,sizeof(float),indx.hfnum,mapfp);
+	}
+      if ( indx.intnum > 0 )
+	{
+	  indx.intpnt = (int *) malloc(sizeof(int)*indx.intnum);
+	  for ( i = 0; i < indx.intnum; i++ )
+	    {
+	      nbytes = fread(mrec, sizeof(unsigned char), 4, mapfp);
+	      indx.intpnt[i] = GET_UINT4(mrec[0],mrec[1],mrec[2],mrec[3]);
+	      if ( indx.intpnt[i] < 0 ) indx.intpnt[i] = 0x7fffffff - indx.intpnt[i] + 1;
+	    }
+	}
+      if ( indx.fltnum > 0 )
+	{
+	  indx.fltpnt = (float *) malloc(sizeof(float)*indx.fltnum);
+	  for ( i = 0; i < indx.fltnum; i++ )
+	    {
+	      nbytes = fread(urec, sizeof(unsigned char), 4, mapfp);
+	      indx.fltpnt[i] = ibm2flt(urec);
+	    }
+	}
+    }
+  else
+    {
+      fseek(mapfp, 0, 0);
+      nbytes = fread (&indx, sizeof(struct gaindx), 1, mapfp);
+      if ( indx.type>>24 > 0 ) swpflg = 1;
+      if ( swpflg ) printf("swap endian!\n");
+      if ( swpflg ) gabswp((float *)&indx.type, 5);
+      
+      if ( indx.hinum > 0 )
+	{
+	  indx.hipnt = (int *) malloc(sizeof(int)*indx.hinum);
+	  nbytes = fread (indx.hipnt, sizeof(int), indx.hinum, mapfp);
+	  if ( swpflg ) gabswp((float *)(indx.hipnt),indx.hinum);
+	}
+      if ( indx.hfnum > 0 )
+	{
+	  indx.hfpnt = (float *) malloc(sizeof(float)*indx.hfnum);
+	  nbytes = fread (indx.hfpnt,sizeof(float),indx.hfnum,mapfp);
+	  if ( swpflg ) gabswp(indx.hfpnt,indx.hfnum);
+	}
+      if ( indx.intnum > 0 )
+	{
+	  indx.intpnt = (int *) malloc(sizeof(int)*indx.intnum);
+	  nbytes = fread (indx.intpnt,sizeof(int),indx.intnum,mapfp);
+	  if ( swpflg ) gabswp((float *)(indx.intpnt),indx.intnum);
+	}
+      if ( indx.fltnum > 0 )
+	{
+	  indx.fltpnt = (float *) malloc(sizeof(float)*indx.fltnum);
+	  nbytes = fread (indx.fltpnt,sizeof(float),indx.fltnum,mapfp);
+	  if ( swpflg ) gabswp(indx.fltpnt,indx.fltnum);
+	}
+    }
+
+  fclose(mapfp);
+
+  printf("hinum: %d\n", indx.hinum);
+  for ( i = 0; i < indx.hinum; i++ )
+    printf("%3d %5d\n", i+1, indx.hipnt[i]);
+  
+  printf("\n");
+  printf("hfnum: %d\n", indx.hfnum);
+  for ( i = 0; i < indx.hfnum; i++ )
+    printf("%3d %g\n", i+1, indx.hfpnt[i]);
+  
+  printf("\n");
+  if ( indx.intnum == indx.fltnum )
+    {
+      printf("num: %d\n", indx.intnum);
+      for ( i = 0; i < indx.intnum/3; i++ )
+	printf("%3d %8d %6d %4d %8g %10g %8g\n", i+1,
+	       indx.intpnt[i*3], indx.intpnt[i*3+1], indx.intpnt[i*3+2],
+	       indx.fltpnt[i*3], indx.fltpnt[i*3+1], indx.fltpnt[i*3+2]);
+    }
+  else
+    {
+      printf("intnum: %d\n", indx.intnum);
+      for ( i = 0; i < indx.intnum; i++ )
+	printf("%3d %d\n", i+1, indx.intpnt[i]);
+
+      printf("\n");
+      printf("fltnum: %d\n", indx.fltnum);
+      for ( i = 0; i < indx.fltnum; i++ )
+	printf("%3d %g\n", i+1, indx.fltpnt[i]);
+    }
+}
+
+static
+void ctl_xydef(FILE *gdp, int gridID, int *yrev)
+{
+  int gridtype;
+  int i, j;
+  int xsize, ysize;
+  double xfirst, yfirst, xinc, yinc;
+  double *xvals, *yvals;
+
+  *yrev = FALSE;
+
+  xsize  = gridInqXsize(gridID);
+  ysize  = gridInqYsize(gridID);
+
+  gridtype = gridInqType(gridID);
+
+  /* XDEF */
+
+  if ( gridtype == GRID_LCC )
+    {
+      double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
+      double xmin = 1.e10, xmax = -1.e10, ymin = 1.e10, ymax = -1.e10;
+      double xrange, yrange;
+      int projflag, scanflag;
+      int nx, ny, ni;
+      double inc[] = { 1, 0.5, 0.2, 0.1, 0.05, 0.02, 0.01, 0.005, 0.002, 0.001 };
+
+      gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm,
+		 &projflag, &scanflag);
+      fprintf(gdp, "PDEF %d %d lcc %g %g 1 1 %g %g %g %g %g\n", 
+	      xsize, ysize, originLat, originLon, lat1, lat2, lonParY, xincm, yincm);
+
+      gridID = gridToCurvilinear(gridID, 0);
+      xvals = (double *) malloc(xsize*ysize*sizeof(double));
+      yvals = (double *) malloc(xsize*ysize*sizeof(double));
+      gridInqXvals(gridID, xvals);
+      gridInqYvals(gridID, yvals);
+      for ( i = 0; i < xsize*ysize; ++i )
+	{
+	  if ( xvals[i] > 180  ) xvals[i] -= 360;
+	  if ( xvals[i] < xmin ) xmin = xvals[i];
+	  if ( xvals[i] > xmax ) xmax = xvals[i];
+	  if ( yvals[i] < ymin ) ymin = yvals[i];
+	  if ( yvals[i] > ymax ) ymax = yvals[i];
+	}
+      free(xvals);
+      free(yvals);
+
+      xfirst = ((int)(xmin-0.0));
+      yfirst = ((int)(ymin-0.0));
+      xrange = ((int)(xmax+1.5)) - xfirst;
+      yrange = ((int)(ymax+1.5)) - yfirst;
+
+      ni = sizeof(inc)/sizeof(inc[0]);
+      for ( i = 0; i < ni; i++ )
+	{
+	  xinc = yinc = inc[i];
+	  nx = 1 + (int) (xrange / xinc);
+	  ny = 1 + (int) (yrange / yinc);
+
+	  if ( nx > 1.5*xsize && ny > 1.5*ysize ) break;
+	}
+
+      fprintf(gdp, "XDEF %d LINEAR %f %f\n", nx, xfirst, xinc);
+      fprintf(gdp, "YDEF %d LINEAR %f %f\n", ny, yfirst, yinc);
+
+      fprintf(gdp, "* XDEF 3600 LINEAR -179.95 0.1\n");
+      fprintf(gdp, "* YDEF 1800 LINEAR  -89.95 0.1\n");
+    }
+  else
+    {
+      xfirst = gridInqXval(gridID, 0);
+      xinc   = gridInqXinc(gridID);
+      if ( IS_EQUAL(xinc, 0) && gridInqXvals(gridID, NULL) )
+	{
+	  xvals = (double *) malloc(xsize*sizeof(double));
+	  gridInqXvals(gridID, xvals);
+	  fprintf(gdp ,"XDEF %d LEVELS ", xsize);
+	  j = 0;
+	  for ( i = 0; i < xsize; i++ )
+	    {
+	      fprintf(gdp, "%7.3f ", xvals[i]); 
+	      j++;
+	      if ( j == 6 )
+		{
+		  fprintf(gdp, "\n");
+		  j = 0;
+		  if ( i != xsize-1 ) fprintf(gdp, "               ");
+		}
+	    }
+	  if ( j ) fprintf(gdp, "\n");
+	  
+	  free(xvals);
+	}
+      else
+	{
+	  if ( IS_EQUAL(xinc, 0) ) xinc = 360.0/xsize;
+	  fprintf(gdp, "XDEF %d LINEAR %f %f\n", xsize, xfirst, xinc);	  
+	}
+    }
+
+  /* YDEF */
+
+  if ( gridtype != GRID_LCC )
+    {
+      yfirst = gridInqYval(gridID, 0);
+      yinc   = gridInqYinc(gridID);
+      if ( gridtype == GRID_GAUSSIAN ) yinc = 0;
+
+      if ( IS_EQUAL(yinc, 0) && gridInqYvals(gridID, NULL) )
+	{
+	  yvals = (double *) malloc(ysize*sizeof(double));
+	  gridInqYvals(gridID, yvals);
+	  fprintf(gdp ,"YDEF %d LEVELS ", ysize);
+	  j = 0;
+	  if ( yvals[0] > yvals[ysize-1] )
+	    {
+	      *yrev = TRUE;
+	      for ( i = ysize-1; i >= 0; i-- )
+		{
+		  fprintf(gdp, "%7.3f ", yvals[i]); 
+		  j++;
+		  if ( j == 6 )
+		    {
+		      fprintf(gdp, "\n");
+		      j = 0;
+		      if ( i != 0 ) fprintf(gdp, "               ");
+		    }
+		}
+	    }
+	  else
+	    {
+	      for ( i = 0; i < ysize; i++ )
+		{
+		  fprintf(gdp, "%7.3f ", yvals[i]); 
+		  j++;
+		  if ( j == 6 )
+		    {
+		      fprintf(gdp, "\n");
+		      j = 0;
+		      if ( i != ysize-1 ) fprintf(gdp, "               ");
+		    }
+		}
+	    }
+
+	  if ( j ) fprintf(gdp, "\n");
+
+	  free(yvals);
+	}
+      else
+	{
+	  if ( IS_EQUAL(yinc, 0) ) yinc = 180.0/ysize;
+	  if ( yinc < 0)
+	    {
+	      *yrev = TRUE;
+	      fprintf(gdp, "YDEF %d LINEAR %f %f\n", ysize, yfirst + yinc * (ysize-1 ), -yinc);
+	    }
+	  else
+	    fprintf(gdp, "YDEF %d LINEAR %f %f\n", ysize, yfirst, yinc);
+	}
+    }
+}
+
+static
+void ctl_zdef(FILE *gdp, int vlistID, int *zrev)
+{
+  int i, j, index;
+  int zaxisIDmax = -1, nlevmax;
+  int nzaxis, zaxisID, nlev;
+  int lplev = FALSE;
+  double *levels, level0, levinc = 0;
+
+  *zrev = FALSE;
+  nzaxis  = vlistNzaxis(vlistID);
+
+  nlevmax = 0;
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      zaxisID = vlistZaxis(vlistID, index);
+      nlev    = zaxisInqSize(zaxisID);
+      if ( nlev > nlevmax )
+	{
+	  nlevmax = nlev;
+	  zaxisIDmax = zaxisID;
+	}
+    }
+
+  levels = (double *) malloc(nlevmax*sizeof(double));
+  zaxisInqLevels(zaxisIDmax, levels);
+  if ( zaxisInqType(zaxisIDmax) == ZAXIS_PRESSURE ) lplev = TRUE;
+  level0 = levels[0];
+  if ( nlevmax > 1 )
+    {
+      if ( levels[0] < levels[1] && zaxisInqType(zaxisIDmax) != ZAXIS_HYBRID )
+	*zrev = TRUE;
+
+      levinc = levels[1] - levels[0];
+
+      if ( IS_EQUAL(levinc, 1) ) *zrev = FALSE;
+
+      for ( i = 1; i < nlevmax; i++ )
+	{
+	  if ( IS_NOT_EQUAL(levinc, (levels[i] - levels[i-1])) )
+	    {
+	      levinc = 0;
+	      break;
+	    }
+	}
+    }
+
+  if ( IS_NOT_EQUAL(levinc, 0) )
+    fprintf(gdp,"ZDEF %d LINEAR %g %g\n", nlevmax, level0, levinc);
+  else
+    {
+      fprintf(gdp, "ZDEF %d LEVELS ", nlevmax);
+      j  = 0;
+      /* zrev not needed !!!
+      if ( *zrev )
+	{
+	  for ( i = nlevmax-1; i >=0 ; i-- )
+	    {
+	      if ( lplev ) fprintf(gdp, "%g ", levels[i]/100);
+	      else         fprintf(gdp, "%d ", (int) levels[i]);
+	      j++;
+	      if ( j == 10 )
+		{
+		  fprintf(gdp, "\n");
+		  j = 0;
+		  if ( i != 0 ) fprintf(gdp, "               ");
+		}
+	    }
+	}
+      else
+      */
+	{
+	  for ( i = 0; i < nlevmax ; i++ )
+	    {
+	      if ( lplev ) fprintf(gdp, "%g ", levels[i]/100);
+	      else         fprintf(gdp, "%g ", levels[i]);
+	      j++;
+	      if ( j == 10 )
+		{
+		  fprintf(gdp, "\n");
+		  j = 0;
+		  if ( i != (nlevmax-1) ) fprintf(gdp, "               ");
+		}
+	    }
+	}
+      if ( j ) fprintf(gdp, "\n");
+    }
+
+  free(levels);
+}
+
+static
+void ctl_options(FILE *gdp, int yrev, int zrev, int sequential, int bigendian, int littleendian, int flt64)
+{
+  /* if ( filetype == FILETYPE_GRB ) zrev = FALSE; */
+
+  if ( yrev || zrev || sequential || bigendian || littleendian || flt64 )
+    {
+      fprintf(gdp, "OPTIONS");
+      if ( yrev )         fprintf(gdp, " yrev");
+      if ( zrev )         fprintf(gdp, " zrev");
+      if ( sequential )   fprintf(gdp, " sequential");
+      if ( bigendian )    fprintf(gdp, " big_endian");
+      if ( littleendian ) fprintf(gdp, " little_endian");
+      if ( flt64 )        fprintf(gdp, " flt64");
+      fprintf(gdp, "\n");
+    }
+}
+
+static
+void ctl_undef(FILE *gdp, int vlistID)
+{
+  double missval;
+
+  missval = vlistInqVarMissval(vlistID, 0);
+  fprintf(gdp, "UNDEF  %g\n", missval);
+}
+
+static
+void ctl_vars(FILE *gdp, int filetype, int vlistID, int nvarsout, int *vars)
+{
+  int varID, nvars;
+  int ltype, code;
+  int zaxisID, nlev;
+  int i, j;
+  int len;
+  char varname[CDI_MAX_NAME], varlongname[CDI_MAX_NAME], varunits[CDI_MAX_NAME];
+
+  nvars   = vlistNvars(vlistID);
+
+  fprintf(gdp, "VARS  %d\n", nvarsout);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( vars[varID] == TRUE )
+	{
+	  zaxisID = vlistInqVarZaxis(vlistID, varID);
+	  ltype   = zaxisInqLtype(zaxisID);
+	  nlev    = zaxisInqSize(zaxisID);
+	  vlistInqVarName(vlistID, varID, varname);
+
+	  len = (int) strlen(varname);
+	  for ( i = 0; i < len; i++ )
+	    if ( varname[i] == '-' ) break;
+
+	  if ( i < len )
+	    for ( j = i; j < len; j++ )
+	      varname[j] = varname[j+1];
+
+	  vlistInqVarLongname(vlistID, varID, varlongname);
+	  vlistInqVarUnits(vlistID, varID, varunits);
+	  fprintf(gdp, "%-15s", varname);
+      
+	  if ( nlev == 1 ) nlev = 0;
+
+	  fprintf(gdp, "  %3d", nlev);
+
+	  if ( filetype == FILETYPE_GRB )
+	    {
+	      code = vlistInqVarCode(vlistID, varID);
+	      /*	      
+	      if      ( ltype == ZAXIS_SURFACE )  ltype = 1;
+	      else if ( ltype == ZAXIS_PRESSURE ) ltype = 99;
+	      else if ( nlev == 1 )  ltype = 1;
+	      else ltype = 99;
+	      */
+	      fprintf(gdp, "  %d,%d", code, ltype);
+	    }
+	  else
+	    fprintf(gdp, "  99");
+
+	  if ( varlongname[0] == 0 )
+	    fprintf(gdp, "  %s", varname);
+	  else
+	    fprintf(gdp, "  %s", varlongname);
+
+	  if ( varunits[0] != 0 )
+	    fprintf(gdp, "  [%s]", varunits);
+	
+	  fprintf(gdp, "\n");      
+	}
+    }
+
+  fprintf(gdp, "ENDVARS\n");
+}
+
+static
+void write_map_grib1(const char *ctlfile, int map_version, int nrecords, int *intnum, float *fltnum)
+{
+  int i;
+  struct gaindx indx;
+  FILE *mapfp;
+  int hinum[4];
+
+  mapfp = fopen(ctlfile, "w");
+  if ( mapfp == NULL ) cdoAbort("Open failed on %s", ctlfile);
+
+  indx.type   = 1;  /* GRIB type */
+  indx.hinum  = 4;
+  indx.hfnum  = 0;
+  indx.intnum = 3 * nrecords;
+  indx.fltnum = 3 * nrecords;
+  indx.hipnt  = NULL;
+  indx.hfpnt  = NULL;
+  indx.intpnt = NULL;
+  indx.fltpnt = NULL;
+
+  hinum[0] = 1;
+  hinum[1] = 1;
+  hinum[2] = nrecords;
+  hinum[3] = 255;
+
+  if ( map_version == 2 )
+    {
+      int nb, bcnt, rc, j;
+      float fdum;
+      unsigned char *map;
+      unsigned char ibmfloat[4];
+      
+      /* calculate the size of the ver==1 index file */
+      
+      nb = 2 + (4*4) +  /* version in byte 2, then 4 ints with number of each data type */
+	indx.hinum*sizeof(int)+
+	indx.hfnum*sizeof(int)+
+	indx.intnum*sizeof(int)+
+	indx.fltnum*sizeof(float) ;
+      
+      /* add additional info */
+      
+      nb += 7;      /* base time (+ sec)  for compatibility with earlier version 2 maps */
+      nb += 8*4;    /* grvals for time <-> grid conversion */
+      
+      map = (unsigned char *) malloc(nb);
+      
+      bcnt = 0;
+      Put1Byte(map, bcnt, 0);
+      Put1Byte(map, bcnt, 2); /* version 2 */
+      
+      Put4Byte(map, bcnt, indx.hinum);
+      Put4Byte(map, bcnt, indx.hfnum);
+      Put4Byte(map, bcnt, indx.intnum);
+      Put4Byte(map, bcnt, indx.fltnum);
+      
+      Put2Byte(map, bcnt, 0);   /* initial year   */
+      Put1Byte(map, bcnt, 0);   /* initial month  */ 
+      Put1Byte(map, bcnt, 0);   /* initial day    */
+      Put1Byte(map, bcnt, 0);   /* initial hour   */
+      Put1Byte(map, bcnt, 0);   /* initial minute */
+      Put1Byte(map, bcnt, 0);   /* initial second */
+      
+      if( indx.hinum )
+	for ( i = 0; i < indx.hinum; i++ )
+	  Put4Byte(map, bcnt, hinum[i]);
+      
+      if( indx.hfnum ) {
+	/* blank for now */
+      }
+      
+      for ( i = 0; i < indx.intnum; i++ )
+	PutInt(map, bcnt, intnum[i]);
+      
+      for ( i = 0; i < indx.fltnum; i++)
+	{
+	  fdum= fltnum[i];
+	  rc = flt2ibm(fdum, ibmfloat); 
+	  if ( rc < 0 ) cdoAbort("overflow in IBM float conversion");
+	  for ( j = 0; j < 4; j++ ) map[bcnt++] = ibmfloat[j];
+	}
+      
+      /* write out the factors for converting from grid to absolute time */ 
+      
+      for ( i = 0; i < 8; i++)
+	{
+	  fdum = 0;
+	  rc = flt2ibm(fdum, ibmfloat); 
+	  if ( rc < 0 ) cdoAbort("overflow in IBM float conversion");
+	  for ( j = 0; j < 4; j++ ) map[bcnt++] = ibmfloat[j];
+	}
+      
+      fwrite(map, 1, bcnt, mapfp);
+	  
+      free(map);
+    }
+  else
+    {
+      fwrite(&indx, sizeof(struct gaindx), 1, mapfp);
+      fwrite(hinum, sizeof(int), 4, mapfp);
+      fwrite(intnum, sizeof(int), 3*nrecords, mapfp);
+      fwrite(fltnum, sizeof(float), 3*nrecords, mapfp);
+    }
+  
+  fclose(mapfp);
+}
+
+
+void *Gradsdes(void *argument)
+{
+  int GRADSDES1, GRADSDES2, DUMPMAP;
+  int operatorID;
+  int streamID = 0;
+  int gridID = -1;
+  int gridtype = -1;
+  int nvars, ngrids;
+  int nvarsout;
+  int ntsteps;
+  int index;
+  int vlistID, tsID, varID;
+  int recID, levelID;
+  int filetype, byteorder;
+  int taxisID, nrecs;
+  int vdate, vtime;
+  const char *datfile;
+  char ctlfile[1024], *pctlfile;
+  int len;
+  char varname[CDI_MAX_NAME];
+  FILE *gdp;
+  int yrev = FALSE;
+  int zrev = FALSE;
+  int xsize = 0, ysize = 0;
+  int res;
+  int xyheader = 0;
+  int nrecords = 0;
+  int bigendian = FALSE, littleendian = FALSE;
+  int flt64 = 0;
+  int sequential = FALSE;
+  char Time[30], Incr[10] = {"1mn"}, *IncrKey[] = {"mn","hr","dy","mo","yr"};
+  int isd, imn, ihh, iyy, imm, idd;
+  int isds = 0, imns = 0, ihhs = 0, iyys = 0, imms = 0, idds = 0;
+  int isd0 = 0, imn0 = 0, ihh0 = 0, iyy0 = 0, imm0 = 0, idd0 = 0;
+  int idmn, idhh, idmm, idyy, iddd;
+  int dt=1, iik=0, mdt = 0;
+  int gridsize = 0;
+  long checksize = 0;
+  int nmiss;
+  int prec;
+  int map_version = 1;
+  int nrecsout = 0;
+  int maxrecs = 0;
+  int monavg = -1;
+  int *vars = NULL;
+  int *recoffset = NULL;
+  int *intnum = NULL;
+  float *fltnum = NULL;
+  double *array = NULL;
+  const char *cmons[]={"jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"};
+      
+  cdoInitialize(argument);
+
+  GRADSDES1 = cdoOperatorAdd("gradsdes1", 0, 0, NULL);
+  GRADSDES2 = cdoOperatorAdd("gradsdes2", 0, 0, NULL);
+  DUMPMAP   = cdoOperatorAdd("dumpmap",   0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == GRADSDES2 ) map_version = 2;
+
+  if ( cdoStreamName(0)[0] == '-' )
+    cdoAbort("This operator does not work with pipes!");
+
+  if ( operatorID == DUMPMAP )
+    {
+      dumpmap();
+
+      goto END_LABEL;
+    }
+
+  streamID = streamOpenRead(cdoStreamName(0));
+
+  vlistID = streamInqVlist(streamID);
+
+  nvars   = vlistNvars(vlistID);
+  ntsteps = vlistNtsteps(vlistID);
+  ngrids  = vlistNgrids(vlistID);
+
+  filetype  = streamInqFiletype(streamID);
+  byteorder = streamInqByteorder(streamID);
+
+  if ( filetype != FILETYPE_SRV &&
+       filetype != FILETYPE_EXT &&
+       filetype != FILETYPE_IEG &&
+       filetype != FILETYPE_GRB )
+    {
+      if ( filetype == FILETYPE_NC || filetype == FILETYPE_NC2 || filetype == FILETYPE_NC4 )
+	cdoAbort("Unsupported file format: netCDF");
+      else if ( filetype == FILETYPE_GRB2 )
+	cdoAbort("Unsupported file format: GRIB2");
+      else
+	cdoAbort("Unsupported file format!");
+    }
+
+  /* find the first lonlat or Gaussian grid */
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID = vlistGrid(vlistID, index);
+      gridtype = gridInqType(gridID);
+      if ( gridtype == GRID_LONLAT   ||
+	   gridtype == GRID_GAUSSIAN ||
+	   gridtype == GRID_LCC  ) break;
+    }
+
+  if ( index == ngrids )
+    cdoAbort("No Lon/Lat, Gaussian or Lambert grid found (%s data unsupported)!",
+	     gridNamePtr(gridtype));
+
+  /* select all variables with used gridID */
+  vars = (int *) malloc(nvars*sizeof(int));
+  recoffset = (int *) malloc(nvars*sizeof(int));
+  nvarsout = 0;
+  nrecsout = 0;
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( vlistInqVarGrid(vlistID, varID) == gridID )
+	{
+	  if ( filetype == FILETYPE_SRV ||
+	       filetype == FILETYPE_EXT ||
+	       filetype == FILETYPE_IEG )
+	    {
+	      prec = vlistInqVarDatatype(vlistID, varID);
+	      if ( prec == DATATYPE_FLT64 ) flt64 = 1;
+	    }
+	  vars[varID] = TRUE;
+	  recoffset[varID] = nrecsout;
+	  nvarsout++;
+	  nrecsout += zaxisInqSize(vlistInqVarZaxis(vlistID, varID));
+	  if ( ntsteps != 1 && ntsteps != 0 && vlistInqVarTsteptype(vlistID, varID) == TSTEP_CONSTANT )
+	    cdoAbort("Unsupported GrADS record structure! Variable %d has only 1 time step.",
+		     vlistInqVarCode(vlistID, varID));
+	}
+      else
+	{
+	  vlistInqVarName(vlistID, varID, varname);
+	  cdoPrint("Unsupported grid type >%s<, skipped variable %s!",
+		   gridNamePtr(gridInqType(vlistInqVarGrid(vlistID, varID))), varname);
+	  vars[varID] = FALSE;
+	}
+    }
+
+  if ( filetype != FILETYPE_GRB && nvars != nvarsout )
+    cdoAbort("Too many different grids!");    
+
+  if ( filetype == FILETYPE_SRV )
+    {
+      xyheader = 40;
+      if ( flt64 ) xyheader = 72;
+      sequential = TRUE;
+      if ( byteorder == CDI_BIGENDIAN )    bigendian = TRUE;
+      if ( byteorder == CDI_LITTLEENDIAN ) littleendian = TRUE;
+    }
+
+  if ( filetype == FILETYPE_EXT )
+    {
+      xyheader = 24;
+      if ( flt64 ) xyheader = 40;
+      sequential = TRUE;
+      if ( byteorder == CDI_BIGENDIAN )    bigendian = TRUE;
+      if ( byteorder == CDI_LITTLEENDIAN ) littleendian = TRUE;
+    }
+
+  if ( filetype == FILETYPE_IEG )
+    {
+      xyheader = 644;
+      if ( flt64 ) xyheader = 1048;
+      sequential = TRUE;
+      if ( byteorder == CDI_BIGENDIAN )    bigendian = TRUE;
+      if ( byteorder == CDI_LITTLEENDIAN ) littleendian = TRUE;
+    }
+
+  strcpy(ctlfile, cdoStreamName(0));
+  len = (int) strlen(ctlfile);
+  if ( len > 4 )
+    {
+      if ( filetype == FILETYPE_SRV )
+	if ( strcmp(&ctlfile[len-4], ".srv") == 0 ) ctlfile[len-4] = 0;
+      if ( filetype == FILETYPE_EXT )
+	if ( strcmp(&ctlfile[len-4], ".ext") == 0 ) ctlfile[len-4] = 0;
+      if ( filetype == FILETYPE_IEG )
+	if ( strcmp(&ctlfile[len-4], ".ieg") == 0 ) ctlfile[len-4] = 0;
+      if ( filetype == FILETYPE_GRB )
+	if ( strcmp(&ctlfile[len-4], ".grb") == 0 ) ctlfile[len-4] = 0;
+    }
+
+  strcat(ctlfile, ".ctl");
+  gdp = fopen(ctlfile, "w");
+  if ( gdp == NULL ) cdoAbort("Open failed on %s", ctlfile);
+
+#if defined (VERSION)
+  fprintf(gdp, "* Generated by CDO version %s\n", VERSION);
+  fprintf(gdp, "*\n");
+#endif
+
+  /* DSET */
+
+  datfile = cdoStreamName(0);
+  if ( datfile[0] == '/' )
+    fprintf(gdp, "DSET  %s\n", datfile);
+  else
+    {
+      datfile = strrchr(datfile, '/');
+      if ( datfile == 0 ) datfile = cdoStreamName(0);
+      else                datfile++;	  
+      fprintf(gdp, "DSET  ^%s\n", datfile);
+    }
+
+  /* DTYPE */
+  if ( filetype == FILETYPE_GRB )
+    {
+      fprintf(gdp, "DTYPE  GRIB\n");
+
+      pctlfile = ctlfile;
+      len = (int) strlen(pctlfile);
+      strcpy(&pctlfile[len-4], ".gmp");
+      
+      if ( datfile[0] == '/' )
+	fprintf(gdp, "INDEX  %s\n", pctlfile);
+      else
+	{
+	  pctlfile = strrchr(pctlfile, '/');
+	  if ( pctlfile == 0 ) pctlfile = ctlfile;
+	  else                 pctlfile++;	  
+	  fprintf(gdp, "INDEX  ^%s\n", pctlfile);
+	}
+
+      gridsize = vlistGridsizeMax(vlistID);
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  /* XYHEADER */
+  if ( xyheader ) fprintf(gdp, "XYHEADER  %d\n", xyheader);
+
+  /* TIME */
+
+  taxisID = vlistInqTaxis(vlistID);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID);
+      vtime = taxisInqVtime(taxisID);
+
+      if ( tsID == 0 )
+	{
+	  cdiDecodeDate(vdate, &iyys, &imms, &idds);
+	  cdiDecodeTime(vtime, &ihhs, &imns, &isds);
+     
+	  if ( imms < 1 || imms > 12 )  imms=1;
+
+	  ihh0 = ihhs;
+	  imn0 = imns;
+	  iyy0 = iyys;
+	  imm0 = imms;
+	  idd0 = idds;
+	}
+
+      if ( tsID == 1 )
+	{
+	  cdiDecodeDate(vdate, &iyy, &imm, &idd);
+	  cdiDecodeTime(vtime, &ihh, &imn, &isd);
+
+	  idmn = imn - imns;
+	  idhh = ihh - ihhs;
+	  iddd = idd - idds;
+	  idmm = imm - imms;
+	  idyy = iyy - iyys;
+
+	  if ( idmn != 0 )
+	    {
+	      dt = idmn + (idhh + (iddd + (idmm*30 + idyy*12)*30)*24)*60;
+	    }
+	  else if ( idhh != 0 )
+	    {
+	      dt = idhh + (iddd + (idmm + idyy*12)*30)*24;
+	      iik = 1;
+	    }
+	  else if ( iddd != 0 )
+	    {
+	      dt = iddd + (idmm + idyy*12)*30;
+	      iik = 2;
+	    }
+	  else if ( idmm != 0 )
+	    {
+	      dt = idmm + idyy*12;
+	      iik = 3;
+	    }
+	  else if ( idyy != 0 )
+	    {
+	      dt = idyy;
+	      iik = 4;
+	    }
+
+	  if ( dt <= 0 ) dt = 1;
+	}
+
+      if ( tsID > 0 && tsID < 6 && iik != 3 && (monavg == TRUE || monavg == -1) )
+	{
+	  cdiDecodeDate(vdate, &iyy, &imm, &idd);
+	  cdiDecodeTime(vtime, &ihh, &imn, &isd);
+
+	  idmn = imn - imns;
+	  idhh = ihh - ihhs;
+	  iddd = idd - idds;
+	  idmm = imm - imms;
+	  idyy = iyy - iyys;
+
+	  if ( iddd < 0 ) iddd *= -1;
+	  if ( idyy > 0 ) idmm += idyy*12;
+
+	  if ( idmn == 0 && idhh == 0 && (iddd == 0 || idd > 27 ) &&
+	       idmm > 0 && (mdt == 0 || idmm == mdt) )
+	    {
+	      mdt = idmm;
+	      monavg = TRUE;
+	    }
+	  else
+	    {
+	      monavg = FALSE;
+	    }
+	  /*
+	  printf("monavg %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d %4d\n",
+		 tsID, monavg, mdt, imm , imms, idmm, iyy, iyys, idyy, idd, idds, iddd);
+	  */
+          imns = imn;
+          ihhs = ihh;
+	  idds = idd;
+          imms = imm;
+          iyys = iyy;
+	}
+
+      if ( filetype == FILETYPE_GRB )
+	{
+	  nrecords += nrecsout;
+	  if ( nrecords >= maxrecs )
+	    {
+	      maxrecs = nrecords;
+	      intnum = (int *) realloc(intnum, 3*maxrecs*sizeof(int));
+	      fltnum = (float *) realloc(fltnum, 3*maxrecs*sizeof(float));
+	    }
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID, &varID, &levelID);
+	      if ( vars[varID] == TRUE )
+		{
+		  streamReadRecord(streamID, array, &nmiss);
+
+		  index = 3*(tsID*nrecsout + recoffset[varID] + levelID);
+	      
+		  streamInqGinfo(streamID, &intnum[index], &fltnum[index]);
+
+		  checksize = (long)intnum[index] + (long)gridsize*intnum[index+2]/8;
+		  if ( checksize < 0L || checksize > 2147483647L )
+		    {
+		      nrecords -= nrecsout;
+		      cdoWarning("GRIB file too large for GrADS! Only the first %d time steps (2GB) are processed.", tsID);
+		      goto LABEL_STOP;
+		    }
+		}
+	    }
+	}
+
+      tsID++;
+    }
+
+ LABEL_STOP:
+
+  /* XYDEF */
+  ctl_xydef(gdp, gridID, &yrev);
+
+  /* ZDEF */
+  ctl_zdef(gdp, vlistID, &zrev);
+
+  /* TDEF */
+
+  if ( monavg == TRUE )
+    {
+      dt = mdt;
+      iik = 3;
+      if ( idd0 > 28 )
+	{
+	  /* int iddx = idd0; */
+	  idd0 = 1;
+	  cdoPrint("Reset start date to %02d:%02dZ%02d%s%04d",
+		   ihh0, imn0, idd0, cmons[imm0-1], iyy0);
+	}
+    }
+
+  sprintf (Time, "%02d:%02dZ%02d%s%04d", ihh0, imn0, idd0, cmons[imm0-1], iyy0);
+  sprintf (Incr, "%d%s", dt, IncrKey[iik]);
+
+  fprintf (gdp, "TDEF %d LINEAR %s %s\n", tsID, Time, Incr);
+
+  /* TITLE */
+
+  xsize  = gridInqXsize(gridID);
+  ysize  = gridInqYsize(gridID);
+
+  res = 0;
+  if ( gridtype == GRID_GAUSSIAN ) res = nlat2ntr(ysize);
+
+  if ( res )
+    fprintf(gdp, "TITLE  %s  T%d grid\n", datfile, res);
+  else
+    fprintf(gdp, "TITLE  %s  %dx%d grid\n", datfile, xsize, ysize);
+
+  /* OPTIONS */
+  ctl_options(gdp, yrev, zrev, sequential, bigendian, littleendian, flt64);
+
+  /* UNDEF */
+  ctl_undef(gdp, vlistID);
+
+  /* VARS */
+  ctl_vars(gdp, filetype, vlistID, nvarsout, vars);
+
+
+  /* INDEX file */
+  if ( filetype == FILETYPE_GRB )
+    {
+      write_map_grib1(ctlfile, map_version, nrecords, intnum, fltnum);
+    }
+
+
+  streamClose(streamID);
+
+  if ( vars ) free(vars);
+  if ( recoffset ) free(recoffset);
+  if ( array ) free(array);
+  if ( intnum ) free(intnum);
+  if ( fltnum ) free(fltnum);
+
+ END_LABEL:
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Gridboxstat.c b/src/Gridboxstat.c
new file mode 100644
index 0000000..642bd46
--- /dev/null
+++ b/src/Gridboxstat.c
@@ -0,0 +1,744 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Gridboxstat    gridboxmin          Gridbox minimum
+      Gridboxstat    gridboxmax          Gridbox maximum
+      Gridboxstat    gridboxsum          Gridbox sum
+      Gridboxstat    gridboxmean         Gridbox mean
+      Gridboxstat    gridboxavg          Gridbox average
+      Gridboxstat    gridboxstd          Gridbox standard deviation
+      Gridboxstat    gridboxvar          Gridbox variance
+*/
+
+#if defined (_OPENMP)
+#  include <omp.h>
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+static
+int genBoxGrid(int gridID1, int xinc, int yinc)
+{
+  int i, j, i1;
+  int gridID2 = -1, gridtype;
+  int gridsize1 = 0, nlon1 = 0, nlat1 = 0;
+  int gridsize2 = 0, nlon2 = 0, nlat2 = 0;
+  int x1, y1, x2, y2;
+  int use_x1, use_y1;
+  int corner, add, g2_add; 
+  int g1_add;
+  int circular = gridIsCircular(gridID1) ;
+  int gridHasBounds = FALSE;
+  double *xvals1, *yvals1, *xvals2, *yvals2;
+  double *grid1_corner_lon = NULL, *grid1_corner_lat = NULL;
+  double *grid2_corner_lon = NULL, *grid2_corner_lat = NULL;
+  double on_up, on_lo, ox_up, ox_lo, an_le, an_ri, ax_le, ax_ri;
+  double xvals2_0 = 0;
+  double area_norm;  
+
+ 
+  gridtype  = gridInqType(gridID1);
+  gridsize1 = gridInqSize(gridID1);
+ 
+  if ( cdoVerbose )
+    {
+      if ( ! circular )
+        fprintf(stderr, "grid is not circular\n");
+      else
+        fprintf(stderr, "grid is circular\n");
+    }
+
+  if ( xinc < 1 || yinc < 1 )
+    cdoAbort("xinc and yinc must not be smaller than 1!");
+  
+  if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_LONLAT ||
+       gridtype == GRID_CURVILINEAR || gridtype == GRID_GENERIC )
+    {
+      nlon1 = gridInqXsize(gridID1);
+      nlat1 = gridInqYsize(gridID1);
+
+      nlon2 = nlon1/xinc;
+      nlat2 = nlat1/yinc;
+      if ( nlon1%xinc ) nlon2++;
+      if ( nlat1%yinc ) nlat2++;
+      gridsize2 = nlon2*nlat2;
+
+      gridID2 = gridCreate(gridtype, gridsize2);
+      gridDefXsize(gridID2, nlon2);
+      gridDefYsize(gridID2, nlat2);
+    }
+  else
+    {
+      cdoAbort("Unsupported grid: %s", gridNamePtr(gridtype));
+    }
+
+  if ( xinc > nlon1 || yinc > nlat1 )
+    cdoAbort("xinc and/or yinc exceeds gridsize!");
+
+  
+  if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_LONLAT )
+    {
+      if ( gridInqXbounds(gridID1, NULL) && gridInqYbounds(gridID1, NULL) )
+        gridHasBounds = TRUE;
+
+      xvals1 = (double *) malloc(nlon1*sizeof(double));
+      yvals1 = (double *) malloc(nlat1*sizeof(double));
+      xvals2 = (double *) malloc(nlon2*sizeof(double));
+      yvals2 = (double *) malloc(nlat2*sizeof(double));
+      gridInqXvals(gridID1, xvals1);
+      gridInqYvals(gridID1, yvals1);
+
+      if ( gridHasBounds )
+        {
+          grid1_corner_lon = (double *) malloc(2*nlon1*sizeof(double));
+          grid1_corner_lat = (double *) malloc(2*nlat1*sizeof(double));
+          grid2_corner_lon = (double *) malloc(2*nlon2*sizeof(double));
+          grid2_corner_lat = (double *) malloc(2*nlat2*sizeof(double));
+          gridInqXbounds(gridID1, grid1_corner_lon);
+          gridInqYbounds(gridID1, grid1_corner_lat);
+        }
+
+      j = 0;
+      for ( i = 0; i < nlon1; i += xinc )
+        {
+          i1 = i+(xinc-1);
+          if ( i1 >= nlon1-1 ) i1 = nlon1-1; 
+          xvals2[j] = xvals1[i] + (xvals1[i1] - xvals1[i])/2.;
+          if ( gridHasBounds )
+            {
+              grid2_corner_lon[2*j  ] = grid1_corner_lon[2*i];
+              grid2_corner_lon[2*j+1] = grid1_corner_lon[2*i1+1];
+            }
+          j++;        
+        }
+      j = 0;
+      for ( i = 0; i < nlat1; i += yinc )
+        {
+          i1 = i+(yinc-1);
+          if ( i1 >= nlat1-1 ) i1 = nlat1-1; 
+          yvals2[j] = yvals1[i] + (yvals1[i1] - yvals1[i])/2;
+          if ( gridHasBounds )
+            {
+              grid2_corner_lat[2*j]   = grid1_corner_lat[2*i];
+              grid2_corner_lat[2*j+1] = grid1_corner_lat[2*i1+1];
+            }
+          j++;
+        }
+      
+      gridDefXvals(gridID2, xvals2);
+      gridDefYvals(gridID2, yvals2);
+
+      free(xvals2);
+      free(yvals2);
+
+      free(xvals1);
+      free(yvals1);
+      
+      if ( gridHasBounds )
+        {
+          gridDefNvertex(gridID2, 2);
+          gridDefXbounds(gridID2, grid2_corner_lon);
+          gridDefYbounds(gridID2, grid2_corner_lat);
+          free(grid2_corner_lon);
+          free(grid2_corner_lat);
+
+          free(grid1_corner_lon);
+          free(grid1_corner_lat);
+        }
+    } /* if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_LONLAT ) */
+  else if ( gridtype == GRID_GENERIC )
+    {
+    }
+  else if ( gridtype == GRID_CURVILINEAR )
+    {
+      
+      if ( gridInqXbounds(gridID1, NULL) && gridInqYbounds(gridID1, NULL) )
+        gridHasBounds = TRUE;
+      
+      xvals1 = (double *) malloc(nlon1*nlat1*sizeof(double));
+      yvals1 = (double *) malloc(nlon1*nlat1*sizeof(double));
+      xvals2 = (double *) malloc(nlon2*nlat2*sizeof(double));
+      yvals2 = (double *) malloc(nlon2*nlat2*sizeof(double));
+      gridInqXvals(gridID1, xvals1);
+      gridInqYvals(gridID1, yvals1);
+
+      /* Convert lat/lon units if required */
+      {
+	char units[CDI_MAX_NAME];
+	gridInqXunits(gridID1, units);
+	gridToDegree(units, "grid center lon", nlon1*nlat1, xvals1);
+	gridInqYunits(gridID1, units);
+	gridToDegree(units, "grid center lat", nlon1*nlat1, yvals1);
+      }
+      
+      if ( gridHasBounds )
+        {
+          grid1_corner_lon = (double *) malloc(4*nlon1*nlat1*sizeof(double));
+          grid1_corner_lat = (double *) malloc(4*nlon1*nlat1*sizeof(double));
+          grid2_corner_lon = (double *) malloc(4*nlon2*nlat2*sizeof(double));
+          grid2_corner_lat = (double *) malloc(4*nlon2*nlat2*sizeof(double));
+          gridInqXbounds(gridID1, grid1_corner_lon);
+          gridInqYbounds(gridID1, grid1_corner_lat);
+
+	  /* Convert lat/lon units if required */
+	  {
+	    char units[CDI_MAX_NAME];
+	    gridInqXunits(gridID1, units);
+	    gridToDegree(units, "grid corner lon", 4*nlon1*nlat1, grid1_corner_lon);
+	    gridInqYunits(gridID1, units);
+	    gridToDegree(units, "grid corner lat", 4*nlon1*nlat1, grid1_corner_lat);
+	  }
+        }
+      
+      /* Process grid2 bounds */
+      area_norm = xinc*yinc;
+      for ( y2 = 0; y2 < nlat2; y2++ )
+        {
+          for ( x2 = 0; x2 < nlon2; x2++ )
+            {
+              g2_add = (y2*nlon2+x2);
+              on_up = on_lo = 360.; ox_up = ox_lo = -360.;
+              an_ri = an_le =  90.; ax_ri = ax_le =  -90.; 
+              
+              for ( y1 = y2*yinc; y1 < yinc*(y2+1); y1++ )
+                {
+                  if ( y1 >= nlat1 ) use_y1 = nlat1-1;
+                  else use_y1 = y1;
+                  for ( x1 = x2*xinc; x1 < xinc*(x2+1) ; x1++ )
+                    {                    
+                      use_x1 = x1;
+                      if ( x1 >= nlon1  ) 
+                        {
+                          if ( circular && use_y1 == y1 ) 
+                            use_y1 -= 1;
+                          else            
+                            use_x1  = nlon1-1;
+                        }
+                      
+                      g1_add= (use_y1*nlon1)+use_x1;                      
+
+                      if ( y1 == y2*yinc && x1 == x2*xinc )
+                        {
+                          xvals2_0 = xvals1[g1_add];
+                          xvals2[g2_add] = xvals1[g1_add]/area_norm;                        
+                          yvals2[g2_add] = yvals1[g1_add]/area_norm;
+                        }
+                      else if ( fabs(xvals1[g1_add] - xvals2_0) > 270. )
+                        {
+                          if ( (xvals1[g1_add] - xvals2_0) > 270. )
+                            xvals2[g2_add] += (xvals1[g1_add]-360.)/area_norm;
+                          else if ( ( xvals1[g1_add] - xvals2_0 ) < -270. )
+                            xvals2[g2_add] += (xvals1[g1_add]+360.)/area_norm;
+			  yvals2[g2_add] += yvals1[g1_add]/area_norm;  
+                        }
+                      else                      
+                        {
+                          xvals2[g2_add] += xvals1[g1_add]/area_norm;
+                          yvals2[g2_add] += yvals1[g1_add]/area_norm;
+                        }
+                     
+                      if ( gridHasBounds )
+                        {/* 
+                         =====================================================================
+                         ** O L D
+                         */
+                          if ( FALSE )
+                            {
+                              /* upper left cell */
+                              if ( y1 == y2*yinc && x1 == x2*xinc)
+                                {
+                                  for ( corner = 0; corner < 4; corner++ )
+                                    {
+                                      add = 4*g1_add + corner;
+                                      if ( grid1_corner_lon[add] < on_up )
+                                        on_up = grid1_corner_lon[add];
+                                      if (grid1_corner_lat[add] > ax_le )
+                                        ax_le = grid1_corner_lat[add];
+                                    }
+                                }
+                              
+                              /* upper right cell */
+                              if ( ( y1 == y2*yinc ) && ( x1 == (x2+1)*xinc - 1 ) )
+                                {    
+                                  for ( corner = 0; corner < 4; corner++ )
+                                    {
+                                      add = 4*g1_add + corner;
+                                      if ( grid1_corner_lon[add] > ox_up )
+                                        ox_up = grid1_corner_lon[add];
+                                      if (grid1_corner_lat[add] > ax_ri )
+                                        ax_ri = grid1_corner_lat[add];
+                                    }
+                                }
+                              
+                              /* lower right cell */
+                              if ( ( y1 == (y2+1)*yinc -1 ) && (x1 == (x2+1)*xinc -1) )
+                                {
+                                  for ( corner = 0; corner < 4; corner++ )
+                                    {                             
+                                  add = 4*g1_add + corner;
+                                      if ( grid1_corner_lon[add] > ox_lo )
+                                        ox_lo = grid1_corner_lon[add];
+                                      if ( grid1_corner_lat[add] < an_ri )
+                                        an_ri = grid1_corner_lat[add];
+                                    }
+                                }
+                              
+                              /* lower left cell */
+                              if ( ( y1 == (y2+1)*yinc -1 ) && ( x1 == x2*xinc ) )
+                                {    
+                                  for ( corner = 0; corner < 4; corner++ )
+                                    {
+                                      add = 4*g1_add + corner;
+                                      if ( grid1_corner_lon[add] < on_lo )
+                                    on_lo = grid1_corner_lon[add];
+                                      if ( grid1_corner_lat[add] < an_le )
+                                        an_le = grid1_corner_lat[add];
+                                    }
+                                }
+                            }  /* O  L  D */
+                          //=================================================================
+                          else /* N  E  W */
+                            {
+                              int c_flag[4], corner2, g1_add2, g1_add3;
+                              double lon, lat, lon2, lat2, lon3, lat3;
+                              /* upper left cell */
+                              if ( y1 == y2*yinc && x1 == x2*xinc)
+                                {                                 
+                                  c_flag[0] = c_flag[1] = c_flag[2] = c_flag[3] = 0;
+                                  for ( corner = 0; corner < 4; corner++ )
+                                    {                                      
+                                      add = 4*g1_add + corner;
+                                      lon = grid1_corner_lon[add];
+                                      lat = grid1_corner_lat[add]; 
+                                      g1_add2 = g1_add+1;
+                                      if ( g1_add+nlon1 > gridsize1 ) 
+                                        {
+                                          cdoWarning("Can't find cell below upper left");
+                                          continue; 
+                                        }
+                                      g1_add3 = g1_add+nlon1;
+                                      for ( corner2 = 0; corner2 < 4; corner2++ )
+                                        {                                          
+                                          lon2 = grid1_corner_lon[4*g1_add2+corner2];
+                                          lat2 = grid1_corner_lat[4*g1_add2+corner2];
+                                          lon3 = grid1_corner_lon[4*g1_add3+corner2];
+                                          lat3 = grid1_corner_lat[4*g1_add3+corner2];
+                                          if ((IS_EQUAL(lon2, lon) && IS_EQUAL(lat2, lat))  ||
+                                              (IS_EQUAL(lon3, lon) && IS_EQUAL(lat3, lat)) )
+                                            c_flag[corner] = 1;
+                                        }
+                                    }
+                                  for ( corner = 0; corner<4; corner++ )
+                                    if ( !c_flag[corner] ) break;                                 
+                                  on_up = grid1_corner_lon[4*g1_add + corner];
+                                  ax_le = grid1_corner_lat[4*g1_add + corner];                                  
+                                  if ( c_flag[0] + c_flag[1] + c_flag[2] + c_flag[3] < 3 )
+                                    cdoWarning("found two matching corners!");                                  
+                                }
+                              
+                              /* upper right cell */
+                              if ( ( y1 == y2*yinc ) && ( x1 == (x2+1)*xinc - 1 ) )
+                                {
+                                  c_flag[0] = c_flag[1] = c_flag[2] = c_flag[3] = 0;
+                                  for ( corner = 0; corner < 4; corner++ )
+                                    {                                      
+                                      add = 4*g1_add + corner;
+                                      lon = grid1_corner_lon[add];
+                                      lat = grid1_corner_lat[add]; 
+                                      g1_add2 = g1_add-1;                                      
+                                      if ( g1_add+nlon1 > gridsize1 ) 
+                                        {
+                                          cdoWarning("Can't find cell below upper left");
+                                          continue; 
+                                        }
+                                      g1_add3 = g1_add+nlon1;
+                                      for ( corner2 = 0; corner2 < 4; corner2++ )
+                                        {                                          
+                                          lon2 = grid1_corner_lon[4*g1_add2+corner2];
+                                          lat2 = grid1_corner_lat[4*g1_add2+corner2];
+                                          lon3 = grid1_corner_lon[4*g1_add3+corner2];
+                                          lat3 = grid1_corner_lat[4*g1_add3+corner2];
+                                         if ((IS_EQUAL(lon2, lon) && IS_EQUAL(lat2, lat))  ||
+					     (IS_EQUAL(lon3, lon) && IS_EQUAL(lat3, lat)) )
+                                             c_flag[corner] = 1;
+                                        } 
+                                    }                                 
+                                  for ( corner = 0; corner<4; corner++ )
+                                    if ( !c_flag[corner] ) break;                                 
+                                  ox_up = grid1_corner_lon[4*g1_add + corner];
+                                  ax_ri = grid1_corner_lat[4*g1_add + corner];                                  
+                                  if ( c_flag[0] + c_flag[1] + c_flag[2] + c_flag[3] < 3 )
+                                    cdoWarning("found two matching corners!");                                     
+                                }
+                            
+                            
+                              
+                              /* lower right cell */
+                              if ( ( y1 == (y2+1)*yinc -1 ) && (x1 == (x2+1)*xinc -1) )
+                                {                                  
+                                  c_flag[0] = c_flag[1] = c_flag[2] = c_flag[3] = 0;
+                                  for ( corner = 0; corner < 4; corner++ )
+                                    {                                      
+                                      add = 4*g1_add + corner;
+                                      lon = grid1_corner_lon[add];
+                                      lat = grid1_corner_lat[add]; 
+                                      g1_add2 = g1_add-1;
+                                      if ( g1_add-nlon1 < 0 ) 
+                                        {
+                                          cdoWarning("Can't find cell above lower right left");
+                                          continue; 
+                                        }
+                                      g1_add3 = g1_add-nlon1;
+                                      for ( corner2 = 0; corner2 < 4; corner2++ )
+                                        {                                          
+                                          lon2 = grid1_corner_lon[4*g1_add2+corner2];
+                                          lat2 = grid1_corner_lat[4*g1_add2+corner2];
+                                          lon3 = grid1_corner_lon[4*g1_add3+corner2];
+                                          lat3 = grid1_corner_lat[4*g1_add3+corner2];
+                                          if ((IS_EQUAL(lon2, lon) && IS_EQUAL(lat2, lat))  ||
+					      (IS_EQUAL(lon3, lon) && IS_EQUAL(lat3, lat)) )
+                                            c_flag[corner] = 1;
+                                        } 
+                                    }                                  
+                                  for ( corner = 0; corner<4; corner++ )
+                                    if ( !c_flag[corner] ) break;                                 
+                                  ox_lo = grid1_corner_lon[4*g1_add + corner];
+                                  an_ri = grid1_corner_lat[4*g1_add + corner];                                  
+                                  if ( c_flag[0] + c_flag[1] + c_flag[2] + c_flag[3] < 3 )
+                                    cdoWarning("found two matching corners!");        
+                                }
+                              
+                              /* lower left cell */
+                              if ( ( y1 == (y2+1)*yinc -1 ) && ( x1 == x2*xinc ) )
+                                {    
+                                  c_flag[0] = c_flag[1] = c_flag[2] = c_flag[3] = 0;
+                                  for ( corner = 0; corner < 4; corner++ )
+                                    {                                      
+                                      add = 4*g1_add + corner;
+                                      lon = grid1_corner_lon[add];
+                                      lat = grid1_corner_lat[add]; 
+                                      g1_add2 = g1_add+1;
+                                      if ( g1_add-nlon1 < 0 ) 
+                                        {
+                                          cdoWarning("Can't find cell above lower right left");
+                                          continue; 
+                                        }
+                                      g1_add3 = g1_add-nlon1;
+                                      for ( corner2 = 0; corner2 < 4; corner2++ )
+                                        {                                          
+                                          lon2 = grid1_corner_lon[4*g1_add2+corner2];
+                                          lat2 = grid1_corner_lat[4*g1_add2+corner2];
+                                          lon3 = grid1_corner_lon[4*g1_add3+corner2];
+                                          lat3 = grid1_corner_lat[4*g1_add3+corner2];
+                                          if ((IS_EQUAL(lon2, lon) && IS_EQUAL(lat2, lat))  ||
+					      (IS_EQUAL(lon3, lon) && IS_EQUAL(lat3, lat)) )
+                                            c_flag[corner] = 1;
+                                        }
+                                    }                                 
+                                  for ( corner = 0; corner<4; corner++ )
+                                    if ( !c_flag[corner] ) break;                                 
+                                  on_lo = grid1_corner_lon[4*g1_add + corner];
+                                  an_le = grid1_corner_lat[4*g1_add + corner];                                  
+                                  if ( c_flag[0] + c_flag[1] + c_flag[2] + c_flag[3] < 3 )
+                                    cdoWarning("found two matching corners!");                                      
+                                }
+                            }/* else to if(fast) */
+                        }/* if ( gridHasBounds) */                  
+                    }/* for ( x1 = x2*xinc; x1 < xinc*(x2+1) ; x1++ ) */
+                }/* for ( y1 = y2*yinc; y1 < yinc*(y2+1); y1++ ) */
+ 
+              
+              if ( gridHasBounds )
+                {
+                  /* upper left corner */
+                  grid2_corner_lon[4*g2_add+3] = on_up;
+                  grid2_corner_lat[4*g2_add+3] = ax_le;
+                  /* upper right corner */
+                  grid2_corner_lon[4*g2_add+2] = ox_up;
+                  grid2_corner_lat[4*g2_add+2] = ax_ri;
+                  /* lower right corner */
+                  grid2_corner_lon[4*g2_add+1] = ox_lo;
+                  grid2_corner_lat[4*g2_add+1] = an_ri;
+                  /* lower left corner */
+                  grid2_corner_lon[4*g2_add+0] = on_lo;
+                  grid2_corner_lat[4*g2_add+0] = an_le;
+                }
+              
+	      //  while ( xvals2[g2_add] >  180. ) xvals2[g2_add] -= 360.;
+	      //  while ( xvals2[g2_add] < -180. ) xvals2[g2_add] += 360.;
+            } /* for ( x2 = 0; x2 < nlon2; x2++ ) */
+        } /* for ( y2 = 0; y2 < nlat2; y2++ ) */
+      
+      gridDefXvals(gridID2, xvals2);
+      gridDefYvals(gridID2, yvals2);
+
+      free(xvals2);
+      free(yvals2);
+
+      free(xvals1);
+      free(yvals1);
+
+      if ( gridHasBounds )
+        {
+          gridDefNvertex(gridID2, 4);
+          gridDefXbounds(gridID2, grid2_corner_lon);
+          gridDefYbounds(gridID2, grid2_corner_lat);
+          
+          free(grid2_corner_lon);
+          free(grid2_corner_lat);
+          
+          free(grid1_corner_lon);
+          free(grid1_corner_lat);
+        }
+    } /* else if ( gridtype == GRID_CURVILINEAR ) */
+  else
+    {
+      cdoAbort("Unsupported grid: %s", gridNamePtr(gridtype));
+    }
+  
+  return gridID2;
+}
+
+static
+void gridboxstat(field_t *field1, field_t *field2, int xinc, int yinc, int statfunc)
+{
+  int nlon1, nlat1;
+  int nlon2, nlat2;
+  int ilat, ilon;
+  int gridID1, gridID2;
+  int nmiss;
+  double *array1, *array2;
+  double missval;
+  long ig, i, j, ii, jj, index;
+  long gridsize;
+  long ompthID;
+  field_t *field;
+  int isize;
+  int useWeight = FALSE;
+
+  if ( field1->weight ) useWeight = TRUE;
+
+  gridsize      = xinc*yinc;
+  field = (field_t *) malloc(ompNumThreads*sizeof(field_t));
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      field[i].size    = gridsize;
+      field[i].ptr     = (double *) malloc(gridsize*sizeof(double));
+      field[i].weight  = NULL;
+      if ( useWeight )
+	field[i].weight  = (double *) malloc(gridsize*sizeof(double));
+      field[i].missval = field1->missval;
+      field[i].nmiss   = 0;
+    }
+  
+  gridID1 = field1->grid;
+  gridID2 = field2->grid;
+  array1  = field1->ptr;
+  array2  = field2->ptr;
+  missval = field1->missval;
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  nlon2 = gridInqXsize(gridID2);
+  nlat2 = gridInqYsize(gridID2);
+
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(ig, ilat, ilon, j, jj, i, ii, index, isize, ompthID)
+#endif
+  for ( ig = 0; ig < nlat2*nlon2; ++ig )
+    {
+#if defined (_OPENMP)
+      ompthID = omp_get_thread_num();
+#else
+      ompthID = 0;
+#endif
+      ilat = ig/nlon2;
+      ilon = ig - ilat*nlon2;
+
+      isize = 0;
+      field[ompthID].nmiss = 0;
+      for ( j = 0; j < yinc; ++j )
+	{
+	  jj = ilat*yinc+j;
+	  if ( jj >= nlat1 ) break;
+	  for ( i = 0; i < xinc; ++i )
+	    {
+	      ii = ilon*xinc+i;
+	      index = jj*nlon1 + ii;
+	      if ( ii >= nlon1 ) break;
+	      field[ompthID].ptr[isize] = array1[index];
+	      if ( useWeight ) field[ompthID].weight[isize] = field1->weight[index];
+	      if ( DBL_IS_EQUAL(field[ompthID].ptr[isize], field[ompthID].missval) ) field[ompthID].nmiss++;
+	      isize++;
+	    }
+	}
+        
+      field[ompthID].size = isize;
+      field2->ptr[ig] = fldfun(field[ompthID], statfunc);
+    }
+  
+  nmiss = 0;
+  for ( i = 0; i < nlat2*nlon2; i++ )
+    if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
+  
+  field2->nmiss = nmiss;
+  
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      if ( field[i].ptr    ) free(field[i].ptr);
+      if ( field[i].weight ) free(field[i].weight);
+    }
+
+  if ( field ) free(field);
+}
+
+
+void *Gridboxstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int lastgrid = -1;
+  int wstatus = FALSE;
+  int code = 0, oldcode = 0;
+  int index, ngrids;
+  int recID, nrecs;
+  int tsID, varID, levelID;
+  int needWeights = FALSE;
+  int gridID1, gridID2;
+  int gridsize1, gridsize2;
+  field_t field1, field2;
+  int taxisID1, taxisID2;
+  int xinc, yinc;
+
+  cdoInitialize(argument);
+
+  operatorInputArg("xinc, yinc");
+  operatorCheckArgc(2);
+  xinc = atoi(operatorArgv()[0]);
+  yinc = atoi(operatorArgv()[1]);
+
+  cdoOperatorAdd("gridboxmin",  func_min,  0, NULL);
+  cdoOperatorAdd("gridboxmax",  func_max,  0, NULL);
+  cdoOperatorAdd("gridboxsum",  func_sum,  0, NULL);
+  cdoOperatorAdd("gridboxmean", func_mean, 0, NULL);
+  cdoOperatorAdd("gridboxavg",  func_avg,  0, NULL);
+  cdoOperatorAdd("gridboxvar",  func_var,  0, NULL);
+  cdoOperatorAdd("gridboxstd",  func_std,  0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  if ( operfunc == func_mean || operfunc == func_avg ||
+       operfunc == func_var  || operfunc == func_std )
+    needWeights = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids = vlistNgrids(vlistID1);
+  if ( ngrids > 1 )  cdoAbort("Too many different grids!");
+
+  gridID1 = vlistGrid(vlistID1, 0);
+  if ( gridInqType(gridID1) == GRID_GAUSSIAN_REDUCED )
+    cdoAbort("Gaussian reduced grid found. Use option -R to convert it to a regular grid!");
+
+  gridID2 = genBoxGrid(gridID1, xinc, yinc);
+  for ( index = 0; index < ngrids; index++ )
+    vlistChangeGridIndex(vlistID2, index, gridID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize1 = gridInqSize(gridID1);
+  field1.ptr    = (double *) malloc(gridsize1*sizeof(double));
+  field1.weight = NULL;
+  if ( needWeights )
+    field1.weight = (double *) malloc(gridsize1*sizeof(double));
+
+  gridsize2 = gridInqSize(gridID2);
+  field2.ptr    = (double *) malloc(gridsize2*sizeof(double));
+  field2.weight = NULL;
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID1, &varID, &levelID);
+          streamReadRecord(streamID1, field1.ptr, &field1.nmiss);
+
+          field1.grid = vlistInqVarGrid(vlistID1, varID);
+          field1.size = gridInqSize(field1.grid);
+          field1.missval = vlistInqVarMissval(vlistID1, varID);
+          
+          field2.grid = gridID2;
+          field2.size = gridsize2;
+          field2.missval = field1.missval;
+
+          if ( needWeights && field1.grid != lastgrid )
+            {
+	      lastgrid = field1.grid;
+              wstatus = gridWeights(field1.grid, field1.weight);
+            }
+          code = vlistInqVarCode(vlistID1, varID);
+          if ( wstatus != 0 && tsID == 0 && code != oldcode )
+            cdoWarning("Using constant grid cell area weights for code %d!", oldcode=code);
+          
+          gridboxstat(&field1, &field2, xinc, yinc, operfunc);
+          
+          streamDefRecord(streamID2, varID,  levelID);
+          streamWriteRecord(streamID2, field2.ptr, field2.nmiss);
+        }
+      tsID++;
+    }
+  
+  streamClose(streamID2);
+  streamClose(streamID1);
+  
+  if ( field1.ptr )    free(field1.ptr);
+  if ( field1.weight ) free(field1.weight);
+  
+  if ( field2.ptr )    free(field2.ptr);
+  if ( field2.weight ) free(field2.weight);
+  
+  cdoFinish();
+  
+  return (0);
+}
diff --git a/src/Gridcell.c b/src/Gridcell.c
new file mode 100644
index 0000000..5c937f4
--- /dev/null
+++ b/src/Gridcell.c
@@ -0,0 +1,330 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Gridcell   gridarea        Grid cell area in m^2
+      Gridcell   gridweights     Grid cell weights
+      Gridcell   gridmask        Grid mask
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+static
+double orthodrome(double px1, double py1, double px2, double py2)
+{
+  return acos(sin(py1)*sin(py2)+cos(py1)*cos(py2)*cos(px2-px1));
+}
+
+
+void *Gridcell(void *argument)
+{
+  int GRIDAREA, GRIDWGTS, GRIDMASK, GRIDDX, GRIDDY;
+  int operatorID;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridID, zaxisID;
+  int gridtype;
+  int status;
+  int ngrids;
+  int need_radius;
+  int tsID, varID, levelID, taxisID;
+  long i, gridsize;
+  char *envstr;
+  double *array = NULL;
+  double  EarthRadius = 6371000; /* default radius of the earth in m */
+  double PlanetRadius = EarthRadius;
+
+  cdoInitialize(argument);
+
+  GRIDAREA = cdoOperatorAdd("gridarea",     1,  0, NULL);
+  GRIDWGTS = cdoOperatorAdd("gridweights",  1,  0, NULL);
+  GRIDMASK = cdoOperatorAdd("gridmask",     0,  0, NULL);
+  GRIDDX   = cdoOperatorAdd("griddx",       1,  0, NULL);
+  GRIDDY   = cdoOperatorAdd("griddy",       1,  0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  need_radius = cdoOperatorF1(operatorID);
+
+  if ( need_radius )
+    {
+      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));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  ngrids = vlistNgrids(vlistID1);
+
+  if ( ngrids > 1 )
+    cdoWarning("Found more than 1 grid, using the first one!");
+
+  gridID  = vlistGrid(vlistID1, 0);
+
+  zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
+
+  vlistID2 = vlistCreate();
+  varID    = vlistDefVar(vlistID2, gridID, zaxisID, TSTEP_CONSTANT);
+
+  if ( operatorID == GRIDAREA )
+    {
+      vlistDefVarName(vlistID2, varID, "cell_area");
+      vlistDefVarStdname(vlistID2, varID, "area");
+      vlistDefVarLongname(vlistID2, varID, "area of grid cell");
+      vlistDefVarUnits(vlistID2, varID, "m2");
+    }
+  else if ( operatorID == GRIDWGTS )
+    {
+      vlistDefVarName(vlistID2, varID, "cell_weights");
+    }
+  else if ( operatorID == GRIDMASK )
+    {
+      vlistDefVarName(vlistID2, varID, "grid_mask");
+      vlistDefVarDatatype(vlistID2, varID, DATATYPE_UINT8);
+    }
+  else if ( operatorID == GRIDDX )
+    {
+      vlistDefVarName(vlistID2, varID, "dx");
+      vlistDefVarLongname(vlistID2, varID, "delta x");
+      vlistDefVarUnits(vlistID2, varID, "m");
+    }
+  else if ( operatorID == GRIDDY )
+    {
+      vlistDefVarName(vlistID2, varID, "dy");
+      vlistDefVarLongname(vlistID2, varID, "delta y");
+      vlistDefVarUnits(vlistID2, varID, "m");
+    }
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+  vlistDefTaxis(vlistID2, taxisID);
+
+
+  gridsize = gridInqSize(gridID);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+
+  if ( operatorID == GRIDAREA )
+    {
+      gridtype = gridInqType(gridID);
+      if ( gridtype == GRID_LONLAT      ||
+	   gridtype == GRID_GAUSSIAN    ||
+	   gridtype == GRID_LCC         ||
+	   gridtype == GRID_GME         ||
+	   gridtype == GRID_CURVILINEAR ||
+	   gridtype == GRID_UNSTRUCTURED )
+	{
+	  if ( gridHasArea(gridID) )
+	    {
+	      if ( cdoVerbose ) cdoPrint("Using existing grid cell area!");
+	      gridInqArea(gridID, array);
+	    }
+	  else
+	    {
+	      status = gridGenArea(gridID, array);
+	      if ( status == 1 )
+		cdoAbort("Grid corner missing!");
+	      else if ( status == 2 )
+		cdoAbort("Can't compute grid cell areas for this grid!");
+
+	      for ( i = 0; i < gridsize; ++i )
+		array[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));
+	}
+    }
+  else if ( operatorID == GRIDWGTS )
+    {
+      status = gridWeights(gridID, array);
+      if ( status != 0 )
+	  cdoWarning("Using constant grid cell area weights!");
+    }
+  else if ( operatorID == GRIDMASK )
+    {
+      int *mask;
+      mask = (int *) malloc(gridsize*sizeof(int));
+      if ( gridInqMask(gridID, NULL) )
+	{
+	  gridInqMask(gridID, mask);
+	}
+      else
+	{
+	  for ( i = 0; i < gridsize; ++i ) mask[i] = 1;
+	}
+
+      for ( i = 0; i < gridsize; ++i ) array[i] = mask[i];
+      free(mask);
+    }
+  else if ( operatorID == GRIDDX || operatorID == GRIDDY )
+    {
+      gridtype = gridInqType(gridID);
+      if ( gridtype == GRID_LONLAT      ||
+	   gridtype == GRID_GAUSSIAN    ||
+	   gridtype == GRID_LCC         ||
+	   gridtype == GRID_CURVILINEAR )
+	{
+	  long i, j, xsize, ysize;
+	  double *xv, *yv;
+	  double len1 = 0, len2 = 0;
+	  char units[CDI_MAX_NAME];
+
+	  if ( gridtype != GRID_CURVILINEAR )
+	    gridID = gridToCurvilinear(gridID, 1);
+
+	  gridsize = gridInqSize(gridID);
+	  xsize = gridInqXsize(gridID);
+	  ysize = gridInqYsize(gridID);
+
+	  xv = (double *) malloc(gridsize*sizeof(double));
+	  yv = (double *) malloc(gridsize*sizeof(double));
+
+	  gridInqXvals(gridID, xv);
+	  gridInqYvals(gridID, yv);
+
+	  /* Convert lat/lon units if required */
+
+	  gridInqXunits(gridID, units);
+
+	  if ( memcmp(units, "degree", 6) == 0 )
+	    {
+	      for ( i = 0; i < gridsize; ++i )
+		{
+		  xv[i] *= DEG2RAD;
+		  yv[i] *= DEG2RAD;
+		}
+	    }
+	  else if ( memcmp(units, "radian", 6) == 0 )
+	    {
+	      /* No conversion necessary */
+	    }
+	  else
+	    {
+	      cdoWarning("Unknown units supplied for grid1 center lat/lon: proceeding assuming radians");
+	    }
+
+	  if ( operatorID == GRIDDX )
+	    {
+	      for ( j = 0; j < ysize; ++j )
+		for ( i = 0; i < xsize; ++i )
+		  {
+		    if ( i == 0 )
+		      {
+			len2 = orthodrome(xv[j*xsize+i], yv[j*xsize+i], xv[j*xsize+i+1], yv[j*xsize+i+1]);
+			len1 = len2;
+		      }
+		    else if ( i == (xsize-1) )
+		      {
+			len1 = orthodrome(xv[j*xsize+i-1], yv[j*xsize+i-1], xv[j*xsize+i], yv[j*xsize+i]);
+			len2 = len1;
+		      }
+		    else
+		      {
+			len1 = orthodrome(xv[j*xsize+i-1], yv[j*xsize+i-1], xv[j*xsize+i], yv[j*xsize+i]);
+			len2 = orthodrome(xv[j*xsize+i], yv[j*xsize+i], xv[j*xsize+i+1], yv[j*xsize+i+1]);
+		      }
+
+		    array[j*xsize+i] = 0.5*(len1+len2)*PlanetRadius;
+		  }
+	    }
+	  else
+	    {
+	      for ( i = 0; i < xsize; ++i )
+	        for ( j = 0; j < ysize; ++j )
+		  {
+		    if ( j == 0 )
+		      {
+			len2 = orthodrome(xv[j*xsize+i], yv[j*xsize+i], xv[(j+1)*xsize+i], yv[(j+1)*xsize+i]);
+			len1 = len2;
+		      }
+		    else if ( j == (ysize-1) )
+		      {
+			len1 = orthodrome(xv[(j-1)*xsize+i], yv[(j-1)*xsize+i], xv[j*xsize+i], yv[j*xsize+i]);
+			len2 = len1;
+		      }
+		    else
+		      {
+			len1 = orthodrome(xv[(j-1)*xsize+i], yv[(j-1)*xsize+i], xv[j*xsize+i], yv[j*xsize+i]);
+			len2 = orthodrome(xv[j*xsize+i], yv[j*xsize+i], xv[(j+1)*xsize+i], yv[(j+1)*xsize+i]);
+		      }
+
+		    array[j*xsize+i] = 0.5*(len1+len2)*PlanetRadius;
+		  }
+	    }
+
+	  free(xv);
+	  free(yv);
+	}
+      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));
+	}
+    }
+
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  streamDefTimestep(streamID2, tsID);
+
+  varID   = 0;
+  levelID = 0;
+  streamDefRecord(streamID2, varID, levelID);
+
+  streamWriteRecord(streamID2, array, 0);
+
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Harmonic.c b/src/Harmonic.c
new file mode 100644
index 0000000..88ddad1
--- /dev/null
+++ b/src/Harmonic.c
@@ -0,0 +1,313 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Harmonic   harmonic        Harmonic
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Harmonic(void *argument)
+{
+  int gridsize;
+  int nrecs;
+  int varID, levelID, recID;
+  int tsID;
+  int i, j;
+  int nts;
+  int streamID1, streamID2;
+  int *streamIDs;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nchars;
+  int offset;
+  int nvars, nlevel;
+  int vdate = 0, vtime = 0;
+  int n_out, nout, n;
+  char filesuffix[32];
+  char filename[8192];
+  double missval;
+  double sine, cosine;
+  double *array;
+  double ***work, ***out;
+
+  cdoInitialize(argument);
+
+  operatorInputArg("wave number and wave length of first harmonic in number of timesteps");
+
+  operatorCheckArgc(2);
+
+  n_out = atoi(operatorArgv()[0]);
+  n     = atoi(operatorArgv()[1]);
+
+  if ( n_out > 9 ) cdoAbort("Maximum number of wave numbers is 9!");
+
+  if ( n < 1 || n < 2 * n_out )
+    cdoAbort("The wave length must be positive and smaller than\n"
+	     "2 times the number of requested harmonics (=%d)!", n_out);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisCreate(TAXIS_ABSOLUTE);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  filesuffix[0] = 0;
+  cdoGenFileSuffix(filesuffix, sizeof(filesuffix), cdoDefaultFileType, vlistID1);
+
+  streamIDs = (int*) malloc(n_out*sizeof(int));
+
+  strcpy(filename, cdoStreamName(1));
+  nchars = strlen(filename);
+
+  for ( j = 0; j < n_out; ++j )
+    {
+      sprintf(filename+nchars, "%1d", j+1);
+      if ( filesuffix[0] )
+	sprintf(filename+nchars+1, "%s", filesuffix);
+
+      streamID2 = streamOpenWrite(filename, cdoFiletype());
+
+      streamIDs[j] = streamID2;
+
+      streamDefVlist(streamID2, vlistID2);
+    }
+
+  nvars = vlistNvars(vlistID1);
+
+  out  = (double ***) malloc(n_out*sizeof(double **));
+  work = (double ***) malloc(2*n_out*sizeof(double **));
+
+  for ( j = 0; j < n_out; ++j )
+    {
+      out[j] = (double **) malloc(nvars*sizeof(double *));
+      for ( varID = 0; varID < nvars; ++varID )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  out[j][varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+	}
+    }
+
+  for ( j = 0; j < n_out*2; ++j )
+    {
+      work[j] = (double **) malloc(nvars*sizeof(double *));
+      for ( varID = 0; varID < nvars; ++varID )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  work[j][varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+	  memset(work[j][varID], 0, gridsize*nlevel*sizeof(double));
+	}
+    }
+
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      if ( tsID == 0 )
+	{
+	  vdate = taxisInqVdate(taxisID1);
+	  vtime = taxisInqVtime(taxisID1);
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  offset   = gridsize*levelID;
+
+	  streamReadRecord(streamID1, array, &nmiss);
+
+	  if ( nmiss > 0 ) cdoAbort("Missing values are not allowed!");
+
+	  for ( j = 0; j < n_out; ++j )
+	    {
+	      sine   = sin (2 * M_PI * (((j + 1) * (tsID+1)) % n) / n);
+	      cosine = cos (2 * M_PI * (((j + 1) * (tsID+1)) % n) / n);
+	      for ( i = 0; i < gridsize; i++ )
+		{
+		  work[j][varID][i+offset]         += array[i] * sine;
+		  work[n_out + j][varID][i+offset] += array[i] * cosine;
+		}
+	    }
+	}
+
+      tsID++;
+    }
+
+  nts = tsID;
+
+  if ( array ) free(array);
+
+  streamClose(streamID1);
+
+
+  if ( nts%n )
+    {
+      cdoAbort("The length of first harmonic (=%d)"
+	       " does not divide the number of timesteps (=%d)!", n, nts);
+    }
+
+  for ( j = 0; j < n_out && 2*(j+1) < n; j++ )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      offset = gridsize*levelID;
+	      for ( i = 0; i < gridsize; i++ )
+		out[j][varID][i+offset] = sqrt(work[j][varID][i+offset] * work[j][varID][i+offset] +
+					work[n_out+j][varID][i+offset] * work[n_out+j][varID][i+offset]) * 2 / nts;
+	    }
+	}
+    }
+
+  if ( 2*n_out == n )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      offset = gridsize*levelID;
+	      for ( i = 0; i < gridsize; i++ )
+		out[n_out - 1][varID][i+offset] = work[2 * n_out - 1][varID][i+offset] / nts;
+	    }
+	}
+    }
+
+  nout = n_out;
+
+  taxisDefVdate(taxisID2, vdate);
+  taxisDefVtime(taxisID2, vtime);
+  for ( j = 0; j < nout; j++ )
+    {
+      streamID2 = streamIDs[j];
+      streamDefTimestep(streamID2, 0);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      offset = gridsize*levelID;
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, out[j][varID]+offset, 0);
+	    }
+	}
+    }
+
+  for ( j = 0; j < n_out && 2 * (j + 1) < n; j++ )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	  missval  = vlistInqVarMissval(vlistID2, varID);
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      offset = gridsize*levelID;
+	      for ( i = 0; i < gridsize; i++ )
+		{
+		  out[j][varID][i+offset] = work[j][varID][i+offset] || work[n_out+j][varID][i+offset]
+		              ? atan2 (work[j][varID][i+offset], work[n_out+j][varID][i+offset]) *
+		                n / (j + 1) / 2 / M_PI : missval;
+	  
+		  if ( out[j][varID][i+offset] < 0 )
+		    out[j][varID][i+offset] += n / (j + 1.);
+		}
+	    }
+	}
+    }
+
+  nout = n_out;
+  if ( 2*n_out == n ) nout -= 1;
+
+  taxisDefVdate(taxisID2, vdate);
+  taxisDefVtime(taxisID2, vtime);
+  for ( j = 0; j < nout; j++ )
+    {
+      streamID2 = streamIDs[j];
+      streamDefTimestep(streamID2, 1);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	  missval  = vlistInqVarMissval(vlistID2, varID);
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      offset = gridsize*levelID;
+	      streamDefRecord(streamID2, varID, levelID);
+	      nmiss = 0;
+	      for ( i = 0; i < gridsize; i++ )
+		if ( DBL_IS_EQUAL(out[j][varID][i+offset], missval) ) nmiss++;
+	      streamWriteRecord(streamID2, out[j][varID]+offset, nmiss);
+	    }
+	}
+    }
+
+  for ( j = 0; j < n_out; j++ )
+    {
+      streamID2 = streamIDs[j];
+      streamClose(streamID2);
+    }
+
+  free(streamIDs);
+
+  for ( j = 0; j < n_out; ++j )
+    {
+      for ( varID = 0; varID < nvars; ++varID )
+	free(out[j][varID]);
+
+      free(out[j]);
+    }
+
+  free(out);
+
+  for ( j = 0; j < n_out*2; ++j )
+    {
+      for ( varID = 0; varID < nvars; ++varID )
+	free(work[j][varID]);
+
+      free(work[j]);
+    }
+
+  free(work);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Hi.c b/src/Hi.c
new file mode 100755
index 0000000..10604ab
--- /dev/null
+++ b/src/Hi.c
@@ -0,0 +1,209 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Hi      hi           Compute the humidity index
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+static const char HI_NAME[]     = "hum_index";
+static const char HI_LONGNAME[] = "Humindex describes empirically in units of temperature how the temperature and humidity influence the wellness of a human being. HI = T + 5/9 * (A - 10) with A = e * (6.112 * 10 ** ((7.5 * T)/(237.7 + T)) * R), T  = air temperature in degree Celsius, R = relative humidity, e = vapour pressure. Humindex is only defined for temperatures of at least 26 degree Celsius and relative humidity of at least 40 percent.";
+static const char HI_UNITS[]    = "Celsius";
+
+static const int FIRST_VAR = 0;
+
+
+static double humidityIndex(double t, double e, double r, double missval)
+{
+  static const double tmin = 26.0;
+  static const double rmin = 40.0;
+  
+  if ( t < tmin || r < rmin )
+    return missval;
+    
+  return t + (5.0 / 9.0) * ((0.01 * r * e * 6.112 * pow(10.0, (7.5 * t) / (237.7 + t))) - 10.0);
+}
+
+
+static void farexpr(field_t *field1, field_t field2, field_t field3, double (*expression)(double, double, double, double))
+{
+  int   i, len;
+  const int     grid1    = field1->grid;
+  const int     nmiss1   = field1->nmiss;
+  const double  missval1 = field1->missval;
+  double       *array1   = field1->ptr;
+  const int     grid2    = field2.grid;
+  const int     nmiss2   = field2.nmiss;
+  const double  missval2 = field2.missval;
+  const double *array2   = field2.ptr;
+  const int     grid3    = field3.grid;
+  const int     nmiss3   = field3.nmiss;
+  const double  missval3 = field3.missval;
+  const double *array3   = field3.ptr;
+
+  len = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) || len != gridInqSize(grid3) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 || nmiss3 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+        if ( DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) || DBL_IS_EQUAL(array3[i], missval3))  
+	  array1[i] = missval1;
+	else
+	  array1[i] = expression(array1[i], array2[i], array3[i], missval1);
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ )
+        array1[i] = expression(array1[i], array2[i], array3[i], missval1);  
+    }
+
+  field1->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+}
+
+   
+void *Hi(void *argument)
+{
+  int streamID1, streamID2, streamID3, streamID4;
+  int gridsize;
+  int nrecs, nrecs2, nrecs3, recID;
+  int tsID;
+  int gridID, zaxisID;
+  int varID1, varID2, varID3, varID4;
+  int levelID1, levelID2, levelID3;
+  int vlistID1, vlistID2, vlistID3, vlistID4;
+  int taxisID1, taxisID2, taxisID3, taxisID4;
+  field_t field1, field2, field3;
+
+  cdoInitialize(argument);
+  cdoOperatorAdd("hi", 0, 0, NULL);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  streamID3 = streamOpenRead(cdoStreamName(2));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = streamInqVlist(streamID3);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = vlistInqTaxis(vlistID3);
+
+  vlistCompare(vlistID1, vlistID2, CMP_DIM);
+  vlistCompare(vlistID1, vlistID3, CMP_DIM);
+  
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr = (double *) malloc(gridsize*sizeof(double));
+  field3.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  if ( cdoVerbose )
+    cdoPrint("Number of timesteps: file1 %d, file2 %d, file3 %d",
+	     vlistNtsteps(vlistID1), vlistNtsteps(vlistID2), vlistNtsteps(vlistID3));
+
+  vlistID4 = vlistCreate();
+  gridID   = vlistInqVarGrid(vlistID1, FIRST_VAR);
+  zaxisID  = vlistInqVarZaxis(vlistID1, FIRST_VAR);
+  varID4   = vlistDefVar(vlistID4, gridID, zaxisID, TSTEP_INSTANT);
+
+  taxisID4 = taxisCreate(TAXIS_RELATIVE);
+  taxisDefTunit(taxisID4, TUNIT_MINUTE);
+  taxisDefCalendar(taxisID4, CALENDAR_STANDARD);
+  taxisDefRdate(taxisID4, 19550101);
+  taxisDefRtime(taxisID4, 0);
+  vlistDefTaxis(vlistID4, taxisID4);
+
+  vlistDefVarName(vlistID4, varID4, HI_NAME);
+  vlistDefVarLongname(vlistID4, varID4, HI_LONGNAME);
+  vlistDefVarUnits(vlistID4, varID4, HI_UNITS);
+
+  streamID4 = streamOpenWrite(cdoStreamName(3), cdoFiletype());
+
+  streamDefVlist(streamID4, vlistID4);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      nrecs2 = streamInqTimestep(streamID2, tsID);
+      nrecs3 = streamInqTimestep(streamID3, tsID);
+      if ( nrecs2 == 0 || nrecs3 == 0 )
+        cdoAbort("Input streams have different number of timesteps!");
+
+      taxisCopyTimestep(taxisID4, taxisID1);
+      streamDefTimestep(streamID4, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID1, &levelID1);
+	  streamReadRecord(streamID1, field1.ptr, &field1.nmiss);
+
+	  streamInqRecord(streamID2, &varID2, &levelID2);
+	  streamReadRecord(streamID2, field2.ptr, &field2.nmiss);
+	  
+	  streamInqRecord(streamID3, &varID3, &levelID3);
+	  streamReadRecord(streamID3, field3.ptr, &field3.nmiss);
+	  
+	  if ( varID1 != varID2 || varID1 != varID3 || levelID1 != levelID2 || levelID1 != levelID3 )
+	    cdoAbort("Input streams have different structure!");
+	    
+          if ( varID1 != FIRST_VAR )
+            continue;
+            
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID1);
+	  field1.missval = vlistInqVarMissval(vlistID1, varID1);
+
+	  field2.grid    = vlistInqVarGrid(vlistID2, varID2);
+	  field2.missval = vlistInqVarMissval(vlistID2, varID2);
+
+	  field3.grid    = vlistInqVarGrid(vlistID3, varID3);
+	  field3.missval = vlistInqVarMissval(vlistID3, varID3);
+
+	  farexpr(&field1, field2, field3, humidityIndex);
+	  
+	  streamDefRecord(streamID4, varID4, levelID1);
+	  streamWriteRecord(streamID4, field1.ptr, field1.nmiss);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID4);
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( field1.ptr ) free(field1.ptr);
+  if ( field2.ptr ) free(field2.ptr);
+  if ( field3.ptr ) free(field3.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Histogram.c b/src/Histogram.c
new file mode 100644
index 0000000..3b7ba62
--- /dev/null
+++ b/src/Histogram.c
@@ -0,0 +1,241 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "list.h"
+
+
+void *Histogram(void *argument)
+{
+  int HISTCOUNT, HISTSUM, HISTMEAN, HISTFREQ;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs;
+  int tsID1, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2;
+  int nmiss;
+  int taxisID1, taxisID2 = CDI_UNDEFID;
+  int nbins;
+  int i, nvars;
+  int offset;
+  int nzaxis, nlevel, zaxisID, zaxisID2, index;
+  double *array = NULL;
+  double *fltarr = NULL;
+  double *bins;
+  double missval;
+  LIST *flist = listNew(FLT_LIST);
+  double **vardata = NULL;
+  double **varcount = NULL;
+  double **vartcount = NULL;
+
+  cdoInitialize(argument);
+
+  HISTCOUNT = cdoOperatorAdd("histcount", 0, 0, NULL);
+  HISTSUM   = cdoOperatorAdd("histsum",   0, 0, NULL);
+  HISTMEAN  = cdoOperatorAdd("histmean",  0, 0, NULL);
+  HISTFREQ  = cdoOperatorAdd("histfreq",  0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg("bins");
+
+  nbins = args2fltlist(operatorArgc(), operatorArgv(), flist) - 1;
+  if ( nbins < 1 ) cdoAbort("Too few arguments!");
+  fltarr = (double *) listArrayPtr(flist);
+
+  if ( cdoVerbose )
+    {
+      printf("nbins = %d\n", nbins);
+      for ( i = 0; i < nbins; i++ )
+	printf("flt %d = %g\n", i+1, fltarr[i]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  taxisID1 = vlistInqTaxis(vlistID1);
+
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  /* create zaxis for output bins */
+  zaxisID2 = zaxisCreate(ZAXIS_GENERIC, nbins);
+  bins = (double *) malloc(nbins*sizeof(double));
+  /* for ( i = 0; i < nbins; i++ ) bins[i] = (fltarr[i]+fltarr[i+1])/2; */
+  for ( i = 0; i < nbins; i++ ) bins[i] = fltarr[i];
+  zaxisDefLevels(zaxisID2, bins);
+  free(bins);
+  zaxisDefLbounds(zaxisID2, fltarr);
+  zaxisDefUbounds(zaxisID2, fltarr+1);
+  zaxisDefName(zaxisID2, "bins");
+  zaxisDefLongname(zaxisID2, "histogram bins");
+  zaxisDefUnits(zaxisID2, "level");
+
+  /* check zaxis: only 2D fields allowed */
+  nzaxis = vlistNzaxis(vlistID1);
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      zaxisID = vlistZaxis(vlistID1, index);
+      nlevel = zaxisInqSize(zaxisID);
+      if ( nlevel > 1 )
+	cdoAbort("Found 3D field with %d levels. Only 2D fields allowed!", nlevel);
+      vlistChangeZaxisIndex(vlistID2, index, zaxisID2);
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars = vlistNvars(vlistID2);
+  vardata   = (double **) malloc(nvars*sizeof(double *));
+  varcount  = (double **) malloc(nvars*sizeof(double *));
+  vartcount = (double **) malloc(nvars*sizeof(double *));
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+      vardata[varID]  = (double *) malloc(nbins*gridsize*sizeof(double));
+      varcount[varID] = (double *) malloc(nbins*gridsize*sizeof(double));
+      vartcount[varID] = (double *) malloc(gridsize*sizeof(double));
+      memset(vardata[varID], 0, nbins*gridsize*sizeof(double));
+      memset(varcount[varID], 0, nbins*gridsize*sizeof(double));
+      memset(vartcount[varID], 0, gridsize*sizeof(double));
+    }
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID1 = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID1)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array, &nmiss);
+	  missval = vlistInqVarMissval(vlistID1, varID);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  nmiss=0;
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+	      if ( !DBL_IS_EQUAL(array[i], missval) )
+		{
+		  *(vartcount[varID]+i) += 1;
+		  index = 0;
+		  while( index < nbins )
+		    {
+		      offset = gridsize*index;
+		      if ( !DBL_IS_EQUAL(*(vardata[varID]+offset+i), missval) &&
+			   array[i] >= fltarr[index] && array[i] < fltarr[index+1] )
+			{
+			  *(vardata[varID]+offset+i) += array[i];
+			  *(varcount[varID]+offset+i) += 1;
+			  break;
+			}
+		      index++;
+		    }
+		}
+	      else { /* missing value */
+		nmiss++;
+	      }
+	    }
+	}
+      tsID1++;
+    }
+
+
+  streamDefTimestep(streamID2, 0);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      missval = vlistInqVarMissval(vlistID2, varID);
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+      nmiss = 0;
+
+      /* fix mising values */
+      
+      for ( index = 0; index < nbins; index++ )
+	{
+	  streamDefRecord(streamID2,  varID,  index);
+	  offset   = gridsize*index;
+	  
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+	      if ( *(vartcount[varID]+i) > 0 )
+		{
+		  if ( operatorID == HISTMEAN || operatorID == HISTFREQ )
+		    {
+		      if ( *(varcount[varID]+offset+i) > 0 ) 
+			{
+			  if ( operatorID == HISTMEAN )
+			    *(vardata[varID]+offset+i) /= *(varcount[varID]+offset+i);	    
+			  else 
+			    *(vardata[varID]+offset+i) = *(varcount[varID]+offset+i) / *(vartcount[varID]+i);
+			} 
+		    }
+		}
+	      else
+		{
+		  nmiss++;
+		  *(vardata[varID]+offset+i) = missval;
+		}
+	    }
+	  if ( operatorID == HISTCOUNT )
+	    streamWriteRecord(streamID2, varcount[varID]+offset, nmiss);
+	  else
+	    streamWriteRecord(streamID2, vardata[varID]+offset, nmiss);
+	}
+    }
+  
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  if ( vardata )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  free(vardata[varID]);
+	  free(varcount[varID]);
+	  free(vartcount[varID]);
+	}
+
+      free(vardata);
+      free(varcount);
+      free(vartcount);
+    }
+
+  if ( array ) free(array);
+
+  listDelete(flist);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Importamsr.c b/src/Importamsr.c
new file mode 100644
index 0000000..62f2f7a
--- /dev/null
+++ b/src/Importamsr.c
@@ -0,0 +1,292 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  NLON    1440
+#define  NLAT     720
+#define  MAX_VARS   6
+
+
+static
+void init_amsr_day(int vlistID, int gridID, int zaxisID, int nvars)
+{
+  /*
+    Version-5 RSS AMSR-E or AMSR-J daily files 
+
+    filename  with path in form satname_yyyymmdd_v5.gz
+    where satname  = name of satellite (amsre or amsr)
+             yyyy	= year
+	       mm	= month
+	       dd	= day of month
+
+    1:time	time of measurement in fractional hours GMT
+    2:sst     	sea surface temperature in deg Celcius
+    3:wind	10m surface wind in meters/second
+    4:vapor	columnar water vapor in millimeters
+    5:cloud	cloud liquid water in millimeters
+    6:rain   	rain rate in millimeters/hour
+  */
+  char *name[]  = {"hours", "sst", "wind", "vapor", "cloud", "rain"};
+  char *units[] = {"h", "deg Celcius", "m/s", "mm", "mm", "mm/h"};
+  double xscale[]  = {0.1, 0.15, 0.2, 0.3, 0.01, 0.1};
+  double xminval[] = {0., -3., 0., 0., 0., 0.};
+  int i, varID;
+
+  for ( i = 0; i < nvars; ++i )
+    {
+      varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+      vlistDefVarName(vlistID, varID, name[i]);
+      vlistDefVarUnits(vlistID, varID, units[i]);
+      vlistDefVarDatatype(vlistID, varID, DATATYPE_INT16);
+      vlistDefVarMissval(vlistID, varID, 254);
+      vlistDefVarScalefactor(vlistID, varID, xscale[i]);
+      vlistDefVarAddoffset(vlistID, varID, xminval[i]);
+    }
+}
+
+
+static
+void init_amsr_averaged(int vlistID, int gridID, int zaxisID, int nvars)
+{
+  /*
+    Version-5 AMSR-E or AMSR-J time-averaged files including:
+	  3-day		(average of 3 days ending on file date)
+	  weekly	(average of 7 days ending on Saturday of file date)
+	  monthly	(average of all days in month)
+
+
+     filename
+	   format of file names are:
+	     	3-day	satname_yyyymmddv5_d3d.gz
+	       	weekly	satname_yyyymmddv5.gz
+	       	monthly	satname_yyyymmv5.gz
+
+       	where	satname	=name of satellite (amsre or amsr)
+		      	yyyy	=year
+		       	mm	=month
+		       	dd	=day of month
+
+    1:sst       sea surface temperature in deg Celcius
+    2:wind      10m surface wind in meters/second
+    3:vapor	columnar water vapor in millimeters
+    4:cloud     cloud liquid water in millimeters
+    5:rain	rain rate in millimeters/hour
+  */
+  char *name[]  = {"sst", "wind", "vapor", "cloud", "rain"};
+  char *units[] = {"deg Celcius", "m/s", "mm", "mm", "mm/h"};
+  double xscale[]  = {0.15, 0.2, 0.3, 0.01, 0.1};
+  double xminval[] = {-3., 0., 0., 0., 0.};
+  int i, varID;
+
+  for ( i = 0; i < nvars; ++i )
+    {
+      /* varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_CONSTANT); */
+      varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+      vlistDefVarName(vlistID, varID, name[i]);
+      vlistDefVarUnits(vlistID, varID, units[i]);
+      vlistDefVarDatatype(vlistID, varID, DATATYPE_INT16);
+      vlistDefVarMissval(vlistID, varID, 254);
+      vlistDefVarScalefactor(vlistID, varID, xscale[i]);
+      vlistDefVarAddoffset(vlistID, varID, xminval[i]);
+    }
+}
+
+static
+void read_amsr(FILE *fp, int vlistID, int nvars, double *data[], int *nmiss)
+{
+  int varID, i, gridsize;
+  unsigned char *amsr_data = NULL;
+  double xminval, xscale, missval;
+  size_t size;
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID, varID));
+      amsr_data = (unsigned char *) realloc(amsr_data, gridsize);
+      size = fread(amsr_data, 1, gridsize, fp);
+      if ( (int)size != gridsize ) cdoAbort("Read error!");
+
+      missval = vlistInqVarMissval(vlistID, varID);
+      xminval = vlistInqVarAddoffset(vlistID, varID);
+      xscale  = vlistInqVarScalefactor(vlistID, varID);
+      
+      nmiss[varID] = 0;
+      for ( i = 0; i < gridsize; ++i )
+	{
+	  if ( amsr_data[i] <= 250 )
+	    {
+	      data[varID][i] = amsr_data[i]*xscale + xminval;
+	    }
+	  else
+	    {
+	      data[varID][i] = missval;
+	      nmiss[varID]++;
+	    }
+	}
+    } 
+
+  free(amsr_data);
+}
+
+static
+void write_data(int streamID, int nvars, double *data[], int *nmiss)
+{
+  int varID;
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      streamDefRecord(streamID, varID, 0);
+      streamWriteRecord(streamID, data[varID], nmiss[varID]);
+    }
+}
+
+static
+int getDate(const char *name)
+{
+  int date = 0;
+  size_t len;
+  char *pname;
+
+  len = strlen(name);
+
+  pname = strchr(name, '_');
+
+  if ( pname ) date = atoi(pname+1);
+
+  return(date);
+}
+
+
+void *Importamsr(void *argument)
+{
+  int streamID;
+  int tsID;
+  int gridID, zaxisID, taxisID, vlistID;
+  int gridsize;
+  int i;
+  int nvars;
+  int vdate = 0, vtime = 0;
+  double xvals[NLON], yvals[NLAT];
+  double *data[MAX_VARS];
+  int nmiss[MAX_VARS];
+  FILE *fp;
+  size_t fsize;
+
+  cdoInitialize(argument);
+
+  fp = fopen(cdoStreamName(0), "r");
+  if ( fp == NULL ) { perror(cdoStreamName(0)); exit(EXIT_FAILURE); }
+
+  fseek(fp, 0L, SEEK_END);
+  fsize = (size_t) ftell(fp);
+  fseek(fp, 0L, SEEK_SET);
+
+  vdate = getDate(cdoStreamName(0));
+  if ( vdate <= 999999 ) vdate = vdate*100 + 1;
+
+  streamID = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  /*
+    Longitude  is 0.25*xdim-0.125    degrees east
+    Latitude   is 0.25*ydim-90.125
+  */
+  gridsize = NLON*NLAT;
+  gridID = gridCreate(GRID_LONLAT, gridsize);
+  gridDefXsize(gridID, NLON);
+  gridDefYsize(gridID, NLAT);
+  for ( i = 0; i < NLON; ++i ) xvals[i] = 0.25*(i+1) - 0.125;
+  for ( i = 0; i < NLAT; ++i ) yvals[i] = 0.25*(i+1) - 90.125;
+  gridDefXvals(gridID, xvals);
+  gridDefYvals(gridID, yvals);
+
+  zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+
+  vlistID = vlistCreate();
+  vlistDefTaxis(vlistID, taxisID);
+
+  if ( fsize == 12441600 )
+    {
+      nvars = 6;
+      for ( i = 0; i < nvars; ++i ) data[i] = (double *) malloc(gridsize*sizeof(double));
+
+      init_amsr_day(vlistID, gridID, zaxisID, nvars);
+
+      streamDefVlist(streamID, vlistID);
+
+      vtime = 13000; /* 1:30:00 */
+      for ( tsID = 0; tsID < 2; ++tsID )
+	{
+	  taxisDefVdate(taxisID, vdate);
+	  taxisDefVtime(taxisID, vtime);
+	  vtime += 120000;  /* 13:30:00 */
+	  streamDefTimestep(streamID, tsID);
+	  processDefTimesteps(streamID);
+
+	  read_amsr(fp, vlistID, nvars, data, nmiss);
+
+	  write_data(streamID, nvars, data, nmiss);
+	}
+
+      for ( i = 0; i < nvars; ++i ) free(data[i]);
+    }
+  else if ( fsize == 5184000 )
+    {
+      nvars = 5;
+      for ( i = 0; i < nvars; ++i ) data[i] = (double *) malloc(gridsize*sizeof(double));
+
+      init_amsr_averaged(vlistID, gridID, zaxisID, nvars);
+
+      /* vlistDefNtsteps(vlistID, 0);*/
+      streamDefVlist(streamID, vlistID);
+      
+      taxisDefVdate(taxisID, vdate);
+      taxisDefVtime(taxisID, vtime);
+      tsID = 0;
+      streamDefTimestep(streamID, tsID);
+      processDefTimesteps(streamID);
+      
+      read_amsr(fp, vlistID, nvars, data, nmiss);
+
+      write_data(streamID, nvars, data, nmiss);
+
+      for ( i = 0; i < nvars; ++i ) free(data[i]);
+    }
+  else
+    cdoAbort("Unexpected file size for AMSR data!");
+
+  processDefVarNum(vlistNvars(vlistID), streamID);
+
+  streamClose(streamID);
+
+  fclose(fp);
+
+  vlistDestroy(vlistID);
+  gridDestroy(gridID);
+  zaxisDestroy(zaxisID);
+  taxisDestroy(taxisID);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Importbinary.c b/src/Importbinary.c
new file mode 100644
index 0000000..04b96a4
--- /dev/null
+++ b/src/Importbinary.c
@@ -0,0 +1,589 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+#include "gradsdeslib.h"
+
+static
+void get_dim_vals(dsets_t *pfi, double *vals, int dimlen, int dim)
+{
+  gadouble (*conv) (gadouble *, gadouble);
+  gadouble *cvals;
+  int i;
+
+  assert( dimlen == pfi->dnum[dim] );
+
+  if ( pfi->linear[dim] == 0 )
+    {
+      for ( i = 0; i < dimlen; ++i )
+	{
+	  vals[i] = pfi->grvals[dim][i+1];
+	  /* printf("%d %g\n", i, vals[i]); */
+	}
+    }
+  else if ( pfi->linear[dim] == 1 )
+    {
+      /*
+      for ( i = 0; i < 3; ++i )
+	printf("%d %g %g\n", i, pfi->grvals[dim][i] , pfi->abvals[dim][i]);
+      */
+      conv = pfi->gr2ab[dim];
+      cvals = pfi->grvals[dim];
+      for ( i = 0; i < dimlen; ++i )
+	{
+	  vals[i] = conv(cvals, i+1);
+	  /* printf("%d %g\n", i, vals[i]); */
+	}
+    }
+  
+}
+
+static
+void rev_vals(double *vals, int n)
+{
+  int i;
+  double dum;
+
+  for ( i = 0; i < n/2; ++i )
+    {
+      dum = vals[i];
+      vals[i] = vals[n-1-i];
+      vals[n-1-i] = dum;
+    }
+}
+
+static
+int y_is_gauss(double *gridyvals, int ysize)
+{
+  int lgauss = FALSE;
+  int i;
+
+  if ( ysize > 2 )
+    {
+      double *yvals, *yw;
+      yvals = (double *) malloc(ysize*sizeof(double));
+      yw    = (double *) malloc(ysize*sizeof(double));
+      gaussaw(yvals, yw, ysize);
+      free(yw);
+      for ( i = 0; i < (int) ysize; i++ )
+	yvals[i] = asin(yvals[i])/M_PI*180.0;
+
+      for ( i = 0; i < (int) ysize; i++ )
+	if ( fabs(yvals[i] - gridyvals[i]) >
+	     ((yvals[0] - yvals[1])/500) ) break;
+		      
+      if ( i == (int) ysize ) lgauss = TRUE;
+
+      /* check S->N */
+      if ( lgauss == FALSE )
+	{		  
+	  for ( i = 0; i < (int) ysize; i++ )
+	    if ( fabs(yvals[i] - gridyvals[ysize-i-1]) >
+		 ((yvals[0] - yvals[1])/500) ) break;
+		      
+	  if ( i == (int) ysize ) lgauss = TRUE;
+	}
+
+      free(yvals);
+    }
+
+  return (lgauss);
+}
+
+static
+int define_grid(dsets_t *pfi)
+{
+  int gridID, gridtype;
+  int nx, ny;
+  double *xvals, *yvals;
+  int lgauss = FALSE;
+
+  nx = pfi->dnum[0];
+  ny = pfi->dnum[1];
+
+  xvals = (double *) malloc(nx*sizeof(double));
+  yvals = (double *) malloc(ny*sizeof(double));
+
+  get_dim_vals(pfi, xvals, nx, 0);
+  get_dim_vals(pfi, yvals, ny, 1);
+
+  if ( pfi->yrflg ) rev_vals(yvals, ny);
+
+  if ( pfi->linear[1] == 0 ) lgauss = y_is_gauss(yvals, ny);
+
+  if ( lgauss ) gridtype = GRID_GAUSSIAN;
+  else          gridtype = GRID_LONLAT;
+
+  gridID = gridCreate(gridtype, nx*ny);
+  gridDefXsize(gridID, nx);
+  gridDefYsize(gridID, ny);
+
+  gridDefXvals(gridID, xvals);
+  gridDefYvals(gridID, yvals);
+
+  free(xvals);
+  free(yvals);
+  
+  return (gridID);
+}
+
+static
+int define_level(dsets_t *pfi, int nlev)
+{
+  int zaxisID = -1;
+  int nz;
+
+  nz = pfi->dnum[2];
+
+  if ( nz )
+    {
+      double *zvals = NULL;
+
+      zvals = (double *) malloc(nz*sizeof(double));
+
+      get_dim_vals(pfi, zvals, nz, 2);
+
+      if ( nz == 1 && IS_EQUAL(zvals[0], 0) )
+	zaxisID = zaxisCreate(ZAXIS_SURFACE, nz);
+      else
+	{
+	  if ( nlev > 0 && nlev < nz ) nz = nlev;
+	  if ( pfi->zrflg ) rev_vals(zvals, nz);
+	  zaxisID = zaxisCreate(ZAXIS_GENERIC, nz);
+	}
+      zaxisDefLevels(zaxisID, zvals);
+
+      free(zvals);
+    }
+  else
+    {
+      double level = 0;
+      nz = 1;
+
+      zaxisID = zaxisCreate(ZAXIS_SURFACE, nz);
+      zaxisDefLevels(zaxisID, &level);
+    }
+
+  return (zaxisID);
+}
+
+
+void *Importbinary(void *argument)
+{
+  int streamID;
+  int gridID = -1, zaxisID, zaxisIDsfc, taxisID, vlistID;
+  int i;
+  int nmiss = 0, n_nan;
+  int ivar;
+  int varID = -1, levelID, tsID;
+  int gridsize;
+  int  status;
+  int datatype;
+  dsets_t pfi;
+  int vdate, vtime;
+  int tcur, told,fnum;
+  int tmin=0,tmax=0;
+  char *ch = NULL;
+  int nvars, nlevels, nrecs;
+  int recID;
+  int e, flag;
+  size_t rc, recsize;
+  int recoffset;
+  char *rec = NULL;
+  struct gavar *pvar;
+  struct dt dtim, dtimi;
+  double missval;
+  double fmin, fmax;
+  double *array;
+  double sfclevel = 0;
+  int *recVarID, *recLevelID;
+  int *var_zaxisID;
+  int *var_dfrm = NULL;
+  char vdatestr[32], vtimestr[32];	  
+
+  cdoInitialize(argument);
+
+  dsets_init(&pfi);
+
+  status = read_gradsdes((char *)cdoStreamName(0), &pfi);
+  if ( cdoVerbose ) fprintf(stderr, "status %d\n", status);
+  //if ( status ) cdoAbort("Open failed on %s!", pfi.name);
+  if ( status ) cdoAbort("Open failed!");
+
+  nrecs = pfi.trecs;
+  nvars = pfi.vnum;
+  pvar  = pfi.pvar1;
+
+  if ( nvars == 0 ) cdoAbort("No variables found!");
+
+  gridID = define_grid(&pfi);
+  if ( cdoVerbose ) gridPrint(gridID, 1);
+
+  zaxisID = define_level(&pfi, 0);
+  if ( cdoVerbose ) zaxisPrint(zaxisID);
+
+  zaxisIDsfc = zaxisCreate(ZAXIS_SURFACE, 1);
+  zaxisDefLevels(zaxisIDsfc, &sfclevel);
+
+  vlistID = vlistCreate();
+
+  var_zaxisID = (int *) malloc(nvars*sizeof(int));
+  recVarID    = (int *) malloc(nrecs*sizeof(int));
+  recLevelID  = (int *) malloc(nrecs*sizeof(int));
+  var_dfrm    = (int *) malloc(nrecs*sizeof(int));
+
+  recID = 0;
+  for ( ivar = 0; ivar < nvars; ++ivar )
+    {
+      /*
+      if ( cdoVerbose )
+	fprintf(stderr, "1:%s 2:%s %d %d %d %d 3:%s %d \n", 
+		pvar->abbrv, pvar->longnm, pvar->offset, pvar->recoff, pvar->levels, 
+		pvar->nvardims, pvar->varnm, pvar->var_t);
+      */
+      nlevels = pvar->levels;
+      
+      if ( nlevels == 0 )
+	{
+	  nlevels = 1;
+	  varID = vlistDefVar(vlistID, gridID, zaxisIDsfc, TSTEP_INSTANT);
+	}
+      else
+	{
+	  if ( nlevels > zaxisInqSize(zaxisID) )
+	    cdoAbort("Variable %s has too many number of levels!", pvar->abbrv);
+	  else if ( nlevels < zaxisInqSize(zaxisID) )
+	    {
+	      int vid, zid = -1, nlev;
+	      for ( vid = 0; vid < ivar; ++vid )
+		{
+		  zid = var_zaxisID[vid];
+		  nlev = zaxisInqSize(zid);
+		  if ( nlev == nlevels ) break;
+		}
+
+	      if ( vid == ivar ) zid = define_level(&pfi, nlevels);
+	      varID = vlistDefVar(vlistID, gridID, zid, TSTEP_INSTANT);
+	    }
+	  else
+	    varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+	}
+
+      var_zaxisID[varID] = vlistInqVarZaxis(vlistID, varID);
+
+      vlistDefVarName(vlistID, varID, pvar->abbrv);
+      {
+	size_t len = strlen(pvar->varnm);
+	char *longname = pvar->varnm;
+	if ( longname[0] == '\'' && longname[len-1] == '\'' )
+	  {
+	    longname[len-1] = 0;
+	    longname++;
+	  }
+	vlistDefVarLongname(vlistID, varID, longname);
+      }
+
+      missval  = pfi.undef;
+      datatype = DATATYPE_FLT32;
+
+      if      ( pvar->dfrm ==  1 ) {
+	datatype = DATATYPE_UINT8;
+	if ( missval < 0 || missval > 255 ) missval = 255;
+      }
+      else if ( pvar->dfrm ==  2 )  {
+	datatype = DATATYPE_UINT16;
+	if ( missval < 0 || missval > 65535 ) missval = 65535;
+      }
+      else if ( pvar->dfrm == -2 )  {
+	datatype = DATATYPE_INT16;
+	if ( missval < -32768 || missval > 32767 ) missval = -32768;
+      }
+      else if ( pvar->dfrm ==  4 )  {
+	datatype = DATATYPE_INT32;
+	if ( missval < -2147483648 || missval > 2147483647 ) missval = -2147483646;
+      }
+      else if ( pfi.flt64 )
+	datatype = DATATYPE_FLT64;
+      
+      vlistDefVarDatatype(vlistID, varID, datatype);
+      vlistDefVarMissval(vlistID, varID, missval);
+
+      for ( levelID = 0; levelID < nlevels; ++levelID )
+	{
+	  if ( recID >= nrecs ) cdoAbort("Internal problem with number of records!");
+	  recVarID[recID]   = varID;
+	  recLevelID[recID] = levelID;
+          var_dfrm[recID]   = pvar->dfrm;
+	  recID++;
+	}
+
+      pvar++;
+    }
+
+  taxisID = taxisCreate(TAXIS_RELATIVE);
+
+  taxisDefCalendar(taxisID, CALENDAR_STANDARD);
+
+  vlistDefTaxis(vlistID, taxisID);
+
+  streamID = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID, vlistID);
+
+
+  gridsize = pfi.dnum[0]*pfi.dnum[1];
+  if ( pfi.flt64 )
+    recoffset = pfi.xyhdr*8;
+  else
+    recoffset = pfi.xyhdr*4;
+
+  if ( pfi.seqflg ) recoffset += 4;
+
+  //recsize = pfi.gsiz*4;
+  recsize = pfi.gsiz*8;
+  rec = (char *) malloc(recsize);
+
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  /*
+  if (pfi.tmplat)
+    for ( i = 0; i <  pfi.dnum[3]; ++i )
+      printf("%d %d\n", i, pfi.fnums[i]);
+  */
+
+  pfi.infile = NULL;
+  tcur = 0;
+  e = 1;
+  while (1)
+    {    /* loop over all times for this ensemble */
+      if (pfi.tmplat)
+	{
+	  /* make sure no file is open */
+	  if (pfi.infile!=NULL) {
+	    fclose(pfi.infile);
+	    pfi.infile=NULL;
+	  }
+	  /* advance to first valid time step for this ensemble */
+	  if (tcur==0) {
+	    told = 0;
+	    tcur = 1;
+	    while (pfi.fnums[tcur-1] == -1) tcur++;  
+	  }
+	  else {  /* tcur!=0 */
+	    told = pfi.fnums[tcur-1];
+	    /* increment time step until fnums changes */
+	    while (told==pfi.fnums[tcur-1] && tcur<=pfi.dnum[3]) {
+	      tcur++;
+	      if ( tcur > pfi.dnum[3] ) break;
+	    }
+	  }
+
+	  /* make sure we haven't advanced past end of time axis */
+	  if (tcur>pfi.dnum[3]) break;
+
+	  /* check if we're past all valid time steps for this ensemble */
+	  if ((told != -1) && (pfi.fnums[tcur-1] == -1)) break;
+
+	  /* Find the range of t indexes that have the same fnums value.
+	     These are the times that are contained in this particular file */
+	  tmin = tcur;
+	  tmax = tcur-1;
+	  fnum = pfi.fnums[tcur-1];
+	  if (fnum != -1) {
+	    while (fnum == pfi.fnums[tmax])
+	      {
+		tmax++; 
+		if (tmax == pfi.dnum[3]) break;
+	      }
+	    gr2t(pfi.grvals[3], (gadouble)tcur, &dtim); 
+	    gr2t(pfi.grvals[3], (gadouble)1, &dtimi);
+	    ch = gafndt(pfi.name, &dtim, &dtimi, pfi.abvals[3], pfi.pchsub1, NULL,tcur,e,&flag);
+	    if (ch==NULL) cdoAbort("Couldn't determine data file name for e=%d t=%d!",e,tcur);
+	  }
+	}
+      else { 
+	/* Data set is not templated */
+	ch = pfi.name;
+	tmin = 1;
+	tmax = pfi.dnum[3];
+      }
+       
+      /* Open this file and position to start of first record */
+      if ( cdoVerbose) cdoPrint("Opening file: %s", ch);
+      pfi.infile = fopen(ch,"rb");
+      if (pfi.infile==NULL) {
+	if (pfi.tmplat) {
+	  if ( cdoVerbose ) cdoPrint("Could not open file: %s",ch);
+	  break;
+	} else {
+	  cdoAbort("Could not open file: %s",ch);
+	}
+      }
+      if (pfi.tmplat) gree(ch,"312");
+
+      /* file header */
+      if (pfi.fhdr > 0) fseeko(pfi.infile, pfi.fhdr, SEEK_SET);
+       
+      /* Get file size */
+      /*
+      fseeko(pfi.infile,0L,2);
+      flen = ftello(pfi.infile);
+
+      printf("flen %d tsiz %d\n", flen, pfi.tsiz);
+       
+      fseeko (pfi.infile,0,0);
+      */
+      for ( tsID = tmin-1; tsID < tmax; ++tsID )
+	{
+	  gr2t(pfi.grvals[3], (gadouble)(tsID+1), &dtim); 
+	  vdate = cdiEncodeDate(dtim.yr, dtim.mo, dtim.dy);
+	  vtime = cdiEncodeTime(dtim.hr, dtim.mn, 0);
+
+	  date2str(vdate, vdatestr, sizeof(vdatestr));
+	  time2str(vtime, vtimestr, sizeof(vtimestr));
+
+	  if ( cdoVerbose )
+	    cdoPrint(" Reading timestep: %3d %s %s", tsID+1, vdatestr, vtimestr);
+
+	  taxisDefVdate(taxisID, vdate);
+	  taxisDefVtime(taxisID, vtime);
+	  streamDefTimestep(streamID, tsID);
+
+	  for ( recID = 0; recID < nrecs; ++recID )
+	    {
+	      /* record size depends on data type */
+	      if (var_dfrm[recID] == 1) {
+		recsize = pfi.gsiz;
+	      }
+	      else if ((var_dfrm[recID] == 2) || (var_dfrm[recID] == -2)) {
+		recsize = pfi.gsiz*2;
+	      }
+	      else {
+		if ( pfi.flt64 )
+		  recsize = pfi.gsiz*8;
+		else
+		  recsize = pfi.gsiz*4;
+	      }
+
+	      rc = fread (rec, 1, recsize, pfi.infile);
+	      if ( rc < recsize ) cdoAbort("I/O error reading record=%d of timestep=%d!", recID+1, tsID+1);
+
+	      /* convert */
+	      if (var_dfrm[recID] == 1) {
+		unsigned char *carray = (void*)(rec + recoffset);
+		for (i = 0; i < gridsize; ++i) array[i] = (double) carray[i];
+	      }
+	      else if (var_dfrm[recID] == 2) {
+		unsigned short *sarray = (void*)(rec + recoffset);
+	        if (pfi.bswap) gabswp2(sarray, gridsize);
+		for (i = 0; i < gridsize; ++i) array[i] = (double) sarray[i];
+	      }
+	      else if (var_dfrm[recID] == -2) {
+		short *sarray = (void*)(rec + recoffset);
+	        if (pfi.bswap) gabswp2(sarray, gridsize);
+		for (i = 0; i < gridsize; ++i) array[i] = (double) sarray[i];
+	      }
+	      else if (var_dfrm[recID] == 4) {
+		int *iarray = (void*)(rec + recoffset);
+	        if (pfi.bswap) gabswp(iarray, gridsize);
+		for (i = 0; i < gridsize; ++i) array[i] = (double) iarray[i];
+	      }
+	      else {
+		if ( pfi.flt64 )
+		  {
+		    double *darray = (double *) (rec + recoffset);
+		    if (pfi.bswap) gabswp(darray, gridsize);
+		    for ( i = 0; i < gridsize; ++i ) array[i] = darray[i];
+		  }
+		else
+		  {
+		    float *farray = (float *) (rec + recoffset);
+		    if (pfi.bswap) gabswp(farray, gridsize);
+		    for ( i = 0; i < gridsize; ++i ) array[i] = (double) farray[i];
+		  }
+	      }
+
+	      fmin =  1.e99;
+	      fmax = -1.e99;
+	      nmiss = 0;
+	      n_nan = 0;
+	      for ( i = 0; i < gridsize; ++i )
+		{
+		  if ( array[i] > pfi.ulow && array[i] < pfi.uhi )
+		    {
+		      array[i] = pfi.undef;
+		      nmiss++;
+		    }
+		  else if ( DBL_IS_NAN(array[i]) )
+		    {
+		      array[i] = pfi.undef;
+		      nmiss++;
+		      n_nan++;
+		    }
+		  else
+		    {
+		      if ( array[i] < fmin ) fmin = array[i];
+		      if ( array[i] > fmax ) fmax = array[i];
+		    }
+		}
+	      if ( cdoVerbose )
+		printf("%3d %4d %3d %6d %6d %12.5g %12.5g\n", tsID, recID, recoffset, nmiss, n_nan, fmin, fmax);
+
+	      varID   = recVarID[recID];
+	      levelID = recLevelID[recID];
+	      streamDefRecord(streamID,  varID,  levelID);
+              streamWriteRecord(streamID, array, nmiss);
+ 	    }
+	}
+
+      /* break out if not templating */
+      if (!pfi.tmplat) break;
+      
+    } /* end of while (1) loop */
+
+
+  processDefVarNum(vlistNvars(vlistID), streamID);
+
+  streamClose(streamID);
+
+  vlistDestroy(vlistID);
+  gridDestroy(gridID);
+  zaxisDestroy(zaxisID);
+  taxisDestroy(taxisID);
+
+  free(array);
+  free(rec);
+
+  if ( var_zaxisID ) free(var_zaxisID);
+  if ( recVarID    ) free(recVarID);
+  if ( recLevelID  ) free(recLevelID);
+  if ( var_dfrm    ) free(var_dfrm);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Importcmsaf.c b/src/Importcmsaf.c
new file mode 100644
index 0000000..c5a3fa5
--- /dev/null
+++ b/src/Importcmsaf.c
@@ -0,0 +1,1665 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#define H5_USE_16_API
+
+#if  defined  (HAVE_LIBHDF5)
+#  include "hdf5.h"
+#endif
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  MAX_DSETS  1024
+
+typedef struct {
+  char *name;
+  char *description;
+  char *units;
+  char *title;
+  char *time;
+  int dtype;
+  int nx;
+  int ny;
+  int nz;
+  int nt;
+  int gridsize;
+  int lscale;
+  int loffset;
+  int lmissval;
+  double scale;
+  double offset;
+  double missval;
+  double *array;
+}
+dset_obj_t;
+
+typedef struct {
+  int nsets;
+  int mergelevel;
+  int lgeoloc;
+  int lregion;
+  int lprojtype;
+  int lmetadata;
+  dset_obj_t obj[MAX_DSETS];
+}
+dsets_t;
+
+
+#if  defined  (HAVE_LIBHDF5)
+static
+void print_filter(hid_t dset_id, char *varname)
+{
+  hid_t plist;
+  H5Z_filter_t filter;
+  unsigned int flags;
+  int idx;
+  unsigned int cd_values;
+  int nfilter;
+  size_t cd_nelmts = 1;
+  size_t pnamelen = 64;
+  char pname[64];
+
+  /* get filter */
+  plist = H5Dget_create_plist(dset_id);
+  nfilter = H5Pget_nfilters(plist);
+
+  for ( idx = 0; idx < nfilter; idx++ )
+    {
+      filter = H5Pget_filter(plist, idx, &flags, &cd_nelmts, &cd_values, 
+			     pnamelen, pname);
+      cdoPrint("Dataset %s: filter %d =  %s", varname, idx+1, pname);
+    }
+
+  H5Pclose(plist);
+}
+#endif
+
+
+#define  NINT(x)   ((x) < 0 ? (int)((x)-0.5) : (int)((x)+0.5))
+
+static
+void get_grid_info(double c0, double re, int *nrxp, int *nryp,
+		   double *r0p, double *s0p, double *cp)
+{
+  const double pi = M_PI;
+  double git, phi, s90;
+  double r0, s0, c;
+  int nrx, nry;
+
+  git=2.*pi*re*cos(pi/6.)/c0;
+  /* number of longitude pixels */
+  nrx=2*NINT(0.5*git);
+
+  /* central index in longitude */
+  r0=nrx/2+0.5;
+
+  /* resolution in km */
+  c=2.*pi*re*cos(30.*pi/180.)/nrx;
+
+  phi=pi/2.;
+  s90= re/c *sin(phi) / cos(30.*pi/180.);
+
+  nry=(int)floor(s90);
+  /* central index in latitude */
+  s0=nry+0.5;
+  /* number of latitude pixels */
+  nry=2*nry;
+
+  *nrxp = nrx;
+  *nryp = nry;
+  *r0p  = r0;
+  *s0p  = s0;
+  *cp   = c;
+}
+
+static
+double det_lon_atovs(double r, double r0, double lts, double c, double re)
+{
+  const double pi = M_PI;
+  double xla;
+
+  xla=(r-r0)*c/re/cos(lts*pi/180.); /* longitude */
+  xla=180.*xla/pi;
+
+  return (xla);
+}
+
+static
+double det_lat_atovs(double s, double s0, double lts, double c, double re)
+{
+  const double pi = M_PI;
+  double siphi;
+  double phi;
+
+  siphi=(s-s0)*c*cos(lts*pi/180.)/re;
+  phi=180.*asin(siphi)/pi; /* latitude */
+
+  return (phi);
+}
+
+static
+int defLonLatGrid(int nx, int ny, double c0, double lts, double re)
+{
+  int gridID;
+  int nrx, nry, i;
+  double c;
+  double r0, s0;
+  double r, s;
+  double xla, phi;
+  double *xvals, *yvals, *xbounds, *ybounds;
+
+  get_grid_info(c0, re, &nrx, &nry, &r0, &s0, &c);
+
+  if ( nx != nrx || ny != nry )
+    {
+      printf("nrx=%d nry=%d\n", nrx, nry);
+      return(-1);
+    }
+
+  xvals = (double *) malloc(nx*sizeof(double));
+  yvals = (double *) malloc(ny*sizeof(double));
+  xbounds = (double *) malloc(nx*2*sizeof(double));
+  ybounds = (double *) malloc(nx*2*sizeof(double));
+
+  for ( i = 0; i < nx; ++i )
+    {
+      r = i+1;
+      xla = det_lon_atovs(r, r0, lts, c, re);
+      xvals[i] = xla;
+      xla = det_lon_atovs(r-0.5, r0, lts, c, re);
+      xbounds[2*i] = xla;
+      xla = det_lon_atovs(r+0.5, r0, lts, c, re);
+      xbounds[2*i+1] = xla;
+      /* printf("xla[%d]=%g\n", i, xla); */
+    }
+
+  for ( i = 0; i < ny; ++i )
+    {
+      s = (nry-i-1)+1;
+      phi = det_lat_atovs(s, s0, lts, c, re);
+      yvals[i] = phi;
+      phi = det_lat_atovs(s-0.5, s0, lts, c, re);
+      ybounds[2*i] = phi;
+      phi = det_lat_atovs(s+0.5, s0, lts, c, re);
+      ybounds[2*i+1] = phi;
+      /* printf("phi[%d]=%g\n", i, phi); */
+    }
+
+  gridID = gridCreate(GRID_LONLAT, nx*ny);
+  gridDefXsize(gridID, nx);
+  gridDefYsize(gridID, ny);
+  gridDefXvals(gridID, xvals);
+  gridDefYvals(gridID, yvals);
+  /*
+  gridDefXbounds(gridID, xbounds);
+  gridDefYbounds(gridID, ybounds);
+  */
+  free(xvals);
+  free(yvals);
+  free(xbounds);
+  free(ybounds);
+
+  return (gridID);
+}
+
+static
+int defSinusoidalGrid(int nx, int ny, double xmin, double xmax, double ymin, double ymax, 
+		      double dx, double dy, double p1, double p2, double p3, double p4)
+{
+  int gridID;
+  int i;
+  double *xvals, *yvals;
+
+  xvals = (double *) malloc(nx*sizeof(double));
+  yvals = (double *) malloc(ny*sizeof(double));
+
+  for ( i = 0; i < nx; ++i )
+    {
+      xvals[i] = xmin + i*dx + dx/2;
+      /* printf("x[%d]=%g\n", i, xvals[i]); */
+    }
+
+  for ( i = 0; i < ny; ++i )
+    {
+      yvals[i] = ymax - i*dx - dx/2;
+      /* printf("y[%d]=%g\n", i, yvals[i]); */
+    }
+
+  gridID = gridCreate(GRID_SINUSOIDAL, nx*ny);
+  gridDefXsize(gridID, nx);
+  gridDefYsize(gridID, ny);
+  gridDefXvals(gridID, xvals);
+  gridDefYvals(gridID, yvals);
+
+  free(xvals);
+  free(yvals);
+
+  return (gridID);
+}
+
+static
+int defLaeaGrid(int nx, int ny, double xmin, double xmax, double ymin, double ymax, 
+		double dx, double dy, double a, double lon0, double lat0)
+{
+  int gridID;
+  int i;
+  double *xvals, *yvals;
+
+  xvals = (double *) malloc(nx*sizeof(double));
+  yvals = (double *) malloc(ny*sizeof(double));
+
+  for ( i = 0; i < nx; ++i )
+    {
+      xvals[i] = xmin + i*dx + dx/2;
+      /* printf("x[%d]=%g\n", i, xvals[i]); */
+    }
+
+  for ( i = 0; i < ny; ++i )
+    {
+      yvals[i] = ymax - i*dx - dx/2;
+      /* printf("y[%d]=%g\n", i, yvals[i]); */
+    }
+
+  gridID = gridCreate(GRID_LAEA, nx*ny);
+  gridDefXsize(gridID, nx);
+  gridDefYsize(gridID, ny);
+  gridDefXvals(gridID, xvals);
+  gridDefYvals(gridID, yvals);
+
+  gridDefLaea(gridID, a, lon0, lat0);
+
+  free(xvals);
+  free(yvals);
+
+  return (gridID);
+}
+
+static
+int scan_pcs_def(char *pcs_def, char proj[128], double *a, double *lon0, double *lat0)
+{
+  char *pcs[64];
+  int npcs = 0;
+  int i;
+  int len;
+  int nfound = 0;
+
+  strcpy(proj, "unknown");
+  *a = 1;
+  *lon0 = 0;
+  *lat0 = 0;
+
+  pcs[npcs++] = &pcs_def[0];
+  len = (int)strlen(pcs_def);
+  for ( i = 0; i < len; ++i )
+    if ( pcs_def[i] == ',' && npcs < 64 )
+      {
+	pcs_def[i] = 0;
+	pcs[npcs++] = &pcs_def[i+1];
+      }
+
+  for ( i = 0; i < npcs; ++i )
+    {
+      if ( memcmp(pcs[i], "proj=", 5) == 0 )
+	{
+	  pcs[i] += 5;
+	  strcpy(proj, pcs[i]);
+	  nfound++;
+	}
+      else if ( memcmp(pcs[i], "a=", 2) == 0 )
+	{
+	  pcs[i] += 2;
+	  *a = atof(pcs[i]);
+	  nfound++;
+	}
+      else if ( memcmp(pcs[i], "lon_0=", 6) == 0 )
+	{
+	  pcs[i] += 6;
+	  *lon0 = atof(pcs[i]);
+	  nfound++;
+	}
+      else if ( memcmp(pcs[i], "lat_0=", 6) == 0 )
+	{
+	  pcs[i] += 6;
+	  *lat0 = atof(pcs[i]);
+	  nfound++;
+	}
+    }
+
+  return (nfound);
+}
+
+#if  defined  (HAVE_LIBHDF5)
+static
+int read_geolocation(hid_t loc_id, int nx, int ny, int lprojtype)
+{
+  int gridID = -1;
+  hid_t grp_id;
+  hid_t proj_id, region_id;
+  hid_t proj_tid, region_tid;
+  hid_t str_tid, fltarr_tid;
+  hid_t ptype_id;
+  herr_t     status;
+  hsize_t dims;
+  int xsize, ysize;
+  typedef struct proj_t {
+    char name[64];
+    char ellipsoid[64];
+    float  parameter[10];
+  } proj_t;
+  typedef struct region_t {
+    float  xmin;
+    float  xmax;
+    float  ymin;
+    float  ymax;
+    float  dx;
+    float  dy;
+  } region_t;
+
+  proj_t proj;
+  region_t region;
+  char *projection_name = NULL;
+
+  if ( cdoVerbose ) cdoPrint("Read geolocation:");
+
+  if ( lprojtype )
+    {
+      ptype_id = H5Topen(loc_id, "ProjType");
+      if ( ptype_id >= 0 )
+	{
+	  projection_name = H5Tget_member_name(ptype_id, 0);
+	  H5Tclose(ptype_id);
+	}
+    }
+
+  str_tid = H5Tcopy(H5T_C_S1);
+  H5Tset_size(str_tid, 64);
+  dims = 10;
+  fltarr_tid = H5Tarray_create(H5T_NATIVE_FLOAT, 1, &dims, NULL);
+
+  proj_tid = H5Tcreate(H5T_COMPOUND, sizeof(proj_t));
+  if ( projection_name )
+    H5Tinsert(proj_tid, projection_name, HOFFSET(proj_t, name), str_tid);
+  else
+    H5Tinsert(proj_tid, "Projection name", HOFFSET(proj_t, name), str_tid);
+  H5Tinsert(proj_tid, "Reference ellipsoid", HOFFSET(proj_t, ellipsoid), str_tid);
+  H5Tinsert(proj_tid, "Projection parameter", HOFFSET(proj_t, parameter), fltarr_tid);
+
+  if ( projection_name ) free(projection_name);
+
+  grp_id = H5Gopen(loc_id, "Geolocation");
+
+  proj_id = H5Dopen(grp_id, "Projection");
+  if ( proj_id < 0 )
+    proj_id = H5Dopen(grp_id, "projection");
+  /*
+  {
+    hid_t tid;
+    int nmem;
+    int im;
+
+    tid = H5Dget_type(proj_id);
+    nmem = H5Tget_nmembers(tid);
+    for ( im = 0; im < nmem; ++im )
+      {
+	printf("%d %s\n", im, H5Tget_member_name(tid, im));
+      }
+  }
+  */
+  if ( proj_id < 0 )
+    memset(&proj, 0, sizeof(proj_t));
+  else
+    status = H5Dread(proj_id, proj_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &proj);
+
+  H5Dclose(proj_id);
+  H5Tclose(proj_tid);
+  H5Tclose(str_tid);
+  H5Tclose(fltarr_tid);
+
+  if ( cdoVerbose )
+    cdoPrint("  Projection: name=%s\n\t\t\tellipsoid=%s\n\t\t\tparameter=%g %g %g %g %g %g",  
+	     proj.name, proj.ellipsoid, 
+	     proj.parameter[0], proj.parameter[1], proj.parameter[2], 
+	     proj.parameter[3], proj.parameter[4], proj.parameter[5]);
+
+  region_tid = H5Tcreate(H5T_COMPOUND, sizeof(region_t));
+  H5Tinsert(region_tid, "xmin", HOFFSET(region_t, xmin), H5T_NATIVE_FLOAT);
+  H5Tinsert(region_tid, "xmax", HOFFSET(region_t, xmax), H5T_NATIVE_FLOAT);
+  H5Tinsert(region_tid, "ymin", HOFFSET(region_t, ymin), H5T_NATIVE_FLOAT);
+  H5Tinsert(region_tid, "ymax", HOFFSET(region_t, ymax), H5T_NATIVE_FLOAT);
+  H5Tinsert(region_tid, "dx",   HOFFSET(region_t, dx),   H5T_NATIVE_FLOAT);
+  H5Tinsert(region_tid, "dy",   HOFFSET(region_t, dy),   H5T_NATIVE_FLOAT);
+
+  region_id = H5Dopen(grp_id, "Region");
+  if ( region_id < 0 )
+    region_id = H5Dopen(grp_id, "region");
+  
+  if ( region_id < 0 )
+    memset(&region, 0, sizeof(region_t));
+  else
+    status = H5Dread(region_id, region_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &region);
+
+  H5Dclose(region_id);
+  H5Tclose(region_tid);
+
+  if ( region.xmin > region.xmax )
+    {
+      double xmin = region.xmin;
+      region.xmin = region.xmax;
+      region.xmax = xmin;
+      if ( cdoVerbose ) cdoPrint("  Swap xmin/xmax");
+    }
+
+  if ( cdoVerbose ) 
+    cdoPrint("  Region: xmin=%g xmax=%g ymin=%g ymax=%g dx=%g dy=%g",
+	     region.xmin, region.xmax, region.ymin, region.ymax, region.dx, region.dy);
+
+  H5Gclose(grp_id);
+
+  /* check region */
+  xsize = NINT((region.xmax-region.xmin)/region.dx);
+  ysize = NINT((region.ymax-region.ymin)/region.dy);
+
+  if ( cdoVerbose ) cdoPrint("  Size: xsize=%d  ysize=%d", xsize, ysize);
+
+  /* some CM-SAF files have incorrect entries for some metadata. */
+  /* these are corrected in the following sections. */
+  /* in case of questions on this, contact frank.kaspar at dwd.de */
+  if ( strcmp(proj.ellipsoid, "WSG-84") == 0 ) strcpy(proj.ellipsoid, "WGS-84");
+
+  if ( (int)region.xmin == -8887500 &&  (int)region.xmax == -8887500 &&
+       (int)region.ymin == 8887500 && (int)region.ymax == 8887500 &&
+       (int)region.dx == 15000 && (int)region.dy  == 15000 )
+    {
+       region.xmax = 8887500.0;
+       region.ymin = -8887500.0;
+       if ( cdoVerbose )
+         cdoPrint("  Corrected region: xmin=%g xmax=%g ymin=%g ymax=%g dx=%g dy=%g",
+                region.xmin, region.xmax, region.ymin, region.ymax, region.dx, region.dy);
+
+       xsize = NINT((region.xmax-region.xmin)/region.dx);
+       ysize = NINT((region.ymax-region.ymin)/region.dy);
+       if ( cdoVerbose ) cdoPrint("  Corrected size: xsize=%d  ysize=%d", xsize, ysize);
+    }
+
+  if (nx == 298 && ny == 371 &&
+      (int)region.xmin == -6709222 &&  (int)region.xmax == 6709222 &&
+      (int)region.ymin == -6664078 && (int)region.ymax == 9984898 &&
+      (int)region.dx == 45000 && (int)region.dy  == 45000 )
+    {
+        region.xmin = -6705000;
+        region.xmax = 6705000;
+        region.ymin = -6705000;
+        region.ymax = 9990000;      
+        cdoPrint("  Corrected region: xmin=%g xmax=%g ymin=%g ymax=%g dx=%g dy=%g",
+               region.xmin, region.xmax, region.ymin, region.ymax, region.dx, region.dy);
+
+        xsize = NINT((region.xmax-region.xmin)/region.dx);
+        ysize = NINT((region.ymax-region.ymin)/region.dy);
+        if ( cdoVerbose ) cdoPrint("  Corrected size: xsize=%d  ysize=%d", xsize, ysize);
+    }
+
+  if ( strcmp(proj.name, "sinusoidal") != 0  && 
+       ( (nx == xsize && ny == ysize &&
+	  (int)region.xmin == -8887500 && (int)region.xmax == 8887500 && 
+	  (int)region.ymin == -8887500 && (int)region.ymax == 8887500 && 
+	  (int)region.dx == 15000 && (int)region.dy  == 15000 )
+	 ||
+	 (nx == xsize && ny == ysize &&
+	  (int)region.xmin == -5827500 && (int)region.xmax == 5827500 && 
+	  (int)region.ymin ==  3307500 && (int)region.ymax == 8887500 && 
+	  (int)region.dx == 15000 && (int)region.dy  == 15000 )
+	 ||
+	 (nx == xsize && ny == ysize &&
+	  (int)region.xmin == -5827500 && (int)region.xmax == 5827500 &&
+	  (int)region.ymin ==  3307500 && (int)region.ymax == 8887500 &&
+	  (int)region.dx == 45000 && (int)region.dy  == 45000 )
+	 ||
+	 (nx == xsize && ny == ysize &&
+	  (int)region.xmin == -5827500 && (int)region.xmax == 5827500 &&
+	  (int)region.ymin ==  3307500 && (int)region.ymax == 8887500 &&
+	  (int)region.dx == 3000 && (int)region.dy  == 3000 )
+	 ||
+	 (nx == 298 && ny == 371 &&
+	  (int)region.xmin == -6709222 && (int)region.xmax == 6709222 &&
+	  (int)region.ymin == -6664078 && (int)region.ymax == 9984898 &&
+	  (int)region.dx == 45000 && (int)region.dy  == 45000 ) 
+	 ||
+	 (nx == xsize && ny == ysize &&
+	  (int)region.xmin == -6705000 && (int)region.xmax == 6705000 &&
+	  (int)region.ymin == -6705000 && (int)region.ymax == 9990000 &&
+	  (int)region.dx == 45000 && (int)region.dy  == 45000 ) ) )
+    {
+      if ( cdoVerbose ) cdoPrint("Replacing incorrect projection parameters for sinusoidal products:");
+      strcpy(proj.ellipsoid, "WGS-84");
+      strcpy(proj.name, "sinusoidal");
+      proj.parameter[0] = 0.0; 
+      proj.parameter[1] = 0.0;
+      proj.parameter[2] = 0.0; 
+      proj.parameter[3] = 0.0;  
+      proj.parameter[4] = -99.99;      
+      proj.parameter[5] = -99.99;          
+      if ( cdoVerbose ) 
+	  cdoPrint("proj1 = %g, proj2 = %g, proj3 = %g, proj4 = %g,",  
+		   proj.parameter[0], proj.parameter[1],  
+		   proj.parameter[2], proj.parameter[3]);
+    }
+
+  if ( nx == xsize && ny == ysize && 
+       strcmp(proj.name, "sinusoidal") == 0 && 
+       strcmp(proj.ellipsoid, "WGS-84") == 0  )
+    {
+      gridID = defSinusoidalGrid(nx, ny, region.xmin, region.xmax, region.ymin, region.ymax, 
+				 region.dx, region.dy,
+				 proj.parameter[0], proj.parameter[1], 
+				 proj.parameter[2], proj.parameter[3]);
+    }
+  /* modification by Frank Kaspar */
+  else if ( nx == xsize && ny == ysize &&
+            strcmp(proj.name, "Lambert Azimuthal Equal Area") == 0 &&
+            memcmp(proj.ellipsoid, "Sphere", 6) == 0 )
+    {
+      double a;
+      if ( proj.parameter[4] < 0 )
+        {
+          a=6370997.0;
+        }
+      else
+        {
+          a=proj.parameter[4];
+        }
+      gridID = defLaeaGrid(nx, ny,
+                           region.xmin, region.xmax,
+                           region.ymin, region.ymax,
+                           region.dx, region.dy,
+                           a, proj.parameter[2], proj.parameter[3]);
+    }
+  else if ( memcmp(proj.name, "Cylindrical Equal Area", 22) == 0 &&
+            memcmp(proj.ellipsoid, "Sphere", 6) == 0 )
+    {
+      double c0  = 0.001*sqrt(proj.parameter[5]);       /* nominal spatial resolution */
+      double lts = proj.parameter[3];      
+      double re  = proj.parameter[4]/1000;  /* Earth radius [km]*/
+      if ( cdoVerbose ) cdoPrint("  c0 = %g, lts = %g, re = %g", c0, lts, re); 
+      gridID = defLonLatGrid(nx, ny, c0, lts, re);
+    }
+  else if ( nx == 386 && ny == 162 )
+    {
+      double c0  = 90;       /* nominal spatial resolution */
+      double lts = 30;      
+      double re  = 6371.228;  /* Earth radius [km]*/
+      if ( cdoVerbose ) cdoPrint("  c0 = %g, lts = %g, re = %g", c0, lts, re); 
+      gridID = defLonLatGrid(nx, ny, c0, lts, re);
+    }
+
+  return (gridID);
+}
+#endif
+
+#if  defined  (HAVE_LIBHDF5)
+static
+int read_region(hid_t loc_id, int nx, int ny)
+{
+  int gridID = -1;
+  hid_t grp_id;
+  hid_t region_id;
+  hid_t region_tid;
+  hid_t str64_tid, str128_tid, fltarr_tid;
+  herr_t     status;
+  hsize_t dims;
+  typedef struct region_t {
+    double area_extent[4];
+    int xsize;
+    int ysize;
+    float xscale;
+    float yscale;
+    float lat_0;
+    float lon_0;
+    float lat_ts;
+    char id[128];
+    char name[128];
+    char pcs_id[128];
+    char pcs_def[128];
+  } region_t;
+  region_t region;
+  int nfound;
+  char proj[128];
+  double a, lon0, lat0;
+  double xmin, ymin, xmax, ymax;
+  double dx, dy;
+
+  if ( cdoVerbose ) cdoPrint("Read region:");
+
+  /*
+   * Create a data type for region
+   */
+  region_tid = H5Tcreate(H5T_COMPOUND, sizeof(region_t));
+  dims = 4;
+  fltarr_tid = H5Tarray_create(H5T_NATIVE_DOUBLE, 1, &dims, NULL);
+  str64_tid = H5Tcopy(H5T_C_S1);
+  H5Tset_size(str64_tid, 128);
+  str128_tid = H5Tcopy(H5T_C_S1);
+  H5Tset_size(str128_tid, 128);
+
+  H5Tinsert(region_tid, "area_extent", HOFFSET(region_t, area_extent), fltarr_tid);
+  H5Tinsert(region_tid, "xsize",   HOFFSET(region_t, xsize),   H5T_NATIVE_INT);
+  H5Tinsert(region_tid, "ysize",   HOFFSET(region_t, ysize),   H5T_NATIVE_INT);
+  H5Tinsert(region_tid, "xscale",  HOFFSET(region_t, xscale),  H5T_NATIVE_FLOAT);
+  H5Tinsert(region_tid, "yscale",  HOFFSET(region_t, yscale),  H5T_NATIVE_FLOAT);
+  H5Tinsert(region_tid, "lat_0",   HOFFSET(region_t, lat_0),   H5T_NATIVE_FLOAT);
+  H5Tinsert(region_tid, "lon_0",   HOFFSET(region_t, lon_0),   H5T_NATIVE_FLOAT);
+  H5Tinsert(region_tid, "lat_ts",  HOFFSET(region_t, lat_ts),  H5T_NATIVE_FLOAT);
+  H5Tinsert(region_tid, "id",      HOFFSET(region_t, id),      str64_tid);
+  H5Tinsert(region_tid, "name",    HOFFSET(region_t, name),    str64_tid);
+  H5Tinsert(region_tid, "pcs_id",  HOFFSET(region_t, pcs_id),  str64_tid);
+  H5Tinsert(region_tid, "pcs_def", HOFFSET(region_t, pcs_def), str128_tid);
+
+  grp_id = H5Gopen(loc_id, "/");
+
+  region_id = H5Dopen(grp_id, "region");
+  /*
+  {
+    hid_t tid;
+    int nmem;
+    int im;
+
+    tid = H5Dget_type(proj_id);
+    nmem = H5Tget_nmembers(tid);
+    for ( im = 0; im < nmem; ++im )
+      {
+	printf("%d %s\n", im, H5Tget_member_name(tid, im));
+      }
+  }
+  */
+  status = H5Dread(region_id, region_tid, H5S_ALL, H5S_ALL, H5P_DEFAULT, &region);
+
+  if ( cdoVerbose )
+    {
+      printf("area_extent[0] = %g\n", region.area_extent[0]);
+      printf("area_extent[1] = %g\n", region.area_extent[1]);
+      printf("area_extent[2] = %g\n", region.area_extent[2]);
+      printf("area_extent[3] = %g\n", region.area_extent[3]);
+      printf("xsize = %d\n", region.xsize);
+      printf("ysize = %d\n", region.ysize);
+      printf("xscale = %g\n", region.xscale);
+      printf("yscale = %g\n", region.yscale);
+      printf("lat_0 = %g\n", region.lat_0);
+      printf("lon_0 = %g\n", region.lon_0);
+      printf("lat_ts = %g\n", region.lat_ts);
+      printf("id = %s\n", region.id);
+      printf("name = %s\n", region.name);
+      printf("pcs_id = %s\n", region.pcs_id);
+      printf("pcs_def = %s\n", region.pcs_def);
+    }
+
+  H5Dclose(region_id);
+  H5Tclose(region_tid);
+  H5Tclose(str64_tid);
+  H5Tclose(str128_tid);
+  H5Tclose(fltarr_tid);
+
+  H5Gclose(grp_id);
+
+  /* check region */
+
+  nfound = scan_pcs_def(region.pcs_def, proj, &a, &lon0, &lat0);
+
+  if ( cdoVerbose )
+    {
+      printf("proj = %s\n", proj);
+      printf("a    = %g\n", a);
+      printf("lon0 = %g\n", lon0);
+      printf("lat0 = %g\n", lat0);
+    }
+
+  xmin =  region.area_extent[0];
+  ymin =  region.area_extent[1];
+  xmax =  region.area_extent[2];
+  ymax =  region.area_extent[3];
+
+  dx = (xmax-xmin) / nx;
+  dy = (ymax-ymin) / ny;
+  /*
+  xsize = NINT((region.xmax-region.xmin)/region.dx);
+  ysize = NINT((region.ymax-region.ymin)/region.dy);
+
+  if ( cdoVerbose ) cdoPrint("  Size: xsize=%d  ysize=%d", xsize, ysize);
+  */
+
+  if ( nfound == 4 &&
+       nx == region.xsize && ny == region.ysize && 
+       strcmp(proj, "laea") == 0 )
+    {
+      gridID = defLaeaGrid(nx, ny, xmin, xmax, ymin, ymax, 
+			   dx, dy, a, lon0, lat0);
+    }
+
+  return (gridID);
+}
+#endif
+
+#if  defined  (HAVE_LIBHDF5)
+static
+void read_dataset(hid_t loc_id, const char *name, void *opdata)
+{
+  hid_t dset_id, type_id;
+  hid_t   dataspace;   
+  hsize_t dims_out[9];  /* dataset dimensions           */
+  herr_t  status;	/* Generic return value		*/
+  hid_t   attr, atype, atype_mem;
+  hid_t   native_type;
+  int iattr;
+  float fattr;
+  double dattr;
+  char attname[CDI_MAX_NAME];
+  H5T_class_t  type_class;
+  H5T_class_t atype_class;
+  size_t atype_size;
+  int     rank;
+  int nx = 0, ny = 0, nz = 0, nt = 0;
+  int gridsize, offset;
+  double *array;
+  double addoffset = 0, scalefactor = 1, missval = cdiInqMissval();
+  int laddoffset = 0, lscalefactor = 0, lmissval = 0;
+  int nset;
+  int i, k;
+  int ftype = 0;
+  int len;
+  int dtype = DATATYPE_FLT32;
+  char attstring[4096];     /* Buffer to read string attribute back */
+  char varname[CDI_MAX_NAME];
+  short *mask = NULL;
+  double minval, maxval;
+  int nmiss;
+  int num_attrs;
+
+  attstring[0] = 0;
+  strcpy(varname, name);
+
+  dset_id = H5Dopen(loc_id, varname);
+  
+  type_id = H5Dget_type(dset_id);  /* get datatype*/
+
+  type_class = H5Tget_class(type_id);
+  if ( type_class < 0 )
+    {
+      cdoAbort(" Invalid datatype for %s", varname);
+    }
+  /*
+  else {
+    if(type_class == H5T_INTEGER)
+      puts("   Datatype is 'H5T_NATIVE_INTEGER'.\n");
+    if(type_class == H5T_FLOAT)
+      puts("   Datatype is 'H5T_NATIVE_FLOAT'.\n");
+    if(type_class == H5T_STRING)
+      puts("   Datatype is 'H5T_NATIVE_STRING'.\n");
+    if(type_class == H5T_BITFIELD)
+      puts("   Datatype is 'H5T_NATIVE_BITFIELD'.\n");
+    if(type_class == H5T_OPAQUE)
+      puts("   Datatype is 'H5T_NATIVE_OPAQUE'.\n");
+    if(type_class == H5T_COMPOUND)
+      puts("   Datatype is 'H5T_NATIVE_COMPOUND'.\n");
+  }
+  */
+  native_type = H5Tget_native_type(type_id, H5T_DIR_ASCEND);
+  if      ( H5Tequal(native_type, H5T_NATIVE_SCHAR)  > 0 ) {ftype=0; dtype = DATATYPE_INT8;}
+  else if ( H5Tequal(native_type, H5T_NATIVE_UCHAR)  > 0 ) {ftype=0; dtype = DATATYPE_UINT8;}
+  else if ( H5Tequal(native_type, H5T_NATIVE_SHORT)  > 0 ) {ftype=0; dtype = DATATYPE_INT16;}
+  else if ( H5Tequal(native_type, H5T_NATIVE_USHORT) > 0 ) {ftype=0; dtype = DATATYPE_UINT16;}
+  else if ( H5Tequal(native_type, H5T_NATIVE_INT)    > 0 ) {ftype=0; dtype = DATATYPE_INT32;}
+  else if ( H5Tequal(native_type, H5T_NATIVE_UINT)   > 0 ) {ftype=0; dtype = DATATYPE_UINT32;}
+  else if ( H5Tequal(native_type, H5T_NATIVE_FLOAT)  > 0 ) {ftype=1; dtype = DATATYPE_FLT32;}
+  else if ( H5Tequal(native_type, H5T_NATIVE_DOUBLE) > 0 ) {ftype=1; dtype = DATATYPE_FLT64;}
+  else
+    {
+      cdoWarning("Dataset %s skipped, unsupported native datatype!", varname);
+      goto RETURN;
+    }
+  H5Tclose(native_type);
+
+  dataspace = H5Dget_space(dset_id);    /* dataspace handle */
+  rank      = H5Sget_simple_extent_ndims(dataspace);
+  status    = H5Sget_simple_extent_dims(dataspace, dims_out, NULL);
+
+  if ( rank == 2 )
+    {
+      nx = dims_out[1];
+      ny = dims_out[0];
+      nz = 1;
+      nt = 1;
+    }
+  else if ( rank == 3 )
+    {
+      nx = dims_out[2];
+      ny = dims_out[1];
+      nz = 1;
+      nt = dims_out[0];
+    }
+  else
+    {
+      cdoWarning("Dataset %s skipped, unsupported rank (=%d)!", varname, rank);
+      goto RETURN;
+    }
+
+
+  len = (int) strlen(varname);
+  if ( ((dsets_t *) opdata)->mergelevel )
+    if ( isdigit(varname[len-1]) && memcmp(varname, "Data", 4) != 0 )
+      {
+	if ( nt > 1 ) cdoAbort("Combination of nlevel > 1 and ntime > 1 not implemented!");
+       
+	nz = atoi(&varname[len-1]);
+	varname[len-1] = 0;
+      }
+
+  gridsize = nx*ny;
+
+  if ( nz == 1 )
+    nset = ((dsets_t *) opdata)->nsets;
+  else
+    {
+      for ( nset = 0; nset < ((dsets_t *) opdata)->nsets; ++nset )
+	{
+	  if ( strcmp(varname, ((dsets_t *) opdata)->obj[nset].name) == 0 ) break;
+	}
+
+      if ( nset >= ((dsets_t *) opdata)->nsets )
+	cdoAbort("3D var %s not found!", varname);
+    }
+
+  if ( nset < MAX_DSETS )
+    {
+      if ( cdoVerbose ) print_filter(dset_id, varname);
+
+      num_attrs = H5Aget_num_attrs(dset_id);
+      for( i = 0; i < num_attrs; i++ )
+	{
+	  attr = H5Aopen_idx(dset_id, i);
+	  atype = H5Aget_type(attr);
+	  H5Aget_name(attr, sizeof(attname), attname);
+
+	  if ( strcmp(attname, "CLASS") == 0 ||
+	       strcmp(attname, "IMAGE_VERSION") == 0 ||
+	       strcmp(attname, "PALETTE") == 0 ) continue;
+
+	  atype_mem = H5Tget_native_type(atype, H5T_DIR_ASCEND);
+	  atype_size = H5Tget_size(atype);
+	  atype_class = H5Tget_class(atype);
+
+	  len = strlen(attname);
+	  for ( k = 0; k < len; ++k ) attname[k] = tolower(attname[k]);
+
+	  if ( strcmp(attname, "intercept") == 0 ||
+	       strcmp(attname, "offset")    == 0 )
+	    {
+	      if ( atype_class == H5T_FLOAT )
+		{
+		  if ( atype_size == 4 )
+		    {
+		      status = H5Aread(attr, H5T_NATIVE_FLOAT, &fattr);
+		      if ( status >= 0 )
+			{
+			  addoffset  = fattr;
+			  laddoffset = 1;
+			}
+		    }
+		  else
+		    {
+		      status = H5Aread(attr, H5T_NATIVE_DOUBLE, &dattr);
+		      if ( status >= 0 )
+			{
+			  addoffset  = dattr;
+			  laddoffset = 1;
+			}
+		    }
+
+		  if ( laddoffset == 0 )
+		    cdoWarning("Reading of float attribute %s failed!", attname);
+		}
+	      else if ( atype_class == H5T_INTEGER )
+		{
+		  status = H5Aread(attr, H5T_NATIVE_INT, &iattr);
+		  if ( status >= 0 )
+		    {
+		      addoffset  = iattr;
+		      laddoffset = 1;
+		    }
+		  else
+		    cdoWarning("Reading of integer attribute %s failed!", attname);
+		}
+	      else
+		cdoWarning("Attribute %s has unsupported data type!", attname);
+	    }
+	  else if ( strcmp(attname, "gain") == 0 ||
+		    strcmp(attname, "scaling_factor") == 0 )
+	    {
+	      if ( atype_class == H5T_FLOAT )
+		{
+		  if ( atype_size == 4 )
+		    {
+		      status = H5Aread(attr, H5T_NATIVE_FLOAT, &fattr);
+		      if ( status >= 0 )
+			{
+			  scalefactor  = fattr;
+			  lscalefactor = 1;
+			}
+		    }
+		  else
+		    {
+		      status = H5Aread(attr, H5T_NATIVE_DOUBLE, &dattr);
+		      if ( status >= 0 )
+			{
+			  scalefactor  = dattr;
+			  lscalefactor = 1;
+			}
+		    }
+
+		  if ( lscalefactor == 0 )
+		    cdoWarning("Reading of float attribute %s failed!", attname);
+		}
+	      else if ( atype_class == H5T_INTEGER )
+		{
+		  status = H5Aread(attr, H5T_NATIVE_INT, &iattr);
+		  if ( status >= 0 )
+		    {
+		      scalefactor  = iattr;
+		      lscalefactor = 1;
+		    }
+		  else
+		    cdoWarning("Reading of integer attribute %s failed!", attname);
+		}
+	      else
+		cdoWarning("Attribute %s has unsupported data type!", attname);
+	    }
+	  else if ( strncmp(attname, "no_data", 7) == 0 ||
+		    strncmp(attname, "nodata", 6)  == 0 )
+	    {
+	      if ( atype_class == H5T_FLOAT )
+		{
+		  if ( atype_size == 4 )
+		    {
+		      status = H5Aread(attr, H5T_NATIVE_FLOAT, &fattr);
+		      if ( status >= 0 )
+			{
+			  missval  = fattr;
+			  lmissval = 1;
+			}
+		    }
+		  else
+		    {
+		      status = H5Aread(attr, H5T_NATIVE_DOUBLE, &dattr);
+		      if ( status >= 0 )
+			{
+			  missval  = dattr;
+			  lmissval = 1;
+			}
+		    }
+
+		  if ( lmissval == 0 )
+		    cdoWarning("Reading of float attribute %s failed!", attname);
+		}
+	      else if ( atype_class == H5T_INTEGER )
+		{
+		  status = H5Aread(attr, H5T_NATIVE_INT, &iattr);
+		  if ( status >= 0 )
+		    {
+		      missval  = iattr;
+		      lmissval = 1;
+		    }
+		  else
+		    cdoWarning("Reading of integer attribute %s failed!", attname);
+		}
+	      else
+		cdoWarning("Attribute %s has unsupported data type!", attname);
+	    }
+	  else if ( strcmp(attname, "description") == 0 )
+	    {
+	      H5Aread(attr, atype_mem, attstring);
+	      if ( ((dsets_t *) opdata)->obj[nset].description )
+		free(((dsets_t *) opdata)->obj[nset].description);
+	      ((dsets_t *) opdata)->obj[nset].description = strdup(attstring);
+	    }
+	  else if ( strcmp(attname, "title") == 0 )
+	    {
+	      H5Aread(attr, atype_mem, attstring);
+	      if ( ((dsets_t *) opdata)->obj[nset].title )
+		free(((dsets_t *) opdata)->obj[nset].title);
+	      ((dsets_t *) opdata)->obj[nset].title = strdup(attstring);
+	    }
+	  else if ( strcmp(attname, "time") == 0 )
+	    {
+	      H5Aread(attr, atype_mem, attstring);
+	      if ( ((dsets_t *) opdata)->obj[nset].time )
+		free(((dsets_t *) opdata)->obj[nset].time);
+	      ((dsets_t *) opdata)->obj[nset].time = strdup(attstring);
+	    }
+	  else if ( strcmp(attname, "unit") == 0 )
+	    {
+	      H5Aread(attr, atype_mem, attstring);
+	      ((dsets_t *) opdata)->obj[nset].units = strdup(attstring);
+	    }
+
+	  H5Tclose(atype_mem);
+	  H5Aclose(attr);
+	  H5Tclose(atype);
+	}
+      
+      offset = gridsize*(nz-1);
+      array  = ((dsets_t *) opdata)->obj[nset].array;
+      array  = (double *) realloc(array, gridsize*nz*nt*sizeof(double));
+      ((dsets_t *) opdata)->obj[nset].array    = array;
+      array  = array+offset;
+
+      if ( ftype )
+	{
+	  if ( dtype == DATATYPE_FLT32 )
+	    {
+	      float *farray;
+	      int i;
+	      farray = (float *) malloc(gridsize*nt*sizeof(float));
+	      status = H5Dread(dset_id, H5T_NATIVE_FLOAT, H5S_ALL, H5S_ALL, H5P_DEFAULT, farray);
+	      if ( status < 0 )
+		cdoAbort("Reading of NATIVE_FLOAT variable %s failed!", varname);
+	      for ( i = 0; i < gridsize*nt; ++i ) array[i] = farray[i];
+	      free(farray);
+	    }
+	  else
+	    {
+	      status = H5Dread(dset_id, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, array);
+	      if ( status < 0 )
+		cdoAbort("Reading of NATIVE_DOUBLE variable %s failed!", varname);
+	    }
+	}
+      else
+	{
+	  int *iarray, i;
+	  iarray = (int *) malloc(gridsize*nt*sizeof(int));
+	  status = H5Dread(dset_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, iarray);
+	  if ( status < 0 )
+	    cdoAbort("Reading of NATIVE_INT variable %s failed!", varname);
+	  for ( i = 0; i < gridsize*nt; ++i ) array[i] = iarray[i];
+	  free(iarray);
+	}
+
+      ((dsets_t *) opdata)->obj[nset].name     = strdup(varname);
+      ((dsets_t *) opdata)->obj[nset].nx       = nx;
+      ((dsets_t *) opdata)->obj[nset].ny       = ny;
+      ((dsets_t *) opdata)->obj[nset].nz       = nz;
+      ((dsets_t *) opdata)->obj[nset].nt       = nt;
+      ((dsets_t *) opdata)->obj[nset].gridsize = gridsize;
+
+      if ( nz > 1 )
+	{
+	  if ( ((dsets_t *) opdata)->obj[nset].dtype != dtype )
+	    cdoWarning("Data type changes over levels!");
+
+	  if ( laddoffset && !DBL_IS_EQUAL(((dsets_t *) opdata)->obj[nset].offset, addoffset) )
+	    cdoWarning("Offset changes over levels!");
+
+	  if ( lscalefactor && !DBL_IS_EQUAL(((dsets_t *) opdata)->obj[nset].scale, scalefactor) )
+	    cdoWarning("Scalefactor changes over levels!");
+
+	  if ( lmissval && !DBL_IS_EQUAL(((dsets_t *) opdata)->obj[nset].missval, missval) )
+	    cdoWarning("Missing value changes over levels!");	       
+	}
+
+      if ( nz == 1 ) ((dsets_t *) opdata)->nsets++;
+
+      mask = (short *) malloc(gridsize*nt*sizeof(short));
+      memset(mask, 0, gridsize*nt*sizeof(short));
+
+      nmiss  = 0;
+ 
+      minval =  1e35;
+      maxval = -1e35;
+      for ( i = 0; i < gridsize*nt; i++ )
+	{
+	  if ( array[i] < minval ) minval = array[i];
+	  if ( array[i] > maxval ) maxval = array[i];
+	}
+
+      if ( cdoVerbose )
+	cdoPrint("Dataset %s: missval = %g  addoffset = %g  scalefactor = %g",
+		 varname, missval, addoffset, scalefactor);
+
+      if ( cdoVerbose )
+	cdoPrint("Dataset %s: dtype = %d  minval = %g  maxval = %g  missval = %g",
+		 varname, dtype,  minval, maxval, missval);
+
+      if ( dtype == DATATYPE_UINT8 )
+	{
+	  if ( minval >= 0 && maxval <= 127 ) dtype = DATATYPE_INT8;
+	}
+      else if ( dtype == DATATYPE_UINT16 )
+	{
+	  if ( minval >= 0 && maxval <= 32767 ) dtype = DATATYPE_INT16;
+	}
+
+      laddoffset   = IS_NOT_EQUAL(addoffset,   0);
+      lscalefactor = IS_NOT_EQUAL(scalefactor, 1);
+
+      if ( laddoffset || lscalefactor )
+	{	  
+	  for ( i = 0; i < gridsize*nt; i++ )
+	    if ( !DBL_IS_EQUAL(array[i], missval) )
+	      {
+		mask[i] = 0;
+
+		if ( lscalefactor ) array[i] *= scalefactor;
+		if ( laddoffset   ) array[i] += addoffset;
+	      }
+	    else
+	      {
+		nmiss++;
+		mask[i] = 1;
+	      }
+	}
+	    
+      minval =  1e35;
+      maxval = -1e35;
+      for ( i = 0; i < gridsize*nt; i++ )
+	if ( mask[i] == 0 )
+	  {
+	    if ( array[i] < minval ) minval = array[i];
+	    if ( array[i] > maxval ) maxval = array[i];
+	  }
+
+      if ( cdoVerbose )
+	cdoPrint("Dataset %s: dtype = %d  minval = %g  maxval = %g  missval = %g",
+		 varname, dtype,  minval, maxval, missval);
+
+      if ( nmiss > 0 )
+	{
+	  if ( ! (missval < minval || missval > maxval) )
+	    {
+	      if ( DBL_IS_EQUAL(missval, 255.) && dtype == DATATYPE_UINT8 )
+		{
+		  missval = -255;
+		  dtype   = DATATYPE_INT16;
+		  cdoPrint("Dataset %s: changed missval to %g and datatype to INT16!",
+			   varname, missval);
+
+		  for ( i = 0; i < gridsize*nt; i++ )
+		    if ( mask[i] ) array[i] = missval;
+		}
+	      else
+		cdoWarning(" Missing value is inside the range of valid values!\n"
+                           " Dataset %s,  Missval: %g,  Range: %g - %g",
+			   varname, missval, minval, maxval);
+	    }
+	}
+
+      ((dsets_t *) opdata)->obj[nset].dtype    = dtype;
+      ((dsets_t *) opdata)->obj[nset].loffset  = laddoffset;
+      ((dsets_t *) opdata)->obj[nset].lscale   = lscalefactor;
+      ((dsets_t *) opdata)->obj[nset].lmissval = lmissval;
+      ((dsets_t *) opdata)->obj[nset].offset   = addoffset;
+      ((dsets_t *) opdata)->obj[nset].scale    = scalefactor;
+      ((dsets_t *) opdata)->obj[nset].missval  = missval;
+
+      free(mask); 
+      mask = NULL;
+    }
+  else
+    {
+      cdoWarning("Too many datasets (MAX = %d)!", MAX_DSETS);
+      goto RETURN;
+    }
+
+  H5Sclose(dataspace);
+
+ RETURN:
+
+  H5Dclose(dset_id);
+  H5Tclose(type_id);
+}
+#endif
+
+#if  defined  (HAVE_LIBHDF5)
+static herr_t
+obj_info(hid_t loc_id, const char *name, void *opdata)
+{
+  H5G_obj_t obj_type;
+  H5G_stat_t statbuf;
+
+  /* avoid compiler warnings */
+  loc_id = loc_id;
+  opdata = opdata;
+
+  H5Gget_objinfo(loc_id, name, FALSE, &statbuf);
+
+  obj_type = statbuf.type;
+
+  switch (obj_type) {
+  case H5G_GROUP:
+    if ( cdoVerbose ) cdoPrint(" Object with name %s is a group", name);
+    if ( strcmp(name, "Data") == 0 )
+      {
+	((dsets_t *) opdata)->mergelevel = TRUE;	
+	H5Giterate(loc_id, name, NULL, obj_info, opdata);
+      }
+    else if ( strcmp(name, "Geolocation") == 0 )
+      {
+	((dsets_t *) opdata)->lgeoloc = TRUE;
+      }
+    else if ( strcmp(name, "Metadata") == 0 )
+      {
+	((dsets_t *) opdata)->lmetadata = TRUE;
+      }
+    break;
+  case H5G_DATASET: 
+    if ( cdoVerbose ) cdoPrint(" Object with name %s is a dataset", name);
+    if ( strstr(name, "PALETTE") )
+      {
+	if ( cdoVerbose ) cdoPrint("   Skip dataset: %s", name);
+      }
+    /*else if ( strstr(name, "egion") ) */
+    else if ( strcmp(name, "region") == 0 )
+      {
+	((dsets_t *) opdata)->lregion = TRUE;
+      }
+    else
+      {
+	if ( cdoVerbose ) cdoPrint("   Read dataset: %s", name);
+	read_dataset(loc_id, name, opdata);
+      }
+    break;
+  case H5G_TYPE: 
+    if ( cdoVerbose ) cdoPrint(" Object with name %s is a named datatype", name);
+    if ( strcmp(name, "ProjType") == 0 )
+      {
+	((dsets_t *) opdata)->lprojtype = TRUE;
+      }
+    break;
+  default:
+    cdoAbort(" Unable to identify an object %s", name);
+  }
+
+  return 0;
+}
+#endif
+
+
+#if  defined  (HAVE_LIBHDF5)
+static
+void get_global_att(hid_t file_id, const char *obj_path, int vlistID)
+{
+  hid_t   attr, atype, atype_mem, obj_id, grp_id = -1;
+  char attname[CDI_MAX_NAME];
+  H5T_class_t  type_class;
+  int attint;
+  double attflt;
+  int i, pos;
+  int num_attrs;
+  char attstring[4096];     /* Buffer to read string attribute back */
+
+  attstring[0] = 0;
+
+  obj_id = H5Gopen(file_id, obj_path);
+
+  num_attrs = H5Aget_num_attrs(obj_id);
+
+  for( i = 0; i < num_attrs; i++ )
+    {
+      attr = H5Aopen_idx(obj_id, i);
+      atype = H5Aget_type(attr);
+      H5Aget_name(attr, sizeof(attname), attname);
+
+      /* remove illegal characters */
+      for ( pos = 0; pos < (int)strlen(attname); ++pos )
+	if ( attname[pos] == '&' ) attname[pos] = '_';
+
+      atype_mem = H5Tget_native_type(atype, H5T_DIR_ASCEND);
+      type_class = H5Tget_class(atype);
+      if ( type_class == H5T_STRING )
+	{
+	  H5Aread(attr, atype_mem, attstring);
+	  vlistDefAttTxt(vlistID, CDI_GLOBAL, attname, (int)strlen(attstring), attstring);
+	} 
+      else if ( type_class == H5T_INTEGER )
+	{
+	  H5Aread(attr, H5T_NATIVE_INT, &attint);
+	  vlistDefAttInt(vlistID, CDI_GLOBAL, attname, DATATYPE_INT32, 1, &attint);
+	} 
+      else if ( type_class == H5T_FLOAT )
+	{
+	  H5Aread(attr, H5T_NATIVE_DOUBLE, &attflt);
+	  vlistDefAttFlt(vlistID, CDI_GLOBAL, attname, DATATYPE_FLT64, 1, &attflt);
+	} 
+      H5Tclose(atype_mem);
+      H5Aclose(attr);
+      H5Tclose(atype);
+    }
+
+  if ( grp_id >= 0 ) H5Gclose(grp_id);	
+
+}
+#endif
+
+static
+int get_vdate(int vlistID)
+{
+  int vdate = 0;
+  int natts;
+  int i, len, type;
+  char name[CDI_MAX_NAME];
+  char attstr[CDI_MAX_NAME];
+
+  vlistInqNatts(vlistID, CDI_GLOBAL, &natts);
+
+  for ( i = 0; i < natts; ++i )
+    {
+      vlistInqAtt(vlistID, CDI_GLOBAL, i, name, &type, &len);
+      if ( type == DATATYPE_TXT )
+	{
+	  if ( strcmp(name, "DateAndTime") == 0 ||
+	       strcmp(name, "Date_Time") == 0 )
+	    {
+	      vlistInqAttTxt(vlistID, CDI_GLOBAL, name, CDI_MAX_NAME, attstr);
+	      if ( len > 8 ) len = 8;
+	      attstr[len] = 0;
+	      vdate = atoi(attstr);
+	      if ( vdate < 999999 ) vdate = vdate*100 + 1;
+	    }
+	}
+    }
+
+  return (vdate);
+}
+
+static
+void dsets_init(dsets_t *dsets)
+{
+  int i;
+
+  dsets->nsets      = 0;
+  dsets->mergelevel = 0;
+  dsets->lgeoloc    = 0;
+  dsets->lregion    = 0;
+  dsets->lprojtype  = 0;
+  dsets->lmetadata  = 0;
+
+  for ( i = 0; i < MAX_DSETS; ++i )
+    {
+      dsets->obj[i].nx          = 0;
+      dsets->obj[i].ny          = 0;
+      dsets->obj[i].nz          = 0;
+      dsets->obj[i].name        = NULL;
+      dsets->obj[i].description = NULL;
+      dsets->obj[i].units       = NULL;
+      dsets->obj[i].title       = NULL;
+      dsets->obj[i].time        = NULL;
+      dsets->obj[i].dtype       = cdoDefaultDataType;
+      dsets->obj[i].lscale      = 0;
+      dsets->obj[i].loffset     = 0;
+      dsets->obj[i].lmissval    = 0;
+      dsets->obj[i].missval     = cdiInqMissval();
+      dsets->obj[i].array       = NULL;   
+    }
+}
+
+
+void *Importcmsaf(void *argument)
+{
+#if  defined  (HAVE_LIBHDF5)
+  int streamID;
+  int gridID = -1, zaxisID, taxisID, vlistID;
+  int i, offset;
+  int nmiss;
+  int ivar;
+  int varID, levelID, tsID;
+  int nx, ny, nz, nt, gridsize;
+  double *array;
+  double missval, minval, maxval;
+  hid_t	  file_id;	/* HDF5 File ID	        	*/
+  herr_t  status;	/* Generic return value		*/
+  dsets_t dsets;
+  int vdate, vtime;
+  int *vtimes = NULL;
+#endif
+
+  cdoInitialize(argument);
+
+  if ( cdoDefaultFileType == CDI_UNDEFID )
+    cdoDefaultFileType = FILETYPE_NC;
+
+#if  defined  (HAVE_LIBHDF5)
+  dsets_init(&dsets);
+
+  /* Open an existing file. */
+  file_id = H5Fopen(cdoStreamName(0), H5F_ACC_RDONLY, H5P_DEFAULT);
+  if ( file_id < 0 ) cdoAbort("H5Fopen failed on %s", cdoStreamName(0));
+
+  /* cmsaf_type = get_cmsaf_type(file_id); */
+
+  H5Giterate(file_id, "/", NULL, obj_info, (void *) &dsets);
+
+  if ( dsets.nsets == 0 ) cdoAbort("No dataset found!");
+
+  gridsize = dsets.obj[0].gridsize;
+  nx = dsets.obj[0].nx;
+  ny = dsets.obj[0].ny;
+  nz = dsets.obj[0].nz;
+  nt = dsets.obj[0].nt;
+
+  for ( ivar = 0; ivar < dsets.nsets; ++ivar )
+    if ( dsets.obj[ivar].nt > 1 )
+      {
+	nt = dsets.obj[ivar].nt;
+	break;
+      }
+
+  if ( nt > 1 )
+    {
+      vtimes = (int *) malloc(nt*sizeof(int));
+      
+      for ( i = 0; i < nt; ++i ) vtimes[i] = i*10000 + 45*100;
+
+      if ( dsets.obj[ivar].time )
+	{
+	  long itime;
+	  char *pline = dsets.obj[ivar].time;
+
+	  for ( i = 0; i < nt; ++i )
+	    {
+	      itime = ((int)strtol(pline, &pline, 10))*100;
+	      if ( itime < 0 || itime > 240000 )
+		{
+		  cdoWarning("Wrong time string!");
+		  break;
+		}
+	      vtimes[i] = (int) itime;
+	    }
+	}
+    }
+
+  if ( cdoVerbose )
+    for ( ivar = 0; ivar < dsets.nsets; ++ivar )
+      cdoPrint(" Var %d %-20s %dx%d nlev = %d nts = %d", 
+	       ivar, dsets.obj[ivar].name, nx, ny, nz, dsets.obj[ivar].nt);
+
+  for ( ivar = 1; ivar < dsets.nsets; ++ivar )
+    {
+      if ( nx != dsets.obj[0].nx || ny != dsets.obj[0].ny )
+	cdoAbort("Gridsize must not change!");
+      if ( nz != dsets.obj[0].nz )
+	cdoAbort("Number of levels must not change!");
+    }
+
+  if ( dsets.lgeoloc )
+    {
+      gridID = read_geolocation(file_id, nx, ny, dsets.lprojtype);
+    }
+  else if ( dsets.lregion )
+    {
+      gridID = read_region(file_id, nx, ny);
+    }
+  
+  if ( gridID == -1 )
+    {
+      gridID = gridCreate(GRID_GENERIC, gridsize);
+      gridDefXsize(gridID, nx);
+      gridDefYsize(gridID, ny);
+    }
+
+  if ( nz == 1 )
+    zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
+  else
+    {
+      double *levels;
+      levels = (double *) malloc(nz*sizeof(double));
+      for ( i = 0; i < nz; ++i ) levels[i] = i+1;
+      zaxisID = zaxisCreate(ZAXIS_GENERIC, nz);
+      zaxisDefLevels(zaxisID, levels);
+      free(levels);
+    }
+
+  vlistID = vlistCreate();
+
+  if ( nt > 1 )
+    taxisID = taxisCreate(TAXIS_RELATIVE);
+  else
+    taxisID = taxisCreate(TAXIS_ABSOLUTE);
+
+  taxisDefCalendar(taxisID, CALENDAR_STANDARD);
+
+  vlistDefTaxis(vlistID, taxisID);
+
+  for ( ivar = 0; ivar < dsets.nsets; ++ivar )
+    {
+      if ( dsets.obj[ivar].nt > 1 )
+	varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+      else
+	varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+
+      vlistDefVarName(vlistID, varID,  dsets.obj[ivar].name);
+      if ( dsets.obj[ivar].description )
+	vlistDefVarLongname(vlistID, varID,  dsets.obj[ivar].description);
+      if ( dsets.obj[ivar].units )
+	vlistDefVarUnits(vlistID, varID,  dsets.obj[ivar].units);
+      if ( dsets.obj[ivar].title )
+	vlistDefAttTxt(vlistID, varID, "title", (int)strlen(dsets.obj[ivar].title), 
+		       dsets.obj[ivar].title);
+	
+      /*
+      vlistDefVarUnits(vlistID, varID, units[i]);
+      */
+      vlistDefVarDatatype(vlistID, varID, dsets.obj[ivar].dtype);
+      if ( dsets.obj[ivar].lmissval )
+	vlistDefVarMissval(vlistID, varID, dsets.obj[ivar].missval);
+      if ( dsets.obj[ivar].lscale )
+	vlistDefVarScalefactor(vlistID, varID, dsets.obj[ivar].scale);
+      if ( dsets.obj[ivar].loffset )
+	vlistDefVarAddoffset(vlistID, varID, dsets.obj[ivar].offset);
+    }
+
+  get_global_att(file_id, "/", vlistID);
+  if ( dsets.lmetadata ) get_global_att(file_id, "Metadata", vlistID);
+
+  vdate = get_vdate(vlistID);
+  if ( vdate == 0 ) vdate = 10101;
+
+  streamID = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID, vlistID);
+
+  for ( tsID = 0; tsID < nt; ++tsID )
+    {
+      taxisDefVdate(taxisID, vdate);
+      vtime = 0;
+      if ( vtimes ) vtime = vtimes[tsID];
+      taxisDefVtime(taxisID, vtime);
+      streamDefTimestep(streamID, tsID);
+
+      for ( ivar = 0; ivar < dsets.nsets; ++ivar )
+	{
+	  varID   = ivar;
+
+	  if ( tsID > 0 && dsets.obj[ivar].nt == 1 ) continue;
+	  
+	  gridsize = dsets.obj[ivar].gridsize;
+	  missval  = dsets.obj[ivar].missval;
+
+	  for ( levelID = 0; levelID < nz; ++levelID )
+	    {
+	      offset = gridsize*levelID;
+	      if ( nz == 1 ) offset = gridsize*tsID;
+	      array  = dsets.obj[ivar].array+offset;
+	      
+	      nmiss  = 0;
+	      minval =  1e35;
+	      maxval = -1e35;
+
+	      for ( i = 0; i < gridsize; i++ )
+		{
+		  if ( !DBL_IS_EQUAL(array[i], missval) )
+		    {
+		      if ( array[i] < minval ) minval = array[i];
+		      if ( array[i] > maxval ) maxval = array[i];
+		    }
+		}
+
+	      for ( i = 0; i < gridsize; i++ )
+		if ( DBL_IS_EQUAL(array[i], missval) ) nmiss++;
+
+	      if ( cdoVerbose )
+		cdoPrint(" Write var %d,  level %d, nmiss %d, missval %g, minval %g, maxval %g",
+			 varID, levelID, nmiss, missval, minval, maxval);
+	      /*
+		if ( ! (missval < minval || missval > maxval) )
+		cdoWarning(" Missval is inside of valid values! Name: %s  Range: %g - %g  Missval: %g\n",
+		dsets.obj[ivar].name, minval, maxval, missval);
+	      */
+	      streamDefRecord(streamID,  varID,  levelID);
+	      streamWriteRecord(streamID, array, nmiss);
+	    }
+	}
+    }
+
+  /* Close file */
+  status = H5Fclose(file_id);
+
+  processDefVarNum(vlistNvars(vlistID), streamID);
+
+  streamClose(streamID);
+
+  vlistDestroy(vlistID);
+  gridDestroy(gridID);
+  zaxisDestroy(zaxisID);
+  taxisDestroy(taxisID);
+
+  for ( ivar = 0; ivar < dsets.nsets; ++ivar )
+    free(dsets.obj[ivar].array);
+
+  if ( vtimes ) free(vtimes);
+
+  cdoFinish();
+#else
+  cdoAbort("HDF5 support not compiled in!");
+#endif
+
+  return (0);
+}
diff --git a/src/Importobs.c b/src/Importobs.c
new file mode 100644
index 0000000..232fdb4
--- /dev/null
+++ b/src/Importobs.c
@@ -0,0 +1,277 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+#define  MAX_VARS   6
+
+
+static
+void init_vars(int vlistID, int gridID, int zaxisID, int nvars)
+{
+  int  code[]  = {11, 17, 33, 34, 1, 2/*, 3*/};
+  char *name[]  = {"temp", "depoint", "u", "v", "height", "pressure" /*, "station"*/};
+  char *units[] = {"Celsius", "", "m/s", "m/s", "m", "hPa" /*, ""*/};
+  int i, varID;
+
+  for ( i = 0; i < nvars; ++i )
+    {
+      varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+      vlistDefVarCode(vlistID, varID, code[i]);
+      vlistDefVarName(vlistID, varID, name[i]);
+      vlistDefVarUnits(vlistID, varID, units[i]);
+      vlistDefVarDatatype(vlistID, varID, DATATYPE_FLT32);
+    }
+}
+
+static
+void init_data(int vlistID, int nvars, double *data[])
+{
+  int varID, i, gridsize;
+  double missval;
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID, varID));
+      missval  = vlistInqVarMissval(vlistID, varID);
+      
+      for ( i = 0; i < gridsize; ++i )
+	{
+	  data[varID][i] = missval;
+	}
+    } 
+}
+
+static
+void write_data(int streamID, int vlistID, int nvars, double *data[])
+{
+  int i;
+  int varID;
+  int nmiss;
+  int gridsize;
+  double missval;
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID, varID));
+      missval  = vlistInqVarMissval(vlistID, varID);
+      
+      streamDefRecord(streamID, varID, 0);
+
+      nmiss = 0;
+      for ( i = 0; i < gridsize; ++i )
+	if ( DBL_IS_EQUAL(data[varID][i], missval) ) nmiss++;
+      
+      streamWriteRecord(streamID, data[varID], nmiss);
+    }
+}
+
+static
+int getDate(const char *name)
+{
+  int date = 0;
+  size_t len;
+  char *pname;
+
+  len = strlen(name);
+
+  pname = strchr(name, '_');
+
+  if ( pname ) date = atoi(pname+1);
+
+  return(date);
+}
+
+#define  MAX_LINE_LEN  4096
+
+void *Importobs(void *argument)
+{
+  int operatorID;
+  char line[MAX_LINE_LEN];
+  int streamID;
+  int tsID;
+  int gridID, zaxisID, taxisID, vlistID;
+  int i, j;
+  int nvars = MAX_VARS;
+  int vdate = 0, vtime = 0;
+  int vdate0 = 0, vtime0 = 0;
+  int gridsize, xsize, ysize;
+  double *xvals = NULL, *yvals = NULL;
+  double *data[MAX_VARS];
+  FILE *fp;
+  char dummy[32], station[32], datetime[32];
+  float lat, lon, height1, pressure, height2, value;
+  double latmin = 90, latmax = -90, lonmin = 360, lonmax = -360;
+  int code;
+  int index;
+  double dx, dy;
+  char *pstation;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("import_obs",     0, 0, "grid description file or name");
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg(cdoOperatorEnter(operatorID));  
+
+  gridID = cdoDefineGrid(operatorArgv()[0]);
+
+  if ( gridInqType(gridID) != GRID_LONLAT ) 
+    cdoAbort("Unsupported grid type: %s", gridNamePtr(gridInqType(gridID)));
+
+  gridsize = gridInqSize(gridID);
+  xsize = gridInqXsize(gridID);
+  ysize = gridInqYsize(gridID);
+
+  // printf("gridsize=%d, xsize=%d, ysize=%d\n", gridsize, xsize, ysize);
+
+  xvals = (double *) malloc(gridsize*sizeof(double));
+  yvals = (double *) malloc(gridsize*sizeof(double));
+
+  gridInqXvals(gridID, xvals);
+  gridInqYvals(gridID, yvals);
+
+  /* Convert lat/lon units if required */
+  {
+    char units[CDI_MAX_NAME];
+    gridInqXunits(gridID, units);
+    gridToDegree(units, "grid center lon", gridsize, xvals);
+    gridInqYunits(gridID, units);
+    gridToDegree(units, "grid center lat", gridsize, yvals);
+  }
+
+  fp = fopen(cdoStreamName(0), "r");
+  if ( fp == NULL ) { perror(cdoStreamName(0)); exit(EXIT_FAILURE); }
+
+  vdate = getDate(cdoStreamName(0));
+  if ( vdate <= 999999 ) vdate = vdate*100 + 1;
+
+  streamID = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
+
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+
+  vlistID = vlistCreate();
+  vlistDefTaxis(vlistID, taxisID);
+
+    {
+      for ( i = 0; i < nvars; ++i ) data[i] = (double *) malloc(gridsize*sizeof(double));
+
+      init_vars(vlistID, gridID, zaxisID, nvars);
+
+      streamDefVlist(streamID, vlistID);
+
+      vdate0 = 0;
+      vtime0 = 0;
+      //ntime = 0;
+      tsID = 0;
+      while ( readline(fp, line, MAX_LINE_LEN) )
+	{
+	  sscanf(line, "%s %s %s %g %g %g %d %g %g %g", 
+		 dummy, station, datetime, &lat, &lon, &height1, &code, &pressure, &height2, &value);
+	  sscanf(datetime, "%d_%d", &vdate, &vtime);
+
+	  if ( vdate != vdate0 || vtime != vtime0 )
+	    {
+	      if ( tsID > 0 ) write_data(streamID, vlistID, nvars, data);
+
+	      vdate0 = vdate;
+	      vtime0 = vtime;
+	      /*
+	      printf("%s %d %d %g %g %g %d %g %g %g\n", 
+		     station, vdate, vtime, lat, lon, height1, code, pressure, height2, value);	    
+	      */
+	      taxisDefVdate(taxisID, vdate);
+	      taxisDefVtime(taxisID, vtime);
+	      streamDefTimestep(streamID, tsID);
+      
+	      init_data(vlistID, nvars, data);
+
+	      tsID++;
+	    }
+
+	  if ( lon < lonmin ) lonmin = lon;
+	  if ( lon > lonmax ) lonmax = lon;
+	  if ( lat < latmin ) latmin = lat;
+	  if ( lat > latmax ) latmax = lat;
+
+	  dy =  yvals[1] - yvals[0];
+	  for ( j = 0; j < ysize; ++j )
+	    if ( lat >= (yvals[j]-dy/2) && lat < (yvals[j]+dy/2) )  break;
+
+	  dx =  xvals[1] - xvals[0];
+	  if ( lon < (xvals[0] - dx/2) && lon < 0 ) lon+=360;
+	  for ( i = 0; i < xsize; ++i )
+	    if ( lon >= (xvals[i]-dx/2) && lon < (xvals[i]+dx/2) )  break;
+	  
+	  index = -1;
+	  if ( code == 11 ) index = 0;
+	  if ( code == 17 ) index = 1;
+	  if ( code == 33 ) index = 2;
+	  if ( code == 34 ) index = 3;
+
+	  //printf("%d %d %d %g %g %g %g\n", i, j, index, dx, dy, lon, lat);
+	  if ( i < xsize && j < ysize && index >= 0 )
+	    {
+	      pstation = station;
+	      while (isalpha(*pstation)) *pstation++;
+	      // printf("station %s %d\n", pstation, atoi(pstation));
+	      data[index][j*xsize+i] = value;
+	      data[    4][j*xsize+i] = height1;
+	      data[    5][j*xsize+i] = pressure;
+	      // data[    6][j*xsize+i] = atoi(pstation);
+	    }
+
+	  /*
+	  printf("%s %d %d %g %g %g %d %g %g %g\n", 
+		 station, vdate, vtime, lat, lon, height1, code, pressure, height2, value);
+	  */
+	}
+
+      write_data(streamID, vlistID, nvars, data);
+
+      for ( i = 0; i < nvars; ++i ) free(data[i]);
+    }
+  printf("lonmin=%g, lonmax=%g, latmin=%g, latmax=%g\n", lonmin, lonmax, latmin, latmax);
+
+  processDefVarNum(vlistNvars(vlistID), streamID);
+
+  streamClose(streamID);
+
+  fclose(fp);
+
+  vlistDestroy(vlistID);
+  gridDestroy(gridID);
+  zaxisDestroy(zaxisID);
+  taxisDestroy(taxisID);
+
+  free(xvals);
+  free(yvals);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Info.c b/src/Info.c
new file mode 100644
index 0000000..403b6d9
--- /dev/null
+++ b/src/Info.c
@@ -0,0 +1,449 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Info       info            Dataset information
+      Info       map             Dataset information and simple map
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void printMap(int nlon, int nlat, double *array, double missval, double min, double max)
+{
+  /* source code from PINGO */
+  int ilon, ilat, i;
+  double x, a, b;
+  double step;
+  double level[9];
+  int min_n, max_n;
+  char c;
+
+  step = (max - min) / 10;
+
+  if ( IS_NOT_EQUAL(step, 0) )
+    {
+      a = pow(10, floor(log(step) / M_LN10));
+      b = step / a;
+
+      if ( b > 5 )
+	b = 0.5 * ceil (b / 0.5);
+      else if ( b > 2 )
+	b = 0.2 * ceil (b / 0.2);
+      else if ( b > 1 )
+	b = 0.1 * ceil (b / 0.1);
+      else
+	b = 1;
+
+      step = b * a;
+
+      if ( min < 0 && max > 0 )
+	{
+	  min_n = (int) floor (10 * (-min) / (max - min) - 0.5);
+	  max_n = (int) ceil (10 * (-min) / (max - min) - 0.5);
+	  level[min_n] = 0;
+	  for (i = min_n - 1; i >= 0; i--)
+	    level[i] = level[i + 1] - step;
+	  for (i = max_n; i < 9; i++)
+	    level[i] = level[i - 1] + step;
+	}
+      else
+	{
+	  level[0] = step * ceil (min / step + 0.5);
+	  for ( i = 1; i < 9; i++ )
+	    level[i] = level[i - 1] + step;
+	}
+    }
+  else
+    for ( i = 0; i < 9; i++ )
+      level[i] = min;
+
+  fputc ('\n', stdout);
+  fflush (stdout);
+
+  if ( nlon >= 1000 )
+    {
+      printf ("%.*s", nlat < 10 ? 2 : nlat < 100 ? 3 : nlat < 1000 ? 4 : 5, "     ");
+      for ( ilon = 0; ilon < nlon; ilon++ )
+	printf ("%d", ((ilon + 1) / 1000) % 10);
+      putchar ('\n');
+      fflush (stdout);
+    }
+
+  if ( nlon >= 100 )
+    {
+      printf ("%.*s", nlat < 10 ? 2 : nlat < 100 ? 3 : nlat < 1000 ? 4 : 5, "     ");
+      for (ilon = 0; ilon < nlon; ilon++)
+	printf ("%d", ((ilon + 1) / 100) % 10);
+      putchar ('\n');
+      fflush (stdout);
+    }
+
+  if ( nlon >= 10 )
+    {
+      printf ("%.*s", nlat < 10 ? 2 : nlat < 100 ? 3 : nlat < 1000 ? 4 : 5, "     ");
+      for (ilon = 0; ilon < nlon; ilon++)
+	printf ("%d", ((ilon + 1) / 10) % 10);
+      putchar ('\n');
+      fflush (stdout);
+    }
+
+  printf ("%.*s", nlat < 10 ? 2 : nlat < 100 ? 3 : nlat < 1000 ? 4 : 5, "     ");
+
+  for ( ilon = 0; ilon < nlon; ilon++ )
+    printf ("%d", (ilon + 1) % 10);
+  putchar ('\n');
+  fflush (stdout);
+  putchar ('\n');
+  fflush (stdout);
+
+  for ( ilat = 0; ilat < nlat; ilat++ )
+    {
+      printf ("%0*d ", nlat < 10 ? 1 : nlat < 100 ? 2 : nlat < 1000 ? 3 : 4, ilat + 1);
+      for ( ilon = 0; ilon < nlon; ilon++ )
+	{
+	  x = array[ilat * nlon + ilon];
+	  if ( DBL_IS_EQUAL(x, missval) )
+	    c = '.';
+	  else if ( DBL_IS_EQUAL(x, min) && !DBL_IS_EQUAL(min, max) )
+	    c = 'm';
+	  else if ( DBL_IS_EQUAL(x, max) && !DBL_IS_EQUAL(min, max) )
+	    c = 'M';
+	  else if ( DBL_IS_EQUAL(x, 0.) )
+	    c = '*';
+	  else if ( x < 0 )
+	    {
+	      c = '9';
+	      for ( i = 0; i < 9; i++ )
+		if ( level[i] > x )
+		  {
+		    c = i + '0';
+		    break;
+		  }
+	    }
+	  else
+	    {
+	      c = '0';
+	      for ( i = 8; i >= 0; i-- )
+		if ( level[i] < x )
+		  {
+		    c = i + 1 + '0';
+		    break;
+		  }
+	    }
+	  putchar (c);
+	}
+      printf (" %0*d\n", nlat < 10 ? 1 : nlat < 100 ? 2 : nlat < 1000 ? 3 : 4, ilat + 1);
+      fflush (stdout);
+    }
+  putchar ('\n');
+  fflush (stdout);
+
+  if ( nlon >= 1000 )
+    {
+      printf ("%.*s", nlat < 10 ? 2 : nlat < 100 ? 3 : nlat < 1000 ? 4 : 5, "     ");
+      for ( ilon = 0; ilon < nlon; ilon++ )
+	printf ("%d", ((ilon + 1) / 1000) % 10);
+      putchar ('\n');
+      fflush (stdout);
+    }
+
+  if ( nlon >= 100 )
+    {
+      printf ("%.*s", nlat < 10 ? 2 : nlat < 100 ? 3 : nlat < 1000 ? 4 : 5, "     ");
+      for ( ilon = 0; ilon < nlon; ilon++ )
+	printf ("%d", ((ilon + 1) / 100) % 10);
+      putchar ('\n');
+      fflush (stdout);
+    }
+
+  if ( nlon >= 10 )
+    {
+      printf ("%.*s", nlat < 10 ? 2 : nlat < 100 ? 3 : nlat < 1000 ? 4 : 5, "     ");
+      for ( ilon = 0; ilon < nlon; ilon++ )
+	printf ("%d", ((ilon + 1) / 10) % 10);
+      putchar ('\n');
+      fflush (stdout);
+    }
+
+  printf ("%.*s", nlat < 10 ? 2 : nlat < 100 ? 3 : nlat < 1000 ? 4 : 5, "     ");
+  for ( ilon = 0; ilon < nlon; ilon++ )
+    printf ("%d", (ilon + 1) % 10);
+  putchar ('\n');
+  fflush (stdout);
+  putchar ('\n');
+  fflush (stdout);
+
+  for ( i = 0; i < 10; i++ )
+    {
+      printf ("%d=%c%+9.3e,%+9.3e%c%s", (int) i,
+	      i == 0 || level[i - 1] >= 0 ? '[' : '[',
+	      i == 0 ? min : level[i - 1],
+	      i == 9 ? max : level[i],
+	      i == 9 || level[i] <= 0 ? ']' : ']',
+	      i != 2 && i != 5 && i != 8 ? "  " : "");
+
+      if ( i == 2 || i == 5 || i == 8 )
+	{
+	  fputc ('\n', stdout);
+	  fflush (stdout);
+	}
+    }
+
+  printf ("*=0  .=miss  m=min=%+9.3e  M=max=%+9.3e\n", min, max);
+  fflush (stdout);
+  putchar ('\n');
+  fflush (stdout);
+}
+
+
+void *Info(void *argument)
+{
+  int INFO, INFOP, INFON, INFOC, MAP;
+  int operatorID;
+  int i;
+  int indf, indg;
+  int varID, recID;
+  int gridsize = 0;
+  int gridID, zaxisID;
+  int code, param;
+  int vdate, vtime;
+  int nrecs;
+  int levelID;
+  int tsID, taxisID;
+  int streamID = 0;
+  int vlistID;
+  int nmiss;
+  int number;
+  int ivals = 0, nvals = 0;
+  int imiss = 0;
+  char varname[CDI_MAX_NAME];
+  char paramstr[32];
+  char vdatestr[32], vtimestr[32];
+  double missval;
+  double *array = NULL;
+  double level;
+  double arrmin = 0, arrmax = 0, arrmean = 0, arrvar = 0;
+
+  cdoInitialize(argument);
+
+  INFO  = cdoOperatorAdd("info",  0, 0, NULL);
+  INFOP = cdoOperatorAdd("infop", 0, 0, NULL);
+  INFON = cdoOperatorAdd("infon", 0, 0, NULL);
+  INFOC = cdoOperatorAdd("infoc", 0, 0, NULL);
+  MAP   = cdoOperatorAdd("map",   0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  for ( indf = 0; indf < cdoStreamCnt(); indf++ )
+    {
+      streamID = streamOpenRead(cdoStreamName(indf));
+
+      vlistID = streamInqVlist(streamID);
+
+      if ( vlistNvars(vlistID) == 0 ) continue;
+
+      gridsize = vlistGridsizeMax(vlistID);
+
+      if ( vlistNumber(vlistID) != CDI_REAL ) gridsize *= 2;
+      array = (double *) malloc(gridsize*sizeof(double));
+
+      indg = 0;
+      tsID = 0;
+      taxisID = vlistInqTaxis(vlistID);
+      while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	{
+	  vdate = taxisInqVdate(taxisID);
+	  vtime = taxisInqVtime(taxisID);
+
+	  date2str(vdate, vdatestr, sizeof(vdatestr));
+	  time2str(vtime, vtimestr, sizeof(vtimestr));
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      if ( (tsID == 0 && recID == 0) || operatorID == MAP )
+		{
+		  if ( operatorID == INFON )
+		    fprintf(stdout, "%6d :       Date     Time   Level Gridsize    Miss :"
+			    "     Minimum        Mean     Maximum : Parameter name\n",  -(indf+1));
+		  else if ( operatorID == INFOC )
+		    fprintf(stdout, "%6d :       Date     Time   Level Gridsize    Miss :"
+			    "     Minimum        Mean     Maximum : Code number\n",  -(indf+1));
+		  else
+		    fprintf(stdout, "%6d :       Date     Time   Level Gridsize    Miss :"
+			    "     Minimum        Mean     Maximum : Parameter ID\n",  -(indf+1));
+		}
+
+	      streamInqRecord(streamID, &varID, &levelID);
+	      streamReadRecord(streamID, array, &nmiss);
+
+	      indg += 1;
+	      param    = vlistInqVarParam(vlistID, varID);
+	      code     = vlistInqVarCode(vlistID, varID);
+	      gridID   = vlistInqVarGrid(vlistID, varID);
+	      zaxisID  = vlistInqVarZaxis(vlistID, varID);
+	      missval  = vlistInqVarMissval(vlistID, varID);
+	      gridsize = gridInqSize(gridID);
+	      number   = vlistInqVarNumber(vlistID, varID);
+
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+
+	      if ( operatorID == INFON ) vlistInqVarName(vlistID, varID, varname);
+
+	      fprintf(stdout, "%6d :%s %s ", indg, vdatestr, vtimestr);
+
+	      level = zaxisInqLevel(zaxisID, levelID);
+	      fprintf(stdout, "%7g ", level);
+
+	      fprintf(stdout, "%8d %7d :", gridsize, nmiss);
+
+	      if ( /* gridInqType(gridID) == GRID_SPECTRAL || */
+		   (gridsize == 1 && nmiss == 0 && number == CDI_REAL) )
+		{
+		  fprintf(stdout, "            %#12.5g            ", array[0]);
+		}
+	      else
+		{
+		  if ( number == CDI_REAL )
+		    {
+		      if ( nmiss > 0 )
+			{
+			  ivals   = 0;
+			  arrmean = 0;
+			  arrvar  = 0;
+			  arrmin  =  1.e300;
+			  arrmax  = -1.e300;
+			  for ( i = 0; i < gridsize; ++i )
+			    {
+			      if ( !DBL_IS_EQUAL(array[i], missval) )
+				{
+				  if ( array[i] < arrmin ) arrmin = array[i];
+				  if ( array[i] > arrmax ) arrmax = array[i];
+				  arrmean += array[i];
+				  arrvar  += array[i]*array[i];
+				  ivals++;
+				}
+			    }
+			  imiss = gridsize - ivals;
+			  nvals = ivals;
+			}
+		      else
+			{
+			  arrmean = array[0];
+			  arrvar  = array[0];
+			  arrmin  = array[0];
+			  arrmax  = array[0];
+			  /*
+#pragma omp parallel for default(none) shared(arrmin, arrmax, array, gridsize)	\
+                                       reduction(+:arrmean, arrvar)
+			  */
+			  for ( i = 1; i < gridsize; i++ )
+			    {
+			      /* #pragma omp critical */
+			      if ( array[i] < arrmin ) arrmin = array[i];
+			      /* #pragma omp critical */
+			      if ( array[i] > arrmax ) arrmax = array[i];
+			      arrmean += array[i];
+			      arrvar  += array[i]*array[i];
+			    }
+			  nvals = gridsize;
+			}
+
+		      if ( nvals )
+			{
+			  arrmean = arrmean/nvals;
+			  arrvar  = arrvar/nvals - arrmean*arrmean;
+			  fprintf(stdout, "%#12.5g%#12.5g%#12.5g", arrmin, arrmean, arrmax);
+			}
+		      else
+			{
+			  fprintf(stdout, "                     nan            ");
+			}
+		    }
+		  else
+		    {
+		      int nvals_r = 0, nvals_i = 0;
+		      double arrsum_r, arrsum_i, arrmean_r = 0, arrmean_i = 0;
+		      arrsum_r = 0;
+		      arrsum_i = 0;
+		      
+		      for ( i = 0; i < gridsize; i++ )
+			{
+			  if ( !DBL_IS_EQUAL(array[i*2],   missval) && 
+			       !DBL_IS_EQUAL(array[i*2+1], missval) )
+			    {
+			      arrsum_r += array[i*2];
+			      arrsum_i += array[i*2+1];
+			      nvals_r++;
+			      nvals_i++;
+			    }
+			}
+
+		      imiss = gridsize - nvals_r;
+
+		      if ( nvals_r > 0 ) arrmean_r = arrsum_r / nvals_r;
+		      if ( nvals_i > 0 ) arrmean_i = arrsum_i / nvals_i;
+		      fprintf(stdout, "  -  (%#12.5g,%#12.5g)  -", arrmean_r, arrmean_i);
+		    }
+		}
+
+	      if ( operatorID == INFON )
+		fprintf(stdout, " : %-11s", varname);
+	      else if ( operatorID == INFOC )
+		fprintf(stdout, " : %4d", code);
+	      else
+		fprintf(stdout, " : %-11s", paramstr);
+
+	      fprintf(stdout, "\n");
+
+	      if ( imiss != nmiss && nmiss > 0 )
+		fprintf(stdout, "Found %d of %d missing values!\n", imiss, nmiss);
+
+	      if ( operatorID == MAP )
+		{
+		  int nlon, nlat;
+		  
+		  nlon = gridInqXsize(gridID);
+		  nlat = gridInqYsize(gridID);
+
+		  if ( gridInqType(gridID) == GRID_GAUSSIAN    ||
+		       gridInqType(gridID) == GRID_LONLAT      ||
+		       gridInqType(gridID) == GRID_CURVILINEAR ||
+		       (gridInqType(gridID) == GRID_GENERIC && 
+			nlon*nlat == gridInqSize(gridID) && nlon < 1024) )
+		    {
+		      printMap(nlon, nlat, array, missval, arrmin, arrmax);
+		    }
+		}
+	    }
+	  tsID++;
+	}
+      streamClose(streamID);
+
+      if ( array ) free(array);
+    }
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Input.c b/src/Input.c
new file mode 100644
index 0000000..5fc4639
--- /dev/null
+++ b/src/Input.c
@@ -0,0 +1,283 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Input     input          ASCII input
+      Input     inputsrv       SERVICE input
+      Input     inputext       EXTRA input
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+static
+int input_iarray(int nval, int *array)
+{
+  int i, n;
+  int ival = 0;
+
+  for ( i = 0; i < nval; i++ )
+    {
+      n = scanf("%d", &array[i]);
+      if ( n != 1 ) break;
+
+      ival++;
+    }
+
+  return (ival);
+}
+
+int input_darray(FILE *gfp, int nval, double *array);
+/*
+static int input_darray(int nval, double *array)
+{
+  int i, n;
+  int ival = 0;
+
+  for ( i = 0; i < nval; i++ )
+    {
+      n = scanf("%lg", &array[i]);
+      if ( n != 1 ) break;
+
+      ival++;
+    }
+
+  return (ival);
+}
+*/
+
+void *Input(void *argument)
+{
+  int INPUT, INPUTSRV, INPUTEXT;
+  int operatorID;
+  int varID = 0;
+  int nlevs = 1;
+  int gridsize0 = 0, gridsize = 0;
+  int gridID = -1, zaxisID, vdate = 0, vtime = 0;
+  int nrecs;
+  int levelID;
+  int tsID, taxisID = 0;
+  int streamID = -1;
+  int vlistID = -1;
+  int nmiss = 0;
+  int i;
+  int code = 0, code0 = 0, level = 0, date = 0, time = 0, nlon = 0, nlat = 0;
+  int output_filetype = FILETYPE_GRB;
+  int rval;
+  int ihead[8];
+  double missval = 0;
+  double levels[1];
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  INPUT    = cdoOperatorAdd("input",    0, 0, NULL);
+  INPUTSRV = cdoOperatorAdd("inputsrv", 0, 0, NULL);
+  INPUTEXT = cdoOperatorAdd("inputext", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == INPUT )
+    {
+      operatorInputArg("grid description file or name");
+      operatorCheckArgc(1);
+      gridID = cdoDefineGrid(operatorArgv()[0]);
+    }
+
+  levels[0] = 0;
+  nrecs = 0;
+
+  tsID = 0;
+  while ( TRUE )
+    {
+      if ( operatorID == INPUT )
+	{
+	  output_filetype = cdoFiletype();
+
+	  code     = -1;
+	  level    = 0;
+	  gridsize = gridInqSize(gridID);
+	  date     = 0;
+	  time     = 0;
+	  
+	  if ( nrecs == 0 )
+	    array = (double *) malloc(gridsize*sizeof(double));
+	  
+	  cdoPrint("Enter all %d elements of record %d!", gridsize, nrecs+1);
+	  
+	  rval = input_darray(stdin, gridsize, array);
+
+	  if ( nrecs > 0 && rval == 0 ) break;
+
+	  if ( rval != gridsize )
+	    cdoAbort("Too few input elements (%d of %d)!", rval, gridsize);
+
+	  if ( feof(stdin) ) break;
+	}
+      else if ( operatorID == INPUTEXT )
+	{
+	  output_filetype = cdoDefaultFileType;
+	  if ( output_filetype == CDI_UNDEFID ) output_filetype = FILETYPE_EXT;
+
+	  cdoPrint("Enter header (code,level,date,time,nlon,nlat,dispo1,dispo2)"
+		   " of record %d (or EOF(=^D))!", nrecs+1);
+
+	  rval = input_iarray(4, ihead);
+	  if ( feof(stdin) && nrecs == 0 )
+	    cdoAbort("Too few header elements (%d of %d)!", rval, 4);
+	  if ( feof(stdin) ) break;
+	  if ( rval != 4 ) cdoAbort("Invalid header input!");
+
+	  date     = ihead[0];
+	  code     = ihead[1];
+	  level    = ihead[2];
+	  gridsize = ihead[3];
+
+	  time = 0;
+	  
+	  if ( nrecs == 0 )
+	    {
+	      code0 = code;
+	      levels[0] = level;
+	      gridsize0 = gridsize;
+
+	      if ( gridsize < 0 )
+		cdoAbort("Gridsize must not be negative!", gridsize);
+
+	      array = (double *) malloc(gridsize*sizeof(double));
+
+	      gridID = gridCreate(GRID_GENERIC, gridsize);
+	    }
+	  else
+	    {
+	      if ( gridsize != gridsize0 )
+		cdoAbort("Gridsize must not change!");
+	    }
+	  
+	  cdoPrint("Enter all %d elements of record %d!", gridsize, nrecs+1);
+	  
+	  rval = input_darray(stdin, gridsize, array);
+	  if ( rval != gridsize ) cdoAbort("Invalid data input!");
+	}
+      else if ( operatorID == INPUTSRV )
+	{
+	  output_filetype = cdoDefaultFileType;
+	  if ( output_filetype == CDI_UNDEFID ) output_filetype = FILETYPE_SRV;
+	  
+	  cdoPrint("Enter header (code,level,date,time,nlon,nlat,dispo1,dispo2)"
+		   " of record %d (or EOF(=^D))!", nrecs+1);
+
+	  rval = input_iarray(8, ihead);
+	  if ( feof(stdin) && nrecs == 0 )
+	    cdoAbort("Too few header elements (%d of %d)!", rval, 8);
+	  if ( feof(stdin) ) break;
+	  if ( rval != 8 ) cdoAbort("Invalid header input!");
+
+	  code  = ihead[0];
+	  level = ihead[1];
+	  date  = ihead[2];
+	  time  = ihead[3];
+	  nlon  = ihead[4];
+	  nlat  = ihead[5];
+
+	  gridsize = nlon*nlat;
+
+	  if ( nrecs == 0 )
+	    {
+	      code0 = code;
+	      levels[0] = level;
+	      gridsize0 = gridsize;
+	  
+	      if ( gridsize < 0 )
+		cdoAbort("Gridsize must not be negative!", gridsize);
+
+	      array = (double *) malloc(gridsize*sizeof(double));
+
+	      gridID = gridCreate(GRID_GENERIC, gridsize);
+	      gridDefXsize(gridID, nlon);
+	      gridDefYsize(gridID, nlat);
+	    }
+	  else
+	    {
+	      if ( gridsize != gridsize0 )
+		cdoAbort("Gridsize must not change!");
+	    }
+	  
+	  cdoPrint("Enter all %d elements of record %d!", gridsize, nrecs+1);
+	  
+	  rval = input_darray(stdin, gridsize, array);
+	  if ( rval != gridsize ) cdoAbort("Invalid data input!");
+	}
+
+      if ( nrecs == 0 )
+	{
+	  zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
+	  zaxisDefLevels(zaxisID, levels);
+
+	  vlistID = vlistCreate();
+	  varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+	  vlistDefVarCode(vlistID, varID, code);
+
+	  missval = vlistInqVarMissval(vlistID, varID);
+
+	  taxisID = taxisCreate(TAXIS_RELATIVE);
+	  vlistDefTaxis(vlistID, taxisID);
+
+	  streamID = streamOpenWrite(cdoStreamName(0), output_filetype);
+
+	  streamDefVlist(streamID, vlistID);
+	}
+
+      vdate = date;
+      vtime = time;
+      taxisDefVdate(taxisID, vdate);
+      taxisDefVtime(taxisID, vtime);
+      streamDefTimestep(streamID, tsID);
+
+      for ( levelID = 0; levelID < nlevs; levelID++ )
+	{
+	  streamDefRecord(streamID, varID, levelID);
+
+	  nmiss = 0;
+	  for ( i = 0; i < gridsize; ++i )
+	    if ( DBL_IS_EQUAL(array[i], missval) ) nmiss++;
+
+	  streamWriteRecord(streamID, array, nmiss);
+	}
+
+      nrecs++;
+      tsID++;
+    }
+
+  if ( streamID >= 0 )
+    {
+      streamClose(streamID);
+      vlistDestroy(vlistID);
+    }
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Intgrid.c b/src/Intgrid.c
new file mode 100644
index 0000000..2673fcf
--- /dev/null
+++ b/src/Intgrid.c
@@ -0,0 +1,466 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Intgrid    interpolate     PINGO grid interpolation
+      Intgrid    intgridbil      Bilinear grid interpolation
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "interpol.h"
+
+
+int genThinoutGrid(int gridID1, int xinc, int yinc)
+{
+  int ilon, ilat, olon, olat;
+  int gridID2, gridtype;
+  int gridsize1, nlon1, nlat1;
+  int gridsize2, nlon2, nlat2;
+  double *xvals1, *yvals1, *xvals2, *yvals2;
+
+  gridtype = gridInqType(gridID1);
+  gridsize1 = gridInqSize(gridID1);
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  nlon2 = nlon1/xinc;
+  nlat2 = nlat1/yinc;
+  if ( nlon1%xinc ) nlon2++;
+  if ( nlat1%yinc ) nlat2++;
+  gridsize2 = nlon2*nlat2;
+
+  gridID2 = gridCreate(GRID_LONLAT, gridsize2);
+  gridDefXsize(gridID2, nlon2);
+  gridDefYsize(gridID2, nlat2);
+
+  if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_LONLAT )
+    {
+      xvals1 = (double *) malloc(nlon1*sizeof(double));
+      yvals1 = (double *) malloc(nlat1*sizeof(double));
+      xvals2 = (double *) malloc(nlon2*sizeof(double));
+      yvals2 = (double *) malloc(nlat2*sizeof(double));
+      gridInqXvals(gridID1, xvals1);
+      gridInqYvals(gridID1, yvals1);
+
+      olat = 0;
+      for ( ilat = 0; ilat < nlat1; ilat+=yinc )
+	{
+	  yvals2[olat] = yvals1[ilat];
+	  olat++;
+	}
+
+      olon = 0;
+      for ( ilon = 0; ilon < nlon1; ilon+=xinc )
+	{
+	  xvals2[olon] = xvals1[ilon];
+	  olon++;
+	}
+
+      gridDefXvals(gridID2, xvals2);
+      gridDefYvals(gridID2, yvals2);
+    }
+  else
+    {
+      cdoAbort("Unsupported grid: %s", gridNamePtr(gridtype));
+    }
+
+  return gridID2;
+}
+
+
+int genBoxavgGrid(int gridID1, int xinc, int yinc)
+{
+  int i, j, i1;
+  int gridID2, gridtype;
+  int gridsize1, nlon1, nlat1;
+  int gridsize2, nlon2, nlat2;
+  double *xvals1, *yvals1, *xvals2, *yvals2;
+  double *grid1_corner_lon = NULL, *grid1_corner_lat = NULL;
+  double *grid2_corner_lon = NULL, *grid2_corner_lat = NULL;
+
+  gridtype = gridInqType(gridID1);
+  gridsize1 = gridInqSize(gridID1);
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  nlon2 = nlon1/xinc;
+  nlat2 = nlat1/yinc;
+  if ( nlon1%xinc ) nlon2++;
+  if ( nlat1%yinc ) nlat2++;
+  gridsize2 = nlon2*nlat2;
+
+  gridID2 = gridCreate(GRID_LONLAT, gridsize2);
+  gridDefXsize(gridID2, nlon2);
+  gridDefYsize(gridID2, nlat2);
+
+  if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_LONLAT )
+    {
+      xvals1 = (double *) malloc(nlon1*sizeof(double));
+      yvals1 = (double *) malloc(nlat1*sizeof(double));
+      xvals2 = (double *) malloc(nlon2*sizeof(double));
+      yvals2 = (double *) malloc(nlat2*sizeof(double));
+      gridInqXvals(gridID1, xvals1);
+      gridInqYvals(gridID1, yvals1);
+
+      if ( gridInqYbounds(gridID1, NULL) && gridInqXbounds(gridID1, NULL) )
+	{
+	  grid1_corner_lon = (double *) malloc(2*nlon1*sizeof(double));
+	  grid1_corner_lat = (double *) malloc(2*nlat1*sizeof(double));
+	  grid2_corner_lon = (double *) malloc(2*nlon2*sizeof(double));
+	  grid2_corner_lat = (double *) malloc(2*nlat2*sizeof(double));
+	  gridInqXbounds(gridID1, grid1_corner_lon);
+	  gridInqYbounds(gridID1, grid1_corner_lat);
+	}
+
+      j = 0;
+      for ( i = 0; i < nlon1; i += xinc )
+	{
+	  i1 = i+(xinc-1);
+	  if ( i1 >= nlon1-1 ) i1 = nlon1-1; 
+	  xvals2[j] = xvals1[i] + (xvals1[i1] - xvals1[i])/2;
+	  if ( grid2_corner_lon )
+	    {
+	      grid2_corner_lon[2*j] = grid1_corner_lon[2*i];
+	      grid2_corner_lon[2*j+1] = grid1_corner_lon[2*i1+1];
+	    }
+	  j++;
+	}
+      j = 0;
+      for ( i = 0; i < nlat1; i += yinc )
+	{
+	  i1 = i+(yinc-1);
+	  if ( i1 >= nlat1-1 ) i1 = nlat1-1; 
+	  yvals2[j] = yvals1[i] + (yvals1[i1] - yvals1[i])/2;
+	  if ( grid2_corner_lat )
+	    {
+	      grid2_corner_lat[2*j] = grid1_corner_lat[2*i];
+	      grid2_corner_lat[2*j+1] = grid1_corner_lat[2*i1+1];
+	    }
+	  j++;
+	}
+
+      gridDefXvals(gridID2, xvals2);
+      gridDefYvals(gridID2, yvals2);
+
+      if ( grid2_corner_lon && grid2_corner_lat )
+	{
+	  gridDefNvertex(gridID2, 2);
+	  gridDefXbounds(gridID2, grid2_corner_lon);
+	  gridDefYbounds(gridID2, grid2_corner_lat);
+
+	  free(grid2_corner_lon);
+	  free(grid2_corner_lat);
+	}
+    }
+  else
+    {
+      cdoAbort("Unsupported grid: %s", gridNamePtr(gridtype));
+    }
+
+  return gridID2;
+}
+
+
+void boxavg(field_t *field1, field_t *field2, int xinc, int yinc)
+{
+  int nlon1, nlat1;
+  int nlon2, nlat2;
+  int ilat, ilon;
+  int gridID1, gridID2;
+  int nmiss;
+  double **xfield1;
+  double *array1, *array2;
+  double missval;
+  int i, j, ii, jj, in;
+  double **xfield2;
+  /* static int index = 0; */
+
+  gridID1 = field1->grid;
+  gridID2 = field2->grid;
+  array1  = field1->ptr;
+  array2  = field2->ptr;
+  missval = field1->missval;
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  nlon2 = gridInqXsize(gridID2);
+  nlat2 = gridInqYsize(gridID2);
+
+  xfield1 = (double **) malloc(nlat1*sizeof(double *));
+
+  for ( ilat = 0; ilat < nlat1; ilat++ )
+    xfield1[ilat] = array1 + ilat*nlon1;
+
+
+  xfield2 = (double **) malloc(nlat2 * sizeof(double *));
+
+  for ( ilat = 0; ilat < nlat2; ilat++ )
+    xfield2[ilat] = array2 + ilat*nlon2;
+
+  for ( ilat = 0; ilat < nlat2; ilat++ )
+    for ( ilon = 0; ilon < nlon2; ilon++ )
+      {
+	xfield2[ilat][ilon] = 0;
+
+	in = 0;
+	for ( j = 0; j < yinc; ++j )
+	  {
+	    jj = ilat*yinc+j;
+	    if ( jj >= nlat1 ) break;
+	    for ( i = 0; i < xinc; ++i )
+	      {
+		ii = ilon*xinc+i;
+		if ( ii >= nlon1 ) break;
+		in++;
+		xfield2[ilat][ilon] += xfield1[jj][ii];
+	      }
+	  }
+	xfield2[ilat][ilon] /= in;
+      }
+
+  nmiss = 0;
+  for ( i = 0; i < nlat2*nlon2; i++ )
+    if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
+
+  field2->nmiss = nmiss;
+
+  free(xfield2);
+  free(xfield1);
+}
+
+
+void thinout(field_t *field1, field_t *field2, int xinc, int yinc)
+{
+  int nlon1, nlat1;
+  int nlon2, nlat2;
+  int ilat, ilon, olat, olon;
+  int gridID1, gridID2;
+  int nmiss;
+  double **xfield1;
+  double *array1, *array2;
+  double missval;
+  int i;
+  double **xfield2;
+
+  gridID1 = field1->grid;
+  gridID2 = field2->grid;
+  array1  = field1->ptr;
+  array2  = field2->ptr;
+  missval = field1->missval;
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  nlon2 = gridInqXsize(gridID2);
+  nlat2 = gridInqYsize(gridID2);
+
+  xfield1 = (double **) malloc(nlat1*sizeof(double *));
+
+  for ( ilat = 0; ilat < nlat1; ilat++ )
+    xfield1[ilat] = array1 + ilat*nlon1;
+
+  xfield2 = (double **) malloc(nlat2*sizeof(double *));
+
+  for ( ilat = 0; ilat < nlat2; ilat++ )
+    xfield2[ilat] = array2 + ilat*nlon2;
+
+  olat = 0;
+  for ( ilat = 0; ilat < nlat1; ilat+=yinc )
+    {
+      olon = 0;
+      for ( ilon = 0; ilon < nlon1; ilon+=xinc )
+	{
+	  xfield2[olat][olon] = xfield1[ilat][ilon];
+	  olon++;
+	}
+      olat++;
+    }
+
+  nmiss = 0;
+  for ( i = 0; i < nlat2*nlon2; i++ )
+    if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
+  
+  field2->nmiss = nmiss;
+
+  free(xfield2);
+  free(xfield1);
+}
+
+
+
+void *Intgrid(void *argument)
+{
+  int INTGRID, INTPOINT, INTERPOLATE, BOXAVG, THINOUT;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs, ngrids;
+  int index;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2;
+  int gridID1 = -1, gridID2 = -1;
+  int nmiss;
+  int xinc = 0, yinc = 0;
+  double missval;
+  double slon, slat;
+  double *array1 = NULL, *array2 = NULL;
+  field_t field1, field2;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  INTGRID     = cdoOperatorAdd("intgridbil",  0, 0, NULL);
+  INTPOINT    = cdoOperatorAdd("intpoint",    0, 0, NULL);
+  INTERPOLATE = cdoOperatorAdd("interpolate", 0, 0, NULL);
+  BOXAVG      = cdoOperatorAdd("boxavg",      0, 0, NULL);
+  THINOUT     = cdoOperatorAdd("thinout",     0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == INTGRID || operatorID == INTERPOLATE )
+    {
+      operatorInputArg("grid description file or name");
+      gridID2 = cdoDefineGrid(operatorArgv()[0]);
+    }
+  else if ( operatorID == INTPOINT )
+    {
+      operatorInputArg("longitude and latitude");
+      operatorCheckArgc(2);
+      slon = atof(operatorArgv()[0]);
+      slat = atof(operatorArgv()[1]);
+      gridID2 = gridCreate(GRID_LONLAT, 1);
+      gridDefXsize(gridID2, 1);
+      gridDefYsize(gridID2, 1);
+      gridDefXvals(gridID2, &slon);
+      gridDefYvals(gridID2, &slat);
+    }
+  else if ( operatorID == THINOUT || operatorID == BOXAVG )
+    {
+      operatorInputArg("xinc, yinc");
+      operatorCheckArgc(2);
+      xinc = atoi(operatorArgv()[0]);
+      yinc = atoi(operatorArgv()[1]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids = vlistNgrids(vlistID1);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID1 = vlistGrid(vlistID1, index);
+
+      if ( operatorID == BOXAVG || operatorID == THINOUT )
+	{
+	  if ( index == 0 )
+	    {
+	      if ( gridInqType(gridID1) != GRID_LONLAT && gridInqType(gridID1) != GRID_GAUSSIAN 
+		   /* && gridInqType(gridID1) != GRID_CURVILINEAR */ )
+		cdoAbort("Interpolation of %s data unsupported!", gridNamePtr(gridInqType(gridID1)) );
+
+	      if ( operatorID == BOXAVG )
+		gridID2 = genBoxavgGrid(gridID1, xinc, yinc);
+	      else
+		gridID2 = genThinoutGrid(gridID1, xinc, yinc);
+	    }
+	  else
+	    cdoAbort("Too many different grids!");
+	}
+      else
+	{
+	  if ( gridInqType(gridID1) != GRID_LONLAT && gridInqType(gridID1) != GRID_GAUSSIAN )
+	    cdoAbort("Interpolation of %s data unsupported!", gridNamePtr(gridInqType(gridID1)) );
+
+	  if ( gridIsRotated(gridID1) )
+	    cdoAbort("Rotated grids not supported!");
+	}
+
+      vlistChangeGridIndex(vlistID2, index, gridID2);
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array1   = (double *) malloc(gridsize*sizeof(double));
+
+  gridsize = gridInqSize(gridID2);
+  array2   = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  gridID1 = vlistInqVarGrid(vlistID1, varID);
+	  missval = vlistInqVarMissval(vlistID1, varID);
+
+	  field1.grid    = gridID1;
+	  field1.nmiss   = nmiss;
+	  field1.missval = missval;
+	  field1.ptr     = array1;
+	  field2.grid    = gridID2;
+	  field2.ptr     = array2;
+	  field2.nmiss   = 0;
+
+	  if ( operatorID == INTGRID || operatorID == INTPOINT )
+	    intgrid(&field1, &field2);
+	  else if ( operatorID == INTERPOLATE )
+	    interpolate(&field1, &field2);
+	  else if ( operatorID == BOXAVG )
+	    boxavg(&field1, &field2, xinc, yinc);
+	  else if ( operatorID == THINOUT )
+	    thinout(&field1, &field2, xinc, yinc);
+
+	  nmiss = field2.nmiss;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array2, nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Intgridtraj.c b/src/Intgridtraj.c
new file mode 100644
index 0000000..081442f
--- /dev/null
+++ b/src/Intgridtraj.c
@@ -0,0 +1,256 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "interpol.h"
+
+
+int readnextpos(FILE *fp, int calendar, juldate_t *juldate, double *xpos, double *ypos)
+{
+  int year = 0, month = 0, day = 0, hour = 0, minute = 0, second = 0;
+  int date, time;
+  int stat;
+
+  *xpos = 0;
+  *ypos = 0;
+
+  stat = fscanf(fp, "%d-%d-%d %d:%d:%d %lf %lf",
+		&year, &month, &day, &hour, &minute, &second, xpos, ypos);
+
+  if ( stat != EOF )
+    {
+      date = cdiEncodeDate(year, month, day);
+      time = cdiEncodeTime(hour, minute, second);
+      *juldate = juldate_encode(calendar, date, time);
+    }
+
+  return (stat);
+}
+
+
+void *Intgridtraj(void *argument)
+{
+  int streamID1, streamID2;
+  int nrecs, nvars, nlevel;
+  int index, ngrids;
+  int i, nrecords;
+  int tsID, tsIDo, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2;
+  int gridID1, gridID2;
+  int taxisID1, taxisID2;
+  int vdate, vtime;
+  int offset;
+  int nmiss;
+  int *recVarID, *recLevelID;
+  juldate_t juldate1, juldate2, juldate;
+  double fac1, fac2;
+  double point;
+  double *array, *single1, *single2;
+  double **vardata1, **vardata2, *vardatap;
+  double xpos, ypos;
+  char *posfile;
+  double missval;
+  int calendar = CALENDAR_STANDARD;
+  field_t field1, field2;
+  FILE *fp;
+
+  cdoInitialize(argument);
+
+  operatorInputArg("filename with grid trajectories");
+  operatorCheckArgc(1);
+
+  posfile = operatorArgv()[0];
+  fp = fopen(posfile, "r");
+  if ( fp == NULL ) cdoAbort("Open failed on %s!", posfile);
+
+  readnextpos(fp, calendar, &juldate, &xpos, &ypos);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  vardata1 = (double **) malloc(nvars*sizeof(double*));
+  vardata2 = (double **) malloc(nvars*sizeof(double*));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      vardata1[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+      vardata2[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+    }
+
+  gridID2 = gridCreate(GRID_TRAJECTORY, 1);
+  gridDefXsize(gridID2, 1);
+  gridDefYsize(gridID2, 1);
+  gridDefXvals(gridID2, &xpos);
+  gridDefYvals(gridID2, &ypos);
+
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  ngrids = vlistNgrids(vlistID1);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID1 = vlistGrid(vlistID1, index);
+
+      if ( gridInqType(gridID1) != GRID_LONLAT &&
+	   gridInqType(gridID1) != GRID_GAUSSIAN )
+	cdoAbort("Unsupported grid type: %s", gridNamePtr(gridInqType(gridID1)) );
+
+      vlistChangeGridIndex(vlistID2, index, gridID2);
+    }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  nrecs = streamInqTimestep(streamID1, tsID++);
+  juldate1 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
+  for ( recID = 0; recID < nrecs; recID++ )
+    {
+      streamInqRecord(streamID1, &varID, &levelID);
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      offset   = gridsize*levelID;
+      single1  = vardata1[varID] + offset;
+      streamReadRecord(streamID1, single1, &nmiss);
+      if ( nmiss ) cdoAbort("Missing values unsupported for this operator!");
+    }
+
+  tsIDo = 0;
+  while ( juldate_to_seconds(juldate1) <= juldate_to_seconds(juldate) )
+    {
+      nrecs = streamInqTimestep(streamID1, tsID++);
+      if ( nrecs == 0 ) break;
+      juldate2 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  recVarID[recID]   = varID;
+	  recLevelID[recID] = levelID;
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single2  = vardata2[varID] + offset;
+	  streamReadRecord(streamID1, single2, &nmiss);
+	  if ( nmiss ) cdoAbort("Missing values unsupported for this operator!");
+	}
+
+      while ( juldate_to_seconds(juldate) < juldate_to_seconds(juldate2) )
+	{
+	  if ( juldate_to_seconds(juldate) >= juldate_to_seconds(juldate1) && 
+	       juldate_to_seconds(juldate) <  juldate_to_seconds(juldate2) )
+	    {
+	      juldate_decode(calendar, juldate, &vdate, &vtime);
+	      taxisDefVdate(taxisID2, vdate);
+	      taxisDefVtime(taxisID2, vtime);
+	      streamDefTimestep(streamID2, tsIDo++);
+
+	      fac1 = juldate_to_seconds(juldate_sub(juldate2, juldate)) / 
+		     juldate_to_seconds(juldate_sub(juldate2, juldate1));
+	      fac2 = juldate_to_seconds(juldate_sub(juldate, juldate1)) / 
+	   	     juldate_to_seconds(juldate_sub(juldate2, juldate1));
+	      /*
+	      printf("      %f %f %f %f %f\n", juldate_to_seconds(juldate),
+	                                       juldate_to_seconds(juldate1), 
+					       juldate_to_seconds(juldate2), fac1, fac2);
+	      */
+	      for ( recID = 0; recID < nrecs; recID++ )
+		{
+		  varID    = recVarID[recID];
+		  levelID  = recLevelID[recID];
+		  missval  = vlistInqVarMissval(vlistID1, varID);
+		  gridID1  = vlistInqVarGrid(vlistID1, varID);
+		  gridsize = gridInqSize(gridID1);
+		  offset   = gridsize*levelID;
+		  single1  = vardata1[varID] + offset;
+		  single2  = vardata2[varID] + offset;
+
+		  for ( i = 0; i < gridsize; i++ )
+		    array[i] = single1[i]*fac1 + single2[i]*fac2;
+
+		  field1.grid    = gridID1;
+		  field1.nmiss   = nmiss;
+		  field1.missval = missval;
+		  field1.ptr     = array;
+		  field2.grid    = gridID2;
+		  field2.ptr     = &point;
+		  field2.nmiss   = 0;
+
+		  intgrid(&field1, &field2);
+
+		  streamDefRecord(streamID2, varID, levelID);
+		  streamWriteRecord(streamID2, &point, nmiss);
+		}
+	    }
+	  if ( readnextpos(fp, calendar, &juldate, &xpos, &ypos) == EOF ) break;
+	  gridDefXvals(gridID2, &xpos);
+	  gridDefYvals(gridID2, &ypos);
+	}
+
+      juldate1 = juldate2;
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  vardatap        = vardata1[varID];
+	  vardata1[varID] = vardata2[varID];
+	  vardata2[varID] = vardatap;
+	}
+    }
+
+  fclose(fp);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      free(vardata1[varID]);
+      free(vardata2[varID]);
+    }
+  free(vardata1);
+  free(vardata2);
+  if ( array )  free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Intlevel.c b/src/Intlevel.c
new file mode 100644
index 0000000..28fb303
--- /dev/null
+++ b/src/Intlevel.c
@@ -0,0 +1,435 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Intlevel   intlevel        Linear level interpolation
+      Intlevel   intlevel3d      Linear level interpolation on a 3d vertical coordinates variable
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "list.h"
+
+
+static
+void interp_lev(int gridsize, double missval, double *vardata1, double *vardata2,
+		int nlev2, int *lev_idx1, int *lev_idx2, double *lev_wgt1, double *lev_wgt2)
+{
+  int i, ilev;
+  int idx1, idx2;
+  double wgt1, wgt2;
+  double w1, w2;
+  double *var1L1, *var1L2, *var2;
+
+  for ( ilev = 0; ilev < nlev2; ++ilev )
+    {
+      idx1 = lev_idx1[ilev];
+      idx2 = lev_idx2[ilev];
+      wgt1 = lev_wgt1[ilev];
+      wgt2 = lev_wgt2[ilev];
+      var2 = vardata2+gridsize*ilev;
+
+      if ( cdoVerbose ) cdoPrint("level %d: idx1=%d idx2=%d wgt1=%g wgt2=%g", ilev, idx1, idx2, wgt1, wgt2);
+
+      var1L1 = vardata1+gridsize*idx1;
+      var1L2 = vardata1+gridsize*idx2;
+
+#if defined (_OPENMP)
+#pragma omp parallel for shared(gridsize, var2, var1L1, var1L2, wgt1, wgt2, missval) private(i, w1, w2)
+#endif
+      for ( i = 0; i < gridsize; ++i )
+	{
+	  w1 = wgt1;
+	  w2 = wgt2;
+	  if ( DBL_IS_EQUAL(var1L1[i], missval) ) w1 = 0;
+	  if ( DBL_IS_EQUAL(var1L2[i], missval) ) w2 = 0;
+
+	  if ( IS_EQUAL(w1, 0) && IS_EQUAL(w2, 0) )
+	    {
+	      var2[i] = missval;
+	    }
+	  else if ( IS_EQUAL(w1, 0) )
+	    {
+	      if ( w2 >= 0.5 )
+		var2[i] = var1L2[i];
+	      else
+		var2[i] = missval;	      
+	    }
+	  else if ( IS_EQUAL(w2, 0) )
+	    {
+	      if ( w1 >= 0.5 )
+		var2[i] = var1L1[i];
+	      else
+		var2[i] = missval;	      
+	    }
+	  else
+	    {
+	      var2[i] = var1L1[i]*w1 + var1L2[i]*w2;
+	    }
+	}
+    }
+}
+
+static
+void gen_weights(int expol, int nlev1, double *lev1, int nlev2, double *lev2,
+		 int *lev_idx1, int *lev_idx2, double *lev_wgt1, double *lev_wgt2)
+{
+  int i1, i2;
+  double val1, val2 = 0;
+  int    idx1 = 0, idx2 = 0;
+
+  for ( i2 = 0; i2 < nlev2; ++i2 )
+    {
+      for ( i1 = 1; i1 < nlev1; ++i1 )
+	{
+	  if ( lev1[i1-1] < lev1[i1] )
+	    {
+	      idx1 = i1 - 1;
+	      idx2 = i1;
+	    }
+	  else
+	    {
+	      idx1 = i1;
+	      idx2 = i1-1;
+	    }
+	  val1 = lev1[idx1];
+	  val2 = lev1[idx2];
+
+	  if ( lev2[i2] > val1 && lev2[i2] <= val2 ) break;
+	}
+
+      if ( i1 == nlev1 ) cdoAbort("Level %g not found!", lev2[i2]);
+      else
+	{
+	  if ( i1-1 == 0 )
+	    {
+	      lev_idx1[i2] = 1;
+	      lev_idx2[i2] = 1;
+	      lev_wgt1[i2] = 0;
+	      if ( expol || IS_EQUAL(lev2[i2], val2) )
+		lev_wgt2[i2] = 1;
+	      else
+		lev_wgt2[i2] = 0;
+	    }
+	  else if ( i1 == nlev1-1 )
+	    {
+	      lev_idx1[i2] = nlev1-2;
+	      lev_idx2[i2] = nlev1-2;
+	      if ( expol || IS_EQUAL(lev2[i2], val2) )
+		lev_wgt1[i2] = 1;
+	      else
+		lev_wgt1[i2] = 0;
+	      lev_wgt2[i2] = 0;
+	    }
+	  else
+	    {
+	      lev_idx1[i2] = idx1;
+	      lev_idx2[i2] = idx2;
+	      lev_wgt1[i2] = (lev1[idx2] - lev2[i2]) / (lev1[idx2] - lev1[idx1]);
+	      lev_wgt2[i2] = (lev2[i2] - lev1[idx1]) / (lev1[idx2] - lev1[idx1]);
+	    }
+	  lev_idx1[i2]--;
+	  lev_idx2[i2]--;
+	  /*
+	  printf("%d %g %d %d %g %g %d %d %g %g\n",
+	  i2, lev2[i2], idx1, idx2, lev1[idx1], lev1[idx2], 
+	  lev_idx1[i2], lev_idx2[i2], lev_wgt1[i2], lev_wgt2[i2]);
+	  */
+	}
+    }
+}
+
+
+void *Intlevel(void *argument)
+{
+  int INTLEVEL, INTLEVELX;
+  int operatorID;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridsize;
+  int recID, nrecs;
+  int i, offset;
+  int tsID, varID, levelID;
+  int nvars;
+  int nzaxis;
+  int nmiss;
+  int zaxisID1 = -1, zaxisID2;
+  int gridID, zaxisID;
+  int nlev1, nlev2, nlevel = 0, maxlev;
+  int lup, ldown;
+  int **varnmiss = NULL;
+  int *varinterp = NULL;
+  int *vars = NULL;
+  int expol = FALSE;
+  double missval;
+  double *lev1 = NULL, *lev2 = NULL;
+  double *single1, *single2;
+  double **vardata1 = NULL, **vardata2 = NULL;
+  int taxisID1, taxisID2;
+  int *lev_idx1, *lev_idx2;
+  double *lev_wgt1, *lev_wgt2;
+  LIST *flist = listNew(FLT_LIST);
+
+  cdoInitialize(argument);
+
+  INTLEVEL   = cdoOperatorAdd("intlevel",  0, 0, NULL);
+  INTLEVELX  = cdoOperatorAdd("intlevelx", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == INTLEVELX ) expol = TRUE;
+
+  operatorInputArg("levels");
+
+  nlev2 = args2fltlist(operatorArgc(), operatorArgv(), flist);
+  lev2  = (double *) listArrayPtr(flist);
+
+  if ( cdoVerbose ) for ( i = 0; i < nlev2; ++i ) printf("lev2 %d: %g\n", i, lev2[i]);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nzaxis  = vlistNzaxis(vlistID1);
+  for ( i = 0; i < nzaxis; i++ )
+    {
+      zaxisID = vlistZaxis(vlistID1, i);
+      nlevel  = zaxisInqSize(zaxisID);
+      if ( zaxisInqType(zaxisID) != ZAXIS_HYBRID && zaxisInqType(zaxisID) != ZAXIS_HYBRID_HALF )
+	if ( nlevel > 1 )
+	  {
+	    zaxisID1 = zaxisID;
+	    break;
+	  }
+    }
+
+  if ( i == nzaxis ) cdoAbort("No processable variable found!");
+
+  nlev1 = nlevel;
+  lev1  = (double *) malloc((nlev1+2)*sizeof(double));
+  zaxisInqLevels(zaxisID1, lev1+1);
+
+  lup = FALSE;
+  ldown = FALSE;
+  for ( i = 1; i < nlev1; ++i )
+    {
+      if ( i == 1 )
+	{
+	  if ( lev1[i+1] > lev1[i] )
+	    lup = TRUE;
+	  else if ( lev1[i+1] < lev1[i] )
+	    ldown = TRUE;	
+	}
+      else
+	{
+	  if ( lup )
+	    {
+	      if ( !(lev1[i+1] > lev1[i]) ) lup = FALSE;
+	    }
+	  else if ( ldown )
+	    {
+	      if ( !(lev1[i+1] < lev1[i]) ) ldown = FALSE;
+	    }
+	}
+    }
+
+  if ( lup )
+    {
+      lev1[0]       = -1.e33; 
+      lev1[nlev1+1] =  1.e33;
+    }
+  else if ( ldown )
+    {
+      lev1[0]       =  1.e33; 
+      lev1[nlev1+1] = -1.e33;
+    }
+  else
+    cdoWarning("Non monotonic zaxis!");
+
+  if ( cdoVerbose ) for ( i = 0; i < nlev1+2; ++i ) printf("lev1 %d: %g\n", i, lev1[i]);
+
+  lev_idx1 = (int *) malloc(nlev2*sizeof(int));
+  lev_idx2 = (int *) malloc(nlev2*sizeof(int));
+  lev_wgt1 = (double *) malloc(nlev2*sizeof(double));
+  lev_wgt2 = (double *) malloc(nlev2*sizeof(double));
+
+  gen_weights(expol, nlev1+2, lev1, nlev2, lev2, lev_idx1, lev_idx2, lev_wgt1, lev_wgt2);
+
+  zaxisID2 = zaxisCreate(zaxisInqType(zaxisID1), nlev2);
+  zaxisDefLevels(zaxisID2, lev2);
+  {
+    char str[256];
+    str[0] = 0;
+    zaxisInqName(zaxisID1, str);
+    zaxisDefName(zaxisID2, str);
+    str[0] = 0;
+    zaxisInqLongname(zaxisID1, str);
+    if ( str[0] ) zaxisDefLongname(zaxisID2, str);
+    str[0] = 0;
+    zaxisInqUnits(zaxisID1, str);
+    if ( str[0] ) zaxisDefUnits(zaxisID2, str);
+
+    zaxisDefPrec(zaxisID2, zaxisInqPrec(zaxisID1));
+  }
+
+  for ( i = 0; i < nzaxis; i++ )
+    if ( zaxisID1 == vlistZaxis(vlistID1, i) )
+      vlistChangeZaxisIndex(vlistID2, i, zaxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars = vlistNvars(vlistID1);
+
+  vars      = (int *) malloc(nvars*sizeof(int));
+  vardata1  = (double **) malloc(nvars*sizeof(double*));
+  vardata2  = (double **) malloc(nvars*sizeof(double*));
+  varnmiss  = (int **) malloc(nvars*sizeof(int*));
+  varinterp = (int *) malloc(nvars*sizeof(int));
+
+  maxlev   = nlev1 > nlev2 ? nlev1 : nlev2;
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(zaxisID);
+
+      vardata1[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+
+      if ( zaxisID == zaxisID1 )
+	{
+	  varinterp[varID] = TRUE;
+	  vardata2[varID]  = (double *) malloc(gridsize*nlev2*sizeof(double));
+	  varnmiss[varID]  = (int *) malloc(maxlev*sizeof(int));
+	  memset(varnmiss[varID], 0, maxlev*sizeof(int));
+	}
+      else
+	{
+	  varinterp[varID] = FALSE;
+	  vardata2[varID]  = vardata1[varID];
+	  varnmiss[varID]  = (int *) malloc(nlevel*sizeof(int));
+	}
+    }
+
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      for ( varID = 0; varID < nvars; ++varID ) vars[varID] = FALSE;
+
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single1  = vardata1[varID] + offset;
+	  
+	  streamReadRecord(streamID1, single1, &varnmiss[varID][levelID]);
+	  vars[varID] = TRUE;
+	}
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vars[varID] && varinterp[varID] )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      missval  = vlistInqVarMissval(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+
+	      interp_lev(gridsize, missval, vardata1[varID], vardata2[varID],
+			 nlev2, lev_idx1, lev_idx2, lev_wgt1, lev_wgt2);
+
+	      for ( levelID = 0; levelID < nlev2; levelID++ )
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+		  offset   = gridsize*levelID;
+		  single2  = vardata2[varID] + offset;
+		  nmiss    = 0;
+		  for ( i = 0; i < gridsize; ++i )
+		    if ( DBL_IS_EQUAL(single2[i], missval) ) nmiss++;
+		  varnmiss[varID][levelID] = nmiss;
+		}
+	    }
+	}
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vars[varID] )
+	    {
+	      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+		  offset   = gridsize*levelID;
+		  single2  = vardata2[varID] + offset;
+		  streamDefRecord(streamID2, varID, levelID);
+		  streamWriteRecord(streamID2, single2, varnmiss[varID][levelID]);
+		}
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      free(varnmiss[varID]);
+      free(vardata1[varID]);
+      if ( varinterp[varID] ) free(vardata2[varID]);
+    }
+
+  free(varinterp);
+  free(varnmiss);
+  free(vardata2);
+  free(vardata1);
+  free(vars);
+
+  free(lev_idx1);
+  free(lev_idx2);
+  free(lev_wgt1);
+  free(lev_wgt2);
+
+  if (lev1) free(lev1);
+
+  listDelete(flist);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Intlevel3d.c b/src/Intlevel3d.c
new file mode 100644
index 0000000..2b4ffaf
--- /dev/null
+++ b/src/Intlevel3d.c
@@ -0,0 +1,649 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Intlevel   intlevel3d      Linear level interpolation on a 3d vertical coordinates variable
+      Intlevel   intlevelx3d     Linear level interpolation on a 3d vertical coordinates variable with extrapolation
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "list.h"
+
+/*
+ * 3d vertical interpolation routine (see interp_lev() in src/Intlevel.c)
+ */
+static
+void interp_lev3d(int gridsize, double missval, double *vardata1, double *vardata2,
+	     	  int nlev2, int *lev_idx1, int *lev_idx2, double *lev_wgt1, double *lev_wgt2)
+{
+  int i, ilev;
+  int idx1, idx2;
+  double wgt1, wgt2;
+  double w1, w2;
+  double var1L1, var1L2, *var2;
+
+  for ( ilev = 0; ilev < nlev2; ilev++ )
+    {
+      var2 = vardata2+(ilev*gridsize);
+
+      for ( i = 0; i < gridsize; i++ )
+	{
+          idx1 = lev_idx1[ilev*gridsize+i];
+          idx2 = lev_idx2[ilev*gridsize+i];
+          wgt1 = lev_wgt1[ilev*gridsize+i];
+          wgt2 = lev_wgt2[ilev*gridsize+i];
+
+          /* upper/lower values from input field */
+          var1L1 = *(vardata1+idx1);
+          var1L2 = *(vardata1+idx2);
+
+          /* if (cdoVerbose) printf("i:%d level %d: idx1=%d idx2=%d (ilev*gridsize+i:%d) wgt1=%g wgt2=%g var1L1:%g var1L2:%g ",
+           *                         i,       ilev, idx1,   idx2,    ilev*gridsize+i,    wgt1,   wgt2,   var1L1,   var1L2);
+           */
+
+	  w1 = wgt1;
+	  w2 = wgt2;
+	  if ( DBL_IS_EQUAL(var1L1, missval)  ) w1 = 0;
+	  if ( DBL_IS_EQUAL(var1L2, missval)  ) w2 = 0;
+
+	  if ( IS_EQUAL(w1, 0) && IS_EQUAL(w2, 0) )
+	    {
+	      var2[i] = missval;
+	    }
+	  else if ( IS_EQUAL(w1, 0) )
+	    {
+	      if ( w2 >= 0.5 )
+		var2[i] = var1L2;
+	      else
+		var2[i] = missval;	      
+	    }
+	  else if ( IS_EQUAL(w2, 0) )
+	    {
+	      if ( w1 >= 0.5 )
+		var2[i] = var1L1;
+	      else
+		var2[i] = missval;	      
+	    }
+	  else
+	    {
+	      var2[i] = var1L1*w1 + var1L2*w2;
+	    }
+	}
+    }
+}
+
+/*
+ * Create weights for the 3d vertical coordinate
+ *
+ * The resulting index sets lev_idx1 and lev_idx2 contain absolute numbers,i.e.
+ * wrt. the given gridsize. They can directly be used to read values from 3d
+ * data fields.
+ *
+ * 3d version of gen_weights() (src/Intlevel.c)
+ */
+static
+void gen_weights3d(int expol, int nlev1, int gridsize, double *lev1, int nlev2, double *lev2,
+                   int *lev_idx1, int *lev_idx2, double *lev_wgt1, double *lev_wgt2)
+{
+  int i,i1, i2;
+  double val1, val2 = 0;
+  int    idx1 = 0, idx2 = 0;
+
+  for ( i = 0; i < gridsize; i++ )
+    {
+      for ( i2 = 0; i2 < nlev2; i2++ )
+        {
+          /* Because 2 levels were added to the source vertical coordinate (one on
+           * top, one at the bottom), its loop starts at 1 */
+          for ( i1 = 1; i1 < nlev1; i1++ )
+            {
+              if ( lev1[(i1-1)*gridsize+i] < lev1[i1*gridsize+i] )
+                {
+                  idx1 = (i1 - 1)*gridsize+i;
+                  idx2 = i1*gridsize+i;
+                }
+              else
+                {
+                  idx1 = i1*gridsize+i;
+                  idx2 = (i1-1)*gridsize+i;
+                }
+              val1 = lev1[idx1];
+              val2 = lev1[idx2];
+
+              if ( lev2[i2*gridsize+i] > val1 && lev2[i2*gridsize+i] <= val2 ) break;
+            }
+
+          if ( i1 == nlev1 ) 
+            {
+              if ( expol )
+                cdoAbort("Level %g at index %d not found! Use extrapolation", lev2[i2*gridsize],i2);
+              else
+                cdoAbort("Level %g at index %d not found!");
+            }
+
+          if ( i1-1 == 0 ) /* destination levels ios not covert by the first two input z levels */
+            {
+              lev_idx1[i2*gridsize+i] = gridsize+i;
+              lev_idx2[i2*gridsize+i] = gridsize+i;
+              lev_wgt1[i2*gridsize+i] = 0;
+              if ( expol || IS_EQUAL(lev2[i2*gridsize+i], val2) )
+                lev_wgt2[i2*gridsize+i] = 1;
+              else
+                lev_wgt2[i2*gridsize+i] = 0;
+            }
+          else if ( i1 == nlev1-1 ) /* destination level is beyond the last value of the input z field */
+            {
+              lev_idx1[i2*gridsize+i] = (nlev1-2)*gridsize+i;
+              lev_idx2[i2*gridsize+i] = (nlev1-2)*gridsize+i;
+              if ( expol || IS_EQUAL(lev2[i2*gridsize+i], val2) )
+                lev_wgt1[i2*gridsize+i] = 1;
+              else
+                lev_wgt1[i2*gridsize+i] = 0;
+              lev_wgt2[i2*gridsize+i] = 0;
+            }
+          else /* target z values has two bounday values in input z field */
+            {
+              lev_idx1[i2*gridsize+i] = idx1;
+              lev_idx2[i2*gridsize+i] = idx2;
+              lev_wgt1[i2*gridsize+i] = (lev1[idx2]        - lev2[i2*gridsize+i]) / (lev1[idx2] - lev1[idx1]);
+              lev_wgt2[i2*gridsize+i] = (lev2[i2*gridsize+i] - lev1[idx1])        / (lev1[idx2] - lev1[idx1]);
+
+            }
+  /*         if (cdoVerbose)
+   *         {
+   *           printf("i:%d i2:%d\ti2*gridsize+i:%d\tlev2[i2*gridsize+i]:%g\tidx1:%d\tidx2:%d\tlev1[idx1]:%g\tlev1[idx2]:%g\t",
+   *                   i, i2, i2*gridsize+i,         lev2[i2*gridsize+i],    idx1,    idx2,    lev1[idx1],    lev1[idx2]);
+   *           printf("\tlev_wgt1:%g\tlev_wgt2:%g\n", lev_wgt1[i2*gridsize+i], lev_wgt2[i2*gridsize+i]);
+   *         }
+   */
+          /* backshift of the indices because if the two additional levels in input vertical coordinate */
+          lev_idx1[i2*gridsize+i] -= gridsize;
+          lev_idx2[i2*gridsize+i] -= gridsize;
+
+        }
+    }
+}
+
+void *Intlevel3d(void *argument)
+{
+  int INTLEVEL3D, INTLEVELX3D;
+  int operatorID;
+  int streamID0, streamID1, streamID2,streamID3;
+  int vlistID0, vlistID1, vlistID2, vlistID3;
+  int gridsize,gridSize,gridsizei,gridsizeo;
+  int recID, nrecs;
+  int i, offset;
+  int tsID, varID, levelID;
+  int nvars,nvct;
+  int nzaxis;
+  int nmiss;
+
+  int nlonIn, nlatIn, nlonOut, nlatOut;
+  double *lonIn, *latIn, *lonOut, *latOut;
+
+  int zaxisID1 = -1, zaxisID3;
+  int gridID, zaxisID;
+  int nlevi, nlevo, nlevel = 0, maxlev;
+  int lup, ldown;
+  int **varnmiss = NULL;
+  int *varinterp = NULL;
+  int *vars = NULL;
+  int expol = FALSE;
+  double missval;
+  double *lev1 = NULL, *lev2 = NULL;
+  double *single1, *single2;
+  double **vardata1 = NULL, **vardata2 = NULL;
+  int taxisID1, taxisID3;
+  int *lev_idx1, *lev_idx2;
+  double *lev_wgt1, *lev_wgt2;
+  double *zlevels_in, *zlevels_out;
+  int zlevels_in_miss, zlevels_out_miss;
+  char varname[10]; 
+
+  cdoInitialize(argument);
+
+  INTLEVEL3D  = cdoOperatorAdd("intlevel3d",  0, 0, NULL);
+  INTLEVELX3D = cdoOperatorAdd("intlevelx3d",  0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( cdoVerbose ) 
+    cdoPrint("Called '%s'\n",__func__);
+
+  if ( operatorID == INTLEVELX3D ) expol = TRUE;
+
+  operatorInputArg("icoordinate");
+
+  /*  Read filename from Parameter */
+  operatorInputArg("grid description file or name, remap file (SCRIP netCDF)");
+  operatorCheckArgc(1);
+  streamID0 = streamOpenRead(operatorArgv()[0]);                /*  3d vertical input coordinate */
+  streamID1 = streamOpenRead(cdoStreamName(0));                 /*  input data */
+  streamID2 = streamOpenRead(cdoStreamName(1));                 /*  3d target vertical coordinate */
+  streamID3 = streamOpenWrite(cdoStreamName(2),cdoFiletype());  /*  output stream */
+
+  vlistID0 = streamInqVlist(streamID0);
+  vlistID1 = streamInqVlist(streamID1); taxisID1 = vlistInqTaxis(vlistID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = vlistDuplicate(vlistID1);  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID3, taxisID1);
+
+  /*
+   * Read 3d input coordinate (streamID0)
+   * * two additional levels are added (top + bottom) for later extrapolation checking
+   */
+  {
+    nvars = vlistNvars(vlistID0);
+    if (nvars != 1) 
+      cdoAbort("Only one single variable is allowed!");
+    gridID     = vlistInqVarGrid(vlistID0, 0);
+    zaxisID    = vlistInqVarZaxis(vlistID0, 0);
+    gridsize   = gridInqSize(gridID);
+    nlevel     = zaxisInqSize(zaxisID);
+
+    nlonIn  = gridInqXsize(gridID);
+    nlatIn  = gridInqYsize(gridID);
+    lonIn   = (double *) malloc(nlonIn*sizeof(double));
+    latIn   = (double *) malloc(nlatIn*sizeof(double));
+    gridInqXvals(gridID, lonIn);
+    gridInqYvals(gridID, latIn);
+
+    zlevels_in = (double *) malloc(gridsize*(nlevel+2)*sizeof(double*));
+    nlevi      = nlevel;   /* number of input levels for later use */
+    gridsizei  = gridsize; /* horizontal gridsize of input z coordinate */
+    nrecs      = streamInqTimestep(streamID0, 0);
+    if (cdoVerbose)
+      cdoPrint("%d records input 3d vertical height\n",nrecs);
+    {
+      for ( recID = 0; recID < nrecs; recID++ )
+      {
+        streamInqRecord(streamID0, &varID, &levelID);
+        gridsize = gridInqSize(vlistInqVarGrid(vlistID0, varID));
+        offset   = gridsize + gridsize*levelID;
+        single1  = zlevels_in + offset;
+        streamReadRecord(streamID0, single1, &zlevels_in_miss);
+      }
+    }
+  }
+
+  /*
+   * Read 3d output coordinate (streamID2)
+   */
+  {
+    nvars = vlistNvars(vlistID2);
+    if (nvars != 1) cdoAbort("Only one single variable is allowed!");
+    gridID      = vlistInqVarGrid(vlistID2, varID);
+    zaxisID     = vlistInqVarZaxis(vlistID2, varID);
+    gridsize    = gridInqSize(gridID);
+    nlevel      = zaxisInqSize(zaxisID);
+
+    nlonOut = gridInqXsize(gridID);
+    nlatOut = gridInqYsize(gridID);
+    lonOut  = (double *) malloc(nlonOut*sizeof(double));
+    latOut  = (double *) malloc(nlatOut*sizeof(double));
+    gridInqXvals(gridID, lonOut);
+    gridInqYvals(gridID, latOut);
+
+    zlevels_out = (double *) malloc(gridsize*nlevel*sizeof(double));
+    nlevo       = nlevel;  /* number of output levels for later use */
+    gridsizeo   = gridsize;/* horizontal gridsize of output z coordinate */
+    nrecs       = streamInqTimestep(streamID2, 0);
+    if (cdoVerbose)
+      cdoPrint("%d records target 3d vertical height and gridsize %d\n",nrecs,gridsize);
+
+    for ( recID = 0; recID < nrecs; recID++ )
+    {
+      streamInqRecord(streamID2, &varID, &levelID);
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+      offset   = gridsize*levelID;
+      single1  = zlevels_out + offset;
+      streamReadRecord(streamID2, single1, &zlevels_out_miss);
+    }
+  }
+
+  /* Missing values are not allowed for coordinate variables */
+  if ( 0 != zlevels_in_miss  )
+    cdoAbort("Input vertical coordinate variables are not allowd to contian missing values.");
+  else
+    {
+      if ( cdoVerbose ) cdoPrint("Input vertical coordinate has no missing values.");
+    }
+  if ( 0 != zlevels_out_miss )
+    cdoAbort("Output vertical coordinate variables are not allowd to contian missing values.");
+  else
+    {
+      if ( cdoVerbose ) cdoPrint("Output vertical coordinate has no missing values.");
+    }
+
+
+  /*
+   * gridsize of input and output vertical coordinate must be equal
+   * (later use of gridsizeo ONLY)
+   */
+  if ( gridsizei != gridsizeo )
+    cdoAbort("Input and output vertical coordinate must have the same gridsize");
+   gridSize = gridsizeo;
+
+   /* input and output vertical coordinates must have exactly the same
+    * horizontal grid */
+   if ( nlonIn != nlonOut || 
+        nlatIn != nlatOut ||
+        memcmp(lonIn,lonOut,nlonIn*sizeof(double)) ||
+        memcmp(latIn,latOut,nlatIn*sizeof(double)) )
+     {
+       /* i =0; printf ( "lonIn:%g latIn:%g lonOut:%g latOut:%g\n",lonIn[i],latIn[i],lonOut[i],latOut[i] ); */
+       cdoAbort("Input and output vertical coordinates do NOT exactly have the same horizontal grid.");
+     }
+
+  /*
+   * Check for the correct vertical axis in the input: Variables with the same
+   * number of levels as the input vertical levels from operators parameter
+   * (streamID0). Variables with a different z-axis should be copied into output.
+   */
+  nzaxis  = vlistNzaxis(vlistID1);
+  for ( i = 0; i < nzaxis; i++ )
+  {
+    zaxisID = vlistZaxis(vlistID1, i);
+    nlevel  = zaxisInqSize(zaxisID);
+    if ( nlevel == nlevi )
+    {
+      zaxisID1 = zaxisID;
+      break;
+    }
+  }
+  if ( i == nzaxis ) cdoAbort("No processable variable found!");
+
+  /*
+   * Check monotony of vertical levels
+   */
+  lup = FALSE;
+  ldown = FALSE;
+  lev1 = zlevels_in + gridSize;
+  for ( i = 0; i < nlevi-1; i++ )
+    {
+      if ( i == 1 )
+	{
+	  if ( lev1[(i+1)*gridSize] > lev1[i*gridSize] )
+	    lup = TRUE;
+	  else if ( lev1[(i+1)*gridSize] < lev1[i*gridSize] )
+	    ldown = TRUE;	
+	}
+      else
+	{
+	  if ( lup )
+	    {
+	      if ( !(lev1[(i+1)*gridSize] > lev1[i*gridSize]) ) lup = FALSE;
+	    }
+	  else if ( ldown )
+	    {
+	      if ( !(lev1[(i+1)*gridSize] < lev1[i*gridSize]) ) ldown = FALSE;
+	    }
+	}
+    }
+
+  /* Add artificial values for intication of extrapolation areas (lowermost + upmost levels) */
+  if ( lup )
+    {
+      for ( i = 0; i < gridSize ;i++)
+      {
+        zlevels_in[i]                      = -1.e33;
+        zlevels_in[(nlevi+1)*gridSize + i] =  1.e33;
+      }
+    }
+  else if ( ldown )
+    {
+      for ( i = 0; i < gridSize ;i++)
+      {
+        zlevels_in[i]                      =  1.e33;
+        zlevels_in[(nlevi+1)*gridSize + i] = -1.e33;
+      }
+    }
+  else
+    cdoWarning("Non monotonic zaxis!");
+
+  /*
+   * Create weights for later interpolation - assumption: input vertical correct is constant in time
+   */
+  lev_idx1 = (int *)    malloc(nlevo*gridSize*sizeof(int));
+  lev_idx2 = (int *)    malloc(nlevo*gridSize*sizeof(int));
+  lev_wgt1 = (double *) malloc(nlevo*gridSize*sizeof(double));
+  lev_wgt2 = (double *) malloc(nlevo*gridSize*sizeof(double));
+
+  gen_weights3d(expol, nlevi+2, gridSize, zlevels_in, nlevo, zlevels_out, lev_idx1, lev_idx2, lev_wgt1, lev_wgt2);
+
+  /*
+   * Copy z-axis information to output z-axis
+   */
+  zaxisID3 = zaxisCreate(zaxisInqType(zaxisID1), nlevo);
+  lev2 = (double *) malloc(nlevo*sizeof(double));
+  /* fill values with its indices */
+  for (i=0;i<nlevo;i++)
+    lev2[i] = (double) i;
+  zaxisDefLevels(zaxisID3, lev2);
+  zaxisDefName(zaxisID3, "lev");
+  /*  copy VCT from input vlistID1 to output vlistID3 if there is one */
+  nvct = zaxisInqVctSize(zaxisID1);
+  if ( nvct > 0 ) zaxisDefVct(zaxisID3,zaxisInqVctSize(zaxisID1), zaxisInqVctPtr(zaxisID1));
+
+  for ( i = 0; i < nzaxis; i++ )
+    if ( zaxisID1 == vlistZaxis(vlistID1, i) )
+      vlistChangeZaxisIndex(vlistID3, i, zaxisID3);
+  /* add the vertical output field to the output stream */
+  int oz3dvarID = vlistDefVar(vlistID3,0,zaxisID3,TSTEP_INSTANT);
+  {
+    char str[256];
+    str[0] = 0;
+    vlistInqVarName(vlistID2,0,str);
+    vlistDefVarName(vlistID3,oz3dvarID,str);
+    str[0] = 0;
+    vlistInqVarLongname(vlistID2,0,str);
+    if ( str[0] ) vlistDefVarLongname(vlistID3,zaxisID1, str);
+    str[0] = 0;
+    vlistInqVarUnits(vlistID2,0, str);
+    if ( str[0] ) vlistDefVarUnits(vlistID3,oz3dvarID, str);
+  }
+
+  streamDefVlist(streamID3, vlistID3);
+
+  maxlev   = nlevi > nlevo ? nlevi : nlevo;
+  nvars     = vlistNvars(vlistID1);
+  vars      = (int *)     malloc(nvars*sizeof(int));
+  vardata1  = (double **) malloc(nvars*sizeof(double*)); /* input                                         */
+  vardata2  = (double **) malloc(nvars*sizeof(double*)); /* output                                        */
+  varnmiss  = (int **)    malloc(nvars*sizeof(int*));    /* can for missing values of arbitrary variables */
+  varinterp = (int *)     malloc(nvars*sizeof(int));     /* marker for variables to be interpolated       */
+
+  /* by default no variable should be interpolated */
+  for (i = 0; i < nvars;i++)
+    varinterp[varID] = FALSE;
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(zaxisID);
+
+      vlistInqVarName(vlistID1, varID, varname);
+
+      vardata1[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+
+      /*  variabls for interpolation:
+       *  * have the required vertical axis, i.e. the correct number of levels (nlevi)
+       *  * have the same number of horizontal grid points (i.e. same gridSize) like the two vertical coordinates
+       *  * are NOT the output vertical coordinates itself
+       */
+      if ( zaxisID == zaxisID1 && varID != oz3dvarID && gridsize == gridSize)
+        {
+          nlonIn  = gridInqXsize(gridID);
+          nlatIn  = gridInqYsize(gridID);
+          lonIn   = (double *) malloc(nlonIn*sizeof(double));
+          latIn   = (double *) malloc(nlatIn*sizeof(double));
+          gridInqXvals(gridID, lonIn);
+          gridInqYvals(gridID, latIn);
+
+          if ( nlonIn != nlonOut || 
+               nlatIn != nlatOut ||
+               memcmp(lonIn,lonOut,nlonIn*sizeof(double)) ||
+               memcmp(latIn,latOut,nlatIn*sizeof(double)) )
+            {
+              varinterp[varID] = FALSE;
+              vardata2[varID]  = vardata1[varID];
+              varnmiss[varID]  = (int *) malloc(nlevel*sizeof(int));
+              if ( cdoVerbose ) cdoPrint("Ignore variable %s with %d levels\n",varname,nlevel);
+            }
+          else
+            {
+              varinterp[varID] = TRUE;
+              vardata2[varID]  = (double *) malloc(gridsize*nlevo*sizeof(double));
+              varnmiss[varID]  = (int *) malloc(maxlev*sizeof(int));
+              memset(varnmiss[varID], 0, maxlev*sizeof(int));
+            }
+        }
+      else
+        {
+          varinterp[varID] = FALSE;
+          vardata2[varID]  = vardata1[varID];
+          varnmiss[varID]  = (int *) malloc(nlevel*sizeof(int));
+          if ( cdoVerbose ) cdoPrint("Ignore variable %s with %d levels\n",varname,nlevel);
+        }
+      }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      for ( varID = 0; varID < nvars; ++varID ) vars[varID] = FALSE;
+
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      /*
+       * Read the whole 3d data field
+       */
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+          vlistInqVarName(vlistID1, varID, varname); 
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single1  = vardata1[varID] + offset;
+          streamReadRecord(streamID1, single1, &varnmiss[varID][levelID]);
+	  vars[varID] = TRUE;
+	}
+
+      /* Perform the interpolation on all valid data variables */
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vars[varID] && varinterp[varID] )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      missval  = vlistInqVarMissval(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+
+	      interp_lev3d(gridsize, missval, vardata1[varID], vardata2[varID],
+			 nlevo, lev_idx1, lev_idx2, lev_wgt1, lev_wgt2);
+
+	      for ( levelID = 0; levelID < nlevo; levelID++ )
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistID3, varID));
+		  offset   = gridsize*levelID;
+		  single2  = vardata2[varID] + offset;
+		  nmiss    = 0;
+		  for ( i = 0; i < gridsize; ++i )
+		    if ( DBL_IS_EQUAL(single2[i], missval) ) nmiss++;
+		  varnmiss[varID][levelID] = nmiss;
+		}
+	    }
+          else
+          { 
+            vlistInqVarName(vlistID1, varID, varname); 
+            if ( cdoVerbose ) cdoPrint("Perform no interpolation on variable %s",varname);
+          }
+	}
+
+      /* write the output */
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vars[varID] )
+	    {
+	      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID3, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistID3, varID));
+		  offset   = gridsize*levelID;
+
+		  single2  = vardata2[varID] + offset;
+		  streamDefRecord(streamID3, varID, levelID);
+		  streamWriteRecord(streamID3, single2, varnmiss[varID][levelID]);
+
+		}
+	    }
+	}
+      /* copy output z coordinate to output stream */
+      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID3, oz3dvarID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+        {
+          gridsize = gridInqSize(vlistInqVarGrid(vlistID3, oz3dvarID));
+          offset   = gridsize*levelID;
+          single2  = zlevels_out + offset;
+          streamDefRecord(streamID3, oz3dvarID, levelID);
+          streamWriteRecord(streamID3, single2, 0);
+
+        }
+      tsID++;
+    }
+
+  nvars     = vlistNvars(vlistID1);
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      free(varnmiss[varID]);
+      free(vardata1[varID]);
+      if ( varinterp[varID] ) free(vardata2[varID]);
+    } 
+
+
+  free(varinterp);
+  free(varnmiss);
+  free(vardata2);
+  free(vardata1);
+  free(vars);
+
+  free(lev_idx1);
+  free(lev_idx2);
+  free(lev_wgt1);
+  free(lev_wgt2);
+
+  streamClose(streamID0);
+  streamClose(streamID1);
+  streamClose(streamID2);
+  streamClose(streamID3);
+
+  vlistDestroy(vlistID3);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Intntime.c b/src/Intntime.c
new file mode 100644
index 0000000..a1c624e
--- /dev/null
+++ b/src/Intntime.c
@@ -0,0 +1,267 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Intntime   intntime        Time interpolation
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "interpol.h"
+
+
+void *Intntime(void *argument)
+{
+  int streamID1, streamID2;
+  int nrecs, nvars, nlevel;
+  int i, nrecords;
+  int tsID, tsIDo, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int vdate, vtime;
+  int vdate1, vtime1;
+  int vdate2, vtime2;
+  int offset;
+  int calendar;
+  int numts, it;
+  int *recVarID, *recLevelID;
+  int **nmiss1, **nmiss2, nmiss3;
+  double missval1, missval2;
+  juldate_t juldate1, juldate2, juldate;
+  double fac1, fac2;
+  double *array, *single1, *single2;
+  double **vardata1, **vardata2, *vardatap;
+
+  cdoInitialize(argument);
+
+  operatorInputArg("number of timesteps between 2 timesteps");
+  if ( operatorArgc() < 1 ) cdoAbort("Too few arguments!");
+
+  numts = atoi(operatorArgv()[0]);
+  if ( numts < 2 ) cdoAbort("parameter must be greater than 1!");
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  nmiss1   = (int **) malloc(nvars*sizeof(int *));
+  nmiss2   = (int **) malloc(nvars*sizeof(int *));
+  vardata1 = (double **) malloc(nvars*sizeof(double *));
+  vardata2 = (double **) malloc(nvars*sizeof(double *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      nmiss1[varID]   = (int *) malloc(nlevel*sizeof(int));
+      nmiss2[varID]   = (int *) malloc(nlevel*sizeof(int));
+      vardata1[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+      vardata2[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+    }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID2) ) taxisDeleteBounds(taxisID2);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  calendar = taxisInqCalendar(taxisID1);
+
+  tsID = 0;
+  tsIDo = 0;
+  nrecs = streamInqTimestep(streamID1, tsID++);
+  vdate1 = taxisInqVdate(taxisID1);
+  vtime1 = taxisInqVtime(taxisID1);
+  juldate1 = juldate_encode(calendar, vdate1, vtime1);
+
+  taxisCopyTimestep(taxisID2, taxisID1);
+  streamDefTimestep(streamID2, tsIDo++);
+  for ( recID = 0; recID < nrecs; recID++ )
+    {
+      streamInqRecord(streamID1, &varID, &levelID);
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      offset   = gridsize*levelID;
+      single1  = vardata1[varID] + offset;
+      streamReadRecord(streamID1, single1, &nmiss1[varID][levelID]);
+
+      streamDefRecord(streamID2, varID, levelID);
+      streamWriteRecord(streamID2, single1, nmiss1[varID][levelID]);
+    }
+
+  while ( (nrecs = streamInqTimestep(streamID1, tsID++)) )
+    {
+      vdate2 = taxisInqVdate(taxisID1);
+      vtime2 = taxisInqVtime(taxisID1);
+      juldate2 = juldate_encode(calendar, vdate2, vtime2);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  recVarID[recID]   = varID;
+	  recLevelID[recID] = levelID;
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single2  = vardata2[varID] + offset;
+	  streamReadRecord(streamID1, single2, &nmiss2[varID][levelID]);
+	}
+
+      for ( it = 1; it < numts; it++ )
+	{
+	  double seconds;
+	  seconds = it * juldate_to_seconds(juldate_sub(juldate2, juldate1)) / numts;
+	  juldate = juldate_add_seconds(NINT(seconds), juldate1);
+
+	  juldate_decode(calendar, juldate, &vdate, &vtime);
+
+	  if ( cdoVerbose )
+	    {
+	      char vdatestr[32], vtimestr[32];	  
+	      /*
+		cdoPrint("juldate1 %f", juldate_to_seconds(juldate1));
+		cdoPrint("juldate  %f", juldate_to_seconds(juldate));
+		cdoPrint("juldate2 %f", juldate_to_seconds(juldate2));
+	      */
+	      date2str(vdate, vdatestr, sizeof(vdatestr));
+	      time2str(vtime, vtimestr, sizeof(vtimestr));
+	      cdoPrint("%s %s", vdatestr, vtimestr);
+	    }
+
+	  taxisDefVdate(taxisID2, vdate);
+	  taxisDefVtime(taxisID2, vtime);
+	  streamDefTimestep(streamID2, tsIDo++);
+
+	  fac1 = juldate_to_seconds(juldate_sub(juldate2, juldate)) / 
+	         juldate_to_seconds(juldate_sub(juldate2, juldate1));
+	  fac2 = juldate_to_seconds(juldate_sub(juldate,  juldate1)) / 
+	         juldate_to_seconds(juldate_sub(juldate2, juldate1));
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      varID    = recVarID[recID];
+	      levelID  = recLevelID[recID];
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      offset   = gridsize*levelID;
+	      single1  = vardata1[varID] + offset;
+	      single2  = vardata2[varID] + offset;
+
+	      nmiss3 = 0;
+
+	      if ( nmiss1[varID][levelID] > 0 || nmiss2[varID][levelID] > 0 )
+		{
+		  missval1 = vlistInqVarMissval(vlistID1, varID);
+		  missval2 = vlistInqVarMissval(vlistID2, varID);
+
+		  for ( i = 0; i < gridsize; i++ )
+		    {
+		      if ( !DBL_IS_EQUAL(single1[i], missval1) &&
+			   !DBL_IS_EQUAL(single2[i], missval2) )
+			array[i] = single1[i]*fac1 + single2[i]*fac2;
+		      else if ( DBL_IS_EQUAL(single1[i], missval1) &&
+				!DBL_IS_EQUAL(single2[i], missval2) && fac2 >= 0.5 )
+			array[i] = single2[i];
+		      else if ( DBL_IS_EQUAL(single2[i], missval2) &&
+				!DBL_IS_EQUAL(single1[i], missval1) && fac1 >= 0.5 )
+			array[i] = single1[i];
+		      else
+			{
+			  array[i] = missval1;
+			  nmiss3++;
+			}
+		    }
+		}
+	      else
+		{
+		  for ( i = 0; i < gridsize; i++ )
+		    array[i] = single1[i]*fac1 + single2[i]*fac2;
+		}
+
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, array, nmiss3);
+	    }
+	}
+
+      taxisDefVdate(taxisID2, vdate2);
+      taxisDefVtime(taxisID2, vtime2);
+      streamDefTimestep(streamID2, tsIDo++);
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  varID   = recVarID[recID];
+	  levelID = recLevelID[recID];
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  offset   = gridsize*levelID;
+	  single2  = vardata2[varID] + offset;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, single2, nmiss2[varID][levelID]);
+	}
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  vardatap        = vardata1[varID];
+	  vardata1[varID] = vardata2[varID];
+	  vardata2[varID] = vardatap;
+	}
+
+      vdate1 = vdate2;
+      vtime1 = vtime2;
+      juldate1 = juldate2;
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      free(nmiss1[varID]);
+      free(nmiss2[varID]);
+      free(vardata1[varID]);
+      free(vardata2[varID]);
+    }
+
+  free(nmiss1);
+  free(nmiss2);
+  free(vardata1);
+  free(vardata2);
+
+  if ( array )  free(array);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Inttime.c b/src/Inttime.c
new file mode 100644
index 0000000..98bf623
--- /dev/null
+++ b/src/Inttime.c
@@ -0,0 +1,333 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Inttime    inttime         Time interpolation
+*/
+
+#include <ctype.h>  /* isdigit */
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "interpol.h"
+
+
+int get_tunits(const char *unit, int *incperiod, int *incunit, int *tunit);
+
+
+void *Inttime(void *argument)
+{
+  int streamID1, streamID2 = -1;
+  int nrecs, nvars, nlevel;
+  int i, nrecords;
+  int tsID, tsIDo, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int vdate, vtime;
+  int offset;
+  int ijulinc, incperiod = 0, incunit = 3600, tunit = TUNIT_HOUR;
+  int calendar;
+  int year, month, day, hour, minute, second;
+  int *recVarID, *recLevelID;
+  int **nmiss1, **nmiss2, nmiss3;
+  const char *datestr, *timestr;
+  char *rstr;
+  double missval1, missval2;
+  juldate_t juldate1, juldate2, juldate;
+  double fac1, fac2;
+  double *array, *single1, *single2;
+  double **vardata1, **vardata2, *vardatap;
+
+  cdoInitialize(argument);
+
+  operatorInputArg("date,time<,increment> (format YYYY-MM-DD,hh:mm:ss)");
+  if ( operatorArgc() < 2 ) cdoAbort("Too few arguments!");
+
+  datestr = operatorArgv()[0];
+  timestr = operatorArgv()[1];
+
+  if ( strchr(datestr, '-') )
+    {
+      year = 1; month = 1; day = 1;
+      sscanf(datestr, "%d-%d-%d", &year, &month, &day);
+      vdate = cdiEncodeDate(year, month, day);
+    }
+  else
+    {
+      vdate = (int)strtol(datestr, &rstr, 10);
+      if ( *rstr != 0 ) cdoAbort("Parameter string contains invalid characters: %s", datestr);
+    }
+
+  if ( strchr(timestr, ':') )
+    {
+      hour = 0; minute = 0; second = 0;
+      sscanf(timestr, "%d:%d:%d", &hour, &minute, &second);
+      vtime = cdiEncodeTime(hour, minute, second);
+    }
+  else
+    {
+      vtime = (int)strtol(timestr, &rstr, 10);
+      if ( *rstr != 0 ) cdoAbort("Parameter string contains invalid characters: %s", timestr);
+    }
+
+  if ( operatorArgc() == 3 )
+    {
+      const char *timeunits = operatorArgv()[2];
+      incperiod = (int)strtol(timeunits, NULL, 10);;
+      while ( isdigit((int) *timeunits) ) timeunits++;
+
+      get_tunits(timeunits, &incperiod, &incunit, &tunit);
+    }
+  /* increment in seconds */
+  ijulinc = incperiod * incunit;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  if ( ijulinc == 0 ) vlistDefNtsteps(vlistID2, 1);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  nmiss1   = (int **) malloc(nvars*sizeof(int *));
+  nmiss2   = (int **) malloc(nvars*sizeof(int *));
+  vardata1 = (double **) malloc(nvars*sizeof(double *));
+  vardata2 = (double **) malloc(nvars*sizeof(double *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      nmiss1[varID]   = (int *) malloc(nlevel*sizeof(int));
+      nmiss2[varID]   = (int *) malloc(nlevel*sizeof(int));
+      vardata1[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+      vardata2[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+    }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID2) ) taxisDeleteBounds(taxisID2);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  calendar = taxisInqCalendar(taxisID1);
+
+  juldate = juldate_encode(calendar, vdate, vtime);
+
+  if ( cdoVerbose )
+    {
+      cdoPrint("date %d  time %d", vdate, vtime);
+      cdoPrint("juldate  = %f", juldate_to_seconds(juldate));
+      cdoPrint("ijulinc = %d", ijulinc);
+    }
+
+  tsID = 0;
+  nrecs = streamInqTimestep(streamID1, tsID++);
+  juldate1 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
+  for ( recID = 0; recID < nrecs; recID++ )
+    {
+      streamInqRecord(streamID1, &varID, &levelID);
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      offset   = gridsize*levelID;
+      single1  = vardata1[varID] + offset;
+      streamReadRecord(streamID1, single1, &nmiss1[varID][levelID]);
+    }
+
+  if ( cdoVerbose )
+    {
+      cdoPrint("date %d  time %d", taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
+      cdoPrint("juldate1  = %f", juldate_to_seconds(juldate1));
+    }
+
+  if ( juldate_to_seconds(juldate1) > juldate_to_seconds(juldate) )
+    cdoWarning("start time %d %d out of range!", vdate, vtime);
+
+  tsIDo = 0;
+  while ( juldate_to_seconds(juldate1) <= juldate_to_seconds(juldate) )
+    {
+      nrecs = streamInqTimestep(streamID1, tsID++);
+      if ( nrecs == 0 ) break;
+
+      juldate2 = juldate_encode(calendar, taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
+      if ( cdoVerbose )
+	{
+	  cdoPrint("date %d  time %d", taxisInqVdate(taxisID1), taxisInqVtime(taxisID1));
+	  cdoPrint("juldate2  = %f", juldate_to_seconds(juldate2));
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  recVarID[recID]   = varID;
+	  recLevelID[recID] = levelID;
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single2  = vardata2[varID] + offset;
+	  streamReadRecord(streamID1, single2, &nmiss2[varID][levelID]);
+	}
+
+      while ( juldate_to_seconds(juldate) < juldate_to_seconds(juldate2) )
+	{
+	  if ( juldate_to_seconds(juldate) >= juldate_to_seconds(juldate1) &&
+	       juldate_to_seconds(juldate) <  juldate_to_seconds(juldate2) )
+	    {
+	      juldate_decode(calendar, juldate, &vdate, &vtime);
+
+	      if ( cdoVerbose )
+		{
+		  char vdatestr[32], vtimestr[32];	  
+		  /*
+		  cdoPrint("juldate1 %f", juldate_to_seconds(juldate1));
+		  cdoPrint("juldate  %f", juldate_to_seconds(juldate));
+		  cdoPrint("juldate2 %f", juldate_to_seconds(juldate2));
+		  */
+		  date2str(vdate, vdatestr, sizeof(vdatestr));
+		  time2str(vtime, vtimestr, sizeof(vtimestr));
+		  cdoPrint("%s %s  %f  %d", vdatestr, vtimestr, juldate_to_seconds(juldate), calendar);
+		}
+
+	      if ( streamID2 == -1 )
+		{
+		  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+		  streamDefVlist(streamID2, vlistID2);
+		}
+
+	      taxisDefVdate(taxisID2, vdate);
+	      taxisDefVtime(taxisID2, vtime);
+	      streamDefTimestep(streamID2, tsIDo++);
+
+	      fac1 = juldate_to_seconds(juldate_sub(juldate2, juldate)) / 
+		     juldate_to_seconds(juldate_sub(juldate2, juldate1));
+	      fac2 = juldate_to_seconds(juldate_sub(juldate, juldate1)) / 
+	   	     juldate_to_seconds(juldate_sub(juldate2, juldate1));
+
+	      for ( recID = 0; recID < nrecs; recID++ )
+		{
+		  varID    = recVarID[recID];
+		  levelID  = recLevelID[recID];
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+		  offset   = gridsize*levelID;
+		  single1  = vardata1[varID] + offset;
+		  single2  = vardata2[varID] + offset;
+
+		  nmiss3 = 0;
+
+		  if ( nmiss1[varID][levelID] > 0 || nmiss2[varID][levelID] > 0 )
+		    {
+		      missval1 = vlistInqVarMissval(vlistID1, varID);
+		      missval2 = vlistInqVarMissval(vlistID2, varID);
+
+		      for ( i = 0; i < gridsize; i++ )
+			{
+			  if ( !DBL_IS_EQUAL(single1[i], missval1) &&
+			       !DBL_IS_EQUAL(single2[i], missval2) )
+			    array[i] = single1[i]*fac1 + single2[i]*fac2;
+			  else if (  DBL_IS_EQUAL(single1[i], missval1) &&
+				    !DBL_IS_EQUAL(single2[i], missval2) && fac2 >= 0.5 )
+			    array[i] = single2[i];
+			  else if (  DBL_IS_EQUAL(single2[i], missval2) &&
+				    !DBL_IS_EQUAL(single1[i], missval1) && fac1 >= 0.5 )
+			    array[i] = single1[i];
+			  else
+			    {
+			      array[i] = missval1;
+			      nmiss3++;
+			    }
+			}
+		    }
+		  else
+		    {
+		      for ( i = 0; i < gridsize; i++ )
+			array[i] = single1[i]*fac1 + single2[i]*fac2;
+		    }
+
+		  streamDefRecord(streamID2, varID, levelID);
+		  streamWriteRecord(streamID2, array, nmiss3);
+		}
+	    }
+
+	  if ( ijulinc == 0 ) break;
+
+	  if ( tunit == TUNIT_MONTH || tunit == TUNIT_YEAR )
+	    {
+	      juldate_decode(calendar, juldate, &vdate, &vtime);
+
+	      cdiDecodeDate(vdate, &year, &month, &day);
+	      
+	      month += ijulinc;
+
+	      while ( month > 12 ) { month -= 12; year++; }
+	      while ( month <  1 ) { month += 12; year--; }
+
+	      vdate = cdiEncodeDate(year, month, day);
+		
+	      juldate = juldate_encode(calendar, vdate, vtime);
+	    }
+	  else
+	    {
+	      juldate = juldate_add_seconds(ijulinc, juldate);
+	    }
+	}
+
+      juldate1 = juldate2;
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  vardatap        = vardata1[varID];
+	  vardata1[varID] = vardata2[varID];
+	  vardata2[varID] = vardatap;
+	}
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      free(nmiss1[varID]);
+      free(nmiss2[varID]);
+      free(vardata1[varID]);
+      free(vardata2[varID]);
+    }
+
+  free(nmiss1);
+  free(nmiss2);
+  free(vardata1);
+  free(vardata2);
+
+  if ( array )  free(array);
+
+  if ( streamID2 != -1 ) streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( tsIDo == 0 ) cdoWarning("date/time out of time axis, no time step interpolated!");
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Intyear.c b/src/Intyear.c
new file mode 100644
index 0000000..b1c0b15
--- /dev/null
+++ b/src/Intyear.c
@@ -0,0 +1,199 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Intyear    intyear         Year interpolation
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "interpol.h"
+#include "list.h"
+
+
+void *Intyear(void *argument)
+{
+  int streamID1, streamID2;
+  int nrecs;
+  int i, iy;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2, vlistID3;
+  int taxisID1, taxisID2, taxisID3;
+  int vtime, vdate1, vdate2, vdate3, year1, year2;
+  int nmiss1, nmiss2, nmiss3;
+  int *iyears, nyears = 0, *streamIDs = NULL;
+  int nchars;
+  char filesuffix[32];
+  char filename[8192];
+  double fac1, fac2;
+  double missval1, missval2;
+  double *array1, *array2, *array3;
+  LIST *ilist = listNew(INT_LIST);
+
+  cdoInitialize(argument);
+
+  operatorInputArg("years");
+
+  nyears = args2intlist(operatorArgc(), operatorArgv(), ilist);
+
+  iyears = (int *) listArrayPtr(ilist);
+
+  streamIDs = (int *) malloc(nyears*sizeof(int));
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+  array3 = (double *) malloc(gridsize*sizeof(double));
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID3) ) taxisDeleteBounds(taxisID3);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  strcpy(filename, cdoStreamName(2));
+  nchars = strlen(filename);
+
+  filesuffix[0] = 0;
+  cdoGenFileSuffix(filesuffix, sizeof(filesuffix), cdoDefaultFileType, vlistID1);
+
+  for ( iy = 0; iy < nyears; iy++ )
+    {
+      sprintf(filename+nchars, "%04d", iyears[iy]);
+      if ( filesuffix[0] )
+	sprintf(filename+nchars+4, "%s", filesuffix);
+      /*	  printf("filename %s\n", filename); */
+      streamIDs[iy] = streamOpenWrite(filename, cdoFiletype());
+
+      streamDefVlist(streamIDs[iy], vlistID3);
+    }
+
+  tsID = 0;
+  while ( TRUE )
+    {
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 ) break;
+      nrecs = streamInqTimestep(streamID2, tsID);
+      if ( nrecs == 0 ) cdoAbort("Too few timesteps in second inputfile!");
+
+      vtime  = taxisInqVtime(taxisID1);
+      vdate1 = taxisInqVdate(taxisID1);
+      year1  = vdate1/10000;
+      vdate2 = taxisInqVdate(taxisID2);
+      year2  = vdate2/10000;
+
+      for ( iy = 0; iy < nyears; iy++ )
+	{
+	  if ( iyears[iy] < year1 || iyears[iy] > year2 )
+	    cdoAbort("Year %d out of bounds (first year %d; last year %d)!",
+		     iyears[iy], year1, year2);
+	  vdate3 = vdate1 - year1*10000 + iyears[iy]*10000;
+	  taxisDefVdate(taxisID3, vdate3);
+	  taxisDefVtime(taxisID3, vtime);
+	  streamDefTimestep(streamIDs[iy], tsID);
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamInqRecord(streamID2, &varID, &levelID);
+
+	  streamReadRecord(streamID1, array1, &nmiss1);
+	  streamReadRecord(streamID2, array2, &nmiss2);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  for ( iy = 0; iy < nyears; iy++ )
+	    {
+	      fac1 = ((double) year2-iyears[iy]) / (year2-year1);
+	      fac2 = ((double) iyears[iy]-year1) / (year2-year1);
+
+	      nmiss3 = 0;
+
+	      if ( nmiss1 > 0 || nmiss2 > 0 )
+		{
+		  missval1 = vlistInqVarMissval(vlistID1, varID);
+		  missval2 = vlistInqVarMissval(vlistID2, varID);
+
+		  for ( i = 0; i < gridsize; i++ )
+		    {
+		      if ( !DBL_IS_EQUAL(array1[i], missval1) &&
+			   !DBL_IS_EQUAL(array2[i], missval2) )
+			array3[i] = array1[i]*fac1 + array2[i]*fac2;
+		      /* 2010-04-19 Uwe Schulzweida: removed 
+		      else if ( DBL_IS_EQUAL(array1[i], missval1) &&
+				!DBL_IS_EQUAL(array2[i], missval2) && fac2 >= 0.5 )
+			array3[i] = array2[i];
+		      else if ( DBL_IS_EQUAL(array2[i], missval2) &&
+				!DBL_IS_EQUAL(array1[i], missval1) && fac1 >= 0.5 )
+			array3[i] = array1[i];
+		      */
+		      else
+			{
+			  array3[i] = missval1;
+			  nmiss3++;
+			}
+		    }
+		}
+	      else
+		{
+		  for ( i = 0; i < gridsize; i++ )
+		    array3[i] = array1[i]*fac1 + array2[i]*fac2;
+		}
+
+	      streamDefRecord(streamIDs[iy], varID, levelID);
+	      streamWriteRecord(streamIDs[iy], array3, nmiss3);
+	    }
+	}
+
+      tsID++;
+    }
+
+  for ( iy = 0; iy < nyears; iy++ )
+    streamClose(streamIDs[iy]);
+  
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array3 )  free(array3);
+  if ( array2 )  free(array2);
+  if ( array1 )  free(array1);
+
+  free(streamIDs);
+
+  listDelete(ilist);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Invert.c b/src/Invert.c
new file mode 100644
index 0000000..24f7c6b
--- /dev/null
+++ b/src/Invert.c
@@ -0,0 +1,414 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Invert     invertlat       Invert latitude
+      Invert     invertlon       Invert longitude
+      Invert     invertlatdes    Invert latitude description
+      Invert     invertlondes    Invert longitude description
+      Invert     invertlatdata   Invert latitude data
+      Invert     invertlondata   Invert longitude data
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "error.h"
+
+
+static
+void invertLonDes(int vlistID)
+{
+  int index, ngrids;
+  int gridID1, gridID2;
+  int nlat, nlon, size;
+  int ilat, ilon;
+  int gridtype, nv, iv;
+  double *xv1, *xv2;
+  double *xb1, *xb2;
+
+  ngrids = vlistNgrids(vlistID);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID1 = vlistGrid(vlistID, index);
+      gridID2 = gridDuplicate(gridID1);
+
+      gridtype = gridInqType(gridID1);
+
+      if ( gridtype != GRID_GENERIC && gridtype != GRID_GAUSSIAN &&
+	   gridtype != GRID_LONLAT  && gridtype != GRID_CURVILINEAR )
+	cdoAbort("Unsupported gridtype!");
+
+      if ( gridInqXvals(gridID1, NULL) )
+	{
+	  nlon  = gridInqXsize(gridID1);
+	  nlat  = gridInqYsize(gridID1);
+
+	  if ( gridtype == GRID_CURVILINEAR )
+	    size = nlon*nlat;
+	  else
+            size = nlon;
+
+	  xv1 = (double *) malloc(size*sizeof(double));
+	  xv2 = (double *) malloc(size*sizeof(double));
+
+	  gridInqXvals(gridID1, xv1);
+
+	  if ( gridtype == GRID_CURVILINEAR )
+	    {
+	      for ( ilat = 0; ilat < nlat; ilat++ )
+		for ( ilon = 0; ilon < nlon; ilon++ )
+		  xv2[ilat*nlon + nlon-ilon-1] = xv1[ilat*nlon + ilon];
+	    }
+	  else
+	    {
+	      for ( ilon = 0; ilon < nlon; ilon++ )
+		xv2[nlon-ilon-1] = xv1[ilon];
+	    }
+
+	  gridDefXvals(gridID2, xv2);
+
+	  if ( xv2 ) free(xv2);
+	  if ( xv1 ) free(xv1);
+	}
+
+      if ( gridInqXbounds(gridID1, NULL) )
+	{
+	  nlon  = gridInqXsize(gridID1);
+	  nlat  = gridInqYsize(gridID1);
+
+	  nv = gridInqNvertex(gridID1);
+
+	  if ( gridtype == GRID_CURVILINEAR )
+	    size = nv*nlon*nlat;
+	  else
+            size = nv*nlon;
+
+	  xb1 = (double *) malloc(size*sizeof(double));
+	  xb2 = (double *) malloc(size*sizeof(double));
+
+	  gridInqXbounds(gridID1, xb1);
+
+	  if ( gridtype == GRID_CURVILINEAR )
+	    {
+	      for ( ilat = 0; ilat < nlat; ilat++ )
+		for ( ilon = 0; ilon < nlon; ilon++ )
+		  for ( iv = 0; iv < nv; iv++ )
+		    xb2[ilat*nlon*nv + (nlon-ilon-1)*nv + iv] = xb1[ilat*nlon*nv + ilon*nv + iv];
+	    }
+	  else
+	    {
+		for ( ilon = 0; ilon < nlon; ilon++ )
+		  {
+		    xb2[nlon*2-ilon*2-1] = xb1[ilon*2];
+		    xb2[nlon*2-ilon*2-2] = xb1[ilon*2+1];
+		  }
+	    }
+
+	  gridDefXbounds(gridID2, xb2);
+
+	  if ( xb2 ) free(xb2);
+	  if ( xb1 ) free(xb1);
+	}
+
+      vlistChangeGrid(vlistID, gridID1, gridID2);
+    }
+}
+
+static
+void invertLatDes(int vlistID)
+{
+  int index, ngrids;
+  int gridID1, gridID2;
+  int nlat, nlon, size;
+  int ilat, ilon;
+  int gridtype, nv, iv;
+  double *yv1, *yv2;
+  double *yb1, *yb2;
+
+  ngrids = vlistNgrids(vlistID);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID1 = vlistGrid(vlistID, index);
+      gridID2 = gridDuplicate(gridID1);
+
+      gridtype = gridInqType(gridID1);
+
+      if ( gridtype != GRID_GENERIC && gridtype != GRID_GAUSSIAN &&
+	   gridtype != GRID_LONLAT  && gridtype != GRID_CURVILINEAR )
+	cdoAbort("Unsupported gridtype!");
+
+      if ( gridInqYvals(gridID1, NULL) )
+	{
+	  nlon  = gridInqXsize(gridID1);
+	  nlat  = gridInqYsize(gridID1);
+
+	  if ( gridtype == GRID_CURVILINEAR )
+	    size = nlon*nlat;
+	  else
+            size = nlat;
+
+	  yv1 = (double *) malloc(size*sizeof(double));
+	  yv2 = (double *) malloc(size*sizeof(double));
+
+
+	  if ( gridtype == GRID_CURVILINEAR )
+	    {
+	      gridInqXvals(gridID1, yv1);
+
+	      for ( ilat = 0; ilat < nlat; ilat++ )
+		for ( ilon = 0; ilon < nlon; ilon++ )
+		  yv2[(nlat-ilat-1)*nlon + ilon] = yv1[ilat*nlon + ilon];
+
+	      gridDefXvals(gridID2, yv2);
+
+	      gridInqYvals(gridID1, yv1);
+
+	      for ( ilat = 0; ilat < nlat; ilat++ )
+		for ( ilon = 0; ilon < nlon; ilon++ )
+		  yv2[(nlat-ilat-1)*nlon + ilon] = yv1[ilat*nlon + ilon];
+
+	      gridDefYvals(gridID2, yv2);
+	    }
+	  else
+	    {
+	      gridInqYvals(gridID1, yv1);
+
+	      for ( ilat = 0; ilat < nlat; ilat++ )
+		yv2[nlat-ilat-1] = yv1[ilat];
+
+	      gridDefYvals(gridID2, yv2);
+	    }
+
+	  if ( yv2 ) free(yv2);
+	  if ( yv1 ) free(yv1);
+	}
+
+      if ( gridInqYbounds(gridID1, NULL) )
+	{
+	  nlon  = gridInqXsize(gridID1);
+	  nlat  = gridInqYsize(gridID1);
+
+	  nv = gridInqNvertex(gridID1);
+
+	  if ( gridtype == GRID_CURVILINEAR )
+	    size = nv*nlon*nlat;
+	  else
+            size = nv*nlat;
+
+	  yb1 = (double *) malloc(size*sizeof(double));
+	  yb2 = (double *) malloc(size*sizeof(double));
+
+	  gridInqYbounds(gridID1, yb1);
+
+	  if ( gridtype == GRID_CURVILINEAR )
+	    {
+	      for ( ilat = 0; ilat < nlat; ilat++ )
+		for ( ilon = 0; ilon < nlon; ilon++ )
+		  for ( iv = 0; iv < nv; iv++ )
+		    yb2[(nlat-ilat-1)*nlon*nv + ilon*nv + iv] = yb1[ilat*nlon*nv + ilon*nv + iv];
+	    }
+	  else
+	    {
+		for ( ilat = 0; ilat < nlat; ilat++ )
+		  {
+		    yb2[nlat*2-ilat*2-1] = yb1[ilat*2];
+		    yb2[nlat*2-ilat*2-2] = yb1[ilat*2+1];
+		  }
+	    }
+
+	  gridDefYbounds(gridID2, yb2);
+
+	  if ( yb2 ) free(yb2);
+	  if ( yb1 ) free(yb1);
+	}
+
+      vlistChangeGrid(vlistID, gridID1, gridID2);
+    }
+}
+
+static
+void invertLonData(double *array1, double *array2, int gridID1)
+{
+  int nlat, nlon;
+  int ilat, ilon;
+  double **field1, **field2;
+
+  nlon = gridInqXsize(gridID1);
+  nlat = gridInqYsize(gridID1);
+
+  if ( nlat > 0 )
+    {
+      field1 = (double **) malloc(nlat*sizeof(double *));
+      field2 = (double **) malloc(nlat*sizeof(double *));
+  
+      for ( ilat = 0; ilat < nlat; ilat++ )
+	{
+	  field1[ilat] = array1 + ilat*nlon;
+	  field2[ilat] = array2 + ilat*nlon;
+	}
+
+      for ( ilat = 0; ilat < nlat; ilat++ )
+	for ( ilon = 0; ilon < nlon; ilon++ )
+	  field2[ilat][nlon-ilon-1] = field1[ilat][ilon];
+  
+      if ( field1 ) free(field1);
+      if ( field2 ) free(field2);
+    }
+  else
+    {
+      array2[0] = array1[0];
+    }
+}
+
+static
+void invertLatData(double *array1, double *array2, int gridID1)
+{
+  int nlat, nlon;
+  int ilat;
+  double **field1, **field2;
+
+  nlon = gridInqXsize(gridID1);
+  nlat = gridInqYsize(gridID1);
+
+  if ( nlat > 0 )
+    {
+      field1 = (double **) malloc(nlat*sizeof(double *));
+      field2 = (double **) malloc(nlat*sizeof(double *));
+  
+      for ( ilat = 0; ilat < nlat; ilat++ )
+	{
+	  field1[ilat] = array1 + ilat*nlon;
+	  field2[ilat] = array2 + ilat*nlon;
+	}
+
+      for ( ilat = 0; ilat < nlat; ilat++ )
+	memcpy(field2[nlat-ilat-1], field1[ilat], nlon*sizeof(double));
+      
+      if ( field1 ) free(field1);
+      if ( field2 ) free(field2);
+    }
+  else
+    {
+      array2[0] = array1[0];
+    }
+}
+
+
+void *Invert(void *argument)
+{
+  int INVERTLAT, INVERTLON, INVERTLATDES, INVERTLONDES, INVERTLATDATA, INVERTLONDATA;
+  int operatorID;
+  int operfunc1, operfunc2;
+  int streamID1, streamID2;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2;
+  int gridID1;
+  int nmiss;
+  double *array1, *array2;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  INVERTLAT     = cdoOperatorAdd("invertlat",     func_all, 0, NULL);
+  INVERTLON     = cdoOperatorAdd("invertlon",     func_all, 0, NULL);
+  INVERTLATDES  = cdoOperatorAdd("invertlatdes",  func_hrd, 0, NULL);
+  INVERTLONDES  = cdoOperatorAdd("invertlondes",  func_hrd, 0, NULL);
+  INVERTLATDATA = cdoOperatorAdd("invertlatdata", func_fld, 0, NULL);
+  INVERTLONDATA = cdoOperatorAdd("invertlondata", func_fld, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc1 = cdoOperatorF1(operatorID);
+  if ( operatorID == INVERTLAT || operatorID == INVERTLATDES || operatorID == INVERTLATDATA )
+    operfunc2 = func_lat;
+  else
+    operfunc2 = func_lon;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  if ( operfunc1 == func_all || operfunc1 == func_hrd )
+    {
+      if ( operfunc2 == func_lat )
+	invertLatDes(vlistID2);
+      else
+	invertLonDes(vlistID2);
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  streamDefRecord(streamID2, varID, levelID);
+
+	  if ( operfunc1 == func_all || operfunc1 == func_fld )
+	    {
+	      gridID1 = vlistInqVarGrid(vlistID1, varID);
+
+	      if ( operfunc2 == func_lat )
+		invertLatData(array1, array2, gridID1);
+	      else
+		invertLonData(array1, array2, gridID1);
+
+	      streamWriteRecord(streamID2, array2, nmiss);     
+	    }
+	  else
+	    {
+	      streamWriteRecord(streamID2, array1, nmiss);     
+	    }
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Invertlev.c b/src/Invertlev.c
new file mode 100644
index 0000000..ab85616
--- /dev/null
+++ b/src/Invertlev.c
@@ -0,0 +1,251 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Invertlev     invertlev       Invert level
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "error.h"
+
+
+
+static
+void invertLevDes(int vlistID)
+{
+  int index, nzaxis;
+  int zaxisID1, zaxisID2;
+  int nlev;
+  int ilev;
+  int zaxistype;
+  double *yv1, *yv2;
+  double *yb1, *yb2;
+
+  nzaxis = vlistNzaxis(vlistID);
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      zaxisID1 = vlistZaxis(vlistID, index);
+      zaxisID2 = zaxisDuplicate(zaxisID1);
+
+      zaxistype = zaxisInqType(zaxisID1);
+
+      nlev = zaxisInqSize(zaxisID1);
+
+      if ( nlev < 2 || zaxistype == ZAXIS_HYBRID || zaxistype == ZAXIS_HYBRID_HALF ) continue;
+
+      /* if ( zaxisInqLevels(zaxisID1, NULL) ) */
+	{
+
+	  yv1 = (double *) malloc(nlev*sizeof(double));
+	  yv2 = (double *) malloc(nlev*sizeof(double));
+
+	  zaxisInqLevels(zaxisID1, yv1);
+	  for ( ilev = 0; ilev < nlev; ++ilev ) yv2[nlev-ilev-1] = yv1[ilev];
+	  zaxisDefLevels(zaxisID2, yv2);
+
+	  if ( yv2 ) free(yv2);
+	  if ( yv1 ) free(yv1);
+	}
+
+      if ( zaxisInqLbounds(zaxisID1, NULL) && zaxisInqUbounds(zaxisID1, NULL) )
+	{
+	  yb1 = (double *) malloc(nlev*sizeof(double));
+	  yb2 = (double *) malloc(nlev*sizeof(double));
+
+	  zaxisInqLbounds(zaxisID1, yb1);
+	  for ( ilev = 0; ilev < nlev; ++ilev ) yb2[nlev-ilev-1] = yb1[ilev];
+	  zaxisDefLbounds(zaxisID2, yb2);
+
+	  zaxisInqUbounds(zaxisID1, yb1);
+	  for ( ilev = 0; ilev < nlev; ++ilev ) yb2[nlev-ilev-1] = yb1[ilev];
+	  zaxisDefUbounds(zaxisID2, yb2);
+
+	  if ( yb2 ) free(yb2);
+	  if ( yb1 ) free(yb1);
+	}
+
+      vlistChangeZaxis(vlistID, zaxisID1, zaxisID2);
+    }
+}
+
+
+void *Invertlev(void *argument)
+{
+  int INVERTLEV;
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2;
+  int nrecs, nvars;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2;
+  int nmiss;
+  int **varnmiss;
+  double *array;
+  double **vardata;
+  int taxisID1, taxisID2;
+  int lcopy = FALSE;
+  int nlev, nlevel;
+  int gridID, zaxisID, zaxistype, offset;
+  int linvert = FALSE;
+
+  cdoInitialize(argument);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  INVERTLEV     = cdoOperatorAdd("invertlev",     func_all, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc   = cdoOperatorF1(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  if ( operfunc == func_all || operfunc == func_hrd )
+    {
+      invertLevDes(vlistID2);
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  nvars = vlistNvars(vlistID1);
+
+  vardata  = (double **) malloc(nvars*sizeof(double*));
+  varnmiss = (int **) malloc(nvars*sizeof(int*));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID    = vlistInqVarGrid(vlistID1, varID);
+      zaxisID   = vlistInqVarZaxis(vlistID1, varID);
+      gridsize  = gridInqSize(gridID);
+      zaxistype = zaxisInqType(zaxisID);
+      nlev      = zaxisInqSize(zaxisID);
+
+      if ( nlev < 2 || zaxistype == ZAXIS_HYBRID || zaxistype == ZAXIS_HYBRID_HALF )
+	{
+	  vardata[varID]  = NULL;
+	  varnmiss[varID] = NULL;
+	}
+      else
+	{
+	  linvert = TRUE;
+	  vardata[varID]  = (double *) malloc(gridsize*nlev*sizeof(double));
+	  varnmiss[varID] = (int *) malloc(nlev*sizeof(int));
+	}
+    }
+
+  if ( linvert == FALSE ) cdoWarning("No variables with invertable levels found!");
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( vardata[varID] )
+	    {    
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlevel   = zaxisInqSize(zaxisID);
+	      offset   = gridsize*levelID;
+
+	      streamReadRecord(streamID1, vardata[varID]+offset, &nmiss);
+	      varnmiss[varID][levelID] = nmiss;
+	    }
+	  else
+	    {
+	      streamDefRecord(streamID2, varID, levelID);
+	      if ( lcopy )
+		{
+		  streamCopyRecord(streamID2, streamID1); 
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array, &nmiss);
+		  streamWriteRecord(streamID2, array, nmiss);
+		}
+	    }
+	}
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vardata[varID] )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlevel   = zaxisInqSize(zaxisID);
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  streamDefRecord(streamID2, varID, levelID);
+
+		  offset   = gridsize*(nlevel-levelID-1);
+
+		  nmiss = varnmiss[varID][nlevel-levelID-1];
+
+		  streamWriteRecord(streamID2, vardata[varID]+offset, nmiss);
+		}   
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array ) free(array);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( vardata[varID] )
+	{
+	  free(varnmiss[varID]);
+	  free(vardata[varID]);
+	}
+    }
+
+  free(varnmiss);
+  free(vardata);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Isosurface.c b/src/Isosurface.c
new file mode 100644
index 0000000..9e181c6
--- /dev/null
+++ b/src/Isosurface.c
@@ -0,0 +1,259 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+double intlin(double x, double y1, double x1, double y2, double x2);
+
+static
+void isosurface(double isoval, long nlev1, double *lev1, field_t *field3D, field_t *field2D)
+{
+  long i, k, gridsize, nmiss;
+  int lmiss1, lmiss2;
+  double missval, val1, val2;
+  double *data2D, *data3D;
+
+  gridsize = gridInqSize(field3D->grid);
+  nmiss    = field3D->nmiss;
+  missval  = field3D->missval;
+  data3D   = field3D->ptr;
+  data2D   = field2D->ptr;
+
+  for ( i = 0; i < gridsize; ++i )
+    {
+      data2D[i] = missval;
+
+      for ( k = 0; k < (nlev1-1); ++k )
+	{
+	  val1 = data3D[k*gridsize+i];
+	  val2 = data3D[(k+1)*gridsize+i];
+
+	  if ( nmiss > 0 )
+	    {
+	      lmiss1 = DBL_IS_EQUAL(val1, missval);
+	      lmiss2 = DBL_IS_EQUAL(val2, missval);
+	      if ( lmiss1 && lmiss2 ) continue;
+	      if ( lmiss1 && IS_EQUAL(isoval, val2) ) data2D[i] = lev1[k+1];
+	      if ( lmiss2 && IS_EQUAL(isoval, val1) ) data2D[i] = lev1[k]  ;
+	      if ( lmiss1 || lmiss2 ) continue;
+	    }
+
+	  if ( (isoval >= val1 && isoval <= val2) || (isoval >= val2 && isoval <= val1) )
+	    {
+	      if ( IS_EQUAL(val1, val2) )
+		data2D[i] = lev1[k];
+	      else
+		data2D[i] = intlin(isoval, lev1[k], val1, lev1[k+1], val2);
+
+	      break;
+	    }
+	}
+    }
+
+  nmiss = 0;
+  for ( i = 0; i < gridsize; ++i )
+    if ( DBL_IS_EQUAL(data2D[i], missval) ) nmiss++;
+
+  field2D->missval = missval;
+  field2D->nmiss   = nmiss;
+}
+
+
+void *Isosurface(void *argument)
+{
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridsize, nlevel = 0;
+  int recID, nrecs;
+  int gridID;
+  int nlev1;
+  int i, offset;
+  int tsID, varID, levelID;
+  int nmiss, nvars;
+  int zaxisID, zaxisID1 = -1, zaxisIDsfc, nzaxis;
+  double missval;
+  double isoval = 0;
+  int *vars = NULL;
+  int *liso = NULL;
+  field_t *vars1 = NULL;
+  field_t field;
+  double *lev1;
+  double *single;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  operatorInputArg("isoval");
+
+  operatorCheckArgc(1);
+
+  isoval = atof(operatorArgv()[0]);
+
+  if ( cdoVerbose ) cdoPrint("Isoval: %g\n", isoval);
+
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nzaxis  = vlistNzaxis(vlistID1);
+  for ( i = 0; i < nzaxis; i++ )
+    {
+      zaxisID = vlistZaxis(vlistID1, i);
+      nlevel  = zaxisInqSize(zaxisID);
+      if ( zaxisInqType(zaxisID) != ZAXIS_HYBRID && zaxisInqType(zaxisID) != ZAXIS_HYBRID_HALF )
+	if ( nlevel > 1 )
+	  {
+	    zaxisID1 = zaxisID;
+	    break;
+	  }
+    }
+
+  if ( i == nzaxis ) cdoAbort("No processable variable found!");
+
+  nlev1 = nlevel;
+  lev1  = (double *) malloc((nlev1)*sizeof(double));
+  zaxisInqLevels(zaxisID1, lev1);
+
+  zaxisIDsfc = zaxisCreate(ZAXIS_SURFACE, 1);
+  for ( i = 0; i < nzaxis; i++ )
+    if ( zaxisID1 == vlistZaxis(vlistID1, i) )
+      vlistChangeZaxisIndex(vlistID2, i, zaxisIDsfc);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  nvars = vlistNvars(vlistID1);
+
+  liso  =     (int *) malloc(nvars*sizeof(int));
+  vars  =     (int *) malloc(nvars*sizeof(int));
+  vars1 = (field_t *) malloc(nvars*sizeof(field_t));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(zaxisID);
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      if ( zaxisID == zaxisID1 )
+	liso[varID] = TRUE;
+      else 
+	liso[varID] = FALSE;
+
+      vars1[varID].grid    = gridID;
+      vars1[varID].zaxis   = zaxisID;
+      vars1[varID].nmiss   = 0;
+      vars1[varID].missval = missval;
+      vars1[varID].ptr     = (double *) malloc(gridsize*nlevel*sizeof(double));
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  vars[varID] = FALSE;
+	  vars1[varID].nmiss = 0;
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single   = vars1[varID].ptr + offset;
+	  
+	  streamReadRecord(streamID1, single, &nmiss);
+	  vars1[varID].nmiss += nmiss;
+	  vars[varID] = TRUE;
+	}
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vars[varID] )
+	    {
+	      if ( liso )
+		{
+		  isosurface(isoval, nlev1, lev1, &vars1[varID], &field);
+
+		  streamDefRecord(streamID2, varID, 0);
+		  streamWriteRecord(streamID2, field.ptr, field.nmiss);
+		}
+	      else
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+		  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+		  missval  = vlistInqVarMissval(vlistID2, varID);
+
+		  for ( levelID = 0; levelID < nlevel; levelID++ )
+		    {
+		      offset   = gridsize*levelID;
+		      single   = vars1[varID].ptr + offset;
+
+		      nmiss = 0;
+		      for ( i = 0; i < gridsize; ++i )
+			if ( DBL_IS_EQUAL(single[i], missval) ) nmiss++;
+
+		      streamDefRecord(streamID2, varID, levelID);
+		      streamWriteRecord(streamID2, single, nmiss);
+		    }
+		}
+	    }
+	}
+
+      tsID++;
+    }
+
+  for ( varID = 0; varID < nvars; varID++ ) free(vars1[varID].ptr);
+  free(vars1);
+
+  free(vars);
+  free(liso);
+  if (lev1) free(lev1);
+
+  free(field.ptr);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Kvl.c b/src/Kvl.c
new file mode 100644
index 0000000..8e253f6
--- /dev/null
+++ b/src/Kvl.c
@@ -0,0 +1,200 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+#include "cdo.h"
+#include "cdo_int.h"
+#include "kvlist.h"
+
+
+static
+int read_cmor_table(const char *filename)
+{
+  void *kvlist;
+  int nlists, listID;
+  int nelements, elemID;
+  const char *listname;
+  const char *ename;
+  const char *evalue;
+
+  kvlist = kvlParseFile(filename);
+  nlists = kvlGetNumLists(kvlist);
+  printf("# Number of lists: %d\n", nlists);
+  for ( listID = 0; listID < nlists; ++listID )
+    {
+      listname = kvlGetListName(kvlist, listID);
+      nelements = kvlGetListNumElements(kvlist, listID);
+      printf("# list ID: %d;   Number of elements: %d\n", listID, nelements);
+      printf("&%s\n", listname);
+      for ( elemID = 0; elemID < nelements; ++elemID )
+	{
+	  ename  = kvlGetListElementName(kvlist, listID, elemID);
+	  evalue = kvlGetListElementValue(kvlist, listID, elemID);
+	  printf("  %s = %s\n", ename, evalue);
+	}
+      printf("/\n");
+    }
+
+  kvlDelete(kvlist);
+
+  return (0);
+}
+
+static
+int conv_cmor_table(const char *filename)
+{
+  void *kvlist;
+  int nlists, listID;
+  int nelements, elemID;
+  int len;
+  int hasmissval = FALSE;
+  double missval;
+  const char *listname;
+  const char *ename;
+  const char *evalue;
+  char *ovalue;
+
+  kvlist = kvlParseFile(filename);
+  nlists = kvlGetNumLists(kvlist);
+  //printf("# Number of lists: %d\n", nlists);
+  for ( listID = 0; listID < nlists; ++listID )
+    {
+      listname = kvlGetListName(kvlist, listID);
+      nelements = kvlGetListNumElements(kvlist, listID);
+      //printf("# list ID: %d;   Number of elements: %d\n", listID, nelements);
+      if ( strncmp("global", listname, strlen(listname)) == 0 )
+	{
+	  for ( elemID = 0; elemID < nelements; ++elemID )
+	    {
+	      ename  = kvlGetListElementName(kvlist, listID, elemID);
+	      evalue = kvlGetListElementValue(kvlist, listID, elemID);
+	      len = strlen(ename);
+
+	      if ( strncmp("missing_value", ename, len) == 0 )
+		{
+		  missval = atof(evalue);
+		  hasmissval = TRUE;
+		}
+	    }
+	}
+      else if ( strncmp("variable", listname, strlen(listname)) == 0 )
+	{
+	  int vlen;
+	  printf("&%s\n", "parameter");
+	  for ( elemID = 0; elemID < nelements; ++elemID )
+	    {
+	      ename  = kvlGetListElementName(kvlist, listID, elemID);
+	      evalue = kvlGetListElementValue(kvlist, listID, elemID);
+	      len = strlen(ename);
+	      vlen = strlen(evalue);
+
+	      if ( vlen > 1 && evalue[0] == '"' && evalue[vlen-1] == '"' ) 
+		{
+		  vlen -= 2;
+		  evalue++;
+		}
+
+	      ovalue = strdup(evalue);
+	      for ( int i = 1; i < vlen; ++i )
+		{
+		  if ( ovalue[i-1] == '"' && ovalue[i] == '"' )
+		    {
+		      ovalue [i-1] = '\'';
+		      for ( int j = i+1; j < vlen; ++j ) ovalue[j-1] = ovalue[j];
+		      vlen -= 1;
+		    }
+		}
+
+	      if ( strncmp("name", ename, len)            == 0 ||
+		   strncmp("standard_name", ename, len)   == 0 ||
+		   strncmp("out_name", ename, len)        == 0 ||
+		   strncmp("type", ename, len)            == 0 ||
+		   strncmp("valid_min", ename, len)       == 0 ||
+		   strncmp("valid_max", ename, len)       == 0 ||
+		   strncmp("ok_min_mean_abs", ename, len) == 0 ||
+		   strncmp("ok_max_mean_abs", ename, len) == 0 )
+		printf("  %-15s = %s\n", ename, ovalue);
+	      else if ( strncmp("long_name", ename, len)  == 0 ||
+		   strncmp("units", ename, len)           == 0 ||
+		   strncmp("cell_methods", ename, len)    == 0 ||
+		   strncmp("cell_measures", ename, len)   == 0 ||
+		   strncmp("comment", ename, len)         == 0 )
+		printf("  %-15s = \"%.*s\"\n", ename, vlen, ovalue);
+
+	      free(ovalue);
+	    }
+	  if ( hasmissval ) printf("  %-15s = %g\n", "missing_value", missval);
+	  printf("/\n");
+	}
+    }
+
+  kvlDelete(kvlist);
+
+  return (0);
+}
+
+
+void *Kvl(void *argument)
+{
+  int READ_CMOR_TABLE, CONV_CMOR_TABLE, CONV_PARTAB;
+  int operatorID;
+  const char *filename;
+
+  cdoInitialize(argument);
+
+  READ_CMOR_TABLE = cdoOperatorAdd("read_cmor_table",   0,   0, NULL);
+  CONV_CMOR_TABLE = cdoOperatorAdd("conv_cmor_table",   0,   0, NULL);
+  CONV_PARTAB     = cdoOperatorAdd("conv_partab",   0,   0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == READ_CMOR_TABLE )
+    {
+      if ( operatorArgc() != 1 ) cdoAbort("Too few arguments!");
+      filename = operatorArgv()[0];
+
+      if ( cdoVerbose ) cdoPrint("Parse file: %s\n", filename);
+
+      read_cmor_table(filename);
+    }
+  else if ( operatorID == CONV_CMOR_TABLE )
+    {
+      if ( operatorArgc() != 1 ) cdoAbort("Too few arguments!");
+      filename = operatorArgv()[0];
+
+      if ( cdoVerbose ) cdoPrint("Parse file: %s\n", filename);
+
+      conv_cmor_table(filename);
+    }
+  else if ( operatorID == CONV_PARTAB )
+    {
+      if ( operatorArgc() != 1 ) cdoAbort("Too few arguments!");
+      filename = operatorArgv()[0];
+
+      if ( cdoVerbose ) cdoPrint("Parse file: %s\n", filename);
+
+      // conv_partab(filename);
+    }
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Log.c b/src/Log.c
new file mode 100644
index 0000000..ce4dfd9
--- /dev/null
+++ b/src/Log.c
@@ -0,0 +1,73 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include "cdo.h"
+#include "cdo_int.h"
+
+void dumplogs(const char *logfilename);
+void daylogs(const char *logfilename);
+void monlogs(const char *logfilename);
+void dumplogo(const char *logfilename, int dumptype);
+
+
+void *Log(void *argument)
+{
+  int DUMPLOGS, DAYLOGS, MONLOGS, DUMPLOGO;
+  int SNAMELOGO, SCALLLOGO, SMEMLOGO, STIMELOGO, SPERCLOGO;
+  int operatorID, operfunc;
+  int dumptype;
+
+  cdoInitialize(argument);
+
+  DUMPLOGS  = cdoOperatorAdd("dumplogs",   0, 0, NULL);
+  DAYLOGS   = cdoOperatorAdd("daylogs",    0, 0, NULL);
+  MONLOGS   = cdoOperatorAdd("monlogs",    0, 0, NULL);
+  DUMPLOGO  = cdoOperatorAdd("dumplogo",   1, 0, NULL);
+  SNAMELOGO = cdoOperatorAdd("snamelogo",  1, 1, NULL);
+  SCALLLOGO = cdoOperatorAdd("scalllogo",  1, 2, NULL);
+  SMEMLOGO  = cdoOperatorAdd("smemlogo",   1, 3, NULL);
+  STIMELOGO = cdoOperatorAdd("stimelogo",  1, 4, NULL);
+  SPERCLOGO = cdoOperatorAdd("sperclogo",  1, 5, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc   = cdoOperatorF1(operatorID);
+  dumptype   = cdoOperatorF2(operatorID);
+
+  if ( cdoStreamName(0)[0] == '-' )
+    cdoAbort("This operator does not work with pipes!");
+
+  if ( operatorID == DUMPLOGS )
+    {
+      dumplogs(cdoStreamName(0));
+    }
+  else if ( operatorID == DAYLOGS )
+    {
+      daylogs(cdoStreamName(0));
+    }
+  else if ( operatorID == MONLOGS )
+    {
+      monlogs(cdoStreamName(0));
+    }
+  else if ( operfunc == 1 )
+    {
+      dumplogo(cdoStreamName(0), dumptype);
+    }
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Maggraph.c b/src/Maggraph.c
new file mode 100644
index 0000000..a43307d
--- /dev/null
+++ b/src/Maggraph.c
@@ -0,0 +1,1042 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h" /* HAVE_LIBMAGICS */
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "grid.h"
+#include "pstream.h"
+
+#if  defined  (HAVE_LIBMAGICS)
+#include "magics_api.h"
+#endif
+
+
+#if  defined  (HAVE_LIBXML2)
+
+#include<libxml/parser.h>
+#include<libxml/tree.h>
+#include "template_parser.h"
+#include "magics_template_parser.h"
+#include "results_template_parser.h"
+#include <ctype.h>
+
+
+extern xmlNode  *magics_node;
+
+#endif
+
+#define DBG 0
+
+
+char *line_colours[] = {     "red", "green", "blue", "yellow", "cyan", "magenta",
+			     "avocado","beige", "brick", "brown", "burgundy",
+			     "charcoal", "chestnut", "coral", "cream", 
+			     "evergreen", "gold", 
+			     "khaki", "kellygreen", "lavender",
+			     "mustard", "navy", "ochre", "olive",
+			     "peach", "pink", "rose", "rust", "sky",
+			     "tan", "tangerine","turquoise",
+			     "violet", "reddishpurple",
+			     "purplered", "purplishred",
+			     "orangishred", "redorange", "reddishorange",
+			     "orange", "yellowishorange",
+			     "orangeyellow", "orangishyellow", 
+			     "greenishyellow", "yellowgreen",
+			     "yellowishgreen", "bluishgreen",
+			     "bluegreen", "greenishblue",
+			     "purplishblue", "bluepurple",
+			     "bluishpurple", "purple",
+			};
+
+char  *graph_params[] = {"ymin","ymax","sigma","stat","obsv","device"};
+
+int graph_param_count = sizeof(graph_params)/sizeof(char*);
+int num_colours = sizeof( line_colours )/sizeof( char* );
+
+void VerifyGraphParameters( int num_param, char **param_names );
+int compareDateOrTimeStr( char *datetimestr1, char *datetimestr2, char *sep_char );
+
+extern int checkdevice();
+extern int IsNumeric();
+extern void StrToUpperCase();
+extern int StringSplitWithSeperator();
+
+extern char *DEVICE;
+extern char *DEVICE_TABLE;
+extern int DEVICE_COUNT;
+
+
+static
+void maggraph(const char *plotfile, const char *varname,const char *varunits, long nfiles, long *nts, int **vdate, int **vtime, double **datatab, int nparam, char **params)
+{
+  
+  char *lines[1];
+  char *temp_str;
+  char **split_str = NULL;
+  char *sep_char = "=";
+  char **date_time_str[nfiles];
+  char min_date_time_str[1024], max_date_time_str[1024];
+  int  min_index, max_index;
+  char vdatestr[32], vtimestr[32], legend_text_data[256];
+  char vdatestr1[32], vtimestr1[32];
+  char vdatestr2[32], vtimestr2[32];
+  int num_sigma = 2;
+  int stat = FALSE, obsv = FALSE;
+  int split_str_count;
+  int file_begin = 0;
+  int count ;
+  int num_years = 0, num_months = 0, num_days = 0;
+  int ret;
+  long tsID, fileID, i, ntime_steps;
+  double *date_time;
+  double min_val = 1.0e+200, max_val = -1.0e+200;
+  double *mean_val, *std_dev_val;
+  double *spread_min, *spread_max;
+  double y_min_val = 1.0e+200, y_max_val = -1.0e+200;
+  
+  if( DBG )
+    {
+      fprintf(stderr, "Num params %d\n", nparam);
+  
+      for( i = 0; i< nparam; i++ )
+	fprintf(stderr, "Param %s\n", params[i]);
+    }
+  
+  for( i = 0; i < nparam; ++i )
+    {
+      split_str_count = 0;
+      sep_char = "=";
+      split_str_count = StringSplitWithSeperator( params[i], sep_char, &split_str );
+      
+      if( !strcmp( split_str[0],"obsv" ) ) 
+	{  
+	  temp_str = strdup( split_str[1] );    
+	  StrToUpperCase( temp_str );
+	  if( !strcmp( temp_str, "TRUE" ) )
+	    {
+	      obsv = TRUE;
+	      file_begin = 1;
+	      if( DBG )
+		fprintf( stderr,"OBSV TRUE\n" );
+	    }
+	}
+	
+      if( !strcmp( split_str[0],"stat" ) ) 
+	{  
+	  temp_str = strdup( split_str[1] );    
+	  StrToUpperCase( temp_str );
+	  
+	  if( !strcmp( temp_str, "TRUE" ) )
+	    {
+	      stat = TRUE;
+	      if( DBG )
+		fprintf(stderr,"STAT TRUE\n");
+	    }
+	}
+	
+      if( !strcmp( split_str[0],"ymin" ) )
+	{
+	  y_min_val = atof( split_str[1] );
+	  if( DBG )
+	    fprintf(stderr,"Y min Val %g\n",y_min_val);
+	}
+	
+      if( !strcmp( split_str[0],"ymax" ) )
+	{
+	  y_max_val = atof( split_str[1] );
+	  if( DBG )
+	    fprintf(stderr,"Y max Val %g\n",y_max_val);
+	}
+	
+      if( !strcmp( split_str[0],"sigma" ) )
+	{
+	  num_sigma = atof( split_str[1] );
+	  if( DBG )
+	    fprintf(stderr,"SIGMA %d\n",num_sigma);
+	}   
+	
+      if( !strcmp( split_str[0],"device" ) ) 
+	{  
+	  temp_str = strdup( split_str[1] );    
+	  StrToUpperCase( temp_str );
+	  DEVICE = temp_str;
+	  if( DBG )
+	    fprintf( stderr,"DEVICE %s\n",DEVICE );
+	  
+	  mag_setc ("output_format", DEVICE );
+	}
+	
+      free( split_str );
+    }
+
+  if ( DBG )
+    {
+      ntime_steps = nts[0];
+      fprintf(stderr," %ld %ld\n", nfiles, ntime_steps );
+      fprintf(stderr,"STAT  %d\n", stat );
+    }
+    
+  if ( stat == TRUE )
+    {
+        ntime_steps = nts[0];
+	/* First date & time of first file */
+	date2str( vdate[0][0],          vdatestr1, sizeof( vdatestr ) );
+	date2str( vdate[0][ nts[0]-1 ], vdatestr2, sizeof( vdatestr ) );	
+	
+	/* Last date & time of first file */
+	time2str( vtime[0][0],          vtimestr1, sizeof( vtimestr ) );
+	time2str( vtime[0][ nts[0]-1 ], vtimestr2, sizeof( vtimestr ) );
+	
+	
+	for ( fileID = 1; fileID < nfiles; fileID++ )
+	  {
+	    if ( nts[ fileID ] != ntime_steps )
+	      {
+		cdoWarning("  Unequal number of time steps! Statistics disabled.");
+		stat = FALSE;
+		break;
+	      }
+	    
+	    /* First date & time of the present file */
+	    date2str( vdate[ fileID ][0], vdatestr, sizeof( vdatestr ) );
+	    sep_char = "-";
+	    ret = compareDateOrTimeStr( vdatestr, vdatestr1, sep_char );
+	    if( ret )
+	      {
+		cdoWarning("  Incosistent start date! Statistics disabled.");
+		stat = FALSE;
+		break;
+	      }
+	      
+	    /* First time of the present file */	
+	    time2str( vtime[ fileID ][0], vtimestr, sizeof( vtimestr ) );  
+	    sep_char = ":";
+	    ret = compareDateOrTimeStr( vtimestr, vtimestr1, sep_char );
+	    if( ret )
+	      {
+		cdoWarning("  Incosistent start time! Statistics disabled.");
+		stat = FALSE;
+		break;
+	      }
+	      
+	     /* Last date of the present file */
+	    date2str( vdate[ fileID ][ nts[ fileID ]-1 ], vdatestr, sizeof( vdatestr ) );
+	    sep_char = "-";
+	    ret = compareDateOrTimeStr( vdatestr, vdatestr2, sep_char );
+	    if( ret )
+	      {
+		cdoWarning("  Incosistent end date! Statistics disabled.");
+		stat = FALSE;
+		break;
+	      }
+	      
+	    /* Last time of the present file */	
+	    time2str( vtime[ fileID ][ nts[ fileID ]-1 ], vtimestr, sizeof( vtimestr ) );  
+	    sep_char = ":";
+	    ret = compareDateOrTimeStr( vtimestr, vtimestr2, sep_char );
+	    if( ret )
+	      {
+		cdoWarning("  Incosistent end time! Statistics disabled.");
+		stat = FALSE;
+		break;
+	      } 
+	  }
+    }
+    
+  if ( DBG )
+    {
+      fprintf(stderr,"STAT  %d\n", stat );
+    }
+    
+  
+  if ( stat == TRUE )
+    {
+	/* if all files are of same number of steps, only one date_time_str array is being used */
+        date_time_str[0] = (char **)malloc( ntime_steps*sizeof(char *) ); 
+	
+	date_time   = (double *) malloc( ntime_steps*sizeof(double) );
+	mean_val    = (double *) malloc( ntime_steps*sizeof(double) );
+	std_dev_val = (double *) malloc( ntime_steps*sizeof(double) );
+	spread_min  = (double *) malloc( ntime_steps*sizeof(double) );
+	spread_max  = (double *) malloc( ntime_steps*sizeof(double) );
+	
+	for ( tsID = 0; tsID < ntime_steps; ++tsID )
+	  {
+	    date_time[tsID] = tsID+1;
+	    date2str(vdate[0][tsID], vdatestr, sizeof(vdatestr));
+	    time2str(vtime[0][tsID], vtimestr, sizeof(vtimestr));
+	    date_time_str[0][tsID] = (char *)malloc(256);
+	    sprintf(date_time_str[0][tsID], "%s %s", vdatestr, vtimestr);
+	    mean_val[tsID] = 0.;
+	    std_dev_val[tsID] = 0.;
+
+	    if( DBG )
+	      {
+		fprintf(stderr,"%ld: %s\n", tsID, date_time_str[0][tsID]);
+		fprintf(stderr,"%6d %6d", vdate[0][tsID], vtime[0][tsID]);
+	      }
+	
+	    for ( fileID = 0; fileID < nfiles; ++fileID )
+	      {
+		if( DBG )
+		  fprintf( stderr,"%ld\n", fileID );
+		
+		if( datatab[fileID][tsID] < min_val )
+		  min_val = datatab[ fileID ][ tsID ];	
+		if( datatab[fileID][tsID] > max_val )
+		  max_val = datatab[ fileID ][ tsID ];	
+	  
+		mean_val[tsID] += datatab[fileID][tsID];
+		std_dev_val[tsID] = 0.;
+		spread_min[tsID] = 0.;
+		spread_max[tsID] = 0.;
+
+		if( DBG )
+		  {
+		    fprintf(stderr," %6g", datatab[fileID][tsID]);
+		    fprintf(stderr,"\n");
+		  }
+	      }
+	  }
+	  
+	for ( tsID = 0; tsID < ntime_steps; ++tsID )
+	  {
+	    mean_val[tsID] /= ( double )nfiles;
+	    spread_min[tsID] = mean_val[tsID];
+	    spread_max[tsID] = mean_val[tsID];
+
+	    for ( fileID = 0; fileID < nfiles; ++fileID )
+	      {
+		std_dev_val[tsID] += ( datatab[fileID][tsID]-mean_val[tsID] ) * ( datatab[fileID][tsID]-mean_val[tsID] );
+	      }
+	    std_dev_val[tsID] /= ( double )nfiles;
+	    std_dev_val[tsID] = pow( std_dev_val[tsID], 0.5 ); 
+      
+	    if( DBG )
+	      fprintf(stderr," Mean : %g Std Dev: %g\n",mean_val[tsID],std_dev_val[tsID] ); 
+
+	    spread_min[tsID] = mean_val[tsID] - num_sigma * std_dev_val[tsID];
+	    spread_max[tsID] = mean_val[tsID] + num_sigma * std_dev_val[tsID];
+	
+	    if( DBG )
+	      fprintf(stderr," Min : %g Max: %g\n",spread_min[tsID],spread_max[tsID] ); 
+	  }
+
+	for ( tsID = 0; tsID < ntime_steps; ++tsID )
+	  {
+	      if( spread_min[tsID] < min_val )
+		  min_val = spread_min[ tsID ];	
+	      if( spread_max[tsID] > max_val )
+		  max_val = spread_max[ tsID ];	
+	  }
+	  
+	if( DBG )
+	  {
+	    fprintf(stderr," %6g %6g\n", min_val, max_val );
+	    fprintf(stderr," %s %s\n", date_time_str[0][0], date_time_str[0][ ntime_steps-1 ] );
+	    fprintf(stderr,"\n");
+	  }
+
+	strcpy( min_date_time_str,date_time_str[0][0] );
+	strcpy( max_date_time_str,date_time_str[0][ ntime_steps - 1 ] );
+    }
+    else
+    {
+      /* Find the min_date_time_str from the min's of nfiles
+         Find the max_date_time_str from the max's of nfiles
+         Construct the date_time_str array
+      */
+      
+      if ( DBG )
+	  fprintf(stderr,"STAT  %d\n", stat );
+	
+      for ( fileID = 0; fileID < nfiles; fileID++ )
+	{
+	  if ( DBG )
+	    fprintf(stderr,"FILE  %ld\n", fileID );
+	  date_time             = (double *) malloc( nts[fileID]*sizeof(double) );
+	  date_time_str[fileID] = (char **)malloc( nts[fileID]*sizeof(char *) );
+	  
+	  for ( tsID = 0; tsID <  nts[fileID]; ++tsID )
+	    {
+	      date_time[tsID] = tsID+1;
+	      date2str(vdate[fileID][tsID], vdatestr, sizeof(vdatestr));
+	      time2str(vtime[fileID][tsID], vtimestr, sizeof(vtimestr));
+	      
+	      date_time_str[fileID][tsID] = (char *)malloc(256);
+	      sprintf(date_time_str[fileID][tsID], "%s %s", vdatestr, vtimestr);
+	      if ( DBG )
+		fprintf( stderr,"%s %s %s\n", vdatestr, vtimestr, date_time_str[fileID][tsID] );
+	      
+	      if( datatab[fileID][tsID] < min_val )
+	        min_val = datatab[ fileID ][ tsID ];	
+	      if( datatab[fileID][tsID] > max_val )
+	        max_val = datatab[ fileID ][ tsID ];	
+	    }
+	  free( date_time );
+	  
+	  if( fileID == 0 )
+	    {
+	      if ( DBG )
+		fprintf( stderr,"\n %s %s\n", date_time_str[ fileID ][0], date_time_str[ fileID ][ nts[0]-1 ] );
+	      min_index = 0;
+	      max_index = 0;
+	    }
+	  else
+	    {
+	      if ( DBG )
+		fprintf( stderr,"compareDateOrTimeStr %s\n", date_time_str[ fileID ][0] );
+	      date2str( vdate[ min_index ][0], vdatestr1, sizeof( vdatestr ) );
+	      date2str( vdate[ fileID ][0]   , vdatestr2, sizeof( vdatestr ) );	
+	      sep_char = "-";
+	      ret = compareDateOrTimeStr( vdatestr1, vdatestr2, sep_char );
+	      if ( ret == -999 )
+		cdoAbort("Error in input Date Time");
+	      else if( ret == 1 )
+		min_index = fileID;
+	      else if( !ret )
+	      {
+		time2str( vtime[ min_index ][0], vtimestr1, sizeof( vtimestr ) );
+		time2str( vtime[ fileID ][0]   , vtimestr2, sizeof( vtimestr ) );
+		sep_char = ":";
+		ret = compareDateOrTimeStr( vtimestr1, vtimestr2, sep_char );
+					   
+		if ( ret == -999 )
+		  cdoAbort("Error in input Date Time");
+		else if( ret == 1 )
+		  min_index = fileID;			      
+					   
+	      }
+	      if ( DBG )
+		fprintf( stderr,"Min File ID %d\n",min_index);
+	      
+	      
+	      if ( DBG )
+		fprintf( stderr,"compareDateOrTimeStr  %s\n", date_time_str[ fileID ][ nts[ fileID ]-1 ] );
+	      
+	      date2str( vdate[ max_index ][ nts[ max_index ]-1 ], vdatestr1, sizeof( vdatestr ) );
+	      date2str( vdate[ fileID ][ nts[ fileID ]-1 ]   , vdatestr2, sizeof( vdatestr ) );
+	      sep_char = "-";
+	      ret = compareDateOrTimeStr( vdatestr1, vdatestr2, sep_char );
+					 
+	      if ( ret == -999 )
+		cdoAbort( "Error in input Date Time" );
+	      else if( ret == -1 )
+		max_index = fileID;
+	      else if( !ret )
+	      {
+		time2str( vtime[ max_index ][ nts[ max_index ]-1 ], vtimestr1, sizeof( vtimestr ) );
+		time2str( vtime[ fileID ][ nts[ fileID ]-1 ]   , vtimestr2, sizeof( vtimestr ) );
+		sep_char = ":";
+		ret = compareDateOrTimeStr( vtimestr1, vtimestr2, sep_char );
+					   
+		if ( ret == -999 )
+		  cdoAbort("Error in input Date Time");
+		else if( ret == -1 )
+		  max_index = fileID;			      
+	      }
+
+            if( DBG )
+	      fprintf( stderr,"Max File ID %d\n",max_index);
+
+	    }
+	}
+	
+	strcpy( min_date_time_str, date_time_str[ min_index ][0] );
+	strcpy( max_date_time_str, date_time_str[ max_index ][ nts[ max_index ]-1 ] );
+	if ( DBG )
+	  fprintf( stderr,"%s %s\n",min_date_time_str, max_date_time_str );
+    }
+    
+    if ( DBG )
+      fprintf( stderr,"%s %s\n",min_date_time_str,max_date_time_str );
+
+    split_str_count = 0;
+    sep_char = "-";
+    split_str_count = StringSplitWithSeperator( max_date_time_str, sep_char, &split_str );
+    num_years  = atoi( split_str[0] );
+    num_months = atoi( split_str[1] );
+    num_days   = atoi( split_str[2] );
+    free( split_str  );
+    
+    split_str_count = StringSplitWithSeperator( min_date_time_str, sep_char, &split_str );
+    num_years -= atoi( split_str[0] );
+
+    if( num_years <= 1 )
+      {
+	if( num_years == 1 )
+	  num_months += ( 12 - atoi( split_str[1] ) );
+	else
+	  num_months -= ( atoi( split_str[1] ) );
+	
+	if( !num_months )
+	  num_days -= atoi( split_str[2] );
+	else if( num_months == 1 )
+	  num_days += ( 31- atoi( split_str[2] ) );
+      }
+    free( split_str );
+    
+    if( DBG )
+      fprintf(stderr," %d %d\n", num_years, num_months );
+
+  /* 
+	1. Loop over the Files
+	2. Loop over the number of time steps 
+	3. Set the attributes for the magics data and plot
+  */  
+   
+#if  defined  (HAVE_LIBMAGICS)
+
+
+  /* magics_template_parser( magics_node ); */
+
+  mag_setc("output_name", plotfile);
+  mag_setc("subpage_map_projection", "cartesian"); 
+  mag_setr("subpage_y_length", 14.);
+  mag_setr("subpage_y_position", 1.5);
+
+
+  /* Horizontal Axis attributes */
+  mag_setc("axis_orientation","horizontal");
+  mag_setc("axis_grid", "on");
+  mag_setc("axis_grid_colour", "grey");
+  mag_seti("axis_grid_thickness", 1);
+  mag_setc("axis_grid_line_style", "dot");
+  mag_setc("axis_type", "date");
+  
+  if( num_years > 1 )
+    mag_setc("axis_date_type", "years");
+  else if( num_years <= 1 )
+    {
+      if( num_months > 1 )
+	mag_setc("axis_date_type", "months");
+      else
+	{
+	  if( num_months == 1 )
+	    mag_setc("axis_date_type", "days");
+	  else
+	    {
+	      if( num_days )
+		mag_setc("axis_date_type", "days");
+	      else
+		mag_setc("axis_date_type", "hours");
+	    }
+	}
+    }
+  
+  
+  mag_setc("axis_date_min_value", min_date_time_str);
+  mag_setc("axis_date_max_value", max_date_time_str);
+  mag_setc("axis_title_text","Time");
+  mag_setc("axis_title_orientation","horizontal");
+  mag_axis();
+
+  /* Vertical Axis attributes */
+  mag_setc("axis_orientation", "vertical");
+  mag_setc("axis_grid", "on");
+  mag_setc("axis_type", "regular");
+  mag_setc("axis_grid_colour", "grey");
+  mag_seti("axis_grid_thickness", 1);
+  mag_setc("axis_grid_line_style", "dot");
+
+  /*  To redefine the y- axis scale based on user input in .xml file */
+
+  /* min & max values from the input data files */
+  mag_setr("axis_min_value", min_val);
+  mag_setr("axis_max_value", max_val);
+  
+  /* min & max values specified by the user in the command line args */
+  if( y_min_val < 1.0e+200 )
+    mag_setr("axis_min_value", y_min_val);
+  
+  if( y_max_val > -1.0e+200)
+    mag_setr("axis_max_value", y_max_val);
+  
+  mag_setc("axis_title_text",varname);
+  
+  mag_setc("axis_title_orientation","vertical");
+  mag_axis();
+ 
+
+  /* Legend */
+  mag_setc("legend", "on");
+  mag_setc("legend_text_colour", "black");
+
+  mag_setc("graph_symbol","off");
+  mag_seti("graph_line_thickness", 8 );
+  
+  if( DBG )
+    fprintf(stderr, "FILE BEGIN %d\n", file_begin );
+  
+  for ( i = file_begin; i < nfiles; ++i )
+    {
+      count = i; 
+      if( obsv == TRUE )
+	count = i -1;
+      if( DBG )
+	fprintf(stderr, "Current File %ld\n", i );
+      /*sprintf(legend_text_data, "ens_%d", count + 1);*/
+      sprintf(legend_text_data, "data_%d", count + 1);
+      mag_setc("graph_line_colour", line_colours[ count%num_colours ]);
+      mag_setc("legend_user_text", legend_text_data);
+      if( stat == TRUE )
+	mag_set1c("graph_curve_date_x_values",(const char**)date_time_str[0], ntime_steps);
+      else
+	mag_set1c("graph_curve_date_x_values",(const char**)date_time_str[i], nts[i]);
+      mag_set1r("graph_curve_y_values", datatab[i], nts[i]);
+      mag_graph ();
+    }
+      
+  if( obsv == TRUE )
+    {
+      mag_setc("graph_line_colour", "black");
+      sprintf(legend_text_data, "%s","Obsv" );
+      mag_setc("legend_user_text", legend_text_data);
+      mag_set1c("graph_curve_date_x_values",(const char**)date_time_str[0], nts[0]);
+      mag_set1r("graph_curve_y_values", datatab[0], nts[0]);
+      mag_setc("graph_line_style", "dot" );
+      mag_seti("graph_line_thickness", 10 );
+      mag_graph ();
+    }
+    
+  if( DBG )
+	fprintf(stderr, "NTIME STEPS %ld\n", ntime_steps ); 
+
+  if( stat == TRUE )
+    {
+      if( DBG )
+	fprintf(stderr, "NTIME STEPS %ld\n", ntime_steps );
+      
+      mag_seti("graph_line_thickness", 8 );
+      mag_setc("graph_line_colour", "grey" );
+      mag_setc("graph_line_style", "dash" );
+      mag_set1c("graph_curve_date_x_values", (const char**)date_time_str[0], ntime_steps);
+      mag_set1r("graph_curve_y_values",mean_val, ntime_steps);
+      sprintf(legend_text_data, "Mean");
+      mag_setc("legend_user_text", legend_text_data);
+      mag_graph ();
+
+      mag_reset("graph_type");
+      mag_setc("graph_type", "area");
+      mag_seti("graph_line_thickness", 1 );
+      mag_setc("graph_shade_style", "dot");
+      mag_setr("graph_shade_dot_size",1.);
+      mag_set1c("graph_curve2_date_x_values", (const char**)date_time_str[0], ntime_steps);
+      mag_set1r("graph_curve2_y_values",spread_max, ntime_steps);
+      mag_set1c("graph_curve_date_x_values", (const char**)date_time_str[0], ntime_steps);
+      mag_set1r("graph_curve_y_values",spread_min, ntime_steps);
+      mag_setc("graph_shade_colour", "grey");
+      sprintf(legend_text_data, "%dSigma", num_sigma);
+      mag_setc("legend_user_text", legend_text_data);
+      mag_graph ();
+    }
+  
+  
+  lines[0] = (char *)malloc(1024);
+  /* To be obtained from Meta Data */
+  /*sprintf( lines[0],"%s","ExpID : " );*/ 
+  /*sprintf( lines[0],"%sxxxx  Variable : %s[%s]",lines[0], varname, varunits );*/
+  // sprintf( lines[0],"Variable : %s[%s]",varname, varunits );
+  // sprintf( lines[0],"%s  Date : %s --%s",lines[0], min_date_time_str, max_date_time_str );
+  sprintf( lines[0],"Variable : %s[%s]  Date : %s --%s",varname, varunits, min_date_time_str, max_date_time_str );
+  mag_set1c( "text_lines", (const char**)lines, 1 );
+  
+  mag_setc("text_html", "true");
+  mag_setc("text_colour", "black");
+  mag_setr("text_font_size", 0.6);
+  mag_setc("text_mode", "positional");
+  mag_setr("text_box_x_position", 1.5);
+  mag_setr("text_box_y_position", 16.5);
+  mag_setr("text_box_x_length", 20.);
+  mag_setr("text_box_y_length", 2.5);
+  mag_setc("text_border", "off");
+  mag_setc("text_justification", "left");
+  mag_text();
+
+  if ( stat == TRUE )
+    {
+      free( date_time );
+      free( mean_val );
+      free( std_dev_val );
+      free( spread_min );
+      free( spread_max );
+    }
+  
+  
+  if( DBG )
+    fprintf(stderr, "%s\n",lines[0]);
+
+#endif
+
+}
+
+int compareDateOrTimeStr( char *datetimestr1, char *datetimestr2, char *sep_char )
+{
+  
+  int    split_str_count1, split_str_count2;
+  int	 i,flag[3]; /*  '3' since, three fields are expected in the input strings */
+  char   **split_str1 = NULL;
+  char   **split_str2 = NULL;
+   
+  if( DBG )
+    fprintf(stderr,"Inside compareDateOrTimeStr %s %s\n",datetimestr1,datetimestr2);
+  split_str_count1 = StringSplitWithSeperator( datetimestr1, sep_char, &split_str1 );
+  
+  if( split_str_count1 )
+    split_str_count2 = StringSplitWithSeperator( datetimestr2, sep_char, &split_str2 );
+  else
+    {
+      free( split_str1 );
+      return -999;
+    }
+  
+  if( split_str_count2 && !( split_str_count1 - split_str_count2 ) )
+    {
+      flag[0] = atoi( split_str1[0] ) - atoi( split_str2[0] ) ;
+      flag[1] = atoi( split_str1[1] ) - atoi( split_str2[1] ) ;
+      flag[2] = atoi( split_str1[2] ) - atoi( split_str2[2] ) ;
+    }
+  else
+    {
+      free( split_str1 );
+      free( split_str2 );
+      return -999;
+    }
+  
+  free( split_str1 );
+  free( split_str2 );
+  
+  for ( i = 0;i < 3 ; i++ )
+    {
+	if( flag[i] > 0 )
+	    return 1;
+	else if(  flag[i] < 0 )
+	  return -1;
+	else 
+	  continue;
+    }
+    return 0;
+}
+
+
+#if  defined  (HAVE_LIBMAGICS)
+
+static
+void init_MAGICS( )
+
+{
+  setenv( "MAGPLUS_QUIET","1",1 ); /* To suppress magics messages */
+  mag_open();
+
+/* Some standard parameters affectng the magics environment, moved from the xml file  ** begin ** */
+  mag_setc ("page_id_line","off");
+/* Some standard parameters affectng the magics environment, moved from the xml file  ** end ** */
+
+}
+
+
+static
+void quit_MAGICS( )
+
+{
+
+  mag_close ();
+  if( DBG )
+    fprintf( stdout,"Exiting From MAGICS\n" );
+
+}
+
+#endif
+
+#define NINC_ALLOC 1024
+
+void *Maggraph(void *argument)
+{
+  const char *ofilename;
+  char varname[CDI_MAX_NAME], units[CDI_MAX_NAME];
+  char **pnames = NULL;
+  int varID, levelID;
+  int gridID;
+  int nrecs;
+  int tsID;
+  int streamID;
+  int vlistID, vlistID0 = -1;
+  int nmiss;
+  int taxisID;
+  int **vdate = NULL, **vtime = NULL;
+  int fileID, nfiles;
+  long *nts, nts_alloc;
+  int nparam = 0;
+  double **datatab = NULL;
+  double val;
+  int i;
+  
+  cdoInitialize(argument);
+
+  nparam = operatorArgc();
+  pnames = operatorArgv();
+  
+  if( nparam )
+    VerifyGraphParameters(nparam,pnames);
+  
+  nfiles = cdoStreamCnt() - 1;
+  ofilename = cdoStreamName(nfiles);
+  
+  if( DBG )
+    {
+       fprintf( stderr," Num of files %d\n",nfiles );
+       fprintf( stderr," files %s\n",ofilename );
+    }
+	
+  datatab = (double **) malloc(nfiles*sizeof(double *));
+  vdate   = (int **) malloc(nfiles*sizeof(int *));
+  vtime   = (int **) malloc(nfiles*sizeof(int *));
+  nts     = (long *) malloc(nfiles*sizeof(long));
+  
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      datatab[fileID] = NULL;
+      vdate[fileID]   = NULL;
+      vtime[fileID]   = NULL;
+      nts[fileID]     = 0;
+    }
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      
+     
+      if( DBG )
+        fprintf( stderr," file %d is %s\n", fileID, cdoStreamName(fileID) );
+      streamID = streamOpenRead(cdoStreamName(fileID));
+
+      vlistID = streamInqVlist(streamID);
+      taxisID = vlistInqTaxis(vlistID);
+
+      vlistInqVarUnits(vlistID, 0, units);
+      if( DBG )
+	fprintf(stderr," %s\n", units );
+      if ( fileID == 0 )
+	{
+	  vlistInqVarName(vlistID, 0, varname);
+	  
+	  
+	  gridID = vlistInqVarGrid(vlistID, 0);
+
+	  if ( gridInqSize(gridID) != 1 ) cdoAbort("Variable has more than one grid point!");
+
+	  vlistID0 = vlistDuplicate(vlistID);
+	}
+      else
+	{
+	  vlistCompare(vlistID0, vlistID, CMP_ALL);
+	}
+
+      tsID = 0;
+      nts_alloc = 0;
+      while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	{
+	  if ( nrecs != 1 ) cdoAbort("Input streams have more than one record!\n");
+	  
+	  if ( tsID == 0 )
+	    {
+	      nts_alloc += NINC_ALLOC;
+	      datatab[ fileID ] = (double *) malloc( nts_alloc*sizeof(double) );
+	      vdate[ fileID ]   = (int *) malloc(  nts_alloc*sizeof(int) );
+	      vtime[ fileID ]   = (int *) malloc(  nts_alloc*sizeof(int) );
+	    }
+		
+	  nts[ fileID ]++;
+
+	  if ( nts[ fileID ] > nts_alloc )
+	    {
+	      nts_alloc += NINC_ALLOC;
+	      datatab[ fileID ] = (double *) realloc(datatab[fileID], nts_alloc*sizeof(double));
+	      vdate[ fileID ]   = (int *) realloc(vdate[fileID], nts_alloc*sizeof(int));
+	      vtime[ fileID ]   = (int *) realloc(vtime[fileID], nts_alloc*sizeof(int));
+	    }
+	  
+	  streamInqRecord( streamID, &varID, &levelID );
+	  streamReadRecord( streamID, &val, &nmiss );	
+	  datatab[ fileID ][ tsID ] = val;
+	  vdate[ fileID ][ tsID ] = taxisInqVdate(taxisID);
+	  vtime[ fileID ][ tsID ] = taxisInqVtime(taxisID);
+
+          if( DBG )
+	    fprintf(stderr, "%f %f\n", datatab[ fileID ][ tsID ],val ); 
+	  tsID++;
+	}
+      streamClose(streamID);
+    }
+  
+#if  defined  (HAVE_LIBXML2)
+  /* HARDCODED THE FILE NAME .. TO BE SENT AS COMMAND LINE ARGUMENT FOR THE MAGICS OPERATOR */
+  /*
+  init_XMLtemplate_parser( Filename );
+  updatemagics_and_results_nodes( );
+  */
+#endif
+
+
+#if  defined  (HAVE_LIBMAGICS)
+  init_MAGICS( );
+#endif
+
+  cdoPrint(" Creating PLOT for %s", varname);
+  if( DBG )
+    {
+      fprintf(stderr, "Num params %d\n", nparam);
+  
+      for( i = 0; i< nparam; i++ )
+	fprintf(stderr, "Param %s\n", pnames[i]);
+    }
+  maggraph(ofilename, varname, units, nfiles, nts, vdate, vtime, datatab, nparam, pnames);
+
+#if  defined  (HAVE_LIBXML2)
+  /* quit_XMLtemplate_parser( ); */
+#endif
+
+#if  defined  (HAVE_LIBMAGICS)
+  quit_MAGICS( );
+#endif
+
+  if ( vlistID0 != -1 ) vlistDestroy(vlistID0);
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      if ( datatab[fileID] ) free(datatab[fileID]);
+    }
+
+  free(datatab);
+
+
+  if ( vdate ) free(vdate);
+  if ( vtime ) free(vtime);
+
+  cdoFinish();
+
+  return (0);
+}
+
+
+void VerifyGraphParameters( int num_param, char **param_names )
+
+{
+  int i, j;
+  int  found = FALSE, syntax = TRUE, halt_flag = FALSE, split_str_count;
+  char **split_str = NULL;
+  char *sep_char = "=";
+  char *temp_str;
+  
+  for ( i = 0; i < num_param; ++i )
+    {
+      split_str_count = 0;
+      found = FALSE;
+      syntax = TRUE;
+      split_str_count = StringSplitWithSeperator( param_names[i], sep_char, &split_str );
+      if( split_str_count > 1 ) 
+	{
+	  for ( j = 0; j < graph_param_count; ++j )
+	    {
+	      if( !strcmp( split_str[0], graph_params[j] ) )
+		{
+		  found = TRUE;
+		  if( !strcmp( split_str[0],"obsv" ) ||  !strcmp( split_str[0],"stat" ) )
+		    {  
+		      if( IsNumeric( split_str[1] ) )
+			syntax = FALSE;
+		      else 
+			{			
+			  temp_str = strdup( split_str[1] );    
+			  StrToUpperCase( temp_str );
+			  if( strcmp( temp_str,"TRUE" ) && strcmp( temp_str,"FALSE" ) )
+			    syntax = FALSE;			      
+			}
+		    }	 
+		      
+		  if( !strcmp( split_str[0],"ymin" ) ||  !strcmp( split_str[0],"ymax" ) || !strcmp( split_str[0],"sigma" )  )
+		    {
+		      if( !IsNumeric( split_str[1] ) )
+			syntax = FALSE;       
+		    }
+		    
+		    
+      		  if( !strcmp( split_str[0],"device" ) )
+		    {
+		      if( IsNumeric( split_str[1] ) )
+			syntax = FALSE;       
+		      else 
+			{
+			  if( !strcmp( split_str[0],"device" ) )
+			    {
+			      if( DBG )
+				fprintf( stderr,"Parameter value '%s'\n",split_str[1] );
+			      if( checkdevice( split_str[1] ) )
+				syntax = FALSE;
+
+                              /* Graph not supported in google earth format */
+                              if( !strcmp( split_str[1],"GIF_ANIMATION" ) || !strcmp( split_str[1],"gif_animation" ))
+                                {
+                                   syntax = FALSE;
+	                           fprintf( stderr,"Animation not supported for Graph!\n");
+                                   if( DBG )
+                                     fprintf( stderr,"Parameter value '%s'\n",split_str[1] );
+                                }
+                              if( !strcmp( split_str[1],"KML" ) || !strcmp( split_str[1],"kml" ) )
+                                {
+                                   syntax = FALSE;
+	                           fprintf( stderr," 'kml' format not supported for  Graph!\n");
+                                   if( DBG )
+                                     fprintf( stderr,"Parameter value '%s'\n",split_str[1] );
+                                }
+			    }
+			}
+		    }
+
+/*		    
+		  if( !strcmp( split_str[0],"xml" ) )
+		    {
+		      if( ( fp = fopen( split_str[1],"r") ) == NULL )
+			{
+			  fprintf( stderr,"Input XML File not found in specified path '%s'\n", split_str[1] );
+			  halt_flag = TRUE;
+			}
+		      else
+			{
+#if  defined  (HAVE_LIBXML2)
+			  // HARDCODED THE FILE NAME .. TO BE SENT AS COMMAND LINE ARGUMENT FOR THE MAGICS OPERATOR 
+			  fclose(fp);
+			  init_XMLtemplate_parser( split_str[1] );
+			  updatemagics_and_results_nodes( );
+#endif			
+			}
+		    }
+*/
+		}
+	    }
+	}
+      else
+	{
+	  syntax = FALSE;
+	}
+	
+      if( found == FALSE )
+	{
+	  halt_flag = TRUE;
+	  fprintf( stderr,"Unknown parameter  '%s'!\n", param_names[i] );
+	} 
+      if( found == TRUE && syntax == FALSE )
+	{
+	  halt_flag = TRUE;
+	  fprintf( stderr,"Invalid parameter specification  '%s'!\n", param_names[i] );
+	}
+      free( split_str );
+    }
+      
+    if( halt_flag == TRUE )
+    {
+      exit(0);
+    }
+    
+}
diff --git a/src/Magplot.c b/src/Magplot.c
new file mode 100644
index 0000000..116920e
--- /dev/null
+++ b/src/Magplot.c
@@ -0,0 +1,1159 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h" /* HAVE_LIBMAGICS */
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "grid.h"
+#include "pstream.h"
+#include "magics_api.h"
+
+#include<libxml/parser.h>
+#include<libxml/tree.h>
+#include "template_parser.h"
+#include "magics_template_parser.h"
+#include "results_template_parser.h"
+
+xmlDoc *param_doc = NULL;
+xmlNode *root_node = NULL, *magics_node = NULL, *results_node = NULL;
+
+#define DBG 0
+
+
+int CONTOUR, SHADED, GRFILL;
+
+char  *contour_params[] = {"min","max","count","interval","list","colour","thickness","style","RGB","device", "step_freq","file_split"};
+int contour_param_count = sizeof(contour_params)/sizeof(char*);
+
+char  *shaded_params[] = {"min","max","count","interval","list","colour_min","colour_max","colourtable","RGB","colour_triad","device","step_freq","file_split"};
+int shaded_param_count = sizeof(shaded_params)/sizeof(char*);
+
+char  *grfill_params[] = {"min","max","count","interval","list","colour_min","colour_max","colourtable","resolution","RGB","colour_triad","device","step_freq","file_split"};
+int grfill_param_count = sizeof(grfill_params)/sizeof(char*);
+
+char  *STD_COLOUR_TABLE[] = {"red", "green", "blue", "yellow", "cyan", "magenta", "black", "avocado",
+			     "beige", "brick", "brown", "burgundy",
+			     "charcoal", "chestnut", "coral", "cream", 
+			     "evergreen", "gold", "grey", 
+			     "khaki", "kellygreen", "lavender",
+			     "mustard", "navy", "ochre", "olive",
+			     "peach", "pink", "rose", "rust", "sky",
+			     "tan", "tangerine","turquoise",
+			     "violet", "reddishpurple",
+			     "purplered", "purplishred",
+			     "orangishred", "redorange", "reddishorange",
+			     "orange", "yellowishorange",
+			     "orangeyellow", "orangishyellow", 
+			     "greenishyellow", "yellowgreen",
+			     "yellowishgreen", "bluishgreen",
+			     "bluegreen", "greenishblue",
+			     "purplishblue", "bluepurple",
+			     "bluishpurple", "purple", "white"
+			    };
+
+
+char **USR_COLOUR_TABLE = NULL;
+
+int  STD_COLOUR_COUNT = sizeof( STD_COLOUR_TABLE )/sizeof( char* );
+int  USR_COLOUR_COUNT =0;
+
+
+char *STYLE_TABLE[] = { "SOLID","DASH","DOT","CHAIN_DASH","CHAIN_DOT"};
+int STYLE_COUNT = sizeof( STYLE_TABLE )/ sizeof( char *);
+
+char *DEVICE_TABLE[] = { "PS","EPS","PDF","PNG","GIF","GIF_ANIMATION","JPEG","SVG","KML"};
+int DEVICE_COUNT = sizeof( DEVICE_TABLE )/ sizeof( char *);
+
+int ANIM_FLAG = 0, STEP_FREQ = 1;
+
+
+int checkcolour( char *colour_in );
+int ReadColourTable ( char *filepath );
+int checkstyle( char *style_in );
+int checkdevice( char *device_in );
+void VerifyPlotParameters( int num_param, char **param_names, int opID );
+
+extern int IsNumeric();
+extern void StrToUpperCase();
+extern void StrToLowerCase();
+extern int StringSplitWithSeperator();
+extern void StrReplaceChar( );
+
+ /* Magics default values */
+int COUNT = 10, isRGB = FALSE,   THICKNESS = 1, NUM_LEVELS = 0, FILE_SPLIT = FALSE;
+double YMIN = 1.0e+200, YMAX = -1.0e+200, INTERVAL = 8.0, RESOLUTION = 10.0f, *LEV_LIST = NULL ;
+char *COLOUR = NULL, *COLOUR_MIN = NULL, *COLOUR_MAX = NULL, *STYLE = NULL, *DEVICE = NULL, *COLOUR_TRIAD = NULL;
+
+
+static
+void magplot( const char *plotfile, int operatorID, const char *varname, long nlon, long nlat, double *grid_center_lon, double *grid_center_lat, double *array,  int nparam, char **params, char *datetime )
+
+{
+  long i;
+  double dlon = 0, dlat = 0;
+  char plotfilename[4096];
+  char *titlename;
+  int j, split_str_count, split_str_count1;
+  char *sep_char = "=";
+  char **split_str = NULL, **split_str1 = NULL;
+  char *temp_str = NULL;
+  char  orig_char = ';', rep_char = ',';
+  char tempname[256];
+  
+  
+  if( DBG )
+    {
+      fprintf(stderr, "Num params %d\n", nparam);
+  
+      for( i = 0; i< nparam; i++ )
+	fprintf(stderr, "Param %s\n", params[i]);
+      fflush( stderr );
+    }
+  
+  for( i = 0; i < nparam; ++i )
+    {
+      split_str_count = 0;
+      sep_char = "=";
+      split_str_count = StringSplitWithSeperator( params[i], sep_char, &split_str );
+	
+      if( !strcmp( split_str[0],"min" ) )
+	{
+	  YMIN = atof( split_str[1] );
+	  if( DBG )
+	    fprintf(stderr," Min Val %g\n",YMIN );
+	}
+	
+      if( !strcmp( split_str[0],"max" ) )
+	{
+	  YMAX = atof( split_str[1] );
+	  if( DBG )
+	    fprintf(stderr,"Max Val %g\n",YMAX );
+	}
+	
+      if( !strcmp( split_str[0],"resolution" ) )
+	{
+	  RESOLUTION = atoi( split_str[1] );
+	  if( DBG )
+	    fprintf( stderr,"RESOLUTION %g\n",RESOLUTION );
+	}	
+	
+      if( !strcmp( split_str[0],"colour" ) ) 
+	{  
+	  temp_str = strdup( split_str[1] );  
+	  if( !isRGB )
+	    StrToLowerCase( temp_str );
+	  else
+	    {
+	      StrToUpperCase( temp_str );
+	      StrReplaceChar( temp_str, orig_char, rep_char ); /* replace ';' in RGB format to ',' */
+	    }
+          COLOUR = temp_str;
+	  if( DBG )
+	    fprintf(stderr,"COLOUR %s\n",COLOUR );
+	}
+	
+      if( !strcmp( split_str[0],"colour_min" ) ) 
+	{  
+	  temp_str = strdup( split_str[1] );    
+          if( !isRGB )
+	    StrToLowerCase( temp_str );
+	  else
+	    {
+	      StrToUpperCase( temp_str );
+	      StrReplaceChar( temp_str, orig_char, rep_char ); /* replace ';' in RGB format to ',' */
+	    }
+	  COLOUR_MIN = temp_str;
+	  if( DBG )
+	    fprintf(stderr,"COLOUR %s\n",COLOUR_MIN );
+	}
+	
+      if( !strcmp( split_str[0],"colour_max" ) ) 
+	{  
+	  temp_str = strdup( split_str[1] );    
+          if( !isRGB )
+	    StrToLowerCase( temp_str );
+	  else
+	    {
+	      StrToUpperCase( temp_str );
+	      StrReplaceChar( temp_str, orig_char, rep_char ); /* replace ';' in RGB format to ',' */
+	    }
+	  COLOUR_MAX = temp_str;
+	  if( DBG )
+	    fprintf(stderr,"COLOUR %s\n",COLOUR_MAX );
+	}			
+	
+      if( !strcmp( split_str[0],"interval" ) )
+	{
+	  INTERVAL = atof( split_str[1] );
+	  
+	  if( DBG )
+	    fprintf( stderr,"INTERVAL %f\n",INTERVAL );
+	}
+	
+      if( !strcmp( split_str[0],"count" ) )
+	{
+	  COUNT = atoi( split_str[1] );
+	  if( DBG )
+	    fprintf( stderr,"COUNT %d\n",COUNT );
+	}
+	
+      if( !strcmp( split_str[0],"list" ) ) /* To be Done */
+	{
+	  sep_char = ";";
+	  split_str_count1 = 0;
+	  split_str_count1 = StringSplitWithSeperator( split_str[1], sep_char, &split_str1 );
+	  if( split_str_count1 )
+	    {
+	      NUM_LEVELS = split_str_count1;
+	      LEV_LIST = ( double *) malloc( sizeof( double ) * split_str_count1 );
+	      for( j = 0; j < split_str_count1; j++ )
+		{
+		  LEV_LIST[j] = atof( split_str1[j] );
+		}
+	      free( split_str1 );
+	    }
+	  if( DBG )
+	    {
+	      for( j = 0; j < split_str_count1; j++ )
+		{
+		  fprintf( stderr,"LIST %f\n",LEV_LIST[j] ); 
+		}
+	    }
+	}   
+	
+      if( !strcmp( split_str[0],"thickness" ) )
+	{
+	  THICKNESS = atoi( split_str[1] );
+	  if( DBG )
+	    fprintf( stderr,"THICKNESS %d\n",THICKNESS );
+	}
+	
+      if( !strcmp( split_str[0],"style" ) ) 
+	{  
+	  temp_str = strdup( split_str[1] );    
+	  StrToUpperCase( temp_str );
+	  STYLE = temp_str;
+	  if( DBG )
+	    fprintf( stderr,"STYLE %s\n",STYLE );
+	}
+	
+      if( !strcmp( split_str[0],"device" ) ) 
+	{  
+	  temp_str = strdup( split_str[1] );    
+	  StrToUpperCase( temp_str );
+	  DEVICE = temp_str;
+	  if( DBG )
+	    fprintf( stderr,"DEVICE %s\n",DEVICE );
+          mag_setc ("output_format", DEVICE );
+	}
+
+      if( !strcmp( split_str[0],"step_freq" ) ) 
+	{  
+	  STEP_FREQ = atoi( split_str[1] );
+	  if( DBG )
+	    fprintf( stderr,"STEP_FREQ %d\n",STEP_FREQ );
+	}
+      free( split_str );
+    }
+
+  if ( nlon > 1 )
+    {
+      for ( i = 1; i < nlon; ++i ) dlon += (grid_center_lon[i] - grid_center_lon[i-1]);
+      dlon /= (nlon-1);
+    }
+  if ( nlat > 1 )
+    {
+      for ( i = 1; i < nlat; ++i ) dlat += (grid_center_lat[nlon*i] - grid_center_lat[nlon*(i-1)]);
+      dlat /= (nlat-1);
+    }
+
+  sprintf( plotfilename, "%s %s", varname, datetime );
+  titlename = strdup( plotfilename );
+  sprintf( plotfilename, "%s_%s", plotfile, varname );
+
+/* #if  defined  (HAVE_LIBMAGICS) */
+
+
+  mag_setc ("output_name",      plotfilename);
+  mag_new( "page");
+
+  /* Set the input data arrays to magics++ */
+   
+  mag_set2r("input_field", array, nlon, nlat);
+
+  /*
+  	mag_setc("input_field_organization", "REGULAR");
+  	mag_set2r("input_field_latitudes", grid_center_lat, nlon, nlat);
+  	mag_set2r("input_field_longitudes", grid_center_lon, nlon, nlat);
+  */
+
+  mag_setr("input_field_initial_latitude", grid_center_lat[0]);
+  mag_setr("input_field_latitude_step", dlat);
+
+  mag_setr("input_field_initial_longitude", grid_center_lon[0]);
+  mag_setr("input_field_longitude_step", dlon);
+ 
+  /* magics_template_parser( magics_node ); */
+  /* results_template_parser(results_node, varname ); */
+
+
+  /* set up the coastline attributes */
+  /* mag_setc ("map_coastline_colour", "khaki"); */
+  /* mag_setc ("map_grid_colour",      "grey");  */ 
+
+  /* define the contouring parameters */
+  if ( operatorID == SHADED )
+    {
+
+      mag_setc ( "contour", "off" );
+      mag_setc ( "contour_shade", "on" );
+      mag_setc ( "contour_shade_method", "area_fill" );
+      mag_setc ( "contour_label", "off" );
+      
+      if( YMIN < 1.0e+200  )
+        {
+	   mag_setr( "contour_shade_min_level", YMIN );
+	   mag_setr( "contour_min_level", YMIN );
+        }
+
+
+
+      
+      if( YMAX > -1.0e+200 )
+        {
+	   mag_setr( "contour_shade_max_level", YMAX );
+	   mag_setr( "contour_max_level", YMAX );
+        }
+      
+      if( COLOUR_MIN )
+	mag_setc( "contour_shade_min_level_colour", COLOUR_MIN );
+      
+      if( COLOUR_MAX )
+	mag_setc( "contour_shade_max_level_colour", COLOUR_MAX );
+
+      if( INTERVAL != 8.0f )
+	{
+	  mag_setc( "contour_level_selection_type", "INTERVAL" );
+	  mag_setr( "contour_interval", INTERVAL );
+	}
+	
+      if( COUNT != 10 )
+	{
+	  mag_setc( "contour_level_selection_type", "COUNT" );
+	  mag_seti( "contour_level_count", COUNT );
+	}
+	
+      if( NUM_LEVELS  )
+	{
+	  mag_setc( "contour_level_selection_type", "LEVEL_LIST" );
+	  mag_set1r( "contour_level_list", LEV_LIST, NUM_LEVELS );
+	}
+	
+      if( USR_COLOUR_COUNT ) 
+	{
+	  mag_setc( "contour_shade_colour_method", "LIST" );
+	  mag_set1c( "contour_shade_colour_list",( const char **)USR_COLOUR_TABLE, USR_COLOUR_COUNT ); 
+	}
+	
+      if( COLOUR_TRIAD )                                
+	{
+	  mag_setc( "contour_shade_colour_direction", COLOUR_TRIAD );
+	}
+	
+      
+      /* Adjust Set The page slightly to fit the legend */
+      mag_setr ( "subpage_x_length", 24. );
+      mag_setr ( "subpage_y_length", 30. );
+
+      /* Legend Settings */
+      mag_setc ( "legend", "on" );
+      mag_setc ( "legend_display_type", "continuous" );
+      mag_setc ( "legend_entry_plot_direction", "column" );
+      mag_setc ( "legend_box_mode", "positional" );
+      mag_setr ( "legend_box_x_position", 26.5 );
+      mag_setr ( "legend_box_y_position", 0.39 );
+      mag_setr ( "legend_box_x_length", 2.0 );
+      mag_setr ( "legend_box_y_length", 12.69 );
+
+      if( DBG )
+        {
+           mag_enqc ( "output_name", &tempname );
+           fprintf( stderr, " SHADED Done %s!\n",tempname );
+           fprintf( stderr, " SHADED Done!\n" );
+        }
+    }
+  else if ( operatorID == CONTOUR )
+    {
+
+      mag_setc ("contour",                  "on");
+      mag_setc ("contour_shade",            "off");
+      mag_setc ("contour_label",            "on");
+      mag_setc ("contour_highlight",        "off");
+      
+    
+      if( YMIN < 1.0e+200  )
+	mag_setr( "contour_min_level", YMIN );
+
+      if( YMAX > -1.0e+200 )
+	mag_setr( "contour_max_level", YMAX );
+
+      
+      if( COLOUR )
+	mag_setc( "contour_line_colour", COLOUR );
+      
+      
+      if( INTERVAL != 8.0f )
+	{
+	  mag_setc( "contour_level_selection_type", "INTERVAL" );
+	  mag_setr( "contour_interval", INTERVAL );
+	}
+	
+      if( COUNT != 10 )
+	{
+	  mag_setc( "contour_level_selection_type", "COUNT" );
+	  mag_seti( "contour_level_count", COUNT );
+	}
+	
+      if( NUM_LEVELS  )
+	{
+	  mag_setc( "contour_level_selection_type", "LEVEL_LIST" );
+	  mag_set1r( "contour_level_list", LEV_LIST, NUM_LEVELS );
+	}
+	
+      if( THICKNESS != 1 )
+	mag_seti( "contour_line_thickness", THICKNESS );
+      
+      if( STYLE )
+      	  mag_setc( "contour_line_style", STYLE );
+      
+      if( DBG )
+        fprintf( stderr, " CONTOUR Done!\n" );
+    }
+  else if ( operatorID == GRFILL )
+    {
+
+      mag_setc ( "contour", "off" );
+      mag_setc ( "contour_shade", "on" );
+
+      mag_setc ( "contour_shade_technique", "cell_shading" );
+
+      mag_setc ( "contour_shade_method", "area_fill" );
+      mag_setc ( "contour_label", "off" );
+      
+      if( YMIN < 1.0e+200  )
+        {
+	   mag_setr( "contour_shade_min_level", YMIN );
+	   mag_setr( "contour_min_level", YMIN );
+        }
+
+      if( YMAX > -1.0e+200 )
+        {
+	   mag_setr( "contour_shade_max_level", YMAX );
+	   mag_setr( "contour_max_level", YMAX );
+        }
+
+      /*
+      if( YMIN < 1.0e+200  )
+	mag_setr( "contour_shade_min_level", YMIN );
+      
+      if( YMAX > -1.0e+200 )
+	mag_setr( "contour_shade_max_level", YMAX );
+      */
+      
+      if( COLOUR_MIN )
+	mag_setc( "contour_shade_min_level_colour", COLOUR_MIN );
+      
+      if( COLOUR_MAX )
+	mag_setc( "contour_shade_max_level_colour", COLOUR_MAX );
+      
+      if( INTERVAL != 8.0f )
+	{
+	  mag_setc( "contour_level_selection_type", "INTERVAL" );
+	  mag_setr( "contour_interval", INTERVAL );
+	}
+	
+      if( COUNT != 10 )
+	{
+	  mag_setc( "contour_level_selection_type", "COUNT" );
+	  mag_seti( "contour_level_count", COUNT );
+	}
+	
+      if( NUM_LEVELS  )
+	{
+	  mag_setc( "contour_level_selection_type", "LEVEL_LIST" );
+	  mag_set1r( "contour_level_list", LEV_LIST, NUM_LEVELS );
+	}
+	
+      if( USR_COLOUR_COUNT ) 
+	{
+	  mag_setc( "contour_shade_colour_method", "LIST" );
+	  mag_set1c( "contour_shade_colour_list",( const char ** ) USR_COLOUR_TABLE, USR_COLOUR_COUNT ); 
+	}
+	
+      if( RESOLUTION != 10.0f)
+	mag_setr( "contour_shade_cell_resolution", RESOLUTION );
+      
+      if( COLOUR_TRIAD )                                
+	  mag_setc( "contour_shade_colour_direction", COLOUR_TRIAD );
+
+      /* Adjust Set The page slightly to fit the legend */
+      mag_setr ( "subpage_x_length", 24. );
+      mag_setr ( "subpage_y_length", 30. );
+
+      /* Legend Settings */
+      mag_setc ( "legend", "on" );
+      mag_setc ( "legend_display_type", "continuous" );
+      mag_setc ( "legend_entry_plot_direction", "column" );
+      mag_setc ( "legend_box_mode", "positional" );
+      mag_setr ( "legend_box_x_position", 26.5 );
+      mag_setr ( "legend_box_y_position", 0.39 );
+      mag_setr ( "legend_box_x_length", 2.0 );
+      mag_setr ( "legend_box_y_length", 12.69 );
+
+      if( DBG )
+        fprintf( stderr, " GrFILL Done!\n");
+    }
+
+  /* plot the title text and the coastlines */
+  mag_cont ();
+  mag_coast ();
+
+
+  mag_set1c("text_lines", (const char **) &titlename, 1);
+  mag_setc("text_colour", "black");
+
+/*
+  mag_setr("text_font_size", 0.6);
+  mag_setc("text_mode", "positional");
+  mag_setr("text_box_x_position", 1.5);
+  mag_setr("text_box_y_position", 16.5);
+  mag_setr("text_box_x_length", 20.);
+  mag_setr("text_box_y_length", 2.5);
+  mag_setc("text_border", "off");
+*/
+
+  mag_setc("text_justification", "left");
+  mag_text();
+
+  if( LEV_LIST ) 
+    free( LEV_LIST );
+
+
+}
+
+
+static
+void init_MAGICS( )
+{
+  setenv( "MAGPLUS_QUIET","1",1 ); /* To suppress magics messages */
+
+  mag_open();
+/* Some standard parameters affectng the magics environment, moved from the xml file  ** begin ** */
+  mag_setc ("page_id_line","off");
+  mag_setc(  "output_name_first_page_number", "off" );
+  if( FILE_SPLIT == TRUE )
+    mag_setc(  "output_ps_split" , "on" );
+}
+
+static
+void quit_MAGICS( )
+{
+
+  mag_close ();
+  if( DBG )
+    fprintf( stderr,"Exiting From MAGICS\n" );
+
+}
+
+void *Magplot(void *argument)
+{
+  int operatorID;
+  int varID, recID;
+  int gridsize;
+  int gridID;
+  int nrecs;
+  int levelID;
+  int tsID;
+  int streamID;
+  int vlistID;
+  int nmiss;
+  int nlon, nlat;
+  int nlev;
+  int zaxisID, taxisID;
+  int vdate, vtime;
+  int nparam = 0;
+  int i;
+  char **pnames = NULL;
+  char varname[CDI_MAX_NAME];
+  double missval;
+  double *array = NULL;
+  double *grid_center_lat = NULL, *grid_center_lon = NULL;
+  char units[CDI_MAX_NAME];
+  char vdatestr[32], vtimestr[32], datetimestr[64];
+
+
+  cdoInitialize(argument);
+  
+  
+  nparam = operatorArgc();
+  pnames = operatorArgv();
+  
+  CONTOUR = cdoOperatorAdd("contour", 0, 0, NULL);
+  SHADED  = cdoOperatorAdd("shaded", 0, 0, NULL);
+  GRFILL  = cdoOperatorAdd("grfill", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  
+  if( nparam )
+    {
+      if( DBG )
+	{
+	  for( i = 0; i < nparam; i++ )
+	    fprintf( stderr,"Param %d is %s!\n",i+1, pnames[i] );
+	}
+      
+      VerifyPlotParameters( nparam, pnames, operatorID );
+    }
+
+  streamID = streamOpenRead(cdoStreamName(0));
+
+  vlistID = streamInqVlist(streamID);
+  taxisID = vlistInqTaxis(vlistID);
+
+  varID = 0;
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  zaxisID = vlistInqVarZaxis(vlistID, varID);
+  missval = vlistInqVarMissval(vlistID, varID);
+
+  if ( gridInqType(gridID) == GRID_GME          ) cdoAbort("GME grid unspported!");
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED ) cdoAbort("Unstructured grid unspported!");
+
+  if ( gridInqType(gridID) != GRID_CURVILINEAR )
+    gridID = gridToCurvilinear(gridID, 1);
+
+  gridsize = gridInqSize(gridID);
+  nlon     = gridInqXsize(gridID);
+  nlat     = gridInqYsize(gridID);
+  nlev     = zaxisInqSize(zaxisID);
+
+  array           = (double *) malloc(gridsize*sizeof(double));
+  grid_center_lat = (double *) malloc(gridsize*sizeof(double));
+  grid_center_lon = (double *) malloc(gridsize*sizeof(double));
+
+  gridInqYvals(gridID, grid_center_lat);
+  gridInqXvals(gridID, grid_center_lon);
+
+  /* Convert lat/lon units if required */
+  gridInqXunits(gridID, units);
+  gridToDegree(units, "grid center lon", gridsize, grid_center_lon);
+  gridInqYunits(gridID, units);
+  gridToDegree(units, "grid center lat", gridsize, grid_center_lat);
+					
+  tsID = 0;
+
+  /* HARDCODED THE FILE NAME .. TO BE SENT AS COMMAND LINE ARGUMENT FOR THE MAGICS OPERATOR */
+  /*
+     init_XMLtemplate_parser( Filename );
+     updatemagics_and_results_nodes( );
+  */
+
+
+  init_MAGICS( );
+
+  while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+    {
+      if( ANIM_FLAG )
+        {
+      	  if( nrecs > 1 )
+	    {
+	      cdoWarning("File has more than one variable! Animation creation not possible!!! \n");
+	      break;
+            }
+      	  if( tsID % STEP_FREQ )
+	    {
+                tsID++;
+		continue;
+            }
+	}
+      
+      vdate = taxisInqVdate(taxisID);
+      vtime = taxisInqVtime(taxisID);
+	      
+      date2str(vdate, vdatestr, sizeof(vdatestr));
+      time2str(vtime, vtimestr, sizeof(vtimestr));
+      sprintf( datetimestr, "%s %s", vdatestr, vtimestr );
+      if( DBG )
+        fprintf( stderr,"Date %s Time %s\n",vdatestr, vtimestr );
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID, &varID, &levelID);
+	  streamReadRecord(streamID, array, &nmiss);
+	  vlistInqVarName(vlistID, varID, varname);
+
+	  if ( operatorID == SHADED || operatorID == CONTOUR || operatorID == GRFILL )
+          {
+                if( DBG )
+                  {
+                     if( operatorID == SHADED )
+                       fprintf( stderr," Creating SHADED PLOT for %s\n",varname );
+                     else if( operatorID == CONTOUR )
+                       fprintf( stderr," Creating CONTOUR PLOT for %s\n",varname );
+                     else if( operatorID == GRFILL )
+                       fprintf( stderr," Creating GRFILL PLOT for %s\n",varname );
+                  }
+
+                if( DBG )
+                  fprintf( stderr,"Plot %d\n",varID );
+	  	magplot(cdoStreamName(1), operatorID, varname, nlon, nlat, grid_center_lon, grid_center_lat, array, nparam, pnames, datetimestr );
+          }
+	  else
+	  	fprintf(stderr,"operator not implemented\n");
+	}
+
+      if( DBG )
+        fprintf( stderr,"TimeStep %d\n",tsID );
+
+      if( ANIM_FLAG )
+        tsID++;
+      else
+        {
+	   cdoWarning("File variables have values at more than one time step! Images created for first time step!!!");
+           if( STEP_FREQ > 1 ) 
+             cdoWarning("Step frequency parameter ignored!!!");
+       	   break;
+	}
+    }
+
+  if( ANIM_FLAG )
+    {
+      if( FILE_SPLIT == TRUE  ) 
+        cdoWarning("File split parameter ignored!!!");
+    }
+  quit_MAGICS( );
+
+  streamClose(streamID);
+
+  if ( array  ) free(array);
+  if ( grid_center_lon ) free(grid_center_lon);
+  if ( grid_center_lat ) free(grid_center_lat);
+
+/*   quit_XMLtemplate_parser( ); */
+
+  cdoFinish();
+
+  return (0);
+
+}
+
+
+void VerifyPlotParameters( int num_param, char **param_names, int opID )
+
+{
+  int i, j, k;
+  int found = FALSE, syntax = TRUE, halt_flag = FALSE, /* file_found = TRUE, */ split_str_count;
+  int param_count;
+  char **params;
+  char **split_str = NULL, **split_str1 = NULL;
+  char *sep_char = "=";
+  char *temp_str;
+  FILE *fp;
+
+/*  
+  char  *contour_params[] = {"ymin","ymax","count","interval","list","colour","thickness","style"};
+  char  *shaded_params[]  = {"ymin","ymax","count","interval","list","colour_min","colour_max","colortable","step_freq"};
+  char  *grfill_params[]  = {"ymin","ymax","count","interval","list","colour_min","colour_max","colortable","resolution"};
+*/
+
+
+  for ( i = 0; i < num_param; ++i )
+    {
+      split_str_count = 0;
+      found = FALSE;
+      syntax = TRUE;
+      split_str_count = StringSplitWithSeperator( param_names[i], sep_char, &split_str );
+      
+      if( DBG )
+	fprintf( stderr, "Verifying params!\n");
+      
+      if( split_str_count > 1 ) 
+	{
+	  
+	  if( opID == CONTOUR )
+	    {
+	      param_count = contour_param_count;
+	      params = contour_params;
+	    }
+	  else if( opID == SHADED )
+	    {
+	      param_count = shaded_param_count;
+	      params = shaded_params;
+	    }
+	  else if( opID == GRFILL )
+	    {
+	      param_count = grfill_param_count;
+	      params = grfill_params;
+	    }
+	  
+	  for ( j = 0; j < param_count; ++j )
+	    {
+	      if( !strcmp( split_str[0], params[j] ) )
+		{
+		  found = TRUE;
+		  if( !strcmp( split_str[0],"colour" )     || !strcmp( split_str[0],"style" )       ||
+		      !strcmp( split_str[0],"colour_min" ) || !strcmp( split_str[0],"colour_max" )  ||
+		      !strcmp( split_str[0],"RGB" )        || !strcmp( split_str[0],"colour_triad" )||
+		      !strcmp( split_str[0],"device")      || !strcmp( split_str[0],"file_split" )
+		    )
+		    {  
+		      if( IsNumeric( split_str[1] ) )
+			syntax = FALSE;
+		      else
+			{
+			  if( !strcmp( split_str[0],"RGB" ) || !strcmp( split_str[0],"file_split") )
+			    {
+			      temp_str = strdup( split_str[1] );    
+			      StrToUpperCase( temp_str );
+			      if( strcmp( temp_str,"TRUE" ) && strcmp( temp_str,"FALSE" ) )
+				syntax = FALSE;      
+			      else
+				{
+                                  if( !strcmp( split_str[0],"RGB" ) )
+                                    {
+				      if( !strcmp( temp_str,"TRUE" ) )
+				        isRGB = TRUE;
+				      else
+				        isRGB = FALSE;
+				    }
+                                  else if( !strcmp( split_str[0],"file_split" ) )
+                                    {
+				      if( !strcmp( temp_str,"TRUE" ) )
+				        FILE_SPLIT = TRUE;
+				      else
+				        FILE_SPLIT = FALSE;
+				    }
+				}
+			    }
+			  else if( !strcmp( split_str[0],"style" ) )
+			    {
+			      if( checkstyle( split_str[1] ) )
+				syntax = FALSE;
+			    }
+			  else if( !strcmp( split_str[0],"colour" ) || !strcmp( split_str[0],"colour_min" ) || !strcmp( split_str[0],"colour_max" ) )
+			    {
+			      
+			      if( checkcolour( split_str[1] ) )
+				syntax = FALSE;
+			    }
+			  else if( !strcmp( split_str[0],"device" ) )
+			    {
+			      if( checkdevice( split_str[1] ) )
+  				    syntax = FALSE;
+			    }
+			  else if( !strcmp( split_str[0],"colour_triad" ) )
+			    {
+			      temp_str = strdup( split_str[1] );    
+			      StrToUpperCase( temp_str );
+			      if( strcmp( temp_str,"CW" ) && strcmp( temp_str,"ACW" ) )
+				    syntax = FALSE;      
+			      else
+				    {
+				  		if( DBG )
+				    	  fprintf( stderr, "TRIAD check  %s!\n",temp_str);
+					    if( !strcmp( temp_str,"CW" ) )
+						  COLOUR_TRIAD = "clockwise";
+					    else
+						  COLOUR_TRIAD = "anti_clockwise";
+				    }
+			    }
+			}
+		    } 
+		      
+		  if( !strcmp( split_str[0],"min" )      ||  !strcmp( split_str[0],"max" )     ||
+		      !strcmp( split_str[0],"count" )     ||  !strcmp( split_str[0],"interval" ) ||
+		      !strcmp( split_str[0],"thickness" ) ||  !strcmp( split_str[0],"resolution" ) || 
+		      !strcmp( split_str[0],"step_freq" )
+                    )
+		    {
+		      if( !IsNumeric( split_str[1] ) )
+			syntax = FALSE;       
+		    }
+		    
+		  if( !strcmp( split_str[0],"colourtable" ) )
+		    {
+		      if( ( fp = fopen( split_str[1],"r") ) == NULL )
+			{
+			  fprintf( stderr,"Input Color Table File not found in specified path '%s'\n", split_str[1] );
+			  halt_flag = TRUE;
+			}
+		      else
+			{
+			  ReadColourTable ( split_str[1] );
+			}
+		    }
+		    
+		  if( !strcmp( split_str[0],"list" ) )
+		    {
+		      sep_char = ";";
+		      split_str_count = StringSplitWithSeperator( split_str[1], sep_char, &split_str1 );
+		      if( !split_str_count )
+			{
+			  syntax = FALSE; 
+			}
+		      else
+		      {
+			for( k = 0; k < split_str_count; k++ )
+			  {
+			    if( !IsNumeric( split_str1[k] ) )
+			      syntax = FALSE;
+			  }
+		      }
+		      sep_char = "=";
+		    }
+		}
+	    }
+	}
+      else
+	{
+	  syntax = FALSE;
+	}
+	
+      if( found == FALSE )
+	{
+	  halt_flag = TRUE;
+	  fprintf( stderr,"Invalid parameter  '%s'\n", param_names[i] );
+	} 
+      if( found == TRUE && syntax == FALSE )
+	{
+	  halt_flag = TRUE;
+	  fprintf( stderr,"Invalid parameter specification  '%s'\n", param_names[i] );
+	}
+	
+      if( split_str ) 	  
+	free( split_str );
+    }
+      
+    if( halt_flag == TRUE )
+    {
+      exit(0);
+    }
+    
+}
+
+
+int checkcolour( char *colour_in )
+
+{
+
+    int i, n, found = FALSE;
+    int split_str_count;
+    char *sep_char =",";
+    char **split_str = NULL;
+    float  rgb_values[3];
+    char temp[256];
+    char *ref;
+   
+    ref = colour_in;
+    
+    if( isRGB )
+      {
+	if( strchr( colour_in,';') == NULL || strstr( colour_in,"RGB(") == NULL )
+	  {
+	    cdoWarning( "Found 'RGB=true',Specify Colour in 'RGB(r;g;b)' ( where r,g,b in [0.0,1.0] ) format!" );
+	    free( split_str );
+	    return 1;
+	  }
+	  
+	n = strlen( colour_in );
+    
+	if( DBG )
+	  fprintf( stdout,"  count %d  original colour %s RGB %d\n", n, colour_in, isRGB  );
+	
+	for( i=0 ; i< n-1; i++ )
+	  {
+	    if( i > 3 )
+	      { 
+		temp[i-4] = *colour_in;
+	      }
+	    colour_in++; 
+	  }
+	  
+	temp[i-4] = '\0';
+	
+	if( DBG )
+	  fprintf( stdout,"  count %d  modified color %s \n", (int)strlen(temp), temp  );
+	
+	sep_char =";";
+	split_str_count = StringSplitWithSeperator( temp, sep_char, &split_str );
+    
+	if(  split_str_count != 3 ) 
+	  {
+	    cdoWarning( " Colour specified in Improper format!" );
+	    free( split_str );
+	    return 1;
+	  }
+    
+	rgb_values[0] = atof( split_str[0] );
+	rgb_values[1] = atof( split_str[1] );
+	rgb_values[2] = atof( split_str[2] );
+    
+	if( rgb_values[0] + rgb_values[1] + rgb_values[2] > 3.0f  || 
+	    rgb_values[0] + rgb_values[1] + rgb_values[2] < 0.0f 	   )
+	  {
+	    cdoWarning( " RGB Colour specified with Improper values!" );
+	    free( split_str );
+	    return 1;
+	  }
+	  
+	free( split_str );  
+      }
+    else
+      {
+	if( strchr( colour_in,';') != NULL || strstr( colour_in,"RGB(") != NULL )
+	  {
+	    cdoWarning( "Found Colour with 'RGB(r;g;b)' format, set parameter RGB='true' !" );
+	    free( split_str );
+	    return 1;
+	  }
+	  
+	StrToLowerCase( colour_in );
+	for( i = 0 ; i < STD_COLOUR_COUNT; i++ )
+	  {
+	    if( !strcmp( STD_COLOUR_TABLE[i], colour_in ) )
+	      {
+		found = TRUE;
+		return 0;
+	      }
+	  }
+	  cdoWarning( "Specified Colour not in Standard colour list, resetting to blue(default colour)!" );
+	  return 1;
+      }
+      
+    if( DBG )  
+      cdoWarning( "Colour %s verified!",ref );  
+    return 0;
+}
+
+
+int ReadColourTable ( char *filepath )
+
+{
+    
+    FILE *fp;
+    int  i, num_colors;
+    char **temp_table = NULL;
+    char  orig_char = ';', rep_char = ',';
+    
+    fp = fopen( filepath,"r" );
+    
+    if( !fp )
+      {
+	fprintf( stdout, "File Not available!" );
+	return 1;
+      }
+    
+    fscanf( fp, "%d", &num_colors );
+    
+    if( DBG )
+      fprintf( stderr, "Num Colours %d\n", num_colors );
+    
+    if( !num_colors )
+      {
+	cdoWarning("No colours found in File, proceeding with Standard Colour table!\n");
+	fclose(fp);
+	return 1;
+      }
+    
+    USR_COLOUR_COUNT = 0;
+    USR_COLOUR_TABLE = malloc ( num_colors * sizeof( char * ) );
+    temp_table  = malloc ( num_colors * sizeof( char * ) );
+    
+    for( i =0; i < num_colors; i++ )
+      {
+         temp_table[i] = malloc (  256 * sizeof( char ) );
+	 fscanf( fp, "%s", temp_table[i] );
+	 if( DBG )
+	   fprintf( stdout, "%s\n", temp_table[i] );
+      } 
+    
+    for( i = 0; i < num_colors; i++ )
+      {
+	  if( DBG )
+	    fprintf( stdout, "%s \n", temp_table[i] );
+	  
+	  if( !checkcolour( temp_table[i] ) )
+	    {
+	      if( isRGB )
+		StrReplaceChar( temp_table[i], orig_char, rep_char ); /* replace ';' in RGB format to ',' */
+
+	      if( DBG )
+		fprintf( stdout, "Before appending %s\n", temp_table[i] );
+	      
+	      USR_COLOUR_TABLE[ USR_COLOUR_COUNT ] = strdup( temp_table[i] );
+	      
+	      /* strcpy( USR_COLOUR_TABLE[ USR_COLOUR_COUNT ], temp_table[i] ); */
+	      USR_COLOUR_COUNT++;
+	      
+	      if( DBG )
+		fprintf( stdout, "After appending %s\n", temp_table[i] );
+	    }
+      }
+    
+    if( USR_COLOUR_COUNT < num_colors )
+      {
+	  cdoWarning( " Discarding improper format colours and continuing!\n" );
+      }
+      
+    fclose(fp);   
+    return 0;
+}
+
+int checkstyle( char *style_in )
+
+{
+    int i, found = FALSE;
+    StrToUpperCase( style_in );
+    for( i = 0 ; i < STYLE_COUNT; i++ )
+      {
+	if( DBG )
+	  fprintf( stderr, "Input %s ref %s\n",style_in, STYLE_TABLE[i] );
+	
+	if( !strcmp( STYLE_TABLE[i], style_in ) )
+	  {
+	    found = TRUE;
+	    return 0;
+	  }
+      }
+      
+    if( !found )
+	 cdoWarning( " Style specified with Improper value!\n" );
+    
+    return 1; 
+}
+
+
+int checkdevice( char *device_in )
+
+{
+    int i, found = FALSE;
+    StrToUpperCase( device_in );
+    for( i = 0 ; i < DEVICE_COUNT; i++ )
+      {
+	if( DBG )
+	  fprintf( stderr, "Input %s ref %s\n",device_in, DEVICE_TABLE[i] );
+	
+	if( !strcmp( DEVICE_TABLE[i], device_in ) )
+	  {
+	    found = TRUE;
+	    if( !strcmp( "GIF_ANIMATION" , device_in ) || !strcmp( "KML", device_in )  )
+	      ANIM_FLAG = 1;
+	    return 0;
+	  }
+      }
+      
+    if( !found )
+	 cdoWarning( " Device specified with Improper value!\n" );
+    
+    return 1; 
+}
diff --git a/src/Magvector.c b/src/Magvector.c
new file mode 100644
index 0000000..6bedde0
--- /dev/null
+++ b/src/Magvector.c
@@ -0,0 +1,506 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h" /* HAVE_LIBMAGICS */
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "grid.h"
+#include "pstream.h"
+
+#include "magics_api.h"
+
+#include<libxml/parser.h>
+#include<libxml/tree.h>
+#include "template_parser.h"
+#include "magics_template_parser.h"
+#include "results_template_parser.h"
+
+extern xmlNode  *magics_node;
+
+#define DBG 0
+
+int VECTOR, STREAM;
+char  *vector_params[] = {"thin_fac","unit_vec","device","step_freq"};
+int vector_param_count = sizeof(vector_params)/sizeof(char*);
+
+void VerifyVectorParameters( int num_param, char **param_names, int opID );
+
+/* Default Magics Values */
+double THIN_FAC = 2.0, UNIT_VEC = 25.0;
+extern int ANIM_FLAG,STEP_FREQ;
+
+extern int checkdevice();
+extern int IsNumeric();
+extern void StrToUpperCase();
+extern int StringSplitWithSeperator();
+
+
+extern char *DEVICE;
+extern char *DEVICE_TABLE;
+extern int DEVICE_COUNT;
+
+static
+void magvector( const char *plotfile, int operatorID, const char *varname, long nlon, long nlat, double *grid_center_lon, double *grid_center_lat, double *uarray, double *varray, int nparam, char **params, char *datetime )
+
+{
+        long i;
+        double dlon = 0, dlat = 0;
+	int split_str_count;
+	char plotfilename[4096];
+	char *sep_char= "=";
+	char **split_str=NULL;
+	char *temp_str = NULL;
+	char *titlename;
+	
+
+	if( uarray == NULL && varray == NULL )
+	  {
+	    fprintf( stderr," No Velocity Components in input file, cannot creaate Vector PLOT!\n" );
+	    return ;
+	  }
+
+	if( uarray == NULL || varray == NULL )
+	  {
+	    fprintf( stderr," Found only one Velocity Component in input file, cannot create Vector PLOT!\n" );
+	    return ;
+	  }
+	
+	if( DBG )
+	  {
+	    fprintf(stderr, "Num params %d\n", nparam);
+      
+	    for( i = 0; i< nparam; i++ )
+	      fprintf(stderr, "Param %s\n", params[i]);
+	    fflush( stderr );
+	  }
+	  
+	for( i = 0; i < nparam; ++i )
+	  {
+	    split_str_count = 0;
+	    sep_char = "=";
+	    split_str_count = StringSplitWithSeperator( params[i], sep_char, &split_str );
+	    
+	    if( !strcmp( split_str[0],"thin_fac" ) )
+	      {
+		THIN_FAC = atof( split_str[1] );
+		if( DBG )
+		  fprintf(stderr,"THIN FACTOR %g\n",THIN_FAC );
+	      }
+	      
+	    if( !strcmp( split_str[0],"unit_vec" ) )
+	      {
+		UNIT_VEC = atof( split_str[1] );
+		if( DBG )
+		  fprintf(stderr,"UNIT VECTOR %g\n",UNIT_VEC );
+	      }
+	      
+            if( !strcmp( split_str[0],"device" ) ) 
+	      {
+		temp_str = strdup( split_str[1] );    
+		StrToUpperCase( temp_str );
+		DEVICE = temp_str;
+		if( DBG )
+		  fprintf( stderr,"DEVICE %s\n",DEVICE );
+		
+		mag_setc ("output_format", DEVICE );
+	      }
+
+	    if( !strcmp( split_str[0],"step_freq" ) )
+	      {
+		STEP_FREQ = atoi( split_str[1] );
+		if( DBG )
+		  fprintf(stderr,"STEP FREQ %d\n",STEP_FREQ );
+	      }
+	      
+	    free( split_str );  
+	  }
+	  
+        if( nlon > 1 )
+	  {
+	    for ( i = 1; i < nlon; ++i ) dlon += (grid_center_lon[i] - grid_center_lon[i-1]);
+		dlon /= (nlon-1);
+	  }	  
+
+        if( nlat > 1 )
+	  {
+	    for( i = 1; i < nlat; ++i ) dlat += (grid_center_lat[nlon*i] - grid_center_lat[nlon*(i-1)]);
+		dlat /= (nlat-1);
+	  }
+
+
+/* #if  defined  (HAVE_LIBMAGICS) */
+
+
+        /* magics_template_parser( magics_node ); */
+
+        /* results_template_parser(results_node, varname ); */
+
+        sprintf( plotfilename, "Velocity Vectors %s",datetime );
+        titlename = strdup( plotfilename );
+        sprintf(plotfilename, "%s", plotfile);
+
+        mag_setc("output_name",      plotfilename);
+        mag_new( "page" );
+
+
+	/* Set the input data */
+        mag_setr("input_field_initial_latitude", grid_center_lat[0]);
+        mag_setr("input_field_latitude_step", dlat);
+
+        mag_setr("input_field_initial_longitude", grid_center_lon[0]);
+        mag_setr("input_field_longitude_step", dlon);
+
+	mag_set2r("input_wind_u_component", uarray, nlon, nlat);
+	mag_set2r("input_wind_v_component", varray, nlon, nlat);
+
+        if( operatorID == VECTOR ) 
+	  {
+		/* Magics functions for performing vector operation */
+		/*
+		  mag_setc("wind_legend_only", "on" );
+		  mag_setc("wind_legend_text", "on" );
+		*/
+
+		mag_setc( "legend", "on" );
+		mag_setc( "wind_flag_cross_boundary", "on" );
+		mag_seti( "wind_arrow_thickness",1 );
+		mag_coast();
+		
+		if( THIN_FAC != 2.0f )
+		  mag_setr("wind_thinning_factor",THIN_FAC);
+		
+		/*wind_arrow_unit_velocity */
+		if( UNIT_VEC != 25.0f )
+		  mag_setr("wind_arrow_unit_velocity",UNIT_VEC);
+                
+		mag_wind();
+
+                mag_set1c("text_lines", (const char **) &titlename, 1);
+                mag_setc("text_colour", "black");
+                mag_setc("text_justification", "centre");
+                mag_text();
+
+	  }
+}
+
+
+static
+void init_MAGICS( )
+
+{
+
+  setenv( "MAGPLUS_QUIET","1",1 ); /* To suppress magics messages */
+  mag_open();
+
+/* Some standard parameters affectng the magics environment, moved from the xml file  ** begin ** */
+  mag_setc ("page_id_line","off");
+
+}
+
+static
+void quit_MAGICS( )
+
+{
+
+  mag_close ();
+  if( DBG )
+    fprintf( stdout,"Exiting From MAGICS\n" );
+
+}
+
+void *Magvector(void *argument)
+
+{
+  int operatorID;
+  int varID, recID;
+  int gridsize;
+  int gridID;
+  int nrecs;
+  int levelID;
+  int tsID;
+  int streamID;
+  int vlistID;
+  int nmiss;
+  int nlon, nlat;
+  int nlev;
+  int zaxisID, taxisID;
+  int vdate, vtime;
+  int found;
+  int nparam = 0;
+  int i;
+  char **pnames = NULL;
+  char varname[CDI_MAX_NAME];
+  double missval;
+  double *uarray = NULL;
+  double *varray = NULL;
+  double *grid_center_lat = NULL, *grid_center_lon = NULL;
+  char units[CDI_MAX_NAME];
+  char vdatestr[32],vtimestr[32],datetimestr[64];
+
+
+  cdoInitialize(argument);
+
+  nparam = operatorArgc();
+  pnames = operatorArgv();
+  
+  VECTOR  = cdoOperatorAdd("vector", 0, 0, NULL);
+  STREAM  = cdoOperatorAdd("stream", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  
+  if( nparam )
+    {
+      if( DBG )
+	{
+	  for( i = 0; i < nparam; i++ )
+	    fprintf( stderr,"Param %d is %s!\n",i+1, pnames[i] );
+	}
+      
+      VerifyVectorParameters( nparam, pnames, operatorID );
+    }
+
+  streamID = streamOpenRead(cdoStreamName(0));
+
+  vlistID = streamInqVlist(streamID);
+  taxisID = vlistInqTaxis(vlistID);
+
+  found = 0;
+  varID = 0;
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  zaxisID = vlistInqVarZaxis(vlistID, varID);
+  missval = vlistInqVarMissval(vlistID, varID);
+
+  if ( gridInqType(gridID) == GRID_GME          ) cdoAbort("GME grid unspported!");
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED ) cdoAbort("Unstructured grid unspported!");
+
+  if ( gridInqType(gridID) != GRID_CURVILINEAR )
+    gridID = gridToCurvilinear(gridID, 1);
+
+  gridsize = gridInqSize(gridID);
+  nlon     = gridInqXsize(gridID);
+  nlat     = gridInqYsize(gridID);
+  nlev     = zaxisInqSize(zaxisID);
+
+  uarray           = (double *) malloc(gridsize*sizeof(double));
+  varray           = (double *) malloc(gridsize*sizeof(double));
+  grid_center_lat = (double *) malloc(gridsize*sizeof(double));
+  grid_center_lon = (double *) malloc(gridsize*sizeof(double));
+
+  gridInqYvals(gridID, grid_center_lat);
+  gridInqXvals(gridID, grid_center_lon);
+
+  /* Convert lat/lon units if required */
+  gridInqXunits(gridID, units);
+  gridToDegree(units, "grid center lon", gridsize, grid_center_lon);
+  gridInqYunits(gridID, units);
+  gridToDegree(units, "grid center lat", gridsize, grid_center_lat);
+					
+  tsID = 0;
+
+  /* HARDCODED THE FILE NAME .. TO BE SENT AS COMMAND LINE ARGUMENT FOR THE MAGICS OPERATOR */
+  /*
+  init_XMLtemplate_parser( Filename );
+  updatemagics_and_results_nodes( );
+  */
+
+
+  init_MAGICS( );
+
+  while( (nrecs = streamInqTimestep(streamID, tsID)) )
+    {
+      if( ANIM_FLAG )
+        {
+          if( tsID % STEP_FREQ )
+            {
+                tsID++;
+                continue;
+            }
+        }
+
+      vdate = taxisInqVdate(taxisID);
+      vtime = taxisInqVtime(taxisID);
+	      
+      date2str(vdate, vdatestr, sizeof(vdatestr));
+      time2str(vtime, vtimestr, sizeof(vtimestr));
+      sprintf(datetimestr, "%s %s", vdatestr,vtimestr);
+
+      for( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID, &varID, &levelID);
+
+	  vlistInqVarName(vlistID, varID, varname);
+
+          if( operatorID == VECTOR )
+	    {
+	       if( !strcmp( varname, "var131" ) || !strcmp( varname, "u" ) ) /* U Velocity as per GRIB is 'var131, as per NC 'u' */
+	  	 {
+                      if( DBG )
+          		fprintf( stderr,"Found U VEL in Varname %s\n",varname );
+		      streamReadRecord(streamID, uarray, &nmiss);
+		      found ++;
+	  	 }
+	       if( !strcmp( varname, "var132" ) || !strcmp( varname, "v" ) ) /* V Velocity as per GRIB  is 'var132, as per NC 'v'*/
+	  	 {
+                      if( DBG )
+          		fprintf( stderr,"Found V VEL in Varname %s\n",varname );
+		      streamReadRecord(streamID, varray, &nmiss);
+		      found ++;
+	  	 }	
+	       if( found == 2 )
+	    	 break;
+	    }
+	  else if ( operatorID == STREAM )
+            fprintf( stderr," Stream Operator Un-Supported!\n" );
+	  else 
+            fprintf( stderr," Operator Un-Supported!\n" );
+        }
+         
+      if( operatorID == VECTOR )
+	{
+	   if( found == 2 )
+	     {
+                if( DBG )
+          	  fprintf( stderr,"Found Both U & V VEL, Creating vector fields! \n" );
+		magvector( cdoStreamName(1), operatorID, varname, nlon, nlat, grid_center_lon, grid_center_lat, uarray, varray, nparam, pnames, datetimestr );
+	     }
+	   else if( found == 1 )
+             {
+                fprintf( stderr,"Found only one Velocity Component in input file, cannot create Vector PLOT!\n" );
+                break;
+             }
+	   else if( found == 0 )
+             {
+                fprintf( stderr,"No Velocity Components in input file, cannot create Vector PLOT!\n" );
+                break;
+             }
+	}
+    
+      if( ANIM_FLAG )
+        tsID++;
+      else
+        {
+           cdoWarning("File has values at more than one time step! Image created for first time step!!!");
+           if( STEP_FREQ > 1 )
+             cdoWarning("Step frequency parameter ignored!!!");
+           break;
+        }
+    }
+
+  streamClose(streamID);
+
+  if ( uarray  ) free(uarray);
+  if ( varray  ) free(varray);
+  if ( grid_center_lon ) free(grid_center_lon);
+  if ( grid_center_lat ) free(grid_center_lat);
+
+  /*   quit_XMLtemplate_parser( ); */
+
+  quit_MAGICS( );
+
+  cdoFinish();
+
+  return (0);
+
+}
+
+
+
+void VerifyVectorParameters( int num_param, char **param_names, int opID )
+
+{
+  
+  int i, j;
+  int found = FALSE, syntax = TRUE, halt_flag = FALSE, split_str_count;
+  int param_count;
+  char **params;
+  char **split_str = NULL;
+  char *sep_char = "=";
+
+  /* char  *vector_params[] = {"min","max","count","interval","list","colour","thickness","style","RGB"}; */
+
+  for ( i = 0; i < num_param; ++i )
+    {
+      split_str_count = 0;
+      found = FALSE;
+      syntax = TRUE;
+      split_str_count = StringSplitWithSeperator( param_names[i], sep_char, &split_str );
+      
+      if( DBG )
+	fprintf( stderr, "Verifying params!\n");
+      
+      if( split_str_count > 1 ) 
+	{
+	  
+	  if( opID == VECTOR )
+	    {
+	      param_count = vector_param_count;
+	      params = vector_params;
+	    }
+	  
+	  for ( j = 0; j < param_count; ++j )
+	    {
+	      if( !strcmp( split_str[0], params[j] ) )
+		{
+		  found = TRUE;
+		      
+		  if( !strcmp( split_str[0],"thin_fac" ) || !strcmp( split_str[0],"unit_vec" ) ||
+		      !strcmp( split_str[0],"step_freq" )
+                    )
+		    {
+		      if( !IsNumeric( split_str[1] ) )
+			syntax = FALSE;       
+		    }
+		    
+   		  if( !strcmp( split_str[0],"device" ) )
+		    {
+		      if( IsNumeric( split_str[1] ) )
+			syntax = FALSE;       
+		      else 
+			{
+			  if( !strcmp( split_str[0],"device" ) )
+			    {
+			      if( DBG )
+				fprintf( stderr,"Parameter value '%s'\n",split_str[1] );
+			      if( checkdevice( split_str[1] ) )
+				syntax = FALSE;
+
+                              /* Vector not supported in google earth format */
+			      if( !strcmp( split_str[1],"KML" ) || !strcmp( split_str[1],"kml" ) )
+                                {
+				   syntax = FALSE;
+			           if( DBG )
+				     fprintf( stderr,"Parameter value '%s'\n",split_str[1] );
+                                }
+			    }
+			}
+		    }
+		}
+	    }
+	}
+      else
+	{
+	  syntax = FALSE;
+	}
+	
+      if( found == FALSE )
+	{
+	  halt_flag = TRUE;
+	  fprintf( stderr,"Invalid parameter  '%s'\n", param_names[i] );
+	} 
+      if( found == TRUE && syntax == FALSE )
+	{
+	  halt_flag = TRUE;
+	  fprintf( stderr,"Invalid parameter specification  '%s'\n", param_names[i] );
+	}
+	
+      if( split_str ) 	  
+	free( split_str );
+    }
+      
+    if( halt_flag == TRUE )
+    {
+      exit(0);
+    }
+    
+}
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..c3e7ea8
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,319 @@
+## Process this file with automake to produce Makefile.in
+#
+bin_PROGRAMS = cdo
+#
+cdo_SOURCES  = cdo.c
+cdo_SOURCES += Arith.c         \
+               Arithc.c        \
+               Arithdays.c     \
+               Arithlat.c      \
+               CDItest.c       \
+               CDIread.c       \
+               CDIwrite.c      \
+               Cat.c           \
+               Change.c        \
+               Change_e5slm.c  \
+               Cloudlayer.c    \
+               Command.c       \
+               Comp.c          \
+               Compc.c         \
+               Complextorect.c \
+               Cond.c          \
+               Cond2.c         \
+               Condc.c         \
+               Consecstat.c    \
+               Copy.c          \
+               Deltime.c       \
+               Derivepar.c     \
+               Detrend.c       \
+               Diff.c          \
+               Duplicate.c     \
+               EOFs.c          \
+	       Eof3d.c         \
+               EcaIndices.c    \
+               Echam5ini.c     \
+               Enlarge.c       \
+               Enlargegrid.c   \
+               Ensstat.c       \
+               Ensstat3.c      \
+               Ensval.c        \
+               Eofcoeff.c      \
+	       Eofcoeff3d.c    \
+               Exprf.c         \
+               FC.c            \
+               Filedes.c       \
+               Fillmiss.c      \
+               Filter.c        \
+               Fldrms.c        \
+               Fldstat.c       \
+               Fldstat2.c      \
+               Fourier.c       \
+               Gather.c        \
+               Gengrid.c       \
+               Gradsdes.c      \
+               Gridboxstat.c   \
+               Gridcell.c      \
+               Harmonic.c      \
+               Hi.c            \
+               Histogram.c     \
+               Importamsr.c    \
+               Importbinary.c  \
+               Importcmsaf.c   \
+               Importobs.c     \
+               Info.c          \
+               Input.c         \
+               Intgrid.c       \
+               Intgridtraj.c   \
+               Intlevel.c      \
+               Intlevel3d.c    \
+               Intntime.c      \
+               Inttime.c       \
+               Intyear.c       \
+               Invert.c        \
+               Invertlev.c     \
+               Isosurface.c    \
+               Kvl.c           \
+               Log.c           \
+               Maskbox.c       \
+               Mastrfu.c       \
+               Math.c          \
+               Merge.c         \
+               Mergegrid.c     \
+               Mergetime.c     \
+               Merstat.c       \
+               Monarith.c      \
+               Mrotuv.c        \
+               Mrotuvb.c       \
+               Ninfo.c         \
+               Nmltest.c       \
+               Output.c        \
+               Outputgmt.c     \
+               Pinfo.c         \
+               Pressure.c      \
+               Regres.c        \
+               Remap.c         \
+               Remapeta.c      \
+               Replace.c       \
+               Replacevalues.c \
+               Rhopot.c        \
+               Rotuv.c         \
+               Runpctl.c       \
+               Runstat.c       \
+               Scatter.c       \
+               Seascount.c     \
+               Seaspctl.c      \
+               Seasstat.c      \
+               Selbox.c        \
+               Select.c        \
+               Seloperator.c   \
+               Selrec.c        \
+               Seltime.c       \
+               Selvar.c        \
+               Set.c           \
+               Setbox.c        \
+               Setgatt.c       \
+               Setgrid.c       \
+               Sethalo.c       \
+               Setmiss.c       \
+               Setpartab.c     \
+               Setrcaname.c    \
+               Settime.c       \
+               Setzaxis.c      \
+               Showinfo.c      \
+               Sinfo.c         \
+               Smooth9.c       \
+               Sort.c          \
+               Sorttimestamp.c \
+               Specinfo.c      \
+               Spectral.c      \
+               Spectrum.c      \
+               Split.c         \
+               Splitrec.c      \
+               Splitsel.c      \
+               Splittime.c     \
+               Splityear.c     \
+               SSOpar.c        \
+               Subtrend.c      \
+               Tee.c           \
+               Templates.c     \
+               Test.c          \
+               Tests.c         \
+               Timcount.c      \
+               Timpctl.c       \
+               Timselpctl.c    \
+               Timselstat.c    \
+               Timsort.c       \
+               Timstat.c       \
+               Timstat2.c      \
+               Timstat3.c      \
+               Tinfo.c         \
+               Tocomplex.c     \
+               Transpose.c     \
+               Trend.c         \
+               Trms.c          \
+               Tstepcount.c    \
+               Vardup.c        \
+               Vargen.c        \
+               Varrms.c        \
+               Vertint.c       \
+               Vertstat.c      \
+               Vertwind.c      \
+               Wct.c           \
+               Wind.c          \
+               Writegrid.c     \
+               Writerandom.c   \
+               YAR.c           \
+               Ydayarith.c     \
+               Ydaypctl.c      \
+               Ydaystat.c      \
+               Ydrunpctl.c     \
+               Ydrunstat.c     \
+               Yhourarith.c    \
+               Yhourstat.c     \
+               Ymonarith.c     \
+               Ymonpctl.c      \
+               Ymonstat.c      \
+               Yseaspctl.c     \
+               Yseasstat.c     \
+               Zonstat.c       \
+               cdo.h           \
+               cdo_int.h       \
+               cdo_pthread.c   \
+               cdo_vlist.c     \
+               color.c         \
+               color.h         \
+               commandline.c   \
+               const.h       \
+               counter.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     \
+               field.c         \
+               field.h         \
+               field2.c        \
+               fieldc.c        \
+               fieldmem.c      \
+               fieldmer.c      \
+               fieldzon.c      \
+               fouriertrans.c  \
+               functs.h        \
+               gradsdeslib.c   \
+               gradsdeslib.h   \
+               grid.c          \
+               grid.h          \
+               grid_gme.c      \
+               grid_lcc.c      \
+               grid_rot.c      \
+               griddes.c       \
+               griddes.h       \
+               griddes_h5.c    \
+               griddes_nc.c    \
+               hetaeta.c       \
+               hetaeta.h       \
+               history.c       \
+               institution.c   \
+               interpol.c      \
+               interpol.h      \
+               job.c           \
+               juldate.c       \
+               kvlist.c        \
+               kvlist.h        \
+               legendre.c      \
+               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   \
+               pipe.c          \
+               pipe.h          \
+               printinfo.h     \
+               process.c       \
+               process.h       \
+               pstream.c       \
+               pstream.h       \
+               pstream_int.h   \
+               pthread_debug.c \
+               pthread_debug.h \
+               readline.c      \
+               realtime.c      \
+               remap.h         \
+               remaplib.c      \
+               remapsort.c     \
+               specspace.c     \
+               specspace.h     \
+               statistic.c     \
+               statistic.h     \
+               table.c         \
+               timebase.h      \
+               timer.c         \
+               userlog.c       \
+               util.c          \
+               util.h          \
+               vinterp.c       \
+               vinterp.h       \
+               zaxis.c
+
+if ENABLE_MAGICS
+cdo_SOURCES += Magplot.c       \
+               Magvector.c     \
+               Maggraph.c      \
+               template_parser.h   \
+               template_parser.c   \
+               results_template_parser.h   \
+               results_template_parser.c   \
+               magics_template_parser.h   \
+               magics_template_parser.c   \
+               StringUtilities.h   \
+               StringUtilities.c   \
+               CdoMagicsMapper.h   \
+               CdoMagicsMapper.c
+endif
+
+cdo_CPPFLAGS = -I$(top_srcdir)/libcdi/src
+cdo_LDADD    = $(top_builddir)/libcdi/src/libcdi.la
+cdo_LDFLAGS  =
+
+if ENABLE_ALL_STATIC
+cdo_LDFLAGS  += -all-static
+endif
+
+noinst_PROGRAMS  = cdotest
+cdotest_SOURCES  = cdo_int.h	\
+	           cdotest.c
+cdotest_LDADD    = $(cdo_LDADD)
+cdotest_CPPFLAGS = $(cdo_CPPFLAGS)
+cdotest_LDFLAGS  = $(cdo_LDFLAGS)
+if ENABLE_ALL_STATIC
+cdotest_LDFLAGS  += -all-static
+endif
+
+cdo-userlog.o: userlog.c config.h
+	$(COMPILE) -DLOGPATH=${exec_prefix}/log -c -o cdo-userlog.o `test -f 'userlog.c' || echo '$(srcdir)/'`userlog.c
+cdo_static-userlog.o: userlog.c config.h
+	$(COMPILE) -DLOGPATH=${exec_prefix}/log -c -o cdo_static-userlog.o `test -f 'userlog.c' || echo '$(srcdir)/'`userlog.c
+#
+CLEANFILES  = `ls *~ 2> /dev/null`
diff --git a/src/Makefile.in b/src/Makefile.in
new file mode 100644
index 0000000..8e94ecd
--- /dev/null
+++ b/src/Makefile.in
@@ -0,0 +1,4469 @@
+# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+bin_PROGRAMS = cdo$(EXEEXT)
+ at ENABLE_MAGICS_TRUE@am__append_1 = Magplot.c       \
+ at ENABLE_MAGICS_TRUE@               Magvector.c     \
+ at ENABLE_MAGICS_TRUE@               Maggraph.c      \
+ at ENABLE_MAGICS_TRUE@               template_parser.h   \
+ at ENABLE_MAGICS_TRUE@               template_parser.c   \
+ at ENABLE_MAGICS_TRUE@               results_template_parser.h   \
+ at ENABLE_MAGICS_TRUE@               results_template_parser.c   \
+ at ENABLE_MAGICS_TRUE@               magics_template_parser.h   \
+ at ENABLE_MAGICS_TRUE@               magics_template_parser.c   \
+ at ENABLE_MAGICS_TRUE@               StringUtilities.h   \
+ at ENABLE_MAGICS_TRUE@               StringUtilities.c   \
+ at ENABLE_MAGICS_TRUE@               CdoMagicsMapper.h   \
+ at ENABLE_MAGICS_TRUE@               CdoMagicsMapper.c
+
+ at ENABLE_ALL_STATIC_TRUE@am__append_2 = -all-static
+noinst_PROGRAMS = cdotest$(EXEEXT)
+ at ENABLE_ALL_STATIC_TRUE@am__append_3 = -all-static
+subdir = src
+DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
+	$(srcdir)/config.h.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(bindir)"
+PROGRAMS = $(bin_PROGRAMS) $(noinst_PROGRAMS)
+am__cdo_SOURCES_DIST = cdo.c Arith.c Arithc.c Arithdays.c Arithlat.c \
+	CDItest.c CDIread.c CDIwrite.c Cat.c Change.c Change_e5slm.c \
+	Cloudlayer.c Command.c Comp.c Compc.c Complextorect.c Cond.c \
+	Cond2.c Condc.c Consecstat.c Copy.c Deltime.c Derivepar.c \
+	Detrend.c Diff.c Duplicate.c EOFs.c Eof3d.c EcaIndices.c \
+	Echam5ini.c Enlarge.c Enlargegrid.c Ensstat.c Ensstat3.c \
+	Ensval.c Eofcoeff.c Eofcoeff3d.c Exprf.c FC.c Filedes.c \
+	Fillmiss.c Filter.c Fldrms.c Fldstat.c Fldstat2.c Fourier.c \
+	Gather.c Gengrid.c Gradsdes.c Gridboxstat.c Gridcell.c \
+	Harmonic.c Hi.c Histogram.c Importamsr.c Importbinary.c \
+	Importcmsaf.c Importobs.c Info.c Input.c Intgrid.c \
+	Intgridtraj.c Intlevel.c Intlevel3d.c Intntime.c Inttime.c \
+	Intyear.c Invert.c Invertlev.c Isosurface.c Kvl.c Log.c \
+	Maskbox.c Mastrfu.c Math.c Merge.c Mergegrid.c Mergetime.c \
+	Merstat.c Monarith.c Mrotuv.c Mrotuvb.c Ninfo.c Nmltest.c \
+	Output.c Outputgmt.c Pinfo.c Pressure.c Regres.c Remap.c \
+	Remapeta.c Replace.c Replacevalues.c Rhopot.c Rotuv.c \
+	Runpctl.c Runstat.c Scatter.c Seascount.c Seaspctl.c \
+	Seasstat.c Selbox.c Select.c Seloperator.c Selrec.c Seltime.c \
+	Selvar.c Set.c Setbox.c Setgatt.c Setgrid.c Sethalo.c \
+	Setmiss.c Setpartab.c Setrcaname.c Settime.c Setzaxis.c \
+	Showinfo.c Sinfo.c Smooth9.c Sort.c Sorttimestamp.c Specinfo.c \
+	Spectral.c Spectrum.c Split.c Splitrec.c Splitsel.c \
+	Splittime.c Splityear.c SSOpar.c Subtrend.c Tee.c Templates.c \
+	Test.c Tests.c Timcount.c Timpctl.c Timselpctl.c Timselstat.c \
+	Timsort.c Timstat.c Timstat2.c Timstat3.c Tinfo.c Tocomplex.c \
+	Transpose.c Trend.c Trms.c Tstepcount.c Vardup.c Vargen.c \
+	Varrms.c Vertint.c Vertstat.c Vertwind.c Wct.c Wind.c \
+	Writegrid.c Writerandom.c YAR.c Ydayarith.c Ydaypctl.c \
+	Ydaystat.c Ydrunpctl.c Ydrunstat.c Yhourarith.c Yhourstat.c \
+	Ymonarith.c Ymonpctl.c Ymonstat.c Yseaspctl.c Yseasstat.c \
+	Zonstat.c cdo.h cdo_int.h cdo_pthread.c cdo_vlist.c color.c \
+	color.h commandline.c const.h counter.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 field.c field.h field2.c fieldc.c fieldmem.c \
+	fieldmer.c fieldzon.c fouriertrans.c functs.h gradsdeslib.c \
+	gradsdeslib.h grid.c grid.h grid_gme.c grid_lcc.c grid_rot.c \
+	griddes.c griddes.h griddes_h5.c griddes_nc.c hetaeta.c \
+	hetaeta.h history.c institution.c interpol.c interpol.h job.c \
+	juldate.c kvlist.c kvlist.h legendre.c 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 \
+	pipe.c pipe.h printinfo.h process.c process.h pstream.c \
+	pstream.h pstream_int.h pthread_debug.c pthread_debug.h \
+	readline.c realtime.c remap.h remaplib.c remapsort.c \
+	specspace.c specspace.h statistic.c statistic.h table.c \
+	timebase.h timer.c userlog.c util.c util.h vinterp.c vinterp.h \
+	zaxis.c Magplot.c Magvector.c Maggraph.c template_parser.h \
+	template_parser.c results_template_parser.h \
+	results_template_parser.c magics_template_parser.h \
+	magics_template_parser.c StringUtilities.h StringUtilities.c \
+	CdoMagicsMapper.h CdoMagicsMapper.c
+ at ENABLE_MAGICS_TRUE@am__objects_1 = cdo-Magplot.$(OBJEXT) \
+ at ENABLE_MAGICS_TRUE@	cdo-Magvector.$(OBJEXT) \
+ at ENABLE_MAGICS_TRUE@	cdo-Maggraph.$(OBJEXT) \
+ at ENABLE_MAGICS_TRUE@	cdo-template_parser.$(OBJEXT) \
+ at ENABLE_MAGICS_TRUE@	cdo-results_template_parser.$(OBJEXT) \
+ at ENABLE_MAGICS_TRUE@	cdo-magics_template_parser.$(OBJEXT) \
+ at ENABLE_MAGICS_TRUE@	cdo-StringUtilities.$(OBJEXT) \
+ at ENABLE_MAGICS_TRUE@	cdo-CdoMagicsMapper.$(OBJEXT)
+am_cdo_OBJECTS = cdo-cdo.$(OBJEXT) cdo-Arith.$(OBJEXT) \
+	cdo-Arithc.$(OBJEXT) cdo-Arithdays.$(OBJEXT) \
+	cdo-Arithlat.$(OBJEXT) cdo-CDItest.$(OBJEXT) \
+	cdo-CDIread.$(OBJEXT) cdo-CDIwrite.$(OBJEXT) cdo-Cat.$(OBJEXT) \
+	cdo-Change.$(OBJEXT) cdo-Change_e5slm.$(OBJEXT) \
+	cdo-Cloudlayer.$(OBJEXT) cdo-Command.$(OBJEXT) \
+	cdo-Comp.$(OBJEXT) cdo-Compc.$(OBJEXT) \
+	cdo-Complextorect.$(OBJEXT) cdo-Cond.$(OBJEXT) \
+	cdo-Cond2.$(OBJEXT) cdo-Condc.$(OBJEXT) \
+	cdo-Consecstat.$(OBJEXT) cdo-Copy.$(OBJEXT) \
+	cdo-Deltime.$(OBJEXT) cdo-Derivepar.$(OBJEXT) \
+	cdo-Detrend.$(OBJEXT) cdo-Diff.$(OBJEXT) \
+	cdo-Duplicate.$(OBJEXT) cdo-EOFs.$(OBJEXT) cdo-Eof3d.$(OBJEXT) \
+	cdo-EcaIndices.$(OBJEXT) cdo-Echam5ini.$(OBJEXT) \
+	cdo-Enlarge.$(OBJEXT) cdo-Enlargegrid.$(OBJEXT) \
+	cdo-Ensstat.$(OBJEXT) cdo-Ensstat3.$(OBJEXT) \
+	cdo-Ensval.$(OBJEXT) cdo-Eofcoeff.$(OBJEXT) \
+	cdo-Eofcoeff3d.$(OBJEXT) cdo-Exprf.$(OBJEXT) cdo-FC.$(OBJEXT) \
+	cdo-Filedes.$(OBJEXT) cdo-Fillmiss.$(OBJEXT) \
+	cdo-Filter.$(OBJEXT) cdo-Fldrms.$(OBJEXT) \
+	cdo-Fldstat.$(OBJEXT) cdo-Fldstat2.$(OBJEXT) \
+	cdo-Fourier.$(OBJEXT) cdo-Gather.$(OBJEXT) \
+	cdo-Gengrid.$(OBJEXT) cdo-Gradsdes.$(OBJEXT) \
+	cdo-Gridboxstat.$(OBJEXT) cdo-Gridcell.$(OBJEXT) \
+	cdo-Harmonic.$(OBJEXT) cdo-Hi.$(OBJEXT) \
+	cdo-Histogram.$(OBJEXT) cdo-Importamsr.$(OBJEXT) \
+	cdo-Importbinary.$(OBJEXT) cdo-Importcmsaf.$(OBJEXT) \
+	cdo-Importobs.$(OBJEXT) cdo-Info.$(OBJEXT) cdo-Input.$(OBJEXT) \
+	cdo-Intgrid.$(OBJEXT) cdo-Intgridtraj.$(OBJEXT) \
+	cdo-Intlevel.$(OBJEXT) cdo-Intlevel3d.$(OBJEXT) \
+	cdo-Intntime.$(OBJEXT) cdo-Inttime.$(OBJEXT) \
+	cdo-Intyear.$(OBJEXT) cdo-Invert.$(OBJEXT) \
+	cdo-Invertlev.$(OBJEXT) cdo-Isosurface.$(OBJEXT) \
+	cdo-Kvl.$(OBJEXT) cdo-Log.$(OBJEXT) cdo-Maskbox.$(OBJEXT) \
+	cdo-Mastrfu.$(OBJEXT) cdo-Math.$(OBJEXT) cdo-Merge.$(OBJEXT) \
+	cdo-Mergegrid.$(OBJEXT) cdo-Mergetime.$(OBJEXT) \
+	cdo-Merstat.$(OBJEXT) cdo-Monarith.$(OBJEXT) \
+	cdo-Mrotuv.$(OBJEXT) cdo-Mrotuvb.$(OBJEXT) cdo-Ninfo.$(OBJEXT) \
+	cdo-Nmltest.$(OBJEXT) cdo-Output.$(OBJEXT) \
+	cdo-Outputgmt.$(OBJEXT) cdo-Pinfo.$(OBJEXT) \
+	cdo-Pressure.$(OBJEXT) cdo-Regres.$(OBJEXT) \
+	cdo-Remap.$(OBJEXT) cdo-Remapeta.$(OBJEXT) \
+	cdo-Replace.$(OBJEXT) cdo-Replacevalues.$(OBJEXT) \
+	cdo-Rhopot.$(OBJEXT) cdo-Rotuv.$(OBJEXT) cdo-Runpctl.$(OBJEXT) \
+	cdo-Runstat.$(OBJEXT) cdo-Scatter.$(OBJEXT) \
+	cdo-Seascount.$(OBJEXT) cdo-Seaspctl.$(OBJEXT) \
+	cdo-Seasstat.$(OBJEXT) cdo-Selbox.$(OBJEXT) \
+	cdo-Select.$(OBJEXT) cdo-Seloperator.$(OBJEXT) \
+	cdo-Selrec.$(OBJEXT) cdo-Seltime.$(OBJEXT) \
+	cdo-Selvar.$(OBJEXT) cdo-Set.$(OBJEXT) cdo-Setbox.$(OBJEXT) \
+	cdo-Setgatt.$(OBJEXT) cdo-Setgrid.$(OBJEXT) \
+	cdo-Sethalo.$(OBJEXT) cdo-Setmiss.$(OBJEXT) \
+	cdo-Setpartab.$(OBJEXT) cdo-Setrcaname.$(OBJEXT) \
+	cdo-Settime.$(OBJEXT) cdo-Setzaxis.$(OBJEXT) \
+	cdo-Showinfo.$(OBJEXT) cdo-Sinfo.$(OBJEXT) \
+	cdo-Smooth9.$(OBJEXT) cdo-Sort.$(OBJEXT) \
+	cdo-Sorttimestamp.$(OBJEXT) cdo-Specinfo.$(OBJEXT) \
+	cdo-Spectral.$(OBJEXT) cdo-Spectrum.$(OBJEXT) \
+	cdo-Split.$(OBJEXT) cdo-Splitrec.$(OBJEXT) \
+	cdo-Splitsel.$(OBJEXT) cdo-Splittime.$(OBJEXT) \
+	cdo-Splityear.$(OBJEXT) cdo-SSOpar.$(OBJEXT) \
+	cdo-Subtrend.$(OBJEXT) cdo-Tee.$(OBJEXT) \
+	cdo-Templates.$(OBJEXT) cdo-Test.$(OBJEXT) cdo-Tests.$(OBJEXT) \
+	cdo-Timcount.$(OBJEXT) cdo-Timpctl.$(OBJEXT) \
+	cdo-Timselpctl.$(OBJEXT) cdo-Timselstat.$(OBJEXT) \
+	cdo-Timsort.$(OBJEXT) cdo-Timstat.$(OBJEXT) \
+	cdo-Timstat2.$(OBJEXT) cdo-Timstat3.$(OBJEXT) \
+	cdo-Tinfo.$(OBJEXT) cdo-Tocomplex.$(OBJEXT) \
+	cdo-Transpose.$(OBJEXT) cdo-Trend.$(OBJEXT) cdo-Trms.$(OBJEXT) \
+	cdo-Tstepcount.$(OBJEXT) cdo-Vardup.$(OBJEXT) \
+	cdo-Vargen.$(OBJEXT) cdo-Varrms.$(OBJEXT) \
+	cdo-Vertint.$(OBJEXT) cdo-Vertstat.$(OBJEXT) \
+	cdo-Vertwind.$(OBJEXT) cdo-Wct.$(OBJEXT) cdo-Wind.$(OBJEXT) \
+	cdo-Writegrid.$(OBJEXT) cdo-Writerandom.$(OBJEXT) \
+	cdo-YAR.$(OBJEXT) cdo-Ydayarith.$(OBJEXT) \
+	cdo-Ydaypctl.$(OBJEXT) cdo-Ydaystat.$(OBJEXT) \
+	cdo-Ydrunpctl.$(OBJEXT) cdo-Ydrunstat.$(OBJEXT) \
+	cdo-Yhourarith.$(OBJEXT) cdo-Yhourstat.$(OBJEXT) \
+	cdo-Ymonarith.$(OBJEXT) cdo-Ymonpctl.$(OBJEXT) \
+	cdo-Ymonstat.$(OBJEXT) cdo-Yseaspctl.$(OBJEXT) \
+	cdo-Yseasstat.$(OBJEXT) cdo-Zonstat.$(OBJEXT) \
+	cdo-cdo_pthread.$(OBJEXT) cdo-cdo_vlist.$(OBJEXT) \
+	cdo-color.$(OBJEXT) cdo-commandline.$(OBJEXT) \
+	cdo-ecacore.$(OBJEXT) cdo-ecautil.$(OBJEXT) \
+	cdo-exception.$(OBJEXT) cdo-expr.$(OBJEXT) \
+	cdo-expr_lex.$(OBJEXT) cdo-expr_yacc.$(OBJEXT) \
+	cdo-field.$(OBJEXT) cdo-field2.$(OBJEXT) cdo-fieldc.$(OBJEXT) \
+	cdo-fieldmem.$(OBJEXT) cdo-fieldmer.$(OBJEXT) \
+	cdo-fieldzon.$(OBJEXT) cdo-fouriertrans.$(OBJEXT) \
+	cdo-gradsdeslib.$(OBJEXT) cdo-grid.$(OBJEXT) \
+	cdo-grid_gme.$(OBJEXT) cdo-grid_lcc.$(OBJEXT) \
+	cdo-grid_rot.$(OBJEXT) cdo-griddes.$(OBJEXT) \
+	cdo-griddes_h5.$(OBJEXT) cdo-griddes_nc.$(OBJEXT) \
+	cdo-hetaeta.$(OBJEXT) cdo-history.$(OBJEXT) \
+	cdo-institution.$(OBJEXT) cdo-interpol.$(OBJEXT) \
+	cdo-job.$(OBJEXT) cdo-juldate.$(OBJEXT) cdo-kvlist.$(OBJEXT) \
+	cdo-legendre.$(OBJEXT) cdo-list.$(OBJEXT) \
+	cdo-merge_sort2.$(OBJEXT) cdo-modules.$(OBJEXT) \
+	cdo-namelist.$(OBJEXT) cdo-normal.$(OBJEXT) \
+	cdo-nth_element.$(OBJEXT) cdo-par_io.$(OBJEXT) \
+	cdo-percentiles.$(OBJEXT) cdo-pipe.$(OBJEXT) \
+	cdo-process.$(OBJEXT) cdo-pstream.$(OBJEXT) \
+	cdo-pthread_debug.$(OBJEXT) cdo-readline.$(OBJEXT) \
+	cdo-realtime.$(OBJEXT) cdo-remaplib.$(OBJEXT) \
+	cdo-remapsort.$(OBJEXT) cdo-specspace.$(OBJEXT) \
+	cdo-statistic.$(OBJEXT) cdo-table.$(OBJEXT) \
+	cdo-timer.$(OBJEXT) cdo-userlog.$(OBJEXT) cdo-util.$(OBJEXT) \
+	cdo-vinterp.$(OBJEXT) cdo-zaxis.$(OBJEXT) $(am__objects_1)
+cdo_OBJECTS = $(am_cdo_OBJECTS)
+cdo_DEPENDENCIES = $(top_builddir)/libcdi/src/libcdi.la
+cdo_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(cdo_LDFLAGS) \
+	$(LDFLAGS) -o $@
+am_cdotest_OBJECTS = cdotest-cdotest.$(OBJEXT)
+cdotest_OBJECTS = $(am_cdotest_OBJECTS)
+cdotest_DEPENDENCIES = $(cdo_LDADD)
+cdotest_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(cdotest_LDFLAGS) \
+	$(LDFLAGS) -o $@
+DEFAULT_INCLUDES = -I. at am__isrc@
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+	$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+	$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+CCLD = $(CC)
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+	--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
+	$(LDFLAGS) -o $@
+SOURCES = $(cdo_SOURCES) $(cdotest_SOURCES)
+DIST_SOURCES = $(am__cdo_SOURCES_DIST) $(cdotest_SOURCES)
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+ETAGS = etags
+CTAGS = ctags
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CLDFLAGS = @CLDFLAGS@
+CLIBS = @CLIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
+ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
+ENABLE_EXTRA = @ENABLE_EXTRA@
+ENABLE_GRIB = @ENABLE_GRIB@
+ENABLE_IEG = @ENABLE_IEG@
+ENABLE_SERVICE = @ENABLE_SERVICE@
+EXEEXT = @EXEEXT@
+FCFLAGS = @FCFLAGS@
+FGREP = @FGREP@
+GREP = @GREP@
+GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
+GRIB_API_LIBS = @GRIB_API_LIBS@
+HDF5_INCLUDE = @HDF5_INCLUDE@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_ROOT = @HDF5_ROOT@
+HOST_NAME = @HOST_NAME@
+INCLUDES = @INCLUDES@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JASPER_LIBS = @JASPER_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAGICS_INCLUDE = @MAGICS_INCLUDE@
+MAGICS_LIBS = @MAGICS_LIBS@
+MAGICS_ROOT = @MAGICS_ROOT@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NC_CONFIG = @NC_CONFIG@
+NETCDF_INCLUDE = @NETCDF_INCLUDE@
+NETCDF_LIBS = @NETCDF_LIBS@
+NETCDF_ROOT = @NETCDF_ROOT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PROJ_INCLUDE = @PROJ_INCLUDE@
+PROJ_LDFLAGS = @PROJ_LDFLAGS@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYSTEM_TYPE = @SYSTEM_TYPE@
+SZLIB_INCLUDE = @SZLIB_INCLUDE@
+SZLIB_LIBS = @SZLIB_LIBS@
+THREADS_INCLUDE = @THREADS_INCLUDE@
+THREADS_LIBS = @THREADS_LIBS@
+UDUNITS_INCLUDE = @UDUNITS_INCLUDE@
+UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@
+USER_NAME = @USER_NAME@
+VERSION = @VERSION@
+XML2_LIBS = @XML2_LIBS@
+ZLIB_INCLUDE = @ZLIB_INCLUDE@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+#
+cdo_SOURCES = cdo.c Arith.c Arithc.c Arithdays.c Arithlat.c CDItest.c \
+	CDIread.c CDIwrite.c Cat.c Change.c Change_e5slm.c \
+	Cloudlayer.c Command.c Comp.c Compc.c Complextorect.c Cond.c \
+	Cond2.c Condc.c Consecstat.c Copy.c Deltime.c Derivepar.c \
+	Detrend.c Diff.c Duplicate.c EOFs.c Eof3d.c EcaIndices.c \
+	Echam5ini.c Enlarge.c Enlargegrid.c Ensstat.c Ensstat3.c \
+	Ensval.c Eofcoeff.c Eofcoeff3d.c Exprf.c FC.c Filedes.c \
+	Fillmiss.c Filter.c Fldrms.c Fldstat.c Fldstat2.c Fourier.c \
+	Gather.c Gengrid.c Gradsdes.c Gridboxstat.c Gridcell.c \
+	Harmonic.c Hi.c Histogram.c Importamsr.c Importbinary.c \
+	Importcmsaf.c Importobs.c Info.c Input.c Intgrid.c \
+	Intgridtraj.c Intlevel.c Intlevel3d.c Intntime.c Inttime.c \
+	Intyear.c Invert.c Invertlev.c Isosurface.c Kvl.c Log.c \
+	Maskbox.c Mastrfu.c Math.c Merge.c Mergegrid.c Mergetime.c \
+	Merstat.c Monarith.c Mrotuv.c Mrotuvb.c Ninfo.c Nmltest.c \
+	Output.c Outputgmt.c Pinfo.c Pressure.c Regres.c Remap.c \
+	Remapeta.c Replace.c Replacevalues.c Rhopot.c Rotuv.c \
+	Runpctl.c Runstat.c Scatter.c Seascount.c Seaspctl.c \
+	Seasstat.c Selbox.c Select.c Seloperator.c Selrec.c Seltime.c \
+	Selvar.c Set.c Setbox.c Setgatt.c Setgrid.c Sethalo.c \
+	Setmiss.c Setpartab.c Setrcaname.c Settime.c Setzaxis.c \
+	Showinfo.c Sinfo.c Smooth9.c Sort.c Sorttimestamp.c Specinfo.c \
+	Spectral.c Spectrum.c Split.c Splitrec.c Splitsel.c \
+	Splittime.c Splityear.c SSOpar.c Subtrend.c Tee.c Templates.c \
+	Test.c Tests.c Timcount.c Timpctl.c Timselpctl.c Timselstat.c \
+	Timsort.c Timstat.c Timstat2.c Timstat3.c Tinfo.c Tocomplex.c \
+	Transpose.c Trend.c Trms.c Tstepcount.c Vardup.c Vargen.c \
+	Varrms.c Vertint.c Vertstat.c Vertwind.c Wct.c Wind.c \
+	Writegrid.c Writerandom.c YAR.c Ydayarith.c Ydaypctl.c \
+	Ydaystat.c Ydrunpctl.c Ydrunstat.c Yhourarith.c Yhourstat.c \
+	Ymonarith.c Ymonpctl.c Ymonstat.c Yseaspctl.c Yseasstat.c \
+	Zonstat.c cdo.h cdo_int.h cdo_pthread.c cdo_vlist.c color.c \
+	color.h commandline.c const.h counter.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 field.c field.h field2.c fieldc.c fieldmem.c \
+	fieldmer.c fieldzon.c fouriertrans.c functs.h gradsdeslib.c \
+	gradsdeslib.h grid.c grid.h grid_gme.c grid_lcc.c grid_rot.c \
+	griddes.c griddes.h griddes_h5.c griddes_nc.c hetaeta.c \
+	hetaeta.h history.c institution.c interpol.c interpol.h job.c \
+	juldate.c kvlist.c kvlist.h legendre.c 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 \
+	pipe.c pipe.h printinfo.h process.c process.h pstream.c \
+	pstream.h pstream_int.h pthread_debug.c pthread_debug.h \
+	readline.c realtime.c remap.h remaplib.c remapsort.c \
+	specspace.c specspace.h statistic.c statistic.h table.c \
+	timebase.h timer.c userlog.c util.c util.h vinterp.c vinterp.h \
+	zaxis.c $(am__append_1)
+cdo_CPPFLAGS = -I$(top_srcdir)/libcdi/src
+cdo_LDADD = $(top_builddir)/libcdi/src/libcdi.la
+cdo_LDFLAGS = $(am__append_2)
+cdotest_SOURCES = cdo_int.h	\
+	           cdotest.c
+
+cdotest_LDADD = $(cdo_LDADD)
+cdotest_CPPFLAGS = $(cdo_CPPFLAGS)
+cdotest_LDFLAGS = $(cdo_LDFLAGS) $(am__append_3)
+#
+CLEANFILES = `ls *~ 2> /dev/null`
+all: config.h
+	$(MAKE) $(AM_MAKEFLAGS) all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu src/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+config.h: stamp-h1
+	@if test ! -f $@; then rm -f stamp-h1; else :; fi
+	@if test ! -f $@; then $(MAKE) $(AM_MAKEFLAGS) stamp-h1; else :; fi
+
+stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
+	@rm -f stamp-h1
+	cd $(top_builddir) && $(SHELL) ./config.status src/config.h
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
+	($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+	rm -f stamp-h1
+	touch $@
+
+distclean-hdr:
+	-rm -f config.h stamp-h1
+install-binPROGRAMS: $(bin_PROGRAMS)
+	@$(NORMAL_INSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	if test -n "$$list"; then \
+	  echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+	  $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+	fi; \
+	for p in $$list; do echo "$$p $$p"; done | \
+	sed 's/$(EXEEXT)$$//' | \
+	while read p p1; do if test -f $$p || test -f $$p1; \
+	  then echo "$$p"; echo "$$p"; else :; fi; \
+	done | \
+	sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+	    -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
+	sed 'N;N;N;s,\n, ,g' | \
+	$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
+	  { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+	    if ($$2 == $$4) files[d] = files[d] " " $$1; \
+	    else { print "f", $$3 "/" $$4, $$1; } } \
+	  END { for (d in files) print "f", d, files[d] }' | \
+	while read type dir files; do \
+	    if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+	    test -z "$$files" || { \
+	    echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \
+	    $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \
+	    } \
+	; done
+
+uninstall-binPROGRAMS:
+	@$(NORMAL_UNINSTALL)
+	@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+	files=`for p in $$list; do echo "$$p"; done | \
+	  sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+	      -e 's/$$/$(EXEEXT)/' `; \
+	test -n "$$list" || exit 0; \
+	echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
+	cd "$(DESTDIR)$(bindir)" && rm -f $$files
+
+clean-binPROGRAMS:
+	@list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+
+clean-noinstPROGRAMS:
+	@list='$(noinst_PROGRAMS)'; test -n "$$list" || exit 0; \
+	echo " rm -f" $$list; \
+	rm -f $$list || exit $$?; \
+	test -n "$(EXEEXT)" || exit 0; \
+	list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
+	echo " rm -f" $$list; \
+	rm -f $$list
+cdo$(EXEEXT): $(cdo_OBJECTS) $(cdo_DEPENDENCIES) $(EXTRA_cdo_DEPENDENCIES) 
+	@rm -f cdo$(EXEEXT)
+	$(cdo_LINK) $(cdo_OBJECTS) $(cdo_LDADD) $(LIBS)
+cdotest$(EXEEXT): $(cdotest_OBJECTS) $(cdotest_DEPENDENCIES) $(EXTRA_cdotest_DEPENDENCIES) 
+	@rm -f cdotest$(EXEEXT)
+	$(cdotest_LINK) $(cdotest_OBJECTS) $(cdotest_LDADD) $(LIBS)
+
+mostlyclean-compile:
+	-rm -f *.$(OBJEXT)
+
+distclean-compile:
+	-rm -f *.tab.c
+
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Arith.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Arithc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Arithdays.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Arithlat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-CDIread.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-CDItest.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-CDIwrite.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Cat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-CdoMagicsMapper.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Change.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Change_e5slm.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Cloudlayer.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Command.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Comp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Compc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Complextorect.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Cond.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Cond2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Condc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Consecstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Copy.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Deltime.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Derivepar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Detrend.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Diff.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Duplicate.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-EOFs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-EcaIndices.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Echam5ini.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Enlarge.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Enlargegrid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ensstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ensstat3.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ensval.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Eof3d.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Eofcoeff.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Eofcoeff3d.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Exprf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-FC.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Filedes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Fillmiss.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Filter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Fldrms.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Fldstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Fldstat2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Fourier.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Gather.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Gengrid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Gradsdes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Gridboxstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Gridcell.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Harmonic.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Hi.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Histogram.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Importamsr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Importbinary.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Importcmsaf.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Importobs.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Info.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Input.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Intgrid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Intgridtraj.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Intlevel.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Intlevel3d.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Intntime.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Inttime.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Intyear.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Invert.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Invertlev.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Isosurface.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Kvl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Log.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Maggraph.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Magplot.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Magvector.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Maskbox.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Mastrfu.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Math.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Merge.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Mergegrid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Mergetime.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Merstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Monarith.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Mrotuv.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Mrotuvb.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ninfo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Nmltest.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Output.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Outputgmt.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Pinfo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Pressure.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Regres.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Remap.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Remapeta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Replace.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Replacevalues.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Rhopot.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Rotuv.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Runpctl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Runstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-SSOpar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Scatter.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Seascount.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Seaspctl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Seasstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Selbox.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Select.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Seloperator.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Selrec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Seltime.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Selvar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Set.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Setbox.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Setgatt.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Setgrid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Sethalo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Setmiss.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Setpartab.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Setrcaname.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Settime.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Setzaxis.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Showinfo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Sinfo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Smooth9.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Sort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Sorttimestamp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Specinfo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Spectral.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Spectrum.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Split.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Splitrec.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Splitsel.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Splittime.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Splityear.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-StringUtilities.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Subtrend.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Tee.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Templates.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Test.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Tests.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Timcount.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Timpctl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Timselpctl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Timselstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Timsort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Timstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Timstat2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Timstat3.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Tinfo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Tocomplex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Transpose.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Trend.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Trms.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Tstepcount.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Vardup.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Vargen.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Varrms.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Vertint.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Vertstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Vertwind.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Wct.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Wind.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Writegrid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Writerandom.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-YAR.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ydayarith.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ydaypctl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ydaystat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ydrunpctl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ydrunstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Yhourarith.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Yhourstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ymonarith.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ymonpctl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Ymonstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Yseaspctl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Yseasstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-Zonstat.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-cdo.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-cdo_pthread.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-cdo_vlist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-color.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-commandline.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-ecacore.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-ecautil.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-exception.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-expr.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-expr_lex.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-expr_yacc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-field.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-field2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-fieldc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-fieldmem.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-fieldmer.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-fieldzon.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-fouriertrans.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-gradsdeslib.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-grid.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-grid_gme.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-grid_lcc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-grid_rot.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-griddes.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-griddes_h5.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-griddes_nc.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-hetaeta.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-history.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-institution.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-interpol.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-job.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-juldate.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-kvlist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-legendre.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-list.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-magics_template_parser.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-merge_sort2.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-modules.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-namelist.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-normal.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-nth_element.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-par_io.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-percentiles.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-pipe.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-process.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-pstream.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-pthread_debug.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-readline.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-realtime.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-remaplib.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-remapsort.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-results_template_parser.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-specspace.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-statistic.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-table.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-template_parser.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-timer.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-userlog.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-util.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-vinterp.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdo-zaxis.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at ./$(DEPDIR)/cdotest-cdotest.Po at am__quote@
+
+.c.o:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c $<
+
+.c.obj:
+ at am__fastdepCC_TRUE@	$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+ at am__fastdepCC_TRUE@	$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(LTCOMPILE) -c -o $@ $<
+
+cdo-cdo.o: cdo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-cdo.o -MD -MP -MF $(DEPDIR)/cdo-cdo.Tpo -c -o cdo-cdo.o `test -f 'cdo.c' || echo '$(srcdir)/'`cdo.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-cdo.Tpo $(DEPDIR)/cdo-cdo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cdo.c' object='cdo-cdo.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-cdo.o `test -f 'cdo.c' || echo '$(srcdir)/'`cdo.c
+
+cdo-cdo.obj: cdo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-cdo.obj -MD -MP -MF $(DEPDIR)/cdo-cdo.Tpo -c -o cdo-cdo.obj `if test -f 'cdo.c'; then $(CYGPATH_W) 'cdo.c'; else $(CYGPATH_W) '$(srcdir)/cdo.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-cdo.Tpo $(DEPDIR)/cdo-cdo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cdo.c' object='cdo-cdo.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-cdo.obj `if test -f 'cdo.c'; then $(CYGPATH_W) 'cdo.c'; else $(CYGPATH_W) '$(srcdir)/cdo.c'; fi`
+
+cdo-Arith.o: Arith.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Arith.o -MD -MP -MF $(DEPDIR)/cdo-Arith.Tpo -c -o cdo-Arith.o `test -f 'Arith.c' || echo '$(srcdir)/'`Arith.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Arith.Tpo $(DEPDIR)/cdo-Arith.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Arith.c' object='cdo-Arith.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Arith.o `test -f 'Arith.c' || echo '$(srcdir)/'`Arith.c
+
+cdo-Arith.obj: Arith.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Arith.obj -MD -MP -MF $(DEPDIR)/cdo-Arith.Tpo -c -o cdo-Arith.obj `if test -f 'Arith.c'; then $(CYGPATH_W) 'Arith.c'; else $(CYGPATH_W) '$(srcdir)/Arith.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Arith.Tpo $(DEPDIR)/cdo-Arith.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Arith.c' object='cdo-Arith.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Arith.obj `if test -f 'Arith.c'; then $(CYGPATH_W) 'Arith.c'; else $(CYGPATH_W) '$(srcdir)/Arith.c'; fi`
+
+cdo-Arithc.o: Arithc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Arithc.o -MD -MP -MF $(DEPDIR)/cdo-Arithc.Tpo -c -o cdo-Arithc.o `test -f 'Arithc.c' || echo '$(srcdir)/'`Arithc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Arithc.Tpo $(DEPDIR)/cdo-Arithc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Arithc.c' object='cdo-Arithc.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Arithc.o `test -f 'Arithc.c' || echo '$(srcdir)/'`Arithc.c
+
+cdo-Arithc.obj: Arithc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Arithc.obj -MD -MP -MF $(DEPDIR)/cdo-Arithc.Tpo -c -o cdo-Arithc.obj `if test -f 'Arithc.c'; then $(CYGPATH_W) 'Arithc.c'; else $(CYGPATH_W) '$(srcdir)/Arithc.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Arithc.Tpo $(DEPDIR)/cdo-Arithc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Arithc.c' object='cdo-Arithc.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Arithc.obj `if test -f 'Arithc.c'; then $(CYGPATH_W) 'Arithc.c'; else $(CYGPATH_W) '$(srcdir)/Arithc.c'; fi`
+
+cdo-Arithdays.o: Arithdays.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Arithdays.o -MD -MP -MF $(DEPDIR)/cdo-Arithdays.Tpo -c -o cdo-Arithdays.o `test -f 'Arithdays.c' || echo '$(srcdir)/'`Arithdays.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Arithdays.Tpo $(DEPDIR)/cdo-Arithdays.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Arithdays.c' object='cdo-Arithdays.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Arithdays.o `test -f 'Arithdays.c' || echo '$(srcdir)/'`Arithdays.c
+
+cdo-Arithdays.obj: Arithdays.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Arithdays.obj -MD -MP -MF $(DEPDIR)/cdo-Arithdays.Tpo -c -o cdo-Arithdays.obj `if test -f 'Arithdays.c'; then $(CYGPATH_W) 'Arithdays.c'; else $(CYGPATH_W) '$(srcdir)/Arithdays.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Arithdays.Tpo $(DEPDIR)/cdo-Arithdays.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Arithdays.c' object='cdo-Arithdays.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Arithdays.obj `if test -f 'Arithdays.c'; then $(CYGPATH_W) 'Arithdays.c'; else $(CYGPATH_W) '$(srcdir)/Arithdays.c'; fi`
+
+cdo-Arithlat.o: Arithlat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Arithlat.o -MD -MP -MF $(DEPDIR)/cdo-Arithlat.Tpo -c -o cdo-Arithlat.o `test -f 'Arithlat.c' || echo '$(srcdir)/'`Arithlat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Arithlat.Tpo $(DEPDIR)/cdo-Arithlat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Arithlat.c' object='cdo-Arithlat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Arithlat.o `test -f 'Arithlat.c' || echo '$(srcdir)/'`Arithlat.c
+
+cdo-Arithlat.obj: Arithlat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Arithlat.obj -MD -MP -MF $(DEPDIR)/cdo-Arithlat.Tpo -c -o cdo-Arithlat.obj `if test -f 'Arithlat.c'; then $(CYGPATH_W) 'Arithlat.c'; else $(CYGPATH_W) '$(srcdir)/Arithlat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Arithlat.Tpo $(DEPDIR)/cdo-Arithlat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Arithlat.c' object='cdo-Arithlat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Arithlat.obj `if test -f 'Arithlat.c'; then $(CYGPATH_W) 'Arithlat.c'; else $(CYGPATH_W) '$(srcdir)/Arithlat.c'; fi`
+
+cdo-CDItest.o: CDItest.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-CDItest.o -MD -MP -MF $(DEPDIR)/cdo-CDItest.Tpo -c -o cdo-CDItest.o `test -f 'CDItest.c' || echo '$(srcdir)/'`CDItest.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-CDItest.Tpo $(DEPDIR)/cdo-CDItest.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='CDItest.c' object='cdo-CDItest.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-CDItest.o `test -f 'CDItest.c' || echo '$(srcdir)/'`CDItest.c
+
+cdo-CDItest.obj: CDItest.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-CDItest.obj -MD -MP -MF $(DEPDIR)/cdo-CDItest.Tpo -c -o cdo-CDItest.obj `if test -f 'CDItest.c'; then $(CYGPATH_W) 'CDItest.c'; else $(CYGPATH_W) '$(srcdir)/CDItest.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-CDItest.Tpo $(DEPDIR)/cdo-CDItest.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='CDItest.c' object='cdo-CDItest.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-CDItest.obj `if test -f 'CDItest.c'; then $(CYGPATH_W) 'CDItest.c'; else $(CYGPATH_W) '$(srcdir)/CDItest.c'; fi`
+
+cdo-CDIread.o: CDIread.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-CDIread.o -MD -MP -MF $(DEPDIR)/cdo-CDIread.Tpo -c -o cdo-CDIread.o `test -f 'CDIread.c' || echo '$(srcdir)/'`CDIread.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-CDIread.Tpo $(DEPDIR)/cdo-CDIread.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='CDIread.c' object='cdo-CDIread.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-CDIread.o `test -f 'CDIread.c' || echo '$(srcdir)/'`CDIread.c
+
+cdo-CDIread.obj: CDIread.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-CDIread.obj -MD -MP -MF $(DEPDIR)/cdo-CDIread.Tpo -c -o cdo-CDIread.obj `if test -f 'CDIread.c'; then $(CYGPATH_W) 'CDIread.c'; else $(CYGPATH_W) '$(srcdir)/CDIread.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-CDIread.Tpo $(DEPDIR)/cdo-CDIread.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='CDIread.c' object='cdo-CDIread.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-CDIread.obj `if test -f 'CDIread.c'; then $(CYGPATH_W) 'CDIread.c'; else $(CYGPATH_W) '$(srcdir)/CDIread.c'; fi`
+
+cdo-CDIwrite.o: CDIwrite.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-CDIwrite.o -MD -MP -MF $(DEPDIR)/cdo-CDIwrite.Tpo -c -o cdo-CDIwrite.o `test -f 'CDIwrite.c' || echo '$(srcdir)/'`CDIwrite.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-CDIwrite.Tpo $(DEPDIR)/cdo-CDIwrite.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='CDIwrite.c' object='cdo-CDIwrite.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-CDIwrite.o `test -f 'CDIwrite.c' || echo '$(srcdir)/'`CDIwrite.c
+
+cdo-CDIwrite.obj: CDIwrite.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-CDIwrite.obj -MD -MP -MF $(DEPDIR)/cdo-CDIwrite.Tpo -c -o cdo-CDIwrite.obj `if test -f 'CDIwrite.c'; then $(CYGPATH_W) 'CDIwrite.c'; else $(CYGPATH_W) '$(srcdir)/CDIwrite.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-CDIwrite.Tpo $(DEPDIR)/cdo-CDIwrite.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='CDIwrite.c' object='cdo-CDIwrite.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-CDIwrite.obj `if test -f 'CDIwrite.c'; then $(CYGPATH_W) 'CDIwrite.c'; else $(CYGPATH_W) '$(srcdir)/CDIwrite.c'; fi`
+
+cdo-Cat.o: Cat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Cat.o -MD -MP -MF $(DEPDIR)/cdo-Cat.Tpo -c -o cdo-Cat.o `test -f 'Cat.c' || echo '$(srcdir)/'`Cat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Cat.Tpo $(DEPDIR)/cdo-Cat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Cat.c' object='cdo-Cat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Cat.o `test -f 'Cat.c' || echo '$(srcdir)/'`Cat.c
+
+cdo-Cat.obj: Cat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Cat.obj -MD -MP -MF $(DEPDIR)/cdo-Cat.Tpo -c -o cdo-Cat.obj `if test -f 'Cat.c'; then $(CYGPATH_W) 'Cat.c'; else $(CYGPATH_W) '$(srcdir)/Cat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Cat.Tpo $(DEPDIR)/cdo-Cat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Cat.c' object='cdo-Cat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Cat.obj `if test -f 'Cat.c'; then $(CYGPATH_W) 'Cat.c'; else $(CYGPATH_W) '$(srcdir)/Cat.c'; fi`
+
+cdo-Change.o: Change.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Change.o -MD -MP -MF $(DEPDIR)/cdo-Change.Tpo -c -o cdo-Change.o `test -f 'Change.c' || echo '$(srcdir)/'`Change.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Change.Tpo $(DEPDIR)/cdo-Change.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Change.c' object='cdo-Change.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Change.o `test -f 'Change.c' || echo '$(srcdir)/'`Change.c
+
+cdo-Change.obj: Change.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Change.obj -MD -MP -MF $(DEPDIR)/cdo-Change.Tpo -c -o cdo-Change.obj `if test -f 'Change.c'; then $(CYGPATH_W) 'Change.c'; else $(CYGPATH_W) '$(srcdir)/Change.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Change.Tpo $(DEPDIR)/cdo-Change.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Change.c' object='cdo-Change.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Change.obj `if test -f 'Change.c'; then $(CYGPATH_W) 'Change.c'; else $(CYGPATH_W) '$(srcdir)/Change.c'; fi`
+
+cdo-Change_e5slm.o: Change_e5slm.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Change_e5slm.o -MD -MP -MF $(DEPDIR)/cdo-Change_e5slm.Tpo -c -o cdo-Change_e5slm.o `test -f 'Change_e5slm.c' || echo '$(srcdir)/'`Change_e5slm.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Change_e5slm.Tpo $(DEPDIR)/cdo-Change_e5slm.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Change_e5slm.c' object='cdo-Change_e5slm.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Change_e5slm.o `test -f 'Change_e5slm.c' || echo '$(srcdir)/'`Change_e5slm.c
+
+cdo-Change_e5slm.obj: Change_e5slm.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Change_e5slm.obj -MD -MP -MF $(DEPDIR)/cdo-Change_e5slm.Tpo -c -o cdo-Change_e5slm.obj `if test -f 'Change_e5slm.c'; then $(CYGPATH_W) 'Change_e5slm.c'; else $(CYGPATH_W) '$(srcdir)/Change_e5slm.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Change_e5slm.Tpo $(DEPDIR)/cdo-Change_e5slm.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Change_e5slm.c' object='cdo-Change_e5slm.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Change_e5slm.obj `if test -f 'Change_e5slm.c'; then $(CYGPATH_W) 'Change_e5slm.c'; else $(CYGPATH_W) '$(srcdir)/Change_e5slm.c'; fi`
+
+cdo-Cloudlayer.o: Cloudlayer.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Cloudlayer.o -MD -MP -MF $(DEPDIR)/cdo-Cloudlayer.Tpo -c -o cdo-Cloudlayer.o `test -f 'Cloudlayer.c' || echo '$(srcdir)/'`Cloudlayer.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Cloudlayer.Tpo $(DEPDIR)/cdo-Cloudlayer.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Cloudlayer.c' object='cdo-Cloudlayer.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Cloudlayer.o `test -f 'Cloudlayer.c' || echo '$(srcdir)/'`Cloudlayer.c
+
+cdo-Cloudlayer.obj: Cloudlayer.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Cloudlayer.obj -MD -MP -MF $(DEPDIR)/cdo-Cloudlayer.Tpo -c -o cdo-Cloudlayer.obj `if test -f 'Cloudlayer.c'; then $(CYGPATH_W) 'Cloudlayer.c'; else $(CYGPATH_W) '$(srcdir)/Cloudlayer.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Cloudlayer.Tpo $(DEPDIR)/cdo-Cloudlayer.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Cloudlayer.c' object='cdo-Cloudlayer.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Cloudlayer.obj `if test -f 'Cloudlayer.c'; then $(CYGPATH_W) 'Cloudlayer.c'; else $(CYGPATH_W) '$(srcdir)/Cloudlayer.c'; fi`
+
+cdo-Command.o: Command.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Command.o -MD -MP -MF $(DEPDIR)/cdo-Command.Tpo -c -o cdo-Command.o `test -f 'Command.c' || echo '$(srcdir)/'`Command.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Command.Tpo $(DEPDIR)/cdo-Command.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Command.c' object='cdo-Command.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Command.o `test -f 'Command.c' || echo '$(srcdir)/'`Command.c
+
+cdo-Command.obj: Command.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Command.obj -MD -MP -MF $(DEPDIR)/cdo-Command.Tpo -c -o cdo-Command.obj `if test -f 'Command.c'; then $(CYGPATH_W) 'Command.c'; else $(CYGPATH_W) '$(srcdir)/Command.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Command.Tpo $(DEPDIR)/cdo-Command.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Command.c' object='cdo-Command.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Command.obj `if test -f 'Command.c'; then $(CYGPATH_W) 'Command.c'; else $(CYGPATH_W) '$(srcdir)/Command.c'; fi`
+
+cdo-Comp.o: Comp.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Comp.o -MD -MP -MF $(DEPDIR)/cdo-Comp.Tpo -c -o cdo-Comp.o `test -f 'Comp.c' || echo '$(srcdir)/'`Comp.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Comp.Tpo $(DEPDIR)/cdo-Comp.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Comp.c' object='cdo-Comp.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Comp.o `test -f 'Comp.c' || echo '$(srcdir)/'`Comp.c
+
+cdo-Comp.obj: Comp.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Comp.obj -MD -MP -MF $(DEPDIR)/cdo-Comp.Tpo -c -o cdo-Comp.obj `if test -f 'Comp.c'; then $(CYGPATH_W) 'Comp.c'; else $(CYGPATH_W) '$(srcdir)/Comp.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Comp.Tpo $(DEPDIR)/cdo-Comp.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Comp.c' object='cdo-Comp.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Comp.obj `if test -f 'Comp.c'; then $(CYGPATH_W) 'Comp.c'; else $(CYGPATH_W) '$(srcdir)/Comp.c'; fi`
+
+cdo-Compc.o: Compc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Compc.o -MD -MP -MF $(DEPDIR)/cdo-Compc.Tpo -c -o cdo-Compc.o `test -f 'Compc.c' || echo '$(srcdir)/'`Compc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Compc.Tpo $(DEPDIR)/cdo-Compc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Compc.c' object='cdo-Compc.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Compc.o `test -f 'Compc.c' || echo '$(srcdir)/'`Compc.c
+
+cdo-Compc.obj: Compc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Compc.obj -MD -MP -MF $(DEPDIR)/cdo-Compc.Tpo -c -o cdo-Compc.obj `if test -f 'Compc.c'; then $(CYGPATH_W) 'Compc.c'; else $(CYGPATH_W) '$(srcdir)/Compc.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Compc.Tpo $(DEPDIR)/cdo-Compc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Compc.c' object='cdo-Compc.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Compc.obj `if test -f 'Compc.c'; then $(CYGPATH_W) 'Compc.c'; else $(CYGPATH_W) '$(srcdir)/Compc.c'; fi`
+
+cdo-Complextorect.o: Complextorect.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Complextorect.o -MD -MP -MF $(DEPDIR)/cdo-Complextorect.Tpo -c -o cdo-Complextorect.o `test -f 'Complextorect.c' || echo '$(srcdir)/'`Complextorect.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Complextorect.Tpo $(DEPDIR)/cdo-Complextorect.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Complextorect.c' object='cdo-Complextorect.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Complextorect.o `test -f 'Complextorect.c' || echo '$(srcdir)/'`Complextorect.c
+
+cdo-Complextorect.obj: Complextorect.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Complextorect.obj -MD -MP -MF $(DEPDIR)/cdo-Complextorect.Tpo -c -o cdo-Complextorect.obj `if test -f 'Complextorect.c'; then $(CYGPATH_W) 'Complextorect.c'; else $(CYGPATH_W) '$(srcdir)/Complextorect.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Complextorect.Tpo $(DEPDIR)/cdo-Complextorect.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Complextorect.c' object='cdo-Complextorect.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Complextorect.obj `if test -f 'Complextorect.c'; then $(CYGPATH_W) 'Complextorect.c'; else $(CYGPATH_W) '$(srcdir)/Complextorect.c'; fi`
+
+cdo-Cond.o: Cond.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Cond.o -MD -MP -MF $(DEPDIR)/cdo-Cond.Tpo -c -o cdo-Cond.o `test -f 'Cond.c' || echo '$(srcdir)/'`Cond.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Cond.Tpo $(DEPDIR)/cdo-Cond.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Cond.c' object='cdo-Cond.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Cond.o `test -f 'Cond.c' || echo '$(srcdir)/'`Cond.c
+
+cdo-Cond.obj: Cond.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Cond.obj -MD -MP -MF $(DEPDIR)/cdo-Cond.Tpo -c -o cdo-Cond.obj `if test -f 'Cond.c'; then $(CYGPATH_W) 'Cond.c'; else $(CYGPATH_W) '$(srcdir)/Cond.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Cond.Tpo $(DEPDIR)/cdo-Cond.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Cond.c' object='cdo-Cond.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Cond.obj `if test -f 'Cond.c'; then $(CYGPATH_W) 'Cond.c'; else $(CYGPATH_W) '$(srcdir)/Cond.c'; fi`
+
+cdo-Cond2.o: Cond2.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Cond2.o -MD -MP -MF $(DEPDIR)/cdo-Cond2.Tpo -c -o cdo-Cond2.o `test -f 'Cond2.c' || echo '$(srcdir)/'`Cond2.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Cond2.Tpo $(DEPDIR)/cdo-Cond2.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Cond2.c' object='cdo-Cond2.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Cond2.o `test -f 'Cond2.c' || echo '$(srcdir)/'`Cond2.c
+
+cdo-Cond2.obj: Cond2.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Cond2.obj -MD -MP -MF $(DEPDIR)/cdo-Cond2.Tpo -c -o cdo-Cond2.obj `if test -f 'Cond2.c'; then $(CYGPATH_W) 'Cond2.c'; else $(CYGPATH_W) '$(srcdir)/Cond2.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Cond2.Tpo $(DEPDIR)/cdo-Cond2.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Cond2.c' object='cdo-Cond2.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Cond2.obj `if test -f 'Cond2.c'; then $(CYGPATH_W) 'Cond2.c'; else $(CYGPATH_W) '$(srcdir)/Cond2.c'; fi`
+
+cdo-Condc.o: Condc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Condc.o -MD -MP -MF $(DEPDIR)/cdo-Condc.Tpo -c -o cdo-Condc.o `test -f 'Condc.c' || echo '$(srcdir)/'`Condc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Condc.Tpo $(DEPDIR)/cdo-Condc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Condc.c' object='cdo-Condc.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Condc.o `test -f 'Condc.c' || echo '$(srcdir)/'`Condc.c
+
+cdo-Condc.obj: Condc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Condc.obj -MD -MP -MF $(DEPDIR)/cdo-Condc.Tpo -c -o cdo-Condc.obj `if test -f 'Condc.c'; then $(CYGPATH_W) 'Condc.c'; else $(CYGPATH_W) '$(srcdir)/Condc.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Condc.Tpo $(DEPDIR)/cdo-Condc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Condc.c' object='cdo-Condc.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Condc.obj `if test -f 'Condc.c'; then $(CYGPATH_W) 'Condc.c'; else $(CYGPATH_W) '$(srcdir)/Condc.c'; fi`
+
+cdo-Consecstat.o: Consecstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Consecstat.o -MD -MP -MF $(DEPDIR)/cdo-Consecstat.Tpo -c -o cdo-Consecstat.o `test -f 'Consecstat.c' || echo '$(srcdir)/'`Consecstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Consecstat.Tpo $(DEPDIR)/cdo-Consecstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Consecstat.c' object='cdo-Consecstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Consecstat.o `test -f 'Consecstat.c' || echo '$(srcdir)/'`Consecstat.c
+
+cdo-Consecstat.obj: Consecstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Consecstat.obj -MD -MP -MF $(DEPDIR)/cdo-Consecstat.Tpo -c -o cdo-Consecstat.obj `if test -f 'Consecstat.c'; then $(CYGPATH_W) 'Consecstat.c'; else $(CYGPATH_W) '$(srcdir)/Consecstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Consecstat.Tpo $(DEPDIR)/cdo-Consecstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Consecstat.c' object='cdo-Consecstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Consecstat.obj `if test -f 'Consecstat.c'; then $(CYGPATH_W) 'Consecstat.c'; else $(CYGPATH_W) '$(srcdir)/Consecstat.c'; fi`
+
+cdo-Copy.o: Copy.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Copy.o -MD -MP -MF $(DEPDIR)/cdo-Copy.Tpo -c -o cdo-Copy.o `test -f 'Copy.c' || echo '$(srcdir)/'`Copy.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Copy.Tpo $(DEPDIR)/cdo-Copy.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Copy.c' object='cdo-Copy.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Copy.o `test -f 'Copy.c' || echo '$(srcdir)/'`Copy.c
+
+cdo-Copy.obj: Copy.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Copy.obj -MD -MP -MF $(DEPDIR)/cdo-Copy.Tpo -c -o cdo-Copy.obj `if test -f 'Copy.c'; then $(CYGPATH_W) 'Copy.c'; else $(CYGPATH_W) '$(srcdir)/Copy.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Copy.Tpo $(DEPDIR)/cdo-Copy.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Copy.c' object='cdo-Copy.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Copy.obj `if test -f 'Copy.c'; then $(CYGPATH_W) 'Copy.c'; else $(CYGPATH_W) '$(srcdir)/Copy.c'; fi`
+
+cdo-Deltime.o: Deltime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Deltime.o -MD -MP -MF $(DEPDIR)/cdo-Deltime.Tpo -c -o cdo-Deltime.o `test -f 'Deltime.c' || echo '$(srcdir)/'`Deltime.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Deltime.Tpo $(DEPDIR)/cdo-Deltime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Deltime.c' object='cdo-Deltime.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Deltime.o `test -f 'Deltime.c' || echo '$(srcdir)/'`Deltime.c
+
+cdo-Deltime.obj: Deltime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Deltime.obj -MD -MP -MF $(DEPDIR)/cdo-Deltime.Tpo -c -o cdo-Deltime.obj `if test -f 'Deltime.c'; then $(CYGPATH_W) 'Deltime.c'; else $(CYGPATH_W) '$(srcdir)/Deltime.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Deltime.Tpo $(DEPDIR)/cdo-Deltime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Deltime.c' object='cdo-Deltime.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Deltime.obj `if test -f 'Deltime.c'; then $(CYGPATH_W) 'Deltime.c'; else $(CYGPATH_W) '$(srcdir)/Deltime.c'; fi`
+
+cdo-Derivepar.o: Derivepar.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Derivepar.o -MD -MP -MF $(DEPDIR)/cdo-Derivepar.Tpo -c -o cdo-Derivepar.o `test -f 'Derivepar.c' || echo '$(srcdir)/'`Derivepar.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Derivepar.Tpo $(DEPDIR)/cdo-Derivepar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Derivepar.c' object='cdo-Derivepar.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Derivepar.o `test -f 'Derivepar.c' || echo '$(srcdir)/'`Derivepar.c
+
+cdo-Derivepar.obj: Derivepar.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Derivepar.obj -MD -MP -MF $(DEPDIR)/cdo-Derivepar.Tpo -c -o cdo-Derivepar.obj `if test -f 'Derivepar.c'; then $(CYGPATH_W) 'Derivepar.c'; else $(CYGPATH_W) '$(srcdir)/Derivepar.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Derivepar.Tpo $(DEPDIR)/cdo-Derivepar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Derivepar.c' object='cdo-Derivepar.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Derivepar.obj `if test -f 'Derivepar.c'; then $(CYGPATH_W) 'Derivepar.c'; else $(CYGPATH_W) '$(srcdir)/Derivepar.c'; fi`
+
+cdo-Detrend.o: Detrend.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Detrend.o -MD -MP -MF $(DEPDIR)/cdo-Detrend.Tpo -c -o cdo-Detrend.o `test -f 'Detrend.c' || echo '$(srcdir)/'`Detrend.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Detrend.Tpo $(DEPDIR)/cdo-Detrend.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Detrend.c' object='cdo-Detrend.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Detrend.o `test -f 'Detrend.c' || echo '$(srcdir)/'`Detrend.c
+
+cdo-Detrend.obj: Detrend.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Detrend.obj -MD -MP -MF $(DEPDIR)/cdo-Detrend.Tpo -c -o cdo-Detrend.obj `if test -f 'Detrend.c'; then $(CYGPATH_W) 'Detrend.c'; else $(CYGPATH_W) '$(srcdir)/Detrend.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Detrend.Tpo $(DEPDIR)/cdo-Detrend.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Detrend.c' object='cdo-Detrend.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Detrend.obj `if test -f 'Detrend.c'; then $(CYGPATH_W) 'Detrend.c'; else $(CYGPATH_W) '$(srcdir)/Detrend.c'; fi`
+
+cdo-Diff.o: Diff.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Diff.o -MD -MP -MF $(DEPDIR)/cdo-Diff.Tpo -c -o cdo-Diff.o `test -f 'Diff.c' || echo '$(srcdir)/'`Diff.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Diff.Tpo $(DEPDIR)/cdo-Diff.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Diff.c' object='cdo-Diff.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Diff.o `test -f 'Diff.c' || echo '$(srcdir)/'`Diff.c
+
+cdo-Diff.obj: Diff.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Diff.obj -MD -MP -MF $(DEPDIR)/cdo-Diff.Tpo -c -o cdo-Diff.obj `if test -f 'Diff.c'; then $(CYGPATH_W) 'Diff.c'; else $(CYGPATH_W) '$(srcdir)/Diff.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Diff.Tpo $(DEPDIR)/cdo-Diff.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Diff.c' object='cdo-Diff.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Diff.obj `if test -f 'Diff.c'; then $(CYGPATH_W) 'Diff.c'; else $(CYGPATH_W) '$(srcdir)/Diff.c'; fi`
+
+cdo-Duplicate.o: Duplicate.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Duplicate.o -MD -MP -MF $(DEPDIR)/cdo-Duplicate.Tpo -c -o cdo-Duplicate.o `test -f 'Duplicate.c' || echo '$(srcdir)/'`Duplicate.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Duplicate.Tpo $(DEPDIR)/cdo-Duplicate.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Duplicate.c' object='cdo-Duplicate.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Duplicate.o `test -f 'Duplicate.c' || echo '$(srcdir)/'`Duplicate.c
+
+cdo-Duplicate.obj: Duplicate.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Duplicate.obj -MD -MP -MF $(DEPDIR)/cdo-Duplicate.Tpo -c -o cdo-Duplicate.obj `if test -f 'Duplicate.c'; then $(CYGPATH_W) 'Duplicate.c'; else $(CYGPATH_W) '$(srcdir)/Duplicate.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Duplicate.Tpo $(DEPDIR)/cdo-Duplicate.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Duplicate.c' object='cdo-Duplicate.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Duplicate.obj `if test -f 'Duplicate.c'; then $(CYGPATH_W) 'Duplicate.c'; else $(CYGPATH_W) '$(srcdir)/Duplicate.c'; fi`
+
+cdo-EOFs.o: EOFs.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-EOFs.o -MD -MP -MF $(DEPDIR)/cdo-EOFs.Tpo -c -o cdo-EOFs.o `test -f 'EOFs.c' || echo '$(srcdir)/'`EOFs.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-EOFs.Tpo $(DEPDIR)/cdo-EOFs.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='EOFs.c' object='cdo-EOFs.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-EOFs.o `test -f 'EOFs.c' || echo '$(srcdir)/'`EOFs.c
+
+cdo-EOFs.obj: EOFs.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-EOFs.obj -MD -MP -MF $(DEPDIR)/cdo-EOFs.Tpo -c -o cdo-EOFs.obj `if test -f 'EOFs.c'; then $(CYGPATH_W) 'EOFs.c'; else $(CYGPATH_W) '$(srcdir)/EOFs.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-EOFs.Tpo $(DEPDIR)/cdo-EOFs.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='EOFs.c' object='cdo-EOFs.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-EOFs.obj `if test -f 'EOFs.c'; then $(CYGPATH_W) 'EOFs.c'; else $(CYGPATH_W) '$(srcdir)/EOFs.c'; fi`
+
+cdo-Eof3d.o: Eof3d.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Eof3d.o -MD -MP -MF $(DEPDIR)/cdo-Eof3d.Tpo -c -o cdo-Eof3d.o `test -f 'Eof3d.c' || echo '$(srcdir)/'`Eof3d.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Eof3d.Tpo $(DEPDIR)/cdo-Eof3d.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Eof3d.c' object='cdo-Eof3d.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Eof3d.o `test -f 'Eof3d.c' || echo '$(srcdir)/'`Eof3d.c
+
+cdo-Eof3d.obj: Eof3d.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Eof3d.obj -MD -MP -MF $(DEPDIR)/cdo-Eof3d.Tpo -c -o cdo-Eof3d.obj `if test -f 'Eof3d.c'; then $(CYGPATH_W) 'Eof3d.c'; else $(CYGPATH_W) '$(srcdir)/Eof3d.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Eof3d.Tpo $(DEPDIR)/cdo-Eof3d.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Eof3d.c' object='cdo-Eof3d.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Eof3d.obj `if test -f 'Eof3d.c'; then $(CYGPATH_W) 'Eof3d.c'; else $(CYGPATH_W) '$(srcdir)/Eof3d.c'; fi`
+
+cdo-EcaIndices.o: EcaIndices.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-EcaIndices.o -MD -MP -MF $(DEPDIR)/cdo-EcaIndices.Tpo -c -o cdo-EcaIndices.o `test -f 'EcaIndices.c' || echo '$(srcdir)/'`EcaIndices.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-EcaIndices.Tpo $(DEPDIR)/cdo-EcaIndices.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='EcaIndices.c' object='cdo-EcaIndices.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-EcaIndices.o `test -f 'EcaIndices.c' || echo '$(srcdir)/'`EcaIndices.c
+
+cdo-EcaIndices.obj: EcaIndices.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-EcaIndices.obj -MD -MP -MF $(DEPDIR)/cdo-EcaIndices.Tpo -c -o cdo-EcaIndices.obj `if test -f 'EcaIndices.c'; then $(CYGPATH_W) 'EcaIndices.c'; else $(CYGPATH_W) '$(srcdir)/EcaIndices.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-EcaIndices.Tpo $(DEPDIR)/cdo-EcaIndices.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='EcaIndices.c' object='cdo-EcaIndices.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-EcaIndices.obj `if test -f 'EcaIndices.c'; then $(CYGPATH_W) 'EcaIndices.c'; else $(CYGPATH_W) '$(srcdir)/EcaIndices.c'; fi`
+
+cdo-Echam5ini.o: Echam5ini.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Echam5ini.o -MD -MP -MF $(DEPDIR)/cdo-Echam5ini.Tpo -c -o cdo-Echam5ini.o `test -f 'Echam5ini.c' || echo '$(srcdir)/'`Echam5ini.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Echam5ini.Tpo $(DEPDIR)/cdo-Echam5ini.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Echam5ini.c' object='cdo-Echam5ini.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Echam5ini.o `test -f 'Echam5ini.c' || echo '$(srcdir)/'`Echam5ini.c
+
+cdo-Echam5ini.obj: Echam5ini.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Echam5ini.obj -MD -MP -MF $(DEPDIR)/cdo-Echam5ini.Tpo -c -o cdo-Echam5ini.obj `if test -f 'Echam5ini.c'; then $(CYGPATH_W) 'Echam5ini.c'; else $(CYGPATH_W) '$(srcdir)/Echam5ini.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Echam5ini.Tpo $(DEPDIR)/cdo-Echam5ini.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Echam5ini.c' object='cdo-Echam5ini.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Echam5ini.obj `if test -f 'Echam5ini.c'; then $(CYGPATH_W) 'Echam5ini.c'; else $(CYGPATH_W) '$(srcdir)/Echam5ini.c'; fi`
+
+cdo-Enlarge.o: Enlarge.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Enlarge.o -MD -MP -MF $(DEPDIR)/cdo-Enlarge.Tpo -c -o cdo-Enlarge.o `test -f 'Enlarge.c' || echo '$(srcdir)/'`Enlarge.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Enlarge.Tpo $(DEPDIR)/cdo-Enlarge.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Enlarge.c' object='cdo-Enlarge.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Enlarge.o `test -f 'Enlarge.c' || echo '$(srcdir)/'`Enlarge.c
+
+cdo-Enlarge.obj: Enlarge.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Enlarge.obj -MD -MP -MF $(DEPDIR)/cdo-Enlarge.Tpo -c -o cdo-Enlarge.obj `if test -f 'Enlarge.c'; then $(CYGPATH_W) 'Enlarge.c'; else $(CYGPATH_W) '$(srcdir)/Enlarge.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Enlarge.Tpo $(DEPDIR)/cdo-Enlarge.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Enlarge.c' object='cdo-Enlarge.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Enlarge.obj `if test -f 'Enlarge.c'; then $(CYGPATH_W) 'Enlarge.c'; else $(CYGPATH_W) '$(srcdir)/Enlarge.c'; fi`
+
+cdo-Enlargegrid.o: Enlargegrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Enlargegrid.o -MD -MP -MF $(DEPDIR)/cdo-Enlargegrid.Tpo -c -o cdo-Enlargegrid.o `test -f 'Enlargegrid.c' || echo '$(srcdir)/'`Enlargegrid.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Enlargegrid.Tpo $(DEPDIR)/cdo-Enlargegrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Enlargegrid.c' object='cdo-Enlargegrid.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Enlargegrid.o `test -f 'Enlargegrid.c' || echo '$(srcdir)/'`Enlargegrid.c
+
+cdo-Enlargegrid.obj: Enlargegrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Enlargegrid.obj -MD -MP -MF $(DEPDIR)/cdo-Enlargegrid.Tpo -c -o cdo-Enlargegrid.obj `if test -f 'Enlargegrid.c'; then $(CYGPATH_W) 'Enlargegrid.c'; else $(CYGPATH_W) '$(srcdir)/Enlargegrid.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Enlargegrid.Tpo $(DEPDIR)/cdo-Enlargegrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Enlargegrid.c' object='cdo-Enlargegrid.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Enlargegrid.obj `if test -f 'Enlargegrid.c'; then $(CYGPATH_W) 'Enlargegrid.c'; else $(CYGPATH_W) '$(srcdir)/Enlargegrid.c'; fi`
+
+cdo-Ensstat.o: Ensstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ensstat.o -MD -MP -MF $(DEPDIR)/cdo-Ensstat.Tpo -c -o cdo-Ensstat.o `test -f 'Ensstat.c' || echo '$(srcdir)/'`Ensstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ensstat.Tpo $(DEPDIR)/cdo-Ensstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ensstat.c' object='cdo-Ensstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ensstat.o `test -f 'Ensstat.c' || echo '$(srcdir)/'`Ensstat.c
+
+cdo-Ensstat.obj: Ensstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ensstat.obj -MD -MP -MF $(DEPDIR)/cdo-Ensstat.Tpo -c -o cdo-Ensstat.obj `if test -f 'Ensstat.c'; then $(CYGPATH_W) 'Ensstat.c'; else $(CYGPATH_W) '$(srcdir)/Ensstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ensstat.Tpo $(DEPDIR)/cdo-Ensstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ensstat.c' object='cdo-Ensstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ensstat.obj `if test -f 'Ensstat.c'; then $(CYGPATH_W) 'Ensstat.c'; else $(CYGPATH_W) '$(srcdir)/Ensstat.c'; fi`
+
+cdo-Ensstat3.o: Ensstat3.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ensstat3.o -MD -MP -MF $(DEPDIR)/cdo-Ensstat3.Tpo -c -o cdo-Ensstat3.o `test -f 'Ensstat3.c' || echo '$(srcdir)/'`Ensstat3.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ensstat3.Tpo $(DEPDIR)/cdo-Ensstat3.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ensstat3.c' object='cdo-Ensstat3.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ensstat3.o `test -f 'Ensstat3.c' || echo '$(srcdir)/'`Ensstat3.c
+
+cdo-Ensstat3.obj: Ensstat3.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ensstat3.obj -MD -MP -MF $(DEPDIR)/cdo-Ensstat3.Tpo -c -o cdo-Ensstat3.obj `if test -f 'Ensstat3.c'; then $(CYGPATH_W) 'Ensstat3.c'; else $(CYGPATH_W) '$(srcdir)/Ensstat3.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ensstat3.Tpo $(DEPDIR)/cdo-Ensstat3.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ensstat3.c' object='cdo-Ensstat3.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ensstat3.obj `if test -f 'Ensstat3.c'; then $(CYGPATH_W) 'Ensstat3.c'; else $(CYGPATH_W) '$(srcdir)/Ensstat3.c'; fi`
+
+cdo-Ensval.o: Ensval.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ensval.o -MD -MP -MF $(DEPDIR)/cdo-Ensval.Tpo -c -o cdo-Ensval.o `test -f 'Ensval.c' || echo '$(srcdir)/'`Ensval.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ensval.Tpo $(DEPDIR)/cdo-Ensval.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ensval.c' object='cdo-Ensval.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ensval.o `test -f 'Ensval.c' || echo '$(srcdir)/'`Ensval.c
+
+cdo-Ensval.obj: Ensval.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ensval.obj -MD -MP -MF $(DEPDIR)/cdo-Ensval.Tpo -c -o cdo-Ensval.obj `if test -f 'Ensval.c'; then $(CYGPATH_W) 'Ensval.c'; else $(CYGPATH_W) '$(srcdir)/Ensval.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ensval.Tpo $(DEPDIR)/cdo-Ensval.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ensval.c' object='cdo-Ensval.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ensval.obj `if test -f 'Ensval.c'; then $(CYGPATH_W) 'Ensval.c'; else $(CYGPATH_W) '$(srcdir)/Ensval.c'; fi`
+
+cdo-Eofcoeff.o: Eofcoeff.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Eofcoeff.o -MD -MP -MF $(DEPDIR)/cdo-Eofcoeff.Tpo -c -o cdo-Eofcoeff.o `test -f 'Eofcoeff.c' || echo '$(srcdir)/'`Eofcoeff.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Eofcoeff.Tpo $(DEPDIR)/cdo-Eofcoeff.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Eofcoeff.c' object='cdo-Eofcoeff.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Eofcoeff.o `test -f 'Eofcoeff.c' || echo '$(srcdir)/'`Eofcoeff.c
+
+cdo-Eofcoeff.obj: Eofcoeff.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Eofcoeff.obj -MD -MP -MF $(DEPDIR)/cdo-Eofcoeff.Tpo -c -o cdo-Eofcoeff.obj `if test -f 'Eofcoeff.c'; then $(CYGPATH_W) 'Eofcoeff.c'; else $(CYGPATH_W) '$(srcdir)/Eofcoeff.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Eofcoeff.Tpo $(DEPDIR)/cdo-Eofcoeff.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Eofcoeff.c' object='cdo-Eofcoeff.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Eofcoeff.obj `if test -f 'Eofcoeff.c'; then $(CYGPATH_W) 'Eofcoeff.c'; else $(CYGPATH_W) '$(srcdir)/Eofcoeff.c'; fi`
+
+cdo-Eofcoeff3d.o: Eofcoeff3d.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Eofcoeff3d.o -MD -MP -MF $(DEPDIR)/cdo-Eofcoeff3d.Tpo -c -o cdo-Eofcoeff3d.o `test -f 'Eofcoeff3d.c' || echo '$(srcdir)/'`Eofcoeff3d.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Eofcoeff3d.Tpo $(DEPDIR)/cdo-Eofcoeff3d.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Eofcoeff3d.c' object='cdo-Eofcoeff3d.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Eofcoeff3d.o `test -f 'Eofcoeff3d.c' || echo '$(srcdir)/'`Eofcoeff3d.c
+
+cdo-Eofcoeff3d.obj: Eofcoeff3d.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Eofcoeff3d.obj -MD -MP -MF $(DEPDIR)/cdo-Eofcoeff3d.Tpo -c -o cdo-Eofcoeff3d.obj `if test -f 'Eofcoeff3d.c'; then $(CYGPATH_W) 'Eofcoeff3d.c'; else $(CYGPATH_W) '$(srcdir)/Eofcoeff3d.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Eofcoeff3d.Tpo $(DEPDIR)/cdo-Eofcoeff3d.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Eofcoeff3d.c' object='cdo-Eofcoeff3d.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Eofcoeff3d.obj `if test -f 'Eofcoeff3d.c'; then $(CYGPATH_W) 'Eofcoeff3d.c'; else $(CYGPATH_W) '$(srcdir)/Eofcoeff3d.c'; fi`
+
+cdo-Exprf.o: Exprf.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Exprf.o -MD -MP -MF $(DEPDIR)/cdo-Exprf.Tpo -c -o cdo-Exprf.o `test -f 'Exprf.c' || echo '$(srcdir)/'`Exprf.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Exprf.Tpo $(DEPDIR)/cdo-Exprf.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Exprf.c' object='cdo-Exprf.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Exprf.o `test -f 'Exprf.c' || echo '$(srcdir)/'`Exprf.c
+
+cdo-Exprf.obj: Exprf.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Exprf.obj -MD -MP -MF $(DEPDIR)/cdo-Exprf.Tpo -c -o cdo-Exprf.obj `if test -f 'Exprf.c'; then $(CYGPATH_W) 'Exprf.c'; else $(CYGPATH_W) '$(srcdir)/Exprf.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Exprf.Tpo $(DEPDIR)/cdo-Exprf.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Exprf.c' object='cdo-Exprf.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Exprf.obj `if test -f 'Exprf.c'; then $(CYGPATH_W) 'Exprf.c'; else $(CYGPATH_W) '$(srcdir)/Exprf.c'; fi`
+
+cdo-FC.o: FC.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-FC.o -MD -MP -MF $(DEPDIR)/cdo-FC.Tpo -c -o cdo-FC.o `test -f 'FC.c' || echo '$(srcdir)/'`FC.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-FC.Tpo $(DEPDIR)/cdo-FC.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='FC.c' object='cdo-FC.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-FC.o `test -f 'FC.c' || echo '$(srcdir)/'`FC.c
+
+cdo-FC.obj: FC.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-FC.obj -MD -MP -MF $(DEPDIR)/cdo-FC.Tpo -c -o cdo-FC.obj `if test -f 'FC.c'; then $(CYGPATH_W) 'FC.c'; else $(CYGPATH_W) '$(srcdir)/FC.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-FC.Tpo $(DEPDIR)/cdo-FC.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='FC.c' object='cdo-FC.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-FC.obj `if test -f 'FC.c'; then $(CYGPATH_W) 'FC.c'; else $(CYGPATH_W) '$(srcdir)/FC.c'; fi`
+
+cdo-Filedes.o: Filedes.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Filedes.o -MD -MP -MF $(DEPDIR)/cdo-Filedes.Tpo -c -o cdo-Filedes.o `test -f 'Filedes.c' || echo '$(srcdir)/'`Filedes.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Filedes.Tpo $(DEPDIR)/cdo-Filedes.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Filedes.c' object='cdo-Filedes.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Filedes.o `test -f 'Filedes.c' || echo '$(srcdir)/'`Filedes.c
+
+cdo-Filedes.obj: Filedes.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Filedes.obj -MD -MP -MF $(DEPDIR)/cdo-Filedes.Tpo -c -o cdo-Filedes.obj `if test -f 'Filedes.c'; then $(CYGPATH_W) 'Filedes.c'; else $(CYGPATH_W) '$(srcdir)/Filedes.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Filedes.Tpo $(DEPDIR)/cdo-Filedes.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Filedes.c' object='cdo-Filedes.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Filedes.obj `if test -f 'Filedes.c'; then $(CYGPATH_W) 'Filedes.c'; else $(CYGPATH_W) '$(srcdir)/Filedes.c'; fi`
+
+cdo-Fillmiss.o: Fillmiss.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Fillmiss.o -MD -MP -MF $(DEPDIR)/cdo-Fillmiss.Tpo -c -o cdo-Fillmiss.o `test -f 'Fillmiss.c' || echo '$(srcdir)/'`Fillmiss.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Fillmiss.Tpo $(DEPDIR)/cdo-Fillmiss.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Fillmiss.c' object='cdo-Fillmiss.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Fillmiss.o `test -f 'Fillmiss.c' || echo '$(srcdir)/'`Fillmiss.c
+
+cdo-Fillmiss.obj: Fillmiss.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Fillmiss.obj -MD -MP -MF $(DEPDIR)/cdo-Fillmiss.Tpo -c -o cdo-Fillmiss.obj `if test -f 'Fillmiss.c'; then $(CYGPATH_W) 'Fillmiss.c'; else $(CYGPATH_W) '$(srcdir)/Fillmiss.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Fillmiss.Tpo $(DEPDIR)/cdo-Fillmiss.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Fillmiss.c' object='cdo-Fillmiss.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Fillmiss.obj `if test -f 'Fillmiss.c'; then $(CYGPATH_W) 'Fillmiss.c'; else $(CYGPATH_W) '$(srcdir)/Fillmiss.c'; fi`
+
+cdo-Filter.o: Filter.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Filter.o -MD -MP -MF $(DEPDIR)/cdo-Filter.Tpo -c -o cdo-Filter.o `test -f 'Filter.c' || echo '$(srcdir)/'`Filter.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Filter.Tpo $(DEPDIR)/cdo-Filter.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Filter.c' object='cdo-Filter.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Filter.o `test -f 'Filter.c' || echo '$(srcdir)/'`Filter.c
+
+cdo-Filter.obj: Filter.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Filter.obj -MD -MP -MF $(DEPDIR)/cdo-Filter.Tpo -c -o cdo-Filter.obj `if test -f 'Filter.c'; then $(CYGPATH_W) 'Filter.c'; else $(CYGPATH_W) '$(srcdir)/Filter.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Filter.Tpo $(DEPDIR)/cdo-Filter.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Filter.c' object='cdo-Filter.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Filter.obj `if test -f 'Filter.c'; then $(CYGPATH_W) 'Filter.c'; else $(CYGPATH_W) '$(srcdir)/Filter.c'; fi`
+
+cdo-Fldrms.o: Fldrms.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Fldrms.o -MD -MP -MF $(DEPDIR)/cdo-Fldrms.Tpo -c -o cdo-Fldrms.o `test -f 'Fldrms.c' || echo '$(srcdir)/'`Fldrms.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Fldrms.Tpo $(DEPDIR)/cdo-Fldrms.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Fldrms.c' object='cdo-Fldrms.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Fldrms.o `test -f 'Fldrms.c' || echo '$(srcdir)/'`Fldrms.c
+
+cdo-Fldrms.obj: Fldrms.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Fldrms.obj -MD -MP -MF $(DEPDIR)/cdo-Fldrms.Tpo -c -o cdo-Fldrms.obj `if test -f 'Fldrms.c'; then $(CYGPATH_W) 'Fldrms.c'; else $(CYGPATH_W) '$(srcdir)/Fldrms.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Fldrms.Tpo $(DEPDIR)/cdo-Fldrms.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Fldrms.c' object='cdo-Fldrms.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Fldrms.obj `if test -f 'Fldrms.c'; then $(CYGPATH_W) 'Fldrms.c'; else $(CYGPATH_W) '$(srcdir)/Fldrms.c'; fi`
+
+cdo-Fldstat.o: Fldstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Fldstat.o -MD -MP -MF $(DEPDIR)/cdo-Fldstat.Tpo -c -o cdo-Fldstat.o `test -f 'Fldstat.c' || echo '$(srcdir)/'`Fldstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Fldstat.Tpo $(DEPDIR)/cdo-Fldstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Fldstat.c' object='cdo-Fldstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Fldstat.o `test -f 'Fldstat.c' || echo '$(srcdir)/'`Fldstat.c
+
+cdo-Fldstat.obj: Fldstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Fldstat.obj -MD -MP -MF $(DEPDIR)/cdo-Fldstat.Tpo -c -o cdo-Fldstat.obj `if test -f 'Fldstat.c'; then $(CYGPATH_W) 'Fldstat.c'; else $(CYGPATH_W) '$(srcdir)/Fldstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Fldstat.Tpo $(DEPDIR)/cdo-Fldstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Fldstat.c' object='cdo-Fldstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Fldstat.obj `if test -f 'Fldstat.c'; then $(CYGPATH_W) 'Fldstat.c'; else $(CYGPATH_W) '$(srcdir)/Fldstat.c'; fi`
+
+cdo-Fldstat2.o: Fldstat2.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Fldstat2.o -MD -MP -MF $(DEPDIR)/cdo-Fldstat2.Tpo -c -o cdo-Fldstat2.o `test -f 'Fldstat2.c' || echo '$(srcdir)/'`Fldstat2.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Fldstat2.Tpo $(DEPDIR)/cdo-Fldstat2.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Fldstat2.c' object='cdo-Fldstat2.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Fldstat2.o `test -f 'Fldstat2.c' || echo '$(srcdir)/'`Fldstat2.c
+
+cdo-Fldstat2.obj: Fldstat2.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Fldstat2.obj -MD -MP -MF $(DEPDIR)/cdo-Fldstat2.Tpo -c -o cdo-Fldstat2.obj `if test -f 'Fldstat2.c'; then $(CYGPATH_W) 'Fldstat2.c'; else $(CYGPATH_W) '$(srcdir)/Fldstat2.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Fldstat2.Tpo $(DEPDIR)/cdo-Fldstat2.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Fldstat2.c' object='cdo-Fldstat2.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Fldstat2.obj `if test -f 'Fldstat2.c'; then $(CYGPATH_W) 'Fldstat2.c'; else $(CYGPATH_W) '$(srcdir)/Fldstat2.c'; fi`
+
+cdo-Fourier.o: Fourier.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Fourier.o -MD -MP -MF $(DEPDIR)/cdo-Fourier.Tpo -c -o cdo-Fourier.o `test -f 'Fourier.c' || echo '$(srcdir)/'`Fourier.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Fourier.Tpo $(DEPDIR)/cdo-Fourier.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Fourier.c' object='cdo-Fourier.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Fourier.o `test -f 'Fourier.c' || echo '$(srcdir)/'`Fourier.c
+
+cdo-Fourier.obj: Fourier.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Fourier.obj -MD -MP -MF $(DEPDIR)/cdo-Fourier.Tpo -c -o cdo-Fourier.obj `if test -f 'Fourier.c'; then $(CYGPATH_W) 'Fourier.c'; else $(CYGPATH_W) '$(srcdir)/Fourier.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Fourier.Tpo $(DEPDIR)/cdo-Fourier.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Fourier.c' object='cdo-Fourier.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Fourier.obj `if test -f 'Fourier.c'; then $(CYGPATH_W) 'Fourier.c'; else $(CYGPATH_W) '$(srcdir)/Fourier.c'; fi`
+
+cdo-Gather.o: Gather.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Gather.o -MD -MP -MF $(DEPDIR)/cdo-Gather.Tpo -c -o cdo-Gather.o `test -f 'Gather.c' || echo '$(srcdir)/'`Gather.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Gather.Tpo $(DEPDIR)/cdo-Gather.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Gather.c' object='cdo-Gather.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Gather.o `test -f 'Gather.c' || echo '$(srcdir)/'`Gather.c
+
+cdo-Gather.obj: Gather.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Gather.obj -MD -MP -MF $(DEPDIR)/cdo-Gather.Tpo -c -o cdo-Gather.obj `if test -f 'Gather.c'; then $(CYGPATH_W) 'Gather.c'; else $(CYGPATH_W) '$(srcdir)/Gather.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Gather.Tpo $(DEPDIR)/cdo-Gather.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Gather.c' object='cdo-Gather.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Gather.obj `if test -f 'Gather.c'; then $(CYGPATH_W) 'Gather.c'; else $(CYGPATH_W) '$(srcdir)/Gather.c'; fi`
+
+cdo-Gengrid.o: Gengrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Gengrid.o -MD -MP -MF $(DEPDIR)/cdo-Gengrid.Tpo -c -o cdo-Gengrid.o `test -f 'Gengrid.c' || echo '$(srcdir)/'`Gengrid.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Gengrid.Tpo $(DEPDIR)/cdo-Gengrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Gengrid.c' object='cdo-Gengrid.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Gengrid.o `test -f 'Gengrid.c' || echo '$(srcdir)/'`Gengrid.c
+
+cdo-Gengrid.obj: Gengrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Gengrid.obj -MD -MP -MF $(DEPDIR)/cdo-Gengrid.Tpo -c -o cdo-Gengrid.obj `if test -f 'Gengrid.c'; then $(CYGPATH_W) 'Gengrid.c'; else $(CYGPATH_W) '$(srcdir)/Gengrid.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Gengrid.Tpo $(DEPDIR)/cdo-Gengrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Gengrid.c' object='cdo-Gengrid.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Gengrid.obj `if test -f 'Gengrid.c'; then $(CYGPATH_W) 'Gengrid.c'; else $(CYGPATH_W) '$(srcdir)/Gengrid.c'; fi`
+
+cdo-Gradsdes.o: Gradsdes.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Gradsdes.o -MD -MP -MF $(DEPDIR)/cdo-Gradsdes.Tpo -c -o cdo-Gradsdes.o `test -f 'Gradsdes.c' || echo '$(srcdir)/'`Gradsdes.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Gradsdes.Tpo $(DEPDIR)/cdo-Gradsdes.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Gradsdes.c' object='cdo-Gradsdes.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Gradsdes.o `test -f 'Gradsdes.c' || echo '$(srcdir)/'`Gradsdes.c
+
+cdo-Gradsdes.obj: Gradsdes.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Gradsdes.obj -MD -MP -MF $(DEPDIR)/cdo-Gradsdes.Tpo -c -o cdo-Gradsdes.obj `if test -f 'Gradsdes.c'; then $(CYGPATH_W) 'Gradsdes.c'; else $(CYGPATH_W) '$(srcdir)/Gradsdes.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Gradsdes.Tpo $(DEPDIR)/cdo-Gradsdes.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Gradsdes.c' object='cdo-Gradsdes.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Gradsdes.obj `if test -f 'Gradsdes.c'; then $(CYGPATH_W) 'Gradsdes.c'; else $(CYGPATH_W) '$(srcdir)/Gradsdes.c'; fi`
+
+cdo-Gridboxstat.o: Gridboxstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Gridboxstat.o -MD -MP -MF $(DEPDIR)/cdo-Gridboxstat.Tpo -c -o cdo-Gridboxstat.o `test -f 'Gridboxstat.c' || echo '$(srcdir)/'`Gridboxstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Gridboxstat.Tpo $(DEPDIR)/cdo-Gridboxstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Gridboxstat.c' object='cdo-Gridboxstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Gridboxstat.o `test -f 'Gridboxstat.c' || echo '$(srcdir)/'`Gridboxstat.c
+
+cdo-Gridboxstat.obj: Gridboxstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Gridboxstat.obj -MD -MP -MF $(DEPDIR)/cdo-Gridboxstat.Tpo -c -o cdo-Gridboxstat.obj `if test -f 'Gridboxstat.c'; then $(CYGPATH_W) 'Gridboxstat.c'; else $(CYGPATH_W) '$(srcdir)/Gridboxstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Gridboxstat.Tpo $(DEPDIR)/cdo-Gridboxstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Gridboxstat.c' object='cdo-Gridboxstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Gridboxstat.obj `if test -f 'Gridboxstat.c'; then $(CYGPATH_W) 'Gridboxstat.c'; else $(CYGPATH_W) '$(srcdir)/Gridboxstat.c'; fi`
+
+cdo-Gridcell.o: Gridcell.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Gridcell.o -MD -MP -MF $(DEPDIR)/cdo-Gridcell.Tpo -c -o cdo-Gridcell.o `test -f 'Gridcell.c' || echo '$(srcdir)/'`Gridcell.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Gridcell.Tpo $(DEPDIR)/cdo-Gridcell.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Gridcell.c' object='cdo-Gridcell.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Gridcell.o `test -f 'Gridcell.c' || echo '$(srcdir)/'`Gridcell.c
+
+cdo-Gridcell.obj: Gridcell.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Gridcell.obj -MD -MP -MF $(DEPDIR)/cdo-Gridcell.Tpo -c -o cdo-Gridcell.obj `if test -f 'Gridcell.c'; then $(CYGPATH_W) 'Gridcell.c'; else $(CYGPATH_W) '$(srcdir)/Gridcell.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Gridcell.Tpo $(DEPDIR)/cdo-Gridcell.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Gridcell.c' object='cdo-Gridcell.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Gridcell.obj `if test -f 'Gridcell.c'; then $(CYGPATH_W) 'Gridcell.c'; else $(CYGPATH_W) '$(srcdir)/Gridcell.c'; fi`
+
+cdo-Harmonic.o: Harmonic.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Harmonic.o -MD -MP -MF $(DEPDIR)/cdo-Harmonic.Tpo -c -o cdo-Harmonic.o `test -f 'Harmonic.c' || echo '$(srcdir)/'`Harmonic.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Harmonic.Tpo $(DEPDIR)/cdo-Harmonic.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Harmonic.c' object='cdo-Harmonic.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Harmonic.o `test -f 'Harmonic.c' || echo '$(srcdir)/'`Harmonic.c
+
+cdo-Harmonic.obj: Harmonic.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Harmonic.obj -MD -MP -MF $(DEPDIR)/cdo-Harmonic.Tpo -c -o cdo-Harmonic.obj `if test -f 'Harmonic.c'; then $(CYGPATH_W) 'Harmonic.c'; else $(CYGPATH_W) '$(srcdir)/Harmonic.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Harmonic.Tpo $(DEPDIR)/cdo-Harmonic.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Harmonic.c' object='cdo-Harmonic.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Harmonic.obj `if test -f 'Harmonic.c'; then $(CYGPATH_W) 'Harmonic.c'; else $(CYGPATH_W) '$(srcdir)/Harmonic.c'; fi`
+
+cdo-Hi.o: Hi.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Hi.o -MD -MP -MF $(DEPDIR)/cdo-Hi.Tpo -c -o cdo-Hi.o `test -f 'Hi.c' || echo '$(srcdir)/'`Hi.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Hi.Tpo $(DEPDIR)/cdo-Hi.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Hi.c' object='cdo-Hi.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Hi.o `test -f 'Hi.c' || echo '$(srcdir)/'`Hi.c
+
+cdo-Hi.obj: Hi.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Hi.obj -MD -MP -MF $(DEPDIR)/cdo-Hi.Tpo -c -o cdo-Hi.obj `if test -f 'Hi.c'; then $(CYGPATH_W) 'Hi.c'; else $(CYGPATH_W) '$(srcdir)/Hi.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Hi.Tpo $(DEPDIR)/cdo-Hi.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Hi.c' object='cdo-Hi.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Hi.obj `if test -f 'Hi.c'; then $(CYGPATH_W) 'Hi.c'; else $(CYGPATH_W) '$(srcdir)/Hi.c'; fi`
+
+cdo-Histogram.o: Histogram.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Histogram.o -MD -MP -MF $(DEPDIR)/cdo-Histogram.Tpo -c -o cdo-Histogram.o `test -f 'Histogram.c' || echo '$(srcdir)/'`Histogram.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Histogram.Tpo $(DEPDIR)/cdo-Histogram.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Histogram.c' object='cdo-Histogram.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Histogram.o `test -f 'Histogram.c' || echo '$(srcdir)/'`Histogram.c
+
+cdo-Histogram.obj: Histogram.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Histogram.obj -MD -MP -MF $(DEPDIR)/cdo-Histogram.Tpo -c -o cdo-Histogram.obj `if test -f 'Histogram.c'; then $(CYGPATH_W) 'Histogram.c'; else $(CYGPATH_W) '$(srcdir)/Histogram.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Histogram.Tpo $(DEPDIR)/cdo-Histogram.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Histogram.c' object='cdo-Histogram.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Histogram.obj `if test -f 'Histogram.c'; then $(CYGPATH_W) 'Histogram.c'; else $(CYGPATH_W) '$(srcdir)/Histogram.c'; fi`
+
+cdo-Importamsr.o: Importamsr.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Importamsr.o -MD -MP -MF $(DEPDIR)/cdo-Importamsr.Tpo -c -o cdo-Importamsr.o `test -f 'Importamsr.c' || echo '$(srcdir)/'`Importamsr.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Importamsr.Tpo $(DEPDIR)/cdo-Importamsr.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Importamsr.c' object='cdo-Importamsr.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Importamsr.o `test -f 'Importamsr.c' || echo '$(srcdir)/'`Importamsr.c
+
+cdo-Importamsr.obj: Importamsr.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Importamsr.obj -MD -MP -MF $(DEPDIR)/cdo-Importamsr.Tpo -c -o cdo-Importamsr.obj `if test -f 'Importamsr.c'; then $(CYGPATH_W) 'Importamsr.c'; else $(CYGPATH_W) '$(srcdir)/Importamsr.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Importamsr.Tpo $(DEPDIR)/cdo-Importamsr.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Importamsr.c' object='cdo-Importamsr.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Importamsr.obj `if test -f 'Importamsr.c'; then $(CYGPATH_W) 'Importamsr.c'; else $(CYGPATH_W) '$(srcdir)/Importamsr.c'; fi`
+
+cdo-Importbinary.o: Importbinary.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Importbinary.o -MD -MP -MF $(DEPDIR)/cdo-Importbinary.Tpo -c -o cdo-Importbinary.o `test -f 'Importbinary.c' || echo '$(srcdir)/'`Importbinary.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Importbinary.Tpo $(DEPDIR)/cdo-Importbinary.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Importbinary.c' object='cdo-Importbinary.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Importbinary.o `test -f 'Importbinary.c' || echo '$(srcdir)/'`Importbinary.c
+
+cdo-Importbinary.obj: Importbinary.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Importbinary.obj -MD -MP -MF $(DEPDIR)/cdo-Importbinary.Tpo -c -o cdo-Importbinary.obj `if test -f 'Importbinary.c'; then $(CYGPATH_W) 'Importbinary.c'; else $(CYGPATH_W) '$(srcdir)/Importbinary.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Importbinary.Tpo $(DEPDIR)/cdo-Importbinary.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Importbinary.c' object='cdo-Importbinary.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Importbinary.obj `if test -f 'Importbinary.c'; then $(CYGPATH_W) 'Importbinary.c'; else $(CYGPATH_W) '$(srcdir)/Importbinary.c'; fi`
+
+cdo-Importcmsaf.o: Importcmsaf.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Importcmsaf.o -MD -MP -MF $(DEPDIR)/cdo-Importcmsaf.Tpo -c -o cdo-Importcmsaf.o `test -f 'Importcmsaf.c' || echo '$(srcdir)/'`Importcmsaf.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Importcmsaf.Tpo $(DEPDIR)/cdo-Importcmsaf.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Importcmsaf.c' object='cdo-Importcmsaf.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Importcmsaf.o `test -f 'Importcmsaf.c' || echo '$(srcdir)/'`Importcmsaf.c
+
+cdo-Importcmsaf.obj: Importcmsaf.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Importcmsaf.obj -MD -MP -MF $(DEPDIR)/cdo-Importcmsaf.Tpo -c -o cdo-Importcmsaf.obj `if test -f 'Importcmsaf.c'; then $(CYGPATH_W) 'Importcmsaf.c'; else $(CYGPATH_W) '$(srcdir)/Importcmsaf.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Importcmsaf.Tpo $(DEPDIR)/cdo-Importcmsaf.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Importcmsaf.c' object='cdo-Importcmsaf.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Importcmsaf.obj `if test -f 'Importcmsaf.c'; then $(CYGPATH_W) 'Importcmsaf.c'; else $(CYGPATH_W) '$(srcdir)/Importcmsaf.c'; fi`
+
+cdo-Importobs.o: Importobs.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Importobs.o -MD -MP -MF $(DEPDIR)/cdo-Importobs.Tpo -c -o cdo-Importobs.o `test -f 'Importobs.c' || echo '$(srcdir)/'`Importobs.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Importobs.Tpo $(DEPDIR)/cdo-Importobs.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Importobs.c' object='cdo-Importobs.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Importobs.o `test -f 'Importobs.c' || echo '$(srcdir)/'`Importobs.c
+
+cdo-Importobs.obj: Importobs.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Importobs.obj -MD -MP -MF $(DEPDIR)/cdo-Importobs.Tpo -c -o cdo-Importobs.obj `if test -f 'Importobs.c'; then $(CYGPATH_W) 'Importobs.c'; else $(CYGPATH_W) '$(srcdir)/Importobs.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Importobs.Tpo $(DEPDIR)/cdo-Importobs.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Importobs.c' object='cdo-Importobs.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Importobs.obj `if test -f 'Importobs.c'; then $(CYGPATH_W) 'Importobs.c'; else $(CYGPATH_W) '$(srcdir)/Importobs.c'; fi`
+
+cdo-Info.o: Info.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Info.o -MD -MP -MF $(DEPDIR)/cdo-Info.Tpo -c -o cdo-Info.o `test -f 'Info.c' || echo '$(srcdir)/'`Info.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Info.Tpo $(DEPDIR)/cdo-Info.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Info.c' object='cdo-Info.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Info.o `test -f 'Info.c' || echo '$(srcdir)/'`Info.c
+
+cdo-Info.obj: Info.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Info.obj -MD -MP -MF $(DEPDIR)/cdo-Info.Tpo -c -o cdo-Info.obj `if test -f 'Info.c'; then $(CYGPATH_W) 'Info.c'; else $(CYGPATH_W) '$(srcdir)/Info.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Info.Tpo $(DEPDIR)/cdo-Info.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Info.c' object='cdo-Info.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Info.obj `if test -f 'Info.c'; then $(CYGPATH_W) 'Info.c'; else $(CYGPATH_W) '$(srcdir)/Info.c'; fi`
+
+cdo-Input.o: Input.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Input.o -MD -MP -MF $(DEPDIR)/cdo-Input.Tpo -c -o cdo-Input.o `test -f 'Input.c' || echo '$(srcdir)/'`Input.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Input.Tpo $(DEPDIR)/cdo-Input.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Input.c' object='cdo-Input.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Input.o `test -f 'Input.c' || echo '$(srcdir)/'`Input.c
+
+cdo-Input.obj: Input.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Input.obj -MD -MP -MF $(DEPDIR)/cdo-Input.Tpo -c -o cdo-Input.obj `if test -f 'Input.c'; then $(CYGPATH_W) 'Input.c'; else $(CYGPATH_W) '$(srcdir)/Input.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Input.Tpo $(DEPDIR)/cdo-Input.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Input.c' object='cdo-Input.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Input.obj `if test -f 'Input.c'; then $(CYGPATH_W) 'Input.c'; else $(CYGPATH_W) '$(srcdir)/Input.c'; fi`
+
+cdo-Intgrid.o: Intgrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intgrid.o -MD -MP -MF $(DEPDIR)/cdo-Intgrid.Tpo -c -o cdo-Intgrid.o `test -f 'Intgrid.c' || echo '$(srcdir)/'`Intgrid.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intgrid.Tpo $(DEPDIR)/cdo-Intgrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intgrid.c' object='cdo-Intgrid.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intgrid.o `test -f 'Intgrid.c' || echo '$(srcdir)/'`Intgrid.c
+
+cdo-Intgrid.obj: Intgrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intgrid.obj -MD -MP -MF $(DEPDIR)/cdo-Intgrid.Tpo -c -o cdo-Intgrid.obj `if test -f 'Intgrid.c'; then $(CYGPATH_W) 'Intgrid.c'; else $(CYGPATH_W) '$(srcdir)/Intgrid.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intgrid.Tpo $(DEPDIR)/cdo-Intgrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intgrid.c' object='cdo-Intgrid.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intgrid.obj `if test -f 'Intgrid.c'; then $(CYGPATH_W) 'Intgrid.c'; else $(CYGPATH_W) '$(srcdir)/Intgrid.c'; fi`
+
+cdo-Intgridtraj.o: Intgridtraj.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intgridtraj.o -MD -MP -MF $(DEPDIR)/cdo-Intgridtraj.Tpo -c -o cdo-Intgridtraj.o `test -f 'Intgridtraj.c' || echo '$(srcdir)/'`Intgridtraj.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intgridtraj.Tpo $(DEPDIR)/cdo-Intgridtraj.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intgridtraj.c' object='cdo-Intgridtraj.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intgridtraj.o `test -f 'Intgridtraj.c' || echo '$(srcdir)/'`Intgridtraj.c
+
+cdo-Intgridtraj.obj: Intgridtraj.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intgridtraj.obj -MD -MP -MF $(DEPDIR)/cdo-Intgridtraj.Tpo -c -o cdo-Intgridtraj.obj `if test -f 'Intgridtraj.c'; then $(CYGPATH_W) 'Intgridtraj.c'; else $(CYGPATH_W) '$(srcdir)/Intgridtraj.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intgridtraj.Tpo $(DEPDIR)/cdo-Intgridtraj.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intgridtraj.c' object='cdo-Intgridtraj.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intgridtraj.obj `if test -f 'Intgridtraj.c'; then $(CYGPATH_W) 'Intgridtraj.c'; else $(CYGPATH_W) '$(srcdir)/Intgridtraj.c'; fi`
+
+cdo-Intlevel.o: Intlevel.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intlevel.o -MD -MP -MF $(DEPDIR)/cdo-Intlevel.Tpo -c -o cdo-Intlevel.o `test -f 'Intlevel.c' || echo '$(srcdir)/'`Intlevel.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intlevel.Tpo $(DEPDIR)/cdo-Intlevel.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intlevel.c' object='cdo-Intlevel.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intlevel.o `test -f 'Intlevel.c' || echo '$(srcdir)/'`Intlevel.c
+
+cdo-Intlevel.obj: Intlevel.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intlevel.obj -MD -MP -MF $(DEPDIR)/cdo-Intlevel.Tpo -c -o cdo-Intlevel.obj `if test -f 'Intlevel.c'; then $(CYGPATH_W) 'Intlevel.c'; else $(CYGPATH_W) '$(srcdir)/Intlevel.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intlevel.Tpo $(DEPDIR)/cdo-Intlevel.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intlevel.c' object='cdo-Intlevel.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intlevel.obj `if test -f 'Intlevel.c'; then $(CYGPATH_W) 'Intlevel.c'; else $(CYGPATH_W) '$(srcdir)/Intlevel.c'; fi`
+
+cdo-Intlevel3d.o: Intlevel3d.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intlevel3d.o -MD -MP -MF $(DEPDIR)/cdo-Intlevel3d.Tpo -c -o cdo-Intlevel3d.o `test -f 'Intlevel3d.c' || echo '$(srcdir)/'`Intlevel3d.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intlevel3d.Tpo $(DEPDIR)/cdo-Intlevel3d.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intlevel3d.c' object='cdo-Intlevel3d.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intlevel3d.o `test -f 'Intlevel3d.c' || echo '$(srcdir)/'`Intlevel3d.c
+
+cdo-Intlevel3d.obj: Intlevel3d.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intlevel3d.obj -MD -MP -MF $(DEPDIR)/cdo-Intlevel3d.Tpo -c -o cdo-Intlevel3d.obj `if test -f 'Intlevel3d.c'; then $(CYGPATH_W) 'Intlevel3d.c'; else $(CYGPATH_W) '$(srcdir)/Intlevel3d.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intlevel3d.Tpo $(DEPDIR)/cdo-Intlevel3d.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intlevel3d.c' object='cdo-Intlevel3d.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intlevel3d.obj `if test -f 'Intlevel3d.c'; then $(CYGPATH_W) 'Intlevel3d.c'; else $(CYGPATH_W) '$(srcdir)/Intlevel3d.c'; fi`
+
+cdo-Intntime.o: Intntime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intntime.o -MD -MP -MF $(DEPDIR)/cdo-Intntime.Tpo -c -o cdo-Intntime.o `test -f 'Intntime.c' || echo '$(srcdir)/'`Intntime.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intntime.Tpo $(DEPDIR)/cdo-Intntime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intntime.c' object='cdo-Intntime.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intntime.o `test -f 'Intntime.c' || echo '$(srcdir)/'`Intntime.c
+
+cdo-Intntime.obj: Intntime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intntime.obj -MD -MP -MF $(DEPDIR)/cdo-Intntime.Tpo -c -o cdo-Intntime.obj `if test -f 'Intntime.c'; then $(CYGPATH_W) 'Intntime.c'; else $(CYGPATH_W) '$(srcdir)/Intntime.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intntime.Tpo $(DEPDIR)/cdo-Intntime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intntime.c' object='cdo-Intntime.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intntime.obj `if test -f 'Intntime.c'; then $(CYGPATH_W) 'Intntime.c'; else $(CYGPATH_W) '$(srcdir)/Intntime.c'; fi`
+
+cdo-Inttime.o: Inttime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Inttime.o -MD -MP -MF $(DEPDIR)/cdo-Inttime.Tpo -c -o cdo-Inttime.o `test -f 'Inttime.c' || echo '$(srcdir)/'`Inttime.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Inttime.Tpo $(DEPDIR)/cdo-Inttime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Inttime.c' object='cdo-Inttime.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Inttime.o `test -f 'Inttime.c' || echo '$(srcdir)/'`Inttime.c
+
+cdo-Inttime.obj: Inttime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Inttime.obj -MD -MP -MF $(DEPDIR)/cdo-Inttime.Tpo -c -o cdo-Inttime.obj `if test -f 'Inttime.c'; then $(CYGPATH_W) 'Inttime.c'; else $(CYGPATH_W) '$(srcdir)/Inttime.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Inttime.Tpo $(DEPDIR)/cdo-Inttime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Inttime.c' object='cdo-Inttime.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Inttime.obj `if test -f 'Inttime.c'; then $(CYGPATH_W) 'Inttime.c'; else $(CYGPATH_W) '$(srcdir)/Inttime.c'; fi`
+
+cdo-Intyear.o: Intyear.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intyear.o -MD -MP -MF $(DEPDIR)/cdo-Intyear.Tpo -c -o cdo-Intyear.o `test -f 'Intyear.c' || echo '$(srcdir)/'`Intyear.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intyear.Tpo $(DEPDIR)/cdo-Intyear.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intyear.c' object='cdo-Intyear.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intyear.o `test -f 'Intyear.c' || echo '$(srcdir)/'`Intyear.c
+
+cdo-Intyear.obj: Intyear.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Intyear.obj -MD -MP -MF $(DEPDIR)/cdo-Intyear.Tpo -c -o cdo-Intyear.obj `if test -f 'Intyear.c'; then $(CYGPATH_W) 'Intyear.c'; else $(CYGPATH_W) '$(srcdir)/Intyear.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Intyear.Tpo $(DEPDIR)/cdo-Intyear.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Intyear.c' object='cdo-Intyear.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Intyear.obj `if test -f 'Intyear.c'; then $(CYGPATH_W) 'Intyear.c'; else $(CYGPATH_W) '$(srcdir)/Intyear.c'; fi`
+
+cdo-Invert.o: Invert.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Invert.o -MD -MP -MF $(DEPDIR)/cdo-Invert.Tpo -c -o cdo-Invert.o `test -f 'Invert.c' || echo '$(srcdir)/'`Invert.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Invert.Tpo $(DEPDIR)/cdo-Invert.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Invert.c' object='cdo-Invert.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Invert.o `test -f 'Invert.c' || echo '$(srcdir)/'`Invert.c
+
+cdo-Invert.obj: Invert.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Invert.obj -MD -MP -MF $(DEPDIR)/cdo-Invert.Tpo -c -o cdo-Invert.obj `if test -f 'Invert.c'; then $(CYGPATH_W) 'Invert.c'; else $(CYGPATH_W) '$(srcdir)/Invert.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Invert.Tpo $(DEPDIR)/cdo-Invert.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Invert.c' object='cdo-Invert.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Invert.obj `if test -f 'Invert.c'; then $(CYGPATH_W) 'Invert.c'; else $(CYGPATH_W) '$(srcdir)/Invert.c'; fi`
+
+cdo-Invertlev.o: Invertlev.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Invertlev.o -MD -MP -MF $(DEPDIR)/cdo-Invertlev.Tpo -c -o cdo-Invertlev.o `test -f 'Invertlev.c' || echo '$(srcdir)/'`Invertlev.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Invertlev.Tpo $(DEPDIR)/cdo-Invertlev.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Invertlev.c' object='cdo-Invertlev.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Invertlev.o `test -f 'Invertlev.c' || echo '$(srcdir)/'`Invertlev.c
+
+cdo-Invertlev.obj: Invertlev.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Invertlev.obj -MD -MP -MF $(DEPDIR)/cdo-Invertlev.Tpo -c -o cdo-Invertlev.obj `if test -f 'Invertlev.c'; then $(CYGPATH_W) 'Invertlev.c'; else $(CYGPATH_W) '$(srcdir)/Invertlev.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Invertlev.Tpo $(DEPDIR)/cdo-Invertlev.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Invertlev.c' object='cdo-Invertlev.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Invertlev.obj `if test -f 'Invertlev.c'; then $(CYGPATH_W) 'Invertlev.c'; else $(CYGPATH_W) '$(srcdir)/Invertlev.c'; fi`
+
+cdo-Isosurface.o: Isosurface.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Isosurface.o -MD -MP -MF $(DEPDIR)/cdo-Isosurface.Tpo -c -o cdo-Isosurface.o `test -f 'Isosurface.c' || echo '$(srcdir)/'`Isosurface.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Isosurface.Tpo $(DEPDIR)/cdo-Isosurface.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Isosurface.c' object='cdo-Isosurface.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Isosurface.o `test -f 'Isosurface.c' || echo '$(srcdir)/'`Isosurface.c
+
+cdo-Isosurface.obj: Isosurface.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Isosurface.obj -MD -MP -MF $(DEPDIR)/cdo-Isosurface.Tpo -c -o cdo-Isosurface.obj `if test -f 'Isosurface.c'; then $(CYGPATH_W) 'Isosurface.c'; else $(CYGPATH_W) '$(srcdir)/Isosurface.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Isosurface.Tpo $(DEPDIR)/cdo-Isosurface.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Isosurface.c' object='cdo-Isosurface.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Isosurface.obj `if test -f 'Isosurface.c'; then $(CYGPATH_W) 'Isosurface.c'; else $(CYGPATH_W) '$(srcdir)/Isosurface.c'; fi`
+
+cdo-Kvl.o: Kvl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Kvl.o -MD -MP -MF $(DEPDIR)/cdo-Kvl.Tpo -c -o cdo-Kvl.o `test -f 'Kvl.c' || echo '$(srcdir)/'`Kvl.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Kvl.Tpo $(DEPDIR)/cdo-Kvl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Kvl.c' object='cdo-Kvl.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Kvl.o `test -f 'Kvl.c' || echo '$(srcdir)/'`Kvl.c
+
+cdo-Kvl.obj: Kvl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Kvl.obj -MD -MP -MF $(DEPDIR)/cdo-Kvl.Tpo -c -o cdo-Kvl.obj `if test -f 'Kvl.c'; then $(CYGPATH_W) 'Kvl.c'; else $(CYGPATH_W) '$(srcdir)/Kvl.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Kvl.Tpo $(DEPDIR)/cdo-Kvl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Kvl.c' object='cdo-Kvl.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Kvl.obj `if test -f 'Kvl.c'; then $(CYGPATH_W) 'Kvl.c'; else $(CYGPATH_W) '$(srcdir)/Kvl.c'; fi`
+
+cdo-Log.o: Log.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Log.o -MD -MP -MF $(DEPDIR)/cdo-Log.Tpo -c -o cdo-Log.o `test -f 'Log.c' || echo '$(srcdir)/'`Log.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Log.Tpo $(DEPDIR)/cdo-Log.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Log.c' object='cdo-Log.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Log.o `test -f 'Log.c' || echo '$(srcdir)/'`Log.c
+
+cdo-Log.obj: Log.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Log.obj -MD -MP -MF $(DEPDIR)/cdo-Log.Tpo -c -o cdo-Log.obj `if test -f 'Log.c'; then $(CYGPATH_W) 'Log.c'; else $(CYGPATH_W) '$(srcdir)/Log.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Log.Tpo $(DEPDIR)/cdo-Log.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Log.c' object='cdo-Log.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Log.obj `if test -f 'Log.c'; then $(CYGPATH_W) 'Log.c'; else $(CYGPATH_W) '$(srcdir)/Log.c'; fi`
+
+cdo-Maskbox.o: Maskbox.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Maskbox.o -MD -MP -MF $(DEPDIR)/cdo-Maskbox.Tpo -c -o cdo-Maskbox.o `test -f 'Maskbox.c' || echo '$(srcdir)/'`Maskbox.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Maskbox.Tpo $(DEPDIR)/cdo-Maskbox.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Maskbox.c' object='cdo-Maskbox.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Maskbox.o `test -f 'Maskbox.c' || echo '$(srcdir)/'`Maskbox.c
+
+cdo-Maskbox.obj: Maskbox.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Maskbox.obj -MD -MP -MF $(DEPDIR)/cdo-Maskbox.Tpo -c -o cdo-Maskbox.obj `if test -f 'Maskbox.c'; then $(CYGPATH_W) 'Maskbox.c'; else $(CYGPATH_W) '$(srcdir)/Maskbox.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Maskbox.Tpo $(DEPDIR)/cdo-Maskbox.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Maskbox.c' object='cdo-Maskbox.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Maskbox.obj `if test -f 'Maskbox.c'; then $(CYGPATH_W) 'Maskbox.c'; else $(CYGPATH_W) '$(srcdir)/Maskbox.c'; fi`
+
+cdo-Mastrfu.o: Mastrfu.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Mastrfu.o -MD -MP -MF $(DEPDIR)/cdo-Mastrfu.Tpo -c -o cdo-Mastrfu.o `test -f 'Mastrfu.c' || echo '$(srcdir)/'`Mastrfu.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Mastrfu.Tpo $(DEPDIR)/cdo-Mastrfu.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Mastrfu.c' object='cdo-Mastrfu.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Mastrfu.o `test -f 'Mastrfu.c' || echo '$(srcdir)/'`Mastrfu.c
+
+cdo-Mastrfu.obj: Mastrfu.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Mastrfu.obj -MD -MP -MF $(DEPDIR)/cdo-Mastrfu.Tpo -c -o cdo-Mastrfu.obj `if test -f 'Mastrfu.c'; then $(CYGPATH_W) 'Mastrfu.c'; else $(CYGPATH_W) '$(srcdir)/Mastrfu.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Mastrfu.Tpo $(DEPDIR)/cdo-Mastrfu.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Mastrfu.c' object='cdo-Mastrfu.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Mastrfu.obj `if test -f 'Mastrfu.c'; then $(CYGPATH_W) 'Mastrfu.c'; else $(CYGPATH_W) '$(srcdir)/Mastrfu.c'; fi`
+
+cdo-Math.o: Math.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Math.o -MD -MP -MF $(DEPDIR)/cdo-Math.Tpo -c -o cdo-Math.o `test -f 'Math.c' || echo '$(srcdir)/'`Math.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Math.Tpo $(DEPDIR)/cdo-Math.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Math.c' object='cdo-Math.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Math.o `test -f 'Math.c' || echo '$(srcdir)/'`Math.c
+
+cdo-Math.obj: Math.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Math.obj -MD -MP -MF $(DEPDIR)/cdo-Math.Tpo -c -o cdo-Math.obj `if test -f 'Math.c'; then $(CYGPATH_W) 'Math.c'; else $(CYGPATH_W) '$(srcdir)/Math.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Math.Tpo $(DEPDIR)/cdo-Math.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Math.c' object='cdo-Math.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Math.obj `if test -f 'Math.c'; then $(CYGPATH_W) 'Math.c'; else $(CYGPATH_W) '$(srcdir)/Math.c'; fi`
+
+cdo-Merge.o: Merge.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Merge.o -MD -MP -MF $(DEPDIR)/cdo-Merge.Tpo -c -o cdo-Merge.o `test -f 'Merge.c' || echo '$(srcdir)/'`Merge.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Merge.Tpo $(DEPDIR)/cdo-Merge.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Merge.c' object='cdo-Merge.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Merge.o `test -f 'Merge.c' || echo '$(srcdir)/'`Merge.c
+
+cdo-Merge.obj: Merge.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Merge.obj -MD -MP -MF $(DEPDIR)/cdo-Merge.Tpo -c -o cdo-Merge.obj `if test -f 'Merge.c'; then $(CYGPATH_W) 'Merge.c'; else $(CYGPATH_W) '$(srcdir)/Merge.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Merge.Tpo $(DEPDIR)/cdo-Merge.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Merge.c' object='cdo-Merge.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Merge.obj `if test -f 'Merge.c'; then $(CYGPATH_W) 'Merge.c'; else $(CYGPATH_W) '$(srcdir)/Merge.c'; fi`
+
+cdo-Mergegrid.o: Mergegrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Mergegrid.o -MD -MP -MF $(DEPDIR)/cdo-Mergegrid.Tpo -c -o cdo-Mergegrid.o `test -f 'Mergegrid.c' || echo '$(srcdir)/'`Mergegrid.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Mergegrid.Tpo $(DEPDIR)/cdo-Mergegrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Mergegrid.c' object='cdo-Mergegrid.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Mergegrid.o `test -f 'Mergegrid.c' || echo '$(srcdir)/'`Mergegrid.c
+
+cdo-Mergegrid.obj: Mergegrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Mergegrid.obj -MD -MP -MF $(DEPDIR)/cdo-Mergegrid.Tpo -c -o cdo-Mergegrid.obj `if test -f 'Mergegrid.c'; then $(CYGPATH_W) 'Mergegrid.c'; else $(CYGPATH_W) '$(srcdir)/Mergegrid.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Mergegrid.Tpo $(DEPDIR)/cdo-Mergegrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Mergegrid.c' object='cdo-Mergegrid.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Mergegrid.obj `if test -f 'Mergegrid.c'; then $(CYGPATH_W) 'Mergegrid.c'; else $(CYGPATH_W) '$(srcdir)/Mergegrid.c'; fi`
+
+cdo-Mergetime.o: Mergetime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Mergetime.o -MD -MP -MF $(DEPDIR)/cdo-Mergetime.Tpo -c -o cdo-Mergetime.o `test -f 'Mergetime.c' || echo '$(srcdir)/'`Mergetime.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Mergetime.Tpo $(DEPDIR)/cdo-Mergetime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Mergetime.c' object='cdo-Mergetime.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Mergetime.o `test -f 'Mergetime.c' || echo '$(srcdir)/'`Mergetime.c
+
+cdo-Mergetime.obj: Mergetime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Mergetime.obj -MD -MP -MF $(DEPDIR)/cdo-Mergetime.Tpo -c -o cdo-Mergetime.obj `if test -f 'Mergetime.c'; then $(CYGPATH_W) 'Mergetime.c'; else $(CYGPATH_W) '$(srcdir)/Mergetime.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Mergetime.Tpo $(DEPDIR)/cdo-Mergetime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Mergetime.c' object='cdo-Mergetime.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Mergetime.obj `if test -f 'Mergetime.c'; then $(CYGPATH_W) 'Mergetime.c'; else $(CYGPATH_W) '$(srcdir)/Mergetime.c'; fi`
+
+cdo-Merstat.o: Merstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Merstat.o -MD -MP -MF $(DEPDIR)/cdo-Merstat.Tpo -c -o cdo-Merstat.o `test -f 'Merstat.c' || echo '$(srcdir)/'`Merstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Merstat.Tpo $(DEPDIR)/cdo-Merstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Merstat.c' object='cdo-Merstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Merstat.o `test -f 'Merstat.c' || echo '$(srcdir)/'`Merstat.c
+
+cdo-Merstat.obj: Merstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Merstat.obj -MD -MP -MF $(DEPDIR)/cdo-Merstat.Tpo -c -o cdo-Merstat.obj `if test -f 'Merstat.c'; then $(CYGPATH_W) 'Merstat.c'; else $(CYGPATH_W) '$(srcdir)/Merstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Merstat.Tpo $(DEPDIR)/cdo-Merstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Merstat.c' object='cdo-Merstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Merstat.obj `if test -f 'Merstat.c'; then $(CYGPATH_W) 'Merstat.c'; else $(CYGPATH_W) '$(srcdir)/Merstat.c'; fi`
+
+cdo-Monarith.o: Monarith.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Monarith.o -MD -MP -MF $(DEPDIR)/cdo-Monarith.Tpo -c -o cdo-Monarith.o `test -f 'Monarith.c' || echo '$(srcdir)/'`Monarith.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Monarith.Tpo $(DEPDIR)/cdo-Monarith.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Monarith.c' object='cdo-Monarith.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Monarith.o `test -f 'Monarith.c' || echo '$(srcdir)/'`Monarith.c
+
+cdo-Monarith.obj: Monarith.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Monarith.obj -MD -MP -MF $(DEPDIR)/cdo-Monarith.Tpo -c -o cdo-Monarith.obj `if test -f 'Monarith.c'; then $(CYGPATH_W) 'Monarith.c'; else $(CYGPATH_W) '$(srcdir)/Monarith.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Monarith.Tpo $(DEPDIR)/cdo-Monarith.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Monarith.c' object='cdo-Monarith.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Monarith.obj `if test -f 'Monarith.c'; then $(CYGPATH_W) 'Monarith.c'; else $(CYGPATH_W) '$(srcdir)/Monarith.c'; fi`
+
+cdo-Mrotuv.o: Mrotuv.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Mrotuv.o -MD -MP -MF $(DEPDIR)/cdo-Mrotuv.Tpo -c -o cdo-Mrotuv.o `test -f 'Mrotuv.c' || echo '$(srcdir)/'`Mrotuv.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Mrotuv.Tpo $(DEPDIR)/cdo-Mrotuv.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Mrotuv.c' object='cdo-Mrotuv.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Mrotuv.o `test -f 'Mrotuv.c' || echo '$(srcdir)/'`Mrotuv.c
+
+cdo-Mrotuv.obj: Mrotuv.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Mrotuv.obj -MD -MP -MF $(DEPDIR)/cdo-Mrotuv.Tpo -c -o cdo-Mrotuv.obj `if test -f 'Mrotuv.c'; then $(CYGPATH_W) 'Mrotuv.c'; else $(CYGPATH_W) '$(srcdir)/Mrotuv.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Mrotuv.Tpo $(DEPDIR)/cdo-Mrotuv.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Mrotuv.c' object='cdo-Mrotuv.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Mrotuv.obj `if test -f 'Mrotuv.c'; then $(CYGPATH_W) 'Mrotuv.c'; else $(CYGPATH_W) '$(srcdir)/Mrotuv.c'; fi`
+
+cdo-Mrotuvb.o: Mrotuvb.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Mrotuvb.o -MD -MP -MF $(DEPDIR)/cdo-Mrotuvb.Tpo -c -o cdo-Mrotuvb.o `test -f 'Mrotuvb.c' || echo '$(srcdir)/'`Mrotuvb.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Mrotuvb.Tpo $(DEPDIR)/cdo-Mrotuvb.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Mrotuvb.c' object='cdo-Mrotuvb.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Mrotuvb.o `test -f 'Mrotuvb.c' || echo '$(srcdir)/'`Mrotuvb.c
+
+cdo-Mrotuvb.obj: Mrotuvb.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Mrotuvb.obj -MD -MP -MF $(DEPDIR)/cdo-Mrotuvb.Tpo -c -o cdo-Mrotuvb.obj `if test -f 'Mrotuvb.c'; then $(CYGPATH_W) 'Mrotuvb.c'; else $(CYGPATH_W) '$(srcdir)/Mrotuvb.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Mrotuvb.Tpo $(DEPDIR)/cdo-Mrotuvb.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Mrotuvb.c' object='cdo-Mrotuvb.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Mrotuvb.obj `if test -f 'Mrotuvb.c'; then $(CYGPATH_W) 'Mrotuvb.c'; else $(CYGPATH_W) '$(srcdir)/Mrotuvb.c'; fi`
+
+cdo-Ninfo.o: Ninfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ninfo.o -MD -MP -MF $(DEPDIR)/cdo-Ninfo.Tpo -c -o cdo-Ninfo.o `test -f 'Ninfo.c' || echo '$(srcdir)/'`Ninfo.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ninfo.Tpo $(DEPDIR)/cdo-Ninfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ninfo.c' object='cdo-Ninfo.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ninfo.o `test -f 'Ninfo.c' || echo '$(srcdir)/'`Ninfo.c
+
+cdo-Ninfo.obj: Ninfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ninfo.obj -MD -MP -MF $(DEPDIR)/cdo-Ninfo.Tpo -c -o cdo-Ninfo.obj `if test -f 'Ninfo.c'; then $(CYGPATH_W) 'Ninfo.c'; else $(CYGPATH_W) '$(srcdir)/Ninfo.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ninfo.Tpo $(DEPDIR)/cdo-Ninfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ninfo.c' object='cdo-Ninfo.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ninfo.obj `if test -f 'Ninfo.c'; then $(CYGPATH_W) 'Ninfo.c'; else $(CYGPATH_W) '$(srcdir)/Ninfo.c'; fi`
+
+cdo-Nmltest.o: Nmltest.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Nmltest.o -MD -MP -MF $(DEPDIR)/cdo-Nmltest.Tpo -c -o cdo-Nmltest.o `test -f 'Nmltest.c' || echo '$(srcdir)/'`Nmltest.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Nmltest.Tpo $(DEPDIR)/cdo-Nmltest.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Nmltest.c' object='cdo-Nmltest.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Nmltest.o `test -f 'Nmltest.c' || echo '$(srcdir)/'`Nmltest.c
+
+cdo-Nmltest.obj: Nmltest.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Nmltest.obj -MD -MP -MF $(DEPDIR)/cdo-Nmltest.Tpo -c -o cdo-Nmltest.obj `if test -f 'Nmltest.c'; then $(CYGPATH_W) 'Nmltest.c'; else $(CYGPATH_W) '$(srcdir)/Nmltest.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Nmltest.Tpo $(DEPDIR)/cdo-Nmltest.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Nmltest.c' object='cdo-Nmltest.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Nmltest.obj `if test -f 'Nmltest.c'; then $(CYGPATH_W) 'Nmltest.c'; else $(CYGPATH_W) '$(srcdir)/Nmltest.c'; fi`
+
+cdo-Output.o: Output.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Output.o -MD -MP -MF $(DEPDIR)/cdo-Output.Tpo -c -o cdo-Output.o `test -f 'Output.c' || echo '$(srcdir)/'`Output.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Output.Tpo $(DEPDIR)/cdo-Output.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Output.c' object='cdo-Output.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Output.o `test -f 'Output.c' || echo '$(srcdir)/'`Output.c
+
+cdo-Output.obj: Output.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Output.obj -MD -MP -MF $(DEPDIR)/cdo-Output.Tpo -c -o cdo-Output.obj `if test -f 'Output.c'; then $(CYGPATH_W) 'Output.c'; else $(CYGPATH_W) '$(srcdir)/Output.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Output.Tpo $(DEPDIR)/cdo-Output.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Output.c' object='cdo-Output.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Output.obj `if test -f 'Output.c'; then $(CYGPATH_W) 'Output.c'; else $(CYGPATH_W) '$(srcdir)/Output.c'; fi`
+
+cdo-Outputgmt.o: Outputgmt.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Outputgmt.o -MD -MP -MF $(DEPDIR)/cdo-Outputgmt.Tpo -c -o cdo-Outputgmt.o `test -f 'Outputgmt.c' || echo '$(srcdir)/'`Outputgmt.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Outputgmt.Tpo $(DEPDIR)/cdo-Outputgmt.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Outputgmt.c' object='cdo-Outputgmt.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Outputgmt.o `test -f 'Outputgmt.c' || echo '$(srcdir)/'`Outputgmt.c
+
+cdo-Outputgmt.obj: Outputgmt.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Outputgmt.obj -MD -MP -MF $(DEPDIR)/cdo-Outputgmt.Tpo -c -o cdo-Outputgmt.obj `if test -f 'Outputgmt.c'; then $(CYGPATH_W) 'Outputgmt.c'; else $(CYGPATH_W) '$(srcdir)/Outputgmt.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Outputgmt.Tpo $(DEPDIR)/cdo-Outputgmt.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Outputgmt.c' object='cdo-Outputgmt.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Outputgmt.obj `if test -f 'Outputgmt.c'; then $(CYGPATH_W) 'Outputgmt.c'; else $(CYGPATH_W) '$(srcdir)/Outputgmt.c'; fi`
+
+cdo-Pinfo.o: Pinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Pinfo.o -MD -MP -MF $(DEPDIR)/cdo-Pinfo.Tpo -c -o cdo-Pinfo.o `test -f 'Pinfo.c' || echo '$(srcdir)/'`Pinfo.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Pinfo.Tpo $(DEPDIR)/cdo-Pinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Pinfo.c' object='cdo-Pinfo.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Pinfo.o `test -f 'Pinfo.c' || echo '$(srcdir)/'`Pinfo.c
+
+cdo-Pinfo.obj: Pinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Pinfo.obj -MD -MP -MF $(DEPDIR)/cdo-Pinfo.Tpo -c -o cdo-Pinfo.obj `if test -f 'Pinfo.c'; then $(CYGPATH_W) 'Pinfo.c'; else $(CYGPATH_W) '$(srcdir)/Pinfo.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Pinfo.Tpo $(DEPDIR)/cdo-Pinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Pinfo.c' object='cdo-Pinfo.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Pinfo.obj `if test -f 'Pinfo.c'; then $(CYGPATH_W) 'Pinfo.c'; else $(CYGPATH_W) '$(srcdir)/Pinfo.c'; fi`
+
+cdo-Pressure.o: Pressure.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Pressure.o -MD -MP -MF $(DEPDIR)/cdo-Pressure.Tpo -c -o cdo-Pressure.o `test -f 'Pressure.c' || echo '$(srcdir)/'`Pressure.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Pressure.Tpo $(DEPDIR)/cdo-Pressure.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Pressure.c' object='cdo-Pressure.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Pressure.o `test -f 'Pressure.c' || echo '$(srcdir)/'`Pressure.c
+
+cdo-Pressure.obj: Pressure.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Pressure.obj -MD -MP -MF $(DEPDIR)/cdo-Pressure.Tpo -c -o cdo-Pressure.obj `if test -f 'Pressure.c'; then $(CYGPATH_W) 'Pressure.c'; else $(CYGPATH_W) '$(srcdir)/Pressure.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Pressure.Tpo $(DEPDIR)/cdo-Pressure.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Pressure.c' object='cdo-Pressure.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Pressure.obj `if test -f 'Pressure.c'; then $(CYGPATH_W) 'Pressure.c'; else $(CYGPATH_W) '$(srcdir)/Pressure.c'; fi`
+
+cdo-Regres.o: Regres.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Regres.o -MD -MP -MF $(DEPDIR)/cdo-Regres.Tpo -c -o cdo-Regres.o `test -f 'Regres.c' || echo '$(srcdir)/'`Regres.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Regres.Tpo $(DEPDIR)/cdo-Regres.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Regres.c' object='cdo-Regres.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Regres.o `test -f 'Regres.c' || echo '$(srcdir)/'`Regres.c
+
+cdo-Regres.obj: Regres.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Regres.obj -MD -MP -MF $(DEPDIR)/cdo-Regres.Tpo -c -o cdo-Regres.obj `if test -f 'Regres.c'; then $(CYGPATH_W) 'Regres.c'; else $(CYGPATH_W) '$(srcdir)/Regres.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Regres.Tpo $(DEPDIR)/cdo-Regres.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Regres.c' object='cdo-Regres.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Regres.obj `if test -f 'Regres.c'; then $(CYGPATH_W) 'Regres.c'; else $(CYGPATH_W) '$(srcdir)/Regres.c'; fi`
+
+cdo-Remap.o: Remap.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Remap.o -MD -MP -MF $(DEPDIR)/cdo-Remap.Tpo -c -o cdo-Remap.o `test -f 'Remap.c' || echo '$(srcdir)/'`Remap.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Remap.Tpo $(DEPDIR)/cdo-Remap.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Remap.c' object='cdo-Remap.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Remap.o `test -f 'Remap.c' || echo '$(srcdir)/'`Remap.c
+
+cdo-Remap.obj: Remap.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Remap.obj -MD -MP -MF $(DEPDIR)/cdo-Remap.Tpo -c -o cdo-Remap.obj `if test -f 'Remap.c'; then $(CYGPATH_W) 'Remap.c'; else $(CYGPATH_W) '$(srcdir)/Remap.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Remap.Tpo $(DEPDIR)/cdo-Remap.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Remap.c' object='cdo-Remap.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Remap.obj `if test -f 'Remap.c'; then $(CYGPATH_W) 'Remap.c'; else $(CYGPATH_W) '$(srcdir)/Remap.c'; fi`
+
+cdo-Remapeta.o: Remapeta.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Remapeta.o -MD -MP -MF $(DEPDIR)/cdo-Remapeta.Tpo -c -o cdo-Remapeta.o `test -f 'Remapeta.c' || echo '$(srcdir)/'`Remapeta.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Remapeta.Tpo $(DEPDIR)/cdo-Remapeta.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Remapeta.c' object='cdo-Remapeta.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Remapeta.o `test -f 'Remapeta.c' || echo '$(srcdir)/'`Remapeta.c
+
+cdo-Remapeta.obj: Remapeta.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Remapeta.obj -MD -MP -MF $(DEPDIR)/cdo-Remapeta.Tpo -c -o cdo-Remapeta.obj `if test -f 'Remapeta.c'; then $(CYGPATH_W) 'Remapeta.c'; else $(CYGPATH_W) '$(srcdir)/Remapeta.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Remapeta.Tpo $(DEPDIR)/cdo-Remapeta.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Remapeta.c' object='cdo-Remapeta.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Remapeta.obj `if test -f 'Remapeta.c'; then $(CYGPATH_W) 'Remapeta.c'; else $(CYGPATH_W) '$(srcdir)/Remapeta.c'; fi`
+
+cdo-Replace.o: Replace.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Replace.o -MD -MP -MF $(DEPDIR)/cdo-Replace.Tpo -c -o cdo-Replace.o `test -f 'Replace.c' || echo '$(srcdir)/'`Replace.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Replace.Tpo $(DEPDIR)/cdo-Replace.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Replace.c' object='cdo-Replace.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Replace.o `test -f 'Replace.c' || echo '$(srcdir)/'`Replace.c
+
+cdo-Replace.obj: Replace.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Replace.obj -MD -MP -MF $(DEPDIR)/cdo-Replace.Tpo -c -o cdo-Replace.obj `if test -f 'Replace.c'; then $(CYGPATH_W) 'Replace.c'; else $(CYGPATH_W) '$(srcdir)/Replace.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Replace.Tpo $(DEPDIR)/cdo-Replace.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Replace.c' object='cdo-Replace.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Replace.obj `if test -f 'Replace.c'; then $(CYGPATH_W) 'Replace.c'; else $(CYGPATH_W) '$(srcdir)/Replace.c'; fi`
+
+cdo-Replacevalues.o: Replacevalues.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Replacevalues.o -MD -MP -MF $(DEPDIR)/cdo-Replacevalues.Tpo -c -o cdo-Replacevalues.o `test -f 'Replacevalues.c' || echo '$(srcdir)/'`Replacevalues.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Replacevalues.Tpo $(DEPDIR)/cdo-Replacevalues.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Replacevalues.c' object='cdo-Replacevalues.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Replacevalues.o `test -f 'Replacevalues.c' || echo '$(srcdir)/'`Replacevalues.c
+
+cdo-Replacevalues.obj: Replacevalues.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Replacevalues.obj -MD -MP -MF $(DEPDIR)/cdo-Replacevalues.Tpo -c -o cdo-Replacevalues.obj `if test -f 'Replacevalues.c'; then $(CYGPATH_W) 'Replacevalues.c'; else $(CYGPATH_W) '$(srcdir)/Replacevalues.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Replacevalues.Tpo $(DEPDIR)/cdo-Replacevalues.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Replacevalues.c' object='cdo-Replacevalues.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Replacevalues.obj `if test -f 'Replacevalues.c'; then $(CYGPATH_W) 'Replacevalues.c'; else $(CYGPATH_W) '$(srcdir)/Replacevalues.c'; fi`
+
+cdo-Rhopot.o: Rhopot.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Rhopot.o -MD -MP -MF $(DEPDIR)/cdo-Rhopot.Tpo -c -o cdo-Rhopot.o `test -f 'Rhopot.c' || echo '$(srcdir)/'`Rhopot.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Rhopot.Tpo $(DEPDIR)/cdo-Rhopot.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Rhopot.c' object='cdo-Rhopot.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Rhopot.o `test -f 'Rhopot.c' || echo '$(srcdir)/'`Rhopot.c
+
+cdo-Rhopot.obj: Rhopot.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Rhopot.obj -MD -MP -MF $(DEPDIR)/cdo-Rhopot.Tpo -c -o cdo-Rhopot.obj `if test -f 'Rhopot.c'; then $(CYGPATH_W) 'Rhopot.c'; else $(CYGPATH_W) '$(srcdir)/Rhopot.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Rhopot.Tpo $(DEPDIR)/cdo-Rhopot.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Rhopot.c' object='cdo-Rhopot.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Rhopot.obj `if test -f 'Rhopot.c'; then $(CYGPATH_W) 'Rhopot.c'; else $(CYGPATH_W) '$(srcdir)/Rhopot.c'; fi`
+
+cdo-Rotuv.o: Rotuv.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Rotuv.o -MD -MP -MF $(DEPDIR)/cdo-Rotuv.Tpo -c -o cdo-Rotuv.o `test -f 'Rotuv.c' || echo '$(srcdir)/'`Rotuv.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Rotuv.Tpo $(DEPDIR)/cdo-Rotuv.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Rotuv.c' object='cdo-Rotuv.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Rotuv.o `test -f 'Rotuv.c' || echo '$(srcdir)/'`Rotuv.c
+
+cdo-Rotuv.obj: Rotuv.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Rotuv.obj -MD -MP -MF $(DEPDIR)/cdo-Rotuv.Tpo -c -o cdo-Rotuv.obj `if test -f 'Rotuv.c'; then $(CYGPATH_W) 'Rotuv.c'; else $(CYGPATH_W) '$(srcdir)/Rotuv.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Rotuv.Tpo $(DEPDIR)/cdo-Rotuv.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Rotuv.c' object='cdo-Rotuv.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Rotuv.obj `if test -f 'Rotuv.c'; then $(CYGPATH_W) 'Rotuv.c'; else $(CYGPATH_W) '$(srcdir)/Rotuv.c'; fi`
+
+cdo-Runpctl.o: Runpctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Runpctl.o -MD -MP -MF $(DEPDIR)/cdo-Runpctl.Tpo -c -o cdo-Runpctl.o `test -f 'Runpctl.c' || echo '$(srcdir)/'`Runpctl.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Runpctl.Tpo $(DEPDIR)/cdo-Runpctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Runpctl.c' object='cdo-Runpctl.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Runpctl.o `test -f 'Runpctl.c' || echo '$(srcdir)/'`Runpctl.c
+
+cdo-Runpctl.obj: Runpctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Runpctl.obj -MD -MP -MF $(DEPDIR)/cdo-Runpctl.Tpo -c -o cdo-Runpctl.obj `if test -f 'Runpctl.c'; then $(CYGPATH_W) 'Runpctl.c'; else $(CYGPATH_W) '$(srcdir)/Runpctl.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Runpctl.Tpo $(DEPDIR)/cdo-Runpctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Runpctl.c' object='cdo-Runpctl.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Runpctl.obj `if test -f 'Runpctl.c'; then $(CYGPATH_W) 'Runpctl.c'; else $(CYGPATH_W) '$(srcdir)/Runpctl.c'; fi`
+
+cdo-Runstat.o: Runstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Runstat.o -MD -MP -MF $(DEPDIR)/cdo-Runstat.Tpo -c -o cdo-Runstat.o `test -f 'Runstat.c' || echo '$(srcdir)/'`Runstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Runstat.Tpo $(DEPDIR)/cdo-Runstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Runstat.c' object='cdo-Runstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Runstat.o `test -f 'Runstat.c' || echo '$(srcdir)/'`Runstat.c
+
+cdo-Runstat.obj: Runstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Runstat.obj -MD -MP -MF $(DEPDIR)/cdo-Runstat.Tpo -c -o cdo-Runstat.obj `if test -f 'Runstat.c'; then $(CYGPATH_W) 'Runstat.c'; else $(CYGPATH_W) '$(srcdir)/Runstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Runstat.Tpo $(DEPDIR)/cdo-Runstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Runstat.c' object='cdo-Runstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Runstat.obj `if test -f 'Runstat.c'; then $(CYGPATH_W) 'Runstat.c'; else $(CYGPATH_W) '$(srcdir)/Runstat.c'; fi`
+
+cdo-Scatter.o: Scatter.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Scatter.o -MD -MP -MF $(DEPDIR)/cdo-Scatter.Tpo -c -o cdo-Scatter.o `test -f 'Scatter.c' || echo '$(srcdir)/'`Scatter.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Scatter.Tpo $(DEPDIR)/cdo-Scatter.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Scatter.c' object='cdo-Scatter.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Scatter.o `test -f 'Scatter.c' || echo '$(srcdir)/'`Scatter.c
+
+cdo-Scatter.obj: Scatter.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Scatter.obj -MD -MP -MF $(DEPDIR)/cdo-Scatter.Tpo -c -o cdo-Scatter.obj `if test -f 'Scatter.c'; then $(CYGPATH_W) 'Scatter.c'; else $(CYGPATH_W) '$(srcdir)/Scatter.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Scatter.Tpo $(DEPDIR)/cdo-Scatter.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Scatter.c' object='cdo-Scatter.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Scatter.obj `if test -f 'Scatter.c'; then $(CYGPATH_W) 'Scatter.c'; else $(CYGPATH_W) '$(srcdir)/Scatter.c'; fi`
+
+cdo-Seascount.o: Seascount.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seascount.o -MD -MP -MF $(DEPDIR)/cdo-Seascount.Tpo -c -o cdo-Seascount.o `test -f 'Seascount.c' || echo '$(srcdir)/'`Seascount.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Seascount.Tpo $(DEPDIR)/cdo-Seascount.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Seascount.c' object='cdo-Seascount.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Seascount.o `test -f 'Seascount.c' || echo '$(srcdir)/'`Seascount.c
+
+cdo-Seascount.obj: Seascount.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seascount.obj -MD -MP -MF $(DEPDIR)/cdo-Seascount.Tpo -c -o cdo-Seascount.obj `if test -f 'Seascount.c'; then $(CYGPATH_W) 'Seascount.c'; else $(CYGPATH_W) '$(srcdir)/Seascount.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Seascount.Tpo $(DEPDIR)/cdo-Seascount.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Seascount.c' object='cdo-Seascount.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Seascount.obj `if test -f 'Seascount.c'; then $(CYGPATH_W) 'Seascount.c'; else $(CYGPATH_W) '$(srcdir)/Seascount.c'; fi`
+
+cdo-Seaspctl.o: Seaspctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seaspctl.o -MD -MP -MF $(DEPDIR)/cdo-Seaspctl.Tpo -c -o cdo-Seaspctl.o `test -f 'Seaspctl.c' || echo '$(srcdir)/'`Seaspctl.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Seaspctl.Tpo $(DEPDIR)/cdo-Seaspctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Seaspctl.c' object='cdo-Seaspctl.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Seaspctl.o `test -f 'Seaspctl.c' || echo '$(srcdir)/'`Seaspctl.c
+
+cdo-Seaspctl.obj: Seaspctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seaspctl.obj -MD -MP -MF $(DEPDIR)/cdo-Seaspctl.Tpo -c -o cdo-Seaspctl.obj `if test -f 'Seaspctl.c'; then $(CYGPATH_W) 'Seaspctl.c'; else $(CYGPATH_W) '$(srcdir)/Seaspctl.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Seaspctl.Tpo $(DEPDIR)/cdo-Seaspctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Seaspctl.c' object='cdo-Seaspctl.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Seaspctl.obj `if test -f 'Seaspctl.c'; then $(CYGPATH_W) 'Seaspctl.c'; else $(CYGPATH_W) '$(srcdir)/Seaspctl.c'; fi`
+
+cdo-Seasstat.o: Seasstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seasstat.o -MD -MP -MF $(DEPDIR)/cdo-Seasstat.Tpo -c -o cdo-Seasstat.o `test -f 'Seasstat.c' || echo '$(srcdir)/'`Seasstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Seasstat.Tpo $(DEPDIR)/cdo-Seasstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Seasstat.c' object='cdo-Seasstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Seasstat.o `test -f 'Seasstat.c' || echo '$(srcdir)/'`Seasstat.c
+
+cdo-Seasstat.obj: Seasstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seasstat.obj -MD -MP -MF $(DEPDIR)/cdo-Seasstat.Tpo -c -o cdo-Seasstat.obj `if test -f 'Seasstat.c'; then $(CYGPATH_W) 'Seasstat.c'; else $(CYGPATH_W) '$(srcdir)/Seasstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Seasstat.Tpo $(DEPDIR)/cdo-Seasstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Seasstat.c' object='cdo-Seasstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Seasstat.obj `if test -f 'Seasstat.c'; then $(CYGPATH_W) 'Seasstat.c'; else $(CYGPATH_W) '$(srcdir)/Seasstat.c'; fi`
+
+cdo-Selbox.o: Selbox.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Selbox.o -MD -MP -MF $(DEPDIR)/cdo-Selbox.Tpo -c -o cdo-Selbox.o `test -f 'Selbox.c' || echo '$(srcdir)/'`Selbox.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Selbox.Tpo $(DEPDIR)/cdo-Selbox.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Selbox.c' object='cdo-Selbox.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Selbox.o `test -f 'Selbox.c' || echo '$(srcdir)/'`Selbox.c
+
+cdo-Selbox.obj: Selbox.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Selbox.obj -MD -MP -MF $(DEPDIR)/cdo-Selbox.Tpo -c -o cdo-Selbox.obj `if test -f 'Selbox.c'; then $(CYGPATH_W) 'Selbox.c'; else $(CYGPATH_W) '$(srcdir)/Selbox.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Selbox.Tpo $(DEPDIR)/cdo-Selbox.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Selbox.c' object='cdo-Selbox.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Selbox.obj `if test -f 'Selbox.c'; then $(CYGPATH_W) 'Selbox.c'; else $(CYGPATH_W) '$(srcdir)/Selbox.c'; fi`
+
+cdo-Select.o: Select.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Select.o -MD -MP -MF $(DEPDIR)/cdo-Select.Tpo -c -o cdo-Select.o `test -f 'Select.c' || echo '$(srcdir)/'`Select.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Select.Tpo $(DEPDIR)/cdo-Select.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Select.c' object='cdo-Select.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Select.o `test -f 'Select.c' || echo '$(srcdir)/'`Select.c
+
+cdo-Select.obj: Select.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Select.obj -MD -MP -MF $(DEPDIR)/cdo-Select.Tpo -c -o cdo-Select.obj `if test -f 'Select.c'; then $(CYGPATH_W) 'Select.c'; else $(CYGPATH_W) '$(srcdir)/Select.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Select.Tpo $(DEPDIR)/cdo-Select.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Select.c' object='cdo-Select.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Select.obj `if test -f 'Select.c'; then $(CYGPATH_W) 'Select.c'; else $(CYGPATH_W) '$(srcdir)/Select.c'; fi`
+
+cdo-Seloperator.o: Seloperator.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seloperator.o -MD -MP -MF $(DEPDIR)/cdo-Seloperator.Tpo -c -o cdo-Seloperator.o `test -f 'Seloperator.c' || echo '$(srcdir)/'`Seloperator.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Seloperator.Tpo $(DEPDIR)/cdo-Seloperator.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Seloperator.c' object='cdo-Seloperator.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Seloperator.o `test -f 'Seloperator.c' || echo '$(srcdir)/'`Seloperator.c
+
+cdo-Seloperator.obj: Seloperator.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seloperator.obj -MD -MP -MF $(DEPDIR)/cdo-Seloperator.Tpo -c -o cdo-Seloperator.obj `if test -f 'Seloperator.c'; then $(CYGPATH_W) 'Seloperator.c'; else $(CYGPATH_W) '$(srcdir)/Seloperator.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Seloperator.Tpo $(DEPDIR)/cdo-Seloperator.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Seloperator.c' object='cdo-Seloperator.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Seloperator.obj `if test -f 'Seloperator.c'; then $(CYGPATH_W) 'Seloperator.c'; else $(CYGPATH_W) '$(srcdir)/Seloperator.c'; fi`
+
+cdo-Selrec.o: Selrec.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Selrec.o -MD -MP -MF $(DEPDIR)/cdo-Selrec.Tpo -c -o cdo-Selrec.o `test -f 'Selrec.c' || echo '$(srcdir)/'`Selrec.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Selrec.Tpo $(DEPDIR)/cdo-Selrec.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Selrec.c' object='cdo-Selrec.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Selrec.o `test -f 'Selrec.c' || echo '$(srcdir)/'`Selrec.c
+
+cdo-Selrec.obj: Selrec.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Selrec.obj -MD -MP -MF $(DEPDIR)/cdo-Selrec.Tpo -c -o cdo-Selrec.obj `if test -f 'Selrec.c'; then $(CYGPATH_W) 'Selrec.c'; else $(CYGPATH_W) '$(srcdir)/Selrec.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Selrec.Tpo $(DEPDIR)/cdo-Selrec.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Selrec.c' object='cdo-Selrec.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Selrec.obj `if test -f 'Selrec.c'; then $(CYGPATH_W) 'Selrec.c'; else $(CYGPATH_W) '$(srcdir)/Selrec.c'; fi`
+
+cdo-Seltime.o: Seltime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seltime.o -MD -MP -MF $(DEPDIR)/cdo-Seltime.Tpo -c -o cdo-Seltime.o `test -f 'Seltime.c' || echo '$(srcdir)/'`Seltime.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Seltime.Tpo $(DEPDIR)/cdo-Seltime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Seltime.c' object='cdo-Seltime.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Seltime.o `test -f 'Seltime.c' || echo '$(srcdir)/'`Seltime.c
+
+cdo-Seltime.obj: Seltime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Seltime.obj -MD -MP -MF $(DEPDIR)/cdo-Seltime.Tpo -c -o cdo-Seltime.obj `if test -f 'Seltime.c'; then $(CYGPATH_W) 'Seltime.c'; else $(CYGPATH_W) '$(srcdir)/Seltime.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Seltime.Tpo $(DEPDIR)/cdo-Seltime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Seltime.c' object='cdo-Seltime.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Seltime.obj `if test -f 'Seltime.c'; then $(CYGPATH_W) 'Seltime.c'; else $(CYGPATH_W) '$(srcdir)/Seltime.c'; fi`
+
+cdo-Selvar.o: Selvar.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Selvar.o -MD -MP -MF $(DEPDIR)/cdo-Selvar.Tpo -c -o cdo-Selvar.o `test -f 'Selvar.c' || echo '$(srcdir)/'`Selvar.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Selvar.Tpo $(DEPDIR)/cdo-Selvar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Selvar.c' object='cdo-Selvar.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Selvar.o `test -f 'Selvar.c' || echo '$(srcdir)/'`Selvar.c
+
+cdo-Selvar.obj: Selvar.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Selvar.obj -MD -MP -MF $(DEPDIR)/cdo-Selvar.Tpo -c -o cdo-Selvar.obj `if test -f 'Selvar.c'; then $(CYGPATH_W) 'Selvar.c'; else $(CYGPATH_W) '$(srcdir)/Selvar.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Selvar.Tpo $(DEPDIR)/cdo-Selvar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Selvar.c' object='cdo-Selvar.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Selvar.obj `if test -f 'Selvar.c'; then $(CYGPATH_W) 'Selvar.c'; else $(CYGPATH_W) '$(srcdir)/Selvar.c'; fi`
+
+cdo-Set.o: Set.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Set.o -MD -MP -MF $(DEPDIR)/cdo-Set.Tpo -c -o cdo-Set.o `test -f 'Set.c' || echo '$(srcdir)/'`Set.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Set.Tpo $(DEPDIR)/cdo-Set.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Set.c' object='cdo-Set.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Set.o `test -f 'Set.c' || echo '$(srcdir)/'`Set.c
+
+cdo-Set.obj: Set.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Set.obj -MD -MP -MF $(DEPDIR)/cdo-Set.Tpo -c -o cdo-Set.obj `if test -f 'Set.c'; then $(CYGPATH_W) 'Set.c'; else $(CYGPATH_W) '$(srcdir)/Set.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Set.Tpo $(DEPDIR)/cdo-Set.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Set.c' object='cdo-Set.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Set.obj `if test -f 'Set.c'; then $(CYGPATH_W) 'Set.c'; else $(CYGPATH_W) '$(srcdir)/Set.c'; fi`
+
+cdo-Setbox.o: Setbox.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setbox.o -MD -MP -MF $(DEPDIR)/cdo-Setbox.Tpo -c -o cdo-Setbox.o `test -f 'Setbox.c' || echo '$(srcdir)/'`Setbox.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setbox.Tpo $(DEPDIR)/cdo-Setbox.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setbox.c' object='cdo-Setbox.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setbox.o `test -f 'Setbox.c' || echo '$(srcdir)/'`Setbox.c
+
+cdo-Setbox.obj: Setbox.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setbox.obj -MD -MP -MF $(DEPDIR)/cdo-Setbox.Tpo -c -o cdo-Setbox.obj `if test -f 'Setbox.c'; then $(CYGPATH_W) 'Setbox.c'; else $(CYGPATH_W) '$(srcdir)/Setbox.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setbox.Tpo $(DEPDIR)/cdo-Setbox.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setbox.c' object='cdo-Setbox.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setbox.obj `if test -f 'Setbox.c'; then $(CYGPATH_W) 'Setbox.c'; else $(CYGPATH_W) '$(srcdir)/Setbox.c'; fi`
+
+cdo-Setgatt.o: Setgatt.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setgatt.o -MD -MP -MF $(DEPDIR)/cdo-Setgatt.Tpo -c -o cdo-Setgatt.o `test -f 'Setgatt.c' || echo '$(srcdir)/'`Setgatt.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setgatt.Tpo $(DEPDIR)/cdo-Setgatt.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setgatt.c' object='cdo-Setgatt.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setgatt.o `test -f 'Setgatt.c' || echo '$(srcdir)/'`Setgatt.c
+
+cdo-Setgatt.obj: Setgatt.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setgatt.obj -MD -MP -MF $(DEPDIR)/cdo-Setgatt.Tpo -c -o cdo-Setgatt.obj `if test -f 'Setgatt.c'; then $(CYGPATH_W) 'Setgatt.c'; else $(CYGPATH_W) '$(srcdir)/Setgatt.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setgatt.Tpo $(DEPDIR)/cdo-Setgatt.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setgatt.c' object='cdo-Setgatt.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setgatt.obj `if test -f 'Setgatt.c'; then $(CYGPATH_W) 'Setgatt.c'; else $(CYGPATH_W) '$(srcdir)/Setgatt.c'; fi`
+
+cdo-Setgrid.o: Setgrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setgrid.o -MD -MP -MF $(DEPDIR)/cdo-Setgrid.Tpo -c -o cdo-Setgrid.o `test -f 'Setgrid.c' || echo '$(srcdir)/'`Setgrid.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setgrid.Tpo $(DEPDIR)/cdo-Setgrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setgrid.c' object='cdo-Setgrid.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setgrid.o `test -f 'Setgrid.c' || echo '$(srcdir)/'`Setgrid.c
+
+cdo-Setgrid.obj: Setgrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setgrid.obj -MD -MP -MF $(DEPDIR)/cdo-Setgrid.Tpo -c -o cdo-Setgrid.obj `if test -f 'Setgrid.c'; then $(CYGPATH_W) 'Setgrid.c'; else $(CYGPATH_W) '$(srcdir)/Setgrid.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setgrid.Tpo $(DEPDIR)/cdo-Setgrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setgrid.c' object='cdo-Setgrid.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setgrid.obj `if test -f 'Setgrid.c'; then $(CYGPATH_W) 'Setgrid.c'; else $(CYGPATH_W) '$(srcdir)/Setgrid.c'; fi`
+
+cdo-Sethalo.o: Sethalo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Sethalo.o -MD -MP -MF $(DEPDIR)/cdo-Sethalo.Tpo -c -o cdo-Sethalo.o `test -f 'Sethalo.c' || echo '$(srcdir)/'`Sethalo.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Sethalo.Tpo $(DEPDIR)/cdo-Sethalo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Sethalo.c' object='cdo-Sethalo.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Sethalo.o `test -f 'Sethalo.c' || echo '$(srcdir)/'`Sethalo.c
+
+cdo-Sethalo.obj: Sethalo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Sethalo.obj -MD -MP -MF $(DEPDIR)/cdo-Sethalo.Tpo -c -o cdo-Sethalo.obj `if test -f 'Sethalo.c'; then $(CYGPATH_W) 'Sethalo.c'; else $(CYGPATH_W) '$(srcdir)/Sethalo.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Sethalo.Tpo $(DEPDIR)/cdo-Sethalo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Sethalo.c' object='cdo-Sethalo.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Sethalo.obj `if test -f 'Sethalo.c'; then $(CYGPATH_W) 'Sethalo.c'; else $(CYGPATH_W) '$(srcdir)/Sethalo.c'; fi`
+
+cdo-Setmiss.o: Setmiss.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setmiss.o -MD -MP -MF $(DEPDIR)/cdo-Setmiss.Tpo -c -o cdo-Setmiss.o `test -f 'Setmiss.c' || echo '$(srcdir)/'`Setmiss.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setmiss.Tpo $(DEPDIR)/cdo-Setmiss.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setmiss.c' object='cdo-Setmiss.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setmiss.o `test -f 'Setmiss.c' || echo '$(srcdir)/'`Setmiss.c
+
+cdo-Setmiss.obj: Setmiss.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setmiss.obj -MD -MP -MF $(DEPDIR)/cdo-Setmiss.Tpo -c -o cdo-Setmiss.obj `if test -f 'Setmiss.c'; then $(CYGPATH_W) 'Setmiss.c'; else $(CYGPATH_W) '$(srcdir)/Setmiss.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setmiss.Tpo $(DEPDIR)/cdo-Setmiss.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setmiss.c' object='cdo-Setmiss.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setmiss.obj `if test -f 'Setmiss.c'; then $(CYGPATH_W) 'Setmiss.c'; else $(CYGPATH_W) '$(srcdir)/Setmiss.c'; fi`
+
+cdo-Setpartab.o: Setpartab.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setpartab.o -MD -MP -MF $(DEPDIR)/cdo-Setpartab.Tpo -c -o cdo-Setpartab.o `test -f 'Setpartab.c' || echo '$(srcdir)/'`Setpartab.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setpartab.Tpo $(DEPDIR)/cdo-Setpartab.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setpartab.c' object='cdo-Setpartab.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setpartab.o `test -f 'Setpartab.c' || echo '$(srcdir)/'`Setpartab.c
+
+cdo-Setpartab.obj: Setpartab.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setpartab.obj -MD -MP -MF $(DEPDIR)/cdo-Setpartab.Tpo -c -o cdo-Setpartab.obj `if test -f 'Setpartab.c'; then $(CYGPATH_W) 'Setpartab.c'; else $(CYGPATH_W) '$(srcdir)/Setpartab.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setpartab.Tpo $(DEPDIR)/cdo-Setpartab.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setpartab.c' object='cdo-Setpartab.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setpartab.obj `if test -f 'Setpartab.c'; then $(CYGPATH_W) 'Setpartab.c'; else $(CYGPATH_W) '$(srcdir)/Setpartab.c'; fi`
+
+cdo-Setrcaname.o: Setrcaname.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setrcaname.o -MD -MP -MF $(DEPDIR)/cdo-Setrcaname.Tpo -c -o cdo-Setrcaname.o `test -f 'Setrcaname.c' || echo '$(srcdir)/'`Setrcaname.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setrcaname.Tpo $(DEPDIR)/cdo-Setrcaname.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setrcaname.c' object='cdo-Setrcaname.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setrcaname.o `test -f 'Setrcaname.c' || echo '$(srcdir)/'`Setrcaname.c
+
+cdo-Setrcaname.obj: Setrcaname.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setrcaname.obj -MD -MP -MF $(DEPDIR)/cdo-Setrcaname.Tpo -c -o cdo-Setrcaname.obj `if test -f 'Setrcaname.c'; then $(CYGPATH_W) 'Setrcaname.c'; else $(CYGPATH_W) '$(srcdir)/Setrcaname.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setrcaname.Tpo $(DEPDIR)/cdo-Setrcaname.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setrcaname.c' object='cdo-Setrcaname.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setrcaname.obj `if test -f 'Setrcaname.c'; then $(CYGPATH_W) 'Setrcaname.c'; else $(CYGPATH_W) '$(srcdir)/Setrcaname.c'; fi`
+
+cdo-Settime.o: Settime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Settime.o -MD -MP -MF $(DEPDIR)/cdo-Settime.Tpo -c -o cdo-Settime.o `test -f 'Settime.c' || echo '$(srcdir)/'`Settime.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Settime.Tpo $(DEPDIR)/cdo-Settime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Settime.c' object='cdo-Settime.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Settime.o `test -f 'Settime.c' || echo '$(srcdir)/'`Settime.c
+
+cdo-Settime.obj: Settime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Settime.obj -MD -MP -MF $(DEPDIR)/cdo-Settime.Tpo -c -o cdo-Settime.obj `if test -f 'Settime.c'; then $(CYGPATH_W) 'Settime.c'; else $(CYGPATH_W) '$(srcdir)/Settime.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Settime.Tpo $(DEPDIR)/cdo-Settime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Settime.c' object='cdo-Settime.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Settime.obj `if test -f 'Settime.c'; then $(CYGPATH_W) 'Settime.c'; else $(CYGPATH_W) '$(srcdir)/Settime.c'; fi`
+
+cdo-Setzaxis.o: Setzaxis.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setzaxis.o -MD -MP -MF $(DEPDIR)/cdo-Setzaxis.Tpo -c -o cdo-Setzaxis.o `test -f 'Setzaxis.c' || echo '$(srcdir)/'`Setzaxis.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setzaxis.Tpo $(DEPDIR)/cdo-Setzaxis.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setzaxis.c' object='cdo-Setzaxis.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setzaxis.o `test -f 'Setzaxis.c' || echo '$(srcdir)/'`Setzaxis.c
+
+cdo-Setzaxis.obj: Setzaxis.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Setzaxis.obj -MD -MP -MF $(DEPDIR)/cdo-Setzaxis.Tpo -c -o cdo-Setzaxis.obj `if test -f 'Setzaxis.c'; then $(CYGPATH_W) 'Setzaxis.c'; else $(CYGPATH_W) '$(srcdir)/Setzaxis.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Setzaxis.Tpo $(DEPDIR)/cdo-Setzaxis.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Setzaxis.c' object='cdo-Setzaxis.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Setzaxis.obj `if test -f 'Setzaxis.c'; then $(CYGPATH_W) 'Setzaxis.c'; else $(CYGPATH_W) '$(srcdir)/Setzaxis.c'; fi`
+
+cdo-Showinfo.o: Showinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Showinfo.o -MD -MP -MF $(DEPDIR)/cdo-Showinfo.Tpo -c -o cdo-Showinfo.o `test -f 'Showinfo.c' || echo '$(srcdir)/'`Showinfo.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Showinfo.Tpo $(DEPDIR)/cdo-Showinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Showinfo.c' object='cdo-Showinfo.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Showinfo.o `test -f 'Showinfo.c' || echo '$(srcdir)/'`Showinfo.c
+
+cdo-Showinfo.obj: Showinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Showinfo.obj -MD -MP -MF $(DEPDIR)/cdo-Showinfo.Tpo -c -o cdo-Showinfo.obj `if test -f 'Showinfo.c'; then $(CYGPATH_W) 'Showinfo.c'; else $(CYGPATH_W) '$(srcdir)/Showinfo.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Showinfo.Tpo $(DEPDIR)/cdo-Showinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Showinfo.c' object='cdo-Showinfo.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Showinfo.obj `if test -f 'Showinfo.c'; then $(CYGPATH_W) 'Showinfo.c'; else $(CYGPATH_W) '$(srcdir)/Showinfo.c'; fi`
+
+cdo-Sinfo.o: Sinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Sinfo.o -MD -MP -MF $(DEPDIR)/cdo-Sinfo.Tpo -c -o cdo-Sinfo.o `test -f 'Sinfo.c' || echo '$(srcdir)/'`Sinfo.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Sinfo.Tpo $(DEPDIR)/cdo-Sinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Sinfo.c' object='cdo-Sinfo.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Sinfo.o `test -f 'Sinfo.c' || echo '$(srcdir)/'`Sinfo.c
+
+cdo-Sinfo.obj: Sinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Sinfo.obj -MD -MP -MF $(DEPDIR)/cdo-Sinfo.Tpo -c -o cdo-Sinfo.obj `if test -f 'Sinfo.c'; then $(CYGPATH_W) 'Sinfo.c'; else $(CYGPATH_W) '$(srcdir)/Sinfo.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Sinfo.Tpo $(DEPDIR)/cdo-Sinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Sinfo.c' object='cdo-Sinfo.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Sinfo.obj `if test -f 'Sinfo.c'; then $(CYGPATH_W) 'Sinfo.c'; else $(CYGPATH_W) '$(srcdir)/Sinfo.c'; fi`
+
+cdo-Smooth9.o: Smooth9.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Smooth9.o -MD -MP -MF $(DEPDIR)/cdo-Smooth9.Tpo -c -o cdo-Smooth9.o `test -f 'Smooth9.c' || echo '$(srcdir)/'`Smooth9.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Smooth9.Tpo $(DEPDIR)/cdo-Smooth9.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Smooth9.c' object='cdo-Smooth9.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Smooth9.o `test -f 'Smooth9.c' || echo '$(srcdir)/'`Smooth9.c
+
+cdo-Smooth9.obj: Smooth9.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Smooth9.obj -MD -MP -MF $(DEPDIR)/cdo-Smooth9.Tpo -c -o cdo-Smooth9.obj `if test -f 'Smooth9.c'; then $(CYGPATH_W) 'Smooth9.c'; else $(CYGPATH_W) '$(srcdir)/Smooth9.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Smooth9.Tpo $(DEPDIR)/cdo-Smooth9.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Smooth9.c' object='cdo-Smooth9.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Smooth9.obj `if test -f 'Smooth9.c'; then $(CYGPATH_W) 'Smooth9.c'; else $(CYGPATH_W) '$(srcdir)/Smooth9.c'; fi`
+
+cdo-Sort.o: Sort.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Sort.o -MD -MP -MF $(DEPDIR)/cdo-Sort.Tpo -c -o cdo-Sort.o `test -f 'Sort.c' || echo '$(srcdir)/'`Sort.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Sort.Tpo $(DEPDIR)/cdo-Sort.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Sort.c' object='cdo-Sort.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Sort.o `test -f 'Sort.c' || echo '$(srcdir)/'`Sort.c
+
+cdo-Sort.obj: Sort.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Sort.obj -MD -MP -MF $(DEPDIR)/cdo-Sort.Tpo -c -o cdo-Sort.obj `if test -f 'Sort.c'; then $(CYGPATH_W) 'Sort.c'; else $(CYGPATH_W) '$(srcdir)/Sort.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Sort.Tpo $(DEPDIR)/cdo-Sort.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Sort.c' object='cdo-Sort.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Sort.obj `if test -f 'Sort.c'; then $(CYGPATH_W) 'Sort.c'; else $(CYGPATH_W) '$(srcdir)/Sort.c'; fi`
+
+cdo-Sorttimestamp.o: Sorttimestamp.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Sorttimestamp.o -MD -MP -MF $(DEPDIR)/cdo-Sorttimestamp.Tpo -c -o cdo-Sorttimestamp.o `test -f 'Sorttimestamp.c' || echo '$(srcdir)/'`Sorttimestamp.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Sorttimestamp.Tpo $(DEPDIR)/cdo-Sorttimestamp.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Sorttimestamp.c' object='cdo-Sorttimestamp.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Sorttimestamp.o `test -f 'Sorttimestamp.c' || echo '$(srcdir)/'`Sorttimestamp.c
+
+cdo-Sorttimestamp.obj: Sorttimestamp.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Sorttimestamp.obj -MD -MP -MF $(DEPDIR)/cdo-Sorttimestamp.Tpo -c -o cdo-Sorttimestamp.obj `if test -f 'Sorttimestamp.c'; then $(CYGPATH_W) 'Sorttimestamp.c'; else $(CYGPATH_W) '$(srcdir)/Sorttimestamp.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Sorttimestamp.Tpo $(DEPDIR)/cdo-Sorttimestamp.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Sorttimestamp.c' object='cdo-Sorttimestamp.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Sorttimestamp.obj `if test -f 'Sorttimestamp.c'; then $(CYGPATH_W) 'Sorttimestamp.c'; else $(CYGPATH_W) '$(srcdir)/Sorttimestamp.c'; fi`
+
+cdo-Specinfo.o: Specinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Specinfo.o -MD -MP -MF $(DEPDIR)/cdo-Specinfo.Tpo -c -o cdo-Specinfo.o `test -f 'Specinfo.c' || echo '$(srcdir)/'`Specinfo.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Specinfo.Tpo $(DEPDIR)/cdo-Specinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Specinfo.c' object='cdo-Specinfo.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Specinfo.o `test -f 'Specinfo.c' || echo '$(srcdir)/'`Specinfo.c
+
+cdo-Specinfo.obj: Specinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Specinfo.obj -MD -MP -MF $(DEPDIR)/cdo-Specinfo.Tpo -c -o cdo-Specinfo.obj `if test -f 'Specinfo.c'; then $(CYGPATH_W) 'Specinfo.c'; else $(CYGPATH_W) '$(srcdir)/Specinfo.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Specinfo.Tpo $(DEPDIR)/cdo-Specinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Specinfo.c' object='cdo-Specinfo.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Specinfo.obj `if test -f 'Specinfo.c'; then $(CYGPATH_W) 'Specinfo.c'; else $(CYGPATH_W) '$(srcdir)/Specinfo.c'; fi`
+
+cdo-Spectral.o: Spectral.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Spectral.o -MD -MP -MF $(DEPDIR)/cdo-Spectral.Tpo -c -o cdo-Spectral.o `test -f 'Spectral.c' || echo '$(srcdir)/'`Spectral.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Spectral.Tpo $(DEPDIR)/cdo-Spectral.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Spectral.c' object='cdo-Spectral.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Spectral.o `test -f 'Spectral.c' || echo '$(srcdir)/'`Spectral.c
+
+cdo-Spectral.obj: Spectral.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Spectral.obj -MD -MP -MF $(DEPDIR)/cdo-Spectral.Tpo -c -o cdo-Spectral.obj `if test -f 'Spectral.c'; then $(CYGPATH_W) 'Spectral.c'; else $(CYGPATH_W) '$(srcdir)/Spectral.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Spectral.Tpo $(DEPDIR)/cdo-Spectral.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Spectral.c' object='cdo-Spectral.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Spectral.obj `if test -f 'Spectral.c'; then $(CYGPATH_W) 'Spectral.c'; else $(CYGPATH_W) '$(srcdir)/Spectral.c'; fi`
+
+cdo-Spectrum.o: Spectrum.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Spectrum.o -MD -MP -MF $(DEPDIR)/cdo-Spectrum.Tpo -c -o cdo-Spectrum.o `test -f 'Spectrum.c' || echo '$(srcdir)/'`Spectrum.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Spectrum.Tpo $(DEPDIR)/cdo-Spectrum.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Spectrum.c' object='cdo-Spectrum.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Spectrum.o `test -f 'Spectrum.c' || echo '$(srcdir)/'`Spectrum.c
+
+cdo-Spectrum.obj: Spectrum.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Spectrum.obj -MD -MP -MF $(DEPDIR)/cdo-Spectrum.Tpo -c -o cdo-Spectrum.obj `if test -f 'Spectrum.c'; then $(CYGPATH_W) 'Spectrum.c'; else $(CYGPATH_W) '$(srcdir)/Spectrum.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Spectrum.Tpo $(DEPDIR)/cdo-Spectrum.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Spectrum.c' object='cdo-Spectrum.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Spectrum.obj `if test -f 'Spectrum.c'; then $(CYGPATH_W) 'Spectrum.c'; else $(CYGPATH_W) '$(srcdir)/Spectrum.c'; fi`
+
+cdo-Split.o: Split.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Split.o -MD -MP -MF $(DEPDIR)/cdo-Split.Tpo -c -o cdo-Split.o `test -f 'Split.c' || echo '$(srcdir)/'`Split.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Split.Tpo $(DEPDIR)/cdo-Split.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Split.c' object='cdo-Split.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Split.o `test -f 'Split.c' || echo '$(srcdir)/'`Split.c
+
+cdo-Split.obj: Split.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Split.obj -MD -MP -MF $(DEPDIR)/cdo-Split.Tpo -c -o cdo-Split.obj `if test -f 'Split.c'; then $(CYGPATH_W) 'Split.c'; else $(CYGPATH_W) '$(srcdir)/Split.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Split.Tpo $(DEPDIR)/cdo-Split.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Split.c' object='cdo-Split.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Split.obj `if test -f 'Split.c'; then $(CYGPATH_W) 'Split.c'; else $(CYGPATH_W) '$(srcdir)/Split.c'; fi`
+
+cdo-Splitrec.o: Splitrec.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Splitrec.o -MD -MP -MF $(DEPDIR)/cdo-Splitrec.Tpo -c -o cdo-Splitrec.o `test -f 'Splitrec.c' || echo '$(srcdir)/'`Splitrec.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Splitrec.Tpo $(DEPDIR)/cdo-Splitrec.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Splitrec.c' object='cdo-Splitrec.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Splitrec.o `test -f 'Splitrec.c' || echo '$(srcdir)/'`Splitrec.c
+
+cdo-Splitrec.obj: Splitrec.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Splitrec.obj -MD -MP -MF $(DEPDIR)/cdo-Splitrec.Tpo -c -o cdo-Splitrec.obj `if test -f 'Splitrec.c'; then $(CYGPATH_W) 'Splitrec.c'; else $(CYGPATH_W) '$(srcdir)/Splitrec.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Splitrec.Tpo $(DEPDIR)/cdo-Splitrec.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Splitrec.c' object='cdo-Splitrec.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Splitrec.obj `if test -f 'Splitrec.c'; then $(CYGPATH_W) 'Splitrec.c'; else $(CYGPATH_W) '$(srcdir)/Splitrec.c'; fi`
+
+cdo-Splitsel.o: Splitsel.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Splitsel.o -MD -MP -MF $(DEPDIR)/cdo-Splitsel.Tpo -c -o cdo-Splitsel.o `test -f 'Splitsel.c' || echo '$(srcdir)/'`Splitsel.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Splitsel.Tpo $(DEPDIR)/cdo-Splitsel.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Splitsel.c' object='cdo-Splitsel.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Splitsel.o `test -f 'Splitsel.c' || echo '$(srcdir)/'`Splitsel.c
+
+cdo-Splitsel.obj: Splitsel.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Splitsel.obj -MD -MP -MF $(DEPDIR)/cdo-Splitsel.Tpo -c -o cdo-Splitsel.obj `if test -f 'Splitsel.c'; then $(CYGPATH_W) 'Splitsel.c'; else $(CYGPATH_W) '$(srcdir)/Splitsel.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Splitsel.Tpo $(DEPDIR)/cdo-Splitsel.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Splitsel.c' object='cdo-Splitsel.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Splitsel.obj `if test -f 'Splitsel.c'; then $(CYGPATH_W) 'Splitsel.c'; else $(CYGPATH_W) '$(srcdir)/Splitsel.c'; fi`
+
+cdo-Splittime.o: Splittime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Splittime.o -MD -MP -MF $(DEPDIR)/cdo-Splittime.Tpo -c -o cdo-Splittime.o `test -f 'Splittime.c' || echo '$(srcdir)/'`Splittime.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Splittime.Tpo $(DEPDIR)/cdo-Splittime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Splittime.c' object='cdo-Splittime.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Splittime.o `test -f 'Splittime.c' || echo '$(srcdir)/'`Splittime.c
+
+cdo-Splittime.obj: Splittime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Splittime.obj -MD -MP -MF $(DEPDIR)/cdo-Splittime.Tpo -c -o cdo-Splittime.obj `if test -f 'Splittime.c'; then $(CYGPATH_W) 'Splittime.c'; else $(CYGPATH_W) '$(srcdir)/Splittime.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Splittime.Tpo $(DEPDIR)/cdo-Splittime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Splittime.c' object='cdo-Splittime.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Splittime.obj `if test -f 'Splittime.c'; then $(CYGPATH_W) 'Splittime.c'; else $(CYGPATH_W) '$(srcdir)/Splittime.c'; fi`
+
+cdo-Splityear.o: Splityear.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Splityear.o -MD -MP -MF $(DEPDIR)/cdo-Splityear.Tpo -c -o cdo-Splityear.o `test -f 'Splityear.c' || echo '$(srcdir)/'`Splityear.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Splityear.Tpo $(DEPDIR)/cdo-Splityear.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Splityear.c' object='cdo-Splityear.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Splityear.o `test -f 'Splityear.c' || echo '$(srcdir)/'`Splityear.c
+
+cdo-Splityear.obj: Splityear.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Splityear.obj -MD -MP -MF $(DEPDIR)/cdo-Splityear.Tpo -c -o cdo-Splityear.obj `if test -f 'Splityear.c'; then $(CYGPATH_W) 'Splityear.c'; else $(CYGPATH_W) '$(srcdir)/Splityear.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Splityear.Tpo $(DEPDIR)/cdo-Splityear.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Splityear.c' object='cdo-Splityear.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Splityear.obj `if test -f 'Splityear.c'; then $(CYGPATH_W) 'Splityear.c'; else $(CYGPATH_W) '$(srcdir)/Splityear.c'; fi`
+
+cdo-SSOpar.o: SSOpar.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-SSOpar.o -MD -MP -MF $(DEPDIR)/cdo-SSOpar.Tpo -c -o cdo-SSOpar.o `test -f 'SSOpar.c' || echo '$(srcdir)/'`SSOpar.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-SSOpar.Tpo $(DEPDIR)/cdo-SSOpar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='SSOpar.c' object='cdo-SSOpar.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-SSOpar.o `test -f 'SSOpar.c' || echo '$(srcdir)/'`SSOpar.c
+
+cdo-SSOpar.obj: SSOpar.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-SSOpar.obj -MD -MP -MF $(DEPDIR)/cdo-SSOpar.Tpo -c -o cdo-SSOpar.obj `if test -f 'SSOpar.c'; then $(CYGPATH_W) 'SSOpar.c'; else $(CYGPATH_W) '$(srcdir)/SSOpar.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-SSOpar.Tpo $(DEPDIR)/cdo-SSOpar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='SSOpar.c' object='cdo-SSOpar.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-SSOpar.obj `if test -f 'SSOpar.c'; then $(CYGPATH_W) 'SSOpar.c'; else $(CYGPATH_W) '$(srcdir)/SSOpar.c'; fi`
+
+cdo-Subtrend.o: Subtrend.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Subtrend.o -MD -MP -MF $(DEPDIR)/cdo-Subtrend.Tpo -c -o cdo-Subtrend.o `test -f 'Subtrend.c' || echo '$(srcdir)/'`Subtrend.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Subtrend.Tpo $(DEPDIR)/cdo-Subtrend.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Subtrend.c' object='cdo-Subtrend.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Subtrend.o `test -f 'Subtrend.c' || echo '$(srcdir)/'`Subtrend.c
+
+cdo-Subtrend.obj: Subtrend.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Subtrend.obj -MD -MP -MF $(DEPDIR)/cdo-Subtrend.Tpo -c -o cdo-Subtrend.obj `if test -f 'Subtrend.c'; then $(CYGPATH_W) 'Subtrend.c'; else $(CYGPATH_W) '$(srcdir)/Subtrend.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Subtrend.Tpo $(DEPDIR)/cdo-Subtrend.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Subtrend.c' object='cdo-Subtrend.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Subtrend.obj `if test -f 'Subtrend.c'; then $(CYGPATH_W) 'Subtrend.c'; else $(CYGPATH_W) '$(srcdir)/Subtrend.c'; fi`
+
+cdo-Tee.o: Tee.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Tee.o -MD -MP -MF $(DEPDIR)/cdo-Tee.Tpo -c -o cdo-Tee.o `test -f 'Tee.c' || echo '$(srcdir)/'`Tee.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Tee.Tpo $(DEPDIR)/cdo-Tee.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Tee.c' object='cdo-Tee.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Tee.o `test -f 'Tee.c' || echo '$(srcdir)/'`Tee.c
+
+cdo-Tee.obj: Tee.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Tee.obj -MD -MP -MF $(DEPDIR)/cdo-Tee.Tpo -c -o cdo-Tee.obj `if test -f 'Tee.c'; then $(CYGPATH_W) 'Tee.c'; else $(CYGPATH_W) '$(srcdir)/Tee.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Tee.Tpo $(DEPDIR)/cdo-Tee.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Tee.c' object='cdo-Tee.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Tee.obj `if test -f 'Tee.c'; then $(CYGPATH_W) 'Tee.c'; else $(CYGPATH_W) '$(srcdir)/Tee.c'; fi`
+
+cdo-Templates.o: Templates.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Templates.o -MD -MP -MF $(DEPDIR)/cdo-Templates.Tpo -c -o cdo-Templates.o `test -f 'Templates.c' || echo '$(srcdir)/'`Templates.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Templates.Tpo $(DEPDIR)/cdo-Templates.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Templates.c' object='cdo-Templates.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Templates.o `test -f 'Templates.c' || echo '$(srcdir)/'`Templates.c
+
+cdo-Templates.obj: Templates.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Templates.obj -MD -MP -MF $(DEPDIR)/cdo-Templates.Tpo -c -o cdo-Templates.obj `if test -f 'Templates.c'; then $(CYGPATH_W) 'Templates.c'; else $(CYGPATH_W) '$(srcdir)/Templates.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Templates.Tpo $(DEPDIR)/cdo-Templates.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Templates.c' object='cdo-Templates.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Templates.obj `if test -f 'Templates.c'; then $(CYGPATH_W) 'Templates.c'; else $(CYGPATH_W) '$(srcdir)/Templates.c'; fi`
+
+cdo-Test.o: Test.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Test.o -MD -MP -MF $(DEPDIR)/cdo-Test.Tpo -c -o cdo-Test.o `test -f 'Test.c' || echo '$(srcdir)/'`Test.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Test.Tpo $(DEPDIR)/cdo-Test.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Test.c' object='cdo-Test.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Test.o `test -f 'Test.c' || echo '$(srcdir)/'`Test.c
+
+cdo-Test.obj: Test.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Test.obj -MD -MP -MF $(DEPDIR)/cdo-Test.Tpo -c -o cdo-Test.obj `if test -f 'Test.c'; then $(CYGPATH_W) 'Test.c'; else $(CYGPATH_W) '$(srcdir)/Test.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Test.Tpo $(DEPDIR)/cdo-Test.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Test.c' object='cdo-Test.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Test.obj `if test -f 'Test.c'; then $(CYGPATH_W) 'Test.c'; else $(CYGPATH_W) '$(srcdir)/Test.c'; fi`
+
+cdo-Tests.o: Tests.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Tests.o -MD -MP -MF $(DEPDIR)/cdo-Tests.Tpo -c -o cdo-Tests.o `test -f 'Tests.c' || echo '$(srcdir)/'`Tests.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Tests.Tpo $(DEPDIR)/cdo-Tests.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Tests.c' object='cdo-Tests.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Tests.o `test -f 'Tests.c' || echo '$(srcdir)/'`Tests.c
+
+cdo-Tests.obj: Tests.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Tests.obj -MD -MP -MF $(DEPDIR)/cdo-Tests.Tpo -c -o cdo-Tests.obj `if test -f 'Tests.c'; then $(CYGPATH_W) 'Tests.c'; else $(CYGPATH_W) '$(srcdir)/Tests.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Tests.Tpo $(DEPDIR)/cdo-Tests.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Tests.c' object='cdo-Tests.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Tests.obj `if test -f 'Tests.c'; then $(CYGPATH_W) 'Tests.c'; else $(CYGPATH_W) '$(srcdir)/Tests.c'; fi`
+
+cdo-Timcount.o: Timcount.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timcount.o -MD -MP -MF $(DEPDIR)/cdo-Timcount.Tpo -c -o cdo-Timcount.o `test -f 'Timcount.c' || echo '$(srcdir)/'`Timcount.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timcount.Tpo $(DEPDIR)/cdo-Timcount.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timcount.c' object='cdo-Timcount.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timcount.o `test -f 'Timcount.c' || echo '$(srcdir)/'`Timcount.c
+
+cdo-Timcount.obj: Timcount.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timcount.obj -MD -MP -MF $(DEPDIR)/cdo-Timcount.Tpo -c -o cdo-Timcount.obj `if test -f 'Timcount.c'; then $(CYGPATH_W) 'Timcount.c'; else $(CYGPATH_W) '$(srcdir)/Timcount.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timcount.Tpo $(DEPDIR)/cdo-Timcount.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timcount.c' object='cdo-Timcount.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timcount.obj `if test -f 'Timcount.c'; then $(CYGPATH_W) 'Timcount.c'; else $(CYGPATH_W) '$(srcdir)/Timcount.c'; fi`
+
+cdo-Timpctl.o: Timpctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timpctl.o -MD -MP -MF $(DEPDIR)/cdo-Timpctl.Tpo -c -o cdo-Timpctl.o `test -f 'Timpctl.c' || echo '$(srcdir)/'`Timpctl.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timpctl.Tpo $(DEPDIR)/cdo-Timpctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timpctl.c' object='cdo-Timpctl.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timpctl.o `test -f 'Timpctl.c' || echo '$(srcdir)/'`Timpctl.c
+
+cdo-Timpctl.obj: Timpctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timpctl.obj -MD -MP -MF $(DEPDIR)/cdo-Timpctl.Tpo -c -o cdo-Timpctl.obj `if test -f 'Timpctl.c'; then $(CYGPATH_W) 'Timpctl.c'; else $(CYGPATH_W) '$(srcdir)/Timpctl.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timpctl.Tpo $(DEPDIR)/cdo-Timpctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timpctl.c' object='cdo-Timpctl.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timpctl.obj `if test -f 'Timpctl.c'; then $(CYGPATH_W) 'Timpctl.c'; else $(CYGPATH_W) '$(srcdir)/Timpctl.c'; fi`
+
+cdo-Timselpctl.o: Timselpctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timselpctl.o -MD -MP -MF $(DEPDIR)/cdo-Timselpctl.Tpo -c -o cdo-Timselpctl.o `test -f 'Timselpctl.c' || echo '$(srcdir)/'`Timselpctl.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timselpctl.Tpo $(DEPDIR)/cdo-Timselpctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timselpctl.c' object='cdo-Timselpctl.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timselpctl.o `test -f 'Timselpctl.c' || echo '$(srcdir)/'`Timselpctl.c
+
+cdo-Timselpctl.obj: Timselpctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timselpctl.obj -MD -MP -MF $(DEPDIR)/cdo-Timselpctl.Tpo -c -o cdo-Timselpctl.obj `if test -f 'Timselpctl.c'; then $(CYGPATH_W) 'Timselpctl.c'; else $(CYGPATH_W) '$(srcdir)/Timselpctl.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timselpctl.Tpo $(DEPDIR)/cdo-Timselpctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timselpctl.c' object='cdo-Timselpctl.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timselpctl.obj `if test -f 'Timselpctl.c'; then $(CYGPATH_W) 'Timselpctl.c'; else $(CYGPATH_W) '$(srcdir)/Timselpctl.c'; fi`
+
+cdo-Timselstat.o: Timselstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timselstat.o -MD -MP -MF $(DEPDIR)/cdo-Timselstat.Tpo -c -o cdo-Timselstat.o `test -f 'Timselstat.c' || echo '$(srcdir)/'`Timselstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timselstat.Tpo $(DEPDIR)/cdo-Timselstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timselstat.c' object='cdo-Timselstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timselstat.o `test -f 'Timselstat.c' || echo '$(srcdir)/'`Timselstat.c
+
+cdo-Timselstat.obj: Timselstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timselstat.obj -MD -MP -MF $(DEPDIR)/cdo-Timselstat.Tpo -c -o cdo-Timselstat.obj `if test -f 'Timselstat.c'; then $(CYGPATH_W) 'Timselstat.c'; else $(CYGPATH_W) '$(srcdir)/Timselstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timselstat.Tpo $(DEPDIR)/cdo-Timselstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timselstat.c' object='cdo-Timselstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timselstat.obj `if test -f 'Timselstat.c'; then $(CYGPATH_W) 'Timselstat.c'; else $(CYGPATH_W) '$(srcdir)/Timselstat.c'; fi`
+
+cdo-Timsort.o: Timsort.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timsort.o -MD -MP -MF $(DEPDIR)/cdo-Timsort.Tpo -c -o cdo-Timsort.o `test -f 'Timsort.c' || echo '$(srcdir)/'`Timsort.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timsort.Tpo $(DEPDIR)/cdo-Timsort.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timsort.c' object='cdo-Timsort.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timsort.o `test -f 'Timsort.c' || echo '$(srcdir)/'`Timsort.c
+
+cdo-Timsort.obj: Timsort.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timsort.obj -MD -MP -MF $(DEPDIR)/cdo-Timsort.Tpo -c -o cdo-Timsort.obj `if test -f 'Timsort.c'; then $(CYGPATH_W) 'Timsort.c'; else $(CYGPATH_W) '$(srcdir)/Timsort.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timsort.Tpo $(DEPDIR)/cdo-Timsort.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timsort.c' object='cdo-Timsort.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timsort.obj `if test -f 'Timsort.c'; then $(CYGPATH_W) 'Timsort.c'; else $(CYGPATH_W) '$(srcdir)/Timsort.c'; fi`
+
+cdo-Timstat.o: Timstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timstat.o -MD -MP -MF $(DEPDIR)/cdo-Timstat.Tpo -c -o cdo-Timstat.o `test -f 'Timstat.c' || echo '$(srcdir)/'`Timstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timstat.Tpo $(DEPDIR)/cdo-Timstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timstat.c' object='cdo-Timstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timstat.o `test -f 'Timstat.c' || echo '$(srcdir)/'`Timstat.c
+
+cdo-Timstat.obj: Timstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timstat.obj -MD -MP -MF $(DEPDIR)/cdo-Timstat.Tpo -c -o cdo-Timstat.obj `if test -f 'Timstat.c'; then $(CYGPATH_W) 'Timstat.c'; else $(CYGPATH_W) '$(srcdir)/Timstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timstat.Tpo $(DEPDIR)/cdo-Timstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timstat.c' object='cdo-Timstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timstat.obj `if test -f 'Timstat.c'; then $(CYGPATH_W) 'Timstat.c'; else $(CYGPATH_W) '$(srcdir)/Timstat.c'; fi`
+
+cdo-Timstat2.o: Timstat2.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timstat2.o -MD -MP -MF $(DEPDIR)/cdo-Timstat2.Tpo -c -o cdo-Timstat2.o `test -f 'Timstat2.c' || echo '$(srcdir)/'`Timstat2.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timstat2.Tpo $(DEPDIR)/cdo-Timstat2.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timstat2.c' object='cdo-Timstat2.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timstat2.o `test -f 'Timstat2.c' || echo '$(srcdir)/'`Timstat2.c
+
+cdo-Timstat2.obj: Timstat2.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timstat2.obj -MD -MP -MF $(DEPDIR)/cdo-Timstat2.Tpo -c -o cdo-Timstat2.obj `if test -f 'Timstat2.c'; then $(CYGPATH_W) 'Timstat2.c'; else $(CYGPATH_W) '$(srcdir)/Timstat2.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timstat2.Tpo $(DEPDIR)/cdo-Timstat2.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timstat2.c' object='cdo-Timstat2.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timstat2.obj `if test -f 'Timstat2.c'; then $(CYGPATH_W) 'Timstat2.c'; else $(CYGPATH_W) '$(srcdir)/Timstat2.c'; fi`
+
+cdo-Timstat3.o: Timstat3.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timstat3.o -MD -MP -MF $(DEPDIR)/cdo-Timstat3.Tpo -c -o cdo-Timstat3.o `test -f 'Timstat3.c' || echo '$(srcdir)/'`Timstat3.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timstat3.Tpo $(DEPDIR)/cdo-Timstat3.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timstat3.c' object='cdo-Timstat3.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timstat3.o `test -f 'Timstat3.c' || echo '$(srcdir)/'`Timstat3.c
+
+cdo-Timstat3.obj: Timstat3.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Timstat3.obj -MD -MP -MF $(DEPDIR)/cdo-Timstat3.Tpo -c -o cdo-Timstat3.obj `if test -f 'Timstat3.c'; then $(CYGPATH_W) 'Timstat3.c'; else $(CYGPATH_W) '$(srcdir)/Timstat3.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Timstat3.Tpo $(DEPDIR)/cdo-Timstat3.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Timstat3.c' object='cdo-Timstat3.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Timstat3.obj `if test -f 'Timstat3.c'; then $(CYGPATH_W) 'Timstat3.c'; else $(CYGPATH_W) '$(srcdir)/Timstat3.c'; fi`
+
+cdo-Tinfo.o: Tinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Tinfo.o -MD -MP -MF $(DEPDIR)/cdo-Tinfo.Tpo -c -o cdo-Tinfo.o `test -f 'Tinfo.c' || echo '$(srcdir)/'`Tinfo.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Tinfo.Tpo $(DEPDIR)/cdo-Tinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Tinfo.c' object='cdo-Tinfo.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Tinfo.o `test -f 'Tinfo.c' || echo '$(srcdir)/'`Tinfo.c
+
+cdo-Tinfo.obj: Tinfo.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Tinfo.obj -MD -MP -MF $(DEPDIR)/cdo-Tinfo.Tpo -c -o cdo-Tinfo.obj `if test -f 'Tinfo.c'; then $(CYGPATH_W) 'Tinfo.c'; else $(CYGPATH_W) '$(srcdir)/Tinfo.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Tinfo.Tpo $(DEPDIR)/cdo-Tinfo.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Tinfo.c' object='cdo-Tinfo.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Tinfo.obj `if test -f 'Tinfo.c'; then $(CYGPATH_W) 'Tinfo.c'; else $(CYGPATH_W) '$(srcdir)/Tinfo.c'; fi`
+
+cdo-Tocomplex.o: Tocomplex.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Tocomplex.o -MD -MP -MF $(DEPDIR)/cdo-Tocomplex.Tpo -c -o cdo-Tocomplex.o `test -f 'Tocomplex.c' || echo '$(srcdir)/'`Tocomplex.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Tocomplex.Tpo $(DEPDIR)/cdo-Tocomplex.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Tocomplex.c' object='cdo-Tocomplex.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Tocomplex.o `test -f 'Tocomplex.c' || echo '$(srcdir)/'`Tocomplex.c
+
+cdo-Tocomplex.obj: Tocomplex.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Tocomplex.obj -MD -MP -MF $(DEPDIR)/cdo-Tocomplex.Tpo -c -o cdo-Tocomplex.obj `if test -f 'Tocomplex.c'; then $(CYGPATH_W) 'Tocomplex.c'; else $(CYGPATH_W) '$(srcdir)/Tocomplex.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Tocomplex.Tpo $(DEPDIR)/cdo-Tocomplex.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Tocomplex.c' object='cdo-Tocomplex.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Tocomplex.obj `if test -f 'Tocomplex.c'; then $(CYGPATH_W) 'Tocomplex.c'; else $(CYGPATH_W) '$(srcdir)/Tocomplex.c'; fi`
+
+cdo-Transpose.o: Transpose.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Transpose.o -MD -MP -MF $(DEPDIR)/cdo-Transpose.Tpo -c -o cdo-Transpose.o `test -f 'Transpose.c' || echo '$(srcdir)/'`Transpose.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Transpose.Tpo $(DEPDIR)/cdo-Transpose.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Transpose.c' object='cdo-Transpose.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Transpose.o `test -f 'Transpose.c' || echo '$(srcdir)/'`Transpose.c
+
+cdo-Transpose.obj: Transpose.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Transpose.obj -MD -MP -MF $(DEPDIR)/cdo-Transpose.Tpo -c -o cdo-Transpose.obj `if test -f 'Transpose.c'; then $(CYGPATH_W) 'Transpose.c'; else $(CYGPATH_W) '$(srcdir)/Transpose.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Transpose.Tpo $(DEPDIR)/cdo-Transpose.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Transpose.c' object='cdo-Transpose.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Transpose.obj `if test -f 'Transpose.c'; then $(CYGPATH_W) 'Transpose.c'; else $(CYGPATH_W) '$(srcdir)/Transpose.c'; fi`
+
+cdo-Trend.o: Trend.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Trend.o -MD -MP -MF $(DEPDIR)/cdo-Trend.Tpo -c -o cdo-Trend.o `test -f 'Trend.c' || echo '$(srcdir)/'`Trend.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Trend.Tpo $(DEPDIR)/cdo-Trend.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Trend.c' object='cdo-Trend.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Trend.o `test -f 'Trend.c' || echo '$(srcdir)/'`Trend.c
+
+cdo-Trend.obj: Trend.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Trend.obj -MD -MP -MF $(DEPDIR)/cdo-Trend.Tpo -c -o cdo-Trend.obj `if test -f 'Trend.c'; then $(CYGPATH_W) 'Trend.c'; else $(CYGPATH_W) '$(srcdir)/Trend.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Trend.Tpo $(DEPDIR)/cdo-Trend.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Trend.c' object='cdo-Trend.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Trend.obj `if test -f 'Trend.c'; then $(CYGPATH_W) 'Trend.c'; else $(CYGPATH_W) '$(srcdir)/Trend.c'; fi`
+
+cdo-Trms.o: Trms.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Trms.o -MD -MP -MF $(DEPDIR)/cdo-Trms.Tpo -c -o cdo-Trms.o `test -f 'Trms.c' || echo '$(srcdir)/'`Trms.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Trms.Tpo $(DEPDIR)/cdo-Trms.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Trms.c' object='cdo-Trms.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Trms.o `test -f 'Trms.c' || echo '$(srcdir)/'`Trms.c
+
+cdo-Trms.obj: Trms.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Trms.obj -MD -MP -MF $(DEPDIR)/cdo-Trms.Tpo -c -o cdo-Trms.obj `if test -f 'Trms.c'; then $(CYGPATH_W) 'Trms.c'; else $(CYGPATH_W) '$(srcdir)/Trms.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Trms.Tpo $(DEPDIR)/cdo-Trms.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Trms.c' object='cdo-Trms.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Trms.obj `if test -f 'Trms.c'; then $(CYGPATH_W) 'Trms.c'; else $(CYGPATH_W) '$(srcdir)/Trms.c'; fi`
+
+cdo-Tstepcount.o: Tstepcount.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Tstepcount.o -MD -MP -MF $(DEPDIR)/cdo-Tstepcount.Tpo -c -o cdo-Tstepcount.o `test -f 'Tstepcount.c' || echo '$(srcdir)/'`Tstepcount.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Tstepcount.Tpo $(DEPDIR)/cdo-Tstepcount.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Tstepcount.c' object='cdo-Tstepcount.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Tstepcount.o `test -f 'Tstepcount.c' || echo '$(srcdir)/'`Tstepcount.c
+
+cdo-Tstepcount.obj: Tstepcount.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Tstepcount.obj -MD -MP -MF $(DEPDIR)/cdo-Tstepcount.Tpo -c -o cdo-Tstepcount.obj `if test -f 'Tstepcount.c'; then $(CYGPATH_W) 'Tstepcount.c'; else $(CYGPATH_W) '$(srcdir)/Tstepcount.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Tstepcount.Tpo $(DEPDIR)/cdo-Tstepcount.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Tstepcount.c' object='cdo-Tstepcount.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Tstepcount.obj `if test -f 'Tstepcount.c'; then $(CYGPATH_W) 'Tstepcount.c'; else $(CYGPATH_W) '$(srcdir)/Tstepcount.c'; fi`
+
+cdo-Vardup.o: Vardup.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Vardup.o -MD -MP -MF $(DEPDIR)/cdo-Vardup.Tpo -c -o cdo-Vardup.o `test -f 'Vardup.c' || echo '$(srcdir)/'`Vardup.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Vardup.Tpo $(DEPDIR)/cdo-Vardup.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Vardup.c' object='cdo-Vardup.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Vardup.o `test -f 'Vardup.c' || echo '$(srcdir)/'`Vardup.c
+
+cdo-Vardup.obj: Vardup.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Vardup.obj -MD -MP -MF $(DEPDIR)/cdo-Vardup.Tpo -c -o cdo-Vardup.obj `if test -f 'Vardup.c'; then $(CYGPATH_W) 'Vardup.c'; else $(CYGPATH_W) '$(srcdir)/Vardup.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Vardup.Tpo $(DEPDIR)/cdo-Vardup.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Vardup.c' object='cdo-Vardup.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Vardup.obj `if test -f 'Vardup.c'; then $(CYGPATH_W) 'Vardup.c'; else $(CYGPATH_W) '$(srcdir)/Vardup.c'; fi`
+
+cdo-Vargen.o: Vargen.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Vargen.o -MD -MP -MF $(DEPDIR)/cdo-Vargen.Tpo -c -o cdo-Vargen.o `test -f 'Vargen.c' || echo '$(srcdir)/'`Vargen.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Vargen.Tpo $(DEPDIR)/cdo-Vargen.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Vargen.c' object='cdo-Vargen.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Vargen.o `test -f 'Vargen.c' || echo '$(srcdir)/'`Vargen.c
+
+cdo-Vargen.obj: Vargen.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Vargen.obj -MD -MP -MF $(DEPDIR)/cdo-Vargen.Tpo -c -o cdo-Vargen.obj `if test -f 'Vargen.c'; then $(CYGPATH_W) 'Vargen.c'; else $(CYGPATH_W) '$(srcdir)/Vargen.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Vargen.Tpo $(DEPDIR)/cdo-Vargen.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Vargen.c' object='cdo-Vargen.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Vargen.obj `if test -f 'Vargen.c'; then $(CYGPATH_W) 'Vargen.c'; else $(CYGPATH_W) '$(srcdir)/Vargen.c'; fi`
+
+cdo-Varrms.o: Varrms.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Varrms.o -MD -MP -MF $(DEPDIR)/cdo-Varrms.Tpo -c -o cdo-Varrms.o `test -f 'Varrms.c' || echo '$(srcdir)/'`Varrms.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Varrms.Tpo $(DEPDIR)/cdo-Varrms.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Varrms.c' object='cdo-Varrms.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Varrms.o `test -f 'Varrms.c' || echo '$(srcdir)/'`Varrms.c
+
+cdo-Varrms.obj: Varrms.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Varrms.obj -MD -MP -MF $(DEPDIR)/cdo-Varrms.Tpo -c -o cdo-Varrms.obj `if test -f 'Varrms.c'; then $(CYGPATH_W) 'Varrms.c'; else $(CYGPATH_W) '$(srcdir)/Varrms.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Varrms.Tpo $(DEPDIR)/cdo-Varrms.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Varrms.c' object='cdo-Varrms.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Varrms.obj `if test -f 'Varrms.c'; then $(CYGPATH_W) 'Varrms.c'; else $(CYGPATH_W) '$(srcdir)/Varrms.c'; fi`
+
+cdo-Vertint.o: Vertint.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Vertint.o -MD -MP -MF $(DEPDIR)/cdo-Vertint.Tpo -c -o cdo-Vertint.o `test -f 'Vertint.c' || echo '$(srcdir)/'`Vertint.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Vertint.Tpo $(DEPDIR)/cdo-Vertint.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Vertint.c' object='cdo-Vertint.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Vertint.o `test -f 'Vertint.c' || echo '$(srcdir)/'`Vertint.c
+
+cdo-Vertint.obj: Vertint.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Vertint.obj -MD -MP -MF $(DEPDIR)/cdo-Vertint.Tpo -c -o cdo-Vertint.obj `if test -f 'Vertint.c'; then $(CYGPATH_W) 'Vertint.c'; else $(CYGPATH_W) '$(srcdir)/Vertint.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Vertint.Tpo $(DEPDIR)/cdo-Vertint.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Vertint.c' object='cdo-Vertint.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Vertint.obj `if test -f 'Vertint.c'; then $(CYGPATH_W) 'Vertint.c'; else $(CYGPATH_W) '$(srcdir)/Vertint.c'; fi`
+
+cdo-Vertstat.o: Vertstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Vertstat.o -MD -MP -MF $(DEPDIR)/cdo-Vertstat.Tpo -c -o cdo-Vertstat.o `test -f 'Vertstat.c' || echo '$(srcdir)/'`Vertstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Vertstat.Tpo $(DEPDIR)/cdo-Vertstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Vertstat.c' object='cdo-Vertstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Vertstat.o `test -f 'Vertstat.c' || echo '$(srcdir)/'`Vertstat.c
+
+cdo-Vertstat.obj: Vertstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Vertstat.obj -MD -MP -MF $(DEPDIR)/cdo-Vertstat.Tpo -c -o cdo-Vertstat.obj `if test -f 'Vertstat.c'; then $(CYGPATH_W) 'Vertstat.c'; else $(CYGPATH_W) '$(srcdir)/Vertstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Vertstat.Tpo $(DEPDIR)/cdo-Vertstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Vertstat.c' object='cdo-Vertstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Vertstat.obj `if test -f 'Vertstat.c'; then $(CYGPATH_W) 'Vertstat.c'; else $(CYGPATH_W) '$(srcdir)/Vertstat.c'; fi`
+
+cdo-Vertwind.o: Vertwind.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Vertwind.o -MD -MP -MF $(DEPDIR)/cdo-Vertwind.Tpo -c -o cdo-Vertwind.o `test -f 'Vertwind.c' || echo '$(srcdir)/'`Vertwind.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Vertwind.Tpo $(DEPDIR)/cdo-Vertwind.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Vertwind.c' object='cdo-Vertwind.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Vertwind.o `test -f 'Vertwind.c' || echo '$(srcdir)/'`Vertwind.c
+
+cdo-Vertwind.obj: Vertwind.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Vertwind.obj -MD -MP -MF $(DEPDIR)/cdo-Vertwind.Tpo -c -o cdo-Vertwind.obj `if test -f 'Vertwind.c'; then $(CYGPATH_W) 'Vertwind.c'; else $(CYGPATH_W) '$(srcdir)/Vertwind.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Vertwind.Tpo $(DEPDIR)/cdo-Vertwind.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Vertwind.c' object='cdo-Vertwind.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Vertwind.obj `if test -f 'Vertwind.c'; then $(CYGPATH_W) 'Vertwind.c'; else $(CYGPATH_W) '$(srcdir)/Vertwind.c'; fi`
+
+cdo-Wct.o: Wct.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Wct.o -MD -MP -MF $(DEPDIR)/cdo-Wct.Tpo -c -o cdo-Wct.o `test -f 'Wct.c' || echo '$(srcdir)/'`Wct.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Wct.Tpo $(DEPDIR)/cdo-Wct.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Wct.c' object='cdo-Wct.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Wct.o `test -f 'Wct.c' || echo '$(srcdir)/'`Wct.c
+
+cdo-Wct.obj: Wct.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Wct.obj -MD -MP -MF $(DEPDIR)/cdo-Wct.Tpo -c -o cdo-Wct.obj `if test -f 'Wct.c'; then $(CYGPATH_W) 'Wct.c'; else $(CYGPATH_W) '$(srcdir)/Wct.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Wct.Tpo $(DEPDIR)/cdo-Wct.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Wct.c' object='cdo-Wct.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Wct.obj `if test -f 'Wct.c'; then $(CYGPATH_W) 'Wct.c'; else $(CYGPATH_W) '$(srcdir)/Wct.c'; fi`
+
+cdo-Wind.o: Wind.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Wind.o -MD -MP -MF $(DEPDIR)/cdo-Wind.Tpo -c -o cdo-Wind.o `test -f 'Wind.c' || echo '$(srcdir)/'`Wind.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Wind.Tpo $(DEPDIR)/cdo-Wind.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Wind.c' object='cdo-Wind.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Wind.o `test -f 'Wind.c' || echo '$(srcdir)/'`Wind.c
+
+cdo-Wind.obj: Wind.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Wind.obj -MD -MP -MF $(DEPDIR)/cdo-Wind.Tpo -c -o cdo-Wind.obj `if test -f 'Wind.c'; then $(CYGPATH_W) 'Wind.c'; else $(CYGPATH_W) '$(srcdir)/Wind.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Wind.Tpo $(DEPDIR)/cdo-Wind.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Wind.c' object='cdo-Wind.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Wind.obj `if test -f 'Wind.c'; then $(CYGPATH_W) 'Wind.c'; else $(CYGPATH_W) '$(srcdir)/Wind.c'; fi`
+
+cdo-Writegrid.o: Writegrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Writegrid.o -MD -MP -MF $(DEPDIR)/cdo-Writegrid.Tpo -c -o cdo-Writegrid.o `test -f 'Writegrid.c' || echo '$(srcdir)/'`Writegrid.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Writegrid.Tpo $(DEPDIR)/cdo-Writegrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Writegrid.c' object='cdo-Writegrid.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Writegrid.o `test -f 'Writegrid.c' || echo '$(srcdir)/'`Writegrid.c
+
+cdo-Writegrid.obj: Writegrid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Writegrid.obj -MD -MP -MF $(DEPDIR)/cdo-Writegrid.Tpo -c -o cdo-Writegrid.obj `if test -f 'Writegrid.c'; then $(CYGPATH_W) 'Writegrid.c'; else $(CYGPATH_W) '$(srcdir)/Writegrid.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Writegrid.Tpo $(DEPDIR)/cdo-Writegrid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Writegrid.c' object='cdo-Writegrid.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Writegrid.obj `if test -f 'Writegrid.c'; then $(CYGPATH_W) 'Writegrid.c'; else $(CYGPATH_W) '$(srcdir)/Writegrid.c'; fi`
+
+cdo-Writerandom.o: Writerandom.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Writerandom.o -MD -MP -MF $(DEPDIR)/cdo-Writerandom.Tpo -c -o cdo-Writerandom.o `test -f 'Writerandom.c' || echo '$(srcdir)/'`Writerandom.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Writerandom.Tpo $(DEPDIR)/cdo-Writerandom.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Writerandom.c' object='cdo-Writerandom.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Writerandom.o `test -f 'Writerandom.c' || echo '$(srcdir)/'`Writerandom.c
+
+cdo-Writerandom.obj: Writerandom.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Writerandom.obj -MD -MP -MF $(DEPDIR)/cdo-Writerandom.Tpo -c -o cdo-Writerandom.obj `if test -f 'Writerandom.c'; then $(CYGPATH_W) 'Writerandom.c'; else $(CYGPATH_W) '$(srcdir)/Writerandom.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Writerandom.Tpo $(DEPDIR)/cdo-Writerandom.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Writerandom.c' object='cdo-Writerandom.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Writerandom.obj `if test -f 'Writerandom.c'; then $(CYGPATH_W) 'Writerandom.c'; else $(CYGPATH_W) '$(srcdir)/Writerandom.c'; fi`
+
+cdo-YAR.o: YAR.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-YAR.o -MD -MP -MF $(DEPDIR)/cdo-YAR.Tpo -c -o cdo-YAR.o `test -f 'YAR.c' || echo '$(srcdir)/'`YAR.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-YAR.Tpo $(DEPDIR)/cdo-YAR.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='YAR.c' object='cdo-YAR.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-YAR.o `test -f 'YAR.c' || echo '$(srcdir)/'`YAR.c
+
+cdo-YAR.obj: YAR.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-YAR.obj -MD -MP -MF $(DEPDIR)/cdo-YAR.Tpo -c -o cdo-YAR.obj `if test -f 'YAR.c'; then $(CYGPATH_W) 'YAR.c'; else $(CYGPATH_W) '$(srcdir)/YAR.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-YAR.Tpo $(DEPDIR)/cdo-YAR.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='YAR.c' object='cdo-YAR.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-YAR.obj `if test -f 'YAR.c'; then $(CYGPATH_W) 'YAR.c'; else $(CYGPATH_W) '$(srcdir)/YAR.c'; fi`
+
+cdo-Ydayarith.o: Ydayarith.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ydayarith.o -MD -MP -MF $(DEPDIR)/cdo-Ydayarith.Tpo -c -o cdo-Ydayarith.o `test -f 'Ydayarith.c' || echo '$(srcdir)/'`Ydayarith.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ydayarith.Tpo $(DEPDIR)/cdo-Ydayarith.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ydayarith.c' object='cdo-Ydayarith.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ydayarith.o `test -f 'Ydayarith.c' || echo '$(srcdir)/'`Ydayarith.c
+
+cdo-Ydayarith.obj: Ydayarith.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ydayarith.obj -MD -MP -MF $(DEPDIR)/cdo-Ydayarith.Tpo -c -o cdo-Ydayarith.obj `if test -f 'Ydayarith.c'; then $(CYGPATH_W) 'Ydayarith.c'; else $(CYGPATH_W) '$(srcdir)/Ydayarith.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ydayarith.Tpo $(DEPDIR)/cdo-Ydayarith.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ydayarith.c' object='cdo-Ydayarith.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ydayarith.obj `if test -f 'Ydayarith.c'; then $(CYGPATH_W) 'Ydayarith.c'; else $(CYGPATH_W) '$(srcdir)/Ydayarith.c'; fi`
+
+cdo-Ydaypctl.o: Ydaypctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ydaypctl.o -MD -MP -MF $(DEPDIR)/cdo-Ydaypctl.Tpo -c -o cdo-Ydaypctl.o `test -f 'Ydaypctl.c' || echo '$(srcdir)/'`Ydaypctl.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ydaypctl.Tpo $(DEPDIR)/cdo-Ydaypctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ydaypctl.c' object='cdo-Ydaypctl.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ydaypctl.o `test -f 'Ydaypctl.c' || echo '$(srcdir)/'`Ydaypctl.c
+
+cdo-Ydaypctl.obj: Ydaypctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ydaypctl.obj -MD -MP -MF $(DEPDIR)/cdo-Ydaypctl.Tpo -c -o cdo-Ydaypctl.obj `if test -f 'Ydaypctl.c'; then $(CYGPATH_W) 'Ydaypctl.c'; else $(CYGPATH_W) '$(srcdir)/Ydaypctl.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ydaypctl.Tpo $(DEPDIR)/cdo-Ydaypctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ydaypctl.c' object='cdo-Ydaypctl.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ydaypctl.obj `if test -f 'Ydaypctl.c'; then $(CYGPATH_W) 'Ydaypctl.c'; else $(CYGPATH_W) '$(srcdir)/Ydaypctl.c'; fi`
+
+cdo-Ydaystat.o: Ydaystat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ydaystat.o -MD -MP -MF $(DEPDIR)/cdo-Ydaystat.Tpo -c -o cdo-Ydaystat.o `test -f 'Ydaystat.c' || echo '$(srcdir)/'`Ydaystat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ydaystat.Tpo $(DEPDIR)/cdo-Ydaystat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ydaystat.c' object='cdo-Ydaystat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ydaystat.o `test -f 'Ydaystat.c' || echo '$(srcdir)/'`Ydaystat.c
+
+cdo-Ydaystat.obj: Ydaystat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ydaystat.obj -MD -MP -MF $(DEPDIR)/cdo-Ydaystat.Tpo -c -o cdo-Ydaystat.obj `if test -f 'Ydaystat.c'; then $(CYGPATH_W) 'Ydaystat.c'; else $(CYGPATH_W) '$(srcdir)/Ydaystat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ydaystat.Tpo $(DEPDIR)/cdo-Ydaystat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ydaystat.c' object='cdo-Ydaystat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ydaystat.obj `if test -f 'Ydaystat.c'; then $(CYGPATH_W) 'Ydaystat.c'; else $(CYGPATH_W) '$(srcdir)/Ydaystat.c'; fi`
+
+cdo-Ydrunpctl.o: Ydrunpctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ydrunpctl.o -MD -MP -MF $(DEPDIR)/cdo-Ydrunpctl.Tpo -c -o cdo-Ydrunpctl.o `test -f 'Ydrunpctl.c' || echo '$(srcdir)/'`Ydrunpctl.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ydrunpctl.Tpo $(DEPDIR)/cdo-Ydrunpctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ydrunpctl.c' object='cdo-Ydrunpctl.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ydrunpctl.o `test -f 'Ydrunpctl.c' || echo '$(srcdir)/'`Ydrunpctl.c
+
+cdo-Ydrunpctl.obj: Ydrunpctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ydrunpctl.obj -MD -MP -MF $(DEPDIR)/cdo-Ydrunpctl.Tpo -c -o cdo-Ydrunpctl.obj `if test -f 'Ydrunpctl.c'; then $(CYGPATH_W) 'Ydrunpctl.c'; else $(CYGPATH_W) '$(srcdir)/Ydrunpctl.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ydrunpctl.Tpo $(DEPDIR)/cdo-Ydrunpctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ydrunpctl.c' object='cdo-Ydrunpctl.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ydrunpctl.obj `if test -f 'Ydrunpctl.c'; then $(CYGPATH_W) 'Ydrunpctl.c'; else $(CYGPATH_W) '$(srcdir)/Ydrunpctl.c'; fi`
+
+cdo-Ydrunstat.o: Ydrunstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ydrunstat.o -MD -MP -MF $(DEPDIR)/cdo-Ydrunstat.Tpo -c -o cdo-Ydrunstat.o `test -f 'Ydrunstat.c' || echo '$(srcdir)/'`Ydrunstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ydrunstat.Tpo $(DEPDIR)/cdo-Ydrunstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ydrunstat.c' object='cdo-Ydrunstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ydrunstat.o `test -f 'Ydrunstat.c' || echo '$(srcdir)/'`Ydrunstat.c
+
+cdo-Ydrunstat.obj: Ydrunstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ydrunstat.obj -MD -MP -MF $(DEPDIR)/cdo-Ydrunstat.Tpo -c -o cdo-Ydrunstat.obj `if test -f 'Ydrunstat.c'; then $(CYGPATH_W) 'Ydrunstat.c'; else $(CYGPATH_W) '$(srcdir)/Ydrunstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ydrunstat.Tpo $(DEPDIR)/cdo-Ydrunstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ydrunstat.c' object='cdo-Ydrunstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ydrunstat.obj `if test -f 'Ydrunstat.c'; then $(CYGPATH_W) 'Ydrunstat.c'; else $(CYGPATH_W) '$(srcdir)/Ydrunstat.c'; fi`
+
+cdo-Yhourarith.o: Yhourarith.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Yhourarith.o -MD -MP -MF $(DEPDIR)/cdo-Yhourarith.Tpo -c -o cdo-Yhourarith.o `test -f 'Yhourarith.c' || echo '$(srcdir)/'`Yhourarith.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Yhourarith.Tpo $(DEPDIR)/cdo-Yhourarith.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Yhourarith.c' object='cdo-Yhourarith.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Yhourarith.o `test -f 'Yhourarith.c' || echo '$(srcdir)/'`Yhourarith.c
+
+cdo-Yhourarith.obj: Yhourarith.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Yhourarith.obj -MD -MP -MF $(DEPDIR)/cdo-Yhourarith.Tpo -c -o cdo-Yhourarith.obj `if test -f 'Yhourarith.c'; then $(CYGPATH_W) 'Yhourarith.c'; else $(CYGPATH_W) '$(srcdir)/Yhourarith.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Yhourarith.Tpo $(DEPDIR)/cdo-Yhourarith.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Yhourarith.c' object='cdo-Yhourarith.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Yhourarith.obj `if test -f 'Yhourarith.c'; then $(CYGPATH_W) 'Yhourarith.c'; else $(CYGPATH_W) '$(srcdir)/Yhourarith.c'; fi`
+
+cdo-Yhourstat.o: Yhourstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Yhourstat.o -MD -MP -MF $(DEPDIR)/cdo-Yhourstat.Tpo -c -o cdo-Yhourstat.o `test -f 'Yhourstat.c' || echo '$(srcdir)/'`Yhourstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Yhourstat.Tpo $(DEPDIR)/cdo-Yhourstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Yhourstat.c' object='cdo-Yhourstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Yhourstat.o `test -f 'Yhourstat.c' || echo '$(srcdir)/'`Yhourstat.c
+
+cdo-Yhourstat.obj: Yhourstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Yhourstat.obj -MD -MP -MF $(DEPDIR)/cdo-Yhourstat.Tpo -c -o cdo-Yhourstat.obj `if test -f 'Yhourstat.c'; then $(CYGPATH_W) 'Yhourstat.c'; else $(CYGPATH_W) '$(srcdir)/Yhourstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Yhourstat.Tpo $(DEPDIR)/cdo-Yhourstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Yhourstat.c' object='cdo-Yhourstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Yhourstat.obj `if test -f 'Yhourstat.c'; then $(CYGPATH_W) 'Yhourstat.c'; else $(CYGPATH_W) '$(srcdir)/Yhourstat.c'; fi`
+
+cdo-Ymonarith.o: Ymonarith.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ymonarith.o -MD -MP -MF $(DEPDIR)/cdo-Ymonarith.Tpo -c -o cdo-Ymonarith.o `test -f 'Ymonarith.c' || echo '$(srcdir)/'`Ymonarith.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ymonarith.Tpo $(DEPDIR)/cdo-Ymonarith.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ymonarith.c' object='cdo-Ymonarith.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ymonarith.o `test -f 'Ymonarith.c' || echo '$(srcdir)/'`Ymonarith.c
+
+cdo-Ymonarith.obj: Ymonarith.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ymonarith.obj -MD -MP -MF $(DEPDIR)/cdo-Ymonarith.Tpo -c -o cdo-Ymonarith.obj `if test -f 'Ymonarith.c'; then $(CYGPATH_W) 'Ymonarith.c'; else $(CYGPATH_W) '$(srcdir)/Ymonarith.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ymonarith.Tpo $(DEPDIR)/cdo-Ymonarith.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ymonarith.c' object='cdo-Ymonarith.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ymonarith.obj `if test -f 'Ymonarith.c'; then $(CYGPATH_W) 'Ymonarith.c'; else $(CYGPATH_W) '$(srcdir)/Ymonarith.c'; fi`
+
+cdo-Ymonpctl.o: Ymonpctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ymonpctl.o -MD -MP -MF $(DEPDIR)/cdo-Ymonpctl.Tpo -c -o cdo-Ymonpctl.o `test -f 'Ymonpctl.c' || echo '$(srcdir)/'`Ymonpctl.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ymonpctl.Tpo $(DEPDIR)/cdo-Ymonpctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ymonpctl.c' object='cdo-Ymonpctl.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ymonpctl.o `test -f 'Ymonpctl.c' || echo '$(srcdir)/'`Ymonpctl.c
+
+cdo-Ymonpctl.obj: Ymonpctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ymonpctl.obj -MD -MP -MF $(DEPDIR)/cdo-Ymonpctl.Tpo -c -o cdo-Ymonpctl.obj `if test -f 'Ymonpctl.c'; then $(CYGPATH_W) 'Ymonpctl.c'; else $(CYGPATH_W) '$(srcdir)/Ymonpctl.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ymonpctl.Tpo $(DEPDIR)/cdo-Ymonpctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ymonpctl.c' object='cdo-Ymonpctl.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ymonpctl.obj `if test -f 'Ymonpctl.c'; then $(CYGPATH_W) 'Ymonpctl.c'; else $(CYGPATH_W) '$(srcdir)/Ymonpctl.c'; fi`
+
+cdo-Ymonstat.o: Ymonstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ymonstat.o -MD -MP -MF $(DEPDIR)/cdo-Ymonstat.Tpo -c -o cdo-Ymonstat.o `test -f 'Ymonstat.c' || echo '$(srcdir)/'`Ymonstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ymonstat.Tpo $(DEPDIR)/cdo-Ymonstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ymonstat.c' object='cdo-Ymonstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ymonstat.o `test -f 'Ymonstat.c' || echo '$(srcdir)/'`Ymonstat.c
+
+cdo-Ymonstat.obj: Ymonstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Ymonstat.obj -MD -MP -MF $(DEPDIR)/cdo-Ymonstat.Tpo -c -o cdo-Ymonstat.obj `if test -f 'Ymonstat.c'; then $(CYGPATH_W) 'Ymonstat.c'; else $(CYGPATH_W) '$(srcdir)/Ymonstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Ymonstat.Tpo $(DEPDIR)/cdo-Ymonstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Ymonstat.c' object='cdo-Ymonstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Ymonstat.obj `if test -f 'Ymonstat.c'; then $(CYGPATH_W) 'Ymonstat.c'; else $(CYGPATH_W) '$(srcdir)/Ymonstat.c'; fi`
+
+cdo-Yseaspctl.o: Yseaspctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Yseaspctl.o -MD -MP -MF $(DEPDIR)/cdo-Yseaspctl.Tpo -c -o cdo-Yseaspctl.o `test -f 'Yseaspctl.c' || echo '$(srcdir)/'`Yseaspctl.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Yseaspctl.Tpo $(DEPDIR)/cdo-Yseaspctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Yseaspctl.c' object='cdo-Yseaspctl.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Yseaspctl.o `test -f 'Yseaspctl.c' || echo '$(srcdir)/'`Yseaspctl.c
+
+cdo-Yseaspctl.obj: Yseaspctl.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Yseaspctl.obj -MD -MP -MF $(DEPDIR)/cdo-Yseaspctl.Tpo -c -o cdo-Yseaspctl.obj `if test -f 'Yseaspctl.c'; then $(CYGPATH_W) 'Yseaspctl.c'; else $(CYGPATH_W) '$(srcdir)/Yseaspctl.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Yseaspctl.Tpo $(DEPDIR)/cdo-Yseaspctl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Yseaspctl.c' object='cdo-Yseaspctl.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Yseaspctl.obj `if test -f 'Yseaspctl.c'; then $(CYGPATH_W) 'Yseaspctl.c'; else $(CYGPATH_W) '$(srcdir)/Yseaspctl.c'; fi`
+
+cdo-Yseasstat.o: Yseasstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Yseasstat.o -MD -MP -MF $(DEPDIR)/cdo-Yseasstat.Tpo -c -o cdo-Yseasstat.o `test -f 'Yseasstat.c' || echo '$(srcdir)/'`Yseasstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Yseasstat.Tpo $(DEPDIR)/cdo-Yseasstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Yseasstat.c' object='cdo-Yseasstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Yseasstat.o `test -f 'Yseasstat.c' || echo '$(srcdir)/'`Yseasstat.c
+
+cdo-Yseasstat.obj: Yseasstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Yseasstat.obj -MD -MP -MF $(DEPDIR)/cdo-Yseasstat.Tpo -c -o cdo-Yseasstat.obj `if test -f 'Yseasstat.c'; then $(CYGPATH_W) 'Yseasstat.c'; else $(CYGPATH_W) '$(srcdir)/Yseasstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Yseasstat.Tpo $(DEPDIR)/cdo-Yseasstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Yseasstat.c' object='cdo-Yseasstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Yseasstat.obj `if test -f 'Yseasstat.c'; then $(CYGPATH_W) 'Yseasstat.c'; else $(CYGPATH_W) '$(srcdir)/Yseasstat.c'; fi`
+
+cdo-Zonstat.o: Zonstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Zonstat.o -MD -MP -MF $(DEPDIR)/cdo-Zonstat.Tpo -c -o cdo-Zonstat.o `test -f 'Zonstat.c' || echo '$(srcdir)/'`Zonstat.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Zonstat.Tpo $(DEPDIR)/cdo-Zonstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Zonstat.c' object='cdo-Zonstat.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Zonstat.o `test -f 'Zonstat.c' || echo '$(srcdir)/'`Zonstat.c
+
+cdo-Zonstat.obj: Zonstat.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Zonstat.obj -MD -MP -MF $(DEPDIR)/cdo-Zonstat.Tpo -c -o cdo-Zonstat.obj `if test -f 'Zonstat.c'; then $(CYGPATH_W) 'Zonstat.c'; else $(CYGPATH_W) '$(srcdir)/Zonstat.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Zonstat.Tpo $(DEPDIR)/cdo-Zonstat.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Zonstat.c' object='cdo-Zonstat.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Zonstat.obj `if test -f 'Zonstat.c'; then $(CYGPATH_W) 'Zonstat.c'; else $(CYGPATH_W) '$(srcdir)/Zonstat.c'; fi`
+
+cdo-cdo_pthread.o: cdo_pthread.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-cdo_pthread.o -MD -MP -MF $(DEPDIR)/cdo-cdo_pthread.Tpo -c -o cdo-cdo_pthread.o `test -f 'cdo_pthread.c' || echo '$(srcdir)/'`cdo_pthread.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-cdo_pthread.Tpo $(DEPDIR)/cdo-cdo_pthread.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cdo_pthread.c' object='cdo-cdo_pthread.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-cdo_pthread.o `test -f 'cdo_pthread.c' || echo '$(srcdir)/'`cdo_pthread.c
+
+cdo-cdo_pthread.obj: cdo_pthread.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-cdo_pthread.obj -MD -MP -MF $(DEPDIR)/cdo-cdo_pthread.Tpo -c -o cdo-cdo_pthread.obj `if test -f 'cdo_pthread.c'; then $(CYGPATH_W) 'cdo_pthread.c'; else $(CYGPATH_W) '$(srcdir)/cdo_pthread.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-cdo_pthread.Tpo $(DEPDIR)/cdo-cdo_pthread.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cdo_pthread.c' object='cdo-cdo_pthread.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-cdo_pthread.obj `if test -f 'cdo_pthread.c'; then $(CYGPATH_W) 'cdo_pthread.c'; else $(CYGPATH_W) '$(srcdir)/cdo_pthread.c'; fi`
+
+cdo-cdo_vlist.o: cdo_vlist.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-cdo_vlist.o -MD -MP -MF $(DEPDIR)/cdo-cdo_vlist.Tpo -c -o cdo-cdo_vlist.o `test -f 'cdo_vlist.c' || echo '$(srcdir)/'`cdo_vlist.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-cdo_vlist.Tpo $(DEPDIR)/cdo-cdo_vlist.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cdo_vlist.c' object='cdo-cdo_vlist.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-cdo_vlist.o `test -f 'cdo_vlist.c' || echo '$(srcdir)/'`cdo_vlist.c
+
+cdo-cdo_vlist.obj: cdo_vlist.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-cdo_vlist.obj -MD -MP -MF $(DEPDIR)/cdo-cdo_vlist.Tpo -c -o cdo-cdo_vlist.obj `if test -f 'cdo_vlist.c'; then $(CYGPATH_W) 'cdo_vlist.c'; else $(CYGPATH_W) '$(srcdir)/cdo_vlist.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-cdo_vlist.Tpo $(DEPDIR)/cdo-cdo_vlist.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cdo_vlist.c' object='cdo-cdo_vlist.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-cdo_vlist.obj `if test -f 'cdo_vlist.c'; then $(CYGPATH_W) 'cdo_vlist.c'; else $(CYGPATH_W) '$(srcdir)/cdo_vlist.c'; fi`
+
+cdo-color.o: color.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-color.o -MD -MP -MF $(DEPDIR)/cdo-color.Tpo -c -o cdo-color.o `test -f 'color.c' || echo '$(srcdir)/'`color.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-color.Tpo $(DEPDIR)/cdo-color.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='color.c' object='cdo-color.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-color.o `test -f 'color.c' || echo '$(srcdir)/'`color.c
+
+cdo-color.obj: color.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-color.obj -MD -MP -MF $(DEPDIR)/cdo-color.Tpo -c -o cdo-color.obj `if test -f 'color.c'; then $(CYGPATH_W) 'color.c'; else $(CYGPATH_W) '$(srcdir)/color.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-color.Tpo $(DEPDIR)/cdo-color.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='color.c' object='cdo-color.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-color.obj `if test -f 'color.c'; then $(CYGPATH_W) 'color.c'; else $(CYGPATH_W) '$(srcdir)/color.c'; fi`
+
+cdo-commandline.o: commandline.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-commandline.o -MD -MP -MF $(DEPDIR)/cdo-commandline.Tpo -c -o cdo-commandline.o `test -f 'commandline.c' || echo '$(srcdir)/'`commandline.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-commandline.Tpo $(DEPDIR)/cdo-commandline.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='commandline.c' object='cdo-commandline.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-commandline.o `test -f 'commandline.c' || echo '$(srcdir)/'`commandline.c
+
+cdo-commandline.obj: commandline.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-commandline.obj -MD -MP -MF $(DEPDIR)/cdo-commandline.Tpo -c -o cdo-commandline.obj `if test -f 'commandline.c'; then $(CYGPATH_W) 'commandline.c'; else $(CYGPATH_W) '$(srcdir)/commandline.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-commandline.Tpo $(DEPDIR)/cdo-commandline.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='commandline.c' object='cdo-commandline.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-commandline.obj `if test -f 'commandline.c'; then $(CYGPATH_W) 'commandline.c'; else $(CYGPATH_W) '$(srcdir)/commandline.c'; fi`
+
+cdo-ecacore.o: ecacore.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-ecacore.o -MD -MP -MF $(DEPDIR)/cdo-ecacore.Tpo -c -o cdo-ecacore.o `test -f 'ecacore.c' || echo '$(srcdir)/'`ecacore.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-ecacore.Tpo $(DEPDIR)/cdo-ecacore.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ecacore.c' object='cdo-ecacore.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-ecacore.o `test -f 'ecacore.c' || echo '$(srcdir)/'`ecacore.c
+
+cdo-ecacore.obj: ecacore.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-ecacore.obj -MD -MP -MF $(DEPDIR)/cdo-ecacore.Tpo -c -o cdo-ecacore.obj `if test -f 'ecacore.c'; then $(CYGPATH_W) 'ecacore.c'; else $(CYGPATH_W) '$(srcdir)/ecacore.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-ecacore.Tpo $(DEPDIR)/cdo-ecacore.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ecacore.c' object='cdo-ecacore.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-ecacore.obj `if test -f 'ecacore.c'; then $(CYGPATH_W) 'ecacore.c'; else $(CYGPATH_W) '$(srcdir)/ecacore.c'; fi`
+
+cdo-ecautil.o: ecautil.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-ecautil.o -MD -MP -MF $(DEPDIR)/cdo-ecautil.Tpo -c -o cdo-ecautil.o `test -f 'ecautil.c' || echo '$(srcdir)/'`ecautil.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-ecautil.Tpo $(DEPDIR)/cdo-ecautil.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ecautil.c' object='cdo-ecautil.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-ecautil.o `test -f 'ecautil.c' || echo '$(srcdir)/'`ecautil.c
+
+cdo-ecautil.obj: ecautil.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-ecautil.obj -MD -MP -MF $(DEPDIR)/cdo-ecautil.Tpo -c -o cdo-ecautil.obj `if test -f 'ecautil.c'; then $(CYGPATH_W) 'ecautil.c'; else $(CYGPATH_W) '$(srcdir)/ecautil.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-ecautil.Tpo $(DEPDIR)/cdo-ecautil.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='ecautil.c' object='cdo-ecautil.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-ecautil.obj `if test -f 'ecautil.c'; then $(CYGPATH_W) 'ecautil.c'; else $(CYGPATH_W) '$(srcdir)/ecautil.c'; fi`
+
+cdo-exception.o: exception.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-exception.o -MD -MP -MF $(DEPDIR)/cdo-exception.Tpo -c -o cdo-exception.o `test -f 'exception.c' || echo '$(srcdir)/'`exception.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-exception.Tpo $(DEPDIR)/cdo-exception.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='exception.c' object='cdo-exception.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-exception.o `test -f 'exception.c' || echo '$(srcdir)/'`exception.c
+
+cdo-exception.obj: exception.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-exception.obj -MD -MP -MF $(DEPDIR)/cdo-exception.Tpo -c -o cdo-exception.obj `if test -f 'exception.c'; then $(CYGPATH_W) 'exception.c'; else $(CYGPATH_W) '$(srcdir)/exception.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-exception.Tpo $(DEPDIR)/cdo-exception.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='exception.c' object='cdo-exception.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-exception.obj `if test -f 'exception.c'; then $(CYGPATH_W) 'exception.c'; else $(CYGPATH_W) '$(srcdir)/exception.c'; fi`
+
+cdo-expr.o: expr.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-expr.o -MD -MP -MF $(DEPDIR)/cdo-expr.Tpo -c -o cdo-expr.o `test -f 'expr.c' || echo '$(srcdir)/'`expr.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-expr.Tpo $(DEPDIR)/cdo-expr.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='expr.c' object='cdo-expr.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-expr.o `test -f 'expr.c' || echo '$(srcdir)/'`expr.c
+
+cdo-expr.obj: expr.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-expr.obj -MD -MP -MF $(DEPDIR)/cdo-expr.Tpo -c -o cdo-expr.obj `if test -f 'expr.c'; then $(CYGPATH_W) 'expr.c'; else $(CYGPATH_W) '$(srcdir)/expr.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-expr.Tpo $(DEPDIR)/cdo-expr.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='expr.c' object='cdo-expr.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-expr.obj `if test -f 'expr.c'; then $(CYGPATH_W) 'expr.c'; else $(CYGPATH_W) '$(srcdir)/expr.c'; fi`
+
+cdo-expr_lex.o: expr_lex.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-expr_lex.o -MD -MP -MF $(DEPDIR)/cdo-expr_lex.Tpo -c -o cdo-expr_lex.o `test -f 'expr_lex.c' || echo '$(srcdir)/'`expr_lex.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-expr_lex.Tpo $(DEPDIR)/cdo-expr_lex.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='expr_lex.c' object='cdo-expr_lex.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-expr_lex.o `test -f 'expr_lex.c' || echo '$(srcdir)/'`expr_lex.c
+
+cdo-expr_lex.obj: expr_lex.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-expr_lex.obj -MD -MP -MF $(DEPDIR)/cdo-expr_lex.Tpo -c -o cdo-expr_lex.obj `if test -f 'expr_lex.c'; then $(CYGPATH_W) 'expr_lex.c'; else $(CYGPATH_W) '$(srcdir)/expr_lex.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-expr_lex.Tpo $(DEPDIR)/cdo-expr_lex.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='expr_lex.c' object='cdo-expr_lex.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-expr_lex.obj `if test -f 'expr_lex.c'; then $(CYGPATH_W) 'expr_lex.c'; else $(CYGPATH_W) '$(srcdir)/expr_lex.c'; fi`
+
+cdo-expr_yacc.o: expr_yacc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-expr_yacc.o -MD -MP -MF $(DEPDIR)/cdo-expr_yacc.Tpo -c -o cdo-expr_yacc.o `test -f 'expr_yacc.c' || echo '$(srcdir)/'`expr_yacc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-expr_yacc.Tpo $(DEPDIR)/cdo-expr_yacc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='expr_yacc.c' object='cdo-expr_yacc.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-expr_yacc.o `test -f 'expr_yacc.c' || echo '$(srcdir)/'`expr_yacc.c
+
+cdo-expr_yacc.obj: expr_yacc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-expr_yacc.obj -MD -MP -MF $(DEPDIR)/cdo-expr_yacc.Tpo -c -o cdo-expr_yacc.obj `if test -f 'expr_yacc.c'; then $(CYGPATH_W) 'expr_yacc.c'; else $(CYGPATH_W) '$(srcdir)/expr_yacc.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-expr_yacc.Tpo $(DEPDIR)/cdo-expr_yacc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='expr_yacc.c' object='cdo-expr_yacc.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-expr_yacc.obj `if test -f 'expr_yacc.c'; then $(CYGPATH_W) 'expr_yacc.c'; else $(CYGPATH_W) '$(srcdir)/expr_yacc.c'; fi`
+
+cdo-field.o: field.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-field.o -MD -MP -MF $(DEPDIR)/cdo-field.Tpo -c -o cdo-field.o `test -f 'field.c' || echo '$(srcdir)/'`field.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-field.Tpo $(DEPDIR)/cdo-field.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='field.c' object='cdo-field.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-field.o `test -f 'field.c' || echo '$(srcdir)/'`field.c
+
+cdo-field.obj: field.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-field.obj -MD -MP -MF $(DEPDIR)/cdo-field.Tpo -c -o cdo-field.obj `if test -f 'field.c'; then $(CYGPATH_W) 'field.c'; else $(CYGPATH_W) '$(srcdir)/field.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-field.Tpo $(DEPDIR)/cdo-field.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='field.c' object='cdo-field.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-field.obj `if test -f 'field.c'; then $(CYGPATH_W) 'field.c'; else $(CYGPATH_W) '$(srcdir)/field.c'; fi`
+
+cdo-field2.o: field2.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-field2.o -MD -MP -MF $(DEPDIR)/cdo-field2.Tpo -c -o cdo-field2.o `test -f 'field2.c' || echo '$(srcdir)/'`field2.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-field2.Tpo $(DEPDIR)/cdo-field2.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='field2.c' object='cdo-field2.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-field2.o `test -f 'field2.c' || echo '$(srcdir)/'`field2.c
+
+cdo-field2.obj: field2.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-field2.obj -MD -MP -MF $(DEPDIR)/cdo-field2.Tpo -c -o cdo-field2.obj `if test -f 'field2.c'; then $(CYGPATH_W) 'field2.c'; else $(CYGPATH_W) '$(srcdir)/field2.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-field2.Tpo $(DEPDIR)/cdo-field2.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='field2.c' object='cdo-field2.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-field2.obj `if test -f 'field2.c'; then $(CYGPATH_W) 'field2.c'; else $(CYGPATH_W) '$(srcdir)/field2.c'; fi`
+
+cdo-fieldc.o: fieldc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-fieldc.o -MD -MP -MF $(DEPDIR)/cdo-fieldc.Tpo -c -o cdo-fieldc.o `test -f 'fieldc.c' || echo '$(srcdir)/'`fieldc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-fieldc.Tpo $(DEPDIR)/cdo-fieldc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fieldc.c' object='cdo-fieldc.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-fieldc.o `test -f 'fieldc.c' || echo '$(srcdir)/'`fieldc.c
+
+cdo-fieldc.obj: fieldc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-fieldc.obj -MD -MP -MF $(DEPDIR)/cdo-fieldc.Tpo -c -o cdo-fieldc.obj `if test -f 'fieldc.c'; then $(CYGPATH_W) 'fieldc.c'; else $(CYGPATH_W) '$(srcdir)/fieldc.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-fieldc.Tpo $(DEPDIR)/cdo-fieldc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fieldc.c' object='cdo-fieldc.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-fieldc.obj `if test -f 'fieldc.c'; then $(CYGPATH_W) 'fieldc.c'; else $(CYGPATH_W) '$(srcdir)/fieldc.c'; fi`
+
+cdo-fieldmem.o: fieldmem.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-fieldmem.o -MD -MP -MF $(DEPDIR)/cdo-fieldmem.Tpo -c -o cdo-fieldmem.o `test -f 'fieldmem.c' || echo '$(srcdir)/'`fieldmem.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-fieldmem.Tpo $(DEPDIR)/cdo-fieldmem.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fieldmem.c' object='cdo-fieldmem.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-fieldmem.o `test -f 'fieldmem.c' || echo '$(srcdir)/'`fieldmem.c
+
+cdo-fieldmem.obj: fieldmem.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-fieldmem.obj -MD -MP -MF $(DEPDIR)/cdo-fieldmem.Tpo -c -o cdo-fieldmem.obj `if test -f 'fieldmem.c'; then $(CYGPATH_W) 'fieldmem.c'; else $(CYGPATH_W) '$(srcdir)/fieldmem.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-fieldmem.Tpo $(DEPDIR)/cdo-fieldmem.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fieldmem.c' object='cdo-fieldmem.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-fieldmem.obj `if test -f 'fieldmem.c'; then $(CYGPATH_W) 'fieldmem.c'; else $(CYGPATH_W) '$(srcdir)/fieldmem.c'; fi`
+
+cdo-fieldmer.o: fieldmer.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-fieldmer.o -MD -MP -MF $(DEPDIR)/cdo-fieldmer.Tpo -c -o cdo-fieldmer.o `test -f 'fieldmer.c' || echo '$(srcdir)/'`fieldmer.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-fieldmer.Tpo $(DEPDIR)/cdo-fieldmer.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fieldmer.c' object='cdo-fieldmer.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-fieldmer.o `test -f 'fieldmer.c' || echo '$(srcdir)/'`fieldmer.c
+
+cdo-fieldmer.obj: fieldmer.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-fieldmer.obj -MD -MP -MF $(DEPDIR)/cdo-fieldmer.Tpo -c -o cdo-fieldmer.obj `if test -f 'fieldmer.c'; then $(CYGPATH_W) 'fieldmer.c'; else $(CYGPATH_W) '$(srcdir)/fieldmer.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-fieldmer.Tpo $(DEPDIR)/cdo-fieldmer.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fieldmer.c' object='cdo-fieldmer.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-fieldmer.obj `if test -f 'fieldmer.c'; then $(CYGPATH_W) 'fieldmer.c'; else $(CYGPATH_W) '$(srcdir)/fieldmer.c'; fi`
+
+cdo-fieldzon.o: fieldzon.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-fieldzon.o -MD -MP -MF $(DEPDIR)/cdo-fieldzon.Tpo -c -o cdo-fieldzon.o `test -f 'fieldzon.c' || echo '$(srcdir)/'`fieldzon.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-fieldzon.Tpo $(DEPDIR)/cdo-fieldzon.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fieldzon.c' object='cdo-fieldzon.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-fieldzon.o `test -f 'fieldzon.c' || echo '$(srcdir)/'`fieldzon.c
+
+cdo-fieldzon.obj: fieldzon.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-fieldzon.obj -MD -MP -MF $(DEPDIR)/cdo-fieldzon.Tpo -c -o cdo-fieldzon.obj `if test -f 'fieldzon.c'; then $(CYGPATH_W) 'fieldzon.c'; else $(CYGPATH_W) '$(srcdir)/fieldzon.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-fieldzon.Tpo $(DEPDIR)/cdo-fieldzon.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fieldzon.c' object='cdo-fieldzon.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-fieldzon.obj `if test -f 'fieldzon.c'; then $(CYGPATH_W) 'fieldzon.c'; else $(CYGPATH_W) '$(srcdir)/fieldzon.c'; fi`
+
+cdo-fouriertrans.o: fouriertrans.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-fouriertrans.o -MD -MP -MF $(DEPDIR)/cdo-fouriertrans.Tpo -c -o cdo-fouriertrans.o `test -f 'fouriertrans.c' || echo '$(srcdir)/'`fouriertrans.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-fouriertrans.Tpo $(DEPDIR)/cdo-fouriertrans.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fouriertrans.c' object='cdo-fouriertrans.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-fouriertrans.o `test -f 'fouriertrans.c' || echo '$(srcdir)/'`fouriertrans.c
+
+cdo-fouriertrans.obj: fouriertrans.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-fouriertrans.obj -MD -MP -MF $(DEPDIR)/cdo-fouriertrans.Tpo -c -o cdo-fouriertrans.obj `if test -f 'fouriertrans.c'; then $(CYGPATH_W) 'fouriertrans.c'; else $(CYGPATH_W) '$(srcdir)/fouriertrans.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-fouriertrans.Tpo $(DEPDIR)/cdo-fouriertrans.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='fouriertrans.c' object='cdo-fouriertrans.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-fouriertrans.obj `if test -f 'fouriertrans.c'; then $(CYGPATH_W) 'fouriertrans.c'; else $(CYGPATH_W) '$(srcdir)/fouriertrans.c'; fi`
+
+cdo-gradsdeslib.o: gradsdeslib.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-gradsdeslib.o -MD -MP -MF $(DEPDIR)/cdo-gradsdeslib.Tpo -c -o cdo-gradsdeslib.o `test -f 'gradsdeslib.c' || echo '$(srcdir)/'`gradsdeslib.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-gradsdeslib.Tpo $(DEPDIR)/cdo-gradsdeslib.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='gradsdeslib.c' object='cdo-gradsdeslib.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-gradsdeslib.o `test -f 'gradsdeslib.c' || echo '$(srcdir)/'`gradsdeslib.c
+
+cdo-gradsdeslib.obj: gradsdeslib.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-gradsdeslib.obj -MD -MP -MF $(DEPDIR)/cdo-gradsdeslib.Tpo -c -o cdo-gradsdeslib.obj `if test -f 'gradsdeslib.c'; then $(CYGPATH_W) 'gradsdeslib.c'; else $(CYGPATH_W) '$(srcdir)/gradsdeslib.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-gradsdeslib.Tpo $(DEPDIR)/cdo-gradsdeslib.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='gradsdeslib.c' object='cdo-gradsdeslib.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-gradsdeslib.obj `if test -f 'gradsdeslib.c'; then $(CYGPATH_W) 'gradsdeslib.c'; else $(CYGPATH_W) '$(srcdir)/gradsdeslib.c'; fi`
+
+cdo-grid.o: grid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-grid.o -MD -MP -MF $(DEPDIR)/cdo-grid.Tpo -c -o cdo-grid.o `test -f 'grid.c' || echo '$(srcdir)/'`grid.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-grid.Tpo $(DEPDIR)/cdo-grid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='grid.c' object='cdo-grid.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-grid.o `test -f 'grid.c' || echo '$(srcdir)/'`grid.c
+
+cdo-grid.obj: grid.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-grid.obj -MD -MP -MF $(DEPDIR)/cdo-grid.Tpo -c -o cdo-grid.obj `if test -f 'grid.c'; then $(CYGPATH_W) 'grid.c'; else $(CYGPATH_W) '$(srcdir)/grid.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-grid.Tpo $(DEPDIR)/cdo-grid.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='grid.c' object='cdo-grid.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-grid.obj `if test -f 'grid.c'; then $(CYGPATH_W) 'grid.c'; else $(CYGPATH_W) '$(srcdir)/grid.c'; fi`
+
+cdo-grid_gme.o: grid_gme.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-grid_gme.o -MD -MP -MF $(DEPDIR)/cdo-grid_gme.Tpo -c -o cdo-grid_gme.o `test -f 'grid_gme.c' || echo '$(srcdir)/'`grid_gme.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-grid_gme.Tpo $(DEPDIR)/cdo-grid_gme.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='grid_gme.c' object='cdo-grid_gme.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-grid_gme.o `test -f 'grid_gme.c' || echo '$(srcdir)/'`grid_gme.c
+
+cdo-grid_gme.obj: grid_gme.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-grid_gme.obj -MD -MP -MF $(DEPDIR)/cdo-grid_gme.Tpo -c -o cdo-grid_gme.obj `if test -f 'grid_gme.c'; then $(CYGPATH_W) 'grid_gme.c'; else $(CYGPATH_W) '$(srcdir)/grid_gme.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-grid_gme.Tpo $(DEPDIR)/cdo-grid_gme.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='grid_gme.c' object='cdo-grid_gme.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-grid_gme.obj `if test -f 'grid_gme.c'; then $(CYGPATH_W) 'grid_gme.c'; else $(CYGPATH_W) '$(srcdir)/grid_gme.c'; fi`
+
+cdo-grid_lcc.o: grid_lcc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-grid_lcc.o -MD -MP -MF $(DEPDIR)/cdo-grid_lcc.Tpo -c -o cdo-grid_lcc.o `test -f 'grid_lcc.c' || echo '$(srcdir)/'`grid_lcc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-grid_lcc.Tpo $(DEPDIR)/cdo-grid_lcc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='grid_lcc.c' object='cdo-grid_lcc.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-grid_lcc.o `test -f 'grid_lcc.c' || echo '$(srcdir)/'`grid_lcc.c
+
+cdo-grid_lcc.obj: grid_lcc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-grid_lcc.obj -MD -MP -MF $(DEPDIR)/cdo-grid_lcc.Tpo -c -o cdo-grid_lcc.obj `if test -f 'grid_lcc.c'; then $(CYGPATH_W) 'grid_lcc.c'; else $(CYGPATH_W) '$(srcdir)/grid_lcc.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-grid_lcc.Tpo $(DEPDIR)/cdo-grid_lcc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='grid_lcc.c' object='cdo-grid_lcc.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-grid_lcc.obj `if test -f 'grid_lcc.c'; then $(CYGPATH_W) 'grid_lcc.c'; else $(CYGPATH_W) '$(srcdir)/grid_lcc.c'; fi`
+
+cdo-grid_rot.o: grid_rot.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-grid_rot.o -MD -MP -MF $(DEPDIR)/cdo-grid_rot.Tpo -c -o cdo-grid_rot.o `test -f 'grid_rot.c' || echo '$(srcdir)/'`grid_rot.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-grid_rot.Tpo $(DEPDIR)/cdo-grid_rot.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='grid_rot.c' object='cdo-grid_rot.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-grid_rot.o `test -f 'grid_rot.c' || echo '$(srcdir)/'`grid_rot.c
+
+cdo-grid_rot.obj: grid_rot.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-grid_rot.obj -MD -MP -MF $(DEPDIR)/cdo-grid_rot.Tpo -c -o cdo-grid_rot.obj `if test -f 'grid_rot.c'; then $(CYGPATH_W) 'grid_rot.c'; else $(CYGPATH_W) '$(srcdir)/grid_rot.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-grid_rot.Tpo $(DEPDIR)/cdo-grid_rot.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='grid_rot.c' object='cdo-grid_rot.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-grid_rot.obj `if test -f 'grid_rot.c'; then $(CYGPATH_W) 'grid_rot.c'; else $(CYGPATH_W) '$(srcdir)/grid_rot.c'; fi`
+
+cdo-griddes.o: griddes.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-griddes.o -MD -MP -MF $(DEPDIR)/cdo-griddes.Tpo -c -o cdo-griddes.o `test -f 'griddes.c' || echo '$(srcdir)/'`griddes.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-griddes.Tpo $(DEPDIR)/cdo-griddes.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='griddes.c' object='cdo-griddes.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-griddes.o `test -f 'griddes.c' || echo '$(srcdir)/'`griddes.c
+
+cdo-griddes.obj: griddes.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-griddes.obj -MD -MP -MF $(DEPDIR)/cdo-griddes.Tpo -c -o cdo-griddes.obj `if test -f 'griddes.c'; then $(CYGPATH_W) 'griddes.c'; else $(CYGPATH_W) '$(srcdir)/griddes.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-griddes.Tpo $(DEPDIR)/cdo-griddes.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='griddes.c' object='cdo-griddes.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-griddes.obj `if test -f 'griddes.c'; then $(CYGPATH_W) 'griddes.c'; else $(CYGPATH_W) '$(srcdir)/griddes.c'; fi`
+
+cdo-griddes_h5.o: griddes_h5.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-griddes_h5.o -MD -MP -MF $(DEPDIR)/cdo-griddes_h5.Tpo -c -o cdo-griddes_h5.o `test -f 'griddes_h5.c' || echo '$(srcdir)/'`griddes_h5.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-griddes_h5.Tpo $(DEPDIR)/cdo-griddes_h5.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='griddes_h5.c' object='cdo-griddes_h5.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-griddes_h5.o `test -f 'griddes_h5.c' || echo '$(srcdir)/'`griddes_h5.c
+
+cdo-griddes_h5.obj: griddes_h5.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-griddes_h5.obj -MD -MP -MF $(DEPDIR)/cdo-griddes_h5.Tpo -c -o cdo-griddes_h5.obj `if test -f 'griddes_h5.c'; then $(CYGPATH_W) 'griddes_h5.c'; else $(CYGPATH_W) '$(srcdir)/griddes_h5.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-griddes_h5.Tpo $(DEPDIR)/cdo-griddes_h5.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='griddes_h5.c' object='cdo-griddes_h5.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-griddes_h5.obj `if test -f 'griddes_h5.c'; then $(CYGPATH_W) 'griddes_h5.c'; else $(CYGPATH_W) '$(srcdir)/griddes_h5.c'; fi`
+
+cdo-griddes_nc.o: griddes_nc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-griddes_nc.o -MD -MP -MF $(DEPDIR)/cdo-griddes_nc.Tpo -c -o cdo-griddes_nc.o `test -f 'griddes_nc.c' || echo '$(srcdir)/'`griddes_nc.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-griddes_nc.Tpo $(DEPDIR)/cdo-griddes_nc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='griddes_nc.c' object='cdo-griddes_nc.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-griddes_nc.o `test -f 'griddes_nc.c' || echo '$(srcdir)/'`griddes_nc.c
+
+cdo-griddes_nc.obj: griddes_nc.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-griddes_nc.obj -MD -MP -MF $(DEPDIR)/cdo-griddes_nc.Tpo -c -o cdo-griddes_nc.obj `if test -f 'griddes_nc.c'; then $(CYGPATH_W) 'griddes_nc.c'; else $(CYGPATH_W) '$(srcdir)/griddes_nc.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-griddes_nc.Tpo $(DEPDIR)/cdo-griddes_nc.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='griddes_nc.c' object='cdo-griddes_nc.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-griddes_nc.obj `if test -f 'griddes_nc.c'; then $(CYGPATH_W) 'griddes_nc.c'; else $(CYGPATH_W) '$(srcdir)/griddes_nc.c'; fi`
+
+cdo-hetaeta.o: hetaeta.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-hetaeta.o -MD -MP -MF $(DEPDIR)/cdo-hetaeta.Tpo -c -o cdo-hetaeta.o `test -f 'hetaeta.c' || echo '$(srcdir)/'`hetaeta.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-hetaeta.Tpo $(DEPDIR)/cdo-hetaeta.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='hetaeta.c' object='cdo-hetaeta.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-hetaeta.o `test -f 'hetaeta.c' || echo '$(srcdir)/'`hetaeta.c
+
+cdo-hetaeta.obj: hetaeta.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-hetaeta.obj -MD -MP -MF $(DEPDIR)/cdo-hetaeta.Tpo -c -o cdo-hetaeta.obj `if test -f 'hetaeta.c'; then $(CYGPATH_W) 'hetaeta.c'; else $(CYGPATH_W) '$(srcdir)/hetaeta.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-hetaeta.Tpo $(DEPDIR)/cdo-hetaeta.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='hetaeta.c' object='cdo-hetaeta.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-hetaeta.obj `if test -f 'hetaeta.c'; then $(CYGPATH_W) 'hetaeta.c'; else $(CYGPATH_W) '$(srcdir)/hetaeta.c'; fi`
+
+cdo-history.o: history.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-history.o -MD -MP -MF $(DEPDIR)/cdo-history.Tpo -c -o cdo-history.o `test -f 'history.c' || echo '$(srcdir)/'`history.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-history.Tpo $(DEPDIR)/cdo-history.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='history.c' object='cdo-history.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-history.o `test -f 'history.c' || echo '$(srcdir)/'`history.c
+
+cdo-history.obj: history.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-history.obj -MD -MP -MF $(DEPDIR)/cdo-history.Tpo -c -o cdo-history.obj `if test -f 'history.c'; then $(CYGPATH_W) 'history.c'; else $(CYGPATH_W) '$(srcdir)/history.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-history.Tpo $(DEPDIR)/cdo-history.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='history.c' object='cdo-history.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-history.obj `if test -f 'history.c'; then $(CYGPATH_W) 'history.c'; else $(CYGPATH_W) '$(srcdir)/history.c'; fi`
+
+cdo-institution.o: institution.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-institution.o -MD -MP -MF $(DEPDIR)/cdo-institution.Tpo -c -o cdo-institution.o `test -f 'institution.c' || echo '$(srcdir)/'`institution.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-institution.Tpo $(DEPDIR)/cdo-institution.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='institution.c' object='cdo-institution.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-institution.o `test -f 'institution.c' || echo '$(srcdir)/'`institution.c
+
+cdo-institution.obj: institution.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-institution.obj -MD -MP -MF $(DEPDIR)/cdo-institution.Tpo -c -o cdo-institution.obj `if test -f 'institution.c'; then $(CYGPATH_W) 'institution.c'; else $(CYGPATH_W) '$(srcdir)/institution.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-institution.Tpo $(DEPDIR)/cdo-institution.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='institution.c' object='cdo-institution.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-institution.obj `if test -f 'institution.c'; then $(CYGPATH_W) 'institution.c'; else $(CYGPATH_W) '$(srcdir)/institution.c'; fi`
+
+cdo-interpol.o: interpol.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-interpol.o -MD -MP -MF $(DEPDIR)/cdo-interpol.Tpo -c -o cdo-interpol.o `test -f 'interpol.c' || echo '$(srcdir)/'`interpol.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-interpol.Tpo $(DEPDIR)/cdo-interpol.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='interpol.c' object='cdo-interpol.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-interpol.o `test -f 'interpol.c' || echo '$(srcdir)/'`interpol.c
+
+cdo-interpol.obj: interpol.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-interpol.obj -MD -MP -MF $(DEPDIR)/cdo-interpol.Tpo -c -o cdo-interpol.obj `if test -f 'interpol.c'; then $(CYGPATH_W) 'interpol.c'; else $(CYGPATH_W) '$(srcdir)/interpol.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-interpol.Tpo $(DEPDIR)/cdo-interpol.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='interpol.c' object='cdo-interpol.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-interpol.obj `if test -f 'interpol.c'; then $(CYGPATH_W) 'interpol.c'; else $(CYGPATH_W) '$(srcdir)/interpol.c'; fi`
+
+cdo-job.o: job.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-job.o -MD -MP -MF $(DEPDIR)/cdo-job.Tpo -c -o cdo-job.o `test -f 'job.c' || echo '$(srcdir)/'`job.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-job.Tpo $(DEPDIR)/cdo-job.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='job.c' object='cdo-job.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-job.o `test -f 'job.c' || echo '$(srcdir)/'`job.c
+
+cdo-job.obj: job.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-job.obj -MD -MP -MF $(DEPDIR)/cdo-job.Tpo -c -o cdo-job.obj `if test -f 'job.c'; then $(CYGPATH_W) 'job.c'; else $(CYGPATH_W) '$(srcdir)/job.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-job.Tpo $(DEPDIR)/cdo-job.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='job.c' object='cdo-job.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-job.obj `if test -f 'job.c'; then $(CYGPATH_W) 'job.c'; else $(CYGPATH_W) '$(srcdir)/job.c'; fi`
+
+cdo-juldate.o: juldate.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-juldate.o -MD -MP -MF $(DEPDIR)/cdo-juldate.Tpo -c -o cdo-juldate.o `test -f 'juldate.c' || echo '$(srcdir)/'`juldate.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-juldate.Tpo $(DEPDIR)/cdo-juldate.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='juldate.c' object='cdo-juldate.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-juldate.o `test -f 'juldate.c' || echo '$(srcdir)/'`juldate.c
+
+cdo-juldate.obj: juldate.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-juldate.obj -MD -MP -MF $(DEPDIR)/cdo-juldate.Tpo -c -o cdo-juldate.obj `if test -f 'juldate.c'; then $(CYGPATH_W) 'juldate.c'; else $(CYGPATH_W) '$(srcdir)/juldate.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-juldate.Tpo $(DEPDIR)/cdo-juldate.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='juldate.c' object='cdo-juldate.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-juldate.obj `if test -f 'juldate.c'; then $(CYGPATH_W) 'juldate.c'; else $(CYGPATH_W) '$(srcdir)/juldate.c'; fi`
+
+cdo-kvlist.o: kvlist.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-kvlist.o -MD -MP -MF $(DEPDIR)/cdo-kvlist.Tpo -c -o cdo-kvlist.o `test -f 'kvlist.c' || echo '$(srcdir)/'`kvlist.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-kvlist.Tpo $(DEPDIR)/cdo-kvlist.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='kvlist.c' object='cdo-kvlist.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-kvlist.o `test -f 'kvlist.c' || echo '$(srcdir)/'`kvlist.c
+
+cdo-kvlist.obj: kvlist.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-kvlist.obj -MD -MP -MF $(DEPDIR)/cdo-kvlist.Tpo -c -o cdo-kvlist.obj `if test -f 'kvlist.c'; then $(CYGPATH_W) 'kvlist.c'; else $(CYGPATH_W) '$(srcdir)/kvlist.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-kvlist.Tpo $(DEPDIR)/cdo-kvlist.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='kvlist.c' object='cdo-kvlist.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-kvlist.obj `if test -f 'kvlist.c'; then $(CYGPATH_W) 'kvlist.c'; else $(CYGPATH_W) '$(srcdir)/kvlist.c'; fi`
+
+cdo-legendre.o: legendre.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-legendre.o -MD -MP -MF $(DEPDIR)/cdo-legendre.Tpo -c -o cdo-legendre.o `test -f 'legendre.c' || echo '$(srcdir)/'`legendre.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-legendre.Tpo $(DEPDIR)/cdo-legendre.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='legendre.c' object='cdo-legendre.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-legendre.o `test -f 'legendre.c' || echo '$(srcdir)/'`legendre.c
+
+cdo-legendre.obj: legendre.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-legendre.obj -MD -MP -MF $(DEPDIR)/cdo-legendre.Tpo -c -o cdo-legendre.obj `if test -f 'legendre.c'; then $(CYGPATH_W) 'legendre.c'; else $(CYGPATH_W) '$(srcdir)/legendre.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-legendre.Tpo $(DEPDIR)/cdo-legendre.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='legendre.c' object='cdo-legendre.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-legendre.obj `if test -f 'legendre.c'; then $(CYGPATH_W) 'legendre.c'; else $(CYGPATH_W) '$(srcdir)/legendre.c'; fi`
+
+cdo-list.o: list.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-list.o -MD -MP -MF $(DEPDIR)/cdo-list.Tpo -c -o cdo-list.o `test -f 'list.c' || echo '$(srcdir)/'`list.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-list.Tpo $(DEPDIR)/cdo-list.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='list.c' object='cdo-list.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-list.o `test -f 'list.c' || echo '$(srcdir)/'`list.c
+
+cdo-list.obj: list.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-list.obj -MD -MP -MF $(DEPDIR)/cdo-list.Tpo -c -o cdo-list.obj `if test -f 'list.c'; then $(CYGPATH_W) 'list.c'; else $(CYGPATH_W) '$(srcdir)/list.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-list.Tpo $(DEPDIR)/cdo-list.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='list.c' object='cdo-list.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-list.obj `if test -f 'list.c'; then $(CYGPATH_W) 'list.c'; else $(CYGPATH_W) '$(srcdir)/list.c'; fi`
+
+cdo-merge_sort2.o: merge_sort2.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-merge_sort2.o -MD -MP -MF $(DEPDIR)/cdo-merge_sort2.Tpo -c -o cdo-merge_sort2.o `test -f 'merge_sort2.c' || echo '$(srcdir)/'`merge_sort2.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-merge_sort2.Tpo $(DEPDIR)/cdo-merge_sort2.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='merge_sort2.c' object='cdo-merge_sort2.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-merge_sort2.o `test -f 'merge_sort2.c' || echo '$(srcdir)/'`merge_sort2.c
+
+cdo-merge_sort2.obj: merge_sort2.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-merge_sort2.obj -MD -MP -MF $(DEPDIR)/cdo-merge_sort2.Tpo -c -o cdo-merge_sort2.obj `if test -f 'merge_sort2.c'; then $(CYGPATH_W) 'merge_sort2.c'; else $(CYGPATH_W) '$(srcdir)/merge_sort2.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-merge_sort2.Tpo $(DEPDIR)/cdo-merge_sort2.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='merge_sort2.c' object='cdo-merge_sort2.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-merge_sort2.obj `if test -f 'merge_sort2.c'; then $(CYGPATH_W) 'merge_sort2.c'; else $(CYGPATH_W) '$(srcdir)/merge_sort2.c'; fi`
+
+cdo-modules.o: modules.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-modules.o -MD -MP -MF $(DEPDIR)/cdo-modules.Tpo -c -o cdo-modules.o `test -f 'modules.c' || echo '$(srcdir)/'`modules.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-modules.Tpo $(DEPDIR)/cdo-modules.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='modules.c' object='cdo-modules.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-modules.o `test -f 'modules.c' || echo '$(srcdir)/'`modules.c
+
+cdo-modules.obj: modules.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-modules.obj -MD -MP -MF $(DEPDIR)/cdo-modules.Tpo -c -o cdo-modules.obj `if test -f 'modules.c'; then $(CYGPATH_W) 'modules.c'; else $(CYGPATH_W) '$(srcdir)/modules.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-modules.Tpo $(DEPDIR)/cdo-modules.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='modules.c' object='cdo-modules.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-modules.obj `if test -f 'modules.c'; then $(CYGPATH_W) 'modules.c'; else $(CYGPATH_W) '$(srcdir)/modules.c'; fi`
+
+cdo-namelist.o: namelist.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-namelist.o -MD -MP -MF $(DEPDIR)/cdo-namelist.Tpo -c -o cdo-namelist.o `test -f 'namelist.c' || echo '$(srcdir)/'`namelist.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-namelist.Tpo $(DEPDIR)/cdo-namelist.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='namelist.c' object='cdo-namelist.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-namelist.o `test -f 'namelist.c' || echo '$(srcdir)/'`namelist.c
+
+cdo-namelist.obj: namelist.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-namelist.obj -MD -MP -MF $(DEPDIR)/cdo-namelist.Tpo -c -o cdo-namelist.obj `if test -f 'namelist.c'; then $(CYGPATH_W) 'namelist.c'; else $(CYGPATH_W) '$(srcdir)/namelist.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-namelist.Tpo $(DEPDIR)/cdo-namelist.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='namelist.c' object='cdo-namelist.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-namelist.obj `if test -f 'namelist.c'; then $(CYGPATH_W) 'namelist.c'; else $(CYGPATH_W) '$(srcdir)/namelist.c'; fi`
+
+cdo-normal.o: normal.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-normal.o -MD -MP -MF $(DEPDIR)/cdo-normal.Tpo -c -o cdo-normal.o `test -f 'normal.c' || echo '$(srcdir)/'`normal.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-normal.Tpo $(DEPDIR)/cdo-normal.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='normal.c' object='cdo-normal.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-normal.o `test -f 'normal.c' || echo '$(srcdir)/'`normal.c
+
+cdo-normal.obj: normal.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-normal.obj -MD -MP -MF $(DEPDIR)/cdo-normal.Tpo -c -o cdo-normal.obj `if test -f 'normal.c'; then $(CYGPATH_W) 'normal.c'; else $(CYGPATH_W) '$(srcdir)/normal.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-normal.Tpo $(DEPDIR)/cdo-normal.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='normal.c' object='cdo-normal.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-normal.obj `if test -f 'normal.c'; then $(CYGPATH_W) 'normal.c'; else $(CYGPATH_W) '$(srcdir)/normal.c'; fi`
+
+cdo-nth_element.o: nth_element.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-nth_element.o -MD -MP -MF $(DEPDIR)/cdo-nth_element.Tpo -c -o cdo-nth_element.o `test -f 'nth_element.c' || echo '$(srcdir)/'`nth_element.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-nth_element.Tpo $(DEPDIR)/cdo-nth_element.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='nth_element.c' object='cdo-nth_element.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-nth_element.o `test -f 'nth_element.c' || echo '$(srcdir)/'`nth_element.c
+
+cdo-nth_element.obj: nth_element.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-nth_element.obj -MD -MP -MF $(DEPDIR)/cdo-nth_element.Tpo -c -o cdo-nth_element.obj `if test -f 'nth_element.c'; then $(CYGPATH_W) 'nth_element.c'; else $(CYGPATH_W) '$(srcdir)/nth_element.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-nth_element.Tpo $(DEPDIR)/cdo-nth_element.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='nth_element.c' object='cdo-nth_element.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-nth_element.obj `if test -f 'nth_element.c'; then $(CYGPATH_W) 'nth_element.c'; else $(CYGPATH_W) '$(srcdir)/nth_element.c'; fi`
+
+cdo-par_io.o: par_io.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-par_io.o -MD -MP -MF $(DEPDIR)/cdo-par_io.Tpo -c -o cdo-par_io.o `test -f 'par_io.c' || echo '$(srcdir)/'`par_io.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-par_io.Tpo $(DEPDIR)/cdo-par_io.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='par_io.c' object='cdo-par_io.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-par_io.o `test -f 'par_io.c' || echo '$(srcdir)/'`par_io.c
+
+cdo-par_io.obj: par_io.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-par_io.obj -MD -MP -MF $(DEPDIR)/cdo-par_io.Tpo -c -o cdo-par_io.obj `if test -f 'par_io.c'; then $(CYGPATH_W) 'par_io.c'; else $(CYGPATH_W) '$(srcdir)/par_io.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-par_io.Tpo $(DEPDIR)/cdo-par_io.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='par_io.c' object='cdo-par_io.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-par_io.obj `if test -f 'par_io.c'; then $(CYGPATH_W) 'par_io.c'; else $(CYGPATH_W) '$(srcdir)/par_io.c'; fi`
+
+cdo-percentiles.o: percentiles.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-percentiles.o -MD -MP -MF $(DEPDIR)/cdo-percentiles.Tpo -c -o cdo-percentiles.o `test -f 'percentiles.c' || echo '$(srcdir)/'`percentiles.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-percentiles.Tpo $(DEPDIR)/cdo-percentiles.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='percentiles.c' object='cdo-percentiles.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-percentiles.o `test -f 'percentiles.c' || echo '$(srcdir)/'`percentiles.c
+
+cdo-percentiles.obj: percentiles.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-percentiles.obj -MD -MP -MF $(DEPDIR)/cdo-percentiles.Tpo -c -o cdo-percentiles.obj `if test -f 'percentiles.c'; then $(CYGPATH_W) 'percentiles.c'; else $(CYGPATH_W) '$(srcdir)/percentiles.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-percentiles.Tpo $(DEPDIR)/cdo-percentiles.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='percentiles.c' object='cdo-percentiles.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-percentiles.obj `if test -f 'percentiles.c'; then $(CYGPATH_W) 'percentiles.c'; else $(CYGPATH_W) '$(srcdir)/percentiles.c'; fi`
+
+cdo-pipe.o: pipe.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-pipe.o -MD -MP -MF $(DEPDIR)/cdo-pipe.Tpo -c -o cdo-pipe.o `test -f 'pipe.c' || echo '$(srcdir)/'`pipe.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-pipe.Tpo $(DEPDIR)/cdo-pipe.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='pipe.c' object='cdo-pipe.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-pipe.o `test -f 'pipe.c' || echo '$(srcdir)/'`pipe.c
+
+cdo-pipe.obj: pipe.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-pipe.obj -MD -MP -MF $(DEPDIR)/cdo-pipe.Tpo -c -o cdo-pipe.obj `if test -f 'pipe.c'; then $(CYGPATH_W) 'pipe.c'; else $(CYGPATH_W) '$(srcdir)/pipe.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-pipe.Tpo $(DEPDIR)/cdo-pipe.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='pipe.c' object='cdo-pipe.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-pipe.obj `if test -f 'pipe.c'; then $(CYGPATH_W) 'pipe.c'; else $(CYGPATH_W) '$(srcdir)/pipe.c'; fi`
+
+cdo-process.o: process.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-process.o -MD -MP -MF $(DEPDIR)/cdo-process.Tpo -c -o cdo-process.o `test -f 'process.c' || echo '$(srcdir)/'`process.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-process.Tpo $(DEPDIR)/cdo-process.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='process.c' object='cdo-process.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-process.o `test -f 'process.c' || echo '$(srcdir)/'`process.c
+
+cdo-process.obj: process.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-process.obj -MD -MP -MF $(DEPDIR)/cdo-process.Tpo -c -o cdo-process.obj `if test -f 'process.c'; then $(CYGPATH_W) 'process.c'; else $(CYGPATH_W) '$(srcdir)/process.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-process.Tpo $(DEPDIR)/cdo-process.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='process.c' object='cdo-process.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-process.obj `if test -f 'process.c'; then $(CYGPATH_W) 'process.c'; else $(CYGPATH_W) '$(srcdir)/process.c'; fi`
+
+cdo-pstream.o: pstream.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-pstream.o -MD -MP -MF $(DEPDIR)/cdo-pstream.Tpo -c -o cdo-pstream.o `test -f 'pstream.c' || echo '$(srcdir)/'`pstream.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-pstream.Tpo $(DEPDIR)/cdo-pstream.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='pstream.c' object='cdo-pstream.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-pstream.o `test -f 'pstream.c' || echo '$(srcdir)/'`pstream.c
+
+cdo-pstream.obj: pstream.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-pstream.obj -MD -MP -MF $(DEPDIR)/cdo-pstream.Tpo -c -o cdo-pstream.obj `if test -f 'pstream.c'; then $(CYGPATH_W) 'pstream.c'; else $(CYGPATH_W) '$(srcdir)/pstream.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-pstream.Tpo $(DEPDIR)/cdo-pstream.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='pstream.c' object='cdo-pstream.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-pstream.obj `if test -f 'pstream.c'; then $(CYGPATH_W) 'pstream.c'; else $(CYGPATH_W) '$(srcdir)/pstream.c'; fi`
+
+cdo-pthread_debug.o: pthread_debug.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-pthread_debug.o -MD -MP -MF $(DEPDIR)/cdo-pthread_debug.Tpo -c -o cdo-pthread_debug.o `test -f 'pthread_debug.c' || echo '$(srcdir)/'`pthread_debug.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-pthread_debug.Tpo $(DEPDIR)/cdo-pthread_debug.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='pthread_debug.c' object='cdo-pthread_debug.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-pthread_debug.o `test -f 'pthread_debug.c' || echo '$(srcdir)/'`pthread_debug.c
+
+cdo-pthread_debug.obj: pthread_debug.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-pthread_debug.obj -MD -MP -MF $(DEPDIR)/cdo-pthread_debug.Tpo -c -o cdo-pthread_debug.obj `if test -f 'pthread_debug.c'; then $(CYGPATH_W) 'pthread_debug.c'; else $(CYGPATH_W) '$(srcdir)/pthread_debug.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-pthread_debug.Tpo $(DEPDIR)/cdo-pthread_debug.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='pthread_debug.c' object='cdo-pthread_debug.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-pthread_debug.obj `if test -f 'pthread_debug.c'; then $(CYGPATH_W) 'pthread_debug.c'; else $(CYGPATH_W) '$(srcdir)/pthread_debug.c'; fi`
+
+cdo-readline.o: readline.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-readline.o -MD -MP -MF $(DEPDIR)/cdo-readline.Tpo -c -o cdo-readline.o `test -f 'readline.c' || echo '$(srcdir)/'`readline.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-readline.Tpo $(DEPDIR)/cdo-readline.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='readline.c' object='cdo-readline.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-readline.o `test -f 'readline.c' || echo '$(srcdir)/'`readline.c
+
+cdo-readline.obj: readline.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-readline.obj -MD -MP -MF $(DEPDIR)/cdo-readline.Tpo -c -o cdo-readline.obj `if test -f 'readline.c'; then $(CYGPATH_W) 'readline.c'; else $(CYGPATH_W) '$(srcdir)/readline.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-readline.Tpo $(DEPDIR)/cdo-readline.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='readline.c' object='cdo-readline.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-readline.obj `if test -f 'readline.c'; then $(CYGPATH_W) 'readline.c'; else $(CYGPATH_W) '$(srcdir)/readline.c'; fi`
+
+cdo-realtime.o: realtime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-realtime.o -MD -MP -MF $(DEPDIR)/cdo-realtime.Tpo -c -o cdo-realtime.o `test -f 'realtime.c' || echo '$(srcdir)/'`realtime.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-realtime.Tpo $(DEPDIR)/cdo-realtime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='realtime.c' object='cdo-realtime.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-realtime.o `test -f 'realtime.c' || echo '$(srcdir)/'`realtime.c
+
+cdo-realtime.obj: realtime.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-realtime.obj -MD -MP -MF $(DEPDIR)/cdo-realtime.Tpo -c -o cdo-realtime.obj `if test -f 'realtime.c'; then $(CYGPATH_W) 'realtime.c'; else $(CYGPATH_W) '$(srcdir)/realtime.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-realtime.Tpo $(DEPDIR)/cdo-realtime.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='realtime.c' object='cdo-realtime.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-realtime.obj `if test -f 'realtime.c'; then $(CYGPATH_W) 'realtime.c'; else $(CYGPATH_W) '$(srcdir)/realtime.c'; fi`
+
+cdo-remaplib.o: remaplib.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-remaplib.o -MD -MP -MF $(DEPDIR)/cdo-remaplib.Tpo -c -o cdo-remaplib.o `test -f 'remaplib.c' || echo '$(srcdir)/'`remaplib.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-remaplib.Tpo $(DEPDIR)/cdo-remaplib.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='remaplib.c' object='cdo-remaplib.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-remaplib.o `test -f 'remaplib.c' || echo '$(srcdir)/'`remaplib.c
+
+cdo-remaplib.obj: remaplib.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-remaplib.obj -MD -MP -MF $(DEPDIR)/cdo-remaplib.Tpo -c -o cdo-remaplib.obj `if test -f 'remaplib.c'; then $(CYGPATH_W) 'remaplib.c'; else $(CYGPATH_W) '$(srcdir)/remaplib.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-remaplib.Tpo $(DEPDIR)/cdo-remaplib.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='remaplib.c' object='cdo-remaplib.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-remaplib.obj `if test -f 'remaplib.c'; then $(CYGPATH_W) 'remaplib.c'; else $(CYGPATH_W) '$(srcdir)/remaplib.c'; fi`
+
+cdo-remapsort.o: remapsort.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-remapsort.o -MD -MP -MF $(DEPDIR)/cdo-remapsort.Tpo -c -o cdo-remapsort.o `test -f 'remapsort.c' || echo '$(srcdir)/'`remapsort.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-remapsort.Tpo $(DEPDIR)/cdo-remapsort.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='remapsort.c' object='cdo-remapsort.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-remapsort.o `test -f 'remapsort.c' || echo '$(srcdir)/'`remapsort.c
+
+cdo-remapsort.obj: remapsort.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-remapsort.obj -MD -MP -MF $(DEPDIR)/cdo-remapsort.Tpo -c -o cdo-remapsort.obj `if test -f 'remapsort.c'; then $(CYGPATH_W) 'remapsort.c'; else $(CYGPATH_W) '$(srcdir)/remapsort.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-remapsort.Tpo $(DEPDIR)/cdo-remapsort.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='remapsort.c' object='cdo-remapsort.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-remapsort.obj `if test -f 'remapsort.c'; then $(CYGPATH_W) 'remapsort.c'; else $(CYGPATH_W) '$(srcdir)/remapsort.c'; fi`
+
+cdo-specspace.o: specspace.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-specspace.o -MD -MP -MF $(DEPDIR)/cdo-specspace.Tpo -c -o cdo-specspace.o `test -f 'specspace.c' || echo '$(srcdir)/'`specspace.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-specspace.Tpo $(DEPDIR)/cdo-specspace.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='specspace.c' object='cdo-specspace.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-specspace.o `test -f 'specspace.c' || echo '$(srcdir)/'`specspace.c
+
+cdo-specspace.obj: specspace.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-specspace.obj -MD -MP -MF $(DEPDIR)/cdo-specspace.Tpo -c -o cdo-specspace.obj `if test -f 'specspace.c'; then $(CYGPATH_W) 'specspace.c'; else $(CYGPATH_W) '$(srcdir)/specspace.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-specspace.Tpo $(DEPDIR)/cdo-specspace.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='specspace.c' object='cdo-specspace.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-specspace.obj `if test -f 'specspace.c'; then $(CYGPATH_W) 'specspace.c'; else $(CYGPATH_W) '$(srcdir)/specspace.c'; fi`
+
+cdo-statistic.o: statistic.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-statistic.o -MD -MP -MF $(DEPDIR)/cdo-statistic.Tpo -c -o cdo-statistic.o `test -f 'statistic.c' || echo '$(srcdir)/'`statistic.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-statistic.Tpo $(DEPDIR)/cdo-statistic.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='statistic.c' object='cdo-statistic.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-statistic.o `test -f 'statistic.c' || echo '$(srcdir)/'`statistic.c
+
+cdo-statistic.obj: statistic.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-statistic.obj -MD -MP -MF $(DEPDIR)/cdo-statistic.Tpo -c -o cdo-statistic.obj `if test -f 'statistic.c'; then $(CYGPATH_W) 'statistic.c'; else $(CYGPATH_W) '$(srcdir)/statistic.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-statistic.Tpo $(DEPDIR)/cdo-statistic.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='statistic.c' object='cdo-statistic.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-statistic.obj `if test -f 'statistic.c'; then $(CYGPATH_W) 'statistic.c'; else $(CYGPATH_W) '$(srcdir)/statistic.c'; fi`
+
+cdo-table.o: table.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-table.o -MD -MP -MF $(DEPDIR)/cdo-table.Tpo -c -o cdo-table.o `test -f 'table.c' || echo '$(srcdir)/'`table.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-table.Tpo $(DEPDIR)/cdo-table.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='table.c' object='cdo-table.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-table.o `test -f 'table.c' || echo '$(srcdir)/'`table.c
+
+cdo-table.obj: table.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-table.obj -MD -MP -MF $(DEPDIR)/cdo-table.Tpo -c -o cdo-table.obj `if test -f 'table.c'; then $(CYGPATH_W) 'table.c'; else $(CYGPATH_W) '$(srcdir)/table.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-table.Tpo $(DEPDIR)/cdo-table.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='table.c' object='cdo-table.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-table.obj `if test -f 'table.c'; then $(CYGPATH_W) 'table.c'; else $(CYGPATH_W) '$(srcdir)/table.c'; fi`
+
+cdo-timer.o: timer.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-timer.o -MD -MP -MF $(DEPDIR)/cdo-timer.Tpo -c -o cdo-timer.o `test -f 'timer.c' || echo '$(srcdir)/'`timer.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-timer.Tpo $(DEPDIR)/cdo-timer.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='timer.c' object='cdo-timer.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-timer.o `test -f 'timer.c' || echo '$(srcdir)/'`timer.c
+
+cdo-timer.obj: timer.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-timer.obj -MD -MP -MF $(DEPDIR)/cdo-timer.Tpo -c -o cdo-timer.obj `if test -f 'timer.c'; then $(CYGPATH_W) 'timer.c'; else $(CYGPATH_W) '$(srcdir)/timer.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-timer.Tpo $(DEPDIR)/cdo-timer.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='timer.c' object='cdo-timer.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-timer.obj `if test -f 'timer.c'; then $(CYGPATH_W) 'timer.c'; else $(CYGPATH_W) '$(srcdir)/timer.c'; fi`
+
+cdo-userlog.obj: userlog.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-userlog.obj -MD -MP -MF $(DEPDIR)/cdo-userlog.Tpo -c -o cdo-userlog.obj `if test -f 'userlog.c'; then $(CYGPATH_W) 'userlog.c'; else $(CYGPATH_W) '$(srcdir)/userlog.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-userlog.Tpo $(DEPDIR)/cdo-userlog.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='userlog.c' object='cdo-userlog.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-userlog.obj `if test -f 'userlog.c'; then $(CYGPATH_W) 'userlog.c'; else $(CYGPATH_W) '$(srcdir)/userlog.c'; fi`
+
+cdo-util.o: util.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-util.o -MD -MP -MF $(DEPDIR)/cdo-util.Tpo -c -o cdo-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-util.Tpo $(DEPDIR)/cdo-util.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='util.c' object='cdo-util.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-util.o `test -f 'util.c' || echo '$(srcdir)/'`util.c
+
+cdo-util.obj: util.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-util.obj -MD -MP -MF $(DEPDIR)/cdo-util.Tpo -c -o cdo-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-util.Tpo $(DEPDIR)/cdo-util.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='util.c' object='cdo-util.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-util.obj `if test -f 'util.c'; then $(CYGPATH_W) 'util.c'; else $(CYGPATH_W) '$(srcdir)/util.c'; fi`
+
+cdo-vinterp.o: vinterp.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-vinterp.o -MD -MP -MF $(DEPDIR)/cdo-vinterp.Tpo -c -o cdo-vinterp.o `test -f 'vinterp.c' || echo '$(srcdir)/'`vinterp.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-vinterp.Tpo $(DEPDIR)/cdo-vinterp.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='vinterp.c' object='cdo-vinterp.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-vinterp.o `test -f 'vinterp.c' || echo '$(srcdir)/'`vinterp.c
+
+cdo-vinterp.obj: vinterp.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-vinterp.obj -MD -MP -MF $(DEPDIR)/cdo-vinterp.Tpo -c -o cdo-vinterp.obj `if test -f 'vinterp.c'; then $(CYGPATH_W) 'vinterp.c'; else $(CYGPATH_W) '$(srcdir)/vinterp.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-vinterp.Tpo $(DEPDIR)/cdo-vinterp.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='vinterp.c' object='cdo-vinterp.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-vinterp.obj `if test -f 'vinterp.c'; then $(CYGPATH_W) 'vinterp.c'; else $(CYGPATH_W) '$(srcdir)/vinterp.c'; fi`
+
+cdo-zaxis.o: zaxis.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-zaxis.o -MD -MP -MF $(DEPDIR)/cdo-zaxis.Tpo -c -o cdo-zaxis.o `test -f 'zaxis.c' || echo '$(srcdir)/'`zaxis.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-zaxis.Tpo $(DEPDIR)/cdo-zaxis.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='zaxis.c' object='cdo-zaxis.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-zaxis.o `test -f 'zaxis.c' || echo '$(srcdir)/'`zaxis.c
+
+cdo-zaxis.obj: zaxis.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-zaxis.obj -MD -MP -MF $(DEPDIR)/cdo-zaxis.Tpo -c -o cdo-zaxis.obj `if test -f 'zaxis.c'; then $(CYGPATH_W) 'zaxis.c'; else $(CYGPATH_W) '$(srcdir)/zaxis.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-zaxis.Tpo $(DEPDIR)/cdo-zaxis.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='zaxis.c' object='cdo-zaxis.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-zaxis.obj `if test -f 'zaxis.c'; then $(CYGPATH_W) 'zaxis.c'; else $(CYGPATH_W) '$(srcdir)/zaxis.c'; fi`
+
+cdo-Magplot.o: Magplot.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Magplot.o -MD -MP -MF $(DEPDIR)/cdo-Magplot.Tpo -c -o cdo-Magplot.o `test -f 'Magplot.c' || echo '$(srcdir)/'`Magplot.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Magplot.Tpo $(DEPDIR)/cdo-Magplot.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Magplot.c' object='cdo-Magplot.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Magplot.o `test -f 'Magplot.c' || echo '$(srcdir)/'`Magplot.c
+
+cdo-Magplot.obj: Magplot.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Magplot.obj -MD -MP -MF $(DEPDIR)/cdo-Magplot.Tpo -c -o cdo-Magplot.obj `if test -f 'Magplot.c'; then $(CYGPATH_W) 'Magplot.c'; else $(CYGPATH_W) '$(srcdir)/Magplot.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Magplot.Tpo $(DEPDIR)/cdo-Magplot.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Magplot.c' object='cdo-Magplot.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Magplot.obj `if test -f 'Magplot.c'; then $(CYGPATH_W) 'Magplot.c'; else $(CYGPATH_W) '$(srcdir)/Magplot.c'; fi`
+
+cdo-Magvector.o: Magvector.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Magvector.o -MD -MP -MF $(DEPDIR)/cdo-Magvector.Tpo -c -o cdo-Magvector.o `test -f 'Magvector.c' || echo '$(srcdir)/'`Magvector.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Magvector.Tpo $(DEPDIR)/cdo-Magvector.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Magvector.c' object='cdo-Magvector.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Magvector.o `test -f 'Magvector.c' || echo '$(srcdir)/'`Magvector.c
+
+cdo-Magvector.obj: Magvector.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Magvector.obj -MD -MP -MF $(DEPDIR)/cdo-Magvector.Tpo -c -o cdo-Magvector.obj `if test -f 'Magvector.c'; then $(CYGPATH_W) 'Magvector.c'; else $(CYGPATH_W) '$(srcdir)/Magvector.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Magvector.Tpo $(DEPDIR)/cdo-Magvector.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Magvector.c' object='cdo-Magvector.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Magvector.obj `if test -f 'Magvector.c'; then $(CYGPATH_W) 'Magvector.c'; else $(CYGPATH_W) '$(srcdir)/Magvector.c'; fi`
+
+cdo-Maggraph.o: Maggraph.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Maggraph.o -MD -MP -MF $(DEPDIR)/cdo-Maggraph.Tpo -c -o cdo-Maggraph.o `test -f 'Maggraph.c' || echo '$(srcdir)/'`Maggraph.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Maggraph.Tpo $(DEPDIR)/cdo-Maggraph.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Maggraph.c' object='cdo-Maggraph.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Maggraph.o `test -f 'Maggraph.c' || echo '$(srcdir)/'`Maggraph.c
+
+cdo-Maggraph.obj: Maggraph.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-Maggraph.obj -MD -MP -MF $(DEPDIR)/cdo-Maggraph.Tpo -c -o cdo-Maggraph.obj `if test -f 'Maggraph.c'; then $(CYGPATH_W) 'Maggraph.c'; else $(CYGPATH_W) '$(srcdir)/Maggraph.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-Maggraph.Tpo $(DEPDIR)/cdo-Maggraph.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='Maggraph.c' object='cdo-Maggraph.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-Maggraph.obj `if test -f 'Maggraph.c'; then $(CYGPATH_W) 'Maggraph.c'; else $(CYGPATH_W) '$(srcdir)/Maggraph.c'; fi`
+
+cdo-template_parser.o: template_parser.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-template_parser.o -MD -MP -MF $(DEPDIR)/cdo-template_parser.Tpo -c -o cdo-template_parser.o `test -f 'template_parser.c' || echo '$(srcdir)/'`template_parser.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-template_parser.Tpo $(DEPDIR)/cdo-template_parser.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='template_parser.c' object='cdo-template_parser.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-template_parser.o `test -f 'template_parser.c' || echo '$(srcdir)/'`template_parser.c
+
+cdo-template_parser.obj: template_parser.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-template_parser.obj -MD -MP -MF $(DEPDIR)/cdo-template_parser.Tpo -c -o cdo-template_parser.obj `if test -f 'template_parser.c'; then $(CYGPATH_W) 'template_parser.c'; else $(CYGPATH_W) '$(srcdir)/template_parser.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-template_parser.Tpo $(DEPDIR)/cdo-template_parser.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='template_parser.c' object='cdo-template_parser.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-template_parser.obj `if test -f 'template_parser.c'; then $(CYGPATH_W) 'template_parser.c'; else $(CYGPATH_W) '$(srcdir)/template_parser.c'; fi`
+
+cdo-results_template_parser.o: results_template_parser.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-results_template_parser.o -MD -MP -MF $(DEPDIR)/cdo-results_template_parser.Tpo -c -o cdo-results_template_parser.o `test -f 'results_template_parser.c' || echo '$(srcdir)/'`results_template_parser.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-results_template_parser.Tpo $(DEPDIR)/cdo-results_template_parser.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='results_template_parser.c' object='cdo-results_template_parser.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-results_template_parser.o `test -f 'results_template_parser.c' || echo '$(srcdir)/'`results_template_parser.c
+
+cdo-results_template_parser.obj: results_template_parser.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-results_template_parser.obj -MD -MP -MF $(DEPDIR)/cdo-results_template_parser.Tpo -c -o cdo-results_template_parser.obj `if test -f 'results_template_parser.c'; then $(CYGPATH_W) 'results_template_parser.c'; else $(CYGPATH_W) '$(srcdir)/results_template_parser.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-results_template_parser.Tpo $(DEPDIR)/cdo-results_template_parser.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='results_template_parser.c' object='cdo-results_template_parser.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-results_template_parser.obj `if test -f 'results_template_parser.c'; then $(CYGPATH_W) 'results_template_parser.c'; else $(CYGPATH_W) '$(srcdir)/results_template_parser.c'; fi`
+
+cdo-magics_template_parser.o: magics_template_parser.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-magics_template_parser.o -MD -MP -MF $(DEPDIR)/cdo-magics_template_parser.Tpo -c -o cdo-magics_template_parser.o `test -f 'magics_template_parser.c' || echo '$(srcdir)/'`magics_template_parser.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-magics_template_parser.Tpo $(DEPDIR)/cdo-magics_template_parser.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='magics_template_parser.c' object='cdo-magics_template_parser.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-magics_template_parser.o `test -f 'magics_template_parser.c' || echo '$(srcdir)/'`magics_template_parser.c
+
+cdo-magics_template_parser.obj: magics_template_parser.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-magics_template_parser.obj -MD -MP -MF $(DEPDIR)/cdo-magics_template_parser.Tpo -c -o cdo-magics_template_parser.obj `if test -f 'magics_template_parser.c'; then $(CYGPATH_W) 'magics_template_parser.c'; else $(CYGPATH_W) '$(srcdir)/magics_template_parser.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-magics_template_parser.Tpo $(DEPDIR)/cdo-magics_template_parser.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='magics_template_parser.c' object='cdo-magics_template_parser.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-magics_template_parser.obj `if test -f 'magics_template_parser.c'; then $(CYGPATH_W) 'magics_template_parser.c'; else $(CYGPATH_W) '$(srcdir)/magics_template_parser.c'; fi`
+
+cdo-StringUtilities.o: StringUtilities.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-StringUtilities.o -MD -MP -MF $(DEPDIR)/cdo-StringUtilities.Tpo -c -o cdo-StringUtilities.o `test -f 'StringUtilities.c' || echo '$(srcdir)/'`StringUtilities.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-StringUtilities.Tpo $(DEPDIR)/cdo-StringUtilities.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='StringUtilities.c' object='cdo-StringUtilities.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-StringUtilities.o `test -f 'StringUtilities.c' || echo '$(srcdir)/'`StringUtilities.c
+
+cdo-StringUtilities.obj: StringUtilities.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-StringUtilities.obj -MD -MP -MF $(DEPDIR)/cdo-StringUtilities.Tpo -c -o cdo-StringUtilities.obj `if test -f 'StringUtilities.c'; then $(CYGPATH_W) 'StringUtilities.c'; else $(CYGPATH_W) '$(srcdir)/StringUtilities.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-StringUtilities.Tpo $(DEPDIR)/cdo-StringUtilities.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='StringUtilities.c' object='cdo-StringUtilities.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-StringUtilities.obj `if test -f 'StringUtilities.c'; then $(CYGPATH_W) 'StringUtilities.c'; else $(CYGPATH_W) '$(srcdir)/StringUtilities.c'; fi`
+
+cdo-CdoMagicsMapper.o: CdoMagicsMapper.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-CdoMagicsMapper.o -MD -MP -MF $(DEPDIR)/cdo-CdoMagicsMapper.Tpo -c -o cdo-CdoMagicsMapper.o `test -f 'CdoMagicsMapper.c' || echo '$(srcdir)/'`CdoMagicsMapper.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-CdoMagicsMapper.Tpo $(DEPDIR)/cdo-CdoMagicsMapper.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='CdoMagicsMapper.c' object='cdo-CdoMagicsMapper.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-CdoMagicsMapper.o `test -f 'CdoMagicsMapper.c' || echo '$(srcdir)/'`CdoMagicsMapper.c
+
+cdo-CdoMagicsMapper.obj: CdoMagicsMapper.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdo-CdoMagicsMapper.obj -MD -MP -MF $(DEPDIR)/cdo-CdoMagicsMapper.Tpo -c -o cdo-CdoMagicsMapper.obj `if test -f 'CdoMagicsMapper.c'; then $(CYGPATH_W) 'CdoMagicsMapper.c'; else $(CYGPATH_W) '$(srcdir)/CdoMagicsMapper.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdo-CdoMagicsMapper.Tpo $(DEPDIR)/cdo-CdoMagicsMapper.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='CdoMagicsMapper.c' object='cdo-CdoMagicsMapper.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdo_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdo-CdoMagicsMapper.obj `if test -f 'CdoMagicsMapper.c'; then $(CYGPATH_W) 'CdoMagicsMapper.c'; else $(CYGPATH_W) '$(srcdir)/CdoMagicsMapper.c'; fi`
+
+cdotest-cdotest.o: cdotest.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdotest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdotest-cdotest.o -MD -MP -MF $(DEPDIR)/cdotest-cdotest.Tpo -c -o cdotest-cdotest.o `test -f 'cdotest.c' || echo '$(srcdir)/'`cdotest.c
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdotest-cdotest.Tpo $(DEPDIR)/cdotest-cdotest.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cdotest.c' object='cdotest-cdotest.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdotest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdotest-cdotest.o `test -f 'cdotest.c' || echo '$(srcdir)/'`cdotest.c
+
+cdotest-cdotest.obj: cdotest.c
+ at am__fastdepCC_TRUE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdotest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cdotest-cdotest.obj -MD -MP -MF $(DEPDIR)/cdotest-cdotest.Tpo -c -o cdotest-cdotest.obj `if test -f 'cdotest.c'; then $(CYGPATH_W) 'cdotest.c'; else $(CYGPATH_W) '$(srcdir)/cdotest.c'; fi`
+ at am__fastdepCC_TRUE@	$(am__mv) $(DEPDIR)/cdotest-cdotest.Tpo $(DEPDIR)/cdotest-cdotest.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	source='cdotest.c' object='cdotest-cdotest.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@	$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(cdotest_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cdotest-cdotest.obj `if test -f 'cdotest.c'; then $(CYGPATH_W) 'cdotest.c'; else $(CYGPATH_W) '$(srcdir)/cdotest.c'; fi`
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
+	list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	mkid -fID $$unique
+tags: TAGS
+
+TAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	set x; \
+	here=`pwd`; \
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	shift; \
+	if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+	  test -n "$$unique" || unique=$$empty_fix; \
+	  if test $$# -gt 0; then \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      "$$@" $$unique; \
+	  else \
+	    $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+	      $$unique; \
+	  fi; \
+	fi
+ctags: CTAGS
+CTAGS:  $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
+		$(TAGS_FILES) $(LISP)
+	list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
+	unique=`for i in $$list; do \
+	    if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+	  done | \
+	  $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
+	      END { if (nonempty) { for (i in files) print i; }; }'`; \
+	test -z "$(CTAGS_ARGS)$$unique" \
+	  || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
+	     $$unique
+
+GTAGS:
+	here=`$(am__cd) $(top_builddir) && pwd` \
+	  && $(am__cd) $(top_srcdir) \
+	  && gtags -i $(GTAGS_ARGS) "$$here"
+
+distclean-tags:
+	-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS) config.h
+installdirs:
+	for dir in "$(DESTDIR)$(bindir)"; do \
+	  test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+	done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-binPROGRAMS clean-generic clean-libtool \
+	clean-noinstPROGRAMS mostlyclean-am
+
+distclean: distclean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+	distclean-hdr distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-binPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -rf ./$(DEPDIR)
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+	mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-binPROGRAMS
+
+.MAKE: all install-am install-strip
+
+.PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \
+	clean-generic clean-libtool clean-noinstPROGRAMS ctags \
+	distclean distclean-compile distclean-generic distclean-hdr \
+	distclean-libtool distclean-tags distdir dvi dvi-am html \
+	html-am info info-am install install-am install-binPROGRAMS \
+	install-data install-data-am install-dvi install-dvi-am \
+	install-exec install-exec-am install-html install-html-am \
+	install-info install-info-am install-man install-pdf \
+	install-pdf-am install-ps install-ps-am install-strip \
+	installcheck installcheck-am installdirs maintainer-clean \
+	maintainer-clean-generic mostlyclean mostlyclean-compile \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	tags uninstall uninstall-am uninstall-binPROGRAMS
+
+
+cdo-userlog.o: userlog.c config.h
+	$(COMPILE) -DLOGPATH=${exec_prefix}/log -c -o cdo-userlog.o `test -f 'userlog.c' || echo '$(srcdir)/'`userlog.c
+cdo_static-userlog.o: userlog.c config.h
+	$(COMPILE) -DLOGPATH=${exec_prefix}/log -c -o cdo_static-userlog.o `test -f 'userlog.c' || echo '$(srcdir)/'`userlog.c
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/src/Maskbox.c b/src/Maskbox.c
new file mode 100644
index 0000000..33cc628
--- /dev/null
+++ b/src/Maskbox.c
@@ -0,0 +1,513 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Maskbox    masklonlatbox   Mask lon/lat box
+      Maskbox    maskindexbox    Mask index box
+      Maskbox    maskregion      Mask regions
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+#define MAX_LINE 256
+#define MAX_VALS 1048576
+
+static
+int ReadCoords(double *xvals, double *yvals, const char *polyfile, FILE *fp)
+{
+  double xcoord, ycoord;
+  int z = 0, number = 0, jumpedlines = 0;
+  int i = 0;
+  char line[MAX_LINE];
+  char *linep;
+
+  while ( readline(fp, line, MAX_LINE) )
+    {
+      i = 0;
+      xcoord = 0;
+      if ( line[0] == '#' ) 
+         { 
+           jumpedlines++;
+           continue;
+         }  
+      if ( line[0] == '\0' )
+         { 
+           jumpedlines++;
+           continue;
+         }  
+      if ( line[0] == '&' ) break;
+	 
+      linep = &line[0];
+     
+      xcoord = strtod(linep, &linep);
+      
+      if ( ! (fabs(xcoord) > 0) ) 
+	{
+	  jumpedlines++;
+	}
+      
+      while( ( ( isdigit( (int) *linep ) == FALSE ) && ( *linep!='-' )) && ( i < 64) )
+	{	  
+	  if ( *linep == 0 ) 
+	    {
+	      cdoAbort(" y value missing in file %s at  line %d", polyfile, (number+jumpedlines+1));
+	      break;
+	    }
+          if ( ( isspace( (int) *linep) == FALSE && ( *linep!='-' ) ) && ( linep != NULL ) ) 
+	    cdoWarning("unknown character in file %s at line %d", polyfile, (number+jumpedlines+1) );
+
+          linep++;
+	  i++;
+	}    
+      if ( ( i >= 63 ) && ( number != 0 ) ) cdoAbort( "Wrong value format in file %s at line %d", polyfile, (number+jumpedlines+1) );
+    
+      ycoord = strtod(linep, NULL);
+     
+      xvals[number] = xcoord;
+      yvals[number] = ycoord;
+
+      number++;
+    }
+
+ 
+  if ( ( number != 0 )&& ( ! (IS_EQUAL(xvals[0], xvals[number-1]) && IS_EQUAL(yvals[0], yvals[number-1])) ) )
+    {
+      xvals[number] = xvals[0];
+      yvals[number] = yvals[0];
+      number++;
+    }
+  
+
+  if ( cdoVerbose ) 
+    {
+      for ( z = 0; z < number; z++ )  fprintf(stderr, "%d %g %g\n",  (z+1),  xvals[z], yvals[z]);
+    }
+
+  return number;
+}
+
+
+void genlonlatbox(double xlon1, double xlon2, double xlat1, double xlat2,
+		  int nlon1, int nlat1, double *xvals1, double *yvals1,
+		  int *lat1, int *lat2, int *lon11, int *lon12, int *lon21, int *lon22);
+
+static
+void genlonlatgrid(int gridID1, int *lat1, int *lat2, int *lon11, int *lon12, int *lon21, int *lon22)
+{
+  int nlon1, nlat1;
+  double *xvals1, *yvals1;
+  double xlon1, xlon2, xlat1, xlat2;
+
+  operatorCheckArgc(4);
+
+  xlon1 = atof(operatorArgv()[0]);
+  xlon2 = atof(operatorArgv()[1]);
+  xlat1 = atof(operatorArgv()[2]);
+  xlat2 = atof(operatorArgv()[3]);
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  xvals1 = (double *) malloc(nlon1*sizeof(double));
+  yvals1 = (double *) malloc(nlat1*sizeof(double));
+
+  gridInqXvals(gridID1, xvals1);
+  gridInqYvals(gridID1, yvals1);
+
+  /* Convert lat/lon units if required */
+  {
+    char units[CDI_MAX_NAME];
+    gridInqXunits(gridID1, units);
+    gridToDegree(units, "grid center lon", nlon1, xvals1);
+    gridInqYunits(gridID1, units);
+    gridToDegree(units, "grid center lat", nlat1, yvals1);
+  }
+
+  genlonlatbox(xlon1, xlon2, xlat1, xlat2,
+	       nlon1, nlat1, xvals1, yvals1,
+	       lat1, lat2, lon11, lon12, lon21, lon22);
+
+  free(xvals1);
+  free(yvals1);
+}
+
+
+static
+void genindexbox(int gridID1, int *lat1, int *lat2, int *lon11, int *lon12, int *lon21, int *lon22)
+{
+  int nlon1, nlat1;
+  int temp;
+
+  operatorCheckArgc(4);
+
+  *lon11 = atoi(operatorArgv()[0]);
+  *lon12 = atoi(operatorArgv()[1]);
+  *lat1  = atoi(operatorArgv()[2]);
+  *lat2  = atoi(operatorArgv()[3]);
+
+  if ( *lat1 > *lat2 )
+    {
+      temp = *lat1;
+      *lat1 = *lat2;
+      *lat2 = temp;
+    }
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  if ( *lat1 < 1 )
+    {
+      cdoWarning("first latitude index out of range. Set to 1.");
+      *lat1 = 1;
+    }
+  if ( *lat2 > nlat1 )
+    {
+      cdoWarning("last latitude index out of range. Set to %d.", nlat1);
+      *lat2 = nlat1;
+    }
+  if ( *lon11 < 1 )
+    {
+      cdoWarning("first longitude index out of range. Set to 1.");
+      *lon11 = 1;
+    }
+  if ( *lon12 > nlon1+1 )
+    {
+      cdoWarning("last longitude index out of range. Set to %d.", nlon1);
+      *lon12 = nlon1;
+    }
+
+  (*lon11)--;
+  (*lon12)--;
+  (*lat1)--;
+  (*lat2)--;
+
+  if ( *lon11 > *lon12 )
+    {
+      *lon21 = *lon11;
+      *lon22 = nlon1 - 1;
+      *lon11 = 0;
+    }
+  else
+    {
+      if ( *lon12 > nlon1-1 )
+	{
+	  *lon21 = *lon11;
+	  *lon22 = nlon1 - 1;
+	  *lon11 = 0;
+	  *lon12 = 0;
+	}
+      else
+	{
+	  *lon21 = 0;
+	  *lon22 = -1;
+	}
+    }
+}
+
+
+static
+void maskbox(int *mask, int gridID,
+	     int lat1, int lat2, int lon11, int lon12, int lon21, int lon22)
+{
+  int nlon, nlat;
+  int ilat, ilon;
+
+  nlon = gridInqXsize(gridID);
+  nlat = gridInqYsize(gridID);
+
+  for ( ilat = 0; ilat < nlat; ilat++ )
+    for ( ilon = 0; ilon < nlon; ilon++ )
+      if (  (lat1 <= ilat && ilat <= lat2 && 
+	      ((lon11 <= ilon && ilon <= lon12) || (lon21 <= ilon && ilon <= lon22))) )
+	mask[nlon*ilat + ilon] = 0;
+}
+
+static
+void maskregion(int *mask, int gridID, double *xcoords, double *ycoords, int nofcoords)
+{
+  int i, j;
+  int nlon, nlat;
+  int ilat, ilon;
+  int c;
+  double *xvals, *yvals;
+  double xval, yval;
+  double xmin, xmax, ymin, ymax;
+
+  nlon = gridInqXsize(gridID);
+  nlat = gridInqYsize(gridID);
+
+  xvals = (double *) malloc(nlon*sizeof(double));
+  yvals = (double *) malloc(nlat*sizeof(double));
+
+  gridInqXvals(gridID, xvals);
+  gridInqYvals(gridID, yvals);  
+
+  /* Convert lat/lon units if required */
+  {
+    char units[CDI_MAX_NAME];
+    gridInqXunits(gridID, units);
+    gridToDegree(units, "grid center lon", nlon, xvals);
+    gridInqYunits(gridID, units);
+    gridToDegree(units, "grid center lat", nlat, yvals);
+  }
+
+  xmin = xvals[0];
+  xmax = xvals[0];
+  ymin = yvals[0];
+  ymax = yvals[0];
+
+  for ( i = 1; i < nlon; i++ )
+    {
+      if ( xvals[i] < xmin ) xmin = xvals[i];
+      if ( xvals[i] > xmax ) xmax = xvals[i];
+    }
+
+  for ( i = 1; i < nlat; i++ )
+    {
+      if ( yvals[i] < ymin ) ymin = yvals[i];
+      if ( yvals[i] > ymax ) ymax = yvals[i];
+    }
+
+  for ( ilat = 0; ilat < nlat; ilat++ )
+    {
+      yval = yvals[ilat];
+      for ( ilon = 0; ilon < nlon; ilon++ )
+	{
+          c = 0;
+	  xval = xvals[ilon];
+	  if (!( ( ( xval > xmin ) || ( xval < xmax ) ) || ( (yval > ymin) || (yval < ymax) ) ) ) c = !c;
+	  	  
+          if ( c == 0 )
+	    {
+	      for (i = 0, j = nofcoords-1; i < nofcoords; j = i++)
+	    
+	      if ((((ycoords[i]<=yval) && (yval<ycoords[j])) ||
+		   ((ycoords[j]<=yval) && (yval<ycoords[i]))) &&
+		  ((xval) < (xcoords[j] - (xcoords[i])) * (yval - ycoords[i]) / (ycoords[j] - ycoords[i]) +(xcoords[i])))
+		c = !c;
+	    }
+
+	  if ( c == 0 )
+	    {
+	      for (i = 0, j = nofcoords-1; i < nofcoords; j = i++)
+		{
+		  if ( xvals[ilon] > 180 )
+		    {
+		      if ((((ycoords[i]<=yval) && (yval<ycoords[j])) ||
+			   ((ycoords[j]<=yval) && (yval<ycoords[i]))) &&
+			  ((xval-360) < (xcoords[j] - (xcoords[i])) * (yval - ycoords[i]) / (ycoords[j] - ycoords[i]) +(xcoords[i])))
+			c = !c;
+		    }
+		}
+	    }
+ 
+	  if ( c == 0 )
+	    {
+	      for ( i = 0, j = nofcoords-1; i< nofcoords; j = i++)
+		{		
+		  if ( xval<0 )
+		    {
+		      if ((((ycoords[i]<=yval) && (yval<ycoords[j])) ||
+			   ((ycoords[j]<=yval) && (yval<ycoords[i]))) &&
+			  ((xval+360) < (xcoords[j] - (xcoords[i])) * (yval - ycoords[i]) / (ycoords[j] - ycoords[i]) +(xcoords[i])))
+			c = !c;
+		    }
+		}
+	    }
+	     
+	  if( c != 0 ) mask[nlon*ilat+ilon] =  0;
+	}
+    }
+      
+  free(xvals);
+  free(yvals);
+}
+
+
+void *Maskbox(void *argument)
+{
+  int MASKLONLATBOX, MASKINDEXBOX, MASKREGION;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs, nvars;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2;
+  int gridID = -1;
+  int index, ngrids, gridtype;
+  int nmiss;
+  int *vars;
+  int i, i2;
+  int ndiffgrids;
+  int lat1, lat2, lon11, lon12, lon21, lon22;
+  int number = 0, nfiles;
+  double missval;
+  int *mask;
+  double *array;
+  int taxisID1, taxisID2;
+  double *xcoords, *ycoords;
+  FILE *fp;
+  const char *polyfile;
+
+  cdoInitialize(argument);
+
+  MASKLONLATBOX = cdoOperatorAdd("masklonlatbox", 0, 0, "western and eastern longitude and southern and northern latitude");
+  MASKINDEXBOX  = cdoOperatorAdd("maskindexbox",  0, 0, "index of first and last longitude and index of first and last latitude");
+  MASKREGION    = cdoOperatorAdd("maskregion",    0, 0, "limiting coordinates of the region");
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  ngrids = vlistNgrids(vlistID1);
+  ndiffgrids = 0;
+  for ( index = 1; index < ngrids; index++ )
+    if ( vlistGrid(vlistID1, 0) != vlistGrid(vlistID1, index))
+      ndiffgrids++;
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID   = vlistGrid(vlistID1, index);
+      gridtype = gridInqType(gridID);
+      if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN ) break;
+      if ( operatorID == MASKINDEXBOX && gridtype == GRID_CURVILINEAR ) break;
+      if ( operatorID == MASKINDEXBOX && gridtype == GRID_GENERIC &&
+	   gridInqXsize(gridID) > 0 && gridInqYsize(gridID) > 0 ) break;
+    }
+
+  if ( gridInqType(gridID) == GRID_GAUSSIAN_REDUCED )
+    cdoAbort("Gaussian reduced grid found. Use option -R to convert it to a regular grid!");
+
+  if ( index == ngrids ) cdoAbort("No regular grid found!");
+  if ( ndiffgrids > 0 )  cdoAbort("Too many different grids!");
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nvars = vlistNvars(vlistID1);
+  vars  = (int *) malloc(nvars*sizeof(int));
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( gridID == vlistInqVarGrid(vlistID1, varID) )
+	vars[varID] = TRUE;
+      else
+	vars[varID] = FALSE;
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = gridInqSize(gridID);
+  array = ( double  * ) malloc ( gridsize*sizeof(double) );
+  mask  = ( int * )     malloc ( gridsize*sizeof(int) );
+  for( i=0;  i < gridsize; i++) mask[i] = 1;
+ 
+  if ( operatorID == MASKLONLATBOX )
+    {
+      genlonlatgrid(gridID, &lat1, &lat2, &lon11, &lon12, &lon21, &lon22);
+      maskbox(mask, gridID, lat1, lat2, lon11, lon12, lon21, lon22);
+    }
+  if ( operatorID == MASKINDEXBOX )
+    {
+      genindexbox(gridID, &lat1, &lat2, &lon11, &lon12, &lon21, &lon22);
+      maskbox(mask, gridID, lat1, lat2, lon11, lon12, lon21, lon22);
+    }
+  if ( operatorID == MASKREGION )
+    {
+      xcoords = (double *) malloc( MAX_VALS*sizeof(double) );
+      ycoords = (double *) malloc( MAX_VALS*sizeof(double) );
+      nfiles = operatorArgc();
+     
+      for ( i2 = 0; i2 < nfiles; i2++ )
+	{
+	  polyfile = operatorArgv()[i2];
+	  fp = fopen(polyfile, "r");
+	 
+	  if ( fp == 0 ) cdoAbort("Open failed on %s", polyfile);   
+	  while ( TRUE )
+	    {
+	      number = ReadCoords (xcoords, ycoords, polyfile, fp );
+	      if ( number == 0 ) break;
+	      if ( number < 3 ) cdoAbort( "Too less values in file %s", polyfile );
+	      maskregion(mask, gridID, xcoords, ycoords, number);
+	    }
+	  fclose(fp); 
+	}
+      if ( xcoords ) free ( xcoords );
+      if ( ycoords ) free ( ycoords );
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( vars[varID] )
+	    {
+	      streamReadRecord(streamID1, array, &nmiss);
+              missval = vlistInqVarMissval(vlistID1, varID);
+             
+	      for ( i = 0; i < gridsize; i++ )
+		{
+		  if( mask[i] ) array[i] = missval;
+		}
+		
+	      nmiss = 0;
+
+	      for ( i = 0; i < gridsize; i++ )
+		if ( DBL_IS_EQUAL(array[i], missval) ) nmiss++;
+
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, array, nmiss);
+	    }
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( vars  ) free(vars);
+  if ( array ) free(array);
+  if ( mask )  free(mask);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Mastrfu.c b/src/Mastrfu.c
new file mode 100644
index 0000000..d5579f2
--- /dev/null
+++ b/src/Mastrfu.c
@@ -0,0 +1,190 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Mastrfu    mastrfu         Mass stream function
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+static
+void mastrfu(int gridID, int zaxisID, double *array1, double *array2)
+{
+  int nlev;
+  int nlat;
+  int ilev, ilat, n;
+  double *plevel, *phi, *cosphi, *dummy;
+  double fact =  4*atan(1.0) * 6371000 / 9.81;
+  double **field1, **field2;
+  char units[CDI_MAX_NAME];
+
+  nlat = gridInqSize(gridID);
+  nlev = zaxisInqSize(zaxisID);
+  phi    = (double *) malloc(nlat*sizeof(double));
+  dummy  = (double *) malloc(nlat*sizeof(double));
+  cosphi = (double *) malloc(nlat*sizeof(double));
+  plevel = (double *) malloc(nlev*sizeof(double));
+  field1 = (double **) malloc(nlev*sizeof(double*));
+  field2 = (double **) malloc(nlev*sizeof(double*));
+
+  zaxisInqLevels(zaxisID, plevel);
+
+  // gaussaw(phi, dummy, nlat);
+  
+  gridInqYvals(gridID, phi);
+  gridInqYunits(gridID, units);
+
+  if ( memcmp(units, "degree", 6) == 0 )
+    for ( ilat = 0; ilat < nlat; ilat++ ) phi[ilat] *= DEG2RAD;
+
+  for ( ilat = 0; ilat < nlat; ilat++ ) phi[ilat] = sin(phi[ilat]);
+
+  for ( ilat = 0; ilat < nlat; ilat++ )
+    cosphi[ilat] = sqrt(1.0 - phi[ilat]*phi[ilat]);
+
+  for ( ilev = 0; ilev < nlev; ilev++ )
+    {
+      field1[ilev] = array1 + ilev*nlat;
+      field2[ilev] = array2 + ilev*nlat;
+    }
+
+  for ( ilev = 0; ilev < nlev; ilev++ )
+    for ( ilat = 0; ilat < nlat; ilat++ )
+      field2[ilev][ilat] = 0.0;
+
+  for ( ilev = nlev-1; ilev >= 0; ilev-- )
+    for ( n = ilev; n < nlev-1; n++ )
+      for ( ilat = 0; ilat < nlat; ilat++ )
+	{
+	  field2[ilev][ilat] = field2[ilev][ilat] +
+	                       fact*(field1[n][ilat]+field1[n+1][ilat])*
+	                       cosphi[ilat]*(plevel[n]-plevel[n+1]);
+	}
+
+  free(field2);
+  free(field1);
+  free(plevel);
+  free(cosphi);
+  free(dummy);
+  free(phi);
+}
+
+
+void *Mastrfu(void *argument)
+{
+  int streamID1, streamID2;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int nvars, code, gridID, zaxisID, nlev;
+  int vlistID1, vlistID2;
+  int offset;
+  int nmiss;
+  double *array1, *array2;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  nvars = vlistNvars(vlistID1);
+  if ( nvars != 1 ) cdoAbort("This operator works only with one variable!");
+
+  code = vlistInqVarCode(vlistID1, 0);
+  if ( code > 0 && code != 132 ) cdoWarning("Unexpected code %d!", code);
+
+  zaxisID = vlistInqVarZaxis(vlistID1, 0);
+  if ( zaxisInqType(zaxisID) != ZAXIS_PRESSURE &&
+       zaxisInqType(zaxisID) != ZAXIS_GENERIC )
+    {
+      char longname[CDI_MAX_NAME];
+      zaxisInqLongname(zaxisID, longname);
+      cdoWarning("Unexpected vertical grid %s!", longname);
+    }
+
+  gridID = vlistInqVarGrid(vlistID1, 0);
+  if ( gridInqXsize(gridID) > 1 ) cdoAbort("Grid must be a zonal mean!");
+
+  gridsize = gridInqSize(gridID);
+  nlev = zaxisInqSize(zaxisID);
+
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  vlistDefVarCode(vlistID2, 0, 272);
+  vlistDefVarName(vlistID2, 0, "mastrfu");
+  vlistDefVarLongname(vlistID2, 0, "mass stream function");
+  vlistDefVarUnits(vlistID2, 0, "kg/s");
+  vlistDefVarDatatype(vlistID2, 0, DATATYPE_FLT32);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  array1 = (double *) malloc(gridsize*nlev*sizeof(double));
+  array2 = (double *) malloc(gridsize*nlev*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  offset  = gridsize*levelID;
+	  streamReadRecord(streamID1, array1+offset, &nmiss);
+	  if ( nmiss ) cdoAbort("Missing values unsupported for this operator!");
+	}
+
+      mastrfu(gridID, zaxisID, array1, array2);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  varID = 0;
+	  levelID = recID;
+	  streamDefRecord(streamID2, varID,  levelID);
+	  offset  = gridsize*levelID;
+	  streamWriteRecord(streamID2, array2+offset, nmiss);     
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Math.c b/src/Math.c
new file mode 100644
index 0000000..66f87c8
--- /dev/null
+++ b/src/Math.c
@@ -0,0 +1,216 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Math       abs             Absolute value
+      Math       sqr             Square
+      Math       sqrt            Square root
+      Math       exp             Exponential
+      Math       ln              Natural logarithm
+      Math       log10           Base 10 logarithm
+      Math       sin             Sine
+      Math       cos             Cosine
+      Math       tan             Tangent
+      Math       asin            Arc sine
+      Math       acos            Arc cosine
+      Math       atan            Arc tangent
+      Math       pow             Power
+      Math       reci            Reciprocal
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Math(void *argument)
+{
+  enum {ABS, FINT, FNINT, SQR, SQRT, EXP, LN, LOG10, SIN, COS, TAN, ASIN, ACOS, ATAN, POW, RECI};
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2;
+  int gridsize;
+  int nrecs, recID;
+  int tsID;
+  int varID, levelID;
+  int vlistID1, vlistID2;
+  int nmiss, nmiss2;
+  int i;
+  double missval1;
+  double *array1, *array2;
+  double rc = 0;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("abs",   ABS,   0, NULL);
+  cdoOperatorAdd("int",   FINT,  0, NULL);
+  cdoOperatorAdd("nint",  FNINT, 0, NULL);
+  cdoOperatorAdd("sqr",   SQR,   0, NULL);
+  cdoOperatorAdd("sqrt",  SQRT,  0, NULL);
+  cdoOperatorAdd("exp",   EXP,   0, NULL);
+  cdoOperatorAdd("ln",    LN,    0, NULL);
+  cdoOperatorAdd("log10", LOG10, 0, NULL);
+  cdoOperatorAdd("sin",   SIN,   0, NULL);
+  cdoOperatorAdd("cos",   COS,   0, NULL);
+  cdoOperatorAdd("tan",   TAN,   0, NULL);
+  cdoOperatorAdd("asin",  ASIN,  0, NULL);
+  cdoOperatorAdd("acos",  ACOS,  0, NULL);
+  cdoOperatorAdd("atan",  ATAN,  0, NULL);
+  cdoOperatorAdd("pow",   POW,   0, NULL);
+  cdoOperatorAdd("reci",  RECI,  0, NULL);
+ 
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  if ( operfunc == POW )
+    {
+      operatorInputArg("value");
+      rc = atof(operatorArgv()[0]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  missval1 = vlistInqVarMissval(vlistID1, varID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  switch ( operfunc )
+	    {
+	    case ABS:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) ? missval1 : fabs(array1[i]);
+	      break;
+	    case FINT:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) ? missval1 : (int)(array1[i]);
+	      break;
+	    case FNINT:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) ? missval1 : NINT(array1[i]);
+	      break;
+	    case SQR:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) ? missval1 : array1[i]*array1[i];
+	      break;
+	    case SQRT:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) ? missval1 : SQRT(array1[i]);
+	      break;
+	    case EXP:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) ? missval1 : exp(array1[i]);
+	      break;
+	    case LN:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) || array1[i] < 0 ? missval1 : log(array1[i]);
+	      break;
+	    case LOG10:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) || array1[i] < 0 ? missval1 : log10(array1[i]);
+	      break;
+	    case SIN:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) ? missval1 : sin(array1[i]);
+	      break;
+	    case COS:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) ? missval1 : cos(array1[i]);
+	      break;
+	    case TAN:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) ? missval1 : tan(array1[i]);
+	      break;
+	    case ASIN:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) || array1[i] < -1
+		         || array1[i] > 1 ? missval1 : asin(array1[i]);
+	      break;
+	    case ACOS:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) || array1[i] < -1
+		         || array1[i] > 1 ? missval1 : acos(array1[i]);
+	      break;
+	    case ATAN:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) ? missval1 : atan(array1[i]);
+	      break;
+	    case POW:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) ? missval1 : pow(array1[i], rc);
+	      break;
+	    case RECI:
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array1[i], 0.) ? missval1 : 1/array1[i];
+	      break;
+	    default:
+	      cdoAbort("operator not implemented!");
+	    }
+
+	  nmiss2 = 0;
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( DBL_IS_EQUAL(array2[i], missval1) ) nmiss2++;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array2, nmiss2);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID2);
+
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Merge.c b/src/Merge.c
new file mode 100644
index 0000000..edccb89
--- /dev/null
+++ b/src/Merge.c
@@ -0,0 +1,278 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Merge      merge           Merge datasets with different fields
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+
+static
+void checkDupEntry(int vlistID1, int vlistID2, const char *filename)
+{
+  char vname1[CDI_MAX_NAME], vname2[CDI_MAX_NAME];
+  int k;
+  int gridID1, gridID2;
+  int zaxisID1, zaxisID2;
+  int varID1, varID2;
+  int nvars1, nvars2;
+  int param1, param2;
+  int ztype1, ztype2;
+  int gtype1, gtype2;
+  int nlev1,  nlev2;
+  int gsize1, gsize2;
+  int mlev1 = 0, mlev2 = 0;
+  double *lev1 = NULL, *lev2 = NULL;
+
+  nvars1 = vlistNvars(vlistID1);
+  nvars2 = vlistNvars(vlistID2);
+
+  for ( varID1 = 0; varID1 < nvars1; ++varID1 )
+    {
+      vlistInqVarName(vlistID1, varID1, vname1);
+      param1   = vlistInqVarParam(vlistID1, varID1);
+      gridID1  = vlistInqVarGrid(vlistID1, varID1);
+      zaxisID1 = vlistInqVarZaxis(vlistID1, varID1);
+      gtype1   = gridInqType(gridID1);
+      gsize1   = gridInqSize(gridID1);
+      ztype1   = zaxisInqType(zaxisID1);
+      nlev1    = zaxisInqSize(zaxisID1);
+      if ( nlev1 > mlev1 )
+	{
+	  mlev1 = nlev1;
+	  lev1 = (double *) realloc(lev1, mlev1*sizeof(double));
+	}
+      zaxisInqLevels(zaxisID1, lev1);
+
+      for ( varID2 = 0; varID2 < nvars2; ++varID2 )
+	{
+	  vlistInqVarName(vlistID2, varID2, vname2);
+	  param2   = vlistInqVarParam(vlistID2, varID2);
+	  gridID2  = vlistInqVarGrid(vlistID2, varID2);
+	  zaxisID2 = vlistInqVarZaxis(vlistID2, varID2);
+	  gtype2   = gridInqType(gridID2);
+	  gsize2   = gridInqSize(gridID2);
+	  ztype2   = zaxisInqType(zaxisID2);
+	  nlev2    = zaxisInqSize(zaxisID2);
+	  if ( gtype1 == gtype2 && gsize1 == gsize2 && ztype1 == ztype2 && nlev1 == nlev2 )
+	    {
+	      if ( nlev2 > mlev2 )
+		{
+		  mlev2 = nlev2;
+		  lev2 = (double *) realloc(lev2, mlev2*sizeof(double));
+		}
+	      zaxisInqLevels(zaxisID2, lev2);
+
+	      for ( k = 0; k < nlev2; ++k )
+		if ( !IS_EQUAL(lev1[k], lev2[k]) ) break;
+
+	      if ( k == nlev2 )
+		{
+		  if ( param1 < 0 || param2 < 0 )
+		    {
+		      if ( strcmp(vname1, vname2) == 0 )
+			{
+			  cdoWarning("Duplicate entry of parameter %s in %s!", vname2, filename);
+			}
+		    }
+		  else
+		    {
+		      if ( param1 == param2 )
+			{
+			  char paramstr[32];
+			  cdiParamToString(param2, paramstr, sizeof(paramstr));
+			  cdoWarning("Duplicate entry of parameter %s in %s!", paramstr, filename);
+			}
+		    }
+		}
+	    }
+	}
+    }
+
+  if ( lev1 ) free(lev1);
+  if ( lev2 ) free(lev2);
+}
+
+
+void *Merge(void *argument)
+{
+  int streamID1 = -1, streamID2 = -1;
+  int varID, varID2;
+  int nrecs = 0;
+  int tsID, recID, levelID, levelID2;
+  int index;
+  int streamCnt;
+  int *streamIDs;
+  int *vlistIDs;
+  int vlistID1 = -1, vlistID2;
+  int recID2;
+  int nmerge;
+  int idum = -4711;
+  int lcopy = FALSE;
+  int gridsize;
+  int nmiss;
+  int taxisID1, taxisID2;
+  const char *ofilename;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  streamCnt = cdoStreamCnt();
+  nmerge    = streamCnt - 1;
+
+  ofilename = cdoStreamName(streamCnt-1);
+
+  if ( !cdoSilentMode && !cdoOverwriteMode )
+    if ( fileExists(ofilename) )
+      if ( !userFileOverwrite(ofilename) )
+	cdoAbort("Outputfile %s already exists!", ofilename);
+
+  streamIDs = (int *) malloc(nmerge*sizeof(int));
+  vlistIDs  = (int *) malloc(nmerge*sizeof(int));
+
+  for ( index = 0; index < nmerge; index++ )
+    {
+      streamID1 = streamOpenRead(cdoStreamName(index));
+
+      streamIDs[index] = streamID1;
+
+      vlistID1 = streamInqVlist(streamID1);
+      vlistIDs[index] = vlistID1;
+    }
+
+  vlistID1 = vlistIDs[0];
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+
+  vlistID2 = vlistCreate();
+  vlistCopy(vlistID2, vlistIDs[0]);
+  for ( index = 1; index < nmerge; index++ )
+    {
+      checkDupEntry(vlistID2, vlistIDs[index], cdoStreamName(index));
+      /* vlistCat(vlistID2, vlistIDs[index]); */
+      vlistMerge(vlistID2, vlistIDs[index]);
+    }
+
+  if ( cdoVerbose ) 
+    {
+      for ( index = 0; index < nmerge; index++ ) vlistPrint(vlistIDs[index]);
+      vlistPrint(vlistID2);
+    }
+       
+  streamID2 = streamOpenWrite(ofilename, cdoFiletype());
+
+  vlistDefTaxis(vlistID2, taxisID2);
+  streamDefVlist(streamID2, vlistID2);
+
+  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  tsID = 0;
+  while ( tsID >= 0 )
+    {
+      recID2 = 0;
+      for ( index = 0; index < nmerge; index++ )
+	{
+	  streamID1 = streamIDs[index];
+	  vlistID1  = vlistIDs[index];
+
+	  if ( vlistID1 == idum ) continue;
+
+	  nrecs = streamInqTimestep(streamID1, tsID);
+
+	  if ( nrecs == 0 )
+	    {
+	      if ( tsID == 1 )
+		{
+		  vlistIDs[index] = idum;
+		  continue;
+		}
+	      else
+		{
+		  tsID = idum;
+		  break;
+		}
+	    }
+
+	  if ( index == 0 )
+	    {
+	      taxisCopyTimestep(taxisID2, taxisID1);
+
+	      streamDefTimestep(streamID2, tsID);
+	    }
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+
+	      varID2   = vlistMergedVar(vlistID1, varID);
+	      levelID2 = vlistMergedLevel(vlistID1, varID, levelID);
+
+	      if ( cdoVerbose )	cdoPrint("var %d %d %d %d", varID, levelID, varID2, levelID2);
+
+	      streamDefRecord(streamID2, varID2, levelID2);
+	      if ( lcopy )
+		{
+		  streamCopyRecord(streamID2, streamID1);
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array, &nmiss);
+		  streamWriteRecord(streamID2, array, nmiss);
+		}
+
+	      recID2++;
+	    }
+	}
+      tsID++;
+
+      for ( index = 0; index < nmerge; index++ )
+	if ( vlistIDs[index] != idum ) break;
+
+      if ( index == nmerge ) tsID = idum;
+    }
+
+  for ( index = 0; index < nmerge; index++ )
+    streamClose(streamIDs[index]);
+
+  streamClose(streamID2);
+
+  vlistDestroy(vlistID2);
+
+  if ( streamIDs ) free(streamIDs);
+  if ( vlistIDs  ) free(vlistIDs);
+ 
+  if ( ! lcopy )
+    if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Mergegrid.c b/src/Mergegrid.c
new file mode 100644
index 0000000..db1b6a1
--- /dev/null
+++ b/src/Mergegrid.c
@@ -0,0 +1,295 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+static
+void gen_index(int gridID1, int gridID2, int *index)
+{
+  int nlat1, nlon1;
+  int nlat2, nlon2;
+  int gridtype1, gridtype2;
+  int gridsize1, gridsize2;
+  int i, j, k, i1, i2;
+  int *xindex = NULL, *yindex = NULL;
+  double *xvals1 = NULL, *yvals1 = NULL;
+  double *xvals2 = NULL, *yvals2 = NULL;
+
+  gridtype1 = gridInqType(gridID1);
+  gridtype2 = gridInqType(gridID2);
+
+  gridsize1 = gridInqSize(gridID1);
+  gridsize2 = gridInqSize(gridID2);
+
+  if ( gridtype1 != gridtype2 )
+    cdoAbort("Input streams have different grid types!");
+
+  if ( index == NULL ) cdoAbort("Internal problem, index not allocated!");
+
+  for ( i = 0; i < gridsize2; i++ ) index[i] = -1;
+
+  if ( gridtype1 == GRID_LONLAT || gridtype1 == GRID_GAUSSIAN )
+    {
+      /*
+      if ( gridIsRotated(gridID1) )
+	cdoAbort("Rotated grids unsupported!");
+      */
+      nlon1 = gridInqXsize(gridID1);
+      nlat1 = gridInqYsize(gridID1);
+
+      nlon2 = gridInqXsize(gridID2);
+      nlat2 = gridInqYsize(gridID2);
+
+      if ( ! (gridInqXvals(gridID1, NULL) && gridInqYvals(gridID1, NULL)) )
+	cdoAbort("Grid 1 has no values!");
+
+      if ( ! (gridInqXvals(gridID2, NULL) && gridInqYvals(gridID2, NULL)) )
+	cdoAbort("Grid 2 has no values!");
+
+      xvals1 = (double *) malloc(nlon1*sizeof(double));
+      yvals1 = (double *) malloc(nlat1*sizeof(double));
+      xvals2 = (double *) malloc(nlon2*sizeof(double));
+      yvals2 = (double *) malloc(nlat2*sizeof(double));
+
+      xindex = (int *) malloc(nlon2*sizeof(int));
+      yindex = (int *) malloc(nlat2*sizeof(int));
+
+      gridInqXvals(gridID1, xvals1);
+      gridInqYvals(gridID1, yvals1);
+
+      /* Convert lat/lon units if required */
+      {
+	char units[CDI_MAX_NAME];
+	gridInqXunits(gridID1, units);
+	gridToDegree(units, "grid1 center lon", nlon1, xvals1);
+	gridInqYunits(gridID1, units);
+	gridToDegree(units, "grid1 center lat", nlat1, yvals1);
+      }
+
+      gridInqXvals(gridID2, xvals2);
+      gridInqYvals(gridID2, yvals2);
+
+      /* Convert lat/lon units if required */
+      {
+	char units[CDI_MAX_NAME];
+	gridInqXunits(gridID2, units);
+	gridToDegree(units, "grid2 center lon", nlon2, xvals2);
+	gridInqYunits(gridID2, units);
+	gridToDegree(units, "grid2 center lat", nlat2, yvals2);
+      }
+
+      for ( i2 = 0; i2 < nlat2; i2++ )
+	{
+	  for ( i1 = 0; i1 < nlat1; i1++ )
+	    if ( fabs(yvals2[i2]-yvals1[i1]) < 0.001 ) break;
+
+	  if ( i1 == nlat1 )
+	    yindex[i2] = -1;
+	  else
+            yindex[i2] = i1;
+	}
+
+      for ( i2 = 0; i2 < nlon2; i2++ )
+	{
+	  for ( i1 = 0; i1 < nlon1; i1++ )
+	    if ( fabs(xvals2[i2]-xvals1[i1]) < 0.001 ) break;
+
+	  if ( i1 == nlon1 )
+	    {
+	      if ( xvals2[i2] < 0 )
+		{
+		  for ( i1 = 0; i1 < nlon1; i1++ )
+		    if ( fabs(xvals2[i2]+360-xvals1[i1]) < 0.001 ) break;
+		}
+	      else if ( xvals2[i2] > 180 )
+		{
+		  for ( i1 = 0; i1 < nlon1; i1++ )
+		    if ( fabs(xvals2[i2]-360-xvals1[i1]) < 0.001 ) break;
+		}
+	    }
+
+	  if ( i1 == nlon1 )
+	    xindex[i2] = -1;
+	  else
+            xindex[i2] = i1;
+	}
+      /*
+      for ( i2 = 0; i2 < nlon2; i2++ )
+	printf("x %d %d\n", i2, xindex[i2]);
+
+      for ( i2 = 0; i2 < nlat2; i2++ )
+	printf("y %d %d\n", i2, yindex[i2]);
+      */
+      k = 0;
+      for ( j = 0; j < nlat2; j++ )
+	for ( i = 0; i < nlon2; i++ )
+	  {
+	    if ( xindex[i] == -1 || yindex[j] == -1 )
+	      index[k++] = -1;
+	    else
+	      index[k++] = yindex[j]*nlon1 + xindex[i];
+	  }
+
+
+      free(xindex);
+      free(yindex);
+      free(xvals1);
+      free(yvals1);
+      free(xvals2);
+      free(yvals2);
+    }
+  else
+    cdoAbort("Unsupported grid type: %s", gridNamePtr(gridtype1));
+}
+
+
+void *Mergegrid(void *argument)
+{
+  int varID;
+  int nrecs = 0;
+  int tsID, recID, levelID;
+  int nrecs2;
+  int streamID1, streamID2, streamID3;
+  int vlistID1 , vlistID2, vlistID3;
+  int nmiss1, nmiss2;
+  int gridsize1, gridsize2;
+  int gridID1, gridID2;
+  int taxisID1, taxisID3;
+  int index;
+  int i, *gindex = NULL;
+  int ndiffgrids;
+  double missval1, missval2;
+  double *array1, *array2;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID3 = taxisDuplicate(taxisID1);
+
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID2 = streamInqVlist(streamID2);
+
+  vlistCompare(vlistID1, vlistID2, CMP_CODE | CMP_NLEVEL);
+
+  ndiffgrids = 0;
+  for ( index = 1; index < vlistNgrids(vlistID1); index++ )
+    if ( vlistGrid(vlistID1, 0) != vlistGrid(vlistID1, index) )
+      ndiffgrids++;
+
+  if ( ndiffgrids > 0 ) cdoAbort("Too many different grids in %s!", cdoStreamName(0));
+
+  ndiffgrids = 0;
+  for ( index = 1; index < vlistNgrids(vlistID2); index++ )
+    if ( vlistGrid(vlistID2, 0) != vlistGrid(vlistID2, index))
+      ndiffgrids++;
+
+  if ( ndiffgrids > 0 ) cdoAbort("Too many different grids in %s!", cdoStreamName(1));
+
+  gridID1 = vlistGrid(vlistID1, 0);
+  gridID2 = vlistGrid(vlistID2, 0);
+
+  gridsize1 = gridInqSize(gridID1);
+  gridsize2 = gridInqSize(gridID2);
+
+  array1 = (double *) malloc(gridsize1*sizeof(double));
+  array2 = (double *) malloc(gridsize2*sizeof(double));
+  gindex = (int *) malloc(gridsize2*sizeof(int));
+
+  gen_index(gridID1, gridID2, gindex);
+
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  vlistDefTaxis(vlistID3, taxisID3);
+  streamDefVlist(streamID3, vlistID3);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      nrecs2 = streamInqTimestep(streamID2, tsID);
+      if ( nrecs2 == 0 )
+	cdoAbort("Input streams have different number of timesteps!");
+
+      if ( nrecs != nrecs2 )
+	cdoAbort("Input streams have different number of records!");
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID2, &varID, &levelID);
+	  streamReadRecord(streamID2, array2, &nmiss2);
+
+	  missval2 = vlistInqVarMissval(vlistID2, varID);
+
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss1);
+
+	  missval1 = vlistInqVarMissval(vlistID1, varID);
+
+	  for ( i = 0; i < gridsize2; i++ )
+	    {
+	      if ( gindex[i] >= 0 && !DBL_IS_EQUAL(array2[i], missval2) )
+		{
+		  array1[gindex[i]] = array2[i];
+		}
+	    }
+
+	  if ( nmiss1 )
+	    {
+	      nmiss1 = 0;
+	      for ( i = 0; i < gridsize1; i++ )
+		if ( DBL_IS_EQUAL(array1[i], missval1) ) nmiss1++;
+	    }
+
+	  streamDefRecord(streamID3, varID, levelID);
+	  streamWriteRecord(streamID3, array1, nmiss1);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+ 
+  if ( gindex ) free(gindex);
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Mergetime.c b/src/Mergetime.c
new file mode 100644
index 0000000..37ce681
--- /dev/null
+++ b/src/Mergetime.c
@@ -0,0 +1,229 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Merge      mergetime       Merge datasets sorted by date and time
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+
+void *Mergetime(void *argument)
+{
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int tsID2 = 0, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int nfiles, fileID;
+  int taxisID1, taxisID2 = CDI_UNDEFID;
+  int lcopy = FALSE;
+  int gridsize;
+  int nmiss;
+  int vdate, vtime;
+  int last_vdate = -1, last_vtime = -1;
+  int next_fileID;
+  int skip_same_time = FALSE;
+  char *envstr;
+  const char *ofilename;
+  double *array = NULL;
+  typedef struct
+  {
+    int streamID;
+    int vlistID;
+    int taxisID;
+    int tsID;
+    int vdate;
+    int vtime;
+    int nrecs;
+  } sfile_t;
+  sfile_t *sf = NULL;
+
+  cdoInitialize(argument);
+
+  envstr = getenv("SKIP_SAME_TIME");
+  if ( envstr )
+    {
+      int ival;
+      ival = atoi(envstr);
+      if ( ival == 1 )
+	{
+	  skip_same_time = TRUE;
+	  if ( cdoVerbose )
+	    cdoPrint("Set SKIP_SAME_TIME to %d", ival);
+	}
+    }
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  nfiles = cdoStreamCnt() - 1;
+
+  sf = (sfile_t *) malloc(nfiles*sizeof(sfile_t));
+
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      if ( cdoVerbose ) cdoPrint("process: %s", cdoStreamName(fileID));
+
+      streamID1 = streamOpenRead(cdoStreamName(fileID));
+
+      vlistID1 = streamInqVlist(streamID1);
+      taxisID1 = vlistInqTaxis(vlistID1);
+
+      sf[fileID].streamID = streamID1;
+      sf[fileID].vlistID  = vlistID1;
+      sf[fileID].taxisID  = taxisID1;
+    }
+
+  
+  /* check that the contents is always the same */
+  for ( fileID = 1; fileID < nfiles; fileID++ )
+    vlistCompare(sf[0].vlistID, sf[fileID].vlistID, CMP_ALL);
+
+  /* read the first time step */
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      sf[fileID].tsID = 0;
+      sf[fileID].nrecs = streamInqTimestep(sf[fileID].streamID, sf[fileID].tsID);
+      if ( sf[fileID].nrecs == 0 )
+	{
+	  streamClose(sf[fileID].streamID);
+	  sf[fileID].streamID = -1;
+	}
+      else
+	{
+	  sf[fileID].vdate = taxisInqVdate(sf[fileID].taxisID);
+	  sf[fileID].vtime = taxisInqVtime(sf[fileID].taxisID);
+	}
+    }
+
+  ofilename = cdoStreamName(nfiles);
+
+  if ( !cdoSilentMode && !cdoOverwriteMode )
+    if ( fileExists(ofilename) )
+      if ( !userFileOverwrite(ofilename) )
+	cdoAbort("Outputfile %s already exists!", ofilename);
+
+  streamID2 = streamOpenWrite(ofilename, cdoFiletype());
+
+  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(sf[0].vlistID);
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  while ( TRUE )
+    {
+      next_fileID = -1;
+      vdate = 0;
+      vtime = 0;
+      for ( fileID = 0; fileID < nfiles; fileID++ )
+	{
+	  if ( sf[fileID].streamID != -1 )
+	    if ( next_fileID == -1 || sf[fileID].vdate < vdate ||
+		 (sf[fileID].vdate == vdate && sf[fileID].vtime < vtime) )
+	      {
+		next_fileID = fileID;
+		vdate = sf[fileID].vdate;
+		vtime = sf[fileID].vtime;
+	      }
+	}
+
+      fileID = next_fileID;
+
+      if ( cdoVerbose )
+	cdoPrint("nextstep = %d  vdate = %d  vtime = %d", next_fileID, vdate, vtime);
+
+      if ( next_fileID == -1 ) break;
+
+      if ( skip_same_time )
+	if ( vdate == last_vdate && vtime == last_vtime )
+	  {
+	    char vdatestr[32], vtimestr[32];
+	    date2str(vdate, vdatestr, sizeof(vdatestr));
+	    time2str(vtime, vtimestr, sizeof(vtimestr));
+	    cdoPrint("Timestep %4d in stream %d (%s %s) already exists, skipped!",
+		     sf[fileID].tsID+1, sf[fileID].streamID, vdatestr, vtimestr);
+	    goto SKIP_TIMESTEP;
+	  }
+
+      if ( tsID2 == 0 )
+	{
+	  vlistID1 = sf[0].vlistID;
+	  vlistID2 = vlistDuplicate(vlistID1);
+	  taxisID1 = vlistInqTaxis(vlistID1);
+	  taxisID2 = taxisDuplicate(taxisID1);
+	  vlistDefTaxis(vlistID2, taxisID2);
+	      
+	  streamDefVlist(streamID2, vlistID2);
+	}
+
+      last_vdate = vdate;
+      last_vtime = vtime;
+
+      taxisCopyTimestep(taxisID2, sf[fileID].taxisID);
+
+      streamDefTimestep(streamID2, tsID2);
+	       
+      for ( recID = 0; recID < sf[fileID].nrecs; recID++ )
+	{
+	  streamInqRecord(sf[fileID].streamID, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  
+	  if ( lcopy )
+	    {
+	      streamCopyRecord(streamID2, sf[fileID].streamID); 
+	    }
+	  else
+	    {
+	      streamReadRecord(sf[fileID].streamID, array, &nmiss);
+	      streamWriteRecord(streamID2, array, nmiss);
+	    }
+	}
+
+      tsID2++;
+
+    SKIP_TIMESTEP:
+
+      sf[fileID].nrecs = streamInqTimestep(sf[fileID].streamID, ++sf[fileID].tsID);
+      if ( sf[fileID].nrecs == 0 )
+	{
+	  streamClose(sf[fileID].streamID);
+	  sf[fileID].streamID = -1;
+	}
+      else
+	{
+	  sf[fileID].vdate = taxisInqVdate(sf[fileID].taxisID);
+	  sf[fileID].vtime = taxisInqVtime(sf[fileID].taxisID);
+	}
+    }
+
+  streamClose(streamID2);
+
+  if ( ! lcopy )
+    if ( array ) free(array);
+
+  if ( sf ) free(sf);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Merstat.c b/src/Merstat.c
new file mode 100644
index 0000000..1a7e329
--- /dev/null
+++ b/src/Merstat.c
@@ -0,0 +1,189 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Merstat    mermin          Meridional minimum
+      Merstat    mermax          Meridional maximum
+      Merstat    mersum          Meridional sum
+      Merstat    mermean         Meridional mean
+      Merstat    meravg          Meridional average
+      Merstat    merstd          Meridional standard deviation
+      Merstat    mervar          Meridional variance
+      Merstat    merpctl         Meridional percentiles
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "grid.h"
+#include "pstream.h"
+
+
+void *Merstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridID1, gridID2 = -1, lastgrid = -1;
+  int wstatus = FALSE;
+  int code = 0, oldcode = 0;
+  int nlonmax;
+  int index, ngrids;
+  int recID, nrecs;
+  int tsID, varID, levelID;
+  int lim;
+  int ndiffgrids;
+  int taxisID1, taxisID2;
+  int needWeights = FALSE;
+  field_t field1, field2;
+  /* RQ */
+  int pn = 0;
+  /* QR */
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("mermin",  func_min,  0, NULL);
+  cdoOperatorAdd("mermax",  func_max,  0, NULL);
+  cdoOperatorAdd("mersum",  func_sum,  0, NULL);
+  cdoOperatorAdd("mermean", func_mean, 0, NULL);
+  cdoOperatorAdd("meravg",  func_avg,  0, NULL);
+  cdoOperatorAdd("mervar",  func_var,  0, NULL);
+  cdoOperatorAdd("merstd",  func_std,  0, NULL);
+  /* RQ */
+  cdoOperatorAdd("merpctl", func_pctl, 0, NULL);
+  /* QR */
+ 
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  /* RQ */
+  if ( operfunc == func_pctl )
+    {
+      operatorInputArg("percentile number");
+      pn = atoi(operatorArgv()[0]);
+      
+      if ( pn < 1 || pn > 99 )
+        cdoAbort("Illegal argument: percentile number %d is not in the range 1..99!", pn);
+    }
+  /* QR */
+
+  if ( operfunc == func_mean || operfunc == func_avg ||
+       operfunc == func_var  || operfunc == func_std )
+    needWeights = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids = vlistNgrids(vlistID1);
+  ndiffgrids = 0;
+  for ( index = 1; index < ngrids; index++ )
+    if ( vlistGrid(vlistID1, 0) != vlistGrid(vlistID1, index))
+      ndiffgrids++;
+
+  if ( ndiffgrids > 0 ) cdoAbort("Too many different grids!");
+
+  index = 0;
+  gridID1 = vlistGrid(vlistID1, index);
+
+  if ( gridInqType(gridID1) == GRID_LONLAT   ||
+       gridInqType(gridID1) == GRID_GAUSSIAN ||
+       gridInqType(gridID1) == GRID_GENERIC )
+    {
+      gridID2 = gridToMeridional(gridID1);
+    }
+  else
+    {
+      cdoAbort("Unsupported gridtype: %s", gridNamePtr(gridInqType(gridID1)));
+    }
+
+  vlistChangeGridIndex(vlistID2, index, gridID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridID1 = vlistInqVarGrid(vlistID1, 0);
+  nlonmax = gridInqXsize(gridID1); /* max nlon ? */
+
+  lim = vlistGridsizeMax(vlistID1);
+  field1.ptr    = (double *) malloc(lim*sizeof(double));
+  field1.weight = NULL;
+  if ( needWeights )
+    field1.weight = (double *) malloc(lim*sizeof(double));
+
+  field2.ptr  = (double *) malloc(nlonmax*sizeof(double));
+  field2.grid = gridID2;
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field1.ptr, &field1.nmiss);
+
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID);
+	  if ( needWeights && field1.grid != lastgrid )
+	    {
+	      lastgrid = field1.grid;
+	      wstatus = gridWeights(field1.grid, field1.weight);
+	    }
+	  code = vlistInqVarCode(vlistID1, varID);
+	  if ( wstatus != 0 && tsID == 0 && code != oldcode )
+	    cdoWarning("Using constant area weights for code %d!", oldcode=code);
+
+	  field1.missval = vlistInqVarMissval(vlistID1, varID);
+	  field2.missval = vlistInqVarMissval(vlistID1, varID);
+
+	  /* RQ */
+	  if ( operfunc == func_pctl )
+	    merpctl(field1, & field2, pn);
+	  else  
+	    merfun(field1, &field2, operfunc);
+	  /* QR */  
+
+	  streamDefRecord(streamID2, varID,  levelID);
+	  streamWriteRecord(streamID2, field2.ptr, field2.nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( field1.ptr )    free(field1.ptr);
+  if ( field1.weight ) free(field1.weight);
+  if ( field2.ptr )    free(field2.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Monarith.c b/src/Monarith.c
new file mode 100644
index 0000000..b321f10
--- /dev/null
+++ b/src/Monarith.c
@@ -0,0 +1,195 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Monarith  monadd         Add monthly time series
+      Monarith  monsub         Subtract monthly time series
+      Monarith  monmul         Multiply monthly time series
+      Monarith  mondiv         Divide monthly time series
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Monarith(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2, streamID3;
+  int gridsize;
+  int nrecs, nrecs2, nvars, nlev, recID;
+  int tsID, tsID2;
+  int varID, levelID;
+  int offset;
+  int vlistID1, vlistID2, vlistID3;
+  int taxisID1, taxisID2, taxisID3;
+  int vdate;
+  int yearmon1, yearmon2 = -1;
+  field_t field1, field2;
+  int **varnmiss2;
+  double **vardata2;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("monadd", func_add, 0, NULL);
+  cdoOperatorAdd("monsub", func_sub, 0, NULL);
+  cdoOperatorAdd("monmul", func_mul, 0, NULL);
+  cdoOperatorAdd("mondiv", func_div, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+  
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  nvars  = vlistNvars(vlistID2);
+
+  vardata2  = (double **) malloc(nvars*sizeof(double *));
+  varnmiss2 = (int **) malloc(nvars*sizeof(int *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+      nlev     = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+      vardata2[varID]  = (double *) malloc(nlev*gridsize*sizeof(double));
+      varnmiss2[varID] = (int *) malloc(nlev*sizeof(int));
+    }
+
+  tsID  = 0;
+  tsID2 = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+
+      yearmon1 = vdate / 100;
+
+      if ( yearmon1 != yearmon2 )
+	{
+	  int year1, mon1;
+
+	  year1 = yearmon1/100;
+	  mon1  = yearmon1 - (yearmon1/100)*100;
+
+	  if ( cdoVerbose ) cdoPrint("Process: Year = %4d  Month = %2d", year1, mon1);
+
+	  nrecs2 = streamInqTimestep(streamID2, tsID2);
+	  if ( nrecs2 == 0 )
+	    cdoAbort("Missing year=%4d mon=%2d in %s!", year1, mon1, cdoStreamName(1));
+
+	  vdate = taxisInqVdate(taxisID2);
+
+	  yearmon2 = vdate / 100;
+
+	  if ( yearmon1 != yearmon2 )
+	    {
+	      int year2, mon2;
+
+	      year2 = yearmon2/100;
+	      mon2  = yearmon2 - (yearmon2/100)*100;
+
+	      cdoAbort("Timestep %d in %s has wrong date!\nCurrent year=%4d mon=%2d, expected year=%4d mon=%2d",
+		       tsID2+1, cdoStreamName(1), year2, mon2, year1, mon1);
+	    }
+
+	  for ( recID = 0; recID < nrecs2; recID++ )
+	    {
+	      streamInqRecord(streamID2, &varID, &levelID);
+
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	      offset   = gridsize*levelID;
+
+	      streamReadRecord(streamID2, vardata2[varID]+offset, &field2.nmiss);
+	      varnmiss2[varID][levelID] = field2.nmiss;
+	    }
+
+	  tsID2++;
+	}
+
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field1.ptr, &field1.nmiss);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  offset   = gridsize*levelID;
+	  memcpy(field2.ptr, vardata2[varID]+offset, gridsize*sizeof(double));
+	  field2.nmiss = varnmiss2[varID][levelID];
+
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID);
+	  field1.missval = vlistInqVarMissval(vlistID1, varID);
+
+	  field2.grid    = vlistInqVarGrid(vlistID2, varID);
+	  field2.missval = vlistInqVarMissval(vlistID2, varID);
+
+	  farfun(&field1, field2, operfunc);
+
+	  streamDefRecord(streamID3, varID, levelID);
+	  streamWriteRecord(streamID3, field1.ptr, field1.nmiss);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      free(vardata2[varID]);
+      free(varnmiss2[varID]);
+    }
+
+  free(vardata2);
+  free(varnmiss2);
+
+  if ( field1.ptr ) free(field1.ptr);
+  if ( field2.ptr ) free(field2.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Mrotuv.c b/src/Mrotuv.c
new file mode 100644
index 0000000..879c3c6
--- /dev/null
+++ b/src/Mrotuv.c
@@ -0,0 +1,442 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Mrotuv      mrotuv          Forward rotation for MPIOM data
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+void rotate_uv(double *u_i, double *v_j, int ix, int iy,
+	       double *lon, double *lat, double *u_lon, double *v_lat)
+{
+  /*
+ real,intent(in)      :: u_i(ix,iy,iz),v_j(ix,iy,iz)                  ! vector components in i-j-direction
+ real,intent(out)     :: u_lon(ix,iy,iz),v_lat(ix,iy,iz)              ! vector components in lon-lat direction
+ real,intent(in)      :: lat(ix,iy),lon(ix,iy)                        ! latitudes and longitudes
+  */
+  double dlat_i, dlat_j,dlon_i,dlon_j,dist_i,dist_j;
+  double lat_factor;
+  double absold, absnew;  /* velocity vector lengths */
+  int  i, j, ip1, im1, jp1, jm1;
+  int  change_sign_u, change_sign_v;
+  double pi = 3.14159265359;
+
+
+  /* specification whether change in sign is needed for the input arrays */
+  change_sign_u = FALSE;
+  change_sign_v = TRUE;
+
+  /* initialization */
+  for ( i = 0; i < ix*iy; i++ )
+    {
+      v_lat[i] = 0;
+      u_lon[i] = 0;
+    }
+
+  /* rotation */
+  for ( j = 0; j < iy; j++ )
+    for ( i = 0; i < ix; i++ )
+      {
+	ip1 = i + 1;
+	im1 = i - 1;
+	jp1 = j + 1;
+	jm1 = j - 1;
+	if ( ip1 >= ix ) ip1 = 0;   /* the 0-meridian */
+	if ( im1 <   0 ) im1 = ix-1;
+	if ( jp1 >= iy ) jp1 = j;   /* treatment of the last..  */
+	if ( jm1 <   0 ) jm1 = j;   /* .. and the fist grid-row */
+
+	/* difference in latitudes */
+	dlat_i = lat[IX2D(j,ip1,ix)] - lat[IX2D(j,im1,ix)];
+	dlat_j = lat[IX2D(jp1,i,ix)] - lat[IX2D(jm1,i,ix)];
+
+	/* difference in longitudes */
+	dlon_i = lon[IX2D(j,ip1,ix)] - lon[IX2D(j,im1,ix)];
+	if ( dlon_i >   pi  ) dlon_i -= 2*pi;
+	if ( dlon_i < (-pi) ) dlon_i += 2*pi;
+	dlon_j = lon[IX2D(jp1,i,ix)] - lon[IX2D(jm1,i,ix)];
+	if ( dlon_j >   pi  ) dlon_j -= 2*pi;
+	if ( dlon_j < (-pi) ) dlon_j += 2*pi;
+
+	lat_factor = cos(lat[IX2D(j,i,ix)]);
+	dlon_i = dlon_i * lat_factor;
+	dlon_j = dlon_j * lat_factor;
+
+	/* projection by scalar product */
+	u_lon[IX2D(j,i,ix)] = u_i[IX2D(j,i,ix)]*dlon_i + v_j[IX2D(j,i,ix)]*dlat_i;
+	v_lat[IX2D(j,i,ix)] = u_i[IX2D(j,i,ix)]*dlon_j + v_j[IX2D(j,i,ix)]*dlat_j;
+
+	dist_i = sqrt(dlon_i*dlon_i + dlat_i*dlat_i);
+	dist_j = sqrt(dlon_j*dlon_j + dlat_j*dlat_j);
+
+	if ( fabs(dist_i) > 0 && fabs(dist_j) > 0 )
+	  {
+	    u_lon[IX2D(j,i,ix)] /= dist_i;
+	    v_lat[IX2D(j,i,ix)] /= dist_j;
+	  }
+	else
+	  {
+	    u_lon[IX2D(j,i,ix)] = 0.0;
+	    v_lat[IX2D(j,i,ix)] = 0.0;
+	  }
+
+	absold = sqrt(u_i[IX2D(j,i,ix)]*u_i[IX2D(j,i,ix)] + v_j[IX2D(j,i,ix)]*v_j[IX2D(j,i,ix)]);
+	absnew = sqrt(u_lon[IX2D(j,i,ix)]*u_lon[IX2D(j,i,ix)] + v_lat[IX2D(j,i,ix)]*v_lat[IX2D(j,i,ix)]);
+
+	u_lon[IX2D(j,i,ix)] *= absold;
+	v_lat[IX2D(j,i,ix)] *= absold;
+
+	if ( absnew > 0 )
+	  {
+	    u_lon[IX2D(j,i,ix)] /= absnew;
+	    v_lat[IX2D(j,i,ix)] /= absnew;
+	  }
+	else
+	  {
+	    u_lon[IX2D(j,i,ix)] = 0.0;
+	    v_lat[IX2D(j,i,ix)] = 0.0;
+	  }
+
+	/* change sign */
+	if ( change_sign_u ) u_lon[IX2D(j,i,ix)] *= -1;
+	if ( change_sign_v ) v_lat[IX2D(j,i,ix)] *= -1;
+
+	if ( cdoVerbose )
+	  {
+	    absold = sqrt(u_i[IX2D(j,i,ix)]*u_i[IX2D(j,i,ix)] + v_j[IX2D(j,i,ix)]*v_j[IX2D(j,i,ix)]);
+	    absnew = sqrt(u_lon[IX2D(j,i,ix)]*u_lon[IX2D(j,i,ix)] + v_lat[IX2D(j,i,ix)]*v_lat[IX2D(j,i,ix)]);
+
+	    if ( i%20 == 0 && j%20 == 0 && absold > 0 )
+	      {
+		printf("(absold,absnew) %d %d %g %g %g %g %g %g\n",
+		       j+1, i+1, absold, absnew, u_i[IX2D(j,i,ix)], v_j[IX2D(j,i,ix)], u_lon[IX2D(j,i,ix)], v_lat[IX2D(j,i,ix)]);
+		
+		/* test orthogonality */
+		if ( (dlon_i*dlon_j + dlat_j*dlat_i) > 0.1 )            
+		  fprintf(stderr, "orthogonal? %d %d %g\n", j+1, i+1, (dlon_i*dlon_j + dlat_j*dlat_i));
+	      }
+	  }
+      }
+}
+
+
+void p_to_uv_grid(int nlon, int nlat, double *grid1x, double *grid1y,
+		  double *gridux, double *griduy, double *gridvx, double *gridvy)
+{
+  int i, j, jp1, ip1;
+
+  
+  /* interpolate scalar to u points */
+  for ( j = 0; j < nlat; j++ )
+    for ( i = 0; i < nlon; i++ )
+      {
+	ip1 = i + 1;
+	if ( ip1 > nlon-1 ) ip1 = 0;
+
+	gridux[IX2D(j,i,nlon)] = (grid1x[IX2D(j,i,nlon)]+grid1x[IX2D(j,ip1,nlon)])*0.5;
+	if ( (grid1x[IX2D(j,i,nlon)] > 340 && grid1x[IX2D(j,ip1,nlon)] <  20) ||
+             (grid1x[IX2D(j,i,nlon)] < 20  && grid1x[IX2D(j,ip1,nlon)] > 340) )
+	  {
+	    if ( gridux[IX2D(j,i,nlon)] < 180 )
+	      gridux[IX2D(j,i,nlon)] += 180;
+	    else
+	      gridux[IX2D(j,i,nlon)] -= 180;
+	  }
+	    
+	griduy[IX2D(j,i,nlon)] = (grid1y[IX2D(j,i,nlon)]+grid1y[IX2D(j,ip1,nlon)])*0.5;
+      }
+
+  
+  /* interpolate scalar to v points */
+  for ( j = 0; j < nlat; j++ )
+    for ( i = 0; i < nlon; i++ )
+      {
+	jp1 = j + 1;
+	if ( jp1 > nlat-1 ) jp1 = nlat-1;
+
+	gridvx[IX2D(j,i,nlon)] = (grid1x[IX2D(j,i,nlon)]+grid1x[IX2D(jp1,i,nlon)])*0.5;
+	if ( (grid1x[IX2D(j,i,nlon)] > 340 && grid1x[IX2D(jp1,i,nlon)] <  20) ||
+             (grid1x[IX2D(j,i,nlon)] < 20  && grid1x[IX2D(jp1,i,nlon)] > 340) )
+	  {
+	    if ( gridvx[IX2D(j,i,nlon)] < 180 )
+	      gridvx[IX2D(j,i,nlon)] += 180;
+	    else
+	      gridvx[IX2D(j,i,nlon)] -= 180;
+	  }
+	    
+	gridvy[IX2D(j,i,nlon)] = (grid1y[IX2D(j,i,nlon)]+grid1y[IX2D(jp1,i,nlon)])*0.5;
+      }
+}
+
+
+void *Mrotuv(void *argument)
+{
+  int streamID1, streamID2, streamID3;
+  int nrecs;
+  int tsID, recID, levelID;
+  int varID, varid;
+  int lid, nlevs, code;
+  int nvars;
+  int gridID1, gridID2, gridIDu, gridIDv;
+  int gridsize, gridsizex;
+  int nlon, nlat;
+  int vlistID1, vlistID2, vlistID3;
+  int i, j;
+  int taxisID1, taxisID2, taxisID3;
+  int nmiss1, nmiss2;
+  int uid = -1, vid = -1;
+  double missval1, missval2;
+  double *ufield = NULL, *vfield = NULL;
+  double **urfield = NULL, **vrfield = NULL;
+  double *uhelp = NULL, *vhelp = NULL;
+  double *grid1x = NULL, *gridux = NULL, *gridvx = NULL;
+  double *grid1y = NULL, *griduy = NULL, *gridvy = NULL;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  nvars = vlistNvars(vlistID1);
+  for ( varid = 0; varid < nvars; varid++ )
+    {
+      code = vlistInqVarCode(vlistID1, varid);
+      if ( code == 3 || code == 131 ) uid = varid;
+      if ( code == 4 || code == 132 ) vid = varid;
+    }
+
+  if ( uid == -1 || vid == -1 )
+    {
+      if ( nvars == 2 )
+	{
+	  uid = 0;
+	  vid = 1;
+	}
+      else
+	cdoAbort("U and V not found in %s",  cdoStreamName(0));
+    }
+
+  nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, uid));
+  if ( nlevs != zaxisInqSize(vlistInqVarZaxis(vlistID1, vid)) )
+    cdoAbort("U and V have different number of levels!");
+
+  gridID1 = vlistInqVarGrid(vlistID1, uid);
+  gridID2 = vlistInqVarGrid(vlistID1, vid);
+  gridsize = gridInqSize(gridID1);
+  if ( gridID1 != gridID2 ) cdoAbort("Input grids differ!");
+
+  if ( gridInqType(gridID1) != GRID_LONLAT      &&
+       gridInqType(gridID1) != GRID_GAUSSIAN    &&
+       gridInqType(gridID1) != GRID_CURVILINEAR )
+    cdoAbort("Grid %s unsupported!", gridNamePtr(gridInqType(gridID1)));
+  
+  if ( gridInqType(gridID1) != GRID_CURVILINEAR )
+    gridID1 = gridToCurvilinear(gridID1, 0);
+
+  if ( gridsize != gridInqSize(gridID1) ) cdoAbort("Internal problem: gridsize changed!");
+
+  nlon    = gridInqXsize(gridID1);
+  nlat    = gridInqYsize(gridID1);
+
+  grid1x  = (double *) malloc(gridsize*sizeof(double));
+  grid1y  = (double *) malloc(gridsize*sizeof(double));
+  gridux  = (double *) malloc(gridsize*sizeof(double));
+  griduy  = (double *) malloc(gridsize*sizeof(double));
+  gridvx  = (double *) malloc(gridsize*sizeof(double));
+  gridvy  = (double *) malloc(gridsize*sizeof(double));
+
+  gridsizex = (nlon+2)*nlat;
+
+  gridInqXvals(gridID1, grid1x);
+  gridInqYvals(gridID1, grid1y);
+
+  /* Convert lat/lon units if required */
+  {
+    char units[CDI_MAX_NAME];
+    gridInqXunits(gridID1, units);
+    gridToDegree(units, "grid center lon", gridsize, grid1x);
+    gridInqYunits(gridID1, units);
+    gridToDegree(units, "grid center lat", gridsize, grid1y);
+  }
+
+  p_to_uv_grid(nlon, nlat, grid1x, grid1y, gridux, griduy, gridvx, gridvy);
+
+  gridIDu = gridCreate(GRID_CURVILINEAR, nlon*nlat);
+  gridDefPrec(gridIDu, gridInqPrec(gridID1));
+  gridDefXsize(gridIDu, nlon);
+  gridDefYsize(gridIDu, nlat);
+  gridDefXvals(gridIDu, gridux);
+  gridDefYvals(gridIDu, griduy);
+
+  gridIDv = gridCreate(GRID_CURVILINEAR, nlon*nlat);
+  gridDefPrec(gridIDv, gridInqPrec(gridID1));
+  gridDefXsize(gridIDv, nlon);
+  gridDefYsize(gridIDv, nlat);
+  gridDefXvals(gridIDv, gridvx);
+  gridDefYvals(gridIDv, gridvy);
+
+  for ( i = 0; i < gridsize; i++ )
+    {
+      grid1x[i] *= DEG2RAD;
+      grid1y[i] *= DEG2RAD;
+    }
+
+  vlistClearFlag(vlistID1);
+  for ( lid = 0; lid < nlevs; lid++ ) vlistDefFlag(vlistID1, uid, lid, TRUE);
+  vlistID2 = vlistCreate();
+  vlistCopyFlag(vlistID2, vlistID1);
+  vlistChangeVarGrid(vlistID2, 0, gridIDu);
+
+  vlistClearFlag(vlistID1);
+  for ( lid = 0; lid < nlevs; lid++ ) vlistDefFlag(vlistID1, vid, lid, TRUE);
+  vlistID3 = vlistCreate();
+  vlistCopyFlag(vlistID3, vlistID1);
+  vlistChangeVarGrid(vlistID3, 0, gridIDv);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+  streamDefVlist(streamID3, vlistID3);
+
+  missval1 = vlistInqVarMissval(vlistID1, uid);
+  missval2 = vlistInqVarMissval(vlistID1, vid);
+
+  ufield  = (double *) malloc(gridsize*sizeof(double));
+  vfield  = (double *) malloc(gridsize*sizeof(double));
+
+  urfield  = (double **) malloc(nlevs*sizeof(double*));
+  vrfield  = (double **) malloc(nlevs*sizeof(double*));
+  for ( lid = 0; lid < nlevs; lid++ )
+    {
+      urfield[lid] = (double *) malloc(gridsize*sizeof(double));
+      vrfield[lid] = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  uhelp   = (double *) malloc(gridsizex*sizeof(double));
+  vhelp   = (double *) malloc(gridsizex*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+      streamDefTimestep(streamID2, tsID);
+      taxisCopyTimestep(taxisID3, taxisID1);
+      streamDefTimestep(streamID3, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( varID == uid ) streamReadRecord(streamID1, urfield[levelID], &nmiss1);
+	  if ( varID == vid ) streamReadRecord(streamID1, vrfield[levelID], &nmiss2);
+	}
+
+      for ( levelID = 0; levelID < nlevs; levelID++ )
+	{
+	  /* remove missing values */
+	  if ( nmiss1 || nmiss2 )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		{
+		  if ( DBL_IS_EQUAL(urfield[levelID][i], missval1) ) urfield[levelID][i] = 0;
+		  if ( DBL_IS_EQUAL(vrfield[levelID][i], missval2) ) vrfield[levelID][i] = 0;
+		}
+	    }
+
+	  /* rotate*/
+	  
+	  rotate_uv(urfield[levelID], vrfield[levelID], nlon, nlat, grid1x, grid1y, ufield, vfield);
+
+	  /* load to a help field */
+	  for ( j = 0; j < nlat; j++ )
+	    for ( i = 0; i < nlon; i++ )
+	      {
+		uhelp[IX2D(j,i+1,nlon+2)] = ufield[IX2D(j,i,nlon)];
+		vhelp[IX2D(j,i+1,nlon+2)] = vfield[IX2D(j,i,nlon)];
+	      }
+
+	  /* make help field cyclic */
+	  for ( j = 0; j < nlat; j++ )
+	    {
+	      uhelp[IX2D(j,0,nlon+2)]      = uhelp[IX2D(j,nlon,nlon+2)];
+	      uhelp[IX2D(j,nlon+1,nlon+2)] = uhelp[IX2D(j,1,nlon+2)];
+	      vhelp[IX2D(j,0,nlon+2)]      = vhelp[IX2D(j,nlon,nlon+2)];
+	      vhelp[IX2D(j,nlon+1,nlon+2)] = vhelp[IX2D(j,1,nlon+2)];
+	    }
+
+	  /* interpolate on u/v points */
+	  for ( j = 0; j < nlat; j++ )
+	    for ( i = 0; i < nlon; i++ )
+	      {
+		ufield[IX2D(j,i,nlon)] = (uhelp[IX2D(j,i+1,nlon+2)]+uhelp[IX2D(j,i+2,nlon+2)])*0.5;
+	      }
+
+	  for ( j = 0; j < nlat-1; j++ )
+	    for ( i = 0; i < nlon; i++ )
+	      {
+		vfield[IX2D(j,i,nlon)] = (vhelp[IX2D(j,i+1,nlon+2)]+vhelp[IX2D(j+1,i+1,nlon+2)])*0.5;
+	      }
+
+	  for ( i = 0; i < nlon; i++ )
+	    {
+	      vfield[IX2D(nlat-1,i,nlon)] = vhelp[IX2D(nlat-1,i+1,nlon+2)];
+	    }
+
+	  streamDefRecord(streamID2, 0, levelID);
+	  streamWriteRecord(streamID2, ufield, nmiss1);     
+	  streamDefRecord(streamID3, 0, levelID);
+	  streamWriteRecord(streamID3, vfield, nmiss2);     
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( ufield  ) free(ufield);
+  if ( vfield  ) free(vfield);
+  if ( urfield ) free(urfield);
+  if ( vrfield ) free(vrfield);
+  if ( uhelp   ) free(uhelp);
+  if ( vhelp   ) free(vhelp);
+  if ( gridux  ) free(gridux);
+  if ( griduy  ) free(griduy);
+  if ( gridvx  ) free(gridvx);
+  if ( gridvy  ) free(gridvy);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Mrotuvb.c b/src/Mrotuvb.c
new file mode 100644
index 0000000..a3211ad
--- /dev/null
+++ b/src/Mrotuvb.c
@@ -0,0 +1,518 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Mrotuvb     mrotuvb          Backward rotation for MPIOM data
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+/*
+!----------------------------------------------------------------------
+!
+!     rotation of vectors: in ocean models with rotated grids velocity
+!     vectors are given in the direction of grid lines and rows. they
+!     have to be rotated in latitudinal and longitudinal direction.
+!
+!     note: this routine assumes positive meridional flow for a flow
+!           from grid point(i,j) to grid point(i,j+1) and positive
+!           zonal flow for a flow from grid point(i,j) to point(i+1,j).
+!           this is not the case for mpi-om!
+!
+!           if this routine is used to rotate data of mpi-om, the
+!           logical change_sign_v needs to be true.
+!j. jungclaus: 22.01.04:
+!note here for the coupling fields u-i,v_j are on the non-verlapping
+! (ie-2=ix) grid, furthermore, the velocity fields were previously
+! interpolated onto the scalar points !
+!
+!h.haak: 07.10.2005 vectorisation and omp directives
+!malte: use outside mpiom 02.06.2006     
+!----------------------------------------------------------------------
+*/
+
+void rotate_uv2(double *u_i, double *v_j, int ix, int iy,
+		double *lon, double *lat, double *u_lon, double *v_lat)
+{
+  /*
+ real,intent(in)      :: u_i(ix,iy,iz),v_j(ix,iy,iz)                  ! vector components in i-j-direction
+ real,intent(out)     :: u_lon(ix,iy,iz),v_lat(ix,iy,iz)              ! vector components in lon-lat direction
+ real,intent(in)      :: lat(ix,iy),lon(ix,iy)                        ! latitudes and longitudes
+  */
+  double dlat_i, dlat_j,dlon_i,dlon_j,dist_i,dist_j;
+  double lat_factor;
+  double absold, absnew;  /* velocity vector lengths */
+  int  i, j, ip1, im1, jp1, jm1;
+  int  change_sign_u, change_sign_v;
+  double pi = 3.14159265359;
+
+
+  /* specification whether change in sign is needed for the input arrays */
+  change_sign_u = FALSE;
+  change_sign_v = TRUE;
+
+  /* initialization */
+  for ( i = 0; i < ix*iy; i++ )
+    {
+      v_lat[i] = 0;
+      u_lon[i] = 0;
+    }
+
+  /* change sign */
+  if ( change_sign_u )
+    for ( i = 0; i < ix*iy; i++ ) u_i[i] *= -1;
+
+  if ( change_sign_v )
+    for ( i = 0; i < ix*iy; i++ ) v_j[i] *= -1;
+
+  /* rotation */
+  for ( j = 0; j < iy; j++ )
+    for ( i = 0; i < ix; i++ )
+      {
+	ip1 = i + 1;
+	im1 = i - 1;
+	jp1 = j + 1;
+	jm1 = j - 1;
+	if ( ip1 >= ix ) ip1 = 0;   /* the 0-meridian */
+	if ( im1 <   0 ) im1 = ix-1;
+	if ( jp1 >= iy ) jp1 = j;   /* treatment of the last..  */
+	if ( jm1 <   0 ) jm1 = j;   /* .. and the fist grid-row */
+
+	/* difference in latitudes */
+	dlat_i = lat[IX2D(j,ip1,ix)] - lat[IX2D(j,im1,ix)];
+	dlat_j = lat[IX2D(jp1,i,ix)] - lat[IX2D(jm1,i,ix)];
+
+	/* difference in longitudes */
+	dlon_i = lon[IX2D(j,ip1,ix)] - lon[IX2D(j,im1,ix)];
+	if ( dlon_i >   pi  ) dlon_i -= 2*pi;
+	if ( dlon_i < (-pi) ) dlon_i += 2*pi;
+	dlon_j = lon[IX2D(jp1,i,ix)] - lon[IX2D(jm1,i,ix)];
+	if ( dlon_j >   pi  ) dlon_j -= 2*pi;
+	if ( dlon_j < (-pi) ) dlon_j += 2*pi;
+
+	lat_factor = cos(lat[IX2D(j,i,ix)]);
+	dlon_i = dlon_i * lat_factor;
+	dlon_j = dlon_j * lat_factor;
+
+	/* projection by scalar product */
+	u_lon[IX2D(j,i,ix)] = u_i[IX2D(j,i,ix)]*dlon_i + v_j[IX2D(j,i,ix)]*dlat_i;
+	v_lat[IX2D(j,i,ix)] = u_i[IX2D(j,i,ix)]*dlon_j + v_j[IX2D(j,i,ix)]*dlat_j;
+
+	dist_i = sqrt(dlon_i*dlon_i + dlat_i*dlat_i);
+	dist_j = sqrt(dlon_j*dlon_j + dlat_j*dlat_j);
+
+	if ( fabs(dist_i) > 0 && fabs(dist_j) > 0 )
+	  {
+	    u_lon[IX2D(j,i,ix)] /= dist_i;
+	    v_lat[IX2D(j,i,ix)] /= dist_j;
+	  }
+	else
+	  {
+	    u_lon[IX2D(j,i,ix)] = 0.0;
+	    v_lat[IX2D(j,i,ix)] = 0.0;
+	  }
+
+	if ( cdoVerbose )
+	  {
+	    absold = sqrt(u_i[IX2D(j,i,ix)]*u_i[IX2D(j,i,ix)] + v_j[IX2D(j,i,ix)]*v_j[IX2D(j,i,ix)]);
+	    absnew = sqrt(u_lon[IX2D(j,i,ix)]*u_lon[IX2D(j,i,ix)] + v_lat[IX2D(j,i,ix)]*v_lat[IX2D(j,i,ix)]);
+
+	    if ( i%20 == 0 && j%20 == 0 && absold > 0 )
+	      {
+		printf("(absold,absnew) %d %d %g %g %g %g %g %g\n",
+		       j+1, i+1, absold, absnew, u_i[IX2D(j,i,ix)], v_j[IX2D(j,i,ix)], u_lon[IX2D(j,i,ix)], v_lat[IX2D(j,i,ix)]);
+		
+		/* test orthogonality */
+		if ( (dlon_i*dlon_j + dlat_j*dlat_i) > 0.1 )            
+		  fprintf(stderr, "orthogonal? %d %d %g\n", j+1, i+1, (dlon_i*dlon_j + dlat_j*dlat_i));
+	      }
+	  }
+      }
+}
+
+
+static
+void uv_to_p_grid(int nlon, int nlat, double *grid1x, double *grid1y, 
+		  double *grid2x, double *grid2y, double *grid3x, double *grid3y)
+{
+  int gridsizex;
+  int i, j;
+  double gx, gy;
+  double gx2, gy2;
+  double *gxhelp, *gyhelp;
+
+  gridsizex = (nlon+2)*nlat;
+  gxhelp  = (double *) malloc(gridsizex*sizeof(double));
+  gyhelp  = (double *) malloc(gridsizex*sizeof(double));
+
+  /* load to a help field */
+  for ( j = 0; j < nlat; j++ )
+    for ( i = 0; i < nlon; i++ )
+      {
+	gxhelp[IX2D(j,i+1,nlon+2)] = grid1x[IX2D(j,i,nlon)];
+	gyhelp[IX2D(j,i+1,nlon+2)] = grid1y[IX2D(j,i,nlon)];
+      }
+
+  /* make help field cyclic */
+  for ( j = 0; j < nlat; j++ )
+    {
+      gxhelp[IX2D(j,0,nlon+2)]      = gxhelp[IX2D(j,nlon,nlon+2)];
+      gxhelp[IX2D(j,nlon+1,nlon+2)] = gxhelp[IX2D(j,1,nlon+2)];
+      gyhelp[IX2D(j,0,nlon+2)]      = gyhelp[IX2D(j,nlon,nlon+2)];
+      gyhelp[IX2D(j,nlon+1,nlon+2)] = gyhelp[IX2D(j,1,nlon+2)];
+    }
+
+  /* interpolate u to scalar points */
+  for ( j = 0; j < nlat; j++ )
+    for ( i = 0; i < nlon; i++ )
+      {
+	grid3x[IX2D(j,i,nlon)] = (gxhelp[IX2D(j,i,nlon+2)]+gxhelp[IX2D(j,i+1,nlon+2)])*0.5;
+	if ( (gxhelp[IX2D(j,i,nlon+2)] > 340 && gxhelp[IX2D(j,i+1,nlon+2)] <  20) ||
+             (gxhelp[IX2D(j,i,nlon+2)] < 20  && gxhelp[IX2D(j,i+1,nlon+2)] > 340) )
+	  {
+	    if ( grid3x[IX2D(j,i,nlon)] < 180 )
+	      grid3x[IX2D(j,i,nlon)] += 180;
+	    else
+	      grid3x[IX2D(j,i,nlon)] -= 180;
+	  }
+	    
+	grid3y[IX2D(j,i,nlon)] = (gyhelp[IX2D(j,i,nlon+2)]+gyhelp[IX2D(j,i+1,nlon+2)])*0.5;
+      }
+
+  /* load to a help field */
+  for ( j = 0; j < nlat; j++ )
+    for ( i = 0; i < nlon; i++ )
+      {
+	gxhelp[IX2D(j,i+1,nlon+2)] = grid2x[IX2D(j,i,nlon)];
+	gyhelp[IX2D(j,i+1,nlon+2)] = grid2y[IX2D(j,i,nlon)];
+      }
+
+  /* make help field cyclic */
+  for ( j = 0; j < nlat; j++ )
+    {
+      gxhelp[IX2D(j,0,nlon+2)]      = gxhelp[IX2D(j,nlon,nlon+2)];
+      gxhelp[IX2D(j,nlon+1,nlon+2)] = gxhelp[IX2D(j,1,nlon+2)];
+      gyhelp[IX2D(j,0,nlon+2)]      = gyhelp[IX2D(j,nlon,nlon+2)];
+      gyhelp[IX2D(j,nlon+1,nlon+2)] = gyhelp[IX2D(j,1,nlon+2)];
+    }
+
+  /* interpolate v to scalar points */
+  for ( j = 1; j < nlat-1; j++ )
+    for ( i = 0; i < nlon; i++ )
+      {
+	gx = (gxhelp[IX2D(j,i+1,nlon+2)]+gxhelp[IX2D(j-1,i+1,nlon+2)])*0.5;
+	if ( (gxhelp[IX2D(j,i+1,nlon+2)] > 340 && gxhelp[IX2D(j-1,i+1,nlon+2)] <  20) ||
+             (gxhelp[IX2D(j,i+1,nlon+2)] < 20  && gxhelp[IX2D(j-1,i+1,nlon+2)] > 340) )
+	  {
+	    if ( gx < 180 )
+	      gx += 180;
+	    else
+	      gx -= 180;
+	  }
+	    
+	gy = (gyhelp[IX2D(j,i+1,nlon+2)]+gyhelp[IX2D(j-1,i+1,nlon+2)])*0.5;
+       
+	/* printf("%d %d %g %g %g %g \n", j, i, gx, gy, grid3x[IX2D(j,i,nlon)], grid3y[IX2D(j,i,nlon)]); */
+
+	gx2 = (gx+grid3x[IX2D(j,i,nlon)])*0.5;
+	if ( (gx > 340 && grid3x[IX2D(j,i,nlon)] <  20) ||
+             (gx < 20  && grid3x[IX2D(j,i,nlon)] > 340) )
+	  {
+	    if ( gx2 < 180 )
+	      gx2 += 180;
+	    else
+	      gx2 -= 180;
+	  }
+	    
+	gy2 = (gy+grid3y[IX2D(j,i,nlon)])*0.5;
+
+	grid3x[IX2D(j,i,nlon)] = gx2;
+	grid3y[IX2D(j,i,nlon)] = gy2;
+
+	/* printf("%d %d %g %g %g %g \n", j, i, gx2, gy2, grid3x[IX2D(j,i,nlon)], grid3y[IX2D(j,i,nlon)]); */
+      }
+
+  free(gxhelp);
+  free(gyhelp);
+}
+
+
+
+void *Mrotuvb(void *argument)
+{
+  int streamID1, streamID2, streamID3;
+  int nrecs, nrecs2;
+  int tsID, recID, levelID;
+  int varID1, varID2;
+  int nvars;
+  int gridID1, gridID2, gridID3;
+  int gridsize, gridsizex;
+  int nlon, nlat;
+  int vlistID1, vlistID2, vlistID3;
+  int i, j;
+  int taxisID1, taxisID3;
+  int nmiss1, nmiss2;
+  int code1, code2;
+  double missval1, missval2;
+  double *ufield = NULL, *vfield = NULL;
+  double *urfield = NULL, *vrfield = NULL;
+  double *uhelp = NULL, *vhelp = NULL;
+  double *grid1x = NULL, *grid2x = NULL, *grid3x = NULL;
+  double *grid1y = NULL, *grid2y = NULL, *grid3y = NULL;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+
+  nvars = vlistNvars(vlistID1);
+  if ( nvars > 1 ) cdoAbort("More than one variable found in %s",  cdoStreamName(0));
+  nvars = vlistNvars(vlistID2);
+  if ( nvars > 1 ) cdoAbort("More than one variable found in %s",  cdoStreamName(1));
+
+  gridID1 = vlistGrid(vlistID1, 0);
+  gridID2 = vlistGrid(vlistID2, 0);
+  gridsize = gridInqSize(gridID1);
+  if ( gridID1 == gridID2 ) cdoAbort("Input grids are the same!");
+  if ( gridsize != gridInqSize(gridID2) ) cdoAbort("Grids have different size!");
+
+  if ( gridInqType(gridID1) != GRID_LONLAT      &&
+       gridInqType(gridID1) != GRID_GAUSSIAN    &&
+       gridInqType(gridID1) != GRID_CURVILINEAR )
+    cdoAbort("Grid %s unsupported!", gridNamePtr(gridInqType(gridID1)));
+  
+  if ( gridInqType(gridID1) != GRID_CURVILINEAR )
+    gridID1 = gridToCurvilinear(gridID1, 1);
+
+  if ( gridsize != gridInqSize(gridID1) ) cdoAbort("Internal problem: gridsize changed!");
+
+  if ( gridInqType(gridID2) != GRID_CURVILINEAR )
+    gridID2 = gridToCurvilinear(gridID2, 1);
+
+  if ( gridsize != gridInqSize(gridID2) ) cdoAbort("Internal problem: gridsize changed!");
+
+  nlon    = gridInqXsize(gridID1);
+  nlat    = gridInqYsize(gridID1);
+
+  grid1x  = (double *) malloc(gridsize*sizeof(double));
+  grid1y  = (double *) malloc(gridsize*sizeof(double));
+  grid2x  = (double *) malloc(gridsize*sizeof(double));
+  grid2y  = (double *) malloc(gridsize*sizeof(double));
+  grid3x  = (double *) malloc(gridsize*sizeof(double));
+  grid3y  = (double *) malloc(gridsize*sizeof(double));
+
+  gridInqXvals(gridID1, grid1x);
+  gridInqYvals(gridID1, grid1y);
+
+  /* Convert lat/lon units if required */
+  {
+    char units[CDI_MAX_NAME];
+    gridInqXunits(gridID1, units);
+    gridToDegree(units, "grid1 center lon", gridsize, grid1x);
+    gridInqYunits(gridID1, units);
+    gridToDegree(units, "grid1 center lat", gridsize, grid1y);
+  }
+
+  gridInqXvals(gridID2, grid2x);
+  gridInqYvals(gridID2, grid2y);
+
+  /* Convert lat/lon units if required */
+  {
+    char units[CDI_MAX_NAME];
+    gridInqXunits(gridID2, units);
+    gridToDegree(units, "grid2 center lon", gridsize, grid2x);
+    gridInqYunits(gridID2, units);
+    gridToDegree(units, "grid2 center lat", gridsize, grid2y);
+  }
+
+  uv_to_p_grid(nlon, nlat, grid1x, grid1y, grid2x, grid2y, grid3x, grid3y);
+
+  if ( grid1x ) free(grid1x);
+  if ( grid1y ) free(grid1y);
+  if ( grid2x ) free(grid2x);
+  if ( grid2y ) free(grid2y);
+
+  gridID3 = gridCreate(GRID_CURVILINEAR, gridsize);
+  gridDefPrec(gridID3, gridInqPrec(gridID1));
+  gridDefXsize(gridID3, nlon);
+  gridDefYsize(gridID3, nlat);
+  gridDefXvals(gridID3, grid3x);
+  gridDefYvals(gridID3, grid3y);
+
+  for ( i = 0; i < gridsize; i++ )
+    {
+      grid3x[i] *= DEG2RAD;
+      grid3y[i] *= DEG2RAD;
+    }
+
+  vlistID3 = vlistCreate();
+  vlistCopy(vlistID3, vlistID1);
+  vlistCat(vlistID3, vlistID2);
+
+  code1 = vlistInqVarCode(vlistID1, 0);
+  code2 = vlistInqVarCode(vlistID2, 0);
+
+  if ( code1 == code2 ) vlistDefVarCode(vlistID3, 1, code1+1);
+  
+  vlistChangeGrid(vlistID3, gridID1, gridID3);
+  vlistChangeGrid(vlistID3, gridID2, gridID3);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  if ( cdoVerbose ) vlistPrint(vlistID3);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  missval1 = vlistInqVarMissval(vlistID1, 0);
+  missval2 = vlistInqVarMissval(vlistID2, 0);
+
+  ufield  = (double *) malloc(gridsize*sizeof(double));
+  vfield  = (double *) malloc(gridsize*sizeof(double));
+  urfield = (double *) malloc(gridsize*sizeof(double));
+  vrfield = (double *) malloc(gridsize*sizeof(double));
+
+  gridsizex = (nlon+2)*nlat;
+
+  uhelp   = (double *) malloc(gridsizex*sizeof(double));
+  vhelp   = (double *) malloc(gridsizex*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      nrecs2 = streamInqTimestep(streamID2, tsID);
+
+      if ( nrecs != nrecs2 ) cdoAbort("Input streams have different number of levels!");
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID1, &levelID);
+	  streamInqRecord(streamID2, &varID2, &levelID);
+
+	  streamReadRecord(streamID1, ufield, &nmiss1);
+	  streamReadRecord(streamID2, vfield, &nmiss2);
+
+	  /* remove missing values */
+	  if ( nmiss1 || nmiss2 )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		{
+		  if ( DBL_IS_EQUAL(ufield[i], missval1) ) ufield[i] = 0;
+		  if ( DBL_IS_EQUAL(vfield[i], missval2) ) vfield[i] = 0;
+		}
+	    }
+
+	  /* load to a help field */
+	  for ( j = 0; j < nlat; j++ )
+	    for ( i = 0; i < nlon; i++ )
+	      {
+		uhelp[IX2D(j,i+1,nlon+2)] = ufield[IX2D(j,i,nlon)];
+		vhelp[IX2D(j,i+1,nlon+2)] = vfield[IX2D(j,i,nlon)];
+	      }
+
+	  /* make help field cyclic */
+	  for ( j = 0; j < nlat; j++ )
+	    {
+	      uhelp[IX2D(j,0,nlon+2)]      = uhelp[IX2D(j,nlon,nlon+2)];
+	      uhelp[IX2D(j,nlon+1,nlon+2)] = uhelp[IX2D(j,1,nlon+2)];
+	      vhelp[IX2D(j,0,nlon+2)]      = vhelp[IX2D(j,nlon,nlon+2)];
+	      vhelp[IX2D(j,nlon+1,nlon+2)] = vhelp[IX2D(j,1,nlon+2)];
+	    }
+
+	  /* interpolate on pressure points */
+	  for ( j = 1; j < nlat; j++ )
+	    for ( i = 0; i < nlon; i++ )
+	      {
+		ufield[IX2D(j,i,nlon)] = (uhelp[IX2D(j,i,nlon+2)]+uhelp[IX2D(j,i+1,nlon+2)])*0.5;
+		vfield[IX2D(j,i,nlon)] = (vhelp[IX2D(j-1,i+1,nlon+2)]+vhelp[IX2D(j,i+1,nlon+2)])*0.5;
+	      }
+
+	  for ( i = 0; i < nlon; i++ )
+	    {
+	      ufield[IX2D(0,i,nlon)] = 0;
+	      vfield[IX2D(0,i,nlon)] = 0;
+	    }
+
+	  /* rotate*/
+	  
+	  rotate_uv2(ufield, vfield, nlon, nlat, grid3x, grid3y, urfield, vrfield);
+
+	  /* calc lat, lon, Auv and alpha */
+	  /*
+          {
+	  double lat, lon, auv, alpha;
+	  for ( j = 1; j < nlat-1; j += 3 )
+	    for ( i = 0; i < nlon; i += 3 )
+	      {
+		lat = grid3y[IX2D(j,i,nlon)]*RAD2DEG;
+		lon = grid3x[IX2D(j,i,nlon)]*RAD2DEG; 
+		auv = sqrt(urfield[IX2D(j,i,nlon)]*urfield[IX2D(j,i,nlon)] +
+			   vrfield[IX2D(j,i,nlon)]*vrfield[IX2D(j,i,nlon)]);
+		alpha = atan2(vrfield[IX2D(j,i,nlon)], urfield[IX2D(j,i,nlon)]);
+		alpha = 90. - alpha*RAD2DEG;
+
+		if ( alpha <   0 ) alpha += 360.;
+		if ( alpha > 360 ) alpha -= 360.;
+
+		printf("%g %g %g %g\n", lon, lat, alpha, auv);
+	      }
+          }
+	  */
+	  nmiss1 = 0;
+	  nmiss2 = 0;
+	  streamDefRecord(streamID3, 0, levelID);
+	  streamWriteRecord(streamID3, urfield, nmiss1);     
+	  streamDefRecord(streamID3, 1, levelID);
+	  streamWriteRecord(streamID3, vrfield, nmiss2);     
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( ufield  ) free(ufield);
+  if ( vfield  ) free(vfield);
+  if ( urfield ) free(urfield);
+  if ( vrfield ) free(vrfield);
+  if ( uhelp   ) free(uhelp);
+  if ( vhelp   ) free(vhelp);
+  if ( grid3x  ) free(grid3x);
+  if ( grid3y  ) free(grid3y);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Ninfo.c b/src/Ninfo.c
new file mode 100644
index 0000000..7f34267
--- /dev/null
+++ b/src/Ninfo.c
@@ -0,0 +1,157 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Ninfo      npar            Number of parameters
+      Ninfo      nlevel          Number of levels
+      Ninfo      nyear           Number of years
+      Ninfo      nmon            Number of months
+      Ninfo      ndate           Number of dates
+      Ninfo      ntime           Number of timesteps
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Ninfo(void *argument)
+{
+  enum {NYEAR, NMON, NDATE, NTIME, NPAR, NLEVEL};
+  int operatorID;
+  int operfunc;
+  int varID, zaxisID;
+  int vdate;
+  int nrecs, nvars, ntsteps;
+  int levelsize;
+  int tsID, ndate, date0 = 0;
+  int day, mon0 = 0, mon, nmon, year0 = 0, year, nyear;
+  int taxisID;
+  int streamID;
+  int vlistID;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("nyear",  NYEAR,  0, NULL);
+  cdoOperatorAdd("nmon",   NMON,   0, NULL);
+  cdoOperatorAdd("ndate",  NDATE,  0, NULL);
+  cdoOperatorAdd("ntime",  NTIME,  0, NULL);
+  cdoOperatorAdd("npar",   NPAR,   0, NULL);
+  cdoOperatorAdd("nlevel", NLEVEL, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc   = cdoOperatorF1(operatorID);
+
+  streamID = streamOpenRead(cdoStreamName(0));
+
+  vlistID = streamInqVlist(streamID);
+
+  nvars   = vlistNvars(vlistID);
+  taxisID = vlistInqTaxis(vlistID);
+  ntsteps = vlistNtsteps(vlistID);
+
+  switch ( operfunc )
+    {
+    case NYEAR:
+      nyear = 0;
+      tsID = 0;
+      if ( ntsteps != 0 )
+	while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	  {
+	    vdate = taxisInqVdate(taxisID);
+
+	    cdiDecodeDate(vdate, &year, &mon, &day);
+	 
+	    if ( tsID == 0 || year0 != year )
+	      {
+		year0 = year;
+		nyear++;
+	      }
+
+	    tsID++;
+	  }
+      fprintf(stdout, "%d\n", nyear);
+      break;
+    case NMON:
+      nmon = 0;
+      tsID = 0;
+      if ( ntsteps != 0 )
+	while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	  {
+	    vdate = taxisInqVdate(taxisID);
+	    
+	    cdiDecodeDate(vdate, &year, &mon, &day);
+	 
+	    if ( tsID == 0 || mon0 != mon )
+	      {
+		mon0 = mon;
+		nmon++;
+	      }
+
+	    tsID++;
+	  }
+      fprintf(stdout, "%d\n", nmon);
+      break;
+    case NDATE:
+      ndate = 0;
+      tsID = 0;
+      if ( ntsteps != 0 )
+	while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	  {
+	    vdate = taxisInqVdate(taxisID);
+	    
+	    if ( tsID == 0 || date0 != vdate )
+	      {
+		date0 = vdate;
+		ndate++;
+	      }
+
+	    tsID++;
+	  }
+      fprintf(stdout, "%d\n", ndate);
+      break;
+    case NTIME:
+      tsID = 0;
+      if ( ntsteps != 0 )
+	while ( (nrecs = streamInqTimestep(streamID, tsID)) ) tsID++;
+      fprintf(stdout, "%d\n", tsID);
+      break;
+    case NPAR:
+      fprintf(stdout, "%d\n", nvars);
+      break;
+    case NLEVEL:
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  zaxisID = vlistInqVarZaxis(vlistID, varID);
+	  levelsize = zaxisInqSize(zaxisID);
+	  fprintf(stdout, "%d\n", levelsize);
+	}
+      break;
+    default:
+      cdoAbort("operator not implemented!");
+    }
+
+  streamClose(streamID);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Nmltest.c b/src/Nmltest.c
new file mode 100644
index 0000000..2621894
--- /dev/null
+++ b/src/Nmltest.c
@@ -0,0 +1,57 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+
+#include "cdo.h"
+#include "cdo_int.h"
+#include "namelist.h"
+
+
+void *Nmltest(void *argument)
+{
+  namelist_t *nml;
+  int i1[5] = {-99, -99, -99, -99, -99};
+  int i2    = -99;
+  char lop[99] = "";
+  double dm = 0;
+  char *var[3];
+
+  cdoInitialize(argument);
+
+  nml = namelistNew("SELECT");
+
+  namelistAdd(nml, "i1",  NML_INT,    0, i1,   sizeof(i1)/sizeof(int));
+  namelistAdd(nml, "i2",  NML_INT,    1, &i2,  sizeof(i2)/sizeof(int));
+  namelistAdd(nml, "lop", NML_TEXT,   2, lop,  sizeof(lop)/sizeof(char));
+  namelistAdd(nml, "dm",  NML_FLT, 1, &dm,  sizeof(dm)/sizeof(double));
+  namelistAdd(nml, "var", NML_WORD,   0, var,  sizeof(var)/sizeof(char *));
+
+  namelistRead(stdin, nml);
+
+  namelistPrint(nml);
+
+  namelistDelete(nml);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Output.c b/src/Output.c
new file mode 100644
index 0000000..d9f10e9
--- /dev/null
+++ b/src/Output.c
@@ -0,0 +1,442 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Output     output          ASCII output
+      Output     outputf         Formatted output
+      Output     outputint       Integer output
+      Output     outputsrv       SERVICE output
+      Output     outputext       EXTRA output
+      Output     outputtable     Table output
+*/
+
+#include <ctype.h>
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "grid.h"
+#include "pstream.h"
+
+
+void *Output(void *argument)
+{
+  int OUTPUT, OUTPUTINT, OUTPUTSRV, OUTPUTEXT, OUTPUTF, OUTPUTTS, OUTPUTFLD, OUTPUTARR, OUTPUTXYZ, OUTPUTTAB;
+  int operatorID;
+  int i;
+  int indf;
+  int varID, recID;
+  int gridsize = 0;
+  int gridID, zaxisID, code, vdate, vtime;
+  int param;
+  int gridtype;
+  int ngrids;
+  int nrecs;
+  int levelID;
+  int tsID, taxisID;
+  int streamID = 0;
+  int vlistID;
+  int nmiss, nout;
+  int nlon, nlat;
+  int nelem = 0;
+  int index;
+  int ndiffgrids;
+  const char *format = NULL;
+  char paramstr[32];
+  char vdatestr[32], vtimestr[32];
+  double level;
+  double *grid_center_lon = NULL, *grid_center_lat = NULL;
+  double *array = NULL;
+  double xdate;
+  double missval;
+  double lon, lat;
+  char name[CDI_MAX_NAME];
+  int len;
+  int npar = 0;
+  int year, month, day;
+  char **parnames = NULL;
+  int *keys = NULL, nkeys = 0, k;
+  int nKeys;
+  int Keylen[]           = {     8,      11,      4,      8,     6,     6,     6,      4,      4,     10,      8,      5,       2,     2 };
+  enum                     {kvalue,  kparam,  kcode,  kname,  klon,  klat,  klev,  kxind,  kyind,  kdate,  ktime,  kyear,  kmonth,  kday };
+  const char *Keynames[] = {"value", "param", "code", "name", "lon", "lat", "lev", "xind", "yind", "date", "time", "year", "month", "day"};
+
+
+  cdoInitialize(argument);
+
+  OUTPUT    = cdoOperatorAdd("output",    0, 0, NULL);
+  OUTPUTINT = cdoOperatorAdd("outputint", 0, 0, NULL);
+  OUTPUTSRV = cdoOperatorAdd("outputsrv", 0, 0, NULL);
+  OUTPUTEXT = cdoOperatorAdd("outputext", 0, 0, NULL);
+  OUTPUTF   = cdoOperatorAdd("outputf",   0, 0, NULL);
+  OUTPUTTS  = cdoOperatorAdd("outputts",  0, 0, NULL);
+  OUTPUTFLD = cdoOperatorAdd("outputfld", 0, 0, NULL);
+  OUTPUTARR = cdoOperatorAdd("outputarr", 0, 0, NULL);
+  OUTPUTXYZ = cdoOperatorAdd("outputxyz", 0, 0, NULL);
+  OUTPUTTAB = cdoOperatorAdd("outputtab", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == OUTPUTF )
+    {
+      operatorInputArg("format and number of elements");
+      operatorCheckArgc(2);
+      format = operatorArgv()[0];
+      nelem  = atoi(operatorArgv()[1]);
+    }
+  else if ( operatorID == OUTPUTTAB )
+    {
+      operatorInputArg("keys to print");
+ 
+      npar     = operatorArgc();
+      parnames = operatorArgv();
+
+      if ( cdoVerbose )
+	for ( i = 0; i < npar; i++ )
+	  printf("key %d = %s\n", i+1, parnames[i]);
+
+      keys = (int *) malloc(npar*sizeof(int));
+      nkeys = 0;
+      nKeys = sizeof(Keynames)/sizeof(char *);
+      for ( i = 0; i < npar; i++ )
+	{
+	  for ( k = 0; k < nKeys; ++k )
+	    {
+	      //	      len = strlen(parnames[i]);
+	      len = strlen(Keynames[k]);
+	      if ( len < 3 ) len = 3;
+	      if ( strncmp(parnames[i], Keynames[k], len) == 0 )
+		{
+		  keys[nkeys++] = k;
+		  if ( parnames[i][len] && isdigit(parnames[i][len]) ) Keylen[k] = atoi(&parnames[i][len]);
+		  break;
+		}
+	    }
+
+	  if ( k == nKeys ) cdoAbort("Key %s unsupported!", parnames[i]);
+	}
+ 
+      if ( cdoVerbose )
+	for ( k = 0; k < nkeys; ++k )
+	  printf("keynr = %d  keyid = %d  keyname = %s\n", k, keys[k], Keynames[keys[k]]);
+    }
+
+  for ( indf = 0; indf < cdoStreamCnt(); indf++ )
+    {
+      streamID = streamOpenRead(cdoStreamName(indf));
+
+      vlistID = streamInqVlist(streamID);
+
+      ngrids = vlistNgrids(vlistID);
+      ndiffgrids = 0;
+      for ( index = 1; index < ngrids; index++ )
+	if ( vlistGrid(vlistID, 0) != vlistGrid(vlistID, index) )
+	  ndiffgrids++;
+
+      if ( ndiffgrids > 0 ) cdoAbort("Too many different grids!");
+
+      gridID   = vlistGrid(vlistID, 0);
+      gridsize = gridInqSize(gridID);
+      gridtype = gridInqType(gridID);
+
+      array = (double *) malloc(gridsize*sizeof(double));
+
+      if ( operatorID == OUTPUTFLD || operatorID == OUTPUTXYZ || operatorID == OUTPUTTAB )
+	{
+	  if ( gridInqType(gridID) == GRID_GME ) gridID = gridToUnstructured(gridID, 0);
+
+	  if ( gridInqType(gridID) != GRID_UNSTRUCTURED && gridInqType(gridID) != GRID_CURVILINEAR )
+	    gridID = gridToCurvilinear(gridID, 0);
+
+	  gridtype = gridInqType(gridID);
+
+	  grid_center_lon = (double *) malloc(gridsize*sizeof(double));
+	  grid_center_lat = (double *) malloc(gridsize*sizeof(double));
+	  gridInqXvals(gridID, grid_center_lon);
+	  gridInqYvals(gridID, grid_center_lat);
+
+	  /* Convert lat/lon units if required */
+	  {
+	    char units[CDI_MAX_NAME];
+	    gridInqXunits(gridID, units);
+	    gridToDegree(units, "grid center lon", gridsize, grid_center_lon);
+	    gridInqYunits(gridID, units);
+	    gridToDegree(units, "grid center lat", gridsize, grid_center_lat);
+	  }
+	}
+
+      tsID = 0;
+      taxisID = vlistInqTaxis(vlistID);
+      while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	{
+	  vdate = taxisInqVdate(taxisID);
+	  vtime = taxisInqVtime(taxisID);
+	  date2str(vdate, vdatestr, sizeof(vdatestr));
+	  time2str(vtime, vtimestr, sizeof(vtimestr));
+
+	  cdiDecodeDate(vdate, &year, &month, &day);
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID, &varID, &levelID);
+
+	      vlistInqVarName(vlistID, varID, name);
+	      param    = vlistInqVarParam(vlistID, varID);
+	      code     = vlistInqVarCode(vlistID, varID);
+	      gridID   = vlistInqVarGrid(vlistID, varID);
+	      zaxisID  = vlistInqVarZaxis(vlistID, varID);
+	      missval  = vlistInqVarMissval(vlistID, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlon     = gridInqXsize(gridID);
+	      nlat     = gridInqYsize(gridID);
+	      level    = zaxisInqLevel(zaxisID, levelID);
+	      
+	      cdiParamToString(param, paramstr, sizeof(paramstr));
+
+	      if ( nlon*nlat != gridsize ) { nlon = gridsize; nlat = 1; }
+
+	      streamReadRecord(streamID, array, &nmiss);
+
+	      if ( operatorID == OUTPUTSRV )
+		fprintf(stdout, "%4d %8g %8d %4d %8d %8d %d %d\n", code, level, vdate, vtime, nlon, nlat, 0, 0);
+
+	      if ( operatorID == OUTPUTEXT )
+		fprintf(stdout, "%8d %4d %8g %8d\n", vdate, code, level, gridsize);
+		
+	      if ( operatorID == OUTPUTINT )
+		{
+		  nout = 0;
+		  for ( i = 0; i < gridsize; i++ )
+		    {
+		      if ( nout == 8 )
+			{
+			  nout = 0;
+			  fprintf(stdout, "\n");
+			}
+		      fprintf(stdout, " %8d", (int) array[i]);
+		      nout++;
+		    }
+		  fprintf(stdout, "\n");
+		}
+	      else if ( operatorID == OUTPUTF )
+		{
+		  nout = 0;
+		  for ( i = 0; i < gridsize; i++ )
+		    {
+		      if ( nout == nelem )
+			{
+			  nout = 0;
+			  fprintf(stdout, "\n");
+			}
+		      fprintf(stdout, format, array[i]);
+		      nout++;
+		    }
+		  fprintf(stdout, "\n");
+		}
+	      else if ( operatorID == OUTPUTTS )
+		{
+		  char vdatestr[32], vtimestr[32];
+	  
+		  if ( gridsize > 1 )
+		    cdoAbort("operator works only with one gridpoint!");
+
+		  date2str(vdate, vdatestr, sizeof(vdatestr));
+		  time2str(vtime, vtimestr, sizeof(vtimestr));
+
+		  fprintf(stdout, "%s %s %12.12g\n", vdatestr, vtimestr, array[0]);
+		}
+	      else if ( operatorID == OUTPUTFLD )
+		{
+		  int hour, minute, second;
+		  cdiDecodeTime(vtime, &hour, &minute, &second);
+		  xdate  = vdate - (vdate/100)*100 + (hour*3600 + minute*60 + second)/86400.;
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( !DBL_IS_EQUAL(array[i], missval) )
+		      fprintf(stdout, "%g\t%g\t%g\t%g\n", xdate, 
+			      grid_center_lat[i], grid_center_lon[i], array[i]);
+		}
+	      else if ( operatorID == OUTPUTTAB )
+		{
+		  int xsize, ysize;
+		  int xind, yind;
+		  int l2d = FALSE;
+
+		  xsize = gridInqXsize(gridID);
+		  ysize = gridInqYsize(gridID);
+		  if ( gridtype == GRID_CURVILINEAR ) l2d = TRUE;
+		      
+		  for ( i = 0; i < gridsize; i++ )
+		    {
+		      yind = i;
+		      xind = i;
+		      if ( l2d ) { yind /= xsize; xind -= yind*xsize; }
+		      lon = grid_center_lon[i];
+		      lat = grid_center_lat[i];
+
+		      for ( k = 0; k < nkeys; ++k )
+			{
+			  len = Keylen[keys[k]];
+			  if      ( keys[k] == kvalue ) fprintf(stdout, "%*g ", len, array[i]);
+			  else if ( keys[k] == kparam ) fprintf(stdout, "%*s ", len, paramstr);
+			  else if ( keys[k] == kcode  ) fprintf(stdout, "%*d ", len, code);
+			  else if ( keys[k] == kname  ) fprintf(stdout, "%*s ", len, name);
+			  else if ( keys[k] == klon   ) fprintf(stdout, "%*g ", len, lon);
+			  else if ( keys[k] == klat   ) fprintf(stdout, "%*g ", len, lat);
+			  else if ( keys[k] == klev   ) fprintf(stdout, "%*g ", len, level);
+			  else if ( keys[k] == kxind  ) fprintf(stdout, "%*d ", len, xind+1);
+			  else if ( keys[k] == kyind  ) fprintf(stdout, "%*d ", len, yind+1);
+			  else if ( keys[k] == kdate  ) fprintf(stdout, "%*s ", len, vdatestr);
+			  else if ( keys[k] == ktime  ) fprintf(stdout, "%*s ", len, vtimestr);
+			  else if ( keys[k] == kyear  ) fprintf(stdout, "%*d ", len, year);
+			  else if ( keys[k] == kmonth ) fprintf(stdout, "%*d ", len, month);
+			  else if ( keys[k] == kday   ) fprintf(stdout, "%*d ", len, day);
+			}
+		      fprintf(stdout, "\n");
+		    }
+		}
+	      else if ( operatorID == OUTPUTXYZ )
+		{
+		  if ( tsID == 0 && recID == 0 )
+		    {
+		      char *fname = "frontplane.xyz";
+		      FILE *fp;
+		      double fmin = 0;
+		      double dx, x0, y0, z0, x, y, z;
+		      for ( i = 0; i < gridsize; i++ )
+			if ( !DBL_IS_EQUAL(array[i], missval) )
+			  {
+			    if ( array[i] < fmin ) fmin = array[i];
+			    fprintf(stdout, "%g\t%g\t%g\t%g\n",
+				    grid_center_lon[i], grid_center_lat[i], array[i], array[i]);
+			  }
+		      fp = fopen(fname, "w");
+		      if ( fp == NULL ) cdoAbort("Open failed on %s", fname);
+		      // first front plane
+		      dx = (grid_center_lon[1] - grid_center_lon[0]);
+		      x0 = grid_center_lon[0]-dx/2;
+		      y0 = grid_center_lat[0]-dx/2;
+		      z0 = fmin;
+		      fprintf(fp, ">\n");
+		      for ( i = 0; i < nlon; ++i )
+			{
+			  x = x0;  y = y0; z = z0;
+			  fprintf(fp, "%g %g %g\n", x, y, z);
+			  x = x0;  y = y0; z = array[i];
+			  fprintf(fp, "%g %g %g\n", x, y, z);
+			  x = x0+dx;  y = y0;
+			  fprintf(fp, "%g %g %g\n", x, y, z);
+			  x0 = x; /*y0 = y0;*/ z0 = z;
+			}
+		      x = x0;  y = y0; z = fmin;
+		      fprintf(fp, "%g %g %g\n", x, y, z);
+		      x = grid_center_lon[0]-dx/2;
+		      fprintf(fp, "%g %g %g\n", x, y, z);
+
+		      // second front plane
+		      x0 = grid_center_lon[0]-dx/2;
+		      y0 = grid_center_lat[0]-dx/2;
+		      z0 = fmin;
+		      fprintf(fp, ">\n");
+		      for ( i = 0; i < nlat; ++i )
+			{
+			  x = x0;  y = y0; z = z0;
+			  fprintf(fp, "%g %g %g\n", x, y, z);
+			  x = x0;  y = y0; z = array[i*nlon];
+			  fprintf(fp, "%g %g %g\n", x, y, z);
+			  x = x0;  y = y0+dx;
+			  fprintf(fp, "%g %g %g\n", x, y, z);
+			  /*x0 = x0;*/ y0 = y; z0 = z;
+			}
+		      x = x0;  y = y0; z = fmin;
+		      fprintf(fp, "%g %g %g\n", x, y, z);
+		      y = grid_center_lat[0]-dx/2;
+		      fprintf(fp, "%g %g %g\n", x, y, z);
+
+		      fclose(fp);
+		    }
+		}
+	      else if ( operatorID == OUTPUTARR )
+		{
+		  for ( i = 0; i < gridsize; i++ )
+		    {
+		      fprintf(stdout, "  arr[%d] = %12.6g;\n", i, array[i]);
+		      nout++;
+		    }
+		}
+	      else
+		{
+		  double minval, maxval;
+		  minval = array[0];
+		  maxval = array[0];
+		  if ( gridInqType(gridID) == GRID_SPECTRAL && gridsize <= 156 )
+		    {
+		      for ( i = 1; i < gridsize; i++ )
+			{
+			  if ( array[i] < minval ) minval = array[i];
+			  if ( array[i] > maxval ) maxval = array[i];
+			}
+		    }
+
+		  if ( gridInqType(gridID) == GRID_SPECTRAL && gridsize <= 156 /* T11 */ &&
+		       minval >= -1 && maxval <= 12 )
+		    {
+		      long m, n, ntr;
+		      double *spc = array;
+		      ntr = gridInqTrunc(gridID);
+		      for ( m = 0; m <= ntr; m++ )
+			{
+			  for ( n = m; n <= ntr; n++ )
+			    {
+			      fprintf(stdout, "%3d", (int) *spc++);
+			      fprintf(stdout, "%3d", (int) *spc++);
+			    }
+			  fprintf(stdout, "\n");
+			}
+		    }
+		  else
+		    {
+		      nout = 0;
+		      for ( i = 0; i < gridsize; i++ )
+			{
+			  if ( nout == 6 )
+			    {
+			      nout = 0;
+			      fprintf(stdout, "\n");
+			    }
+			  fprintf(stdout, " %12.6g", array[i]);
+			  nout++;
+			}
+		      fprintf(stdout, "\n");
+		    }
+		}
+	    }
+	  tsID++;
+	}
+      streamClose(streamID);
+
+      if ( array ) free(array);
+      if ( grid_center_lon ) free(grid_center_lon);
+      if ( grid_center_lat ) free(grid_center_lat);
+    }
+
+  if ( keys ) free(keys);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Outputgmt.c b/src/Outputgmt.c
new file mode 100644
index 0000000..451e31b
--- /dev/null
+++ b/src/Outputgmt.c
@@ -0,0 +1,1230 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+/*
+  Output center or bounderies for GMT plotting
+
+  Plotting example:
+
+    - outputcenter
+    - outputbounds
+    - outputboundscpt
+    - outputvector
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h" /* VERSION */
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "grid.h"
+#include "pstream.h"
+#include "color.h"
+
+double intlin(double x, double y1, double x1, double y2, double x2);
+
+static
+int pnpoly(int npol, double *xp, double *yp, double x, double y)
+{
+  int i, j, c = 0;
+
+  for (i = 0, j = npol-1; i < npol; j = i++) {
+    if ((((yp[i]<=y) && (y<yp[j])) ||
+	 ((yp[j]<=y) && (y<yp[i]))) &&
+	(x < (xp[j] - xp[i]) * (y - yp[i]) / (yp[j] - yp[i]) + xp[i]))
+      
+      c = !c;
+  }
+  return c;
+}
+
+
+static
+double PolygonArea_old(int np, double *xp, double *yp)
+{
+  int i, j;
+  double area = 0;
+
+  for ( i = 0; i < np; i++ )
+    {
+      j = (i + 1) % np;
+      area += xp[i] * yp[j];
+      area -= yp[i] * xp[j];
+    }
+
+  area /= 2;
+  /* return(area < 0 ? -area : area); */
+  return (area);
+}
+
+
+static
+double PolygonArea(int np, double *xp, double *yp, double yc)
+{
+  int i, j;
+  double area = 0.;
+
+  /* Process area in Radians */
+   
+  for ( i = 0; i < np; i++ )
+    {
+      j = (i + 1) % np;
+      area += DEG2RAD*xp[i] * DEG2RAD*yp[j];
+      area -= DEG2RAD*yp[i] * DEG2RAD*xp[j];
+    }
+  area *= 0.5 * cos(DEG2RAD*yc);
+  return (area);
+}
+
+static
+int ccw(double p0x, double p0y, double p1x, double p1y, double p2x, double p2y)
+{
+  /*
+    This function says wether the point are orientated clockwise
+    +1 positive orientation
+    -1 negative orientation
+     0 points are on a line --> no orientation
+    
+    This is done by a comparision of the gradient of
+    dy1/dx1 = p1 - p0 vs.
+    dy2/dx2 = p2 - p0
+    To avoid singularities at dx1=0 OR dx2 = 0 we multiply with dx1*dx2
+  */
+  double dx1, dx2, dy1, dy2;
+
+  dx1 = p1x - p0x; dy1 = p1y - p0y;
+  dx2 = p2x - p0x; dy2 = p2y - p0y;
+  if ( dx1*dy2 > dy1*dx2 ) return +1;
+  if ( dx1*dy2 < dy1*dx2 ) return -1;
+  if ( (dx1*dx2 < 0 ) || (dy1*dy2 < 0)) return -1;
+  if ( (dx1*dx1 + dy1*dy1) < (dx2*dx2 + dy2*dy2)) return +1;
+
+  return 0;
+}
+
+static
+int intersect(double pix, double piy, double pjx, double pjy,
+              double pkx, double pky, double plx, double ply)
+{
+  /*This function returns if there is an intersection between the lines 
+    line1 between pi and pj and
+    line2 between pk and pl,
+    whereas pi = (pix, piy).
+      
+    This can done by means of ccw since the product of ccw(pi,pj,pk)*ccw(pi,pj,pl)
+    shows if pk and pl are on different or the same side(s) of the line1 (They must
+    have different signums to be on different sides).
+      
+    Consequently if and ONLY IF pk as well as pl are on different sides of line1
+    AND pi as well as pj are on different sides of line2 there HAS TO be an intersection.
+  */
+    
+  return ( ( ccw(pix, piy, pjx, pjy, pkx, pky) *
+	     ccw(pix, piy, pjx, pjy, plx, ply) <= 0 ) &&
+	   ( ccw(pkx, pky, plx, ply, pix, piy) *
+	     ccw(pkx, pky, plx, ply, pjx, pjy) <= 0 ) );
+}
+
+#ifndef MAX_CORNERS 
+#define MAX_CORNERS 8+1
+#endif
+void verify_grid(int gridtype, int gridsize, int ncorner,
+		double *grid_center_lon, double *grid_center_lat,
+		double *grid_corner_lon, double *grid_corner_lat)
+{
+  int i0, i, j, k, l;
+  int l0;
+  int nout;
+  int isinside, convex, alone, isnegative;
+  int cuts[MAX_CORNERS][MAX_CORNERS];  
+  int *alone_cell;          
+  int check_corners;
+  double lon, lat = 0;
+  double lon_bounds[MAX_CORNERS], lat_bounds[MAX_CORNERS];
+  double area, sumarea;
+
+  alone_cell = (int *) malloc(gridsize*ncorner*sizeof(int));
+
+  check_corners = 0; /* don't execute corner checking (last loop) */
+  nout = 0;
+  sumarea = 0;
+  /*
+  for ( i = 0; i < gridsize; ++i )
+    {
+      lon = grid_center_lon[i];
+      lat = grid_center_lat[i];
+      for ( k = 0; k < ncorner; ++k )
+        {
+          lon_bounds[k] = grid_corner_lon[i*ncorner+k];
+          lat_bounds[k] = grid_corner_lat[i*ncorner+k];
+          if ( (lon - lon_bounds[k]) > 270 ) lon_bounds[k] += 360;
+          if ( (lon_bounds[k] - lon) > 270 ) lon_bounds[k] -= 360;
+        }      
+      lon_bounds[ncorner] = lon_bounds[0];
+      lat_bounds[ncorner] = lat_bounds[0];
+      fprintf(stdout, " %6i %6i %9.4f %9.4f :",  nout, i+1, lon, lat);
+      for ( k = 0; k < ncorner; k++ )
+	fprintf(stdout, " %9.4f %9.4f : ", lon_bounds[k], lat_bounds[k]);
+      fprintf(stdout, "\n");
+    }
+  */
+
+  /* Check if center is inside bounds of cell */
+  for ( i = 0; i < gridsize; ++i )
+    {
+      lon = grid_center_lon[i];
+      lat = grid_center_lat[i];
+
+      for ( k = 0; k < ncorner; ++k )
+        {
+          lon_bounds[k] = grid_corner_lon[i*ncorner+k];
+          lat_bounds[k] = grid_corner_lat[i*ncorner+k];
+          if ( (lon - lon_bounds[k]) > 270 ) lon_bounds[k] += 360;
+          if ( (lon_bounds[k] - lon) > 270 ) lon_bounds[k] -= 360;
+        }      
+      lon_bounds[ncorner] = lon_bounds[0];
+      lat_bounds[ncorner] = lat_bounds[0];
+      
+      isinside = pnpoly(ncorner+1, lon_bounds, lat_bounds, lon, lat);
+
+      if ( !isinside ) nout++;
+      if ( !isinside && cdoVerbose )
+        {
+          if ( nout == 1 )
+            {
+              fprintf(stdout,"\n CENTER IS OUT OF BOUNDS");
+              fprintf(stdout,"\n                                                  :");
+              for ( k = 0; k < ncorner; k++ )
+                fprintf(stdout, "            Corner %2i : ", k);
+              fprintf(stdout,"\n Number  Index  center_lon  center_lat  area*10^6 :");
+              for ( k = 0; k < ncorner; k++ )
+                fprintf(stdout, "    lon_%2.2i     lat_%2.2i : ", k, k);
+              fprintf(stdout, "\n");
+            }
+          area = PolygonArea(ncorner+1, lon_bounds, lat_bounds,lat);
+          fprintf(stdout, " %6i %6i   %9.4f   %9.4f %10.5f :", 
+		  nout, i+1, lon, lat, area*pow(10,6));
+          for ( k = 0; k < ncorner; k++ )
+            fprintf(stdout, " %9.4f  %9.4f : ", lon_bounds[k], lat_bounds[k]);
+          fprintf(stdout, "\n");
+        }
+    }
+
+  if ( nout )
+    cdoWarning("%d of %d points out of bounds!", nout, gridsize);
+  
+  /* check that all cell bounds have the same orientation */
+  
+  nout = 0;
+  for ( i = 0; i < gridsize; ++i )
+    {
+      lon = grid_center_lon[i];
+      lat = grid_center_lat[i];
+      
+      for ( k = 0; k < ncorner; ++k )
+	{
+          lon_bounds[k] = grid_corner_lon[i*ncorner+k];
+          lat_bounds[k] = grid_corner_lat[i*ncorner+k];
+          if ( (grid_center_lon[i] - lon_bounds[k]) > 270 ) lon_bounds[k] += 360;
+          if ( (lon_bounds[k] - grid_center_lon[i]) > 270 ) lon_bounds[k] -= 360;
+	}
+      lon_bounds[ncorner] = lon_bounds[0];
+      lat_bounds[ncorner] = lat_bounds[0];
+      
+      area = PolygonArea(ncorner+1, lon_bounds, lat_bounds, lat);
+      
+      isnegative = area < 0 ? 1 : 0;
+      sumarea += area < 0 ? -area : area;
+      
+      if ( isnegative ) nout++;
+      
+      if ( isnegative && cdoVerbose )
+        {
+          if ( nout == 1 )
+            {
+              fprintf(stdout,"\n                                       :");
+              for ( k = 0; k < ncorner; k++ )
+                fprintf(stdout, "            Corner %2i : ", k);
+              fprintf(stdout,"\n Number  Index  center_lon  center_lat :");
+              for ( k = 0; k < ncorner; k++ )
+                fprintf(stdout, "    lon_%2.2i     lat_%2.2i : ", k, k);
+              fprintf(stdout, "\n");
+            }
+          fprintf(stdout, "%6i %6i   %9.4f   %9.4f :", nout, i+1, lon, lat);
+          for ( k = 0; k < ncorner; k++ )
+            fprintf(stdout, " %9.4f  %9.4f : ", lon_bounds[k], lat_bounds[k]);
+          fprintf(stdout, "\n");
+        }
+    }
+
+  if ( nout )
+    cdoWarning("%d of %d grid cells have wrong orientation!", nout, gridsize);
+
+  if ( cdoVerbose ) 
+    fprintf(stdout, "area-error: %9.5f%%\n", 100.*(sumarea - 4.*M_PI)/4.*M_PI );
+
+  if ( fabs(100.*(sumarea - 4.*M_PI)/4.*M_PI) > 0.1)
+    cdoWarning("area-error: %9.5f%%", 100.*(sumarea - 4.*M_PI)/4.*M_PI );
+  
+  /* check that all cells are convex */
+  
+  nout = 0;
+  for ( i0 = 0; i0 < gridsize; i0++ )
+    {
+      lon = grid_center_lon[i0];
+      lat = grid_center_lat[i0];
+
+      for ( k = 0; k < ncorner; k++ )
+	{
+	  lon_bounds[k] = grid_corner_lon[i0*ncorner+k];
+	  lat_bounds[k] = grid_corner_lat[i0*ncorner+k];
+	  /* Find cells that cover left and right border of the grid and adjust
+	     coordinates --> they become closed polygons on theta-phi plane! */
+	  if ( (lon - lon_bounds[k]) > 270 ) lon_bounds[k] += 360; 
+	  if ( (lon_bounds[k] - lon) > 270 ) lon_bounds[k] -= 360;
+	}
+      
+      /* Reset found cuts for the current cell before starting the search */
+      for ( i = 0; i < ncorner; i++ )
+	for ( j = 0; j < ncorner; j++ )
+	  cuts[i][j] = 0;
+      
+      /* Loops cover all combinations between inner lines of the Polygon
+	 Check whether each inner line is cut by an other (inner) one at least once. 
+	 - Only if there is a cut every inner line the Polygon is convex
+	 - We assume: Points are in either cyclic or anticyclic order
+      */
+      for ( i = 0; i < ncorner-1; i++ )
+	{
+          /* j = i+2 excludes lines from one corner to an other (j=i+1) and
+	     from one point to itself (j=i)*/
+          for ( j = i+2 ; j < ncorner; j++ )
+	    {
+              /* Exclude the line between the last and first corner */
+              if ( i == 0 && j == ncorner-1 ) continue;
+
+	      /* k = i+1: if starting point is in common lines to different corners
+		 do not intersect */
+              for ( k = i+1; k < ncorner - 1; k++ )
+		{                  
+                  if ( i == k ) l0 = j+1;
+                  else          l0 = k+2;
+
+                  for ( l = l0; l < ncorner; l++ )
+		    {
+                      if ( cuts[k][l] && cuts[i][j] ) continue;
+		      /* Exlude the line between the last and first corner 
+			 Exlude the line itself (l!=i, k!=j)
+			 Check if line ij and kl intersect each other.
+			 If so increment respective counters for intersections. 
+			 It is not relevant by which line a line is intersected - 
+			 it is only relevant if they is itersected! */
+                      if ( ! ( k==0 && l == ncorner-1 ) && ( l != j ) && ( k != j )  )
+			{
+                          if ( intersect(lon_bounds[i], lat_bounds[i], lon_bounds[j], lat_bounds[j],
+                                         lon_bounds[k], lat_bounds[k], lon_bounds[l], lat_bounds[l]) )
+			    {
+			      cuts[i][j]++; cuts[k][l]++; cuts[j][i]++; cuts[l][k]++;
+			    }
+			}
+		    }
+		}                  
+	    }
+	}
+
+      convex = 1;
+      /* The following loop covers all inner lines of the Polygon 
+	 (The assumption applies that the points are in cyclic order) */
+      for ( i = 0; i < ncorner-1; i++ )
+	for ( j = i+2; j < ncorner; j++)
+	  {
+	    if ( i == 0 && j == ncorner-1 ) continue;	   
+	    if ( ! cuts[i][j] ) convex = 0;
+	  }
+      if ( !convex ) nout++;        
+      if ( cdoVerbose && ( !convex ) )
+	{
+          if ( nout == 1 )
+	    {
+              fprintf(stdout,"\n NO CONVEX POLYGON");
+              fprintf(stdout,"\n                                       :");
+              for ( k = 0; k < ncorner; k++ )
+		fprintf(stdout, "            Corner %2i : ", k);
+              fprintf(stdout,"\n Number  Index  center_lon  center_lat :");
+              for ( k = 0; k < ncorner; k++ )
+		fprintf(stdout, "    lon_%2.2i     lat_%2.2i : ", k, k);
+              fprintf(stdout, "\n");
+	    }
+          
+          fprintf(stdout, " %6i %6i   %9.4f   %9.4f :", nout, i0+1, lon, lat);
+          for ( k = 0; k < ncorner; k++ )
+	    fprintf(stdout, "  %9.4f %9.4f : ", lon_bounds[k], lat_bounds[k]);
+          fprintf(stdout, "\n");         
+	}     
+    }
+
+  if ( nout )
+    cdoWarning("%d of %d cells are not Convex!", nout, gridsize);
+  
+  if ( check_corners )
+    {
+      /* 
+	 Check if there is a corner at the same point of 
+	 an other cell foreach corner of each cell 
+      */
+      nout = 0;
+      for ( i = 0; i < gridsize*ncorner; i++ )
+	alone_cell[i] = 1;
+      
+      for ( i = 0; i < gridsize*ncorner; i++ )
+	{
+	  if ( ! alone_cell[i] ) continue;
+	  alone = 1;
+	  lon = grid_corner_lon[i];
+	  lat = grid_corner_lat[i];			
+	  for ( j = 0; j < gridsize*ncorner; j++ )
+	    if ( j != i && 
+		 IS_EQUAL(grid_corner_lat[j], lat) && 
+		 IS_EQUAL(grid_corner_lon[j], lon) )
+	      { alone = 0; alone_cell[i] = alone_cell[j] = 1; break; }
+	  if ( alone )
+	    {
+	      if      ( lon >= 180. ) lon -= 360.;
+	      else if ( lon  < 180. ) lon += 360.;
+	      for ( j = i+1; j < gridsize*ncorner; j++ )
+		if (j != i  && 
+		    IS_EQUAL(grid_corner_lat[j], lat) && 
+		    IS_EQUAL(grid_corner_lon[j], lon) )
+		  { alone = 0; alone_cell[i] = alone_cell[j] = 0; break; }
+	    }
+	  if ( alone )
+	    { 
+	      nout++;
+	      if ( cdoVerbose )
+		{
+		  if ( nout == 1 )
+		    {
+		      fprintf(stdout,"\n VERTEX ALONE ON GRID\n");
+		      fprintf(stdout," number cell-Index  Vert-Index :        lon        lat\n");
+		    }							
+		  fprintf(stdout, " %6i     %6i      %6i : %10.4f %10.4f\n", 
+			  nout, i/ncorner, i, grid_corner_lon[i], grid_corner_lat[i]);
+		}					
+	    }
+	}
+
+      if ( nout )
+	cdoWarning("%d of %d corners are lonely on the grid!", nout, gridsize*ncorner);
+    }
+
+  free(alone_cell);
+}
+
+
+void verify_grid_old(int gridtype, int gridsize, int ncorner,
+		double *grid_center_lon, double *grid_center_lat,
+		double *grid_corner_lon, double *grid_corner_lat)
+{
+  int i, k;
+  int nout;
+  int isinside;
+  int isnegative;
+  double area;
+  double lon, lat;
+  double lon_bounds[9], lat_bounds[9];
+
+  /* check that all centers are inside the bounds */
+
+  nout = 0;
+  for ( i = 0; i < gridsize; ++i )
+    {
+      lon = grid_center_lon[i];
+      lat = grid_center_lat[i];
+
+      for ( k = 0; k < ncorner; ++k )
+	{
+	  lon_bounds[k] = grid_corner_lon[i*ncorner+k];
+	  lat_bounds[k] = grid_corner_lat[i*ncorner+k];
+	}
+
+      for ( k = 0; k < ncorner; ++k )
+	{
+	  if ( (lon - lon_bounds[k]) > 270 ) lon_bounds[k] += 360;
+	  if ( (lon_bounds[k] - lon) > 270 ) lon_bounds[k] -= 360;
+	}
+
+      lon_bounds[ncorner] = lon_bounds[0];
+      lat_bounds[ncorner] = lat_bounds[0];
+
+      isinside = pnpoly(ncorner+1, lon_bounds, lat_bounds, lon, lat);
+
+      if ( !isinside ) nout++;
+
+      if ( !isinside && cdoVerbose )
+	printf("center: %d %d %g %g %g %g %g %g %g %g %g %g\n", nout, i, lon, lat, lon_bounds[0], lat_bounds[0],
+	       lon_bounds[1], lat_bounds[1], lon_bounds[2], lat_bounds[2], lon_bounds[3], lat_bounds[3]);
+    }
+
+  if ( nout > 0 )
+    cdoWarning("%d of %d points out of bounds!", nout, gridsize);
+
+
+  /* check that all cell bounds have the same orientation */
+
+  nout = 0;
+  for ( i = 0; i < gridsize; ++i )
+    {
+      lon = grid_center_lon[i];
+      lat = grid_center_lat[i];
+
+      for ( k = 0; k < ncorner; ++k )
+	{
+	  lon_bounds[k] = grid_corner_lon[i*ncorner+k];
+	  lat_bounds[k] = grid_corner_lat[i*ncorner+k];
+	}
+
+      for ( k = 0; k < ncorner; ++k )
+	{
+	  if ( (grid_center_lon[i] - lon_bounds[k]) > 270 ) lon_bounds[k] += 360;
+	  if ( (lon_bounds[k] - grid_center_lon[i]) > 270 ) lon_bounds[k] -= 360;
+	}
+
+      lon_bounds[ncorner] = lon_bounds[0];
+      lat_bounds[ncorner] = lat_bounds[0];
+
+      area = PolygonArea_old(ncorner+1, lon_bounds, lat_bounds);
+
+      if ( area < 0 ) isnegative = 1;
+      else            isnegative = 0;
+
+      if ( isnegative ) nout++;
+
+      if ( isnegative && cdoVerbose )
+	printf("bounds: %d %d %g %g %g %g %g %g %g %g %g %g\n", nout, i, lon, lat, lon_bounds[0], lat_bounds[0],
+	       lon_bounds[1], lat_bounds[1], lon_bounds[2], lat_bounds[2], lon_bounds[3], lat_bounds[3]);
+    }
+
+  if ( nout > 0 )
+    cdoWarning("%d of %d grid cells have wrong orientation!", nout, gridsize);
+}
+
+
+void make_cyclic(double *array1, double *array2, int nlon, int nlat)
+{
+  int i, j;
+  int ij1, ij2;
+
+  for ( j = 0; j < nlat; ++j )
+    {
+      for ( i = 0; i < nlon; ++i )
+	{
+	  ij1 = j*nlon+i;
+	  ij2 = j*(nlon+1)+i;
+	  array2[ij2] = array1[ij1];
+	}
+    }
+
+  for ( j = 0; j < nlat; ++j )
+    {
+      ij2 = j*(nlon+1);
+      array2[ij2+nlon] = array2[ij2];
+    }
+}
+
+
+void *Outputgmt(void *argument)
+{
+  int GRIDVERIFY, OUTPUTCENTER, OUTPUTCENTER2, OUTPUTCENTERCPT, OUTPUTBOUNDS;
+  int OUTPUTBOUNDSCPT, OUTPUTVECTOR, OUTPUTTRI, OUTPUTVRML;
+  int operatorID;
+  int process_data = TRUE;
+  int i, j;
+  int varID0, varID, recID;
+  int nvals;
+  int gridsize = 0;
+  int gridsize2 = 0;
+  int gridID, code;
+  int nrecs;
+  int levelID;
+  int tsID;
+  int streamID = 0;
+  int vlistID;
+  int nmiss;
+  int nlon, nlat, nalloc;
+  int nlev, lzon = FALSE, lmer = FALSE, lhov = FALSE;
+  int gridcorners = 0, ic;
+  int status;
+  int lgrid_gen_bounds = FALSE, luse_grid_corner = FALSE;
+  int zaxisID, taxisID;
+  int ninc = 1;
+  int vdate, vtime;
+  char varname[CDI_MAX_NAME];
+  double level;
+  double missval;
+  double *array = NULL;
+  double *array2 = NULL;
+  double *parray;
+  double *uf = NULL, *vf = NULL, *alpha = NULL, *auv = NULL;
+  double *grid_center_lat = NULL, *grid_center_lon = NULL;
+  double *grid_center_lat2 = NULL, *grid_center_lon2 = NULL;
+  double *grid_corner_lat = NULL, *grid_corner_lon = NULL;
+  double *plat, *plon;
+  double *zaxis_center_lev, *zaxis_lower_lev, *zaxis_upper_lev;
+  int *grid_mask = NULL;
+  FILE *cpt_fp;
+  CPT cpt;
+  int grid_is_circular;
+  char units[CDI_MAX_NAME];
+  char vdatestr[32], vtimestr[32];	  
+
+  cdoInitialize(argument);
+
+  GRIDVERIFY      = cdoOperatorAdd("gridverify",      0, 0, NULL);
+  OUTPUTCENTER    = cdoOperatorAdd("outputcenter",    0, 0, NULL);
+  OUTPUTCENTER2   = cdoOperatorAdd("outputcenter2",   0, 0, NULL);
+  OUTPUTCENTERCPT = cdoOperatorAdd("outputcentercpt", 0, 0, NULL);
+  OUTPUTBOUNDS    = cdoOperatorAdd("outputbounds",    0, 0, NULL);
+  OUTPUTBOUNDSCPT = cdoOperatorAdd("outputboundscpt", 0, 0, NULL);
+  OUTPUTVECTOR    = cdoOperatorAdd("outputvector",    0, 0, NULL);
+  OUTPUTTRI       = cdoOperatorAdd("outputtri",       0, 0, NULL);
+  OUTPUTVRML      = cdoOperatorAdd("outputvrml",      0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == OUTPUTVECTOR )
+    {
+      operatorInputArg("increment");
+      operatorCheckArgc(1);
+      ninc  = atoi(operatorArgv()[0]);
+      if ( ninc < 1 ) cdoAbort("Increment must be greater than 0!");
+    }
+
+  if ( operatorID == GRIDVERIFY  )
+    {
+      process_data = FALSE;
+      luse_grid_corner = TRUE;
+    }
+
+  if ( operatorID == OUTPUTBOUNDS || operatorID == OUTPUTBOUNDSCPT )
+    luse_grid_corner = TRUE;
+
+  if ( operatorID == OUTPUTCENTERCPT || operatorID == OUTPUTBOUNDSCPT || operatorID == OUTPUTVRML )
+    {
+      char *cpt_file;
+
+      cpt_file = operatorArgv()[0];
+
+      if ( (cpt_fp = fopen (cpt_file, "r")) == NULL )
+	cdoAbort("Open failed on color palette table %s", cpt_file);
+
+      status = cptRead(cpt_fp, &cpt);
+      if ( status != 0 )
+	cdoAbort("Error during read of color palette table %s", cpt_file);
+      
+      if ( cdoVerbose ) cptWrite(stderr, cpt);
+    }
+
+  streamID = streamOpenRead(cdoStreamName(0));
+
+  vlistID = streamInqVlist(streamID);
+  taxisID = vlistInqTaxis(vlistID);
+
+  varID = 0;
+  vlistInqVarName(vlistID, varID, varname);
+  code    = vlistInqVarCode(vlistID, varID);
+  gridID  = vlistInqVarGrid(vlistID, varID);
+  zaxisID = vlistInqVarZaxis(vlistID, varID);
+  missval = vlistInqVarMissval(vlistID, varID);
+
+  if ( gridInqType(gridID) == GRID_GME ) gridID = gridToUnstructured(gridID, 1);
+
+  if ( gridInqType(gridID) != GRID_UNSTRUCTURED && gridInqType(gridID) != GRID_CURVILINEAR )
+    {
+      gridID = gridToCurvilinear(gridID, 1);
+      lgrid_gen_bounds = TRUE;
+    }
+
+  gridsize = gridInqSize(gridID);
+  nlon     = gridInqXsize(gridID);
+  nlat     = gridInqYsize(gridID);
+  nlev     = zaxisInqSize(zaxisID);
+
+  if ( gridInqMaskGME(gridID, NULL) )
+    {
+      grid_mask = (int *) malloc(gridsize*sizeof(int));
+      gridInqMaskGME(gridID, grid_mask);
+    }
+
+  if ( gridInqType(gridID) != GRID_UNSTRUCTURED )
+    {
+      if ( nlon == 1 && nlat  > 1 && nlev == 1 ) lhov = TRUE;
+      if ( nlon == 1 && nlat  > 1 && nlev  > 1 ) lzon = TRUE;
+      if ( nlon  > 1 && nlat == 1 && nlev  > 1 ) lmer = TRUE;
+    }
+  else
+    {
+      nlat = 1;
+    }
+
+  if ( cdoVerbose && lhov ) cdoPrint("Process hovmoeller data");
+  if ( cdoVerbose && lzon ) cdoPrint("Process zonal data");
+  if ( cdoVerbose && lmer ) cdoPrint("Process meridional data");
+  /*
+  if ( lzon || lmer ) 
+    {
+      if ( operatorID == OUTPUTBOUNDS || operatorID == OUTPUTBOUNDSCPT )
+	cdoAbort("Bounds not available for zonal/meridional data!");
+    }
+  */
+  if ( lhov ) 
+    {
+      if ( operatorID == OUTPUTBOUNDS || operatorID == OUTPUTBOUNDSCPT )
+	cdoAbort("Bounds not available hovmoeller data!");
+    }
+
+  if ( gridInqType(gridID) == GRID_UNSTRUCTURED )
+    gridcorners = gridInqNvertex(gridID);
+  else
+    gridcorners = 4;
+
+  grid_is_circular = gridIsCircular(gridID);
+
+  grid_center_lat = (double *) malloc(gridsize*sizeof(double));
+  grid_center_lon = (double *) malloc(gridsize*sizeof(double));
+
+  gridInqYvals(gridID, grid_center_lat);
+  gridInqXvals(gridID, grid_center_lon);
+
+  /* Convert lat/lon units if required */
+  gridInqXunits(gridID, units);
+  gridToDegree(units, "grid center lon", gridsize, grid_center_lon);
+  gridInqYunits(gridID, units);
+  gridToDegree(units, "grid center lat", gridsize, grid_center_lat);
+
+  nvals = gridsize;
+  plon = grid_center_lon;
+  plat = grid_center_lat;
+
+  if ( operatorID == OUTPUTCENTER2 && grid_is_circular )
+    {
+      int ij2;
+
+      gridsize2 = nlat*(nlon+1);
+
+      grid_center_lat2 = (double *) malloc(gridsize2*sizeof(double));
+      grid_center_lon2 = (double *) malloc(gridsize2*sizeof(double));
+
+      make_cyclic(grid_center_lat, grid_center_lat2, nlon, nlat);
+      make_cyclic(grid_center_lon, grid_center_lon2, nlon, nlat);
+
+      for ( j = 0; j < nlat; ++j )
+	{
+	  ij2 = j*(nlon+1);
+	  grid_center_lon2[ij2+nlon] += 360;
+	}
+
+      nvals = gridsize2;
+      plon = grid_center_lon2;
+      plat = grid_center_lat2;
+    }
+
+  zaxis_center_lev = (double *) malloc(nlev*sizeof(double));
+  zaxis_lower_lev  = (double *) malloc(nlev*sizeof(double));
+  zaxis_upper_lev  = (double *) malloc(nlev*sizeof(double));
+
+  zaxisInqLevels(zaxisID, zaxis_center_lev);
+
+  if ( luse_grid_corner )
+    {
+      if ( gridcorners == 0 ) cdoAbort("grid corner missing!");
+      nalloc = gridcorners*gridsize;
+      grid_corner_lat = (double *) realloc(grid_corner_lat, nalloc*sizeof(double));
+      grid_corner_lon = (double *) realloc(grid_corner_lon, nalloc*sizeof(double));
+
+      if ( gridInqYbounds(gridID, NULL) && gridInqXbounds(gridID, NULL) )
+	{
+	  gridInqYbounds(gridID, grid_corner_lat);
+	  gridInqXbounds(gridID, grid_corner_lon);
+	}
+      else
+	{
+	  if ( lgrid_gen_bounds )
+	    {
+	      if ( ! lzon ) genXbounds(nlon, nlat, grid_center_lon, grid_corner_lon, 0);
+	      if ( ! lmer ) genYbounds(nlon, nlat, grid_center_lat, grid_corner_lat);
+	    }
+	  else
+	    cdoAbort("Grid corner missing!");
+	}
+
+
+      /* Note: using units from latitude instead from bounds */
+      gridToDegree(units, "grid corner lon", gridcorners*gridsize, grid_corner_lon);
+      gridToDegree(units, "grid corner lat", gridcorners*gridsize, grid_corner_lat);
+
+      if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	{
+	  zaxisInqLbounds(zaxisID, zaxis_lower_lev);
+	  zaxisInqUbounds(zaxisID, zaxis_upper_lev);
+	}
+      else
+	{
+	  zaxis_lower_lev[0] = zaxis_center_lev[0];
+	  for ( i = 1; i < nlev; ++i )
+	    zaxis_lower_lev[i] = 0.5*(zaxis_center_lev[i] + zaxis_center_lev[i-1]);
+
+	  zaxis_upper_lev[nlev-1] = zaxis_center_lev[nlev-1];
+	  for ( i = 0; i < nlev-1; ++i )
+	    zaxis_upper_lev[i] = zaxis_lower_lev[i+1];
+
+	  if ( cdoVerbose )
+	    for ( i = 0; i < nlev; ++i )
+	      printf("level: %d %g %g %g\n",
+		     i+1, zaxis_lower_lev[i], zaxis_center_lev[i], zaxis_upper_lev[i]);
+	}
+    }
+
+  array = (double *) malloc(gridsize*sizeof(double));
+  parray = array;
+						
+  if ( operatorID == OUTPUTCENTER2 && grid_is_circular )
+    {
+      array2 = (double *) malloc(nlat*(nlon+1)*sizeof(double));
+      parray = array2;
+    }
+
+  if ( operatorID == OUTPUTVECTOR )
+    {
+      uf    = (double *) malloc(gridsize*sizeof(double));
+      vf    = (double *) malloc(gridsize*sizeof(double));
+      alpha = (double *) malloc(gridsize*sizeof(double));
+      auv   = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  if ( operatorID == GRIDVERIFY )
+    verify_grid(gridInqType(gridID), gridsize, gridcorners,
+		grid_center_lon, grid_center_lat,
+		grid_corner_lon, grid_corner_lat);
+
+  tsID = 0;
+  if ( process_data )
+  while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID);
+      vtime = taxisInqVtime(taxisID);
+	      
+      date2str(vdate, vdatestr, sizeof(vdatestr));
+      time2str(vtime, vtimestr, sizeof(vtimestr));
+
+      if ( tsID == 0 && operatorID != OUTPUTTRI )
+	{
+	  if ( operatorID == OUTPUTVRML )
+	    printf("#VRML V2.0 utf8\n\n");
+#if defined (VERSION)
+	  fprintf(stdout, "# Generated by CDO version %s\n", VERSION);
+	  fprintf(stdout, "#\n");
+#endif
+	  fprintf(stdout, "# Operator = %s\n", cdoOperatorName(operatorID));
+	  if      ( lhov )  fprintf(stdout, "# Mode     = hovmoeller\n");
+	  else if ( lzon )  fprintf(stdout, "# Mode     = zonal\n");
+	  else if ( lmer )  fprintf(stdout, "# Mode     = meridional\n");
+	  else              fprintf(stdout, "# Mode     = horizonal\n");
+
+	  if ( operatorID == OUTPUTVECTOR )
+	    fprintf(stdout, "# Increment = %d\n", ninc);
+	  fprintf(stdout, "#\n");
+	  fprintf(stdout, "# File  = %s\n", cdoStreamName(0));
+	  fprintf(stdout, "# Date  = %s\n", vdatestr);
+	  fprintf(stdout, "# Time  = %s\n", vtimestr);
+	  fprintf(stdout, "# Name  = %s\n", varname);
+	  fprintf(stdout, "# Code  = %d\n", code);
+	}
+
+      varID0 = varID;
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID, &varID, &levelID);
+
+	  if ( varID != varID0 ) continue;
+	  if ( recID > 0 && !lzon && !lmer ) continue;
+
+	  streamReadRecord(streamID, array, &nmiss);
+
+	  if ( operatorID == OUTPUTCENTER2 && grid_is_circular )
+	    make_cyclic(array, array2, nlon, nlat);
+
+	  level = zaxis_center_lev[levelID];
+
+	  if ( (tsID == 0 || lzon || lmer) && operatorID != OUTPUTTRI )
+	    fprintf(stdout, "# Level = %g\n", level);
+	  if ( lhov )
+	    fprintf(stdout, "# Timestep = %d\n", tsID+1);
+
+	  if ( operatorID != OUTPUTTRI ) fprintf(stdout, "#\n");
+
+	  if ( operatorID == OUTPUTCENTER || operatorID == OUTPUTCENTER2 || operatorID == OUTPUTCENTERCPT )
+	    {
+	      for ( i = 0; i < nvals; i++ )
+		{
+		  if ( grid_mask )
+		    if ( grid_mask[i] == 0 ) continue;
+
+		  if ( operatorID == OUTPUTCENTERCPT )
+		    {
+		      int r = 0, g = 0, b = 0, n;
+
+		      if ( !DBL_IS_EQUAL(array[i], missval) )
+			{
+			  for ( n = 0; n < cpt.ncolors; n++ )
+			    if ( array[i] > cpt.lut[n].z_low && array[i] <= cpt.lut[n].z_high ) break;
+
+			  if ( n == cpt.ncolors )
+			    {
+			      r = cpt.bfn[0].rgb[0];  g = cpt.bfn[0].rgb[1];  b = cpt.bfn[0].rgb[2];
+			    }
+			  else
+			    {
+			      r = cpt.lut[n].rgb_high[0];  g = cpt.lut[n].rgb_high[1];  b = cpt.lut[n].rgb_high[2];
+			    }
+			}
+		      else
+			{
+			  r = cpt.bfn[2].rgb[0];  g = cpt.bfn[2].rgb[1];  b = cpt.bfn[2].rgb[2]; 
+			}
+		    }
+
+		  if ( operatorID == OUTPUTCENTER )
+		    {
+		      if ( lzon )
+			fprintf(stdout, " %g  %g  %g\n", grid_center_lat[i], level, array[i]);
+		      else if ( lmer )
+			fprintf(stdout, " %g  %g  %g\n", grid_center_lon[i], level, array[i]);
+		      else if ( lhov )
+			fprintf(stdout, " %d  %g  %g\n", tsID+1, grid_center_lat[i], array[i]);
+		      else
+			fprintf(stdout, " %g  %g  %g\n", grid_center_lon[i], grid_center_lat[i], array[i]);
+		    }
+		  else if ( operatorID == OUTPUTCENTER2 )
+		    {
+		      fprintf(stdout, " %g  %g  %g\n", plon[i], plat[i], parray[i]);
+		    }
+		  else
+		    {
+		      if ( lzon )
+			fprintf(stdout, " %g  %g  %g\n", grid_center_lat[i], level, array[i]);
+		      else if ( lmer )
+			fprintf(stdout, " %g  %g  %g\n", grid_center_lon[i], level, array[i]);
+		      else
+			fprintf(stdout, " %g  %g  %g  %g\n", grid_center_lon[i], grid_center_lat[i], array[i], array[i]);
+		    }
+		}
+	      fprintf(stdout, "#\n");
+	    }
+	  else if ( operatorID == OUTPUTTRI )
+	    {
+	      int ij, c1, c2, c3;
+	      int mlon, ip1;
+	      if ( gridInqType(gridID) != GRID_CURVILINEAR ) cdoAbort("Unsupported grid!");
+
+	      mlon = nlon-1;
+	      /* if ( gridIsCircular(gridID) ) mlon = nlon; */
+	      for ( j = 0; j < nlat-1; ++j )
+		{
+		  for ( i = 0; i < mlon; ++i )
+		    {
+		      ip1 = i+1;
+		      if ( i == nlon-1 ) ip1 = 0;
+		      ij = j*nlon+i;
+		      c1 = (j)*nlon+ip1;
+		      c2 = (j)*nlon+i;
+		      c3 = (j+1)*nlon+i;
+		      fprintf(stdout, "%d   %d   %d\n", c1, c2, c3);
+		      c1 = (j)*nlon+i+1;
+		      c2 = (j+1)*nlon+i;
+		      c3 = (j+1)*nlon+ip1;
+		      fprintf(stdout, "%d   %d   %d\n", c1, c2, c3);
+		    }
+		}
+	    }
+	  else if ( operatorID == OUTPUTVECTOR )
+	    {
+	      if ( nrecs < 2 ) cdoAbort("Too few fields!");
+
+	      memcpy(uf, array, gridsize*sizeof(double));
+	      streamInqRecord(streamID, &varID, &levelID);
+	      streamReadRecord(streamID, vf, &nmiss);
+
+	      for ( j = 0; j < nlat; j += ninc )
+		for ( i = 0; i < nlon; i += ninc )
+		  {
+		    /* compute length of velocity vector */
+		    auv[IX2D(j,i,nlon)] = sqrt(uf[IX2D(j,i,nlon)]*uf[IX2D(j,i,nlon)] + 
+					       vf[IX2D(j,i,nlon)]*vf[IX2D(j,i,nlon)]);
+
+		    alpha[IX2D(j,i,nlon)] = atan2(vf[IX2D(j,i,nlon)],uf[IX2D(j,i,nlon)]);
+		    alpha[IX2D(j,i,nlon)] = 90. - alpha[IX2D(j,i,nlon)]*RAD2DEG;
+
+		    if ( alpha[IX2D(j,i,nlon)] <   0 ) alpha[IX2D(j,i,nlon)] += 360;
+		    if ( alpha[IX2D(j,i,nlon)] > 360 ) alpha[IX2D(j,i,nlon)] -= 360;
+
+		    if ( fabs(auv[IX2D(j,i,nlon)]) > 0 )
+		      fprintf(stdout, " %g  %g  %g  %g\n",
+			      grid_center_lon[IX2D(j,i,nlon)], grid_center_lat[IX2D(j,i,nlon)],
+			      alpha[IX2D(j,i,nlon)], auv[IX2D(j,i,nlon)]);
+		  }
+
+	      fprintf(stdout, "#\n");
+	      break;
+	    }
+	  else if ( operatorID == OUTPUTVRML )
+	    {
+	      double minval = 1e33;
+	      double maxval = -1e33;
+	      double meanval = 0;
+	      for ( i = 0; i < gridsize; i++ )
+		{
+		  if ( array[i] < minval ) minval = array[i];
+		  if ( array[i] > maxval ) maxval = array[i];
+		  meanval += array[i];
+		}
+	      meanval /= gridsize;
+
+	      double dx = 10./nlon;
+
+	      printf("Viewpoint {\n");
+	      printf("  description \"viewpoint1\"\n");
+	      printf("  orientation 0 0 1 0\n");
+	      printf("  position 0.0 0.0 10.0\n");
+	      printf("}\n");
+	      printf("\n");
+	      printf("Background {\n");
+	      printf("  skyColor [\n");
+	      printf("    0.0 0.1 0.8,\n");
+	      printf("    0.0 0.5 1.0,\n");
+	      printf("    1.0 1.0 1.0\n");
+	      printf("  ]\n");
+	      printf("  skyAngle [0.785, 1.571]\n");
+	      printf("\n");
+	      printf("  groundColor [\n");
+	      printf("    0.0 0.0 0.0,\n");
+	      printf("    0.3 0.3 0.3,\n");
+	      printf("    0.5 0.5 0.5\n");
+	      printf("  ]\n");
+	      printf("  groundAngle [0.785, 1.571]\n");
+	      printf("}\n");
+	      printf("\n");
+	      printf("Transform {\n");
+	      printf("  children [\n");
+	      printf("    Shape {\n");
+	      printf("      appearance Appearance {\n");
+	      printf("        material Material {}\n");
+	      printf("      }\n");
+	      printf("      geometry ElevationGrid {\n");
+    	      printf("        colorPerVertex TRUE\n");
+    	      printf("        solid FALSE\n");
+    	      printf("        xDimension %d\n", nlon);
+    	      printf("        zDimension %d\n", nlat);
+    	      printf("        xSpacing %g\n", dx);
+    	      printf("        zSpacing %g\n", dx);
+	      printf("        color Color {\n");
+	      printf("          color [\n");
+	      for ( j = nlat-1; j >= 0 ; --j )
+		for ( i = 0; i < nlon; ++i )
+		{
+		  int r = 0, g = 0, b = 0, n;
+		  double val = array[j*nlon+i];
+
+		  if ( !DBL_IS_EQUAL(val, missval) )
+		    {
+		      for ( n = 0; n < cpt.ncolors; n++ )
+			if ( val > cpt.lut[n].z_low && val <= cpt.lut[n].z_high ) break;
+		      
+		      if ( n == cpt.ncolors )
+			{
+			  r = cpt.bfn[0].rgb[0];  g = cpt.bfn[0].rgb[1];  b = cpt.bfn[0].rgb[2];
+			}
+		      else
+			{
+			  //  r = cpt.lut[n].rgb_high[0];  g = cpt.lut[n].rgb_high[1];  b = cpt.lut[n].rgb_high[2];
+			  r = intlin(val, cpt.lut[n].rgb_low[0], cpt.lut[n].z_low, cpt.lut[n].rgb_high[0], cpt.lut[n].z_high);
+			  g = intlin(val, cpt.lut[n].rgb_low[1], cpt.lut[n].z_low, cpt.lut[n].rgb_high[1], cpt.lut[n].z_high);
+			  b = intlin(val, cpt.lut[n].rgb_low[2], cpt.lut[n].z_low, cpt.lut[n].rgb_high[2], cpt.lut[n].z_high);
+			}
+		    }
+		  else
+		    {
+		      r = cpt.bfn[2].rgb[0];  g = cpt.bfn[2].rgb[1];  b = cpt.bfn[2].rgb[2]; 
+		    }
+		  printf(" %.3g %.3g %.3g,\n", r/255., g/255., b/255.);
+		}
+	      printf("          ]\n");
+	      printf("        }\n");
+    	      printf("        height [\n");
+	      //	      for ( j = 0; j < nlat; ++j )
+	      for ( j = nlat-1; j >= 0 ; --j )
+		{
+		  for ( i = 0; i < nlon; ++i )
+		    {
+		      printf("%g,\n", array[j*nlon+i]);
+		    }
+		}
+    	      printf("        ]\n");
+	      printf("      }\n");
+	      printf("    }\n");
+	      printf("  ]\n");
+	      printf("  translation -5 0 %g\n", -5.*nlat/nlon);
+	      printf("  rotation 0.0 0.0 0.0 0.0\n");
+	      printf("  scale 1.0 %g 1.0\n", 0.5/(maxval-minval));
+	      printf("}\n");
+            }
+	  else if ( operatorID == OUTPUTBOUNDS || operatorID == OUTPUTBOUNDSCPT )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		{
+		  if ( grid_mask )
+		    if ( grid_mask[i] == 0 ) continue;
+
+		  if ( !DBL_IS_EQUAL(array[i], missval) )
+		    fprintf(stdout, "> -Z%g", array[i]);
+		  else
+		    fprintf(stdout, "> -ZNaN");
+
+		  if ( operatorID == OUTPUTBOUNDSCPT )
+		    {
+		      int r = 0, g = 0, b = 0, n;
+
+		      if ( !DBL_IS_EQUAL(array[i], missval) )
+			{
+			  for ( n = 0; n < cpt.ncolors; n++ )
+			    if ( array[i] > cpt.lut[n].z_low && array[i] <= cpt.lut[n].z_high ) break;
+
+			  if ( n == cpt.ncolors )
+			    {
+			      r = cpt.bfn[0].rgb[0];  g = cpt.bfn[0].rgb[1];  b = cpt.bfn[0].rgb[2];
+			    }
+			  else
+			    {
+			      r = cpt.lut[n].rgb_high[0];  g = cpt.lut[n].rgb_high[1];  b = cpt.lut[n].rgb_high[2];
+			    }
+			}
+		      else
+			{
+			  r = cpt.bfn[2].rgb[0];  g = cpt.bfn[2].rgb[1];  b = cpt.bfn[2].rgb[2]; 
+			}
+
+		      fprintf(stdout, " -G%d/%d/%d", r, g, b);
+		    }
+
+		  fprintf(stdout, "\n");
+
+		  if ( lzon )
+		    {
+		      double xlev[4], xlat[4];
+		      double levmin = zaxis_lower_lev[levelID];
+		      double levmax = zaxis_upper_lev[levelID];
+		      double latmin = grid_corner_lat[i*4+0];
+		      double latmax = grid_corner_lat[i*4+0];
+		      for ( ic = 1; ic < 4; ic++ )
+			{
+			  if ( grid_corner_lat[i*4+ic] < latmin ) latmin = grid_corner_lat[i*4+ic];
+			  if ( grid_corner_lat[i*4+ic] > latmax ) latmax = grid_corner_lat[i*4+ic];
+			}
+		      xlev[0] = levmin;
+		      xlev[1] = levmax;
+		      xlev[2] = levmax;
+		      xlev[3] = levmin;
+		      xlat[0] = latmin;
+		      xlat[1] = latmin;
+		      xlat[2] = latmax;
+		      xlat[3] = latmax;
+		      for ( ic = 0; ic < 4; ic++ )
+			fprintf(stdout, "   %g  %g\n", xlat[ic], xlev[ic]);
+		      fprintf(stdout, "   %g  %g\n", xlat[0], xlev[0]);
+		    }
+		  else if ( lmer )
+		    {
+		      double xlev[4], xlon[4];
+		      double levmin = zaxis_lower_lev[levelID];
+		      double levmax = zaxis_upper_lev[levelID];
+		      double lonmin = grid_corner_lon[i*4+0];
+		      double lonmax = grid_corner_lon[i*4+0];
+		      for ( ic = 1; ic < 4; ic++ )
+			{
+			  if ( grid_corner_lon[i*4+ic] < lonmin ) lonmin = grid_corner_lon[i*4+ic];
+			  if ( grid_corner_lon[i*4+ic] > lonmax ) lonmax = grid_corner_lon[i*4+ic];
+			}
+		      xlev[0] = levmin;
+		      xlev[1] = levmin;
+		      xlev[2] = levmax;
+		      xlev[3] = levmax;
+		      xlon[0] = lonmin;
+		      xlon[1] = lonmax;
+		      xlon[2] = lonmax;
+		      xlon[3] = lonmin;
+		      for ( ic = 0; ic < 4; ic++ )
+			fprintf(stdout, "   %g  %g\n", xlon[ic], xlev[ic]);
+		      fprintf(stdout, "   %g  %g\n", xlon[0], xlev[0]);
+		    }
+		  else if ( lhov )
+		    {
+		      cdoAbort("Implementation for hovmoeller data missing!\n");
+		    }
+		  else
+		    {
+		      for ( ic = 0; ic < gridcorners; ic++ )
+			fprintf(stdout, "   %g  %g\n",
+				grid_corner_lon[i*gridcorners+ic], grid_corner_lat[i*gridcorners+ic]);
+		      fprintf(stdout, "   %g  %g\n",
+			      grid_corner_lon[i*gridcorners], grid_corner_lat[i*gridcorners]);
+		    }
+		}
+	      fprintf(stdout, "\n");
+	    }
+	}
+
+      if ( ! lhov ) break;
+
+      tsID++;
+    }
+
+  streamClose(streamID);
+
+  if ( array  ) free(array);
+  if ( array2 ) free(array2);
+  if ( grid_mask ) free(grid_mask);
+  if ( grid_center_lon ) free(grid_center_lon);
+  if ( grid_center_lat ) free(grid_center_lat);
+  if ( grid_center_lon2 ) free(grid_center_lon2);
+  if ( grid_center_lat2 ) free(grid_center_lat2);
+  if ( grid_corner_lon ) free(grid_corner_lon);
+  if ( grid_corner_lat ) free(grid_corner_lat);
+
+  free(zaxis_center_lev);
+  free(zaxis_lower_lev);
+  free(zaxis_upper_lev);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Pinfo.c b/src/Pinfo.c
new file mode 100644
index 0000000..78ff27a
--- /dev/null
+++ b/src/Pinfo.c
@@ -0,0 +1,203 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Pinfo(void *argument)
+{
+  int PINFO, PINFOV;
+  int operatorID;
+  int i;
+  int indg;
+  int varID, recID;
+  int gridsize = 0;
+  int gridID, zaxisID, code;
+  int nrecs;
+  int levelID;
+  int tsID;
+  int taxisID1, taxisID2;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int nmiss;
+  int ivals = 0, imiss = 0;
+  int vdate, vtime;
+  char varname[CDI_MAX_NAME];
+  char vdatestr[32], vtimestr[32];	  
+  double missval;
+  double *array1 = NULL, *array2 = NULL;
+  double level;
+  double arrmin, arrmax, arrmean, arrvar;
+
+  cdoInitialize(argument);
+
+  PINFO  = cdoOperatorAdd("pinfo",  0, 0, NULL);
+  PINFOV = cdoOperatorAdd("pinfov", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+
+  indg = 0;
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      date2str(vdate, vdatestr, sizeof(vdatestr));
+      time2str(vtime, vtimestr, sizeof(vtimestr));
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  if ( tsID == 0 && recID == 0 )
+	    {
+	      if ( operatorID == PINFOV )
+		fprintf(stdout, "   Rec :       Date  Time    Varname     Level    Size    Miss :"
+			    "     Minimum        Mean     Maximum\n");
+	      else
+		fprintf(stdout, "   Rec :       Date  Time    Code  Level    Size    Miss :"
+			"     Minimum        Mean     Maximum\n");
+	    }
+
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  indg += 1;
+	  code     = vlistInqVarCode(vlistID1, varID);
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+
+	  if ( operatorID == PINFOV ) vlistInqVarName(vlistID1, varID, varname);
+
+	  if ( operatorID == PINFOV )
+	    fprintf(stdout, "%6d :%s %s %-8s ", indg, vdatestr, vtimestr, varname);
+	  else
+	    fprintf(stdout, "%6d :%s %s %3d", indg, vdatestr, vtimestr, code);
+
+	  level = zaxisInqLevel(zaxisID, levelID);
+	  fprintf(stdout, " %7g ", level);
+
+	  fprintf(stdout, "%7d %7d :", gridsize, nmiss);
+
+	  if ( gridInqType(gridID) == GRID_SPECTRAL ||
+	       (gridsize == 1 && nmiss == 0) )
+	    {
+	      fprintf(stdout, "            %#12.5g\n", array1[0]);
+	    }
+	  else
+	    {
+	      if ( nmiss > 0 )
+		{
+		  ivals = 0;
+		  arrmean = 0;
+		  arrvar  = 0;
+		  arrmin  =  1.e300;
+		  arrmax  = -1.e300;
+		  for ( i = 0; i < gridsize; i++ )
+		    {
+		      if ( !DBL_IS_EQUAL(array1[i], missval) )
+			{
+			  if ( array1[i] < arrmin ) arrmin = array1[i];
+			  if ( array1[i] > arrmax ) arrmax = array1[i];
+			  arrmean += array1[i];
+			  arrvar  += array1[i]*array1[i];
+			  ivals++;
+			}
+		    }
+		  imiss = gridsize - ivals;
+		  gridsize = ivals;
+		}
+	      else
+		{
+		  arrmean = array1[0];
+		  arrvar  = array1[0];
+		  arrmin  = array1[0];
+		  arrmax  = array1[0];
+		  for ( i = 1; i < gridsize; i++ )
+		    {
+		      if ( array1[i] < arrmin ) arrmin = array1[i];
+		      if ( array1[i] > arrmax ) arrmax = array1[i];
+		      arrmean += array1[i];
+		      arrvar  += array1[i]*array1[i];
+		    }
+		}
+
+	      if ( gridsize )
+		{
+		  arrmean = arrmean/gridsize;
+		  arrvar  = arrvar/gridsize - arrmean*arrmean;
+		  fprintf(stdout, "%#12.5g%#12.5g%#12.5g\n", arrmin, arrmean, arrmax);
+		}
+	      else
+		{
+		  fprintf(stdout, "                     nan\n");
+		}
+
+	      if ( imiss != nmiss && nmiss > 0 )
+		fprintf(stdout, "Found %d of %d missing values!\n", imiss, nmiss);
+	    }
+
+	  for ( i = 0; i < gridsize; i++ ) array2[i] = array1[i];
+
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  streamWriteRecord(streamID2, array2, nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Pressure.c b/src/Pressure.c
new file mode 100644
index 0000000..7421c3e
--- /dev/null
+++ b/src/Pressure.c
@@ -0,0 +1,452 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Pressure    pressure_fl          Pressure on full hybrid levels
+      Pressure    pressure_hl          Pressure on half hybrid levels
+      Pressure    deltap               Difference of two half hybrid levels
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "vinterp.h"
+#include "list.h"
+
+
+void *Pressure(void *argument)
+{
+  int PRESSURE_FL, PRESSURE_HL, DELTAP;
+  int operatorID;
+  int mode;
+  enum {ECHAM_MODE, WMO_MODE};
+  int geop_code = 0, temp_code = 0, ps_code = 0, lsp_code = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridsize, ngp = 0;
+  int recID, nrecs;
+  int i, k, offset;
+  int tsID, varID, levelID;
+  int nvars;
+  int zaxisIDp, zaxisIDh = -1, nzaxis;
+  int ngrids, gridID, zaxisID;
+  int nhlev = 0, nhlevf = 0, nhlevh = 0, nlevel;
+  int nvct;
+  int geopID = -1, tempID = -1, psID = -1, lnpsID = -1, pvarID = -1;
+  int code, param;
+  char paramstr[32];
+  char varname[CDI_MAX_NAME];
+  double minval, maxval;
+  double *vct = NULL;
+  double *ps_prog = NULL, *full_press = NULL, *half_press = NULL, *deltap = NULL;
+  double *pout = NULL;
+  double *pdata = NULL;
+  int taxisID1, taxisID2;
+  int lhavevct;
+  int nmiss;
+  int mono_level;
+  int instNum, tableNum;
+  int useTable;
+
+  cdoInitialize(argument);
+
+  PRESSURE_FL = cdoOperatorAdd("pressure_fl", 0, 0, NULL);
+  PRESSURE_HL = cdoOperatorAdd("pressure_hl", 0, 0, NULL);
+  DELTAP      = cdoOperatorAdd("deltap",      0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  ngrids  = vlistNgrids(vlistID1);
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) != GRID_SPECTRAL )
+	{
+	  ngp = gridInqSize(gridID);
+	  break;
+	}
+    }
+
+  /* check gridsize */
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) != GRID_SPECTRAL )
+	{
+	  if ( ngp != gridInqSize(gridID) )
+	    cdoAbort("Grids have different size!");
+	}
+    }
+
+  nzaxis  = vlistNzaxis(vlistID1);
+  lhavevct = FALSE;
+  for ( i = 0; i < nzaxis; i++ )
+    {
+      mono_level = FALSE;
+      mono_level = TRUE;
+      zaxisID = vlistZaxis(vlistID1, i);
+      nlevel  = zaxisInqSize(zaxisID);
+
+      if ( (zaxisInqType(zaxisID) == ZAXIS_HYBRID || zaxisInqType(zaxisID) == ZAXIS_HYBRID_HALF) &&
+	   nlevel > 1 )
+	{
+	  double *level;
+	  int l;
+	  level = (double *) malloc(nlevel*sizeof(double));
+	  zaxisInqLevels(zaxisID, level);
+	  for ( l = 0; l < nlevel; l++ )
+	    {
+	      if ( (l+1) != (int) (level[l]+0.5) ) break;
+	    }
+	  if ( l == nlevel ) mono_level = TRUE; 
+	  free(level);
+	}
+
+      if ( (zaxisInqType(zaxisID) == ZAXIS_HYBRID || zaxisInqType(zaxisID) == ZAXIS_HYBRID_HALF) &&
+	   nlevel > 1 && mono_level )
+	{
+	  nvct = zaxisInqVctSize(zaxisID);
+	  if ( nlevel == (nvct/2 - 1) )
+	    {
+	      if ( lhavevct == FALSE )
+		{
+		  lhavevct = TRUE;
+		  zaxisIDh = zaxisID;
+		  nhlev    = nlevel;
+		  nhlevf   = nhlev;
+		  nhlevh   = nhlevf + 1;
+	      
+		  vct = (double *) malloc(nvct*sizeof(double));
+		  zaxisInqVct(zaxisID, vct);
+		}
+	    }
+	  else if ( nlevel == (nvct/2) )
+	    {
+	      if ( lhavevct == FALSE )
+		{
+		  lhavevct = TRUE;
+		  zaxisIDh = zaxisID;
+		  nhlev    = nlevel;
+		  nhlevf   = nhlev - 1;
+		  nhlevh   = nhlev;
+	      
+		  vct = (double *) malloc(nvct*sizeof(double));
+		  zaxisInqVct(zaxisID, vct);
+		}
+	    }
+	  else if ( nlevel == (nvct - 4 - 1) )
+	    {
+	      if ( lhavevct == FALSE )
+		{
+		  int vctsize;
+		  int voff = 4;
+		  double *rvct = NULL;
+
+		  rvct = (double *) malloc(nvct*sizeof(double));
+		  zaxisInqVct(zaxisID,rvct);
+
+		  if ( (int)(rvct[0]+0.5) == 100000 && rvct[voff] < rvct[voff+1] )
+		    {
+		      lhavevct = TRUE;
+		      zaxisIDh = zaxisID;
+		      nhlev    = nlevel;
+		      nhlevf   = nhlev;
+		      nhlevh   = nhlev + 1;
+
+		      vctsize = 2*nhlevh;
+		      vct = (double *) malloc(vctsize*sizeof(double));
+
+		      /* calculate VCT for LM */
+
+		      for ( i = 0; i < vctsize/2; i++ )
+			{
+			  if ( rvct[voff+i] >= rvct[voff] && rvct[voff+i] <= rvct[3] )
+			    {
+			      vct[i] = rvct[0]*rvct[voff+i];
+			      vct[vctsize/2+i] = 0;
+			    }
+			  else
+			    {
+			      vct[i] = (rvct[0]*rvct[3]*(1-rvct[voff+i]))/(1-rvct[3]);
+			      vct[vctsize/2+i] = (rvct[voff+i]-rvct[3])/(1-rvct[3]);
+			    }
+			}
+		      
+		      if ( cdoVerbose )
+			{
+			  for ( i = 0; i < vctsize/2; i++ )
+			    fprintf(stdout, "%5d %25.17f %25.17f\n", i, vct[i], vct[vctsize/2+i]);
+			}
+		    }
+		  free(rvct);
+		}
+	    }
+	}
+    }
+
+
+  nvars = vlistNvars(vlistID1);
+
+  if ( zaxisIDh != -1 && ngp > 0 )
+    {
+      ps_prog    = (double *) malloc(ngp*sizeof(double));
+      deltap     = (double *) malloc(ngp*nhlevf*sizeof(double));
+      full_press = (double *) malloc(ngp*nhlevf*sizeof(double));
+      half_press = (double *) malloc(ngp*nhlevh*sizeof(double));
+    }
+  else
+    cdoAbort("No data on hybrid model level found!");
+
+  if ( operatorID == PRESSURE_FL || operatorID == DELTAP )
+    zaxisIDp = zaxisCreate(ZAXIS_HYBRID, nhlevf);
+  else
+    zaxisIDp = zaxisCreate(ZAXIS_HYBRID_HALF, nhlevh);
+
+  {
+    double *level;
+    int l;
+    level = (double *) malloc(nhlevh*sizeof(double));
+    for ( l = 0; l < nhlevh; l++ ) level[l] = l+1;
+    zaxisDefLevels(zaxisIDp, level);
+    free(level);
+  }
+
+  zaxisDefVct(zaxisIDp, 2*nhlevh, vct);
+
+  useTable = FALSE;
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      tableNum = tableInqNum(vlistInqVarTable(vlistID1, varID));
+
+      if ( tableNum > 0 && tableNum != 255 )
+	{
+	  useTable = TRUE;
+	  break;
+	}
+    }
+
+  if ( cdoVerbose && useTable ) cdoPrint("Use code tables!");
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(zaxisID);
+      instNum  = institutInqCenter(vlistInqVarInstitut(vlistID1, varID));
+      tableNum = tableInqNum(vlistInqVarTable(vlistID1, varID));
+
+      code     = vlistInqVarCode(vlistID1, varID);
+      param    = vlistInqVarParam(vlistID1, varID);
+
+      cdiParamToString(param, paramstr, sizeof(paramstr));
+
+      if ( useTable )
+	{
+	  if ( tableNum == 2 )
+	    {
+	      mode = WMO_MODE;
+	      geop_code  =   6;
+	      temp_code  =  11;
+	      ps_code    =   1;
+	    }
+	  else if ( tableNum == 128 )
+	    {
+	      mode = ECHAM_MODE;
+	      geop_code  = 129;
+	      temp_code  = 130;
+	      ps_code    = 134;
+	      lsp_code   = 152;
+	    }
+	  else
+	    mode = -1;
+	}
+      else
+	{
+	  mode = ECHAM_MODE;
+	  geop_code  = 129;
+	  temp_code  = 130;
+	  ps_code    = 134;
+	  lsp_code   = 152;
+	}
+
+      if ( cdoVerbose )
+	cdoPrint("Mode = %d  Center = %d  Param = %s", mode, instNum, paramstr);
+
+      if ( code <= 0 )
+	{
+	  vlistInqVarName(vlistID1, varID, varname);
+
+	  strtolower(varname);
+
+	  /*                        ECHAM                            ECMWF       */
+	  if      ( strcmp(varname, "geosp") == 0 || strcmp(varname, "z")    == 0 ) code = 129;
+	  else if ( strcmp(varname, "st")    == 0 || strcmp(varname, "t")    == 0 ) code = 130;
+	  else if ( strcmp(varname, "aps")   == 0 || strcmp(varname, "sp"  ) == 0 ) code = 134;
+	  else if ( strcmp(varname, "ps")    == 0 )                                 code = 134;
+	  else if ( strcmp(varname, "lsp")   == 0 || strcmp(varname, "lnsp") == 0 ) code = 152;
+	  /* else if ( strcmp(varname, "geopoth") == 0 ) code = 156; */
+	}
+
+      if ( mode == ECHAM_MODE )
+	{
+	  if      ( code == geop_code  && nlevel == 1     ) geopID  = varID;
+	  else if ( code == temp_code  && nlevel == nhlev ) tempID  = varID;
+	  else if ( code == ps_code    && nlevel == 1     ) psID    = varID;
+	  else if ( code == lsp_code   && nlevel == 1     ) lnpsID  = varID;
+	  /* else if ( code == 156 ) gheightID = varID; */
+	}
+      else if ( mode == WMO_MODE )
+	{
+	  if      ( code == geop_code  && nlevel == 1     ) geopID  = varID;
+	  else if ( code == temp_code  && nlevel == nhlev ) tempID  = varID;
+	  else if ( code == ps_code    && nlevel == 1     ) psID    = varID;
+	}
+    }
+
+  pvarID = lnpsID;
+  if ( zaxisIDh != -1 && lnpsID != -1 )
+    {
+      gridID = vlistInqVarGrid(vlistID1, lnpsID);
+      if ( gridInqType(gridID) == GRID_SPECTRAL )
+	{
+	  lnpsID = -1;
+	  cdoWarning("Spectral LOG surface pressure not supported - using surface pressure!");
+	}
+    }
+
+  if ( zaxisIDh != -1 && lnpsID == -1 )
+    {
+      pvarID = psID;
+      if ( psID == -1 )
+	cdoAbort("Surface pressure not found!");
+    }
+
+  gridID = vlistInqVarGrid(vlistID1, pvarID);
+  if ( gridInqType(gridID) == GRID_SPECTRAL )
+    cdoAbort("Surface pressure on spectral representation not supported!");
+
+  gridsize = gridInqSize(gridID);
+  pdata = (double *) malloc(gridsize*sizeof(double));
+
+
+  vlistID2 = vlistCreate();
+  varID = vlistDefVar(vlistID2, gridID, zaxisIDp, TSTEP_INSTANT);
+  vlistDefVarCode(vlistID2, varID, 1);
+  vlistDefVarName(vlistID2, varID, "pressure");
+  vlistDefVarLongname(vlistID2, varID, "Air pressure");
+  vlistDefVarStdname(vlistID2, varID, "air_pressure");
+  vlistDefVarUnits(vlistID2, varID, "Pa");
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( varID == pvarID )
+	    {	  
+	      streamReadRecord(streamID1, pdata, &nmiss);
+	      if ( nmiss > 0 ) cdoAbort("Missing valus unsupported!");
+	    }
+	}
+
+      if ( zaxisIDh != -1 )
+	{
+	  if ( lnpsID != -1 )
+	    for ( i = 0; i < ngp; i++ ) ps_prog[i] = exp(pdata[i]);
+	  else if ( psID != -1 )
+	    memcpy(ps_prog, pdata, ngp*sizeof(double));
+
+	  /* check range of ps_prog */
+	  minmaxval(ngp, ps_prog, NULL, &minval, &maxval);
+	  if ( minval < MIN_PS || maxval > MAX_PS )
+	    cdoWarning("Surface pressure out of range (min=%g max=%g)!", minval, maxval);
+	    
+	  presh(full_press, half_press, vct, ps_prog, nhlevf, ngp);
+	}
+
+      if ( operatorID == PRESSURE_FL )
+	{
+	  nlevel = nhlevf;
+	  pout = full_press;
+	}
+      else if ( operatorID == DELTAP )
+	{
+	  nlevel = nhlevf;
+	  for ( k = 0; k < nhlevf; ++k )
+	    for ( i = 0; i < ngp; ++i )
+	      {
+		deltap[k*ngp+i] = half_press[(k+1)*ngp+i] - half_press[k*ngp+i];
+	      }
+
+	  pout = deltap;
+	}
+      else
+	{
+	  nlevel = nhlevh;
+	  pout = half_press;
+	}
+	  
+      varID = 0;
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  streamDefRecord(streamID2, varID, levelID);
+	  offset = levelID*gridsize;
+	  streamWriteRecord(streamID2, pout+offset, 0);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( pdata      ) free(pdata);
+  if ( ps_prog    ) free(ps_prog);
+  if ( deltap     ) free(deltap);
+  if ( full_press ) free(full_press);
+  if ( half_press ) free(half_press);
+  if ( vct        ) free(vct);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Regres.c b/src/Regres.c
new file mode 100644
index 0000000..bbeb46b
--- /dev/null
+++ b/src/Regres.c
@@ -0,0 +1,216 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Regres      regres           Regression
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+/* Same code as Trend ! */
+void *Regres(void *argument)
+{
+  int gridsize;
+  int vdate = 0, vtime = 0;
+  int nrecs, nrecords;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int i, w;
+  int streamID1,/* streamID2, */streamID3;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  int nwork = 5;
+  double temp1, temp2;
+  double missval, missval1, missval2;
+  field_t **work[5];
+  field_t field1, field2;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  vlistDefNtsteps(vlistID2, 1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+  /*
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+  */
+  streamID3 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  for ( w = 0; w < nwork; w++ )
+    work[w] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      for ( w = 0; w < nwork; w++ )
+	work[w][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  for ( w = 0; w < nwork; w++ )
+	    {
+	      work[w][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+	      for ( i = 0; i < gridsize; i++ ) work[w][varID][levelID].ptr[i] = 0;
+	    }
+	}
+    }
+
+  tsID    = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      tsID++; /* don't move this line !!! */
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 1 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+
+	  streamReadRecord(streamID1, field1.ptr, &nmiss);
+
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( !DBL_IS_EQUAL(field1.ptr[i], missval) )
+	      {
+		work[0][varID][levelID].ptr[i] += tsID;
+		work[1][varID][levelID].ptr[i] += tsID * tsID;
+		work[2][varID][levelID].ptr[i] += tsID * field1.ptr[i];
+		work[3][varID][levelID].ptr[i] += field1.ptr[i];
+		work[4][varID][levelID].ptr[i]++;
+	      }      
+	}
+    }
+	  
+
+  taxisDefVdate(taxisID2, vdate);
+  taxisDefVtime(taxisID2, vtime);
+  /* streamDefTimestep(streamID2, 0); */
+  streamDefTimestep(streamID3, 0);
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID   = recVarID[recID];
+      levelID = recLevelID[recID];
+
+      missval  = vlistInqVarMissval(vlistID1, varID);
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+
+      missval1  = missval;
+      missval2  = missval;
+
+      for ( i = 0; i < gridsize; i++ )
+	{
+	  temp1 = SUB(work[2][varID][levelID].ptr[i],
+		      DIV(MUL(work[0][varID][levelID].ptr[i], work[3][varID][levelID].ptr[i]), work[4][varID][levelID].ptr[i]));
+	  temp2 = SUB(work[1][varID][levelID].ptr[i],
+		      DIV(MUL(work[0][varID][levelID].ptr[i], work[0][varID][levelID].ptr[i]), work[4][varID][levelID].ptr[i]));
+
+	  field2.ptr[i] = DIV(temp1, temp2);
+	  field1.ptr[i] = SUB(DIV(work[3][varID][levelID].ptr[i], work[4][varID][levelID].ptr[i]),
+			      MUL(DIV(work[0][varID][levelID].ptr[i], work[4][varID][levelID].ptr[i]), field2.ptr[i]));
+	}
+
+      /*
+      nmiss = 0;
+      for ( i = 0; i < gridsize; i++ )
+	if ( DBL_IS_EQUAL(field1.ptr[i], missval) ) nmiss++;
+
+      streamDefRecord(streamID2, varID, levelID);
+      streamWriteRecord(streamID2, field1.ptr, nmiss);
+      */
+      nmiss = 0;
+      for ( i = 0; i < gridsize; i++ )
+	if ( DBL_IS_EQUAL(field2.ptr[i], missval) ) nmiss++;
+
+      streamDefRecord(streamID3, varID, levelID);
+      streamWriteRecord(streamID3, field2.ptr, nmiss);
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  for ( w = 0; w < nwork; w++ )
+	    free(work[w][varID][levelID].ptr);
+	}
+
+      for ( w = 0; w < nwork; w++ )
+	free(work[w][varID]);
+    }
+
+  for ( w = 0; w < nwork; w++ ) free(work[w]);
+
+  if ( field1.ptr ) free(field1.ptr);
+  if ( field2.ptr ) free(field2.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID3);
+  /* streamClose(streamID2); */
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Remap.c b/src/Remap.c
new file mode 100644
index 0000000..97c16c7
--- /dev/null
+++ b/src/Remap.c
@@ -0,0 +1,1063 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Interpolate remapcon        First order conservative remapping
+      Interpolate remapcon2       Second order conservative remapping
+      Interpolate remapbil        Bilinear interpolation
+      Interpolate remapbic        Bicubic interpolation
+      Interpolate remapdis        Distance-weighted averaging
+      Interpolate remapnn         Nearest neighbor remapping
+      Interpolate remaplaf        Largest area fraction remapping
+      Genweights  gencon          Generate first order conservative remap weights
+      Genweights  gencon2         Generate second order conservative remap weights
+      Genweights  genbil          Generate bilinear interpolation weights
+      Genweights  genbic          Generate bicubic interpolation weights
+      Genweights  gendis          Generate distance-weighted averaging weights
+      Genweights  gennn           Generate nearest neighbor weights
+      Genweights  genlaf          Generate largest area fraction weights
+      Remap       remap           SCRIP grid remapping
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "remap.h"
+#include "grid.h"
+
+
+enum {REMAPCON, REMAPCON2, REMAPBIL, REMAPBIC, REMAPDIS, REMAPNN, REMAPLAF, REMAPSUM,
+      GENCON, GENCON2, GENBIL, GENBIC, GENDIS, GENNN, GENLAF, REMAPXXX};
+
+enum {HEAP_SORT, MERGE_SORT};
+
+static
+void get_map_type(int operfunc, int *map_type, int *submap_type, int *remap_order)
+{
+  switch ( operfunc )
+    {
+    case REMAPCON:
+    case GENCON:
+      *map_type = MAP_TYPE_CONSERV;
+      *remap_order = 1;
+      break;
+    case REMAPCON2:
+    case GENCON2:
+      *map_type = MAP_TYPE_CONSERV;
+      *remap_order = 2;
+      break;
+    case REMAPLAF:
+    case GENLAF:
+      *map_type = MAP_TYPE_CONSERV;
+      *submap_type = SUBMAP_TYPE_LAF;
+      break;
+    case REMAPSUM:
+      *map_type = MAP_TYPE_CONSERV;
+      *submap_type = SUBMAP_TYPE_SUM;
+      break;
+    case REMAPBIL:
+    case GENBIL:
+      *map_type = MAP_TYPE_BILINEAR;
+      break;
+    case REMAPBIC:
+    case GENBIC:
+      *map_type = MAP_TYPE_BICUBIC;
+      break;
+    case REMAPDIS:
+    case GENDIS:
+      *map_type = MAP_TYPE_DISTWGT;
+      break;
+    case REMAPNN:
+    case GENNN:
+      *map_type = MAP_TYPE_DISTWGT1;
+      break;
+    default:
+      cdoAbort("Unknown mapping method");
+    }
+}
+
+static
+int maptype2operfunc(int map_type, int submap_type, int remap_order)
+{
+  int operfunc = -1;
+
+  if ( map_type == MAP_TYPE_CONSERV )
+    {
+      if ( submap_type == SUBMAP_TYPE_LAF )
+	{
+	  operfunc = REMAPLAF;
+	  cdoPrint("Using remaplaf");
+	}
+      else
+	{
+	  if ( remap_order == 2 )
+	    {
+	      operfunc = REMAPCON2;
+	      cdoPrint("Using remapcon2");
+	    }
+	  else
+	    {
+	      operfunc = REMAPCON;
+	      cdoPrint("Using remapcon");
+	    }
+	}
+    }
+  else if ( map_type == MAP_TYPE_BILINEAR )
+    {
+      operfunc = REMAPBIL;
+      cdoPrint("Using remapbil");
+    }
+  else if ( map_type == MAP_TYPE_BICUBIC )
+    {
+      operfunc = REMAPBIC;
+      cdoPrint("Using remapbic");
+    }
+  else if ( map_type == MAP_TYPE_DISTWGT )
+    {
+      operfunc = REMAPDIS;
+      cdoPrint("Using remapdis");
+    }
+  else if ( map_type == MAP_TYPE_DISTWGT1 )
+    {
+      operfunc = REMAPNN;
+      cdoPrint("Using remapnn");
+    }
+  else
+    cdoAbort("Unsupported mapping method (map_type = %d)", map_type);
+
+  return (operfunc);
+}
+
+double remap_threshhold = 2;
+int remap_test = 0;
+int remap_order = 1;
+int remap_restrict_type = RESTRICT_LATITUDE;
+int remap_store_link_fast = TRUE;
+int remap_non_global = FALSE;
+int remap_num_srch_bins = 180;
+int lremap_num_srch_bins = FALSE;
+int remap_extrapolate = FALSE;
+int lextrapolate = FALSE;
+int max_remaps = 0;
+int sort_mode = HEAP_SORT;
+double remap_area_min = 0;
+
+
+static
+void get_remap_env(void)
+{
+  char *envstr;
+
+  envstr = getenv("MAX_REMAPS");
+  if ( envstr )
+    {
+      int ival;
+      ival = atoi(envstr);
+      if ( ival > 0 )
+	{
+	  max_remaps = ival;
+	  if ( cdoVerbose )
+	    cdoPrint("Set MAX_REMAPS to %d", max_remaps);
+	}
+    }
+
+  envstr = getenv("REMAP_MAX_ITER");
+  if ( envstr )
+    {
+      int ival;
+      ival = atoi(envstr);
+      if ( ival > 0 )
+	{
+	  remap_set_max_iter(ival);
+	  if ( cdoVerbose )
+	    cdoPrint("Set REMAP_MAX_ITER to %d", ival);
+	}
+    }
+  /*
+  envstr = getenv("REMAP_ORDER");
+  if ( envstr )
+    {
+      int ival;
+      ival = atoi(envstr);
+      if ( ival > 0 )
+	{
+	  remap_order = ival;
+	  if ( remap_order == 0 ) remap_order = 1;
+	  if ( remap_order != 1 && remap_order != 2 )
+	    cdoAbort("REMAP_ORDER must be 1 or 2");
+	  if ( cdoVerbose )
+	    cdoPrint("Set REMAP_ORDER to %d", remap_order);
+	}
+    }
+  */
+  envstr = getenv("REMAP_TEST");
+  if ( envstr )
+    {
+      int ival;
+      ival = atoi(envstr);
+      if ( ival > 0 )
+	{
+	  remap_test = ival;
+	  if ( cdoVerbose )
+	    cdoPrint("Set REMAP_TEST to %d", remap_test);
+	}
+    }
+
+#if defined (_OPENMP)
+  if ( ompNumThreads == 1 )
+    sort_mode = HEAP_SORT;
+  else
+    sort_mode = MERGE_SORT;
+#endif
+
+  envstr = getenv("REMAP_SORT_MODE");
+  if ( envstr )
+    {
+      if      ( strcmp(envstr, "heap")  == 0 ) sort_mode = HEAP_SORT;
+      else if ( strcmp(envstr, "merge") == 0 ) sort_mode = MERGE_SORT;
+
+      if ( cdoVerbose )
+	{
+	  if      ( sort_mode == HEAP_SORT )
+	    cdoPrint("Set sort_mode to HEAP_SORT");
+	  else if ( sort_mode == MERGE_SORT )
+	    cdoPrint("Set sort_mode to MERGE_SORT");
+	}
+    }
+
+  envstr = getenv("REMAP_RESTRICT_TYPE");
+  if ( envstr )
+    {
+      if      ( strcmp(envstr, "latitude") == 0 ) remap_restrict_type = RESTRICT_LATITUDE;
+      else if ( strcmp(envstr, "latlon")   == 0 ) remap_restrict_type = RESTRICT_LATLON;
+
+      if ( cdoVerbose )
+	{
+	  if      ( remap_restrict_type == RESTRICT_LATITUDE )
+	    cdoPrint("Set REMAP_RESTRICT_TYPE to latitude");
+	  else if ( remap_restrict_type == RESTRICT_LATLON )
+	    cdoPrint("Set REMAP_RESTRICT_TYPE to latlon");
+	}
+    }
+
+  envstr = getenv("REMAP_THRESHHOLD");
+  if ( envstr )
+    {
+      double fval;
+      fval = atof(envstr);
+      if ( fval > 0 )
+	{
+	  remap_threshhold = fval;
+	  if ( cdoVerbose )
+	    cdoPrint("Set REMAP_THRESHHOLD to %g", remap_threshhold);
+	}
+    }
+
+  envstr = getenv("REMAP_AREA_MIN");
+  if ( envstr )
+    {
+      double fval;
+      fval = atof(envstr);
+      if ( fval > 0 )
+	{
+	  remap_area_min = fval;
+	  if ( cdoVerbose )
+	    cdoPrint("Set REMAP_AREA_MIN to %g", remap_area_min);
+	}
+    }
+
+  envstr = getenv("REMAP_NUM_SRCH_BINS");
+  if ( envstr )
+    {
+      int ival;
+      ival = atoi(envstr);
+      if ( ival > 0 )
+	{
+	  remap_num_srch_bins = ival;
+	  lremap_num_srch_bins = TRUE;
+	  if ( cdoVerbose )
+	    cdoPrint("Set REMAP_NUM_SRCH_BINS to %d", remap_num_srch_bins);
+	}
+    }
+
+  envstr = getenv("REMAP_NON_GLOBAL");
+  if ( envstr )
+    {
+      int ival;
+      ival = atoi(envstr);
+      if ( ival >= 0 )
+	{
+	  remap_non_global = ival;
+	  if ( cdoVerbose )
+	    cdoPrint("Set REMAP_NON_GLOBAL to %d", remap_non_global);
+	}
+    }
+
+  envstr = getenv("REMAP_STORE_LINK_FAST");
+  if ( envstr )
+    {
+      int ival;
+      ival = atoi(envstr);
+      if ( ival >= 0 )
+	{
+	  remap_store_link_fast = ival;
+	  if ( cdoVerbose )
+	    cdoPrint("Set REMAP_STORE_LINK_FAST to %d", remap_store_link_fast);
+	}
+    }
+
+  envstr = getenv("REMAP_EXTRAPOLATE");
+  if ( envstr )
+    {
+      int ival;
+      ival = atoi(envstr);
+      if ( *envstr )
+	{
+	  if ( memcmp(envstr, "ON", 2) == 0 || memcmp(envstr, "on", 2) == 0 )
+	    {
+	      lextrapolate = TRUE;
+	      remap_extrapolate = TRUE;
+	    }
+	  else if ( memcmp(envstr, "OFF", 3) == 0 || memcmp(envstr, "off", 3) == 0 )
+	    {
+	      lextrapolate = TRUE;
+	      remap_extrapolate = FALSE;
+	    }
+	  else
+	    cdoWarning("Environment variable REMAP_EXTRAPOLATE has wrong value!");
+
+	  if ( cdoVerbose )
+	    {
+	      if ( remap_extrapolate == TRUE )
+		cdoPrint("Extrapolation enabled!");
+	      else if ( remap_extrapolate == FALSE )
+		cdoPrint("Extrapolation disabled!");
+	    }
+	}
+    }
+}
+
+static
+void scale_gridbox_area(long gridsize, const double *restrict array1, long gridsize2, double *restrict array2, const double *restrict grid2_area)
+{
+  static int lgridboxinfo = TRUE;
+  long i;
+  double array1sum = 0;
+  double array2sum = 0;
+
+  for ( i = 0; i < gridsize; i++ )
+    array1sum += array1[i];
+
+  for ( i = 0; i < gridsize2; i++ )
+    array2sum += grid2_area[i];
+
+  for ( i = 0; i < gridsize2; i++ )
+    array2[i] = grid2_area[i]/array2sum*array1sum;
+
+  if ( lgridboxinfo )
+    {
+      cdoPrint("gridbox_area replaced and scaled to %g", array1sum);
+      lgridboxinfo = FALSE;
+    }
+}
+
+
+int timer_remap, timer_remap_init, timer_remap_sort;
+int timer_remap_bil, timer_remap_nn, timer_remap_con, timer_remap_con_l1, timer_remap_con_l2;
+
+
+void *Remap(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2 = -1;
+  int nrecs, ngrids;
+  int nzaxis, zaxisID, zaxissize;
+  int nvars;
+  int index;
+  int tsID, recID, varID, levelID;
+  int gridsize, gridsize2;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int gridID1 = -1, gridID2;
+  int gridtype;
+  int nmiss1, nmiss2, i, j, r;
+  int *imask = NULL;
+  int nremaps = 0;
+  int norm_opt = NORM_OPT_NONE;
+  int map_type = -1;
+  int submap_type = SUBMAP_TYPE_NONE;
+  int need_gradiants = FALSE;
+  int non_global;
+  int grid1sizemax;
+  short *remapgrids = NULL;
+  char varname[CDI_MAX_NAME];
+  double missval;
+  double *array1 = NULL, *array2 = NULL;
+  double *grad1_lat = NULL, *grad1_lon = NULL, *grad1_latlon = NULL;
+  remap_t *remaps;
+  char *envstr;
+  char *remap_file = NULL;
+  int lwrite_remap;
+
+  if ( cdoTimer )
+    {
+      timer_remap        = timer_new("remap");
+      timer_remap_init   = timer_new("remap init");
+      timer_remap_sort   = timer_new("remap sort");
+      timer_remap_bil    = timer_new("remap bil");
+      timer_remap_nn     = timer_new("remap nn");
+      timer_remap_con    = timer_new("remap con");
+      timer_remap_con_l1 = timer_new("remap con loop1");
+      timer_remap_con_l2 = timer_new("remap con loop2");
+    }
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("remapcon",    REMAPCON,    0, NULL);
+  cdoOperatorAdd("remapcon2",   REMAPCON2,   0, NULL);
+  cdoOperatorAdd("remapbil",    REMAPBIL,    0, NULL);
+  cdoOperatorAdd("remapbic",    REMAPBIC,    0, NULL);
+  cdoOperatorAdd("remapdis",    REMAPDIS,    0, NULL);
+  cdoOperatorAdd("remapnn",     REMAPNN,     0, NULL);
+  cdoOperatorAdd("remaplaf",    REMAPLAF,    0, NULL);
+  cdoOperatorAdd("remapsum",    REMAPSUM,    0, NULL);
+  cdoOperatorAdd("gencon",      GENCON,      1, NULL);
+  cdoOperatorAdd("gencon2",     GENCON2,     1, NULL);
+  cdoOperatorAdd("genbil",      GENBIL,      1, NULL);
+  cdoOperatorAdd("genbic",      GENBIC,      1, NULL);
+  cdoOperatorAdd("gendis",      GENDIS,      1, NULL);
+  cdoOperatorAdd("gennn",       GENNN,       1, NULL);
+  cdoOperatorAdd("genlaf",      GENLAF,      1, NULL);
+  cdoOperatorAdd("remap",       REMAPXXX,    0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc   = cdoOperatorF1(operatorID);
+  lwrite_remap = cdoOperatorF2(operatorID);
+
+  if ( operfunc == REMAPDIS || operfunc == GENDIS ||
+       operfunc == REMAPNN  || operfunc == GENNN )
+    remap_extrapolate = TRUE;
+
+  get_remap_env();
+
+  if ( cdoVerbose )
+    {
+      if ( remap_extrapolate == TRUE )
+	cdoPrint("Extrapolation enabled!");
+      else if ( remap_extrapolate == FALSE )
+	cdoPrint("Extrapolation disabled!");
+    }
+
+  if ( operfunc == REMAPXXX )
+    {
+      operatorInputArg("grid description file or name, remap file (SCRIP netCDF)");
+      operatorCheckArgc(2);
+      gridID2 = cdoDefineGrid(operatorArgv()[0]);
+      remap_file = operatorArgv()[1];
+    }
+  else
+    {
+      operatorInputArg("grid description file or name");
+      operatorCheckArgc(1);
+      gridID2 = cdoDefineGrid(operatorArgv()[0]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids = vlistNgrids(vlistID1);
+  remapgrids = (short *) malloc(ngrids*sizeof(short));
+  for ( index = 0; index < ngrids; index++ )
+    {
+      remapgrids[index] = TRUE;
+
+      gridID1 = vlistGrid(vlistID1, index);
+      gridtype = gridInqType(gridID1);
+
+      if ( gridtype != GRID_LONLAT      &&
+	   gridtype != GRID_GAUSSIAN    &&
+	   gridtype != GRID_LCC         &&
+	   gridtype != GRID_LAEA        &&
+	   gridtype != GRID_SINUSOIDAL  &&
+	   gridtype != GRID_GME         &&
+	   gridtype != GRID_REFERENCE   &&
+	   gridtype != GRID_CURVILINEAR &&
+	   gridtype != GRID_UNSTRUCTURED )
+	{
+	  if ( gridInqType(gridID1) == GRID_GAUSSIAN_REDUCED )
+	    cdoAbort("Unsupported grid type: %s, use CDO option -R to convert reduced to regular grid!",
+		     gridNamePtr(gridInqType(gridID1)));
+	  else if ( gridInqType(gridID1) == GRID_GENERIC && gridInqSize(gridID1) == 1 )
+	    remapgrids[index] = FALSE;
+	  else
+	    cdoAbort("Unsupported grid type: %s", gridNamePtr(gridInqType(gridID1)));
+	}
+
+      if ( remapgrids[index] )
+	vlistChangeGridIndex(vlistID2, index, gridID2);
+    }
+
+  for ( index = 0; index < ngrids; index++ )
+    if ( remapgrids[index] == TRUE ) break;
+
+  if ( index == ngrids )
+    cdoAbort("No remappable grid found!");
+
+  gridID1 = vlistGrid(vlistID1, index);
+
+  if ( max_remaps == 0 )
+    {
+      nzaxis = vlistNzaxis(vlistID1);
+      for ( index = 0; index < nzaxis; index++ )
+        {
+	  zaxisID = vlistZaxis(vlistID1, index);
+	  zaxissize = zaxisInqSize(zaxisID);
+          if ( zaxissize > max_remaps ) max_remaps = zaxissize;
+	}
+
+      nvars = vlistNvars(vlistID1);
+      if ( nvars > max_remaps ) max_remaps = nvars;
+
+      max_remaps++;
+
+      if ( cdoVerbose )
+        cdoPrint("Set max_remaps to %d", max_remaps);
+    }
+
+  remaps = (remap_t *) malloc(max_remaps*sizeof(remap_t));
+  for ( r = 0; r < max_remaps; r++ )
+    {
+      remaps[r].gridID   = -1;
+      remaps[r].gridsize = 0;
+      remaps[r].nmiss    = 0;
+    }
+
+  if ( operfunc == REMAPXXX )
+    {
+      int gridsize2;
+
+      read_remap_scrip(remap_file, gridID1, gridID2, &map_type, &submap_type, 
+		       &remap_order, &remaps[0].grid, &remaps[0].vars);
+      nremaps = 1;
+      gridsize = remaps[0].grid.grid1_size;
+      remaps[0].gridID = gridID1;
+      remaps[0].gridsize = gridInqSize(gridID1);
+      remaps[0].nmiss = 0;
+
+      if ( map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1 )
+	{
+	  if ( !lextrapolate ) remap_extrapolate = TRUE;
+	}
+
+      if ( gridIsCircular(gridID1) && !lextrapolate ) remap_extrapolate = TRUE;
+      non_global = remap_non_global || !gridIsCircular(gridID1);
+      if ( !remap_extrapolate && gridInqSize(gridID1) > 1 &&
+	   (map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1) &&
+	   ((gridInqType(gridID1) == GRID_LONLAT && gridIsRotated(gridID1)) ||
+	    (gridInqType(gridID1) == GRID_LONLAT && non_global) ||
+	    (gridInqType(gridID1) == GRID_LCC) ||
+	    (gridInqType(gridID1) == GRID_LAEA) ||
+	    (gridInqType(gridID1) == GRID_SINUSOIDAL) ||
+	    (gridInqType(gridID1) == GRID_CURVILINEAR && non_global)) )
+	{
+	  remaps[0].gridsize += 4*(gridInqXsize(gridID1)+2) + 4*(gridInqYsize(gridID1)+2);
+	  remaps[0].grid.non_global = TRUE;
+	}
+
+      if ( gridInqType(gridID1) == GRID_GME ) gridsize = remaps[0].grid.grid1_nvgp;
+
+      if ( gridsize != remaps[0].gridsize )
+	cdoAbort("Size of source grid and weights from %s differ!", remap_file);
+
+      if ( gridInqType(gridID1) == GRID_GME ) gridsize = remaps[0].grid.grid1_size;
+
+      for ( i = 0; i < gridsize; i++ )
+        if ( remaps[0].grid.grid1_mask[i] == FALSE )
+          remaps[0].nmiss++;
+
+      gridsize2 = gridInqSize(gridID2);
+      if ( gridInqType(gridID2) == GRID_GME )
+	{
+	  int gridID2_gme;
+	  int isize = 0;
+	  remaps[0].grid.grid2_nvgp = gridInqSize(gridID2);
+	  remaps[0].grid.grid2_vgpm = (int *) realloc(remaps[0].grid.grid2_vgpm,
+						      gridInqSize(gridID2)*sizeof(int));
+	  gridID2_gme = gridToUnstructured(gridID2, 1);
+	  gridInqMaskGME(gridID2_gme, remaps[0].grid.grid2_vgpm);
+	  for ( i = 0; i < gridsize2; ++i )
+	    if ( remaps[0].grid.grid2_vgpm[i] ) isize++;
+	  gridsize2 = isize;
+	}
+      /*
+      printf("grid2 %d %d %d\n", gridsize2, remaps[0].grid.grid2_nvgp, remaps[0].grid.grid2_size);
+      */
+      if ( remaps[0].grid.grid2_size != gridsize2 )
+	cdoAbort("Size of target grid and weights from %s differ!", remap_file);
+
+      operfunc = maptype2operfunc(map_type, submap_type, remap_order);
+
+      if ( remap_test ) reorder_links(&remaps[0].vars);
+    }
+
+  get_map_type(operfunc, &map_type, &submap_type, &remap_order);
+
+  if ( map_type == MAP_TYPE_CONSERV )
+    {
+      norm_opt = NORM_OPT_FRACAREA;
+
+      envstr = getenv("NORMALIZE_OPT");
+
+      if ( envstr && *envstr )
+        {
+	  if      ( memcmp(envstr, "frac", 4) == 0 )
+	    norm_opt = NORM_OPT_FRACAREA;
+	  else if ( memcmp(envstr, "dest", 4) == 0 )
+	    norm_opt = NORM_OPT_DESTAREA;
+	  else if ( memcmp(envstr, "none", 4) == 0 )
+	    norm_opt = NORM_OPT_NONE;
+	  else
+	    cdoWarning("NORMALIZE_OPT=%s unsupported!", envstr);
+	}
+
+      if ( cdoVerbose )
+        {
+	  if ( norm_opt == NORM_OPT_FRACAREA )
+	    cdoPrint("Normalization option: frac");
+	  else if ( norm_opt == NORM_OPT_DESTAREA )
+	    cdoPrint("Normalization option: dest");
+	  else
+	    cdoPrint("Normalization option: none");
+	}
+    }
+
+  grid1sizemax = vlistGridsizeMax(vlistID1);
+
+  if ( map_type == MAP_TYPE_BICUBIC ) need_gradiants = TRUE;
+  if ( map_type == MAP_TYPE_CONSERV && remap_order == 2 )
+    {
+      if ( cdoVerbose ) cdoPrint("Second order remapping");
+      need_gradiants = TRUE;
+    }
+  else
+    remap_order = 1;
+
+  if ( need_gradiants )
+    {
+      grad1_lat    = (double *) malloc(grid1sizemax*sizeof(double));
+      grad1_lon    = (double *) malloc(grid1sizemax*sizeof(double));
+      grad1_latlon = (double *) malloc(grid1sizemax*sizeof(double));
+    }
+
+  array1 = (double *) malloc(grid1sizemax*sizeof(double));
+  imask  = (int *) malloc(grid1sizemax*sizeof(int));
+
+  gridsize = gridInqSize(gridID2);
+  array2   = (double *) malloc(gridsize*sizeof(double));
+
+  if ( ! lwrite_remap )
+    {
+      streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+      streamDefVlist(streamID2, vlistID2);
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      if ( ! lwrite_remap ) 
+	streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss1);
+
+	  gridID1 = vlistInqVarGrid(vlistID1, varID);
+
+	  if ( remapgrids[vlistGridIndex(vlistID1, gridID1)] == FALSE )
+	    {
+	      if ( lwrite_remap ) continue;
+	      else
+		{
+		  nmiss2 = nmiss1;
+		  *array2 = *array1;
+		  goto SKIPVAR;
+		}
+	    }
+
+	  if ( map_type != MAP_TYPE_CONSERV && 
+	       gridInqType(gridID1) == GRID_GME && gridInqType(gridID2) == GRID_GME )
+	    cdoAbort("Only conservative remapping is available to remap between GME grids!");
+	  /*
+	  if ( gridIsRotated(gridID1) && map_type != MAP_TYPE_CONSERV )
+	    cdoAbort("Only conservative remapping is available for rotated grids!");
+	  */
+	  missval = vlistInqVarMissval(vlistID1, varID);
+	  gridsize = gridInqSize(gridID1);
+
+	  if ( gridIsCircular(gridID1) && !lextrapolate ) remap_extrapolate = TRUE;
+	  non_global = remap_non_global || !gridIsCircular(gridID1);
+	  if ( !remap_extrapolate && gridInqSize(gridID1) > 1 &&
+	       (map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1) &&
+	       ((gridInqType(gridID1) == GRID_LONLAT && gridIsRotated(gridID1)) ||
+		(gridInqType(gridID1) == GRID_LONLAT && non_global) ||
+		(gridInqType(gridID1) == GRID_LCC) ||
+		(gridInqType(gridID1) == GRID_LAEA) ||
+		(gridInqType(gridID1) == GRID_SINUSOIDAL) ||
+		(gridInqType(gridID1) == GRID_CURVILINEAR && non_global)) )
+	    {
+	      int gridsize_new;
+	      int nx, ny;
+	      nx = gridInqXsize(gridID1);
+	      ny = gridInqYsize(gridID1);
+	      gridsize_new = gridsize + 4*(nx+2) + 4*(ny+2);
+	      if ( gridsize_new > grid1sizemax )
+		{
+		  grid1sizemax = gridsize_new;
+		  array1 = (double *) realloc(array1, grid1sizemax*sizeof(double));
+		  imask  = (int *) realloc(imask, grid1sizemax*sizeof(int));
+
+		  if ( need_gradiants )
+		    {
+		      grad1_lat    = (double *) realloc(grad1_lat, grid1sizemax*sizeof(double));
+		      grad1_lon    = (double *) realloc(grad1_lon, grid1sizemax*sizeof(double));
+		      grad1_latlon = (double *) realloc(grad1_latlon, grid1sizemax*sizeof(double));
+		    }
+		}
+	      
+	      for ( j = ny-1; j >= 0; j-- )
+		for ( i = nx-1; i >= 0; i-- )
+		  array1[(j+2)*(nx+4)+i+2] = array1[j*nx+i];
+
+	      for ( j = 0; j < ny+4; j++ ) array1[j*(nx+4)+0]      = missval;
+	      for ( j = 0; j < ny+4; j++ ) array1[j*(nx+4)+1]      = missval;
+	      for ( j = 0; j < ny+4; j++ ) array1[j*(nx+4)+nx+2]   = missval;
+	      for ( j = 0; j < ny+4; j++ ) array1[j*(nx+4)+nx+3]   = missval;
+	      for ( i = 0; i < nx+4; i++ ) array1[     0*(nx+4)+i] = missval;
+	      for ( i = 0; i < nx+4; i++ ) array1[     1*(nx+4)+i] = missval;
+	      for ( i = 0; i < nx+4; i++ ) array1[(ny+2)*(nx+4)+i] = missval;
+	      for ( i = 0; i < nx+4; i++ ) array1[(ny+3)*(nx+4)+i] = missval;
+
+	      gridsize = gridsize_new;
+	      nmiss1 += 4*(nx+2) + 4*(ny+2);
+	    }
+
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( DBL_IS_EQUAL(array1[i], missval) )
+	      imask[i] = FALSE;
+	    else
+	      imask[i] = TRUE;
+
+	  for ( r = nremaps-1; r >= 0; r-- )
+	    {
+	      if ( gridID1 == remaps[r].gridID && nmiss1 == remaps[r].nmiss )
+		{
+		  if ( memcmp(imask, remaps[r].grid.grid1_mask, remaps[r].grid.grid1_size*sizeof(int)) == 0 )
+		    break;
+		}	      
+	    }
+
+	  if ( cdoVerbose && r >= 0 ) cdoPrint("Using remap %d", r);
+
+	  if ( r < 0 )
+	    {
+	      if ( nremaps < max_remaps )
+		{
+		  r = nremaps;
+		  nremaps++;
+		}
+	      else
+		{
+		  r = nremaps - 1;
+		}
+
+	      if ( remaps[r].gridID != gridID1 )
+		{
+		  if ( gridIsCircular(gridID1) && !lextrapolate ) remap_extrapolate = TRUE;
+		  remaps[r].grid.non_global = FALSE;
+		  non_global = remap_non_global || !gridIsCircular(gridID1);
+		  if ( !remap_extrapolate && gridInqSize(gridID1) > 1 &&
+		       (map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1) &&
+		       ((gridInqType(gridID1) == GRID_LONLAT && gridIsRotated(gridID1)) ||
+			(gridInqType(gridID1) == GRID_LONLAT && non_global) ||
+			(gridInqType(gridID1) == GRID_LCC) ||
+			(gridInqType(gridID1) == GRID_LAEA) ||
+			(gridInqType(gridID1) == GRID_SINUSOIDAL) ||
+			(gridInqType(gridID1) == GRID_CURVILINEAR && non_global)) )
+		    {
+		      remaps[r].grid.non_global = TRUE;
+		    }
+		  /*
+		    remaps[r].grid.luse_grid1_area = FALSE;
+		    remaps[r].grid.luse_grid2_area = FALSE;
+		  */
+		  if ( gridInqType(gridID1) != GRID_UNSTRUCTURED && lremap_num_srch_bins == FALSE )
+		    {
+		      if ( !remap_extrapolate && (map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1) )
+			{
+			  remap_num_srch_bins = 1;
+			}
+		      else
+			{
+			  int maxbins = 720;
+			  int ysize1 = gridInqYsize(gridID1);
+			  remap_num_srch_bins = ysize1/2 + ysize1%2;
+			  if ( remap_num_srch_bins > maxbins ) remap_num_srch_bins = maxbins;
+			  if ( remap_num_srch_bins < 1 )       remap_num_srch_bins = 1;
+			}
+		    }
+
+		  remaps[r].grid.threshhold    = remap_threshhold;
+		  remaps[r].grid.restrict_type = remap_restrict_type;
+		  remaps[r].grid.num_srch_bins = remap_num_srch_bins;
+		  remaps[r].grid.pinit = FALSE;
+
+		  remaps[r].vars.norm_opt = norm_opt;
+		  remaps[r].vars.pinit = FALSE;
+		  
+		  if ( (map_type == MAP_TYPE_BILINEAR || map_type == MAP_TYPE_BICUBIC) &&
+		       (gridInqType(gridID1) == GRID_GME || gridInqType(gridID1) == GRID_UNSTRUCTURED) )
+		    cdoAbort("Bilinear/bicubic interpolation doesn't support unstructured source grids!");
+
+		  /* initialize grid information for both grids */
+		  if ( cdoTimer ) timer_start(timer_remap_init);
+		  remapGridInit(map_type, remap_extrapolate, gridID1, gridID2, &remaps[r].grid);
+		  if ( cdoTimer ) timer_stop(timer_remap_init);
+
+		  remaps[r].grid.store_link_fast = remap_store_link_fast;
+		}
+
+	      remaps[r].gridID = gridID1;
+	      remaps[r].nmiss  = nmiss1;
+
+	      if ( gridInqType(gridID1) == GRID_GME )
+		{
+		  j = 0;
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( remaps[r].grid.grid1_vgpm[i] ) imask[j++] = imask[i];
+		}
+
+	      memcpy(remaps[r].grid.grid1_mask, imask, remaps[r].grid.grid1_size*sizeof(int));
+
+	      if ( map_type == MAP_TYPE_CONSERV )
+		{
+		  memset(remaps[r].grid.grid1_area, 0, remaps[r].grid.grid1_size*sizeof(double));
+		  memset(remaps[r].grid.grid1_frac, 0, remaps[r].grid.grid1_size*sizeof(double));
+		  memset(remaps[r].grid.grid2_area, 0, remaps[r].grid.grid2_size*sizeof(double));
+		}
+	      memset(remaps[r].grid.grid2_frac, 0, remaps[r].grid.grid2_size*sizeof(double));
+
+	      /* initialize some remapping variables */
+	      if ( cdoTimer ) timer_start(timer_remap_init);
+	      remapVarsInit(map_type, &remaps[r].grid, &remaps[r].vars);
+	      if ( cdoTimer ) timer_stop(timer_remap_init);
+
+	      if      ( map_type == MAP_TYPE_CONSERV  ) remap_conserv(&remaps[r].grid, &remaps[r].vars);
+	      else if ( map_type == MAP_TYPE_BILINEAR ) remap_bilin(&remaps[r].grid, &remaps[r].vars);
+	      else if ( map_type == MAP_TYPE_BICUBIC  ) remap_bicub(&remaps[r].grid, &remaps[r].vars);
+	      else if ( map_type == MAP_TYPE_DISTWGT  ) remap_distwgt(&remaps[r].grid, &remaps[r].vars);
+	      else if ( map_type == MAP_TYPE_DISTWGT1 ) remap_distwgt1(&remaps[r].grid, &remaps[r].vars);
+
+	      if ( remaps[r].vars.num_links != remaps[r].vars.max_links )
+		resize_remap_vars(&remaps[r].vars, remaps[r].vars.num_links-remaps[r].vars.max_links);
+
+	      if ( cdoTimer ) timer_start(timer_remap_sort);
+	      if ( sort_mode == MERGE_SORT )
+		{ /* 
+		  ** use a combination of the old sort_add and a split and merge approach.
+                  ** The chunk size is determined by MERGE_SORT_LIMIT_SIZE in remaplib.c. 
+		  ** OpenMP parallelism is supported
+		  */   
+		  sort_iter(remaps[r].vars.num_links, remaps[r].vars.num_wts,
+			    remaps[r].vars.grid2_add, remaps[r].vars.grid1_add,
+			    remaps[r].vars.wts, ompNumThreads);
+		}
+	      else
+		{ /* use a pure heap sort without any support of parallelism */
+		  sort_add(remaps[r].vars.num_links, remaps[r].vars.num_wts,
+			   remaps[r].vars.grid2_add, remaps[r].vars.grid1_add,
+			   remaps[r].vars.wts);
+		}
+	      if ( cdoTimer ) timer_stop(timer_remap_sort);
+	      	      
+	      if ( lwrite_remap ) goto WRITE_REMAP;
+
+	      if ( remap_test ) reorder_links(&remaps[r].vars);
+	    }
+
+	  if ( gridInqType(gridID1) == GRID_GME )
+	    {
+	      j = 0;
+	      for ( i = 0; i < gridsize; i++ )
+		if ( remaps[r].grid.grid1_vgpm[i] ) array1[j++] = array1[i];
+	    }
+	  
+	  if ( need_gradiants )
+	    {
+	      if ( remaps[r].grid.grid1_rank != 2 && remap_order == 2 )
+		cdoAbort("Second order remapping is only available for 2D grids!");
+
+	      remap_gradients(remaps[r].grid, array1, grad1_lat, grad1_lon, grad1_latlon);
+	    }
+
+	  if ( operfunc == REMAPLAF )
+	    remap_laf(array2, missval, gridInqSize(gridID2), remaps[r].vars.num_links, remaps[r].vars.wts,
+		  remaps[r].vars.num_wts, remaps[r].vars.grid2_add, remaps[r].vars.grid1_add, array1);
+	  else if ( operfunc == REMAPSUM )
+	    remap_sum(array2, missval, gridInqSize(gridID2), remaps[r].vars.num_links, remaps[r].vars.wts,
+		  remaps[r].vars.num_wts, remaps[r].vars.grid2_add, remaps[r].vars.grid1_add, array1);
+	  else
+	    remap(array2, missval, gridInqSize(gridID2), remaps[r].vars.num_links, remaps[r].vars.wts,
+		  remaps[r].vars.num_wts, remaps[r].vars.grid2_add, remaps[r].vars.grid1_add,
+		  array1, grad1_lat, grad1_lon, grad1_latlon, remaps[r].vars.links);
+
+	  gridsize2 = gridInqSize(gridID2);
+
+	  /* used only to check the result of remapcon */
+	  if ( operfunc == REMAPCON || operfunc == REMAPCON2 )
+	    {
+	      double grid2_err;
+
+	      if ( remaps[r].vars.norm_opt == NORM_OPT_NONE )
+		{
+		  for ( i = 0; i < gridsize2; i++ )
+		    {
+		      grid2_err = remaps[r].grid.grid2_frac[i]*remaps[r].grid.grid2_area[i];
+		      if ( fabs(grid2_err) > 0 )
+			array2[i] = array2[i]/grid2_err;
+		      else
+			array2[i] = missval;
+		    }
+		}
+	      else if ( remaps[r].vars.norm_opt == NORM_OPT_DESTAREA )
+		{
+		  for ( i = 0; i < gridsize2; i++ )
+		    {
+		      if ( fabs(remaps[r].grid.grid2_frac[i]) > 0 )
+			array2[i] = array2[i]/remaps[r].grid.grid2_frac[i];
+		      else
+			array2[i] = missval;
+		    }
+		}
+
+	      if ( remap_area_min > 0 )
+		{
+		  for ( i = 0; i < gridsize2; i++ )
+		    {
+		      //printf("%d %g %g\n", i, remaps[r].grid.grid2_frac[i], remaps[r].grid.grid2_area[i]);
+		      if ( remaps[r].grid.grid2_frac[i] < remap_area_min ) array2[i] = missval;
+		    }
+		}
+	    }
+
+	  if ( operfunc == REMAPSUM )
+	  {
+	    double array1sum = 0;
+	    double array2sum = 0;
+   
+	    for ( i = 0; i < gridsize; i++ )
+	      printf("1 %d %g %g %g %g\n", i, array1[i], remaps[r].grid.grid1_frac[i], remaps[r].grid.grid1_area[i],remaps[r].grid.grid1_frac[i]);
+	    for ( i = 0; i < gridsize; i++ )
+	      array1sum += remaps[r].grid.grid1_area[i];
+
+	    for ( i = 0; i < gridsize2; i++ )
+	      printf("2 %d %g %g %g %g\n", i, array2[i], remaps[r].grid.grid2_frac[i],remaps[r].grid.grid2_area[i],remaps[r].grid.grid2_frac[i]);
+	    for ( i = 0; i < gridsize2; i++ )
+	      array2sum += remaps[r].grid.grid2_area[i];
+
+	    printf("array1sum %g, array2sum %g\n", array1sum, array2sum);
+	  }
+
+	  vlistInqVarName(vlistID1, varID, varname);
+	  if ( operfunc == REMAPCON || operfunc == REMAPCON2 )
+	    if ( strcmp(varname, "gridbox_area") == 0 )
+	      {
+		scale_gridbox_area(gridsize, array1, gridsize2, array2, remaps[r].grid.grid2_area);
+	      }
+
+	  /* calculate some statistics */
+	  if ( cdoVerbose )
+	    remap_stat(remap_order, remaps[r].grid, remaps[r].vars, array1, array2, missval);
+
+	  if ( gridInqType(gridID2) == GRID_GME )
+	    {
+	      int ni, nd;
+ 	      ni = gridInqGMEni(gridID2);
+	      nd = gridInqGMEnd(gridID2);
+	      j = remaps[r].grid.grid2_size;
+
+	      for ( i = gridsize2-1; i >=0 ; i-- )
+		if ( remaps[r].grid.grid2_vgpm[i] ) array2[i] = array2[--j];
+
+	      gme_grid_restore(array2, ni, nd);
+	    }
+
+	  nmiss2 = 0;
+	  for ( i = 0; i < gridsize2; i++ )
+	    if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss2++;
+
+	SKIPVAR:
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array2, nmiss2);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+
+  WRITE_REMAP:
+ 
+  if ( lwrite_remap ) 
+    write_remap_scrip(cdoStreamName(1), map_type, submap_type, remap_order, remaps[r].grid, remaps[r].vars);
+
+  streamClose(streamID1);
+
+  if ( remapgrids ) free(remapgrids);
+  if ( imask )  free(imask);
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  if ( grad1_latlon ) free(grad1_latlon);
+  if ( grad1_lon ) free(grad1_lon);
+  if ( grad1_lat ) free(grad1_lat);
+
+  for ( r = 0; r < nremaps; r++ )
+    {
+      remapVarsFree(&remaps[r].vars);
+      remapGridFree(&remaps[r].grid);
+    }
+
+  if ( remaps ) free(remaps);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Remapeta.c b/src/Remapeta.c
new file mode 100644
index 0000000..40ad8e8
--- /dev/null
+++ b/src/Remapeta.c
@@ -0,0 +1,870 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2007-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Remapeta     remapeta          Model to model level interpolation
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "vinterp.h"
+#include "list.h"
+#include "hetaeta.h"
+
+
+static 
+void setmissval(long nvals, int *imiss, double missval, double *array)
+{
+  long i;
+
+  if ( imiss )
+    {
+      for ( i = 0; i < nvals; ++i )
+	if ( imiss[i] ) array[i] = missval;
+    }
+}
+
+static
+void corr_hum(long gridsize, double *q, double q_min)
+{
+  long i;
+
+  for ( i = 0; i < gridsize; ++i )
+    {
+      if ( q[i] < q_min ) q[i] = q_min;
+    }
+}
+ 
+static
+long ncctop(double cptop, long nlev, long nlevp1, double *vct_a, double *vct_b)
+{
+  /*
+    Description:
+    Defines highest level *ncctop* where condensation is allowed.
+    
+    Author:
+  
+    E. Roeckner, MPI, October 2001
+  */
+  /* local variables */
+  long nctop = 0;
+  long jk;
+  double    za, zb, zph[nlevp1], zp[nlev];
+  // double    cptop  =  1000.;   /* min. pressure level for cond. */
+
+  /* half level pressure values, assuming 101320. Pa surface pressure */
+
+  for ( jk = 0; jk < nlevp1; ++jk )
+    {
+      za = vct_a[jk];
+      zb = vct_b[jk];
+      zph[jk] = za + zb*101320.;
+    }
+
+  /* full level pressure */
+
+  for ( jk = 0; jk < nlev; ++jk )
+    zp[jk] = (zph[jk] + zph[jk+1])*0.5;
+
+  /* search for pressure level cptop (Pa) */
+
+  for ( jk = 0; jk < nlev; ++jk )
+    {
+      nctop = jk;
+      if ( zp[jk] >= cptop ) break;
+    }
+
+  return (nctop);
+}
+
+
+double *vctFromFile(const char *filename, int *nvct)
+{
+  char line[1024], *pline;
+  int num, i = 0;
+  int nlevh2, nvct2;
+  int maxvct = 8192;
+  double *vct2;
+  FILE *fp;
+
+
+  fp = fopen(filename, "r");
+  if ( fp == NULL ) { perror(filename); exit(EXIT_FAILURE); }
+
+  vct2 = (double *) malloc(maxvct*sizeof(double));
+
+  while ( readline(fp, line, 1024) )
+    {
+      if ( line[0] == '#' ) continue;
+      if ( line[0] == '\0' ) continue;
+
+      pline = line;
+      num = (int) strtod(pline, &pline);
+      if ( pline == NULL ) cdoAbort("Format error in VCT file %s!", filename);
+      if ( num != i ) cdoWarning("Inconsistent VCT file, entry %d is %d.", i, num);
+      
+      if ( i+maxvct/2 >= maxvct-1 ) cdoAbort("Too many values in VCT file!");
+
+      vct2[i] = strtod(pline, &pline);
+      if ( pline == NULL ) cdoAbort("Format error in VCT file %s!", filename);
+
+      vct2[i+maxvct/2] = strtod(pline, &pline);
+
+      i++;
+    }
+
+  fclose(fp);
+
+  nvct2 = 2*i;
+  nlevh2 = i - 1;
+
+  for ( i = 0; i < nlevh2+1; ++i )
+    vct2[i+nvct2/2] = vct2[i+maxvct/2];
+  
+  vct2 = (double *) realloc(vct2, nvct2*sizeof(double));
+
+  *nvct = nvct2;
+
+  return (vct2);
+}
+
+static
+void vert_sum(double *sum, double *var3d, long gridsize, long nlevel)
+{
+  long i, k;
+
+  for ( i = 0; i < gridsize; ++i ) sum[i] = 0;
+
+  for ( k = 0; k < nlevel; ++k )
+    for ( i = 0; i < gridsize; ++i )
+      {
+	sum[i] += var3d[k*gridsize + i];
+      }
+}
+
+static
+void vert_sumw(double *sum, double *var3d, long gridsize, long nlevel, double *deltap)
+{
+  long i, k;
+
+  for ( i = 0; i < gridsize; ++i ) sum[i] = 0;
+
+  for ( k = 0; k < nlevel; ++k )
+    for ( i = 0; i < gridsize; ++i )
+      {
+	sum[i] += var3d[k*gridsize + i]*deltap[k*gridsize + i];
+      }
+}
+
+
+#define  MAX_VARS3D  1024
+
+void *Remapeta(void *argument)
+{
+  int REMAPETA, REMAPETAS, REMAPETAZ;
+  int operatorID;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridsize, ngp = 0, nfis2gp = 0;
+  int recID, nrecs;
+  int i, offset, iv;
+  int tsID, varID, levelID;
+  int nvars, nvars3D = 0;
+  int zaxisID2, zaxisIDh = -1, nzaxis, surfaceID;
+  int ngrids, gridID, zaxisID;
+  int nlevel;
+  int nvct1, nvct2 = 0;
+  int geopID = -1, tempID = -1, sqID = -1, psID = -1, lnpsID = -1, presID = -1;
+  int code;
+  char varname[CDI_MAX_NAME];
+  double *single2;
+  int taxisID1, taxisID2;
+  int lhavevct;
+  int nhlevf1 = 0, nhlevf2 = 0;
+  double *lev2;
+  double *vct1 = NULL, *vct2 = NULL;
+  double *a1 = NULL, *b1 = NULL, *a2 = NULL, *b2 = NULL;
+  double *fis1 = NULL, *ps1 = NULL, *t1 = NULL, *q1 = NULL;
+  double *fis2 = NULL, *ps2 = NULL, *t2 = NULL, *q2 = NULL;
+  double *tscor = NULL, *pscor = NULL, *secor = NULL;
+  int nmiss, nmissout = 0;
+  int ltq = FALSE;
+  int lfis2 = FALSE;
+  int varids[MAX_VARS3D];
+  int *imiss = NULL;
+  int timer_hetaeta = 0;
+  long nctop = 0;
+  double *array = NULL;
+  double *deltap1 = NULL, *deltap2 = NULL;
+  double *half_press1 = NULL, *half_press2 = NULL;
+  double *sum1 = NULL, *sum2 = NULL;
+  double **vars1 = NULL, **vars2 = NULL;
+  double minval, maxval;
+  double missval = 0;
+  double cconst = 1.E-6;
+  const char *fname;
+  char *envstr;
+  double cptop  = 0; /* min. pressure level for cond. */
+
+  if ( cdoTimer ) timer_hetaeta = timer_new("Remapeta_hetaeta");
+
+  cdoInitialize(argument);
+
+  REMAPETA  = cdoOperatorAdd("remapeta",   0, 0, "VCT file name");
+  REMAPETAS = cdoOperatorAdd("remapeta_s", 0, 0, "VCT file name");
+  REMAPETAZ = cdoOperatorAdd("remapeta_z", 0, 0, "VCT file name");
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  envstr = getenv("REMAPETA_PTOP");
+  if ( envstr )
+    {
+      double fval = atof(envstr);
+      if ( fval > 0 )
+	{
+	  cptop = fval;
+	  //	  if ( cdoVerbose )
+	  cdoPrint("Set REMAPETA_PTOP to %g", cptop);
+	}
+    }  
+
+  vct2 = vctFromFile(operatorArgv()[0], &nvct2);
+  nhlevf2 = nvct2/2 - 1;
+
+  a2 = vct2;
+  b2 = vct2 + nvct2/2;
+
+  if ( cdoVerbose )
+    for ( i = 0; i < nhlevf2+1; ++i )
+      cdoPrint("vct2: %5d %25.17f %25.17f", i, vct2[i], vct2[nvct2/2+i]);
+
+  if ( operatorArgc() == 2 )
+    {
+      lfis2 = TRUE;
+      fname = operatorArgv()[1];
+      
+      streamID1 = streamOpenRead(fname);
+
+      vlistID1 = streamInqVlist(streamID1);
+
+      streamInqRecord(streamID1, &varID, &levelID);
+      gridID  = vlistInqVarGrid(vlistID1, varID);
+      nfis2gp = gridInqSize(gridID);
+
+      fis2 = (double *) malloc(nfis2gp*sizeof(double));
+
+      streamReadRecord(streamID1, fis2, &nmiss);
+
+      if ( nmiss )
+	{
+	  missval = vlistInqVarMissval(vlistID1, varID);
+	  imiss = (int *) malloc (nfis2gp*sizeof(int));
+	  for ( i = 0; i < nfis2gp; ++i )
+	    {
+	      if ( DBL_IS_EQUAL(fis2[i], missval) )
+		imiss[i] = 1;
+	      else 
+		imiss[i] = 0;
+	    }
+
+	  nmissout = nmiss;
+	}
+
+      /* check range of geop */
+      minmaxval(nfis2gp, fis2, imiss, &minval, &maxval);
+      if ( minval < MIN_FIS || maxval > MAX_FIS )
+	cdoWarning("Orography out of range (min=%g max=%g)!", minval, maxval);
+
+      if ( minval < -1.e10 || maxval > 1.e10 )
+	cdoAbort("Orography out of range!");
+
+      streamClose(streamID1); 
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids  = vlistNgrids(vlistID1);
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) == GRID_SPECTRAL )
+	{
+	  cdoAbort("Spectral data unsupported!");
+	}
+      else
+	{
+	  ngp = gridInqSize(gridID);
+	  break;
+	}
+    }
+
+  /* check gridsize */
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) != GRID_SPECTRAL )
+	{
+	  if ( ngp != gridInqSize(gridID) )
+	    cdoAbort("Grids have different size!");
+	}
+    }
+
+  zaxisID2 = zaxisCreate(ZAXIS_HYBRID, nhlevf2);
+  lev2 = (double *) malloc(nhlevf2*sizeof(double));
+  for ( i = 0; i < nhlevf2; ++i ) lev2[i] = i+1;
+  zaxisDefLevels(zaxisID2, lev2);
+  free(lev2);
+
+  if ( nvct2 == 0 ) cdoAbort("Internal problem, vct2 undefined!");
+  zaxisDefVct(zaxisID2, nvct2, vct2);
+
+  surfaceID = zaxisFromName("surface");
+
+  nzaxis  = vlistNzaxis(vlistID1);
+  lhavevct = FALSE;
+
+  if ( cdoVerbose )
+    cdoPrint("nzaxis: %d", nzaxis);
+
+  for ( i = 0; i < nzaxis; i++ )
+    {
+      zaxisID = vlistZaxis(vlistID1, i);
+      nlevel  = zaxisInqSize(zaxisID);
+      if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+	{
+	  if ( nlevel > 1 )
+	    {
+	      nvct1 = zaxisInqVctSize(zaxisID);
+
+              if ( cdoVerbose )
+                cdoPrint("i: %d, vct1 size of zaxisID %d = %d", i, zaxisID, nvct1);
+
+	      if ( nlevel == (nvct1/2 - 1) )
+		{
+		  if ( lhavevct == FALSE )
+		    {
+		      lhavevct = TRUE;
+		      zaxisIDh = zaxisID;
+		      nhlevf1  = nlevel;
+	      
+                      if ( cdoVerbose )
+                        cdoPrint("lhavevct=TRUE  zaxisIDh = %d, nhlevf1   = %d", zaxisIDh, nlevel);
+ 
+		      vct1 = (double *) malloc(nvct1*sizeof(double));
+		      zaxisInqVct(zaxisID, vct1);
+		      
+		      vlistChangeZaxisIndex(vlistID2, i, zaxisID2);
+
+		      a1 = vct1;
+		      b1 = vct1 + nvct1/2;
+		      if ( cdoVerbose )
+			for ( i = 0; i < nvct1/2; ++i )
+			  cdoPrint("vct1: %5d %25.17f %25.17f", i, vct1[i], vct1[nvct1/2+i]);
+		    }
+		  else
+		    {
+		      if ( memcmp(vct1, zaxisInqVctPtr(zaxisID), nvct1*sizeof(double)) == 0 )
+			vlistChangeZaxisIndex(vlistID2, i, zaxisID2);
+		    }
+		}
+              else 
+                {
+		  if ( cdoVerbose )
+		    cdoPrint("nlevel /= (nvct1/2 - 1): nlevel = %d", nlevel);
+                }
+	    }
+	  else
+	    {
+	      vlistChangeZaxisIndex(vlistID2, i, surfaceID);
+	    }
+	}
+      else
+        {
+	  if ( cdoVerbose )
+	    cdoPrint("i: %d, type of zaxisID %d not ZAXIS_HYBRID", i, zaxisID);
+        }
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+
+  if ( zaxisIDh == -1 )
+    cdoWarning("No data on hybrid model level found!");
+
+  nvars = vlistNvars(vlistID1);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID  = vlistInqVarGrid(vlistID1, varID);
+      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+      nlevel  = zaxisInqSize(zaxisID);
+
+      code = vlistInqVarCode(vlistID1, varID);
+      /* code = -1; */
+      if ( code <= 0 )
+	{
+	  vlistInqVarName(vlistID1, varID, varname);
+
+	  strtolower(varname);
+
+	  if ( nlevel == 1 )
+	    {
+	      if      ( strcmp(varname, "geosp")   == 0 ) code = 129;
+	      else if ( strcmp(varname, "aps")     == 0 ) code = 134;
+	      else if ( strcmp(varname, "ps")      == 0 ) code = 134;
+	      else if ( strcmp(varname, "lsp")     == 0 ) code = 152;
+	    }
+
+	  if ( nlevel == nhlevf1 )
+	    {
+	      if      ( strcmp(varname, "t")       == 0 ) code = 130;
+	      else if ( strcmp(varname, "q")       == 0 ) code = 133;
+	    }
+	}
+
+      if      ( code == 129 ) geopID    = varID;
+      else if ( code == 130 ) tempID    = varID;
+      else if ( code == 133 ) sqID      = varID;
+      else if ( code == 134 ) psID      = varID;
+      else if ( code == 152 ) lnpsID    = varID;
+
+      if ( gridInqType(gridID) == GRID_SPECTRAL && zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+	cdoAbort("Spectral data on model level unsupported!");
+
+      if ( gridInqType(gridID) == GRID_SPECTRAL )
+	cdoAbort("Spectral data unsupported!");
+
+
+      if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID && zaxisIDh != -1 && nlevel == nhlevf1 )
+	{
+	  if ( ! (code == 130 || code == 133) )
+	    varids[nvars3D++] = varID;
+	}
+      else
+	{
+	  if ( code == 130 ) tempID = -1;
+	  if ( code == 133 ) sqID   = -1;
+	}
+    }
+
+  if ( tempID != -1 && sqID != -1 )
+    {
+      ltq = TRUE;
+    }
+  else
+    {
+      if ( tempID != -1 ) cdoAbort("Temperature without humidity unsupported!");
+      if ( sqID   != -1 ) cdoAbort("Humidity without temperature unsupported!");
+    }
+  /*
+  if ( ltq == FALSE )
+    {
+      cdoWarning("Temperature and Humidity not found!");
+    }
+  */
+  if ( operatorID == REMAPETAS || operatorID == REMAPETAZ)
+    {
+      sum1 = (double *) malloc(ngp*sizeof(double));
+      sum2 = (double *) malloc(ngp*sizeof(double));
+    }
+
+  if ( operatorID == REMAPETAZ )
+    {
+      deltap1 = (double *) malloc(ngp*nhlevf1*sizeof(double));
+      deltap2 = (double *) malloc(ngp*nhlevf2*sizeof(double));
+      half_press1 = (double *) malloc(ngp*(nhlevf1+1)*sizeof(double));
+      half_press2 = (double *) malloc(ngp*(nhlevf2+1)*sizeof(double));
+    }
+
+  array = (double *) malloc(ngp*sizeof(double));
+
+  fis1  = (double *) malloc(ngp*sizeof(double));
+  ps1   = (double *) malloc(ngp*sizeof(double));
+
+  if ( lfis2 == FALSE ) fis2  = (double *) malloc(ngp*sizeof(double));
+  if ( lfis2 == TRUE && ngp != nfis2gp ) cdoAbort("Orographies have different grid size!");
+
+  ps2   = (double *) malloc(ngp*sizeof(double));
+
+  if ( ltq )
+    {
+      tscor = (double *) malloc(ngp*sizeof(double));
+      pscor = (double *) malloc(ngp*sizeof(double));
+      secor = (double *) malloc(ngp*sizeof(double));
+
+      t1    = (double *) malloc(ngp*nhlevf1*sizeof(double));
+      q1    = (double *) malloc(ngp*nhlevf1*sizeof(double));
+
+      t2    = (double *) malloc(ngp*nhlevf2*sizeof(double));
+      q2    = (double *) malloc(ngp*nhlevf2*sizeof(double));
+    }
+
+  if ( nvars3D )
+    {
+      vars1  = (double **) malloc(nvars*sizeof(double));
+      vars2  = (double **) malloc(nvars*sizeof(double));
+
+      for ( varID = 0; varID < nvars3D; ++varID )
+	{
+	  vars1[varID] = (double *) malloc(ngp*nhlevf1*sizeof(double));
+	  vars2[varID] = (double *) malloc(ngp*nhlevf2*sizeof(double));
+	}
+    }
+
+  if ( zaxisIDh != -1 && geopID == -1 )
+    {
+      if ( ltq )
+	cdoWarning("Orography (surf. geopotential) not found - using zero orography!");
+
+      memset(fis1, 0, ngp*sizeof(double));
+    }
+
+  presID = lnpsID;
+  if ( zaxisIDh != -1 && lnpsID == -1 )
+    {
+      presID = psID;
+      if ( psID != -1 )
+	cdoWarning("LOG surface pressure (lsp) not found - using surface pressure (asp)!");
+      else
+	cdoAbort("Surface pressure not found!");
+    }
+
+  if ( cdoVerbose ) cdoPrint("nvars3D = %d   ltq = %d", nvars3D, ltq);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+	  nlevel   = zaxisInqSize(zaxisID);
+	  offset   = gridsize*levelID;
+	  streamReadRecord(streamID1, array, &nmiss);
+
+	  if ( zaxisIDh != -1 )
+	    {
+	      if ( varID == geopID )
+		memcpy(fis1, array, ngp*sizeof(double));
+	      else if ( varID == presID )
+		{
+		  if ( lnpsID != -1 )
+		    for ( i = 0; i < ngp; ++i ) ps1[i] = exp(array[i]);
+		  else if ( psID != -1 )
+		    memcpy(ps1, array, ngp*sizeof(double));
+		}
+	      else if ( ltq && varID == tempID )
+		memcpy(t1+offset, array, ngp*sizeof(double));
+	      else if ( ltq && varID == sqID )
+		memcpy(q1+offset, array, ngp*sizeof(double));
+	      /* else if ( zaxisID == zaxisIDh ) */
+	      else if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID && nlevel == nhlevf1 )
+		{
+		  for ( i = 0; i < nvars3D; ++i )
+		    if ( varID == varids[i] ) break;
+
+		  if ( i == nvars3D ) cdoAbort("Internal error, 3D variable not found!");
+
+		  memcpy(vars1[i]+offset, array, ngp*sizeof(double));
+		}
+	      else
+		{
+		  streamDefRecord(streamID2, varID, levelID);
+		  streamWriteRecord(streamID2, array, nmiss);
+		}
+	    }
+	  else
+	    {
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, array, nmiss);
+	    }
+	}
+
+      if ( zaxisIDh != -1 )
+	{
+	  /* check range of ps_prog */
+	  minmaxval(ngp, ps1, imiss, &minval, &maxval);
+	  if ( minval < MIN_PS || maxval > MAX_PS )
+	    cdoWarning("Surface pressure out of range (min=%g max=%g)!", minval, maxval);
+
+	  /* check range of geop */
+	  minmaxval(ngp, fis1, imiss, &minval, &maxval);
+	  if ( minval < MIN_FIS || maxval > MAX_FIS )
+	    cdoWarning("Orography out of range (min=%g max=%g)!", minval, maxval);
+	}
+
+      if ( lfis2 == FALSE )
+	for ( i = 0; i < ngp; i++ ) fis2[i] = fis1[i];
+
+      if ( ltq )
+	{
+	  varID = tempID;
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      offset   = gridsize*levelID;
+	      single2  = t1 + offset;
+
+	      minmaxval(ngp, single2, imiss, &minval, &maxval);
+	      if ( minval < MIN_T || maxval > MAX_T )
+		cdoWarning("Input temperature at level %d out of range (min=%g max=%g)!",
+			   levelID+1, minval, maxval);
+	    }
+
+	  varID = sqID;
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      offset   = gridsize*levelID;
+	      single2  = q1 + offset;
+
+	      corr_hum(gridsize, single2, MIN_Q);
+
+	      minmaxval(ngp, single2, imiss, &minval, &maxval);
+	      if ( minval < MIN_Q || maxval > MAX_Q )
+		cdoWarning("Input humidity at level %d out of range (min=%g max=%g)!",
+			   levelID+1, minval, maxval);
+	    }
+	}
+
+      if ( nvars3D || ltq )
+	{
+	  if ( cdoTimer ) timer_start(timer_hetaeta);
+	  hetaeta(ltq, ngp, imiss,
+		  nhlevf1, a1, b1,
+		  fis1, ps1,
+		  t1, q1,
+		  nhlevf2, a2, b2,
+		  fis2, ps2,
+		  t2, q2,
+		  nvars3D, vars1, vars2,
+		  tscor, pscor, secor);
+	  if ( cdoTimer ) timer_stop(timer_hetaeta);
+	}
+
+      if ( cptop > 0 )
+	nctop = ncctop(cptop, (long) nhlevf2, (long) nhlevf2+1, a2, b2);
+
+      if ( geopID != -1 )
+	{
+	  varID   = geopID;
+	  levelID = 0;
+	  setmissval(ngp, imiss, missval, fis2);
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, fis2, nmissout);
+	}
+
+      if ( lnpsID != -1 )
+	for ( i = 0; i < ngp; ++i ) ps2[i] = log(ps2[i]);
+
+      if ( presID != -1 )
+	{
+	  varID   = presID;
+	  levelID = 0;
+	  setmissval(ngp, imiss, missval, ps2);
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, ps2, nmissout);
+	}
+
+      if ( ltq )
+	{
+	  varID = tempID;
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	      offset   = gridsize*levelID;
+	      single2  = t2 + offset;
+
+	      minmaxval(ngp, single2, imiss, &minval, &maxval);
+	      if ( minval < MIN_T || maxval > MAX_T )
+		cdoWarning("Output temperature at level %d out of range (min=%g max=%g)!",
+			   levelID+1, minval, maxval);
+
+	      if ( gridsize == ngp ) setmissval(ngp, imiss, missval, single2);
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, single2, nmissout);
+	    }
+
+	  varID = sqID;
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	      offset   = gridsize*levelID;
+	      single2  = q2 + offset;
+
+	      corr_hum(gridsize, single2, MIN_Q);
+
+	      if ( levelID < nctop )
+		for ( i = 0; i < gridsize; ++i ) single2[i] = cconst;
+
+	      minmaxval(ngp, single2, imiss, &minval, &maxval);
+	      if ( minval < MIN_Q || maxval > MAX_Q )
+		cdoWarning("Output humidity at level %d out of range (min=%g max=%g)!",
+			   levelID+1, minval, maxval);
+
+	      if ( gridsize == ngp ) setmissval(ngp, imiss, missval, single2);
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, single2, nmissout);
+	    }
+	}
+
+      for ( iv = 0; iv < nvars3D; ++iv )
+	{
+	  varID = varids[iv];
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+
+	  if ( operatorID == REMAPETAS )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      vert_sum(sum1, vars1[iv], gridsize, nhlevf1);
+
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	      vert_sum(sum2, vars2[iv], gridsize, nhlevf2);
+	    }
+	  else if ( operatorID == REMAPETAZ )
+	    {
+	      int k;
+
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+
+	      presh(NULL, half_press1, vct1, ps1, nhlevf1, gridsize);
+	      for ( k = 0; k < nhlevf1; ++k )
+		for ( i = 0; i < ngp; ++i )
+		  {
+		    deltap1[k*ngp+i] = half_press1[(k+1)*ngp+i] - half_press1[k*ngp+i];
+		    deltap1[k*ngp+i] = log(deltap1[k*ngp+i]);
+		  }
+	      vert_sumw(sum1, vars1[iv], gridsize, nhlevf1, deltap1);
+
+
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+
+	      presh(NULL, half_press2, vct2, ps1, nhlevf2, gridsize);
+	      for ( k = 0; k < nhlevf2; ++k )
+		for ( i = 0; i < ngp; ++i )
+		  {
+		    deltap2[k*ngp+i] = half_press2[(k+1)*ngp+i] - half_press2[k*ngp+i];
+		    deltap2[k*ngp+i] = log(deltap2[k*ngp+i]);
+		  }
+	      vert_sumw(sum2, vars2[iv], gridsize, nhlevf2, deltap2);
+	    }
+
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      offset   = gridsize*levelID;
+	      single2  = vars2[iv] + offset;
+
+	      if ( operatorID == REMAPETAS || operatorID == REMAPETAZ )
+		{
+		  /*
+		  for ( i = 0; i < gridsize; ++i )
+		    if ( i %100 == 0 )
+		      printf("%d %g %g %g %g %g\n",i, single2[i], sum1[i], sum2[i], sum1[i]/sum2[i], single2[i]*sum1[i]/sum2[i]);
+		  */
+		  for ( i = 0; i < gridsize; ++i )
+		    single2[i] = single2[i]*sum1[i]/sum2[i];
+		}
+
+	      if ( gridsize == ngp ) setmissval(ngp, imiss, missval, single2);
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, single2, nmissout);
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( nvars3D )
+    {
+      for ( varID = 0; varID < nvars3D; varID++ )
+	{
+	  free(vars2[varID]);
+	  free(vars1[varID]);
+	}
+      free(vars2);
+      free(vars1);
+    }
+
+  if ( ltq )
+    {
+      free(q2);
+      free(t2);
+      free(q1);
+      free(t1);
+      free(secor);
+      free(pscor);
+      free(tscor);
+    }
+
+  if ( imiss ) free(imiss);
+
+  free(ps2);
+  free(fis2);
+  free(ps1);
+  free(fis1);
+
+  if ( sum1 ) free(sum1);
+  if ( sum2 ) free(sum2);
+
+  if ( deltap1 ) free(deltap1);
+  if ( deltap2 ) free(deltap2);
+
+  if ( half_press1 ) free(half_press1);
+  if ( half_press2 ) free(half_press2);
+
+  free(array);
+  free(vct2);
+  if ( vct1 ) free(vct1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Replace.c b/src/Replace.c
new file mode 100644
index 0000000..dd7690b
--- /dev/null
+++ b/src/Replace.c
@@ -0,0 +1,270 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Replace    replace         Replace variables
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  MAX_VARS  1024
+
+void *Replace(void *argument)
+{
+  int varID;
+  int varID1, nvars1;
+  int varID2, nvars2;
+  int nrecs = 0;
+  int tsID, recID, levelID, levelID2;
+  int nrecs2;
+  int nchvars = 0;
+  int idx;
+  int streamID1, streamID2, streamID3;
+  int vlistID1 , vlistID2, vlistID3;
+  int code1 = 0, code2;
+  int nlevel1, nlevel2;
+  char varname1[CDI_MAX_NAME], varname2[CDI_MAX_NAME];
+  int gridsize;
+  int nmiss;
+  int taxisID1, taxisID3;
+  int offset;
+  int nts2;
+  int varlist1[MAX_VARS], varlist2[MAX_VARS];
+  int **varlevel = NULL;
+  int **varnmiss2 = NULL;
+  double **vardata2 = NULL;
+  double *array = NULL, *parray;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID3 = taxisDuplicate(taxisID1);
+
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID2 = streamInqVlist(streamID2);
+
+  /* compare all variables in vlistID2 */
+
+  nvars1 = vlistNvars(vlistID1);
+  nvars2 = vlistNvars(vlistID2);
+
+  for ( varID2 = 0; varID2 < nvars2; varID2++ )
+    {
+      code2 = vlistInqVarCode(vlistID2, varID2);
+      vlistInqVarName(vlistID2, varID2, varname2);
+
+      for ( varID1 = 0; varID1 < nvars1; varID1++ )
+	{
+	  code1 = vlistInqVarCode(vlistID1, varID1);
+	  vlistInqVarName(vlistID1, varID1, varname1);
+	  if ( strcmp(varname1, varname2) == 0 ) break;
+	}
+
+      if ( code2 > 0 && varID1 == nvars1 )
+	{
+	  for ( varID1 = 0; varID1 < nvars1; varID1++ )
+	    {
+	      code1 = vlistInqVarCode(vlistID1, varID1);
+	      vlistInqVarName(vlistID1, varID1, varname1);
+	      if ( code1 == code2 ) break;
+	    }
+	}
+
+      if ( varID1 < nvars1 )
+	{
+	  int gridsize1, gridsize2, nlevel1, nlevel2;
+
+	  gridsize1 = gridInqSize(vlistInqVarGrid(vlistID1, varID1));
+	  nlevel1   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID1));
+
+	  gridsize2 = gridInqSize(vlistInqVarGrid(vlistID2, varID2));
+	  nlevel2   = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID2));
+
+	  if ( gridsize1 != gridsize2 )
+	    cdoAbort("Variables have different gridsize!");
+
+	  if ( nlevel1 < nlevel2 )
+	    cdoAbort("Variables have different number of levels!");
+
+	  if ( cdoVerbose )
+	    cdoPrint("Variable %s (code %d) replaced by  %s (code %d)",
+		     varname1, code1, varname2, code2);
+
+	  varlist1[nchvars] = varID1;
+	  varlist2[nchvars] = varID2;
+	  nchvars++;
+	  if ( nchvars > MAX_VARS ) cdoAbort("Internal problem - too many variables!");
+	}
+      else
+	{
+	  cdoPrint("Variable %s (code %d) not found!", varname2, code2);
+	}
+    }
+
+  if ( nchvars )
+    {
+      vardata2  = (double **) malloc(nchvars*sizeof(double *));
+      varnmiss2 = (int **) malloc(nchvars*sizeof(int *));
+      varlevel  = (int **) malloc(nchvars*sizeof(int *));
+      for ( idx = 0; idx < nchvars; idx++ )
+	{
+	  varID1 = varlist1[idx];
+	  varID2 = varlist2[idx];
+	  nlevel1  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID1));
+	  nlevel2  = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID2));
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID2));
+	  vardata2[idx]  = (double *) malloc(nlevel2*gridsize*sizeof(double));
+	  varnmiss2[idx] = (int *) malloc(nlevel2*sizeof(int));
+	  varlevel[idx] = (int *) malloc(nlevel1*sizeof(int));
+	  /*
+	  for ( levelID = 0; levelID < nlevel1; levelID++ )
+	    varlevel[idx][levelID] = levelID;
+	  */
+	  if ( nlevel2 <= nlevel1 )
+	    {
+	      double *level1 = (double *) malloc(nlevel1*sizeof(double));
+	      double *level2 = (double *) malloc(nlevel2*sizeof(double));
+	      zaxisInqLevels(vlistInqVarZaxis(vlistID1, varID1), level1);
+	      zaxisInqLevels(vlistInqVarZaxis(vlistID2, varID2), level2);
+
+	      for ( levelID = 0; levelID < nlevel1; levelID++ )
+		varlevel[idx][levelID] = -1;
+	      
+	      for ( int l2 = 0; l2 < nlevel2; l2++ )
+		{
+		  int l1;
+		  for ( l1 = 0; l1 < nlevel1; l1++ )
+		    if ( IS_EQUAL(level2[l2], level1[l1]) )
+		      {
+			varlevel[idx][l1] = l2;
+			break;
+		      }
+
+		  if ( l1 == nlevel1 ) cdoWarning("Level %g not found!", level2[l2]);
+		}
+
+	      free(level1);
+	      free(level2);
+	    }
+	}
+    }
+
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  vlistDefTaxis(vlistID3, taxisID3);
+  streamDefVlist(streamID3, vlistID3);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  nts2 = vlistNtsteps(vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      if ( tsID == 0 || (nts2 != 0 && nts2 != 1) )
+	{
+	  nrecs2 = streamInqTimestep(streamID2, tsID);
+	  if ( nrecs2 == 0 )
+	    cdoAbort("Input streams have different number of timesteps!");
+
+	  for ( recID = 0; recID < nrecs2; recID++ )
+	    {
+	      streamInqRecord(streamID2, &varID, &levelID);
+	      
+	      for ( idx = 0; idx < nchvars; idx++ )
+		if ( varlist2[idx] == varID )
+		  {
+		    gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+		    offset   = gridsize*levelID;
+		    parray   = vardata2[idx]+offset;
+		    streamReadRecord(streamID2, parray, &nmiss);
+		    varnmiss2[idx][levelID] = nmiss;
+		    break;
+		  }
+	    }
+	}
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  parray = array;
+
+	  for ( idx = 0; idx < nchvars; idx++ )
+	    if ( varlist1[idx] == varID )
+	      {
+		levelID2 = varlevel[idx][levelID];
+		if ( levelID2 != -1 )
+		  {
+		    gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+		    offset   = gridsize*levelID2;
+		    parray   = vardata2[idx]+offset;
+		    nmiss    = varnmiss2[idx][levelID2];
+		    break;
+		  }
+	      }
+
+	  if ( idx == nchvars ) streamReadRecord(streamID1, parray, &nmiss);
+
+	  streamDefRecord(streamID3, varID, levelID);
+	  streamWriteRecord(streamID3, parray, nmiss);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+ 
+  if ( vardata2 )
+    {
+      for ( idx = 0; idx < nchvars; idx++ )
+	{
+	  free(vardata2[idx]);
+	  free(varnmiss2[idx]);
+	  free(varlevel[idx]);
+	}
+
+      free(vardata2);
+      free(varnmiss2);
+      free(varlevel);
+    }
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Replacevalues.c b/src/Replacevalues.c
new file mode 100644
index 0000000..31b90f4
--- /dev/null
+++ b/src/Replacevalues.c
@@ -0,0 +1,193 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Setvals     setvals       Set list of old values to new values
+      Setrtoc     setrtoc       Set range to new value
+      Setrtoc2    setrtoc2      Set range to new value others to value2
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "list.h"
+
+static
+double arg2val(char *arg)
+{
+  /*
+  if      ( strcmp(arg,"inf") == 0 )
+    return  DBL_MAX;
+  else if ( strcmp(arg,"-inf") == 0 )
+    return -DBL_MAX;
+  else
+  */
+    return atof(arg);
+}
+
+void *Replacevalues(void *argument)
+{
+  int  SETVALS, SETRTOC, SETRTOC2;
+  int operatorID;
+  int streamID1, streamID2;
+  int gridsize;
+  int nrecs, recID;
+  int tsID;
+  int varID, levelID;
+  int vlistID1, vlistID2;
+  int nmiss;
+  int nvals = 0;
+  LIST *flist = listNew(FLT_LIST);
+  double *fltarr = NULL;
+  int i, j;
+  double missval;
+  double rmin = 0, rmax = 0;
+  double *array;
+  int taxisID1, taxisID2;
+  double newval = 0, newval2 = 0;
+
+  cdoInitialize(argument);
+
+  SETVALS  = cdoOperatorAdd("setvals" , 0, 0, "I1,O1,...,In,On");
+  SETRTOC  = cdoOperatorAdd("setrtoc",  0, 0, "range (min, max), value");
+  SETRTOC2 = cdoOperatorAdd("setrtoc2", 0, 0, "range (min, max), value1, value2");
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  if ( operatorID == SETVALS )
+    {
+      nvals = args2fltlist(operatorArgc(), operatorArgv(), flist);
+      if ( nvals < 2 ) cdoAbort("Too few arguments!");
+      if ( nvals % 2 != 0 )  cdoAbort("Need pairs of arguments!");
+      fltarr = (double *) listArrayPtr(flist);
+      nvals = nvals / 2;
+    }
+  else if ( operatorID == SETRTOC )
+    {
+      operatorCheckArgc(3);
+      rmin   = arg2val(operatorArgv()[0]);
+      rmax   = arg2val(operatorArgv()[1]);
+      newval = arg2val(operatorArgv()[2]);
+    }
+  else if ( operatorID == SETRTOC2 )
+    {
+      operatorCheckArgc(4);
+      rmin    = arg2val(operatorArgv()[0]);
+      rmax    = arg2val(operatorArgv()[1]);
+      newval  = arg2val(operatorArgv()[2]);
+      newval2 = arg2val(operatorArgv()[3]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array, &nmiss);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  missval = vlistInqVarMissval(vlistID1, varID);
+
+	  if ( operatorID == SETVALS )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		if ( !DBL_IS_EQUAL(array[i], missval) )
+		  {
+		    /* printf("\nelem %d val %f ",i,array[i]); */
+		    for (j=0; j < nvals; j++)
+		      {
+			if ( DBL_IS_EQUAL(array[i], fltarr[j*2] ) )
+			  {
+			    array[i] = fltarr[j*2+1];
+			    /* printf("j=%d %f %f ",j,fltarr[j*2],fltarr[j*2+1]); */
+			    break;
+			  }
+			
+		      }
+		  }
+	    }
+	  else if ( operatorID == SETRTOC )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		if ( !DBL_IS_EQUAL(array[i], missval) )
+		  {
+		    if ( array[i] >= rmin && array[i] <= rmax)
+		      {
+			array[i] = newval;
+		      }
+		  }
+	    }
+	  else if ( operatorID == SETRTOC2 )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		if ( !DBL_IS_EQUAL(array[i], missval) )
+		  {
+		    if ( array[i] >= rmin && array[i] <= rmax )
+		      {
+			array[i] = newval;
+		      }
+		    else
+		      {
+			array[i] = newval2;
+		      }
+		  }
+	    }
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array, nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array ) free(array);
+
+  listDelete(flist);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Rhopot.c b/src/Rhopot.c
new file mode 100644
index 0000000..4bbe592
--- /dev/null
+++ b/src/Rhopot.c
@@ -0,0 +1,352 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Rhopot      rhopot          potential density
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+/*
+!>
+!! transformation from potential to in situ temperature
+!! according to Bryden, 1973, "New polynomials for thermal expansion,
+!! adiabatic temperature gradient and potential temperature of sea
+!! water". Deep Sea Research and Oceanographic Abstracts. 20, 401-408
+!! (GILL P.602), which gives the inverse transformation for an
+!! approximate value, all terms linear in t are taken after that one
+!! newton step.  for the check value 8.4678516 the accuracy is 0.2
+!! mikrokelvin.
+!!
+*/
+
+/* compute density from potential temperature directly */
+static
+double potrho_1(double tpot, double sal, double p)
+{
+  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;
+
+  double r_a0 = 999.842594, r_a1 = 6.793952e-2, r_a2 = -9.095290e-3,
+         r_a3 = 1.001685e-4, r_a4 = -1.120083e-6, r_a5 = 6.536332e-9,
+         r_b0 = 8.24493e-1, r_b1 = -4.0899e-3, r_b2 = 7.6438e-5,
+         r_b3 = -8.2467e-7, r_b4 = 5.3875e-9,
+         r_c0 = -5.72466e-3, r_c1 = 1.0227e-4, r_c2 = -1.6546e-6,
+         r_d0 = 4.8314e-4,
+         r_e0 = 19652.21, r_e1 = 148.4206, r_e2 = -2.327105,
+         r_e3 = 1.360477e-2, r_e4 = -5.155288e-5,
+         r_f0 = 54.6746, r_f1 = -0.603459, r_f2 = 1.09987e-2,
+         r_f3 = -6.1670e-5,
+         r_g0 = 7.944e-2, r_g1 = 1.6483e-2, r_g2 = -5.3009e-4,
+         r_h0 = 3.239908, r_h1 = 1.43713e-3, r_h2 = 1.16092e-4,
+         r_h3 = -5.77905e-7,
+         r_ai0 = 2.2838e-3, r_ai1 = -1.0981e-5, r_ai2 = -1.6078e-6,
+         r_aj0 = 1.91075e-4,
+         r_ak0 = 8.50935e-5, r_ak1 = -6.12293e-6, r_ak2 = 5.2787e-8,
+         r_am0 = -9.9348e-7, r_am1 = 2.0816e-8, r_am2 = 9.1697e-10;
+
+  double dc, dv, dvs, fne, fst, qc, qn3, qnq, qv, qvs, s, s3h, t, tpo;
+  double rho;
+
+  qc = p * (a_a1 + p * (a_c1 - a_e1 * p));
+  qv = p * (a_b1 - a_d * p);
+  dc = 1. + p * (-a_a2 + p * (a_c2 - a_e2 * p));
+  dv = a_b2 * p;
+  qnq  = -p * (-a_a3 + p * a_c3);
+  qn3  = -p * a_a4;
+
+    {
+      tpo = tpot;
+      qvs = qv*(sal - 35.) + qc;
+      dvs = dv*(sal - 35.) + dc;
+      t   = (tpo + qvs)/dvs;
+      fne = - qvs + t*(dvs + t*(qnq + t*qn3)) - tpo;
+      fst = dvs + t*(2.*qnq + 3.*qn3*t);
+      t = t - fne/fst;
+      s = MAX(sal, 0.0);
+      s3h = sqrt(s*s*s);
+
+      rho = (r_a0 + t * (r_a1 + t * (r_a2 + t * (r_a3 + t * (r_a4 + t * r_a5))))
+            + s * (r_b0 + t * (r_b1 + t * (r_b2 + t * (r_b3 + t * r_b4))))    
+            + r_d0 * s*s                 
+            + s3h * (r_c0 + t * (r_c1 + r_c2 * t)))                           
+           / (1.                                                            
+             - p / (p * (r_h0 + t * (r_h1 + t * (r_h2 + t * r_h3))            
+                         + s * (r_ai0 + t * (r_ai1 + r_ai2 * t))              
+                         + r_aj0 * s3h                                        
+                         + (r_ak0 + t * (r_ak1 + t * r_ak2)                   
+                         + s * (r_am0 + t * (r_am1 + t * r_am2))) * p)        
+                    + r_e0 + t * (r_e1 + t * (r_e2 + t * (r_e3 + t * r_e4)))  
+                    + s * (r_f0 + t * (r_f1 + t * (r_f2 + t * r_f3)))         
+                    + s3h * (r_g0 + t * (r_g1 + r_g2 * t))));
+    }
+
+  return (rho);
+}
+
+/*
+#define N 4
+int main (int argc, char *argv[])
+{
+  int i;
+  {
+    double p    = 0;
+    double t[N] = {22, 25, 28, 31};
+    double s[N] = {35, 35, 35, 35};
+    double x[N] = {24.219, 23.343, 22.397, 21.384};
+    double r[N];
+  
+    potrho_1d(t, s, p, r, N);
+
+    for ( i = 0; i < N; ++i )
+      printf("%d %5g %3g %8g %8g %8g %10.3f\n", i, p, s[i], t[i], x[i], r[i], r[i]-x[i]);
+  }
+
+  {
+    double p    = 300;
+    double t[N] = {-2.140, -0.186, 1.771, 3.728};
+    double s[N] = {35, 35, 35, 35};
+    double x[N] = {42.191, 41.941, 41.649, 41.319};
+    double r[N];
+  
+    potrho_1d(t, s, p, r, N);
+
+    for ( i = 0; i < N; ++i )
+      printf("%d %5g %3g %8g %8g %8g %10.3f\n", i, p, s[i], t[i], x[i], r[i], r[i]-x[i]);
+  }
+
+  return (0);
+}
+*/
+
+static
+void calc_rhopot(long gridsize, long nlevel, double *pressure, field_t tho, field_t sao, field_t rho)
+{
+  /* pressure units: hPa     */
+  /* tho units:      Celsius */
+  /* sao units:      psu     */
+
+  long i, levelID, offset;
+  double *rhoptr, *thoptr, *saoptr;
+
+  for ( levelID = 0; levelID < nlevel; ++levelID )
+    {
+      offset = gridsize*levelID;
+      thoptr = tho.ptr + offset;
+      saoptr = sao.ptr + offset;
+      rhoptr = rho.ptr + offset;
+
+      for ( i = 0; i < gridsize; ++i )
+	{
+	  if ( DBL_IS_EQUAL(thoptr[i], tho.missval) ||
+	       DBL_IS_EQUAL(saoptr[i], sao.missval) )
+	    {
+	      rhoptr[i] = rho.missval;
+	    }
+	  else
+	    {
+	      rhoptr[i] = potrho_1(thoptr[i], saoptr[i], pressure[levelID]); 
+	    }
+	}
+    }
+}
+
+
+void *Rhopot(void *argument)
+{
+  int streamID1, streamID2;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int nlevel1, nlevel2;
+  int gridsize;
+  int nvars, code, gridID, zaxisID;
+  int vlistID1, vlistID2;
+  int offset;
+  int ngrids, nlevel;
+  int i;
+  int nmiss;
+  int thoID = -1, saoID = -1;
+  char varname[CDI_MAX_NAME], stdname[CDI_MAX_NAME];
+  int taxisID1, taxisID2;
+  double pin = -1;
+  double *pressure;
+  double *single;
+  field_t tho, sao, rho;
+
+  cdoInitialize(argument);
+
+  if ( operatorArgc() == 1 ) pin = atof(operatorArgv()[0]);
+  
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  nvars = vlistNvars(vlistID1);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID  = vlistInqVarGrid(vlistID1, varID);
+
+      code = vlistInqVarCode(vlistID1, varID);
+      vlistInqVarName(vlistID1, varID, varname);
+      vlistInqVarStdname(vlistID1,varID, stdname);
+      strtolower(varname);
+
+      if      ( strcmp(varname, "tho")   == 0 ) code = 2;
+      else if ( strcmp(varname, "sao")   == 0 ) code = 5;
+
+      else if ( strcmp(varname, "t")     == 0 ) code = 2;
+      else if ( strcmp(varname, "s")     == 0 ) code = 5;
+
+      else if ( strcmp(stdname, "sea_water_potential_temperature") == 0 ) code = 2;
+      else if ( strcmp(stdname, "sea_water_salinity")              == 0 ) code = 5;
+
+      if      ( code == 2 ) thoID = varID;
+      else if ( code == 5 ) saoID = varID;
+    }
+
+  if ( thoID == -1 ) cdoAbort("Potential temperature not found!");
+  if ( saoID == -1 ) cdoAbort("Sea water salinity not found!");
+
+  ngrids = vlistNgrids(vlistID1);
+  gridID = vlistGrid(vlistID1, 0);
+  gridsize = gridInqSize(gridID);
+
+  /* check gridsize */
+  for ( i = 1; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridsize != gridInqSize(gridID) )
+	cdoAbort("Grids have different size!");
+    }
+
+  zaxisID = vlistInqVarZaxis(vlistID1, saoID);
+  nlevel1 = zaxisInqSize(zaxisID);
+  zaxisID = vlistInqVarZaxis(vlistID1, thoID);
+  nlevel2 = zaxisInqSize(zaxisID);
+
+  if ( nlevel1 != nlevel2 ) cdoAbort("temperature and salinity have different number of levels!");
+  nlevel = nlevel1;
+
+  pressure = (double *) malloc(nlevel*sizeof(double));
+  zaxisInqLevels(zaxisID, pressure);
+
+  if ( pin >= 0 ) 
+    for ( i = 0; i < nlevel; ++i ) pressure[i] = pin;
+  else
+    for ( i = 0; i < nlevel; ++i ) pressure[i] /= 10;
+
+  if ( cdoVerbose )
+    {
+      cdoPrint("Level Pressure");
+      for ( i = 0; i < nlevel; ++i )
+	cdoPrint("%5d  %g", i+1, pressure[i]);
+    }
+
+  tho.ptr = (double *) malloc(gridsize*nlevel*sizeof(double));
+  sao.ptr = (double *) malloc(gridsize*nlevel*sizeof(double));
+  rho.ptr = (double *) malloc(gridsize*nlevel*sizeof(double));
+
+  tho.nmiss = 0;
+  sao.nmiss = 0;
+  rho.nmiss = 0;
+  
+  tho.missval = vlistInqVarMissval(vlistID1, thoID);
+  sao.missval = vlistInqVarMissval(vlistID1, saoID);
+  rho.missval = tho.missval;
+
+
+  vlistID2 = vlistCreate();
+  varID = vlistDefVar(vlistID2, gridID, zaxisID, TSTEP_INSTANT);
+  vlistDefVarParam(vlistID2, varID, cdiEncodeParam(18, 255, 255));
+  vlistDefVarName(vlistID2, varID, "rhopot");
+  vlistDefVarLongname(vlistID2, varID, "Sea water potential density");
+  vlistDefVarStdname(vlistID2, varID, "sea_water_potential_density");
+  vlistDefVarUnits(vlistID2, varID, "kg m-3");
+  vlistDefVarMissval(vlistID2, varID, rho.missval);
+
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; ++recID )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  offset = gridsize*levelID;
+
+	  if ( varID == thoID ) streamReadRecord(streamID1, tho.ptr+offset, &(tho.nmiss));
+	  if ( varID == saoID ) streamReadRecord(streamID1, sao.ptr+offset, &(sao.nmiss));
+	}
+
+      calc_rhopot(gridsize, nlevel, pressure, tho, sao, rho); 
+
+      for ( levelID = 0; levelID < nlevel; ++levelID )
+	{
+	  offset = gridsize*levelID;
+	  single = rho.ptr+offset;
+
+	  nmiss = 0;
+	  for ( i = 0; i < gridsize; ++i )
+	    if ( DBL_IS_EQUAL(single[i], rho.missval) ) nmiss++;
+ 
+	  streamDefRecord(streamID2, 0, levelID);
+	  streamWriteRecord(streamID2, single, nmiss);     
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID2);
+
+  free(pressure);
+  free(rho.ptr);
+  free(tho.ptr);
+  free(sao.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Rotuv.c b/src/Rotuv.c
new file mode 100644
index 0000000..ce75a57
--- /dev/null
+++ b/src/Rotuv.c
@@ -0,0 +1,304 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Rotuv      rotuvb          Backward rotation
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+static
+void rot_uv_back(int gridID, double *us, double *vs)
+{
+  long i, ilat, ilon, nlat, nlon;
+  double u, v;
+  double xval, yval;
+  double xpole, ypole, angle;
+  double *xvals, *yvals;
+
+  nlon = gridInqXsize(gridID);
+  nlat = gridInqYsize(gridID);
+
+  xpole = gridInqXpole(gridID);
+  ypole = gridInqYpole(gridID);
+  angle = gridInqAngle(gridID);
+
+  xvals = (double *) malloc(nlon*sizeof(double));
+  yvals = (double *) malloc(nlat*sizeof(double));
+
+  gridInqXvals(gridID, xvals);
+  gridInqYvals(gridID, yvals);
+
+  /* Convert lat/lon units if required */
+  {
+    char units[CDI_MAX_NAME];
+    gridInqXunits(gridID, units);
+    gridToDegree(units, "xpole", 1, &xpole);
+    gridToDegree(units, "grid center lon", nlon, xvals);
+    gridInqYunits(gridID, units);
+    gridToDegree(units, "ypole", 1, &ypole);
+    gridToDegree(units, "grid center lat", nlat, yvals);
+  }
+
+  for ( ilat = 0; ilat < nlat; ilat++ )
+    for ( ilon = 0; ilon < nlon; ilon++ )
+      {
+	i = ilat*nlon + ilon;
+
+        xval = lamrot_to_lam(yvals[ilat], xvals[ilon], ypole, xpole, angle);
+        yval = phirot_to_phi(yvals[ilat], xvals[ilon], ypole, angle);
+
+	usvs_to_uv(us[i], vs[i], yval, xval, ypole, xpole, &u, &v);
+	/*
+	if ( i%100 == 0 )
+	fprintf(stderr, "%d %d %g %g %g %g %g %g %g %g\n",
+		ilat, ilon, us[i], vs[i], yvals[ilat], xvals[ilon], ypole, xpole, u, v);
+	*/
+	us[i] = u;
+	vs[i] = v;
+      }
+
+  free(xvals);
+  free(yvals);
+}
+
+#define  MAXARG     16384
+
+void *Rotuv(void *argument)
+{
+  int streamID1, streamID2;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int varID1, varID2, nlevel1, nlevel2;
+  int gridsize;
+  int nvars, code, gridID;
+  int vlistID1, vlistID2;
+  int offset;
+  int nlevel;
+  int lvar = FALSE;
+  int i, nch;
+  int lfound[MAXARG];
+  int chcodes[MAXARG];
+  char *chvars[MAXARG];
+  char varname[CDI_MAX_NAME];
+  int taxisID1, taxisID2;
+  int *recVarID, *recLevelID;
+  int **varnmiss;
+  double **vardata, *single, *usvar = NULL, *vsvar = NULL;
+
+  cdoInitialize(argument);
+
+  operatorInputArg("pairs of u and v in the rotated system");
+
+  nch = operatorArgc();
+  if ( nch%2 ) cdoAbort("Odd number of input arguments!");
+
+  if ( isdigit(*operatorArgv()[0]) )
+    {
+      lvar = FALSE;
+      for ( i = 0; i < nch; i++ )
+	chcodes[i] = atoi(operatorArgv()[i]);
+    }
+  else
+    {
+      lvar = TRUE;
+      for ( i = 0; i < nch; i++ )
+	chvars[i] = operatorArgv()[i];
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  nvars = vlistNvars(vlistID1);
+  nrecs = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecs*sizeof(int));
+  recLevelID = (int *) malloc(nrecs*sizeof(int));
+
+  varnmiss   = (int **) malloc(nvars*sizeof(int *));
+  vardata    = (double **) malloc(nvars*sizeof(double *));
+
+  for ( i = 0; i < nch; i++ ) lfound[i] = FALSE;
+
+  if ( lvar )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  vlistInqVarName(vlistID2, varID, varname);
+	  for ( i = 0; i < nch; i++ )
+	    if ( strcmp(varname, chvars[i]) == 0 ) lfound[i] = TRUE;
+	}
+      for ( i = 0; i < nch; i++ )
+	if ( ! lfound[i] ) cdoAbort("Variable %s not found!", chvars[i]);
+    }
+  else
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  code = vlistInqVarCode(vlistID2, varID);
+	  for ( i = 0; i < nch; i++ )
+	    if ( code == chcodes[i] ) lfound[i] = TRUE;
+	}
+      for ( i = 0; i < nch; i++ )
+	if ( ! lfound[i] ) cdoAbort("Code %d not found!", chcodes[i]);
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID = vlistInqVarGrid(vlistID1, varID);
+      if ( ! (gridInqType(gridID) == GRID_LONLAT && gridIsRotated(gridID)) )
+	cdoAbort("Only rotated lon/lat grids supported");
+
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      varnmiss[varID] = (int *)    malloc(nlevel*sizeof(int));
+      vardata[varID]  = (double *) malloc(gridsize*nlevel*sizeof(double));
+    }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  recVarID[recID]   = varID;
+	  recLevelID[recID] = levelID;
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));	  
+	  offset  = gridsize*levelID;
+	  single  = vardata[varID] + offset;
+	  streamReadRecord(streamID1, single, &varnmiss[varID][levelID]);
+	  if ( varnmiss[varID][levelID] )
+	    cdoAbort("Missing values unsupported for this operator!");
+	}
+
+      for ( i = 0; i < nch; i += 2 )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( lvar )
+		{
+		  vlistInqVarName(vlistID2, varID, varname);
+		  if ( strcmp(varname, chvars[i]) == 0 ) break;
+		}
+	      else
+		{
+		  code = vlistInqVarCode(vlistID2, varID);
+		  if ( code == chcodes[i] ) break;
+		}
+	    }
+
+	  if ( varID == nvars )
+	    cdoAbort("u-wind not found!");
+	  else
+	    usvar = vardata[varID];
+
+	  varID1 = varID;
+	  
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( lvar )
+		{
+		  vlistInqVarName(vlistID2, varID, varname);
+		  if ( strcmp(varname, chvars[i+1]) == 0 ) break;
+		}
+	      else
+		{
+		  code = vlistInqVarCode(vlistID2, varID);
+		  if ( code == chcodes[i+1] ) break;
+		}
+	    }
+
+	  if ( varID == nvars )
+	    cdoAbort("v-wind not found!");
+	  else
+	    vsvar = vardata[varID];
+
+	  varID2 = varID;
+
+	  if ( cdoVerbose )
+	    cdoPrint("Using code %d [%d](u) and code %d [%d](v)",
+		     vlistInqVarCode(vlistID1, varID1), chcodes[i],
+		     vlistInqVarCode(vlistID1, varID2), chcodes[i+1]);
+	  
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  nlevel1  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID1));
+	  nlevel2  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID2));
+
+	  if ( nlevel1 != nlevel2 )
+	    cdoAbort("u-wind and v-wind have different number of levels!");
+
+	  for ( levelID = 0; levelID < nlevel1; levelID++ )
+	    {
+	      offset = gridsize*levelID;
+	      rot_uv_back(gridID, usvar + offset, vsvar + offset);
+	    }
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  varID    = recVarID[recID];
+	  levelID  = recLevelID[recID];
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single   = vardata[varID] + offset;
+
+	  streamDefRecord(streamID2, varID,  levelID);
+	  streamWriteRecord(streamID2, single, varnmiss[varID][levelID]);     
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      free(varnmiss[varID]);
+      free(vardata[varID]);
+    }
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Runpctl.c b/src/Runpctl.c
new file mode 100644
index 0000000..247c36f
--- /dev/null
+++ b/src/Runpctl.c
@@ -0,0 +1,246 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Runpctl    runpctl         Running percentiles
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "nth_element.h"
+
+
+void *Runpctl(void *argument)
+{
+  int gridsize;
+  int varID;
+  int recID;
+  int gridID;
+  int nrecs, nrecords;
+  int levelID;
+  int tsID;
+  int otsID;
+  int i, j, inp, its, ndates = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int nmiss;
+  int nvars, nlevels;
+  int *recVarID, *recLevelID;
+  double missval, val;
+  field_t ***vars1 = NULL;
+  datetime_t *datetime;
+  int taxisID1, taxisID2;
+  int calendar, dpy;
+  int pn;
+  double *array;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("runpctl", func_pctl, 0, NULL);
+
+  operatorInputArg("percentile number, number of timesteps");
+  operatorCheckArgc(2);
+  pn     = atoi(operatorArgv()[0]);
+  ndates = atoi(operatorArgv()[1]);
+
+  if ( pn < 1 || pn > 99 )
+    cdoAbort("Illegal argument: percentile number %d is not in the range 1..99!", pn);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  calendar = taxisInqCalendar(taxisID1);
+  dpy      = calendar_dpy(calendar);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  datetime = (datetime_t *) malloc((ndates+1)*sizeof(datetime_t));
+  vars1 = (field_t ***) malloc((ndates+1)*sizeof(field_t **));
+  array = (double *) malloc(ndates*sizeof(double));
+  
+  for ( its = 0; its < ndates; its++ )
+    {
+      vars1[its] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          gridID   = vlistInqVarGrid(vlistID1, varID);
+          gridsize = gridInqSize(gridID);
+          nlevels  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+          missval  = vlistInqVarMissval(vlistID1, varID);
+
+          vars1[its][varID] = (field_t *)  malloc(nlevels*sizeof(field_t));
+
+          for ( levelID = 0; levelID < nlevels; levelID++ )
+            {
+              vars1[its][varID][levelID].grid    = gridID;
+              vars1[its][varID][levelID].nmiss   = 0;
+              vars1[its][varID][levelID].missval = missval;
+              vars1[its][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+            }
+        }
+    }
+
+  for ( tsID = 0; tsID < ndates; tsID++ )
+    {
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 )
+        cdoAbort("File has less than %d timesteps!", ndates);
+
+      datetime[tsID].date = taxisInqVdate(taxisID1);
+      datetime[tsID].time = taxisInqVtime(taxisID1);
+        
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID1, &varID, &levelID);
+
+          if ( tsID == 0 )
+            {
+              recVarID[recID]   = varID;
+              recLevelID[recID] = levelID;
+            }
+          
+          streamReadRecord(streamID1, vars1[tsID][varID][levelID].ptr, &nmiss);
+          vars1[tsID][varID][levelID].nmiss = nmiss;
+        }
+    }
+
+  otsID = 0;
+  while ( TRUE )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+          
+          gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+          missval  = vlistInqVarMissval(vlistID1, varID);
+          nlevels  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+          
+          for ( levelID = 0; levelID < nlevels; levelID++ )
+            {
+              nmiss = 0;  
+              for ( i = 0; i < gridsize; i++ )
+                {
+                  for ( inp = 0, j = 0; inp < ndates; inp++ )
+                    {
+                      val = vars1[inp][varID][levelID].ptr[i];
+                      if ( !DBL_IS_EQUAL(val, missval) )
+                        array[j++] = val;
+                    }
+                  
+                  if ( j > 0 )
+                    {
+                      vars1[0][varID][levelID].ptr[i] = nth_element(array, j, (int)ceil(j*(pn/100.0))-1);
+                    }
+                  else
+                    {
+                      vars1[0][varID][levelID].ptr[i] = missval;
+                      nmiss++;
+                    }
+                }
+              vars1[0][varID][levelID].nmiss = nmiss;  
+            }
+        }
+     
+      datetime_avg(dpy, ndates, datetime);
+
+      taxisDefVdate(taxisID2, datetime[ndates].date);
+      taxisDefVtime(taxisID2, datetime[ndates].time);
+      streamDefTimestep(streamID2, otsID);
+
+      for ( recID = 0; recID < nrecords; recID++ )
+        {
+          varID    = recVarID[recID];
+          levelID  = recLevelID[recID];
+
+	  if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, vars1[0][varID][levelID].ptr, vars1[0][varID][levelID].nmiss);
+        }
+
+      otsID++;
+
+      datetime[ndates] = datetime[0];
+      vars1[ndates] = vars1[0];
+
+      for ( inp = 0; inp < ndates; inp++ )
+        {
+          datetime[inp] = datetime[inp+1];
+          vars1[inp] = vars1[inp+1];
+        }
+
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 ) break;
+
+      datetime[ndates-1].date = taxisInqVdate(taxisID1);
+      datetime[ndates-1].time = taxisInqVtime(taxisID1);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID1, &varID, &levelID);
+          
+          streamReadRecord(streamID1, vars1[ndates-1][varID][levelID].ptr, &nmiss);
+          vars1[ndates-1][varID][levelID].nmiss = nmiss;
+        }
+
+      tsID++;
+    }
+
+  for ( its = 0; its < ndates; its++ )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+          for ( levelID = 0; levelID < nlevels; levelID++ )
+            free(vars1[its][varID][levelID].ptr);
+          free(vars1[its][varID]);
+        }
+      free(vars1[its]);
+    }
+
+  free(vars1);
+  free(array);
+  
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Runstat.c b/src/Runstat.c
new file mode 100644
index 0000000..e2716cb
--- /dev/null
+++ b/src/Runstat.c
@@ -0,0 +1,499 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Runstat    runmin          Running minimum
+      Runstat    runmax          Running maximum
+      Runstat    runsum          Running sum
+      Runstat    runmean         Running mean
+      Runstat    runavg          Running average
+      Runstat    runvar          Running variance
+      Runstat    runstd          Running standard deviation
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void datetime_avg(int calendar, int ndates, datetime_t *datetime)
+{
+  int vdate, vtime;
+  juldate_t juldate1, juldate2, juldatem;
+  double seconds;
+  /*
+  for ( i = 0; i < ndates; i++ )
+    fprintf(stdout, "%4d %d %d\n", i+1, datetime[i].date, datetime[i].time);
+  */
+  if ( ndates%2 == 0 )
+    {
+      /*
+      vdate = datetime[ndates-1].date;
+      vtime = datetime[ndates-1].time;
+      */
+      vdate = datetime[ndates/2-1].date;
+      vtime = datetime[ndates/2-1].time;
+      juldate1 = juldate_encode(calendar, vdate, vtime);
+
+      vdate = datetime[ndates/2].date;
+      vtime = datetime[ndates/2].time;
+      juldate2 = juldate_encode(calendar, vdate, vtime);
+
+      seconds = juldate_to_seconds(juldate_sub(juldate2, juldate1)) / 2;
+      juldatem = juldate_add_seconds(NINT(seconds), juldate1);
+      juldate_decode(calendar, juldatem, &vdate, &vtime);
+    }
+  else
+    {
+      vdate = datetime[ndates/2].date;
+      vtime = datetime[ndates/2].time;
+    }
+
+  datetime[ndates].date = vdate;
+  datetime[ndates].time = vtime;
+  /*
+  fprintf(stdout, "res: %d %d\n\n", datetime[ndates].date, datetime[ndates].time);
+  */
+}
+
+
+void *Runstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int gridsize, gridsizemax;
+  int i;
+  int varID;
+  int recID;
+  int gridID;
+  int nrecs, nrecords;
+  int levelID;
+  int tsID;
+  int otsID;
+  int inp, its, ndates = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int nmiss;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  int *imask;
+  double missval;
+  field_t ***vars1 = NULL, ***vars2 = NULL, ***samp1 = NULL;
+  datetime_t *datetime;
+  int taxisID1, taxisID2;
+  int calendar;
+  int runstat_nomiss = 0;
+  int runstat_date = DATE_MIDDLE;
+  char *envstr;
+
+  cdoInitialize(argument);
+
+  envstr = getenv("RUNSTAT_NOMISS");
+  if ( envstr )
+    {
+      char *endptr;
+      int envval = (int) strtol(envstr, &endptr, 10);
+      if ( envval == 1 ) runstat_nomiss = 1;
+    }
+
+  envstr = getenv("RUNSTAT_DATE");
+  if ( envstr )
+    {
+      int env_date = -1;
+
+      if      ( memcmp(envstr, "first", 5) == 0 ||
+		memcmp(envstr, "FIRST", 5) == 0 ||
+		memcmp(envstr, "First", 5) == 0 )  env_date = DATE_FIRST;
+      else if ( memcmp(envstr, "last", 4) == 0 ||
+		memcmp(envstr, "LAST", 4) == 0 ||
+		memcmp(envstr, "Last", 4) == 0 )   env_date = DATE_LAST;
+      else if ( memcmp(envstr, "middle", 6) == 0 ||
+		memcmp(envstr, "MIDDLE", 6) == 0 ||
+		memcmp(envstr, "Middle", 6) == 0 ) env_date = DATE_MIDDLE;
+
+      if ( env_date >= 0 )
+	{
+	  runstat_date = env_date;
+
+	  if ( cdoVerbose )
+	    cdoPrint("Set RUNSTAT_DATE to %s", envstr);
+	}
+    }
+
+  cdoOperatorAdd("runmin",  func_min,  0, NULL);
+  cdoOperatorAdd("runmax",  func_max,  0, NULL);
+  cdoOperatorAdd("runsum",  func_sum,  0, NULL);
+  cdoOperatorAdd("runmean", func_mean, 0, NULL);
+  cdoOperatorAdd("runavg",  func_avg,  0, NULL);
+  cdoOperatorAdd("runvar",  func_var,  0, NULL);
+  cdoOperatorAdd("runstd",  func_std,  0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  operatorInputArg("number of timesteps");
+  ndates = atoi(operatorArgv()[0]);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  calendar = taxisInqCalendar(taxisID1);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  datetime = (datetime_t *) malloc((ndates+1)*sizeof(datetime_t));
+  vars1 = (field_t ***) malloc((ndates+1)*sizeof(field_t **));
+  if ( !runstat_nomiss )
+    samp1 = (field_t ***) malloc((ndates+1)*sizeof(field_t **));
+  if ( operfunc == func_std || operfunc == func_var )
+    vars2 = (field_t ***) malloc((ndates+1)*sizeof(field_t **));
+
+  for ( its = 0; its < ndates; its++ )
+    {
+      vars1[its] = (field_t **) malloc(nvars*sizeof(field_t *));
+      if ( !runstat_nomiss )
+	samp1[its] = (field_t **) malloc(nvars*sizeof(field_t *));
+      if ( operfunc == func_std || operfunc == func_var )
+	vars2[its] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+
+	  vars1[its][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	  if ( !runstat_nomiss )
+	    samp1[its][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	  if ( operfunc == func_std || operfunc == func_var )
+	    vars2[its][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      vars1[its][varID][levelID].grid    = gridID;
+	      vars1[its][varID][levelID].nmiss   = 0;
+	      vars1[its][varID][levelID].missval = missval;
+	      vars1[its][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+	      if ( !runstat_nomiss )
+		{
+		  samp1[its][varID][levelID].grid    = gridID;
+		  samp1[its][varID][levelID].nmiss   = 0;
+		  samp1[its][varID][levelID].missval = missval;
+		  samp1[its][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		}
+
+	      if ( operfunc == func_std || operfunc == func_var )
+		{
+		  vars2[its][varID][levelID].grid    = gridID;
+		  vars2[its][varID][levelID].nmiss   = 0;
+		  vars2[its][varID][levelID].missval = missval;
+		  vars2[its][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		}
+	    }
+	}
+    }
+
+  gridsizemax = vlistGridsizeMax(vlistID1);
+  imask = (int *) malloc(gridsizemax*sizeof(int));
+
+  for ( tsID = 0; tsID < ndates; tsID++ )
+    {
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 )
+	cdoAbort("File has less then %d timesteps!", ndates);
+
+      datetime[tsID].date = taxisInqVdate(taxisID1);
+      datetime[tsID].time = taxisInqVtime(taxisID1);
+	
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+	  
+	  streamReadRecord(streamID1, vars1[tsID][varID][levelID].ptr, &nmiss);
+	  vars1[tsID][varID][levelID].nmiss = nmiss;
+
+	  if ( runstat_nomiss && nmiss > 0 ) cdoAbort("Missing values supported swichted off!");
+
+	  if ( !runstat_nomiss )
+	    {
+	      gridsize = gridInqSize(vars1[0][varID][levelID].grid);
+	      missval  = vars1[0][varID][levelID].missval;
+
+	      for ( i = 0; i < gridsize; i++ )
+		if ( DBL_IS_EQUAL(vars1[tsID][varID][levelID].ptr[i], missval) )
+		  imask[i] = 0;
+		else
+		  imask[i] = 1;
+
+	      for ( i = 0; i < gridsize; i++ )
+		samp1[tsID][varID][levelID].ptr[i] = (double) imask[i];
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, inp)
+#endif
+	      for ( inp = 0; inp < tsID; inp++ )
+		{
+		  double *ptr = samp1[inp][varID][levelID].ptr;
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( imask[i] > 0 ) ptr[i]++;
+		}
+	    }
+
+	  if ( operfunc == func_std || operfunc == func_var )
+	    {
+	      farmoq(&vars2[tsID][varID][levelID], vars1[tsID][varID][levelID]);
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared)
+#endif
+	      for ( inp = 0; inp < tsID; inp++ )
+		{
+		  farsumq(&vars2[inp][varID][levelID], vars1[tsID][varID][levelID]);
+		  farsum(&vars1[inp][varID][levelID], vars1[tsID][varID][levelID]);
+		}
+	    }
+	  else
+	    {
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared)
+#endif
+	      for ( inp = 0; inp < tsID; inp++ )
+		{
+		  farfun(&vars1[inp][varID][levelID], vars1[tsID][varID][levelID], operfunc);
+		}
+	    }
+	}
+    }
+
+  otsID = 0;
+  while ( TRUE )
+    {
+      if ( operfunc == func_mean || operfunc == func_avg )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      {
+		if ( runstat_nomiss )
+		  farcmul(&vars1[0][varID][levelID], 1.0/ndates);
+		else
+		  fardiv(&vars1[0][varID][levelID], samp1[0][varID][levelID]);
+	      }
+	  }
+      else if ( operfunc == func_std || operfunc == func_var )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      {
+		if ( runstat_nomiss )
+		  {
+		    if ( operfunc == func_std )
+		      farcstd(&vars1[0][varID][levelID], vars2[0][varID][levelID], 1.0/ndates);
+		    else
+		      farcvar(&vars1[0][varID][levelID], vars2[0][varID][levelID], 1.0/ndates);
+		  }
+		else
+		  {
+		    farinv(&samp1[0][varID][levelID]);
+		    if ( operfunc == func_std )
+		      farstd(&vars1[0][varID][levelID], vars2[0][varID][levelID], samp1[0][varID][levelID]);
+		    else
+		      farvar(&vars1[0][varID][levelID], vars2[0][varID][levelID], samp1[0][varID][levelID]);
+		  }
+	      }
+	  }
+
+      if ( runstat_date == DATE_MIDDLE )
+	{
+	  datetime_avg(calendar, ndates, datetime);
+	}
+      else if ( runstat_date == DATE_FIRST )
+	{
+	  datetime[ndates].date = datetime[0].date;
+	  datetime[ndates].time = datetime[0].time;
+	}
+      else if ( runstat_date == DATE_LAST )
+	{
+	  datetime[ndates].date = datetime[ndates-1].date;
+	  datetime[ndates].time = datetime[ndates-1].time;
+	}
+
+      taxisDefVdate(taxisID2, datetime[ndates].date);
+      taxisDefVtime(taxisID2, datetime[ndates].time);
+      streamDefTimestep(streamID2, otsID);
+
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  varID    = recVarID[recID];
+	  levelID  = recLevelID[recID];
+
+	  if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, vars1[0][varID][levelID].ptr, vars1[0][varID][levelID].nmiss);
+	}
+
+      otsID++;
+
+      datetime[ndates] = datetime[0];
+      vars1[ndates] = vars1[0];
+      if ( !runstat_nomiss )
+	samp1[ndates] = samp1[0];
+      if ( operfunc == func_std || operfunc == func_var )
+        vars2[ndates] = vars2[0];
+
+      for ( inp = 0; inp < ndates; inp++ )
+	{
+	  datetime[inp] = datetime[inp+1];
+	  vars1[inp] = vars1[inp+1];
+	  if ( !runstat_nomiss )
+	    samp1[inp] = samp1[inp+1];
+	  if ( operfunc == func_std || operfunc == func_var )
+	    vars2[inp] = vars2[inp+1];
+	}
+
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 ) break;
+
+      datetime[ndates-1].date = taxisInqVdate(taxisID1);
+      datetime[ndates-1].time = taxisInqVtime(taxisID1);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  
+	  streamReadRecord(streamID1, vars1[ndates-1][varID][levelID].ptr, &nmiss);
+	  vars1[ndates-1][varID][levelID].nmiss = nmiss;
+
+	  if ( runstat_nomiss && nmiss > 0 ) cdoAbort("Missing values supported swichted off!");
+
+	  if ( !runstat_nomiss )
+	    {
+	      gridsize = gridInqSize(vars1[0][varID][levelID].grid);
+	      missval  = vars1[0][varID][levelID].missval;
+
+	      for ( i = 0; i < gridsize; i++ )
+		if ( DBL_IS_EQUAL(vars1[ndates-1][varID][levelID].ptr[i], missval) )
+		  imask[i] = 0;
+		else
+		  imask[i] = 1;
+
+	      for ( i = 0; i < gridsize; i++ )
+		samp1[ndates-1][varID][levelID].ptr[i] = (double) imask[i];
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, inp)
+#endif
+	      for ( inp = 0; inp < ndates-1; inp++ )
+		{
+		  double *ptr = samp1[inp][varID][levelID].ptr;
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( imask[i] > 0 ) ptr[i]++;
+		}
+	    }
+
+	  if ( operfunc == func_std || operfunc == func_var )
+	    {
+	      farmoq(&vars2[ndates-1][varID][levelID], vars1[ndates-1][varID][levelID]);
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared)
+#endif
+	      for ( inp = 0; inp < ndates-1; inp++ )
+		{
+		  farsumq(&vars2[inp][varID][levelID], vars1[ndates-1][varID][levelID]);
+		  farsum(&vars1[inp][varID][levelID], vars1[ndates-1][varID][levelID]);
+		}
+	    }
+	  else
+	    {
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared)
+#endif
+	      for ( inp = 0; inp < ndates-1; inp++ )
+		{
+		  farfun(&vars1[inp][varID][levelID], vars1[ndates-1][varID][levelID], operfunc);
+		}
+	    }
+	}
+
+      tsID++;
+    }
+
+  for ( its = 0; its < ndates; its++ )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      free(vars1[its][varID][levelID].ptr);
+	      if ( !runstat_nomiss ) free(samp1[its][varID][levelID].ptr);
+	      if ( operfunc == func_std || operfunc == func_var ) free(vars2[its][varID][levelID].ptr);
+	    }
+
+	  free(vars1[its][varID]);
+	  if ( !runstat_nomiss ) free(samp1[its][varID]);
+	  if ( operfunc == func_std || operfunc == func_var ) free(vars2[its][varID]);
+	}
+
+      free(vars1[its]);
+      if ( !runstat_nomiss ) free(samp1[its]);
+      if ( operfunc == func_std || operfunc == func_var ) free(vars2[its]);
+    }
+
+  free(datetime);
+  free(vars1);
+  if ( !runstat_nomiss ) free(samp1);
+  if ( operfunc == func_std || operfunc == func_var ) free(vars2);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+  if ( imask )      free(imask);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/SSOpar.c b/src/SSOpar.c
new file mode 100644
index 0000000..6512428
--- /dev/null
+++ b/src/SSOpar.c
@@ -0,0 +1,1017 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2012-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Derivepar     geopotheight          geopotential height
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+
+static
+void data_treat(double *zdata, double *xdata, double *ydata, long nx, long ny)
+{
+/*
+  PARAMETER(iwork=3000,jwork=1500)
+  REAL zdata(nx,ny),xdata(nx),ydata(ny)
+  REAL zwork(-iwork:2*iwork,jwork),xwork(-iwork:2*iwork)
+*/
+  double *zwork = NULL, *xwork = NULL;
+  double *xscale = NULL;
+  int *iscale = NULL;
+  long i, j;
+
+  zwork = (double *) malloc(3*nx*ny*sizeof(double));
+  xwork = (double *) malloc(3*nx*sizeof(double));
+  xscale = (double *) malloc(ny*sizeof(double));
+  iscale = (int *) malloc(ny*sizeof(int));
+
+  double pi2 = 2*acos(-1.);
+  for ( i = 0; i < nx; ++i )
+    {
+      xwork[i]      = xdata[i] - pi2;
+      xwork[i+nx]   = xdata[i];
+      xwork[i+nx*2] = xdata[i] + pi2;
+    }
+  /*
+  for ( j = 0; j < ny; ++j )
+    for ( i = 0; i < nx; ++i )
+      {
+	zwork(i   ,j)=zdata[j*nx+i];
+	zwork(i-nx,j)=zdata[j*nx+i];
+	zwork(i+nx,j)=zdata[j*nx+i];
+      }
+    }
+  */
+  /*
+  xincr=(xdata(2)-xdata(1))/2.
+  DO j=1,ny
+    xscale(j)=1./fabs(cos(ydata(j)))*xincr
+    !f77         iscale(j)=MIN(1./fabs(cos(ydata(j))),nx)
+    iscale(j)=1./fabs(cos(ydata(j)))
+    iscale(j)=MIN(iscale(j),nx)
+    !        print *,j,iscale(j)
+    DO i=1,nx
+      zdata(i,j)=0.
+      weight=0.
+      zlan=0.
+      ztot=0.
+      DO is=-iscale(j),iscale(j)
+        weig = MIN(2.*xincr,                                      &
+               MAX(xwork(i+is)+xincr-xwork[i]+xscale(j),0.),      &
+               MAX(xwork[i]+xscale(j)-xwork(i+is)+xincr,0.))
+        IF(weig > 0.)THEN
+          ztot=ztot+1.
+          IF(zwork(i+is,j) >= 1.)zlan=zlan+1.
+          weight=weight+weig
+          zdata(i,j)=zdata(i,j)+zwork(i+is,j)*weig
+        ENDIF
+      ENDDO
+      IF(zlan/ztot >= 0.5)THEN
+        zdata(i,j)=zdata(i,j)/weight
+      ELSE
+        zdata(i,j)=0.
+      ENDIF
+    ENDDO
+  ENDDO
+  */
+
+  free(zwork);
+  free(xwork);
+  free(xscale);
+  free(iscale);
+} // data_treat
+
+static
+void grid_noro(long imdep, long jmdep, double *xdata, double *ydata, double *zdata,          
+	       long imar, long jmar, double *x, double *y,                                   
+	       double *zphi, double *zmea, double *zstd, double *zsig, double *zgam, double *zthe,     
+	       double *zpic, double *zval, int *mask)
+{
+  /*
+  !=======================================================================
+  ! (F. Lott) (voir aussi z.x. Li, A. Harzallah et L. Fairhead)
+  !
+  !      Compute the Parameters of the SSO scheme as described in
+  !      LOTT & MILLER (1997) and LOTT(1999).
+  !      Target points are on a imarxjmar grid.
+  !      At the poles (if any) the fields value is repeated
+  !      jmar time.
+  !      The parameters a,b,c,d represent the limite of the target
+  !      gridpoint region. The means over this region are calculated
+  !      from USN data, ponderated by a weight proportional to the
+  !      surface occupated by the data inside the model gridpoint area.
+  !      In most circumstances, this weight is the ratio between the
+  !      surface of the USN gridpoint area and the surface of the
+  !      model gridpoint area.
+  !
+  !           (c)
+  !        ----d-----
+  !        | . . . .|
+  !        |        |
+  !     (b)a . * . .b(a)
+  !        |        |
+  !        | . . . .|
+  !        ----c-----
+  !           (d)
+  !=======================================================================
+  ! INPUT:
+  !        imdep, jmdep: dimensions X and Y input field
+  !        xdata, ydata: coordinates X and Y input field
+  !        zdata: Input field
+  !        In this version it is assumed that the entry data come from
+  !        the USNavy dataset: imdep=iusn=2160, jmdep=jusn=1080.
+  ! OUTPUT:
+  !        imar, jmar: dimensions X and Y Output field
+  !        x, y: ccordinates  X and Y Output field.
+  !             zmea:  Mean orographie
+  !             zstd:  Standard deviation
+  !             zsig:  Slope
+  !             zgam:  Anisotropy
+  !             zthe:  Orientation of the small axis
+  !             zpic:  Maximum altitude
+  !             zval:  Minimum altitude
+  !=======================================================================
+  */
+
+  // IMPLICIT INTEGER (i,j)
+  // IMPLICIT REAL(x,z)                                                
+
+  // PARAMETER(iext=216)
+  long iext = imdep/10;
+  /*
+  REAL xusn(imdep+2*iext),yusn(jmdep+2)	
+  REAL zusn(imdep+2*iext,jmdep+2)
+
+  REAL xdata(imdep),ydata(jmdep)
+  REAL zdata(imdep,jmdep)
+
+  ! INTERMEDIATE FIELDS  (CORRELATIONS OF OROGRAPHY GRADIENT)
+
+  REAL ztz(imar,jmar),zxtzx(imar,jmar)
+  REAL zytzy(imar,jmar),zxtzy(imar,jmar)
+  REAL weight(imar,jmar)
+  REAL num_tot(imar,jmar),num_lan(imar,jmar)
+
+  ! CORRELATIONS OF USN OROGRAPHY GRADIENTS
+
+  REAL zxtzxusn(imdep+2*iext,jmdep+2),zytzyusn(imdep+2*iext,jmdep+2)
+  REAL zxtzyusn(imdep+2*iext,jmdep+2)
+  REAL x(imar),y(jmar),zphi(imar,jmar)
+  ! INPUT FIELDS
+  REAL zmea(imar,jmar),zstd(imar,jmar)
+  REAL zsig(imar,jmar),zgam(imar,jmar),zthe(imar,jmar)
+  REAL zpic(imar,jmar),zval(imar,jmar)
+  INTEGER mask(imar,jmar)
+  !
+  REAL a(imar),b(imar),c(jmar),d(jmar)
+  INTEGER ia(imar),ib(imar),ic(jmar),id(jmar)
+  !
+  */
+
+  if ( cdoVerbose ) cdoPrint("Subgrid Scale Orography Parameters");
+
+  double xpi = acos(-1.);
+  double rad = 6371229.;
+  //  double zdeltay=2.*xpi/REAL(jmdep)*rad;
+
+  //  EXTENSION OF THE USN DATABASE TO POCEED COMPUTATIONS AT BOUNDARIES:
+
+  //data_treat(zdata, xdata, ydata, imdep, jmdep);
+
+  /*
+  DO j=1,jmdep
+    yusn(j+1)=ydata(j)
+    DO i=1,imdep
+      zusn(i+iext,j+1)=zdata(i,j)
+      xusn(i+iext)=xdata[i]
+    ENDDO
+    DO i=1,iext
+      zusn(i,j+1)=zdata(imdep-iext+i,j)
+      xusn[i]=xdata(imdep-iext+i)-2.*xpi
+      zusn(imdep+iext+i,j+1)=zdata(i,j)
+      xusn(imdep+iext+i)=xdata[i]+2.*xpi
+    ENDDO
+  ENDDO
+
+  yusn(1)=ydata(1)+(ydata(1)-ydata(2))
+  yusn(jmdep+2)=ydata(jmdep)+(ydata(jmdep)-ydata(jmdep-1))
+  DO i=1,imdep/2+iext
+    zusn(i,1)=zusn(i+imdep/2,2)
+    zusn(i+imdep/2+iext,1)=zusn(i,2)
+    zusn(i,jmdep+2)=zusn(i+imdep/2,jmdep+1)
+    zusn(i+imdep/2+iext,jmdep+2)=zusn(i,jmdep+1)
+  ENDDO
+  !
+  ! COMPUTE LIMITS OF MODEL GRIDPOINT AREA
+  !     ( REGULAR GRID)
+  !
+  a(1) = x(1) - (x(2)-x(1))/2.0
+  b(1) = (x(1)+x(2))/2.0
+  DO i = 2, imar-1
+    a[i] = b(i-1)
+    b[i] = (x[i]+x(i+1))/2.0
+  ENDDO
+  a(imar) = b(imar-1)
+  b(imar) = x(imar) + (x(imar)-x(imar-1))/2.0
+
+  IF(y(2) <= y(1))THEN
+    c(1) = y(1) - (y(2)-y(1))/2.0
+    d(1) = (y(1)+y(2))/2.0
+    DO j = 2, jmar-1
+      c(j) = d(j-1)
+      d(j) = (y(j)+y(j+1))/2.0
+    ENDDO
+    c(jmar) = d(jmar-1)
+    d(jmar) = y(jmar) + (y(jmar)-y(jmar-1))/2.0
+  ELSE
+    c(1) = (y(1)+y(2))/2.0
+    d(1) =  y(1) - (y(2)-y(1))/2.0
+    DO j = 2, jmar-1
+      d(j) = c(j-1)
+      c(j) = (y(j)+y(j+1))/2.0
+    ENDDO
+    d(jmar)=c(jmar-1)
+    c(jmar) = y(jmar) + (y(jmar)-y(jmar-1))/2.0
+  ENDIF
+
+  DO ii=1,imar
+    DO i=2,imdep+2*iext-1
+      IF(a(ii) >= xusn(i-1).AND.a(ii) < xusn[i])ia(ii)=i-1
+      IF(b(ii) > xusn[i].AND.b(ii) <= xusn(i+1))ib(ii)=i+1
+    ENDDO
+  ENDDO
+  DO jj=1,jmar
+    DO j=2,jmdep+1
+      IF(c(jj) >= yusn(j).AND.c(jj) < yusn(j-1))ic(jj)=j-1
+      IF(d(jj) > yusn(j+1).AND.d(jj) <= yusn(j))id(jj)=j+1
+    ENDDO
+  ENDDO
+
+  !
+  !  initialisations:
+  !
+  DO i = 1, imar
+    DO j = 1, jmar
+      weight(i,j) = 0.0
+      zxtzx(i,j)  = 0.0
+      zytzy(i,j)  = 0.0
+      zxtzy(i,j)  = 0.0
+      ztz(i,j)    = 0.0
+      zmea(i,j)   = 0.0
+      zpic(i,j)  =-1.e+10
+      zval(i,j)  = 1.e+10
+    ENDDO
+  ENDDO
+  !
+  !  COMPUTE SLOPES CORRELATIONS ON USN GRID
+  !
+  DO j = 1,jmdep+2
+    DO i = 1, imdep+2*iext
+      zytzyusn(i,j)=0.0
+      zxtzxusn(i,j)=0.0
+      zxtzyusn(i,j)=0.0
+    ENDDO
+  ENDDO
+
+
+  DO j = 2,jmdep+1
+    zdeltax=zdeltay*cos(yusn(j))
+    DO i = 2, imdep+2*iext-1
+      zytzyusn(i,j)=(zusn(i,j+1)-zusn(i,j-1))**2/zdeltay**2
+      zxtzxusn(i,j)=(zusn(i+1,j)-zusn(i-1,j))**2/zdeltax**2
+      zxtzyusn(i,j)=(zusn(i,j+1)-zusn(i,j-1))/zdeltay             &
+                   *(zusn(i+1,j)-zusn(i-1,j))/zdeltax
+    ENDDO
+  ENDDO
+  !
+  !  SUMMATION OVER GRIDPOINT AREA
+  !
+  zleny=xpi/REAL(jmdep)*rad
+  xincr=xpi/2./REAL(jmdep)
+  DO ii = 1, imar
+    DO jj = 1, jmar
+      num_tot(ii,jj)=0.
+      num_lan(ii,jj)=0.
+      !        PRINT *,' iteration ii jj:',ii,jj
+      DO j = ic(jj),id(jj)
+        zlenx=zleny*cos(yusn(j))
+        zdeltax=zdeltay*cos(yusn(j))
+        zbordnor=(c(jj)-yusn(j)+xincr)*rad
+        zbordsud=(yusn(j)-d(jj)+xincr)*rad
+        weighy=MAX(0.,MIN(zbordnor,zbordsud,zleny))
+        DO i = ia(ii),ib(ii)
+          zbordest=(xusn[i]-a(ii)+xincr)*rad*cos(yusn(j))
+          zbordoue=(b(ii)+xincr-xusn[i])*rad*cos(yusn(j))
+          weighx=MAX(0.,MIN(zbordest,zbordoue,zlenx))
+          num_tot(ii,jj)=num_tot(ii,jj)+1.0
+          IF(zusn(i,j) >= 1.)num_lan(ii,jj)=num_lan(ii,jj)+1.0
+          weight(ii,jj)=weight(ii,jj)+weighx*weighy
+          zxtzx(ii,jj)=zxtzx(ii,jj)+zxtzxusn(i,j)*weighx*weighy
+          zytzy(ii,jj)=zytzy(ii,jj)+zytzyusn(i,j)*weighx*weighy
+          zxtzy(ii,jj)=zxtzy(ii,jj)+zxtzyusn(i,j)*weighx*weighy
+          ztz(ii,jj)  =ztz(ii,jj)  +zusn(i,j)*zusn(i,j)*weighx*weighy
+          ! mean
+          zmea(ii,jj) =zmea(ii,jj)+zusn(i,j)*weighx*weighy
+          ! peacks
+          zpic(ii,jj)=MAX(zpic(ii,jj),zusn(i,j))
+          ! valleys
+          zval(ii,jj)=MIN(zval(ii,jj),zusn(i,j))
+        ENDDO
+      ENDDO
+    ENDDO
+  ENDDO
+  !
+  !  COMPUTE PARAMETERS NEEDED BY THE LOTT & MILLER (1997) AND
+  !  LOTT (1999) SSO SCHEME.
+  !
+  zllmmea=0.
+  zllmstd=0.
+  zllmsig=0.
+  zllmgam=0.
+  zllmpic=0.
+  zllmval=0.
+  zllmthe=0.
+  zminthe=0.
+  !     print 100,' '
+  !100  format(1X,A1,'II JJ',4X,'H',8X,'SD',8X,'SI',3X,'GA',3X,'TH')
+  DO ii = 1, imar
+    DO jj = 1, jmar
+      IF (weight(ii,jj)  /=  0.0) THEN
+        !  Mask
+        IF(num_lan(ii,jj)/num_tot(ii,jj) >= 0.5)THEN
+          mask(ii,jj)=1
+        ELSE
+          mask(ii,jj)=0
+        ENDIF
+        !  Mean Orography:
+        zmea (ii,jj)=zmea (ii,jj)/weight(ii,jj)
+        zxtzx(ii,jj)=zxtzx(ii,jj)/weight(ii,jj)
+        zytzy(ii,jj)=zytzy(ii,jj)/weight(ii,jj)
+        zxtzy(ii,jj)=zxtzy(ii,jj)/weight(ii,jj)
+        ztz(ii,jj)  =ztz(ii,jj)/weight(ii,jj)
+        !  Standard deviation:
+        zstd(ii,jj)=SQRT(MAX(0.,ztz(ii,jj)-zmea(ii,jj)**2))
+      ELSE
+        PRINT*, 'probleme,ii,jj=', ii,jj
+      ENDIF
+    ENDDO
+  ENDDO
+
+  ! CORRECT VALUES OF HORIZONTAL SLOPES NEAR THE POLES:
+
+  IF(y(jmar) <= -89.95.OR.y(jmar) >= 89.95)THEN
+
+    DO ii = 1, imar
+      zxtzx(ii,1)=zxtzx(ii,2)
+      zxtzx(ii,jmar)=zxtzx(ii,jmar-1)
+      zxtzy(ii,1)=zxtzy(ii,2)
+      zxtzy(ii,jmar)=zxtzy(ii,jmar-1)
+      zytzy(ii,1)=zytzy(ii,2)
+      zytzy(ii,jmar)=zytzy(ii,jmar-1)
+    ENDDO
+
+  ENDIF
+
+  !  FILTERS TO SMOOTH OUT FIELDS FOR INPUT INTO SSO SCHEME.
+
+  !  FIRST FILTER, MOVING AVERAGE OVER 9 POINTS.
+
+  CALL mva9(zmea,imar,jmar)
+  CALL mva9(zstd,imar,jmar)
+  CALL mva9(zpic,imar,jmar)
+  CALL mva9(zval,imar,jmar)
+  CALL mva9(zxtzx,imar,jmar)
+  CALL mva9(zxtzy,imar,jmar)
+  CALL mva9(zytzy,imar,jmar)
+
+  !  SECOND FILTER FOR SLOPES, MASK AND UNIFORM HORIS RESOLUTION
+
+  DO ii = 1, imar
+    DO jj = 1, jmar
+      zxtzx(ii,jj)=zxtzx(ii,jj)*mask(ii,jj)
+      zxtzy(ii,jj)=zxtzy(ii,jj)*mask(ii,jj)
+      zytzy(ii,jj)=zytzy(ii,jj)*mask(ii,jj)
+    ENDDO
+  ENDDO
+
+  CALL uni_res(zxtzx,y,imar,jmar)
+  CALL uni_res(zxtzy,y,imar,jmar)
+  CALL uni_res(zytzy,y,imar,jmar)
+
+
+  DO ii = 1, imar
+    DO jj = 1, jmar
+      IF (weight(ii,jj)  /=  0.0) THEN
+        !  Coefficients K, L et M:
+        xk=(zxtzx(ii,jj)+zytzy(ii,jj))/2.
+        xl=(zxtzx(ii,jj)-zytzy(ii,jj))/2.
+        xm=zxtzy(ii,jj)
+        xp=xk-SQRT(xl**2+xm**2)
+        xq=xk+SQRT(xl**2+xm**2)
+        xw=1.e-8
+        IF(xp <= xw) xp=0.
+        IF(xq <= xw) xq=xw
+        IF(fabs(xm) <= xw) xm=xw*SIGN(1.,xm)
+        ! slope:
+        zsig(ii,jj)=SQRT(xq)*mask(ii,jj)
+        ! isotropy:
+        zgam(ii,jj)=xp/xq*mask(ii,jj)
+        ! angle theta:
+        zthe(ii,jj)=57.29577951*ATAN2(xm,xl)/2.*mask(ii,jj)
+        zphi(ii,jj)=zmea(ii,jj)*mask(ii,jj)
+        zmea(ii,jj)=zmea(ii,jj)*mask(ii,jj)
+        zpic(ii,jj)=zpic(ii,jj)*mask(ii,jj)
+        zval(ii,jj)=zval(ii,jj)*mask(ii,jj)
+        zstd(ii,jj)=zstd(ii,jj)*mask(ii,jj)
+
+        !          print 101,ii,jj,
+        !    *           zmea(ii,jj),zstd(ii,jj),zsig(ii,jj),zgam(ii,jj),
+        !    *           zthe(ii,jj)
+        !101  format(1x,2(1x,i2),2(1x,f7.1),1x,f7.4,2x,f4.2,1x,f5.1)
+      ELSE
+        !           PRINT*, 'probleme,ii,jj=', ii,jj
+      ENDIF
+      zllmmea=MAX(zmea(ii,jj),zllmmea)
+      zllmstd=MAX(zstd(ii,jj),zllmstd)
+      zllmsig=MAX(zsig(ii,jj),zllmsig)
+      zllmgam=MAX(zgam(ii,jj),zllmgam)
+      zllmthe=MAX(zthe(ii,jj),zllmthe)
+      zminthe=MIN(zthe(ii,jj),zminthe)
+      zllmpic=MAX(zpic(ii,jj),zllmpic)
+      zllmval=MAX(zval(ii,jj),zllmval)
+    ENDDO
+  ENDDO
+
+  PRINT *,'  MEAN ORO:  ',zllmmea
+  PRINT *,'  ST. DEV.:  ',zllmstd
+  PRINT *,'  PENTE:     ',zllmsig
+  PRINT *,'  ANISOTROP: ',zllmgam
+  PRINT *,'  ANGLE:     ',zminthe,zllmthe	
+  PRINT *,'  pic:       ',zllmpic
+  PRINT *,'  val:       ',zllmval
+
+  ! ENSURE PERIODICITY AT HORIZONTAL GRID END
+
+  IF(xdata(imar) >= xdata(1)+2.*xpi-0.001)THEN
+    DO jj=1,jmar
+      zmea(imar,jj)=zmea(1,jj)
+      zpic(imar,jj)=zpic(1,jj)
+      zval(imar,jj)=zval(1,jj)
+      zstd(imar,jj)=zstd(1,jj)
+      zsig(imar,jj)=zsig(1,jj)
+      zgam(imar,jj)=zgam(1,jj)
+      zthe(imar,jj)=zthe(1,jj)
+    ENDDO
+  ENDIF
+
+  !
+  ! VALUES AT THE POLE (IF THERE ARE POLES
+  ! ON THE GRID CONSIDERED)
+  ! gamma and theta a 1. and 0. at poles
+  !
+  IF(ydata(1) <= -xpi/2+0.01.OR.ydata(1) >= xpi/2-0.01)THEN
+    zmeanor=0.0
+    zmeasud=0.0
+    zstdnor=0.0
+    zstdsud=0.0
+    zsignor=0.0
+    zsigsud=0.0
+    zweinor=0.0
+    zweisud=0.0
+    zpicnor=0.0
+    zpicsud=0.0
+    zvalnor=0.0
+    zvalsud=0.0
+
+    DO ii=1,imar
+      zweinor=zweinor+              weight(ii,   1)
+      zweisud=zweisud+              weight(ii,jmar)
+      zmeanor=zmeanor+zmea(ii,   1)*weight(ii,   1)
+      zmeasud=zmeasud+zmea(ii,jmar)*weight(ii,jmar)
+      zstdnor=zstdnor+zstd(ii,   1)*weight(ii,   1)
+      zstdsud=zstdsud+zstd(ii,jmar)*weight(ii,jmar)
+      zsignor=zsignor+zsig(ii,   1)*weight(ii,   1)
+      zsigsud=zsigsud+zsig(ii,jmar)*weight(ii,jmar)
+      zpicnor=zpicnor+zpic(ii,   1)*weight(ii,   1)
+      zpicsud=zpicsud+zpic(ii,jmar)*weight(ii,jmar)
+      zvalnor=zvalnor+zval(ii,   1)*weight(ii,   1)
+      zvalsud=zvalsud+zval(ii,jmar)*weight(ii,jmar)
+    ENDDO
+
+    DO ii=1,imar
+      zmea(ii,   1)=zmeanor/zweinor
+      zmea(ii,jmar)=zmeasud/zweisud
+      zphi(ii,   1)=zmeanor/zweinor
+      zphi(ii,jmar)=zmeasud/zweisud
+      zpic(ii,   1)=zpicnor/zweinor
+      zpic(ii,jmar)=zpicsud/zweisud
+      zval(ii,   1)=zvalnor/zweinor
+      zval(ii,jmar)=zvalsud/zweisud
+      zstd(ii,   1)=zstdnor/zweinor
+      zstd(ii,jmar)=zstdsud/zweisud
+      zsig(ii,   1)=zsignor/zweinor
+      zsig(ii,jmar)=zsigsud/zweisud
+      zgam(ii,   1)=1.
+      zgam(ii,jmar)=1.
+      zthe(ii,   1)=0.
+      zthe(ii,jmar)=0.
+    ENDDO
+
+  ENDIF
+  */
+} // grid_noro
+
+/*
+SUBROUTINE mva9(x,imar,jmar)
+
+  ! MAKE A MOVING AVERAGE OVER 9 GRIDPOINTS OF THE X FIELDS
+
+  REAL x(imar,jmar),xf(imar,jmar)
+  REAL weight(-1:1,-1:1)
+
+
+  sum=0.
+  DO is=-1,1
+    DO js=-1,1
+      weight(is,js)=1./REAL((1+is**2)*(1+js**2))
+      sum=sum+weight(is,js)
+    ENDDO
+  ENDDO
+
+  DO is=-1,1
+    DO js=-1,1
+      weight(is,js)=weight(is,js)/sum
+    ENDDO
+  ENDDO
+
+  DO j=2,jmar-1
+    DO i=2,imar-1
+      xf(i,j)=0.
+      DO is=-1,1
+        DO js=-1,1
+          xf(i,j)=xf(i,j)+x(i+is,j+js)*weight(is,js)
+        ENDDO
+      ENDDO
+    ENDDO
+  ENDDO
+
+  DO j=2,jmar-1
+    xf(1,j)=0.
+    is=imar-1
+    DO js=-1,1
+      xf(1,j)=xf(1,j)+x(is,j+js)*weight(-1,js)
+    ENDDO
+    DO is=0,1
+      DO js=-1,1
+        xf(1,j)=xf(1,j)+x(1+is,j+js)*weight(is,js)
+      ENDDO
+    ENDDO
+    xf(imar,j)=xf(1,j)
+  ENDDO
+
+  DO i=1,imar
+    xf(i,1)=xf(i,2)
+    xf(i,jmar)=xf(i,jmar-1)
+  ENDDO
+
+  DO i=1,imar
+    DO j=1,jmar
+      x(i,j)=xf(i,j)
+    ENDDO
+  ENDDO
+
+  RETURN
+END SUBROUTINE mva9
+
+SUBROUTINE uni_res(xfield,ylat,imar,jmar)
+
+  ! MAKE A MOVING AVERAGE OVER LONGITUDE POINTS
+  ! TO UNIFORMIZE THE HORIZONTAL RESOLUTION
+
+  REAL xfield(imar,jmar),xfilt(-imar:2*imar,jmar)
+  REAL ylat(jmar)
+
+
+  DO j=1,jmar
+    DO i=1,imar
+      xfilt(i+imar,j) = xfield(i,j)
+      xfilt(i-imar,j) = xfield(i,j)
+      xfilt(i     ,j) = xfield(i,j)
+    ENDDO
+  ENDDO
+
+  DO j=2,jmar-1
+    ism=1./cos(ylat(j))
+    !f77      ism=MIN(ism,imar-1)
+    ism=MIN(ism,imar-1)
+    DO i=1,imar
+      xfield(i,j)=0.
+      DO is=-ism,ism
+        xfield(i,j)=xfield(i,j)+xfilt(i+is,j)/REAL(2*ism+1)
+      ENDDO
+    ENDDO
+  ENDDO
+
+  !  POLES TREATMENT FOR SLOPES
+
+  IF(cos(ylat(1)) == 0)THEN
+    DO i=1,imar
+      xfield(i,1)   =0.
+      DO ii=1,imar
+        xfield(i,1)   =xfield(i,1)+xfilt(ii,1)/REAL(imar)
+      ENDDO
+    ENDDO
+  ELSE
+    ism=1./cos(ylat(1))
+    !f77        ism=MIN(ism,imar-1)
+    ism=MIN(ism,imar-1)
+    DO i=1,imar
+      xfield(i,1)   =0.
+      DO is=-ism,ism
+        xfield(i,1)=xfield(i,1)+xfilt(i+is,1)/REAL(2*ism+1)
+      ENDDO
+    ENDDO
+  ENDIF
+
+  IF(cos(ylat(jmar)) == 0)THEN
+    DO i=1,imar
+      xfield(i,jmar)=0.
+      DO ii=1,imar
+        xfield(i,jmar)=xfield(i,jmar)+xfilt(ii,jmar)/REAL(imar)
+      ENDDO
+    ENDDO
+  ELSE
+    ism=1./cos(ylat(jmar))
+    !f77        ism=MIN(ism,imar-1)
+    ism=MIN(ism,imar-1)
+    DO i=1,imar
+      xfield(i,jmar)   =0.
+      DO is=-ism,ism
+        xfield(i,jmar)=xfield(i,jmar)+xfilt(i+is,jmar)/REAL(2*ism+1)
+      ENDDO
+    ENDDO
+  ENDIF
+
+  RETURN
+END SUBROUTINE uni_res
+
+*/
+
+
+void *SSOpar(void *argument)
+{
+  int GEOPOTHEIGHT;
+  int operatorID;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridsize, ngp = 0;
+  int recID, nrecs;
+  int i, offset, iv;
+  int tsID, varID, levelID;
+  int nvars;
+  int zaxisID2, zaxisIDh = -1, nzaxis, surfaceID;
+  int ngrids, gridID, zaxisID;
+  int nlevel;
+  int nvct;
+  int geopID = -1, tempID = -1, humID = -1, psID = -1, lnpsID = -1, presID = -1, clwcID = -1, ciwcID = -1;
+  int code;
+  char varname[CDI_MAX_NAME];
+  double *single2;
+  int taxisID1, taxisID2;
+  int lhavevct;
+  int nhlevf = 0;
+  double *lev2;
+  double *vct = NULL;
+  double *geop = NULL, *ps = NULL, *temp = NULL, *hum = NULL, *lwater = NULL, *iwater = NULL;
+  double *geopotheight = NULL;
+  int nmiss, nmissout = 0;
+  int ltq = FALSE;
+  double *array = NULL;
+  double *half_press = NULL;
+  double minval, maxval;
+  double missval = 0;
+  double cconst = 1.E-6;
+  const char *fname;
+
+
+  cdoInitialize(argument);
+
+  GEOPOTHEIGHT = cdoOperatorAdd("geopotheight",   0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  ngrids  = vlistNgrids(vlistID1);
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) == GRID_SPECTRAL )
+	{
+	  cdoAbort("Spectral data unsupported!");
+	}
+      else
+	{
+	  ngp = gridInqSize(gridID);
+	  break;
+	}
+    }
+
+  /* check gridsize */
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) != GRID_SPECTRAL )
+	{
+	  if ( ngp != gridInqSize(gridID) )
+	    cdoAbort("Grids have different size!");
+	}
+    }
+
+
+  nzaxis  = vlistNzaxis(vlistID1);
+  lhavevct = FALSE;
+
+  if ( cdoVerbose )
+    cdoPrint("nzaxis: %d", nzaxis);
+
+  for ( i = 0; i < nzaxis; i++ )
+    {
+      zaxisID = vlistZaxis(vlistID1, i);
+      nlevel  = zaxisInqSize(zaxisID);
+      if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+	{
+	  if ( nlevel > 1 )
+	    {
+	      nvct = zaxisInqVctSize(zaxisID);
+
+              if ( cdoVerbose )
+                cdoPrint("i: %d, vct size of zaxisID %d = %d", i, zaxisID, nvct);
+
+	      if ( nlevel == (nvct/2 - 1) )
+		{
+		  if ( lhavevct == FALSE )
+		    {
+		      lhavevct = TRUE;
+		      zaxisIDh = zaxisID;
+		      nhlevf   = nlevel;
+	      
+                      if ( cdoVerbose )
+                        cdoPrint("lhavevct=TRUE  zaxisIDh = %d, nhlevf   = %d", zaxisIDh, nlevel);
+ 
+		      vct = (double *) malloc(nvct*sizeof(double));
+		      zaxisInqVct(zaxisID, vct);
+
+		      if ( cdoVerbose )
+			for ( i = 0; i < nvct/2; ++i )
+			  cdoPrint("vct: %5d %25.17f %25.17f", i, vct[i], vct[nvct/2+i]);
+		    }
+		}
+              else 
+                {
+		  if ( cdoVerbose )
+		    cdoPrint("nlevel /= (nvct/2 - 1): nlevel = %d", nlevel);
+                }
+	    }
+	}
+    }
+
+  if ( zaxisIDh == -1 )
+    cdoAbort("No data on hybrid model level found!");
+
+  nvars = vlistNvars(vlistID1);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID  = vlistInqVarGrid(vlistID1, varID);
+      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+      nlevel  = zaxisInqSize(zaxisID);
+
+      code = vlistInqVarCode(vlistID1, varID);
+      /* code = -1; */
+      if ( code <= 0 )
+	{
+	  vlistInqVarName(vlistID1, varID, varname);
+
+	  strtolower(varname);
+
+	  if ( nlevel == 1 )
+	    {
+	      if      ( strcmp(varname, "geosp")   == 0 ) code = 129;
+	      else if ( strcmp(varname, "aps")     == 0 ) code = 134;
+	      else if ( strcmp(varname, "ps")      == 0 ) code = 134;
+	      else if ( strcmp(varname, "lsp")     == 0 ) code = 152;
+	    }
+
+	  if ( nlevel == nhlevf )
+	    {
+	      if      ( strcmp(varname, "t")       == 0 ) code = 130;
+	      else if ( strcmp(varname, "q")       == 0 ) code = 133;
+	      else if ( strcmp(varname, "clwc")    == 0 ) code = 246;
+	      else if ( strcmp(varname, "ciwc")    == 0 ) code = 247;
+	    }
+	}
+
+      if      ( code == 129 ) geopID    = varID;
+      else if ( code == 130 ) tempID    = varID;
+      else if ( code == 133 ) humID     = varID;
+      else if ( code == 134 ) psID      = varID;
+      else if ( code == 152 ) lnpsID    = varID;
+      else if ( code == 246 ) clwcID    = varID;
+      else if ( code == 247 ) ciwcID    = varID;
+
+      if ( gridInqType(gridID) == GRID_SPECTRAL && zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+	cdoAbort("Spectral data on model level unsupported!");
+
+      if ( gridInqType(gridID) == GRID_SPECTRAL )
+	cdoAbort("Spectral data unsupported!");
+
+
+      if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID && zaxisIDh != -1 && nlevel == nhlevf )
+	{
+	}
+      else
+	{
+	  if ( code == 130 ) tempID = -1;
+	  if ( code == 133 ) humID  = -1;
+	  if ( code == 246 ) clwcID  = -1;
+	  if ( code == 247 ) ciwcID  = -1;
+	}
+    }
+
+  if ( tempID == -1 ) cdoAbort("Temperature not found!");
+
+  array  = (double *) malloc(ngp*sizeof(double));
+
+  geop   = (double *) malloc(ngp*sizeof(double));
+  ps     = (double *) malloc(ngp*sizeof(double));
+
+  temp   = (double *) malloc(ngp*nhlevf*sizeof(double));
+  hum    = (double *) malloc(ngp*nhlevf*sizeof(double));
+  lwater = (double *) malloc(ngp*nhlevf*sizeof(double));
+  iwater = (double *) malloc(ngp*nhlevf*sizeof(double));
+
+  half_press   = (double *) malloc(ngp*(nhlevf+1)*sizeof(double));
+  geopotheight = (double *) malloc(ngp*(nhlevf+1)*sizeof(double));
+
+  if ( zaxisIDh != -1 && geopID == -1 )
+    {
+      if ( ltq )
+	cdoWarning("Orography (surf. geopotential) not found - using zero orography!");
+
+      memset(geop, 0, ngp*sizeof(double));
+    }
+
+  presID = lnpsID;
+  if ( zaxisIDh != -1 && lnpsID == -1 )
+    {
+      presID = psID;
+      if ( psID != -1 )
+	cdoWarning("LOG surface pressure (lsp) not found - using surface pressure (asp)!");
+      else
+	cdoAbort("Surface pressure not found!");
+    }
+
+
+  vlistID2 = vlistCreate();
+  varID = vlistDefVar(vlistID2, gridID, zaxisIDh, TSTEP_INSTANT);
+  vlistDefVarParam(vlistID2, varID, cdiEncodeParam(156, 128, 255));
+  vlistDefVarName(vlistID2, varID, "geopotheight");
+  vlistDefVarStdname(vlistID2, varID, "geopotental_height");
+  vlistDefVarUnits(vlistID2, varID, "m");
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+	  nlevel   = zaxisInqSize(zaxisID);
+	  offset   = gridsize*levelID;
+	  streamReadRecord(streamID1, array, &nmiss);
+
+	  if ( zaxisIDh != -1 )
+	    {
+	      if ( varID == geopID )
+		{
+		  memcpy(geop, array, ngp*sizeof(double));
+		}
+	      else if ( varID == presID )
+		{
+		  if ( lnpsID != -1 )
+		    for ( i = 0; i < ngp; ++i ) ps[i] = exp(array[i]);
+		  else if ( psID != -1 )
+		    memcpy(ps, array, ngp*sizeof(double));
+		}
+	      else if ( varID == tempID )
+		memcpy(temp+offset, array, ngp*sizeof(double));
+	      else if ( varID == humID )
+		memcpy(hum+offset, array, ngp*sizeof(double));
+	      else if ( varID == clwcID )
+		memcpy(lwater+offset, array, ngp*sizeof(double));
+	      else if ( varID == ciwcID )
+		memcpy(iwater+offset, array, ngp*sizeof(double));
+	    }
+	}
+
+      if ( zaxisIDh != -1 )
+	{
+	  /* check range of ps_prog */
+
+	  minmaxval(ngp, ps, NULL, &minval, &maxval);
+	  if ( minval < MIN_PS || maxval > MAX_PS )
+	    cdoWarning("Surface pressure out of range (min=%g max=%g)!", minval, maxval);
+
+	  /* check range of geop */
+
+	  minmaxval(ngp, geop, NULL, &minval, &maxval);
+	  if ( minval < MIN_FIS || maxval > MAX_FIS )
+	    cdoWarning("Orography out of range (min=%g max=%g)!", minval, maxval);
+	}
+
+      varID = tempID;
+      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single2  = temp + offset;
+
+	  minmaxval(ngp, single2, NULL, &minval, &maxval);
+	  if ( minval < MIN_T || maxval > MAX_T )
+	    cdoWarning("Input temperature at level %d out of range (min=%g max=%g)!",
+		       levelID+1, minval, maxval);
+	}
+
+
+      nmissout = 0;
+      varID = 0;
+      nlevel = nhlevf;
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, geopotheight+levelID*ngp, nmissout);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID2);
+
+  free(ps);
+  free(geop);
+  free(temp);
+  free(geopotheight);
+  if ( hum ) free(hum);
+
+  if ( half_press ) free(half_press);
+
+  free(array);
+  if ( vct ) free(vct);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Scatter.c b/src/Scatter.c
new file mode 100644
index 0000000..e62864b
--- /dev/null
+++ b/src/Scatter.c
@@ -0,0 +1,307 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+#define  MAX_BLOCKS  16384
+
+static
+void genGrids(int gridID1, int *gridIDs, int nxvals, int nyvals, int nxblocks, int nyblocks,
+	      int **gridindex, int *ogridsize, int nsplit)
+{
+  int gridID2;
+  int gridtype;
+  int gridsize, nx, ny;
+  int gridsize2;
+  int index, i, j, ix, iy, offset;
+  int *xlsize = NULL, *ylsize = NULL;
+  double *xvals = NULL, *yvals = NULL;
+
+  gridtype = gridInqType(gridID1);
+  if ( !(gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN || gridtype == GRID_GENERIC) )
+    cdoAbort("Unsupported grid type: %s!", gridNamePtr(gridtype));
+
+  gridsize = gridInqSize(gridID1);
+  nx = gridInqXsize(gridID1);
+  ny = gridInqYsize(gridID1);
+
+  xvals = (double *) malloc(nx*sizeof(double));
+  yvals = (double *) malloc(ny*sizeof(double));
+
+  xlsize = (int *) malloc(nxblocks*sizeof(int));
+  ylsize = (int *) malloc(nyblocks*sizeof(int));
+
+  gridInqXvals(gridID1, xvals);
+  gridInqYvals(gridID1, yvals);
+
+  for ( ix = 0; ix < nxblocks; ++ix ) xlsize[ix] = nxvals;
+  if ( nx%nxblocks != 0 ) xlsize[nxblocks-1] = nx - (nxblocks-1)*nxvals;
+  if ( cdoVerbose ) for ( ix = 0; ix < nxblocks; ++ix ) cdoPrint("xblock %d: %d", ix, xlsize[ix]);
+
+  for ( iy = 0; iy < nyblocks; ++iy ) ylsize[iy] = nyvals;
+  if ( ny%nyblocks != 0 ) ylsize[nyblocks-1] = ny - (nyblocks-1)*nyvals;
+  if ( cdoVerbose ) for ( iy = 0; iy < nyblocks; ++iy ) cdoPrint("yblock %d: %d", iy, ylsize[iy]);
+
+  index = 0;
+  for ( iy = 0; iy < nyblocks; ++iy )
+    for ( ix = 0; ix < nxblocks; ++ix )
+      {
+	offset = iy*nyvals*nx + ix*nxvals;
+	gridsize2 = 0;
+	// printf("iy %d, ix %d offset %d\n", iy, ix,  offset);
+	for ( j = 0; j < ylsize[iy]; ++j )
+	  {
+	    for ( i = 0; i < xlsize[ix]; ++i )
+	      {
+		//	printf(">> %d %d %d\n", j, i, offset + j*nx + i);
+		gridindex[index][gridsize2++] = offset + j*nx + i;
+	      }
+	  }
+
+	gridID2 = gridCreate(gridtype, gridsize2);
+	gridDefXsize(gridID2, xlsize[ix]);
+	gridDefYsize(gridID2, ylsize[iy]);
+	gridDefXvals(gridID2, xvals+ix*nxvals);
+	gridDefYvals(gridID2, yvals+iy*nyvals);
+
+	gridIDs[index] = gridID2;
+	ogridsize[index] = gridsize2;
+
+	index++;
+	if ( index > nsplit )
+	  cdoAbort("Internal problem, index exceeded bounds!");
+      }
+
+  free(xvals);
+  free(yvals);
+  free(xlsize);
+  free(ylsize);
+}
+
+static
+void window_cell(double *array1, int gridID1, double *array2, long gridsize2, int *cellidx)
+{
+  long i;
+
+  for ( i = 0; i < gridsize2; ++i )
+    array2[i] = array1[cellidx[i]];
+}
+
+typedef struct
+{
+  int gridID;
+  int *gridIDs;
+  int *gridsize;
+  int **gridindex;
+} sgrid_t;
+
+
+void *Scatter(void *argument)
+{
+  int nchars;
+  int streamID1;
+  int *vlistIDs = NULL, *streamIDs = NULL;
+  int gridID1 = -1, varID;
+  int nrecs, ngrids;
+  int tsID, recID, levelID;
+  int vlistID1;
+  char *rstr;
+  char filesuffix[32];
+  char filename[8192];
+  int index;
+  int nsplit;
+  int xinc = 1, yinc = 1;
+  int gridsize, gridsize2max;
+  int gridtype = -1;
+  int nmiss;
+  int nxblocks = 1, nyblocks = 1;
+  int nx, ny, i;
+  double missval;
+  double *array1 = NULL, *array2 = NULL;
+  sgrid_t *grids;
+
+  cdoInitialize(argument);
+
+  operatorInputArg("nxblocks, [nyblocks]");
+  if ( operatorArgc() < 1 ) cdoAbort("Too few arguments!");
+  if ( operatorArgc() > 2 ) cdoAbort("Too many arguments!");
+  nxblocks = (int)strtol(operatorArgv()[0], &rstr, 10);
+  if ( *rstr != 0 ) cdoAbort("Integer parameter string contains invalid characters: %s", operatorArgv()[0]);
+  if ( operatorArgc() == 2 )
+    {
+      nyblocks = (int)strtol(operatorArgv()[1], &rstr, 10);
+      if ( *rstr != 0 ) cdoAbort("Integer parameter string contains invalid characters: %s", operatorArgv()[1]);
+    }
+
+  if ( nxblocks <= 0 ) cdoAbort("nxblocks has to be greater than 0!");
+  if ( nyblocks <= 0 ) cdoAbort("nyblocks has to be greater than 0!");
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  ngrids = vlistNgrids(vlistID1);
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID1 = vlistGrid(vlistID1, index);
+      gridtype = gridInqType(gridID1);
+      if ( gridtype == GRID_LONLAT   || gridtype == GRID_GAUSSIAN ||
+	   (gridtype == GRID_GENERIC && gridInqXsize(gridID1) > 0 && gridInqYsize(gridID1) > 0) )
+	   break;
+    }
+
+  if ( index == ngrids )
+    cdoAbort("No Lon/Lat, Gaussian or Generic grid found (%s data unsupported)!", gridNamePtr(gridtype));
+
+  gridID1 = vlistGrid(vlistID1, 0);
+  gridsize = gridInqSize(gridID1);
+  nx = gridInqXsize(gridID1);
+  ny = gridInqYsize(gridID1);
+  for ( i = 1; i < ngrids; i++ )
+    {
+      gridID1 = vlistGrid(vlistID1, i);
+      if ( gridsize != gridInqSize(gridID1) )
+	cdoAbort("Gridsize must not change!");
+    }
+
+  if ( nxblocks > nx ) cdoAbort("nxblocks greater than nx!");
+  if ( nyblocks > ny ) cdoAbort("nyblocks greater than ny!");
+
+  xinc = nx/nxblocks;
+  yinc = ny/nyblocks;
+
+  if ( nx%xinc != 0 ) xinc++;
+  if ( ny%yinc != 0 ) yinc++;
+
+  nsplit = nxblocks*nyblocks;
+  if ( nsplit > MAX_BLOCKS ) cdoAbort("Too many blocks (max = %d)!", MAX_BLOCKS);
+
+  gridsize2max = xinc*yinc;
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize2max*sizeof(double));
+
+  vlistIDs  = (int *) malloc(nsplit*sizeof(int));
+  streamIDs = (int *) malloc(nsplit*sizeof(int));
+
+  grids = (sgrid_t *) malloc(ngrids*sizeof(sgrid_t));
+  for ( i = 0; i < ngrids; i++ )
+    {  
+      gridID1 = vlistGrid(vlistID1, i);
+      grids[i].gridID = vlistGrid(vlistID1, i);
+      grids[i].gridIDs = (int *) malloc(nsplit*sizeof(int));
+      grids[i].gridsize = (int *) malloc(nsplit*sizeof(int));
+      grids[i].gridindex = (int **) malloc(nsplit*sizeof(int*));
+      for ( index = 0; index < nsplit; index++ )
+	grids[i].gridindex[index] = (int *) malloc(gridsize2max*sizeof(int));
+    }
+
+  for ( index = 0; index < nsplit; index++ )
+    vlistIDs[index] = vlistDuplicate(vlistID1);
+
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID1 = vlistGrid(vlistID1, i);
+      genGrids(gridID1, grids[i].gridIDs, xinc, yinc, nxblocks, nyblocks, grids[i].gridindex, grids[i].gridsize, nsplit);
+
+      for ( index = 0; index < nsplit; index++ )
+	vlistChangeGridIndex(vlistIDs[index], i, grids[i].gridIDs[index]);
+    }
+
+  strcpy(filename, cdoStreamName(1));
+  nchars = strlen(filename);
+
+  filesuffix[0] = 0;
+  cdoGenFileSuffix(filesuffix, sizeof(filesuffix), cdoDefaultFileType, vlistID1);
+
+  for ( index = 0; index < nsplit; index++ )
+    {
+      sprintf(filename+nchars, "%05d", index);
+      if ( filesuffix[0] )
+	sprintf(filename+nchars+5, "%s", filesuffix);
+      streamIDs[index] = streamOpenWrite(filename, cdoFiletype());
+
+      streamDefVlist(streamIDs[index], vlistIDs[index]);
+    }
+
+  printf("Bausstelle: i=0!\n");
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      for ( index = 0; index < nsplit; index++ )
+	streamDefTimestep(streamIDs[index], tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  missval = vlistInqVarMissval(vlistID1, varID);
+
+	  for ( index = 0; index < nsplit; index++ )
+	    {
+	      i = 0;
+	      window_cell(array1, gridID1, array2, grids[i].gridsize[index], grids[i].gridindex[index]);
+	      streamDefRecord(streamIDs[index], varID, levelID);
+	      if ( nmiss > 0 )
+		{
+		  nmiss = 0;
+		  for ( i = 0; i < grids[i].gridsize[index]; ++i )
+		    if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
+		}
+	      streamWriteRecord(streamIDs[index], array2, nmiss);
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID1);
+
+  for ( index = 0; index < nsplit; index++ )
+    {
+      streamClose(streamIDs[index]);
+      vlistDestroy(vlistIDs[index]);
+    }
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+
+  if ( vlistIDs  ) free(vlistIDs);
+  if ( streamIDs ) free(streamIDs);
+
+  for ( i = 0; i < ngrids; i++ )
+    {
+      for ( index = 0; index < nsplit; index++ )
+	gridDestroy(grids[i].gridIDs[index]);
+      free(grids[i].gridIDs);
+      free(grids[i].gridsize);
+
+      for ( index = 0; index < nsplit; index++ )
+	free(grids[i].gridindex[index]);
+      free(grids[i].gridindex);
+    }
+  free(grids);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Seascount.c b/src/Seascount.c
new file mode 100644
index 0000000..0e88152
--- /dev/null
+++ b/src/Seascount.c
@@ -0,0 +1,233 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2007 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Seascount   seascount         Seasonal counts
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+
+void *Seascount(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int gridsize;
+  int vdate = 0, vtime = 0;
+  int vdate0 = 0, vtime0 = 0;
+  int nrecs, nrecords;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int otsID;
+  long nsets;
+  int i;
+  int year, month, day, seas, seas0 = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  int newseas, oldmon = 0, newmon;
+  double missval;
+  field_t **vars1 = NULL;
+  field_t field;
+  int season_start;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("seascount", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  season_start = get_season_start();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  vars1 = (field_t **) malloc(nvars*sizeof(field_t *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      vars1[varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+        {
+          vars1[varID][levelID].grid    = gridID;
+          vars1[varID][levelID].nmiss   = 0;
+          vars1[varID][levelID].missval = missval;
+          vars1[varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+        }
+    }
+
+  tsID    = 0;
+  otsID   = 0;
+  while ( TRUE )
+    {
+      nsets = 0;
+      newseas = FALSE;
+      while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+        {
+          vdate = taxisInqVdate(taxisID1);
+          vtime = taxisInqVtime(taxisID1);
+	  cdiDecodeDate(vdate, &year, &month, &day);
+          if ( month < 0 || month > 16 )
+            cdoAbort("Month %d out of range!", month);
+
+	  newmon = month;
+
+	  if ( season_start == START_DEC )
+	    {
+	      if ( newmon == 12 ) newmon = 0;
+
+	      if ( month <= 12 )
+		seas = (month % 12) / 3;
+	      else
+		seas = month - 13;
+	    }
+	  else
+	    {
+	      if ( month <= 12 )
+		seas = (month - 1) / 3;
+	      else
+		seas = month - 13;
+	    }
+
+          if ( seas < 0 || seas > 3 )
+            cdoAbort("Season %d out of range!", seas+1);
+
+          if ( nsets == 0 )
+            {
+              seas0 = seas;
+              oldmon = newmon;
+            }
+
+          if ( newmon < oldmon ) newseas = TRUE;
+
+          if ( (seas != seas0) || newseas ) break;
+
+          oldmon = newmon;
+
+          for ( recID = 0; recID < nrecs; recID++ )
+            {
+              streamInqRecord(streamID1, &varID, &levelID);
+
+              if ( tsID == 0 )
+                {
+                  recVarID[recID]   = varID;
+                  recLevelID[recID] = levelID;
+                }
+
+              gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+              if ( nsets == 0 )
+                {
+                  for ( i = 0; i < gridsize; i++ )
+                    vars1[varID][levelID].ptr[i] = vars1[varID][levelID].missval;
+		  vars1[varID][levelID].nmiss = gridsize;
+                }
+
+              streamReadRecord(streamID1, field.ptr, &field.nmiss);
+              field.grid    = vars1[varID][levelID].grid;
+              field.missval = vars1[varID][levelID].missval;
+
+              farcount(&vars1[varID][levelID], field);
+            }
+
+          vdate0 = vdate;
+          vtime0 = vtime;
+          nsets++;
+          tsID++;
+        }
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+
+      taxisDefVdate(taxisID2, vdate0);
+      taxisDefVtime(taxisID2, vtime0);
+      streamDefTimestep(streamID2, otsID);
+
+      for ( recID = 0; recID < nrecords; recID++ )
+        {
+          varID   = recVarID[recID];
+          levelID = recLevelID[recID];
+
+	  if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, vars1[varID][levelID].ptr,  vars1[varID][levelID].nmiss);
+        }
+
+      if ( nrecs == 0 ) break;
+      otsID++;
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+        {
+          free(vars1[varID][levelID].ptr);
+        }
+
+      free(vars1[varID]);
+    }
+
+  free(vars1);
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Seaspctl.c b/src/Seaspctl.c
new file mode 100644
index 0000000..019402c
--- /dev/null
+++ b/src/Seaspctl.c
@@ -0,0 +1,283 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Seaspctl   seaspctl        Seasonal percentiles
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "percentiles.h"
+#include "util.h"
+
+
+void *Seaspctl(void *argument)
+{
+  int gridsize;
+  int vdate1 = 0, vtime1 = 0;
+  int vdate2 = 0, vtime2 = 0;
+  int vdate3 = 0, vtime3 = 0;
+  int vdate4 = 0, vtime4 = 0;
+  int nrecs, nrecords;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int otsID;
+  long nsets;
+  int year, month, day, seas, seas0 = 0;
+  int streamID1, streamID2, streamID3, streamID4;
+  int vlistID1, vlistID2, vlistID3, vlistID4, taxisID1, taxisID2, taxisID3, taxisID4;
+  int nmiss;
+  int nvars, nlevels;
+  int *recVarID, *recLevelID;
+  int newseas, oldmon = 0, newmon;
+  double missval;
+  field_t **vars1 = NULL;
+  field_t field;
+  double pn;
+  HISTOGRAM_SET *hset = NULL;
+  int season_start;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("seaspctl", func_pctl, 0, NULL);
+
+  operatorInputArg("percentile number");
+  pn = atof(operatorArgv()[0]);
+      
+  if ( !(pn > 0 && pn < 100) )
+    cdoAbort("Illegal argument: percentile number %g is not in the range 0..100!", pn);
+
+  season_start = get_season_start();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  streamID3 = streamOpenRead(cdoStreamName(2));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = streamInqVlist(streamID3);
+  vlistID4 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+  vlistCompare(vlistID1, vlistID3, CMP_ALL);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = vlistInqTaxis(vlistID3);
+  /* TODO - check that time axes 2 and 3 are equal */
+
+  taxisID4 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID4, taxisID4);
+
+  streamID4 = streamOpenWrite(cdoStreamName(3), cdoFiletype());
+
+  streamDefVlist(streamID4, vlistID4);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords * sizeof(int));
+  recLevelID = (int *) malloc(nrecords * sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  vars1 = (field_t **) malloc(nvars * sizeof(field_t *));
+  hset = hsetCreate(nvars);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevels   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      vars1[varID] = (field_t *) malloc(nlevels * sizeof(field_t));
+      hsetCreateVarLevels(hset, varID, nlevels, gridID);
+
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	{
+	  vars1[varID][levelID].grid    = gridID;
+	  vars1[varID][levelID].nmiss   = 0;
+	  vars1[varID][levelID].missval = missval;
+	  vars1[varID][levelID].ptr     = (double *) malloc(gridsize * sizeof(double));
+	}
+    }
+
+  tsID    = 0;
+  otsID   = 0;
+  while ( TRUE )
+    {
+      nsets   = 0;
+      newseas = FALSE;
+
+      nrecs = streamInqTimestep(streamID2, otsID);
+      if ( nrecs != streamInqTimestep(streamID3, otsID) )
+        cdoAbort("Number of records at time step %d of %s and %s differ!", otsID+1, cdoStreamName(1), cdoStreamName(2));
+      
+      vdate2 = taxisInqVdate(taxisID2);
+      vtime2 = taxisInqVtime(taxisID2);
+      vdate3 = taxisInqVdate(taxisID3);
+      vtime3 = taxisInqVtime(taxisID3);
+      if ( vdate2 != vdate3 || vtime2 != vtime3 )
+        cdoAbort("Verification dates at time step %d of %s and %s differ!", otsID+1, cdoStreamName(1), cdoStreamName(2));
+
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID2, &varID, &levelID);
+	  streamReadRecord(streamID2, vars1[varID][levelID].ptr, &nmiss);
+          vars1[varID][levelID].nmiss = nmiss;
+        }
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID3, &varID, &levelID);
+	  streamReadRecord(streamID3, field.ptr, &nmiss);
+          field.nmiss   = nmiss;
+          field.grid    = vars1[varID][levelID].grid;
+	  field.missval = vars1[varID][levelID].missval;
+	  
+	  hsetDefVarLevelBounds(hset, varID, levelID, &vars1[varID][levelID], &field);
+        }
+
+      while ( nrecs && (nrecs = streamInqTimestep(streamID1, tsID)) )
+	{
+	  vdate1 = taxisInqVdate(taxisID1);
+	  vtime1 = taxisInqVtime(taxisID1);
+	  cdiDecodeDate(vdate1, &year, &month, &day);
+	  if ( month < 0 || month > 16 )
+	    cdoAbort("Month %d out of range!", month);
+
+	  newmon = month;
+
+	  if ( season_start == START_DEC )
+	    {
+	      if ( newmon == 12 ) newmon = 0;
+
+	      if ( month <= 12 )
+		seas = (month % 12) / 3;
+	      else
+		seas = month - 13;
+	    }
+	  else
+	    {
+	      if ( month <= 12 )
+		seas = (month - 1) / 3;
+	      else
+		seas = month - 13;
+	    }
+
+	  if ( seas < 0 || seas > 3 )
+	    cdoAbort("Season %d out of range!", seas + 1);
+
+	  if ( nsets == 0 )
+	    {
+	      seas0 = seas;
+	      oldmon = newmon;
+	    }
+
+	  if ( newmon < oldmon ) newseas = TRUE;
+
+	  if ( (seas != seas0) || newseas ) break;
+
+	  oldmon = newmon;
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+	      if ( tsID == 0 )
+		{
+		  recVarID[recID]   = varID;
+		  recLevelID[recID] = levelID;
+		}
+	      streamReadRecord(streamID1, vars1[varID][levelID].ptr, &nmiss);
+	      vars1[varID][levelID].nmiss = nmiss;
+	      
+	      hsetAddVarLevelValues(hset, varID, levelID, &vars1[varID][levelID]);
+	    }
+
+	  vdate4 = vdate1;
+	  vtime4 = vtime1;
+	  nsets++;
+	  tsID++;
+	}
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+
+      if ( vdate2 != vdate4 )
+        cdoAbort("Verification dates at time step %d of %s, %s and %s differ!", otsID+1, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+      if ( vtime2 != vtime4 )
+        cdoAbort("Verification times at time step %d of %s, %s and %s differ!", otsID+1, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	  nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+            hsetGetVarLevelPercentiles(&vars1[varID][levelID], hset, varID, levelID, pn);
+	}
+
+      taxisDefVdate(taxisID4, vdate4);
+      taxisDefVtime(taxisID4, vtime4);
+      streamDefTimestep(streamID4, otsID);
+
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  varID   = recVarID[recID];
+	  levelID = recLevelID[recID];
+
+	  if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	  streamDefRecord(streamID4, varID, levelID);
+	  streamWriteRecord(streamID4, vars1[varID][levelID].ptr, vars1[varID][levelID].nmiss);
+	}
+
+      if ( nrecs == 0 ) break;
+      otsID++;
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	free(vars1[varID][levelID].ptr);
+      free(vars1[varID]);
+    }
+
+  free(vars1);
+  hsetDestroy(hset);
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID4);
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Seasstat.c b/src/Seasstat.c
new file mode 100644
index 0000000..e1518ca
--- /dev/null
+++ b/src/Seasstat.c
@@ -0,0 +1,381 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Seasstat   seasmin         Seasonal minimum
+      Seasstat   seasmax         Seasonal maximum
+      Seasstat   seassum         Seasonal sum
+      Seasstat   seasmean        Seasonal mean
+      Seasstat   seasavg         Seasonal average
+      Seasstat   seasvar         Seasonal variance
+      Seasstat   seasstd         Seasonal standard deviation
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+
+void *Seasstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int gridsize;
+  int vdate = 0, vtime = 0;
+  int vdate0 = 0, vtime0 = 0;
+  int vdate1 = 0, vtime1 = 0;
+  int nrecs, nrecords;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int otsID;
+  long nsets;
+  int i;
+  int year, month, seas, seas0 = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  int newseas, oldmon = 0, newmon;
+  int nseason = 0;
+  double missval;
+  field_t **vars1 = NULL, **vars2 = NULL, **samp1 = NULL;
+  field_t field;
+  int season_start;
+  const char *seas_name[4];
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("seasmin",  func_min,  0, NULL);
+  cdoOperatorAdd("seasmax",  func_max,  0, NULL);
+  cdoOperatorAdd("seassum",  func_sum,  0, NULL);
+  cdoOperatorAdd("seasmean", func_mean, 0, NULL);
+  cdoOperatorAdd("seasavg",  func_avg,  0, NULL);
+  cdoOperatorAdd("seasvar",  func_var,  0, NULL);
+  cdoOperatorAdd("seasstd",  func_std,  0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  season_start = get_season_start();
+  get_season_name(seas_name);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  vars1 = (field_t **) malloc(nvars*sizeof(field_t *));
+  samp1 = (field_t **) malloc(nvars*sizeof(field_t *));
+  if ( operfunc == func_std || operfunc == func_var )
+    vars2 = (field_t **) malloc(nvars*sizeof(field_t *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      vars1[varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+      samp1[varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+      if ( operfunc == func_std || operfunc == func_var )
+	vars2[varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  vars1[varID][levelID].grid    = gridID;
+	  vars1[varID][levelID].nmiss   = 0;
+	  vars1[varID][levelID].missval = missval;
+	  vars1[varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+	  samp1[varID][levelID].grid    = gridID;
+	  samp1[varID][levelID].nmiss   = 0;
+	  samp1[varID][levelID].missval = missval;
+	  samp1[varID][levelID].ptr     = NULL;
+	  if ( operfunc == func_std || operfunc == func_var )
+	    {
+	      vars2[varID][levelID].grid    = gridID;
+	      vars2[varID][levelID].nmiss   = 0;
+	      vars2[varID][levelID].missval = missval;
+	      vars2[varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+	    }
+	}
+    }
+
+  tsID    = 0;
+  otsID   = 0;
+  while ( TRUE )
+    {
+      nsets = 0;
+      newseas = FALSE;
+      while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+	{
+	  vdate = taxisInqVdate(taxisID1);
+	  vtime = taxisInqVtime(taxisID1);
+	  year  =  vdate / 10000;
+	  month = (vdate - year*10000) / 100;
+	  if ( month < 1 || month > 12 )
+	    cdoAbort("Month %d out of range!", month);
+
+	  newmon = month;
+
+	  if ( season_start == START_DEC )
+	    {
+	      if ( newmon == 12 ) newmon = 0;
+
+	      if ( month <= 12 )
+		seas = (month % 12) / 3;
+	      else
+		seas = month - 13;
+	    }
+	  else
+	    {
+	      if ( month <= 12 )
+		seas = (month - 1) / 3;
+	      else
+		seas = month - 13;
+	    }
+
+	  if ( seas < 0 || seas > 3 )
+	    cdoAbort("Season %d out of range!", seas+1);
+
+	  if ( nsets == 0 )
+	    {
+	      nseason++;
+	      vdate0 = vdate;
+	      vtime0 = vtime;
+	      seas0  = seas;
+	      oldmon = newmon;
+	    }
+
+	  if ( newmon < oldmon ) newseas = TRUE;
+
+	  if ( (seas != seas0) || newseas ) break;
+
+	  oldmon = newmon;
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+
+	      if ( tsID == 0 )
+		{
+		  recVarID[recID]   = varID;
+		  recLevelID[recID] = levelID;
+		}
+
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	      if ( nsets == 0 )
+		{
+		  streamReadRecord(streamID1, vars1[varID][levelID].ptr, &nmiss);
+		  vars1[varID][levelID].nmiss = nmiss;
+
+		  if ( nmiss > 0 || samp1[varID][levelID].ptr )
+		    {
+		      if ( samp1[varID][levelID].ptr == NULL )
+			samp1[varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+
+		      for ( i = 0; i < gridsize; i++ )
+			if ( DBL_IS_EQUAL(vars1[varID][levelID].ptr[i],
+					  vars1[varID][levelID].missval) )
+			  samp1[varID][levelID].ptr[i] = 0;
+			else
+			  samp1[varID][levelID].ptr[i] = 1;
+		    }
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, field.ptr, &field.nmiss);
+		  field.grid    = vars1[varID][levelID].grid;
+		  field.missval = vars1[varID][levelID].missval;
+
+		  if ( field.nmiss > 0 || samp1[varID][levelID].ptr )
+		    {
+		      if ( samp1[varID][levelID].ptr == NULL )
+			{
+			  samp1[varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+			  for ( i = 0; i < gridsize; i++ )
+			    samp1[varID][levelID].ptr[i] = nsets;
+			}
+
+		      for ( i = 0; i < gridsize; i++ )
+			if ( !DBL_IS_EQUAL(field.ptr[i], vars1[varID][levelID].missval) )
+			  samp1[varID][levelID].ptr[i]++;
+		    }
+
+		  if ( operfunc == func_std || operfunc == func_var )
+		    {
+		      farsumq(&vars2[varID][levelID], field);
+		      farsum(&vars1[varID][levelID], field);
+		    }
+		  else
+		    {
+		      farfun(&vars1[varID][levelID], field, operfunc);
+		    }
+		}
+	    }
+
+	  if ( nsets == 0 && (operfunc == func_std || operfunc == func_var) )
+	    for ( varID = 0; varID < nvars; varID++ )
+	      {
+		if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+		nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+		for ( levelID = 0; levelID < nlevel; levelID++ )
+		  farmoq(&vars2[varID][levelID], vars1[varID][levelID]);
+	      }
+
+	  vdate1 = vdate;
+	  vtime1 = vtime;
+	  nsets++;
+	  tsID++;
+	}
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+
+      if ( operfunc == func_mean || operfunc == func_avg )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      {
+		if ( samp1[varID][levelID].ptr == NULL )
+		  farcmul(&vars1[varID][levelID], 1.0/nsets);
+		else
+		  fardiv(&vars1[varID][levelID], samp1[varID][levelID]);
+	      }
+	  }
+      else if ( operfunc == func_std || operfunc == func_var )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      {
+		if ( samp1[varID][levelID].ptr == NULL )
+		  {
+		    if ( operfunc == func_std )
+		      farcstd(&vars1[varID][levelID], vars2[varID][levelID], 1.0/nsets);
+		    else
+		      farcvar(&vars1[varID][levelID], vars2[varID][levelID], 1.0/nsets);
+		  }
+		else
+		  {
+		    farinv(&samp1[varID][levelID]);
+		    if ( operfunc == func_std )
+		      farstd(&vars1[varID][levelID], vars2[varID][levelID], samp1[varID][levelID]);
+		    else
+		      farvar(&vars1[varID][levelID], vars2[varID][levelID], samp1[varID][levelID]);
+		  }
+	      }
+	  }
+
+      if ( cdoVerbose )
+	{
+	  char vdatestr0[32], vtimestr0[32];
+	  char vdatestr1[32], vtimestr1[32];
+	  date2str(vdate0, vdatestr0, sizeof(vdatestr0));
+	  time2str(vtime0, vtimestr0, sizeof(vtimestr0));
+	  date2str(vdate1, vdatestr1, sizeof(vdatestr1));
+	  time2str(vtime1, vtimestr1, sizeof(vtimestr1));
+	  cdoPrint("season %3d %3s start %s %s end %s %s ntimesteps %d", 
+		   nseason, seas_name[seas0],
+		   vdatestr0, vtimestr0, vdatestr1, vtimestr1, nsets);
+	}
+
+      taxisDefVdate(taxisID2, vdate1);
+      taxisDefVtime(taxisID2, vtime1);
+      streamDefTimestep(streamID2, otsID);
+
+      if ( nsets < 3 )
+	{
+	  char vdatestr[32];
+	  date2str(vdate0, vdatestr, sizeof(vdatestr));
+	  cdoWarning("Season %3d (%s) has only %d input time step%s!", 
+		     otsID+1, vdatestr, nsets, nsets == 1 ? "" : "s");
+	}
+
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  varID   = recVarID[recID];
+	  levelID = recLevelID[recID];
+
+	  if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, vars1[varID][levelID].ptr,  vars1[varID][levelID].nmiss);
+	}
+
+      if ( nrecs == 0 ) break;
+      otsID++;
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  free(vars1[varID][levelID].ptr);
+	  if ( samp1[varID][levelID].ptr ) free(samp1[varID][levelID].ptr);
+	  if ( operfunc == func_std || operfunc == func_var ) free(vars2[varID][levelID].ptr);
+	}
+
+      free(vars1[varID]);
+      free(samp1[varID]);
+      if ( operfunc == func_std || operfunc == func_var ) free(vars2[varID]);
+    }
+
+  free(vars1);
+  free(samp1);
+  if ( operfunc == func_std || operfunc == func_var ) free(vars2);
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Selbox.c b/src/Selbox.c
new file mode 100644
index 0000000..0a2eeb2
--- /dev/null
+++ b/src/Selbox.c
@@ -0,0 +1,1002 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Selbox     sellonlatbox    Select lon/lat box
+      Selbox     selindexbox     Select index box
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+static
+void correct_xvals(long nlon, long inc, double *xvals)
+{
+  long i; 
+
+  if ( IS_EQUAL(xvals[0], xvals[(nlon-1)*inc]) ) xvals[(nlon-1)*inc] += 360;
+
+  if ( xvals[0] > xvals[(nlon-1)*inc] )
+    for ( i = 0; i < nlon; i++ )
+      if ( xvals[i*inc] >= 180 ) xvals[i*inc] -= 360;
+
+  for ( i = 0; i < nlon; i++ )
+    {
+      if ( xvals[i*inc] < -180 ) xvals[i*inc] += 360;
+      if ( xvals[i*inc] >  360 ) xvals[i*inc] -= 360;
+    }
+
+  if ( xvals[0] > xvals[(nlon-1)*inc] )
+    for ( i = 1; i < nlon; i++ )
+      if ( xvals[i*inc] < xvals[(i-1)*inc] ) xvals[i*inc] += 360;
+}
+
+static
+int gengrid(int gridID1, int lat1, int lat2, int lon11, int lon12, int lon21, int lon22)
+{
+  int gridtype, gridID2;
+  int nlon1, nlat1;
+  int nlon2, nlat2;
+  int nlon21, nlon22;
+  int i;
+  int prec;
+  int ilat, ilon;
+  int lxvals, lyvals;
+  char xname[CDI_MAX_NAME], xlongname[CDI_MAX_NAME], xunits[CDI_MAX_NAME];
+  char yname[CDI_MAX_NAME], ylongname[CDI_MAX_NAME], yunits[CDI_MAX_NAME];
+  double *xvals1 = NULL, *yvals1 = NULL;
+  double *xvals2 = NULL, *yvals2 = NULL;
+  double *xbounds1 = NULL, *ybounds1 = NULL;
+  double *xbounds2 = NULL, *ybounds2 = NULL;
+  double *pxvals2 = NULL, *pyvals2 = NULL;
+  double *pxbounds2 = NULL, *pybounds2 = NULL;
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  nlon21 = lon12 - lon11 + 1;
+  nlon22 = lon22 - lon21 + 1;
+  nlon2 = nlon21 + nlon22;
+  nlat2 = lat2 - lat1 + 1;
+
+  gridtype = gridInqType(gridID1);
+  prec     = gridInqPrec(gridID1);
+
+  gridID2 = gridCreate(gridtype, nlon2*nlat2);
+  gridDefXsize(gridID2, nlon2);
+  gridDefYsize(gridID2, nlat2);
+
+  gridDefNP(gridID2, gridInqNP(gridID1));
+
+  gridDefPrec(gridID2, prec);
+
+  gridInqXname(gridID1, xname);
+  gridInqXlongname(gridID1, xlongname);
+  gridInqXunits(gridID1, xunits);
+  gridInqYname(gridID1, yname);
+  gridInqYlongname(gridID1, ylongname);
+  gridInqYunits(gridID1, yunits);
+
+  gridDefXname(gridID2, xname);
+  gridDefXlongname(gridID2, xlongname);
+  gridDefXunits(gridID2, xunits);
+  gridDefYname(gridID2, yname);
+  gridDefYlongname(gridID2, ylongname);
+  gridDefYunits(gridID2, yunits);
+
+  if ( gridIsRotated(gridID1) )
+    {
+      gridDefXpole(gridID2, gridInqXpole(gridID1));
+      gridDefYpole(gridID2, gridInqYpole(gridID1));
+    }
+
+  lxvals = gridInqXvals(gridID1, NULL);
+  lyvals = gridInqYvals(gridID1, NULL);
+
+  if ( gridtype == GRID_CURVILINEAR )
+    {
+      if ( lxvals && lyvals )
+	{
+	  xvals1 = (double *) malloc(nlon1*nlat1*sizeof(double));
+	  yvals1 = (double *) malloc(nlon1*nlat1*sizeof(double));
+	  xvals2 = (double *) malloc(nlon2*nlat2*sizeof(double));
+	  yvals2 = (double *) malloc(nlon2*nlat2*sizeof(double));
+	}
+    }
+  else
+    {
+      if ( lxvals ) xvals1 = (double *) malloc(nlon1*sizeof(double));
+      if ( lyvals ) yvals1 = (double *) malloc(nlat1*sizeof(double));
+      if ( lxvals ) xvals2 = (double *) malloc(nlon2*sizeof(double));
+      if ( lyvals ) yvals2 = (double *) malloc(nlat2*sizeof(double));
+    }
+
+  pxvals2 = xvals2;
+  pyvals2 = yvals2;
+
+  if ( xvals1 ) gridInqXvals(gridID1, xvals1);
+  if ( yvals1 ) gridInqYvals(gridID1, yvals1);
+
+  if ( gridtype == GRID_CURVILINEAR )
+    {
+      if ( lxvals && lyvals )
+	for ( ilat = lat1; ilat <= lat2; ilat++ )
+	  {
+	    for ( ilon = lon21; ilon <= lon22; ilon++ )
+	      {
+		*pxvals2++ = xvals1[ilat*nlon1 + ilon];
+		*pyvals2++ = yvals1[ilat*nlon1 + ilon];
+	      }
+	    for ( ilon = lon11; ilon <= lon12; ilon++ )
+	      {
+		*pxvals2++ = xvals1[ilat*nlon1 + ilon];
+		*pyvals2++ = yvals1[ilat*nlon1 + ilon];
+	      }
+	  }
+    }
+  else
+    {
+      if ( lxvals )
+	{
+	  for ( i = lon21; i <= lon22; i++ ) *pxvals2++ = xvals1[i];
+	  for ( i = lon11; i <= lon12; i++ ) *pxvals2++ = xvals1[i];
+	  if ( memcmp(xunits, "degree", 6) == 0 ) correct_xvals(nlon2, 1, xvals2);
+	}
+      
+      if ( lyvals ) for ( i = lat1;  i <= lat2;  i++ ) *pyvals2++ = yvals1[i];
+    }
+  /*
+    for ( i = 0; i < nlat2; i++ ) printf("lat : %d %g\n", i+1, yvals2[i]);
+    for ( i = 0; i < nlon2; i++ ) printf("lon : %d %g\n", i+1, xvals2[i]);
+  */
+  if ( xvals2 ) gridDefXvals(gridID2, xvals2);
+  if ( yvals2 ) gridDefYvals(gridID2, yvals2);
+
+  if ( xvals1 ) free(xvals1);
+  if ( yvals1 ) free(yvals1);
+  if ( xvals2 ) free(xvals2);
+  if ( yvals2 ) free(yvals2);
+
+  if ( gridInqXbounds(gridID1, NULL) && gridInqYbounds(gridID1, NULL) )
+    {
+      if ( gridtype == GRID_CURVILINEAR )
+	{
+	  xbounds1 = (double *) malloc(4*nlon1*nlat1*sizeof(double));
+	  ybounds1 = (double *) malloc(4*nlon1*nlat1*sizeof(double));
+	  xbounds2 = (double *) malloc(4*nlon2*nlat2*sizeof(double));
+	  ybounds2 = (double *) malloc(4*nlon2*nlat2*sizeof(double));
+	}
+      else
+	{
+	  xbounds1 = (double *) malloc(2*nlon1*sizeof(double));
+	  ybounds1 = (double *) malloc(2*nlat1*sizeof(double));
+	  xbounds2 = (double *) malloc(2*nlon2*sizeof(double));
+	  ybounds2 = (double *) malloc(2*nlat2*sizeof(double));
+	}
+
+      pxbounds2 = xbounds2;
+      pybounds2 = ybounds2;
+
+      gridInqXbounds(gridID1, xbounds1);
+      gridInqYbounds(gridID1, ybounds1);
+
+      if ( gridtype == GRID_CURVILINEAR )
+	{
+	  gridDefNvertex(gridID2, 4);
+	  for ( ilat = lat1; ilat <= lat2; ilat++ )
+	    {
+	      for ( ilon = 4*lon21; ilon < 4*(lon22+1); ilon++ )
+		{
+		  *pxbounds2++ = xbounds1[4*ilat*nlon1 + ilon];
+		  *pybounds2++ = ybounds1[4*ilat*nlon1 + ilon];
+		}
+	      for ( ilon = 4*lon11; ilon < 4*(lon12+1); ilon++ )
+		{
+		  *pxbounds2++ = xbounds1[4*ilat*nlon1 + ilon];
+		  *pybounds2++ = ybounds1[4*ilat*nlon1 + ilon];
+		}
+	    }
+	}
+      else
+	{
+	  gridDefNvertex(gridID2, 2);
+	  for ( i = 2*lon21; i < 2*(lon22+1); i++ ) *pxbounds2++ = xbounds1[i];
+	  for ( i = 2*lon11; i < 2*(lon12+1); i++ ) *pxbounds2++ = xbounds1[i];
+	  for ( i = 2*lat1;  i < 2*(lat2+1);  i++ ) *pybounds2++ = ybounds1[i];
+
+	  if ( memcmp(xunits, "degree", 6) == 0 )
+	    {
+	      correct_xvals(nlon2, 2, xbounds2);
+	      correct_xvals(nlon2, 2, xbounds2+1);
+	    }
+	}
+
+      gridDefXbounds(gridID2, xbounds2);
+      gridDefYbounds(gridID2, ybounds2);
+
+      free(xbounds1);
+      free(ybounds1);
+      free(xbounds2);
+      free(ybounds2);
+    }
+
+  return (gridID2);
+}
+
+static
+int gengridcell(int gridID1, int gridsize2, int *cellidx)
+{
+  int gridtype, gridID2;
+  int gridsize1;
+  int i, k, nv;
+  int prec;
+  char xname[CDI_MAX_NAME], xlongname[CDI_MAX_NAME], xunits[CDI_MAX_NAME];
+  char yname[CDI_MAX_NAME], ylongname[CDI_MAX_NAME], yunits[CDI_MAX_NAME];
+  double *xvals1 = NULL, *yvals1 = NULL;
+  double *xvals2 = NULL, *yvals2 = NULL;
+  double *xbounds1 = NULL, *ybounds1 = NULL;
+  double *xbounds2 = NULL, *ybounds2 = NULL;
+
+  gridsize1 = gridInqSize(gridID1);
+
+  /* printf("gridsize1 = %d, gridsize2 = %d\n", gridsize1, gridsize2); */
+
+  gridtype = gridInqType(gridID1);
+  prec     = gridInqPrec(gridID1);
+
+  gridID2 = gridCreate(gridtype, gridsize2);
+
+  gridDefPrec(gridID2, prec);
+
+  gridInqXname(gridID1, xname);
+  gridInqXlongname(gridID1, xlongname);
+  gridInqXunits(gridID1, xunits);
+  gridInqYname(gridID1, yname);
+  gridInqYlongname(gridID1, ylongname);
+  gridInqYunits(gridID1, yunits);
+
+  gridDefXname(gridID2, xname);
+  gridDefXlongname(gridID2, xlongname);
+  gridDefXunits(gridID2, xunits);
+  gridDefYname(gridID2, yname);
+  gridDefYlongname(gridID2, ylongname);
+  gridDefYunits(gridID2, yunits);
+
+  if ( gridInqXvals(gridID1, NULL) && gridInqYvals(gridID1, NULL) )
+    {
+      xvals1 = (double *) malloc(gridsize1*sizeof(double));
+      yvals1 = (double *) malloc(gridsize1*sizeof(double));
+      xvals2 = (double *) malloc(gridsize2*sizeof(double));
+      yvals2 = (double *) malloc(gridsize2*sizeof(double));
+
+      gridInqXvals(gridID1, xvals1);
+      gridInqYvals(gridID1, yvals1);
+
+      for ( i = 0; i < gridsize2; ++i )
+	{
+	  xvals2[i] = xvals1[cellidx[i]];
+	  yvals2[i] = yvals1[cellidx[i]];
+	}
+
+      if ( cdoVerbose )
+	for ( i = 0; i < gridsize2; i++ ) printf("lat/lon : %d %g %g\n", i+1, yvals2[i], xvals2[i]);
+
+      gridDefXvals(gridID2, xvals2);
+      gridDefYvals(gridID2, yvals2);
+
+      free(xvals1);
+      free(yvals1);
+      free(xvals2);
+      free(yvals2);
+    }
+
+  if ( gridInqXbounds(gridID1, NULL) && gridInqYbounds(gridID1, NULL) )
+    {
+      nv = gridInqNvertex(gridID1);
+
+      xbounds1 = (double *) malloc(nv*gridsize1*sizeof(double));
+      ybounds1 = (double *) malloc(nv*gridsize1*sizeof(double));
+      xbounds2 = (double *) malloc(nv*gridsize2*sizeof(double));
+      ybounds2 = (double *) malloc(nv*gridsize2*sizeof(double));
+
+      gridInqXbounds(gridID1, xbounds1);
+      gridInqYbounds(gridID1, ybounds1);
+
+      gridDefNvertex(gridID2, nv);
+
+      for ( i = 0; i < gridsize2; ++i )
+	{
+	  for ( k = 0; k < nv; ++k )
+	    {
+	      xbounds2[i*nv+k] = xbounds1[cellidx[i]*nv+k];
+	      ybounds2[i*nv+k] = ybounds1[cellidx[i]*nv+k];
+	    }
+	}
+
+      gridDefXbounds(gridID2, xbounds2);
+      gridDefYbounds(gridID2, ybounds2);
+
+      free(xbounds1);
+      free(ybounds1);
+      free(xbounds2);
+      free(ybounds2);
+    }
+
+  return (gridID2);
+}
+
+
+void genlonlatbox(double xlon1, double xlon2, double xlat1, double xlat2,
+		  int nlon1, int nlat1, double *xvals1, double *yvals1,
+		  int *lat1, int *lat2, int *lon11, int *lon12, int *lon21, int *lon22)
+{
+  if ( IS_NOT_EQUAL(xlon1, xlon2) )
+    {
+      xlon2 -= 360 * floor ((xlon2 - xlon1) / 360);
+      if ( IS_EQUAL(xlon1, xlon2) ) xlon2 += 360;
+    }
+  else
+    {
+      xlon2 += 0.00001;
+    }
+
+  xlon2 -= 360 * floor ((xlon1 - xvals1[0]) / 360);
+  xlon1 -= 360 * floor ((xlon1 - xvals1[0]) / 360);
+
+  // while ( nlon1 == 1 || (xvals1[nlon1-1] - xvals1[0]) >= 360 ) nlon1--;
+
+  for ( *lon21 = 0; *lon21 < nlon1 && xvals1[*lon21] < xlon1; (*lon21)++ );
+  for ( *lon22 = *lon21; *lon22 < nlon1 && xvals1[*lon22] < xlon2; (*lon22)++ );
+
+  if ( *lon22 >= nlon1 || xvals1[*lon22] > xlon2 ) (*lon22)--;
+
+  xlon1 -= 360;
+  xlon2 -= 360;
+
+  for ( *lon11 = 0; xvals1[*lon11] < xlon1; (*lon11)++ );
+  for ( *lon12 = *lon11; *lon12 < nlon1 && xvals1[*lon12] < xlon2; (*lon12)++ );
+  
+  // (*lon12)--;
+  if ( *lon12 >= nlon1 || xvals1[*lon12] > xlon2 ) (*lon12)--;
+  if ( *lon12 >= 0 )
+    if ( IS_EQUAL(xvals1[*lon12], xvals1[*lon21]) ) (*lon12)--;
+
+  if ( *lon12 - *lon11 + 1 + *lon22 - *lon21 + 1 <= 0 )
+    cdoAbort("Longitudinal dimension is too small!");
+  
+  if ( yvals1[0] > yvals1[nlat1 - 1] )
+    {
+      if ( xlat1 > xlat2 )
+	{
+	  for ( *lat1 = 0; *lat1 < nlat1 && yvals1[*lat1] > xlat1; (*lat1)++ );
+	  for ( *lat2 = nlat1 - 1; *lat2 && yvals1[*lat2] < xlat2; (*lat2)-- );
+	}
+      else
+	{
+	  for ( *lat1 = 0; *lat1 < nlat1 && yvals1[*lat1] > xlat2; (*lat1)++ );
+	  for ( *lat2 = nlat1 - 1; *lat2 && yvals1[*lat2] < xlat1; (*lat2)-- );
+	}
+    }
+  else
+    {
+      if ( xlat1 < xlat2 )
+	{
+	  for ( *lat1 = 0; *lat1 < nlat1 && yvals1[*lat1] < xlat1; (*lat1)++ );
+	  for ( *lat2 = nlat1 - 1; *lat2 && yvals1[*lat2] > xlat2; (*lat2)-- );
+	}
+      else
+	{
+	  for ( *lat1 = 0; *lat1 < nlat1 && yvals1[*lat1] < xlat2; (*lat1)++ );
+	  for ( *lat2 = nlat1 - 1; *lat2 && yvals1[*lat2] > xlat1; (*lat2)-- );
+	}
+    }
+  
+  if ( *lat2 - *lat1 + 1 <= 0 )
+    cdoAbort("Latitudinal dimension is too small!");
+}
+
+static
+int genlonlatgrid(int gridID1, int *lat1, int *lat2, int *lon11, int *lon12, int *lon21, int *lon22)
+{
+  int ilon, ilat;
+  int nlon1, nlat1;
+  int gridtype, gridID2;
+  double *xvals1, *yvals1;
+  double xlon1, xlon2, xlat1, xlat2;
+  int grid_is_circular;
+  char xunits[CDI_MAX_NAME];
+  char yunits[CDI_MAX_NAME];
+  double xfact = 1, yfact = 1;
+
+  operatorCheckArgc(4);
+
+  xlon1 = atof(operatorArgv()[0]);
+  xlon2 = atof(operatorArgv()[1]);
+  xlat1 = atof(operatorArgv()[2]);
+  xlat2 = atof(operatorArgv()[3]);
+
+  gridtype = gridInqType(gridID1);
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  grid_is_circular = gridIsCircular(gridID1);
+
+  if ( gridtype == GRID_CURVILINEAR )
+    {
+      xvals1 = (double *) malloc(nlon1*nlat1*sizeof(double));
+      yvals1 = (double *) malloc(nlon1*nlat1*sizeof(double));
+    }
+  else
+    {
+      xvals1 = (double *) malloc(nlon1*sizeof(double));
+      yvals1 = (double *) malloc(nlat1*sizeof(double));
+    }
+
+  gridInqXvals(gridID1, xvals1);
+  gridInqYvals(gridID1, yvals1);
+
+  gridInqXunits(gridID1, xunits);
+  gridInqYunits(gridID1, yunits);
+
+  if ( memcmp(xunits, "radian", 6) == 0 ) xfact = RAD2DEG;
+  if ( memcmp(yunits, "radian", 6) == 0 ) yfact = RAD2DEG;
+
+  if ( gridtype == GRID_CURVILINEAR )
+    {
+      double xval, yval, xlast, ylast;
+      int ixmin, ixmax, iymin, iymax;
+      int lp2 = FALSE;
+
+      if ( xlon1 > xlon2 ) 
+	cdoAbort("The second longitude have to be greater than the first one!");
+
+      if ( xlat1 > xlat2 )
+	{
+	  double xtemp = xlat1;
+	  xlat1 = xlat2;
+	  xlat2 = xtemp;
+	}
+	  
+      *lat1 = nlat1-1;
+      *lat2 = 0;
+      *lon11 = 0;
+      *lon12 = -1;
+      *lon21 = nlon1-1;
+      *lon22 = 0;
+
+      ixmin = nlon1-1;
+      ixmax = 0;
+      iymin = nlat1-1;
+      iymax = 0;
+
+      for ( ilat = 0; ilat < nlat1; ilat++ )
+	{
+	  xlast = xfact * xvals1[ilat*nlon1 + nlon1-1];
+	  ylast = yfact * yvals1[ilat*nlon1 + nlon1-1];
+	  if ( ylast >= xlat1 && ylast <= xlat2 )
+	    if ( grid_is_circular && xlon1 <= xlast && xlon2 > xlast && (xlon2-xlon1) < 360)
+	      {
+		*lon11 = nlon1-1;
+		*lon12 = 0;
+		lp2 = TRUE;
+	      }
+	}
+
+      for ( ilat = 0; ilat < nlat1; ilat++ )
+	{
+	  xlast = xfact * xvals1[ilat*nlon1 + nlon1-1];
+
+	  for ( ilon = 0; ilon < nlon1; ilon++ )
+	    {
+	      xval = xvals1[ilat*nlon1 + ilon];
+	      yval = yvals1[ilat*nlon1 + ilon];
+
+	      xval *= xfact;
+	      yval *= yfact;
+
+
+	      if ( yval >= xlat1 && yval <= xlat2 )
+		{
+		  if ( lp2 )
+		    {
+		      if ( xval >= xlon1 && xval <= xlast )
+			{
+			  if ( ilon < *lon21 ) *lon21 = ilon;
+			  if ( ilon > *lon22 ) *lon22 = ilon;
+			  if ( ilat < *lat1 ) *lat1 = ilat;
+			  if ( ilat > *lat2 ) *lat2 = ilat;
+			}
+		      else if ( xval > xlast && xval <= xlon2 )
+			{
+			  if ( ilon < *lon11 ) *lon11 = ilon;
+			  if ( ilon > *lon12 ) *lon12 = ilon;
+			  if ( ilat < *lat1 ) *lat1 = ilat;
+			  if ( ilat > *lat2 ) *lat2 = ilat;
+			}
+		    }
+		  else
+		    {
+		      if ( ((xval >= xlon1 && xval <= xlon2) ||
+			    (xval-360 >= xlon1 && xval-360 <= xlon2) ||
+			    (xval+360 >= xlon1 && xval+360 <= xlon2)) )
+			{
+			  if ( ilon < ixmin ) ixmin = ilon;
+			  if ( ilon > ixmax ) ixmax = ilon;
+			  if ( ilat < iymin ) iymin = ilat;
+			  if ( ilat > iymax ) iymax = ilat;
+			}
+		    }
+		}
+	    }
+	}
+
+      if ( ! lp2 )
+	{
+	  *lat1 = iymin;
+	  *lat2 = iymax;
+	  *lon21 = ixmin;
+	  *lon22 = ixmax;
+	}      
+
+      if ( *lat2 - *lat1 + 1 <= 0 )
+	cdoAbort("Latitudinal dimension is too small!");
+    }
+  else
+    {
+      for ( ilat = 0; ilat < nlat1; ilat++ ) yvals1[ilat] *= yfact;
+      for ( ilon = 0; ilon < nlon1; ilon++ ) xvals1[ilon] *= xfact;
+
+      genlonlatbox(xlon1, xlon2, xlat1, xlat2,
+		   nlon1, nlat1, xvals1, yvals1,
+		   lat1, lat2, lon11, lon12, lon21, lon22);
+    }
+
+  free(xvals1);
+  free(yvals1);
+
+  gridID2 = gengrid(gridID1, *lat1, *lat2, *lon11, *lon12, *lon21, *lon22);
+
+  return (gridID2);
+}
+
+static
+int gencellgrid(int gridID1, int *gridsize2, int **cellidx)
+{
+  int gridtype, gridID2;
+  double *xvals1, *yvals1;
+  double xlon1, xlon2, xlat1, xlat2, x, xval, yval;
+  int i, gridsize1;
+  int nvals = 0;
+  int maxcell = 0;
+  int cellinc = 4096;
+  char xunits[CDI_MAX_NAME];
+  char yunits[CDI_MAX_NAME];
+  double xfact, yfact;
+
+  operatorCheckArgc(4);
+
+  xlon1 = atof(operatorArgv()[0]);
+  xlon2 = atof(operatorArgv()[1]);
+  xlat1 = atof(operatorArgv()[2]);
+  xlat2 = atof(operatorArgv()[3]);
+
+  if ( xlon1 >= xlon2 ) { x = xlon1; xlon1 = xlon2; xlon2 = x; }
+  if ( xlat1 >= xlat2 ) { x = xlat1; xlat1 = xlat2; xlat2 = x; }
+
+  gridtype = gridInqType(gridID1);
+
+  gridsize1 = gridInqSize(gridID1);
+
+  if ( gridtype != GRID_UNSTRUCTURED ) cdoAbort("Internal problem, wrong grid type!");
+
+  xvals1 = (double *) malloc(gridsize1*sizeof(double));
+  yvals1 = (double *) malloc(gridsize1*sizeof(double));
+
+  gridInqXvals(gridID1, xvals1);
+  gridInqYvals(gridID1, yvals1);
+
+  gridInqXunits(gridID1, xunits);
+  gridInqYunits(gridID1, yunits);
+
+  if ( memcmp(xunits, "radian", 6) == 0 )
+    xfact = RAD2DEG;
+  else
+    xfact = 1;
+
+  if ( memcmp(yunits, "radian", 6) == 0 )
+    yfact = RAD2DEG;
+  else
+    yfact = 1;
+
+  /* find gridsize2 */
+  *cellidx = NULL;
+  for ( i = 0; i < gridsize1; ++i )
+    {
+      xval = xvals1[i]*xfact;
+      yval = yvals1[i]*yfact;
+      if ( yval >= xlat1 && yval <= xlat2 )
+	if ( (xval >= xlon1 && xval <= xlon2) ||
+	     (xval+360 >= xlon1 && xval+360 <= xlon2) ||
+	     (xval-360 >= xlon1 && xval-360 <= xlon2)  )
+	  {
+	    nvals++;
+	    if ( nvals > maxcell )
+	      {
+		maxcell += cellinc;
+		*cellidx = (int *) realloc(*cellidx, maxcell*sizeof(int));
+	      }
+	    (*cellidx)[nvals-1] = i;
+	  }
+    }
+
+  if ( nvals == 0 ) cdoAbort("No grid points found!");
+
+  *gridsize2 = nvals;
+
+  free(xvals1);
+  free(yvals1);
+
+  gridID2 = gengridcell(gridID1, *gridsize2, *cellidx);
+
+  return (gridID2);
+}
+
+static
+int genindexgrid(int gridID1, int *lat1, int *lat2, int *lon11, int *lon12, int *lon21, int *lon22)
+{
+  int gridID2;
+  int nlon1, nlat1;
+  int temp;
+
+  operatorCheckArgc(4);
+
+  *lon11 = atoi(operatorArgv()[0]);
+  *lon12 = atoi(operatorArgv()[1]);
+  *lat1  = atoi(operatorArgv()[2]);
+  *lat2  = atoi(operatorArgv()[3]);
+
+  if ( *lat1 > *lat2 )
+    {
+      temp = *lat1;
+      *lat1 = *lat2;
+      *lat2 = temp;
+    }
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  if ( *lat1 < 1 )
+    {
+      cdoWarning("First latitude index out of range, set to 1!");
+      *lat1 = 1;
+    }
+  if ( *lat2 > nlat1 )
+    {
+      cdoWarning("First latitude index out of range, set to %d!", nlat1);
+      *lat1 = nlat1;
+    }
+  if ( *lat2 < 1 )
+    {
+      cdoWarning("First latitude index out of range, set to 1!");
+      *lat2 = 1;
+    }
+  if ( *lat2 > nlat1 )
+    {
+      cdoWarning("Last latitude index out of range, set to %d!", nlat1);
+      *lat2 = nlat1;
+    }
+  if ( *lon11 < 1 )
+    {
+      cdoWarning("First longitude index out of range, set to 1!");
+      *lon11 = 1;
+    }
+  if ( *lon12 > nlon1+1 )
+    {
+      cdoWarning("Last longitude index out of range, set to %d!", nlon1);
+      *lon12 = nlon1;
+    }
+
+  (*lon11)--;
+  (*lon12)--;
+  (*lat1)--;
+  (*lat2)--;
+
+  if ( *lon11 > *lon12 )
+    {
+      *lon21 = *lon11;
+      *lon22 = nlon1 - 1;
+      *lon11 = 0;
+    }
+  else
+    {
+      if ( *lon12 > nlon1-1 )
+	{
+	  *lon21 = *lon11;
+	  *lon22 = nlon1 - 1;
+	  *lon11 = 0;
+	  *lon12 = 0;
+	}
+      else
+	{
+	  *lon21 = 0;
+	  *lon22 = -1;
+	}
+    }
+
+  gridID2 = gengrid(gridID1, *lat1, *lat2, *lon11, *lon12, *lon21, *lon22);
+
+  return (gridID2);
+}
+
+static
+void window(int nwpv, double *array1, int gridID1, double *array2,
+	    long lat1, long lat2, long lon11, long lon12, long lon21, long lon22)
+{
+  long nlon1;
+  long ilat, ilon;
+
+  nlon1 = gridInqXsize(gridID1);
+
+  if ( nwpv == 2 )
+    {
+      for ( ilat = lat1; ilat <= lat2; ilat++ )
+	{
+	  for ( ilon = lon21; ilon <= lon22; ilon++ )
+	    {
+	      *array2++ = array1[ilat*nlon1*2 + ilon*2];
+	      *array2++ = array1[ilat*nlon1*2 + ilon*2+1];
+	    }
+	  for ( ilon = lon11; ilon <= lon12; ilon++ )
+	    {
+	      *array2++ = array1[ilat*nlon1*2 + ilon*2];
+	      *array2++ = array1[ilat*nlon1*2 + ilon*2+1];
+	    }
+	}
+    }
+  else
+    {
+      for ( ilat = lat1; ilat <= lat2; ilat++ )
+	{
+	  for ( ilon = lon21; ilon <= lon22; ilon++ )
+	    *array2++ = array1[ilat*nlon1 + ilon];
+	  for ( ilon = lon11; ilon <= lon12; ilon++ )
+	    *array2++ = array1[ilat*nlon1 + ilon];
+	}
+    }
+}
+
+static
+void window_cell(int nwpv, double *array1, int gridID1, double *array2, long gridsize2, int *cellidx)
+{
+  long i;
+
+  if ( nwpv == 2 )
+    {
+      for ( i = 0; i < gridsize2; ++i )
+	{
+	  array2[i*2]   = array1[cellidx[i]*2];
+	  array2[i*2+1] = array1[cellidx[i]*2+1];
+	}
+    }
+  else
+    {
+      for ( i = 0; i < gridsize2; ++i )
+	array2[i] = array1[cellidx[i]];
+    }
+}
+
+
+void *Selbox(void *argument)
+{
+  int SELLONLATBOX, SELINDEXBOX;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs, nvars;
+  int tsID, recID, varID, levelID;
+  int gridsize, gridsize2;
+  int vlistID1, vlistID2;
+  int gridID1 = -1, gridID2;
+  int index, ngrids, gridtype = -1;
+  int nmiss;
+  int *vars = NULL;
+  int i;
+  int nwpv; // number of words per value; real:1  complex:2
+  double missval;
+  double *array1 = NULL, *array2 = NULL;
+  int taxisID1, taxisID2;
+  typedef struct {
+    int gridID1, gridID2;
+    int *cellidx, nvals;
+    int lat1, lat2, lon11, lon12, lon21, lon22; 
+  } sbox_t;
+  sbox_t *sbox = NULL;
+
+  cdoInitialize(argument);
+
+  SELLONLATBOX = cdoOperatorAdd("sellonlatbox", 0, 0, "western and eastern longitude and southern and northern latitude");
+  SELINDEXBOX  = cdoOperatorAdd("selindexbox",  0, 0, "index of first and last longitude and index of first and last latitude");
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nvars = vlistNvars(vlistID1);
+  vars  = (int *) malloc(nvars*sizeof(int));
+  for ( varID = 0; varID < nvars; varID++ ) vars[varID] = FALSE;
+
+  ngrids = vlistNgrids(vlistID1);
+  sbox = (sbox_t *) malloc(ngrids*sizeof(sbox_t));
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID1  = vlistGrid(vlistID1, index);
+      gridtype = gridInqType(gridID1);
+
+      if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN || gridtype == GRID_CURVILINEAR ||
+	   (operatorID == SELINDEXBOX && (gridtype == GRID_GENERIC || gridtype == GRID_SINUSOIDAL) && 
+	    gridInqXsize(gridID1) > 0 && gridInqYsize(gridID1) > 0) ||
+	   (operatorID == SELLONLATBOX && gridtype == GRID_UNSTRUCTURED) )
+	{
+	  if ( operatorID == SELLONLATBOX )
+	    {
+	      if ( gridtype == GRID_UNSTRUCTURED )
+		gridID2 = gencellgrid(gridID1, &sbox[index].nvals, &sbox[index].cellidx);
+	      else
+		gridID2 = genlonlatgrid(gridID1, &sbox[index].lat1, &sbox[index].lat2, &sbox[index].lon11, 
+					&sbox[index].lon12, &sbox[index].lon21, &sbox[index].lon22);
+	    }
+	  else
+	    gridID2 = genindexgrid(gridID1, &sbox[index].lat1, &sbox[index].lat2, &sbox[index].lon11, 
+				   &sbox[index].lon12, &sbox[index].lon21, &sbox[index].lon22);
+	  
+	  sbox[index].gridID1 = gridID1;
+	  sbox[index].gridID2 = gridID2;
+
+	  vlistChangeGridIndex(vlistID2, index, gridID2);
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    if ( gridID1 == vlistInqVarGrid(vlistID1, varID) )
+	      vars[varID] = TRUE;
+	}
+      else if ( gridtype == GRID_GENERIC && gridInqXsize(gridID1) == 0 && gridInqYsize(gridID1) == 0 )
+	{
+	}
+      else
+	{
+	  cdoPrint("Unsupported grid type: %s", gridNamePtr(gridtype));
+	  if ( gridtype == GRID_GAUSSIAN_REDUCED )
+	    cdoPrint("Use option -R to convert Gaussian reduced grid to a regular grid!");
+	  cdoAbort("Unsupported grid type!");
+	}
+    }
+
+  if ( cdoVerbose )
+    {
+      if ( gridtype != GRID_UNSTRUCTURED )
+	{
+	  cdoPrint("box1 - idx1,idx2,idy1,idy2: %d,%d,%d,%d",
+		   sbox[0].lon21+1, sbox[0].lon22+1, sbox[0].lat1+1, sbox[0].lat2+1);
+	  cdoPrint("box2 - idx1,idx2,idy1,idy2: %d,%d,%d,%d",
+		   sbox[0].lon11+1, sbox[0].lon12+1, sbox[0].lat1+1, sbox[0].lat2+1);
+	}
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+  array1 = (double *) malloc(gridsize*sizeof(double));
+
+  gridsize2 = vlistGridsizeMax(vlistID2);
+  if ( vlistNumber(vlistID2) != CDI_REAL ) gridsize2 *= 2;
+  array2 = (double *) malloc(gridsize2*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  streamDefRecord(streamID2, varID, levelID);
+
+	  if ( vars[varID] )
+	    {
+	      if ( vlistInqVarDatatype(vlistID1, varID) == DATATYPE_CPX32 || 
+		   vlistInqVarDatatype(vlistID1, varID) == DATATYPE_CPX64 )
+		nwpv = 2;
+	      else
+		nwpv = 1;
+	      
+	      gridID1 = vlistInqVarGrid(vlistID1, varID);
+
+	      for ( index = 0; index < ngrids; index++ )
+		if ( gridID1 == sbox[index].gridID1 ) break;
+
+	      if ( index == ngrids ) cdoAbort("Internal problem, grid not found!");
+
+	      gridsize2 = gridInqSize(sbox[index].gridID2);
+
+	      if ( operatorID == SELLONLATBOX  && gridtype == GRID_UNSTRUCTURED )
+		window_cell(nwpv, array1, gridID1, array2, gridsize2, sbox[index].cellidx);
+ 	      else
+		window(nwpv, array1, gridID1, array2, sbox[index].lat1, sbox[index].lat2, sbox[index].lon11, 
+		       sbox[index].lon12, sbox[index].lon21, sbox[index].lon22);
+
+	      if ( nmiss )
+		{
+		  nmiss = 0;
+		  missval = vlistInqVarMissval(vlistID2, varID);
+		  for ( i = 0; i < gridsize2; i++ )
+		    if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
+		}
+
+	      streamWriteRecord(streamID2, array2, nmiss);
+	    }
+	  else
+	    {
+	      streamWriteRecord(streamID2, array1, nmiss);
+	    }
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID2);
+
+  if ( vars   ) free(vars);
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  if ( sbox )
+    {
+      if ( operatorID == SELLONLATBOX  && gridtype == GRID_UNSTRUCTURED )
+	{
+	  for ( index = 0; index < ngrids; index++ )
+	    if ( sbox[index].cellidx ) free(sbox[index].cellidx);
+	}
+      free(sbox);
+    }
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Select.c b/src/Select.c
new file mode 100644
index 0000000..fa04017
--- /dev/null
+++ b/src/Select.c
@@ -0,0 +1,845 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Select      select         Select fields
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "error.h"
+#include "util.h"
+#include "list.h"
+#include "namelist.h"
+
+
+#define  PML_INT         1
+#define  PML_FLT         2
+#define  PML_WORD        3
+#define  PML_DATE        4
+#define  PML_TIME        4
+
+/*
+typedef struct {
+  char *name;
+  int maxpar;
+  int numpar;
+  char *par;
+}
+PARAMETER;
+
+static PARAMETER Parameter[] =
+{
+  {"code", 1024, 0, NULL},
+};
+
+static int NumParameter = sizeof(Parameter) / sizeof(Parameter[0]);
+*/
+
+#define PML_DEF(name, size, txt)      int flag_##name[size]; int npar_##name = 0; int max_##name = size; const char str_##name[] = txt
+#define PML_DEF_INT(name, size, txt)  int par_##name[size]; int name = 0; PML_DEF(name, size, txt)
+#define PML_DEF_FLT(name, size, txt)  double par_##name[size]; double name = 0; PML_DEF(name, size, txt)
+#define PML_DEF_WORD(name, size, txt) char *par_##name[size]; char *name = 0; PML_DEF(name, size, txt)
+#define PML_INIT_INT(name)            memset(flag_##name, 0, max_##name * sizeof(int))
+#define PML_INIT_FLT(name)            memset(flag_##name, 0, max_##name * sizeof(int))
+#define PML_INIT_WORD(name)           memset(flag_##name, 0, max_##name * sizeof(int))
+#define PML_ADD_INT(nml, name)        pmlAdd(nml, #name, PML_INT,  0, par_##name, sizeof(par_##name)/sizeof(int))
+#define PML_ADD_FLT(nml, name)        pmlAdd(nml, #name, PML_FLT,  0, par_##name, sizeof(par_##name)/sizeof(double))
+#define PML_ADD_WORD(nml, name)       pmlAdd(nml, #name, PML_WORD, 0, par_##name, sizeof(par_##name)/sizeof(char *))
+#define PML_NUM(nml, name)            npar_##name = pmlNum(nml, #name)
+#define PML_PAR(name)                 npar_##name, par_##name, name
+
+#define PAR_CHECK_INT_FLAG(name)      par_check_int_flag(npar_##name, par_##name, flag_##name, str_##name)
+#define PAR_CHECK_FLT_FLAG(name)      par_check_flt_flag(npar_##name, par_##name, flag_##name, str_##name)
+#define PAR_CHECK_WORD_FLAG(name)     par_check_word_flag(npar_##name, par_##name, flag_##name, str_##name)
+#define PAR_CHECK_INT(name)           par_check_int(npar_##name, par_##name, flag_##name, name)
+#define PAR_CHECK_FLT(name)           par_check_flt(npar_##name, par_##name, flag_##name, name)
+#define PAR_CHECK_WORD(name)          par_check_word(npar_##name, par_##name, flag_##name, name)
+
+#define MAX_PLIST_ENTRY  256
+#define MAX_PML_ENTRY    256
+
+typedef struct
+{
+  char *text;
+  size_t len;
+  void *ptr;
+  int type;
+  int occ;
+  int dis;
+  size_t size;
+} plist_entry_t;
+
+
+typedef struct
+{
+  int size;
+  plist_entry_t *entry[MAX_PLIST_ENTRY];
+} plist_t;
+
+
+typedef struct
+{
+  char *name;
+  size_t len;
+  void *ptr;
+  int type;
+  int occ;
+  int dis;
+  size_t size;
+} pml_entry_t;
+
+
+typedef struct
+{
+  int size;
+  int dis;
+  char *name;
+  /* PML_LINE line; */
+  pml_entry_t *entry[MAX_PML_ENTRY];
+} pml_t;
+
+
+static
+void pml_init(pml_t *pml, const char *name)
+{
+  pml->size = 0;
+  pml->dis  = 1;
+  pml->name = strdup(name);
+}
+
+
+pml_t *pmlNew(const char *name)
+{
+  pml_t *pml;
+
+  pml = (pml_t *) malloc(sizeof(pml_t));
+
+  pml_init(pml, name);
+
+  return (pml);
+}
+
+
+void pmlPrint(pml_t *pml)
+{
+  pml_entry_t *entry;
+  int i, j, nout;
+
+  if ( pml == NULL ) return;
+
+  fprintf(stdout, "Parameter list: %s\n", pml->name);
+  fprintf(stdout, " Num  Name             Type  Size   Dis   Occ  Entries\n");
+
+  for ( i = 0; i < pml->size; ++i )
+    {
+      entry = pml->entry[i];
+      fprintf(stdout, "%4d  %-16s %4d  %4d  %4d  %4d ",
+	      i+1, pml->entry[i]->name, pml->entry[i]->type, (int)pml->entry[i]->size,
+	      pml->entry[i]->dis, pml->entry[i]->occ);
+      nout = pml->entry[i]->occ;
+      if ( nout > 8 ) nout = 8;
+
+      if      ( entry->type == PML_WORD )
+	for ( j = 0; j < nout; j++ )
+	  fprintf(stdout, " %s", ((char **)entry->ptr)[j]);
+      else if ( entry->type == PML_INT )
+	for ( j = 0; j < nout; j++ )
+	  fprintf(stdout, " %d", ((int *)entry->ptr)[j]);
+      else if ( entry->type == PML_FLT )
+	for ( j = 0; j < nout; j++ )
+	  fprintf(stdout, " %g", ((double *)entry->ptr)[j]);
+      
+      fprintf(stdout, "\n");
+    }
+}
+
+
+int pmlAdd(pml_t *pml, const char *name, int type, int dis, void *ptr, size_t size)
+{
+  pml_entry_t *pml_entry;
+  int entry = 0;
+
+  if ( pml->size >= MAX_PML_ENTRY )
+    {
+      fprintf(stderr, "Too many entries in parameter list %s! (Max = %d)\n", pml->name, MAX_PML_ENTRY);
+      return (-1);
+    }
+
+  pml_entry = (pml_entry_t *) malloc(sizeof(pml_entry_t));
+
+  pml_entry->name = strdup(name);
+  pml_entry->len  = strlen(name);
+  pml_entry->type = type;
+  pml_entry->ptr  = ptr;
+  pml_entry->size = size;
+  pml_entry->dis  = dis;
+  pml_entry->occ  = 0;
+
+  entry = pml->size;
+  pml->entry[pml->size++] = pml_entry;
+
+  return (entry);
+}
+
+
+int pmlNum(pml_t *pml, const char *name)
+{
+  pml_entry_t *entry;
+  int i, nocc = 0;
+
+  if ( pml == NULL ) return (nocc);
+
+  for ( i = 0; i < pml->size; i++ )
+    {
+      entry = pml->entry[i];
+      if ( strcmp(name, entry->name) == 0 )
+	{
+	  nocc = entry->occ;
+	  break;
+	}
+    }
+
+  if ( i == pml->size )
+    fprintf(stderr, "Parameter list entry %s not found in %s\n", name, pml->name);
+
+  return (nocc);
+}
+
+
+int pml_add_entry(pml_entry_t *entry, char *arg)
+{
+  int status = 0;
+
+  if ( entry->type == PML_INT )
+    {
+      if ( entry->occ < (int) entry->size )
+	((int *) entry->ptr)[entry->occ++] = atoi(arg);
+    }
+  else if ( entry->type == PML_FLT )
+    {
+      if ( entry->occ < (int) entry->size )
+	((double *) entry->ptr)[entry->occ++] = atof(arg);
+    }
+  else if ( entry->type == PML_WORD )
+    {
+      if ( entry->occ < (int) entry->size )
+	((char **) entry->ptr)[entry->occ++] = strdupx(arg);
+    }
+  else
+    {
+      fprintf(stderr, "unsupported type!\n");
+    }
+
+  return (status);
+}
+
+
+void pmlProcess(pml_entry_t *entry, int argc, char **argv)
+{
+  int i;
+  int len;
+  char *parg;
+  char *epos;
+
+  for ( i = 0; i < argc; ++i )
+    {
+      parg = argv[i];
+      if ( i == 0 )
+	{
+	  epos = strchr(parg, '=');
+	  if ( epos == NULL )
+	    {
+	      fprintf(stderr, "internal problem, keyword not found!\n");
+	    }
+	  parg += epos-parg+1;
+	}
+
+      pml_add_entry(entry, parg);
+    }
+}
+
+
+int pmlRead(pml_t *pml, int argc, char **argv)
+{
+  pml_entry_t *entry = NULL;
+  pml_entry_t *pentry[MAX_PML_ENTRY];
+  int params[MAX_PML_ENTRY];
+  int num_par[MAX_PML_ENTRY];
+  int nparams = 0;
+  int i, istart;
+  char *epos;
+  size_t len;
+  char *parbuf;
+  int bufsize = 0;
+  int status = 0;
+  /*
+  if ( cdoVerbose )
+    for ( i = 0; i < argc; ++i ) printf("pmlRead: %d %s\n", i, argv[i]);
+  */
+  for ( i = 0; i < argc; ++i )
+    {
+      len = strlen(argv[i]);
+      bufsize += len+1;
+    }
+
+  parbuf = (char *) malloc(bufsize*sizeof(char));
+  memset(parbuf, 0, bufsize*sizeof(char));
+
+  istart = 0;
+  while ( istart < argc )
+    {
+      epos = strchr(argv[istart], '=');
+      if ( epos == NULL )
+	{
+	  fprintf(stderr, "Parameter >%s< has no keyword!\n", argv[istart]);
+	  status = 1;
+	  goto END_LABEL;
+	}
+
+      len = epos - argv[istart];
+      for ( i = 0; i < pml->size; ++i )
+	{
+	  entry = pml->entry[i];
+	  if ( entry->len == len )
+	    if ( memcmp(entry->name, argv[istart], len) == 0 ) break;
+	}
+
+      if ( i == pml->size )
+	{
+	  fprintf(stderr, "Parameter >%s< has not a valid keyword!\n", argv[istart]);
+	  status = 2;
+	  goto END_LABEL;
+	}
+
+      num_par[nparams] = 0;
+      pentry[nparams]  = entry;
+      params[nparams]  = istart;
+      num_par[nparams] = 1;
+      
+      istart++;
+      for ( i = istart; i < argc; ++i )
+	{
+	  if ( *argv[i] == 0 ) { i++; break;}
+	  epos = strchr(argv[i], '=');
+	  if ( epos != NULL ) break;
+
+	  num_par[nparams]++;
+	}
+
+      istart = i;
+
+      nparams++;
+    }
+
+  for ( i = 0; i < nparams; ++i )
+    {
+      pmlProcess(pentry[i], num_par[i], &argv[params[i]]);
+    }
+
+
+ END_LABEL:
+
+  free(parbuf);
+
+  return (status);
+}
+
+
+int par_check_int(int npar, int *parlist, int *flaglist, int par)
+{
+  int i, found;
+
+  found = 0;
+  for ( i = 0; i < npar; i++ )
+    if ( par == parlist[i] ) { found = 1; flaglist[i] = TRUE;/* break;*/}
+
+  return (found);
+}
+
+
+int par_check_flt(int npar, double *parlist, int *flaglist, double par)
+{
+  int i, found;
+
+  found = 0;
+  for ( i = 0; i < npar; i++ )
+    if ( fabs(par - parlist[i]) < 1.e-4 ) { found = 1; flaglist[i] = TRUE;/* break;*/}
+
+  return (found);
+}
+
+
+int par_check_word(int npar, char **parlist, int *flaglist, char *par)
+{
+  int i, found;
+
+  found = 0;
+  for ( i = 0; i < npar; i++ )
+    if ( strcmp(par, parlist[i]) == 0 ) { found = 1; flaglist[i] = TRUE;/* break;*/}
+
+  return (found);
+}
+
+
+void par_check_int_flag(int npar, int *parlist, int *flaglist, const char *txt)
+{
+  int i;
+
+  for ( i = 0; i < npar; ++i )
+    if ( flaglist[i] == FALSE )
+      cdoWarning("%s >%d< not found!", txt, parlist[i]);
+}
+
+
+void par_check_flt_flag(int npar, double *parlist, int *flaglist, const char *txt)
+{
+  int i;
+
+  for ( i = 0; i < npar; ++i )
+    if ( flaglist[i] == FALSE )
+      cdoWarning("%s >%g< not found!", txt, parlist[i]);
+}
+
+
+void par_check_word_flag(int npar, char **parlist, int *flaglist, const char *txt)
+{
+  int i;
+
+  for ( i = 0; i < npar; ++i )
+    if ( flaglist[i] == FALSE )
+      cdoWarning("%s >%s< not found!", txt, parlist[i]);
+}
+
+
+void *Select(void *argument)
+{
+  int SELECT, DELETE;
+  int operatorID;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int tsID1, tsID2, nrecs;
+  int nvars, nlevs;
+  int zaxisID, levID;
+  int varID2, levelID2;
+  int recID, varID, levelID;
+  int iparam;
+  int nsel;
+  int vdate, vtime;
+  int copytimestep;
+  char paramstr[32];
+  char varname[CDI_MAX_NAME];
+  char stdname[CDI_MAX_NAME];
+  char **argnames = NULL;
+  int vlistID0 = -1, vlistID1 = -1, vlistID2 = -1;
+  int i;
+  int result = FALSE;
+  int lcopy = FALSE;
+  int gridsize;
+  int nmiss;
+  int streamCnt, nfiles, indf;
+  double *array = NULL;
+  int taxisID1, taxisID2 = CDI_UNDEFID;
+  int ntsteps;
+  int ltimsel = FALSE;
+  int npar;
+  int *vars = NULL;
+  pml_t *pml;
+  PML_DEF_INT(timestep, 4096, "Timestep");
+  PML_DEF_INT(year,     1024, "Year");
+  PML_DEF_INT(month,      32, "Month");
+  PML_DEF_INT(day,        32, "Day");
+  PML_DEF_INT(code,     1024, "Code number");
+  PML_DEF_INT(ltype,    1024, "Level type");
+  PML_DEF_INT(levidx,   1024, "Level index");
+  PML_DEF_FLT(level,    1024, "Level");
+  PML_DEF_WORD(name,    1024, "Variable name");
+  PML_DEF_WORD(param,   1024, "Parameter");
+
+  PML_INIT_INT(timestep);
+  PML_INIT_INT(year);
+  PML_INIT_INT(month);
+  PML_INIT_INT(day);
+  PML_INIT_INT(code);
+  PML_INIT_INT(ltype);
+  PML_INIT_INT(levidx);
+  PML_INIT_FLT(level);
+  PML_INIT_WORD(name);
+  PML_INIT_WORD(param);
+
+  cdoInitialize(argument);
+
+  SELECT  = cdoOperatorAdd("select", 0, 0, "parameter list");
+  DELETE  = cdoOperatorAdd("delete", 0, 0, "parameter list");
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  nsel     = operatorArgc();
+  argnames = operatorArgv();
+
+  if ( cdoVerbose )
+    for ( i = 0; i < nsel; i++ )
+      printf("name %d = %s\n", i+1, argnames[i]);
+
+  pml = pmlNew("SELECT");
+
+  PML_ADD_INT(pml, timestep);
+  PML_ADD_INT(pml, year);
+  PML_ADD_INT(pml, month);
+  PML_ADD_INT(pml, day);
+  PML_ADD_INT(pml, code);
+  PML_ADD_INT(pml, ltype);
+  PML_ADD_INT(pml, levidx);
+  PML_ADD_FLT(pml, level);
+  PML_ADD_WORD(pml, name);
+  PML_ADD_WORD(pml, param);
+
+  pmlRead(pml, nsel, argnames);
+
+  if ( cdoVerbose ) pmlPrint(pml);
+
+  PML_NUM(pml, timestep);
+  PML_NUM(pml, year);
+  PML_NUM(pml, month);
+  PML_NUM(pml, day);
+  PML_NUM(pml, code);
+  PML_NUM(pml, ltype);
+  PML_NUM(pml, levidx);
+  PML_NUM(pml, level);
+  PML_NUM(pml, name);
+  PML_NUM(pml, param);
+  /*
+  pmlDelete(pml);
+  */
+
+  streamCnt = cdoStreamCnt();
+  nfiles = streamCnt - 1;
+
+  tsID2 = 0;
+  for ( indf = 0; indf < nfiles; indf++ )
+    {
+      if ( cdoVerbose ) cdoPrint("Process file: %s", cdoStreamName(indf));
+
+      streamID1 = streamOpenRead(cdoStreamName(indf));
+
+      vlistID1 = streamInqVlist(streamID1);
+      taxisID1 = vlistInqTaxis(vlistID1);
+
+      if ( indf == 0 )
+	{
+	  vlistClearFlag(vlistID1);
+	  nvars = vlistNvars(vlistID1);
+	  vars  = (int *) malloc(nvars*sizeof(int));
+
+	  if ( operatorID == DELETE )
+	    {
+	      result = FALSE;
+	      for ( varID = 0; varID < nvars; varID++ )
+		{
+		  zaxisID = vlistInqVarZaxis(vlistID1, varID);
+		  nlevs   = zaxisInqSize(zaxisID);
+		  for ( levID = 0; levID < nlevs; levID++ )
+		    vlistDefFlag(vlistID1, varID, levID, TRUE);
+		}
+	    }
+	  else
+	    {
+	      result = TRUE;
+	    }
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      iparam  = vlistInqVarParam(vlistID1, varID);
+	      code    = vlistInqVarCode(vlistID1, varID);
+	      vlistInqVarName(vlistID1, varID, varname);
+	      vlistInqVarStdname(vlistID1, varID, stdname);
+
+	      cdiParamToString(iparam, paramstr, sizeof(paramstr));
+
+	      name  = varname;
+	      param = paramstr;
+
+	      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+	      nlevs   = zaxisInqSize(zaxisID);
+	      ltype   = zaxis2ltype(zaxisID);
+
+
+	      vars[varID] = FALSE;
+	      
+	      if ( npar_ltype )
+		{
+		  if ( !vars[varID] && npar_code  && PAR_CHECK_INT(ltype) && PAR_CHECK_INT(code) )   vars[varID] = TRUE;
+		  if ( !vars[varID] && npar_name  && PAR_CHECK_INT(ltype) && PAR_CHECK_WORD(name) )  vars[varID] = TRUE;
+		  if ( !vars[varID] && npar_param && PAR_CHECK_INT(ltype) && PAR_CHECK_WORD(param) ) vars[varID] = TRUE;
+		  if ( !vars[varID] && !npar_code && !npar_name && !npar_param )
+		    {
+		      if ( PAR_CHECK_INT(ltype) ) vars[varID] = TRUE;
+		      else
+			{
+			  for ( levID = 0; levID < nlevs; levID++ )
+			    {
+			      levidx = levID + 1;
+			      level = zaxisInqLevel(zaxisID, levID);
+			      if ( !vars[varID] && npar_levidx && PAR_CHECK_INT(ltype) && PAR_CHECK_INT(levidx) )  vars[varID] = TRUE;
+			      if ( !vars[varID] && npar_level  && PAR_CHECK_INT(ltype) && PAR_CHECK_FLT(level)  )  vars[varID] = TRUE;
+			    }
+			}
+		    }
+		}
+	      else
+		{
+		  if ( !vars[varID] && npar_code  && PAR_CHECK_INT(code) )   vars[varID] = TRUE;
+		  if ( !vars[varID] && npar_name  && PAR_CHECK_WORD(name) )  vars[varID] = TRUE;
+		  if ( !vars[varID] && npar_param && PAR_CHECK_WORD(param) ) vars[varID] = TRUE;
+		  if ( !vars[varID] && !npar_code && !npar_name && !npar_param )
+		    {
+		      for ( levID = 0; levID < nlevs; levID++ )
+			{
+			  levidx = levID + 1;
+			  level = zaxisInqLevel(zaxisID, levID);
+			  if ( !vars[varID] && npar_levidx && PAR_CHECK_INT(levidx) )  vars[varID] = TRUE;
+			  if ( !vars[varID] && npar_level  && PAR_CHECK_FLT(level)  )  vars[varID] = TRUE;
+			}
+		    }
+		}
+	    }
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( vars[varID] )
+		{
+		  zaxisID = vlistInqVarZaxis(vlistID1, varID);
+		  nlevs   = zaxisInqSize(zaxisID);
+
+		  for ( levID = 0; levID < nlevs; levID++ )
+		    {
+		      levidx = levID + 1;
+		      level = zaxisInqLevel(zaxisID, levID);
+		      
+		      if ( nlevs == 1 && IS_EQUAL(level, 0) )
+			{
+			  vlistDefFlag(vlistID1, varID, levID, result);
+			}
+		      else
+			{
+			  if ( npar_levidx )
+			    {
+			      if ( PAR_CHECK_INT(levidx) )
+				vlistDefFlag(vlistID1, varID, levID, result);
+			    }
+			  else if ( npar_level )
+			    {
+			      if ( PAR_CHECK_FLT(level) )
+				vlistDefFlag(vlistID1, varID, levID, result);
+			    }
+			  else
+			    {
+			      vlistDefFlag(vlistID1, varID, levID, result);
+			    }
+			}
+		    }
+		}
+	    }
+
+	  PAR_CHECK_INT_FLAG(code);
+	  PAR_CHECK_INT_FLAG(ltype);
+	  PAR_CHECK_INT_FLAG(levidx);
+	  PAR_CHECK_FLT_FLAG(level);
+	  PAR_CHECK_WORD_FLAG(name);
+	  PAR_CHECK_WORD_FLAG(param);
+
+	  if ( npar_timestep || npar_year || npar_month || npar_day ) ltimsel = TRUE;
+
+	  npar = 0;
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+	      nlevs   = zaxisInqSize(zaxisID);
+
+	      for ( levID = 0; levID < nlevs; levID++ )
+		if ( vlistInqFlag(vlistID1, varID, levID) == result ) break;
+	      
+	      if ( levID < nlevs ) npar++;
+	    }
+
+	  if ( npar == 0 )
+	    {
+	      if ( ltimsel == TRUE )
+		{
+		  for ( varID = 0; varID < nvars; varID++ )
+		    {
+		      vars[varID] = TRUE;
+		      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+		      nlevs   = zaxisInqSize(zaxisID);
+
+		      for ( levID = 0; levID < nlevs; levID++ )
+			vlistDefFlag(vlistID1, varID, levID, TRUE);
+		    }
+		}
+	      else
+		{
+		  cdoAbort("No variable selected!");
+		}
+	    }
+
+	  // if ( cdoVerbose ) vlistPrint(vlistID1);
+
+	  vlistID0 = vlistDuplicate(vlistID1);
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+	      nlevs   = zaxisInqSize(zaxisID);
+	      for ( levID = 0; levID < nlevs; levID++ )
+		vlistDefFlag(vlistID0, varID, levID, vlistInqFlag(vlistID1, varID, levID));
+	    }
+
+	  // if ( cdoVerbose ) vlistPrint(vlistID0);
+
+	  vlistID2 = vlistCreate();
+	  vlistCopyFlag(vlistID2, vlistID1);
+
+	  // if ( cdoVerbose ) vlistPrint(vlistID2);
+	  nvars = vlistNvars(vlistID2);
+	  for ( varID = 0; varID < nvars; ++varID )
+	    if ( vlistInqVarTsteptype(vlistID2, varID) != TSTEP_CONSTANT ) break;
+	  if ( varID == nvars ) vlistDefNtsteps(vlistID2, 0);
+
+	  taxisID2 = taxisDuplicate(taxisID1);
+	  vlistDefTaxis(vlistID2, taxisID2);
+
+	  ntsteps = vlistNtsteps(vlistID1);
+
+	  if ( ntsteps == 1 )
+	    {
+	      for ( varID = 0; varID < nvars; ++varID )
+		if ( vlistInqVarTsteptype(vlistID1, varID) != TSTEP_CONSTANT ) break;
+	      
+	      if ( varID == nvars ) ntsteps = 0;
+	    }
+
+	  if ( ntsteps == 0 && nfiles > 1 )
+	    {	      
+	      for ( varID = 0; varID < nvars; ++varID )
+		vlistDefVarTsteptype(vlistID2, varID, TSTEP_INSTANT);
+	    }
+
+	  streamID2 = streamOpenWrite(cdoStreamName(nfiles), cdoFiletype());
+
+	  streamDefVlist(streamID2, vlistID2);
+
+	  if ( ! lcopy )
+	    {
+	      gridsize = vlistGridsizeMax(vlistID1);
+	      if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+	      array = (double *) malloc(gridsize*sizeof(double));
+	    }
+	}
+      else
+	{
+	  vlistCompare(vlistID0, vlistID1, CMP_ALL);
+	}
+
+
+      tsID1 = 0;
+      while ( (nrecs = streamInqTimestep(streamID1, tsID1)) )
+	{
+	  if ( ltimsel == TRUE )
+	    {
+	      copytimestep = FALSE;
+	      timestep = tsID1 + 1;
+
+	      if ( npar_timestep && PAR_CHECK_INT(timestep) ) copytimestep = TRUE;
+
+	      if ( !copytimestep && npar_timestep == 0 )
+		{
+		  int lyear = 0, lmonth = 0, lday = 0;
+		  vdate = taxisInqVdate(taxisID1);
+		  vtime = taxisInqVtime(taxisID1);
+		  cdiDecodeDate(vdate, &year, &month, &day);
+		  if ( npar_year  == 0 || (npar_year   && PAR_CHECK_INT(year))  ) lyear  = TRUE;
+		  if ( npar_month == 0 || (npar_month  && PAR_CHECK_INT(month)) ) lmonth = TRUE;
+		  if ( npar_day   == 0 || (npar_day    && PAR_CHECK_INT(day))   ) lday   = TRUE;
+
+		  if ( lyear && lmonth && lday ) copytimestep = TRUE;
+		}
+
+	      if ( operatorID == DELETE ) copytimestep = !copytimestep;
+	    }
+	  else
+	    {
+	      copytimestep = TRUE;
+	    }
+
+	  if ( copytimestep == TRUE )
+	    {
+	      taxisCopyTimestep(taxisID2, taxisID1);
+
+	      streamDefTimestep(streamID2, tsID2);
+     
+	      for ( recID = 0; recID < nrecs; recID++ )
+		{
+		  streamInqRecord(streamID1, &varID, &levelID);
+		  if ( vlistInqFlag(vlistID0, varID, levelID) == TRUE )
+		    {
+		      varID2   = vlistFindVar(vlistID2, varID);
+		      levelID2 = vlistFindLevel(vlistID2, varID, levelID);
+		      
+		      streamDefRecord(streamID2, varID2, levelID2);
+		      if ( lcopy )
+			{
+			  streamCopyRecord(streamID2, streamID1);
+			}
+		      else
+			{
+			  streamReadRecord(streamID1, array, &nmiss);
+			  streamWriteRecord(streamID2, array, nmiss);
+			}
+		    }
+		}
+	      tsID2++;
+	    }
+
+	  tsID1++;
+	}
+      
+      streamClose(streamID1);
+    }
+
+  PAR_CHECK_INT_FLAG(timestep);
+  PAR_CHECK_INT_FLAG(year);
+  PAR_CHECK_INT_FLAG(month);
+  PAR_CHECK_INT_FLAG(day);
+
+  streamClose(streamID2);
+
+  vlistDestroy(vlistID0);
+  vlistDestroy(vlistID2);
+
+  if ( array ) free(array);
+  if ( vars ) free(vars);
+
+  cdoFinish();
+
+  return (NULL);
+}
diff --git a/src/Seloperator.c b/src/Seloperator.c
new file mode 100644
index 0000000..f4c9212
--- /dev/null
+++ b/src/Seloperator.c
@@ -0,0 +1,156 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Seloperator(void *argument)
+{
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int scode, sltype;
+  double slevel = 0, level;
+  int nvars, nlevs, code, zaxisID, selfound = FALSE;
+  int levID, ltype = 0;
+  int varID2, levelID2;
+  int sellevel, selcode, selltype;
+  int lcopy = FALSE;
+  int gridsize, nmiss;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  operatorInputArg("code, ltype, level");
+
+  scode  = atoi(operatorArgv()[0]);
+  sltype = atoi(operatorArgv()[1]);
+
+  if ( operatorArgc() == 3 )
+    slevel = atof(operatorArgv()[2]);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  nvars = vlistNvars(vlistID1);
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      code    = vlistInqVarCode(vlistID1, varID);
+      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+      nlevs   = zaxisInqSize(zaxisID);
+
+      ltype = zaxis2ltype(zaxisID);
+
+      for ( levID = 0; levID < nlevs; levID++ )
+	{
+	  level = zaxisInqLevel(zaxisID, levID);
+
+	  if ( operatorArgc() == 3 )
+	    sellevel = IS_EQUAL(level, slevel);
+	  else
+	    sellevel = TRUE;
+
+	  if ( scode == -1 || scode == code )
+            selcode = TRUE;
+	  else
+            selcode = FALSE;
+
+	  if ( sltype == -1 || sltype == ltype )
+            selltype = TRUE;
+	  else
+            selltype = FALSE;
+
+	  if ( selcode && selltype && sellevel )
+	    {
+	      vlistDefFlag(vlistID1, varID, levID, TRUE);
+	      selfound = TRUE;
+	    }
+	}
+    }
+
+  if ( selfound == FALSE )
+    cdoWarning("Code %d, ltype %d, level %g not found!", scode, sltype, slevel);
+
+  vlistID2 = vlistCreate();
+  vlistCopyFlag(vlistID2, vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  if ( vlistInqFlag(vlistID1, varID, levelID) == TRUE )
+	    {
+	      varID2   = vlistFindVar(vlistID2, varID);
+	      levelID2 = vlistFindLevel(vlistID2, varID, levelID);
+
+	      streamDefRecord(streamID2, varID2, levelID2);
+	  
+	      if ( lcopy )
+		{
+		  streamCopyRecord(streamID2, streamID1);
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array, &nmiss);
+		  streamWriteRecord(streamID2, array, nmiss);
+		}
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  vlistDestroy(vlistID2);
+
+  if ( ! lcopy )
+    if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Selrec.c b/src/Selrec.c
new file mode 100644
index 0000000..109bf23
--- /dev/null
+++ b/src/Selrec.c
@@ -0,0 +1,115 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Selrec     selrec          Select records
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"  /* processSelf */
+#include "pstream.h"
+#include "error.h"
+#include "util.h"
+#include "list.h"
+
+
+void *Selrec(void *argument)
+{
+  int streamID1, streamID2;
+  int tsID, nrecs;
+  int recID, varID, levelID;
+  int *intarr, nsel = 0;
+  int vlistID1 = -1, vlistID2 = -1;
+  int i;
+  int recordID;
+  int filetype;
+  int taxisID1, taxisID2;
+  LIST *ilist = listNew(INT_LIST);
+
+  cdoInitialize(argument);
+
+  if ( processSelf() != 0 && *(char *)argument == '-' )
+    cdoAbort("This operator does not work with pipes!");
+
+  operatorInputArg("records");
+
+  nsel = args2intlist(operatorArgc(), operatorArgv(), ilist);
+
+  intarr = (int *) listArrayPtr(ilist);
+
+  if ( cdoVerbose )
+    {
+      for ( i = 0; i < nsel; i++ )
+	cdoPrint("intarr entry: %d %d", i, intarr[i]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  filetype = streamInqFiletype(streamID1);
+
+  if ( filetype == FILETYPE_NC || filetype == FILETYPE_NC2 )
+    cdoAbort("This operator does not work on netCDF data!");
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  recordID = 0;
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+     
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  recordID++;
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  for ( i = 0; i < nsel; i++ )
+	    {
+	      if ( recordID == intarr[i] )
+		{
+		  streamDefRecord(streamID2, varID, levelID);
+		  streamCopyRecord(streamID2, streamID1);
+		  break;
+		}
+	    }
+	}
+       
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  listDelete(ilist);
+
+  cdoFinish();
+
+  return (NULL);
+}
diff --git a/src/Seltime.c b/src/Seltime.c
new file mode 100644
index 0000000..7c17f64
--- /dev/null
+++ b/src/Seltime.c
@@ -0,0 +1,677 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Seltime    seltimestep     Select timesteps
+      Seltime    seltime         Select times
+      Seltime    selhour         Select hours
+      Seltime    selday          Select days
+      Seltime    selmon          Select months
+      Seltime    selyear         Select years
+      Seltime    selseas         Select seasons
+      Seltime    seldate         Select dates
+      Seltime    selsmon         Select single month
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "error.h"
+#include "util.h"
+#include "list.h"
+
+
+#define  NOPERATORS  32
+
+static
+int seaslist(LIST *ilist)
+{
+  int i;
+  int nsel;
+  char Seas[3];
+  int seas[4] = {FALSE, FALSE, FALSE, FALSE};
+  int imon[17]; /* 1-16 ! */
+  int ival;
+  size_t len;
+  int season_start;
+
+  season_start = get_season_start();
+  nsel = operatorArgc();
+  if ( isdigit(*operatorArgv()[0]))
+    for ( i = 0; i < nsel; i++ )
+      {
+	ival = atoi(operatorArgv()[i]);
+	if      ( ival == 1 || ival == 13 ) seas[0] = TRUE;
+	else if ( ival == 2 || ival == 14 ) seas[1] = TRUE;
+	else if ( ival == 3 || ival == 15 ) seas[2] = TRUE;
+	else if ( ival == 4 || ival == 16 ) seas[3] = TRUE;
+	else cdoAbort("Season %d not available!", ival);
+      }
+  else
+    for ( i = 0; i < nsel; i++ )
+      {
+	len = strlen(operatorArgv()[i]);
+	if ( len > 3 ) len = 3;
+	while ( len-- > 0 ) Seas[len] = toupper(operatorArgv()[i][len]);
+	if ( season_start == START_DEC )
+	  {
+	    if      ( memcmp(Seas, "DJF", 3) == 0 ) seas[0] = TRUE;
+	    else if ( memcmp(Seas, "MAM", 3) == 0 ) seas[1] = TRUE;
+	    else if ( memcmp(Seas, "JJA", 3) == 0 ) seas[2] = TRUE;
+	    else if ( memcmp(Seas, "SON", 3) == 0 ) seas[3] = TRUE;
+	    else cdoAbort("Season %s not available!", operatorArgv()[i]);
+	  }
+	else
+	  {
+	    if      ( memcmp(Seas, "JFM", 3) == 0 ) seas[0] = TRUE;
+	    else if ( memcmp(Seas, "AMJ", 3) == 0 ) seas[1] = TRUE;
+	    else if ( memcmp(Seas, "JAS", 3) == 0 ) seas[2] = TRUE;
+	    else if ( memcmp(Seas, "OND", 3) == 0 ) seas[3] = TRUE;
+	    else cdoAbort("Season %s not available!", operatorArgv()[i]);
+	  }
+      }
+  
+  for ( i = 0; i < 17; ++i ) imon[i] = 0;
+  
+  if ( season_start == START_DEC )
+    {
+      if ( seas[0] ) { imon[12]++; imon[ 1]++; imon[ 2]++; imon[13]++; }
+      if ( seas[1] ) { imon[ 3]++; imon[ 4]++; imon[ 5]++; imon[14]++; }
+      if ( seas[2] ) { imon[ 6]++; imon[ 7]++; imon[ 8]++; imon[15]++; }
+      if ( seas[3] ) { imon[ 9]++; imon[10]++; imon[11]++; imon[16]++; }
+    }
+  else
+    {
+      if ( seas[0] ) { imon[ 1]++; imon[ 2]++; imon[ 3]++; imon[13]++; }
+      if ( seas[1] ) { imon[ 4]++; imon[ 5]++; imon[ 6]++; imon[14]++; }
+      if ( seas[2] ) { imon[ 7]++; imon[ 8]++; imon[ 9]++; imon[15]++; }
+      if ( seas[3] ) { imon[10]++; imon[11]++; imon[12]++; imon[16]++; }
+    }
+  
+  nsel = 0;
+  for ( i = 1; i < 17; ++i )
+    {
+      if ( imon[i] )
+	listSetInt(ilist, nsel++, i);
+    }
+
+  return (nsel);
+}
+
+static
+int datelist(LIST *flist)
+{
+  int nsel;
+  int i;
+  int status;
+  int set2 = TRUE;
+  int year = 1, month = 1, day = 1, hour = 0, minute = 0, second = 0;
+  double fval = 0;
+
+  nsel = operatorArgc();
+  if ( nsel < 1 ) cdoAbort("Too few arguments!");
+  for ( i = 0; i < nsel; i++)
+    {
+      if      ( operatorArgv()[i][0] == '-' && operatorArgv()[i][1] == 0 )
+	{
+	  if ( i == 0 )
+	    fval = -99999999999.;
+	  else
+	    fval =  99999999999.;
+
+	  listSetFlt(flist, i,  fval);
+	}
+      else if ( strchr(operatorArgv()[i], '-') == NULL )
+	{
+	  fval = atof(operatorArgv()[i]);
+	  listSetFlt(flist, i, fval);
+	}
+      else
+	{
+	  year = 1; month = 1; day = 1; hour = 0; minute = 0, second = 0;
+	  if ( strchr(operatorArgv()[i], 'T') )
+	    {
+	      status = sscanf(operatorArgv()[i], "%d-%d-%dT%d:%d:%d",
+			      &year, &month, &day, &hour, &minute, &second);
+	      fval = cdiEncodeTime(hour, minute, second);
+	      if ( fabs(fval) > 0 ) fval /= 1000000;
+	      fval += cdiEncodeDate(year, month, day);
+	      listSetFlt(flist, i, fval);
+	      set2 = FALSE;
+	    }
+	  else
+	    {
+	      status = sscanf(operatorArgv()[i], "%d-%d-%d", &year, &month, &day);
+	      fval = cdiEncodeDate(year, month, day);
+	      
+	      if ( nsel > 1 && i > 0 ) fval += 0.999;
+
+	      listSetFlt(flist, i, fval);
+	    }
+	}
+    }
+
+  if ( nsel == 1 && set2 == TRUE )
+    {
+      fval += 0.999;
+      listSetFlt(flist, nsel, fval);
+      nsel = 2;
+    }
+
+  return (nsel);
+}
+
+
+void *Seltime(void *argument)
+{
+  int SELTIMESTEP, SELDATE, SELTIME, SELHOUR, SELDAY, SELMON, SELYEAR, SELSEAS, SELSMON;
+  int operatorID;
+  int operfunc, intval;
+  int moddat[NOPERATORS];
+  int streamID1, streamID2 = -1;
+  int tsID, tsID2, nrecs;
+  int recID, varID, levelID;
+  int *intarr, nsel = 0, selival;
+  int vlistID1 = -1, vlistID2 = -1;
+  int taxisID1, taxisID2;
+  int vdate, vtime;
+  int copytimestep;
+  int copy_nts2 = FALSE;
+  int i, isel;
+  int lcopy = FALSE;
+  int gridsize;
+  int nmiss;
+  int lnts1;
+  int ncts = 0, nts, it;
+  int *selfound = NULL;
+  int hour = 0, minute = 0, second = 0;
+  int nts1 = 0, nts2 = 0;
+  int its1 = 0, its2 = 0;
+  double selfval = 0, *fltarr;
+  double *array = NULL;
+  LIST *ilist = listNew(INT_LIST);
+  LIST *flist = listNew(FLT_LIST);
+  int gridID;
+  int nvars, nlevel;
+  int nconst, lconstout = FALSE;
+  int process_nts1 = FALSE, process_nts2 = FALSE;
+  int *vdate_list = NULL, *vtime_list = NULL;
+  double missval;
+  double *single;
+  field_t ***vars = NULL;
+
+  cdoInitialize(argument);
+
+  SELTIMESTEP = cdoOperatorAdd("seltimestep", func_step,     1, "timesteps");
+  SELDATE     = cdoOperatorAdd("seldate",     func_datetime, 1, "start date and end date (format YYYY-MM-DDThh:mm:ss)");
+  SELTIME     = cdoOperatorAdd("seltime",     func_time,     1, "times (format hh:mm:ss)");
+  SELHOUR     = cdoOperatorAdd("selhour",     func_time, 10000, "hours");
+  SELDAY      = cdoOperatorAdd("selday",      func_date,     1, "days");
+  SELMON      = cdoOperatorAdd("selmon",      func_date,   100, "months");
+  SELYEAR     = cdoOperatorAdd("selyear",     func_date, 10000, "years");
+  SELSEAS     = cdoOperatorAdd("selseas",     func_date,   100, "seasons");
+  SELSMON     = cdoOperatorAdd("selsmon",     func_date,   100, "month[,nts1[,nts2]]");
+
+  moddat[SELTIMESTEP] =          1;
+  /*  moddat[SELDATE]     = 1000000000; */
+  moddat[SELDATE]     =          0;
+  moddat[SELTIME]     =    1000000;
+  moddat[SELHOUR]     =      10000;
+  moddat[SELDAY]      =        100;
+  moddat[SELMON]      =        100;
+  moddat[SELYEAR]     = 1000000000;
+  moddat[SELSEAS]     =        100;
+  moddat[SELSMON]     =        100;
+
+  operatorID = cdoOperatorID();
+
+  operfunc = cdoOperatorF1(operatorID);
+  intval   = cdoOperatorF2(operatorID);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  if ( operatorID == SELSEAS )
+    {
+      nsel = seaslist(ilist);
+    }
+  else if ( operatorID == SELDATE )
+    {
+      nsel = datelist(flist);
+    }
+  else if ( operatorID == SELTIME )
+    {
+      nsel = operatorArgc();
+      if ( nsel < 1 ) cdoAbort("Too few arguments!");
+      for ( i = 0; i < nsel; i++ )
+	{
+	  if ( strchr(operatorArgv()[i], ':') )
+	    {
+	      sscanf(operatorArgv()[i], "%d:%d:%d", &hour, &minute, &second);
+	      listSetInt(ilist, i, cdiEncodeTime(hour, minute, second));
+	    }
+	  else
+	    {
+	      listSetInt(ilist, i, atoi(operatorArgv()[i]));
+	    }
+	}
+    }
+  else
+    {
+      nsel = args2intlist(operatorArgc(), operatorArgv(), ilist);
+    }
+
+  if ( nsel < 1 ) cdoAbort("No timestep selected!");
+
+  intarr = (int *) listArrayPtr(ilist);
+  fltarr = (double *) listArrayPtr(flist);
+
+  if ( operatorID == SELSMON )
+    {
+      if ( nsel > 1 ) nts1 = intarr[1];
+      if ( nsel > 2 ) nts2 = intarr[2];
+      else            nts2 = nts1;
+
+      if ( nsel > 3 ) cdoAbort("Too many parameters");
+
+      if ( cdoVerbose )
+	cdoPrint("mon=%d  nts1=%d  nts2=%d", intarr[0], nts1, nts2);
+
+      nsel = 1;
+    }
+
+  if ( nsel )
+    {
+      selfound = (int *) malloc(nsel*sizeof(int));
+      for ( i = 0; i < nsel; i++ ) selfound[i] = FALSE;
+    }
+
+  if ( cdoVerbose )
+    {
+      for ( i = 0; i < nsel; i++ )
+	if ( operatorID == SELDATE )
+	  cdoPrint("fltarr entry: %d %14.4f", i+1, fltarr[i]);
+	else
+	  cdoPrint("intarr entry: %d %d", i+1, intarr[i]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+  if ( nsel == 1 && operfunc == func_step )  vlistDefNtsteps(vlistID2, 1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  nvars = vlistNvars(vlistID1);
+  nconst = 0;
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) nconst++;
+      
+  lnts1 = operatorID == SELSMON && nts1 > 0;
+
+  if ( lnts1 || nconst )
+    {
+      if ( lnts1 )
+	{
+	  vdate_list = (int *) malloc(nts1*sizeof(int));
+	  vtime_list = (int *) malloc(nts1*sizeof(int));
+	}
+      else
+	{
+	  nts1 = 1;
+	}
+
+      vars  = (field_t ***) malloc(nts1*sizeof(field_t **));
+
+      for ( tsID = 0; tsID < nts1; tsID++ )
+	{
+	  vars[tsID] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( lnts1 || (vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT) )
+		{
+		  gridID  = vlistInqVarGrid(vlistID1, varID);
+		  missval = vlistInqVarMissval(vlistID1, varID);
+		  nlevel  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+		  gridsize = gridInqSize(gridID);
+		  
+		  vars[tsID][varID] = (field_t *) malloc(nlevel*sizeof(field_t));
+
+		  for ( levelID = 0; levelID < nlevel; levelID++ )
+		    {
+		      vars[tsID][varID][levelID].grid    = gridID;
+		      vars[tsID][varID][levelID].missval = missval;
+		      vars[tsID][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		    }
+		}
+	    }
+	}
+    }
+
+  tsID  = 0;
+  tsID2 = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      copytimestep = FALSE;
+      selival = -1;
+
+      if ( operfunc == func_step )
+	{
+	  selival = tsID + 1;
+	  if ( selival > intarr[nsel-1] ) break;
+	}
+      else if ( operfunc == func_date )
+	{
+	  selival = (vdate/intval)%moddat[operatorID];
+	}
+      else if ( operfunc == func_time )
+	{
+	  selival = (vtime/intval)%moddat[operatorID];
+	}
+      else if ( operfunc == func_datetime )
+	{
+	  selfval = vdate + vtime/1000000.;
+	}
+
+      if ( operatorID == SELDATE )
+	{
+	  if ( selfval >= fltarr[0] && selfval <= fltarr[nsel-1] )
+	    {
+	      copytimestep = TRUE;
+	      selfound[0]      = TRUE;
+	      selfound[nsel-1] = TRUE;
+	    }
+	}
+      else
+	{
+	  for ( i = 0; i < nsel; i++ )
+	    if ( selival == intarr[i] )
+	      {
+		copytimestep = TRUE;
+		selfound[i] = TRUE;
+		break;
+	      }
+	}
+
+      if ( operatorID == SELSMON && copytimestep == FALSE )
+	{
+	  copy_nts2 = FALSE;
+
+	  if ( process_nts1 == TRUE )
+	    {
+	      process_nts2 = TRUE;
+	      its2 = 0;
+	      process_nts1 = FALSE;
+	    }
+
+	  if ( process_nts2 == TRUE )
+	    {
+	      if ( its2++ < nts2 )
+		copy_nts2 = TRUE;
+	      else
+		process_nts2 = FALSE;
+	    }
+	}
+
+      if ( copytimestep || copy_nts2 )
+	{
+	  if ( tsID2 == 0 )
+	    {
+	      streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+	      streamDefVlist(streamID2, vlistID2);
+	    }
+
+	  if ( lnts1 && ncts == 0 )
+	    {
+	      nts = nts1;
+	      if ( its1 < nts1 )
+		{
+		  nts = its1;
+		  cdoWarning("%d timesteps missing before month %d!", nts1-its1, intarr[0]);
+		}
+
+	      for ( it = 0; it < nts; it++ )
+		{
+		  taxisDefVdate(taxisID2, vdate_list[it]);
+		  taxisDefVtime(taxisID2, vtime_list[it]);
+		  streamDefTimestep(streamID2, tsID2++);
+		  
+		  for ( varID = 0; varID < nvars; varID++ )
+		    {
+		      if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT && tsID2 > 1 ) continue;
+		      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+		      for ( levelID = 0; levelID < nlevel; levelID++ )
+			{
+			  streamDefRecord(streamID2, varID, levelID);
+			  single = vars[it][varID][levelID].ptr;
+			  nmiss  = vars[it][varID][levelID].nmiss;
+			  streamWriteRecord(streamID2, single, nmiss);
+			}
+		    }
+		}
+
+	      its1 = 0;
+	    }
+
+	  ncts++;
+	  if ( process_nts2 == FALSE )
+	    {
+	      its2 = 0;
+	      process_nts1 = TRUE;
+	    }
+
+	  taxisCopyTimestep(taxisID2, taxisID1);
+
+	  streamDefTimestep(streamID2, tsID2++);
+
+	  if ( tsID > 0 && lconstout )
+	    {
+	      lconstout = FALSE;
+	      nts = nts1 - 1;
+	      for ( varID = 0; varID < nvars; varID++ )
+		{
+		  if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT )
+		    {
+		      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+		      for ( levelID = 0; levelID < nlevel; levelID++ )
+			{
+			  streamDefRecord(streamID2, varID, levelID);
+			  single = vars[nts][varID][levelID].ptr;
+			  nmiss  = vars[nts][varID][levelID].nmiss;
+			  streamWriteRecord(streamID2, single, nmiss);
+			}
+		    }
+		}
+	    }
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+	      streamDefRecord(streamID2, varID, levelID);
+	      if ( lcopy )
+		{
+		  streamCopyRecord(streamID2, streamID1);
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array, &nmiss);
+		  streamWriteRecord(streamID2, array, nmiss);
+		}
+	    }
+	}
+      else
+	{
+	  ncts = 0;
+
+	  if ( lnts1 || tsID == 0 )
+	    {
+	      if ( tsID == 0 && nconst && (!lnts1) ) lconstout = TRUE;
+
+	      nts = nts1-1;
+	      if ( lnts1 )
+		{
+		  if ( its1 <= nts )
+		    nts = its1;
+		  else
+		    for ( it = 0; it < nts; it++ )
+		      {
+			vdate_list[it] = vdate_list[it+1];
+			vtime_list[it] = vtime_list[it+1];
+			for ( varID = 0; varID < nvars; varID++ )
+			  {
+			    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+			    gridID   = vlistInqVarGrid(vlistID1, varID);
+			    gridsize = gridInqSize(gridID);
+			    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+			    for ( levelID = 0; levelID < nlevel; levelID++ )
+			      {
+				memcpy(vars[it][varID][levelID].ptr,
+				       vars[it+1][varID][levelID].ptr,
+				       gridsize*sizeof(double));
+				vars[it][varID][levelID].nmiss = vars[it+1][varID][levelID].nmiss;
+			      }
+			  }
+		      }
+
+		  vdate_list[nts] = taxisInqVdate(taxisID1);
+		  vtime_list[nts] = taxisInqVtime(taxisID1);
+
+		  its1++;
+		}
+
+	      for ( recID = 0; recID < nrecs; recID++ )
+		{
+		  streamInqRecord(streamID1, &varID, &levelID);
+		  if ( lnts1 || (vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT) )
+		    {
+		      single = vars[nts][varID][levelID].ptr;
+		      streamReadRecord(streamID1, single, &nmiss);
+		      vars[nts][varID][levelID].nmiss = nmiss;
+		    }
+		}
+	    }
+	}
+       
+      tsID++;
+    }
+
+  if ( streamID2 != -1 ) streamClose(streamID2);
+  streamClose(streamID1);
+ 
+  if ( operatorID == SELSMON )
+    if ( its2 < nts2 )
+      cdoWarning("%d timesteps missing after the last month!", nts2-its2);
+
+  if ( ! lcopy )
+    if ( array ) free(array);
+
+  for ( isel = 0; isel < nsel; isel++ )
+    {
+      if ( selfound[isel] == FALSE )
+	{
+	  if ( operatorID == SELTIMESTEP )
+	    {
+	      cdoWarning("Time step %d not found!", intarr[isel]);
+	    }
+	  else if ( operatorID == SELDATE )
+	    {
+	      if ( isel == 0 )
+		cdoWarning("Date between %14.4f and %14.4f not found!", fltarr[0], fltarr[nsel-1]);
+	    }
+	  else if ( operatorID == SELTIME )
+	    {
+	      cdoWarning("Time %d not found!", intarr[isel]);
+	    }
+	  else if ( operatorID == SELHOUR )
+	    {
+	      cdoWarning("Hour %d not found!", intarr[isel]);
+	    }
+	  else if ( operatorID == SELDAY )
+	    {
+	      cdoWarning("Day %d not found!", intarr[isel]);
+	    }
+	  else if ( operatorID == SELMON )
+	    {
+	      cdoWarning("Month %d not found!", intarr[isel]);
+	    }
+	  else if ( operatorID == SELYEAR )
+	    {
+	      cdoWarning("Year %d not found!", intarr[isel]);
+	    }
+	  else if ( operatorID == SELSEAS )
+	    {
+	      if ( isel < 3 )
+		cdoWarning("Month %d not found!", intarr[isel]);
+	    }
+	}
+    }
+
+  if ( selfound ) free(selfound);
+
+  listDelete(ilist);
+
+  if ( lnts1 || nconst )
+    {
+      for ( tsID = 0; tsID < nts1; tsID++ )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( lnts1 || (vlistInqVarTsteptype(vlistID2, varID) == TSTEP_CONSTANT) )
+		{
+		  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+		  for ( levelID = 0; levelID < nlevel; levelID++ )
+		    if ( vars[tsID][varID][levelID].ptr )
+		      free(vars[tsID][varID][levelID].ptr);
+
+		  free(vars[tsID][varID]);
+		}
+	    }
+	  free(vars[tsID]);
+	}
+
+      if ( vars  ) free(vars);
+      if ( vdate_list ) free(vdate_list);
+      if ( vtime_list ) free(vtime_list);
+    }
+
+  vlistDestroy(vlistID2);
+
+  cdoFinish();
+
+  return (NULL);
+}
diff --git a/src/Selvar.c b/src/Selvar.c
new file mode 100644
index 0000000..b079d54
--- /dev/null
+++ b/src/Selvar.c
@@ -0,0 +1,460 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Selvar     selparam        Select parameters by identifier (format: code.tabnum  or  pnum.cat.dis)
+      Selvar     delparam        Delete parameters by identifier (format: code.tabnum  or  pnum.cat.dis)
+      Selvar     selcode         Select parameters by code number
+      Selvar     delcode         Delete parameters by code number
+      Selvar     selname         Select parameters by name
+      Selvar     delname         Delete parameters by name
+      Selvar     selstdname      Select parameters by CF standard name
+      Selvar     sellevel        Select levels
+      Selvar     sellevidx       Select levels by index
+      Selvar     selgrid         Select grids
+      Selvar     selzaxis        Select zaxis
+      Selvar     seltabnum       Select parameter table number
+      Selvar     selltype        Select GRIB level type 
+*/
+
+#include <ctype.h>  /* isdigit */
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "error.h"
+#include "util.h"
+#include "list.h"
+
+
+void *Selvar(void *argument)
+{
+  int SELPARAM, SELCODE, SELNAME, SELLEVEL, SELLEVIDX, SELGRID, SELZAXIS, SELLTYPE; 
+  int SELTABNUM, DELPARAM, DELCODE, DELNAME, SELSTDNAME;
+  int operatorID;
+  int streamID1, streamID2;
+  int tsID, nrecs;
+  int nvars, nlevs;
+  int code, tabnum, param, gridID, zaxisID, levID;
+  int grididx, zaxisidx;
+  double level;
+  int varID2, levelID2;
+  int recID, varID, levelID;
+  int *intarr = NULL, nsel = 0;
+  int *selfound = NULL;
+  double *fltarr = NULL;
+  char paramstr[32];
+  char varname[CDI_MAX_NAME];
+  char stdname[CDI_MAX_NAME];
+  char gridname[CDI_MAX_NAME];
+  char zaxisname[CDI_MAX_NAME];
+  char **argnames = NULL;
+  int vlistID1 = -1, vlistID2 = -1;
+  int isel;
+  int i;
+  int npar;
+  int intlist, byname;
+  int lcopy = FALSE;
+  int gridsize;
+  int nmiss;
+  double *array = NULL;
+  int taxisID1, taxisID2;
+  int ltype;
+  LIST *ilist = listNew(INT_LIST);
+  LIST *flist = listNew(FLT_LIST);
+
+  cdoInitialize(argument);
+
+  SELPARAM     = cdoOperatorAdd("selparam",     0, 0, "parameters");
+  SELCODE      = cdoOperatorAdd("selcode",      0, 0, "code numbers");
+  SELNAME      = cdoOperatorAdd("selname",      0, 0, "variable names");
+  SELSTDNAME   = cdoOperatorAdd("selstdname",   0, 0, "standard names");
+  SELLEVEL     = cdoOperatorAdd("sellevel",     0, 0, "levels");
+  SELLEVIDX    = cdoOperatorAdd("sellevidx",    0, 0, "index of levels");
+  SELGRID      = cdoOperatorAdd("selgrid",      0, 0, "list of grid names or numbers");
+  SELZAXIS     = cdoOperatorAdd("selzaxis",     0, 0, "list of zaxis names or numbers");
+  SELTABNUM    = cdoOperatorAdd("seltabnum",    0, 0, "table numbers");
+  DELPARAM     = cdoOperatorAdd("delparam",     0, 0, "parameter");
+  DELCODE      = cdoOperatorAdd("delcode",      0, 0, "code numbers");
+  DELNAME      = cdoOperatorAdd("delname",      0, 0, "variable names");
+  SELLTYPE     = cdoOperatorAdd("selltype",     0, 0, "GRIB level types"); 
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  intlist = FALSE;
+  byname  = TRUE;
+
+  if ( operatorID == SELPARAM || operatorID == DELPARAM || operatorID == SELNAME || operatorID == DELNAME || 
+       operatorID == SELSTDNAME || operatorID == SELGRID || operatorID == SELZAXIS )
+    {
+      nsel     = operatorArgc();
+      argnames = operatorArgv();
+
+      if ( cdoVerbose )
+	for ( i = 0; i < nsel; i++ )
+	  fprintf(stderr, "name %d = %s\n", i+1, argnames[i]);
+
+      if ( operatorID == SELGRID || operatorID == SELZAXIS )
+	{
+	  if ( nsel > 0 && isdigit(*argnames[0]) )
+	    {
+	      intlist = TRUE;
+	      byname  = FALSE;
+	    }
+	}
+    }
+  else if ( operatorID == SELLEVEL )
+    {
+      nsel = args2fltlist(operatorArgc(), operatorArgv(), flist);
+      fltarr = (double *) listArrayPtr(flist);
+
+      if ( cdoVerbose )
+	for ( i = 0; i < nsel; i++ )
+	  printf("flt %d = %g\n", i+1, fltarr[i]);
+    }
+  else
+    {
+      intlist = TRUE;
+    }
+
+  if ( intlist )
+    {
+      nsel = args2intlist(operatorArgc(), operatorArgv(), ilist);
+      intarr = (int *) listArrayPtr(ilist);
+
+      if ( cdoVerbose )
+	for ( i = 0; i < nsel; i++ )
+	  printf("int %d = %d\n", i+1, intarr[i]);
+    }
+
+  if ( nsel )
+    {
+      selfound = (int *) malloc(nsel*sizeof(int));
+      for ( i = 0; i < nsel; i++ ) selfound[i] = FALSE;
+    }
+
+  /*
+  if ( nsel == 0 )
+    cdoAbort("missing code argument!");
+  */
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  vlistClearFlag(vlistID1);
+  nvars = vlistNvars(vlistID1);
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      vlistInqVarName(vlistID1, varID, varname);
+      vlistInqVarStdname(vlistID1, varID, stdname);
+      param    = vlistInqVarParam(vlistID1, varID);
+      code     = vlistInqVarCode(vlistID1, varID);
+      tabnum   = tableInqNum(vlistInqVarTable(vlistID1, varID));
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      grididx  = vlistGridIndex(vlistID1, gridID);
+      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+      zaxisidx = vlistZaxisIndex(vlistID1, zaxisID);
+      nlevs    = zaxisInqSize(zaxisID);
+      gridName(gridInqType(gridID), gridname);
+      zaxisName(zaxisInqType(zaxisID), zaxisname);
+
+      cdiParamToString(param, paramstr, sizeof(paramstr));
+
+      for ( levID = 0; levID < nlevs; levID++ )
+	{
+	  level = zaxisInqLevel(zaxisID, levID);
+
+	  if ( operatorID == DELCODE || operatorID == DELNAME || operatorID == DELPARAM )
+	    vlistDefFlag(vlistID1, varID, levID, TRUE);
+
+	  for ( isel = 0; isel < nsel; isel++ )
+	    {
+	      if ( operatorID == SELCODE )
+		{
+		  if ( intarr[isel] == code )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == SELPARAM )
+		{
+		  if ( strcmp(argnames[isel], paramstr) == 0 )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == SELNAME )
+		{
+		  if ( strcmp(argnames[isel], varname) == 0 )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == SELSTDNAME )
+		{
+		  if ( strcmp(argnames[isel], stdname) == 0 )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == SELLEVEL )
+		{
+		  if ( fabs(fltarr[isel] - level) < 0.0001 )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == SELLEVIDX )
+		{
+		  if ( intarr[isel] == (levID+1) )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == SELGRID && byname == FALSE )
+		{
+		  if ( intarr[isel] == (grididx+1) )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == SELGRID && byname == TRUE )
+		{
+		  if ( memcmp(argnames[isel], gridname, strlen(argnames[isel])) == 0 )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == SELZAXIS && byname == FALSE )
+		{
+		  if ( intarr[isel] == (zaxisidx+1) )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == SELZAXIS && byname == TRUE )
+		{
+		  if ( memcmp(argnames[isel], zaxisname, strlen(argnames[isel])) == 0 )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == SELTABNUM )
+		{
+		  if ( intarr[isel] == tabnum )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == DELCODE )
+		{
+		  if ( intarr[isel] == code )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, FALSE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == DELNAME )
+		{
+		  if ( strcmp(argnames[isel], varname) == 0 )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, FALSE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == DELPARAM )
+		{
+		  if ( strcmp(argnames[isel], paramstr) == 0 )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, FALSE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	      else if ( operatorID == SELLTYPE )
+		{
+		  ltype = zaxis2ltype(zaxisID);
+
+		  if ( intarr[isel] == ltype )
+		    {
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		      selfound[isel] = TRUE;
+		    }
+		}
+	    }
+	}
+    }
+
+  npar = 0;
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+      nlevs   = zaxisInqSize(zaxisID);
+
+      for ( levID = 0; levID < nlevs; levID++ )
+	if ( vlistInqFlag(vlistID1, varID, levID) == TRUE ) break;
+	      
+      if ( levID < nlevs ) npar++;
+    }
+
+  for ( isel = 0; isel < nsel; isel++ )
+    {
+      if ( selfound[isel] == FALSE )
+	{
+	  if ( operatorID == SELCODE || operatorID == DELCODE )
+	    {
+	      cdoWarning("Code number %d not found!", intarr[isel]);
+	    }
+	  else if ( operatorID == SELPARAM || operatorID == DELPARAM )
+	    {
+	      cdoWarning("Parameter %s not found!", argnames[isel]);
+	    }
+	  else if ( operatorID == SELNAME || operatorID == DELNAME )
+	    {
+	      cdoWarning("Variable name %s not found!", argnames[isel]);
+	    }
+	  else if ( operatorID == SELSTDNAME )
+	    {
+	      cdoWarning("Variable with standard name %s not found!", argnames[isel]);
+	    }
+	  else if ( operatorID == SELLEVEL )
+	    {
+	      cdoWarning("Level %g not found!", fltarr[isel]);
+	    }
+	  else if ( operatorID == SELLEVIDX )
+	    {
+	      cdoWarning("Level index %d not found!", intarr[isel]);
+	    }
+	  else if ( operatorID == SELGRID && byname == FALSE )
+	    {
+	      cdoWarning("Grid %d not found!", intarr[isel]);
+	    }
+	  else if ( operatorID == SELGRID && byname == TRUE )
+	    {
+	      cdoWarning("Grid name %s not found!", argnames[isel]);
+	    }
+	  else if ( operatorID == SELZAXIS && byname == FALSE )
+	    {
+	      cdoWarning("Zaxis %d not found!", intarr[isel]);
+	    }
+	  else if ( operatorID == SELZAXIS && byname == TRUE )
+	    {
+	      cdoWarning("Zaxis name %s not found!", argnames[isel]);
+	    }
+	  else if ( operatorID == SELTABNUM )
+	    {
+	      cdoWarning("Table number %d not found!", intarr[isel]);
+	    }
+	  else if ( operatorID == SELLTYPE )
+	    {
+	      cdoWarning("GRIB level type %d not found!", intarr[isel]);
+	    }
+	}
+    }
+  
+  if ( npar == 0 ) cdoAbort("No variables selected!");
+
+  vlistID2 = vlistCreate();
+  vlistCopyFlag(vlistID2, vlistID1);
+
+  nvars = vlistNvars(vlistID2);
+  for ( varID = 0; varID < nvars; ++varID )
+    if ( vlistInqVarTsteptype(vlistID2, varID) != TSTEP_CONSTANT ) break;
+  if ( varID == nvars ) vlistDefNtsteps(vlistID2, 0);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nrecs = vlistNrecs(vlistID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+     
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  if ( vlistInqFlag(vlistID1, varID, levelID) == TRUE )
+	    {
+	      varID2   = vlistFindVar(vlistID2, varID);
+	      levelID2 = vlistFindLevel(vlistID2, varID, levelID);
+
+	      streamDefRecord(streamID2, varID2, levelID2);
+	      if ( lcopy )
+		{
+		  streamCopyRecord(streamID2, streamID1);
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array, &nmiss);
+		  streamWriteRecord(streamID2, array, nmiss);
+		}
+     	    }
+	}
+       
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+ 
+  vlistDestroy(vlistID2);
+
+  if ( ! lcopy )
+    if ( array ) free(array);
+
+  if ( selfound ) free(selfound);
+
+  listDelete(ilist);
+  listDelete(flist);
+
+  cdoFinish();
+
+  return (NULL);
+}
diff --git a/src/Set.c b/src/Set.c
new file mode 100644
index 0000000..3c1a4a2
--- /dev/null
+++ b/src/Set.c
@@ -0,0 +1,209 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Set        setcode         Set code number
+      Set        setparam        Set parameter identifier
+      Set        setname         Set variable name
+      Set        setlevel        Set level
+      Set        setltype        Set GRIB level type
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+int stringToParam(const char *paramstr)
+{
+  int param = 0;
+  int pnum = -1, pcat = 255, pdis = 255;
+
+  sscanf(paramstr, "%d.%d.%d", &pnum, &pcat, &pdis);
+  
+  if ( cdoVerbose ) cdoPrint("pnum, pcat, pdis: %d.%d.%d", pnum, pcat, pdis);
+
+  param = cdiEncodeParam(pnum, pcat, pdis);
+
+  return (param);
+}
+
+
+void *Set(void *argument)
+{
+  int SETCODE, SETPARAM, SETNAME, SETUNIT, SETLEVEL, SETLTYPE, SETTABNUM;
+  int operatorID;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs, nvars, newval = -1, tabnum = 0;
+  int tsID1, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int nmiss;
+  int gridsize;
+  int index, zaxisID1, zaxisID2, nzaxis, nlevs;
+  int zaxistype;
+  int newparam    = 0;
+  char *newname   = NULL, *newunit = NULL;
+  double newlevel = 0;
+  double *levels  = NULL;
+  double *array   = NULL;
+
+  cdoInitialize(argument);
+
+  SETCODE    = cdoOperatorAdd("setcode",    0, 0, "code number");
+  SETPARAM   = cdoOperatorAdd("setparam",   0, 0, "parameter identifier (format: code[.tabnum] or num[.cat[.dis]])");
+  SETNAME    = cdoOperatorAdd("setname",    0, 0, "variable name");
+  SETUNIT    = cdoOperatorAdd("setunit",    0, 0, "variable unit");
+  SETLEVEL   = cdoOperatorAdd("setlevel",   0, 0, "level");
+  SETLTYPE   = cdoOperatorAdd("setltype",   0, 0, "GRIB level type");
+  SETTABNUM  = cdoOperatorAdd("settabnum",  0, 0, "GRIB table number");
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+  if ( operatorID == SETCODE || operatorID == SETLTYPE )
+    {
+      newval = atoi(operatorArgv()[0]);
+    }
+  else if ( operatorID == SETPARAM )
+    {
+      newparam = stringToParam(operatorArgv()[0]);
+    }
+  else if ( operatorID == SETNAME )
+    {
+      newname = operatorArgv()[0];
+    }
+  else if ( operatorID == SETUNIT )
+    {
+      newunit = operatorArgv()[0];
+    }
+  else if ( operatorID == SETTABNUM )
+    {
+      tabnum = atoi(operatorArgv()[0]);
+    }
+  else if ( operatorID == SETLEVEL )
+    {
+      newlevel = atof(operatorArgv()[0]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+  /* vlistPrint(vlistID2);*/
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  if ( operatorID == SETCODE )
+    {
+      nvars = vlistNvars(vlistID2);
+      for ( varID = 0; varID < nvars; varID++ )
+	vlistDefVarCode(vlistID2, varID, newval);
+    }
+  else if ( operatorID == SETPARAM )
+    {
+      vlistDefVarParam(vlistID2, 0, newparam);
+    }
+  else if ( operatorID == SETNAME )
+    {
+      vlistDefVarName(vlistID2, 0, newname);
+    }
+  else if ( operatorID == SETUNIT )
+    {
+      vlistDefVarUnits(vlistID2, 0, newunit);
+    }
+  else if ( operatorID == SETTABNUM )
+    {
+      int tableID;
+      tableID = tableDef(-1, tabnum, NULL);
+      nvars = vlistNvars(vlistID2);
+      for ( varID = 0; varID < nvars; varID++ )
+	vlistDefVarTable(vlistID2, varID, tableID);
+    }
+  else if ( operatorID == SETLEVEL )
+    {
+      nzaxis = vlistNzaxis(vlistID2);
+      for ( index = 0; index < nzaxis; index++ )
+	{
+	  zaxisID1 = vlistZaxis(vlistID2, index);
+	  zaxisID2 = zaxisDuplicate(zaxisID1);
+	  nlevs = zaxisInqSize(zaxisID2);
+	  levels = (double *) malloc(nlevs*sizeof(double));
+	  zaxisInqLevels(zaxisID2, levels);
+	  levels[0] = newlevel;
+	  zaxisDefLevels(zaxisID2, levels);
+	  vlistChangeZaxis(vlistID2, zaxisID1, zaxisID2);
+	  free(levels);
+	}
+    }
+  else if ( operatorID == SETLTYPE )
+    {
+      nzaxis = vlistNzaxis(vlistID2);
+      for ( index = 0; index < nzaxis; index++ )
+	{
+	  zaxisID1 = vlistZaxis(vlistID2, index);
+	  zaxisID2 = zaxisDuplicate(zaxisID1);
+
+	  zaxistype = ltype2ztype(newval);
+
+	  zaxisChangeType(zaxisID2, zaxistype);
+	  if ( zaxistype == ZAXIS_GENERIC ) zaxisDefLtype(zaxisID2, newval);
+	  vlistChangeZaxis(vlistID2, zaxisID1, zaxisID2);
+	}
+    }
+
+  /* vlistPrint(vlistID2);*/
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID1 = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID1)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID1);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  
+	  streamReadRecord(streamID1, array, &nmiss);
+	  streamWriteRecord(streamID2, array, nmiss);
+	}
+      tsID1++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Setbox.c b/src/Setbox.c
new file mode 100644
index 0000000..1816c1b
--- /dev/null
+++ b/src/Setbox.c
@@ -0,0 +1,294 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Setbox     setclonlatbox   Set lon/lat box to constant
+      Setbox     setcindexbox    Set index box to constant
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+void genlonlatbox(double xlon1, double xlon2, double xlat1, double xlat2,
+		  int nlon1, int nlat1, double *xvals1, double *yvals1,
+		  int *lat1, int *lat2, int *lon11, int *lon12, int *lon21, int *lon22);
+
+static
+void genlonlatgrid(int gridID1, int *lat1, int *lat2, int *lon11, int *lon12, int *lon21, int *lon22, double *constant)
+{
+  int nlon1, nlat1;
+  double *xvals1, *yvals1;
+  double xlon1, xlon2, xlat1, xlat2;
+
+  operatorCheckArgc(5);
+
+  *constant = atof(operatorArgv()[0]);
+  xlon1 = atof(operatorArgv()[1]);
+  xlon2 = atof(operatorArgv()[2]);
+  xlat1 = atof(operatorArgv()[3]);
+  xlat2 = atof(operatorArgv()[4]);
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  xvals1 = (double *) malloc(nlon1*sizeof(double));
+  yvals1 = (double *) malloc(nlat1*sizeof(double));
+
+  gridInqXvals(gridID1, xvals1);
+  gridInqYvals(gridID1, yvals1);
+
+  /* Convert lat/lon units if required */
+  {
+    char units[CDI_MAX_NAME];
+    gridInqXunits(gridID1, units);
+    gridToDegree(units, "grid center lon", nlon1, xvals1);
+    gridInqYunits(gridID1, units);
+    gridToDegree(units, "grid center lat", nlat1, yvals1);
+  }
+
+  genlonlatbox(xlon1, xlon2, xlat1, xlat2,
+	       nlon1, nlat1, xvals1, yvals1,
+	       lat1, lat2, lon11, lon12, lon21, lon22);
+
+  free(xvals1);
+  free(yvals1);
+}
+
+
+static
+void genindexbox(int gridID1, int *lat1, int *lat2, int *lon11, int *lon12, int *lon21, int *lon22, double *constant)
+{
+  int nlon1, nlat1;
+  int temp;
+
+  operatorCheckArgc(5);
+
+  *constant = atof(operatorArgv()[0]);
+  *lon11 = atoi(operatorArgv()[1]);
+  *lon12 = atoi(operatorArgv()[2]);
+  *lat1  = atoi(operatorArgv()[3]);
+  *lat2  = atoi(operatorArgv()[4]);
+
+  if ( *lat1 > *lat2 )
+    {
+      temp = *lat1;
+      *lat1 = *lat2;
+      *lat2 = temp;
+    }
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  if ( *lat1 < 1 )
+    {
+      cdoWarning("first latitude index out of range. Set to 1.");
+      *lat1 = 1;
+    }
+  if ( *lat2 > nlat1 )
+    {
+      cdoWarning("last latitude index out of range. Set to %d.", nlat1);
+      *lat2 = nlat1;
+    }
+  if ( *lon11 < 1 )
+    {
+      cdoWarning("first longitude index out of range. Set to 1.");
+      *lon11 = 1;
+    }
+  if ( *lon12 > nlon1+1 )
+    {
+      cdoWarning("last longitude index out of range. Set to %d.", nlon1);
+      *lon12 = nlon1;
+    }
+
+  (*lon11)--;
+  (*lon12)--;
+  (*lat1)--;
+  (*lat2)--;
+
+  if ( *lon11 > *lon12 )
+    {
+      *lon21 = *lon11;
+      *lon22 = nlon1 - 1;
+      *lon11 = 0;
+    }
+  else
+    {
+      if ( *lon12 > nlon1-1 )
+	{
+	  *lon21 = *lon11;
+	  *lon22 = nlon1 - 1;
+	  *lon11 = 0;
+	  *lon12 = 0;
+	}
+      else
+	{
+	  *lon21 = 0;
+	  *lon22 = -1;
+	}
+    }
+}
+
+
+static
+void setcbox(double constant, double *array, int gridID,
+	     int lat1, int lat2, int lon11, int lon12, int lon21, int lon22)
+{
+  int nlon, nlat;
+  int ilat, ilon;
+
+  nlon = gridInqXsize(gridID);
+  nlat = gridInqYsize(gridID);
+
+  for ( ilat = 0; ilat < nlat; ilat++ )
+    for ( ilon = 0; ilon < nlon; ilon++ )
+      if ( (lat1 <= ilat && ilat <= lat2 && 
+	    ((lon11 <= ilon && ilon <= lon12) || (lon21 <= ilon && ilon <= lon22))) ) {
+	array[nlon*ilat + ilon] = constant;
+      }
+}
+
+
+void *Setbox(void *argument)
+{
+  int SETCLONLATBOX, SETCINDEXBOX;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs, nvars;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2;
+  int gridID = -1;
+  int index, ngrids, gridtype;
+  int nmiss;
+  int *vars;
+  int i;
+  int ndiffgrids;
+  int lat1, lat2, lon11, lon12, lon21, lon22;
+  double missval;
+  double constant;
+  double *array;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  SETCLONLATBOX = cdoOperatorAdd("setclonlatbox", 0, 0, "constant, western and eastern longitude and southern and northern latitude");
+  SETCINDEXBOX  = cdoOperatorAdd("setcindexbox",  0, 0, "constant, index of first and last longitude and index of first and last latitude");
+
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  ngrids = vlistNgrids(vlistID1);
+  ndiffgrids = 0;
+  for ( index = 1; index < ngrids; index++ )
+    if ( vlistGrid(vlistID1, 0) != vlistGrid(vlistID1, index))
+      ndiffgrids++;
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID   = vlistGrid(vlistID1, index);
+      gridtype = gridInqType(gridID);
+      if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN ) break;
+      if ( operatorID == SETCINDEXBOX && gridtype == GRID_CURVILINEAR ) break;
+      if ( operatorID == SETCINDEXBOX && gridtype == GRID_GENERIC &&
+	   gridInqXsize(gridID) > 0 && gridInqYsize(gridID) > 0 ) break;
+    }
+
+  if ( gridInqType(gridID) == GRID_GAUSSIAN_REDUCED )
+    cdoAbort("Gaussian reduced grid found. Use option -R to convert it to a regular grid!");
+
+  if ( index == ngrids ) cdoAbort("No regular grid found!");
+  if ( ndiffgrids > 0 )  cdoAbort("Too many different grids!");
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  if ( operatorID == SETCLONLATBOX )
+    genlonlatgrid(gridID, &lat1, &lat2, &lon11, &lon12, &lon21, &lon22, &constant);
+  else
+    genindexbox(gridID, &lat1, &lat2, &lon11, &lon12, &lon21, &lon22, &constant);
+
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nvars = vlistNvars(vlistID1);
+  vars  = (int *) malloc(nvars*sizeof(int));
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( gridID == vlistInqVarGrid(vlistID1, varID) )
+	vars[varID] = TRUE;
+      else
+	vars[varID] = FALSE;
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = gridInqSize(gridID);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( vars[varID] )
+	    {
+	      streamReadRecord(streamID1, array, &nmiss);
+
+	      missval = vlistInqVarMissval(vlistID1, varID);
+	      setcbox(constant, array, gridID, lat1, lat2, lon11, lon12, lon21, lon22);
+
+	      nmiss = 0;
+	      for ( i = 0; i < gridsize; i++ )
+		if ( DBL_IS_EQUAL(array[i], missval) ) nmiss++;
+
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, array, nmiss);
+	    }
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( vars  ) free(vars);
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Setgatt.c b/src/Setgatt.c
new file mode 100644
index 0000000..ae8e8b5
--- /dev/null
+++ b/src/Setgatt.c
@@ -0,0 +1,152 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Setgatt    setgatt         Set global attribute
+      Setgatt    setgatts        Set global attributes
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Setgatt(void *argument)
+{
+  int SETGATT, SETGATTS;
+  int operatorID;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int gridsize;
+  int nmiss;
+  char *attname = NULL, *attstring = NULL, *attfile = NULL;
+  double *array = NULL;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  SETGATT  = cdoOperatorAdd("setgatt",  0, 0, "attribute name and string");
+  SETGATTS = cdoOperatorAdd("setgatts", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == SETGATT )
+    {
+      operatorInputArg(cdoOperatorEnter(operatorID));
+      attname   = operatorArgv()[0];
+      attstring = operatorArgv()[1];
+    }
+  else
+    {
+      attfile   = operatorArgv()[0];
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  if ( operatorID == SETGATT )
+    {
+      vlistDefAttTxt(vlistID2, CDI_GLOBAL, attname, (int)strlen(attstring), attstring);
+    }
+  else
+    {
+      char line[1024];
+      FILE *fp;
+      int attlen = 0;
+
+      fp = fopen(attfile, "r");
+      if ( fp == 0 ) cdoAbort("Open failed on %s", attfile);
+
+      while ( readline(fp, line, 1024) )
+	{
+	  attlen = 0;
+	  if ( line[0] == '#' ) continue;
+	  if ( line[0] == '\0' ) continue;
+	  attname = line;
+	  while ( isspace((int) *attname) ) attname++;
+	  if ( attname[0] == '\0' ) continue;
+	  attstring = attname;
+	  while ( *attstring != ' ' && *attstring != '\0' &&
+		  *attstring != '=' && *attstring != '"' ) attstring++;
+	  if ( *attstring == '\0' )
+	    attstring = NULL;
+	  else
+	    {
+	      *attstring = '\0';
+	      attstring++;
+	      while ( isspace((int) *attstring) || (int) *attstring == '=' ||
+		      (int) *attstring == '"' || (int) *attstring == '\'' ) attstring++;
+	      attlen = strlen(attstring);
+	      if ( attstring[attlen-1] == '"' || attstring[attlen-1] == '\'' )
+		attstring[--attlen] = 0;
+	    }
+
+	  if ( attstring && attlen)
+	    vlistDefAttTxt(vlistID2, CDI_GLOBAL, attname, attlen, attstring);
+	}
+
+      fclose(fp);
+    }
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  
+	  streamReadRecord(streamID1, array, &nmiss);
+	  streamWriteRecord(streamID2, array, nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Setgrid.c b/src/Setgrid.c
new file mode 100644
index 0000000..c41d298
--- /dev/null
+++ b/src/Setgrid.c
@@ -0,0 +1,390 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Setgrid    setgrid         Set grid
+      Setgrid    setgridtype     Set grid type
+      Setgrid    setgridarea     Set grid area
+      Setgrid    setgridmask     Set grid mask
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+void *Setgrid(void *argument)
+{
+  int SETGRID, SETGRIDTYPE, SETGRIDAREA, SETGRIDMASK, UNSETGRIDMASK, SETGRIDNUMBER;
+  int operatorID;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int gridID1, gridID2 = -1;
+  int ngrids, index;
+  int gridtype = -1;
+  int nmiss;
+  int found;
+  long i, gridsize;
+  long areasize = 0;
+  long masksize = 0;
+  int lregular = 0;
+  int ligme = 0;
+  int number = 0, position = 0;
+  int grid2_nvgp;
+  int *grid2_vgpm = NULL;
+  char *gridname = NULL;
+  double *gridmask = NULL;
+  double *areaweight = NULL;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  SETGRID       = cdoOperatorAdd("setgrid",       0, 0, "grid description file or name");
+  SETGRIDTYPE   = cdoOperatorAdd("setgridtype",   0, 0, "grid type");
+  SETGRIDAREA   = cdoOperatorAdd("setgridarea",   0, 0, "filename with area weights");
+  SETGRIDMASK   = cdoOperatorAdd("setgridmask",   0, 0, "filename with grid mask");
+  UNSETGRIDMASK = cdoOperatorAdd("unsetgridmask", 0, 0, NULL);
+  SETGRIDNUMBER = cdoOperatorAdd("setgridnumber", 0, 0, "grid number and optionally grid position");
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID != UNSETGRIDMASK )
+    operatorInputArg(cdoOperatorEnter(operatorID));  
+
+  if ( operatorID == SETGRID )
+    {
+      operatorCheckArgc(1);
+      gridID2 = cdoDefineGrid(operatorArgv()[0]);
+    }
+  else if ( operatorID == SETGRIDTYPE )
+    {
+      operatorCheckArgc(1);
+      gridname = operatorArgv()[0];
+
+      if      ( strcmp(gridname, "curvilinear") == 0 )   gridtype = GRID_CURVILINEAR;
+      else if ( strcmp(gridname, "cell") == 0 )          gridtype = GRID_UNSTRUCTURED;
+      else if ( strcmp(gridname, "unstructured") == 0 )  gridtype = GRID_UNSTRUCTURED;
+      else if ( strcmp(gridname, "dereference") == 0 )   gridtype = GRID_REFERENCE;
+      else if ( strcmp(gridname, "lonlat") == 0 )        gridtype = GRID_LONLAT;
+      else if ( strcmp(gridname, "gaussian") == 0 )      gridtype = GRID_GAUSSIAN;
+      else if ( strcmp(gridname, "regular") == 0 )      {gridtype = GRID_GAUSSIAN; lregular = 1;}
+      else cdoAbort("Unsupported grid name: %s", gridname);
+    }
+  else if ( operatorID == SETGRIDAREA )
+    {
+      int streamID, vlistID, gridID;
+      char *areafile;
+
+      operatorCheckArgc(1);
+      areafile = operatorArgv()[0];
+
+      streamID = streamOpenRead(areafile);
+
+      vlistID = streamInqVlist(streamID);
+
+      nrecs = streamInqTimestep(streamID, 0);
+      streamInqRecord(streamID, &varID, &levelID);
+
+      gridID = vlistInqVarGrid(vlistID, varID);
+      areasize = gridInqSize(gridID);
+      areaweight = (double *) malloc(areasize*sizeof(double));
+  
+      streamReadRecord(streamID, areaweight, &nmiss);
+
+      streamClose(streamID);
+
+      if ( cdoVerbose )
+	{
+	  double arrmean, arrmin, arrmax;
+
+	  arrmean = areaweight[0];
+	  arrmin  = areaweight[0];
+	  arrmax  = areaweight[0];
+	  for ( i = 1; i < areasize; i++ )
+	    {
+	      if ( areaweight[i] < arrmin ) arrmin = areaweight[i];
+	      if ( areaweight[i] > arrmax ) arrmax = areaweight[i];
+	      arrmean += areaweight[i];
+	    }
+	  arrmean = arrmean/areasize;
+
+	  cdoPrint("areaweights: %d %#12.5g%#12.5g%#12.5g", areasize, arrmin, arrmean, arrmax);
+	}
+    }
+  else if ( operatorID == SETGRIDMASK )
+    {
+      int streamID, vlistID, gridID;
+      char *maskfile;
+      double missval;
+
+      operatorCheckArgc(1);
+      maskfile = operatorArgv()[0];
+      streamID = streamOpenRead(maskfile);
+
+      vlistID = streamInqVlist(streamID);
+
+      nrecs = streamInqTimestep(streamID, 0);
+      streamInqRecord(streamID, &varID, &levelID);
+
+      missval  = vlistInqVarMissval(vlistID, varID);
+      gridID   = vlistInqVarGrid(vlistID, varID);
+      masksize = gridInqSize(gridID);
+      gridmask = (double *) malloc(masksize*sizeof(double));
+  
+      streamReadRecord(streamID, gridmask, &nmiss);
+
+      streamClose(streamID);
+
+      for ( i = 0; i < masksize; i++ )
+	if ( DBL_IS_EQUAL(gridmask[i], missval) ) gridmask[i] = 0;
+    }
+  else if ( operatorID == SETGRIDNUMBER )
+    {
+      if ( operatorArgc() >= 1 && operatorArgc() <= 2 )
+	{
+	  number = atoi(operatorArgv()[0]);
+	  if ( operatorArgc() == 2 ) position = atoi(operatorArgv()[1]);
+	}
+      else
+	{
+	  operatorCheckArgc(1);
+	}
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  if ( operatorID == SETGRID )
+    {
+      found = 0;
+      ngrids = vlistNgrids(vlistID1);
+      for ( index = 0; index < ngrids; index++ )
+	{
+	  gridID1 = vlistGrid(vlistID1, index);
+
+	  if ( gridInqSize(gridID1) == gridInqSize(gridID2) )
+	    {
+	      vlistChangeGridIndex(vlistID2, index, gridID2);
+	      found++;
+	    }
+	}
+      if ( ! found ) cdoWarning("No grid with %d points found!", gridInqSize(gridID2));
+    }
+  else if ( operatorID == SETGRIDNUMBER )
+    {
+      gridID1 = vlistGrid(vlistID1, 0);
+      gridID2 = gridCreate(GRID_REFERENCE, gridInqSize(gridID1));
+      gridDefNumber(gridID2, number);
+      gridDefPosition(gridID2, position);
+
+      found = 0;
+      ngrids = vlistNgrids(vlistID1);
+      for ( index = 0; index < ngrids; index++ )
+	{
+	  gridID1 = vlistGrid(vlistID1, index);
+
+	  if ( gridInqSize(gridID1) == gridInqSize(gridID2) )
+	    {
+	      vlistChangeGridIndex(vlistID2, index, gridID2);
+	      found++;
+	    }
+	}
+      if ( ! found ) cdoWarning("No grid with %d points found!", gridInqSize(gridID2));
+    }
+  else if ( operatorID == SETGRIDTYPE )
+    {
+      ngrids = vlistNgrids(vlistID1);
+      for ( index = 0; index < ngrids; index++ )
+	{
+	  gridID1 = vlistGrid(vlistID1, index);
+	  gridID2 = -1;
+
+	  if ( lregular )
+	    {
+	      if ( gridInqType(gridID1) == GRID_GAUSSIAN_REDUCED )
+		{
+		  gridID2 = gridToRegular(gridID1);
+		}
+	    }
+	  else
+	    {
+	      if      ( gridtype == GRID_CURVILINEAR  )
+		{
+		  gridID2 = gridToCurvilinear(gridID1, 1);
+		}
+	      else if ( gridtype == GRID_UNSTRUCTURED )
+		{
+		  if ( gridInqType(gridID1) == GRID_GME ) ligme = 1;
+		  gridID2 = gridToUnstructured(gridID1, 1);
+
+		  if ( ligme )
+		    {
+		      grid2_nvgp = gridInqSize(gridID2);
+		      grid2_vgpm = (int *) malloc(grid2_nvgp*sizeof(int));
+		      gridInqMaskGME(gridID2, grid2_vgpm);
+		      gridCompress(gridID2);
+		    }
+		}
+	      else if ( gridtype == GRID_REFERENCE    )
+		{
+		  gridID2 = referenceToGrid(gridID1);
+		  if ( gridID2 == -1 ) cdoAbort("Grid reference not found!");
+ 		}
+	      else if ( gridtype == GRID_LONLAT && gridInqType(gridID1) == GRID_CURVILINEAR )
+		{
+		  gridID2 = gridCurvilinearToRegular(gridID1);
+		  if ( gridID2 == -1 ) cdoAbort("No regular grid found!");
+ 		}
+	      else if ( gridtype == GRID_LONLAT && gridInqType(gridID1) == GRID_LONLAT )
+		{
+		  gridID2 = gridID1;
+		}
+	      else cdoAbort("Unsupported grid name: %s", gridname);
+	    }
+
+	  if ( gridID2 == -1 ) cdoAbort("Unsupported grid type!");
+
+	  vlistChangeGridIndex(vlistID2, index, gridID2);
+	}
+    }
+  else if ( operatorID == SETGRIDAREA )
+    {
+      ngrids = vlistNgrids(vlistID1);
+      for ( index = 0; index < ngrids; index++ )
+	{
+	  gridID1  = vlistGrid(vlistID1, index);
+	  gridsize = gridInqSize(gridID1);
+	  if ( gridsize == areasize )
+	    {
+	      gridID2 = gridDuplicate(gridID1);
+	      gridDefArea(gridID2, areaweight);
+	      vlistChangeGridIndex(vlistID2, index, gridID2);
+	    }
+	}
+    }
+  else if ( operatorID == SETGRIDMASK )
+    {
+      ngrids = vlistNgrids(vlistID1);
+      for ( index = 0; index < ngrids; index++ )
+	{
+	  gridID1  = vlistGrid(vlistID1, index);
+	  gridsize = gridInqSize(gridID1);
+	  if ( gridsize == masksize )
+	    {
+	      int *mask;
+	      mask = (int *) malloc(masksize*sizeof(int));
+	      for ( i = 0; i < masksize; i++ )
+		{
+		  if ( gridmask[i] < 0 || gridmask[i] > 255 )
+		    mask[i] = 0;
+		  else
+		    mask[i] = NINT(gridmask[i]);
+		}
+	      gridID2 = gridDuplicate(gridID1);
+	      gridDefMask(gridID2, mask);
+	      vlistChangeGridIndex(vlistID2, index, gridID2);
+	      free(mask);
+	    }
+	}
+    }
+  else if ( operatorID == UNSETGRIDMASK )
+    {
+      ngrids = vlistNgrids(vlistID1);
+      for ( index = 0; index < ngrids; index++ )
+	{
+	  gridID1  = vlistGrid(vlistID1, index);
+	  gridID2 = gridDuplicate(gridID1);
+	  gridDefMask(gridID2, NULL);
+	  vlistChangeGridIndex(vlistID2, index, gridID2);
+	}
+    }
+
+  streamDefVlist(streamID2, vlistID2);
+  //vlistPrint(vlistID2);
+
+  if ( lregular )
+    gridsize = vlistGridsizeMax(vlistID2);
+  else
+    gridsize = vlistGridsizeMax(vlistID1);
+
+  if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  
+	  streamReadRecord(streamID1, array, &nmiss);
+
+	  gridID1 = vlistInqVarGrid(vlistID1, varID);
+	  if ( lregular )
+	    {
+	      gridID2 = vlistInqVarGrid(vlistID2, varID);
+	      if ( gridInqType(gridID1) == GRID_GAUSSIAN_REDUCED )
+		{
+		  double missval = vlistInqVarMissval(vlistID1, varID);
+		  field2regular(gridID1, gridID2, missval, array, nmiss);
+		}
+	    }
+	  else if ( gridInqType(gridID1) == GRID_GME )
+	    {
+	      int j = 0;
+	      gridsize = gridInqSize(gridID1);
+	      for ( i = 0; i < gridsize; i++ )
+		if ( grid2_vgpm[i] ) array[j++] = array[i];
+	    }
+
+	  streamWriteRecord(streamID2, array, nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( gridmask ) free(gridmask);
+  if ( areaweight ) free(areaweight);
+  if ( array ) free(array);
+  if ( grid2_vgpm ) free(grid2_vgpm);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Sethalo.c b/src/Sethalo.c
new file mode 100644
index 0000000..3aefe6c
--- /dev/null
+++ b/src/Sethalo.c
@@ -0,0 +1,614 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+static
+int gentpngrid(int gridID1)
+{
+  int gridtype, gridID2;
+  int nlon1, nlat1;
+  int nlon2, nlat2;
+  int prec;
+  int ilat, ilon, ilonr, k, kr;
+  char xname[CDI_MAX_NAME], xlongname[CDI_MAX_NAME], xunits[CDI_MAX_NAME];
+  char yname[CDI_MAX_NAME], ylongname[CDI_MAX_NAME], yunits[CDI_MAX_NAME];
+  double *xvals1 = NULL, *yvals1 = NULL;
+  double *xvals2 = NULL, *yvals2 = NULL;
+  double *xbounds1 = NULL, *ybounds1 = NULL;
+  double *xbounds2 = NULL, *ybounds2 = NULL;
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  nlon2 = nlon1;
+  nlat2 = nlat1+2;
+
+  gridtype = gridInqType(gridID1);
+  prec     = gridInqPrec(gridID1);
+
+  gridID2 = gridCreate(gridtype, nlon2*nlat2);
+  gridDefXsize(gridID2, nlon2);
+  gridDefYsize(gridID2, nlat2);
+
+  gridDefPrec(gridID2, prec);
+
+  gridInqXname(gridID1, xname);
+  gridInqXlongname(gridID1, xlongname);
+  gridInqXunits(gridID1, xunits);
+  gridInqYname(gridID1, yname);
+  gridInqYlongname(gridID1, ylongname);
+  gridInqYunits(gridID1, yunits);
+
+  gridDefXname(gridID2, xname);
+  gridDefXlongname(gridID2, xlongname);
+  gridDefXunits(gridID2, xunits);
+  gridDefYname(gridID2, yname);
+  gridDefYlongname(gridID2, ylongname);
+  gridDefYunits(gridID2, yunits);
+	
+  if ( gridInqXvals(gridID1, NULL) && gridInqYvals(gridID1, NULL) )
+    {
+      if ( gridtype == GRID_CURVILINEAR )
+	{
+	  xvals1 = (double *) malloc(nlon1*nlat1*sizeof(double));
+	  yvals1 = (double *) malloc(nlon1*nlat1*sizeof(double));
+	  xvals2 = (double *) malloc(nlon2*nlat2*sizeof(double));
+	  yvals2 = (double *) malloc(nlon2*nlat2*sizeof(double));
+
+	  gridInqXvals(gridID1, xvals1);
+	  gridInqYvals(gridID1, yvals1);
+
+	  for ( ilat = 0; ilat < nlat1; ilat++ )
+	    {
+	      for ( ilon = 0; ilon < nlon1; ilon++ )
+		{
+		  xvals2[(ilat+2)*nlon1 + ilon] = xvals1[ilat*nlon1 + ilon];
+		  yvals2[(ilat+2)*nlon1 + ilon] = yvals1[ilat*nlon1 + ilon];
+		}
+	    }
+
+	  for ( ilon = 0; ilon < nlon1; ilon++ )
+	    {
+	      ilonr = nlon1 - ilon - 1;
+	      xvals2[1*nlon1 + ilon] = xvals2[2*nlon1 + ilonr]; /* syncronise line 2 with line 3 */
+	      xvals2[0*nlon1 + ilon] = xvals2[3*nlon1 + ilonr]; /* syncronise line 1 with line 4 */
+	      yvals2[1*nlon1 + ilon] = yvals2[2*nlon1 + ilonr]; /* syncronise line 2 with line 3 */
+	      yvals2[0*nlon1 + ilon] = yvals2[3*nlon1 + ilonr]; /* syncronise line 1 with line 4 */
+	    }	
+	  
+	  gridDefXvals(gridID2, xvals2);
+	  gridDefYvals(gridID2, yvals2);
+	  
+	  free(xvals1);
+	  free(yvals1);
+	  free(xvals2);
+	  free(yvals2);
+	}
+    }
+
+  if ( gridInqXbounds(gridID1, NULL) && gridInqYbounds(gridID1, NULL) )
+    {
+      if ( gridtype == GRID_CURVILINEAR )
+	{
+	  xbounds1 = (double *) malloc(4*nlon1*nlat1*sizeof(double));
+	  ybounds1 = (double *) malloc(4*nlon1*nlat1*sizeof(double));
+	  xbounds2 = (double *) malloc(4*nlon2*nlat2*sizeof(double));
+	  ybounds2 = (double *) malloc(4*nlon2*nlat2*sizeof(double));
+
+	  gridInqXbounds(gridID1, xbounds1);
+	  gridInqYbounds(gridID1, ybounds1);
+
+	  if ( gridtype == GRID_CURVILINEAR )
+	    {
+	      gridDefNvertex(gridID2, 4);
+
+	      for ( ilat = 0; ilat < nlat1; ilat++ )
+		{
+		  for ( ilon = 0; ilon < 4*nlon1; ilon++ )
+		    {
+		      xbounds2[4*(ilat+2)*nlon1 + ilon] = xbounds1[4*ilat*nlon1 + ilon];
+		      ybounds2[4*(ilat+2)*nlon1 + ilon] = ybounds1[4*ilat*nlon1 + ilon];
+		    }
+		}
+
+	      for ( ilon = 0; ilon < nlon1; ilon++ )
+		{
+		  ilonr = nlon1 - ilon - 1;
+		  for ( k = 0; k < 4; ++k )
+		    {
+		      kr = 3 - k;
+		      xbounds2[4*1*nlon1 + 4*ilon + k] = xbounds2[4*2*nlon1 + 4*ilonr + kr];
+		      xbounds2[4*0*nlon1 + 4*ilon + k] = xbounds2[4*3*nlon1 + 4*ilonr + kr];
+		      ybounds2[4*1*nlon1 + 4*ilon + k] = ybounds2[4*2*nlon1 + 4*ilonr + kr];
+		      ybounds2[4*0*nlon1 + 4*ilon + k] = ybounds2[4*3*nlon1 + 4*ilonr + kr];
+		    }
+		}	
+	      /*
+	      for ( ilon = 0; ilon < 4*nlon1; ilon++ )
+		{
+		  ilonr = 4*nlon1 - ilon - 1;
+		    {
+		      xbounds2[4*1*nlon1 + ilon ] = xbounds2[4*2*nlon1 + ilonr ];
+		      xbounds2[4*0*nlon1 + ilon ] = xbounds2[4*3*nlon1 + ilonr ];
+		      ybounds2[4*1*nlon1 + ilon ] = ybounds2[4*2*nlon1 + ilonr ];
+		      ybounds2[4*0*nlon1 + ilon ] = ybounds2[4*3*nlon1 + ilonr ]; 
+		    }
+		}
+	      */	
+	    }
+
+	  gridDefXbounds(gridID2, xbounds2);
+	  gridDefYbounds(gridID2, ybounds2);
+
+	  free(xbounds1);
+	  free(ybounds1);
+	  free(xbounds2);
+	  free(ybounds2);
+	}
+    }
+
+  return (gridID2);
+}
+
+static
+int gengrid(int gridID1, int lhalo, int rhalo)
+{
+  int gridtype, gridID2;
+  int nlon1, nlat1;
+  int nlon2, nlat2;
+  int nmin, nmax;
+  int i;
+  int prec;
+  int ilat, ilon;
+  char xname[CDI_MAX_NAME], xlongname[CDI_MAX_NAME], xunits[CDI_MAX_NAME];
+  char yname[CDI_MAX_NAME], ylongname[CDI_MAX_NAME], yunits[CDI_MAX_NAME];
+  double *xvals1 = NULL, *yvals1 = NULL;
+  double *xvals2 = NULL, *yvals2 = NULL;
+  double *xbounds1 = NULL, *ybounds1 = NULL;
+  double *xbounds2 = NULL, *ybounds2 = NULL;
+  double *pxvals2 = NULL, *pyvals2 = NULL;
+  double *pxbounds2 = NULL, *pybounds2 = NULL;
+  double cpi2 = M_PI*2;
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+
+  nlon2 = nlon1 + lhalo + rhalo;
+  nlat2 = nlat1;
+
+  nmin = 0;
+  nmax = nlon1;
+  if ( lhalo < 0 ) nmin  = -lhalo;
+  if ( rhalo < 0 ) nmax +=  rhalo;
+  /*
+  printf("nlon1=%d, nlon2=%d, lhalo=%d, rhalo=%d nmin=%d, nmax=%d\n",
+	 nlon1, nlon2, lhalo, rhalo, nmin, nmax);
+  */
+  gridtype = gridInqType(gridID1);
+  prec     = gridInqPrec(gridID1);
+
+  gridID2 = gridCreate(gridtype, nlon2*nlat2);
+  gridDefXsize(gridID2, nlon2);
+  gridDefYsize(gridID2, nlat2);
+
+  gridDefPrec(gridID2, prec);
+
+  gridInqXname(gridID1, xname);
+  gridInqXlongname(gridID1, xlongname);
+  gridInqXunits(gridID1, xunits);
+  gridInqYname(gridID1, yname);
+  gridInqYlongname(gridID1, ylongname);
+  gridInqYunits(gridID1, yunits);
+
+  gridDefXname(gridID2, xname);
+  gridDefXlongname(gridID2, xlongname);
+  gridDefXunits(gridID2, xunits);
+  gridDefYname(gridID2, yname);
+  gridDefYlongname(gridID2, ylongname);
+  gridDefYunits(gridID2, yunits);
+
+  if ( memcmp(xunits, "degree", 6) == 0 ) cpi2 *= rad2deg;
+
+  if ( gridInqXvals(gridID1, NULL) && gridInqYvals(gridID1, NULL) )
+    {
+      if ( gridtype == GRID_CURVILINEAR )
+	{
+	  xvals1 = (double *) malloc(nlon1*nlat1*sizeof(double));
+	  yvals1 = (double *) malloc(nlon1*nlat1*sizeof(double));
+	  xvals2 = (double *) malloc(nlon2*nlat2*sizeof(double));
+	  yvals2 = (double *) malloc(nlon2*nlat2*sizeof(double));
+	}
+      else
+	{
+	  xvals1 = (double *) malloc(nlon1*sizeof(double));
+	  yvals1 = (double *) malloc(nlat1*sizeof(double));
+	  xvals2 = (double *) malloc(nlon2*sizeof(double));
+	  yvals2 = (double *) malloc(nlat2*sizeof(double));
+	}
+
+      pxvals2 = xvals2;
+      pyvals2 = yvals2;
+
+      gridInqXvals(gridID1, xvals1);
+      gridInqYvals(gridID1, yvals1);
+
+      if ( gridtype == GRID_CURVILINEAR )
+	{
+	  for ( ilat = 0; ilat < nlat2; ilat++ )
+	    {
+	      for ( ilon = nlon1-lhalo; ilon < nlon1; ilon++ )
+		{
+		  *pxvals2++ = xvals1[ilat*nlon1 + ilon];
+		  *pyvals2++ = yvals1[ilat*nlon1 + ilon];
+		}
+
+	      for ( ilon = nmin; ilon < nmax; ilon++ )
+		{
+		  *pxvals2++ = xvals1[ilat*nlon1 + ilon];
+		  *pyvals2++ = yvals1[ilat*nlon1 + ilon];
+		}
+
+	      for ( ilon = 0; ilon < rhalo; ilon++ )
+		{
+		  *pxvals2++ = xvals1[ilat*nlon1 + ilon];
+		  *pyvals2++ = yvals1[ilat*nlon1 + ilon];
+		}
+	    }
+	}
+      else
+	{
+	  for ( i = nlon1-lhalo; i < nlon1; i++ ) *pxvals2++ = xvals1[i] - cpi2;
+	  for ( i = nmin; i < nmax; i++ ) *pxvals2++ = xvals1[i];
+	  for ( i = 0; i < rhalo; i++ ) *pxvals2++ = xvals1[i] + cpi2;
+
+	  for ( i = 0; i < nlat1; i++ ) yvals2[i] = yvals1[i];
+	}
+      /*
+      for ( i = 0; i < nlat2; i++ ) printf("lat : %d %g\n", i+1, yvals2[i]);
+      for ( i = 0; i < nlon2; i++ ) printf("lon : %d %g\n", i+1, xvals2[i]);
+      */
+      gridDefXvals(gridID2, xvals2);
+      gridDefYvals(gridID2, yvals2);
+
+      free(xvals1);
+      free(yvals1);
+      free(xvals2);
+      free(yvals2);
+    }
+
+  if ( gridInqXbounds(gridID1, NULL) && gridInqYbounds(gridID1, NULL) )
+    {
+      if ( gridtype == GRID_CURVILINEAR )
+	{
+	  xbounds1 = (double *) malloc(4*nlon1*nlat1*sizeof(double));
+	  ybounds1 = (double *) malloc(4*nlon1*nlat1*sizeof(double));
+	  xbounds2 = (double *) malloc(4*nlon2*nlat2*sizeof(double));
+	  ybounds2 = (double *) malloc(4*nlon2*nlat2*sizeof(double));
+	}
+      else
+	{
+	  xbounds1 = (double *) malloc(2*nlon1*sizeof(double));
+	  ybounds1 = (double *) malloc(2*nlat1*sizeof(double));
+	  xbounds2 = (double *) malloc(2*nlon2*sizeof(double));
+	  ybounds2 = (double *) malloc(2*nlat2*sizeof(double));
+	}
+
+      pxbounds2 = xbounds2;
+      pybounds2 = ybounds2;
+
+      gridInqXbounds(gridID1, xbounds1);
+      gridInqYbounds(gridID1, ybounds1);
+
+      if ( gridtype == GRID_CURVILINEAR )
+	{
+	  gridDefNvertex(gridID2, 4);
+	  for ( ilat = 0; ilat < nlat1; ilat++ )
+	    {
+	      for ( ilon = 4*(nlon1-lhalo); ilon < 4*nlon1; ilon++ )
+		{
+		  *pxbounds2++ = xbounds1[4*ilat*nlon1 + ilon];
+		  *pybounds2++ = ybounds1[4*ilat*nlon1 + ilon];
+		}
+
+	      for ( ilon = 4*nmin; ilon < 4*nmax; ilon++ )
+		{
+		  *pxbounds2++ = xbounds1[4*ilat*nlon1 + ilon];
+		  *pybounds2++ = ybounds1[4*ilat*nlon1 + ilon];
+		}
+
+	      for ( ilon = 0; ilon < 4*rhalo; ilon++ )
+		{
+		  *pxbounds2++ = xbounds1[4*ilat*nlon1 + ilon];
+		  *pybounds2++ = ybounds1[4*ilat*nlon1 + ilon];
+		}
+	    }
+	}
+      else
+	{
+	  gridDefNvertex(gridID2, 2);
+	  for ( i = 2*(nlon1-lhalo); i < 2*nlon1; i++ ) *pxbounds2++ = xbounds1[i] - cpi2;
+	  for ( i = 2*nmin; i < 2*nmax; i++ ) *pxbounds2++ = xbounds1[i];
+	  for ( i = 0; i < 2*rhalo; i++ ) *pxbounds2++ = xbounds1[i] + cpi2;
+
+	  for ( i = 0; i < 2*nlat2; i++ ) ybounds2[i] = ybounds1[i];
+	}
+
+      gridDefXbounds(gridID2, xbounds2);
+      gridDefYbounds(gridID2, ybounds2);
+
+      free(xbounds1);
+      free(ybounds1);
+      free(xbounds2);
+      free(ybounds2);
+    }
+
+  return (gridID2);
+}
+
+
+static
+int genindexgrid(int gridID1, int *lhalo, int *rhalo)
+{
+  int gridID2;
+  int nlon1;
+
+  operatorCheckArgc(2);
+
+  *lhalo = atoi(operatorArgv()[0]);
+  *rhalo = atoi(operatorArgv()[1]);
+
+  nlon1 = gridInqXsize(gridID1);
+
+  if ( *lhalo > nlon1 )
+    {
+      *lhalo = nlon1;
+      cdoWarning("left halo out of range. Set to %d.", *lhalo);
+    }
+
+  if ( *lhalo < 0 && -(*lhalo) > nlon1/2 )
+    {
+      *lhalo = -nlon1/2;
+      cdoWarning("left halo out of range. Set to %d.", *lhalo);
+    }
+
+  if ( *rhalo > nlon1 )
+    {
+      *rhalo = nlon1;
+      cdoWarning("right halo out of range. Set to %d.", rhalo);
+    }
+
+  if ( *rhalo < 0 && -(*rhalo) > nlon1/2 )
+    {
+      *rhalo = -nlon1/2;
+      cdoWarning("right halo out of range. Set to %d.", rhalo);
+    }
+
+  gridID2 = gengrid(gridID1, *lhalo, *rhalo);
+
+  return (gridID2);
+}
+
+
+static
+void halo(double *array1, int gridID1, double *array2, int lhalo, int rhalo)
+{
+  int nlon1, nlat;
+  int ilat, ilon;
+  int nmin, nmax;
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat  = gridInqYsize(gridID1);
+
+  nmin = 0;
+  nmax = nlon1;
+  if ( lhalo < 0 ) nmin  = -lhalo;
+  if ( rhalo < 0 ) nmax +=  rhalo;
+
+  for ( ilat = 0; ilat < nlat; ilat++ )
+    {
+      for ( ilon = nlon1-lhalo; ilon < nlon1; ilon++ )
+	*array2++ = array1[ilat*nlon1 + ilon];
+
+      for ( ilon = nmin; ilon < nmax; ilon++ )
+	*array2++ = array1[ilat*nlon1 + ilon];
+
+      for ( ilon = 0; ilon < rhalo; ilon++ )
+	*array2++ = array1[ilat*nlon1 + ilon];
+    }
+}
+
+
+static
+void tpnhalo(double *array1, int gridID1, double *array2)
+{
+  int nlon, nlat;
+  int ilat, ilon, ilonr;
+
+  nlon = gridInqXsize(gridID1);
+  nlat = gridInqYsize(gridID1);
+
+  for ( ilat = 0; ilat < nlat; ilat++ )
+    {
+      for ( ilon = 0; ilon < nlon; ilon++ )
+	array2[(ilat+2)*nlon + ilon] = array1[ilat*nlon + ilon];
+    }
+
+  for ( ilon = 0; ilon < nlon; ilon++ )
+    {
+      ilonr = nlon - ilon - 1;
+      array2[1*nlon + ilon] = array2[2*nlon + ilonr]; /* syncronise line 2 with line 3 */
+      array2[0*nlon + ilon] = array2[3*nlon + ilonr]; /* syncronise line 1 with line 4 */
+    }
+}
+
+
+void *Sethalo(void *argument)
+{
+  int SETHALO, TPNHALO;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs, nvars;
+  int tsID, recID, varID, levelID;
+  int gridsize, gridsize2;
+  int vlistID1, vlistID2;
+  int gridID1 = -1, gridID2;
+  int index, ngrids, gridtype;
+  int nmiss;
+  int *vars;
+  int i;
+  int lhalo = 0, rhalo = 0;
+  int ndiffgrids;
+  double missval;
+  double *array1 = NULL, *array2 = NULL;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  SETHALO = cdoOperatorAdd("sethalo", 0, 0, NULL);
+  TPNHALO = cdoOperatorAdd("tpnhalo", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  ngrids = vlistNgrids(vlistID1);
+  ndiffgrids = 0;
+  for ( index = 1; index < ngrids; index++ )
+    if ( vlistGrid(vlistID1, 0) != vlistGrid(vlistID1, index))
+      ndiffgrids++;
+
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID1  = vlistGrid(vlistID1, index);
+      gridtype = gridInqType(gridID1);
+      if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN ) break;
+      if ( gridtype == GRID_CURVILINEAR ) break;
+      if ( gridtype == GRID_GENERIC &&
+	   gridInqXsize(gridID1) > 0 && gridInqYsize(gridID1) > 0 ) break;
+    }
+
+  if ( gridInqType(gridID1) == GRID_GAUSSIAN_REDUCED )
+    cdoAbort("Gaussian reduced grid found. Use option -R to convert it to a regular grid!");
+
+  if ( index == ngrids ) cdoAbort("No regular grid found!");
+  if ( ndiffgrids > 0 )  cdoAbort("Too many different grids!");
+
+  if ( operatorID == SETHALO )
+    {
+      operatorInputArg("left and right halo");
+      gridID2 = genindexgrid(gridID1, &lhalo, &rhalo);
+    }
+  else
+    {
+      gridID2 = gentpngrid(gridID1);
+    }
+
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids = vlistNgrids(vlistID1);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( gridID1 == vlistGrid(vlistID1, index) )
+	{
+	  vlistChangeGridIndex(vlistID2, index, gridID2);
+	  break;
+	}
+    }
+
+  nvars = vlistNvars(vlistID1);
+  vars  = (int *) malloc(nvars*sizeof(int));
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( gridID1 == vlistInqVarGrid(vlistID1, varID) )
+	vars[varID] = TRUE;
+      else
+	vars[varID] = FALSE;
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = gridInqSize(gridID1);
+  array1 = (double *) malloc(gridsize*sizeof(double));
+
+  gridsize2 = gridInqSize(gridID2);
+  array2 = (double *) malloc(gridsize2*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( vars[varID] )
+	    {
+	      streamReadRecord(streamID1, array1, &nmiss);
+
+	      if ( operatorID == SETHALO )
+		halo(array1, gridID1, array2, lhalo, rhalo);
+	      else
+		tpnhalo(array1, gridID1, array2);
+
+	      if ( nmiss )
+		{
+		  nmiss = 0;
+		  missval = vlistInqVarMissval(vlistID1, varID);
+		  for ( i = 0; i < gridsize2; i++ )
+		    if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
+		}
+
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, array2, nmiss);
+	    }
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( vars   ) free(vars);
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Setmiss.c b/src/Setmiss.c
new file mode 100644
index 0000000..6fd4c8c
--- /dev/null
+++ b/src/Setmiss.c
@@ -0,0 +1,229 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Setmiss    setmissval      Set a new missing value
+      Setmiss    setctomiss      Set constant to missing value
+      Setmiss    setmisstoc      Set missing value to constant
+      Setmiss    setrtomiss      Set range to missing value
+      Setmiss    setvrange       Set range of valid value
+*/
+
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if  defined  (HAVE_ISNAN) && ! defined(__cplusplus)
+int isnan(const double x);
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Setmiss(void *argument)
+{
+  int SETMISSVAL, SETCTOMISS, SETMISSTOC, SETRTOMISS, SETVRANGE;
+  int operatorID;
+  int streamID1, streamID2;
+  int gridsize;
+  int nrecs, recID;
+  int nvars;
+  int tsID;
+  int varID, levelID;
+  int vlistID1, vlistID2;
+  int nmiss;
+  int i;
+  int calendar;
+  double missval, missval2 = 0;
+  double rconst = 0, rmin = 0, rmax = 0;
+  double *array;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  SETMISSVAL   = cdoOperatorAdd("setmissval",    0, 0, "missing value");
+  SETCTOMISS   = cdoOperatorAdd("setctomiss",    0, 0, "constant");
+  SETMISSTOC   = cdoOperatorAdd("setmisstoc",    0, 0, "constant");
+  SETRTOMISS   = cdoOperatorAdd("setrtomiss",    0, 0, "range (min, max)");
+  SETVRANGE    = cdoOperatorAdd("setvrange",     0, 0, "range (min, max)");
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == SETMISSVAL )
+    {
+      operatorCheckArgc(1);
+      missval2 = atof(operatorArgv()[0]);
+    }
+  else if ( operatorID == SETCTOMISS || operatorID == SETMISSTOC )
+    {
+      operatorCheckArgc(1);
+      /*
+      if ( operatorArgv()[0][0] == 'n' || operatorArgv()[0][0] == 'N' )
+	{
+#if ! defined  (HAVE_ISNAN)
+	  cdoWarning("Function >isnan< not available!");
+#endif
+	  rconst = 0.0/0.0;
+	}
+      else
+      */
+	rconst = atof(operatorArgv()[0]);
+    }
+  else
+    {
+      operatorCheckArgc(2);
+      rmin = atof(operatorArgv()[0]);
+      rmax = atof(operatorArgv()[1]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  calendar = taxisInqCalendar(taxisID1);  
+
+  if ( operatorID == SETMISSVAL )
+    {
+      nvars = vlistNvars(vlistID2);
+      for ( varID = 0; varID < nvars; varID++ )
+	vlistDefVarMissval(vlistID2, varID, missval2);
+    }
+
+  /*
+  if ( operatorID == SETVRANGE )
+    {
+      double range[2];
+      range[0] = rmin;
+      range[1] = rmax;
+
+      nvars = vlistNvars(vlistID2);
+      for ( varID = 0; varID < nvars; varID++ )
+	vlistDefAttFlt(vlistID2, varID, "valid_range", DATATYPE_FLT64, 2, range);
+    }
+  */
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array, &nmiss);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  missval = vlistInqVarMissval(vlistID1, varID);
+
+	  if ( operatorID == SETMISSVAL )
+	    {
+	      nmiss = 0;
+	      for ( i = 0; i < gridsize; i++ )
+		if ( DBL_IS_EQUAL(array[i], missval)  || DBL_IS_EQUAL(array[i], (float)missval) ||
+		     DBL_IS_EQUAL(array[i], missval2) || DBL_IS_EQUAL(array[i], (float)missval2) )
+		  {
+		    array[i] = missval2;
+		    nmiss++;
+		  }
+	    }
+	  else if ( operatorID == SETCTOMISS )
+	    {
+#if  defined  (HAVE_ISNAN)
+	      if ( isnan(rconst) )
+		{
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( isnan(array[i]) )
+		      {
+			array[i] = missval;
+			nmiss++;
+		      }
+		}
+	      else
+#endif
+		{
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( DBL_IS_EQUAL(array[i], rconst) || DBL_IS_EQUAL(array[i], (float)rconst) )
+		      {
+			array[i] = missval;
+			nmiss++;
+		      }
+		}
+	    }
+	  else if ( operatorID == SETMISSTOC )
+	    {
+	      nmiss = 0;
+	      for ( i = 0; i < gridsize; i++ )
+		if ( DBL_IS_EQUAL(array[i], missval) || DBL_IS_EQUAL(array[i], (float)missval) )
+		  {
+		    array[i] = rconst;
+		  }
+	    }
+	  else if ( operatorID == SETRTOMISS )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		if ( array[i] >= rmin && array[i] <= rmax )
+		  {
+		    array[i] = missval;
+		    nmiss++;
+		  }
+	    }
+	  else if ( operatorID == SETVRANGE )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		if ( array[i] < rmin || array[i] > rmax ) array[i] = missval;
+
+	      nmiss = 0;
+	      for ( i = 0; i < gridsize; i++ )
+		if ( DBL_IS_EQUAL(array[i], missval) ) nmiss++;
+	    }
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array, nmiss);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Setpartab.c b/src/Setpartab.c
new file mode 100644
index 0000000..0e104ff
--- /dev/null
+++ b/src/Setpartab.c
@@ -0,0 +1,753 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Setpartab  setpartab       Set parameter table
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if defined (HAVE_LIBUDUNITS2)
+#  include <udunits2.h>
+#endif
+
+#include <errno.h>
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+#include "namelist.h"
+
+
+static void udunitsInitialize(void);
+static int udunitsInit = 0;
+
+#if  defined  (HAVE_LIBPTHREAD)
+#  include <pthread.h>
+
+static pthread_once_t  udunitsInitThread = PTHREAD_ONCE_INIT;
+static pthread_mutex_t udunitsMutex;
+
+#  define UDUNITS_LOCK()         pthread_mutex_lock(&udunitsMutex)
+#  define UDUNITS_UNLOCK()       pthread_mutex_unlock(&udunitsMutex)
+#  define UDUNITS_INIT()         pthread_once(&udunitsInitThread, udunitsInitialize)
+
+#else
+
+#  define UDUNITS_LOCK()
+#  define UDUNITS_UNLOCK()
+#  define UDUNITS_INIT()         if ( !udunitsInit ) udunitsInitialize();
+
+#endif
+
+typedef enum {CODE_NUMBER, PARAMETER_ID, VARIABLE_NAME, STANDARD_NAME} pt_mode_t;
+
+#if defined (HAVE_LIBUDUNITS2)
+ut_system *ut_read = NULL;
+
+static
+void udunitsInitialize(void)
+{
+#if  defined  (HAVE_LIBPTHREAD)
+  /* initialize global API mutex lock */
+  pthread_mutex_init(&udunitsMutex, NULL);
+#endif
+
+  udunitsInit = 1;
+}
+
+static
+void *get_converter(char *src_unit_str, char *tgt_unit_str, int *rstatus)
+{
+  ut_unit *src_unit, *tgt_unit;
+  cv_converter *ut_units_converter = NULL;
+  int status;
+
+  *rstatus = -1;
+
+  if ( ut_read == NULL )
+    {
+      ut_set_error_message_handler(ut_ignore);
+
+      errno = 0;
+      ut_read = ut_read_xml(NULL);
+      status = ut_get_status();
+      if ( status == UT_PARSE )
+	{
+	  if ( cdoVerbose ) cdoWarning("Udunits: Couldn't parse unit database!");
+	}
+      if ( status == UT_OPEN_ENV || status == UT_OPEN_DEFAULT || status == UT_OS )
+	{
+	  if ( cdoVerbose ) cdoWarning("Udunits: %s", strerror(errno));
+	}
+      errno = 0;
+      if ( status != UT_SUCCESS )
+	{
+	  if ( cdoVerbose ) cdoWarning("Udunits: Error reading units system!");
+	  return NULL;
+	}
+    }
+
+  ut_trim(src_unit_str, UT_ASCII);
+  src_unit = ut_parse(ut_read, src_unit_str, UT_ASCII);
+  if ( ut_get_status() != UT_SUCCESS )
+    {
+      if ( cdoVerbose ) cdoWarning("Udunits: Error parsing units: [%s]", src_unit_str);
+      return NULL;
+    }
+
+  ut_trim(tgt_unit_str, UT_ASCII);
+  tgt_unit = ut_parse(ut_read, tgt_unit_str, UT_ASCII);
+  if ( ut_get_status() != UT_SUCCESS )
+    {
+      if ( cdoVerbose ) cdoWarning("Udunits: Error parsing units: [%s]", tgt_unit_str);
+      return NULL;
+    }
+
+  status = ut_compare(src_unit, tgt_unit);
+  if ( status == 0 ) *rstatus = -2;
+
+  if ( *rstatus == -1 )
+    {
+      status = ut_are_convertible(src_unit, tgt_unit);
+      if ( status == 0 ) *rstatus = -3;
+    }
+
+  if ( *rstatus == -1 )
+    {
+      ut_units_converter = ut_get_converter(src_unit, tgt_unit);
+      if ( ut_units_converter == NULL || ut_get_status() != UT_SUCCESS )
+	{
+	  if ( cdoVerbose ) cdoWarning("Udunits: Error getting converter from [%s] to [%s]", src_unit_str, tgt_unit_str);
+	}
+      else
+	*rstatus = 0;
+    }
+
+  ut_free(src_unit);
+  if ( ut_get_status() != UT_SUCCESS )
+    {
+      if ( cdoVerbose ) cdoWarning("Udunits: Error freeing units [%s]", src_unit_str);
+      return NULL;
+    }
+     
+  ut_free(tgt_unit);
+  if ( ut_get_status() != UT_SUCCESS )
+    {
+      if ( cdoVerbose ) cdoWarning("Udunits: Error freeing units [%s]", tgt_unit_str);
+      return NULL;
+    }
+
+  return ((void *) ut_units_converter);
+}
+#endif
+
+typedef struct
+{
+  // missing value
+  int changemissval;
+  double missval_old;
+  //
+  int lfactor;
+  double factor;
+  //
+  int checkvalid;
+  double valid_min;
+  double valid_max;
+  //
+  int check_min_mean_abs;
+  double ok_min_mean_abs;
+  //
+  int check_max_mean_abs;
+  double ok_max_mean_abs;
+  // units
+  int changeunits;
+  char units_old[CDI_MAX_NAME];
+  char units[CDI_MAX_NAME];
+  // varname
+  char name[CDI_MAX_NAME];
+  // converter
+  void *ut_converter;
+} var_t;
+
+int lwarn_udunits = TRUE;
+
+static
+void defineVarAttText(int vlistID2, int varID, const char *attname, const char *atttext)
+{
+  int len = strlen(atttext);
+  vlistDefAttTxt(vlistID2, varID, attname, len, atttext);
+}
+
+static
+void defineVarUnits(var_t *vars, int vlistID2, int varID, char *units, char *name)
+{
+  char units_old[CDI_MAX_NAME];
+  size_t len1, len2;
+
+  vlistInqVarUnits(vlistID2, varID, units_old);
+  len1 = strlen(units_old);
+  len2 = strlen(units);
+
+  if ( strcmp(units, units_old) != 0 )
+    {
+      if ( len1 > 0 && len2 > 0 )
+	{
+	  int status;
+	  vars[varID].changeunits = TRUE;
+	  strcpy(vars[varID].units_old, units_old);
+	  strcpy(vars[varID].units, units);
+#if defined (HAVE_LIBUDUNITS2)
+	  UDUNITS_INIT();
+	  UDUNITS_LOCK();
+	  vars[varID].ut_converter = get_converter(units_old, units, &status);
+	  UDUNITS_UNLOCK();
+	  if ( vars[varID].ut_converter == NULL )
+	    {
+	      if ( status == -2 )
+		{
+		  if ( cdoVerbose )
+		    cdoPrint("%s - not converted from  [%s] to [%s], units are equal!", name, units_old, units);
+		}
+	      else if ( status == -3 )
+		{
+		  cdoWarning("%s - converting units from [%s] to [%s] failed, not convertible!", name, units_old, units);
+		}
+	      else
+		cdoWarning("%s - converting units from [%s] to [%s] failed!", name, units_old, units);
+	      vars[varID].changeunits = FALSE;
+	    }
+	  else
+	    {
+	      if ( cdoVerbose )
+		{
+		  char buf[64];
+		  cv_get_expression(vars[varID].ut_converter, buf, 64, name);
+		  cdoPrint("%s - convert units from [%s] to [%s] (expression: %s).", name, units_old, units, buf);
+		}
+	    }
+#else
+	  if ( lwarn_udunits )
+	    {
+	      cdoWarning("Can't convert units, UDUNITS2 support not compiled in!");
+	      vars[varID].changeunits = FALSE;
+	      lwarn_udunits = FALSE;
+	    }
+#endif
+	}
+
+      vlistDefVarUnits(vlistID2, varID, units);
+      defineVarAttText(vlistID2, varID, "original_units", units_old);
+    }
+}
+
+static
+void read_partab(pt_mode_t ptmode, int nvars, int vlistID2, var_t *vars)
+{
+  FILE *fp;
+  namelist_t *nml;
+  int nml_code, nml_out_code, nml_table, nml_param, nml_datatype, nml_name, nml_out_name, nml_stdname;
+  int nml_longname, nml_units, nml_comment, nml_ltype, nml_missval, nml_factor;
+  int nml_cell_methods, nml_cell_measures;
+  int nml_valid_min, nml_valid_max, nml_ok_min_mean_abs, nml_ok_max_mean_abs;
+  int locc, i;
+  int code, out_code, table, ltype;
+  int nml_index = 0;
+  int codenum, tabnum, levtype, param;
+  int varID, tableID;
+  int num_pt_files;
+  double param_dp;
+  double missval, factor;
+  double valid_min, valid_max, ok_min_mean_abs, ok_max_mean_abs;
+  char *partab = NULL;
+  char *datatypestr = NULL;
+  char *name = NULL, *out_name = NULL, *stdname = NULL, longname[CDI_MAX_NAME] = "", units[CDI_MAX_NAME] = "";
+  char cell_methods[CDI_MAX_NAME] = "", cell_measures[CDI_MAX_NAME] = "";
+  char varname[CDI_MAX_NAME];
+  char comment[1024] = "";
+
+  num_pt_files = operatorArgc();
+
+  for ( int fileID = 0; fileID < num_pt_files; ++fileID )
+    {
+      partab = operatorArgv()[fileID];
+      fp = fopen(partab, "r");
+      if ( fp == NULL ) cdoAbort("Open failed on parameter table %d file name %s!", fileID+1, partab);
+
+      nml_index = 0;
+      nml = namelistNew("parameter");
+      nml->dis = 0;
+
+      nml_code            = namelistAdd(nml, "code",            NML_INT,  0, &code, 1);
+      nml_out_code        = namelistAdd(nml, "out_code",        NML_INT,  0, &out_code, 1);
+      nml_table           = namelistAdd(nml, "table",           NML_INT,  0, &table, 1);
+      nml_ltype           = namelistAdd(nml, "ltype",           NML_INT,  0, &ltype, 1);
+      nml_missval         = namelistAdd(nml, "missing_value",   NML_FLT,  0, &missval, 1);
+      nml_factor          = namelistAdd(nml, "factor",          NML_FLT,  0, &factor, 1);
+      nml_valid_min       = namelistAdd(nml, "valid_min",       NML_FLT,  0, &valid_min, 1);
+      nml_valid_max       = namelistAdd(nml, "valid_max",       NML_FLT,  0, &valid_max, 1);
+      nml_ok_min_mean_abs = namelistAdd(nml, "ok_min_mean_abs", NML_FLT,  0, &ok_min_mean_abs, 1);
+      nml_ok_max_mean_abs = namelistAdd(nml, "ok_max_mean_abs", NML_FLT,  0, &ok_max_mean_abs, 1);
+      nml_param           = namelistAdd(nml, "param",           NML_FLT,  0, &param_dp, 1);
+      nml_datatype        = namelistAdd(nml, "type",            NML_WORD, 0, &datatypestr, 1);
+      nml_name            = namelistAdd(nml, "name",            NML_WORD, 0, &name, 1);
+      nml_out_name        = namelistAdd(nml, "out_name",        NML_WORD, 0, &out_name, 1);
+      nml_stdname         = namelistAdd(nml, "standard_name",   NML_WORD, 0, &stdname, 1);
+      nml_longname        = namelistAdd(nml, "long_name",       NML_TEXT, 0, longname, sizeof(longname));
+      nml_units           = namelistAdd(nml, "units",           NML_TEXT, 0, units, sizeof(units));
+      nml_comment         = namelistAdd(nml, "comment",         NML_TEXT, 0, comment, sizeof(comment));
+      nml_cell_methods    = namelistAdd(nml, "cell_methods",    NML_TEXT, 0, cell_methods, sizeof(cell_methods));
+      nml_cell_measures   = namelistAdd(nml, "cell_measures",   NML_TEXT, 0, cell_measures, sizeof(cell_measures));
+	      
+      while ( ! feof(fp) )
+	{
+	  namelistReset(nml);
+
+	  namelistRead(fp, nml);
+
+	  locc = FALSE;
+	  for ( i = 0; i < nml->size; i++ )
+	    {
+	      if ( nml->entry[i]->occ ) { locc = TRUE; break; }
+	    }
+
+	  if ( locc )
+	    {
+	      // namelistPrint(nml);
+	  
+	      nml_index++;
+
+	      if ( ptmode == CODE_NUMBER )
+		{
+		  if ( nml->entry[nml_code]->occ == 0 )
+		    {
+		      cdoPrint("Parameter entry %d (table %d) skipped, code number not found!", nml_index, fileID+1);
+		      continue;
+		    }
+		}
+	      else if ( ptmode == PARAMETER_ID )
+		{
+		  if ( nml->entry[nml_param]->occ == 0 )
+		    {
+		      cdoWarning("Parameter entry %d (table %d) skipped, parameter ID not found!", nml_index, fileID+1);
+		      continue;
+		    }
+		}
+	      else if ( ptmode == VARIABLE_NAME )
+		{
+		  if ( nml->entry[nml_name]->occ == 0 )
+		    {
+		      cdoWarning("Parameter entry %d (table %d) skipped, variable name not found!", nml_index, fileID+1);
+		      continue;
+		    }
+		}
+
+	      for ( varID = 0; varID < nvars; varID++ )
+		{
+		  if ( ptmode == CODE_NUMBER )
+		    {
+		      codenum = vlistInqVarCode(vlistID2, varID);
+		      tableID = vlistInqVarTable(vlistID2, varID);
+		      tabnum  = tableInqNum(tableID);
+		      levtype = zaxisInqLtype(vlistInqVarZaxis(vlistID2, varID));
+		      
+		      //	printf("code = %d  tabnum = %d  ltype = %d\n", codenum, tabnum, levtype);
+		      
+		      if ( nml->entry[nml_table]->occ == 0 ) table = tabnum;
+		      if ( nml->entry[nml_ltype]->occ == 0 ) ltype = levtype;
+		  
+		      if ( codenum == code && tabnum == table && levtype == ltype ) break;
+		    }
+		  else if ( ptmode == PARAMETER_ID )
+		    {
+		      param   = vlistInqVarParam(vlistID2, varID);
+		      codenum = vlistInqVarCode(vlistID2, varID);
+		      tableID = vlistInqVarTable(vlistID2, varID);
+		      tabnum  = tableInqNum(tableID);
+		      levtype = zaxisInqLtype(vlistInqVarZaxis(vlistID2, varID));
+		      
+		      //	printf("code = %d  tabnum = %d  ltype = %d\n", codenum, tabnum, levtype);
+		      code = (int) param_dp;
+		      table = (param_dp-code)*1000;
+		      printf("code = %d  tabnum = %d  ltype = %d\n", code, table, levtype);
+		      
+		      if ( nml->entry[nml_table]->occ == 0 ) table = tabnum;
+		      if ( nml->entry[nml_ltype]->occ == 0 ) ltype = levtype;
+		  
+		      if ( codenum == code && tabnum == table && levtype == ltype ) break;
+		    }
+		  else if ( ptmode == VARIABLE_NAME )
+		    {
+		      vlistInqVarName(vlistID2, varID, varname);
+		      if ( strcmp(varname, name) == 0 ) break;
+		    }
+		}
+
+	      if ( varID < nvars )
+		{
+		  if ( nml->entry[nml_code]->occ     ) vlistDefVarCode(vlistID2, varID, code);
+		  if ( nml->entry[nml_out_code]->occ ) vlistDefVarCode(vlistID2, varID, out_code);
+		  if ( nml->entry[nml_name]->occ     ) strcpy(vars[varID].name, name);
+		  if ( nml->entry[nml_name]->occ     ) vlistDefVarName(vlistID2, varID, name);
+		  if ( nml->entry[nml_out_name]->occ ) vlistDefVarName(vlistID2, varID, out_name);
+		  if ( nml->entry[nml_out_name]->occ ) defineVarAttText(vlistID2, varID, "original_name", vars[varID].name);
+		  if ( nml->entry[nml_stdname]->occ  ) vlistDefVarStdname(vlistID2, varID, stdname);
+		  if ( nml->entry[nml_longname]->occ ) vlistDefVarLongname(vlistID2, varID, longname);
+		  if ( nml->entry[nml_units]->occ    ) defineVarUnits(vars, vlistID2, varID, units, name);
+		  if ( nml->entry[nml_comment]->occ  ) defineVarAttText(vlistID2, varID, "comment", comment);
+		  if ( nml->entry[nml_cell_methods]->occ  )  defineVarAttText(vlistID2, varID, "cell_methods", cell_methods);
+		  if ( nml->entry[nml_cell_measures]->occ  ) defineVarAttText(vlistID2, varID, "cell_measures", cell_measures);
+		  if ( nml->entry[nml_datatype]->occ )
+		    {
+		      int datatype = str2datatype(datatypestr);
+		      if ( datatype != -1 ) vlistDefVarDatatype(vlistID2, varID, datatype);
+		    }
+		  if ( nml->entry[nml_missval]->occ )
+		    {
+		      double missval_old;
+		      missval_old = vlistInqVarMissval(vlistID2, varID);
+		      if ( ! DBL_IS_EQUAL(missval, missval_old) )
+			{
+			  if ( cdoVerbose ) 
+			    cdoPrint("%s - change missval from %g to %g", name, missval_old, missval);
+			  vars[varID].changemissval = TRUE;
+			  vars[varID].missval_old = missval_old;
+			  vlistDefVarMissval(vlistID2, varID, missval);
+			}
+		    }
+		  if ( nml->entry[nml_factor]->occ )
+		    {
+		      vars[varID].lfactor = TRUE;
+		      vars[varID].factor = factor;
+		      if ( cdoVerbose ) 
+			cdoPrint("%s - scale factor %g", name, factor);
+		    }
+		  if ( nml->entry[nml_valid_min]->occ && nml->entry[nml_valid_max]->occ )
+		    {
+		      vars[varID].checkvalid = TRUE;
+		      vars[varID].valid_min = valid_min;
+		      vars[varID].valid_max = valid_max;
+		    }
+		  if ( nml->entry[nml_ok_min_mean_abs]->occ )
+		    {
+		      vars[varID].check_min_mean_abs = TRUE;
+		      vars[varID].ok_min_mean_abs = ok_min_mean_abs;
+		    }
+		  if ( nml->entry[nml_ok_max_mean_abs]->occ )
+		    {
+		      vars[varID].check_max_mean_abs = TRUE;
+		      vars[varID].ok_max_mean_abs = ok_max_mean_abs;
+		    }
+		}
+	      /*
+	      else
+		{
+		  if ( cdoVerbose )
+		    {
+		      if ( ptmode == CODE_NUMBER )
+			{
+			  if ( nml->entry[nml_table]->occ == 0 )
+			    cdoPrint("Code %d not found!", code);
+			  else
+			    cdoPrint("Code %d and table %d not found!", code, table);
+			}
+		      else
+			cdoPrint("%s - not found!", name);
+		    }
+		}
+	      */
+	    }
+	  else
+	    break;
+	}
+  
+      namelistDelete(nml);
+
+      fclose(fp);
+    }
+}
+
+static
+void check_data(int vlistID2, int varID, var_t *vars, long gridsize, double missval, double *array)
+{
+  char varname[CDI_MAX_NAME];
+  int nvals = 0;
+  double amean = 0, aval;
+  double amin  =  1.e300;
+  double amax  = -1.e300;
+  
+  for ( long i = 0; i < gridsize; ++i )
+    {
+      aval = array[i];
+      if ( !DBL_IS_EQUAL(aval, missval) )
+	{
+	  if ( aval < amin ) amin = aval;
+	  if ( aval > amax ) amax = aval;
+	  amean += aval;
+	  nvals++;
+	}
+    }
+
+  if ( nvals > 0 ) amean /= nvals;
+
+  int n_lower_min = 0;
+  int n_greater_max = 0;
+  for ( long i = 0; i < gridsize; ++i )
+    {
+      aval = array[i];
+      if ( !DBL_IS_EQUAL(aval, missval) )
+	{
+	  if ( aval < vars[varID].valid_min ) n_lower_min++;
+	  if ( aval > vars[varID].valid_max ) n_greater_max++;
+	}
+    }
+
+  vlistInqVarName(vlistID2, varID, varname);
+
+  if ( n_lower_min > 0 )
+    cdoWarning("Invalid value(s) detected for variable '%s': %i values were lower than minimum valid value (%.4g).",
+	       varname, n_lower_min, vars[varID].valid_min);
+  if ( n_greater_max > 0 )
+    cdoWarning("Invalid value(s) detected for variable '%s': %i values were greater than maximum valid value (%.4g).",
+	       varname, n_greater_max, vars[varID].valid_max);
+
+  amean = fabs(amean);
+
+  if ( vars[varID].check_min_mean_abs )
+    {
+      if ( amean < .1*vars[varID].ok_min_mean_abs )
+	cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is lower by more than an order of magnitude than minimum allowed: %.4g",
+		 varname, amean, vars[varID].ok_min_mean_abs);
+
+      if ( amean < vars[varID].ok_min_mean_abs)
+	cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is lower than minimum allowed: %.4g",
+		   varname, amean, vars[varID].ok_min_mean_abs);
+    }
+
+  if ( vars[varID].check_max_mean_abs )
+    {
+      if ( amean > 10.*vars[varID].ok_max_mean_abs )
+	cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is greater by more than an order of magnitude than maximum allowed: %.4g",
+		 varname, amean, vars[varID].ok_max_mean_abs);
+      
+      if ( amean > vars[varID].ok_max_mean_abs )
+	cdoWarning("Invalid Absolute Mean for variable '%s' (%.5g) is greater than maximum allowed: %.4g",
+		   varname, amean, vars[varID].ok_max_mean_abs);
+    }
+}
+
+
+void *Setpartab(void *argument)
+{
+  int SETPARTAB, SETPARTABN, SETPARTABC, SETPARTABP;
+  int operatorID;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs, nvars;
+  int tsID1, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int nmiss;
+  long gridsize;
+  int tableID = -1;
+  int tableformat = 0;
+  char *partab = NULL;
+  double missval;
+  double *array = NULL;
+  var_t *vars = NULL;
+  pt_mode_t ptmode = CODE_NUMBER;
+
+
+  cdoInitialize(argument);
+
+  SETPARTAB  = cdoOperatorAdd("setpartab",  0, 0, "parameter table name");
+  SETPARTABC = cdoOperatorAdd("setpartabc", 0, 0, "parameter table name");
+  SETPARTABP = cdoOperatorAdd("setpartabp", 0, 0, "parameter table name");
+  SETPARTABN = cdoOperatorAdd("setpartabn", 0, 0, "parameter table name");
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  if ( operatorArgc() < 1 ) cdoAbort("Too few arguments!");
+
+  if      ( operatorID == SETPARTAB )  ptmode = CODE_NUMBER;
+  else if ( operatorID == SETPARTABC ) ptmode = CODE_NUMBER;
+  else if ( operatorID == SETPARTABP ) ptmode = PARAMETER_ID;
+  else if ( operatorID == SETPARTABN ) ptmode = VARIABLE_NAME;
+
+  if ( ptmode == CODE_NUMBER )
+    {
+      FILE *fp;
+      size_t fsize;
+      char *parbuf = NULL;
+      size_t nbytes;
+
+      partab = operatorArgv()[0];
+      fp = fopen(partab, "r");
+      if ( fp != NULL )
+	{
+	  fseek(fp, 0L, SEEK_END);
+	  fsize = (size_t) ftell(fp);
+	  parbuf = (char *) malloc(fsize+1);
+	  fseek(fp, 0L, SEEK_SET);
+	  nbytes = fread(parbuf, fsize, 1, fp);
+	  parbuf[fsize] = 0;
+	  fseek(fp, 0L, SEEK_SET);
+
+	  if ( atoi(parbuf) == 0 ) tableformat = 1;
+
+	  fclose(fp);
+	  free(parbuf);
+	}
+
+      if ( tableformat == 0 ) tableID = defineTable(partab);
+    }
+  else if (  ptmode == PARAMETER_ID )
+    {
+      tableformat = 1;
+    }
+  else if (  ptmode == VARIABLE_NAME )
+    {
+      tableformat = 1;
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+  /* vlistPrint(vlistID2);*/
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nvars = vlistNvars(vlistID2);
+  vars = (var_t *) malloc(nvars*sizeof(var_t));
+  memset(vars, 0, nvars*sizeof(var_t));
+
+  if ( tableformat == 0 )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	vlistDefVarTable(vlistID2, varID, tableID);
+    }
+  else
+    {
+      read_partab(ptmode, nvars, vlistID2, vars);
+    }
+
+  /* vlistPrint(vlistID2);*/
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID1 = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID1)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID1);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+
+	  streamReadRecord(streamID1, array, &nmiss);
+
+	  missval = vlistInqVarMissval(vlistID2, varID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  if ( vlistInqVarNumber(vlistID2, varID) != CDI_REAL ) gridsize *= 2;
+
+	  if ( nmiss > 0 && vars[varID].changemissval == TRUE )
+	    {
+	      for ( long i = 0; i < gridsize; ++i )
+		{
+		  if ( DBL_IS_EQUAL(array[i], vars[varID].missval_old) ) array[i] = missval;
+		}
+	    }
+
+	  if ( vars[varID].lfactor == TRUE )
+	    {
+	      for ( long i = 0; i < gridsize; ++i )
+		{
+		  if ( !DBL_IS_EQUAL(array[i], missval) ) array[i] *= vars[varID].factor;
+		}
+	    }
+
+#if defined (HAVE_LIBUDUNITS2)
+	  if ( vars[varID].changeunits == TRUE )
+	    {
+	      int nerr = 0;
+	      for ( long i = 0; i < gridsize; ++i )
+		{
+		  if ( !DBL_IS_EQUAL(array[i], missval) )
+		    {
+		      array[i] = cv_convert_double(vars[varID].ut_converter, array[i]);
+		      if ( ut_get_status() != UT_SUCCESS ) nerr++;
+		    }
+		}
+	      if ( nerr )
+		{
+		  cdoWarning("Udunits: Error converting units from [%s] to [%s], parameter: %s",
+			     vars[varID].units_old, vars[varID].units, vars[varID].name);
+		  vars[varID].changeunits = FALSE;
+		}
+	    }
+#endif
+	  
+	  streamWriteRecord(streamID2, array, nmiss);
+
+	  if ( vars[varID].checkvalid || vars[varID].check_min_mean_abs || vars[varID].check_max_mean_abs )
+	    check_data(vlistID2, varID, vars, gridsize, missval, array);
+	}
+      tsID1++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+#if defined (HAVE_LIBUDUNITS2)
+  UDUNITS_LOCK();
+
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vars[varID].ut_converter ) cv_free(vars[varID].ut_converter);
+
+  if ( ut_read )
+    { 
+      ut_free_system(ut_read);
+      ut_read = NULL;
+    }
+
+  UDUNITS_UNLOCK();
+#endif
+
+  if ( array ) free(array);
+  if ( vars  ) free(vars);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Setrcaname.c b/src/Setrcaname.c
new file mode 100644
index 0000000..30ccdc8
--- /dev/null
+++ b/src/Setrcaname.c
@@ -0,0 +1,164 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+#define  MAX_LINE_LEN  4096
+
+void *Setrcaname(void *argument)
+{
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  char **rcsnames;
+  FILE *fp;
+  char line[MAX_LINE_LEN];
+  char sname[CDI_MAX_NAME], sdescription[CDI_MAX_NAME], sunits[CDI_MAX_NAME];
+  int scode, sltype, slevel;
+  int nvars;
+  int zaxisID, ltype, code, nlev;
+  int level;
+  int lcopy = FALSE;
+  int gridsize, nmiss;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  operatorInputArg("file name with RCA names");
+  rcsnames = operatorArgv();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  nvars = vlistNvars(vlistID2);
+
+  fp = fopen(rcsnames[0], "r");
+  if ( fp != NULL )
+    {
+      while ( readline(fp, line, MAX_LINE_LEN) )
+	{
+	  sscanf(line, "%d\t%d\t%d\t%s\t%s\t%s", &scode, &sltype, &slevel, sname, sdescription, sunits);
+	  /*
+	  printf("%s\n", line);
+	  printf("%d:%d:%d:%s:%s:%s\n", scode, sltype, slevel, sname, sdescription, sunits);
+	  */
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      code = vlistInqVarCode(vlistID2, varID);
+	      zaxisID = vlistInqVarZaxis(vlistID2, varID);
+	      nlev = zaxisInqSize(zaxisID);
+
+	      ltype = zaxis2ltype(zaxisID);
+
+	      if ( code == scode )
+		{
+		  if ( ltype == 105 )
+		    {
+		      if ( nlev != 1 )
+			{
+			  cdoWarning("Number of levels should be 1 for level type 105!");
+			  cdoWarning("Maybe environment variable SPLIT_LTYPE_105 is not set.");
+			  continue;
+			}
+		      level = (int) zaxisInqLevel(zaxisID, 0);
+		      if ( sltype == 105 && slevel == level )
+			{
+			  vlistDefVarName(vlistID2, varID, sname);
+			  vlistDefVarLongname(vlistID2, varID, sdescription);
+			  vlistDefVarUnits(vlistID2, varID, sunits);
+			  break;
+			}
+		    }
+		  else if ( sltype != 105 )
+		    {
+		      vlistDefVarName(vlistID2, varID, sname);
+		      vlistDefVarLongname(vlistID2, varID, sdescription);
+		      vlistDefVarUnits(vlistID2, varID, sunits);
+		      break;
+		    }
+		}
+	    }
+	}
+
+      fclose(fp);
+    }
+  else
+    {
+      perror(rcsnames[0]);
+    }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+
+	  if ( lcopy )
+	    {
+	      streamCopyRecord(streamID2, streamID1);
+	    }
+	  else
+	    {
+	      streamReadRecord(streamID1, array, &nmiss);
+	      streamWriteRecord(streamID2, array, nmiss);
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  vlistDestroy(vlistID2);
+
+  if ( ! lcopy )
+    if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Settime.c b/src/Settime.c
new file mode 100644
index 0000000..c097512
--- /dev/null
+++ b/src/Settime.c
@@ -0,0 +1,487 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Settime    setdate         Set date
+      Settime    settime         Set time
+      Settime    setday          Set day
+      Settime    setmon          Set month
+      Settime    setyear         Set year
+      Settime    settunits       Set time units
+      Settime    settaxis        Set time axis
+      Settime    setreftime      Set reference time
+      Settime    setcalendar     Set calendar
+      Settime    shifttime       Shift timesteps
+*/
+
+#include <ctype.h>  /* isdigit */
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+int get_tunits(const char *unit, int *incperiod, int *incunit, int *tunit)
+{
+  size_t len;
+	
+  len = strlen(unit);
+  
+  if      ( memcmp(unit, "seconds", len) == 0 ) { *incunit =     1; *tunit = TUNIT_SECOND;  }
+  else if ( memcmp(unit, "minutes", len) == 0 ) { *incunit =    60; *tunit = TUNIT_MINUTE;  }
+  else if ( memcmp(unit, "hours", len)   == 0 ) { *incunit =  3600; *tunit = TUNIT_HOUR;    }
+  else if ( memcmp(unit, "3hours", len)  == 0 ) { *incunit = 10800; *tunit = TUNIT_3HOURS;  }
+  else if ( memcmp(unit, "6hours", len)  == 0 ) { *incunit = 21600; *tunit = TUNIT_6HOURS;  }
+  else if ( memcmp(unit, "12hours", len) == 0 ) { *incunit = 43200; *tunit = TUNIT_12HOURS; }
+  else if ( memcmp(unit, "days", len)    == 0 ) { *incunit = 86400; *tunit = TUNIT_DAY;     }
+  else if ( memcmp(unit, "months", len)  == 0 ) { *incunit =     1; *tunit = TUNIT_MONTH;   }
+  else if ( memcmp(unit, "years", len)   == 0 ) { *incunit =    12; *tunit = TUNIT_YEAR;    }
+  else cdoAbort("time unit >%s< unsupported", unit);
+
+  if ( *tunit == TUNIT_HOUR )
+    {
+      if      ( *incperiod ==  3 ) { *incperiod = 1; *incunit = 10800; *tunit = TUNIT_3HOURS;  }
+      else if ( *incperiod ==  6 ) { *incperiod = 1; *incunit = 21600; *tunit = TUNIT_6HOURS;  }
+      else if ( *incperiod == 12 ) { *incperiod = 1; *incunit = 43200; *tunit = TUNIT_12HOURS; }
+    }
+
+  return (0);
+}
+
+static
+void shifttime(int calendar, int tunit, int ijulinc, int *pdate, int *ptime)
+{
+  int year, month, day;
+  int vdate = *pdate;
+  int vtime = *ptime;
+  juldate_t juldate;
+
+  if ( tunit == TUNIT_MONTH || tunit == TUNIT_YEAR )
+    {
+      cdiDecodeDate(vdate, &year, &month, &day);
+	      
+      month += ijulinc;
+
+      while ( month > 12 ) { month -= 12; year++; }
+      while ( month <  1 ) { month += 12; year--; }
+
+      vdate = cdiEncodeDate(year, month, day);
+
+      *pdate = vdate;
+    }
+  else
+    {
+      juldate = juldate_encode(calendar, vdate, vtime);
+      juldate = juldate_add_seconds(ijulinc, juldate);
+      juldate_decode(calendar, juldate, &vdate, &vtime);
+
+      *pdate = vdate;
+      *ptime = vtime;
+
+      if ( cdoVerbose )
+	cdoPrint("juldate, ijulinc, vdate, vtime: %g %d %d %d",
+		 juldate_to_seconds(juldate), ijulinc, vdate, vtime);
+    }
+}
+
+
+void *Settime(void *argument)
+{
+  int SETYEAR, SETMON, SETDAY, SETDATE, SETTIME, SETTUNITS;
+  int SETTAXIS, SETREFTIME, SETCALENDAR, SHIFTTIME;
+  int operatorID;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs, newval = 0, ntsteps, nvars;
+  int tsID1, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int vdate, vtime;
+  int vdateb[2], vtimeb[2];
+  int sdate = 0, stime = 0;
+  int taxisID1, taxisID2 = CDI_UNDEFID;
+  int nmiss;
+  int gridsize;
+  int tunit = TUNIT_DAY;
+  int ijulinc = 0, incperiod = 0, incunit = 0;
+  int year = 1, month = 1, day = 1, hour = 0, minute = 0, second = 0;
+  int day0;
+  int taxis_has_bounds, copy_timestep = FALSE;
+  int calendar;
+  int newcalendar = CALENDAR_STANDARD;
+  // int nargs;
+  const char *datestr, *timestr;
+  char *rstr;
+  juldate_t juldate;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  SETYEAR     = cdoOperatorAdd("setyear",     0,  1, "year");
+  SETMON      = cdoOperatorAdd("setmon",      0,  1, "month");
+  SETDAY      = cdoOperatorAdd("setday",      0,  1, "day");
+  SETDATE     = cdoOperatorAdd("setdate",     0,  1, "date (format: YYYY-MM-DD)");
+  SETTIME     = cdoOperatorAdd("settime",     0,  1, "time (format: hh:mm:ss)");
+  SETTUNITS   = cdoOperatorAdd("settunits",   0,  1, "time units (seconds, minutes, hours, days, months, years)");
+  SETTAXIS    = cdoOperatorAdd("settaxis",    0, -2, "date,time<,increment> (format YYYY-MM-DD,hh:mm:ss)");
+  SETREFTIME  = cdoOperatorAdd("setreftime",  0, -2, "date,time<,units> (format YYYY-MM-DD,hh:mm:ss)");
+  SETCALENDAR = cdoOperatorAdd("setcalendar", 0,  1, "calendar (standard, proleptic, 360days, 365days, 366days)");
+  SHIFTTIME   = cdoOperatorAdd("shifttime",   0,  1, "shift value");
+
+  operatorID = cdoOperatorID();
+  // nargs = cdoOperatorF2(operatorID);
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  //  if ( operatorArgc()
+
+  if ( operatorID == SETTAXIS || operatorID == SETREFTIME )
+    {
+      if ( operatorArgc() < 2 ) cdoAbort("Too few arguments!");
+
+      datestr = operatorArgv()[0];
+      timestr = operatorArgv()[1];
+
+      if ( strchr(datestr, '-') )
+	{
+	  sscanf(datestr, "%d-%d-%d", &year, &month, &day);
+	  sdate = cdiEncodeDate(year, month, day);
+	}
+      else
+	{
+	  sdate = (int)strtol(datestr, &rstr, 10);
+	  if ( *rstr != 0 ) cdoAbort("Parameter string contains invalid characters: %s", datestr);
+	}
+
+      if ( strchr(timestr, ':') )
+	{
+	  sscanf(timestr, "%d:%d:%d", &hour, &minute, &second);
+	  stime = cdiEncodeTime(hour, minute, second);
+	}
+      else
+	{
+	  stime = (int)strtol(timestr, &rstr, 10);
+	  if ( *rstr != 0 ) cdoAbort("Parameter string contains invalid characters: %s", timestr);
+	}
+
+      if ( operatorArgc() == 3 )
+	{
+	  const char *timeunits = operatorArgv()[2];
+	  incperiod = (int)strtol(timeunits, NULL, 10);;
+	  while ( isdigit((int) *timeunits) ) timeunits++;
+
+	  get_tunits(timeunits, &incperiod, &incunit, &tunit);
+	}
+      /* increment in seconds */
+      ijulinc = incperiod * incunit;
+    }
+  else if ( operatorID == SETDATE )
+    {
+      if ( operatorArgc() < 1 ) cdoAbort("Too few arguments!");
+      datestr = operatorArgv()[0];
+      if ( strchr(datestr, '-') )
+	{
+	  sscanf(datestr, "%d-%d-%d", &year, &month, &day);
+	  newval = cdiEncodeDate(year, month, day);
+	}
+      else
+	{
+	  newval = (int)strtol(datestr, &rstr, 10);
+	  if ( *rstr != 0 ) cdoAbort("Parameter string contains invalid characters: %s", datestr);
+	}
+    }
+  else if ( operatorID == SETTIME )
+    {
+      if ( operatorArgc() < 1 ) cdoAbort("Too few arguments!");
+      timestr = operatorArgv()[0];
+
+      if ( strchr(timestr, ':') )
+	{
+	  sscanf(timestr, "%d:%d:%d", &hour, &minute, &second);
+	  newval = cdiEncodeTime(hour, minute, second);
+	}
+      else
+	{
+	  newval = (int)strtol(timestr, &rstr, 10);
+	  if ( *rstr != 0 ) cdoAbort("Parameter string contains invalid characters: %s", timestr);
+	}
+    }
+  else if ( operatorID == SHIFTTIME )
+    {
+      const char *timeunits = operatorArgv()[0];
+      incperiod = (int)strtol(timeunits, NULL, 10);;
+      if ( timeunits[0] == '-' || timeunits[0] == '+' ) timeunits++;
+      while ( isdigit((int) *timeunits) ) timeunits++;
+
+      get_tunits(timeunits, &incperiod, &incunit, &tunit);
+
+      /* increment in seconds */
+      ijulinc = incperiod * incunit;
+    }
+  else if ( operatorID == SETTUNITS )
+    {
+      int idum;
+      const char *timeunits = operatorArgv()[0];
+      incperiod = 0;
+      get_tunits(timeunits, &incperiod, &idum, &tunit);
+    }
+  else if ( operatorID == SETCALENDAR )
+    {
+      size_t len;
+      char *cname = operatorArgv()[0];
+      len = strlen(cname);      
+      if      ( memcmp(cname, "standard" , len) == 0 ) { newcalendar = CALENDAR_STANDARD;}
+      else if ( memcmp(cname, "proleptic", len) == 0 ) { newcalendar = CALENDAR_PROLEPTIC;}
+      else if ( memcmp(cname, "360days",   len) == 0 ) { newcalendar = CALENDAR_360DAYS;}
+      else if ( memcmp(cname, "365days",   len) == 0 ) { newcalendar = CALENDAR_365DAYS;}
+      else if ( memcmp(cname, "366days",   len) == 0 ) { newcalendar = CALENDAR_366DAYS;}
+      else cdoAbort("Calendar >%s< unsupported!", cname);
+    }
+  else
+    {
+      newval = (int)strtol(operatorArgv()[0], &rstr, 10);
+      if ( *rstr != 0 ) cdoAbort("Parameter string contains invalid characters: %s", operatorArgv()[0]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxis_has_bounds = taxisHasBounds(taxisID1);
+  ntsteps  = vlistNtsteps(vlistID1);
+  nvars    = vlistNvars(vlistID1);
+
+  if ( ntsteps == 1 )
+    {
+      for ( varID = 0; varID < nvars; ++varID )
+	if ( vlistInqVarTsteptype(vlistID1, varID) != TSTEP_CONSTANT ) break;
+
+      if ( varID == nvars ) ntsteps = 0;
+    }
+
+  if ( ntsteps == 0 )
+    {
+      for ( varID = 0; varID < nvars; ++varID )
+	vlistDefVarTsteptype(vlistID2, varID, TSTEP_INSTANT);
+    }
+
+  calendar = taxisInqCalendar(taxisID1);
+
+  if ( cdoVerbose ) cdoPrint("calendar = %d", calendar);
+
+  if ( operatorID == SETREFTIME )
+    {
+      copy_timestep = TRUE;
+
+      if ( taxisInqType(taxisID1) == TAXIS_ABSOLUTE )
+	{
+	  cdoPrint("Changing absolute to relative time axis!");
+
+	  taxisID2 = taxisCreate(TAXIS_RELATIVE);
+	}
+      else
+	taxisID2 = taxisDuplicate(taxisID1);
+
+      if ( operatorArgc() != 3 ) tunit = taxisInqTunit(taxisID1);
+      taxisDefTunit(taxisID2, tunit);
+    }
+  else if ( operatorID == SETTUNITS )
+    {
+      copy_timestep = TRUE;
+
+      if ( taxisInqType(taxisID1) == TAXIS_ABSOLUTE )
+	{
+	  cdoPrint("Changing absolute to relative time axis!");
+
+	  taxisID2 = taxisCreate(TAXIS_RELATIVE);
+	  taxisDefTunit(taxisID2, tunit);
+	}
+      else
+	taxisID2 = taxisDuplicate(taxisID1);
+    }
+  else if ( operatorID == SETCALENDAR )
+    {
+      copy_timestep = TRUE;
+      /*
+      if ( ((char *)argument)[0] == '-' )
+	cdoAbort("This operator does not work with pipes!");
+      */
+      if ( taxisInqType(taxisID1) == TAXIS_ABSOLUTE )
+	{/*
+	  if ( cdoFiletype() != FILETYPE_NC )
+	    cdoAbort("This operator does not work on an absolute time axis!");
+	 */
+	  cdoPrint("Changing absolute to relative time axis!");
+	  taxisID2 = taxisCreate(TAXIS_RELATIVE);
+	}
+      else
+	taxisID2 = taxisDuplicate(taxisID1);
+    }
+  else
+    taxisID2 = taxisDuplicate(taxisID1);
+
+  if ( operatorID == SETTAXIS )
+    {
+      taxisDefTunit(taxisID2, tunit);
+      taxisDefRdate(taxisID2, sdate);
+      taxisDefRtime(taxisID2, stime);
+      juldate = juldate_encode(calendar, sdate, stime);
+    }
+  else if ( operatorID == SETTUNITS )
+    {
+      taxisDefTunit(taxisID2, tunit);
+    }
+  else if ( operatorID == SETCALENDAR )
+    {
+      taxisDefCalendar(taxisID2, newcalendar);
+    }
+
+  if ( operatorID != SHIFTTIME )
+    if ( taxis_has_bounds && copy_timestep == FALSE )
+      {
+	cdoWarning("Time bounds unsupported by this operator, removed!");
+	taxisDeleteBounds(taxisID2);
+	taxis_has_bounds = FALSE;
+      }
+
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID1 = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID1)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      if ( operatorID == SETTAXIS )
+	{
+	  if ( tunit == TUNIT_MONTH || tunit == TUNIT_YEAR )
+	    {
+	      vtime = stime;
+	      if ( tsID1 == 0 )
+		{
+		  vdate = sdate;
+		  cdiDecodeDate(vdate, &year, &month, &day0);
+		}
+	      else
+		{	      
+		  month += ijulinc;
+
+		  while ( month > 12 ) { month -= 12; year++; }
+		  while ( month <  1 ) { month += 12; year--; }
+
+		  if ( day0 == 31 )
+		    day = days_per_month(calendar, year, month);
+		  else
+		    day = day0;
+
+		  vdate = cdiEncodeDate(year, month, day);
+		}
+	    }
+	  else
+	    {
+	      juldate_decode(calendar, juldate, &vdate, &vtime);
+	      juldate = juldate_add_seconds(ijulinc, juldate);
+	    }
+	}
+      else if ( operatorID == SHIFTTIME )
+	{
+	  shifttime(calendar, tunit, ijulinc, &vdate, &vtime);
+	  if ( taxis_has_bounds )
+	    {
+	      taxisInqVdateBounds(taxisID1, &vdateb[0], &vdateb[1]);
+	      taxisInqVtimeBounds(taxisID1, &vtimeb[0], &vtimeb[1]);	      
+	      shifttime(calendar, tunit, ijulinc, &vdateb[0], &vtimeb[0]);
+	      shifttime(calendar, tunit, ijulinc, &vdateb[1], &vtimeb[1]);
+	    }
+	}
+      else if ( operatorID == SETREFTIME || operatorID == SETCALENDAR || operatorID == SETTUNITS )
+	{
+	  ;
+	}
+      else
+	{
+	  cdiDecodeDate(vdate, &year, &month, &day);
+
+	  if ( operatorID == SETYEAR ) year  = newval;
+	  if ( operatorID == SETMON  ) month = newval;
+	  if ( operatorID == SETMON && (month < 0 || month > 16) ) cdoAbort("parameter month=%d out of range!", month);
+	  if ( operatorID == SETDAY  ) day   = newval;
+	  if ( operatorID == SETDAY && (day < 0 || day > 31) ) cdoAbort("parameter day=%d %d out of range!", day);
+      
+	  vdate = cdiEncodeDate(year, month, day);
+
+	  if ( operatorID == SETDATE  ) vdate = newval;
+	  if ( operatorID == SETTIME  ) vtime = newval;
+	}
+
+      if ( copy_timestep )
+	{
+	  taxisCopyTimestep(taxisID2, taxisID1);
+	  if ( operatorID == SETREFTIME )
+	    {
+	      taxisDefRdate(taxisID2, sdate);
+	      taxisDefRtime(taxisID2, stime);
+	    }
+	}
+      else
+	{
+	  int numavg = taxisInqNumavg(taxisID1);
+	  taxisDefNumavg(taxisID2, numavg);
+
+	  taxisDefVdate(taxisID2, vdate);
+	  taxisDefVtime(taxisID2, vtime);
+	  if ( taxis_has_bounds )
+	    {
+	      taxisDefVdateBounds(taxisID2, vdateb[0], vdateb[1]);
+	      taxisDefVtimeBounds(taxisID2, vtimeb[0], vtimeb[1]);
+	    }
+	}
+
+      streamDefTimestep(streamID2, tsID1);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  
+	  streamReadRecord(streamID1, array, &nmiss);
+	  streamWriteRecord(streamID2, array, nmiss);
+	}
+      
+      tsID1++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Setzaxis.c b/src/Setzaxis.c
new file mode 100644
index 0000000..676c020
--- /dev/null
+++ b/src/Setzaxis.c
@@ -0,0 +1,119 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Setzaxis   setzaxis        Set zaxis
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Setzaxis(void *argument)
+{
+  int SETZAXIS;
+  int operatorID;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int zaxisID1, zaxisID2 = -1;
+  int nzaxis, index;
+  int gridsize;
+  int nmiss;
+  int found;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  SETZAXIS = cdoOperatorAdd("setzaxis",     0, 0, "zaxis description file");
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg(cdoOperatorEnter(operatorID));  
+
+  if ( operatorID == SETZAXIS )
+    {
+      zaxisID2 = cdoDefineZaxis(operatorArgv()[0]);
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  if ( operatorID == SETZAXIS )
+    {
+      found = 0;
+      nzaxis = vlistNzaxis(vlistID1);
+      for ( index = 0; index < nzaxis; index++ )
+	{
+	  zaxisID1 = vlistZaxis(vlistID1, index);
+
+	  if ( zaxisInqSize(zaxisID1) == zaxisInqSize(zaxisID2) )
+	    {
+	      vlistChangeZaxisIndex(vlistID2, index, zaxisID2);
+	      found++;
+	    }
+	}
+      if ( ! found ) cdoWarning("No zaxis with %d levels found!", zaxisInqSize(zaxisID2));
+    }
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  
+	  streamReadRecord(streamID1, array, &nmiss);
+	  streamWriteRecord(streamID2, array, nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Showinfo.c b/src/Showinfo.c
new file mode 100644
index 0000000..eafc3f0
--- /dev/null
+++ b/src/Showinfo.c
@@ -0,0 +1,291 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Showinfo   showparam       Show parameters
+      Showinfo   showcode        Show code numbers
+      Showinfo   showname        Show variable names
+      Showinfo   showstdname     Show variable standard names
+      Showinfo   showlevel       Show levels
+      Showinfo   showyear        Show years
+      Showinfo   showmon         Show months
+      Showinfo   showdate        Show dates
+      Showinfo   showtime        Show timesteps
+      Showinfo   showltype       Show level types
+      Showinfo   showformat      Show file format
+*/
+
+
+#include <stdio.h>
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Showinfo(void *argument)
+{
+  int SHOWYEAR, SHOWMON, SHOWDATE, SHOWTIME, SHOWTIMESTAMP, SHOWCODE, SHOWUNIT;
+  int SHOWPARAM, SHOWNAME, SHOWSTDNAME, SHOWLEVEL, SHOWLTYPE, SHOWFORMAT;
+  int operatorID;
+  int varID, zaxisID;
+  int vdate, vtime;
+  int nrecs, nvars, nout, ntsteps;
+  int nlevs, levelID;
+  int ltype;
+  int index, nzaxis;
+  int tsID, ndate, date0 = 0;
+  int taxisID;
+  int streamID;
+  int vlistID;
+  int year, month, day;
+  int month0 = 0, nmonth, year0 = 0, nyear;
+  char varname[CDI_MAX_NAME];
+  char stdname[CDI_MAX_NAME];
+  char varunits[CDI_MAX_NAME];
+  char vdatestr[32], vtimestr[32];
+
+  cdoInitialize(argument);
+
+  SHOWYEAR      = cdoOperatorAdd("showyear",      0, 0, NULL);
+  SHOWMON       = cdoOperatorAdd("showmon",       0, 0, NULL);
+  SHOWDATE      = cdoOperatorAdd("showdate",      0, 0, NULL);
+  SHOWTIME      = cdoOperatorAdd("showtime",      0, 0, NULL);
+  SHOWTIMESTAMP = cdoOperatorAdd("showtimestamp", 0, 0, NULL);
+  SHOWCODE      = cdoOperatorAdd("showcode",      0, 0, NULL);
+  SHOWUNIT      = cdoOperatorAdd("showunit",      0, 0, NULL);
+  SHOWPARAM     = cdoOperatorAdd("showparam",     0, 0, NULL);
+  SHOWNAME      = cdoOperatorAdd("showname",      0, 0, NULL);
+  SHOWSTDNAME   = cdoOperatorAdd("showstdname",   0, 0, NULL);
+  SHOWLEVEL     = cdoOperatorAdd("showlevel",     0, 0, NULL);
+  SHOWLTYPE     = cdoOperatorAdd("showltype",     0, 0, NULL);
+  SHOWFORMAT    = cdoOperatorAdd("showformat",    0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID = streamOpenRead(cdoStreamName(0));
+
+  vlistID = streamInqVlist(streamID);
+
+  nvars   = vlistNvars(vlistID);
+  taxisID = vlistInqTaxis(vlistID);
+  ntsteps = vlistNtsteps(vlistID);
+
+  if ( operatorID == SHOWYEAR )
+    {
+      nyear = 0;
+      tsID = 0;
+      if ( ntsteps != 0 )
+	while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	  {
+	    vdate = taxisInqVdate(taxisID);
+
+	    cdiDecodeDate(vdate, &year, &month, &day);
+	 
+	    if ( tsID == 0 || year0 != year )
+	      {
+		/* if ( nyear == 10 ) { nyear = 0; fprintf(stdout, "\n"); } */
+		year0 = year;
+		fprintf(stdout, " %4d", year0);
+		nyear++;
+	      }
+
+	    tsID++;
+	  }
+      fprintf(stdout, "\n");
+    }
+  else if ( operatorID == SHOWMON )
+    {
+      nmonth = 0;
+      tsID = 0;
+      if ( ntsteps != 0 )
+	while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	  {
+	    vdate = taxisInqVdate(taxisID);
+
+	    cdiDecodeDate(vdate, &year, &month, &day);
+	 
+	    if ( tsID == 0 || month0 != month )
+	      {
+		/* if ( nmonth == 12 ) { nmonth = 0; fprintf(stdout, "\n"); } */
+		month0 = month;
+		fprintf(stdout, " %2d", month0);
+		nmonth++;
+	      }
+
+	    tsID++;
+	  }
+      fprintf(stdout, "\n");
+    }
+  else if ( operatorID == SHOWDATE )
+    {
+      ndate = 0;
+      tsID  = 0;
+      if ( ntsteps != 0 )
+	while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	  {
+	    vdate = taxisInqVdate(taxisID);
+	 
+	    date2str(vdate, vdatestr, sizeof(vdatestr));
+
+	    if ( tsID == 0 || date0 != vdate )
+	      {
+		/* if ( ndate == 10 ) { ndate = 0; fprintf(stdout, "\n"); } */
+		date0 = vdate;
+		fprintf(stdout, " %s", vdatestr);
+		ndate++;
+	      }
+
+	    tsID++;
+	  }
+      fprintf(stdout, "\n");
+    }
+  else if ( operatorID == SHOWTIME )
+    {
+      nout = 0;
+      tsID = 0;
+      if ( ntsteps != 0 )
+	while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	  {
+	    /* if ( nout == 4 ) { nout = 0; fprintf(stdout, "\n"); } */
+	    vtime = taxisInqVtime(taxisID);
+
+	    time2str(vtime, vtimestr, sizeof(vtimestr));
+	    fprintf(stdout, " %s", vtimestr);
+
+	    tsID++;
+	    nout++;
+	  }
+      fprintf(stdout, "\n");
+    }
+  else if ( operatorID == SHOWTIMESTAMP )
+    {
+      nout = 0;
+      tsID = 0;
+      if ( ntsteps != 0 )
+	while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	  {
+	    /* if ( nout == 4 ) { nout = 0; fprintf(stdout, "\n"); } */
+	    vdate = taxisInqVdate(taxisID);
+	    vtime = taxisInqVtime(taxisID);
+
+	    date2str(vdate, vdatestr, sizeof(vdatestr));
+	    time2str(vtime, vtimestr, sizeof(vtimestr));
+	    fprintf(stdout, " %sT%s", vdatestr, vtimestr);
+
+	    tsID++;
+	    nout++;
+	  }
+      fprintf(stdout, "\n");
+    }
+  else if ( operatorID == SHOWCODE )
+    {
+      nout = 0;
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  /* if ( nout == 20 ) { nout = 0; fprintf(stdout, "\n"); } */
+	  fprintf(stdout, " %d", vlistInqVarCode(vlistID, varID));
+	  nout++;
+	}
+      fprintf(stdout, "\n");
+    }
+  else if ( operatorID == SHOWUNIT )
+    {
+      nout = 0;
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  varunits[0] = 0;
+	  vlistInqVarUnits(vlistID, varID, varunits);
+	  /* if ( nout == 20 ) { nout = 0; fprintf(stdout, "\n"); } */
+          if ( strlen(varunits) )
+            fprintf(stdout, " %s", varunits);
+	  nout++;
+	}
+      fprintf(stdout, "\n");
+    }
+  else if ( operatorID == SHOWPARAM )
+    {
+      int param;
+      char paramstr[32];
+      
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  param   = vlistInqVarParam(vlistID, varID);
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+
+	  fprintf(stdout, " %s", paramstr);
+	}
+      fprintf(stdout, "\n");
+    }
+  else if ( operatorID == SHOWNAME )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  vlistInqVarName(vlistID, varID, varname);
+	  fprintf(stdout, " %s", varname);
+	}
+      fprintf(stdout, "\n");
+    }
+  else if ( operatorID == SHOWSTDNAME )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  vlistInqVarStdname(vlistID, varID, stdname);
+	  if ( stdname[0] != 0 )
+	    fprintf(stdout, " %s", stdname);
+	  else
+	    fprintf(stdout, " unknown");
+	}
+      fprintf(stdout, "\n");
+    }
+  else if ( operatorID == SHOWLEVEL )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  zaxisID = vlistInqVarZaxis(vlistID, varID);
+	  nlevs = zaxisInqSize(zaxisID);
+	  for ( levelID = 0; levelID < nlevs; levelID++ )
+	    fprintf(stdout, " %.9g", zaxisInqLevel(zaxisID, levelID));
+	  fprintf(stdout, "\n");
+	}
+    }
+  else if ( operatorID == SHOWLTYPE )
+    {
+      nzaxis = vlistNzaxis(vlistID);
+      for ( index = 0; index < nzaxis; index++ )
+	{
+	  zaxisID = vlistZaxis(vlistID, index);
+
+	  ltype = zaxis2ltype(zaxisID);
+
+	  if ( ltype != -1 ) fprintf(stdout, " %d", ltype);
+	}
+      fprintf(stdout, "\n"); 
+    }
+  else if ( operatorID == SHOWFORMAT )
+    {
+      printFiletype(streamID, vlistID);
+    }
+
+  streamClose(streamID);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Sinfo.c b/src/Sinfo.c
new file mode 100644
index 0000000..a51d6ee
--- /dev/null
+++ b/src/Sinfo.c
@@ -0,0 +1,357 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Sinfo      sinfo           Short dataset information
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+#include "printinfo.h"
+
+#define MAXCHARS 82
+
+void *Sinfo(void *argument)
+{
+  enum {func_generic, func_param, func_name, func_code};
+  int operatorID;
+  int operfunc, lensemble;
+  int indf;
+  int varID;
+  int gridsize = 0;
+  int gridID, zaxisID, code, tabnum, param;
+  int zaxistype, ltype;
+  int vdate, vtime;
+  int nrecs, nvars, nzaxis, ntsteps;
+  int levelID, levelsize;
+  int tsID, ntimeout;
+  int tsteptype, taxisID;
+  int nbyte, nbyte0;
+  int index;
+  char varname[CDI_MAX_NAME];
+  char longname[CDI_MAX_NAME];
+  char units[CDI_MAX_NAME];
+  char paramstr[32];
+  char vdatestr[32], vtimestr[32];
+  double level;
+  char *modelptr, *instptr;
+  int streamID = 0;
+  int vlistID;
+  int datatype;
+  char pstr[4];
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("sinfo",   func_generic, 0, NULL);
+  cdoOperatorAdd("sinfop",  func_param,   0, NULL);
+  cdoOperatorAdd("sinfon",  func_name,    0, NULL);
+  cdoOperatorAdd("sinfoc",  func_code,    0, NULL);
+  cdoOperatorAdd("seinfo",  func_generic, 1, NULL);
+  cdoOperatorAdd("seinfop", func_param,   1, NULL);
+  cdoOperatorAdd("seinfon", func_name,    1, NULL);
+  cdoOperatorAdd("seinfoc", func_code,    1, NULL);
+
+  operatorID = cdoOperatorID();
+
+  operfunc  = cdoOperatorF1(operatorID);
+  lensemble = cdoOperatorF2(operatorID);
+
+  for ( indf = 0; indf < cdoStreamCnt(); indf++ )
+    {
+      streamID = streamOpenRead(cdoStreamName(indf));
+
+      vlistID = streamInqVlist(streamID);
+
+      printf("   File format: ");
+      printFiletype(streamID, vlistID);
+
+      if ( lensemble )
+	{
+	  if ( operfunc == func_name )
+	    fprintf(stdout,
+		    "%6d : Institut Source   Ttype    Einfo Levels Num  Gridsize Num Dtype : Parameter name\n",  -(indf+1));
+	  else if ( operfunc == func_code )
+	    fprintf(stdout,
+		    "%6d : Institut Source   Ttype    Einfo Levels Num  Gridsize Num Dtype : Table Code\n",  -(indf+1));
+	  else
+	    fprintf(stdout,
+		    "%6d : Institut Source   Ttype    Einfo Levels Num  Gridsize Num Dtype : Parameter ID\n",  -(indf+1));
+	}
+      else
+	{
+	  if ( operfunc == func_name )
+	    fprintf(stdout,
+		    "%6d : Institut Source   Ttype    Levels Num  Gridsize Num Dtype : Parameter name\n",  -(indf+1));
+	  else if ( operfunc == func_code )
+	    fprintf(stdout,
+		    "%6d : Institut Source   Ttype    Levels Num  Gridsize Num Dtype : Table Code\n",  -(indf+1));
+	  else
+	    fprintf(stdout,
+		    "%6d : Institut Source   Ttype    Levels Num  Gridsize Num Dtype : Parameter ID\n",  -(indf+1));
+	}
+
+      nvars = vlistNvars(vlistID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  param   = vlistInqVarParam(vlistID, varID);
+	  code    = vlistInqVarCode(vlistID, varID);
+	  tabnum  = tableInqNum(vlistInqVarTable(vlistID, varID));
+	  gridID  = vlistInqVarGrid(vlistID, varID);
+	  zaxisID = vlistInqVarZaxis(vlistID, varID);
+
+	  fprintf(stdout, "%6d : ", varID + 1);
+
+	  /* institute info */
+	  instptr = institutInqNamePtr(vlistInqVarInstitut(vlistID, varID));
+	  if ( instptr )
+	    fprintf(stdout, "%-8s ", instptr);
+	  else
+	    fprintf(stdout, "unknown  ");
+
+	  /* source info */
+	  modelptr = modelInqNamePtr(vlistInqVarModel(vlistID, varID));
+	  if ( modelptr )
+	    fprintf(stdout, "%-8s ", modelptr);
+	  else
+	    fprintf(stdout, "unknown  ");
+
+	  /* tsteptype */
+	  tsteptype = vlistInqVarTsteptype(vlistID, varID);
+	  if      ( tsteptype == TSTEP_CONSTANT ) fprintf(stdout, "%-8s ", "constant");
+	  else if ( tsteptype == TSTEP_INSTANT  ) fprintf(stdout, "%-8s ", "instant");
+	  else if ( tsteptype == TSTEP_INSTANT2 ) fprintf(stdout, "%-8s ", "instant");
+	  else if ( tsteptype == TSTEP_INSTANT3 ) fprintf(stdout, "%-8s ", "instant");
+	  else if ( tsteptype == TSTEP_MIN      ) fprintf(stdout, "%-8s ", "min");
+	  else if ( tsteptype == TSTEP_MAX      ) fprintf(stdout, "%-8s ", "max");
+	  else if ( tsteptype == TSTEP_ACCUM    ) fprintf(stdout, "%-8s ", "accum");
+	  else                                    fprintf(stdout, "%-8s ", "unknown");
+
+	  /* ensemble information */
+	  if ( lensemble )
+	    {
+	      int ensID, ensCount, forecast_type;
+	      if ( vlistInqVarEnsemble(vlistID, varID, &ensID, &ensCount, &forecast_type) )
+		fprintf(stdout, "%2d/%-2d ", ensID, ensCount);
+	      else
+		fprintf(stdout, "--/-- ");
+	    }
+
+	  /* layer info */
+	  levelsize = zaxisInqSize(zaxisID);
+	  fprintf(stdout, "%6d ", levelsize);
+	  fprintf(stdout, "%3d ", vlistZaxisIndex(vlistID, zaxisID) + 1);
+
+	  /* grid info */
+	  gridsize = gridInqSize(gridID);
+	  fprintf(stdout, "%9d ", gridsize);
+	  fprintf(stdout, "%3d ", vlistGridIndex(vlistID, gridID) + 1);
+
+	  /* datatype */
+	  datatype = vlistInqVarDatatype(vlistID, varID);
+	  datatype2str(datatype, pstr);
+
+	  fprintf(stdout, " %-3s", pstr);
+
+	  if ( vlistInqVarCompType(vlistID, varID) == COMPRESS_NONE )
+	    fprintf(stdout, "  ");
+	  else
+	    fprintf(stdout, "z ");
+
+	  /* parameter info */
+	  fprintf(stdout, ": ");
+
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+
+	  if ( operfunc == func_name ) vlistInqVarName(vlistID, varID, varname);
+
+	  if ( operfunc == func_name )
+	    fprintf(stdout, "%-11s", varname);
+	  else if ( operfunc == func_code )
+	    fprintf(stdout, "%4d %4d", tabnum, code);
+	  else
+	    fprintf(stdout, "%-11s", paramstr);
+
+	  fprintf(stdout, "\n");
+	}
+
+      fprintf(stdout, "   Grid coordinates :\n");
+      printGridInfo(vlistID);
+
+      nzaxis = vlistNzaxis(vlistID);
+      fprintf(stdout, "   Vertical coordinates :\n");
+      for ( index = 0; index < nzaxis; index++)
+	{
+	  zaxisID   = vlistZaxis(vlistID, index);
+	  zaxistype = zaxisInqType(zaxisID);
+	  ltype     = zaxisInqLtype(zaxisID);
+	  levelsize = zaxisInqSize(zaxisID);
+	  /* zaxisInqLongname(zaxisID, longname); */
+	  zaxisName(zaxistype, longname);
+	  longname[17] = 0;
+	  zaxisInqUnits(zaxisID, units);
+	  units[12] = 0;
+	  if ( zaxistype == ZAXIS_GENERIC && ltype != 0 )
+	    nbyte0    = fprintf(stdout, "  %4d : %-11s  (ltype=%3d) : ", vlistZaxisIndex(vlistID, zaxisID)+1, longname, ltype);
+	  else
+	    nbyte0    = fprintf(stdout, "  %4d : %-17s  %5s : ", vlistZaxisIndex(vlistID, zaxisID)+1, longname, units);
+	  nbyte = nbyte0;
+	  for ( levelID = 0; levelID < levelsize; levelID++ )
+	    {
+	      if ( nbyte > MAXCHARS )
+		{
+		  fprintf(stdout, "\n");
+		  fprintf(stdout, "%*s", nbyte0, "");
+		  nbyte = nbyte0;
+		}
+	      level = zaxisInqLevel(zaxisID, levelID);
+	      nbyte += fprintf(stdout, "%.9g ", level);
+	    }
+	  fprintf(stdout, "\n");
+	  if ( zaxisInqLbounds(zaxisID, NULL) && zaxisInqUbounds(zaxisID, NULL) )
+	    {
+	      double level1, level2;
+	      nbyte = nbyte0;
+	      nbyte0 = fprintf(stdout, "%33s : ", "bounds");
+	      for ( levelID = 0; levelID < levelsize; levelID++ )
+		{
+		  if ( nbyte > MAXCHARS )
+		    {
+		      fprintf(stdout, "\n");
+		      fprintf(stdout, "%*s", nbyte0, "");
+		      nbyte = nbyte0;
+		    }
+		  level1 = zaxisInqLbound(zaxisID, levelID);
+		  level2 = zaxisInqUbound(zaxisID, levelID);
+		  nbyte += fprintf(stdout, "%.9g-%.9g ", level1, level2);
+		}
+	      fprintf(stdout, "\n");
+	    }
+	}
+
+      taxisID = vlistInqTaxis(vlistID);
+      ntsteps = vlistNtsteps(vlistID);
+
+      if ( ntsteps != 0 )
+	{
+	  if ( ntsteps == CDI_UNDEFID )
+	    fprintf(stdout, "   Time coordinate :  unlimited steps\n");
+	  else
+	    fprintf(stdout, "   Time coordinate :  %d step%s\n", ntsteps, ntsteps == 1 ? "" : "s");
+
+	  if ( taxisID != CDI_UNDEFID )
+	    {
+	      int calendar, tunits;
+
+	      if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
+		{
+		  vdate = taxisInqRdate(taxisID);
+		  vtime = taxisInqRtime(taxisID);
+
+		  date2str(vdate, vdatestr, sizeof(vdatestr));
+		  time2str(vtime, vtimestr, sizeof(vtimestr));
+
+		  fprintf(stdout, "     RefTime = %s %s", vdatestr, vtimestr);
+		      
+		  tunits = taxisInqTunit(taxisID);
+		  if ( tunits != CDI_UNDEFID )
+		    {
+		      if ( tunits == TUNIT_YEAR )
+			fprintf(stdout, "  Units = years");
+		      else if ( tunits == TUNIT_MONTH )
+			fprintf(stdout, "  Units = months");
+		      else if ( tunits == TUNIT_DAY )
+			fprintf(stdout, "  Units = days");
+		      else if ( tunits == TUNIT_12HOURS )
+			fprintf(stdout, "  Units = 12hours");
+		      else if ( tunits == TUNIT_6HOURS )
+			fprintf(stdout, "  Units = 6hours");
+		      else if ( tunits == TUNIT_3HOURS )
+			fprintf(stdout, "  Units = 3hours");
+		      else if ( tunits == TUNIT_HOUR )
+			fprintf(stdout, "  Units = hours");
+		      else if ( tunits == TUNIT_MINUTE )
+			fprintf(stdout, "  Units = minutes");
+		      else if ( tunits == TUNIT_SECOND )
+			fprintf(stdout, "  Units = seconds");
+		      else
+			fprintf(stdout, "  Units = unknown");
+		    }
+	      
+		  calendar = taxisInqCalendar(taxisID);
+		  if ( calendar != CDI_UNDEFID )
+		    {
+		      if      ( calendar == CALENDAR_STANDARD )
+			fprintf(stdout, "  Calendar = STANDARD");
+		      else if ( calendar == CALENDAR_PROLEPTIC )
+			fprintf(stdout, "  Calendar = PROLEPTIC");
+		      else if ( calendar == CALENDAR_360DAYS )
+			fprintf(stdout, "  Calendar = 360DAYS");
+		      else if ( calendar == CALENDAR_365DAYS )
+			fprintf(stdout, "  Calendar = 365DAYS");
+		      else if ( calendar == CALENDAR_366DAYS )
+			fprintf(stdout, "  Calendar = 366DAYS");
+		      else
+			fprintf(stdout, "  Calendar = unknown");
+		    }
+
+		  if ( taxisHasBounds(taxisID) )
+		    fprintf(stdout, "  Bounds = true");
+
+		  fprintf(stdout, "\n");
+		}
+	    }
+
+	  fprintf(stdout, "  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss\n");
+
+	  ntimeout = 0;
+	  tsID = 0;
+	  while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	    {
+	      if ( ntimeout == 4 )
+		{
+		  ntimeout = 0;
+		  fprintf(stdout, "\n");
+		}
+
+	      vdate = taxisInqVdate(taxisID);
+	      vtime = taxisInqVtime(taxisID);
+
+	      date2str(vdate, vdatestr, sizeof(vdatestr));
+	      time2str(vtime, vtimestr, sizeof(vtimestr));
+
+	      fprintf(stdout, " %s %s", vdatestr, vtimestr);
+
+	      ntimeout++;
+	      tsID++;
+	    }
+	  fprintf(stdout, "\n");
+	}
+
+      streamClose(streamID);
+    }
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Smooth9.c b/src/Smooth9.c
new file mode 100644
index 0000000..5e67379
--- /dev/null
+++ b/src/Smooth9.c
@@ -0,0 +1,312 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Smoothstat       smooth9             running 9-point-average
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+void *Smooth9(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2;
+  int gridsize;
+  int gridID;
+  int nrecs, recID;
+  int tsID;
+  int varID, levelID;
+  int vlistID1, vlistID2;
+  int nmiss, nmiss2;
+  int i, j , i2;
+  double avg,divavg;
+  double missval1, missval2;
+  double *array1, *array2;
+  int taxisID1, taxisID2;
+  int nlon, nlat;
+  int gridtype;
+  int nvars;
+  int grid_is_cyclic;
+  int *varIDs = NULL, *mask =  NULL; 
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("smooth9",   0,   0, NULL);
+ 
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nvars = vlistNvars(vlistID1);
+  varIDs  = (int *) malloc(nvars*sizeof(int)); 
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      gridID = vlistInqVarGrid(vlistID1, varID);
+      gridtype = gridInqType(gridID);
+      if ( gridtype == GRID_GAUSSIAN ||
+           gridtype == GRID_LONLAT   ||
+           gridtype == GRID_CURVILINEAR )
+	{
+	  varIDs[varID] = 1;
+	}
+      else
+	{
+	  varIDs[varID] = 0;
+	  cdoWarning("Unsupported grid for varID %d", varID);
+	}
+    }
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize *sizeof(double));
+  mask   = (  int  *) malloc(gridsize *sizeof(int));
+ 
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+	
+	  if ( varIDs[varID] )
+	    {	    
+	      missval1 = vlistInqVarMissval(vlistID1, varID);
+	      missval2 = missval1;
+
+	      gridID = vlistInqVarGrid(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlon = gridInqXsize(gridID);	 
+	      nlat = gridInqYsize(gridID);
+	      grid_is_cyclic = gridIsCircular(gridID);
+	   
+	      for ( i = 0; i < gridsize; i++) 
+		{		
+		  if ( DBL_IS_EQUAL(missval1, array1[i]) ) mask[i] = 0;
+		  else mask[i] = 1;
+		}
+ 
+	      nmiss2=0;
+	      for ( i = 0; i < nlat; i++ )
+		{
+		  for ( i2 = 0; i2 < nlon; i2++ )
+		    {		      
+		      avg = 0; divavg = 0; 	  		     			
+
+		      if ( ( i == 0 ) || ( i2 == 0 )  ||
+                           ( i == ( nlat - 1 ) ) || ( i2 == ( nlon -1 ) ) )
+			{
+			  j = i2+nlon*i;
+			  if ( mask[j] )
+			    {
+			      avg += array1[j];  divavg+= 1;					     		       
+			      /* upper left corner */
+			      if ( (  i!=0 ) && ( i2!=0 ) ) 
+				{ 
+				  j = ((i-1)*nlon)+i2-1;
+				  if ( mask[j] ) 
+				    { avg +=   0.3*array1[j]; divavg+=0.3;}
+				}
+			      else if ( i != 0 && grid_is_cyclic ) 
+				{ 
+				  j = (i-1)*nlon+i2-1+nlon;
+				  if ( mask[j] ) 
+				    { avg+=0.3*array1[j]; divavg+=0.3;}
+				}
+			      
+			      /* upper cell */
+			      if ( i!=0 ) 
+				{
+				  j = ((i-1)*nlon)+i2;
+				  if ( mask[j] )
+				    { avg +=  0.5*array1[j];  divavg+= 0.5; }
+				}
+			      
+			      /* upper right corner */
+			      if ( ( i!=0) && ( i2!=(nlon-1) ) ) 
+				{
+				  j = ((i-1)*nlon)+i2+1;
+				  if ( mask[j] )
+				    { avg +=   0.3*array1[j]; divavg+= 0.3; }
+				}
+			      else if ( i!= 0 && grid_is_cyclic )
+				{ 
+				  j = (i-1)*nlon+i2+1-nlon;
+				  if ( mask[j] ) 
+				    {avg+=0.3*array1[j]; divavg+=0.3;}
+				}
+			      
+			      /* left cell */
+			      if  ( i2!=0 ) 
+				{
+				  j = ((i)*nlon)+i2-1;
+				  if ( mask[j] )
+				    {  avg +=   0.5*array1[j];  divavg+= 0.5;}
+				}
+			      else if ( grid_is_cyclic )
+				{
+				  j = i*nlon-1+nlon;
+				  if ( mask[j] ) 
+				    { avg+=0.5*array1[j]; divavg+=0.5;}
+				}
+			      
+			      /* right cell */
+			      if ( i2!=(nlon-1) ) 
+				{ 
+				  j = (i*nlon)+i2+1;
+				  if ( mask[j] )
+				    {  avg +=   0.5*array1[j]; divavg+= 0.5; } 
+				}
+			      else if ( grid_is_cyclic )
+				{
+				  j = i*nlon+i2+1-nlon;
+				  if (mask[j])
+				    { avg+=0.5*array1[j]; divavg+=0.5;}
+				}
+			      
+			      /* lower left corner */
+			      if ( mask[j] &&  ( (i!=(nlat-1))&& (i2!=0) ) )
+				{	       
+				  j = ((i+1)*nlon+i2-1);
+				  if ( mask[j] )
+				    { avg +=   0.3*array1[j];  divavg+= 0.3; }
+				}
+			      else if ( i!= nlat-1 && grid_is_cyclic ) 
+				{
+				  j= (i+1)*nlon-1+nlon; 
+				  if ( mask[j] ) 
+				    { avg+= 0.3*array1[j]; divavg+=0.3; }
+				}
+			      
+			      /* lower cell */
+			      if  ( i!=(nlat-1) ) 
+				{
+				  j = ((i+1)*nlon)+i2;
+				  if ( mask[j] ) 
+				    { avg += 0.5*array1[j];  divavg+= 0.5;  }
+				}
+			      
+			      /* lower right corner */
+			      if ( i!=(nlat-1) && (i2!=(nlon-1) ) )
+				{
+				  j = ((i+1)*nlon)+i2+1;
+				  if ( mask[j] )
+				    {  avg += 0.3*array1[j]; divavg+= 0.3; }	
+				}
+			      else if ( i != (nlat-1) && grid_is_cyclic )
+				{
+				  j= ((i+1)*nlon)+i2+1-nlon;
+				  if ( mask[j] )
+				    {avg+=0.3*array1[j]; divavg+=0.3;}
+				}
+			    }
+			}
+		      else if ( mask[i2+nlon*i] )
+			{			 
+			  avg += array1[i2+nlon*i]; divavg+= 1;
+			    
+			  j = ((i-1)*nlon)+i2-1;
+			  if ( mask[j] )
+			    { avg += 0.3*array1[j]; divavg+= 0.3; }
+
+			  j = ((i-1)*nlon)+i2;
+			  if ( mask[j] )
+			    { avg += 0.5*array1[j]; divavg+= 0.5; }
+
+			  j = ((i-1)*nlon)+i2+1;
+			  if ( mask[j] )
+			    { avg += 0.3*array1[j]; divavg+= 0.3; }
+
+			  j = ((i)*nlon)+i2-1;
+			  if ( mask[j] )
+			    { avg += 0.5*array1[j]; divavg+= 0.5; }
+
+			  j = (i*nlon)+i2+1;
+			  if ( mask[j] )
+			    { avg += 0.5*array1[j]; divavg+= 0.5; } 
+
+			  j = ((i+1)*nlon+i2-1);	        
+			  if ( mask[j] )
+			    { avg += 0.3*array1[j]; divavg+= 0.3; }
+
+			  j = ((i+1)*nlon)+i2;
+			  if ( mask[j] )
+			    { avg += 0.5*array1[j]; divavg+= 0.5; }
+
+			  j = ((i+1)*nlon)+i2+1;
+			  if ( mask[j] )
+			    { avg += 0.3*array1[j]; divavg+= 0.3; }
+			}
+
+		      if ( fabs(divavg) > 0 )
+			{
+			  array2[i*nlon+i2] = avg/divavg;			
+			}
+		      else 
+			{
+			  array2[i*nlon+i2] = missval2;					
+			  nmiss2++;
+			}
+		    }			    	     
+		}    
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, array2, nmiss2);		
+	    }     	   
+	  else 
+	    {
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, array1, nmiss);
+	    }
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  free(varIDs);
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Sort.c b/src/Sort.c
new file mode 100644
index 0000000..5318ca1
--- /dev/null
+++ b/src/Sort.c
@@ -0,0 +1,243 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Sort sortcode  Sort by code number
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+typedef struct
+{
+  int      recID;
+  int      varID;
+  int      levelID;
+  int      code;
+  double   level;
+  char     name[CDI_MAX_NAME];
+}
+recinfo_t;
+
+static
+int cmpreccode(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  recinfo_t *x = (recinfo_t *) s1;
+  recinfo_t *y = (recinfo_t *) s2;
+  /*
+  printf("%d %d  %d %d\n", x->code, y->code, x, y);
+  */
+  if      ( x->code < y->code ) cmp = -1;
+  else if ( x->code > y->code ) cmp =  1;
+
+  return (cmp);
+}
+
+static
+int cmpreclevel(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  recinfo_t *x = (recinfo_t *) s1;
+  recinfo_t *y = (recinfo_t *) s2;
+  /*
+  printf("%g %g  %d %d\n", x->level, y->level, x, y);
+  */
+  if      ( x->level < y->level ) cmp = -1;
+  else if ( x->level > y->level ) cmp =  1;
+
+  return (cmp);
+}
+
+static
+int cmprecname(const void *s1, const void *s2)
+{
+  recinfo_t *x = (recinfo_t *) s1;
+  recinfo_t *y = (recinfo_t *) s2;
+
+  return (strcmp(x->name, y->name));
+}
+
+static
+int findrec(recinfo_t *recInfo[], int nrecords, int varID, int levelID)
+{
+  int index;
+
+  for ( index = 0; index < nrecords; index++ )
+    if ( recInfo[index]->varID == varID && recInfo[index]->levelID == levelID )
+      break;
+
+  if ( index == nrecords )
+    cdoAbort("Internal problem! Record not found.");
+
+  return (index);
+}
+
+
+void *Sort(void *argument)
+{
+  int SORTCODE, SORTNAME, SORTLEVEL;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs;
+  int tsID, recID, varID, levelID, zaxisID;
+  int nvars, nrecords, nlevel, offset, index;
+  int vlistID1, vlistID2;
+  int gridsize;
+  int nmiss;
+  int *recNmiss;
+  double *single;
+  double **vardata = NULL;
+  recinfo_t **recInfo;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  SORTCODE  = cdoOperatorAdd("sortcode",  0, 0, NULL);
+  SORTNAME  = cdoOperatorAdd("sortname",  0, 0, NULL);
+  SORTLEVEL = cdoOperatorAdd("sortlevel", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+  /*
+  if ( operatorID == SORTCODE )
+      vlistSortCode(vlistID2);
+   else if ( operatorID == SORTNAME )
+      ;
+   else if ( operatorID == SORTLEVEL )
+      ;
+  */
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recNmiss   = (int *) malloc(nrecords*sizeof(int));
+
+  recInfo    = (recinfo_t **) malloc(nrecords*sizeof(recinfo_t *));
+  recInfo[0] = (recinfo_t *) malloc(nrecords*sizeof(recinfo_t));
+
+  for ( index = 1; index < nrecords; index++ )
+    recInfo[index] = recInfo[0] + index;
+
+  vardata = (double **) malloc(nvars*sizeof(double*));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      vardata[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recInfo[recID]->recID   = recID;
+	      recInfo[recID]->varID   = varID;
+	      recInfo[recID]->levelID = levelID;
+	      recInfo[recID]->code    = vlistInqVarCode(vlistID1, varID);
+	      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+	      recInfo[recID]->level   = zaxisInqLevel(zaxisID, levelID);
+	      vlistInqVarName(vlistID1, varID, recInfo[recID]->name);
+	    }
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single   = vardata[varID] + offset;
+
+	  streamReadRecord(streamID1, single, &nmiss);
+
+	  index = findrec(recInfo, nrecords, varID, levelID);
+	  recNmiss[index] = nmiss;
+	}
+
+      if ( tsID == 0 )
+	{
+	  if      ( operatorID == SORTCODE )
+	    qsort(recInfo[0], nrecords, sizeof(recinfo_t), cmpreccode);
+	  else if ( operatorID == SORTNAME )
+	    qsort(recInfo[0], nrecords, sizeof(recinfo_t), cmprecname);
+	  else if ( operatorID == SORTLEVEL )
+	    qsort(recInfo[0], nrecords, sizeof(recinfo_t), cmpreclevel);
+	}
+
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  /*
+	  printf("recID, recID %d %d\n", recID, recInfo[recID]->recID);
+	  */
+	  varID   = recInfo[recID]->varID;
+	  levelID = recInfo[recID]->levelID;
+	  nmiss   = recNmiss[recID];
+
+	  if ( tsID == 0 || vlistInqVarTsteptype(vlistID1, varID) != TSTEP_CONSTANT )
+	    {
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	      offset   = gridsize*levelID;
+	      single   = vardata[varID] + offset;
+
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, single, nmiss);
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    free(vardata[varID]);
+
+  free(vardata);
+
+  free(recInfo[0]);
+  free(recInfo);
+
+  if ( recNmiss ) free(recNmiss);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Sorttimestamp.c b/src/Sorttimestamp.c
new file mode 100644
index 0000000..5f349fa
--- /dev/null
+++ b/src/Sorttimestamp.c
@@ -0,0 +1,232 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+     Sorttimestamp    sorttimestamp         Sort all timesteps
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  NALLOC_INC  1024
+
+typedef struct
+{
+  int      index;
+  double   datetime;
+}
+timeinfo_t;
+
+static
+int cmpdatetime(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  timeinfo_t *x = (timeinfo_t *) s1;
+  timeinfo_t *y = (timeinfo_t *) s2;
+  /*
+  printf("%g %g  %d %d\n", x->datetime, y->datetime, x, y);
+  */
+  if      ( x->datetime < y->datetime ) cmp = -1;
+  else if ( x->datetime > y->datetime ) cmp =  1;
+
+  return (cmp);
+}
+
+
+void *Sorttimestamp(void *argument)
+{
+  int gridsize;
+  int nrecs;
+  int gridID, varID, levelID, recID;
+  int tsID, tsID2, xtsID, lasttsID = -1;
+  int nfiles, fileID;
+  int nts;
+  int nalloc = 0;
+  int streamID1, streamID2;
+  int vlistID1 = -1, vlistID2 = -1, taxisID1, taxisID2 = -1;
+  int nmiss;
+  int nvars = 0, nlevel;
+  int *vdate = NULL, *vtime = NULL;
+  double missval;
+  field_t ***vars = NULL;
+  timeinfo_t *timeinfo;
+
+  cdoInitialize(argument);
+
+  nfiles = cdoStreamCnt() - 1;
+
+  xtsID = 0;
+  for ( fileID = 0; fileID < nfiles; fileID++ )
+    {
+      streamID1 = streamOpenRead(cdoStreamName(fileID));
+
+      vlistID1 = streamInqVlist(streamID1);
+      taxisID1 = vlistInqTaxis(vlistID1);
+
+      if ( fileID == 0 )
+	{
+	  vlistID2 = vlistDuplicate(vlistID1);
+	  taxisID2 = taxisDuplicate(taxisID1);
+	  if ( taxisHasBounds(taxisID2) )
+	    {
+	      cdoWarning("Time bounds unsupported by this operator, removed!");
+	      taxisDeleteBounds(taxisID2);
+	    }
+	}
+      else
+	{
+	  vlistCompare(vlistID2, vlistID1, CMP_ALL);
+	}
+
+      nvars = vlistNvars(vlistID1);
+
+      tsID = 0;
+      while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+	{
+	  if ( xtsID >= nalloc )
+	    {
+	      nalloc += NALLOC_INC;
+	      vdate = (int *) realloc(vdate, nalloc*sizeof(int));
+	      vtime = (int *) realloc(vtime, nalloc*sizeof(int));
+	      vars  = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
+	    }
+
+	  vdate[xtsID] = taxisInqVdate(taxisID1);
+	  vtime[xtsID] = taxisInqVtime(taxisID1);
+
+	  vars[xtsID] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridID  = vlistInqVarGrid(vlistID1, varID);
+	      missval = vlistInqVarMissval(vlistID1, varID);
+	      nlevel  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      
+	      vars[xtsID][varID] = (field_t *) malloc(nlevel*sizeof(field_t));
+
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  vars[xtsID][varID][levelID].grid    = gridID;
+		  vars[xtsID][varID][levelID].missval = missval;
+		  vars[xtsID][varID][levelID].ptr     = NULL;
+		}
+	    }
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      vars[xtsID][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+	      streamReadRecord(streamID1, vars[xtsID][varID][levelID].ptr, &nmiss);
+	      vars[xtsID][varID][levelID].nmiss = nmiss;
+	    }
+
+	  tsID++;
+	  xtsID++;
+	}
+
+      streamClose(streamID1);
+    }
+
+  nts = xtsID;
+
+  timeinfo= (timeinfo_t *) malloc(nts*sizeof(timeinfo_t));
+
+  for ( tsID = 0; tsID < nts; tsID++ )
+    {
+      int calendar, julday, secofday;
+      double vdatetime;
+
+      calendar = taxisInqCalendar(taxisID2);
+      julday = date_to_julday(calendar, vdate[tsID]);
+      secofday = time_to_sec(vtime[tsID]);
+      vdatetime = julday + secofday / 86400.;
+      timeinfo[tsID].index    = tsID;
+      timeinfo[tsID].datetime = vdatetime;
+    }
+  
+
+  qsort(timeinfo, nts, sizeof(timeinfo_t), cmpdatetime);  	      
+
+
+  vlistDefTaxis(vlistID2, taxisID2);
+	  
+  streamID2 = streamOpenWrite(cdoStreamName(nfiles), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID2 = 0;
+  for ( tsID = 0; tsID < nts; tsID++ )
+    {
+      xtsID = timeinfo[tsID].index;
+
+      if ( tsID > 0 )
+	{
+	  if ( IS_EQUAL(timeinfo[tsID].datetime, timeinfo[lasttsID].datetime) )
+	    {
+	      if ( cdoVerbose )
+		{
+		  char vdatestr[32], vtimestr[32];
+		  date2str(vdate[xtsID], vdatestr, sizeof(vdatestr));
+		  time2str(vtime[xtsID], vtimestr, sizeof(vtimestr));
+		  cdoPrint("Timestep %4d %s %s already exists, skipped!", xtsID, vdatestr, vtimestr);
+		}
+	      continue;
+	    }
+	}
+
+      lasttsID = tsID;
+
+      taxisDefVdate(taxisID2, vdate[xtsID]);
+      taxisDefVtime(taxisID2, vtime[xtsID]);
+      streamDefTimestep(streamID2, tsID2++);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      if ( vars[xtsID][varID][levelID].ptr )
+		{
+		  nmiss = vars[xtsID][varID][levelID].nmiss;
+		  streamDefRecord(streamID2, varID, levelID);
+		  streamWriteRecord(streamID2, vars[xtsID][varID][levelID].ptr, nmiss);
+		  free(vars[xtsID][varID][levelID].ptr);
+		}
+	    }
+	  free(vars[xtsID][varID]);
+	}
+      free(vars[xtsID]);      
+    }
+
+  if ( vars  ) free(vars);
+  if ( vdate ) free(vdate);
+  if ( vtime ) free(vtime);
+
+  streamClose(streamID2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Specinfo.c b/src/Specinfo.c
new file mode 100644
index 0000000..8735a5b
--- /dev/null
+++ b/src/Specinfo.c
@@ -0,0 +1,493 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Specinfo specinfo  Spectral information
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define NTR2NSP(ntr)          ((ntr+1)*(ntr+2))
+#define NSP2NTR(nsp)          ((int) ((((sqrt((double)(4*nsp+1)))-3)/2)))
+#define NGP2NLEVEL(ngp)        ((int) (log10(((double)ngp)/80.)/log10(4.)))
+#define NGP_ICON(nrooti,nlevel) ((int) (20*nrooti*nrooti*ipow(4, nlevel)))
+/*#define NGP_GME(ni)           ((ni+1)*(ni+1)*10)*/
+#define NGP_GME(ni)           (2+ni*ni*10)
+#define NGP2NI(ngp)           ((int) sqrt((double)ngp/10.) - 1)
+
+
+static void fac(int nlonin, int *nlonout, int *ierr)
+{
+  int n2, n3, n5;
+  int m;
+  
+  n2 = 0;
+  n3 = 0;
+  n5 = 0;
+
+  m = nlonin;
+
+  while (m%2 == 0)
+    {
+      m = m/2;
+      n2++;
+    }
+  while (m%3 == 0)
+    {
+      m = m/3;
+      n3++;
+    }
+  while (m%5 == 0)
+    {
+      m = m/5;
+      n5++;
+    }
+
+  if (m == 1) {
+    *nlonout = nlonin;
+    *ierr = 0;
+  } else {
+    *nlonout =  nlonin+1;
+    *ierr = 1;
+  }
+
+  return;
+}
+
+
+static int compnlon(int nlat)
+{
+  int nlon, n;
+
+  nlon = 2 * nlat;
+
+  /* check that FFT works with nlon */
+  while ( 1 )
+    {
+      n = nlon;
+      if    ( n % 8 == 0 )  { n /= 8; }
+      while ( n % 6 == 0 )  { n /= 6; }
+      while ( n % 5 == 0 )  { n /= 5; }
+      while ( n % 4 == 0 )  { n /= 4; }
+      while ( n % 3 == 0 )  { n /= 3; }
+      if    ( n % 2 == 0 )  { n /= 2; }
+
+      if ( n <= 8 ) break;
+
+      nlon = nlon + 4;
+
+      if ( nlon > 9999 )
+	{
+	  nlon = 2 * nlat;
+	  fprintf(stderr, "FFT does not work with len %d!\n", nlon);
+	  break;
+	}
+    }
+
+  return (nlon);
+}
+
+
+static int nlat2nlon(int nlat)
+{
+  int nlon, m, ierr;
+
+  if ( nlat == 0 )
+    cdoAbort("nlat = 0!");
+
+  nlon = 2*nlat;
+
+  fac(nlon, &m, &ierr);
+  /* adjust till fft is possible */
+  while (ierr != 0) 
+    {
+      nlon = m;
+      /* correct here nlon so that nlat keeps always even */
+      while (nlon%4 != 0) nlon++;
+      fac(nlon, &m, &ierr);
+    }
+
+  return (nlon);
+}
+
+
+int ngp2ntr(int ngp)
+{
+  int ntr, nlatl, nlonl;
+
+  ntr = NINT(sqrt(0.25+ngp)-1.5);
+  nlatl = ntr2nlat_linear(ntr);
+  nlonl = compnlon(nlatl);
+  nlatl = nlonl/2;
+
+  ntr = (2*nlatl-1)/2;
+
+  return (ntr);
+}
+
+
+int ipow(int i1, int i2)
+{
+  int i;
+  int i3 = 1;
+
+  for ( i = 0; i < i2; ++i ) i3 *= i1;
+
+  return (i3);
+}
+
+
+void lookup_ni(int nsp, int *nroot, int *ni)
+{
+  int tbl2[12], tbl3[12], tbl5[12];
+  int i, d, d2, n2, d3, n3, d5, n5 ;
+    
+  for ( i = 0; i < 12; ++i )
+    {
+      tbl2[i] = 10*2*2*ipow(4, (i+1))+2;
+      tbl3[i] = 10*3*3*ipow(4, (i+1))+2;
+      tbl5[i] = 10*5*5*ipow(4, (i+1))+2;
+    }
+
+  for ( i = 0; i < 12; ++i ) if (tbl2[i] >= nsp) break;
+  n2 = i;
+  d2 = tbl2[n2]-nsp;
+
+  for ( i = 0; i < 12; ++i ) if (tbl3[i] >= nsp) break;
+  n3 = i;
+  d3 = tbl3[n3]-nsp;
+
+  for ( i = 0; i < 12; ++i ) if (tbl5[i] >= nsp) break;
+  n5 = i;
+  d5 = tbl5[n5]-nsp;
+
+  d = d2;
+  if ( d3 < d ) d = d3;
+  if ( d5 < d ) d = d5;
+
+  if ( d == d2 )
+    {
+      *nroot = 2;
+      *ni = 2*ipow(2, n2+1);
+    }
+  else if ( d == d3 )
+    {
+      *nroot = 3;
+      *ni = 3*ipow(2, n3+1);
+    }
+  else if ( d == d5 )
+    {
+      *nroot = 5;
+      *ni = 5*ipow(2, n5+1);
+    }
+}
+
+
+void lookup_rl(int nsp, int *nroot, int *nlevel)
+{
+  int tbl2[12], tbl3[12], tbl5[12];
+  int i, d, d2, n2, d3, n3, d5, n5 ;
+    
+  for ( i = 0; i < 12; ++i )
+    {
+      tbl2[i] = 20*2*2*ipow(4, (i+1));
+      tbl3[i] = 20*3*3*ipow(4, (i+1));
+      tbl5[i] = 20*5*5*ipow(4, (i+1));
+    }
+
+  for ( i = 0; i < 12; ++i ) if (tbl2[i] >= nsp) break;
+  n2 = i;
+  d2 = tbl2[n2]-nsp;
+
+  for ( i = 0; i < 12; ++i ) if (tbl3[i] >= nsp) break;
+  n3 = i;
+  d3 = tbl3[n3]-nsp;
+
+  for ( i = 0; i < 12; ++i ) if (tbl5[i] >= nsp) break;
+  n5 = i;
+  d5 = tbl5[n5]-nsp;
+
+  d = d2;
+  if ( d3 < d ) d = d3;
+  if ( d5 < d ) d = d5;
+
+  if ( d == d2 )
+    {
+      *nroot = 2;
+      *nlevel = n2+1;
+    }
+  else if ( d == d3 )
+    {
+      *nroot = 3;
+      *nlevel = n3+1;
+    }
+  else if ( d == d5 )
+    {
+      *nroot = 5;
+      *nlevel = n5+1;
+    }
+}
+
+
+void *Specinfo(void *argument)
+{
+  char arg[128], *parg;
+  int len, i, nout1 = 0, nout2 = 0;
+  int ntr1 = 0, nsp1 = 0, nlat1 = 0, nlon1 = 0, ngp1 = 0, ni1 = 0, ngp_gme1 = 0;
+  int ntr2 = 0, nsp2 = 0, nlat2 = 0, nlon2 = 0, ngp2 = 0, ni2 = 0, ngp_gme2 = 0;
+  int nlevel1 = 0, nlevel2 = 0, ngp_icon1 = 0, ngp_icon2 = 0;
+  int nrootg1 = 0, nrooti1 = 0, nrootg2 = 0, nrooti2 = 0;
+
+  cdoInitialize(argument);
+
+  operatorInputArg("Txx, TLxx, NLON=xx, NLAT=xx, NIxx or ICONRyyLxx");
+
+  len = strlen(operatorArgv()[0]);
+
+  if ( (len+1) >= 128 ) cdoAbort("Parameter string to large!");
+
+  for ( i = 0; i < len; i++ ) arg[i] = toupper(operatorArgv()[0][i]);
+  arg[len] = 0;
+
+  if ( arg[0] == 'T' && arg[1] == 'L' )
+    {
+      parg = &arg[2];
+      if ( *parg == '=' ) parg++;
+      if ( ! isdigit((int) *parg) ) cdoAbort("Wrong parameter: %s", arg);
+      ntr2   = atoi(parg);
+      nsp2   = NTR2NSP(ntr2);
+      nlat2  = ntr2nlat_linear(ntr2);
+      nlon2  = compnlon(nlat2);
+      ngp2   = nlon2*nlat2;
+
+      lookup_ni(nsp2, &nrootg2, &ni2);
+      lookup_rl(nsp2, &nrooti2, &nlevel2);
+
+      nout1  = FALSE;
+      nout2  = TRUE;
+    }
+  else if ( arg[0] == 'T' )
+    {
+      parg = &arg[1];
+      if ( *parg == '=' ) parg++;
+      if ( ! isdigit((int) *parg) ) cdoAbort("Wrong parameter: %s", arg);
+      ntr1   = atoi(parg);
+      nsp1   = NTR2NSP(ntr1);
+      nlat1  = ntr2nlat(ntr1);
+      nlon1  = compnlon(nlat1);
+      ngp1   = nlon1*nlat1;
+
+      lookup_ni(nsp1, &nrootg1, &ni1);
+      lookup_rl(nsp1, &nrooti1, &nlevel1);
+
+      nout1  = TRUE;
+      nout2  = FALSE;
+    }
+  else if ( arg[0] == 'N' && arg[1] == 'I' )
+    {
+      parg = &arg[2];
+      if ( *parg == '=' ) parg++;
+      if ( ! isdigit((int) *parg) ) cdoAbort("Wrong parameter: %s", arg);
+      ni1    = atoi(parg);
+      ni2    = ni1;
+      ngp_gme1 = NGP_GME(ni1);
+      ngp_gme2 = NGP_GME(ni2);
+
+      ntr1 = ngp2ntr(ngp_gme1);
+
+      nsp1 = NTR2NSP(ntr1);
+      ntr1 = NSP2NTR(nsp1);
+      ntr2 = ntr1;
+
+      nlat1 = ntr2nlat(ntr1);
+      nlon1 = compnlon(nlat1);
+      nlat1 = nlon1/2;
+
+      nlat2 = ntr2nlat_linear(ntr2);
+      nlon2 = compnlon(nlat2);
+      nlat2 = nlon2/2;
+
+      /* lookup_ni(nsp1, &nrootg1, &ni1); */
+      lookup_rl(nsp1, &nrooti1, &nlevel1);
+
+      nrootg2 = nrootg1;
+      ni2 = ni1;
+      nrooti2 = nrooti1;
+      nlevel2 = nlevel1;
+
+      nout1  = TRUE;
+      nout2  = TRUE;
+    }
+  else if ( arg[0] == 'N' && arg[1] == 'L' && arg[2] == 'O' && arg[3] == 'N' )
+    {
+      parg = &arg[4];
+      if ( *parg == '=' ) parg++;
+      if ( ! isdigit((int) *parg) ) cdoAbort("Wrong parameter: %s", arg);
+      nlon1  = atoi(parg);
+      nlon2  = nlon1;
+      nlat1  = nlon1 / 2;
+      nlat2  = nlon2 / 2;
+      nlon1  = nlat2nlon(nlat1);
+      nlon2  = nlat2nlon(nlat2);
+      nlat1  = nlon1 / 2;
+      nlat2  = nlon2 / 2;
+      ntr1   = (nlat1*2-1)/3;
+      ntr2   = (nlat2*2-1)/2;
+      ngp1   = nlon1*nlat1;
+      ngp2   = nlon2*nlat2;
+
+      nsp1   = NTR2NSP(ntr1);
+      nsp2   = NTR2NSP(ntr2);
+
+      lookup_ni(nsp1, &nrootg1, &ni1);
+      lookup_rl(nsp1, &nrooti1, &nlevel1);
+
+      lookup_ni(nsp2, &nrootg2, &ni2);
+      lookup_rl(nsp2, &nrooti2, &nlevel2);
+
+      nout1  = TRUE;
+      nout2  = TRUE;
+    }
+  else if ( arg[0] == 'N' && arg[1] == 'L' && arg[2] == 'A' && arg[3] == 'T' )
+    {
+      parg = &arg[4];
+      if ( *parg == '=' ) parg++;
+      if ( ! isdigit((int) *parg) ) cdoAbort("Wrong parameter: %s", arg);
+      nlat1  = atoi(parg);
+      nlat2  = nlat1;
+      nlon1  = nlat2nlon(nlat1);
+      nlon2  = nlat2nlon(nlat2);
+      nlat1  = nlon1 / 2;
+      nlat2  = nlon2 / 2;
+      ntr1   = (nlat1*2-1)/3;
+      ntr2   = (nlat2*2-1)/2;
+      ngp1   = nlon1*nlat1;
+      ngp2   = nlon2*nlat2;
+
+      nsp1   = NTR2NSP(ntr1);
+      nsp2   = NTR2NSP(ntr2);
+
+      lookup_ni(nsp1, &nrootg1, &ni1);
+      lookup_rl(nsp1, &nrooti1, &nlevel1);
+
+      lookup_ni(nsp2, &nrootg2, &ni2);
+      lookup_rl(nsp2, &nrooti2, &nlevel2);
+
+      nout1  = TRUE;
+      nout2  = TRUE;
+    }
+  else if ( arg[0] == 'N' )
+    {
+      parg = &arg[1];
+      if ( *parg == '=' ) parg++;
+      if ( ! isdigit((int) *parg) ) cdoAbort("Wrong parameter: %s", arg);
+      nlat1  = 2*atoi(parg);
+      nlat2  = nlat1;
+      nlon1  = nlat2nlon(nlat1);
+      nlon2  = nlat2nlon(nlat2);
+      nlat1  = nlon1 / 2;
+      nlat2  = nlon2 / 2;
+      ntr1   = (nlat1*2-1)/3;
+      ntr2   = (nlat2*2-1)/2;
+      ngp1   = nlon1*nlat1;
+      ngp2   = nlon2*nlat2;
+
+      nsp1   = NTR2NSP(ntr1);
+      nsp2   = NTR2NSP(ntr2);
+
+      lookup_ni(nsp1, &nrootg1, &ni1);
+      lookup_rl(nsp1, &nrooti1, &nlevel1);
+
+      lookup_ni(nsp2, &nrootg2, &ni2);
+      lookup_rl(nsp2, &nrooti2, &nlevel2);
+
+      nout1  = TRUE;
+      nout2  = TRUE;
+    }
+  else if ( arg[0] == 'I' && arg[1] == 'C' && arg[2] == 'O' && arg[3] == 'N' )
+    {
+      parg = &arg[4];
+      if ( *parg != 'R' ) cdoAbort("Wrong parameter: %s", arg);
+      parg++;
+      if ( ! isdigit((int) *parg) ) cdoAbort("Wrong parameter: %s", arg);
+      nrooti1 = atoi(parg);
+      nrooti2 = nrooti1;
+      while ( isdigit((int) *parg) ) parg++;
+      if ( *parg != 'L' ) cdoAbort("Wrong parameter: %s", arg);
+      parg++;
+      if ( ! isdigit((int) *parg) ) cdoAbort("Wrong parameter: %s", arg);
+      nlevel1 = atoi(parg);
+      nlevel2 = nlevel1;
+      ngp_icon1 = NGP_ICON(nrooti1,nlevel1);
+      ngp_icon2 = NGP_ICON(nrooti1,nlevel2);
+
+      ntr1 = ngp2ntr(ngp_icon1);
+      nsp1 = NTR2NSP(ntr1);
+      ntr1 = NSP2NTR(nsp1);
+      ntr2 = ntr1;
+
+      nlat1 = ntr2nlat(ntr1);
+      nlon1 = compnlon(nlat1);
+      nlat1 = nlon1/2;
+
+      nlat2 = ntr2nlat_linear(ntr2);
+      nlon2 = compnlon(nlat2);
+      nlat2 = nlon2/2;
+
+      lookup_ni(nsp1, &nrootg1, &ni1);
+      /* lookup_rl(nsp1, &nrooti1, &nlevel1);*/
+
+      nrootg2 = nrootg1;
+      ni2 = ni1;
+      nrooti2 = nrooti1;
+      nlevel2 = nlevel1;
+
+      nout1  = TRUE;
+      nout2  = TRUE;
+    }
+  else
+    cdoAbort("Unsupported parameter: %s", arg);
+
+  nsp1      = NTR2NSP(ntr1);
+  nsp2      = NTR2NSP(ntr2);
+  ngp1      = nlon1*nlat1;
+  ngp2      = nlon2*nlat2;
+  ngp_gme1  = NGP_GME(ni1);
+  ngp_gme2  = NGP_GME(ni2);
+  ngp_icon1 = NGP_ICON(nrooti1,nlevel1);
+  ngp_icon2 = NGP_ICON(nrooti2,nlevel2);
+
+  fprintf(stdout, "truncation     nsp  nlon  nlat      ngp  gme   ngp_gme  icon  ngp_icon\n");
+
+  if ( nout1 ) fprintf(stdout, "   T%-4d  %8d %5d %5d %8d  ni%d %8d  R%dL%d  %8d\n",
+		       ntr1, nsp1, nlon1, nlat1, ngp1, ni1, ngp_gme1, nrooti1, nlevel1, ngp_icon1);
+
+  if ( nout2 ) fprintf(stdout, "   TL%-4d %8d %5d %5d %8d  ni%d %8d  R%dL%d  %8d\n",
+		       ntr2, nsp2, nlon2, nlat2, ngp2, ni2, ngp_gme2, nrooti2, nlevel2, ngp_icon2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Spectral.c b/src/Spectral.c
new file mode 100644
index 0000000..b0f9402
--- /dev/null
+++ b/src/Spectral.c
@@ -0,0 +1,310 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Spectral   sp2gp           Spectral to gridpoint
+      Spectral   sp2gpl          Spectral to gridpoint linear
+      Spectral   gp2sp           Gridpoint to spectral
+      Spectral   gp2spl          Gridpoint to spectral linear
+      Spectral   sp2sp           Spectral to spectral
+      Spectral   spcut           Cut spectral wave number
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "specspace.h"
+#include "list.h"
+
+
+void *Spectral(void *argument)
+{
+  int GP2SP, GP2SPL, SP2GP, SP2GPL, SP2SP, SPCUT;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs, nvars;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int index, ngrids;
+  int vlistID1, vlistID2;
+  int gridIDsp = -1, gridIDgp = -1;
+  int gridID1 = -1, gridID2 = -1;
+  int gridID;
+  int nmiss;
+  int ncut = 0;
+  int *wnums = NULL, *waves = NULL;
+  int *vars;
+  int lcopy = FALSE;
+  double *array1 = NULL, *array2 = NULL;
+  int taxisID1, taxisID2;
+  int nlon, nlat, ntr;
+  SPTRANS *sptrans = NULL;
+  LIST *ilist = listNew(INT_LIST);
+
+  cdoInitialize(argument);
+
+  GP2SP  = cdoOperatorAdd("gp2sp",  0, 0, NULL);
+  GP2SPL = cdoOperatorAdd("gp2spl", 0, 0, NULL);
+  SP2GP  = cdoOperatorAdd("sp2gp",  0, 0, NULL);
+  SP2GPL = cdoOperatorAdd("sp2gpl", 0, 0, NULL);
+  SP2SP  = cdoOperatorAdd("sp2sp",  0, 0, NULL);
+  SPCUT  = cdoOperatorAdd("spcut",  0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids = vlistNgrids(vlistID1);
+  /* find first spectral grid */
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID = vlistGrid(vlistID1, index);
+      if ( gridInqType(gridID) == GRID_SPECTRAL )
+	{
+	  gridIDsp = gridID;
+	  break;
+	}
+    }
+  /* find first gaussian grid */
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID = vlistGrid(vlistID1, index);
+      if ( gridInqType(gridID) == GRID_GAUSSIAN )
+	{
+	  gridIDgp = gridID;
+	  break;
+	}
+    }
+
+  /* define output grid */
+  if ( operatorID == GP2SP || operatorID == GP2SPL )
+    {
+      gridID1 = gridIDgp;
+
+      if ( gridID1 != -1 )
+	{
+	  if ( operatorID == GP2SP )
+	    ntr = nlat2ntr(gridInqYsize(gridID1));
+	  else
+	    ntr = nlat2ntr_linear(gridInqYsize(gridID1));
+
+	  if ( gridIDsp != -1 )
+	    if ( ntr != gridInqTrunc(gridIDsp) ) gridIDsp = -1;
+
+	  if ( gridIDsp == -1 )
+	    {
+	      gridIDsp = gridCreate(GRID_SPECTRAL, (ntr+1)*(ntr+2));
+	      gridDefTrunc(gridIDsp, ntr);
+	      gridDefComplexPacking(gridIDsp, 1);
+	    }
+	}
+
+      if ( gridIDsp == -1 && gridInqType(vlistGrid(vlistID1, 0)) == GRID_GAUSSIAN_REDUCED )
+	cdoAbort("Gaussian reduced grid found. Use option -R to convert it to a regular grid!");
+
+      if ( gridIDsp == -1 ) cdoAbort("No Gaussian grid data found!");
+
+      gridID2 = gridIDsp;
+
+      nlon = gridInqXsize(gridID1);
+      nlat = gridInqYsize(gridID1);
+      ntr  = gridInqTrunc(gridID2);
+
+      sptrans = sptrans_new(nlon, nlat, ntr, 0);
+    }
+  else if ( operatorID == SP2GP || operatorID == SP2GPL )
+    {   
+      if ( gridIDsp == -1 ) cdoWarning("No spectral data found!");
+
+      gridID1 = gridIDsp;
+
+      if ( gridID1 != -1 )
+	{
+	  if ( gridIDgp != -1 )
+	    {
+	      if ( operatorID == SP2GP )
+		ntr = nlat2ntr(gridInqYsize(gridIDgp));
+	      else
+		ntr = nlat2ntr_linear(gridInqYsize(gridIDgp));
+
+	      if ( gridInqTrunc(gridIDsp) != ntr ) gridIDgp = -1;
+	    }
+
+	  if ( gridIDgp == -1 )
+	    {
+	      char gridname[20];
+	      if ( operatorID == SP2GP )
+		sprintf(gridname, "t%dgrid", gridInqTrunc(gridIDsp));
+	      else
+		sprintf(gridname, "tl%dgrid", gridInqTrunc(gridIDsp));
+
+	      gridIDgp = gridFromName(gridname);
+	    }
+
+	  gridID2 = gridIDgp;
+
+	  ntr  = gridInqTrunc(gridID1);
+	  nlon = gridInqXsize(gridID2);
+	  nlat = gridInqYsize(gridID2);
+      
+	  sptrans = sptrans_new(nlon, nlat, ntr, 0);
+	}
+    }
+  else if ( operatorID == SP2SP )
+    {
+      gridID1 = gridIDsp;
+
+      operatorInputArg("truncation");
+      if ( gridID1 != -1 )
+	{
+	  int ntr = atoi(operatorArgv()[0]);
+	  int nsp = (ntr+1)*(ntr+2);
+	  gridIDsp = gridCreate(GRID_SPECTRAL, nsp);
+	  gridDefTrunc(gridIDsp, ntr);
+	  gridDefComplexPacking(gridIDsp, 1);
+	}
+      else
+	cdoAbort("No spectral data found!");
+
+      gridID2 = gridIDsp;
+    }
+  else if ( operatorID == SPCUT )
+    {
+      long i, j, maxntr;
+      gridID1 = gridIDsp;
+
+      operatorInputArg("wave numbers");
+      if ( gridID1 != -1 )
+	{
+	  maxntr = 1+gridInqTrunc(gridID1);
+	  ncut = args2intlist(operatorArgc(), operatorArgv(), ilist);
+	  wnums = (int *) listArrayPtr(ilist);
+	  waves = (int *) malloc(maxntr*sizeof(int));
+	  for ( i = 0; i < maxntr; i++ ) waves[i] = 1;
+	  for ( i = 0; i < ncut; i++ )
+	    {
+	      j = wnums[i] - 1;
+	      if ( j < 0 || j >= maxntr )
+		cdoAbort("wave number %d out of range (min=1, max=%d)!", wnums[i], maxntr);
+	      waves[j] = 0;
+	    }
+	}
+      else
+	cdoAbort("No spectral data found!");
+
+      gridID2 = gridIDsp;
+    }
+
+  nvars = vlistNvars(vlistID2);
+  vars  = (int *) malloc(nvars*sizeof(int));
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( gridID1 == vlistInqVarGrid(vlistID1, varID) )
+	vars[varID] = TRUE;
+      else
+	vars[varID] = FALSE;
+    }
+
+  if ( gridID1 != -1 ) vlistChangeGrid(vlistID2, gridID1, gridID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array1 = (double *) malloc(gridsize*sizeof(double));
+
+  if ( gridID2 != -1 )
+    {
+      gridsize = gridInqSize(gridID2);
+      array2 = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( vars[varID] )
+	    {
+	      streamReadRecord(streamID1, array1, &nmiss);
+	      if ( nmiss ) cdoAbort("Missing values unsupported for spectral data!");
+
+	      gridID1 = vlistInqVarGrid(vlistID1, varID);
+	      if ( operatorID == GP2SP || operatorID == GP2SPL )
+		grid2spec(sptrans, gridID1, array1, gridID2, array2);	      
+	      else if ( operatorID == SP2GP || operatorID == SP2GPL )
+		spec2grid(sptrans, gridID1, array1, gridID2, array2);
+	      else if ( operatorID == SP2SP )
+		spec2spec(gridID1, array1, gridID2, array2);
+	      else if ( operatorID == SPCUT )
+		speccut(gridID1, array1, array2, waves);
+
+	      streamDefRecord(streamID2, varID, levelID);
+	      streamWriteRecord(streamID2, array2, nmiss);  
+	    }   
+	  else
+	    {
+	      streamDefRecord(streamID2, varID, levelID);
+	      if ( lcopy )
+		{
+		  streamCopyRecord(streamID2, streamID1);
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array1, &nmiss);
+		  streamWriteRecord(streamID2, array1, nmiss);
+		}
+	    }    
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+  if ( vars )   free(vars);
+  if ( waves )  free(waves);
+
+  listDelete(ilist);
+
+  sptrans_delete(sptrans);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Spectrum.c b/src/Spectrum.c
new file mode 100644
index 0000000..ba73a8f
--- /dev/null
+++ b/src/Spectrum.c
@@ -0,0 +1,408 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Spectrum    spectrum         Spectrum
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+#include "statistic.h"
+
+
+#define  NALLOC_INC  1000
+
+
+static
+void spectrum(int nrec, double *data, double *spectrum, double *real, double *imag, double *window,
+	      double wssum, int detrend, int seg_n, int seg_l)
+{
+  int k;
+  double sumx, sumkx;
+  double a, b;
+  int seg_i, offset;
+  int bit;
+
+  for ( bit = seg_l; !(bit & 1); bit >>= 1 );
+
+  if ( detrend == 1 )
+    {
+      sumx = 0;
+      for (k = 0; k < nrec; k++) sumx += data[k];
+      sumx /= nrec;
+      for (k = 0; k < nrec; k++) data[k] -= sumx;
+    }
+  else if ( detrend == 2 )
+    {
+      sumx = sumkx = 0;
+      for (k = 0; k < nrec; k++)
+	{
+	  sumx += data[k];
+	  sumkx += k * data[k];
+	}
+      b = (sumkx - sumx * (nrec - 1) / 2.)
+	/ ((nrec + 1) * nrec * (nrec - 1) / 12.);
+      a = sumx / nrec - b * (nrec - 1) / 2.;
+      for (k = 0; k < nrec; k++)
+	data[k] -= a + b * k;
+    }
+	
+  for (seg_i = 0; seg_i < seg_n; seg_i += 2)
+    {
+      offset = seg_n == 1 ? 0 : (int) ((double) (nrec - seg_l) / (seg_n - 1) * seg_i);
+      
+      for ( k = 0; k < seg_l; k++ ) real[k] = data[offset + k];
+
+      if (detrend == 3)
+	{
+	  sumx = sumkx = 0;
+	  for (k = 0; k < seg_l; k++)
+	    {
+	      sumx += real[k];
+	      sumkx += k * real[k];
+	    }
+
+	  b = (sumkx - sumx * (seg_l - 1) / 2.)
+	    / ((seg_l + 1) * seg_l * (seg_l - 1) / 12.);
+	  a = sumx / seg_l - b * (seg_l - 1) / 2.;
+	
+	  for (k = 0; k < seg_l; k++)
+	    real[k] -= a + b * k;
+	}
+		
+      for (k = 0; k < seg_l; k++)
+	real[k] *= window[k];
+      
+      if (seg_i + 1 < seg_n)
+	{
+	  offset = seg_n == 1 ? 0 : (int) ((double) (nrec - seg_l) / (seg_n - 1) * (seg_i + 1));
+	  for (k = 0; k < seg_l; k++)
+	    imag[k] = data[offset + k];
+	  if ( detrend == 3 )
+	    {
+	      sumx = sumkx = 0;
+	      for (k = 0; k < seg_l; k++)
+		{
+		  sumx += imag[k];
+		  sumkx += k * imag[k];
+		}
+	      
+	      b = (sumkx - sumx * (seg_l - 1) / 2.)
+		/ ((seg_l + 1) * seg_l * (seg_l - 1) / 12.);
+	      a = sumx / seg_l - b * (seg_l - 1) / 2.;
+	      
+	      for (k = 0; k < seg_l; k++)
+		imag[k] -= a + b * k;
+	    }
+		
+	  for (k = 0; k < seg_l; k++)
+	    imag[k] *= window[k];
+	}
+      else
+	for (k = 0; k < seg_l; k++)
+	  imag[k] = 0;
+      
+      if (bit == 1)	/* seg_l is a power of 2 */
+	fft (real, imag, seg_l, 1);
+      else
+	ft (real, imag, seg_l, 1);
+	
+      spectrum[0] += real[0] * real[0] + imag[0] * imag[0];
+      
+      for (k = 1; k < (seg_l + 1) / 2; k++)
+	spectrum[k] += real[k] * real[k] + imag[k] * imag[k]
+	  + real[seg_l - k] * real[seg_l - k]
+	  + imag[seg_l - k] * imag[seg_l - k];
+      
+      if (!(seg_l & 1))
+	spectrum[seg_l / 2] +=
+	  real[seg_l / 2] * real[seg_l / 2] +
+	  imag[seg_l / 2] * imag[seg_l / 2];
+    }
+	
+  for (k = 0; k <= seg_l / 2; k++)
+    spectrum[k] *= seg_l / (seg_n * wssum);
+
+  spectrum[0] *= 2;
+ 
+  if (!(seg_l & 1)) spectrum[seg_l / 2] *= 2;
+}
+
+
+void *Spectrum(void *argument)
+{
+  int gridsize;
+  int nrecs;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int i, k;
+  int nts;
+  int nalloc = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int *vdate = NULL, *vtime = NULL;
+  int freq, nfreq;
+  int seg_l, seg_n, detrend, which_window;
+  double missval;
+  double wssum;
+  double *array1, *array2;
+  double *real, *imag, *window;
+  field_t ***vars = NULL;
+  field_t ***vars2 = NULL;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisCreate(TAXIS_ABSOLUTE);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars = vlistNvars(vlistID1);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      if ( tsID >= nalloc )
+	{
+	  nalloc += NALLOC_INC;
+	  vdate = (int *) realloc(vdate, nalloc*sizeof(int));
+	  vtime = (int *) realloc(vtime, nalloc*sizeof(int));
+	  vars  = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
+	}
+
+      vdate[tsID] = taxisInqVdate(taxisID1);
+      vtime[tsID] = taxisInqVtime(taxisID1);
+
+      vars[tsID] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+
+	  vars[tsID][varID] = (field_t *) malloc(nlevel*sizeof(field_t));
+
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      vars[tsID][varID][levelID].grid    = gridID;
+	      vars[tsID][varID][levelID].missval = missval;
+	      vars[tsID][varID][levelID].ptr     = NULL;
+	    }
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  vars[tsID][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+	  streamReadRecord(streamID1, vars[tsID][varID][levelID].ptr, &nmiss);
+	  vars[tsID][varID][levelID].nmiss = nmiss;
+
+	  if ( nmiss > 0 ) cdoAbort("Missing values are not allowed!");
+	}
+
+      tsID++;
+    }
+
+  nts = tsID;
+
+
+  operatorInputArg("detrend type, length of segments, number of segments, window type\n\n"
+		   "       detrend type: 0 - data should be used unchanged\n"
+		   "                     1 - the mean of the whole time series should be subtracted\n"
+		   "                     2 - the whole time series should be detrended\n"
+		   "                     3 - every segment should be detrended\n\n"
+		   "        window type: 0 - no data windowing\n"
+		   "                     1 - Hann window\n"
+		   "                     2 - Bartlett window\n"
+		   "                     3 - Welch window\n");
+
+  operatorCheckArgc(4);
+
+  detrend = atoi(operatorArgv()[0]);
+  seg_l = atoi(operatorArgv()[1]);
+  seg_n = atoi(operatorArgv()[2]);
+  which_window = atoi(operatorArgv()[3]);
+
+  if ( detrend < 0 || detrend > 3 )
+    cdoAbort("Illegal value for detrend (=%d)!",detrend);
+  
+  if ( seg_l <= 2 || seg_l > nts )
+    cdoAbort("Length must be at least 3 and at most the number of timesteps (=%d)", nts);
+
+  if ( seg_n <= 0 || seg_n > nts - seg_l + 1 )
+    cdoAbort("Number of segments must be positiv and not greater than %d!", nts - seg_l + 1);
+
+
+  nfreq = seg_l/2 + 1;
+
+  vars2 = (field_t ***) malloc(nfreq*sizeof(field_t **));
+  for ( freq = 0; freq < nfreq; freq++ )
+    {
+      vars2[freq] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      
+	  vars2[freq][varID] = (field_t *) malloc(nlevel*sizeof(field_t));
+      
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      vars2[freq][varID][levelID].grid    = gridID;
+	      vars2[freq][varID][levelID].missval = missval;
+	      vars2[freq][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+	    }
+	}
+    }
+
+
+  array1  = (double *) malloc(nts*sizeof(double));
+
+  array2  = (double *) malloc(nfreq * sizeof(double));
+  real    = (double *) malloc(seg_l * sizeof(double));
+  imag    = (double *) malloc(seg_l * sizeof(double));
+  window  = (double *) malloc(seg_l * sizeof(double));
+  	   
+  switch (which_window)
+    {
+    case 0:
+      for (k = 0; k < seg_l; k++)
+	window[k] = 1;
+      break;
+    case 1:
+      for (k = 0; k < seg_l; k++)
+	window[k] = 1 - cos (2 * M_PI * (k + 1) / (seg_l + 1));
+      break;
+    case 2:
+      for (k = 0; k < seg_l / 2; k++)
+	window[k] = window[seg_l - 1 - k] = k;
+      break;
+    case 3:
+      for (k = 0; k < seg_l; k++)
+	{
+	  double temp;
+	  temp = ((k + 1.) - 0.5 * (seg_l + 1.)) / (0.5 * (seg_l + 1.));
+	  window[k] = 1 - temp * temp;
+	}
+      break;
+    default:
+      cdoAbort("Invalid window type %d!", which_window);
+    }
+  
+  wssum = 0;
+  for ( k = 0; k < seg_l; k++ )
+    wssum += window[k] * window[k];
+
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      missval  = vlistInqVarMissval(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+	      for ( tsID = 0; tsID < nts; tsID++ )
+		array1[tsID] = vars[tsID][varID][levelID].ptr[i];
+
+	      for ( freq = 0; freq < nfreq; freq++ ) array2[freq] = 0;
+
+	      spectrum(nts, array1, array2, real, imag, window, wssum, detrend, seg_n, seg_l);
+
+	      for ( freq = 0; freq < nfreq; freq++ )
+		vars2[freq][varID][levelID].ptr[i] = array2[freq];
+	    }
+	}
+    }
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+
+  for ( tsID = 0; tsID < nts; tsID++ )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    if ( vars[tsID][varID][levelID].ptr )
+	      free(vars[tsID][varID][levelID].ptr);
+
+	  free(vars[tsID][varID]);
+	}
+      free(vars[tsID]);
+    }
+
+  for ( tsID = 0; tsID < nfreq; tsID++ )
+    {
+      taxisDefVdate(taxisID2, vdate[0]);
+      taxisDefVtime(taxisID2, vtime[0]);
+      streamDefTimestep(streamID2, tsID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      if ( vars2[tsID][varID][levelID].ptr )
+		{
+		  nmiss = vars2[tsID][varID][levelID].nmiss;
+		  streamDefRecord(streamID2, varID, levelID);
+		  streamWriteRecord(streamID2, vars2[tsID][varID][levelID].ptr, 0);
+		  free(vars2[tsID][varID][levelID].ptr);
+		}
+	    }
+	  free(vars2[tsID][varID]);
+	}
+      free(vars2[tsID]);
+    }
+
+  if ( vars  ) free(vars);
+  if ( vars2 ) free(vars2);
+  if ( vdate ) free(vdate);
+  if ( vtime ) free(vtime);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Split.c b/src/Split.c
new file mode 100644
index 0000000..a811636
--- /dev/null
+++ b/src/Split.c
@@ -0,0 +1,516 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Split      splitcode       Split codes
+      Split      splitparam      Split parameters
+      Split      splitname       Split variables
+      Split      splitlevel      Split levels
+      Split      splitgrid       Split grids
+      Split      splitzaxis      Split zaxis
+      Split      splittabnum     Split table numbers
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+static
+void gen_filename(char *filename, int swap_obase, const char *obase, const char *suffix)
+{
+  if ( swap_obase ) strcat(filename, obase);
+  if ( suffix[0] ) strcat(filename, suffix);
+}
+
+
+void *Split(void *argument)
+{
+  int SPLITCODE, SPLITPARAM, SPLITNAME, SPLITLEVEL, SPLITGRID, SPLITZAXIS, SPLITTABNUM;
+  int operatorID;
+  int nchars = 0;
+  int streamID1;
+  int varID;
+  int code, tabnum, param;
+  int nrecs, nvars, nzaxis, nlevs;
+  int tsID, recID, levelID, zaxisID, levID;
+  int varID2, levelID2;
+  int vlistID1, vlistID2;
+  int *vlistIDs = NULL, *streamIDs = NULL;
+  int  itmp[999];
+  double ftmp[999];
+  char filesuffix[32];
+  char filename[8192];
+  int nsplit = 0;
+  int index;
+  int i;
+  int lcopy = FALSE;
+  int gridsize;
+  int nmiss;
+  int swap_obase = FALSE;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  SPLITCODE   = cdoOperatorAdd("splitcode",   0, 0, NULL);
+  SPLITPARAM  = cdoOperatorAdd("splitparam",  0, 0, NULL);
+  SPLITNAME   = cdoOperatorAdd("splitname",   0, 0, NULL);
+  SPLITLEVEL  = cdoOperatorAdd("splitlevel",  0, 0, NULL);
+  SPLITGRID   = cdoOperatorAdd("splitgrid",   0, 0, NULL);
+  SPLITZAXIS  = cdoOperatorAdd("splitzaxis",  0, 0, NULL);
+  SPLITTABNUM = cdoOperatorAdd("splittabnum", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorArgc() == 1 )
+    if ( memcmp("swap", operatorArgv()[0], 4) == 0 ) swap_obase = TRUE;
+
+  if ( operatorArgc() > 1 ) cdoAbort("Too many arguments!");
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  nvars  = vlistNvars(vlistID1);
+  nrecs  = vlistNrecs(vlistID1);
+  nzaxis = vlistNzaxis(vlistID1);
+
+  if ( swap_obase == 0 )
+    {
+      strcpy(filename, cdoStreamName(1));
+      nchars = strlen(filename);
+    }
+
+  filesuffix[0] = 0;
+  cdoGenFileSuffix(filesuffix, sizeof(filesuffix), cdoDefaultFileType, vlistID1);
+
+  if ( operatorID == SPLITCODE )
+    {
+      int *codes = NULL;
+      nsplit = 0;
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  code = vlistInqVarCode(vlistID1, varID);
+	  for ( index = 0; index < varID; index++ )
+	    if ( code == vlistInqVarCode(vlistID1, index) ) break;
+
+	  if ( index == varID )
+	    {
+	      itmp[nsplit] = code;
+	      nsplit++;
+	    }
+	}
+
+      codes     = (int *) malloc(nsplit*sizeof(int));
+      vlistIDs  = (int *) malloc(nsplit*sizeof(int));
+      streamIDs = (int *) malloc(nsplit*sizeof(int));
+      memcpy(codes, itmp, nsplit*sizeof(int));
+
+      for ( index = 0; index < nsplit; index++ )
+	{
+	  vlistClearFlag(vlistID1);
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      code    = vlistInqVarCode(vlistID1, varID);
+	      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+	      nlevs   = zaxisInqSize(zaxisID);
+	      if ( codes[index] == code )
+		{
+		  for ( levID = 0; levID < nlevs; levID++ )
+		    {
+		      vlistDefIndex(vlistID1, varID, levID, index);
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		    }
+		}
+	    }
+
+	  vlistID2 = vlistCreate();
+	  vlistCopyFlag(vlistID2, vlistID1);
+	  vlistIDs[index] = vlistID2;
+
+	  if ( codes[index] > 9999 )
+	    {
+	      sprintf(filename+nchars, "%05d", codes[index]);
+	      gen_filename(filename, swap_obase, cdoStreamName(1), filesuffix);
+	    }
+	  else if ( codes[index] > 999 )
+	    {
+	      sprintf(filename+nchars, "%04d", codes[index]);
+	      gen_filename(filename, swap_obase, cdoStreamName(1), filesuffix);
+	    }
+	  else
+	    {
+	      sprintf(filename+nchars, "%03d", codes[index]);
+	      gen_filename(filename, swap_obase, cdoStreamName(1), filesuffix);
+	    }
+
+	  streamIDs[index] = streamOpenWrite(filename, cdoFiletype());
+
+	  streamDefVlist(streamIDs[index], vlistIDs[index]);
+	}
+      if ( codes ) free(codes);
+    }
+  else if ( operatorID == SPLITPARAM )
+    {
+      char paramstr[32];
+      int *params = NULL;
+      nsplit = 0;
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  param = vlistInqVarParam(vlistID1, varID);
+	  for ( index = 0; index < varID; index++ )
+	    if ( param == vlistInqVarParam(vlistID1, index) ) break;
+
+	  if ( index == varID )
+	    {
+	      itmp[nsplit] = param;
+	      nsplit++;
+	    }
+	}
+
+      params    = (int *) malloc(nsplit*sizeof(int));
+      vlistIDs  = (int *) malloc(nsplit*sizeof(int));
+      streamIDs = (int *) malloc(nsplit*sizeof(int));
+      memcpy(params, itmp, nsplit*sizeof(int));
+
+      for ( index = 0; index < nsplit; index++ )
+	{
+	  vlistClearFlag(vlistID1);
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      param   = vlistInqVarParam(vlistID1, varID);
+	      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+	      nlevs   = zaxisInqSize(zaxisID);
+	      if ( params[index] == param )
+		{
+		  for ( levID = 0; levID < nlevs; levID++ )
+		    {
+		      vlistDefIndex(vlistID1, varID, levID, index);
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		    }
+		}
+	    }
+
+	  vlistID2 = vlistCreate();
+	  vlistCopyFlag(vlistID2, vlistID1);
+	  vlistIDs[index] = vlistID2;
+
+	  cdiParamToString(params[index], paramstr, sizeof(paramstr));
+
+	  filename[nchars] = '\0';
+	  strcat(filename, paramstr);
+	  gen_filename(filename, swap_obase, cdoStreamName(1), filesuffix);
+
+	  streamIDs[index] = streamOpenWrite(filename, cdoFiletype());
+
+	  streamDefVlist(streamIDs[index], vlistIDs[index]);
+	}
+      if ( params ) free(params);
+    }
+  else if ( operatorID == SPLITTABNUM )
+    {
+      int *tabnums = NULL;
+      nsplit = 0;
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  tabnum  = tableInqNum(vlistInqVarTable(vlistID1, varID));
+	  for ( index = 0; index < varID; index++ )
+	    if ( tabnum == tableInqNum(vlistInqVarTable(vlistID1, index)) ) break;
+
+	  if ( index == varID )
+	    {
+	      itmp[nsplit] = tabnum;
+	      nsplit++;
+	    }
+	}
+
+      tabnums   = (int *) malloc(nsplit*sizeof(int));
+      vlistIDs  = (int *) malloc(nsplit*sizeof(int));
+      streamIDs = (int *) malloc(nsplit*sizeof(int));
+      memcpy(tabnums, itmp, nsplit*sizeof(int));
+
+      for ( index = 0; index < nsplit; index++ )
+	{
+	  vlistClearFlag(vlistID1);
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      tabnum  = tableInqNum(vlistInqVarTable(vlistID1, varID));
+	      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+	      nlevs   = zaxisInqSize(zaxisID);
+	      if ( tabnums[index] == tabnum )
+		{
+		  for ( levID = 0; levID < nlevs; levID++ )
+		    {
+		      vlistDefIndex(vlistID1, varID, levID, index);
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		    }
+		}
+	    }
+	  vlistID2 = vlistCreate();
+	  vlistCopyFlag(vlistID2, vlistID1);
+	  vlistIDs[index] = vlistID2;
+
+	  sprintf(filename+nchars, "%03d", tabnums[index]);
+	  gen_filename(filename, swap_obase, cdoStreamName(1), filesuffix);
+
+	  streamIDs[index] = streamOpenWrite(filename, cdoFiletype());
+
+	  streamDefVlist(streamIDs[index], vlistIDs[index]);
+	}
+      if ( tabnums ) free(tabnums);
+    }
+  else if ( operatorID == SPLITNAME )
+    {
+      char varname[CDI_MAX_NAME];
+      nsplit = nvars;
+
+      vlistIDs  = (int *) malloc(nsplit*sizeof(int));
+      streamIDs = (int *) malloc(nsplit*sizeof(int));
+
+      for ( index = 0; index < nsplit; index++ )
+	{
+	  vlistClearFlag(vlistID1);
+	  varID = index;
+	  zaxisID = vlistInqVarZaxis(vlistID1, varID);
+	  nlevs   = zaxisInqSize(zaxisID);
+	  for ( levID = 0; levID < nlevs; levID++ )
+	    {
+	      vlistDefIndex(vlistID1, varID, levID, index);
+	      vlistDefFlag(vlistID1, varID, levID, TRUE);
+	    }
+
+	  vlistID2 = vlistCreate();
+	  vlistCopyFlag(vlistID2, vlistID1);
+	  vlistIDs[index] = vlistID2;
+
+	  filename[nchars] = '\0';
+	  vlistInqVarName(vlistID1, varID, varname);
+	  strcat(filename, varname);
+	  gen_filename(filename, swap_obase, cdoStreamName(1), filesuffix);
+
+	  streamIDs[index] = streamOpenWrite(filename, cdoFiletype());
+
+	  streamDefVlist(streamIDs[index], vlistID2);
+	}
+    }
+  else if ( operatorID == SPLITLEVEL )
+    {
+      double level, *levels = NULL;
+      nzaxis = vlistNzaxis(vlistID1);
+      nsplit = 0;
+      for ( index = 0; index < nzaxis; index++ )
+	{
+	  zaxisID = vlistZaxis(vlistID1, index);
+	  nlevs   = zaxisInqSize(zaxisID);
+	  for ( levID = 0; levID < nlevs; levID++ )
+	    {
+	      level = zaxisInqLevel(zaxisID, levID);
+	      for ( i = 0; i < nsplit; i++ )
+		if ( IS_EQUAL(level, ftmp[i]) ) break;
+	      if ( i == nsplit )
+		ftmp[nsplit++] = level;
+	    }
+	}
+
+      levels    = (double *) malloc(nsplit*sizeof(double));
+      vlistIDs  = (int *) malloc(nsplit*sizeof(int));
+      streamIDs = (int *) malloc(nsplit*sizeof(int));
+      memcpy(levels, ftmp, nsplit*sizeof(double));
+
+      for ( index = 0; index < nsplit; index++ )
+	{
+	  vlistClearFlag(vlistID1);
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+	      nlevs   = zaxisInqSize(zaxisID);
+	      for ( levID = 0; levID < nlevs; levID++ )
+		{
+		  level = zaxisInqLevel(zaxisID, levID);
+		  if ( IS_EQUAL(levels[index], level) )
+		    {
+		      vlistDefIndex(vlistID1, varID, levID, index);
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		    }
+		}
+	    }
+	  vlistID2 = vlistCreate();
+	  vlistCopyFlag(vlistID2, vlistID1);
+	  vlistIDs[index] = vlistID2;
+
+	  sprintf(filename+nchars, "%06g", levels[index]);
+	  gen_filename(filename, swap_obase, cdoStreamName(1), filesuffix);
+   
+	  streamIDs[index] = streamOpenWrite(filename, cdoFiletype());
+
+	  streamDefVlist(streamIDs[index], vlistID2);
+	}
+      if ( levels ) free(levels);
+    }
+  else if ( operatorID == SPLITGRID )
+    {
+      int gridID, *gridIDs = NULL;
+
+      nsplit = vlistNgrids(vlistID1);
+
+      gridIDs   = (int *) malloc(nsplit*sizeof(int));
+      vlistIDs  = (int *) malloc(nsplit*sizeof(int));
+      streamIDs = (int *) malloc(nsplit*sizeof(int));
+
+      for ( index = 0; index < nsplit; index++ )
+	gridIDs[index] = vlistGrid(vlistID1, index);
+
+      for ( index = 0; index < nsplit; index++ )
+	{
+	  vlistClearFlag(vlistID1);
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridID  = vlistInqVarGrid(vlistID1, varID);
+	      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+	      nlevs   = zaxisInqSize(zaxisID);
+	      if ( gridIDs[index] == gridID )
+		{
+		  for ( levID = 0; levID < nlevs; levID++ )
+		    {
+		      vlistDefIndex(vlistID1, varID, levID, index);
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		    }
+		}
+	    }
+	  vlistID2 = vlistCreate();
+	  vlistCopyFlag(vlistID2, vlistID1);
+	  vlistIDs[index] = vlistID2;
+
+	  sprintf(filename+nchars, "%02d", vlistGridIndex(vlistID1, gridIDs[index])+1);
+	  gen_filename(filename, swap_obase, cdoStreamName(1), filesuffix);
+
+	  streamIDs[index] = streamOpenWrite(filename, cdoFiletype());
+
+	  streamDefVlist(streamIDs[index], vlistID2);
+	}
+      if ( gridIDs ) free(gridIDs);
+    }
+  else if ( operatorID == SPLITZAXIS )
+    {
+      int zaxisID, *zaxisIDs = NULL;
+
+      nsplit = vlistNzaxis(vlistID1);
+
+      zaxisIDs  = (int *) malloc(nsplit*sizeof(int));
+      vlistIDs  = (int *) malloc(nsplit*sizeof(int));
+      streamIDs = (int *) malloc(nsplit*sizeof(int));
+
+      for ( index = 0; index < nsplit; index++ )
+	zaxisIDs[index] = vlistZaxis(vlistID1, index);
+
+      for ( index = 0; index < nsplit; index++ )
+	{
+	  vlistClearFlag(vlistID1);
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      zaxisID = vlistInqVarZaxis(vlistID1, varID);
+	      nlevs   = zaxisInqSize(zaxisID);
+	      if ( zaxisIDs[index] == zaxisID )
+		{
+		  for ( levID = 0; levID < nlevs; levID++ )
+		    {
+		      vlistDefIndex(vlistID1, varID, levID, index);
+		      vlistDefFlag(vlistID1, varID, levID, TRUE);
+		    }
+		}
+	    }
+	  vlistID2 = vlistCreate();
+	  vlistCopyFlag(vlistID2, vlistID1);
+	  vlistIDs[index] = vlistID2;
+
+	  sprintf(filename+nchars, "%02d", vlistZaxisIndex(vlistID1, zaxisIDs[index])+1);
+	  gen_filename(filename, swap_obase, cdoStreamName(1), filesuffix);
+
+	  streamIDs[index] = streamOpenWrite(filename, cdoFiletype());
+
+	  streamDefVlist(streamIDs[index], vlistID2);
+	}
+      if ( zaxisIDs ) free(zaxisIDs);
+    }
+  else
+    {
+      cdoAbort("not implemented!");
+    }
+
+  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      for ( index = 0; index < nsplit; index++ )
+	streamDefTimestep(streamIDs[index], tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  index    = vlistInqIndex(vlistID1, varID, levelID);
+	  vlistID2 = vlistIDs[index];
+	  varID2   = vlistFindVar(vlistID2, varID);
+	  levelID2 = vlistFindLevel(vlistID2, varID, levelID);
+	  /*
+	    printf("%d %d %d %d %d %d\n", index, vlistID2, varID, levelID, varID2, levelID2);
+	  */
+	  streamDefRecord(streamIDs[index], varID2, levelID2);
+	  if ( lcopy )
+	    {
+	      streamCopyRecord(streamIDs[index], streamID1);
+	    }
+	  else
+	    {
+	      streamReadRecord(streamID1, array, &nmiss);
+	      streamWriteRecord(streamIDs[index], array, nmiss);
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID1);
+
+  for ( index = 0; index < nsplit; index++ )
+    {
+      streamClose(streamIDs[index]);
+      vlistDestroy(vlistIDs[index]);
+    }
+ 
+  if ( ! lcopy )
+    if ( array ) free(array);
+
+  if ( vlistIDs  ) free(vlistIDs);
+  if ( streamIDs ) free(streamIDs);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Splitrec.c b/src/Splitrec.c
new file mode 100644
index 0000000..5b557a5
--- /dev/null
+++ b/src/Splitrec.c
@@ -0,0 +1,125 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Split      splitrec        Split records
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Splitrec(void *argument)
+{
+  int nchars;
+  int streamID1, streamID2;
+  int varID;
+  int nrecs;
+  int tsID, recID, levelID;
+  int varID2, levelID2;
+  int vlistID1, vlistID2;
+  char filesuffix[32];
+  char filename[8192];
+  int index;
+  int lcopy = FALSE;
+  int gridsize;
+  int nmiss;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  nrecs  = vlistNrecs(vlistID1);
+
+  strcpy(filename, cdoStreamName(1));
+  nchars = strlen(filename);
+
+  filesuffix[0] = 0;
+  cdoGenFileSuffix(filesuffix, sizeof(filesuffix), cdoDefaultFileType, vlistID1);
+
+  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  index = 0;
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  vlistClearFlag(vlistID1);
+	  vlistDefFlag(vlistID1, varID, levelID, TRUE);
+
+	  vlistID2 = vlistCreate();
+	  vlistCopyFlag(vlistID2, vlistID1);
+
+	  index++;
+	  sprintf(filename+nchars, "%06d", index);
+	  if ( filesuffix[0] )
+	    sprintf(filename+nchars+6, "%s", filesuffix);
+
+	  if ( cdoVerbose ) cdoPrint("create file %s", filename);
+
+	  streamID2 = streamOpenWrite(filename, cdoFiletype());
+
+	  streamDefVlist(streamID2, vlistID2);
+
+	  varID2   = vlistFindVar(vlistID2, varID);
+	  levelID2 = vlistFindLevel(vlistID2, varID, levelID);
+
+	  streamDefTimestep(streamID2, 0);
+	  streamDefRecord(streamID2, varID2, levelID2);
+	  if ( lcopy )
+	    {
+	      streamCopyRecord(streamID2, streamID1);
+	    }
+	  else
+	    {
+	      streamReadRecord(streamID1, array, &nmiss);
+	      streamWriteRecord(streamID2, array, nmiss);
+	    }
+
+	  streamClose(streamID2);
+	  vlistDestroy(vlistID2);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID1);
+
+  if ( ! lcopy )
+    if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Splitsel.c b/src/Splitsel.c
new file mode 100644
index 0000000..7c6b4d7
--- /dev/null
+++ b/src/Splitsel.c
@@ -0,0 +1,280 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Splitsel   splitsel        Split time selection
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Splitsel(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int gridsize;
+  int vdate = 0, vtime = 0;
+  int nrecs = 0;
+  int varID, levelID, recID;
+  int tsID, tsID2;
+  int nsets;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int gridID;
+  int nvars, nlevel;
+  int nconst;
+/*   int ndates = 0, noffset = 0, nskip = 0, nargc; */
+  double ndates, noffset, nskip;
+  int i2 = 0;
+  int nargc;
+
+  /* from Splittime.c */
+  int nchars;
+  char filesuffix[32];
+  char filename[8192];
+  int index = 0;
+  int lcopy = FALSE;
+  double *array = NULL;
+  field_t **vars = NULL;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("splitsel",  0,  0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  /*  operatorInputArg("nsets <noffset <nskip>>"); */
+
+  nargc = operatorArgc();
+
+  if ( nargc < 1 )
+    cdoAbort("Too few arguments! Need %d found %d.", 1, nargc);
+
+/*   ndates = atoi(operatorArgv()[0]); */
+/*   if ( nargc > 1 ) noffset = atoi(operatorArgv()[1]); */
+/*   if ( nargc > 2 ) nskip   = atoi(operatorArgv()[2]); */
+/*   printf("%s %s %s\n", operatorArgv()[0],operatorArgv()[1],operatorArgv()[2]); */
+  ndates = noffset = nskip = 0.0;
+  ndates = atof(operatorArgv()[0]);
+  if ( nargc > 1 ) noffset = atof(operatorArgv()[1]);
+  if ( nargc > 2 ) nskip   = atof(operatorArgv()[2]);
+
+  if ( cdoVerbose ) cdoPrint("nsets = %f, noffset = %f, nskip = %f", ndates, noffset, nskip);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+/*   taxisID2 = taxisCreate(TAXIS_ABSOLUTE); */
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  strcpy(filename, cdoStreamName(1));
+  nchars = strlen(filename);
+
+  filesuffix[0] = 0;
+  cdoGenFileSuffix(filesuffix, sizeof(filesuffix), cdoDefaultFileType, vlistID1);
+
+  //  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  nvars = vlistNvars(vlistID1);
+  nconst = 0;
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) nconst++;
+
+  if ( nconst )
+    {
+      vars = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT )
+	    {
+	      gridID  = vlistInqVarGrid(vlistID1, varID);
+	      nlevel  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      gridsize = gridInqSize(gridID);
+		  
+	      vars[varID] = (field_t *) malloc(nlevel*sizeof(field_t));
+
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  vars[varID][levelID].grid    = gridID;
+		  vars[varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		}
+	    }
+	}
+    }
+
+
+  /* offset */
+  for ( tsID = 0; tsID < noffset; tsID++ )
+    {
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 )
+	{
+	  cdoWarning("noffset is larger than number of timesteps!");
+	  goto LABEL_END;
+	}
+
+      if ( tsID == 0 && nconst )
+	for ( recID = 0; recID < nrecs; recID++ )
+	  {
+	    streamInqRecord(streamID1, &varID, &levelID);
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT )
+	      streamReadRecord(streamID1, vars[varID][levelID].ptr, &vars[varID][levelID].nmiss);
+	  }
+    }
+
+  index = 0;
+  nsets = 0;
+  while ( TRUE )
+    {
+      sprintf(filename+nchars, "%06d", index);
+      sprintf(filename+nchars+6, "%s", filesuffix);
+	  
+      if ( cdoVerbose ) cdoPrint("create file %s", filename);
+      streamID2 = streamOpenWrite(filename, cdoFiletype());
+
+      streamDefVlist(streamID2, vlistID2);
+
+      tsID2 = 0;
+
+      for ( ; nsets < (int)(ndates*(index+1)); nsets++ ) 
+	{
+	  nrecs = streamInqTimestep(streamID1, tsID);
+	  if ( nrecs == 0 ) break;
+
+	  vdate = taxisInqVdate(taxisID1);
+	  vtime = taxisInqVtime(taxisID1);
+	  /* printf("vdate: %d vtime: %d\n", vdate, vtime); */
+
+	  taxisCopyTimestep(taxisID2, taxisID1);
+	  streamDefTimestep(streamID2, tsID2);
+
+	  if ( tsID > 0 && tsID2 == 0 && nconst )
+	    {
+	      for ( varID = 0; varID < nvars; varID++ )
+		{
+		  if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT )
+		    {
+		      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+		      for ( levelID = 0; levelID < nlevel; levelID++ )
+			{
+			  streamDefRecord(streamID2, varID, levelID);
+			  nmiss = vars[varID][levelID].nmiss;
+			  streamWriteRecord(streamID2, vars[varID][levelID].ptr, nmiss);
+			}
+		    }
+		}
+	    }
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      
+	      streamInqRecord(streamID1, &varID, &levelID);
+	      streamDefRecord(streamID2,  varID,  levelID);
+	      if ( lcopy && !(tsID == 0 && nconst) )
+		{
+		  streamCopyRecord(streamID2, streamID1);
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array, &nmiss);
+		  streamWriteRecord(streamID2, array, nmiss);
+
+		  if ( tsID == 0 && nconst )
+		    {
+		      if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT )
+			{
+			  gridID  = vlistInqVarGrid(vlistID1, varID);
+			  gridsize = gridInqSize(gridID);
+			  memcpy(vars[varID][levelID].ptr, array, gridsize*sizeof(double));
+			  vars[varID][levelID].nmiss = nmiss;
+			}
+		    }
+		}
+	    }
+	  
+	  tsID++;
+	  tsID2++;	  
+	}
+      
+      streamClose(streamID2);
+      if ( nrecs == 0 ) break;
+
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 ) break;
+
+      for ( ; i2 < (int)(nskip*(index+1)); i2++ )
+	{
+	  nrecs = streamInqTimestep(streamID1, tsID);
+	  if ( nrecs == 0 ) break;
+	  tsID++;
+	}
+
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 ) break;
+
+      index++;
+    }
+
+ LABEL_END:
+
+  streamClose(streamID1);
+ 
+  if ( array ) free(array);
+
+  if ( nconst )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vlistInqVarTsteptype(vlistID2, varID) == TSTEP_CONSTANT )
+	    {
+	      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		if ( vars[varID][levelID].ptr )
+		  free(vars[varID][levelID].ptr);
+
+	      free(vars[varID]);
+	    }
+	}
+
+      if ( vars  ) free(vars);
+    }
+
+  vlistDestroy(vlistID2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Splittime.c b/src/Splittime.c
new file mode 100644
index 0000000..dd13853
--- /dev/null
+++ b/src/Splittime.c
@@ -0,0 +1,284 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Splittime  splithour       Split hours
+      Splittime  splitday        Split days
+      Splittime  splitmon        Split months
+      Splittime  splitseas       Split seasons
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+
+#define  MAX_STREAMS 32
+
+void *Splittime(void *argument)
+{
+  int SPLITHOUR, SPLITDAY, SPLITMON, SPLITSEAS;
+  int operatorID;
+  int operfunc, operintval;
+  int nchars;
+  int streamID1, streamID2;
+  int varID;
+  int nrecs;
+  int tsID, recID, levelID;
+  int vlistID1, vlistID2;
+  int  streamIDs[MAX_STREAMS], tsIDs[MAX_STREAMS];
+  char filesuffix[32];
+  char filename[8192];
+  int index = 0;
+  int i;
+  int taxisID1, taxisID2;
+  int vdate, vtime;
+  int lcopy = FALSE;
+  int gridsize;
+  int nmiss;
+  int gridID;
+  int nvars, nlevel;
+  int nconst;
+  double *array = NULL;
+  field_t **vars = NULL;
+  int season_start;
+  const char *seas_name[4];
+
+  cdoInitialize(argument);
+
+  SPLITHOUR = cdoOperatorAdd("splithour", func_time, 10000, NULL);
+  SPLITDAY  = cdoOperatorAdd("splitday",  func_date,     1, NULL);
+  SPLITMON  = cdoOperatorAdd("splitmon",  func_date,   100, NULL);
+  SPLITSEAS = cdoOperatorAdd("splitseas", func_date,   100, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc   = cdoOperatorF1(operatorID);
+  operintval = cdoOperatorF2(operatorID);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  season_start = get_season_start();
+  get_season_name(seas_name);
+
+  for ( i = 0; i < MAX_STREAMS; i++ ) streamIDs[i] = -1;
+  for ( i = 0; i < MAX_STREAMS; i++ ) tsIDs[i] = 0;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  strcpy(filename, cdoStreamName(1));
+  nchars = strlen(filename);
+
+  filesuffix[0] = 0;
+  cdoGenFileSuffix(filesuffix, sizeof(filesuffix), cdoDefaultFileType, vlistID1);
+
+  //  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  nvars = vlistNvars(vlistID1);
+  nconst = 0;
+  for ( varID = 0; varID < nvars; varID++ )
+    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) nconst++;
+
+  if ( nconst )
+    {
+      vars = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT )
+	    {
+	      gridID  = vlistInqVarGrid(vlistID1, varID);
+	      nlevel  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      gridsize = gridInqSize(gridID);
+		  
+	      vars[varID] = (field_t *) malloc(nlevel*sizeof(field_t));
+
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  vars[varID][levelID].grid    = gridID;
+		  vars[varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		}
+	    }
+	}
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      if ( operfunc == func_date )
+	{
+	  index = (vdate/operintval)%100;
+
+	  if ( operatorID == SPLITSEAS )
+	    {
+	      if ( index < 0 || index > 16 )
+		cdoAbort("Month %d out of range!", index);
+
+	      if ( season_start == START_DEC )
+		{
+		  if ( index <= 12 )
+		    index = (index % 12) / 3;
+		  else
+		    index = index - 13;
+		}
+	      else
+		{
+		  if ( index <= 12 )
+		    index = (index - 1) / 3;
+		  else
+		    index = index - 13;
+		}
+	      
+	      if ( index < 0 || index > 3 )
+		cdoAbort("Season %d out of range!", index+1);
+	    }
+	}
+      else if ( operfunc == func_time )
+	{
+	  index = (vtime/operintval)%100;
+	}
+
+      if ( index < 0 || index >= MAX_STREAMS )
+	cdoAbort("Index out of range!");
+
+      streamID2 = streamIDs[index];
+      if ( streamID2 < 0 )
+	{
+	  if ( operatorID == SPLITSEAS )
+	    {
+	      sprintf(filename+nchars, "%3s", seas_name[index]);
+	      if ( filesuffix[0] )
+		sprintf(filename+nchars+3, "%s", filesuffix);
+	    }
+	  else
+	    {
+	      sprintf(filename+nchars, "%02d", index);
+	      if ( filesuffix[0] )
+		sprintf(filename+nchars+2, "%s", filesuffix);
+	    }
+
+	  if ( cdoVerbose ) cdoPrint("create file %s", filename);
+
+	  streamID2 = streamOpenWrite(filename, cdoFiletype());
+
+	  streamDefVlist(streamID2, vlistID2);
+
+	  streamIDs[index] = streamID2;
+	}
+
+      taxisCopyTimestep(taxisID2, taxisID1);
+      streamDefTimestep(streamID2, tsIDs[index]);
+
+      if ( tsID > 0 && tsIDs[index] == 0 && nconst )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT )
+		{
+		  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+		  for ( levelID = 0; levelID < nlevel; levelID++ )
+		    {
+		      streamDefRecord(streamID2, varID, levelID);
+		      nmiss = vars[varID][levelID].nmiss;
+		      streamWriteRecord(streamID2, vars[varID][levelID].ptr, nmiss);
+		    }
+		}
+	    }
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  if ( lcopy && !(tsID == 0 && nconst) )
+	    {
+	      streamCopyRecord(streamID2, streamID1);
+	    }
+	  else
+	    {
+	      streamReadRecord(streamID1, array, &nmiss);
+	      streamWriteRecord(streamID2, array, nmiss);
+
+	      if ( tsID == 0 && nconst )
+		{
+		  if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT )
+		    {
+		      gridID  = vlistInqVarGrid(vlistID1, varID);
+		      gridsize = gridInqSize(gridID);
+		      memcpy(vars[varID][levelID].ptr, array, gridsize*sizeof(double));
+		      vars[varID][levelID].nmiss = nmiss;
+		    }
+		}
+	    }
+	}
+
+      tsIDs[index]++;
+      tsID++;
+    }
+
+  streamClose(streamID1);
+
+  for ( index = 0; index < MAX_STREAMS; index++ )
+    {
+      streamID2 = streamIDs[index];
+      if ( streamID2 >= 0 ) streamClose(streamID2);
+    }
+ 
+  if ( array ) free(array);
+
+  if ( nconst )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vlistInqVarTsteptype(vlistID2, varID) == TSTEP_CONSTANT )
+	    {
+	      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		if ( vars[varID][levelID].ptr )
+		  free(vars[varID][levelID].ptr);
+
+	      free(vars[varID]);
+	    }
+	}
+
+      if ( vars  ) free(vars);
+    }
+
+  vlistDestroy(vlistID2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Splityear.c b/src/Splityear.c
new file mode 100644
index 0000000..a9fec21
--- /dev/null
+++ b/src/Splityear.c
@@ -0,0 +1,152 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+     Splittime  splityear       Split years
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define MAX_YEARS 99999
+
+void *Splityear(void *argument)
+{
+  int nchars;
+  int streamID1, streamID2 = -1;
+  int varID;
+  int nrecs;
+  int tsID, tsID2, recID, levelID;
+  int vlistID1, vlistID2;
+  char filesuffix[32];
+  char filename[8192];
+  int vdate;
+  int day;
+  int year1, year2;
+  int mon1, mon2;
+  int taxisID1, taxisID2;
+  int lcopy = FALSE;
+  int gridsize;
+  int ic = 0;
+  int cyear[MAX_YEARS];
+  int nmiss;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  memset(cyear, 0, MAX_YEARS*sizeof(int));
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  strcpy(filename, cdoStreamName(1));
+  nchars = strlen(filename);
+
+  filesuffix[0] = 0;
+  cdoGenFileSuffix(filesuffix, sizeof(filesuffix), cdoDefaultFileType, vlistID1);
+
+  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      if ( vlistNumber(vlistID1) != CDI_REAL ) gridsize *= 2;
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  year1 = -1;
+  mon1  = -1;
+  tsID  = 0;
+  tsID2 = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      cdiDecodeDate(vdate, &year2, &mon2, &day);
+
+      if ( tsID == 0 || year1 != year2 || (year1 == year2 && mon1 > mon2) )
+	{
+	  tsID2 = 0;
+
+	  if ( year1 != year2 ) ic = 0;
+	  else                  ic++;
+
+	  if ( year2 >= 0 && year2 < MAX_YEARS )
+	    {
+	      ic = cyear[year2];
+	      cyear[year2]++;
+	    }
+
+	  year1 = year2;
+
+	  if ( streamID2 >= 0 ) streamClose(streamID2);
+
+	  sprintf(filename+nchars, "%04d", year1);
+	  if ( ic > 0 ) sprintf(filename+strlen(filename), "_%d", ic+1);
+	  if ( filesuffix[0] )
+	    sprintf(filename+strlen(filename), "%s", filesuffix);
+	  
+	  if ( cdoVerbose ) cdoPrint("create file %s", filename);
+
+	  streamID2 = streamOpenWrite(filename, cdoFiletype());
+
+	  streamDefVlist(streamID2, vlistID2);
+	}
+      mon1 = mon2;
+
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID2++);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  if ( lcopy )
+	    {
+	      streamCopyRecord(streamID2, streamID1);
+	    }
+	  else
+	    {
+	      streamReadRecord(streamID1, array, &nmiss);
+	      streamWriteRecord(streamID2, array, nmiss);
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+ 
+  if ( ! lcopy )
+    if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/StringUtilities.c b/src/StringUtilities.c
new file mode 100644
index 0000000..3afd07b
--- /dev/null
+++ b/src/StringUtilities.c
@@ -0,0 +1,110 @@
+#include "StringUtilities.h"
+
+#define DBG 0
+
+int StringSplitWithSeperator(  char *source_string, char *seperator, char*** ptr_split_string )
+
+{
+	char *duplicate_src = NULL, **temp_list = NULL , *temp_str = NULL, *saveptr;
+	int n = 0, i;
+	int str_len = 0, sep_count = 0;	
+
+	str_len = strlen( source_string );
+
+	if( !str_len )
+	  return 0;
+
+	if( DBG )
+	  fprintf(stderr, "StringSplitWithSeperator Input str %s , seperator %s \n", source_string, seperator );
+	
+	duplicate_src = strdup(source_string);
+        
+	for( i = 0; i < str_len; i++ )
+	  {
+		 if( duplicate_src[i] == *seperator )  
+		   sep_count++;
+	  }	
+ 
+	temp_list  = ( char** )malloc ( sizeof( char* ) * (sep_count+1) );
+	
+	if( DBG )
+	  fprintf(stderr, "Input str %s , seperator %s  sep count %d\n", duplicate_src, seperator, sep_count );
+	
+	while( ( temp_str = strtok_r( duplicate_src, seperator, &saveptr ) ) )
+          {
+	    temp_list[n] = temp_str;
+            n++;
+            duplicate_src = saveptr;
+          }
+          
+        if( DBG )
+	  {
+	    for( i = 0; i <  n; i++ )
+	      fprintf(stderr, "str  %s \n", temp_list[i] );  
+	  }
+	  
+	*ptr_split_string = temp_list;
+
+	return n;
+}
+
+
+
+int IsNumeric (const char *s)
+{
+    char *ptr;
+    if (s == NULL || *s == '\0' || isspace(*s))
+      return 0;
+    
+    strtod (s, &ptr);
+    return *ptr == '\0';
+}
+
+
+void StrToUpperCase ( char *sPtr )
+{
+    while ( *sPtr != '\0' )
+    {
+      *sPtr = toupper ( ( unsigned char ) *sPtr );
+      ++sPtr;
+    }
+}
+
+
+void StrToLowerCase ( char *sPtr )
+{
+    while ( *sPtr != '\0' )
+    {
+      *sPtr = tolower ( ( unsigned char ) *sPtr );
+      ++sPtr;
+    }
+}
+
+/* To replace a single char with another single char in a given string */
+
+void StrReplaceChar( char *str_in, char orig_char, char rep_char )
+
+{
+  
+  char *ref = NULL;
+  
+  ref = str_in; 
+  
+  if( strchr( str_in, orig_char) == NULL )
+    return;
+  
+  if( DBG )  
+    fprintf( stderr,"Before %s\n", ref );        
+  
+  while( *str_in != '\0' )
+    {
+      if( *str_in == orig_char )
+	  *str_in = rep_char;
+      str_in++;
+    } 
+  if( DBG )  
+    fprintf( stderr,"After %s\n", ref );      
+  
+  return  ;     
+}
+
diff --git a/src/StringUtilities.h b/src/StringUtilities.h
new file mode 100644
index 0000000..53d6988
--- /dev/null
+++ b/src/StringUtilities.h
@@ -0,0 +1,19 @@
+#ifndef STR_UTILITIES_H
+#define STR_UTILITIES_H
+
+#include<stdio.h>
+#include<string.h>
+#include<stdlib.h>
+#include <ctype.h>
+
+int StringSplitWithSeperator( char *source_string, char *seperator, char*** ptr_split_string );
+
+int IsNumeric (const char *s);
+
+void StrToUpperCase ( char *sPtr );
+
+void StrToLowerCase ( char *sPtr );
+
+void StrReplaceChar( char *str_in, char orig_char, char rep_char );
+
+#endif
diff --git a/src/Subtrend.c b/src/Subtrend.c
new file mode 100644
index 0000000..4c9d706
--- /dev/null
+++ b/src/Subtrend.c
@@ -0,0 +1,176 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+     Subtrend   subtrend        Subtract trend
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Subtrend(void *argument)
+{
+  int gridsize;
+  int nrecs, nrecords;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int i;
+  int streamID1, streamID2, streamID3, streamID4;
+  int vlistID1, vlistID2, vlistID3, vlistID4, taxisID1, taxisID4;
+  int nmiss;
+  int nvars, nlevel;
+  double missval, missval1, missval2;
+  field_t **vars2, **vars3;
+  field_t field1, field4;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  streamID3 = streamOpenRead(cdoStreamName(2));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = streamInqVlist(streamID3);
+  vlistID4 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_DIM);
+  vlistCompare(vlistID1, vlistID3, CMP_DIM);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID4 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID4, taxisID4);
+
+  streamID4 = streamOpenWrite(cdoStreamName(3), cdoFiletype());
+
+  streamDefVlist(streamID4, vlistID4);
+
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field4.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  vars2 = (field_t **) malloc(nvars*sizeof(field_t *));
+  vars3 = (field_t **) malloc(nvars*sizeof(field_t *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      vars2[varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+      vars3[varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  vars2[varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+	  vars3[varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+	}
+    }
+
+
+  tsID = 0;
+  nrecs = streamInqTimestep(streamID2, tsID);
+
+  for ( recID = 0; recID < nrecs; recID++ )
+    {
+      streamInqRecord(streamID2, &varID, &levelID);
+      streamReadRecord(streamID2, vars2[varID][levelID].ptr, &nmiss);
+    }
+
+  tsID = 0;
+  nrecs = streamInqTimestep(streamID3, tsID);
+
+  for ( recID = 0; recID < nrecs; recID++ )
+    {
+      streamInqRecord(streamID3, &varID, &levelID);
+      streamReadRecord(streamID3, vars3[varID][levelID].ptr, &nmiss);
+    }
+
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID4, taxisID1);
+
+      streamDefTimestep(streamID4, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field1.ptr, &nmiss);
+
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+
+	  missval1 = missval;
+	  missval2 = missval;
+	  for ( i = 0; i < gridsize; i++ )
+	    field4.ptr[i] = SUB(field1.ptr[i], ADD(vars2[varID][levelID].ptr[i], MUL(vars3[varID][levelID].ptr[i], tsID)));
+    
+	  nmiss = 0;
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( DBL_IS_EQUAL(field4.ptr[i], missval) ) nmiss++;
+
+	  streamDefRecord(streamID4, varID, levelID);
+	  streamWriteRecord(streamID4, field4.ptr, nmiss);
+	}
+
+      tsID++;
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  free(vars2[varID][levelID].ptr);
+	  free(vars3[varID][levelID].ptr);
+	}
+
+      free(vars2[varID]);
+      free(vars3[varID]);
+    }
+
+  free(vars2);
+  free(vars3);
+
+  if ( field1.ptr ) free(field1.ptr);
+  if ( field4.ptr ) free(field4.ptr);
+
+  streamClose(streamID4);
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Tee.c b/src/Tee.c
new file mode 100644
index 0000000..41e8577
--- /dev/null
+++ b/src/Tee.c
@@ -0,0 +1,110 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Tee(void *argument)
+{
+  int streamID1, streamID2, streamID3;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int lcopy = FALSE;
+  int gridsize;
+  int vlistID1, vlistID2, vlistID3;
+  int nmiss;
+  int taxisID1, taxisID2, taxisID3;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  taxisID1 = vlistInqTaxis(vlistID1);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  vlistID2 = vlistDuplicate(vlistID1);
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  taxisID2 = taxisDuplicate(taxisID1);
+  taxisID3 = taxisDuplicate(taxisID1);
+
+  vlistDefTaxis(vlistID2, taxisID2);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  streamDefVlist(streamID2, vlistID2);
+  streamDefVlist(streamID3, vlistID3);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+      streamDefTimestep(streamID3, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{ 
+	  if ( lcopy )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+
+	      streamDefRecord(streamID2,  varID,  levelID);
+	      streamCopyRecord(streamID2, streamID1);
+
+	      streamDefRecord(streamID3,  varID,  levelID);
+	      streamCopyRecord(streamID3, streamID1);
+	    }
+	  else
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+	      streamReadRecord(streamID1, array, &nmiss);
+
+	      streamDefRecord(streamID2,  varID,  levelID);
+	      streamWriteRecord(streamID2, array, nmiss);
+
+	      streamDefRecord(streamID3,  varID,  levelID);
+	      streamWriteRecord(streamID3, array, nmiss);
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID1);
+
+  streamClose(streamID2);
+  streamClose(streamID3);
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Templates.c b/src/Templates.c
new file mode 100644
index 0000000..0e2668e
--- /dev/null
+++ b/src/Templates.c
@@ -0,0 +1,156 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Template1(void *argument)
+{
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int lcopy = FALSE;
+  int gridsize, nmiss;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  if ( ! lcopy )
+    {
+      gridsize = vlistGridsizeMax(vlistID1);
+      array = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  
+	  if ( lcopy )
+	    {
+	      streamCopyRecord(streamID2, streamID1);
+	    }
+	  else
+	    {
+	      streamReadRecord(streamID1, array, &nmiss);
+	      streamWriteRecord(streamID2, array, nmiss);
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  vlistDestroy(vlistID2);
+
+  if ( ! lcopy )
+    if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
+
+
+void *Template2(void *argument)
+{
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs;
+  int tsID, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int gridsize;
+  int nmiss;
+  int taxisID1, taxisID2;
+  double *array = NULL;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  
+	  streamReadRecord(streamID1, array, &nmiss);
+	  streamWriteRecord(streamID2, array, nmiss);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  vlistDestroy(vlistID2);
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Test.c b/src/Test.c
new file mode 100644
index 0000000..1003467
--- /dev/null
+++ b/src/Test.c
@@ -0,0 +1,160 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Test(void *argument)
+{
+  /*
+  int streamID1, streamID2;
+  */
+
+  cdoInitialize(argument);
+
+  /*
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+  */
+  cdoFinish();
+
+  return (0);
+}
+
+
+void *Test2(void *argument)
+{
+  /*
+  int streamID1, streamID2, streamID3;
+  */
+
+  cdoInitialize(argument);
+
+  /*
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+  */
+  cdoFinish();
+
+  return (0);
+}
+
+
+void *Testdata(void *argument)
+{
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs;
+  int tsID1, tsID2, recID, varID, levelID;
+  int gridsize, i;
+  int vlistID1, vlistID2 = -1;
+  int nmiss;
+  int taxisID1, taxisID2 = CDI_UNDEFID;
+  double *array = NULL;
+  float *fval;
+  int *ival;
+  unsigned char *cval;
+  unsigned char *cval2;
+  FILE *fp;
+
+  cdoInitialize(argument);
+
+  tsID2 = 0;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  taxisID1 = vlistInqTaxis(vlistID1);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  vlistID2 = vlistDuplicate(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array = (double *) malloc(gridsize*sizeof(double));
+  fval = (float *) malloc(gridsize*sizeof(float));
+  ival = (int *) malloc(gridsize*sizeof(int));
+  cval = (unsigned char *) malloc(gridsize*sizeof(unsigned char)*4);
+  cval2 = (unsigned char *) malloc(gridsize*sizeof(unsigned char)*4);
+
+  fp = fopen("testdata", "w");
+
+  tsID1 = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID1)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID2);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  
+	  streamReadRecord(streamID1, array, &nmiss);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  for ( i = 0; i < gridsize; ++i )
+	    {
+	      fval[i] = (float) array[i];
+
+	      memcpy(&ival[i], &fval[i], 4);
+	      memcpy(&cval[i*4], &fval[i], 4);
+
+	      cval2[i+gridsize*0] = cval[i*4+0];
+	      cval2[i+gridsize*1] = cval[i*4+1];
+	      cval2[i+gridsize*2] = cval[i*4+2];
+	      cval2[i+gridsize*3] = cval[i*4+3];
+
+	      if ( tsID1 == 0 && recID == 0 )
+	      printf("%4d %3d %3d %3d %3d %d %g\n",
+		     i, (unsigned int)cval[4*i+0], (unsigned int)cval[4*i+1], (unsigned int)cval[4*i+2], (unsigned int)cval[4*i+3], ival[i], fval[i]);
+	    }
+
+	  streamWriteRecord(streamID2, array, nmiss);
+
+	  fwrite(cval, 4, gridsize, fp);
+	}
+
+      tsID1++;
+      tsID2++;
+    }
+  
+  fclose(fp);
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  if ( array ) free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Tests.c b/src/Tests.c
new file mode 100644
index 0000000..2b760ab
--- /dev/null
+++ b/src/Tests.c
@@ -0,0 +1,177 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "statistic.h"
+
+
+void *Tests(void *argument)
+{
+  int NORMAL, STUDENTT, CHISQUARE, BETA, FISHER;
+  int operatorID;
+  int streamID1, streamID2 = CDI_UNDEFID;
+  int nrecs;
+  int i;
+  int tsID, recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int gridsize;
+  int nmiss;
+  int taxisID1, taxisID2;
+  double degree_of_freedom = 0, p = 0, q = 0, n = 0, d = 0;
+  double missval;
+  double *array1 = NULL, *array2 = NULL;
+
+  cdoInitialize(argument);
+
+  NORMAL    = cdoOperatorAdd("normal",    0, 0, NULL);
+  STUDENTT  = cdoOperatorAdd("studentt",  0, 0, "degree of freedom");
+  CHISQUARE = cdoOperatorAdd("chisquare", 0, 0, "degree of freedom");
+  BETA      = cdoOperatorAdd("beta",      0, 0, "p and q");
+  FISHER    = cdoOperatorAdd("fisher",    0, 0, "degree of freedom of nominator and of denominator");
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == STUDENTT || operatorID == CHISQUARE )
+    {
+      operatorInputArg(cdoOperatorEnter(operatorID));
+
+      operatorCheckArgc(1);
+
+      degree_of_freedom = atof(operatorArgv()[0]);
+
+      if ( degree_of_freedom <= 0 )
+	cdoAbort("degree of freedom must be positive!");
+    }
+  else if ( operatorID == BETA )
+    {
+      operatorInputArg(cdoOperatorEnter(operatorID));
+
+      operatorCheckArgc(2);
+
+      p = atof(operatorArgv()[0]);
+      q = atof(operatorArgv()[1]);
+
+      if ( p <= 0 || q <= 0 )
+	cdoAbort("p and q must be positive!");
+    }
+  else if ( operatorID == FISHER )
+    {
+      operatorInputArg(cdoOperatorEnter(operatorID));
+
+      operatorCheckArgc(2);
+
+      n = atof(operatorArgv()[0]);
+      d = atof(operatorArgv()[1]);
+
+      if ( n <= 0 || d <= 0 )
+	cdoAbort("both degrees must be positive!");
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);	  
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  missval = vlistInqVarMissval(vlistID1, varID);
+
+	  if ( operatorID == NORMAL )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval) ? missval :
+		  normal(array1[i], processInqPrompt());
+	    }
+	  else if ( operatorID == STUDENTT )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval) ? missval :
+		  student_t(degree_of_freedom, array1[i], processInqPrompt());
+	    }
+	  else if ( operatorID == CHISQUARE )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval) ? missval :
+		  chi_square(degree_of_freedom, array1[i], processInqPrompt());
+	    }
+	  else if ( operatorID == BETA )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		{
+		  if ( array1[i] < 0 || array1[i] > 1 )
+		    cdoAbort("Value out of range (0-1)!");
+
+		  array2[i] = DBL_IS_EQUAL(array1[i], missval) ? missval :
+		    beta_distr(p, q, array1[i], processInqPrompt());
+		}
+	    }
+	  else if ( operatorID == FISHER )
+	    {
+	      for ( i = 0; i < gridsize; i++ )
+		array2[i] = DBL_IS_EQUAL(array1[i], missval) ? missval :
+		  fisher(n, d, array1[i], processInqPrompt());
+	    }
+	  else
+	    {
+	      cdoAbort("Internal problem, operator not implemented!");
+	    }
+
+	  streamDefRecord(streamID2,  varID,  levelID);
+	  streamWriteRecord(streamID2, array2, nmiss);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID1);
+  streamClose(streamID2);
+
+  vlistDestroy(vlistID2);
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Timcount.c b/src/Timcount.c
new file mode 100644
index 0000000..fbfa16a
--- /dev/null
+++ b/src/Timcount.c
@@ -0,0 +1,208 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Timcount    timcount          Time counts
+      Hourcount   hourcount         Hourly counts
+      Daycount    daycount          Daily counts
+      Moncount    moncount          Monthly counts
+      Yearcount   yearcount         Yearly counts
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Timcount(void *argument)
+{
+  int operatorID;
+  int cmplen;
+  char indate1[DATE_LEN+1], indate2[DATE_LEN+1];
+  int gridsize;
+  int vdate = 0, vtime = 0;
+  int vdate0 = 0, vtime0 = 0;
+  int nrecs, nrecords;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int otsID;
+  long nsets;
+  int i;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  double missval;
+  field_t **vars1 = NULL;
+  field_t field;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("timcount",  0, 31, NULL);
+  cdoOperatorAdd("yearcount", 0, 10, NULL);
+  cdoOperatorAdd("moncount",  0,  8, NULL);
+  cdoOperatorAdd("daycount",  0,  6, NULL);
+  cdoOperatorAdd("hourcount", 0,  4, NULL);
+
+  operatorID = cdoOperatorID();
+
+  cmplen = DATE_LEN - cdoOperatorF2(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  nvars    = vlistNvars(vlistID1);
+  for ( varID = 0; varID < nvars; varID++ )
+      vlistDefVarUnits(vlistID2, varID, "No.");
+
+  if ( cdoOperatorF2(operatorID) == 16 ) vlistDefNtsteps(vlistID2, 1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nrecords = vlistNrecs(vlistID1);
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  vars1 = (field_t **) malloc(nvars*sizeof(field_t *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      vars1[varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  vars1[varID][levelID].grid    = gridID;
+	  vars1[varID][levelID].nmiss   = 0;
+	  vars1[varID][levelID].missval = missval;
+	  vars1[varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+	}
+    }
+
+  tsID    = 0;
+  otsID   = 0;
+  while ( TRUE )
+    {
+      nsets = 0;
+      while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+	{
+	  vdate = taxisInqVdate(taxisID1);
+	  vtime = taxisInqVtime(taxisID1);
+
+	  if ( nsets == 0 ) SET_DATE(indate2, vdate, vtime);
+	  SET_DATE(indate1, vdate, vtime);
+
+	  if ( DATE_IS_NEQ(indate1, indate2, cmplen) ) break;
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+
+	      if ( tsID == 0 )
+		{
+		  recVarID[recID]   = varID;
+		  recLevelID[recID] = levelID;
+		}
+
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	      if ( nsets == 0 )
+		{
+		  for ( i = 0; i < gridsize; i++ )
+		    vars1[varID][levelID].ptr[i] = vars1[varID][levelID].missval;
+		  vars1[varID][levelID].nmiss = gridsize;
+		}
+
+              streamReadRecord(streamID1, field.ptr, &field.nmiss);
+              field.grid    = vars1[varID][levelID].grid;
+	      field.missval = vars1[varID][levelID].missval;
+
+              farcount(&vars1[varID][levelID], field);
+	    }
+
+	  vdate0 = vdate;
+	  vtime0 = vtime;
+	  nsets++;
+	  tsID++;
+	}
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+
+      taxisDefVdate(taxisID2, vdate0);
+      taxisDefVtime(taxisID2, vtime0);
+      streamDefTimestep(streamID2, otsID);
+
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  varID   = recVarID[recID];
+	  levelID = recLevelID[recID];
+
+	  if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, vars1[varID][levelID].ptr,  vars1[varID][levelID].nmiss);
+	}
+
+      if ( nrecs == 0 ) break;
+      otsID++;
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  free(vars1[varID][levelID].ptr);
+	}
+
+      free(vars1[varID]);
+    }
+
+  free(vars1);
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Timpctl.c b/src/Timpctl.c
new file mode 100644
index 0000000..2035fea
--- /dev/null
+++ b/src/Timpctl.c
@@ -0,0 +1,269 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Timpctl    timpctl         Time percentiles
+      Hourpctl   hourpctl        Hourly percentiles
+      Daypctl    daypctl         Daily percentiles
+      Monpctl    monpctl         Monthly percentiles
+      Yearpctl   yearpctl        Yearly percentiles
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "percentiles.h"
+
+
+static
+void timpctl(int operatorID)
+{
+  int cmplen;
+  char indate1[DATE_LEN+1], indate2[DATE_LEN+1];
+  int gridsize;
+  int vdate1 = 0, vtime1 = 0;
+  int vdate2 = 0, vtime2 = 0;
+  int vdate3 = 0, vtime3 = 0;
+  int vdate4 = 0, vtime4 = 0;
+  int nrecs, nrecords;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int otsID;
+  long nsets;
+  int streamID1, streamID2, streamID3, streamID4;
+  int vlistID1, vlistID2, vlistID3, vlistID4, taxisID1, taxisID2, taxisID3, taxisID4;
+  int nmiss;
+  int nvars, nlevels;
+  int *recVarID, *recLevelID;
+  double missval;
+  field_t **vars1 = NULL;
+  field_t field;
+  double pn;
+  HISTOGRAM_SET *hset = NULL;
+  
+  operatorInputArg("percentile number");
+  pn = atof(operatorArgv()[0]);
+      
+  if ( !(pn >= 0 && pn <= 100) )
+    cdoAbort("Illegal argument: percentile number %g is not in the range 0..100!", pn);
+
+  cmplen = DATE_LEN - cdoOperatorF2(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  streamID3 = streamOpenRead(cdoStreamName(2));
+  
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = streamInqVlist(streamID3);
+  vlistID4 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+  vlistCompare(vlistID1, vlistID3, CMP_ALL);
+  
+  if ( cdoOperatorF2(operatorID) == 16 ) vlistDefNtsteps(vlistID4, 1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = vlistInqTaxis(vlistID3);
+  /* TODO - check that time axes 2 and 3 are equal */
+
+  taxisID4 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID4, taxisID4);
+
+  streamID4 = streamOpenWrite(cdoStreamName(3), cdoFiletype());
+
+  streamDefVlist(streamID4, vlistID4);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords * sizeof(int));
+  recLevelID = (int *) malloc(nrecords * sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr = (double *) malloc(gridsize * sizeof(double));
+
+  vars1 = (field_t **) malloc(nvars * sizeof(field_t *));
+  hset = hsetCreate(nvars);
+  
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevels  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      vars1[varID] = (field_t *) malloc(nlevels*sizeof(field_t));
+      hsetCreateVarLevels(hset, varID, nlevels, gridID);
+
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        {
+          vars1[varID][levelID].grid    = gridID;
+          vars1[varID][levelID].nmiss   = 0;
+          vars1[varID][levelID].missval = missval;
+          vars1[varID][levelID].ptr     = (double *) malloc(gridsize * sizeof(double));
+        } 
+    }
+
+  tsID    = 0;
+  otsID   = 0;
+  while ( TRUE )
+    {
+      nsets = 0;
+      
+      nrecs = streamInqTimestep(streamID2, otsID);
+      if ( nrecs != streamInqTimestep(streamID3, otsID) )
+        cdoAbort("Number of records at time step %d of %s and %s differ!", otsID+1, cdoStreamName(1), cdoStreamName(2));
+
+      vdate2 = taxisInqVdate(taxisID2);
+      vtime2 = taxisInqVtime(taxisID2);
+      vdate3 = taxisInqVdate(taxisID3);
+      vtime3 = taxisInqVtime(taxisID3);
+      if ( vdate2 != vdate3 || vtime2 != vtime3 )
+        cdoAbort("Verification dates at time step %d of %s and %s differ!", otsID+1, cdoStreamName(1), cdoStreamName(2));
+      
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID2, &varID, &levelID);
+	  streamReadRecord(streamID2, vars1[varID][levelID].ptr, &nmiss);
+          vars1[varID][levelID].nmiss = nmiss;
+        }
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID3, &varID, &levelID);
+	  streamReadRecord(streamID3, field.ptr, &nmiss);
+          field.nmiss   = nmiss;
+          field.grid    = vars1[varID][levelID].grid;
+	  field.missval = vars1[varID][levelID].missval;
+	  
+	  hsetDefVarLevelBounds(hset, varID, levelID, &vars1[varID][levelID], &field);
+        }
+          
+      while ( nrecs && (nrecs = streamInqTimestep(streamID1, tsID)) )
+	{
+	  vdate1 = taxisInqVdate(taxisID1);
+	  vtime1 = taxisInqVtime(taxisID1);
+
+
+	  if ( nsets == 0 ) SET_DATE(indate2, vdate1, vtime1);
+	  SET_DATE(indate1, vdate1, vtime1);
+
+	  if ( DATE_IS_NEQ(indate1, indate2, cmplen) ) break;
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+	      if ( tsID == 0 )
+		{
+		  recVarID[recID]   = varID;
+		  recLevelID[recID] = levelID;
+		}
+	      streamReadRecord(streamID1, vars1[varID][levelID].ptr, &nmiss);
+              vars1[varID][levelID].nmiss = nmiss;
+
+	      hsetAddVarLevelValues(hset, varID, levelID, &vars1[varID][levelID]);
+	    }
+
+	  vdate4 = vdate1;
+	  vtime4 = vtime1;
+	  nsets++;
+	  tsID++;
+	}
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+
+      if ( vdate2 != vdate4 )
+        cdoAbort("Verification dates at time step %d of %s, %s and %s differ!", otsID+1, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+      if ( vtime2 != vtime4 )
+        cdoAbort("Verification times at time step %d of %s, %s and %s differ!", otsID+1, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+      
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	  nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+            hsetGetVarLevelPercentiles(&vars1[varID][levelID], hset, varID, levelID, pn);
+	}
+
+      taxisDefVdate(taxisID4, vdate4);
+      taxisDefVtime(taxisID4, vtime4);
+      streamDefTimestep(streamID4, otsID);
+
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  varID   = recVarID[recID];
+	  levelID = recLevelID[recID];
+
+	  if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	  streamDefRecord(streamID4, varID, levelID);
+	  streamWriteRecord(streamID4, vars1[varID][levelID].ptr, vars1[varID][levelID].nmiss);
+	}
+
+      if ( nrecs == 0 ) break;
+      otsID++;
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	free(vars1[varID][levelID].ptr);
+      free(vars1[varID]);
+    }
+
+  free(vars1);
+  hsetDestroy(hset);
+  
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID4);
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+}
+
+void *Timpctl(void *argument)
+{
+  int operatorID;
+  
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("timpctl",  func_pctl, 31, NULL);
+  cdoOperatorAdd("yearpctl", func_pctl, 10, NULL);
+  cdoOperatorAdd("monpctl",  func_pctl,  8, NULL);
+  cdoOperatorAdd("daypctl",  func_pctl,  6, NULL);
+  cdoOperatorAdd("hourpctl", func_pctl,  4, NULL);
+
+  operatorID = cdoOperatorID();
+  
+  timpctl(operatorID);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Timselpctl.c b/src/Timselpctl.c
new file mode 100644
index 0000000..3b99988
--- /dev/null
+++ b/src/Timselpctl.c
@@ -0,0 +1,289 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Timselpctl    timselpctl         Time range percentiles
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "percentiles.h"
+
+
+void *Timselpctl(void *argument)
+{
+  int gridsize;
+  int vdate1 = 0, vtime1 = 0;
+  int vdate2 = 0, vtime2 = 0;
+  int vdate3 = 0, vtime3 = 0;
+  int vdate4 = 0, vtime4 = 0;
+  int nrecs = 0, nrecords;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int otsID;
+  int nsets = 0;
+  int i;
+  int streamID1, streamID2, streamID3, streamID4;
+  int vlistID1, vlistID2, vlistID3, vlistID4, taxisID1, taxisID2, taxisID3, taxisID4;
+  int nmiss;
+  int nvars, nlevels;
+  int ndates = 0, noffset = 0, nskip = 0, nargc;
+  int *recVarID, *recLevelID;
+  double missval;
+  field_t **vars1 = NULL;
+  field_t field;
+  double pn;
+  HISTOGRAM_SET *hset = NULL;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("timselpctl", func_pctl,  0, NULL);
+
+  operatorInputArg("percentile number, nsets <,noffset <,nskip>>");
+
+  nargc = operatorArgc();
+  if ( nargc < 2 )
+    cdoAbort("Too few arguments! Need %d found %d.", 2, nargc);
+
+  pn     = atof(operatorArgv()[0]);
+  ndates = atoi(operatorArgv()[1]);
+  if ( nargc > 2 ) noffset = atoi(operatorArgv()[2]);
+  if ( nargc > 3 ) nskip   = atoi(operatorArgv()[3]);
+
+  if ( !(pn > 0 && pn < 100) )
+    cdoAbort("Illegal argument: percentile number %g is not in the range 0..100!", pn);
+
+  if ( cdoVerbose ) cdoPrint("nsets = %d, noffset = %d, nskip = %d", ndates, noffset, nskip);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  streamID3 = streamOpenRead(cdoStreamName(2));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = streamInqVlist(streamID3);
+  vlistID4 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+  vlistCompare(vlistID1, vlistID3, CMP_ALL);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = vlistInqTaxis(vlistID3);
+  /* TODO - check that time axes 2 and 3 are equal */
+
+  taxisID4 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID4, taxisID4);
+
+  streamID4 = streamOpenWrite(cdoStreamName(3), cdoFiletype());
+
+  streamDefVlist(streamID4, vlistID4);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr = (double *) malloc(gridsize * sizeof(double));
+
+  vars1 = (field_t **) malloc(nvars * sizeof(field_t *));
+  hset = hsetCreate(nvars);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevels   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      vars1[varID] = (field_t *)  malloc(nlevels * sizeof(field_t));
+      hsetCreateVarLevels(hset, varID, nlevels, gridID);
+
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	{
+	  vars1[varID][levelID].grid    = gridID;
+	  vars1[varID][levelID].nmiss   = 0;
+	  vars1[varID][levelID].missval = missval;
+	  vars1[varID][levelID].ptr     = (double *) malloc(gridsize * sizeof(double));
+	}
+    }
+
+  for ( tsID = 0; tsID < noffset; tsID++ )
+    {
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 ) break;
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+	}
+    }
+
+  if ( tsID < noffset )
+    {
+      cdoWarning("noffset is larger than number of timesteps!");
+      goto LABEL_END;
+    }
+
+  otsID = 0;
+  while ( TRUE )
+    {
+      nrecs = streamInqTimestep(streamID2, otsID);
+      if ( nrecs != streamInqTimestep(streamID3, otsID) )
+        cdoAbort("Number of records at time step %d of %s and %s differ!", otsID+1, cdoStreamName(1), cdoStreamName(2));
+
+      vdate2 = taxisInqVdate(taxisID2);
+      vtime2 = taxisInqVtime(taxisID2);
+      vdate3 = taxisInqVdate(taxisID3);
+      vtime3 = taxisInqVtime(taxisID3);
+      if ( vdate2 != vdate3 || vtime2 != vtime3 )
+        cdoAbort("Verification dates at time step %d of %s and %s differ!", otsID+1, cdoStreamName(1), cdoStreamName(2));
+      
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID2, &varID, &levelID);
+          streamReadRecord(streamID2, vars1[varID][levelID].ptr, &nmiss);
+          vars1[varID][levelID].nmiss = nmiss;
+        }
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID3, &varID, &levelID);
+          streamReadRecord(streamID3, field.ptr, &nmiss);
+          field.nmiss   = nmiss;
+          field.grid    = vars1[varID][levelID].grid;
+          field.missval = vars1[varID][levelID].missval;
+          
+          hsetDefVarLevelBounds(hset, varID, levelID, &vars1[varID][levelID], &field);
+        }
+      
+      if ( nrecs )
+      for ( nsets = 0; nsets < ndates; nsets++ )
+	{
+	  nrecs = streamInqTimestep(streamID1, tsID);
+	  if ( nrecs == 0 ) break;
+
+	  vdate1 = taxisInqVdate(taxisID1);
+	  vtime1 = taxisInqVtime(taxisID1);
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+
+	      if ( tsID == 0 )
+		{
+		  recVarID[recID]   = varID;
+		  recLevelID[recID] = levelID;
+		}
+
+	      streamReadRecord(streamID1, vars1[varID][levelID].ptr, &nmiss);
+	      vars1[varID][levelID].nmiss = nmiss;
+                  
+              hsetAddVarLevelValues(hset, varID, levelID, &vars1[varID][levelID]);
+	    }
+
+	  vdate4 = vdate1;
+	  vtime4 = vtime1;
+	  tsID++;
+	}
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+
+      if ( vdate2 != vdate4 )
+        cdoAbort("Verification dates at time step %d of %s, %s and %s differ!",
+		 otsID+1, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+      if ( vtime2 != vtime4 )
+        cdoAbort("Verification times at time step %d of %s, %s and %s differ!",
+		 otsID+1, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+          nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+          
+          for ( levelID = 0; levelID < nlevels; levelID++ )
+            hsetGetVarLevelPercentiles(&vars1[varID][levelID], hset, varID, levelID, pn);
+        }
+
+      taxisDefVdate(taxisID4, vdate4);
+      taxisDefVtime(taxisID4, vtime4);
+      streamDefTimestep(streamID4, otsID);
+
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  varID   = recVarID[recID];
+	  levelID = recLevelID[recID];
+
+	  if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	  streamDefRecord(streamID4, varID, levelID);
+	  streamWriteRecord(streamID4, vars1[varID][levelID].ptr,  vars1[varID][levelID].nmiss);
+	}
+
+      if ( nrecs == 0 ) break;
+      otsID++;
+
+      for ( i = 0; i < nskip; i++ )
+	{
+	  nrecs = streamInqTimestep(streamID1, tsID);
+	  if ( nrecs == 0 ) break;
+	  tsID++;
+	}
+
+      if ( nrecs == 0 ) break;
+    }
+
+ LABEL_END:
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	free(vars1[varID][levelID].ptr);
+      free(vars1[varID]);
+    }
+
+  free(vars1);
+  hsetDestroy(hset);
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID4);
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Timselstat.c b/src/Timselstat.c
new file mode 100644
index 0000000..1d0e932
--- /dev/null
+++ b/src/Timselstat.c
@@ -0,0 +1,375 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Timselstat    timselmin          Time range minimum
+      Timselstat    timselmax          Time range maximum
+      Timselstat    timselsum          Time range sum
+      Timselstat    timselmean         Time range mean
+      Timselstat    timselavg          Time range average
+      Timselstat    timselvar          Time range variance
+      Timselstat    timselstd          Time range standard deviation
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Timselstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int gridsize;
+  int vdate = 0, vtime = 0;
+  int vdate0 = 0, vtime0 = 0;
+  int vdate_lb = 0, vdate_ub = 0, date_lb = 0, date_ub = 0;
+  int vtime_lb = 0, vtime_ub = 0, time_lb = 0, time_ub = 0;
+  int nrecs = 0, nrecords;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int otsID;
+  int nsets;
+  int i;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int taxis_has_bounds = FALSE;
+  int nmiss;
+  int nvars, nlevel;
+  int ndates = 0, noffset = 0, nskip = 0, nargc;
+  int *recVarID, *recLevelID;
+  double missval;
+  field_t **vars1 = NULL, **vars2 = NULL, **samp1 = NULL;
+  field_t field;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("timselmin",  func_min,  0, NULL);
+  cdoOperatorAdd("timselmax",  func_max,  0, NULL);
+  cdoOperatorAdd("timselsum",  func_sum,  0, NULL);
+  cdoOperatorAdd("timselmean", func_mean, 0, NULL);
+  cdoOperatorAdd("timselavg",  func_avg,  0, NULL);
+  cdoOperatorAdd("timselvar",  func_var,  0, NULL);
+  cdoOperatorAdd("timselstd",  func_std,  0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  operatorInputArg("nsets <noffset <nskip>>");
+
+  nargc = operatorArgc();
+
+  ndates = atoi(operatorArgv()[0]);
+  if ( nargc > 1 ) noffset = atoi(operatorArgv()[1]);
+  if ( nargc > 2 ) nskip   = atoi(operatorArgv()[2]);
+
+  if ( cdoVerbose ) cdoPrint("nsets = %d, noffset = %d, nskip = %d", ndates, noffset, nskip);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxis_has_bounds = taxisHasBounds(taxisID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  vars1 = (field_t **) malloc(nvars*sizeof(field_t *));
+  samp1 = (field_t **) malloc(nvars*sizeof(field_t *));
+  if ( operfunc == func_std || operfunc == func_var )
+    vars2 = (field_t **) malloc(nvars*sizeof(field_t *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      vars1[varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+      samp1[varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+      if ( operfunc == func_std || operfunc == func_var )
+	vars2[varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  vars1[varID][levelID].grid    = gridID;
+	  vars1[varID][levelID].nmiss   = 0;
+	  vars1[varID][levelID].missval = missval;
+	  vars1[varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+	  samp1[varID][levelID].grid    = gridID;
+	  samp1[varID][levelID].nmiss   = 0;
+	  samp1[varID][levelID].missval = missval;
+	  samp1[varID][levelID].ptr     = NULL;
+	  if ( operfunc == func_std || operfunc == func_var )
+	    {
+	      vars2[varID][levelID].grid    = gridID;
+	      vars2[varID][levelID].nmiss   = 0;
+	      vars2[varID][levelID].missval = missval;
+	      vars2[varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+	    }
+	}
+    }
+
+  for ( tsID = 0; tsID < noffset; tsID++ )
+    {
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 ) break;
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+	}
+    }
+
+  if ( tsID < noffset )
+    {
+      cdoWarning("noffset is larger than number of timesteps!");
+      goto LABEL_END;
+    }
+
+  otsID   = 0;
+  while ( TRUE )
+    {
+      for ( nsets = 0; nsets < ndates; nsets++ )
+	{
+	  nrecs = streamInqTimestep(streamID1, tsID);
+	  if ( nrecs == 0 ) break;
+
+	  vdate = taxisInqVdate(taxisID1);
+	  vtime = taxisInqVtime(taxisID1);
+
+	  if ( taxis_has_bounds )
+	    {
+	      taxisInqVdateBounds(taxisID1, &date_lb, &date_ub);
+	      taxisInqVtimeBounds(taxisID1, &time_lb, &time_ub);
+	      if ( nsets == 0 )
+		{
+		  vdate_lb = date_lb;
+		  vtime_lb = time_lb;
+		}
+	      vdate_ub = date_ub;
+	      vtime_ub = time_ub;
+	    }
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+
+	      if ( tsID == 0 )
+		{
+		  recVarID[recID]   = varID;
+		  recLevelID[recID] = levelID;
+		}
+
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	      if ( nsets == 0 )
+		{
+		  streamReadRecord(streamID1, vars1[varID][levelID].ptr, &nmiss);
+		  vars1[varID][levelID].nmiss = nmiss;
+
+		  if ( nmiss > 0 || samp1[varID][levelID].ptr )
+		    {
+		      if ( samp1[varID][levelID].ptr == NULL )
+			samp1[varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+
+		      for ( i = 0; i < gridsize; i++ )
+			if ( DBL_IS_EQUAL(vars1[varID][levelID].ptr[i],
+					  vars1[varID][levelID].missval) )
+			  samp1[varID][levelID].ptr[i] = 0;
+			else
+			  samp1[varID][levelID].ptr[i] = 1;
+		    }
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, field.ptr, &field.nmiss);
+		  field.grid    = vars1[varID][levelID].grid;
+		  field.missval = vars1[varID][levelID].missval;
+
+		  if ( field.nmiss > 0 || samp1[varID][levelID].ptr )
+		    {
+		      if ( samp1[varID][levelID].ptr == NULL )
+			{
+			  samp1[varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+			  for ( i = 0; i < gridsize; i++ )
+			    samp1[varID][levelID].ptr[i] = nsets;
+			}
+
+		      for ( i = 0; i < gridsize; i++ )
+			if ( !DBL_IS_EQUAL(field.ptr[i], vars1[varID][levelID].missval) )
+			  samp1[varID][levelID].ptr[i]++;
+		    }
+
+		  if ( operfunc == func_std || operfunc == func_var )
+		    {
+		      farsumq(&vars2[varID][levelID], field);
+		      farsum(&vars1[varID][levelID], field);
+		    }
+		  else
+		    {
+		      farfun(&vars1[varID][levelID], field, operfunc);
+		    }
+		}
+	    }
+
+	  if ( nsets == 0 && (operfunc == func_std || operfunc == func_var) )
+	    for ( varID = 0; varID < nvars; varID++ )
+	      {
+		if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+		nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+		for ( levelID = 0; levelID < nlevel; levelID++ )
+		  farmoq(&vars2[varID][levelID], vars1[varID][levelID]);
+	      }
+
+	  vdate0 = vdate;
+	  vtime0 = vtime;
+	  tsID++;
+	}
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+
+      if ( operfunc == func_mean || operfunc == func_avg )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      {
+		if ( samp1[varID][levelID].ptr == NULL )
+		  farcmul(&vars1[varID][levelID], 1.0/nsets);
+		else
+		  fardiv(&vars1[varID][levelID], samp1[varID][levelID]);
+	      }
+	  }
+      else if ( operfunc == func_std || operfunc == func_var )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      {
+		if ( samp1[varID][levelID].ptr == NULL )
+		  {
+		    if ( operfunc == func_std )
+		      farcstd(&vars1[varID][levelID], vars2[varID][levelID], 1.0/nsets);
+		    else
+		      farcvar(&vars1[varID][levelID], vars2[varID][levelID], 1.0/nsets);
+		  }
+		else
+		  {
+		    farinv(&samp1[varID][levelID]);
+		    if ( operfunc == func_std )
+		      farstd(&vars1[varID][levelID], vars2[varID][levelID], samp1[varID][levelID]);
+		    else
+		      farvar(&vars1[varID][levelID], vars2[varID][levelID], samp1[varID][levelID]);
+		  }
+	      }
+	  }
+
+      taxisDefVdate(taxisID2, vdate0);
+      taxisDefVtime(taxisID2, vtime0);
+      if ( taxis_has_bounds )
+	{
+	  taxisDefVdateBounds(taxisID2, vdate_lb, vdate_ub);
+	  taxisDefVtimeBounds(taxisID2, vtime_lb, vtime_ub);
+	}
+      streamDefTimestep(streamID2, otsID);
+
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  varID   = recVarID[recID];
+	  levelID = recLevelID[recID];
+
+	  if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, vars1[varID][levelID].ptr,  vars1[varID][levelID].nmiss);
+	}
+
+      if ( nrecs == 0 ) break;
+      otsID++;
+
+      for ( i = 0; i < nskip; i++ )
+	{
+	  nrecs = streamInqTimestep(streamID1, tsID);
+	  if ( nrecs == 0 ) break;
+	  tsID++;
+	}
+
+      if ( nrecs == 0 ) break;
+    }
+
+ LABEL_END:
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  free(vars1[varID][levelID].ptr);
+	  if ( samp1[varID][levelID].ptr ) free(samp1[varID][levelID].ptr);
+	  if ( operfunc == func_std || operfunc == func_var ) free(vars2[varID][levelID].ptr);
+	}
+
+      free(vars1[varID]);
+      free(samp1[varID]);
+      if ( operfunc == func_std || operfunc == func_var ) free(vars2[varID]);
+    }
+
+  free(vars1);
+  free(samp1);
+  if ( operfunc == func_std || operfunc == func_var ) free(vars2);
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Timsort.c b/src/Timsort.c
new file mode 100644
index 0000000..56597a3
--- /dev/null
+++ b/src/Timsort.c
@@ -0,0 +1,209 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+     Timsort    timsort         Sort over the time
+*/
+
+
+#if defined (_OPENMP)
+#  include <omp.h>
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  NALLOC_INC  1024
+
+static
+int cmpdarray(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  double *x = (double *) s1;
+  double *y = (double *) s2;
+  /*
+  printf("%d %d  %d %d\n", x->code, y->code, x, y);
+  */
+  if      ( *x < *y ) cmp = -1;
+  else if ( *x > *y ) cmp =  1;
+
+  return (cmp);
+}
+
+
+void *Timsort(void *argument)
+{
+  int gridsize;
+  int nrecs;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int i;
+  int nts;
+  int nalloc = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int *vdate = NULL, *vtime = NULL;
+  int ompthID;
+  double missval;
+  double **sarray = NULL;
+  field_t ***vars = NULL;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisCreate(TAXIS_ABSOLUTE);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars = vlistNvars(vlistID1);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      if ( tsID >= nalloc )
+	{
+	  nalloc += NALLOC_INC;
+	  vdate = (int *) realloc(vdate, nalloc*sizeof(int));
+	  vtime = (int *) realloc(vtime, nalloc*sizeof(int));
+	  vars  = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
+	}
+
+      vdate[tsID] = taxisInqVdate(taxisID1);
+      vtime[tsID] = taxisInqVtime(taxisID1);
+
+      vars[tsID] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridID  = vlistInqVarGrid(vlistID1, varID);
+	  missval = vlistInqVarMissval(vlistID1, varID);
+	  nlevel  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+
+	  vars[tsID][varID] = (field_t *) malloc(nlevel*sizeof(field_t));
+
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      vars[tsID][varID][levelID].grid    = gridID;
+	      vars[tsID][varID][levelID].missval = missval;
+	      vars[tsID][varID][levelID].ptr     = NULL;
+	    }
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  vars[tsID][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+	  streamReadRecord(streamID1, vars[tsID][varID][levelID].ptr, &nmiss);
+	  vars[tsID][varID][levelID].nmiss = nmiss;
+	}
+
+      tsID++;
+    }
+
+  nts = tsID;
+
+  sarray = (double **) malloc(ompNumThreads*sizeof(double *));
+  for ( i = 0; i < ompNumThreads; i++ )
+    sarray[i] = (double *) malloc(nts*sizeof(double));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, ompthID, tsID)
+#endif
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+#if defined (_OPENMP)
+	      ompthID = omp_get_thread_num();
+#else
+	      ompthID = 0;
+#endif
+	      for ( tsID = 0; tsID < nts; tsID++ )
+		sarray[ompthID][tsID] = vars[tsID][varID][levelID].ptr[i];
+
+	      qsort(sarray[ompthID], nts, sizeof(double), cmpdarray);  	      
+
+	      for ( tsID = 0; tsID < nts; tsID++ )
+		vars[tsID][varID][levelID].ptr[i] = sarray[ompthID][tsID];
+	    }
+	}
+    }
+
+  for ( i = 0; i < ompNumThreads; i++ )
+    if ( sarray[i] ) free(sarray[i]);
+
+  if ( sarray ) free(sarray);
+
+  for ( tsID = 0; tsID < nts; tsID++ )
+    {
+      taxisDefVdate(taxisID2, vdate[tsID]);
+      taxisDefVtime(taxisID2, vtime[tsID]);
+      streamDefTimestep(streamID2, tsID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevel; levelID++ )
+	    {
+	      if ( vars[tsID][varID][levelID].ptr )
+		{
+		  nmiss = vars[tsID][varID][levelID].nmiss;
+		  streamDefRecord(streamID2, varID, levelID);
+		  streamWriteRecord(streamID2, vars[tsID][varID][levelID].ptr, nmiss);
+		  free(vars[tsID][varID][levelID].ptr);
+		}
+	    }
+	  free(vars[tsID][varID]);
+	}
+      free(vars[tsID]);      
+    }
+
+  if ( vars  ) free(vars);
+  if ( vdate ) free(vdate);
+  if ( vtime ) free(vtime);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Timstat.c b/src/Timstat.c
new file mode 100644
index 0000000..ba12fe6
--- /dev/null
+++ b/src/Timstat.c
@@ -0,0 +1,459 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Timstat    timmin          Time minimum
+      Timstat    timmax          Time maximum
+      Timstat    timsum          Time sum
+      Timstat    timmean         Time mean
+      Timstat    timavg          Time average
+      Timstat    timvar          Time variance
+      Timstat    timstd          Time standard deviation
+      Hourstat   hourmin         Hourly minimum
+      Hourstat   hourmax         Hourly maximum
+      Hourstat   hoursum         Hourly sum
+      Hourstat   hourmean        Hourly mean
+      Hourstat   houravg         Hourly average
+      Hourstat   hourvar         Hourly variance
+      Hourstat   hourstd         Hourly standard deviation
+      Daystat    daymin          Daily minimum
+      Daystat    daymax          Daily maximum
+      Daystat    daysum          Daily sum
+      Daystat    daymean         Daily mean
+      Daystat    dayavg          Daily average
+      Daystat    dayvar          Daily variance
+      Daystat    daystd          Daily standard deviation
+      Monstat    monmin          Monthly minimum
+      Monstat    monmax          Monthly maximum
+      Monstat    monsum          Monthly sum
+      Monstat    monmean         Monthly mean
+      Monstat    monavg          Monthly average
+      Monstat    monvar          Monthly variance
+      Monstat    monstd          Monthly standard deviation
+      Yearstat   yearmin         Yearly minimum
+      Yearstat   yearmax         Yearly maximum
+      Yearstat   yearsum         Yearly sum
+      Yearstat   yearmean        Yearly mean
+      Yearstat   yearavg         Yearly average
+      Yearstat   yearvar         Yearly variance
+      Yearstat   yearstd         Yearly standard deviation
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Timstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int cmplen;
+  char indate1[DATE_LEN+1], indate2[DATE_LEN+1];
+  int gridsize;
+  int vdate = 0, vtime = 0;
+  int vdate0 = 0, vtime0 = 0;
+  int vdate_lb = 0, vdate_ub = 0, date_lb = 0, date_ub = 0;
+  int vtime_lb = 0, vtime_ub = 0, time_lb = 0, time_ub = 0;
+  int nrecs, nrecords;
+  int varID, levelID, recID;
+  int tsID;
+  int otsID;
+  long nsets;
+  int i;
+  int streamID1, streamID2, streamID3 = -1;
+  int vlistID1, vlistID2, vlistID3, taxisID1, taxisID2, taxisID3 = -1;
+  int nmiss;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  int taxis_has_bounds = FALSE;
+  int lvfrac = FALSE;
+  char vdatestr[32], vtimestr[32];
+  double vfrac = 1;
+  double missval;
+  field_t **vars1 = NULL, **vars2 = NULL, **samp1 = NULL;
+  field_t field;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("timmin",   func_min,  31, NULL);
+  cdoOperatorAdd("timmax",   func_max,  31, NULL);
+  cdoOperatorAdd("timsum",   func_sum,  31, NULL);
+  cdoOperatorAdd("timmean",  func_mean, 31, NULL);
+  cdoOperatorAdd("timavg",   func_avg,  31, NULL);
+  cdoOperatorAdd("timvar",   func_var,  31, NULL);
+  cdoOperatorAdd("timstd",   func_std,  31, NULL);
+  cdoOperatorAdd("yearmin",  func_min,  10, NULL);
+  cdoOperatorAdd("yearmax",  func_max,  10, NULL);
+  cdoOperatorAdd("yearsum",  func_sum,  10, NULL);
+  cdoOperatorAdd("yearmean", func_mean, 10, NULL);
+  cdoOperatorAdd("yearavg",  func_avg,  10, NULL);
+  cdoOperatorAdd("yearvar",  func_var,  10, NULL);
+  cdoOperatorAdd("yearstd",  func_std,  10, NULL);
+  cdoOperatorAdd("monmin",   func_min,   8, NULL);
+  cdoOperatorAdd("monmax",   func_max,   8, NULL);
+  cdoOperatorAdd("monsum",   func_sum,   8, NULL);
+  cdoOperatorAdd("monmean",  func_mean,  8, NULL);
+  cdoOperatorAdd("monavg",   func_avg,   8, NULL);
+  cdoOperatorAdd("monvar",   func_var,   8, NULL);
+  cdoOperatorAdd("monstd",   func_std,   8, NULL);
+  cdoOperatorAdd("daymin",   func_min,   6, NULL);
+  cdoOperatorAdd("daymax",   func_max,   6, NULL);
+  cdoOperatorAdd("daysum",   func_sum,   6, NULL);
+  cdoOperatorAdd("daymean",  func_mean,  6, NULL);
+  cdoOperatorAdd("dayavg",   func_avg,   6, NULL);
+  cdoOperatorAdd("dayvar",   func_var,   6, NULL);
+  cdoOperatorAdd("daystd",   func_std,   6, NULL);
+  cdoOperatorAdd("hourmin",  func_min,   4, NULL);
+  cdoOperatorAdd("hourmax",  func_max,   4, NULL);
+  cdoOperatorAdd("hoursum",  func_sum,   4, NULL);
+  cdoOperatorAdd("hourmean", func_mean,  4, NULL);
+  cdoOperatorAdd("houravg",  func_avg,   4, NULL);
+  cdoOperatorAdd("hourvar",  func_var,   4, NULL);
+  cdoOperatorAdd("hourstd",  func_std,   4, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  if ( operfunc == func_mean )
+    {
+      int oargc = operatorArgc();
+      char **oargv = operatorArgv();
+
+      if ( oargc == 1 )
+	{
+	  lvfrac = TRUE;
+	  vfrac = atof(oargv[0]);
+	  if ( cdoVerbose ) cdoPrint("Set vfrac to %g", vfrac);
+	  if ( vfrac < 0 || vfrac > 1 ) cdoAbort("vfrac out of range!");
+	}
+      else if ( oargc > 1 )
+	cdoAbort("Too many arguments!");
+    }
+
+  cmplen = DATE_LEN - cdoOperatorF2(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  if ( cdoOperatorF2(operatorID) == 31 ) vlistDefNtsteps(vlistID2, 1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxis_has_bounds = taxisHasBounds(taxisID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  if ( cdoDiag )
+    {
+      char filename[8192];
+
+      strcpy(filename, cdoOperatorName(operatorID));
+      strcat(filename, "_");
+      strcat(filename, cdoStreamName(1));
+      streamID3 = streamOpenWrite(filename, cdoFiletype());
+
+      vlistID3 = vlistDuplicate(vlistID1);
+
+      for ( varID = 0; varID < nvars; ++varID )
+	{
+	  vlistDefVarDatatype(vlistID3, varID, DATATYPE_INT32);
+	  vlistDefVarUnits(vlistID3, varID, "");
+	  vlistDefVarAddoffset(vlistID3, varID, 0);
+	  vlistDefVarScalefactor(vlistID3, varID, 1);
+	}
+
+      taxisID3 = taxisDuplicate(taxisID1);
+      vlistDefTaxis(vlistID3, taxisID3);
+
+      streamDefVlist(streamID3, vlistID3);
+    }
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  vars1 = field_malloc(vlistID1, FIELD_PTR);
+  samp1 = field_malloc(vlistID1, FIELD_NONE);
+  if ( operfunc == func_std || operfunc == func_var )
+    vars2 = field_malloc(vlistID1, FIELD_PTR);
+
+  tsID    = 0;
+  otsID   = 0;
+  while ( TRUE )
+    {
+      nsets = 0;
+      while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+	{
+	  vdate = taxisInqVdate(taxisID1);
+	  vtime = taxisInqVtime(taxisID1);
+
+	  if ( taxis_has_bounds )
+	    {
+	      taxisInqVdateBounds(taxisID1, &date_lb, &date_ub);
+	      taxisInqVtimeBounds(taxisID1, &time_lb, &time_ub);
+	      if ( nsets == 0 )
+		{
+		  vdate_lb = date_lb;
+		  vtime_lb = time_lb;
+		}
+	    }
+
+	  if ( nsets == 0 ) SET_DATE(indate2, vdate, vtime);
+	  SET_DATE(indate1, vdate, vtime);
+
+	  if ( DATE_IS_NEQ(indate1, indate2, cmplen) ) break;
+
+	  if ( taxis_has_bounds )
+	    {
+	      vdate_ub = date_ub;
+	      vtime_ub = time_ub;
+	    }
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID1, &varID, &levelID);
+
+	      if ( tsID == 0 )
+		{
+		  recVarID[recID]   = varID;
+		  recLevelID[recID] = levelID;
+		}
+
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	      if ( nsets == 0 )
+		{
+		  streamReadRecord(streamID1, vars1[varID][levelID].ptr, &nmiss);
+		  vars1[varID][levelID].nmiss = nmiss;
+
+		  if ( nmiss > 0 || samp1[varID][levelID].ptr )
+		    {
+		      if ( samp1[varID][levelID].ptr == NULL )
+			samp1[varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+
+		      for ( i = 0; i < gridsize; i++ )
+			if ( DBL_IS_EQUAL(vars1[varID][levelID].ptr[i], vars1[varID][levelID].missval) )
+			  samp1[varID][levelID].ptr[i] = 0;
+			else
+			  samp1[varID][levelID].ptr[i] = 1;
+		    }
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, field.ptr, &field.nmiss);
+		  field.grid    = vars1[varID][levelID].grid;
+		  field.missval = vars1[varID][levelID].missval;
+
+		  if ( field.nmiss > 0 || samp1[varID][levelID].ptr )
+		    {
+		      if ( samp1[varID][levelID].ptr == NULL )
+			{
+			  samp1[varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+			  for ( i = 0; i < gridsize; i++ )
+			    samp1[varID][levelID].ptr[i] = nsets;
+			}
+
+		      for ( i = 0; i < gridsize; i++ )
+			if ( !DBL_IS_EQUAL(field.ptr[i], vars1[varID][levelID].missval) )
+			  samp1[varID][levelID].ptr[i]++;
+		    }
+
+		  if ( operfunc == func_std || operfunc == func_var )
+		    {
+		      farsumq(&vars2[varID][levelID], field);
+		      farsum(&vars1[varID][levelID], field);
+		    }
+		  else
+		    {
+		      farfun(&vars1[varID][levelID], field, operfunc);
+		    }
+		}
+	    }
+
+	  if ( nsets == 0 && (operfunc == func_std || operfunc == func_var) )
+	    for ( varID = 0; varID < nvars; varID++ )
+	      {
+		if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+		nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+		for ( levelID = 0; levelID < nlevel; levelID++ )
+		  farmoq(&vars2[varID][levelID], vars1[varID][levelID]);
+	      }
+
+	  vdate0 = vdate;
+	  vtime0 = vtime;
+	  nsets++;
+	  tsID++;
+	}
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+
+      if ( operfunc == func_mean || operfunc == func_avg )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      {
+		if ( samp1[varID][levelID].ptr == NULL )
+		  farcmul(&vars1[varID][levelID], 1.0/nsets);
+		else
+		  fardiv(&vars1[varID][levelID], samp1[varID][levelID]);
+	      }
+	  }
+      else if ( operfunc == func_std || operfunc == func_var )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      {
+		if ( samp1[varID][levelID].ptr == NULL )
+		  {
+		    if ( operfunc == func_std )
+		      farcstd(&vars1[varID][levelID], vars2[varID][levelID], 1.0/nsets);
+		    else
+		      farcvar(&vars1[varID][levelID], vars2[varID][levelID], 1.0/nsets);
+		  }
+		else
+		  {
+		    farinv(&samp1[varID][levelID]);
+		    if ( operfunc == func_std )
+		      farstd(&vars1[varID][levelID], vars2[varID][levelID], samp1[varID][levelID]);
+		    else
+		      farvar(&vars1[varID][levelID], vars2[varID][levelID], samp1[varID][levelID]);
+		  }
+	      }
+	  }
+
+      if ( cdoVerbose )
+	{
+	  date2str(vdate0, vdatestr, sizeof(vdatestr));
+	  time2str(vtime0, vtimestr, sizeof(vtimestr));
+	  cdoPrint("%s %s  vfrac = %g, nsets = %d", vdatestr, vtimestr, vfrac, nsets);
+	}
+
+      if ( lvfrac && operfunc == func_mean )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      {
+		missval = vars1[varID][levelID].missval;
+		if ( samp1[varID][levelID].ptr )
+		  {
+		    int irun = 0;
+		    for ( i = 0; i < gridsize; ++i )
+		      {
+			if ( (samp1[varID][levelID].ptr[i] / nsets) < vfrac )
+			  {
+			    vars1[varID][levelID].ptr[i] = missval;
+			    irun++;
+			  }
+		      }
+
+		    if ( irun )
+		      {
+			nmiss = 0;
+			for ( i = 0; i < gridsize; ++i )
+			  if ( DBL_IS_EQUAL(vars1[varID][levelID].ptr[i], missval) ) nmiss++;
+			vars1[varID][levelID].nmiss = nmiss;
+		      }
+		  }
+	      }
+	  }
+
+      taxisDefVdate(taxisID2, vdate0);
+      taxisDefVtime(taxisID2, vtime0);
+      if ( taxis_has_bounds )
+	{
+	  taxisDefVdateBounds(taxisID2, vdate_lb, vdate_ub);
+	  taxisDefVtimeBounds(taxisID2, vtime_lb, vtime_ub);
+	}
+      streamDefTimestep(streamID2, otsID);
+
+      if ( cdoDiag )
+	{
+	  taxisDefVdate(taxisID3, vdate0);
+	  taxisDefVtime(taxisID3, vtime0);
+	  if ( taxis_has_bounds )
+	    {
+	      taxisDefVdateBounds(taxisID3, vdate_lb, vdate_ub);
+	      taxisDefVtimeBounds(taxisID3, vtime_lb, vtime_ub);
+	    }
+	  streamDefTimestep(streamID3, otsID);
+	}
+
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  varID   = recVarID[recID];
+	  levelID = recLevelID[recID];
+
+	  if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, vars1[varID][levelID].ptr,  vars1[varID][levelID].nmiss);
+	  if ( cdoDiag )
+	    {
+	      if ( samp1[varID][levelID].ptr )
+		{
+		  streamDefRecord(streamID3, varID, levelID);
+		  streamWriteRecord(streamID3, samp1[varID][levelID].ptr, 0);
+		}
+	    }
+	}
+
+      if ( nrecs == 0 ) break;
+      otsID++;
+    }
+
+
+  field_free(vars1, vlistID1);
+  field_free(samp1, vlistID1);
+  if ( operfunc == func_std || operfunc == func_var )
+    field_free(vars2, vlistID1);
+
+  if ( cdoDiag ) streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Timstat2.c b/src/Timstat2.c
new file mode 100644
index 0000000..f12ae94
--- /dev/null
+++ b/src/Timstat2.c
@@ -0,0 +1,318 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+        Timstat2        timcor      correlates two data files on the same grid
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+/* correlation in time */
+static
+int correlation_t(long gridsize, double missval1, double missval2, int *nofvals, 
+		  double *work0, double *work1, double *work2, double *work3, double *work4)
+{
+  long i;
+  int nvals, nmiss = 0;
+  double temp0, temp1, temp2, temp3, temp4, temp5, temp6;
+  double cor;
+
+  for ( i = 0; i < gridsize; i++ )
+    {	  
+      nvals = nofvals[i];
+
+      if ( nvals > 0 )
+	{
+	  temp0 = MUL(work0[i], work1[i]);
+	  temp1 = SUB(work4[i], DIV(temp0, nvals));
+	  temp2 = MUL(work0[i], work0[i]);
+	  temp3 = MUL(work1[i], work1[i]);
+	  temp4 = SUB(work2[i], DIV(temp2, nvals));
+	  temp5 = SUB(work3[i], DIV(temp3, nvals));
+	  temp6 = MUL(temp4, temp5);
+
+	  cor = DIV(temp1, SQRT(temp6));
+	  /*
+	    if      ( cor < -1)  cor = -1;
+	    else if ( cor >  1)  cor =  1;
+	  */
+	  if ( DBL_IS_EQUAL(cor, missval1) ) nmiss++;
+	}
+      else
+	{
+	  nmiss++;
+	  cor = missval1;
+	}
+
+      work0[i] = cor;
+    }
+
+  return nmiss;
+}
+
+/* covariance in time */
+static
+int covariance_t(long gridsize, double missval1, double missval2, int *nofvals, 
+		 double *work0, double *work1, double *work2)
+{
+  long i;
+  int nvals, nmiss = 0;
+  double temp;
+  double dnvals;
+  double covar;
+
+  for ( i = 0; i < gridsize; i++ )
+    {	  
+      nvals = nofvals[i];
+      dnvals = nvals;
+
+      if ( nvals > 0 )
+	{
+	  temp = DIV(MUL(work0[i], work1[i]), dnvals*dnvals);
+	  covar = SUB(DIV(work2[i], dnvals), temp);
+
+	  if ( DBL_IS_EQUAL(covar, missval1) ) nmiss++;
+	}
+      else
+	{
+	  nmiss++;
+	  covar = missval1;
+	}
+
+      work0[i] = covar;
+    }
+
+  return nmiss;
+}
+
+
+void *Timstat2(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int nwork = 0;
+  int streamID1, streamID2, streamID3;
+  int vdate = 0, vtime = 0;
+  int nrecs, nrecs2, nrecs3, nvars, nlevs;
+  long i, gridsize;
+  int tsID;
+  int varID, recID, levelID, gridID;
+  int nmiss;
+  int *recVarID, *recLevelID;
+  int vlistID1, vlistID2, vlistID3;
+  int taxisID1, taxisID2, taxisID3;
+  double missval1, missval2;
+  double ****work = NULL;
+  int ***nofvals = NULL;
+  double *array1 = NULL, *array2 = NULL;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("timcor",   func_cor,   0, NULL);
+  cdoOperatorAdd("timcovar", func_covar, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc   = cdoOperatorF1(operatorID);
+
+  if      ( operfunc == func_cor   ) nwork = 5;
+  else if ( operfunc == func_covar ) nwork = 3;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+ 
+  nvars  = vlistNvars(vlistID1);
+  nrecs  = vlistNrecs(vlistID1);
+  nrecs3 = nrecs;
+  recVarID   = (int *) malloc(nrecs*sizeof(int));
+  recLevelID = (int *) malloc(nrecs*sizeof(int));
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = taxisDuplicate(taxisID1);
+ 
+  vlistDefTaxis(vlistID3, taxisID3);
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+ 
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array1  = (double *) malloc(gridsize*sizeof(double));
+  array2  = (double *) malloc(gridsize*sizeof(double));
+  				 
+  work    = (double ****) malloc(nvars*sizeof(double ***));
+  nofvals = (int ***)     malloc(nvars*sizeof(int **));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, 0);  
+      gridsize = gridInqSize(gridID);
+      nlevs    = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+
+      work[varID]    = (double ***)  malloc(nlevs*sizeof(double **));
+      nofvals[varID] = (int **)      malloc(nlevs*sizeof(int *));  
+
+      for ( levelID = 0; levelID < nlevs; levelID++ )
+	{
+	  nofvals[varID][levelID] = (int *) malloc(gridsize*sizeof(int));
+	  memset(nofvals[varID][levelID], 0, gridsize*sizeof(int));
+      
+	  work[varID][levelID] = (double **) malloc(nwork*sizeof(double *));
+	  for ( i = 0; i < nwork; i++ )
+	    {
+	      work[varID][levelID][i] = (double *) malloc(gridsize*sizeof(double));
+	      memset(work[varID][levelID][i], 0, gridsize*sizeof(double));
+	    }
+	}
+    }
+ 
+  tsID=0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      nrecs2 = streamInqTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamInqRecord(streamID2, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;	     	     
+	    }	 
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  missval1 = vlistInqVarMissval(vlistID1, varID);
+	  missval2 = vlistInqVarMissval(vlistID2, varID);
+
+	  streamReadRecord(streamID1, array1, &nmiss);
+	  streamReadRecord(streamID2, array2, &nmiss);
+
+	  if ( operfunc == func_cor )
+	    {
+	      for ( i = 0; i < gridsize; i++)
+		{
+		  if ( ( ! DBL_IS_EQUAL(array1[i], missval1) ) && 
+		       ( ! DBL_IS_EQUAL(array2[i], missval2) ) )
+		    {
+		      work[varID][levelID][0][i] += array1[i];
+		      work[varID][levelID][1][i] += array2[i];
+		      work[varID][levelID][2][i] += array1[i]*array1[i];
+		      work[varID][levelID][3][i] += array2[i]*array2[i];
+		      work[varID][levelID][4][i] += array1[i]*array2[i];
+		      nofvals[varID][levelID][i]++;
+		    }
+		}	 
+	    }
+	  else if ( operfunc == func_covar )
+	    {
+	      for ( i = 0; i < gridsize; i++)
+		{
+		  if ( ( ! DBL_IS_EQUAL(array1[i], missval1) ) && 
+		       ( ! DBL_IS_EQUAL(array2[i], missval2) ) )
+		    {
+		      work[varID][levelID][0][i] += array1[i];
+		      work[varID][levelID][1][i] += array2[i];
+		      work[varID][levelID][2][i] += array1[i]*array2[i];
+		      nofvals[varID][levelID][i]++;
+		    }
+		}	 
+	    }
+	}
+
+      tsID++;
+    }
+
+  tsID = 0;
+  taxisDefVdate(taxisID3, vdate);
+  taxisDefVtime(taxisID3, vtime);
+  streamDefTimestep(streamID3, tsID);
+
+  for ( recID = 0; recID < nrecs3; recID++ )
+    {
+      varID    = recVarID[recID];
+      levelID  = recLevelID[recID];
+   
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+      missval1 = vlistInqVarMissval(vlistID1, varID);
+      missval2 = vlistInqVarMissval(vlistID2, varID);
+
+      if ( operfunc == func_cor )
+	{
+	  nmiss = correlation_t(gridsize, missval1, missval2, nofvals[varID][levelID],
+				work[varID][levelID][0], work[varID][levelID][1],
+				work[varID][levelID][2], work[varID][levelID][3], 
+				work[varID][levelID][4]);
+	}
+      else if ( operfunc == func_covar )
+	{
+	  nmiss = covariance_t(gridsize, missval1, missval2, nofvals[varID][levelID],
+			       work[varID][levelID][0], work[varID][levelID][1],
+			       work[varID][levelID][2]);
+	}
+
+      streamDefRecord(streamID3, varID, levelID);
+      streamWriteRecord(streamID3, work[varID][levelID][0], nmiss);
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevs; levelID++ )
+	{
+	  free(nofvals[varID][levelID]);
+	  for ( i = 0; i < nwork; i++ )
+	    free(work[varID][levelID][i]);
+	  free(work[varID][levelID]);
+	}
+    
+      free(nofvals[varID]);
+      free(work[varID]);
+    }
+    
+  free(nofvals);
+  free(work);
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array1 )     free(array1);
+  if ( array2 )     free(array2);
+  if ( recVarID )   free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+    
+  cdoFinish();   
+ 
+  return (0);
+}
diff --git a/src/Timstat3.c b/src/Timstat3.c
new file mode 100644
index 0000000..b047772
--- /dev/null
+++ b/src/Timstat3.c
@@ -0,0 +1,347 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+        Timstat3        varquot2test
+        Timstat3        meandiff2test
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "statistic.h"
+
+
+#define  NIN     2
+#define  NOUT    1
+#define  NFWORK  4
+#define  NIWORK  2
+
+void *Timstat3(void *argument)
+{
+  int VARQUOT2TEST, MEANDIFF2TEST;
+  int operatorID;
+  int streamID[NIN], streamID3;
+  int vlistID[NIN], vlistID2 = -1, vlistID3 = -1;
+  int gridsize;
+  int vdate = 0, vtime = 0;
+  int nrecs, nrecs3, nvars, nlevs ;
+  int i, iw, is;
+  int tsID;
+  int varID, recID, levelID, gridID;
+  int nmiss3;
+  int *recVarID, *recLevelID;
+  int taxisID1, taxisID3;
+  double rconst, risk;
+  double fnvals0, fnvals1;
+  double missval, missval1, missval2;
+  double fractil_1, fractil_2, statistic;
+  double temp0, temp1, temp2, temp3;
+  int ***iwork[NIWORK];
+  field_t **fwork[NFWORK];
+  field_t in[NIN], out[NOUT];
+  int reached_eof[NIN];
+  int n_in = NIN;
+
+
+  cdoInitialize(argument);
+
+  VARQUOT2TEST  = cdoOperatorAdd("varquot2test",  0, 0, NULL);
+  MEANDIFF2TEST = cdoOperatorAdd("meandiff2test", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg("constant and risk (e.g. 0.05)");
+  operatorCheckArgc(2);
+  rconst = atof(operatorArgv()[0]);
+  risk   = atof(operatorArgv()[1]);
+
+  if ( operatorID == VARQUOT2TEST )
+    {
+      if ( rconst <= 0 )
+	cdoAbort("Constant must be positive!");
+      
+      if ( risk <= 0 || risk >= 1 )
+	cdoAbort("Risk must be greater than 0 and lower than 1!");
+    }
+
+  for ( is = 0; is < NIN; ++is )
+    {
+      streamID[is] = streamOpenRead(cdoStreamName(is));
+
+      vlistID[is] = streamInqVlist(streamID[is]);
+      if ( is > 0 )
+	{
+	  vlistID2 = streamInqVlist(streamID[is]);
+	  vlistCompare(vlistID[0], vlistID2, CMP_ALL);
+	}
+    }
+
+  vlistID3 = vlistDuplicate(vlistID[0]);
+
+  gridsize = vlistGridsizeMax(vlistID[0]);
+  nvars = vlistNvars(vlistID[0]);
+  nrecs = vlistNrecs(vlistID[0]);
+  nrecs3 = nrecs;
+  recVarID   = (int *) malloc(nrecs*sizeof(int));
+  recLevelID = (int *) malloc(nrecs*sizeof(int));
+  taxisID1 = vlistInqTaxis(vlistID[0]);
+  taxisID3 = taxisDuplicate(taxisID1);
+ 
+  vlistDefTaxis(vlistID3, taxisID3);
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  for ( i = 0; i < NIN; ++i ) reached_eof[i] = 0;
+
+  for ( i = 0; i < NIN; ++i )
+    in[i].ptr = (double *) malloc(gridsize*sizeof(double));
+  				 
+  for ( i = 0; i < NOUT; ++i )
+    out[i].ptr = (double *) malloc(gridsize*sizeof(double));
+  				 
+  for ( iw = 0; iw < NFWORK; ++iw )
+    fwork[iw] = (field_t **) malloc(nvars*sizeof(field_t *));
+  for ( iw = 0; iw < NIWORK; ++iw )
+    iwork[iw] = (int ***)   malloc(nvars*sizeof(int **));
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      gridID   = vlistInqVarGrid(vlistID[0], varID);      
+      gridsize = vlistGridsizeMax(vlistID[0]);
+      nlevs    = zaxisInqSize(vlistInqVarZaxis(vlistID[0], varID));
+      missval  = missval1 = vlistInqVarMissval(vlistID[0], varID);
+      missval2 = vlistInqVarMissval(vlistID[1], varID); 
+
+      for ( iw = 0; iw < NFWORK; ++iw )
+	fwork[iw][varID] = (field_t *)  malloc(nlevs*sizeof(field_t));
+      for ( iw = 0; iw < NIWORK; ++iw )
+	iwork[iw][varID] = (int **)  malloc(nlevs*sizeof(int *));  
+
+      for ( levelID = 0; levelID < nlevs; ++levelID )
+	{
+	  for ( iw = 0; iw < NFWORK; ++iw )
+	    {
+	      fwork[iw][varID][levelID].grid    = gridID;
+	      fwork[iw][varID][levelID].nmiss   = 0;
+	      fwork[iw][varID][levelID].missval = missval;
+	      fwork[iw][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+	      memset(fwork[iw][varID][levelID].ptr, 0, gridsize*sizeof(double));
+	    }
+
+	  for ( iw = 0; iw < NIWORK; ++iw )
+	    {
+	      iwork[iw][varID][levelID] = (int *) malloc(gridsize*sizeof(int));
+	      memset(iwork[iw][varID][levelID], 0, gridsize*sizeof(int));
+	    }
+	}
+    }
+ 
+  tsID=0;
+  while ( TRUE )
+    {
+      for ( is = 0; is < NIN; ++is )
+	{
+	  if ( reached_eof[is] ) continue;
+
+	  nrecs = streamInqTimestep(streamID[is], tsID);
+	  if ( nrecs == 0 )
+	    {
+	      reached_eof[is] = 1;
+	      continue;
+	    }
+
+	  vdate = taxisInqVdate(taxisID1);
+	  vtime = taxisInqVtime(taxisID1);
+
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      streamInqRecord(streamID[is], &varID, &levelID);
+
+	      gridsize = gridInqSize(vlistInqVarGrid(vlistID[is], varID));
+
+	      in[is].missval = vlistInqVarMissval(vlistID[is], varID);
+
+	      if ( tsID == 0 && is == 0 )
+		{
+		  recVarID[recID] = varID;
+		  recLevelID[recID] = levelID;	     	     
+		}	 
+
+	      streamReadRecord(streamID[is], in[is].ptr, &in[is].nmiss);
+	      
+	      for ( i = 0; i < gridsize; ++i )
+		{
+		  /*
+		  if ( ( ! DBL_IS_EQUAL(array1[i], missval1) ) && 
+		  ( ! DBL_IS_EQUAL(array2[i], missval2) ) )
+		  */
+		    {
+		      fwork[NIN*is + 0][varID][levelID].ptr[i] += in[is].ptr[i];
+		      fwork[NIN*is + 1][varID][levelID].ptr[i] += in[is].ptr[i] * in[is].ptr[i];
+		      iwork[is][varID][levelID][i]++;
+		    }
+		}	 
+	    }
+	}
+
+      for ( is = 0; is < NIN; ++is )
+	if ( ! reached_eof[is] ) break;
+
+      if ( is == NIN ) break;
+
+      tsID++;
+    }
+
+  tsID = 0;
+  taxisDefVdate(taxisID3, vdate);
+  taxisDefVtime(taxisID3, vtime);
+  streamDefTimestep(streamID3, tsID);
+
+  for ( recID = 0; recID < nrecs3; recID++ )
+    {
+      varID    = recVarID[recID];
+      levelID  = recLevelID[recID];
+  
+      missval1 = fwork[0][varID][levelID].missval;
+      missval2 = missval1;
+
+      if ( operatorID == VARQUOT2TEST )
+	{
+	  for ( i = 0; i < gridsize; ++i )
+	    {
+	      fnvals0 = iwork[0][varID][levelID][i];
+	      fnvals1 = iwork[1][varID][levelID][i];
+
+	      temp0 = DIV(MUL(fwork[0][varID][levelID].ptr[i], fwork[0][varID][levelID].ptr[i]), fnvals0);
+	      temp1 = DIV(MUL(fwork[2][varID][levelID].ptr[i], fwork[2][varID][levelID].ptr[i]), fnvals1);
+	      temp2 = SUB(fwork[1][varID][levelID].ptr[i], temp0);
+	      temp3 = SUB(fwork[3][varID][levelID].ptr[i], temp1);
+	      statistic = DIV(temp2, ADD(temp2, MUL(rconst, temp3)));
+	      
+	      if ( fnvals0 <= 1 || fnvals1 <= 1 )
+		fractil_1 = fractil_2 = missval1;
+	      else
+		beta_distr_constants((fnvals0 - 1) / 2,
+				     (fnvals1 - 1) / 2, 1 - risk,
+				     &fractil_1, &fractil_2, __func__);
+	      out[0].ptr[i] = DBL_IS_EQUAL(statistic, missval1) ? missval1 : 
+	       	              statistic <= fractil_1 || statistic >= fractil_2 ? 1 : 0;
+	    }
+	}									       
+      else if ( operatorID == MEANDIFF2TEST )
+	{
+	  int j;
+	  double fnvals;
+	  double fractil;
+	  double mean_factor[NIN], var_factor[NIN];
+	  double stddev_estimator, mean_estimator, norm, deg_of_freedom;
+	  double tmp;
+	  
+	  mean_factor[0] = 1;
+	  mean_factor[1] = -1;
+	  var_factor[0] = var_factor[1] = 1;
+
+	  for ( i = 0; i < gridsize; ++i )
+	    {
+	      temp0 = 0;
+	      deg_of_freedom = -n_in;
+	      for ( j = 0; j < n_in; j++ )
+		{
+		  fnvals = iwork[j][varID][levelID][i];
+		  tmp   = DIV(MUL(fwork[2*j][varID][levelID].ptr[i], fwork[2*j][varID][levelID].ptr[i]), fnvals);
+		  temp0 = ADD(temp0, DIV(SUB(fwork[2*j+1][varID][levelID].ptr[i], tmp), var_factor[j]));
+		  deg_of_freedom = ADD(deg_of_freedom, fnvals);
+		}
+
+	      if ( !DBL_IS_EQUAL(temp0, missval1) && temp0 < 0 ) /* This is possible because */
+		temp0 = 0;	                                 /* of rounding errors       */
+
+	      stddev_estimator = SQRT(DIV(temp0, deg_of_freedom));
+	      mean_estimator = -rconst;
+	      for ( j = 0; j < n_in; j++ )
+		{
+		  fnvals = iwork[j][varID][levelID][i];
+		  mean_estimator = ADD(mean_estimator,
+				       MUL(mean_factor[j],
+					   DIV(fwork[2*j][varID][levelID].ptr[i], fnvals)));
+		}
+
+	      temp1 = 0;
+	      for ( j = 0; j < n_in; j++ )
+		{
+		  fnvals = iwork[j][varID][levelID][i];
+		  temp1 = ADD(temp1, DIV(MUL(MUL(mean_factor[j], mean_factor[j]),
+					     var_factor[j]), fnvals));
+		}
+
+	      norm = SQRT(temp1);
+	      
+	      temp2 = DIV(DIV(mean_estimator, norm), stddev_estimator);
+	      fractil = deg_of_freedom < 1 ? missval1 :
+		student_t_inv (deg_of_freedom, 1 - risk/2, __func__);
+
+	      out[0].ptr[i] = DBL_IS_EQUAL(temp2, missval1)|| DBL_IS_EQUAL(fractil, missval1) ? 
+		              missval1 : fabs(temp2) >= fractil;
+	    }
+	}
+
+      nmiss3 = 0;
+      for ( i = 0; i < gridsize; i++ )
+	if ( DBL_IS_EQUAL(out[0].ptr[i], missval1) ) nmiss3++;
+
+      streamDefRecord(streamID3, varID, levelID);
+      streamWriteRecord(streamID3, out[0].ptr, nmiss3);
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevs = zaxisInqSize(vlistInqVarZaxis(vlistID[0], varID));
+      for ( levelID = 0; levelID < nlevs; levelID++ )
+	{
+	  for ( iw = 0; iw < NFWORK; ++iw )
+	    free(fwork[iw][varID][levelID].ptr);
+	  for ( iw = 0; iw < NIWORK; ++iw )
+	    free(iwork[iw][varID][levelID]);
+	}
+    
+      for ( iw = 0; iw < NFWORK; ++iw ) free(fwork[iw][varID]);
+      for ( iw = 0; iw < NIWORK; ++iw ) free(iwork[iw][varID]);
+    }
+
+  for ( iw = 0; iw < NFWORK; iw++ ) free(fwork[iw]);
+  for ( iw = 0; iw < NIWORK; iw++ ) free(iwork[iw]);
+
+
+  streamClose(streamID3);
+  for ( is = 0; is < NIN; ++is )
+    streamClose(streamID[is]);
+
+  for ( i = 0; i < NIN; ++i ) free(in[i].ptr);
+  for ( i = 0; i < NOUT; ++i ) free(out[i].ptr);
+
+  free(recVarID);
+  free(recLevelID);
+    
+  cdoFinish();   
+ 
+  return (0);
+}
diff --git a/src/Tinfo.c b/src/Tinfo.c
new file mode 100644
index 0000000..016d8dd
--- /dev/null
+++ b/src/Tinfo.c
@@ -0,0 +1,499 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2007-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Tinfo      tinfo           Time information
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "dtypes.h"
+
+
+#define MAX_GAPS   64
+#define MAX_NTSM  128
+#define LIM_NTSM 1024
+
+enum {TU_SECONDS=0, TU_MINUTES, TU_HOURS, TU_DAYS, TU_MONTHS, TU_YEARS};
+char *tunits[] = {"second", "minute", "hour", "day", "month", "year"};
+int   iunits[] = {1, 60, 3600, 86400, 1, 12};
+
+static
+void printTunit(int unit)
+{
+  if ( unit == TUNIT_YEAR )
+    fprintf(stdout, "  Units = years");
+  else if ( unit == TUNIT_MONTH )
+    fprintf(stdout, "  Units = months");
+  else if ( unit == TUNIT_DAY )
+    fprintf(stdout, "  Units = days");
+  else if ( unit == TUNIT_12HOURS )
+    fprintf(stdout, "  Units = 12hours");
+  else if ( unit == TUNIT_6HOURS )
+    fprintf(stdout, "  Units = 6hours");
+  else if ( unit == TUNIT_3HOURS )
+    fprintf(stdout, "  Units = 3hours");
+  else if ( unit == TUNIT_HOUR )
+    fprintf(stdout, "  Units = hours");
+  else if ( unit == TUNIT_MINUTE )
+    fprintf(stdout, "  Units = minutes");
+  else if ( unit == TUNIT_SECOND )
+    fprintf(stdout, "  Units = seconds");
+  else
+    fprintf(stdout, "  Units = unknown");
+}
+
+static
+void printCalendar(int calendar)
+{
+  if      ( calendar == CALENDAR_STANDARD )
+    fprintf(stdout, "  Calendar = STANDARD");
+  else if ( calendar == CALENDAR_PROLEPTIC )
+    fprintf(stdout, "  Calendar = PROLEPTIC");
+  else if ( calendar == CALENDAR_360DAYS )
+    fprintf(stdout, "  Calendar = 360DAYS");
+  else if ( calendar == CALENDAR_365DAYS )
+    fprintf(stdout, "  Calendar = 365DAYS");
+  else if ( calendar == CALENDAR_366DAYS )
+    fprintf(stdout, "  Calendar = 366DAYS");
+  else
+    fprintf(stdout, "  Calendar = unknown");
+}
+
+
+void getTimeInc(double jdelta, int vdate0, int vdate1, int *incperiod, int *incunit)
+{
+  int year0, month0, day0;
+  int year1, month1, day1;
+  int deltam, deltay;
+  int lperiod;
+  int sign = 1;
+
+  *incperiod = 0;
+  *incunit   = 0;
+
+  if ( jdelta < 0 )
+    lperiod = (int)(jdelta-0.5);
+  else
+    lperiod = (int)(jdelta+0.5);
+
+  if ( lperiod < 0 )
+    {
+      int tmp;
+      tmp = vdate1;
+      vdate1 = vdate0;
+      vdate0 = tmp;
+      lperiod = -lperiod;
+      sign = -1;
+    }
+
+  // printf("\n%d %d %d\n",lperiod, vdate0, vdate1);
+
+  cdiDecodeDate(vdate0, &year0, &month0, &day0);
+  cdiDecodeDate(vdate1, &year1, &month1, &day1);
+
+  deltay = year1-year0;
+  deltam = deltay*12 + (month1-month0);
+
+  if ( lperiod/60 > 0 && lperiod/60 < 60 )
+    {
+      *incperiod = lperiod/60;
+      *incunit = TU_MINUTES;
+    }
+  else if ( lperiod/3600 > 0 && lperiod/3600 < 24 )
+    {
+      *incperiod = lperiod/3600;
+      *incunit = TU_HOURS;
+    }
+  else if ( lperiod/(3600*24) > 0 && lperiod/(3600*24) < 32 )
+    {
+      *incperiod = lperiod/(3600*24);
+      *incunit = TU_DAYS;
+      if ( *incperiod > 27 && deltam == 1 )
+	{
+	  *incperiod = 1;
+	  *incunit = TU_MONTHS;
+	}
+    }
+  else if ( lperiod/(3600*24*30) > 0 && lperiod/(3600*24*30) < 12 )
+    {
+      *incperiod = deltam;
+      *incunit = TU_MONTHS;
+    }
+  else if ( lperiod/(3600*24*30*12) > 0 )
+    {
+      *incperiod = deltay;
+      *incunit = TU_YEARS;
+    }
+  else
+    {
+      *incperiod = lperiod;
+      *incunit = TU_SECONDS;
+    }
+
+  *incperiod *= sign;
+}
+
+static
+void printBounds(int taxisID, int calendar)
+{
+  int vdate0, vdate1;
+  int vtime0, vtime1;
+  int incperiod = 0, incunit = 0;
+  juldate_t juldate1, juldate0;
+  double jdelta;
+  int i, len;
+  char vdatestr[32], vtimestr[32];
+
+  taxisInqVdateBounds(taxisID, &vdate0, &vdate1);
+  taxisInqVtimeBounds(taxisID, &vtime0, &vtime1);
+
+  date2str(vdate0, vdatestr, sizeof(vdatestr));
+  time2str(vtime0, vtimestr, sizeof(vtimestr));	  
+  fprintf(stdout, " %s %s", vdatestr, vtimestr);
+
+  date2str(vdate1, vdatestr, sizeof(vdatestr));
+  time2str(vtime1, vtimestr, sizeof(vtimestr));	  
+  fprintf(stdout, " %s %s", vdatestr, vtimestr);
+
+  juldate0  = juldate_encode(calendar, vdate0, vtime0);
+  juldate1  = juldate_encode(calendar, vdate1, vtime1);
+  jdelta    = juldate_to_seconds(juldate_sub(juldate1, juldate0));
+
+  getTimeInc(jdelta, vdate0, vdate1, &incperiod, &incunit);
+  
+  /* fprintf(stdout, "  %g  %g  %g  %d", jdelta, jdelta/3600, fmod(jdelta,3600), incperiod%3600);*/
+  len = fprintf(stdout, " %3d %s%s", incperiod, tunits[incunit], abs(incperiod)>1?"s":"");
+  for ( i = 0; i < 11-len; ++i ) fprintf(stdout, " ");
+}
+
+static
+int fill_gap(int ngaps, int ntsm[MAX_NTSM], int rangetsm[MAX_GAPS][2], 
+	     int vdatem[MAX_GAPS][MAX_NTSM], int vtimem[MAX_GAPS][MAX_NTSM],
+	     int tsID, int incperiod0, int incunit0, int vdate, int vdate0, int vtime0,
+	     int calendar, int day0, juldate_t juldate, juldate_t juldate0)
+{
+  int its = 0;
+  int year, month, day;
+  int ndate, ntime;
+  int ijulinc = incperiod0 * iunits[incunit0];
+
+  if ( ijulinc > 0 && ngaps < MAX_GAPS )
+    {
+      rangetsm[ngaps][0] = tsID;
+      rangetsm[ngaps][1] = tsID+1;
+
+      if ( incunit0 == TU_MONTHS || incunit0 == TU_YEARS )
+	{
+	  its = 0;
+	  ndate = vdate0;
+	  //printf("fill_gap %d\n", ndate);
+	  while ( TRUE )
+	    {
+	      cdiDecodeDate(ndate, &year, &month, &day);
+	      
+	      month += ijulinc;
+				  
+	      while ( month > 12 ) { month -= 12; year++; }
+	      while ( month <  1 ) { month += 12; year--; }
+	      
+	      if ( day0 == 31 )
+		day = days_per_month(calendar, year, month);
+	      
+	      ndate = cdiEncodeDate(year, month, day);
+	      ntime = vtime0;
+	      if ( ndate >= vdate ) break;
+	      /* printf("\n1 %d %d\n", ndate, ntime); */
+	      if ( its < MAX_NTSM )
+		{
+		  vdatem[ngaps][its] = ndate;
+		  vtimem[ngaps][its] = ntime;
+		}
+	      else if ( its >= LIM_NTSM )
+		break;
+
+	      its++;
+	    }
+	}
+      else
+	{
+	  its = 0;
+	  juldate0 = juldate_add_seconds(ijulinc, juldate0);
+	  while ( juldate_to_seconds(juldate0) < juldate_to_seconds(juldate) )
+	    {
+	      juldate_decode(calendar, juldate0, &ndate, &ntime);
+	      juldate0 = juldate_add_seconds(ijulinc, juldate0);
+	      if ( its < MAX_NTSM )
+		{
+		  vdatem[ngaps][its] = ndate;
+		  vtimem[ngaps][its] = ntime;
+		}
+	      else if ( its >= LIM_NTSM )
+		break;
+
+	      its++;
+	    }
+	}			
+      ntsm[ngaps] = its;
+    }
+
+  return (its);
+}
+
+
+void *Tinfo(void *argument)
+{
+  int vdate_first = 0, vtime_first = 0;
+  int vdate0 = 0, vtime0 = 0;
+  int vdate = 0, vtime = 0;
+  int nrecs, ntsteps;
+  int tsID = 0, ntimeout;
+  int taxisID;
+  int streamID;
+  int vlistID;
+  int year0, month0, day0;
+  int year, month, day;
+  int calendar, unit;
+  int incperiod0 = 0, incunit0 = 0;
+  int incperiod = 0, incunit = 0;
+  int its = 0, igap;
+  int ngaps = 0;
+  int ntsm[MAX_GAPS];
+  int rangetsm[MAX_GAPS][2];
+  int vdatem[MAX_GAPS][MAX_NTSM];
+  int vtimem[MAX_GAPS][MAX_NTSM];
+  juldate_t juldate, juldate0;
+  double jdelta = 0, jdelta0 = 0;
+  int arrow = 0;
+  int i, len;
+  char vdatestr[32], vtimestr[32];	  
+
+  cdoInitialize(argument);
+
+  streamID = streamOpenRead(cdoStreamName(0));
+
+  vlistID = streamInqVlist(streamID);
+
+  fprintf(stdout, "\n");
+
+  taxisID = vlistInqTaxis(vlistID);
+  ntsteps = vlistNtsteps(vlistID);
+
+  if ( ntsteps != 0 )
+    {
+      if ( ntsteps == CDI_UNDEFID )
+	fprintf(stdout, "   Time axis :  unlimited steps\n");
+      else
+	fprintf(stdout, "   Time axis :  %d step%s\n", ntsteps, ntsteps == 1 ? "" : "s");
+
+      if ( taxisID != CDI_UNDEFID )
+	{
+	  if ( taxisInqType(taxisID) == TAXIS_RELATIVE )
+	    {
+	      vdate = taxisInqRdate(taxisID);
+	      vtime = taxisInqRtime(taxisID);
+	      
+	      date2str(vdate, vdatestr, sizeof(vdatestr));
+	      time2str(vtime, vtimestr, sizeof(vtimestr));
+
+	      fprintf(stdout, "     RefTime = %s %s", vdatestr, vtimestr);
+		      
+	      unit = taxisInqTunit(taxisID);
+	      if ( unit != CDI_UNDEFID ) printTunit(unit);
+	      
+	      calendar = taxisInqCalendar(taxisID);
+	      if ( calendar != CDI_UNDEFID ) printCalendar(calendar);
+
+	      if ( taxisHasBounds(taxisID) )
+		fprintf(stdout, "  Bounds = true");
+
+	      fprintf(stdout, "\n");
+	    }
+	}
+
+      calendar = taxisInqCalendar(taxisID);
+
+      if ( taxisHasBounds(taxisID) )
+	fprintf(stdout, "\nTimestep YYYY-MM-DD hh:mm:ss   Increment YYYY-MM-DD hh:mm:ss  YYYY-MM-DD hh:mm:ss  Difference\n");
+      else
+	fprintf(stdout, "\nTimestep YYYY-MM-DD hh:mm:ss   Increment\n");
+
+      tsID = 0;
+      while ( (nrecs = streamInqTimestep(streamID, tsID)) )
+	{  
+	  vdate = taxisInqVdate(taxisID);
+	  vtime = taxisInqVtime(taxisID);
+	  
+	  cdiDecodeDate(vdate, &year, &month, &day);
+	      
+	  date2str(vdate, vdatestr, sizeof(vdatestr));
+	  time2str(vtime, vtimestr, sizeof(vtimestr));
+
+	  fprintf(stdout, "%6d  %s %s", tsID+1, vdatestr, vtimestr);
+
+	  if ( tsID )
+	    {
+	      cdiDecodeDate(vdate0, &year0, &month0, &day0);
+
+	      juldate0  = juldate_encode(calendar, vdate0, vtime0);
+	      juldate   = juldate_encode(calendar, vdate, vtime);
+	      jdelta    = juldate_to_seconds(juldate_sub(juldate, juldate0));
+
+	      getTimeInc(jdelta, vdate0, vdate, &incperiod, &incunit);
+
+	      /* fprintf(stdout, "  %g  %g  %g  %d", jdelta, jdelta/3600, fmod(jdelta,3600), incperiod%3600);*/
+	      len = fprintf(stdout, " %3d %s%s", incperiod, tunits[incunit], abs(incperiod)>1?"s":"");
+	      for ( i = 0; i < 11-len; ++i ) fprintf(stdout, " ");
+	    }
+	  else
+	    {
+	      vdate_first = vdate;
+	      vtime_first = vtime;
+	      fprintf(stdout, "   --------");
+	    }
+
+	  if ( taxisHasBounds(taxisID) ) printBounds(taxisID, calendar);
+
+	  if (  tsID > 1 && (incperiod != incperiod0 || incunit != incunit0) )
+	    {
+	      if ( tsID == 2 && (jdelta0 > jdelta) )
+		{
+		  jdelta0    = jdelta;
+		  incperiod0 = incperiod;
+		  incunit0   = incunit;
+
+		  its = fill_gap(ngaps, ntsm, rangetsm, vdatem, vtimem,
+				 1, incperiod0, incunit0, vdate_first, vdate, vtime,
+				 calendar, day, juldate0, 
+				 juldate_encode(calendar, vdate_first, vtime_first));
+
+		  arrow = '^';
+		}
+	      else
+		{
+		  its = fill_gap(ngaps, ntsm, rangetsm, vdatem, vtimem,
+				 tsID, incperiod0, incunit0, vdate, vdate0, vtime0,
+				 calendar, day0, juldate, juldate0);
+
+		  arrow = '<';
+
+		  if (  its == 0 && incperiod < 0 )
+		    {
+		      its = -1;
+		      vdate = vdate0;
+		      vtime = vtime0;
+		    }
+		}
+
+	      if ( its > 0 )
+		{
+		  ngaps++;
+		  if ( cdoVerbose )
+		    fprintf(stdout, "  %c--- Gap %d, missing %s%d timestep%s",
+			    arrow, ngaps, its>=LIM_NTSM?"more than ":"", its, its>1?"s":"");
+		}
+	      else if ( its < 0 )
+		{
+		  if ( cdoVerbose )
+		    fprintf(stdout, "  %c--- Wrong date/time information, negative increment!", arrow);
+		}
+	    }
+
+	  if ( tsID == 1 )
+	    {
+	      jdelta0    = jdelta;
+	      incperiod0 = incperiod;
+	      incunit0   = incunit;
+	    }
+
+	  fprintf(stdout, "\n");
+
+	  vdate0 = vdate;
+	  vtime0 = vtime;
+
+	  tsID++;
+	}
+    }
+
+  streamClose(streamID);
+
+  fprintf(stdout, "\n");
+
+  date2str(vdate_first, vdatestr, sizeof(vdatestr));
+  time2str(vtime_first, vtimestr, sizeof(vtimestr));
+  fprintf(stdout, " Start date          : %s %s\n", vdatestr, vtimestr);
+
+  date2str(vdate, vdatestr, sizeof(vdatestr));
+  time2str(vtime, vtimestr, sizeof(vtimestr));
+  fprintf(stdout, " End date            : %s %s\n", vdatestr, vtimestr);
+
+  fprintf(stdout, " Increment           : %3d %s%s\n", 
+	  incperiod0, tunits[incunit0], incperiod0>1?"s":"");
+  fprintf(stdout, " Number of timesteps : %d\n", tsID);
+  fprintf(stdout, " Gaps identified     : %d\n", ngaps);
+
+  if ( cdoVerbose && ngaps )
+    {
+      fprintf(stdout, "\nFound potentially %d gap%s in the time series", ngaps, ngaps>1?"s":"");
+      if ( ngaps >= MAX_GAPS )
+	{
+	  ngaps = MAX_GAPS;
+	  fprintf(stdout, ", here are the first %d", ngaps);
+	}
+      fprintf(stdout, ":\n");
+      for ( igap = 0; igap < ngaps; ++igap )
+	{
+	  fprintf(stdout, "  Gap %d between timestep %d and %d, missing %d timestep%s",
+		  igap+1, rangetsm[igap][0], rangetsm[igap][1], ntsm[igap], ntsm[igap]>1?"s":"");
+	  if ( ntsm[igap] >= MAX_NTSM )
+	    {
+	      ntsm[igap] = MAX_NTSM;
+	      fprintf(stdout, ", here are the first %d", ntsm[igap]);
+	    }
+	  fprintf(stdout, ":\n");
+	  
+	  ntimeout = 0;
+	  for ( its = 0; its < ntsm[igap]; ++its )
+	    {
+	      if ( ntimeout == 4 )
+		{
+		  ntimeout = 0;
+		  fprintf(stdout, "\n");
+		}
+
+	      vdate = vdatem[igap][its];
+	      vtime = vtimem[igap][its];
+
+	      date2str(vdate, vdatestr, sizeof(vdatestr));
+	      time2str(vtime, vtimestr, sizeof(vtimestr));
+	      fprintf(stdout, "  %s %s", vdatestr, vtimestr);
+
+	      ntimeout++;
+	      tsID++;
+	    }
+	  fprintf(stdout, "\n");
+	}
+    }
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Tocomplex.c b/src/Tocomplex.c
new file mode 100644
index 0000000..b6ff689
--- /dev/null
+++ b/src/Tocomplex.c
@@ -0,0 +1,127 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Tocomplex(void *argument)
+{
+  int RETOCOMPLEX, IMTOCOMPLEX;
+  int operatorID;
+  int streamID1, streamID2;
+  int tsID, tsID2, nrecs;
+  int recID, varID, levelID;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int i, gridsize;
+  int datatype;
+  int nmiss, nvars;
+  double *array1 = NULL, *array2 = NULL;
+
+  cdoInitialize(argument);
+
+  RETOCOMPLEX = cdoOperatorAdd("retocomplex", 0, 0, NULL);
+  IMTOCOMPLEX = cdoOperatorAdd("imtocomplex", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  nvars = vlistNvars(vlistID2);
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      datatype = vlistInqVarDatatype(vlistID2, varID);
+      if ( datatype == DATATYPE_FLT64 )
+	datatype = DATATYPE_CPX64;
+      else
+	datatype = DATATYPE_CPX32;
+
+      vlistDefVarDatatype(vlistID2, varID, datatype);
+    }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  if ( cdoFiletype() != FILETYPE_EXT ) cdoAbort("Complex numbers need EXTRA format; used CDO option -f ext!");
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(2*gridsize*sizeof(double));
+      
+  tsID  = 0;
+  tsID2 = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID2++);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamDefRecord(streamID2, varID, levelID);
+	      
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  if ( operatorID == RETOCOMPLEX )
+	    {
+	      for ( i = 0; i < gridsize; ++i )
+		{
+		  array2[2*i]   = array1[i];
+		  array2[2*i+1] = 0;
+		}
+	    }
+	  else if ( operatorID == IMTOCOMPLEX )
+	    {
+	      for ( i = 0; i < gridsize; ++i )
+		{
+		  array2[2*i]   = 0;
+		  array2[2*i+1] = array1[i];
+		}
+	    }
+
+	  streamWriteRecord(streamID2, array2, nmiss);
+	}
+       
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array1 ) free(array1);
+  if ( array2 ) free(array2);
+
+  vlistDestroy(vlistID2);
+
+  cdoFinish();
+
+  return (NULL);
+}
diff --git a/src/Transpose.c b/src/Transpose.c
new file mode 100644
index 0000000..4b43058
--- /dev/null
+++ b/src/Transpose.c
@@ -0,0 +1,135 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Transpose  transxy         Transpose X/Y
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void transxy(int gridID, double *array1, double *array2)
+{
+  int i, j;
+  int nx, ny;
+  double **a2D1, **a2D2;
+
+  nx = gridInqXsize(gridID);
+  ny = gridInqYsize(gridID);
+
+  a2D1 = (double **) malloc(ny*sizeof(double *));
+  a2D2 = (double **) malloc(nx*sizeof(double *));
+
+  for ( j = 0; j < ny; ++j ) a2D1[j] = array1+j*nx;
+  for ( i = 0; i < nx; ++i ) a2D2[i] = array2+i*ny;
+
+  for ( j = 0; j < ny; ++j )
+    for ( i = 0; i < nx; ++i )
+      a2D2[i][j] = a2D1[j][i];
+
+  free(a2D1);
+  free(a2D2);
+}
+
+
+void *Transpose(void *argument)
+{
+  int streamID1, streamID2;
+  int gridsize;
+  int ngrids, index;
+  int gridID1, gridID2;
+  int nx, ny;
+  int nrecs, recID;
+  int gridID, tsID;
+  int varID, levelID;
+  int vlistID1, vlistID2;
+  int nmiss;
+  int taxisID1, taxisID2;
+  double *array1, *array2;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  ngrids = vlistNgrids(vlistID1);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID1 = vlistGrid(vlistID1, index);
+      nx = gridInqXsize(gridID1);
+      ny = gridInqYsize(gridID1);
+
+      gridID2 = gridCreate(GRID_GENERIC, nx*ny);
+      gridDefXsize(gridID2, ny);
+      gridDefYsize(gridID2, nx);
+
+      vlistChangeGridIndex(vlistID2, index, gridID2);
+    }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  array1 = (double *) malloc(gridsize*sizeof(double));
+  array2 = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  gridID = vlistInqVarGrid(vlistID1, varID);
+
+	  transxy(gridID, array1, array2);
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array2, nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  free(array1);
+  free(array2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Trend.c b/src/Trend.c
new file mode 100644
index 0000000..6b08c0a
--- /dev/null
+++ b/src/Trend.c
@@ -0,0 +1,218 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Trend      trend           Trend
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Trend(void *argument)
+{
+  int gridsize;
+  int vdate = 0, vtime = 0;
+  int nrecs, nrecords;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int i, w;
+  int streamID1, streamID2, streamID3;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  int nwork = 5;
+  double zj;
+  double temp1, temp2;
+  double missval, missval1, missval2;
+  field_t **work[5];
+  field_t field1, field2;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  vlistDefNtsteps(vlistID2, 1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    vlistDefVarDatatype(vlistID2, varID, DATATYPE_FLT64);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+  streamDefVlist(streamID3, vlistID2);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  for ( w = 0; w < nwork; w++ )
+    work[w] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      for ( w = 0; w < nwork; w++ )
+	work[w][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  for ( w = 0; w < nwork; w++ )
+	    {
+	      work[w][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+	      for ( i = 0; i < gridsize; i++ ) work[w][varID][levelID].ptr[i] = 0;
+	    }
+	}
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      zj = tsID;
+      
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+
+	  streamReadRecord(streamID1, field1.ptr, &nmiss);
+
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( !DBL_IS_EQUAL(field1.ptr[i], missval) )
+	      {
+		work[0][varID][levelID].ptr[i] += zj;
+		work[1][varID][levelID].ptr[i] += zj * zj;
+		work[2][varID][levelID].ptr[i] += zj * field1.ptr[i];
+		work[3][varID][levelID].ptr[i] += field1.ptr[i];
+		work[4][varID][levelID].ptr[i]++;
+	      }      
+	}
+
+      tsID++;
+    }
+	  
+
+  taxisDefVdate(taxisID2, vdate);
+  taxisDefVtime(taxisID2, vtime);
+  streamDefTimestep(streamID2, 0);
+  streamDefTimestep(streamID3, 0);
+
+  for ( recID = 0; recID < nrecords; recID++ )
+    {
+      varID   = recVarID[recID];
+      levelID = recLevelID[recID];
+
+      missval  = vlistInqVarMissval(vlistID1, varID);
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+
+      missval1  = missval;
+      missval2  = missval;
+
+      for ( i = 0; i < gridsize; i++ )
+	{
+	  temp1 = SUB(work[2][varID][levelID].ptr[i],
+		      DIV(MUL(work[0][varID][levelID].ptr[i], work[3][varID][levelID].ptr[i]), work[4][varID][levelID].ptr[i]));
+	  temp2 = SUB(work[1][varID][levelID].ptr[i],
+		      DIV(MUL(work[0][varID][levelID].ptr[i], work[0][varID][levelID].ptr[i]), work[4][varID][levelID].ptr[i]));
+
+	  field2.ptr[i] = DIV(temp1, temp2);
+	  field1.ptr[i] = SUB(DIV(work[3][varID][levelID].ptr[i], work[4][varID][levelID].ptr[i]),
+			      MUL(DIV(work[0][varID][levelID].ptr[i], work[4][varID][levelID].ptr[i]), field2.ptr[i]));
+	}
+
+      nmiss = 0;
+      for ( i = 0; i < gridsize; i++ )
+	if ( DBL_IS_EQUAL(field1.ptr[i], missval) ) nmiss++;
+
+      streamDefRecord(streamID2, varID, levelID);
+      streamWriteRecord(streamID2, field1.ptr, nmiss);
+
+      nmiss = 0;
+      for ( i = 0; i < gridsize; i++ )
+	if ( DBL_IS_EQUAL(field2.ptr[i], missval) ) nmiss++;
+
+      streamDefRecord(streamID3, varID, levelID);
+      streamWriteRecord(streamID3, field2.ptr, nmiss);
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  for ( w = 0; w < nwork; w++ )
+	    free(work[w][varID][levelID].ptr);
+	}
+
+      for ( w = 0; w < nwork; w++ )
+	free(work[w][varID]);
+    }
+
+  for ( w = 0; w < nwork; w++ ) free(work[w]);
+
+  if ( field1.ptr ) free(field1.ptr);
+  if ( field2.ptr ) free(field2.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Trms.c b/src/Trms.c
new file mode 100644
index 0000000..e906797
--- /dev/null
+++ b/src/Trms.c
@@ -0,0 +1,295 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void trms(field_t field1, field_t field2, double *dp, field_t *field3)
+{
+  int i, k, nlev, len, rnmiss = 0;
+  int    zaxis    = field1.zaxis;
+  int    grid1    = field1.grid;
+  double *array1  = field1.ptr;
+  int    grid2    = field2.grid;
+  double *array2  = field2.ptr;
+  double missval1 = field1.missval;
+  double missval2 = field2.missval;
+  double *w       = field1.weight;
+  double rsum = 0, rsumw = 0, ravg = 0, wp;
+
+  nlev   = zaxisInqSize(zaxis);
+  len    = gridInqSize(grid1);
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("fields have different size!");
+
+  for ( k = 0; k < nlev; k++ ) 
+    for ( i = 0; i < len; i++ ) 
+      {
+	wp = w[i]*dp[k*len+i];
+	rsum  = ADD(rsum, MUL(wp, MUL(SUB(array2[k*len+i], array1[k*len+i]),
+				      SUB(array2[k*len+i], array1[k*len+i]))));
+	rsumw = ADD(rsumw, wp);
+      }
+
+  ravg = SQRT(DIV(rsum, rsumw));
+
+  if ( DBL_IS_EQUAL(ravg, missval1) ) rnmiss++;
+
+  field3->ptr[0] = ravg;
+  field3->nmiss  = rnmiss;
+}
+
+void *Trms(void *argument)
+{
+  int streamID1, streamID2, streamID3;
+  int vlistID1, vlistID2, vlistID3;
+  int gridID1, gridID3, lastgrid = -1;
+  int wstatus = FALSE;
+  int code = 0, oldcode = 0;
+  int zaxisID;
+  int index, ngrids, nzaxis;
+  int recID, nrecs;
+  int nvars, nlevel;
+  int gridsize;
+  int i, k;
+  int nmiss;
+  int tsID, varID, levelID;
+  int lim;
+  int pcode = 152, pvarID = -1;
+  int needWeights = FALSE;
+  long offset;
+  size_t vctsize = 0;
+  const double *vct, *va = NULL, *vb = NULL;
+  double dp1, dp2;
+  double *dp;
+  double *single;
+  double **vardata1 = NULL, **vardata2 = NULL;
+  double slon, slat;
+  double sglval;
+  field_t field1, field2, field3;
+  int taxisID1, taxisID3;
+
+  cdoInitialize(argument);
+
+  needWeights = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+
+  slon = 0;
+  slat = 0;
+  gridID3 = gridCreate(GRID_LONLAT, 1);
+  gridDefXsize(gridID3, 1);
+  gridDefYsize(gridID3, 1);
+  gridDefXvals(gridID3, &slon);
+  gridDefYvals(gridID3, &slat);
+
+  vlistClearFlag(vlistID1);
+  nvars    = vlistNvars(vlistID1);
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( vlistInqVarCode(vlistID1, varID) == pcode )
+	pvarID = varID;
+      else
+	vlistDefFlag(vlistID1, varID, 0, TRUE);
+    }
+
+  if ( pvarID == -1 ) cdoAbort("pressure variable missing!");
+
+  vlistID3 = vlistCreate();
+  vlistCopyFlag(vlistID3, vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  ngrids = vlistNgrids(vlistID1);
+  index = 0;
+  gridID1 = vlistGrid(vlistID1, index);
+  
+  if ( needWeights &&
+       gridInqType(gridID1) != GRID_LONLAT &&
+       gridInqType(gridID1) != GRID_GAUSSIAN )
+    cdoAbort("Unsupported gridtype: %s", gridNamePtr(gridInqType(gridID1)));
+
+  vlistChangeGridIndex(vlistID3, index, gridID3);
+  if ( ngrids > 1 ) cdoAbort("Too many different grids!");
+
+  nzaxis = vlistNzaxis(vlistID1);
+  for ( index = 0; index < nzaxis; index++ )
+    {
+      zaxisID = vlistZaxis(vlistID1, index);
+      if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+	{
+	  vctsize = zaxisInqVctSize(zaxisID);
+	  vct     = zaxisInqVctPtr(zaxisID);
+	  va = vct;
+	  vb = vct + vctsize/2;
+	  /*
+	  for ( i = 0; i < vctsize/2; i++ )
+	    fprintf(stdout, "%5d %25.17f %25.17f\n", i, vct[i], vct[vctsize/2+i]);
+	  for ( i = 0; i < vctsize/2-1; i++ )
+	    fprintf(stdout, "%5d %25.17f %25.17f %25.17f\n", i, vct[i], vct[vctsize/2+i],
+		    (va[i+1] + vb[i+1]*101300) - (va[i] + vb[i]*101300));
+	  */
+
+	  break;
+	}
+    }
+
+  if ( vctsize == 0 ) cdoAbort("VCT missing!");
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  vardata1 = (double **) malloc(nvars*sizeof(double*));
+  vardata2 = (double **) malloc(nvars*sizeof(double*));
+
+  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, pvarID));
+  nlevel   = vctsize/2 - 1;
+  dp = (double *) malloc(gridsize*nlevel*sizeof(double));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      vardata1[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+      vardata2[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+    }
+
+  lim = vlistGridsizeMax(vlistID1);
+  field1.weight = NULL;
+  if ( needWeights )
+    field1.weight = (double *) malloc(lim*sizeof(double));
+
+  field2.weight = NULL;
+
+  field3.ptr  = &sglval;
+  field3.grid = gridID3;
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      nrecs = streamInqTimestep(streamID2, tsID);
+
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single   = vardata1[varID] + offset;
+
+	  streamReadRecord(streamID1, single, &nmiss);
+	  if ( nmiss ) cdoAbort("Missing values unsupported for this operator!");
+
+	  streamInqRecord(streamID2, &varID, &levelID);
+
+	  single   = vardata2[varID] + offset;
+
+	  streamReadRecord(streamID2, single, &nmiss);
+	  if ( nmiss ) cdoAbort("Missing values unsupported for this operator!");
+	}
+
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, pvarID));
+      for ( i = 0; i < gridsize; i++ )
+	{
+	  vardata1[pvarID][i] = exp(vardata1[pvarID][i]);
+	  vardata2[pvarID][i] = exp(vardata2[pvarID][i]);
+	}
+
+      nlevel = vctsize/2 - 1;
+      for ( k = 0; k < nlevel; k++ )
+	{
+	  offset = gridsize*k;
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+	      dp1 = (va[k+1] + vb[k+1]*vardata1[pvarID][i]) - (va[k] + vb[k]*vardata1[pvarID][i]);
+	      dp2 = (va[k+1] + vb[k+1]*vardata2[pvarID][i]) - (va[k] + vb[k]*vardata2[pvarID][i]);
+
+	      dp[offset+i] = 0.5 * (dp1 + dp2);
+	    }
+	}
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  field1.ptr = vardata1[varID];
+	  field2.ptr = vardata2[varID];
+
+	  field1.zaxis   = vlistInqVarZaxis(vlistID1, varID);
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID);
+	  field2.grid    = vlistInqVarGrid(vlistID2, varID);
+	  if ( needWeights && field1.grid != lastgrid )
+	    {
+	      lastgrid = field1.grid;
+	      wstatus = gridWeights(field1.grid, field1.weight);
+	    }
+	  code = vlistInqVarCode(vlistID1, varID);
+	  if ( wstatus != 0 && tsID == 0 && code != oldcode )
+	    cdoWarning("Using constant area weights for code %d!", oldcode=code);
+
+	  field1.missval = vlistInqVarMissval(vlistID1, varID);
+	  field2.missval = vlistInqVarMissval(vlistID2, varID);
+	  field3.missval = vlistInqVarMissval(vlistID3, varID);
+
+	  trms(field1, field2, dp, &field3);
+
+	  streamDefRecord(streamID3, varID, 0);
+	  streamWriteRecord(streamID3, &sglval, field3.nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID3);
+
+  if ( field1.weight ) free(field1.weight);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      free(vardata1[varID]);
+      free(vardata2[varID]);
+    }
+
+  free(vardata1);
+  free(vardata2);
+  free(dp);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Tstepcount.c b/src/Tstepcount.c
new file mode 100644
index 0000000..54a96c2
--- /dev/null
+++ b/src/Tstepcount.c
@@ -0,0 +1,211 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Tstepcount  tstepcount  Count number of timesteps
+*/
+
+#if defined (_OPENMP)
+#  include <omp.h>
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  NALLOC_INC  1024
+
+
+static
+double tstepcount(long nts, double missval1, double *array1, double refval)
+{
+  long j;
+  long n = 0;
+
+  if ( DBL_IS_EQUAL(refval, missval1) ) return (missval1);
+
+  for ( j = 0; j < nts; j++ )
+    {
+      n++;
+      if ( DBL_IS_EQUAL(array1[j], refval) ) break;  
+    }
+
+  if ( j == nts )
+    return (missval1);
+  else
+    return ((double) n);
+}
+
+
+void *Tstepcount(void *argument)
+{
+  int ompthID;
+  int gridsize;
+  int nrecs;
+  int gridID, varID, levelID, recID;
+  int tsID;
+  int i;
+  int nts;
+  int nalloc = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int vdate = 0, vtime = 0;
+  double missval;
+  double refval = 0;
+  double count;
+  field_t ***vars = NULL;
+  typedef struct
+  {
+    double *array1;
+  } memory_t;
+  memory_t *mem = NULL;
+
+  cdoInitialize(argument);
+
+  if ( operatorArgc() == 1 ) refval = atof(operatorArgv()[0]);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  vlistDefNtsteps(vlistID2, 1);
+
+  nvars = vlistNvars(vlistID1);
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      vlistDefVarUnits(vlistID2, varID, "steps");
+    }
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      if ( tsID >= nalloc )
+	{
+	  nalloc += NALLOC_INC;
+	  vars  = (field_t ***) realloc(vars, nalloc*sizeof(field_t **));
+	}
+
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      vars[tsID] = field_malloc(vlistID1, FIELD_NONE);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  vars[tsID][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+	  streamReadRecord(streamID1, vars[tsID][varID][levelID].ptr, &nmiss);
+	  vars[tsID][varID][levelID].nmiss = nmiss;
+	}
+
+      tsID++;
+    }
+
+  nts = tsID;
+
+  mem = (memory_t *) malloc(ompNumThreads*sizeof(memory_t));
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      mem[i].array1 = (double *) malloc(nts*sizeof(double));
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      missval  = vlistInqVarMissval(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, ompthID, tsID) \
+  schedule(dynamic,1)
+#endif
+	  for ( i = 0; i < gridsize; i++ )
+	    {
+#if defined (_OPENMP)
+              ompthID = omp_get_thread_num();
+#else
+              ompthID = 0;
+#endif
+	      for ( tsID = 0; tsID < nts; tsID++ )
+		mem[ompthID].array1[tsID] = vars[tsID][varID][levelID].ptr[i];
+
+	      count = tstepcount(nts, missval, mem[ompthID].array1, refval);
+	      vars[0][varID][levelID].ptr[i] = count;
+	    }
+	}
+    }
+
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      free(mem[i].array1);
+    }
+  free(mem);
+
+  taxisDefVdate(taxisID2, vdate);
+  taxisDefVtime(taxisID2, vtime);
+  streamDefTimestep(streamID2, 0);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID2, varID);
+      missval  = vlistInqVarMissval(vlistID2, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+
+      for ( levelID = 0; levelID < nlevel; levelID++ )
+	{
+	  streamDefRecord(streamID2, varID, levelID);
+
+	  nmiss = 0;
+	  for ( i = 0; i < gridsize; i++ )
+	    if ( DBL_IS_EQUAL(vars[0][varID][levelID].ptr[i], missval) ) nmiss++;
+
+	  streamWriteRecord(streamID2, vars[0][varID][levelID].ptr, nmiss);
+	}
+    }
+
+  for ( tsID = 0; tsID < nts; tsID++ )
+    field_free(vars[tsID], vlistID1);
+
+  if ( vars  ) free(vars);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Vardup.c b/src/Vardup.c
new file mode 100644
index 0000000..101a601
--- /dev/null
+++ b/src/Vardup.c
@@ -0,0 +1,164 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Vardup     pardup          Duplicate parameters
+      Vardup     parmul          Multiply parameters
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Vardup(void *argument)
+{
+  int PARDUP, PARMUL;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs, nrecords;
+  int tsID, recID, varID, varID2, levelID;
+  int gridsize, i;
+  int vlistID1, vlistID2;
+  long offset;
+  int nmul = 0;
+  int nmiss;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  int **varnmiss;
+  double *single;
+  double **vardata;
+  double *array;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  PARDUP = cdoOperatorAdd("pardup", 0, 0, NULL);
+  PARMUL = cdoOperatorAdd("parmul", 0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == PARDUP )
+    {
+      nmul = 2;
+    }
+  else if ( operatorID == PARMUL )
+    {
+      operatorInputArg("number of multiply");
+      nmul = atoi(operatorArgv()[0]);
+    }
+  else
+    cdoAbort("operator not implemented!");
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array    = (double *) malloc(gridsize*sizeof(double));
+  vardata  = (double **) malloc(nvars*sizeof(double *));
+  varnmiss = (int **) malloc(nvars*sizeof(int *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      vardata[varID]  = (double *) malloc(gridsize*nlevel*sizeof(double));
+      varnmiss[varID] = (int *) malloc(nlevel*sizeof(int));
+    }
+
+  for ( i = 1; i < nmul; i++ )
+    {
+      vlistCat(vlistID2, vlistID1);
+      for ( varID = 0; varID < nvars; varID++ )
+	vlistDefVarCode(vlistID2, varID+nvars*i, -(varID+nvars*i+1));
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  recVarID[recID]   = varID;
+	  recLevelID[recID] = levelID;
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single   = vardata[varID] + offset;
+  
+	  streamReadRecord(streamID1, single, &nmiss);
+	  varnmiss[varID][levelID] = nmiss;
+	}
+
+      for ( i = 0; i < nmul; i++ )
+	for ( recID = 0; recID < nrecs; recID++ )
+	  {
+	    varID    = recVarID[recID];
+	    varID2   = varID + i*nvars;
+	    levelID  = recLevelID[recID];
+
+	    gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	    offset   = gridsize*levelID;
+	    single   = vardata[varID] + offset;
+	    nmiss    = varnmiss[varID][levelID];
+
+	    memcpy(array, single, gridsize*sizeof(double));
+
+	    streamDefRecord(streamID2,  varID2,  levelID);
+	    streamWriteRecord(streamID2, array, nmiss);
+	  }
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  for ( varID = 0; varID < nvars; varID++ )  free(vardata[varID]);
+  for ( varID = 0; varID < nvars; varID++ )  free(varnmiss[varID]);
+  free(vardata);
+  free(varnmiss);
+  free(array);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Vargen.c b/src/Vargen.c
new file mode 100644
index 0000000..297f0be
--- /dev/null
+++ b/src/Vargen.c
@@ -0,0 +1,352 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Vargen     const           Create a constant field
+      Vargen     random          Field with random values
+      Vargen     stdatm          Field values for pressure and temperature for
+                                 the standard atmosphere
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "list.h"
+
+
+#if defined (__GNUC__)
+#if __GNUC__ > 2
+#  define WITH_DATA 1
+#endif
+#endif
+
+
+#if defined(WITH_DATA)
+  static double etopo_scale  = 3;
+  static double etopo_offset = 11000;
+  static const unsigned short etopo[] = {
+#include "etopo.h"
+  };
+
+  static double temp_scale  =  500;
+  static double temp_offset = -220;
+  static const unsigned short temp[] = {
+#include "temp.h"
+  };
+
+  static double mask_scale  =  1;
+  static double mask_offset =  0;
+  static const unsigned short mask[] = {
+#include "mask.h"
+  };
+#endif
+
+/*  some Constants for creating temperatur and pressure for the standard atmosphere */
+#define T_ZERO          (213.0)
+#define T_DELTA          (75.0)
+#define SCALEHEIGHT   (10000.0)   /* [m] */
+#define P_ZERO         (1013.25)  /* surface pressure [hPa] */
+#define C_EARTH_GRAV      (9.80665)
+#define C_R             (287.05)  /*  specific gas constant for air */
+static double TMP4PRESSURE = (C_EARTH_GRAV*SCALEHEIGHT)/(C_R*T_ZERO);
+
+static double
+std_atm_temperatur(double height)
+{
+  /*
+    Compute the temperatur for the given height (in meters) according to the
+    solution of the hydrostatic atmosphere
+   */
+   return (T_ZERO + T_DELTA * exp((-1)*(height/SCALEHEIGHT)));
+}
+
+static double
+std_atm_pressure(double height)
+{
+  /*
+    Compute the pressure for the given height (in meters) according to the
+    solution of the hydrostatic atmosphere
+   */
+  return (P_ZERO * exp((-1)*TMP4PRESSURE*log((exp(height/SCALEHEIGHT)*T_ZERO + T_DELTA)/(T_ZERO + T_DELTA))));
+}
+
+void *Vargen(void *argument)
+{
+  int RANDOM, CONST, FOR, TOPO, TEMP, MASK, STDATM;
+  int operatorID;
+  int streamID;
+  int nvars, ntimesteps, nlevels = 1;
+  int tsID, varID, varID2 = -1, levelID;
+  int gridsize, i;
+  int vlistID;
+  int gridID = -1, zaxisID, taxisID;
+  int vdate, vtime, julday;
+  const char *gridfile;
+  double rval, rstart = 0, rstop = 0, rinc = 0;
+  double rconst = 0;
+  double *array, *levels = NULL;
+  LIST *flist = listNew(FLT_LIST);
+
+  cdoInitialize(argument);
+
+  RANDOM = cdoOperatorAdd("random", 0, 0, "grid description file or name, <seed>");
+  CONST  = cdoOperatorAdd("const",  0, 0, "constant value, grid description file or name");
+  FOR    = cdoOperatorAdd("for",    0, 0, "start, end, <increment>");
+  TOPO   = cdoOperatorAdd("topo",   0, 0, NULL);
+  TEMP   = cdoOperatorAdd("temp",   0, 0, NULL);
+  MASK   = cdoOperatorAdd("mask",   0, 0, NULL);
+  STDATM = cdoOperatorAdd("stdatm", 0, 0, "levels");
+
+  operatorID = cdoOperatorID();
+
+  if ( operatorID == RANDOM )
+    {
+      unsigned int seed = 1;
+      operatorInputArg(cdoOperatorEnter(operatorID));
+      if ( operatorArgc() < 1 ) cdoAbort("Too few arguments!");
+      if ( operatorArgc() > 2 ) cdoAbort("Too many arguments!");
+      gridfile = operatorArgv()[0];
+      gridID   = cdoDefineGrid(gridfile);
+      if ( operatorArgc() == 2 )
+        {
+          long idum;
+          idum = atol(operatorArgv()[1]);
+          if ( idum >= 0 && idum < 0x7FFFFFFF )
+            seed = idum;
+        }
+      srand(seed);
+    }
+  else if ( operatorID == CONST )
+    {
+      operatorInputArg(cdoOperatorEnter(operatorID));
+      operatorCheckArgc(2);
+      rconst   = atof(operatorArgv()[0]);
+      gridfile = operatorArgv()[1];
+      gridID   = cdoDefineGrid(gridfile);
+    }
+  else if ( operatorID == TOPO || operatorID == TEMP || operatorID == MASK )
+    {
+      int nlon, nlat, i;
+      double lon[720], lat[360];
+      nlon = 720;
+      nlat = 360;
+      gridID = gridCreate(GRID_LONLAT, nlon*nlat);
+      gridDefXsize(gridID, nlon);
+      gridDefYsize(gridID, nlat);
+
+      for ( i = 0; i < nlon; i++ ) lon[i] = -179.75 + i*0.5;
+      for ( i = 0; i < nlat; i++ ) lat[i] = -89.75 + i*0.5;
+
+      gridDefXvals(gridID, lon);
+      gridDefYvals(gridID, lat);
+    }
+  else if ( operatorID == FOR )
+    {
+      double lon = 0, lat = 0;
+      operatorInputArg(cdoOperatorEnter(operatorID));
+      if ( operatorArgc() < 2 ) cdoAbort("Too few arguments!");
+      if ( operatorArgc() > 3 ) cdoAbort("Too many arguments!");
+
+      rstart = atof(operatorArgv()[0]);
+      rstop  = atof(operatorArgv()[1]);
+      if ( operatorArgc() == 3 )
+        rinc = atof(operatorArgv()[2]);
+      else
+        rinc = 1;
+
+      if ( DBL_IS_EQUAL(rinc, 0.0) ) cdoAbort("Increment is zero!");
+
+      gridID = gridCreate(GRID_LONLAT, 1);
+      gridDefXsize(gridID, 1);
+      gridDefYsize(gridID, 1);
+      gridDefXvals(gridID, &lon);
+      gridDefYvals(gridID, &lat);
+    }
+  else if ( operatorID == STDATM )
+    {
+      double lon = 0, lat = 0;
+
+      operatorInputArg("levels");
+      nlevels = args2fltlist(operatorArgc(), operatorArgv(), flist);
+      levels  = (double *) listArrayPtr(flist);
+
+      if ( cdoVerbose ) for ( i = 0; i < nlevels; ++i ) printf("levels %d: %g\n", i, levels[i]);
+
+      gridID = gridCreate(GRID_LONLAT, 1);
+      gridDefXsize(gridID, 1);
+      gridDefYsize(gridID, 1);
+      gridDefXvals(gridID, &lon);
+      gridDefYvals(gridID, &lat);
+    }
+
+  if ( operatorID == STDATM )
+    {
+      zaxisID = zaxisCreate(ZAXIS_HEIGHT, nlevels);
+      zaxisDefLevels(zaxisID  , levels);
+      zaxisDefName(zaxisID    , "level");
+      zaxisDefLongname(zaxisID, "Level");
+      zaxisDefUnits(zaxisID   , "m");
+    }
+  else
+    {
+      zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
+      nlevels = 1;
+    }
+
+  vlistID = vlistCreate();
+
+  if ( operatorID == FOR )
+    varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+  else
+    varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_CONSTANT);
+  /*
+     For the standard atmosphere two output variables are generated: pressure and
+     temperatur. The first (varID) is pressure, second (varID2) is temperatur.
+     Add an additional variable for the standard atmosphere.
+   */
+  if ( operatorID == STDATM )
+    varID2 = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_CONSTANT);
+
+  if ( operatorID == MASK )
+    vlistDefVarDatatype(vlistID, varID, DATATYPE_INT8);
+
+  if ( operatorID == STDATM )
+    {
+      vlistDefVarName(vlistID    , varID , "P");
+      vlistDefVarCode(vlistID    , varID , 1);
+      vlistDefVarStdname(vlistID , varID , "air_pressure");
+      vlistDefVarLongname(vlistID, varID , "pressure");
+      vlistDefVarUnits(vlistID   , varID , "hPa");
+      vlistDefVarName(vlistID    , varID2, "T");
+      vlistDefVarCode(vlistID    , varID2, 130);
+      vlistDefVarStdname(vlistID , varID2, "air_temperature");
+      vlistDefVarLongname(vlistID, varID2, "temperature");
+      vlistDefVarUnits(vlistID   , varID2, "K");
+    }
+  else
+    {
+      vlistDefVarName(vlistID, varID, cdoOperatorName(operatorID));
+      if ( operatorID == TOPO )
+	vlistDefVarUnits(vlistID, varID , "m");	
+      if ( operatorID == TEMP )
+	vlistDefVarUnits(vlistID, varID , "K");	
+    }
+
+  taxisID = taxisCreate(TAXIS_RELATIVE);
+  vlistDefTaxis(vlistID, taxisID);
+
+  if ( operatorID == RANDOM || operatorID == CONST || operatorID == TOPO ||
+       operatorID == TEMP || operatorID == MASK || operatorID == STDATM )
+    vlistDefNtsteps(vlistID, 1);
+
+  streamID = streamOpenWrite(cdoStreamName(0), cdoFiletype());
+
+  streamDefVlist(streamID, vlistID);
+
+  gridsize = gridInqSize(gridID);
+  array = (double *) malloc(gridsize*sizeof(double));
+
+  if ( operatorID == FOR )
+    ntimesteps = 1.001 + ((rstop-rstart)/rinc);
+  else
+    ntimesteps = 1;
+
+  julday = date_to_julday(CALENDAR_PROLEPTIC, 10101);
+
+  nvars = vlistNvars(vlistID);
+
+  for ( tsID = 0; tsID < ntimesteps; tsID++ )
+    {
+      rval  = rstart + rinc*tsID;
+      vdate = julday_to_date(CALENDAR_PROLEPTIC, julday + tsID);
+      vtime = 0;
+      taxisDefVdate(taxisID, vdate);
+      taxisDefVtime(taxisID, vtime);
+      streamDefTimestep(streamID, tsID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+        {
+          nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID, varID));
+          for ( levelID = 0; levelID < nlevels; levelID++ )
+            {
+              streamDefRecord(streamID, varID, levelID);
+
+              if ( operatorID == RANDOM )
+                {
+                  for ( i = 0; i < gridsize; i++ )
+                    array[i] = rand()/(RAND_MAX+1.0);
+                }
+              else if ( operatorID == CONST )
+                {
+                  for ( i = 0; i < gridsize; i++ )
+                    array[i] = rconst;
+                }
+              else if ( operatorID == TOPO )
+                {
+#if defined(WITH_DATA)
+                  for ( i = 0; i < gridsize; i++ )
+                    array[i] = etopo[i]/etopo_scale - etopo_offset;
+#else
+                  cdoAbort("Operator support disabled!");
+#endif
+                }
+              else if ( operatorID == TEMP )
+                {
+#if defined(WITH_DATA)
+                  for ( i = 0; i < gridsize; i++ )
+                    array[i] = temp[i]/temp_scale - temp_offset;
+#else
+                  cdoAbort("Operator support disabled!");
+#endif
+                }
+              else if ( operatorID == MASK )
+                {
+#if defined(WITH_DATA)
+                  for ( i = 0; i < gridsize; i++ )
+                    array[i] = mask[i]/mask_scale - mask_offset;
+#else
+                  cdoAbort("Operator support disabled!");
+#endif
+                }
+              else if ( operatorID == FOR )
+                {
+                  array[0] = rval;
+                }
+              else if ( operatorID == STDATM )
+                {
+                  array[0] = (varID == varID2) ? std_atm_temperatur(levels[levelID]) : std_atm_pressure(levels[levelID]);
+                }
+
+              streamWriteRecord(streamID, array, 0);
+            }
+        }
+    }
+
+  streamClose(streamID);
+
+  vlistDestroy(vlistID);
+
+  if ( array ) free(array);
+  if ( levels ) free(levels); 
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Varrms.c b/src/Varrms.c
new file mode 100644
index 0000000..d63e4e7
--- /dev/null
+++ b/src/Varrms.c
@@ -0,0 +1,198 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Varrms(void *argument)
+{
+  int streamID1, streamID2, streamID3;
+  int vlistID1, vlistID2, vlistID3;
+  int gridID1, gridID2, gridID3, lastgrid = -1;
+  int wstatus = FALSE;
+  int code = 0, oldcode = 0;
+  int index, ngrids;
+  int recID, nrecs;
+  int nvars, nlevel;
+  int gridsize;
+  int nmiss;
+  int tsID, varID, levelID;
+  int lim;
+  int needWeights = FALSE;
+  long offset;
+  double *single;
+  double **vardata1 = NULL, **vardata2 = NULL;
+  double slon, slat;
+  double sglval;
+  field_t field1, field2, field3;
+  int taxisID1, taxisID3;
+
+  cdoInitialize(argument);
+
+  needWeights = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+
+  slon = 0;
+  slat = 0;
+  gridID3 = gridCreate(GRID_LONLAT, 1);
+  gridDefXsize(gridID3, 1);
+  gridDefYsize(gridID3, 1);
+  gridDefXvals(gridID3, &slon);
+  gridDefYvals(gridID3, &slat);
+
+  vlistClearFlag(vlistID1);
+  nvars    = vlistNvars(vlistID1);
+  for ( varID = 0; varID < nvars; varID++ )
+    vlistDefFlag(vlistID1, varID, 0, TRUE);
+
+  vlistID3 = vlistCreate();
+  vlistCopyFlag(vlistID3, vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  ngrids = vlistNgrids(vlistID1);
+  index = 0;
+  gridID1 = vlistGrid(vlistID1, index);
+  gridID2 = vlistGrid(vlistID1, index);
+  
+  if ( needWeights &&
+       gridInqType(gridID1) != GRID_LONLAT &&
+       gridInqType(gridID1) != GRID_GAUSSIAN )
+    cdoAbort("Unsupported gridtype: %s", gridNamePtr(gridInqType(gridID1)));
+
+  vlistChangeGridIndex(vlistID3, index, gridID3);
+  if ( ngrids > 1 ) cdoAbort("Too many different grids!");
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  vardata1 = (double **) malloc(nvars*sizeof(double*));
+  vardata2 = (double **) malloc(nvars*sizeof(double*));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+      vardata1[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+      vardata2[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+    }
+
+  lim = vlistGridsizeMax(vlistID1);
+  field1.weight = NULL;
+  if ( needWeights )
+    field1.weight = (double *) malloc(lim*sizeof(double));
+
+  field2.weight = NULL;
+
+  field3.ptr  = &sglval;
+  field3.grid = gridID3;
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      nrecs = streamInqTimestep(streamID2, tsID);
+
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single   = vardata1[varID] + offset;
+
+	  streamReadRecord(streamID1, single, &nmiss);
+	  if ( nmiss ) cdoAbort("Missing values unsupported for this operator!");
+
+	  streamInqRecord(streamID2, &varID, &levelID);
+
+	  single   = vardata2[varID] + offset;
+
+	  streamReadRecord(streamID2, single, &nmiss);
+	  if ( nmiss ) cdoAbort("this operator does not work with missing values!");
+	}
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  field1.ptr = vardata1[varID];
+	  field2.ptr = vardata2[varID];
+
+	  field1.zaxis   = vlistInqVarZaxis(vlistID1, varID);
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID);
+	  field2.grid    = vlistInqVarGrid(vlistID2, varID);
+	  if ( needWeights && field1.grid != lastgrid )
+	    {
+	      lastgrid = field1.grid;
+	      wstatus = gridWeights(field1.grid, field1.weight);
+	    }
+	  code = vlistInqVarCode(vlistID1, varID);
+	  if ( wstatus != 0 && tsID == 0 && code != oldcode )
+	    cdoWarning("Using constant area weights for code %d!", oldcode=code);
+
+	  field1.missval = vlistInqVarMissval(vlistID1, varID);
+	  field2.missval = vlistInqVarMissval(vlistID1, varID);
+	  field3.missval = vlistInqVarMissval(vlistID1, varID);
+
+	  varrms(field1, field2, &field3);
+
+	  streamDefRecord(streamID3, varID, 0);
+	  streamWriteRecord(streamID3, &sglval, field3.nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID3);
+
+  if ( field1.weight ) free(field1.weight);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      free(vardata1[varID]);
+      free(vardata2[varID]);
+    }
+
+  free(vardata1);
+  free(vardata2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Vertint.c b/src/Vertint.c
new file mode 100644
index 0000000..5805939
--- /dev/null
+++ b/src/Vertint.c
@@ -0,0 +1,679 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Vertint    ml2pl           Model to pressure level interpolation
+      Vertint    ml2hl           Model to height level interpolation
+*/
+
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "vinterp.h"
+#include "list.h"
+
+#define  C_EARTH_GRAV    (9.80665)
+
+void *Vertint(void *argument)
+{
+  int ML2PL, ML2HL, ML2PLX, ML2HLX;
+  int ML2PL_LP, ML2HL_LP, ML2PLX_LP, ML2HLX_LP;
+  int operatorID;
+  int mode;
+  enum {ECHAM_MODE, WMO_MODE};
+  enum {func_pl, func_hl};
+  enum {type_lin, type_log};
+  int geop_code = 0, temp_code = 0, ps_code = 0, lsp_code = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridsize, ngp = 0;
+  int recID, nrecs;
+  int i, k, offset;
+  int tsID, varID, levelID;
+  int nvars;
+  int zaxisIDp, zaxisIDh = -1, nzaxis;
+  int ngrids, gridID, zaxisID;
+  int nplev, nhlev = 0, nhlevf = 0, nhlevh = 0, nlevel, maxlev;
+  int *vert_index = NULL;
+  int nvct;
+  int geop_needed = FALSE;
+  int geopID = -1, tempID = -1, psID = -1, lnpsID = -1, gheightID = -1;
+  int code, param;
+  int pnum, pcat, pdis;
+  int **varnmiss = NULL, *pnmiss = NULL;
+  int *varinterp = NULL;
+  char paramstr[32];
+  char varname[CDI_MAX_NAME], stdname[CDI_MAX_NAME];
+  int *vars = NULL;
+  double minval, maxval;
+  double missval;
+  double *plev = NULL, *phlev = NULL, *vct = NULL;
+  double *rvct = NULL; /* reduced VCT for LM */
+  double *single1, *single2;
+  double **vardata1 = NULL, **vardata2 = NULL;
+  double *geop = NULL, *ps_prog = NULL, *full_press = NULL, *half_press = NULL;
+  double *hyb_press = NULL;
+  int Extrapolate = 0;
+  int taxisID1, taxisID2;
+  int lhavevct;
+  int mono_level;
+  int instNum, tableNum;
+  int useTable;
+  int operfunc, opertype;
+  LIST *flist = listNew(FLT_LIST);
+
+  cdoInitialize(argument);
+
+  ML2PL  = cdoOperatorAdd("ml2pl",  func_pl, type_lin, "pressure levels in pascal");
+  ML2PLX = cdoOperatorAdd("ml2plx", func_pl, type_lin, "pressure levels in pascal");
+  ML2HL  = cdoOperatorAdd("ml2hl",  func_hl, type_lin, "height levels in meter");
+  ML2HLX = cdoOperatorAdd("ml2hlx", func_hl, type_lin, "height levels in meter");
+  ML2PL_LP  = cdoOperatorAdd("ml2pl_lp",  func_pl, type_log, "pressure levels in pascal");
+  ML2PLX_LP = cdoOperatorAdd("ml2plx_lp", func_pl, type_log, "pressure levels in pascal");
+  ML2HL_LP  = cdoOperatorAdd("ml2hl_lp",  func_hl, type_log, "height levels in meter");
+  ML2HLX_LP = cdoOperatorAdd("ml2hlx_lp", func_hl, type_log, "height levels in meter");
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+  opertype = cdoOperatorF2(operatorID);
+
+  if ( operatorID == ML2PL || operatorID == ML2HL || operatorID == ML2PL_LP || operatorID == ML2HL_LP )
+    {
+      char *envstr;
+      envstr = getenv("EXTRAPOLATE");
+
+      if ( envstr )
+	{
+	  if ( isdigit((int) envstr[0]) )
+	    {
+	      Extrapolate = atoi(envstr);
+	      if ( Extrapolate == 1 )
+		cdoPrint("Extrapolation of missing values enabled!");
+	    }
+	}
+    }
+  else
+    {
+      Extrapolate = 1;
+    }
+
+  operatorInputArg(cdoOperatorEnter(operatorID));
+
+  nplev = args2fltlist(operatorArgc(), operatorArgv(), flist);
+  plev  = (double *) listArrayPtr(flist);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids  = vlistNgrids(vlistID1);
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) != GRID_SPECTRAL )
+	{
+	  ngp = gridInqSize(gridID);
+	  break;
+	}
+    }
+
+  /* check gridsize */
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) != GRID_SPECTRAL )
+	{
+	  if ( ngp != gridInqSize(gridID) )
+	    cdoAbort("Grids have different size!");
+	}
+    }
+
+  if ( operfunc == func_hl )
+    zaxisIDp = zaxisCreate(ZAXIS_HEIGHT, nplev);
+  else
+    zaxisIDp = zaxisCreate(ZAXIS_PRESSURE, nplev);
+
+  zaxisDefLevels(zaxisIDp, plev);
+  nzaxis  = vlistNzaxis(vlistID1);
+  lhavevct = FALSE;
+  for ( i = 0; i < nzaxis; i++ )
+    {
+      /* mono_level = FALSE; */
+      mono_level = TRUE;
+      zaxisID = vlistZaxis(vlistID1, i);
+      nlevel  = zaxisInqSize(zaxisID);
+
+      if ( (zaxisInqType(zaxisID) == ZAXIS_HYBRID || zaxisInqType(zaxisID) == ZAXIS_HYBRID_HALF) &&
+	   nlevel > 1 )
+	{
+	  double *level;
+	  int l;
+	  level = (double *) malloc(nlevel*sizeof(double));
+	  zaxisInqLevels(zaxisID, level);
+	  for ( l = 0; l < nlevel; l++ )
+	    {
+	      if ( (l+1) != (int) (level[l]+0.5) ) break;
+	    }
+	  if ( l == nlevel ) mono_level = TRUE; 
+	  free(level);
+	}
+
+      if ( (zaxisInqType(zaxisID) == ZAXIS_HYBRID || zaxisInqType(zaxisID) == ZAXIS_HYBRID_HALF) &&
+	   nlevel > 1 && mono_level )
+	{
+	  nvct = zaxisInqVctSize(zaxisID);
+	  if ( nlevel == (nvct/2 - 1) )
+	    {
+	      if ( lhavevct == FALSE )
+		{
+		  lhavevct = TRUE;
+		  zaxisIDh = zaxisID;
+		  nhlev    = nlevel;
+		  nhlevf   = nhlev;
+		  nhlevh   = nhlevf + 1;
+	      
+		  vct = (double *) malloc(nvct*sizeof(double));
+		  zaxisInqVct(zaxisID, vct);
+
+		  vlistChangeZaxisIndex(vlistID2, i, zaxisIDp);
+		}
+	      else
+		{
+		  if ( memcmp(vct, zaxisInqVctPtr(zaxisID), nvct*sizeof(double)) == 0 )
+		    vlistChangeZaxisIndex(vlistID2, i, zaxisIDp);
+		}
+	    }
+	  else if ( nlevel == (nvct/2) )
+	    {
+	      if ( lhavevct == FALSE )
+		{
+		  lhavevct = TRUE;
+		  zaxisIDh = zaxisID;
+		  nhlev    = nlevel;
+		  nhlevf   = nhlev - 1;
+		  nhlevh   = nhlev;
+	      
+		  vct = (double *) malloc(nvct*sizeof(double));
+		  zaxisInqVct(zaxisID, vct);
+
+		  vlistChangeZaxisIndex(vlistID2, i, zaxisIDp);
+		}
+	      else
+		{
+		  if ( memcmp(vct, zaxisInqVctPtr(zaxisID), nvct*sizeof(double)) == 0 )
+		    vlistChangeZaxisIndex(vlistID2, i, zaxisIDp);
+		}
+	    }
+	  else if ( nlevel == (nvct - 4 - 1) )
+	    {
+	      if ( lhavevct == FALSE )
+		{
+		  int vctsize;
+		  int voff = 4;
+		  
+		  rvct = (double *) malloc(nvct*sizeof(double));
+		  zaxisInqVct(zaxisID, rvct);
+
+		  if ( (int)(rvct[0]+0.5) == 100000 && rvct[voff] < rvct[voff+1] )
+		    {
+		      lhavevct = TRUE;
+		      zaxisIDh = zaxisID;
+		      nhlev    = nlevel;
+		      nhlevf   = nhlev;
+		      nhlevh   = nhlev + 1;
+
+		      vctsize = 2*nhlevh;
+		      vct = (double *) malloc(vctsize*sizeof(double));
+
+		      vlistChangeZaxisIndex(vlistID2, i, zaxisIDp);
+
+		      /* calculate VCT for LM */
+
+		      for ( i = 0; i < vctsize/2; i++ )
+			{
+			  if ( rvct[voff+i] >= rvct[voff] && rvct[voff+i] <= rvct[3] )
+			    {
+			      vct[i] = rvct[0]*rvct[voff+i];
+			      vct[vctsize/2+i] = 0;
+			    }
+			  else
+			    {
+			      vct[i] = (rvct[0]*rvct[3]*(1-rvct[voff+i]))/(1-rvct[3]);
+			      vct[vctsize/2+i] = (rvct[voff+i]-rvct[3])/(1-rvct[3]);
+			    }
+			}
+		      
+		      if ( cdoVerbose )
+			{
+			  for ( i = 0; i < vctsize/2; i++ )
+			    fprintf(stdout, "%5d %25.17f %25.17f\n", i, vct[i], vct[vctsize/2+i]);
+			}
+		    }
+		}
+	      else
+		{
+		  if ( memcmp(rvct, zaxisInqVctPtr(zaxisID), nvct*sizeof(double)) == 0 )
+		    vlistChangeZaxisIndex(vlistID2, i, zaxisIDp);
+		}
+	    }
+	}
+    }
+
+  nvars = vlistNvars(vlistID1);
+
+  vars      = (int *) malloc(nvars*sizeof(int));
+  vardata1  = (double **) malloc(nvars*sizeof(double*));
+  vardata2  = (double **) malloc(nvars*sizeof(double*));
+  varnmiss  = (int **) malloc(nvars*sizeof(int*));
+  varinterp = (int *) malloc(nvars*sizeof(int));
+
+  maxlev   = nhlevh > nplev ? nhlevh : nplev;
+
+  if ( Extrapolate == 0 )
+    pnmiss   = (int *) malloc(nplev*sizeof(int));
+
+  if ( zaxisIDh != -1 && ngp > 0 )
+    {
+      vert_index = (int *) malloc(ngp*nplev*sizeof(int));
+      ps_prog    = (double *) malloc(ngp*sizeof(double));
+      full_press = (double *) malloc(ngp*nhlevf*sizeof(double));
+      half_press = (double *) malloc(ngp*nhlevh*sizeof(double));
+    }
+  else
+    cdoWarning("No data on hybrid model level found!");
+
+  if ( operfunc == func_hl )
+    {
+      phlev = (double *) malloc(nplev*sizeof(double));
+      h2p(phlev, plev, nplev);
+      memcpy(plev, phlev, nplev*sizeof(double));
+      free(phlev);
+    }
+
+  if ( opertype == type_log )
+    for ( k = 0; k < nplev; k++ ) plev[k] = log(plev[k]);
+
+  useTable = FALSE;
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      tableNum = tableInqNum(vlistInqVarTable(vlistID1, varID));
+      if ( tableNum > 0 && tableNum != 255 )
+	{
+	  useTable = TRUE;
+	  break;
+	}
+    }
+
+  if ( cdoVerbose && useTable ) cdoPrint("Using code tables!");
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(zaxisID);
+      instNum  = institutInqCenter(vlistInqVarInstitut(vlistID1, varID));
+      tableNum = tableInqNum(vlistInqVarTable(vlistID1, varID));
+
+      code     = vlistInqVarCode(vlistID1, varID);
+      param    = vlistInqVarParam(vlistID1, varID);
+
+      cdiParamToString(param, paramstr, sizeof(paramstr));
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+      if ( pdis >= 0 && pdis < 255 ) code = -1;
+
+      if ( useTable )
+	{
+	  if ( tableNum == 2 )
+	    {
+	      mode = WMO_MODE;
+	      geop_code  =   6;
+	      temp_code  =  11;
+	      ps_code    =   1;
+	    }
+	  else if ( tableNum == 128 || tableNum == 0 )
+	    {
+	      mode = ECHAM_MODE;
+	      geop_code  = 129;
+	      temp_code  = 130;
+	      ps_code    = 134;
+	      lsp_code   = 152;
+	    }
+	  else
+	    mode = -1;
+	}
+      else
+	{
+	  mode = ECHAM_MODE;
+	  geop_code  = 129;
+	  temp_code  = 130;
+	  ps_code    = 134;
+	  lsp_code   = 152;
+	}
+
+      if ( cdoVerbose )
+	cdoPrint("Mode = %d  Center = %d  Code = %d  Param = %s", mode, instNum, code, paramstr);
+
+      if ( code <= 0 )
+	{
+	  vlistInqVarName(vlistID1, varID, varname);
+	  strtolower(varname);
+
+	  vlistInqVarStdname(vlistID1, varID, stdname);
+	  strtolower(stdname);
+
+	  if ( strcmp(stdname, "surface_air_pressure") == 0 ) code = 134;
+	  else
+	    {
+	      /*                        ECHAM                            ECMWF       */
+	      if      ( strcmp(varname, "geosp") == 0 || strcmp(varname, "z")    == 0 ) code = 129;
+	      else if ( strcmp(varname, "st")    == 0 || strcmp(varname, "t")    == 0 ) code = 130;
+	      else if ( strcmp(varname, "aps")   == 0 || strcmp(varname, "sp"  ) == 0 ) code = 134;
+	      else if ( strcmp(varname, "lsp")   == 0 || strcmp(varname, "lnsp") == 0 ) code = 152;
+	      /* else if ( strcmp(varname, "geopoth") == 0 ) code = 156; */
+	    }
+	}
+
+      if ( mode == ECHAM_MODE )
+	{
+	  if      ( code == geop_code  && nlevel == 1      ) geopID    = varID;
+	  else if ( code == temp_code  && nlevel == nhlevf ) tempID    = varID;
+	  else if ( code == ps_code    && nlevel == 1      ) psID      = varID;
+	  else if ( code == lsp_code   && nlevel == 1      ) lnpsID    = varID;
+	  else if ( code == 156        && nlevel == nhlevf ) gheightID = varID;
+	}
+      else if ( mode == WMO_MODE )
+	{
+	  if      ( code == geop_code  && nlevel == 1      ) geopID  = varID;
+	  else if ( code == temp_code  && nlevel == nhlevf ) tempID  = varID;
+	  else if ( code == ps_code    && nlevel == 1      ) psID    = varID;
+	}
+
+      if ( gridInqType(gridID) == GRID_SPECTRAL && zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+	cdoAbort("Spectral data on model level unsupported!");
+
+      if ( gridInqType(gridID) == GRID_SPECTRAL )
+	cdoAbort("Spectral data unsupported!");
+
+      if ( varID == gheightID )
+	vardata1[varID] = (double *) malloc(gridsize*(nlevel+1)*sizeof(double));
+      else
+	vardata1[varID] = (double *) malloc(gridsize*nlevel*sizeof(double));
+
+      /* if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID && zaxisIDh != -1 && nlevel == nhlev ) */
+      if ( zaxisID == zaxisIDh ||
+	   (zaxisInqType(zaxisID) == ZAXIS_HYBRID && zaxisIDh != -1 && (nlevel == nhlevh || nlevel == nhlevf)) )
+	{
+	  varinterp[varID] = TRUE;
+	  vardata2[varID]  = (double *) malloc(gridsize*nplev*sizeof(double));
+	  varnmiss[varID]  = (int *) malloc(maxlev*sizeof(int));
+	  memset(varnmiss[varID], 0, maxlev*sizeof(int));
+	}
+      else
+	{
+	  if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID && zaxisIDh != -1 && nlevel > 1 )
+	    cdoWarning("Parameter %d has wrong number of levels, skipped! (param=%s nlevel=%d)",
+		       varID+1, paramstr, nlevel);
+	  varinterp[varID] = FALSE;
+	  vardata2[varID]  = vardata1[varID];
+	  varnmiss[varID]  = (int *) malloc(nlevel*sizeof(int));
+	}
+    }
+
+  if ( tempID != -1 || gheightID != -1 ) geop_needed = TRUE;
+
+  if ( zaxisIDh != -1 && geop_needed )
+    {
+      geop = (double *) malloc(ngp*sizeof(double));
+      if ( geopID == -1 )
+	{
+	  cdoWarning("Orography (surf. geopotential) not found - using zero orography!");
+	  memset(geop, 0, ngp*sizeof(double));
+	}
+    }
+
+  if ( zaxisIDh != -1 && gheightID != -1 && tempID == -1 )
+    cdoAbort("Temperature not found, needed to compute geopotheight!");
+
+  if ( zaxisIDh != -1 && lnpsID == -1 )
+    {
+      if ( psID != -1 )
+	{
+	  param = vlistInqVarParam(vlistID1, psID);
+	  cdiParamToString(param, paramstr, sizeof(paramstr));
+	  if ( cdoVerbose )
+	    cdoPrint("LOG surface pressure not found - using surface pressure (param=%s)!", paramstr);
+	}
+      else
+	cdoAbort("Surface pressure not found!");
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      for ( varID = 0; varID < nvars; ++varID ) vars[varID] = FALSE;
+
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  offset   = gridsize*levelID;
+	  single1  = vardata1[varID] + offset;
+	  
+	  streamReadRecord(streamID1, single1, &varnmiss[varID][levelID]);
+	  vars[varID] = TRUE;
+	}
+
+      if ( zaxisIDh != -1 )
+	{
+	  if ( geop_needed && geopID != -1 )
+	    {
+	      memcpy(geop, vardata1[geopID], ngp*sizeof(double));
+
+	      /* check range of geop */
+	      minmaxval(ngp, geop, NULL, &minval, &maxval);
+	      if ( minval < MIN_FIS || maxval > MAX_FIS )
+		cdoWarning("Surface geopotential out of range (min=%g max=%g)!", minval, maxval);
+	      if ( minval >= 0 && maxval <= 1000 )
+		cdoWarning("Surface geopotential has an unexpected range (min=%g max=%g)!", minval, maxval);
+	    }
+
+	  if ( lnpsID != -1 )
+	    for ( i = 0; i < ngp; i++ ) ps_prog[i] = exp(vardata1[lnpsID][i]);
+	  else if ( psID != -1 )
+	    memcpy(ps_prog, vardata1[psID], ngp*sizeof(double));
+
+	  /* check range of ps_prog */
+	  minmaxval(ngp, ps_prog, NULL, &minval, &maxval);
+	  if ( minval < MIN_PS || maxval > MAX_PS )
+	    cdoWarning("Surface pressure out of range (min=%g max=%g)!", minval, maxval);
+
+
+	  presh(full_press, half_press, vct, ps_prog, nhlevf, ngp);
+
+	  if ( opertype == type_log )
+	    {
+	      for ( i = 0; i < ngp; i++ ) ps_prog[i] = log(ps_prog[i]);
+
+	      for ( k = 0; k < nhlevh; k++ )
+		for ( i = 0; i < ngp; i++ )
+		  half_press[k*ngp+i] = log(half_press[k*ngp+i]);
+
+	      for ( k = 0; k < nhlevf; k++ )
+		for ( i = 0; i < ngp; i++ )
+		  full_press[k*ngp+i] = log(full_press[k*ngp+i]);
+	    }
+
+	  genind(vert_index, plev, full_press, ngp, nplev, nhlevf);
+
+	  if ( Extrapolate == 0 )
+	    genindmiss(vert_index, plev, ngp, nplev, ps_prog, pnmiss);
+	}
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vars[varID] )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+	      missval  = vlistInqVarMissval(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlevel   = zaxisInqSize(zaxisID);
+	      if ( varinterp[varID] )
+		{
+		  /*
+		  if ( nlevel == nhlevh )
+		    {
+		      int i, k;
+		      double *vl1, *vl2;
+
+		      for ( k = 1; k < nlevel; k++ )
+			{
+			  vl1  = vardata1[varID] + gridsize*(k-1);
+			  vl2  = vardata1[varID] + gridsize*(k);
+			  for ( i = 0; i < gridsize; i++ )
+			    vl1[i] = 0.5*(vl1[i] + vl2[i]);
+			}
+		      
+		      nlevel = nhlevf;
+		    }
+		  */
+		  if ( nlevel == nhlevh )
+		    {
+		      hyb_press = half_press;
+		    }
+		  else if ( nlevel == nhlevf )
+		    {
+		      hyb_press = full_press;
+		    }
+		  else
+		    {
+		      param = vlistInqVarParam(vlistID1, varID);
+		      cdiParamToString(param, paramstr, sizeof(paramstr));
+		      cdoAbort("Number of hybrid level differ from full/half level (param=%s)!", paramstr);
+		    }
+
+		  for ( levelID = 0; levelID < nlevel; levelID++ )
+		    {
+		      if ( varnmiss[varID][levelID] )
+			cdoAbort("Missing values unsupported for this operator!");
+		    }
+
+		  if ( varID == tempID )
+		    {
+		      if ( nlevel == nhlevh )
+			cdoAbort("Temperature on half level unsupported!");
+
+		      if ( opertype == type_log && Extrapolate )
+			cdoAbort("Log. extrapolation of temperature unsupported!");
+
+		      interp_T(geop, vardata1[varID], vardata2[varID],
+			       full_press, half_press, vert_index,
+			       plev, nplev, ngp, nlevel, missval);
+		    }
+		  else if ( varID == gheightID )
+		    {
+		      for ( i = 0; i < ngp; ++i )
+			vardata1[varID][ngp*nlevel+i] = geop[i]/C_EARTH_GRAV;
+
+		      interp_Z(geop, vardata1[varID], vardata2[varID],
+			       full_press, half_press, vert_index, vardata1[tempID],
+			       plev, nplev, ngp, nlevel, missval);
+		    }
+		  else
+		    {
+		      interp_X(vardata1[varID], vardata2[varID], hyb_press,
+			       vert_index, plev, nplev, ngp, nlevel, missval);
+		    }
+		  
+		  if ( Extrapolate == 0 )
+		    memcpy(varnmiss[varID], pnmiss, nplev*sizeof(int));
+		}
+	    }
+	}
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vars[varID] )
+	    {
+	      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+		  offset   = gridsize*levelID;
+		  single2  = vardata2[varID] + offset;
+		  streamDefRecord(streamID2, varID, levelID);
+		  streamWriteRecord(streamID2, single2, varnmiss[varID][levelID]);
+		}
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      free(varnmiss[varID]);
+      free(vardata1[varID]);
+      if ( varinterp[varID] ) free(vardata2[varID]);
+    }
+
+  free(varinterp);
+  free(varnmiss);
+  free(vardata2);
+  free(vardata1);
+  free(vars);
+
+  if ( pnmiss     ) free(pnmiss);
+
+  if ( geop       ) free(geop);
+  if ( ps_prog    ) free(ps_prog);
+  if ( vert_index ) free(vert_index);
+  if ( full_press ) free(full_press);
+  if ( half_press ) free(half_press);
+  if ( vct        ) free(vct);
+  if ( rvct       ) free(rvct);
+
+  listDelete(flist);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Vertstat.c b/src/Vertstat.c
new file mode 100644
index 0000000..d49be7b
--- /dev/null
+++ b/src/Vertstat.c
@@ -0,0 +1,251 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Vertstat   vertmin         Vertical minimum
+      Vertstat   vertmax         Vertical maximum
+      Vertstat   vertsum         Vertical sum
+      Vertstat   vertmean        Vertical mean
+      Vertstat   vertavg         Vertical average
+      Vertstat   vertvar         Vertical variance
+      Vertstat   vertstd         Vertical standard deviation
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Vertstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridsize;
+  int recID, nrecs;
+  int gridID;
+  int i;
+  int tsID, varID, levelID;
+  int nmiss, nvars;
+  int zaxisID, nzaxis;
+  double missval;
+  field_t *vars1 = NULL, *vars2 = NULL, *samp1 = NULL;
+  field_t field;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("vertmin",  func_min,  0, NULL);
+  cdoOperatorAdd("vertmax",  func_max,  0, NULL);
+  cdoOperatorAdd("vertsum",  func_sum,  0, NULL);
+  cdoOperatorAdd("vertmean", func_mean, 0, NULL);
+  cdoOperatorAdd("vertavg",  func_avg,  0, NULL);
+  cdoOperatorAdd("vertvar",  func_var,  0, NULL);
+  cdoOperatorAdd("vertstd",  func_std,  0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc   = cdoOperatorF1(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  vlistClearFlag(vlistID1);
+  nvars = vlistNvars(vlistID1);
+  for ( varID = 0; varID < nvars; varID++ )
+    vlistDefFlag(vlistID1, varID, 0, TRUE);
+
+  vlistID2 = vlistCreate();
+  vlistCopyFlag(vlistID2, vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
+  nzaxis  = vlistNzaxis(vlistID1);
+  for ( i = 0; i < nzaxis; i++ )
+    if ( zaxisInqSize(vlistZaxis(vlistID1, i)) > 1 )
+      vlistChangeZaxisIndex(vlistID2, i, zaxisID);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  vars1 = (field_t *) malloc(nvars*sizeof(field_t));
+  samp1 = (field_t *) malloc(nvars*sizeof(field_t));
+  if ( operfunc == func_std || operfunc == func_var )
+    vars2 = (field_t *) malloc(nvars*sizeof(field_t));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      missval  = vlistInqVarMissval(vlistID1, varID);
+
+      vars1[varID].grid    = gridID;
+      vars1[varID].nsamp   = 0;
+      vars1[varID].nmiss   = 0;
+      vars1[varID].missval = missval;
+      vars1[varID].ptr     = (double *) malloc(gridsize*sizeof(double));
+      samp1[varID].grid    = gridID;
+      samp1[varID].nmiss   = 0;
+      samp1[varID].missval = missval;
+      samp1[varID].ptr     = NULL;
+      if ( operfunc == func_std || operfunc == func_var )
+	{
+	  vars2[varID].grid    = gridID;
+	  vars2[varID].nmiss   = 0;
+	  vars2[varID].missval = missval;
+	  vars2[varID].ptr     = (double *) malloc(gridsize*sizeof(double));
+	}
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+          vars1[varID].nsamp++;
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  if ( levelID == 0 )
+	    {
+	      streamReadRecord(streamID1, vars1[varID].ptr, &nmiss);
+	      vars1[varID].nmiss = nmiss;
+
+	      if ( operfunc == func_std || operfunc == func_var )
+		farmoq(&vars2[varID], vars1[varID]);
+
+	      if ( nmiss > 0 || samp1[varID].ptr )
+		{
+		  if ( samp1[varID].ptr == NULL )
+		    samp1[varID].ptr = (double *) malloc(gridsize*sizeof(double));
+
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( DBL_IS_EQUAL(vars1[varID].ptr[i], vars1[varID].missval) )
+		      samp1[varID].ptr[i] = 0;
+		    else
+		      samp1[varID].ptr[i] = 1;
+		}
+	    }
+	  else
+	    {
+	      streamReadRecord(streamID1, field.ptr, &field.nmiss);
+	      field.grid    = vars1[varID].grid;
+	      field.missval = vars1[varID].missval;
+
+	      if ( field.nmiss > 0 || samp1[varID].ptr )
+		{
+		  if ( samp1[varID].ptr == NULL )
+		    {
+		      samp1[varID].ptr = (double *) malloc(gridsize*sizeof(double));
+		      for ( i = 0; i < gridsize; i++ )
+			samp1[varID].ptr[i] = vars1[varID].nsamp;
+		    }
+
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( !DBL_IS_EQUAL(field.ptr[i], vars1[varID].missval) )
+		      samp1[varID].ptr[i]++;
+		}
+
+	      if ( operfunc == func_std || operfunc == func_var )
+		{
+		  farsumq(&vars2[varID], field);
+		  farsum(&vars1[varID], field);
+		}
+	      else
+		{
+		  farfun(&vars1[varID], field, operfunc);
+		}
+	    }
+	}
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vars1[varID].nsamp )
+	    {
+	      if ( operfunc == func_mean || operfunc == func_avg )
+		{
+		  if ( samp1[varID].ptr == NULL )
+		    farcmul(&vars1[varID], 1.0/vars1[varID].nsamp);
+		  else
+		    fardiv(&vars1[varID], samp1[varID]);
+		}
+	      else if ( operfunc == func_std || operfunc == func_var )
+		{
+		  if ( samp1[varID].ptr == NULL )
+		    {
+		      if ( operfunc == func_std )
+			farcstd(&vars1[varID], vars2[varID], 1.0/vars1[varID].nsamp);
+		      else
+			farcvar(&vars1[varID], vars2[varID], 1.0/vars1[varID].nsamp);
+		    }
+		  else
+		    {
+		      farinv(&samp1[varID]);
+		      if ( operfunc == func_std )
+			farstd(&vars1[varID], vars2[varID], samp1[varID]);
+		      else
+			farvar(&vars1[varID], vars2[varID], samp1[varID]);
+		    }
+		}
+
+	      streamDefRecord(streamID2, varID, 0);
+	      streamWriteRecord(streamID2, vars1[varID].ptr, vars1[varID].nmiss);
+	      vars1[varID].nsamp = 0;
+	    }
+	}
+
+      tsID++;
+    }
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      free(vars1[varID].ptr);
+      if ( samp1[varID].ptr ) free(samp1[varID].ptr);
+      if ( operfunc == func_std || operfunc == func_var ) free(vars2[varID].ptr);
+    }
+
+  free(vars1);
+  free(samp1);
+  if ( operfunc == func_std || operfunc == func_var ) free(vars2);
+
+  if ( field.ptr ) free(field.ptr);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  vlistDestroy(vlistID2);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Vertwind.c b/src/Vertwind.c
new file mode 100644
index 0000000..04a6b07
--- /dev/null
+++ b/src/Vertwind.c
@@ -0,0 +1,297 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Vertwind    vertwind      Convert the vertical velocity to [m/s]
+*/
+
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "vinterp.h"
+
+
+#define R  287.07  /* spezielle Gaskonstante fuer Luft */
+#define G  9.80665 /* Erdbeschleunigung */
+
+void *Vertwind(void *argument)
+{
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int taxisID1, taxisID2;
+  int gridID, zaxisID, tsID;
+  int nlevel, nrecs, recID, code;
+  int varID, levelID;
+  int nvars, nvct = 0;
+  int gridsize, i;
+  int offset;
+  int nmiss, nmiss_out;
+  int ngp = 0, ngrids;
+  int temp_code, sq_code, ps_code, omega_code, lsp_code;
+  int tempID = -1, sqID = -1, psID = -1, omegaID = -1, lnpsID = -1;
+  char varname[CDI_MAX_NAME];
+  double *vct = NULL;
+  double tv, rho;
+  double *level = NULL;
+  double *temp = NULL, *sq = NULL, *omega = NULL, *wms = NULL;
+  double *fpress = NULL, *hpress = NULL, *ps_prog = NULL;
+  double missval_t, missval_sq, missval_wap, missval_out;
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+
+  ngrids  = vlistNgrids(vlistID1);
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) != GRID_SPECTRAL )
+	{
+	  ngp = gridInqSize(gridID);
+	  break;
+	}
+    }
+
+  /* check gridsize */
+  for ( i = 0; i < ngrids; i++ )
+    {
+      gridID = vlistGrid(vlistID1, i);
+      if ( gridInqType(gridID) != GRID_SPECTRAL )
+	{
+	  if ( ngp != gridInqSize(gridID) )
+	    cdoAbort("Grids have different size!");
+	}
+    }
+
+  temp_code  = 130;
+  sq_code    = 133;
+  ps_code    = 134;
+  omega_code = 135;
+  lsp_code   = 152;
+
+  nvars = vlistNvars(vlistID1);
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      gridID   = vlistInqVarGrid(vlistID1, varID);
+      zaxisID  = vlistInqVarZaxis(vlistID1, varID);
+      gridsize = gridInqSize(gridID);
+      nlevel   = zaxisInqSize(zaxisID);
+
+      code = vlistInqVarCode(vlistID1, varID);
+
+      if ( code <= 0 )
+	{
+	  vlistInqVarName(vlistID1, varID, varname);
+
+	  strtolower(varname);
+
+	  if      ( strcmp(varname, "st")    == 0 ) code = 130;
+	  else if ( strcmp(varname, "sq")    == 0 ) code = 133;
+	  else if ( strcmp(varname, "aps")   == 0 ) code = 134;
+	  else if ( strcmp(varname, "omega") == 0 ) code = 135;
+	  else if ( strcmp(varname, "lsp")   == 0 ) code = 152;
+	}
+
+      if      ( code == temp_code  ) tempID  = varID;
+      else if ( code == sq_code    ) sqID    = varID;
+      else if ( code == ps_code    ) psID    = varID;
+      else if ( code == omega_code ) omegaID = varID;
+      else if ( code == lsp_code   ) lnpsID  = varID;
+    }
+
+  if ( tempID == -1 || sqID == -1 || omegaID == -1 )
+    {
+      if ( tempID  == -1 ) cdoWarning("Temperature (code 130) not found!");
+      if ( sqID    == -1 ) cdoWarning("Specific humidity (code 133) not found!");
+      if ( omegaID == -1 ) cdoWarning("Vertical velocity (code 135) not found!");
+      cdoAbort("Parameter not found!");
+    }
+
+  /* Get missing values */
+  missval_t   = vlistInqVarMissval(vlistID1, tempID);
+  missval_sq  = vlistInqVarMissval(vlistID1, sqID);
+  missval_wap = vlistInqVarMissval(vlistID1, omegaID);
+  missval_out = missval_wap;
+
+  gridID  = vlistInqVarGrid(vlistID1, omegaID);
+  zaxisID = vlistInqVarZaxis(vlistID1, omegaID);
+
+  if ( psID == -1 && zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+    cdoAbort("Surface pressure (code 134) not found!");
+
+  gridsize = gridInqSize(gridID);
+  nlevel = zaxisInqSize(zaxisID);
+  level  = (double *) malloc(nlevel*sizeof(double));
+  zaxisInqLevels(zaxisID, level);
+
+  temp    = (double *) malloc(gridsize*nlevel*sizeof(double));
+  sq      = (double *) malloc(gridsize*nlevel*sizeof(double));
+  omega   = (double *) malloc(gridsize*nlevel*sizeof(double));
+  wms     = (double *) malloc(gridsize*nlevel*sizeof(double));
+  fpress  = (double *) malloc(gridsize*nlevel*sizeof(double));
+
+
+  if ( zaxisInqType(zaxisID) == ZAXIS_PRESSURE )
+    {
+      for ( levelID = 0; levelID < nlevel; ++levelID )
+	{
+	  offset = levelID*gridsize;
+	  for ( i = 0; i < gridsize; ++i )
+	    fpress[offset+i] = level[levelID];
+	}
+    }
+  else if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+    {
+      ps_prog = (double *) malloc(gridsize*sizeof(double));
+      hpress  = (double *) malloc(gridsize*(nlevel+1)*sizeof(double));
+  
+      nvct = zaxisInqVctSize(zaxisID);
+      if ( nlevel == (nvct/2 - 1) )
+	{
+	  vct = (double *) malloc(nvct*sizeof(double));
+	  zaxisInqVct(zaxisID, vct);
+	}
+      else
+	cdoAbort("Unsupported vertical coordinate table format!");
+    }
+  else
+    cdoAbort("Unsupported Z-Axis type!");
+
+
+  vlistClearFlag(vlistID1);
+  for ( levelID = 0; levelID < nlevel; ++levelID )
+    vlistDefFlag(vlistID1, omegaID, levelID, TRUE);
+
+  vlistID2 = vlistCreate();
+  vlistCopyFlag(vlistID2, vlistID1);
+  vlistDefVarCode(vlistID2, 0, 40);
+  vlistDefVarName(vlistID2, 0, "W");
+  vlistDefVarLongname(vlistID2, 0, "Vertical velocity");
+  vlistDefVarUnits(vlistID2, 0, "m/s");
+  vlistDefVarMissval(vlistID2, 0, missval_out);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+     
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  offset = levelID*gridsize;
+
+	  if      ( varID == tempID )
+	    streamReadRecord(streamID1, temp+offset, &nmiss);
+	  else if ( varID == sqID )
+	    streamReadRecord(streamID1, sq+offset, &nmiss);
+	  else if ( varID == omegaID )
+	    streamReadRecord(streamID1, omega+offset, &nmiss);
+	  else if ( varID == psID && zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+	    streamReadRecord(streamID1, ps_prog, &nmiss);
+	}
+
+      if ( zaxisInqType(zaxisID) == ZAXIS_HYBRID )
+	presh(fpress, hpress, vct, ps_prog, nlevel, gridsize);
+
+      for ( levelID = 0; levelID < nlevel; ++levelID )
+	{
+	  offset = levelID*gridsize;
+
+	  for ( i = 0; i < gridsize; ++i )
+	    {
+	      if ( DBL_IS_EQUAL(temp[offset+i],missval_t)    || 
+		   DBL_IS_EQUAL(omega[offset+i],missval_wap) ||
+		   DBL_IS_EQUAL(sq[offset+i],missval_sq) )
+		{
+		  wms[offset+i] = missval_out;
+		}
+	      else
+		{
+	          /* Virtuelle Temperatur bringt die Feuchteabhaengigkeit hinein */
+	          tv = temp[offset+i] * (1. + 0.608*sq[offset+i]);
+
+	          /*
+		    Die Dichte erhaelt man nun mit der Gasgleichung rho=p/(R*tv)
+		    Level in Pa!
+	          */
+	          rho = fpress[offset+i] / (R*tv);
+
+	          /*
+		    Nun daraus die Vertikalgeschwindigkeit im m/s, indem man die
+		    Vertikalgeschwindigkeit in Pa/s durch die Erdbeschleunigung
+		    und die Dichte teilt
+	          */
+	          wms[offset+i] = omega[offset+i]/(G*rho);
+	        }
+            }
+	}
+
+      for ( levelID = 0; levelID < nlevel; ++levelID )
+	{
+	  nmiss_out = 0;
+	  for ( i = 0; i < gridsize; i++ )
+            if ( DBL_IS_EQUAL(wms[offset+i],missval_out) )
+	      nmiss_out++;
+
+	  offset = levelID*gridsize;
+
+	  streamDefRecord(streamID2, 0, levelID);
+	  streamWriteRecord(streamID2, wms+offset, nmiss_out);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+ 
+  vlistDestroy(vlistID2);
+
+  free(temp);
+  free(sq);
+  free(omega);
+  free(wms);
+  free(fpress);
+
+  if ( ps_prog ) free(ps_prog);
+  if ( hpress )  free(hpress);
+  if ( vct ) free(vct);
+
+  free(level);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Wct.c b/src/Wct.c
new file mode 100755
index 0000000..18376c8
--- /dev/null
+++ b/src/Wct.c
@@ -0,0 +1,187 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Wct     wct          Compute the windchill temperature (degree C)
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+static const char WCT_NAME[]     = "wind_chill_temperature";
+static const char WCT_LONGNAME[] = "Windchill temperature describes the fact that low temperatures are felt to be even lower in case of wind. It is based on the rate of heat loss from exposed skin caused by wind and cold. It is calculated according to the empirical formula: 33 + (T - 33) * (0.478 + 0.237 * (SQRT(ff*3.6) - 0.0124 * ff * 3.6)) with T  = air temperature in degree Celsius, ff = 10 m wind speed in m/s. Windchill temperature is only defined for temperatures at or below 33 degr [...]
+static const char WCT_UNITS[]    = "Celsius";
+
+static const int FIRST_VAR = 0;
+
+
+static double windchillTemperature(double t, double ff, double missval)
+{
+  static const double tmax = 33.0; 
+  static const double vmin = 1.39; /* minimum wind speed (m/s) */
+  
+  return ff < vmin || t > tmax ? missval : tmax + (t - tmax) * (0.478 + 0.237 * (sqrt(ff * 3.6) - 0.0124 * ff * 3.6));
+}
+
+
+static void farexpr(field_t *field1, field_t field2, double (*expression)(double, double, double))
+{
+  int   i, len;
+  const int     grid1    = field1->grid;
+  const int     nmiss1   = field1->nmiss;
+  const double  missval1 = field1->missval;
+  double       *array1   = field1->ptr;
+  const int     grid2    = field2.grid;
+  const int     nmiss2   = field2.nmiss;
+  const double  missval2 = field2.missval;
+  const double *array2   = field2.ptr;
+
+  len = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+        if ( DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) )  
+	  array1[i] = missval1;
+	else
+	  array1[i] = expression(array1[i], array2[i], missval1);
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ )
+        array1[i] = expression(array1[i], array2[i], missval1);  
+    }
+
+  field1->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+}
+
+   
+void *Wct(void *argument)
+{
+  int streamID1, streamID2, streamID3;
+  int gridsize;
+  int nrecs, nrecs2, recID;
+  int tsID;
+  int gridID, zaxisID;
+  int varID1, varID2, varID3;
+  int levelID1, levelID2;
+  int vlistID1, vlistID2, vlistID3;
+  int taxisID1, taxisID2, taxisID3;
+  field_t field1, field2;
+
+  cdoInitialize(argument);
+  cdoOperatorAdd("wct", 0, 0, NULL);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+
+  vlistCompare(vlistID1, vlistID2, CMP_DIM);
+  
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  if ( cdoVerbose )
+    cdoPrint("Number of timesteps: file1 %d, file2 %d", vlistNtsteps(vlistID1), vlistNtsteps(vlistID2));
+
+  vlistID3 = vlistCreate();
+  gridID   = vlistInqVarGrid(vlistID1, FIRST_VAR);
+  zaxisID  = vlistInqVarZaxis(vlistID1, FIRST_VAR);
+  varID3   = vlistDefVar(vlistID3, gridID, zaxisID, TSTEP_INSTANT);
+
+  taxisID3 = taxisCreate(TAXIS_RELATIVE);
+  taxisDefTunit(taxisID3, TUNIT_MINUTE);
+  taxisDefCalendar(taxisID3, CALENDAR_STANDARD);
+  taxisDefRdate(taxisID3, 19550101);
+  taxisDefRtime(taxisID3, 0);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  vlistDefVarName(vlistID3, varID3, WCT_NAME);
+  vlistDefVarLongname(vlistID3, varID3, WCT_LONGNAME);
+  vlistDefVarUnits(vlistID3, varID3, WCT_UNITS);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      nrecs2 = streamInqTimestep(streamID2, tsID);
+      if ( nrecs2 == 0 )
+        cdoAbort("Input streams have different number of timesteps!");
+
+      taxisCopyTimestep(taxisID3, taxisID1);
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID1, &levelID1);
+	  streamReadRecord(streamID1, field1.ptr, &field1.nmiss);
+
+	  streamInqRecord(streamID2, &varID2, &levelID2);
+	  streamReadRecord(streamID2, field2.ptr, &field2.nmiss);
+	  
+	  if ( varID1 != varID2 || levelID1 != levelID2 )
+	    cdoAbort("Input streams have different structure!");
+	    
+          if ( varID1 != FIRST_VAR )
+            continue;
+            
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID1);
+	  field1.missval = vlistInqVarMissval(vlistID1, varID1);
+
+	  field2.grid    = vlistInqVarGrid(vlistID2, varID2);
+	  field2.missval = vlistInqVarMissval(vlistID2, varID2);
+
+	  farexpr(&field1, field2, windchillTemperature);
+	  
+	  streamDefRecord(streamID3, varID3, levelID1);
+	  streamWriteRecord(streamID3, field1.ptr, field1.nmiss);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( field1.ptr ) free(field1.ptr);
+  if ( field2.ptr ) free(field2.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Wind.c b/src/Wind.c
new file mode 100644
index 0000000..66f9892
--- /dev/null
+++ b/src/Wind.c
@@ -0,0 +1,425 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Wind       uv2dv           U and V wind to divergence and vorticity
+      Wind       dv2uv           Divergence and vorticity to U and V wind
+      Wind       dv2ps           Divergence and vorticity to
+                                 velocity potential and stream function
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "specspace.h"
+#include "list.h"
+
+
+void *Wind(void *argument)
+{
+  int UV2DV, UV2DVL, DV2UV, DV2UVL, DV2PS;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs, nvars;
+  int tsID, recID, varID, levelID;
+  int nlev = 0, gridsize;
+  int index, ngrids;
+  int vlistID1, vlistID2;
+  int gridIDsp = -1, gridIDgp = -1;
+  int gridID1 = -1, gridID2 = -1;
+  int gridID;
+  int nmiss;
+  int lcopy = FALSE;
+  int taxisID1, taxisID2;
+  int nlon, nlat, ntr = -1;
+  int code, param;
+  int pnum, pcat, pdis;
+  int varID1 = -1, varID2 = -1;
+  int offset;
+  SPTRANS *sptrans = NULL;
+  DVTRANS *dvtrans = NULL;
+  char varname[CDI_MAX_NAME];
+  double *array1 = NULL;
+  double *ivar1 = NULL, *ivar2 = NULL, *ovar1 = NULL, *ovar2 = NULL;
+
+  cdoInitialize(argument);
+
+  UV2DV  = cdoOperatorAdd("uv2dv",  0, 0, NULL);
+  UV2DVL = cdoOperatorAdd("uv2dvl", 0, 0, NULL);
+  DV2UV  = cdoOperatorAdd("dv2uv",  0, 0, NULL);
+  DV2UVL = cdoOperatorAdd("dv2uvl", 0, 0, NULL);
+  DV2PS  = cdoOperatorAdd("dv2ps",  0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  if ( UNCHANGED_RECORD ) lcopy = TRUE;
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  /* find variables */
+  nvars = vlistNvars(vlistID2);
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      param = vlistInqVarParam(vlistID2, varID);
+      cdiDecodeParam(param, &pnum, &pcat, &pdis);
+      code = pnum;
+      if ( operatorID == UV2DV || operatorID == UV2DVL )
+	{
+	  /* search for u and v wind */
+	  if ( code <= 0 )
+	    {
+	      vlistInqVarName(vlistID1, varID, varname);
+	      strtolower(varname);
+
+	      if      ( strcmp(varname, "u") == 0 ) code = 131;
+	      else if ( strcmp(varname, "v") == 0 ) code = 132;
+	    }
+
+	  if      ( code == 131 ) varID1 = varID;
+	  else if ( code == 132 ) varID2 = varID;
+	}
+      else if ( operatorID == DV2UV || operatorID == DV2UVL || operatorID == DV2PS )
+	{
+	  /* search for divergence and vorticity */
+	  if ( pdis != 255 ) // GRIB2
+	    {
+	      vlistInqVarName(vlistID1, varID, varname);
+	      strtolower(varname);
+
+	      if      ( strcmp(varname, "d")  == 0 ) code = 155;
+	      else if ( strcmp(varname, "vo") == 0 ) code = 138;
+	    }
+	  else if ( code <= 0 )
+	    {
+	      vlistInqVarName(vlistID1, varID, varname);
+	      strtolower(varname);
+
+	      if      ( strcmp(varname, "sd")  == 0 ) code = 155;
+	      else if ( strcmp(varname, "svo") == 0 ) code = 138;
+	    }
+
+	  if      ( code == 155 ) varID1 = varID;
+	  else if ( code == 138 ) varID2 = varID;
+	}
+      else
+	cdoAbort("Unexpected operatorID %d", operatorID);
+    }
+
+  ngrids = vlistNgrids(vlistID1);
+
+  /* find first spectral grid */
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID = vlistGrid(vlistID1, index);
+      if ( gridInqType(gridID) == GRID_SPECTRAL )
+	{
+	  gridIDsp = gridID;
+	  break;
+	}
+    }
+
+  /* find first gaussian grid */
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID = vlistGrid(vlistID1, index);
+      if ( gridInqType(gridID) == GRID_GAUSSIAN )
+	{
+	  gridIDgp = gridID;
+	  break;
+	}
+    }
+
+  /* define output grid */
+  if ( operatorID == UV2DV || operatorID == UV2DVL )
+    {
+      if ( varID1 == -1 ) cdoWarning("U-wind not found!");
+      if ( varID2 == -1 ) cdoWarning("V-wind not found!");
+
+      if ( varID1 != -1 && varID2 != -1 )
+	{
+	  gridID1 = vlistInqVarGrid(vlistID1, varID1);
+
+	  if ( gridInqType(gridID1) != GRID_GAUSSIAN )
+	    cdoAbort("U-wind is not on gaussian grid!");
+
+	  if ( gridID1 != vlistInqVarGrid(vlistID1, varID2) )
+	    cdoAbort("U and V wind must have the same grid represention!");
+
+	  if ( gridID1 != -1 )
+	    {
+	      if ( operatorID == UV2DV )
+		ntr = nlat2ntr(gridInqYsize(gridID1));
+	      else
+		ntr = nlat2ntr_linear(gridInqYsize(gridID1));
+
+	      if ( gridIDsp != -1 )
+		if ( ntr != gridInqTrunc(gridIDsp) ) gridIDsp = -1;
+
+	      if ( gridIDsp == -1 )
+		{
+		  gridIDsp = gridCreate(GRID_SPECTRAL, (ntr+1)*(ntr+2));
+		  gridDefTrunc(gridIDsp, ntr);
+		  gridDefComplexPacking(gridIDsp, 1);
+		}
+	    }
+
+	  if ( gridIDsp == -1 && gridInqType(vlistGrid(vlistID1, 0)) == GRID_GAUSSIAN_REDUCED )
+	    cdoAbort("Gaussian reduced grid found. Use option -R to convert it to a regular grid!");
+
+	  if ( gridIDsp == -1 ) cdoAbort("No Gaussian grid data found!");
+
+	  gridID2 = gridIDsp;
+
+	  vlistChangeVarGrid(vlistID2, varID1, gridID2);
+	  vlistChangeVarGrid(vlistID2, varID2, gridID2);
+	  vlistDefVarParam(vlistID2, varID1, cdiEncodeParam(155, 128, 255));
+	  vlistDefVarParam(vlistID2, varID2, cdiEncodeParam(138, 128, 255));
+	  vlistDefVarName(vlistID2, varID1, "sd");
+	  vlistDefVarName(vlistID2, varID2, "svo");
+	  vlistDefVarLongname(vlistID2, varID1, "divergence");
+	  vlistDefVarLongname(vlistID2, varID2, "vorticity");
+	  vlistDefVarUnits(vlistID2, varID1, "1/s");
+	  vlistDefVarUnits(vlistID2, varID2, "1/s");
+
+	  nlon = gridInqXsize(gridID1);
+	  nlat = gridInqYsize(gridID1);
+	  ntr  = gridInqTrunc(gridID2);
+
+	  sptrans = sptrans_new(nlon, nlat, ntr, 1);
+	}
+    }
+  else if ( operatorID == DV2UV || operatorID == DV2UVL )
+    {   
+      if ( varID1 == -1 ) cdoWarning("Divergence not found!");
+      if ( varID2 == -1 ) cdoWarning("Vorticity not found!");
+
+      if ( varID1 != -1 && varID2 != -1 )
+	{
+	  gridID1 = vlistInqVarGrid(vlistID1, varID2);
+
+	  if ( gridInqType(gridID1) != GRID_SPECTRAL )
+	    cdoAbort("Vorticity is not on spectral grid!");
+
+	  if ( gridID1 != vlistInqVarGrid(vlistID1, varID1) )
+	    cdoAbort("Divergence and vorticity must have the same grid represention!");
+
+	  if ( gridIDgp != -1 )
+	    {
+	      if ( operatorID == DV2UV )
+		ntr = nlat2ntr(gridInqYsize(gridIDgp));
+	      else
+		ntr = nlat2ntr_linear(gridInqYsize(gridIDgp));
+	      
+	      if ( gridInqTrunc(gridIDsp) != ntr ) gridIDgp = -1;
+	    }
+
+	  if ( gridIDgp == -1 )
+	    {
+	      char gridname[20];
+
+	      if ( operatorID == DV2UV )
+		sprintf(gridname, "t%dgrid", gridInqTrunc(gridIDsp));
+	      else
+		sprintf(gridname, "tl%dgrid", gridInqTrunc(gridIDsp));
+	  
+	      gridIDgp = gridFromName(gridname);
+	    }
+
+	  gridID2 = gridIDgp;
+
+	  vlistChangeVarGrid(vlistID2, varID1, gridID2);
+	  vlistChangeVarGrid(vlistID2, varID2, gridID2);
+	  vlistDefVarParam(vlistID2, varID1, cdiEncodeParam(131, 128, 255));
+	  vlistDefVarParam(vlistID2, varID2, cdiEncodeParam(132, 128, 255));
+	  vlistDefVarName(vlistID2, varID1, "u");
+	  vlistDefVarName(vlistID2, varID2, "v");
+	  vlistDefVarLongname(vlistID2, varID1, "u-velocity");
+	  vlistDefVarLongname(vlistID2, varID2, "v-velocity");
+	  vlistDefVarUnits(vlistID2, varID1, "m/s");
+	  vlistDefVarUnits(vlistID2, varID2, "m/s");
+
+	  ntr  = gridInqTrunc(gridID1);
+	  nlon = gridInqXsize(gridID2);
+	  nlat = gridInqYsize(gridID2);
+      
+	  sptrans = sptrans_new(nlon, nlat, ntr, 0);
+	  dvtrans = dvtrans_new(ntr);
+	}
+    }
+  else if ( operatorID == DV2PS )
+    {   
+      if ( varID1 == -1 ) cdoWarning("Divergence not found!");
+      if ( varID2 == -1 ) cdoWarning("Vorticity not found!");
+
+      if ( varID1 != -1 && varID2 != -1 )
+	{
+	  gridID1 = vlistInqVarGrid(vlistID1, varID2);
+
+	  if ( gridInqType(gridID1) != GRID_SPECTRAL )
+	    cdoAbort("Vorticity is not on spectral grid!");
+
+	  if ( gridID1 != vlistInqVarGrid(vlistID1, varID1) )
+	    cdoAbort("Divergence and vorticity must have the same grid represention!");
+
+	  vlistDefVarParam(vlistID2, varID1, cdiEncodeParam(149, 128, 255));
+	  vlistDefVarParam(vlistID2, varID2, cdiEncodeParam(148, 128, 255));
+	  vlistDefVarName(vlistID2, varID1, "velopot");
+	  vlistDefVarName(vlistID2, varID2, "stream");
+	  vlistDefVarLongname(vlistID2, varID1, "velocity potential");
+	  vlistDefVarLongname(vlistID2, varID2, "streamfunction");
+	  vlistDefVarUnits(vlistID2, varID1, "m^2/s");
+	  vlistDefVarUnits(vlistID2, varID2, "m^2/s");
+
+	  ntr  = gridInqTrunc(gridID1);
+	  gridID2 = gridID1;
+	}
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array1 = (double *) malloc(gridsize*sizeof(double));
+
+  if ( varID1 != -1 && varID2 != -1 )
+    {
+      nlev     = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID1));
+
+      gridsize = gridInqSize(gridID1);
+      ivar1 = (double *) malloc(nlev*gridsize*sizeof(double));
+      ivar2 = (double *) malloc(nlev*gridsize*sizeof(double));
+  
+      gridsize = gridInqSize(gridID2);
+      ovar1 = (double *) malloc(nlev*gridsize*sizeof(double));
+      ovar2 = (double *) malloc(nlev*gridsize*sizeof(double));
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( (varID1 != -1 && varID2 != -1) && (varID == varID1 || varID == varID2) )
+	    {
+	      streamReadRecord(streamID1, array1, &nmiss);
+	      if ( nmiss ) cdoAbort("Missing values unsupported for spectral data!");
+
+	      gridsize = gridInqSize(gridID1);
+	      offset = gridsize*levelID;
+
+	      if      ( varID == varID1 )
+		memcpy(ivar1+offset, array1, gridsize*sizeof(double));
+	      else if ( varID == varID2 )
+	        memcpy(ivar2+offset, array1, gridsize*sizeof(double));
+	    }   
+	  else
+	    {
+	      streamDefRecord(streamID2, varID, levelID);
+	      if ( lcopy )
+		{
+		  streamCopyRecord(streamID2, streamID1);
+		}
+	      else
+		{
+		  streamReadRecord(streamID1, array1, &nmiss);
+		  streamWriteRecord(streamID2, array1, nmiss);
+		}
+	    }
+	}
+
+      if ( varID1 != -1 && varID2 != -1 )
+	{
+	  if ( operatorID == UV2DV || operatorID == UV2DVL )
+	    trans_uv2dv(sptrans, nlev, gridID1, ivar1, ivar2, gridID2, ovar1, ovar2);
+	  else if ( operatorID == DV2UV || operatorID == DV2UVL )
+	    trans_dv2uv(sptrans, dvtrans, nlev, gridID1, ivar1, ivar2, gridID2, ovar1, ovar2);
+	  else if ( operatorID == DV2PS )
+	    {
+	      dv2ps(ivar1, ovar1, nlev, ntr);
+	      dv2ps(ivar2, ovar2, nlev, ntr);
+	    }
+
+	  gridsize = gridInqSize(gridID2);
+	  if ( operatorID == UV2DV || operatorID == UV2DVL || operatorID == DV2PS )
+	    {
+	      for ( levelID = 0; levelID < nlev; levelID++ )
+		{
+		  offset = gridsize*levelID;
+		  streamDefRecord(streamID2, varID2, levelID);
+		  streamWriteRecord(streamID2, ovar2+offset, 0);
+		}
+	      for ( levelID = 0; levelID < nlev; levelID++ )
+		{
+		  offset = gridsize*levelID;
+		  streamDefRecord(streamID2, varID1, levelID);
+		  streamWriteRecord(streamID2, ovar1+offset, 0);
+		}
+	    }
+	  else if ( operatorID == DV2UV || operatorID == DV2UVL )
+	    {
+	      for ( levelID = 0; levelID < nlev; levelID++ )
+		{
+		  offset = gridsize*levelID;
+		  streamDefRecord(streamID2, varID1, levelID);
+		  streamWriteRecord(streamID2, ovar1+offset, 0);
+		}
+	      for ( levelID = 0; levelID < nlev; levelID++ )
+		{
+		  offset = gridsize*levelID;
+		  streamDefRecord(streamID2, varID2, levelID);
+		  streamWriteRecord(streamID2, ovar2+offset, 0);
+		}
+	    }
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array1 ) free(array1);
+
+  if ( ivar1 ) free(ivar1);
+  if ( ivar2 ) free(ivar2);
+  if ( ovar1 ) free(ovar1);
+  if ( ovar2 ) free(ovar2);
+
+  sptrans_delete(sptrans);
+  if ( dvtrans ) dvtrans_delete(dvtrans);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Writegrid.c b/src/Writegrid.c
new file mode 100644
index 0000000..e37ae5c
--- /dev/null
+++ b/src/Writegrid.c
@@ -0,0 +1,78 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      writegrid Write grid
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "grid.h"
+
+
+void *Writegrid(void *argument)
+{
+  int streamID;
+  int vlistID;
+  int gridID;
+  long gridsize, i;
+  int gridtype;
+  int *mask = NULL;
+
+  cdoInitialize(argument);
+
+  streamID = streamOpenRead(cdoStreamName(0));
+
+  vlistID = streamInqVlist(streamID);
+  gridID  = vlistGrid(vlistID, 0);
+
+  gridtype = gridInqType(gridID);
+  gridsize = gridInqSize(gridID);
+
+  if ( gridtype == GRID_GME ) gridID = gridToUnstructured(gridID, 1);
+
+  if ( gridtype != GRID_CURVILINEAR && gridtype != GRID_UNSTRUCTURED )
+    gridID = gridToCurvilinear(gridID, 1);
+
+  if ( gridInqXbounds(gridID, NULL) == 0 || gridInqYbounds(gridID, NULL) == 0 )
+    cdoAbort("Grid corner missing!");
+
+  mask = (int *) malloc(gridsize*sizeof(int));
+
+  if ( gridInqMask(gridID, NULL) )
+    {
+      gridInqMask(gridID, mask);
+    }
+  else
+    {
+      for ( i = 0; i < gridsize; i++ ) mask[i] = 1;
+    }
+      
+  writeNCgrid(cdoStreamName(1), gridID, mask);
+
+  streamClose(streamID);
+
+  if ( mask ) free(mask);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Writerandom.c b/src/Writerandom.c
new file mode 100644
index 0000000..58c9283
--- /dev/null
+++ b/src/Writerandom.c
@@ -0,0 +1,134 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Writerandom writerandom
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+void *Writerandom(void *argument)
+{
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridsize;
+  int recID, nrecs;
+  int tsID, varID, levelID;
+  int index, rindex, ipos;
+  double **recdata = NULL;
+  int *recvarID, *reclevelID, *recnmiss, *recindex;
+  int taxisID1, taxisID2;
+
+
+  cdoInitialize(argument);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      recdata    = (double **) malloc(nrecs*sizeof(double*));
+      recvarID   = (int *) malloc(nrecs*sizeof(int));
+      reclevelID = (int *) malloc(nrecs*sizeof(int));
+      recnmiss   = (int *) malloc(nrecs*sizeof(int));
+      recindex   = (int *) malloc(nrecs*sizeof(int));
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	  recvarID[recID] = varID;
+	  reclevelID[recID] = levelID;
+	  recdata[recID] = (double *) malloc(gridsize*sizeof(double));
+	  streamReadRecord(streamID1, recdata[recID], &recnmiss[recID]);
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ ) recindex[recID] = -1;
+
+      for ( rindex = nrecs-1; rindex >= 0; rindex-- )
+	{
+	  index = (int) (rindex*1.0*rand()/(RAND_MAX+1.0));
+	  /*	printf("rindex %d %d\n", rindex, index); */
+	  ipos = -1;
+	  for ( recID = 0; recID < nrecs; recID++ )
+	    {
+	      if ( recindex[recID] == -1 ) ipos++;
+	      if ( recindex[recID] == -1 && ipos == index )
+		{
+		  recindex[recID] = rindex;
+		  break;
+		}
+	    }
+	}
+
+      /*
+      for ( recID = 0; recID < nrecs; recID++ )
+	printf("recID %d %d\n", recID, recindex[recID]);
+      */
+      for ( recID = 0; recID < nrecs; recID++ )
+	if ( recindex[recID] == -1 )
+	  cdoAbort("Internal problem! Random initialize.");
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  rindex   = recindex[recID];
+	  varID    = recvarID[rindex];
+	  levelID  = reclevelID[rindex];
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, recdata[rindex], recnmiss[rindex]);
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ ) free(recdata[recID]);
+
+      free(recdata);
+      free(recvarID);
+      free(reclevelID);
+      free(recnmiss);
+      free(recindex);
+
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/YAR.c b/src/YAR.c
new file mode 100644
index 0000000..598106d
--- /dev/null
+++ b/src/YAR.c
@@ -0,0 +1,557 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "interpol.h"
+
+#if defined (HAVE_LIBYAC)
+#include "points.h"
+#include "grid_reg2d.h"
+#include "event.h"
+#include "search.h"
+#include "clipping.h"
+#endif
+
+int lout = 0;
+
+static
+void gen_xbounds(int nx, double *xvals, double *xbounds)
+{
+  int i;
+
+  for ( i = 0; i < nx-1; i++ )
+    {
+      xbounds[i+1]   = 0.5*(xvals[i] + xvals[i+1]);
+    }
+
+  xbounds[0]  = 2*xvals[0] - xbounds[1];
+  xbounds[nx] = 2*xvals[nx-1] - xbounds[nx-1];
+}
+
+static
+void gen_ybounds(int ny, double *yvals, double *ybounds)
+{
+  int i;
+
+  for ( i = 0; i < ny-1; i++ )
+    {
+      ybounds[i+1]   = 0.5*(yvals[i] + yvals[i+1]);
+    }
+
+  ybounds[0]  = 2*yvals[0] - ybounds[1];
+  ybounds[ny] = 2*yvals[ny-1] - ybounds[ny-1];
+
+  if ( yvals[0] > yvals[ny-1] )
+    {
+      if ( ybounds[0]  >  88 ) ybounds[0]  =  90;
+      if ( ybounds[ny] < -88 ) ybounds[ny] = -90;
+    }
+  else
+    {
+      if ( ybounds[0]  < -88 ) ybounds[0]  = -90;
+      if ( ybounds[ny] >  88 ) ybounds[ny] =  90;
+    }
+}
+
+
+void set_source_data(double * source_data, double init_value,
+                     unsigned size_x, unsigned size_y) {
+
+   for (unsigned i = 0; i < size_x; ++i)
+      for (unsigned j = 0; j < size_y; ++j)
+         source_data[i + j * size_x] = init_value;
+}
+
+
+int grid_search( int *restrict src_add, double *restrict src_lats, 
+		double *restrict src_lons, double plat, double plon, const int *restrict src_grid_dims)
+{
+  return 0;
+}
+
+void testint_p(field_t *field1, field_t *field2)
+{
+  int nlonIn, nlatIn;
+  int nlonOut, nlatOut;
+  int ilat, ilon;
+  int gridIDin, gridIDout;
+  int i, nmiss;
+  int gridsize1, gridsize2;
+  double *lonIn, *latIn;
+  double *lonOut, *latOut;
+  double **fieldIn;
+  double **field;
+  double *array = NULL;
+  double *arrayIn, *arrayOut;
+  double missval;
+  int testit = 1;
+  /* static int index = 0; */
+
+  gridIDin  = field1->grid;
+  gridIDout = field2->grid;
+  arrayIn   = field1->ptr;
+  arrayOut  = field2->ptr;
+  missval   = field1->missval;
+
+  if ( ! (gridInqXvals(gridIDin, NULL) && gridInqYvals(gridIDin, NULL)) )
+    cdoAbort("Source grid has no values");
+
+  nlonIn = gridInqXsize(gridIDin);
+  nlatIn = gridInqYsize(gridIDin);
+  gridsize1 = gridInqSize(gridIDin);
+  lonIn = (double *) malloc(nlonIn*sizeof(double));
+  latIn = (double *) malloc(nlatIn*sizeof(double));
+  gridInqXvals(gridIDin, lonIn);
+  gridInqYvals(gridIDin, latIn);
+
+  if ( ! (gridInqXvals(gridIDout, NULL) && gridInqYvals(gridIDout, NULL)) )
+    cdoAbort("Target grid has no values");
+
+  nlonOut = gridInqXsize(gridIDout);
+  nlatOut = gridInqYsize(gridIDout);
+  gridsize2 = gridInqSize(gridIDout);
+  lonOut = (double *) malloc(nlonOut*sizeof(double));
+  latOut = (double *) malloc(nlatOut*sizeof(double));
+  gridInqXvals(gridIDout, lonOut);
+  gridInqYvals(gridIDout, latOut);
+
+#if defined (HAVE_LIBYAC)
+
+  //--------------------------------------------
+  // define a grid
+  //--------------------------------------------
+  unsigned num_source_cells[2];
+  unsigned num_target_cells[2];
+  num_source_cells[0] = nlonIn;
+  num_source_cells[1] = nlatIn;
+  num_target_cells[0] = nlonOut;
+  num_target_cells[1] = nlatOut;
+
+  unsigned cyclic[2] = {0,0};
+  struct grid source_grid, target_grid;
+
+  init_reg2d_grid(&source_grid, NULL, NULL, num_source_cells, cyclic);
+  init_reg2d_grid(&target_grid, NULL, NULL, num_target_cells, cyclic);
+
+  struct points source_points, target_points;
+
+  //--------------------------------------------
+  // define points
+  //--------------------------------------------
+  init_points(&source_points, &source_grid, CELL, lonIn, latIn);
+  init_points(&target_points, &target_grid, CELL, lonOut, latOut);
+
+  //--------------------------------------------
+  // initialise interpolation
+  //--------------------------------------------
+
+  struct dep_list tgt_to_src_cell;
+  unsigned search_id;
+  //struct interpolation interpolation;
+
+  // seg fault:  printf("src num_grid_corners %d\n", get_num_grid_corners(*get_point_grid(&source_grid)));
+  // seg fault:  printf("tgt num_grid_corners %d\n", get_num_grid_corners(*get_point_grid(&target_grid)));
+  printf("src num_grid_corners %d\n", get_num_grid_corners(*get_point_grid(&source_points)));
+  printf("tgt num_grid_corners %d\n", get_num_grid_corners(*get_point_grid(&target_points)));
+
+  search_id = search_init(get_point_grid(&source_points));
+ 
+  do_point_search_p(*get_point_grid(&target_points), search_id, &tgt_to_src_cell);
+
+  printf("total_num_dependencies: %d\n", get_total_num_dependencies(tgt_to_src_cell));
+
+  unsigned const * curr_src_corners;
+  for ( int i = 0; i < 10; ++i )
+    {
+      printf("num_deps_per_element %d %d\n", i, tgt_to_src_cell.num_deps_per_element[i]);
+      curr_src_corners = get_dependencies_of_element(tgt_to_src_cell,i);
+      for ( int k = 0; k < tgt_to_src_cell.num_deps_per_element[i]; ++k )
+	printf("  curr_src_corners: %d %d\n", k, curr_src_corners[k]);
+    }
+
+  for ( int i = 0; i < 10; ++i )
+    {
+      double lon = lonOut[i];
+      double lat = latOut[i];
+      printf("num_deps_per_element %d %d\n", i, tgt_to_src_cell.num_deps_per_element[i]);
+      curr_src_corners = get_dependencies_of_element(tgt_to_src_cell,i);
+      for ( int k = 0; k < tgt_to_src_cell.num_deps_per_element[i]; ++k )
+	printf("  curr_src_corners: %d %d\n", k, curr_src_corners[k]);
+    }
+
+  for ( int i = 0; i < gridsize2; ++i )
+    {
+      double lon = lonOut[i];
+      double lat = latOut[i];
+      curr_src_corners = get_dependencies_of_element(tgt_to_src_cell,i);
+      for ( int k = 0; k < tgt_to_src_cell.num_deps_per_element[i]; ++k )
+	{
+	}
+    }
+
+  /*
+  for ( int j = 0; j < 10; ++j )
+    {
+      for ( int i = 0; i < 10; ++i )
+	printf("%g ", arrayOut[j*10+i]);
+      printf("\n");
+    }
+  */
+  // free (search_result);
+  // if (array) free(array);
+  //free(lonIn);
+  //free(latIn);
+  //free(lonOut);
+  //free(latOut);
+  //free(fieldIn);
+#endif
+}
+
+
+void testint_c(field_t *field1, field_t *field2)
+{
+  int nlonIn, nlatIn;
+  int nlonOut, nlatOut;
+  int ilat, ilon;
+  int gridIDin, gridIDout;
+  int i, nmiss;
+  int gridsize1, gridsize2;
+  double *lonIn, *latIn;
+  double *lonOut, *latOut;
+  double *xlonIn, *xlatIn;
+  double *xlonOut, *xlatOut;
+  double **fieldIn;
+  double **field;
+  double *array = NULL;
+  double *arrayIn, *arrayOut;
+  double missval;
+  double dxIn, dxOut;
+  /* static int index = 0; */
+
+  gridIDin  = field1->grid;
+  gridIDout = field2->grid;
+  arrayIn   = field1->ptr;
+  arrayOut  = field2->ptr;
+  missval   = field1->missval;
+
+  if ( ! (gridInqXvals(gridIDin, NULL) && gridInqYvals(gridIDin, NULL)) )
+    cdoAbort("Source grid has no values");
+
+  nlonIn = gridInqXsize(gridIDin);
+  nlatIn = gridInqYsize(gridIDin);
+  gridsize1 = gridInqSize(gridIDin);
+  lonIn = (double *) malloc((nlonIn+1)*sizeof(double));
+  latIn = (double *) malloc((nlatIn+1)*sizeof(double));
+  gridInqXvals(gridIDin, lonIn);
+  gridInqYvals(gridIDin, latIn);
+  xlonIn = (double *) malloc((nlonIn)*sizeof(double));
+  xlatIn = (double *) malloc((nlatIn)*sizeof(double));
+  gridInqXvals(gridIDin, xlonIn);
+  gridInqYvals(gridIDin, xlatIn);
+  dxIn = lonIn[1] - lonIn[0];
+  for ( int i = 0; i < nlonIn; ++i ) lonIn[i] -= dxIn/2;
+  for ( int i = 0; i < nlatIn; ++i ) latIn[i] -= dxIn/2;
+  //  latIn[nlatIn] = latIn[nlatIn-1] + dxIn;
+  latIn[nlatIn] = 90;
+
+  if ( ! (gridInqXvals(gridIDout, NULL) && gridInqYvals(gridIDout, NULL)) )
+    cdoAbort("Target grid has no values");
+
+  nlonOut = gridInqXsize(gridIDout);
+  nlatOut = gridInqYsize(gridIDout);
+  gridsize2 = gridInqSize(gridIDout);
+  lonOut = (double *) malloc((nlonOut+1)*sizeof(double));
+  latOut = (double *) malloc((nlatOut+1)*sizeof(double));
+  gridInqXvals(gridIDout, lonOut);
+  gridInqYvals(gridIDout, latOut);
+  xlonOut = (double *) malloc((nlonOut+1)*sizeof(double));
+  xlatOut = (double *) malloc((nlatOut+1)*sizeof(double));
+  gridInqXvals(gridIDout, xlonOut);
+  gridInqYvals(gridIDout, xlatOut);
+  dxOut = lonOut[1] - lonOut[0];
+  for ( int i = 0; i < nlonOut; ++i ) lonOut[i] -= dxOut/2;
+  for ( int i = 0; i < nlatOut; ++i ) latOut[i] -= dxOut/2;
+  //latOut[nlatOut] = latIn[nlatOut-1] + dxIn;
+  latOut[nlatOut] = 90;
+  printf("dxIn: %g   dxOut: %g\n", dxIn, dxOut);
+#if defined (HAVE_LIBYAC)
+
+  //--------------------------------------------
+  // define a grid
+  //--------------------------------------------
+  unsigned num_source_cells[2];
+  unsigned num_target_cells[2];
+  num_source_cells[0] = nlonIn;
+  num_source_cells[1] = nlatIn;
+  num_target_cells[0] = nlonOut;
+  num_target_cells[1] = nlatOut;
+
+  unsigned cyclic[2] = {1,0};
+  struct grid source_grid, target_grid;
+
+  init_reg2d_grid(&source_grid, lonIn, latIn, num_source_cells, cyclic);
+  init_reg2d_grid(&target_grid, lonOut, latOut, num_target_cells, cyclic);
+
+  struct points source_points, target_points;
+
+  //--------------------------------------------
+  // define points
+  //--------------------------------------------
+  // init_points(&source_points, &source_grid, CELL, lonIn, latIn);
+  // init_points(&target_points, &target_grid, CELL, lonOut, latOut);
+
+  //--------------------------------------------
+  // initialise interpolation
+  //--------------------------------------------
+
+  struct dep_list tgt_to_src_cell;
+  unsigned search_id;
+  //struct interpolation interpolation;
+
+  // printf("src num_grid_corners %d\n", get_num_grid_corners(*get_point_grid(&source_points)));
+  //printf("tgt num_grid_corners %d\n", get_num_grid_corners(*get_point_grid(&target_points)));
+
+  search_id = search_init(&source_grid);
+ 
+  do_cell_search(target_grid, search_id, &tgt_to_src_cell);
+
+
+  printf("total_num_dependencies: %d\n", get_total_num_dependencies(tgt_to_src_cell));
+  int num_elements = tgt_to_src_cell.num_elements;
+  printf("dep num elements: %d\n", tgt_to_src_cell.num_elements);
+
+  enum edge_type quad_type[] = {GREAT_CIRCLE, GREAT_CIRCLE, GREAT_CIRCLE, GREAT_CIRCLE};
+
+  double *weight;
+  weight = (double *) malloc(gridsize1*sizeof(double));
+
+  struct grid_cell *SourceCell;
+  SourceCell = malloc (gridsize1  * sizeof(*SourceCell) );
+
+  for ( int n = 0; n <  gridsize1; n++ ) {
+    SourceCell[n].num_corners   = 4;
+    SourceCell[n].edge_type     = quad_type;
+    SourceCell[n].coordinates_x = malloc ( 4 * sizeof(SourceCell[n].coordinates_x[0]) );
+    SourceCell[n].coordinates_y = malloc ( 4 * sizeof(SourceCell[n].coordinates_y[0]) );
+  }
+
+  struct grid_cell  TargetCell;
+
+  TargetCell.num_corners   = 4;
+  TargetCell.edge_type     = quad_type;
+
+  TargetCell.coordinates_x = malloc ( 4 * sizeof(*TargetCell.coordinates_x) );
+  TargetCell.coordinates_y = malloc ( 4 * sizeof(*TargetCell.coordinates_y) );
+
+  unsigned const * curr_deps;
+
+  for ( int i = 0; i < num_elements; ++i )
+    {
+      int index2 = i;
+      int ilat2 = index2/nlonOut;
+      int ilon2 = index2 - ilat2*nlonOut;
+
+      TargetCell.coordinates_x[0] =  xlonOut[ilon2]-dxOut/2;
+      TargetCell.coordinates_y[0] =  xlatOut[ilat2]-dxOut/2;
+      TargetCell.coordinates_x[1] =  xlonOut[ilon2]+dxOut/2;
+      TargetCell.coordinates_y[1] =  xlatOut[ilat2]-dxOut/2;
+      TargetCell.coordinates_x[2] =  xlonOut[ilon2]+dxOut/2;
+      TargetCell.coordinates_y[2] =  xlatOut[ilat2]+dxOut/2;
+      TargetCell.coordinates_x[3] =  xlonOut[ilon2]-dxOut/2;
+      TargetCell.coordinates_y[3] =  xlatOut[ilat2]+dxOut/2;
+
+      if ( lout )
+	{
+	  printf("target:\n");
+	  for ( int n = 0; n < 4; ++n )
+	    printf(" %g %g", TargetCell.coordinates_x[n], TargetCell.coordinates_y[n]);
+	  printf("\n");
+	}
+
+      if ( lout )
+	printf("num_deps_per_element %d %d\n", i, tgt_to_src_cell.num_deps_per_element[i]);
+      int num_deps = tgt_to_src_cell.num_deps_per_element[i];
+      if ( num_deps > 0 ) curr_deps = get_dependencies_of_element(tgt_to_src_cell, i);
+      for ( int k = 0; k < num_deps; ++k )
+	{
+	  int index1 = curr_deps[k];
+	  int ilat1 = index1/nlonIn;
+	  int ilon1 = index1 - ilat1*nlonIn;
+	  if ( lout )
+	    printf("  dep: %d %d %d %d %d %d\n", k, nlonOut, nlatOut, index1, ilon1, ilat1);
+	
+	  SourceCell[k].coordinates_x[0] =  xlonIn[ilon1]-dxIn/2;
+	  SourceCell[k].coordinates_y[0] =  xlatIn[ilat1]-dxIn/2;
+	  SourceCell[k].coordinates_x[1] =  xlonIn[ilon1]+dxIn/2;
+	  SourceCell[k].coordinates_y[1] =  xlatIn[ilat1]-dxIn/2;
+	  SourceCell[k].coordinates_x[2] =  xlonIn[ilon1]+dxIn/2;
+	  SourceCell[k].coordinates_y[2] =  xlatIn[ilat1]+dxIn/2;
+	  SourceCell[k].coordinates_x[3] =  xlonIn[ilon1]-dxIn/2;
+	  SourceCell[k].coordinates_y[3] =  xlatIn[ilat1]+dxIn/2;
+	  if ( lout )
+	    {
+	      printf("source: %d\n", k);
+	      for ( int n = 0; n < 4; ++n )
+		printf(" %g %g", SourceCell[k].coordinates_x[n], SourceCell[k].coordinates_y[n]);
+	      printf("\n");
+	    }
+	}
+      
+      polygon_partial_weights (num_deps, SourceCell, TargetCell, weight );
+      for ( int k = 0; k < num_deps; ++k )
+	{
+	  int index1 = curr_deps[k];
+	  int ilat1 = index1/nlonIn;
+	  int ilon1 = index1 - ilat1*nlonIn;
+	  if ( lout )
+	    printf("  result dep: %d %d %d %d %d %d  %g\n", k, nlonOut, nlatOut, index1, ilon1, ilat1, weight[k]);
+	}
+      // correct_weights ( nSourceCells, weight );
+    }
+
+  /*
+  for ( int j = 0; j < 10; ++j )
+    {
+      for ( int i = 0; i < 10; ++i )
+	printf("%g ", arrayOut[j*10+i]);
+      printf("\n");
+    }
+  */
+  // free (search_result);
+  // if (array) free(array);
+  //free(lonIn);
+  //free(latIn);
+  //free(lonOut);
+  //free(latOut);
+  //free(fieldIn);
+#endif
+}
+
+
+void *YAR(void *argument)
+{
+  int YARBIL, YARCON;
+  int operatorID;
+  int streamID1, streamID2;
+  int nrecs, ngrids;
+  int index;
+  int tsID, recID, varID, levelID;
+  int gridsize;
+  int vlistID1, vlistID2;
+  int gridID1 = -1, gridID2 = -1;
+  int nmiss;
+  int xinc = 0, yinc = 0;
+  double missval;
+  double slon, slat;
+  double *array1 = NULL, *array2 = NULL;
+  field_t field1, field2;
+  int taxisID1, taxisID2;
+
+  cdoInitialize(argument);
+
+  YARBIL = cdoOperatorAdd("yarbil",  0, 0, NULL);
+  YARCON = cdoOperatorAdd("yarcon",  0, 0, NULL);
+
+  operatorID = cdoOperatorID();
+
+  operatorInputArg("grid description file or name");
+  gridID2 = cdoDefineGrid(operatorArgv()[0]);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids = vlistNgrids(vlistID1);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID1 = vlistGrid(vlistID1, index);
+
+      if ( gridInqType(gridID1) != GRID_LONLAT && gridInqType(gridID1) != GRID_GAUSSIAN )
+	cdoAbort("Interpolation of %s data unsupported!", gridNamePtr(gridInqType(gridID1)) );
+
+      if ( gridIsRotated(gridID1) )
+	cdoAbort("Rotated grids not supported!");
+
+      vlistChangeGridIndex(vlistID2, index, gridID2);
+    }
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  array1   = (double *) malloc(gridsize*sizeof(double));
+
+  gridsize = gridInqSize(gridID2);
+  array2   = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+	       
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, array1, &nmiss);
+
+	  gridID1 = vlistInqVarGrid(vlistID1, varID);
+	  missval = vlistInqVarMissval(vlistID1, varID);
+
+	  field1.grid    = gridID1;
+	  field1.nmiss   = nmiss;
+	  field1.missval = missval;
+	  field1.ptr     = array1;
+	  field2.grid    = gridID2;
+	  field2.ptr     = array2;
+	  field2.nmiss   = 0;
+
+	  if ( operatorID == YARBIL )
+	    testint_p(&field1, &field2);
+	  else if ( operatorID == YARCON )
+	    testint_c(&field1, &field2);
+	  else
+	    cdoAbort("Not implemented!");
+
+	  nmiss = field2.nmiss;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, array2, nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( array2 ) free(array2);
+  if ( array1 ) free(array1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Ydayarith.c b/src/Ydayarith.c
new file mode 100644
index 0000000..12870be
--- /dev/null
+++ b/src/Ydayarith.c
@@ -0,0 +1,187 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Ydayarith  ydayadd         Add multi-year daily time series
+      Ydayarith  ydaysub         Subtract multi-year daily time series
+      Ydayarith  ydaymul         Multiply multi-year daily time series
+      Ydayarith  ydaydiv         Divide multi-year daily time series
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  MAX_DAY   1232
+
+void *Ydayarith(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2, streamID3;
+  int gridsize;
+  int nrecs, nvars, nlev, recID;
+  int tsID;
+  int varID, levelID;
+  int offset;
+  int vlistID1, vlistID2, vlistID3;
+  int taxisID1, taxisID2, taxisID3;
+  int vdate, year, mon, day;
+  field_t field1, field2;
+  int **varnmiss2[MAX_DAY];
+  double **vardata2[MAX_DAY];
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("ydayadd", func_add, 0, NULL);
+  cdoOperatorAdd("ydaysub", func_sub, 0, NULL);
+  cdoOperatorAdd("ydaymul", func_mul, 0, NULL);
+  cdoOperatorAdd("ydaydiv", func_div, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  nvars  = vlistNvars(vlistID2);
+
+  for ( day = 0; day < MAX_DAY ; day++ ) vardata2[day] = NULL;
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID2, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID2);
+
+      cdiDecodeDate(vdate, &year, &mon, &day);
+      day += mon*100;
+      if ( day < 0 || day >= MAX_DAY ) cdoAbort("Day %d out of range!", day);
+
+      if ( vardata2[day] != NULL ) cdoAbort("Day %d already allocatd!", day);
+
+      vardata2[day]  = (double **) malloc(nvars*sizeof(double *));
+      varnmiss2[day] = (int **) malloc(nvars*sizeof(int *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  nlev     = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	  vardata2[day][varID]  = (double *) malloc(nlev*gridsize*sizeof(double));
+	  varnmiss2[day][varID] = (int *) malloc(nlev*sizeof(int));
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID2, &varID, &levelID);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  offset   = gridsize*levelID;
+
+	  streamReadRecord(streamID2, vardata2[day][varID]+offset, &field2.nmiss);
+	  varnmiss2[day][varID][levelID] = field2.nmiss;
+	}
+
+      tsID++;
+    }
+
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+
+      cdiDecodeDate(vdate, &year, &mon, &day);
+      day += mon*100;
+      if ( day < 0 || day >= MAX_DAY ) cdoAbort("Day %d out of range!", day);
+
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field1.ptr, &field1.nmiss);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  offset   = gridsize*levelID;
+	  if ( vardata2[day] == NULL ) cdoAbort("Day %d not found!", day);
+	  memcpy(field2.ptr, vardata2[day][varID]+offset, gridsize*sizeof(double));
+	  field2.nmiss = varnmiss2[day][varID][levelID];
+
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID);
+	  field1.missval = vlistInqVarMissval(vlistID1, varID);
+
+	  field2.grid    = vlistInqVarGrid(vlistID2, varID);
+	  field2.missval = vlistInqVarMissval(vlistID2, varID);
+
+	  farfun(&field1, field2, operfunc);
+
+	  streamDefRecord(streamID3, varID, levelID);
+	  streamWriteRecord(streamID3, field1.ptr, field1.nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  for ( day = 0; day < MAX_DAY ; day++ ) 
+    if ( vardata2[day] )
+      {
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    free(vardata2[day][varID]);
+	    free(varnmiss2[day][varID]);
+	  }
+
+	free(vardata2[day]);
+	free(varnmiss2[day]);
+      }
+
+  if ( field1.ptr ) free(field1.ptr);
+  if ( field2.ptr ) free(field2.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Ydaypctl.c b/src/Ydaypctl.c
new file mode 100644
index 0000000..bea10dc
--- /dev/null
+++ b/src/Ydaypctl.c
@@ -0,0 +1,291 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Ydaypctl   ydaypctl        Multi-year daily percentiles
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "percentiles.h"
+
+#define  NDAY       373
+
+
+void *Ydaypctl(void *argument)
+{
+  int gridsize;
+  int varID;
+  int recID;
+  int gridID;
+  int vdate, vtime;
+  int year, month, day, dayoy;
+  int nrecs, nrecords;
+  int levelID;
+  int tsID;
+  int otsID;
+  long nsets[NDAY];
+  int streamID1, streamID2, streamID3, streamID4;
+  int vlistID1, vlistID2, vlistID3, vlistID4, taxisID1, taxisID2, taxisID3, taxisID4;
+  int nmiss;
+  int nvars, nlevels;
+  int *recVarID, *recLevelID;
+  int vdates1[NDAY], vtimes1[NDAY];
+  int vdates2[NDAY], vtimes2[NDAY];
+  double missval;
+  field_t **vars1[NDAY];
+  field_t field;
+  double pn;
+  HISTOGRAM_SET *hsets[NDAY];
+
+  cdoInitialize(argument);
+  cdoOperatorAdd("ydaypctl", func_pctl, 0, NULL);
+
+  operatorInputArg("percentile number");
+  pn = atof(operatorArgv()[0]);
+      
+  if ( !(pn > 0 && pn < 100) )
+    cdoAbort("Illegal argument: percentile number %g is not in the range 0..100!", pn);
+
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    {
+      vars1[dayoy] = NULL;
+      hsets[dayoy] = NULL;
+      nsets[dayoy] = 0;
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  streamID3 = streamOpenRead(cdoStreamName(2));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = streamInqVlist(streamID3);
+  vlistID4 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+  vlistCompare(vlistID1, vlistID3, CMP_ALL);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = vlistInqTaxis(vlistID3);
+  /* TODO - check that time axes 2 and 3 are equal */
+
+  taxisID4 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID4) ) taxisDeleteBounds(taxisID4);
+  vlistDefTaxis(vlistID4, taxisID4);
+
+  streamID4 = streamOpenWrite(cdoStreamName(3), cdoFiletype());
+
+  streamDefVlist(streamID4, vlistID4);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID2, tsID)) )
+    {
+      if ( nrecs != streamInqTimestep(streamID3, tsID) )
+        cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoStreamName(1), cdoStreamName(2));
+      
+      vdate = taxisInqVdate(taxisID2);
+      vtime = taxisInqVtime(taxisID2);
+      
+      if ( vdate != taxisInqVdate(taxisID3) || vtime != taxisInqVtime(taxisID3) )
+        cdoAbort("Verification dates at time step %d of %s and %s differ!", tsID+1, cdoStreamName(1), cdoStreamName(2));
+        
+      if ( cdoVerbose ) cdoPrint("process timestep: %d %d %d", tsID+1, vdate, vtime);
+
+      cdiDecodeDate(vdate, &year, &month, &day);
+
+      if ( month >= 1 && month <= 12 )
+	dayoy = (month-1)*31 + day;
+      else
+	dayoy = 0;
+
+      if ( dayoy < 0 || dayoy >= NDAY )
+	cdoAbort("Day %d out of range!", dayoy);
+
+      vdates2[dayoy] = vdate;
+      vtimes2[dayoy] = vtime;
+
+      if ( vars1[dayoy] == NULL )
+	{
+	  vars1[dayoy] = (field_t **) malloc(nvars*sizeof(field_t *));
+          hsets[dayoy] = hsetCreate(nvars);
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlevels  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      missval  = vlistInqVarMissval(vlistID1, varID);
+
+	      vars1[dayoy][varID] = (field_t *)  malloc(nlevels*sizeof(field_t));
+              hsetCreateVarLevels(hsets[dayoy], varID, nlevels, gridID);
+	      
+	      for ( levelID = 0; levelID < nlevels; levelID++ )
+		{
+		  vars1[dayoy][varID][levelID].grid    = gridID;
+		  vars1[dayoy][varID][levelID].nmiss   = 0;
+		  vars1[dayoy][varID][levelID].missval = missval;
+		  vars1[dayoy][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		}
+	    }
+	}
+      
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID2, &varID, &levelID);
+	  streamReadRecord(streamID2, vars1[dayoy][varID][levelID].ptr, &nmiss);
+          vars1[dayoy][varID][levelID].nmiss = nmiss;
+        }
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID3, &varID, &levelID);
+	  streamReadRecord(streamID3, field.ptr, &nmiss);
+          field.nmiss   = nmiss;
+          field.grid    = vars1[dayoy][varID][levelID].grid;
+	  field.missval = vars1[dayoy][varID][levelID].missval;
+	  
+	  hsetDefVarLevelBounds(hsets[dayoy], varID, levelID, &vars1[dayoy][varID][levelID], &field);
+        }
+      
+      tsID++;
+    }
+  
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      if ( cdoVerbose ) cdoPrint("process timestep: %d %d %d", tsID+1, vdate, vtime);
+
+      cdiDecodeDate(vdate, &year, &month, &day);
+
+      if ( month >= 1 && month <= 12 )
+	dayoy = (month-1)*31 + day;
+      else
+	dayoy = 0;
+
+      if ( dayoy < 0 || dayoy >= NDAY )
+	cdoAbort("Day %d out of range!", dayoy);
+	
+      vdates1[dayoy] = vdate;
+      vtimes1[dayoy] = vtime;
+      
+      if ( vars1[dayoy] == NULL )
+        cdoAbort("No data for day %d in %s and %s", dayoy, cdoStreamName(1), cdoStreamName(2));
+        
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+
+	  streamReadRecord(streamID1, vars1[dayoy][varID][levelID].ptr, &nmiss);
+	  vars1[dayoy][varID][levelID].nmiss = nmiss;
+	      
+	  hsetAddVarLevelValues(hsets[dayoy], varID, levelID, &vars1[dayoy][varID][levelID]);
+	}
+
+      nsets[dayoy]++;
+      tsID++;
+    }
+
+  otsID = 0;
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    if ( nsets[dayoy] )
+      {
+        if ( vdates1[dayoy] != vdates2[dayoy] )
+          cdoAbort("Verification dates for day %d of %s, %s and %s are different!", dayoy, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+        if ( vtimes1[dayoy] != vtimes2[dayoy] )
+          cdoAbort("Verification times for day %d of %s, %s and %s are different!", dayoy, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+        
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      
+	    for ( levelID = 0; levelID < nlevels; levelID++ )
+	      hsetGetVarLevelPercentiles(&vars1[dayoy][varID][levelID], hsets[dayoy], varID, levelID, pn);
+	  }
+
+	taxisDefVdate(taxisID4, vdates1[dayoy]);
+	taxisDefVtime(taxisID4, vtimes1[dayoy]);
+	streamDefTimestep(streamID4, otsID);
+
+	for ( recID = 0; recID < nrecords; recID++ )
+	  {
+	    varID    = recVarID[recID];
+	    levelID  = recLevelID[recID];
+
+	    if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	    streamDefRecord(streamID4, varID, levelID);
+	    streamWriteRecord(streamID4, vars1[dayoy][varID][levelID].ptr, vars1[dayoy][varID][levelID].nmiss);
+	  }
+
+	otsID++;
+      }
+
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    {
+      if ( vars1[dayoy] != NULL )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevels; levelID++ )
+		free(vars1[dayoy][varID][levelID].ptr);
+	      free(vars1[dayoy][varID]);
+	    }
+	  free(vars1[dayoy]); 
+	  hsetDestroy(hsets[dayoy]);
+	}
+    }
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID4);
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Ydaystat.c b/src/Ydaystat.c
new file mode 100644
index 0000000..398aa09
--- /dev/null
+++ b/src/Ydaystat.c
@@ -0,0 +1,343 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Ydaystat   ydaymin         Multi-year daily minimum
+      Ydaystat   ydaymax         Multi-year daily maximum
+      Ydaystat   ydaysum         Multi-year daily sum
+      Ydaystat   ydaymean        Multi-year daily mean
+      Ydaystat   ydayavg         Multi-year daily average
+      Ydaystat   ydayvar         Multi-year daily variance
+      Ydaystat   ydaystd         Multi-year daily standard deviation
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  NDAY       373
+
+
+void *Ydaystat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int gridsize;
+  int i;
+  int varID;
+  int recID;
+  int gridID;
+  int vdate, vtime;
+  int year, month, day, dayoy;
+  int nrecs, nrecords;
+  int levelID;
+  int tsID;
+  int otsID;
+  long nsets[NDAY];
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  int vdates[NDAY], vtimes[NDAY];
+  double missval;
+  field_t **vars1[NDAY], **vars2[NDAY], **samp1[NDAY];
+  field_t field;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("ydaymin",  func_min,  0, NULL);
+  cdoOperatorAdd("ydaymax",  func_max,  0, NULL);
+  cdoOperatorAdd("ydaysum",  func_sum,  0, NULL);
+  cdoOperatorAdd("ydaymean", func_mean, 0, NULL);
+  cdoOperatorAdd("ydayavg",  func_avg,  0, NULL);
+  cdoOperatorAdd("ydayvar",  func_var,  0, NULL);
+  cdoOperatorAdd("ydaystd",  func_std,  0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    {
+      vars1[dayoy] = NULL;
+      vars2[dayoy] = NULL;
+      samp1[dayoy] = NULL;
+      nsets[dayoy] = 0;
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID2) ) taxisDeleteBounds(taxisID2);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  otsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      if ( cdoVerbose ) cdoPrint("process timestep: %d %d %d", tsID+1, vdate, vtime);
+
+      cdiDecodeDate(vdate, &year, &month, &day);
+
+      if ( month >= 1 && month <= 12 )
+	dayoy = (month-1)*31 + day;
+      else
+	dayoy = 0;
+
+      if ( dayoy < 0 || dayoy >= NDAY )
+	cdoAbort("day of year %d out of range (date=%d)!", dayoy, vdate);
+
+      vdates[dayoy] = vdate;
+      vtimes[dayoy] = vtime;
+
+      if ( vars1[dayoy] == NULL )
+	{
+	  vars1[dayoy] = (field_t **) malloc(nvars*sizeof(field_t *));
+	  samp1[dayoy] = (field_t **) malloc(nvars*sizeof(field_t *));
+	  if ( operfunc == func_std || operfunc == func_var )
+	    vars2[dayoy] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      missval  = vlistInqVarMissval(vlistID1, varID);
+
+	      vars1[dayoy][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      samp1[dayoy][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      if ( operfunc == func_std || operfunc == func_var )
+		vars2[dayoy][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  vars1[dayoy][varID][levelID].grid    = gridID;
+		  vars1[dayoy][varID][levelID].nmiss   = 0;
+		  vars1[dayoy][varID][levelID].missval = missval;
+		  vars1[dayoy][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		  samp1[dayoy][varID][levelID].grid    = gridID;
+		  samp1[dayoy][varID][levelID].nmiss   = 0;
+		  samp1[dayoy][varID][levelID].missval = missval;
+		  samp1[dayoy][varID][levelID].ptr     = NULL;
+		  if ( operfunc == func_std || operfunc == func_var )
+		    {
+		      vars2[dayoy][varID][levelID].grid    = gridID;
+		      vars2[dayoy][varID][levelID].nmiss   = 0;
+		      vars2[dayoy][varID][levelID].missval = missval;
+		      vars2[dayoy][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		    }
+		}
+	    }
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  if ( nsets[dayoy] == 0 )
+	    {
+	      streamReadRecord(streamID1, vars1[dayoy][varID][levelID].ptr, &nmiss);
+	      vars1[dayoy][varID][levelID].nmiss = nmiss;
+
+	      if ( nmiss > 0 || samp1[dayoy][varID][levelID].ptr )
+		{
+		  if ( samp1[dayoy][varID][levelID].ptr == NULL )
+		    samp1[dayoy][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( DBL_IS_EQUAL(vars1[dayoy][varID][levelID].ptr[i],
+				      vars1[dayoy][varID][levelID].missval) )
+		      samp1[dayoy][varID][levelID].ptr[i] = 0;
+		    else
+		      samp1[dayoy][varID][levelID].ptr[i] = 1;
+		}
+	    }
+	  else
+	    {
+	      streamReadRecord(streamID1, field.ptr, &field.nmiss);
+	      field.grid    = vars1[dayoy][varID][levelID].grid;
+	      field.missval = vars1[dayoy][varID][levelID].missval;
+
+	      if ( field.nmiss > 0 || samp1[dayoy][varID][levelID].ptr )
+		{
+		  if ( samp1[dayoy][varID][levelID].ptr == NULL )
+		    {
+		      samp1[dayoy][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+		      for ( i = 0; i < gridsize; i++ )
+			samp1[dayoy][varID][levelID].ptr[i] = nsets[dayoy];
+		    }
+		  
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( !DBL_IS_EQUAL(field.ptr[i], vars1[dayoy][varID][levelID].missval) )
+		      samp1[dayoy][varID][levelID].ptr[i]++;
+		}
+
+	      if ( operfunc == func_std || operfunc == func_var )
+		{
+		  farsumq(&vars2[dayoy][varID][levelID], field);
+		  farsum(&vars1[dayoy][varID][levelID], field);
+		}
+	      else
+		{
+		  farfun(&vars1[dayoy][varID][levelID], field, operfunc);
+		}
+	    }
+	}
+
+      if ( nsets[dayoy] == 0 && (operfunc == func_std || operfunc == func_var) )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      farmoq(&vars2[dayoy][varID][levelID], vars1[dayoy][varID][levelID]);
+	  }
+
+      nsets[dayoy]++;
+      tsID++;
+    }
+
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    if ( nsets[dayoy] )
+      {
+	if ( operfunc == func_mean || operfunc == func_avg )
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  if ( samp1[dayoy][varID][levelID].ptr == NULL )
+		    farcmul(&vars1[dayoy][varID][levelID], 1.0/nsets[dayoy]);
+		  else
+		    fardiv(&vars1[dayoy][varID][levelID], samp1[dayoy][varID][levelID]);
+		}
+	    }
+	else if ( operfunc == func_std || operfunc == func_var )
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  if ( samp1[dayoy][varID][levelID].ptr == NULL )
+		    {
+		      if ( operfunc == func_std )
+			farcstd(&vars1[dayoy][varID][levelID], vars2[dayoy][varID][levelID], 1.0/nsets[dayoy]);
+		      else
+			farcvar(&vars1[dayoy][varID][levelID], vars2[dayoy][varID][levelID], 1.0/nsets[dayoy]);
+		    }
+		  else
+		    {
+		      farinv(&samp1[dayoy][varID][levelID]);
+		      if ( operfunc == func_std )
+			farstd(&vars1[dayoy][varID][levelID], vars2[dayoy][varID][levelID], samp1[dayoy][varID][levelID]);
+		      else
+			farvar(&vars1[dayoy][varID][levelID], vars2[dayoy][varID][levelID], samp1[dayoy][varID][levelID]);
+		    }
+		}
+	    }
+
+	taxisDefVdate(taxisID2, vdates[dayoy]);
+	taxisDefVtime(taxisID2, vtimes[dayoy]);
+	streamDefTimestep(streamID2, otsID);
+
+	for ( recID = 0; recID < nrecords; recID++ )
+	  {
+	    varID    = recVarID[recID];
+	    levelID  = recLevelID[recID];
+
+	    if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	    streamDefRecord(streamID2, varID, levelID);
+	    streamWriteRecord(streamID2, vars1[dayoy][varID][levelID].ptr,
+			      vars1[dayoy][varID][levelID].nmiss);
+	  }
+
+	otsID++;
+      }
+
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    {
+      if ( vars1[dayoy] != NULL )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  free(vars1[dayoy][varID][levelID].ptr);
+		  if ( samp1[dayoy][varID][levelID].ptr ) free(samp1[dayoy][varID][levelID].ptr);
+		  if ( operfunc == func_std || operfunc == func_var ) free(vars2[dayoy][varID][levelID].ptr);
+		}
+	      
+	      free(vars1[dayoy][varID]);
+	      free(samp1[dayoy][varID]);
+	      if ( operfunc == func_std || operfunc == func_var ) free(vars2[dayoy][varID]);
+	    }
+
+	  free(vars1[dayoy]);
+	  free(samp1[dayoy]);
+	  if ( operfunc == func_std || operfunc == func_var ) free(vars2[dayoy]);
+	}
+    }
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Ydrunpctl.c b/src/Ydrunpctl.c
new file mode 100644
index 0000000..f642136
--- /dev/null
+++ b/src/Ydrunpctl.c
@@ -0,0 +1,381 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Ydrunpctl    ydrunpctl         Multi-year daily running percentiles
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "percentiles.h"
+
+
+#define NDAY 373
+
+
+void *Ydrunpctl(void *argument)
+{
+  int gridsize;
+  int varID;
+  int recID;
+  int gridID;
+  int nrecs, nrecords;
+  int levelID;
+  int tsID;
+  int otsID;
+  int inp, its, ndates = 0;
+  int streamID1, streamID2, streamID3, streamID4;
+  int vlistID1, vlistID2, vlistID3, vlistID4;
+  int nmiss;
+  int nvars, nlevels;
+  int *recVarID, *recLevelID;
+  double missval;
+  field_t ***vars1 = NULL, **vars2[NDAY];
+  datetime_t *datetime;
+  int taxisID1, taxisID2, taxisID3, taxisID4;
+  int calendar, dpy;
+  int vdate, vtime;
+  int vdates1[NDAY], vtimes1[NDAY];
+  int vdates2[NDAY], vtimes2[NDAY];
+  int nsets[NDAY];
+  int year, month, day, dayoy;
+  field_t field;
+  double pn;
+  HISTOGRAM_SET *hsets[NDAY];
+    
+  cdoInitialize(argument);
+  cdoOperatorAdd("ydrunpctl", func_pctl, 0, NULL);
+
+  operatorInputArg("percentile number, number of timesteps");
+  operatorCheckArgc(2);
+  pn     = atof(operatorArgv()[0]);
+  ndates = atoi(operatorArgv()[1]);
+
+  if ( !(pn > 0 && pn < 100) )
+    cdoAbort("Illegal argument: percentile number %g is not in the range 0..100!", pn);
+  
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    {
+      vars2[dayoy] = NULL;
+      hsets[dayoy] = NULL;
+      nsets[dayoy] = 0;
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  streamID3 = streamOpenRead(cdoStreamName(2));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = streamInqVlist(streamID3);
+  vlistID4 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+  vlistCompare(vlistID1, vlistID3, CMP_ALL);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = vlistInqTaxis(vlistID3);
+  /* TODO - check that time axes 2 and 3 are equal */
+
+  taxisID4 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID4) ) taxisDeleteBounds(taxisID4);
+  vlistDefTaxis(vlistID4, taxisID4);
+
+  calendar = taxisInqCalendar(taxisID1);
+  dpy      = calendar_dpy(calendar);
+
+  streamID4 = streamOpenWrite(cdoStreamName(3), cdoFiletype());
+
+  streamDefVlist(streamID4, vlistID4);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  datetime = (datetime_t *) malloc((ndates+1)*sizeof(datetime_t));
+  
+  vars1 = (field_t ***) malloc((ndates+1)*sizeof(field_t **));
+  
+  for ( its = 0; its < ndates; its++ )
+    {
+      vars1[its] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  nlevels  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+
+	  vars1[its][varID] = (field_t *) malloc(nlevels*sizeof(field_t));
+
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    {
+	      vars1[its][varID][levelID].grid    = gridID;
+	      vars1[its][varID][levelID].nmiss   = 0;
+	      vars1[its][varID][levelID].missval = missval;
+	      vars1[its][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+	    }
+	}
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID2, tsID)) )
+    {
+      if ( nrecs != streamInqTimestep(streamID3, tsID) )
+        cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoStreamName(1), cdoStreamName(2));
+      
+      vdate = taxisInqVdate(taxisID2);
+      vtime = taxisInqVtime(taxisID2);
+      
+      if ( vdate != taxisInqVdate(taxisID3) || vtime != taxisInqVtime(taxisID3) )
+        cdoAbort("Verification dates at time step %d of %s and %s differ!", tsID+1, cdoStreamName(1), cdoStreamName(2));
+        
+      if ( cdoVerbose ) cdoPrint("process timestep: %d %d %d", tsID+1, vdate, vtime);
+
+      cdiDecodeDate(vdate, &year, &month, &day);
+
+      if ( month >= 1 && month <= 12 )
+	dayoy = (month-1)*31 + day;
+      else
+	dayoy = 0;
+
+      if ( dayoy < 0 || dayoy >= NDAY )
+	cdoAbort("Day %d out of range!", dayoy);
+
+      vdates2[dayoy] = vdate;
+      vtimes2[dayoy] = vtime;
+
+      if ( vars2[dayoy] == NULL )
+	{
+	  vars2[dayoy] = (field_t **) malloc(nvars*sizeof(field_t *));
+          hsets[dayoy] = hsetCreate(nvars);
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID2, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlevels  = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	      missval  = vlistInqVarMissval(vlistID2, varID);
+
+	      vars2[dayoy][varID] = (field_t *)  malloc(nlevels*sizeof(field_t));
+              hsetCreateVarLevels(hsets[dayoy], varID, nlevels, gridID);
+	      
+	      for ( levelID = 0; levelID < nlevels; levelID++ )
+		{
+		  vars2[dayoy][varID][levelID].grid    = gridID;
+		  vars2[dayoy][varID][levelID].nmiss   = 0;
+		  vars2[dayoy][varID][levelID].missval = missval;
+		  vars2[dayoy][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		}
+	    }
+	}
+      
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID2, &varID, &levelID);
+	  streamReadRecord(streamID2, vars2[dayoy][varID][levelID].ptr, &nmiss);
+          vars2[dayoy][varID][levelID].nmiss = nmiss;
+        }
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID3, &varID, &levelID);
+	  streamReadRecord(streamID3, field.ptr, &nmiss);
+          field.nmiss   = nmiss;
+          field.grid    = vars2[dayoy][varID][levelID].grid;
+	  field.missval = vars2[dayoy][varID][levelID].missval;
+	  
+	  hsetDefVarLevelBounds(hsets[dayoy], varID, levelID, &vars2[dayoy][varID][levelID], &field);
+        }
+      
+      tsID++;
+    }
+  
+  for ( tsID = 0; tsID < ndates; tsID++ )
+    {
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 )
+	cdoAbort("File has less then %d timesteps!", ndates);
+
+      datetime[tsID].date = taxisInqVdate(taxisID1);
+      datetime[tsID].time = taxisInqVtime(taxisID1);
+	
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+	  
+	  streamReadRecord(streamID1, vars1[tsID][varID][levelID].ptr, &nmiss);
+	  vars1[tsID][varID][levelID].nmiss = nmiss;
+	}
+    }
+  
+  while ( TRUE )
+    {
+      datetime_avg(dpy, ndates, datetime);
+      
+      vdate = datetime[ndates].date;
+      vtime = datetime[ndates].time;
+      
+      cdiDecodeDate(vdate, &year, &month, &day);
+
+      if ( month >= 1 && month <= 12 )
+	dayoy = (month-1)*31 + day;
+      else
+	dayoy = 0;
+
+      if ( dayoy < 0 || dayoy >= NDAY )
+	cdoAbort("Day %d out of range!", dayoy);
+
+      vdates1[dayoy] = vdate;
+      vtimes1[dayoy] = vtime;
+      
+      if ( vars2[dayoy] == NULL )
+        cdoAbort("No data for day %d in %s and %s", dayoy, cdoStreamName(1), cdoStreamName(2));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	  nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    for ( inp = 0; inp < ndates; inp++ )
+	      hsetAddVarLevelValues(hsets[dayoy], varID, levelID, &vars1[inp][varID][levelID]);
+	}
+        
+      datetime[ndates] = datetime[0];
+      vars1[ndates] = vars1[0];
+
+      for ( inp = 0; inp < ndates; inp++ )
+	{
+	  datetime[inp] = datetime[inp+1];
+	  vars1[inp] = vars1[inp+1];
+	}
+
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 ) break;
+
+      datetime[ndates-1].date = taxisInqVdate(taxisID1);
+      datetime[ndates-1].time = taxisInqVtime(taxisID1);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  
+	  streamReadRecord(streamID1, vars1[ndates-1][varID][levelID].ptr, &nmiss);
+	  vars1[ndates-1][varID][levelID].nmiss = nmiss;
+	}
+
+      nsets[dayoy] += ndates;
+      tsID++;
+    }
+
+  otsID = 0;
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    if ( nsets[dayoy] )
+      {
+        if ( vdates1[dayoy] != vdates2[dayoy] )
+          cdoAbort("Verification dates for day %d of %s, %s and %s are different!", dayoy, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+        if ( vtimes1[dayoy] != vtimes2[dayoy] )
+          cdoAbort("Verification times for day %d of %s, %s and %s are different!", dayoy, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      
+	    for ( levelID = 0; levelID < nlevels; levelID++ )
+	      hsetGetVarLevelPercentiles(&vars2[dayoy][varID][levelID], hsets[dayoy], varID, levelID, pn);
+	  }
+
+	taxisDefVdate(taxisID4, vdates1[dayoy]);
+	taxisDefVtime(taxisID4, vtimes1[dayoy]);
+	streamDefTimestep(streamID4, otsID);
+
+	for ( recID = 0; recID < nrecords; recID++ )
+	  {
+	    varID    = recVarID[recID];
+	    levelID  = recLevelID[recID];
+
+	    if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	    streamDefRecord(streamID4, varID, levelID);
+	    streamWriteRecord(streamID4, vars2[dayoy][varID][levelID].ptr,
+			      vars2[dayoy][varID][levelID].nmiss);
+	  }
+
+	otsID++;
+      }
+  
+  for ( its = 0; its < ndates; its++ )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    free(vars1[its][varID][levelID].ptr);
+	  free(vars1[its][varID]);
+	}
+      free(vars1[its]);
+    }
+  free(vars1);
+
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    {
+      if ( vars2[dayoy] != NULL )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	      for ( levelID = 0; levelID < nlevels; levelID++ )
+		free(vars2[dayoy][varID][levelID].ptr);
+	      free(vars2[dayoy][varID]);
+	    }
+	  free(vars2[dayoy]); 
+	  hsetDestroy(hsets[dayoy]);
+	}
+    }
+
+  if ( field.ptr ) free(field.ptr);
+  
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID4);
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Ydrunstat.c b/src/Ydrunstat.c
new file mode 100644
index 0000000..ca8de8f
--- /dev/null
+++ b/src/Ydrunstat.c
@@ -0,0 +1,560 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Ydrunstat    ydrunmin          Multi-year daily running minimum
+      Ydrunstat    ydrunmax          Multi-year daily running maximum
+      Ydrunstat    ydrunsum          Multi-year daily running sum
+      Ydrunstat    ydrunmean         Multi-year daily running mean
+      Ydrunstat    ydrunavg          Multi-year daily running average
+      Ydrunstat    ydrunvar          Multi-year daily running variance
+      Ydrunstat    ydrunstd          Multi-year daily running standard deviation
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define NDAY 373
+
+
+typedef struct {
+  int     vdate[NDAY];
+  int     vtime[NDAY];  
+  field_t **vars1[NDAY]; 
+  field_t **vars2[NDAY];
+  int     nsets[NDAY];
+  int     vlist;
+}
+YDAY_STATS;
+
+
+static YDAY_STATS *ydstatCreate(int vlistID);
+static void ydstatDestroy(YDAY_STATS *stats);
+static void ydstatCreateVars1(YDAY_STATS *stats, int dayoy);
+static void ydstatCreateVars2(YDAY_STATS *stats, int dayoy);
+static void ydstatUpdate(YDAY_STATS *stats, int vdate, int vtime, 
+  field_t **vars1, field_t **vars2, int nsets, int operfunc);
+static void ydstatFinalize(YDAY_STATS *stats, int operfunc);
+
+
+void *Ydrunstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int gridsize;
+  int varID;
+  int recID;
+  int gridID;
+  int nrecs, nrecords;
+  int levelID;
+  int tsID;
+  int otsID;
+  int inp, its, ndates = 0;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int nmiss;
+  int nvars, nlevels;
+  int *recVarID, *recLevelID;
+  double missval;
+  field_t ***vars1 = NULL, ***vars2 = NULL;
+  datetime_t *datetime;
+  int taxisID1, taxisID2;
+  int calendar, dpy;
+  int vdate, vtime;
+  int dayoy;
+  YDAY_STATS *stats;
+    
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("ydrunmin",  func_min,  0, NULL);
+  cdoOperatorAdd("ydrunmax",  func_max,  0, NULL);
+  cdoOperatorAdd("ydrunsum",  func_sum,  0, NULL);
+  cdoOperatorAdd("ydrunmean", func_mean, 0, NULL);
+  cdoOperatorAdd("ydrunavg",  func_avg,  0, NULL);
+  cdoOperatorAdd("ydrunvar",  func_var,  0, NULL);
+  cdoOperatorAdd("ydrunstd",  func_std,  0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  operatorInputArg("number of timesteps");
+  ndates = atoi(operatorArgv()[0]);
+  
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID2) ) taxisDeleteBounds(taxisID2);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  calendar = taxisInqCalendar(taxisID1);
+  dpy      = calendar_dpy(calendar);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  datetime = (datetime_t *) malloc((ndates+1)*sizeof(datetime_t));
+  
+  stats = ydstatCreate(vlistID1);
+  vars1 = (field_t ***) malloc((ndates+1)*sizeof(field_t **));
+  if ( operfunc == func_std || operfunc == func_var )
+    vars2 = (field_t ***) malloc((ndates+1)*sizeof(field_t **));
+  
+  for ( its = 0; its < ndates; its++ )
+    {
+      vars1[its] = (field_t **) malloc(nvars*sizeof(field_t *));
+      if ( operfunc == func_std || operfunc == func_var )
+	vars2[its] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridID   = vlistInqVarGrid(vlistID1, varID);
+	  gridsize = gridInqSize(gridID);
+	  nlevels  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  missval  = vlistInqVarMissval(vlistID1, varID);
+
+	  vars1[its][varID] = (field_t *) malloc(nlevels*sizeof(field_t));
+	  if ( operfunc == func_std || operfunc == func_var )
+	    vars2[its][varID] = (field_t *) malloc(nlevels*sizeof(field_t));
+
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    {
+	      vars1[its][varID][levelID].grid    = gridID;
+	      vars1[its][varID][levelID].nmiss   = 0;
+	      vars1[its][varID][levelID].missval = missval;
+	      vars1[its][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+	      if ( operfunc == func_std || operfunc == func_var )
+		{
+		  vars2[its][varID][levelID].grid    = gridID;
+		  vars2[its][varID][levelID].nmiss   = 0;
+		  vars2[its][varID][levelID].missval = missval;
+		  vars2[its][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		}
+	    }
+	}
+    }
+  
+  for ( tsID = 0; tsID < ndates; tsID++ )
+    {
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 )
+	cdoAbort("File has less then %d timesteps!", ndates);
+
+      datetime[tsID].date = taxisInqVdate(taxisID1);
+      datetime[tsID].time = taxisInqVtime(taxisID1);
+	
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+	  
+	  streamReadRecord(streamID1, vars1[tsID][varID][levelID].ptr, &nmiss);
+	  vars1[tsID][varID][levelID].nmiss = nmiss;
+
+	  if ( operfunc == func_std || operfunc == func_var )
+	    {
+	      farmoq(&vars2[tsID][varID][levelID], vars1[tsID][varID][levelID]);
+	      for ( inp = 0; inp < tsID; inp++ )
+		{
+		  farsumq(&vars2[inp][varID][levelID], vars1[tsID][varID][levelID]);
+		  farsum(&vars1[inp][varID][levelID], vars1[tsID][varID][levelID]);
+		}
+	    }
+	  else
+	    {
+	      for ( inp = 0; inp < tsID; inp++ )
+		{
+		  farfun(&vars1[inp][varID][levelID], vars1[tsID][varID][levelID], operfunc);
+		}
+	    }
+	}
+    }
+  
+  while ( TRUE )
+    {
+      datetime_avg(dpy, ndates, datetime);
+      
+      vdate = datetime[ndates].date;
+      vtime = datetime[ndates].time;
+      
+      if ( operfunc == func_std || operfunc == func_var )   
+        ydstatUpdate(stats, vdate, vtime, vars1[0], vars2[0], ndates, operfunc);
+      else
+        ydstatUpdate(stats, vdate, vtime, vars1[0], NULL, ndates, operfunc);
+        
+      datetime[ndates] = datetime[0];
+      vars1[ndates] = vars1[0];
+      if ( operfunc == func_std || operfunc == func_var )
+        vars2[ndates] = vars2[0];
+
+      for ( inp = 0; inp < ndates; inp++ )
+	{
+	  datetime[inp] = datetime[inp+1];
+	  vars1[inp] = vars1[inp+1];
+	  if ( operfunc == func_std || operfunc == func_var )
+	    vars2[inp] = vars2[inp+1];
+	}
+
+      nrecs = streamInqTimestep(streamID1, tsID);
+      if ( nrecs == 0 ) break;
+
+      datetime[ndates-1].date = taxisInqVdate(taxisID1);
+      datetime[ndates-1].time = taxisInqVtime(taxisID1);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  
+	  streamReadRecord(streamID1, vars1[ndates-1][varID][levelID].ptr, &nmiss);
+	  vars1[ndates-1][varID][levelID].nmiss = nmiss;
+
+	  if ( operfunc == func_std || operfunc == func_var )
+	    {
+	      for ( inp = 0; inp < ndates-1; inp++ )
+		{
+		  farsumq(&vars2[inp][varID][levelID], vars1[ndates-1][varID][levelID]);
+		  farsum(&vars1[inp][varID][levelID], vars1[ndates-1][varID][levelID]);
+		}
+	      farmoq(&vars2[ndates-1][varID][levelID], vars1[ndates-1][varID][levelID]);
+	    }
+	  else
+	    {
+	      for ( inp = 0; inp < ndates-1; inp++ )
+		{
+		  farfun(&vars1[inp][varID][levelID], vars1[ndates-1][varID][levelID], operfunc);
+		}
+	    }
+	}
+
+      tsID++;
+    }
+
+  ydstatFinalize(stats, operfunc);
+  otsID = 0;
+
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    if ( stats->nsets[dayoy] )
+      {
+	taxisDefVdate(taxisID2, stats->vdate[dayoy]);
+	taxisDefVtime(taxisID2, stats->vtime[dayoy]);
+	streamDefTimestep(streamID2, otsID);
+
+	for ( recID = 0; recID < nrecords; recID++ )
+	  {
+	    varID    = recVarID[recID];
+	    levelID  = recLevelID[recID];
+
+	    if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	    streamDefRecord(streamID2, varID, levelID);
+	    streamWriteRecord(streamID2, stats->vars1[dayoy][varID][levelID].ptr,
+			      stats->vars1[dayoy][varID][levelID].nmiss);
+	  }
+
+	otsID++;
+      }
+  
+  for ( its = 0; its < ndates; its++ )
+    {
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    {
+	      free(vars1[its][varID][levelID].ptr);
+	      if ( operfunc == func_std || operfunc == func_var ) free(vars2[its][varID][levelID].ptr);
+	    }
+
+	  free(vars1[its][varID]);
+	  if ( operfunc == func_std || operfunc == func_var ) free(vars2[its][varID]);
+	}
+	free(vars1[its]);
+	if ( operfunc == func_std || operfunc == func_var ) free(vars2[its]);
+    }
+  
+  ydstatDestroy(stats);
+  free(vars1);
+  if ( operfunc == func_std || operfunc == func_var ) free(vars2);
+
+  if ( datetime ) free(datetime);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
+
+static
+YDAY_STATS *ydstatCreate(int vlistID)
+{
+  int dayoy;
+  
+  YDAY_STATS *stats = (YDAY_STATS *) malloc(sizeof(YDAY_STATS));
+  
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    {
+      stats->vdate[dayoy] = 0;
+      stats->vtime[dayoy] = 0;
+      stats->vars1[dayoy] = NULL;
+      stats->vars2[dayoy] = NULL;
+      stats->nsets[dayoy] = 0;
+    }
+  stats->vlist = vlistID;
+  
+  return stats;
+}
+
+static
+void ydstatDestroy(YDAY_STATS *stats)
+{
+  int dayoy, varID, levelID, nvars, nlevels;
+  
+  if ( stats != NULL )
+    {
+      nvars = vlistNvars(stats->vlist);
+      
+      for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+        {
+          if ( stats->vars1[dayoy] != NULL )
+            {
+              for ( varID = 0; varID < nvars; varID++ )
+                {
+              	  nlevels = zaxisInqSize(vlistInqVarZaxis(stats->vlist, varID));
+              	  for ( levelID = 0; levelID < nlevels; levelID++ )
+              	    free(stats->vars1[dayoy][varID][levelID].ptr);
+              	  free(stats->vars1[dayoy][varID]);
+                }
+              free(stats->vars1[dayoy]);
+            }
+          if ( stats->vars2[dayoy] != NULL )
+            {
+              for ( varID = 0; varID < nvars; varID++ )
+                {
+              	  nlevels = zaxisInqSize(vlistInqVarZaxis(stats->vlist, varID));
+              	  for ( levelID = 0; levelID < nlevels; levelID++ )
+              	    free(stats->vars2[dayoy][varID][levelID].ptr);
+              	  free(stats->vars2[dayoy][varID]);
+                }
+              free(stats->vars2[dayoy]);
+            }
+        }
+      free(stats);    
+    }
+}
+
+static
+void ydstatCreateVars1(YDAY_STATS *stats, int dayoy)
+{
+  int varID, levelID, nvars, nlevels;
+  int gridID, gridsize;
+  double missval;
+
+  nvars = vlistNvars(stats->vlist);
+  
+  stats->vars1[dayoy] = (field_t **) malloc(nvars * sizeof(field_t *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(stats->vlist, varID);
+      gridsize = gridInqSize(gridID);
+      nlevels  = zaxisInqSize(vlistInqVarZaxis(stats->vlist, varID));
+      missval  = vlistInqVarMissval(stats->vlist, varID);
+
+      stats->vars1[dayoy][varID] = (field_t *) malloc(nlevels * sizeof(field_t));
+	      
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        {
+	  stats->vars1[dayoy][varID][levelID].grid    = gridID;
+	  stats->vars1[dayoy][varID][levelID].nmiss   = 0;
+	  stats->vars1[dayoy][varID][levelID].missval = missval;
+	  stats->vars1[dayoy][varID][levelID].ptr     = (double *) malloc(gridsize * sizeof(double));
+        }
+    }
+}
+
+static
+void ydstatCreateVars2(YDAY_STATS *stats, int dayoy)
+{
+  int varID, levelID, nvars, nlevels;
+  int gridID, gridsize;
+  double missval;
+
+  nvars = vlistNvars(stats->vlist);
+  
+  stats->vars2[dayoy] = (field_t **) malloc(nvars * sizeof(field_t *));
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID   = vlistInqVarGrid(stats->vlist, varID);
+      gridsize = gridInqSize(gridID);
+      nlevels  = zaxisInqSize(vlistInqVarZaxis(stats->vlist, varID));
+      missval  = vlistInqVarMissval(stats->vlist, varID);
+
+      stats->vars2[dayoy][varID] = (field_t *) malloc(nlevels * sizeof(field_t));
+	      
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        {
+	  stats->vars2[dayoy][varID][levelID].grid    = gridID;
+	  stats->vars2[dayoy][varID][levelID].nmiss   = 0;
+	  stats->vars2[dayoy][varID][levelID].missval = missval;
+	  stats->vars2[dayoy][varID][levelID].ptr     = (double *) malloc(gridsize * sizeof(double));
+        }
+    }
+}
+
+static
+void ydstatUpdate(YDAY_STATS *stats, int vdate, int vtime, 
+		  field_t **vars1, field_t **vars2, int nsets, int operfunc)
+{
+  int varID, levelID, nvars, nlevels;
+  int gridsize;
+  int year, month, day, dayoy;
+
+  nvars = vlistNvars(stats->vlist);
+  
+  year  =  vdate / 10000;
+  month = (vdate - year * 10000) / 100;
+  day   =  vdate - year * 10000 - month * 100;
+
+  if ( month >= 1 && month <= 12 )
+    dayoy = (month - 1) * 31 + day;
+  else
+    dayoy = 0;
+
+  if ( dayoy < 0 || dayoy >= NDAY )
+    cdoAbort("day %d out of range!", dayoy);
+
+  stats->vdate[dayoy] = vdate;
+  stats->vtime[dayoy] = vtime;
+
+  if ( stats->vars1[dayoy] == NULL )
+    {
+      ydstatCreateVars1(stats, dayoy);
+      if ( operfunc == func_std || operfunc == func_var )
+	ydstatCreateVars2(stats, dayoy);
+    }
+
+  for ( varID = 0; varID  < nvars; varID++ )
+    {
+      if ( vlistInqVarTsteptype(stats->vlist, varID) == TSTEP_CONSTANT ) continue;
+        
+      gridsize = gridInqSize(vlistInqVarGrid(stats->vlist, varID));
+      nlevels  = zaxisInqSize(vlistInqVarZaxis(stats->vlist, varID));
+          
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        {
+	  if ( stats->nsets[dayoy] == 0 )
+	    {
+	      memcpy(stats->vars1[dayoy][varID][levelID].ptr, vars1[varID][levelID].ptr, gridsize * sizeof(double));
+	      stats->vars1[dayoy][varID][levelID].nmiss = vars1[varID][levelID].nmiss;
+	       
+	      if ( operfunc == func_std || operfunc == func_var )
+	        {
+	          memcpy(stats->vars2[dayoy][varID][levelID].ptr, vars2[varID][levelID].ptr, gridsize * sizeof(double));
+	          stats->vars2[dayoy][varID][levelID].nmiss = vars2[varID][levelID].nmiss;
+	        }
+	    }
+	  else
+	    {
+	      if ( operfunc == func_std || operfunc == func_var )
+	        {
+		  farsum(&stats->vars1[dayoy][varID][levelID], vars1[varID][levelID]);
+		  farsum(&stats->vars2[dayoy][varID][levelID], vars2[varID][levelID]);
+		}
+	      else
+		{
+	          farfun(&stats->vars1[dayoy][varID][levelID], vars1[varID][levelID], operfunc);
+		}
+	    }
+        }
+    }
+
+  stats->nsets[dayoy] += nsets;
+}
+
+static
+void ydstatFinalize(YDAY_STATS *stats, int operfunc)
+{
+  int varID, levelID, nvars, nlevels;
+  int dayoy;
+  
+  nvars = vlistNvars(stats->vlist);
+  
+  for ( dayoy = 0; dayoy < NDAY; dayoy++ )
+    if ( stats->nsets[dayoy] )
+      {
+      	switch ( operfunc )
+      	  {
+	    case func_avg: case func_mean:
+	      for ( varID = 0; varID < nvars; varID++ )
+	        {
+	          if ( vlistInqVarTsteptype(stats->vlist, varID) == TSTEP_CONSTANT ) continue;
+	          nlevels = zaxisInqSize(vlistInqVarZaxis(stats->vlist, varID));
+	          for ( levelID = 0; levelID < nlevels; levelID++ )
+		    farcmul(&stats->vars1[dayoy][varID][levelID], 1.0 / stats->nsets[dayoy]);
+	        }
+	      break;
+	      
+	    case func_std:
+	      for ( varID = 0; varID < nvars; varID++ )
+	        {
+	          if ( vlistInqVarTsteptype(stats->vlist, varID) == TSTEP_CONSTANT ) continue;
+	          nlevels = zaxisInqSize(vlistInqVarZaxis(stats->vlist, varID));
+	          for ( levelID = 0; levelID < nlevels; levelID++ )
+		    farcstd(&stats->vars1[dayoy][varID][levelID], stats->vars2[dayoy][varID][levelID],
+		      1.0 / stats->nsets[dayoy]);
+	        }
+	      break;
+	      
+	    case func_var:
+	      for ( varID = 0; varID < nvars; varID++ )
+	        {
+	          if ( vlistInqVarTsteptype(stats->vlist, varID) == TSTEP_CONSTANT ) continue;
+	          nlevels = zaxisInqSize(vlistInqVarZaxis(stats->vlist, varID));
+	          for ( levelID = 0; levelID < nlevels; levelID++ )
+		    farcvar(&stats->vars1[dayoy][varID][levelID], stats->vars2[dayoy][varID][levelID],
+		      1.0 / stats->nsets[dayoy]);
+	        }
+	      break;
+      	  }
+      }
+}
diff --git a/src/Yhourarith.c b/src/Yhourarith.c
new file mode 100644
index 0000000..cc6ee50
--- /dev/null
+++ b/src/Yhourarith.c
@@ -0,0 +1,212 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Yhourarith  yhouradd         Add multi-year hourly time series
+      Yhourarith  yhoursub         Subtract multi-year hourly time series
+      Yhourarith  yhourmul         Multiply multi-year hourly time series
+      Yhourarith  yhourdiv         Divide multi-year hourly time series
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  MAX_HOUR  9301  /* 31*12*25 + 1 */
+
+static
+int hour_of_year(int vdate, int vtime)
+{
+  int year, month, day, houroy;
+  int hour, minute, second;
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+      
+  if ( month >= 1 && month <= 12 && day >= 1 && day <=31 && hour >= 0 && hour < 24 )
+    houroy = ((month-1)*31 + day - 1)*25 + hour + 1;
+  else
+    houroy = 0;
+
+  if ( houroy < 0 || houroy >= MAX_HOUR )
+    {
+      char vdatestr[32], vtimestr[32];
+      date2str(vdate, vdatestr, sizeof(vdatestr));
+      time2str(vtime, vtimestr, sizeof(vtimestr));
+      cdoAbort("Hour of year %d out of range (%s %s)!", houroy, vdatestr, vtimestr);
+    }
+
+  return (houroy);
+}
+
+
+void *Yhourarith(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2, streamID3;
+  int gridsize;
+  int nrecs, nvars, nlev, recID;
+  int tsID;
+  int varID, levelID;
+  int offset;
+  int vlistID1, vlistID2, vlistID3;
+  int taxisID1, taxisID2, taxisID3;
+  int vdate, vtime;
+  int houroy;
+  field_t field1, field2;
+  int **varnmiss2[MAX_HOUR];
+  double **vardata2[MAX_HOUR];
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("yhouradd", func_add, 0, NULL);
+  cdoOperatorAdd("yhoursub", func_sub, 0, NULL);
+  cdoOperatorAdd("yhourmul", func_mul, 0, NULL);
+  cdoOperatorAdd("yhourdiv", func_div, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  nvars  = vlistNvars(vlistID2);
+
+  for ( houroy = 0; houroy < MAX_HOUR ; ++houroy ) vardata2[houroy] = NULL;
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID2, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID2);
+      vtime = taxisInqVtime(taxisID2);
+
+      houroy = hour_of_year(vdate, vtime);
+      if ( vardata2[houroy] != NULL ) cdoAbort("Hour of year %d already allocatd!", houroy);
+
+      vardata2[houroy]  = (double **) malloc(nvars*sizeof(double *));
+      varnmiss2[houroy] = (int **) malloc(nvars*sizeof(int *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  nlev     = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	  vardata2[houroy][varID]  = (double *) malloc(nlev*gridsize*sizeof(double));
+	  varnmiss2[houroy][varID] = (int *) malloc(nlev*sizeof(int));
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID2, &varID, &levelID);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  offset   = gridsize*levelID;
+
+	  streamReadRecord(streamID2, vardata2[houroy][varID]+offset, &field2.nmiss);
+	  varnmiss2[houroy][varID][levelID] = field2.nmiss;
+	}
+
+      tsID++;
+    }
+
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      houroy = hour_of_year(vdate, vtime);
+      if ( vardata2[houroy] == NULL ) cdoAbort("Hour of year %d not found!", houroy);
+
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field1.ptr, &field1.nmiss);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  offset   = gridsize*levelID;
+	  memcpy(field2.ptr, vardata2[houroy][varID]+offset, gridsize*sizeof(double));
+	  field2.nmiss   = varnmiss2[houroy][varID][levelID];
+
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID);
+	  field1.missval = vlistInqVarMissval(vlistID1, varID);
+
+	  field2.grid    = vlistInqVarGrid(vlistID2, varID);
+	  field2.missval = vlistInqVarMissval(vlistID2, varID);
+
+	  farfun(&field1, field2, operfunc);
+
+	  streamDefRecord(streamID3, varID, levelID);
+	  streamWriteRecord(streamID3, field1.ptr, field1.nmiss);
+	}
+
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  for ( houroy = 0; houroy < MAX_HOUR; ++houroy )
+    if ( vardata2[houroy] )
+      {
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    free(vardata2[houroy][varID]);
+	    free(varnmiss2[houroy][varID]);
+	  }
+
+	free(vardata2[houroy]);
+	free(varnmiss2[houroy]);
+      }
+
+  if ( field1.ptr ) free(field1.ptr);
+  if ( field2.ptr ) free(field2.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Yhourstat.c b/src/Yhourstat.c
new file mode 100644
index 0000000..1d64723
--- /dev/null
+++ b/src/Yhourstat.c
@@ -0,0 +1,360 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Yhourstat   yhourmin         Multi-year hourly minimum
+      Yhourstat   yhourmax         Multi-year hourly maximum
+      Yhourstat   yhoursum         Multi-year hourly sum
+      Yhourstat   yhourmean        Multi-year hourly mean
+      Yhourstat   yhouravg         Multi-year hourly average
+      Yhourstat   yhourvar         Multi-year hourly variance
+      Yhourstat   yhourstd         Multi-year hourly standard deviation
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  MAX_HOUR  9301  /* 31*12*25 + 1 */
+
+static
+int hour_of_year(int vdate, int vtime)
+{
+  int year, month, day, houroy;
+  int hour, minute, second;
+
+  cdiDecodeDate(vdate, &year, &month, &day);
+  cdiDecodeTime(vtime, &hour, &minute, &second);
+      
+  if ( month >= 1 && month <= 12 && day >= 1 && day <=31 && hour >= 0 && hour < 24 )
+    houroy = ((month-1)*31 + day - 1)*25 + hour + 1;
+  else
+    houroy = 0;
+
+  if ( houroy < 0 || houroy >= MAX_HOUR )
+    {
+      char vdatestr[32], vtimestr[32];
+      date2str(vdate, vdatestr, sizeof(vdatestr));
+      time2str(vtime, vtimestr, sizeof(vtimestr));
+      cdoAbort("Hour of year %d out of range (%s %s)!", houroy, vdatestr, vtimestr);
+    }
+
+  return (houroy);
+}
+
+
+void *Yhourstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int gridsize;
+  int i;
+  int varID;
+  int recID;
+  int gridID;
+  int vdate, vtime;
+  int houroy;
+  int nrecs, nrecords;
+  int levelID;
+  int tsID;
+  int otsID;
+  long nsets[MAX_HOUR];
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  int vdates[MAX_HOUR], vtimes[MAX_HOUR];
+  double missval;
+  field_t **vars1[MAX_HOUR], **vars2[MAX_HOUR], **samp1[MAX_HOUR];
+  field_t field;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("yhourmin",  func_min,  0, NULL);
+  cdoOperatorAdd("yhourmax",  func_max,  0, NULL);
+  cdoOperatorAdd("yhoursum",  func_sum,  0, NULL);
+  cdoOperatorAdd("yhourmean", func_mean, 0, NULL);
+  cdoOperatorAdd("yhouravg",  func_avg,  0, NULL);
+  cdoOperatorAdd("yhourvar",  func_var,  0, NULL);
+  cdoOperatorAdd("yhourstd",  func_std,  0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  for ( houroy = 0; houroy < MAX_HOUR; ++houroy )
+    {
+      vars1[houroy] = NULL;
+      vars2[houroy] = NULL;
+      samp1[houroy] = NULL;
+      nsets[houroy] = 0;
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID2) ) taxisDeleteBounds(taxisID2);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  otsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      if ( cdoVerbose ) cdoPrint("process timestep: %d %d %d", tsID+1, vdate, vtime);
+
+      houroy = hour_of_year(vdate, vtime);
+
+      vdates[houroy] = vdate;
+      vtimes[houroy] = vtime;
+
+      if ( vars1[houroy] == NULL )
+	{
+	  vars1[houroy] = (field_t **) malloc(nvars*sizeof(field_t *));
+	  samp1[houroy] = (field_t **) malloc(nvars*sizeof(field_t *));
+	  if ( operfunc == func_std || operfunc == func_var )
+	    vars2[houroy] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      missval  = vlistInqVarMissval(vlistID1, varID);
+
+	      vars1[houroy][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      samp1[houroy][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      if ( operfunc == func_std || operfunc == func_var )
+		vars2[houroy][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  vars1[houroy][varID][levelID].grid    = gridID;
+		  vars1[houroy][varID][levelID].nmiss   = 0;
+		  vars1[houroy][varID][levelID].missval = missval;
+		  vars1[houroy][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		  samp1[houroy][varID][levelID].grid    = gridID;
+		  samp1[houroy][varID][levelID].nmiss   = 0;
+		  samp1[houroy][varID][levelID].missval = missval;
+		  samp1[houroy][varID][levelID].ptr     = NULL;
+		  if ( operfunc == func_std || operfunc == func_var )
+		    {
+		      vars2[houroy][varID][levelID].grid    = gridID;
+		      vars2[houroy][varID][levelID].nmiss   = 0;
+		      vars2[houroy][varID][levelID].missval = missval;
+		      vars2[houroy][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		    }
+		}
+	    }
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  if ( nsets[houroy] == 0 )
+	    {
+	      streamReadRecord(streamID1, vars1[houroy][varID][levelID].ptr, &nmiss);
+	      vars1[houroy][varID][levelID].nmiss = nmiss;
+
+	      if ( nmiss > 0 || samp1[houroy][varID][levelID].ptr )
+		{
+		  if ( samp1[houroy][varID][levelID].ptr == NULL )
+		    samp1[houroy][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( DBL_IS_EQUAL(vars1[houroy][varID][levelID].ptr[i],
+				      vars1[houroy][varID][levelID].missval) )
+		      samp1[houroy][varID][levelID].ptr[i] = 0;
+		    else
+		      samp1[houroy][varID][levelID].ptr[i] = 1;
+		}
+	    }
+	  else
+	    {
+	      streamReadRecord(streamID1, field.ptr, &field.nmiss);
+	      field.grid    = vars1[houroy][varID][levelID].grid;
+	      field.missval = vars1[houroy][varID][levelID].missval;
+
+	      if ( field.nmiss > 0 || samp1[houroy][varID][levelID].ptr )
+		{
+		  if ( samp1[houroy][varID][levelID].ptr == NULL )
+		    {
+		      samp1[houroy][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+		      for ( i = 0; i < gridsize; i++ )
+			samp1[houroy][varID][levelID].ptr[i] = nsets[houroy];
+		    }
+		  
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( !DBL_IS_EQUAL(field.ptr[i], vars1[houroy][varID][levelID].missval) )
+		      samp1[houroy][varID][levelID].ptr[i]++;
+		}
+
+	      if ( operfunc == func_std || operfunc == func_var )
+		{
+		  farsumq(&vars2[houroy][varID][levelID], field);
+		  farsum(&vars1[houroy][varID][levelID], field);
+		}
+	      else
+		{
+		  farfun(&vars1[houroy][varID][levelID], field, operfunc);
+		}
+	    }
+	}
+
+      if ( nsets[houroy] == 0 && (operfunc == func_std || operfunc == func_var) )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      farmoq(&vars2[houroy][varID][levelID], vars1[houroy][varID][levelID]);
+	  }
+
+      nsets[houroy]++;
+      tsID++;
+    }
+
+  for ( houroy = 0; houroy < MAX_HOUR; ++houroy )
+    if ( nsets[houroy] )
+      {
+	if ( operfunc == func_mean || operfunc == func_avg )
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  if ( samp1[houroy][varID][levelID].ptr == NULL )
+		    farcmul(&vars1[houroy][varID][levelID], 1.0/nsets[houroy]);
+		  else
+		    fardiv(&vars1[houroy][varID][levelID], samp1[houroy][varID][levelID]);
+		}
+	    }
+	else if ( operfunc == func_std || operfunc == func_var )
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  if ( samp1[houroy][varID][levelID].ptr == NULL )
+		    {
+		      if ( operfunc == func_std )
+			farcstd(&vars1[houroy][varID][levelID], vars2[houroy][varID][levelID], 1.0/nsets[houroy]);
+		      else
+			farcvar(&vars1[houroy][varID][levelID], vars2[houroy][varID][levelID], 1.0/nsets[houroy]);
+		    }
+		  else
+		    {
+		      farinv(&samp1[houroy][varID][levelID]);
+		      if ( operfunc == func_std )
+			farstd(&vars1[houroy][varID][levelID], vars2[houroy][varID][levelID], samp1[houroy][varID][levelID]);
+		      else
+			farvar(&vars1[houroy][varID][levelID], vars2[houroy][varID][levelID], samp1[houroy][varID][levelID]);
+		    }
+		}
+	    }
+
+	taxisDefVdate(taxisID2, vdates[houroy]);
+	taxisDefVtime(taxisID2, vtimes[houroy]);
+	streamDefTimestep(streamID2, otsID);
+
+	for ( recID = 0; recID < nrecords; recID++ )
+	  {
+	    varID    = recVarID[recID];
+	    levelID  = recLevelID[recID];
+
+	    if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	    streamDefRecord(streamID2, varID, levelID);
+	    streamWriteRecord(streamID2, vars1[houroy][varID][levelID].ptr,
+			      vars1[houroy][varID][levelID].nmiss);
+	  }
+
+	otsID++;
+      }
+
+  for ( houroy = 0; houroy < MAX_HOUR; ++houroy )
+    {
+      if ( vars1[houroy] != NULL )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  free(vars1[houroy][varID][levelID].ptr);
+		  if ( samp1[houroy][varID][levelID].ptr ) free(samp1[houroy][varID][levelID].ptr);
+		  if ( operfunc == func_std || operfunc == func_var ) free(vars2[houroy][varID][levelID].ptr);
+		}
+	      
+	      free(vars1[houroy][varID]);
+	      free(samp1[houroy][varID]);
+	      if ( operfunc == func_std || operfunc == func_var ) free(vars2[houroy][varID]);
+	    }
+
+	  free(samp1[houroy]);
+	  free(vars1[houroy]);
+	  if ( operfunc == func_std || operfunc == func_var ) free(vars2[houroy]);
+	}
+    }
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Ymonarith.c b/src/Ymonarith.c
new file mode 100644
index 0000000..d6b1204
--- /dev/null
+++ b/src/Ymonarith.c
@@ -0,0 +1,185 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Ymonarith  ymonadd         Add multi-year monthly time series
+      Ymonarith  ymonsub         Subtract multi-year monthly time series
+      Ymonarith  ymonmul         Multiply multi-year monthly time series
+      Ymonarith  ymondiv         Divide multi-year monthly time series
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  MAX_MON    20
+
+void *Ymonarith(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2, streamID3;
+  int gridsize;
+  int nrecs, nvars, nlev, recID;
+  int tsID;
+  int varID, levelID;
+  int offset;
+  int vlistID1, vlistID2, vlistID3;
+  int taxisID1, taxisID2, taxisID3;
+  int vdate, year, mon, day;
+  field_t field1, field2;
+  int **varnmiss2[MAX_MON];
+  double **vardata2[MAX_MON];
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("ymonadd", func_add, 0, NULL);
+  cdoOperatorAdd("ymonsub", func_sub, 0, NULL);
+  cdoOperatorAdd("ymonmul", func_mul, 0, NULL);
+  cdoOperatorAdd("ymondiv", func_div, 0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+
+  gridsize = vlistGridsizeMax(vlistID1);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID3, taxisID3);
+
+  streamID3 = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+
+  streamDefVlist(streamID3, vlistID3);
+
+  nvars  = vlistNvars(vlistID2);
+
+  for ( mon = 0; mon < MAX_MON ; mon++ ) vardata2[mon] = NULL;
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID2, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID2);
+
+      cdiDecodeDate(vdate, &year, &mon, &day);
+      if ( mon < 0 || mon >= MAX_MON ) cdoAbort("Month %d out of range!", mon);
+
+      if ( vardata2[mon] != NULL ) cdoAbort("Month %d already allocatd!", mon);
+
+      vardata2[mon]  = (double **) malloc(nvars*sizeof(double *));
+      varnmiss2[mon] = (int **) malloc(nvars*sizeof(int *));
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  nlev     = zaxisInqSize(vlistInqVarZaxis(vlistID2, varID));
+	  vardata2[mon][varID]  = (double *) malloc(nlev*gridsize*sizeof(double));
+	  varnmiss2[mon][varID] = (int *) malloc(nlev*sizeof(int));
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID2, &varID, &levelID);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  offset   = gridsize*levelID;
+
+	  streamReadRecord(streamID2, vardata2[mon][varID]+offset, &field2.nmiss);
+	  varnmiss2[mon][varID][levelID] = field2.nmiss;
+	}
+
+      tsID++;
+    }
+
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+
+      cdiDecodeDate(vdate, &year, &mon, &day);
+      if ( mon < 0 || mon >= MAX_MON ) cdoAbort("Month %d out of range!", mon);
+
+      taxisCopyTimestep(taxisID3, taxisID1);
+
+      streamDefTimestep(streamID3, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field1.ptr, &field1.nmiss);
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID2, varID));
+	  offset   = gridsize*levelID;
+	  if ( vardata2[mon] == NULL ) cdoAbort("Month %d not found!", mon);
+	  memcpy(field2.ptr, vardata2[mon][varID]+offset, gridsize*sizeof(double));
+	  field2.nmiss = varnmiss2[mon][varID][levelID];
+
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID);
+	  field1.missval = vlistInqVarMissval(vlistID1, varID);
+
+	  field2.grid    = vlistInqVarGrid(vlistID2, varID);
+	  field2.missval = vlistInqVarMissval(vlistID2, varID);
+
+	  farfun(&field1, field2, operfunc);
+
+	  streamDefRecord(streamID3, varID, levelID);
+	  streamWriteRecord(streamID3, field1.ptr, field1.nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  for ( mon = 0; mon < MAX_MON ; mon++ ) 
+    if ( vardata2[mon] )
+      {
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    free(vardata2[mon][varID]);
+	    free(varnmiss2[mon][varID]);
+	  }
+
+	free(vardata2[mon]);
+	free(varnmiss2[mon]);
+      }
+
+  if ( field1.ptr ) free(field1.ptr);
+  if ( field2.ptr ) free(field2.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Ymonpctl.c b/src/Ymonpctl.c
new file mode 100644
index 0000000..a8ace66
--- /dev/null
+++ b/src/Ymonpctl.c
@@ -0,0 +1,277 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Ymonpctl   ymonpctl        Multi-year monthly percentiles
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "percentiles.h"
+
+#define  NMONTH     17
+
+void *Ymonpctl(void *argument)
+{
+  int gridsize;
+  int varID;
+  int recID;
+  int gridID;
+  int vdate, vtime;
+  int year, month, day;
+  int nrecs, nrecords;
+  int levelID;
+  int tsID;
+  int otsID;
+  long nsets[NMONTH];
+  int streamID1, streamID2, streamID3, streamID4;
+  int vlistID1, vlistID2, vlistID3, vlistID4, taxisID1, taxisID2, taxisID3, taxisID4;
+  int nmiss;
+  int nvars, nlevels;
+  int *recVarID, *recLevelID;
+  int vdates1[NMONTH], vtimes1[NMONTH];
+  int vdates2[NMONTH], vtimes2[NMONTH];
+  double missval;
+  field_t **vars1[NMONTH];
+  field_t field;
+  double pn;
+  HISTOGRAM_SET *hsets[NMONTH];
+
+  cdoInitialize(argument);
+  cdoOperatorAdd("ymonpctl", func_pctl, 0, NULL);
+
+  operatorInputArg("percentile number");
+  pn = atof(operatorArgv()[0]);
+      
+  if ( !(pn > 0 && pn < 100) )
+    cdoAbort("Illegal argument: percentile number %g is not in the range 0..100!", pn);
+
+  for ( month = 0; month < NMONTH; month++ )
+    {
+      vars1[month] = NULL;
+      hsets[month] = NULL;
+      nsets[month] = 0;
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  streamID3 = streamOpenRead(cdoStreamName(2));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = streamInqVlist(streamID3);
+  vlistID4 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+  vlistCompare(vlistID1, vlistID3, CMP_ALL);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = vlistInqTaxis(vlistID3);
+  /* TODO - check that time axes 2 and 3 are equal */
+
+  taxisID4 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID4) ) taxisDeleteBounds(taxisID4);
+  vlistDefTaxis(vlistID4, taxisID4);
+
+  streamID4 = streamOpenWrite(cdoStreamName(3), cdoFiletype());
+
+  streamDefVlist(streamID4, vlistID4);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID2, tsID)) )
+    {
+      if ( nrecs != streamInqTimestep(streamID3, tsID) )
+        cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoStreamName(1), cdoStreamName(2));
+      
+      vdate = taxisInqVdate(taxisID2);
+      vtime = taxisInqVtime(taxisID2);
+      
+      if ( vdate != taxisInqVdate(taxisID3) || vtime != taxisInqVtime(taxisID3) )
+        cdoAbort("Verification dates at time step %d of %s and %s differ!", tsID+1, cdoStreamName(1), cdoStreamName(2));
+        
+      if ( cdoVerbose ) cdoPrint("process timestep: %d %d %d", tsID+1, vdate, vtime);
+
+      cdiDecodeDate(vdate, &year, &month, &day);
+      if ( month < 0 || month >= NMONTH )
+	cdoAbort("Month %d out of range!", month);
+
+      vdates2[month] = vdate;
+      vtimes2[month] = vtime;
+
+      if ( vars1[month] == NULL )
+	{
+	  vars1[month] = (field_t **) malloc(nvars*sizeof(field_t *));
+          hsets[month] = hsetCreate(nvars);
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlevels  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      missval  = vlistInqVarMissval(vlistID1, varID);
+
+	      vars1[month][varID] = (field_t *)  malloc(nlevels*sizeof(field_t));
+              hsetCreateVarLevels(hsets[month], varID, nlevels, gridID);
+	      
+	      for ( levelID = 0; levelID < nlevels; levelID++ )
+		{
+		  vars1[month][varID][levelID].grid    = gridID;
+		  vars1[month][varID][levelID].nmiss   = 0;
+		  vars1[month][varID][levelID].missval = missval;
+		  vars1[month][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		}
+	    }
+	}
+      
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID2, &varID, &levelID);
+	  streamReadRecord(streamID2, vars1[month][varID][levelID].ptr, &nmiss);
+          vars1[month][varID][levelID].nmiss = nmiss;
+        }
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID3, &varID, &levelID);
+	  streamReadRecord(streamID3, field.ptr, &nmiss);
+          field.nmiss   = nmiss;
+          field.grid    = vars1[month][varID][levelID].grid;
+	  field.missval = vars1[month][varID][levelID].missval;
+	  
+	  hsetDefVarLevelBounds(hsets[month], varID, levelID, &vars1[month][varID][levelID], &field);
+        }
+      
+      tsID++;
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      if ( cdoVerbose ) cdoPrint("process timestep: %d %d %d", tsID+1, vdate, vtime);
+
+      cdiDecodeDate(vdate, &year, &month, &day);
+      if ( month < 0 || month >= NMONTH )
+	cdoAbort("Month %d out of range!", month);
+
+      vdates1[month] = vdate;
+      vtimes1[month] = vtime;
+
+      if ( vars1[month] == NULL )
+        cdoAbort("No data for month %d in %s and %s", month, cdoStreamName(1), cdoStreamName(2));
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+
+	  streamReadRecord(streamID1, vars1[month][varID][levelID].ptr, &nmiss);
+	  vars1[month][varID][levelID].nmiss = nmiss;
+
+	  hsetAddVarLevelValues(hsets[month], varID, levelID, &vars1[month][varID][levelID]);
+	}
+
+      nsets[month]++;
+      tsID++;
+    }
+
+  otsID = 0;
+  for ( month = 0; month < NMONTH; month++ )
+    if ( nsets[month] )
+      {
+        if ( vdates1[month] != vdates2[month] )
+          cdoAbort("Verification dates for month %d of %s, %s and %s are different!", month, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+        if ( vtimes1[month] != vtimes2[month] )
+          cdoAbort("Verification times for month %d of %s, %s and %s are different!", month, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      
+	    for ( levelID = 0; levelID < nlevels; levelID++ )
+	      hsetGetVarLevelPercentiles(&vars1[month][varID][levelID], hsets[month], varID, levelID, pn);
+	  }
+
+	taxisDefVdate(taxisID4, vdates1[month]);
+	taxisDefVtime(taxisID4, vtimes1[month]);
+	streamDefTimestep(streamID4, otsID);
+
+	for ( recID = 0; recID < nrecords; recID++ )
+	  {
+	    varID    = recVarID[recID];
+	    levelID  = recLevelID[recID];
+
+	    if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	    streamDefRecord(streamID4, varID, levelID);
+	    streamWriteRecord(streamID4, vars1[month][varID][levelID].ptr, vars1[month][varID][levelID].nmiss);
+	  }
+
+	otsID++;
+      }
+
+  for ( month = 0; month < NMONTH; month++ )
+    {
+      if ( vars1[month] != NULL )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevels; levelID++ )
+		free(vars1[month][varID][levelID].ptr);
+	      free(vars1[month][varID]);
+	    }
+	  free(vars1[month]); 
+	  hsetDestroy(hsets[month]);
+	}
+    }
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID4);
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Ymonstat.c b/src/Ymonstat.c
new file mode 100644
index 0000000..2b909fc
--- /dev/null
+++ b/src/Ymonstat.c
@@ -0,0 +1,377 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Ymonstat   ymonmin         Multi-year monthly minimum
+      Ymonstat   ymonmax         Multi-year monthly maximum
+      Ymonstat   ymonsum         Multi-year monthly sum
+      Ymonstat   ymonmean        Multi-year monthly mean
+      Ymonstat   ymonavg         Multi-year monthly average
+      Ymonstat   ymonvar         Multi-year monthly variance
+      Ymonstat   ymonstd         Multi-year monthly standard deviation
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+
+
+#define  NMONTH     17
+
+/*
+static
+int cmpint(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  int *x = (int *) s1;
+  int *y = (int *) s2;
+
+  if      ( *x < *y ) cmp = -1;
+  else if ( *x > *y ) cmp =  1;
+
+  return (cmp);
+}
+*/
+
+void *Ymonstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int gridsize;
+  int i;
+  int varID;
+  int recID;
+  int gridID;
+  int vdate, vtime;
+  int year, month, day;
+  int nrecs, nrecords;
+  int levelID;
+  int tsID;
+  int otsID;
+  long nsets[NMONTH];
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  int vdates[NMONTH], vtimes[NMONTH];
+  int mon[NMONTH];
+  int nmon = 0;
+  double missval;
+  field_t **vars1[NMONTH], **vars2[NMONTH], **samp1[NMONTH];
+  field_t field;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("ymonmin",  func_min,  0, NULL);
+  cdoOperatorAdd("ymonmax",  func_max,  0, NULL);
+  cdoOperatorAdd("ymonsum",  func_sum,  0, NULL);
+  cdoOperatorAdd("ymonmean", func_mean, 0, NULL);
+  cdoOperatorAdd("ymonavg",  func_avg,  0, NULL);
+  cdoOperatorAdd("ymonvar",  func_var,  0, NULL);
+  cdoOperatorAdd("ymonstd",  func_std,  0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  for ( month = 0; month < NMONTH; month++ )
+    {
+      vars1[month] = NULL;
+      vars2[month] = NULL;
+      samp1[month] = NULL;
+      nsets[month] = 0;
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID2) ) taxisDeleteBounds(taxisID2);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  otsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+
+      if ( cdoVerbose ) cdoPrint("process timestep: %d %d %d", tsID+1, vdate, vtime);
+
+      cdiDecodeDate(vdate, &year, &month, &day);
+      if ( month < 0 || month >= NMONTH )
+	cdoAbort("month %d out of range!", month);
+
+      vdates[month] = vdate;
+      vtimes[month] = vtime;
+      // mon[month] = vdate;
+
+      if ( vars1[month] == NULL )
+	{
+	  mon[nmon++] = month;
+	  vars1[month] = (field_t **) malloc(nvars*sizeof(field_t *));
+	  samp1[month] = (field_t **) malloc(nvars*sizeof(field_t *));
+	  if ( operfunc == func_std || operfunc == func_var )
+	    vars2[month] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      missval  = vlistInqVarMissval(vlistID1, varID);
+
+	      vars1[month][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      samp1[month][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      if ( operfunc == func_std || operfunc == func_var )
+		vars2[month][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  vars1[month][varID][levelID].grid    = gridID;
+		  vars1[month][varID][levelID].nmiss   = 0;
+		  vars1[month][varID][levelID].missval = missval;
+		  vars1[month][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		  samp1[month][varID][levelID].grid    = gridID;
+		  samp1[month][varID][levelID].nmiss   = 0;
+		  samp1[month][varID][levelID].missval = missval;
+		  samp1[month][varID][levelID].ptr     = NULL;
+		  if ( operfunc == func_std || operfunc == func_var )
+		    {
+		      vars2[month][varID][levelID].grid    = gridID;
+		      vars2[month][varID][levelID].nmiss   = 0;
+		      vars2[month][varID][levelID].missval = missval;
+		      vars2[month][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		    }
+		}
+	    }
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  if ( nsets[month] == 0 )
+	    {
+	      streamReadRecord(streamID1, vars1[month][varID][levelID].ptr, &nmiss);
+	      vars1[month][varID][levelID].nmiss = nmiss;
+
+	      if ( nmiss > 0 || samp1[month][varID][levelID].ptr )
+		{
+		  if ( samp1[month][varID][levelID].ptr == NULL )
+		    samp1[month][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( DBL_IS_EQUAL(vars1[month][varID][levelID].ptr[i],
+				      vars1[month][varID][levelID].missval) )
+		      samp1[month][varID][levelID].ptr[i] = 0;
+		    else
+		      samp1[month][varID][levelID].ptr[i] = 1;
+		}
+	    }
+	  else
+	    {
+	      streamReadRecord(streamID1, field.ptr, &field.nmiss);
+	      field.grid    = vars1[month][varID][levelID].grid;
+	      field.missval = vars1[month][varID][levelID].missval;
+
+	      if ( field.nmiss > 0 || samp1[month][varID][levelID].ptr )
+		{
+		  if ( samp1[month][varID][levelID].ptr == NULL )
+		    {
+		      samp1[month][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+		      for ( i = 0; i < gridsize; i++ )
+			samp1[month][varID][levelID].ptr[i] = nsets[month];
+		    }
+		  
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( !DBL_IS_EQUAL(field.ptr[i], vars1[month][varID][levelID].missval) )
+		      samp1[month][varID][levelID].ptr[i]++;
+		}
+
+	      if ( operfunc == func_std || operfunc == func_var )
+		{
+		  farsumq(&vars2[month][varID][levelID], field);
+		  farsum(&vars1[month][varID][levelID], field);
+		}
+	      else
+		{
+		  farfun(&vars1[month][varID][levelID], field, operfunc);
+		}
+	    }
+	}
+
+      if ( nsets[month] == 0 && (operfunc == func_std || operfunc == func_var) )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      farmoq(&vars2[month][varID][levelID], vars1[month][varID][levelID]);
+	  }
+
+      nsets[month]++;
+      tsID++;
+    }
+
+  /* sort output time steps */
+  /*
+  nmon = 0;
+  for ( month = 0; month < NMONTH; month++ )
+    {
+      if ( nsets[month] == 0 )
+	for ( i = month+1; i < NMONTH; i++ ) mon[i-1] = mon[i];
+      else
+	nmon++;
+    }
+
+  qsort(mon, nmon, sizeof(int), cmpint);
+	      
+  for ( i = 0; i < nmon; i++ )
+    {
+      cdiDecodeDate(mon[i], &year, &month, &day);
+      mon[i] = month;
+    }
+  */
+  for ( i = 0; i < nmon; i++ )
+    {
+      month = mon[i];
+      if ( nsets[month] == 0 ) cdoAbort("Internal problem, nsets[%d] not defined!", month);
+
+      if ( operfunc == func_mean || operfunc == func_avg )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      {
+		if ( samp1[month][varID][levelID].ptr == NULL )
+		  farcmul(&vars1[month][varID][levelID], 1.0/nsets[month]);
+		else
+		  fardiv(&vars1[month][varID][levelID], samp1[month][varID][levelID]);
+	      }
+	  }
+      else if ( operfunc == func_std || operfunc == func_var )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      {
+		if ( samp1[month][varID][levelID].ptr == NULL )
+		  {
+		    if ( operfunc == func_std )
+		      farcstd(&vars1[month][varID][levelID], vars2[month][varID][levelID], 1.0/nsets[month]);
+		    else
+		      farcvar(&vars1[month][varID][levelID], vars2[month][varID][levelID], 1.0/nsets[month]);
+		  }
+		else
+		  {
+		    farinv(&samp1[month][varID][levelID]);
+		    if ( operfunc == func_std )
+		      farstd(&vars1[month][varID][levelID], vars2[month][varID][levelID], samp1[month][varID][levelID]);
+		    else
+		      farvar(&vars1[month][varID][levelID], vars2[month][varID][levelID], samp1[month][varID][levelID]);
+		  }
+	      }
+	  }
+
+      taxisDefVdate(taxisID2, vdates[month]);
+      taxisDefVtime(taxisID2, vtimes[month]);
+      streamDefTimestep(streamID2, otsID);
+
+      for ( recID = 0; recID < nrecords; recID++ )
+	{
+	  varID    = recVarID[recID];
+	  levelID  = recLevelID[recID];
+	  
+	  if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	  streamDefRecord(streamID2, varID, levelID);
+	  streamWriteRecord(streamID2, vars1[month][varID][levelID].ptr,
+			    vars1[month][varID][levelID].nmiss);
+	}
+
+      otsID++;
+    }
+
+  for ( month = 0; month < NMONTH; month++ )
+    {
+      if ( vars1[month] != NULL )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  free(vars1[month][varID][levelID].ptr);
+		  if ( samp1[month][varID][levelID].ptr ) free(samp1[month][varID][levelID].ptr);
+		  if ( operfunc == func_std || operfunc == func_var ) free(vars2[month][varID][levelID].ptr);
+		}
+	      
+	      free(vars1[month][varID]);
+	      free(samp1[month][varID]);
+	      if ( operfunc == func_std || operfunc == func_var ) free(vars2[month][varID]);
+	    }
+
+	  free(vars1[month]);
+	  free(samp1[month]);
+	  if ( operfunc == func_std || operfunc == func_var ) free(vars2[month]);
+	}
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Yseaspctl.c b/src/Yseaspctl.c
new file mode 100644
index 0000000..8c04289
--- /dev/null
+++ b/src/Yseaspctl.c
@@ -0,0 +1,303 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Yseaspctl  yseaspctl       Multi-year seasonally percentiles
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "percentiles.h"
+#include "util.h"
+
+#define  NSEAS       4
+
+void *Yseaspctl(void *argument)
+{
+  int gridsize;
+  int varID;
+  int recID;
+  int gridID;
+  int vdate, vtime;
+  int year, month, day, seas;
+  int nrecs, nrecords;
+  int levelID;
+  int tsID;
+  int otsID;
+  long nsets[NSEAS];
+  int streamID1, streamID2, streamID3, streamID4;
+  int vlistID1, vlistID2, vlistID3, vlistID4, taxisID1, taxisID2, taxisID3, taxisID4;
+  int nmiss;
+  int nvars, nlevels;
+  int *recVarID, *recLevelID;
+  int vdates1[NSEAS], vtimes1[NSEAS];
+  int vdates2[NSEAS], vtimes2[NSEAS];
+  double missval;
+  field_t **vars1[NSEAS];
+  field_t field;
+  double pn;
+  HISTOGRAM_SET *hsets[NSEAS];
+  int season_start;
+
+  cdoInitialize(argument);
+  cdoOperatorAdd("yseaspctl", func_pctl, 0, NULL);
+
+  operatorInputArg("percentile number");
+  pn = atof(operatorArgv()[0]);
+      
+  if ( !(pn > 0 && pn < 100) )
+    cdoAbort("Illegal argument: percentile number %g is not in the range 0..100!", pn);
+
+  season_start = get_season_start();
+  for ( seas = 0; seas < NSEAS; seas++ )
+    {
+      vars1[seas] = NULL;
+      hsets[seas] = NULL;
+      nsets[seas] = 0;
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+  streamID2 = streamOpenRead(cdoStreamName(1));
+  streamID3 = streamOpenRead(cdoStreamName(2));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = streamInqVlist(streamID2);
+  vlistID3 = streamInqVlist(streamID3);
+  vlistID4 = vlistDuplicate(vlistID1);
+
+  vlistCompare(vlistID1, vlistID2, CMP_ALL);
+  vlistCompare(vlistID1, vlistID3, CMP_ALL);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = vlistInqTaxis(vlistID2);
+  taxisID3 = vlistInqTaxis(vlistID3);
+  /* TODO - check that time axes 2 and 3 are equal */
+
+  taxisID4 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID4) ) taxisDeleteBounds(taxisID4);
+  vlistDefTaxis(vlistID4, taxisID4);
+
+  streamID4 = streamOpenWrite(cdoStreamName(3), cdoFiletype());
+
+  streamDefVlist(streamID4, vlistID4);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID2, tsID)) )
+    {
+      if ( nrecs != streamInqTimestep(streamID3, tsID) )
+        cdoAbort("Number of records at time step %d of %s and %s differ!", tsID+1, cdoStreamName(1), cdoStreamName(2));
+      
+      vdate = taxisInqVdate(taxisID2);
+      vtime = taxisInqVtime(taxisID2);
+      
+      if ( vdate != taxisInqVdate(taxisID3) || vtime != taxisInqVtime(taxisID3) )
+        cdoAbort("Verification dates at time step %d of %s and %s differ!", tsID+1, cdoStreamName(1), cdoStreamName(2));
+        
+      if ( cdoVerbose ) cdoPrint("process timestep: %d %d %d", tsID+1, vdate, vtime);
+
+      cdiDecodeDate(vdate, &year, &month, &day);
+      if ( month < 0 || month > 16 )
+	cdoAbort("Month %d out of range!", month);
+
+      if ( season_start == START_DEC )
+	{
+	  if ( month <= 12 )
+	    seas = (month % 12) / 3;
+	  else
+	    seas = month - 13;
+	}
+      else
+	{
+	  if ( month <= 12 )
+	    seas = (month - 1) / 3;
+	  else
+	    seas = month - 13;
+	}
+
+      if ( seas < 0 || seas > 3 )
+	cdoAbort("Season %d out of range!", seas+1);
+
+      vdates2[seas] = vdate;
+      vtimes2[seas] = vtime;
+
+      if ( vars1[seas] == NULL )
+	{
+	  vars1[seas] = (field_t **) malloc(nvars*sizeof(field_t *));
+          hsets[seas] = hsetCreate(nvars);
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlevels  = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      missval  = vlistInqVarMissval(vlistID1, varID);
+
+	      vars1[seas][varID] = (field_t *)  malloc(nlevels*sizeof(field_t));
+              hsetCreateVarLevels(hsets[seas], varID, nlevels, gridID);
+	      
+	      for ( levelID = 0; levelID < nlevels; levelID++ )
+		{
+		  vars1[seas][varID][levelID].grid    = gridID;
+		  vars1[seas][varID][levelID].nmiss   = 0;
+		  vars1[seas][varID][levelID].missval = missval;
+		  vars1[seas][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		}
+	    }
+	}
+      
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID2, &varID, &levelID);
+	  streamReadRecord(streamID2, vars1[seas][varID][levelID].ptr, &nmiss);
+          vars1[seas][varID][levelID].nmiss = nmiss;
+        }
+      for ( recID = 0; recID < nrecs; recID++ )
+        {
+          streamInqRecord(streamID3, &varID, &levelID);
+	  streamReadRecord(streamID3, field.ptr, &nmiss);
+          field.nmiss   = nmiss;
+          field.grid    = vars1[seas][varID][levelID].grid;
+	  field.missval = vars1[seas][varID][levelID].missval;
+	  
+	  hsetDefVarLevelBounds(hsets[seas], varID, levelID, &vars1[seas][varID][levelID], &field);
+        }
+      
+      tsID++;
+    }
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+      
+      cdiDecodeDate(vdate, &year, &month, &day);
+      if ( month < 0 || month > 16 )
+	cdoAbort("Month %d out of range!", month);
+
+      if ( month <= 12 )
+	seas = (month % 12) / 3;
+      else
+	seas = month - 13;
+      if ( seas < 0 || seas > 3 )
+	cdoAbort("Season %d out of range!", seas+1);
+
+      vdates1[seas] = vdate;
+      vtimes1[seas] = vtime;
+
+      if ( vars1[seas] == NULL )
+        cdoAbort("No data for season %d in %s and %s", seas, cdoStreamName(1), cdoStreamName(2));
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+
+	  streamReadRecord(streamID1, vars1[seas][varID][levelID].ptr, &nmiss);
+	  vars1[seas][varID][levelID].nmiss = nmiss;
+	  
+	  hsetAddVarLevelValues(hsets[seas], varID, levelID, &vars1[seas][varID][levelID]);
+	}
+
+      nsets[seas]++;
+      tsID++;
+    }
+
+  otsID = 0;
+  for ( seas = 0; seas < NSEAS; seas++ )
+    if ( nsets[seas] )
+      {
+        if ( vdates1[seas] != vdates2[seas] )
+          cdoAbort("Verification dates for season %d of %s, %s and %s are different!", seas, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+        if ( vtimes1[seas] != vtimes2[seas] )
+          cdoAbort("Verification times for season %d of %s, %s and %s are different!", seas, cdoStreamName(1), cdoStreamName(2), cdoStreamName(3));
+
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    
+	    for ( levelID = 0; levelID < nlevels; levelID++ )
+	      hsetGetVarLevelPercentiles(&vars1[seas][varID][levelID], hsets[seas], varID, levelID, pn);
+	  }
+
+	taxisDefVdate(taxisID4, vdates1[seas]);
+	taxisDefVtime(taxisID4, vtimes1[seas]);
+	streamDefTimestep(streamID4, otsID);
+
+	for ( recID = 0; recID < nrecords; recID++ )
+	  {
+	    varID    = recVarID[recID];
+	    levelID  = recLevelID[recID];
+
+	    if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	    streamDefRecord(streamID4, varID, levelID);
+	    streamWriteRecord(streamID4, vars1[seas][varID][levelID].ptr, vars1[seas][varID][levelID].nmiss);
+	  }
+
+	otsID++;
+      }
+
+  for ( seas = 0; seas < NSEAS; seas++ )
+    {
+      if ( vars1[seas] != NULL )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      nlevels = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevels; levelID++ )
+		free(vars1[seas][varID][levelID].ptr);
+	      free(vars1[seas][varID]);
+	    }
+	  free(vars1[seas]); 
+	  hsetDestroy(hsets[seas]);
+	}
+    }
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID4);
+  streamClose(streamID3);
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Yseasstat.c b/src/Yseasstat.c
new file mode 100644
index 0000000..f585935
--- /dev/null
+++ b/src/Yseasstat.c
@@ -0,0 +1,378 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Yseasstat  yseasmin        Multi-year seasonally minimum
+      Yseasstat  yseasmax        Multi-year seasonally maximum
+      Yseasstat  yseassum        Multi-year seasonally sum
+      Yseasstat  yseasmean       Multi-year seasonally mean
+      Yseasstat  yseasavg        Multi-year seasonally average
+      Yseasstat  yseasvar        Multi-year seasonally variance
+      Yseasstat  yseasstd        Multi-year seasonally standard deviation
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "util.h"
+
+
+#define  NSEAS       4
+
+typedef struct {
+  int vdate;
+  int vtime;
+}
+date_time_t;
+
+
+static 
+void set_date(int vdate_new, int vtime_new, date_time_t *datetime)
+{
+  int year, month, day;
+
+  cdiDecodeDate(vdate_new, &year, &month, &day);
+  if ( month == 12 ) vdate_new = cdiEncodeDate(year-1, month, day);
+
+  if ( vdate_new > datetime->vdate )
+    {
+      datetime->vdate = vdate_new;
+      datetime->vtime = vtime_new;
+    }
+}
+
+
+void *Yseasstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int gridsize;
+  int i;
+  int varID;
+  int recID;
+  int gridID;
+  int vdate, vtime;
+  int year, month, day, seas;
+  int nrecs, nrecords;
+  int levelID;
+  int tsID;
+  int otsID;
+  long nsets[NSEAS];
+  int streamID1, streamID2;
+  int vlistID1, vlistID2, taxisID1, taxisID2;
+  int nmiss;
+  int nvars, nlevel;
+  int *recVarID, *recLevelID;
+  date_time_t datetime[NSEAS];
+  double missval;
+  field_t **vars1[NSEAS], **vars2[NSEAS], **samp1[NSEAS];
+  field_t field;
+  int season_start;
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("yseasmin",  func_min,  0, NULL);
+  cdoOperatorAdd("yseasmax",  func_max,  0, NULL);
+  cdoOperatorAdd("yseassum",  func_sum,  0, NULL);
+  cdoOperatorAdd("yseasmean", func_mean, 0, NULL);
+  cdoOperatorAdd("yseasavg",  func_avg,  0, NULL);
+  cdoOperatorAdd("yseasvar",  func_var,  0, NULL);
+  cdoOperatorAdd("yseasstd",  func_std,  0, NULL);
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  season_start = get_season_start();
+  for ( seas = 0; seas < NSEAS; seas++ )
+    {
+      vars1[seas]  = NULL;
+      vars2[seas]  = NULL;
+      samp1[seas]  = NULL;
+      nsets[seas]  = 0;
+      datetime[seas].vdate = 0;
+      datetime[seas].vtime = 0;
+    }
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  if ( taxisHasBounds(taxisID2) ) taxisDeleteBounds(taxisID2);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  nvars    = vlistNvars(vlistID1);
+  nrecords = vlistNrecs(vlistID1);
+
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = vlistGridsizeMax(vlistID1);
+  field.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  tsID = 0;
+  otsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      vdate = taxisInqVdate(taxisID1);
+      vtime = taxisInqVtime(taxisID1);
+      cdiDecodeDate(vdate, &year, &month, &day);
+      if ( month < 0 || month > 16 )
+	cdoAbort("Month %d out of range!", month);
+
+      if ( season_start == START_DEC )
+	{
+	  if ( month <= 12 )
+	    seas = (month % 12) / 3;
+	  else
+	    seas = month - 13;
+	}
+      else
+	{
+	  if ( month <= 12 )
+	    seas = (month - 1) / 3;
+	  else
+	    seas = month - 13;
+	}
+
+      if ( seas < 0 || seas > 3 )
+	cdoAbort("Season %d out of range!", seas+1);
+
+      set_date(vdate, vtime, &datetime[seas]);
+
+      if ( vars1[seas] == NULL )
+	{
+	  vars1[seas] = (field_t **) malloc(nvars*sizeof(field_t *));
+	  samp1[seas] = (field_t **) malloc(nvars*sizeof(field_t *));
+	  if ( operfunc == func_std || operfunc == func_var )
+	    vars2[seas] = (field_t **) malloc(nvars*sizeof(field_t *));
+
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      gridID   = vlistInqVarGrid(vlistID1, varID);
+	      gridsize = gridInqSize(gridID);
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      missval  = vlistInqVarMissval(vlistID1, varID);
+
+	      vars1[seas][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      samp1[seas][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      if ( operfunc == func_std || operfunc == func_var )
+		vars2[seas][varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+	      
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  vars1[seas][varID][levelID].grid    = gridID;
+		  vars1[seas][varID][levelID].nmiss   = 0;
+		  vars1[seas][varID][levelID].missval = missval;
+		  vars1[seas][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		  samp1[seas][varID][levelID].grid    = gridID;
+		  samp1[seas][varID][levelID].nmiss   = 0;
+		  samp1[seas][varID][levelID].missval = missval;
+		  samp1[seas][varID][levelID].ptr     = NULL;
+		  if ( operfunc == func_std || operfunc == func_var )
+		    {
+		      vars2[seas][varID][levelID].grid    = gridID;
+		      vars2[seas][varID][levelID].nmiss   = 0;
+		      vars2[seas][varID][levelID].missval = missval;
+		      vars2[seas][varID][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+		    }
+		}
+	    }
+	}
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+
+	  if ( tsID == 0 )
+	    {
+	      recVarID[recID]   = varID;
+	      recLevelID[recID] = levelID;
+	    }
+
+	  gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+
+	  if ( nsets[seas] == 0 )
+	    {
+	      streamReadRecord(streamID1, vars1[seas][varID][levelID].ptr, &nmiss);
+	      vars1[seas][varID][levelID].nmiss = nmiss;
+
+	      if ( nmiss > 0 || samp1[seas][varID][levelID].ptr )
+		{
+		  if ( samp1[seas][varID][levelID].ptr == NULL )
+		    samp1[seas][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( DBL_IS_EQUAL(vars1[seas][varID][levelID].ptr[i],
+				      vars1[seas][varID][levelID].missval) )
+		      samp1[seas][varID][levelID].ptr[i] = 0;
+		    else
+		      samp1[seas][varID][levelID].ptr[i] = 1;
+		}
+	    }
+	  else
+	    {
+	      streamReadRecord(streamID1, field.ptr, &field.nmiss);
+	      field.grid    = vars1[seas][varID][levelID].grid;
+	      field.missval = vars1[seas][varID][levelID].missval;
+
+	      if ( field.nmiss > 0 || samp1[seas][varID][levelID].ptr )
+		{
+		  if ( samp1[seas][varID][levelID].ptr == NULL )
+		    {
+		      samp1[seas][varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+		      for ( i = 0; i < gridsize; i++ )
+			samp1[seas][varID][levelID].ptr[i] = nsets[seas];
+		    }
+		  
+		  for ( i = 0; i < gridsize; i++ )
+		    if ( !DBL_IS_EQUAL(field.ptr[i], vars1[seas][varID][levelID].missval) )
+		      samp1[seas][varID][levelID].ptr[i]++;
+		}
+
+	      if ( operfunc == func_std || operfunc == func_var )
+		{
+		  farsumq(&vars2[seas][varID][levelID], field);
+		  farsum(&vars1[seas][varID][levelID], field);
+		}
+	      else
+		{
+		  farfun(&vars1[seas][varID][levelID], field, operfunc);
+		}
+	    }
+	}
+
+      if ( nsets[seas] == 0 && (operfunc == func_std || operfunc == func_var) )
+	for ( varID = 0; varID < nvars; varID++ )
+	  {
+	    if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	    gridsize = gridInqSize(vlistInqVarGrid(vlistID1, varID));
+	    nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	    for ( levelID = 0; levelID < nlevel; levelID++ )
+	      farmoq(&vars2[seas][varID][levelID], vars1[seas][varID][levelID]);
+	  }
+
+      nsets[seas]++;
+      tsID++;
+    }
+
+  for ( seas = 0; seas < NSEAS; seas++ )
+    if ( nsets[seas] )
+      {
+	if ( operfunc == func_mean || operfunc == func_avg )
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  if ( samp1[seas][varID][levelID].ptr == NULL )
+		    farcmul(&vars1[seas][varID][levelID], 1.0/nsets[seas]);
+		  else
+		    fardiv(&vars1[seas][varID][levelID], samp1[seas][varID][levelID]);
+		}
+	    }
+	else if ( operfunc == func_std || operfunc == func_var )
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      if ( vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+	      nlevel   = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  if ( samp1[seas][varID][levelID].ptr == NULL )
+		    {
+		      if ( operfunc == func_std )
+			farcstd(&vars1[seas][varID][levelID], vars2[seas][varID][levelID], 1.0/nsets[seas]);
+		      else
+			farcvar(&vars1[seas][varID][levelID], vars2[seas][varID][levelID], 1.0/nsets[seas]);
+		    }
+		  else
+		    {
+		      farinv(&samp1[seas][varID][levelID]);
+		      if ( operfunc == func_std )
+			farstd(&vars1[seas][varID][levelID], vars2[seas][varID][levelID], samp1[seas][varID][levelID]);
+		      else
+			farvar(&vars1[seas][varID][levelID], vars2[seas][varID][levelID], samp1[seas][varID][levelID]);
+		    }
+		}
+	    }
+
+	taxisDefVdate(taxisID2, datetime[seas].vdate);
+	taxisDefVtime(taxisID2, datetime[seas].vtime);
+	streamDefTimestep(streamID2, otsID);
+
+	for ( recID = 0; recID < nrecords; recID++ )
+	  {
+	    varID    = recVarID[recID];
+	    levelID  = recLevelID[recID];
+
+	    if ( otsID && vlistInqVarTsteptype(vlistID1, varID) == TSTEP_CONSTANT ) continue;
+
+	    streamDefRecord(streamID2, varID, levelID);
+	    streamWriteRecord(streamID2, vars1[seas][varID][levelID].ptr,
+			      vars1[seas][varID][levelID].nmiss);
+	  }
+
+	otsID++;
+      }
+
+  for ( seas = 0; seas < NSEAS; seas++ )
+    {
+      if ( vars1[seas] != NULL )
+	{
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID1, varID));
+	      for ( levelID = 0; levelID < nlevel; levelID++ )
+		{
+		  free(vars1[seas][varID][levelID].ptr);
+		  if ( samp1[seas][varID][levelID].ptr ) free(samp1[seas][varID][levelID].ptr);
+		  if ( operfunc == func_std || operfunc == func_var ) free(vars2[seas][varID][levelID].ptr);
+		}
+	      
+	      free(vars1[seas][varID]);
+	      free(samp1[seas][varID]);
+	      if ( operfunc == func_std || operfunc == func_var ) free(vars2[seas][varID]);
+	    }
+
+	  free(vars1[seas]);
+	  free(samp1[seas]);
+	  if ( operfunc == func_std || operfunc == func_var ) free(vars2[seas]);
+	}
+    }
+
+  if ( field.ptr ) free(field.ptr);
+
+  if ( recVarID   ) free(recVarID);
+  if ( recLevelID ) free(recLevelID);
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/Zonstat.c b/src/Zonstat.c
new file mode 100644
index 0000000..bb71214
--- /dev/null
+++ b/src/Zonstat.c
@@ -0,0 +1,191 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.1
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/*
+   This module contains the following operators:
+
+      Zonstat    zonmin          Zonal minimum
+      Zonstat    zonmax          Zonal maximum
+      Zonstat    zonrange        Zonal range
+      Zonstat    zonsum          Zonal sum
+      Zonstat    zonmean         Zonal mean
+      Zonstat    zonavg          Zonal average
+      Zonstat    zonstd          Zonal standard deviation
+      Zonstat    zonvar          Zonal variance
+      Zonstat    zonpctl         Zonal percentiles
+*/
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "grid.h"
+#include "pstream.h"
+
+
+void *Zonstat(void *argument)
+{
+  int operatorID;
+  int operfunc;
+  int streamID1, streamID2;
+  int vlistID1, vlistID2;
+  int gridID1 = -1, gridID2 = -1;
+  int zongridID = -1;
+  int nlatmax;
+  int index, ngrids;
+  int recID, nrecs;
+  int tsID, varID, levelID;
+  int lim;
+  int ndiffgrids;
+  int taxisID1, taxisID2;
+  field_t field1, field2;
+  /* RQ */
+  int pn = 0;
+  /* QR */
+
+  cdoInitialize(argument);
+
+  cdoOperatorAdd("zonmin",   func_min,   0, NULL);
+  cdoOperatorAdd("zonmax",   func_max,   0, NULL);
+  cdoOperatorAdd("zonrange", func_range, 0, NULL);
+  cdoOperatorAdd("zonsum",   func_sum,   0, NULL);
+  cdoOperatorAdd("zonmean",  func_mean,  0, NULL);
+  cdoOperatorAdd("zonavg",   func_avg,   0, NULL);
+  cdoOperatorAdd("zonvar",   func_var,   0, NULL);
+  cdoOperatorAdd("zonstd",   func_std,   0, NULL);
+  /* RQ */
+  cdoOperatorAdd("zonpctl",  func_pctl,  0, NULL);
+  /* QR */
+
+  operatorID = cdoOperatorID();
+  operfunc = cdoOperatorF1(operatorID);
+
+  /* RQ */
+  if ( operfunc == func_pctl )
+    {
+      operatorInputArg("percentile number");
+      pn = atoi(operatorArgv()[0]);
+      
+      if ( pn < 1 || pn > 99 )
+        cdoAbort("Illegal argument: percentile number %d is not in the range 1..99!", pn);
+    }
+  /* QR */
+
+  streamID1 = streamOpenRead(cdoStreamName(0));
+
+  vlistID1 = streamInqVlist(streamID1);
+  vlistID2 = vlistDuplicate(vlistID1);
+
+  taxisID1 = vlistInqTaxis(vlistID1);
+  taxisID2 = taxisDuplicate(taxisID1);
+  vlistDefTaxis(vlistID2, taxisID2);
+
+  ngrids = vlistNgrids(vlistID1);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( gridInqXsize(vlistGrid(vlistID1, index)) > 1 ) 
+	{
+	  if ( gridID1 == -1 ) gridID1 = vlistGrid(vlistID1, index);
+	}
+      else
+	{
+	  if ( zongridID == -1 ) zongridID = vlistGrid(vlistID1, index);
+	}
+    }
+
+  ndiffgrids = 0;
+  for ( index = 0; index < ngrids; index++ )
+    {
+      if ( zongridID != -1 && zongridID == vlistGrid(vlistID1, index) ) continue;
+      if ( gridID1 != vlistGrid(vlistID1, index) ) ndiffgrids++;
+    }
+  if ( ndiffgrids > 0 ) cdoAbort("Too many different grids!");
+
+  if ( gridInqType(gridID1) == GRID_LONLAT   ||
+       gridInqType(gridID1) == GRID_GAUSSIAN ||
+       gridInqType(gridID1) == GRID_GENERIC )
+    {
+      if ( zongridID != -1 && gridInqYsize(zongridID) == gridInqYsize(gridID1) )
+	gridID2 = zongridID;
+      else
+	gridID2 = gridToZonal(gridID1);
+    }
+  else
+    {
+      cdoAbort("Unsupported gridtype: %s", gridNamePtr(gridInqType(gridID1)));
+    }
+
+  for ( index = 0; index < ngrids; index++ )
+    vlistChangeGridIndex(vlistID2, index, gridID2);
+
+  streamID2 = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+
+  streamDefVlist(streamID2, vlistID2);
+
+  gridID1 = vlistInqVarGrid(vlistID1, 0);
+  nlatmax = gridInqYsize(gridID1); /* max nlat ? */
+
+  lim = vlistGridsizeMax(vlistID1);
+  field1.ptr  = (double *) malloc(lim*sizeof(double));
+  field2.ptr  = (double *) malloc(nlatmax*sizeof(double));
+  field2.grid = gridID2;
+
+  tsID = 0;
+  while ( (nrecs = streamInqTimestep(streamID1, tsID)) )
+    {
+      taxisCopyTimestep(taxisID2, taxisID1);
+
+      streamDefTimestep(streamID2, tsID);
+
+      for ( recID = 0; recID < nrecs; recID++ )
+	{
+	  streamInqRecord(streamID1, &varID, &levelID);
+	  streamReadRecord(streamID1, field1.ptr, &field1.nmiss);
+
+	  field1.grid    = vlistInqVarGrid(vlistID1, varID);
+	  field1.missval = vlistInqVarMissval(vlistID1, varID);
+	  field2.missval = vlistInqVarMissval(vlistID1, varID);
+
+	  if ( zongridID != -1 && zongridID == field1.grid )
+	    {
+	      memcpy(field2.ptr, field1.ptr, nlatmax*sizeof(double));
+	      field2.nmiss = field1.nmiss;
+	    }
+	  else
+	    {
+	      if ( operfunc == func_pctl )
+		zonpctl(field1, & field2, pn);
+	      else  
+		zonfun(field1, &field2, operfunc);
+	    }
+
+	  streamDefRecord(streamID2, varID,  levelID);
+	  streamWriteRecord(streamID2, field2.ptr, field2.nmiss);
+	}
+      tsID++;
+    }
+
+  streamClose(streamID2);
+  streamClose(streamID1);
+
+  if ( field1.ptr ) free(field1.ptr);
+  if ( field2.ptr ) free(field2.ptr);
+
+  cdoFinish();
+
+  return (0);
+}
diff --git a/src/cdo.c b/src/cdo.c
new file mode 100644
index 0000000..85ef5bb
--- /dev/null
+++ b/src/cdo.c
@@ -0,0 +1,1200 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <limits.h>
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+/*#include <malloc.h>*/ /* mallopt and malloc_stats */
+#if  defined (HAVE_GETRLIMIT)
+#if  defined (HAVE_SYS_RESOURCE_H)
+#include <sys/time.h>       /* getrlimit */
+#include <sys/resource.h>   /* getrlimit */
+#endif
+#endif
+#include <unistd.h>         /* sysconf, gethostname */
+
+#if defined (SX)
+#define RLIM_T  long long
+#else
+#define RLIM_T  rlim_t
+#endif
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+
+
+#if  defined  (HAVE_LIBPTHREAD)
+#include "pstream_int.h"
+#include "pthread_debug.h"
+#endif
+
+#include "modules.h"
+#include "util.h"
+
+#if defined (_OPENMP)
+#  include <omp.h>
+#endif
+
+#if ! defined (VERSION)
+#  define  VERSION  "0.0.1"
+#endif
+
+char CDO_Version[] = "Climate Data Operators version "VERSION" (http://code.zmaw.de/projects/cdo)";
+
+
+char *Progname;
+
+int ompNumThreads = 1;
+
+int cdoDefaultFileType   = CDI_UNDEFID;
+int cdoDefaultDataType   = CDI_UNDEFID;
+int cdoDefaultTimeType   = CDI_UNDEFID;
+int cdoDefaultByteorder  = CDI_UNDEFID;
+int cdoDefaultTableID    = CDI_UNDEFID;
+
+int cdoLockIO            = FALSE;
+int cdoCheckDatarange    = FALSE;
+
+int cdoDiag              = FALSE;
+int cdoDisableHistory    = FALSE;
+int cdoCompType          = COMPRESS_NONE;  // compression type
+int cdoCompLevel         = 0;              // compression level
+int cdoChunkType         = CDI_UNDEFID;
+int cdoLogOff            = FALSE;
+int cdoSilentMode        = FALSE;
+int cdoOverwriteMode     = FALSE;
+int cdoBenchmark         = FALSE;
+int cdoTimer             = FALSE;
+int cdoVerbose           = FALSE;
+int cdoDebug             = 0;
+int cdoCompress          = FALSE;
+int cdoInteractive       = FALSE;
+int cdoParIO             = FALSE;
+int cdoRegulargrid       = FALSE;
+
+#define MAX_NUM_VARNAMES 256
+int cdoNumVarnames       = 0;
+char **cdoVarnames       = NULL;
+
+char cdo_file_suffix[32];
+
+int cdoExpMode           = -1;
+char *cdoExpName         = NULL;
+void exp_run(int argc, char *argv[], char *cdoExpName);
+
+
+int timer_total, timer_read, timer_write;
+
+
+#define PRINT_RLIMIT(resource) \
+      { \
+	int status; \
+	struct rlimit rlim; \
+	status = getrlimit(resource, &rlim); \
+	if ( status == 0 ) \
+	  { \
+	    if ( sizeof(RLIM_T) > sizeof(long) ) \
+	      { \
+		fprintf(stderr, "CUR %-15s = %llu\n", #resource, (long long) rlim.rlim_cur); \
+		fprintf(stderr, "MAX %-15s = %llu\n", #resource, (long long) rlim.rlim_max); \
+	      } \
+	    else \
+	      { \
+		fprintf(stderr, "CUR %-15s = %lu\n", #resource, (long) rlim.rlim_cur); \
+		fprintf(stderr, "MAX %-15s = %lu\n", #resource, (long) rlim.rlim_max); \
+	      } \
+	  } \
+      }
+
+
+static
+void cdo_version(void)
+{
+  fprintf(stderr, "%s\n", CDO_Version);
+#if defined (COMPILER)
+  fprintf(stderr, "Compiler: %s\n", COMPILER);
+#endif
+#if defined (COMP_VERSION)
+  fprintf(stderr, " version: %s\n", COMP_VERSION);
+#endif
+  fprintf(stderr, "    with:");
+#if defined (HAVE_LIBPTHREAD)
+  fprintf(stderr, " PTHREADS");
+#endif
+#if defined (_OPENMP)
+  fprintf(stderr, " OpenMP");
+#endif
+#if  defined  (HAVE_NETCDF4)
+  fprintf(stderr, " NC4");
+#endif
+#if  defined  (HAVE_LIBNC_DAP)
+  fprintf(stderr, " OPeNDAP");
+#endif
+#if defined (HAVE_LIBSZ)
+  fprintf(stderr, " SZ");
+#endif
+#if defined (HAVE_LIBZ)
+  fprintf(stderr, " Z");
+#endif
+#if defined (HAVE_LIBJASPER)
+  fprintf(stderr, " JASPER");
+#endif
+#if defined (HAVE_LIBUDUNITS2)
+  fprintf(stderr, " UDUNITS2");
+#endif
+#if defined (HAVE_LIBPROJ)
+  fprintf(stderr, " PROJ.4");
+#endif
+#if defined (HAVE_LIBXML2)
+  fprintf(stderr, " XML2");
+#endif
+#if defined (HAVE_LIBMAGICS)
+  fprintf(stderr, " MAGICS");
+#endif
+#if defined (HAVE_LIBDRMAA)
+  fprintf(stderr, " DRMAA");
+#endif
+#if defined (HAVE_LIBCURL)
+  fprintf(stderr, " CURL");
+#endif
+  fprintf(stderr, "\n");
+#if defined (USER_NAME) && defined(HOST_NAME) && defined(SYSTEM_TYPE)
+  fprintf(stderr, "Compiled: by %s on %s (%s) %s %s\n",
+	  USER_NAME, HOST_NAME, SYSTEM_TYPE, __DATE__, __TIME__);
+#endif
+  cdiPrintVersion();
+  fprintf(stderr, "\n");
+}
+
+static
+void usage(void)
+{
+  int id = 0;
+  char *name;
+
+  /*  fprintf(stderr, "%s\n", CDO_Version);*/
+  /*  fprintf(stderr, "\n");*/
+  fprintf(stderr, "usage : cdo  [Options]  Operator1  [-Operator2  [-OperatorN]]\n");
+  fprintf(stderr, "\n");
+  fprintf(stderr, "  Options:\n");
+  fprintf(stderr, "    -a             Generate an absolute time axis\n");
+  fprintf(stderr, "    -b <nbits>     Set the number of bits for the output precision\n");
+  fprintf(stderr, "                   (I8/I16/I32/F32/F64 for nc/nc2/nc4/nc4c; F32/F64 for grb2/srv/ext/ieg; P1 - P24 for grb/grb2)\n");
+  fprintf(stderr, "                   Add L or B to set the byteorder to Little or Big endian\n");
+  fprintf(stderr, "    -f <format>    Format of the output file. (grb/grb2/nc/nc2/nc4/nc4c/srv/ext/ieg)\n");
+  fprintf(stderr, "    -g <grid>      Set default grid name or file. Available grids: \n");
+  fprintf(stderr, "                   n<N>, t<RES>, tl<RES>, r<NX>x<NY>, g<NX>x<NY>, gme<NI>, lon=<LON>/lat=<LAT>\n");
+  fprintf(stderr, "    -h             Help information for the operators\n");
+  /*
+  fprintf(stderr, "    -i <inst>      Institution name/file\n");
+  fprintf(stderr, "                   Predefined instituts: ");
+  for ( id = 0; id < institutInqNumber; id++ )
+    if ( (name = institutInqNamePtr(id)) )
+      fprintf(stderr, " %s", name);
+  fprintf(stderr, "\n");
+  */
+  /* fprintf(stderr, "    -l <level>     Level file\n"); */
+  fprintf(stderr, "    -k <chunktype> Chunk type: auto, grid or lines\n");
+  fprintf(stderr, "    -L             Lock IO\n");
+  fprintf(stderr, "    -M             Switch to indicate that the I/O streams have missing values\n");
+  fprintf(stderr, "    -m <missval>   Set the default missing value (default: %g)\n", cdiInqMissval());
+  fprintf(stderr, "    -O             Overwrite existing output file, if checked\n");
+#if defined (_OPENMP)
+  fprintf(stderr, "    -P <nthreads>  Set number of OpenMP threads\n");
+#endif
+  fprintf(stderr, "    -Q             Alphanumeric sorting of netCDF parameter names\n");
+  fprintf(stderr, "    -R             Convert GRIB1 data from reduced to regular grid (only with cgribex)\n");
+  fprintf(stderr, "    -r             Generate a relative time axis\n");
+  fprintf(stderr, "    -S             Create an extra output stream for the module TIMSTAT. This stream\n");
+  fprintf(stderr, "                   contains the number of non missing values for each output period.\n");
+  fprintf(stderr, "    -s             Silent mode\n");
+  fprintf(stderr, "    -t <partab>    Set default parameter table name or file\n");
+  fprintf(stderr, "                   Predefined tables: ");
+  for ( id = 0; id < tableInqNumber(); id++ )
+    if ( (name = tableInqNamePtr(id)) )
+      fprintf(stderr, " %s", name);
+  fprintf(stderr, "\n");
+
+  fprintf(stderr, "    -V             Print the version number\n");
+  fprintf(stderr, "    -v             Print extra details for some operators\n");
+  fprintf(stderr, "    -z szip        SZIP compression of GRIB1 records\n");
+  fprintf(stderr, "       jpeg        JPEG compression of GRIB2 records\n");
+  fprintf(stderr, "        zip[_1-9]  Deflate compression of netCDF4 variables\n");
+  fprintf(stderr, "\n");
+
+  fprintf(stderr, "  Operators:\n");
+  operatorPrintAll();
+
+  fprintf(stderr, "\n");
+  fprintf(stderr, "  CDO version %s, Copyright (C) 2003-2012 Uwe Schulzweida\n", VERSION);
+  //  fprintf(stderr, "  Available from <http://code.zmaw.de/projects/cdo>\n");
+  fprintf(stderr, "  This is free software and comes with ABSOLUTELY NO WARRANTY\n");
+  fprintf(stderr, "  Report bugs to <http://code.zmaw.de/projects/cdo>\n");
+}
+
+static
+void cdoPrintHelp(char *phelp[]/*, char *xoperator*/)
+{
+  if ( phelp == NULL )
+    fprintf(stderr, "No help available for this operator!\n");
+  else
+    {
+      int lprint;
+      while ( *phelp )
+	{
+	  lprint = TRUE;
+	  if ( *phelp[0] == '\0' )
+	    if ( *(phelp+1) )
+	      if ( *(phelp+1)[0] == ' ' ) lprint = FALSE;
+	  
+	  if ( lprint ) fprintf(stdout, "%s\n", *phelp);
+
+	  phelp++;
+	}
+    }
+}
+
+
+void cdoGenFileSuffix(char *filesuffix, size_t maxlen, int filetype, int vlistID)
+{
+  if ( strncmp(cdo_file_suffix, "NULL", 4) )
+    {
+      if ( cdo_file_suffix[0] != 0 )
+	{
+	  strncat(filesuffix, cdo_file_suffix, maxlen-1);
+	}
+      else
+	{
+	  strncat(filesuffix, streamFilesuffix(filetype), maxlen-1);
+	  if ( cdoDefaultFileType == FILETYPE_GRB )
+	    if ( vlistIsSzipped(vlistID) || cdoCompType == COMPRESS_SZIP )
+	      strncat(filesuffix, ".sz", maxlen-1);
+	}
+    }
+}
+
+static
+void cdoSetDebug(int level)
+{
+  /*
+    level   0: off
+    level   1: on
+    level   2: cdi
+    level   4: memory
+    level   8: file
+    level  16: format
+    level  32: cdo
+    level  64: stream
+    level 128: pipe
+    level 256: pthread
+   */
+  cdiDebug(level);
+
+  if ( level == 1 || level &  32 ) cdoDebug = 1;
+  if ( level == 1 || level &  64 ) pstreamDebug(1);
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( level == 1 || level & 128 ) pipeDebug(1);
+  if ( level == 1 || level & 256 ) Pthread_debug(1);
+#endif
+}
+
+static int cdoOptind = 1;
+static char *cdoOptarg;
+
+static
+int cdoGetopt(int argc, char * const argv[], const char *optstring)
+{
+  static int optpos = 0;
+  int optval = -1, value;
+  int opthasarg = 0;
+  int optstrlen = strlen(optstring);
+  int iargc;
+
+  cdoOptarg = NULL;
+
+  while ( optpos < optstrlen && cdoOptind < argc )
+    {
+      value = optstring[optpos];
+      optpos++;
+      if ( optstring[optpos] == ':' )
+	{
+	  opthasarg = 1;
+	  optpos++;
+	}
+      else
+	opthasarg = 0;
+
+      for ( iargc = 1; iargc < argc; iargc++ )
+	{
+	  if ( *argv[iargc] == '-' && strlen(argv[iargc]) == 2 )
+	    {
+	      if ( (argv[iargc][1]) == value )
+		{
+		  optval = value;
+		  cdoOptind++;
+		  if ( opthasarg )
+		    {
+		      cdoOptarg = argv[iargc+1];
+		      cdoOptind++;
+		    }
+		  break;
+		}
+	    }
+	}
+      if ( iargc < argc ) break;
+    }
+
+  if ( opthasarg && cdoOptarg == NULL ) optval = ':';
+
+  return (optval);
+}
+
+#undef  IsBigendian
+#define IsBigendian()  ( u_byteorder.c[sizeof(long) - 1] )
+
+static
+void setDefaultDataType(char *datatypestr)
+{
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+  int nbits = -1;
+  enum {D_UINT, D_INT, D_FLT, D_CPX};
+  int dtype = -1;
+
+  if      ( *datatypestr == 'i' || *datatypestr == 'I' )
+    {
+      dtype = D_INT;
+      datatypestr++;
+    }
+  else if ( *datatypestr == 'u' || *datatypestr == 'U' )
+    {
+      dtype = D_UINT;
+      datatypestr++;
+    }
+  else if ( *datatypestr == 'f' || *datatypestr == 'F' )
+    {
+      dtype = D_FLT;
+      datatypestr++;
+    }
+  else if ( *datatypestr == 'c' || *datatypestr == 'C' )
+    {
+      dtype = D_CPX;
+      datatypestr++;
+    }
+
+  if ( isdigit((int) *datatypestr) )
+    {
+      nbits = atoi(datatypestr);
+      if ( nbits < 10 )
+	datatypestr += 1;
+      else
+	datatypestr += 2;
+
+      if ( dtype == -1 )
+	{
+	  if      ( nbits > 0 && nbits < 32 ) cdoDefaultDataType = nbits;
+	  else if ( nbits == 32 )
+	    {
+	      if ( cdoDefaultFileType == FILETYPE_GRB )
+		cdoDefaultDataType = DATATYPE_PACK32;
+	      else
+		cdoDefaultDataType = DATATYPE_FLT32;
+	    }
+	  else if ( nbits == 64 ) cdoDefaultDataType = DATATYPE_FLT64;
+	  else
+	    {
+	      fprintf(stderr, "Unsupported number of bits %d!\n", nbits);
+	      fprintf(stderr, "Use I8/I16/I32/F32/F64 for nc/nc2/nc4/nc4c; F32/F64 for grb2/srv/ext/ieg; P1 - P24 for grb/grb2.\n");
+	      exit(EXIT_FAILURE);
+	    }
+	}
+      else
+	{
+	  if ( dtype == D_INT )
+	    {
+	      if      ( nbits ==  8 ) cdoDefaultDataType = DATATYPE_INT8;
+	      else if ( nbits == 16 ) cdoDefaultDataType = DATATYPE_INT16;
+	      else if ( nbits == 32 ) cdoDefaultDataType = DATATYPE_INT32;
+	      else
+		{
+		  fprintf(stderr, "Unsupported number of bits = %d for datatype INT!\n", nbits);
+		  exit(EXIT_FAILURE);
+		}
+	    }
+	  /*
+	  else if ( dtype == D_UINT )
+	    {
+	      if      ( nbits ==  8 ) cdoDefaultDataType = DATATYPE_UINT8;
+	      else
+		{
+		  fprintf(stderr, "Unsupported number of bits = %d for datatype UINT!\n", nbits);
+		  exit(EXIT_FAILURE);
+		}
+	    }
+	  */
+	  else if ( dtype == D_FLT )
+	    {
+	      if      ( nbits == 32 ) cdoDefaultDataType = DATATYPE_FLT32;
+	      else if ( nbits == 64 ) cdoDefaultDataType = DATATYPE_FLT64;
+	      else
+		{
+		  fprintf(stderr, "Unsupported number of bits = %d for datatype FLT!\n", nbits);
+		  exit(EXIT_FAILURE);
+		}
+	    }
+	  else if ( dtype == D_CPX )
+	    {
+	      if      ( nbits == 32 ) cdoDefaultDataType = DATATYPE_CPX32;
+	      else if ( nbits == 64 ) cdoDefaultDataType = DATATYPE_CPX64;
+	      else
+		{
+		  fprintf(stderr, "Unsupported number of bits = %d for datatype CPX!\n", nbits);
+		  exit(EXIT_FAILURE);
+		}
+	    }
+	}
+    }
+
+  if ( *datatypestr != 0 )
+    {
+      if ( *datatypestr == 'l' || *datatypestr == 'L' )
+	{
+	  if ( IsBigendian() ) cdoDefaultByteorder = CDI_LITTLEENDIAN;
+	  datatypestr++;
+	}
+      else if ( *datatypestr == 'b' || *datatypestr == 'B' )
+	{
+	  if ( ! IsBigendian() ) cdoDefaultByteorder = CDI_BIGENDIAN;
+	  datatypestr++;
+	}
+      else
+	{
+	  fprintf(stderr, "Unsupported character in number of bytes: >%s< !\n", datatypestr);
+	  exit(EXIT_FAILURE);
+	}
+    }
+}
+
+static
+void setDefaultDataTypeByte(char *datatypestr)
+{
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+  int datatype = -1;
+
+  if ( isdigit((int) *datatypestr) )
+    {
+      datatype = atoi(datatypestr);
+      datatypestr++;
+
+      if      ( datatype == 1 ) cdoDefaultDataType = DATATYPE_PACK8;
+      else if ( datatype == 2 ) cdoDefaultDataType = DATATYPE_PACK16;
+      else if ( datatype == 3 ) cdoDefaultDataType = DATATYPE_PACK24;
+      else if ( datatype == 4 ) cdoDefaultDataType = DATATYPE_FLT32;
+      else if ( datatype == 8 ) cdoDefaultDataType = DATATYPE_FLT64;
+      else
+	{
+	  fprintf(stderr, "Unsupported datatype %d!\n", datatype);
+	  fprintf(stderr, "Use 4/8 for filetype nc/srv/ext/ieg and 1/2/3 for grb/grb2.\n");
+	  exit(EXIT_FAILURE);
+	}
+    }
+
+  if ( *datatypestr != 0 )
+    {
+      if ( *datatypestr == 'l' || *datatypestr == 'L' )
+	{
+	  if ( IsBigendian() ) cdoDefaultByteorder = CDI_LITTLEENDIAN;
+	  datatypestr++;
+	}
+      else if ( *datatypestr == 'b' || *datatypestr == 'B' )
+	{
+	  if ( ! IsBigendian() ) cdoDefaultByteorder = CDI_BIGENDIAN;
+	  datatypestr++;
+	}
+      else
+	{
+	  fprintf(stderr, "Unsupported character in number of bytes: %s!\n", datatypestr);
+	  exit(EXIT_FAILURE);
+	}
+    }
+}
+
+static
+void setDefaultFileType(char *filetypestr, int labort)
+{
+  if ( filetypestr )
+    {
+      char *ftstr = filetypestr;
+
+      if      ( memcmp(filetypestr, "grb2", 4)  == 0 ) { ftstr += 4; cdoDefaultFileType = FILETYPE_GRB2;}
+      else if ( memcmp(filetypestr, "grb1", 4)  == 0 ) { ftstr += 4; cdoDefaultFileType = FILETYPE_GRB; }
+      else if ( memcmp(filetypestr, "grb",  3)  == 0 ) { ftstr += 3; cdoDefaultFileType = FILETYPE_GRB; }
+      else if ( memcmp(filetypestr, "nc2",  3)  == 0 ) { ftstr += 3; cdoDefaultFileType = FILETYPE_NC2; }
+      else if ( memcmp(filetypestr, "nc4c", 4)  == 0 ) { ftstr += 4; cdoDefaultFileType = FILETYPE_NC4C;}
+      else if ( memcmp(filetypestr, "nc4",  3)  == 0 ) { ftstr += 3; cdoDefaultFileType = FILETYPE_NC4; }
+      else if ( memcmp(filetypestr, "nc",   2)  == 0 ) { ftstr += 2; cdoDefaultFileType = FILETYPE_NC;  }
+      else if ( memcmp(filetypestr, "srv",  3)  == 0 ) { ftstr += 3; cdoDefaultFileType = FILETYPE_SRV; }
+      else if ( memcmp(filetypestr, "ext",  3)  == 0 ) { ftstr += 3; cdoDefaultFileType = FILETYPE_EXT; }
+      else if ( memcmp(filetypestr, "ieg",  3)  == 0 ) { ftstr += 3; cdoDefaultFileType = FILETYPE_IEG; }
+      else
+	{
+	  if ( labort )
+	    {
+	      fprintf(stderr, "Unsupported filetype %s!\n", filetypestr);
+	      fprintf(stderr, "Available filetypes: grb/grb2/nc/nc2/nc4/nc4c/srv/ext/ieg\n");
+	      exit(EXIT_FAILURE);
+	    }
+	  else
+	    {
+	      return;
+	    }
+	}
+
+      if ( cdoDefaultFileType != CDI_UNDEFID && *ftstr != 0 )
+	{
+	  if ( *ftstr == '_' )
+	    {
+	      ftstr++;
+
+	      setDefaultDataType(ftstr);
+	    }
+	  else
+	    {
+	      fprintf(stderr, "Unexpected character >%c< in file type >%s<!\n", *ftstr, filetypestr);
+	      fprintf(stderr, "Use format[_nbits] with:\n");
+	      fprintf(stderr, "    format = grb, grb2, nc, nc2, nc4, nc4c, srv, ext or ieg\n");
+	      fprintf(stderr, "    nbits  = 32/64 for grb2/nc/nc2/nc4/nc4c/srv/ext/ieg; 1 - 24 for grb/grb2\n");
+	      exit(EXIT_FAILURE);
+	    }
+	}
+    }
+}
+
+#if defined (malloc)
+#undef malloc
+#undef free
+#endif
+
+#define NTESTS 11
+static
+int getMemAlignment(void)
+{
+  int ma = -1;
+  int i, k;
+  double *ptr[NTESTS];
+  int64_t iptr;
+  size_t tsize[NTESTS] = {1, 3, 5, 9, 17, 33, 69, 121, 251, 510, 1025};
+  size_t ma_check[4] = {8, 16, 32, 64};
+  int ma_result[4] = {1, 1, 1, 1};
+
+  for ( i = 0; i < NTESTS; ++i )
+    {
+      ptr[i] = malloc(tsize[i]);
+      iptr = (int64_t) ptr[i];
+      for ( k = 0; k < 4; ++k ) if ( iptr%ma_check[k] ) ma_result[k] = 0; 
+    }
+  for ( i = 0; i < NTESTS; ++i ) free(ptr[i]);
+
+  for ( i = NTESTS-1; i >= 0; i-- )
+    {
+      ptr[i] = malloc(tsize[i]+5);
+      iptr = (int64_t) ptr[i];
+      for ( k = 0; k < 4; ++k ) if ( iptr%ma_check[k] ) ma_result[k] = 0; 
+    }
+  for ( i = 0; i < NTESTS; ++i ) free(ptr[i]);
+
+  for ( k = 0; k < 4; ++k ) if ( ma_result[k] ) ma = ma_check[k];
+
+  return (ma);
+}
+
+
+int cdoFiletype(void)
+{
+  if ( cdoDefaultFileType == CDI_UNDEFID )
+    {
+      cdoDefaultFileType = FILETYPE_GRB;
+      if ( ! cdoSilentMode )
+	cdoPrint("Set default filetype to GRIB");
+    }
+
+  return (cdoDefaultFileType);
+}
+
+static
+void defineCompress(const char *arg)
+{
+  size_t len = strlen(arg);
+
+  if      ( memcmp(arg, "szip", len) == 0 )
+    {
+      cdoCompType  = COMPRESS_SZIP;
+      cdoCompLevel = 0;
+    }
+  else if ( memcmp(arg, "jpeg", len) == 0 )
+    {
+      cdoCompType = COMPRESS_JPEG;
+      cdoCompLevel = 0;
+    }
+  else if ( memcmp(arg, "gzip", len) == 0 )
+    {
+      cdoCompType  = COMPRESS_GZIP;
+      cdoCompLevel = 6;
+    }
+  else if ( memcmp(arg, "zip", 3) == 0 )
+    {
+      cdoCompType  = COMPRESS_ZIP;
+      if ( len == 5 && arg[3] == '_' && isdigit(arg[4]) )
+	cdoCompLevel = atoi(&arg[4]);
+      else
+	cdoCompLevel = 1;
+    }
+  else
+    {
+      fprintf(stderr, "Compression type '%s' unsupported!\n", arg);
+      exit(EXIT_FAILURE);
+    }
+}
+
+static
+void defineChunktype(const char *arg)
+{
+  if      ( strcmp("auto",  arg)   == 0 ) cdoChunkType = CHUNK_AUTO;
+  else if ( strcmp("grid",  arg)   == 0 ) cdoChunkType = CHUNK_GRID;
+  else if ( strcmp("lines", arg)   == 0 ) cdoChunkType = CHUNK_LINES;
+  else
+    {
+      fprintf(stderr, "Chunk type '%s' unsupported!\n", arg);
+      exit(EXIT_FAILURE);
+    }
+}
+
+static
+void defineVarnames(const char *arg)
+{
+  size_t len = strlen(arg);
+  size_t istart = 0;
+  char *pbuf;
+
+  while ( istart < len && (arg[istart] == ' ' || arg[istart] == ',') ) istart++;
+
+  len -= istart;
+
+  if ( len )
+    {
+      char *commapos;
+      
+      cdoVarnames = (char **) malloc(MAX_NUM_VARNAMES*sizeof(char *));
+
+      pbuf = strdup(arg+istart);
+      cdoVarnames[cdoNumVarnames++] = pbuf;    
+
+      commapos = pbuf;
+      while ( (commapos = strchr(commapos, ',')) != NULL )
+	{
+	  *commapos++ = '\0';
+	  if ( strlen(commapos) )
+	    {
+	      if ( cdoNumVarnames >= MAX_NUM_VARNAMES )
+		cdoAbort("Too many variable names (limit=%d)!", MAX_NUM_VARNAMES);
+
+	      cdoVarnames[cdoNumVarnames++] = commapos;
+	    }
+	}
+      /*
+      for ( int i = 0; i < cdoNumVarnames; ++i )
+	printf("varname %d: %s\n", i+1, cdoVarnames[i]);
+      */
+    }
+}
+
+static
+void get_env_vars(void)
+{
+  char *envstr;
+
+  envstr = getenv("CDO_LOG_OFF");
+  if ( envstr )
+    {
+      if ( atoi(envstr) == 1 )
+	{
+	  cdoLogOff = TRUE;
+	  if ( cdoVerbose )
+	    fprintf(stderr, "CDO_LOG_OFF         = %s\n", envstr);
+	}
+    }
+
+  envstr = getenv("CDO_DISABLE_HISTORY");
+  if ( envstr )
+    {
+      if ( atoi(envstr) == 1 )
+	{
+	  cdoDisableHistory = TRUE;
+	  if ( cdoVerbose )
+	    fprintf(stderr, "CDO_DISABLE_HISTORY = %s\n", envstr);
+	}
+    }
+
+  cdo_file_suffix[0] = 0;
+
+  envstr = getenv("CDO_FILE_SUFFIX");
+  if ( envstr )
+    {
+      if ( envstr[0] )
+	{
+	  strncat(cdo_file_suffix, envstr, sizeof(cdo_file_suffix)-1);
+	  if ( cdoVerbose )
+	    fprintf(stderr, "CDO_FILE_SUFFIX = %s\n", envstr);
+	}
+    }
+
+  envstr = getenv("CDO_DISABLE_FILESUFFIX");
+  if ( envstr )
+    {
+      if ( atoi(envstr) == 1 )
+	{
+	  strcat(cdo_file_suffix, "NULL");
+	  if ( cdoVerbose )
+	    fprintf(stderr, "CDO_DISABLE_FILESUFFIX = %s\n", envstr);
+	}
+    }
+
+  envstr = getenv("CDO_DIAG");
+  if ( envstr )
+    {
+      if ( atoi(envstr) == 1 )
+	{
+	  cdoDiag = TRUE;
+	  if ( cdoVerbose )
+	    fprintf(stderr, "CDO_DIAG = %s\n", envstr);
+	}
+    }
+}
+
+
+int main(int argc, char *argv[])
+{
+  int c;
+  int Debug = 0;
+  int Version = 0;
+  int Help = 0;
+  int DebugLevel = 0;
+  int lstop = FALSE;
+  int noff = 0;
+  int status = 0;
+  int numThreads = 0;
+  char *operatorName = NULL;
+  char *operatorArg = NULL;
+  char *argument = NULL;
+  extern int dmemory_ExitOnError;
+
+  init_is_tty();
+
+  dmemory_ExitOnError = 1;
+
+  /* mallopt(M_MMAP_MAX, 0); */
+ 
+  setCommandLine(argc, argv);
+
+  Progname = getProgname(argv[0]);
+
+  if ( memcmp(Progname, "cdo", 3) == 0 && strlen(Progname) > 3 ) noff = 3;
+
+  /* old versions !!!! */
+  if ( memcmp(Progname, "gdo", 3) == 0 && strlen(Progname) > 3 ) noff = 3;
+  if ( memcmp(Progname, "gm",  2) == 0 && strlen(Progname) > 2 ) noff = 2;
+
+  if ( noff ) setDefaultFileType(Progname+noff, 0);
+
+  while ( (c = cdoGetopt(argc, argv, "f:b:e:P:p:g:i:k:l:m:n:t:D:z:aBcdhLMOQRrsSTuVvXZ")) != -1 )
+    {
+      switch (c)
+	{
+	case 'a':
+	  cdoDefaultTimeType = TAXIS_ABSOLUTE;
+	  break;
+	case 'b':
+	  setDefaultDataType(cdoOptarg);
+	  break;
+	case 'B':
+	  cdoBenchmark = TRUE;
+	  break;
+	case 'c':
+	  cdoCheckDatarange = TRUE;
+	  break;
+	case 'd':
+	  Debug = 1;
+	  break;
+	case 'D':
+	  Debug = 1;
+	  DebugLevel = atoi(cdoOptarg);
+	  break;
+	case 'e':
+	  {
+#if defined (HAVE_GETHOSTNAME)
+	  char host[1024];
+	  gethostname(host, sizeof(host));
+	  cdoExpName = cdoOptarg;
+	  /* printf("host: %s %s\n", host, cdoExpName); */
+	  if ( strcmp(host, cdoExpName) == 0 )
+	    cdoExpMode = CDO_EXP_REMOTE;
+	  else
+            cdoExpMode = CDO_EXP_LOCAL;
+#else
+          fprintf(stderr, "Function gethostname not available!\n");
+	  exit(EXIT_FAILURE);
+#endif
+          break;
+	  }
+	case 'f':
+	  setDefaultFileType(cdoOptarg, 1);
+	  break;
+	case 'g':
+	  defineGrid(cdoOptarg);
+	  break;
+	case 'h':	
+	  Help = 1;
+	  break;
+	case 'i':
+	  defineInstitution(cdoOptarg);
+	  break;
+	case 'k':
+	  defineChunktype(cdoOptarg);
+	  break;
+	case 'L':	
+	  cdoLockIO = TRUE;
+	  break;
+	case 'l':
+	  defineZaxis(cdoOptarg);
+	  break;
+	case 'm':
+	  cdiDefMissval(atof(cdoOptarg));
+	  break;
+	case 'M':
+	  cdiDefGlobal("HAVE_MISSVAL", TRUE);
+	  break;
+	case 'n':
+	  defineVarnames(cdoOptarg);
+	  break;
+	case 'O':
+	  cdoOverwriteMode = TRUE;
+	  break;
+	case 'P':
+	  if ( *cdoOptarg < '1' || *cdoOptarg > '9' )
+	    {
+	      fprintf(stderr, "Unexpected character in number of OpenMP threads (-P <nthreads>): %s!\n", cdoOptarg);
+	      exit(EXIT_FAILURE);
+	    }
+	  numThreads = atoi(cdoOptarg);
+	  break;
+	case 'p':
+	  fprintf(stderr, "CDO option -p is obsolete and will be removed in the next release, please switch to -b <bits>!\n");
+	  setDefaultDataTypeByte(cdoOptarg);
+	  break;
+	case 'Q':
+	  cdiDefGlobal("SORTNAME", TRUE);
+	  break;
+	case 'R':
+	  cdoRegulargrid = TRUE;
+	  cdiDefGlobal("REGULARGRID", TRUE);
+	  break;
+	case 'r':
+	  cdoDefaultTimeType = TAXIS_RELATIVE;
+	  break;
+	case 'S':
+	  cdoDiag = TRUE;
+	  break;
+	case 's':
+	  cdoSilentMode = TRUE;
+	  break;
+	case 'T':
+	  cdoTimer = TRUE;
+	  break;
+	case 't':
+	  cdoDefaultTableID = defineTable(cdoOptarg);
+	  break;
+	case 'u':
+	  cdoInteractive = TRUE;
+	  break;
+	case 'V':
+	  Version = 1;
+	  break;
+	case 'v':
+	  cdoVerbose = TRUE;
+	  break;
+	case 'X': /* multi threaded I/O */
+	  cdoParIO = TRUE;
+	  break;
+	case 'Z':
+	  cdoCompress = TRUE;
+          break;
+	case 'z':
+	  defineCompress(cdoOptarg);
+          break;
+	case ':':
+	  fprintf(stderr, "\nmissing parameter for one of the options\n\n");	  
+	  Help = 1;
+	  break;
+	}
+    }
+
+  get_env_vars();
+
+  if ( Debug || Version ) cdo_version();
+
+  if ( Debug )
+    {
+      char *envstr;
+
+      if ( DebugLevel == 0 ) DebugLevel = 1;
+      cdoSetDebug(DebugLevel);
+      fprintf(stderr, "\n");
+      fprintf(stderr, "cdoDefaultFileType  = %d\n", cdoDefaultFileType);
+      fprintf(stderr, "cdoDefaultDataType  = %d\n", cdoDefaultDataType);
+      fprintf(stderr, "cdoDefaultByteorder = %d\n", cdoDefaultByteorder);
+      fprintf(stderr, "cdoDefaultTableID   = %d\n", cdoDefaultTableID);
+      fprintf(stderr, "\n");
+
+      envstr = getenv("HOSTTYPE");
+      if ( envstr ) fprintf(stderr, "HOSTTYPE            = %s\n", envstr);
+      envstr = getenv("VENDOR");
+      if ( envstr ) fprintf(stderr, "VENDOR              = %s\n", envstr);
+      envstr = getenv("OSTYPE");
+      if ( envstr ) fprintf(stderr, "OSTYPE              = %s\n", envstr);
+      envstr = getenv("MACHTYPE");
+      if ( envstr ) fprintf(stderr, "MACHTYPE            = %s\n", envstr);
+      fprintf(stderr, "\n");
+
+#if defined (__SSE2__)
+      fprintf(stderr, "Predefined: __SSE2__\n");
+#endif 
+#if defined (__SSE3__)
+      fprintf(stderr, "Predefined: __SSE3__\n");
+#endif 
+#if defined (__SSE4_1__)
+      fprintf(stderr, "Predefined: __SSE4_1__\n");
+#endif 
+#if defined (__SSE4_2__)
+      fprintf(stderr, "Predefined: __SSE4_2__\n");
+#endif 
+#if defined (__AVX__)
+      fprintf(stderr, "Predefined: __AVX__\n");
+#endif 
+      fprintf(stderr, "\n");
+
+      fprintf(stderr, "mem alignment       = %d\n\n", getMemAlignment());
+
+#if defined (HAVE_MMAP)
+      fprintf(stderr, "HAVE_MMAP\n");
+#endif
+#if defined (HAVE_MEMORY_H)
+      fprintf(stderr, "HAVE_MEMORY_H\n");
+#endif
+      fprintf(stderr, "\n");
+
+#if defined (_OPENACC)
+      fprintf(stderr, "OPENACC VERSION     = %d\n", _OPENACC);
+#endif
+#if defined (_OPENMP)
+      fprintf(stderr, "OPENMP VERSION      = %d\n", _OPENMP);
+#endif
+#if defined (__GNUC__)
+      fprintf(stderr, "GNUC VERSION        = %d\n", __GNUC__);
+#endif
+#if defined (__ICC)
+      fprintf(stderr, "ICC VERSION         = %d\n", __ICC);
+#endif
+#if defined (__STDC__)
+      fprintf(stderr, "STD ANSI C          = %d\n", __STDC__);
+#endif
+#if defined (__STD_VERSION__)
+      fprintf(stderr, "STD VERSION         = %ld\n", __STD_VERSION__);
+#endif
+#if defined (__STDC_VERSION__)
+      fprintf(stderr, "STDC VERSION        = %ld\n", __STDC_VERSION__);
+#endif
+#if defined (__STD_HOSTED__)
+      fprintf(stderr, "STD HOSTED          = %d\n", __STD_HOSTED__);
+#endif
+#if defined (FLT_EVAL_METHOD)
+      fprintf(stderr, "FLT_EVAL_METHOD     = %d\n", FLT_EVAL_METHOD);
+#endif
+#if defined (FP_FAST_FMA)
+      fprintf(stderr, "FP_FAST_FMA         = defined\n");
+#endif
+      fprintf(stderr, "\n");
+
+#if defined (_SC_VERSION)
+      fprintf(stderr, "POSIX.1 VERSION     = %ld\n", sysconf(_SC_VERSION));
+#endif
+#if defined (_SC_ARG_MAX)
+      fprintf(stderr, "POSIX.1 ARG_MAX     = %ld\n", sysconf(_SC_ARG_MAX));
+#endif
+#if defined (_SC_CHILD_MAX)
+      fprintf(stderr, "POSIX.1 CHILD_MAX   = %ld\n", sysconf(_SC_CHILD_MAX));
+#endif
+#if defined (_SC_STREAM_MAX)
+      fprintf(stderr, "POSIX.1 STREAM_MAX  = %ld\n", sysconf(_SC_STREAM_MAX));
+#endif
+#if defined (_SC_OPEN_MAX)
+      fprintf(stderr, "POSIX.1 OPEN_MAX    = %ld\n", sysconf(_SC_OPEN_MAX));
+#endif
+#if defined (_SC_PAGESIZE)
+      fprintf(stderr, "POSIX.1 PAGESIZE    = %ld\n", sysconf(_SC_PAGESIZE));
+#endif
+
+      fprintf(stderr, "\n");
+
+#if defined (HAVE_GETRLIMIT)
+#if defined (RLIMIT_FSIZE)
+      PRINT_RLIMIT(RLIMIT_FSIZE);
+#endif
+#if defined (RLIMIT_NOFILE)
+      PRINT_RLIMIT(RLIMIT_NOFILE);
+#endif
+#if defined (RLIMIT_STACK)
+      PRINT_RLIMIT(RLIMIT_STACK);
+#endif
+#endif
+      fprintf(stderr, "\n");
+    }
+
+#if defined (HAVE_GETRLIMIT)
+#if defined (RLIMIT_STACK)
+  {
+#define  MIN_STACK_SIZE  67108864L  /* 64MB */
+    int status;
+    struct rlimit rlim;
+    RLIM_T min_stack_size = MIN_STACK_SIZE;
+
+    status = getrlimit(RLIMIT_STACK, &rlim);
+
+    if ( status == 0 )
+      {
+	if ( min_stack_size > rlim.rlim_max ) min_stack_size = rlim.rlim_max;
+	if ( rlim.rlim_cur < min_stack_size )
+	  {
+	    rlim.rlim_cur = min_stack_size;
+
+	    status = setrlimit(RLIMIT_STACK, &rlim);
+	    if ( Debug )
+	      {
+		if ( status == 0 )
+		  {
+		    fprintf(stderr, "Set stack size to %ld\n", (long) min_stack_size);
+		    PRINT_RLIMIT(RLIMIT_STACK);
+		  }
+		else
+		  fprintf(stderr, "Set stack size to %ld failed!\n", (long) min_stack_size);
+	      }
+	  }
+      }
+  }
+#endif
+#endif
+
+  if ( Debug )
+    {
+      print_pthread_info();
+    }
+
+#if defined (_OPENMP)
+  if ( numThreads <= 0 ) numThreads = 1;
+  omp_set_num_threads(numThreads);
+  ompNumThreads = omp_get_max_threads();
+  if ( omp_get_max_threads() > omp_get_num_procs() )
+    fprintf(stderr, "Warning: Number of OMP threads is greater than number of CPUs=%d!\n", omp_get_num_procs());
+  if ( ompNumThreads < numThreads )
+    fprintf(stderr, "Warning: omp_get_max_threads() returns %d!\n", ompNumThreads);
+  if ( cdoVerbose )
+    fprintf(stderr, " OpenMP:  num_procs = %d  max_threads = %d\n", omp_get_num_procs(), omp_get_max_threads());
+#else
+  if ( numThreads > 0 )
+    {
+      fprintf(stderr, "Option -P failed, OpenMP support not compiled in!\n");
+      return(-1);
+    }
+#endif
+
+
+  if ( cdoOptind < argc )
+    {
+      operatorArg = argv[cdoOptind];
+      argument = makeArgument(argc-cdoOptind, &argv[cdoOptind]);
+    }
+  else
+    {
+      if ( ! Version && ! Help )
+	{
+	  fprintf(stderr, "\nno operator given\n\n");
+	  usage();
+	  status = 1;
+	}
+
+      if ( Help ) usage();
+      lstop = TRUE;
+    }
+
+  if ( lstop ) return (status);
+
+  if ( cdoDefaultTableID != CDI_UNDEFID ) cdiDefTableID(cdoDefaultTableID);
+
+  operatorName = getOperatorName(operatorArg);
+
+  if ( Help )
+    {
+      cdoPrintHelp(operatorHelp(operatorName));
+    }
+  else if ( cdoExpMode == CDO_EXP_LOCAL )
+    {
+      exp_run(argc, argv, cdoExpName);
+    }
+  else
+    {
+      timer_total      = timer_new("total");
+      timer_read       = timer_new("read");
+      timer_write      = timer_new("write");
+
+      timer_start(timer_total);
+
+      operatorModule(operatorName)(argument);
+
+      timer_stop(timer_total);
+
+      if ( cdoTimer ) timer_report();
+    }
+
+  if ( argument ) free(argument);
+
+  if ( cdoVarnames )
+    {
+      if ( cdoNumVarnames ) free(cdoVarnames[0]);
+      free(cdoVarnames);
+    }
+  /* problems with alias!!! if ( operatorName ) free(operatorName); */ 
+
+  /* malloc_stats(); */
+
+  return (status);
+}
diff --git a/src/cdo.h b/src/cdo.h
new file mode 100644
index 0000000..9c80c3e
--- /dev/null
+++ b/src/cdo.h
@@ -0,0 +1,139 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _CDO_H
+#define _CDO_H
+
+#include <stdio.h>
+#include "dmemory.h"
+
+#undef   TRUE
+#define  TRUE   1
+#undef   FALSE
+#define  FALSE  0
+
+#undef   MIN
+#define  MIN(a,b)  ((a) < (b) ? (a) : (b))
+#undef   MAX
+#define  MAX(a,b)  ((a) > (b) ? (a) : (b))
+#undef   NINT
+#define  NINT(x)   ((x) < 0 ? (int)((x)-0.5) : (int)((x)+0.5))
+#undef   NINTD
+#define  NINTD(x)   ((x) < 0 ? ((x)-0.5) : ((x)+0.5))
+
+#define  UNCHANGED_RECORD  (processSelf() == 0 && *cdoStreamName(0) != '-' && cdoRegulargrid == FALSE && cdoDefaultDataType == -1 && cdoDefaultByteorder == -1 )
+
+
+typedef struct {
+  int      argc;
+  char   **argv;
+}
+ARGUMENT;
+
+
+extern int ompNumThreads;
+
+extern int cdoDefaultFileType;
+extern int cdoDefaultDataType;
+extern int cdoDefaultByteorder;
+extern int cdoDefaultTableID;
+extern int cdoDefaultInstID;
+
+extern int cdoLockIO;
+extern int cdoCheckDatarange;
+
+extern int cdoSilentMode;
+extern int cdoOverwriteMode;
+extern int cdoRegulargrid;
+extern int cdoBenchmark;
+extern int cdoTimer;
+extern int cdoVerbose;
+extern int cdoDebug;
+extern int cdoCompress;
+extern int cdoInteractive;
+extern int cdoParIO;
+
+extern int cdoCompType;
+extern int cdoCompLevel;
+
+extern int cdoChunkType;
+
+extern int cdoExpMode;
+
+extern int cdoDiag;
+
+extern int cdoNumVarnames;
+extern char **cdoVarnames;
+
+void    cdiError(int cdiErrno, const char *fmt, ...);
+void    cdoAbort(const char *fmt, ...);
+void    cdoWarning(const char *fmt, ...);
+void    cdoPrint(const char *fmt, ...);
+
+int  timer_new(const char *text);
+void timer_report(void);
+void timer_start(int it);
+void timer_stop(int it);
+double timer_val(int it);
+
+void    operatorInputArg(const char *enter);
+int     operatorArgc(void);
+char  **operatorArgv(void);
+void    operatorCheckArgc(int numargs);
+
+const char *cdoStreamName(int cnt);
+
+void    cdoInitialize(void *argument);
+void    cdoFinish(void);
+
+int     cdoStreamNumber(void);
+int     cdoStreamCnt(void);
+int     cdoOperatorAdd(const char *name, int func, int intval, const char *enter);
+int     cdoOperatorID(void);
+int     cdoOperatorF1(int operID);
+int     cdoOperatorF2(int operID);
+const char *cdoOperatorName(int operID);
+const char *cdoOperatorEnter(int operID);
+
+int     cdoFiletype(void);
+
+void    cdoInqHistory(int fileID);
+void    cdoDefHistory(int fileID, char *histstring);
+
+int     cdoDefineGrid(const char *gridfile);
+int     cdoDefineZaxis(const char *zaxisfile);
+
+int     vlistIsSzipped(int vlistID);
+void cdoGenFileSuffix(char *filesuffix, size_t maxlen, int filetype, int vlistID);
+
+int  gridWeights(int gridID, double *weights);
+int  gridGenArea(int gridID, double *area);
+void gaussaw(double pa[], double pw[], int nlat);
+void genXbounds(long xsize, long ysize, const double * restrict grid_center_lon, 
+		double * restrict grid_corner_lon, double dlon);
+void genYbounds(long xsize, long ysize, const double * restrict grid_center_lat,
+		double * restrict grid_corner_lat);
+void writeNCgrid(const char *gridfile, int gridID, int *imask);
+void defineZaxis(const char *zaxisarg);
+void cdiDefTableID(int tableID);
+void gridGenXvals(int xsize, double xfirst, double xlast, double xinc, double *xvals);
+void gridGenYvals(int gridtype, int ysize, double yfirst, double ylast, double yinc, double *yvals);
+
+int gridFromName(const char *gridname);
+int zaxisFromName(const char *zaxisname);
+
+#endif  /* _CDO_H */
diff --git a/src/cdo_int.h b/src/cdo_int.h
new file mode 100644
index 0000000..979a2ce
--- /dev/null
+++ b/src/cdo_int.h
@@ -0,0 +1,195 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _CDO_INT_H
+#define _CDO_INT_H
+
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <assert.h>
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <float.h>
+
+#include "timebase.h"
+#include "field.h"
+#include "functs.h"
+#include "dmemory.h"
+#include "process.h"
+#include "const.h"
+
+#ifndef strdupx
+#ifndef strdup
+char *strdup(const char *s);
+#endif
+#define strdupx  strdup
+/*
+#define strdupx(s)			          \
+({					      	  \
+   const char *__old = (s);			  \
+   size_t __len = strlen(__old) + 1;		  \
+   char *__new = (char *) malloc(__len);	  \
+   (char *) memcpy(__new, __old, __len);	  \
+})
+*/
+#endif
+
+
+/* sxxxYYYYMMDDhhmm0 */
+#define  DATE_LEN  31        /* YYYYMMDDhhmmss allocate DTLEN+1 !!!! */
+#define  SET_DATE(dtstr, date, time)      (sprintf(dtstr, "%*d%*d", DATE_LEN-6, date, 6, time))
+#define  DATE_IS_NEQ(dtstr1, dtstr2, len) (memcmp(dtstr1, dtstr2, len) != 0)
+
+
+#if defined (__xlC__) /* performance problems on IBM */
+#ifndef DBL_IS_NAN
+#  define DBL_IS_NAN(x)     ((x) != (x))
+#endif
+#else
+#ifndef DBL_IS_NAN
+#if  defined  (HAVE_DECL_ISNAN)
+#  define DBL_IS_NAN(x)     (isnan(x))
+#elif  defined  (FP_NAN)
+#  define DBL_IS_NAN(x)     (fpclassify(x) == FP_NAN)
+#else
+#  define DBL_IS_NAN(x)     ((x) != (x))
+#endif
+#endif
+#endif
+
+#ifndef DBL_IS_EQUAL
+/*#define DBL_IS_EQUAL(x,y) (!(x < y || y < x)) */
+#  define DBL_IS_EQUAL(x,y) (DBL_IS_NAN(x)||DBL_IS_NAN(y)?(DBL_IS_NAN(x)&&DBL_IS_NAN(y)?1:0):!(x < y || y < x))
+#endif
+
+#ifndef IS_EQUAL
+#  define IS_NOT_EQUAL(x,y) (x < y || y < x)
+#  define IS_EQUAL(x,y)     (!IS_NOT_EQUAL(x,y))
+#endif
+
+
+#ifndef  M_PI
+#define  M_PI        3.14159265358979323846  /* pi */
+#endif
+
+#ifndef  M_LN10
+#define  M_LN10      2.30258509299404568402  /* log_e 10 */
+#endif
+
+
+#ifndef  RAD2DEG
+#define  RAD2DEG  (180./M_PI)   /* conversion for rad to deg */
+#endif
+
+#ifndef  DEG2RAD
+#define  DEG2RAD  (M_PI/180.)   /* conversion for deg to rad */
+#endif
+
+#define  IX2D(y,x,nx)  ((y)*(nx)+(x))
+
+#define  MEMTYPE_DOUBLE  1
+#define  MEMTYPE_FLOAT   2
+
+#define  CDO_EXP_LOCAL   1
+#define  CDO_EXP_REMOTE  2
+
+
+enum {DATE_FIRST, DATE_LAST, DATE_MIDDLE};
+
+void strtolower(char *str);
+
+void print_pthread_info(void);
+
+void cdoProcessTime(double *utime, double *stime);
+
+void    setCommandLine(int argc, char **argv);
+char   *commandLine(void);
+int     readline(FILE *fp, char *line, int len);
+
+int zaxis2ltype(int zaxisID);
+int ztype2ltype(int zaxistype);
+int ltype2ztype(int ltype);
+
+
+int nfc2nlat(int nfc, int ntr);
+int nlat2ntr(int nlat);
+int nlat2ntr_linear(int nlat);
+int ntr2nlat(int ntr);
+int ntr2nlat_linear(int ntr);
+int compNlon(int nlat);
+
+void param2str(int param, char *paramstr, int maxlen);
+void date2str(int date, char *datestr, int maxlen);
+void time2str(int time, char *timestr, int maxlen);
+
+typedef struct {
+  int   date;
+  int   time;
+} datetime_t;
+
+typedef struct
+{
+  datetime_t v;
+  datetime_t b[2];
+} dtinfo_t;
+
+typedef struct {
+  int   julday;
+  int   secofday;
+} juldate_t;
+
+
+juldate_t juldate_encode(int calendar, int date, int time);
+void      juldate_decode(int calendar, juldate_t juldate, int *date, int *time);
+juldate_t juldate_sub(juldate_t juldate2, juldate_t juldate1);
+juldate_t juldate_add_seconds(int seconds, juldate_t juldate);
+double    juldate_to_seconds(juldate_t juldate);
+
+void    datetime_avg(int dpy, int ndates, datetime_t *datetime);
+void    taxisInqDTinfo(int taxisID, dtinfo_t *dtinfo);
+void    taxisDefDTinfo(int taxisID, dtinfo_t dtinfo);
+
+int     days_per_month(int calendar, int year, int month);
+int     days_per_year(int calendar, int year);
+int     calendar_dpy(int calendar);
+
+void    defineGrid(const char *gridarg);
+void    defineInstitution(char *instarg);
+int     defineTable(char *tablearg);
+
+void    cdolog(const char *prompt, double cputime);
+void    cdologs(int noper);
+void    cdologo(int noper);
+void    nospec(int vlistID);
+void    gridWrite(FILE *fp, int gridID);
+
+void openLock(void);
+void openUnlock(void);
+
+int  cdf_openread(const char *filename);
+
+void printFiletype(int streamID, int vlistID);
+
+void job_submit(const char *expname, const char *jobfilename, const char *jobname, const char *tmppath, const char *ftppath);
+
+void minmaxval(long nvals, double *array, int *imiss, double *minval, double *maxval);
+
+
+#endif  /* _CDO_INT_H */
diff --git a/src/cdo_pthread.c b/src/cdo_pthread.c
new file mode 100644
index 0000000..9720bba
--- /dev/null
+++ b/src/cdo_pthread.c
@@ -0,0 +1,67 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+
+#if  defined  (HAVE_LIBPTHREAD)
+#include <limits.h>
+#include <pthread.h>
+#include "pthread_debug.h"
+#endif
+
+
+void print_pthread_info()
+{
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_attr_t attr;
+  pthread_mutexattr_t m_attr;
+  pthread_condattr_t c_attr;
+
+#if defined (PTHREAD_KEYS_MAX)
+  fprintf(stderr, "PTHREAD_KEYS_MAX    = %d\n", PTHREAD_KEYS_MAX);
+#endif
+#if defined (PTHREAD_DESTRUCTOR_ITERATIONS)
+  fprintf(stderr, "PTHREAD_DESTRUCTOR_ITERATIONS = %d\n", PTHREAD_DESTRUCTOR_ITERATIONS);
+#endif
+#if defined (PTHREAD_THREADS_MAX)
+  fprintf(stderr, "PTHREAD_THREADS_MAX = %d\n", PTHREAD_THREADS_MAX);
+#endif
+#if defined (PTHREAD_STACK_MIN)
+  fprintf(stderr, "PTHREAD_STACK_MIN   = %d\n", PTHREAD_STACK_MIN);
+#endif
+
+  fprintf(stderr, "\n");
+
+  pthread_attr_init(&attr);
+  print_pthread_attr("Default pthread attr", &attr);
+  pthread_attr_destroy(&attr);
+
+  pthread_mutexattr_init(&m_attr);
+  print_pthread_mutexattr("Default pthread mutexattr", &m_attr);
+  pthread_mutexattr_destroy(&m_attr);
+
+  pthread_condattr_init(&c_attr);
+  print_pthread_condattr("Default pthread condattr ", &c_attr);
+  pthread_condattr_destroy(&c_attr);
+
+  fprintf(stderr, "\n");
+#endif
+}
diff --git a/src/cdo_vlist.c b/src/cdo_vlist.c
new file mode 100644
index 0000000..9ffd213
--- /dev/null
+++ b/src/cdo_vlist.c
@@ -0,0 +1,258 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "error.h"
+
+static
+void compareGrids(int gridID1, int gridID2)
+{
+  /* compare grids of first variable */
+  int xsize, ysize;
+  int i;
+
+  if ( gridInqType(gridID1) == gridInqType(gridID2) )
+    {
+      if ( gridInqType(gridID1) == GRID_GAUSSIAN || gridInqType(gridID1) == GRID_LONLAT )
+	{
+	  xsize = gridInqXsize(gridID1);
+	  ysize = gridInqYsize(gridID1);
+		
+	  if ( ysize == gridInqYsize(gridID2) )
+	    {
+	      if ( ysize > 1 )
+		{
+		  double *yvals1, *yvals2;
+
+		  yvals1 = (double *) malloc(ysize*sizeof(double));
+		  yvals2 = (double *) malloc(ysize*sizeof(double));
+
+		  gridInqYvals(gridID1, yvals1);
+		  gridInqYvals(gridID2, yvals2);
+		
+		  if ( IS_EQUAL(yvals1[0], yvals2[ysize-1]) &&
+		       IS_EQUAL(yvals1[ysize-1], yvals2[0]) )
+		    {
+		      if ( yvals1[0] > yvals2[0] )
+			cdoWarning("Grid orientation differ! First grid: N->S; second grid: S->N");
+		      else
+			cdoWarning("Grid orientation differ! First grid: S->N; second grid: N->S");
+		    }
+		  else
+		    {
+		      for ( i = 0; i < ysize; ++i )
+			if ( fabs(yvals1[i] - yvals2[i]) > 1.e-5 )
+			  {
+			    // printf("lat %g %g %g\n", yvals1[i], yvals2[i], yvals1[i] - yvals2[i]);
+			    cdoWarning("Grid latitudes differ!");
+			    break;
+			  }
+		    }
+
+		  free(yvals1);
+		  free(yvals2);
+		}
+	    }
+	  else
+	    cdoWarning("ysize of input grids differ!");
+		
+	  if ( xsize == gridInqXsize(gridID2) )
+	    {
+	      if ( xsize > 1 )
+		{
+		  double *xvals1, *xvals2;
+
+		  xvals1 = (double *) malloc(xsize*sizeof(double));
+		  xvals2 = (double *) malloc(xsize*sizeof(double));
+
+		  gridInqXvals(gridID1, xvals1);
+		  gridInqXvals(gridID2, xvals2);
+		
+		  for ( i = 0; i < xsize; ++i )
+		    if ( fabs(xvals1[i] - xvals2[i]) > 1.e-5 )
+		      {
+			cdoWarning("Grid longitudes differ!");
+			break;
+		      }
+
+		  free(xvals1);
+		  free(xvals2);
+		}
+	    }
+	  else
+	    cdoWarning("ysize of input grids differ!");
+	}
+    }
+  else
+    {
+      cdoWarning("Grids have different types! First grid: %s; second grid: %s",
+		 gridNamePtr(gridInqType(gridID1)), gridNamePtr(gridInqType(gridID2)));
+    }
+}
+
+static
+int cmpnames(const void *s1, const void *s2)
+{
+  char *name1 = (char *) s1;
+  char *name2 = (char *) s2;
+
+  return (strcmp(name1, name2));
+}
+
+
+void vlistCompare(int vlistID1, int vlistID2, int flag)
+{
+  int varID, nvars;
+  int lchecknames = FALSE;
+
+  if ( vlistNvars(vlistID1) != vlistNvars(vlistID2) )
+    cdoAbort("Input streams have different number of variables per timestep!");
+
+  if ( vlistNrecs(vlistID1) != vlistNrecs(vlistID2) )
+    cdoAbort("Input streams have different number of records per timestep!");
+
+  nvars = vlistNvars(vlistID1);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( flag & CMP_CODE )
+	if ( vlistInqVarCode(vlistID1, varID) != vlistInqVarCode(vlistID2, varID) )
+	  cdoAbort("Input streams have different structure!");
+
+      if ( (flag & CMP_NAME) && nvars > 1 )
+	{
+	  char name1[CDI_MAX_NAME], name2[CDI_MAX_NAME];
+	  vlistInqVarName(vlistID1, varID, name1);
+	  vlistInqVarName(vlistID2, varID, name2);
+	  if ( strcmp(name1, name2) != 0 )
+	    {
+	      cdoWarning("Input streams have different parameters!");
+	      lchecknames = TRUE;
+	      flag -= CMP_NAME;
+	      //    break;
+	    }
+	}
+
+      if ( flag & CMP_GRIDSIZE )
+	{
+	  if ( gridInqSize(vlistInqVarGrid(vlistID1, varID)) !=
+	       gridInqSize(vlistInqVarGrid(vlistID2, varID)) )
+	    cdoAbort("Grid size of the input parameters do not match!");
+	}
+      
+      if ( flag & CMP_NLEVEL )
+	{
+	  if ( zaxisInqSize(vlistInqVarZaxis(vlistID1, varID)) !=
+	       zaxisInqSize(vlistInqVarZaxis(vlistID2, varID)) )
+	    cdoAbort("Number of levels of the input parameters do not match!");
+	}
+    }
+
+  if ( flag & CMP_GRID )
+    {
+      int gridID1, gridID2;
+
+      gridID1 = vlistInqVarGrid(vlistID1, 0);
+      gridID2 = vlistInqVarGrid(vlistID2, 0);
+
+      compareGrids(gridID1, gridID2);
+    }
+
+  if ( lchecknames )
+    {
+      char names1[nvars][CDI_MAX_NAME], names2[nvars][CDI_MAX_NAME];
+      for ( varID = 0; varID < nvars; varID++ )
+	vlistInqVarName(vlistID1, varID, names1[varID]);
+      for ( varID = 0; varID < nvars; varID++ )
+	vlistInqVarName(vlistID2, varID, names2[varID]);
+
+      qsort(names1[0], nvars, CDI_MAX_NAME, cmpnames);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	if ( strcmp(names1[varID], names2[varID]) != 0 ) break;
+
+      if ( varID == nvars )
+	cdoPrint("Use the CDO option -Q to sort the parameter names, if you have netCDF input files!");
+    }
+}
+
+
+int vlistCompareX(int vlistID1, int vlistID2, int flag)
+{
+  int varID, nvars, nvars2, nlevels2;
+
+  nvars = vlistNvars(vlistID1);
+  nvars2 = vlistNvars(vlistID2);
+  nlevels2 = zaxisInqSize(vlistInqVarZaxis(vlistID2, 0));
+
+  if ( nvars2 != 1 )
+    cdoAbort("Internal problem, vlistCompareX() called with unexpected vlistID2 argument!");
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      if ( flag & CMP_GRIDSIZE )
+	{
+	  if ( gridInqSize(vlistInqVarGrid(vlistID1, varID)) !=
+	       gridInqSize(vlistInqVarGrid(vlistID2, 0)) )
+	    cdoAbort("Grid size of the input parameters do not match!");
+	}
+      
+      if ( flag & CMP_NLEVEL )
+	{
+	  if ( (zaxisInqSize(vlistInqVarZaxis(vlistID1, varID)) !=
+                nlevels2) && nlevels2 > 1 )
+	    cdoAbort("Number of levels of the input parameters do not match!");
+	}
+    }
+
+  if ( flag & CMP_GRID )
+    {
+      int gridID1, gridID2;
+
+      gridID1 = vlistInqVarGrid(vlistID1, 0);
+      gridID2 = vlistInqVarGrid(vlistID2, 0);
+
+      compareGrids(gridID1, gridID2);
+    }
+
+  return (nlevels2);
+}
+
+
+int vlistIsSzipped(int vlistID)
+{
+  int lszip = FALSE;
+  int nvars, varID, comptype;
+
+  nvars = vlistNvars(vlistID);
+
+  for ( varID = 0; varID < nvars; varID++ )
+    {						
+      comptype = vlistInqVarCompType(vlistID, varID);
+      if ( comptype == COMPRESS_SZIP )
+	{
+	  lszip = TRUE;
+	  break;
+	}
+    }      
+
+  return (lszip);
+}
+
+
diff --git a/src/cdotest.c b/src/cdotest.c
new file mode 100755
index 0000000..e72590f
--- /dev/null
+++ b/src/cdotest.c
@@ -0,0 +1,541 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include <cdi.h>
+#include "cdo_int.h"
+
+
+#define TO_KELVIN(x) ((x) + 273.15)
+#define MISSVAL -9.0E33
+
+
+static 
+int equals(double expected, double actual, double eps)
+{
+  return (int) fabs(expected - actual) < eps; 
+}
+
+static 
+double humidityIndex(double t, double p, double r, double missval)
+{
+  static const double tmin = 26.0;
+  static const double rmin = 40.0;
+  
+  if ( t < tmin || r < rmin )
+    return missval;
+    
+  return t + (5.0 / 9.0) * ((0.01 * r * p * 6.112 * pow(10.0, (7.5 * t) / (237.7 + t))) - 10.0);
+}
+
+/* reads a NetCDF file containing data for a single grid point */ 
+static
+void readNcFile(const char path[], double **vars, int nvars, int nts)
+{
+  int taxisID;
+  int vlistID, varID, streamID, tsID;
+  int nmiss, nrecs;
+  
+  streamID = streamOpenRead(path);
+  if ( streamID < 0 )
+    {
+      fprintf(stderr, "%s\n", cdiStringError(streamID));
+      exit(EXIT_FAILURE);
+    }
+  
+  vlistID = streamInqVlist(streamID);
+  
+  assert(vlistNtsteps(vlistID) == nts);
+  
+  assert(vlistGridsizeMax(vlistID) == 1);
+  assert(vlistNvars(vlistID) == nvars);
+
+  taxisID = vlistInqTaxis(vlistID);
+  
+  for (tsID = 0; tsID < nts; ++tsID)
+    {
+      nrecs = streamInqTimestep(streamID, tsID);
+      assert(nrecs == nvars);
+      
+      taxisInqVdate(taxisID);
+      taxisInqVtime(taxisID);
+    
+      for (varID = 0; varID < nvars; ++varID)
+        streamReadVar(streamID, varID, &vars[varID][tsID], &nmiss);
+    }
+  
+  streamClose(streamID);
+}
+
+/* writes a NetCDF file containing data for a single grid point */
+static
+void writeNcFile(const char path[], const double array[], int length)
+{
+  int gridID, zaxisID, taxisID;
+  int vlistID, varID, streamID, tsID;
+  int nmiss;
+  
+  double lons[] = {0.0};
+  double lats[] = {0.0};
+  double value;
+  
+  gridID = gridCreate(GRID_LONLAT, 1);
+  gridDefXsize(gridID, 1);
+  gridDefYsize(gridID, 1);
+  gridDefXvals(gridID, lons);
+  gridDefYvals(gridID, lats);
+  
+  zaxisID = zaxisCreate(ZAXIS_SURFACE, 1);
+  vlistID = vlistCreate();
+  
+  varID = vlistDefVar(vlistID, gridID, zaxisID, TSTEP_INSTANT);
+  vlistDefVarName(vlistID, varID, "test_values");
+  vlistDefVarDatatype(vlistID, varID, DATATYPE_FLT64);
+  vlistDefVarMissval(vlistID, varID, MISSVAL);
+  
+  taxisID = taxisCreate(TAXIS_ABSOLUTE);
+  vlistDefTaxis(vlistID, taxisID);
+  
+  streamID = streamOpenWrite(path, FILETYPE_NC);
+  if ( streamID < 0 ) 
+    {
+      fprintf(stderr, "%s\n", cdiStringError(streamID));
+      exit(EXIT_FAILURE);
+    }
+  
+  streamDefVlist(streamID, vlistID);
+  
+  for (tsID = 0; tsID < length; ++tsID)
+    {
+      /* TODO - find a better solution for setting the date */   
+      if ( tsID < 6 ) {
+        taxisDefVdate(taxisID, 20060625 + tsID);
+      } else {
+        taxisDefVdate(taxisID, 20060701 + tsID - 6);
+      }  
+      taxisDefVtime(taxisID, 235900);
+      streamDefTimestep(streamID, tsID);
+      
+      value = array[tsID];
+      nmiss = DBL_IS_EQUAL(value, MISSVAL) ? 1 : 0;
+      
+      streamWriteVar(streamID, varID, &value, nmiss);
+    }
+    
+  streamClose(streamID);
+  
+  vlistDestroy(vlistID);
+  taxisDestroy(taxisID);
+  zaxisDestroy(zaxisID);
+  gridDestroy(gridID); 
+}
+
+/* creates the necessary storage for nvars variables with nts time steps on a single grid point */
+static
+double **createVars(int nvars, int nts)
+{  
+  double *array = (double *) malloc(nvars*nts*sizeof(double));
+  double **vars = (double **) malloc(nvars*sizeof(double));
+  
+  int i;
+  
+  for (i = 0; i < nvars; ++i)
+    vars[i] = &array[i * nts];
+    
+  return vars;  
+}
+
+/* destroys storage */
+static
+void destroyVars(double **vars)
+{  
+  if ( vars != NULL)
+    {
+      free(vars[0]);
+      free(vars);
+    }
+}
+
+/* gets the path of the CDO binary executable */
+static 
+char *getCdoPath()
+{
+  char *cdoPath = getenv("CDO_PATH");
+  
+  if ( cdoPath == NULL )
+    {
+      struct stat filestat;
+      int status;
+      status = stat("$HOME/bin/cdo", &filestat);
+      if ( status == 0 )
+	return "$HOME/bin/cdo";
+      else
+	{
+	  fprintf(stderr, "cdo binary not found! Use CDO_PATH to set the path to cdo.\n");
+	  exit(-1);
+	}
+    }
+    
+  return cdoPath;
+}
+
+/* submits a CDO command */
+static
+int submitCdoCommand(const char *argument)
+{  
+  const char *cdoPath = getCdoPath();
+  char *cdoCommand = (char *) malloc(strlen(cdoPath) + strlen(argument) + 8);
+  
+  int status;
+  
+  cdoCommand[0] = '\0';
+  strcat(cdoCommand, cdoPath);
+  strcat(cdoCommand, " -b 64 ");
+  strcat(cdoCommand, argument);
+  
+  status = system(cdoCommand);
+  free(cdoCommand);
+  
+  return status;
+}
+
+static
+void testEcaFd()
+{
+  const double array[] = {MISSVAL, MISSVAL, TO_KELVIN(1.0), TO_KELVIN(1.0), 
+    TO_KELVIN(-1.0), TO_KELVIN(-1.0)};
+  
+  int nvars = 1;
+  int nts   = 1;
+  
+  double **vars = createVars(nvars, nts);
+  
+  writeNcFile("in.nc", array, 2);
+
+  submitCdoCommand("eca_fd in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], MISSVAL));
+
+  writeNcFile("in.nc", array, 3);
+
+  submitCdoCommand("eca_fd in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 0.));
+
+  writeNcFile("in.nc", array, 5);
+
+  submitCdoCommand("eca_fd in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 1.));
+
+  writeNcFile("in.nc", array, 6);
+
+  submitCdoCommand("eca_fd in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 2.));
+  
+  destroyVars(vars);
+}
+
+static
+void testEcaSu()
+{
+  const double array[] = {MISSVAL, MISSVAL, TO_KELVIN(26.0), TO_KELVIN(24.0), 
+    TO_KELVIN(26.0), TO_KELVIN(24.0)};
+  
+  int nvars = 1;
+  int nts   = 1;
+  
+  double **vars = createVars(nvars, nts);
+  
+  writeNcFile("in.nc", array, 2);
+
+  submitCdoCommand("eca_su in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], MISSVAL));
+
+  writeNcFile("in.nc", array, 6);
+
+  submitCdoCommand("eca_su in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 2.));
+
+  submitCdoCommand("eca_su,20.0 in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 4.));
+
+  submitCdoCommand("eca_su,30.0 in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 0.));
+  
+  destroyVars(vars);
+}
+
+static
+void testFdns()
+{
+  const double array1[] = {MISSVAL, TO_KELVIN(1.0), TO_KELVIN(-1.0), 
+    TO_KELVIN(-1.0), TO_KELVIN(-1.0)};
+  const double array2[] = {0.0, 0.0, 1.0, 0.0, MISSVAL};
+  
+  int nvars = 1;
+  int nts   = 1;
+  
+  double **vars = createVars(nvars, nts);
+  
+  writeNcFile("in1.nc", array1, 1);
+  writeNcFile("in2.nc", array2, 1);
+
+  submitCdoCommand("fdns in1.nc in2.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], MISSVAL));
+  
+  writeNcFile("in1.nc", array1, 2);
+  writeNcFile("in2.nc", array2, 2);
+
+  submitCdoCommand("fdns in1.nc in2.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 0.));
+
+  writeNcFile("in1.nc", array1, 3);
+  writeNcFile("in2.nc", array2, 3);
+
+  submitCdoCommand("fdns in1.nc in2.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 0.));
+
+  writeNcFile("in1.nc", array1, 4);
+  writeNcFile("in2.nc", array2, 4);
+
+  submitCdoCommand("fdns in1.nc in2.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 1.));
+
+  writeNcFile("in1.nc", array1, 5);
+  writeNcFile("in2.nc", array2, 5);
+
+  submitCdoCommand("fdns in1.nc in2.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 1.));
+
+  writeNcFile("in1.nc", array1 + 4, 1);
+  writeNcFile("in2.nc", array2 + 4, 1);
+
+  submitCdoCommand("fdns in1.nc in2.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], MISSVAL));
+
+  destroyVars(vars);
+}
+
+static 
+void testEcaGsl()
+{
+  const double array1[] = {TO_KELVIN(6.0), TO_KELVIN(6.0), TO_KELVIN(6.0), TO_KELVIN(6.0), TO_KELVIN(6.0), TO_KELVIN(6.0), TO_KELVIN(6.0), 
+    TO_KELVIN(-1.0), TO_KELVIN(-1.0), TO_KELVIN(-1.0), TO_KELVIN(-1.0), TO_KELVIN(-1.0), TO_KELVIN(-1.0), TO_KELVIN(-1.0)};
+  const double array2[] = {0.5};
+  
+  int nvars = 2;
+  int nts   = 1;
+  
+  double **vars = createVars(nvars, nts);
+  
+  writeNcFile("in1.nc", array1, 14);
+  writeNcFile("in2.nc", array2, 2);
+
+  submitCdoCommand("eca_gsl in1.nc in2.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 7.0));
+  assert(DBL_IS_EQUAL(vars[1][0], 181.0));
+
+  //  submitCdoCommand("eca_gsl,6,5.0,0.6 in1.nc in2.nc out.nc");
+  //  readNcFile("out.nc", vars, nvars, nts);
+  //  assert(DBL_IS_EQUAL(vars[0][0], MISSVAL));
+  //  assert(DBL_IS_EQUAL(vars[1][0], MISSVAL));
+ 
+  writeNcFile("in1.nc", array1, 7);
+
+  submitCdoCommand("eca_gsl in1.nc in2.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 1.0));
+  assert(DBL_IS_EQUAL(vars[1][0], 181.0));
+
+  writeNcFile("in1.nc", array1, 8);
+
+  submitCdoCommand("eca_gsl in1.nc in2.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 2.0));
+  assert(DBL_IS_EQUAL(vars[1][0], 181.0));
+ 
+  //  writeNcFile("in1.nc", array1, 4);
+
+  //  submitCdoCommand("eca_gsl in1.nc in2.nc out.nc");
+  //  readNcFile("out.nc", vars, nvars, nts);
+  //  assert(DBL_IS_EQUAL(vars[0][0], MISSVAL));
+  //  assert(DBL_IS_EQUAL(vars[1][0], MISSVAL));
+ 
+  destroyVars(vars);
+}
+
+static
+void testHi()
+{
+  const double array1[] = {MISSVAL, 70.0, 36.0, 46.0, 56.0};
+  const double array2[] = {1.0, 1.0, 1.0, 1.0, 1.0};
+  const double array3[] = {0.4, 0.4, 0.3, 0.5, 0.6};
+  
+  int nvars = 1;
+  int nts   = 5;
+  
+  double **vars = createVars(nvars, nts);
+  
+  writeNcFile("in1.nc", array1, 5);
+  writeNcFile("in2.nc", array2, 5);
+  writeNcFile("in3.nc", array3, 5);
+
+  submitCdoCommand("hi in1.nc in2.nc in3.nc out.nc");
+
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(equals(vars[0][0], humidityIndex(array1[0], array2[0], array3[0], MISSVAL), 1.0e-5));
+  assert(equals(vars[0][1], humidityIndex(array1[1], array2[1], array3[1], MISSVAL), 1.0e-5));
+  assert(equals(vars[0][2], humidityIndex(array1[2], array2[2], array3[2], MISSVAL), 1.0e-5));
+  assert(equals(vars[0][3], humidityIndex(array1[3], array2[3], array3[3], MISSVAL), 1.0e-5));
+  assert(equals(vars[0][4], humidityIndex(array1[4], array2[4], array3[4], MISSVAL), 1.0e-5));
+
+  destroyVars(vars);
+}
+
+static
+void testTimcount()
+{
+  const double array[] = {MISSVAL, MISSVAL, TO_KELVIN(1.0), MISSVAL, 
+    TO_KELVIN(1.0), TO_KELVIN(1.0)};
+  
+  /* number of output variables and time steps */
+  int nvars = 1;
+  int nts   = 1;
+  
+  double **vars = createVars(nvars, nts);
+  
+  writeNcFile("in.nc", array, 2);
+
+  submitCdoCommand("timcount in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], MISSVAL));
+
+  writeNcFile("in.nc", array, 3);
+
+  submitCdoCommand("timcount in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 1.));
+
+  writeNcFile("in.nc", array, 5);
+
+  submitCdoCommand("timcount in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 2.));
+
+  writeNcFile("in.nc", array, 6);
+
+  submitCdoCommand("timcount in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 3.));
+  
+  destroyVars(vars);
+}
+
+static
+void testSeascount()
+{
+  const double array[] = {MISSVAL, MISSVAL, TO_KELVIN(1.0), MISSVAL, 
+    TO_KELVIN(1.0), TO_KELVIN(1.0)};
+  
+  /* number of output variables and time steps */
+  int nvars = 1;
+  int nts   = 1;
+  
+  double **vars = createVars(nvars, nts);
+  
+  writeNcFile("in.nc", array, 2);
+
+  submitCdoCommand("seascount in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], MISSVAL));
+
+  writeNcFile("in.nc", array, 3);
+
+  submitCdoCommand("seascount in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 1.));
+
+  writeNcFile("in.nc", array, 5);
+
+  submitCdoCommand("seascount in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 2.));
+
+  writeNcFile("in.nc", array, 6);
+
+  submitCdoCommand("seascount in.nc out.nc");
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(DBL_IS_EQUAL(vars[0][0], 3.));
+  
+  destroyVars(vars);
+}
+
+static
+void testWct()
+{
+  const double array1[] = {-3.1102};
+  const double array2[] = {1.9787};
+  
+  int nvars = 1;
+  int nts   = 1;
+  
+  double **vars = createVars(nvars, nts);
+  
+  writeNcFile("in1.nc", array1, 1);
+  writeNcFile("in2.nc", array2, 1);
+
+  submitCdoCommand("wct in1.nc in2.nc out.nc");
+
+  readNcFile("out.nc", vars, nvars, nts);
+  assert(equals(vars[0][0], -6.34597, 1.0e-5));
+  
+  destroyVars(vars);
+}
+
+
+int main(void)
+{
+  testEcaFd();
+  testEcaSu();
+  testEcaGsl();
+
+  testFdns();
+  /* testHi(); */
+  testTimcount();
+  testWct();
+  
+  return 0;
+}
diff --git a/src/color.c b/src/color.c
new file mode 100644
index 0000000..25158f3
--- /dev/null
+++ b/src/color.c
@@ -0,0 +1,429 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include "color.h"
+
+
+#define  FALSE  0
+#define  TRUE   1
+
+#define  RGB    0
+#define  HSV    1
+#define  CMYK   2
+
+double rint(double x);
+
+#define irint(x) ((int)rint(x))
+
+
+int check_rgb (int rgb[])
+{
+  return (( (rgb[0] < 0 || rgb[0] > 255) || (rgb[1] < 0 || rgb[1] > 255) || (rgb[2] < 0 || rgb[2] > 255) ));
+}
+
+int check_hsv (double h, double s, double v)
+{
+  return (( (h < 0.0 || h > 360.0) || (s < 0.0 || s > 1.0) || (h < 0.0 || v > 1.0) ));
+}
+
+int check_cmyk (double cmyk[])
+{
+  int i;
+  for (i = 0; i < 4; i++) if (cmyk[i] < 0.0 || cmyk[i] > 100.0) return (TRUE);
+  return (FALSE);
+}
+
+void hsv_to_rgb (int rgb[], double h, double s, double v)
+{
+  int i;
+  double f, p, q, t, rr = 0, gg = 0, bb = 0;
+	
+  if ( !(fabs(s) > 0) )
+    rgb[0] = rgb[1] = rgb[2] = (int) floor (255.999 * v);
+  else {
+    while (h >= 360.0) h -= 360.0;
+    h /= 60.0;
+    i = (int)h;
+    f = h - i;
+    p = v * (1.0 - s);
+    q = v * (1.0 - (s * f));
+    t = v * (1.0 - (s * (1.0 - f)));
+    switch (i) {
+    case 0:
+      rr = v;	gg = t;	bb = p;
+      break;
+    case 1:
+      rr = q;	gg = v;	bb = p;
+      break;
+    case 2:
+      rr = p;	gg = v;	bb = t;
+      break;
+    case 3:
+      rr = p;	gg = q;	bb = v;
+      break;
+    case 4:
+      rr = t;	gg = p;	bb = v;
+      break;
+    case 5:
+      rr = v;	gg = p;	bb = q;
+      break;
+    }
+		
+    rgb[0] = (rr < 0.0) ? 0 : (int) floor (rr * 255.999);
+    rgb[1] = (gg < 0.0) ? 0 : (int) floor (gg * 255.999);
+    rgb[2] = (bb < 0.0) ? 0 : (int) floor (bb * 255.999);
+  }
+}
+
+
+void cmyk_to_rgb (int rgb[], double cmyk[])
+{
+  /* Plain conversion; no undercolor removal or blackgeneration */
+	
+  int i;
+	
+  /* CMYK is in 0-100, RGB will be in 0-255 range */
+	
+  for (i = 0; i < 3; i++) rgb[i] = (int) floor ((100.0 - cmyk[i] - cmyk[3]) * 2.55999);
+}
+
+
+int slash_count (char *txt)
+{
+  int i = 0, n = 0;
+  while (txt[i]) if (txt[i++] == '/') n++;
+  return (n);
+}
+
+
+int getrgb (char *line, int rgb[], int color_model)
+{
+  int n, count;
+	
+  count = slash_count (line);
+	
+  if (count == 3) {	/* c/m/y/k */
+    double cmyk[4];
+    n = sscanf (line, "%lf/%lf/%lf/%lf", &cmyk[0], &cmyk[1], &cmyk[2], &cmyk[3]);
+    if (n != 4 || check_cmyk (cmyk)) return (TRUE);
+    cmyk_to_rgb (rgb, cmyk);
+    return (FALSE);
+  }
+	
+  if (count == 2) {	/* r/g/b or h/s/v */
+    if (color_model == RGB) {	/* r/g/b */
+      n = sscanf (line, "%d/%d/%d", &rgb[0], &rgb[1], &rgb[2]);
+      if (n != 3 || check_rgb (rgb)) return (TRUE);
+    }
+    else {					/* h/s/v */
+      double h, s, v;
+      n = sscanf (line, "%lf/%lf/%lf", &h, &s, &v);
+      if (n != 3 || check_hsv (h, s, v)) return (TRUE);
+      hsv_to_rgb (rgb, h, s, v);
+    }
+    return (FALSE);
+  }
+	
+  if (count == 0) {				/* gray */
+    n = sscanf (line, "%d", &rgb[0]);
+    rgb[1] = rgb[2] = rgb[0];
+    if (n != 1 || check_rgb (rgb)) return (TRUE);
+    return (FALSE);
+  }
+
+  /* Get here if there is a problem */
+			
+  return (TRUE);
+}
+
+
+void cptInit(CPT *cpt)
+{
+  int k;
+
+  cpt->ncolors = 0;
+  for ( k = 0; k < 3; k++ )
+    {
+      cpt->bfn[k].rgb[0] = 0;
+      cpt->bfn[k].rgb[1] = 0;
+      cpt->bfn[k].rgb[2] = 0;
+      cpt->bfn[k].skip = TRUE;
+    }
+}
+
+#define  READERR  -1
+
+int cptRead(FILE *fp, CPT *cpt)
+{
+  int ncolors;
+  int status = 0;
+  /* Opens and reads a color palette file in RGB, HSV, or CMYK of arbitrary length */
+  int small_chunk = 64;
+  int n = 0, i, nread, annot, n_alloc = small_chunk, color_model, id;
+  double dz;
+  int gap, error = FALSE;
+  char T0[64], T1[64], T2[64], T3[64], T4[64], T5[64], T6[64], T7[64], T8[64], T9[64];
+  char line[BUFSIZ], option[64], c;
+
+  if ( fp == NULL ) return (READERR);
+	
+  cptInit(cpt);
+
+  cpt->lut = (LUT *) calloc(1, n_alloc*sizeof(LUT));
+	
+  /* Save the original setting since it may be modified by settings in the CPT file */
+  color_model = RGB; 
+
+  while ( !error && fgets (line, BUFSIZ, fp) )
+    {
+      if (strstr (line, "COLOR_MODEL"))
+	{	/* cpt file overrides default color model */
+	  if (strstr (line, "RGB") || strstr (line, "rgb"))
+	    color_model = RGB;
+	  else if (strstr (line, "HSV") || strstr (line, "hsv"))
+	    color_model = HSV;
+	  else if (strstr (line, "CMYK") || strstr (line, "cmyk"))
+	    color_model = CMYK;
+	  else
+	    {
+	      fprintf (stderr, "%s: unrecognized COLOR_MODEL\n", __func__);
+	      return (READERR);
+	    }
+	}
+
+      c = line[0];
+      if (c == '#' || c == '\n') continue;	/* Comment or blank */
+		
+      T1[0] = T2[0] = T3[0] = T4[0] = T5[0] = T6[0] = T7[0] = T8[0] = T9[0] = 0;
+      switch (c) {
+      case 'B':
+	id = 0;
+	break;
+      case 'F':
+	id = 1;
+	break;
+      case 'N':
+	id = 2;
+	break;
+      default:
+	id = 3;
+	break;
+      }
+				
+      if ( id < 3 ) {	/* Foreground, background, or nan color */
+	cpt->bfn[id].skip = FALSE;
+	if ((nread = sscanf (&line[2], "%s %s %s %s", T1, T2, T3, T4)) < 1) error = TRUE;
+	if (T1[0] == 'p' || T1[0] == 'P') {	/* Gave a pattern */
+	  fprintf (stderr, "%s: CPT Pattern fill (%s) unsupported!\n", __func__, T1);
+	  return (READERR);
+	}
+	else {	/* Shades, RGB, HSV, or CMYK */
+	  if (T1[0] == '-')	/* Skip this slice */
+	    cpt->bfn[id].skip = TRUE;
+	  else if (nread == 1) {	/* Gray shade */
+	    sprintf (option, "%s", T1);
+	    if (getrgb (option, cpt->bfn[id].rgb, color_model)) error++;
+	  }
+	  else if (color_model == CMYK) {
+	    sprintf (option, "%s/%s/%s/%s", T1, T2, T3, T4);
+	    if (getrgb (option, cpt->bfn[id].rgb, color_model)) error++;
+	  }
+	  else {
+	    sprintf (option, "%s/%s/%s", T1, T2, T3);
+	    if (getrgb (option, cpt->bfn[id].rgb, color_model)) error++;
+	  }
+	}
+	continue;
+      }
+		
+		
+      /* Here we have regular z-slices.  Allowable formats are
+       *
+       * z0 - z1 - [LUB]
+       * z0 pattern z1 - [LUB]
+       * z0 r0 z1 r1 [LUB]
+       * z0 r0 g0 b0 z1 r1 g1 b1 [LUB]
+       * z0 h0 s0 v0 z1 h1 s1 v1 [LUB]
+       * z0 c0 m0 y0 k0 z1 c1 m1 y1 k1 [LUB]
+       */
+
+      /* Determine if psscale need to label these steps by examining for the optional L|U|B character at the end */
+
+      c = line[strlen(line)-2]; 
+      if (c == 'L')
+	cpt->lut[n].annot = 1;
+      else if (c == 'U')
+	cpt->lut[n].annot = 2;
+      else if (c == 'B')
+	cpt->lut[n].annot = 3;
+      /* Chop off this information so it does not affect our column count below */
+      if ( cpt->lut[n].annot ) line[strlen(line)-2] = '\0';
+			
+      /* Chop off this information so it does not affect our column count below */
+      nread = sscanf (line, "%s %s %s %s %s %s %s %s %s %s", T0, T1, T2, T3, T4, T5, T6, T7, T8, T9);
+		
+      if (nread <= 0) continue;						       	/* Probably a line with spaces - skip */
+      if (color_model == CMYK && nread != 10) error = TRUE;			/* CMYK should results in 10 fields */
+      if (color_model != CMYK && !(nread == 4 || nread == 8)) error = TRUE;	/* HSV or RGB should result in 8 fields, gray, patterns, or skips in 4 */
+		
+      cpt->lut[n].z_low = atof (T0);
+      cpt->lut[n].skip = FALSE;
+      if (T1[0] == '-') {				/* Skip this slice */
+	if (nread != 4) {
+	  fprintf (stderr, "%s: z-slice to skip not in [z0 - z1 -] format!\n", __func__);
+	  return (READERR);
+	}
+	cpt->lut[n].z_high = atof (T2);
+	cpt->lut[n].skip = TRUE;		/* Don't paint this slice if possible*/
+	for (i = 0; i < 3; i++) cpt->lut[n].rgb_low[i] = cpt->lut[n].rgb_high[i] = 255;	/* If you must, use page color */
+      }
+      else if (T1[0] == 'p' || T1[0] == 'P') {	/* Gave pattern fill */
+	fprintf (stderr, "%s: CPT Pattern fill (%s) unsupported!\n", __func__, T1);
+	return (READERR);
+      }
+      else {							/* Shades, RGB, HSV, or CMYK */
+	if (nread == 4) {	/* gray shades */
+	  cpt->lut[n].z_high = atof (T2);
+	  cpt->lut[n].rgb_low[0]  = cpt->lut[n].rgb_low[1]  = cpt->lut[n].rgb_low[2]  = irint (atof (T1));
+	  cpt->lut[n].rgb_high[0] = cpt->lut[n].rgb_high[1] = cpt->lut[n].rgb_high[2] = irint (atof (T3));
+	  if ( cpt->lut[n].rgb_low[0] < 0 || cpt->lut[n].rgb_high[0] < 0) error++;
+	}
+	else if (color_model == CMYK) {
+	  cpt->lut[n].z_high = atof (T5);
+	  sprintf (option, "%s/%s/%s/%s", T1, T2, T3, T4);
+	  if (getrgb (option, cpt->lut[n].rgb_low, color_model)) error++;
+	  sprintf (option, "%s/%s/%s/%s", T6, T7, T8, T9);
+	  if (getrgb (option, cpt->lut[n].rgb_high, color_model)) error++;
+	}
+	else {			/* RGB or HSV */
+	  cpt->lut[n].z_high = atof (T4);
+	  sprintf (option, "%s/%s/%s", T1, T2, T3);
+	  if (getrgb (option, cpt->lut[n].rgb_low, color_model)) error++;
+	  sprintf (option, "%s/%s/%s", T5, T6, T7);
+	  if (getrgb (option, cpt->lut[n].rgb_high, color_model)) error++;
+	}
+		
+	dz = cpt->lut[n].z_high - cpt->lut[n].z_low;
+	if ( !(fabs(dz) > 0) ) {
+	  fprintf (stderr, "%s: Z-slice with dz = 0\n", __func__);
+	  return (READERR);
+	}
+	cpt->lut[n].i_dz = 1.0 / dz;
+
+	for (i = 0; i < 3; i++)
+	  cpt->lut[n].rgb_diff[i] = cpt->lut[n].rgb_high[i] - cpt->lut[n].rgb_low[i];	/* Used in get_rgb24 */
+      }
+
+      n++;
+      if (n == n_alloc) {
+	i = n_alloc;
+	n_alloc += small_chunk;
+	cpt->lut = (LUT *) realloc((void *)cpt->lut, (size_t)n_alloc*sizeof (LUT));
+	memset ((void *)&cpt->lut[i], 0, (size_t)(small_chunk * sizeof (LUT)));  /* Initialize new structs to zero */
+      }
+    }
+	
+  fclose (fp);
+
+  if ( error )
+    {
+      fprintf (stderr, "%s: Decoding error\n", __func__);
+      return (READERR);
+    }
+
+  if ( n == 0 )
+    {
+      fprintf (stderr, "%s: CPT file has no z-slices!\n", __func__);
+      return (READERR);
+    }
+		
+  cpt->lut = (LUT *) realloc((void *)cpt->lut, (size_t)n*sizeof (LUT));
+  ncolors = n;
+  for (i = annot = 0, gap = FALSE; i < ncolors - 1; i++) {
+    if ( fabs(cpt->lut[i].z_high - cpt->lut[i+1].z_low) > 0 ) gap = TRUE;
+    annot += cpt->lut[i].annot;
+  }
+
+  annot += cpt->lut[i].annot;
+  if ( gap )
+    {
+      fprintf (stderr, "%s: Color palette table has gaps - aborts!\n", __func__);
+      return (READERR);
+    }
+
+  if (!annot) {	/* Must set default annotation flags */
+    for ( i = 0; i < ncolors; i++ ) cpt->lut[i].annot = 1;
+    cpt->lut[i-1].annot = 3;
+  }
+
+  cpt->ncolors = ncolors;
+
+  return (status);
+}
+
+
+int cptWrite(FILE *fp, CPT cpt)
+{
+  char code[3] = {'B', 'F', 'N'};
+  int n, k;
+  int status = 0;
+
+  for ( n = 0; n < cpt.ncolors; n++ )
+    {
+      fprintf(fp, "%g\t%d\t%d\t%d\t%g\t%d\t%d\t%d\n",
+	     cpt.lut[n].z_low, cpt.lut[n].rgb_low[0], cpt.lut[n].rgb_low[1], cpt.lut[n].rgb_low[2],
+	     cpt.lut[n].z_high, cpt.lut[n].rgb_high[0], cpt.lut[n].rgb_high[1], cpt.lut[n].rgb_high[2]);
+    }
+
+  for ( k = 0; k < 3; k++ )
+    {
+      if ( cpt.bfn[k].skip )
+	fprintf(fp, "%c -\n", code[k]);
+      else
+	fprintf(fp, "%c\t%d\t%d\t%d\n", code[k], cpt.bfn[k].rgb[0], cpt.bfn[k].rgb[1], cpt.bfn[k].rgb[2]);
+    }
+
+  return (status);
+}
+
+
+int cptWriteC(FILE *fp, CPT cpt, const char *name)
+{
+  char lut_name[4096];
+  char cpt_name[4096];
+  int n, k;
+  int status = 0;
+
+  strcpy(lut_name, name);
+  strcat(lut_name, "_lut");
+  strcpy(cpt_name, name);
+  strcat(cpt_name, "_cpt");
+
+  fprintf(fp, "\nstatic LUT %s[] = {\n", lut_name);
+  for ( n = 0; n < cpt.ncolors; n++ )
+    {
+      fprintf(fp, "  { %7g, %7g, %7g, {%3d, %3d, %3d}, {%3d, %3d, %3d}, {%3d, %3d, %3d}, %d, %d},\n",
+	      cpt.lut[n].z_low, cpt.lut[n].z_high, cpt.lut[n].i_dz,
+	      cpt.lut[n].rgb_low[0], cpt.lut[n].rgb_low[1], cpt.lut[n].rgb_low[2],
+	      cpt.lut[n].rgb_high[0], cpt.lut[n].rgb_high[1], cpt.lut[n].rgb_high[2],
+	      cpt.lut[n].rgb_diff[0], cpt.lut[n].rgb_diff[1], cpt.lut[n].rgb_diff[2],
+	      cpt.lut[n].annot, cpt.lut[n].skip);
+    }
+  fprintf(fp, "};\n");
+
+  fprintf(fp, "\nstatic const CPT %s = {\n", cpt_name);
+  fprintf(fp, "  %d,\n", cpt.ncolors);
+  fprintf(fp, "  %s,\n", lut_name);
+  fprintf(fp, "  {\n");
+  for ( k = 0; k < 3; k++ )
+    {
+      fprintf(fp, "    {{%3d, %3d, %3d}, %d},\n",
+	      cpt.bfn[k].rgb[0], cpt.bfn[k].rgb[1], cpt.bfn[k].rgb[2], cpt.bfn[k].skip);
+    }
+  fprintf(fp, "  }\n");
+  fprintf(fp, "};\n");
+
+  return (status);
+}
diff --git a/src/color.h b/src/color.h
new file mode 100644
index 0000000..cbab956
--- /dev/null
+++ b/src/color.h
@@ -0,0 +1,32 @@
+#ifndef _COLOR_H
+#define _COLOR_H
+
+typedef struct{
+  double z_low, z_high, i_dz;
+  int rgb_low[3], rgb_high[3], rgb_diff[3];
+  int annot;
+  int skip;
+}
+LUT;
+
+
+typedef struct {	/* For back-, fore-, and nan-colors */
+  int rgb[3];
+  int skip;
+}
+BFN_COLOR;
+
+
+typedef struct {
+  int       ncolors;
+  LUT      *lut;
+  BFN_COLOR bfn[3];
+}
+CPT;
+
+
+int cptRead(FILE *fp, CPT *cpt);
+int cptWrite(FILE *fp, CPT cpt);
+int cptWriteC(FILE *fp, CPT cpt, const char *name);
+
+#endif  /* _COLOR_H */
diff --git a/src/commandline.c b/src/commandline.c
new file mode 100644
index 0000000..431c02e
--- /dev/null
+++ b/src/commandline.c
@@ -0,0 +1,81 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <string.h>
+
+static int gargc = 0;
+static char **gargv;
+
+static char CommandLine[1024];
+
+void initCommandLine(void)
+{
+  int iarg;
+  char *pargv;
+  size_t len, offset = 0;
+  /*
+  time_t tp;
+  struct tm *ltime;
+
+  tp = time(NULL);
+
+  if ( tp != -1 )
+    {
+      ltime = localtime(&tp);
+      offset = strftime(CommandLine, 1024, "%d %b %Y : ", ltime);
+    }
+    */
+  for ( iarg = 0; iarg < gargc; iarg++ )
+    {
+      if ( iarg == 0 )
+	{
+	  pargv = strrchr(gargv[iarg], '/');
+	  if ( pargv == 0 ) pargv = gargv[0];
+	  else              pargv++;
+	}
+      else
+	pargv = gargv[iarg];
+
+      len = strlen(pargv);
+      if ( offset+len+1 > 1024 ) break;
+      memcpy(CommandLine+offset, pargv, len);
+      offset += len;
+      CommandLine[offset] = ' ';
+      offset++;
+    }
+
+  CommandLine[offset-1] = '\0';
+}
+
+char *commandLine(void)
+{
+  static int init = 0;
+
+  if ( init == 0 )
+    {
+      initCommandLine();
+      init = 1;
+    }
+
+  return (CommandLine);
+}
+
+void setCommandLine(int argc, char **argv)
+{
+  gargc = argc;
+  gargv = argv;
+}
diff --git a/src/config.h.in b/src/config.h.in
new file mode 100644
index 0000000..58956e8
--- /dev/null
+++ b/src/config.h.in
@@ -0,0 +1,226 @@
+/* src/config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Compiler */
+#undef COMPILER
+
+/* Compiler version */
+#undef COMP_VERSION
+
+/* Define to 1 if you have the declaration of `isnan', and to 0 if you don't.
+   */
+#undef HAVE_DECL_ISNAN
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the `gethostname' function. */
+#undef HAVE_GETHOSTNAME
+
+/* Define to 1 if you have the `getpagesize' function. */
+#undef HAVE_GETPAGESIZE
+
+/* Define to 1 if you have the `getrlimit' function. */
+#undef HAVE_GETRLIMIT
+
+/* Define to 1 if you have the <grib_api.h> header file. */
+#undef HAVE_GRIB_API_H
+
+/* Define to 1 if you have the <hdf5.h> header file. */
+#undef HAVE_HDF5_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <jasper.h> header file. */
+#undef HAVE_JASPER_H
+
+/* Define to 1 for GRIB1 decoding/encoding with cgribex */
+#undef HAVE_LIBCGRIBEX
+
+/* Define to 1 for EXTRA interface */
+#undef HAVE_LIBEXTRA
+
+/* Define to 1 for GRIB support */
+#undef HAVE_LIBGRIB
+
+/* GRIB_API library is present if defined to 1 */
+#undef HAVE_LIBGRIB_API
+
+/* Define to 1 for HDF5 support */
+#undef HAVE_LIBHDF5
+
+/* Define to 1 for IEG interface */
+#undef HAVE_LIBIEG
+
+/* Define to 1 for JPEG compression for GRIB2 */
+#undef HAVE_LIBJASPER
+
+/* Define to 1 if you have the `m' library (-lm). */
+#undef HAVE_LIBM
+
+/* Define to 1 for MAGICS support */
+#undef HAVE_LIBMAGICS
+
+/* Define to 1 if you have the `malloc' library (-lmalloc). */
+#undef HAVE_LIBMALLOC
+
+/* Define to 1 for NETCDF OpenDAP */
+#undef HAVE_LIBNC_DAP
+
+/* Define to 1 for NETCDF support */
+#undef HAVE_LIBNETCDF
+
+/* Define to 1 for PROJ support */
+#undef HAVE_LIBPROJ
+
+/* Define to 1 if you have the `pthread' library (-lpthread). */
+#undef HAVE_LIBPTHREAD
+
+/* Define to 1 for SERVICE interface */
+#undef HAVE_LIBSERVICE
+
+/* Define to 1 for SZIP support */
+#undef HAVE_LIBSZ
+
+/* Define to 1 for UDUNITS2 support */
+#undef HAVE_LIBUDUNITS2
+
+/* Define to 1 for XML2 support */
+#undef HAVE_LIBXML2
+
+/* Define to 1 if you have the <libxml/parser.h> header file. */
+#undef HAVE_LIBXML_PARSER_H
+
+/* Define to 1 if you have the <libxml/tree.h> header file. */
+#undef HAVE_LIBXML_TREE_H
+
+/* Define 1 for ZLIB support */
+#undef HAVE_LIBZ
+
+/* Define to 1 if you have the <magics_api.h> header file. */
+#undef HAVE_MAGICS_API_H
+
+/* Define to 1 if you have the `mallinfo' function. */
+#undef HAVE_MALLINFO
+
+/* Define to 1 if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have a working `mmap' system call. */
+#undef HAVE_MMAP
+
+/* Define to 1 for NETCDF2 support */
+#undef HAVE_NETCDF2
+
+/* Define to 1 for NETCDF4 support */
+#undef HAVE_NETCDF4
+
+/* Define to 1 if you have the <netcdf.h> header file. */
+#undef HAVE_NETCDF_H
+
+/* Define to 1 if you have the <proj_api.h> header file. */
+#undef HAVE_PROJ_API_H
+
+/* Define if you have POSIX threads libraries and header files. */
+#undef HAVE_PTHREAD
+
+/* Define to 1 if you have the <pthread.h> header file. */
+#undef HAVE_PTHREAD_H
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define to 1 if `st_blksize' is a member of `struct stat'. */
+#undef HAVE_STRUCT_STAT_ST_BLKSIZE
+
+/* Define to 1 if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define to 1 if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/times.h> header file. */
+#undef HAVE_SYS_TIMES_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <szlib.h> header file. */
+#undef HAVE_SZLIB_H
+
+/* Define to 1 if you have the <udunits2.h> header file. */
+#undef HAVE_UDUNITS2_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the <zlib.h> header file. */
+#undef HAVE_ZLIB_H
+
+/* Host name */
+#undef HOST_NAME
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Define to 1 if your C compiler doesn't accept -c and -o together. */
+#undef NO_MINUS_C_MINUS_O
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define to necessary symbol if this constant uses a non-standard name on
+   your system. */
+#undef PTHREAD_CREATE_JOINABLE
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* System type */
+#undef SYSTEM_TYPE
+
+/* User name */
+#undef USER_NAME
+
+/* Version number of package */
+#undef VERSION
+
+/* Number of bits in a file offset, on hosts where this is settable. */
+#undef _FILE_OFFSET_BITS
+
+/* Define for large files, on AIX-style hosts. */
+#undef _LARGE_FILES
diff --git a/src/const.h b/src/const.h
new file mode 100644
index 0000000..0626b36
--- /dev/null
+++ b/src/const.h
@@ -0,0 +1,33 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2012-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _CONST_H
+#define _CONST_H
+
+#define  MIN_PS      20000
+#define  MAX_PS     120000
+
+#define  MIN_FIS   -100000
+#define  MAX_FIS    100000
+
+#define  MIN_T         150
+#define  MAX_T         400
+
+#define  MIN_Q           0
+#define  MAX_Q         0.1
+
+#endif  /* _CONST_H */
diff --git a/src/counter.h b/src/counter.h
new file mode 100644
index 0000000..ead52bd
--- /dev/null
+++ b/src/counter.h
@@ -0,0 +1,14 @@
+#ifndef _COUNTER_H
+#define _COUNTER_H
+
+typedef struct {
+  double cputime;
+  char   mark[32];
+}
+counter_t;
+
+void counter_start(counter_t *counter);
+void counter_stop(counter_t *counter);
+double counter_cputime(counter_t counter);
+
+#endif  /* _COUNTER_H */
diff --git a/src/dmemory.h b/src/dmemory.h
new file mode 100644
index 0000000..5922c39
--- /dev/null
+++ b/src/dmemory.h
@@ -0,0 +1,45 @@
+#ifndef _DMEMORY_H
+#define _DMEMORY_H
+
+#include <stdlib.h>
+
+/*
+ * if DEBUG_MEMORY is defined setenv MEMORY_DEBUG to debug memory
+ */
+
+#define  DEBUG_MEMORY
+
+#ifndef  WITH_CALLER_NAME
+#define  WITH_CALLER_NAME
+#endif
+
+extern size_t  memTotal(void);
+extern void    memDebug(int debug);
+extern void    memExitOnError(void);
+
+#if  defined  DEBUG_MEMORY
+
+extern void   *Realloc(const char *caller, const char *file, int line, void *ptr, size_t size);
+extern void   *Calloc (const char *caller, const char *file, int line, size_t nmemb, size_t size);
+extern void   *Malloc (const char *caller, const char *file, int line, size_t size);
+extern void    Free   (const char *caller, const char *file, int line, void *ptr);
+
+#if  defined  calloc
+#  undef  calloc
+#endif
+
+#if  defined  WITH_CALLER_NAME
+#  define  realloc(p, s)  Realloc(__func__, __FILE__, __LINE__, p, (size_t)s)
+#  define   calloc(n, s)   Calloc(__func__, __FILE__, __LINE__, n, (size_t)s)
+#  define   malloc(s)      Malloc(__func__, __FILE__, __LINE__, (size_t)s)
+#  define     free(p)        Free(__func__, __FILE__, __LINE__, p)
+#else
+#  define  realloc(p, s)  Realloc((void *) NULL, __FILE__, __LINE__, p, (size_t)s)
+#  define   calloc(n, s)   Calloc((void *) NULL, __FILE__, __LINE__, n, (size_t)s)
+#  define   malloc(s)      Malloc((void *) NULL, __FILE__, __LINE__, (size_t)s)
+#  define     free(p)        Free((void *) NULL, __FILE__, __LINE__, p)
+#endif
+
+#endif /* DEBUG_MEMORY */
+
+#endif /* _DMEMORY_H */
diff --git a/src/dtypes.h b/src/dtypes.h
new file mode 100644
index 0000000..4072754
--- /dev/null
+++ b/src/dtypes.h
@@ -0,0 +1,48 @@
+#ifndef _DTYPES_H
+#define _DTYPES_H
+
+#include <stdio.h>
+#include <limits.h>
+
+/* INT32 */
+
+#if ! defined (INT_MAX)
+#  error INT_MAX undefined
+#endif
+
+#undef  INT32
+#if  INT_MAX == 2147483647L
+#  define  INT32  int
+#elif LONG_MAX == 2147483647L
+#  define  INT32  long
+#endif
+
+/* INT64 */
+
+#if ! defined (LONG_MAX)
+#  error LONG_MAX undefined
+#endif
+
+#undef  INT64
+#if  LONG_MAX > 2147483647L
+#  define  INT64  long
+#else
+#  define  INT64  long long
+#endif
+
+/* FLT32 */
+
+#undef   FLT32
+#define  FLT32  float
+
+/* FLT64 */
+
+#undef   FLT64
+#define  FLT64  double
+
+/* UINT32 and UINT64 */
+
+#define  UINT32   unsigned INT32
+#define  UINT64   unsigned INT64
+
+#endif  /* _DTYPES_H */
diff --git a/src/ecacore.c b/src/ecacore.c
new file mode 100755
index 0000000..3222a60
--- /dev/null
+++ b/src/ecacore.c
@@ -0,0 +1,1513 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <assert.h>
+#include <string.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "grid.h"
+#include "pstream.h"
+#include "dtypes.h"
+#include "ecacore.h"
+#include "ecautil.h"
+
+#define FIRST_VAR_ID 0
+
+#define IS_NOT_SET(x) (x == NULL)
+#define IS_SET(x)     (x != NULL)
+
+
+void eca1(const ECA_REQUEST_1 *request)
+{
+  const int operatorID = cdoOperatorID();
+  
+  int cmplen;
+  char indate1[DATE_LEN+1], indate2[DATE_LEN+1];
+  int gridsize;
+  int ivdate = 0, ivtime = 0;
+  int ovdate = 0, ovtime = 0;
+  int nrecs, nrecords;
+  int gridID, zaxisID, varID, levelID, recID;
+  int itsID;
+  int otsID;
+  long nsets;
+  int i;
+  int istreamID, ostreamID;
+  int ivlistID, ovlistID, itaxisID, otaxisID;
+  int nlevels;
+  int *recVarID, *recLevelID;
+  double missval;
+  field_t *var12 = NULL, *samp1 = NULL, *samp2 = NULL, *var13 = NULL, *var21 = NULL, *var23 = NULL, *var;
+  field_t field1, field2;
+  
+  cmplen = DATE_LEN - cdoOperatorF2(operatorID);
+
+  istreamID = streamOpenRead(cdoStreamName(0));
+  if ( istreamID < 0 ) cdiError(istreamID, "Open failed on %s", cdoStreamName(0));
+
+  ivlistID = streamInqVlist(istreamID);
+  ovlistID = vlistCreate();
+  
+  gridID  = vlistInqVarGrid(ivlistID, FIRST_VAR_ID);
+  zaxisID = vlistInqVarZaxis(ivlistID, FIRST_VAR_ID);
+  missval = vlistInqVarMissval(ivlistID, FIRST_VAR_ID);
+
+  varID   = vlistDefVar(ovlistID, gridID, zaxisID, TSTEP_INSTANT);
+
+  vlistDefVarMissval(ovlistID, varID, missval);
+  
+  if ( IS_SET(request->var1.name) )
+    vlistDefVarName(ovlistID, varID, request->var1.name);
+  if ( IS_SET(request->var1.longname) ) 
+    vlistDefVarLongname(ovlistID, varID, request->var1.longname);
+  if ( IS_SET(request->var1.units) ) 
+    vlistDefVarUnits(ovlistID, varID, request->var1.units);
+
+  if ( IS_SET(request->var2.h2) || IS_SET(request->var2.h3) )
+    {
+      varID = vlistDefVar(ovlistID, gridID, zaxisID, TSTEP_INSTANT);
+  
+      vlistDefVarMissval(ovlistID, varID, missval);
+
+      if ( IS_SET(request->var2.name) ) 
+        vlistDefVarName(ovlistID, varID, request->var2.name);
+      if ( IS_SET(request->var2.longname) ) 
+        vlistDefVarLongname(ovlistID, varID, request->var2.longname);
+      if ( IS_SET(request->var2.units) ) 
+        vlistDefVarUnits(ovlistID, varID, request->var2.units);
+    }
+    
+  if ( cdoOperatorF2(operatorID) == 16 ) vlistDefNtsteps(ovlistID, 1);
+
+  itaxisID = vlistInqTaxis(ivlistID);
+  otaxisID = taxisCreate(TAXIS_RELATIVE);
+  taxisDefTunit(otaxisID, TUNIT_MINUTE);
+  //  taxisDefCalendar(otaxisID, CALENDAR_PROLEPTIC);
+  taxisDefCalendar(otaxisID, taxisInqCalendar(itaxisID));
+  taxisDefRdate(otaxisID, 19550101);
+  taxisDefRtime(otaxisID, 0);
+  vlistDefTaxis(ovlistID, otaxisID);
+
+  ostreamID = streamOpenWrite(cdoStreamName(1), cdoFiletype());
+  if ( ostreamID < 0 ) cdiError(ostreamID, "Open failed on %s", cdoStreamName(1));
+
+  streamDefVlist(ostreamID, ovlistID);
+
+  nrecords   = vlistNrecs(ivlistID);
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = gridInqSize(gridID);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  if ( IS_SET(request->var2.h2) || IS_SET(request->var2.h3) ) 
+    field2.ptr = (double *) malloc(gridsize*sizeof(double));
+  else
+    field2.ptr = NULL;
+
+  nlevels = zaxisInqSize(zaxisID);
+
+  var12 = (field_t *) malloc(nlevels*sizeof(field_t));
+  samp1 = (field_t *) malloc(nlevels*sizeof(field_t));
+  samp2 = (field_t *) malloc(nlevels*sizeof(field_t));
+  if ( IS_SET(request->var1.f3) ) 
+    var13 = (field_t *) malloc(nlevels*sizeof(field_t));
+    
+  if ( IS_SET(request->var2.h2) ) 
+    var21 = (field_t *) malloc(nlevels*sizeof(field_t));
+  if ( IS_SET(request->var2.h3) ) 
+    var23 = (field_t *) malloc(nlevels*sizeof(field_t));
+      
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      var12[levelID].grid    = gridID;
+      var12[levelID].nmiss   = 0;
+      var12[levelID].missval = missval;
+      var12[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+
+      samp1[levelID].grid    = gridID;
+      samp1[levelID].nmiss   = 0;
+      samp1[levelID].missval = missval;
+      samp1[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+
+      samp2[levelID].grid    = gridID;
+      samp2[levelID].nmiss   = 0;
+      samp2[levelID].missval = missval;
+      samp2[levelID].ptr     = NULL;
+
+      if ( IS_SET(request->var1.f3) )
+        {
+          var13[levelID].grid    = gridID;
+          var13[levelID].nmiss   = 0;
+          var13[levelID].missval = missval;
+          var13[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+        }
+      if ( IS_SET(request->var2.h2) )
+        {
+          var21[levelID].grid    = gridID;
+          var21[levelID].nmiss   = 0;
+          var21[levelID].missval = missval;
+          var21[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+        }
+      if ( IS_SET(request->var2.h3) )
+        {
+          var23[levelID].grid    = gridID;
+          var23[levelID].nmiss   = 0;
+          var23[levelID].missval = missval;
+          var23[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+        }
+    }
+
+  itsID   = 0;
+  otsID   = 0;
+  while ( TRUE )
+    {
+      nsets = 0;
+      while ( (nrecs = streamInqTimestep(istreamID, itsID)) > 0 )
+        {
+          ivdate = taxisInqVdate(itaxisID);
+          ivtime = taxisInqVtime(itaxisID);
+
+	  if ( nsets == 0 ) SET_DATE(indate2, ivdate, ivtime);
+	  SET_DATE(indate1, ivdate, ivtime);
+
+	  if ( DATE_IS_NEQ(indate1, indate2, cmplen) ) break;
+
+          for ( recID = 0; recID < nrecs; recID++ )
+            {
+              streamInqRecord(istreamID, &varID, &levelID);
+
+              if ( itsID == 0 )
+                {
+                  recVarID[recID]   = varID;
+                  recLevelID[recID] = levelID;
+                }
+              if ( varID != FIRST_VAR_ID ) continue;
+
+              if ( nsets == 0 )
+                {
+                  for ( i = 0; i < gridsize; i++ )
+                    {
+                      var12[levelID].ptr[i] = missval;
+                      samp1[levelID].ptr[i] = missval;
+                      if ( IS_SET(samp2[levelID].ptr) ) samp2[levelID].ptr[i] = 0.0;
+                      if ( IS_SET(request->var1.f3) ) var13[levelID].ptr[i] = missval;
+                      if ( IS_SET(request->var2.h2) ) var21[levelID].ptr[i] = missval;
+                      if ( IS_SET(request->var2.h3) ) var23[levelID].ptr[i] = missval;
+                    }
+                  var12[levelID].nmiss = gridsize;
+                  samp1[levelID].nmiss = gridsize;
+                  if ( IS_SET(request->var1.f3) ) var13[levelID].nmiss = gridsize;
+                  if ( IS_SET(request->var2.h2) ) var21[levelID].nmiss = gridsize; 
+                  if ( IS_SET(request->var2.h3) ) var23[levelID].nmiss = gridsize; 
+                }
+
+              streamReadRecord(istreamID, field1.ptr, &field1.nmiss);
+              field1.grid    = var12[levelID].grid;
+              field1.missval = var12[levelID].missval;
+              
+              farnum(&samp1[levelID], field1);
+
+              if ( IS_SET(request->var2.h2) )
+                {
+                  memcpy(field2.ptr, field1.ptr, gridsize*sizeof(double));
+                  field2.nmiss   = field1.nmiss;
+                  field2.grid    = field1.grid;
+                  field2.missval = field1.missval;
+                }
+		
+              if ( IS_SET(request->var1.f1) ) 
+                request->var1.f1(&field1, request->var1.f1arg);
+
+              if ( field1.nmiss > 0 || IS_SET(samp2[levelID].ptr) )
+                {
+                  if ( IS_NOT_SET(samp2[levelID].ptr) )
+                    {
+                      samp2[levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+                      for ( i = 0; i < gridsize; i++ )
+                        samp2[levelID].ptr[i] = nsets;
+                    }
+                  for ( i = 0; i < gridsize; i++ )
+                    {
+                      if ( DBL_IS_EQUAL(field1.ptr[i], field1.missval) )
+                        continue;
+                      samp2[levelID].ptr[i]++;
+                    }
+                }
+              
+              if ( IS_NOT_EQUAL(request->var1.mulc, 0.0) )
+                farcmul(&field1, request->var1.mulc);
+              if ( IS_NOT_EQUAL(request->var1.addc, 0.0) )
+                farcadd(&field1, request->var1.addc);
+                
+              request->var1.f2(&var12[levelID], field1);
+              
+              if ( IS_SET(request->var2.h2) || IS_SET(request->var2.h3) )
+                { 
+                  /* if h2 is null, use the output of f2 as input for h1 */
+                  if ( IS_NOT_SET(request->var2.h2) )
+                    {
+                      memcpy(field2.ptr, var12[levelID].ptr, gridsize*sizeof(double));
+                      field2.nmiss   = var12[levelID].nmiss;
+                      field2.grid    = var12[levelID].grid;
+                      field2.missval = var12[levelID].missval;
+                    }
+                  
+                  if ( IS_SET(request->var2.h1) ) 
+                    request->var2.h1(&field2, request->var2.h1arg);
+                        
+                  if ( IS_NOT_SET(request->var2.h2) )    
+                    request->var2.h3(&var23[levelID], field2);
+                  else
+                    {
+                      request->var2.h2(&var21[levelID], field2);
+                      if ( IS_SET(request->var2.h3) )
+                        request->var2.h3(&var23[levelID], var21[levelID]);
+                    }
+                }
+
+              if ( IS_SET(request->var1.f3) )
+                request->var1.f3(&var13[levelID], var12[levelID]);
+            }
+
+          ovdate = ivdate;
+          ovtime = ivtime;
+          nsets++;
+          itsID++;
+        }
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+      
+      if ( request->var1.epilog == MEAN || request->var1.epilog == PERCENT_OF_TIME )
+        for ( levelID = 0; levelID < nlevels; levelID++ )
+          {
+            if ( IS_SET(request->var1.f3) )
+              var = &var13[levelID];
+            else 
+              var = &var12[levelID];
+              
+            if ( IS_NOT_SET(samp2[levelID].ptr) )
+              farcdiv(var, nsets);
+            else
+              fardiv(var, samp2[levelID]);
+              
+            if ( request->var1.epilog == PERCENT_OF_TIME )
+              farcmul(var, 100.0);
+          }
+
+      taxisDefVdate(otaxisID, ovdate);
+      taxisDefVtime(otaxisID, ovtime);
+      streamDefTimestep(ostreamID, otsID);
+
+      if ( otsID && vlistInqVarTsteptype(ivlistID, FIRST_VAR_ID) == TSTEP_CONSTANT ) continue;
+
+      varID = 0;
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	{
+	  if ( IS_SET(request->var1.f3) )
+	    var = &var13[levelID];
+	  else 
+	    var = &var12[levelID];
+              
+	  farsel(var, samp1[levelID]);
+
+	  streamDefRecord(ostreamID, varID, levelID);
+	  streamWriteRecord(ostreamID, var->ptr, var->nmiss);
+	}
+      if ( IS_SET(request->var2.h2) || IS_SET(request->var2.h3) )
+	{
+	  varID = 1;
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    {
+	      if ( IS_SET(request->var2.h3) )
+		var = &var23[levelID];
+	      else 
+		var = &var21[levelID];
+                  
+	      farsel(var, samp1[levelID]);
+                  
+	      streamDefRecord(ostreamID, varID, levelID);
+	      streamWriteRecord(ostreamID, var->ptr, var->nmiss);
+	    }
+        }
+
+      if ( nrecs == 0 ) break;
+      otsID++;
+    }
+
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      free(var12[levelID].ptr);
+      free(samp1[levelID].ptr);
+      if ( IS_SET(samp2[levelID].ptr) ) free(samp2[levelID].ptr);
+    }  
+  free(var12);
+  free(samp1);
+  free(samp2);
+  
+  if ( IS_SET(var13) ) 
+    {
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        free(var13[levelID].ptr);
+      free(var13);
+    }
+  if ( IS_SET(var21) ) 
+    {
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        free(var21[levelID].ptr);
+      free(var21);
+    }
+  if ( IS_SET(var23) ) 
+    {
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        free(var23[levelID].ptr);
+      free(var23);
+    }
+    
+  if ( IS_SET(field1.ptr) ) free(field1.ptr);
+  if ( IS_SET(field2.ptr) ) free(field2.ptr);
+
+  if ( IS_SET(recVarID) )   free(recVarID);
+  if ( IS_SET(recLevelID) ) free(recLevelID);
+
+  streamClose(ostreamID);
+  streamClose(istreamID);
+}
+
+
+void eca2(const ECA_REQUEST_2 *request)
+{
+  const int operatorID = cdoOperatorID();
+  
+  int cmplen;
+  char indate1[DATE_LEN+1], indate2[DATE_LEN+1];
+  int gridsize;
+  int ivdate = 0, ivtime = 0;
+  int ovdate = 0, ovtime = 0;
+  int nrecs, nrecords;
+  int gridID, zaxisID, varID, levelID, recID;
+  int itsID;
+  int otsID;
+  long nsets;
+  int i;
+  int istreamID1, istreamID2, ostreamID;
+  int ivlistID1, ivlistID2, ovlistID, itaxisID1, itaxisID2, otaxisID;
+  int nlevels;
+  int *recVarID, *recLevelID;
+  double missval1, missval2;
+  field_t *var14 = NULL, *samp1 = NULL, *samp2 = NULL, *samp3 = NULL, *total = NULL, *var15 = NULL, *var22 = NULL, *var;
+  field_t field1, field2;
+  
+  cmplen = DATE_LEN - cdoOperatorF2(operatorID);
+
+  istreamID1 = streamOpenRead(cdoStreamName(0));
+  if ( istreamID1 < 0 ) cdiError(istreamID1, "Open failed on %s", cdoStreamName(0));
+  istreamID2 = streamOpenRead(cdoStreamName(1));
+  if ( istreamID2 < 0 ) cdiError(istreamID2, "Open failed on %s", cdoStreamName(1));
+
+  ivlistID1 = streamInqVlist(istreamID1);
+  ivlistID2 = streamInqVlist(istreamID2);
+  ovlistID  = vlistCreate();
+  
+  vlistCompare(ivlistID1, ivlistID2, CMP_ALL);
+  
+  gridID  = vlistInqVarGrid(ivlistID1, FIRST_VAR_ID);
+  zaxisID = vlistInqVarZaxis(ivlistID1, FIRST_VAR_ID);
+  missval1 = vlistInqVarMissval(ivlistID1, FIRST_VAR_ID);
+  missval2 = vlistInqVarMissval(ivlistID2, FIRST_VAR_ID);
+
+  varID   = vlistDefVar(ovlistID, gridID, zaxisID, TSTEP_INSTANT);
+  
+  vlistDefVarMissval(ovlistID, varID, missval1);
+
+  if ( IS_SET(request->var1.name) ) 
+    vlistDefVarName(ovlistID, varID, request->var1.name);
+  if ( IS_SET(request->var1.longname) ) 
+    vlistDefVarLongname(ovlistID, varID, request->var1.longname);
+  if ( IS_SET(request->var1.units) ) 
+    vlistDefVarUnits(ovlistID, varID, request->var1.units);
+
+  if ( IS_SET(request->var2.h2) )
+    {
+      varID = vlistDefVar(ovlistID, gridID, zaxisID, TSTEP_INSTANT);
+  
+      vlistDefVarMissval(ovlistID, varID, missval1);
+
+      if ( IS_SET(request->var2.name) ) 
+        vlistDefVarName(ovlistID, varID, request->var2.name);
+      if ( IS_SET(request->var2.longname) ) 
+        vlistDefVarLongname(ovlistID, varID, request->var2.longname);
+      if ( IS_SET(request->var2.units) ) 
+        vlistDefVarUnits(ovlistID, varID, request->var2.units);
+    }
+
+  if ( cdoOperatorF2(operatorID) == 16 ) vlistDefNtsteps(ovlistID, 1);
+
+  itaxisID1 = vlistInqTaxis(ivlistID1);
+  itaxisID2 = vlistInqTaxis(ivlistID2);
+  otaxisID = taxisCreate(TAXIS_RELATIVE);
+  taxisDefTunit(otaxisID, TUNIT_MINUTE);
+  //  taxisDefCalendar(otaxisID, CALENDAR_PROLEPTIC);
+  taxisDefCalendar(otaxisID, taxisInqCalendar(itaxisID1));
+  taxisDefRdate(otaxisID, 19550101);
+  taxisDefRtime(otaxisID, 0);
+  vlistDefTaxis(ovlistID, otaxisID);
+
+  ostreamID = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+  if ( ostreamID < 0 ) cdiError(ostreamID, "Open failed on %s", cdoStreamName(2));
+
+  streamDefVlist(ostreamID, ovlistID);
+
+  nrecords   = vlistNrecs(ivlistID1);
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = gridInqSize(gridID);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  nlevels = zaxisInqSize(zaxisID);
+  
+  var14 = (field_t *) malloc(nlevels*sizeof(field_t));
+  samp1 = (field_t *) malloc(nlevels*sizeof(field_t));
+  samp2 = (field_t *) malloc(nlevels*sizeof(field_t));
+  samp3 = (field_t *) malloc(nlevels*sizeof(field_t));
+  
+  if ( request->var1.epilog == PERCENT_OF_TOTAL_AMOUNT )
+    total = (field_t *) malloc(nlevels*sizeof(field_t));
+  if ( IS_SET(request->var1.f5) )
+    var15 = (field_t *) malloc(nlevels*sizeof(field_t));
+  if ( IS_SET(request->var2.h2) )
+    var22 = (field_t *) malloc(nlevels*sizeof(field_t));
+      
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      var14[levelID].grid    = gridID;
+      var14[levelID].nmiss   = 0;
+      var14[levelID].missval = missval1;
+      var14[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+      
+      samp1[levelID].grid    = gridID;
+      samp1[levelID].nmiss   = 0;
+      samp1[levelID].missval = missval1;
+      samp1[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+
+      samp2[levelID].grid    = gridID;
+      samp2[levelID].nmiss   = 0;
+      samp2[levelID].missval = missval1;
+      samp2[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+
+      samp3[levelID].grid    = gridID;
+      samp3[levelID].nmiss   = 0;
+      samp3[levelID].missval = missval1;
+      samp3[levelID].ptr     = NULL;
+      
+      if ( request->var1.epilog == PERCENT_OF_TOTAL_AMOUNT )
+        {
+          total[levelID].grid    = gridID;
+          total[levelID].nmiss   = 0;
+          total[levelID].missval = missval1;
+          total[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+        }
+      if ( IS_SET(request->var1.f5) )
+        {
+          var15[levelID].grid    = gridID;
+          var15[levelID].nmiss   = 0;
+          var15[levelID].missval = missval1;
+          var15[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+        }
+      if ( IS_SET(request->var2.h2) )
+        {
+          var22[levelID].grid    = gridID;
+          var22[levelID].nmiss   = 0;
+          var22[levelID].missval = missval1;
+          var22[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+        }
+    }
+
+  itsID   = 0;
+  otsID   = 0;
+  while ( TRUE )
+    {
+      nsets = 0;
+      while ( (nrecs = streamInqTimestep(istreamID1, itsID)) > 0 )
+        {
+	  if ( !streamInqTimestep(istreamID2, itsID) )
+	    cdoAbort("Input streams have different number of time steps!");
+
+          ivdate = taxisInqVdate(itaxisID1);
+          ivtime = taxisInqVtime(itaxisID1);
+          
+	  if ( nsets == 0 ) SET_DATE(indate2, ivdate, ivtime);
+	  SET_DATE(indate1, ivdate, ivtime);
+
+	  if ( DATE_IS_NEQ(indate1, indate2, cmplen) ) break;
+
+          for ( recID = 0; recID < nrecs; recID++ )
+            {
+              streamInqRecord(istreamID1, &varID, &levelID);
+              streamInqRecord(istreamID2, &varID, &levelID);
+
+              if ( itsID == 0 )
+                {
+                  recVarID[recID]   = varID;
+                  recLevelID[recID] = levelID;
+                }
+              if ( varID != FIRST_VAR_ID ) continue;
+
+              if ( nsets == 0 )
+                {
+                  for ( i = 0; i < gridsize; i++ )
+                    {
+                      var14[levelID].ptr[i] = missval1;
+                      samp1[levelID].ptr[i] = missval1;
+                      samp2[levelID].ptr[i] = missval1;
+                      if ( IS_SET(samp3[levelID].ptr) )
+                        samp3[levelID].ptr[i] = 0.0;
+                      if ( request->var1.epilog == PERCENT_OF_TOTAL_AMOUNT )
+                        total[levelID].ptr[i] = 0.0;
+                      if ( IS_SET(request->var1.f5) ) 
+                        var15[levelID].ptr[i] = missval1;
+                      if ( IS_SET(request->var2.h2) ) 
+                        var22[levelID].ptr[i] = missval1;
+                    }
+                  var14[levelID].nmiss = gridsize;
+                  samp1[levelID].nmiss = gridsize;
+                  samp2[levelID].nmiss = gridsize;
+                  if ( request->var1.epilog == PERCENT_OF_TOTAL_AMOUNT )
+                    total[levelID].nmiss = gridsize;
+                  if ( IS_SET(request->var1.f5) )
+                    var15[levelID].nmiss = gridsize;
+                  if ( IS_SET(request->var2.h2) )
+                    var22[levelID].nmiss = gridsize;
+                }
+
+              streamReadRecord(istreamID1, field1.ptr, &field1.nmiss);
+              field1.grid    = gridID;
+              field1.missval = missval1;
+              
+              streamReadRecord(istreamID2, field2.ptr, &field2.nmiss);
+              field2.grid    = gridID;
+              field2.missval = missval2;
+
+              farnum(&samp1[levelID], field1);
+              farnum(&samp2[levelID], field2);
+
+              if ( request->var1.epilog == PERCENT_OF_TOTAL_AMOUNT )
+                farsum(&total[levelID], field1);
+                             
+              if ( IS_SET(request->var1.f1) ) 
+                request->var1.f1(&field1, request->var1.f1arg);
+              
+              if ( IS_SET(request->var1.f2) )
+                request->var1.f2(&field2, request->var1.f2arg);
+
+              if ( field1.nmiss > 0 || IS_SET(samp3[levelID].ptr) )
+                {
+                  if ( IS_NOT_SET(samp3[levelID].ptr) )
+                    {
+                      samp3[levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+                      for ( i = 0; i < gridsize; i++ )
+                        samp3[levelID].ptr[i] = nsets;
+                    }
+                  for ( i = 0; i < gridsize; i++ )
+                    {
+                      if ( DBL_IS_EQUAL(field1.ptr[i], field1.missval) )
+                        continue;
+                      samp3[levelID].ptr[i]++;
+                    }
+                }
+              
+              request->var1.f3(&field1, field2);
+              request->var1.f4(&var14[levelID], field1);
+
+              if ( IS_SET(request->var2.h2) )
+                {
+                  memcpy(field2.ptr, var14[levelID].ptr, gridsize*sizeof(double));
+                  field2.nmiss   = var14[levelID].nmiss;
+                  field2.grid    = var14[levelID].grid;
+                  field2.missval = var14[levelID].missval;
+
+                  if ( IS_SET(request->var2.h1) )
+                    request->var2.h1(&field2, request->var2.h1arg);
+                    
+                  request->var2.h2(&var22[levelID], field2);
+                }
+
+              if ( IS_SET(request->var1.f5) )
+                request->var1.f5(&var15[levelID], var14[levelID], request->var1.f5arg);              
+            }
+
+          ovdate = ivdate;
+          ovtime = ivtime;
+          nsets++;
+          itsID++;
+        }
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+      
+      if ( request->var1.epilog == MEAN || request->var1.epilog == PERCENT_OF_TIME )
+        for ( levelID = 0; levelID < nlevels; levelID++ )
+          {
+	    if ( IS_SET(request->var1.f5) )
+	      var = &var15[levelID];
+	    else
+	      var = &var14[levelID];
+	  
+            if ( IS_NOT_SET(samp3[levelID].ptr) )
+              farcdiv(var, nsets);
+            else
+              fardiv(var, samp3[levelID]);
+
+	    if ( request->var1.epilog == PERCENT_OF_TIME )
+	      farcmul(var, 100.0);
+          }
+      else if ( request->var1.epilog == PERCENT_OF_TOTAL_AMOUNT )
+        for ( levelID = 0; levelID < nlevels; levelID++ )
+          {
+	    if ( IS_SET(request->var1.f5) )
+	      var = &var15[levelID];
+	    else
+	      var = &var14[levelID];
+	  
+            fardiv(var, total[levelID]);
+	    farcmul(var, 100.0);
+          }
+
+      taxisDefVdate(otaxisID, ovdate);
+      taxisDefVtime(otaxisID, ovtime);
+      streamDefTimestep(ostreamID, otsID);
+
+      if ( otsID && vlistInqVarTsteptype(ivlistID1, FIRST_VAR_ID) == TSTEP_CONSTANT ) continue;
+
+      varID = 0;
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	{
+	  if ( IS_SET(request->var1.f5) )
+	    var = &var15[levelID];
+	  else 
+	    var = &var14[levelID];
+              
+	  farsel(var, samp1[levelID]);
+	  farsel(var, samp2[levelID]);
+              
+	  streamDefRecord(ostreamID, varID, levelID);
+	  streamWriteRecord(ostreamID, var->ptr, var->nmiss);
+	}
+      if ( IS_SET(request->var2.h2) )
+	{
+	  varID = 1;
+	  for ( levelID = 0; levelID < nlevels; levelID++ )
+	    {
+	      var = &var22[levelID];
+              
+	      farsel(var, samp1[levelID]);
+	      farsel(var, samp2[levelID]);
+                  
+	      streamDefRecord(ostreamID, varID, levelID);
+	      streamWriteRecord(ostreamID, var->ptr, var->nmiss);
+	    }
+        }
+
+      if ( nrecs == 0 ) break;
+      otsID++;
+    }
+
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      free(var14[levelID].ptr);
+      free(samp1[levelID].ptr);
+      free(samp2[levelID].ptr);
+      if ( IS_SET(samp3[levelID].ptr) ) free(samp3[levelID].ptr);
+    }
+  free(var14);
+  free(samp1);
+  free(samp2);
+  free(samp3);
+  
+  if ( IS_SET(total) ) 
+    {
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        free(total[levelID].ptr);
+      free(total);
+    }
+  if ( IS_SET(var15) ) 
+    {
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        free(var15[levelID].ptr);
+      free(var15);
+    }
+  if ( IS_SET(var22) ) 
+    {
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        free(var22[levelID].ptr);
+      free(var22);
+    }
+  
+  if ( IS_SET(field1.ptr) ) free(field1.ptr);
+  if ( IS_SET(field2.ptr) ) free(field2.ptr);
+
+  if ( IS_SET(recVarID) )   free(recVarID);
+  if ( IS_SET(recLevelID) ) free(recLevelID);
+
+  streamClose(ostreamID);
+  streamClose(istreamID2);
+  streamClose(istreamID1);
+}
+
+
+void eca3(const ECA_REQUEST_3 *request)
+{
+  const int operatorID = cdoOperatorID();
+
+  int cmplen;
+  char indate1[DATE_LEN+1], indate2[DATE_LEN+1];
+  int gridsize;
+  int ivdate1 = 0, ivtime1 = 0;
+  int ivdate2 = 0, ivtime2 = 0;
+  int ovdate = 0, ovtime = 0;
+  int nrecs, nrecords;
+  int gridID, zaxisID, varID, levelID, recID;
+  int itsID;
+  int otsID;
+  long nsets;
+  int i;
+  int istreamID1, istreamID2, ostreamID;
+  int ivlistID1, ivlistID2, ovlistID, itaxisID1, itaxisID2, otaxisID;
+  int nlevels;
+  int *recVarID, *recLevelID;
+  double missval;
+  field_t *var1 = NULL, *var2 = NULL;
+  field_t field1, field2;
+  
+  cmplen = DATE_LEN - cdoOperatorF2(operatorID);
+
+  istreamID1 = streamOpenRead(cdoStreamName(0));
+  if ( istreamID1 < 0 ) cdiError(istreamID1, "Open failed on %s", cdoStreamName(0));
+  istreamID2 = streamOpenRead(cdoStreamName(1));
+  if ( istreamID2 < 0 ) cdiError(istreamID2, "Open failed on %s", cdoStreamName(1));
+
+  ivlistID1 = streamInqVlist(istreamID1);
+  ivlistID2 = streamInqVlist(istreamID2);
+  ovlistID  = vlistCreate();
+  
+  vlistCompare(ivlistID1, ivlistID2, CMP_ALL);
+  
+  gridID  = vlistInqVarGrid(ivlistID1, FIRST_VAR_ID);
+  zaxisID = vlistInqVarZaxis(ivlistID1, FIRST_VAR_ID);
+  missval = vlistInqVarMissval(ivlistID1, FIRST_VAR_ID);
+
+  varID   = vlistDefVar(ovlistID, gridID, zaxisID, TSTEP_INSTANT);
+
+  vlistDefVarMissval(ovlistID, varID, missval);
+  
+  if ( IS_SET(request->name) ) 
+    vlistDefVarName(ovlistID, varID, request->name);
+  if ( IS_SET(request->longname) ) 
+    vlistDefVarLongname(ovlistID, varID, request->longname);
+  if ( IS_SET(request->units) ) 
+    vlistDefVarUnits(ovlistID, varID, request->units);
+
+  if ( cdoOperatorF2(operatorID) == 16 ) vlistDefNtsteps(ovlistID, 1);
+
+  itaxisID1 = vlistInqTaxis(ivlistID1);
+  itaxisID2 = vlistInqTaxis(ivlistID2);
+  otaxisID = taxisCreate(TAXIS_RELATIVE);
+  taxisDefTunit(otaxisID, TUNIT_MINUTE);
+  //  taxisDefCalendar(otaxisID, CALENDAR_PROLEPTIC);
+  taxisDefCalendar(otaxisID, taxisInqCalendar(itaxisID1));
+  taxisDefRdate(otaxisID, 19550101);
+  taxisDefRtime(otaxisID, 0);
+  vlistDefTaxis(ovlistID, otaxisID);
+
+  ostreamID = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+  if ( ostreamID < 0 ) cdiError(ostreamID, "Open failed on %s", cdoStreamName(2));
+
+  streamDefVlist(ostreamID, ovlistID);
+
+  nrecords   = vlistNrecs(ivlistID1);
+  recVarID   = (int *) malloc(nrecords*sizeof(int));
+  recLevelID = (int *) malloc(nrecords*sizeof(int));
+
+  gridsize = gridInqSize(gridID);
+
+  field1.ptr = (double *) malloc(gridsize*sizeof(double));
+  field2.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  nlevels = zaxisInqSize(zaxisID);
+
+  var1 = (field_t *) malloc(nlevels*sizeof(field_t));
+  var2 = (field_t *) malloc(nlevels*sizeof(field_t));
+        
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      var1[levelID].grid    = gridID;
+      var1[levelID].nmiss   = 0;
+      var1[levelID].missval = missval;
+      var1[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+            
+      var2[levelID].grid    = gridID;
+      var2[levelID].nmiss   = 0;
+      var2[levelID].missval = missval;
+      var2[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+    }
+
+  itsID   = 0;
+  otsID   = 0;
+  while ( TRUE )
+    {
+      nsets = 0;
+      while ( (nrecs = streamInqTimestep(istreamID1, itsID)) > 0 )
+        {
+	  if ( !streamInqTimestep(istreamID2, itsID) )
+	    cdoAbort("Input streams have different number of time steps!");
+            
+          ivdate1 = taxisInqVdate(itaxisID1);
+          ivdate2 = taxisInqVdate(itaxisID2);
+          if ( ivdate1 != ivdate2 )
+            cdoAbort("Input streams have different verification dates at time step %d!", itsID+1);
+            
+          ivtime1 = taxisInqVtime(itaxisID1);
+          ivtime2 = taxisInqVtime(itaxisID2);
+          if ( ivtime1 != ivtime2 )
+            cdoAbort("Input streams have different verification times at time step %d!", itsID+1);
+   
+	  if ( nsets == 0 ) SET_DATE(indate2, ivdate1, ivtime1);
+	  SET_DATE(indate1, ivdate1, ivtime1);
+
+	  if ( DATE_IS_NEQ(indate1, indate2, cmplen) ) break;
+
+          for ( recID = 0; recID < nrecs; recID++ )
+            {
+              streamInqRecord(istreamID1, &varID, &levelID);
+              streamInqRecord(istreamID2, &varID, &levelID);
+
+              if ( itsID == 0 )
+                {
+                  recVarID[recID]   = varID;
+                  recLevelID[recID] = levelID;
+                }
+              if ( varID != FIRST_VAR_ID ) continue;
+
+              if ( nsets == 0 )
+                {
+                  for ( i = 0; i < gridsize; i++ )
+                    {
+                      var1[levelID].ptr[i] = missval;
+                      var2[levelID].ptr[i] = missval;
+                    }
+                  var1[levelID].nmiss = gridsize;
+                  var2[levelID].nmiss = gridsize;
+                }
+
+              streamReadRecord(istreamID1, field1.ptr, &field1.nmiss);
+              field1.grid    = var1[levelID].grid;
+              field1.missval = var1[levelID].missval;
+
+              streamReadRecord(istreamID2, field2.ptr, &field2.nmiss);
+              field2.grid    = var1[levelID].grid;
+              field2.missval = var1[levelID].missval;
+
+              request->f1(&var1[levelID], field1);
+              request->f2(&var2[levelID], field2);
+            }
+
+          ovdate = ivdate1;
+          ovtime = ivtime1;
+          nsets++;
+          itsID++;
+        }
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+      
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        request->f3(&var1[levelID], var2[levelID]);
+
+      taxisDefVdate(otaxisID, ovdate);
+      taxisDefVtime(otaxisID, ovtime);
+      streamDefTimestep(ostreamID, otsID);
+
+      if ( otsID && vlistInqVarTsteptype(ivlistID1, FIRST_VAR_ID) == TSTEP_CONSTANT ) continue;
+
+      varID = 0;
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+	{
+	  streamDefRecord(ostreamID, varID, levelID);
+	  streamWriteRecord(ostreamID, var1[levelID].ptr, var1[levelID].nmiss);
+	}
+
+      if ( nrecs == 0 ) break;
+      otsID++;
+    }
+
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      free(var1[levelID].ptr);
+      free(var2[levelID].ptr);
+    }
+  free(var1);
+  free(var2);
+    
+  if ( IS_SET(field1.ptr) ) free(field1.ptr);
+  if ( IS_SET(field2.ptr) ) free(field2.ptr);
+
+  if ( IS_SET(recVarID) )   free(recVarID);
+  if ( IS_SET(recLevelID) ) free(recLevelID);
+
+  streamClose(ostreamID);
+  streamClose(istreamID2);
+  streamClose(istreamID1);
+}
+
+
+void eca4(const ECA_REQUEST_4 *request)
+{
+  const int operatorID = cdoOperatorID();
+
+  int cmplen;
+  char indate1[DATE_LEN+1], indate2[DATE_LEN+1];
+  int gridsize, gridtype;
+  double *yvals;
+  int ivdate = 0, ivtime = 0;
+  int ovdate = 0, ovtime = 0;
+  int month, yearcnt = 0;
+  int nrecs, nrecords;
+  int gridID, zaxisID, varID, ovarID1, ovarID2, levelID, recID;
+  int itsID;
+  int otsID;
+  long nsets;
+  int i;
+  int istreamID1, istreamID2, ostreamID;
+  int ivlistID1, ivlistID2, ovlistID, itaxisID, otaxisID;
+  int nlevels;
+  int *recVarID, *recLevelID;
+  double missval;
+  field_t *startCount          , *endCount;
+  field_t *startDateWithHist[2], *endDateWithHist[2];
+  field_t *gslDuration, *gslFirstDay;
+  field_t fieldGt, fieldLt, mask;
+  int resetAtJan = FALSE, resetAtJul = FALSE;
+  int isFirstYear = TRUE;
+
+  cmplen = DATE_LEN - cdoOperatorF2(operatorID);
+
+  istreamID1 = streamOpenRead(cdoStreamName(0));
+  if ( istreamID1 < 0 ) cdiError(istreamID1, "Open failed on %s", cdoStreamName(0));
+  istreamID2 = streamOpenRead(cdoStreamName(1));
+  if ( istreamID2 < 0 ) cdiError(istreamID1, "Open failed on %s", cdoStreamName(1));
+
+  ivlistID1 = streamInqVlist(istreamID1);
+  ivlistID2 = streamInqVlist(istreamID2);
+  ovlistID = vlistCreate();
+
+  gridID = vlistInqVarGrid(ivlistID1, FIRST_VAR_ID);
+  if ( gridID != vlistInqVarGrid(ivlistID2, FIRST_VAR_ID) ) cdoAbort("Grid sizes of the input fields do not match!");
+
+  zaxisID = vlistInqVarZaxis(ivlistID1, FIRST_VAR_ID);
+  missval = vlistInqVarMissval(ivlistID1, FIRST_VAR_ID);
+
+  ovarID1 = vlistDefVar(ovlistID, gridID, zaxisID, TSTEP_INSTANT);
+
+  vlistDefVarMissval(ovlistID, ovarID1, missval);
+
+  if ( IS_SET(request->name) )
+    vlistDefVarName(ovlistID, ovarID1, request->name);
+  if ( IS_SET(request->longname) ) 
+    vlistDefVarLongname(ovlistID, ovarID1, request->longname);
+  if ( IS_SET(request->units) ) 
+    vlistDefVarUnits(ovlistID, ovarID1, request->units);
+
+  ovarID2 = vlistDefVar(ovlistID, gridID, zaxisID, TSTEP_INSTANT);
+  
+  vlistDefVarMissval(ovlistID, ovarID2, missval);
+
+  if ( IS_SET(request->name2) ) 
+    vlistDefVarName(ovlistID, ovarID2, request->name2);
+  if ( IS_SET(request->longname2) ) 
+    vlistDefVarLongname(ovlistID, ovarID2, request->longname2);
+  if ( IS_SET(request->units2) ) 
+    vlistDefVarUnits(ovlistID, ovarID2, request->units2);
+
+  if ( cdoOperatorF2(operatorID) == 16 ) vlistDefNtsteps(ovlistID, 1);
+
+  itaxisID = vlistInqTaxis(ivlistID1);
+  otaxisID = taxisCreate(TAXIS_RELATIVE);
+  taxisDefTunit(otaxisID, TUNIT_MINUTE);
+  //  taxisDefCalendar(otaxisID, CALENDAR_PROLEPTIC);
+  taxisDefCalendar(otaxisID, taxisInqCalendar(itaxisID));
+  taxisDefRdate(otaxisID, 19550101);
+  taxisDefRtime(otaxisID, 0);
+  vlistDefTaxis(ovlistID, otaxisID);
+
+  ostreamID = streamOpenWrite(cdoStreamName(2), cdoFiletype());
+  if ( ostreamID < 0 ) cdiError(ostreamID, "Open failed on %s", cdoStreamName(2));
+
+  streamDefVlist(ostreamID, ovlistID);
+
+  nrecords    = vlistNrecs(ivlistID1);
+  recVarID    = (int *) malloc(nrecords*sizeof(int));
+  recLevelID  = (int *) malloc(nrecords*sizeof(int));
+
+  gridtype = gridInqType(gridID);
+  if ( gridtype != GRID_UNSTRUCTURED && gridtype != GRID_CURVILINEAR ) 
+    {
+      if ( gridtype == GRID_GME )
+        gridID = gridToUnstructured(gridID, 1);
+      else
+        gridID = gridToCurvilinear(gridID, 1);
+    }
+  gridsize    = gridInqSize(gridID);
+  /* for later check on northern\southern hemisphere */
+  yvals   = malloc(gridsize*sizeof(double));
+  gridInqYvals(gridID,yvals);
+
+  /* Two fields are needed because of the definition of gsl for northern and
+  * southern hemisphere                                                      */
+  fieldGt.ptr = (double *) malloc(gridsize*sizeof(double));
+  fieldLt.ptr = (double *) malloc(gridsize*sizeof(double));
+
+  /* field for the land-water-distribution */
+  mask.ptr    = (double *) malloc(gridsize*sizeof(double));
+
+  nlevels     = zaxisInqSize(zaxisID);
+
+  startCount  = (field_t *) malloc(nlevels*sizeof(field_t));
+  endCount    = (field_t *) malloc(nlevels*sizeof(field_t));
+  gslDuration = (field_t *) malloc(nlevels*sizeof(field_t));
+  gslFirstDay = (field_t *) malloc(nlevels*sizeof(field_t));
+
+  /* because of the different definitions for northern and southern hemisphere,
+   * the values of the last year have to be present
+   * THE LAST YEAR HAS THE INDEX 1 */
+  for ( int h = 0; h < 2; h++ )
+  {
+    startDateWithHist[h] = (field_t *) malloc(nlevels*sizeof(field_t));
+    endDateWithHist[h]   = (field_t *) malloc(nlevels*sizeof(field_t));
+  }
+
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+  {
+    startCount[levelID].grid     = gridID;
+    startCount[levelID].size     = gridsize;
+    startCount[levelID].nmiss    = 0;
+    startCount[levelID].missval  = missval;
+    startCount[levelID].ptr      = (double *) malloc(gridsize*sizeof(double));
+
+    endCount[levelID].grid       = gridID;
+    endCount[levelID].size       = gridsize;
+    endCount[levelID].nmiss      = 0;
+    endCount[levelID].missval    = missval;
+    endCount[levelID].ptr        = (double *) malloc(gridsize*sizeof(double));
+
+    gslDuration[levelID].grid    = gridID;
+    gslDuration[levelID].size    = gridsize;
+    gslDuration[levelID].nmiss   = 0;
+    gslDuration[levelID].missval = missval;
+    gslDuration[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+
+    gslFirstDay[levelID].grid    = gridID;
+    gslFirstDay[levelID].size    = gridsize;
+    gslFirstDay[levelID].nmiss   = 0;
+    gslFirstDay[levelID].missval = missval;
+    gslFirstDay[levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+
+    for ( int h = 0; h < 2; h++ )
+    {
+      startDateWithHist[h][levelID].grid    = gridID;
+      startDateWithHist[h][levelID].size    = gridsize;
+      startDateWithHist[h][levelID].nmiss   = 0;
+      startDateWithHist[h][levelID].missval = missval;
+      startDateWithHist[h][levelID].ptr     = (double *) malloc(gridsize*sizeof(double));
+
+      endDateWithHist[h][levelID].grid      = gridID;
+      endDateWithHist[h][levelID].size      = gridsize;
+      endDateWithHist[h][levelID].nmiss     = 0;
+      endDateWithHist[h][levelID].missval   = missval;
+      endDateWithHist[h][levelID].ptr       = (double *) malloc(gridsize*sizeof(double));
+    }
+  }
+
+  itsID   = 0;
+  otsID   = 0;
+
+  if ( streamInqTimestep(istreamID2, itsID) )
+    {
+      streamInqRecord(istreamID2, &varID, &levelID);
+      streamReadRecord(istreamID2, mask.ptr, &mask.nmiss);
+      mask.grid    = gridID;
+      mask.missval = vlistInqVarMissval(ivlistID2, 0);
+
+      request->s3(&mask, request->s3arg);
+    }
+  else cdoAbort("Could not read land-water mask!");
+
+  while ( TRUE )
+    {
+      nsets = 0;
+      while ( (nrecs = streamInqTimestep(istreamID1, itsID)) > 0 )
+        {
+          ivdate = taxisInqVdate(itaxisID);
+          ivtime = taxisInqVtime(itaxisID);
+
+          month = (ivdate % 10000) / 100;
+          if ( month < 1 || month > 12 ) cdoAbort("month %d out of range!", month);
+
+          if ( nsets == 0 ) SET_DATE(indate2, ivdate, ivtime);
+          SET_DATE(indate1, ivdate, ivtime);
+
+          if ( DATE_IS_NEQ(indate1, indate2, cmplen) ) {
+            resetAtJan = FALSE;
+            resetAtJul = FALSE;
+            break;
+          }
+
+          for ( recID = 0; recID < nrecs; recID++ )
+            {
+              streamInqRecord(istreamID1, &varID, &levelID);
+
+              if ( itsID == 0 )
+                {
+                  recVarID[recID]   = varID;
+                  recLevelID[recID] = levelID;
+                }
+              if ( varID != FIRST_VAR_ID ) continue;
+
+              if ( nsets == 0 )
+                {
+                  for ( i = 0; i < gridsize; i++ )
+                    {
+                      gslDuration[levelID].ptr[i]          = missval;
+                      gslFirstDay[levelID].ptr[i]          = missval;
+                      /* reinitialize the current year */
+                      startDateWithHist[0][levelID].ptr[i] = missval;
+                      endDateWithHist[0][levelID].ptr[i]   = missval;
+                    }
+                  gslDuration[levelID].nmiss          = missval;
+                  gslFirstDay[levelID].nmiss          = missval;
+                  /* reinitialize the current year */
+                  startDateWithHist[0][levelID].nmiss = gridsize;
+                  endDateWithHist[0][levelID].nmiss   = gridsize;
+                }
+              /* init the history ONCE */
+              if ( 0 == itsID )
+                {
+                  for ( i = 0; i < gridsize; i++ )
+                    {
+                      startDateWithHist[1][levelID].ptr[i] = missval;
+                      endDateWithHist[1][levelID].ptr[i]   = missval;
+                    }
+                  startDateWithHist[1][levelID].nmiss = gridsize;
+                  endDateWithHist[1][levelID].nmiss   = gridsize;
+                }
+
+              streamReadRecord(istreamID1, fieldGt.ptr, &fieldGt.nmiss);
+              memcpy(fieldLt.ptr, fieldGt.ptr, gridsize*sizeof(double));
+              fieldLt.nmiss = fieldGt.nmiss;
+              fieldGt.grid    = startCount[levelID].grid;
+              fieldGt.missval = startCount[levelID].missval;
+              fieldLt.grid    = startCount[levelID].grid;
+              fieldLt.missval = startCount[levelID].missval;
+
+              /* Reinitialization of (start|end)Count variables has to be done
+               * different for norther and southern hemisphere */
+              if ( 1 == month && !resetAtJan )
+              {
+                /* reset northern startCount */
+                for ( i = 0; i < gridsize; i++ )
+                  {
+                    if ( yvals[i] >= 0.0 )
+                      if ( !DBL_IS_EQUAL(startCount[levelID].ptr[i], missval) )
+                      {
+                        startCount[levelID].ptr[i] = missval;
+                        startCount[levelID].nmiss++;
+                      }
+                  }
+                /* reset southern endCount */
+                for ( i = 0; i < gridsize; i++ )
+                  {
+                    if ( yvals[i] < 0.0 )
+                      if ( !DBL_IS_EQUAL(endCount[levelID].ptr[i], missval) )
+                        {
+                          endCount[levelID].ptr[i] = missval;
+                          endCount[levelID].nmiss++;
+                        }
+                  }
+
+                resetAtJan = TRUE;
+              }
+              if ( 7 == month && !resetAtJul )
+              {
+#if defined (_OPENMP)
+#pragma omp sections
+#endif
+                {
+#if defined (_OPENMP)
+#pragma omp section
+#endif
+                  {
+                    /* reset northern endCount  */
+                    for ( i = 0; i < gridsize; i++ )
+                      {
+                        if ( yvals[i] >= 0.0 )
+                          {
+                            if ( !DBL_IS_EQUAL(endCount[levelID].ptr[i], missval) )
+                              {
+                                endCount[levelID].ptr[i] = missval;
+                                endCount[levelID].nmiss++;
+                              }
+                          }
+                      }
+                  }
+#if defined (_OPENMP)
+#pragma omp section
+#endif
+                  {
+                    /* reset southern startCount */
+                    for ( i = 0; i < gridsize; i++ )
+                    {
+                      if ( yvals[i] < 0.0 )
+                      {
+                        if ( !DBL_IS_EQUAL(startCount[levelID].ptr[i], missval) )
+                          {
+                            startCount[levelID].ptr[i] = missval;
+                            startCount[levelID].nmiss++;
+                          }
+                      }
+                    }
+                  }
+                }
+                resetAtJul = TRUE;
+              }
+
+              /* count the day with temperature larger/smaller than the given limit */
+#if defined (_OPENMP)
+#pragma omp sections
+#endif
+              {
+#if defined (_OPENMP)
+#pragma omp section
+#endif
+                {
+                  farsel(&fieldGt             , mask);
+                  request->s1(&fieldGt        , request->s1arg);
+                  farnum2(&startCount[levelID], fieldGt);
+                }
+#if defined (_OPENMP)
+#pragma omp section
+#endif
+                {
+                  farsel(&fieldLt           , mask);
+                  request->s2(&fieldLt      , request->s1arg);
+                  farnum2(&endCount[levelID], fieldLt);
+                }
+              }
+
+              if ( month < 7 )
+                {
+                  for ( i = 0; i < gridsize; i++ )
+                    /* dictinct between northern and southern sphere */
+                    /* start with south */
+                    if ( yvals[i] < 0 )
+                    {
+                      /* south: periods can also start in the first half of the
+                       * year, but this date has already gone into the history */
+                      if ( DBL_IS_EQUAL(startDateWithHist[1][levelID].ptr[i], missval) &&
+                           IS_EQUAL(startCount[levelID].ptr[i], request->consecutiveDays) )
+                      {
+                        startDateWithHist[1][levelID].ptr[i] = ivdate;
+                        /* reset the endCount, because we are only interessted
+                         * in the end of the eriod, if a start was found */
+                        endCount[levelID].ptr[i]           = missval;
+                        endDateWithHist[0][levelID].ptr[i] = missval;
+                      }
+                      if ( DBL_IS_EQUAL(endDateWithHist[0][levelID].ptr[i], missval) &&
+                          IS_EQUAL(endCount[levelID].ptr[i], request->consecutiveDays) )
+                      {
+                        endDateWithHist[0][levelID].ptr[i] = ivdate;
+                      }
+                    }
+                    else
+                    {
+                      if ( DBL_IS_EQUAL(startDateWithHist[0][levelID].ptr[i], missval) && 
+                           IS_EQUAL(startCount[levelID].ptr[i], request->consecutiveDays) )
+                      {
+                        startDateWithHist[0][levelID].ptr[i] = ivdate;
+                      }
+                    }
+                }
+              else
+                {
+                  for ( i = 0; i < gridsize; i++ )
+                  {
+                    if ( yvals[i] < 0 )
+                    {
+                      if ( DBL_IS_EQUAL(startDateWithHist[0][levelID].ptr[i], missval) &&
+                           IS_EQUAL(startCount[levelID].ptr[i], request->consecutiveDays) )
+                      {
+                        startDateWithHist[0][levelID].ptr[i] = ivdate;
+                      }
+                    }
+                    else
+                    {
+                      /* north: periods can also start in the second half of the year */
+                      if ( DBL_IS_EQUAL(startDateWithHist[0][levelID].ptr[i], missval) &&
+                           IS_EQUAL(startCount[levelID].ptr[i], request->consecutiveDays) )
+                      {
+                        startDateWithHist[0][levelID].ptr[i] = ivdate;
+                        /* reset the endCount, because we are only interessted
+                         * in the end of the eriod, if a start was found */
+                        endCount[levelID].ptr[i]           = missval;
+                        endDateWithHist[0][levelID].ptr[i] = missval;
+                      }
+                      if ( DBL_IS_EQUAL(endDateWithHist[0][levelID].ptr[i], missval) && 
+                          IS_EQUAL(endCount[levelID].ptr[i], request->consecutiveDays) )
+                      {
+                        endDateWithHist[0][levelID].ptr[i] = ivdate;
+                      }
+                    }
+                  }
+                }
+              /* update nmiss for saving data in GRIB */
+              fldunm(&startCount[levelID]);
+              fldunm(  &endCount[levelID]);
+              fldunm(&startDateWithHist[1][levelID]);
+              fldunm(&startDateWithHist[0][levelID]);
+              fldunm(  &endDateWithHist[1][levelID]);
+              fldunm(  &endDateWithHist[0][levelID]);
+
+            }
+
+          ovdate = ivdate;
+          ovtime = ivtime;
+          nsets++;
+          itsID++;
+        }
+
+      if ( nrecs == 0 && nsets == 0 ) break;
+
+      adjustEndDate(nlevels, gridsize, yvals, missval, ovdate,
+                    startDateWithHist, endDateWithHist);
+
+      /*  compute and write GSL for the previous year
+       *  AND
+       *  write the current start/end dates into the history
+       *
+       *  this is the default action if more than a year is available */
+      if (yearcnt != 0)
+        {
+          computeGsl(nlevels, gridsize, yvals, missval,
+                     startDateWithHist, endDateWithHist,
+                     gslDuration, gslFirstDay,
+                     FALSE);
+
+          /* values of the privous year */
+          {writeGslStream(ostreamID, otaxisID, otsID,
+                          ovarID1, ovarID2,ivlistID1,
+                          FIRST_VAR_ID,
+                          gslDuration, gslFirstDay,
+                          cdiEncodeDate(ovdate/10000 - 1, 12, 31), ovtime,  nlevels); otsID++;}
+        }
+
+      /*  if there is a previous year */
+      if (ovdate != ivdate)
+      {
+        /*  if the first year of data was processed, the history has to
+         *  be checked befor it get's updated. This is necessary, if a
+         *  growing period on the southern hemisphere was found. Otherwise,
+         *  it would get overwritten. */
+        if ( isFirstYear )
+          {
+            /*  Check for non missing values, i.e. is there any data for the
+             *  previous year? */
+            if ( fldhvs(startDateWithHist[1], nlevels) )
+              {
+                computeGsl(nlevels, gridsize, yvals, missval,
+                          startDateWithHist, endDateWithHist,
+                          gslDuration, gslFirstDay,
+                          FALSE);
+                {writeGslStream(ostreamID, otaxisID, otsID,
+                                ovarID1, ovarID2,ivlistID1,
+                                FIRST_VAR_ID,
+                                gslDuration, gslFirstDay,
+                                cdiEncodeDate(ovdate/10000 - 1,12,31), ovtime, nlevels); otsID++;}
+              }
+            isFirstYear = FALSE;
+          }
+#if defined (_OPENMP)
+#pragma omp sections
+#endif
+          {
+            updateHist(startDateWithHist, nlevels, gridsize, yvals, FALSE);
+#if defined (_OPENMP)
+#pragma omp section
+#endif
+            updateHist(endDateWithHist,   nlevels, gridsize, yvals, TRUE);
+          }
+        }
+      else /* process the current year, this only happens, if the last timestep
+              is reached OR if data for only one year is present */
+        {
+          computeGsl(nlevels, gridsize, yvals, missval,
+                     startDateWithHist, endDateWithHist,
+                     gslDuration, gslFirstDay,
+                     TRUE);
+          {writeGslStream(ostreamID, otaxisID, otsID,
+                          ovarID1, ovarID2,ivlistID1,
+                          FIRST_VAR_ID,
+                          gslDuration, gslFirstDay,
+                          ovdate, ovtime, nlevels); otsID++;}
+        }
+      yearcnt++;
+
+      if ( nrecs == 0 ) break;
+    }
+
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      free(startCount[levelID].ptr);
+      free(endCount[levelID].ptr);
+      free(gslDuration[levelID].ptr);
+      free(gslFirstDay[levelID].ptr);
+      for (int h = 0; h < 2; h++)
+        {
+          free(startDateWithHist[h][levelID].ptr);
+          free(endDateWithHist[h][levelID].ptr);
+        }
+    }
+  for (int h = 0; h < 2; h++)
+    {
+      free(startDateWithHist[h]);
+      free(endDateWithHist[h]);
+    }
+  free(startCount);
+  free(endCount);
+  free(gslDuration);
+  free(gslFirstDay);
+
+  if ( IS_SET(fieldGt.ptr) ) free(fieldGt.ptr);
+  if ( IS_SET(fieldLt.ptr) ) free(fieldLt.ptr);
+
+  if ( IS_SET(recVarID) )   free(recVarID);
+  if ( IS_SET(recLevelID) ) free(recLevelID);
+
+  streamClose(ostreamID);
+  streamClose(istreamID1);
+
+}
diff --git a/src/ecacore.h b/src/ecacore.h
new file mode 100755
index 0000000..a4bf32f
--- /dev/null
+++ b/src/ecacore.h
@@ -0,0 +1,273 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef ECA_H_
+#define ECA_H_
+
+
+typedef enum {
+  NONE,
+  MEAN,
+  PERCENT_OF_TIME,
+  PERCENT_OF_TOTAL_AMOUNT
+}
+ECA_EPILOG;
+
+typedef void (*ECA_FUNC_1)(field_t *, double);
+typedef void (*ECA_FUNC_2)(field_t *, field_t);
+typedef void (*ECA_FUNC_3)(field_t *, field_t, double);
+
+/**
+ * Structure describing a processing request of the form
+ * 
+ * o = F3(F2(a * F1(i) + b))
+ * 
+ * where i and o denote the input and output fields, and
+ * F1, F2 and F3 are field operators.
+ * 
+ * The structure contains the following elements:
+ * 
+ * name      the name of the output variable
+ * longname  the longname of the output variable
+ * units     the units of the output variable
+ * f1        the 1st field operator
+ * f1arg     the argument of the 1st field operator
+ * f2        the 2nd field operator
+ * f3        the 3rd field operator
+ * mulc      the multiplier a
+ * addc      the addend b
+ * epilog    the final operation carried out after processing
+ */ 
+typedef struct {
+  const char *name;      
+  const char *longname;  
+  const char *units;   
+  ECA_FUNC_1  f1;
+  double      f1arg;
+  ECA_FUNC_2  f2;
+  ECA_FUNC_2  f3;
+  double      mulc;
+  double      addc;
+  ECA_EPILOG  epilog;
+}
+ECA_MAJOR_REQUEST_ELEMENT_1;
+
+/**
+ * Structure describing a processing request of the form
+ * 
+ * o = H3(H2(H1(i)))
+ * 
+ * where i and o denote the input and output fields, and
+ * H1, H2 and H3 are field operators.
+ * 
+ * The structure contains the following elements:
+ * 
+ * name      the name of the output variable
+ * longname  the longname of the output variable
+ * h1        the 1st field operator
+ * h1arg     the argument of the 1st field operator
+ * h2        the 2nd field operator
+ * h3        the 3rd field operator
+ */ 
+typedef struct {
+  const char *name;
+  const char *longname;
+  const char *units;
+  ECA_FUNC_1  h1;
+  double      h1arg;
+  ECA_FUNC_2  h2;
+  ECA_FUNC_2  h3;
+}
+ECA_MINOR_REQUEST_ELEMENT_1;
+
+
+typedef struct {
+  ECA_MAJOR_REQUEST_ELEMENT_1 var1;
+  ECA_MINOR_REQUEST_ELEMENT_1 var2;
+}
+ECA_REQUEST_1;
+
+
+/**
+ * Structure describing a processing request of the form
+ * 
+ * o = F5(F4(F3(F1(i1), F2(i2))))
+ * 
+ * where i1, i2 and o denote the input and output fields,
+ * and F1, F2, F3, F4 and F3 are field operators.
+ * 
+ * The structure contains the following elements:
+ * 
+ * name      the name of the output variable
+ * longname  the longname of the output variable
+ * units     the units of the output variable
+ * f1        the 1st field operator
+ * f1arg     the argument of the 1st field operator
+ * f2        the 2nd field operator
+ * f2arg     the argument of the 2nd field operator
+ * f3        the 3rd field operator
+ * f4        the 4th field operator
+ * f5        the 5th field operator
+ * f5arg     the argument of the 5th field operator
+ * epilog    the final operation carried out after processing
+ */ 
+typedef struct {
+  const char *name;
+  const char *longname;
+  const char *units;
+  ECA_FUNC_1  f1;
+  double      f1arg;
+  ECA_FUNC_1  f2;
+  double      f2arg;
+  ECA_FUNC_2  f3;
+  ECA_FUNC_2  f4;
+  ECA_FUNC_3  f5;
+  double      f5arg;
+  ECA_EPILOG  epilog;
+}
+ECA_MAJOR_REQUEST_ELEMENT_2;
+
+
+/**
+ * Structure describing a processing request of the form
+ * 
+ * o = H2(H1(i))
+ * 
+ * where i and o denote the input and output fields, and
+ * H1, and H2 are field operators.
+ * 
+ * The structure contains the following elements:
+ * 
+ * name      the name of the output variable
+ * longname  the longname of the output variable
+ * units     the units of the output variable
+ * h1        the 1st field operator
+ * h1arg     the argument of the 1st field operator
+ * h2        the 2nd field operator
+ */ 
+typedef struct {
+  const char *name;
+  const char *longname;
+  const char *units;
+  ECA_FUNC_1  h1;
+  double      h1arg;
+  ECA_FUNC_2  h2;
+}
+ECA_MINOR_REQUEST_ELEMENT_2;
+
+
+typedef struct {
+  ECA_MAJOR_REQUEST_ELEMENT_2 var1;
+  ECA_MINOR_REQUEST_ELEMENT_2 var2;
+}
+ECA_REQUEST_2;
+
+
+/**
+ * Structure describing a processing request of the form
+ * 
+ * o = F3(F1(i1), F2(i2))
+ * 
+ * where i1, i2 and o denote the input and output fields,
+ * and F1, F2 and F3 are field operators.
+ * 
+ * The structure contains the following elements:
+ * 
+ * name      the name of the output variable
+ * longname  the longname of the output variable
+ * units     the units of the output variable
+ * f1        the 1st field operator
+ * f2        the 2nd field operator
+ * f3        the 3rd field operator
+ */ 
+typedef struct {
+  const char *name;
+  const char *longname;
+  const char *units;
+  ECA_FUNC_2  f1;
+  ECA_FUNC_2  f2;
+  ECA_FUNC_2  f3;
+}
+ECA_REQUEST_3;
+
+
+/**
+ * Structure describing a GSL-like processing request. The structure
+ * contains the following elements:
+ * 
+ * name       the name of the 1st output variable
+ * longname   the longname of the 1st output variable
+ * units      the units of the 1st output variable
+ * name2      the name of the 2nd output variable
+ * longname2  the longname of the 2nd output variable
+ * units2     the units of the 2nd output variable
+ * name3      the name of the 3rd output variable
+ * longname3  the longname of the 3rd output variable
+ * units3     the units of the 3rd output variable
+ * s1         the 1st field selector
+ * s1arg      argument of the 1st field selector
+ * s2         the 2nd field selector
+ * s2arg      argument of the 2nd field selector
+ * consecutiveDays  the number od concecutive days
+ */ 
+typedef struct {
+  const char *name;
+  const char *longname;
+  const char *units;
+  const char *name2;
+  const char *longname2;
+  const char *units2;
+  ECA_FUNC_1  s1;
+  double      s1arg;
+  ECA_FUNC_1  s2;
+  double      s2arg;
+  ECA_FUNC_1  s3;
+  double      s3arg;
+  int         consecutiveDays;
+}
+ECA_REQUEST_4;
+
+
+/**
+ * Function processing a request of type 1.
+ * 
+ * @param request the processing request
+ */ 
+void eca1(const ECA_REQUEST_1 *request);
+
+/**
+ * Function processing a request of type 2.
+ * 
+ * @param request the processing request
+ */ 
+void eca2(const ECA_REQUEST_2 *request);
+
+/**
+ * Function processing a request of type 3.
+ * 
+ * @param request the processing request
+ */ 
+void eca3(const ECA_REQUEST_3 *request);
+
+/**
+ * Function processing a request of type 4.
+ * 
+ * @param request the processing request
+ */ 
+void eca4(const ECA_REQUEST_4 *request);
+
+#endif /*ECA_H_*/
diff --git a/src/ecautil.c b/src/ecautil.c
new file mode 100755
index 0000000..1dbda32
--- /dev/null
+++ b/src/ecautil.c
@@ -0,0 +1,623 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <assert.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "pstream.h"
+#include "ecautil.h"
+
+
+/**
+ * Convert a Gregorian/Julian date to a Julian day number.
+ *
+ * The Gregorian calendar was adopted midday, October 15, 1582.
+ */
+static unsigned long gregdate_to_julday(
+    int		year,	/* Gregorian year */
+    int		month,	/* Gregorian month (1-12) */
+    int		day	/* Gregorian day (1-31) */
+    )
+{
+#if INT_MAX <= 0X7FFF
+    long		igreg = 15 + 31 * (10 + (12 * 1582));
+    long		iy;	/* signed, origin 0 year */
+    long		ja;	/* Julian century */
+    long		jm;	/* Julian month */
+    long		jy;	/* Julian year */
+#else
+    int			igreg = 15 + 31 * (10 + (12 * 1582));
+    int			iy;	/* signed, origin 0 year */
+    int			ja;	/* Julian century */
+    int			jm;	/* Julian month */
+    int			jy;	/* Julian year */
+#endif
+    unsigned long	julday;	/* returned Julian day number */
+
+    /*
+     * Because there is no 0 BC or 0 AD, assume the user wants the start of 
+     * the common era if they specify year 0.
+     */
+    if (year == 0)
+	year = 1;
+
+    iy = year;
+    if (year < 0)
+	iy++;
+    if (month > 2)
+    {
+	jy = iy;
+	jm = month + 1;
+    }
+    else
+    {
+	jy = iy - 1;
+	jm = month + 13;
+    }
+
+    /*
+     *  Note: SLIGHTLY STRANGE CONSTRUCTIONS REQUIRED TO AVOID PROBLEMS WITH
+     *        OPTIMISATION OR GENERAL ERRORS UNDER VMS!
+     */
+    julday = day + (int)(30.6001 * jm);
+    if (jy >= 0)
+    {
+	julday += 365 * jy;
+	julday += (unsigned long) (0.25 * jy);
+    }
+    else
+    {
+	double		xi = 365.25 * jy;
+
+	if ((int)xi != xi)
+	    xi -= 1;
+	julday += (int)xi;
+    }
+    julday += 1720995;
+
+    if (day + (31* (month + (12 * iy))) >= igreg)
+    {
+	ja = jy/100;
+	julday -= ja;
+	julday += 2;
+	julday += ja/4;
+    }
+
+    return julday;
+}
+
+
+/**
+ * Computes the day-of-year correspnding a given Gregorian date.
+ * 
+ * @param date a Gregorian date in the form YYYYMMDD
+ * 
+ * @return the day-of-year
+ */
+unsigned long day_of_year(int date)
+{
+  const int year = date / 10000;
+  const int month = (date - year * 10000) / 100;
+  const int day = date - year * 10000 - month * 100;
+ 
+  return gregdate_to_julday(year, month, day) - gregdate_to_julday(year, 1, 1) + 1;
+}
+
+
+/**
+ * Counts the number of nonmissing values. The result of the operation
+ * is computed according to the following rules:
+ * 
+ * field1  field2  mode  result
+ * a       b       0     a + 1
+ * a       miss    0     a
+ * miss    b       0     1
+ * miss    miss    0     0
+ * 
+ * a       b       1     a + 1
+ * a       miss    1     0
+ * miss    b       1     1
+ * miss    miss    1     0
+ * 
+ * a       b       n     b < n ? a : b > n ? a + 1 : a + n
+ * a       miss    n     a
+ * miss    b       n     b < n ? 0 : b
+ * miss    miss    n     0    
+ * 
+ * @param field1 the 1st input field, also holds the result
+ * @param field2 the 2nd input field
+ * @param mode   the counting mode, must be an exact mathematical
+ *               integer
+ */  
+static void count(field_t *field1, const field_t *field2, double mode)
+{
+  int   i, len;
+  const int     grid1    = field1->grid;
+  const int     nmiss1   = field1->nmiss;
+  const double  missval1 = field1->missval;
+  double       *array1   = field1->ptr;
+  const int     grid2    = field2->grid;
+  const double  missval2 = field2->missval;
+  const double *array2   = field2->ptr;
+  
+  len = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+        {
+          if ( DBL_IS_EQUAL(array2[i], missval2) )
+            {
+              if ( IS_EQUAL(mode, 1.0) || DBL_IS_EQUAL(array1[i], missval1) )
+                array1[i] = 0.0; 
+              continue;
+            }
+
+          if ( !DBL_IS_EQUAL(array1[i], missval1) )
+            {
+              if ( IS_EQUAL(mode, 0.0) || IS_EQUAL(mode, 1.0) || array2[i] > mode )
+                array1[i] += 1.0;
+              else if (  DBL_IS_EQUAL(array2[i], mode) )
+                array1[i] += mode;
+            } 
+          else
+            {
+              if ( IS_EQUAL(mode, 0.0) || IS_EQUAL(mode, 1.0) )
+                array1[i] = 1.0;
+              else if ( array2[i] < mode )
+                array1[i] = 0.0;
+              else
+                array1[i] = array2[i];
+            } 
+        }
+
+      field1->nmiss = 0;
+      for ( i = 0; i < len; i++ )
+        if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+    }
+  else 
+    {
+      for ( i = 0; i < len; i++ )
+        {
+          if ( DBL_IS_EQUAL(array2[i], missval2) )
+            {
+              if ( IS_EQUAL(mode, 1.0) )
+                array1[i] = 0.0; 
+              continue;
+            }
+
+          if ( IS_EQUAL(mode, 0.0) || IS_EQUAL(mode, 1.0) || array2[i] > mode )
+            array1[i] += 1.0;
+          else if ( DBL_IS_EQUAL(array2[i], mode) )
+            array1[i] += mode;
+        }
+    }
+}
+
+
+/**
+ * Selects all field elements that compare to the corresponding
+ * element of a reference field. The result of the operation is
+ * computed according to the following rules:
+ * 
+ * field1  field2  result
+ * a       b       comp(a, b) ? a : miss
+ * a       miss    miss
+ * miss    b       miss
+ * miss    miss    miss    
+ * 
+ * @param field1  the input field, also holds the result
+ * @param field2  the reference field
+ * @param compare the comparator
+ */  
+static void selcomp(field_t *field1, const field_t *field2, int (*compare)(double, double))
+{
+  int   i, len;
+  const int     grid1    = field1->grid;
+  const int     nmiss1   = field1->nmiss;
+  const double  missval1 = field1->missval;
+  double       *array1   = field1->ptr;
+  const int     grid2    = field2->grid;
+  const int     nmiss2   = field2->nmiss;
+  const double  missval2 = field2->missval;
+  const double *array2   = field2->ptr;
+  
+  len = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+        if ( DBL_IS_EQUAL(array1[i], missval1) || DBL_IS_EQUAL(array2[i], missval2) || !compare(array1[i], array2[i]) ) 
+          array1[i] = missval1;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ )
+        if ( !compare(array1[i], array2[i]) ) 
+          array1[i] = missval1;
+    }
+      
+  field1->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+}
+
+
+/**
+ * Selects all field elements that compare to a certain reference
+ * value. The result of the operation is computed according to the
+ * following rules:
+ * 
+ * field  c      result
+ * a      c      comp(a, c) ? a : miss
+ * a      miss   miss
+ * miss   c      miss
+ * miss   miss   miss    
+ * 
+ * @param field   the input field, also holds the result
+ * @param c       the refence value
+ * @param compare the comparator
+ */  
+static void selcompc(field_t *field, double c, int (*compare)(double, double))
+{
+  int   i, len;
+  const int     grid    = field->grid;
+  const int     nmiss   = field->nmiss;
+  const double  missval = field->missval;
+  double       *array   = field->ptr;
+  
+  len = gridInqSize(grid);
+
+  if ( DBL_IS_EQUAL(c, missval) )
+    {
+      for ( i = 0; i < len; i++ )
+        array[i] = missval;
+    }
+  else if ( nmiss > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+        if ( DBL_IS_EQUAL(array[i], missval) || !compare(array[i], c) ) 
+          array[i] = missval;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ )
+        if ( !compare(array[i], c) ) 
+          array[i] = missval;
+    }
+      
+  field->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array[i], missval) ) field->nmiss++;
+}
+
+
+static int le(double a, double b)
+{
+  return a <= b;
+}
+
+
+static int lt(double a, double b)
+{
+  return a < b;
+}
+
+
+static int ge(double a, double b)
+{
+  return a >= b;
+}
+
+
+static int gt(double a, double b)
+{
+  return a > b;
+}
+
+
+static int eq(double a, double b)
+{
+  return DBL_IS_EQUAL(a, b);
+}
+
+
+static int ne(double a, double b)
+{
+  return !DBL_IS_EQUAL(a, b);
+}
+
+
+void farnum(field_t *field1, field_t field2)
+{
+  count(field1, &field2, 0.0);
+}
+
+
+void farnum2(field_t *field1, field_t field2)
+{
+  count(field1, &field2, 1.0);
+}
+
+
+void farnum3(field_t *field1, field_t field2, double n)
+{
+  count(field1, &field2, n);
+}
+
+
+void farsel(field_t *field1, field_t field2)
+{
+  int   i, len;
+  const int     grid1    = field1->grid;
+  const double  missval1 = field1->missval;
+  double       *array1   = field1->ptr;
+  const int     grid2    = field2.grid;
+  const int     nmiss2   = field2.nmiss;
+  const double  missval2 = field2.missval;
+  const double *array2   = field2.ptr;
+  
+  len = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+        if ( DBL_IS_EQUAL(array2[i], missval2) ||  DBL_IS_EQUAL(array2[i], 0.0) ) 
+          array1[i] = missval1;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ )
+        if ( IS_EQUAL(array2[i], 0.0) ) array1[i] = missval1;
+    }
+      
+  field1->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+}
+
+
+void farselle(field_t *field1, field_t field2)
+{
+  selcomp(field1, &field2, le);
+}
+
+
+void farsellt(field_t *field1, field_t field2)
+{
+  selcomp(field1, &field2, lt);
+}
+
+
+void farselge(field_t *field1, field_t field2)
+{
+  selcomp(field1, &field2, ge);
+}
+
+
+void farselgt(field_t *field1, field_t field2)
+{
+  selcomp(field1, &field2, gt);
+}
+
+
+void farseleq(field_t *field1, field_t field2)
+{
+  selcomp(field1, &field2, eq);
+}
+
+
+void farselne(field_t *field1, field_t field2)
+{
+  selcomp(field1, &field2, ne);
+}
+
+
+void farsellec(field_t *field, double c)
+{
+  selcompc(field, c, le);
+}
+
+
+void farselltc(field_t *field, double c)
+{
+  selcompc(field, c, lt);
+}
+
+
+void farselgec(field_t *field, double c)
+{
+  selcompc(field, c, ge);
+}
+
+
+void farseleqc(field_t *field, double c)
+{
+  selcompc(field, c, eq);
+}
+
+
+void farselnec(field_t *field, double c)
+{
+  selcompc(field, c, ne);
+}
+
+
+void farselgtc(field_t *field, double c)
+{
+  selcompc(field, c, gt);
+}
+
+void updateHist(field_t *field[2], int nlevels, int gridsize, double *yvals, int onlyNorth)
+{
+  int levelID,i;
+
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    for ( i = 0; i < gridsize; i++ )
+      if ( onlyNorth )
+      {
+        if ( yvals[i] >= 0.0 )
+          field[1][levelID].ptr[i] = field[0][levelID].ptr[i];
+      }
+      else
+        field[1][levelID].ptr[i] = field[0][levelID].ptr[i];
+}
+
+void adjustEndDate(int nlevels, int gridsize, double *yvals, double missval, int ovdate,
+                field_t *startDateWithHist[2], field_t *endDateWithHist[2])
+{
+  int levelID, i, ovdateSouth;
+
+  ovdateSouth = MIN(cdiEncodeDate(ovdate/10000,6,30),ovdate);
+
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+  {
+    for ( i = 0; i < gridsize; i++ )
+    {
+      /* start with southern sphere */
+      if ( yvals[i] < 0 )
+      {
+        if ( DBL_IS_EQUAL(startDateWithHist[1][levelID].ptr[i], missval) ) {
+          endDateWithHist[0][levelID].ptr[i] = missval;
+          continue;
+        }
+        if ( DBL_IS_EQUAL(endDateWithHist[0][levelID].ptr[i], missval) ) {
+          endDateWithHist[0][levelID].ptr[i] = ovdateSouth;
+        }
+      }
+      else
+      {
+        if ( DBL_IS_EQUAL(startDateWithHist[0][levelID].ptr[i], missval) ) {
+          endDateWithHist[0][levelID].ptr[i] = missval;
+          continue;
+        }
+
+        if ( DBL_IS_EQUAL(endDateWithHist[0][levelID].ptr[i], missval) ) {
+          endDateWithHist[0][levelID].ptr[i] = ovdate;
+        }
+      }
+    }
+  }
+}
+
+void computeGsl(int nlevels, int gridsize, double *yvals, double missval,
+                field_t *startDateWithHist[2], field_t *endDateWithHist[2],
+                field_t *gslDuration, field_t *gslFirstDay,
+                int useCurrentYear)
+{
+  int levelID, i;
+  double firstDay, duration;
+
+  if ( !useCurrentYear )
+    {
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        {
+          for ( i = 0; i < gridsize; i++ )
+            {
+              /* start with southern sphere */
+              if ( yvals[i] < 0.0 )
+                {
+                  duration = (double) (date_to_julday(CALENDAR_PROLEPTIC, (int)   endDateWithHist[0][levelID].ptr[i]) -
+                                       date_to_julday(CALENDAR_PROLEPTIC, (int) startDateWithHist[1][levelID].ptr[i]));
+                  firstDay = (double) day_of_year((int) startDateWithHist[1][levelID].ptr[i]);
+                }
+              else
+                {
+                  duration = (double) (date_to_julday(CALENDAR_PROLEPTIC, (int)   endDateWithHist[1][levelID].ptr[i]) -
+                                       date_to_julday(CALENDAR_PROLEPTIC, (int) startDateWithHist[1][levelID].ptr[i]));
+                  firstDay = (double) day_of_year((int) startDateWithHist[1][levelID].ptr[i]);
+                }
+              gslDuration[levelID].ptr[i] = duration;
+              gslFirstDay[levelID].ptr[i] = firstDay;
+            }
+        }
+    }
+  else
+    {
+      /* the current year can only have values for the northern hemisphere */
+      for ( levelID = 0; levelID < nlevels; levelID++ )
+        {
+          for ( i = 0; i < gridsize; i++ )
+            {
+              /* start with southern sphere */
+              if ( yvals[i] < 0.0 )
+                {
+                  gslDuration[levelID].ptr[i] = missval;
+                  gslFirstDay[levelID].ptr[i] = missval;
+                }
+              else
+                {
+                  duration = (double) (date_to_julday(CALENDAR_PROLEPTIC, (int)   endDateWithHist[0][levelID].ptr[i]) -
+                                       date_to_julday(CALENDAR_PROLEPTIC, (int) startDateWithHist[0][levelID].ptr[i]));
+                  firstDay = (double) day_of_year((int) startDateWithHist[0][levelID].ptr[i]);
+
+                  gslDuration[levelID].ptr[i] = duration;
+                  gslFirstDay[levelID].ptr[i] = firstDay;
+                }
+            }
+        }
+    }
+
+
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      gslDuration[levelID].nmiss = 0;
+      gslFirstDay[levelID].nmiss = 0;
+      for ( i = 0; i < gridsize; i++ )
+        {
+          if ( DBL_IS_EQUAL(gslDuration[levelID].ptr[i], missval) )
+            gslDuration[levelID].nmiss++;
+          if ( DBL_IS_EQUAL(gslFirstDay[levelID].ptr[i], missval) )
+            gslFirstDay[levelID].nmiss++;
+        }
+    }
+}
+
+void writeGslStream(int ostreamID, int otaxisID, int otsID,
+                    int ovarID1, int ovarID2, int ivlistID1,
+                    int first_var_id,
+                    field_t *gslDuration, field_t *gslFirstDay,
+                    int vdate, int vtime, int nlevels)
+{
+  int levelID;
+
+  taxisDefVdate(otaxisID, vdate);
+  taxisDefVtime(otaxisID, vtime);
+  streamDefTimestep(ostreamID, otsID);
+
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      streamDefRecord(ostreamID, ovarID1, levelID);
+      streamWriteRecord(ostreamID, gslDuration[levelID].ptr, gslDuration[levelID].nmiss);
+    }
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      streamDefRecord(  ostreamID, ovarID2, levelID);
+      streamWriteRecord(ostreamID, gslFirstDay[levelID].ptr, gslFirstDay[levelID].nmiss);
+    }
+}
diff --git a/src/ecautil.h b/src/ecautil.h
new file mode 100755
index 0000000..7f17dc7
--- /dev/null
+++ b/src/ecautil.h
@@ -0,0 +1,341 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef ECAUTIL_H_
+#define ECAUTIL_H_
+
+#include "field.h"
+
+/**
+ * Computes the day-of-year correspnding a given Gregorian date.
+ * 
+ * @param date a Gregorian date in the form YYYYMMDD
+ * 
+ * @return the day-of-year
+ */
+unsigned long day_of_year(int date);
+
+/**
+ * Counts the number of nonmissing values in a field. The result
+ * of the operation is computed according to the following rules:
+ * 
+ * field1  field2  result
+ * a       b       a + 1
+ * a       miss    a
+ * miss    b       1
+ * miss    miss    0
+ * 
+ * @param field1 the 1st input field, also holds the result
+ * @param field2 the 2nd input field  
+ */  
+void farnum(field_t *field1, field_t field2);
+
+/**
+ * Counts the number of consecutive nonmissing values in a field.
+ * The result of the operation is computed according to the following
+ * rules:
+ * 
+ * field1  field2  result
+ * a       b       a + 1
+ * a       miss    0
+ * miss    b       1
+ * miss    miss    0
+ * 
+ * @param field1 the 1st input field, also holds the result
+ * @param field2 the 2nd input field  
+ */  
+void farnum2(field_t *field1, field_t field2);
+
+/**
+ * Counts the number of values in series of at least n consecutive
+ * nonmissing values. The result of the operation is computed according
+ * to the following rules:
+ * 
+ * field1  field2  result
+ * a       b       b < n ? a : b > n ? a + 1 : a + n
+ * a       miss    a
+ * miss    b       b < n ? 0 : b
+ * miss    miss    0    
+ * 
+ * @param field1 the 1st input field, also holds the result
+ * @param field2 the 2nd input field
+ * @param n      the number of consecutive values, must be an exact
+ *               mathematical integer
+ */  
+void farnum3(field_t *field1, field_t field2, double n);
+
+/**
+ * Selects field elements according to a given mask. The result of
+ * the operation is computed according to the following rules:
+ * 
+ * field1  field2  result
+ * a       b       b != 0.0 ? a : miss
+ * a       miss    miss
+ * miss    b       miss
+ * miss    miss    miss    
+ * 
+ * @param field1  the input field, also holds the result
+ * @param field2  the mask
+ */  
+void farsel(field_t *field1, field_t field2);
+
+/**
+ * Selects all field elements that are less than or equal to the
+ * corresponding element of a reference field. The result of the
+ * operation is computed according to the following rules:
+ * 
+ * field1  field2  result
+ * a       b       a <= b ? a : miss
+ * a       miss    miss
+ * miss    b       miss
+ * miss    miss    miss    
+ * 
+ * @param field1 the input field, also holds the result
+ * @param field2 the reference field
+ */  
+void farselle(field_t *field1, field_t field2);
+
+/**
+ * Selects all field elements that are less than the
+ * corresponding element of a reference field. The result of the
+ * operation is computed according to the following rules:
+ * 
+ * field1  field2  result
+ * a       b       a < b ? a : miss
+ * a       miss    miss
+ * miss    b       miss
+ * miss    miss    miss    
+ * 
+ * @param field1 the input field, also holds the result
+ * @param field2 the reference field
+ */  
+void farsellt(field_t *field1, field_t field2);
+
+/**
+ * Selects all field elements that are greater than or equal to
+ * the corresponding element of a reference field. The result of
+ * the operation is computed according to the following rules:
+ * 
+ * field1  field2  result
+ * a       b       a >= b ? a : miss
+ * a       miss    miss
+ * miss    b       miss
+ * miss    miss    miss    
+ * 
+ * @param field1 the input field, also holds the result
+ * @param field2 the reference field
+ */  
+void farselge(field_t *field1, field_t field2);
+
+/**
+ * Selects all field elements that are greater than the
+ * corresponding element of a reference field. The result of the
+ * operation is computed according to the following rules:
+ * 
+ * field1  field2  result
+ * a       b       a > b ? a : miss
+ * a       miss    miss
+ * miss    b       miss
+ * miss    miss    miss    
+ * 
+ * @param field1 the input field, also holds the result
+ * @param field2 the reference field
+ */  
+void farselgt(field_t *field1, field_t field2);
+
+/**
+ * Selects all field elements that are equal to the
+ * corresponding element of a reference field. The result of the
+ * operation is computed according to the following rules:
+ * 
+ * field1  field2  result
+ * a       b       a == b ? a : miss
+ * a       miss    miss
+ * miss    b       miss
+ * miss    miss    miss    
+ * 
+ * @param field1 the input field, also holds the result
+ * @param field2 the reference field
+ */  
+void farseleq(field_t *field1, field_t field2);
+
+/**
+ * Selects all field elements that are not equal to the
+ * corresponding element of a reference field. The result of the
+ * operation is computed according to the following rules:
+ * 
+ * field1  field2  result
+ * a       b       a != b ? a : miss
+ * a       miss    miss
+ * miss    b       miss
+ * miss    miss    miss    
+ * 
+ * @param field1 the input field, also holds the result
+ * @param field2 the reference field
+ */  
+void farselne(field_t *field1, field_t field2);
+
+/**
+ * Selects all field elements that are less than or equal to a
+ * certain reference value. The result of the operation is computed
+ * according to the following rules:
+ * 
+ * field  c      result
+ * a      c      a <= c ? a : miss
+ * a      miss   miss
+ * miss   c      miss
+ * miss   miss   miss    
+ * 
+ * @param field the input field, also holds the result
+ * @param c     the reference value
+ */  
+void farsellec(field_t *field, double c);
+
+/**
+ * Selects all field elements that are less a
+ * certain reference value. The result of the operation is computed
+ * according to the following rules:
+ * 
+ * field  c      result
+ * a      c      a < c ? a : miss
+ * a      miss   miss
+ * miss   c      miss
+ * miss   miss   miss    
+ * 
+ * @param field the input field, also holds the result
+ * @param c     the reference value
+ */  
+void farselltc(field_t *field, double c);
+
+/**
+ * Selects all field elements that are greater than or equal to a
+ * certain reference value. The result of the operation is computed
+ * according to the following rules:
+ * 
+ * field  c      result
+ * a      c      a >= c ? a : miss
+ * a      miss   miss
+ * miss   c      miss
+ * miss   miss   miss    
+ * 
+ * @param field the input field, also holds the result
+ * @param c     the reference value
+ */  
+void farselgec(field_t *field, double c);
+
+/**
+ * Selects all field elements that are greater than a
+ * certain reference value. The result of the operation is computed
+ * according to the following rules:
+ * 
+ * field  c      result
+ * a      c      a > c ? a : miss
+ * a      miss   miss
+ * miss   c      miss
+ * miss   miss   miss    
+ * 
+ * @param field the input field, also holds the result
+ * @param c     the reference value
+ */  
+void farselgtc(field_t *field, double c);
+
+/**
+ * Selects all field elements that are equal to a
+ * certain reference value. The result of the operation is computed
+ * according to the following rules:
+ * 
+ * field  c      result
+ * a      c      a == c ? a : miss
+ * a      miss   miss
+ * miss   c      miss
+ * miss   miss   miss    
+ * 
+ * @param field the input field, also holds the result
+ * @param c     the reference value
+ */  
+void farseleqc(field_t *field, double c);
+
+/**
+ * Selects all field elements that are not equal to a
+ * certain reference value. The result of the operation is computed
+ * according to the following rules:
+ * 
+ * field  c      result
+ * a      c      a != c ? a : miss
+ * a      miss   miss
+ * miss   c      miss
+ * miss   miss   miss    
+ * 
+ * @param field the input field, also holds the result
+ * @param c     the reference value
+ */  
+void farselnec(field_t *field, double c);
+
+/**
+ * reset the fields real values to the missval for all levels
+ *
+ * @param field     list of fields: 0 is index of the current values, 1 hold
+ *                  the values of the previous year
+ * @param nlevels   number of available levels
+ * @param gridsize  number of grid points
+ * @param yvals     list of latitudes
+ * @param onlyNorth boolean for processing only the norther hemisphere
+ */
+void updateHist(field_t *field[2], int nlevels, int gridsize, double *yvals, int onlyNorth);
+
+/*
+ * Compute the Gsl and its starting day
+ *
+ * @param int nlevels
+ * @param int gridsize
+ * @param double *yvals = array of latitudes
+ * @param int ysize = number of gridpoints in lat-direction
+ * @param double missval
+ * @param int ovdate = the last year, which has been fully processed
+ * @param field_t *startDate
+ * @param field_t *endDate
+ * @param field_t *startDateWithHist[2]
+ * @param field_t *endDateWithHist[2]
+ * @param field_t *gslDuration
+ * @param field_t *gslFirstDay
+ * @param int useCurrentYear = if TRUE, only measurements of the current year
+ *                             (index 0) are used for computation, i.e. that
+ *                             gsl can only be computed for the northern
+ *                             hemisphere (see definition of GSL: EcaGsl()
+ */
+void computeGsl(int nlevels, int gridsize, double *yvals, double missval, 
+                field_t *startDateWithHist[2], field_t *endDateWithHist[2],
+                field_t *gslDuration, field_t *gslFirstDay,
+                int useCurrentYear);
+
+/*
+ * Adjust the endDates found in the current year:
+ * if a starting date for gsl could be found, but no ending date, the end
+ * should be the last day of the corresponding year for norther and June, 30th
+ * for southern hemisphere
+ */
+void adjustEndDate(int nlevels, int gridsize, double *yvals, double missval, int ovdate,
+                   field_t *startDateWithHist[2], field_t *endDateWithHist[2]);
+/*
+ * Write GSL related fields to an output stream
+ */
+void writeGslStream(int ostreamID, int otaxisID, int otsID, 
+                    int ovarID1, int ovarID2, int ivlistID1,
+                    int first_var_id,
+                    field_t *gslDuration, field_t *gslFirstDay,
+                    int vdate, int vtime,  int nlevels);
+#endif /*ECAUTIL_H_*/
diff --git a/src/error.h b/src/error.h
new file mode 100644
index 0000000..02323b4
--- /dev/null
+++ b/src/error.h
@@ -0,0 +1,37 @@
+#ifndef _ERROR_H
+#define _ERROR_H
+
+#ifndef  WITH_CALLER_NAME
+#define  WITH_CALLER_NAME
+#endif
+
+#define  _FATAL     1     /* Error flag: exit on error  */
+#define  _VERBOSE   2     /* Error flag: report errors  */
+#define  _DEBUG     4     /* Error flag: debug          */
+
+extern int _ExitOnError;  /* If set to 1, exit on error (default 1)       */
+extern int _Verbose;      /* If set to 1, errors are reported (default 1) */
+extern int _Debug;        /* If set to 1, debuggig (default 0)            */
+
+void SysError_(const char *caller, const char *fmt, ...);
+void    Error_(const char *caller, const char *fmt, ...);
+void  Warning_(const char *caller, const char *fmt, ...);
+void  Message_(const char *caller, const char *fmt, ...);
+
+#if  defined  WITH_CALLER_NAME
+#  define  SysError(...)  SysError_(__func__, __VA_ARGS__)
+#  define    Errorc(...)     Error_(  caller, __VA_ARGS__)
+#  define     Error(...)     Error_(__func__, __VA_ARGS__)
+#  define   Warning(...)   Warning_(__func__, __VA_ARGS__)
+#  define  Messagec(...)   Message_(  caller, __VA_ARGS__)
+#  define   Message(...)   Message_(__func__, __VA_ARGS__)
+#else
+#  define  SysError(...)  SysError_((void *), __VA_ARGS__)
+#  define    Errorc(...)     Error_((void *), __VA_ARGS__)
+#  define     Error(...)     Error_((void *), __VA_ARGS__)
+#  define   Warning(...)   Warning_((void *), __VA_ARGS__)
+#  define  Messagec(...)   Message_((void *), __VA_ARGS__)
+#  define   Message(...)   Message_((void *), __VA_ARGS__)
+#endif
+
+#endif  /* _ERROR_H */
diff --git a/src/etopo.h b/src/etopo.h
new file mode 100644
index 0000000..fd12354
--- /dev/null
+++ b/src/etopo.h
@@ -0,0 +1,32401 @@
+/* cdo outputf,"%6g",8 -int -mulc,3 -addc,11000 etopo2_0.5deg.nc > topo */
+41350,41350,41350,41350,41350,41350,41352,41352,
+41352,41352,41352,41353,41353,41353,41353,41355,
+41355,41356,41356,41356,41356,41356,41356,41358,
+41358,41358,41358,41358,41358,41359,41361,41361,
+41359,41359,41359,41359,41359,41359,41359,41358,
+41358,41358,41359,41359,41359,41358,41359,41358,
+41358,41358,41358,41358,41358,41358,41358,41358,
+41358,41358,41356,41356,41355,41355,41355,41355,
+41353,41353,41353,41353,41352,41352,41352,41352,
+41350,41350,41350,41350,41350,41350,41349,41347,
+41347,41347,41346,41346,41346,41346,41346,41344,
+41343,41343,41343,41340,41340,41340,41338,41338,
+41338,41338,41337,41337,41335,41335,41335,41334,
+41334,41332,41331,41331,41329,41329,41329,41326,
+41326,41326,41326,41326,41325,41323,41323,41322,
+41322,41320,41319,41319,41319,41319,41317,41317,
+41316,41316,41316,41314,41314,41314,41313,41313,
+41311,41311,41311,41310,41308,41308,41308,41308,
+41307,41305,41305,41305,41305,41304,41302,41302,
+41302,41302,41301,41299,41299,41299,41298,41298,
+41296,41296,41296,41295,41295,41293,41293,41292,
+41292,41292,41292,41290,41290,41290,41290,41289,
+41287,41287,41287,41287,41284,41284,41284,41284,
+41284,41283,41283,41283,41283,41281,41281,41281,
+41281,41280,41280,41278,41278,41277,41277,41277,
+41277,41277,41277,41277,41277,41275,41274,41274,
+41274,41274,41274,41274,41274,41274,41274,41272,
+41271,41271,41271,41271,41271,41271,41271,41271,
+41269,41269,41269,41269,41269,41269,41269,41269,
+41269,41269,41269,41269,41269,41268,41269,41268,
+41269,41269,41269,41269,41269,41269,41269,41269,
+41269,41269,41269,41269,41269,41269,41268,41269,
+41269,41269,41269,41269,41269,41269,41269,41269,
+41271,41271,41271,41271,41272,41272,41272,41274,
+41274,41274,41275,41275,41275,41275,41275,41275,
+41275,41275,41275,41275,41275,41277,41278,41278,
+41278,41280,41280,41281,41281,41281,41281,41281,
+41283,41284,41284,41284,41284,41286,41286,41287,
+41287,41287,41290,41290,41290,41290,41290,41293,
+41293,41293,41296,41296,41296,41296,41298,41299,
+41301,41301,41301,41301,41302,41304,41304,41305,
+41307,41307,41308,41310,41310,41310,41311,41313,
+41313,41313,41316,41316,41317,41317,41319,41320,
+41320,41322,41322,41323,41323,41326,41326,41328,
+41329,41329,41331,41332,41332,41335,41335,41335,
+41338,41338,41340,41340,41343,41343,41344,41346,
+41346,41347,41349,41349,41349,41352,41352,41355,
+41355,41356,41356,41356,41358,41358,41359,41361,
+41362,41364,41365,41365,41367,41367,41368,41370,
+41370,41373,41373,41374,41376,41377,41379,41379,
+41380,41383,41383,41386,41389,41389,41391,41392,
+41392,41395,41395,41395,41397,41397,41398,41398,
+41400,41401,41401,41403,41403,41403,41403,41404,
+41406,41406,41406,41406,41406,41409,41409,41409,
+41412,41412,41413,41415,41415,41415,41415,41415,
+41416,41416,41418,41419,41419,41421,41422,41422,
+41424,41425,41425,41426,41427,41428,41428,41430,
+41430,41430,41430,41430,41431,41433,41433,41433,
+41434,41436,41436,41436,41439,41439,41439,41439,
+41440,41440,41440,41440,41442,41443,41443,41443,
+41445,41445,41446,41446,41446,41448,41448,41449,
+41449,41449,41449,41449,41449,41452,41452,41452,
+41452,41452,41452,41452,41454,41455,41455,41455,
+41455,41457,41457,41457,41458,41460,41460,41460,
+41460,41460,41460,41460,41460,41461,41461,41463,
+41463,41463,41463,41463,41464,41464,41464,41464,
+41466,41466,41466,41466,41467,41467,41467,41467,
+41467,41467,41467,41467,41469,41469,41469,41469,
+41469,41469,41469,41472,41472,41472,41472,41472,
+41472,41473,41473,41473,41473,41473,41473,41473,
+41473,41475,41475,41475,41475,41475,41475,41475,
+41475,41475,41475,41475,41476,41476,41476,41476,
+41476,41476,41475,41475,41475,41476,41476,41476,
+41476,41476,41476,41476,41476,41476,41476,41478,
+41478,41478,41476,41476,41476,41476,41476,41475,
+41475,41475,41475,41473,41473,41473,41473,41472,
+41472,41472,41472,41470,41469,41469,41467,41467,
+41467,41466,41464,41463,41463,41461,41460,41458,
+41458,41457,41455,41454,41452,41451,41449,41448,
+41446,41446,41443,41443,41442,41439,41437,41436,
+41434,41433,41431,41430,41427,41425,41424,41421,
+41418,41416,41413,41412,41409,41407,41406,41403,
+41401,41398,41396,41394,41392,41391,41391,41388,
+41386,41385,41382,41381,41379,41377,41376,41376,
+41373,41373,41370,41368,41368,41367,41366,41364,
+41362,41362,41361,41361,41360,41359,41359,41358,
+41358,41358,41358,41356,41356,41356,41356,41356,
+41356,41356,41356,41356,41353,41353,41353,41353,
+41353,41353,41353,41352,41351,41350,41350,41350,
+41350,41349,41349,41349,41350,41350,41350,41350,
+41817,41811,41803,41796,41789,41781,41774,41766,
+41760,41752,41746,41739,41733,41726,41719,41715,
+41710,41705,41700,41698,41694,41691,41688,41684,
+41679,41676,41669,41664,41659,41655,41650,41646,
+41643,41641,41637,41634,41631,41628,41623,41620,
+41617,41614,41612,41610,41607,41604,41601,41598,
+41595,41592,41589,41586,41583,41580,41577,41575,
+41573,41571,41568,41566,41562,41560,41558,41556,
+41553,41550,41548,41545,41542,41538,41535,41533,
+41530,41527,41523,41520,41517,41514,41511,41508,
+41503,41499,41496,41492,41488,41484,41481,41476,
+41473,41469,41464,41461,41455,41452,41449,41445,
+41442,41436,41434,41430,41427,41422,41419,41416,
+41412,41409,41406,41403,41403,41400,41399,41397,
+41394,41394,41391,41391,41388,41386,41385,41385,
+41383,41382,41380,41379,41377,41376,41376,41374,
+41374,41371,41371,41370,41368,41367,41365,41365,
+41362,41361,41359,41356,41358,41355,41352,41350,
+41347,41344,41343,41340,41335,41332,41331,41326,
+41323,41319,41315,41311,41307,41301,41296,41291,
+41285,41278,41272,41268,41262,41256,41250,41244,
+41236,41230,41223,41217,41210,41204,41197,41191,
+41185,41179,41173,41169,41162,41155,41151,41146,
+41140,41137,41134,41128,41125,41122,41119,41116,
+41113,41112,41109,41106,41104,41103,41100,41098,
+41097,41094,41094,41091,41091,41089,41088,41086,
+41085,41083,41083,41082,41080,41080,41079,41077,
+41076,41076,41074,41073,41074,41071,41072,41070,
+41070,41068,41068,41068,41067,41065,41067,41065,
+41065,41064,41062,41062,41062,41062,41061,41059,
+41061,41059,41059,41059,41058,41059,41058,41056,
+41056,41056,41056,41056,41056,41055,41055,41053,
+41055,41053,41055,41053,41055,41053,41053,41053,
+41053,41053,41053,41053,41053,41053,41053,41055,
+41055,41055,41056,41056,41056,41058,41058,41061,
+41061,41061,41062,41064,41064,41064,41065,41068,
+41068,41070,41070,41073,41073,41076,41077,41079,
+41080,41080,41083,41085,41086,41088,41089,41089,
+41092,41093,41095,41094,41097,41098,41098,41100,
+41100,41103,41103,41103,41104,41106,41104,41106,
+41106,41106,41107,41107,41106,41106,41106,41107,
+41107,41106,41106,41106,41106,41106,41106,41106,
+41106,41106,41106,41107,41106,41106,41106,41107,
+41107,41107,41107,41109,41109,41110,41110,41112,
+41112,41112,41113,41115,41116,41116,41118,41119,
+41122,41124,41126,41128,41128,41133,41134,41137,
+41139,41142,41146,41149,41151,41154,41158,41161,
+41166,41169,41175,41178,41181,41185,41190,41193,
+41197,41202,41208,41211,41215,41220,41224,41230,
+41235,41239,41245,41251,41254,41260,41266,41271,
+41278,41283,41289,41292,41298,41304,41310,41314,
+41320,41325,41331,41337,41344,41350,41358,41366,
+41373,41380,41386,41394,41400,41407,41413,41419,
+41425,41431,41437,41446,41453,41460,41469,41478,
+41487,41498,41508,41519,41530,41542,41553,41565,
+41577,41589,41601,41614,41626,41638,41649,41661,
+41671,41679,41686,41694,41699,41704,41710,41716,
+41724,41731,41739,41747,41755,41763,41770,41779,
+41788,41796,41803,41811,41819,41826,41833,41839,
+41845,41851,41856,41860,41865,41869,41872,41875,
+41878,41880,41883,41886,41886,41886,41886,41886,
+41886,41886,41886,41884,41883,41881,41878,41877,
+41875,41872,41869,41866,41863,41860,41857,41853,
+41850,41847,41845,41842,41839,41835,41832,41829,
+41825,41820,41817,41815,41811,41808,41803,41800,
+41797,41794,41791,41787,41784,41780,41776,41772,
+41769,41766,41763,41760,41757,41754,41749,41746,
+41743,41742,41739,41736,41734,41731,41728,41727,
+41725,41724,41721,41718,41718,41715,41715,41715,
+41715,41713,41713,41713,41712,41710,41710,41709,
+41707,41707,41706,41706,41706,41707,41707,41706,
+41706,41709,41709,41709,41709,41712,41712,41713,
+41716,41719,41719,41721,41724,41725,41727,41730,
+41731,41734,41736,41737,41739,41740,41743,41745,
+41748,41751,41752,41754,41757,41758,41761,41764,
+41767,41769,41772,41773,41776,41778,41781,41784,
+41784,41788,41791,41793,41794,41797,41800,41803,
+41806,41809,41811,41814,41815,41817,41820,41823,
+41826,41829,41830,41833,41836,41838,41839,41842,
+41845,41848,41851,41854,41857,41859,41862,41865,
+41868,41871,41874,41877,41880,41883,41884,41887,
+41892,41895,41895,41898,41901,41904,41907,41910,
+41913,41916,41919,41922,41925,41925,41928,41931,
+41932,41934,41937,41940,41940,41941,41944,41944,
+41946,41947,41950,41950,41952,41952,41953,41953,
+41955,41955,41955,41954,41954,41955,41955,41953,
+41953,41953,41951,41950,41949,41946,41946,41944,
+41943,41941,41938,41935,41932,41929,41925,41921,
+41917,41912,41908,41902,41896,41890,41885,41880,
+41874,41865,41859,41853,41845,41838,41832,41824,
+42205,42199,42193,42187,42180,42174,42167,42159,
+42153,42145,42138,42131,42123,42117,42110,42103,
+42097,42089,42084,42078,42072,42064,42058,42055,
+42049,42043,42039,42035,42029,42027,42024,42021,
+42018,42015,42010,42007,42001,41997,41995,41991,
+41985,41979,41975,41971,41967,41964,41959,41956,
+41949,41943,41937,41931,41924,41919,41914,41910,
+41908,41904,41901,41898,41895,41890,41886,41881,
+41875,41872,41866,41862,41857,41851,41844,41838,
+41832,41826,41820,41812,41806,41800,41793,41787,
+41781,41775,41768,41761,41756,41749,41743,41738,
+41733,41727,41722,41715,41709,41707,41703,41698,
+41695,41694,41691,41686,41683,41679,41673,41668,
+41663,41656,41650,41644,41638,41633,41627,41620,
+41614,41608,41601,41593,41586,41580,41572,41565,
+41557,41549,41542,41535,41527,41520,41513,41505,
+41499,41492,41483,41476,41469,41461,41455,41448,
+41442,41434,41428,41422,41416,41412,41406,41403,
+41400,41394,41392,41390,41385,41382,41377,41373,
+41368,41362,41356,41352,41345,41338,41334,41327,
+41320,41314,41307,41299,41293,41286,41278,41271,
+41264,41256,41250,41243,41235,41227,41220,41214,
+41207,41199,41191,41185,41179,41172,41166,41158,
+41154,41147,41142,41136,41131,41127,41121,41116,
+41113,41110,41106,41103,41100,41100,41098,41095,
+41093,41091,41088,41085,41081,41077,41073,41071,
+41067,41065,41062,41059,41058,41054,41049,41046,
+41043,41041,41040,41037,41034,41031,41028,41026,
+41023,41020,41017,41016,41013,41010,41008,41005,
+41004,41001,40999,40996,40994,40992,40990,40987,
+40986,40983,40981,40980,40977,40975,40973,40971,
+40969,40967,40965,40964,40962,40960,40959,40956,
+40953,40951,40950,40947,40944,40944,40941,40939,
+40938,40935,40933,40931,40929,40927,40924,40923,
+40920,40918,40915,40912,40911,40909,40906,40903,
+40902,40899,40896,40893,40891,40887,40884,40881,
+40881,40878,40875,40873,40870,40867,40867,40864,
+40864,40861,40861,40861,40860,40860,40857,40857,
+40857,40857,40857,40857,40857,40858,40860,40862,
+40863,40863,40866,40866,40869,40872,40873,40875,
+40878,40881,40884,40887,40890,40893,40899,40900,
+40905,40909,40912,40916,40921,40924,40929,40933,
+40939,40942,40948,40952,40959,40962,40968,40974,
+40980,40983,40990,40996,41001,41006,41013,41020,
+41026,41030,41038,41043,41049,41055,41061,41067,
+41071,41076,41079,41086,41089,41092,41095,41098,
+41100,41101,41104,41107,41109,41112,41116,41119,
+41122,41127,41130,41133,41138,41143,41146,41151,
+41156,41161,41166,41170,41176,41182,41187,41193,
+41199,41204,41212,41217,41226,41232,41238,41247,
+41253,41262,41268,41275,41283,41289,41298,41304,
+41311,41319,41327,41334,41343,41352,41361,41368,
+41376,41385,41392,41398,41403,41408,41412,41418,
+41424,41430,41439,41445,41454,41462,41470,41479,
+41489,41499,41508,41518,41527,41538,41548,41559,
+41571,41583,41595,41607,41621,41635,41653,41668,
+41684,41697,41713,41728,41745,41764,41784,41804,
+41827,41850,41874,41896,41919,41938,41958,41973,
+41985,41994,42003,42011,42020,42030,42041,42051,
+42063,42072,42084,42092,42102,42111,42117,42126,
+42134,42141,42147,42153,42159,42165,42168,42172,
+42177,42179,42183,42185,42189,42190,42192,42193,
+42193,42195,42195,42195,42195,42195,42193,42193,
+42192,42190,42187,42187,42184,42184,42181,42180,
+42177,42175,42172,42171,42168,42166,42163,42161,
+42159,42156,42153,42152,42150,42147,42144,42141,
+42138,42135,42132,42129,42127,42126,42124,42121,
+42118,42117,42114,42112,42109,42108,42106,42103,
+42102,42100,42098,42096,42096,42093,42091,42091,
+42088,42088,42088,42085,42084,42084,42082,42082,
+42081,42081,42081,42079,42079,42078,42079,42078,
+42077,42076,42075,42076,42076,42075,42075,42073,
+42073,42073,42073,42072,42070,42071,42070,42070,
+42070,42069,42069,42068,42067,42066,42067,42066,
+42064,42064,42064,42063,42061,42061,42060,42060,
+42058,42058,42057,42054,42055,42052,42051,42051,
+42049,42049,42046,42043,42042,42040,42040,42038,
+42037,42034,42031,42030,42028,42025,42021,42019,
+42015,42013,42010,42006,42003,42001,42000,41994,
+41992,41991,41986,41983,41980,41977,41974,41973,
+41971,41971,41971,41971,41974,41979,41985,41992,
+41999,42008,42019,42033,42049,42065,42081,42097,
+42111,42128,42141,42155,42168,42180,42190,42201,
+42210,42220,42229,42237,42245,42251,42258,42261,
+42267,42270,42274,42280,42282,42283,42285,42286,
+42286,42288,42289,42289,42289,42289,42289,42289,
+42289,42289,42288,42289,42288,42288,42288,42286,
+42285,42285,42282,42281,42280,42277,42276,42273,
+42271,42270,42267,42261,42258,42255,42252,42249,
+42244,42241,42237,42232,42228,42222,42216,42211,
+42372,42373,42376,42376,42379,42381,42382,42385,
+42387,42388,42390,42391,42393,42394,42395,42396,
+42396,42397,42397,42397,42396,42396,42394,42393,
+42391,42388,42385,42382,42379,42375,42372,42366,
+42360,42357,42351,42345,42340,42333,42327,42321,
+42315,42309,42303,42297,42291,42282,42270,42257,
+42242,42226,42210,42195,42179,42162,42146,42128,
+42111,42093,42075,42058,42041,42024,42011,42000,
+41985,41965,41943,41919,41898,41878,41860,41842,
+41825,41812,41798,41788,41777,41769,41761,41754,
+41748,41744,41739,41737,41733,41730,41730,41727,
+41725,41725,41722,41721,41721,41721,41721,41721,
+41719,41719,41719,41721,41721,41721,41721,41721,
+41722,41722,41722,41722,41721,41721,41721,41721,
+41721,41718,41718,41716,41713,41710,41705,41703,
+41699,41694,41686,41677,41665,41653,41639,41625,
+41610,41595,41581,41568,41553,41541,41527,41515,
+41503,41490,41478,41467,41455,41443,41433,41421,
+41409,41399,41388,41376,41364,41353,41342,41329,
+41318,41307,41293,41281,41269,41257,41245,41232,
+41220,41208,41197,41187,41177,41167,41159,41151,
+41145,41139,41133,41130,41127,41122,41121,41118,
+41115,41112,41109,41106,41103,41098,41096,41091,
+41087,41080,41076,41067,41058,41049,41040,41031,
+41022,41014,41004,40998,40989,40981,40974,40969,
+40961,40956,40952,40947,40942,40939,40935,40932,
+40929,40926,40923,40920,40918,40915,40912,40911,
+40908,40905,40903,40902,40899,40896,40894,40891,
+40888,40887,40887,40884,40882,40879,40878,40875,
+40875,40872,40869,40869,40866,40863,40861,40858,
+40855,40851,40848,40845,40840,40836,40831,40827,
+40824,40818,40815,40810,40806,40803,40801,40798,
+40795,40795,40791,40791,40788,40785,40785,40782,
+40780,40777,40774,40773,40770,40765,40762,40758,
+40753,40749,40743,40738,40731,40724,40717,40711,
+40705,40698,40692,40686,40681,40677,40671,40668,
+40663,40662,40656,40656,40653,40651,40650,40648,
+40648,40648,40650,40650,40651,40653,40654,40657,
+40659,40662,40665,40668,40668,40672,40675,40680,
+40684,40687,40692,40695,40701,40707,40713,40719,
+40726,40735,40741,40747,40756,40763,40770,40777,
+40782,40789,40794,40797,40799,40803,40805,40806,
+40812,40813,40818,40821,40824,40828,40833,40837,
+40840,40846,40851,40857,40861,40869,40873,40881,
+40888,40896,40903,40910,40917,40925,40933,40941,
+40950,40957,40967,40974,40983,40993,41001,41010,
+41020,41028,41036,41044,41053,41059,41066,41074,
+41080,41086,41091,41097,41098,41100,41103,41106,
+41112,41115,41118,41124,41127,41133,41136,41142,
+41148,41151,41157,41160,41166,41169,41173,41178,
+41181,41184,41188,41192,41194,41199,41202,41206,
+41210,41214,41217,41221,41226,41229,41234,41239,
+41244,41250,41256,41263,41272,41280,41290,41301,
+41314,41328,41344,41360,41376,41396,41420,41449,
+41486,41523,41562,41602,41638,41670,41693,41706,
+41720,41736,41752,41768,41782,41798,41813,41827,
+41842,41855,41869,41882,41895,41908,41919,41931,
+41943,41954,41965,41975,41983,41991,41995,41999,
+42004,42011,42018,42024,42033,42042,42051,42060,
+42069,42078,42087,42096,42106,42115,42122,42132,
+42140,42148,42157,42163,42170,42177,42183,42189,
+42193,42199,42204,42208,42213,42217,42222,42225,
+42228,42231,42234,42235,42238,42240,42243,42244,
+42246,42247,42249,42249,42250,42250,42252,42252,
+42253,42253,42253,42253,42253,42252,42252,42250,
+42250,42250,42250,42249,42247,42247,42246,42246,
+42244,42244,42241,42241,42241,42240,42239,42237,
+42237,42235,42234,42234,42232,42231,42231,42229,
+42228,42228,42228,42225,42223,42223,42222,42222,
+42220,42219,42219,42219,42216,42216,42216,42216,
+42214,42214,42213,42211,42211,42210,42210,42210,
+42210,42208,42207,42207,42207,42205,42205,42205,
+42204,42204,42204,42202,42204,42202,42202,42202,
+42203,42202,42202,42202,42202,42202,42202,42202,
+42202,42202,42204,42204,42204,42205,42205,42205,
+42205,42207,42208,42208,42211,42211,42211,42214,
+42214,42216,42217,42217,42220,42223,42223,42226,
+42229,42232,42234,42237,42241,42243,42246,42250,
+42253,42256,42259,42264,42267,42270,42274,42277,
+42281,42285,42288,42292,42294,42295,42298,42298,
+42300,42301,42302,42303,42306,42306,42306,42308,
+42309,42309,42310,42310,42310,42310,42310,42310,
+42310,42310,42310,42309,42309,42307,42306,42306,
+42304,42303,42303,42303,42303,42303,42303,42303,
+42303,42301,42303,42301,42301,42303,42303,42303,
+42304,42304,42306,42305,42306,42307,42309,42311,
+42312,42315,42315,42318,42318,42321,42323,42324,
+42327,42328,42330,42333,42333,42336,42339,42340,
+42343,42345,42348,42349,42352,42352,42355,42358,
+42358,42361,42362,42364,42366,42366,42369,42372,
+42231,42227,42222,42219,42215,42208,42202,42197,
+42190,42180,42172,42160,42148,42135,42121,42106,
+42091,42077,42062,42048,42034,42021,42004,41992,
+41976,41958,41943,41929,41916,41904,41891,41877,
+41865,41853,41842,41832,41822,41811,41799,41787,
+41775,41763,41754,41746,41739,41730,41724,41716,
+41710,41701,41695,41689,41681,41667,41651,41631,
+41608,41584,41562,41540,41518,41499,41480,41461,
+41442,41428,41414,41405,41395,41388,41382,41379,
+41374,41371,41371,41370,41369,41370,41367,41365,
+41368,41370,41373,41374,41379,41385,41388,41391,
+41396,41400,41407,41415,41426,41436,41448,41461,
+41474,41487,41497,41507,41517,41526,41533,41540,
+41546,41551,41551,41553,41550,41545,41541,41532,
+41523,41512,41500,41488,41475,41460,41448,41433,
+41421,41410,41403,41397,41388,41380,41370,41361,
+41350,41340,41330,41322,41313,41303,41295,41287,
+41278,41271,41261,41253,41244,41238,41229,41217,
+41206,41191,41176,41160,41140,41112,41080,41033,
+40978,40926,40879,40833,40803,40776,40752,40733,
+40716,40703,40692,40686,40683,40681,40681,40680,
+40681,40684,40684,40684,40687,40689,40689,40689,
+40690,40690,40690,40689,40687,40684,40683,40680,
+40675,40674,40669,40666,40661,40657,40653,40648,
+40643,40638,40633,40627,40623,40617,40614,40608,
+40606,40605,40600,40599,40596,40596,40595,40594,
+40594,40594,40594,40594,40596,40597,40597,40600,
+40600,40603,40603,40605,40606,40606,40609,40609,
+40611,40611,40611,40612,40612,40614,40612,40615,
+40615,40615,40618,40618,40618,40620,40620,40618,
+40617,40617,40614,40608,40602,40595,40587,40579,
+40570,40560,40548,40536,40524,40512,40502,40490,
+40476,40462,40446,40428,40410,40392,40376,40359,
+40344,40329,40316,40304,40293,40284,40276,40269,
+40264,40258,40257,40254,40249,40246,40246,40243,
+40242,40239,40240,40242,40242,40245,40248,40251,
+40254,40257,40260,40264,40270,40276,40285,40294,
+40304,40314,40327,40341,40355,40371,40389,40405,
+40421,40438,40453,40467,40479,40489,40498,40504,
+40510,40518,40524,40533,40542,40550,40557,40566,
+40573,40582,40590,40597,40606,40614,40621,40629,
+40636,40643,40649,40656,40662,40668,40674,40679,
+40684,40690,40695,40699,40705,40710,40715,40719,
+40725,40731,40735,40740,40746,40752,40758,40764,
+40770,40776,40782,40786,40791,40795,40799,40806,
+40817,40828,40840,40854,40866,40881,40896,40912,
+40929,40944,40962,40979,40998,41016,41034,41049,
+41062,41074,41086,41095,41105,41112,41120,41127,
+41133,41140,41146,41151,41155,41158,41163,41166,
+41169,41172,41173,41176,41178,41181,41181,41184,
+41184,41187,41187,41190,41190,41191,41193,41194,
+41197,41199,41202,41204,41207,41212,41218,41224,
+41232,41241,41251,41262,41272,41286,41301,41318,
+41334,41352,41368,41385,41397,41415,41439,41472,
+41505,41538,41571,41604,41641,41674,41704,41733,
+41760,41788,41817,41844,41871,41895,41917,41938,
+41958,41973,41986,41997,42004,42013,42022,42031,
+42039,42046,42054,42061,42069,42076,42085,42090,
+42099,42106,42114,42120,42127,42135,42142,42148,
+42154,42160,42166,42170,42175,42181,42184,42190,
+42193,42198,42202,42207,42210,42214,42218,42220,
+42225,42228,42231,42234,42237,42240,42241,42243,
+42246,42248,42250,42252,42255,42255,42258,42258,
+42261,42261,42262,42264,42264,42267,42267,42267,
+42270,42270,42270,42270,42271,42273,42273,42273,
+42273,42273,42273,42276,42276,42276,42276,42276,
+42276,42276,42276,42277,42277,42279,42279,42279,
+42279,42279,42279,42280,42280,42280,42282,42282,
+42282,42282,42283,42283,42283,42283,42285,42286,
+42286,42286,42286,42288,42289,42289,42289,42291,
+42292,42292,42292,42293,42294,42295,42295,42295,
+42295,42295,42295,42295,42295,42295,42295,42294,
+42292,42292,42291,42289,42289,42286,42286,42285,
+42283,42283,42282,42280,42279,42279,42277,42276,
+42276,42273,42273,42273,42270,42270,42268,42267,
+42267,42265,42264,42262,42261,42260,42259,42259,
+42256,42256,42255,42253,42252,42252,42249,42249,
+42248,42246,42245,42243,42241,42241,42240,42237,
+42237,42235,42235,42232,42232,42232,42231,42229,
+42228,42227,42225,42222,42221,42220,42219,42216,
+42214,42213,42211,42209,42208,42205,42205,42202,
+42201,42199,42198,42196,42196,42196,42194,42193,
+42193,42193,42192,42192,42193,42195,42192,42195,
+42195,42196,42198,42199,42199,42201,42202,42204,
+42205,42207,42208,42211,42213,42214,42215,42217,
+42219,42220,42223,42225,42226,42228,42231,42232,
+42234,42236,42237,42240,42243,42243,42246,42247,
+42249,42249,42249,42252,42253,42252,42253,42253,
+42255,42255,42253,42255,42253,42253,42252,42250,
+42249,42247,42247,42244,42241,42240,42238,42234,
+42090,42082,42072,42056,42033,42003,41976,41938,
+41889,41832,41782,41733,41699,41672,41646,41627,
+41608,41589,41570,41549,41527,41503,41478,41447,
+41422,41403,41382,41361,41339,41326,41319,41319,
+41321,41320,41313,41299,41283,41268,41255,41247,
+41242,41242,41244,41233,41182,41109,41016,40902,
+40806,40746,40668,40511,40314,40321,40160,40093,
+40071,40045,40036,40048,40064,40091,40124,40147,
+40203,40267,40347,40432,40524,40607,40675,40731,
+40770,40794,40811,40826,40836,40844,40851,40857,
+40863,40866,40866,40864,40861,40857,40849,40842,
+40836,40830,40825,40828,40831,40836,40845,40857,
+40874,40888,40899,40908,40914,40920,40924,40932,
+40938,40947,40953,40959,40965,40965,40965,40961,
+40957,40954,40951,40942,40938,40932,40927,40921,
+40917,40911,40909,40905,40900,40897,40894,40891,
+40887,40886,40884,40882,40881,40876,40873,40869,
+40864,40859,40851,40841,40830,40817,40800,40777,
+40751,40722,40694,40665,40639,40612,40589,40566,
+40543,40521,40501,40479,40449,40416,40377,40336,
+40293,40250,40216,40197,40176,40152,40131,40113,
+40094,40076,40055,40034,40012,39990,39968,39949,
+39930,39917,39906,39900,39895,39891,39887,39886,
+39883,39879,39880,39882,39884,39891,39898,39903,
+39906,39910,39916,39925,39938,39946,39952,39960,
+39968,39975,39984,39990,40002,40016,40031,40047,
+40063,40081,40099,40117,40137,40149,40161,40173,
+40179,40182,40183,40185,40185,40185,40186,40185,
+40186,40185,40185,40183,40180,40179,40177,40173,
+40166,40159,40155,40149,40143,40135,40129,40120,
+40112,40102,40093,40083,40073,40062,40051,40040,
+40028,40015,40004,39993,39983,39974,39966,39958,
+39952,39946,39941,39939,39933,39930,39925,39922,
+39919,39919,39920,39918,39918,39919,39919,39919,
+39918,39917,39913,39910,39907,39906,39903,39901,
+39897,39894,39892,39889,39888,39886,39881,39879,
+39874,39876,39879,39879,39883,39888,39891,39897,
+39904,39914,39928,39947,39966,39991,40014,40038,
+40063,40086,40107,40124,40139,40152,40164,40177,
+40187,40195,40203,40215,40225,40237,40251,40266,
+40285,40305,40327,40349,40374,40396,40419,40438,
+40456,40472,40485,40494,40502,40509,40518,40527,
+40536,40545,40555,40566,40577,40587,40598,40608,
+40617,40627,40636,40646,40655,40666,40676,40688,
+40698,40710,40719,40728,40736,40744,40753,40759,
+40769,40779,40792,40803,40819,40839,40857,40879,
+40902,40926,40947,40971,40992,41013,41033,41052,
+41068,41082,41093,41100,41104,41110,41116,41122,
+41129,41136,41140,41147,41152,41157,41161,41166,
+41172,41176,41181,41187,41193,41199,41206,41212,
+41220,41229,41238,41248,41259,41270,41283,41294,
+41307,41316,41326,41337,41343,41353,41361,41370,
+41382,41394,41405,41415,41427,41441,41457,41473,
+41490,41508,41528,41548,41568,41588,41609,41630,
+41651,41670,41685,41696,41709,41726,41746,41770,
+41795,41821,41848,41875,41902,41927,41952,41973,
+41988,41998,42007,42021,42034,42048,42062,42075,
+42088,42100,42112,42122,42133,42144,42151,42160,
+42168,42175,42183,42190,42196,42201,42207,42211,
+42216,42219,42222,42228,42231,42233,42237,42238,
+42240,42243,42244,42244,42247,42247,42250,42250,
+42250,42253,42253,42253,42253,42255,42256,42256,
+42256,42256,42256,42256,42256,42256,42256,42256,
+42256,42256,42255,42256,42256,42255,42255,42256,
+42255,42256,42256,42256,42258,42258,42258,42258,
+42258,42258,42261,42261,42261,42261,42264,42264,
+42267,42267,42267,42270,42270,42273,42274,42276,
+42279,42279,42282,42285,42285,42288,42291,42291,
+42294,42297,42297,42298,42300,42300,42300,42302,
+42303,42303,42303,42306,42306,42306,42306,42306,
+42309,42309,42309,42309,42309,42309,42309,42309,
+42309,42309,42309,42309,42309,42309,42309,42309,
+42306,42306,42306,42303,42303,42300,42300,42298,
+42297,42294,42291,42286,42282,42278,42273,42267,
+42262,42256,42250,42245,42238,42235,42228,42222,
+42216,42211,42207,42198,42192,42187,42183,42177,
+42171,42163,42157,42153,42147,42141,42135,42129,
+42123,42118,42112,42106,42100,42094,42090,42084,
+42078,42073,42069,42063,42057,42053,42049,42043,
+42039,42034,42030,42025,42024,42019,42014,42013,
+42010,42006,42004,42003,42001,41998,41997,41997,
+41994,41994,41992,41992,41991,41989,41991,41989,
+41989,41991,41989,41989,41990,41989,41991,41992,
+41995,41995,41998,42001,42006,42010,42018,42024,
+42027,42031,42034,42039,42043,42049,42052,42057,
+42061,42066,42069,42073,42078,42081,42084,42087,
+42087,42090,42091,42091,42093,42094,42096,42096,
+42097,42097,42098,42099,42099,42100,42102,42103,
+42105,42105,42105,42108,42106,42108,42108,42108,
+42109,42108,42108,42106,42103,42103,42100,42096,
+41845,41835,41823,41810,41793,41772,41749,41726,
+41706,41685,41653,41604,41543,41474,41393,41303,
+41190,41093,41022,40971,40942,40923,40899,40857,
+40774,40594,40393,40236,40148,40103,40078,40068,
+40078,40106,40139,40151,40162,40206,40200,40195,
+40182,40167,40204,40227,40258,40287,40308,40309,
+40310,40500,40731,40502,39744,39453,39301,39078,
+38883,38855,38823,38826,38921,39024,39085,39141,
+39758,41730,42007,42324,41565,40634,40733,40367,
+40291,40222,40174,40236,40334,40380,40394,40429,
+40464,40479,40476,40459,40437,40422,40417,40414,
+40416,40417,40416,40414,40410,40402,40383,40350,
+40305,40257,40213,40169,40127,40100,40073,40045,
+40011,39961,39903,39850,39816,39799,39800,39816,
+39846,39891,39972,40107,40264,40351,40392,40425,
+40454,40479,40497,40514,40531,40549,40565,40582,
+40599,40614,40629,40647,40663,40678,40696,40712,
+40726,40740,40751,40761,40765,40768,40768,40764,
+40754,40737,40715,40684,40645,40600,40554,40509,
+40481,40447,40410,40370,40329,40279,40227,40188,
+40138,40065,39977,39879,39780,39688,39610,39546,
+39476,39406,39336,39270,39204,39143,39088,39042,
+39012,38989,38974,38960,38943,38928,38921,38920,
+38929,38943,38963,38979,38999,39027,39064,39115,
+39174,39239,39301,39357,39408,39447,39479,39501,
+39514,39521,39523,39525,39523,39519,39513,39504,
+39495,39485,39478,39472,39468,39463,39463,39466,
+39469,39472,39477,39481,39487,39491,39496,39504,
+39513,39521,39528,39536,39544,39549,39555,39559,
+39564,39568,39573,39577,39584,39586,39589,39589,
+39585,39573,39558,39534,39503,39469,39438,39406,
+39378,39355,39336,39324,39313,39307,39303,39303,
+39303,39307,39313,39324,39339,39358,39378,39399,
+39420,39439,39459,39474,39489,39501,39512,39522,
+39529,39534,39540,39545,39552,39555,39556,39559,
+39561,39562,39564,39565,39571,39576,39580,39585,
+39588,39592,39597,39598,39604,39609,39618,39627,
+39637,39649,39663,39680,39696,39714,39733,39754,
+39774,39793,39812,39831,39850,39867,39884,39895,
+39906,39920,39934,39954,39971,39990,40008,40027,
+40047,40067,40088,40108,40129,40149,40167,40185,
+40203,40223,40246,40272,40299,40326,40354,40379,
+40402,40426,40449,40470,40489,40503,40521,40539,
+40558,40580,40600,40620,40641,40661,40680,40697,
+40715,40731,40744,40758,40771,40782,40789,40795,
+40801,40809,40819,40829,40841,40855,40869,40883,
+40898,40913,40926,40940,40955,40969,40983,40996,
+41008,41023,41035,41047,41058,41068,41079,41087,
+41095,41100,41102,41108,41114,41121,41129,41139,
+41148,41160,41169,41181,41193,41205,41219,41232,
+41245,41259,41274,41289,41303,41317,41331,41345,
+41360,41373,41387,41395,41402,41412,41425,41440,
+41457,41475,41496,41517,41540,41562,41586,41610,
+41634,41657,41679,41694,41711,41734,41762,41790,
+41819,41850,41881,41913,41946,41973,41992,42008,
+42026,42045,42065,42087,42110,42134,42157,42178,
+42201,42219,42236,42250,42264,42273,42282,42288,
+42295,42298,42301,42304,42306,42309,42312,42315,
+42317,42318,42322,42324,42328,42331,42334,42337,
+42340,42343,42345,42348,42351,42351,42354,42357,
+42359,42360,42361,42361,42364,42364,42364,42364,
+42364,42364,42363,42364,42364,42362,42361,42361,
+42361,42358,42361,42358,42357,42355,42355,42354,
+42352,42349,42349,42348,42346,42342,42339,42337,
+42333,42331,42328,42324,42322,42319,42315,42312,
+42309,42306,42304,42303,42300,42298,42297,42297,
+42294,42294,42291,42291,42289,42289,42288,42286,
+42286,42283,42283,42283,42283,42282,42282,42282,
+42282,42282,42282,42282,42285,42285,42285,42288,
+42288,42289,42291,42292,42294,42294,42294,42295,
+42295,42295,42295,42295,42297,42297,42297,42297,
+42297,42297,42297,42297,42297,42297,42297,42297,
+42297,42295,42294,42291,42291,42288,42285,42282,
+42279,42273,42268,42264,42258,42252,42246,42240,
+42233,42225,42217,42208,42201,42192,42184,42176,
+42166,42157,42148,42139,42129,42121,42110,42100,
+42091,42082,42073,42063,42057,42047,42039,42032,
+42024,42021,42013,42006,41998,41994,41988,41982,
+41974,41967,41961,41955,41947,41941,41935,41927,
+41919,41911,41904,41895,41889,41880,41874,41865,
+41859,41851,41844,41838,41832,41827,41820,41814,
+41808,41803,41797,41791,41785,41781,41775,41770,
+41766,41761,41757,41755,41751,41751,41749,41748,
+41746,41748,41748,41746,41749,41749,41751,41752,
+41754,41754,41757,41760,41763,41766,41769,41773,
+41778,41784,41788,41796,41803,41811,41820,41829,
+41838,41849,41859,41868,41877,41885,41892,41899,
+41903,41908,41911,41911,41910,41910,41907,41905,
+41902,41902,41900,41901,41902,41901,41899,41896,
+41893,41888,41883,41878,41872,41866,41860,41853,
+41377,41374,41379,41355,41326,41263,41196,41138,
+41067,40938,40905,40903,40872,40832,40807,40782,
+40707,40599,40446,40292,40141,39852,39602,39466,
+39324,39189,39084,39013,38991,38871,38671,38517,
+38415,38388,38379,38418,38502,38580,38779,39288,
+39724,41365,41961,43572,44487,44383,43678,41151,
+38957,38583,38322,38010,37963,38237,37602,37324,
+37449,37422,37387,37075,37123,37465,37830,38478,
+39755,41136,41406,40519,39939,39326,39360,39452,
+39491,39530,39626,39792,39956,40101,40205,40272,
+40340,40410,40482,40537,40566,40567,40556,40544,
+40545,40594,40717,40876,41034,41160,41298,41577,
+41640,41633,39885,39298,38964,38611,38262,38366,
+38418,38514,38898,38972,38856,39164,39553,39630,
+39696,39813,39922,40017,40092,40146,40176,40193,
+40198,40206,40221,40234,40249,40266,40281,40299,
+40316,40334,40353,40375,40400,40426,40457,40485,
+40510,40549,40599,40656,40717,40776,40821,40857,
+40885,40902,40909,40905,40894,40880,40858,40821,
+40755,40650,40535,40453,40326,40101,39729,39507,
+39391,39300,39220,39148,39080,39024,38988,38954,
+38916,38878,38844,38812,38784,38758,38736,38715,
+38694,38672,38649,38624,38596,38566,38535,38499,
+38463,38427,38403,38385,38361,38336,38312,38292,
+38272,38258,38248,38245,38242,38238,38229,38216,
+38202,38187,38171,38150,38118,38079,38029,37971,
+37909,37848,37809,37773,37747,37756,37764,37770,
+37800,37838,37876,37913,37951,37999,38064,38136,
+38223,38313,38393,38466,38540,38611,38676,38736,
+38795,38851,38905,38943,38969,38993,39008,39016,
+39018,39012,38998,38980,38956,38929,38905,38883,
+38866,38851,38837,38828,38818,38810,38806,38805,
+38805,38811,38817,38828,38841,38857,38876,38895,
+38912,38929,38950,38967,38985,39006,39027,39054,
+39079,39104,39128,39152,39174,39198,39225,39249,
+39273,39291,39301,39314,39327,39341,39355,39366,
+39379,39391,39402,39414,39423,39435,39446,39457,
+39469,39481,39496,39510,39525,39542,39558,39571,
+39583,39602,39624,39653,39690,39727,39768,39807,
+39845,39876,39896,39914,39939,39969,40000,40033,
+40065,40095,40130,40161,40188,40204,40223,40244,
+40266,40292,40320,40348,40374,40401,40427,40452,
+40470,40486,40496,40507,40524,40545,40566,40588,
+40610,40632,40653,40675,40695,40715,40735,40752,
+40768,40783,40792,40801,40807,40819,40827,40837,
+40848,40858,40869,40880,40892,40902,40913,40924,
+40937,40947,40959,40971,40982,40995,41006,41018,
+41030,41040,41051,41060,41069,41076,41083,41088,
+41095,41100,41104,41109,41116,41122,41130,41136,
+41144,41154,41160,41171,41182,41192,41205,41215,
+41228,41241,41254,41268,41282,41299,41313,41329,
+41346,41364,41380,41394,41403,41421,41443,41470,
+41505,41541,41580,41617,41653,41685,41701,41723,
+41754,41787,41823,41862,41901,41940,41973,41995,
+42016,42049,42087,42126,42166,42202,42238,42270,
+42293,42307,42325,42345,42363,42380,42398,42414,
+42429,42444,42456,42468,42477,42485,42494,42499,
+42505,42512,42517,42522,42530,42535,42540,42546,
+42549,42557,42561,42567,42573,42579,42582,42586,
+42590,42595,42597,42601,42603,42606,42610,42615,
+42619,42624,42628,42634,42636,42638,42640,42641,
+42642,42645,42645,42648,42648,42648,42648,42648,
+42648,42647,42648,42648,42646,42645,42645,42645,
+42644,42642,42642,42642,42642,42642,42639,42636,
+42636,42633,42631,42628,42624,42622,42619,42615,
+42612,42609,42606,42604,42601,42598,42595,42591,
+42585,42580,42572,42562,42553,42543,42534,42525,
+42516,42509,42498,42492,42483,42476,42468,42459,
+42453,42447,42441,42435,42426,42420,42412,42404,
+42396,42389,42382,42374,42367,42360,42353,42347,
+42339,42334,42328,42324,42321,42316,42315,42312,
+42309,42307,42306,42304,42304,42303,42301,42301,
+42301,42301,42301,42300,42300,42300,42298,42297,
+42297,42294,42289,42283,42275,42267,42257,42247,
+42237,42227,42216,42204,42194,42183,42170,42158,
+42147,42135,42123,42111,42099,42087,42075,42063,
+42051,42040,42030,42018,42007,41999,41993,41985,
+41979,41970,41961,41949,41940,41929,41918,41908,
+41896,41883,41871,41859,41845,41829,41815,41802,
+41787,41774,41760,41746,41735,41723,41713,41706,
+41698,41694,41688,41682,41678,41672,41667,41662,
+41656,41650,41646,41641,41635,41631,41626,41622,
+41616,41614,41611,41607,41604,41601,41601,41598,
+41595,41594,41590,41589,41587,41586,41583,41580,
+41580,41577,41577,41572,41570,41566,41559,41551,
+41540,41529,41514,41496,41478,41465,41458,41450,
+41443,41443,41430,41416,41397,41373,41353,41314,
+41271,41241,41221,41202,41180,41164,41157,41157,
+41157,41160,41172,41192,41212,41238,41271,41316,
+41365,41409,41430,41430,41419,41409,41400,41385,
+40754,40686,40617,40569,40565,40609,40708,40843,
+40960,41031,41082,41133,41186,41239,41286,41323,
+41352,41370,41377,41356,41363,41450,41469,41364,
+41157,40610,39926,39825,40682,42056,40999,42933,
+42885,37957,37295,37107,37724,38662,38834,37432,
+35314,35055,35481,36987,38757,38180,37494,37206,
+36374,35916,36072,37121,36744,35493,35340,35264,
+35445,35799,36268,36340,36345,36859,37961,37115,
+36423,36322,36339,36544,36627,36619,36654,36732,
+36841,36790,36897,37082,37074,36960,36780,36826,
+37096,37025,37148,39273,39580,38947,38265,37737,
+37215,36969,36816,36784,36678,36657,36790,37042,
+37419,37761,37763,38037,39792,40671,38952,41429,
+42093,41897,41871,42018,42220,42243,42105,41876,
+41642,41479,41314,41185,41111,41038,40938,40856,
+40830,40795,40701,40484,40249,40158,40146,40146,
+40149,40157,40163,40173,40182,40186,40186,40191,
+40197,40209,40233,40266,40314,40370,40434,40485,
+40522,40563,40603,40641,40674,40698,40716,40725,
+40719,40693,40644,40563,40482,40354,40070,39636,
+39390,39215,39072,38989,38927,38874,38844,38833,
+38837,38845,38850,38840,38829,38821,38817,38803,
+38789,38768,38725,38653,38561,38470,38403,38305,
+38145,37960,37824,37764,37752,37766,37789,37818,
+37851,37887,37920,37941,37947,37930,37892,37833,
+37764,37654,37512,37363,37233,37164,37110,37064,
+37026,37002,36988,36984,36987,36999,37023,37053,
+37092,37135,37176,37201,37232,37269,37314,37368,
+37422,37475,37531,37588,37641,37692,37740,37783,
+37840,37935,38032,38122,38195,38258,38307,38332,
+38344,38350,38352,38353,38353,38356,38356,38361,
+38364,38370,38373,38374,38378,38380,38385,38386,
+38389,38392,38394,38394,38396,38400,38407,38415,
+38426,38442,38460,38483,38508,38537,38564,38587,
+38606,38627,38646,38663,38679,38693,38709,38728,
+38763,38803,38845,38887,38929,38970,39012,39054,
+39093,39133,39171,39210,39248,39281,39299,39321,
+39344,39365,39384,39400,39415,39427,39441,39454,
+39469,39483,39499,39522,39547,39584,39616,39671,
+39742,39819,39883,39918,39963,40011,40053,40095,
+40131,40164,40188,40206,40227,40251,40278,40306,
+40336,40367,40395,40422,40449,40475,40495,40507,
+40521,40537,40552,40566,40583,40598,40615,40631,
+40647,40664,40680,40694,40710,40725,40740,40754,
+40767,40779,40791,40798,40802,40809,40819,40828,
+40839,40849,40860,40870,40881,40891,40901,40912,
+40923,40934,40946,40958,40970,40982,40994,41005,
+41017,41029,41041,41053,41065,41074,41083,41092,
+41098,41102,41106,41110,41116,41119,41125,41130,
+41134,41139,41143,41149,41154,41161,41167,41175,
+41182,41193,41203,41212,41224,41237,41253,41269,
+41292,41314,41340,41367,41388,41402,41424,41460,
+41502,41549,41598,41644,41686,41708,41737,41773,
+41814,41857,41899,41940,41977,42001,42039,42088,
+42141,42195,42244,42282,42304,42326,42349,42375,
+42400,42424,42446,42467,42486,42505,42523,42540,
+42553,42566,42577,42587,42598,42607,42619,42632,
+42645,42657,42673,42686,42701,42714,42729,42744,
+42756,42768,42781,42792,42802,42813,42822,42831,
+42838,42846,42855,42862,42868,42872,42876,42882,
+42885,42889,42892,42895,42897,42899,42901,42904,
+42906,42908,42909,42909,42911,42912,42914,42914,
+42915,42915,42915,42913,42913,42910,42909,42907,
+42906,42904,42901,42900,42898,42895,42893,42892,
+42889,42886,42883,42880,42877,42872,42867,42861,
+42858,42852,42846,42841,42834,42826,42820,42811,
+42804,42796,42789,42781,42772,42762,42751,42743,
+42731,42721,42711,42702,42691,42682,42672,42663,
+42654,42645,42636,42628,42619,42611,42600,42589,
+42576,42562,42549,42537,42527,42516,42504,42492,
+42480,42468,42456,42444,42429,42416,42403,42390,
+42376,42363,42350,42339,42330,42321,42314,42309,
+42304,42300,42298,42298,42297,42295,42292,42289,
+42286,42280,42276,42268,42259,42252,42241,42231,
+42219,42208,42195,42181,42168,42156,42144,42129,
+42117,42105,42093,42082,42072,42063,42053,42043,
+42037,42027,42019,42012,42005,41997,41989,41975,
+41960,41942,41924,41905,41887,41866,41844,41824,
+41803,41781,41759,41739,41721,41705,41697,41688,
+41677,41665,41652,41637,41625,41610,41598,41583,
+41570,41556,41541,41526,41511,41499,41488,41478,
+41470,41464,41458,41452,41451,41448,41445,41443,
+41441,41440,41437,41434,41429,41421,41411,41397,
+41384,41361,41331,41298,41263,41223,41182,41145,
+41118,41097,41075,41051,41014,40963,40917,40873,
+40844,40808,40762,40723,40681,40645,40620,40605,
+40590,40571,40545,40500,40440,40365,40282,40218,
+40185,40167,40171,40204,40254,40279,40268,40279,
+40320,40412,40544,40676,40774,40817,40842,40865,
+40886,40905,40912,40906,40887,40858,40827,40806,
+41309,41248,40975,40073,39175,38241,38109,37953,
+38431,39794,40005,40610,41012,40899,40906,41187,
+41101,41045,40837,37783,37588,37417,37930,39141,
+38904,38733,37663,37250,37070,36986,37224,37023,
+34792,33933,33701,33285,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,33020,33130,33285,
+33468,33662,33850,34008,34134,34198,34035,33930,
+33869,33800,33798,33835,33862,33881,33915,33981,
+34069,34177,34251,34316,34399,34537,34705,34849,
+35001,35148,35262,35324,35350,35355,35362,35371,
+35409,35484,35571,35710,35884,36009,36075,36189,
+36353,36522,36637,36760,36969,37196,37351,37536,
+37709,37832,37956,38064,38130,38186,38282,38389,
+38535,38924,39000,38972,38982,39053,39124,39195,
+39285,39420,39578,39660,39675,39693,39699,39693,
+39671,39651,39638,39630,39622,39615,39618,39627,
+39630,39625,39612,39594,39579,39558,39540,39537,
+39542,39546,39544,39538,39528,39513,39483,39413,
+39280,39096,38962,38886,38886,38997,39217,39477,
+39653,39727,39751,39782,39843,39952,40069,40106,
+40044,39855,39490,39103,38805,38373,38102,37813,
+37657,37468,37165,37000,36900,36845,36859,36987,
+37167,37179,37070,36951,36877,36845,36829,36818,
+36804,36789,36774,36761,36753,36747,36748,36751,
+36760,36770,36786,36803,36823,36845,36866,36887,
+36908,36930,36955,36987,37019,37050,37074,37087,
+37098,37115,37140,37174,37210,37266,37338,37398,
+37425,37419,37390,37354,37315,37275,37239,37208,
+37182,37224,37310,37433,37528,37617,37692,37748,
+37777,37807,37825,37845,37868,37890,37911,37933,
+37958,37982,38002,38021,38035,38047,38061,38074,
+38087,38101,38118,38133,38148,38167,38187,38210,
+38233,38256,38276,38294,38316,38338,38363,38389,
+38418,38466,38526,38591,38654,38696,38733,38783,
+38838,38890,38937,38974,39003,39042,39088,39133,
+39172,39213,39248,39277,39296,39311,39326,39344,
+39360,39375,39393,39412,39438,39470,39507,39543,
+39579,39607,39654,39710,39769,39826,39873,39906,
+39942,39979,40017,40053,40092,40126,40157,40183,
+40200,40215,40236,40260,40285,40312,40341,40369,
+40397,40423,40446,40466,40483,40496,40505,40516,
+40531,40549,40567,40586,40605,40622,40639,40657,
+40672,40689,40704,40718,40731,40744,40756,40769,
+40782,40790,40798,40803,40810,40818,40828,40836,
+40847,40855,40865,40874,40884,40893,40902,40914,
+40925,40935,40947,40957,40969,40978,40990,40999,
+41008,41018,41028,41035,41043,41051,41058,41065,
+41071,41076,41081,41085,41089,41094,41095,41098,
+41101,41106,41115,41127,41140,41155,41173,41194,
+41218,41247,41277,41310,41346,41377,41397,41422,
+41458,41500,41547,41593,41640,41681,41712,41749,
+41788,41824,41863,41910,41959,42002,42044,42093,
+42147,42211,42271,42307,42342,42376,42411,42445,
+42479,42511,42541,42568,42591,42606,42631,42666,
+42701,42735,42766,42793,42818,42841,42862,42877,
+42891,42900,42911,42924,42936,42946,42958,42970,
+42981,42991,43000,43008,43015,43024,43030,43038,
+43045,43051,43057,43066,43072,43079,43087,43096,
+43104,43111,43120,43128,43137,43149,43159,43168,
+43177,43185,43191,43194,43195,43198,43201,43202,
+43203,43203,43204,43203,43202,43201,43200,43200,
+43198,43197,43195,43193,43188,43185,43179,43171,
+43160,43148,43134,43119,43107,43096,43084,43074,
+43065,43056,43047,43038,43029,43021,43009,43000,
+42991,42981,42970,42961,42951,42940,42930,42921,
+42913,42904,42897,42891,42883,42872,42863,42852,
+42842,42829,42815,42799,42782,42764,42747,42729,
+42712,42696,42678,42663,42648,42633,42618,42602,
+42592,42583,42571,42558,42543,42527,42507,42489,
+42470,42450,42431,42411,42392,42374,42357,42342,
+42327,42316,42306,42301,42297,42294,42291,42283,
+42276,42265,42251,42236,42218,42203,42183,42165,
+42146,42126,42105,42085,42066,42048,42030,42015,
+42003,41996,41988,41976,41964,41950,41939,41928,
+41915,41903,41889,41874,41856,41840,41821,41802,
+41784,41765,41744,41723,41706,41694,41671,41651,
+41628,41601,41578,41559,41544,41534,41524,41515,
+41506,41499,41490,41481,41471,41463,41451,41441,
+41430,41417,41405,41398,41388,41373,41358,41340,
+41326,41311,41299,41286,41273,41262,41253,41242,
+41232,41223,41212,41199,41186,41169,41151,41132,
+41112,41094,41068,41044,41015,40981,40938,40888,
+40838,40800,40749,40668,40583,40508,40414,40261,
+40157,40069,39996,39913,39818,39739,39681,39633,
+39628,39827,41519,41444,40694,40346,39564,39198,
+38774,38732,38806,38944,39321,39614,39563,39663,
+39751,39916,40208,40350,40491,40579,40686,40766,
+41016,41316,41388,41387,41367,41352,41335,41325,
+39396,39222,40217,40019,39679,38556,35591,34843,
+37373,38262,37823,37483,37424,37593,36690,35844,
+35046,35436,34986,35522,34624,34311,33813,33257,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,33000,33000,33000,33001,33002,33008,33017,
+33030,33060,33103,33162,33234,33312,33389,33459,
+33519,33565,33589,33595,33597,33598,33597,33603,
+33634,33693,33771,33849,33922,33986,34036,34079,
+34116,34146,34177,34224,34373,34521,34635,34732,
+34788,34805,34899,35009,35112,35206,35286,35353,
+35397,35445,35533,35631,35727,35821,35907,35973,
+36002,36006,36012,36029,36077,36124,36158,36201,
+36293,36495,36672,36797,36876,36952,37026,37106,
+37235,37428,37638,37771,37846,37891,38043,38322,
+39247,39213,39175,39882,39941,40284,39232,39293,
+39466,39479,39321,39123,39003,38908,38841,38829,
+38918,38993,39099,39582,39606,39598,39596,39596,
+39672,39780,39875,39948,39982,39949,39895,39843,
+39751,39550,39124,38734,38819,38963,39066,39099,
+39205,39415,39622,39678,39665,39639,39600,39526,
+39427,39324,39234,39152,39042,38853,38602,38267,
+37923,37641,37370,37267,37302,37283,37243,37218,
+37182,37136,37080,37011,36936,36856,36777,36703,
+36645,36608,36579,36535,36490,36454,36425,36402,
+36379,36360,36345,36330,36312,36294,36280,36267,
+36266,36280,36296,36318,36347,36363,36354,36353,
+36419,36451,36477,36504,36789,36531,36200,36111,
+36125,36003,35843,35930,36265,36555,36622,36694,
+36718,36758,36793,36817,36834,36861,36897,36954,
+37018,37080,37148,37200,37238,37281,37322,37354,
+37383,37402,37421,37435,37448,37458,37468,37479,
+37495,37515,37546,37579,37611,37645,37683,37724,
+37782,37858,37970,38081,38143,38196,38232,38258,
+38279,38295,38314,38338,38357,38384,38427,38495,
+38568,38630,38689,38734,38791,38839,38878,38915,
+38946,38978,39009,39042,39073,39105,39139,39173,
+39203,39229,39252,39280,39310,39339,39374,39415,
+39457,39504,39541,39570,39597,39622,39652,39688,
+39727,39768,39810,39849,39883,39903,39926,39953,
+39981,40013,40043,40071,40095,40115,40134,40152,
+40169,40184,40196,40208,40230,40257,40290,40323,
+40357,40392,40424,40454,40476,40494,40506,40525,
+40545,40566,40585,40602,40618,40633,40645,40660,
+40672,40684,40696,40708,40720,40732,40743,40752,
+40762,40770,40778,40784,40789,40794,40798,40800,
+40803,40809,40815,40821,40827,40834,40843,40850,
+40859,40867,40876,40885,40893,40902,40908,40917,
+40925,40933,40940,40949,40957,40966,40977,40986,
+40996,41005,41017,41026,41038,41052,41068,41087,
+41101,41132,41173,41217,41264,41313,41361,41395,
+41423,41460,41508,41559,41614,41662,41694,41719,
+41757,41803,41856,41913,41968,42003,42050,42108,
+42175,42244,42294,42325,42370,42421,42475,42530,
+42577,42604,42643,42696,42753,42816,42873,42900,
+42921,42945,42967,42988,43006,43022,43038,43050,
+43060,43073,43083,43093,43102,43111,43119,43127,
+43135,43144,43152,43159,43167,43176,43183,43191,
+43198,43202,43209,43220,43229,43240,43251,43264,
+43275,43287,43298,43309,43320,43331,43341,43351,
+43360,43368,43377,43386,43395,43401,43409,43413,
+43419,43422,43423,43425,43428,43429,43429,43431,
+43429,43429,43429,43427,43425,43424,43419,43416,
+43410,43404,43394,43386,43374,43362,43347,43331,
+43315,43298,43281,43265,43246,43230,43213,43195,
+43181,43164,43143,43128,43116,43105,43092,43078,
+43065,43053,43042,43030,43021,43009,42997,42985,
+42972,42960,42948,42935,42922,42911,42900,42891,
+42873,42853,42835,42817,42799,42781,42765,42747,
+42730,42712,42698,42681,42667,42654,42640,42626,
+42611,42597,42582,42558,42534,42513,42490,42468,
+42448,42428,42408,42387,42365,42345,42327,42309,
+42294,42276,42256,42234,42211,42186,42161,42135,
+42108,42081,42057,42035,42015,42001,41991,41975,
+41952,41928,41904,41880,41856,41836,41815,41794,
+41776,41759,41742,41727,41709,41692,41678,41660,
+41636,41612,41583,41553,41521,41488,41454,41426,
+41403,41391,41382,41370,41363,41354,41346,41336,
+41324,41312,41298,41282,41265,41246,41224,41202,
+41178,41155,41133,41117,41100,41091,41079,41070,
+41059,41050,41042,41035,41028,41019,41010,40999,
+40988,40974,40959,40941,40922,40899,40874,40849,
+40827,40807,40798,40785,40769,40744,40696,40626,
+40550,40503,40481,40462,40447,40443,40440,40436,
+40434,40425,40408,40374,40339,40702,39789,38910,
+38139,38017,37892,37817,37856,37841,37786,37623,
+37466,37322,37050,36501,36850,39507,39713,40446,
+39760,40076,38864,39140,40891,42379,39557,38241,
+37954,37780,38449,36162,36593,37812,37480,38144,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+33000,33018,33038,33060,33081,33103,33125,33147,
+33171,33193,33215,33237,33260,33285,33308,33333,
+33358,33387,33414,33445,33480,33519,33559,33583,
+33591,33594,33595,33595,33600,33636,33698,33778,
+33867,33954,34038,34111,34171,34199,34209,34222,
+34237,34255,34281,34320,34376,34477,34716,34787,
+34743,34749,34779,34814,34855,34941,35054,35178,
+35286,35362,35397,35406,35423,35461,35517,35583,
+35643,35695,35738,35776,35809,35843,35880,35919,
+35961,35993,36001,36018,36053,36099,36160,36230,
+36303,36399,36528,36614,36693,36793,36918,37101,
+37255,37373,37470,37563,37712,37830,37965,38090,
+38164,38245,38316,38366,38409,38482,38592,38688,
+38754,38831,38891,38937,38966,38987,38997,39003,
+39004,38999,38990,38966,38943,38927,38895,38895,
+38900,38910,38952,39046,39240,39395,39516,39602,
+39613,39621,39616,39608,39485,39119,38997,38971,
+38971,38978,38988,39004,39031,39023,38884,38670,
+38448,38021,37693,37670,37733,37698,37578,37510,
+37482,37437,37381,37327,37273,37218,37163,37074,
+36975,36871,36772,36687,36615,36547,36467,36379,
+36294,36213,36127,36036,35983,35937,35865,35757,
+35609,35452,35370,35343,35314,35241,35105,34934,
+34815,34743,34698,34724,34740,34607,34635,34416,
+34089,34118,34348,34549,34688,34806,34954,35175,
+35337,35398,35455,35566,35725,35940,36101,36231,
+36339,36426,36495,36570,36648,36757,36867,36930,
+36992,37050,37099,37132,37149,37142,37120,37090,
+37056,37023,36998,36987,36998,37041,37110,37187,
+37293,37433,37514,37588,37675,37756,37823,37893,
+37960,38016,38065,38091,38109,38124,38140,38158,
+38183,38212,38247,38287,38332,38376,38409,38460,
+38524,38589,38652,38694,38721,38757,38796,38829,
+38861,38888,38913,38934,38958,38980,39002,39031,
+39079,39160,39249,39306,39349,39400,39447,39484,
+39516,39542,39564,39584,39598,39621,39657,39697,
+39743,39790,39833,39865,39890,39909,39933,39960,
+39986,40010,40035,40057,40077,40100,40119,40137,
+40155,40172,40186,40197,40211,40232,40257,40284,
+40313,40341,40368,40396,40422,40447,40472,40490,
+40506,40525,40545,40563,40577,40593,40606,40620,
+40632,40645,40656,40666,40678,40687,40699,40710,
+40717,40728,40737,40745,40752,40760,40767,40774,
+40780,40786,40791,40795,40798,40801,40806,40812,
+40819,40827,40835,40845,40854,40866,40877,40891,
+40906,40924,40941,40961,40981,41004,41028,41053,
+41079,41097,41122,41158,41200,41250,41306,41358,
+41396,41428,41485,41548,41610,41669,41706,41742,
+41784,41826,41874,41929,41985,42029,42096,42187,
+42276,42322,42372,42421,42475,42530,42578,42607,
+42654,42714,42779,42842,42888,42909,42936,42961,
+42985,43009,43030,43051,43071,43087,43102,43116,
+43131,43143,43155,43167,43179,43186,43195,43203,
+43213,43227,43241,43256,43272,43287,43303,43319,
+43335,43350,43367,43381,43398,43413,43427,43445,
+43464,43482,43492,43506,43522,43534,43546,43557,
+43569,43578,43587,43596,43601,43608,43612,43618,
+43627,43636,43647,43659,43666,43674,43680,43686,
+43689,43692,43696,43699,43701,43701,43698,43695,
+43689,43684,43679,43671,43663,43654,43644,43633,
+43622,43609,43598,43587,43576,43566,43554,43542,
+43528,43517,43504,43491,43474,43443,43407,43365,
+43320,43282,43248,43219,43200,43185,43167,43148,
+43128,43108,43091,43079,43069,43059,43050,43039,
+43026,43011,42993,42973,42951,42927,42905,42886,
+42866,42841,42818,42795,42771,42745,42717,42690,
+42666,42643,42625,42610,42600,42588,42569,42545,
+42519,42493,42467,42441,42416,42391,42369,42348,
+42330,42312,42300,42288,42266,42237,42207,42177,
+42146,42115,42087,42059,42033,42012,41995,41970,
+41934,41898,41860,41823,41789,41757,41727,41704,
+41695,41683,41671,41656,41640,41623,41606,41587,
+41569,41550,41528,41508,41484,41460,41438,41416,
+41397,41368,41337,41304,41268,41229,41194,41162,
+41139,41118,41101,41089,41077,41061,41043,41025,
+41006,40984,40963,40942,40923,40905,40888,40871,
+40851,40833,40816,40801,40792,40776,40756,40732,
+40702,40670,40632,40590,40545,40500,40462,40419,
+40371,40317,40266,40220,40191,40163,40142,40120,
+40101,40084,40074,40072,40082,40115,40155,40103,
+40257,40469,39574,39091,39038,38977,38862,38734,
+38940,39276,39626,40780,42017,42423,43260,40482,
+39500,38388,38647,36518,35503,35407,35191,34695,
+36767,39739,38740,37126,36467,38266,38842,39111,
+37149,35853,35445,35214,34920,34633,33710,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,33004,33009,33018,
+33032,33051,33072,33099,33127,33157,33192,33228,
+33270,33315,33362,33412,33466,33521,33570,33595,
+33600,33609,33615,33619,33620,33615,33604,33595,
+33647,33678,33696,33702,33707,33723,33750,33786,
+33824,33856,33880,33924,34069,34195,34197,34191,
+34186,34196,34198,34197,34197,34200,34206,34231,
+34255,34276,34305,34344,34401,34479,34577,34720,
+34788,34814,34881,34964,35046,35130,35217,35290,
+35344,35386,35418,35463,35512,35557,35609,35663,
+35712,35773,35841,35904,35955,36000,36099,36198,
+36276,36346,36454,36570,36634,36709,36789,36861,
+36922,37024,37138,37228,37356,37480,37547,37602,
+37650,37695,37742,37797,37870,37984,38091,38163,
+38245,38317,38373,38439,38542,38622,38667,38689,
+38699,38739,38827,38908,38961,38988,38998,38998,
+39001,39000,38994,38979,38957,38933,38907,38884,
+38863,38846,38834,38827,38822,38811,38787,38742,
+38694,38616,38500,38368,38154,38009,37932,37876,
+37838,37804,37755,37658,37555,37488,37418,37345,
+37285,37230,37183,37107,37043,36989,36947,36910,
+36870,36822,36755,36672,36600,36528,36448,36387,
+36345,36313,36281,36237,36189,36145,36099,36054,
+36012,35979,35936,35875,35808,35743,35702,35657,
+35578,35489,35371,35049,34665,34461,34178,34011,
+33914,33792,33677,33642,33638,33647,33695,33793,
+33990,34613,34821,34797,34957,35313,35777,36122,
+37007,37381,37558,37485,37344,37196,37151,37057,
+36903,36734,36612,36554,36499,36459,36432,36415,
+36404,36397,36393,36393,36402,36420,36451,36486,
+36545,36719,36945,37127,37233,37340,37419,37463,
+37484,37508,37545,37597,37663,37729,37788,37837,
+37884,37926,37965,37999,38032,38058,38079,38096,
+38112,38136,38163,38196,38230,38263,38297,38329,
+38357,38380,38398,38421,38447,38483,38526,38574,
+38623,38668,38700,38735,38793,38858,38922,38971,
+39006,39053,39108,39157,39203,39246,39279,39303,
+39326,39357,39393,39427,39460,39494,39525,39551,
+39585,39621,39666,39715,39769,39824,39882,39914,
+39947,39979,40007,40033,40057,40080,40103,40127,
+40148,40170,40190,40203,40223,40250,40279,40307,
+40335,40361,40385,40407,40428,40450,40474,40491,
+40503,40514,40527,40539,40553,40566,40581,40595,
+40608,40623,40638,40650,40662,40674,40684,40696,
+40706,40715,40724,40732,40740,40749,40757,40765,
+40774,40781,40789,40797,40806,40821,40841,40863,
+40890,40918,40949,40983,41016,41050,41079,41100,
+41118,41141,41163,41187,41213,41244,41281,41328,
+41376,41411,41477,41557,41634,41692,41725,41758,
+41787,41817,41853,41889,41934,41982,42017,42078,
+42153,42237,42306,42384,42488,42587,42649,42735,
+42823,42889,42919,42957,42992,43023,43047,43071,
+43092,43112,43131,43149,43164,43180,43194,43201,
+43214,43231,43251,43274,43299,43323,43347,43371,
+43395,43421,43446,43470,43489,43504,43523,43542,
+43564,43588,43612,43637,43662,43686,43709,43726,
+43741,43757,43773,43789,43804,43821,43833,43851,
+43868,43887,43907,43929,43955,43986,44017,44037,
+44053,44066,44076,44088,44091,44091,44091,44092,
+44091,44091,44089,44082,44074,44063,44055,44042,
+44027,44007,43985,43964,43941,43922,43903,43887,
+43873,43862,43849,43838,43824,43812,43799,43782,
+43767,43753,43738,43723,43706,43690,43669,43648,
+43628,43603,43577,43550,43521,43500,43475,43440,
+43399,43357,43315,43275,43239,43207,43185,43165,
+43146,43128,43111,43092,43073,43051,43028,43005,
+42982,42956,42933,42910,42895,42875,42844,42807,
+42764,42720,42675,42634,42603,42589,42570,42548,
+42526,42504,42482,42460,42436,42411,42385,42360,
+42338,42316,42300,42291,42274,42252,42226,42198,
+42168,42135,42101,42067,42033,42004,41986,41953,
+41915,41874,41830,41787,41748,41716,41697,41682,
+41661,41640,41619,41598,41577,41554,41531,41506,
+41481,41455,41432,41409,41397,41382,41361,41337,
+41312,41282,41244,41200,41155,41114,41088,41065,
+41043,41020,40993,40967,40943,40923,40909,40897,
+40885,40875,40862,40843,40816,40794,40764,40729,
+40693,40665,40640,40623,40608,40596,40587,40576,
+40563,40546,40523,40498,40452,40388,40308,40242,
+40200,40168,40116,40046,39965,39890,39841,39805,
+39783,39765,39738,39706,39689,39662,39722,39858,
+40088,40221,40479,40666,40170,39502,38682,38083,
+37871,37785,37656,37639,37764,38051,37152,39533,
+41377,40793,35461,35594,34626,34599,34569,35151,
+33984,34619,33060,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,33000,33007,33016,33029,33045,33066,33088,
+33115,33148,33187,33229,33274,33321,33371,33420,
+33472,33522,33573,33618,33666,33717,33774,33854,
+34035,34210,34284,34316,34323,34314,34305,34290,
+34276,34267,34257,34251,34245,34238,34217,34180,
+34161,34190,34187,34163,34153,34187,34204,34206,
+34208,34201,34243,34287,34323,34359,34402,34443,
+34484,34524,34594,34673,34739,34785,34803,34825,
+34854,34885,34923,34983,35076,35225,35370,35484,
+35564,35616,35656,35693,35772,35886,35982,36098,
+36252,36361,36516,36623,36760,36875,36926,36989,
+37046,37097,37141,37177,37217,37308,37395,37472,
+37547,37650,37755,37849,37963,38047,38112,38206,
+38318,38408,38550,38677,38766,38868,38955,39018,
+39075,39114,39137,39133,39109,39075,39036,39004,
+38990,38968,38943,38916,38886,38858,38826,38793,
+38764,38739,38716,38698,38678,38635,38580,38518,
+38448,38380,38262,38140,38079,38014,37947,37876,
+37797,37659,37514,37440,37347,37239,37071,36884,
+36782,36722,36684,36649,36615,36591,36532,36435,
+36329,36258,36150,36043,35946,35780,35658,35573,
+35505,35440,35363,35265,35185,35127,35090,35058,
+35042,35027,35013,34977,34930,34866,34782,34714,
+34649,34591,34542,34500,34455,34399,34354,34331,
+34254,33971,33314,32997,32997,32997,32997,32997,
+32997,32997,33482,34566,35400,35476,35516,35696,
+35841,36221,36593,36787,36867,37052,37231,37227,
+37212,37446,38231,36774,36159,35858,35699,35697,
+35727,35739,35736,35728,35722,35724,35733,35748,
+35771,35817,35888,36015,36229,36495,36876,37184,
+37345,37443,37488,37500,37500,37497,37512,37545,
+37588,37635,37689,37735,37769,37802,37829,37858,
+37886,37913,37938,37959,37982,37999,38015,38028,
+38040,38047,38049,38058,38067,38079,38088,38098,
+38114,38138,38172,38209,38253,38303,38353,38391,
+38419,38463,38514,38566,38624,38685,38728,38803,
+38883,38947,38991,39021,39056,39100,39147,39189,
+39229,39261,39288,39319,39357,39396,39435,39475,
+39516,39550,39584,39615,39661,39709,39759,39807,
+39853,39899,39930,39969,40011,40047,40081,40119,
+40162,40195,40221,40251,40280,40311,40338,40367,
+40393,40419,40443,40468,40488,40501,40514,40525,
+40537,40548,40560,40571,40583,40594,40606,40617,
+40629,40641,40653,40665,40680,40695,40711,40727,
+40744,40762,40779,40794,40803,40819,40843,40870,
+40900,40933,40969,41008,41049,41084,41103,41127,
+41157,41194,41234,41277,41334,41391,41429,41490,
+41571,41656,41709,41757,41805,41850,41891,41930,
+41964,41988,42015,42051,42102,42158,42213,42292,
+42336,42393,42463,42543,42600,42663,42749,42843,
+42909,42955,42995,43034,43069,43098,43125,43146,
+43165,43181,43195,43203,43222,43247,43275,43306,
+43340,43375,43410,43445,43476,43497,43515,43543,
+43573,43605,43637,43670,43704,43736,43762,43785,
+43804,43827,43859,43891,43923,43952,43982,44007,
+44034,44060,44088,44111,44140,44176,44220,44263,
+44306,44346,44373,44395,44410,44421,44427,44427,
+44426,44424,44420,44416,44412,44409,44406,44401,
+44397,44391,44381,44368,44355,44340,44328,44317,
+44304,44292,44280,44267,44250,44231,44208,44181,
+44156,44128,44108,44088,44066,44043,44017,43990,
+43959,43929,43895,43863,43833,43809,43796,43783,
+43767,43746,43722,43697,43669,43641,43611,43579,
+43547,43517,43496,43470,43434,43390,43342,43293,
+43248,43210,43191,43168,43143,43119,43094,43066,
+43039,43011,42982,42955,42930,42909,42894,42875,
+42846,42813,42777,42739,42702,42666,42635,42610,
+42596,42578,42553,42524,42489,42451,42414,42376,
+42339,42308,42282,42253,42219,42190,42166,42144,
+42125,42105,42087,42069,42051,42031,42011,41991,
+41957,41904,41844,41787,41737,41702,41686,41669,
+41650,41630,41610,41592,41570,41550,41528,41505,
+41483,41459,41435,41411,41393,41364,41328,41294,
+41259,41226,41193,41160,41127,41098,41065,41014,
+40956,40896,40842,40801,40770,40722,40671,40619,
+40568,40522,40491,40459,40431,40406,40384,40369,
+40357,40350,40341,40332,40319,40302,40283,40263,
+40241,40218,40203,40195,40182,40160,40125,40074,
+40000,39913,39816,39633,39480,39340,39222,39085,
+38973,39617,40324,38681,38063,38243,38373,38463,
+38589,39620,40278,39789,38730,38664,37739,37878,
+37678,38422,42676,41856,41014,39621,36306,33429,
+33329,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,33001,33018,33046,33090,33147,
+33214,33286,33358,33423,33481,33526,33557,33577,
+33590,33608,33632,33652,33672,33696,33733,33801,
+33879,33983,34146,34242,34307,34337,34360,34392,
+34444,34514,34540,34554,34573,34587,34599,34614,
+34624,34626,34625,34626,34635,34658,34695,34746,
+34799,34796,34823,34926,35051,35112,35155,35187,
+35219,35259,35299,35342,35385,35407,35451,35514,
+35578,35630,35674,35703,35751,35809,35868,35927,
+35988,36070,36201,36312,36438,36567,36646,36741,
+36830,36894,36948,37024,37099,37171,37253,37406,
+37538,37708,37821,37915,37992,38050,38115,38214,
+38313,38435,38655,38867,39037,39179,39382,39611,
+39562,39478,39388,39313,39275,39213,39139,39064,
+39012,38987,38957,38924,38893,38861,38829,38799,
+38767,38731,38697,38661,38595,38506,38416,38338,
+38242,38158,38101,38059,38002,37946,37880,37794,
+37658,37510,37386,37236,37140,37063,36975,36905,
+36853,36769,36656,36553,36456,36364,36291,36236,
+36171,36099,36001,35832,35671,35510,35403,35286,
+35172,35090,34980,34881,34803,34711,34599,34517,
+34485,34462,34425,34372,34307,34239,34192,34144,
+34076,34009,33957,33911,33861,33774,33669,33496,
+33124,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,33720,34467,
+34747,34824,34916,35013,35316,35698,35925,36163,
+36459,36569,36634,36845,36921,36977,36558,35440,
+34598,34479,34483,34470,34407,34329,34274,34239,
+34234,34284,34472,34689,34848,35113,35440,36106,
+36681,36820,36846,36966,37167,37248,37296,37331,
+37359,37386,37413,37444,37470,37491,37510,37534,
+37570,37610,37656,37704,37746,37782,37806,37831,
+37857,37886,37909,37931,37949,37964,37977,37988,
+37998,38007,38018,38030,38046,38060,38079,38106,
+38146,38196,38258,38333,38394,38464,38538,38601,
+38670,38713,38760,38808,38857,38899,38939,38968,
+38988,39002,39022,39049,39078,39106,39141,39172,
+39201,39226,39256,39292,39318,39352,39392,39438,
+39483,39523,39565,39603,39643,39694,39747,39801,
+39852,39894,39936,39989,40046,40102,40158,40200,
+40230,40260,40291,40320,40349,40374,40398,40420,
+40443,40465,40483,40499,40513,40527,40540,40553,
+40566,40579,40593,40605,40621,40635,40653,40671,
+40691,40710,40731,40751,40774,40791,40803,40814,
+40830,40851,40880,40917,40955,40993,41031,41068,
+41103,41151,41209,41262,41316,41368,41421,41503,
+41583,41654,41704,41757,41802,41848,41895,41940,
+41983,42015,42055,42106,42165,42228,42296,42331,
+42436,42504,42568,42610,42675,42759,42845,42901,
+42945,42994,43039,43084,43123,43155,43182,43199,
+43218,43246,43280,43315,43356,43397,43440,43479,
+43502,43531,43570,43617,43667,43718,43764,43795,
+43820,43851,43885,43921,43957,43992,44025,44056,
+44083,44100,44119,44146,44176,44210,44247,44285,
+44321,44358,44388,44401,44416,44436,44458,44481,
+44504,44526,44547,44566,44584,44598,44608,44617,
+44622,44622,44622,44622,44622,44623,44623,44622,
+44617,44611,44601,44591,44577,44561,44542,44521,
+44498,44475,44453,44431,44412,44397,44382,44360,
+44332,44305,44274,44245,44216,44187,44157,44127,
+44104,44090,44069,44040,44004,43967,43927,43893,
+43858,43828,43806,43791,43774,43755,43734,43712,
+43688,43662,43637,43608,43578,43545,43515,43491,
+43459,43419,43371,43318,43266,43216,43188,43159,
+43126,43089,43047,43000,42957,42919,42897,42879,
+42858,42838,42820,42802,42788,42772,42756,42741,
+42724,42708,42692,42675,42651,42619,42582,42517,
+42442,42354,42246,42061,41982,41954,41944,41934,
+41919,41913,41907,41899,41887,41868,41843,41813,
+41780,41745,41715,41697,41679,41659,41638,41616,
+41592,41565,41539,41511,41484,41460,41438,41417,
+41400,41376,41341,41299,41245,41183,41119,41085,
+41043,40997,40952,40908,40867,40834,40809,40793,
+40768,40728,40683,40635,40587,40546,40513,40494,
+40467,40432,40393,40356,40324,40294,40266,40240,
+40216,40200,40185,40163,40139,40116,40098,40086,
+40075,40063,40050,40028,39993,39945,39894,39811,
+39699,39585,39459,39366,39342,39531,38669,38329,
+38142,37998,37866,37472,37086,36802,36985,38697,
+38704,39030,40217,38998,39415,37009,34716,33998,
+34080,34787,36366,38028,33435,33081,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,33026,33123,33246,
+33351,33422,33465,33502,33540,33578,33616,33637,
+33621,33601,33598,33629,33667,33674,33677,33687,
+33714,33759,33820,33883,33921,33976,34033,34086,
+34135,34184,34297,34524,34614,34660,34701,34740,
+34779,34795,34797,34800,34800,34809,34835,34897,
+34992,35105,35177,35243,35298,35341,35370,35373,
+35368,35367,35368,35385,35413,35484,35562,35627,
+35676,35697,35706,35712,35718,35722,35725,35733,
+35751,35787,35857,36011,36328,36516,36600,36691,
+36792,36876,36945,37066,37186,37275,37405,37514,
+37635,37758,37846,37941,38025,38106,38199,38310,
+38400,38553,38739,38973,39105,39244,39352,39524,
+39613,39649,39652,39634,39607,39573,39504,39429,
+39368,39322,39284,39210,39119,39037,38994,38965,
+38933,38898,38864,38838,38808,38749,38643,38436,
+38337,38264,38202,38136,38089,38040,37974,37878,
+37671,37433,37327,37263,37206,37147,37071,36955,
+36811,36627,36372,36180,36030,35922,35802,35702,
+35608,35453,35304,35102,34917,34794,34703,34593,
+34477,34327,34242,34245,34254,34255,34252,34254,
+34255,34254,34237,34192,34098,33999,33905,33839,
+33782,33708,33578,33115,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,33072,33300,33610,33858,33975,
+33988,34004,34035,34082,34096,34097,34014,33934,
+33879,33789,33664,33045,32997,32997,32997,32997,
+32997,33200,33561,33978,34821,35596,35843,35994,
+36116,36254,36370,36522,36672,36852,36970,37053,
+37107,37140,37162,37176,37185,37194,37200,37217,
+37249,37290,37335,37374,37409,37432,37445,37448,
+37454,37467,37488,37509,37553,37611,37682,37747,
+37785,37806,37842,37883,37924,37965,38011,38059,
+38097,38134,38184,38238,38287,38331,38386,38457,
+38547,38646,38714,38772,38823,38866,38901,38928,
+38952,38972,38988,38997,39004,39013,39024,39036,
+39048,39061,39075,39087,39103,39121,39143,39165,
+39196,39235,39275,39309,39351,39399,39459,39522,
+39582,39614,39661,39715,39771,39829,39885,39925,
+39999,40086,40158,40200,40230,40263,40294,40323,
+40350,40376,40398,40420,40443,40464,40482,40497,
+40505,40521,40534,40549,40566,40581,40596,40611,
+40626,40640,40654,40666,40680,40697,40713,40731,
+40751,40772,40793,40825,40870,40920,40983,41042,
+41101,41166,41238,41296,41346,41397,41466,41553,
+41631,41683,41718,41767,41818,41868,41920,41966,
+42003,42051,42118,42193,42287,42358,42438,42510,
+42573,42615,42682,42766,42852,42906,42961,43024,
+43087,43155,43197,43226,43252,43281,43308,43339,
+43374,43414,43458,43492,43517,43554,43602,43656,
+43711,43761,43796,43825,43863,43905,43950,43992,
+44031,44067,44091,44102,44119,44139,44160,44185,
+44211,44239,44269,44302,44334,44366,44392,44412,
+44436,44459,44483,44507,44530,44555,44580,44607,
+44635,44660,44681,44695,44705,44718,44736,44753,
+44772,44790,44808,44826,44842,44858,44870,44877,
+44877,44874,44865,44851,44835,44818,44799,44778,
+44755,44731,44709,44688,44656,44615,44571,44526,
+44484,44451,44421,44399,44381,44346,44308,44269,
+44232,44196,44157,44123,44098,44085,44065,44042,
+44018,43995,43972,43947,43923,43898,43872,43844,
+43819,43800,43783,43760,43733,43703,43671,43635,
+43596,43555,43517,43491,43462,43426,43383,43338,
+43294,43253,43224,43209,43185,43127,43069,43014,
+42964,42927,42903,42888,42867,42843,42822,42795,
+42765,42728,42688,42643,42599,42538,42434,42336,
+42278,42213,42159,42112,42073,42044,42023,42009,
+41997,41986,41976,41959,41940,41922,41898,41871,
+41843,41810,41775,41739,41709,41688,41655,41611,
+41563,41520,41478,41435,41400,41379,41353,41328,
+41298,41268,41239,41210,41178,41145,41111,41064,
+41015,40965,40908,40855,40804,40767,40719,40668,
+40608,40547,40497,40458,40414,40375,40338,40303,
+40269,40235,40209,40191,40173,40155,40129,40104,
+40075,40046,40012,39972,39930,39899,39864,39803,
+39734,39665,39609,39570,39534,39538,39578,39612,
+39595,39569,39555,39537,39528,39461,38986,38943,
+38511,38212,38028,37992,37964,38277,37052,35886,
+38433,35260,34866,34206,33345,32997,32999,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,33001,33532,34038,
+34245,34412,34494,34553,34635,34732,34799,34816,
+34827,34820,34806,34764,34692,34612,34537,34446,
+34306,34216,34182,34171,34171,34188,34209,34254,
+34310,34379,34449,34497,34531,34578,34638,34703,
+34765,34803,34834,34861,34890,34925,34964,35008,
+35050,35088,35122,35170,35218,35268,35311,35352,
+35394,35443,35529,35621,35691,35727,35761,35791,
+35817,35838,35859,35883,35913,35946,35977,36024,
+36142,36294,36454,36587,36672,36768,36865,36960,
+37098,37197,37269,37352,37453,37536,37668,37821,
+37967,38097,38276,38412,38494,38576,38659,38735,
+38867,38985,39076,39195,39291,39357,39439,39516,
+39579,39606,39611,39610,39609,39609,39603,39594,
+39569,39526,39474,39417,39366,39327,39289,39235,
+39170,39105,39043,38992,38925,38816,38710,38638,
+38541,38448,38388,38314,38215,38091,37903,37746,
+37608,37493,37326,37158,37016,36909,36856,36770,
+36621,36396,36192,36028,35842,35670,35564,35436,
+35288,35065,34875,34768,34644,34511,34272,33988,
+33822,33773,33767,33784,33814,33843,33877,33933,
+34054,34168,34203,34165,34044,33923,33849,33756,
+33652,33536,33389,33211,33062,33000,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,33341,33862,34206,34452,34807,
+34980,35140,35310,35504,35713,35904,36013,36054,
+36057,36095,36117,36149,36207,36259,36297,36377,
+36523,36683,36873,36999,37154,37412,37554,37515,
+37437,37237,37109,36972,36903,36890,36903,36925,
+36981,37083,37191,37320,37464,37541,37639,37743,
+37809,37893,37988,38055,38096,38133,38186,38256,
+38337,38409,38487,38583,38661,38706,38748,38790,
+38826,38859,38884,38907,38930,38946,38962,38976,
+38988,38997,39001,39007,39013,39024,39039,39060,
+39084,39106,39130,39156,39186,39226,39268,39327,
+39437,39546,39621,39681,39730,39771,39814,39861,
+39907,39974,40050,40122,40177,40222,40270,40317,
+40352,40384,40410,40434,40455,40472,40489,40500,
+40517,40539,40561,40584,40611,40641,40671,40702,
+40732,40757,40776,40797,40827,40878,40933,40990,
+41043,41083,41118,41166,41232,41307,41380,41467,
+41598,41698,41758,41811,41854,41892,41926,41955,
+41974,41990,42003,42031,42070,42120,42180,42244,
+42319,42401,42486,42568,42636,42708,42769,42814,
+42860,42909,42993,43089,43178,43242,43297,43338,
+43372,43404,43428,43449,43472,43493,43515,43555,
+43604,43659,43711,43755,43796,43823,43858,43896,
+43932,43965,43994,44021,44047,44073,44094,44103,
+44117,44134,44153,44171,44191,44212,44233,44253,
+44276,44298,44319,44340,44359,44379,44394,44408,
+44440,44475,44510,44547,44581,44616,44653,44688,
+44712,44738,44763,44791,44818,44846,44871,44895,
+44919,44940,44961,44979,44996,45003,45016,45027,
+45036,45045,45049,45051,45050,45048,45042,45033,
+45019,44998,44973,44941,44904,44861,44819,44778,
+44740,44706,44676,44628,44583,44541,44499,44463,
+44427,44395,44367,44338,44304,44265,44223,44178,
+44133,44098,44078,44055,44033,44010,43989,43968,
+43948,43930,43912,43893,43873,43851,43823,43796,
+43769,43729,43688,43644,43596,43549,43506,43474,
+43423,43359,43288,43221,43185,43154,43122,43091,
+43060,43027,42990,42954,42920,42897,42872,42838,
+42801,42764,42726,42682,42638,42601,42567,42519,
+42470,42427,42388,42356,42327,42306,42289,42259,
+42223,42187,42150,42112,42075,42036,42003,41980,
+41943,41898,41848,41797,41745,41702,41653,41577,
+41490,41416,41373,41325,41280,41232,41185,41142,
+41112,41096,41089,41085,41077,41061,41040,41011,
+40972,40932,40886,40841,40799,40756,40697,40637,
+40573,40518,40459,40361,40249,40185,40143,40109,
+40076,40045,40012,39978,39942,39908,39877,39823,
+39759,39687,39626,39589,39562,39517,39453,39357,
+39265,39150,39038,38958,38829,38655,38496,38396,
+38353,38384,38449,38536,38639,38772,38895,38988,
+39282,39538,39361,39057,38697,37639,35910,36720,
+38787,35647,36736,36522,34473,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,33036,33158,
+33336,33530,33832,34023,34066,34025,33954,33929,
+33912,33889,33873,33875,33901,33945,33977,33970,
+33910,33855,33787,33748,33744,33755,33791,33840,
+33886,33915,33941,33966,33992,34020,34047,34074,
+34102,34135,34173,34210,34294,34395,34485,34557,
+34673,34783,34867,34962,35016,35056,35093,35136,
+35208,35301,35383,35434,35505,35579,35648,35700,
+35751,35821,35898,35965,36017,36104,36202,36285,
+36345,36419,36485,36546,36598,36673,36769,36849,
+36885,36906,36937,37001,37084,37167,37232,37317,
+37397,37473,37530,37631,37742,37822,37949,38062,
+38142,38262,38367,38431,38529,38625,38694,38735,
+38773,38832,38909,38958,38988,39033,39082,39136,
+39189,39244,39293,39348,39429,39528,39612,39762,
+39895,39928,39890,39766,39627,39545,39462,39399,
+39352,39319,39294,39243,39133,39005,38925,38815,
+38718,38634,38517,38428,38379,38310,38221,38107,
+37919,37708,37513,37182,36982,36847,36660,36486,
+36282,36159,36070,35988,35859,35703,35472,35317,
+35167,35020,34791,34501,34283,34126,33932,33808,
+33739,33717,33714,33717,33709,33672,33629,33637,
+33732,33841,33878,33880,33840,33706,33547,33332,
+33122,33007,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,33023,33245,33507,
+33680,33798,33927,34107,34377,34557,34743,34855,
+34893,34907,34911,34911,34916,34903,34885,34861,
+34842,34824,34832,34933,35094,35261,35429,35608,
+35758,35924,36021,36084,36147,36226,36297,36349,
+36411,36485,36556,36620,36721,36846,36957,37086,
+37203,37342,37467,37574,37696,37797,37865,37932,
+37990,38041,38088,38136,38227,38319,38388,38436,
+38505,38580,38648,38690,38715,38749,38784,38822,
+38857,38895,38933,38969,39000,39034,39079,39124,
+39167,39211,39253,39289,39348,39425,39507,39576,
+39614,39657,39703,39748,39803,39858,39906,39998,
+40110,40192,40240,40302,40357,40402,40434,40458,
+40481,40499,40518,40540,40562,40584,40606,40629,
+40655,40683,40716,40752,40779,40804,40846,40905,
+40971,41034,41083,41121,41184,41249,41311,41368,
+41404,41459,41541,41630,41691,41739,41806,41877,
+41942,41990,42023,42064,42110,42156,42198,42243,
+42277,42312,42377,42459,42537,42595,42641,42697,
+42753,42810,42864,42908,42957,43015,43073,43126,
+43175,43216,43274,43332,43384,43431,43473,43503,
+43536,43574,43610,43644,43679,43714,43748,43776,
+43803,43837,43878,43917,43953,43983,44013,44040,
+44061,44077,44093,44101,44115,44130,44145,44160,
+44178,44194,44209,44225,44241,44257,44274,44291,
+44308,44329,44348,44367,44386,44400,44420,44452,
+44490,44529,44569,44611,44652,44684,44700,44719,
+44742,44765,44787,44811,44834,44853,44871,44886,
+44900,44914,44928,44940,44954,44969,44983,44995,
+45004,45018,45036,45052,45067,45081,45092,45099,
+45103,45102,45098,45089,45078,45063,45048,45030,
+45012,44997,44970,44931,44890,44848,44810,44769,
+44730,44697,44664,44623,44572,44518,44466,44421,
+44392,44358,44313,44266,44222,44182,44146,44117,
+44094,44073,44054,44032,44013,43990,43968,43944,
+43917,43887,43851,43818,43788,43734,43665,43585,
+43515,43479,43432,43384,43341,43306,43279,43257,
+43238,43222,43216,43211,43197,43107,43011,42928,
+42874,42834,42795,42765,42736,42705,42671,42639,
+42609,42594,42573,42543,42516,42486,42450,42411,
+42370,42329,42297,42264,42213,42158,42102,42048,
+42000,41959,41911,41871,41838,41806,41763,41707,
+41631,41534,41463,41416,41376,41295,41181,41097,
+41047,41012,40975,40947,40926,40916,40901,40878,
+40851,40824,40801,40782,40741,40683,40615,40548,
+40496,40451,40392,40329,40273,40227,40196,40153,
+40102,40052,40011,39973,39937,39897,39808,39712,
+39634,39593,39556,39519,39480,39433,39371,39292,
+39154,38994,38849,38717,38601,38454,38253,37962,
+37756,37543,37287,37149,37082,37001,36982,37191,
+38198,38320,38492,38854,38910,36153,35379,34530,
+34101,34129,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,33007,33057,33133,33224,
+33319,33414,33498,33567,33639,33711,33776,33828,
+33862,33882,33894,33922,33963,34004,34047,34095,
+34147,34188,34218,34252,34310,34393,34488,34631,
+34783,34923,35099,35208,35310,35382,35424,35487,
+35556,35630,35695,35750,35816,35875,35934,35987,
+36051,36153,36258,36329,36439,36531,36595,36655,
+36738,36818,36880,36907,36940,36975,37020,37076,
+37146,37248,37426,37534,37540,37509,37494,37500,
+37534,37586,37656,37733,37809,37924,38043,38115,
+38219,38316,38383,38413,38457,38506,38562,38620,
+38671,38709,38796,38911,38994,39042,39103,39162,
+39219,39267,39301,39351,39424,39523,39609,39720,
+39835,39909,39961,40006,40035,40023,39929,39810,
+39716,39652,39593,39443,39264,39137,39052,39006,
+38979,38926,38857,38743,38599,38411,38253,38115,
+38056,37960,37787,37461,37239,37114,36976,36882,
+36801,36735,36684,36639,36522,36266,36066,35640,
+35459,35313,35054,34703,34509,34404,34222,33832,
+33401,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,33006,33136,33335,33531,33624,
+33645,33604,33438,33172,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+33000,33095,33186,33216,33275,33419,33613,33921,
+34425,34746,34959,35296,36114,36252,36272,36246,
+36480,37053,36618,36581,36484,36429,36540,36419,
+36459,36534,36501,36655,36792,36915,36997,37077,
+37185,37364,37543,37681,37768,37823,37875,37924,
+37964,37990,38007,38028,38061,38097,38154,38228,
+38298,38369,38440,38529,38619,38689,38730,38779,
+38838,38898,38967,39019,39103,39195,39280,39351,
+39427,39500,39570,39615,39663,39706,39748,39788,
+39825,39871,39917,40011,40125,40201,40269,40342,
+40404,40451,40484,40501,40525,40556,40586,40613,
+40640,40669,40698,40731,40762,40788,40822,40875,
+40938,41001,41063,41113,41178,41249,41312,41374,
+41421,41478,41532,41584,41635,41677,41703,41734,
+41776,41821,41866,41913,41959,41996,42039,42092,
+42149,42205,42259,42310,42383,42465,42541,42598,
+42646,42706,42773,42834,42882,42910,42949,42999,
+43054,43107,43172,43211,43244,43279,43318,43359,
+43401,43441,43479,43513,43542,43575,43608,43645,
+43687,43734,43783,43816,43868,43929,43984,44027,
+44059,44084,44097,44107,44116,44124,44134,44143,
+44152,44163,44172,44184,44195,44208,44221,44236,
+44250,44266,44281,44300,44316,44334,44352,44367,
+44382,44394,44400,44411,44427,44447,44472,44500,
+44532,44568,44605,44641,44671,44692,44702,44713,
+44727,44739,44750,44760,44772,44783,44791,44800,
+44810,44819,44829,44844,44859,44876,44895,44916,
+44937,44958,44979,44994,45003,45018,45033,45051,
+45066,45082,45093,45102,45108,45109,45106,45099,
+45087,45071,45051,45029,45006,44984,44946,44901,
+44856,44808,44757,44707,44668,44622,44568,44509,
+44458,44412,44377,44335,44292,44260,44234,44211,
+44187,44166,44145,44124,44106,44094,44079,44056,
+44026,43992,43953,43914,43867,43819,43769,43678,
+43579,43506,43474,43434,43401,43368,43340,43313,
+43287,43260,43233,43206,43185,43153,43113,43068,
+43021,42976,42933,42896,42866,42829,42799,42770,
+42744,42712,42684,42659,42639,42626,42616,42606,
+42571,42504,42433,42357,42300,42252,42183,42104,
+42030,41988,41946,41898,41846,41795,41748,41712,
+41688,41656,41631,41611,41595,41575,41550,41519,
+41479,41430,41382,41289,41182,41105,41052,40985,
+40919,40855,40809,40779,40738,40685,40628,40575,
+40527,40493,40452,40392,40336,40279,40217,40149,
+40033,39936,39889,39859,39831,39802,39774,39745,
+39710,39673,39633,39580,39459,39328,39228,39138,
+39067,38989,38859,38727,38562,38310,38005,37533,
+37030,36672,36449,36158,35890,35621,35463,35292,
+35121,35743,37043,38222,37531,36227,35269,34402,
+33983,33156,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,33006,33026,33065,33126,
+33207,33305,33413,33526,33608,33659,33714,33762,
+33802,33835,33877,33934,34045,34157,34344,34545,
+34670,34776,34822,34839,34848,34861,34881,34898,
+34926,34974,35053,35235,35415,35526,35619,35698,
+35830,35977,36069,36179,36265,36332,36426,36522,
+36594,36660,36733,36781,36830,36885,36916,36964,
+37014,37074,37145,37202,37263,37332,37392,37431,
+37458,37487,37504,37540,37587,37622,37650,37684,
+37728,37782,37850,37974,38074,38109,38152,38211,
+38281,38352,38396,38445,38514,38583,38653,38706,
+38769,38845,38923,38989,39031,39093,39156,39213,
+39258,39295,39311,39329,39353,39372,39392,39408,
+39424,39444,39479,39515,39564,39597,39630,39681,
+39708,39714,39704,39686,39657,39609,39499,39330,
+39232,39129,39024,38928,38777,38579,38367,38173,
+38040,37817,37481,37235,37143,37069,37031,37053,
+37107,37096,36884,36900,35835,35836,35790,35646,
+35502,35130,34779,34470,34213,33803,33523,33022,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,33568,33434,33358,
+33570,33912,34086,34147,34155,34200,34268,34328,
+34348,34375,34421,34430,34370,34196,33872,33351,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,33021,33355,33870,33945,34350,34763,
+35259,35419,35554,35448,35484,35390,35642,35741,
+35865,35694,35592,35547,35569,35809,35992,36120,
+36291,36535,36840,37119,37401,37482,37512,37542,
+37598,37659,37720,37780,37884,38024,38110,38193,
+38279,38364,38451,38608,38715,38805,38922,39020,
+39131,39238,39331,39424,39514,39585,39636,39690,
+39736,39775,39810,39838,39864,39887,39912,39968,
+40042,40124,40193,40249,40323,40398,40461,40497,
+40528,40569,40601,40626,40650,40677,40714,40761,
+40811,40894,40986,41063,41116,41164,41225,41291,
+41360,41405,41475,41563,41637,41688,41721,41750,
+41775,41802,41831,41859,41890,41923,41955,41983,
+42004,42041,42092,42150,42204,42251,42291,42318,
+42366,42434,42503,42575,42639,42711,42780,42861,
+42912,42949,42981,43014,43045,43080,43116,43155,
+43190,43222,43276,43339,43401,43449,43492,43507,
+43523,43559,43596,43615,43629,43645,43657,43674,
+43696,43736,43798,43889,44013,44095,44136,44163,
+44181,44194,44202,44207,44210,44211,44211,44211,
+44208,44206,44203,44203,44203,44205,44211,44220,
+44229,44244,44259,44276,44292,44308,44325,44342,
+44361,44377,44392,44400,44405,44404,44401,44397,
+44394,44390,44389,44393,44399,44406,44415,44429,
+44444,44466,44493,44517,44537,44553,44568,44581,
+44589,44593,44599,44607,44616,44631,44648,44668,
+44690,44721,44763,44805,44848,44890,44930,44967,
+44994,45009,45030,45052,45071,45088,45102,45109,
+45106,45096,45077,45053,45021,44996,44958,44904,
+44853,44811,44776,44746,44718,44693,44640,44566,
+44494,44430,44395,44373,44353,44331,44310,44287,
+44266,44247,44229,44208,44188,44164,44137,44111,
+44093,44067,44028,43971,43905,43833,43786,43740,
+43677,43608,43541,43495,43468,43438,43402,43359,
+43318,43280,43248,43222,43203,43188,43155,43114,
+43069,43023,42977,42933,42900,42876,42837,42793,
+42748,42706,42664,42627,42600,42584,42553,42513,
+42465,42414,42361,42314,42286,42237,42180,42117,
+42054,42002,41968,41929,41880,41823,41770,41725,
+41697,41687,41676,41665,41656,41647,41637,41623,
+41608,41587,41561,41526,41481,41418,41328,41188,
+41089,40977,40881,40812,40773,40703,40628,40560,
+40507,40476,40410,40332,40254,40178,40072,39958,
+39885,39843,39814,39802,39798,39796,39790,39783,
+39769,39748,39715,39667,39601,39465,39300,39121,
+38979,38889,38834,38768,38685,38593,38466,38328,
+38103,37902,37774,37644,37530,37832,38478,38094,
+38272,38799,39325,38766,35104,33138,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32998,33111,33289,33470,
+33575,33595,33356,33022,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,33117,33271,
+33364,33428,33475,33511,33515,33566,33769,33891,
+33930,33961,33990,34029,34088,34151,34197,34227,
+34264,34312,34370,34431,34489,34560,34666,34781,
+34941,35086,35186,35333,35480,35651,35785,35979,
+36125,36254,36337,36458,36561,36678,36798,36877,
+36919,36972,37023,37068,37111,37153,37188,37215,
+37267,37324,37380,37432,37473,37497,37527,37569,
+37620,37674,37731,37780,37807,37864,37947,38037,
+38102,38142,38181,38211,38229,38241,38257,38289,
+38335,38393,38466,38559,38652,38706,38745,38784,
+38823,38864,38910,38950,38986,39012,39048,39088,
+39133,39176,39215,39246,39268,39284,39289,39273,
+39235,39189,39135,39078,39021,38999,38998,39056,
+39147,39229,39290,39343,39393,39430,39450,39453,
+39446,39425,39358,39169,38859,38502,38107,37758,
+37627,37647,37717,37836,37911,38031,38211,37968,
+35802,35232,35501,34883,34689,34835,34072,33969,
+34229,34421,34516,34571,34526,34278,33861,33051,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,33173,34018,34198,34515,34701,34802,
+34896,35010,35091,35118,35103,35030,34857,34573,
+34296,33588,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32998,33572,33820,33885,
+33945,33998,34025,34044,34072,34188,34263,34323,
+34356,34410,34508,34698,34857,35046,35216,35416,
+35620,35850,36153,36410,36657,36822,36930,37129,
+37238,37335,37434,37549,37710,37920,38154,38283,
+38376,38463,38644,38794,38967,39072,39199,39293,
+39367,39480,39582,39625,39672,39719,39762,39802,
+39837,39867,39891,39905,39925,39954,39993,40041,
+40095,40159,40224,40315,40405,40482,40540,40607,
+40670,40727,40771,40818,40899,41008,41099,41161,
+41226,41277,41314,41343,41372,41401,41460,41555,
+41652,41715,41780,41836,41883,41923,41959,41984,
+42000,42020,42057,42102,42158,42219,42276,42304,
+42338,42366,42392,42418,42446,42480,42516,42550,
+42582,42607,42667,42745,42846,42913,42961,43002,
+43034,43061,43086,43103,43114,43137,43166,43200,
+43251,43328,43414,43496,43549,43584,43610,43632,
+43651,43671,43686,43700,43710,43719,43728,43740,
+43763,43788,43824,43897,43987,44064,44100,44122,
+44131,44136,44137,44139,44142,44146,44148,44145,
+44137,44128,44118,44104,44100,44098,44094,44085,
+44070,44052,44031,44013,44002,43990,43974,43965,
+43960,43942,43923,43920,43915,43914,43914,43919,
+43938,43968,43996,44029,44072,44104,44136,44155,
+44175,44189,44202,44220,44243,44267,44290,44311,
+44333,44355,44376,44394,44408,44418,44426,44434,
+44446,44457,44469,44482,44499,44521,44547,44575,
+44604,44633,44661,44679,44691,44705,44721,44739,
+44757,44757,44754,44733,44712,44685,44653,44625,
+44604,44585,44571,44560,44550,44535,44514,44489,
+44464,44442,44422,44409,44400,44391,44378,44362,
+44346,44325,44307,44287,44265,44243,44220,44195,
+44171,44148,44127,44104,44076,44020,43962,43910,
+43864,43821,43770,43687,43604,43536,43495,43447,
+43385,43333,43290,43250,43217,43199,43181,43155,
+43122,43086,43050,43014,42976,42939,42904,42867,
+42816,42762,42714,42667,42623,42591,42558,42526,
+42484,42444,42405,42366,42321,42287,42241,42190,
+42126,42060,42004,41965,41919,41867,41821,41781,
+41754,41734,41721,41708,41698,41679,41651,41619,
+41583,41543,41499,41454,41410,41377,41304,41196,
+41097,40996,40861,40776,40703,40649,40621,40599,
+40567,40531,40494,40434,40350,40263,40199,40136,
+40039,39963,39921,39903,39897,39891,39881,39864,
+39840,39808,39771,39726,39678,39624,39588,39548,
+39487,39399,39291,39195,39092,39028,38994,38936,
+38820,38654,38601,38739,38967,38679,38408,38433,
+37364,36943,35997,35896,36263,35738,36174,33381,
+33002,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+33036,33475,33848,34230,34224,33898,33505,33135,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+33020,33656,33904,34086,34360,34572,34656,34707,
+34747,34795,34874,34974,35045,35080,35089,35052,
+34953,34861,34791,34733,34655,34581,34536,34522,
+34521,34530,34545,34583,34641,34735,34866,35083,
+35253,35411,35640,35779,35913,36018,36167,36298,
+36408,36517,36600,36691,36804,36897,37021,37145,
+37215,37257,37300,37346,37401,37456,37494,37513,
+37529,37549,37565,37581,37599,37624,37656,37693,
+37738,37785,37832,37892,37959,38028,38088,38119,
+38160,38200,38240,38277,38311,38338,38361,38392,
+38433,38490,38538,38575,38613,38643,38670,38688,
+38697,38702,38712,38724,38740,38762,38788,38820,
+38857,38905,38951,38989,39021,39047,39070,39085,
+39074,39039,39006,38968,38921,38879,38853,38836,
+38822,38818,38830,38863,38907,38956,38991,39030,
+39082,39124,39132,39104,39039,38944,38757,38577,
+38495,38454,38784,38460,37011,36375,35703,35385,
+35289,34553,33703,33966,34776,32997,32997,33150,
+33284,33174,33143,33149,33143,33057,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,33360,33886,33994,33800,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,33483,34194,34631,34758,34819,
+34918,35018,35076,35095,35076,34908,34287,33594,
+33481,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,33012,33192,
+33331,33414,33471,33525,33738,34417,34669,34802,
+34970,35134,35265,35413,35496,35541,35615,35668,
+35696,35754,35769,35760,35743,35739,35750,35814,
+35854,35986,36136,36366,36681,36884,37023,37150,
+37216,37290,37372,37473,37552,37738,38047,38251,
+38347,38419,38544,38703,38898,39060,39203,39305,
+39420,39533,39617,39675,39720,39759,39792,39823,
+39853,39880,39902,39937,39982,40036,40092,40143,
+40183,40213,40279,40363,40446,40516,40608,40704,
+40791,40863,40951,41040,41100,41157,41217,41274,
+41326,41366,41394,41418,41469,41539,41623,41722,
+41817,41906,41977,42012,42051,42090,42129,42165,
+42200,42237,42272,42300,42343,42411,42480,42538,
+42576,42600,42618,42639,42669,42705,42750,42803,
+42858,42899,42928,42967,43009,43053,43093,43128,
+43156,43179,43194,43212,43247,43300,43368,43440,
+43496,43545,43590,43632,43668,43695,43717,43734,
+43749,43766,43781,43793,43802,43811,43821,43833,
+43853,43872,43896,43917,43940,43959,43974,43984,
+43990,43992,43992,43984,43980,43974,43969,43968,
+43968,43967,43962,43954,43944,43929,43909,43882,
+43849,43813,43785,43737,43676,43620,43578,43536,
+43505,43477,43455,43434,43424,43420,43427,43446,
+43466,43488,43507,43525,43565,43620,43672,43729,
+43779,43810,43845,43881,43914,43948,43977,44007,
+44031,44048,44067,44085,44096,44104,44113,44115,
+44125,44137,44150,44169,44196,44222,44242,44250,
+44259,44268,44271,44270,44272,44272,44274,44277,
+44283,44277,44265,44254,44243,44241,44250,44248,
+44242,44236,44233,44239,44245,44257,44275,44298,
+44323,44343,44356,44362,44364,44361,44359,44354,
+44347,44337,44322,44307,44289,44271,44253,44232,
+44211,44190,44166,44141,44114,44097,44063,44010,
+43950,43887,43829,43787,43716,43632,43555,43503,
+43466,43409,43350,43299,43255,43219,43197,43181,
+43163,43143,43120,43093,43062,43028,42994,42961,
+42925,42895,42856,42801,42734,42670,42615,42585,
+42548,42510,42476,42443,42405,42366,42315,42266,
+42186,42096,42018,41985,41948,41907,41870,41838,
+41810,41785,41765,41747,41725,41704,41688,41650,
+41601,41550,41495,41443,41402,41373,41311,41233,
+41154,41074,40947,40846,40797,40758,40713,40671,
+40630,40593,40555,40518,40480,40393,40287,40206,
+40164,40116,40083,40065,40050,40035,40018,39998,
+39975,39960,39949,39943,39936,39921,39902,39885,
+39861,39829,39801,39777,39738,39666,39413,39215,
+39267,39386,39489,39590,39608,39591,39438,39184,
+37779,38620,37507,38540,38913,39120,39590,37653,
+35376,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,33004,33299,33721,33856,33997,34147,34255,
+34342,34453,34527,34563,34684,34815,34875,34899,
+34950,35016,35086,35145,35192,35221,35236,35235,
+35229,35226,35223,35203,35169,35141,35127,35122,
+35141,35154,35202,35274,35378,35495,35652,35865,
+36105,36227,36333,36441,36573,36669,36770,36864,
+36927,36970,36990,37024,37098,37193,37328,37461,
+37514,37548,37578,37605,37625,37639,37648,37656,
+37660,37665,37671,37678,37689,37702,37728,37764,
+37801,37858,37914,37974,38025,38063,38094,38121,
+38152,38176,38193,38202,38190,38153,38112,38064,
+37998,37953,37947,37966,38012,38077,38111,38117,
+38131,38148,38163,38185,38217,38253,38297,38346,
+38396,38430,38463,38486,38507,38518,38521,38525,
+38530,38533,38536,38541,38550,38560,38569,38571,
+38568,38559,38548,38535,38532,38536,38550,38571,
+38598,38637,38679,38715,38773,38809,38857,39458,
+39672,39596,39594,39984,36449,37191,39339,36905,
+34631,33023,32997,32997,32997,32997,33417,33791,
+33816,33786,33664,33125,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,33042,33546,33981,33807,
+33016,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,33009,33833,34110,34248,34335,
+34405,34452,34443,34168,33804,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,33189,
+33768,33921,34155,34389,34594,34623,34618,34535,
+34400,34154,33981,33950,33960,33978,34014,34041,
+34090,34368,34521,34671,34953,35330,35646,35990,
+36215,36444,36675,36758,36834,36911,36978,37056,
+37131,37202,37264,37309,37346,37373,37399,37424,
+37465,37504,37572,37695,37824,37956,38085,38227,
+38387,38478,38581,38680,38790,38964,39082,39213,
+39337,39478,39586,39674,39734,39774,39807,39842,
+39878,39907,39960,40031,40106,40170,40206,40266,
+40331,40396,40455,40497,40546,40626,40717,40791,
+40862,40948,41029,41095,41158,41227,41292,41348,
+41391,41431,41488,41548,41605,41674,41757,41878,
+41982,42049,42123,42189,42240,42282,42304,42333,
+42372,42415,42466,42533,42589,42632,42671,42707,
+42740,42770,42798,42825,42852,42882,42907,42950,
+42999,43051,43108,43160,43197,43220,43248,43278,
+43304,43333,43363,43399,43442,43494,43536,43582,
+43629,43673,43715,43753,43785,43802,43816,43833,
+43849,43867,43884,43900,43913,43923,43932,43938,
+43941,43939,43936,43929,43920,43909,43894,43878,
+43857,43836,43815,43799,43783,43770,43765,43769,
+43778,43788,43797,43804,43812,43821,43821,43808,
+43782,43715,43629,43548,43488,43408,43311,43232,
+43191,43161,43138,43119,43104,43091,43084,43086,
+43094,43112,43138,43170,43198,43228,43270,43312,
+43347,43387,43426,43456,43470,43474,43476,43476,
+43469,43458,43444,43438,43435,43437,43443,43449,
+43453,43458,43458,43461,43459,43458,43461,43464,
+43470,43477,43488,43495,43510,43538,43579,43637,
+43689,43738,43772,43794,43809,43826,43841,43854,
+43868,43890,43917,43947,43978,44008,44035,44063,
+44094,44140,44182,44217,44242,44259,44272,44280,
+44283,44283,44281,44278,44270,44260,44248,44234,
+44218,44199,44180,44158,44130,44099,44061,44011,
+43955,43898,43845,43804,43767,43704,43638,43579,
+43525,43489,43444,43397,43345,43299,43265,43241,
+43224,43209,43196,43173,43150,43122,43094,43068,
+43041,43013,42978,42931,42879,42785,42684,42597,
+42555,42517,42484,42450,42414,42376,42330,42289,
+42225,42123,42024,41967,41931,41908,41884,41868,
+41850,41829,41812,41796,41780,41760,41735,41708,
+41689,41649,41591,41531,41462,41397,41337,41244,
+41146,41088,41028,40962,40901,40848,40809,40785,
+40755,40718,40681,40641,40590,40537,40494,40450,
+40401,40346,40301,40271,40249,40232,40218,40209,
+40203,40200,40196,40191,40186,40176,40168,40150,
+40113,40062,40005,39948,39902,39885,39859,39817,
+39710,39439,39190,39132,38902,38616,38384,38192,
+37959,37776,37546,37047,36803,36598,36336,36366,
+37587,38994,35652,33324,33900,34422,33252,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+31464,31518,31593,31578,31514,31391,31248,31210,
+31225,31221,31197,31278,31399,31424,31473,31626,
+31624,31546,31252,32337,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,33133,34026,34399,34688,34865,
+35217,35349,35427,35574,35706,35780,35802,35835,
+35841,35833,35844,35832,35761,35681,35631,35706,
+35910,36008,36027,36012,35907,35827,35861,35964,
+36067,36198,36319,36468,36602,36692,36775,36853,
+36913,36988,37074,37149,37198,37267,37359,37436,
+37488,37554,37681,37776,37825,37827,37814,37809,
+37797,37788,37774,37775,37781,37791,37803,37819,
+37833,37842,37852,37863,37883,37908,37938,37973,
+38011,38049,38079,38097,38103,38109,38103,38090,
+38049,37981,37900,37821,37772,37708,37653,37608,
+37579,37566,37550,37535,37534,37542,37556,37574,
+37596,37632,37681,37729,37787,37829,37855,37875,
+37887,37898,37900,37890,37904,37941,37984,38020,
+38061,38087,38103,38107,38115,38122,38121,38117,
+38115,38097,38088,38085,38076,38061,38048,38048,
+38065,38089,38109,38135,38160,38237,38697,39252,
+40377,40908,40732,42846,38633,36893,34509,34066,
+33242,33270,33627,34592,34865,35157,34996,34699,
+34273,33766,33288,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,33575,33834,33839,
+33801,33758,33749,33699,33615,33536,33363,33103,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+33770,33965,34364,34728,35093,35328,35526,35760,
+35982,36045,35992,35850,35704,35594,35500,35314,
+35152,35027,34937,34836,34750,34743,34829,35086,
+35382,35667,35940,36330,36752,37066,37280,37485,
+37577,37649,37701,37732,37767,37795,37842,37903,
+37983,38064,38110,38169,38245,38323,38415,38513,
+38610,38706,38814,38928,39009,39079,39149,39211,
+39276,39363,39496,39610,39722,39827,39896,39945,
+40020,40103,40175,40223,40296,40374,40436,40481,
+40515,40558,40609,40669,40734,40795,40878,40995,
+41085,41145,41214,41283,41343,41393,41433,41487,
+41538,41590,41640,41689,41763,41892,42015,42107,
+42182,42242,42285,42308,42349,42400,42453,42507,
+42558,42594,42618,42658,42702,42746,42792,42835,
+42873,42898,42913,42933,42962,42998,43044,43101,
+43152,43201,43263,43331,43388,43432,43459,43475,
+43487,43497,43507,43527,43562,43605,43650,43705,
+43766,43804,43840,43883,43921,43954,43980,44001,
+44013,44023,44035,44046,44055,44061,44062,44055,
+44042,44022,44001,43974,43943,43911,43878,43846,
+43818,43800,43785,43763,43744,43728,43717,43710,
+43709,43709,43707,43704,43696,43681,43657,43618,
+43569,43514,43455,43347,43241,43183,43131,43081,
+43036,43000,42973,42947,42920,42894,42868,42847,
+42835,42832,42833,42837,42847,42864,42886,42919,
+42945,42969,42993,43001,43011,43020,43025,43022,
+43017,43002,42996,42993,42990,42987,42987,42987,
+42987,42984,42984,42990,42993,43002,43015,43039,
+43052,43066,43088,43113,43140,43167,43186,43200,
+43233,43290,43343,43386,43425,43459,43497,43539,
+43592,43651,43704,43755,43794,43817,43851,43891,
+43932,43971,44013,44052,44087,44111,44130,44150,
+44171,44190,44202,44211,44215,44217,44214,44208,
+44197,44183,44164,44137,44104,44074,44034,43990,
+43945,43899,43856,43815,43787,43747,43705,43662,
+43620,43583,43550,43518,43488,43431,43368,43309,
+43259,43223,43200,43179,43153,43128,43105,43077,
+43044,43008,42968,42929,42899,42858,42795,42726,
+42665,42619,42592,42553,42510,42467,42423,42384,
+42348,42313,42270,42189,42124,42076,42040,42018,
+42000,41985,41970,41940,41906,41873,41835,41797,
+41760,41717,41652,41578,41505,41438,41393,41323,
+41247,41185,41136,41098,41055,41002,40954,40914,
+40876,40844,40813,40790,40761,40722,40675,40629,
+40591,40561,40538,40516,40493,40467,40435,40405,
+40381,40366,40354,40341,40326,40308,40285,40261,
+40235,40212,40194,40167,40120,40066,40009,39951,
+39901,39847,39752,39620,39426,39286,39213,39093,
+38946,38895,38939,39391,39297,37783,37172,37128,
+37570,37723,36566,36036,38599,38711,35136,33917,
+33285,33003,34510,32998,34044,33003,33000,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32953,32915,32333,32462,31380,30831,31161,
+31219,31212,31202,31189,31188,31247,31314,31396,
+31198,31180,31156,31202,31260,31212,31194,31199,
+31198,31188,31212,31199,31236,31318,31579,31818,
+31761,31669,31503,31262,31189,31093,30573,30564,
+30531,30474,30876,31931,32075,31461,32079,31221,
+31212,31170,31140,31029,31020,31167,31179,31224,
+31797,32265,32403,32388,33492,34239,34761,35062,
+35223,35280,35332,35469,35369,35331,35207,34943,
+34920,34671,34226,33262,32994,33640,33582,33929,
+34493,34641,34898,35134,34912,34175,34695,35252,
+35747,36124,36180,36231,36309,36399,36519,36639,
+36802,36972,37271,37512,37394,37455,37510,37545,
+37583,37623,37660,37712,37784,37890,38031,38142,
+38318,38522,38628,38632,38605,38524,38487,38440,
+38407,38385,38357,38332,38327,38331,38343,38376,
+38420,38467,38487,38465,38403,38335,38257,38205,
+38170,38146,38125,38104,38077,38034,37976,37906,
+37836,37779,37677,37573,37511,37472,37413,37354,
+37294,37242,37208,37192,37177,37166,37160,37156,
+37160,37160,37164,37171,37179,37195,37207,37227,
+37248,37268,37285,37301,37315,37330,37351,37375,
+37421,37482,37539,37604,37651,37675,37683,37692,
+37698,37698,37698,37698,37701,37702,37699,37682,
+37656,37641,37647,37675,37737,37779,37853,37988,
+38139,37908,38497,38929,36465,34542,34140,34133,
+34563,34620,34539,34119,33519,33104,33003,33047,
+33360,33761,33987,34150,34223,34275,34328,34299,
+34214,34108,33984,33905,33802,33430,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,31803,31860,31911,31962,
+32013,32055,32085,32100,32124,32184,32229,32244,
+32250,32253,32274,32304,32334,32583,32310,31707,
+31992,32108,32182,32121,31781,31572,31410,32704,
+32970,31168,32847,31030,30088,29841,29608,29601,
+29693,29758,29848,30455,31128,32141,32280,30147,
+30000,29739,29706,29988,30009,30456,30015,31185,
+31803,32397,32658,33659,34131,34812,35238,35516,
+35831,36139,36498,36727,36787,36787,36787,36777,
+36747,36731,36729,36707,36699,36709,36715,36741,
+36793,36847,36901,36974,37082,37187,37282,37464,
+37663,37838,38005,38112,38195,38258,38308,38353,
+38394,38421,38447,38474,38523,38616,38703,38811,
+38928,39015,39096,39167,39216,39252,39279,39308,
+39369,39431,39518,39599,39733,39889,39979,40074,
+40161,40211,40284,40373,40455,40504,40550,40604,
+40667,40727,40791,40878,41016,41116,41217,41316,
+41385,41438,41493,41552,41605,41647,41685,41710,
+41732,41764,41808,41867,41944,42045,42162,42273,
+42329,42387,42443,42498,42547,42593,42621,42675,
+42739,42809,42872,42903,42927,42949,42963,42973,
+42985,43004,43029,43065,43107,43158,43200,43253,
+43328,43410,43480,43523,43560,43585,43603,43618,
+43631,43647,43668,43696,43729,43770,43811,43858,
+43911,43962,44010,44050,44079,44098,44113,44136,
+44158,44178,44195,44208,44215,44215,44208,44193,
+44174,44147,44114,44089,44040,43980,43926,43874,
+43821,43785,43756,43726,43698,43674,43655,43640,
+43625,43611,43597,43579,43560,43543,43515,43483,
+43411,43320,43234,43185,43123,43053,42981,42914,
+42846,42744,42648,42589,42564,42549,42534,42510,
+42481,42456,42432,42404,42373,42354,42330,42316,
+42310,42310,42309,42305,42300,42297,42293,42293,
+42296,42306,42315,42318,42315,42318,42328,42336,
+42342,42348,42348,42352,42366,42384,42411,42435,
+42462,42486,42512,42538,42576,42627,42707,42777,
+42834,42892,42949,43029,43124,43200,43275,43376,
+43470,43521,43584,43645,43701,43752,43793,43815,
+43848,43885,43926,43965,44001,44037,44066,44089,
+44108,44133,44154,44166,44175,44179,44177,44169,
+44156,44139,44119,44099,44073,44038,43997,43951,
+43905,43858,43816,43785,43755,43724,43694,43663,
+43630,43596,43560,43525,43497,43448,43380,43311,
+43242,43196,43169,43142,43115,43089,43059,43029,
+42996,42965,42932,42898,42870,42828,42780,42726,
+42675,42627,42597,42578,42552,42521,42488,42453,
+42417,42385,42356,42331,42309,42287,42241,42198,
+42160,42122,42088,42055,42024,41998,41953,41889,
+41822,41756,41703,41660,41595,41523,41456,41403,
+41348,41274,41201,41136,41094,41056,41019,40986,
+40951,40916,40880,40846,40815,40796,40776,40748,
+40722,40697,40668,40635,40599,40561,40527,40505,
+40495,40483,40468,40451,40429,40405,40380,40350,
+40317,40281,40239,40200,40171,40134,40092,40051,
+40016,39989,39970,39968,39975,39963,39912,39871,
+39860,39885,39947,40005,40020,32832,31549,31601,
+31679,32449,36291,36011,37434,34799,34108,36106,
+33464,32509,31791,31854,31776,33128,32961,31501,
+31830,31534,30906,30607,30682,31201,32193,30766,
+30870,30871,30885,30912,30954,31044,31146,31197,
+31206,31203,31201,31206,31203,31203,31203,31206,
+31205,31208,31228,31248,31311,31471,31582,31563,
+31502,31452,31419,31414,31443,31531,31706,31799,
+31803,31794,31721,31506,31381,31287,31011,30942,
+30667,30759,30911,31197,31849,31932,32041,31905,
+31677,31209,31194,31158,31146,31197,31284,31677,
+31788,31209,30681,32400,31887,33512,34010,34516,
+34627,34788,35126,34556,34239,31032,30339,29949,
+30672,33951,33255,32970,32982,32970,33749,34171,
+32970,33321,32970,32997,33753,33855,34333,35029,
+35348,35727,35895,36342,36598,36695,37086,37407,
+37515,37505,37522,37647,37797,37974,38121,38247,
+38380,38484,38602,38730,38880,38950,38951,38922,
+38919,38992,39207,39372,39482,39505,39443,39318,
+39126,38884,38506,38421,38472,38664,38831,39029,
+39246,39333,39337,39216,39062,38923,38736,38575,
+38411,38170,38094,38064,37978,37872,37768,37650,
+37552,37465,37351,37242,37186,37098,36996,36927,
+36891,36853,36818,36791,36771,36756,36738,36723,
+36714,36714,36721,36735,36757,36791,36821,36846,
+36870,36887,36901,36918,36948,36988,37038,37089,
+37137,37178,37199,37215,37238,37270,37308,37341,
+37369,37389,37390,37390,37404,37413,37402,37395,
+37382,37365,37364,37389,37431,37456,37432,37336,
+37212,37076,37025,36513,35655,35462,35393,35248,
+35070,35050,35141,34812,34359,34770,35243,35460,
+35502,35593,35666,35559,35374,34761,33807,32999,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,31707,31752,31791,31830,
+31893,31953,32001,32046,32097,32148,32178,32184,
+32151,32678,31944,32055,32134,32166,32235,32319,
+32345,32266,32161,32091,32029,31914,31786,31580,
+31437,31259,31070,30869,30709,30548,30396,30237,
+30078,29992,29870,29787,29813,30019,30657,31242,
+31767,32096,32630,30114,29997,29901,29688,29901,
+30594,31254,31788,31758,31836,32794,33800,33968,
+34107,34590,35009,35570,35978,36462,36713,36843,
+36906,36976,37135,37229,37291,37382,37431,37464,
+37473,37473,37478,37500,37565,37665,37774,37869,
+38013,38140,38220,38306,38384,38418,38439,38460,
+38493,38541,38598,38674,38755,38888,39007,39100,
+39192,39318,39447,39548,39594,39624,39663,39703,
+39743,39783,39826,39861,39896,39968,40080,40180,
+40239,40320,40398,40468,40512,40575,40648,40731,
+40799,40905,41053,41169,41322,41413,41508,41607,
+41686,41724,41758,41783,41805,41823,41835,41851,
+41874,41908,41956,42001,42063,42171,42288,42399,
+42521,42592,42622,42657,42697,42741,42786,42834,
+42882,42918,42957,42990,43022,43044,43066,43089,
+43116,43146,43182,43218,43296,43387,43462,43501,
+43535,43575,43616,43655,43689,43717,43742,43767,
+43786,43803,43832,43880,43940,44004,44058,44092,
+44104,44122,44139,44154,44170,44193,44218,44249,
+44283,44316,44350,44378,44398,44408,44415,44404,
+44361,44281,44194,44117,44067,44002,43942,43888,
+43833,43783,43750,43714,43677,43642,43609,43579,
+43551,43521,43497,43461,43410,43350,43287,43227,
+43186,43127,43059,42986,42912,42807,42623,42519,
+42420,42342,42294,42241,42171,42103,42047,41994,
+41944,41895,41850,41806,41776,41743,41704,41678,
+41652,41634,41616,41598,41582,41568,41560,41561,
+41559,41569,41580,41603,41649,41682,41719,41775,
+41819,41851,41877,41904,41928,41955,41981,42016,
+42058,42106,42151,42190,42237,42288,42341,42414,
+42486,42564,42623,42729,42843,42916,43035,43165,
+43248,43364,43465,43513,43569,43636,43707,43774,
+43809,43851,43897,43943,43989,44032,44073,44100,
+44119,44136,44151,44163,44169,44172,44163,44151,
+44136,44118,44097,44066,44021,43968,43912,43861,
+43816,43793,43768,43742,43715,43689,43660,43627,
+43593,43558,43527,43491,43452,43410,43369,43324,
+43275,43230,43197,43165,43118,43068,43023,42981,
+42942,42906,42870,42837,42804,42768,42732,42693,
+42652,42618,42597,42580,42557,42534,42507,42480,
+42450,42420,42387,42354,42322,42298,42284,42264,
+42238,42211,42178,42144,42108,42071,42033,42000,
+41964,41901,41834,41768,41714,41675,41601,41517,
+41442,41397,41345,41279,41219,41169,41130,41103,
+41076,41046,41009,40971,40934,40896,40860,40833,
+40812,40801,40785,40756,40727,40690,40652,40617,
+40587,40564,40544,40529,40518,40512,40506,40500,
+40497,40496,40497,40498,40498,40473,40401,40326,
+40262,40228,40210,40203,40206,40209,40203,40150,
+40033,39929,39885,39876,32765,32100,31773,31333,
+30670,31254,34885,32618,30856,31218,30975,30675,
+30113,30435,31855,31365,30902,30471,30725,30978,
+31144,31197,31180,31345,31223,31192,31352,31430,
+31308,31320,31278,31028,30618,30709,31236,31263,
+31254,31223,31154,30916,30672,31122,31214,31204,
+31359,31407,31453,31489,31498,31514,31525,31531,
+31534,31527,31513,31490,31473,31473,31488,31554,
+31665,31763,31801,31755,31577,31460,31316,31184,
+31209,31192,31217,31298,31314,31530,31593,31714,
+31968,32037,31857,31784,31453,31324,31811,31959,
+31817,31883,31903,30764,29917,29877,29889,30162,
+31968,32112,31812,31530,31335,30264,30042,30651,
+30927,31341,33008,33042,32997,33150,33420,32991,
+32997,32970,32970,32970,32997,33833,34722,35369,
+35972,36592,36921,37186,37247,37317,37384,37497,
+37666,37810,37921,38062,38207,38337,38465,38802,
+39047,39253,39341,39366,39369,39392,39447,39531,
+39600,39623,39628,39634,39640,39644,39645,39624,
+39565,39384,39351,39498,39900,39582,39654,39759,
+39777,39687,39560,39459,39385,39304,39182,39003,
+38809,38619,38127,37728,42810,37446,37527,37834,
+37722,37460,37190,37067,36967,36889,36793,36674,
+36574,36540,36567,36600,36596,36560,36506,36453,
+36412,36387,36378,36389,36414,36445,36487,36547,
+36598,36619,36637,36653,36669,36671,36670,36657,
+36636,36629,36623,36632,36653,36682,36706,36733,
+36755,36783,36814,36852,36885,36910,36939,36960,
+36984,36997,36997,36972,36885,36777,36651,36561,
+36429,36267,36121,36000,35937,35764,35667,35646,
+35614,35558,35498,35500,35529,35612,35832,36108,
+36231,36144,35571,34736,33594,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,31620,31647,31665,31668,
+31671,31746,31806,32185,31831,31842,31954,32119,
+32118,32102,32101,32106,32103,32104,32103,32103,
+32103,32106,32096,32072,32040,31996,31942,31882,
+31821,31721,31621,31527,31434,31296,31056,30821,
+30624,30492,30386,30281,30215,30130,30033,29991,
+30062,30237,30858,31374,31704,31992,32372,32295,
+32155,32222,31038,30318,30855,31671,31692,31797,
+31899,32157,32517,33264,33779,34278,34764,35188,
+35693,36164,36486,36684,36880,37015,37167,37335,
+37497,37606,37690,37764,37807,37835,37872,37913,
+37955,38004,38046,38076,38120,38205,38310,38404,
+38476,38571,38675,38785,38949,39073,39232,39351,
+39520,39634,39731,39811,39864,39898,39931,39975,
+40021,40076,40131,40185,40233,40292,40352,40408,
+40452,40490,40530,40600,40681,40756,40815,40908,
+41004,41094,41184,41311,41424,41574,41692,41754,
+41823,41884,41937,41985,42014,42046,42078,42108,
+42151,42204,42247,42301,42366,42466,42573,42661,
+42730,42774,42806,42833,42861,42888,42903,42930,
+42966,43008,43050,43089,43124,43154,43179,43195,
+43215,43262,43325,43407,43494,43567,43645,43714,
+43764,43792,43805,43821,43842,43865,43892,43931,
+43977,44030,44078,44108,44128,44146,44164,44180,
+44191,44197,44201,44202,44205,44210,44219,44235,
+44253,44271,44288,44301,44310,44305,44285,44251,
+44204,44143,44099,44068,44025,43974,43926,43878,
+43833,43795,43761,43723,43684,43647,43617,43587,
+43548,43498,43426,43329,43245,43194,43132,43048,
+42952,42887,42811,42711,42608,42486,42330,42243,
+42139,42049,41991,41930,41853,41783,41723,41686,
+41628,41562,41499,41439,41376,41308,41253,41206,
+41148,41100,40998,40914,40812,40773,40759,40752,
+40751,40758,40772,40782,40785,40794,40817,40862,
+40916,40969,41016,41058,41099,41145,41214,41295,
+41368,41463,41556,41672,41779,41935,42022,42113,
+42219,42298,42378,42478,42571,42654,42808,42924,
+43091,43217,43306,43387,43449,43495,43542,43623,
+43718,43794,43845,43900,43953,44002,44046,44081,
+44100,44124,44144,44160,44174,44184,44187,44179,
+44162,44139,44113,44091,44043,43973,43893,43812,
+43764,43734,43700,43671,43645,43619,43591,43562,
+43530,43501,43465,43416,43359,43306,43258,43220,
+43197,43166,43117,43060,43010,42963,42925,42901,
+42880,42848,42820,42793,42766,42738,42713,42686,
+42658,42632,42606,42591,42577,42560,42541,42520,
+42496,42471,42445,42418,42390,42361,42333,42308,
+42288,42270,42261,42259,42259,42255,42246,42211,
+42150,42072,42002,41933,41840,41764,41709,41666,
+41583,41493,41417,41380,41349,41316,41274,41231,
+41195,41156,41119,41089,41058,41013,40965,40915,
+40872,40836,40810,40792,40768,40740,40716,40692,
+40670,40648,40627,40610,40594,40582,40572,40565,
+40559,40554,40546,40534,40509,40450,40314,40209,
+40179,40151,40131,40095,40035,39969,39913,39849,
+39714,39542,39474,36184,32415,31847,31752,31284,
+31239,31274,30830,30643,31260,31000,30765,30519,
+30550,30609,30603,30607,30627,30711,30915,31170,
+31532,31839,31891,31878,31844,31713,31529,31574,
+31728,31771,31803,31803,31881,31512,31201,31191,
+31203,31207,31218,31234,31257,31261,31272,31311,
+31350,31398,31441,31480,31497,31504,31503,31513,
+31507,31500,31453,31375,31260,31198,31311,31473,
+31656,31795,31803,31642,31488,31543,31576,31607,
+31542,31431,31293,29817,29462,30627,29883,29586,
+29794,28572,28239,27144,27498,26353,24900,24650,
+28692,30113,28443,30907,32334,32008,31768,31928,
+32314,32533,32830,32923,31348,30294,32208,32253,
+31836,32301,32418,32775,32970,32995,33140,34165,
+33640,33700,32997,32970,33488,34537,35771,36018,
+35961,36476,36710,36688,36564,36492,36469,36693,
+37140,37619,37902,38154,38346,38461,38527,38926,
+39102,39201,39281,39300,39320,39339,39288,39286,
+39297,39297,39288,39300,39367,39500,39609,39710,
+39834,39989,40094,40162,40106,40122,40094,40032,
+39795,39549,39246,38869,38680,38586,38577,38592,
+38442,38175,38053,37859,37785,37695,37578,37480,
+37328,37203,37024,36825,36642,36598,37231,42512,
+39905,36749,36449,36328,36203,36119,36059,36003,
+36005,36014,35961,35916,35929,35967,36031,36112,
+36168,36207,36240,36253,36213,36120,36011,35919,
+35826,35787,35786,35799,35835,35868,35892,35915,
+35949,35998,36088,36198,36282,36337,36394,36462,
+36545,36608,36654,36687,36708,36714,36711,36692,
+36639,36565,36425,36263,36177,36134,36107,36076,
+36025,35951,35793,35632,35472,35334,35022,34713,
+34332,33862,33069,32997,32997,32997,33084,33425,
+33747,33985,34189,34379,34779,35067,35542,35622,
+35398,35019,34720,34711,34524,33621,33057,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+32997,32997,32997,32997,31548,31569,32844,32577,
+31729,31806,31803,31677,31553,31495,31510,31645,
+31764,31788,31830,31872,31940,32035,32113,32109,
+32103,32106,32100,32088,32070,32045,32016,31984,
+31949,31911,31869,31820,31776,31740,31693,31618,
+31509,31380,31214,31069,30965,30803,30706,30627,
+30570,30546,30524,30533,30570,30579,30878,31252,
+31527,31661,31740,31977,32032,32253,32322,32693,
+31413,31581,31716,31890,32088,32256,32187,32037,
+33060,33354,33885,34272,34731,35268,35608,35904,
+36080,36171,36261,36407,36531,36624,36762,36882,
+36975,37053,37141,37218,37277,37375,37466,37544,
+37704,37947,38306,38678,38881,38967,39094,39315,
+39469,39571,39681,39795,39882,39936,40009,40098,
+40185,40240,40315,40392,40458,40500,40551,40599,
+40639,40683,40744,40805,40949,41086,41169,41247,
+41301,41349,41405,41510,41635,41719,41822,41928,
+42009,42102,42202,42289,42333,42375,42411,42439,
+42471,42510,42546,42582,42613,42667,42736,42800,
+42854,42897,42921,42955,42990,43029,43069,43116,
+43161,43193,43214,43230,43243,43255,43272,43293,
+43320,43350,43395,43467,43563,43718,43836,43875,
+43897,43909,43922,43937,43955,43971,43986,44001,
+44014,44030,44049,44071,44092,44109,44118,44121,
+44128,44125,44118,44111,44108,44101,44097,44092,
+44092,44092,44093,44094,44095,44095,44090,44082,
+44068,44046,44019,43988,43954,43918,43880,43843,
+43810,43788,43749,43707,43665,43625,43590,43554,
+43514,43480,43396,43287,43189,43096,43003,42909,
+42822,42702,42603,42504,42364,42254,42106,42000,
+41922,41829,41746,41698,41650,41562,41446,41320,
+41142,41041,40977,40894,40796,40707,40587,40533,
+40500,40464,40403,40341,40275,40213,40165,40132,
+40136,40135,40152,40170,40197,40265,40321,40366,
+40421,40490,40562,40634,40716,40789,40860,40976,
+41082,41145,41242,41346,41442,41586,41729,41890,
+42037,42171,42278,42348,42444,42559,42654,42786,
+42919,43089,43200,43269,43329,43381,43437,43494,
+43578,43719,43818,43891,43947,43999,44044,44083,
+44109,44135,44157,44175,44190,44202,44206,44200,
+44181,44154,44119,44090,44019,43914,43821,43772,
+43727,43695,43659,43626,43594,43562,43532,43500,
+43461,43389,43308,43237,43194,43123,43038,42968,
+42918,42888,42865,42843,42821,42802,42789,42774,
+42758,42745,42733,42722,42710,42697,42684,42669,
+42654,42639,42623,42611,42601,42597,42589,42579,
+42570,42559,42545,42531,42514,42498,42478,42460,
+42441,42429,42421,42414,42405,42392,42371,42342,
+42297,42201,42084,42003,41956,41890,41834,41778,
+41724,41688,41634,41573,41516,41469,41425,41394,
+41355,41305,41253,41201,41154,41113,41076,41025,
+40964,40911,40868,40834,40810,40798,40785,40767,
+40743,40713,40681,40648,40615,40582,40552,40524,
+40503,40488,40461,40424,40379,40327,40269,40197,
+40080,39975,39915,39873,39751,39591,39473,39358,
+39294,39282,39282,39249,39153,32112,31705,31222,
+30708,30556,30830,31328,31221,31190,31196,31134,
+31263,31200,31116,31042,31026,31044,31081,31120,
+31161,31191,31212,31354,31403,31581,31755,31824,
+31836,31822,31797,31821,31872,31884,31795,31502,
+31318,31272,31230,31206,31201,31227,31259,31300,
+31241,31366,31458,31525,31581,31631,30687,30432,
+30571,29931,29055,28854,29028,28554,29127,30020,
+30430,29574,28893,28847,28228,26406,26610,26665,
+25869,24501,25014,24157,24102,23890,23826,23589,
+23460,22916,22671,22687,22590,22257,22103,22461,
+23083,23028,22600,22155,22545,25278,30602,32360,
+30308,29601,31871,31901,32741,23706,25536,29418,
+26988,29439,29937,32694,31824,30747,32088,32193,
+32040,32286,32403,32688,32769,32763,32766,32984,
+34421,34824,35179,34843,33979,33768,34003,34966,
+35898,36243,36573,36544,36857,36627,36601,36591,
+36590,36639,36552,37116,37188,37237,37487,40809,
+37920,37631,37686,37869,38116,38557,38520,38940,
+38867,38938,38715,38452,38361,38352,38320,38300,
+38340,38320,38258,38190,38153,38109,38058,38022,
+37989,37912,37837,37776,37764,37596,37706,38892,
+40247,36351,36315,36214,36180,36112,36051,36016,
+36081,36018,35787,35442,35236,34979,34770,34658,
+34583,34564,34628,34908,35220,35291,35298,35270,
+35218,35159,35058,34956,34812,34646,34570,34539,
+34584,34703,34822,34910,34996,35091,35158,35208,
+35262,35333,35384,35435,35575,35681,35715,35747,
+35840,35932,35997,36112,36255,36405,36556,36628,
+36673,36714,36726,36705,36624,36453,36268,36109,
+35994,35847,35687,35517,35382,35238,35094,34884,
+34689,34555,34482,34371,34131,33821,33711,33744,
+33871,34164,34330,34708,34976,35168,35488,36050,
+36196,36016,36140,36412,36730,36750,36793,36837,
+36774,36081,34635,33792,33387,33116,32997,32997,
+32997,32997,32997,32997,32091,31757,31844,31793,
+31711,31593,31502,31485,31489,31494,31500,31500,
+31510,31537,31572,31605,31644,31695,31771,31864,
+31963,32037,32069,32079,32083,32080,32074,32057,
+32035,32008,31978,31950,31922,31899,31880,31866,
+31848,31833,31788,31738,31681,31606,31494,31312,
+31151,31096,31054,31011,30948,30856,30774,30725,
+30780,31089,31529,31603,31546,31605,31768,31827,
+31791,31885,31897,32721,31800,31800,31800,31794,
+32334,32049,32061,32034,31830,31764,32478,32999,
+33180,33483,33764,33705,33561,33698,34005,34248,
+34524,34811,35019,35123,35076,35434,35859,36118,
+36487,36857,37129,37317,37984,38900,39024,39326,
+39483,39588,39670,39822,39913,40000,40104,40213,
+40335,40460,40509,40552,40593,40630,40680,40734,
+40786,40848,40954,41076,41178,41280,41364,41439,
+41538,41634,41696,41745,41802,41857,41913,41971,
+42034,42120,42210,42289,42363,42465,42554,42598,
+42633,42666,42706,42755,42810,42867,42903,42948,
+43003,43057,43108,43152,43188,43212,43250,43290,
+43329,43365,43395,43419,43433,43442,43449,43460,
+43476,43495,43530,43609,43713,43795,43838,43878,
+43907,43925,43935,43940,43943,43942,43937,43924,
+43905,43884,43863,43841,43819,43807,43819,43837,
+43859,43874,43883,43884,43881,43876,43879,43891,
+43896,43890,43880,43868,43865,43860,43857,43856,
+43852,43844,43833,43818,43806,43800,43791,43775,
+43750,43719,43682,43639,43597,43554,43518,43492,
+43436,43359,43259,43185,43084,42954,42874,42770,
+42645,42559,42438,42309,42207,42047,41943,41843,
+41743,41679,41598,41481,41213,40948,40821,40718,
+40524,40365,40213,40112,40008,39932,39882,39819,
+39763,39711,39659,39625,39607,39588,39576,39565,
+39561,39565,39576,39591,39643,39735,39840,39930,
+40048,40150,40227,40348,40470,40558,40660,40761,
+40851,40970,41085,41192,41334,41515,41715,41895,
+42021,42186,42319,42558,42676,42768,42865,42922,
+42993,43072,43146,43194,43224,43266,43320,43393,
+43480,43590,43737,43818,43899,43968,44024,44069,
+44099,44117,44138,44151,44155,44149,44130,44103,
+44078,44031,43971,43902,43829,43789,43749,43702,
+43659,43621,43589,43556,43521,43492,43440,43360,
+43269,43198,43143,43060,42972,42896,42844,42792,
+42743,42712,42690,42675,42660,42648,42633,42619,
+42612,42609,42612,42615,42620,42629,42641,42643,
+42642,42641,42639,42634,42628,42622,42618,42614,
+42613,42611,42612,42613,42616,42619,42619,42618,
+42615,42607,42598,42573,42540,42498,42439,42369,
+42301,42245,42187,42125,42067,42016,41985,41919,
+41844,41778,41727,41698,41660,41603,41538,41477,
+41424,41375,41305,41248,41193,41145,41108,41087,
+41055,41015,40975,40938,40904,40875,40850,40824,
+40802,40770,40714,40659,40605,40560,40524,40492,
+40455,40417,40377,40332,40280,40221,40144,39957,
+39872,39860,39817,39697,39438,39258,39177,39073,
+38961,38775,38537,38372,38394,38130,32673,30714,
+31375,31323,30721,30800,31479,31441,31152,31292,
+31679,31790,31567,31292,31199,31201,31199,31196,
+31295,31466,31491,31791,31899,31910,31785,31819,
+31806,31794,31716,31566,31476,31431,31409,31404,
+31425,31458,31509,31557,31465,31206,31197,31203,
+31575,31193,30342,30312,29188,28481,28351,27968,
+27843,27495,26765,26483,26460,26499,26979,26957,
+26292,25509,25155,24971,24291,24586,24026,23358,
+23214,23220,22599,22387,22411,22501,22577,22607,
+22572,22485,22397,22324,22260,22191,22146,22272,
+22444,22164,22185,22215,22156,21989,21909,21959,
+22098,22185,22103,22163,22178,22206,22545,23004,
+23673,28792,31728,32246,31845,32504,32757,32922,
+30771,32982,32912,32834,32791,32798,32839,32897,
+32971,32322,32403,32526,32520,32496,32505,32646,
+33468,33883,34023,34869,35338,35187,35055,34980,
+35341,35492,35595,35322,35475,36181,36621,36779,
+36740,36186,36069,36548,36445,36418,36545,36663,
+36675,36810,36931,37151,37166,37049,36969,36950,
+36885,36801,36752,36738,36782,36826,36894,36922,
+36865,36635,36398,36244,36207,36152,36125,36145,
+36138,35269,34905,34403,34617,34452,34372,34236,
+33692,33091,35013,34537,33642,33829,33691,33372,
+32997,32997,32997,33016,33129,33704,33791,33843,
+33854,33876,33847,33608,32997,32997,32997,33006,
+33013,33449,33974,34515,34828,34963,35050,35148,
+35289,35364,35388,35392,35400,35421,35462,35527,
+35617,35694,35790,35917,36009,36201,36387,36591,
+36697,36776,36797,36744,36570,36302,36162,36041,
+35941,35842,35769,35696,35646,35585,35513,35433,
+35341,35223,35016,34671,34503,34399,34288,34266,
+34417,34875,35551,36080,36400,36774,36799,36762,
+35868,36404,36821,36794,36661,36583,36831,37405,
+37309,36618,35887,35346,35356,34524,34081,32997,
+32812,31284,30963,31099,31186,31290,31425,31546,
+31659,31722,31722,31688,31647,31614,31592,31581,
+31572,31563,31551,31537,31517,31500,31494,31515,
+31574,31652,31746,31836,31890,31950,32028,32104,
+32131,32110,32064,32014,31972,31933,31897,31868,
+31848,31838,31833,31833,31830,31820,31789,31735,
+31660,31577,31489,31402,31314,31251,31185,31081,
+30952,30882,30957,31261,31614,31740,31767,31749,
+31726,31791,32025,31977,31580,30933,30956,31792,
+31809,31905,31872,31818,31461,31257,31197,31212,
+31881,32097,32223,32409,32643,32751,32763,32808,
+32700,32769,33168,34140,34484,34892,35241,35581,
+35899,36180,36531,36826,36999,37621,38784,39441,
+39624,39558,39747,40035,40143,40222,40368,40502,
+40603,40679,40732,40779,40832,40923,41039,41116,
+41198,41298,41377,41425,41500,41580,41644,41689,
+41718,41761,41796,41820,41838,41859,41890,41940,
+41996,42054,42150,42267,42369,42511,42611,42673,
+42724,42769,42807,42855,42906,42981,43066,43136,
+43180,43207,43239,43272,43308,43345,43381,43419,
+43458,43494,43514,43528,43534,43538,43545,43558,
+43575,43598,43628,43668,43711,43753,43786,43801,
+43814,43818,43819,43816,43815,43806,43794,43780,
+43756,43739,43726,43705,43671,43621,43567,43541,
+43515,43496,43482,43481,43480,43480,43487,43492,
+43497,43506,43516,43533,43557,43587,43611,43629,
+43641,43648,43651,43650,43647,43642,43636,43632,
+43623,43611,43592,43559,43521,43486,43413,43321,
+43234,43179,43093,42982,42894,42825,42725,42624,
+42536,42420,42300,42217,42110,41994,41850,41676,
+41444,41283,41089,40940,40788,40575,40347,40157,
+40045,39945,39852,39701,39591,39504,39403,39337,
+39280,39239,39210,39147,39088,39012,38940,38900,
+38892,38895,38912,38952,38991,39075,39151,39259,
+39369,39601,39945,40127,40257,40410,40518,40619,
+40720,40812,40956,41097,41245,41436,41672,41904,
+42069,42225,42391,42563,42718,42849,42945,43014,
+43066,43107,43139,43166,43191,43209,43254,43327,
+43416,43501,43626,43752,43819,43887,43950,44001,
+44043,44071,44082,44076,44058,44028,43988,43945,
+43895,43845,43801,43773,43731,43687,43641,43599,
+43555,43522,43498,43474,43424,43351,43272,43201,
+43146,43077,42996,42919,42859,42783,42709,42652,
+42612,42594,42576,42555,42529,42502,42474,42450,
+42429,42408,42395,42398,42420,42456,42495,42541,
+42583,42603,42619,42625,42622,42619,42616,42616,
+42618,42624,42631,42642,42654,42667,42679,42691,
+42702,42708,42708,42699,42675,42639,42597,42515,
+42397,42309,42264,42197,42123,42054,42003,41952,
+41885,41828,41778,41734,41692,41627,41557,41484,
+41412,41367,41324,41285,41238,41188,41139,41102,
+41081,41048,41010,40966,40918,40874,40833,40802,
+40772,40722,40668,40608,40555,40508,40490,40474,
+40455,40431,40399,40353,40299,40239,40198,40142,
+40053,39954,39857,39695,39277,38900,38598,38388,
+38310,38019,37791,37672,37554,37299,36844,36396,
+34154,31407,30229,30651,30825,31261,31647,31833,
+31788,31794,31816,31872,31896,31876,31503,31390,
+31262,31197,31271,31428,31836,31844,31842,31837,
+31828,31819,31795,31708,31547,31490,31482,31473,
+31482,31488,31487,31476,31478,31523,31587,31540,
+29705,28183,27376,26775,26878,26132,26354,26374,
+26397,26295,26010,25589,25341,25098,24916,24816,
+24529,24070,24021,24060,23940,23344,22606,22648,
+22690,22497,22211,22118,22135,22143,22156,22195,
+22257,22311,22326,22293,22215,22131,22011,21847,
+21684,21597,21582,21610,21634,21636,21621,21607,
+21598,21618,21633,21611,21555,21489,21462,21487,
+21546,21613,21756,22075,22260,22458,23336,27043,
+30393,32501,32217,31898,31778,31866,31910,31968,
+32080,32138,32145,31998,32314,32076,31284,31363,
+32448,31839,31767,31773,31266,31251,33090,34186,
+33679,33912,33579,33075,32988,32664,33223,33028,
+33117,32934,32997,32868,32997,32997,32997,33212,
+33790,34026,34015,33404,33164,33256,33574,33744,
+33682,33729,33942,34228,34325,34381,34626,34704,
+34587,34701,34776,34855,35007,35029,35060,34866,
+34679,34518,34350,34269,33426,33099,32997,32997,
+33069,34239,34211,33015,32997,32997,32997,32997,
+32924,32978,32970,32982,32996,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32997,32997,
+33553,34143,34607,34987,35371,35582,35696,35701,
+35689,35643,35584,35556,35562,35595,35646,35711,
+35868,36025,36193,36375,36571,36723,36808,36873,
+36907,36921,36941,36954,36952,36922,36840,36741,
+36677,36493,36194,36057,36001,35952,35866,35793,
+35714,35638,35484,35339,35322,35508,35717,35783,
+35940,36133,36428,36737,36873,37316,37769,37662,
+37643,37799,37747,38145,38355,38424,38494,38658,
+38832,38950,38769,38168,37695,36183,36753,36792,
+31619,31011,31049,31182,31274,31333,31386,31435,
+31482,31519,31552,31584,31613,31636,31658,31676,
+31692,31706,31716,31716,31700,31665,31609,31551,
+31508,31482,31468,31471,31485,31521,31572,31608,
+31648,31713,31797,31870,31911,31921,31909,31881,
+31846,31819,31801,31791,31774,31772,31817,31938,
+32016,31892,31746,31601,31477,31402,31296,31230,
+31212,31197,31167,31201,31409,31658,31782,31878,
+31632,31427,31511,31806,31895,31728,31390,31091,
+30714,30717,31083,31680,31713,31359,31029,31146,
+31179,31623,31884,31998,32280,32343,32634,32925,
+32529,32598,32655,32727,33474,33952,34229,34535,
+34908,35544,35976,36165,36357,36617,36806,36873,
+37870,40830,39649,40025,40194,40200,40320,40530,
+40620,40614,40677,40849,41085,41234,41352,41408,
+41442,41484,41526,41562,41606,41652,41692,41728,
+41769,41775,41743,41706,41691,41676,41667,41682,
+41756,41880,42000,42142,42300,42439,42589,42666,
+42738,42791,42839,42892,42969,43092,43198,43249,
+43284,43302,43309,43315,43321,43328,43335,43351,
+43373,43403,43438,43470,43491,43503,43518,43533,
+43545,43557,43570,43584,43598,43608,43617,43620,
+43614,43599,43581,43560,43554,43535,43519,43516,
+43509,43460,43284,43097,42994,42956,42972,42992,
+43014,43037,43057,43077,43103,43141,43173,43185,
+43199,43206,43221,43234,43261,43296,43338,43377,
+43415,43443,43458,43461,43456,43449,43437,43421,
+43401,43383,43365,43341,43308,43260,43205,43156,
+43085,43001,42921,42879,42828,42759,42651,42547,
+42436,42307,42226,42111,41989,41769,41568,41270,
+41046,40905,40796,40692,40516,40233,40055,39935,
+39814,39627,39455,39316,39245,39135,38922,38557,
+38201,38001,37782,37659,37602,37622,37709,37776,
+37823,37913,38094,38265,38397,38549,38793,39060,
+39223,39315,39440,39653,39903,40214,40385,40522,
+40622,40716,40843,41032,41184,41347,41544,41736,
+41951,42084,42217,42315,42479,42623,42817,42925,
+43003,43060,43098,43126,43152,43179,43206,43261,
+43348,43449,43545,43663,43770,43814,43849,43875,
+43887,43882,43871,43851,43830,43810,43793,43764,
+43729,43694,43657,43620,43584,43544,43509,43491,
+43468,43438,43401,43349,43287,43222,43173,43114,
+43050,42972,42882,42771,42667,42597,42553,42492,
+42435,42391,42352,42326,42304,42291,42273,42246,
+42228,42216,42215,42226,42242,42264,42288,42319,
+42379,42445,42501,42537,42562,42579,42590,42595,
+42597,42600,42607,42621,42640,42659,42679,42696,
+42711,42722,42726,42721,42705,42673,42627,42581,
+42506,42426,42340,42264,42171,42064,41997,41958,
+41921,41877,41826,41772,41722,41688,41633,41560,
+41486,41422,41386,41332,41277,41226,41177,41131,
+41096,41052,41001,40950,40899,40852,40812,40764,
+40719,40677,40636,40603,40577,40559,40549,40544,
+40545,40545,40539,40511,40402,40266,40179,40017,
+39870,39711,39548,39335,39202,39070,38967,38847,
+38756,38663,38529,38298,38114,37899,37624,37427,
+37389,37171,32790,31789,30552,31253,30903,30285,
+31042,31385,31677,31796,31854,31822,31803,31810,
+31783,31635,31486,31446,31476,31570,31564,31715,
+31821,31840,31817,31804,31814,31828,31822,31800,
+31788,31792,31807,31773,31619,31472,31001,30540,
+30653,29606,28906,28088,27613,27399,26763,25744,
+25545,25297,25086,24612,24425,23428,23382,23347,
+23306,23319,22974,23235,23088,23394,22908,22414,
+22225,22196,22338,22371,22322,22231,22048,21822,
+21623,21630,21793,21904,21815,21537,21276,21403,
+21633,21605,21603,21604,21589,21523,21438,21353,
+21302,21304,21343,21373,21381,21387,21436,21576,
+21658,21635,21646,21631,21600,21594,21620,21749,
+22002,22402,23020,23991,25506,27099,28022,28496,
+28644,28956,29526,30852,31519,31647,31715,31926,
+32011,31850,31284,31578,31878,31609,31001,30516,
+31287,31767,32434,30516,32442,31738,32385,32607,
+32655,32745,32895,32913,32997,32997,32997,32997,
+32997,32997,32997,32997,32997,32997,32999,33037,
+33013,32997,33156,33984,33961,33913,33294,32997,
+32997,32997,32997,32997,32997,33007,32997,32997,
+32997,32997,34956,34669,33176,32997,32997,32862,
+32709,34383,33113,32905,32997,32983,32997,32997,
+32997,32969,32821,32881,32928,32964,32988,32994,
+32997,32997,32997,32997,32997,33414,33958,34074,
+34315,34772,35199,35391,35595,35753,35878,35995,
+36152,36280,36328,36188,36084,36132,36310,36486,
+36656,36760,36814,36818,36781,36735,36690,36702,
+36750,36772,36766,36694,36499,36344,36262,36189,
+36110,35970,35701,35640,35944,36093,36137,36233,
+36295,36276,36165,36036,35853,35512,35871,36028,
+36001,36181,36319,36438,36448,36715,36651,36883,
+37175,37182,37406,37395,37516,38031,38355,38604,
+38954,39109,39228,39160,38535,38106,37776,36135,
+36192,35468,31665,31160,31081,31192,31261,31320,
+31371,31422,31465,31504,31546,31597,31655,31711,
+31764,31806,31821,31830,31838,31845,31848,31843,
+31837,31806,31748,31679,31620,31576,31542,31518,
+31499,31482,31464,31468,31515,31711,31849,31822,
+31798,31829,31788,31716,31497,31416,31301,30828,
+29889,28608,28329,27840,28019,28663,29470,30126,
+30342,30513,30537,30325,29961,29369,28796,28269,
+27768,27310,26782,26171,25718,25593,25693,26465,
+30437,32125,31721,31561,31545,31653,31521,31077,
+31236,31869,31959,32097,32520,32703,32970,32970,
+32538,32610,32673,32730,32802,32808,32949,32991,
+32997,33159,33838,34314,34785,35150,35604,35850,
+36010,36249,36381,36885,37081,37368,38316,38922,
+39437,39831,40004,40640,40740,41107,41300,41400,
+41417,41399,41398,41401,41392,41370,41326,41222,
+41130,41101,41118,41182,41276,41362,41431,41532,
+41637,41716,41853,42010,42198,42344,42543,42639,
+42707,42759,42802,42841,42880,42927,43024,43133,
+43197,43204,43199,43193,43185,43170,43156,43150,
+43153,43164,43185,43220,43266,43314,43347,43362,
+43386,43416,43439,43441,43432,43430,43422,43408,
+43380,43339,43275,43222,43189,43152,43084,42984,
+42878,42725,42609,42546,42464,42419,42418,42416,
+42423,42472,42531,42576,42603,42633,42695,42766,
+42829,42876,42921,42976,43021,43050,43070,43087,
+43109,43134,43156,43175,43186,43192,43200,43192,
+43177,43143,43101,43059,43023,42999,42978,42951,
+42924,42899,42870,42816,42747,42669,42594,42495,
+42363,42264,42170,41997,41795,41602,41395,41070,
+40875,40801,40758,40685,40482,40106,39951,39843,
+39614,39377,39227,39088,38871,38445,37887,37501,
+37167,36963,36723,36576,36585,36645,36886,37195,
+37545,37597,37629,37756,38073,38383,38832,39156,
+39263,39326,39439,39558,39642,39798,40116,40363,
+40517,40644,40734,40911,41103,41244,41396,41546,
+41701,41883,42021,42108,42214,42436,42699,42867,
+42940,43002,43042,43074,43103,43133,43167,43200,
+43275,43387,43488,43563,43648,43715,43758,43771,
+43773,43761,43744,43720,43692,43659,43626,43597,
+43569,43548,43529,43509,43488,43464,43435,43404,
+43374,43338,43297,43252,43207,43164,43095,43014,
+42916,42816,42673,42581,42501,42419,42345,42297,
+42264,42214,42168,42129,42105,42090,42075,42064,
+42060,42067,42081,42101,42127,42158,42197,42243,
+42292,42335,42382,42433,42476,42513,42537,42555,
+42567,42574,42581,42589,42598,42613,42635,42658,
+42675,42688,42691,42690,42681,42658,42623,42591,
+42555,42497,42432,42360,42300,42255,42175,42093,
+42027,41990,41944,41883,41823,41764,41711,41628,
+41524,41433,41380,41309,41249,41199,41157,41118,
+41082,41025,40964,40905,40854,40809,40767,40700,
+40641,40593,40558,40536,40521,40518,40518,40518,
+40515,40504,40439,40317,40200,40105,39983,39866,
+39717,39606,39540,39474,39417,39327,39202,39123,
+39116,39145,39132,39049,38934,38799,38692,38544,
+38398,38055,37915,38943,40873,33980,31986,31659,
+31262,30831,30682,30722,30595,30644,31143,31197,
+31220,31691,31809,31716,31623,31682,31404,31218,
+31194,31188,31387,31707,31785,31734,31806,31809,
+31806,31806,31810,31822,31858,31884,31839,31587,
+31377,30881,29515,27938,26653,25480,24909,25024,
+24408,24163,24653,24639,24338,23221,21872,21918,
+22067,22022,21966,22020,21968,21676,21561,21256,
+20911,20980,21135,21302,21706,21936,21970,21912,
+21818,21704,21591,21521,21588,21667,21645,21341,
+20986,21165,21482,21374,21315,21293,21269,21241,
+21125,20556,20406,20560,20724,20795,20778,20747,
+20735,20766,20813,20863,20895,20912,21118,21473,
+21595,21514,21480,21574,21754,21687,21573,22136,
+22593,22941,23580,24402,25309,26387,27507,28387,
+29019,29459,29573,29399,29235,29179,29171,29200,
+29296,29485,29734,29946,30058,30145,30303,30555,
+30883,31239,31601,31959,32301,32613,32898,31380,
+32205,32970,32970,33403,33465,32997,32997,32997,
+32892,32925,33438,33403,33063,32982,33065,32964,
+32760,32646,32623,32676,32715,32593,32484,32455,
+32496,32353,32110,31878,31694,31567,31481,31428,
+31350,32038,31356,31359,31881,31810,31971,32168,
+32370,32553,32703,32818,32900,32962,32970,32322,
+31755,32460,33645,33894,33657,33049,33108,33321,
+33646,33983,34297,34428,34499,34610,34827,35046,
+35491,36126,36476,36741,36996,36528,36298,36069,
+35941,36022,36099,36256,36261,36210,36026,35733,
+35574,35484,35394,35340,35298,35190,34877,34429,
+34198,33903,33315,32970,32970,32970,33915,35544,
+35543,35064,34598,34548,34527,33611,32988,32994,
+33282,33960,33235,33135,33669,34328,35222,35729,
+35829,35874,35979,35984,36190,36439,36810,37152,
+37524,38490,38878,38247,38065,38189,38314,38529,
+36056,35763,34043,31713,31383,31225,31205,31234,
+31281,31332,31374,31416,31449,31483,31525,31594,
+31684,31771,31822,31837,31836,31826,31818,31813,
+31809,31800,31797,31797,31792,31761,31702,31627,
+31548,31498,31491,31494,31485,31434,31302,31053,
+30526,30238,30135,29922,29373,28476,27789,27251,
+26748,26131,25573,25128,25482,25685,24948,25245,
+25509,25651,25734,25901,25851,25796,25529,25104,
+24861,24798,24816,24864,24873,24515,24237,23664,
+23719,24878,26656,27366,28307,30105,31292,32079,
+32276,32091,32145,32736,31701,32430,32598,32643,
+32700,32721,32766,32814,32865,32919,32997,32970,
+33834,34241,33521,33891,34302,34698,34980,35322,
+35660,35899,36173,36468,36941,37245,37417,37950,
+38203,38385,38541,38681,38784,39153,39657,41001,
+41072,41049,40929,40832,40776,40678,40533,40404,
+40362,40408,40530,40791,41081,41260,41393,41487,
+41595,41719,41878,42034,42218,42342,42454,42564,
+42626,42682,42729,42768,42807,42853,42902,42934,
+42964,42975,42964,42928,42868,42820,42783,42753,
+42736,42736,42752,42765,42760,42744,42734,42729,
+42756,42796,42837,42872,42888,42906,42906,42902,
+42891,42883,42864,42824,42740,42633,42576,42576,
+42600,42591,42295,42153,42073,42015,41976,41934,
+41923,41932,41946,41973,42018,42120,42270,42333,
+42396,42482,42570,42614,42673,42729,42775,42807,
+42819,42823,42823,42814,42804,42793,42790,42789,
+42790,42804,42817,42809,42785,42777,42776,42768,
+42748,42724,42693,42653,42613,42576,42496,42397,
+42308,42225,42118,41967,41726,41578,41442,41278,
+41073,40906,40797,40695,40521,40218,39991,39798,
+39541,39312,39187,39002,38569,38126,37605,37138,
+36858,36456,35932,35496,35303,35843,35983,36080,
+36301,36803,37387,37662,38099,38544,39114,39243,
+39274,39294,39316,39392,39520,39620,39739,40020,
+40330,40531,40664,40761,40967,41163,41277,41391,
+41508,41679,41933,42093,42222,42359,42568,42687,
+42798,42880,42918,42952,42999,43045,43099,43161,
+43231,43332,43431,43500,43553,43607,43639,43653,
+43647,43629,43607,43581,43554,43522,43491,43467,
+43443,43421,43399,43376,43349,43322,43296,43272,
+43248,43218,43191,43145,43072,42983,42900,42823,
+42687,42587,42504,42414,42339,42292,42243,42177,
+42120,42072,42033,42004,41991,41979,41973,41976,
+41985,41996,42010,42035,42065,42104,42150,42203,
+42257,42299,42330,42358,42378,42396,42412,42423,
+42433,42444,42459,42481,42510,42543,42576,42600,
+42619,42638,42650,42657,42658,42651,42639,42619,
+42599,42571,42513,42437,42366,42310,42242,42170,
+42107,42045,41956,41844,41757,41700,41644,41554,
+41447,41370,41302,41236,41180,41136,41104,41077,
+41017,40950,40883,40827,40788,40719,40632,40548,
+40499,40467,40432,40403,40378,40357,40341,40334,
+40326,40306,40269,40222,40177,40077,39993,39954,
+39930,39915,39903,39864,39773,39647,39553,39465,
+39415,39394,39384,39381,39348,39236,39043,38811,
+38484,38271,37749,39496,42615,38448,37433,39141,
+35830,32805,31986,31628,31704,31711,31424,31416,
+31239,31017,31077,31331,31653,31881,31921,31884,
+31815,31607,31177,31201,31487,31848,31407,31470,
+31827,31830,31830,31817,31820,31810,31768,31600,
+31426,30939,29967,28239,27153,26598,24776,24049,
+23565,23370,23385,23310,23188,22998,22650,21816,
+21436,21300,21237,21199,21168,21144,21090,20979,
+20871,20813,20812,20865,20994,21169,21301,21400,
+21363,21296,21156,20950,20843,20882,21012,21081,
+21000,20705,20379,20337,20401,20450,20708,20689,
+20472,20421,20390,20468,20727,20271,20225,20325,
+20376,20407,20424,20438,20536,20651,20742,20799,
+20837,20879,20932,20974,21018,21051,21047,21043,
+21071,21136,21212,21270,21209,21273,21763,22597,
+23481,24228,24804,25235,25551,25802,26020,26232,
+26460,26715,26994,27295,27609,27933,28269,28624,
+29002,29409,29847,30330,30870,31479,32167,32857,
+30630,31236,33072,33042,32421,32490,32022,31880,
+31794,31722,31644,31555,31461,31368,31281,31188,
+31085,30975,30864,30759,30658,30561,30455,30345,
+30228,30111,29991,29871,29763,29681,29633,29630,
+29673,29769,29910,30071,30371,30649,30990,31374,
+31798,32258,32708,31323,31818,32931,32970,32301,
+31800,33015,33692,33617,33674,33697,33728,33824,
+33939,34023,33919,33810,33951,33754,33138,32997,
+33175,33556,33540,33867,33694,33766,33702,33673,
+33292,33003,33039,33758,33853,34053,34000,34017,
+33875,33179,32970,33659,33497,32970,32970,32970,
+32970,32970,32970,32970,32970,32970,32978,32997,
+34179,33836,32970,33191,33705,32970,32970,32970,
+34191,34530,33369,32970,33354,32997,32997,32970,
+32970,32990,33554,33153,33927,34340,34715,35352,
+35652,36291,36021,36708,37244,37557,37950,38219,
+37659,36497,36007,36060,33381,32571,31682,31364,
+31330,31349,31374,31402,31426,31443,31455,31464,
+31477,31501,31560,31628,31687,31731,31766,31789,
+31803,31828,31870,31918,31960,31993,32003,31975,
+31902,31785,31509,31335,30909,30410,29958,29442,
+28729,28212,27729,27204,26544,25967,25462,25006,
+25084,24900,24636,24541,24150,23973,23841,24050,
+23588,23414,23598,23868,23905,23683,23375,23177,
+22848,22631,22539,22701,22770,22969,23106,23309,
+23317,22550,22227,22456,23654,24768,24157,25399,
+25647,26618,28864,31396,31854,32214,31113,31002,
+31236,32871,32889,32910,32928,32952,32943,32976,
+34032,34698,34752,33652,34656,34173,34292,34487,
+34809,35169,35538,36018,36611,37092,37257,37470,
+37791,38031,38321,38821,39187,39276,39257,38799,
+38568,38823,39285,39449,40463,39359,39195,39286,
+39497,40116,40554,40761,40955,41116,41289,41417,
+41559,41761,41979,42108,42206,42264,42299,42356,
+42428,42490,42535,42570,42592,42612,42642,42654,
+42657,42624,42573,42502,42435,42382,42345,42318,
+42299,42286,42271,42241,42207,42184,42169,42090,
+41985,41903,41787,41748,41757,41820,41942,42207,
+42585,42648,42656,42645,42622,42597,42522,42326,
+42033,41715,41261,40962,40869,40931,41010,41080,
+41155,41256,41395,41471,41544,41632,41694,41739,
+41786,41834,41929,42054,42159,42207,42242,42255,
+42246,42235,42226,42201,42180,42164,42137,42109,
+42087,42087,42108,42169,42253,42311,42380,42430,
+42462,42481,42486,42480,42462,42430,42393,42348,
+42304,42253,42150,42003,41809,41653,41541,41440,
+41305,41099,40940,40805,40688,40498,40193,39951,
+39531,39060,38832,38546,37993,37456,37251,36899,
+36459,35754,35473,35380,35067,34606,34535,34875,
+35817,37578,36834,37276,37438,37600,37842,38156,
+38433,38572,38713,38892,39105,39198,39296,39615,
+39993,40316,40543,40654,40808,41011,41160,41269,
+41369,41478,41685,41986,42154,42276,42370,42508,
+42598,42660,42727,42785,42837,42898,42958,43063,
+43182,43255,43348,43431,43488,43522,43560,43575,
+43561,43534,43502,43458,43404,43347,43305,43276,
+43258,43246,43235,43224,43212,43200,43176,43134,
+43087,43032,42969,42906,42846,42736,42623,42555,
+42454,42352,42288,42237,42172,42103,42034,41985,
+41954,41908,41868,41842,41833,41839,41855,41878,
+41904,41927,41949,41967,41990,42009,42043,42082,
+42135,42193,42246,42271,42274,42274,42276,42279,
+42283,42288,42294,42303,42321,42352,42389,42427,
+42466,42506,42544,42574,42594,42611,42633,42647,
+42645,42619,42555,42431,42332,42273,42203,42136,
+42068,42006,41937,41826,41721,41670,41604,41533,
+41454,41368,41192,41104,41059,41033,41010,40979,
+40937,40886,40833,40784,40689,40592,40512,40453,
+40360,40278,40224,40183,40155,40130,40119,40128,
+40164,40200,40213,40208,40197,40170,40131,40091,
+40053,40020,39990,39960,39934,39918,39903,39860,
+39831,39870,39913,39923,39893,39854,39768,39704,
+39675,39706,39919,40164,38899,40225,39264,38377,
+37642,41154,39405,39338,35241,34211,33852,31887,
+31967,32613,31453,31167,31262,31493,31473,31680,
+31850,31860,31835,31810,31797,31753,31790,31459,
+32006,31608,31245,31551,31456,31610,31796,31701,
+31452,31510,31357,31137,30822,30700,29382,28196,
+26373,24780,24044,23598,22995,22542,22183,21763,
+21519,21530,21441,21271,21101,21018,21009,20951,
+20574,20409,20411,20476,20524,20562,20581,20581,
+20572,20560,20542,20508,20453,20387,20403,20453,
+20436,20377,20347,20358,20382,20436,20563,20749,
+20829,20802,20758,20761,20837,20957,21022,20649,
+20407,20343,20323,20323,20346,20379,20404,20412,
+20394,20398,20467,20593,20715,20838,20959,21006,
+20994,20998,20965,20922,20901,20916,21024,21228,
+21456,21590,21775,22091,22357,22541,22713,22935,
+23170,23421,23791,24281,24784,25247,25682,26107,
+26535,26974,27417,27867,28326,28792,29250,29691,
+30064,30313,30408,30363,30237,30072,29908,29763,
+29638,29541,29463,29401,29348,29298,29251,29203,
+29149,29088,29014,28930,28836,28731,28618,28496,
+28371,28248,28131,28028,27945,27891,27873,27900,
+27976,28109,28302,28550,28854,29207,29602,30036,
+30498,30987,31480,31947,32314,32545,32734,32650,
+31860,33489,33231,32970,32970,32970,32997,32997,
+33042,33020,32970,32997,32997,32997,32970,32970,
+32967,32970,32970,32472,32445,32925,32076,31737,
+32382,33679,32901,32724,32547,32997,32968,32688,
+32479,32311,32161,31985,31786,31614,31860,32224,
+31214,31455,31541,31664,31950,32174,32398,32616,
+32832,32887,32997,33984,33946,32970,32976,32970,
+32970,32970,32970,32970,32970,32997,32997,32970,
+32970,32970,32970,32970,32970,32970,32970,32970,
+32970,34080,35109,36162,36857,37313,37776,38467,
+38507,38338,37537,37200,36173,33471,31678,31646,
+31620,31522,31484,31479,31482,31486,31489,31489,
+31487,31484,31476,31473,31471,31495,31560,31653,
+31741,31822,31907,32028,32160,32269,32308,32221,
+31932,31388,30720,30007,29342,28749,28341,27940,
+27555,26978,26484,25949,25448,24845,24415,24097,
+23764,23506,23162,23011,22911,22846,22896,22693,
+22487,22591,21909,21981,22260,22090,22177,23064,
+22424,21584,21610,21597,21634,21735,21495,21421,
+21808,22347,22503,21603,21537,21587,22323,21450,
+22614,22023,22491,23291,24222,23784,25331,29325,
+31757,31328,27285,29700,32901,32970,32970,32970,
+32901,32979,32991,32928,32922,32946,33250,33687,
+33925,34320,34738,35406,35977,36443,37034,37202,
+37349,37558,37996,38685,38862,38677,38509,38818,
+38857,37568,37161,37316,37687,37549,37749,38097,
+39039,39356,40066,40328,40580,40751,40928,41167,
+41508,41864,41999,42047,42096,42141,42168,42168,
+42158,42152,42135,42055,41996,41947,41921,41900,
+41874,41841,41814,41762,41712,41679,41619,41604,
+41634,41632,41548,41358,41163,40939,40654,40659,
+40662,40560,40492,40590,40656,40971,41392,41610,
+41880,42233,42360,42324,42123,41703,41128,40894,
+40569,40053,39884,39739,39673,39678,40043,40281,
+40509,40548,40566,40566,40590,40608,40957,41235,
+41385,41481,41530,41549,41550,41528,41565,41605,
+41632,41662,41689,41717,41728,41736,41737,41730,
+41739,41757,41793,41829,41864,41915,41980,42052,
+42140,42219,42279,42300,42317,42324,42315,42301,
+42292,42267,42218,42138,42025,41846,41666,41552,
+41455,41346,41130,40965,40800,40696,40512,40147,
+39882,39387,39099,38820,38622,38290,37757,37253,
+36791,36159,35603,34753,34230,33534,33337,33427,
+34555,35427,35902,36237,36357,36499,36653,36822,
+37189,37409,37671,37932,38130,38401,38942,39201,
+39588,39985,40274,40504,40674,40825,41000,41116,
+41232,41358,41447,41612,41823,42044,42165,42252,
+42324,42433,42550,42613,42661,42687,42707,42742,
+42812,42886,42984,43137,43198,43231,43275,43293,
+43267,43245,43213,43196,43181,43162,43142,43125,
+43111,43092,43073,43050,43025,42991,42951,42916,
+42866,42785,42693,42596,42524,42432,42326,42255,
+42150,42031,41967,41896,41827,41771,41715,41682,
+41655,41643,41637,41634,41634,41636,41640,41651,
+41675,41706,41733,41762,41787,41812,41838,41866,
+41891,41916,41941,41961,41979,41993,42006,42018,
+42036,42072,42120,42159,42195,42232,42262,42288,
+42316,42352,42396,42442,42481,42510,42528,42540,
+42530,42495,42430,42350,42292,42228,42152,42079,
+42018,41979,41909,41829,41745,41667,41517,41380,
+41135,41004,40931,40905,40889,40869,40851,40826,
+40793,40746,40668,40549,40425,40253,40155,40079,
+40027,39970,39927,39900,39886,39879,39875,39864,
+39867,39897,39949,40014,40053,40047,39999,39934,
+39894,39888,39879,39863,39852,39848,39849,39856,
+39864,39878,39908,39984,40044,40044,39962,39622,
+39374,38965,38376,38097,37994,37861,38719,39691,
+39873,40104,40746,38199,38790,38223,41254,40422,
+34753,39249,32871,31793,31819,31344,31203,31349,
+31572,31777,31801,31812,31871,31641,31099,30606,
+29734,28562,28650,28128,28578,29247,28889,30709,
+29585,30789,30764,31265,31209,31089,30477,29850,
+29079,27492,25058,23841,22580,21912,21552,21430,
+21410,21381,21402,21426,21156,20956,20849,20637,
+20402,20324,20340,20382,20415,20427,20418,20389,
+20338,20255,20154,20073,20053,20067,20073,20064,
+20070,20126,20225,20322,20400,20446,20460,20448,
+20422,20404,20409,20448,20568,20718,20832,20879,
+20880,20875,20913,21055,21082,20587,20365,20385,
+20401,20403,20403,20411,20437,20466,20503,20547,
+20565,20541,20527,20565,20605,20647,20694,20757,
+20836,20931,21024,21118,21189,21234,21318,22453,
+21702,21495,22082,22707,23079,23220,23227,23559,
+24038,24486,24924,25359,25783,26178,26527,26823,
+27058,27225,27330,27380,27385,27364,27327,27294,
+27268,27256,27263,27285,27319,27366,27420,27476,
+27525,27564,27579,27572,27532,27463,27364,27244,
+27115,26976,26844,26724,26626,26557,26526,26538,
+26604,26727,26912,27160,27467,27828,28236,28671,
+29123,29569,29998,30402,30779,31130,31424,31516,
+32037,32281,32752,32970,32970,32997,32997,33275,
+34433,34365,35013,34971,34861,34555,33596,33125,
+32915,32211,31704,31532,31362,31171,31419,31946,
+32217,32435,32540,32533,32411,32232,32014,31773,
+31507,31231,30963,30710,30481,30283,30126,30017,
+29967,29976,30048,30174,30357,30585,30846,31136,
+31440,31746,32035,32278,32451,32604,32721,32821,
+32898,32952,32981,32997,32970,32970,32970,32970,
+32970,33114,32970,33137,33925,33963,32997,32970,
+32970,32970,34556,35963,36510,36900,37578,38375,
+38562,37442,36375,36072,35301,35129,33829,31216,
+31097,31254,31392,31493,31533,31543,31543,31542,
+31532,31513,31467,31380,31254,31068,30832,30632,
+30738,31155,31490,31571,31560,31454,31446,30493,
+29317,28680,28093,27805,27528,27228,26825,26463,
+26064,25629,24923,24746,24648,24369,23607,22341,
+21573,21617,21897,22119,22255,22261,22217,22137,
+22039,21954,21930,21817,21543,21346,21315,21444,
+21717,22193,22153,21327,21072,21352,21116,20866,
+21054,21391,21891,21956,21564,21285,20864,20898,
+20704,20892,20823,21218,20922,21260,21607,21781,
+22339,23650,25702,26991,27985,29781,31914,32263,
+32112,32652,32697,32193,32190,32355,32412,32670,
+32934,33015,34016,34751,35110,35307,35604,35956,
+36372,36723,36804,36828,37026,37348,37257,36960,
+37008,37134,36291,35753,35642,35511,35825,36466,
+37139,37410,38040,38603,39406,39847,39996,40556,
+40992,40983,41894,41449,41463,41257,41007,40346,
+40560,40716,40712,40710,40874,40530,40650,41099,
+41308,40910,40848,40812,40424,40206,39862,39380,
+39983,40226,40065,39239,39124,38818,38559,38003,
+38303,37934,37919,37877,38014,39331,39615,40096,
+39758,40759,40503,40185,38978,38297,38643,38949,
+38658,38720,38794,38809,38662,38687,38949,39368,
+39405,39379,39440,39505,39681,39932,40089,40483,
+40774,40908,40961,40929,40882,40860,40863,40944,
+41003,41070,41118,41149,41179,41168,41172,41202,
+41241,41274,41298,41337,41391,41484,41619,41715,
+41825,41913,41983,42054,42126,42186,42219,42232,
+42233,42230,42219,42206,42180,42123,42012,41781,
+41602,41456,41349,41150,40920,40759,40700,40548,
+40083,39668,39294,38994,38781,38582,38308,37917,
+37371,36982,36311,35676,34932,34193,33414,33291,
+33132,33137,33377,34422,34893,35361,35831,36266,
+36667,37098,37392,37704,38378,39117,39227,39240,
+39326,39566,39908,40222,40452,40611,40777,40921,
+41094,41205,41317,41393,41459,41605,41747,41944,
+42055,42130,42187,42232,42322,42431,42493,42522,
+42542,42555,42591,42672,42774,42850,42890,42903,
+42914,42919,42918,42910,42900,42886,42867,42844,
+42817,42794,42765,42729,42687,42643,42596,42533,
+42435,42362,42297,42228,42150,42065,41996,41942,
+41863,41775,41698,41646,41569,41507,41463,41428,
+41404,41399,41397,41395,41397,41405,41423,41445,
+41472,41496,41521,41550,41579,41598,41605,41605,
+41600,41607,41613,41624,41642,41672,41699,41718,
+41742,41793,41841,41897,41964,42017,42060,42106,
+42147,42188,42238,42282,42316,42354,42371,42367,
+42348,42314,42275,42227,42173,42114,42051,42003,
+41943,41853,41751,41679,41559,41404,41283,41100,
+40799,40695,40639,40606,40584,40557,40531,40506,
+40467,40365,40224,40134,40053,39999,39966,39930,
+39892,39813,39714,39633,39592,39582,39570,39566,
+39553,39552,39552,39564,39597,39642,39674,39693,
+39703,39709,39705,39684,39663,39656,39673,39700,
+39720,39736,39742,39687,39579,39537,39363,39136,
+38954,38635,37695,36951,36756,36680,37691,38439,
+38943,39543,39771,40035,39237,38255,36407,36547,
+33227,35482,38862,32683,32313,31787,31804,31810,
+31637,31241,31304,31036,30903,30162,30155,30156,
+29329,27846,26911,26790,26424,25868,26445,26797,
+26436,28815,30687,30942,30199,29687,28671,28557,
+27054,25691,24751,22911,22550,22081,21866,21609,
+21312,21176,21096,21045,20889,20824,20715,20645,
+20491,20402,20251,20103,20149,20316,20208,20289,
+20395,20364,20354,20367,20239,20319,20307,20289,
+20222,20135,20120,20078,20104,20129,20150,20169,
+20158,20208,20205,20191,20200,20241,20316,20389,
+20357,20352,20376,20498,20250,20364,20365,20358,
+20373,20343,20340,20289,20273,20182,20258,20248,
+20275,20227,20227,20216,20193,19997,20181,20330,
+20377,20442,20478,20399,20497,20500,20493,20416,
+20445,20584,20796,20880,21213,21400,21610,21923,
+21922,22057,22355,22919,23151,23765,23148,23309,
+23194,22942,22763,23052,23503,23730,24818,23867,
+23670,23949,24357,23449,24656,25639,25887,26243,
+26546,27225,28165,29500,30812,31527,31619,31527,
+31636,31785,31689,31315,31627,31435,30981,30594,
+30047,30020,29521,29933,30063,29383,29346,29485,
+29727,30470,31303,31257,31261,31056,30858,30639,
+30446,30548,30956,31609,31659,32343,32435,32988,
+32360,32598,32988,32952,32652,32162,32624,32124,
+32553,31887,31581,31491,31602,31575,31703,31843,
+31383,31543,31245,31078,31114,31171,31457,31254,
+31396,31266,31269,31284,31374,31305,31437,31348,
+31332,31305,31296,31308,31392,31813,31714,31413,
+31404,31420,31519,31471,31566,31683,31975,31782,
+31436,33006,34018,33875,33810,34025,33252,32967,
+33917,34149,33472,35056,35025,34786,34495,33126,
+32760,32952,34486,35436,36058,36907,37497,37950,
+38130,37005,36363,35292,34897,33927,32954,32628,
+32458,32233,31857,31625,31442,31225,31081,30981,
+31000,31089,30849,30315,29826,29345,28928,28479,
+27932,27148,27235,27260,27205,27048,26821,26618,
+26421,26319,26136,25851,25560,25344,24958,24363,
+23928,23685,23279,22734,22297,22728,22762,22477,
+21846,21559,21306,21354,21596,21635,21544,21519,
+21567,21611,21577,21457,21336,21158,20909,20693,
+20652,20717,20886,21069,21323,21170,20760,20681,
+20684,20847,21108,21216,20897,20763,20653,20666,
+20713,20766,20401,20198,20145,20339,20389,20314,
+20286,20544,21304,22380,23944,25264,26385,26470,
+28732,31881,32427,32064,32004,32104,31929,32772,
+32870,32890,33528,34167,34558,34561,33548,33672,
+33667,34029,34653,35451,35954,36672,36794,35799,
+35088,34999,35781,35957,35973,34187,33123,34262,
+34770,35250,35672,35910,36016,36411,37170,37308,
+37483,37437,37512,37677,37570,38178,37319,37694,
+37439,36988,37859,37990,39390,38931,39519,38868,
+39169,39615,38628,38384,38268,38004,38331,38139,
+38183,38211,38198,38154,38013,37770,37320,36681,
+36289,36213,36194,36292,36508,36411,36341,36313,
+36333,36080,35548,35988,36125,36303,36197,36459,
+37031,37339,37455,37473,37504,37594,37648,37743,
+38129,38213,38333,38431,38540,38742,38883,39465,
+39906,40136,40164,40073,39983,39988,39999,39955,
+39968,40029,40096,40167,40224,40297,40392,40490,
+40666,40858,40953,40955,40923,40905,41016,41327,
+41550,41649,41709,41796,41891,41943,41970,42000,
+42041,42094,42145,42195,42231,42231,42162,42015,
+41843,41674,41455,41337,41156,40842,40707,40651,
+40281,39900,39516,39247,38885,38765,38382,38051,
+37593,37269,36687,35957,35459,34652,34164,33329,
+33089,32966,32754,32705,32834,33682,34242,35035,
+36149,36757,37343,37635,37968,38690,39099,39231,
+39279,39346,39503,39807,40151,40383,40539,40697,
+40814,40981,41103,41181,41251,41320,41391,41461,
+41554,41671,41774,41910,41991,42069,42168,42226,
+42267,42291,42311,42363,42441,42505,42546,42565,
+42573,42573,42570,42564,42551,42528,42498,42475,
+42463,42448,42414,42369,42326,42288,42217,42141,
+42075,42030,41980,41916,41861,41810,41762,41706,
+41656,41594,41515,41433,41385,41321,41250,41209,
+41201,41211,41224,41235,41243,41253,41262,41277,
+41298,41319,41335,41352,41366,41370,41350,41325,
+41320,41325,41331,41334,41338,41349,41370,41397,
+41427,41469,41509,41568,41633,41691,41773,41859,
+41950,42000,42036,42074,42120,42150,42168,42172,
+42162,42142,42106,42060,42014,41973,41926,41865,
+41814,41773,41723,41620,41493,41395,41281,41168,
+41090,40899,40747,40554,40476,40446,40401,40335,
+40240,40154,40026,39937,39892,39867,39831,39772,
+39671,39584,39488,39383,39310,39271,39221,39184,
+39153,39156,39189,39230,39263,39288,39306,39306,
+39293,39272,39229,39218,39224,39255,39325,39406,
+39499,39564,39592,39611,39613,39601,39485,39042,
+37908,36979,37121,36467,35451,35424,37473,38117,
+37294,37428,36786,37488,37777,38790,38849,39114,
+40702,42700,37650,36637,34927,32994,31878,31448,
+29758,27897,27339,26839,26905,26731,26556,26852,
+27320,28638,30223,28975,27450,27155,26252,25986,
+27820,28886,28099,28174,28268,26920,24786,23262,
+22985,22698,22323,22104,21451,21373,21114,21011,
+20982,20904,20853,20663,20820,21096,20999,20877,
+20702,20640,20382,20178,20219,20287,20338,20408,
+20410,21147,20280,20431,20364,20350,20314,20256,
+20205,20127,19998,20100,20046,20006,20056,20053,
+20112,20010,20072,20043,20090,20121,20211,20211,
+20187,20133,20155,20414,20343,20276,20265,20278,
+20229,20271,20235,20234,20243,20243,20166,20217,
+20189,20142,20118,20005,20106,20196,20228,20280,
+20345,20388,20411,20187,20388,20188,20127,19925,
+20229,20410,20617,20845,20909,20823,20967,21288,
+21335,21736,21936,22341,22371,22983,22970,22694,
+23760,22243,22433,22293,21942,24306,23690,24119,
+23917,23637,23931,24345,24146,24009,24827,25107,
+25555,25437,26490,26024,26257,26657,27035,27273,
+27562,27105,27422,27619,28078,28409,27710,28346,
+28114,28820,30087,31340,30802,31117,31559,31737,
+31594,31544,31401,31491,31576,32336,31855,31245,
+31406,30653,31078,30279,31061,31992,31700,31249,
+31008,31144,30882,31710,31086,31038,30425,30903,
+30911,31329,31482,31524,31455,31451,31552,31291,
+31603,31523,31043,31180,31554,31268,31586,31671,
+31568,31402,31356,31345,31438,31305,31266,31348,
+31242,31291,31368,31485,31325,31719,31809,31949,
+31485,31410,31354,31339,31360,31398,31655,32702,
+32879,32772,32757,32547,32848,32988,33057,33546,
+34080,34390,35100,35678,34445,35256,35915,33044,
+32665,34280,35942,36778,37260,37616,38241,39175,
+39156,38670,37960,37153,36282,33645,32907,32760,
+32491,32224,31935,31684,31509,31201,31236,31470,
+30753,30093,29381,28573,27708,27009,26534,26212,
+25930,25657,25278,25155,25292,25299,25188,24907,
+24518,24202,24010,23741,23544,23454,23424,23354,
+23076,22779,22458,22176,21615,21097,20893,20897,
+21102,21220,21282,21035,21041,21179,21340,21223,
+21264,21231,21074,21003,20798,20708,20520,20336,
+20253,20229,20210,20241,20356,20409,20422,20563,
+20742,20328,20594,20763,20521,20390,20718,20132,
+20202,20139,20301,20212,20118,19848,19853,19728,
+19811,19850,19943,20559,21634,23520,23913,24983,
+25755,26150,26020,27078,29218,32273,31995,32350,
+32855,31665,31227,33632,34601,33831,32760,32600,
+32868,33765,33969,33065,32949,32778,32704,32694,
+32907,32994,32994,32909,32883,32985,32891,32847,
+32969,33266,34017,34452,34854,35322,35820,35894,
+35782,35728,35787,35827,35850,35671,35280,35354,
+35733,35991,36374,36603,36618,36674,36728,36273,
+36075,36066,35808,35971,36525,36258,36009,35970,
+35901,36011,36043,36016,35874,35571,35335,35181,
+35059,34975,34900,34930,35012,35007,34855,34623,
+34519,34477,34442,34525,34614,34699,34856,35002,
+35300,35512,35722,35887,36081,36348,36411,36702,
+37021,37129,37289,37477,37583,37781,38088,38351,
+38621,38809,38912,38840,38734,38676,38596,38680,
+38935,39039,39126,39224,39356,39559,39826,39966,
+40092,40224,40410,40549,40614,40621,40635,40707,
+40866,41138,41351,41400,41441,41470,41489,41497,
+41505,41562,41677,41895,42045,42089,42069,41991,
+41810,41637,41473,41372,41229,41073,40848,40710,
+40500,40131,39789,39510,39221,38924,38667,38408,
+38190,37857,37503,37266,36572,35654,34563,33886,
+33244,32990,32960,32673,32507,32768,32967,33875,
+34804,35907,36859,37502,37716,38098,38503,38931,
+39135,39232,39296,39411,39639,39934,40178,40402,
+40571,40704,40794,40900,41028,41119,41171,41233,
+41294,41346,41385,41413,41451,41488,41526,41568,
+41621,41679,41773,41938,42021,42099,42149,42189,
+42218,42236,42243,42238,42232,42228,42205,42164,
+42114,42048,42000,41958,41910,41859,41809,41761,
+41724,41699,41674,41634,41592,41553,41513,41465,
+41405,41357,41272,41176,41101,41059,41022,41004,
+40995,41003,41031,41062,41090,41111,41127,41133,
+41132,41128,41116,41094,41067,41037,41004,40992,
+41006,41046,41082,41105,41103,41068,41058,41073,
+41106,41160,41214,41276,41316,41358,41411,41490,
+41565,41653,41705,41748,41784,41816,41842,41868,
+41888,41879,41837,41784,41727,41693,41669,41634,
+41577,41496,41411,41322,41220,41154,41123,41079,
+40972,40857,40779,40688,40603,40539,40485,40345,
+40188,40000,39869,39791,39725,39653,39593,39519,
+39416,39311,39258,39200,39153,39102,39046,39005,
+38980,38945,38905,38860,38820,38751,38707,38658,
+38610,38592,38583,38592,38611,38641,38688,38752,
+38823,38849,38964,39254,39396,39372,39307,39548,
+37235,35699,34659,33892,33038,34930,36805,36534,
+34472,35273,37622,35923,36323,37568,35905,36491,
+35424,33160,31791,31930,32536,31448,27658,28372,
+26940,26738,26999,27173,27742,29067,26022,26288,
+26112,27675,26093,25723,25260,25184,25410,26994,
+26314,27407,28295,26788,26049,24049,22445,21827,
+21736,21431,21264,21202,21078,20964,20888,20906,
+20922,20887,20983,21365,21408,20637,20355,20577,
+20709,20772,20621,20448,20385,20314,20352,20433,
+20409,20425,20604,20440,20619,20442,20555,20454,
+20306,20175,20192,20129,20147,20084,20070,19998,
+19968,19932,19944,19955,19947,19977,20052,20056,
+20038,20037,20049,20218,20249,20239,20222,20197,
+20173,20150,20135,20075,20111,20065,20016,20061,
+20082,20037,19987,20025,19972,20118,20166,20175,
+20189,20130,20161,20177,20110,20076,20046,19997,
+20016,20041,19905,20117,20088,20112,20547,20734,
+20856,20983,21490,21627,23016,22516,22815,23361,
+22768,22200,22538,22248,23264,23138,23186,23852,
+23485,23931,24015,24913,24012,23735,23821,25182,
+24863,24668,25206,24763,24628,24558,24594,24683,
+24260,24158,23666,23841,23985,24317,24333,24338,
+24651,25119,25279,25851,26129,26070,26046,25896,
+25660,25787,25762,26013,26156,25884,25938,25851,
+26124,25429,25234,25703,25509,24741,24273,23631,
+24896,26615,27733,27977,28315,28894,29392,29809,
+30407,31022,31458,31635,31650,30936,30511,29961,
+29598,29673,29796,30329,30650,30825,30831,31207,
+31026,31135,31119,31182,31197,31167,31128,31090,
+31101,31019,31044,31014,31078,31254,31561,31536,
+31562,31914,32139,31156,31713,32030,32545,32840,
+32988,32973,32982,32988,32995,32987,32955,32874,
+32550,32903,33119,34236,35433,36090,35204,32845,
+32914,34740,35854,36569,38316,38730,39056,39016,
+38628,37952,36704,34522,32991,32838,32977,32772,
+32514,32221,31908,31598,31337,31091,31028,30656,
+30000,29165,28137,27027,26097,25511,25238,24997,
+24788,24904,24909,24702,24250,23693,23553,23318,
+23175,23033,22872,22713,22639,22596,22560,22503,
+22407,22260,22097,21843,21564,21160,20921,20423,
+20511,20512,20725,20715,20678,20583,20643,20709,
+20783,20763,20723,20577,20388,20425,20410,20213,
+20145,20062,19970,19900,19813,19781,19763,19725,
+19641,19729,19842,20007,20253,20010,19872,19966,
+19921,19806,19803,19840,19816,19707,19887,19902,
+19809,19525,19451,19405,19282,19266,19275,19810,
+20259,23716,25041,25020,24484,25582,26463,27082,
+27886,28630,30454,32035,32299,32986,32982,31901,
+32688,32063,31181,33056,32721,32616,32630,32766,
+32876,32997,32990,32903,32837,32775,32697,32654,
+32635,32686,32846,32702,32904,32934,32971,32994,
+33047,33333,33549,33667,33757,33825,33876,34131,
+34204,34220,34301,34313,34398,34476,34200,33384,
+33771,33854,33993,34044,33963,34070,34276,34447,
+34548,34557,34523,34522,34400,33921,32913,32856,
+32901,32983,32987,33996,33483,32973,33001,33837,
+33570,32982,32997,32997,32997,32993,32956,33297,
+33828,34100,34493,34935,35385,35529,35697,35913,
+36082,36315,36468,36644,36971,37250,37593,37790,
+37931,38041,38028,37830,37506,37335,37146,37069,
+37296,37610,38188,38490,38694,38921,39092,39308,
+39597,39837,40044,40215,40376,40429,40427,40406,
+40377,40398,40490,40674,40872,41069,41133,41182,
+41223,41241,41249,41298,41493,41740,41822,41835,
+41733,41570,41415,41323,41229,41125,41033,40855,
+40690,40483,40209,39933,39669,39430,39216,39013,
+38764,38341,38128,37832,37717,37597,36843,35763,
+33448,33656,32966,32675,32225,32014,32217,32729,
+33475,34288,35613,36769,37526,37779,37993,38165,
+38352,38601,38875,39044,39229,39402,39620,39892,
+40090,40290,40485,40604,40690,40767,40842,40935,
+41016,41085,41108,41149,41196,41241,41268,41293,
+41313,41327,41347,41376,41407,41477,41589,41685,
+41761,41824,41866,41882,41855,41817,41778,41734,
+41695,41655,41586,41527,41478,41438,41408,41388,
+41373,41352,41333,41314,41287,41250,41205,41155,
+41106,41048,40986,40929,40869,40813,40792,40788,
+40791,40794,40803,40827,40854,40888,40926,40946,
+40929,40881,40812,40740,40637,40550,40515,40519,
+40530,40537,40545,40551,40572,40605,40664,40735,
+40792,40839,40893,40953,41028,41074,41097,41130,
+41190,41253,41301,41334,41358,41374,41387,41371,
+41337,41305,41283,41275,41259,41253,41247,41241,
+41236,41225,41193,41125,40926,40786,40807,40834,
+40842,40824,40797,40747,40689,40616,40516,40360,
+40198,39998,39894,39802,39701,39593,39465,39325,
+39258,39163,39061,38991,38911,38830,38748,38677,
+38601,38511,38448,38381,38303,38176,38151,38167,
+38133,38109,38132,38160,38195,38214,38268,38325,
+38368,38394,38490,38655,38821,38793,38588,37771,
+36116,35264,34345,33075,36000,37785,34680,33224,
+34981,36607,37096,34584,33813,32751,33182,32982,
+32470,32215,31185,29874,27588,26390,25997,26069,
+27216,28024,25415,26589,26051,25725,25835,25471,
+26156,25372,24963,24006,23328,25042,28234,26196,
+23610,23615,23784,24415,22689,21759,21109,21053,
+20904,20551,20623,20772,20859,20361,20685,20688,
+20787,20663,20793,20803,20721,20722,20643,20515,
+20390,20513,20527,20483,20499,20467,20340,20307,
+20367,20298,20177,20099,20104,19981,20374,20380,
+20273,20457,20322,20346,20424,20456,20459,20319,
+20088,19978,20063,19993,19910,19869,19889,19890,
+19881,19935,19953,20045,20076,20103,20053,20090,
+20035,19988,19932,19980,19941,19974,19997,20016,
+19988,19919,19897,19969,19980,20025,20049,20043,
+20000,19977,19986,19778,19881,19882,19875,19812,
+19763,19701,19854,19838,19969,20301,20434,20844,
+20829,21351,21353,21396,21699,22404,22324,22601,
+23030,22971,22852,22587,23212,23164,22479,23277,
+24030,23463,23661,22870,22386,22856,24207,24168,
+24266,24834,24597,25058,24425,24344,23578,23447,
+23167,22848,22345,22485,22500,22507,22523,22874,
+22977,22952,22557,23017,23115,22320,22505,21753,
+21895,22023,22340,22314,22899,22465,22269,21608,
+21315,20967,21731,21737,21645,21748,21470,21354,
+21027,21030,20859,20460,21006,21001,22018,23145,
+24494,26633,27222,27408,26827,25951,25139,24217,
+23843,23710,24156,24429,25374,26424,27307,28188,
+28968,30039,31089,31588,31644,31157,31128,31388,
+31362,31353,31373,31270,31280,31359,31467,32134,
+31734,31777,31748,32391,31378,31377,31524,32298,
+32770,32988,32993,32961,32997,32997,32997,32997,
+32990,32992,33069,32996,34882,35502,32905,32944,
+34206,35892,37185,38358,38817,38937,39131,38873,
+37985,37072,35028,32994,32851,32841,32986,32645,
+32045,31554,31538,31462,31266,31004,31181,30543,
+29695,28798,27618,26035,24710,24258,24021,23865,
+23729,23637,23649,23547,23315,23078,22821,22660,
+22449,22251,22064,21960,21932,21936,21951,21995,
+21906,21918,21798,21660,21596,21361,21236,20843,
+20535,20475,20406,20569,20691,20417,20401,20353,
+20346,20266,20244,20082,20076,20034,19962,19941,
+19938,19809,19746,19649,19565,19507,19446,19375,
+19399,19356,19460,19496,19559,19664,19776,19801,
+19849,19864,19813,19639,19509,19240,19434,19462,
+19313,19335,19276,19271,19308,19273,19008,18894,
+18933,18958,19209,19671,19881,21999,24914,25617,
+26190,26985,27028,26542,27753,29332,28767,28781,
+27618,30846,28687,29324,32200,32119,31949,31979,
+31752,32047,32981,32891,32783,32484,32205,32416,
+32822,32984,32995,32946,32937,32927,32916,32913,
+32997,32997,32997,32997,32987,32802,32835,32925,
+32927,32997,32997,32995,32917,32619,32486,32847,
+32937,32997,33019,32991,32998,32991,32917,32911,
+33805,32987,32997,32979,32966,33019,33004,32997,
+32997,32997,32997,33090,32912,32996,32997,32791,
+32312,32992,32995,32996,32997,32995,32997,32997,
+32997,32767,32738,32912,33126,33482,33972,34227,
+34613,34814,35171,35364,35939,36567,36580,36767,
+36971,36918,36599,36210,35676,35145,34803,35904,
+36501,36849,37510,37997,38432,38640,38853,39177,
+39406,39587,39716,39879,40062,40152,40177,40194,
+40204,40218,40230,40254,40296,40362,40461,40651,
+40901,41036,41088,41139,41244,41354,41402,41427,
+41412,41367,41302,41232,41170,41119,41052,40898,
+40788,40663,40497,40198,39846,39486,39334,39105,
+38837,38326,37783,37461,36871,35778,34381,33258,
+33153,33048,32670,32070,31887,32064,32515,32990,
+32894,33415,34538,35827,36576,37030,37280,37267,
+37278,37393,37653,37863,38087,38448,38841,39124,
+39385,39658,39839,39986,40141,40240,40339,40423,
+40480,40521,40592,40677,40751,40795,40837,40879,
+40918,40940,40941,40977,41037,41083,41125,41215,
+41306,41365,41395,41423,41438,41434,41410,41392,
+41363,41304,41232,41163,41116,41090,41046,41006,
+40968,40925,40899,40886,40878,40864,40850,40828,
+40809,40794,40749,40687,40636,40588,40550,40524,
+40511,40510,40511,40524,40545,40576,40621,40637,
+40587,40518,40479,40437,40380,40293,40234,40216,
+40218,40233,40254,40269,40274,40258,40285,40333,
+40378,40428,40478,40507,40530,40580,40719,40829,
+40875,40914,40942,40960,40956,40926,40892,40860,
+40835,40824,40814,40812,40809,40814,40831,40865,
+40898,40908,40884,40816,40742,40666,40641,40651,
+40670,40678,40680,40677,40668,40635,40516,40242,
+40112,39980,39888,39721,39543,39300,39165,39054,
+38948,38799,38667,38554,38473,38372,38209,38124,
+38044,37947,37856,37701,37608,37551,37504,37463,
+37456,37461,37489,37535,37596,37685,37773,37869,
+37907,37825,37673,37720,37941,37969,37629,36570,
+34521,33936,32994,32988,32850,32959,31920,32083,
+32973,32988,32988,32933,32846,32042,31910,29905,
+27468,26364,26151,26126,25344,25346,25771,27171,
+27813,25262,27117,26118,25189,24066,22821,23641,
+23801,23163,22891,22334,22689,22294,22572,22158,
+21684,22104,21709,21249,21450,21034,20742,20806,
+20643,20907,20725,20700,20724,20706,20457,20664,
+20748,20715,20894,20881,20793,20805,20824,20658,
+20775,20737,20657,20634,20635,20461,20527,20739,
+20728,20812,20961,21015,20910,21530,20508,20370,
+20946,20892,20898,20911,20854,20585,20490,20597,
+20164,20446,20382,20016,19866,19727,19808,19800,
+19890,19835,19895,19855,19864,19814,19974,19938,
+19930,19909,19949,19951,19827,19954,19962,19788,
+19818,19921,19960,19973,19943,19955,19953,19944,
+19934,19911,19725,19790,19835,19775,19788,19730,
+19728,19721,19289,19921,19981,20136,20421,20504,
+20729,21237,20990,22437,23610,24084,23697,22728,
+21777,22799,25488,28199,23871,23391,25173,25545,
+21968,24064,22135,21738,21795,22125,25071,25245,
+24170,24438,24632,24444,24125,23990,23376,22914,
+22628,22210,22171,21632,21436,21404,21558,22126,
+22369,22489,22335,22258,22164,21910,21711,21639,
+21456,20936,21000,21592,21546,21271,21375,21639,
+21100,20879,20594,20976,19951,20331,20611,20688,
+20569,20477,20273,20237,20168,20124,20109,19977,
+19974,20285,21630,22741,22479,22004,22246,21348,
+21360,21511,21868,21978,22571,22899,23652,24636,
+26005,26547,27090,27746,28277,28738,28230,28013,
+28552,29934,30815,31401,31397,31292,31197,31331,
+31503,31234,31328,31658,31741,32127,32987,32974,
+32948,33894,32959,32897,32928,32835,32922,32946,
+32976,34546,35845,35748,39528,32401,31902,33823,
+34783,35874,36765,37655,37864,38386,39420,38648,
+38456,36135,33525,32919,32862,32927,32935,32747,
+32469,32129,31850,31644,31514,31402,31509,30607,
+29670,28653,27268,25829,24598,23966,23644,23375,
+23041,22913,22986,22791,22655,22533,22243,21922,
+21822,21606,21555,21412,21345,21351,21360,21386,
+21432,21456,21492,21498,21396,21339,21132,20802,
+20405,20385,20338,20332,20382,20361,20343,20286,
+20184,20094,19998,19903,19832,19805,19772,19752,
+19694,19553,19587,19530,19471,19306,19296,19232,
+19206,19114,19159,19179,19259,19296,19294,19314,
+19318,19334,19395,19296,19242,19245,19203,19266,
+19245,19179,18917,18910,19074,18988,18918,18860,
+18791,18533,18271,18396,18876,19365,19755,20328,
+20827,21170,22498,24276,26329,27592,23493,25269,
+26310,25525,25889,25185,25737,26000,26636,25869,
+24393,24914,24732,24554,25034,29227,29880,29970,
+32813,30901,29316,28810,28455,28698,28247,28115,
+28180,28177,29432,30201,30220,30804,31128,31155,
+31366,32319,31722,32019,32103,32838,32988,32988,
+32988,32905,32894,32997,32997,32997,32997,33116,
+33391,32968,32996,32997,32784,32322,31077,29313,
+32163,31386,30414,29085,27952,26418,25314,24982,
+25169,25079,26299,26825,29344,31995,32497,32742,
+32854,32997,32997,32997,32997,32997,32997,32716,
+32475,32836,34006,34877,35532,34872,33771,34176,
+34866,34125,33324,33857,33054,32880,34150,34666,
+35488,36327,36892,37572,37793,38211,38450,38975,
+39286,39473,39605,39711,39780,39774,39743,39695,
+39633,39573,39573,39651,39947,40137,40247,40320,
+40338,40440,40730,40847,40947,41046,41101,41121,
+41129,41118,41109,41064,40998,40924,40749,40581,
+40466,40332,40136,39748,39440,39283,39072,38983,
+38868,38447,37914,37266,36734,36058,35490,34315,
+33554,33602,32934,32586,32484,32598,32715,32731,
+32639,32577,32799,32997,33585,32985,32965,33505,
+35267,35678,36260,36726,37118,37465,37694,38062,
+38563,38970,39225,39354,39450,39550,39700,39870,
+39949,40024,40099,40159,40197,40248,40311,40367,
+40408,40454,40493,40531,40596,40676,40750,40804,
+40892,40983,41052,41094,41126,41139,41142,41119,
+41087,40998,40889,40803,40726,40647,40588,40550,
+40521,40512,40505,40504,40510,40518,40521,40518,
+40514,40503,40485,40437,40377,40305,40246,40207,
+40194,40194,40203,40219,40224,40216,40206,40149,
+40029,39859,39678,39570,39504,39483,39495,39514,
+39539,39565,39588,39616,39667,39729,39780,39834,
+39874,39922,40004,40096,40153,40194,40222,40265,
+40355,40461,40562,40594,40594,40582,40559,40527,
+40500,40485,40474,40449,40417,40417,40458,40511,
+40606,40653,40649,40633,40587,40518,40442,40368,
+40327,40318,40327,40336,40310,40213,40155,40105,
+40064,39932,39693,39504,39289,39104,38753,38584,
+38391,38142,37990,37855,37652,37433,37330,37342,
+37320,37273,37188,36901,36732,36633,36588,36567,
+36535,36538,36549,36569,36634,36787,36930,36987,
+37038,36873,36564,36153,36630,36702,36029,34640,
+32996,31946,30854,31106,32604,31907,32196,31572,
+30385,29655,28050,27874,28465,27340,26830,26638,
+25989,25384,25032,25108,25145,25332,26325,26765,
+24942,26368,25900,24807,24130,23191,22162,22481,
+23237,22689,22516,22575,22335,22200,21735,21945,
+21658,21158,23883,22788,21284,21510,21257,20821,
+20889,21187,21226,20877,20559,20694,20430,20579,
+20759,20554,20541,20646,20868,21095,21208,21330,
+21243,21207,21078,20972,21025,21246,21063,20796,
+21001,20969,21065,21215,21052,21114,20799,21465,
+21324,21373,21075,21138,21105,20891,20400,20058,
+20406,20271,20265,20150,19908,19590,19806,19741,
+19737,19819,19864,19891,19660,19872,19836,19713,
+19908,19840,19992,19992,19853,19863,19793,19871,
+19932,20003,19875,20037,20024,19968,19980,19836,
+19871,19805,19676,19779,19737,19490,19636,19644,
+19772,19911,19863,20013,20083,19988,20439,21026,
+20523,23166,25100,23337,21532,21771,22009,21689,
+21838,21836,21951,21601,21666,20912,21917,21611,
+21395,23262,22662,21809,25527,29318,23311,22648,
+23541,23223,22047,22058,22367,23138,21741,21189,
+21158,21113,22608,21204,20827,20958,21124,22294,
+21799,22165,22089,21781,21629,21073,21060,21027,
+21507,20944,20231,20302,20880,21308,20705,20418,
+20628,20679,20820,20535,20270,20407,20483,20229,
+19923,19719,19803,19644,19641,19685,19677,19780,
+19960,20091,20587,21330,21345,21015,20787,20358,
+20384,21839,22025,22465,22484,22569,22587,22911,
+23367,24318,24246,24498,24642,24417,23814,24085,
+23862,24246,25098,25711,26396,27418,27869,28724,
+28693,31176,30562,30102,31629,31743,31764,31776,
+32043,32319,32022,31288,31926,32401,32568,32787,
+35031,35967,39253,34827,32620,30936,32298,32997,
+32994,32948,34031,35866,37573,38280,38274,36897,
+34982,34611,32812,33856,32898,32853,32811,32573,
+32080,31931,31896,31814,31896,31812,31471,30788,
+29547,28326,27138,26157,25161,24625,24244,23956,
+23729,23466,23254,23089,22829,22599,22459,22230,
+21941,21652,21364,21076,21032,21047,20953,20867,
+20875,20979,21058,21014,21004,20934,20779,20586,
+20316,20141,20049,20110,20075,20135,19988,19932,
+19882,19804,19742,19644,19790,19674,19593,19542,
+19617,19401,19430,19383,19266,19197,19239,19128,
+19014,19026,19005,18903,19025,18983,19014,18979,
+18941,18900,18933,18945,18911,18956,18903,18874,
+18925,18957,18916,18851,18835,18847,18814,18840,
+18684,18529,18698,18531,18765,18926,18599,18698,
+19570,20695,21248,21111,20778,22894,22505,22431,
+22600,22933,24051,25098,26815,27087,26551,23931,
+24159,23088,22748,23377,24228,25275,26066,26232,
+26989,27110,24440,24473,23653,24101,24047,24336,
+25111,26025,26748,26638,27736,27283,26529,25263,
+24480,25477,24414,25109,26338,28828,29632,30970,
+30762,30681,30480,30397,30526,30641,30491,30242,
+29837,29399,28846,27674,25995,26194,25124,25187,
+25787,25731,25761,25221,24525,24054,23097,23560,
+23647,23506,24426,24875,24603,23813,24870,26649,
+27500,28413,30764,32808,32997,32997,32997,32997,
+32769,32936,32988,34569,34148,33778,32995,32912,
+32952,32718,32349,32307,32112,32166,32848,32997,
+35301,35996,36765,36933,37171,37542,38061,38514,
+38636,38793,39108,39213,39174,39051,38872,38604,
+38475,38431,38455,38575,38785,38992,39551,40098,
+40194,40234,40296,40400,40489,40587,40647,40570,
+40440,40356,40351,40437,40215,40139,40020,39880,
+39668,39518,39375,39183,38946,38728,38655,38574,
+38482,38250,37893,37407,37085,36649,36267,35592,
+34079,33103,33000,32992,32880,32864,32987,32997,
+32940,32983,32916,31572,31157,30641,30976,31596,
+31830,32994,34082,34713,35580,36273,36605,37144,
+37488,37915,38390,38709,38784,38859,38951,39060,
+39183,39278,39384,39481,39550,39591,39632,39690,
+39767,39831,39885,39934,39987,40053,40110,40184,
+40281,40387,40470,40529,40590,40651,40659,40638,
+40620,40554,40485,40384,40305,40252,40221,40192,
+40178,40190,40219,40254,40270,40293,40313,40312,
+40290,40241,40183,40110,40047,39975,39925,39897,
+39881,39862,39835,39796,39755,39651,39562,39465,
+39426,39372,39102,38930,38959,39021,39087,39124,
+39165,39197,39171,39129,39107,39080,39105,39120,
+39217,39320,39426,39560,39651,39781,39932,39987,
+40015,40044,40081,40074,40081,40053,39979,39887,
+39802,39735,39678,39669,39750,39891,40057,40192,
+40284,40395,40485,40525,40536,40501,40367,40232,
+40179,40156,40160,40164,40157,40127,40072,39963,
+39602,39338,39259,39139,38710,38340,38043,37907,
+37784,37659,37489,37216,36889,36641,36557,36518,
+36552,36579,36543,36365,36165,35813,35558,35516,
+35550,35574,35629,35613,35445,35000,34768,35288,
+35286,34755,33035,34876,34428,32776,32196,32428,
+32420,31427,30993,30902,28397,26718,26559,26621,
+26503,26873,26431,26320,26299,26406,26092,26040,
+25398,25467,24927,24591,24346,24540,24185,23372,
+25236,25516,24321,23517,22743,22089,22016,22151,
+22243,22185,22385,22509,22350,22298,22993,22325,
+22336,23540,28788,24791,23112,22238,22111,21717,
+21326,21374,22776,20269,20387,20716,20432,20385,
+20325,20252,19944,20068,21354,21977,21174,21100,
+21651,21702,21763,21345,21457,21462,21342,21498,
+21453,21350,21307,21210,20500,21057,21423,20952,
+20719,20812,21202,21037,21582,20401,20168,21027,
+20920,20463,20430,20127,20163,20721,19646,19617,
+19795,19935,19892,19500,19778,19862,19461,19916,
+19908,19794,20172,19932,19625,19956,19924,19942,
+20064,20116,20157,19954,20066,20102,19717,19957,
+19953,19708,19646,19710,19584,19557,19661,19874,
+19923,20025,19928,19945,20007,20276,20301,20379,
+20628,20337,20817,20663,20411,20904,21774,22091,
+22164,21613,21908,21213,21619,21144,20947,20892,
+20437,20252,20160,20075,20166,20221,20378,20043,
+20909,21736,21098,20964,22710,20780,20726,20648,
+20631,20682,20510,20568,20256,20529,20784,20992,
+21785,21184,21175,21479,21163,20580,20508,20529,
+20924,20773,20255,20116,20235,20292,20617,20366,
+20272,20529,20414,20463,20212,20138,19837,19695,
+19618,19596,19488,19526,19416,19532,19560,19643,
+19768,19725,19797,20047,20348,20496,20046,20224,
+20709,23235,32894,28137,22125,21563,21956,22101,
+22344,22503,23022,23184,22908,22635,22275,21864,
+22403,22823,23094,22719,22534,22788,22555,23426,
+24229,24723,25832,23530,25076,24549,31099,31578,
+31474,31273,31643,31665,31800,31467,31644,32359,
+32726,32736,32751,32553,30699,32423,32535,32538,
+32250,32589,34971,37149,35726,35489,35426,32994,
+33818,32895,32772,32804,32908,32988,32993,32809,
+32550,32265,32030,31926,31803,31852,31764,31193,
+29395,28391,27118,26094,25167,24787,24435,24036,
+23973,23703,23517,23319,23112,22970,22847,22700,
+22527,22485,22171,21831,21526,21236,20973,20775,
+20650,20556,20556,20680,20688,20412,20442,20304,
+20172,19995,20047,20040,19927,19867,19675,19826,
+19716,19631,19614,19572,19586,19470,19453,19441,
+19342,19269,19230,19137,19095,19165,19072,19014,
+18945,18870,18843,18845,18678,18776,18729,18671,
+18612,18672,18741,18735,18669,18541,18671,18651,
+18515,18613,18724,18615,18532,18640,18541,18606,
+18608,18761,18554,18775,18617,18526,18453,18737,
+18594,18902,19167,19479,19904,20831,21249,21415,
+22834,23328,23941,24638,25771,25249,23626,23144,
+21789,21166,21494,21660,21939,22307,21510,22857,
+21291,20931,20721,21252,21212,21274,21913,22679,
+23277,23301,23677,23957,24108,23422,23637,23547,
+23829,23056,23763,23211,24602,25944,28156,28910,
+27736,26255,25738,25287,25327,24944,24487,24354,
+24534,24118,22935,22521,22317,23732,21930,21720,
+22123,22519,22037,21918,22542,22451,22576,22524,
+21910,22466,22677,22803,23132,23244,22712,22675,
+23320,23914,25881,26332,29106,31146,32676,32544,
+32829,32961,33784,33937,33620,32989,32784,31620,
+31392,31361,31230,31517,31845,32303,32778,32532,
+32713,34104,35509,36250,36495,36765,36900,37308,
+37613,37974,38060,37859,37792,37792,37708,37520,
+37372,37470,37599,37923,38193,38330,38871,39495,
+39711,39831,39848,39789,39555,39028,38776,38794,
+38986,39421,39509,39525,39448,39279,39075,38814,
+38672,38664,38669,38598,38489,38359,38185,37998,
+37790,37554,37218,37071,36921,36621,36408,35991,
+35498,34718,33911,32986,32995,32968,32992,32653,
+32143,30858,30615,30804,30930,31007,30981,30825,
+30744,30390,31173,32775,33603,34674,35464,36325,
+36797,37130,37390,37527,37620,37698,37813,38046,
+38304,38577,38739,38829,38866,38842,38784,38748,
+38737,38814,38980,39090,39180,39251,39303,39375,
+39479,39576,39636,39714,39804,39891,39994,40058,
+40076,40020,39936,39867,39766,39687,39631,39599,
+39573,39555,39576,39641,39771,39899,39966,39997,
+39984,39942,39871,39793,39731,39663,39612,39590,
+39536,39441,39357,39268,39108,38949,38822,38718,
+38569,38386,38295,38266,38297,38364,38430,38430,
+38400,38328,38237,38183,38190,38196,38219,38302,
+38404,38502,38640,38786,38969,39107,39243,39306,
+39358,39381,39373,39339,39339,39350,39312,39218,
+39089,39012,38985,38991,39037,39140,39264,39439,
+39642,39912,40065,40170,40221,40241,40182,40108,
+40105,40128,40141,40101,39960,39689,39402,39250,
+39112,38746,38408,38197,37717,37221,36910,36822,
+36809,36808,36381,35856,35034,34677,34909,35410,
+35374,35433,35711,35548,35253,34860,34080,33845,
+33973,33363,33748,33904,34582,33164,32841,31953,
+32309,32529,32178,31880,30998,29610,29524,29289,
+29012,28308,27508,26950,26675,26188,25839,25588,
+26146,25346,25743,26065,25901,25495,25340,25467,
+25627,24791,23653,24728,24012,24237,23277,23741,
+24127,23643,23131,22435,21998,22005,22098,21982,
+22515,22362,22443,22424,22570,22441,22322,22696,
+25082,24681,24215,23509,22891,22477,22431,21960,
+21427,21173,20607,20261,20346,20323,21074,22318,
+22836,20850,21021,21699,21705,22344,22540,22344,
+21870,22006,21803,21741,21763,21639,21699,21784,
+21648,21822,22119,21852,21866,21056,21141,21147,
+21384,20196,20444,19281,20526,20742,20661,20746,
+20591,20405,20391,20524,20249,20089,19913,20134,
+19810,19650,20021,19646,19792,20083,20073,20100,
+20366,20226,20339,19998,19654,20051,19440,19576,
+20068,20145,19998,20193,20225,19993,20223,19886,
+19791,19889,19204,19759,19624,19497,19841,19796,
+19828,19690,19586,20075,19752,20038,20076,20112,
+20184,20033,20519,20359,20605,20755,21998,21087,
+21117,21106,20998,20913,20820,20650,21320,20591,
+20536,20307,20376,19659,20379,20329,22116,21222,
+20466,20616,20795,21366,20681,20588,20397,20472,
+19985,19895,19746,19956,20210,20352,20414,20498,
+21240,20604,20736,20857,20863,20460,20034,19962,
+20660,20762,19981,19888,19638,19575,19534,19697,
+19908,19817,19755,19811,19671,19430,19461,19473,
+19421,19229,19375,19424,19473,20097,19683,19532,
+19551,19578,19820,19887,19593,19626,19672,20145,
+20157,20540,21003,20907,21300,21746,21241,21264,
+21124,21461,21877,22201,21728,20835,21558,21101,
+21035,21915,22164,21636,21698,21779,21056,21078,
+20979,21171,21554,21685,21670,22231,22487,23128,
+24843,31044,31575,31383,31371,31882,31719,31863,
+32378,30558,30904,30569,31584,31566,31220,31929,
+32303,32361,32409,37961,37154,33001,32840,32651,
+32700,32812,32865,32831,32634,32680,32898,32368,
+31800,31657,31557,31626,31670,31989,32080,31529,
+29861,28406,27132,26053,25155,24609,24283,23964,
+23636,23450,23268,23125,22879,22664,22515,22499,
+22425,22478,22353,22212,21934,21681,21313,20955,
+20702,20478,20229,20232,20085,20207,20166,20077,
+20100,20091,20049,19969,19839,19758,19565,19677,
+19673,19633,19664,19627,19581,19649,19579,19484,
+19400,19260,19179,19174,19123,19092,19041,18984,
+18933,18870,18751,18774,18718,18697,18623,18637,
+18578,18507,18543,18502,18436,18328,18346,18356,
+18366,18547,18561,18527,18484,18353,18469,18576,
+18564,18439,18384,18310,18430,18333,18274,18334,
+18234,18158,18569,18566,19185,19276,22013,19689,
+20503,20782,20452,19250,19384,19768,20583,20955,
+21058,21447,21180,20393,20166,19851,19938,19915,
+19933,19740,19747,19742,19689,21105,21282,21804,
+22100,22464,22083,22022,21578,20884,21548,21633,
+22250,22187,22473,22981,24189,25162,27246,28217,
+26231,25308,24519,23704,22616,22342,22170,21903,
+21461,21677,20892,20885,20961,21504,21286,21148,
+21114,21303,21144,20970,20662,21454,21820,22295,
+22504,22372,22116,21899,22165,22176,21937,22353,
+22719,23148,23493,22290,22923,23806,27853,30898,
+31704,31595,31561,31898,31845,30362,30096,29676,
+28056,28356,27856,25927,26078,26803,29589,31973,
+31850,31982,32369,32677,32595,34931,35895,36188,
+36328,36566,36484,36390,36384,36519,36785,36186,
+35060,35187,36456,37302,37733,38082,38361,38765,
+38923,39204,39354,39411,39243,38391,38076,37540,
+38208,38364,38442,38577,38511,38170,37476,37312,
+37365,37353,37308,37311,37468,37437,36964,36629,
+36367,36282,36208,36148,35830,35649,35601,35534,
+35322,35047,34793,33309,32538,31865,31139,31194,
+31108,30626,30930,30940,31149,31327,31296,31380,
+31531,31409,31305,31653,32421,32887,34559,35245,
+36022,36582,36790,36832,36822,36846,36884,36958,
+37286,37521,37668,37723,37716,37695,37614,37567,
+37564,37715,37926,38103,38300,38463,38660,38775,
+38872,38948,39003,39058,39088,39122,39165,39202,
+39190,39145,39076,38993,38867,38744,38696,38699,
+38726,38779,38856,38988,39127,39235,39312,39390,
+39477,39496,39470,39406,39342,39285,39214,39147,
+39042,38876,38646,38499,38340,38141,37993,37823,
+37699,37560,37426,37275,37180,37131,37090,37070,
+37077,37119,37127,37074,37014,36982,37069,37220,
+37437,37659,37872,38089,38226,38367,38511,38652,
+38751,38823,38824,38783,38706,38571,38394,38320,
+38338,38321,38307,38323,38371,38428,38626,38801,
+38907,39022,39148,39306,39557,39623,39626,39619,
+39605,39585,39488,39247,39069,38973,38805,38515,
+38220,37978,37737,37230,37037,36237,35665,35290,
+35655,36006,35779,34927,34091,32873,32887,32997,
+32995,32919,32788,32874,32673,32714,32440,32024,
+31452,31649,32609,32905,32844,32208,32386,31982,
+31776,31636,32112,31296,29750,28428,27549,27283,
+26910,26629,26443,26119,25873,25755,25170,25389,
+25804,25253,24919,25285,25119,26096,25875,25926,
+24717,24564,23826,23762,23933,23586,23350,23586,
+23313,23223,27912,26031,22746,22604,22953,23222,
+22614,22741,23017,24442,22303,22567,24000,24708,
+27996,26047,22823,23071,24395,22083,22227,21836,
+21712,21397,21240,21780,22724,21943,21740,22593,
+22310,21876,22316,22966,22030,22017,21957,22325,
+22173,22061,21905,21625,21789,21806,22410,22122,
+22054,22108,22155,22561,21576,21797,21774,21383,
+20166,21356,22038,21469,21204,21127,20975,20691,
+21583,20886,21048,20644,20526,21277,20533,19827,
+19580,19695,19800,20502,19580,20706,20397,20833,
+20004,20650,20632,20460,19841,20581,20271,20254,
+20321,19928,20060,20264,20174,20301,20038,20499,
+19725,20925,21146,20339,19780,19785,19749,19827,
+19627,19476,19446,19608,19649,20094,20234,19951,
+19737,19644,19935,20196,20229,20322,20210,20400,
+20187,20447,20755,20215,20421,20585,20724,20629,
+20342,20085,19668,20378,19668,20125,20133,19770,
+20087,19932,20046,20037,20115,20034,19898,19832,
+19425,19488,19385,19657,19788,19916,20136,20235,
+20268,20369,20471,20765,21247,20448,20380,19599,
+19678,19659,19473,19524,19268,19293,19228,19100,
+19263,19365,19313,19292,19236,19242,19206,19192,
+19181,19250,19272,19293,19316,19279,19313,19262,
+19375,19519,19577,19406,19535,19350,19362,19500,
+19626,19707,20198,20397,20573,20675,20957,20559,
+20544,20625,21135,20901,20870,20838,20513,20636,
+20952,20982,20665,20910,21207,20904,20936,20681,
+20637,20577,20637,21256,21561,22288,23508,24485,
+23385,23899,25263,27299,32024,31127,31542,31911,
+31926,31736,30822,31218,31730,32525,32964,32246,
+32510,32256,34127,37082,34956,32949,32876,32549,
+32520,32577,32627,32563,32510,32558,32493,31952,
+31620,31608,31713,31422,31401,31857,31799,31533,
+30002,28383,26802,25803,24816,24220,23760,23369,
+23151,23060,22938,22826,22641,22501,22200,21882,
+21933,21990,21888,21723,21513,21308,21056,20919,
+20745,20559,20341,20202,20223,20220,20151,20049,
+19965,19935,19774,19726,19719,19631,19499,19483,
+19444,19459,19459,19436,19380,19332,19363,19317,
+19221,19277,19278,19247,19205,19124,19064,18957,
+18872,18845,18780,18700,18699,18678,18613,18529,
+18494,18474,18386,18401,18384,18371,18302,18302,
+18351,18344,18375,18415,18429,18369,18412,18348,
+18330,18324,18405,18438,18388,18275,18316,18272,
+18641,18658,18744,18309,18247,18501,19182,18389,
+18540,18513,18714,18625,18708,18966,19186,19457,
+19824,20198,20535,20183,19499,19467,19418,19286,
+19508,19547,19282,19527,20427,19853,19722,20892,
+19752,19737,19756,19603,20022,20304,20307,20790,
+21331,21683,22851,24253,24446,25280,26697,27046,
+25607,24214,23345,22737,21906,21516,21384,21244,
+20977,20476,20249,20035,20028,20631,20757,20595,
+20906,20799,20489,19872,19800,20193,20366,20388,
+20657,21098,21573,21424,21789,21771,21502,22552,
+21735,22131,21496,21624,22373,23009,24492,28221,
+30404,30907,30503,29589,28262,23646,22665,23782,
+25168,25602,25140,22912,21920,22435,23223,25754,
+25579,25338,27363,30945,31947,31953,32358,32547,
+32819,33058,33869,33739,33602,35434,34598,34891,
+33840,33164,34531,35534,36403,37465,37773,37588,
+37429,37665,37836,37912,37649,37302,36906,36619,
+36393,36311,37536,37350,36902,36443,36144,35387,
+35460,35703,35317,35190,34983,34658,34891,34870,
+34653,34263,34171,33654,33184,32833,32861,32730,
+32645,32610,32832,33021,32431,31953,31668,31118,
+30978,31148,31125,31251,31465,31602,31779,31720,
+31823,31746,31752,31983,31950,31740,31706,31658,
+31755,32286,32681,33481,34032,34323,34671,35238,
+35678,36143,36327,36225,36339,36627,36710,36715,
+36705,36793,36978,37341,37563,37761,37903,37984,
+38080,38157,38187,38084,38115,38189,38264,38349,
+38407,38442,38508,38547,38546,37960,37593,37702,
+37793,37847,38007,38201,38388,38485,38613,38742,
+38838,38856,38791,38716,38612,38457,38219,37801,
+37900,37743,37576,37434,37183,36988,36837,36495,
+36312,36201,35930,35719,35597,35712,35926,36150,
+36217,36201,36091,35884,35753,35834,36030,36196,
+36301,36483,36762,36954,37064,37170,37396,37422,
+37491,37722,37812,37749,37674,37570,37408,37255,
+37155,36960,36963,37146,37357,37543,37593,37458,
+38190,38353,38595,38717,38772,38809,38797,38701,
+38569,38484,38517,38517,38517,38472,38362,37905,
+37509,37101,36955,36890,36804,36066,34826,34799,
+32951,33253,34361,34529,33862,32678,29487,32037,
+32989,32913,32277,31899,31577,31329,31410,31476,
+31524,31518,31557,31859,31998,31818,31506,31374,
+31337,31505,31560,29541,26860,26397,25941,25991,
+25743,25552,25527,25401,25316,25220,25186,25672,
+25144,26857,26044,27066,27513,29711,28304,26953,
+28594,25860,24863,23830,23397,23565,23423,23425,
+25558,24984,23751,22996,22872,22340,22458,22502,
+22115,22325,22423,22589,22748,26274,23244,24021,
+26302,22767,21991,21744,21231,22032,22815,22681,
+23040,26076,23353,22888,22909,23291,22611,22851,
+22608,23516,21979,21842,22236,22818,22832,22588,
+22521,22414,21893,22054,23799,21221,21068,22620,
+22104,22230,22596,21448,21425,22913,22009,22030,
+21642,21407,20497,21122,21312,21185,21719,21242,
+20871,20898,21650,21286,20430,20828,20619,20610,
+20579,20922,20049,19930,20681,20327,20773,20332,
+20751,20661,20912,20655,19917,19785,20275,21018,
+20921,20756,20451,20250,20070,20301,19990,20330,
+20654,19636,20348,20554,20225,19974,19905,19822,
+19905,19138,19495,19436,19308,19233,19457,19381,
+19455,19639,19913,20149,20082,20022,19554,19936,
+19770,19701,20072,19979,19892,19955,20259,20794,
+20636,20016,19833,19982,19933,19749,19653,19818,
+19596,19734,19512,19464,19454,19376,19503,19191,
+19223,19236,19180,19530,19589,19590,19365,19607,
+19952,20137,20313,20468,20494,20293,20133,19644,
+19426,19247,18993,19062,19031,18954,18776,18764,
+18872,18945,18896,18880,19017,19020,19016,19045,
+19073,19072,19083,19162,19079,19293,20028,19134,
+19689,19294,19319,19063,19177,19587,19650,19293,
+19031,19689,19533,19897,20097,20074,20040,19974,
+20064,20301,20525,20533,20235,20203,20094,19904,
+20028,20223,20310,20069,20429,20696,20610,20538,
+20720,21045,21459,21756,22033,22502,22241,21884,
+22659,23676,24798,24351,25110,32052,31370,31775,
+31704,31615,31506,31131,31851,31517,33563,35892,
+33526,36516,33999,36399,34983,36290,32979,32325,
+32113,32358,32568,32664,32685,32619,32606,32325,
+31983,32052,31537,31509,31551,31377,31177,30963,
+29802,28276,26859,25765,24755,24094,23486,23183,
+22830,22524,22308,22152,21724,21617,21903,21669,
+21051,21058,21046,20940,20752,20673,20718,20676,
+20608,20400,20316,20178,20065,19869,19833,19728,
+19725,19649,19558,19553,19526,19507,19434,19395,
+19338,19242,19251,19186,19170,19176,19161,19145,
+19112,19092,19093,19082,19046,18946,18855,18786,
+18693,18654,18724,18704,18675,18601,18520,18460,
+18460,18276,18387,18356,18360,18323,18151,18258,
+18282,18327,18248,18292,18267,18189,18196,18156,
+18204,18264,18288,18277,18313,18146,18158,18670,
+18201,18114,18507,19214,18270,18606,18284,18494,
+18306,18610,18363,18411,18438,18570,18756,18708,
+19157,19552,20136,19607,19238,19200,18918,19045,
+19071,19098,19377,19411,20692,22643,20133,24045,
+23175,20541,20155,19982,20225,20295,20358,20333,
+20414,20589,21394,23259,22023,23923,26624,22872,
+23038,23247,22979,22771,22401,22750,21153,20443,
+20153,19773,19517,19317,19722,19899,20220,19870,
+20212,20145,19695,19269,19191,19389,19403,19643,
+19533,19815,19506,20352,20739,21048,21309,21197,
+21317,20944,20994,21042,21368,21473,21442,23948,
+28266,29487,29193,29591,23130,21650,22527,22101,
+21327,20816,20964,22815,20241,20496,22689,24337,
+24681,22713,22665,23377,24332,25262,26204,27668,
+30223,31846,31436,31504,31845,32961,32704,30954,
+32107,32983,32993,33250,34131,34205,35066,35316,
+35843,36397,36860,36887,36850,36655,35542,33688,
+32985,34827,34932,34479,33874,33373,32906,32978,
+32499,31977,31792,31707,31826,32115,32304,32542,
+32655,32624,32724,32364,31237,31804,31554,31751,
+31779,32370,31848,31938,32277,31875,31452,31320,
+31349,31335,31197,31584,31668,31758,31836,31858,
+32102,32076,32092,32251,32139,32091,31904,31394,
+31326,32069,32640,32982,32980,32821,32785,33073,
+33705,33954,33769,33913,34252,34692,35024,35308,
+35380,35411,35501,36222,36558,36660,36799,36912,
+36895,37125,37098,36892,36729,36771,36665,36855,
+37163,37317,37378,37280,37124,37204,35813,35855,
+36599,37300,37461,37575,37788,37924,38034,38066,
+38051,38078,38071,37911,37746,37381,37020,36392,
+36236,35975,35663,35454,35342,35247,34965,35055,
+35088,35068,34755,34444,33681,32883,32805,32760,
+34083,34420,34531,34201,33761,33416,33357,33832,
+34448,34579,34607,34915,35735,35783,35631,35661,
+35861,36255,36564,36453,36089,35783,34934,35162,
+35224,34859,34748,35136,36192,36672,36892,36669,
+36963,37682,37605,37538,37456,37407,37431,37449,
+37449,37425,37385,37343,37298,37239,37056,36808,
+36516,36385,36302,35895,35282,35450,35427,34977,
+34484,32865,32834,32997,32993,32202,31624,31541,
+31665,31624,31010,30897,30801,30755,30775,30838,
+30873,30879,30609,30497,30623,30600,30593,30991,
+31547,32330,26298,25678,25648,25134,25231,25336,
+25264,25187,25092,24984,24690,25731,26079,26157,
+30549,32316,26566,26461,26498,26236,28407,26744,
+27541,25300,24786,24330,23249,23298,25881,26745,
+22647,22589,23811,23559,23169,22494,25934,22596,
+22377,22161,22014,21846,22188,22146,21864,22552,
+21712,21958,22844,22241,21235,25800,26355,24115,
+24534,23835,24032,23115,23108,24524,22970,22957,
+23569,23350,23212,23381,23440,22874,22794,22887,
+22099,24227,21877,22053,21988,22965,22068,22350,
+22000,20021,22342,23478,22075,20883,22400,21261,
+21720,21178,21755,21365,21355,21086,21225,21715,
+21975,21606,20820,21488,20826,21405,22165,20253,
+19883,21015,20413,19788,20277,20467,21012,20709,
+20640,20505,20010,20784,19460,20621,19793,21656,
+21326,20787,20631,20311,20923,20638,21465,20051,
+19815,20260,20754,19640,20429,19807,19410,20184,
+19275,19137,19285,18899,19129,19242,19144,19270,
+20211,19294,19309,19330,19503,19509,19432,19408,
+19290,19438,19410,19107,19376,19446,19527,19938,
+19698,19573,19665,19708,19435,19225,19389,19230,
+19232,19209,19302,19043,19167,19174,19085,18964,
+18872,18762,18648,18863,18510,18776,18942,19032,
+19125,19242,19482,19764,19722,19594,19206,19021,
+19283,19252,18765,18756,18855,18747,18740,18716,
+18671,18699,18676,18704,18802,18798,18837,18852,
+18879,18910,18948,18785,18776,18848,18924,18997,
+18939,19020,19135,19188,19154,18966,18972,19004,
+18949,19224,19359,19604,19556,19231,19404,19466,
+19756,19839,19827,19727,19857,19818,19744,19784,
+20127,20112,20119,20205,20286,20355,20307,20704,
+20617,20933,21140,21178,21453,21425,22161,23502,
+24002,23277,23740,23310,22007,22316,22643,26618,
+31618,31504,31404,31433,31905,32336,32040,33261,
+32843,32919,32083,34813,36158,38050,35583,34416,
+32976,32749,32933,32904,32878,32533,32248,32076,
+32067,31791,31329,31206,31212,31186,31589,30999,
+30333,28920,27572,26352,25131,24265,23961,23794,
+23615,23337,23013,22658,22287,21957,21575,21308,
+21249,21117,20700,20434,20208,20316,20311,20307,
+20274,20188,20072,19916,19701,19755,19576,19518,
+19448,19446,19359,19215,19275,19340,19315,19210,
+19146,19128,19085,18967,18996,18997,18917,18949,
+18882,18834,18909,18894,18816,18654,18696,18655,
+18591,18574,18539,18558,18514,18432,18400,18321,
+18422,18348,18256,18335,18255,18219,18212,18180,
+18147,18146,18098,18127,18139,18107,18135,18126,
+18093,18089,18115,18022,18060,18168,18066,18059,
+18120,18097,18198,18128,18165,18189,17990,18225,
+18314,18351,18416,18372,18213,18540,18555,18922,
+18971,19385,19880,19026,18757,18894,18872,19065,
+19796,20238,19613,20119,20395,21285,21984,21917,
+21447,20631,20571,20276,20122,20357,20268,20160,
+20899,20575,22251,22998,22925,24177,24259,23333,
+22789,22752,23178,22705,22030,21229,20498,20196,
+19932,19506,19407,18980,19134,19322,19430,19439,
+19601,19727,19357,19282,19275,19141,18960,18957,
+19164,19149,19548,19743,19854,20073,19515,20306,
+20342,20571,20476,20424,20607,20745,20956,20993,
+21883,26754,29108,29040,24117,20738,20052,19989,
+20122,20113,20121,19525,19542,19532,20481,20716,
+19871,20315,20412,22611,21892,23416,24737,25658,
+24825,25851,27543,26967,27959,31119,31781,30778,
+32309,33109,32594,30150,32387,33440,35034,36255,
+36510,36963,37847,38755,39461,38517,36869,35463,
+33107,32862,32814,30633,30732,31227,32755,32357,
+31637,30282,29442,31761,32215,32176,31855,31494,
+28439,26831,28492,27822,29493,28713,27475,26351,
+27075,27040,28954,29412,28606,28974,30600,31501,
+31367,31473,30788,29316,27576,26868,27178,27741,
+28431,28407,30063,31615,30734,32159,31674,31676,
+31860,32049,32233,32519,32991,32986,32941,32955,
+32997,32994,32988,33007,32994,32968,32946,32962,
+32895,32988,32880,32699,32799,34494,34841,34856,
+34590,34735,34758,34291,34406,35185,34395,34355,
+34674,34759,35031,34884,35104,33789,34045,34476,
+35147,35863,36263,36915,37430,37696,37647,37251,
+37247,37538,37572,37082,36440,35842,34984,34235,
+33583,32893,32577,32996,33400,33486,34058,35721,
+36393,36867,36711,36261,34842,34628,33735,32988,
+32954,32994,32925,32904,32403,32282,32540,32493,
+32688,32546,32979,32945,32974,32960,32943,33951,
+33674,33375,34383,35245,34758,33046,32965,32973,
+32880,32265,32647,32988,34850,36100,36263,36015,
+36065,36754,36586,35973,35554,36037,36365,36066,
+35836,35921,35961,35529,35082,35133,34975,34310,
+33830,33264,32987,32762,32739,32526,32764,32466,
+31857,31767,31854,32214,32050,31216,31101,31199,
+31674,31615,31699,31673,30951,30763,30680,30426,
+30319,30039,29847,29802,29826,29972,30102,28884,
+26388,25268,25072,25020,24669,24631,24607,25127,
+24654,24934,24475,24789,25110,27857,32994,27180,
+25463,25707,30150,25556,24703,25233,24623,24471,
+24648,24448,24074,23589,22803,23424,22852,23148,
+23277,23103,23949,24021,24278,23241,23276,22950,
+22430,22306,22486,22209,22172,21767,21227,21523,
+22350,22014,22959,24850,25168,24042,25329,24354,
+24589,24418,24015,24867,23269,23890,23694,24366,
+23615,23635,23443,22491,23538,23693,22753,23248,
+22802,21537,22920,23086,22033,21656,22992,22665,
+22738,22193,22592,20653,22209,21429,21063,21481,
+20728,20875,21186,21177,21707,19922,20871,21881,
+20376,20902,20856,21064,21682,20606,20994,20835,
+20227,20991,20990,20057,19818,20160,21935,21040,
+20786,21438,20370,20445,21580,20988,20112,20733,
+20234,21057,21727,21135,19833,21453,20391,21066,
+20594,19599,20308,21015,19554,20037,19665,20156,
+19536,19335,19113,18945,19289,19041,19068,18896,
+18894,19024,18944,18876,19043,19058,19161,19123,
+19018,18958,19133,19409,19453,19453,19245,19289,
+19498,19121,19038,18969,19003,19000,19037,18902,
+18768,18732,18622,18525,18642,18707,18738,18690,
+18710,18613,18547,18544,18465,18493,18610,18605,
+18594,18592,18738,18994,18873,18957,18999,18756,
+18582,18884,18646,18725,18549,18374,18297,18077,
+18291,18475,18574,18600,18608,18618,18654,18718,
+18795,18846,18869,18765,18750,18707,18577,18684,
+18543,18461,18638,18816,18692,18915,18788,18898,
+18758,19253,19258,19365,19435,19472,20858,19563,
+19580,19715,19750,19770,19756,19692,19456,19368,
+19606,19765,19965,20073,20241,20319,20328,20330,
+20437,20690,20903,21160,20806,21603,21975,22684,
+22046,21633,21566,21853,21652,22270,22701,23586,
+24403,25621,31549,31698,31823,31733,31786,31782,
+31448,32754,32995,32313,32890,35490,37341,36402,
+32997,32996,32997,32979,33066,32947,32991,32134,
+31949,31819,31875,31943,31932,31893,31818,31681,
+31479,30882,29589,28144,26682,25178,24137,24507,
+23709,23690,23464,22922,22503,22142,21669,21195,
+20951,20673,20523,20376,20249,20150,20020,19870,
+19829,19806,19785,19719,19658,19563,19419,19340,
+19246,19119,19112,19227,19191,19092,19032,18955,
+18999,18979,18958,18940,18891,18825,18752,18657,
+18641,18725,18658,18656,18642,18597,18497,18495,
+18480,18450,18399,18366,18329,18339,18324,18376,
+18318,18282,18234,18183,18227,18227,18237,18174,
+18129,18102,18079,18015,17980,17954,17974,18016,
+18037,18001,18005,18000,17961,17932,17940,18036,
+18186,18091,17955,17917,18060,18098,18254,18045,
+18201,18425,18369,18415,18450,18587,18596,18714,
+18973,19236,19196,18529,18351,19197,20112,21326,
+21912,22533,22457,21979,22451,22299,22431,22199,
+21903,21098,20742,20706,20838,20272,20170,20182,
+19940,20057,20158,20516,21267,23115,23296,23472,
+23838,24345,24578,23535,22780,22146,20973,20289,
+20478,21191,19105,18843,18838,18860,18920,19046,
+19033,18969,18717,19251,19104,18764,18839,18735,
+18563,18877,19176,19266,19384,19425,19410,19017,
+19378,19671,19776,19884,19954,20214,20476,21234,
+21559,24937,28872,29679,28803,24063,20832,20090,
+18846,19056,18994,19074,19080,18752,19254,19392,
+19983,20277,20966,21346,21661,21385,22918,23773,
+24203,24741,23250,25608,26429,26775,27225,26431,
+29066,29667,28660,31647,32195,32952,33840,34682,
+35156,35587,35625,35571,35731,35596,35192,33910,
+32593,32001,31875,31972,29901,28521,26739,27072,
+26913,26733,25756,25075,25436,24360,23869,23694,
+24228,25347,24761,24639,25474,25692,23761,24356,
+25284,26712,26960,25939,25898,25959,26336,26739,
+26849,26662,26320,25839,25020,24543,24534,25055,
+25452,24765,23736,23790,25677,25806,27143,29169,
+29936,30732,31286,31771,32093,32143,31962,31826,
+32493,32402,32512,32995,32943,32995,32911,32805,
+32910,32453,32321,32832,31551,31352,31524,31975,
+31555,31662,31990,32120,32053,31668,32990,32953,
+32971,32992,32919,32465,32227,32600,32865,32820,
+32997,33171,34452,35377,35756,36026,35745,35155,
+34642,35349,34443,32936,32036,31264,30780,30531,
+30192,30573,31323,30633,32415,33886,35034,35568,
+36032,36225,35714,34815,33042,32985,31686,32634,
+32102,31233,30706,30597,30938,30270,30749,30951,
+30374,30793,31590,31993,31632,30618,31476,31731,
+32001,32187,32569,32961,32579,32988,31185,31875,
+30630,30284,30971,31509,32988,34202,34175,33858,
+34120,34491,35266,34776,33007,32889,33704,32994,
+32769,32568,31839,31226,30677,30525,30514,31509,
+32398,32082,31820,31861,32264,31515,31051,31517,
+31234,31584,32050,32172,32185,32235,31416,31293,
+31785,31693,31104,30782,30836,30302,30489,29374,
+27547,26305,25560,25177,26146,26031,25145,25236,
+25024,24561,24342,24531,24302,24447,24578,24928,
+24987,24541,24948,25424,32937,26733,25860,25734,
+27023,24788,24207,24051,24489,24022,24006,24330,
+24186,23994,23716,23932,23582,23565,23379,23567,
+23079,23239,22971,23094,22962,22880,22085,22288,
+21867,21950,22140,21663,21888,22802,23139,20884,
+23199,22593,23334,23862,23930,24222,24190,23559,
+24223,24234,24420,25299,24020,23703,24138,24494,
+24048,23850,23979,23915,23933,23600,23420,23192,
+25014,23211,23907,23697,23605,23472,22083,21667,
+22104,22204,22432,21545,23061,21061,20706,20723,
+21378,20908,21545,22371,21744,20820,20004,21470,
+21871,20868,20241,21338,20759,20185,20622,21005,
+20691,20859,20874,20605,21038,20427,22474,20157,
+21327,22007,20042,20540,22296,20757,22404,20830,
+20974,19968,20697,20778,20631,21524,20235,21051,
+20519,20692,20119,20403,20424,20018,19206,19713,
+19572,19518,20125,19182,19779,18684,18804,18687,
+18877,18732,18727,18804,18852,18871,18872,18915,
+19191,19604,18876,18907,18849,18644,18704,18843,
+18872,18894,18830,18710,18729,18609,18648,18594,
+18431,18422,18356,18343,18387,18432,18418,18473,
+18480,18446,18438,18455,18458,18282,18314,18308,
+18369,18426,18456,18494,18690,18723,18688,18609,
+19218,18559,18814,18523,18421,18225,18081,18222,
+18224,18358,18463,18492,18490,18486,18414,18468,
+18500,18585,18630,18629,18348,18525,18738,18775,
+18800,18801,18763,18883,18968,18974,18948,18183,
+18823,18993,24914,21781,19242,19121,19258,19237,
+19395,19575,19616,19547,19458,19542,19163,19317,
+19543,19497,19857,20664,19948,20259,20207,20460,
+20591,20706,21017,21179,21173,21446,21025,20745,
+20984,20967,21135,21692,22129,22534,22905,22591,
+22905,23174,23784,29345,31908,31989,32061,31679,
+31994,31936,31688,32805,32995,32980,32592,36189,
+36556,36825,33858,32991,32775,32770,32727,32839,
+32988,32009,32007,32071,32109,32023,32040,32057,
+32003,32103,31505,30069,28355,26954,26307,25282,
+24495,23965,23460,23051,22366,21758,21171,21049,
+20814,20528,20354,20229,20145,20046,19950,19797,
+19592,19495,19332,19306,19355,19379,19232,19211,
+19223,19184,19035,18986,18974,18686,18582,18591,
+18730,18726,18732,18655,18641,18672,18674,18664,
+18553,18611,18538,18414,18312,18322,18461,18440,
+18377,18337,18296,18282,18264,18266,18271,18245,
+18195,18135,18029,18091,18057,18113,18153,18146,
+18121,18054,18029,17961,17832,17785,17719,17776,
+17877,17900,17902,17861,17790,17772,17786,17828,
+17894,18005,17948,18003,18022,18082,17998,17973,
+17998,18147,18142,18208,18246,18216,17989,18322,
+18276,18450,18561,18506,18152,18396,19752,21000,
+22497,23444,23916,24135,24690,23045,22318,21727,
+21533,21556,20700,20326,19974,19866,20319,20213,
+20978,20256,20025,20499,20574,21287,22406,23438,
+24102,24323,24823,25960,23571,23049,26661,23493,
+26534,21414,19212,19019,18537,18303,18276,18522,
+18582,18079,18378,18828,18839,18866,18678,18600,
+18619,18474,18630,18802,18744,18702,18731,18659,
+18728,18829,18862,18980,19045,18818,19453,20156,
+21493,26760,30446,28003,25785,21568,21593,20328,
+19697,19036,18834,18813,18881,19077,19074,19233,
+19479,19450,19597,19848,20718,22363,21531,23824,
+22416,22947,23090,23718,22890,24273,24958,25774,
+27204,24982,24867,25761,28312,29162,29688,31499,
+31766,32043,31882,32127,32073,32043,31158,31297,
+31170,27913,26036,26043,24879,24405,23469,22611,
+22920,22346,22283,21553,22290,22769,22396,22581,
+23175,23427,24084,24267,24393,22554,23140,23658,
+24755,25557,25590,25509,24906,24684,24455,24840,
+24823,24429,23988,24352,24329,24073,23438,23151,
+23670,23783,23904,23670,23168,23061,22741,23842,
+25572,27069,28063,28702,29114,29322,29865,30004,
+29787,29007,27790,27717,28747,29256,29646,31173,
+30190,29046,28572,29523,30381,30540,31404,31387,
+32874,32961,31702,30734,31142,30774,32002,32997,
+32997,32997,32997,32997,32992,32964,32980,32989,
+32955,32995,32939,32987,32976,32906,32829,32788,
+32793,32035,31437,31300,30815,30831,30402,31035,
+31363,31589,31791,31256,32000,31728,31778,31881,
+32363,32791,32853,32068,30295,31499,31494,32915,
+31332,30850,30756,30279,29940,30105,30032,29889,
+30606,30534,30035,30156,29665,29942,30598,31647,
+31861,31338,31467,31632,32214,32673,31711,30945,
+31617,32330,31569,29803,29214,30511,31397,31934,
+32062,31923,31919,32209,32565,32582,32323,32624,
+32988,31279,29936,30789,30896,31207,31570,32083,
+32309,31948,31295,31716,31094,29493,28671,27774,
+26312,25161,24937,25344,26538,26550,26143,26139,
+25766,26522,26364,26496,27442,27342,26684,27028,
+26412,24663,24498,24455,24262,24067,24336,24348,
+24123,24208,24113,23827,24292,24322,24363,23326,
+24533,24219,24311,24258,26103,24685,24715,25116,
+24788,24271,23875,23860,23691,23754,23563,23880,
+23979,23199,23481,23645,24081,24005,23865,23649,
+23519,23169,23067,22702,22580,22980,22635,22341,
+22044,22812,23666,21551,21641,22081,20877,23376,
+24207,23745,23828,23871,24138,23968,24183,24081,
+24008,24472,25380,25347,25178,24570,23997,24548,
+24423,24954,24611,24418,24052,23991,24537,25194,
+24558,25102,25030,24434,24742,23863,23368,22648,
+22783,22515,22278,21144,23362,21744,21167,22617,
+21504,21543,20177,21798,21751,21161,20837,22098,
+21018,21289,21765,21725,21922,21825,21846,22530,
+21149,20817,19946,19167,20346,20978,19860,20794,
+21336,20998,21053,21976,21444,22345,22067,20364,
+21111,20166,22504,20468,20677,20322,20574,20408,
+20227,19560,20613,20489,20188,20213,19780,20163,
+19150,20026,20201,18500,18844,18840,18849,18798,
+18716,18709,18621,18222,18804,18681,18606,18642,
+18651,18578,18579,18547,18529,18507,18404,18486,
+18546,18555,18526,18446,18388,18344,18302,18270,
+18183,18213,18198,18194,18214,18241,18213,18262,
+18237,18164,18167,18195,18233,18194,18194,18029,
+17970,18167,18244,18090,18144,18323,18480,18388,
+18504,18530,18344,19037,18032,18159,18162,18212,
+18236,18278,18264,18370,18417,18425,18393,18362,
+18387,18397,18495,18522,18213,18290,18481,18593,
+18714,18720,18639,18975,19206,20165,21539,18654,
+19980,18939,22139,26087,18918,19287,18990,19504,
+19230,19347,19163,19314,19395,19459,19505,19483,
+19518,19524,19661,19752,20025,20229,20454,20473,
+20451,20586,20708,20716,20485,20767,20748,20905,
+21190,21168,21417,21465,21737,21868,21942,22454,
+22856,23366,24035,25152,25198,25065,31707,31715,
+31906,31584,31818,31542,31881,31914,32375,32690,
+34939,34936,37439,34429,32994,32666,32527,32732,
+32891,32436,31877,31564,31640,31578,31452,31430,
+31450,31566,31767,30168,28323,26741,25725,24678,
+24090,23840,23253,22828,22479,21839,21246,21066,
+20901,20726,20406,20199,20080,19971,19550,19553,
+19385,19311,19223,19233,19204,19019,18934,18885,
+18798,18823,18792,18801,18921,19018,18632,18735,
+18712,18670,18555,18561,18507,18474,18594,18462,
+18351,18132,18286,18383,18357,18280,18324,18408,
+18336,18248,18252,18219,18224,18219,18170,18133,
+18117,18147,18024,17904,17935,17940,18000,18116,
+18073,18044,18019,17940,17756,17715,17772,17862,
+17783,17813,17676,17708,17792,17704,17735,17610,
+17759,17847,17943,17917,18003,17962,17946,17954,
+17988,17934,17925,17868,17869,17877,17679,17950,
+17921,17949,18045,18092,18025,18486,19656,20686,
+22137,23821,24031,24583,25560,28503,25430,24335,
+22803,22344,21661,21085,19732,19390,19248,18966,
+18761,19491,19482,19596,18998,18976,22141,20423,
+21027,21185,21087,21402,21906,22590,22499,21683,
+22860,19114,19239,18945,18596,18379,18002,17657,
+18092,18237,18513,18372,18566,18666,18628,18328,
+18221,18120,18006,18078,18083,18230,18255,18276,
+18311,18381,18431,18414,18365,18410,19102,19659,
+20149,22236,23216,25212,28666,25729,18884,20803,
+19565,19046,18660,18557,18588,18564,18811,18571,
+19098,19041,19256,19641,20157,20581,20932,20857,
+21279,21402,21871,22797,23449,23929,24545,25426,
+25425,26098,23425,25085,24899,23778,25126,26262,
+27694,24774,28011,28188,25281,24132,23256,24207,
+23668,24473,22743,22743,21696,22327,22125,21456,
+21246,20880,21197,21282,21379,22002,22645,23575,
+24498,24872,24721,23418,21957,22145,23499,24529,
+24519,24438,24803,24666,24174,23819,23540,23552,
+23476,23238,23259,23019,23292,23772,23621,22887,
+22596,22356,22636,22747,22588,22711,22749,22561,
+22859,23105,22893,23347,23363,23058,23229,24135,
+24782,24957,24813,24147,24350,24846,25036,25068,
+25407,25788,25961,26168,26553,25958,28004,29502,
+30180,30510,30791,30867,30813,31877,31308,32997,
+32974,32997,32992,32868,32226,32529,31911,32242,
+32265,32697,32715,32271,32278,32961,32967,32715,
+32477,32506,32422,31336,30492,30296,30765,30974,
+31212,31660,30648,27172,26778,27707,28430,28721,
+28598,29118,29608,30215,29513,30510,31302,32007,
+31592,31308,30449,30262,30723,29096,25767,25226,
+24938,24663,24453,24720,25182,25721,25439,26228,
+26330,25821,29424,31565,31668,31590,30932,30800,
+30633,30863,28447,31702,30602,30375,31037,31395,
+31128,31059,30464,30570,32007,31583,30748,30744,
+31446,31119,28923,27591,27120,27086,26404,25469,
+26349,26349,25554,25618,25890,24747,24640,25003,
+25001,24274,24039,23349,24198,23722,23361,23814,
+24236,23399,23592,24001,23704,23911,24336,24559,
+24533,24015,24308,24059,23508,23632,23547,23334,
+23471,23517,23658,23571,25372,23051,23505,24910,
+24381,26109,25197,24569,24375,24138,24123,23642,
+23848,23820,23744,23459,23835,23385,23378,23277,
+23637,24012,24146,23999,23882,23638,23029,23586,
+23361,23937,22827,23032,22710,22964,22926,24552,
+22979,20999,22951,23955,24305,23472,26554,22336,
+22407,23334,23520,23370,24609,22835,24267,23979,
+23898,24084,24857,24897,25183,25201,25518,24525,
+25534,25051,24813,24869,25558,25744,25225,24874,
+24732,24718,24651,24954,24162,24160,23980,23204,
+23718,23699,22581,23447,22641,21243,23401,23451,
+21591,21720,20733,21654,22285,22177,21571,22017,
+21822,22011,22183,23095,21654,20214,20742,22055,
+21620,19984,20817,20817,21227,20950,20976,20437,
+21404,21916,20964,20907,20871,20847,21537,22398,
+20938,20394,20238,20897,19713,19902,19843,20488,
+20059,19950,20233,20067,19993,19562,20218,19977,
+20880,18659,19162,18882,18737,18645,18897,19422,
+18707,18192,18733,18483,18262,18536,18578,18393,
+18207,18212,18348,18406,18473,18364,18333,18286,
+18324,18381,18359,18283,18213,18153,18117,18090,
+18051,18048,18042,18058,18086,18142,18172,18173,
+18207,18169,18115,17987,17958,17889,17999,18075,
+18028,18277,17828,17982,18011,18057,18039,18114,
+18154,18073,18033,18068,18058,18035,18012,17991,
+18034,18073,18168,18207,18208,18262,18209,18234,
+18274,18264,18298,18342,18366,18354,18364,18431,
+18528,18558,18729,18949,19227,19618,18959,18131,
+18873,19906,19895,20214,19188,19581,19080,18904,
+18805,18868,19001,19056,19159,19248,19269,19246,
+19351,19326,19414,19649,19943,20174,20236,20066,
+20381,20164,20502,20441,20770,21148,21210,21314,
+21124,21142,21395,21282,21486,21817,21674,22020,
+22319,22531,22882,23240,24036,26128,24735,30024,
+31848,31482,31659,31937,31902,31214,32094,32905,
+34747,33315,31892,34260,36843,36276,33438,32955,
+32992,31796,31410,31461,31813,31983,31908,31786,
+31816,31875,31962,30171,27926,26275,25317,24621,
+24207,23905,23393,22875,22383,21921,21978,20947,
+21001,20652,20313,20145,19962,19876,19440,19512,
+19573,19224,19125,18890,18852,18811,18687,18456,
+18650,18564,18629,18538,18471,18884,19301,18533,
+18538,18495,18508,18411,19074,18306,18333,18399,
+18330,18345,18287,18251,18249,18135,18263,18238,
+18303,18450,18205,18165,18156,18235,18165,18108,
+18133,18030,17966,17955,17916,18068,18080,17983,
+18077,18142,18083,17972,17825,17821,17888,17787,
+17709,17724,17766,17874,17838,17805,17778,17769,
+17802,17846,17788,17826,17735,17706,17724,17631,
+17688,17704,17555,17622,17622,17628,17661,17633,
+17685,17775,17807,17880,17749,17688,17741,18845,
+21477,23635,24933,25836,26218,26366,26131,25335,
+24453,25731,25055,27276,26234,20684,18962,18813,
+18837,18684,17613,17847,18098,18411,18702,19509,
+19278,19569,19965,19567,19605,18816,19252,19572,
+19813,18588,17868,18190,18156,18048,18093,17881,
+17757,18025,18157,18199,18219,18204,18292,18129,
+18020,17967,17916,17935,17876,17818,17888,17763,
+17925,17714,18047,18135,18089,18027,18267,18989,
+19465,20518,22035,24015,23891,19582,19305,19411,
+18500,18654,18470,18456,18404,18444,18363,18463,
+19017,18980,19625,20778,20223,19830,19800,20085,
+20546,21427,21669,22624,22653,21633,22485,24103,
+22825,21750,22515,24425,22996,23442,24573,25832,
+23368,21708,23531,23431,22599,21508,20957,22167,
+21943,21594,22105,21293,21075,21575,21563,20409,
+20999,20866,20881,21258,21415,22119,22764,23214,
+22350,22368,21980,21836,21429,22592,23243,23557,
+23330,23747,24113,23814,23228,23392,22974,22438,
+22440,22228,22084,22666,22798,22845,23036,22953,
+22896,22774,22681,22410,22618,22573,22470,22170,
+22044,22104,22075,22257,22581,22917,22914,22629,
+22571,22518,22901,22699,22476,22781,23164,23130,
+22948,23379,23396,23343,22991,23779,24892,25671,
+26030,27122,27918,28653,29892,30749,31515,32304,
+32515,32664,32584,31735,31884,31770,31959,32068,
+32378,32988,32988,32838,32157,30640,29507,29325,
+29667,29746,28479,27100,26261,26822,24848,24624,
+24893,23918,24458,23548,24605,25022,24577,25785,
+27431,27727,28230,28042,28077,27463,26920,27129,
+27382,27020,25926,24476,24027,23755,23860,23747,
+23919,23925,24564,24231,24285,24530,25471,24945,
+25781,24705,24290,24373,24073,25582,25222,25919,
+26169,26574,28002,28456,28921,29814,29526,29362,
+30618,30247,30520,30909,31147,28306,27160,26515,
+26391,25480,25466,23923,23978,24417,23937,24788,
+23764,24177,22974,23964,23552,23034,23211,22629,
+23169,23186,22395,22421,22634,22918,22660,22767,
+22169,22837,22690,22959,22828,22967,23100,23055,
+22820,23375,23126,22967,22778,22827,22809,23091,
+23322,23478,24496,23508,23436,23985,24593,24398,
+24330,24287,24095,24362,24028,23625,23868,23662,
+24020,23886,23688,23217,23670,23562,23001,23343,
+23862,23698,23997,23932,24022,23552,24312,24722,
+24314,26148,25017,24507,21189,25332,24687,25438,
+25487,24564,22947,25057,26800,24099,25944,24847,
+23619,23625,22671,23089,23136,23341,23579,24243,
+23629,23819,23919,24333,24411,24540,24564,25173,
+25349,26804,25370,25101,25224,25996,25771,26105,
+25185,24696,24451,24522,24195,24440,24522,24612,
+24910,24555,24752,25275,23754,21811,23139,22438,
+23184,22850,23210,23087,23511,23776,23964,22434,
+22822,20861,21551,23204,21958,22169,22495,22719,
+22592,22332,21341,21180,21166,21396,21743,21868,
+21871,22281,22215,22758,20908,21186,20975,20836,
+20781,21534,21753,19767,19629,20136,20391,20390,
+20178,20142,19062,19699,20404,19065,18681,18620,
+19146,19380,18859,19323,18839,18635,18243,18308,
+19047,18995,18607,18591,18597,18063,18792,18497,
+18322,18048,17989,18074,18097,18091,17979,18038,
+18071,18117,18102,18112,18069,18052,18033,18000,
+17994,17999,18032,17998,18074,18075,18081,18060,
+18019,17968,17880,17965,17960,17865,17782,17687,
+17690,17683,17685,17673,17652,17828,17889,17941,
+18021,18081,18052,18084,18022,17973,17989,18013,
+18050,18078,18132,18133,18125,18116,18115,18174,
+18162,18207,18198,18238,17887,18188,18288,18345,
+18357,18384,18489,18612,18741,18794,18762,18771,
+18624,21225,18973,19543,19110,18852,19035,18853,
+18842,18689,18834,18899,18852,18999,19084,19147,
+19188,19194,19514,19682,19825,20070,20270,20358,
+20412,20648,20602,20730,20768,21121,20598,21000,
+21253,22542,21282,21996,21431,21466,21401,21753,
+21999,22241,22605,22515,23066,23332,23490,25199,
+25227,25019,30871,31743,31572,31316,31572,31419,
+32777,33254,31622,34395,30516,31695,37161,38511,
+35112,34629,32529,32747,36435,32960,32992,32388,
+31934,32025,32141,31152,28489,26906,25917,25482,
+24914,24540,24198,23629,22991,22185,22093,21243,
+20688,20341,20123,19974,19719,20193,19641,19619,
+19668,19214,19156,18879,18990,18762,18946,19068,
+19029,19250,18968,18554,18569,18424,18540,19316,
+20348,18304,18327,19467,18751,18258,18298,18627,
+19068,18484,18106,18234,18570,18356,18093,18237,
+18447,18266,18208,18891,18075,18582,18211,18172,
+18161,18219,18086,18040,17932,17943,18021,18018,
+18051,18018,18030,17976,17925,17838,17744,17850,
+17905,17900,17811,17699,17748,17733,17696,17698,
+17603,17655,17643,17643,17616,17532,17470,17439,
+17407,17462,17481,17460,17466,17445,17461,17535,
+17587,17626,17712,17768,17556,17627,17403,17775,
+18099,20195,21903,24508,25804,26058,25550,24996,
+24343,23607,22435,20799,18985,19032,18700,21402,
+19512,19239,18435,17541,18473,17361,17265,17829,
+17695,18032,18133,18168,17961,18607,18489,18021,
+18033,17973,17349,17942,17340,17835,17866,17934,
+17733,17919,18022,18007,18049,18081,18046,18043,
+17934,17819,17859,17814,17758,17597,17670,17676,
+17709,17758,17816,17814,17847,17880,17936,18067,
+18271,18619,18707,18614,17650,17938,18164,18057,
+18101,18324,18329,18296,18216,18351,18410,18520,
+18778,19093,19413,19661,19608,18990,19671,19756,
+20211,20190,20529,20196,20267,21274,21799,21354,
+20127,22314,22107,21718,23075,23469,21796,23563,
+22631,21073,19845,20454,20738,20358,19875,20147,
+19999,20219,20316,20619,20636,20788,20901,20249,
+20304,20378,20570,20872,21657,21478,21036,21159,
+21322,21253,21468,21625,21336,21455,22317,22702,
+22899,23033,23058,22811,23009,22812,22683,22437,
+22223,22032,21629,21569,21803,22048,22159,21849,
+22121,21748,21885,21904,21912,21998,21940,21875,
+21848,22240,21831,22017,21818,21756,21946,21782,
+22021,22092,22143,21846,22213,22412,22503,22527,
+22494,22449,21936,22341,22477,22830,23253,23493,
+23682,24267,24443,24362,25165,26014,27456,28991,
+29442,30179,30361,31575,31704,31686,31511,31739,
+32113,32347,28609,28412,26553,26964,27685,26485,
+25262,24111,25216,25515,25868,24777,24201,23211,
+23383,22762,22908,22976,23211,23226,24317,25239,
+25857,24660,24983,24539,24909,26368,27085,26085,
+26198,25080,25002,24180,23790,23398,22996,23159,
+22591,22623,22734,22800,23055,22966,23180,22930,
+22341,22590,21631,22303,22618,22740,22462,22965,
+23460,23740,24652,24816,25420,24456,25950,26243,
+25660,25128,25746,24869,24222,23403,23409,23855,
+24564,23896,23562,22758,22602,22595,22776,22656,
+22599,22536,22096,21805,21774,21876,22190,22188,
+22262,22215,21786,21601,21912,21979,22135,21968,
+21957,22129,22212,22086,22405,22530,22662,22767,
+22553,22604,22401,22671,22964,22835,23382,23445,
+23446,24998,23194,23025,24074,24678,24598,24977,
+24329,24642,24225,24302,24231,24153,24426,23826,
+23758,24404,23860,24078,23947,23652,24002,24250,
+24006,23743,23036,24086,24284,23910,24689,25210,
+25612,25959,26297,26303,24861,26178,24007,22922,
+25515,24927,25534,25839,24573,24858,24976,23089,
+23043,23098,22550,22937,22853,22861,23579,24453,
+24249,23371,23549,23311,23960,24057,24120,24330,
+24628,24377,25099,24489,25111,24760,25230,26279,
+25644,25106,24921,25069,24705,24237,24568,24543,
+24300,24108,24208,25971,23452,23841,23780,23212,
+23796,24503,24445,23871,24891,24676,24446,23444,
+23039,22801,22822,23444,23081,23310,22112,23375,
+22789,22275,22135,21626,21135,22667,21947,20337,
+21207,21206,21346,21831,21420,21633,21506,21136,
+20820,20586,20699,20987,20390,19679,20009,20103,
+20401,19802,19899,18606,19704,19390,18965,18519,
+20205,18617,19644,18957,18593,18694,18737,18730,
+18242,18364,19183,18660,19065,18735,18175,18387,
+18108,17946,17964,18072,18005,17819,17772,17776,
+17816,17895,17899,17928,17952,17961,17958,17969,
+17948,17987,17988,17997,18039,17935,17895,17756,
+17543,17727,17518,17509,17573,17616,17637,17560,
+17630,17546,17550,17565,17516,17660,17684,17710,
+17708,17691,17676,17658,17668,17683,17709,17748,
+17865,17917,17934,17886,17834,17922,17857,17919,
+18033,18018,18060,18064,17774,18024,18250,18285,
+18284,18219,18264,18402,18558,18771,18738,19019,
+18495,18891,19946,18855,18629,18676,18711,19007,
+18738,18916,18709,18755,18845,18889,18928,18954,
+19014,18895,19524,19581,19629,19763,20040,20281,
+20562,19719,19946,20496,20320,20523,20730,20874,
+21330,21129,21292,21730,21342,21509,21618,21676,
+21834,22010,21967,22144,22278,22995,23233,23397,
+23201,23299,23241,23451,30361,31794,31853,32081,
+31428,31670,31992,32331,32968,30738,33345,31960,
+32588,34474,36287,32994,31877,31283,31201,31503,
+32045,31961,32522,32246,31746,31658,30017,30129,
+27654,26469,25485,25110,24320,23761,23694,22974,
+22854,22347,22251,21351,20530,21492,22476,21863,
+20426,19938,19465,19113,19396,19428,19258,18879,
+18835,19006,19484,18996,18534,18954,20934,19426,
+18626,18989,18840,18735,18228,17832,18308,19506,
+20224,19066,18546,18336,18737,20034,18305,18329,
+18315,18092,18266,18155,18106,17989,18335,18877,
+18251,18211,18080,18111,18024,18726,18126,18182,
+17883,17964,17968,17913,17835,17901,17829,17628,
+17691,17680,17809,17802,17571,17371,17606,17693,
+17543,17706,17750,17581,17454,17279,17292,17348,
+17374,17418,17394,17331,17442,17490,17277,17102,
+17370,17472,17412,17608,17388,17453,17445,17429,
+17320,17397,18192,19294,22679,23296,21645,20322,
+20345,19983,19171,19482,19318,18750,19059,18753,
+18634,18698,20414,18860,17216,17235,16435,16470,
+16554,16767,18459,18186,17486,19814,17643,17563,
+17509,17847,18084,17436,18612,17935,17918,17937,
+17964,17854,17717,17975,17877,17900,17921,17848,
+17842,17796,17700,17695,17639,17587,17364,17373,
+17605,17666,17714,17606,17682,17658,17710,17816,
+17817,18259,18190,17952,18054,18026,17906,17839,
+17385,17964,18101,17942,18126,18195,18210,18377,
+18558,18742,18876,18963,18978,18733,18884,18949,
+19176,19211,19508,19516,20136,21004,20938,19649,
+19770,18928,18971,19244,19422,19269,18883,19098,
+19504,19395,19701,18926,18700,19366,18822,18729,
+18744,19194,19329,19537,19852,20160,20188,20136,
+19764,19902,20076,20377,20746,21159,21157,20875,
+20731,20649,20943,21267,21365,21086,21384,21868,
+22300,22129,21995,22365,21985,22144,21861,22038,
+22003,21873,21882,21845,21667,21511,21778,21977,
+21957,21785,22045,22009,21951,22040,22077,22104,
+22164,21951,21990,22011,22617,22509,22277,22182,
+21786,21906,21799,21768,21866,21810,21780,21834,
+21865,21966,21939,21891,21937,22124,22038,22438,
+22733,22660,23016,23581,24327,24819,25080,24812,
+24594,25720,26013,25620,26951,28482,27999,27735,
+27749,28006,28785,27162,25566,23676,23816,23751,
+23217,22478,21495,22707,23961,24577,24434,23280,
+23343,22650,22369,21913,22311,22071,22797,23582,
+23705,23039,23227,23586,24177,24698,24637,24874,
+25083,24497,23908,23307,22819,22649,22458,22220,
+21915,22055,21996,21588,22134,21766,21972,21851,
+21388,21337,21444,21291,21189,20991,20953,20852,
+21456,21507,21636,21528,21438,21534,21904,22149,
+22083,21667,22319,22049,21563,21432,21633,21783,
+22144,22209,22537,22444,22669,22780,22335,21757,
+21665,21068,21108,21750,21708,21514,21572,21530,
+21519,21589,21436,21624,21444,21651,21647,21702,
+21708,21691,21837,22135,22096,22518,22479,22218,
+22396,22332,22673,22887,23263,23593,23576,23074,
+23502,23317,25633,25501,24936,24904,24761,25011,
+24825,24880,24915,24454,24351,24416,24493,24091,
+24016,24399,23900,24374,23823,23667,23643,25060,
+23992,26288,25758,24933,25620,27677,25742,27108,
+26370,28691,26037,24958,24284,23358,23322,23072,
+26403,22941,24306,23928,22998,24300,22086,22501,
+22237,22409,21960,23131,23365,21979,22719,23448,
+23482,23992,23148,23552,23517,24154,23595,23770,
+22861,23291,23359,23739,24401,24440,24744,25490,
+25529,25183,24991,24609,25708,25503,25213,25916,
+28323,25439,25586,24399,24498,25115,25210,24873,
+24645,24974,24555,25147,25244,25978,25554,24700,
+24489,24477,24183,24295,23957,23831,24120,23323,
+23311,24055,23257,21279,22881,23127,21900,21732,
+22053,21689,21120,22172,22029,21547,21867,21090,
+21327,21047,20911,20643,19759,20768,20805,19947,
+19259,19670,20108,19552,19536,18939,19830,20160,
+17053,19460,18299,19246,19795,18637,17938,19062,
+19212,18073,18574,18474,18618,18203,18653,18226,
+17858,18018,18142,17994,17952,18051,17768,17718,
+17796,17829,17846,17937,17942,17965,17980,17891,
+17893,17928,17881,17860,17784,17663,17868,17799,
+17615,17580,17529,17593,17544,17473,17649,17667,
+17650,17610,17569,17510,17544,17571,17542,17535,
+17483,17405,17369,17384,17388,17397,17404,17454,
+17539,17625,17685,17731,17726,17814,17792,17941,
+18006,18032,18015,17721,17628,17743,18132,18061,
+18108,18052,18042,18158,18330,18630,18920,18873,
+18884,18618,19482,19245,18713,18516,19389,18731,
+18802,19204,18586,18615,18717,18773,18833,18801,
+18763,18801,19005,19296,19256,19368,19458,19629,
+19651,19724,20149,20083,19671,19604,19821,20156,
+21107,20165,20640,21000,21033,20899,21135,21236,
+21334,21279,21332,21450,21420,21761,21902,22149,
+21685,22246,22231,23028,23871,24523,25467,31620,
+31878,31240,32004,32938,30168,29613,31500,31455,
+32362,30795,32760,32625,32988,33745,32593,34475,
+33968,33904,32180,32349,31557,31338,31563,31411,
+29969,29176,28139,27732,26234,23750,23074,23046,
+23295,23113,23223,22290,21795,22122,23943,22338,
+21733,21597,21526,21507,23517,18563,20213,20257,
+19842,19097,19272,19476,19186,18730,19045,19273,
+19206,19229,19918,18685,18003,20067,19935,19626,
+18024,17823,18142,18203,18996,18117,18984,18754,
+18639,18482,18349,18645,19662,20442,18150,18043,
+18272,18239,18048,18372,18627,18172,18295,18392,
+18174,17983,17961,18141,18001,17231,17339,17757,
+18162,17625,17418,17600,17715,17336,17511,17697,
+17730,17682,17479,17549,17593,17538,17533,17549,
+17374,17425,17497,17450,17271,17257,17243,17271,
+17292,17327,17378,17334,17496,17235,16992,16655,
+17297,16947,17082,17334,17151,17699,18369,18397,
+18245,17942,17644,18018,16608,17749,17591,17400,
+17529,17791,17750,17790,17676,17367,17034,18540,
+16653,17959,16512,17043,18019,17784,18075,17930,
+17575,17628,17823,17853,17658,17885,20681,17567,
+17668,17713,17740,17697,17829,17828,17785,17762,
+17761,17735,17611,17679,17643,17631,17592,17576,
+17511,17599,17592,17616,17608,17647,17705,17759,
+17757,17878,17900,17772,17872,17923,17920,17937,
+17849,17877,17987,17946,18023,18075,17960,18116,
+18203,18330,18327,18465,18326,18330,18516,18489,
+18705,18923,19101,19839,20010,20477,20314,19241,
+18768,18676,18278,18406,18396,18568,18411,18576,
+18651,18614,18548,17971,18315,18237,18145,18365,
+18432,18694,18825,19030,19202,19344,19400,19938,
+19657,19504,19405,19518,19711,20424,20622,20400,
+20255,20316,20374,20622,20691,20639,20533,20831,
+21155,21211,21226,21204,21147,21048,20913,21172,
+20867,21009,21090,21110,21073,21381,21219,21499,
+21667,21557,21417,21339,21354,21472,21798,21582,
+22358,22269,22209,22952,24345,25125,25026,24689,
+24502,22784,21552,21627,22776,21697,21633,21495,
+21243,21435,21510,21383,21597,21359,21768,22037,
+22139,22220,22672,23368,23199,23529,23608,24232,
+24998,26133,26072,25990,25977,23582,27670,28377,
+28983,28925,29055,27036,27882,22341,24532,23569,
+21899,21431,21204,21351,21837,22211,22748,23009,
+22983,22542,22116,21829,21402,21360,21871,22110,
+21944,22212,22522,22701,22753,22646,22941,22883,
+23185,23071,23070,22808,22474,22362,22200,21879,
+21844,21768,21630,21493,21465,21405,21253,21148,
+21082,20919,21085,21026,20955,20719,20663,20710,
+20733,20562,20664,20228,19812,20408,20479,20550,
+20433,20189,20223,20366,20308,20250,20416,20649,
+20969,21237,21234,21705,21491,21524,21474,21456,
+21642,21324,21178,21242,21321,21447,21432,21323,
+21326,21213,21299,21346,21366,21311,21382,21414,
+21330,21514,21751,21761,21783,22114,22828,22458,
+22362,22695,22958,23690,23454,24007,23866,23305,
+23710,25869,25850,25630,26491,25659,25514,25377,
+25368,24881,25103,24588,24708,24392,24435,24033,
+24282,24304,24513,24415,24833,25536,23931,26631,
+25007,25325,25521,26519,27547,27580,28032,28548,
+26712,25154,24124,22989,25893,23524,21725,20697,
+20381,21525,21459,22783,22574,22119,22599,22692,
+21246,20742,22600,21243,21502,21985,22635,22255,
+21168,22151,22529,22939,22824,22969,22207,23437,
+23332,22550,22565,23375,23691,24173,24630,24929,
+24892,24550,25394,25312,25189,26314,24585,25031,
+25070,24737,25314,25353,25438,24328,25320,25289,
+25205,25111,23706,23337,24956,25096,25643,24782,
+24555,24506,24038,23788,23933,24071,23647,24389,
+23598,23162,22085,22446,23466,22581,21610,23077,
+22311,22683,21336,22205,20553,21003,21213,22144,
+21531,20985,20064,20613,20850,20713,20460,20274,
+20067,19746,20158,19483,19683,19369,19349,19205,
+18920,21735,17758,20353,19043,18934,17800,18117,
+18311,18324,18573,18408,18551,19077,18264,18388,
+18138,18669,18328,18285,17845,17740,17883,17670,
+17733,17741,17822,17895,18021,17994,17985,17981,
+17937,17751,17939,17829,18031,17976,17710,17787,
+17691,17610,17530,17571,17594,17631,17624,17560,
+17630,17575,17541,17518,17536,17539,17535,17525,
+17493,17474,17467,17457,17527,17592,17614,17655,
+17664,17748,17814,17943,18150,18225,18240,18159,
+18228,18264,17806,17975,17913,17913,17841,17839,
+17928,17991,18117,18166,18289,18545,18545,18592,
+18705,18582,18691,18686,18744,18700,18930,18706,
+18666,18561,18443,18423,18607,18665,18782,18696,
+18753,18729,18786,18876,18958,19069,19080,19077,
+19055,18999,18828,19085,19887,20988,19007,20132,
+19440,19958,20487,20286,20442,20574,21179,20760,
+22673,21084,21005,21096,21059,21198,21246,21282,
+21582,22199,22782,22953,23261,23334,23143,21714,
+22043,27015,31623,31372,32636,32900,32536,32762,
+29840,28806,29571,30690,30907,31949,32265,32056,
+32757,32437,32799,31909,32033,29717,27286,26174,
+25104,23047,22977,22929,22814,23005,22820,22992,
+22872,23489,23211,22278,25133,27177,26425,24758,
+24016,23024,22809,22615,20561,21818,25052,22516,
+21121,21867,21075,20124,18715,19594,19710,18961,
+18371,19778,19333,18792,20855,19887,19402,19349,
+18939,18529,18893,20874,21062,21652,20204,21303,
+19720,18816,18492,18068,18715,19633,18695,17987,
+18129,18105,18642,20026,18809,18045,17991,17658,
+18733,18599,17930,18027,17306,17334,18551,18186,
+17433,18012,18373,17639,17364,17528,18457,17831,
+17448,17702,17938,17783,17565,17499,17238,17349,
+17287,17259,17244,17248,17232,17160,17262,17112,
+17259,17184,17423,17229,17142,16914,17184,17138,
+16767,17052,17035,16990,17002,16206,17359,16576,
+16959,16995,17287,17214,17425,17372,17346,17828,
+17907,17316,17562,18224,17889,18322,17509,17042,
+16691,16377,17049,17013,17634,17972,17636,18020,
+17880,17661,17529,17554,17868,17701,17611,17823,
+17878,17720,17689,17755,17734,17676,17611,17613,
+17610,17661,17631,17641,17640,17682,17613,17567,
+17513,17479,17503,17532,17574,17614,17655,17650,
+17675,17596,17730,17655,17742,17757,17770,17676,
+17782,17791,17820,17814,17873,17872,17911,17925,
+17967,17989,17973,17815,17875,18059,18268,18324,
+18436,18699,18900,19142,19248,19496,19464,18727,
+18369,18209,18230,18098,18087,18138,18063,18090,
+18123,17978,17901,17949,17880,18033,18123,18326,
+18437,18607,18790,18967,19058,19145,19393,19548,
+19212,19319,19394,19116,19660,20231,20281,20265,
+20176,20112,20154,20174,20064,20023,19929,20217,
+20473,20598,20745,20857,20805,20928,20844,20918,
+20994,21017,21037,21200,21357,21450,21408,21422,
+21586,21517,21485,21483,21417,21524,22272,23038,
+24252,24415,25020,25633,26489,26187,25941,25854,
+24995,24567,22981,23554,22701,21848,21926,21746,
+21659,21594,21468,21393,21475,21502,21451,21561,
+21420,21495,21912,22452,22614,21780,22367,22977,
+23197,23310,23194,23019,22296,22113,21379,21808,
+22046,21963,22053,22704,20994,21746,21363,21187,
+21212,21065,20852,20913,21198,20808,21261,21406,
+21729,21876,21641,21480,21348,21445,21234,20850,
+21162,21408,21376,21396,21381,21546,21629,21652,
+21720,21820,21826,21635,21434,21045,21095,21073,
+21217,21360,21170,21011,20808,20703,20646,20589,
+20484,20346,20295,20273,20288,20239,20355,20210,
+20109,19937,19811,19839,19635,19688,19758,19863,
+19703,19630,19600,19538,19704,20085,20310,20483,
+20778,20943,21286,21674,22437,22559,22930,23001,
+21522,21725,21709,21019,21127,21084,20969,21053,
+21074,21024,20987,20885,20906,20981,20960,21108,
+21102,21689,21291,21387,22926,22257,22278,21622,
+21941,22165,23945,23961,24527,24333,23146,23439,
+26276,26869,26268,26304,26347,25926,25587,25388,
+25347,24961,25090,24129,24818,26178,24298,23929,
+25895,24720,25367,25044,25743,25832,26924,26184,
+26186,28787,26124,25286,24312,28263,24778,23370,
+21440,27613,21720,22133,23403,23107,23587,21309,
+21110,21554,22071,21889,21795,21773,21782,21889,
+21037,21963,21582,21328,20088,20196,21718,20919,
+21948,22765,21076,22365,22214,22753,22537,22578,
+23269,22909,23030,23065,23562,23985,24278,24190,
+24932,24345,24147,25073,23574,24255,25092,24276,
+24560,24293,25671,24902,23823,23982,24186,24725,
+24393,23565,24296,24889,24444,24584,24598,25294,
+25266,24657,24813,24570,24635,25088,23421,23644,
+24170,25594,23173,23379,23028,22821,22072,22949,
+23023,23677,22605,22756,21146,21119,22235,21930,
+21836,20809,21076,20826,20905,21165,21241,21424,
+18870,19977,19899,20371,20449,19467,19867,19197,
+19002,19032,19422,20217,19093,18743,18644,18946,
+18216,18487,18214,18499,18240,18404,18785,17997,
+18162,18097,18330,18056,17850,18768,18099,17529,
+17599,17720,17811,18024,17970,18227,18054,17856,
+18374,18255,18390,18159,17889,17901,17513,17689,
+17661,17562,17510,17601,17656,17578,17441,17529,
+17516,17477,17383,17478,17425,17462,17499,17505,
+17518,17553,17658,17724,17782,17794,17802,17816,
+17819,17829,17964,18283,18468,18303,18027,18114,
+18176,18168,17694,17663,17697,17586,17794,17799,
+17864,17897,17973,18046,18092,18305,18413,18512,
+18709,18651,19330,18596,18662,18519,18465,18515,
+18661,18495,18515,18463,18601,18628,18543,18564,
+18666,18513,18844,18744,18749,18828,18754,18753,
+18632,18616,18495,18496,19167,19280,19396,19185,
+19325,19935,20009,20358,20009,19885,20659,19915,
+20193,20887,20583,20712,20664,20834,21614,21223,
+21757,22326,22087,22410,22647,20955,23256,23885,
+20781,18903,21628,26489,28133,30609,31992,32740,
+32983,32880,31990,30993,27785,28035,28922,30978,
+31557,32025,31232,31282,30021,27071,25001,24198,
+23606,23064,22928,22917,22924,23019,23100,22894,
+23051,23412,25190,25594,26244,27839,31882,30205,
+29752,29446,29446,27239,22944,22754,23013,23032,
+23952,23072,20391,23931,22800,21556,19508,17856,
+21114,22769,21750,20730,20637,21104,20166,19516,
+20955,21352,18471,19697,19831,18420,17750,18532,
+18359,18809,18823,18587,20394,18824,20109,21132,
+19533,18444,18336,19144,18723,19281,19437,19141,
+17961,17808,18150,18024,18575,18620,17608,18037,
+18141,19165,17956,17607,20382,18061,17988,17682,
+18068,17475,17250,17804,17938,17283,17226,17503,
+17805,17451,17217,17594,17324,17244,17161,17454,
+17417,17028,16934,17109,17044,16986,16956,16996,
+16977,16946,16781,16977,16690,16860,16949,17727,
+16907,16821,17113,17137,17306,17317,17481,17278,
+17577,17697,17772,17896,17756,18867,19496,17937,
+17391,16980,17131,17215,17586,17781,18223,18051,
+17946,18082,17950,17865,17555,17365,17442,17805,
+17381,17526,17481,17616,17637,17606,17529,17545,
+17545,17598,17571,17640,17608,17499,17529,17448,
+17396,17449,17451,17446,17496,17528,17587,17613,
+17632,17621,17613,17613,17591,17622,17591,17604,
+17596,17616,17676,17612,17568,17614,17688,17631,
+17687,17719,17701,17670,17649,17742,17827,17958,
+18029,18153,18362,18510,18426,18306,18324,18236,
+18045,17884,17839,17769,17729,17781,17527,17719,
+17731,17728,17712,17784,17858,17948,18142,18210,
+18298,18399,18597,18642,18880,18825,18832,18943,
+19068,19102,19809,19240,19333,19504,19517,20000,
+20046,20016,19842,19966,19903,19620,19494,19653,
+19878,20121,20351,20564,20724,20757,20768,20629,
+20767,20978,21033,20943,20947,21253,21324,21055,
+20905,20313,20985,21050,21368,23592,24487,25197,
+25586,27369,28154,27182,26326,26465,25269,25007,
+24659,23838,22476,22090,22629,22876,22255,23253,
+21204,21381,21494,20696,21226,21181,20899,20819,
+21120,21054,21234,21436,21417,21309,21491,21311,
+21117,21112,20928,20835,20634,20418,20232,19986,
+19748,19462,20005,19444,19459,19386,19784,19730,
+19760,20145,20228,20175,19651,20173,20375,20687,
+21066,21324,21313,21294,21021,20868,20843,20689,
+20385,20597,20674,20683,20709,20652,20708,20741,
+20774,20807,20748,20499,20438,20582,20686,20862,
+20748,20643,20681,20673,20612,20526,20470,20423,
+20412,20318,20254,20219,20208,20226,20185,20076,
+19916,19911,19767,19794,19728,19698,19643,19641,
+19580,19727,19740,19750,19764,19918,20111,20322,
+20512,20682,20860,21011,21314,21168,21251,21165,
+20742,20567,20335,20721,20600,20613,20750,20852,
+20706,20738,20521,20612,20616,20766,20849,20901,
+21309,21105,21267,20916,22462,21920,21681,21567,
+23115,24142,24101,25273,24154,23493,22976,25806,
+26617,26373,25756,26021,26805,26135,25974,25936,
+25777,26036,25119,24900,24294,24899,26858,24628,
+26137,27243,23658,27190,25616,26028,25935,26376,
+25975,27162,25707,24345,23369,21013,21328,22707,
+20338,20736,20889,20041,21039,21267,20181,20874,
+20921,21048,21258,20813,21003,20874,22168,21447,
+21196,19863,21417,21310,20685,21527,21700,22124,
+22157,20381,21846,21259,21975,23055,21939,22166,
+21709,21859,23310,22967,23832,23430,24362,22619,
+22200,23206,23234,23166,22896,23406,23019,23263,
+23197,22817,22370,23371,23613,22905,23277,22671,
+22918,23811,24016,23889,24063,23790,24200,24237,
+24198,24590,24827,25530,24638,24516,24593,24592,
+24114,23942,23838,23854,23011,22560,22239,22359,
+21895,22484,22854,22400,22165,21884,22189,20784,
+22961,20796,21624,20968,21084,20453,21154,21201,
+20916,20615,20194,20756,20881,20604,20227,19596,
+19280,19632,19458,19363,19163,19584,19417,19186,
+19442,19062,18355,19025,18927,19395,19023,18640,
+18873,19125,18855,18500,18569,18382,18300,18201,
+17775,17643,17850,17592,17393,17308,17616,18005,
+18169,17962,17621,17665,17834,17898,18162,17776,
+17771,17594,18327,17503,17527,17583,17484,17477,
+17466,17438,17314,17313,17306,17355,17575,17624,
+17685,17749,17790,17795,17823,17819,17759,17746,
+17802,17824,18182,18259,18407,18051,17739,17523,
+17429,17592,17422,17514,17490,17598,17640,17771,
+17700,18000,18158,18227,18316,18221,18273,18312,
+18258,18269,18471,18479,18475,18609,18306,18337,
+18573,18492,18441,18476,18481,18762,18505,18351,
+18597,19090,18441,18935,18673,18816,18519,18538,
+18356,18390,18620,18474,18615,18426,18910,19425,
+18791,19579,20253,19581,19746,19701,19918,20031,
+20281,20489,20453,20621,20579,20577,20858,21172,
+20937,21887,21393,21903,21302,26302,21265,21833,
+22761,22489,22869,22183,19089,21507,24711,26188,
+28458,31429,32153,32314,32124,31880,31696,31272,
+29772,27231,29726,31659,31982,31652,31131,27469,
+25146,24174,23561,23197,23138,23101,23059,23389,
+24027,28473,31126,32099,32418,31886,31977,31491,
+30859,31369,30873,32566,29804,26733,22225,22583,
+23260,24246,26889,24998,19096,19711,24320,25279,
+23866,25550,23511,21512,21833,23851,20271,20706,
+21358,20806,21120,21403,19594,18852,20715,21696,
+21627,21670,20332,19215,19041,18083,18523,19634,
+19910,19867,21238,19226,19936,19839,17601,19201,
+20487,19900,18545,17576,17778,18702,19860,19989,
+20210,19798,18639,18582,17427,17467,17283,17672,
+18065,18497,19492,18681,17773,17660,17757,17088,
+17716,18695,17446,17477,16836,16983,17434,17244,
+17157,17076,17002,17135,17242,16857,16746,16756,
+16965,16914,16761,16881,16861,16901,16920,16834,
+16959,16980,17160,17061,16947,17376,17249,17385,
+17607,17703,18297,17670,18201,18498,17859,17663,
+17666,17578,17111,17157,17382,17430,17309,17453,
+18231,17962,17941,17808,17772,17650,17412,17515,
+17496,17432,17169,17421,17496,17457,17547,17424,
+17495,17466,17504,17544,17466,17483,17472,17366,
+17377,17276,17344,17344,17394,17425,17494,17549,
+17607,17484,17478,17520,17589,17561,17475,17443,
+17424,17442,17385,17400,17395,17397,17414,17427,
+17415,17436,17385,17433,17436,17475,17497,17440,
+17597,17730,17771,17799,17822,17550,17725,17783,
+17616,17693,17598,17502,17507,17511,17450,17501,
+17592,17585,17664,17717,17832,17903,17943,18025,
+18045,18152,18272,18661,18566,18617,18714,18846,
+18933,18492,20118,18731,19275,19581,19356,19722,
+19627,19750,19350,19615,19723,19812,19807,19791,
+19650,19901,20285,20496,20654,20673,20624,20639,
+20601,20570,20496,20337,20517,21082,21073,20631,
+20769,21284,21789,22413,23022,23967,25242,25920,
+26301,26543,26769,26319,26170,26050,26241,24498,
+23399,23165,21505,21422,22034,21775,21651,21670,
+21389,21375,21164,20881,20584,20833,20177,20452,
+20475,20604,20425,20640,20611,20830,20945,20724,
+20364,20143,20070,19776,19851,19617,19564,19495,
+19155,19181,19380,19328,19104,19442,19809,19737,
+19776,19949,19749,19596,19674,19698,19940,19935,
+20248,20405,20502,20657,20621,20635,20624,20371,
+20116,19808,19869,20136,20239,20350,20353,20255,
+20239,20292,20235,20334,20373,20516,20438,20495,
+20284,20283,20228,20246,20136,20051,20042,20079,
+20115,20056,20004,19965,19854,19827,19857,19755,
+19730,19734,19638,19554,19429,19443,19388,19473,
+19536,19628,19683,19774,19794,19697,19869,20009,
+20086,20098,20217,20333,20345,20340,20450,20205,
+20169,20226,20216,20241,20373,20315,20465,20474,
+20330,20475,20667,20649,20536,20635,21057,21013,
+22464,21354,21279,21905,21754,22381,21870,23208,
+24665,24500,24322,24303,24301,23439,25448,24944,
+24867,25123,25248,25716,25581,25679,25858,26115,
+26575,26169,27464,25428,24889,24933,26013,24826,
+24733,26490,24525,25377,24391,26048,23851,23659,
+23166,22748,19836,19818,20484,21461,19217,21130,
+20221,19817,20445,21433,22547,21186,19742,23389,
+20474,20166,19542,20539,19812,19600,19707,19731,
+20392,20489,20715,20936,21135,20772,21131,21753,
+21097,21531,21515,22479,22544,21371,21631,22932,
+20514,21420,22375,20826,21752,22082,23124,21981,
+22465,22335,21951,23058,21783,21398,20437,21500,
+23653,20269,21869,21686,22063,21879,22382,22767,
+22603,23189,23292,23472,24198,23479,23509,23686,
+23931,23932,24395,24484,24813,25071,24984,24721,
+24047,24201,23854,23533,23430,23080,23200,23044,
+22908,22659,22252,22137,22584,21936,21242,21297,
+22524,21834,22153,21212,21551,21367,21188,21072,
+20842,21315,20617,20628,21310,20856,20901,20706,
+20292,19715,20281,20406,19239,19578,18759,19515,
+19428,19201,19866,19705,19671,19800,20178,19602,
+19607,18957,18430,17901,17768,18024,17259,17234,
+17650,17189,16911,18063,18526,18540,18627,18895,
+18201,18428,18248,18042,17298,17962,17934,17880,
+17992,17535,17640,17943,17988,17881,17717,17520,
+17459,17442,17451,17476,17487,17423,17865,18009,
+18180,18177,17944,17931,18344,18122,18199,18065,
+17892,17493,17837,17743,17827,17385,17722,17568,
+17496,17774,17980,17608,17289,17205,18074,18450,
+18463,18015,17920,18043,18012,18027,17877,18021,
+18070,18347,18325,18388,18195,18219,18343,18614,
+18425,18477,18815,19210,18358,18289,18844,18528,
+18272,19170,18411,18585,18630,18417,18356,18303,
+18180,18276,18888,18329,18723,18505,18665,19209,
+19752,19305,19818,19847,19281,19900,20064,20020,
+20189,20470,20159,20309,20539,20547,20171,21330,
+21502,21284,21324,21750,22747,23965,23232,22749,
+22613,22266,22383,22629,21989,21564,19813,18004,
+18498,20643,22357,24600,25929,25347,29460,32048,
+32604,32992,32091,32739,29389,30396,30407,31034,
+31306,31232,25231,24314,23852,24042,24246,24474,
+24543,27835,31299,32677,32214,31961,32019,32063,
+31221,31683,31653,31774,32317,28869,25143,24937,
+24053,23240,22325,22723,27895,28791,25818,24159,
+20190,23043,25126,22404,25810,26308,27087,24266,
+22815,21480,21635,23526,21948,19800,18717,19926,
+20696,20721,20697,23109,20496,21444,20613,19922,
+18948,18800,17620,17278,18304,19681,20156,21798,
+22289,22380,19878,18873,19683,19515,19706,17114,
+16665,18354,18581,20143,19544,19610,20274,19238,
+18312,18821,18588,18233,18246,18705,18043,17837,
+17136,18971,17623,17585,17781,16706,17313,17718,
+17442,17067,17623,17336,16992,17136,16899,16598,
+17006,16824,16885,16910,16811,16852,16913,16899,
+16959,17051,16873,17157,17257,17349,17021,17111,
+17154,17187,18627,17565,17496,18108,18304,18897,
+18405,17940,17371,17404,17123,17355,17560,17395,
+17334,18462,18327,18023,17760,17967,17550,17529,
+17344,17457,17526,17058,16840,17368,17515,17792,
+17476,17338,17406,17285,17329,17325,17309,17247,
+17230,17229,17304,17295,17279,17322,17392,17403,
+17416,17447,17436,17428,17406,17404,17346,17342,
+17298,17274,17295,17265,17298,17214,17170,17188,
+17240,17214,17253,17289,17312,17324,17301,17320,
+17365,17396,17445,17415,17392,17380,17370,17301,
+17350,17304,17282,17334,17340,17345,17315,17406,
+17440,17492,17504,17558,17686,17721,17778,17970,
+17973,18431,18226,18250,18398,18605,18690,18928,
+18873,19026,19063,20534,19581,19560,19878,19919,
+19701,19648,19687,19599,19655,19719,19809,19908,
+19905,19583,20111,20388,20442,20480,20364,20533,
+20532,20696,20678,21947,21407,21146,20984,21985,
+21944,22080,22112,22436,22949,23054,23638,24439,
+25404,26481,26762,26745,26877,27855,26967,24988,
+27338,24647,25715,25074,22129,21773,21435,21240,
+20310,20148,20331,20508,20787,20543,20364,20363,
+20334,20396,20436,20431,20382,20379,20260,20544,
+20379,20026,19869,19839,19766,19732,19671,19449,
+19150,19196,19328,19288,19540,19466,19435,19758,
+19737,19734,19341,19792,19836,19896,19746,19869,
+20082,20278,20323,20354,20371,20457,20412,20355,
+20169,20037,19783,19997,19911,20056,20035,19911,
+19928,19989,20016,20158,20218,20193,20130,20255,
+20260,20093,20024,19925,19848,19763,19662,19674,
+19685,19641,19686,19718,19722,19700,19723,19686,
+19624,19557,19485,19418,19356,19305,19311,19289,
+19390,19440,19471,19470,19422,19290,19512,19676,
+19778,19845,19738,19919,19707,19887,20055,20247,
+20088,20015,20104,20094,20137,20077,20223,20508,
+20676,20538,20798,20870,20506,21386,21376,22399,
+22196,21774,21357,22217,23071,22263,23889,24034,
+24200,24365,24455,24888,24597,23352,23614,24437,
+24549,24672,24967,25573,25115,25564,26041,26005,
+25074,25474,25405,23837,24371,25041,24012,24391,
+25460,23595,21494,23218,23835,24116,23847,22200,
+20271,20614,20040,20582,20919,20174,19718,20073,
+18818,19770,19665,20288,23379,21424,19634,19262,
+19590,20934,20715,20805,20775,20576,18839,21104,
+20643,21252,20637,20970,21129,20809,21252,20745,
+21351,21118,20529,20759,20633,23335,22237,21189,
+20913,20415,21731,23024,21573,21618,21878,21862,
+21720,20562,20466,21723,21933,20151,20166,21157,
+21994,21405,21619,21556,21915,22038,22525,22456,
+22424,23055,23103,22464,23096,22213,21729,23877,
+23315,23983,23487,24238,24596,25250,25089,24604,
+24502,24552,23985,23750,23727,23807,23493,22992,
+22430,22435,22684,22529,22443,22397,22267,22477,
+22190,22060,21710,21479,21648,22535,21297,20781,
+20372,21172,20180,20955,20477,20373,20355,20361,
+20276,19887,19860,19782,19802,19385,19530,19743,
+19633,19428,19830,20516,23210,20019,19689,20974,
+20142,19779,19683,18702,18163,17464,17650,17110,
+18730,18633,18780,18794,18999,18631,19110,18723,
+18525,17886,18208,17704,18036,18500,18298,17832,
+17535,17481,17652,17976,17646,17699,17642,17645,
+17525,17477,17385,17361,17467,17504,17595,17965,
+18643,18652,18685,18529,17529,17156,17253,18135,
+18323,17769,17504,17434,17430,17527,17741,18055,
+17802,17204,16988,17685,18100,19269,18212,18192,
+18047,17948,18006,18064,17926,18135,18210,18206,
+18329,18025,17761,18126,17828,18049,18569,19087,
+19791,18744,18482,18532,19548,18249,18327,18916,
+18603,18712,18171,18563,18307,18108,18129,18048,
+17994,18250,18061,18267,18297,18228,18753,19011,
+19149,19246,19676,19799,20231,19765,20067,20835,
+20088,20692,20907,20339,20535,21327,21161,21732,
+21080,22572,24511,22354,25233,23706,22650,21873,
+21879,22020,22075,21870,22277,21834,22289,21657,
+21129,20063,19912,19491,19047,18899,22943,23092,
+25862,23753,24247,25578,28783,31534,29545,26440,
+24798,29049,25559,28651,26229,26878,29353,25509,
+27936,28458,32370,32566,32280,32532,32879,32758,
+32292,32085,30314,26013,20894,18444,18804,15084,
+20913,23632,22506,24321,26805,29610,27700,30822,
+24751,25039,30166,21810,24306,22386,23394,26415,
+26274,28030,26631,28456,27789,23846,24311,24141,
+25843,23133,23532,20127,17454,21458,22503,24215,
+22462,22464,22256,21599,21216,21844,22182,20355,
+20040,18303,20790,20030,20065,20424,21021,20925,
+19360,18176,18484,19259,20191,19401,19726,18406,
+18572,19047,19769,19399,17919,18411,17583,17560,
+17874,17736,16630,16986,17446,17097,17427,17238,
+17538,17783,17678,17199,16798,17061,17058,16837,
+16812,16839,16877,16944,17013,17048,17056,16982,
+17473,16944,16637,16950,17334,17381,17816,17013,
+17239,17160,17538,17532,17555,17271,18067,18010,
+17964,17795,17384,17406,16852,17247,17075,17499,
+17709,17740,17775,18136,18061,17901,17698,17720,
+17594,17487,17169,17342,17197,16817,17193,17747,
+18042,17484,17298,17291,17212,17229,17253,17224,
+17222,17187,17144,17143,17169,17241,17311,17259,
+17370,17422,17415,17385,17326,17292,17242,17237,
+17237,17262,17243,17194,17205,17196,17159,17154,
+17144,17136,17190,17227,17105,17253,17214,17235,
+17229,17247,17241,17238,17183,17300,17200,17235,
+17222,17220,17227,17234,17190,17274,17295,17319,
+17304,17425,17484,17523,17588,17652,17721,17779,
+17926,18048,18173,18222,18279,18360,18489,18627,
+18848,19095,19269,18983,18986,19033,19305,18998,
+19249,19434,19343,19440,19551,19525,19711,19762,
+19910,19879,19634,20257,20112,20313,20310,20487,
+21406,21954,23043,23010,22007,22617,23365,23026,
+22839,22771,22674,22852,23633,23881,24961,25071,
+26145,27235,27663,27857,26920,28952,28125,27590,
+25727,23022,22395,20288,21431,20591,20401,20181,
+20098,20117,20181,20223,20217,20307,20250,20357,
+20303,20170,19980,19809,19797,19998,20024,19953,
+19860,19776,19755,19851,19719,19641,19560,19256,
+19305,19467,19556,19651,19743,19594,19706,19743,
+19646,19467,19904,20382,20335,20047,19929,20451,
+20076,20113,19967,20066,20169,20193,20262,20190,
+20181,20064,19966,19941,19886,19878,19787,19729,
+19616,19770,19887,19920,19936,20052,20052,20015,
+19897,19908,19908,19842,19809,19725,19604,19520,
+19425,19419,19475,19557,19606,19620,19590,19516,
+19459,19397,19239,19267,19224,19190,19178,19158,
+19203,19167,19248,19166,19201,19082,19320,19524,
+19659,19707,19708,19743,19854,19866,20137,20189,
+19898,20260,20313,20186,20040,20213,20328,20966,
+20650,20656,21468,20352,21009,21411,21952,22545,
+22561,21795,22192,22223,22881,23472,23698,24117,
+23800,24526,25288,24824,26142,23376,23818,24074,
+23688,24216,24572,25289,26523,25221,24807,24134,
+25352,24408,25529,23221,23490,23690,22330,22767,
+22502,23607,23023,23780,20505,19596,19135,19242,
+19854,19491,19542,18722,19036,18864,18025,19270,
+18961,19338,18517,20853,21220,22158,20425,19870,
+20436,19437,19976,17690,18911,19610,20241,21217,
+19960,20316,20375,20270,20640,20394,20377,20455,
+20586,20436,20185,19379,21145,20717,20250,20793,
+20833,21459,20721,21405,20591,20715,19345,20442,
+22905,19683,19530,20241,21936,20743,20631,21402,
+21094,21000,21165,21744,19985,21969,20972,22145,
+22274,22304,22102,22211,22199,22541,22752,22667,
+22290,23262,23382,23841,24265,24676,25222,26263,
+24806,24863,24671,24192,24018,23743,24134,23359,
+23154,22956,23004,23012,23048,23043,22979,22864,
+22419,22166,22671,22503,21961,21771,21666,21673,
+21588,21162,21048,20890,20301,21204,21250,20117,
+19671,20272,19488,20106,20013,20049,19672,20077,
+20145,19897,20324,19973,19653,19969,20702,19971,
+20025,20033,18917,18651,17118,20701,19533,19514,
+18879,19073,19186,18855,19235,19272,18970,18138,
+19240,18165,18353,19275,18087,18311,17844,18516,
+17361,17428,17304,17727,17536,17504,17673,17664,
+17568,17571,17606,17646,17613,17460,17420,17565,
+17897,17527,17266,17460,19324,17973,17263,18008,
+17955,17967,17768,17643,17520,17632,17465,17451,
+17610,17652,18864,17872,18197,18279,19305,18170,
+18057,17854,17991,18198,18075,18789,18580,18621,
+18311,18174,17919,17736,17481,17256,17248,17775,
+17814,19488,18308,17662,18537,18114,17629,17679,
+17823,18028,17975,17964,18111,18105,17977,17997,
+17877,17951,18066,18167,18139,18510,18668,18952,
+19155,19393,19797,19343,19358,19644,19535,19779,
+20041,20089,20532,20354,19520,19863,21285,22430,
+22962,23000,22849,23592,23859,22176,22869,23370,
+21159,21853,21685,21083,21577,22452,21342,20830,
+20896,22494,21715,22115,25351,21096,21639,21544,
+22175,22602,23283,24381,25086,25579,22821,21912,
+26492,28158,22833,25881,27540,28344,26177,23009,
+16851,26356,30960,22988,22883,19714,18660,16192,
+16326,16857,19785,23995,24862,25761,29505,29358,
+29027,27942,26747,23970,24232,28265,27619,28095,
+30156,31712,23828,25248,25080,25068,28764,29457,
+24750,28713,24903,24828,23384,24684,24303,27979,
+31083,28370,26232,22780,21123,15649,17445,19155,
+20427,23589,22351,21167,21208,21669,21768,23022,
+22469,22074,21078,22580,22529,22588,22118,20948,
+20650,20310,20171,21145,19716,19640,19706,18855,
+18592,18093,19808,18945,17034,18636,18754,18597,
+17568,17226,17219,17137,17329,17175,17988,18381,
+17179,17307,17274,17994,17265,16925,16761,17250,
+16653,16844,17221,16632,16804,16875,17113,16951,
+17233,17137,16870,16816,16866,16973,16936,17473,
+17380,17383,16797,17319,17236,17445,17763,17722,
+17595,17700,17184,17287,17139,17366,16332,17105,
+17890,17803,17982,18255,18148,18202,17841,17488,
+17765,17508,17508,17136,17253,17981,17169,16700,
+17420,17458,17138,17263,17325,17242,17223,17228,
+17214,17149,17186,17214,17301,17404,17302,17247,
+17242,17329,17355,17316,17284,17218,17227,17189,
+17195,17226,17275,17201,17169,17166,17151,17103,
+17154,17126,17103,17180,17137,17231,17143,17106,
+17169,16995,17099,17137,17148,17127,17084,17040,
+17112,17075,17156,17162,17214,17227,17247,17247,
+17327,17383,17439,17515,17566,17619,17677,17715,
+17746,17853,18051,18151,18231,18288,18386,18513,
+18721,18763,18763,18871,18858,18972,18765,19016,
+19131,19290,19017,19248,19327,19383,19527,19580,
+19686,19802,19822,19719,19690,19584,19272,19773,
+19629,21983,22162,22745,23990,26105,25938,26036,
+26286,25563,25425,25218,25230,24668,25458,26190,
+27342,28038,28074,28110,28178,28128,28901,28560,
+27558,26094,25238,20781,20433,19644,19623,19495,
+19601,19526,19516,19535,19651,19907,20043,19855,
+19888,19899,19854,19614,19883,19836,19653,19440,
+19463,19443,19589,19578,19661,19578,19376,19389,
+19260,19300,19278,19290,19653,19707,19689,20415,
+19923,19905,20418,21323,19930,19890,20037,19989,
+20001,19995,19918,19887,20127,20129,20130,20087,
+20012,19918,19813,19788,19735,19164,19558,19328,
+19452,19522,19608,19695,19743,19748,19812,19787,
+19662,19728,19711,19704,19682,19641,19533,19406,
+19329,19227,19127,19278,19440,19425,19392,19299,
+19257,19175,19124,19112,18980,19092,19079,19084,
+19089,19036,19120,19047,19047,19023,18987,19307,
+19403,19461,19530,19494,19764,19815,19709,19921,
+19917,19766,20368,20356,20348,19676,20469,21200,
+20604,20887,21209,21029,22235,21769,23742,24019,
+21291,22461,22669,23409,23772,23198,24284,24225,
+24527,24496,25028,24919,23858,23967,23935,23723,
+23723,23983,24410,24446,23871,26797,26606,23738,
+23646,24099,20102,23113,22275,22512,22953,20286,
+22672,21325,20763,20427,20316,19919,19825,19543,
+19056,18455,18918,18853,18713,18496,18113,18904,
+18946,19008,19377,18387,19963,18395,18327,18171,
+18885,18735,18390,18376,19186,20778,19415,19565,
+19434,20076,19868,20205,21058,19617,19852,19846,
+20307,19985,19800,19015,18750,20232,20147,19959,
+20398,19144,20414,18663,20912,20695,18636,20487,
+19291,21350,20407,20469,20064,20109,20997,22392,
+20363,19944,19218,19449,21222,21762,21335,21057,
+22218,22314,21813,22193,22479,22800,22565,22635,
+22920,23113,23672,23732,24348,24463,24801,25203,
+25608,25152,25437,25221,24486,24381,24234,23802,
+23632,23514,23561,23393,23253,23211,23068,24315,
+24378,21816,22209,22334,22231,22032,22230,22029,
+20949,22040,20485,20807,20948,20835,21453,20194,
+20886,20179,20490,20924,20612,19888,20397,20487,
+20077,20138,20103,20283,20001,19742,19316,18677,
+18997,19096,21760,20610,19857,19563,18844,18858,
+19209,19156,19419,19467,18859,18712,19604,20070,
+18718,18876,18777,18418,18191,18740,17979,17952,
+18612,18535,17463,17892,17567,17566,17472,17628,
+17599,17628,17775,17847,17548,17445,17131,18052,
+18280,19071,18905,18552,19073,18276,17686,17571,
+18099,18194,17354,17809,18500,18467,18342,18354,
+18222,18077,18048,18231,18568,18746,18639,18724,
+19054,18819,18891,18753,18695,18919,18939,18154,
+18915,18275,18001,18357,18966,18240,20362,18901,
+18223,18324,18290,17486,17586,17976,18012,17875,
+17910,17886,17769,17922,17840,17772,17856,18137,
+17850,17782,18078,18215,18237,18451,18540,18651,
+18675,18436,18991,18996,19323,19123,19183,19509,
+20779,20070,20226,19368,21573,21364,25821,22255,
+22401,22189,22830,22305,22968,23130,22395,22685,
+22060,21780,21080,21009,20646,20872,21321,21984,
+21999,24127,26399,20935,21340,22426,22532,22303,
+22434,22218,22632,22155,23388,22907,22863,23035,
+23770,24900,23301,21717,21576,20986,21591,20898,
+19695,20476,20038,21453,23930,24270,23332,20645,
+20242,19753,20847,20427,21855,22924,24907,29001,
+29922,27717,26169,24280,24438,24756,25161,25770,
+27458,29589,27475,25528,27390,27735,24529,25416,
+27615,28656,22232,24544,24725,24924,25401,29692,
+30537,27897,26825,26556,24562,22653,19850,14332,
+18010,19479,23661,22997,21827,23925,23591,20834,
+23063,25335,25128,24148,24613,23857,23343,20342,
+19641,21298,23135,20823,21717,19715,21171,21221,
+18231,18895,17484,19386,17838,18133,17481,18828,
+17418,17010,17220,17298,16650,17210,17001,18505,
+18285,17157,17283,18035,20028,17625,16910,16484,
+17003,17299,17451,16816,17076,17679,17526,17423,
+17038,17305,17706,17502,17081,17127,17413,18097,
+17717,17384,17013,17203,17449,17325,17446,17682,
+17591,17616,17856,17645,16664,16491,17226,17968,
+17532,17608,17907,18023,18100,17622,17384,17526,
+18240,17878,17286,17439,17290,16929,17681,17263,
+16725,17235,17193,16971,17058,17133,17144,17144,
+17063,17136,17166,17278,17440,17345,17210,17154,
+17150,17189,17247,17241,17237,17212,17172,17186,
+17158,17182,17165,17098,17097,17071,17061,17076,
+17110,17105,17148,17235,17121,17199,17135,17124,
+17127,17076,17073,17097,17080,17090,17025,17039,
+16975,17019,17107,17145,17196,17199,17223,17259,
+17314,17328,17437,17481,17506,17565,17651,17716,
+17751,17749,17937,18034,18086,18209,18261,18369,
+18516,18597,18675,18336,18099,18287,18941,19593,
+18780,19147,19452,18828,18944,18980,19410,19098,
+19581,19958,19784,19434,19007,19524,19602,20376,
+19962,22584,25520,26846,27969,27745,27956,28175,
+29048,29280,28682,28281,27125,26585,26468,26431,
+26759,27655,28642,28881,28059,29156,29229,28697,
+28408,27065,22893,20353,20364,19565,19107,18920,
+19146,19086,19084,19035,19154,19691,19818,19697,
+19677,19518,19604,19592,19689,19738,19746,19378,
+19524,19505,19511,19545,19550,19577,19470,19668,
+19844,19958,20213,20324,20121,19240,19125,18891,
+19642,20045,20217,20164,20211,20149,20995,19693,
+20025,19829,20031,19881,19894,19910,19745,19744,
+19680,19576,19537,19704,19566,19548,19002,19114,
+19200,19256,19328,19360,19414,19481,19521,19541,
+19547,19515,19512,19520,19507,19472,19401,19336,
+19262,19161,19101,19181,19031,18973,19027,19088,
+19118,19086,19014,18999,19000,19022,19000,19007,
+19060,19061,19065,18952,19010,18867,19109,19071,
+19197,19284,19279,19715,19735,19952,20094,19960,
+20057,20446,20570,20178,20522,20379,20982,21292,
+21436,21705,21220,20909,21852,22083,21826,24128,
+22240,22962,23539,23190,24797,24716,25051,24573,
+24386,24405,25269,22327,24360,24618,23420,24057,
+24161,23442,24362,24094,25057,24909,21744,22031,
+22888,22134,21081,20709,20311,19888,21576,19812,
+20424,20532,18465,19647,19470,19081,18317,18666,
+18210,18432,17758,17914,18462,17826,21593,18372,
+18255,18833,17415,18792,18422,18724,19832,18063,
+17751,18588,18738,18576,19795,17720,19169,18721,
+19326,18669,19216,20418,19171,18216,18468,19729,
+17823,17592,17783,18924,19526,19408,18909,20816,
+18896,19017,20429,18464,18928,18947,20766,19322,
+18828,18986,19258,18852,20548,19039,19062,21788,
+19129,19474,18576,19271,18558,19556,20245,20430,
+20736,21568,21376,22106,21936,22244,23117,22756,
+22402,22764,23153,23304,23663,23984,24738,24624,
+24525,24679,24789,25052,25896,24996,24697,24271,
+24116,24257,23903,23490,23118,23030,22907,23307,
+23250,22851,22803,23320,22611,21589,21993,22024,
+21381,21348,21549,21696,21159,21357,20855,20799,
+20479,21793,21362,20933,21261,20151,20900,20830,
+20349,19626,19966,19842,18622,20123,21548,20583,
+20374,20379,19781,19674,19378,20044,19596,19080,
+19815,19011,20111,19830,17502,20451,19716,18908,
+18621,17679,17976,18499,18714,18309,18610,18510,
+18308,17574,17350,17778,17248,17196,17558,17299,
+17173,17063,17091,17225,17772,18543,18717,18657,
+18813,18405,18787,18234,18296,18345,15624,18144,
+19434,18759,18926,19185,18657,18716,18609,18352,
+18197,18153,18228,18501,18771,18618,19299,20583,
+19842,18957,19407,19232,18144,17801,18935,20288,
+19059,19817,18498,18109,17478,17910,17429,18049,
+18147,18162,17339,18102,18105,17933,17845,17639,
+17686,17655,17699,17741,17673,17866,17776,20611,
+17331,17457,18123,18279,18532,17698,17749,18168,
+18392,18467,18401,19527,19071,19098,20594,19680,
+18876,19332,21774,21189,21560,21698,22135,21876,
+22959,22166,22537,23090,22100,22556,22742,21825,
+21468,21816,21228,21319,22485,21672,21429,24441,
+21415,21712,21814,22230,22401,22362,22410,22137,
+21913,21847,21692,21491,21714,22152,22308,22585,
+23061,24659,23379,22296,21573,22086,21764,21297,
+22154,22089,23096,25980,24497,28447,29412,27859,
+23398,21022,20966,21586,21317,21617,24394,25208,
+25514,26409,24285,24451,24422,24402,24715,26355,
+27012,28425,24750,24971,25548,25483,24350,23452,
+22275,23801,23847,23904,24890,24601,24417,25140,
+25268,27527,28224,27339,25171,24010,20960,17873,
+13305,18972,19583,21135,21514,21861,20007,20971,
+19746,21572,23976,24907,22874,26227,22786,21354,
+21177,22012,20340,20562,20994,21759,21712,20219,
+20167,19525,20056,19710,19813,19038,19056,18916,
+18309,17424,16965,17795,18693,18520,18390,17918,
+16752,19409,18740,16450,17005,19489,17384,18055,
+18321,17973,19701,17688,17003,18155,17958,17786,
+17493,17627,18291,17530,17742,17281,17094,17276,
+17052,17781,18039,17454,17379,17223,17103,17014,
+16920,16853,17316,17510,16003,18321,17049,16695,
+17859,17465,17727,17838,18145,17616,17532,17740,
+18073,17444,18413,17236,17201,17004,16811,16826,
+18058,17742,18252,17900,17151,16974,16884,16938,
+16966,16983,17001,17015,17076,17035,17013,17013,
+17044,17119,17154,17171,17179,17150,17067,17074,
+17091,17103,17093,17036,17049,17019,17055,17067,
+17197,17161,17157,17104,17076,17040,17046,17155,
+17054,16998,17029,17045,17043,17019,17031,17020,
+16998,16994,17016,16824,17119,17160,17196,17159,
+17224,17268,17364,17431,17468,17510,17586,17705,
+17681,17682,17882,17991,18059,18177,18255,18317,
+18341,18411,18485,18517,18644,18476,19301,18981,
+19077,18816,19416,18547,18679,18918,18774,19424,
+19558,19335,19180,19026,19170,19842,18971,19782,
+20182,21082,25052,27657,28089,28855,28977,29265,
+29325,29426,29497,29506,28986,28711,28410,27141,
+27296,27167,27391,27420,28586,28802,28122,26921,
+24659,23115,20469,19968,18958,18913,19111,19185,
+18702,19152,19296,19371,19354,19533,19707,19623,
+19580,19482,19588,19377,19563,19540,19624,19725,
+19527,19629,19628,19622,19603,19515,19807,19863,
+20294,20526,20457,20315,20157,19824,19695,19334,
+19691,19656,19815,19659,20031,20076,19600,19955,
+19656,19483,19638,19609,19733,19481,19427,19293,
+19254,19196,19167,19328,19459,19475,19200,18929,
+18880,18963,19008,19007,19017,19164,19208,19354,
+19410,19466,19441,19368,19424,19339,19328,19313,
+19206,19183,19139,19158,19074,18909,18787,18819,
+19018,18919,18829,18834,18897,18957,18936,18965,
+18881,19044,19201,19176,19022,18986,19020,18862,
+19180,19314,19479,19620,19842,20178,20781,20721,
+21894,20196,20490,20613,20880,21147,20988,21507,
+21708,22155,21638,22280,21348,23322,23213,22851,
+23137,23175,23622,25077,24022,24854,24671,24158,
+24549,25441,22344,23811,24111,23688,23277,23957,
+24200,23463,24518,24586,22101,16542,25596,21245,
+21285,21912,20544,20805,19787,20378,20833,19871,
+17249,20378,18808,20019,19173,18583,18262,17935,
+17993,17559,17495,18304,17277,17667,17195,17438,
+17148,17705,18155,17841,18267,17802,18680,17527,
+18135,18382,17580,18765,16975,19616,18795,18892,
+18135,20077,18189,18691,20222,19633,19522,19028,
+18549,17118,17526,17468,17724,19056,19354,19137,
+20291,18320,19257,19548,20754,19044,18177,19338,
+19498,19122,18661,19209,20498,19863,18708,19910,
+19647,19468,19751,19536,19509,19876,20566,21156,
+21639,21540,21606,21985,21937,21467,21800,22204,
+22050,22284,22651,23095,23400,23791,24076,24273,
+24213,24415,24652,25023,24873,24826,25191,25868,
+24371,23965,23763,23553,23574,23570,23471,23136,
+22258,22932,22766,22624,22309,21991,22068,22563,
+21781,21700,21888,21648,21535,21339,21120,21207,
+21624,21375,21711,21254,20673,19632,18290,19242,
+22023,22670,21786,21771,21729,21067,21264,21216,
+21645,20595,20393,20421,20275,20232,19752,19678,
+19497,19428,19010,19507,18887,18965,19497,19344,
+18629,19114,19135,18209,18584,18464,18219,18714,
+18454,17860,18274,17709,17523,16961,17401,16782,
+17078,18585,18444,18392,18611,18607,18609,19132,
+18528,17628,17994,17792,19450,19789,19839,19262,
+21966,18665,19126,19068,19238,18936,18656,18294,
+18239,18202,18457,18762,18423,18475,18527,18897,
+19531,21748,21739,20682,20331,19498,20243,19160,
+18960,18181,17637,17934,18916,18678,18615,18061,
+17274,17545,18156,18241,17677,17820,17558,17735,
+17605,17654,17660,17994,19437,18534,17968,18559,
+18681,18776,17832,17771,17476,17997,18435,18264,
+18552,19007,18785,18867,19401,19753,19282,18864,
+21001,21240,21596,21853,21578,22121,21807,21608,
+21395,22082,22980,23292,20345,22717,22222,21643,
+21387,21833,22027,22225,25394,25953,22992,21513,
+21269,20968,21271,21836,21688,21795,22144,21661,
+21363,21408,21117,20547,20373,21167,20796,21356,
+22494,23487,24398,23982,22071,21222,20944,21497,
+22432,23232,24561,23923,24207,25135,25404,26282,
+26470,22913,22274,21693,22880,23030,24733,24234,
+23566,23798,23617,23913,23745,24229,26191,27760,
+26586,27027,24450,25130,24255,23363,22509,22653,
+23478,22758,23036,24083,23568,23391,23675,23453,
+23775,24758,26808,28241,27143,28625,23683,18815,
+11919,17523,19697,20586,20076,19260,19002,19822,
+19960,19152,20085,20409,20036,24406,23680,20439,
+23809,22755,21167,20704,22333,21794,21409,21191,
+21540,21883,21927,21867,21793,21462,19689,19342,
+18828,17610,18071,20144,21453,20641,19133,19268,
+17145,19509,20619,19905,18199,19929,20177,19373,
+19914,16848,19864,19941,18642,18499,20424,17638,
+15887,17010,17491,17403,17605,17470,17503,17546,
+18489,18483,17730,17703,17316,17112,16836,16291,
+16370,16653,16478,16762,16980,18375,16523,17650,
+18699,17915,18633,17573,17918,18036,18053,17639,
+16932,17949,16690,17547,17136,16795,16479,16801,
+17496,19532,17662,17495,17096,16717,16811,16852,
+16851,16806,16873,16869,16958,16897,16867,16921,
+16974,17019,17065,17083,17058,17007,16995,16967,
+17002,17006,17084,17112,17112,17165,17118,17179,
+17311,17581,17468,17249,17233,17127,17100,17032,
+16859,17036,17021,16984,16938,16965,17002,16997,
+16963,16900,16975,17035,17181,17280,17176,17082,
+17045,17022,17090,17348,17362,17408,17469,17499,
+17683,17688,17700,17945,18039,18084,18178,18194,
+18248,18300,18377,18278,18389,18531,18765,18746,
+19239,18876,19239,18706,18557,18924,19608,19560,
+19510,18788,22838,19070,19385,19191,19050,19295,
+20091,21065,23493,26160,27372,28799,29211,29505,
+29726,29859,30701,29865,30594,29792,28866,29372,
+28296,27974,28266,28516,28170,27066,25900,25458,
+24027,20792,21277,19502,18813,18913,18652,18582,
+18592,18682,18712,18802,19164,19360,19509,19563,
+19482,19402,19428,19305,19554,19971,19953,19986,
+19906,19970,19562,20091,20253,19773,20057,20086,
+20541,20202,20039,20091,20277,19812,19218,19284,
+19549,19342,19770,19697,19965,19669,19639,19776,
+19412,18935,19276,19738,19503,19325,19209,19066,
+19131,19098,19089,19225,19438,19351,19264,19010,
+18882,18957,19124,18880,18807,18816,18966,19005,
+19276,19330,19334,19294,19263,19227,19190,19262,
+19236,19222,19152,19086,19095,19005,18921,18942,
+18855,18648,18630,18683,18766,18923,18935,18951,
+18963,18978,19087,18807,18959,19067,19071,18792,
+19302,19410,19404,19885,19794,20140,21636,21952,
+21489,21100,21393,20714,20835,21054,21096,21724,
+21939,23549,22195,22820,22702,23523,23505,21892,
+23230,24347,23922,23685,24432,24029,23730,23975,
+24358,22047,23541,23891,23356,23492,22932,23487,
+23752,23445,23534,18986,22330,23734,21733,21456,
+20089,19396,22383,22128,18903,17971,20182,19357,
+18990,19300,18053,18651,18600,18149,17859,17555,
+17513,17389,17663,17724,17392,17571,17397,16741,
+17866,17355,17420,17542,17769,17359,18450,17893,
+17844,18188,18604,17633,18656,18237,18495,17985,
+18425,17729,18336,18592,18673,18749,18346,18865,
+19125,18731,18870,19098,17781,19026,18239,19105,
+20866,17850,19164,18374,17640,19142,19560,20234,
+19978,18911,20485,17997,18673,19665,18691,20048,
+19944,20551,19055,19862,19834,20890,22808,20712,
+21372,21289,21068,21402,21435,22416,21426,21845,
+22249,22317,22466,22966,23304,23590,23800,23924,
+23762,23757,24290,24609,24511,24484,25317,24917,
+24290,24580,24644,24021,23718,23635,23525,23202,
+23006,23231,22440,22470,22367,22422,22162,22533,
+21702,21200,21637,21474,21520,21706,20935,20497,
+20235,19765,20409,22665,22782,22440,22623,22380,
+22102,22314,21592,21764,21505,21003,21766,21507,
+21406,21210,21269,21149,21000,20697,20301,20222,
+20059,20421,19668,19349,19241,19041,18779,19242,
+19648,18801,19207,18809,18992,19340,18510,19325,
+18741,17736,18645,19079,17225,18641,20190,19857,
+18861,18193,18882,19483,18956,19083,17517,17603,
+18955,19377,19614,19017,19205,19011,18627,18955,
+19325,19451,19164,19146,19179,18999,18822,18550,
+18494,18536,18679,19183,18772,18859,19146,20748,
+19477,19591,26539,21137,19610,19470,18663,18278,
+17991,18213,18308,19139,18737,18496,17103,17829,
+18505,17844,18349,17696,17830,17835,17623,17416,
+18081,18386,19116,17882,18249,18948,18423,18463,
+18903,18771,18423,18413,18735,18866,18755,19021,
+18826,18396,19241,19059,19084,19141,19986,20786,
+20727,20193,21542,21601,21755,22002,22048,22121,
+22153,22229,21719,23578,22624,22647,23901,21557,
+23055,21470,22530,21445,22273,20751,21861,23907,
+23092,20649,23277,22868,21228,21555,21673,21511,
+21412,20746,20480,20965,20574,20725,20580,21525,
+21300,21558,21951,20984,21582,22377,21897,22576,
+23299,23015,23472,23703,23831,24843,24637,24839,
+23881,23775,24582,24393,23382,23598,22530,23206,
+23158,22939,22950,23355,23399,23744,25719,26568,
+24807,25060,22574,25292,24310,24199,24472,23797,
+23239,22532,21792,24021,21921,23338,23043,23333,
+23130,23702,26105,29056,26019,24627,22679,17672,
+11157,16195,18912,19058,19913,20406,20993,18406,
+19111,18987,19317,21015,20545,21345,22158,21511,
+20706,18729,19658,17668,16511,16375,16681,19744,
+20030,18812,21374,20440,22189,20631,20768,20526,
+19417,19569,19013,19883,21001,21129,21492,20404,
+20248,19896,21278,20035,18759,19571,19659,19849,
+20619,19985,20128,19418,18615,20091,17417,18111,
+19647,18066,17689,17535,17367,17252,18280,19629,
+20744,19634,19349,18091,17734,17430,16361,17069,
+15938,15891,16530,16296,16066,17133,18159,16962,
+16215,16408,18653,17817,18292,17491,18090,17784,
+17925,18009,17444,18027,17853,17801,17517,17013,
+16637,16649,17126,16626,16800,16837,16629,16812,
+16689,16762,16758,16761,16816,16833,16859,16865,
+16916,16964,17032,17019,16947,16880,16881,16884,
+16935,17037,17097,17263,17367,17367,17457,17286,
+17445,17594,17851,17478,17388,17436,17422,17272,
+17161,17089,17028,16995,17115,17064,17001,16995,
+16862,16875,16923,16962,17019,17127,17130,17289,
+17110,17120,17216,17337,17400,17425,17451,17464,
+17346,17568,17702,17841,17841,17970,17961,18096,
+18225,18252,18267,18398,18698,18576,19064,19554,
+19831,18752,18758,20126,19756,20031,20607,19664,
+19867,19583,19477,19025,20419,19032,19144,19329,
+19203,20030,22227,22150,24503,25023,26391,28557,
+28518,29111,27383,27874,28879,28688,28608,28026,
+27911,28009,27990,28083,26607,25869,24658,23002,
+20065,21256,19873,18774,18556,19177,18565,18462,
+18369,18479,18552,18774,19202,19106,18966,19264,
+19375,19613,20267,19656,20073,20454,20791,20110,
+20776,20594,20310,20000,20096,20054,20278,20248,
+19559,20126,20093,20108,19827,19489,19635,19722,
+19819,19615,19493,19702,20087,19764,19899,20052,
+19849,19625,19686,19407,19629,19521,19351,19275,
+19189,19227,19223,19422,19463,19430,19365,19009,
+18974,18820,19223,19482,19027,18862,18796,18770,
+19040,18834,18894,18971,18985,19004,19008,18975,
+18997,19107,19130,19014,19017,19009,19006,18983,
+18970,18921,18810,18794,18782,18942,18950,18998,
+18991,18912,18816,19426,19254,19286,19035,18619,
+19458,19239,19547,19746,20095,20490,20774,21339,
+20709,20939,21036,21109,21281,21448,21382,21977,
+22208,22391,22575,22711,22994,23198,22837,24107,
+23979,24613,23260,23575,23448,23712,23400,24039,
+24492,22047,23186,23262,22761,22688,22860,23194,
+23310,23819,20620,15811,23230,22956,21198,21156,
+21238,24108,21153,21994,19590,19047,19966,17037,
+18549,18384,17856,17931,17131,17308,17659,17516,
+17532,17334,17031,17675,17104,17313,17029,17036,
+16686,16984,16920,17403,17787,17598,18053,18018,
+18196,17931,18200,17799,18061,18047,17987,18452,
+18519,17972,19710,16689,18186,18628,19302,18401,
+18960,18264,19370,18894,18363,19719,18690,17845,
+20173,18143,18849,18340,19297,18282,19795,19728,
+19369,20721,19841,19593,19290,19788,19720,19567,
+20111,20104,20262,20281,19102,20505,21027,21294,
+21437,21449,21615,21941,20007,20831,21837,22074,
+21968,22103,22190,22392,22656,23001,23221,23421,
+23519,23465,24036,24281,24048,24663,24978,25939,
+25216,24060,24675,24652,24341,24195,23610,23238,
+22950,22789,22677,22473,22344,22096,22296,22161,
+22698,20412,22016,19662,21498,21897,22941,22305,
+22288,22398,22569,22608,22764,23147,22473,22230,
+22505,22206,22108,21855,22128,22274,22601,20348,
+20793,21213,21335,20918,20948,20862,20262,19835,
+19915,20023,19901,19452,19551,19455,18936,19107,
+18801,19229,18775,19188,19415,19446,19001,18915,
+18310,18435,19769,21053,20482,19568,19287,18021,
+18459,19228,18361,17767,20028,20628,19372,19416,
+18957,19026,18672,18968,18726,18569,18867,19128,
+19871,19295,19131,19401,20682,19292,19321,19502,
+18928,18047,18699,19209,18832,18297,18815,18604,
+20178,19647,17361,19041,18268,17313,18182,17893,
+17936,19781,17790,19042,21095,18132,17665,17341,
+17128,17406,17292,17643,17442,17695,18154,17340,
+18768,19098,17509,19509,19063,18546,18393,18132,
+18396,18778,19333,19128,19158,19006,19091,18811,
+19475,19535,18993,19461,20631,20623,20704,19752,
+20772,21318,21713,20418,21084,21579,21460,21336,
+21765,23541,25650,19662,19894,22720,21637,20016,
+20757,21998,21559,22457,21854,21819,22265,23239,
+24456,20401,20467,22233,22521,22447,22516,21334,
+20983,20398,20439,19790,20614,20487,20736,20627,
+20941,20581,20801,20606,20857,21972,21812,22374,
+24342,23199,22908,22750,23320,23950,24225,24569,
+24621,23220,24324,23531,22947,22610,22192,22254,
+23435,24494,23672,23830,23583,23063,23548,24934,
+24030,24156,23897,24144,23623,22320,22085,23132,
+23325,22280,23707,24466,21939,22901,22956,22621,
+23259,24987,26604,31259,23972,21330,19653,18690,
+13061,16908,20161,18488,20727,19232,19350,18556,
+20441,20508,19313,18157,17567,18679,19368,19551,
+20168,20271,19926,20337,20625,20847,21013,22587,
+23171,22580,21543,21915,22258,23226,21615,22386,
+22122,24537,22334,21239,22705,23325,20886,21753,
+21940,23583,22355,22071,20978,21984,20714,20625,
+20880,21042,20808,19784,21618,18004,18309,18326,
+19076,19265,22809,18601,16542,17222,18056,19297,
+19679,18100,16042,17255,16779,17172,15790,16194,
+16422,15425,16512,16234,17252,16538,16266,16709,
+16737,16566,19353,17233,17791,18741,20103,17937,
+17712,18372,19080,19329,18141,17088,17188,17463,
+17805,16608,16859,16501,17443,16935,17050,16638,
+16893,16703,16705,16722,16662,16671,16707,16641,
+16713,16799,16835,16863,16804,16824,16779,16844,
+16929,17103,17201,17589,17669,17461,17208,17191,
+17120,17276,17804,17718,17531,17478,17475,17482,
+17346,17226,17113,17312,17288,17164,16992,16974,
+16904,16856,16810,16846,16950,17049,17108,17050,
+16950,17151,17346,17440,17433,17415,17398,17725,
+17742,18011,17571,17796,17831,17961,18125,18300,
+19008,18948,18657,18927,18573,18780,18866,19153,
+20021,19680,18966,18462,19830,24516,19238,19659,
+19289,21160,22118,21567,20082,20767,22319,21382,
+22151,22794,22128,21575,24159,25119,24729,26040,
+27655,27274,26619,26953,27595,27945,27985,28072,
+27903,27687,27307,26876,26407,23742,21036,19155,
+18559,19221,19053,18500,18425,18948,18519,18268,
+18374,18734,18864,19165,19095,19103,19169,19473,
+20127,20529,20571,20691,20610,20566,20344,20698,
+20514,20376,20831,19872,20226,19929,20109,20396,
+20224,20011,20201,20115,20045,19748,19886,19928,
+19951,20245,19930,20171,19830,20031,19794,20216,
+20040,20121,19821,19644,19815,19725,19523,19242,
+19269,19338,19372,19574,19321,19257,19155,19267,
+19188,19197,18900,18825,19218,18858,18843,18978,
+19092,18882,18690,18506,18600,18544,18535,18682,
+18724,18857,18989,19060,19018,18960,18963,18918,
+18913,18923,18909,18891,18849,18761,18681,18958,
+19124,19170,19088,19668,19188,20263,20451,20622,
+19686,19755,19320,19578,20352,20489,20686,21186,
+20922,21579,20893,21962,21407,22016,21939,22395,
+22863,22652,23481,23610,23343,23666,24018,23441,
+25360,24683,22968,23242,23198,23264,23122,23489,
+21863,22759,22624,22383,22219,22478,22563,22729,
+22964,21595,16773,18867,23874,26285,25477,22041,
+21720,21550,21003,19971,20320,19423,19526,15627,
+18687,18032,18156,17111,17314,16794,16818,17305,
+17294,16961,17097,17190,17080,17112,17461,17766,
+16800,16967,17058,17106,17019,16913,17613,17683,
+17610,17562,17784,18101,18093,17593,18148,17637,
+18281,18181,17707,17979,18195,17689,18533,18521,
+18629,17778,17988,18418,18907,19500,18144,19607,
+17576,18577,18539,18291,19512,19868,20238,21233,
+20059,19456,19938,18786,18248,19737,19636,19434,
+20979,19158,20312,20129,20514,19776,21275,20250,
+21336,20888,20535,20970,21220,21285,21476,21606,
+21591,21822,21983,22388,22671,22791,23052,23263,
+23364,23493,23655,23790,23754,24207,24802,24655,
+24364,24779,24580,25156,24492,24411,24025,23590,
+23467,23175,22817,22633,22255,21684,23050,22256,
+25644,21925,23955,23658,23209,22719,22939,23013,
+23035,22999,22395,22526,22857,22701,22501,22470,
+21978,22463,22224,22367,22078,22092,22210,21808,
+20755,20214,20248,21069,21031,21077,20851,20572,
+20016,20348,21046,20468,19246,19570,20457,20047,
+19478,19170,20610,18251,17421,18094,20631,21968,
+20541,20125,18633,18421,19293,20237,20627,20444,
+20136,20733,19930,19720,19944,19913,20044,19283,
+20210,19924,19568,19535,19251,19065,18903,19245,
+19509,19780,20216,20031,19570,19422,19675,19185,
+19243,19143,19044,18458,18960,18576,18732,18945,
+18215,18925,19515,18644,18357,19587,17729,17997,
+18201,18674,17457,17606,17736,17553,17052,17908,
+17947,18102,17846,17274,17241,17365,15344,18088,
+18798,18953,17860,18983,17145,18933,19402,18244,
+18476,18265,19194,18914,19135,19356,19386,19410,
+19468,19044,19758,19459,20190,20034,20748,20997,
+22777,20155,21534,21675,21452,21093,20860,20855,
+21711,26923,28737,22625,21180,20368,20284,20383,
+20427,21532,21502,21238,21576,21843,21252,20988,
+20837,22781,22615,21818,18653,21021,21324,20966,
+22393,24338,21852,20882,20429,19579,21416,21122,
+21174,20760,21324,21088,20992,21510,21674,22517,
+22305,23022,22749,22626,23451,22176,22930,23703,
+24324,23259,22497,22839,22519,22725,22746,22248,
+25027,25444,23794,23576,23233,23508,23289,22653,
+22242,22296,23110,23049,22432,21385,21336,21877,
+22327,23347,24261,21555,23634,23052,23168,22703,
+23033,24389,27140,25005,22323,21423,20221,11970,
+14847,19259,19004,20459,17961,19267,19113,20036,
+19226,18593,19100,19364,18651,18582,19470,19698,
+19972,19939,19348,18752,20105,21216,21519,21577,
+21989,22108,21001,22665,22574,22597,23445,22979,
+22124,23953,22591,22643,22269,23894,23715,23273,
+22329,21935,21436,21838,22852,23154,21807,20184,
+20040,20221,20353,19527,20610,19077,21586,20412,
+19940,18987,18634,18840,18669,18923,18182,17892,
+16545,16975,17264,16893,17701,17281,15606,16479,
+16792,15654,17229,17170,18192,16998,15921,17097,
+16908,16242,16412,19138,17650,18207,17763,19155,
+19573,18227,17990,18290,20789,17611,17923,19428,
+18525,17335,16644,17074,17332,16890,16815,17031,
+16584,16717,16632,16722,16668,16568,16547,16587,
+16466,16666,16587,16588,16820,16775,16719,16752,
+17007,16882,17736,17490,17532,17414,17278,17248,
+17085,17220,17283,17331,17304,17872,17481,17477,
+17529,17544,17716,17670,17487,17145,16901,16951,
+16870,16718,16590,16700,16832,16923,16977,16991,
+16991,17185,17433,17749,17832,17754,17596,18148,
+18524,18493,17877,18128,18270,17961,17988,18335,
+18228,18471,18487,18528,18846,18760,19399,19334,
+19438,19965,21137,20393,20255,22467,23514,23334,
+24727,26357,25505,26462,27528,28108,27897,27185,
+25796,24015,23548,24234,23046,24572,24945,25616,
+25674,26085,26721,27257,28033,28093,27972,27953,
+27003,26466,25629,24226,20865,19930,19577,19517,
+19086,18894,19025,18788,19275,18845,18855,19005,
+18847,19029,19272,19511,19771,19884,20049,20256,
+20515,20766,20680,20588,20433,20214,20501,20231,
+20342,20066,20376,19828,19546,20118,20116,20324,
+20796,21665,20523,20356,20000,20229,19915,19721,
+19518,19743,20079,20067,20496,20023,19931,19852,
+19731,19890,20001,19771,20307,19982,19608,19435,
+19518,19507,19855,19512,19410,19288,19206,19201,
+19354,19361,19278,19001,19124,19245,18984,18891,
+18849,18843,18801,18710,18645,18562,18489,18466,
+18468,18639,18942,18885,18939,18792,18819,18850,
+18895,18852,18868,18886,18941,18897,18991,19092,
+19333,19639,19614,20112,19706,20000,20029,20017,
+19722,20277,20152,19896,20425,20645,20887,21063,
+20439,22125,20942,21844,22085,22215,22347,22515,
+23171,23307,23694,24122,23800,23325,25063,25034,
+24453,23185,20923,23139,23685,22626,22988,23577,
+21708,23091,22152,22506,22065,21804,21772,22279,
+22394,22727,17497,21013,26505,23409,21452,21813,
+21755,22224,22290,21933,20903,19243,20033,19871,
+19233,16506,18037,17716,17793,17742,17760,17263,
+17280,17227,17586,17304,16821,16299,16817,16632,
+17036,16583,16912,16940,16665,17025,17021,17224,
+17526,17781,17775,17546,17856,17390,17934,17933,
+18448,18129,17755,17911,18006,18066,18145,18042,
+17524,17809,17804,18218,17994,18896,18790,17996,
+18442,18030,18458,18220,19475,18382,20027,19884,
+19748,19022,18984,19649,17286,18538,18307,19800,
+20258,20298,20433,20326,20406,20036,20755,20799,
+20559,20616,20496,20519,20812,21090,20793,21795,
+21674,21794,22304,22518,22656,22851,22911,22674,
+23078,22895,23250,24088,23095,23778,24058,24441,
+25210,24768,25041,25107,24541,24718,24094,23815,
+23563,23940,23061,21056,24496,23123,23274,24201,
+23222,24888,24083,23699,24205,22962,23472,23691,
+23046,23085,22922,22651,22797,22914,23445,22750,
+23222,22514,22395,22113,21998,21556,21534,20841,
+21347,21149,21126,21350,20841,20819,21605,20626,
+20372,21411,22324,19659,17540,18131,19729,19527,
+20460,21469,20031,19566,20986,21864,21405,21462,
+21244,21932,21435,21616,21680,21383,21057,20439,
+20536,20269,20324,20849,20597,20212,20061,20278,
+20403,20447,19704,19347,19448,20705,20127,19791,
+19609,19547,19976,20721,19912,19914,19800,19845,
+19582,19488,18600,19380,19218,18296,19000,19161,
+18741,18549,19698,16721,16315,16999,17332,17543,
+18232,17622,16845,18344,17961,17255,16887,16758,
+17313,17126,17041,16423,16462,17040,17484,18006,
+18255,19144,18813,18945,17775,17901,18734,18622,
+18645,19380,18936,19366,19349,19458,19558,19952,
+19590,20024,20067,20341,20468,20409,21059,21493,
+22839,22167,21902,20151,20086,20700,24948,32228,
+32479,29810,26020,21633,21399,20743,21051,20712,
+21432,21096,20823,20888,21110,20770,21236,21387,
+22112,22149,20042,21296,24164,23760,21192,23878,
+22696,24511,20259,18227,17043,20897,22388,20783,
+20457,20210,20013,20784,18311,17958,17405,21030,
+21984,21793,21189,20538,20800,22005,22160,22332,
+21285,21898,22133,21184,21359,22068,23243,22757,
+24825,25181,24183,23430,24411,22590,22545,21754,
+21038,20362,22725,23127,23055,23578,23440,22851,
+22949,23380,21930,23512,23169,23357,23339,25819,
+24435,30073,30018,24903,22419,17379,12606,12837,
+16623,18724,21080,19440,20358,19659,18780,19482,
+17520,18813,18962,17346,17640,19261,19477,19335,
+19745,20744,20289,18754,19623,20296,20174,19346,
+19928,20019,20574,21635,22405,20856,22466,22796,
+22027,22088,22564,23074,25522,25683,25359,25998,
+23801,23577,23745,23388,22735,21869,22540,22747,
+20931,19977,20274,19569,19505,20775,20467,20584,
+18570,18942,19994,22698,18828,19031,18162,19325,
+17802,16486,17649,17036,17753,17592,17176,15841,
+18008,15804,17383,16169,16429,16699,16542,17055,
+17934,17630,16635,16789,19693,19645,18846,18562,
+21186,19881,18281,18498,19068,21270,21457,20628,
+19704,16840,18029,16802,19146,16666,17043,16526,
+16686,16623,16653,16564,16644,16664,16569,16594,
+16677,16516,16740,16583,16694,17028,17024,16938,
+16850,16938,17454,17118,17807,17720,17265,17118,
+17046,17368,17604,18036,17777,18035,17858,18358,
+18128,18120,17759,17550,17525,17186,17241,17236,
+17099,16927,16743,16457,16529,16807,16809,16902,
+16892,16882,17589,17640,18241,18138,18846,18302,
+18770,18977,18648,18467,18132,18460,18350,18222,
+18125,18573,18405,18720,18658,18447,18542,18912,
+19413,20034,21062,24728,25437,26561,28815,30229,
+28869,28108,28045,26424,26814,27430,28537,28654,
+28048,26509,25647,25467,23932,25242,25446,25832,
+26359,25767,25727,25776,27261,27615,27333,27144,
+25500,22145,19800,19829,19351,19480,19497,18990,
+19506,19656,19164,18627,18837,19480,19350,19395,
+19545,19983,20094,20478,20775,20929,20742,20802,
+20805,20620,20732,20499,20406,20406,20139,19811,
+19805,19980,20736,19983,20609,20668,20478,20214,
+20809,20322,21259,20730,20676,20209,20222,20091,
+20294,20323,20124,20377,20328,20691,21440,20656,
+20163,20531,20439,20142,19858,19732,19705,19601,
+19514,19464,19451,19429,19554,19572,19445,19551,
+19388,19613,19593,19576,19584,19482,19303,19170,
+19008,18810,18728,18687,18583,18513,18510,18568,
+18600,18630,18903,18486,18903,18402,18486,18768,
+18948,18931,18899,18972,19056,19141,19123,19329,
+19371,19344,19843,20589,21241,20154,20640,21117,
+22046,23240,20148,20223,20796,20760,20901,21114,
+20867,21454,22052,22234,22477,22620,22616,22857,
+22905,23865,24192,24144,24162,22797,25130,23943,
+24498,22146,22945,22796,22916,22939,23205,21884,
+22476,22255,22521,22589,22191,21934,21829,21359,
+21735,22330,18990,18757,24288,24936,21116,21036,
+21201,21078,21364,21669,20789,18294,19804,19020,
+17547,18267,18300,17088,17331,17325,17139,17241,
+16893,16798,17378,17392,17231,16655,16596,16498,
+16920,17061,16867,16918,16913,17095,17225,17495,
+17417,18007,17950,17961,17761,17805,17589,17633,
+17434,17575,17779,17840,17923,17895,17936,17852,
+17654,17516,17747,17748,18137,18204,17033,18319,
+17859,18596,18842,19015,18919,19371,19557,19305,
+18651,18373,18996,19724,16848,18840,19764,18917,
+19582,20445,19053,21558,20780,20553,20489,19926,
+20065,20264,20160,20702,21276,20985,21363,21587,
+21957,22123,22175,22061,23575,23147,22812,22599,
+22524,22590,22840,22746,23059,23076,23496,23748,
+24040,24533,24651,24889,25035,25061,26012,24042,
+22569,24318,20295,25017,22863,24436,23932,24370,
+25092,24675,25235,24910,24657,24467,24178,24097,
+24121,23541,23084,22798,22695,22527,22406,22407,
+21858,22281,22290,21897,21908,21951,21696,21519,
+21393,21279,21289,21414,20984,20548,19650,19657,
+19043,19352,21252,21357,20089,20377,21309,23855,
+24352,23062,22810,22406,22611,22440,22002,22020,
+21960,22413,21186,21850,21364,21284,20896,21234,
+21081,21626,21348,20900,20836,21077,20592,20560,
+20742,20231,19879,20012,20059,19829,19674,19695,
+19790,19731,19730,20055,19842,19866,19529,19345,
+19219,19148,19689,19298,19551,18748,19187,18168,
+19036,18168,18365,16835,17139,17356,17346,17171,
+17303,17588,16101,17256,16913,16850,17144,16885,
+17790,17146,17387,17325,17435,17718,16751,20134,
+17298,18138,17889,18239,17527,18786,19153,19261,
+19240,19128,19063,19234,20292,19936,20606,20477,
+20507,20356,19429,19846,20536,20185,20619,20420,
+20416,20430,25578,27045,31831,32748,32286,32663,
+32628,32617,31335,28198,23125,21625,24744,21180,
+20769,21088,21030,20919,20498,20820,20432,19930,
+20286,20076,20874,20525,22758,24747,21166,18873,
+19212,19550,22637,21753,22201,18199,19402,20698,
+22295,21006,20497,21134,21669,21544,21752,21455,
+22164,21660,20867,20432,21005,21033,21700,22241,
+24156,23790,24551,20808,21591,23555,23536,24087,
+25581,24072,23898,24580,23298,22293,23328,21540,
+22115,22525,22170,23566,23454,22582,23665,23404,
+23135,22998,24570,23427,23086,23415,23898,24824,
+27565,30525,25881,21260,12400,13360,9083,16464,
+19707,20286,20428,20691,21116,19261,19182,20060,
+18997,17706,18394,18978,18467,19544,19206,19356,
+19529,19438,19782,18952,19366,19235,19082,19752,
+19441,20139,20904,21262,21621,22203,22904,21742,
+20772,21393,21572,23134,25719,28236,23670,24480,
+26190,24570,22303,22416,22539,21592,22680,22776,
+22557,21591,20618,19803,21401,21795,22044,22149,
+23733,21591,22110,18934,20187,20595,21027,18365,
+20688,18285,18048,17742,19731,17513,17343,16191,
+17737,16481,17923,17332,17492,17705,17300,17577,
+17747,18201,18662,17535,18010,20538,19953,20678,
+19285,20382,19198,20667,21133,24744,23484,23712,
+19070,17886,19431,17094,18381,16627,17364,16510,
+16512,16641,16641,16579,16671,16677,16621,16548,
+16633,16884,16661,16985,16914,16932,16999,17009,
+17019,17374,17245,18093,17887,18507,17929,17973,
+18039,18121,18387,18718,18837,18139,18604,18206,
+18549,18524,18347,18169,18154,17868,17693,17501,
+17480,17230,16961,16873,17014,17010,17005,16958,
+17089,17347,17013,17686,17448,17532,19374,18896,
+18708,19894,21555,19512,19436,18697,18597,18147,
+18405,18545,18433,18728,18505,18486,18501,19138,
+19991,21827,22809,24314,26159,25458,27045,26445,
+26370,24805,23061,20941,20670,21461,22428,25320,
+26151,25842,25170,24576,24559,24147,24119,24189,
+24560,26072,24830,26202,26727,25950,25032,23787,
+22182,21417,19302,19134,20410,18955,19110,19742,
+19310,18577,19296,19587,19582,19636,19498,19724,
+19867,20088,20412,20661,21035,21051,20871,20955,
+20886,21150,20892,20698,20535,20238,19791,20095,
+20445,20725,21268,20674,21150,20907,22033,20813,
+21052,20458,20692,21289,21018,20949,19944,20409,
+20236,20442,20110,20209,20678,20356,20529,20550,
+21507,20634,20532,20646,20436,20092,19771,19790,
+19506,19575,19475,19857,19808,19431,19485,19625,
+19638,19766,19859,19703,19709,19761,19578,19330,
+19292,19200,19062,18896,18685,18436,18738,18843,
+19009,18850,18849,18830,18906,18456,18402,18710,
+19087,19353,19344,19629,19692,19635,19704,20208,
+19880,19995,19943,20022,20614,21168,21514,21672,
+21502,20177,20292,20501,20858,21348,21753,21123,
+22082,21170,22245,22420,22833,23045,23283,23022,
+22365,23782,24954,24276,24188,25327,24389,23608,
+22776,21894,21636,22137,21912,22794,22612,22572,
+22320,22096,22071,21983,22011,21942,21600,21604,
+21477,22011,22239,17418,22710,23905,20288,21645,
+21031,20637,20361,20413,19362,18626,18612,18108,
+17478,18663,19260,18963,18942,18993,18043,18245,
+17271,17202,17154,17532,17454,16997,16086,16683,
+16605,16794,16740,16795,16602,17206,17570,17262,
+17833,18232,18245,18294,18027,17628,17748,17628,
+17220,17388,17524,17543,17452,17703,17622,17595,
+17649,17640,17733,17716,17640,17863,18015,17998,
+18138,18413,18895,19241,19340,19421,19199,18573,
+19474,20037,17700,19428,18942,20442,19852,18419,
+17886,18014,19899,20579,19725,20305,20533,20286,
+20186,20416,20325,20992,20906,21214,21537,21469,
+21144,21690,21933,22053,22392,22693,22962,22875,
+22766,22557,22622,22700,22909,23038,23061,23230,
+23539,23583,24178,24411,24415,24697,24079,26880,
+21185,23084,23007,23010,22887,22885,22596,23733,
+24120,24258,25156,26025,24990,24795,24210,24291,
+23697,23578,23444,23178,23073,23148,22935,22989,
+21942,22638,22278,21567,21523,21414,21790,21898,
+20316,20141,19044,20114,23172,23758,22339,21910,
+26162,22926,23457,25342,24519,24889,24281,24367,
+24236,23952,23357,23311,23368,22738,22713,22845,
+22168,22164,21981,21753,21346,21738,21932,21725,
+21531,21390,21132,21537,21266,21154,20828,20766,
+20820,20481,20412,20909,20689,20472,19575,19581,
+19766,19841,19785,19688,20058,19903,19578,19426,
+19967,21941,19210,19620,19339,19384,19039,19885,
+19105,17375,15991,16715,16515,16893,17385,16700,
+16889,17890,16245,16885,16883,17166,17922,17935,
+18037,17349,18182,17137,18602,18337,17816,18813,
+17328,18219,18093,18002,19617,19242,19965,17655,
+19945,20776,18837,19533,19923,20095,19850,20498,
+21076,21083,21038,20644,20481,20567,19863,23298,
+26514,26692,28086,32612,32835,32893,32757,32811,
+32808,32996,32948,32016,25515,23861,21905,21513,
+21072,20573,20790,20812,20860,20453,19981,20631,
+21156,20992,21165,21779,19833,20417,20336,20469,
+21060,20739,25056,25975,23424,21476,21269,20877,
+20750,20685,20709,20439,20616,20927,21730,21629,
+20721,22344,21367,21072,21215,21501,21810,23106,
+23532,24424,23236,23497,22544,22498,22669,23955,
+24324,24639,24984,22535,22400,24933,22816,22365,
+25685,25580,25694,24385,22498,24361,23316,22338,
+23153,22852,22556,22566,22847,23643,27508,28961,
+29454,26913,19245,11275,11554,11706,17156,20535,
+21295,21111,20119,19944,19842,18650,18592,20067,
+18307,19009,19191,20675,17876,19170,20224,19795,
+20530,19848,19928,19918,20482,19863,19381,18684,
+19511,20765,20775,21385,20829,20898,22010,21279,
+21782,23049,23412,25875,23343,22923,21732,20276,
+19824,20011,20400,22638,22390,22614,22673,21865,
+20689,21061,23208,23193,22824,22522,22405,23143,
+24778,23481,23335,23342,19967,19722,19502,19011,
+19203,18354,19263,18688,19848,19672,17289,18251,
+17729,17010,17502,18176,17809,18027,17844,17943,
+18040,18004,18266,19227,18735,18900,21308,20032,
+19320,19017,20641,22249,22338,23182,24402,23670,
+20244,19395,18423,17315,19758,17625,16774,17001,
+16796,16519,16716,16567,16623,16626,16641,16682,
+16589,16678,16968,17215,17059,17515,17586,16988,
+16929,17566,17997,19599,20259,19885,20894,21113,
+20512,19570,19449,19350,18634,18958,19353,18762,
+18966,19043,18624,18651,18848,18742,18618,17931,
+17799,17471,16985,16688,17219,16878,17244,17095,
+17044,17196,17380,17399,17280,17694,20232,23058,
+23433,19784,20136,20046,20074,19497,19220,18672,
+18316,19285,19325,18899,19009,18875,18979,19650,
+20436,22197,23568,25053,23689,21842,21693,20442,
+20247,19792,20109,20354,20562,20872,20748,20947,
+22880,24241,23608,24230,23486,23523,24125,24798,
+25350,26270,25619,25653,25267,24512,24204,24027,
+22740,21514,19335,18654,18520,18934,17833,18443,
+19139,19257,19528,19563,19410,19524,19647,19815,
+19968,19960,19854,19911,20749,20346,20252,20781,
+20797,20703,20726,20505,20063,20149,20190,20026,
+20630,20547,20817,21120,22034,20674,22775,21311,
+20281,21774,20728,20358,21105,21196,20697,20459,
+20786,20625,20556,20568,20751,20793,20274,20466,
+20929,21364,21558,21144,20911,20618,20430,20128,
+20083,20152,19634,19682,19396,19537,19767,19842,
+19793,20211,20171,19658,20005,20297,19890,19621,
+19577,19420,19261,19197,18764,19008,18979,19053,
+19150,18919,19004,19022,18924,18902,18644,18438,
+19231,19505,19527,19671,19716,19963,19974,20589,
+19991,20601,20958,21040,20439,20400,21403,21536,
+20967,21232,20707,20763,20675,21639,21601,21375,
+23463,21679,23407,23160,23270,23407,23829,23622,
+23546,24769,24831,24894,24789,26622,23562,23457,
+21465,20966,22194,22002,22027,22314,21927,21819,
+22114,21235,21758,21993,21993,21052,20691,21251,
+21323,21224,20786,21179,27732,19172,19748,21131,
+19483,20649,19710,18961,20247,19994,19335,17005,
+17173,19308,22252,23642,23160,23547,21327,21558,
+20400,26259,18029,17387,17382,17305,16671,16500,
+16863,16710,16890,17004,17223,17530,17759,17538,
+17826,17559,17426,17628,17506,17186,17374,17469,
+17228,17433,17299,17321,17354,17289,17149,17031,
+17092,17248,17024,17421,17690,17813,17948,17894,
+18150,18468,18737,18868,17940,19282,18883,19837,
+17598,18448,17955,18969,18729,18998,17622,20259,
+20113,19581,18106,18575,19262,19733,19936,19882,
+20131,20280,19791,20483,20662,20980,21138,20691,
+20814,21750,22056,22432,22596,23072,22704,22902,
+22720,22347,22076,22616,22815,22391,23886,23021,
+23325,23764,22422,23327,21813,21162,22699,22216,
+22287,23236,22322,22739,23340,23352,23166,23878,
+24337,23898,24859,25612,25430,25044,24955,24219,
+24835,24194,24168,23780,23643,23782,23395,23283,
+23326,22780,22602,23144,20832,21386,21669,21602,
+24916,24449,23391,27244,23874,18122,24106,23013,
+21105,25655,24435,24259,24789,26322,25491,24591,
+24259,24222,24069,23876,23547,23404,22923,21932,
+22737,22314,21876,21612,22149,22545,22263,22158,
+22030,21508,21747,21345,21537,21312,21567,20848,
+21215,20959,20184,20067,20350,19879,19828,19869,
+20264,19916,19562,19669,19464,19387,19176,19664,
+20958,24227,19692,19095,19418,19314,19205,18989,
+18438,15337,18584,16897,16936,16770,16648,16883,
+16653,16805,18861,19668,18394,18588,18633,17784,
+18282,17619,19194,17291,18545,18278,18665,18048,
+18039,17752,17951,18204,17861,19970,22012,19282,
+19420,19736,20430,20100,20350,20615,21065,21102,
+21279,21057,20359,19959,19779,23968,27087,27192,
+28940,32931,32976,32661,33101,32999,33704,32995,
+32931,33000,32969,32798,29619,29211,27149,26239,
+24252,23474,21317,20916,20344,20729,20059,19600,
+20887,25627,21797,21096,21080,22640,22560,22830,
+21189,22551,23534,24177,22277,21227,20181,20380,
+20370,20579,20019,20982,21156,20388,21846,21738,
+22350,18737,22067,22063,21264,21315,21486,21483,
+23193,23788,23403,22611,22644,23003,23379,23245,
+23145,22986,23353,21639,23490,24189,25792,30264,
+32585,32397,31396,26286,23720,22958,25322,24567,
+24849,22856,16265,21432,15981,16380,17682,16675,
+11244,10323,10725,9501,14010,18121,20117,20707,
+21425,21300,20751,20931,20982,19018,18407,18454,
+19643,19754,18288,18094,19441,20208,19784,20196,
+20829,20689,20575,18994,20385,20646,20258,20748,
+20848,20861,22118,22801,22842,23004,22619,21836,
+22646,22155,22543,22721,23562,23582,23801,23445,
+23683,23468,25995,25131,24119,25374,24861,24285,
+24341,20895,24003,21809,23491,23777,24171,23460,
+23408,25033,24389,24929,22637,25281,24705,24060,
+24694,19893,20549,20226,19797,20115,19173,18985,
+18903,18439,18447,18211,17930,18480,17246,18028,
+19118,18369,18424,20281,19872,19463,20244,21183,
+20773,20178,21042,20800,24585,22569,22747,21762,
+20780,19357,19938,16689,17746,19486,16363,16895,
+16473,15833,16594,16305,16368,16634,16695,16729,
+16679,16578,16835,16979,17102,17613,17661,16972,
+17696,18635,19225,20694,21031,21022,22186,22263,
+21822,21437,20320,20337,20589,20974,19976,19965,
+19994,19695,19941,19758,19273,19332,18972,18693,
+18103,17492,17316,16920,17784,17784,18083,17367,
+18660,18285,18512,17295,17129,18426,18655,19118,
+19265,19226,20595,18846,19890,19923,18794,18795,
+18537,19192,18941,19257,18987,18902,19132,20022,
+21039,21995,23433,24758,23126,22049,21138,19634,
+20128,20369,20586,23334,20945,21319,21849,22198,
+23279,24384,25910,26425,25507,25728,26656,26376,
+27342,28065,27586,26437,27282,26380,25896,25161,
+22199,20001,20004,19614,20196,22770,20733,18435,
+18445,20476,19519,19240,19636,19680,19494,20049,
+19905,19713,19872,19699,20177,19598,20467,19964,
+20095,20146,19866,19829,20033,19716,19468,20466,
+20811,20741,20706,21793,21000,21074,19829,22044,
+20632,21023,19915,21291,21050,21174,21411,20758,
+20584,20690,20757,20876,21655,21534,22027,21102,
+21326,21697,21369,21264,21447,21261,20827,20251,
+19888,19947,19989,19286,19956,19950,19845,19818,
+19850,19958,20586,20023,20323,20131,20091,19656,
+19572,19571,19368,19437,19221,19305,19164,19216,
+19320,19056,19145,19657,18873,19595,19342,19500,
+19896,19787,19817,19815,19741,19773,20118,20276,
+20809,20766,20722,20844,20749,22315,20873,21249,
+20977,21217,21174,21804,21595,21342,22309,21043,
+22998,22065,23574,23704,23705,23823,24096,23910,
+24331,24802,25153,24867,24791,24772,22544,22119,
+20926,21631,21728,21471,22081,21565,21699,22610,
+22035,21244,21620,21346,21107,20760,20780,20796,
+20589,20416,21028,21997,21843,28408,17945,19926,
+19795,18929,19206,19152,20493,18608,20983,17811,
+19971,18965,23304,26931,29199,28527,28272,27770,
+27696,25188,23370,19226,19085,17442,17532,17259,
+17178,17013,17016,16791,17129,17457,17598,18018,
+17673,17538,17519,17478,17342,17244,16908,17106,
+17141,17213,17119,16972,17125,17109,17056,17067,
+17111,17157,17271,17343,17526,17642,17632,17827,
+18137,18084,18177,18468,18259,18126,17364,18523,
+18433,18739,17952,18126,17580,18691,18282,18380,
+17467,18138,19662,19539,19616,19399,20278,19857,
+19780,20185,19817,20721,20903,20912,21003,20917,
+21472,21025,21596,22170,22664,23030,22923,22505,
+22143,21819,22079,22159,22315,22270,21633,20753,
+21617,20759,22311,21704,22165,22397,21677,21809,
+22016,22624,22617,22525,21962,22743,23632,23883,
+25725,24813,25020,28374,25811,25755,25028,25296,
+24190,24862,24994,23923,23925,23276,24267,24815,
+21999,22389,19596,22542,26811,21782,22881,23706,
+24147,22142,21566,25196,26673,22478,23091,23697,
+23583,23880,24006,24417,24546,24720,25704,24926,
+24627,24741,24696,23997,23775,23862,23449,23460,
+23116,22835,22633,22614,22704,22440,22251,22127,
+22061,21548,21597,21376,21666,21403,21112,21057,
+21300,20952,21237,20826,20739,20298,20556,20476,
+20229,21041,20299,19109,19761,19239,19428,19445,
+19638,19357,20385,20424,19656,19587,19272,19139,
+18962,15422,17370,15473,15839,17116,16915,18733,
+18195,19806,19790,19195,20997,19046,18675,19551,
+17831,17681,17610,18273,18472,19444,18839,18326,
+18123,18277,18398,18687,16095,19469,19595,19539,
+20309,19910,20580,20340,21001,21261,21277,21262,
+20719,20207,20044,22846,27616,31576,32919,32742,
+32988,32818,33148,33393,33498,36567,33546,33888,
+34590,34376,34485,34372,34050,33122,32298,33003,
+32996,31616,29773,30257,29612,32063,32268,32195,
+32166,32168,31681,32275,32523,32541,32550,31488,
+30915,25644,21999,20440,21699,21571,22248,21081,
+20500,20111,20619,21316,20886,20289,20176,19449,
+19845,20167,18158,17933,19919,20391,24006,23028,
+20991,21662,22155,21342,21605,22791,22945,23328,
+23277,23523,31006,32294,32022,32094,32515,33454,
+32993,32247,31179,29515,23216,17270,15504,15314,
+15818,14819,13791,13401,14056,13874,12930,13270,
+13853,13442,14777,17558,17935,19243,20273,20842,
+20483,20449,21916,20924,17946,20198,19200,19777,
+18811,19733,19989,20351,19519,20403,20760,21179,
+21185,21507,20938,20518,21463,20830,20487,20540,
+20896,20973,20855,22449,22572,23412,23778,23401,
+22747,22857,23706,25365,24952,24618,25434,24822,
+24582,25142,25024,24657,26345,26826,26113,28074,
+29865,28413,19566,25194,26039,26226,29069,25797,
+27746,25546,21613,24469,26310,24555,21903,23756,
+24339,23561,22389,23082,19752,20618,20835,19461,
+20631,17859,19853,18657,18336,18738,19247,19008,
+18594,19629,19502,19837,21367,21168,20237,21726,
+21080,21543,21509,21426,22947,22013,22318,20365,
+18561,21173,20718,19305,17589,19319,16278,20490,
+17709,17312,17113,16716,16171,16350,16907,16611,
+16766,16609,16663,16887,17706,17844,18099,18149,
+18507,18142,18979,20122,21486,21996,23521,23353,
+23670,23228,21893,21925,22108,21363,21660,20941,
+20607,22139,20727,20520,20333,20667,20316,19689,
+19149,18093,17149,16715,22560,26717,26649,26689,
+21459,20594,19778,18774,17908,17792,18499,18525,
+18038,17652,18216,19829,19043,19239,19602,18879,
+18534,18788,18543,19029,18866,18803,19080,19658,
+21144,20921,20696,20139,19770,19852,19649,19860,
+20115,20515,20920,21332,21467,22273,22795,23343,
+23298,24498,25817,27624,27909,27786,28153,28201,
+28598,27969,26911,26909,26159,25534,24625,21660,
+23223,21236,20156,19758,20026,19274,18908,17583,
+20481,19899,19287,19463,19182,19526,19109,19311,
+19854,20022,19691,19640,19875,19616,20134,20473,
+20197,19686,20244,19978,20259,20301,20374,20949,
+21401,21249,21942,22044,21961,22575,22524,21948,
+22162,21965,21766,21288,21166,21447,21228,20330,
+21069,21048,20961,21303,21023,21277,21609,21461,
+21345,21513,21820,20986,21468,21587,21319,20793,
+20804,20595,20224,20035,19846,19957,20405,20204,
+20107,20152,20419,20205,20143,19742,20460,19873,
+19884,19931,20009,19438,19747,19570,19842,20003,
+19372,19442,19368,19294,19035,19908,19692,19601,
+19880,19821,19842,20043,19931,20178,20251,20354,
+20880,20541,20884,21178,20556,21128,21011,20808,
+21432,21764,21438,21993,21896,21573,22064,21757,
+22794,22629,23821,23716,24257,24408,24485,24601,
+25010,25641,25780,25408,25185,24204,23329,21772,
+21267,21422,21394,21496,21750,22344,22495,21963,
+20743,20644,20851,20621,20586,19983,20644,20791,
+20841,21157,21553,21354,20670,30540,16965,18771,
+19245,19905,19777,19928,19553,19236,19500,19734,
+26882,25656,27252,28638,27246,30516,29751,29979,
+29638,29120,29100,28241,26527,21768,20263,18859,
+17297,16569,16887,17232,17333,17478,17809,17946,
+18017,18031,17859,17650,17505,17124,17037,16959,
+17070,17004,16761,16857,16894,16937,16908,17001,
+16396,16848,17060,17310,17253,17524,17499,17642,
+17676,17485,17655,17772,17947,17663,17758,17840,
+17628,17695,17602,18889,17678,17651,17440,18610,
+18897,18079,18981,19518,19051,19911,19347,19141,
+19429,19192,20296,20449,20520,20622,20289,21085,
+20997,21300,21217,21880,21952,21675,21557,21057,
+22223,22847,21861,20096,21319,20901,21558,21259,
+21840,22039,21549,22002,22132,21876,21745,22320,
+22368,22692,22626,22843,22529,24510,23386,23938,
+23891,24865,25317,25595,25290,26160,24705,24202,
+24965,25062,26169,24779,24193,24496,22773,24174,
+23514,22566,23056,22728,19955,20250,20232,20504,
+22134,22786,23090,21759,21864,23508,23442,23057,
+23656,23404,24039,24440,24291,24450,25479,24879,
+23880,24195,24889,25601,24684,24600,24013,23373,
+23213,23001,23023,22690,22317,22337,22333,22272,
+21903,21783,21984,22165,21759,21454,21387,21585,
+21061,20641,20834,20454,20910,20829,21342,21081,
+22627,20342,20061,19780,20159,19742,19646,19792,
+19506,19587,19586,19380,19503,19471,19669,19062,
+18858,19843,14370,17129,16011,16356,19100,18560,
+18895,19473,19412,18581,18836,19994,18915,18650,
+18052,17688,17998,17895,17904,17529,18070,18483,
+18660,18696,18828,18992,18933,19266,19488,19874,
+20136,20319,20615,20914,21036,21233,21565,21190,
+20544,20537,24858,25866,32539,32592,32775,32996,
+32998,32999,33599,32958,32607,33970,34085,33594,
+33884,33348,32961,32843,32753,32692,32652,32637,
+32631,32175,31866,31711,32206,32532,32637,32880,
+32701,32757,32670,32703,32701,32604,31725,30995,
+28967,27785,27629,26458,26700,22841,23952,24729,
+18856,21251,21147,21054,22719,19425,19357,20320,
+21604,21786,21855,20693,22113,22652,22206,24612,
+23175,23714,24306,25312,23994,26364,26661,26562,
+26422,30712,31864,32283,32606,33039,34166,32928,
+32308,31347,23016,22103,21040,21564,21013,19804,
+19107,18027,17817,18207,18183,17978,17054,17192,
+17487,16503,16944,17236,18507,19105,19369,19026,
+19469,22650,19688,19340,20239,21615,23002,21711,
+22079,19299,19402,19701,19869,19851,19612,20421,
+20494,20511,20829,20815,20963,20952,21392,21210,
+21351,21408,22448,22081,22124,23715,23168,23204,
+23288,23368,24219,24222,25254,25844,25491,25282,
+25107,25833,24126,27796,26235,26319,26322,25263,
+24656,25880,23046,28592,24093,26822,29663,28447,
+26248,22195,26335,24792,24894,25389,24393,23336,
+21152,23664,22717,23502,21746,21969,21459,21951,
+20316,20496,18534,19776,19207,19962,19144,19418,
+19356,21099,20616,21276,21098,22004,22705,21586,
+22275,23429,21594,22862,21809,21330,22160,22178,
+21726,19835,21816,20591,19992,17268,18786,20029,
+18050,17392,17719,16530,16413,17145,16576,16940,
+16695,16844,16630,16700,17025,17769,18004,18299,
+18369,18646,19206,20394,21534,24366,23774,24575,
+24848,24630,23091,23487,23088,22393,22101,23159,
+21458,21253,21030,20805,20028,20198,19527,19458,
+19310,19255,18711,19833,22196,28793,28860,28856,
+26342,24243,20024,19611,19713,18381,18263,18597,
+18291,18303,17547,18102,18840,17884,19839,19241,
+18786,18586,18681,18549,18789,18708,19017,19038,
+18854,18918,19188,19195,19204,19341,19634,19823,
+20133,20233,20580,20865,22494,24158,25371,25758,
+25858,24424,26097,27319,28732,29296,29169,28963,
+28446,28577,27511,26826,25308,26134,23115,22299,
+22242,22629,22271,21594,23025,27260,20706,19022,
+20873,19936,19115,19344,19694,19336,19479,19245,
+19332,19951,19558,19590,19460,19821,20112,20341,
+20238,20418,20269,20328,20469,20389,20502,21366,
+21693,21769,21891,21861,21480,20920,21886,22105,
+21798,21573,21285,21279,21170,20983,21263,21318,
+20906,20943,21312,21085,21065,21294,21639,21683,
+21873,21993,21583,21438,21699,22065,21739,21327,
+21012,21039,20886,20791,20341,20930,19936,20400,
+20734,20503,20864,20376,20342,20152,20832,20071,
+20110,20018,20283,20515,19620,20098,19648,19363,
+19399,19174,18964,19062,18761,20022,20163,20135,
+19808,19794,19933,20268,20545,20382,20379,20823,
+20772,20868,21116,21507,21095,21051,21247,20895,
+21750,20939,21206,22134,21947,23196,22210,22679,
+23051,23043,24618,24604,24651,24879,25293,25527,
+24450,24622,24073,24715,25620,22892,21931,20945,
+20451,21567,21383,20814,20922,20726,20601,21148,
+21217,21068,20825,20193,20531,20786,20604,20181,
+20782,20367,20388,20094,21131,24128,20490,19235,
+20400,20081,19981,19766,19736,18999,19526,18439,
+21353,29673,28418,29087,29492,29045,29778,30156,
+30019,30109,29873,29629,29436,29114,27444,23728,
+21019,18936,17481,17644,18601,18249,17803,17981,
+18183,18665,18157,18080,17823,17384,17217,17204,
+17200,16824,16884,16863,16798,16737,16655,16389,
+16677,16853,16718,17078,17024,17121,17163,17140,
+17149,17071,17404,17320,17706,17523,17500,17610,
+17865,18156,18063,18196,17955,18906,18112,18041,
+18489,19281,19329,19104,19414,19068,18983,19731,
+19065,19283,20000,19404,19734,20144,20337,20817,
+20304,20231,20895,20194,20865,21702,21946,19350,
+18279,19934,21695,21537,20743,20759,20985,20996,
+20929,21277,20860,20551,20889,21736,21669,21693,
+21937,22037,22578,23273,23019,23635,23802,29757,
+25251,25200,26103,24295,24291,23736,23449,23454,
+23205,23951,25987,23698,21522,21600,21255,21222,
+19889,20102,20948,20868,20952,21540,21344,21066,
+21531,21853,22130,21903,21910,22374,22579,22908,
+23013,22809,23741,22792,23388,24499,24156,23922,
+23739,23845,24398,24967,24529,24030,23775,23365,
+23092,22995,22669,22441,22449,22492,22175,22059,
+22000,22381,22092,22050,22368,21622,21108,20453,
+21504,21197,20925,20914,20964,20686,20780,20303,
+20746,20255,21102,19891,20140,20081,19787,19680,
+19645,19869,19754,19640,19710,19391,19861,20069,
+18642,18825,18300,15760,18137,18406,17832,18202,
+18361,18688,18976,18438,18583,18855,18408,18186,
+17859,17929,17860,17873,17961,18073,17916,18330,
+18483,19193,20061,19167,19263,19820,19770,19851,
+19872,20365,20681,20350,21033,21030,20907,20563,
+20742,25641,25434,31995,32989,33073,36128,33570,
+32953,34107,32446,32148,33687,33575,33402,33177,
+33035,32838,32787,32739,32697,32682,32655,32603,
+31647,31329,31473,31570,31581,32250,32133,32072,
+30551,30381,31230,30262,29696,29109,26909,25840,
+25881,24119,25317,26067,27931,28459,30124,31321,
+31782,27810,25644,24937,24636,21029,18709,19626,
+21013,22278,23333,22611,21792,22556,23163,25625,
+25125,24581,25303,29525,32677,32441,30529,29399,
+27702,31161,32011,32325,32682,32644,32479,28828,
+29186,22688,22256,23544,25366,25562,23341,23234,
+22221,21324,20433,20217,19929,19639,18868,18516,
+17897,18150,18107,17801,17887,18464,19408,19259,
+20792,20362,20426,19764,19691,19494,19953,20249,
+20397,20545,20345,20064,20090,19698,20498,20580,
+20685,21168,20891,20770,21460,21166,21375,21587,
+21792,21862,22389,22887,22386,22908,23058,22953,
+23487,23618,24291,24025,27210,26153,24641,25746,
+26986,27051,25553,25674,26229,25241,25404,25128,
+25116,25059,26078,24381,24576,23448,23928,27103,
+28056,27799,26987,26292,27569,20871,25030,25246,
+24729,19494,23104,20856,21478,23146,22451,22217,
+23553,20202,22406,19446,22026,21653,21007,20774,
+21098,21076,23445,21928,21894,23189,20934,23239,
+22940,22806,22005,23682,23290,23765,24645,23452,
+24224,21974,18917,18426,21908,18648,16914,17894,
+18985,19551,18644,17440,17652,16909,16702,18125,
+17172,16950,16655,16630,16857,18172,19671,18640,
+19192,18934,19155,20063,21005,22718,24732,25583,
+25941,25773,24462,24423,23745,23150,23208,23093,
+22320,22353,21054,21330,21770,21527,20770,27103,
+29913,20754,19805,20286,20029,20569,23872,23113,
+26901,22475,21414,20241,19473,18580,18717,19349,
+18447,20004,19479,17373,17466,19142,18213,19185,
+18687,18660,18651,18846,19001,18629,19853,19157,
+19215,19161,19452,19704,19596,19414,19607,19825,
+20128,20440,20523,21612,22437,23206,25774,27126,
+26901,28192,29139,27423,28343,29392,29784,29694,
+28986,28302,28189,27695,28272,26748,22269,23529,
+21028,23542,23440,25366,27018,25083,20722,18397,
+20880,19286,19408,19179,19302,19352,19635,19770,
+19531,19974,19548,20050,19808,19871,20017,20157,
+19969,20296,20409,20490,20758,20977,21265,21609,
+21128,21224,21180,21060,21335,21526,21920,22350,
+21558,21990,21515,21534,21465,21256,21293,21591,
+21507,21330,21247,21205,21397,20952,21355,21495,
+21855,21888,22038,21687,21759,21882,21664,21591,
+21498,21149,21164,21189,21284,20930,20878,20729,
+21130,20782,20548,20814,20087,20341,20670,20186,
+20141,19576,19878,19774,20448,19874,19162,19650,
+19599,19489,19624,19260,19279,20201,20483,20232,
+20016,20315,20323,20563,20709,20944,20925,21037,
+21300,21083,20670,21583,22499,22265,21901,21663,
+21769,21729,22509,22053,21918,24178,22253,22948,
+23156,24045,24473,24890,23690,23895,23888,24042,
+24257,24436,26112,23918,25422,21708,21669,20142,
+21174,21510,20980,21219,21243,20913,19997,21099,
+20896,20588,20627,20856,20755,20697,20233,20389,
+20779,20367,20245,20210,19996,23105,26492,20520,
+20758,21231,20942,26099,19603,19579,18943,19479,
+21973,26811,28055,28623,28993,29341,30227,30140,
+30380,30450,30645,30529,30522,30231,30740,31509,
+30452,28375,22549,24876,22469,18764,18069,18090,
+18022,18099,18118,18200,18031,17931,17586,17415,
+17376,17271,17103,17079,16871,16735,16590,16548,
+16599,16692,16827,16854,16921,16883,16938,16530,
+16464,16534,16590,16911,17217,17583,17930,17139,
+18407,17865,18160,18341,17670,18268,18560,17989,
+17646,18759,18039,19461,19364,20478,20019,19174,
+19165,19846,18981,19893,19971,20529,20505,20241,
+20113,20214,22130,23061,19390,19130,20697,22164,
+20390,20232,20003,19923,20617,20247,20433,20874,
+20747,21098,21153,21036,21871,20787,21840,22039,
+22348,21984,22917,22818,22478,25708,22855,23383,
+23661,24331,24280,24338,24171,23996,23147,20706,
+20408,20743,18573,19075,19668,20023,21230,20725,
+20871,20973,21329,21120,20921,21171,21108,21220,
+21486,21871,21699,22114,21962,21958,21538,22014,
+23177,23441,23568,23432,23828,24201,24181,24195,
+23823,24039,24196,24663,24340,24048,23896,23765,
+23503,23161,22841,22505,23025,22447,22135,22391,
+22159,21903,21923,22387,22692,21513,21291,21179,
+22151,21260,21075,21080,20868,20622,20693,20444,
+20354,20550,20568,20189,20420,19774,19868,19727,
+19857,19569,19485,19314,19488,19669,19391,19826,
+19331,19344,18255,17955,17250,18884,18658,17846,
+18161,18192,18405,18159,18426,18340,18417,18127,
+18169,18076,18035,18003,18008,17969,18366,18873,
+18803,19425,19491,19252,19476,20009,19908,20007,
+20085,20362,20723,20759,20850,21291,20785,20586,
+26880,28956,31870,32741,32919,32256,33152,33450,
+32912,34456,32676,33441,33575,33102,33695,32904,
+32904,32764,32737,32685,32658,32601,32613,32309,
+31808,31629,31804,31694,31412,31479,31308,30797,
+30803,31101,30564,29422,28673,26964,26655,26170,
+25830,24731,23798,23712,24678,25115,26602,27486,
+27416,26177,27810,29561,28159,22672,25141,24037,
+24610,27036,27839,27361,27001,27835,27864,29073,
+28627,29090,30090,30362,28017,26878,25082,22468,
+20985,22058,22182,22902,23341,25182,25285,23905,
+23191,22807,22359,23463,24492,25616,24579,24118,
+23212,21979,21693,22639,22158,21324,20064,19967,
+18813,19460,18999,18447,18428,18906,21933,19857,
+19638,21029,20285,19991,20113,19613,19810,20025,
+20247,19954,20040,19990,20145,20568,20725,20683,
+20820,20725,21017,21102,21540,21585,22117,21775,
+21741,21903,22467,22734,22989,23241,23263,23334,
+23839,23877,24210,24612,25233,25587,25842,27446,
+27794,24147,25470,25365,26396,25410,26118,25132,
+26458,24901,25009,24816,24674,24154,25200,23544,
+24504,24288,24627,25785,24202,24808,25177,24225,
+26116,22524,18252,24636,24704,23682,24912,23241,
+22033,22612,22809,21008,20876,19923,22456,22281,
+20907,21839,21655,23357,23934,23881,23012,23547,
+23979,23843,24122,22956,25808,23777,22109,21816,
+24703,22072,22348,21579,23827,22306,19566,18741,
+17262,18877,18404,16500,16646,16599,16769,16786,
+16731,17040,17273,17084,16954,18134,18182,19313,
+18969,19101,19413,19932,20985,21922,23304,24621,
+25205,25399,25341,24867,24380,24878,25462,25950,
+28695,30984,29851,26205,23500,27050,23622,25665,
+26679,23321,20907,19555,19307,20646,20564,21054,
+21180,21032,21136,20367,19856,19862,19460,19718,
+18472,20571,19551,19746,17529,17275,18129,17008,
+20110,18586,20513,18229,21427,19110,18737,19291,
+18763,18386,19392,19570,19168,19332,19582,19964,
+20179,20432,20801,21276,21955,22831,25724,28566,
+30204,31629,32407,31628,30546,29805,30276,29757,
+29391,29425,28703,27907,27659,24873,24609,26318,
+26568,30117,22803,21503,21345,17984,21749,20925,
+19719,19371,19596,19545,19806,19359,19399,19513,
+19698,19924,20147,19857,20858,20221,20192,20270,
+20153,20166,20554,20752,20988,21318,21451,21495,
+21376,21278,21321,20970,20961,21327,21499,21865,
+21892,21929,21699,21407,21406,21395,21420,21173,
+22334,21474,21843,21689,21452,21499,21819,21908,
+21798,21728,22164,22581,22352,22038,21910,21609,
+21364,21435,21534,21498,21444,20656,21411,21034,
+20915,20227,20599,20041,20078,20118,19623,20784,
+20124,19206,19186,19238,19704,19767,19200,19402,
+19134,18982,19323,19270,18785,19650,20454,20977,
+20736,20812,20819,20982,21340,21152,21159,21528,
+21663,21653,21863,21821,21399,21279,22106,22029,
+22215,22383,22499,22833,23340,22506,21498,23045,
+23888,24712,25386,23502,23749,23609,23367,23671,
+22997,24093,24920,23884,23131,20828,21022,21265,
+21339,20841,20934,20697,21315,21406,21337,20634,
+20777,20301,20183,20526,20620,20648,20883,20440,
+20595,20530,20043,19268,20016,20157,24401,24789,
+20241,20555,21270,21796,21114,20066,19968,19165,
+20024,23626,26847,29074,29385,29609,29943,30684,
+30543,30812,31633,32107,31642,32113,31677,31718,
+31920,32005,30921,29713,21258,19584,18385,18252,
+18438,18705,19030,18372,18143,18141,17886,17499,
+17619,17690,17159,17109,16896,16849,16700,16664,
+16338,16463,16512,16732,16483,16578,16331,16099,
+15957,16181,16601,16953,17442,17309,17565,17562,
+17859,17690,17845,17851,17965,18179,18528,18196,
+19164,18342,18996,19304,19865,19560,19464,18980,
+19482,19806,19872,19978,19521,20658,19959,20838,
+21898,22738,17706,19042,20842,20465,20775,19957,
+19520,19902,19683,19662,20148,19716,19512,20239,
+19276,20019,21510,21027,21014,21389,21580,21409,
+22126,22476,22354,23409,23012,23235,23493,22335,
+22947,21479,18867,22692,23508,21217,19424,19758,
+19089,19671,19971,20013,20400,19869,20319,19837,
+21377,21377,21222,21073,22021,21005,21486,21010,
+21697,21359,21068,21384,21830,22210,22057,22370,
+22775,23120,23167,23619,23853,24393,24622,24062,
+24207,24686,24378,24839,25212,24286,23971,23736,
+23371,23022,22785,22643,22439,22547,22433,22378,
+22299,22206,22084,22365,21587,21480,21480,21420,
+21100,20959,21268,20980,20349,19920,20325,20889,
+21642,20546,19907,19728,19878,19655,19366,19773,
+19720,19703,18951,19334,19179,19551,19615,19475,
+18873,18804,19360,18667,18095,18085,18135,18252,
+18093,18208,18215,18206,18185,18339,18288,18348,
+18302,18342,18379,18264,18213,18273,18594,18825,
+19620,19093,19886,19658,19667,19974,20163,20292,
+20418,20655,20832,21029,20835,21237,20777,20870,
+28039,32379,32880,32432,31893,33545,33867,32751,
+34184,33087,32995,33028,32937,33183,33444,32820,
+32799,32760,32730,32689,32642,32607,32515,32240,
+32167,32111,32046,32000,32127,32061,31892,32341,
+32465,32652,32444,31584,31563,30839,29043,28364,
+28005,27342,26688,25707,24943,24099,24313,23141,
+22518,23690,23827,23781,23680,22815,22380,22218,
+22470,24795,23838,23247,23235,23096,23301,23355,
+23595,24270,25000,25078,24770,22032,21562,21549,
+21676,21996,22009,22538,24925,27117,26368,24463,
+21798,21790,21501,22246,23305,24993,25201,23670,
+22207,21784,22061,21775,23282,23257,21314,18987,
+19185,18475,18582,18627,18582,18864,23274,25020,
+19380,20865,20095,19937,19022,19665,19908,19254,
+19950,20217,19967,19873,20153,20392,20781,20662,
+21030,20885,21126,21706,21351,21417,21963,21837,
+22220,22056,22384,23132,23727,23662,23994,24132,
+24907,24303,27079,24917,25532,26762,26501,26503,
+26496,26763,26733,26568,28076,25742,25431,25236,
+25057,25137,25164,25449,24779,25197,23954,23826,
+23804,22061,22442,23271,22698,23505,22853,23701,
+23301,24177,24908,23805,22302,24054,25549,22781,
+24404,23034,24685,25370,23313,25668,22584,23857,
+23058,24181,24254,25338,24964,23709,23172,21902,
+23927,23862,24345,25897,22878,24609,25401,23687,
+23650,24513,21921,18191,24411,22042,22640,14727,
+19611,18164,17621,17860,16131,16068,16572,15808,
+16874,17774,16728,17452,17145,17291,19902,18635,
+19742,19460,19299,19903,20304,21083,22163,23031,
+24690,25605,26143,25804,25219,24772,29470,31353,
+32132,31182,24164,23619,23822,24318,23016,22848,
+25973,20057,19919,21264,25846,23945,19482,18862,
+19990,20154,20964,21164,19245,19806,19050,19740,
+19238,19369,19106,19221,18941,17727,17829,18440,
+16854,19581,18633,19217,19094,19497,18962,19741,
+19142,20225,18876,19173,19560,19610,20091,20279,
+20397,20439,21038,21426,22174,23415,25416,28519,
+30763,32478,32499,32458,32448,31946,31350,30738,
+30491,30813,29631,32253,31018,30351,27541,24624,
+23701,22769,22665,21890,23217,20333,20193,19956,
+19488,19704,19634,19845,19757,19548,19760,19670,
+19733,19932,20037,20150,20367,20399,20950,20340,
+20655,20453,20498,20883,21112,21259,21309,21516,
+21360,21306,21451,21300,21097,21143,21342,21672,
+21723,21768,21956,22031,22005,21903,22367,21831,
+21906,22265,21981,21646,21976,21519,21810,21692,
+22449,21972,22002,22338,22731,22631,22357,22134,
+21842,22074,21791,21246,21433,21326,21489,21429,
+21156,20900,20925,20589,21039,20079,20202,20348,
+19782,19371,19635,19813,20393,19974,19560,19526,
+19775,19260,18987,19381,18581,20127,20298,20707,
+21063,21106,21465,21327,21270,21633,21734,21844,
+21976,21945,22218,22451,22268,23291,22995,22183,
+23232,22440,23560,22898,22731,24367,22233,24415,
+24354,24408,24087,22827,22980,23221,22877,23330,
+23723,23358,23555,23466,21831,20106,20393,21101,
+21532,20807,20763,20586,21024,22641,21688,21374,
+20585,20162,20433,20504,20173,20298,20401,20153,
+19612,19788,20360,20619,20958,20526,19794,21600,
+28428,22076,21399,20527,22592,20582,19728,19761,
+19827,21480,26277,29952,29647,29739,30009,30074,
+30843,31847,32514,32488,31891,31491,31468,32073,
+31842,32113,31391,30573,24779,20836,19510,19164,
+19028,18649,18528,18267,18032,17382,17802,17652,
+17907,17680,17476,17221,17013,16845,16869,16734,
+16150,16589,16740,16611,16368,16159,16171,16278,
+16392,16621,17169,17307,17358,17527,17130,17401,
+17244,17555,17507,17785,18102,18309,18695,18247,
+18205,18054,18110,18069,18800,18897,20125,18661,
+20143,20316,19817,20137,20296,20060,22072,18127,
+18582,19299,21127,21067,19407,21089,21162,19766,
+18751,19512,19564,20361,19617,19619,19655,19178,
+20622,20163,20257,21171,20515,20721,21015,21356,
+21495,21680,21981,24342,25575,21108,18911,22563,
+23045,22086,21345,18285,19007,19428,20546,20512,
+20448,20481,20253,20094,19452,20147,20004,19882,
+20265,20730,20952,20289,20147,20588,20407,20688,
+21108,21297,21456,21510,21678,21882,22332,22176,
+22293,22741,22776,23179,23388,24033,24687,26103,
+24789,25373,25203,25703,24886,24866,24071,23522,
+23253,22949,22847,22556,22666,22192,22504,22341,
+22274,22125,22143,22251,21374,21554,21297,21292,
+21078,20956,21186,21494,21098,20805,20378,20326,
+20335,20068,19768,19793,19680,19818,19777,19860,
+20055,19418,19812,19203,18881,18800,19073,18899,
+18638,18882,18771,18349,18397,18648,18486,18611,
+18536,18349,18366,18378,18324,18399,18405,18512,
+18357,18670,18855,18771,18737,18810,18967,19341,
+19277,19590,19618,19866,19697,19923,20111,20281,
+20654,20859,21093,21177,20991,21157,21033,22206,
+30870,32701,33348,32997,32998,33246,33560,34537,
+34479,33649,33828,33587,33625,32874,33236,32925,
+32742,32742,32723,32687,32638,32594,32519,32401,
+32306,32254,32221,32148,32141,32484,32878,32941,
+33003,32984,32901,32701,32288,31884,30485,29416,
+29014,28542,27909,27384,26898,26222,25807,25496,
+25173,24785,24780,24564,24567,24294,24364,23587,
+23374,23101,23351,23145,22996,23613,23579,23691,
+23778,23184,22954,22597,22491,21843,21716,21705,
+21805,21993,22334,22613,23025,23110,24300,20937,
+20555,20769,20961,21780,24172,27432,26358,25058,
+23118,22824,23118,24285,25324,23892,22167,19989,
+19147,18955,19361,20508,25546,21289,20107,23516,
+18936,19794,19682,19968,19998,19107,19901,20126,
+20061,20484,20085,20202,20237,20283,20548,20700,
+20927,20648,20907,20895,20849,22158,21885,22385,
+22237,22253,22755,23214,24216,24792,24586,25068,
+25165,25100,25098,25413,25905,24834,23847,24944,
+25815,25080,25737,25269,25257,26103,24914,25011,
+25350,24785,24823,25198,25364,24804,23411,23196,
+22713,22507,21019,22382,22626,22610,21861,21429,
+21621,22248,22146,22077,24223,28120,23274,24241,
+23210,23065,25374,21738,23504,23897,23070,22019,
+21647,22359,25011,24627,25010,24947,24956,24379,
+24366,24297,23580,22937,22065,24043,24050,23907,
+23073,20491,23085,21595,21586,23110,21153,22125,
+17361,18821,18355,19379,19023,18095,16311,16824,
+17227,16743,17664,17595,17308,17319,19238,19662,
+18676,19687,19680,20036,20538,20917,21739,23022,
+24009,27852,31479,30345,25328,25597,26121,25398,
+24805,24639,23416,23004,23447,23251,22801,21116,
+19611,19628,19302,18531,18075,20375,19369,18109,
+18913,19498,19570,20518,19844,23002,19973,19775,
+19863,19487,18787,18873,18597,18858,17862,18675,
+19565,18678,19098,18559,17661,19885,18431,19531,
+19388,19332,19731,19838,20336,20594,21654,21899,
+21499,21623,22039,21691,22263,25020,28623,30040,
+31141,32017,32287,32237,32254,32291,31879,30907,
+31164,31240,28608,27719,23413,23099,22667,22971,
+23567,23454,22891,22440,21241,20850,20551,20190,
+19835,19643,20124,20334,19626,20349,19879,20038,
+19724,19978,20231,20934,20469,20382,20372,20338,
+20786,20779,21004,20842,21038,21112,21367,21458,
+21451,21510,21592,21570,21661,21535,21815,21790,
+21920,21926,21731,22147,22146,22325,22573,22263,
+22084,23683,21990,22049,22530,22584,22385,21779,
+21972,22233,22376,22640,22730,22161,22359,22149,
+22170,22116,21987,22316,22044,22229,21996,21948,
+21712,21624,21387,20819,20887,20934,21624,20516,
+20237,20146,20418,20614,20857,19917,20625,20307,
+19186,19820,19130,19457,19917,20596,21288,21546,
+21417,21681,21599,21457,21649,21940,22261,22136,
+22518,23322,22422,22693,22303,22398,22761,22882,
+23756,23961,23700,23327,25318,25979,23220,24198,
+25053,23940,23874,25539,22560,22568,23204,23496,
+23235,22935,22894,23708,20948,21417,20395,20736,
+21153,20398,19785,19545,20253,21250,21201,21135,
+20795,21481,20210,19863,19800,19791,19668,20148,
+19855,19599,20268,19728,19703,20082,19007,21951,
+22207,29560,17519,19580,23247,20850,20586,19945,
+19974,19814,26668,30069,29499,29874,30089,30356,
+30956,32141,32539,32504,32129,31587,31774,31299,
+31269,31195,30988,30355,28375,22060,20415,18870,
+17802,18285,18026,17951,18149,18141,18009,18510,
+18017,18340,17900,17694,17491,17480,17435,17293,
+16866,16831,16449,16365,16664,16524,16638,16672,
+17325,17553,17716,17904,17827,17773,17758,17729,
+17400,17414,17510,17481,17904,18204,18322,18612,
+19292,18573,17235,18081,19439,18853,19272,19387,
+18996,19425,20887,19362,21615,17661,18460,19223,
+19917,20059,20741,20871,19690,19497,19689,20240,
+19680,18727,19432,19509,19522,20037,20034,20466,
+20487,20170,20187,21018,21183,20640,21566,20739,
+20357,18754,18965,21341,22854,21787,22086,22746,
+19757,20387,19825,19942,20958,20347,20154,19771,
+19725,20469,19402,20027,20187,20990,21072,18940,
+19731,19589,20039,20484,20667,20580,20645,20837,
+21088,21396,21319,21621,21642,21209,21504,22167,
+22230,22161,22440,22765,22981,23202,23598,23925,
+24003,24482,24570,24459,25023,24393,24040,23804,
+23409,23205,22896,22770,22347,22470,22672,22594,
+22371,22260,21984,21544,21684,21873,21348,21082,
+21645,21444,21193,21414,21035,20786,20446,20509,
+20482,20574,20305,20280,20153,20547,19605,20283,
+19164,19154,19707,19557,19182,18979,19186,18834,
+18796,18680,18108,18291,18237,18376,18529,18627,
+18665,18550,18528,18546,18718,18640,18584,18644,
+18881,18885,18800,19187,19208,19411,19233,19950,
+20045,19878,19744,19831,20138,20280,20571,20682,
+20907,21135,21348,21368,20952,21023,20908,23760,
+31571,32247,33000,32989,32997,33906,33564,33332,
+33431,33397,33615,33258,33343,33069,32966,32807,
+32757,32718,32702,32644,32587,32593,32607,32509,
+32539,32385,32360,32302,32455,32996,32988,32996,
+33235,33003,33360,33032,32857,32193,31574,30120,
+29663,29184,28447,27768,27354,27015,26691,26325,
+26363,25914,26023,25842,25841,25818,25913,25812,
+25648,25117,24978,24639,24556,25117,25134,25095,
+24709,24899,26689,26541,24279,22748,21846,21827,
+21870,21967,21990,21787,21399,20709,20047,19622,
+19170,18768,19024,19908,26514,28011,27441,24900,
+23010,22494,22304,23507,22296,22141,20997,19093,
+18895,21420,23608,23980,25415,22939,20676,19892,
+20001,19821,19281,19109,19776,19074,19430,19918,
+19989,20187,19965,20143,20100,20282,19992,20659,
+20601,20511,21015,20619,21315,21648,21996,21948,
+21879,22243,22296,22422,23130,24259,25189,25476,
+25597,25400,25790,25850,26452,26176,25854,25188,
+25558,25010,25037,25101,25017,25650,25342,25221,
+25157,23990,23712,24866,24252,24801,23493,24948,
+24258,21798,21320,21418,21012,21430,21399,20918,
+21135,20985,21092,21438,21505,22337,22140,27849,
+21441,24663,24732,25995,25455,23631,25679,24336,
+24320,23385,23586,23823,23522,23759,22898,22712,
+21183,23653,22159,21728,21763,22521,21733,22009,
+20407,20519,21079,21837,23179,21707,21881,21198,
+21275,18939,17308,20283,20061,18894,18141,17131,
+15981,17331,18864,17326,19183,18051,18135,19017,
+18060,19768,19774,19981,20360,21118,22194,23073,
+23528,23886,24103,24419,25068,24927,25051,24804,
+24147,23804,23052,22681,22225,22020,20973,20529,
+19740,19245,19350,19237,18874,18960,19266,19386,
+19417,19405,19547,20844,20775,20255,20547,20312,
+20242,19827,19468,19022,18399,17894,18540,18113,
+18810,19412,17706,21107,18952,18389,19554,19493,
+20245,20199,20798,20449,21404,23903,26418,22926,
+23439,23534,25378,26572,25894,26319,28551,29856,
+30724,30897,31402,31792,32022,31822,31470,30965,
+32859,32052,24741,23614,23055,22340,21986,21363,
+21520,21727,21500,21346,21282,20514,20568,20373,
+20071,20545,20411,20442,20319,20268,20620,19926,
+20022,20031,20326,20894,21339,20307,20520,20610,
+21649,20720,21167,21294,21018,21127,21249,21443,
+21700,21814,21758,21852,21721,21489,21584,21897,
+22014,22009,21972,21491,21866,22468,22692,22962,
+22821,22764,22721,22111,22062,22024,22364,21887,
+22050,22228,22584,22719,22801,22533,22020,22024,
+22068,22185,22323,22478,21903,22626,21665,22710,
+21929,21847,22035,21518,21506,21444,21436,19827,
+22806,20456,20352,21009,20650,19951,19469,19636,
+20535,20810,19742,20068,18910,21120,21229,21434,
+21776,21866,21904,21806,21813,22289,22273,22432,
+22683,23401,22389,22897,22740,22855,22991,22645,
+22706,23072,23925,24450,25404,26883,23507,23726,
+23340,23237,24081,24074,22008,22076,22084,22142,
+22293,22870,22755,22921,20741,21252,21094,21147,
+20455,20257,20318,20673,19828,20785,21198,20606,
+20287,20015,19812,19581,19512,19293,19422,20000,
+19898,19875,20064,20106,19971,19608,20397,22212,
+23225,23609,30372,20568,20572,21468,20124,20558,
+20199,20150,23746,30124,30440,30594,30716,31083,
+31149,31585,31932,32154,31789,31534,31429,31438,
+31404,31546,31350,30846,31411,29886,24468,20194,
+18794,18274,17562,17892,18171,18216,18060,18202,
+18411,18663,18422,18534,18701,18402,18206,17976,
+17266,16935,17555,16010,17610,16797,17088,17968,
+18696,17442,17524,17733,17847,17751,17601,17552,
+17532,17536,17427,17484,17527,17591,17857,17910,
+18216,19204,18465,18387,18498,18717,19313,19260,
+19455,19755,19484,16900,18053,18840,19473,20353,
+20542,19403,19730,20139,19790,18660,19172,19035,
+18609,19082,19068,19920,19653,19860,20709,20237,
+20600,20422,19905,21648,21588,21048,20238,19333,
+19986,21545,21135,21126,22698,22322,17583,19811,
+19442,19768,20170,20073,20619,19677,19614,19292,
+19455,20100,19248,19407,18771,19055,19602,19536,
+19533,19775,20440,20353,20394,20575,20847,20922,
+21021,21070,21424,21681,21636,21780,21913,22037,
+22234,22276,22412,22809,22860,23016,23328,23528,
+23612,24120,24117,24346,24764,24680,24051,23985,
+23722,23508,23021,22702,22638,22650,22545,22379,
+22110,21507,22071,22066,21800,22254,21954,21964,
+21601,21532,21349,20664,20521,20529,20733,20853,
+20893,21450,20805,20643,20291,19638,19589,19869,
+20027,19938,19631,19515,19364,19321,19455,19393,
+18778,18361,18380,18157,18165,18245,18172,18489,
+18660,18661,18670,18703,18834,19023,18990,18904,
+19048,18965,19189,19484,20340,19463,19907,20454,
+19575,20559,19879,20229,21054,20124,20821,21412,
+21269,21391,21465,21477,21257,20808,21118,24874,
+32538,32982,33322,32952,33282,33462,33513,33847,
+33958,33752,33658,33596,33180,33327,32635,32778,
+32732,32694,32674,32653,32631,32589,32631,32582,
+32551,32569,32503,32385,32466,32613,32988,32988,
+32996,32982,32988,32886,32763,32710,31844,31104,
+29967,29310,28830,28314,27721,27333,27018,26855,
+26575,26120,25740,25624,25712,25443,25182,25368,
+25229,24819,24897,24872,25095,24624,24885,25244,
+26646,28233,28272,27123,25848,24296,22576,21825,
+21513,21294,20750,19623,18837,18968,19164,18524,
+18512,18497,18425,22227,25168,26947,22200,22335,
+21284,21255,20841,20676,19380,19365,18546,18372,
+19707,20875,23417,23601,23676,24671,20801,20166,
+19164,19002,18500,18684,19322,19341,19650,19689,
+19856,20007,19803,19965,20054,19998,19971,19724,
+20259,20577,21376,21035,22026,21912,21393,21956,
+22542,22295,22520,21674,21759,23689,24497,24642,
+25110,24886,26204,26496,26392,26036,25629,25464,
+25263,24810,25363,24747,24503,24944,24960,25739,
+27399,29388,28391,23448,23532,23101,22740,23146,
+22314,22848,21580,21686,21806,21534,21709,21357,
+21048,21800,20927,19961,21131,21774,22632,25215,
+22766,27083,22841,24801,23748,21676,24030,21524,
+23685,22700,21261,21264,21246,23016,22436,21627,
+20640,21597,20963,21672,21708,20052,20703,19826,
+20202,20912,19884,19312,22886,19368,20731,23148,
+21186,15204,18127,18543,19828,19874,16540,18036,
+17058,17206,17151,17157,18438,17583,18209,17601,
+18645,17874,19822,20058,20174,21083,22162,22824,
+23211,23164,23215,23208,23185,23617,23535,22864,
+22809,22305,21561,21495,21059,20736,20503,20109,
+19470,19347,19288,19068,19100,19234,19087,19154,
+19170,18886,19161,19510,21051,28680,22317,21400,
+20378,19959,19668,19015,18947,18565,18535,19650,
+18117,19868,19275,19167,19033,19686,19702,20294,
+20709,21420,21989,23688,24633,25796,26128,27036,
+26441,25552,25314,28614,30748,32112,30534,32190,
+30669,32223,31755,31667,31875,31053,31010,31327,
+27969,23023,23223,22906,22314,22275,22097,22077,
+21861,21761,20964,21006,21098,20877,20494,20190,
+20127,20086,20367,20417,20393,20558,20142,20300,
+20344,20485,20652,20675,20896,21054,20137,21196,
+20634,20818,21976,20991,21014,21434,21882,21851,
+21789,21661,21584,21962,22018,21995,22012,22020,
+21695,22004,21981,22221,22458,22962,21633,22215,
+22431,22758,23040,22500,21748,22193,22307,22354,
+22773,22124,22352,23063,22697,22369,21935,21938,
+21847,21711,23406,22815,22536,21867,22739,21930,
+21761,21810,21942,22029,21990,21798,22296,20874,
+22492,20457,20481,20639,20371,19321,19905,21352,
+20554,21751,20597,20211,18715,20821,21609,22248,
+22380,22847,22366,22319,22245,22593,22566,22854,
+22686,23374,23172,23081,23197,23475,23211,23022,
+23170,23818,23900,23942,24476,25440,23011,23925,
+22566,21378,21923,21567,21458,21903,21768,21263,
+21903,22665,22650,20687,20498,21380,20483,20494,
+20825,20293,20602,21229,21015,21211,20463,20298,
+20079,20042,19820,19634,19949,20070,19893,19967,
+19794,19307,19773,19934,20026,19480,21708,21504,
+22734,22047,21921,28971,19282,23441,21218,21103,
+25025,20897,23697,31830,32151,31370,31304,31229,
+31248,31251,31332,31384,31428,31386,31452,31709,
+31388,31380,31285,30900,30685,30075,29322,26163,
+19452,18323,18268,18400,18191,18755,18495,18321,
+19321,19023,18684,20545,20501,20350,20831,19647,
+19496,17618,16242,17216,17011,16706,17343,17855,
+18057,17745,17517,17635,17971,17826,17595,17475,
+17574,17553,17235,17308,17230,17397,17883,17989,
+17585,18195,18283,19003,18101,19886,19432,18938,
+18561,17642,17040,18202,19035,18347,18471,18726,
+18586,19173,19409,19308,18933,18798,19256,18570,
+18751,19237,19388,20279,19484,19273,19852,19890,
+20459,20773,20250,19221,19731,19632,19647,20060,
+19993,20579,20376,21612,18880,19822,19996,21150,
+20631,20823,20724,19749,19464,20198,20183,19587,
+19691,19916,18989,18309,19152,19297,19376,19136,
+19245,19986,20010,20375,20480,20619,20958,20790,
+20831,20713,21255,21441,21648,21641,21939,22013,
+22203,22492,22537,22442,22308,23120,23132,23280,
+23463,24312,24168,24454,24474,25134,24431,23946,
+23823,23583,23685,23496,23510,23091,22627,22863,
+22656,22435,22244,22140,22164,21687,22113,21526,
+20962,21240,21332,21237,20895,21010,21470,20889,
+20892,20521,20334,20376,20137,19972,20113,20174,
+19854,19946,20180,20515,20071,19516,19283,19200,
+18975,18690,18225,18272,18182,18571,18402,18381,
+18678,18629,18687,19637,18477,19238,19150,19506,
+19019,19226,19275,19578,19394,20551,19512,19800,
+19858,19812,20170,20184,20380,20559,21195,21107,
+21277,21474,21518,21325,21643,21113,21229,29916,
+32727,32510,33073,33392,33446,36591,34077,37709,
+34179,33567,33926,33934,33789,33452,32802,32802,
+32879,32762,32667,32664,32652,32631,32578,32585,
+32571,32724,32514,32454,32480,32610,32640,32595,
+32597,32418,32634,32606,32550,32499,31797,31240,
+30408,29645,29055,28512,27757,27223,26904,26886,
+26812,26469,25856,25416,24968,24597,24732,24772,
+24991,25172,26065,27714,28181,28080,28106,28686,
+28825,29111,28681,28044,26604,26022,25578,22477,
+21096,20475,19234,18252,18101,18097,18051,18185,
+23519,21446,20535,18269,19182,20243,19979,20216,
+19734,19753,19392,19312,18630,18399,18608,17604,
+19626,21513,22285,23584,23856,22067,19866,19730,
+19681,19592,19764,19281,19254,19665,19560,19832,
+19638,19715,19811,20184,20319,20460,20472,20404,
+20787,21133,21447,21050,21992,21597,21044,21186,
+21575,23173,22718,22829,23046,22795,23507,23686,
+23438,25110,25539,25732,26045,25400,25560,25257,
+25029,25127,24839,26108,24516,25150,24746,25816,
+29211,23961,22709,23450,22964,23088,26531,28656,
+23505,25197,25150,21446,21329,22000,22248,21777,
+21249,20509,20091,20943,20988,21786,22064,21291,
+21654,22173,26202,25974,22903,22294,23348,22014,
+21813,22338,21086,21480,21114,21965,23107,22071,
+19344,20412,21236,21353,20358,20292,21654,19887,
+19816,18986,21719,18961,20292,21786,18500,19763,
+20469,23287,17457,19641,18140,18951,18615,17691,
+17904,18229,20938,16867,18205,17954,17666,18630,
+18830,19128,19404,19934,20305,20810,21092,22381,
+21742,22365,22332,22419,21805,21489,20991,21147,
+21095,21190,20766,20907,20290,19703,19893,19719,
+19566,19305,19263,19299,19275,19564,19529,19111,
+19002,18795,19230,19257,19756,21012,19455,20004,
+24256,19286,19408,19373,18831,18756,18722,19162,
+18531,19018,19887,18707,19230,19670,19872,20919,
+21448,21385,22410,24731,24424,25398,26575,27694,
+27507,27116,27561,29192,30690,31017,31340,31416,
+31537,31528,31470,31592,31415,31449,31933,28314,
+23615,23900,22995,22439,22474,22313,22139,21969,
+22048,21246,21285,20977,21070,20757,20487,20294,
+20409,20376,20443,20667,20235,20543,20474,20595,
+20596,20454,20649,20814,20970,20889,20622,20857,
+22135,21180,21270,21716,21564,22037,21924,21965,
+22076,21888,21921,22067,22164,22188,22273,22660,
+22114,22046,22120,22052,22190,22350,22926,22926,
+23196,22668,22824,23139,22741,23787,22776,22573,
+22881,23183,22889,23083,23370,22926,22356,22618,
+22904,22979,22739,23016,23260,22631,21141,20394,
+21367,21584,21784,22436,22243,22359,21906,21899,
+21146,22245,21667,21549,21546,21759,20293,20484,
+21748,20371,21710,20481,19999,21468,22080,22971,
+22938,22768,22597,23243,22767,22759,22950,22779,
+23076,23376,23504,23842,23856,23697,23802,23603,
+23802,24318,24039,24136,25282,25019,23660,22287,
+22125,20858,21349,22325,21761,21844,21658,21466,
+22074,22117,22478,19542,19005,21417,20353,20222,
+19829,19917,21097,23523,22252,21079,20531,19827,
+20064,20147,20115,20209,19672,20097,19438,19425,
+19574,19236,19884,19980,20190,20088,20949,19368,
+20437,20370,21104,20203,26508,25416,27726,27765,
+21490,25765,22930,30498,32996,32619,31721,31593,
+31463,31280,31223,31262,31246,31329,31369,31530,
+31448,31373,31376,30905,30162,29382,28563,27217,
+23718,20536,19786,19457,19572,18921,19004,19305,
+19248,19095,20006,20341,21912,26902,29184,27030,
+21382,18321,16622,16667,16663,16695,17455,17688,
+17387,17532,17559,17670,17652,17502,17430,17175,
+17475,17549,17485,17430,17125,17426,17526,17679,
+17547,17595,17898,18715,18501,19151,19087,19279,
+17189,17524,18308,17700,17826,17625,17962,18016,
+18085,18054,18546,19461,19436,18261,18060,18897,
+18604,18140,19968,18752,18418,20112,20227,20833,
+21019,20620,18598,19571,20682,20716,23015,21525,
+20742,19894,19224,19392,19669,19331,20482,21309,
+20137,19482,19788,19689,20652,20212,20521,19681,
+19664,19941,18144,18149,18465,18597,19362,19389,
+19383,19026,19374,20418,20622,20804,20981,20865,
+20881,20883,21862,21432,21923,21814,21835,21879,
+22150,22257,22389,22226,22410,22687,22861,23417,
+23340,23475,24213,24677,24882,24661,24820,24603,
+24059,24149,23812,22716,23189,22399,22255,22093,
+22383,22592,22453,22962,22711,22959,21819,21873,
+21460,21612,21437,21133,20838,20896,20584,20499,
+20643,20537,20538,20510,20284,20356,20547,19727,
+20168,20196,20265,20112,21127,19794,19947,19353,
+19293,19113,18792,18387,18223,18298,18381,18263,
+18851,18496,19206,18903,17875,19782,19858,19288,
+19720,19380,19395,19450,19736,19656,20285,19787,
+19694,19911,20422,20342,20559,20499,20610,20830,
+21066,21349,21394,21292,21165,21099,22440,30597,
+32694,33558,32400,33359,36315,35269,33633,33675,
+33501,33783,34155,33369,33873,34008,33227,32931,
+32902,32910,32737,32673,32672,32665,32659,32605,
+32587,32575,32667,32514,32530,32517,32543,32458,
+32502,32607,32376,32267,32149,31953,31697,31269,
+30751,30189,29364,28634,28012,27439,27060,26482,
+26423,26213,26448,25643,24844,24657,24700,24632,
+24792,24922,25173,26171,25547,25974,26812,28046,
+28017,28018,28362,29043,28963,28201,27014,25295,
+23294,20128,18915,18214,17975,17607,18939,19259,
+19646,22703,18279,18684,18304,18457,18453,18210,
+17985,18378,18400,18462,21921,18885,18729,16725,
+22623,19528,22541,21930,20947,19949,19338,18669,
+18998,19140,19850,20068,19913,20349,20302,20409,
+20363,19710,19743,19802,19976,20272,20692,20193,
+20269,21347,21597,22256,21996,22371,21603,21670,
+22507,22935,23286,23007,23135,24090,23586,24093,
+24981,26419,26493,26430,25946,24969,24471,24705,
+24325,24495,24402,24118,24781,23687,23559,22566,
+22221,22554,22667,21947,22410,22682,22279,23713,
+24825,23521,24206,21627,21693,20592,20010,20836,
+20654,18585,19470,19539,20766,22098,22950,21399,
+20697,20325,20677,19822,20043,20589,21443,21855,
+20684,20420,23318,20441,21547,21164,20855,20755,
+20004,20211,20580,20028,20027,19386,20639,20481,
+19971,18805,18231,21234,17710,20221,19503,16893,
+19543,20715,21832,22101,23101,20252,21438,16983,
+20681,17391,18912,20749,18265,17103,17498,17587,
+19095,18303,18946,19979,19719,20644,21413,20915,
+20265,20657,21328,21401,21027,20820,19898,20570,
+20588,20250,20562,20381,19787,19308,19747,19185,
+19137,19304,19867,19769,19799,19908,19792,19543,
+19421,18731,19265,19910,19831,19980,20435,19992,
+19962,19919,19925,19572,19213,19130,18923,19044,
+20698,19278,19491,19167,19098,19176,19494,26896,
+28542,29832,27951,30448,25677,25716,27288,28476,
+29321,32493,31998,32339,31462,31355,31205,31449,
+31366,31324,31362,31269,30684,27283,27516,24678,
+23815,23281,22881,22511,22350,22359,22286,22011,
+21968,21485,21209,21048,20903,20682,20511,20436,
+20393,20424,20467,20454,20525,20559,20601,20505,
+20579,20670,20632,20496,20730,20940,21291,21300,
+21410,21754,21649,22566,21923,22045,22164,22178,
+22140,21907,22680,22228,22354,22317,22467,22458,
+22216,22822,22437,22451,22297,22380,23028,22968,
+22959,23443,23094,23001,23493,22408,22698,22314,
+22799,23147,23214,23766,23376,23671,23033,23571,
+23106,22734,22994,23894,22514,23572,22952,21727,
+22432,21631,21999,22063,22559,22746,22569,23319,
+22075,22413,23033,22174,22427,23363,21174,20660,
+21063,22331,21237,20250,21251,20391,22782,22869,
+22644,23049,23633,23393,22962,23021,23008,23442,
+23881,24522,24634,24234,23856,23675,23877,24227,
+24094,24442,24735,25366,25590,25613,24693,23340,
+21906,22098,20714,22278,21385,21348,21792,21819,
+21276,20816,21276,19072,19961,19951,19833,19932,
+20202,19480,21528,21372,23241,20826,20596,20050,
+19992,19665,19645,19847,19472,19287,19818,18378,
+19322,19743,19556,19670,19421,18951,19485,22994,
+20721,20349,20348,21093,20643,20927,27768,28053,
+25398,21900,22481,24403,32472,32493,32596,32276,
+31442,31232,31159,31182,31195,31323,31413,31467,
+31357,31515,31356,31067,30570,29478,28868,28364,
+26394,26681,26505,21454,21348,22041,20346,19713,
+21724,19503,19871,20271,21024,26682,29043,28082,
+20427,17253,17265,17004,16827,17001,17317,17278,
+16855,17145,17210,17379,17307,17218,17427,17375,
+17446,17208,17473,17386,17400,17448,17409,17345,
+17507,17961,18204,18447,18756,17880,17679,17881,
+17862,17955,17878,17884,17626,17809,17796,17931,
+17728,18092,18144,18577,18063,18334,19079,19179,
+19095,19276,20583,19271,20097,20528,21147,19056,
+19298,18599,20224,16716,22029,20525,20768,19350,
+19068,19794,19560,19706,18983,19014,19255,20174,
+19893,19548,19671,19578,19620,18946,19459,19430,
+19029,18620,17673,18822,18942,19137,19137,19835,
+19584,19703,19987,20211,20640,20931,21198,21369,
+21146,20893,20889,21417,21065,21174,21650,21828,
+21780,21954,21852,22931,22793,23576,23457,22919,
+23712,23853,24570,24830,25256,24975,25503,24322,
+24407,23979,23539,22044,25916,23915,23755,23877,
+23835,23406,23046,22714,22872,22383,22134,21500,
+21723,21542,21579,21687,21345,21217,21086,20766,
+20731,20904,20661,19983,20192,20248,20224,20273,
+19746,19616,19750,20379,20655,19778,19425,19716,
+19536,19216,18873,18590,18841,18598,18809,18875,
+18540,19164,19224,19363,19186,19269,19765,20206,
+19420,20035,20192,19680,19662,19957,19916,19987,
+19864,19826,20158,20472,20619,20526,20740,21019,
+21243,21606,21405,21273,21021,21135,28159,28512,
+32988,33225,33260,32954,34676,38026,35334,33909,
+35844,34531,35307,34597,33852,32994,33206,33215,
+33095,32861,32754,32713,32692,32661,32623,32673,
+32614,32525,32593,32708,32441,32583,32500,32501,
+32299,32087,32086,31991,32040,31962,31512,31138,
+30564,30126,29590,28994,28239,27573,26606,25818,
+25584,25173,25269,25281,24182,23947,25118,25163,
+25732,25921,24381,24079,22639,22694,23725,23740,
+24402,26454,27245,26714,27701,27126,27415,26313,
+22783,19941,18787,17970,17641,17534,17609,18436,
+18027,17628,17796,17826,17816,17647,17469,17605,
+17836,17593,17718,18407,18726,18252,18911,20655,
+23730,20239,19934,18572,18705,19596,19193,18804,
+19091,19852,20034,19879,21223,21105,20628,20343,
+19893,20208,20204,20209,20121,20119,20250,20329,
+21132,20962,21987,21694,21502,22386,21488,21771,
+22195,22437,22488,22918,24423,23787,23932,24431,
+26014,25179,24077,23765,23654,23725,24105,23060,
+23171,23356,23517,23518,23364,22917,22751,22284,
+21963,21617,21657,21837,21983,22231,22197,22174,
+23250,24414,23050,23670,22386,28243,28188,23018,
+19164,20799,19504,20856,21456,21239,22049,20919,
+20438,21750,21891,20108,19944,19310,19052,18963,
+18966,20214,20248,19704,20166,19803,20718,20008,
+20096,19422,18886,20055,20370,20571,20482,20194,
+19281,17196,18844,17519,17796,18744,19448,18468,
+17454,20651,22152,19104,20758,21933,23640,19971,
+19153,19526,17510,17346,17510,17746,18172,18933,
+19260,18875,18342,19781,19289,19833,21004,20734,
+19986,20137,20796,20446,20518,20211,19810,20057,
+19901,19912,18368,19736,20016,19574,20258,20139,
+20070,20435,20100,19885,20127,20158,20069,19962,
+19728,19742,19399,19873,19737,19916,20093,20218,
+19827,20007,19838,19394,19503,19029,18963,18843,
+19381,21023,21011,20373,23368,21911,23975,30228,
+31389,32110,31597,27078,27222,27969,27835,32224,
+32349,32679,32632,32783,32688,32508,31092,31263,
+31020,30753,29808,28015,24761,24628,25265,24811,
+23869,23308,23076,22674,22482,22429,22236,21968,
+21659,21552,21678,21398,21087,20997,20611,20712,
+20659,20213,20493,20526,20719,20784,20607,20544,
+20590,20689,20753,20987,21065,21257,21300,21896,
+21526,21592,21890,22001,22110,22321,22435,22302,
+22413,22053,22727,22350,22683,22722,22897,22875,
+22468,22749,22913,22618,22596,22500,23149,23295,
+23710,23269,23779,22215,23532,23056,22689,22140,
+23233,23484,23370,23444,22950,23121,23259,23091,
+23298,23238,22922,23044,24445,23950,22995,22535,
+21900,24073,23015,20121,23130,22428,22922,22800,
+21543,21656,21391,21495,22122,20340,21049,22408,
+19674,22156,21940,20814,21908,20815,20319,22098,
+22032,22310,22229,22141,22407,22269,21814,22050,
+22224,22969,22946,23183,23208,22963,23126,22925,
+22926,24057,23475,23857,24067,24125,23914,22155,
+21489,21577,21669,22414,22778,22272,22173,21611,
+20733,21471,20251,19527,20880,20086,19652,19845,
+20015,20259,20878,21470,21447,21041,21436,19743,
+20164,20001,19127,19704,18288,18711,19006,19395,
+19693,18996,19314,18241,18357,19236,18960,20328,
+19766,20052,20497,21162,21227,20630,20510,24217,
+26217,22534,22719,24009,32386,32295,32295,31756,
+31110,31051,31018,31031,31253,31470,31575,31704,
+31621,31584,31349,31453,31286,31107,30832,29989,
+28961,28670,29555,30263,29262,31053,28045,24975,
+26873,24762,20885,20161,21006,20922,21524,17766,
+17796,17416,16534,17148,16999,16794,16590,16644,
+17165,17013,17333,17319,17346,17316,17034,17363,
+17324,17461,17481,17463,17285,17169,17118,17570,
+17690,17831,17849,17963,20221,18240,17949,17862,
+18039,18026,17690,17779,18015,18018,18021,18000,
+17876,17816,19110,19065,18381,19449,18523,19568,
+19278,19821,19905,20569,19766,18636,19113,19793,
+19617,19434,19576,18803,20991,19427,19136,19230,
+19320,19407,19578,18877,19161,19353,19556,19228,
+19292,19053,17751,18685,19671,20654,18186,19524,
+19752,18054,18855,18967,18998,18975,19387,19299,
+19488,19296,19614,20084,20403,20831,21234,21265,
+21148,21006,21120,21212,21377,21586,21619,21741,
+21819,21972,22368,23181,22977,23671,23436,22980,
+23327,23864,24124,24537,24849,25151,23232,22999,
+22927,23751,24137,24678,24859,25152,24631,23982,
+23974,23815,23457,23373,23427,22692,22472,21996,
+21687,21088,21340,21329,21248,20862,20478,20726,
+20660,20662,20466,20584,20115,20353,20238,20304,
+20071,19565,20042,20199,20599,19908,19356,19006,
+19177,18720,18591,18411,18515,18582,19072,18994,
+19114,19058,19437,19425,19773,19020,19487,19266,
+19228,19958,20117,19164,19413,19748,19749,20022,
+19780,19884,20218,20546,20593,20597,20793,20948,
+21157,21399,21408,21006,21159,21153,24720,28656,
+32977,32997,34317,35281,36038,43081,35924,36267,
+34853,34458,33906,33711,33616,33950,33839,33726,
+33168,32795,32691,32644,32727,32671,32651,32604,
+32578,32538,32527,32550,32598,32502,32459,32189,
+31894,31671,31595,31763,31842,31903,31416,30671,
+30281,29163,29067,28161,27429,25977,25235,22401,
+15653,14854,16761,15111,15228,16289,17375,15898,
+15091,16056,17187,14923,16225,16064,16302,16529,
+16805,17135,16527,18198,17640,17058,18255,16921,
+16698,17412,17127,18215,20802,18656,18513,17666,
+18073,18019,17458,17097,17127,17465,18042,17658,
+17193,16776,17210,17672,17592,17475,18545,22885,
+20214,19348,19019,19063,19275,19008,19269,19529,
+19291,20111,20249,20010,21743,21511,21398,20664,
+20471,20300,20337,20371,20574,20475,19945,20858,
+21046,21093,21148,21714,22021,22601,22350,22535,
+23112,23058,23561,25208,21861,24349,23055,24138,
+23911,22827,23178,23676,23096,23286,22071,21597,
+22889,21195,21672,21996,22500,22520,22317,21725,
+20940,20979,21253,21095,21378,21201,21975,21429,
+21479,21966,26734,21998,22291,22847,23691,31239,
+21879,20649,20155,20866,21965,21515,21370,20880,
+20531,19029,20238,19530,21102,18102,19518,21151,
+19617,21004,19741,22140,19956,20134,19515,20115,
+20278,19583,19382,19674,19926,19733,19978,19286,
+19811,18653,18534,18373,18792,17990,17937,18315,
+17297,21149,18209,19989,19024,23089,20460,22477,
+18720,20469,19075,19734,18708,18679,19744,19470,
+19993,19590,20085,18987,19392,19774,19986,19509,
+19965,20310,20796,21076,20463,19929,20031,22650,
+19470,20939,20480,20060,20139,19911,20201,20550,
+20420,20607,20445,20399,20339,20358,20256,20236,
+20321,20364,20314,19808,20236,20186,20187,19947,
+19959,20085,19875,19678,19839,19493,19176,19524,
+19506,19931,21600,23580,25131,26289,27870,27880,
+26685,26904,27566,28014,28358,28989,32069,32429,
+32572,32965,33730,32997,33180,32803,31457,31146,
+29776,26390,25625,25475,24945,24984,24478,24051,
+23811,23306,23001,22887,22686,22474,22356,22116,
+21881,21927,21983,21840,21404,21158,20952,20829,
+20871,20698,20692,20653,20853,20811,20847,20805,
+20961,21143,21309,21273,20994,21278,21702,21579,
+22028,21962,22022,22515,22496,22548,22671,22768,
+22653,22545,23292,23161,23375,23335,23221,23286,
+23098,22845,23349,22708,23290,22938,22989,23316,
+23423,23725,24042,23930,22294,24345,23412,23148,
+21614,20991,23913,22981,23131,23469,22288,22782,
+22914,22404,22332,22013,22809,22086,22160,21683,
+21500,19356,23668,22173,21923,21861,22160,22164,
+21352,19128,22326,21827,21637,22485,22916,20475,
+19566,23066,19733,22066,20182,20427,23175,22183,
+21417,21655,21630,21754,21732,21603,22232,22145,
+22274,22340,22716,22396,22638,22716,22737,22484,
+22362,22428,22757,23217,23431,23395,23560,22416,
+20218,21996,21681,22103,22119,21996,21633,21270,
+20805,21480,20019,18585,21032,20178,20208,20032,
+20226,21379,22824,25861,27968,27150,23650,21456,
+20252,19974,20047,20047,19154,18946,18890,19414,
+18541,18835,19281,17523,18421,18141,19070,19040,
+19351,20271,20614,20019,21849,20640,20462,18663,
+28025,24695,22893,23412,27770,31110,30982,30961,
+31381,30636,30654,30819,31053,31153,31752,32546,
+31915,31644,31776,31500,31396,31425,31239,30361,
+29250,28774,29910,30056,30265,30168,30268,29056,
+30111,28788,23975,18147,19122,19143,18135,17968,
+17738,17617,17488,17142,17005,16854,17091,16874,
+17070,17085,17278,17129,17184,17207,17070,17164,
+17322,17405,17412,17373,17464,18006,17526,18000,
+18275,18594,18354,17789,18473,18176,18012,17679,
+17265,17982,18099,18221,18219,18135,18284,18342,
+18407,18596,18762,18686,18523,18801,20043,18305,
+20277,19831,18899,19541,19026,18936,19141,18987,
+19146,20112,24009,19348,19115,19155,20521,18936,
+20667,19800,19344,19176,19300,19163,19545,18771,
+18739,19281,19254,18494,19138,19664,18183,18906,
+18798,19103,18448,18500,18734,18810,18941,19176,
+19407,19110,19677,19868,19884,20172,20400,21324,
+20809,20514,20640,21274,21732,21787,21897,21888,
+21894,21930,21947,21998,22292,25146,22513,23129,
+23186,22377,22367,23495,23964,23669,23658,23510,
+23691,23769,24384,23901,24309,25137,24169,24539,
+24162,23599,23497,23349,23208,22788,22368,22080,
+21712,21437,21123,21300,20822,20719,20827,20910,
+20664,20349,20178,20292,20162,20463,20578,19976,
+19953,19740,19371,20074,20955,20105,19329,19032,
+18918,18823,18792,18671,19035,18820,18941,19099,
+19354,19917,18781,19665,20640,18786,20040,19712,
+19393,19592,19710,19873,19548,20705,19838,19824,
+19881,20050,20202,20637,20730,20709,20784,20870,
+20847,21121,21511,21801,21087,21411,23787,28650,
+32838,32873,33403,33513,36835,36173,35328,35930,
+35848,34404,34755,34454,34638,34507,33768,33594,
+33567,33118,32696,32611,32628,32686,32604,32586,
+32587,32592,32502,32514,32554,32504,32237,31905,
+31555,31149,30615,30774,30738,30575,30000,30354,
+29676,28071,25851,23523,19386,16731,15141,14335,
+14406,14961,14929,14892,15271,15127,15056,15625,
+15345,15462,15449,14950,15338,15673,14858,14222,
+14986,15728,16213,16148,16309,16587,15927,16277,
+17441,16997,17147,16770,16925,17349,17765,17181,
+17622,17880,19203,23201,21754,21039,22590,22914,
+24269,22428,20444,18003,18608,23580,23425,22992,
+20187,18919,19871,19410,19257,19203,19476,19484,
+19657,19806,20010,20599,20824,20946,20748,20489,
+20223,20223,21283,21136,21067,21418,21596,21697,
+21836,21663,21823,21796,22520,22610,22530,23385,
+23581,24007,25694,26634,26437,24779,24360,24566,
+24160,21885,24217,21926,21300,21909,22002,21374,
+21588,22152,22780,21337,21051,22402,22860,21052,
+21595,21487,21348,21105,20874,20987,21257,21051,
+21411,21587,21715,21591,21889,21376,21409,22143,
+21738,20551,19860,21510,21713,20757,23088,21332,
+21799,23502,19837,20682,19172,18928,18516,19955,
+19215,19188,19465,18131,18268,18141,18995,19528,
+18683,20690,19865,20392,19711,20292,19176,18735,
+20161,17848,18662,17310,18885,17482,18249,19142,
+18489,17124,19502,18868,20772,22151,20258,21555,
+23286,20168,18261,20427,20955,20356,20795,19476,
+19671,20088,20850,19473,19704,20051,19600,20627,
+20525,19812,19773,20547,20459,20491,20468,19344,
+25296,20618,20236,20409,20493,20625,20697,20647,
+20486,20678,20377,20501,20738,20684,20644,20702,
+20883,21019,20934,20848,20455,20551,20287,20150,
+20190,20064,20182,19790,19635,19414,19503,19980,
+19865,19846,21136,23679,27110,26784,25272,25290,
+25719,27152,27702,28498,28873,29343,32065,32300,
+32537,32934,32989,32823,32783,32708,29992,28518,
+27464,26115,25786,25501,25227,24911,24431,23995,
+23699,23592,23178,22980,22775,22695,22698,22534,
+22234,22145,22399,22359,21985,21675,21447,21249,
+21060,20875,20779,20896,20487,20823,21132,21237,
+21929,21471,21706,21696,21390,21642,21491,21579,
+22081,23104,23625,23441,22674,22963,22847,23043,
+23103,23301,22701,23773,24103,24108,23464,23831,
+23809,23299,22641,23483,23635,23463,23379,23544,
+23721,24240,22546,23881,23953,22246,23863,24047,
+23452,24834,22986,22827,23158,22864,22337,22282,
+22478,22093,21999,22225,22122,22668,22596,21954,
+22110,23708,22615,21650,21635,21690,21933,21495,
+21564,19809,19735,19723,20823,21042,19906,21260,
+22248,23619,22620,20820,20304,20987,22158,22273,
+21451,21462,21081,21389,21453,21437,21728,21921,
+21783,21822,22098,22199,22272,22284,22255,22143,
+21944,22064,22386,22858,23726,22686,22748,21981,
+19575,21270,20510,21221,20353,20520,21354,20457,
+20503,21281,19278,19930,24117,21759,21063,20976,
+21507,21550,27643,27408,28045,26944,20874,19762,
+19192,19899,18823,19992,20377,19026,18606,18756,
+19031,18757,19234,18587,18248,18885,19365,19312,
+19350,19397,19803,20727,19365,21128,20829,19537,
+15649,29147,25496,24103,28561,32741,32626,31724,
+31032,31021,30711,30645,30153,30614,30735,31022,
+31135,30774,30807,31069,30801,30787,30725,30180,
+28881,28929,29317,29521,30291,30676,30757,30642,
+31506,29834,23816,19276,18380,18315,18141,17962,
+17739,20114,17385,17291,17013,16999,16893,16968,
+16961,16995,16998,17008,17105,17034,17062,17276,
+17433,17667,17601,17598,17838,19701,18111,18369,
+17593,17791,18536,18267,18044,17549,17168,17659,
+17536,17790,17888,17688,18114,18232,18410,18422,
+18787,18537,18749,18622,19275,19365,19216,20370,
+17897,18988,18361,18435,18785,19359,25734,20268,
+19119,19294,19170,18729,19317,18813,18792,18848,
+17893,19235,19250,18807,18493,18696,17758,18769,
+18808,18693,19131,17885,18538,17441,20043,17679,
+18539,19425,19026,18647,19438,18871,19202,19302,
+19525,19592,19761,19419,19446,19674,20015,20431,
+20497,20408,20851,21020,21380,21423,21500,21483,
+21444,21878,22020,21531,21100,21483,21813,22068,
+22497,22721,23064,23361,23930,23627,24014,23678,
+24229,24022,24155,24702,25016,25102,24525,24385,
+24072,23685,23398,23331,23104,22944,22518,22280,
+21725,21578,21495,21627,21138,20962,20591,20963,
+20978,20484,20383,20381,20326,20156,20016,20736,
+20288,20302,19929,19737,19567,19362,19072,19081,
+19013,19376,18822,18884,19863,19506,19274,19326,
+19200,19498,19359,19900,19893,19718,19804,19677,
+19763,19666,20062,20131,20345,21093,20952,20417,
+20568,20745,20482,20739,20727,20511,20953,20606,
+20865,20958,21385,21169,21740,21432,21618,28439,
+32601,33096,33455,32997,35751,34279,35490,34450,
+35427,35160,35000,35511,36023,35563,34509,33895,
+33495,33201,33303,32948,32805,32706,32725,32734,
+32625,32573,32567,32498,32653,32602,32109,31680,
+31181,30538,29364,28512,27837,28371,28254,27354,
+22530,18471,17877,15959,15327,14725,14955,14112,
+14789,13944,14093,14091,14655,14829,14805,14783,
+14814,14799,14829,14847,15102,15011,15730,15513,
+15234,14967,15604,15666,14733,15065,16017,15622,
+15765,16256,15776,15808,15797,16090,16405,16449,
+17084,16736,17589,17004,18147,18215,18402,18669,
+18524,18633,18337,19099,19161,19175,19067,19762,
+19149,19108,19421,19531,19481,20019,19749,19688,
+19574,19963,19878,20478,20524,21159,21367,21187,
+20809,20994,20893,20050,20085,20982,21583,21684,
+22235,21848,21612,22176,23122,23617,23967,23970,
+26019,25700,25017,28185,25143,24749,24350,23718,
+23390,22503,22229,21993,21645,20913,20067,22172,
+21630,21874,21237,21413,21703,21256,21553,21906,
+20702,21471,21460,21370,20975,20580,20361,20397,
+21030,21552,21624,20999,21846,21573,22783,29024,
+29361,22448,21792,21495,20927,19465,20314,20240,
+19948,19513,18936,19587,19061,17667,19296,19494,
+19667,20073,19542,18300,17818,18026,19074,19021,
+18891,19330,19089,19500,18336,18414,18788,19995,
+19403,17128,18318,17509,17137,17694,17772,16422,
+16459,17630,17162,19636,20051,21009,20469,22720,
+26855,22524,23382,20557,22749,20245,20510,20273,
+20993,20490,20475,19463,19880,19846,20278,21283,
+20321,22028,20165,20593,21003,20772,20343,20356,
+23936,20968,21375,21303,21324,21675,21863,21811,
+21370,21348,20399,20789,21021,21080,21156,21220,
+21072,21240,21117,21077,21082,20770,20591,20271,
+20130,20119,19686,20197,19917,20029,19874,19779,
+19887,20103,21840,24823,24674,23949,23334,23534,
+24972,26430,28536,30151,30606,31148,31746,32271,
+32517,32609,32506,32526,32574,32595,30174,27732,
+27020,26325,25915,26304,25337,24936,24251,24147,
+23858,23627,23344,23179,22963,23017,23019,22980,
+22835,22418,22854,22575,22142,21999,21792,21545,
+21467,21338,21236,21272,20929,21444,21656,21768,
+21895,21611,21414,21607,22081,21901,21672,21507,
+21941,22093,22271,22902,22836,22746,23034,23616,
+23464,23759,25149,24552,24350,24338,24525,24066,
+23934,24090,23712,24061,23371,24375,24003,24612,
+23093,23864,23505,22884,23051,24335,23869,23954,
+23484,23400,22809,22523,23316,22039,22153,22362,
+22261,22082,21436,22224,22155,22104,21634,21879,
+23358,22821,21373,21471,21739,21396,21596,21280,
+21192,21314,19533,21498,21113,20100,20625,21617,
+20300,21386,21751,20555,20730,22038,20901,19605,
+21708,21186,20365,20906,21038,21217,21418,21087,
+21256,21315,21504,21700,21760,21980,21611,21908,
+21786,21843,21978,21942,22227,23414,22875,20882,
+21273,20032,20232,20565,20204,20268,19998,21258,
+20226,20606,18633,20653,25359,24485,26039,25533,
+27054,27702,27657,28491,27035,24274,21867,19390,
+18390,18923,18678,19474,19041,18585,18633,18029,
+18582,18898,18561,18566,18396,18762,17607,17688,
+18684,19337,18117,19797,20835,21709,21440,21816,
+17237,22701,27063,24587,29589,32591,32945,32902,
+32577,31165,31056,30798,29864,29391,29560,29540,
+29805,29907,29709,29631,29710,29834,29852,29571,
+28836,28818,29176,29642,30260,31151,31905,31935,
+32445,31082,27284,18868,18439,18514,18333,17880,
+17691,17661,17208,17350,17353,17166,17169,17074,
+16930,17374,17546,17241,17220,18099,17235,17193,
+17310,17468,17554,17367,17849,18572,17558,17994,
+18335,18528,18450,18212,18108,18921,19182,18354,
+17847,18015,18027,17982,17959,18110,18290,18386,
+18355,19201,18467,18503,18714,20263,18855,19119,
+18367,18140,18528,19053,19164,18951,18840,18118,
+19389,18889,18678,18228,18243,18993,18013,17892,
+18228,18121,17946,18559,17885,18261,18269,18519,
+18764,17973,17636,17552,17874,17093,18768,18231,
+18647,18236,19068,19037,19295,18946,19225,19331,
+19566,19402,19634,19536,19467,19509,19498,19819,
+20145,20270,23071,21168,21633,21558,20831,20700,
+21110,21111,21294,21474,21522,21532,21448,21495,
+21933,22380,22181,22605,23012,23277,23834,23274,
+23513,23730,24834,24393,24638,25384,24711,24498,
+24228,23749,23632,23487,23028,22940,22668,22187,
+22077,22353,22121,21571,21303,21008,21216,21065,
+20705,20319,20532,20845,20829,20346,19903,19846,
+19995,19991,20023,22079,20087,19697,19035,19065,
+18900,19059,19025,18429,19470,18553,19139,19701,
+19223,20457,21093,20937,20400,20538,20194,20790,
+20156,19794,20244,20372,20435,20331,20730,20744,
+21043,21387,21329,21426,21562,21506,21418,21911,
+21225,21330,21900,22120,22028,22001,21722,26670,
+29537,32997,32286,33264,32997,34606,35820,35943,
+37653,35736,35304,35421,35674,35154,34600,33689,
+33341,33468,33399,33158,32874,32877,32705,32676,
+32670,32678,32593,32562,32566,32570,31924,31281,
+30690,29548,27750,25515,23919,21837,19496,18632,
+17923,17220,15457,15467,15120,14942,14839,14695,
+14462,14757,14505,14823,14672,14892,14872,14741,
+14823,14775,14840,14910,14830,15047,15564,15983,
+15724,15835,16090,15361,14757,15053,15716,16342,
+16051,15852,15606,15053,15340,15618,15028,15705,
+16124,16467,16343,17356,16749,16728,16818,17919,
+18566,17917,18084,17930,18126,18735,18978,18685,
+18923,19109,19004,19222,19617,19547,19866,19474,
+19703,19489,19592,19989,20651,20562,20815,21072,
+20991,21304,21612,21882,22012,21637,21642,22171,
+23241,22185,22847,22215,23349,23700,23563,24747,
+25221,26116,27315,27358,26895,25045,24674,23476,
+22759,23293,22659,22520,22177,21603,21651,21024,
+21410,21612,21006,20326,21100,21850,21873,21757,
+21395,20766,21389,21129,20824,20156,19834,19377,
+19370,19152,19900,21782,19888,20894,20361,24672,
+23722,22536,20921,28212,22669,19275,20709,19625,
+19260,19091,19620,19472,18210,18163,19126,20376,
+20166,19905,19148,19511,18814,17606,18228,18119,
+19014,18088,17698,17812,18705,18753,18833,18711,
+19198,18525,17033,18906,18119,17201,18722,16342,
+19465,17739,18974,17074,20140,20134,22788,19520,
+21108,24795,19924,23872,25041,22679,21957,22260,
+20373,21293,20589,20597,20014,20440,20843,20681,
+20818,21293,21315,21522,21206,20967,21660,23365,
+22848,21370,22092,22068,22247,23018,23355,22865,
+22327,21562,21066,21155,21495,21622,21766,21518,
+21719,21403,21629,21607,21648,21282,21038,20406,
+20085,19959,19953,19454,20440,20103,19819,19688,
+19687,20138,20242,21766,23276,22396,22348,22668,
+23332,25676,26451,29864,31568,31775,31594,32125,
+32291,32457,32402,32528,32590,32628,32339,31634,
+30617,26428,26214,28932,25506,24739,23923,24303,
+24150,23842,23505,23285,23136,22926,22929,23111,
+22945,22767,22787,22819,22512,22234,22058,21768,
+21756,21804,21859,21768,21545,21658,21816,21936,
+22014,22163,22127,22053,22467,22216,21811,21618,
+21582,22484,22008,21903,22576,23089,23520,23654,
+24084,24640,24453,24273,24948,24605,24943,22970,
+25264,24149,23988,24597,24017,24531,24478,24156,
+24513,23766,23258,22725,22996,22380,22326,23520,
+23254,23943,23087,23014,21737,22266,21871,21802,
+21726,21155,21523,21621,21638,21819,22348,21352,
+21621,21017,21078,21491,21204,21132,21302,21717,
+20861,20309,22011,21294,22123,20868,20710,20479,
+22188,20365,20664,21942,20560,20517,21117,20306,
+21218,20646,20558,20645,20724,20710,20841,20711,
+20937,20880,21315,21033,21148,21393,21368,21375,
+21793,21610,21591,21519,21634,21593,22475,20619,
+21659,20847,20430,19641,20193,20275,20257,19518,
+19521,21112,19060,23815,24539,26147,28159,28851,
+29343,29125,27693,25684,25636,21828,20404,18870,
+18616,19488,18766,18293,18282,18465,18454,18257,
+18641,19289,18673,18547,17224,18536,18900,19329,
+18338,19779,19206,19326,19583,20278,20065,20160,
+19787,22806,24244,24180,26167,32464,32438,32584,
+32598,32719,31060,31031,29352,29112,29004,28980,
+28875,28788,28830,29024,29150,29252,29418,28577,
+29263,29387,30043,30157,31112,32167,32580,32456,
+29501,26453,24405,20052,18921,18972,18320,18009,
+17605,17934,17700,17623,17521,17058,17334,17430,
+17372,17416,17323,17246,17427,17169,17059,16949,
+17123,17691,17240,17376,17227,17156,17655,17988,
+18186,17318,18609,18513,18746,19022,19136,18923,
+18690,18864,18939,18600,18759,18574,18378,18360,
+18615,18586,18191,18854,19851,18825,19071,19767,
+18705,18464,18606,18441,18938,18075,18685,18907,
+18556,17931,18889,19078,20022,18554,17952,18840,
+17299,17974,17988,17923,17668,17605,18633,17732,
+17575,17147,17733,17722,18397,18139,17415,18566,
+19184,18762,18516,18476,18612,18606,18657,19089,
+19222,19452,19293,19363,19349,19602,19654,19924,
+19663,19610,19724,20463,20511,20718,20943,20784,
+21045,20959,21115,21186,21408,21327,21311,21552,
+21720,21975,22202,22196,22390,23941,23154,23290,
+23432,23678,23907,24363,24684,25113,24726,24501,
+24158,24081,23575,23390,23364,23073,22803,22673,
+22525,21861,21914,22217,21370,21111,21038,20994,
+20960,20405,20605,20672,19850,20165,20445,20220,
+20012,19963,20638,20652,20264,19935,19545,19527,
+19407,19071,19838,19735,18609,20823,20055,19560,
+19857,20084,21528,21435,20944,20931,20725,20309,
+20457,19933,20029,20211,20188,20502,20626,21114,
+21528,22260,22136,22838,22082,23004,21621,20160,
+21478,21815,21814,21487,22538,22838,22695,23131,
+28332,32679,32385,33612,37693,34463,34017,35379,
+34530,34850,35008,35736,35018,35055,34014,33820,
+33777,33363,33483,33426,32998,32859,32757,32664,
+32626,32616,32679,32637,32589,32622,32139,31356,
+30487,29191,26296,24462,21558,20844,20558,18392,
+17047,16071,15594,15294,14859,14732,14610,14671,
+14661,14616,14517,14587,14592,14726,14859,15028,
+15253,15337,15270,15299,15242,15446,16098,16566,
+16968,16099,15372,15090,15076,15143,15402,16052,
+16812,16115,15635,15344,15426,15634,15286,15442,
+15568,15856,16064,16551,16261,16959,16925,17509,
+17478,17851,18040,18015,17956,19250,18987,18815,
+18690,18994,19166,19400,19848,20130,19758,19857,
+20021,19679,20346,20589,19699,20594,20643,20802,
+20816,21587,21865,22360,22471,22365,22581,22908,
+23574,23534,22908,26313,26670,24365,26599,24144,
+21469,25590,27033,26342,25872,25424,24928,23155,
+22449,23088,22632,22722,22629,21956,22701,21723,
+21384,20951,20826,20925,20473,21001,21903,21871,
+20750,21128,20988,20724,20133,19731,19387,19224,
+18838,19483,19693,20042,20241,21362,26965,26868,
+26922,23025,21249,25592,19247,21341,19649,19194,
+18658,19287,18965,19561,20375,18281,18586,19175,
+19554,18863,18309,18123,15948,15662,17262,17106,
+18173,19535,18183,18046,18810,18597,17761,18497,
+19368,17457,17473,17767,17422,17049,17307,16196,
+17023,17262,18189,17508,20907,19575,18653,21801,
+22306,26579,22079,28365,20389,23481,22533,22722,
+22044,21411,22450,22789,21493,21256,20510,21526,
+21958,21609,21913,21755,21333,21468,22099,22789,
+22759,22286,22516,23058,24094,24033,24002,24147,
+22155,21663,21632,21453,22370,23052,22940,22713,
+22455,21842,22069,21879,21529,21238,21140,20574,
+20183,19968,19973,19790,20040,19849,20022,19752,
+19683,19695,19821,20881,20024,21317,21484,21763,
+22506,24865,26526,28564,30672,32184,32403,32082,
+32424,32273,31386,32547,32855,31966,31559,31303,
+30478,27593,26946,24063,22845,22692,22650,22918,
+23952,23604,23646,23127,22954,23037,23304,23100,
+22765,22839,22677,22837,22673,22470,21985,21961,
+22029,22221,22168,22381,22308,22438,22155,22061,
+22017,22098,22219,22170,22361,22378,22674,21960,
+21910,22038,22514,23178,22504,23072,23309,23925,
+24286,24628,24848,24661,24390,24183,24226,23701,
+23522,24726,24080,24003,23923,23648,24540,23670,
+23593,23245,22383,22591,23402,23309,22774,22402,
+22964,23793,23117,23298,21972,22035,21538,21225,
+21219,21384,21141,21387,21017,21177,21435,20806,
+21177,21554,21475,20657,20755,20964,21051,21481,
+21031,19214,20487,20194,19428,20327,20540,20163,
+20874,20937,20266,19873,19802,18269,21931,20438,
+20682,20393,20576,20568,20664,20445,20522,20502,
+20403,20630,20656,20646,20769,20892,20909,20961,
+21006,21233,21108,21528,21606,21604,22302,21057,
+21528,19713,20223,19830,19875,19491,18710,19026,
+18900,20158,22281,23733,25080,27496,28968,29755,
+30432,29875,28039,23155,20713,23367,24846,18463,
+18119,18303,18864,18468,18151,18458,18930,18465,
+18791,18942,19134,18231,18930,20649,18613,18354,
+18049,21100,19346,18963,19290,20129,19497,19667,
+19075,16382,28016,26297,26336,29242,32572,32626,
+32682,32658,32460,31066,29970,29364,29094,28914,
+28923,28792,28892,28497,28799,29047,29159,28767,
+28641,29432,30036,30810,29192,30419,30245,30522,
+24403,23095,20929,19590,19096,19276,18842,18349,
+18152,18688,19414,17998,18261,18013,17757,17754,
+17586,17419,17387,17693,17363,17225,16691,16508,
+16696,17120,17253,16338,17063,17384,17760,17730,
+17760,17724,17427,17408,18221,18678,18842,18222,
+18351,18762,19102,18772,18857,18559,18567,19040,
+18846,18735,19300,22071,19812,19411,19544,19112,
+18453,18569,19545,18350,19224,18605,18447,18270,
+17835,17643,17676,18745,17739,17708,18421,17820,
+17814,17811,17991,17626,17992,17850,17784,17594,
+17302,17412,17506,18080,16235,19329,17280,19083,
+18676,18261,18321,18309,18389,18559,18848,18894,
+19340,19357,19447,19455,19405,19350,19232,19662,
+19703,21369,20020,20482,20046,20793,20797,20642,
+20798,20772,20463,20842,21048,20775,21358,21488,
+21064,21329,21723,22703,22805,23046,23152,23270,
+23513,24212,24039,24202,24051,24625,24606,24694,
+23837,23751,23795,23766,23747,23334,23009,22816,
+22723,22767,22527,22281,21813,21435,21231,21150,
+21177,20860,21087,20776,20898,20987,22771,20792,
+20401,20667,20549,21055,20540,20256,19843,20933,
+20204,19959,19680,19836,19795,20172,20478,20499,
+20179,21220,21093,20386,21121,20997,20976,20226,
+20467,20736,20177,20505,20063,20342,21102,21534,
+22479,22054,22181,22581,21670,21926,21612,21661,
+19884,21612,22450,22749,22614,22411,22816,23122,
+24942,32997,33179,33001,36272,36105,33717,36195,
+36120,36738,34839,34816,34218,33917,33748,33558,
+33814,33582,32752,32781,32883,32734,32685,32664,
+32678,32663,32631,32578,32670,32729,32557,31407,
+30408,28977,26156,24525,21785,20436,20033,18314,
+16092,16010,15352,14925,14845,14754,14738,14670,
+14512,14591,14840,14821,15037,15141,15262,15624,
+15810,16003,15924,15994,16077,16469,17109,17106,
+16864,16399,15988,15639,15559,15566,15882,16159,
+17451,16464,16193,15716,15834,15670,15542,15396,
+15373,15762,16268,16579,16599,17018,17132,17221,
+17541,17437,17854,18244,18199,18538,18809,18780,
+18633,18960,18799,19591,20204,20307,19771,19588,
+19670,19934,20121,20410,20654,20634,21036,20916,
+20752,21049,21891,21751,22526,22607,23104,22993,
+23397,23499,23778,24528,26100,26065,23872,23694,
+23545,23511,23945,23021,24605,24135,23337,23142,
+25480,23325,21732,21425,21861,21552,21968,22406,
+21924,20837,20834,20769,20901,21027,21345,21971,
+22143,20432,21237,20627,19338,18654,18302,18904,
+19371,20218,20328,20352,20967,24455,26963,26068,
+26662,21806,20292,18854,17214,19515,19420,18534,
+18909,19371,17957,17684,17898,19008,19528,18859,
+19542,19788,19186,18421,14631,14463,16710,17121,
+19335,18495,19207,18684,17758,18582,18118,18428,
+17361,16092,17681,17356,17122,16346,15219,15689,
+16386,17729,16786,17410,15528,19781,23469,23226,
+20886,23806,26831,19112,23987,23901,23727,22725,
+23417,23067,22841,31893,28898,23292,22784,24240,
+22611,21909,22989,23216,23094,26277,23707,23280,
+23724,24500,25026,25137,26142,25224,24588,24166,
+22794,22619,24387,27092,29066,28202,32549,31644,
+25687,32196,23450,21906,21707,21237,20955,20673,
+20372,20055,19700,19731,19567,19809,19916,19578,
+19608,19470,19435,19639,19541,20591,20921,21403,
+21483,23096,24564,26192,29043,30597,31659,31730,
+31160,30629,28835,26704,26826,28484,26319,30239,
+25833,24010,22956,22601,22824,22718,23119,22581,
+22868,22617,22858,22802,22654,22563,23450,22927,
+22603,22812,22757,22834,22736,22118,22061,21717,
+22033,21897,21953,22186,22537,22451,22507,22557,
+22433,22691,22386,22401,22723,22536,22550,22723,
+22531,22332,22641,22626,22548,23592,23535,24817,
+25236,24505,24412,24313,24616,23570,23826,23571,
+24369,24001,24092,24012,23725,23264,22806,23042,
+22957,22591,22328,22326,22605,21960,22623,22160,
+22783,22837,22995,22101,21662,21630,21207,21064,
+21237,21276,21306,21102,21279,21068,20888,20981,
+20925,21324,21030,19938,20820,20582,20427,20652,
+21459,19995,20138,19065,19630,20668,20745,20024,
+21360,21522,19059,19502,20273,20051,20853,20083,
+20156,20139,20149,19804,19872,20144,20253,20149,
+20193,20286,20315,20313,20367,20524,20559,20640,
+20615,20722,21084,21143,21252,21226,21690,20343,
+20245,20187,19041,19514,19989,19667,17861,18380,
+19024,19491,22427,24783,25669,27509,28743,29288,
+28818,26511,23511,21636,19958,18809,18486,18453,
+18955,18939,19180,19004,18916,18984,19044,19002,
+18708,19183,19330,19079,19067,18959,18469,18502,
+18021,17972,18522,22407,19129,19010,19593,20140,
+19818,19262,24625,31344,29811,29729,31803,33354,
+32903,32902,32718,32619,30793,30030,29287,29124,
+28803,28392,28572,28389,28579,27753,27417,27250,
+26417,26014,25162,24562,24871,25577,25040,24585,
+22989,22013,20876,20208,19810,19607,19776,18897,
+19017,19738,18836,20436,18879,18780,18363,18070,
+17628,17598,17982,18782,16934,16767,16950,16743,
+16407,16845,16338,17042,17126,17330,17376,17078,
+17230,17103,17268,17617,17704,18276,18546,18497,
+18537,18864,19070,18849,18603,18246,18724,20235,
+24948,19485,19052,21911,18914,17862,17964,18192,
+18226,19188,18562,18405,17909,17799,17901,17996,
+17997,17815,17582,17539,17744,18179,18660,17886,
+17688,17689,17749,18324,18062,17895,17997,17739,
+17047,17040,17211,20489,15019,17581,18790,15366,
+17528,18351,18021,17850,18240,18409,19168,19659,
+18786,18449,19142,18894,18819,19158,19212,19303,
+19440,19418,19359,19814,21864,20649,20394,19776,
+20417,20634,20592,21090,21105,21205,21586,21606,
+21778,22230,22350,22707,22986,22708,23234,23305,
+23360,23662,23979,23841,27490,24817,25890,24314,
+23903,23749,23758,23517,23327,23223,22953,23043,
+22755,22832,22574,22976,22437,22225,21626,21364,
+21229,21117,21205,21142,21424,20779,21582,20952,
+20415,20886,20890,20611,20454,20791,19694,20864,
+20365,20419,19940,20524,20661,20691,19936,20952,
+20846,20447,21328,21246,21187,21456,21441,22341,
+21086,20805,20868,20892,20896,20433,21016,21975,
+22872,21959,21729,22716,22743,22388,21566,21564,
+21677,21174,22194,22452,23041,24459,24295,24421,
+25068,32816,34230,34149,33027,34576,35986,35401,
+34729,35045,35285,34835,34926,34427,35127,33398,
+33215,32611,32580,32640,32728,32714,32698,32723,
+32700,32739,32721,32680,32733,32637,32412,32694,
+30569,28920,26009,24987,22592,19955,19189,17795,
+15768,16113,15642,15163,14968,14829,14769,14751,
+14695,14606,14787,14943,15401,15756,15667,15874,
+16212,16505,16668,16703,16812,17187,17503,17730,
+17058,16818,16560,16284,16233,16287,16366,16506,
+16860,16998,16502,16671,16335,16155,16203,16063,
+15913,15974,15996,16314,16655,17103,17095,17042,
+17026,17220,17910,18093,17951,18417,18555,18805,
+18801,18981,19101,18827,20299,19767,20111,19593,
+20055,20080,20481,20511,20660,20741,20471,20717,
+21282,21360,21501,21888,22213,22760,22165,24455,
+23412,24449,24101,25443,26475,25455,25063,24352,
+24051,24603,24729,23995,23038,22598,21727,22296,
+22288,21691,23381,21813,21927,21628,26200,21825,
+21050,20535,20643,20569,20773,21133,20976,21297,
+20301,20354,19208,19729,19519,18951,19182,18400,
+19219,19369,19192,20198,21579,25290,26345,26060,
+20722,19638,19017,18663,18241,18022,19098,18204,
+19210,18524,19419,20598,19030,18766,19656,19182,
+19523,19239,19968,19984,17827,17142,17478,18206,
+20310,18944,18914,17981,18611,18345,17795,17481,
+16794,16960,15859,16639,15929,16218,16523,15546,
+16416,16803,17301,17937,16202,18354,20425,20160,
+25743,20475,23818,22097,26841,22822,27495,24576,
+24241,25150,25134,26046,25422,26803,24468,26166,
+24198,25569,24493,27477,28223,32852,25917,25126,
+24549,26182,27225,27728,27550,26853,26004,24621,
+23369,26782,31054,32783,32312,31516,28392,30781,
+27867,23963,22420,22542,22431,21340,21022,20676,
+20223,20004,19812,19493,19554,19483,19515,19160,
+19191,19201,19412,19130,19624,19878,20486,20664,
+20569,20908,22677,24591,26232,28306,30544,30617,
+27508,24483,24059,23718,23890,23502,24185,24611,
+23547,22577,22644,22374,23242,21936,22494,22092,
+23042,22522,22982,22998,22904,22714,22523,22766,
+22878,22690,22892,22380,22427,22202,22408,22431,
+22428,22505,22591,22239,22360,22471,22350,22390,
+22806,23466,22624,22544,22579,22847,22518,23293,
+23163,22892,22771,22823,23418,23301,23626,24194,
+23339,24563,23863,23344,23196,23229,23095,23052,
+23346,23563,23540,23494,23389,23118,22626,22838,
+22785,22478,22413,22179,21791,22038,22686,21912,
+21963,21656,22365,21683,21372,21180,21259,21096,
+20851,21043,21147,21364,20945,20943,20799,20883,
+21136,20689,20944,20988,21042,20056,20718,20387,
+20226,20127,20187,20041,20034,21004,20786,20066,
+20356,19229,19740,19884,20277,19948,20992,20331,
+19804,20120,19221,19887,19933,19813,19842,19938,
+19970,19934,20109,20110,20186,20314,20031,20345,
+20578,20342,20584,20484,20765,20799,20412,18578,
+19679,19476,18932,18762,19200,19603,18927,18621,
+19243,21725,23504,25535,27133,26639,26008,24999,
+24171,21609,23957,22433,19667,19216,19016,19035,
+18515,19506,20356,19434,19125,19303,19010,18902,
+18566,19185,18993,18098,18036,17743,17819,17918,
+18074,18225,18563,18652,19131,19790,20448,19640,
+21694,22912,18374,27364,32151,32721,32942,33528,
+33075,33210,33800,33068,32823,31819,29728,29057,
+28446,28096,28050,27703,27309,27699,27585,26817,
+26389,26715,25746,24521,24276,23766,23453,22480,
+24318,23973,21537,20495,20665,20454,21093,20870,
+20778,21309,20748,19776,19110,18352,17991,18095,
+17325,17409,17358,17086,17478,17045,17174,17118,
+17041,16858,16747,17059,17260,16528,16746,17244,
+16668,17016,17164,17784,17592,17774,17929,18428,
+18525,18346,17924,18207,19550,19712,19551,19188,
+20268,18258,18804,18449,18402,17792,17852,17935,
+17703,18257,18084,17837,17842,17636,17917,17997,
+18105,17739,17790,17540,17948,17845,17585,18173,
+17778,17883,17772,17857,17929,17856,17626,17382,
+17317,17400,17580,18000,17929,17360,17622,18840,
+15003,17193,18607,18490,18775,18322,18636,18402,
+18525,18465,18519,18449,18841,19048,19048,19144,
+18988,19268,19230,20446,19497,19916,20121,21140,
+21337,20409,20680,21029,20924,21211,21510,21708,
+21872,22461,22258,23677,23199,23457,23176,23082,
+23225,23629,23737,24192,24587,25793,24796,24417,
+24786,23865,23763,23478,23315,23154,23368,22784,
+22548,22410,22624,22410,22392,22941,21945,21750,
+21707,21447,22119,21437,21240,21258,21276,21173,
+21222,21608,21015,20395,20200,19929,19857,19854,
+20157,19844,20449,21043,21081,20529,19476,19524,
+19449,19489,19694,20349,20994,21711,21022,21447,
+22404,21021,22170,19968,20169,20071,21214,22031,
+22115,22232,22174,21997,21798,22277,22564,22578,
+22702,23095,23367,24688,23916,24439,21889,24071,
+26131,32475,32952,33440,32996,35796,36790,34506,
+35421,35013,34851,34635,34251,33864,34131,34863,
+34089,32773,32712,32713,32649,32646,32658,32760,
+32689,32735,32762,32718,32923,32646,32649,32674,
+30385,29015,26713,23938,22617,19608,18344,16740,
+16638,16167,15657,15093,15189,15088,14950,14898,
+14808,14948,15102,15342,15738,16072,16070,16334,
+16642,16846,16985,17255,17346,17270,17475,17763,
+17513,17131,16837,16731,16754,16800,16715,16869,
+17133,17119,16953,16881,16962,16883,16701,16480,
+16221,16049,15927,16293,16963,17246,17302,17652,
+17550,17790,17659,18377,18273,18591,18755,19052,
+19104,19012,19375,19293,19296,19929,19713,19839,
+19484,20586,20253,19759,20806,20781,21195,20979,
+21291,21818,21924,22203,22353,22704,22992,23200,
+24244,25215,24550,24945,23764,23004,22935,23403,
+23815,23912,24758,23655,23871,22847,22545,22011,
+22686,22303,22335,21550,20728,20343,21087,21878,
+21670,21516,21228,21273,21350,20657,20681,20838,
+21280,19645,19536,19194,19422,18888,18840,18645,
+19464,22035,21867,20817,25965,20655,20339,19768,
+19783,20071,19194,19378,18837,18387,19026,18591,
+18645,18312,19085,18942,16445,18612,18721,18363,
+19230,19341,19461,20210,18870,18956,19732,20815,
+19864,18477,17968,18441,18250,18335,18094,17457,
+16469,16504,17329,16150,16483,16342,16309,16333,
+16081,17128,17058,16986,17335,19119,17737,20410,
+21598,19023,19353,22576,25743,24132,27381,23956,
+25297,25675,25143,25568,26069,26001,25582,25527,
+26450,27633,29398,28372,28293,27891,27764,27206,
+27270,27759,28005,28002,27894,28108,27870,25473,
+23895,24726,28075,32291,32125,32988,29401,26621,
+24218,23373,22722,22858,22326,21453,21113,20739,
+20402,20066,19902,19689,19517,19461,19301,19149,
+18889,19000,19071,19091,19299,19545,20464,19162,
+19259,19695,20379,22795,22720,26029,26433,26910,
+26487,23373,23369,22776,22389,23295,22929,23016,
+22488,22269,21875,22085,21630,21828,22243,22325,
+22629,22572,22329,22575,22487,22508,22346,22789,
+22052,22470,22674,22550,22101,22252,22495,22206,
+22476,22341,22469,22628,22627,22482,22409,22380,
+22688,22822,22692,22879,23136,23070,22778,23061,
+23157,23037,23082,23257,23544,23948,23094,23880,
+24906,24464,23965,23451,23067,22989,22884,22845,
+23242,23514,23064,22589,22927,22638,22460,22323,
+22277,22328,22073,22040,21579,21697,21403,21472,
+21920,21495,20988,21295,21093,21094,21058,21003,
+21057,21213,21399,21123,20562,20589,20709,20631,
+20903,20749,21139,20882,20921,20620,20309,20106,
+19746,19929,19494,21528,21000,20133,18900,18696,
+19170,19662,19611,19294,18894,20522,20139,20185,
+20337,19600,19355,19475,19340,19188,19565,19555,
+19564,19290,19657,19746,19914,19905,19991,20060,
+20322,19962,20189,20546,20682,21081,19938,19581,
+19081,19500,18941,19029,19353,19477,18744,18198,
+18879,24810,26014,24822,26921,24623,24289,22246,
+20971,20413,24261,19125,22289,18018,17797,17690,
+18207,18995,20112,19383,19251,19149,19875,19074,
+19302,18943,18092,18014,18635,18462,18297,17794,
+18160,18452,18543,18700,19104,19220,18989,19426,
+19533,19808,20219,21751,28177,32997,35879,36018,
+34443,33544,34203,35859,34019,32962,30555,28725,
+28663,28395,28251,28413,28271,28468,28578,28050,
+27481,26690,25602,25027,24492,24802,24614,24234,
+24993,24705,24522,24369,24630,26061,24689,26036,
+21237,23224,19767,18966,18342,18397,18870,18607,
+18679,18555,17490,17307,17289,17129,17115,17161,
+17181,16970,16876,16802,16690,17703,15973,16591,
+17050,17202,17228,17533,17232,17647,17972,17988,
+18101,18551,18797,18715,22598,21522,18189,18556,
+18971,23988,18247,17651,17776,17284,17313,17262,
+17560,17649,18392,17443,17439,17664,17621,17859,
+17925,17530,17421,17421,17525,17874,17529,17670,
+17990,19032,17913,17397,17682,17526,17601,17412,
+17626,17591,17734,17473,17154,16994,16934,16189,
+16611,19428,18725,13119,18079,18717,18609,18586,
+19682,19567,18324,18576,18467,18449,18636,18924,
+18662,19599,19380,19344,19085,20019,19545,21135,
+20983,20352,20085,20334,20055,20950,20680,21822,
+21782,21678,22154,22455,23121,22890,22988,22869,
+23142,23271,23877,23900,24522,25017,24408,25043,
+24209,24219,23737,23619,23400,23462,23437,23403,
+22452,22832,22575,22415,22345,22281,22195,22107,
+22202,21701,21514,21368,21395,21277,20891,20702,
+20517,20182,20021,20057,20421,20452,25502,20225,
+20298,20911,20142,20897,24989,20940,20360,19942,
+20234,20315,20608,20825,20630,21041,21208,21478,
+21327,21558,21912,21765,21167,22431,21945,21045,
+21158,21954,23283,22907,22431,22763,24102,23298,
+22891,23384,24405,25527,24833,24153,23325,23116,
+26812,32427,31876,33124,33150,32997,35235,35261,
+35308,35378,35082,34882,35465,33906,34401,34141,
+33812,34631,32796,32898,32809,32700,32774,32709,
+32726,32765,32790,32705,32652,32626,32629,32523,
+30597,29285,27925,24663,21706,20312,18000,16609,
+16272,17195,15983,15672,15405,15231,15125,14915,
+15067,15248,15477,15787,16152,16422,16569,16669,
+16856,17112,17303,17424,17585,17649,17908,18028,
+17838,17541,17448,17358,16985,16965,17409,17601,
+17480,17412,17241,17036,16893,16763,16620,16514,
+16346,16198,16193,16311,16629,17061,17234,17393,
+17201,17667,17277,17616,18549,18656,18937,19232,
+19291,19103,19046,19096,19180,19627,19490,20439,
+19640,19780,19864,20341,20920,21000,21007,21088,
+21242,22160,23037,21749,22689,22610,22055,23391,
+23325,26760,25757,23868,24113,23271,23651,24240,
+23791,24514,22343,22638,21766,22163,22717,22605,
+22341,22527,22325,22594,22324,22401,22968,22929,
+22848,22575,22362,21574,21430,20616,20629,20106,
+20905,21257,20900,20595,20806,19425,18882,18414,
+22734,20787,22162,19872,20033,20287,19784,19887,
+19213,19758,19548,19386,19291,18945,19013,18954,
+18890,18324,19059,18896,18299,18059,19443,19753,
+18846,18658,19053,18653,19068,19347,19824,20337,
+20008,19016,18226,18736,18721,18490,18062,17583,
+18000,17603,16956,16762,16542,16249,16167,16727,
+16362,16512,16866,17075,16119,17910,20172,19451,
+22607,18522,19744,23400,21647,25663,19118,26231,
+28022,26152,26158,25511,25327,25177,26724,26878,
+27171,26955,27255,29814,28053,28496,27810,28682,
+28425,28284,28106,28227,28302,28530,27447,24738,
+23156,24838,25966,27563,27748,26394,25580,24016,
+23811,23445,22989,22806,22707,22163,21004,20589,
+20358,20088,19812,19630,19454,19340,19224,19011,
+18925,18737,18790,18906,19133,19048,18914,18688,
+18768,19203,19517,20346,20502,20504,22071,22878,
+22983,22575,22044,22086,21836,21960,22191,22300,
+22556,21440,21966,21947,22458,22501,21595,22042,
+21966,22686,22311,22458,22731,22867,22607,22770,
+22648,22734,22468,22401,22608,22668,22349,22428,
+22671,22499,22133,22395,22744,22430,22446,22767,
+22735,22906,23043,23456,23778,23393,23235,23382,
+24838,23427,23386,23772,23946,24300,24390,24239,
+24925,23379,23490,22896,22683,22557,22655,22577,
+22659,22566,22623,22098,22404,22411,22082,22346,
+21948,22168,21978,21839,21692,21526,21269,20970,
+21908,21507,21504,20877,21299,20874,21021,20849,
+20827,21115,21144,20549,20517,20415,20652,20392,
+20601,20643,20730,20653,20587,20663,20551,20460,
+21070,20269,19723,20265,19845,21036,19223,19200,
+19015,20086,19954,19684,19398,19518,20940,19812,
+19456,19208,19137,19260,18897,19427,19323,19298,
+19309,19302,19422,19522,19455,19779,19624,19694,
+19790,20072,19449,19939,20669,20446,19707,18672,
+20084,19424,19921,19263,19509,19154,19107,18020,
+18972,26129,26880,24853,23100,24520,22233,20884,
+20612,20562,20188,20346,19703,19451,19188,18489,
+18846,18901,18990,18851,19147,18992,18342,18713,
+19245,19238,19498,17907,17751,18308,17973,17592,
+18055,18135,18608,18558,18621,18599,18861,18720,
+19403,19056,19216,20094,20459,26062,35481,33372,
+35502,35323,34356,35224,34329,33347,32769,30164,
+28863,28654,28857,28923,29235,29837,29290,28946,
+28714,27943,26823,25282,25090,25215,25470,25345,
+28745,28862,28917,29009,28968,29395,29759,29079,
+27790,27727,25391,24834,24318,22133,19665,21421,
+18258,20337,18567,17738,18223,17695,17392,16821,
+17196,17194,17191,16809,17484,16920,16659,16649,
+17141,17569,17595,17759,18405,18359,18685,18591,
+18444,17902,19479,18837,17090,18154,18256,18472,
+23403,23024,19353,18195,17171,17697,17436,17370,
+17563,17862,17896,17841,17973,17217,17378,17713,
+17808,17837,17764,17601,17692,17761,17751,17408,
+17749,17352,17445,17419,17393,17276,17770,17436,
+17512,17739,17387,17400,17175,16646,17934,17311,
+17058,17803,18445,18579,19520,18264,17432,18319,
+18104,17604,17972,18147,17863,18729,18750,19283,
+19071,19131,18993,19215,19440,19574,19522,19725,
+19934,20805,20091,20236,21003,21399,21388,21216,
+21904,22224,22118,22161,22305,22306,22443,22449,
+22842,23056,23356,23881,24313,26070,24569,25169,
+24347,24135,23922,23490,23361,22997,23811,23535,
+23538,23284,23110,22640,22587,22435,22401,21907,
+21697,21636,21412,21727,21462,21248,21351,20820,
+21183,20974,20811,20572,20192,20185,20121,21950,
+20847,20073,20467,20012,20471,19929,19795,20029,
+19855,20207,20337,20492,20667,20669,21203,21087,
+21244,21457,21648,21576,21727,21825,21738,22219,
+22728,22542,23700,24609,24244,23432,23178,21398,
+21202,22269,23841,22790,23891,23975,23991,23257,
+24852,32826,32061,33436,32995,33609,33634,34957,
+36566,37617,35127,34888,35822,34507,34242,33772,
+33921,33914,34335,33683,33111,32872,32708,32739,
+32748,32751,32686,32691,32739,32668,32640,32530,
+29808,28151,27246,25061,22746,20591,17496,17116,
+16684,16446,16110,15866,15660,15381,15335,15103,
+15344,15525,15850,16100,16335,16811,17023,17088,
+17272,17376,17373,17607,17790,18063,18231,17811,
+17913,17930,18324,17979,17757,18058,17824,17845,
+17787,17666,17384,17103,16948,16834,16797,16776,
+16675,16498,16458,16466,16443,16842,16919,17313,
+17381,17759,17704,18185,18744,18908,19401,19066,
+19340,19340,19200,19512,19987,19685,19037,19007,
+18857,19552,19185,20195,20478,20722,20508,20483,
+21374,21269,22903,21906,21764,24111,24212,24075,
+24603,22834,23208,22388,23172,23004,22214,22378,
+22876,22351,21853,22107,21648,22098,22030,22100,
+21707,21392,21984,22781,21907,21885,24568,23065,
+25446,25249,22275,22219,21108,21045,20259,21023,
+20755,19461,18933,19338,18464,17748,18528,25128,
+25959,20238,20407,20616,21155,20621,19738,19659,
+19173,19435,19179,18791,18863,18449,18967,18190,
+18819,17976,19191,18923,19347,19563,16050,19977,
+18950,18859,18693,17944,20070,19428,19409,20071,
+19804,19858,18879,18645,18528,18889,18368,17850,
+17761,17334,17547,16377,16349,16756,16782,16074,
+15987,15628,15772,16447,16784,19353,19242,19553,
+18643,18548,18894,19773,22481,21540,22449,24091,
+29743,24410,29266,26721,26029,26463,26855,27043,
+25778,26331,25971,27100,27636,26839,26917,27643,
+28751,28533,28116,27885,27669,27075,25920,25186,
+23571,24354,24607,24982,24726,24297,23614,23350,
+22849,22659,22583,21838,21538,21504,20727,20240,
+20087,19891,19645,19490,19221,18992,19092,18941,
+18742,18624,18615,18456,18195,18324,18546,18493,
+18726,19013,19154,19835,20229,19977,21167,20895,
+21939,21390,21044,21437,21453,21889,22124,22227,
+22308,22315,21552,22240,22492,22479,22274,21773,
+21699,22166,22083,22350,22613,22822,22764,22868,
+22573,22338,22794,23319,22858,22689,22541,22530,
+22432,21930,22713,23011,22665,22593,22541,22812,
+23006,22941,23018,22815,23475,23609,23635,23580,
+23421,23350,23644,24252,24198,24815,24246,23800,
+23652,23263,22781,22659,22393,22164,22055,22288,
+22156,22115,22440,22127,22041,21989,21975,21903,
+21922,22095,22149,21558,21249,21093,20869,20655,
+21291,21649,20910,21073,21100,20620,20683,20768,
+20516,20229,20650,20612,20714,20239,20277,20046,
+20395,20208,19976,20158,20217,20201,19800,19913,
+19871,20076,19395,19633,18851,19159,19300,19560,
+19308,20488,19759,19664,19128,19914,18624,18416,
+17945,17989,18823,18468,18699,19355,19060,19062,
+19278,18919,19291,19653,19275,19473,19299,19347,
+19356,19509,19218,19630,19955,20180,19249,17704,
+19171,19017,19059,19230,18426,18903,18626,18684,
+18555,22704,23217,22247,23625,24243,24985,24859,
+21259,21078,22218,23182,23559,23229,21855,19797,
+18890,18909,18372,18385,18618,18664,18513,18021,
+19308,18778,19214,18737,18421,17680,17601,18009,
+18243,18249,18393,18445,18470,18251,18411,19264,
+18576,19058,19115,19476,21204,21395,26800,34485,
+37073,36754,34143,37315,37233,34198,32985,32727,
+32564,30551,29943,29998,30295,30501,30450,29947,
+29556,29276,29121,28050,27674,27596,27013,27438,
+30714,31340,31342,31236,31447,31680,32554,33138,
+32664,31163,29671,27316,24186,23012,22322,20457,
+21269,19803,19213,17486,17781,18003,17353,17977,
+17924,17422,16937,17000,16824,16974,17016,17292,
+17501,17499,17619,17825,17820,18405,19625,18975,
+23234,18315,17245,17100,16694,17798,18720,18151,
+18244,21504,17948,17554,17217,17458,17707,17510,
+18129,18360,17806,17592,17304,16994,16938,17081,
+17178,17301,17596,17541,17598,17570,17445,17235,
+17748,17085,16973,17004,17442,17119,17310,17284,
+17685,17768,17862,17235,17592,17602,18984,17756,
+18444,18171,18291,18240,18135,17944,18384,18190,
+17789,17810,18033,17628,18421,18728,18213,18462,
+19070,18820,18703,19137,19292,19598,19640,19722,
+19382,20398,20207,20550,21025,20799,21210,20994,
+21681,22108,22177,21657,21402,21667,22036,22174,
+22600,22764,23265,23621,23826,24209,24336,24686,
+24545,24069,23798,23376,23580,22425,22992,24497,
+23155,23076,22442,22554,22299,22275,22004,22030,
+21779,21458,21525,21300,21379,21176,21185,21186,
+21365,21680,21699,20617,21025,20650,20060,20548,
+20778,20395,21122,20343,20182,19926,20133,20025,
+20067,20207,20362,20583,20705,20940,21183,21593,
+21520,21843,21900,21987,21844,22025,22500,22428,
+22088,23071,23638,23704,23470,23443,23304,22190,
+22821,22821,23080,22101,22239,23727,23418,23268,
+22791,31436,32469,32995,32996,32875,34584,36014,
+35472,35620,36011,34740,35941,35059,34237,34245,
+34242,33968,33676,34023,33894,32966,32718,32688,
+32736,32736,32834,32706,32643,32635,32599,32807,
+31468,28477,26841,26169,24226,19934,18642,17396,
+17151,16816,16432,16125,15871,15704,15364,15377,
+15557,15941,16203,16564,16924,17089,17335,17579,
+17890,18120,17896,17755,17988,17894,17727,17625,
+17576,17544,17628,17664,17588,17553,17473,17564,
+17550,17571,17396,17217,17031,16991,17040,17077,
+17076,16932,16726,16658,16747,16817,17040,17019,
+17663,18130,18240,18303,18794,18744,18689,19637,
+19314,19279,19132,19698,19384,19113,18774,18589,
+19102,19592,19264,19601,20528,20723,20328,21331,
+21579,21498,21810,21915,23050,22971,22914,25388,
+26579,22584,22464,22350,23413,22935,22326,23075,
+22388,21991,22304,22331,21035,21613,22047,21375,
+21410,21333,21610,21987,22931,22254,21300,20234,
+21331,21079,22078,21313,22621,19934,19838,21213,
+20923,21090,20180,19539,19258,19240,20302,22362,
+20097,18242,18970,19840,20120,21279,19718,19905,
+19459,19362,19044,19012,19256,19465,19140,18969,
+19090,18470,17920,19634,17973,17984,18805,18417,
+17457,18792,18432,18866,19284,19200,18512,19110,
+19224,19126,19125,18944,18215,18240,18126,18210,
+17888,17799,17653,16816,17368,16756,16309,16267,
+16336,16450,16401,17023,17277,17271,16873,17925,
+18461,19784,20336,18712,20889,20583,23253,21555,
+26215,26102,27526,29193,24426,28494,24923,26155,
+25752,27063,26123,26894,25663,25445,25484,25188,
+26967,29078,27498,27072,26670,25990,25673,25194,
+23853,24569,24200,24092,24181,23763,23450,23100,
+22872,22667,22431,22298,21772,21108,20714,20019,
+19761,19631,19434,19214,19355,18885,18818,18740,
+18500,18300,18352,18273,18375,18154,18360,18291,
+18683,18990,19848,19049,19608,19781,20106,20393,
+22169,21396,21052,21207,21057,21266,21701,21901,
+21659,21654,21762,22060,21871,22866,22967,22768,
+22403,22040,22605,22725,22841,22811,22831,22957,
+23009,22992,23133,22479,23058,23082,22744,23639,
+22938,23105,22675,23187,22996,23009,22979,22980,
+23297,23365,23553,23526,23419,23522,23970,23654,
+23988,24132,24305,24308,24462,24208,23801,24216,
+23220,23060,22484,22522,22328,22152,21981,22038,
+21972,21867,22032,21804,21667,21675,21630,21781,
+21677,21942,21862,21598,21327,21106,20981,20697,
+21017,20897,21076,20506,20157,20690,20499,20355,
+20316,20087,20364,20361,20058,20239,20347,20402,
+20589,20939,19502,20855,20302,20121,19608,19839,
+19620,19615,19680,19703,19260,19463,19790,19609,
+19554,20196,19329,18971,19492,19002,17438,19235,
+18801,17548,19168,18468,18393,18789,18851,18806,
+18929,18954,18877,19239,19185,19335,19216,19265,
+19322,19253,19236,18945,19684,19662,19842,18391,
+18837,18499,18981,19191,18812,19185,18513,18548,
+20171,19749,23649,25991,28475,27337,28913,25500,
+21336,21977,23364,24746,24950,23919,22165,20742,
+19235,19134,18698,18621,18839,19065,18490,17339,
+17671,19219,18973,19445,18891,17656,17253,17659,
+17739,17755,18123,18494,17913,18218,18426,18716,
+18818,18700,18692,19791,21137,21423,21784,24621,
+34590,35208,37033,37310,34504,34245,33063,32861,
+32736,32757,32626,31208,31056,31275,31338,31285,
+32055,30606,29950,29745,29522,29660,29904,30080,
+31890,31831,31741,31843,31918,32742,32994,32991,
+32250,31641,30988,30038,28374,27456,26672,26466,
+26272,24962,20311,18702,19717,17973,18803,20629,
+17871,17412,16872,17094,16912,17069,17075,17326,
+17625,17497,17966,17428,17769,21363,20925,19384,
+16797,17269,17790,16935,17807,18524,18521,17376,
+17055,17807,17307,16762,17305,17971,17687,17622,
+17775,17365,17516,17578,17643,17625,16884,17049,
+17112,16976,16962,16873,17182,17539,17499,17148,
+16844,16773,16883,16524,16527,16629,16540,17034,
+17568,17055,17409,17369,18180,17940,17412,18168,
+18600,18147,18139,17893,17986,18030,17798,17752,
+17774,18631,17993,18151,18042,18387,18283,18818,
+18486,18183,18858,18959,19309,19623,19780,19953,
+20076,20174,20218,20613,20793,21075,21691,22019,
+21664,21485,21338,21232,21123,21423,21504,21852,
+22353,22549,22794,23287,23549,23772,24048,24754,
+25359,24381,23910,23551,23084,22993,23172,23684,
+23259,22965,22332,22404,22516,22023,21821,21726,
+21426,21720,21450,21213,20926,21147,20613,21081,
+19734,22251,21699,22344,22472,28108,20908,20853,
+21894,20586,20124,19838,19869,19233,19875,19995,
+20334,20574,21162,20580,20552,20781,21243,21956,
+22434,22308,22593,22599,22200,21936,22525,22823,
+22619,22868,24426,25002,23925,23369,23229,22350,
+22283,22092,22786,22550,22950,23188,22551,22644,
+22191,30206,32969,32346,32918,32632,35237,36078,
+37224,35613,36426,35640,34650,35367,34041,33828,
+33746,33864,34089,33813,33780,32927,32691,32778,
+32790,32789,32732,32669,32595,32760,32697,32490,
+31539,29059,27130,25308,24852,21945,18686,18127,
+17421,17113,16622,16244,15969,15665,15469,15501,
+15933,16287,16658,16920,17367,17183,17212,17207,
+17452,17378,17393,17476,17825,17721,17725,17711,
+17550,17481,17501,17536,17478,17426,17370,17401,
+17460,17493,17429,17156,16980,17080,17220,17312,
+17336,17278,17251,17600,18014,17694,17864,17736,
+18020,18276,17950,18760,19204,19625,19282,19069,
+19576,19351,18805,19292,19049,18923,17901,18718,
+19455,19611,20076,20277,20319,21350,21870,22234,
+21558,22523,20940,22510,22656,23272,24588,24801,
+24633,23576,23407,23209,22866,22647,22958,22383,
+21799,21734,22176,22524,20921,20563,21214,21274,
+21432,21299,20714,20963,20300,20407,22998,20283,
+20885,20651,24208,19854,26998,29646,21153,20243,
+20514,20535,20240,19399,19502,19723,19523,19982,
+19832,18879,19248,19438,21499,20710,21331,20458,
+20328,19619,19889,19125,19503,19896,18939,18168,
+17762,18760,17571,18696,17690,19290,17694,18666,
+18523,18683,18893,18545,18694,18129,18855,18546,
+18285,17949,18682,18666,18665,18243,17829,18399,
+17969,17457,17550,17622,16918,16799,16862,16843,
+16687,16440,16899,16482,16247,17262,17352,16626,
+18199,18062,19153,18475,19717,19776,20200,21711,
+23754,25258,24181,25497,27093,25891,23892,27057,
+25314,27659,25275,26276,23457,23999,24612,24217,
+24717,25488,25390,25410,25314,25496,25656,25140,
+24795,25224,25557,25490,24876,23959,23330,23099,
+22576,22414,22272,21651,21183,20691,20379,19859,
+19450,19287,19115,19023,19040,18789,18605,18472,
+18225,18150,17895,17823,17910,18109,18235,18393,
+18802,19074,18945,19452,19703,19713,19803,20015,
+20970,21190,20820,21279,21140,21171,21496,21575,
+21984,21851,21815,21820,22110,22631,22806,22968,
+23036,23007,22878,22868,22968,22777,23112,23178,
+23104,23586,23328,23321,22913,22826,23472,23471,
+23217,22919,23483,22877,23356,23349,23439,23426,
+23552,23817,23860,24149,23678,24070,24241,24176,
+24407,23451,24684,24519,24252,23529,23656,23358,
+23053,23121,22786,22326,22299,22230,22068,22095,
+21837,21837,21705,21672,21431,21195,21099,21766,
+21387,21574,21693,21123,21423,20972,20970,20961,
+20896,20282,20598,20427,20501,20445,20136,19965,
+20112,19928,19973,20043,20099,20154,20274,20278,
+20309,19785,19317,20079,20251,19864,19675,19780,
+19626,20256,19356,19329,19580,19491,19229,19206,
+19175,19482,19388,19350,19406,19753,19119,19164,
+17661,18029,18344,18645,18521,18448,18561,18714,
+18685,18543,18725,18382,18763,18874,18920,19005,
+19077,19179,18965,19044,19380,19182,18841,19290,
+18912,18768,18464,19034,18778,18525,18789,18844,
+19719,23179,25314,28140,32538,32619,32633,32538,
+25837,22327,22883,24399,25073,24998,24347,20049,
+19254,19095,18882,18974,18951,19433,19126,18603,
+17272,17931,19755,19392,19241,18809,18453,17996,
+18019,17930,17634,18228,18550,18177,18376,19067,
+18478,18807,19236,19540,20933,21813,23844,27065,
+27581,32626,33700,37241,37446,37620,34425,33561,
+33086,34003,32813,32766,31571,31450,31753,31888,
+31773,31684,31625,31717,31521,31726,31505,31717,
+31493,31518,31627,31815,31821,32018,32339,31994,
+31167,30995,30516,30036,29100,27834,27151,27043,
+26382,26033,24320,22940,22607,23328,23170,19856,
+18507,17565,17013,17033,17434,17593,17867,17818,
+17654,17642,17776,18102,18476,19878,17840,17595,
+17624,18258,17829,18648,17764,18202,17793,18354,
+17756,17751,17938,17472,17729,17771,17676,17476,
+17261,17262,17155,17394,17451,17080,17343,17016,
+17222,16791,17039,16705,16863,17271,17201,17027,
+16867,17076,17249,17118,16430,16370,17052,16980,
+16946,16654,16116,17175,17386,18180,17375,17486,
+18477,17987,17886,17379,17592,17226,17119,17640,
+18166,18092,18198,18111,18414,18324,18833,18448,
+19274,19237,19092,19155,19231,19422,19593,19890,
+20036,20238,20394,20458,21212,22635,22570,21477,
+21747,21340,21013,20991,21216,21360,21378,21987,
+22149,22665,22975,23030,23563,24057,24532,24632,
+25174,24624,24062,23421,23399,23231,23420,22914,
+23169,22627,22891,22556,22475,22002,21583,21491,
+21386,21612,21607,21373,21032,20535,19377,20594,
+20102,20604,20521,20987,23170,19680,20435,19777,
+19686,20247,20157,20089,20283,20256,20163,20291,
+20553,20898,20786,20631,20790,20982,21063,21632,
+22056,22494,22107,22198,21737,22543,22053,22569,
+23502,24236,25389,24588,23326,23386,22901,22713,
+22338,22386,22088,22253,22713,22690,22497,22512,
+22008,29352,32500,33680,33535,32453,35393,36378,
+39396,36428,36825,35722,36507,34808,34879,34605,
+33789,33525,33549,33573,33336,33006,32930,32916,
+32844,32856,32748,32724,32640,32797,32802,32707,
+32352,31875,28554,27022,25997,23265,19908,19086,
+17916,17500,16903,16380,16050,15819,15548,15516,
+15915,16283,16572,16617,16557,16730,16772,16916,
+17219,17338,17401,17467,17412,17599,17741,17563,
+17516,17532,17364,17355,17492,17526,17468,17367,
+17313,17486,17587,17199,17152,17209,17319,17439,
+17445,17400,17521,17820,17987,17992,18240,18524,
+18234,18324,18772,19451,19653,19409,19746,19114,
+19254,19272,19148,19044,19134,18845,19313,19457,
+19630,19873,20531,20698,20804,21116,21527,21849,
+21612,22497,22144,22594,23238,22982,24247,23670,
+25722,23521,23352,23031,23130,22848,22335,22203,
+21569,21745,22104,22379,21405,21185,21506,21497,
+21290,20516,20328,19871,20041,19730,19536,20025,
+19927,19692,23000,20283,18621,18748,19753,21296,
+20574,20890,21825,20097,19596,20008,19826,19371,
+19197,18749,18599,19455,19018,20322,21128,24321,
+24550,21480,22591,21206,20961,20007,19191,19224,
+18729,19878,18817,17222,17190,19588,18949,18807,
+18885,18319,18138,18642,18499,18398,18289,18329,
+18115,17970,18060,18677,18501,18888,19106,18903,
+17957,17766,17616,17627,17334,17385,16584,17568,
+17043,16982,16914,16549,16883,16224,17055,16554,
+17541,18212,18171,19859,18513,19689,20688,20252,
+20505,22226,22299,23724,25137,25146,24450,27052,
+26178,28388,26212,21176,21146,23236,24271,24035,
+24387,25073,24371,24130,24657,24762,25332,25093,
+25450,25565,25869,25782,25430,23577,24125,22569,
+23299,23137,21929,21193,20736,20470,20211,20083,
+19599,19220,18961,18842,18723,19250,18455,19013,
+18052,17720,17465,18011,18099,17941,18108,18628,
+18567,18162,18630,19509,19561,19947,19884,20119,
+20480,20589,20967,21509,20507,20694,20894,20274,
+21343,21678,21827,22016,22344,22754,22818,23271,
+23524,23485,23285,23289,23062,23355,23225,23332,
+23517,23564,23878,23985,23868,23655,22713,23263,
+23809,23457,23631,23787,23949,23987,24033,24135,
+24432,24342,24507,24210,24541,24849,24849,24720,
+24720,24490,24252,24088,23769,23633,23427,23311,
+22719,23047,22750,22377,22180,21828,21972,21855,
+21704,21501,21255,21408,21303,21293,21195,21380,
+21309,21259,21634,20954,20984,20838,20462,20625,
+20791,20511,20659,20221,21459,20100,19951,20083,
+19921,20039,19947,19834,19900,19833,19531,20049,
+19947,20141,19434,19781,19588,19590,19452,19545,
+19207,19433,19137,19049,19251,19201,19088,19428,
+19882,19200,19293,18993,18929,18882,19078,18714,
+17037,17811,16954,19051,18363,18248,18294,18315,
+18132,18126,18392,18489,18447,18542,18702,18824,
+18696,18647,18679,18867,19034,19314,19496,18228,
+18920,18663,18890,19140,18872,18826,18960,19491,
+20715,24597,27882,32901,34449,35181,32997,32751,
+31277,22959,23114,24539,23710,23411,21249,20220,
+19432,19096,19093,18991,18999,19218,19510,19023,
+18803,18709,18621,19704,18842,19497,18300,17912,
+17874,18178,18097,18243,17880,18196,18351,19134,
+22281,22197,21231,20499,20384,21505,24545,28773,
+29456,30098,30777,32334,33372,36060,34978,36565,
+33600,32959,32873,32010,31249,31680,32660,32457,
+31962,32135,32302,32073,31980,31740,31668,31567,
+30066,30211,30331,30551,30081,29835,29802,29715,
+29421,28686,28094,27714,27955,27593,27799,28406,
+27049,27497,27231,25499,24455,23829,24537,23988,
+21006,18338,18106,17911,17588,17680,17982,17701,
+17945,17188,18615,20568,22374,17702,17047,17388,
+18028,17680,18269,18611,18249,18330,18707,18896,
+19874,18018,18069,18028,17737,17541,17518,17347,
+17217,17368,17451,17700,17556,16661,17029,16917,
+16959,17367,17049,16779,16656,16557,16651,16770,
+16967,17027,16909,16964,16577,16776,16809,16485,
+16534,15686,17463,17430,17505,17061,16715,17246,
+17559,17619,17650,17868,17825,17641,17800,17755,
+17907,19173,17936,18118,18923,18135,18570,18977,
+19281,19279,19085,19256,19160,19317,19733,19892,
+20502,20218,20528,20814,21228,21390,21282,21426,
+21022,20977,21054,21104,21332,21293,22216,22008,
+22326,22981,23009,23109,23247,23789,24061,24561,
+25236,24834,24355,23974,23744,23652,23222,23328,
+23476,23365,22761,22779,22815,22251,21843,21515,
+21709,21480,21721,21543,20985,20691,19191,19081,
+19770,19701,20443,20292,21016,19760,20142,19595,
+19155,19636,20303,19833,20361,20540,20335,20339,
+20473,20985,21080,21210,21380,21319,21081,21402,
+21781,22502,22370,22266,22662,23098,23112,23833,
+24979,24606,25076,24518,23391,22034,22535,22951,
+22530,22511,22434,22319,22332,22263,22077,22143,
+21757,26128,32488,32768,33345,32577,34034,33816,
+35391,38016,35865,36414,35754,36648,36821,36920,
+35653,33692,33311,33486,33374,33375,32969,33000,
+33151,32837,32783,32748,32711,32711,32724,32722,
+32738,32785,31146,28527,27583,24932,22850,19287,
+18560,18054,16743,16717,16301,15981,15679,15816,
+15778,15963,16245,16185,16012,16119,16360,16698,
+17127,17349,17385,17392,17501,17956,17654,17549,
+17481,17452,17405,17436,17424,17501,17505,17577,
+17363,17360,17467,17356,17301,17353,17379,17459,
+17452,17565,17772,18031,17532,17463,17933,17809,
+18816,19201,19789,19468,19596,19707,19525,19440,
+19316,19325,19214,19257,19524,19435,19464,20013,
+19869,20330,20292,20824,21526,21651,21747,22216,
+22753,22870,22602,22500,23052,23712,25006,27091,
+24022,23801,23491,23511,23457,23178,23271,22543,
+21985,21177,21412,22067,21365,21750,20592,21238,
+23238,20118,21000,20424,20353,19951,20221,20553,
+20074,20478,20045,23616,20783,20694,19242,21294,
+20895,21325,21199,21288,21907,23877,20033,18911,
+19227,18546,18829,18990,19359,19398,18761,18139,
+18364,23111,22357,19980,18682,24036,19611,19477,
+18918,19193,18893,19029,19765,17730,17927,19176,
+18382,17342,18229,18308,18122,17939,17978,17806,
+17935,17515,17849,18171,19120,19839,20281,20727,
+20582,18823,18893,18828,18297,18270,17886,18555,
+18607,17833,17232,17310,17164,17113,16999,16851,
+16655,17991,19068,19193,18082,18735,20068,19545,
+19944,21333,21601,22929,24039,24309,24834,24937,
+25364,27070,25653,22500,23932,26079,22320,23989,
+23006,24305,23260,23295,23009,23675,23617,24016,
+23839,24374,24780,24526,23844,22716,22986,22562,
+21960,22585,21488,21090,20595,20275,20049,19908,
+19768,19308,19012,18787,18625,18068,18357,18283,
+18000,17589,18171,17792,17517,17491,18143,17883,
+18053,17898,19038,19654,19904,19897,19932,20153,
+20271,20497,20154,20721,20620,20622,20996,21441,
+20981,21569,21804,21865,22122,22820,22943,23013,
+23379,23628,23934,23652,23813,23208,23727,23535,
+23734,23834,24535,24615,24561,24606,24783,21702,
+23253,23162,23862,24044,24287,24345,23999,24210,
+24425,24601,24644,24439,24840,24784,24541,24373,
+24139,23846,23921,23507,23686,23371,23246,23112,
+22792,22498,22179,22040,22122,21724,21501,21696,
+21590,21240,20916,20965,21498,21453,21509,21448,
+21002,21305,21287,21227,20516,20862,20473,20427,
+20336,20361,20559,21018,20472,20355,20018,20161,
+20102,19879,19934,19940,19863,19891,19452,19650,
+19425,20001,19292,19149,18920,19227,18836,19563,
+19326,19498,18946,19029,19485,19059,19083,19207,
+19191,18764,19252,18936,18633,18230,19176,18412,
+17037,17775,17690,18176,17994,18147,17805,18210,
+18050,18000,18007,18312,18381,18383,17730,18611,
+18583,18391,18663,17697,18581,18655,19464,19287,
+19062,18618,19027,18744,18704,18192,18693,19923,
+23120,27309,32770,33498,34350,34482,33188,33540,
+32546,25470,24004,21744,20706,20895,20495,19867,
+19297,19106,19053,19146,19237,19492,19472,19224,
+19088,18900,19226,18643,18684,18914,18486,18495,
+17715,17938,18211,18273,18213,18444,19405,20135,
+23532,19713,19617,19894,20604,22464,24447,28537,
+28680,29360,30148,30582,32562,32642,34238,35516,
+35306,33771,33124,31300,28152,29220,29991,30412,
+30828,31032,30944,30632,29933,29193,29120,30085,
+25041,25152,25278,25430,25959,25041,24747,24996,
+24861,25139,25002,24399,24588,26303,26688,26433,
+26452,26575,25144,23456,22117,23598,23665,22458,
+19551,19223,18277,18140,17569,18113,17553,17958,
+17767,19184,28662,18542,17517,17438,17337,17520,
+17643,17965,17759,18289,18385,18867,18867,18075,
+18002,17674,18075,17770,17720,17732,17548,17434,
+17481,17912,17799,17808,17808,17274,17065,16674,
+16950,17001,16603,16451,16268,16276,16460,17040,
+16647,16714,16988,16847,17274,17103,16824,16439,
+17681,15791,17094,17382,17223,17210,17322,17895,
+17514,17428,17649,17761,17760,17634,17841,17757,
+17922,18015,17802,18047,18041,18739,18782,18866,
+19012,19038,19292,19488,19106,19423,19701,19918,
+20151,20504,20688,20721,21174,21109,20725,21003,
+20705,20899,20712,20799,21965,21552,22458,22196,
+22371,22954,23922,23243,23226,23994,24280,24922,
+25301,25246,24510,24051,23766,23367,23234,23444,
+23013,22849,22851,22824,22665,22376,22180,21817,
+21495,20814,21075,20593,20145,21146,19496,19703,
+19748,19371,19632,19911,20694,21096,20500,21150,
+21109,19928,19908,20023,21600,20516,20052,21486,
+21380,21555,21984,22013,22500,22362,22249,21813,
+21802,22005,22013,22767,23420,23417,23613,24936,
+25215,24394,23003,23335,22639,22872,22341,22417,
+22582,22494,22411,22245,22288,23005,22704,21819,
+21576,25386,32477,32985,33135,32994,33087,37101,
+34572,34953,35568,36225,35856,36629,36615,36778,
+35941,34961,35055,34281,33809,33185,33197,32994,
+33115,32897,32813,32781,32808,32763,32733,32779,
+32648,32868,32722,31767,29331,27920,25614,21819,
+19290,18436,17603,16854,16409,16157,15970,16096,
+16098,15920,16047,15970,15540,15761,16159,16581,
+16983,17371,17279,17403,17733,17836,17661,17497,
+17464,17447,17411,17442,17395,17508,17468,17301,
+17207,17254,17380,17420,17424,17398,17373,17424,
+17589,17685,18142,18415,17908,17810,18206,18150,
+18226,18770,18942,19378,19108,19341,19473,19517,
+19541,19653,19224,19159,19398,19604,20269,20134,
+20393,20824,20787,21233,21305,21501,22024,22856,
+22581,22743,23104,24675,23658,23250,24387,26785,
+25014,24538,23502,23713,23805,23481,23350,22974,
+22554,21358,21378,22325,21649,21262,21522,21731,
+21046,20932,20801,20616,20532,20495,21123,21253,
+20585,20628,20156,19893,22440,27087,27163,32725,
+30334,28648,23158,21749,28964,19574,19396,19456,
+19119,18474,18391,18381,18747,18402,18701,18279,
+18839,19231,20123,19944,21147,25835,19641,24235,
+22820,19209,18502,19847,20037,18921,17922,17778,
+17361,17152,17755,16878,17314,17335,17526,17795,
+17655,17480,17634,17647,18072,19445,20261,24331,
+23277,22605,21318,21031,20553,20509,20797,20776,
+19901,19080,18363,18224,16920,17335,17860,17609,
+16880,17955,18812,18329,19067,18968,19263,20590,
+19677,19533,20695,21250,22790,23763,24808,23135,
+24625,24525,26215,27147,28300,29658,23709,22567,
+22953,24150,23826,23679,23583,24090,24113,24066,
+24125,24102,24031,23890,23630,23184,22033,22371,
+22070,21632,21457,20558,20789,20170,19761,19634,
+19456,19366,18852,18760,18532,18639,19828,19181,
+18809,18392,18043,17626,17478,17616,17985,18033,
+18027,18596,18443,18348,19327,19877,20002,20035,
+20358,20859,20485,20800,20544,21007,21491,20904,
+21942,21226,21011,21598,22068,22506,22995,23200,
+23235,23455,23830,24398,24033,23954,23706,24562,
+24358,24233,24705,24942,24612,24950,24669,24156,
+23465,23358,23879,23694,24490,24693,24490,24610,
+24704,24446,24955,25206,24744,24324,24123,23886,
+23797,23035,23307,23214,23232,23161,22926,22881,
+22639,22566,22324,22030,22168,21729,21666,22098,
+21632,21129,20767,20548,20957,20857,21864,21822,
+20865,21211,20813,20867,20793,20406,20677,20487,
+19867,20472,20205,20484,20376,20740,20181,20040,
+19932,19974,19934,19520,19641,19693,19662,19674,
+19631,19733,19676,19166,19117,18819,18783,19172,
+19110,18993,19056,19142,19065,19144,19026,18636,
+18252,18684,18811,18623,18589,18700,18592,18283,
+18114,17478,17346,18032,17944,18114,17753,17807,
+17876,17836,17605,18161,17892,18141,18168,18060,
+18231,18271,18234,18189,18216,18226,18826,18654,
+19270,18201,18948,18307,17892,18363,19320,21261,
+23616,30479,32991,34357,35325,34494,34687,34290,
+32796,27693,24315,20814,20364,19806,19314,19296,
+18443,18938,18941,19249,19111,19218,19515,19402,
+19134,18701,18998,18690,18657,19056,18809,18390,
+18157,18130,18320,18225,18340,18227,18379,20553,
+20370,19369,19683,20754,21180,21962,26148,27321,
+28089,29087,29452,29692,30715,32257,32716,33767,
+35248,36806,36151,33708,30558,26676,25272,24756,
+24813,24598,24980,25646,26187,26290,25820,24788,
+25644,24877,25146,24914,24684,24321,24652,24224,
+24657,23873,23923,24226,24466,23253,24326,22892,
+22792,23300,22692,21405,19818,22528,19591,19054,
+19557,19031,18438,18165,17925,17883,17662,18906,
+22061,18081,17890,18190,17774,17488,17293,17316,
+17462,17412,17316,16961,17419,17965,18117,18413,
+17849,18087,18095,18000,17856,17814,17700,17659,
+17728,17534,17390,18120,17540,17466,17042,16752,
+16494,16612,16369,16269,16309,15951,16364,17175,
+16863,17388,17047,17620,17016,17226,16533,16273,
+18599,17255,17973,17688,17138,18590,18208,18209,
+17600,18072,17838,18075,17911,18028,17930,17715,
+17876,17853,18099,18157,18334,18582,18614,18768,
+18938,18649,18880,19407,19479,19311,19608,19754,
+20334,20622,20748,20814,20594,21053,20422,20657,
+21040,20984,21056,21530,21333,21831,22299,22535,
+22322,22914,23361,23808,23951,23777,24507,24681,
+24921,25390,24524,24197,23707,23459,23026,22989,
+22674,22514,22642,22486,22427,22253,22083,21228,
+21249,20518,21188,21576,21108,20891,21282,20287,
+20472,20310,18682,19031,20918,21332,21524,22607,
+21908,21101,21316,21503,21654,21900,23604,21738,
+21501,21345,21241,21927,22938,23903,23838,22624,
+22329,22350,23256,21759,23145,23041,23915,22164,
+24253,22216,21802,22234,22453,22373,22289,22502,
+22449,22208,22077,21969,22062,22026,22383,22869,
+21497,24219,30900,32333,32953,33003,32451,35019,
+36853,37663,36730,36684,37074,36882,36174,37007,
+36064,35014,35582,34692,34118,33621,32578,32599,
+32814,32828,32833,32850,32819,32797,32757,32762,
+32775,32745,32701,32697,32509,29739,28147,25026,
+20569,19498,18690,17410,16941,16565,16268,16165,
+16130,16040,15825,15622,16095,16032,16162,16472,
+16815,17309,17704,17753,17791,17754,17692,17588,
+17521,17487,17462,17388,17414,17512,17505,17313,
+17256,17257,17259,17310,17286,17245,17170,17277,
+17562,17958,18237,18270,18341,17748,17939,18480,
+18834,18758,18939,18391,18885,19183,19713,19591,
+19430,19438,19309,19404,19692,19875,19909,20568,
+21111,20926,20941,21031,21370,21477,22104,22136,
+22166,22631,22907,24371,24134,23400,24791,23865,
+24578,23732,23110,23574,23635,23646,23010,22943,
+22905,22287,21567,22899,22076,21084,21825,21476,
+21527,21612,21011,21015,20271,20814,20429,20039,
+20978,21918,20820,22586,21867,23083,24894,26938,
+30261,24663,28386,27535,21334,19271,19329,18928,
+18655,18345,18477,18408,18642,18738,18384,18713,
+18945,19133,18813,19328,20084,19814,18615,19912,
+23739,21079,20664,20387,17685,20235,18903,18073,
+17476,17281,18171,16953,16030,17680,17751,17706,
+18175,17691,17468,17730,18025,18414,19384,22028,
+22955,24003,24042,23379,23493,23064,22885,22641,
+21741,19168,17997,17764,17775,17487,17842,18058,
+18455,16405,18285,18051,17862,18396,18940,19321,
+19320,18636,20566,21581,21788,22956,23424,23700,
+24473,25107,26036,25926,25167,22599,22395,25105,
+24287,24865,25408,22743,23587,24757,23821,23390,
+22940,23538,23460,23732,22974,22913,22885,20949,
+20652,21150,21512,20919,20523,19946,19516,19355,
+19081,18995,18802,18616,18282,18334,18126,18595,
+17359,18060,17905,17537,17683,17685,17949,18139,
+18264,18719,18873,19587,19921,19849,20380,20246,
+20286,20658,20859,20970,20816,20385,20986,21456,
+20859,21610,21576,21073,22395,22870,22833,23348,
+23451,23445,23506,23826,23679,24102,24744,24856,
+23571,24700,24648,25461,25065,24799,24393,23889,
+23302,23926,24149,24159,24756,24855,25405,25239,
+24798,25133,26771,24735,24600,24163,24113,23630,
+23485,23329,23175,23088,22983,22957,22730,22508,
+22424,22471,22000,22285,21747,21890,21551,20715,
+21546,21152,20887,20456,20643,20492,20592,20622,
+20706,21176,20930,20537,20228,20021,20521,20462,
+20006,19833,20143,20375,19969,19969,20102,19785,
+19839,19531,19689,19677,19577,19626,19316,19440,
+19740,19860,19949,19316,19065,18925,19258,18963,
+18874,18237,18723,18605,18724,18828,18576,18282,
+18280,18220,18310,18445,18426,18339,17956,16802,
+18453,18334,17419,17626,17045,17403,18022,18089,
+17977,17775,17277,18328,17955,17966,18125,19355,
+17817,17992,18003,18082,18333,18081,18701,18348,
+17730,16828,17342,18247,18300,19478,20684,22431,
+26650,32676,33582,35097,36735,36365,33652,34044,
+33132,29542,24090,20749,19506,19250,18822,19322,
+18357,18204,18960,19008,18903,19311,19471,19738,
+19736,19333,19306,18068,18863,18903,18459,18737,
+18255,18334,18360,18281,18576,21099,18784,19209,
+18866,19239,19747,20486,21089,22614,26721,28677,
+28947,29709,29862,29971,30819,32247,32567,34577,
+34348,34963,36621,36208,33007,32669,30267,26799,
+25636,24508,24423,24682,24496,25155,24763,24657,
+24714,24963,25025,24917,23537,23796,23901,23293,
+23124,23728,22823,22408,23205,22751,21210,20819,
+21045,21259,21081,20503,19524,18997,19189,19089,
+18312,19432,18436,18390,17693,18003,18966,27603,
+18114,17523,18765,18223,17598,17115,17208,17354,
+17541,17583,16995,18470,18117,18226,18477,18016,
+18000,17806,18075,18052,18022,17797,17952,17709,
+17973,17379,17950,17866,17639,17187,17263,16495,
+16595,16470,16422,15845,16124,16149,16513,16434,
+17037,17060,17773,16470,16793,16302,16533,16889,
+16799,17027,17109,17327,17402,17721,17580,17310,
+17246,18138,19355,18264,17818,17795,17697,17655,
+17876,17976,18035,18218,18263,18456,18540,18683,
+19119,19321,19404,19716,19649,19316,19591,19997,
+20643,20991,21170,20940,21073,21026,20973,20703,
+20359,21001,21063,21261,21927,21728,21627,22200,
+22800,23040,23270,23949,24508,24568,24849,25176,
+24729,24897,24420,24134,24036,23424,22801,22579,
+22208,22295,21955,22810,21645,21919,21991,21702,
+21201,20978,21255,21962,20882,20159,20876,20666,
+15717,20334,20513,23822,23190,22046,21558,21237,
+22220,21962,21852,22267,22947,23109,22860,22911,
+23075,22073,22486,20995,18108,21531,22302,20436,
+21616,20838,23946,23692,22096,20660,22536,23419,
+21987,21262,21133,21086,21433,21835,22008,21948,
+22215,21949,22439,21628,21954,21813,22151,21738,
+21611,22189,29114,31794,33928,33840,33721,34673,
+36651,36621,36249,35943,35797,35690,35499,35739,
+36467,36234,36264,34788,33831,33444,32704,32603,
+32895,32904,32907,32901,32853,32847,32896,32793,
+32769,32745,32730,32712,32773,32397,29603,28165,
+24175,19878,18960,18207,17342,16811,16418,16304,
+16235,16225,16455,16164,16137,16012,16336,16676,
+17148,17464,17613,17688,17679,17706,17688,17606,
+17535,17474,17466,17459,17479,17454,17443,17351,
+17376,17359,17303,17167,17101,17190,17160,17380,
+17865,18045,18017,17946,18101,18133,17506,18477,
+18495,18741,18646,18966,18899,19046,19595,19596,
+19584,19479,19843,19887,19942,20067,19825,20004,
+20193,20082,20763,21266,21527,21705,22104,22248,
+22380,22250,23305,22894,23935,25054,24183,24830,
+23806,23666,23357,24000,24076,24003,23217,22776,
+23074,22434,21988,21456,21856,21942,22340,21884,
+20962,20879,21129,20739,20906,20193,19521,19121,
+19497,20307,20064,21267,21177,21089,22704,22475,
+22070,22235,21919,19202,19497,18552,19112,18639,
+18204,18423,18181,18051,18227,18027,18201,18578,
+18204,18951,19158,19000,18505,18598,18380,18988,
+20057,19755,26561,22020,20988,19709,19998,18685,
+17559,18183,18731,18818,19757,17216,18269,18203,
+18044,17902,17706,17620,17814,18102,19206,20343,
+22001,23398,24755,24153,23673,24737,24427,24240,
+21297,20128,19281,18678,18663,18219,17730,18579,
+18574,18989,18465,17069,17457,17967,18831,19310,
+19080,20295,20724,21385,21516,22398,22660,23075,
+23646,23937,24722,26389,26251,19547,26443,23270,
+22821,22207,25645,21960,22534,23004,23436,23527,
+23936,23140,22736,23559,22549,22809,22909,22153,
+22573,22190,21504,20107,19979,19503,19252,19176,
+18956,18851,18741,18411,18549,18096,17348,17910,
+17884,17950,17704,17529,17531,17640,17618,17779,
+17985,18762,19374,20106,20109,19881,19752,20301,
+20581,20742,20613,20875,20895,20671,20636,20712,
+21041,21770,20940,21888,21690,21132,22736,23157,
+24186,23523,23581,23601,24343,24301,24627,24467,
+24480,23491,24573,24841,24796,24423,23911,23821,
+23395,23637,23262,24216,24870,25476,24784,24753,
+24791,25094,24844,24500,24180,23892,23590,23524,
+23318,23226,23138,22884,22868,22779,22442,22237,
+22152,22183,21968,21702,21580,21571,20952,20926,
+20968,20955,20109,20238,20134,20194,20555,20915,
+20577,20913,20734,20566,20049,20125,20437,20171,
+20660,19773,19851,19683,19764,20158,20003,19688,
+19674,19725,19454,19614,19715,19355,19125,19277,
+19422,19396,19413,19087,18744,18715,18277,18577,
+18489,18166,18992,18198,18504,18867,18015,18150,
+18361,18395,18305,18260,18205,18060,18022,17596,
+17880,17012,18053,16395,16908,17022,17473,16978,
+17707,17649,17969,17656,17751,17761,17862,17627,
+17835,17815,17907,17673,18161,18450,17243,17649,
+17028,18811,18090,18106,19410,20652,23530,26313,
+31545,33237,34236,34406,33530,33747,34930,33901,
+33228,30459,21874,20548,19660,19164,18843,18891,
+18499,23511,18138,18480,19304,18898,19307,19515,
+19604,19585,19566,19272,18812,18514,18309,18175,
+18208,18483,18538,18595,18446,18539,18944,19061,
+18381,19536,19505,20758,21312,26644,28788,29383,
+29898,30059,30139,30399,30793,31560,32473,32711,
+34385,34202,32622,33317,32997,33429,33003,33712,
+30465,28999,26712,24423,24011,24075,24770,24760,
+25299,24721,24328,24325,22506,22641,22081,19974,
+20673,20877,22173,21608,22597,20395,19791,19884,
+20091,20384,20643,20024,19809,19089,18743,19008,
+19353,18403,17783,17736,19241,29274,20686,17186,
+17535,17517,17676,17595,17245,16948,17479,17517,
+17448,17905,20055,17701,19038,19023,18324,18316,
+18062,18148,18057,17889,18048,18148,18321,17880,
+17929,17988,17950,17616,17568,17037,16811,16740,
+16628,16110,16480,16560,16387,16358,17394,17375,
+16738,17208,16685,16208,16986,16853,17063,18267,
+14964,17544,16950,17339,18247,17913,18192,17285,
+17761,17935,18111,18256,18140,17796,17834,17967,
+17705,17808,18032,18331,18541,18606,18925,19217,
+19233,19446,19443,19537,19912,19740,19575,20226,
+20922,21086,21407,20913,20491,20880,20647,20250,
+20835,20941,21459,20696,21241,21393,22086,22080,
+22560,22842,23276,23762,24057,23975,23961,24217,
+24191,24852,24417,24122,23664,23679,22845,22558,
+22295,22306,21891,21561,21818,21767,22160,21633,
+21085,21078,21180,21316,22298,20379,20373,20635,
+19806,19572,20197,19685,21548,21897,21631,21926,
+22162,21787,22127,22173,22346,22636,23328,23553,
+23448,24442,23500,23233,22810,23153,21834,21677,
+22272,23100,22971,22788,23552,22575,21175,21111,
+20886,21390,21028,20890,20824,20479,21071,21496,
+21272,21257,22470,22488,22625,21810,21610,21426,
+21418,20777,28047,32100,33984,33478,33831,36536,
+35640,36855,36004,35124,36419,35712,35835,35632,
+35265,34594,34258,33801,33570,33285,32997,33257,
+33201,33043,33064,32975,32898,32890,32854,32812,
+32808,32749,32638,32712,32764,32622,31836,28978,
+28193,24149,20152,18784,17752,17213,16668,16605,
+16309,16479,16524,16592,16575,16577,16704,16925,
+17289,17421,17517,17607,17663,17709,17714,17586,
+17594,17554,17534,17518,17486,17436,17455,17421,
+17328,17379,17388,17325,17233,17214,17230,17528,
+18559,17927,17802,18051,18164,18081,18413,18558,
+18922,19035,18954,18660,19296,19612,19827,19933,
+20368,20210,19810,20007,20266,20332,20496,20877,
+20964,20389,19981,20366,21191,21403,22264,22586,
+22032,21516,22544,23392,24281,26291,22605,23949,
+23442,23573,22917,23655,23591,23627,23217,23415,
+23504,23523,24063,24159,22304,22263,22356,21961,
+21477,21414,21576,21120,24515,20733,24684,19611,
+19719,26698,19437,19491,20358,19392,19953,20090,
+20160,19630,18993,18550,18830,18669,18648,18523,
+18434,17997,17757,17826,17398,17416,17541,17568,
+17755,18384,18173,19002,19358,18957,19359,19408,
+18965,19445,18643,23532,26922,22708,19771,19313,
+18645,18278,18119,18114,18357,18107,18085,18066,
+17857,17454,17719,17252,17515,17492,18912,20358,
+21432,23211,24758,25137,24590,26013,24940,25041,
+23782,21464,20085,19383,19692,19020,18646,19131,
+19141,20215,18099,18115,18105,17016,18809,19386,
+19709,20760,19912,21619,20098,21337,22369,22366,
+22568,23693,24530,25398,25555,26120,26484,26156,
+26031,25099,25576,23512,22989,23084,24276,24792,
+23205,23318,22920,21948,21624,22365,23199,21663,
+21696,21696,21017,20490,19984,20077,19378,19104,
+18777,18687,18439,18303,17768,17712,17521,17458,
+17759,17429,17616,17836,17478,17323,17736,17709,
+18134,18582,19814,19977,19537,19675,19821,20693,
+20562,20972,20728,20856,20832,20724,20697,20793,
+20737,20808,21273,20942,21885,22293,20844,23067,
+23165,23867,24040,24519,24704,24492,24480,23991,
+24486,23745,24051,24102,24039,23802,23654,23650,
+22922,23410,23080,23142,24857,25081,24406,24334,
+24389,24291,23842,24741,23298,23695,23577,23227,
+23230,23226,22942,22613,22451,22511,22299,22032,
+21850,21619,21648,21476,21451,21094,20969,20719,
+20720,21050,20217,19886,19966,20039,20023,20506,
+20832,20755,20883,21379,19700,19823,19979,19776,
+20022,19361,19540,19352,19503,19716,19800,19369,
+19427,19281,19258,19386,19233,19082,19062,18941,
+19008,19245,19174,18560,19119,18469,17826,18811,
+18295,18146,18168,17967,18964,18315,17556,17964,
+17934,18131,18161,18037,17943,17924,17769,17733,
+17760,17428,16508,17079,16811,17504,17127,16950,
+17186,17354,17364,17181,17333,17147,17374,17457,
+17438,17465,17326,18187,18265,18356,17247,17426,
+17559,17994,18065,19095,20760,22504,27222,32657,
+32715,33024,32991,32806,32574,32763,32805,32816,
+32886,32493,22200,20622,20036,19210,19002,18987,
+18342,18553,19917,18371,18559,18956,19533,19809,
+19890,19318,19722,18310,18751,17988,18204,18133,
+18303,18569,18683,18939,19266,19050,18430,19560,
+19477,20391,20595,20364,20746,26673,28824,29735,
+30236,30218,30295,30409,30634,31303,31954,32517,
+33065,32730,32860,32790,32670,32598,34467,33852,
+33064,31961,27334,25884,24281,23896,23829,24965,
+24802,23871,23112,22214,21808,21703,21491,19993,
+20785,19986,20223,20798,19948,18965,19074,19358,
+19482,19523,19456,19338,19355,19141,18478,18794,
+18600,18502,18202,18755,18464,17497,16904,16309,
+17719,17833,18034,17637,17597,17364,17335,17422,
+17501,17824,18269,18301,19135,18242,18917,18573,
+18462,18067,18083,18017,18345,18440,18159,17993,
+18087,17769,17709,17804,17446,16876,16605,16578,
+16460,16367,16149,16905,16891,17064,16609,17067,
+17263,17319,16917,16700,18343,16839,16344,16436,
+17095,17122,16998,17933,19210,17100,17850,17222,
+17258,17609,17915,18150,18349,18165,18044,18204,
+18015,18152,18107,18343,18608,19119,18837,18939,
+19300,19229,19539,19160,19704,19878,19611,20520,
+21137,21159,21159,21096,20673,20406,20332,20737,
+18348,20335,20755,20913,21081,21519,21834,21918,
+22394,22316,23097,23432,23569,23621,23704,23944,
+24936,25155,24230,24131,23727,23188,23130,22683,
+22369,22244,22184,21486,21482,21449,21570,21263,
+21269,21060,21109,21046,21182,20659,20457,20245,
+19832,20121,19481,19899,21354,21318,21109,21757,
+22374,22385,23160,22658,22002,22526,22851,23797,
+23724,24069,23010,21675,22221,21879,22077,22119,
+21867,21740,21228,21153,19154,20386,20001,20853,
+20875,20794,20348,20698,19794,20472,20710,20871,
+20344,20386,19391,19612,20881,20933,21567,21396,
+21531,20509,25287,30532,32736,33906,33334,33301,
+37707,38756,35289,35546,36026,36348,36248,36033,
+34927,34156,33848,33451,33236,33070,33394,33199,
+33191,33125,33100,32988,32961,32922,32878,32830,
+32795,32734,32750,32781,32703,32835,32708,31764,
+29340,28071,24597,20082,18625,17742,17071,16980,
+16629,16601,16585,16621,16631,16710,16770,16909,
+17106,17170,17385,17469,17598,17656,17694,17673,
+17664,17606,17541,17527,17540,17529,17470,17424,
+17426,17448,17424,17409,17321,17255,17538,18314,
+18438,17721,17687,18063,18033,17997,18270,18384,
+18612,18361,18985,19045,19623,19221,19691,20138,
+20465,20169,20289,20012,20232,20548,20484,20613,
+20801,20694,21012,21339,21496,21604,21931,22185,
+22068,22613,22959,24112,24969,25459,24671,23856,
+22830,24283,23491,23575,23210,28728,23235,24157,
+24145,23316,23268,22942,25551,22559,22606,22762,
+22446,22259,22767,22652,22043,23607,21089,20688,
+20071,20256,18662,20310,18713,18198,17459,18597,
+19051,19075,18613,18767,18692,18549,18461,18387,
+18336,17533,17487,17430,17345,16894,16770,16838,
+17382,17847,18115,18165,18706,19037,19085,18697,
+18678,18553,22109,18448,25092,28248,25936,22020,
+18328,18063,17907,18364,18188,17817,18180,17771,
+17850,17757,17433,17348,17478,17685,18221,19874,
+21576,23641,24759,25704,25859,25157,24468,24148,
+22881,21019,20263,19922,19813,19098,19812,21175,
+21321,20503,21312,17662,19251,17850,18336,18066,
+18285,19376,18972,19838,19224,20280,20334,21378,
+22046,22457,24364,25055,26013,27966,26210,23890,
+24687,26654,23223,27634,26167,23755,24873,24413,
+22551,24102,22134,21843,21111,21376,21867,20195,
+20905,20918,21333,20613,20027,19323,19377,19226,
+18764,18628,18350,18035,17623,17732,17455,17058,
+17103,17004,17374,17315,17501,17367,17845,17788,
+18058,19108,20100,19124,19831,20093,19587,20536,
+20941,20974,20649,20646,20559,20552,20640,20589,
+20706,20800,20924,21762,21570,22009,22306,21288,
+22073,24849,25808,23452,24630,24184,23598,23883,
+23329,23494,23451,23247,23811,23472,23297,23071,
+22980,23073,22784,22845,22990,23661,23771,23572,
+23560,23732,23996,23356,23488,23302,23438,23130,
+22920,22809,23358,22537,22342,22191,22030,21931,
+21758,21537,21408,21183,20967,21039,20660,20475,
+21303,21086,20699,20213,19721,19764,20076,20172,
+20421,20409,20091,19206,20024,19731,19592,19534,
+20035,19779,20147,19776,19351,19395,19483,19503,
+18966,19482,18999,18940,19045,18939,18682,18895,
+18974,18774,17912,19484,18604,18282,17995,19119,
+18394,18502,18252,17754,18894,17637,17103,17129,
+17473,17526,17697,17762,17824,17808,17783,17723,
+17817,16867,16779,16753,16527,17115,16425,16548,
+16514,16325,16848,16824,16794,17069,17027,17118,
+17267,17406,17408,17479,17628,18717,17247,17472,
+18056,18184,19296,20422,22818,25055,29384,32802,
+32869,32823,32835,32794,32826,32761,32751,32859,
+32996,32798,25023,20541,20037,19147,18958,19055,
+18871,18688,18768,18858,18957,19188,19283,19508,
+19867,19335,18663,18943,18364,18318,18207,17806,
+19230,18744,18748,19063,18868,18833,20951,21630,
+22284,23246,23522,21011,23549,25815,29106,29976,
+30157,30346,30453,30396,30546,30847,31140,31974,
+32400,32650,32748,32748,32694,32727,33010,33455,
+33925,32907,31205,27207,25329,23304,23116,24205,
+22852,22543,22299,21970,21669,21221,21306,20191,
+19556,19204,19008,18513,19366,18494,18669,19005,
+19217,19243,19106,19073,18967,19008,18513,18427,
+17938,18851,19014,25615,18672,17138,19206,17604,
+18036,18158,17853,17594,18352,17599,17673,17833,
+18051,17889,18897,18266,18969,19070,18714,18967,
+18198,18235,18091,18318,18333,18319,18280,17977,
+17864,17559,17467,17700,17021,16747,16596,17076,
+16808,16402,16399,17401,17259,16930,16794,16951,
+16506,16179,16956,17018,17605,16933,16686,17462,
+17392,17453,17889,17336,17263,17303,17539,17231,
+17819,18109,18266,18171,18056,19217,18066,17987,
+17841,17982,17968,18585,18749,19067,18977,19082,
+19461,19404,19043,19517,19740,19508,19752,20296,
+20834,20706,20530,20829,20531,20132,19957,19534,
+20493,19776,20326,20620,20914,21171,21667,22134,
+22657,22677,22873,23493,23632,23589,23494,24040,
+25130,25884,24459,23877,23616,23146,23165,22858,
+22482,22411,21906,21735,21742,22116,21341,21375,
+21203,21099,21049,21048,20731,20496,20654,20388,
+20658,20111,19314,19629,21552,22317,22170,22636,
+22516,22921,22924,23322,24040,23874,23550,23232,
+24547,24444,23649,23238,22575,22527,22638,22143,
+21927,21742,20961,21900,21838,19972,20335,20635,
+20742,20418,21293,21203,21530,21021,20933,20844,
+20499,20811,21119,20777,20996,21408,20808,21432,
+20910,20446,24778,29499,32520,33077,33415,35199,
+36632,36310,35906,36138,34923,34741,34770,34872,
+34319,33715,33355,33704,33465,33372,33363,33192,
+33150,33144,33069,33017,32956,32932,32888,32841,
+32835,32782,32751,32765,32714,32716,32711,32755,
+31025,29399,26387,21579,19472,18647,18062,17536,
+17219,16822,16765,16827,16735,16737,16560,16956,
+17091,17251,17384,17442,17505,17572,17643,17688,
+17708,17704,17538,17589,17567,17622,17514,17590,
+17578,17522,17441,17383,17244,17403,17781,18404,
+18574,18205,17847,17988,18052,18198,18765,18681,
+19128,19284,19447,19356,19697,19577,19803,19861,
+20196,20103,20079,19755,20443,20521,21000,21064,
+21147,20756,20999,20983,21280,21164,21671,22168,
+22194,23042,23502,23704,24140,24665,25125,25902,
+23526,24331,24414,25584,23569,23310,23036,22983,
+23474,24036,23616,22122,23186,23039,22881,22856,
+23356,23504,25577,25949,27601,22484,20708,20941,
+18936,19044,19797,19272,18081,18327,18096,18273,
+18111,18146,18190,18252,18106,18303,17957,17759,
+18007,17892,17378,17346,17041,17019,16976,16517,
+16956,17280,17973,18217,18651,18747,18623,18027,
+18759,18834,21307,18511,18952,18526,18563,18539,
+18257,17700,18237,18069,18261,18019,18273,18450,
+18355,17634,17161,17158,17272,17513,17602,18945,
+21227,24396,24808,25619,25542,25403,24766,23265,
+22518,20386,20673,20441,19613,19751,21186,22119,
+21519,20727,20241,20080,18747,18278,17732,17188,
+18255,18881,17559,17853,19394,18325,18330,19313,
+20838,22363,22247,23628,24229,25998,25964,22752,
+24612,24238,25097,27019,24425,23280,23983,23099,
+24107,23262,23070,21708,20685,22754,21681,20238,
+20862,19941,20603,21171,20757,21246,19440,18905,
+18714,18448,18179,17936,17631,17295,17237,17041,
+16720,17067,17047,17202,17545,17997,18455,18053,
+18204,18858,18494,18708,19816,20259,20166,20370,
+20279,20598,20581,20384,20385,20478,20478,20309,
+20790,20995,20540,20841,21174,21552,21897,22970,
+22155,24870,26269,26226,26138,23795,23343,23066,
+23159,23211,23097,23178,22792,23106,22833,22761,
+22784,22734,22605,22722,22464,22329,22558,22809,
+22998,23068,22848,23343,22891,22906,23191,23534,
+22695,22660,22733,22305,22123,21961,21942,21864,
+21714,21406,21126,20916,20766,20624,20492,20567,
+20613,20835,20771,20228,19749,19344,19826,19380,
+19884,19536,19332,19065,19259,19460,19409,19617,
+20415,20102,19269,19584,19193,18759,20034,19263,
+19202,19341,18706,18704,18897,18717,18728,18418,
+18590,18776,18639,18363,18800,18546,18712,18030,
+18191,18390,18357,17869,19796,17160,17411,17163,
+17097,17334,17643,17716,17739,17456,17522,17420,
+17282,16774,17019,16371,16560,16596,16536,16127,
+16179,16313,16466,16480,16448,16723,16569,16593,
+16868,17268,16880,16833,17355,17345,17337,18089,
+17917,19997,20970,23367,25086,27676,32633,32750,
+32987,32793,32830,32783,32757,32778,32799,32867,
+32988,32913,25484,20175,20100,19629,18978,19142,
+18965,18830,19374,24913,19208,18984,18972,19196,
+19321,18649,19011,18936,18405,18117,18143,18394,
+18006,18701,18586,18680,18706,19130,24965,23307,
+23077,25996,25851,23200,22929,25923,29944,29818,
+30739,30891,30978,30878,30521,30528,30778,31701,
+32190,32473,32657,32715,32923,33363,33824,34919,
+34560,33390,32539,30596,30587,23034,24552,22898,
+22437,22563,22546,22562,21544,21116,20408,20612,
+19029,18444,18099,17838,17775,18010,18184,18668,
+18860,19029,19205,19251,19320,19034,18656,19850,
+21068,28191,19269,18116,17477,18267,19416,18095,
+18521,17903,17450,17256,17827,17822,17862,17741,
+17951,22990,19884,19020,18507,18289,18441,17935,
+18205,18555,17757,18204,18118,18246,17946,17880,
+17766,17512,17179,16846,16649,16755,17088,17753,
+17988,16659,17756,17352,17280,17715,16850,16614,
+16839,15486,16668,17106,17154,17129,17214,17577,
+17863,17904,18735,17375,17284,17357,17344,17508,
+17888,18245,18109,17896,18312,18168,17558,17899,
+18045,18180,18228,18966,18903,19216,19194,19290,
+18848,19775,19127,19713,19361,21158,19933,19869,
+20412,20568,20306,19780,20218,19873,19934,20221,
+20406,20292,20445,20696,20673,21159,21843,21782,
+21968,22420,22697,23677,23181,23779,23423,24442,
+25131,26176,24750,23871,23626,23383,22986,22675,
+22317,22323,21881,21684,21627,21830,21372,21221,
+21258,21474,21150,20889,20736,20418,20679,20480,
+20326,20038,19709,19703,20842,21813,21914,21424,
+22373,22792,23223,23529,23969,23977,23740,23666,
+24499,24084,23859,23509,23352,22889,22535,22468,
+22188,21726,21772,21675,21438,20776,19785,20242,
+20208,20472,21282,20301,21744,21108,21318,20867,
+21521,20642,20824,20727,20622,21894,21021,20912,
+20582,19938,23457,27342,32535,32991,33738,33696,
+36126,37671,38843,36564,35107,35484,34294,34918,
+33849,33985,33896,33669,33385,33545,33387,33287,
+33243,33108,33047,32997,32985,32946,32916,32898,
+32870,32841,32830,32898,32855,32845,32802,32742,
+32486,30813,29563,25849,21358,19357,18774,18430,
+17639,17376,17085,16971,16826,16868,16897,16970,
+17169,17274,17390,17430,17440,17517,17598,17645,
+17680,17689,17724,17715,17717,17728,17649,17710,
+17629,17581,17439,17390,17217,17760,17993,18215,
+18177,18012,18115,18149,18453,18100,18861,19101,
+18741,19590,19756,19566,19470,20397,20087,20830,
+20637,20106,19874,19323,19946,20470,20197,20793,
+20870,20743,20734,20871,20919,21466,20841,21707,
+22146,22818,23379,23762,24848,25167,25620,24450,
+25960,24599,24096,24078,23763,23378,23505,23338,
+22736,23683,22476,22555,22969,22455,24054,24708,
+24595,22801,23700,23303,22742,21671,20927,19657,
+18395,18379,18910,18696,18981,18634,18642,18182,
+18122,17760,17898,17575,17867,18016,17841,17848,
+17629,17514,17580,16785,16800,17196,16923,16861,
+17134,17061,17459,18059,18454,18625,17735,17883,
+18343,18351,19182,27811,18223,18969,18737,18083,
+18294,18357,18211,18199,18180,18723,18015,18738,
+18048,17457,17232,17421,17473,17589,18074,18492,
+20195,23423,24316,25619,25434,24442,23976,22375,
+21155,20573,21012,20166,19677,18666,20321,21449,
+20331,20673,21388,21557,18012,17873,16626,16939,
+18021,17970,17882,17179,18018,17727,19376,18987,
+20694,21346,22088,22103,22975,24191,26529,23237,
+23716,25516,22499,24248,21684,25467,26364,26353,
+23850,23868,23792,23830,23008,22744,22425,20900,
+19269,19022,21511,20244,20172,20571,19818,19565,
+18746,18133,17883,17570,17469,17237,17129,17196,
+16932,16698,17055,17330,17063,17610,18012,17763,
+20048,19413,19318,18764,20067,19599,20336,20100,
+20501,20520,20548,20435,20454,20442,20134,19869,
+19985,20498,21273,20815,20121,20936,21835,21814,
+23040,23791,27772,29084,26535,25323,23542,23814,
+23262,23099,22823,22659,22623,22658,22829,22554,
+22554,22487,22358,22377,22220,21987,21743,21976,
+22371,22553,21591,22553,22294,22432,22443,22833,
+22525,22593,21863,22089,21807,21990,21806,21474,
+21363,21281,20994,20958,20861,20356,20428,20139,
+19848,20334,20556,19914,19759,19479,19564,19861,
+19380,19616,19419,19050,18930,19008,19041,19450,
+19527,20433,19489,19824,19312,19486,19426,19393,
+19536,19115,19121,18889,18390,18768,18893,18669,
+18441,18821,18049,18655,17945,17436,17204,18389,
+18933,18408,19435,18128,17916,16929,17613,17091,
+17689,17389,17802,17561,17790,17710,17106,16660,
+16892,16875,16294,16631,16419,16545,16308,16130,
+16366,16257,16782,16276,16302,16419,16493,16633,
+16830,16630,16752,16926,17205,17250,17965,18098,
+19375,21852,23406,25161,28107,31674,32722,32716,
+32788,32829,32797,32786,32763,32812,32814,32873,
+32850,31310,26121,20597,20089,19187,19221,19089,
+18804,19022,20795,19932,19888,19998,19526,19191,
+18483,18774,18780,18828,18427,18121,18132,18456,
+19068,18447,18489,18441,18779,18826,24978,24151,
+23609,26472,26550,24228,23756,24212,29531,30837,
+31138,31354,31383,31223,30998,30684,30441,30977,
+31939,32602,32615,32876,33872,33812,34818,36131,
+36222,33900,32877,32862,31701,23130,22568,22548,
+22206,22407,22340,22473,21466,21484,20571,19829,
+19050,18242,17690,17574,17508,17249,18372,18103,
+18867,19136,19231,18945,19128,18310,18972,23402,
+21941,19636,17211,17339,16897,19178,18354,18093,
+18076,17589,17544,17247,17533,17646,17943,18015,
+18276,19727,19615,18434,18007,18256,18266,18773,
+18333,17988,17991,17789,17895,17745,17188,18137,
+17976,17478,17022,16887,16935,16681,16660,17372,
+17195,17497,17936,17547,18009,18073,16286,16577,
+16902,16833,17528,17166,17600,17787,17416,17088,
+17127,17511,17265,17327,17822,17598,17761,17590,
+17917,18115,18247,17863,18176,17939,17938,18137,
+18338,18558,18414,18614,19101,18944,18360,19031,
+19783,20770,21231,21304,20927,20040,19959,19086,
+19745,19605,19575,19786,19221,20294,19920,19806,
+20409,20541,20639,20872,21120,21021,22087,22173,
+21827,21999,22464,23389,23186,23817,24258,24359,
+24660,25045,24698,24325,23784,23403,23114,22686,
+22775,22298,22132,21796,21264,21540,21322,21011,
+21072,21301,21138,20820,20729,20781,20862,20793,
+20263,20960,19998,19998,22109,21946,22116,22128,
+22247,22811,23427,24200,25065,24543,24747,24795,
+23922,23773,23244,23835,23592,22848,22890,22631,
+22151,21912,21925,21645,21143,20664,20460,21104,
+21059,20932,21320,21797,21760,21178,21707,22819,
+20224,20553,20859,20890,20905,21284,21418,19556,
+20877,20073,19862,28724,32706,33444,33223,33842,
+37169,36629,39177,35965,35183,34858,34884,34028,
+34101,34120,33638,33606,33561,33451,33453,33049,
+33306,33157,33113,33011,33249,33246,33132,33059,
+33022,32979,32925,32865,32801,32778,32741,32725,
+32721,31740,30177,29414,22971,20753,19783,19100,
+18360,17553,17399,17223,17203,16944,17078,17022,
+17256,17349,17422,17345,17414,17469,17505,17585,
+17638,17659,17698,17730,17725,17745,17782,17763,
+17773,17684,17560,17448,17347,17978,18328,18602,
+18263,18123,17970,17876,18172,17853,17977,19527,
+19772,19944,19174,20359,20187,21114,20449,20869,
+20508,20235,20604,20192,22646,22109,20665,20939,
+20724,20878,21207,21552,21962,21213,21560,21616,
+21645,21636,21804,24624,23687,26187,26118,27211,
+26082,24113,24125,24250,23946,23583,23698,24442,
+28535,24257,24813,23253,22512,22760,22558,23125,
+23957,23490,22350,22435,24389,20457,21639,21051,
+20907,19152,18686,18810,18472,18457,18050,18301,
+17749,17904,17729,17625,17595,17942,17621,17802,
+17696,17304,17364,17210,17645,16944,16806,17230,
+17391,17112,16935,17614,17814,17724,18375,17619,
+18399,18350,20109,23927,20831,18274,18659,18752,
+18560,18593,18493,18460,18342,18678,18559,17751,
+17758,17553,18178,17476,17791,17607,17343,17868,
+19290,20860,23281,24159,24543,23882,22764,21957,
+20472,20843,20646,20244,20241,20142,21111,20741,
+20270,20257,21417,21492,19164,19139,17588,17185,
+17385,18057,18177,18324,17491,17407,17551,19422,
+19871,20904,21380,21156,22679,23115,25489,24572,
+23918,23449,22198,23535,21429,25380,24259,24847,
+25854,24784,23021,24945,23697,22377,25056,22279,
+20212,22497,21738,21808,20460,20349,20139,19593,
+18894,18167,17689,17572,17262,17018,17223,17179,
+17010,17094,17022,17121,17433,17387,17556,17566,
+19495,17920,19381,19743,19954,19743,20134,20319,
+20468,20298,19996,20197,20613,20603,19805,20287,
+20316,20373,20256,20723,20094,21230,21381,22600,
+23688,24473,25106,29266,27333,27279,23147,23164,
+23167,22991,22718,22542,22509,22524,22464,22290,
+22347,22152,22146,22236,22149,22001,21990,21612,
+22121,22129,22124,22011,22102,22335,22347,22507,
+22247,21954,21977,21895,21969,21662,21443,21173,
+21063,20955,20985,20864,20693,20425,20253,20229,
+19947,20049,19815,19562,19155,19303,19677,19034,
+19071,19290,18862,18742,19562,19092,18888,19020,
+19159,20026,19461,19637,20075,19392,18800,19274,
+19167,19747,19469,18979,18482,18475,18855,17897,
+18072,17882,18045,16751,18366,17181,19881,18363,
+17684,18732,18383,17998,17802,17183,17132,17790,
+17282,17604,17781,17682,18062,17416,17125,16863,
+17097,16713,17082,17102,16465,16287,16514,16312,
+16380,16342,16323,16468,16185,16395,16259,16487,
+16608,16344,16647,17002,17190,17394,19328,20020,
+23728,26110,29125,32756,32950,32824,33000,32958,
+32772,32765,32781,32910,32979,32991,32856,32831,
+32703,26431,23446,23714,19893,19499,19326,19185,
+18957,18893,18960,19282,19326,19269,19910,19877,
+18876,18972,18792,18369,18370,18354,18961,18572,
+18248,18219,18482,18765,18579,19492,20967,22082,
+24295,26898,27773,24537,24441,26879,29786,31096,
+31358,31598,31489,31356,31099,30699,30342,29729,
+29648,32554,32538,32615,32789,33363,33829,33959,
+35045,35310,34614,34053,32827,29946,22376,22244,
+22319,22410,22394,22987,23127,21204,20668,18550,
+18826,17952,17482,17421,17454,17287,17619,16950,
+18649,19135,22080,18796,18355,18258,20270,23298,
+28851,18454,17280,17348,17183,16863,17016,18125,
+17901,17480,17274,17418,17245,17055,17588,18706,
+17999,18786,19266,17748,17443,17928,17315,17016,
+17505,17757,17128,17346,17274,16852,17342,18566,
+17276,17205,16784,16650,16562,16309,16539,16897,
+17076,17312,17928,17073,16891,16859,15723,15775,
+16902,16839,17282,17396,17499,17398,17367,17737,
+17274,17699,17258,17535,17610,17973,18301,18276,
+18432,18057,17670,18549,18035,18396,18630,18678,
+18569,18400,19218,19145,18959,18902,19100,19786,
+20349,21147,21662,21787,21100,21324,20344,20078,
+19647,19560,19899,19484,20355,20924,20085,19973,
+20900,20015,20549,20411,20786,20763,21400,22016,
+22014,23352,22770,23681,23343,22692,24610,23994,
+24373,25326,24997,24565,24054,23486,23076,22834,
+22578,22299,22222,21933,21581,21433,21478,21128,
+20940,20973,20860,20893,20814,21042,21251,21171,
+20256,20808,21738,21828,21887,21746,21677,21660,
+22469,22405,22632,24010,23625,23435,23675,22443,
+22983,23129,23752,23388,23111,23003,22615,22566,
+22335,21971,21466,23215,22266,20919,20505,20587,
+20941,21316,21717,20688,21239,21579,20674,20910,
+20868,20454,20308,20871,20442,20819,20931,21082,
+21442,20098,19620,28457,32443,33418,33702,34203,
+37039,36681,36715,36537,34815,34638,34172,34848,
+33953,33892,33865,33728,33578,33912,33622,33285,
+32977,33504,33468,33714,33642,33782,33474,33394,
+33333,33237,33208,33141,32978,32859,32763,32788,
+32665,31947,30806,29448,25194,21291,20649,19774,
+19108,18457,18102,17645,17511,17298,17364,17445,
+17439,17451,17463,17484,17495,17531,17571,17622,
+17657,17679,17693,17724,17757,17757,17799,17873,
+18017,17985,17861,17559,17529,17927,17735,18306,
+18100,18006,18254,18360,18567,18360,18544,19569,
+19974,20169,20265,20983,21258,20574,22342,22010,
+20566,20643,20269,20925,20820,21204,20697,21581,
+21401,20784,20934,21072,21107,20958,21187,21544,
+22752,21909,22578,24330,25389,27327,26451,22770,
+23664,24261,23727,23266,23350,23176,24156,23171,
+22866,21402,22269,22388,22839,23346,23382,26874,
+23934,23787,23056,21578,22401,21625,20575,20136,
+19444,19692,18769,18011,19171,18922,18166,17910,
+18083,17604,17379,17616,17535,17577,17694,17704,
+17796,17856,17897,17778,17505,17363,17379,17557,
+17778,17529,17956,17736,17573,17277,17365,17622,
+17640,18164,17780,18063,18117,25801,18849,18533,
+18531,18704,18750,18834,18649,18695,18484,18503,
+18633,18564,17709,17384,17619,17652,17412,17581,
+18747,20936,21697,23572,24432,23891,24468,23988,
+22674,20166,20079,20348,21255,20825,20926,20745,
+20646,20391,21684,22616,20787,17343,18243,16296,
+16563,17258,16785,17669,18381,17699,17949,18643,
+19785,20658,20007,20707,21562,22483,24448,25679,
+23612,22744,21650,24430,22173,24417,25801,28106,
+23694,26363,28352,26598,23277,23624,23806,24223,
+22239,21648,22413,21102,20257,19539,20238,18843,
+19425,18334,17869,16805,17354,17287,17298,17079,
+17182,17258,17302,17340,17325,17577,17727,17596,
+18109,19374,18589,19003,19630,19115,19860,20061,
+20150,20295,20352,20162,20342,20448,20223,19962,
+21154,20265,19416,19935,20737,20492,21675,22139,
+23529,25268,25919,31151,27117,27260,29008,22737,
+22728,22671,22299,22239,22058,22359,22256,22318,
+21942,22095,21978,22212,22184,22092,22100,22160,
+21703,22029,21623,22163,22036,21825,21891,21947,
+22003,21223,21145,21795,21889,21435,20971,20620,
+20530,20691,20691,20507,20138,19953,19728,20070,
+20021,19683,19563,19517,19422,19320,19452,19005,
+18944,18889,18568,18730,18792,18993,19161,19038,
+19257,19701,20277,19834,19223,19698,19497,18993,
+19644,20330,20505,19896,19023,18029,19287,19676,
+18846,17110,16964,16975,17727,20679,16933,19288,
+17326,17948,18066,18651,17344,17508,17046,16917,
+16571,17460,17444,17284,17943,17602,16748,16410,
+16776,16681,16400,16188,16260,16240,16619,16242,
+16448,16333,16113,16260,16074,16426,16636,16276,
+16487,16320,16606,16523,16926,22461,24255,25787,
+28922,32847,32843,33015,33140,33330,33453,33399,
+33165,32986,32971,33276,33502,33520,33040,32858,
+32454,32634,32050,30864,26030,19381,19136,19002,
+18571,19217,19065,18918,20973,18996,19269,20032,
+19332,18886,18084,18673,18607,18080,18450,19068,
+18963,18264,18514,18495,18351,18555,22236,23334,
+25413,28004,27911,26210,25390,26478,28628,29889,
+31162,31475,31243,31378,30591,30316,29301,28360,
+28642,29042,29751,32567,32730,33138,33273,34116,
+34343,33751,34347,34313,33231,32586,23632,23293,
+21780,22336,22350,22809,22062,20904,20424,17855,
+17949,17397,17317,17691,17412,17204,17030,17122,
+17720,17999,17958,17649,17160,21144,19634,20175,
+19453,20439,18737,17187,17241,16563,17019,17265,
+17689,17328,16896,17110,17202,17447,17774,19028,
+19221,18930,17793,16818,17500,16891,17190,16821,
+16842,17040,16824,16955,16573,16858,17290,18339,
+17155,16443,16504,16488,16119,16293,16342,16134,
+17976,17076,17269,15735,17757,16287,15777,17013,
+17724,17905,17271,17896,17832,18018,17777,17592,
+18171,18052,17608,17977,18095,18189,18397,18251,
+18347,18777,18621,18579,18400,19064,18881,18943,
+18569,19488,19153,19535,19482,19161,19669,20094,
+20615,20931,21306,21069,20996,19880,20018,20539,
+21054,21304,21813,21555,20961,20216,20520,20849,
+20247,20533,20559,20965,21376,21411,21858,22527,
+22059,22248,22255,22983,27175,23303,24093,25297,
+24681,24389,25417,24229,23890,23501,23166,22681,
+22455,22419,22529,21914,21505,21305,21373,21265,
+20740,21503,20565,20708,21004,21012,20445,21394,
+20618,21279,21457,22072,22199,21969,22302,21962,
+22784,22711,24225,24559,24243,22600,24120,22893,
+22174,21959,22176,22038,22168,22248,22064,22316,
+20828,20961,21735,21915,20372,20403,20569,20907,
+21322,22038,21660,20786,20838,21118,21363,20913,
+20644,20736,20732,20563,20829,20742,20584,20804,
+20847,20152,19023,27558,32389,34584,34006,33553,
+34534,37535,36605,36069,37110,35477,36086,34473,
+34015,34044,33907,33758,33656,33729,33920,33558,
+33438,33572,33777,34621,33852,33661,33558,33657,
+33549,33716,33494,33303,33087,32951,32901,32766,
+32745,32709,30936,29418,29322,22810,21447,20854,
+20017,19395,18618,18054,17789,17720,17648,17573,
+17595,17598,17572,17583,17629,17563,17637,17702,
+17757,17775,17814,17754,17757,17846,17843,17873,
+17983,18127,18271,18096,17969,18246,18586,18338,
+18165,18164,18414,18678,18829,18837,18588,19517,
+20046,20482,20863,21976,21128,21345,21259,21324,
+20134,20358,20421,20793,20421,20021,21270,21471,
+20837,20712,21325,21186,21893,21117,21478,21723,
+21778,22603,23314,23786,25247,25858,25553,23607,
+24102,23613,23507,23585,23219,21690,22085,22800,
+22080,21509,21772,22578,22950,23085,22654,23224,
+22839,22458,24096,25422,21999,22562,21072,20552,
+20344,19619,19773,18479,18783,18313,17947,17871,
+18039,17557,17864,17534,18036,17636,17890,17967,
+17958,17841,17819,17927,20670,17847,18043,17844,
+18370,18035,17646,18039,17767,17437,17386,17612,
+17382,18314,17958,18547,17661,17911,18270,19833,
+19050,19375,19079,19290,19100,19005,18742,19330,
+19706,21390,19780,17949,17550,16671,16770,17383,
+18442,21072,22275,23361,24031,23645,24150,22395,
+22653,20493,20083,20034,20372,20414,20563,20388,
+20500,20426,20974,21738,22054,19169,18267,16178,
+17445,17037,17985,18005,17274,16935,17913,18307,
+19455,19279,19566,19853,21090,22083,24195,25087,
+25446,22937,23000,22822,23265,24018,24459,23831,
+26513,26281,26292,24374,27257,26302,27038,23512,
+21486,21901,21434,19521,19228,20259,19991,20913,
+18366,18470,17721,17208,17508,17131,17315,17302,
+17319,17394,17474,17458,17592,17825,17841,18149,
+19208,19339,18873,19761,19926,20001,20156,20178,
+20339,20603,20349,20376,20217,20118,19523,20252,
+20410,21431,20126,20169,20898,21211,20906,22447,
+22620,23463,24810,28077,27779,27367,27158,24432,
+22580,22148,22205,22056,21996,22102,22395,22318,
+21533,21813,21839,21938,22044,22122,22154,22152,
+22361,22887,21697,21824,21605,21502,21317,21546,
+21795,21806,21173,21593,21537,20997,20988,20549,
+20355,20426,20151,20125,19866,19654,19527,19733,
+19608,19561,19520,19686,19360,19219,18745,18909,
+18390,18408,18607,18360,18724,18753,17439,19191,
+19418,19769,20348,19602,19780,19836,19026,18912,
+19499,19963,19325,19367,19477,17896,17462,17360,
+19326,19360,18015,17796,18581,17841,18324,16287,
+17047,17617,16714,18549,17493,16756,16663,16164,
+16227,16472,16479,16461,17316,17438,16750,16470,
+16494,16054,16154,16368,16371,16261,16238,16362,
+16718,16259,16296,16297,16365,16497,16654,16520,
+16898,16448,16901,17586,17605,26279,29149,32061,
+32887,33175,33132,33458,33638,33648,33765,34170,
+34155,33167,33330,34201,36273,34461,33339,33219,
+33069,33105,33090,32794,31139,19629,18633,18666,
+18758,19038,19360,19035,19403,19178,19651,20253,
+19796,19323,19226,18745,18630,18076,18078,18690,
+18167,18016,17757,18982,19326,20571,21093,27528,
+28829,29095,28329,27533,27123,28632,29919,30629,
+30985,31034,30822,30516,29343,27976,27812,27750,
+27972,28397,28815,29766,32655,32882,33090,33140,
+33335,32976,32742,33789,33784,32684,29309,22754,
+19022,21180,22422,21502,22466,20665,19056,17347,
+16888,16696,16463,16748,18516,16917,16770,17288,
+17412,18433,17505,17240,18966,19905,18831,18657,
+19493,19021,25674,18090,18021,17254,16917,17043,
+17381,16621,17340,17480,17591,17647,18173,18168,
+18878,17490,16822,17775,17050,16765,16878,16745,
+16851,16527,16563,16563,16705,16512,16548,17282,
+16645,16293,16377,16254,16274,16407,16322,16778,
+16740,17281,17312,16848,16353,16858,15951,17976,
+18897,17200,18507,18158,17784,17739,17448,18158,
+18645,17838,17715,18044,17877,18204,18798,18606,
+18534,18486,18496,18270,18255,18680,18471,19505,
+19530,19569,19947,20097,19943,19439,19058,20225,
+20553,20586,21439,21333,20644,19574,20468,20273,
+20832,18369,19704,16569,19401,22908,21279,20100,
+20460,20262,20838,21747,20945,20815,21025,21060,
+21470,22142,23985,22901,23085,22933,23247,23639,
+24833,25336,25611,24753,24255,23481,22813,22323,
+22265,22272,22220,21993,21648,21560,21555,21281,
+21207,20793,21774,21996,21402,22213,22093,21782,
+21393,22293,22623,22821,23759,23271,21879,22887,
+22884,20662,23310,23168,22776,22614,23085,22375,
+22711,22677,22348,22249,22040,21138,20709,21322,
+20212,20820,20868,21407,21008,20982,20964,21133,
+20962,21078,21876,20866,21109,20811,21100,20830,
+20592,21581,20541,20688,20862,20721,20568,20819,
+20464,20487,18894,23846,32290,33309,33385,33554,
+35277,37950,36382,36912,36108,35786,35376,35159,
+34479,33797,33759,33748,33872,34052,33876,33518,
+33348,33404,33453,33584,33567,33543,33621,33701,
+33649,33557,33287,33138,33040,33011,32970,32947,
+32768,32705,32639,30324,29456,25321,22799,21778,
+20871,20061,19308,18721,18198,17992,17944,17680,
+17788,17750,17744,17708,17488,17692,17812,17848,
+17889,17921,17929,17918,17960,18036,18017,17984,
+18024,18060,18147,18396,18225,18222,18181,18492,
+18158,18393,18663,18894,19334,19149,18717,19829,
+19965,20705,20660,22896,20432,19773,20176,20061,
+19832,20462,20078,20394,20608,20455,20456,20653,
+20895,21057,20883,20967,20610,21595,21572,21797,
+22101,22071,23456,24522,26124,22751,24258,22778,
+22975,23126,22890,22343,22108,23067,30429,25545,
+21987,22365,21810,21838,22116,22413,22038,22027,
+28339,22718,22958,22573,22197,21148,22752,22971,
+29212,19958,24611,21061,18514,18954,17679,17529,
+17693,18189,18031,17914,17625,17759,17661,17793,
+17724,17811,17907,18229,18365,18136,18276,18349,
+18351,17793,18480,18033,17834,17799,17588,17391,
+17752,17581,18042,18315,18233,18921,18727,18688,
+19097,19721,19766,19711,20500,19622,19359,26122,
+26849,20703,20993,21960,20474,17886,17088,17301,
+18633,21864,22905,23473,24406,23781,23160,22076,
+20776,20669,20088,19378,19171,19626,20151,20379,
+20340,20575,21172,21483,21036,20852,17713,17215,
+17009,16668,17615,17117,17258,17689,18491,18284,
+18923,18931,19790,19367,19668,20685,22070,24136,
+24432,23853,23195,21930,21417,20881,22010,22022,
+21593,23720,24825,23527,24910,25583,25668,22609,
+23613,24894,19503,20787,21820,21306,19343,18092,
+18846,18981,16956,17171,17568,17394,17591,17529,
+17468,17601,17492,17717,18070,18117,18176,18890,
+18948,19083,19400,19960,19751,19738,20202,20144,
+19620,20558,20451,20020,20058,19962,19700,19650,
+20505,21243,20659,20603,20781,21468,21099,22350,
+22794,23180,24420,25443,27261,27141,27394,25283,
+22013,22456,22104,22163,21952,21696,21957,21989,
+21786,21545,21378,21417,21435,21610,21809,22059,
+22170,23080,22290,21359,21465,21350,21084,20982,
+21570,21343,21246,20978,20962,20439,20558,19997,
+20689,20250,20212,19701,19489,19538,19600,19493,
+19596,19218,19100,18964,19071,18474,18657,18493,
+18536,18977,18430,18198,18678,18163,18210,18294,
+16934,16797,20412,17400,17058,17034,17310,15472,
+16758,16993,19661,17414,17785,18230,15555,19248,
+18894,17805,17658,19952,20554,17617,17033,17736,
+18243,17568,18596,16535,19834,17739,18568,16246,
+16776,16561,16751,16108,16849,16087,16275,16925,
+16400,16339,16201,16236,16240,16226,16269,16222,
+16251,16220,16429,16521,16670,16608,16230,17554,
+17858,17125,18867,22841,29514,30921,32513,32865,
+33096,33162,33414,33693,34001,33780,34731,33923,
+34561,34441,33880,33704,34900,36269,34827,34520,
+35124,35267,34936,33383,32743,20641,19209,18697,
+18828,18612,19212,19530,19786,20036,19980,19621,
+20139,19450,19006,18973,18015,17684,18190,18130,
+18060,17787,18369,20182,21697,24075,25477,27939,
+28191,28801,28534,28284,28320,29098,29772,29701,
+29742,29295,29244,28012,27002,27210,27248,27560,
+27479,27811,28491,29207,32624,33113,33308,34053,
+32790,31333,29345,28683,28276,29000,28149,26938,
+20830,19365,20998,19991,19449,17651,16887,16751,
+16474,16307,16272,16312,16483,17017,17192,16756,
+17535,19938,17052,17462,23398,18066,17843,18716,
+18732,19407,19201,18594,17790,17709,16742,18158,
+17860,16811,16804,17275,17030,17601,17896,17476,
+16891,17066,17173,17244,16749,16746,16752,16671,
+16874,16672,16638,16722,16773,16398,16866,16376,
+16266,16122,15950,16196,16504,16533,16726,17193,
+16904,16723,16681,17039,17835,17415,17837,18400,
+18954,18903,18604,17861,17553,18610,18007,18248,
+18419,18105,18264,18204,18531,18654,18789,18867,
+18611,18572,18412,18550,18696,18772,19365,19404,
+19665,19397,19794,21482,20110,19948,20235,20145,
+20199,20412,20514,20151,20684,19069,21042,21061,
+22529,22106,21498,21439,20274,20970,20635,20461,
+20727,19875,21750,21060,21032,20866,21339,21943,
+22776,22659,23263,23171,23735,31047,23745,24088,
+24379,24357,24714,24520,23796,23583,22665,22176,
+22274,22123,22184,22041,21917,21945,21947,21720,
+21500,21703,22347,23365,23687,24040,23302,22547,
+22746,23175,22981,23032,22905,25116,24048,23835,
+22638,23520,23593,24348,23808,23498,22749,22579,
+22113,22422,22365,21825,21788,22131,21042,20949,
+21148,20553,21264,21721,21198,20607,21007,20974,
+21232,21925,22742,21003,20821,20874,20572,20975,
+20514,20714,21241,20899,20785,20643,20793,21105,
+21282,20747,18942,22806,29685,32661,33806,33348,
+34882,36377,37431,41349,36183,38279,36216,35538,
+34791,34009,33820,33834,33957,34062,33777,33462,
+33366,33354,33353,33336,33340,33370,33441,33394,
+33390,33291,33192,33096,33033,33024,33055,32963,
+32919,32853,32732,32585,30982,28224,23885,23356,
+21907,20972,19988,19149,18699,18584,18456,18294,
+18189,18003,17924,17874,17822,17860,17946,18027,
+18019,17960,18009,18015,18028,18089,18099,18087,
+18084,18067,18089,18082,18141,18091,18365,18475,
+18305,18774,19099,19419,19361,19278,18864,20197,
+20043,20172,20453,20235,20453,20125,19660,19874,
+19518,19518,19457,19928,20652,20380,20868,20869,
+21402,21417,21186,21427,20191,20573,20861,21018,
+21117,22638,23560,23937,24855,25855,24855,23922,
+24834,23217,22707,22177,22739,22581,21712,21876,
+21318,21545,21469,22257,21963,21816,21895,21442,
+22000,21198,21569,20678,20512,21363,23699,20013,
+20064,19302,18312,19296,18083,17744,17672,18033,
+17349,17844,18045,17653,17506,17502,17310,17458,
+17661,17721,17746,17829,18190,18729,19046,20228,
+18777,18207,17860,17900,17270,17498,17923,18027,
+17985,18232,18110,18398,18384,18338,18270,18706,
+19235,19488,19896,20113,26844,20630,21223,24756,
+30309,31935,31303,25720,25803,22075,18953,18259,
+18202,19295,20790,25425,22935,22557,20764,20637,
+19713,18656,18999,18916,19083,19449,19883,20217,
+20388,20450,21169,21606,22185,21726,18469,17580,
+15978,16553,17043,16854,17135,16949,18332,18609,
+19129,18017,18464,18268,19229,19934,21693,23949,
+25189,26113,24430,23139,21756,19752,22995,18653,
+22317,23753,23334,23007,24061,23280,22500,21941,
+23621,28135,23229,22119,22677,22750,19179,20799,
+21648,21051,18645,18390,17645,17917,18084,17903,
+17744,17684,17871,18102,18468,18764,19015,19363,
+19483,19526,19926,19470,19810,19464,19599,19299,
+19990,19890,20163,20272,20037,19961,19545,19288,
+19851,20532,21258,20052,21155,20931,21923,21954,
+22504,23492,24604,24303,24508,25811,24958,25314,
+25257,25377,21870,21870,21459,21557,21506,21450,
+21425,21337,21147,21138,21338,21336,21201,21485,
+21665,22313,21552,22000,21411,21134,21024,21136,
+22688,21305,20957,20914,20865,20233,20862,20235,
+19737,19944,19719,19643,19429,19591,19794,19892,
+19857,19205,18989,19112,19197,18631,18889,18209,
+17504,18334,18153,18633,18677,17202,16615,19041,
+16740,16501,15503,17502,17983,17452,15689,15529,
+16393,15894,17614,16720,16820,19379,17706,18198,
+18215,17802,17989,18450,17865,17880,17460,17283,
+17448,16623,16008,16308,17469,16404,16847,16617,
+16214,16358,16365,16558,16327,16354,16272,16398,
+16113,16310,16392,16230,16212,16248,16275,16253,
+16247,16246,16314,16390,16785,16581,18060,19208,
+20252,25932,30407,32857,32861,32865,32988,32853,
+33121,33273,33426,33436,33403,33484,33781,33599,
+33716,33563,33402,34632,34612,36706,37284,36293,
+36624,35089,35483,33299,32609,20726,19083,18560,
+18893,18591,19008,19204,19686,19624,19422,22515,
+28119,19489,18682,19479,18713,17898,18204,17744,
+17934,18256,19304,22524,24033,24439,24262,25893,
+27609,28969,29370,29261,28996,28688,29139,28725,
+28015,27228,26418,26627,26721,26793,26911,27378,
+27710,28008,28600,30365,32956,32998,32955,33132,
+31937,28186,27901,25811,25798,25773,25710,27296,
+22545,17031,17818,17132,16039,16359,16266,16492,
+16172,16017,15825,16053,16768,17072,17120,16900,
+17348,17454,19713,17803,23439,18688,18136,18588,
+18501,18413,18886,19480,17598,17736,16850,18384,
+17740,16983,17034,17073,16588,16946,17581,17166,
+17189,17210,17749,17104,16669,16949,16943,16899,
+16703,16558,16591,16995,16803,16789,16806,16422,
+16359,16457,16633,16637,16866,17421,17358,17212,
+16305,17595,17084,17189,16572,17190,18377,18581,
+18132,18706,17654,18433,17406,18732,18783,18512,
+18724,18346,18249,18813,18990,18766,19016,18850,
+19085,18972,19159,18717,20161,19744,19573,19835,
+20187,20214,20414,19929,20022,20027,20310,19962,
+20055,20379,20336,20700,21396,24333,19739,20948,
+21499,21182,21139,21821,21451,19884,20115,21744,
+20697,20475,20952,21350,21248,21771,21690,22485,
+26408,24543,25916,26722,25459,23349,24354,25015,
+23724,24560,24093,24861,24126,23654,22874,22661,
+22637,22307,22043,22083,21977,21883,22405,23080,
+24938,24326,25754,23127,22219,23193,23097,23541,
+20641,21924,22108,22720,21250,21702,21873,20549,
+22412,27227,24682,23658,23244,23364,21532,22387,
+21883,21633,21694,22036,21164,21000,20944,21405,
+21747,21501,23160,21735,20749,23372,22751,21503,
+19678,21366,21032,21438,20889,20776,21046,20867,
+20855,20941,21159,20854,20886,20765,20893,20961,
+20731,20593,19806,18546,27436,32654,33920,33827,
+33565,37849,39194,39306,37959,37866,37394,35981,
+34954,34014,33914,33962,33975,33891,33707,33419,
+33381,33309,33309,33315,33318,33309,33270,33242,
+33228,33144,33105,33032,33039,33010,32981,32955,
+32917,32919,32857,32820,32673,31797,27048,24571,
+23150,22455,21018,19939,19653,19108,18883,18697,
+18379,18312,18207,18104,18084,18066,18105,18203,
+18150,18051,18127,18144,18164,18209,18249,18346,
+18297,18162,18059,18144,18310,18339,18459,18696,
+18647,18882,19349,19614,19261,19603,19886,19527,
+20280,20284,20118,19790,19100,19715,19520,20679,
+20400,20659,20145,20763,20760,20861,20553,20520,
+21429,21526,21340,21468,21838,21346,21174,20991,
+22032,22717,23596,25245,26742,24952,22431,23991,
+22847,22595,22381,23495,22191,22265,21719,21119,
+21626,21861,21906,22086,21641,22272,21988,21278,
+21651,24975,24063,19918,20625,21178,20892,20725,
+20874,20260,19090,18969,19034,19096,18471,17865,
+18442,17172,17830,17697,17383,17119,17061,17015,
+17286,17404,17459,17544,17865,17677,18425,18723,
+17957,17735,17793,17827,17745,17598,17473,18005,
+18349,18192,18353,18508,20511,18428,18602,19068,
+19460,19848,20321,20997,22304,22590,24906,29185,
+32459,32572,32576,32562,30994,27067,24292,23403,
+19375,18682,20540,19449,18701,21117,22166,19001,
+18999,18829,18775,18842,18930,19361,19711,19937,
+20535,20493,21108,21866,22445,22521,20059,17392,
+16476,15972,16833,17064,17232,17501,17325,17289,
+18034,18250,18489,18378,18938,19664,20463,22239,
+23496,24959,24802,23115,22646,21967,22500,21471,
+23133,22338,23045,22317,21984,21340,22873,23118,
+19785,23503,20493,24885,25068,20691,20151,21566,
+19112,19944,19287,18672,18239,17519,17957,18197,
+17653,17544,18030,18354,18979,19105,19224,19882,
+19584,19566,20262,20230,20012,20370,20178,19795,
+19836,20088,19836,19540,19938,20094,19995,20244,
+20065,20573,20540,20747,20236,21570,22473,22351,
+23008,24095,22525,23883,24717,25486,24404,25056,
+25543,25397,23957,20685,21530,21239,21459,21278,
+21107,21098,21087,20920,20892,21325,21358,21280,
+21346,21313,21466,21508,21150,20697,21017,21240,
+21528,21030,20877,20694,20268,20124,20839,20247,
+19868,19783,19488,19462,19568,19572,20420,20065,
+19004,18846,18818,18671,18611,18564,18524,18663,
+17437,17676,18684,18057,18135,14357,17460,16692,
+17146,16644,18570,18327,18382,17428,18201,16190,
+16289,16164,17568,16476,16838,17149,17316,17337,
+18388,18718,19057,19611,19281,19199,18747,17642,
+17328,17292,17580,17223,17467,17234,16973,16954,
+17388,16781,16779,16500,16004,16185,16451,16453,
+16145,16296,15952,16475,16053,16303,16487,16274,
+17100,17502,17797,18852,19178,20220,21169,26804,
+32826,32573,32880,32882,32847,32809,32804,33037,
+33110,33280,33364,33395,33351,33359,33411,33368,
+33292,33318,33312,33402,33462,34299,33993,35035,
+37198,36283,35779,34356,32955,23037,19241,18558,
+18601,18735,18855,19166,19270,19323,19884,19128,
+19245,18831,19101,19218,19850,18246,17292,20418,
+17885,24170,23151,25214,24136,23985,24204,26570,
+28353,30297,29914,29674,29223,28614,28176,26410,
+25627,25833,26121,26079,26325,26600,27202,27903,
+28295,28941,29548,32287,33076,33138,32905,32622,
+31613,27993,25056,25785,26470,25584,25321,24325,
+23139,17184,10671,13791,15069,15881,16249,16215,
+16017,16109,16120,15963,16692,17950,16767,17223,
+16955,17392,16640,20326,21243,19952,17899,18251,
+18405,17757,17300,18489,17760,17054,16401,17427,
+17391,16981,17027,16899,16325,16741,16824,16657,
+16724,17541,17300,16672,17180,17069,16955,16696,
+16621,16644,16479,16660,16495,16625,16304,16316,
+16477,16341,17011,17908,17489,17661,17948,18218,
+17217,18053,19797,17702,17396,16915,17532,18330,
+18147,17498,17856,18400,18150,18181,17901,21090,
+17373,18416,18485,18613,18887,18768,19431,18763,
+19008,19170,18494,19284,19788,20268,20869,20580,
+20514,20643,20791,20781,20874,20650,20059,20511,
+20985,20917,21842,23337,22771,21245,20628,21313,
+20529,20568,20877,21057,20608,21580,21393,20820,
+20661,21583,21570,21600,21197,22260,20842,21527,
+23914,22190,22996,27325,23417,23431,22920,23723,
+23852,24142,24625,24503,24226,23568,22968,22974,
+22413,22328,22349,22067,22692,23298,22124,22619,
+21929,22518,22527,24303,23463,23177,23613,23958,
+23607,22717,22131,22520,22569,22577,22666,23281,
+23017,23268,22692,22939,23061,21429,21795,22303,
+22140,22028,21594,21274,21459,21153,20539,20724,
+21662,21501,21663,20409,21249,21544,21503,21559,
+21393,21549,21771,21410,21180,21210,21005,21064,
+20935,21193,21029,20952,21156,20694,20782,20900,
+20705,20592,20241,17952,22222,31168,32892,33590,
+33285,36426,40587,40611,39771,37204,38626,36486,
+34762,34069,34031,34056,34022,33848,33659,33512,
+33310,33247,33249,33225,33251,33243,33246,33169,
+33114,33061,33063,33032,33058,32958,32964,32945,
+32940,32908,32913,32858,32813,32717,30895,27504,
+25288,23869,22179,21059,20067,19580,19064,18810,
+18622,18439,18389,18355,18340,18344,18449,18372,
+18265,18201,18231,18279,18240,18376,18433,18549,
+18705,18258,18190,18257,18447,18624,18921,19108,
+19065,19023,19559,19521,19442,19581,19638,19679,
+20111,20895,20331,19020,19527,18225,20140,20340,
+20856,20514,19304,20295,19779,20517,21048,20336,
+21536,21920,22011,22220,21490,21628,22060,21604,
+22116,24456,22023,23666,21751,25643,23661,23012,
+23562,22960,22927,22374,21858,21426,21375,21091,
+21402,21462,22177,21879,21523,21621,21188,21793,
+21504,20864,20306,21551,22287,22221,23853,21733,
+21552,20310,20255,19826,18900,19353,20550,18783,
+18035,18589,18475,18448,17865,17516,17094,16922,
+17222,16827,17028,17228,17083,17598,17802,17994,
+17918,17972,17934,17680,17410,17496,17562,18156,
+18315,18376,18457,18702,18460,18528,18785,19206,
+20116,20457,20984,22610,24467,25054,30693,32481,
+32524,32647,32646,32623,32215,29783,27570,26529,
+23091,19335,19019,19416,19149,19201,19341,19438,
+19143,19111,19069,19093,19151,19326,19350,19938,
+20740,20880,21192,21516,21996,22497,22083,18754,
+17275,16733,16559,16841,16896,17307,16581,17375,
+17152,16898,18304,19029,20007,19978,21729,22125,
+24929,25419,23972,22572,22974,21675,20666,22971,
+21605,21918,22350,23344,21201,21950,21409,21628,
+24037,22726,25158,27837,26358,21402,22452,22934,
+19190,18129,19245,18923,17791,16463,17837,17934,
+18111,17963,17871,18631,18362,19222,19875,20242,
+20289,19727,19826,20269,20256,20246,19899,19736,
+20178,20088,19769,19795,19812,19815,20136,19416,
+20059,20103,20663,20592,21718,20349,22550,20320,
+22556,23486,24030,23877,24975,25079,24929,24972,
+25362,25062,24990,20277,21534,21388,21626,21242,
+20916,20922,20985,21103,20948,20925,21168,21222,
+20959,21139,21068,20819,21426,21534,21021,21258,
+20968,21121,20814,20364,20115,19773,19808,19582,
+19464,19254,19197,19456,19018,19075,19552,19517,
+20027,19410,18762,18741,18852,19464,20117,18730,
+16112,14150,16960,18286,17646,16179,16819,16919,
+16018,16930,16189,16662,17007,17217,18575,17084,
+16486,17217,16372,17010,16434,17018,17762,19623,
+20295,21881,23398,22044,21467,21471,19300,18137,
+18770,17484,17693,18375,18546,18313,18234,18159,
+18137,17550,17368,17332,16964,16750,16870,16947,
+16755,16779,16724,17162,18234,17539,17813,20801,
+23075,24999,25863,25487,24776,25141,25890,32564,
+32650,33606,33429,33154,32895,32903,32997,33167,
+33208,33366,33382,33310,33274,33286,33261,33261,
+33240,33294,33299,33387,33397,33609,33993,34797,
+36505,37200,36474,34725,32995,27339,18258,18471,
+18717,18440,18606,18635,19077,18713,20085,19635,
+19018,19106,19061,19252,19125,18093,18024,18627,
+21033,25497,24549,23847,24142,24950,28033,28848,
+29148,30052,30174,29994,29160,27873,25020,25157,
+25134,25536,25909,27039,27625,27060,28077,28328,
+28495,30531,32233,34286,33369,32696,32532,32134,
+28715,26490,25365,27613,25425,26475,25290,25105,
+23187,17181,12268,12646,14808,16065,16542,16410,
+16500,15981,16199,16159,16148,16541,16161,16508,
+16635,20280,17021,20555,18517,17458,17928,17934,
+18117,17736,17213,18798,17571,16909,16617,17857,
+19034,17189,16925,16719,17966,16894,16260,16912,
+17736,17348,17616,17183,17027,16988,16868,16638,
+16546,16548,16620,16033,16557,16729,16668,16587,
+16411,16743,16980,17928,17157,17535,18502,17343,
+16583,16977,17344,17730,17362,17876,17957,17992,
+17964,18419,18523,17721,19850,19444,17876,18584,
+19126,18180,18246,20112,19101,19161,18685,19147,
+19136,18738,19906,19289,19548,20625,20805,20133,
+20378,20970,21672,21438,21588,21306,21114,21384,
+20994,22052,21757,21508,21052,23102,20430,20022,
+20824,20232,20492,20292,20119,20739,21269,21813,
+21741,21891,21866,21246,21213,25251,21786,23938,
+22449,22590,23328,22950,23126,23752,23607,23349,
+24839,25603,24291,24689,23438,23442,22808,22478,
+22682,23303,21489,21519,21780,23400,23641,23031,
+23316,23982,23468,23600,23399,22726,23600,22657,
+22102,21549,22053,21960,22043,23429,22886,23442,
+22797,22804,22940,22996,23154,22962,21945,22398,
+21986,21985,21988,22155,20663,21429,21306,21023,
+20688,21101,22201,20918,21061,21248,21171,20962,
+21305,21745,21840,21790,21798,21464,21297,21531,
+21362,20925,20977,20889,20827,20856,20826,20862,
+20622,20428,20196,19053,17679,26886,31658,33914,
+33788,34062,40604,42355,38565,37032,37254,35325,
+34272,34180,34125,34109,34046,33891,33639,33450,
+33354,33298,33291,33251,33232,33226,33192,33165,
+33123,33077,33074,33039,33038,32970,32976,32974,
+32964,32928,32913,32931,32913,32848,32474,29894,
+27162,25014,23364,21909,21153,19792,19628,19110,
+18777,18553,18505,18424,18650,18500,18447,18418,
+18360,18351,18396,18483,18551,18594,18664,18901,
+18449,18389,18393,18468,18687,18992,19213,19155,
+18897,19244,19803,19920,21092,19073,20048,20168,
+20049,20808,20857,21057,19218,18795,19725,22045,
+20227,21325,20698,21368,20820,21243,21664,20939,
+21637,21181,21528,21975,21817,22114,22010,21867,
+22179,22979,23706,21965,23148,23635,24277,23141,
+22782,21393,21715,22382,23238,22577,21831,24676,
+21761,21411,20481,20868,21328,20826,21090,20945,
+22565,24072,20527,21398,22078,25962,23643,20661,
+20313,21237,20541,20870,19422,18972,19515,19191,
+18303,18664,17615,18153,18280,18207,17796,17382,
+17245,17241,17307,17245,17109,17358,17745,17764,
+17663,18118,18017,17886,17820,17840,17827,18159,
+18357,18207,18944,19143,18990,18779,19029,18984,
+20130,21927,23988,24056,25392,31713,32450,32513,
+32631,32768,32675,31850,30540,31598,29910,28424,
+27259,25170,20324,20564,20253,20134,19969,19722,
+19709,19767,19607,19743,19560,19338,19563,20196,
+20682,23393,22998,21923,21893,23105,22449,21557,
+17055,16766,16762,17076,17093,17149,16843,17232,
+16972,17362,17503,18895,19017,20084,22080,23928,
+25330,23682,24248,24307,24477,23631,22295,21706,
+20451,19781,20136,21795,21886,21646,20511,18720,
+20172,21825,27573,26911,25242,21558,24258,23671,
+18846,19439,17743,19141,19550,18814,18281,17625,
+17996,18422,18113,19695,19229,19315,19481,20094,
+19320,19792,19395,19517,19804,19754,19510,19896,
+18489,20937,19280,19735,19938,20379,19845,19905,
+20731,20924,19360,20865,21723,21651,20745,21568,
+22596,23112,23831,24295,25590,23249,24012,23996,
+23859,26230,25189,23515,20673,21670,21814,21705,
+21120,20818,21077,21130,21523,21323,21437,21013,
+20928,20586,20706,20369,20925,20244,21053,21025,
+21141,20588,20415,20247,20132,19565,19571,19450,
+19332,19189,19169,19254,19117,19321,19411,20028,
+19681,19123,19464,19515,19179,20435,16052,17418,
+18947,18052,16571,17830,17723,17642,17010,17166,
+16326,17431,17016,17716,17708,18450,18611,18693,
+18501,18267,17091,18378,19534,26090,25812,27965,
+32665,32619,32937,32622,32814,30384,22533,22549,
+20229,19755,19739,20090,20014,19659,19567,19468,
+19270,19228,18597,18507,18024,17672,17463,18281,
+18348,18423,18495,18704,19629,21376,25377,27734,
+28199,28667,29321,29283,29057,31978,32627,32757,
+32819,32859,32958,32913,32892,33765,33043,33061,
+33314,33303,33188,33209,33237,33159,33247,33186,
+33214,33254,33300,33328,33357,33539,33792,33952,
+34038,35683,35220,34902,34165,32669,25845,18717,
+18531,18682,18435,18402,18028,19041,18708,19052,
+20900,18768,19129,18699,18864,18459,18803,20367,
+23920,23976,24584,24976,27205,27944,28674,28969,
+29672,29662,29868,29641,26840,24663,24788,25117,
+25386,25707,29109,30561,28287,26931,27416,28111,
+29252,32376,33158,33864,33043,32417,30728,30297,
+27165,25639,27744,24230,24903,23631,26387,24501,
+22938,19971,13302,11399,14385,16181,17310,16609,
+16824,15684,16074,16048,16215,16201,15594,17363,
+16614,15689,20520,18307,16660,17403,17331,17534,
+17463,16971,17281,17524,17655,17630,16911,18385,
+17088,16895,16575,16570,17386,17237,16900,17658,
+17991,17530,17700,17719,17155,16833,16958,16697,
+16884,16782,16787,16649,16754,16792,16538,16818,
+17039,17150,17253,17889,17400,17511,17289,16942,
+18254,18507,17771,18721,17991,17739,17465,17526,
+17385,18789,18944,17814,18069,19047,18132,18261,
+18587,18312,18943,18596,18468,18261,18450,19071,
+20859,19494,19984,18708,20065,19959,25592,22851,
+24069,24783,21880,22902,22738,23387,24151,24111,
+22055,21813,22775,20053,23970,20200,19812,20428,
+20079,20687,21282,20761,20826,21246,22566,20633,
+20935,23068,22859,22240,21287,21801,22659,22203,
+22330,22049,22637,22779,22753,22855,23649,24360,
+23084,24485,25189,23513,23143,23424,22406,23945,
+22558,23680,23310,23430,23173,22624,22373,22962,
+23403,23197,21426,22883,23086,23308,22919,22259,
+21860,22367,22124,22167,22695,23340,23319,22524,
+22389,23244,22671,23484,23327,22306,21921,21726,
+22229,21932,22007,22019,21201,21604,20910,20794,
+21350,21444,21751,21058,20850,20995,21066,21180,
+21435,21388,21444,21590,22059,21676,21557,21435,
+21003,21146,20889,20785,20709,21078,21033,21038,
+20883,20609,20985,20473,18536,24082,29329,32564,
+33442,33907,35683,43562,41751,37929,37088,34840,
+34497,34314,34154,34374,34158,33921,33651,33468,
+33397,33360,33318,33225,33239,33218,33210,33189,
+33144,33106,33060,33046,32964,32934,32964,33162,
+33036,33195,33095,32900,32834,32871,32834,32714,
+29276,26313,24393,22581,21868,21290,20267,19557,
+18956,18790,18769,18900,18627,18571,18534,18628,
+18605,18686,18756,18813,18866,18822,18862,18701,
+18513,18421,18400,18630,18764,18974,19107,18647,
+19140,19776,19634,20338,19620,19370,20066,19858,
+19250,22774,23880,25289,23718,22140,19442,20547,
+19344,20072,22124,22390,20533,20897,20920,21456,
+22222,22314,22189,21856,22381,21773,22317,22530,
+21638,22637,21495,21377,23367,22043,23256,24436,
+23529,23584,23580,23119,22582,22926,22339,22180,
+21600,20335,20776,21400,21609,21216,21249,19931,
+20389,20121,20131,20632,21506,25042,25990,28314,
+23858,20141,21045,21501,18960,20447,19731,19622,
+18648,18435,18201,18004,18451,18370,18079,17928,
+17512,17546,17424,17494,17397,17047,17373,17580,
+17760,17513,17892,17795,17913,17955,18119,18348,
+17987,18966,18849,19123,19143,19597,19169,19433,
+20733,22676,24944,27442,30999,32466,32708,33009,
+32947,32775,32789,32744,32658,32588,32619,32540,
+32436,31568,29166,26112,24664,21611,20763,20667,
+20331,20208,20011,19956,20153,20635,20190,21041,
+23489,25502,25134,24572,25144,24639,23754,23279,
+18848,17314,17188,17136,17021,17214,17184,17464,
+17666,17408,17540,18105,19056,20766,23721,27903,
+26764,26678,27368,25845,24947,25363,20718,21374,
+21767,21089,21447,20054,21480,21677,19863,20059,
+19993,19676,22950,25582,19424,22248,26319,22793,
+20346,22217,20371,20774,20589,19227,18258,17487,
+17801,18300,18414,17883,18575,19044,19190,20004,
+19129,19309,18813,19272,19378,19408,19498,19331,
+19543,19710,19854,19866,20317,19986,20367,20067,
+19952,20652,21276,20293,20901,20895,21774,21693,
+22713,24042,23205,24324,24108,25059,24152,23779,
+23223,23798,25773,23820,23292,22213,22635,21464,
+21611,21072,20915,21521,22320,22221,22089,20979,
+20734,20949,20775,19878,21192,21071,20780,20541,
+19386,19986,19783,19441,19908,19870,19752,19556,
+19398,19173,19200,19432,19300,19442,19940,19995,
+20145,20310,20261,20556,20028,16011,18110,17734,
+16378,16476,16624,16209,16689,17060,17133,16898,
+17338,18342,16743,19243,25058,26439,25561,25821,
+25424,24017,23331,24035,28748,31576,32625,32967,
+33217,33438,33511,33388,33306,32951,32910,27270,
+26899,25077,24545,23907,27148,26523,25815,26316,
+21554,20556,20295,19625,19302,18987,19474,20004,
+20014,20358,20258,21703,26080,27444,28305,28934,
+29653,30077,31138,32604,32691,32812,32887,33114,
+32937,32893,32965,33142,32942,33870,33343,33180,
+33225,33163,33180,33159,33153,33216,33178,33192,
+33231,33258,33300,33356,33404,33471,33772,33900,
+34141,34739,34801,35136,33910,33084,31220,19643,
+18736,18384,18363,18393,18548,18552,19027,19155,
+19294,19150,19152,19439,19962,18588,17676,20467,
+23673,25391,25206,25278,28207,29346,29221,29591,
+29381,29823,28752,26649,24443,24230,24792,26627,
+28878,28056,29814,28250,25945,27487,28168,29192,
+32033,32840,32898,32452,31348,29252,28440,27469,
+26908,26988,25962,28359,24979,26584,25200,23456,
+23510,21321,16131,10167,14107,15663,15801,16530,
+15856,15788,15975,15677,15771,15677,15723,15535,
+15735,15978,18111,15879,16414,16620,17206,17447,
+17869,17083,16708,17340,17578,17354,16505,16905,
+16686,16957,16838,16848,17013,17296,17313,17592,
+17410,16187,17127,17706,17264,16999,17078,16823,
+17121,17123,17282,17273,17306,17173,17040,16996,
+17165,17341,16679,17443,17618,16807,16554,16829,
+16320,16749,16951,17778,17685,17942,17256,17355,
+16724,17868,18083,17066,18253,18170,18560,18878,
+18867,17988,18619,18270,18510,18256,18948,19278,
+19178,19311,19326,20336,19185,19996,21741,22005,
+20438,21451,23372,26840,25293,26938,20475,21427,
+22056,21831,21665,20921,23812,21654,21996,20946,
+20991,20187,26561,24066,25303,20900,21723,21285,
+21576,21499,21738,21450,22209,21771,22614,21742,
+22306,22536,22813,22569,22917,23653,24699,25846,
+24819,23849,23528,23856,24002,23769,23697,23553,
+23174,23038,23174,23174,23858,23173,23274,22836,
+22443,22614,22270,22575,22781,22798,22162,21903,
+22312,22308,22500,22114,23523,22574,22177,22035,
+22172,22630,22485,22728,21534,22494,21287,21759,
+22100,22246,22739,21451,21839,21325,20905,21406,
+21925,21432,21480,21440,20836,21201,21263,21193,
+20942,21494,21478,22136,22139,22031,21718,21846,
+21009,21606,21085,21090,20550,20582,20645,21000,
+20787,21168,20952,20981,19813,17344,25269,31509,
+33753,34998,34957,41355,43372,38190,36672,35071,
+34479,34303,34202,34707,34367,34055,33803,33592,
+33432,33375,33330,33288,33225,33231,33168,33086,
+33141,33108,33015,32883,33176,33105,33114,33169,
+33216,33412,33474,33429,32939,32929,32797,32808,
+32223,28868,26089,25019,24212,23071,22404,21470,
+20505,19942,19224,19121,18942,19020,19083,18879,
+19169,19221,19266,19161,19044,19082,19135,18708,
+18550,18183,18578,19184,19223,19512,18827,19512,
+20442,19476,19320,19389,18763,18396,20926,20828,
+22341,23453,25062,19004,22417,21490,21416,21122,
+20230,20778,20666,21117,21080,21447,21321,21153,
+20991,21593,21783,21639,22472,22243,21826,21795,
+21398,21246,21957,23206,23279,22532,23060,23457,
+23384,21651,24831,24916,24851,23475,22169,21813,
+22412,20457,21324,21030,20184,20252,20833,20439,
+19401,20391,20043,20887,21427,21920,21734,22738,
+24469,21005,20599,20421,22296,21450,20493,19641,
+19445,19309,18851,18237,18367,18347,18072,17915,
+17469,17316,17218,17291,17188,17304,17532,17511,
+18711,18436,18125,18035,17979,18077,18284,18387,
+18723,18876,19253,19488,19533,19676,19827,20138,
+21027,22780,25074,31823,32469,32778,33397,33807,
+33726,33366,33327,33154,32818,32656,32644,32471,
+32688,32673,32622,32645,32649,29249,24480,22181,
+21528,21285,20844,20783,20638,20546,20694,21187,
+23715,25666,27563,26837,25045,25303,24954,24093,
+20151,17361,17337,17274,17455,17173,17223,17472,
+17861,18000,18148,17424,19557,19921,23565,25347,
+29235,28994,28993,28221,26678,24963,23445,21066,
+21255,20643,20313,20119,21120,21752,20456,18518,
+19505,18832,21108,22446,21539,23806,25519,22598,
+26076,23280,20448,22229,21744,20328,16930,18060,
+17492,18047,18543,18394,18682,18933,19437,19067,
+19395,19494,19059,19256,18977,19019,18933,19076,
+19366,19400,19953,20983,19269,19620,19962,20182,
+20549,20200,20367,19718,20694,21719,21348,22685,
+22435,22088,24173,24858,24854,24529,25007,23688,
+22433,22897,24053,24932,25962,23840,22444,22442,
+21302,21636,21409,21859,23128,23355,23648,22292,
+21320,20894,20979,20873,20354,20469,20741,21063,
+20112,19950,19698,19775,19881,19690,19474,19835,
+19645,19670,19662,19541,19468,18988,19812,19656,
+19349,19407,20683,14226,18525,17468,21522,17841,
+16692,16182,15794,16230,16665,17290,17028,17133,
+17525,17394,18114,23106,26202,26760,26898,26271,
+25236,25042,24113,26795,29979,32618,33029,33320,
+33629,33692,33735,33743,33619,33372,33192,32739,
+32848,32824,32535,32977,32943,32913,32775,32764,
+32691,29799,28602,22442,22517,21996,22068,21664,
+22440,22508,23175,26411,28275,29171,29232,29256,
+30552,32349,32678,32685,32654,32741,32924,33303,
+32967,32917,32931,33555,33043,33641,33647,33123,
+33150,33117,33168,33159,33163,33229,33184,33202,
+33232,33259,33301,33332,33444,33624,33855,33754,
+34339,34356,35421,35662,34698,33847,32588,27487,
+18438,18671,18605,18485,18398,18311,18770,18705,
+18837,18751,19150,19083,19008,19052,18372,23058,
+26227,26341,25589,27001,28876,30413,29754,29444,
+29709,28530,24827,24140,24071,24372,28155,29011,
+30028,28627,26882,27117,27579,27591,27860,31692,
+32432,32743,30148,27656,27962,27078,26899,26943,
+24474,24285,24088,26019,24726,23122,25241,29932,
+27370,23622,16908,11792,10295,14577,16499,15476,
+16694,16070,15875,15847,16028,15634,17645,16041,
+16701,20244,16338,16269,16584,17026,16979,17089,
+17059,17103,17206,17358,13803,17418,16350,17508,
+16736,16504,16506,16945,16728,17066,17692,18121,
+17072,17739,17591,17229,17252,16719,17023,16934,
+17073,17269,17355,17292,17165,17352,17271,17383,
+17430,17182,17091,16977,17277,17205,18435,17958,
+17382,17573,17579,17721,18120,17755,17398,17513,
+16999,21117,18421,17769,17883,19254,18183,18804,
+18957,18269,18492,18817,18733,19052,19866,19386,
+18760,19147,19604,19152,20115,19965,20236,21740,
+21197,22659,23028,21301,20727,23027,23352,20748,
+21025,20637,20965,22632,22083,20791,27585,19688,
+20826,21109,21530,22134,25425,20990,22997,22754,
+22688,22314,21750,22032,22164,22309,22019,23076,
+23091,22317,23090,23854,24265,24834,24825,24434,
+23789,23997,23371,23608,23289,24180,23998,23428,
+23105,24137,23462,23363,22840,23871,23670,22101,
+22947,22872,22550,22641,22933,22017,22266,22325,
+21863,22041,21870,22026,22333,22286,22836,21965,
+21659,21764,21696,22101,21861,22131,21402,21962,
+21561,21982,22316,22182,21856,21820,21633,21315,
+21425,21390,21442,23109,20841,20929,21289,21260,
+21222,21280,21283,21862,23635,21973,32799,24397,
+26625,24463,30698,21796,22864,21985,20882,20210,
+20584,20356,21263,21360,20852,17682,19613,28951,
+32972,33644,34248,38630,44304,36491,36752,35128,
+34566,34375,34233,34993,34670,34332,34014,33678,
+33527,33399,33332,33318,33300,33287,33210,33126,
+33089,33012,33012,33123,33288,33356,33405,33377,
+33525,33433,33179,33253,33035,32967,32883,32772,
+32811,32135,29718,28397,25768,24494,23290,22708,
+21804,21153,20855,20690,20595,20335,20286,20142,
+20063,19944,19743,19540,19310,19099,19484,19131,
+19302,18984,19728,19715,19578,19093,19227,19557,
+19751,19831,19932,19616,19689,19830,21258,24813,
+23145,17313,24021,26424,24731,23646,21469,21020,
+19665,19393,18773,19435,19784,19800,19743,20606,
+20499,20589,20650,21434,21529,21468,21354,22923,
+23014,22097,22240,22140,22810,23055,23132,21800,
+21153,23031,25193,25942,23297,22193,20915,21869,
+22043,21331,21579,21659,20669,20362,20618,19993,
+20106,21356,20292,19511,20487,21004,21444,21190,
+25614,28581,22109,22282,26674,27928,21233,19875,
+19574,19888,18720,20092,18703,18360,18124,17995,
+17486,17415,17343,17398,17516,17199,17445,17296,
+17692,17795,17871,17886,18207,18214,18207,18650,
+18972,19305,19510,19923,20046,20309,20862,21550,
+23513,26355,29289,32310,32716,33395,36148,33882,
+34686,35721,33868,33819,34495,35058,35711,35370,
+34971,33339,34025,33021,32943,32848,32254,26673,
+22881,21714,21564,21510,21378,21206,21202,21372,
+21671,24225,26041,26076,25722,27309,27675,26281,
+25206,18448,17457,17579,17627,17511,17403,17513,
+18037,17800,17868,18276,19636,21930,25164,27189,
+29617,30157,29658,28077,26076,25078,23121,21381,
+21003,20817,20517,20288,20004,20364,20527,19461,
+19585,20219,20322,19029,20507,23115,26334,22200,
+22384,22812,23799,22829,17691,19848,18615,20312,
+18403,17826,17442,18310,18166,18198,19279,18736,
+18997,18126,19673,18745,18944,19068,19122,18846,
+19263,19518,19718,19787,20238,19299,18880,20514,
+20666,20718,20531,20418,20460,21137,21592,21990,
+22572,22862,22277,24675,24654,25428,24300,23315,
+22693,22553,22287,23108,23934,23307,23418,21526,
+21657,21342,21695,22332,23414,24483,25517,22891,
+22527,22394,22135,21489,20727,20705,20202,19623,
+20172,20009,19776,19744,19372,19623,19614,19826,
+19868,20147,20823,19922,20044,19060,19689,19596,
+19332,19454,16536,21318,22749,20865,17427,16999,
+15422,15766,17201,17445,16390,16853,17361,17589,
+17116,16720,18779,23975,25253,25494,26189,25536,
+24696,23970,22970,26438,29595,32730,33150,33492,
+33821,33820,33894,33934,34004,33858,33843,33666,
+33177,33149,33089,33208,33281,33240,33312,32991,
+32913,32529,32877,31212,30620,29825,29839,29140,
+27921,25143,29356,29685,29343,30014,30681,31143,
+32512,32583,32814,32769,32831,32857,33094,33207,
+33297,33197,32943,32982,33311,34266,33522,33167,
+33145,33180,33147,33153,33141,33291,33279,33215,
+33226,33284,33313,33379,33982,33807,33727,33741,
+34119,34252,35646,36249,35305,33108,33209,32489,
+25016,18468,18894,18666,19245,18384,18387,18342,
+18394,18587,18579,19607,19833,20094,19782,24485,
+27596,26139,27917,28118,29985,30544,30280,30018,
+28276,24992,23862,23858,24478,25167,30708,28190,
+26250,27136,26643,26877,27489,27106,30266,29571,
+29555,29555,26767,26654,27007,26706,24661,24033,
+26133,24316,23921,23666,28710,25009,26349,25376,
+26901,25548,19554,14015,7971,13394,15150,15351,
+17276,16484,15941,16362,15735,16014,15965,16215,
+16824,19686,17038,16305,16419,16861,16546,16184,
+16430,16695,17614,16229,16711,17170,16416,16782,
+16331,16189,16422,16915,17235,17541,17230,17700,
+16854,17163,16874,17576,16086,16023,17025,17091,
+17103,17244,17394,17302,17136,17328,17387,17630,
+17623,17310,17217,17244,17568,16959,17808,18561,
+18717,18336,17874,18087,18238,18834,17681,18365,
+17089,17550,17161,18039,17769,17712,17853,18639,
+18558,18945,18840,18925,19400,18839,19176,19430,
+19137,19285,19761,19633,19646,19493,20244,20297,
+20943,21177,21298,20841,21851,22856,21633,21582,
+21058,21246,21766,22511,21378,19119,22640,22228,
+19484,23531,21605,22392,23160,21589,23655,21477,
+22288,21567,21885,22359,23229,23300,22589,24747,
+24246,24320,24335,24627,24247,24605,24861,24900,
+25190,24354,23679,25589,24484,25454,24181,23429,
+23863,23154,23297,23080,23133,23295,24246,23818,
+23451,23146,22650,22707,22662,23773,22320,22194,
+21888,21411,21744,23820,22149,21918,22591,22783,
+22005,21894,21563,21771,22284,21741,21965,21581,
+21755,21225,22078,22241,22383,22044,21840,21980,
+21629,22006,22039,21857,21287,21797,21619,21300,
+21464,21497,21609,21098,21097,21462,21381,20710,
+21147,20779,21778,20856,20666,24031,23539,20304,
+19664,20234,20467,20874,21678,21080,17115,25138,
+32516,35195,34486,45825,44469,37500,35412,34831,
+34642,34408,34669,35623,35365,35541,34727,33995,
+33645,33379,33326,33332,33284,33201,33156,33016,
+33016,33015,33125,33069,33202,33190,33170,33321,
+33399,33626,33271,33093,33017,33039,32976,32937,
+32813,32629,32549,30896,29578,26304,24059,23358,
+22625,22034,21655,21345,21078,20861,20529,20341,
+20076,19863,19682,19474,19240,19346,18908,18608,
+18974,19090,20151,19428,19252,19315,19314,19807,
+20535,20840,21777,20276,20295,20564,21454,21188,
+23124,23950,24490,24077,24420,23724,22438,21191,
+20202,19259,18528,19137,19411,18902,20017,19950,
+19404,19350,19972,20022,20399,19797,20853,21436,
+21781,21772,22022,22379,22286,22442,22144,23227,
+23214,23328,23911,22956,22475,21423,22203,22515,
+22394,21814,21768,20795,20511,20745,20579,20984,
+21176,20644,20286,20321,21392,20532,27178,25429,
+22256,21126,27772,29060,26494,21532,24840,26181,
+19473,19338,18857,19161,29164,18771,18526,17981,
+18326,18072,17835,17284,17597,17653,17101,17671,
+17604,17707,18090,18134,17907,18276,18547,18900,
+18985,20026,20466,20261,20760,21330,21949,22887,
+24974,29508,31596,32407,33455,33545,35533,35880,
+36087,35624,36164,34384,36558,35649,35691,35235,
+34881,34728,34201,35145,34743,34437,33406,32680,
+28754,24223,22994,22233,21777,21421,21537,21730,
+21747,22050,24316,25948,26919,28900,28590,27531,
+25211,18737,17922,17518,17916,17508,17557,17640,
+17943,18527,17688,18333,20052,20871,26615,30732,
+30851,30158,29505,28196,25779,24295,22962,21945,
+21474,20766,20727,20805,20236,20016,20087,19125,
+18976,19215,19973,18577,20272,23752,22812,21228,
+26955,24420,26592,20371,17458,20100,20905,19059,
+16943,18903,17544,18787,19849,18513,19604,19220,
+18399,17801,18736,19160,19322,19031,19212,18960,
+19248,19439,19434,19356,19322,20154,20677,19404,
+21444,20640,20707,20635,21442,21369,22776,22818,
+23376,24015,24313,25666,23551,23558,23862,23180,
+23289,22396,22579,22229,22373,21379,21507,21675,
+22568,22661,22374,22587,23887,24889,24967,24227,
+22986,22192,21828,21180,21060,20624,19898,19940,
+19588,20006,20013,19716,19563,19236,19728,19926,
+20001,19670,20160,20226,20777,19692,19215,19151,
+18751,17183,17377,18426,18447,18627,18006,17475,
+15918,19476,16680,16530,15429,17101,17530,16664,
+16745,16872,19011,23275,26508,26224,22652,20656,
+22834,21582,22286,26232,30056,32653,32909,33020,
+33721,33832,33957,33969,33996,33934,33996,33966,
+34088,33834,33577,33595,33564,33677,33394,33420,
+32907,32864,32925,32976,32391,32089,32495,32517,
+32406,32585,32847,32574,32427,32459,32689,32642,
+32679,32732,32781,32942,32835,33035,33194,33274,
+33626,33830,33335,32888,33780,34821,33774,33333,
+33291,33239,33127,33134,33216,33199,33213,33229,
+33273,33295,33330,33420,33484,33642,33639,33689,
+34211,34435,35406,35901,35648,33735,33555,32775,
+32101,22667,18327,18386,18309,18454,18632,18605,
+32288,18665,19643,23307,24185,24922,21048,25245,
+28454,28983,28779,28389,30370,30595,30387,29735,
+25023,23868,23776,23814,24544,29013,29635,28600,
+27344,26844,26504,29659,28471,27415,25947,24688,
+27853,27125,26852,27048,23154,21960,22944,22065,
+24782,23530,22502,23968,24915,23685,24621,24882,
+24340,31077,22858,16443,9605,11862,14749,15750,
+15855,16015,15908,16463,16244,15414,15290,16008,
+19092,17116,16200,16887,16561,17010,16659,16243,
+16395,16696,17941,17869,16808,15036,16002,16539,
+16677,16511,16797,16593,16938,17507,17114,16635,
+16730,17753,16982,16050,16167,16680,16993,16523,
+16764,17122,17342,16948,17276,17460,17570,17595,
+17747,17688,17529,17415,18129,17791,17949,18946,
+18657,18371,18886,17966,17436,18908,17891,17101,
+16804,17044,18051,17306,17587,18414,18661,18465,
+19195,18421,18776,18963,19493,19488,19324,19311,
+19652,19925,19875,19931,20386,20402,20515,20257,
+20530,20423,27620,25215,22581,22485,21374,20531,
+21541,25506,21948,20922,20035,19743,22566,22864,
+21700,22040,21161,22686,22150,24376,21177,22657,
+22138,22978,22421,22831,22674,23388,23066,23739,
+24006,24284,24488,23958,23987,24935,24798,24645,
+24486,24990,26139,25365,23527,25332,24203,24200,
+23763,23493,23530,23202,23140,22530,23094,23028,
+22385,22367,22458,22335,22308,21884,22509,21738,
+21785,21834,21783,21790,21249,21913,21627,22273,
+21656,21183,21489,21717,22109,22961,22172,22503,
+21906,22085,21371,21651,22527,22695,22429,21882,
+21800,22006,21606,21469,21561,21466,21242,21636,
+22115,21837,21492,21379,21093,21428,21418,20761,
+20985,20659,20409,20496,20205,20247,20562,19746,
+20399,19631,21272,20286,24374,20652,16084,24987,
+29314,33938,35148,43404,45040,40904,35178,34802,
+34563,34361,34938,36721,36611,35325,35404,34410,
+33751,33495,33363,33317,33282,33164,33013,33057,
+33155,33113,33099,33032,33149,33187,33186,33174,
+33114,33474,33774,33374,33070,33006,33006,32952,
+32965,32809,32753,31071,28932,27048,24299,23523,
+22800,22066,21672,21138,20808,20684,20410,20334,
+20249,20233,20076,20017,19777,19365,19550,18622,
+18954,19878,19562,20194,19497,19122,20460,22501,
+22953,22631,21755,20971,21107,20844,20776,20879,
+20709,21428,21893,22161,23307,24034,23169,21403,
+21751,20687,21293,19844,20271,19986,20669,20502,
+19989,20460,21514,21168,20620,21133,21053,21481,
+21852,22229,22596,21855,22194,21711,21992,22689,
+22812,22776,25919,25734,24579,23000,22731,21954,
+22781,22490,21275,20195,20641,21864,21615,21421,
+21775,20927,20563,20453,21116,21218,20780,20030,
+20346,20300,25121,20848,20607,20731,27376,29181,
+19437,19571,19479,29108,24482,20803,18661,17745,
+18685,17776,17581,17504,17085,17429,17826,17852,
+18034,17770,17959,17939,17970,18756,18655,19431,
+20026,20955,21570,21777,21330,22604,23109,24834,
+26545,31566,32111,32538,33142,34825,35540,34420,
+35937,36421,35466,34999,35150,35594,35445,35665,
+35451,35379,35016,34828,34826,34968,35190,34175,
+33048,30770,24730,22965,21992,21910,21913,21964,
+22055,22323,22719,24426,28395,28531,28904,27576,
+26068,18982,17922,17822,17862,17900,17967,17535,
+17651,18106,17808,19295,20427,20473,27445,30294,
+30137,29717,29251,27342,25473,24050,23013,22815,
+21804,21385,20988,20577,20550,20235,19933,18742,
+19835,18090,19505,18507,21329,22017,20999,19292,
+24071,22139,25924,21401,18065,19316,21840,18648,
+19023,18058,19758,19170,18836,19782,19217,19188,
+17161,18525,17958,18864,18169,18933,19193,19234,
+19366,19624,19239,19794,20108,19992,19866,21143,
+19829,21768,20466,20550,20980,22493,22275,22598,
+22543,24015,24246,24810,23516,24047,22230,22955,
+22665,22091,23002,22740,22059,23081,23730,21928,
+23877,21693,21809,23045,23658,24264,25516,25386,
+24381,22222,21968,21245,20799,20541,20342,20410,
+19521,20164,20300,20218,19272,19188,19882,20529,
+19624,20935,17616,17916,21648,18680,20595,18084,
+20921,22115,21660,19459,16840,18454,17771,16752,
+17233,16710,16519,17989,17139,17748,16870,16698,
+16766,16926,17018,18834,22131,19343,19032,18837,
+19495,19738,20996,23589,28491,31980,32883,33040,
+33916,33793,34017,33919,33901,33939,34178,34114,
+34035,33872,33828,33756,33946,33737,33532,33443,
+33395,33283,32903,32823,32868,32844,32883,32849,
+32852,32820,32799,32712,32783,32769,32772,32760,
+32756,32856,32810,32907,32997,33297,33345,33522,
+33630,33596,33292,33083,33927,34635,34200,33825,
+33657,33371,33264,33185,33162,33196,33242,33309,
+33275,33292,33429,33618,33756,33633,33843,33911,
+33990,34532,34712,34992,35280,33968,33610,33031,
+32853,31879,21360,18496,18517,18768,18536,17729,
+21411,18871,23724,24018,21937,20089,20217,25380,
+27674,28884,28907,28571,29965,30424,30223,27783,
+24059,23700,23482,23760,25367,31065,29075,30420,
+27423,27354,27498,23866,22057,21182,23274,25316,
+26434,27442,26976,25692,22785,21917,21627,21765,
+21441,21864,22812,23066,25811,27279,23643,25230,
+25542,24366,25643,19075,14574,9737,14095,15437,
+16489,16347,16040,15804,15822,15103,14972,17099,
+22116,15920,15708,16470,16035,16398,16764,16273,
+16168,17196,16786,17891,16701,17847,16365,16371,
+15567,16860,17343,17614,16575,17104,16620,16469,
+16818,16404,16563,15987,17057,16890,17186,16421,
+17086,17367,17301,17271,17139,17451,17626,17154,
+17753,17789,17445,17593,17490,18338,18324,18657,
+22407,18755,18678,18111,18192,18220,17892,17742,
+16413,17338,18357,18540,16962,17943,18802,18587,
+18734,19251,19416,19489,19847,20201,19213,19542,
+19695,21306,20019,19833,20890,21155,19881,19668,
+20357,21240,22485,23040,22197,22084,21291,21033,
+20368,20596,22120,21384,23951,22747,22099,23207,
+22887,23745,23046,23465,22327,22925,22356,23057,
+23601,22692,22792,22713,22847,22839,22436,22641,
+23301,23817,23400,23698,23948,24589,24701,25216,
+24645,26010,25516,23548,24935,26635,24116,23448,
+23509,23065,23082,22899,22475,22594,22629,22407,
+21983,22009,22620,22072,22036,22276,21898,21497,
+21526,21458,21339,21021,21381,21621,21666,21930,
+21552,21285,21947,21448,23038,22482,21009,23129,
+22675,21996,22671,22357,22428,22440,22476,22335,
+21908,21897,21120,21537,21564,20968,21452,21401,
+21682,21513,21475,21250,21173,21033,21228,21385,
+21325,21016,20629,20748,20730,20975,20944,21090,
+20287,20295,21147,20910,21168,21538,16402,21959,
+30246,34161,39273,44817,44180,40174,35057,34603,
+34370,35094,34224,34687,35104,34755,35933,34388,
+33906,33584,33384,33296,33306,33112,33021,33264,
+33141,33162,33139,33031,33156,33193,33288,33559,
+33313,33200,33338,33384,33312,33291,33006,32965,
+32894,32829,32771,32233,28167,26374,24621,23859,
+23156,22461,21813,21504,21047,20914,20934,21105,
+21597,21293,20991,21258,21318,20736,20265,20114,
+19434,20217,20298,20603,19525,20100,21912,24133,
+24481,23640,23070,22398,22473,22308,20502,22122,
+21278,20672,21068,20967,22299,23187,21747,20145,
+20205,20001,20400,19573,20811,20315,19489,20095,
+20053,20322,20763,20298,20507,20505,20802,21019,
+20793,21783,21153,21390,21754,22049,22335,22239,
+23367,24385,23814,22271,21784,25507,24199,22901,
+21639,22140,21951,21465,20925,20981,21735,20701,
+20442,20433,20166,20426,20099,21460,21014,20989,
+22953,21111,19737,20861,22211,20502,19940,28015,
+24867,19527,19920,20535,23398,18407,18386,19172,
+18539,17876,17907,17965,17610,18062,18153,18102,
+18275,19775,18057,18002,18151,18306,18906,19971,
+20507,21403,22405,22351,23117,23925,24444,27596,
+30524,31948,32298,32505,32724,34335,35171,34154,
+37808,37558,37317,36310,35571,35814,35985,36468,
+36109,37266,37666,35490,37710,36807,36168,34893,
+34862,33355,30186,24636,23230,22178,22200,22236,
+22407,22284,22437,23199,24435,27386,28234,26113,
+24831,19310,17877,18025,18045,18138,18111,17913,
+17928,19015,18737,20140,20899,21246,27451,28969,
+28938,28461,27879,27762,25328,23783,22816,22343,
+22321,22012,21864,21880,21898,20693,20727,19713,
+18938,18108,19180,20685,20772,19341,19617,20331,
+22734,21704,26121,25503,21073,23917,21114,19864,
+20589,19473,18336,18815,18813,18270,17694,19009,
+17993,19675,18263,19096,18687,18891,19554,18982,
+19287,19293,19399,19445,19308,19968,19915,20074,
+20895,20779,21422,21689,21630,22053,22612,23043,
+24006,24267,24805,24115,24192,23142,22843,21502,
+22381,21781,21386,22291,22667,21930,22410,22537,
+22083,25194,24144,24974,23064,24678,27051,27633,
+24894,22878,21918,21610,21025,20776,20528,19665,
+19574,19676,20352,19449,19721,19863,20688,23323,
+24573,27174,29299,28384,28467,25829,25899,25891,
+29522,26358,26271,25659,19435,17906,16950,16554,
+16803,17118,16725,19148,18033,16346,18081,16584,
+16786,16956,17199,17398,18060,17766,17692,18202,
+18560,18464,18911,19511,22626,30791,32609,33037,
+33835,33705,33724,33945,33924,34141,34124,34217,
+34015,33921,34186,34070,34009,33958,33735,33520,
+33426,33420,33352,33244,32963,33060,32991,32934,
+32902,32874,32877,32849,32850,32826,32807,32811,
+32830,32835,32982,32926,33201,33303,33744,33492,
+33440,33342,33402,33075,33852,34533,33821,33945,
+33987,33686,33646,33348,33191,33189,33203,33237,
+33259,33377,33441,33721,33909,33931,33622,33638,
+33720,34115,34497,34410,33974,33585,34308,34291,
+33525,32857,25025,19302,18805,18917,18570,18681,
+18711,19014,23997,24431,21298,20698,23494,25632,
+28108,28710,28738,29745,30110,29620,29744,27326,
+23964,25448,23524,23715,28020,30862,30084,28675,
+30828,27087,22080,21415,25764,20832,22755,23489,
+26610,26922,26103,22667,22062,20952,20854,21497,
+21288,21316,21689,22284,23227,26407,27080,23481,
+23634,27245,29639,20859,17005,7770,14875,15873,
+16327,16722,17991,15936,15963,16363,15012,16587,
+16350,15807,15744,15625,16193,16982,16304,16836,
+16993,17451,18324,18118,16690,17427,19980,16834,
+17438,17013,18492,16920,16848,16623,16785,16770,
+17629,16709,15927,16655,17155,17239,16805,16601,
+17103,17268,17157,17286,17437,17613,17173,17676,
+17832,17823,17580,17682,18722,18584,18435,18243,
+18938,18179,18036,18122,17028,17537,17623,17671,
+17812,18149,18954,17811,17910,18150,18603,18740,
+19334,20112,19432,20220,20688,20097,19815,20006,
+20265,20712,20745,20269,19185,20221,21128,21285,
+21439,21402,21421,21163,20943,21642,20115,21170,
+21622,22360,22382,22442,22042,21888,21684,21819,
+21898,22176,22150,22009,22554,22974,22710,22893,
+22779,22211,23170,22919,22665,22600,22792,22893,
+23655,23172,23986,23760,24161,24560,24686,24785,
+25305,24627,23592,24123,24795,24051,23655,23698,
+23178,23269,22892,22470,22547,23292,22528,22174,
+22342,22492,22506,22468,23277,21912,21984,21805,
+21654,21229,22204,22303,22632,22301,21723,21595,
+21990,21939,22470,21065,22036,21648,22131,21852,
+23113,24111,24376,23547,22991,22190,21821,22024,
+22508,21469,21322,21330,21094,21418,21680,21492,
+21763,21135,21111,21012,21054,21049,21199,21532,
+21126,20938,20685,20451,21048,20793,20799,20151,
+20391,20517,21404,21081,20928,20910,17097,21424,
+29505,34972,39651,44439,40675,42173,36717,34746,
+34801,34803,34199,34397,33933,34993,38357,34238,
+33849,33607,33436,33315,33265,33088,33023,33093,
+33187,33114,33168,33126,33199,33291,33663,33751,
+33337,33393,33641,33509,33460,33844,33177,33015,
+32994,32961,32792,32640,29469,26385,24963,24181,
+23487,23256,22749,22277,21963,22093,22074,22061,
+21794,21819,21658,21636,21923,21839,21878,21526,
+20502,20190,20215,20800,20950,23703,23010,25297,
+26496,25841,25827,26091,23575,25066,24302,22297,
+21986,21346,20562,21218,22402,24000,21387,20310,
+19520,19048,18781,19143,20653,19941,20259,19728,
+19458,19968,19940,20182,19716,20287,20691,20925,
+20960,20609,21601,21562,21792,21831,22224,22066,
+23205,23365,24008,23713,25104,25290,24861,22896,
+22422,21754,22119,21634,21470,21978,21094,21450,
+20244,20467,20463,20547,21360,20411,20095,20556,
+21327,21996,20006,20133,21612,23099,23691,19755,
+18838,24446,19357,21337,30768,20366,18457,18750,
+18388,18022,17542,17640,17499,17775,17396,17988,
+21223,18237,18177,18317,18207,18186,19249,20022,
+21127,21386,22395,22870,23487,25662,27693,30091,
+31544,32014,32472,32661,33121,34286,35148,35306,
+36328,36358,36842,36825,37263,36939,37158,36797,
+37974,38584,36304,36966,37359,37278,36670,35707,
+34985,35240,33561,28317,24543,23565,23291,22740,
+22540,22582,22730,22895,24258,25423,26189,25902,
+25389,20834,17685,17832,18057,18080,17855,18089,
+17793,18260,18387,19607,20625,24002,26508,27354,
+27228,26888,27292,27018,25278,23080,22181,21853,
+21570,21018,20630,20408,19820,19260,19202,19017,
+18843,19168,18912,18846,20183,18526,17745,20396,
+20811,21491,21945,20700,20611,24688,20328,18592,
+20571,19420,20527,18006,17612,18882,18509,18841,
+19029,19347,19282,18651,19653,18041,19122,19346,
+19408,19923,20080,19893,19535,19471,20129,20941,
+19773,21546,20860,21759,22647,22044,22767,23493,
+22877,23802,24218,23967,23822,23720,22398,21731,
+21151,21519,21846,21234,21255,21901,21818,21361,
+20820,20175,23770,21754,22823,24042,27522,27775,
+26415,24063,22607,22003,20739,20721,20397,19604,
+19628,18912,20377,20638,22737,19410,30886,29199,
+27115,26228,25565,26611,27262,25905,25542,25665,
+25539,25633,25294,24058,19399,17154,17369,17260,
+16901,17221,16515,19041,16850,17674,17488,17145,
+17228,17478,17459,17212,17574,17808,17864,17876,
+17854,17786,17954,18786,20085,29489,32571,33036,
+33690,33599,33918,33798,33938,34218,34293,34235,
+34275,34129,34000,33862,34003,33918,33844,33546,
+33460,33477,33417,33360,33354,33335,33312,33267,
+33278,33005,32901,32884,32877,32853,32860,32878,
+33115,33112,33315,33335,33472,33428,33429,33456,
+33406,33330,33287,33147,33503,34605,33502,33387,
+33447,33366,33967,33699,33391,33525,33217,33414,
+33261,33546,33490,33621,33900,33698,33545,33588,
+33684,33959,34206,34758,34440,35135,35175,34455,
+33675,33009,31458,20029,19081,18709,18902,18750,
+18969,19532,22170,25311,20679,22449,32916,27610,
+28278,28685,29112,28872,29019,28887,28839,26351,
+24960,26556,23233,23954,26501,30264,29370,30325,
+27772,23007,21522,20560,20691,21022,22259,22740,
+28797,28179,27730,25880,21806,21148,21102,21610,
+21170,21015,21219,21355,22047,24088,25759,24425,
+24246,26384,30150,24242,17363,13851,10226,15480,
+20461,16535,16234,16362,15237,15529,15412,26964,
+16826,15754,15870,15624,16250,15886,18182,16072,
+16677,17004,17157,18349,16608,16583,19752,16764,
+17100,17201,16905,16797,16833,17926,16680,18249,
+18694,17574,17080,17565,17224,17596,17484,17159,
+17442,17023,17255,17327,17464,17385,17390,17621,
+17127,18126,17173,17598,19101,18816,19002,17799,
+18397,18091,18067,17877,19179,18805,18748,18805,
+18996,18051,18776,18550,18864,19338,19289,19686,
+20424,21309,22627,21160,20774,20326,20087,20042,
+20025,19992,20127,22707,20775,20954,20757,20709,
+21245,21333,21073,20913,21464,21748,22215,22176,
+21671,21287,21607,21239,21629,21677,21318,21165,
+21799,22199,21809,22085,21829,22818,22227,23123,
+22569,22991,23224,22647,22442,22528,22780,22567,
+23356,23185,24182,24061,24285,24360,25293,24850,
+24626,24664,24807,24630,23907,24141,23660,23176,
+23326,22998,23015,22761,22699,22642,22586,22452,
+22653,22176,22457,22263,21753,22206,22162,21951,
+21754,22621,21728,22248,22469,22156,22003,21722,
+21741,22133,22002,21607,21775,22336,22225,22666,
+23751,23994,25292,23571,22874,23031,21613,22670,
+22422,22447,21948,21705,21475,20727,21016,21961,
+21513,21345,21060,21093,20889,21093,21015,21657,
+21156,20820,20770,20464,20037,20113,20663,20250,
+20249,20186,20738,20280,21008,20633,17847,22277,
+30648,35769,43386,45294,42172,37985,36349,34800,
+35263,34581,34880,34607,33718,36291,38305,34533,
+33802,33444,33351,33355,33279,33152,33058,33031,
+33168,33209,33168,33094,33158,33272,33414,33868,
+33528,33533,33492,33770,33972,33911,34095,33510,
+32998,32686,32933,32677,32674,28349,26065,24390,
+24462,23460,23262,22927,22433,22386,22279,22440,
+22776,22073,21765,21857,21671,21110,21598,21372,
+21505,19857,21879,23285,23319,25632,25454,27935,
+29403,30559,31427,25965,29199,28962,27851,26057,
+24603,21567,20086,21253,22665,23343,22079,20169,
+19256,18762,18837,18879,18540,19107,19454,20308,
+19647,19783,19663,19460,19602,19610,19851,20196,
+20768,21219,21219,21155,21519,21481,21863,21745,
+22445,23114,23084,23977,25314,22738,23568,23946,
+22779,22584,21911,21719,21467,21434,20632,20766,
+21156,20946,21448,20576,20247,19821,19722,19599,
+20451,20835,19771,19975,19878,19368,20875,24715,
+20970,21078,20555,23063,20566,28052,18151,18277,
+17748,17812,17747,17778,17856,17577,17627,18185,
+18222,18475,18278,18425,18248,18562,19310,19858,
+21180,22084,23100,23659,24562,25614,28293,31230,
+31737,32238,32394,32853,33887,33625,34491,35840,
+35970,36138,36479,36710,37265,36956,36614,36974,
+37365,37399,37368,37716,37635,38021,38241,37380,
+36873,35799,35004,33997,29632,23984,23577,23808,
+23928,23280,23255,23161,24255,24903,25401,25500,
+23871,19907,18000,18150,18212,18204,18116,18000,
+18137,18258,19036,20034,21227,23026,28144,29021,
+26376,26151,27042,27152,26089,24677,21585,20289,
+19876,19260,18534,18379,18402,18615,18678,18417,
+17472,18609,21939,20004,19929,18425,19533,21082,
+18493,18503,21341,23637,25394,24214,22453,22850,
+20998,17215,21546,16996,18801,18411,18210,19185,
+18934,18558,19061,18645,19592,19717,18573,20025,
+19554,19602,19689,19787,20094,20049,20178,20132,
+20856,21038,21175,21278,21930,23292,23848,24009,
+24697,24107,24371,23203,22998,22361,21970,21734,
+21249,20904,20517,21742,21344,21157,21203,21577,
+21958,19820,23439,21816,23214,23607,26859,28764,
+29160,27036,23656,22920,22731,21771,20095,19992,
+18910,19243,19266,23096,27530,29694,28008,27206,
+25939,25623,24961,25644,26814,25647,25836,26165,
+23312,22600,24197,20750,20706,18477,18519,17592,
+16894,16480,23447,17002,17702,17676,17458,18470,
+17241,17902,17459,17205,17267,17265,17496,17477,
+17611,17843,17944,18816,20079,30226,32890,33139,
+34028,33665,33864,33921,34033,34148,34113,34186,
+34191,34385,34212,33899,33921,33963,33806,33670,
+33536,33546,33483,33447,33467,33473,33476,33461,
+33420,33387,33356,33311,33255,33229,33181,33204,
+33167,33450,33381,33435,33366,33583,33564,33377,
+33399,33522,33277,33124,33220,34520,33330,33130,
+33115,33191,33509,33722,33630,33840,33271,33247,
+33252,33335,33822,33726,33693,33687,33479,33503,
+33614,33911,34650,34424,33985,34809,35694,36438,
+34702,33440,32358,19536,19480,18801,18429,18440,
+18991,19503,22603,24399,20924,21476,26751,28667,
+28776,28901,28844,28864,29279,29875,29262,27999,
+26692,26360,23175,23139,25394,28659,26683,28294,
+24788,21223,20984,20683,21339,20623,23427,23430,
+26744,29562,26611,22866,21822,27405,27354,20986,
+20961,20640,20844,21085,21963,22869,26172,24974,
+25832,26934,27894,27132,21339,15069,6063,14210,
+15720,16506,17202,15762,15502,15432,22729,15837,
+16281,15654,15751,16257,16623,16746,20219,16510,
+16262,16748,16731,16826,17385,15218,17735,16966,
+17734,17661,17163,17095,16842,16532,16399,17634,
+16964,17514,17630,17911,18137,17659,17247,17939,
+17793,17304,17527,17523,17385,17417,17536,17623,
+17883,17998,18807,18498,20043,19317,19620,17862,
+18745,18411,18204,17831,18520,18461,18436,18468,
+18315,18264,18127,18615,19221,19301,19686,19942,
+20183,20670,21132,21510,20586,20691,20504,20913,
+20166,20250,20268,21357,19953,19666,20444,20802,
+20750,20729,20300,20712,20978,21526,21608,21502,
+20961,21236,21231,21630,21373,21312,21279,22023,
+21149,21519,21884,22062,22291,22316,22530,22677,
+22299,22494,23194,22801,22527,24104,24000,23380,
+23193,23248,23139,23533,23937,24505,24336,24469,
+24802,24729,24525,23919,23712,23966,23490,23316,
+23490,23099,23131,22874,22639,22574,22750,22617,
+22401,22374,22684,22340,22572,22132,22026,22102,
+21893,21999,21816,22442,22145,22389,22522,22224,
+21961,21921,22709,21957,21963,22356,21728,22527,
+22327,23139,22987,22977,22064,22145,22128,22411,
+21956,22064,21839,21399,21229,21503,21222,21590,
+22002,21374,21282,21192,21034,20772,21342,21684,
+22899,20964,20502,20624,20688,20492,19896,20151,
+19772,19232,20131,20792,20969,20297,18114,19332,
+30649,34713,37173,44326,42040,41195,36868,35068,
+37411,35021,35175,34663,33690,34122,34557,35327,
+33753,33292,33198,33203,33286,33211,33056,33021,
+33053,33102,33195,33183,33093,33342,33427,33548,
+33852,33372,33335,33667,33498,33522,33881,33437,
+33195,32993,32898,32879,32604,32525,29645,28339,
+25199,24704,23751,23166,22928,22581,22755,22812,
+22708,21966,21722,21630,21709,22137,21661,21375,
+20063,20726,21459,22704,25283,26027,31264,30159,
+28686,30964,30096,30270,29472,27939,24976,23197,
+22060,21250,23093,21851,24503,24015,22139,19314,
+19248,18735,18407,18322,18870,19155,19308,19113,
+18834,19662,19127,19117,19283,19390,19605,20353,
+20838,20699,21258,21187,21294,21359,22065,22065,
+23322,22726,23922,24267,25236,24690,24330,23058,
+22755,22479,21963,21589,20994,21008,21101,20559,
+20853,21171,20619,19398,19383,19661,18785,20344,
+19599,19609,19394,19672,18634,22125,20595,22551,
+24183,26204,20745,20151,22365,26115,27846,17449,
+18201,18771,17862,17499,17535,17691,17786,17541,
+17683,17972,18390,18376,18258,18766,19540,20415,
+21180,22113,23547,24570,25591,27103,29715,32394,
+32333,32303,32500,33305,34233,34920,35103,35739,
+35950,35973,36386,36432,36537,36635,36305,36792,
+36885,36946,37043,36895,37254,37151,38849,38727,
+38433,37397,37623,35464,34392,27971,25235,24287,
+23805,23794,23766,23907,24465,24819,27399,27691,
+26357,23008,18528,18142,17775,18107,18115,18093,
+18204,18372,19025,18745,22242,21498,27642,26583,
+26071,26277,26751,27403,27693,25810,25275,23379,
+20494,18886,18633,18511,19037,17889,20310,18261,
+18255,18690,17671,21302,20284,19629,19716,21574,
+20361,19368,19824,19548,24404,24298,24170,22572,
+24573,17987,22571,18196,20252,20187,18878,18974,
+19054,18861,19584,19760,20957,20269,19182,18764,
+19149,19878,19800,19750,20518,20358,19251,21562,
+20412,21295,21604,21591,20449,23451,23368,23943,
+23962,23316,23320,22886,23097,22885,22629,21225,
+21123,20977,20429,20601,21267,21642,21201,20833,
+21149,21474,21402,22252,20474,23945,25938,27763,
+27609,27022,26518,27885,26762,25426,26866,26247,
+28209,27879,28741,28620,28789,28765,27560,25792,
+24696,24008,24501,24909,26028,25761,25407,24273,
+23587,21674,22749,19581,19927,18752,18309,18075,
+17346,15727,20152,17537,17775,17502,17711,17603,
+17819,17432,17073,17112,16951,17119,17483,17710,
+17731,17891,18075,18586,22578,31972,33197,33674,
+33853,33862,34015,34137,34012,34221,34059,34205,
+34358,34289,34055,34107,34027,34056,33894,33825,
+33599,33600,33588,33557,33552,33585,33580,33540,
+33471,33474,33438,33417,33378,33336,33284,33299,
+33537,33501,33501,33494,33354,33414,33430,33426,
+33379,33339,33357,33095,33744,35100,33488,33018,
+33096,33183,33291,33412,33536,33570,33486,33282,
+33240,33267,33343,33450,33495,33485,33417,33415,
+33471,33637,33939,34165,34008,34460,35852,35767,
+34121,33456,32675,19533,19322,18617,18603,18300,
+32033,19653,23426,24141,21701,22335,26131,27780,
+29090,28843,28563,29050,29421,29492,29302,28550,
+26640,24925,23245,23523,25635,25265,26609,29221,
+23085,23340,21388,20044,21228,21016,23788,24132,
+27414,29793,29523,25023,23650,21285,20761,20571,
+20577,20152,20387,20852,21153,22950,25539,29715,
+25997,26228,27603,30840,23291,18842,13359,14735,
+17955,16353,16252,15576,15524,21821,16713,15283,
+15839,16449,16396,16431,16419,16455,17130,17157,
+16461,16692,16605,16844,16968,16545,17697,16918,
+16893,17193,17134,17331,17283,16993,18237,17146,
+17331,17363,17367,18633,18319,17345,17136,17375,
+17172,17430,17922,17908,17747,17495,17683,17769,
+17695,18114,18056,20142,19333,19089,19725,18609,
+19113,19468,18243,18798,18890,18795,18869,18688,
+18866,18996,18802,18981,20492,20422,19653,20018,
+20022,20517,19265,19993,20601,20759,20616,21234,
+21270,20618,20148,20189,20270,20811,19966,20233,
+20013,20128,19786,20210,20478,20913,20910,20739,
+21460,21124,21292,21544,21321,21246,21848,22048,
+21570,21726,22050,21910,21820,21853,22206,21786,
+22236,22776,22707,22542,22068,23014,21990,22629,
+23444,23458,23574,23590,23652,23976,24257,24442,
+25465,24573,24210,23939,23696,23490,23734,23550,
+23303,23435,22900,22752,22695,22993,23055,22467,
+22630,22753,22603,22740,23272,22089,21959,22220,
+22626,22839,22281,22229,22882,23467,21593,22451,
+21779,21693,21846,21664,22053,22594,21876,22617,
+22770,22799,22905,22596,22482,21525,21799,21657,
+22173,21782,22256,22408,21137,21437,22303,21230,
+21191,21551,21342,21201,21063,20517,21030,21054,
+21465,20908,22673,20295,20250,20271,20106,20890,
+20473,19863,20006,20585,19623,19925,17890,19130,
+29250,35194,38466,45912,47226,38408,36464,35322,
+36872,35412,34197,34071,33586,33555,33750,35901,
+33946,33237,33225,33220,33267,33211,33111,33079,
+33086,33066,33140,33209,33107,33111,33367,33504,
+33376,33720,33378,33264,33621,33215,33362,33432,
+33459,32980,33021,32980,32858,32667,32543,32174,
+31286,27740,25659,25050,23385,22612,22557,22549,
+22291,21396,21306,21379,21548,21498,22317,22644,
+23362,19885,20671,21823,23100,27154,29070,28510,
+29253,28979,28815,29639,27487,23871,22578,21468,
+21183,21210,22001,23173,24957,25186,21823,19727,
+20046,19125,18817,18890,18083,19023,19120,19488,
+19384,19882,19366,19502,19527,19817,19350,20280,
+19866,20731,20632,21342,21269,21594,22314,21716,
+22296,22807,22950,24222,23886,24086,23904,23094,
+22637,22482,22017,21685,21343,21484,21235,20949,
+20688,20387,20193,21078,20100,19173,19676,18848,
+19227,19260,19033,18931,20259,18972,19512,19854,
+23607,25814,26319,21699,20767,30198,29953,17626,
+18255,17853,17937,17561,17389,17376,17085,17419,
+17682,17505,18126,18286,18558,19417,19840,20248,
+21417,22603,23549,24705,27697,31085,32166,32306,
+32370,32520,32874,34337,36132,35871,35691,35686,
+35811,35895,35832,35888,36047,36374,36211,36335,
+37137,36692,37162,37661,37507,37136,37620,37656,
+40529,37317,37502,36801,35715,33056,30609,26439,
+26543,26757,25173,24596,24747,24837,26200,27861,
+26653,23506,18707,18015,17646,18057,18124,18212,
+18268,18591,18544,19841,20604,23731,22078,25697,
+24426,25829,25920,27309,27721,25758,24211,23334,
+20448,19259,19164,18588,18753,18333,18362,17990,
+18420,18815,18849,19880,20638,20296,19464,19561,
+19068,18131,19758,20862,21899,20053,22449,22730,
+22563,16676,18319,20332,19029,18157,19291,19293,
+18294,19167,19343,19077,19627,19429,19652,18707,
+19722,20253,19271,19492,20169,19351,20252,20626,
+20799,21412,21677,22421,21876,21443,24074,23502,
+23682,22164,22866,22522,22128,21861,21761,21974,
+20977,21242,21116,20725,20807,20769,20574,20666,
+20915,21099,20772,22731,21227,23480,28796,26738,
+26196,27487,28869,26751,26556,27683,26082,24720,
+25397,26054,25881,26218,26399,26977,26508,25620,
+24723,24345,22696,23130,25583,25253,25854,23596,
+22233,20820,20137,19197,21121,18768,18771,18180,
+19524,18132,18955,16373,17897,17604,17669,17517,
+17163,17514,16971,16572,16795,16920,16989,18077,
+17787,18060,18024,19203,27054,32837,33340,33862,
+33937,33909,33996,34150,34362,34410,34379,34465,
+34225,34316,34254,34143,34173,34018,33994,33990,
+33822,33594,33660,33660,33701,33711,33648,33639,
+33603,33559,33513,33473,33375,33360,33316,33727,
+33540,33562,33621,33511,33462,33507,33555,33525,
+33327,33359,33122,33267,33375,33978,34530,33099,
+33111,33210,33240,33322,33293,33335,33432,33348,
+33287,33279,33309,33302,33410,33348,33367,33375,
+33402,33480,33541,33675,35834,35034,35284,36830,
+35714,35296,32988,24693,19408,18906,19217,18909,
+18681,19376,22886,26387,25060,22687,25777,27666,
+27685,28470,28886,29163,29426,29412,29139,27734,
+25599,23779,23515,23399,24276,24924,26739,29699,
+23243,22016,22124,23746,24869,26673,27235,25272,
+26030,28619,28992,24684,22031,21336,20762,20364,
+20335,19978,20230,22131,21615,21939,24696,28720,
+27959,26093,26685,28338,25245,21272,18330,7478,
+14211,16900,16006,15983,15535,18700,16271,15846,
+16890,16634,15804,16437,16509,16542,16991,17102,
+20571,17125,16802,16700,17609,17314,17137,17349,
+16819,17238,17078,17360,17340,17241,17595,17662,
+17343,17460,17374,17656,17589,18126,17770,17593,
+17622,17496,17855,17908,17787,17261,17777,17942,
+17926,19199,17937,21769,20531,19428,19138,19616,
+20130,19840,18975,18654,18876,18436,18969,18488,
+18869,18951,19496,19823,19669,20172,20410,20187,
+20028,21897,19191,19464,20188,20827,20459,20246,
+20737,20282,20364,20223,20144,20335,20459,20444,
+20499,20426,20516,20638,21015,21003,20930,20934,
+21001,21180,21339,21186,21281,21306,21873,21762,
+21397,21661,21738,21643,21843,21819,22127,22190,
+22255,21928,21463,21514,23298,24346,22960,22633,
+23189,23085,23214,23516,23798,23633,24014,24299,
+24670,24249,24039,24120,24126,23983,23449,23676,
+23877,23486,23244,23246,22838,23305,22949,22716,
+22285,22489,22881,22498,22925,22092,22252,22900,
+22905,23263,22806,22062,22779,21496,21744,21705,
+21910,21451,21489,22125,21300,22183,22371,22761,
+23387,22592,22550,22436,22535,22282,21381,22016,
+21686,21369,21591,22302,22513,21814,21849,21297,
+21282,21360,21192,21111,20958,20907,20829,21030,
+21138,21357,21277,22416,20372,20118,19797,20359,
+20662,20598,20522,20806,20524,19919,18230,16339,
+26910,33897,38026,44109,44688,41922,40089,37225,
+37920,35043,33968,33822,33796,33525,33594,34328,
+34557,33285,33324,33282,33200,33159,33149,33132,
+33051,33075,33181,33252,33162,33117,33269,33285,
+33289,33376,33354,33356,33277,33085,33145,33264,
+33115,33095,33475,33376,32917,32770,32633,32418,
+31253,27908,26161,25581,23496,22422,22253,22194,
+21672,21015,20981,21092,21552,21882,22504,22104,
+23376,19647,20190,20274,20997,23376,25555,27336,
+24668,23904,27624,27329,23743,22517,21947,21963,
+22522,20804,22125,22983,23584,24509,21666,20330,
+19005,19271,18345,18516,17649,18504,18255,18306,
+19113,19287,19517,19830,20274,19929,19182,19498,
+20314,20253,20250,19871,20287,20413,21489,21966,
+22074,22585,22926,22419,23637,24538,24254,23013,
+22040,22305,21753,21708,21420,21125,20981,21158,
+19959,20819,20649,20258,19708,20071,19836,19257,
+19921,19547,19431,19200,19943,18954,19620,19220,
+21057,22872,21964,22015,27492,26253,24599,18981,
+18547,17977,18177,17677,17476,17632,17596,17484,
+17890,17977,18012,18294,18517,19409,20456,20932,
+21754,22867,24617,26211,29380,31521,32384,32450,
+32400,32564,33588,35317,35838,35922,36088,36010,
+35847,35763,35628,36026,36399,36415,36038,36521,
+36288,36815,37389,37167,37551,37503,37951,39126,
+38674,38629,38221,36978,36196,34804,32801,31576,
+28591,27557,26202,25043,25175,25227,26274,27282,
+26052,22761,18027,18234,18086,18060,18189,18007,
+18433,18617,18995,19678,20927,21475,21778,23727,
+25778,25197,25303,26067,26541,25786,23902,23798,
+23074,21010,19300,19455,19266,18139,18165,17765,
+18148,18612,19515,18757,19425,19119,19829,18901,
+18694,19144,18048,17459,20001,19655,20115,18081,
+21290,20100,21378,18978,23678,17716,21237,19020,
+19537,18825,19078,19335,19396,20016,19770,19568,
+20167,20065,20034,19866,18763,19956,20336,20244,
+20883,21828,21794,23522,22664,22903,24722,24327,
+23494,22357,23121,22867,21660,21860,21151,20980,
+21232,21242,21033,21096,20544,20180,20356,20628,
+21415,21685,21518,22368,20173,22144,28367,28037,
+26883,26870,25643,24811,25290,25650,25557,24315,
+23393,24457,26268,25676,25223,25295,25073,24480,
+24604,22928,22489,22482,24993,25575,23727,22722,
+21561,20558,19470,18844,18858,18507,18258,17987,
+18201,18081,18564,16032,17083,17288,17285,17616,
+17489,17215,16785,16456,16494,16723,16913,17136,
+17202,18417,22635,25462,30849,32848,33335,33781,
+33857,33871,33965,33954,33978,34306,34415,34220,
+34185,34173,34272,34087,34086,34230,34335,34216,
+33974,33855,33594,33625,33639,33669,33708,33679,
+33657,33592,33588,33538,33466,33570,33598,33547,
+33724,33568,33621,33495,33477,33450,33687,33574,
+33340,33288,33131,33348,33234,33315,33435,33162,
+33081,33284,33477,33551,33267,33246,33460,33454,
+33308,33317,33339,33313,33342,33341,33375,33421,
+33399,33451,33514,33650,34650,34236,34983,36326,
+34683,33225,33042,31835,19518,19286,19134,18331,
+22257,18541,20149,26345,27417,24012,24530,25461,
+27618,28565,28660,29536,29463,29447,28945,27675,
+23790,22803,23040,25506,23772,23808,25661,28284,
+29524,25353,27225,24772,27212,25848,26158,25929,
+27550,25993,27732,26469,21970,20964,21288,20203,
+20107,20338,20596,21330,24678,21862,23040,29007,
+28939,25218,25572,27889,29386,24060,20117,12093,
+13791,15912,15571,15936,19044,22380,15945,16555,
+16984,16704,16809,16788,16761,16638,16876,16881,
+17907,16782,16686,16617,16763,15986,16945,17405,
+17181,17241,18004,16870,16998,17157,16543,17594,
+18829,16803,17041,17751,18597,18948,18891,18244,
+17463,17774,17631,17588,17304,17478,17209,17502,
+18204,18103,18810,19233,19290,19342,18663,18835,
+18830,18863,18424,18832,18850,19146,19729,19708,
+19176,20279,20548,19935,20400,20462,20540,21292,
+20720,20106,20101,19703,19902,20133,20054,20090,
+20073,20461,20463,20121,20406,20247,20457,20613,
+20885,20943,20871,20830,21075,21495,22059,20965,
+20797,21357,21222,21401,21464,21567,21755,22004,
+21874,22049,22119,22140,21926,22275,22517,22770,
+22858,22389,22276,23173,22770,22761,22935,22758,
+22833,23232,23274,23517,23900,24012,24809,25364,
+24974,24291,24299,24163,23997,23632,23414,23421,
+23847,23440,23315,23334,23022,23752,23065,21747,
+22506,22777,22560,23059,22254,23371,22126,22368,
+23219,22947,22424,22055,22534,22043,22047,21722,
+21740,22038,21672,21723,21714,22459,24167,23347,
+23409,22962,23052,22099,22638,22565,22289,21684,
+21990,21545,21326,21267,21192,21113,21602,22039,
+20867,21134,21326,21269,20886,20812,20282,20897,
+20862,21416,20911,21969,20935,20469,20443,20420,
+20955,20613,20211,20811,20991,20027,19804,14372,
+26665,34020,38850,45557,44450,43337,38589,36549,
+41477,38309,34233,33947,33743,33678,33453,33310,
+33870,33290,33357,33216,33195,33163,33141,33128,
+33108,33153,33121,33219,33220,33198,33171,33195,
+33344,33456,33731,34231,34492,33849,34404,34450,
+34324,34458,35032,35841,33003,32853,32748,32611,
+31109,28368,26986,25749,24591,22419,22075,21867,
+21409,20786,20927,20930,21140,21777,21844,21478,
+21342,19905,20214,19989,20172,21159,21742,22221,
+22167,21542,23765,23265,21816,23562,25129,24009,
+21353,25550,22842,23516,25431,23998,23010,20638,
+18422,18189,17961,17352,16938,17463,17675,17913,
+18468,18785,18730,19501,19628,18926,19401,20051,
+19815,19986,20015,20618,20909,21789,21969,21859,
+22875,22173,21386,23054,22111,23879,22379,23079,
+23047,22101,22151,21471,21342,20948,21315,20738,
+20500,20317,20528,20328,19938,20268,19953,19929,
+19564,19837,19902,18573,19347,18684,19229,18888,
+19056,21026,21682,22912,24114,22655,19311,17891,
+18024,17502,17766,18201,17649,17393,17329,17773,
+21201,18204,18118,17983,18243,19177,20418,20882,
+21764,22832,24087,26293,29679,32040,32403,32461,
+32376,32740,33755,35613,35244,35451,35947,35998,
+35658,35436,35676,36134,35812,36633,35974,36013,
+36528,36422,36883,36935,37230,37425,37812,38423,
+40278,40792,42276,37619,37854,35763,33769,32869,
+30315,28248,26499,26231,26000,25701,26630,26976,
+27066,22347,18810,18273,18198,18099,18067,18459,
+18297,18635,18865,19113,19719,20361,22588,24882,
+26922,26030,24478,24091,25548,23817,23340,24356,
+25003,23847,21663,21240,19302,18426,17997,17701,
+18222,18567,17802,18588,19107,18461,18297,18320,
+17593,18509,17688,18750,17838,18606,20120,18627,
+22491,18373,23072,21447,20957,18910,20282,18631,
+18511,18015,20289,19636,19425,20328,19667,19701,
+19943,20072,19874,20665,21350,21995,21027,21291,
+21510,21533,22977,22714,23267,24444,24954,23781,
+23610,22102,21858,21753,21866,21265,21357,21090,
+20990,20680,21079,20665,20711,20078,20123,20828,
+21186,21704,21801,22564,21795,23231,25528,27061,
+25754,24946,23069,22128,22266,23211,23831,22128,
+21080,22093,25542,24876,24521,24816,24456,24105,
+24087,22821,21763,22059,27000,26685,24652,23352,
+21262,19622,19619,19128,18662,18302,19347,18836,
+19158,18046,18666,17597,17472,17283,17607,17676,
+17550,17004,16493,16359,16329,16335,16380,16961,
+17685,19386,23373,29680,32952,32940,33418,33928,
+34022,34014,33928,34002,34145,34322,34200,34219,
+34288,34227,34370,34053,34282,34350,34212,34284,
+34185,33983,33799,33616,33625,33656,33651,33662,
+33713,33567,33834,33768,33671,33671,33874,33734,
+33688,33686,33577,33533,33480,33540,33420,33372,
+33243,33071,33047,33018,33071,33188,33118,33035,
+33109,33268,33407,33495,33445,33237,33274,33427,
+33435,33360,33393,33399,33424,33379,33405,33419,
+33430,33455,33504,33594,33895,34162,34836,36030,
+35428,33528,33072,32713,25074,19350,18597,18534,
+18271,19014,19305,22449,26801,24134,25034,24693,
+27539,28241,28464,28593,28803,29427,28698,26995,
+23517,22403,22821,23874,23263,23092,25341,28700,
+32071,24578,25491,26700,23929,24103,26253,24369,
+24783,25426,25658,24283,25709,20595,20049,20226,
+19983,20517,20773,21228,21894,22501,23421,25528,
+30324,25497,26171,26463,31912,25239,21481,16296,
+10481,15363,15830,16330,16752,21689,16907,16857,
+16995,16977,16884,17698,16961,16704,17238,16656,
+19458,16882,16500,16530,16089,16782,17306,16984,
+17301,17041,17682,18266,17456,17306,17268,17828,
+17706,17154,16926,17839,17904,18840,18110,17736,
+17616,17598,17500,17378,17083,17274,17628,18221,
+17306,18942,19742,19431,20220,18902,18886,18587,
+19161,18909,19548,19785,19444,19368,20097,20010,
+19711,21493,20426,20651,21388,21216,21712,21570,
+20386,22108,20770,20153,20196,20301,20419,20278,
+20207,20394,20366,20571,20561,20499,20616,20560,
+20861,21230,21396,21240,21513,21009,20892,20836,
+21194,20901,21121,21628,21723,22094,22337,21879,
+22272,21693,22107,22230,22717,22482,22623,22935,
+23243,22856,23340,22989,22372,22485,23591,23545,
+22785,23049,23142,23735,23731,23799,24375,23948,
+24125,24197,24507,24606,25207,23610,23958,23724,
+23654,24105,23407,23606,23251,24464,22665,22863,
+21857,23118,23202,22589,23125,22814,22350,22464,
+22980,22473,23046,22363,22272,22373,21924,22103,
+22177,21568,21799,21820,22143,23271,24158,22774,
+22708,23258,23388,24144,22787,22386,22834,22458,
+22200,22086,21600,21960,22212,22979,21156,22118,
+20774,21558,21457,21282,20830,21179,20779,20884,
+20555,20497,20676,21303,22081,20221,20624,21117,
+19997,20445,20175,20265,20888,20820,20049,13974,
+23562,35671,36295,38393,46638,43918,41894,37864,
+40269,41430,35587,36640,34535,34007,33764,33346,
+33318,33294,33265,33227,33220,33163,33154,33156,
+33123,33102,33193,33159,33198,33180,33149,33129,
+33265,33402,33726,33976,34233,34166,34199,35319,
+34651,35274,34908,35943,33357,33033,32766,32678,
+32423,30495,28606,25487,24480,22755,22123,21915,
+21657,21220,20958,21933,22477,21439,21578,21255,
+21086,21340,19850,18962,19604,20320,20727,20677,
+20560,20143,20427,20991,22020,24268,25619,24250,
+23610,27888,27817,25773,20820,22812,20597,19716,
+19169,17480,17746,17348,17700,18671,19071,18516,
+18419,19501,18839,19338,19065,19241,19595,19662,
+19869,19955,19804,20219,20631,21000,20798,21410,
+21633,22323,22241,22920,22991,23556,23436,23103,
+23825,21669,22423,22626,21777,21424,21435,20561,
+20301,19875,20472,20140,20274,20146,19905,19696,
+19596,19302,18837,19038,19034,18489,18750,19577,
+19826,19342,20119,21035,23312,23887,21473,18076,
+17924,17544,17658,18114,18810,17314,17682,18244,
+18189,17491,17814,18335,18533,18797,19423,20285,
+21270,22407,24540,26663,30366,32573,32502,32544,
+32648,33675,35388,34196,34872,34768,34074,35348,
+35562,35397,35619,35748,36019,36334,37065,36837,
+36282,36662,36671,36721,36918,37358,37454,38191,
+38100,42312,36522,35910,35521,35129,34923,33325,
+32856,28543,27120,27245,27502,26253,25626,26652,
+26238,23812,20224,18324,18404,18507,18487,18609,
+18800,18912,18927,19137,19308,19258,20657,21564,
+25762,26915,24397,25920,24318,23639,24181,24450,
+24910,24831,22725,17880,18004,17754,17889,17933,
+17949,17724,18330,17995,18231,18016,18217,18172,
+16743,17729,18519,19955,18033,18050,18768,19027,
+21415,17566,21621,22123,22581,21755,22617,21704,
+20321,21183,18524,20606,21537,19791,20360,20694,
+20587,20667,19549,20502,20182,20906,21348,21963,
+22128,22559,22135,23247,24203,23878,23586,22863,
+22723,21786,21927,22182,21130,20496,21030,21117,
+21132,20643,20539,21430,20751,20302,19927,20232,
+20565,21683,21486,21635,20603,22973,23988,22676,
+23000,23532,21719,21052,21141,20616,20586,20681,
+20343,20943,23158,24564,24079,25581,24515,23836,
+22216,21067,21458,24033,28227,28008,26162,22670,
+21514,20270,19431,19030,18596,17814,20673,18633,
+17986,18581,20715,17580,16894,18238,17598,17657,
+17271,16461,15969,16232,16447,16250,16720,17007,
+19283,24005,28233,32971,32884,33323,33815,33960,
+33925,33999,34002,34193,34362,34426,34253,34284,
+34206,34170,34180,34346,34228,34547,34414,34219,
+34203,34126,33900,33759,33897,34055,33935,33911,
+33846,34020,33962,33919,33933,33854,33964,33825,
+33849,33707,33615,33600,33666,33516,33330,33396,
+33343,33072,33039,33028,33025,33121,33116,33069,
+33090,33232,33340,33450,33240,33253,33283,33513,
+33381,33425,33529,33453,33432,33408,33420,33462,
+33502,33510,33496,33551,33691,33877,34294,35128,
+34871,34100,33198,32807,23461,19083,19308,21460,
+18789,18906,19533,20852,23892,23397,23913,23775,
+25381,27391,28248,28498,28598,28913,28203,27549,
+23646,22503,23844,23624,23367,23779,27006,30531,
+27970,23391,24687,24150,25246,24735,24487,23716,
+24887,25964,25525,23499,22842,21456,20523,22362,
+20175,20029,20914,21999,21934,22213,22633,24348,
+27073,28049,24889,27425,29010,25351,22730,18692,
+7298,15961,16113,16791,19632,18873,17143,17418,
+17526,17372,16986,18270,16881,16377,16536,16690,
+16408,16916,16682,16553,16176,18150,17630,16914,
+17080,16721,17210,16959,19047,17679,16936,17646,
+17505,17460,17432,18564,17211,17410,17616,17476,
+16986,17497,17434,17118,17163,17694,17793,18700,
+18471,19580,20565,18261,18342,18825,18582,18814,
+18977,19105,19852,20160,19901,19965,19722,20715,
+23079,25519,24913,23281,22365,21282,22419,22494,
+21640,20815,20016,19962,20054,20234,20318,21268,
+20554,20550,20677,20532,20700,20246,20385,20463,
+20442,20383,21539,22878,21051,20288,20878,20895,
+21546,21395,21738,21736,21721,21851,21899,21970,
+22554,22119,22599,22801,22156,22755,22140,22377,
+24808,22352,22818,22437,22215,22348,22834,22997,
+23361,23058,25149,23715,23802,24416,25813,24360,
+24066,24012,25907,24323,24500,24258,23946,23454,
+24522,23286,24563,24807,23550,23726,23715,22671,
+22789,22782,22671,22421,24859,22861,22024,23152,
+22950,22236,23698,22269,22809,23767,22587,22401,
+22137,21988,22132,22956,21560,22876,22600,22333,
+24323,24124,23234,23638,22438,23686,22904,21382,
+22523,21900,21539,21357,21128,21591,21800,21708,
+23055,21203,21399,21597,21460,20910,20718,20305,
+20420,21213,21453,20431,21127,20165,20637,20193,
+21337,20542,20526,20840,21006,21139,20288,17614,
+21040,31794,34227,38892,41307,45052,45974,41544,
+39272,36098,35276,35718,35911,34794,33993,33420,
+33363,33305,33324,33268,33204,33170,33147,33187,
+33118,33123,33207,33231,33160,33150,33191,33245,
+33204,33367,33578,33854,34041,34573,34717,35071,
+35510,35478,35535,36078,37334,34060,33105,32795,
+32566,32314,30411,26027,24675,23478,22685,22397,
+22182,22518,23868,23928,23653,23373,23741,24754,
+20142,20293,20112,18613,21156,20127,19320,19756,
+19785,19749,19911,20056,20945,22588,22286,20144,
+20088,23634,23409,19876,18939,20343,18096,17685,
+18114,17671,18259,18277,16866,17991,17918,18348,
+18120,19106,18982,18694,18890,19423,19353,19746,
+20238,19966,20502,20427,20283,21230,21739,21438,
+22025,22746,22836,23098,22975,22242,24119,24333,
+24087,23355,22426,22044,22172,21238,19984,20655,
+21540,20191,20241,20019,19971,19991,19368,19687,
+19117,19084,19257,19056,19208,18897,18927,18477,
+19227,19152,19569,19721,20633,23544,22017,23850,
+18070,17847,18338,18192,18321,18075,17847,17799,
+17855,17735,17943,18148,18405,18785,19050,19737,
+20904,22074,24297,26943,29996,32643,32499,32813,
+33581,33197,34051,34990,35453,35549,35220,35723,
+35028,35585,35677,35796,36104,36969,37334,37257,
+36351,36487,37045,36948,36929,37182,37425,37599,
+38100,38148,38228,36943,37237,36361,35028,33621,
+33093,30081,27758,28131,27895,27375,26660,26548,
+27349,25718,21108,18582,18462,18578,18759,18820,
+18746,19094,19300,19277,19291,19396,19539,21105,
+24788,25715,28448,25696,25748,24063,24367,25137,
+26880,26118,24596,19218,17523,17542,17538,17736,
+17342,17621,17610,17553,17679,17885,17979,18331,
+18103,17254,18190,19430,18333,17796,17701,17775,
+19097,18740,20030,21651,23022,19516,21437,24748,
+24148,21239,20907,20424,21285,19068,20280,20456,
+20492,20628,20235,20150,22214,21783,21822,21564,
+23086,22859,22728,22373,23517,23319,23184,22985,
+22905,21471,20913,22145,21196,21093,20478,20184,
+20923,20335,20142,20046,20934,20145,19942,20337,
+19903,20754,20354,19900,20484,22600,22833,21636,
+23100,23106,20604,20461,20397,19101,19419,19788,
+20291,20865,21264,21794,22272,22801,23424,22432,
+21936,20231,20164,21201,28818,29952,23760,20334,
+19681,19383,18805,18675,22721,19613,20500,18549,
+18861,17589,17005,18000,16766,17540,17159,17043,
+17186,16780,16107,16242,16600,16491,16503,17572,
+21250,29757,31419,32979,32959,33852,33750,33885,
+34116,34113,34064,34164,34296,34396,34344,34374,
+34230,34424,34499,34330,34305,34422,34472,34399,
+34266,34189,34055,34018,34182,34155,34059,34063,
+34011,34174,34020,34110,34021,34230,34013,33930,
+33992,33852,33738,33722,33822,33594,33294,33312,
+33118,33019,32927,33075,33046,33155,33058,33089,
+33102,33184,33375,33252,33687,33433,33322,33467,
+33423,33511,33508,33537,33500,33484,33486,33548,
+33567,33563,33678,33588,33654,33833,34000,34821,
+34840,33871,33750,32766,27040,21198,19511,28710,
+18459,19186,21265,23729,26355,23727,22730,23134,
+25884,26925,27876,28146,28941,29110,29503,28007,
+23196,22789,23090,22848,22419,22875,27229,29232,
+22957,24774,23298,24148,24480,25560,22339,22959,
+24882,25260,25545,23857,23029,20911,27346,20173,
+19345,20867,20616,21701,22679,21938,22101,23949,
+28332,29384,25483,26187,27870,27159,23329,19500,
+6615,14103,16345,23172,19449,18101,16962,17497,
+17556,17941,17952,17145,17042,16291,16162,16035,
+18029,16371,16387,16330,16057,16787,16624,17345,
+17049,16488,16962,16895,17220,18499,17949,17419,
+19208,18461,17638,17532,16925,17248,17734,17339,
+17448,17595,17421,17148,17250,17388,17520,17717,
+19700,21333,19253,20361,19711,18985,18891,19271,
+19616,20010,20997,20837,24714,20910,21197,26785,
+26191,28096,25612,22707,21920,21944,21140,21034,
+20632,19752,19788,19872,20007,20326,19885,20238,
+20431,20540,20509,20619,20596,20631,20859,21153,
+21390,21273,21083,21972,21070,21539,21410,21851,
+21558,21314,21724,21300,21473,20796,22955,22106,
+22031,22366,22570,22795,22920,22542,23135,23418,
+23312,21881,22298,22261,23276,22880,23038,24071,
+23678,23733,23520,23521,25646,27026,25911,25200,
+24647,24421,23664,25676,24225,24222,23955,24268,
+24468,24306,23599,24024,23646,24692,23286,24282,
+23693,22872,23367,22800,22567,22987,23481,24320,
+22232,22349,22345,22074,23943,23148,22890,21842,
+22765,21703,22335,22353,21729,22439,21980,22280,
+22298,22100,21729,21699,22308,22951,22772,24367,
+24971,21960,21609,21483,21311,22017,21654,21712,
+21818,21291,21033,22447,21951,21224,20845,20889,
+21224,20106,22172,21749,22097,21855,20621,20953,
+20658,20792,20199,19809,21060,21656,20404,18917,
+18688,27639,33924,36536,40966,45755,49888,44636,
+38875,37564,35880,35223,37223,33845,34062,33533,
+33457,33426,33387,33382,33319,33199,33207,33192,
+33187,33159,33190,33189,33183,33161,33199,33218,
+33558,33688,33747,33994,34417,34497,34833,35179,
+34895,35190,35496,35812,35631,35547,35358,32817,
+32650,32280,30144,26801,25912,24747,23518,23774,
+23102,24124,24876,24252,23892,23938,23539,24707,
+20510,20274,20488,18744,20005,19075,18997,19719,
+19686,19741,19896,19682,18957,19744,20247,20405,
+23327,18703,19452,18449,18240,18924,19050,19334,
+19162,20331,19791,18452,18089,17762,17850,18449,
+18021,18426,18876,18980,18884,19209,19062,19107,
+19284,19743,20811,20541,20721,21819,21078,21460,
+21685,22290,22793,22386,23705,23904,23021,22791,
+22978,23112,22110,22308,21862,21432,20853,20496,
+20567,20849,20595,19854,20088,19938,19863,19656,
+18613,18674,19028,19632,18744,18480,18924,18262,
+18291,19035,18739,19143,19530,22413,24259,22802,
+18945,18788,17958,18615,18289,18282,18090,17917,
+17882,17973,17669,18182,18644,18782,19209,19806,
+20712,22184,24579,27153,29349,31792,32608,33429,
+34424,36323,35207,35409,36138,36290,36014,35583,
+35530,35589,35771,36004,36251,36563,36933,37512,
+37060,36259,36674,36707,36825,36981,37177,37430,
+37799,37803,38759,37972,36610,36562,36070,34110,
+33393,31605,28770,28286,28129,28161,27900,27765,
+27208,27487,21163,19041,18814,18820,18929,18924,
+19203,19250,19441,19318,19538,19526,20012,20715,
+23611,26915,27707,26958,27450,27210,27377,25434,
+25998,24300,19795,18250,17175,17147,17125,17072,
+17057,16956,16873,17111,17545,17391,17629,17820,
+17945,17980,16854,18623,16742,14526,18410,17769,
+17526,20424,20348,19423,21275,22363,23184,20652,
+23628,22471,19647,21447,22618,21666,20865,20420,
+20727,21218,22090,21189,20854,22639,21918,22638,
+23283,22698,24304,23676,23745,22758,21792,23052,
+22412,21195,21586,21941,21370,21111,21422,21444,
+20994,21709,20002,20215,19973,20282,19992,19630,
+19744,20111,20190,20817,20836,22094,23643,23397,
+23592,21804,19304,19523,19344,18147,18982,19146,
+20030,20701,21183,20198,20274,20448,20196,20019,
+20221,19571,19777,21450,24992,25445,20892,19887,
+19057,18473,18575,19474,19507,19916,19652,19446,
+19163,18741,18076,18142,17392,17056,16836,16708,
+16614,17134,16200,16173,15534,16668,17049,20474,
+25959,30887,32348,32844,33465,33652,33765,33965,
+34119,34325,34326,34333,34239,34590,34527,34551,
+34543,34516,34320,34398,34563,34681,34440,34297,
+34352,34380,34291,34294,34136,34361,34176,34091,
+34209,34087,34311,34314,34139,34179,34291,34229,
+34165,34034,33912,33765,33837,33685,33299,33252,
+33360,33045,33133,33024,33064,33067,33115,33114,
+33127,33213,33420,33206,33225,33303,33491,33482,
+33445,33620,33574,33605,33583,33604,33612,33648,
+33688,33693,33727,33741,33803,33973,34131,34395,
+34332,33465,33054,32761,28396,20140,25569,19032,
+18567,18729,23155,24099,25983,22714,22707,22891,
+25185,27237,28209,28628,28721,29225,29328,27384,
+23936,22968,23148,22243,22835,23293,26563,28159,
+23827,22934,23431,21055,23296,25250,24231,21794,
+24909,26122,24673,23545,20928,22200,20562,19179,
+19599,20004,21013,21366,20642,24267,23422,24543,
+26321,30198,25493,25392,27474,29475,26094,18689,
+11372,13530,17247,20106,17324,17127,16931,17079,
+17489,18767,17819,16874,16436,15759,15837,15860,
+15822,16180,16169,16506,15909,15989,16417,16968,
+16889,16419,16734,17037,17212,18365,18441,18018,
+17193,17757,17497,18657,17960,16945,17550,17817,
+17729,17261,17446,17287,17555,17422,19341,18626,
+19119,20330,21438,20231,19224,18878,18926,19417,
+20227,20836,22356,22185,21204,24155,23765,22871,
+27062,22846,25158,23337,22556,22017,19595,20563,
+19866,20052,20299,20139,20219,19713,20002,20227,
+20617,20470,20734,20382,20824,20985,21062,21189,
+21483,22132,20556,21390,22160,21242,21049,21868,
+21780,21405,21418,21507,21729,21723,21951,22344,
+21900,22427,22268,22626,22629,22616,23274,22706,
+23121,22428,22014,22649,23189,22989,25651,23498,
+23802,24165,24443,24315,23901,24903,25271,24798,
+25338,24762,23924,23264,23752,26002,25323,24075,
+26428,23077,23431,23256,24363,24783,27408,22385,
+23125,21838,23278,23620,24714,23196,23535,23028,
+23288,23045,22855,22604,22101,22413,22686,22755,
+23134,22855,23502,22294,23043,26201,21868,22163,
+21549,21400,21768,21732,21697,21516,22553,24325,
+24832,23731,22201,21839,21050,21937,21570,21826,
+21624,21417,21827,21702,21428,21212,21395,20011,
+21094,21090,20916,22002,21898,22358,21867,21096,
+22518,20217,20525,20458,20916,20737,20897,19829,
+13263,20826,34011,36273,42621,45870,46242,45816,
+38652,45239,39797,43271,34728,33853,33917,33469,
+33456,33461,33457,33434,33413,33247,33256,33231,
+33191,33183,33142,33156,33147,33146,33177,33202,
+33581,33774,33997,33642,34113,34101,34470,34325,
+35094,35800,35385,36396,34336,34371,33132,32876,
+32684,32512,30865,28344,26741,25364,25226,24745,
+24806,25223,25748,24921,24043,23436,22982,21919,
+21796,20740,20988,19662,19155,19170,19190,19237,
+19873,19500,20899,20205,19836,19416,18829,18652,
+18815,18289,18080,17787,17699,18368,18960,18942,
+17963,18069,18292,18223,18492,18335,18275,18888,
+18078,18655,18637,18204,17584,18151,19134,19332,
+20011,19995,20409,21039,20375,20245,20914,21468,
+22202,22479,22287,23628,25548,23691,22908,23004,
+22792,22334,21894,21780,21794,21656,21518,20911,
+20250,20034,20023,19922,20035,20124,19662,19391,
+19028,18910,18957,18774,18124,18717,18953,18045,
+17739,18720,18527,18756,18816,20517,23220,25680,
+24455,20626,20174,18401,18474,17920,18534,18020,
+18291,18403,18412,18464,18654,18959,18795,20094,
+21176,22695,25350,28857,31134,32109,32814,35148,
+35269,36770,35400,35143,36361,38045,36377,35604,
+35553,35552,35791,35911,36097,36251,36591,37069,
+37259,36489,36877,36975,36891,36959,37062,37206,
+37648,37914,37850,37965,38351,36681,35675,34080,
+33181,33051,29745,29127,28770,28487,28676,27891,
+26965,27272,21297,19406,18885,19074,19125,19095,
+19298,19509,19670,19839,19663,19907,20336,20758,
+23385,28191,28887,28972,29205,28383,27106,27245,
+23374,20882,18656,17855,17184,17140,17138,16767,
+17052,17064,17156,16938,17057,17463,17669,17676,
+17739,17889,17664,17034,16586,18204,18288,15567,
+17229,19353,16854,21011,19737,19235,21169,20741,
+21870,22578,21293,25342,22857,18923,21256,20873,
+21183,21648,22309,21115,22877,22656,22492,22655,
+23879,23436,22565,22581,23457,23016,23087,22296,
+21143,20916,21111,22304,22652,20374,20865,19971,
+20593,20807,20658,20138,20018,19847,19785,19864,
+19459,19667,20115,21001,22641,23393,26684,27124,
+24628,20865,18956,19080,18792,17850,18454,18730,
+19310,19386,19737,20006,19734,19404,19480,19685,
+19276,18876,19472,19475,21410,19104,20631,19458,
+19327,19086,18598,18564,18489,18516,18918,18777,
+18933,18676,18297,18390,17953,17476,17184,16453,
+16905,17016,16815,16089,16092,17253,21357,26250,
+30090,31380,32577,32809,33546,33611,33722,33963,
+33886,34230,34288,34266,34380,34482,34615,34602,
+34444,34526,34484,34716,34627,34467,34356,34515,
+34255,34372,34242,34259,34156,34307,34181,34156,
+34370,34143,34371,34482,34381,34496,34356,34413,
+34260,34269,34150,33942,33930,33602,33452,33438,
+33257,33079,33061,33033,33057,33127,33200,33119,
+33108,33198,33479,33429,33416,33399,33501,33644,
+33480,33649,33642,33703,33732,33729,33781,33855,
+33834,33721,33974,33867,33875,34192,34042,34542,
+34026,33900,32927,32451,21101,18653,19517,18624,
+18441,18519,23708,24313,24440,22680,22547,23637,
+25679,27260,27987,28679,28777,29132,29278,27895,
+24897,22944,22731,22147,22503,23283,31383,29178,
+22413,24171,24101,21368,21720,23396,23372,24196,
+22976,22598,21190,20913,21057,21243,19391,19775,
+19584,20270,20850,20768,20336,20922,22749,23907,
+25785,30411,26417,25540,26599,28929,26360,20655,
+14816,12690,21957,18374,17703,17334,17136,16681,
+16806,16685,17059,16662,16339,15768,15657,16182,
+16073,16502,16113,16498,16261,16436,16835,16562,
+16786,16520,16372,17194,17895,17669,17588,17637,
+17722,18075,17557,18279,18414,17195,17111,17865,
+17790,16901,17376,17767,18866,18437,18282,18676,
+19354,19305,18814,19873,19225,19168,20080,20200,
+20526,20583,26121,24180,21216,24091,24490,23415,
+21682,22422,22017,21721,21299,20100,19901,19746,
+19905,20004,19960,20127,20322,20115,19925,20310,
+20335,20283,20136,20953,20649,20511,20973,21177,
+21081,21778,21914,21977,22643,22022,21483,22044,
+21414,21477,21293,21615,21707,21666,22237,22039,
+22049,22312,22288,22362,22320,23106,24331,22905,
+22776,22816,23058,22416,23859,23556,22833,24044,
+23334,25602,24717,24653,25882,25290,25025,24645,
+24677,24483,25047,25064,23408,24323,23470,23964,
+23519,24569,21753,25885,25930,22988,24639,23388,
+22272,23700,23000,26006,23852,23226,24708,24775,
+22550,23014,22549,22342,22203,21752,22305,23370,
+24330,23463,22664,22347,24314,24261,24072,22161,
+21825,21957,22274,22046,22254,22063,21909,22421,
+24065,23610,22118,21867,21854,21588,21767,22163,
+21325,22103,21577,21602,22112,21015,20626,21180,
+22344,21088,21348,21169,22151,23052,23068,20106,
+20397,21110,21391,21553,20698,20941,20924,20302,
+15413,22171,33058,36273,41063,46116,47480,47659,
+45503,44082,43646,42267,42180,34509,34069,33608,
+33547,33560,33508,33470,33467,33325,33297,33242,
+33206,33181,33149,33138,33116,33170,33242,33284,
+33779,33526,33613,34674,34179,34693,34435,35662,
+36664,36265,36732,36105,34602,33671,33405,32862,
+32730,32629,32415,31506,28592,26333,25482,25194,
+25310,25541,25915,25779,25625,25260,24145,22263,
+21330,24189,20308,20853,19654,19453,19443,19302,
+19337,19359,19182,19116,20611,20342,19698,18945,
+18549,17872,18189,18257,18247,18282,18474,18853,
+18315,19178,18034,18067,17841,18046,18313,18235,
+18978,19058,19452,18708,18611,17544,17991,18225,
+19029,20809,20397,20365,20693,21224,21612,21795,
+22092,22501,23175,21476,25170,25037,23892,22899,
+22226,21880,21578,21273,20767,20915,21288,20888,
+21073,20397,20142,20353,19230,19413,19662,19499,
+19225,18819,18996,18863,17862,17776,18176,19123,
+18022,18532,18983,17649,18243,19422,23931,24022,
+23355,24349,23968,20850,18366,18085,18291,18276,
+18277,18201,18030,18146,18939,18863,19241,20767,
+21912,23799,27078,31332,31875,32328,33438,35184,
+37460,37113,35902,35229,35373,35902,36096,35945,
+35550,35667,35733,35723,35836,36015,36255,36550,
+37012,36762,37090,37185,37662,37130,37267,37302,
+37665,37784,37684,37919,37766,36732,35818,33548,
+33172,33131,31158,30542,29661,29060,28038,28041,
+27404,27300,20353,19549,19272,19127,19367,19299,
+19545,19650,19797,20002,20145,20253,20324,21702,
+23706,26726,28729,27517,27810,26424,25729,24188,
+20579,19051,18382,17848,17250,17118,17064,16848,
+16827,17007,16851,17231,17284,17250,17470,17575,
+17688,17783,17122,16878,16822,17218,17112,17886,
+16900,17031,18888,18727,18032,20992,20885,21582,
+21075,19766,20318,20442,22429,22551,22401,24655,
+21888,22880,22809,22522,22072,22984,22983,24405,
+24227,23786,23457,22658,23025,22983,22049,21386,
+20246,20917,19368,23475,21920,21172,20591,20703,
+20457,20232,20500,20263,19833,19786,20124,19734,
+19169,19488,20028,21066,21801,24170,26379,27046,
+26419,19322,19617,18578,18317,17661,18048,18357,
+19046,19296,19478,19088,19976,19481,19388,19414,
+18560,18351,18135,18017,19031,19921,20353,20008,
+18931,19105,18685,17966,17805,17875,18265,18073,
+18461,18646,18524,17983,16221,16743,17455,17639,
+17198,16972,16083,17397,19053,21250,23441,28941,
+30690,32427,32796,33210,33330,33456,33753,33879,
+33889,34094,34476,34592,34416,34544,34750,34702,
+34490,34578,34497,34605,34554,34373,34320,34422,
+34211,34392,34347,34451,34212,34537,34314,34162,
+34390,34340,34628,34823,34719,34620,34665,34635,
+34635,34560,34205,33960,33757,33600,33444,33373,
+33156,33117,33051,33056,33074,33066,33055,33132,
+33115,33254,33323,33456,33367,33524,33489,33789,
+33590,33822,33794,33786,33878,34097,34038,34133,
+34245,33975,33965,33888,33915,33961,34321,34305,
+33807,34148,32897,31942,20638,18879,19914,18873,
+18849,18972,22388,24388,23466,22446,24659,25515,
+26757,27589,28306,28829,29301,29403,29658,28179,
+25686,23841,22897,22459,22329,22581,26444,29628,
+24046,26078,22764,22037,21338,22254,22761,20865,
+22512,21795,20918,20730,20169,20317,19122,19608,
+19480,19809,20073,20206,20442,20949,21804,24494,
+26102,30084,27930,25647,26243,28034,26871,23091,
+17893,13266,20914,18108,17670,17464,17031,16829,
+16965,17016,16244,17820,17254,15918,15900,15444,
+15253,16356,16285,16063,16728,16797,17421,17610,
+15960,16383,16823,17110,17709,17937,17645,17886,
+17638,16963,17653,17699,17181,17557,17525,18046,
+17861,17772,18316,18824,18470,18807,18255,18603,
+19219,19485,19950,18985,19780,19654,20292,20268,
+20756,21204,28041,24915,25584,22596,22371,20451,
+20286,20890,21410,20656,20430,19898,19830,19741,
+19549,19749,19892,19872,20139,20219,20247,20471,
+20341,20202,20468,20749,21202,20995,20722,21302,
+21373,21686,22451,22314,22401,22139,21880,21522,
+21314,21744,22068,22413,22026,22306,22059,22323,
+22212,22247,22585,22853,22719,22816,22939,23626,
+22986,23429,23038,22940,22636,26215,23371,24376,
+24507,24642,26692,24441,24415,23791,24610,25088,
+24267,23985,23767,23827,22881,23934,23385,23614,
+23027,23084,23130,24148,23431,23695,23302,23523,
+24615,26245,26404,26102,31093,23113,25103,23490,
+22588,24028,22401,22207,21221,23556,22851,22689,
+23316,24016,22752,22638,22575,22212,22788,23995,
+23426,21074,21816,21896,22251,21960,22578,21954,
+22405,23439,22883,25134,22421,22365,21489,21213,
+20688,20710,20933,22235,22536,23034,21283,24388,
+25269,20225,20489,25878,21051,22808,22878,21579,
+22584,21591,20149,21234,20862,21029,20648,20249,
+15885,18360,32493,36171,38074,42987,46851,48053,
+45444,43994,45856,44598,42459,35217,34707,33856,
+33612,33578,33556,33484,33413,33360,33303,33253,
+33207,33180,33183,33158,33160,33454,33237,33282,
+33403,34069,33599,33924,35007,35438,35285,35745,
+35795,35676,35339,35487,35475,35987,32998,32945,
+32793,32716,32590,31820,31156,27443,26267,26052,
+26083,26155,25761,25438,25340,25204,24447,22164,
+22852,27224,20727,20264,20377,19854,20061,20060,
+19977,19898,19723,19127,18973,19479,18873,18681,
+18315,17990,17616,17859,17581,17461,17475,17440,
+17813,18425,18352,17518,17272,17860,17595,18738,
+21092,18872,18732,17455,18655,17905,18463,18649,
+20313,20490,20727,20863,21563,21498,21829,20613,
+21120,22383,23497,23984,22236,23465,23745,22755,
+21810,21534,20993,21177,20629,20173,20612,20922,
+20494,20079,19896,19571,19575,19242,19246,19404,
+19400,18784,18919,18855,18733,18566,18656,19010,
+17995,17250,16044,17779,17501,18853,18874,20380,
+23274,25091,27915,28632,30862,21359,18142,18459,
+18723,18538,18639,18785,19245,19307,19951,20802,
+22193,24839,28462,31751,32125,32485,34217,35056,
+36068,37544,36917,35612,36222,36043,36027,35976,
+35800,35728,35859,35922,35886,36031,36146,36333,
+36543,36696,36771,37128,37489,37486,37572,37786,
+37795,37731,37643,38059,38077,37261,35875,33765,
+33213,33023,31871,31046,31072,29937,29667,27559,
+26871,26896,24948,20081,20631,20244,20229,19740,
+19805,20036,20213,20145,20388,20385,20957,23289,
+25462,29122,31491,29932,27333,25950,24893,22695,
+19562,19426,18189,17955,17603,17190,17239,17184,
+17002,16719,16500,17224,17070,17484,17502,17364,
+17337,17294,17132,17301,17352,17677,17319,16769,
+17475,17609,20589,16849,17346,20172,20728,20514,
+18304,18992,19745,20333,21306,20346,20787,22713,
+20048,22143,23759,23052,23196,24492,24304,23133,
+24486,22581,22449,22600,21029,22602,21504,21201,
+20915,20805,20093,20411,21037,20493,21323,21248,
+20736,19611,20244,20237,19959,20051,19828,20094,
+19238,19626,19125,19543,20753,24245,27693,25463,
+23689,19305,19161,18516,18522,17639,18072,18531,
+19508,19050,18708,19341,19359,19044,19038,18449,
+18324,18207,17369,17157,17754,17601,18975,22439,
+22263,20092,20046,18465,17673,17555,17622,17880,
+18111,17900,18482,17709,16334,16904,18747,17031,
+16423,16099,17932,19281,20559,22775,25815,29862,
+31227,32595,32925,32993,33034,33451,33660,33844,
+34056,33994,34143,34377,34416,34527,34802,34645,
+34734,34623,34590,34563,34378,34346,34374,34421,
+34299,34284,34353,34430,34340,34553,34347,34383,
+34705,34788,34985,35098,34912,35006,35353,35122,
+35257,34713,34334,34206,33904,33751,33640,33381,
+33225,33207,33164,33102,33063,33096,33103,33132,
+33187,33524,33290,33288,33318,33563,33479,33571,
+33705,33817,33989,33983,33951,34233,34487,34333,
+34434,34161,34111,34017,34070,34159,33992,34141,
+34453,33387,32859,32763,22029,19057,18874,18805,
+19039,18924,19288,23771,22443,22780,24609,25593,
+26924,27817,28257,31329,31620,30698,29260,27741,
+25554,24109,23193,22602,22183,23050,28848,28662,
+26001,23576,23950,23801,22179,21791,21731,23852,
+20610,21513,20844,19257,19264,19737,19188,19335,
+19647,19890,20189,20176,20544,20843,24815,24756,
+25410,28596,27657,25791,27129,29741,29076,25119,
+20330,15228,19854,17630,18185,17431,16378,16477,
+16334,16375,16470,16257,16412,16206,16238,15877,
+16305,16080,16002,16020,16053,16761,17023,16528,
+16820,16394,16978,16941,18170,17607,18668,18252,
+17491,17893,18052,17466,17819,18002,18135,18033,
+17983,18294,18765,19236,19728,18915,18417,18796,
+19447,19750,20441,19817,19863,19041,18861,19836,
+21136,20712,27637,22131,21055,20877,20571,20043,
+20041,19644,20298,19735,19893,19890,19560,19695,
+19791,19711,20250,20556,20431,20084,20069,20265,
+20344,20563,20889,21230,21239,20886,20361,21208,
+20799,21299,21804,21971,21749,21999,21635,22134,
+21849,22090,21608,22110,23125,22179,22659,22836,
+22444,22666,23229,23020,24484,24939,22933,25487,
+27721,25546,23649,24164,22526,24522,24965,24655,
+24968,25514,23730,24156,23317,24460,23961,24484,
+24134,23592,23498,22995,23571,22604,22801,22853,
+22439,22990,22927,22689,23094,23307,22683,23268,
+22288,22620,22646,22764,24003,24083,28862,25371,
+22047,23220,21963,22671,22369,21274,25631,24701,
+23760,28172,24501,23824,23631,24441,21654,21356,
+21233,25299,23658,22648,26156,21613,22422,22010,
+22960,22597,28781,28974,22539,26957,26430,22918,
+25729,30641,26517,20661,21084,20763,21074,21295,
+20247,20731,21105,20655,21237,25872,21824,20032,
+21218,21955,20487,19694,20862,22570,21450,21679,
+17950,18906,32145,35958,38682,43329,46658,45906,
+42920,45784,45978,41149,38359,37031,34777,34102,
+33744,33666,33594,33510,33463,33386,33317,33284,
+33246,33202,33211,33177,33159,33276,33369,33959,
+33699,33882,33597,33917,34338,34422,34731,34764,
+35656,35749,35550,35442,35742,35753,33379,32970,
+32898,32812,32683,32584,32229,32106,27768,26949,
+26589,26528,26264,25859,25536,24408,24384,23793,
+22011,21281,20933,20557,20360,20242,20326,20331,
+20464,20325,19662,19119,19074,19007,18915,18453,
+18052,17484,17118,17331,17103,17258,17109,17019,
+17455,17886,17787,17429,17900,18371,18126,18326,
+18987,18949,19254,19259,19411,20910,18333,18465,
+19620,20694,21221,20930,20631,20280,21133,22118,
+22020,23265,23831,21748,23586,24448,22387,22034,
+21691,21126,21529,20605,20811,19152,19956,19451,
+19673,20252,19696,19326,18733,19002,18810,18897,
+19017,18230,18639,19095,18621,17649,17328,16728,
+17182,17484,16489,17692,17579,18042,17893,18990,
+20496,22602,25436,28869,29601,21131,19935,18566,
+18510,18683,18846,19136,19429,19755,20137,21226,
+22407,25129,28939,31808,32297,32646,34749,35253,
+36603,37336,37117,35917,36138,36256,36124,36019,
+35895,35823,35910,35949,35989,35935,36154,36348,
+36244,36401,36528,37052,37683,37414,36656,36948,
+37173,37242,37499,38042,38043,37216,36120,33780,
+33227,32969,31933,31675,31786,31941,29661,28434,
+27511,26815,25425,22096,20746,21530,20918,20661,
+20079,20217,20379,20490,20558,20691,21349,23588,
+26843,32506,32821,32571,30482,29180,26452,23644,
+19464,19137,18585,18086,17747,17654,17436,17442,
+17636,17605,18345,17688,17695,17178,17970,17844,
+17545,17511,17589,17511,17436,17455,17440,16035,
+17631,17492,18699,17448,18537,20840,17854,19679,
+18915,19266,19650,19924,20333,20133,19734,22397,
+22734,24129,24748,21892,22884,23937,23321,23188,
+23907,23421,23059,22187,22287,21519,20870,21108,
+20787,21007,20403,20859,19483,20592,20435,21174,
+21409,20892,21073,20461,20361,19944,19843,19386,
+19551,19159,19445,19519,20004,22667,26529,29094,
+25233,18882,19050,19215,19020,18150,18216,18225,
+18812,18597,18427,19608,18586,18334,17546,17827,
+17133,17438,17202,17073,17130,16402,17360,25642,
+27992,25182,20263,19180,18045,17423,17428,17583,
+17609,18684,18182,18443,17310,19452,17922,17992,
+16468,17159,20439,20931,21649,23668,27255,30510,
+32283,32675,32988,32994,33028,33297,33559,33759,
+33988,34100,34200,34268,34428,34730,34692,34687,
+34682,34659,34731,34471,34425,34375,34434,34377,
+34365,34313,34344,34254,34503,34587,34539,34592,
+34716,34847,34922,35037,35055,35041,34778,34721,
+34632,34544,34551,34336,33978,33660,33496,33362,
+33312,33242,33171,33113,33126,33135,33234,33153,
+33194,33318,33351,33375,33337,33421,33588,33683,
+33852,33788,34042,34044,34065,34180,34755,34377,
+35123,34328,34047,33718,33887,33831,33676,33758,
+33266,33188,32673,32814,22515,18873,20128,18884,
+19160,19340,19654,24129,24769,23429,25383,26663,
+27357,27936,28722,31410,30453,32506,32604,28028,
+25401,23942,22350,21893,22644,24446,29423,27300,
+28430,27726,24979,24714,24579,25077,21722,20161,
+22146,19804,21466,20302,19428,19158,19267,19534,
+19734,19778,19806,20103,20150,21555,24273,26487,
+25384,28616,29303,26532,28149,29298,30736,29937,
+21352,15126,16209,17346,17688,16900,16194,16539,
+16082,15594,15650,16366,16029,15657,15978,15809,
+16035,16083,16054,16155,16413,17082,17953,16578,
+16995,16455,17084,16788,17964,18916,18459,18724,
+17570,18105,18416,17828,18062,18391,18528,18694,
+18621,18000,18851,19218,19941,20401,18871,19478,
+19427,19500,19284,18784,18993,19154,18957,25521,
+19707,20159,21093,20351,26040,22104,19714,19702,
+19394,19339,19425,19401,19471,19358,19449,19675,
+19541,20049,20810,20226,20538,20448,20718,20542,
+20770,20871,21290,21109,21767,21050,20712,21106,
+21162,21570,21708,22612,22518,24427,22173,22623,
+22389,22941,22659,22894,22399,22775,23184,23154,
+23009,22965,23417,22545,24252,24214,23142,24042,
+24041,23043,24961,23898,24089,25033,24767,25725,
+24653,24012,24589,23239,23690,23383,24351,24494,
+24225,24066,23475,21978,22672,22551,22558,22420,
+23022,22554,22447,21950,22162,22551,22578,22939,
+22301,22811,22434,22407,22697,23799,26017,23380,
+24348,28920,24298,21762,22170,23572,22790,23251,
+24363,22957,20589,20978,24809,21381,24121,25102,
+24892,24375,24466,26317,22367,24081,21501,23386,
+26052,23473,21720,21753,23248,23421,24374,20376,
+20512,20733,20511,30027,25134,21016,21487,20871,
+19746,19860,19897,20643,20709,21141,20375,20186,
+21822,23444,22153,22437,20297,20999,21909,21699,
+17655,17659,28290,37240,39468,44946,46247,45651,
+45272,44463,45860,39903,40701,36188,35048,34313,
+33865,33713,33649,33549,33444,33390,33360,33315,
+33261,33229,33203,33192,33180,33531,33222,33555,
+33788,33647,33802,33786,34345,34978,35196,35747,
+35763,36217,35726,35719,35595,35805,33352,33584,
+32922,32861,32806,32737,32711,32637,30526,27414,
+26844,26302,26457,26496,25548,25116,24696,23808,
+23364,21493,21180,21055,20847,20573,20331,20424,
+20592,20455,19659,19084,18457,18717,18669,18288,
+17541,17322,17191,16806,16744,17049,17169,17128,
+17286,17333,17883,16722,18544,18479,18534,17611,
+18624,18872,19405,19842,18907,18429,19318,19505,
+19738,20901,20678,21042,21155,21004,21448,19813,
+21826,21417,21652,23670,24940,23763,22950,21731,
+20758,21174,22046,19966,20603,20324,19590,19125,
+19389,19757,19043,18519,18672,19117,18480,18414,
+18577,19015,18214,17726,17960,16563,17362,17874,
+17139,17367,16998,17508,18420,17613,18089,18031,
+18686,21031,23361,30210,29605,26364,23102,18951,
+18595,18729,18988,19599,19614,20063,20623,21529,
+22956,24926,28562,32042,32455,32724,34867,37389,
+36782,37365,37266,36168,36488,36279,36210,36162,
+36043,35982,36011,36076,36037,36039,36047,36106,
+36246,36421,36729,36758,36163,36768,36192,36018,
+36126,36519,36249,37652,38370,36702,34573,33735,
+33196,33066,33045,32716,32304,32539,31551,28123,
+26775,26574,24226,21838,22692,21920,21555,21286,
+21060,20936,20772,20710,21198,21114,21690,24258,
+32190,33426,33357,33443,32343,32773,32836,22978,
+20064,18960,18564,18289,18051,17885,17795,17766,
+17729,17489,17960,17211,18003,18131,18157,18185,
+18105,17995,18193,17581,17432,17323,17417,17902,
+18599,17871,18675,17931,17942,19551,18921,19576,
+20061,19531,19617,19977,20081,20731,20640,21684,
+20525,21687,23694,23903,24279,22534,23070,23245,
+21872,22383,22374,22098,22273,20939,21934,21318,
+20766,20868,19962,20912,20532,19479,20186,19893,
+20623,20436,20025,20451,20146,19845,20038,19059,
+19849,19047,18893,19289,19443,22365,26725,28195,
+23541,18396,18667,18890,18607,18221,18138,18454,
+18693,18398,18602,18222,18276,18237,18069,17726,
+17786,17193,17013,16810,16939,15869,16179,16815,
+19977,22607,20193,19215,17673,17252,17196,17259,
+17277,17895,18582,16234,18069,16757,18842,18904,
+21200,22032,21735,21582,21986,24633,28702,30364,
+32457,32670,32766,32976,33123,33333,33547,33655,
+33941,34096,34247,34408,34499,34501,34614,34792,
+34803,34953,34782,34619,34560,34383,34360,34374,
+34410,34290,34260,34213,34371,34365,34536,34588,
+34700,34989,35118,35250,34789,34821,34553,34476,
+34417,34322,34186,34173,33972,33831,33528,33449,
+33399,33329,33216,33165,33153,33228,33282,33242,
+33195,33236,33260,33442,33385,33381,33451,33568,
+33934,33988,34020,34162,34232,34510,34789,34889,
+34841,34186,34308,33819,34104,34155,33895,33474,
+33190,33041,32971,32494,20861,21135,18759,19033,
+19240,20460,22404,25739,25740,24182,26493,32825,
+28103,27723,28705,29131,31313,29643,28668,26208,
+24951,23763,22252,22131,22578,24524,27780,29036,
+26561,26973,25964,25863,25107,21201,21273,20760,
+20744,20377,19174,19808,19778,19135,19178,19733,
+19542,19525,19897,20148,20511,21925,23708,25732,
+26202,30206,29985,27296,29062,28818,29280,31111,
+20639,11712,15169,16506,16793,16643,16296,16249,
+16323,15684,15861,15482,15646,15162,15594,15420,
+16016,15894,15801,15816,16521,16594,18071,16604,
+16466,16461,17226,17624,19170,17613,17967,18135,
+18246,18486,18018,18815,18426,18881,18882,18711,
+18406,19750,19442,18329,18968,19410,19287,18155,
+18884,18756,18940,18209,20281,21103,19718,19594,
+19281,20439,21497,22125,25011,19938,20082,19146,
+18892,19272,19594,19234,19122,19378,19488,19591,
+19607,19972,20797,20916,20685,20534,20437,20650,
+20932,20829,21846,21705,21445,20763,21239,21096,
+21705,21756,22018,22656,22054,22314,22545,22006,
+22805,22968,22368,21859,24776,21858,26202,26123,
+24115,22418,23424,23151,27240,22551,23577,22773,
+24042,29241,22527,22784,24492,24292,24993,25431,
+22768,23515,23480,23036,22701,22644,23372,23934,
+24147,23797,22506,22365,21957,22089,21792,21926,
+21371,21601,21837,21690,22342,22361,22446,22208,
+22317,22529,22066,22307,22536,22518,21978,22346,
+21974,22089,22330,21432,22184,21459,22533,23970,
+21968,22533,28230,21890,23692,22184,23284,21151,
+21564,20897,21822,25738,21786,21491,21674,22822,
+21464,22189,21334,22073,22167,24428,27261,21392,
+21744,22009,23259,21856,20489,21167,20515,20596,
+19870,19965,19559,20066,19791,19551,19751,19664,
+20358,20976,23158,22778,20968,21111,19769,20384,
+18207,16473,26934,39528,38817,42343,44629,44761,
+43317,45230,45300,43458,41377,36618,37725,34365,
+33825,33642,33606,33523,33433,33408,33368,33345,
+33354,33354,33240,33216,33209,33159,33272,33804,
+33773,33786,33900,33851,34488,34801,34355,34850,
+35725,34739,35529,36165,36234,33917,35094,33638,
+33168,32851,32891,32753,32815,32718,32563,30809,
+28517,27562,27157,26661,26173,25144,24573,24084,
+22852,22357,22010,21470,21051,20859,20645,20570,
+20690,20567,19944,19141,18555,18471,18153,17908,
+17285,17084,16955,17582,16774,16890,16464,16560,
+16900,17038,17562,16844,18493,17683,17401,17928,
+18416,19363,20166,18785,18725,18501,19539,19548,
+18747,19258,19880,20602,20177,20508,20718,21089,
+20914,22005,22576,23264,24864,21891,23125,22967,
+22395,21819,21049,20901,20293,19110,19760,19344,
+18809,19392,19042,18546,18834,19005,19059,18000,
+17361,17341,18955,18369,19272,18102,18202,16738,
+17160,17530,16938,17448,17589,17498,18066,17802,
+18379,21765,24234,28077,29133,27168,22606,18824,
+18933,18856,19130,19473,20064,20340,20850,21942,
+23587,26083,29640,31920,32554,32781,34827,35247,
+38291,37083,36753,36218,36577,36393,36348,36282,
+36201,36149,36225,36329,36213,36147,36195,36156,
+36304,36659,36659,36238,36356,36081,35909,36549,
+37206,36128,35797,36807,36159,37111,34328,33915,
+33540,33117,33105,33227,33108,32989,32798,29625,
+26524,26263,22638,23415,23211,22463,22365,22049,
+22121,21922,21507,21294,21974,21906,21969,26485,
+33450,33591,33848,33713,33930,35819,32980,24003,
+21111,19526,18990,18611,18340,18072,18450,18236,
+17814,17856,17677,18452,19030,18772,18366,18037,
+18351,18138,17842,17823,17785,17913,17681,19351,
+17664,19625,19040,18631,18267,21237,20234,19788,
+19576,20241,20457,20811,20226,20974,21550,22173,
+23549,22227,23103,23813,24146,21786,23189,23347,
+22211,20946,22498,22219,22011,21151,21074,19753,
+19849,20807,20475,20412,21553,19968,19840,20672,
+21313,20244,19997,20015,19925,20115,19936,19773,
+19826,19288,19053,19055,19406,21499,26158,27837,
+22446,18114,18591,19006,17910,18026,18013,18174,
+18360,18176,17988,17655,17718,17737,17829,17965,
+17133,16895,16643,16650,16470,16350,16201,16251,
+18609,20338,18933,19902,18041,16716,16851,17371,
+16881,17367,15558,23765,17115,16884,18631,21738,
+24795,25361,23385,20610,21219,24618,28481,30355,
+31638,32714,32988,33039,33180,33396,33479,33782,
+33900,34252,34432,34678,34518,34872,34882,34848,
+34685,34692,34662,34485,34590,34341,34377,34452,
+34281,34290,34349,34275,34245,34465,34186,34625,
+34577,34699,34700,34641,34508,34401,34482,34579,
+34608,34560,34259,34251,34124,33846,33691,33577,
+33502,33417,33303,33247,33198,33180,33215,33218,
+33272,33259,33435,33483,33618,33542,33534,33576,
+33738,34237,33824,34131,34445,34683,34673,35661,
+34563,33737,33540,33453,33790,34182,34021,33492,
+33051,32961,33006,25281,20790,20094,19587,19460,
+22649,24996,24509,26194,25301,24710,25053,31103,
+28101,28234,28568,29264,29251,29217,27373,24993,
+24488,25245,21929,22092,22755,25541,28896,29499,
+29334,27144,26994,26379,24534,21225,21163,22610,
+20206,20676,20447,19542,20026,19309,19605,19203,
+19985,19629,19720,20113,20362,21468,23043,26663,
+26339,28613,30334,26661,27392,26985,28548,30988,
+21576,10064,12522,15761,16169,16405,16459,15802,
+16090,15639,15674,15894,15585,16461,16141,16178,
+16054,15824,15735,15408,16702,17181,16763,16705,
+17066,16862,16794,18093,18095,18213,18900,17921,
+18168,18625,18742,18897,18774,18622,19065,20412,
+18327,18031,18296,18493,20410,18822,19104,18688,
+18897,19369,18816,17715,18179,19740,20814,23327,
+29091,24153,23554,20001,19884,18872,19730,18618,
+18814,19467,19975,19011,18868,18990,19719,19535,
+19872,19692,20243,20568,20529,20547,20461,21201,
+20684,20762,21741,21191,20837,20800,21354,21937,
+21948,21999,21642,22106,23260,21740,22618,27846,
+24071,24480,23352,23173,23350,24732,25914,23928,
+23749,23362,23436,22690,24019,23060,23376,22268,
+23842,23495,23878,23524,23769,24227,23851,23780,
+21638,23571,22249,22698,23488,22434,23125,23778,
+25801,23763,23095,22421,21894,21912,22146,21749,
+21538,22022,21762,21517,21474,21773,21742,21787,
+21867,21600,21784,21676,22548,21446,21903,21990,
+22392,22629,22340,21983,22798,21978,21962,21987,
+22305,22230,20877,22537,22682,21630,21804,21065,
+21621,21906,21199,20947,21321,21847,21984,21138,
+21134,21949,23340,20263,20805,23715,21839,19901,
+22712,22046,21946,20175,20572,20710,20178,19981,
+19863,19787,19677,18988,18930,19382,19158,20208,
+19856,19931,20957,23241,22050,20674,20243,20140,
+17551,13985,26277,38900,36621,41274,42192,43598,
+45828,45260,49082,44939,45627,36285,34346,35602,
+33732,33555,33564,33535,33492,33453,33363,33365,
+33353,33267,33263,33223,33204,33181,33396,33598,
+33566,33789,33939,33837,33846,33939,34843,34830,
+34866,34785,35192,35839,35616,35718,36054,34986,
+33225,33502,32893,32902,32871,32783,32667,32519,
+32238,30866,29535,28427,27504,26225,24546,24006,
+23685,22865,22325,21942,21060,20872,20761,20822,
+20571,20558,20115,19621,19132,18895,18420,17931,
+17637,17305,17224,17421,16928,16634,16590,17052,
+17532,16227,17370,16935,18954,17775,17944,19343,
+18476,17969,18019,18929,19372,18464,19254,19989,
+19771,20092,20261,20217,20826,20490,20582,21111,
+21548,21618,23205,22568,25251,23018,23556,22924,
+21908,21234,21180,21720,20573,19900,19813,19632,
+19302,19262,18582,18268,18937,18675,18618,18169,
+18115,16145,17155,18096,16782,18152,17679,17456,
+17745,18177,18009,17655,17290,18474,17526,17505,
+19427,22615,24894,27752,28876,25113,22585,19248,
+18986,18905,19515,19757,20553,21070,21813,22676,
+23974,26961,30682,32109,32692,33531,34847,35757,
+37842,37056,36942,36600,36546,36573,36459,36468,
+36411,36318,36393,36384,36277,36222,36261,36288,
+36340,36456,36575,36113,35747,35580,35962,36977,
+36909,36666,36942,35867,35967,34438,34228,33816,
+33475,33104,33109,33105,33176,33129,33222,31162,
+27690,26277,23175,23434,23445,23337,23027,22938,
+22830,22719,22419,21144,22616,22766,22954,33060,
+33939,34046,34201,34807,34294,34996,33054,27984,
+22419,20537,20104,20248,18861,18129,18069,17797,
+17730,17678,18477,19140,18693,18624,19201,18198,
+19118,18822,18327,17975,17847,18081,18372,18228,
+19248,18216,19281,18450,19767,20717,19234,19934,
+19023,19790,20523,20440,20769,22636,20878,22086,
+21958,22248,24656,22935,23970,22427,23989,22941,
+22704,22788,21887,21445,21087,22340,21168,20896,
+21493,21062,20838,20549,20400,20069,21486,20113,
+20083,20412,19481,19868,20278,20379,20214,19972,
+20139,19494,19158,18946,19327,21234,25212,25203,
+21137,17862,18557,17429,17456,17652,17895,18141,
+19206,18597,17657,17524,17523,17507,17347,17194,
+17310,17038,17031,16683,16317,16307,16916,15774,
+17200,16284,18893,19496,18380,17000,16660,17313,
+17712,15732,20862,17162,15694,20829,23341,24913,
+24833,24551,24212,20167,20763,24635,27829,29945,
+31084,32591,32874,33024,33180,33526,33766,33900,
+34143,34124,34540,34427,34305,34488,34740,34910,
+34736,34723,34612,34690,34401,34372,34238,34266,
+34232,34212,34248,34290,34041,34413,34510,34472,
+34629,34324,34387,34384,34564,34794,34902,35334,
+34986,34875,34839,34498,34238,34138,33851,33714,
+33619,33475,33384,33306,33282,33229,33363,33279,
+33351,33265,33356,33633,33494,33597,33457,33584,
+33591,33679,33761,34026,34517,34434,34194,34045,
+33896,33670,33576,33369,33570,34307,33327,33217,
+32646,32957,31199,23988,21694,19919,20703,20441,
+25881,25626,25437,25413,25171,25146,25689,28353,
+27551,28449,29076,29904,29540,28602,26907,24720,
+24549,23767,22344,22478,22831,25481,29517,29055,
+27459,26321,26625,26640,21286,24465,21728,21332,
+20730,21581,20488,20027,20133,19527,19468,19409,
+19733,19833,19728,20269,20424,21561,22181,26107,
+26074,29085,31133,26261,27785,27475,28115,30981,
+26796,12119,8916,15176,15908,15905,16133,15846,
+15919,15918,15589,15807,15638,15927,16312,15984,
+15942,15855,15864,16026,15927,16306,16630,16802,
+16799,17622,17549,17984,18768,18321,18420,22388,
+19210,19589,19114,19437,19024,18439,18245,18323,
+18318,18577,18743,23393,19913,19194,18784,18781,
+18775,18615,18462,18212,19401,20026,18671,17805,
+25668,23307,20939,19696,19572,19664,19443,18688,
+18717,18818,18917,18827,18903,19105,18685,20054,
+19792,19527,19924,20292,20373,20831,20642,20833,
+21248,20611,21043,21778,24943,24059,21508,21226,
+24324,22369,24148,23751,22413,23998,22587,22747,
+23401,21804,23078,23047,22890,23209,23119,22989,
+23156,22663,22278,21800,23397,22911,22338,22287,
+24214,22425,22443,23304,22982,24306,23083,23973,
+24385,24141,23685,23410,22801,22514,22962,22938,
+24080,22507,22259,22083,22161,21933,21705,21661,
+22188,21636,21587,21513,21517,21572,21926,21560,
+21411,21420,21429,21319,21719,21600,21365,21279,
+21828,21287,21532,21177,21396,21114,20953,21166,
+21963,22329,22435,20916,21507,21744,21382,21632,
+21295,21118,20388,20535,20758,20952,20848,20430,
+21243,21584,21459,21655,22593,22559,22352,22659,
+21183,21828,23977,25295,19360,21330,20508,19672,
+19083,19961,19581,18998,19156,19382,19419,19839,
+19572,19187,25029,21004,22809,21118,21642,20268,
+18088,12210,25662,35365,35643,39630,42477,39813,
+46539,45653,44656,43171,45046,39644,34233,34285,
+33852,33508,33599,33558,33462,33412,33363,33326,
+33309,33281,33241,33198,33207,33157,33361,33499,
+33692,34056,33810,33889,33930,34210,34404,33969,
+34718,34936,35913,35016,34838,34840,34881,35223,
+35341,35742,35012,35802,33274,33134,32822,32715,
+32648,32616,32468,31356,31572,29329,26051,24406,
+23769,23214,23107,22484,21705,21234,20463,20743,
+20658,20417,20203,19787,19434,18859,18251,17965,
+17754,17535,17234,16913,16900,17042,16564,16364,
+16178,16596,17063,17187,17477,16034,17968,17235,
+18252,16486,16728,16947,17478,17550,18285,18620,
+18004,18136,18683,19593,20036,20332,20748,21487,
+21867,22541,21908,21997,25518,23728,24326,23262,
+21558,21626,21506,21273,19830,19419,19521,19730,
+18816,18408,18523,18789,18457,18060,18285,18657,
+18801,15962,16839,17263,17412,16588,16097,17232,
+18589,17571,17350,17215,17467,17019,17967,19311,
+21238,23627,26274,27759,26783,24792,21132,18969,
+19088,18333,19275,19864,20322,21257,22363,23783,
+25508,28095,31920,32351,32628,33972,34804,35932,
+38298,37546,37056,36785,36788,36684,36691,36659,
+36649,36653,36516,36497,36355,36389,36339,36282,
+36249,36194,36228,36294,35935,35817,35868,35676,
+36141,36293,36781,36972,35061,34353,33994,33903,
+33468,33252,33194,33120,33313,33454,33176,32608,
+27896,26724,24118,23811,23920,23880,23173,23259,
+23366,23087,22191,22830,22876,23279,23591,33261,
+33898,33960,34585,35149,36661,36045,33468,31769,
+25467,21045,21117,22317,20680,19046,18240,18007,
+17700,18741,19104,19180,19782,20765,20510,20116,
+18691,19007,19324,18951,18367,18498,18789,19263,
+20590,19492,19041,20745,20365,20137,19356,21091,
+20649,20891,21057,21551,20658,21236,22206,20886,
+21714,24215,26064,25179,23744,23737,21614,22674,
+20877,21692,21479,20415,21397,20286,21078,20617,
+21182,19919,20021,20118,20256,19731,19761,20073,
+19860,19640,19607,19783,19490,19927,20610,19714,
+19707,19980,19511,19296,19989,21690,24976,24022,
+21636,18959,18485,18059,16566,17534,17895,17827,
+17724,17836,17304,17273,17297,17469,17561,17507,
+17046,16329,16795,16047,16586,16536,16821,15118,
+15680,16454,20047,18532,18008,17793,16853,16727,
+16999,23127,18838,16163,16279,18504,21773,23749,
+24652,26519,22693,19385,19227,19629,23224,26907,
+30415,31764,32810,33066,33156,33534,33681,33945,
+34125,34350,34230,33934,34245,34614,34799,34842,
+34728,34710,34503,34467,34176,34068,34124,34258,
+34257,34205,34185,34128,34098,34394,34322,34293,
+34320,34344,34470,34557,34705,35120,35098,35277,
+35217,35347,35325,34710,34484,34434,34200,33930,
+33758,33623,33495,33404,33363,33285,33407,33314,
+33405,33328,33320,33510,33584,33795,33607,33512,
+33702,33740,33802,33966,34222,34145,34111,33761,
+33613,33886,33521,33218,33730,33465,33012,32920,
+32988,32007,30986,28551,29058,23970,22426,26036,
+27389,26491,26270,25914,25409,25269,25296,25737,
+26271,27556,28932,29691,28710,26982,25382,24841,
+25341,23496,22142,22286,24059,25608,30562,30162,
+28320,27013,27529,27160,24723,21253,20673,19886,
+20250,20808,20665,20384,19940,19815,19726,19607,
+19602,19797,19848,19902,20797,21502,23038,25612,
+25055,28465,30675,25516,26133,25662,24449,31470,
+29306,19486,2135,13397,15575,15636,15956,15609,
+15760,15891,15847,15852,15875,16076,15990,16055,
+15945,15726,16032,15890,16407,17160,20517,17458,
+17149,17530,17934,18640,21588,18903,18816,19055,
+19221,18835,18848,19197,19022,18375,18439,18305,
+18449,18665,18891,19818,19278,19643,19515,18790,
+19107,19526,24991,19046,24494,21715,21428,21510,
+20187,20313,18083,18352,20259,19728,18891,18486,
+18309,18469,18494,18691,18875,18921,19508,19671,
+19584,20383,20046,20394,20672,22638,22078,20647,
+20646,27844,26006,21315,20813,21972,22339,22926,
+22733,24108,23943,23346,24731,22553,22685,22290,
+21891,22068,22215,22465,22267,22116,22095,22172,
+22117,22360,22316,22469,22442,23263,22377,22889,
+22653,22485,22481,22272,22816,23428,23745,23726,
+24116,24352,23670,22832,22027,22089,22273,22558,
+23045,22545,22302,22200,21697,21863,21941,21677,
+21675,21440,21419,21390,21407,21426,21423,21501,
+21461,21245,21229,21348,21788,21578,20893,21317,
+21558,21267,21587,21285,20856,21466,20893,21068,
+21285,21777,21539,20916,21305,21434,21378,21246,
+20659,20740,18932,20136,20164,19718,20494,21552,
+20700,20734,20348,21619,21291,21138,22648,20838,
+21214,22572,24664,29008,20770,20986,21246,20016,
+19299,19263,19116,19035,19149,18587,19438,19477,
+19510,19482,19472,20439,21764,22200,22761,20751,
+19189,11001,26578,36664,36699,39478,41949,39797,
+46578,45862,44988,44362,46092,44011,36381,33852,
+33706,33688,33673,33636,33576,33521,33450,33369,
+33340,33312,33246,33208,33199,33367,33678,33559,
+34047,34329,33924,33925,33640,33831,33904,34230,
+34779,34783,34569,34583,34738,34528,34841,34834,
+34779,34835,35757,35370,35484,35785,33688,32751,
+32826,32767,32725,32641,32619,32702,27660,25214,
+24346,23787,23363,22237,21672,20701,20835,20499,
+20420,20328,20231,19979,19637,19026,18143,18045,
+18286,17779,17442,17265,17048,16975,16680,16772,
+16711,16389,16572,16105,16634,17794,16979,17831,
+18432,17999,16925,17487,17425,18177,18649,18729,
+18784,18857,18894,18834,19760,21002,20580,19382,
+20474,20580,21751,22776,24613,24516,22815,22146,
+20787,21564,20770,20596,20501,19281,19641,19635,
+19663,20168,19038,19098,18929,18073,17917,18603,
+16396,16740,16701,17373,18855,18798,16796,17372,
+17463,17307,17346,16941,17351,17607,18340,18782,
+20709,23501,25017,26187,26004,25833,20734,19431,
+29343,19557,19622,20154,20660,21582,22551,24099,
+25913,29431,31832,32592,32642,33614,34923,35713,
+37511,37899,37194,37353,36989,36834,36996,36885,
+36732,36699,36704,36590,36460,36350,36282,36173,
+36030,36016,36111,36195,35943,35838,35730,35445,
+35870,35709,35999,36126,34863,34414,34128,33819,
+33342,33314,33154,33121,33360,33441,33409,32235,
+28930,25698,23819,23484,24005,23679,23877,24384,
+22987,23721,22962,23556,23076,24447,27264,33342,
+34289,34487,34374,35224,37587,35067,33645,32993,
+26133,22213,20632,21666,18051,18186,18717,18078,
+17836,18863,19302,19606,20423,20607,20326,20146,
+19470,18876,20660,18714,18134,19025,20358,19845,
+19815,19125,19499,19166,19042,21318,20377,21428,
+21403,21141,21272,21678,20207,22446,21605,22356,
+23700,24392,24399,24350,23684,22534,22241,23106,
+20916,19809,20473,21147,21713,21397,21430,19625,
+21005,21100,19969,19431,20013,20025,19697,19059,
+19666,20047,18783,19500,19933,19619,19599,19879,
+20043,19917,19485,19447,19844,21307,22915,24537,
+22983,17644,18510,18378,17655,17922,17959,18352,
+18174,17910,17307,17152,17206,17413,17569,17695,
+17232,16866,16584,16299,16424,15805,16614,15968,
+15835,16253,16877,17881,17996,16923,16043,16776,
+20151,17664,18184,16408,16941,17654,21040,22062,
+23559,24393,22965,20337,18088,17811,18962,22464,
+28081,30155,32198,32916,33200,33387,33496,33665,
+33981,33690,33873,34395,34575,35406,35475,34770,
+34467,34540,34644,34406,34124,34002,34084,34205,
+34140,34188,34112,34181,34194,33969,34164,34334,
+34495,34313,34314,34520,34705,34740,34913,35340,
+35050,34968,34885,35110,35258,34968,34833,34053,
+33855,33713,33611,33579,33547,33408,33510,33378,
+33455,33535,33434,33477,33711,33768,33856,33587,
+33618,33714,33739,34068,34315,33945,34257,33753,
+33543,33455,33440,33639,33190,33211,32919,32991,
+32580,31916,31576,31962,31223,27525,26347,30855,
+27168,26652,27260,26368,25396,25408,25308,29749,
+26249,27828,28817,28651,27141,26499,26183,25908,
+25637,23619,22086,22549,25158,28499,30736,29665,
+29002,27402,28098,23533,23273,21492,18907,17118,
+17070,18988,19668,19898,20096,19575,20108,19946,
+19867,20121,20005,20422,21320,21985,23230,24283,
+25626,27911,29706,26589,24588,24962,24922,28233,
+30772,22456,15622,7485,14427,15268,15834,15930,
+15929,15900,15830,15491,16353,16421,16254,16177,
+15814,15816,16236,16714,16689,16684,17724,18735,
+17720,18404,18909,18442,18203,19009,19046,19388,
+20560,19011,19644,18536,18444,18108,19009,18560,
+18556,18741,19915,19897,20719,19919,24769,19006,
+18993,24445,20346,19182,19420,18831,18622,19066,
+18747,18637,18473,18947,18214,18336,17751,19829,
+19168,19640,19432,18855,18993,19497,19917,19462,
+20507,19668,20430,20679,20364,20889,20213,20457,
+20526,20873,21240,20494,26027,23475,23147,22779,
+23361,23855,23659,23202,22737,23113,22113,21854,
+21930,21641,21498,21664,21584,21747,21832,22067,
+21944,21939,22056,22545,22770,22658,22491,23071,
+22965,22441,22761,22970,23212,22779,23280,23364,
+22653,23409,23459,23998,23147,22320,22377,22556,
+23752,22515,22051,22365,22071,21981,21765,21621,
+21355,21498,21348,21175,21342,21491,21388,21279,
+21276,21187,21153,20917,21457,21043,20958,20934,
+20947,21218,21561,21540,21030,18694,21074,20882,
+20929,21345,21165,21396,21031,21538,21608,21360,
+22568,20622,20429,20542,19990,20199,20694,20836,
+20853,20670,20681,20498,20816,20724,21922,22079,
+21295,23816,24834,21557,29802,20755,20323,19846,
+18913,18671,18764,18607,19212,18730,19027,19755,
+19257,19161,18820,19590,20978,21994,23045,23614,
+18685,11118,23755,35143,37344,38253,41035,41356,
+46778,47181,46779,45174,43530,43557,36255,34690,
+34121,33666,33572,33524,33609,33562,33468,33399,
+33349,33339,33233,33234,33254,33447,33504,34662,
+34205,34329,34188,33933,33870,33801,34157,33922,
+34179,34054,34144,34458,34560,34842,35190,34444,
+34690,34818,35744,36515,35921,34552,38094,36069,
+33222,32995,33325,33225,32960,32797,32698,30063,
+25260,24369,23573,22810,22080,21675,21061,20820,
+20433,20309,20176,19665,19562,19091,18679,18916,
+18775,18333,17723,17376,17097,17005,17250,16899,
+16743,16507,16540,17138,16425,16681,16845,15806,
+16288,16233,16529,16597,17467,17736,18079,17797,
+18523,18923,18672,18972,19346,20153,21255,21217,
+21103,21050,20734,21567,20949,24093,22751,24123,
+23670,22486,21474,21194,20409,20110,18975,20138,
+19518,18819,17396,18954,17940,18402,18354,18133,
+17337,16635,18165,18294,17941,17898,18063,17463,
+16482,16170,16301,17251,17192,17942,17996,18229,
+18716,21840,24403,25719,25742,25935,26817,19667,
+19786,19606,19847,20268,20997,21822,22203,24132,
+25913,30072,32026,32595,32707,33669,34578,36888,
+37724,38324,38536,37608,37236,37191,37187,36851,
+36736,36709,36593,36466,36261,36131,36039,35994,
+35960,36022,36147,36345,36748,36621,35777,35592,
+35476,35263,35301,35188,35979,35214,34194,33831,
+33561,33273,33201,33348,33413,33375,33186,32360,
+29275,25968,23646,23286,22916,23208,23472,22992,
+23335,23185,22863,23868,23589,25242,32085,34164,
+34909,34968,35524,35784,35842,34747,33793,33047,
+27055,22633,21579,20476,19054,18746,18546,20800,
+18495,19816,19514,19788,20213,20154,20277,20835,
+20167,19116,19375,18057,18630,18121,18422,20945,
+20099,20429,22641,20599,21246,21185,20931,20590,
+20532,20172,21960,21147,21441,22174,22383,23275,
+23751,23919,24374,23960,24567,21905,22158,21261,
+20910,21253,19755,19694,20524,20249,20417,19780,
+20882,20549,20153,19341,19742,19444,19500,19197,
+19205,18644,19256,19401,18597,18633,19044,19407,
+18079,19463,18720,18948,20476,20142,21999,22844,
+21177,18041,19403,17616,17437,18492,18841,18993,
+18578,17971,17340,17120,17156,17322,17732,17979,
+17532,16856,16458,16181,16067,16213,15735,16029,
+15783,16061,20325,19784,18212,15100,22344,16328,
+19609,22435,19776,19143,19999,17467,22322,21126,
+20274,20691,20879,18169,18087,17715,17910,18564,
+22857,29149,30321,32988,33210,33189,33374,33448,
+33484,34404,34279,35414,35385,35137,34625,34263,
+34273,34520,34380,34293,34230,34020,33861,34059,
+34055,33966,34101,34049,34227,34031,34308,34290,
+34197,34132,34173,34292,34438,34594,34650,34665,
+34699,34783,34989,34867,34834,34737,34455,34233,
+33999,33841,33776,33844,33559,33459,33480,33524,
+33531,33510,33552,33473,33513,33705,33987,33741,
+33719,33693,33750,33993,34121,33935,34013,33855,
+33979,33483,33300,33338,33147,33409,32889,32987,
+32664,32510,32302,31965,31349,27178,23658,26538,
+26658,27112,26564,26369,25407,25823,27972,28471,
+27009,27292,29983,28533,27243,26919,26518,25787,
+24419,22329,22254,23605,25957,32990,31809,30675,
+27758,28133,26871,22923,19314,21774,21482,23288,
+20032,22980,18738,22998,16901,19893,21291,19743,
+20215,20235,20287,20289,20734,21539,21988,24779,
+25240,27639,30828,28269,25179,25604,25484,27560,
+30433,31686,20263,12881,12991,14994,15792,15884,
+15963,15869,16021,16134,16122,16338,15891,16560,
+16251,16131,16097,16099,16528,16683,17256,17776,
+18001,18479,18497,19797,18796,18462,18810,19242,
+19266,19225,19140,19104,18602,18150,18291,18424,
+18945,19137,19160,19250,19437,19203,19659,18200,
+18943,21522,20817,18330,18876,18657,20413,18820,
+19200,18414,19478,18616,18898,20098,20187,23769,
+20145,19550,19884,20565,20771,19997,19907,20088,
+20938,23010,32575,23214,21531,21348,21384,20785,
+20481,22200,23211,25364,23041,22197,22093,22245,
+22067,21739,22012,22449,22640,22031,22024,21501,
+20739,20934,21325,21120,21470,21609,21538,21684,
+22062,21947,21861,22233,23164,22933,22338,22422,
+22597,22646,22509,22455,23061,22954,22943,23720,
+23168,23616,23787,23508,23175,23486,22670,22233,
+22425,22020,22736,21942,22135,22170,21965,21525,
+21438,21393,21350,21440,21480,21417,21435,21205,
+21109,21078,20904,21066,21110,20964,20825,20891,
+21015,20784,20678,21162,21469,21060,20652,20854,
+20732,20985,21235,21148,22169,20961,21067,21123,
+21187,20886,20604,20907,20702,20473,20987,20673,
+20605,20507,20697,21241,20877,20578,20621,19641,
+20205,23847,27652,25725,21410,27993,19941,20943,
+19995,18891,19202,19301,18867,18743,19019,19120,
+20150,19038,19293,19251,23520,20412,21025,20250,
+19813,10629,23976,31813,36924,38282,40807,42471,
+46011,47621,47502,45929,43998,46055,38988,36258,
+34702,33839,33729,33670,33647,33559,33456,33381,
+33336,33338,33234,33234,33344,33456,33525,33922,
+34860,34167,34004,33915,33905,33915,33658,34068,
+34034,34142,34434,34349,34915,34516,34377,34791,
+35246,34824,35181,35739,35882,37711,38034,34855,
+34823,34857,36700,36469,33091,32885,32832,32406,
+28055,25786,24887,23004,24011,21456,21276,20406,
+20128,19944,19528,18745,19284,19383,19485,19356,
+19439,18572,18000,17520,17264,16687,17146,16880,
+16712,16156,16608,17066,17123,17247,17454,17024,
+16584,17112,17083,16632,17314,17678,17491,17528,
+18019,17574,19419,19128,19379,19363,20617,20484,
+20384,19845,20419,21196,21030,23646,22027,20492,
+22494,23211,21229,21510,21099,20572,20091,19950,
+19361,18591,17788,17295,18108,19252,19125,18930,
+18388,18051,16615,16435,18008,17696,17641,17376,
+16931,16321,16286,17064,17163,17307,17571,17998,
+18264,19761,22935,24639,25762,24534,25074,24913,
+19794,19893,20179,20604,21291,22260,23561,25444,
+27784,31197,32306,32781,32784,34144,35067,35831,
+36178,37317,38547,37836,37641,37540,37500,37314,
+36755,36568,36378,36259,36117,36030,36010,35930,
+35916,36049,36173,36300,36540,36579,36131,35806,
+35416,34952,34624,34811,34362,34149,33930,34197,
+33600,33386,33299,33566,33495,33327,33185,32268,
+29380,25900,23432,23214,23178,22808,23504,23982,
+24574,23490,22953,24279,24302,27042,32991,33527,
+34530,35232,34662,36359,35293,35878,35064,33072,
+31170,23966,21284,19296,18638,18082,18047,18086,
+18448,20093,19638,19522,20055,20529,21188,20553,
+20680,20305,18723,19645,19779,19580,20793,20239,
+21580,19084,19665,21354,20379,21109,19913,20658,
+20138,20733,21097,22320,21713,22563,22808,23784,
+23605,25289,23813,24536,22321,23757,21365,20945,
+20230,20854,21464,20298,20325,21093,20091,19743,
+19751,22537,20012,19994,18618,19543,19071,18378,
+18327,18251,18815,18853,18490,17819,19257,18896,
+19111,18729,19265,19008,18934,22121,22557,23004,
+22223,17034,19503,18264,17241,18426,18453,18592,
+18396,18036,17704,17322,17327,17219,17889,18196,
+18056,16998,16629,15577,15572,15881,15468,15798,
+15567,15048,18016,18024,15321,18047,15855,24726,
+25561,26851,24180,23361,21206,20784,23753,22548,
+18732,18918,19765,17502,17040,17814,17907,17901,
+19296,23826,27960,32181,32805,33055,33179,33366,
+33711,35108,35080,34864,35088,34224,34319,34533,
+34431,34363,34213,34153,34091,33780,33866,33800,
+34025,33939,34067,34011,34203,34244,34349,34112,
+34138,34092,34148,34310,34554,34983,35100,35020,
+35045,35347,34795,34600,34688,34458,34278,34120,
+33965,33753,33630,33540,33517,33480,33810,33765,
+33732,33619,33712,33635,33570,33503,33591,33805,
+33678,33740,33720,33918,33983,33667,33749,33864,
+33616,33430,34081,32904,32978,32954,32817,32809,
+32979,32979,32403,31739,29636,24325,30039,25256,
+28088,27718,26646,25983,26109,25560,32746,26178,
+26229,27597,27717,28166,27792,27442,26466,23908,
+22665,22398,22628,24191,32973,33949,31382,26670,
+26841,31624,27308,15612,18039,24870,27530,27050,
+23069,27737,26504,25901,20485,28241,19379,22314,
+21163,21065,20584,20684,20740,21306,21621,22560,
+26687,27122,30062,27339,25284,28023,26265,25990,
+29828,32134,25313,18488,7251,14558,15240,16227,
+16423,16176,16491,16624,16554,16623,16590,16671,
+16580,16659,16451,16556,17379,17247,17128,17508,
+17676,18314,18813,18879,18561,19923,19382,18732,
+19656,19953,18902,18639,20577,17897,17827,19227,
+18801,18629,26578,19344,19413,19194,19043,19311,
+19128,19585,19146,19892,20199,18840,18340,19119,
+19762,18948,18800,18999,19932,19927,19851,21083,
+19206,19842,19958,20223,20212,19176,25369,23380,
+20191,22155,30813,24580,22818,22048,23946,25479,
+25269,25964,22217,22155,22317,21652,21678,21950,
+21894,21699,21719,21636,21341,21277,21098,20983,
+21789,20731,20660,21441,21196,21293,21096,21194,
+21633,21765,22454,21730,22329,22464,22632,23251,
+22629,23062,22812,22581,22658,22990,22890,23255,
+23023,23563,23729,23435,23598,23043,23143,22732,
+22655,22254,22782,22389,22139,22037,21723,21764,
+21444,21214,21419,21511,21405,21839,21439,21339,
+21154,21000,20874,20808,21151,20928,20982,20766,
+20736,20802,20696,20733,23393,21081,20531,20506,
+20764,20955,20609,21943,21294,21201,21009,21184,
+20671,20867,21152,20685,19572,20219,20877,20605,
+20673,21162,20671,20749,20240,20484,20486,20520,
+22003,23557,23311,26270,27178,26942,20367,20928,
+20048,18999,19443,18981,18930,18857,18951,19675,
+19271,18696,18941,18765,18987,19225,19922,19841,
+19176,12339,22809,31388,37462,37758,43299,47122,
+46535,45294,45477,43302,44805,43602,38579,36521,
+35776,34492,33854,33744,33669,33521,33446,33408,
+33321,33284,33228,33227,33362,33808,34225,34129,
+34895,34362,33952,33891,33899,34113,33938,33644,
+33910,33914,34281,34282,34389,34356,34404,34887,
+34825,34875,36647,36633,35591,35748,36322,36812,
+35498,34958,34491,33864,35703,33003,32943,32853,
+28107,26383,25467,22596,21882,20941,20903,20326,
+19847,19632,19525,19504,19711,19595,19594,19587,
+19365,18989,18201,17847,16929,17070,17387,17292,
+17198,16765,16626,16946,17404,16587,16539,15990,
+16503,17021,18463,18321,18601,19052,17488,18747,
+17685,18144,18793,18777,20473,20873,20634,20466,
+20272,20203,20509,21724,20788,21822,23193,23807,
+22121,23754,22596,20724,21420,20523,20315,20008,
+19114,19063,18310,19101,18847,17589,19058,17373,
+17362,16842,16098,16822,17393,16536,17371,16623,
+16950,16988,16491,17532,17010,17347,17804,18129,
+18456,19254,20379,22803,22993,23629,23618,23651,
+18949,20228,20527,21066,21811,22794,24523,26475,
+28833,31836,32516,32669,33528,34481,36243,36776,
+36911,37633,37539,38124,37951,37653,37418,37137,
+36906,36758,36528,36346,36210,36042,35951,35901,
+35893,35927,36080,36211,36321,36097,35950,35679,
+35465,35165,35013,34783,34743,34484,34299,34344,
+33923,33528,33408,33484,33507,33295,33063,32002,
+29494,25624,24016,23465,23370,23529,25560,25619,
+23982,24069,23317,24132,25053,26666,32793,33146,
+34009,33531,33784,34995,35221,36192,36528,33482,
+32951,26212,21352,19245,18474,18200,18291,18042,
+18027,18026,19813,21210,20027,20762,23280,24096,
+21452,20650,19557,20758,22377,20259,21207,20218,
+21564,20726,20989,20589,20253,21423,21401,21606,
+23580,22180,22139,23617,22348,23454,23366,23406,
+24348,24998,25032,23890,22768,22621,21871,21417,
+20757,21785,18888,20040,20916,20737,20890,20410,
+20323,18708,19411,19707,19166,18831,19259,18897,
+18279,18359,18339,18321,18701,18555,18352,18606,
+19098,19273,19009,18807,21056,20922,22699,22999,
+22374,19560,18597,17765,18102,19016,18915,17871,
+17855,17878,17505,17691,17568,17403,17917,18206,
+18287,16893,16341,15879,15267,15703,14784,15086,
+14832,14743,16117,15909,17073,18175,22346,25064,
+27135,24392,21424,19181,18174,19122,21026,21386,
+19341,23205,18415,17826,17715,18170,17850,17862,
+19344,23245,28073,29907,32988,32993,33057,33252,
+33545,33955,33953,34175,34386,33827,33954,34029,
+34125,34230,34004,33873,33875,33828,33783,33800,
+33966,34047,34140,33890,34061,34212,34145,34151,
+34170,34136,34247,34230,34443,34557,34599,34674,
+34692,34685,34545,34446,34542,34470,34181,34095,
+33929,33883,33798,33740,33508,33598,34011,33975,
+33925,33954,33880,33795,33540,33594,33756,33956,
+33756,33876,33784,34199,33878,33567,33585,33825,
+34103,33545,33828,32993,32989,32817,32979,32992,
+32992,32979,32763,32969,29366,23580,23124,23436,
+29027,30009,28986,29094,27710,25833,28712,27193,
+26589,27569,29147,28932,28319,30507,25708,22275,
+22342,22548,25247,32997,35710,31007,26370,27495,
+29836,28604,17625,20770,24099,26030,24581,24835,
+23520,23654,24080,24672,24220,30708,27039,25622,
+22218,21892,21159,20657,20683,20752,23340,22343,
+24795,27923,29550,28959,25396,25440,27708,26017,
+28905,31893,28626,23805,10932,12223,14629,16399,
+17495,15796,16265,16578,16600,16725,16545,16497,
+16206,16728,16899,17053,17409,17424,17013,17388,
+17537,18019,18350,19102,18939,19417,18726,19568,
+32708,19620,18812,18884,18899,18467,19707,18357,
+19548,20873,19323,18740,19057,19550,19758,20967,
+19562,19186,28401,19045,18981,19134,18753,18288,
+19359,18495,19376,19242,18704,19429,20331,19944,
+20377,19648,20187,20709,19673,20324,22253,21885,
+20553,21174,20280,20380,19747,26265,31929,27808,
+23092,21570,21715,21204,21045,22416,21102,21450,
+21395,21516,21673,21051,20859,20375,21981,20616,
+20952,20435,20993,21038,21510,21612,21099,21212,
+23416,22230,22170,22421,22361,22825,22690,22506,
+22351,22839,22710,22494,22850,23137,23237,23233,
+23062,23610,23466,23909,23313,22674,22878,22737,
+22646,22856,22702,22348,22309,22167,22071,21476,
+21579,21497,21335,21473,21718,21449,21264,21227,
+20997,21077,20952,21122,20921,21113,20570,20439,
+20701,20978,20824,21172,20950,21189,20415,20737,
+20930,21072,20909,21406,21268,22522,21628,20694,
+20482,20626,20528,21002,20922,20334,20280,20412,
+20457,20382,20358,20122,20315,20392,20005,20448,
+20934,21885,23107,24175,26915,28126,21304,20307,
+20011,20382,18983,17010,19525,18375,18899,18873,
+18465,18358,18797,19094,18608,19734,19998,20715,
+20424,13600,25227,32307,35484,37138,45041,44689,
+45408,44310,44684,45914,44185,40308,40920,37299,
+34885,34223,33984,33847,33740,33592,33450,33426,
+33365,33285,33222,33228,33287,33786,34656,33693,
+33979,34368,33992,34101,33990,33919,34128,33943,
+33975,33956,34275,34200,34205,34372,34806,34766,
+34833,35756,35725,35631,35642,35742,35758,36072,
+36386,34717,34683,34412,33435,33199,32952,32583,
+27775,26430,24924,22833,22241,21195,20640,20091,
+20158,20034,19928,20270,19845,20149,20784,19795,
+19703,19143,18866,17880,17238,17414,16865,17505,
+17193,17064,16119,16863,16785,17274,16943,17568,
+16672,17570,16947,17553,17295,17309,17547,17349,
+18670,19197,19582,19383,21192,22665,20197,19864,
+19149,19928,20908,22093,22641,22082,20974,23915,
+23318,21966,22933,20549,21552,21564,21041,21100,
+20187,20757,19337,17646,17389,18881,19248,18469,
+17749,18285,14990,17107,17704,18779,17364,16461,
+16368,16602,16602,16482,16543,16533,17253,17764,
+19002,20916,20055,20298,21111,22061,23448,24720,
+21705,20511,21171,21690,22580,24109,25168,28392,
+30249,31875,32622,33147,34731,35300,35829,36650,
+37146,37278,37173,37355,37668,37458,37292,37018,
+36669,36561,36525,36438,36278,36117,35967,35828,
+35751,35705,35836,35860,35856,36181,36015,35922,
+35803,35769,35343,35475,34989,34599,34270,34077,
+33832,33525,33548,33276,33204,33158,32988,31406,
+29064,27276,24475,23959,24032,24016,24657,25761,
+23507,23769,23637,24598,24525,26975,30559,32996,
+33597,34228,34515,34749,35055,36741,36930,34005,
+33053,27924,22092,19563,18816,18374,17838,18104,
+18146,18305,18609,20526,19912,22658,28619,35931,
+24752,20623,22102,18903,19864,20433,19355,20900,
+20075,20675,21008,21314,21246,20969,20961,22020,
+22625,23016,23326,23259,22706,23294,23767,23472,
+25429,24900,24702,23445,23084,23278,20647,20732,
+19720,20113,20006,20744,19901,20139,20206,20537,
+20982,20241,19126,18985,18556,18557,18673,18669,
+18782,18709,18321,18904,17505,18326,18853,18403,
+18826,18747,19311,19678,19727,21352,23444,24741,
+22937,18240,18858,18202,18322,18792,18468,17262,
+17589,18116,17981,17826,17619,17364,17666,17966,
+17946,16890,15447,15594,15315,14823,15219,15247,
+15995,15534,15204,15198,16761,17011,18249,21011,
+21990,21813,19202,17748,18216,17288,18588,19054,
+19276,18293,18214,17618,19485,17772,17824,19137,
+27661,27532,28578,30171,32104,32937,32953,32970,
+33342,33641,33421,33333,33498,33639,33612,33885,
+33921,33928,33911,33736,33881,33918,33893,33915,
+33945,33827,33937,34032,34132,34324,34076,34208,
+34152,34064,34159,34272,34220,34295,34328,34387,
+34463,34391,34385,34446,34231,34252,34395,33990,
+33867,33792,33725,33621,33538,33671,33942,34250,
+33885,33885,33507,33519,33543,33573,33793,33893,
+33905,34050,34040,33975,33740,33882,33779,33904,
+34010,33519,33020,32982,32844,32991,32991,32991,
+32993,32988,32073,30102,26884,23617,23388,32826,
+26700,26682,26510,29778,29977,32491,31830,26923,
+27008,30408,29556,30280,30594,25248,22616,22387,
+22278,27265,33864,32973,26357,26040,27303,29487,
+26269,17775,21701,25412,25975,25596,24181,25078,
+24963,23501,24436,23398,24819,22698,24062,24897,
+27964,22328,21548,22053,21886,22182,21605,22473,
+24135,27621,31571,30504,26100,25479,26049,26479,
+26256,28700,31368,28370,18902,7022,14566,15534,
+16023,15916,16212,16644,16618,16350,16083,16590,
+16325,17190,16722,17241,17601,17591,17178,17142,
+18503,17864,18410,19161,18157,18274,18324,19435,
+19097,18834,18680,19064,19549,19674,21405,19290,
+19908,19427,18736,19050,19095,19262,19578,20253,
+18953,19183,26558,20419,18053,18600,19350,19809,
+19401,19087,19788,19266,20356,19844,20711,20231,
+18664,23198,19926,19593,19799,19275,20211,20115,
+19302,25514,25259,22232,23215,20735,21874,20490,
+20496,20666,19529,20878,20991,20852,20711,21606,
+21363,25383,23796,20682,20738,20643,20625,21092,
+21240,20859,20681,21041,21304,21402,21148,21110,
+22277,22187,22041,22257,21864,22287,22346,22401,
+22359,22749,23065,23350,22746,22599,22926,22705,
+23235,23257,23280,23100,23481,23140,23059,22645,
+22641,22677,22452,22362,22182,21856,21576,21577,
+21735,21501,21418,21338,21301,21187,21186,21040,
+20910,20893,20904,20781,20952,21208,20829,20728,
+20689,20967,20952,21341,20791,20550,20461,20460,
+20785,21002,20634,22284,20899,21171,20706,20595,
+20667,21849,21239,20614,20451,19919,20208,19954,
+20278,20177,20138,20159,20031,19952,19975,20228,
+20647,21012,21071,22078,24920,25097,28119,22274,
+19872,19407,19439,19619,19027,18594,18240,19537,
+18648,18045,18507,18408,18282,19041,19112,19494,
+21459,12798,25591,32096,36187,38366,45282,45773,
+45766,43947,43953,45148,42199,40551,40986,35704,
+36910,35028,34352,34082,33789,33642,33541,33428,
+33326,33267,33240,33222,33196,33558,34462,33619,
+33687,33704,34424,34749,34213,34122,33916,33954,
+33963,34008,33942,34071,34389,34690,34704,34593,
+34983,35717,35588,35297,35372,35899,36096,36121,
+35739,34865,35673,35676,35176,33576,33532,32941,
+28140,26516,25786,24054,32931,24900,21753,20952,
+24897,26238,32895,23398,23946,20455,20223,22020,
+30552,19386,19015,18759,18176,21966,17929,17811,
+17330,17418,16848,16578,16215,16770,17181,16833,
+17165,17248,16883,16255,16537,16060,16046,17024,
+18398,18622,19354,19952,21692,20714,19389,19203,
+20724,21050,20547,21249,22535,20484,23057,23346,
+24112,23289,23284,21391,21222,21220,20398,20132,
+20289,20158,19148,18475,19694,19711,19534,17706,
+17157,16644,15319,15941,20018,16047,15792,16118,
+16100,16427,16290,16224,16680,16579,16691,16998,
+17393,20257,21175,19890,20124,20538,21466,24776,
+24744,31839,23385,24375,25411,27063,27416,29298,
+31479,32067,32733,33621,34794,35558,35859,36834,
+37358,37660,37137,36884,37077,37085,36966,36729,
+36517,36180,36059,36021,36177,36170,36000,35874,
+35757,35738,35704,35649,35684,36102,36403,36534,
+36582,36169,35873,35813,35343,35384,34467,34439,
+34254,33845,34002,33452,33225,33105,32742,32907,
+29102,27723,26281,24819,24732,24555,24020,23961,
+24450,24563,24834,23600,24030,27288,28855,31839,
+33351,33625,34127,34511,35533,37572,37849,34816,
+33399,30369,23316,20575,19102,18591,18243,18124,
+18074,18192,18113,21779,19876,22399,28765,28343,
+21549,20223,21826,21380,19672,20877,20295,21004,
+20840,20209,21428,20769,22396,22650,23289,23136,
+23498,23670,24171,24918,22287,24679,24462,24405,
+25102,24987,24321,23779,23089,22759,21846,20877,
+21125,21435,20044,18470,20016,19864,19813,19809,
+19096,19478,18903,18348,19305,18783,18538,18699,
+18629,18452,19527,18669,17751,17030,18228,18472,
+25416,19536,19340,19953,20377,21950,25020,26746,
+23050,19278,18217,18370,18835,23200,18331,18296,
+17075,17652,18315,17961,17718,17258,17457,17634,
+17572,16982,15885,15840,15140,14424,14943,14898,
+15231,16448,15116,15818,16424,16711,17083,16916,
+17694,18055,17678,16524,16362,16553,17360,17866,
+17785,17908,17864,17816,17688,18929,23019,28644,
+28834,30011,29838,29623,30207,32128,32962,32979,
+32969,33068,33016,33058,33157,33315,33252,33280,
+33415,33439,33735,33798,33732,33723,33851,33855,
+33959,34009,33856,34041,33818,34042,34006,33959,
+34095,34065,34046,34011,34124,34159,34174,34218,
+34197,34230,34272,34107,34083,34539,34155,33891,
+33870,33824,33662,33614,33659,33792,34175,34110,
+34006,33537,33402,33395,33433,33521,33649,33797,
+33976,34325,34344,33890,33663,33665,34119,33379,
+34233,33206,33007,32870,32994,32994,32988,32622,
+32551,32105,31235,27294,26478,23352,23540,28250,
+25025,26172,27770,27657,29826,32988,31248,26736,
+27883,30321,31253,29850,25358,22212,22263,22131,
+31637,34254,32948,26168,26412,28061,33002,21376,
+20295,13709,24283,27829,29047,25596,22953,24600,
+22613,23426,23388,24189,24576,23760,24702,22938,
+25841,25122,26238,23697,23271,22650,21467,22692,
+24532,27873,28406,29876,24849,25602,25401,25703,
+26183,28516,32988,28949,19858,6877,13656,15588,
+16125,16143,16422,16839,16708,23175,17523,16305,
+17264,16428,17490,17446,17494,17655,17407,17360,
+16802,17853,17756,18793,18428,18146,18629,18795,
+18900,19371,19278,19840,19994,24834,20426,19763,
+19243,18873,18541,19172,19158,18975,19604,20476,
+19476,20733,21641,20103,18504,21879,18895,18736,
+20582,20960,19285,19226,19956,20439,20088,19910,
+21412,20065,21083,19926,19491,20366,20711,19353,
+24324,24404,21643,20534,21436,20977,21264,20982,
+20462,21045,20886,22167,22109,21937,20478,21660,
+22009,21466,21705,21546,21192,21153,20712,21182,
+21116,20818,21327,21850,21640,21205,21365,22122,
+21864,22707,22327,22485,22105,24501,22695,22203,
+22582,23032,22599,22876,22407,22785,23160,23163,
+23093,22974,23220,23506,23860,23377,23235,22865,
+22911,22941,22469,22383,22086,21980,21596,21372,
+21294,21459,21428,21248,20855,21100,20963,21177,
+21048,21007,20834,20844,20847,20730,20727,20686,
+20488,20628,20350,20221,20237,20597,20493,20388,
+20181,20935,19700,21618,21856,20769,20301,20556,
+20422,19963,20850,20673,20333,20118,20087,20238,
+20433,20100,20279,20011,19660,19674,19746,19917,
+20081,20049,20470,20794,22596,23682,24281,22554,
+21147,20456,19097,19338,19371,18987,19940,18688,
+18270,18261,18019,18123,18519,19071,19401,20868,
+18475,12172,25869,31575,36126,40245,46035,43943,
+43872,43872,45417,44352,41925,44163,41332,37578,
+36141,36035,34480,34180,33940,33748,33588,33449,
+33409,33402,33299,33232,33297,33607,33854,33437,
+33799,33799,34276,34688,34117,34003,34288,33923,
+34078,34031,34191,34484,34368,34368,34495,34663,
+34908,35309,36351,35548,35427,35750,35413,35743,
+35856,34869,34389,35718,35629,35981,34836,32997,
+31467,27276,27207,28066,27090,24540,26236,26770,
+25135,20678,22185,20559,20412,20406,20464,20552,
+20139,19615,20032,18788,18006,19320,19235,17296,
+17563,17270,16557,16631,17658,18198,16501,17074,
+16773,17116,17418,17532,16998,18113,16570,17564,
+18504,18588,18780,18279,19341,20409,19682,21021,
+21276,21134,21298,21832,21273,23251,23354,24137,
+23568,22766,22404,21899,22585,21426,19585,20235,
+19045,20232,19258,18354,19029,18580,18340,17330,
+19073,18621,17850,18560,16788,18893,16639,15991,
+17526,16650,16275,16449,16398,16383,16627,16650,
+16752,17293,17241,18571,20058,19026,19513,19569,
+25306,26312,26769,25949,28146,28674,29325,30855,
+32159,31477,33132,35226,34687,35805,36570,36438,
+36660,37394,37511,37104,36882,36876,36789,36597,
+36482,36223,36014,35908,35883,35961,35823,35772,
+35742,35741,35748,35718,35737,36025,36381,36789,
+36951,37110,36494,36321,35463,35739,36179,34947,
+34361,35490,33626,33504,33183,32934,32838,32661,
+30573,28416,27564,26437,25423,25145,24659,24308,
+24447,25179,25266,24144,25557,26861,27702,29227,
+32847,33318,33771,34166,35515,36457,37390,37060,
+34302,32622,24884,21267,19416,18601,18305,18134,
+18220,18111,18250,18170,21076,19719,20413,20870,
+20169,20055,23820,33161,19902,19877,20526,21276,
+20962,22109,21575,21781,21849,22529,23752,23773,
+24321,24188,24022,24594,23997,25887,24248,24447,
+24522,24903,24393,23465,22681,22448,22258,20596,
+20510,21154,21172,18693,20057,19874,20295,19717,
+19209,18990,18558,18957,18672,18390,18582,18870,
+17686,18242,19571,18075,18210,18044,17733,18807,
+17990,17966,18990,19588,19515,21621,25270,26549,
+24900,21582,18733,19728,17840,18714,18067,18291,
+17861,17427,17619,17439,17487,17564,17176,17281,
+17217,16851,15569,15804,14912,15147,14742,15180,
+15166,14820,16100,15484,15462,15482,16162,15117,
+16776,18136,17120,16755,16433,16837,16920,17488,
+17962,18004,18009,17357,19685,24306,28792,28350,
+29138,30474,30250,29610,29393,30272,32796,32708,
+32718,32891,32901,32957,32988,32955,33066,33222,
+33380,33418,33533,33572,33600,33600,33598,33881,
+33903,33850,33666,33684,33771,33933,33852,34128,
+34116,34247,34229,34120,34094,34182,34140,34095,
+34067,34018,33953,33946,34101,34138,33879,33773,
+33789,33866,33658,33662,33692,33902,34238,33930,
+33555,33409,33288,33381,33421,33666,33933,34257,
+35149,34910,35192,34029,33990,33645,33243,33570,
+33560,33283,32922,32943,32985,32989,32205,31961,
+31803,31653,29579,26451,24571,23598,23463,23522,
+24441,25421,26479,29460,29868,32895,26675,25931,
+28552,32982,29323,23530,21777,22334,22119,26005,
+32994,29270,24525,25157,29490,26281,22181,20907,
+16712,18023,30299,32430,27574,24083,23173,22742,
+23651,23517,24621,23873,23358,23904,24231,23130,
+24003,23276,23517,23688,22294,22869,22443,23274,
+24591,28593,28097,31803,26301,24929,25507,26030,
+26506,27932,29595,32211,22568,15345,11859,15725,
+16661,17162,17075,17863,17680,17333,16684,16719,
+18112,17278,17926,16916,17643,17842,17769,18046,
+17853,18786,18969,18348,18789,18033,18520,18556,
+18263,18324,20109,30758,24615,20576,19608,18650,
+18948,18813,19041,18772,19207,19612,19494,19250,
+19341,19665,19422,21309,19571,18984,19932,19614,
+19778,21858,20177,19604,19247,21563,23024,19892,
+19107,19670,19834,19730,19743,20306,19661,27332,
+21531,21784,20746,20361,20415,20614,20679,20653,
+21026,21474,22061,22436,22767,23668,23123,22719,
+23996,21852,20453,21111,20501,20946,21098,20709,
+21370,21248,21081,21347,21246,21854,21729,21928,
+23023,22364,22488,22568,22631,22929,22584,22544,
+22316,22437,22307,22390,22637,22989,22581,22885,
+22974,23275,23196,23412,23213,23429,23277,23061,
+22694,22585,22501,22278,22142,22153,21638,21323,
+21235,21265,21279,21096,21117,21177,21021,20980,
+20956,20940,20820,20723,20764,20669,20649,20509,
+20047,20382,20404,20679,20433,20257,20226,20181,
+20423,19974,20804,21077,20402,20484,20523,19567,
+20055,19937,20147,21084,19836,20799,20618,20369,
+20385,20365,20254,20025,19691,19599,19647,19673,
+19851,19597,19984,20305,21022,21711,23055,25460,
+22010,20916,20546,19779,19162,19565,20838,18381,
+18459,19022,18067,18342,18403,19068,20082,21422,
+17266,15997,27906,30618,36576,41196,48288,44362,
+44456,43925,44475,45918,45771,42419,39279,37721,
+37045,35679,34556,34332,33939,33821,33498,33549,
+33621,33610,33366,33248,33279,33431,33251,33278,
+33296,33882,33992,34770,34631,34250,34362,34145,
+34542,34114,34084,34167,34370,34749,34830,34866,
+35292,35868,36553,35766,35361,35250,35724,35729,
+35736,35037,34512,34835,34211,34271,34421,33239,
+32905,29706,29614,32758,32639,22169,21043,20965,
+20501,20651,20531,20647,20487,20535,20877,20613,
+20499,19755,19530,18771,18820,18177,18171,17806,
+17479,16969,17175,15897,16667,17351,16677,15978,
+15891,16328,16472,16966,17778,17384,17619,19685,
+18283,18725,19198,19282,19620,19375,20727,20214,
+20587,21432,21933,21690,22305,22800,22719,24111,
+25111,23063,22041,21965,21492,20820,19857,20234,
+19851,20089,19438,19527,18162,18543,18786,18185,
+18331,18768,18406,18028,17025,17318,17997,17008,
+17163,17893,16179,16428,16361,16446,16398,16700,
+16826,16904,17876,17898,17841,17622,17424,18248,
+18570,23250,25616,28514,28819,29406,30183,31710,
+32523,32385,34485,35877,36535,36355,36506,36805,
+36875,37525,37332,37570,36852,36688,36646,36600,
+36492,36523,36174,35961,35871,35841,35804,35784,
+35802,35895,35923,35799,35833,35889,36095,36228,
+36649,36777,37246,36903,36342,36645,36822,35656,
+34883,37171,34538,33285,33264,33001,32957,32909,
+32918,30230,28131,27112,26450,25675,24927,24566,
+24688,25374,24257,25275,25704,26451,27228,29386,
+32506,33173,33516,34555,36018,37018,38166,37664,
+34260,33162,26703,21448,19575,18515,18329,18026,
+18249,18217,18408,18399,24723,19059,21839,19803,
+19831,19856,20796,31533,26326,19060,19425,20772,
+21012,21039,20867,22284,26084,30541,32733,30806,
+26545,24816,24530,25474,26057,25629,22392,24147,
+23508,24018,22749,23226,22474,22120,20910,21525,
+20718,21095,20393,20697,19370,20539,20154,19281,
+19318,19266,18972,18364,17878,18051,17877,18339,
+18240,18067,19453,17921,17849,18482,18303,17847,
+18145,18348,18351,19320,19827,22109,25864,27714,
+26658,20358,17283,19300,17748,18792,17916,18477,
+17320,17696,18226,17382,17224,17367,17170,16916,
+16697,16814,15990,16065,15176,15161,15053,15284,
+15574,15122,15342,15198,14630,15533,15796,16939,
+16617,16464,16317,16678,16368,16621,16864,16745,
+17285,18551,20051,20953,21067,23697,25835,26925,
+28382,29340,30249,29631,29171,28659,30522,32748,
+32787,32823,32778,32826,32902,32919,32949,32937,
+32946,33032,33037,33143,33327,33423,33378,33559,
+33691,33461,33549,33605,33743,33867,33862,34041,
+34069,34144,34142,34268,34012,34118,33897,33936,
+33942,33844,33812,33853,34075,33881,33726,33699,
+33702,33710,33734,33754,33804,33921,33759,33765,
+33411,33252,33233,33358,33486,33780,34115,35411,
+35704,35001,34566,33965,33885,33596,33058,32834,
+32875,32880,32991,32991,32957,32154,31925,32311,
+31751,31423,28167,25836,24653,27903,23532,23485,
+27163,24571,24684,26551,32491,32986,28480,25907,
+26714,24975,24780,22483,22322,22305,22626,32947,
+28973,23355,23484,30693,25868,21314,20856,18771,
+17029,23641,30306,28791,23172,24668,23538,23364,
+23586,24357,25481,23773,24970,23796,23724,25314,
+24150,24418,24009,26178,22233,21762,24136,22770,
+24881,27218,28495,31282,25362,26809,25940,26281,
+25280,26751,27997,32342,26330,20202,9981,15219,
+16375,16793,17241,19164,23188,18506,17700,17955,
+18333,16580,17021,17751,18052,17345,17958,17894,
+18624,18594,18319,18852,18443,18105,18335,18660,
+19123,18771,24572,19371,19348,19098,19380,18870,
+18589,19334,18811,18900,18885,19531,19269,18143,
+22692,22777,25383,21058,21597,21829,22740,21161,
+19897,19853,19671,19664,20208,19762,19630,19581,
+21360,19975,19937,19764,19754,30319,23862,21867,
+22607,28679,31697,20556,21333,20697,22297,22914,
+23098,23231,23659,24240,24934,23127,22008,21395,
+21320,21647,21183,20364,20653,20941,21022,20768,
+20743,20595,20725,20786,22417,21870,22149,21615,
+22497,24504,22230,22080,21864,21959,22219,22113,
+22476,22197,22461,22336,22428,22528,22818,23031,
+23088,23179,23275,23703,23558,23835,23528,23202,
+23027,22653,22452,22076,22239,22086,21860,21625,
+21583,21282,21131,21147,21212,21045,20860,20918,
+20938,20956,20691,20832,20475,20553,20446,20560,
+20523,20208,20328,20264,20233,20426,19914,20066,
+19917,20626,19805,20902,21462,20505,20675,20331,
+20169,20334,20012,20591,19520,19680,20346,20247,
+20199,20122,19920,19863,19700,19473,19616,19659,
+19738,19876,19878,20148,20508,20814,22538,22303,
+22850,22520,22915,19958,20365,19153,19866,19338,
+19491,18960,18597,18626,19075,20091,20879,17973,
+12327,24201,30041,34182,36696,44451,44509,43893,
+43988,44090,44569,45420,43139,41514,42826,38816,
+35640,35022,34297,34464,33969,33890,33804,33810,
+33801,33896,33557,33510,33625,33202,33259,33276,
+33299,33337,35067,33898,34754,34848,34376,34536,
+34799,34140,34208,34326,34830,34828,35051,35674,
+35823,35711,35643,35784,35297,34833,35167,35302,
+35598,34827,34990,33936,34039,33941,33666,33213,
+33003,32822,32846,32851,23676,22535,21499,20820,
+20843,20730,20566,20139,20163,20467,20588,20481,
+20320,19900,19368,18864,18598,18408,17824,17465,
+17536,17467,17524,16893,16747,17577,16278,17200,
+16414,16736,17244,18254,17956,18365,17742,18413,
+17612,19224,19774,18710,20677,21949,21099,21097,
+21675,22005,21311,22211,23310,24280,25015,25080,
+25992,23451,22975,22620,21548,20950,21003,19747,
+19445,19549,19471,18726,18729,19066,18612,17966,
+18168,18453,18501,18500,17975,16326,16313,18470,
+18032,17642,16536,16368,16410,16646,16473,16695,
+16674,17091,17691,17247,17150,17181,17175,17727,
+17536,18220,18831,22641,27813,29004,30561,31982,
+32436,33761,34701,35167,36196,36666,36559,36492,
+36334,36426,36635,36991,36780,36594,36566,36601,
+36495,36345,36198,35976,35886,35877,35839,35810,
+35746,35895,36040,36028,36003,36090,36006,36025,
+36352,36681,36752,37101,37157,37311,36607,35691,
+36033,36298,34680,33713,33120,33320,33131,32988,
+32985,32758,30144,27910,26916,26239,25627,24950,
+24998,24707,25692,25419,26506,26556,27318,29630,
+32704,33208,33602,36057,35645,36843,39528,37575,
+35750,33939,28880,22318,19615,18813,18501,18230,
+18234,18297,18227,18506,18529,18741,19278,19763,
+19797,21359,27408,31544,27497,22905,20397,21036,
+20910,24005,22888,22886,21942,23055,23391,23631,
+24039,25011,25795,25198,25156,24594,23862,23464,
+23554,23388,23482,22083,22455,21903,20763,20652,
+21300,21001,20300,20089,20004,20337,19400,19533,
+19000,18912,18641,19755,18696,18198,18198,18000,
+17845,18138,18267,17941,17403,17511,17430,18035,
+18564,18289,18441,18450,19531,21341,25260,28014,
+24903,20524,18015,18688,18766,18581,17620,17536,
+18374,18492,18540,17505,17229,17693,17244,16582,
+15990,16356,16238,15801,15540,15052,14907,14997,
+15048,14743,15135,14716,15239,15868,16039,16276,
+15984,16272,15645,16333,16369,16487,16525,16457,
+16754,17821,18328,19533,21280,21481,23387,25511,
+26783,27897,29516,29253,29223,28509,28759,31887,
+32337,32697,32622,32742,32806,32741,32779,32873,
+32828,32798,32922,33153,33267,33402,33409,33439,
+33504,33687,33627,33747,33768,33962,34159,33980,
+34033,34291,34296,34409,34095,33924,33916,33813,
+33897,33738,33916,34023,33924,33721,33678,33658,
+33669,33723,33765,33789,33636,33612,33874,33276,
+33240,33155,33186,33291,33459,33708,34235,34917,
+35156,34608,34312,34245,34230,33056,32904,32925,
+32985,32924,32949,32158,31706,31572,31986,31764,
+32559,30309,27331,26251,24072,24212,24159,23618,
+24401,24423,25930,24489,28869,32988,29271,29588,
+29499,23610,22504,22220,22301,22803,32988,32988,
+22744,22711,26358,27553,21210,21029,19970,15480,
+22583,31185,31085,30092,27420,23717,23371,23505,
+23744,24557,23773,24633,24343,24449,23286,23514,
+23018,23358,23273,24356,28253,22194,23839,27083,
+26063,28286,30280,31443,24631,27433,25930,26203,
+24412,26311,28924,29244,29413,23249,10770,21282,
+18088,17249,17496,18594,19694,20742,19233,18222,
+17020,17429,16665,17362,16799,16523,17585,17732,
+17644,18572,18291,18835,18141,18118,18699,19183,
+28349,18591,18618,17922,19773,19194,18714,18744,
+18424,18513,18758,18839,18704,20367,21033,30156,
+19493,20829,22248,21471,20202,22100,23059,20212,
+20170,19817,19209,20133,19669,19349,19650,19281,
+20020,19865,20360,18930,32937,20178,20521,20307,
+20068,20274,31524,20930,24464,24134,24132,25516,
+24768,25482,23615,23432,23612,21570,20684,20578,
+20263,20010,20242,20388,20559,20431,20897,20995,
+20895,21074,21183,21123,21523,22161,21558,21846,
+22070,22668,22044,21972,22086,22258,22098,22271,
+22168,22278,22393,22392,22630,22888,23025,23121,
+22982,23371,23334,23652,24069,24003,23513,23194,
+23100,22911,22703,22315,22440,22040,22019,21649,
+21388,21471,21084,21180,21196,20986,20848,21238,
+21056,20827,20761,20703,20786,20809,20632,20570,
+20355,20353,20237,20451,20388,20472,20100,20670,
+19857,20705,21702,20658,20554,20619,20257,20205,
+19678,19767,19989,20262,19812,20187,20430,20007,
+19567,19786,19727,19785,19703,19626,19539,19554,
+19642,19569,19886,19845,20067,20033,20755,21417,
+23114,24019,21836,20491,20104,19578,19485,18597,
+19374,19486,19229,19134,19470,18712,20667,15092,
+19584,28091,28895,34383,39791,46789,45273,44032,
+44231,44037,44288,43540,44425,40511,40023,39361,
+36692,33920,34046,34081,34056,33917,33937,33937,
+34145,33778,33598,33675,33321,33244,33303,33348,
+33376,33375,33933,34080,34638,34875,35258,34820,
+34691,34413,34757,34367,34813,34845,35311,34829,
+35682,35679,35738,35748,35730,34809,34889,34827,
+36650,34961,35661,34635,33897,34001,34175,33360,
+32991,32701,32826,32908,23733,22609,21770,21153,
+21042,20700,20130,20220,20102,20108,20190,20262,
+20023,19680,19314,18844,18483,18117,17667,17428,
+17511,17596,17648,16674,16222,15777,16465,16743,
+17092,17226,16743,18100,18385,18716,19119,17961,
+18132,18293,19108,20496,20722,20904,21086,21726,
+22854,22400,22439,22480,22592,24219,22947,25059,
+24494,24200,23092,23443,22044,21192,21180,20944,
+18915,20029,19831,19100,19910,19624,18699,18333,
+16753,18484,19396,19554,18340,19089,17862,19137,
+17931,17553,16453,15868,16656,16230,16468,16744,
+16711,16674,16920,16743,16565,17094,16905,17015,
+17710,18342,18981,20052,20852,24012,30165,32302,
+32844,34697,35301,37511,36975,36441,36318,36299,
+36231,36252,36367,36443,36512,36564,36591,36456,
+36404,36262,36141,36065,35940,35937,35897,35840,
+35790,35922,36129,36204,36108,36348,35850,35882,
+36125,36191,36650,36441,36608,37158,37137,36362,
+36801,37758,34824,34104,33224,33633,33454,33012,
+33012,32988,32132,28851,27363,26420,25702,25272,
+25303,24936,25530,26743,26919,26861,27528,30255,
+32992,33767,33414,35652,35859,36879,36847,37498,
+35928,33486,32992,24799,21232,19139,18903,18238,
+18348,18228,18338,18672,18486,19143,19168,19605,
+20036,21216,24161,24291,26572,28385,28438,24727,
+26430,20829,21261,21560,22704,22371,21803,23970,
+24594,23845,24165,25620,25124,24341,24254,23990,
+22779,23518,22887,22406,21021,21496,20746,20180,
+20922,19936,18678,19472,19326,19855,19323,18843,
+18067,18047,19120,19584,17405,18490,18160,17979,
+17730,17896,18013,17584,17490,17194,17325,17383,
+17945,18719,18100,18066,18614,20780,25023,27480,
+25053,19774,17586,18258,18038,17445,16827,17375,
+17790,19594,19234,17038,16965,16676,16680,15906,
+16141,16677,16467,16272,15509,15112,14944,14781,
+15621,15281,15063,16052,15387,15363,15688,15996,
+16103,15822,16077,16161,16032,16104,16385,16217,
+16299,16547,17201,18614,19501,19963,20871,20022,
+23262,26163,28741,28662,28590,27903,27936,29277,
+31113,31610,32172,32398,32502,32529,32662,32760,
+32762,32658,32697,33075,33363,33494,33706,33471,
+33532,33303,33641,33459,33799,33850,34133,34241,
+34012,34157,34231,34288,34142,33919,33717,33655,
+33728,33716,33732,33948,33754,33660,33653,33621,
+33697,33841,33814,33778,33609,33467,33249,33116,
+33155,33104,33111,33207,33381,33837,33976,34704,
+34745,34527,34470,35052,33014,32913,32976,32990,
+32599,31460,30962,30653,29901,29114,28769,28932,
+28490,27165,26881,25928,24825,25290,25079,27319,
+26475,26705,23598,23357,22599,29491,21018,22215,
+24739,24260,23934,23619,24255,23526,31118,25501,
+22196,26853,27081,21760,20867,19505,19617,17667,
+26611,29547,32961,25384,25644,25552,21253,23918,
+23277,24004,24253,23995,24333,24114,26510,24270,
+22449,24476,28098,26793,26805,29857,26301,24512,
+25404,29471,32523,32988,25522,26097,25913,25932,
+25809,26195,28854,30303,28031,23240,16374,14664,
+16399,17733,18057,18461,19581,20421,18385,20687,
+16878,16590,16389,16945,17191,17535,17959,20492,
+19019,20328,18307,18811,19164,18132,18173,18917,
+18492,17898,18552,18063,19586,19077,19000,18987,
+18342,18507,18117,21948,19822,23112,27649,20305,
+20859,21497,20946,20459,22071,24014,22115,21225,
+20502,19757,19811,20547,20132,19960,20787,20409,
+20163,20640,20665,29181,23662,21762,31433,22167,
+21454,21884,22737,22961,23026,24779,26089,23881,
+23019,21438,21627,21157,21227,20754,20241,20133,
+20084,20062,20288,20520,20613,20496,20926,20733,
+20895,21002,20906,22183,22053,21243,21190,22659,
+21591,21714,22231,21941,21723,21946,22496,21948,
+22077,22180,22238,22416,22791,23317,23015,23102,
+23490,23926,25193,23673,23915,24349,23685,23565,
+24479,22892,22845,22377,22030,22446,21879,21369,
+21361,21257,21553,21126,20959,21012,21162,20934,
+20887,20836,20613,20607,20619,20587,20528,20440,
+20415,20603,20764,20347,20043,20443,20548,20133,
+20532,20769,21035,23924,19704,20052,20164,20217,
+19864,19860,19863,19995,20027,19862,20100,19829,
+19881,19893,19777,19754,19559,19611,19578,19602,
+19689,19527,19406,19528,19379,19186,19779,20583,
+22638,23793,22755,20589,20873,20310,19848,19364,
+19024,18951,20214,19968,20250,20058,14373,19077,
+28152,30561,32200,34243,41570,47834,44876,44446,
+44692,44057,45607,45108,41360,39972,39500,39275,
+37224,34716,33911,33920,33876,33870,33915,34509,
+35109,33706,34278,33930,33858,33294,33340,33385,
+33454,33515,34306,34285,34100,35376,35221,34823,
+34830,34830,35400,34440,34832,34809,34818,34890,
+34944,35382,35535,35388,35112,34800,34878,34760,
+36717,35836,34881,35263,34171,34644,33865,33258,
+33025,32941,32886,32859,32889,24311,21765,21235,
+21218,20916,20576,20079,19878,19919,19775,19645,
+19500,19359,19085,18846,18498,18243,17835,17511,
+17316,17370,17437,16313,16542,16376,16730,17538,
+15933,17004,19832,18766,18330,18294,18509,19092,
+18819,19134,20099,20832,21384,21486,21901,22244,
+22742,22686,22696,22886,24268,22507,23414,24238,
+23880,23502,23278,22681,21934,21852,21230,21258,
+19536,19637,20033,20061,19599,19276,18495,17970,
+17860,18628,18738,18191,18445,18789,15603,17015,
+17949,17893,17088,16137,16040,16084,16405,16786,
+16714,16304,16654,16512,16588,17092,17340,17586,
+17982,17887,19290,20314,21175,22579,27527,30144,
+34422,35919,35399,37398,36599,36327,36247,36217,
+36274,36362,36372,36412,36473,36493,36486,36390,
+36332,36234,36191,35973,36006,35946,35897,35859,
+35813,36091,36164,36037,35582,35072,35744,36190,
+35772,36327,35755,36246,36586,36794,37492,37528,
+37422,38607,34611,34526,33923,33166,33794,33041,
+33017,32988,32739,29473,27659,26487,25938,25980,
+25507,24889,25396,28938,26964,26460,27888,32720,
+33123,34789,34512,35595,35758,37347,37434,36390,
+35934,35613,33087,27622,21412,19551,18911,18584,
+18343,18229,18360,18590,18890,19866,18915,19198,
+20297,20256,22345,22599,26283,23519,24650,21285,
+21621,20900,20805,21561,22282,22960,22377,22965,
+22560,24516,24719,24751,23868,24702,24297,23428,
+23302,23064,22805,21159,20568,20236,20868,20908,
+20679,20232,19697,19171,19522,19932,18546,19819,
+19323,18067,19011,18387,19284,17447,18471,17954,
+17571,17730,18161,17910,17308,16903,16628,16925,
+17563,18363,17882,17512,17828,19479,22291,25205,
+27345,20868,17593,17166,18288,18537,18110,16460,
+16729,16821,19140,18047,16191,15214,17151,16002,
+16409,16287,16416,16402,16530,15554,16420,15338,
+15710,16638,16188,14697,14878,15441,15735,15636,
+15732,15658,15933,16139,16193,15864,16188,16082,
+16291,16074,16095,17434,18057,19560,18711,18429,
+19006,24226,27811,28290,28482,27554,27717,28545,
+29026,29480,28981,31011,32210,32394,32477,32629,
+32485,32520,32631,32826,33062,33375,33240,33226,
+33281,33240,33327,33405,33626,33654,34150,34154,
+34152,34229,34238,34168,34120,33895,33752,33681,
+33675,33759,33651,33818,33624,33610,33691,33681,
+33711,33943,33817,33634,33456,33175,33123,33076,
+33174,33060,33060,33143,33349,33658,33717,34582,
+34470,35815,34935,35393,33020,32991,32769,30465,
+29793,29632,29616,29672,29401,29001,28371,27725,
+27130,26145,25527,24484,25156,26670,28188,28704,
+25943,24435,24063,22245,22188,25536,20314,20852,
+22179,23811,23850,23701,23311,29126,32763,23085,
+23459,20693,21443,19040,19593,19634,19579,22707,
+26778,29556,28824,26124,25970,24852,23970,23647,
+24533,23973,24533,24033,24893,23975,24444,26049,
+21150,24063,26709,29847,32031,28805,26528,24489,
+26517,32586,32805,27744,25683,26269,25449,25912,
+26358,26037,28378,29709,29157,26742,18396,11660,
+17025,18795,19058,17199,20347,18473,19986,17918,
+16834,16207,16666,16903,16839,17972,17088,17367,
+17613,19872,19681,19385,18861,18448,18296,18455,
+18138,17604,17867,18885,19209,20064,19236,18999,
+18555,18684,19514,23711,19773,19859,19806,19714,
+20137,21045,23726,22463,24492,34032,22986,21904,
+21204,20169,20374,21296,20486,23288,20952,20525,
+21362,22909,24298,27831,24758,22074,32756,22014,
+22254,23639,25016,24963,24183,24353,23265,23019,
+21771,20474,20008,20309,19819,20550,20169,19696,
+20234,20247,20024,20327,20344,20531,20555,20753,
+21026,20950,20558,21762,22179,21776,21750,21681,
+21746,21768,21930,22085,22092,21946,21934,22067,
+22304,22258,22411,22709,23220,23616,23319,23090,
+22866,23643,23762,23605,24375,24892,23745,23518,
+23218,22944,22886,22488,22131,21728,21823,21456,
+21396,21417,20997,21079,20983,21042,20661,21298,
+20992,21184,20991,20931,20641,20694,20379,20728,
+20454,20478,20304,20421,20472,20424,20429,20328,
+19992,20727,19634,22645,21307,19987,20183,19918,
+20033,19832,20088,19683,20007,19683,19724,19675,
+19522,19770,19539,19718,19833,19593,19449,19353,
+19313,19463,19383,19452,19396,19374,19597,20126,
+22665,23487,24081,22710,21438,21287,19787,19962,
+19675,20293,19267,19197,18219,12920,20519,27292,
+30562,32743,34944,37488,45480,45780,45060,44729,
+44178,44301,45164,41200,43762,41085,39451,38275,
+36094,34306,33916,33879,33863,33783,33891,34085,
+33985,34315,33779,33676,33258,33284,33342,33385,
+33333,33343,34140,34482,34803,35277,35257,35469,
+35408,35367,34977,34368,34875,35502,35931,35416,
+35652,35731,35031,34890,35115,34931,34775,36092,
+36563,35526,35710,35725,34779,33894,33619,33725,
+33177,32997,32916,32913,32986,27990,22018,23232,
+28770,20610,20280,19941,19701,19689,19581,19293,
+18969,18754,18644,18650,18468,18094,17803,17478,
+17151,16910,16975,16594,16908,17637,17241,16832,
+17421,17100,18038,18819,18631,17841,19301,19488,
+20161,20958,20157,21405,21724,22142,22579,24478,
+23235,22995,25190,23246,21173,22431,24039,24792,
+22121,22041,22831,23145,21672,22491,21879,21614,
+21148,20813,20889,20184,19343,19392,18786,16613,
+17473,17770,16994,18527,17866,18991,17769,16740,
+17313,16215,15734,16014,15947,16140,16011,16022,
+16526,16146,16167,16259,16551,16950,17513,17880,
+18196,18858,19592,20504,21263,23516,28763,32876,
+35187,36237,37149,37317,36614,36281,36242,36260,
+36261,36363,36433,36441,36382,36270,36293,36318,
+36242,36219,36201,36093,36026,35970,35928,35934,
+35761,35740,35323,35823,35753,36314,34656,35952,
+35351,35249,35579,35835,36911,37126,37165,37019,
+35980,37056,34933,34733,34057,33600,33115,33277,
+33087,33023,32904,32577,29680,28245,26259,26133,
+25889,25614,24986,27087,26865,27369,30506,32706,
+33357,33619,34001,35027,34830,35336,35474,36644,
+35125,35382,34104,32437,23593,20362,18973,18683,
+18231,18674,18633,19167,18648,19267,19253,19402,
+19305,20127,20324,20794,20991,22995,31789,28424,
+21900,21825,22488,22141,22760,22036,21859,22291,
+23678,21906,24697,22623,23710,24319,24275,23932,
+23793,21966,21522,20570,19497,21095,20162,19441,
+19548,18693,18677,18668,20093,19375,18805,18254,
+18580,17870,18588,18315,19452,17643,18216,18114,
+17553,17478,17470,17669,17253,17279,17061,17274,
+17381,17824,18594,19067,18536,19524,21999,25072,
+27268,20727,16386,18123,17660,17800,16749,17134,
+16725,16697,17267,19583,16515,14976,15714,16503,
+16124,15786,16096,17184,15876,15380,17654,16572,
+15908,15327,14487,14658,14903,15139,14883,15597,
+15672,15876,15717,15601,15783,15713,16103,16387,
+16116,16066,16303,16320,16923,18021,18078,17496,
+18438,21276,26832,26680,26499,27219,26988,28037,
+27759,27374,26634,27252,30243,32183,32095,32285,
+32253,32434,32640,32768,33023,33092,33111,33194,
+33306,33299,33760,33585,33855,33978,34346,34207,
+33631,33883,34235,34307,34030,33851,33643,33657,
+33669,33689,33612,33657,33694,33714,33718,33694,
+33756,33854,33987,33676,33427,33153,33045,33019,
+33009,33024,33051,33158,33295,33407,33649,33822,
+34344,34829,34940,33885,32950,32983,29601,29168,
+29760,30196,30470,31812,32102,32539,31050,30072,
+28248,27632,26805,25364,24347,24501,24470,27124,
+25929,25236,24034,22772,22257,24414,20846,20549,
+22058,24546,24486,22134,22322,25560,26473,22229,
+20187,19065,18864,19421,19749,19416,17205,22240,
+32380,31519,26767,27678,25263,24580,23967,25095,
+23338,24583,25213,24684,24414,25427,27379,26616,
+25890,24295,32994,34185,33663,32994,30181,25170,
+28533,31398,32989,26472,25645,25774,26831,26583,
+27142,26476,27943,28806,29550,28895,20405,9271,
+17540,18480,17940,18354,18094,17007,17241,18017,
+16706,16457,16767,16934,16755,16785,15938,16070,
+15776,17144,17587,18180,18477,18123,17832,18323,
+17307,17289,17274,18370,18348,18605,18351,18592,
+18128,18444,18942,18915,19149,20376,19945,20797,
+21337,22000,21641,22709,24552,24195,21687,21083,
+20755,21553,21252,20781,28018,22934,21365,25310,
+27653,25972,26668,25278,24591,23655,22176,22100,
+24200,24855,25694,27549,23861,22638,21420,21159,
+21309,19792,19679,20020,20190,20503,20046,20037,
+20360,20623,20235,20604,20790,20804,20886,20844,
+21242,21305,21683,21903,21954,21324,21656,21632,
+22058,21814,21980,22110,22102,21936,22422,22743,
+23017,22037,22351,23164,23138,25714,23496,23609,
+23618,23633,23371,23662,24264,23838,23808,23757,
+23085,23034,23042,22697,22353,22170,21764,21743,
+21441,21219,21238,21524,22317,20693,20418,21169,
+21797,21529,21202,20415,20261,20890,20557,21153,
+20502,20248,20732,20652,20232,20669,20598,20687,
+21126,20823,21090,21259,20817,20092,19728,19619,
+19664,20057,19749,19688,19971,19624,19540,19713,
+19936,19917,19852,19686,19647,19487,19283,19272,
+19125,19061,19156,19215,19419,18987,19268,19605,
+20736,22809,22165,24387,23457,22299,21495,20320,
+21112,19892,18972,16627,13267,19773,27774,29898,
+32822,36932,40195,42351,45897,45432,44583,45994,
+46086,46202,42334,44954,45102,36813,34470,33717,
+33854,33836,33671,33781,33764,33891,33911,33939,
+33871,33810,33479,33303,33272,33267,33325,33353,
+33344,33389,34442,34616,35193,35088,34687,35080,
+35732,35277,34887,34626,34821,34881,35643,35024,
+35744,35761,34884,34719,34836,34947,34734,34810,
+35586,34993,34891,34893,35748,34826,33879,33523,
+33249,32998,32893,27893,26094,23841,23674,21081,
+20886,20612,19279,19640,19556,19489,19364,19188,
+18648,18387,18288,18375,18322,17978,17783,17457,
+17181,16854,16748,17735,15462,16223,16599,16779,
+17604,17866,18954,18162,20171,18600,19530,19152,
+19093,19695,19725,21704,22187,22074,22308,23602,
+22594,23580,24204,23900,25205,23682,22345,23742,
+23457,21059,21516,21704,22744,21197,21086,20242,
+20952,21065,20573,20314,20384,18468,18839,18271,
+18448,18006,18621,19348,18969,18064,17915,17752,
+17011,15998,16964,16446,16153,16014,15928,16257,
+16208,16196,16552,16474,16755,17240,17642,18361,
+18214,18669,19512,20580,22047,23752,30296,32945,
+34188,36257,35991,35423,35976,36285,36309,36296,
+36328,36390,36455,36480,36414,36417,36453,36312,
+36344,36291,36166,36069,36006,35965,35961,36063,
+35886,35864,35964,36213,36661,36799,35244,34676,
+34930,35047,35391,36334,36290,37361,36120,36040,
+35782,35049,34965,34605,33689,33356,33134,33929,
+33453,33330,33216,33046,32937,32988,29910,27632,
+27093,25925,24868,26310,26475,27539,32414,32952,
+33167,33762,34083,34737,34387,33978,34743,34900,
+35711,35896,33306,32495,26307,21015,19307,18931,
+18528,18845,18976,18733,18970,19352,19968,19369,
+19378,20217,20145,20591,23117,32020,32987,30145,
+29205,23979,22068,22161,22630,21969,21172,22043,
+21829,22821,22887,22687,24011,26724,23418,23607,
+23690,22878,21101,20016,20700,19601,20553,18627,
+20684,17976,20069,19252,18824,19195,18830,18415,
+17411,19156,17748,18626,19661,18093,18506,17974,
+17702,17604,17527,17335,17618,17244,17708,17124,
+17157,16927,18748,18744,19418,20372,21920,24834,
+27816,23823,16580,18687,17523,17584,16236,17240,
+17216,17136,16308,17967,19890,15025,15708,16386,
+16302,16221,16173,16818,14911,16275,14968,17514,
+16048,15548,14543,14649,15366,15220,15257,15383,
+15543,15606,15460,15150,15699,15212,15847,15858,
+16465,16662,16198,16554,16620,17083,17409,17834,
+19041,20931,25984,26606,25941,24618,23651,23367,
+25223,24960,26396,24153,27438,32980,32988,32346,
+32088,32364,32685,32860,33081,33419,33095,33066,
+33110,33276,34447,33924,33880,34374,34592,34477,
+34704,33537,33718,33996,34023,33699,33605,33718,
+33762,33683,33658,33663,33699,33759,33809,33735,
+33791,33717,33759,33327,33144,33099,32967,32949,
+32949,32829,33038,33137,33208,33328,33474,33723,
+34090,34995,35011,33636,32884,31154,28699,30010,
+31055,30212,30753,31857,31908,31158,30844,32353,
+30348,28868,27249,26259,25985,24142,28037,27113,
+25515,25312,24061,24576,22772,22259,22201,20961,
+19958,19906,18900,19480,19446,20584,21393,22642,
+19423,19482,18872,19713,19485,18108,18618,21053,
+30140,30063,26325,24812,24494,23571,23906,24318,
+24219,24549,25154,24611,24336,25551,28158,24594,
+25417,25129,32856,32966,32986,32988,30142,26301,
+32997,29067,30151,29010,26938,25447,24952,25790,
+26061,25701,26145,27616,29588,27807,22045,8259,
+15548,17289,18665,18537,17607,16586,17288,18639,
+15890,15640,16047,15621,16800,15594,16433,16586,
+16238,16647,17251,18742,18147,18156,18314,17928,
+17287,17658,17710,19103,18086,18462,18533,18165,
+19365,22334,21360,20022,21788,20127,21340,21225,
+24798,29293,23035,21121,20970,20907,20364,20408,
+20757,20280,20169,27098,25410,32613,32806,32791,
+30079,27378,31467,26596,26094,23205,23265,25113,
+25320,26344,25320,24970,22440,21696,20398,19438,
+20056,19921,19690,20048,20076,20229,20367,20591,
+20337,21386,20259,20772,21150,20841,21268,21138,
+21550,21601,21550,22181,21750,21623,21636,21798,
+21888,22335,22424,21713,22229,22002,23187,22997,
+21667,22431,22332,22518,22683,22888,22585,22966,
+23209,22961,23268,23698,23988,24147,23956,23568,
+23100,22672,22370,22302,22278,22107,22001,21866,
+20352,24670,22824,22143,23594,24459,27051,25463,
+20253,21748,21099,21202,21543,21519,21225,21640,
+20889,21579,21006,21481,20538,20206,20815,21210,
+20712,20688,21092,20982,19590,20161,20227,20151,
+19979,19747,19728,19847,19590,19364,19557,20202,
+19863,19763,19599,19458,19365,19272,19284,18870,
+18941,19133,18911,19191,19023,19569,19303,19290,
+19738,19747,21084,23667,24622,23916,22899,21201,
+20182,19383,15321,17393,23268,27485,32778,35889,
+37089,40046,40634,46821,45090,44577,44757,44836,
+40188,41971,42018,38349,34701,33649,33515,33618,
+33618,33667,33661,34044,34205,34395,34083,33915,
+33703,33451,33372,33388,33306,33309,33350,33420,
+33642,33844,34220,34029,34852,34806,34550,34890,
+34853,34542,34859,34745,34871,35424,35742,35688,
+35965,35586,34796,34764,34950,34634,34890,35674,
+34893,35654,34993,34678,34822,34739,35056,34695,
+33496,33065,32931,26540,24994,22197,20908,21250,
+20378,20399,20154,19824,19541,19371,19350,19185,
+18761,18359,18221,18179,18192,17933,17561,17133,
+16898,16344,16696,17339,16715,17223,16040,17427,
+17382,17529,17805,20268,18566,18122,18765,20325,
+19130,19467,19952,20987,21798,21999,24127,21618,
+22649,23565,24291,23837,24072,22572,22714,23679,
+23340,21966,21584,22260,20171,20384,21363,21518,
+21184,21181,20312,19675,20291,19779,18486,18522,
+18387,18144,20312,19035,19280,18405,18370,17403,
+16779,15918,16401,16628,16302,16068,15864,16509,
+15979,16249,16638,16698,16900,17345,17827,18367,
+18496,18982,20020,21003,22569,24214,29774,32954,
+34311,35134,35772,36219,36624,36307,36345,36319,
+36410,36447,36503,36518,36423,36505,36375,36475,
+36433,36324,36155,36083,36033,36019,35973,36015,
+35700,35988,36012,36144,36681,37051,36645,34699,
+34428,34428,36011,36634,36624,36921,36265,35640,
+34800,34995,33730,33969,33354,33303,33176,33802,
+34076,33627,33405,33243,33206,33109,33023,32638,
+28790,26550,25299,25932,26556,26356,30601,32479,
+32970,33258,33687,33786,33843,33076,33915,36084,
+35571,36259,34774,32985,32987,22176,19745,19476,
+18628,18903,19272,18972,19005,18764,19893,19182,
+20235,19860,20673,20558,22701,24187,32475,32703,
+31171,22267,22983,22875,24075,21718,21466,21600,
+21777,22092,23048,23092,22389,23402,23285,23807,
+23958,22638,19979,19931,20072,20174,18444,20787,
+18993,17732,19482,17121,19760,19375,18600,18882,
+16756,18728,18825,18783,19057,19011,17385,17758,
+17916,17694,17767,17065,16674,16902,16970,17487,
+17463,17050,17025,17941,18432,19820,22884,24924,
+27765,25668,15651,18093,17863,18015,16548,17833,
+17889,17594,17169,16770,18148,18168,14435,15926,
+16968,16302,15798,16791,14663,16851,14760,17294,
+17460,15035,14950,14679,15388,14739,15517,15371,
+15634,15026,15383,15534,15624,15274,15668,16272,
+15954,16358,17772,16055,15981,16184,16968,18671,
+18092,21327,26601,25083,22968,27072,27357,23981,
+24036,25849,21957,20019,26994,28413,31012,31576,
+31521,32196,32851,32970,32919,32994,32904,33003,
+33156,33840,34005,34431,34365,34425,34460,34335,
+33612,33390,33622,33753,33716,33484,33322,33649,
+33767,33767,33736,33783,33834,33780,33683,33394,
+33355,33324,33380,33175,33013,32962,32991,32952,
+32921,32988,33007,33069,33152,33246,33402,33478,
+33918,34506,34232,32979,32916,28558,28082,32600,
+30046,30235,30408,31354,31879,31514,30620,30374,
+30267,27373,25863,25532,24664,23346,23772,25986,
+24583,24877,23745,24389,23777,23114,23783,21259,
+19326,20110,19252,18125,20093,21800,19012,20741,
+19300,15661,18270,18353,18682,19258,19941,27756,
+33398,27739,24882,23876,23409,22968,23682,23652,
+24033,23940,24005,24619,23556,23339,26903,24938,
+25139,24854,29253,32004,32981,33817,32968,32545,
+31650,32964,27897,24610,26756,26382,22727,24603,
+26732,27362,26329,26938,28683,27313,21898,13532,
+15408,18285,19461,18438,17265,16996,17051,18183,
+16394,16728,16136,18259,17061,16302,16433,16419,
+16650,15763,16989,18585,19949,18427,18554,17995,
+17451,17385,18289,18251,18154,18047,18333,19297,
+19387,19729,20428,19764,19830,21995,19716,22924,
+32026,25224,21276,20402,20241,20066,20072,20646,
+20235,25742,29992,29207,31737,30445,31872,28772,
+27681,28005,25003,24792,25126,28297,26271,27099,
+26205,24996,24695,22236,21478,21009,19783,19438,
+19520,19870,19918,20389,20110,20792,20478,20257,
+20568,20534,20619,20933,21394,21511,21084,21121,
+21337,22498,23220,21408,21793,22803,21507,22156,
+21851,22106,22256,21882,22065,22469,22396,22746,
+21705,21681,21212,22138,22382,22491,22806,22958,
+23327,23119,23567,23369,23831,23802,23936,23481,
+23172,22854,22591,22442,22167,22098,21847,21919,
+21245,22070,21717,21378,21819,21030,20621,20782,
+21765,26790,22164,21603,21660,21183,22311,20514,
+22572,23006,22201,21440,20845,21034,22500,22281,
+20733,21742,20880,20439,20928,19923,20258,20585,
+19985,19785,19706,19470,19679,19836,19851,19800,
+19652,19732,19836,19581,19180,18818,18923,18777,
+18917,20022,19004,19119,19138,19463,19342,19231,
+19473,19434,21356,22861,24342,24864,24402,22330,
+20185,14964,22667,26821,32307,36163,37221,37461,
+40191,47197,44281,46500,44680,44461,44469,47037,
+38906,37917,36136,35920,34122,33557,33495,33501,
+33591,33656,34530,34802,34149,34467,33911,33895,
+33918,33900,33687,33507,33371,33329,33453,33449,
+33675,34150,34082,34012,34740,34807,34415,34617,
+34335,34764,34428,35154,35574,35759,35733,35647,
+35744,35719,34865,34994,34651,34494,34890,35709,
+34785,35620,35718,34824,34815,34452,33897,34254,
+33711,33193,32903,32880,25254,20689,20307,20441,
+20391,20233,19923,19856,19391,19251,19122,19089,
+19061,18719,18317,18225,18098,17989,17193,17388,
+16863,16473,16284,16204,16303,17050,18774,17903,
+17880,18133,16836,18888,18720,19102,18392,18915,
+19045,19794,20120,19956,21305,21318,21965,22248,
+22666,22812,23040,23384,24380,22751,22875,23088,
+22729,21641,22216,21755,21518,21868,21134,20596,
+22424,21512,20306,19836,22855,20258,19194,18809,
+18564,18449,18303,18052,18705,18822,17262,16899,
+17088,17453,16543,16469,16589,16560,16375,16470,
+16428,16446,16671,16779,17001,17226,17577,17745,
+18446,18882,19584,20956,21432,23666,27111,32712,
+33759,34347,36469,36467,36495,36332,36312,36438,
+36491,36472,36575,36623,36594,36575,36516,36627,
+36531,36391,36270,36117,36055,36025,35988,36121,
+36109,36225,36130,36199,36235,36354,36160,36268,
+35825,34236,36388,35836,34976,34287,34101,34434,
+34682,34030,34144,33437,33802,33346,34340,34835,
+34800,34207,33988,33738,33753,33549,33179,33036,
+31183,27118,25618,27701,24855,24406,27572,30734,
+32184,33062,33174,33176,33259,33334,33384,33879,
+36660,36648,35667,33913,32667,23223,20721,19782,
+19077,18967,19596,19152,18792,19032,18975,20376,
+19512,19547,20241,20637,22227,25586,32381,32610,
+32106,29194,24541,23125,22796,21989,21273,21743,
+22194,23702,23213,24041,22773,24105,24900,23621,
+23873,22946,22092,20592,20383,19626,19671,19545,
+21177,18575,16844,17603,19789,19358,19784,18344,
+17915,18056,18305,18425,18525,18828,18495,18195,
+17629,17558,17515,17757,16221,16991,17389,17253,
+17818,17687,17216,17852,17730,18905,20788,24342,
+27012,23124,16566,18217,15627,17354,16903,17274,
+20297,18924,16166,16638,17154,18507,15559,16007,
+16873,18057,15840,17037,15511,16387,15593,16886,
+16060,14001,14172,14580,15573,15615,15222,14917,
+15732,15355,15443,15310,15454,15165,15729,15834,
+16395,16833,15669,16540,15857,15892,16966,17789,
+19269,23807,25503,24588,21183,19487,15977,15756,
+15497,16935,15811,15893,16560,26391,28344,29928,
+31114,32194,32942,32682,32599,32835,32988,33203,
+32994,33658,34115,34440,34736,34497,34050,33917,
+33481,33345,33805,33168,33598,33641,33351,33577,
+33747,33721,33698,33699,33750,33594,33418,33294,
+33174,33091,33048,32992,32862,32881,32980,32895,
+32990,32829,32958,33054,33123,33202,33341,33564,
+34095,35265,33525,32985,28626,27604,28941,29754,
+30037,30024,30531,32098,30754,29916,29774,30457,
+28933,25746,22611,22749,23829,21325,23119,21914,
+22104,25454,25645,24711,24171,22969,23841,21042,
+20553,20178,19860,18082,18996,20219,18261,20016,
+19142,21318,20934,19906,19344,19790,28900,31876,
+33128,25428,24074,23454,23928,23100,22893,23321,
+23305,23581,24900,25124,24395,24027,23770,25394,
+25434,26764,27133,21350,27165,31848,32932,33084,
+32567,28095,24782,27304,26911,26421,26143,25801,
+26308,26227,26550,27345,30609,28731,23135,11568,
+16472,17927,19299,17741,17253,17468,17427,17172,
+19658,21204,16568,17243,16962,16521,16264,16656,
+16519,16227,16921,16680,19131,18393,18039,18067,
+17751,17743,17939,18366,18678,20937,22053,19326,
+25426,20096,20627,21507,19954,19799,19761,20004,
+18989,20054,20338,19732,20361,20139,20343,28582,
+22065,29806,32948,28898,28420,28188,28926,24080,
+22472,22718,24226,30740,27125,27447,31153,26787,
+25639,24807,22055,21716,20772,20989,19845,19755,
+19539,21303,21055,20459,20134,20587,20551,20643,
+20816,20766,20577,21015,20668,21427,20868,21207,
+21273,21011,21503,21498,21491,21213,22925,21567,
+21929,21465,21726,21750,21778,21729,21932,22078,
+21963,22437,22466,22233,22415,22911,23151,23556,
+22953,23440,23441,23780,23628,23699,23889,23340,
+23236,22995,22691,22508,22201,22233,22019,21540,
+21714,21879,21395,21176,21120,21339,21100,20348,
+20406,21242,21984,22994,20967,22188,22362,20242,
+20424,21859,23643,22506,21942,21519,22769,21986,
+22293,21558,20292,20934,21525,20956,20542,20259,
+20474,20101,20309,19729,19674,20270,19951,19644,
+19377,19592,19424,19303,19241,19025,18678,18629,
+18951,18834,18738,18920,19280,19315,19212,19068,
+19217,19057,20056,21163,22670,24732,24105,23358,
+17189,27068,30282,34311,41413,39401,44862,40188,
+46941,46412,45697,44580,44509,44481,41813,39271,
+36003,36021,36178,34929,33481,33425,33492,33537,
+33489,33519,34046,34123,34098,34005,33795,33601,
+33779,33911,33760,33759,33350,34358,34038,33468,
+33470,34958,34746,35133,35373,34733,34216,34463,
+33898,34344,34130,34323,35445,35222,36186,36129,
+35898,35787,35332,34824,34796,34742,34437,35167,
+34631,34972,35868,35641,35355,35758,35481,34550,
+33758,33307,32913,26558,22281,20979,20943,20550,
+20207,20037,19822,19728,19465,19266,18921,18909,
+19029,18711,18376,18183,17959,17629,17329,17062,
+16994,17144,15865,15211,16213,16843,17300,18312,
+17520,18553,18430,18555,18482,17614,17774,18582,
+20007,19626,19839,20784,21432,21323,21428,21730,
+22125,22728,22898,23947,24687,24651,24393,23983,
+21993,22386,22407,22030,22092,21040,21294,21419,
+20291,19996,21792,20035,25286,20418,19250,18902,
+17849,16956,18420,18114,18075,18739,17514,17183,
+17277,16794,16437,16457,16398,16479,16438,16473,
+16501,16571,16646,16821,16979,17265,17243,17937,
+18379,19232,19868,20598,21795,23144,26642,31956,
+33674,34381,34677,36943,37029,36530,36478,36601,
+36726,36769,36761,36653,36713,36692,36645,36666,
+36566,36452,36357,36194,36121,36127,35989,36198,
+36351,36504,36588,36243,35991,35999,35950,35955,
+36435,35698,34071,34449,35086,34173,33966,34299,
+34033,34042,33917,34148,34443,33967,35491,35319,
+35155,34835,34746,34731,34029,33779,33414,33295,
+33010,29818,25615,26466,24153,23462,23275,25700,
+28494,30366,31205,32869,32992,33270,33357,33354,
+33963,35446,35541,32990,33275,25391,21289,20163,
+19707,18801,19269,19143,19059,20496,19407,19469,
+20088,19429,20143,20540,20552,21516,24622,28818,
+31779,32367,31903,24150,22446,22433,21415,21327,
+22838,22776,23957,23653,24150,24508,23247,22088,
+24383,22538,22669,20963,19876,20857,19510,18636,
+20100,17910,19421,19548,17886,18341,18276,19301,
+17932,17825,17842,18158,17725,17619,18114,17917,
+18201,18073,18130,18249,17247,17348,17519,17908,
+18396,17997,18279,20124,19469,20641,23674,25638,
+25450,21465,16677,17301,15018,18066,16805,16709,
+17423,17571,16065,16525,16284,18792,16989,15799,
+16227,18669,16340,17085,15539,19164,15593,16002,
+15299,14613,14991,14649,15963,15797,14739,14997,
+15141,15249,14804,14393,14403,15036,15563,15482,
+15961,16631,15626,16085,15995,15839,16969,18393,
+21443,20460,18936,17042,16368,16309,16565,15581,
+16209,15926,15901,15852,15994,19897,26025,27643,
+30008,31539,32769,32814,32777,32772,32988,32994,
+32985,33088,34128,34586,34121,34270,33780,33431,
+33322,33294,33423,33186,33384,33169,33385,33636,
+33593,33615,33545,33610,33626,33475,33221,33335,
+33064,32979,32968,32898,32852,32803,32694,32784,
+32937,32720,32778,33042,33096,33172,33401,33614,
+33681,33652,34038,32988,27171,27387,28828,29702,
+29790,29800,30092,31710,29871,29463,29330,29027,
+27844,20233,20214,19708,19718,20327,22333,23337,
+22598,24477,24449,24151,23199,22758,26133,22740,
+21018,20784,19272,19272,18809,19517,20183,18537,
+19123,23887,23841,23157,22407,28753,32946,25699,
+32089,24333,23923,23307,22731,22343,23163,23013,
+22839,23901,24621,25035,23851,24011,24042,27723,
+23511,23824,25631,24793,27969,25909,26698,28782,
+25594,23905,25648,27362,28022,26669,26651,27714,
+28497,27768,27148,25300,25906,25732,17051,14336,
+19801,19593,18697,18162,17695,17427,17262,17463,
+17919,17506,17260,17052,16451,16294,16011,18807,
+16594,16719,17768,16706,18065,18636,18302,18407,
+17846,17457,18816,18066,19598,20043,22828,18085,
+19071,18781,19518,19436,20654,18984,19732,19058,
+18991,19691,19778,19830,20051,19989,21069,26268,
+32766,32994,32989,31596,24573,27498,22911,22602,
+24216,21967,21516,23631,25539,27088,26706,26141,
+24613,21414,20703,20904,21209,20166,20110,19800,
+20128,20877,19635,20592,20030,20540,20282,20458,
+20751,20769,21147,20994,20948,20916,21400,21030,
+21710,21310,21447,21777,21499,22563,21706,21522,
+21303,21292,21275,21329,21668,21555,22068,22051,
+22088,22071,21824,22871,22515,22378,24838,22506,
+22750,22881,23011,23463,23649,23772,24404,25159,
+23295,23001,22628,22375,22269,22152,22187,22062,
+22032,21897,22060,21246,20839,21351,21299,20883,
+20579,20602,20565,21225,21240,22278,21684,22011,
+22348,22236,22401,22557,22754,23010,22131,22374,
+22377,21671,21737,20682,22444,20972,20820,20724,
+20721,20193,20738,20124,20333,20312,20008,19616,
+19483,19404,19279,18977,19236,18811,18626,18496,
+18394,18729,18545,18613,18811,19006,19044,19017,
+18990,19403,20238,20673,21687,22908,22622,19567,
+27651,32826,37461,38767,43060,44364,47605,47235,
+46905,47425,47579,44479,44481,46050,41739,35634,
+34649,35991,34541,34539,33405,33400,33482,33579,
+33521,33593,33878,33813,33754,33676,33665,33704,
+33694,33882,33993,34086,33456,33405,34379,33603,
+34329,34731,35041,34671,34412,34508,34418,34684,
+33889,33927,34013,35320,34871,35988,35587,35443,
+35693,35699,35253,34831,35340,34821,34945,34477,
+34523,34651,36048,36176,35638,35251,34518,33824,
+33894,33209,32570,25308,21606,20611,20313,20259,
+19707,19509,19469,19326,19415,19440,19409,19083,
+18804,18786,18636,18165,17723,17203,17276,16680,
+17091,15955,15313,15793,16013,15489,16391,16448,
+16226,17624,17636,17566,18280,16452,16630,17308,
+19554,19999,20206,20381,20047,21093,21271,21984,
+22110,22470,23269,23235,24637,25374,24360,23878,
+23150,22965,22570,23064,22746,21176,21534,27265,
+19999,19947,19820,21060,20571,19176,19320,18627,
+18893,18541,18759,19107,19550,17392,17918,16353,
+17331,16938,16437,16851,16692,16569,16383,16395,
+16489,16494,16631,16799,17022,17313,17560,18077,
+18693,19248,19944,21027,21946,23265,25233,29064,
+33834,33948,37166,37349,37346,36738,36552,36735,
+37078,36894,37124,36911,36941,36775,36532,36660,
+36642,36421,36261,36195,36172,36105,36204,36208,
+36376,36445,36557,36390,36861,36153,36135,36035,
+36561,36341,36461,36310,34101,35529,35566,35203,
+35118,34557,34734,35815,36357,35015,35929,34853,
+35814,35564,35676,34862,34762,34286,33984,33577,
+33265,32616,25338,25809,23605,23850,22755,23004,
+23706,22758,23918,26695,30042,32562,33268,33289,
+33885,35476,35777,33903,33768,26643,21660,20794,
+20075,19231,19109,19061,19435,19269,20007,21384,
+19830,19916,20193,20274,21303,20926,21037,23457,
+32044,32773,32364,23658,21793,22655,21895,22647,
+22794,22902,21905,22821,23666,24993,24022,23105,
+22650,22162,22293,21533,20924,20099,20356,19534,
+18638,18893,17267,18024,16740,17727,17854,16821,
+17697,17789,17708,17796,17853,17904,18153,17996,
+18332,18047,17624,18024,17740,17948,18448,19167,
+19185,20282,18610,22135,23763,26932,27475,24706,
+26127,21954,16953,17625,18756,17931,17761,17306,
+17634,17147,15771,16992,15882,17468,19518,16382,
+16267,19137,17601,16895,16967,14610,16791,13216,
+16569,15395,16713,15438,16371,16301,14346,14433,
+15135,15792,14238,15045,15243,15740,15502,15749,
+16116,16882,18315,15468,15900,15907,16501,18111,
+20661,17307,17264,16754,18477,15676,15819,15732,
+15955,15826,15961,15828,15840,19152,25834,26825,
+27793,30764,32040,32712,32862,32815,32873,32953,
+32987,32995,33603,33913,34309,34032,34032,33547,
+33002,33391,33069,33435,33773,33243,33647,33584,
+33495,33534,33515,33446,33287,33265,33078,33063,
+32898,32917,32909,32830,32784,32718,32697,32789,
+32782,32492,32844,33007,33109,33224,33407,33282,
+33198,33240,33102,32946,26480,27526,29295,29299,
+29562,29802,29804,29004,28670,27394,25089,22011,
+21087,20425,18996,19054,19125,19297,20854,23235,
+22421,21191,23346,23778,24034,23815,22760,24675,
+23694,21343,19359,18515,18939,18357,21110,22350,
+20365,20259,20823,20784,22969,33880,32250,25836,
+28395,23317,23448,22416,22538,22794,22692,22863,
+22260,22836,22338,23676,24648,23632,24195,23823,
+24015,23945,25686,24239,25154,25860,25127,25386,
+26185,25701,25603,26308,28524,28117,28057,27352,
+27524,26751,27893,25817,22687,13373,13911,20535,
+19520,20032,21715,19989,20369,18984,17946,18829,
+17794,17175,17106,16974,16311,16291,15702,16306,
+16110,18756,17328,17777,17370,18922,17935,17673,
+17061,17925,17754,17754,16997,19442,17969,18051,
+18283,18108,18999,18221,19500,19485,18464,18813,
+19698,21434,19045,19907,19437,20838,27207,28060,
+27160,27077,24978,24715,24823,26798,24171,24642,
+22419,20818,20738,21436,25578,24028,24177,24086,
+23968,21399,25368,20213,20496,20148,20383,19544,
+19935,20172,20034,19943,20070,20325,20698,20604,
+20836,20973,21351,21085,20872,20525,21083,21036,
+21090,21379,21900,21762,21367,21942,21775,21891,
+21802,21643,21557,21776,22293,22171,22097,22198,
+21806,22357,23082,22420,22416,22941,22780,22749,
+23307,23007,23294,23411,23667,23734,23847,23844,
+23668,23007,23155,22809,22569,22542,22424,22125,
+22041,21877,22035,21967,21033,20364,21494,21207,
+21077,20689,19976,20707,20933,20742,20693,21094,
+21572,22088,22310,19791,19764,23267,22181,22111,
+22389,21726,21605,21615,21311,20963,21017,20641,
+20445,21210,20886,20518,20958,20301,20296,19802,
+19942,19649,19191,18970,19096,18732,18582,18475,
+18603,18131,18667,18463,18333,18318,18766,19134,
+19082,19583,20375,20798,20622,20523,18294,28359,
+33538,33871,39116,43610,47065,45825,47153,47257,
+45660,45046,44760,45111,46841,48269,39120,37554,
+34441,33993,33630,33626,33410,33405,33406,33462,
+33499,33930,33646,33704,33719,33553,33820,34559,
+34572,34976,35082,34494,33587,33600,34062,33615,
+33879,34035,34639,35133,34905,34853,34387,33927,
+33918,33944,33813,34109,34449,34660,34709,35942,
+36068,34495,34917,35236,35314,35008,35324,34798,
+34413,34560,34809,35034,35015,34727,35756,34575,
+34214,33304,28946,24290,21898,20713,20099,20121,
+19636,19523,18942,19435,19275,19341,19212,18675,
+18570,18813,18494,17721,17554,18262,17472,17460,
+17232,17538,17510,17250,16624,16170,17110,16429,
+17493,17480,16589,18149,18417,18087,17504,18429,
+18716,18448,18687,19965,20743,20041,21741,21974,
+22209,22765,23085,24273,24627,25164,23992,23786,
+24566,23384,24395,23009,22297,22199,21729,21179,
+20398,20532,20406,21045,20278,20289,19872,20393,
+19503,19340,19313,16531,16649,16900,16931,16833,
+17356,17007,16773,16791,16704,16336,16403,16378,
+16368,16483,16588,16756,17102,17446,17872,18367,
+18771,19410,19869,21049,21884,22740,24059,26104,
+32418,34823,35460,38064,37261,36887,36781,37279,
+37452,37261,37400,37160,37061,37035,36687,36714,
+36667,36465,36451,36219,36087,36078,36107,36261,
+36407,36555,36559,36396,36363,36750,36781,36384,
+36396,36135,34560,34500,34995,35763,35868,35991,
+35496,34521,35339,36624,36546,36101,34415,34960,
+35256,34532,35307,35089,34746,34497,34197,33794,
+33716,33182,24672,25236,24222,23244,22874,22694,
+22364,22590,23272,24003,25533,28808,32373,33372,
+33455,36293,36358,35520,32885,24905,22155,20866,
+19931,19197,18702,19956,19892,19357,20166,20310,
+20421,20822,20133,20076,20388,20823,21144,21484,
+31708,32804,28597,23890,21641,21623,20856,22100,
+22941,21672,23455,23975,26120,24198,25257,23534,
+21827,22411,21765,21536,20225,20610,20631,19117,
+20288,18870,17725,17825,17948,17579,18149,17774,
+17764,17578,17529,17410,17604,17810,18515,18188,
+18066,18059,18296,18480,18094,18171,18373,19526,
+19467,18632,20889,23220,26019,27737,26880,23483,
+27318,22756,17938,15620,17787,18237,17226,16926,
+17733,16047,16617,17865,15499,17081,19299,25481,
+17422,18792,18735,18210,16613,15701,17418,14842,
+16039,15492,16071,17023,17065,16952,16276,15303,
+14172,14872,15524,14643,17198,15250,15515,16136,
+16170,17730,20157,15993,15729,15969,15987,17505,
+19825,20403,23036,20217,23245,16303,16160,15889,
+16038,15828,16002,15867,15979,17116,22413,25094,
+27576,29269,31095,32126,32571,32648,32628,32907,
+32934,32988,33206,33822,33945,33292,33870,33501,
+32916,32958,32991,33015,33228,33625,33428,33369,
+33453,33594,33420,33267,33292,33080,33049,32939,
+32904,32898,32889,32803,32778,32753,32724,32711,
+32717,32360,32861,33033,33152,33351,33566,33075,
+33093,33557,32977,32487,26015,27958,29032,29187,
+29041,28629,26290,24375,23589,21101,19803,19352,
+19287,19042,19056,19099,19091,19195,22311,26344,
+22380,25170,20571,24711,25887,25479,23083,25215,
+24346,23225,20854,19419,19590,20784,19395,21746,
+20208,20494,21623,22151,22050,31832,29020,23787,
+24015,23802,23397,22778,22799,22776,22920,23158,
+22947,23382,22542,24716,24765,24370,24250,24105,
+24184,24393,25451,26219,25542,25240,26687,26069,
+26180,26485,26097,28425,27073,27953,27320,25971,
+23987,17958,19026,18231,18375,17799,21089,20172,
+22460,25244,31760,25538,26214,22493,18059,18287,
+17170,16567,16446,16652,16500,16883,16954,16992,
+16537,16446,18765,24774,18816,19032,17562,16890,
+17337,17550,17383,17709,18116,18010,17521,17990,
+17779,18150,18318,18278,18500,17793,18239,19321,
+19087,19680,20394,27477,23391,26361,22293,23804,
+22875,22686,21086,22138,26720,23683,26703,24265,
+20316,21345,20392,20727,20418,24184,26342,22400,
+21986,21162,20915,20328,20816,20420,20622,20634,
+20202,20808,20402,20219,20156,20575,20823,21335,
+20595,20829,21580,20595,20699,21104,20897,21015,
+21207,21303,21199,21663,21534,21699,21511,21684,
+21590,21687,21747,22077,22106,21864,21664,21835,
+22243,22116,22113,22492,22641,23460,23040,24177,
+23501,23578,23382,23694,23927,23820,23751,23814,
+23557,23061,23209,23127,22920,23065,22256,22242,
+22515,22131,21589,21767,21590,21741,22201,21180,
+21737,20408,19779,20506,20940,21229,22857,20952,
+21912,21630,22098,22304,21606,24237,21387,21639,
+21947,21906,21796,21635,21240,21182,20984,21681,
+20146,21414,22147,21158,21177,20661,20586,20469,
+20182,19672,20037,19125,18957,18754,18442,18491,
+18549,18145,18486,18573,18446,18374,18596,18977,
+19071,19562,20137,20025,19480,17349,25994,32424,
+34239,38834,44997,45114,46044,44155,46656,44451,
+44799,44193,47329,45699,46673,39401,38142,35987,
+34200,33762,33592,33559,33428,33408,33401,33447,
+33463,33640,33524,33573,33765,33638,34324,33591,
+33816,35162,34969,34806,34836,33951,34157,34200,
+34503,34358,34296,34488,34714,34875,34821,34383,
+33871,33918,33733,33922,33923,34216,34650,34533,
+35604,34908,34427,35283,35287,35273,34796,34369,
+34329,34556,34738,35031,34361,34218,34377,34536,
+33771,33222,29674,24584,22241,21116,20391,19839,
+19580,19196,19037,19165,19284,19153,19127,20216,
+18957,18579,18141,17519,17342,17910,17831,17478,
+17544,17433,16798,17144,16623,16252,17648,16400,
+16087,17794,17754,18321,18833,18873,18866,18330,
+19692,19359,19428,19895,20630,20697,21504,22289,
+21997,21900,22719,24770,25921,24747,23404,23237,
+22697,23237,23328,22705,22153,22154,21802,20167,
+20976,21359,20550,20380,19884,20544,21091,18637,
+19705,19065,17767,18117,17558,18234,17147,16866,
+16878,16457,16335,16559,16491,16383,16331,16437,
+16458,16493,16534,16695,17024,17406,17910,18438,
+18942,19602,20114,21006,21927,22563,23656,24837,
+30608,34890,35313,35721,37688,37062,37188,37087,
+37526,37398,37360,37258,37449,36940,37028,36700,
+36744,36772,36462,36169,36104,36096,36169,36267,
+36509,36576,36497,36333,36417,36632,36378,36340,
+36573,36609,36494,36591,34886,34865,35775,36321,
+35979,36009,36774,36673,38130,34433,34488,35155,
+35166,35010,34578,34338,34278,34161,34269,33908,
+33324,32860,24881,25970,24120,22955,22665,22522,
+22446,22447,22730,23130,24117,25734,28465,32936,
+33444,38043,36184,34530,32510,23655,21497,20261,
+19682,18945,18756,18599,20091,19467,19782,20169,
+20682,20091,21321,20508,20358,20844,20925,21186,
+31825,32491,29283,24386,22192,21800,21740,21284,
+22998,22567,22335,22995,25882,24485,23821,22951,
+23415,22190,22678,21493,22494,19869,19692,20733,
+17418,18285,18522,17987,17724,17420,17522,17386,
+17150,17367,17250,17126,17613,18202,18401,18192,
+18120,17912,18392,18150,18581,18961,19530,20961,
+17689,19017,21437,21848,25031,25920,25089,23081,
+25497,23618,18080,17145,18120,18564,16757,16064,
+17046,14719,16839,17553,15972,16126,18751,17874,
+17829,19200,21549,18774,16644,16041,17079,18513,
+15760,15095,17585,18264,18313,17874,17862,15764,
+15175,15273,15452,16160,17905,16572,16642,16788,
+17272,22821,22069,16037,15913,15936,16035,16563,
+18246,19905,19911,20543,15563,16005,15490,15876,
+15751,15906,15690,15766,15853,15997,20104,23920,
+24295,25644,26989,31667,31959,32205,32637,32682,
+32766,32884,32983,32994,33102,33543,33511,32889,
+32715,32830,32952,33063,33701,33705,33316,33318,
+33714,33777,33753,33310,33521,33587,33091,33008,
+32959,33069,32932,32799,32694,32730,32587,32871,
+32738,32640,32778,33022,33169,33474,33615,32987,
+32997,32989,31679,24936,26451,26628,28569,28095,
+27009,23064,21945,19987,19110,18996,19104,19035,
+19139,19068,19146,18903,19236,19840,21332,26501,
+23855,21549,19233,20858,25581,24753,22968,25740,
+20051,24034,26952,20726,21276,20557,20586,22689,
+20156,22245,25216,27777,17873,26935,28003,29670,
+25821,23374,23326,22818,23282,24633,24588,22466,
+24045,23973,23973,23720,23809,23829,24638,24204,
+24528,24052,24858,26337,26677,26388,25986,26652,
+26293,26741,27509,26647,26619,28567,26666,23121,
+18162,20279,19782,19060,18744,19545,25485,32997,
+32800,20661,19822,22866,19702,18717,17551,18013,
+17657,17350,16905,16347,16651,16621,16920,16785,
+16558,18915,19530,22832,22596,21376,17558,18180,
+17304,18078,17906,17079,17574,17433,17385,17375,
+17781,17914,17776,17436,17847,17854,17889,18228,
+18323,18919,19995,26820,21088,28743,22385,19028,
+19131,18847,19834,19741,19419,19335,20270,20301,
+21456,19711,19656,19633,19849,20310,21546,21391,
+21039,20531,21078,20562,20649,21317,20550,20091,
+20048,20058,20103,20127,20076,21058,20361,20451,
+20657,21436,21141,20627,21234,21535,20913,20996,
+21545,21196,21290,22773,21652,21616,21342,21729,
+21942,22115,22098,22089,22032,22086,22569,22120,
+22214,22380,22105,22913,22404,22805,22847,23520,
+23284,22404,23691,22963,25022,24432,24137,24228,
+23580,23871,23179,23867,23370,22759,22590,22365,
+22278,22233,22116,21822,21350,20817,20659,20996,
+20627,20686,20514,20337,20591,21072,21535,20933,
+20897,21421,22134,21799,21551,21430,21954,21603,
+21393,21864,21610,21781,21402,21447,21540,22026,
+21510,21441,21278,22700,21106,20348,20367,20613,
+20790,20298,19769,20054,19261,18786,18507,18502,
+18507,18348,18427,18640,18054,18273,18805,19158,
+19481,19668,19747,18801,16827,23647,31520,32952,
+37125,44509,45891,45117,41121,46386,46191,44307,
+46376,48686,45391,40863,36297,37983,34962,34265,
+33601,33618,33601,33607,33410,33391,33376,33384,
+33399,33394,33411,33629,33584,33610,34246,33773,
+34809,34779,34683,34693,34483,34455,34138,34200,
+34453,34262,34297,34215,34348,33914,34111,34395,
+33927,33847,33708,33718,33848,34166,34825,34154,
+35042,35484,34414,35766,35260,35191,34860,35215,
+34322,34420,35436,35032,34351,35011,33990,34206,
+33879,33428,32539,24991,22477,21540,20583,19827,
+19788,19497,19548,19320,19208,21258,18825,18615,
+19001,18502,17964,19873,17556,17539,16244,16581,
+17292,17028,15558,17988,16140,16874,16574,17145,
+17403,17208,17110,17334,17529,17343,18708,18257,
+19618,19919,19585,20253,20341,21830,21828,22027,
+22584,23499,24583,25128,23301,23109,22130,22740,
+23008,22863,22320,21718,22068,22109,22044,22485,
+21517,20636,21118,21045,21264,21145,20274,20033,
+19979,20552,20411,17987,17076,15125,16149,16717,
+16180,16396,16374,16378,16314,16309,16297,16379,
+16431,16391,16454,16653,16974,17418,17902,18325,
+18819,19365,19978,20749,21523,22300,22999,23874,
+29646,35029,37328,35701,38633,37914,37672,37691,
+37792,37738,37563,37426,37296,37132,36827,36697,
+36707,36881,36591,36225,36109,36120,36203,36318,
+36246,36219,36528,36720,36501,36860,36524,36647,
+36679,36655,36663,37133,35916,35455,34786,35578,
+35959,36755,36394,36645,34916,34416,36498,35481,
+34863,35740,35147,34751,34440,34287,33922,33768,
+33826,29807,28086,25368,23835,23109,22548,22422,
+22366,22522,22278,22600,22941,24041,25652,32286,
+32673,35373,34697,34356,30624,22942,21663,20478,
+19590,18992,19103,19938,19295,19632,19549,20027,
+19541,19944,20284,20382,19845,20985,21122,21282,
+24365,31355,28945,24576,22246,21568,21647,21618,
+22714,22425,22830,23961,23239,22905,23657,22501,
+21831,22033,20993,21815,21075,20832,19802,19513,
+18965,19317,18211,17654,17409,16662,17511,17371,
+16981,17078,17286,17139,17211,18348,18435,17994,
+18320,18217,17967,17772,18732,19652,21998,19468,
+17563,17511,18848,19149,20364,21557,20965,21078,
+25244,24942,19033,17365,17691,17535,17045,16635,
+17294,15537,15735,17343,15601,16101,18061,19709,
+20093,18105,18734,18539,18163,16047,16485,14241,
+15245,15504,18075,19273,18267,17872,16821,16076,
+16728,14867,16895,16302,16358,15367,16004,16424,
+17179,25995,19126,17397,16093,15832,16615,16242,
+16983,18353,18393,17588,15808,16088,16028,15976,
+15904,15903,15892,15723,15652,16590,18893,24489,
+26117,25833,27537,30442,31535,31870,32153,32475,
+32656,32754,32821,32982,32991,32994,32988,32670,
+32538,32791,32922,32895,33147,33252,33181,33663,
+33621,33814,34140,33717,33397,33419,33272,33041,
+33015,32996,32956,32887,32821,32774,32738,32796,
+32787,32901,32541,33093,33166,33306,34714,32976,
+32988,24882,24708,24222,24396,27372,27080,24798,
+20886,19839,19452,19302,19021,19077,19092,19014,
+19034,19080,19125,19193,20095,21910,23652,26033,
+26669,26194,22653,21162,19943,24425,23333,25635,
+24039,20809,23500,23909,25782,23418,23293,24868,
+25672,28215,30021,27573,13380,25197,29928,30300,
+27266,21451,23876,21753,23796,23556,23559,25314,
+24369,24627,23712,24198,24204,24191,24562,24295,
+24559,25460,24664,26908,26730,26726,26172,27720,
+25431,28116,26589,25198,25719,19761,18927,31512,
+22110,19693,25046,23015,19298,22457,21717,28740,
+19292,18236,18403,18285,18254,17826,17306,17701,
+17178,17529,16579,16842,17085,15888,16749,16437,
+19926,26164,23727,24723,25476,23906,20670,17166,
+17199,17461,17692,20783,17052,17921,17694,17448,
+17806,17704,17371,17272,17312,17463,17776,17988,
+18414,18714,19221,23596,19058,18950,18778,19225,
+19201,19032,18629,18997,18491,18462,19487,18643,
+20771,19719,19495,19596,19623,20067,21092,20521,
+20973,20907,20616,20398,20523,20673,20305,20396,
+19884,19911,19665,19976,19873,19781,20379,20873,
+22777,21342,20830,21777,22230,22731,21920,21531,
+21054,21273,21150,21043,21103,21386,22239,22736,
+22224,22125,22289,22317,21918,22339,22059,21781,
+21978,23033,22161,22800,22191,22210,25187,22558,
+23820,23621,23544,23385,24503,23642,24072,23937,
+24891,23926,23994,23591,23346,22993,22484,22449,
+22100,22291,22056,21630,21587,21363,20679,21051,
+20586,20107,20003,19478,23342,20610,21885,20586,
+21039,21099,21296,21365,21192,21537,21230,21946,
+21346,21951,21839,20437,22108,21808,21714,21384,
+21535,21063,21428,21430,20970,20922,20865,20758,
+20394,20490,21147,20517,19546,19393,19317,18763,
+17987,18570,18077,18513,18542,18695,18891,18547,
+19410,19700,18932,17523,22437,29019,32426,33378,
+43736,46750,47643,43688,39746,41700,45870,42852,
+44495,40849,36555,35893,34533,34503,34074,33723,
+33600,33543,33600,33600,33414,33393,33384,33382,
+33398,33397,33537,33471,33607,33594,33861,33995,
+34804,34401,34509,34483,34490,34218,33990,34125,
+34220,34205,34203,34059,33912,33917,33893,33912,
+34374,33821,33633,33920,33789,33978,34650,33987,
+34627,34717,34368,35739,35356,35151,35076,34837,
+34345,34351,35708,35427,34856,35849,34572,34781,
+34299,33481,32865,28176,23670,21979,20927,20080,
+19898,19839,19660,19740,18693,19244,19359,18553,
+18105,17844,18132,16787,16719,17052,15517,16035,
+16364,16824,16343,17002,16607,16335,16571,16766,
+17067,16428,17163,17046,17198,17415,17981,18058,
+18402,19754,20307,20150,21477,21625,20934,22059,
+22554,23477,25397,24667,24067,23358,23180,22413,
+22450,21848,21849,20909,21888,22567,21381,21612,
+20798,20133,21266,23177,22238,20706,18605,18994,
+19985,19390,18901,17835,16890,15976,16368,17805,
+16527,16323,16223,16323,16257,16287,16278,16342,
+16377,16557,16490,16688,16978,17301,17689,18262,
+18675,19319,19942,20641,21440,21982,22689,23786,
+26316,33694,35412,35415,35897,36570,37931,37860,
+37919,37880,37188,37214,37400,37536,37289,36915,
+36834,36675,36416,36260,36194,36168,36270,36423,
+36270,36405,36666,36916,36861,36528,36489,36453,
+36512,36791,36817,37062,37554,36749,34746,34916,
+35382,36037,36327,36414,34527,34416,37023,36041,
+34824,34840,34893,34710,34576,34660,34179,33954,
+33457,29305,26712,24636,23631,22992,22482,22397,
+22353,22976,24384,22315,22464,22957,23547,25947,
+33111,32976,33464,33558,27237,21889,20914,20259,
+19555,18471,18930,19676,19163,19623,20148,19926,
+19935,19852,19920,20295,20655,20799,20711,21633,
+23520,30168,27168,23978,22315,21605,21285,20730,
+21608,23383,23259,23617,23361,20139,23849,21314,
+21769,21496,22413,22375,21147,21346,20132,19464,
+19066,19336,17858,17879,17603,17909,17591,17557,
+17012,16899,16724,16942,17298,18424,18068,18558,
+18822,18513,17673,18253,18179,19090,20256,19130,
+18834,18091,18624,18780,19966,18583,19624,19673,
+24227,26003,18780,17476,18496,17745,16033,16605,
+17802,16260,17024,17407,15722,16031,19602,23911,
+29883,18903,18123,17174,18312,16140,15839,15314,
+14068,16399,18975,19653,19568,21996,20266,16616,
+15458,15918,21207,16787,18947,17959,18690,20017,
+24637,22521,25767,19209,17487,16656,16686,17020,
+17464,17467,17383,17813,16545,16141,16252,16135,
+16024,16191,15876,16038,16103,16206,18166,26088,
+24554,26828,26541,28118,31296,31653,31662,32355,
+32589,32596,32805,32869,32901,32853,32709,32665,
+32706,32803,32844,32891,33000,33330,33169,33315,
+33185,33114,34005,33900,33553,33279,33507,33080,
+32973,32969,32952,32926,32859,32732,32732,32782,
+32812,32656,32790,33048,33192,33330,33712,32991,
+24678,24717,23945,23429,24502,25332,23996,20292,
+19732,19612,19795,19359,19196,18977,19151,19143,
+19167,19157,19260,19830,21846,23364,25328,26880,
+26892,26874,25632,22965,20735,23027,24135,23220,
+25197,23802,22627,23661,23486,21609,20043,20950,
+26154,26897,26664,24354,15547,31193,28033,28706,
+25587,22975,21369,22981,22836,22981,22836,23016,
+25164,24370,23267,25769,26238,25676,27026,25419,
+24166,24375,24924,24746,24227,21347,23557,20909,
+22978,32116,27653,21999,24689,23857,24990,21140,
+21595,24324,20954,21372,20946,19004,19086,18651,
+18427,18203,18129,18312,18070,17721,17456,17330,
+16834,17639,18128,16331,16010,15713,16646,16948,
+20506,23934,25224,25754,25529,24697,21528,18214,
+17922,17244,16101,17834,17320,17601,17729,17957,
+18313,18078,17574,17238,17466,17858,17809,18077,
+18552,17820,20314,19033,19305,19412,18764,20544,
+18177,18462,18922,19337,18630,18984,18201,18878,
+19480,19490,20048,20010,20216,20417,20403,20485,
+20865,21195,20849,20687,20579,20395,20648,20025,
+19665,20054,19832,19894,20020,20043,20426,21006,
+21008,21160,20938,20616,20988,20760,20652,21075,
+21207,21166,20897,21478,21246,21157,21484,22008,
+21667,21694,21789,22491,23022,21744,21798,21672,
+22034,22719,22256,22053,22347,22572,23643,24288,
+24518,24051,23484,23382,23196,23181,23264,23923,
+23682,23939,23806,23460,23187,23116,22825,22542,
+22479,22173,22070,21639,21693,20689,21045,20772,
+20187,19961,19921,20080,19688,20490,21555,19932,
+21003,20001,21142,21051,21303,21342,21697,21733,
+22611,22065,21960,21645,21684,22162,21753,21596,
+21335,21244,20755,20782,20526,20679,20961,20676,
+20541,20492,20680,20754,20208,20251,19497,19662,
+18529,18423,18386,18394,18804,18958,19122,19131,
+19104,18826,17968,17526,27006,31236,32606,39291,
+45200,47088,44925,44434,35966,38635,36384,39399,
+41237,35379,34797,34048,33780,33597,33608,33658,
+33600,33603,33623,33600,33403,33368,33424,33457,
+33606,33457,33654,33542,33590,33912,33984,34797,
+34000,34200,34208,34200,34200,34199,34125,34020,
+33900,34200,33932,33921,33914,33816,33855,33937,
+33935,33903,33573,33619,33873,33786,34119,33856,
+33915,34467,34861,35816,35267,34956,35317,35345,
+34404,34334,34758,35805,36077,34125,34351,33715,
+34208,33502,32943,33014,26301,22797,21681,20473,
+20131,20067,19578,21326,19249,19266,20280,19352,
+21163,17457,17066,16750,16556,16739,16261,16331,
+16681,16839,17345,15649,14964,16820,17166,17493,
+17141,17628,17552,18189,18367,17843,18329,18283,
+18276,19455,19417,21014,21454,19988,20280,22261,
+21828,22592,26001,23954,23961,22982,22097,22884,
+22029,21198,20972,20359,20543,20648,20292,20619,
+20770,21900,21974,26682,26483,22863,20871,19917,
+18432,19178,20554,18441,17068,17112,16983,16266,
+16695,16371,16290,16300,16237,16203,16344,16310,
+16402,16524,16632,16640,16933,17303,17637,18123,
+18580,19049,19941,20726,21270,21858,22262,24110,
+26572,29819,33690,35644,35862,38621,38618,37985,
+38293,38049,37137,37112,37483,37179,37029,37127,
+36978,36481,36362,36297,36243,36315,36744,36790,
+36544,36624,36467,36738,36673,36826,36723,36909,
+36618,36798,36678,36808,36795,37517,36708,34836,
+35145,36252,36375,35754,34421,34416,36885,37035,
+35225,34428,34368,34377,34286,34332,34040,33906,
+33246,31008,25636,24995,23322,22701,22692,24277,
+21772,23677,32995,22924,22353,22503,22722,32828,
+31435,32988,34052,33063,28413,21410,20863,20379,
+19184,18972,19123,19006,19041,19171,19530,20555,
+19980,19861,19851,20036,20199,20529,21201,21493,
+22652,27309,26623,24318,23094,21608,21174,21861,
+22558,21067,23896,24345,23424,24227,22697,21938,
+23001,21613,21076,22273,22368,21868,22097,19067,
+18701,18936,17761,18312,17983,17543,17508,17612,
+16705,16416,16871,16849,16600,17865,17685,17831,
+18357,18434,17859,18403,18028,19035,20192,20600,
+18126,17681,17973,18536,18903,18577,18214,19420,
+23181,27373,18315,16539,17703,18852,16593,16869,
+16308,15362,16496,16652,15891,18495,19233,22033,
+20045,18848,19271,17698,19962,16296,17934,15058,
+14786,17330,18750,18613,23256,18471,20663,19254,
+15501,16372,18429,15336,16923,18492,20231,16464,
+21252,20541,20203,20104,18941,19831,21390,21951,
+18531,21264,16550,16099,16966,17378,16499,17258,
+16185,15756,16302,16240,16244,16775,18369,22069,
+24762,26195,26001,27296,27909,31074,31445,32393,
+32429,32761,32717,32741,32733,32727,32789,32698,
+32697,32744,32790,32877,32964,33090,33015,33099,
+33057,33051,33910,33822,33400,33153,33270,33237,
+33174,32991,32958,32891,32886,32784,32761,32833,
+32833,32742,32637,32950,33114,33256,33111,32991,
+24336,24486,23244,24267,23604,23871,20572,20722,
+20487,20298,19686,19497,19346,19260,19289,19569,
+19427,19592,19736,22828,23297,23823,25961,27391,
+27609,27272,26895,26196,22557,21136,25593,20061,
+26090,26088,23218,22223,20061,20527,19919,21002,
+21407,20607,20394,18614,16683,28983,26985,23336,
+24006,22776,24277,23010,22900,23491,23070,26044,
+26869,26871,23295,23303,25104,24846,24653,23963,
+28774,23990,24462,22946,23299,26253,23827,25155,
+27581,30173,24358,24543,25731,27389,23985,25133,
+29357,20569,29254,26979,23388,19056,18835,18600,
+18468,18095,18549,17702,17778,17545,17033,17246,
+16643,16204,16731,16782,15993,16779,17240,19153,
+21403,23328,25375,25551,25841,25031,22014,17674,
+17442,17479,17439,17482,17548,17743,17482,17627,
+17523,17669,17700,16735,17322,17390,17475,17538,
+17800,18937,18723,18666,18183,18307,22260,19268,
+18687,18327,18486,18705,18552,19014,18781,18536,
+18612,18341,18631,18222,18010,20270,21204,20931,
+20678,20705,21132,20635,20695,20222,20214,20547,
+20069,20073,20217,20382,20328,20262,20782,21006,
+20793,20918,20961,20428,20846,20442,20798,20760,
+21273,21129,20962,21512,20856,21532,20411,21246,
+22317,21210,21756,21839,21584,21719,21674,22038,
+22651,22416,22368,22316,22402,23286,22541,23222,
+22758,22917,23549,23685,22936,23094,23291,23485,
+23508,23996,24597,23879,23322,23161,23088,22584,
+22485,22137,22019,21809,21607,21075,21299,21354,
+20252,19851,20010,20128,20576,20178,20700,20736,
+20779,20476,20736,21085,21129,21305,21213,22679,
+22536,22802,22079,22004,21672,21735,21380,21137,
+21182,20946,20832,20479,20386,20997,20912,20534,
+20564,20407,20163,20174,19887,19954,19806,20157,
+19207,19018,18723,18633,18723,19355,19314,19151,
+18777,18114,15503,26018,28584,32608,34908,40793,
+45144,44804,39066,36522,39155,39453,35991,40975,
+37635,34511,33898,33775,33664,33612,33600,33571,
+33562,33600,33580,33584,33423,33379,33461,33434,
+33551,33429,33522,33864,34196,33940,33940,34215,
+34296,33982,33954,34196,34079,34077,34160,34198,
+33899,34068,34205,33801,33786,33725,33885,33900,
+34001,33930,33592,33587,33784,33753,33905,33812,
+34325,34668,34447,35680,35298,35220,34961,35243,
+35100,34279,34362,36344,35883,34586,34767,33942,
+33786,33570,33454,33429,32965,25814,23145,21410,
+20595,20184,19315,22084,20781,18447,19107,20038,
+19353,17322,17184,16326,16580,16569,16411,16389,
+16713,16386,16755,16171,16350,17719,15771,16920,
+17652,17201,17869,17538,17763,17621,17857,18639,
+19054,19337,18003,19921,19179,20177,21016,21718,
+22933,23903,22473,23538,24234,22412,22584,21750,
+21971,20992,21102,22935,20351,20469,20208,21297,
+20799,21113,21573,21668,21059,20229,19698,18527,
+18918,18292,17667,16470,17879,16455,18042,17371,
+16336,16124,16323,16314,16245,16287,16314,16208,
+16506,16464,16506,16756,16951,17298,17753,18157,
+18480,19216,19955,20601,21446,22212,22654,23703,
+26811,27942,31137,33493,36381,38142,37674,37313,
+38111,38183,37370,36995,37129,37319,37146,37071,
+36872,36374,36282,36232,36207,36180,36624,37111,
+36862,36830,36639,37003,37058,36969,36900,37074,
+37110,36531,36607,36494,36508,37005,37171,35115,
+35175,35892,36546,37336,34416,35204,35468,35055,
+35004,35022,34550,33950,33912,34303,33918,33928,
+33380,31541,27498,25255,23865,22833,23099,32838,
+28563,25296,23563,23089,25639,27156,22432,31429,
+30407,32898,33106,29399,22407,20984,20180,19734,
+19454,19280,20123,18903,19126,19230,20859,19865,
+19975,20205,20168,20121,20179,20565,20799,22812,
+23957,25845,32087,25275,23850,20892,22408,20556,
+22069,21183,23730,21832,23864,23454,22010,23638,
+20716,21493,21336,21491,22119,22511,21788,19808,
+19563,19067,18833,18391,17906,17512,17457,17502,
+17159,16611,16914,16881,16689,17645,17168,17385,
+18227,18361,17538,17774,17962,17708,19485,19938,
+18229,18381,16871,17549,18372,18646,17876,18870,
+21868,27741,21137,17183,16432,17208,16329,16418,
+15515,15430,16173,16462,17324,18423,21981,20704,
+20158,23866,19351,18066,22568,17115,16713,16272,
+15725,18003,18756,20156,19848,18753,17499,18962,
+17105,18251,17109,16005,16374,17015,16955,17067,
+17422,18107,19144,20445,21354,24287,24381,25256,
+19205,24806,19781,17804,18750,15817,17817,17274,
+17391,16733,16608,16581,17038,17276,17961,21753,
+23934,22632,22275,24909,28106,31043,32871,32749,
+32744,32686,32733,32779,32725,32748,32717,32710,
+32673,32723,32841,32861,32901,32922,33030,32974,
+33005,33014,33400,33451,33057,33046,33013,32996,
+32980,32997,32962,32916,32835,32718,32793,32754,
+32828,32861,32922,33007,33155,33200,32991,32991,
+25052,23874,23970,23354,22416,22808,21435,21618,
+21132,20667,20073,19642,19390,19613,19645,19935,
+20082,20208,20418,21174,21387,21985,25042,26539,
+26551,26946,26589,25459,24369,24442,22467,22368,
+27584,25882,21779,21636,19990,18527,20506,18609,
+19458,19758,19395,13293,20060,27544,27803,27602,
+26521,26539,21656,22810,25528,24397,23519,26996,
+25415,26472,19698,21373,23511,23659,23727,23980,
+23502,24360,22308,23455,24305,25560,24264,23776,
+32988,23879,28540,32121,28746,21894,21288,20845,
+20241,19163,19143,19058,19545,18900,19006,19497,
+18570,18460,18021,18207,17511,17280,16737,16723,
+16821,15965,16748,16355,19087,20089,22079,21983,
+22003,22649,24555,25323,25248,24172,21327,17997,
+17254,17436,17103,16673,16932,17119,16989,16923,
+17168,16641,16935,16324,16656,17226,17167,17541,
+17424,18048,17835,18754,18789,17990,17815,18264,
+18432,18715,19172,18897,18510,19010,18660,18507,
+18574,18294,18555,19041,19249,19971,22275,19971,
+20101,21528,21666,21219,21160,20728,20426,20760,
+21021,20311,21011,20713,20559,20573,20873,21081,
+21123,21159,20992,21260,20655,20893,20813,20771,
+21093,20993,21157,21508,21177,20976,21300,21542,
+21495,21470,21990,21576,21723,21536,22143,21609,
+21819,21827,21900,22285,22335,22461,21357,21949,
+22250,22528,22328,22338,23014,23019,23052,24288,
+24039,23706,24067,23627,23171,22893,22683,22389,
+22151,22260,22111,21684,21316,21119,21489,21038,
+19316,20109,20249,20337,20538,21747,21203,19956,
+20316,20439,20717,20843,20999,21341,21522,21870,
+22277,21973,22119,21884,21696,21528,21543,21315,
+21002,20941,20586,20248,20998,20730,20366,20637,
+21112,20262,19965,19987,19921,19851,19706,19476,
+19614,18765,19068,19590,19158,19450,19330,18828,
+18102,15795,22216,28655,32526,32919,42208,46667,
+44667,47486,45754,35562,35589,34626,34437,34203,
+34189,34252,33897,33808,33890,33887,33609,33602,
+33602,33608,33472,33486,33465,33444,33496,33657,
+33987,33622,33562,33999,33667,33601,33730,34203,
+34085,34135,34055,33846,33963,33774,34321,34038,
+33888,34257,34202,33896,33747,33909,33837,33857,
+33936,33894,33552,33634,33747,33980,33906,33916,
+33950,34358,34752,35711,35313,34642,34337,34328,
+34809,34386,35248,35755,35216,36150,34935,34923,
+34396,33831,33922,33511,33081,32183,24732,22326,
+21080,21579,19725,20579,18888,19200,22728,20772,
+18472,18343,16453,16817,16521,16574,16530,16488,
+15990,16338,16380,16362,16217,17907,18051,15951,
+16764,17172,17591,17770,17782,17937,18529,18513,
+18694,19491,20055,19972,20045,21171,21978,21151,
+22156,22624,23050,22548,22870,22856,22593,22573,
+22405,22205,21922,20949,20725,20340,20357,20453,
+20492,20509,20559,20904,20134,21579,19496,18644,
+18712,18995,17982,16178,18930,18117,17157,16929,
+16397,15959,16254,16251,16188,16302,16288,16382,
+16302,16471,16611,16798,17022,17324,17721,18135,
+18445,18938,19713,20331,21131,21556,22254,23358,
+26688,27441,29901,32709,36537,37074,37465,37560,
+37592,37999,37497,36870,36946,36895,36938,36789,
+36486,36350,36342,36270,36220,36326,36435,36738,
+37268,37359,37367,37320,37329,36855,36944,36568,
+36415,36782,36322,36482,36540,36799,37029,36675,
+36056,35799,36386,37965,34416,34416,34884,34998,
+34479,34524,34374,34239,33702,34158,33916,34864,
+33133,32492,25967,26880,24703,23544,33090,25515,
+23142,22830,22809,22471,21778,22224,22698,22108,
+22639,25182,29508,25071,22200,20881,20223,19922,
+19515,18912,19003,19019,19572,19834,19829,21999,
+20196,21006,20032,20208,20481,20712,22339,22906,
+24327,28520,32454,32481,26510,25236,22659,20865,
+21807,22334,22569,22691,22958,22115,22501,21094,
+22668,21008,19967,21728,23484,23217,22210,20591,
+20274,19034,18741,18084,17754,17721,17355,17150,
+16968,16554,17481,17035,17022,17106,17149,17250,
+17855,17998,17607,17532,17912,18096,18544,20063,
+17553,17854,16521,16332,17355,19329,17133,18920,
+21883,27728,23210,16991,16878,18235,18160,17388,
+15996,15503,16770,16256,16805,17697,18990,18105,
+18749,26184,20063,19709,22831,17260,17926,17373,
+16994,17626,23539,18192,18930,18345,23428,22790,
+20604,18199,19802,18913,16189,18995,19447,17322,
+17146,17843,18443,20215,20543,20334,21534,22648,
+20409,22507,20496,19935,19274,19156,17401,16668,
+16866,15644,16332,16121,16908,17948,18623,21035,
+20551,22881,24783,23836,27310,30887,32505,32247,
+32297,32085,32593,32745,32863,32745,32664,32649,
+32763,32807,32787,32814,33102,33108,32985,32893,
+32937,33047,33058,32962,32959,32934,32992,32966,
+32962,32982,32947,32920,32904,32808,32827,32803,
+32878,32957,32788,32823,33102,33114,32971,32988,
+29219,25238,26896,26554,25747,24210,23561,23293,
+23224,23624,24212,22682,22250,21223,21759,21464,
+21831,22917,30470,32334,29361,23574,22325,22962,
+24263,25811,26435,26422,24685,23643,20267,26272,
+30070,24985,21110,19855,18757,21627,18352,20542,
+19991,19273,18385,9397,24675,29055,27195,24765,
+26160,22593,22948,25122,23632,23086,22894,23940,
+27136,21627,23502,28483,22722,20812,22304,26823,
+31587,30147,23120,24087,28826,27470,24882,25245,
+23329,29323,26367,22665,22059,21934,24180,22797,
+22409,20283,19308,18258,19363,19095,18923,18774,
+18657,18513,18480,17751,18021,17239,17298,16906,
+17271,16794,16898,16610,20070,18866,20744,21845,
+20934,23637,25166,25369,25314,23214,23931,18815,
+18213,17472,17561,17618,16874,17393,16779,16475,
+16776,15899,16427,16235,16599,16661,17630,17449,
+23842,19722,18163,18509,18054,20459,17916,18548,
+18478,18888,18411,18327,18462,18436,19333,18509,
+18423,18752,18672,19011,18802,19578,21162,20445,
+21210,22871,20856,20787,23936,23562,22333,21468,
+20841,21189,20509,20958,20339,20520,20510,20982,
+20963,21030,21361,21036,20430,20683,20557,21126,
+21489,21309,21315,21329,22262,22139,20968,21336,
+22210,22672,22718,22187,21214,21852,22059,21073,
+21029,20746,21039,21706,21525,21421,21853,21840,
+22299,22341,22294,22400,22467,22654,23419,23378,
+23588,23556,23787,24141,23391,23100,22913,22428,
+22175,22322,22489,21962,21392,20668,21026,21321,
+20443,20043,20203,19492,20064,20112,20766,19995,
+20307,20772,20909,21429,21097,21357,21272,21445,
+22117,21377,21457,22774,21610,21553,21594,21237,
+20992,20993,20672,20619,20247,20568,20456,20526,
+20361,20085,19941,20001,19611,19629,19790,19468,
+18975,19232,19524,19876,19578,20017,18721,18899,
+17085,19534,26225,31332,32760,35697,42747,45802,
+41902,37470,35664,34198,34085,35478,34011,34019,
+34521,34137,33933,33820,33865,33601,33549,33526,
+33495,33594,33490,33410,33543,33524,33666,33591,
+33900,33842,33894,33600,33748,33683,34183,34080,
+33811,33596,34006,33597,33761,34185,33894,34113,
+34002,33896,33882,33900,33764,33679,33850,33921,
+33899,33884,33552,33614,33684,33913,33810,33845,
+34434,34776,35281,35110,35172,35033,34356,34311,
+34314,34147,35689,35477,35467,35510,34935,34600,
+34443,33877,34542,33515,33420,32995,27380,24420,
+22746,21334,20008,18843,18908,19185,18331,17931,
+17550,16959,16992,16818,16767,16587,16554,16356,
+16500,16913,16139,16586,15441,16649,17068,17238,
+16428,17218,17673,17555,17585,18429,18353,17900,
+18987,19398,20055,20210,21062,21690,22055,21273,
+22137,22715,23196,23716,24019,24991,25293,23320,
+22293,22571,21760,19541,20451,21147,19896,20187,
+19495,20017,20514,19190,19457,18834,24013,18726,
+17745,18246,17288,17872,18623,18373,21270,17281,
+16346,16167,16254,16249,16320,16321,16219,16317,
+16350,16309,16351,16749,17091,17433,17795,18197,
+18672,18825,19837,20064,20997,20724,21270,22712,
+25601,28363,29963,32988,35500,37368,37182,38368,
+38088,37412,37188,36342,36943,36855,37030,36702,
+36607,36387,36199,36311,36321,36353,36485,36562,
+37182,37185,37374,37224,37723,36597,36978,36624,
+36461,36642,36648,36480,36525,36564,36989,37426,
+36769,36017,36218,36665,34416,34533,35226,34836,
+35226,34836,34826,34382,33570,33447,34041,33923,
+33063,32815,26634,26880,25060,23617,26288,24095,
+22899,22773,22806,22372,22061,21795,24862,21612,
+21398,22605,22659,23988,24150,20791,19343,19427,
+18608,18680,19403,18557,19460,19868,19443,20295,
+19319,22728,20325,20296,20634,21985,23514,23618,
+22800,32814,32623,32586,32004,26472,23818,22893,
+22335,21861,21540,23104,22899,24104,23416,22848,
+22776,22398,21018,22203,23919,23773,23102,21581,
+20359,19920,18680,17809,17939,17569,17097,17213,
+16872,16831,16834,17036,17190,17460,17108,17140,
+17652,17868,17745,17971,17779,17684,18042,18899,
+20347,18377,17225,17532,17394,19437,18582,17369,
+20629,28230,22494,16475,14781,18732,18135,18826,
+17205,16182,17083,17399,18116,16671,17034,17200,
+19305,20082,18858,18892,22413,17775,27249,21714,
+19179,19360,18113,17364,17471,16246,17373,15974,
+23714,20736,21745,16875,15378,16906,16342,17217,
+17852,16626,17406,18657,19021,18313,19307,20579,
+20907,21645,19106,18774,17172,17712,13296,13066,
+12783,14247,13971,13967,12728,15800,15378,16479,
+24591,26689,26861,27078,28722,28897,29046,30365,
+30567,31911,31916,32832,32776,32843,32803,32615,
+32735,32818,32844,32829,32964,32981,33012,32878,
+33039,32991,32941,32910,32884,32873,32861,32853,
+32914,32964,32919,32862,32837,32853,32758,32805,
+32847,32879,32882,32876,33196,33061,32991,32991,
+29805,27609,28780,28271,28189,26940,25431,26032,
+26713,25611,26432,26610,27016,26452,28047,30208,
+32721,32986,32997,32077,30982,27736,26058,23327,
+21513,26666,26673,25065,23547,23052,23435,29703,
+22832,20970,17460,15132,16355,12877,11439,16878,
+21047,20045,15551,20577,28690,27576,24239,24520,
+24135,23086,23569,24348,23103,24225,22075,21210,
+21881,25911,24745,23553,25095,25618,25843,27780,
+22112,19564,20697,23078,27854,24978,23572,24306,
+26945,25782,21190,19616,20211,20753,21664,22475,
+23129,21357,21384,20387,19258,19560,18619,18838,
+18936,18257,17706,18006,17580,19644,21644,20489,
+20885,18044,21995,18240,23321,18756,20550,23025,
+22109,24058,24962,25149,24708,23266,21864,18715,
+17791,18281,17724,17145,16911,17118,16981,19515,
+16208,16350,16304,17046,16674,17122,19947,18153,
+18864,18555,18339,18032,18642,21875,18597,19101,
+17801,18321,18843,18585,18984,18470,18439,18461,
+18230,18918,18828,19155,19134,19910,20315,20539,
+20962,21338,22828,21913,24352,22998,21384,20254,
+24046,22199,21103,21148,20779,20600,20394,21198,
+20919,21266,20612,20156,20855,20325,20544,20187,
+21223,21436,21126,21000,21100,21077,21383,21343,
+21558,21291,21758,21777,21601,21244,21361,21406,
+21241,21313,20700,20921,21081,20781,21297,22017,
+21726,21571,22326,22223,23064,22924,23097,22982,
+23498,23601,23858,24339,23387,23850,22848,22644,
+22515,22273,21988,22263,21585,21040,21081,20946,
+20469,21539,20100,19933,19992,20252,20128,20557,
+20335,20300,20675,20636,20805,21423,21479,21775,
+21816,22163,25229,21969,22092,21943,21323,21066,
+21047,21012,21353,20573,20562,20281,20457,20554,
+20027,20064,19936,20196,20175,19552,19885,19102,
+19281,19210,19271,19610,19916,20664,19787,18681,
+14052,23577,29083,32060,33187,44706,45072,44420,
+42162,35922,35501,36475,33883,33901,34341,34244,
+33902,34225,33895,33762,33900,33897,33844,33495,
+33535,33488,33603,33596,33438,33565,33594,33877,
+34232,33597,33676,33709,33598,33788,33889,33741,
+33613,33586,33540,33599,33686,34124,33866,33900,
+34243,34196,33900,33963,33960,33858,33916,33764,
+33837,33872,33557,33558,33761,33865,33911,34083,
+33897,34144,34371,35043,35418,34831,34836,34584,
+34480,34365,34224,34270,34365,34937,35130,34224,
+33992,33914,34498,33966,33792,33233,32968,30119,
+24856,21605,20517,19515,19036,19333,17838,18045,
+17416,17565,17195,17001,16983,16826,17152,16553,
+16491,18192,16431,16363,16604,17236,16519,16319,
+17694,16863,17385,17114,17670,18159,19410,19140,
+21356,19449,21301,21456,20105,21272,22344,21567,
+22242,22772,22625,23553,23982,26705,25840,24319,
+23644,22791,22434,21838,20712,19554,21130,20886,
+20279,20816,21456,19644,19853,18869,18366,18771,
+18741,17750,17332,17939,17485,16685,16718,16437,
+16406,16049,16175,16218,16134,16181,16158,16308,
+16348,16500,16497,16875,17151,17501,17847,18279,
+18496,19020,19991,19567,20295,20594,24277,26366,
+28224,29190,31497,32982,34325,36203,37166,37560,
+37403,36199,36276,36412,36652,36460,36869,36948,
+36685,36461,36215,36217,36126,36266,36300,36477,
+36729,36592,37483,37004,37452,36562,36470,36357,
+36268,36663,36777,36499,36663,36759,36641,37131,
+36888,36139,36618,39002,34416,36280,36321,35836,
+35566,35748,34975,34566,34075,34076,34851,33666,
+33057,32348,26592,26994,25233,23690,22964,23022,
+22821,22557,22320,22091,21175,21711,21360,20599,
+20826,21199,20402,20910,24570,22292,20415,20067,
+19721,19297,18967,18708,18983,19359,20014,21267,
+20696,20912,20424,20708,21066,21935,23576,25019,
+32229,32554,32632,32721,32761,27546,23771,22526,
+21744,20626,21123,21672,25659,23289,24330,21981,
+22191,22458,21838,20664,22761,23382,24148,21800,
+20517,22430,18050,17918,17513,17555,17243,17087,
+16857,16751,17330,16974,16962,17247,17241,17384,
+17477,17601,17706,17997,17874,17940,17460,18471,
+19075,18076,18581,18731,18159,18629,18165,18891,
+20502,24252,22269,17538,15675,19237,17269,17459,
+17757,17482,16857,16432,17737,17681,18878,17124,
+17629,18234,17627,18588,19335,16704,19657,25842,
+18366,17863,17276,16598,20150,17354,16371,16326,
+20030,24942,18394,19869,15855,16045,16328,15356,
+17694,19338,25233,16320,17094,17582,17284,16326,
+18248,16097,16648,17447,21854,24291,23497,23289,
+23944,24061,23746,23081,23119,21945,21995,25651,
+28140,29021,31108,31263,30130,32932,32850,27700,
+26787,29649,30601,31895,32283,32698,32869,32729,
+32590,32822,32930,32817,32792,32807,32817,32823,
+32849,32832,32810,32812,32813,32830,32829,32842,
+32857,32836,32833,32835,32829,32827,32844,32833,
+32817,32856,32913,32970,32991,32970,32992,32991,
+29919,28650,29183,28998,28587,28008,26391,25805,
+26351,26779,27237,28915,32553,32980,32699,32993,
+32076,29844,23169,23499,22985,26808,27069,31190,
+25721,21766,30461,28647,25670,24238,25034,24912,
+23054,16549,19677,31851,33170,26873,23786,24643,
+23442,18771,26064,32814,31679,25965,25969,25437,
+22657,22116,23227,22752,22531,22734,19143,22083,
+23112,22509,20721,19283,20104,19456,20742,21224,
+18808,18195,19234,19096,18328,19387,21795,32696,
+25879,22229,21153,19396,19362,19157,19877,20990,
+23015,21784,20296,20670,20901,20757,21629,21621,
+20999,20394,18024,17793,17948,17740,20058,21380,
+20777,21021,21342,20427,23568,19897,20312,20820,
+22040,23865,24967,25252,23785,22621,20625,17817,
+17049,17295,17322,16977,16582,16779,16655,17558,
+16536,16526,17504,18180,16797,17759,21774,20804,
+19160,18213,18300,18718,24135,18092,19584,18221,
+18327,18182,18498,18575,18985,18012,17661,18309,
+18447,17881,19383,19371,19411,19955,20208,20456,
+20844,22609,24486,24304,23160,20250,20347,20520,
+20349,20117,19463,18987,21565,22282,21060,20589,
+21101,21322,20265,20019,19660,21015,20757,20210,
+20911,21018,21474,21006,21504,21096,21262,21216,
+21270,21600,21737,21618,20944,21179,21092,20790,
+20922,20646,20439,20694,20702,20851,20877,21298,
+21257,21106,21560,22113,22575,22849,23109,22881,
+23157,23256,23896,24355,23450,23411,23309,23055,
+22462,22328,22279,22434,21645,21495,21284,19357,
+20062,20217,19859,20299,19730,19826,20443,19876,
+20136,20045,20236,20699,20977,21194,21309,21377,
+21721,21969,21976,21799,22077,21489,21455,20981,
+20482,21027,20280,20365,20566,20194,20111,20059,
+19945,19613,19771,19754,20592,19445,19480,19407,
+19464,19510,20046,19422,19227,19200,18732,16887,
+21045,27668,32552,32516,39011,41847,44997,41995,
+39729,34470,33911,34813,34041,34512,34560,34494,
+33884,33903,33907,33628,33600,33601,33600,33600,
+33601,33492,33422,33439,33378,33375,33597,33438,
+33510,33580,33613,33673,33821,33908,33606,33598,
+33598,33586,33684,33594,33903,33880,33892,33965,
+33572,33612,33928,34340,34367,33829,33818,33754,
+33945,34003,33621,33547,33714,33909,33866,33953,
+33955,33970,34675,35088,35786,34956,34122,34374,
+34735,34423,34249,34359,34304,36329,34549,35621,
+34191,34741,34373,33889,34007,33466,33093,32991,
+28804,22547,20783,19618,18941,18399,18306,17585,
+17637,17438,17131,17208,16803,16793,17399,16359,
+15735,16248,15997,15845,16764,16437,15964,16851,
+16321,17328,18300,16773,17124,17376,17824,18898,
+19854,19841,20936,21025,21257,21512,22711,21307,
+22138,22539,23290,25293,25328,25909,25113,24933,
+23635,22967,22911,21954,21999,21208,21299,21109,
+19865,19251,19957,20212,20466,19310,18819,19477,
+18740,18584,18531,17066,17529,17162,16551,16766,
+16113,16062,15883,15987,16045,16080,16136,16284,
+16382,16632,16683,17091,17335,17610,17906,18324,
+18616,18806,18860,19822,20340,22617,25249,27041,
+27439,29391,32757,33154,33559,35899,36640,36581,
+36303,36195,36346,36561,36507,36672,36734,36782,
+36420,36278,36269,36240,35915,36086,35905,36345,
+36409,35713,36279,37967,37344,36050,35661,38071,
+35994,36219,36919,37092,36923,37489,36703,36696,
+36964,37005,38164,36729,34416,35823,35353,35787,
+35359,35502,35743,34844,34003,34500,33918,33688,
+32998,29190,24756,26646,24838,23847,22857,22443,
+22214,22015,21566,21464,21196,20726,20614,20889,
+19508,19802,19749,23041,24458,28640,28829,20727,
+19523,19567,18713,19086,20837,20997,20450,21189,
+22878,23657,21068,20759,21993,23886,24924,26208,
+31656,32732,32352,32668,31705,26864,23439,22569,
+21245,20849,21727,20910,22305,24954,22519,24007,
+21169,22137,21478,21729,22031,23338,24283,23309,
+21966,19032,18653,17545,17736,17325,17037,17108,
+16957,16969,17427,16782,16881,17212,17054,16953,
+17130,17528,17506,17420,17724,17664,17472,17833,
+17167,17714,18972,18926,18012,18010,17711,17436,
+19283,21182,20439,17565,15978,18849,18864,17142,
+17455,17730,17082,16241,16168,17904,18180,19086,
+17428,17253,17524,18129,18581,16140,16657,17519,
+17523,17460,16178,15972,16122,16399,16618,15882,
+18003,19470,18264,21989,16695,15306,13471,14060,
+13614,13458,13251,12417,11894,18269,21082,19994,
+22604,23628,27606,25575,24926,25468,20841,20091,
+19690,20169,19475,20387,20069,24630,25482,29213,
+32965,32184,30063,30335,28134,26253,32053,34071,
+32258,26096,27813,29140,30582,32591,32696,32700,
+32755,32765,32750,32708,32549,32698,32749,32838,
+32805,32804,32853,32892,32862,32855,32880,32917,
+32928,32868,32865,32839,32838,32836,32845,32841,
+32862,32898,32920,32974,32997,32948,32981,32989,
+30952,29492,28402,29093,27545,26940,25558,27141,
+32802,32989,33085,34160,33683,32986,31372,29208,
+26878,23730,24016,24033,23901,22444,22581,21851,
+22011,23309,23642,27059,25724,25341,22377,19464,
+17184,27616,29892,32774,21740,23550,23310,24994,
+23084,25438,28020,27901,32982,30297,25624,24189,
+21944,21839,22062,23772,15202,22821,20281,21087,
+20367,20268,18570,17815,17806,17977,17913,17724,
+18093,18042,18183,18290,18799,18465,19914,22578,
+18895,20802,20703,19314,18831,18579,18860,19284,
+19618,20086,21473,21659,21179,22309,22437,21535,
+22147,21388,21056,21087,18592,18658,23349,20481,
+21559,21379,22271,21982,23329,22156,22097,20121,
+22081,24117,25309,24613,22507,20597,19207,19997,
+16959,16596,16668,16112,16398,16505,16099,16716,
+16690,16582,16335,16565,16994,18386,20952,18529,
+17783,18867,18417,19119,18791,18767,18717,18647,
+18543,18350,18048,18255,17874,17817,17895,18178,
+18509,18813,18612,20094,19782,20062,20229,21082,
+23008,25311,32128,22388,20522,20249,20097,20089,
+20361,19624,19580,19793,20655,19998,19491,19610,
+19341,18984,20505,20919,21499,20558,19626,20832,
+20843,20739,21164,21430,21417,21417,21473,21320,
+21398,21330,22149,21196,20001,20803,20243,20810,
+19961,20065,20307,20080,20126,19498,20760,21398,
+20336,21930,21352,21861,22563,22677,22674,22623,
+23421,23410,23575,23893,23961,23589,23736,23462,
+22921,23181,22225,22262,22538,21306,21865,21819,
+19457,20926,19179,19467,20057,19360,20437,19979,
+19992,20224,20760,21051,21115,21000,21294,21102,
+21852,21794,21905,22641,21979,21416,21294,20685,
+20380,21948,20607,20386,20253,20003,20017,19884,
+20028,20142,19927,19908,19808,19731,19755,19342,
+19522,19500,19843,19588,19359,18892,17575,15553,
+28447,32274,32712,33174,45063,46389,44569,39972,
+41218,34041,34542,33912,34079,34500,33939,34140,
+33810,33870,33794,33599,33600,33561,33561,33580,
+33607,33296,33495,33552,33368,33598,33486,33298,
+33401,33486,33600,33558,33549,33550,33447,33579,
+33672,33583,33605,33471,33878,33622,33789,33579,
+33497,33617,34520,34250,34054,34088,33584,33502,
+33916,34262,33890,33494,33824,33897,33841,33776,
+33941,33914,34889,34347,34770,34419,33970,34846,
+34821,34328,34353,34391,34264,34637,35267,34302,
+34370,34287,34026,33694,33456,33479,34080,33468,
+32960,27388,23205,26115,18822,18603,18322,18169,
+17927,17452,18814,18531,18455,16943,17599,16731,
+15714,16242,16051,16063,15948,16887,16013,16912,
+16401,17280,18071,16224,17958,18159,19052,19349,
+19278,19556,21129,21081,21585,21445,22449,21450,
+21279,22387,23145,23836,24453,26398,30564,24736,
+23553,23430,22678,22073,22267,22143,21866,21529,
+20104,20391,21732,20787,21192,20131,18808,19433,
+19907,20496,18369,16416,17701,17921,19771,17684,
+17993,16180,15593,15966,15822,15962,15986,15915,
+16564,16718,17026,17320,17626,17727,18057,18709,
+18972,18955,19315,19794,20598,21398,25426,26565,
+27481,31402,32781,33459,33386,33825,34818,34847,
+36208,36441,36549,35460,35766,35910,36635,36368,
+36270,36217,36267,36135,36215,35785,35914,35997,
+36011,35604,35727,35636,37977,35890,35550,37582,
+35853,35925,36678,37043,37230,37392,37337,36716,
+36806,37065,37077,35103,34416,38978,35892,34817,
+34794,34836,34626,34840,34064,33884,33778,32938,
+28941,24753,24730,25650,24115,23339,22495,21909,
+21841,21624,21270,21093,20810,21981,20475,27500,
+19697,19845,19864,21261,24923,25692,31891,21351,
+20473,19816,18909,19846,20536,20945,21641,22350,
+24398,21126,21043,20999,22323,24407,26055,32515,
+29894,28591,32037,31605,26766,25764,23150,21621,
+21084,20046,22284,21081,21939,22546,23630,22865,
+21127,22275,20920,23040,23421,24336,24607,24438,
+22626,20868,18393,17918,18162,17432,17435,17055,
+17079,17101,16965,16759,16857,17027,16865,16862,
+17094,17265,18461,19197,17887,17591,17700,18024,
+17874,16818,17954,18195,18567,18589,18183,17054,
+18822,22653,20229,17600,16326,18156,18507,17399,
+17293,18173,17310,17033,17282,16701,17915,18057,
+16626,17098,18114,17455,17791,16631,16998,17721,
+16874,17544,16836,16325,16222,16432,16225,16065,
+17135,18677,18829,17607,15924,13863,13136,13542,
+21759,22622,23552,27600,25655,26857,24264,28349,
+23793,24511,26339,22412,21417,20308,20169,20019,
+20290,21832,22865,23339,26229,29572,32757,34733,
+33585,32292,27890,25431,23753,23423,25832,33530,
+35217,33267,29208,27888,25713,27685,30798,32058,
+32709,32496,32344,32055,32095,32340,32774,32832,
+32526,32757,32914,32862,32772,32778,32842,32928,
+32967,32885,32846,32859,32874,32873,32858,32875,
+32888,32898,32952,32970,32986,32951,32945,32988,
+32979,32670,27874,27918,26839,26528,29659,33626,
+36433,35922,38286,33082,29743,31673,29303,23949,
+25722,25682,25644,25452,23407,22674,22798,24850,
+22255,21088,22722,20703,22664,23518,20184,31577,
+34482,33288,28956,29997,19840,21367,22124,23470,
+22871,22561,26511,25338,27868,26296,24538,22605,
+21249,21053,21942,22072,22119,20606,19156,18691,
+18196,17861,17286,17441,17795,17433,17842,17532,
+18112,17744,18404,18735,18356,18690,21117,20220,
+19455,17744,18276,19888,17815,17044,17195,17604,
+17718,18030,20242,20907,19998,20523,20144,21315,
+27957,25077,20277,20512,19353,18579,20800,20824,
+21043,21216,21531,20619,21904,24276,21995,23910,
+22308,23808,24066,23544,20659,20074,20312,21159,
+16703,16327,16451,18262,19742,16647,16274,16304,
+16893,16956,16650,16948,18536,18078,19474,18744,
+18478,18667,18924,18930,17901,18159,18261,19105,
+18421,17723,17801,17823,17635,17985,17752,18179,
+18499,18739,19168,19315,19803,20646,21829,25038,
+23691,22650,22991,21036,20753,20271,20234,19956,
+19640,19742,19773,19392,19086,19104,19168,19245,
+19315,20007,19448,19333,19167,19502,19389,19652,
+20092,19248,20058,20547,21311,21321,21084,21191,
+21034,20972,20723,20940,20508,20157,20030,20097,
+19982,20261,19527,19940,20179,20178,19668,21176,
+21273,21717,22239,21441,22314,22187,22669,23032,
+23103,23403,23494,23902,24148,23503,23381,22806,
+23184,22617,22785,22366,22431,21939,21348,20988,
+20208,19654,18660,19605,20931,19874,19986,19815,
+20189,20397,20894,20589,20661,21401,22302,21729,
+22047,21623,22359,21173,21291,21288,20985,20439,
+21032,20636,20851,20699,20885,20358,20416,20183,
+20136,20179,19972,19592,19966,19746,20018,19859,
+19822,19674,19712,19654,18378,18432,14910,22347,
+30528,32538,32723,35199,43551,44274,40860,37146,
+36591,34202,35937,33634,33924,33596,33600,33717,
+33805,33863,33600,33599,33599,33588,33448,33524,
+33486,33565,33303,33294,33318,34036,33533,33299,
+33264,33302,33348,33600,33575,33609,33299,33282,
+33867,33689,33451,33588,33614,33603,33690,33585,
+33841,34227,34449,34142,33905,34051,34390,33825,
+33912,34413,33905,33661,33547,33501,33884,33450,
+33730,33923,34899,33948,34199,34320,34385,33939,
+34320,34585,34367,34408,34365,34130,34329,34128,
+34347,34248,34423,33544,34081,33909,35130,34332,
+33366,32935,29184,20761,19641,19098,18492,17986,
+19587,17616,17007,16941,16633,16689,16629,16263,
+16161,16266,16305,16084,16140,15906,16394,16740,
+16523,16165,16897,17198,17678,19599,19890,21400,
+19574,20119,20457,20474,21021,21887,19929,20572,
+21348,22964,24701,23711,24663,26251,24243,23881,
+23153,22707,21912,22047,22113,21668,20691,22054,
+20698,20555,20072,20108,20177,20116,18768,19174,
+18999,19690,19184,17340,17944,18202,16920,17497,
+18794,18107,15961,15799,15973,15960,16245,16288,
+16602,16797,17010,17426,17675,18045,18354,18815,
+19012,19206,19693,20136,20205,22304,25265,26772,
+28375,32282,33086,33156,33432,34701,34882,35519,
+36378,36583,35283,35327,35742,36105,36396,36216,
+36001,35859,36223,36086,36257,35982,36332,35939,
+36243,36112,35133,34833,35859,35969,35808,37786,
+35943,35814,36093,36978,36687,36877,37613,37574,
+37188,36889,37903,37457,36543,38057,35935,34137,
+35771,34731,33906,34442,33895,33795,33838,31767,
+25104,24213,23793,24092,23494,22536,22022,21579,
+21348,21198,20985,20601,25314,21354,19832,21204,
+19662,19687,19416,20070,24828,29679,26910,23693,
+20720,19876,19802,22619,21189,20958,20992,22630,
+22469,21298,20928,21549,23012,25616,26397,30259,
+32635,27516,26642,26621,25240,24029,22645,21553,
+21017,21564,21303,21304,21132,22955,22020,22662,
+22610,20793,21689,24081,26249,26518,27255,24532,
+22952,21431,20397,17821,18000,17527,17352,17217,
+16803,17058,17319,16719,16812,17427,17259,17148,
+16944,17275,17945,18708,18151,17460,18994,18999,
+18908,19483,17754,17319,17896,18402,18595,18375,
+19239,24848,20224,17127,16487,17858,18637,17159,
+17345,16726,17385,17767,16868,17594,19350,17939,
+16434,17540,19347,17628,18017,16415,16210,16485,
+16354,16512,17123,16845,16433,16925,16146,16399,
+16094,16839,16757,14917,12728,18624,21670,24343,
+25138,26283,27341,23498,23887,24391,22670,22250,
+24165,25222,25252,26137,21792,22161,24155,25359,
+25122,25907,28920,27087,27174,28244,31137,31848,
+30846,27813,25975,24738,22839,23418,23140,24225,
+34098,35189,33634,32908,29035,27917,25689,26429,
+28160,29985,30702,31064,31203,31840,32446,32623,
+32490,32451,32763,32799,32760,32713,32831,32877,
+32839,32842,32849,32862,32845,32892,32876,32896,
+32898,32898,32990,32988,32998,32999,32991,32937,
+32791,32736,29388,28272,27576,31424,33858,39297,
+35235,33175,32334,31213,33431,32993,29734,29117,
+30631,32907,31715,31194,25390,22031,22930,21771,
+21595,23558,19837,21782,26140,28035,29473,32882,
+32065,28732,32971,26229,18561,23550,18108,19510,
+21667,21060,23216,22183,21748,22629,20858,20903,
+21348,18486,22568,22407,19057,19135,18801,17848,
+16575,16569,16730,17508,17421,17428,17856,17532,
+17955,17985,18101,18840,18668,18625,19184,23119,
+17607,17713,17454,17238,17067,16820,16434,16606,
+16988,18144,20703,19463,18954,19138,19390,20786,
+19983,19743,20007,17467,19338,20726,18138,20415,
+19232,19506,20493,22575,21485,22350,22530,19728,
+21549,23283,24480,21675,20061,20838,20802,21441,
+18120,16431,15853,19323,20804,16529,21666,16394,
+16597,16947,17140,17706,18078,17400,18168,18216,
+18328,17449,23661,17895,17563,17707,17626,18590,
+17977,17234,17724,17886,17509,17766,18081,18265,
+18856,19153,19411,20064,20109,20515,27707,31416,
+30303,22860,20851,20414,20488,20276,20021,19749,
+19715,19848,19500,19270,19103,19121,18794,19126,
+19013,18981,19273,19146,18772,18626,19014,19228,
+19394,19548,19289,19680,19959,20182,20280,20161,
+20070,20316,20790,20446,19687,19695,19900,20004,
+19635,19878,20046,20044,20123,20367,20584,20460,
+20368,21606,21036,21373,21717,22765,22872,23061,
+23088,23208,23236,23741,23343,23743,24178,23589,
+23290,23403,23390,22479,21836,21668,22058,21566,
+20871,22925,20892,20596,19806,20619,20619,20412,
+20226,20449,20298,20466,21065,20982,23148,22629,
+22040,21363,21139,21005,20564,20943,20596,21032,
+20721,20658,20604,20363,20589,20215,20055,20474,
+20538,20478,19913,19881,19949,19833,19731,19722,
+19972,20001,20139,19519,18765,17750,17025,28373,
+32660,32725,32968,40657,45437,40668,43368,34827,
+35225,34055,33485,33427,33681,33867,33600,33798,
+33600,33592,33592,33600,33600,33478,33510,33498,
+33531,33425,33300,33294,33300,33297,33301,33297,
+33236,33300,33300,33258,33600,33270,33296,33612,
+33296,33308,33433,33579,33288,33477,33573,33823,
+34162,34440,34182,34178,34095,33928,33933,33733,
+34749,34045,34313,33731,33572,33456,33924,33492,
+33930,34022,34433,34407,33999,34396,34076,33748,
+33897,34432,34542,33834,34217,34705,34322,34452,
+33843,33892,33846,34275,34054,34787,35458,35467,
+34356,33132,32514,26727,22889,19254,18615,17926,
+18285,18523,17264,16940,16767,16563,16464,16386,
+16240,15894,15769,16073,17221,17393,16465,16056,
+16896,16830,16518,17620,18224,19851,19440,18634,
+18974,20830,19946,20619,21210,21700,21521,21441,
+21997,23922,23292,24031,25064,25788,24742,24149,
+23520,22686,21785,21099,21811,21493,21177,20926,
+20718,20233,20127,19720,19455,19752,20388,19666,
+19828,19329,18330,20098,19041,17916,18530,16677,
+18324,15817,16125,16284,15937,16197,16413,16577,
+16905,17028,17264,17592,17971,18386,18690,18962,
+19240,19581,19746,20263,21037,22374,25125,26097,
+28035,30496,32920,33377,33954,35186,35744,36491,
+36524,34953,35039,35383,35765,36238,36501,36172,
+35967,35638,35895,35993,36024,36240,36108,36249,
+36299,36267,35731,35741,34686,34966,37362,36972,
+36141,35760,36690,35872,36438,37654,37099,37526,
+36331,36747,37551,36642,36567,37212,36724,34678,
+33759,35358,33846,34296,34090,33460,33049,28882,
+26801,25071,24285,22798,22784,21930,21696,21258,
+21063,20875,20625,20259,20124,22863,30530,19672,
+19406,20292,20610,19742,21350,23423,23719,29433,
+20554,20185,23837,22878,20799,21023,20797,22836,
+22419,21867,22608,23141,25412,25717,29144,31180,
+30984,26753,25657,25808,25966,23436,21950,21240,
+21740,20550,21742,22008,22217,23445,24720,16497,
+22461,22017,22556,23628,28382,28089,25985,25526,
+23987,22916,19280,18933,18441,18043,17813,17327,
+17025,16863,16934,16719,16989,18117,17752,17571,
+17666,17557,18030,18393,18458,18081,18034,18556,
+18891,19413,16078,16853,17574,17810,18021,18099,
+18171,23553,21994,18044,16107,17699,18573,17062,
+18738,16481,17181,16899,19191,15918,18077,17778,
+16914,16776,18192,18516,17826,16606,16539,16171,
+15941,16070,16683,16900,16960,17388,16596,16723,
+15885,15597,13230,18102,23637,25528,27259,25458,
+22480,22323,22448,24291,26454,29852,30228,29591,
+29808,29256,28885,29765,31371,32295,32996,32035,
+33348,32881,34789,33348,33149,33101,32512,32995,
+35564,34140,35114,36432,32951,24470,23174,23375,
+23748,24297,33686,35691,34107,32993,30423,27129,
+27323,26568,28787,26224,28221,29732,30858,32078,
+32040,32193,32727,32544,32682,32702,32776,32796,
+32865,32826,32876,32860,32898,32901,32898,32889,
+32898,33028,33074,33119,33118,33348,33195,32974,
+32844,32016,32549,29806,31287,33408,37461,36502,
+33393,32766,32989,31642,32280,32977,32043,32985,
+29194,28467,20013,22898,28044,25038,21366,21570,
+22488,24307,24576,30953,32996,28800,27975,31694,
+27891,33801,25959,21960,22424,24796,26170,25603,
+24068,17238,20101,21676,22312,19353,21226,21714,
+18634,21610,21079,19976,18207,17611,17760,17700,
+16559,16715,16461,17184,17784,17694,17418,16997,
+18081,17380,17201,17289,18806,18639,22569,22110,
+17613,17144,17169,16940,16808,16401,16307,16422,
+16912,16814,17227,18419,18292,18464,23130,19077,
+18486,19217,19173,18312,17577,20145,18544,20331,
+19908,19505,21291,21576,21497,22617,21722,20340,
+20987,22837,21697,21061,32093,21735,21035,22194,
+19873,16095,15606,16265,16592,16452,16448,16997,
+16802,17688,19219,18288,18000,17740,17455,18312,
+18393,22893,17092,17700,17451,18242,17682,16730,
+17320,16898,17100,17409,17812,17901,18429,18894,
+19917,19804,19846,19973,20059,23161,23989,22453,
+22361,21539,20850,20578,20350,20046,19590,19491,
+19335,19299,19155,18985,19376,18932,18582,18909,
+18932,19065,19161,19011,19063,19140,19304,19125,
+19086,19140,19316,19381,19631,19432,19330,19452,
+19223,19947,19720,20352,19515,19412,19779,20062,
+20334,20108,20064,19715,19956,19443,20058,20049,
+20568,20043,20106,19758,23533,22767,22461,22119,
+22434,22626,23134,23078,23322,23178,23161,23712,
+23579,23212,23194,22791,22529,22053,22096,21783,
+21327,21563,22285,20686,21252,21515,20667,20551,
+20589,21027,20585,21547,20955,22080,23593,21912,
+21182,20967,20978,21069,21239,20640,20754,20643,
+20323,20574,20160,20531,20626,20688,20397,20278,
+20190,20522,20214,20088,20143,19882,19978,20055,
+20052,20134,20061,20063,19371,17226,24547,31075,
+32612,32625,34587,44794,45763,45235,35649,35784,
+35025,34096,33420,33357,33875,33599,33596,33596,
+33589,33586,33583,33600,33600,33599,33597,33300,
+33300,33290,33299,33300,33289,33297,33300,33290,
+33305,33234,33256,33540,33464,33300,33294,33415,
+33298,33297,33536,33429,33285,34156,34247,34800,
+34467,34440,34200,34179,33606,33943,33801,34011,
+33913,33890,34391,33945,33777,33379,33888,33360,
+33636,33923,34384,34236,33870,34328,34212,33957,
+33769,33951,33915,33807,34367,34380,34823,34611,
+34184,34339,34671,34645,34647,34850,35412,34818,
+34751,33503,32907,29316,22776,18612,17946,17774,
+17150,17032,16981,16593,16682,23113,16549,16389,
+16341,16575,16314,15868,15633,16212,16106,16254,
+15547,15849,16478,16015,15466,15524,16837,17564,
+18634,20271,20559,21370,21003,21319,22825,22270,
+21510,22322,22971,23082,26090,25482,24369,24198,
+23160,23028,21798,21257,22037,24443,21812,20715,
+20654,20388,19328,18977,19187,19160,20013,19486,
+19610,19652,18199,19713,19830,18617,18452,19511,
+16924,21775,16537,16639,16934,16408,16359,16661,
+16792,17092,17391,17709,17988,18345,18885,19227,
+19404,19797,20157,20401,20856,23884,25317,26821,
+27813,30969,32774,33870,34598,35063,35793,35562,
+35754,35064,35463,35229,35691,36403,36345,36082,
+35849,35355,35739,35689,35695,35761,36176,36262,
+35973,36154,35979,35274,34893,34692,35547,37435,
+36480,36149,37640,35910,36537,35292,36852,38174,
+36195,35412,36432,36977,36237,37006,38240,38479,
+33774,33882,33874,33691,33477,34345,33003,32019,
+28377,25511,24278,23486,22707,21861,21268,21231,
+20879,20619,20355,20322,25607,26562,24883,20001,
+19404,18847,18824,19865,20732,21045,19392,19260,
+20054,17508,22930,20803,20640,20844,21110,22125,
+23231,22560,23101,23277,24256,25734,29277,29581,
+27627,25056,24372,23855,23508,22922,21190,21090,
+21198,21120,21311,20779,21624,21667,23307,24797,
+19685,21653,21330,21273,25259,30576,27317,26926,
+26033,23141,20123,18337,18418,17926,17871,17235,
+17232,17571,16773,16752,16623,16899,17019,17145,
+17214,17433,17465,17340,17715,17971,17790,18087,
+18639,18471,17071,17086,17084,17137,17644,17398,
+18981,22260,23247,18016,16709,17336,19215,17058,
+17193,16995,17855,16817,17987,18261,17165,17199,
+16575,17643,17583,18158,18324,16961,16883,16597,
+16010,16072,16698,16734,17003,17028,16338,15900,
+14865,12814,16602,21915,26765,24686,22634,23508,
+23765,29369,30534,30400,31817,32598,32863,33381,
+33597,34854,33039,34261,33470,35607,36501,29702,
+32525,32333,31727,33372,32835,31907,28028,29711,
+30387,29670,27523,31134,30982,32866,33285,33191,
+32986,36415,28982,26532,24073,27682,26457,32408,
+32568,31583,30636,31485,31860,32971,30272,29980,
+31246,32109,32952,32816,32668,32652,32724,32877,
+32823,32880,32904,33003,33005,33003,32932,32916,
+33003,33016,33160,33107,33015,33021,33006,32975,
+32895,32783,32702,32988,33010,37342,41188,33800,
+32944,30810,32094,30460,31329,31805,29063,25044,
+18942,18705,20683,21161,22970,26289,22874,23324,
+22110,25735,33000,33099,27924,27573,32318,32994,
+32847,31564,20592,24238,27159,25998,23394,23219,
+24355,26078,23981,20679,18294,19410,22080,22453,
+21039,20357,20560,19279,18384,17336,16808,16752,
+17370,17659,17412,18337,17342,20030,16776,16515,
+18220,17262,22712,18771,20098,19556,21228,17539,
+18996,17437,17407,15484,15738,16377,16167,16025,
+16591,16784,16328,16651,16701,21138,17382,17999,
+20760,17570,17518,17897,17552,17029,17880,17543,
+20253,20447,21036,20127,20769,22163,21924,19503,
+18540,22816,20864,20239,23959,21237,23031,18822,
+20177,16337,16419,16338,16534,16392,17805,17273,
+16820,16824,18173,17338,17774,17896,18505,17985,
+19176,19458,17611,17539,17742,17512,17523,17291,
+17341,17312,17427,17566,18132,18235,18786,19295,
+20112,20528,19785,19594,19606,22053,25128,31144,
+23307,20797,20676,20516,20209,20166,19809,19740,
+19478,19220,19089,18828,19153,19132,19020,19175,
+19207,19062,19105,19361,19365,19387,19491,19238,
+18891,19122,19359,19386,19743,19281,19264,19476,
+19298,18995,19897,20685,19519,19587,19776,20028,
+19918,19709,19886,19899,20010,19635,20034,20436,
+20115,20426,20897,21708,22228,20513,21708,22065,
+21705,22425,22666,22716,22760,22977,23163,25835,
+23760,23463,22804,23019,22566,22406,21920,21576,
+21409,21960,20600,21243,20412,19466,19568,19883,
+20763,20451,21114,21565,21196,21745,21381,21525,
+21339,21322,21119,21210,21069,20905,20929,20615,
+20782,20672,20691,20623,20413,20649,20414,20622,
+20710,20443,21197,20261,20448,20063,20113,20289,
+20058,19905,20404,19941,19349,14630,27714,32268,
+32680,33304,43888,42898,40575,38256,34253,34341,
+34458,33365,33517,33590,34125,33599,33597,33600,
+33597,33599,33599,33600,33600,33593,33342,33300,
+33300,33285,33287,33290,33267,33275,33284,33258,
+33298,33298,33297,33299,33300,33297,33286,33216,
+33296,33648,33493,33299,33300,33600,33969,33825,
+33857,33715,33747,34240,34249,34095,33458,33900,
+34215,33912,34255,33696,33600,33326,33785,33684,
+33348,33585,33938,33847,34105,34163,34269,34479,
+33787,34146,33762,33595,33814,33953,34849,34804,
+35260,34855,34758,34971,34650,34987,34476,34807,
+33720,33403,32977,28647,19954,20328,18498,18053,
+17723,17034,16977,16825,16719,16425,16695,16335,
+16187,16488,15852,15882,16272,15969,16329,15912,
+16527,16623,17243,17500,16881,18235,18323,18404,
+18903,19198,20069,19378,20642,20712,20490,20756,
+21564,22105,21476,24720,24966,25320,23079,22512,
+23151,22953,22176,21129,21680,22706,21750,20613,
+19929,19608,19839,19674,19947,18767,18891,19227,
+19434,19238,19359,19776,21444,19695,19076,20911,
+18805,16759,16357,16245,18006,16749,16738,17025,
+17097,17232,17575,17991,18367,18765,19215,19431,
+19922,20304,20388,20855,20907,25053,26613,28455,
+29688,32647,33461,34424,34709,35685,35691,36467,
+35766,34803,34472,35048,35289,36308,36099,35908,
+35533,35400,35554,35319,35640,35611,35743,35866,
+35766,35808,35919,35224,35782,35193,35115,35516,
+35007,36294,37483,39435,35385,35457,38278,35636,
+36549,36999,37163,37391,37078,35821,37650,38062,
+37688,38418,34836,33689,33201,33294,33019,32990,
+28759,25923,24360,23458,22362,21746,21106,20560,
+20689,20299,20076,20181,20113,21627,25290,27969,
+19215,19293,19449,21631,20593,19740,19752,19930,
+21036,23489,20811,21158,21370,21807,21697,22554,
+24426,22712,28196,23633,24851,27923,28107,26561,
+24071,22566,22855,22090,22457,22208,21619,20847,
+21308,20994,22854,20838,21133,23445,21327,24564,
+26708,21935,21017,21900,22112,25981,30811,27415,
+28005,22493,22370,19290,18491,17261,17099,17274,
+17635,17280,17151,17294,17040,17909,16540,16448,
+16799,17267,17511,17395,17589,17922,18000,17485,
+17638,18237,17466,17216,17216,17228,17664,17984,
+18501,20633,22885,18393,17589,17018,17696,17381,
+18065,17877,18633,17306,17337,17997,17442,17151,
+16575,18916,17822,16965,19205,17717,17137,16996,
+16118,16746,16677,17184,16434,15483,14016,14685,
+17706,20160,24033,25521,24361,26434,26667,31544,
+33083,32901,32856,33060,33430,33461,34596,36354,
+33591,33601,33003,33504,33213,31008,30169,28938,
+28920,29507,32954,29553,27116,24039,19356,18080,
+18063,17979,18683,22326,26437,25728,23593,25353,
+20880,21018,21231,24712,35339,32731,27473,26181,
+27800,20211,25507,31665,30237,31664,33060,31560,
+30627,32029,32934,32809,32919,32778,32736,32728,
+32802,32908,32904,32910,33003,33003,33003,33003,
+33019,33252,33204,33051,33106,33224,33039,33009,
+32997,32772,33046,33988,33696,38150,37621,32206,
+28181,21611,17748,19110,20307,17754,18102,16886,
+18231,20423,20712,19170,21965,22183,24487,21385,
+25064,33142,30392,29930,29520,33737,28650,32424,
+24774,26490,25914,28651,29079,26462,23502,22500,
+20896,21712,23532,24113,22824,22105,21303,21094,
+21377,20208,20250,19006,19087,16878,17117,17481,
+16131,16782,17216,16975,17403,16929,16689,17268,
+17768,18487,19392,17936,20878,18895,19309,16719,
+17181,18117,17640,17384,16605,16185,16114,15895,
+15865,17478,16803,16601,23313,17169,16482,17183,
+18459,17032,18651,20546,17712,16311,16410,16602,
+18846,18068,19443,20286,20701,21632,21695,20884,
+15423,20637,20282,19419,26266,19073,17568,16240,
+17388,16834,16841,17012,16989,16536,16869,17375,
+17173,18395,17496,17784,17877,18164,18120,18189,
+20929,16773,17489,16662,17179,17243,17148,17226,
+17248,17507,18363,18944,18781,18335,19032,19323,
+19558,19436,20043,20311,20328,20527,20760,20844,
+21088,20750,20723,20241,20049,20025,19484,19764,
+20042,19807,19386,19102,19156,19149,18908,18779,
+18991,18814,18894,19257,19377,19102,19571,19629,
+19492,19191,19750,20062,20073,19707,19495,19336,
+18481,19239,19161,20079,20107,20059,19945,20322,
+20153,20053,19895,19716,19885,19769,20046,20378,
+20664,20888,20934,21049,20187,20642,21322,21405,
+22190,22203,22239,22387,22842,23289,23392,23310,
+24201,23399,23036,23034,22919,22413,22126,21828,
+21432,21786,20838,24242,22232,21417,20451,20864,
+20865,21416,21050,21844,22053,21834,21369,21417,
+21230,21228,21151,21150,21185,21003,20880,20559,
+20490,20621,20604,20621,20670,20752,20096,20733,
+20582,20874,20691,20559,20475,20347,19989,20432,
+20643,20500,19903,19920,18552,20857,32133,32901,
+32975,34601,38932,41820,43444,35609,33979,35360,
+33657,33305,33885,33513,34347,33600,33586,33610,
+33549,33597,33599,33552,33588,33300,33300,33297,
+33282,33300,33300,33300,33300,33249,33222,33238,
+33279,33300,33190,33289,33297,33237,33284,33300,
+33300,33300,33275,33276,33639,34098,33750,33696,
+33830,33903,33625,33867,33848,34182,33894,34160,
+33817,33795,34089,33924,33591,33295,33615,33651,
+33351,33859,34410,33902,33862,33758,33928,34080,
+33672,33727,33619,33602,33669,33930,34685,35174,
+35616,34565,34857,34779,34340,35082,34701,34460,
+33705,33240,32941,23976,20421,20016,18823,18134,
+17787,17262,16980,16794,16602,16632,18192,16550,
+16170,15916,15775,15809,16056,16115,16156,16293,
+16900,16773,18166,17387,17685,17824,18703,18849,
+19052,19737,20076,20131,20360,19928,21216,20255,
+22332,22215,21483,21501,21947,24788,23067,22666,
+22398,22725,23586,22509,22639,22116,21610,20799,
+19992,20307,19032,19434,19009,19278,18399,20077,
+20840,19322,19781,19899,20167,21021,19557,18865,
+18367,16932,15655,16492,16780,16792,16776,17124,
+17281,17532,17769,18133,18567,19056,19526,19826,
+20118,20532,20991,21295,21486,25596,27965,30142,
+32403,32892,34031,34840,34820,34866,35888,35771,
+35179,34796,34896,34896,36049,36064,35877,35819,
+35502,35223,35118,35184,35388,35444,35570,35588,
+35283,35742,35486,35593,35219,35751,34833,34791,
+35367,36529,37866,39321,35292,36213,37530,35890,
+36124,36696,36907,37359,36685,36317,35449,36057,
+35703,36678,35041,34854,33340,33950,33084,32492,
+29790,26625,24967,23441,22398,21656,21141,20833,
+20407,20224,19965,21508,21264,19570,20713,19121,
+19239,19785,22067,23904,19913,20152,19452,19380,
+21153,28909,21114,21066,21807,21067,21740,22246,
+30674,26337,24313,24134,28146,28336,26109,23155,
+22062,21351,21366,21384,21502,21480,21214,20828,
+21028,20939,22278,20511,22686,22271,22987,23077,
+23579,24649,22130,20709,21718,25985,30339,29069,
+29931,25404,21938,18039,18221,17568,17336,17004,
+17196,17355,17736,17829,17602,18081,17000,17540,
+17686,17817,17898,18420,18069,18684,18940,17775,
+19319,19998,18227,17401,17538,17451,17574,17842,
+17582,21288,23207,19015,17422,17565,17431,17412,
+18032,18008,18633,17208,17460,17810,17443,17411,
+16943,17371,18800,16082,17762,17352,17100,18114,
+16981,16545,16706,18304,15515,15588,20557,22916,
+24019,23811,26379,26540,28926,33912,35572,36843,
+34684,33441,35700,36183,35565,33397,33183,33336,
+33340,33003,32992,32981,32937,32839,32242,31786,
+31813,31506,31745,32319,32919,30231,24564,21852,
+23538,30843,31314,33003,30468,22409,22719,21900,
+21392,21138,20556,20607,21767,19113,18372,18753,
+24933,26852,21740,19908,24963,26490,32352,32977,
+30293,31282,32676,32875,32897,32919,32868,32724,
+32779,32919,32898,32904,32946,32995,33003,33003,
+33003,33141,33096,33194,33660,33385,33729,33866,
+33393,33328,33700,37497,37995,37656,31849,23510,
+20329,16980,13866,18207,17917,17485,18657,19749,
+18665,19696,18371,18357,18778,10938,23467,29711,
+28868,29168,33494,32398,29840,28359,26483,20596,
+23226,25587,27945,28097,26844,24036,24501,21779,
+22248,21807,22239,22584,22320,21609,21030,21215,
+20655,20322,19126,18785,18073,17676,17705,17680,
+16764,16824,17134,17990,17063,17218,17149,16391,
+18179,19349,26656,17002,19344,21670,17056,19559,
+18006,17730,16744,16138,17814,15804,15444,15683,
+14886,15453,15913,15982,16463,17343,16527,17231,
+16811,16525,16840,16925,18473,16214,17084,17078,
+17094,17779,18450,19594,20939,22505,21244,22080,
+18775,19452,20555,20664,21078,19934,17475,17931,
+17401,16896,16776,16766,16680,16664,16854,17210,
+17157,17927,17366,17734,17711,17621,18428,23521,
+18784,17451,18649,17409,17645,17524,17172,17234,
+17445,17982,18356,18474,18459,18456,18967,19053,
+19557,19790,20169,20026,20072,20064,20283,20160,
+20414,20654,20375,20027,19854,19832,19746,19775,
+19917,19755,19548,19440,19476,19158,18858,18753,
+19044,19025,18744,19087,19310,19322,19488,19236,
+19087,19237,20356,19988,20219,20610,19793,19317,
+19233,19413,19807,19950,20037,19941,19839,19809,
+20007,19855,19969,20395,20250,20447,20338,20299,
+20351,20157,20547,20774,20492,20790,21056,21144,
+22137,22091,22173,22467,22603,23096,23304,23410,
+23379,23872,23362,23334,22892,22107,22249,21907,
+21860,21843,20282,20236,21869,20817,22119,21144,
+20944,21254,21340,22391,21429,21776,21630,21330,
+21260,21305,21127,21223,21216,21036,20974,20751,
+20669,20530,20486,20697,20671,20781,20618,20691,
+20697,21148,20795,20931,20601,20451,20590,20107,
+20228,20776,20140,19734,16803,24920,32365,32838,
+33324,35610,44269,39237,40122,35008,34929,34001,
+35024,33413,33422,33549,33606,33597,33504,33586,
+33581,33596,33569,33435,33426,33360,33298,33276,
+33267,33249,33242,33265,33297,33268,33240,33214,
+33300,33231,33213,33261,33261,33232,33285,33299,
+33300,33548,33519,33300,33511,33595,33354,33697,
+33421,33798,33556,33591,33685,34248,33995,34122,
+33786,33900,33895,33713,34710,33839,33558,33609,
+33768,33780,34146,34227,34516,34106,34019,33688,
+33622,33367,33529,33828,34059,34315,34830,34827,
+34451,34395,33978,33784,33576,33966,34369,34653,
+33791,33429,32963,24651,21409,19439,18552,18661,
+18164,17901,17317,17127,16842,16713,17058,16160,
+15931,15960,15858,15935,16194,16057,15608,16209,
+16769,16303,17295,17210,17330,19440,18732,17949,
+19018,19374,19632,19953,20646,20446,21061,21354,
+21996,21777,22049,22172,22794,23666,23227,24097,
+23554,23667,20898,23475,22161,22032,21471,20718,
+20298,19458,19161,19722,18439,18049,18583,20005,
+20325,19464,19169,19494,20317,20117,20411,25258,
+19399,20077,19276,16584,16875,16729,17232,18179,
+17282,17858,17946,18389,18769,19097,19629,20150,
+20547,20730,21429,21922,22866,26677,29329,31716,
+32825,33165,34092,35044,34324,34791,35769,35613,
+35662,34780,35400,35756,35968,35769,35310,34914,
+34914,34885,34805,35138,35212,35458,35520,34988,
+34921,35392,35259,35752,35141,34829,34777,34827,
+35363,36363,37155,35274,35274,36102,36181,37608,
+36447,36831,36660,37053,36915,36402,35950,35711,
+37701,36033,34513,34540,33507,33310,33001,31722,
+29223,26910,25032,23658,22592,21862,21256,20688,
+20404,20046,19917,19408,19557,19311,19701,18990,
+19008,19749,24240,22110,19837,19307,19164,19737,
+19974,29155,21420,21461,21587,21591,22586,22358,
+25678,24731,25000,28224,28956,25308,22681,21498,
+21370,21063,20976,21099,20984,21074,20886,20823,
+20463,20848,21059,20406,22619,22761,21695,23352,
+24122,23782,22512,21987,21843,26037,29847,30594,
+32455,27229,24339,18080,18254,17516,17538,17122,
+17059,17307,17320,17200,17514,17778,17297,17604,
+18179,17722,17769,18809,18538,17961,17640,17391,
+18069,20131,18376,17696,17175,17412,17679,17946,
+18027,23480,23964,22935,21043,17508,17515,17760,
+17518,17853,18097,17817,17655,17497,17537,17513,
+17181,17185,18017,16017,18063,17133,17686,18393,
+17205,17580,16870,16408,15678,23982,25521,28723,
+27528,27519,32751,33094,34685,34786,33627,35596,
+33348,32982,32887,32894,32850,33126,33159,32982,
+32946,32871,32871,32936,32789,32753,32985,32976,
+32514,31416,31743,31733,32555,32905,32600,28641,
+28877,30747,32991,25770,27773,27832,24398,21065,
+21126,21372,19953,19914,20149,22083,19082,20772,
+21257,23834,27048,23197,16388,20951,25360,32142,
+31094,27510,32122,32655,33003,32994,32928,32828,
+32846,32907,32880,32865,32890,32998,33003,33012,
+33003,33006,33187,33238,33558,33921,37407,36486,
+36085,34782,37086,37778,36376,35612,32130,30096,
+26796,18949,18512,17042,15144,12165,15299,17402,
+18762,19494,19949,16907,11685,18578,31641,33030,
+32438,33318,23578,22505,24283,22697,22210,24003,
+26306,27505,27303,25845,24627,22545,22326,22101,
+22322,22095,22062,21708,22791,22113,22398,21983,
+22225,21025,20599,20369,20412,18777,16852,17143,
+16432,17645,17066,16799,16937,16451,15764,16122,
+16709,17698,15865,17905,16572,16178,16239,15932,
+18534,18357,17526,14352,16745,14406,15871,15525,
+15609,15617,15150,16294,17336,15968,15805,16499,
+16367,16827,16323,18243,16545,15951,15903,16031,
+18124,17264,18004,22699,20985,22773,19795,18408,
+18078,18697,22395,18218,19026,17613,19326,17853,
+17806,17074,17004,17106,17397,17244,17232,16692,
+17318,17903,18039,17449,17310,17943,17368,18717,
+18118,17320,17324,17774,17939,17962,17508,18092,
+18099,18206,18040,18813,18692,18904,18863,19236,
+19629,19758,19857,19783,19870,20046,19890,20122,
+20343,20898,20562,21427,19842,19634,19347,19479,
+19487,19554,19507,19199,19329,19271,18839,19156,
+18699,18938,18916,19153,19113,19429,19172,18915,
+19063,19632,19920,19512,20210,19155,19251,19362,
+19391,19455,19561,19609,19813,19782,19842,19945,
+20179,20272,20241,20178,20517,20510,20136,20237,
+20412,20373,20475,20460,20607,20491,20535,21261,
+22128,22247,22191,22335,22589,23019,22985,24009,
+23366,23070,24312,24637,23190,22347,22563,22221,
+22502,21885,21787,20792,21162,21116,20505,21728,
+21198,21395,21634,22014,21748,22180,21495,21389,
+21554,21478,21302,21285,21189,21072,21048,20887,
+20738,20562,20661,20841,20865,20832,20886,20793,
+21117,20908,20556,21049,20875,20693,20857,20704,
+21185,20502,20487,19899,16058,28069,32994,33336,
+33396,42988,40041,40845,39006,37070,35114,33918,
+33354,33288,33300,33328,33600,33497,33598,33370,
+33438,33548,33488,33558,33300,33300,33300,33272,
+33296,33253,33237,33264,33255,33254,33189,33201,
+33285,33300,33297,33162,33166,33300,33291,33252,
+33300,33300,33297,33282,33276,33479,33274,33298,
+33287,33552,33750,33570,33678,33772,34180,34209,
+34132,33909,33600,33918,34503,33294,33576,33465,
+33908,33556,33875,33907,33954,34080,33865,34188,
+34127,33594,33438,33777,33801,34260,34771,34122,
+34527,33921,33529,33936,33858,33369,34368,34647,
+33457,33109,30949,25426,20336,19482,19188,18662,
+18405,17922,17546,18966,16953,17307,16659,16402,
+16197,16039,16032,16154,16039,15702,16585,15858,
+17811,17196,16292,18011,18093,19644,18804,18940,
+19193,20742,20262,20535,20118,19887,20152,20643,
+20902,21885,21825,21149,22474,22383,23353,23951,
+24366,25728,24228,23646,22551,21237,19861,19116,
+19631,19054,19483,20473,18919,18571,18438,18188,
+17544,19234,19851,19196,19173,19986,20748,20761,
+23332,19034,24717,16644,18128,16863,17036,17325,
+17565,17831,18234,18588,18983,19230,19753,20271,
+20867,21410,22020,22574,24238,27118,30354,32744,
+32982,33444,33752,33980,34260,35848,35601,34842,
+35183,34470,34668,35418,35757,35494,34894,34845,
+34941,34839,34812,34917,34863,35109,35097,34873,
+34997,35331,34940,34828,34924,34826,34829,34824,
+35534,35641,36003,36520,36697,36614,36720,36507,
+36425,36390,36796,37938,36873,36477,35453,36761,
+35642,36774,35407,34014,33578,33081,32998,30695,
+28115,27033,24756,23562,22602,21754,21012,20487,
+20108,20025,19820,19387,19412,19564,19080,18982,
+18873,18380,21765,22181,18816,18585,19009,18121,
+19131,27837,25593,21853,22070,22152,24496,22831,
+31334,24448,28146,29500,28730,24637,21270,21018,
+20635,20895,20994,20966,20817,20704,21124,20408,
+20832,21408,20799,20981,20399,21558,22857,21782,
+24484,23301,22690,21876,21649,21764,31067,32988,
+32946,29379,22536,16839,18492,17508,17339,17298,
+17293,17511,17682,17718,17794,17652,17454,17544,
+17397,17444,17416,17312,17736,17436,17673,17447,
+17595,17975,18085,18138,17529,17451,17298,17676,
+18309,22052,23528,22177,19369,18003,17474,18058,
+17385,17524,17586,17721,17721,17606,17586,17898,
+17253,17365,19611,15923,18057,16541,18052,18843,
+17278,16734,15723,15843,23845,26708,29403,27570,
+26760,32754,31461,32883,33035,33075,33117,33030,
+32998,32914,32756,32841,32938,32884,32862,32862,
+32808,32829,32837,32770,32782,32784,32768,32714,
+32655,31211,31986,31977,32026,32575,31116,29502,
+29384,27884,28683,27307,26975,31426,26697,21299,
+24558,20016,22704,20871,20778,19628,18297,18224,
+18435,18279,20415,22680,23928,13017,15297,27848,
+28866,28399,23135,29436,33003,32904,32898,32896,
+32886,32833,32822,32829,32908,33004,33007,33003,
+33003,33022,33084,33338,33630,35520,36594,38967,
+36963,37231,37587,38791,34221,40395,40457,32344,
+27105,27914,28129,32990,32991,24933,16110,10155,
+16099,19095,17388,8281,16491,31025,33561,32993,
+25788,24104,23977,23505,23545,24713,24852,26871,
+27619,27978,26223,24747,24543,23073,22303,22206,
+22191,21750,22024,22074,22167,22498,23077,23663,
+23772,23207,22828,22419,21288,21903,19358,20821,
+17180,16849,16815,16832,16327,16719,16372,16494,
+23895,18604,20594,18869,16869,16458,17444,17499,
+16667,16905,16290,17672,16119,15739,15911,16636,
+15074,14997,15564,16046,16632,15187,16092,16332,
+16386,16173,16209,23940,16471,15636,15905,16567,
+16329,17765,19537,21006,21873,25853,25587,19349,
+17631,18355,19565,21024,20300,19702,16564,17022,
+17847,17560,17216,16332,16051,16958,17457,17204,
+22639,18095,18516,18030,17931,18531,16743,18748,
+17901,17275,17157,16812,18414,17445,17247,17368,
+20028,18732,18785,18812,19005,18803,19110,19425,
+19116,19156,19334,19605,19778,19813,19916,20241,
+20271,20591,20220,19891,19740,19494,19454,19777,
+19459,19362,19380,19130,19066,19100,18675,19443,
+19131,19030,18946,19104,19470,19513,19533,19188,
+19244,19220,19183,19817,20188,20253,19720,19410,
+19584,19541,19596,19821,20058,19962,20032,20182,
+20342,20269,20215,20079,19916,20403,20678,20636,
+20530,20324,20365,20407,20388,20439,20559,21308,
+20459,22075,22089,22482,22642,22980,22997,22842,
+23126,23631,24648,23771,23082,22797,21784,22440,
+22155,22634,21900,21995,21187,21398,21726,21531,
+21504,21648,21903,22527,21488,21756,21522,21419,
+21496,21657,21635,21275,21252,21033,21113,21159,
+20898,20784,20755,20778,21053,21103,21387,20875,
+21441,21177,21235,21146,20939,20856,20615,21232,
+20489,20733,23991,19848,18992,32260,33015,33369,
+34992,41006,34961,35765,38070,35580,34780,33592,
+33599,33553,33330,33330,33311,33300,33558,33622,
+33602,33300,33297,33300,33300,33300,33300,33299,
+33244,33227,33229,33260,33210,33217,33178,33189,
+33174,33168,33153,33300,33288,33150,33279,33203,
+33162,33217,33265,33529,33294,33279,33579,33429,
+33564,33751,33575,33338,33606,33940,33600,34139,
+34176,33900,33752,33597,33357,33270,33642,33267,
+33888,33698,33924,33543,33521,33561,33583,33599,
+33558,33613,33707,33536,33657,34426,34455,34614,
+34226,33890,33346,33414,33366,33303,33306,33899,
+33297,33009,25041,20990,19919,19418,18891,18915,
+18304,18078,17734,17329,17227,17022,16727,16188,
+16160,16181,16206,16467,16821,15754,16995,16405,
+17341,16936,16021,18120,17551,18053,18417,18504,
+19317,19704,19517,19563,19633,20464,20860,21392,
+21924,22092,21601,21957,22873,22109,23104,24019,
+25353,25172,23932,23028,22674,22418,21708,21788,
+19904,20940,19475,19641,19638,17681,17706,17083,
+17638,18260,18687,19653,19311,20340,20220,20590,
+19965,18503,21339,17961,18136,17532,29015,17079,
+18504,17607,18137,18486,18950,19375,19920,20384,
+20939,21681,22524,23454,25085,26895,29802,32883,
+33021,33144,33549,33976,34603,34555,35243,35277,
+34840,34881,35286,35493,35271,34976,34844,34816,
+35025,34538,34728,34902,34830,34980,34648,34712,
+35102,34990,34869,34810,34925,34817,34832,34812,
+35395,36440,35646,35292,36504,37149,36081,36250,
+36247,36406,36855,36864,37014,36927,35550,36597,
+36553,37997,35493,34694,34155,33177,32887,29750,
+28194,26843,24750,23478,22594,21562,21072,20595,
+20088,19674,19599,19437,19395,19203,19011,18733,
+20972,17946,20175,20788,18528,17875,17748,18736,
+19851,18387,32984,26187,22580,22402,26283,23842,
+28367,30462,29140,28827,26317,21891,20884,20776,
+20774,20958,21378,21120,20859,20337,21146,21292,
+20195,21007,20505,21753,21084,20731,23802,21975,
+22970,23823,22394,20961,20698,22109,25903,30762,
+32990,32662,24171,18044,18811,16936,17216,17409,
+17348,17513,17579,17562,17448,17403,17401,17446,
+17533,17410,17427,17468,17313,17524,17462,17482,
+17852,17609,17987,18073,17823,17739,17641,17628,
+17639,21564,21999,22107,20091,19315,17982,17822,
+17477,19394,18075,17784,17771,17751,17701,19270,
+17194,18149,16824,17078,18074,16698,17127,17616,
+17631,15960,15841,23046,27903,30048,26886,26289,
+31710,32987,32995,33462,32890,32829,32893,32893,
+32917,32925,32860,32873,32973,32851,32872,32802,
+32917,32988,32805,32795,32816,32841,32855,32793,
+32623,32213,32007,32632,32340,31001,30521,32661,
+32095,29542,26184,26582,27846,30952,22387,32991,
+32912,27099,25677,24165,21843,20790,23089,22560,
+18219,18530,19362,21255,21985,15276,12590,18446,
+32726,33003,29475,22371,32997,32996,32945,32849,
+32865,32908,32925,32871,33003,33003,33009,33003,
+33053,33324,33386,33422,34091,39118,41613,41821,
+38406,40956,35740,36591,38163,31554,28881,29862,
+32610,33729,33516,35188,33900,35170,34523,22936,
+14987,10215,17268,19269,29892,33405,32502,24873,
+26041,26100,25950,25675,25846,26886,27665,27583,
+27649,27739,26328,24945,23629,22971,22504,22598,
+22278,22627,22976,25026,25463,24663,24264,24810,
+24945,24928,24114,23787,22705,22449,22189,21102,
+18187,17334,16456,16358,16350,16372,16813,18420,
+25791,15717,17106,16611,16059,15582,16325,19578,
+17483,16563,16787,16028,16235,15828,16476,16383,
+17424,16782,16720,17301,17105,16344,15713,16224,
+15626,15994,16235,17658,18381,16317,16041,16792,
+16267,16739,16833,18492,21396,21726,24058,22908,
+18093,26431,24558,19845,18186,17252,17526,17388,
+19410,25846,17376,17472,18154,19881,17911,17980,
+17983,17120,17449,15227,17435,18594,19501,16494,
+15913,16901,17349,18594,18422,19045,17907,17787,
+18360,17652,20115,20089,19114,19350,20062,19290,
+19058,18767,19368,19340,19648,19658,20003,19918,
+20256,20090,20049,19695,19570,19425,19286,19371,
+19449,19497,19035,19258,19086,19028,19389,18905,
+19029,18939,19005,19239,19414,19306,19352,19539,
+18926,18751,19069,19368,19021,20011,19805,19556,
+19607,19771,20014,20210,20267,20260,20307,20334,
+20308,20301,20264,20343,20341,20497,20421,20430,
+20403,20274,20424,20396,20462,20579,21001,20976,
+21267,21991,21988,22897,22682,22662,22953,23633,
+23040,23375,23587,24037,23466,23185,22482,22509,
+22620,22589,22434,21861,22305,21682,22292,21482,
+21411,21165,22191,22180,21660,21855,21717,21657,
+21458,21575,21372,21450,21482,21134,21048,21066,
+20934,20742,21053,21340,21600,21375,21607,21433,
+21334,21398,21541,21837,21126,20796,21169,21759,
+21955,25154,20884,20136,21128,32679,33043,33489,
+34370,38835,36952,34808,35632,34128,33804,33593,
+33469,33473,33378,33304,33321,33300,33354,33302,
+33408,33300,33300,33299,33262,33296,33291,33276,
+33245,33222,33229,33280,33299,33276,33247,33141,
+33123,33147,33139,33156,33112,33260,33136,33131,
+33156,33232,33275,33292,33300,33297,33374,33485,
+33650,33592,33897,33798,33558,33832,33593,33778,
+33595,33585,33906,33630,33599,33123,33237,33283,
+33444,33954,33701,33936,33588,33324,33321,33585,
+33294,33457,33280,33453,33510,34256,33943,34586,
+34880,33516,33377,33195,33418,33251,33068,33201,
+33354,32433,28929,21562,20007,19527,19224,19113,
+19090,18703,18035,17865,17709,17150,16872,16599,
+16600,16681,16485,18474,16800,15911,18001,18110,
+16689,16644,18201,17619,18267,17079,17938,18681,
+19028,18891,19169,19845,20241,21090,21171,20930,
+21359,21486,21838,22383,23114,22659,21856,24891,
+25024,25583,22992,22831,22498,21917,21612,21498,
+20658,20622,20893,19869,19458,19156,18621,17669,
+16503,16662,18316,17631,18061,20336,20601,22161,
+20004,18354,18616,21187,16770,17855,16612,17736,
+22179,23314,18314,18585,19059,19407,19771,20225,
+21072,21695,22623,23803,25089,26868,29525,32743,
+33036,33436,34019,33440,33915,34781,34820,35091,
+34901,34878,35188,35099,35179,34641,34829,34833,
+34761,34750,34518,34430,34646,34824,34692,34749,
+34980,34824,34773,34902,34919,34890,34979,35751,
+35313,35684,35292,35292,37217,36223,36187,36485,
+36397,36411,36779,36693,36516,37287,36975,36642,
+37524,36672,36804,35531,34317,33722,32053,32998,
+28437,27102,25358,23730,22641,21670,20954,20502,
+20104,19602,19462,19252,19150,18963,18795,18560,
+18463,18633,18228,18909,17889,18321,18459,18605,
+18834,22428,31606,23489,23209,23813,25372,32664,
+32701,31974,29296,25266,21940,20826,20600,20775,
+20772,21187,21598,22287,21135,20374,20169,21098,
+20185,20465,20901,21531,21015,21129,20331,24513,
+23292,21805,23394,21411,21624,20565,23649,32818,
+32814,27851,25941,19008,19392,17571,17007,17427,
+17283,17310,17443,17760,17421,17380,17295,17371,
+17579,17510,17475,17408,17313,19749,17675,17564,
+18070,18507,18002,17985,17994,17853,17711,17820,
+17755,20070,22047,20826,19205,19466,18032,18084,
+17907,18650,17833,18011,17922,17904,17924,20364,
+17910,18468,18723,18688,18792,18051,18045,16980,
+16070,15356,24501,28140,32540,28824,27756,30959,
+34017,33795,33371,33261,32913,32946,32907,32893,
+32881,32922,32926,32829,32910,32814,32805,32803,
+32848,32804,32814,32844,32897,32906,32898,32832,
+32820,32731,30916,32960,31243,31290,32842,34469,
+33202,29803,26097,32486,32988,33357,32039,30213,
+32132,17511,22308,22881,23347,24014,26273,26118,
+28963,17951,18003,19538,26280,13556,12915,22071,
+31316,32384,30628,22519,25488,32988,32981,32623,
+32835,32827,32934,32987,33003,33003,33020,33104,
+33559,34542,36418,40067,36276,38391,38717,38016,
+34388,34605,33549,33004,28671,27862,30615,28452,
+28831,29412,29079,31332,31401,30006,35514,35096,
+28378,26472,26126,25567,25075,32250,23107,25857,
+28213,27912,28585,27406,27573,27603,32873,30952,
+27853,27391,27402,28141,25346,23529,23547,24564,
+25832,27312,27068,26275,24663,23811,23901,24321,
+24426,23877,23824,23257,23191,22841,21864,21666,
+20277,19230,17860,16809,16203,16362,16747,15925,
+16911,19439,15750,16752,16396,16351,19182,16907,
+15195,15463,14984,16269,15543,15503,16809,16571,
+16950,16515,17748,20322,16637,16467,16489,19404,
+17568,15435,15708,16695,16928,18023,16498,16279,
+16158,16710,17379,18399,22274,20884,25098,23590,
+22175,20925,20942,18065,18108,17710,17618,17643,
+17169,17799,17352,17132,17454,17518,17954,17362,
+17945,17525,19241,17846,19111,20178,16867,16405,
+17231,17745,18789,18615,19413,18556,17626,18571,
+19735,19239,20400,18889,19269,18908,19468,20328,
+19366,19468,19071,19630,19337,19493,19686,20007,
+19860,19617,19579,19499,18965,19254,19513,19337,
+19398,19060,19227,19067,18996,19016,19422,19221,
+18823,18818,18937,19255,19242,19062,19248,19410,
+19093,19110,19523,19711,19566,20100,19688,19751,
+19830,19895,20094,20207,20469,20539,20438,20481,
+20365,20291,20323,20383,20387,20472,20648,20350,
+20211,20139,20109,20307,20424,20679,20869,20931,
+21006,21741,22062,22225,22738,23624,22416,22779,
+22311,23131,23404,24157,23582,23400,23832,22741,
+22557,22873,22589,22746,23391,22155,22149,21376,
+21641,21794,21113,21593,21687,21781,21685,21933,
+21549,21663,21457,22198,21954,21277,21228,21225,
+21151,21092,21310,21713,22319,21569,21201,21580,
+21654,22368,22042,22115,22103,22142,22076,21035,
+21612,22925,22337,20914,21026,32921,33309,33717,
+37888,39128,37982,33882,34515,33544,33477,33448,
+33371,33350,33393,33362,33345,33317,33300,33294,
+33300,33300,33285,33281,33220,33261,33274,33264,
+33246,33204,33204,33238,33269,33241,33221,33169,
+33148,33207,33129,33122,33287,33178,33243,33274,
+33132,33126,33282,33217,33252,33521,33174,33298,
+33719,33684,33535,33521,33410,33538,33237,33587,
+33554,33592,33615,33736,33309,33315,33620,33561,
+33930,33876,33710,33875,33808,33282,33345,33302,
+33390,33294,33378,33298,33816,34205,33958,34764,
+34875,34006,33368,33444,33164,32930,32955,30988,
+31389,32677,23995,21424,20699,19681,19562,19781,
+19325,18874,19386,18308,17973,17577,17167,16890,
+16781,16596,16464,16996,17099,17068,17081,16753,
+16979,15783,17769,17312,17466,18124,17962,18081,
+19023,19137,19227,18872,20005,19917,20385,21608,
+21693,22359,21590,22062,22106,24120,24985,27296,
+24303,22605,22024,22688,22362,21854,20790,20436,
+21088,20514,20857,19824,20037,19367,19212,19128,
+18642,19270,19131,18725,19003,17178,19586,19786,
+19918,18990,21281,17892,17621,17230,18587,17904,
+17976,17805,18210,18630,18989,19385,19789,20285,
+20858,21677,22589,23309,24423,26985,31998,32929,
+33295,33669,34438,34101,34005,33984,34354,34891,
+34794,34837,34465,34362,34649,33995,34560,34314,
+34373,34552,34368,34404,34359,34633,34254,34746,
+34880,34834,34827,34818,34806,34860,34876,36115,
+35425,36936,35319,36029,36972,36294,36200,36236,
+36750,36415,36663,36136,36801,37516,37570,37590,
+36741,36473,36308,35728,37927,34635,32989,32581,
+29286,27549,26573,24241,22780,21707,20769,20290,
+19899,19402,19271,19150,18948,18780,18730,18543,
+18328,18224,17997,17835,17808,17817,17966,18155,
+19069,20871,23124,26198,29752,32753,32870,32852,
+32794,29103,25991,22205,21132,20689,20399,20727,
+21802,21189,21551,23268,21582,20750,20008,19828,
+21879,20628,21236,21619,21897,22020,22609,21678,
+25410,25887,22107,22144,21054,19762,21027,24351,
+29740,29372,26902,25036,17940,17422,18042,17772,
+17526,18009,18087,17718,18405,17574,17522,17764,
+17722,17795,18026,18226,18092,21215,19017,17564,
+17933,18123,18067,18078,18144,17898,17831,17861,
+17856,20400,23419,20559,19058,18630,18066,18114,
+18075,18010,19498,19202,18238,17999,18045,17791,
+17962,17255,19890,18218,18684,18502,17781,16713,
+15720,21672,28491,29570,28006,30045,32547,35928,
+34215,33256,33081,33039,32943,32938,32925,32887,
+32898,32892,32912,32863,32862,32852,32835,32812,
+32832,32837,32824,32873,32910,32911,32922,32927,
+32806,32694,32352,28299,27428,28961,32988,34970,
+33248,32136,28617,33372,32988,32982,32892,21016,
+19536,19312,19468,22509,22560,25278,22328,21523,
+18192,19682,18951,20319,25142,13674,18654,32709,
+30276,30113,27327,27099,26553,32844,32694,32476,
+32909,33003,33156,33326,33423,33441,33642,36655,
+40107,40637,36580,35260,34100,33964,33897,34491,
+33445,33220,36052,32532,32994,28490,27531,27984,
+27793,27516,28527,27763,26780,26607,29151,33726,
+33826,29936,23812,20510,26698,26551,28206,27339,
+28067,29405,29307,28059,27846,27819,27673,27296,
+27853,27321,27420,27405,25032,24145,25011,27788,
+27875,26160,25174,24345,23609,24703,23741,23659,
+23385,23129,23369,23386,22972,22390,22443,22194,
+20930,20234,19474,18229,17386,17199,17507,15500,
+17037,19788,17281,17397,16826,15854,17083,15637,
+15300,15121,14514,15393,15207,15053,15283,16561,
+16024,16163,21169,16820,16307,16881,16107,19011,
+17379,18949,16521,16042,16979,16752,17113,16956,
+16065,16651,17190,17513,21218,23017,23328,23070,
+18774,18532,19835,16842,21120,17493,17572,16779,
+17346,20485,17747,17485,17065,17336,17670,17877,
+17898,17121,18675,18268,18363,17811,18411,17981,
+18084,18544,18933,19065,20046,18895,18440,18603,
+18742,19026,19437,19021,18215,18966,20127,19797,
+19194,19183,20145,19899,19365,19753,19805,19586,
+19522,19330,19026,19424,18960,18880,19143,19551,
+19334,19122,19189,19332,19392,19142,19242,19656,
+19281,19035,19235,19240,19139,19050,19202,19110,
+19175,19143,19290,19507,19770,19853,19800,19643,
+19834,19976,20066,20218,20337,20166,20231,20341,
+20214,20195,20212,20260,20300,20194,20363,20201,
+20174,20166,20210,20392,20441,20571,20807,20913,
+20958,21205,21993,22716,22421,22518,22683,22632,
+22429,22887,22828,22581,23139,23266,23481,23466,
+23695,22995,22823,22078,22611,22733,21576,21418,
+21821,21789,21978,21687,21863,21852,21822,22003,
+21819,21747,21786,22006,21687,21757,21579,21657,
+21501,21473,21594,22068,22263,22067,21996,21945,
+22710,22156,22795,22707,22267,22334,23010,23953,
+21402,21648,23054,21642,21339,32340,36224,33841,
+38416,38203,36821,34241,33573,33569,33537,33531,
+33438,33405,33405,33360,33351,33322,33305,33295,
+33300,33297,33270,33261,33249,33237,33237,33244,
+33243,33244,33215,33216,33264,33229,33276,33150,
+33117,33190,33114,33114,33107,33157,33196,33101,
+33174,33133,33210,33298,33297,33311,33299,33310,
+33183,33591,33416,33598,33304,33302,33169,33316,
+33334,33305,33418,33585,33171,33301,33300,33600,
+33600,33516,33339,33633,33250,33290,33088,33197,
+33318,33280,33299,33227,33744,33796,35071,33842,
+34278,33464,33630,33179,32974,32404,26532,26094,
+25310,23583,22005,21687,21350,27419,20139,20281,
+19634,19125,18888,18554,18416,17868,17487,17237,
+16908,17072,16962,17564,17373,17078,17463,17886,
+17540,16270,18463,18678,18409,17830,18729,18274,
+18705,19425,19366,18721,18851,19851,19744,20624,
+20833,21422,21713,21579,22173,21412,23295,23208,
+24390,23014,23290,22140,21837,20928,21262,22727,
+21009,20710,20106,20519,20096,19410,19229,19301,
+19569,19514,27249,20226,19365,18921,19161,18957,
+18518,18813,19072,19008,18557,17812,17521,17589,
+18156,18632,18087,18435,19068,19409,19987,20545,
+21099,21714,22503,24241,27358,31567,32599,33043,
+33567,34014,33622,33774,34067,34750,33649,34894,
+34783,35054,34183,34155,34043,34370,34379,34274,
+34050,34063,34278,34299,34391,34377,34388,34392,
+34825,34827,34829,34827,34487,34842,35232,34782,
+35692,39303,35319,37232,36711,36375,36520,36289,
+36423,36609,36647,36320,36602,37666,38349,37620,
+36672,36618,36401,35647,34802,34442,33514,31992,
+30742,28593,27154,24336,22855,21683,20975,20284,
+19838,19455,19077,18978,18836,18773,18494,18328,
+18218,18189,17984,17805,17916,17733,17741,18928,
+19956,20859,23166,24482,31864,32671,32842,32982,
+32955,26072,21983,21153,21028,20286,20614,20859,
+22617,21733,21744,21500,21090,19546,20337,21033,
+21372,20442,21083,21218,21377,22821,23566,23715,
+22722,23666,23372,22277,20010,20414,20131,21227,
+23171,25992,25089,24666,17384,18511,17853,18030,
+17664,17962,17862,18113,18114,17998,17967,18951,
+18865,17969,17769,18108,18722,23360,20213,18554,
+18052,18186,18171,18108,18168,17987,17955,18001,
+18181,21942,25224,21955,20163,19654,18168,18258,
+18255,18072,18348,19560,18293,18238,18447,19131,
+18043,17654,19171,19688,18500,19751,19259,17666,
+17489,25938,32784,29301,32889,33102,39930,35271,
+33256,33206,33120,33005,32943,32935,32923,32916,
+32910,32881,32865,32898,32896,32874,32841,32873,
+32892,32893,32898,32944,32938,32945,32943,32923,
+32920,32870,32115,27276,26802,27067,32247,34324,
+33003,27192,30516,34680,33380,33642,29571,18045,
+18030,19791,18318,19749,21079,17910,21827,21305,
+18178,25312,22953,28642,20980,20369,27966,30606,
+29985,30210,30783,31848,29358,32528,33421,35331,
+34362,34140,38432,37472,38942,42756,41856,39086,
+37521,34577,34097,33356,33146,33095,33167,33081,
+33082,33160,30136,27891,27560,27469,27096,27279,
+27391,28062,27633,27920,26577,26334,26390,33948,
+32881,34158,28525,23172,27741,22312,26307,27565,
+27996,28498,28572,27874,27851,27644,28181,26476,
+26306,26584,26685,26341,24501,24566,25083,26570,
+25575,25116,23706,24148,23647,23078,23558,23223,
+22786,22999,23345,23060,22642,22008,22056,22341,
+20733,19945,19462,18675,17878,17275,17553,18650,
+17949,17202,16857,20038,18587,16955,16068,15447,
+17139,16548,15069,15118,15684,15417,14831,15003,
+15201,16297,17187,19234,16142,20502,17398,17212,
+20115,18867,24910,16620,16653,17116,15260,16389,
+16784,15755,17049,17322,21574,22020,24384,20108,
+18300,17396,17562,18036,18222,18066,16903,16932,
+18510,17622,16596,17573,17368,17600,18714,17395,
+18109,18951,17723,17516,17986,21153,18305,18145,
+18151,18464,18806,19067,19154,19149,19092,18726,
+18799,18939,18862,19196,18951,19189,19308,19481,
+19529,19308,19694,19532,19785,19301,19619,19900,
+19719,19843,19461,18984,18928,18989,19239,19354,
+19349,19357,19404,19524,19227,19170,19206,18698,
+18637,18870,19146,19212,19250,19469,19417,19297,
+19452,19205,19325,19825,19442,19231,19563,19419,
+19594,19842,19932,20102,20020,20112,20160,20188,
+20070,20184,20201,20107,20403,20287,20307,20118,
+20142,20199,20150,20157,20418,20633,20928,21111,
+21141,21095,21039,21238,22047,21896,21861,21981,
+22173,22602,22483,22512,22556,23211,22659,22923,
+23421,21490,21587,23236,22915,22372,22550,22646,
+22702,22106,22122,21897,22368,22295,21953,21907,
+22176,22037,22372,22229,21939,22001,22021,21966,
+21772,21836,22006,22443,22648,22908,22504,22351,
+22110,22694,22906,23255,22929,22830,22981,23169,
+23749,24939,22539,21680,19224,31492,33092,33903,
+34941,41189,35723,35255,33591,33706,33612,33601,
+33540,33477,33440,33401,33366,33320,33308,33303,
+33299,33286,33274,33276,33282,33205,33294,33282,
+33221,33300,33297,33184,33172,33167,33151,33132,
+33120,33109,33106,33103,33102,33099,33094,33069,
+33056,33078,33124,33139,33143,33255,33228,33243,
+33163,33168,33291,33297,33288,33282,33316,33260,
+33249,33294,33308,33300,33127,33300,33267,33300,
+33996,33424,33941,33297,33129,33063,33036,33068,
+33329,33300,33108,33314,33268,34587,33338,33395,
+33710,33295,33258,32951,32724,26651,24925,23952,
+27680,28523,27629,21314,28271,29503,20364,24356,
+20265,19575,19151,18540,18279,18152,17670,17519,
+17283,17142,16953,16621,17100,16588,16902,18305,
+18284,17895,18123,17361,18110,17299,17990,18722,
+17607,18423,19107,19653,18534,18813,20295,21018,
+21169,21409,21039,21757,22277,22527,23747,25753,
+23889,22974,21630,22266,21486,21363,21818,20736,
+20646,19824,19682,20341,19908,19638,19311,19000,
+18868,18560,19236,19709,19618,20304,19942,18039,
+20739,19632,19631,19329,19437,18961,18054,17958,
+18204,18630,18816,18839,19411,19742,20214,20498,
+20772,22501,25739,27892,30960,32538,33667,33672,
+33342,33453,34048,34830,34041,34803,34940,34880,
+34899,34439,33916,34021,34149,33998,34287,34363,
+34328,34368,34374,34621,34424,34853,34797,34773,
+34827,34542,34823,34606,34706,35748,35737,36187,
+38278,40353,35319,38567,36639,36919,36574,36459,
+36624,36488,36625,36309,36288,36083,37264,36486,
+36843,36286,36480,35743,35483,34771,33881,33395,
+31086,30732,27051,24331,23051,22112,21753,21033,
+20142,19597,19161,18843,18705,18622,18444,18346,
+20553,18641,18027,17813,17827,17587,17856,17869,
+19905,20235,22669,24238,22626,29488,32982,32949,
+25484,21983,20724,20735,20522,20548,20707,20914,
+21850,23829,20619,20792,20511,20772,20087,20440,
+20589,20702,21127,21721,21620,22538,22208,22989,
+24447,23904,22450,22072,20817,20128,21333,20310,
+20934,22985,23004,24199,17793,18294,18180,18063,
+17871,17919,18047,17624,18117,17868,17586,18166,
+18259,17969,17778,17835,17337,22063,19161,18563,
+18417,18873,18278,18318,18305,19026,18267,18213,
+18108,22715,24021,22894,21987,20361,18309,18471,
+18287,18517,18987,19260,18378,18405,17953,18299,
+19036,17610,17374,20412,18084,18202,17956,18033,
+25264,32525,30341,31187,33019,33894,33621,33350,
+33200,33094,33037,33015,32949,32946,32953,32903,
+32919,32915,32881,32904,32896,32904,32886,32909,
+32916,32922,32929,32940,32923,33156,33147,32990,
+33003,32928,32740,30921,27282,27177,32274,33343,
+33300,29318,33253,33814,33767,32988,29333,19190,
+17982,21212,20990,19652,23981,33879,30696,21897,
+31272,30589,21898,23844,27824,33616,30521,28875,
+27232,32772,33222,32742,34446,33708,34821,37605,
+37642,40425,40725,40358,41939,37840,35289,34715,
+33648,37110,33646,33575,33721,33490,33589,33840,
+32970,29585,27065,26629,26724,26888,27315,29448,
+28724,28117,26922,25907,25925,25821,25631,26826,
+27144,31527,24726,26904,25012,25832,26172,27125,
+27585,27922,27985,27696,27490,27553,27378,27185,
+26617,25689,26341,25628,24203,23392,23857,23004,
+25112,22861,24073,22350,22551,22413,22641,22807,
+22421,22629,22791,22610,22002,21249,21413,21143,
+20673,20142,19947,19459,18747,17757,17146,18647,
+17288,17699,18019,18648,17322,17118,16906,17085,
+16474,17247,16382,16326,15004,15409,15333,14850,
+15069,15136,17445,16864,16596,17012,17621,16455,
+17809,18834,17331,17221,17126,18550,17808,19098,
+16631,15785,16304,18733,22008,18741,18768,17831,
+16927,17178,17056,17169,16914,17482,16945,16358,
+17027,16900,17076,17385,17472,17658,17876,17495,
+21684,17835,18053,18627,18027,17531,19098,18748,
+18602,18675,18789,18856,19104,18939,18782,18884,
+18718,18798,18649,18940,18919,19179,19446,19359,
+19149,18726,18980,20991,19513,19922,19638,19683,
+20028,19882,19501,19789,19216,19343,19412,19515,
+19372,19426,19376,19368,19370,19405,19221,19537,
+19164,18654,18705,18761,19124,19274,19448,19666,
+19375,19290,19167,19420,19035,19306,19353,19267,
+19545,19787,19844,19912,20014,20031,20205,20074,
+20148,20255,20412,20151,20077,20301,20390,20277,
+20270,20465,20277,19848,20296,20590,20934,21198,
+21075,21097,21208,21053,21179,21275,21147,21698,
+21684,21293,21587,22317,22435,22694,22517,22358,
+22371,22718,23116,23183,23260,22618,22717,22833,
+22656,22474,22385,22226,21981,22361,22161,22076,
+22002,22258,22158,22221,22029,22458,22265,22212,
+22083,22197,22798,23292,23109,22783,22617,22650,
+22908,23323,23355,23442,23461,23064,23218,23211,
+23502,23595,24483,24199,19624,28838,32712,32978,
+33809,38623,40605,35545,34506,33872,33732,33638,
+33552,33492,33449,33425,33381,33346,33315,33307,
+33294,33300,33300,33301,33300,33236,33207,33205,
+33299,33244,33298,33201,33159,33145,33132,33123,
+33114,33114,33105,33090,33084,33078,33084,33078,
+33076,33060,33069,33054,33101,33097,33111,33233,
+33225,33098,33154,33297,33297,33300,33298,33173,
+33068,33156,33183,33150,33052,33158,33300,33244,
+33303,33381,33273,33521,33276,33229,32997,33119,
+33171,33284,33121,33010,33294,33321,33170,33558,
+33129,33004,32988,32435,26894,24496,23371,25659,
+22462,22026,21333,21291,20945,20792,20782,20063,
+20016,19543,19067,18543,18235,18074,17883,17748,
+17484,17259,16903,16925,17181,17020,17355,18027,
+18972,18874,18177,16334,16461,17727,18047,18067,
+18739,18281,17890,18839,19209,19558,19734,20214,
+20609,19128,20276,22269,23321,21257,22967,22774,
+23234,23364,21647,21711,22683,20980,21576,20244,
+20391,20265,20029,19716,19197,18596,18172,19040,
+18753,18720,19383,19265,19447,19995,20085,20324,
+19518,21115,19783,22250,21774,19792,18889,19497,
+19080,19311,19520,19528,19970,20144,20651,20804,
+21732,25859,28507,32188,32809,33789,35237,33971,
+33699,33672,34537,34821,34772,34780,34860,34908,
+33816,34002,33898,34011,34059,34071,34091,34176,
+34188,34227,34371,34366,34415,34363,34461,34857,
+34827,34745,34827,34598,35157,35590,35363,36643,
+36885,40157,34980,38198,37485,37497,36781,36617,
+36795,36434,36523,36909,36887,37826,37713,37917,
+37545,41253,36286,35737,35757,34393,33785,33645,
+32622,30976,27161,24345,23119,22490,22210,21639,
+20919,20204,19626,19137,18782,18596,18447,18321,
+18217,18213,17964,17832,17770,17769,17702,17909,
+18372,19442,21348,23677,22358,23077,23784,22160,
+21383,20700,19986,20535,21144,20638,20958,24167,
+20778,20915,20146,19569,19936,20872,20179,19662,
+20057,20085,20860,20694,22479,22769,22266,24903,
+26247,25106,23053,21237,21897,21210,19931,19950,
+20548,21906,21324,22620,17880,18112,19524,18081,
+18015,17988,17944,18078,18507,18733,18261,17950,
+18088,17930,17784,17690,17859,23905,24018,18507,
+18390,18774,18455,18612,18488,18597,18396,18314,
+18337,21058,22496,22948,21450,19930,18480,18582,
+18729,18665,18585,18672,18897,18702,18426,18513,
+19443,18081,18466,20145,20531,17052,16015,21754,
+32081,30837,30834,33149,36750,33760,33174,33242,
+33103,33030,33024,33003,32968,32963,32967,32989,
+32980,32952,32910,32918,32921,32930,32910,32970,
+33017,33004,32921,33041,33003,33039,33444,33165,
+33159,32928,32946,32911,31681,27310,34320,36849,
+33332,31755,36410,33900,33332,32142,26016,18562,
+19074,18859,17720,19993,38309,34098,30442,32916,
+32728,33062,34948,33757,34319,32846,29349,29156,
+30112,33045,33111,33582,34738,34025,32988,33500,
+35139,36700,34119,34203,37575,33191,33150,33965,
+33814,34167,34189,35021,33595,32744,32181,25633,
+28418,26625,26530,27247,27041,27142,28251,30102,
+28119,27656,26694,25832,25125,26522,28959,34600,
+29380,28416,28483,25245,26169,32250,26461,27385,
+27396,27709,27861,27672,27407,27229,26888,26736,
+25952,25397,26060,25273,24168,22074,25730,21015,
+20779,21774,21444,21491,21876,21369,21921,22192,
+22239,22599,22812,22441,21834,20977,21108,21301,
+20627,20334,19966,19738,18937,17275,18191,17501,
+17483,17415,17405,18227,17190,17601,17625,16674,
+16587,17003,16026,16251,15748,15750,15690,17025,
+15262,17262,16210,16109,16193,17904,18038,16806,
+28193,17724,15543,17310,17643,16633,16704,17250,
+16512,19983,15910,17265,17076,17277,17198,16609,
+17234,17235,17203,17181,17680,17463,17102,16768,
+17053,17080,17191,17637,17457,17204,17259,17904,
+20470,17814,18018,17865,17484,18316,19100,18867,
+18576,18878,18733,18681,18822,18850,18857,18993,
+18963,18691,18966,19065,18912,19269,19287,19270,
+19333,19173,18938,19188,19402,20010,19861,19567,
+20029,20289,19862,20199,19309,19443,19946,19890,
+19557,19647,19488,19566,19159,20034,19862,20250,
+19722,19061,18939,18597,19127,19422,19473,19702,
+19528,19337,19243,19132,19324,19017,19004,19143,
+19856,19625,19599,19692,19986,20031,20093,20064,
+19914,20326,20258,20283,20292,20280,20266,20126,
+20412,20478,20299,20052,20412,20526,20766,20895,
+21008,21126,21180,21219,21428,21433,21351,21788,
+21579,21638,21461,22005,22035,21997,22226,22107,
+22248,22749,23432,23060,22774,23115,22746,22594,
+22762,22383,22578,22283,22678,22473,22473,22470,
+22535,22447,22585,22362,22433,22169,22336,22439,
+22692,23052,23343,23419,23437,23714,23190,23219,
+23306,23556,23511,23364,23401,23349,23739,24172,
+24039,23959,24102,23982,23410,28102,32790,32988,
+33132,45051,40781,35552,34027,33950,33724,33639,
+33564,33510,33475,33456,33413,33372,33329,33310,
+33300,33291,33270,33263,33242,33237,33283,33263,
+33192,33189,33187,33168,33163,33147,33133,33122,
+33117,33114,33102,33093,33084,33084,33084,33159,
+33208,33196,33209,33144,33047,33066,33057,33267,
+33192,33314,33218,33125,33330,33297,33300,33250,
+33035,33038,33083,33063,33018,33229,33287,33237,
+33215,33242,33221,33465,33255,33229,33048,32996,
+33075,33123,33042,32997,32995,32907,32979,32646,
+32906,32872,27471,25777,24265,22902,22569,22025,
+22059,21475,21315,20958,20587,20495,20319,20089,
+20116,19538,19128,18572,18483,18258,18317,17428,
+16940,17088,17175,17122,17395,17244,16872,18701,
+18144,17827,17697,16671,16531,16386,17074,17916,
+17932,19043,17982,18273,19043,18835,18762,19477,
+19563,19271,20261,21964,22080,22633,23072,23800,
+23717,22371,20917,22050,21157,20679,20601,20276,
+20167,19318,19725,19248,18639,18323,18435,18475,
+18832,18386,19189,19383,17808,18669,18555,19208,
+22440,19532,20388,19563,20118,21894,19826,20028,
+19833,20388,20684,20576,20646,20793,21137,22008,
+22881,28776,32954,32821,33003,33271,34439,35180,
+34650,34524,34812,34692,34830,34827,34832,34234,
+33846,33954,33923,33925,33978,34093,34192,34189,
+34232,34329,34433,34632,34839,34425,34826,34791,
+34827,34827,34800,34484,34885,35769,35235,35872,
+37212,39716,37882,37646,37911,37653,37498,36429,
+37071,36711,36588,36747,37297,37852,37935,38182,
+36578,37116,36829,36138,35028,34128,33820,33149,
+32976,32444,28389,24868,23675,23015,22461,21972,
+21327,20624,20034,19415,18882,18642,18533,18411,
+18201,18167,17958,17870,18066,17698,17837,17954,
+18636,18418,20168,22441,20318,20679,22086,21628,
+19928,19974,19971,20091,20190,20526,20029,19934,
+19946,19746,19689,19041,19252,20440,20231,19842,
+21690,21384,22926,22444,22503,21888,22999,22036,
+23828,24490,22989,21790,20997,21173,22286,19452,
+20541,22950,23373,23614,19431,18057,18588,18039,
+18221,18031,18149,18214,18270,18288,17987,17976,
+18243,18262,18301,18097,19162,23940,22286,19117,
+18676,18583,18588,18520,18650,18617,18555,18444,
+18301,20145,23901,23308,22958,19368,19014,18691,
+18778,18711,18676,18690,18642,18784,19074,19262,
+18447,18914,18319,20902,19252,16022,21825,27600,
+32915,29839,32430,35559,34302,33389,33099,33114,
+33050,33011,33004,33002,33116,32987,32880,33106,
+32996,32986,32906,32904,32907,33171,33342,33034,
+33242,33128,33051,33153,33057,33003,33187,34572,
+33003,32926,32854,32988,31471,30153,36306,39070,
+33097,32988,35289,34956,31458,24267,19631,19564,
+18561,18495,20470,18462,20817,23841,27421,21594,
+29084,31640,32062,31285,30945,28267,29522,32533,
+35418,32800,33019,33183,33893,32160,32986,32273,
+33271,34667,35544,34432,33354,34463,34308,33722,
+34602,33260,34570,30843,25851,25435,26942,26601,
+26256,28308,27525,27844,30923,30120,30014,27093,
+26198,25939,26232,27719,28473,32870,31384,28058,
+26927,28984,23519,19458,24840,25548,25869,27554,
+27760,27868,27903,27730,27583,26973,26301,27058,
+25364,25017,25144,24638,22940,21751,20376,22092,
+20410,19977,19830,19801,22815,20568,21283,21741,
+22165,22689,22439,22272,21667,20687,20705,20812,
+20856,20544,20213,19617,18709,18256,17619,19050,
+17919,21459,17135,16965,16931,16762,17367,16664,
+16757,16332,16290,16245,16084,16278,16397,16029,
+17549,16767,17601,16595,16811,17049,16563,16649,
+17232,16155,16746,18534,18907,15948,16806,16520,
+16742,15900,16691,16171,16544,17724,17028,16831,
+17016,17088,17195,17071,16740,16900,17420,17357,
+17232,17278,17425,17245,17607,17931,17526,18909,
+18795,18333,18751,19044,18248,18538,18452,19195,
+18760,18831,18603,18645,18540,18656,18920,18861,
+19058,18841,19020,18863,19053,19219,19237,19521,
+19088,19374,19350,19894,19770,19666,19641,19878,
+21216,20356,20123,19848,19468,19546,19791,19752,
+19697,19833,19614,19249,19639,19749,19521,19655,
+19511,19663,19340,19197,19045,19460,19774,19305,
+19476,19452,19372,19275,19422,18914,18939,19115,
+19419,19508,19547,19654,19885,19596,19954,20166,
+20024,20199,20219,20185,20100,20149,20424,20553,
+20522,20301,20135,19968,20010,20502,20667,20742,
+20881,20986,21016,21123,21210,21291,21202,21459,
+21603,21489,21612,21969,21729,22253,22383,22125,
+22508,22976,23516,23313,23313,23020,22970,22726,
+22734,22637,22558,22723,22846,22906,22741,22788,
+22811,22726,22791,22437,23137,22891,22717,22745,
+23200,23751,23683,23162,23849,23730,23717,23546,
+23686,23412,23754,23539,23965,24552,25133,24787,
+28192,24602,25071,25562,23869,28347,33212,33478,
+33321,33857,43702,39894,34831,34061,33747,33640,
+33549,33526,33467,33441,33406,33319,33309,33311,
+33297,33286,33279,33300,33286,33245,33290,33285,
+33174,33183,33171,33165,33172,33155,33135,33123,
+33114,33111,33105,33086,33102,33066,33183,33298,
+33281,33263,33110,33257,33300,33299,33067,33075,
+33234,33093,33031,33067,33164,33240,33158,33217,
+33003,33005,33007,33004,33003,33064,33301,33183,
+33129,33237,33152,33198,33162,33142,33000,32974,
+32631,32979,32946,32941,32943,32684,32424,32618,
+32868,26988,24282,31632,23243,23305,22153,20162,
+21473,21142,20932,20386,20310,20009,19883,19657,
+19286,19333,19182,18609,18405,18254,18176,18216,
+17937,18070,19025,18806,18105,18007,18039,19641,
+19908,19581,18453,19168,18516,19579,19305,18720,
+16998,16029,22468,21690,19227,18254,20387,20121,
+21049,21731,21225,22504,21270,22983,22461,22204,
+22960,23220,22005,20694,20921,20433,19872,20383,
+19952,18832,18949,18960,18504,18369,17877,18071,
+17941,17987,18321,18049,19253,17917,19149,19118,
+18881,19606,21841,19235,19522,20422,19838,20764,
+20328,27096,21766,21780,21435,22146,22514,23332,
+25124,30012,32904,33122,33264,33514,34301,34692,
+34723,34869,34826,34576,34824,34718,35016,34624,
+33892,34049,34313,34191,33996,34048,34111,34209,
+34268,34283,34289,34369,34344,34359,34379,34796,
+34480,34833,34465,34437,35565,35217,34962,35973,
+36587,39412,38995,38112,37051,37256,36657,36399,
+36399,36399,36402,36408,36825,37088,38306,36573,
+35628,37490,36499,36281,35294,33965,33642,33378,
+33157,33003,32522,26353,24441,23482,22621,22112,
+21478,20804,20286,19635,18981,18804,18633,18407,
+18346,18176,17917,17886,17798,17918,17762,17786,
+18313,17781,17851,19693,19499,19875,20547,19854,
+19590,19725,19806,19875,19693,19837,19515,19815,
+21031,19123,19301,18954,18993,19203,19508,19782,
+21063,20139,21601,22213,21690,22030,23885,24459,
+22965,21246,22055,20154,21123,21511,22211,19974,
+20947,22416,24699,23945,21725,18552,19186,19195,
+18360,18253,18164,18279,18189,18167,18112,18301,
+18343,18501,18822,18428,18193,18772,18349,18740,
+18804,18726,18734,18699,18784,18816,18819,20345,
+18601,19716,23063,20629,20189,19263,18805,18733,
+18813,18798,18841,18765,18618,21327,18975,20001,
+18644,18770,18232,18024,17168,21565,26855,33009,
+28203,30750,34227,34679,33452,33231,33252,33168,
+33022,33003,32924,32939,32969,32979,32913,32909,
+32913,32919,32913,32883,33104,33372,33836,33282,
+33414,33187,33168,33237,33179,33076,33129,33824,
+33035,32932,32988,32680,26431,27623,33173,38290,
+37652,36308,34442,33090,30023,29014,28104,27714,
+23739,23751,25969,28965,22188,24615,23805,23005,
+21235,27063,31440,30975,32568,32928,32466,32667,
+32890,33009,32992,32997,32957,32373,31296,32286,
+32479,33067,33483,34165,33621,33609,33541,32289,
+30545,25877,23819,21880,24288,26088,24843,27458,
+27794,30096,29712,30361,32423,32970,32410,32933,
+31945,26668,28143,30513,32022,29862,27440,28152,
+26442,24231,20940,23718,23619,25299,26212,27471,
+27921,28029,28129,27768,27276,26959,26215,25599,
+24772,24912,24889,24639,22338,20974,20937,20626,
+21245,19914,21561,19738,20586,21117,21198,21950,
+22256,21858,21424,20857,20597,20283,20730,21247,
+21450,20210,19764,19382,18897,18625,19491,20783,
+21020,20157,18324,20413,17652,16416,16341,16469,
+17079,17461,17267,16467,16806,16013,16202,15965,
+17584,23665,24414,17650,16714,17655,17079,17099,
+17287,16458,17106,16783,15071,18429,17880,17399,
+15854,15937,17077,16590,16717,16450,16431,16928,
+17058,17137,17167,17085,16687,17331,17478,17734,
+17810,17915,17420,17594,17687,17767,17952,19153,
+18428,19878,18439,18794,18687,18429,18495,18911,
+18655,18643,18583,18762,18631,18644,18470,18786,
+19188,19467,19326,19560,19652,20014,19875,19875,
+19500,19953,20165,19788,19870,20141,20165,20083,
+19929,19865,20109,20130,20235,20061,19664,19720,
+19836,19605,19731,19473,19636,19871,19675,19217,
+19890,19471,19529,19050,19089,19624,19715,19813,
+19574,19422,19091,19029,19005,18987,19047,18995,
+19439,19449,19428,19514,19734,19898,20010,20188,
+20366,20353,20414,20073,20070,20091,20210,20565,
+20494,20430,20181,20077,20156,20460,20734,20634,
+20593,20829,21048,21322,21335,21444,21318,21482,
+21473,21627,21733,21747,21943,22102,22227,22558,
+22644,22958,23314,24027,22832,23082,22664,22867,
+23081,22878,22809,22848,22883,23001,22955,22912,
+23093,23183,23070,22825,23075,22807,22819,23245,
+23402,23049,22767,24465,23815,24486,24549,24394,
+24189,24933,24796,24725,25352,25794,26371,26854,
+26910,27281,26587,27461,26232,27936,33101,33436,
+33089,34357,43136,40509,34631,33936,33777,33639,
+33567,33538,33481,33447,33378,33315,33310,33459,
+33373,33299,33300,33300,33301,33246,33222,33196,
+33183,33228,33204,33174,33166,33153,33129,33117,
+33114,33111,33108,33106,33105,33145,33249,33300,
+33245,33318,33247,33060,33219,33186,33267,33255,
+33229,33559,33340,33558,33186,33023,33007,33026,
+33003,33003,33003,32998,33001,32974,33049,33084,
+33084,33140,33107,33073,33049,33002,32997,32964,
+32944,32733,28819,26031,25396,24042,23221,22498,
+22330,22465,23632,22311,23748,22401,20255,21330,
+21690,20808,20454,20270,19836,19522,19077,18991,
+18978,19074,18490,18212,18336,18465,18779,17793,
+17718,17864,17438,17742,17518,18044,19401,19877,
+19709,18887,18673,19203,18978,18323,19543,19263,
+19923,20133,21297,20589,20982,19104,18157,20078,
+19465,21010,21414,21882,23131,25326,23352,23868,
+22386,21285,20397,21436,20627,19485,20192,20165,
+19429,18269,19237,18501,17993,18024,18207,17550,
+17625,17946,18070,17877,18312,18819,19136,19041,
+19023,18808,18996,20211,20100,20849,20959,21736,
+20826,21693,21942,22601,22442,22874,23346,24631,
+26866,31404,32964,33200,33691,33501,34227,35340,
+35258,35010,34193,34234,34886,34602,34832,34195,
+33865,33882,34298,34307,34025,34047,34121,34236,
+34270,34229,34316,34362,34344,34344,34371,34370,
+34593,34537,34424,34427,35055,35782,36089,36838,
+36667,38860,37581,37799,38043,36913,36660,36399,
+36399,36399,36399,36678,37296,37608,38783,39264,
+35025,38232,38300,35880,35064,34126,33631,33298,
+33270,33065,33239,30764,25929,24140,23288,22567,
+21974,20913,20294,19769,19268,18825,18773,18562,
+18420,18270,18051,17886,17790,17740,17711,17705,
+17991,18228,18517,19142,19334,19404,19530,19467,
+19419,19630,19667,19673,19624,19677,20153,20977,
+19693,18906,18870,19137,19329,19157,20461,20606,
+21060,20904,20287,21651,21891,23467,23016,25251,
+25553,23868,22102,21517,20790,20252,20645,22624,
+21234,25194,24475,23985,24118,18260,18466,20004,
+19680,18939,18264,18278,18293,18138,17930,18204,
+18360,18433,18569,18946,18813,18820,19146,18942,
+18897,18872,18870,18940,18930,18916,18765,19440,
+18910,20497,24900,19332,18629,18868,18804,18857,
+18909,19047,18993,18929,18944,19306,19845,21196,
+19836,19853,18242,17739,20124,29617,32997,27888,
+29139,32973,37941,35110,33344,33247,33165,33088,
+33014,32955,32937,33009,32986,32916,32904,32885,
+32875,32933,32967,32958,33060,33762,33377,33439,
+33421,33353,33177,33186,33289,33009,33414,34047,
+32997,32988,32747,27776,26175,27798,32604,37425,
+37409,36157,33779,33123,32307,31886,32991,32920,
+32898,35668,32998,32953,32118,27965,30831,32586,
+30418,28314,30791,32994,33472,32942,32886,32877,
+33132,33246,33569,33720,32994,32041,29853,32937,
+35409,33032,33006,33010,33045,32960,27580,24413,
+24352,23692,22008,23906,23971,26966,25392,28084,
+30561,29822,29175,27297,28552,30025,29022,29277,
+29316,28425,28693,29538,29964,29812,26475,24135,
+18564,17453,32988,26694,22866,25671,26465,27418,
+27920,28059,28074,27555,27136,26784,26574,25450,
+24135,22302,24065,23949,22362,20881,20620,20422,
+19779,19614,19148,19660,19833,20607,20917,21182,
+21704,21408,20779,20513,20446,20267,20802,21595,
+21078,19816,19474,18899,19299,20112,20430,21805,
+17799,18374,18176,18170,16454,16636,16864,16506,
+17222,19079,17205,17092,17797,16840,16747,17634,
+16166,17160,17583,17100,16885,17073,17006,16444,
+16017,16490,17016,17049,16895,16659,14355,12848,
+16793,17661,17380,16923,16465,16527,16683,16500,
+17072,17008,16952,17016,17117,17355,17331,17154,
+17636,17478,17377,18695,17729,18793,18352,19745,
+24021,18806,18280,18355,18930,18987,18352,18584,
+18465,18281,18571,18867,18934,18989,18358,18952,
+19318,19956,20145,20594,20175,20560,20139,19919,
+19677,19680,19742,19554,19701,19462,19101,20062,
+20005,20142,20065,20520,20277,20352,19962,20136,
+19728,20202,19379,19856,20747,19881,19762,19707,
+19153,19863,19770,19463,19367,19449,19563,19787,
+19345,19287,19152,19061,19171,19188,19072,19113,
+19234,19352,19465,19593,19794,19955,20028,20185,
+20354,20601,20440,20358,20304,20303,20385,20531,
+20541,20415,20255,20118,20049,20494,20631,20702,
+20835,20889,21185,21309,21246,21245,21291,21658,
+21603,21735,21855,21600,21685,21921,22120,22242,
+22668,22963,22793,23071,23136,23016,22913,23055,
+23080,22962,22927,22986,23070,23054,23093,23063,
+23055,23168,22992,22918,22993,22682,23297,23388,
+22574,22277,28768,32148,31122,30772,30686,30032,
+28322,26892,27309,26324,25847,25930,27103,27734,
+28161,28309,29175,28367,27750,26355,33186,33591,
+33241,35515,42499,41613,34477,33936,33817,33628,
+33591,33553,33503,33453,33398,33342,33339,33329,
+33298,33300,33270,33258,33243,33300,33297,33301,
+33400,33299,33348,33216,33140,33117,33129,33115,
+33114,33113,33111,33114,33114,33246,33300,33270,
+33300,33300,33297,33294,33240,33087,33192,33267,
+33595,33421,33812,33906,33940,33536,33594,33090,
+33009,33003,33006,33018,33015,33008,32988,33061,
+33054,33051,33014,33003,32998,31894,32880,32935,
+32902,30043,24999,24060,23454,22731,22439,21694,
+21915,21768,23419,24692,23022,19920,19673,20248,
+19617,19686,20174,19785,19484,19860,19746,20224,
+20388,20762,20765,19876,20511,22353,23159,24027,
+22976,21243,21248,21105,18820,18576,20085,20289,
+19357,19276,20595,17683,17067,16956,17753,19545,
+19105,20115,20604,21282,21273,22918,21778,24427,
+24492,21570,17025,19036,23770,23251,25602,22652,
+22616,21456,20661,20835,21059,18454,20472,19963,
+19155,18428,18345,18407,18166,18206,17950,17493,
+17484,17976,17739,18336,17914,18600,18811,18949,
+19038,18816,19033,19043,19263,21171,20520,20694,
+21267,21769,22686,25259,22801,23822,24305,25498,
+28911,32532,33054,33301,33416,33733,34473,35097,
+34674,34374,33884,34311,34568,34839,34218,34159,
+33918,33868,33921,34123,34106,34086,34266,34164,
+34203,34263,34305,34322,34377,34371,34368,34336,
+34374,34347,34407,34384,34679,35027,35096,34866,
+36600,37546,37347,39011,37367,37031,36464,36759,
+36399,36399,36399,36399,37080,37943,38271,38622,
+37239,38337,37581,36630,35075,34192,33797,33359,
+33253,33212,33088,33039,29524,25710,24126,23164,
+22530,21848,20657,20007,19330,19152,18748,18666,
+18475,18417,18457,18333,17838,17808,17670,17703,
+17671,17766,19173,18737,18931,19736,19209,19126,
+19365,19302,19714,19440,19356,19281,19157,19566,
+19261,19352,19165,19035,19209,18993,19360,18989,
+18890,20697,19974,20748,21426,22670,25935,25203,
+24192,23138,22393,21983,21857,21582,20070,20625,
+20427,23768,26098,25121,24105,18137,19084,19980,
+18648,18677,18525,18483,18512,18564,18216,18297,
+19195,18701,18682,18765,18825,19363,19106,18930,
+19119,18972,18999,19089,19056,18937,18934,18926,
+19280,20394,25507,23138,21462,19081,19101,19145,
+18995,19206,19121,19056,19050,18985,19921,19256,
+20259,20053,17464,16314,26418,33441,29508,27813,
+31904,39086,33862,33363,33222,33444,33151,33093,
+33013,32965,32992,32952,32909,32889,32903,32868,
+32900,32973,32994,32937,33400,33222,33882,33507,
+33852,33309,33313,33298,33251,33017,33375,33915,
+33444,32998,32988,31087,26461,26654,31764,37518,
+38279,32927,34217,34445,34059,30714,32996,28702,
+28161,24564,25227,27594,26724,23191,28351,32975,
+29997,30794,30926,32995,31853,32992,33052,33333,
+33909,35672,35658,39093,32993,32182,31641,30148,
+32995,32940,30485,31152,28742,24158,20223,22200,
+23216,22078,22272,23261,21248,21039,25392,29622,
+32952,29656,27239,26100,27194,28302,27005,27929,
+29192,27720,29461,28602,23325,22083,15753,20147,
+15230,21493,19596,21219,21666,25143,26148,26679,
+27126,27378,27853,27357,27031,26780,26482,25410,
+25353,23202,21973,21893,20269,20489,19854,19572,
+19417,19704,21731,19349,19764,20147,21105,21395,
+21006,20595,20062,20259,20025,20044,20148,20443,
+20785,19497,19064,18915,20808,32574,17514,21174,
+24515,18038,16864,17066,16279,16320,16455,17040,
+17137,17615,16675,16657,17443,16350,16486,17905,
+16470,16278,16321,16883,16768,16509,16599,17379,
+16867,17496,17183,16438,16472,15562,18006,17016,
+16739,18300,15569,18174,16496,16325,16770,17974,
+17331,17119,17330,17060,17139,17771,17397,17322,
+17200,18031,18354,18177,18224,18341,21249,18945,
+18195,21384,18291,18969,18632,18711,18258,18642,
+18711,19242,19345,19303,19198,19323,19204,19417,
+20309,20470,20032,21553,20311,20009,20105,20031,
+20420,21152,19598,19356,19620,19587,19459,19864,
+20226,20238,20133,20325,20147,20040,20036,19882,
+19500,19797,19957,19941,19856,20157,19874,19668,
+19933,19879,19719,19465,19509,19272,19223,19360,
+19574,19131,18973,19034,19135,19236,19103,18969,
+19054,19336,19552,19600,19730,19905,20115,20304,
+20451,20649,20626,20359,20492,20486,20346,20499,
+20578,20415,20448,20232,20235,20591,20764,20773,
+20821,21428,21363,21447,21375,21381,21287,21591,
+21760,21671,21779,21853,21879,21879,22229,22522,
+22701,22859,23043,23208,23107,23246,23055,22844,
+23113,23116,23085,23154,23190,23360,23228,23103,
+22920,22910,22732,22844,22887,23093,23310,23451,
+22624,34178,32875,32937,31502,32904,29475,28175,
+27981,27251,26571,26298,25496,25812,26634,26210,
+26831,28468,28771,28869,28572,23356,32631,33201,
+33330,34014,43101,42611,36089,33909,33858,33723,
+33640,33637,33557,33470,33393,33316,33305,33300,
+33254,33299,33339,33261,33293,33416,33290,33300,
+33549,33596,33420,33249,33162,33124,33145,33124,
+33122,33113,33135,33143,33136,33255,33267,33300,
+33282,33301,33300,33300,33280,33559,33862,33343,
+34107,34152,34194,33603,33604,33729,33704,33583,
+33017,33003,32998,33003,33003,33022,33003,32988,
+33007,33003,32954,32964,32955,32901,32988,32988,
+32849,25512,23834,24773,22509,22268,21890,21459,
+21081,21374,19392,20077,19928,19508,19244,19549,
+19654,19825,19692,19615,19588,19266,19086,19707,
+19345,19410,19987,20216,20969,21358,21126,21207,
+21843,22159,22823,22221,22191,24223,25008,22611,
+22407,22599,22322,21739,19413,14658,15957,24613,
+19961,19323,21270,20402,21367,21057,21017,23301,
+23952,22261,22697,21354,22254,20896,21276,21120,
+21933,21045,20638,20796,20665,19017,20088,20577,
+19002,18600,18576,17748,18884,17757,17244,17616,
+17568,17601,17818,18122,18030,18302,18263,18435,
+18841,18580,18832,19095,20355,19873,20611,20678,
+21121,21564,21942,22638,23467,23930,24688,25899,
+28356,32935,33078,33050,33167,33437,34451,34551,
+33936,33711,34095,34174,34632,34596,34270,34262,
+33915,33925,33916,33928,34327,34381,34301,34142,
+34196,34291,34306,34311,34345,34308,34355,34362,
+34353,34360,34368,34575,34828,35742,35706,35576,
+36303,38584,36177,36843,37626,37149,37407,36399,
+36399,36399,36399,36399,37242,38250,38892,40274,
+39252,40146,36441,35706,35183,34432,33884,33490,
+33384,33313,33177,33009,32996,28818,24930,23871,
+22476,22089,21168,20480,19635,19432,19000,18723,
+18568,18504,18280,17808,17830,17765,17774,17781,
+17700,18128,18291,18700,18651,18616,18645,19053,
+18810,19265,19239,19333,19231,18998,19210,19148,
+19453,19226,19166,18677,19431,19969,19929,19705,
+22392,19776,21543,21813,21445,23172,26108,24549,
+25640,23612,22449,22296,21768,21912,20962,20295,
+19809,25166,30341,26948,24672,20049,19662,19384,
+18980,18742,18551,18660,18696,18747,18603,18708,
+18974,19097,18897,18872,18973,19074,19139,19189,
+19559,18940,19079,18963,19085,19222,19140,19146,
+19252,19575,25489,24681,22969,20686,19323,19243,
+19151,19308,19167,19195,19242,18852,19302,19459,
+19275,18423,17484,23036,31156,32932,28928,30855,
+32958,34455,33594,33325,33373,33195,33010,32950,
+32933,32964,32930,32913,32898,32882,32862,32891,
+32904,32894,32994,33036,33311,33351,33898,33846,
+34953,33485,33412,34291,33165,33231,33274,33408,
+33354,33355,33003,32828,26909,25566,27194,33999,
+32988,32481,31827,32988,32939,32992,35455,28192,
+26094,23418,24572,27403,25537,21387,33114,33413,
+32997,30728,29093,32416,32988,32994,31500,33123,
+34843,36381,36362,33045,28096,29213,31781,33079,
+30305,26511,22057,21208,19406,19798,21083,22490,
+22714,23604,23180,22696,22511,22388,20959,20373,
+20472,23298,31364,27549,25373,27026,24606,25890,
+26037,25405,22110,13806,18038,17467,18849,15195,
+21262,20025,20325,20667,23772,24179,26016,27093,
+26961,27096,27276,26868,26678,26478,26368,25128,
+24733,24207,23050,20935,20579,19868,19611,19626,
+19578,19744,19713,19745,20286,20824,20385,20414,
+20297,20271,20382,19942,20118,20094,20348,20016,
+19825,19265,18804,19860,28572,19278,17892,18327,
+18201,17305,17372,16923,16759,16224,16694,16655,
+16442,17025,17027,17331,16659,16197,16272,17099,
+16787,17490,16770,17008,16627,16762,16291,15955,
+16251,16885,16926,17013,16462,16502,17037,16399,
+16793,18712,17013,16988,19365,17478,17221,17271,
+17432,17276,17261,17186,17861,17083,17564,17985,
+20277,17566,18780,18423,19020,21867,19088,20900,
+20956,18493,18930,18545,18590,18669,20529,19377,
+20843,21102,20205,19706,19767,19543,19537,19748,
+20199,19881,20549,20279,20093,19482,19955,19918,
+19776,19884,19688,19745,19809,19708,19672,20023,
+20171,20108,20007,19851,20211,20055,19898,19596,
+19913,20332,20212,19615,19779,19908,19953,20178,
+19890,19968,19866,19654,19638,19418,19107,19121,
+19182,19047,19039,18930,18903,19200,19198,18996,
+19057,19433,19676,19727,20052,20010,20052,20441,
+20600,20825,20682,20580,20688,20607,20701,20703,
+20812,20793,20768,20677,20541,20779,20874,20950,
+21132,21390,21337,21798,21608,21616,21744,21808,
+21750,21661,21711,21862,21783,21843,22175,22478,
+22761,22808,23146,23387,23045,23299,23196,23145,
+23257,23139,23155,23262,23086,23202,23124,23475,
+23157,23041,23029,22950,23044,23455,23853,23643,
+26089,33947,34045,28689,28895,28252,29259,27310,
+25238,25179,24621,24462,24150,24009,25257,23702,
+24066,25533,27312,28162,30665,27021,32640,33356,
+33820,34437,40300,45070,38142,33960,33844,33772,
+33798,33607,33526,33369,33396,33439,33324,33383,
+33545,33434,33273,33276,33579,33284,33298,33300,
+33276,33561,33209,33204,33171,33198,33187,33157,
+33150,33175,33168,33189,33141,33195,33300,33341,
+33610,33454,33462,33795,33607,33670,33604,33896,
+33804,33895,33893,33896,33569,33575,33466,34164,
+33213,33000,32965,33003,33003,33003,33003,32989,
+32952,32907,32972,32948,32930,32980,32933,32748,
+24109,23376,23343,21632,21820,21555,21486,21038,
+20854,21113,19921,20001,19708,19569,19498,19490,
+19462,19539,19472,19648,19691,19770,19665,19815,
+19668,19907,20604,20764,19674,20547,21069,21060,
+22467,21699,22391,21996,22172,23844,22836,24002,
+22647,21438,19981,18557,22562,22317,20286,21825,
+21685,18333,13955,16589,21953,23763,22528,21215,
+23373,23979,21079,21701,21321,20727,20643,19844,
+19942,19949,17882,20760,20574,18244,18251,20773,
+18481,17957,17439,18013,17803,17736,17533,17413,
+17568,17603,17645,17818,17978,18116,18055,18159,
+18716,18330,18588,18992,18768,20484,20206,20697,
+20885,21114,22583,23378,24438,23775,24465,25542,
+27435,31884,32861,33422,33349,33443,34302,33837,
+33579,34050,35070,34464,34724,34539,34211,34037,
+33969,33980,33984,33969,34327,34370,34110,34229,
+34113,34104,34165,34321,34324,34336,34367,34335,
+34324,34371,34365,34389,34551,34719,35738,35713,
+36543,37409,40273,35422,37797,36897,37273,36690,
+36399,36399,36399,36399,36506,36399,38620,40254,
+40542,40104,42721,36214,34889,34174,33736,33715,
+33486,33387,33237,33081,33082,32782,27702,24415,
+23583,22525,21617,20960,20380,19914,19399,18933,
+18707,18630,18585,18120,17785,17767,17702,17863,
+17690,17696,18132,18344,18620,18765,20116,27150,
+18933,18968,18951,19012,19053,19014,18745,18861,
+19525,19059,18773,19811,20036,20520,19479,19311,
+20748,21534,20289,22517,23363,23572,25354,22954,
+21781,22518,21964,21608,21537,21333,21620,20552,
+21295,24519,26976,26688,24424,20892,19875,20016,
+19410,19113,18815,18623,18745,18757,18771,18858,
+18922,18969,19037,19154,19060,20553,19184,19295,
+19229,19175,19334,19424,19392,19223,19285,19333,
+19467,20477,22148,23590,22896,19922,19287,19414,
+19377,19404,19325,19378,19616,19291,19737,19990,
+18822,18088,18057,28859,32087,32884,31899,32653,
+35960,35174,33359,33282,33138,33013,33005,32994,
+32985,32959,32901,32895,32885,32877,32847,32871,
+32885,32877,33024,33017,33576,33238,33413,33127,
+33655,33588,35373,34053,33963,33447,33466,33304,
+33183,33045,33225,32985,26419,25775,28959,32835,
+30940,28365,31169,32986,32997,30450,29650,22248,
+22232,20727,25606,26514,25453,24323,33000,34026,
+32292,28351,29367,29167,32995,32996,33453,25833,
+27915,29254,24397,23952,26067,27434,29961,22143,
+19200,17949,18164,19148,19305,21644,22663,23045,
+23820,23512,22975,23238,24010,23571,24282,22592,
+21725,21095,20976,20826,18918,18368,17958,17212,
+18009,17509,14373,18976,17707,17844,19077,19017,
+19100,19896,20860,21779,24636,25461,26648,27203,
+27134,26896,26668,26404,26382,26449,25968,24807,
+24010,23967,22445,21018,19722,19637,19638,19636,
+19644,19758,19868,19866,19841,19845,20034,20237,
+20326,20358,19752,19458,19377,19171,19902,19721,
+19441,24900,19779,21375,18927,18455,17953,18109,
+18028,17615,17392,16494,16623,16511,16821,16938,
+17229,16888,16842,17233,19388,17070,17421,18883,
+16746,16952,16823,16761,16664,17171,16545,15915,
+16091,15773,16365,16703,17048,16392,17022,16752,
+16752,16650,17340,17317,17251,17574,24001,20026,
+17394,17761,17488,18097,17792,17919,17374,17659,
+18997,17979,18410,19101,20752,19704,20079,21559,
+19827,19194,18726,18634,18386,19060,19465,20636,
+22612,21260,20019,19890,19714,21750,20166,24687,
+19981,20203,20028,20274,19803,19923,20383,19939,
+19664,20007,19614,19659,19773,20027,19991,20137,
+20317,20218,20164,20211,19949,19939,19786,19647,
+20418,19755,20308,20568,20071,20230,19869,19642,
+19658,19930,19801,19878,19563,19722,19688,19426,
+19393,19257,19225,19314,19299,18496,18717,19242,
+19392,19737,19803,19689,20007,20075,20286,20640,
+20568,20931,20800,20750,20514,20703,20817,20831,
+20906,21171,21082,20930,20711,20988,21005,21059,
+21047,21369,21435,21684,21688,21701,21918,21898,
+22022,22014,21863,21928,21864,21889,22425,22607,
+22724,22904,23370,24218,23360,23156,23385,23048,
+23317,23079,23061,23018,23389,23450,23373,23301,
+23232,23016,23085,23281,23770,23691,23959,24311,
+23498,27585,24858,28761,26838,26346,25751,25164,
+25069,24972,24810,24659,23880,24184,23723,23349,
+23435,23787,24524,23901,27648,26811,24709,32849,
+33876,33828,35869,41758,38970,34716,34161,33824,
+33768,33604,33447,33462,33488,33724,34023,33643,
+33497,33424,33624,33635,33295,33300,33275,33273,
+33219,33243,33296,33315,33294,33648,33328,33239,
+33219,33215,33193,33241,33156,33221,33292,33536,
+33600,33921,33406,33366,33599,33600,33619,33556,
+33833,33886,34512,33897,33604,33637,33519,33546,
+33297,33049,32997,32997,33003,32941,32971,32934,
+32916,32871,32892,32833,32916,32602,32823,24336,
+21451,21856,21549,21569,21616,28759,23559,24440,
+20303,19080,18948,19779,19656,19618,19533,19413,
+19290,19572,19483,19379,19455,19857,19847,20007,
+20250,20397,20706,21081,21743,20956,20602,20763,
+21890,23334,22966,23493,22292,23500,25638,22885,
+22140,22035,21771,21191,21494,19788,18435,18000,
+18469,20263,21253,22701,24210,21150,18090,22085,
+21164,21971,20252,20099,20997,20748,19993,19824,
+19139,19089,19592,19658,18807,18030,19432,17775,
+17618,17013,17798,17498,17627,17820,17727,17396,
+17556,17648,17557,17718,17885,17938,17994,18209,
+18338,18513,18984,18899,18962,19815,20002,20393,
+20761,21113,21762,22953,24296,32901,24216,24745,
+26448,30943,32925,33235,33190,33777,33563,33959,
+33897,34161,34300,34596,34612,34391,34125,34016,
+33924,34035,34137,33971,33996,34129,34146,34223,
+34227,34255,34236,34264,34272,34284,34313,34320,
+34336,34353,34362,34557,34368,34803,35426,35331,
+35321,35768,36893,38730,35748,36440,36636,36533,
+36630,36635,36690,36432,36651,37539,39254,38719,
+39841,38454,39026,37314,34731,34315,33903,33500,
+33407,33274,33206,33115,33069,33040,32457,28079,
+26259,23359,22369,21540,21271,20510,19919,19275,
+18915,18754,18491,18130,17782,17739,17714,17684,
+17671,17799,17769,18137,18437,18381,21066,24262,
+19245,18900,19467,18809,18782,18963,18829,19284,
+19626,20227,20052,20875,20716,20432,21279,18907,
+21342,21829,21805,21139,24021,25820,23540,23037,
+22671,22664,22401,20805,20244,20523,20287,20565,
+20786,24597,32995,25852,25421,21979,20396,20146,
+19759,19164,18688,18718,18789,18749,18801,18910,
+19066,19102,19247,19233,19331,19651,19662,19611,
+19326,19350,19465,19440,19434,19355,19411,19548,
+19452,19463,20782,22167,18912,20244,19480,19437,
+19477,19555,19577,19686,19701,19383,19546,20085,
+18986,17493,23399,32047,31102,32988,33010,33332,
+35601,33454,33172,33056,33039,32997,33009,32967,
+32982,32965,32895,32878,32861,32845,32964,32899,
+32904,32941,33135,33123,33137,33291,33034,33263,
+33294,34527,35969,34942,33594,34100,33442,33489,
+33215,33150,33452,32381,26768,25943,26243,31394,
+32994,32193,32346,32176,31488,31572,31409,30952,
+25802,23452,24833,26145,25406,23902,32477,33144,
+32445,32564,29763,30552,32601,29952,27552,23698,
+21232,20704,21262,21708,21169,20568,17874,18012,
+19323,19634,19830,21569,20931,22170,22794,23232,
+23628,23134,22494,23190,23784,23873,23837,22410,
+22092,21587,23339,22134,21552,20278,19466,19585,
+20449,20199,18168,19466,18037,17862,15930,21066,
+19509,19987,20730,21999,24075,24992,25422,26573,
+27004,26754,26705,26301,26271,26178,25812,24880,
+24711,23764,22029,21102,20038,19776,19689,19663,
+19840,19866,19782,19843,19824,19946,20329,20222,
+19815,20494,19650,19727,19897,20094,19448,19474,
+19700,20043,24760,25209,19191,18502,18252,18311,
+17691,17033,17979,16660,16562,16751,17087,17373,
+16563,18029,17325,17270,17366,17220,20345,17049,
+16849,16851,16738,16950,16546,16824,16117,16326,
+16189,16602,16593,16770,16538,16084,17622,16963,
+18354,17601,16964,17332,17705,17112,17295,16965,
+18561,24926,17274,17679,17811,17758,18427,17247,
+17960,18340,19745,19260,19941,20293,23178,19123,
+19221,19260,19392,18726,19462,19687,19770,21403,
+20917,20649,20632,19778,19857,20149,19517,19515,
+19880,20697,20022,20066,19682,19785,19888,19896,
+19938,20115,19970,19951,19766,19795,19852,19965,
+19737,19969,19815,20096,19776,19656,19896,20000,
+19715,19729,19920,20367,20205,19948,20160,20088,
+19907,19647,19757,19650,19669,19786,19817,19631,
+19572,19351,19494,19318,19365,19458,19203,19383,
+19681,20096,19830,19872,19874,20112,20113,20174,
+20807,20966,20704,20822,20930,20952,21095,21078,
+21277,21141,21241,20949,20969,21217,21192,21153,
+21168,21455,21450,21683,21784,21927,22272,22089,
+21954,22002,22085,22005,22035,22075,22333,22623,
+22566,22958,22974,23651,23580,23157,23256,22759,
+22956,22578,22950,22830,22839,22674,23043,22822,
+22971,22502,22840,23850,23318,24444,24249,24936,
+25983,28805,31407,26913,26949,27066,26596,27027,
+26637,26068,25003,24918,25212,24225,24159,22765,
+22919,22591,21774,23150,24211,23800,23997,30653,
+33696,33828,34025,36487,42831,39168,34668,34338,
+33991,33641,33645,33609,33528,34477,34799,33517,
+33802,33622,33852,33595,33499,33295,33294,33289,
+33260,33240,33300,35175,34471,34205,33866,33286,
+33279,33486,33300,33261,33135,33254,33326,33584,
+33579,33599,33527,33612,33600,33594,33753,33715,
+33882,33763,33690,33869,33603,33381,33594,33300,
+33246,33110,33035,32992,32934,32856,32909,32933,
+32863,32904,32890,32973,32232,25485,22331,24296,
+20544,20632,20746,20907,20067,20071,20220,19886,
+24667,19884,19722,19448,19241,19388,19478,19776,
+20340,19670,20229,19857,20455,19786,23768,21230,
+22868,20878,21631,22795,23123,23181,22989,22181,
+21329,22256,25082,19384,19250,23040,21471,20612,
+21636,20373,22078,21836,21848,20458,19836,18130,
+18460,17215,17859,17745,18120,18110,21353,23448,
+24985,25404,20517,18974,20681,20169,21030,20478,
+20802,19888,21177,18401,18245,17543,17638,17682,
+17311,17967,17443,17303,17387,17574,17772,17661,
+17613,17655,17650,17724,17871,17892,17953,18082,
+18392,18420,18697,19463,19865,19675,20174,20623,
+20838,21377,21260,22461,23356,23877,24327,25155,
+25694,28869,32810,33449,34226,34635,34218,34104,
+34353,34322,34327,34470,34605,34344,34377,34059,
+34060,34003,34035,34158,34062,34200,34182,34167,
+34184,34165,34219,34249,34261,34278,34302,34309,
+34287,34348,34306,34326,34933,34832,34854,34890,
+35268,35715,35807,34731,37650,36652,36677,36482,
+36489,36190,36304,36301,37006,37977,39234,37815,
+36806,38225,35975,35952,34711,34044,33693,33683,
+33417,33310,33156,33094,33052,33093,33084,32791,
+27723,25224,23324,22656,22041,21195,20300,19584,
+19081,18799,18648,18084,17712,17727,17698,17681,
+17655,17983,17806,18018,17836,18897,18835,19296,
+23204,19245,18846,18749,18807,19125,19095,18656,
+21145,20540,18464,20353,19314,22481,19951,21484,
+20825,21212,21728,23431,22088,23874,20585,22255,
+22267,22684,22354,21834,21560,20962,20235,20502,
+21537,24597,32905,27321,25685,24075,21854,20457,
+20232,19608,18993,18681,18780,18781,18922,18925,
+19137,19281,19379,19404,19446,20260,20241,19563,
+19497,19503,19491,19580,19569,19427,19512,19649,
+19646,19791,22837,24416,21990,20274,19516,19677,
+19685,19750,19753,19842,19882,19917,19828,19845,
+18354,17731,31094,33297,31872,32869,35008,36366,
+34117,33300,33056,33036,33024,33001,32992,32997,
+33027,32996,32879,32862,32833,32944,32984,32967,
+32900,32997,33441,33285,33360,33294,33200,33243,
+33024,33087,33489,35340,34207,35713,34282,34759,
+33296,33288,33276,32995,32457,32716,25821,24080,
+33012,36702,35579,34279,34589,33312,36934,35409,
+33804,32320,25089,27188,27273,26177,30461,33582,
+32999,30116,32382,27465,27396,27493,30643,22381,
+21783,21052,21849,21459,23887,19440,18675,19231,
+19755,19899,20717,20720,20901,22246,22656,23376,
+22624,23052,23944,23361,24304,24230,23031,21753,
+21150,20723,21409,20427,20199,19470,19215,19470,
+19899,18273,20733,18907,18201,17331,19944,18786,
+19179,20328,21522,22854,23256,23737,24877,25958,
+26916,26595,26562,26166,25885,25506,25242,24621,
+24741,23376,22071,21224,20392,20258,19966,19907,
+19986,19957,19931,19991,20022,20204,20160,20149,
+20481,20463,20007,19682,20138,20891,20738,19572,
+19547,20024,26269,19251,19161,18921,18800,18203,
+17385,17236,16717,16524,16477,16179,16335,16823,
+16705,16635,18971,17085,17397,17212,17257,16558,
+16584,16525,16853,16653,16539,16325,15984,16900,
+16927,16747,16488,16370,16656,16614,16509,17218,
+17033,16785,17087,16952,16866,17292,17684,17917,
+17511,17649,17268,17018,19293,19815,17232,17586,
+19215,19570,20522,20910,20999,23022,21878,20004,
+19272,19182,19374,22383,19792,19468,20264,20132,
+20253,20439,20091,19807,19521,19082,19341,19411,
+19167,19923,19615,19548,19458,19401,19785,19929,
+19917,19964,20086,19975,19938,19923,19807,19905,
+19995,19791,19892,20089,20031,20030,19871,19893,
+19645,19616,19822,19566,19750,19608,20406,19942,
+19995,19987,20010,19470,19274,19623,19370,19579,
+19921,19515,19655,19422,19721,19197,19005,19112,
+19163,19557,19332,19345,19790,19555,19669,19900,
+20229,20214,20646,20945,21091,21210,21219,21502,
+21269,21269,21367,21101,21279,21357,21241,21243,
+21366,21555,21608,21699,21833,22047,22185,22102,
+21997,22002,22053,22196,22447,22366,22257,22729,
+22625,22698,23158,23373,23663,23304,22969,22404,
+22081,22326,22693,23071,23259,23477,23907,23894,
+23973,23567,23286,23433,25114,24954,25365,26099,
+26286,26689,26754,28229,26577,26200,25649,25479,
+25221,24969,25073,24555,24967,25080,23664,22817,
+22671,22624,23326,22395,21849,23752,23646,24432,
+31819,32271,33273,35133,40496,41808,39328,34742,
+34499,34129,33621,33629,33816,33891,33645,34000,
+33675,33681,33554,33501,33399,33291,33283,33261,
+33258,33264,33373,34167,34815,34212,35593,33824,
+33744,33327,33327,33376,33231,33201,33255,33505,
+33738,34173,34525,33915,33861,33596,33897,33881,
+33909,33897,33843,33824,33520,33565,33408,33359,
+33316,33249,33088,33003,32976,32921,32967,32882,
+32855,32818,32918,29277,24554,22428,23086,21022,
+20770,20343,20187,19907,19845,21392,20736,19482,
+19654,23817,19854,21270,20519,20656,20607,21551,
+21522,20777,21417,21392,21739,22254,23235,22796,
+22923,22581,25320,24083,23922,22473,23481,21822,
+22439,21348,21809,21297,21882,22905,21846,21630,
+20707,19946,21003,21135,20975,21291,19869,18687,
+18453,18765,20596,18925,17756,17682,16887,16745,
+16768,18208,18348,19548,19040,19487,17307,17296,
+17437,17353,18829,19086,18460,19146,19851,18524,
+17873,18931,17793,17416,17564,18105,17679,17619,
+17684,17571,17529,17711,17785,17875,17937,18131,
+18419,18591,18914,19170,19821,19784,20122,20727,
+21132,21604,21976,22486,23088,23754,30352,26025,
+25928,27420,32726,33953,34246,34842,34743,34512,
+34469,34605,34098,34454,34470,34230,34249,34066,
+34026,34076,34113,34155,34148,34135,34122,34101,
+34173,34189,34209,34233,34260,34267,34299,34301,
+34329,34350,34369,34351,34824,34581,34831,34841,
+34903,35325,35740,35632,36964,36222,36043,36144,
+36258,36129,36118,36343,36606,38871,40064,35927,
+35595,38484,38337,35066,34258,33829,33657,33699,
+33546,33372,33468,33379,33222,33157,33125,33145,
+32992,29112,25464,23970,22907,21926,20788,19892,
+19340,18917,18806,18540,17800,17695,17652,17552,
+17730,17669,17656,17669,17967,18379,18602,19162,
+19305,22203,19078,19800,19337,19613,19500,19452,
+19117,18202,20318,20163,19913,20987,21513,21279,
+22812,22235,22159,21919,22728,24097,24123,21915,
+21150,21948,21478,20955,21300,20721,20733,20778,
+21747,25584,27657,27078,25548,25850,23115,21948,
+20518,20409,19275,19230,19145,18968,19207,19314,
+19187,19356,19540,19560,19647,19609,19695,19545,
+19603,19636,19596,19741,19572,19615,19740,19830,
+19827,20988,23511,25025,26292,19738,19007,19324,
+19830,19878,19953,19992,19971,19784,19272,18920,
+17352,24017,32987,31964,31965,32773,34962,33424,
+33209,33128,33104,33032,33001,32982,32941,32984,
+32893,32910,32880,32839,32858,32915,32973,32930,
+32877,32914,33695,33297,33409,33120,33290,33400,
+33655,33633,34648,34983,34741,36215,33915,35421,
+35432,33613,34229,33087,33581,32994,25452,24681,
+23825,32707,33134,32088,30866,25960,29152,23392,
+28548,34815,30687,27984,27430,27504,27779,33509,
+34254,32901,26128,24346,24552,25285,27369,20766,
+21031,18992,20931,19599,23339,20087,20139,19675,
+20713,20900,20834,20718,20724,20355,20325,21540,
+21940,22595,23321,23812,24291,23990,22219,21030,
+20424,20090,19646,19789,19683,19323,19474,20319,
+20061,14842,23812,18290,19125,17337,18320,19092,
+19934,21121,21586,22971,24157,25715,25386,25836,
+25931,26168,26018,25809,25546,24986,24871,25092,
+24141,23087,22062,21495,20637,20411,20112,19919,
+20209,20012,20110,20145,20205,20058,20151,20097,
+20403,20495,19768,19397,19735,20382,20116,20220,
+20675,21342,23419,19073,19311,19163,19246,24453,
+18197,19371,17025,16015,15944,16554,17082,17036,
+16563,16467,16855,16995,17276,17241,16675,16794,
+16830,17173,16863,16333,16395,16459,16456,17235,
+17333,16804,16820,16679,16257,17292,16984,18205,
+17134,16494,16691,17157,17105,16926,16968,17041,
+16982,17718,17395,17343,17437,17319,17415,17587,
+19161,19602,19631,21294,25650,32951,23505,19433,
+19811,18636,19893,19232,19115,19108,19508,19956,
+20614,19956,20115,19751,19410,18812,19134,18990,
+19040,19343,19380,19493,19543,19536,19797,19871,
+19922,20085,20155,19976,19868,19631,19530,19750,
+19952,19904,20066,20243,20063,19953,19869,19737,
+19534,19641,19446,19768,19420,19934,20301,20196,
+19936,20494,19759,19644,19641,19759,19279,19512,
+19664,19886,19788,19544,19079,19012,18815,18945,
+19220,19220,19247,19278,19245,20156,19596,19476,
+20025,19909,20185,20626,20773,20889,20880,21257,
+21502,21501,21450,21375,21564,21515,21446,21408,
+21469,21602,21609,21678,21748,21845,22011,22257,
+21899,22045,22093,22141,22386,22337,22320,22623,
+22718,22967,23413,24037,23271,23583,23073,23633,
+23778,23049,23480,23252,24551,24423,23798,24097,
+23772,24104,24696,24751,25147,25104,25291,25952,
+26007,27063,26997,27018,27387,25926,25427,24958,
+25090,25040,24976,24786,23856,25224,23622,23994,
+23517,22856,23322,22806,23540,23911,23178,24935,
+27552,30315,33018,33180,35949,36145,42165,39228,
+36405,34539,34091,33834,33780,33730,34533,33977,
+33971,33614,33559,33536,33488,33295,33657,33498,
+33540,33293,33108,33252,33414,33429,34080,34344,
+33565,33637,34778,33399,35535,33209,33489,33894,
+34021,34156,34346,34200,33912,33603,33768,33904,
+33903,33918,33899,33671,33600,34452,34215,33585,
+33324,33499,33045,33003,32911,32917,32963,32852,
+32871,32867,28470,25752,23425,24354,22896,20691,
+20478,20186,19900,19937,19890,19864,19775,19654,
+19695,20204,20055,20471,21165,19543,20615,20937,
+19874,20779,21667,21993,22048,22146,22950,23051,
+24854,23910,26373,25095,24058,22610,22806,23520,
+21735,22218,21516,20757,21252,21342,22272,24591,
+22080,21461,20608,20772,19839,19509,18426,17532,
+17950,17577,18030,19557,17262,17394,17640,17169,
+16801,18077,18445,19372,19462,18231,18371,19638,
+20045,19878,18526,18808,19620,17597,17227,19054,
+18606,18935,18273,17475,17535,17811,17815,17907,
+17853,17673,17560,17608,17688,17745,17877,18315,
+18469,18672,18995,19211,19535,20039,20373,20611,
+21115,21624,22145,22630,23232,24012,28476,27263,
+25799,26658,29232,34348,34449,34392,34520,34639,
+34818,34773,34628,34527,34445,34313,34143,34052,
+34063,34169,34225,34199,34102,34155,34085,34184,
+34229,34252,34242,34236,34274,34289,34292,34308,
+34371,34369,34318,34334,34614,34331,34758,34862,
+35469,35542,35685,35850,37322,34854,34854,36393,
+36321,36104,36138,36150,36233,37630,37148,35745,
+35124,36852,37685,34592,34101,33903,33858,33792,
+33744,33604,33540,33859,33286,33428,33356,33216,
+33190,33189,30815,26759,24329,22593,21600,19886,
+19712,19301,18951,18783,18208,17672,17520,17686,
+17631,17529,17642,17507,17701,17904,18156,18453,
+18670,19025,19092,19248,19730,19469,18776,18436,
+19836,19833,18681,20015,20457,20841,20139,21354,
+21546,22496,21833,23601,24192,23668,25005,23602,
+22361,21726,22064,20198,21261,20679,21059,20594,
+22434,25224,31085,26569,25908,25737,23442,22631,
+21139,21170,20364,19274,19659,20333,19864,19601,
+19368,19441,19519,19737,19704,19812,19782,19778,
+19760,19779,19823,19976,19839,19837,19907,20072,
+20274,21362,23478,24781,26085,21659,19830,19944,
+20196,19981,20223,19885,19734,19326,18901,18330,
+24049,27526,31407,31016,32827,32966,35312,33435,
+33219,33054,33032,32993,32894,32883,33027,33070,
+32976,32889,32823,32836,32817,32784,32823,32829,
+32845,32913,32990,33305,32979,32943,33091,33606,
+34549,33636,33503,33460,34536,35535,34582,34504,
+34703,34409,33928,33280,32880,32988,19757,21498,
+22878,22769,25526,23920,23548,21228,19428,17820,
+18057,32695,30803,26518,28496,24881,25436,33738,
+32673,29815,20157,20780,20153,21210,23158,21878,
+20480,19407,21702,20537,23047,20013,20732,20555,
+20669,20647,19884,20291,19799,19899,20106,20310,
+21324,22118,23715,24781,24556,22434,21053,20262,
+19792,19791,19453,19390,19261,19281,19588,19965,
+19477,13100,22519,18825,15343,18903,17853,18576,
+19774,21967,22662,22353,23423,24448,24860,25473,
+25817,25860,25700,25308,25397,24946,24996,25043,
+23877,22854,22095,21561,20667,20359,20085,19869,
+20208,20108,20327,20346,20552,20379,19983,19944,
+20601,20574,20065,19616,20104,20422,20121,19939,
+20358,22920,21661,19250,19344,19137,17748,17049,
+17721,17022,16704,16554,16512,16553,16590,16044,
+16867,16347,16864,17085,16788,16737,16584,17235,
+17428,17265,17852,16642,16692,16578,17430,17406,
+16729,16917,17127,17016,16725,16976,16887,16783,
+16565,17133,16853,16731,16943,16931,19209,17878,
+17469,17370,17481,17406,17661,17708,18085,17976,
+20712,21500,19605,24492,24232,23662,19776,18999,
+18802,18820,18758,18470,18771,18631,18870,19033,
+19377,19408,19286,19452,19026,18648,18778,18762,
+19038,19386,19368,19146,19219,19524,20007,19702,
+19752,19737,19692,19557,19599,19555,19673,19729,
+19637,20127,19956,20283,19923,20125,20127,19962,
+19800,19827,19746,20406,19595,20094,20010,20092,
+20034,19899,19779,19797,19519,19587,19540,19695,
+19887,19756,19510,19308,19374,19236,18991,19131,
+19279,19128,19205,19370,19498,19866,19818,19988,
+20163,20142,20257,20462,20598,20808,20943,20990,
+20918,21116,21363,21519,21603,21536,21506,21486,
+21599,21722,21762,21629,21675,21667,21753,21865,
+21856,21933,21900,22291,22566,22370,22314,22422,
+22450,22659,22748,23446,23483,20972,23143,22262,
+23709,23662,23214,24420,23721,25585,25341,25055,
+24865,24826,25147,24673,25170,25461,26918,26266,
+26100,26214,26219,26465,26753,26199,26037,26026,
+25617,24549,24565,23798,24189,24521,24354,24427,
+22906,22698,22677,24118,26039,23574,24009,24915,
+22848,30539,31974,33063,33435,39178,38715,41330,
+35461,37434,34584,34014,33860,34113,33951,33915,
+33778,33585,33468,33381,33548,33495,33335,33483,
+33595,33546,33139,33387,33344,33794,33607,34104,
+35370,35545,34064,33884,33383,33297,33361,34410,
+33549,34021,33569,33812,33919,33820,33796,34216,
+34195,34201,33911,33696,33600,33584,33480,33994,
+33845,33259,33003,32904,32781,32892,32905,32770,
+32768,29013,24949,23340,22129,21486,21018,20634,
+20027,20058,20114,19896,19929,19818,20636,19620,
+19814,19791,19782,19880,19842,20344,19839,20815,
+20798,20175,21143,20997,22182,22138,23865,22533,
+24053,25233,24869,25658,23595,22686,23584,22470,
+21318,21023,21303,20681,21195,21092,21890,22209,
+20607,19822,20185,18795,19374,18927,18555,19106,
+18217,17697,17988,18611,17500,17797,17670,17223,
+17664,18052,18137,20017,17340,17871,18674,19760,
+18618,18971,19167,19329,18844,19044,18090,17892,
+17847,18105,18497,18286,18101,18429,18429,18343,
+18290,17962,17744,17802,17720,17651,17729,18224,
+18614,18894,19230,19389,19740,19816,20314,20742,
+21178,21832,22437,22974,23507,23939,24881,25200,
+26132,26924,27775,32606,33480,33720,34062,34186,
+34741,34778,34599,34759,34757,34370,34344,34828,
+34037,34357,34295,34248,33945,33929,33963,33991,
+34249,34224,34244,34235,34254,34283,34279,34303,
+34369,34370,34369,34421,34621,34831,34806,35034,
+35578,35742,35742,35752,37349,38461,35338,35344,
+36144,36201,36249,36298,36530,37104,35373,35106,
+35205,37509,34745,35475,34392,34095,34092,34036,
+34440,33907,33785,33728,33327,33865,33650,33470,
+33272,33241,33277,32943,27978,24170,22912,21384,
+20580,20123,19515,18884,19514,17769,17465,17634,
+17685,17604,17724,17782,17744,17889,17829,18045,
+18535,19931,18879,20040,18862,19360,19004,19550,
+20392,19359,20025,20208,21323,21583,23280,20508,
+22231,21664,23388,24539,24921,23988,23928,20930,
+21604,21725,21148,21282,20286,20667,20656,21615,
+21858,26578,32476,27549,26271,25926,24020,22702,
+21437,20597,20208,20101,21479,21841,19733,19921,
+19929,19581,19544,19859,19888,19927,19964,19857,
+19914,19977,20168,20029,21514,19929,20087,20209,
+20883,22890,24786,25210,24735,23813,21173,20271,
+20161,20186,20302,19535,18731,18595,20118,27521,
+31290,32583,33009,32964,34245,37374,36655,33190,
+33014,32988,32959,32937,33045,33037,33222,33138,
+32937,32839,32868,32891,32826,32817,32742,32825,
+32827,32947,32967,32904,32826,32823,32998,33003,
+33305,34531,33306,35064,33557,36801,37206,34133,
+35864,33318,33286,33026,32871,30366,19218,17179,
+17345,17534,17737,16875,16551,16681,16761,17559,
+18619,21963,28263,26810,28631,26096,26272,31905,
+33114,30806,23428,20961,21272,20099,22044,19923,
+20744,20649,19461,22429,21636,20236,19933,19900,
+21004,20370,19608,19641,19727,20043,20159,20355,
+21069,21939,23319,25005,24842,22492,20777,19915,
+19560,19716,19494,19197,19444,19394,19757,19392,
+19789,13607,20390,20640,17981,18202,18158,19046,
+19541,21419,21594,22042,24121,24538,25004,25059,
+25650,25518,24940,24501,24723,24819,24756,24162,
+23468,22463,22049,21498,20919,20316,20091,19780,
+20162,20473,20613,20445,20539,20390,19962,19687,
+19906,19329,19710,19842,20448,21351,21270,20599,
+19811,20685,22182,18904,26574,22206,17860,17843,
+20373,16983,16813,17087,16631,16425,16376,16180,
+16526,16558,16708,17268,17490,17046,17190,17204,
+17430,17157,17611,18188,18272,17097,17236,16861,
+16896,16933,16988,16811,16439,16132,17961,17532,
+16714,16605,16648,16458,16704,26984,16955,16953,
+16986,17265,17265,17802,17863,18113,18542,19966,
+20796,23059,23230,25612,20172,20460,20066,19172,
+18783,18631,18632,18523,18597,18698,18339,18019,
+17904,18903,19631,18880,18717,18585,18507,18494,
+18652,19005,19010,19149,19119,19437,19624,19623,
+19533,19530,19457,19570,19290,19659,19888,20046,
+20106,20196,20086,20439,20088,20165,20142,20137,
+20026,19995,20131,20556,20089,19738,19936,20409,
+20220,19830,19617,19704,19353,19563,19839,19726,
+19730,19623,19523,19448,19263,19329,19110,19237,
+19257,19206,19284,19550,19588,19593,19785,19951,
+20463,20320,20313,20357,20392,20819,20889,20748,
+20890,21307,21305,21507,21679,21493,21480,21338,
+21467,21660,21715,21658,21581,21536,21546,21522,
+21666,21819,22102,22217,22407,22248,22379,22355,
+22486,22574,22980,23266,23346,22623,22865,22967,
+22370,22672,23590,23991,24067,24204,23808,24434,
+24307,24790,24845,25313,25200,25038,25144,25365,
+25656,25876,26219,26811,27550,27485,26745,27997,
+26202,23285,24653,24549,23963,23518,24263,23289,
+23607,23700,23297,26508,25045,24231,23616,21147,
+23260,22423,32418,32982,32997,34963,37375,44196,
+39096,36315,36573,34264,33941,33899,33870,33900,
+33924,33799,33604,33604,33421,33330,34105,33635,
+33287,33600,33303,33319,33207,33530,33488,35885,
+35436,34291,33881,33628,33594,33294,33225,33561,
+33601,33927,33598,33381,33597,33671,33858,34364,
+33924,33900,33897,33564,33602,34043,33543,33279,
+33705,33151,32986,32825,32757,32808,32761,32850,
+32229,28465,24988,23126,22085,21377,20994,20457,
+20335,20167,20058,19907,19740,19671,19907,19852,
+19762,19489,19490,20346,19935,20229,20754,20328,
+20097,20960,21986,20802,21708,21549,23061,24469,
+24314,22675,25538,22999,22962,22650,22800,21899,
+21745,21533,21315,21533,20576,21239,20635,20968,
+19560,19513,19271,19545,19306,19182,19170,19305,
+19347,18493,17951,18099,18438,18840,18696,18585,
+18480,18915,18832,18877,19095,19188,19691,18810,
+18546,18496,19326,19227,18891,18976,18473,18447,
+18399,18664,18763,18784,18844,18891,19124,18996,
+18858,18274,17662,17691,17592,17618,18229,18440,
+18687,19500,19543,19688,19865,20218,20628,21268,
+21634,22420,23358,25130,26932,26865,26178,26303,
+27675,26938,28458,32327,33546,35033,34673,34514,
+34851,34934,34811,34792,34801,34772,34358,34409,
+34263,34364,34321,34248,33981,34189,34092,34260,
+34285,34215,34245,34266,34312,34369,34288,34263,
+34278,34349,34362,34558,34844,34968,35004,35266,
+35553,35565,35734,36371,36691,37344,35179,35819,
+36306,36017,36137,36768,36600,36691,34970,34688,
+34244,34428,34285,34262,34661,34542,34371,34667,
+34528,34225,33893,34763,33930,34096,34200,33738,
+33491,33289,33305,33559,33252,29130,24928,23249,
+21346,21576,20625,19468,21405,19146,17673,17986,
+17592,17712,17666,18026,17865,17904,17928,17852,
+17988,18186,22079,19567,19083,20065,20160,21829,
+19167,20168,20840,21066,21626,23484,22077,21984,
+24084,25037,24259,25557,23082,26050,23925,23597,
+22256,21598,20697,20850,20906,20543,20566,21752,
+22127,27064,31832,26247,25491,25658,24243,22793,
+21553,21017,20617,21586,22659,22533,20538,20091,
+19850,19752,19845,19922,20008,20037,20100,20097,
+20129,20111,20504,20260,20152,20422,20213,20315,
+20136,20999,23177,25449,26418,26596,21239,20505,
+20424,20426,19815,18261,19634,27890,29522,33121,
+32438,29705,30804,33225,35824,36126,33754,33055,
+32976,32943,32862,33090,33361,33095,33825,32988,
+32884,32813,32840,32952,32994,32805,32810,32758,
+32766,32988,32956,32878,32839,32886,32973,33003,
+33246,33475,33697,33537,33620,35263,36320,34479,
+35571,33408,33141,33000,28391,22993,20955,19138,
+18290,17297,17584,17113,17151,17297,17684,18322,
+19595,20616,31174,28988,28409,27275,26139,22467,
+24363,27697,19353,24061,22412,19831,22980,29125,
+21618,21198,20791,21784,20487,19860,20355,20499,
+20589,19831,19062,19240,20013,19839,20231,20218,
+20677,21663,23648,25491,25065,21590,20484,20182,
+19675,19424,19600,19335,19404,19699,19797,19588,
+19573,19467,19451,15956,17411,17966,18252,19212,
+20042,20992,20739,22626,23740,24243,24489,24826,
+24751,24504,24031,24297,24763,23851,23649,23887,
+22647,22229,21873,21575,20937,20613,20064,19797,
+20176,20396,20497,20259,20114,20007,19821,19623,
+19777,19883,19976,20193,20510,20378,21022,20946,
+20017,20863,19890,18761,19556,18593,17976,17991,
+21692,17964,16901,16848,16445,16836,17023,15800,
+15979,16602,16923,16997,16926,17151,17708,17867,
+17884,17898,17684,17343,17224,17442,17066,16920,
+17145,16976,16710,16720,16119,16301,17010,17293,
+17298,16645,16665,16232,16856,17231,16883,17090,
+17449,17327,17844,19299,19204,19163,19329,19773,
+20793,24853,26445,21457,20022,19674,19572,19275,
+18902,18797,18684,18528,18468,18510,18978,18452,
+18417,18300,17904,17883,17652,17659,18386,19298,
+18624,18735,19101,19209,18933,19095,19107,19395,
+19536,19702,19588,19320,19354,19799,20126,20000,
+20049,20127,20261,20058,19898,19993,20130,19566,
+20046,20005,20116,20466,19622,19735,20027,20067,
+19778,19710,19573,19743,19474,19536,19566,19598,
+19635,19723,19472,19368,19465,19446,19380,19272,
+19247,19268,19264,19746,20094,20146,20153,20115,
+20176,20434,20427,20451,20548,20618,20699,20850,
+21125,20974,21285,21491,21613,21470,21412,21469,
+21314,21395,21397,21390,21502,21572,21677,21567,
+21642,21597,21774,21880,21996,22128,22316,22376,
+22423,22739,23324,23926,23293,23322,22879,23112,
+22828,21678,23687,23970,23322,23316,23170,22702,
+23236,23090,24208,24342,24637,25105,25119,25083,
+24965,25541,26515,26030,26469,27757,28643,28481,
+28992,26385,25168,24969,24302,23585,25117,20884,
+24312,23294,23766,27696,25084,26253,24040,25786,
+24546,21559,25692,28039,32922,33418,38639,36461,
+40185,34034,39725,34917,33928,33875,33720,33852,
+33663,33602,33602,33413,33426,33364,33351,33280,
+33593,33373,33610,34323,34129,33974,36536,36618,
+34486,34252,33710,33595,33625,33300,33282,33372,
+33933,34179,33285,33302,33612,33621,33661,34386,
+33576,33594,34046,33422,33318,34003,33619,33151,
+33298,33183,32652,32929,32806,32708,32622,32215,
+29967,27840,25089,23256,22075,21432,20876,20644,
+20232,19921,20027,19900,19792,20729,20362,20420,
+19836,19643,19915,19638,19507,20267,20192,21432,
+21279,20571,21522,21745,22199,22019,22245,24810,
+24179,24066,24921,23689,21568,21333,21938,22231,
+22014,21267,21102,21359,19916,20412,18921,20320,
+19706,19416,19422,19558,19806,19162,19837,19790,
+19148,18607,18162,18081,18496,18348,18531,18356,
+18552,18696,18707,18756,18833,19080,18990,19528,
+19504,19338,19128,18702,19047,19599,19926,19467,
+19374,19392,19485,19541,19787,19776,19942,19815,
+19452,18981,18054,17758,17795,17550,18351,18684,
+18839,19186,19564,19717,20256,20484,21067,21373,
+22006,23169,25581,27667,28984,29553,29787,27672,
+28522,32652,29841,32942,33202,34352,34932,34845,
+34878,34904,35008,34870,34807,34629,34710,34827,
+34476,34448,34337,34290,34287,33984,33996,34146,
+34777,34213,34361,34773,34643,34802,34369,34347,
+34353,34741,34834,34800,34886,34914,35034,35187,
+35640,35747,35633,35648,35921,36628,35270,35450,
+35712,35659,36062,36436,37206,35622,34767,34435,
+34065,34564,34068,35352,34877,34767,35767,35206,
+34797,34569,34269,34539,33927,33920,34308,34518,
+34218,33762,33369,33399,33523,33294,29970,24174,
+23142,22124,21144,19871,18411,18894,17572,17734,
+18169,17616,17541,18227,17922,17835,17964,18036,
+18113,18591,19399,19303,17923,19962,21390,19410,
+20895,21394,20684,21755,21685,23238,23631,22037,
+24231,22833,25687,24220,25027,23847,23293,22778,
+22489,22042,20417,21330,20135,20327,20960,21160,
+23732,27761,32682,27760,25517,25428,24544,23535,
+22253,21874,20819,22493,23574,22756,20528,20237,
+19876,19848,19968,20037,20137,20210,20265,20333,
+20214,20247,20134,20466,20406,20369,20474,20308,
+20454,20453,21951,23871,25828,24801,21160,20701,
+20544,19857,18902,20030,28833,28869,30323,30598,
+29716,29832,33621,36445,37183,33817,33155,32991,
+32843,32821,32906,33613,33314,33480,33019,32933,
+32854,32784,32787,32887,32997,32835,32793,32955,
+32726,32760,32794,32796,32811,32854,32868,32922,
+32868,32724,33582,33856,35810,33990,38243,35615,
+36581,33577,33022,32711,30849,25684,22155,20515,
+19485,18519,18199,17985,18007,17885,17996,18427,
+20122,19440,21677,31406,26079,27156,27035,23922,
+22785,19794,17498,21319,19976,20850,21965,24558,
+21951,21029,21141,22219,19069,19099,19869,19620,
+19478,19605,19347,19507,19483,19809,19776,19813,
+20447,22116,25081,26145,24756,22218,21828,20067,
+19151,20115,19470,19530,19125,18951,19570,20563,
+20021,20483,19212,16068,17622,19264,19068,19120,
+19708,20583,20814,22819,22458,24564,24901,24714,
+24187,24798,24132,24693,24639,23817,22526,22320,
+22234,22296,22309,21987,21136,20547,19941,19704,
+19906,20215,20247,20183,19837,19811,19401,19301,
+19683,19796,20268,19876,19949,20265,20430,20253,
+20262,32986,21276,18791,18493,17907,18510,18061,
+17730,17407,15790,16869,16127,16353,16763,16837,
+16442,16831,17280,17044,16764,17357,17669,19866,
+18129,18087,17727,17235,16584,17097,16790,16806,
+16929,16875,16808,16378,16232,16362,16653,16852,
+16786,16437,16323,16628,16600,16991,16873,16960,
+17385,17579,18661,20410,19586,18882,19242,19535,
+20757,26277,23855,20739,19965,19264,19260,19031,
+18798,18657,18662,18810,18639,18270,18578,18393,
+18426,18336,18069,18009,18399,18200,18065,17970,
+17904,17350,18864,19037,19077,19151,19432,19280,
+19552,19772,19887,19798,19713,19989,20156,20028,
+20020,20355,20356,20002,19842,19637,19833,19830,
+19979,20042,20086,19895,19752,20018,20057,19848,
+19500,19551,19599,19718,19478,19590,19583,19691,
+19583,19578,19551,19625,19654,19664,19788,19225,
+19456,19302,19423,19640,20067,20203,20229,20417,
+20403,20459,20376,20426,20640,20656,20583,20628,
+21409,20846,21104,21343,21372,21412,21309,21160,
+21012,21069,21113,21223,21536,21569,21516,21425,
+21543,21618,21518,21763,21886,22070,22110,22313,
+22564,22952,23334,23513,23522,23271,23076,22707,
+23427,22950,22584,22417,22739,22656,23128,22365,
+22686,23945,23283,23141,23745,23398,24806,24508,
+24285,24609,25008,25812,25827,26630,26351,27897,
+27647,28422,28203,25583,24466,23599,23826,23277,
+24955,22479,23472,23760,24683,29047,26361,26028,
+23835,23973,21483,27822,30420,32988,35467,36994,
+40732,34583,37493,42585,34372,33765,33723,33547,
+33518,33672,33596,33492,33343,33264,33242,33237,
+33854,33388,35678,35091,34895,34855,35376,35745,
+34932,34139,35529,33917,34638,33347,33353,33567,
+33300,33312,33223,33282,33444,33638,34620,33928,
+33444,33500,33493,33439,33428,33586,33330,33311,
+33180,33012,32934,32778,32735,32808,32390,30532,
+27921,26451,24326,22728,21739,21393,20958,20823,
+20298,21504,21410,22267,23217,22108,20892,20678,
+19463,19227,19851,20314,20367,20319,20347,21015,
+20856,20144,20593,21502,21826,22664,23615,24477,
+27040,25656,24764,21235,22080,22359,21627,21300,
+21147,20590,19693,19155,19804,19913,19322,19692,
+19525,19025,20823,20847,21869,22259,19772,19655,
+19315,18443,18264,18147,18026,18086,18101,18132,
+18337,18527,18573,18710,18674,19151,19443,19791,
+20001,19953,21183,20237,19554,20192,22054,22330,
+22296,22317,21282,21081,21422,21231,21368,21077,
+21161,22195,26528,22636,18747,18846,18471,19006,
+19260,19640,19933,20299,20544,20985,21630,22268,
+24248,27058,29430,31284,31596,32182,31714,31706,
+30768,33244,32988,33001,33255,33879,35029,34934,
+34619,34978,35259,35346,34851,34807,34827,34339,
+34826,34851,34363,34357,34161,34037,33974,34046,
+34380,34371,34370,34397,34509,34796,34630,34711,
+34787,34827,34817,34810,34765,34823,34912,34964,
+34998,35046,35172,35334,35880,36277,35718,35789,
+35820,36511,35813,36791,37032,34815,34779,34400,
+34077,34846,34512,35559,35307,36677,36323,35661,
+35207,34861,34334,33933,33733,33862,34201,34734,
+34591,33984,33712,33602,33564,33557,33285,29563,
+24462,24189,24288,22611,19817,18232,17838,17703,
+17546,18405,17458,18286,17872,17999,18198,18204,
+18231,18919,18713,19158,18519,20162,19641,19320,
+21204,20949,20490,22475,23136,23811,26622,20328,
+23804,22880,23495,23109,23906,23265,22674,22685,
+21996,21617,21228,21571,20430,20556,20775,20979,
+23090,32944,31572,26218,25482,25281,24956,24023,
+23185,22599,21887,22913,23133,20759,20198,20007,
+20002,19946,20087,20174,20253,20308,20454,20436,
+20426,20417,20556,20553,20760,20520,20604,20697,
+20707,21243,22366,23791,27447,25599,22241,21038,
+20549,19903,19294,28035,28495,30390,28359,30072,
+32415,33008,39408,40131,33152,32997,32990,32825,
+32826,32961,33116,34961,33191,33927,33045,32903,
+32856,32790,32790,32772,32797,32759,32770,32933,
+33015,32721,32733,32754,32737,32776,32774,32836,
+32847,32655,32985,33185,33525,34390,34782,35946,
+35023,33121,33003,33003,32088,25032,23493,21526,
+20028,18997,18588,18360,18141,17767,17607,18296,
+18628,19303,21973,32267,21603,30038,26150,29136,
+30885,16224,18663,19615,19215,19718,20496,20181,
+22769,18786,20750,21189,19071,18277,17788,18125,
+18547,18544,19215,19353,19299,20025,19689,19956,
+20212,21891,25080,26241,24693,23055,21453,20805,
+19938,19970,19944,19312,20097,19091,19650,20113,
+21660,18964,18916,19041,19452,19863,20950,19609,
+19296,19960,20672,21528,22603,24107,24509,23629,
+22778,24724,24444,24480,24546,23382,21690,21893,
+22011,22367,22944,22469,21261,20745,19866,19725,
+19621,19622,19756,19645,19494,19425,19201,18996,
+20022,19685,20131,20086,19515,20255,20511,19782,
+19935,20979,22293,18494,18311,17889,18712,17691,
+17809,16365,15633,15630,16200,16670,16291,16513,
+15909,16328,16544,16536,16530,16912,17206,18474,
+18559,17644,17670,17836,16811,16385,17562,16451,
+16759,16847,16208,16218,15675,15731,16617,16350,
+16883,16431,16594,16234,16622,17061,17118,17478,
+18549,18125,18936,20511,19609,19681,19662,21755,
+24524,23647,21466,20408,19975,19820,19158,18798,
+18984,19263,19254,18728,18634,18312,18231,18479,
+18010,17859,17646,17940,17889,18324,18331,18727,
+17787,18021,17296,18291,17835,18116,18497,19217,
+19566,19504,19539,19304,19275,19622,19858,20461,
+19624,20022,20010,20032,19923,19713,19847,19742,
+19500,19782,19521,19427,19472,19450,20406,20615,
+19798,19717,19341,19536,19714,19640,19618,19594,
+19737,19794,19814,19620,19823,19896,19776,19586,
+20319,20172,19668,19620,19866,20076,20322,20640,
+20545,20412,20093,20236,20389,20457,20402,20394,
+20217,20630,20993,21246,21147,21242,21107,21246,
+21167,21061,21201,21628,21432,21404,21347,21256,
+21418,21607,21313,21783,21937,22022,22062,22353,
+22771,22822,23245,23718,23126,23200,22953,22753,
+22567,22602,23339,24952,22112,22506,22461,22853,
+22868,22102,22108,23083,23419,23617,23424,23202,
+23954,23613,24885,23988,24672,25462,26316,27033,
+27974,28497,28919,28230,25323,24067,23726,23133,
+23742,23018,24272,23439,26952,30029,28475,27286,
+23548,23812,22644,21769,29071,33034,33642,34850,
+39751,36082,33744,43879,38226,33778,33585,33495,
+33477,33456,33492,33442,33386,33402,33276,33250,
+33787,35718,35307,36093,38021,39038,37140,35290,
+35273,37649,36019,35507,35865,34657,34810,34520,
+33367,35382,33855,33216,33381,33584,33516,33807,
+33771,33273,34116,33234,33426,33313,33138,33088,
+33226,32994,32878,32763,32463,30459,29625,27894,
+25899,25395,23922,22443,21742,21130,20859,20696,
+23609,22664,21085,20994,21960,20693,20898,19854,
+19359,19224,19588,19945,20308,20580,20970,21149,
+21775,21696,21321,22474,22230,23663,26269,23550,
+23766,24390,24452,22430,22207,22208,21668,20548,
+21211,20795,20807,20247,20232,19662,19118,20904,
+19917,19727,21276,21966,23334,21870,21090,20604,
+19185,18636,18387,18207,17920,17932,18015,18085,
+18147,18282,18438,18385,18724,19111,19541,19999,
+20419,20887,21723,22887,25946,28584,28284,28322,
+32694,31956,25912,24059,23985,23741,23021,23157,
+23988,25257,27341,29606,32015,28650,20277,19780,
+20253,20784,20872,20750,20970,21429,22131,24361,
+26760,29390,32277,32982,32917,32988,32806,32928,
+32988,32389,36446,33003,33272,33808,34394,34735,
+35212,35094,35076,34840,34823,34728,34821,34779,
+34375,34423,34386,34686,34123,34260,34821,34541,
+34781,34377,34362,34344,34352,34460,34491,34575,
+34747,34827,34903,34890,34880,34919,34998,35034,
+35160,35092,35266,35427,35406,35427,35132,34944,
+37019,37288,35301,36738,35022,34476,34768,35762,
+34233,34970,35319,36549,37825,37113,36640,36139,
+36239,34781,35199,33978,33768,33924,34103,34584,
+34426,34120,33504,34016,33501,33381,33432,33070,
+31851,28396,25429,23036,21969,18148,18063,17683,
+17690,18872,17478,17502,17562,18144,18344,18061,
+19010,19681,18654,19732,19336,19098,19605,21257,
+21368,21305,22496,23369,25111,23620,25558,22689,
+23015,21897,22071,22134,21429,21348,22125,22214,
+22059,20495,22089,20550,21630,20734,20703,20856,
+23489,31437,31782,26926,25348,25278,25421,25014,
+24015,22509,22976,23870,23684,20224,20109,20061,
+20114,20023,20120,20273,20508,20445,20446,20586,
+20528,20709,22910,20940,20757,20612,20704,20788,
+20614,21013,22377,22310,24333,25113,22963,21139,
+20631,19613,21244,28496,28224,26328,28820,32943,
+33192,39424,38177,33888,32830,32847,32828,32798,
+32833,33032,33331,33402,33534,34836,33048,32880,
+32819,32802,32766,32759,32722,32782,32734,32955,
+32997,32796,32696,32694,32685,32718,32765,32787,
+32790,32748,32857,32987,33114,33704,35975,35827,
+34404,33942,33201,33141,32848,32991,27738,22365,
+19914,18820,18603,18654,17950,17999,18133,17967,
+18215,18429,25903,31763,23729,32733,28223,29357,
+20701,15027,17679,18006,18549,22072,18676,22584,
+25590,24519,25096,24469,20010,18142,18497,17994,
+18401,18598,18714,19260,19614,20583,20191,20049,
+20475,21698,23151,25470,24924,23564,22401,21486,
+20426,20524,20583,19781,20382,19031,20802,22211,
+19807,20106,19632,17544,20869,21133,19137,19375,
+18909,19614,20142,21566,22291,22913,23115,22586,
+22279,23106,23598,24565,24789,23316,21611,21485,
+21759,22241,22536,22203,21336,20066,19896,19554,
+19533,19382,19257,19238,19190,19119,19002,19083,
+19588,20764,20652,20225,19649,19693,20017,19788,
+20271,23430,20790,17826,17560,17625,17994,18320,
+17830,15108,15084,15590,15788,16014,16569,19959,
+15687,15748,16929,16875,16555,17838,17621,17766,
+17096,18079,17417,16617,15850,16157,16399,16583,
+16519,16298,15918,15625,15325,15909,16158,15429,
+16787,16248,16534,17123,18102,18021,18045,18414,
+20780,19938,18851,20284,23746,21549,28112,28455,
+25314,27009,20876,20160,19870,19350,18970,19021,
+18741,19687,18903,18710,18571,18151,18142,18320,
+17942,17738,17934,18143,17950,18046,18143,17970,
+18197,18203,17790,17559,17541,18105,18421,18084,
+18605,18753,19065,19945,19761,19533,19557,19599,
+19503,19609,19584,19722,19682,19646,19192,19235,
+19325,19368,19341,19420,19428,19843,20070,20489,
+19902,19918,19758,19935,20125,20027,19554,19676,
+19907,20117,19865,19767,19324,19404,19830,20064,
+20052,20756,20070,19990,20054,20001,19943,20270,
+20196,20531,20644,19642,20094,19953,19975,20621,
+20528,20735,20709,20748,21016,21146,21162,21259,
+20929,21194,21122,21208,21220,21308,21342,21333,
+21401,21506,21673,21723,21832,21909,22248,22854,
+22660,22844,23112,23361,23529,23131,23083,22665,
+22617,22344,22560,22800,22573,22244,22527,22174,
+22592,22697,22632,22588,22599,22482,22432,23050,
+22828,23110,23764,23666,23589,23772,24851,24603,
+24728,25896,29602,28959,27249,24843,26757,22867,
+23237,23472,23188,21990,24503,22547,27615,27063,
+23434,23595,23435,22165,28505,33054,33187,39468,
+37308,42810,35991,39858,42113,34749,33810,33462,
+33445,33435,33448,33407,33387,33309,33286,33255,
+33959,37122,38865,35390,37288,35958,36519,35217,
+36447,34968,35900,34966,35695,36138,35952,34759,
+35971,35222,33094,33225,33228,33384,33782,33195,
+33254,33149,33218,33388,33145,33248,33141,33096,
+32467,32923,32802,32817,26017,25717,26149,25042,
+24329,24219,23197,22001,21477,21133,20802,20383,
+22950,21408,19355,19223,19064,19067,19232,19317,
+19249,19048,19196,19417,20061,19663,19984,21251,
+21471,21694,21463,22017,22205,23752,23014,23254,
+23215,23502,22935,21509,20976,22114,21836,21036,
+20782,21015,20236,21124,20467,19972,20343,20503,
+20046,20240,21399,21981,22629,24256,24908,23238,
+20302,19005,18267,18045,18003,18021,18064,18024,
+18059,18212,18249,18548,18696,19124,19686,20196,
+20878,21539,22310,24375,28362,32686,32808,33303,
+33459,33509,33356,32190,32246,27885,26799,26028,
+27795,29838,32316,32922,32929,32861,32793,21744,
+21996,22491,22231,21785,21663,21792,23401,25495,
+28401,30981,32742,33446,33451,33672,33769,33522,
+33619,33001,34251,33889,33920,34553,34371,34829,
+34737,34861,34868,35239,34991,35100,34966,34830,
+34815,34785,35034,34829,34105,34393,34761,34454,
+34357,34661,34349,34522,34589,34380,34521,34521,
+34823,34827,34812,34831,34890,34974,35046,35205,
+34809,35004,35195,35289,35322,35392,35042,34740,
+35155,36845,35076,34992,34652,34337,36153,34527,
+34556,34690,36321,36498,38145,37269,35796,35226,
+35736,35715,35285,33936,33774,34204,34123,34712,
+34639,34039,33720,34055,33489,33456,33407,33555,
+32640,29311,24543,22630,21238,18666,18387,17694,
+17692,17682,20869,17894,17883,17857,17926,18766,
+19508,19578,20012,19260,19967,20619,21519,20538,
+21685,22325,23036,22963,23079,24786,22491,21903,
+23446,20868,22983,21787,22230,21069,21469,22072,
+22494,21681,20867,21565,21067,20889,20886,21682,
+24306,26275,31495,26349,25371,24971,26350,26020,
+25098,23224,23926,24592,22889,20298,20479,20268,
+20077,20032,20190,20303,20499,20587,20562,20692,
+20694,20733,20814,21240,20852,20760,20931,20976,
+21013,20879,21711,22022,22067,24165,23687,21474,
+20742,19954,27552,29583,28497,25461,31061,33987,
+35280,36452,33553,33107,32883,32795,32799,32825,
+32864,34075,36176,33827,33525,34165,33102,32958,
+32803,32783,32799,32742,32727,32730,32725,32745,
+32888,32712,32622,32658,32715,32678,32712,32731,
+32481,32743,32766,32705,32940,33210,33363,34837,
+35921,35799,34306,35358,32960,32974,32986,30550,
+24987,20901,19560,18447,18153,18204,18425,18334,
+17808,17332,23366,32017,23034,29839,30164,22182,
+9963,17658,17239,17593,18126,25174,18877,19584,
+23898,23364,18753,24294,20998,19153,19981,18204,
+18879,19762,19266,19963,19727,20464,19839,20610,
+20296,21339,22393,24087,26195,24543,23464,22429,
+21379,20911,20170,20125,20182,20564,20345,21593,
+23820,21046,21273,20413,21381,19191,19076,19113,
+18508,19494,20570,21291,22404,22098,22639,22976,
+22264,22263,23136,23896,25101,23433,21556,21175,
+21838,21659,21615,21363,20307,20235,19143,19589,
+19252,18952,18840,19173,19028,18679,18876,19245,
+19215,29024,20075,19986,19919,19598,19038,18949,
+19446,22188,18999,18215,17866,17766,17553,15196,
+18849,14638,14727,15390,15600,15326,15228,16577,
+14600,15613,16146,16629,17130,17153,17197,17103,
+16977,16861,16853,16380,17577,17198,15803,16844,
+16153,15680,15844,16164,15966,15069,15589,20359,
+17297,17067,17265,17495,18540,18915,18856,19119,
+20532,20502,19407,23130,22151,23976,27174,22520,
+21312,20799,20346,20010,21830,20511,19034,22464,
+18921,18714,19172,18804,18609,18504,18267,18150,
+18061,17875,17863,17961,18043,18170,18581,18288,
+17979,17949,17712,17932,17942,17684,18105,17935,
+18024,18324,18285,18468,19063,18843,18838,19619,
+20057,19821,19323,19231,19512,19360,19107,19188,
+19199,19351,19407,19529,19492,19604,20099,20477,
+19807,20508,20433,20160,20019,20036,19471,20074,
+19983,20225,19984,19835,19534,19662,20012,20099,
+20021,20458,20554,20578,20565,20397,20427,20759,
+20524,20198,20896,20440,20118,20156,20391,20293,
+20292,20666,20883,21096,21072,21033,20885,20913,
+20820,20892,20904,20996,21107,21318,21207,21603,
+21459,21650,21573,21687,21834,21929,22470,22779,
+22965,22993,23420,23186,23643,23085,23064,22930,
+22723,22450,22489,22279,23364,22380,22140,22378,
+22402,22434,22176,22401,22359,22219,22233,22137,
+21970,22296,22158,22997,23636,23988,23841,24493,
+25532,27309,27832,28635,28067,24804,24108,23740,
+23451,24003,23971,24186,21454,21120,28487,22144,
+23349,23628,23847,22638,25758,33522,33386,35760,
+36217,40883,33756,37583,41938,39647,35844,33737,
+33486,33402,33337,33315,33289,33252,33288,33213,
+33473,38343,38081,35889,36033,39040,34503,35574,
+35987,35694,36200,36763,36283,36244,38140,36768,
+36381,35188,33381,33219,33133,33051,33126,33094,
+33164,33183,33206,33183,33303,33204,33003,32928,
+32878,32745,32491,25958,23675,23749,23628,23409,
+22947,22641,22590,21868,21258,20909,20656,23206,
+21471,20523,19036,18886,19039,19105,19026,18948,
+18819,18968,19024,19967,18512,20301,20556,20521,
+20901,21557,22024,23203,22374,23588,22487,23103,
+22977,23304,22275,21561,21504,21178,20983,21073,
+20605,20047,20737,19644,19719,19768,20022,19638,
+20070,20016,21402,21540,23058,24554,24617,23787,
+20563,19206,18624,17992,18096,18006,18005,18021,
+18039,18135,18414,18579,18399,19127,19815,20716,
+21588,22506,23679,27144,32709,33340,33668,33603,
+33446,33826,33405,33383,33221,33216,33222,33249,
+33222,33216,33218,33219,33248,33228,32985,32586,
+25370,25467,24648,23303,22743,22689,24480,26920,
+29640,32409,32746,33058,33245,33909,33469,33467,
+33393,33687,37653,36802,37284,35749,35047,34827,
+34828,34833,34917,35366,35497,35680,34920,34731,
+35294,35168,35244,35163,34656,34224,34221,34374,
+34348,34427,34458,34670,34828,34587,34643,34684,
+34822,34794,34792,34803,34842,34900,34960,34876,
+34941,34944,34880,34811,34754,34740,34544,34350,
+34455,34541,34462,34802,34394,35511,35270,34785,
+34605,37384,36033,36453,37912,36741,36659,37719,
+36312,36805,34356,34005,34057,34786,34569,34131,
+33834,33801,33903,33954,33567,33429,33396,33408,
+33637,32005,24772,22824,19406,18490,18004,17672,
+17704,17662,17625,20355,17440,18114,17900,18454,
+18501,18888,19543,20553,20450,19944,21592,22284,
+23217,23883,23529,23020,24196,22225,22095,21482,
+21304,20418,19854,20443,20902,21882,19836,21381,
+20781,21296,20340,21621,20571,20963,21056,21780,
+25983,28026,32371,27996,25345,24946,25508,26548,
+25542,24980,24421,25294,22215,20860,20692,20988,
+20382,20262,20278,20508,20627,20655,20682,20820,
+20891,20829,20947,20964,20995,21004,21075,21144,
+21160,21747,22791,23898,24060,23205,23071,21289,
+20782,19956,28745,28860,28613,27471,32991,33960,
+33105,33036,32865,32847,32729,32756,32783,32799,
+32976,33394,35540,34062,33321,33963,32987,32819,
+32790,32796,32801,32766,32814,32856,32791,32777,
+32779,32680,32657,32616,32515,32513,32753,32534,
+32737,32826,29001,28478,32696,32922,32994,33867,
+34932,34134,34173,33800,33482,33530,33004,31649,
+32998,31506,21069,20160,21101,18078,18561,19032,
+16270,15441,20323,27997,22404,26466,20405,10896,
+14904,17301,17652,18082,16335,16874,17296,17452,
+25384,19314,20345,20372,18899,18828,18593,18542,
+19430,19554,19994,18867,18614,19623,22030,20941,
+20475,20529,21263,22287,25458,25812,24001,23231,
+21214,20504,22315,19029,20458,19906,21835,20390,
+21572,20981,20277,17946,22649,19043,19060,19119,
+19286,20261,22595,30142,22583,21386,22724,22543,
+22206,22269,22575,23490,26700,23484,21383,20765,
+20442,20172,20974,19830,19598,24111,21993,18957,
+18750,18584,18650,18975,18739,18292,18196,23904,
+19773,19136,21115,19779,20336,21857,19074,19422,
+21514,18465,18324,17280,17608,17578,17451,14919,
+19040,14770,15386,15543,16206,15123,16195,15471,
+14850,15679,15505,20079,18615,18442,17631,16929,
+17250,16581,15795,15862,19701,15406,16082,16086,
+16414,15460,15765,15672,16011,16392,16217,17064,
+17457,17157,17639,18789,19741,19736,19705,20568,
+20169,19309,19844,21830,27903,26438,27406,22446,
+23705,21060,20819,20016,22372,19269,18714,19382,
+18539,18333,19662,18579,18705,18474,18195,18153,
+17953,17351,17485,17598,17868,17809,18157,18189,
+18452,18243,17794,17579,17457,17800,17814,17701,
+17927,18310,18208,18385,18576,18756,19067,18600,
+18165,18181,18273,18724,19425,19289,19111,19212,
+19152,19164,19623,19704,19305,20034,19933,22253,
+20421,20654,20776,20273,20670,19823,19884,19764,
+19937,19957,19965,20028,19870,19566,19981,20137,
+20241,20043,20285,20416,20387,20611,21022,21033,
+20859,20610,20518,20596,20369,20270,20421,20418,
+20529,20577,20405,20981,21027,20932,21003,20772,
+20832,20732,20918,20981,21351,21267,21822,21543,
+21474,21489,21597,21667,21562,22021,22128,22606,
+24412,23491,23586,23409,23246,23269,23784,22866,
+22765,22578,22372,22518,22652,22657,22221,22860,
+22214,22761,22345,22225,22413,23018,22032,22000,
+21738,22196,22017,22437,22794,23507,24127,24645,
+25526,25901,27948,27393,28149,27370,24693,24147,
+23352,23487,22982,24316,29718,27156,23783,23513,
+24266,23891,22233,24166,23868,33206,33189,37494,
+38795,40051,33582,36069,40980,40359,43033,35542,
+33556,33413,33343,33286,33324,33248,33249,33195,
+33127,36135,37061,38385,36550,39009,35844,34380,
+36583,35920,37780,35532,39448,35703,35514,35024,
+33897,33837,33602,33237,33058,33006,33009,33021,
+33045,33025,33036,33009,32995,32550,32744,32988,
+32724,32085,25431,23019,22533,22754,22404,22157,
+22060,21689,21798,21483,21125,20913,22061,21231,
+20274,19675,18780,18942,18468,18872,18606,18501,
+19095,19217,18765,19399,19596,20031,20355,20187,
+20982,21470,21832,20856,22619,24601,23709,24143,
+22447,22056,21525,20919,19828,20575,21008,20897,
+20741,19999,21491,20946,20786,20049,20660,20310,
+20011,20091,20856,21333,22154,22908,24034,23620,
+23630,20037,18237,18531,18091,18007,18042,17955,
+17955,18225,18312,18714,19101,19305,20447,21405,
+23025,24435,27940,32778,33414,33504,33447,33987,
+33453,33576,33556,33611,33656,33226,33309,33313,
+33228,33282,33477,33457,33544,33452,33574,33424,
+32956,32997,28711,26186,24807,25273,25383,27930,
+29861,32742,33049,33095,33165,33349,33462,33456,
+33444,33601,34683,36974,36652,36654,35061,35443,
+35741,35410,35343,35338,36196,35792,35069,35555,
+35505,35031,35118,34683,34775,34443,34369,34399,
+34777,34476,34642,34752,34821,34797,34588,34783,
+34663,34770,34829,34829,34877,34854,34842,34836,
+34819,34710,34653,34665,34470,34404,34380,34288,
+34299,34281,34314,34275,34586,36757,37038,34714,
+34727,37915,37155,37843,39165,38180,37885,37580,
+36820,35911,34796,34292,35182,34459,34210,33754,
+34302,33960,34159,33977,33729,33615,33534,33414,
+33456,33423,29706,23798,19773,19644,18125,17731,
+17691,17646,17877,17612,20114,17968,18225,17706,
+18590,21801,19350,20982,20834,21328,22357,22765,
+23722,24552,23391,21907,23019,21105,21373,21240,
+20030,20936,20007,20784,21661,21858,20632,19964,
+17958,19272,20360,20538,20646,21039,21087,22701,
+26152,31557,32954,28047,25044,24758,25062,26528,
+26003,25765,25545,25485,22533,22594,23292,21812,
+26553,26117,28809,20877,20708,20868,20782,20887,
+21021,21030,21117,21177,21146,21082,21210,21186,
+21332,21342,22046,24231,24300,24083,21676,21293,
+20502,20365,28525,28776,25215,28930,31837,30421,
+29313,29401,30279,32697,32751,32708,32817,32888,
+32972,33810,35149,33585,33389,32883,32850,32846,
+32800,32805,32817,32812,32796,32821,32821,32791,
+32741,32696,32567,32561,32310,30868,29500,29452,
+31428,28408,25829,26065,29060,32283,32732,32972,
+36645,35441,36534,33348,33302,32908,32679,32464,
+32972,32988,28008,24945,18078,19035,19016,18089,
+20799,23118,33065,24285,27418,21399,16219,11750,
+17651,17460,16833,16794,16431,16292,16588,17140,
+18876,23048,20746,23565,19137,17544,17866,18693,
+19235,19087,19710,19914,19335,19745,19544,19812,
+24063,22521,22244,22002,25162,26082,22979,21917,
+20195,20370,27397,20389,21044,20408,20850,20632,
+21417,21956,23433,24420,20444,18234,19357,19148,
+21613,20817,26611,26920,22059,20835,20874,21796,
+21768,22173,30823,22705,21896,22341,20601,20323,
+19720,20655,19833,18998,19091,19333,18874,18606,
+18463,18101,18102,18246,18020,18018,18086,19731,
+22132,18637,24930,21962,19898,19740,18991,19254,
+28424,21703,18832,17865,17397,17462,17532,15199,
+16617,14256,15803,16420,16479,16170,15899,15144,
+15256,15615,16297,17433,19689,21645,18293,17461,
+16866,16034,15351,15330,15887,15847,15568,15934,
+15276,15751,16112,14650,15669,16364,17223,16748,
+17115,17973,17820,19524,19581,18679,18804,19517,
+19632,19148,32614,31098,24472,26790,25656,21045,
+20940,20721,20543,20630,23460,21121,18973,18388,
+18107,18344,18626,18825,18591,18474,17961,18322,
+17802,17163,17559,17612,17781,18873,18282,19973,
+18236,18036,17529,17695,17904,17736,17452,17568,
+17666,17936,18031,18297,18398,18428,18213,17928,
+18033,18503,18304,18496,18780,18633,18298,18954,
+19293,19395,19536,19795,19833,19609,19784,20427,
+20478,20290,20178,19866,20383,20153,20219,19548,
+19467,19587,19756,19683,19944,20188,20818,19829,
+20100,20073,20325,20226,20354,20418,20551,20700,
+21201,21054,21284,20820,20748,20417,20459,20489,
+20502,20540,20727,20959,20981,20880,20852,20844,
+20613,20789,21328,23572,22162,22001,20974,21638,
+21633,21350,21426,21657,21822,22101,21969,22921,
+23118,23336,23665,23773,23210,23055,23016,22996,
+22749,22605,22428,22304,22407,22318,21942,21892,
+21900,22234,22417,22192,22326,22077,22300,22013,
+21890,21843,22125,21981,22238,22016,22483,23515,
+24149,24627,25871,27856,27212,27455,27919,27646,
+25283,24161,22792,25218,29559,26820,24763,23908,
+23346,23448,23725,21870,22415,34257,33056,41482,
+38931,38940,33932,33520,36410,38436,43218,40378,
+33779,33427,33360,33288,33257,33242,33245,33165,
+33093,33952,36302,37098,36319,38962,34308,34588,
+34389,34878,34666,35163,34538,35060,34443,33426,
+33346,33609,33042,33103,33033,32993,32790,32847,
+32790,32837,32982,32803,32695,32478,32966,32757,
+25620,24459,23134,22033,21731,21765,21429,21510,
+21333,21117,21186,21030,20724,21504,20861,19882,
+19299,19057,19023,18609,18782,18731,18840,19232,
+20087,19113,18987,18739,20036,19963,19494,20004,
+20790,21265,21025,23358,20590,23644,23620,21555,
+21642,21875,21113,19464,20479,20587,20646,20166,
+20013,20016,20018,19682,20456,20340,25707,20006,
+20377,20706,22152,22050,22253,21960,22011,22460,
+23511,23223,19040,18423,18323,18203,18198,18161,
+18133,18420,18516,18896,19509,20250,21319,22164,
+24624,29154,32876,33564,33455,33920,33447,33737,
+33894,33648,33582,33685,33687,33541,33263,33227,
+33341,33473,33792,33560,33532,33425,33457,34125,
+33251,33195,33207,32994,32359,32988,32838,32976,
+32733,33015,33098,33115,33507,33177,33429,33346,
+33318,33574,33664,35478,36802,39222,35198,35551,
+35743,35303,35607,35743,35790,36285,35895,35743,
+35174,35152,34728,34675,34482,34809,34470,34820,
+34540,34580,34673,34827,34829,34850,34792,34830,
+34792,34827,34809,34826,34863,35090,34823,34737,
+34819,34487,34422,34359,34431,34272,34263,34286,
+34290,34259,34253,34257,35064,35542,37509,36502,
+37498,39946,37528,36672,39444,40263,38792,36507,
+35652,35840,35469,35813,34701,34023,33966,34248,
+34452,34326,34383,34221,33971,33935,33867,33460,
+33465,33414,32459,26796,23100,20461,17883,17701,
+17760,17709,17640,17745,19605,17736,18048,17796,
+19266,19516,21320,20443,20775,23440,21522,22668,
+24426,21951,25287,22701,21997,20366,20314,20079,
+21176,20159,21056,20342,19562,18981,21281,18281,
+20800,20714,17985,18462,21273,20910,21148,22714,
+27304,30687,32995,28381,25494,24744,25172,26778,
+26928,26213,26020,26122,24300,24638,24519,28188,
+33533,33424,33019,32400,20913,20976,21045,21006,
+21105,21230,21274,21291,21571,21445,21353,21357,
+21359,21477,21945,24061,25866,24642,24513,21505,
+20442,21844,28907,28413,27179,27789,27884,29444,
+29310,29028,29526,32130,32688,32724,32820,32995,
+32974,33282,33331,33272,32971,32906,32833,32845,
+32823,32841,32837,32885,32891,32832,32841,32813,
+32731,32663,32560,31712,29793,28991,28902,27502,
+29155,29004,28682,25209,26094,28066,32553,32832,
+33136,34481,33547,32753,32913,32610,29838,26727,
+26796,32973,32988,32923,23196,20208,20211,19740,
+33955,34669,33342,30966,31371,22504,10006,15858,
+17343,18009,16590,16694,16335,16167,16288,17659,
+18707,21729,22431,20106,18605,17145,18897,19262,
+19561,19520,19776,20247,20568,21141,20100,21033,
+20655,21177,22621,22676,26293,25998,23923,24645,
+26121,26816,23242,20058,19653,20942,21716,22268,
+21707,23406,22410,26118,24579,19244,19080,19307,
+19794,20374,21540,20816,23123,19319,19752,20479,
+20400,20981,25213,21845,20994,21048,20160,19670,
+19256,32121,18699,18922,18679,18664,18367,18340,
+18060,17975,17799,17854,17943,18091,18195,18393,
+18396,17889,22103,24932,19400,19454,20433,32140,
+20412,18675,19089,18109,17610,17102,15412,20646,
+14502,14994,16961,16260,16440,16230,15771,16943,
+15771,15576,16143,16830,21029,22687,21743,19359,
+17394,15669,15243,16338,15840,15604,15633,15623,
+16089,16324,16280,15138,15627,15997,16406,17321,
+18114,18802,18417,18363,18006,18315,18455,18679,
+18175,19223,20196,22738,26928,26793,21798,20331,
+19923,19950,21431,20946,22116,19056,18556,18549,
+18227,17634,18483,18815,18195,18589,17650,17364,
+17074,17118,17337,17157,18113,18564,18932,18617,
+18484,18196,18042,17757,17517,17789,17664,17839,
+17784,18354,17690,17877,17539,18042,17729,18057,
+18474,18174,18274,18346,18525,18631,18858,18346,
+18947,19140,19386,19757,19452,19256,19643,20343,
+20036,19738,19716,19840,19884,20070,19452,19256,
+19546,19528,19941,19786,19715,20565,20064,19855,
+19452,19728,20460,20506,20205,20571,20562,20860,
+20719,21153,20524,20864,20962,20732,20474,20746,
+20785,20640,20732,20993,20622,20491,21755,20988,
+20803,21015,19729,21415,22568,21894,21667,21523,
+21541,21533,21453,21700,21675,21706,22237,22839,
+22989,23736,23640,23763,23507,23151,23001,23088,
+23117,22485,22539,22504,22456,22665,22042,22020,
+21986,21810,22538,22221,22073,22378,22285,22129,
+22170,21921,21857,22179,22445,22272,22608,23324,
+23408,23703,24219,24813,25280,27175,28094,28786,
+27873,26339,23534,24618,29407,26132,22962,23030,
+22983,23729,22654,22995,29519,33450,33261,38632,
+41229,38289,35619,33161,33406,35350,40920,41167,
+33825,33433,33367,33317,33275,33252,33240,33282,
+33274,33262,35199,37886,34443,34848,33835,34461,
+34590,34319,34349,34051,33312,33300,33375,33564,
+33102,33122,33042,33006,32989,32919,32503,32669,
+32886,32778,32580,32850,32865,32683,32696,27974,
+22956,21894,21552,20638,21129,20907,20886,20859,
+20659,20661,20650,20535,20385,20090,19653,19282,
+18687,19477,19702,19335,19018,18903,19248,19421,
+19776,18696,19029,19402,19871,19683,19557,20022,
+20286,21181,22109,22930,20943,22575,22886,20850,
+21621,21512,20820,20337,20814,20609,20290,20347,
+19908,19083,20466,19539,19572,20160,20000,20263,
+21273,24207,22817,23511,22951,21756,21576,22043,
+20738,20070,19078,18374,18313,18308,18312,18459,
+18226,18771,19285,19374,20046,21188,22726,25918,
+31445,33403,33449,33430,33906,33774,33911,33828,
+33804,33760,33672,33830,33654,33576,33356,33559,
+33465,33474,33681,33711,33701,33665,33707,33252,
+33437,33393,33236,33206,33228,33111,33158,33156,
+33121,33322,33233,33295,34249,33265,33850,33453,
+33393,33385,33999,33898,35469,34262,37655,36658,
+35742,35931,35736,35742,36083,36666,36657,35796,
+35291,34830,34738,34391,34333,34512,34635,34750,
+34620,34551,34785,34827,34821,34844,35326,34931,
+34817,34827,34808,34822,34930,34798,34641,34617,
+34516,34305,34334,34247,34254,34245,34231,34261,
+34241,34231,34222,34229,34888,34925,36007,38379,
+36288,35430,35939,38321,38305,40654,40971,41724,
+36327,36806,36246,34885,35476,34770,34665,34824,
+34548,34707,34674,34451,34215,34130,33939,33782,
+33622,33455,32991,31080,26521,23031,17994,17813,
+17727,17744,17629,17414,17710,18433,18398,18411,
+19679,20385,20335,20759,21684,22725,23028,23991,
+23274,23354,23162,22195,22237,21156,20956,20250,
+19075,18951,18537,18912,18806,20211,18365,19756,
+19218,19519,20193,19645,20945,20702,20919,21453,
+26442,29693,31925,26157,24708,24836,25194,27139,
+27438,27179,26195,25509,25354,24815,25706,32385,
+33413,35972,33437,33030,20946,21082,20973,21234,
+21243,21357,21431,21477,21466,21514,21447,21532,
+21568,21594,21808,23771,24312,24515,23323,22031,
+20433,22723,28818,32929,27917,22337,27570,30683,
+29809,29487,29756,31684,32610,32779,32985,32978,
+33392,33438,33021,32883,32860,32856,32838,32854,
+32839,32839,32844,32870,32878,32857,32863,32782,
+32697,32610,32181,28929,28318,28140,27723,27273,
+28290,29572,28391,28023,24416,24384,29037,32616,
+32860,33283,32980,32949,32794,29364,23809,21774,
+18972,25523,32833,32973,32851,24966,21143,22321,
+34254,33048,33092,29578,32973,24385,6831,15435,
+16818,17130,16362,16248,16336,16179,16569,18285,
+19726,21495,23041,22612,19869,16551,19691,19893,
+19821,20093,19789,20587,21063,21492,21546,18696,
+20761,21312,19233,19466,22668,25378,24285,21147,
+21854,24644,23133,22260,22682,22646,21202,21975,
+22782,25559,31838,22128,19888,19286,20003,21042,
+21337,30337,25010,19185,19263,19200,19584,19795,
+19482,19788,21785,24216,32526,20738,19242,24731,
+18633,18702,18678,18269,18408,18330,18264,18037,
+17927,17707,17589,17624,17666,17861,18125,18188,
+18404,18544,19532,19351,19121,19783,19545,18955,
+22548,19011,18539,17916,17186,17115,17788,17412,
+14884,15078,16483,16108,16729,16386,16248,15806,
+15348,15823,16002,16462,19046,22719,23430,22257,
+17891,15670,15303,15275,15285,15090,15369,15872,
+16225,16397,16223,15708,16365,16290,17061,17903,
+19290,18227,18046,17704,17789,17796,18188,18439,
+18493,19917,19641,22075,23432,29191,22019,22343,
+20079,19286,19077,19282,20199,18260,17979,17608,
+17718,17700,18075,18484,17994,17700,17263,17023,
+17502,17511,17547,17910,20920,18649,18052,18464,
+18146,17942,17773,17278,17543,17754,17768,17847,
+17518,17826,17565,17512,17733,17863,17671,17792,
+17795,17717,17968,18390,18534,19070,19038,18859,
+19078,19065,18908,19035,19848,19066,19173,19245,
+19181,18704,19083,18835,19275,18881,19298,19116,
+19275,19967,19233,19609,19377,19263,19739,20182,
+19914,19942,20046,20080,20058,20095,20326,21525,
+20635,21180,20946,21158,20381,20763,20628,20502,
+20743,20605,20447,20781,21224,21149,21605,20586,
+20650,21585,21086,21414,21595,21818,21398,21615,
+21345,21576,21474,21733,22009,22306,22228,22782,
+22990,23479,24462,23823,23217,23016,23185,22997,
+22896,22944,22419,22332,22523,22491,22466,22131,
+21727,21726,21997,21925,22215,22146,22341,22375,
+22377,21939,22038,22305,22644,22509,22655,22826,
+23178,23256,23517,23890,26097,26274,27843,29446,
+27935,28102,22724,25761,32946,32034,33599,32711,
+28485,24916,24435,26929,33651,33225,33268,40032,
+37371,35243,34152,35215,33233,35007,42348,38218,
+33651,33441,33376,33329,33280,33234,33201,33166,
+33156,33101,33111,34161,33552,33876,35674,34839,
+33896,34510,34508,34149,33621,33342,33451,33393,
+33561,33604,33108,32984,32988,32623,32892,32742,
+31816,32537,32673,32541,32605,32199,30841,25656,
+21406,20848,20230,20322,20363,20472,20391,20336,
+20356,20346,20161,20061,20005,19756,19209,19236,
+18846,18677,18674,18808,18791,18853,18909,19525,
+19164,19215,20084,21482,22947,21906,21345,21585,
+21822,22026,21984,22906,21462,23028,22294,19629,
+18930,20229,20500,19047,19425,19329,19719,20580,
+20161,20316,18869,19462,19884,19455,18973,19878,
+20958,20449,20265,22694,22684,22869,21225,21855,
+19836,19788,19003,18558,18382,18101,18130,18868,
+18903,18941,20378,21288,27873,30435,32856,32764,
+33173,33309,33445,33935,33919,33976,34507,33891,
+33906,33856,33789,34103,33603,33555,33502,33476,
+33536,33675,33767,33804,33915,33429,33447,33348,
+33306,34428,33447,33374,33210,33225,33218,33382,
+33594,33668,33958,33674,33870,33370,33428,33513,
+33444,33433,33447,33661,33741,34173,34167,36789,
+38031,36230,36291,36528,37278,36006,35772,35745,
+34806,34386,34357,34367,34211,34333,34188,34380,
+34435,34516,34755,34767,34857,34800,35078,35119,
+35061,35160,35206,35084,34839,34745,34642,34494,
+34408,34250,34210,34180,34206,34199,34209,34224,
+34050,33930,33903,34252,34421,34740,36591,37869,
+38328,37019,38719,38980,38700,40362,40635,41731,
+39285,38806,36646,35496,34800,35569,35465,35744,
+35769,35545,34933,34660,34393,34446,34186,34190,
+33894,33618,33350,32352,27651,22005,17884,18115,
+17712,17697,17665,17723,17709,17937,22179,19887,
+18657,20680,20980,20805,21258,21861,24318,22622,
+22314,23614,22821,22417,21830,20662,19914,20871,
+19420,19266,19056,18912,19070,19654,18744,19485,
+19242,19011,19435,19090,20208,20650,20744,21918,
+26388,28578,27444,24799,24723,24716,25629,27561,
+28113,28035,32344,30585,26509,25494,26317,32379,
+33460,34512,33913,33181,21612,21162,21204,21304,
+21435,21449,21493,21620,21650,21673,21696,21843,
+21687,21781,21786,23992,24533,23021,22139,21511,
+20772,25254,27457,32939,27310,25193,26469,30004,
+29775,30058,30801,31758,32596,32794,32967,33183,
+33141,32923,32874,32859,32864,32862,32829,32841,
+32871,32874,32869,32898,32905,32885,32801,32780,
+32752,32673,32065,30170,28000,27519,27573,27096,
+26912,28197,28236,28282,27444,24309,25624,28959,
+32216,32715,33067,32988,32690,25705,25204,21738,
+20330,19764,18443,28240,33036,32347,29885,29869,
+33000,33181,35565,32840,36603,27450,9367,14745,
+17888,17851,17497,16778,16323,15684,16993,20284,
+19545,20936,20958,22295,32789,20479,20114,22776,
+14415,13977,17982,20437,22500,23382,23959,24540,
+24258,23700,24501,24714,20903,21408,23740,26863,
+24906,24214,22017,25381,27035,26410,27045,29895,
+23943,25319,27249,20757,20004,23705,21612,32677,
+26430,22650,20222,19092,19366,19702,24378,22034,
+20560,18240,19063,21859,23825,19611,18844,18562,
+18414,18469,19542,18480,18242,18085,17817,17774,
+17716,17520,17454,17526,17808,18210,18042,18243,
+18690,30674,19242,19788,20912,20753,25333,25726,
+20533,19309,17703,17553,16992,16996,18603,15742,
+17946,15375,16245,16401,16358,16746,16029,16050,
+14701,15391,15465,15999,16643,20491,21658,21958,
+20878,15342,15127,15067,15004,15342,15224,16296,
+16986,16782,17689,16468,16822,16526,17766,17904,
+17601,17463,17474,17506,17678,17913,18107,18110,
+18804,21982,19265,19747,20593,19815,18930,18507,
+19841,23275,19289,18756,21504,18605,21910,17186,
+17421,17547,17698,17650,17531,17745,17468,17265,
+17123,17072,17790,18122,17775,17937,18465,18831,
+17694,17583,17738,17375,17536,17932,17554,17766,
+17975,17377,17903,17796,17544,18505,16487,17714,
+17760,17766,17889,18350,18565,18392,18719,19052,
+19018,18983,18764,18640,19461,18562,18369,18696,
+18319,18194,17947,18579,19082,19563,19528,19317,
+19269,19428,19375,18996,19740,19616,19717,19950,
+19587,19991,20134,19773,19792,20191,20587,20727,
+21096,21150,20484,20145,21205,21053,20856,20754,
+20962,20907,20643,20815,20661,22533,21530,20848,
+21246,21226,21852,21462,21135,20918,21479,21927,
+21543,21512,21876,22056,22313,22386,22583,23096,
+23273,24000,24684,23567,23339,23106,22873,23035,
+22614,22677,22266,22196,22348,22356,22106,22913,
+21669,22333,21867,21801,22026,22074,22212,22399,
+22350,22355,22393,22783,23373,23245,22590,22641,
+22827,23115,23414,23503,24930,26082,28054,28272,
+28149,28524,27659,32348,32923,33005,34205,33110,
+32718,32445,32610,34887,35835,33216,33234,33382,
+33833,33344,33184,35642,33123,36864,35520,35738,
+34321,33783,33396,33309,33279,33228,33175,33143,
+33124,33092,33100,33354,33181,33313,33036,33251,
+33838,34402,34128,34374,33954,34115,33662,33288,
+33589,33075,32957,32901,32925,32489,29742,28081,
+28043,27561,30014,31618,30803,30016,29178,24651,
+20811,19916,19872,19947,20133,19569,20024,19825,
+20009,19856,19758,19565,19407,19406,19209,18934,
+19133,19122,19179,18782,19269,18679,19294,18942,
+17700,20731,20248,20582,20950,20852,20281,20859,
+20557,21295,21571,20099,19317,21648,21484,19470,
+18678,18036,19445,19625,19007,19527,19054,20440,
+18622,19420,19630,17895,17468,18372,17982,18236,
+18836,19190,19875,20867,23844,23478,26598,20857,
+19854,20148,19034,18823,18635,18441,18759,19179,
+19558,20315,21774,27753,32815,31806,33003,33126,
+33357,33530,33747,34509,34367,34334,34776,34497,
+34807,34321,33916,33759,33631,33906,33862,33539,
+33471,33743,33819,33585,33951,33456,33471,33251,
+33256,34780,33485,33529,33489,33648,33458,33615,
+33878,34370,34374,34377,33719,33276,33453,33389,
+33349,33360,33794,33455,33504,35141,34345,34134,
+34470,37174,34825,34887,36405,34842,34591,34568,
+34618,34485,34306,34101,34215,34164,34121,34371,
+34376,34572,34866,34832,35068,34997,34981,35373,
+35344,35449,35457,34888,34824,34821,34536,34351,
+34368,34478,34174,34157,34188,34211,34206,34214,
+34074,33879,33876,33908,34324,34710,37959,39476,
+39171,38751,38019,40062,39011,38233,41178,39591,
+37926,36771,36765,35816,35727,35268,36246,35499,
+35823,35564,35113,34847,34892,34771,35136,34704,
+34735,34576,34103,33269,29373,23982,19903,17802,
+17748,17823,17758,17949,17799,17769,17635,20988,
+19326,19377,21264,21839,22618,23513,25979,21831,
+24216,21804,22160,20357,21344,19804,18756,19910,
+20376,19280,19242,19115,19017,19074,19123,18988,
+19215,18977,19116,19678,20784,20649,21026,22674,
+26065,27235,28390,25278,24756,24772,25044,27806,
+28324,31368,32806,32886,29616,27139,28113,32666,
+33273,33623,33344,32994,22985,21434,21567,21495,
+21468,21552,21675,21723,21722,21812,21879,22002,
+21947,22041,22250,23148,24373,23622,22341,21252,
+25081,29232,31544,30014,26909,26609,25716,30384,
+30978,30426,31381,31802,32798,32976,33107,33897,
+33106,32790,32841,32802,32771,32811,32819,32884,
+32884,32887,32890,32902,32902,32883,32820,32801,
+32667,32622,31797,30443,29991,28875,27167,32990,
+27660,27524,29460,31026,31283,27350,25154,24461,
+28524,32402,32861,32653,32599,28646,22156,21400,
+20887,20529,19626,20418,34232,32778,33946,32962,
+35316,34632,36006,33301,34150,28173,8934,15160,
+19345,17507,16680,16335,16316,16213,18040,20040,
+19413,19252,20410,19932,21144,27612,18531,19413,
+23661,25757,23559,16616,23637,24274,24491,24526,
+24213,25725,26926,20994,23616,26301,25995,26570,
+24303,25726,27767,26655,25846,25068,31465,32565,
+29721,32892,26628,28427,20343,20247,21412,29063,
+20854,20396,18748,19297,19254,21083,27714,20766,
+18835,19058,18843,18729,18501,18193,18322,18315,
+17871,18324,20853,18358,18865,17332,17784,17644,
+17513,17459,17385,17416,17589,18033,17852,18613,
+30171,21721,20923,20353,20628,21642,20439,20215,
+18609,17856,17736,17561,17136,16977,16538,21576,
+16840,17715,16191,16150,16768,16175,16348,15120,
+15410,15288,15459,15427,16622,16748,17380,19861,
+16104,15106,15190,15013,15096,15315,14841,15902,
+15907,16644,16995,16572,16335,18228,18684,17973,
+17260,17456,17628,18101,17991,17883,17835,29274,
+18732,19036,26662,18887,19095,19548,21279,23475,
+20798,19203,18776,18696,19731,18063,17972,16970,
+17664,17250,17373,17823,17727,17436,17503,17652,
+17705,17730,18062,18380,18739,18099,18104,17745,
+17274,16857,17066,17472,17462,17640,17685,17910,
+17654,17403,17641,17628,17845,17654,17730,17619,
+17661,17806,18115,18324,18459,18570,18716,18890,
+19003,18857,18931,18570,18587,18205,18224,18575,
+18153,18036,18021,18154,18705,18682,18967,19308,
+19544,19544,19614,19846,19839,19700,19635,19688,
+19878,19683,20349,19984,20139,20265,20502,20829,
+21525,21010,21109,20955,21402,21894,20694,21029,
+20914,23688,21196,20635,20931,20900,21003,21006,
+21555,21582,21401,20196,21649,21117,21655,21387,
+21862,22247,21673,22598,23035,23352,23416,24033,
+23816,24188,24038,23644,23110,23331,23118,23583,
+22356,22458,22233,22385,21760,22169,22032,22050,
+22040,22011,22013,21933,22219,22177,22328,22391,
+22435,22574,22862,22764,22755,22639,22713,22742,
+23083,23301,23039,23865,24229,27115,25541,28065,
+27504,28309,32912,32998,33366,33523,33186,32903,
+32811,32838,32985,33024,33076,35062,32956,33437,
+33427,33146,33084,37117,33130,38046,34591,33510,
+40131,40592,33774,33378,33265,33228,33202,33164,
+33095,33145,33182,33209,33237,33268,33327,33336,
+33230,33249,33060,33382,33185,33007,33134,33127,
+33027,32979,32925,32721,29758,28185,27026,24972,
+25125,24735,28404,29442,29441,29232,25197,22251,
+18927,19391,19469,19564,19638,19516,19370,19593,
+19497,19151,19379,19415,19249,19140,18900,19173,
+18530,18866,18647,19152,18481,17893,18861,19084,
+18801,21480,20067,22113,20040,20927,18682,21444,
+19241,19758,19991,19546,19554,19561,19221,19454,
+19987,18431,19353,19115,18653,18806,18981,17691,
+19206,18393,17845,18032,18034,17777,17921,18120,
+18338,18885,18787,18689,19938,22283,20280,20309,
+20325,19771,19263,18687,18630,19425,19374,19334,
+19740,21162,22853,32370,32988,32726,33056,33210,
+33644,33919,33775,34206,34452,34689,35258,34561,
+34536,34198,33915,33914,33910,33918,33897,33870,
+33910,33933,33932,33454,33387,33378,33271,33261,
+33392,34839,33660,33684,33456,33519,33816,33814,
+33926,34165,34091,33727,34020,33339,33753,33766,
+34454,33786,33623,33347,33706,33555,34126,36327,
+34155,34143,34512,34327,34353,34392,34594,34371,
+34531,34286,34218,34056,34144,34146,34098,34130,
+34201,34778,34986,35082,35475,35574,35436,35628,
+35563,35811,35237,34977,34753,34670,34412,34370,
+34242,34220,34149,34147,34183,34193,34216,34226,
+34053,33906,33858,34140,34605,34976,37729,38459,
+40198,37387,40026,38498,43085,38007,38550,41266,
+36672,36750,37333,36618,36421,35930,36051,36627,
+36186,35812,35455,35409,35034,35022,35268,35427,
+35040,34830,34209,33951,32897,27441,21970,19017,
+17920,17757,19518,17746,17657,21786,18148,20805,
+20346,19518,21851,21570,23982,23273,22342,25313,
+23714,22759,20484,20709,20145,20208,19131,18966,
+19347,19263,19233,20097,19285,19219,19094,19137,
+19150,19071,19077,19131,20294,20797,21325,22295,
+25929,28155,26947,25416,24712,24721,25543,28335,
+29687,32780,33126,33024,32434,28794,30470,32974,
+33281,33456,33033,28465,21894,21262,21821,21921,
+21840,21738,21797,21822,21891,21961,22058,22098,
+22104,22249,22431,23082,23277,22701,21516,21789,
+27669,29412,32997,31264,24362,25721,24983,28414,
+31444,31395,31638,32627,32961,33004,33295,34643,
+33006,32946,32909,32783,32830,32771,32838,32928,
+32925,32949,32931,32928,32928,32934,32894,32859,
+32832,32649,32029,31489,31242,30452,27443,30484,
+27725,28984,31642,27662,31528,32814,30206,24855,
+25384,31545,33029,32574,31666,28801,26495,22187,
+23130,20475,20637,18129,26103,30862,34390,33780,
+32950,35522,34938,33160,33271,27336,11735,16001,
+16096,16832,16148,16064,15883,15996,19077,17889,
+19532,19302,18264,19722,20943,29031,23463,21995,
+22590,27472,24918,14359,23704,26175,25049,27136,
+25329,21414,18906,22871,26921,26331,26617,25374,
+23562,23483,29687,29912,25674,24627,30875,31369,
+29776,32988,22892,23470,23052,19935,21317,23520,
+23746,19842,18025,17503,26523,18411,19673,18400,
+17707,18087,18192,18335,18063,18030,18202,18051,
+17759,24913,18379,24357,18929,18203,17618,17475,
+17078,17442,17325,17298,17954,17948,19399,21675,
+24991,20152,19901,20639,20005,21254,28308,18693,
+18664,18188,17838,17591,17106,16913,16563,17541,
+17813,17497,18837,15237,15936,14923,15530,14686,
+14901,15070,15269,15836,15900,15927,15593,15561,
+15824,15194,15038,14981,13941,15325,15584,15940,
+16403,17602,17445,17055,17414,17229,18018,17445,
+16659,17756,17863,18829,18868,18088,17835,19487,
+19155,19014,19166,25548,18602,18498,18938,18473,
+18094,19771,19925,18580,18529,17198,18272,16760,
+17238,17109,17361,17846,17637,17218,17440,16783,
+17123,17703,18168,18993,20811,17740,17278,17806,
+17285,17306,17412,17984,17397,17052,17728,16965,
+17669,17539,17718,18005,17307,17641,17717,18017,
+18186,17872,18051,18335,18740,18666,18861,18738,
+18834,18760,18627,18687,18522,18368,18425,18188,
+18213,18204,18315,18376,18741,19014,18894,19220,
+19251,19295,19302,19359,19364,19440,19350,19374,
+19578,19455,19837,19774,19465,19942,20277,20127,
+19916,21137,20889,20974,21351,20939,21453,21416,
+21237,21151,21071,20669,20906,21150,21351,21145,
+21390,21658,21670,21412,21302,21607,22608,22437,
+22428,22695,22414,23111,23041,23599,23745,24295,
+23845,23148,22946,23392,22335,22294,23961,22699,
+22035,21801,21337,21001,21361,21498,21769,21765,
+21891,22198,22581,22846,22219,21861,22187,22176,
+22308,21668,22744,22811,22683,22647,23774,23411,
+23013,23496,23242,23457,23913,24442,24274,29309,
+32912,33591,35829,36651,34653,33503,33720,33725,
+32991,32427,32362,33548,33832,32625,32870,33251,
+33248,33137,33060,33058,33172,36489,33287,33146,
+33267,44631,41798,33882,33315,33232,33186,33104,
+33264,33222,33417,33276,33475,33376,33657,33615,
+33452,33225,33118,33005,33003,33003,32997,32983,
+32933,32798,31864,26883,27165,25323,24384,23326,
+23799,23898,24956,28971,28708,21649,19143,19145,
+18852,19042,19044,19317,19270,19200,19190,18872,
+19105,19168,19160,19077,18884,18802,18549,18495,
+19062,19428,18859,20895,21207,22072,22468,22116,
+24436,22366,21007,20632,20059,19390,20088,19877,
+18910,19125,19199,18600,18146,18765,18302,18367,
+18906,18259,17852,18862,19373,18881,18479,17401,
+17085,17327,17334,17403,17805,17968,17820,17934,
+17892,18285,19239,19501,19678,21213,21853,22953,
+20364,19563,19251,19271,19408,19762,23742,21834,
+20784,23319,29091,32988,32988,32991,33169,33177,
+33639,34144,34506,34366,34810,35739,35072,34895,
+34333,33966,34392,34001,33919,33909,33933,33815,
+33681,34125,33833,33694,33441,33258,33291,33471,
+33321,34871,33837,33915,33921,33804,34254,34239,
+33898,33831,33606,33237,33178,33449,33955,34025,
+33856,33741,33637,33737,33514,33360,33874,35424,
+34050,35934,34060,33709,33737,34093,34405,34335,
+34350,34186,34113,34047,34053,34092,34062,34102,
+34398,34418,34701,34710,34832,35720,35513,35748,
+35735,35419,35094,34800,34659,34597,34457,34311,
+34215,34169,34147,34128,34167,34162,34167,34173,
+33955,33854,33988,34344,34776,38865,36959,38529,
+39247,37630,38547,41438,39387,39134,39431,36639,
+38895,38080,37066,37251,36610,37323,37054,36892,
+36667,36197,35637,35371,35701,35271,34800,34557,
+34422,34246,34940,34353,33626,29014,23898,19881,
+18576,18103,18060,18550,18153,18007,18708,21593,
+21573,20401,20425,22395,23492,25170,22982,23070,
+21502,21627,20037,20072,19332,19224,19324,19297,
+19383,19370,19326,19407,19233,19298,19324,19372,
+19266,19294,19152,19090,20275,21362,21543,22563,
+25746,27336,25886,26366,24711,24639,26550,32006,
+32758,33042,36328,33070,32928,31131,31666,32664,
+33156,33208,32418,22189,21613,21549,21829,21744,
+21860,21905,21956,21988,22095,22051,22144,22287,
+22316,22421,22629,22865,24702,22572,21842,22358,
+29244,31693,29310,20485,22486,27900,25002,26663,
+31670,31574,31963,32970,32994,33420,33046,33484,
+32861,32898,32846,32781,32781,32805,32860,32922,
+32944,32971,32988,32964,32955,32986,32889,32883,
+32797,32768,30547,28491,28774,27924,27957,29809,
+28638,28588,25885,30930,32991,29713,26597,27526,
+28337,26094,32392,33099,31315,26667,26719,30543,
+25361,24082,20785,18445,20443,20187,32778,31839,
+30784,32682,34635,33354,32995,20691,9210,14635,
+15654,15420,15267,15586,14979,14631,14697,16320,
+18115,19480,18805,18447,21729,23313,17331,19728,
+25814,21379,25236,27628,14129,24756,22546,18441,
+21171,23134,25866,26233,26473,27212,24346,22374,
+21249,21722,21402,20621,23263,26397,22830,24085,
+26951,29872,20599,28934,32782,21551,18773,26030,
+32968,20239,17698,17394,16420,17157,18977,17247,
+17572,17822,18040,17759,17575,17329,17364,18652,
+17670,17959,17343,18985,20638,18593,27462,17729,
+17350,17300,16733,19202,21033,19848,19206,32841,
+20141,24202,19374,22965,19527,22405,32720,19869,
+18230,18189,17841,17229,16916,16510,17317,16959,
+14892,17604,17158,15370,15074,14880,14910,15224,
+15201,14787,14738,15213,15475,15414,15168,15714,
+15207,16506,14462,15109,15285,15254,15375,16006,
+16346,19349,17601,16838,18263,18609,17518,20566,
+16335,18146,19923,19546,18894,18691,27037,18972,
+19438,23199,18633,18310,18201,17891,17616,18140,
+24445,21834,19572,24316,25373,19240,17247,17627,
+17245,17061,17428,17425,17670,17459,17573,17443,
+17355,18434,19071,18652,17889,17760,17479,17288,
+17409,17415,17490,17218,17400,18225,17718,17345,
+17574,17665,17730,17925,17478,17307,17329,17358,
+17838,17941,18153,18601,18588,18570,18625,18560,
+18664,18608,18147,18246,18140,18427,18138,17834,
+18012,18201,18352,18522,18636,18876,18840,19019,
+19153,19203,19157,19149,19242,19293,19268,19434,
+19470,19365,19539,19724,19855,19944,20018,20185,
+20119,19935,20343,20558,20678,20335,21594,21334,
+21183,20950,20543,21197,21610,21524,21412,21194,
+21841,21938,22673,23064,21806,22758,22554,22527,
+23183,22632,22983,23052,23123,23438,24060,24653,
+23880,23611,23498,22799,22656,22287,22490,22475,
+22888,22028,21611,21365,21309,21441,20874,22020,
+22113,22933,24232,21746,21892,22010,21960,21820,
+21881,22170,21582,22785,22468,22633,22864,23063,
+23182,23778,23455,23454,21908,27461,30545,32015,
+35286,35970,38201,32997,31925,31279,30558,32970,
+33551,33703,33139,33757,30648,28645,27536,32745,
+33040,33381,33053,33066,33129,35241,33465,33059,
+32997,32582,38822,39678,33672,33360,33243,33222,
+33231,33402,33426,33435,33331,33201,33433,33827,
+33477,33224,33081,33003,33003,33003,32997,32864,
+32944,31849,27831,25529,24689,23998,23216,22843,
+22518,22635,23496,26286,19353,18867,19090,18877,
+18659,18660,18738,18843,18507,18881,18801,18867,
+18804,18503,18765,18663,18783,18736,19066,18390,
+18371,18954,20126,20958,22351,23654,25031,24448,
+20164,22646,21681,21706,20717,21142,20400,19850,
+19219,19083,19039,18252,18584,18151,17868,18839,
+19247,19015,17319,17607,17993,18215,17511,17461,
+17977,17950,17819,17636,18366,17817,17768,17871,
+18045,18015,18747,18990,19356,26145,21002,22016,
+19128,19638,19660,22353,25151,27771,29721,30149,
+32037,32858,32757,32988,32721,33239,33228,33347,
+33987,34364,34986,34710,34607,35296,34809,34539,
+34403,34188,34355,34173,34118,33947,34035,33685,
+33800,34005,33606,33853,33562,33330,33397,33561,
+33405,34068,34484,33948,33791,33915,34245,33886,
+33707,33207,33312,33457,33390,33814,34594,34638,
+34419,36867,35709,34539,33949,33882,33552,33940,
+33595,33585,33517,33693,34212,34263,34572,34275,
+34201,34256,34357,34404,33981,34007,34047,34083,
+34111,34147,34223,34376,34618,34693,35349,35652,
+34872,34950,35062,35057,34906,34614,34494,34341,
+34209,34160,34137,34050,34152,34176,34011,33882,
+33874,34050,34201,34306,35484,37188,37556,38490,
+37256,38751,40215,37957,40911,40668,40312,37576,
+35544,37162,39561,40746,37181,38284,38229,37176,
+36636,35985,35928,35904,35238,34930,34962,35310,
+35275,35778,34955,34525,33896,32897,30635,24332,
+19751,19059,18717,18734,18746,18781,19173,20745,
+20214,22773,23297,22435,22134,24348,21247,22389,
+21903,21264,20019,19323,19386,19621,19424,19482,
+19503,19364,19413,19550,19534,19228,19440,19450,
+19356,19311,19070,19314,19621,20065,19821,23418,
+26296,27048,26511,26199,24975,24843,26807,31053,
+32876,33051,36989,33339,33081,33032,32880,32880,
+33052,33042,26317,21662,21743,21845,21876,21780,
+21990,21988,22076,22162,22169,22200,22302,22395,
+22520,22563,22693,23190,24330,22696,22065,25441,
+29292,32992,28168,19974,23938,28278,25480,25681,
+31109,31806,32232,32952,32945,34647,32994,33207,
+32871,32875,32877,32784,32796,32830,32903,32936,
+32941,32967,33003,33001,32950,32934,32914,32853,
+32779,32395,30873,27697,26164,25082,27290,28499,
+28344,30036,25758,32022,27048,27061,26690,28881,
+27556,26262,27831,32457,34234,32559,26937,29238,
+30303,31849,20982,18643,22857,30243,33306,31613,
+27728,33012,27884,35132,32204,15646,10913,15270,
+15738,15793,15673,15434,14549,14844,14697,14523,
+15558,16734,17406,17077,18137,25325,21396,20188,
+23391,18339,21381,22842,20143,19242,25729,23583,
+23152,26525,23151,23645,27012,24169,19933,18791,
+19249,20094,19328,21596,25457,20662,18241,21719,
+30309,20262,18236,22143,18950,17670,17483,19091,
+19470,18007,17328,16770,16700,16823,17607,17727,
+17400,17366,17568,17586,16890,17144,17385,16833,
+18009,17976,17213,18209,21249,17849,17824,17382,
+17410,17232,19767,23011,21288,21663,32988,26118,
+19309,18974,18452,28048,28023,21333,19636,18739,
+18330,18219,17699,17123,16824,16576,17448,17015,
+17280,16894,17507,16568,15192,15533,15111,15374,
+14541,14854,14668,14934,15213,15036,16167,15966,
+15840,15673,15258,15532,15426,15436,15362,15557,
+16099,20454,18589,18095,19887,19131,17465,17517,
+18493,17637,17662,18093,19631,25636,27519,19129,
+19521,20378,18602,22293,18433,17559,18340,17742,
+17803,19749,17673,17865,17502,17594,18021,18470,
+17142,17261,17285,17337,18299,18173,17487,17665,
+17352,18228,19251,19416,17547,17508,17075,17074,
+17337,17319,17226,17618,17568,17256,17907,17589,
+17505,17704,17641,17566,17865,17445,18021,17855,
+18165,18285,18660,18580,18430,18446,18552,18506,
+18470,18334,18440,18435,18228,18309,18172,18246,
+18060,18262,18303,18582,18716,19026,19149,18980,
+19176,19124,19090,19117,19135,19070,19095,19179,
+19392,19515,19371,19653,19765,19893,19913,19961,
+19917,19905,19799,20224,20209,20646,20709,20834,
+20009,21028,21712,22181,23292,21819,21074,21522,
+21928,21976,21913,24484,21971,23314,23267,23615,
+22218,22992,21818,22872,22973,23557,23988,25195,
+23859,23176,22853,22661,22319,22405,22092,21881,
+21433,21641,21444,20223,21099,21558,21270,21621,
+21444,21447,21605,21422,21606,21930,22544,21838,
+21993,21949,21756,21970,22385,22563,22930,23277,
+22962,23682,23370,20082,28957,32931,32851,35601,
+36816,36834,32390,28965,26195,24291,28476,27463,
+29301,31389,28986,27480,29594,23831,24530,31858,
+32991,34116,33018,33266,33181,33728,33465,33033,
+32568,32460,34011,35729,36180,33930,34056,33725,
+34011,33803,33879,33831,33527,33137,33288,33904,
+33778,33210,33027,33003,33003,32960,32857,32826,
+32271,29371,27133,24717,23727,23175,22347,22041,
+21658,21608,20480,19336,19286,18835,18573,18338,
+18468,18440,18369,18514,18501,18603,18553,18548,
+18453,18442,18543,17910,18610,19866,19445,19104,
+20063,20583,20665,19806,21588,23767,26155,24230,
+22751,21663,21962,21610,20763,21015,19632,18616,
+18334,17951,18203,17382,18808,18121,17903,17490,
+17605,17069,17059,17158,17004,16210,17001,16260,
+16761,16359,16650,16839,17538,17624,17985,17616,
+17635,17216,17679,18981,19467,18375,18590,18448,
+19278,20834,20556,22746,29073,30729,31419,32749,
+32889,32973,32988,32268,33033,34037,33222,33402,
+34212,34512,34366,34803,34401,34432,34506,34356,
+34360,34907,34350,34372,33953,33924,33714,33750,
+33949,34078,33714,33699,33887,33390,33391,33638,
+33651,33639,34404,34193,33934,34127,34366,33890,
+33698,33421,33820,33809,33633,34251,34493,35006,
+35297,36681,35808,34321,34377,34005,35363,34602,
+33900,33885,34024,34084,33912,34170,34626,34057,
+34027,34005,34122,34105,34023,34057,34096,34116,
+34126,34158,34176,34383,34457,34926,34692,34830,
+34872,34635,34806,34842,34714,34399,34374,34371,
+34193,34162,34128,34161,34146,34206,34095,33889,
+33928,34137,34190,34417,35411,37332,37922,35839,
+38713,37476,39450,39180,39507,40899,40992,41390,
+35350,35615,35532,36047,36402,38482,37983,36985,
+36070,36994,36672,36061,35845,36098,35643,35964,
+35757,35791,35357,35081,34386,33782,32416,28914,
+20820,19830,19047,19379,19019,18786,19212,24186,
+21351,21621,22176,24030,21998,20773,21591,20938,
+20276,19290,19839,19645,19371,19559,19571,19640,
+19596,19614,19633,19679,19668,19584,19668,19614,
+19440,19413,19267,19364,19677,20289,22058,25744,
+26771,27152,28561,26705,25310,26176,26101,32544,
+32608,33275,34377,33550,33264,33059,32508,32988,
+33003,32855,22602,22070,21798,22049,22012,22073,
+22200,22190,22248,22255,22361,22403,22455,22580,
+22702,22784,22756,23008,23075,22755,22704,26601,
+30078,31338,27722,23433,22668,28083,24879,25557,
+29614,31950,32163,32917,32960,33423,32835,32991,
+32897,32795,32772,32791,32802,32890,32896,32920,
+32964,32988,33003,33003,33003,32988,32932,32891,
+32800,32949,32184,28795,25976,23841,23121,26088,
+25947,28663,26193,25713,32481,26879,25748,25503,
+28262,26838,26183,28151,32093,32997,30080,29763,
+29039,28428,31940,23874,26378,33663,32592,32334,
+34677,29349,28690,32827,32117,9672,13353,15450,
+15438,15810,15355,15687,15503,15669,14545,13557,
+14979,15828,16066,16676,19825,23955,25512,22639,
+20691,18765,19853,21896,26941,16511,21954,31479,
+24877,27567,26268,24876,22583,19512,18506,18647,
+19922,21924,20775,22281,19350,20518,19522,21840,
+27958,18789,16701,17325,16434,15958,16780,17281,
+16932,16848,16532,16147,16605,16186,16735,17424,
+16891,17455,16989,17052,16702,17265,17485,17149,
+20690,26022,26532,20751,22870,20927,17755,16981,
+17254,18027,17787,18881,20019,18830,19572,20144,
+19814,20628,27568,21027,20622,20496,18581,18089,
+17943,17882,17384,17052,16717,16626,17454,17269,
+17553,17881,16852,17446,15214,14567,15587,14331,
+14822,14424,14964,15425,15230,16125,16037,14678,
+15167,16066,16075,15793,16254,15961,15700,16683,
+19824,19962,19563,18983,20376,19088,17093,17123,
+17214,19181,21114,25977,21952,22857,19106,18515,
+18961,19515,19237,17847,17964,19138,17345,17269,
+18390,18647,18328,17700,17955,17199,17757,17309,
+18290,17352,18091,17568,17917,17361,17851,17499,
+17619,18117,17831,17219,16953,17293,17188,17051,
+17192,17100,17406,17376,17829,17707,17259,17745,
+17523,17565,17586,17778,17802,18040,18166,18544,
+18118,17992,18198,18345,18447,18413,18351,18106,
+17920,18436,18366,18150,18397,18338,18514,18294,
+18114,18390,18377,18488,18576,18898,19096,19024,
+19007,18962,18963,19010,19044,18828,19083,19233,
+19316,19415,19661,19531,19811,19904,19902,20019,
+19862,19844,20089,20061,20146,19953,20433,20723,
+20674,20646,21982,21081,21342,21886,21994,21753,
+22872,23016,21428,22852,26382,26599,23075,24570,
+27718,20926,22344,21821,21982,22978,23475,24208,
+22988,23352,22386,22784,22515,22653,22546,21288,
+21679,21004,20984,19321,20862,21096,21051,20953,
+21243,21093,21378,21272,21489,21513,21660,21770,
+21848,21736,21883,21476,21621,22821,22979,23241,
+23735,24003,19833,28186,33342,33097,36901,38205,
+33491,32923,28992,27221,25261,23804,23363,23664,
+24367,25069,26211,26664,24756,24141,23916,28306,
+32847,33021,33108,33571,34912,34065,38036,33189,
+32972,33142,35803,34572,34965,34944,33642,35943,
+34798,35046,33519,33120,32999,32862,32805,35417,
+36139,33724,33100,32954,32973,33139,32854,32703,
+30320,28358,27084,25140,21999,22069,21750,21129,
+21282,20508,20124,19508,19083,18642,18276,18179,
+18213,18240,18270,18071,18339,18347,18381,18505,
+18532,18396,18489,18646,18903,18356,18297,19719,
+19125,18364,19331,20036,21652,21301,23846,23995,
+22810,22190,21864,21741,20982,19602,19218,18726,
+18718,18580,17753,19779,19151,18105,16326,16242,
+17604,17049,17340,17101,16977,16098,16825,17236,
+17645,17048,17084,16843,16971,16181,17172,17291,
+16788,17838,17853,17526,17821,17720,17457,18174,
+19047,19305,20056,21424,28764,31497,32408,32897,
+32608,32925,32948,33178,33578,34084,33511,34818,
+34233,35159,34345,34248,34187,34218,34220,34311,
+34169,34347,34136,34080,34141,33918,33858,33963,
+34082,33870,33691,33811,33678,33428,33429,33445,
+33450,33452,34392,34153,33971,33971,34055,33912,
+33630,33609,33915,33771,34125,34338,34794,35043,
+35004,35556,35199,35060,34379,34233,33989,33643,
+34293,35284,34854,34831,34297,34038,33957,33951,
+33984,33968,33986,34011,34086,34213,34237,34148,
+34134,34225,34243,34254,34353,34500,34614,34656,
+34617,34502,34515,34608,34420,34360,34365,34298,
+34218,34186,34196,34248,34226,34573,34230,34158,
+34152,34147,34241,34501,35216,36990,35094,36571,
+36546,37302,38370,39993,38847,38793,39378,42426,
+35371,35037,35388,34973,35279,36789,36800,34289,
+33581,33758,34176,34205,34764,34423,37766,36483,
+36299,36112,35466,34263,33981,33864,32867,30895,
+23096,20691,20278,20052,19667,19467,21540,24438,
+27599,19818,21694,28468,23060,22017,21206,19935,
+20010,19470,19407,19430,19598,19559,19716,19692,
+19790,19730,19770,19771,19766,19791,19744,19731,
+19684,19647,19554,19457,19949,21717,22351,26653,
+26091,27543,28920,30594,25737,26233,27467,32945,
+33054,33938,37923,33857,33699,33267,32999,32811,
+32967,31740,22493,22058,22022,22142,22194,22188,
+22312,22358,22464,22433,22459,22623,22644,22743,
+22829,22970,22984,22964,23085,22786,22683,27318,
+31299,31223,27237,21309,23766,25204,25633,25457,
+29310,31929,32089,32881,32910,33521,32995,32916,
+32821,32786,32781,32811,32850,32941,32991,32954,
+32910,32990,33006,33003,33003,32997,32953,32953,
+32892,32825,32423,30153,28476,30519,24079,21302,
+22538,25347,25350,27978,31662,27972,30076,29286,
+28383,29129,28341,28500,30690,32800,33065,32724,
+28581,29642,28992,28245,28908,32969,34205,33164,
+32988,32970,32805,32430,22404,4336,15036,16024,
+16404,16160,15858,15629,15696,15497,15030,15144,
+14991,15516,15760,15740,19178,22991,19785,16592,
+18330,20193,19347,20735,22513,14435,18539,29466,
+29112,23286,21320,21629,20115,17891,18578,18808,
+19907,23179,22629,23370,17896,17745,17886,17728,
+23745,19410,16071,15853,15570,15708,16001,16415,
+16398,16076,16112,15942,16086,16005,16481,16369,
+15810,21736,16542,16378,16409,16605,16483,17511,
+19795,27885,20320,22282,26209,27018,20303,19642,
+18084,19116,18971,19699,20134,21044,20295,19140,
+20523,23549,24811,27507,24452,25527,18840,18416,
+17910,17640,17382,16836,16516,16625,16816,17413,
+15968,16365,18481,16427,19149,17176,15397,14943,
+15168,14787,14963,14768,15494,17434,15894,15309,
+15838,16917,19747,18560,15990,16464,16161,21724,
+16694,17026,18622,24261,25153,25992,18523,19235,
+16461,18294,17715,18600,19368,18813,18873,24826,
+18521,18285,18398,18205,17505,17703,17127,17045,
+19776,17499,17182,17146,17046,17007,16334,17367,
+17463,17583,17472,17712,17658,17448,17517,17469,
+19586,17715,16782,17345,17332,17300,17723,17865,
+17083,17073,17375,17383,17386,17347,17748,17154,
+17030,17447,17908,18187,17869,17529,19048,18483,
+18365,18356,18097,18263,18312,18290,18038,18150,
+18242,18459,18112,18023,18385,18174,18450,18061,
+17841,17985,18356,18607,18672,18779,18782,18742,
+18801,18776,18861,19070,19148,19052,19174,19212,
+19323,19446,19607,19683,19608,19794,19699,20019,
+19995,19876,20063,19943,20063,20260,20493,20428,
+21119,20448,20777,20985,21084,21238,22162,21691,
+21189,20815,21900,21544,22045,20708,20877,22734,
+22362,22554,22814,22635,23264,23274,23523,23925,
+23658,23787,23460,23069,22986,22619,22050,22533,
+21300,21784,20970,21039,21047,21002,21166,20862,
+20878,20859,21428,21344,21402,21397,21709,21533,
+21913,21960,21666,21819,21570,22588,23474,24243,
+25029,20091,26980,32458,32703,34689,33178,33462,
+33038,30348,27438,26217,24296,23727,23238,22488,
+22383,22379,22585,22632,23328,22950,23779,24885,
+27930,33000,33018,33042,43953,34788,36707,33401,
+33043,33235,34449,34497,35317,34009,33821,32993,
+30824,30332,32366,32544,29601,29613,31464,32853,
+32926,32933,33690,32808,32464,34230,32844,32369,
+29556,28746,27365,25824,22341,21183,21032,20612,
+19984,19992,19645,19356,18921,18550,18372,18160,
+18114,18183,17853,18139,17989,18521,18207,18293,
+18213,18231,18708,18290,18054,19071,22737,23331,
+21333,17481,17508,17502,18405,18815,19854,17658,
+17240,18654,18990,17878,16636,16479,15977,16411,
+17170,17610,16965,17375,18355,16569,15851,15298,
+14415,16441,15827,15557,15567,15156,15927,16956,
+16838,17307,16848,16806,16168,16469,17166,17277,
+17046,17415,17511,17284,17600,17485,17722,18355,
+18863,19378,19998,20905,24548,31316,32977,32988,
+32849,32988,32994,33284,33389,34192,34079,36469,
+35001,34890,34724,34226,34251,34110,34170,34221,
+34014,34175,33976,33933,34167,34374,33924,33946,
+33947,33814,33801,33870,33904,33465,33601,33684,
+33949,33410,33585,34318,33909,33918,33783,33906,
+33531,33500,33770,34083,34307,34660,34765,34825,
+34872,35850,34806,34628,34444,34406,33982,34086,
+34296,34314,34398,35505,34295,33959,33889,33918,
+33885,33970,33975,33987,34123,34233,34347,34174,
+34265,34256,34336,34252,34467,34535,34854,34509,
+34601,34524,34399,34335,34346,34350,34345,34329,
+34275,34341,34458,34379,34438,34554,34383,34211,
+34143,34136,34218,34532,35119,35287,35148,37107,
+37497,38894,39147,42614,39457,39937,41733,38646,
+35726,35176,34409,34851,35219,34840,33792,33035,
+31206,29412,29962,33617,33029,33513,39272,37419,
+36624,35736,34642,36183,35406,33703,32815,30483,
+25550,22412,21474,20568,20180,20820,21268,28529,
+17277,23492,19430,23286,24663,22365,20522,20385,
+19447,19341,19459,19698,19736,19711,19802,19873,
+19904,19895,19941,19956,19909,19957,19890,19716,
+19635,19736,19551,19784,20787,22421,23851,27831,
+30985,28269,28537,30619,26271,27012,30993,32988,
+33196,33411,33948,33706,33534,33250,33011,33003,
+32489,27127,22572,21872,22249,22271,22323,22341,
+22487,22522,22623,22562,22706,22788,22857,22749,
+22956,23109,23144,23259,23255,23139,22780,27753,
+32665,32355,26945,26182,23625,23472,23732,25433,
+27987,31815,32097,32859,32982,33473,33246,32805,
+32735,32823,32829,32809,32887,32928,32997,33171,
+33089,33053,33004,33006,33006,33015,33537,33159,
+32928,32875,32368,32115,28335,26379,23652,21228,
+20802,21605,20822,22295,30130,27260,26211,27586,
+32966,30670,32701,30788,28910,31800,32989,32928,
+32864,32913,32770,30841,33344,32993,34511,32988,
+31707,32877,32601,33103,14765,10563,18903,15963,
+16431,16593,16010,15428,15455,15744,15297,15579,
+15596,15472,15483,15943,17630,24465,20883,20429,
+18684,18518,18259,18784,21315,12659,16711,15162,
+17555,16446,16404,18197,17010,15783,17586,18002,
+20116,21947,21258,20986,19106,17331,17382,16859,
+15717,16110,15763,15612,15409,15547,15585,15631,
+15722,15852,15867,15794,15822,15871,16168,16170,
+16093,17614,16251,16136,15942,18099,16037,17206,
+20273,20717,20750,20749,22225,21023,19080,18919,
+18845,18972,18811,18900,22011,21869,22122,20020,
+19124,18429,19351,21739,21635,19662,17796,18473,
+17786,17328,16927,16714,16313,16429,16106,16436,
+16033,15719,16645,17064,14964,14459,14098,15447,
+15352,14861,15826,16786,15583,16299,16773,15918,
+16658,18128,19155,16833,16241,17178,16922,16552,
+16660,18537,16695,18444,18231,17853,17100,16740,
+22692,17358,17813,18603,19484,20585,18717,17876,
+18700,20294,18987,17235,17358,16828,16887,18441,
+16561,16928,17232,17314,17147,16694,16851,17460,
+17428,17517,17466,17017,17454,17778,17622,17573,
+16881,17119,16839,17073,16821,16935,17398,17262,
+16860,17061,17163,16918,17230,17163,17222,17399,
+17348,17628,17926,17952,17952,18027,18184,19260,
+18599,18204,18442,18227,18034,18024,18079,18211,
+18040,18246,18360,18360,18532,18510,18105,18183,
+18015,18317,18492,18582,18414,18487,18575,18609,
+18721,18792,18689,18980,19018,19161,19260,19258,
+19356,19547,19607,19497,19573,19655,19722,19835,
+20402,19936,20055,20174,20496,20821,20435,20447,
+21036,20912,20719,20411,20832,20940,21008,20775,
+21679,21928,20839,22146,22073,22014,21980,22871,
+21906,22490,22240,22816,23133,23082,23666,24039,
+24883,24137,23286,23639,22938,23042,23150,22962,
+22117,22709,21453,21246,21278,20746,20555,20398,
+20827,20567,20954,20915,21126,21282,21480,21834,
+21919,22010,21860,21879,22224,22523,22465,22587,
+17629,27336,32409,32598,33699,33093,33406,34062,
+32795,29013,26322,25101,24624,23546,22952,23130,
+22981,22458,22422,22244,22932,22785,23493,24214,
+26534,29142,31674,32214,33422,33087,33225,33281,
+32829,32858,32974,33309,34264,33327,33300,32350,
+28397,27384,29845,30817,31467,31273,30930,32445,
+32821,32687,32811,32721,32501,32376,33048,29493,
+28044,28626,27953,26090,23250,20286,20100,19578,
+19384,19354,18643,18613,18558,18275,18182,18121,
+17931,17894,18043,18133,18237,18138,18441,18651,
+18159,18126,17748,18518,19890,20760,21464,23315,
+22285,23658,21315,21426,21165,20853,19620,19829,
+19335,19476,19019,19077,17724,16708,17834,17758,
+18033,17766,16106,15129,16206,17463,16466,16576,
+16952,16063,15786,15786,15453,15343,15721,16447,
+16928,16399,17043,17540,17556,17615,17223,17292,
+17283,17462,17670,17667,17716,17875,17931,18431,
+18654,19275,20037,21323,23247,32841,32988,33000,
+32996,33009,33078,33288,33740,33925,34688,36021,
+35169,34773,34277,34353,34156,34138,34060,34090,
+34065,34035,33966,34242,34315,34368,34045,34268,
+33957,33829,33753,34045,33915,33918,33628,33588,
+33867,33616,33483,33727,33912,33781,33698,33642,
+33386,33684,33911,34278,34770,34629,34842,34852,
+34753,34754,34530,34282,34336,34359,34314,34269,
+34369,34174,34056,34125,33903,33889,33912,33900,
+33936,33921,33936,34390,34906,34664,34338,34245,
+34245,34302,34359,34360,34521,34657,34760,34716,
+34636,34528,34387,34376,34341,34307,34299,34300,
+34528,34412,34659,34649,34949,35020,34647,34357,
+34166,34143,34350,34801,34698,34676,36537,35615,
+36102,39361,40395,38647,39897,38664,41437,39628,
+35585,34461,34089,33681,34113,34941,33194,32807,
+30939,29630,28290,27911,27698,27617,32603,31641,
+32640,33250,33451,37810,34842,34765,32548,29721,
+25851,26480,26490,23439,20839,23782,23416,23895,
+20374,22221,23535,18505,20820,19977,20919,19544,
+19862,19691,19739,19851,19916,19864,19981,20037,
+20090,20091,20059,20084,20119,20134,20031,19963,
+19851,19829,19671,19922,20507,21346,26136,29121,
+30099,32703,26732,26568,26485,28590,32988,32992,
+33187,34738,33956,33570,33846,33631,33229,33006,
+30429,24305,23196,22180,22371,22505,22325,22484,
+22594,22695,22752,22823,22890,22947,23070,23047,
+23118,23288,23333,23435,23385,23283,22466,23964,
+31512,32535,28797,27438,23928,23833,23311,25401,
+26768,31503,32589,32982,33124,33030,34294,32825,
+32638,32796,32854,32818,32830,32931,33273,33157,
+33261,33044,33011,33026,33099,33138,33231,34050,
+33123,32983,32966,32256,29390,26899,24237,21215,
+20544,20276,20137,19998,22474,29114,26460,24882,
+30481,32791,31759,27781,27648,31098,32925,32994,
+32987,32983,32781,32208,35176,33289,32863,32997,
+32073,33155,34022,31709,12678,13917,15689,15957,
+16424,15724,15479,15454,15513,14863,14987,15594,
+14979,15886,15347,15939,17273,19587,18399,18942,
+18150,18645,17982,19505,23081,21331,19506,19808,
+24039,22522,15778,6795,4179,6944,10539,13397,
+18793,20685,18969,21081,16644,22449,15909,16269,
+15819,15561,15432,15408,15357,15396,15387,15360,
+15438,15461,15477,15513,15303,15509,15141,15258,
+15304,26558,15391,15989,16115,17007,24053,16059,
+22032,17124,22315,21045,28275,18910,17998,20771,
+17889,18618,20745,21729,27913,32918,25602,25224,
+20093,20972,20617,32646,23348,18392,19351,18204,
+17640,17184,16576,16264,16396,16206,16936,16686,
+16710,16141,16095,16119,16441,15324,14955,14895,
+15097,15239,16245,17383,18430,17968,17870,17651,
+16749,17484,17157,16341,17699,16971,17664,17788,
+16368,17077,16344,16256,18416,17221,17721,16944,
+18303,16943,19008,16933,20469,17340,18283,17466,
+17550,18127,17195,17325,17082,16023,22147,16584,
+17291,17216,17991,17619,16639,16437,16688,17199,
+17287,17648,17326,17591,16993,17366,17535,17195,
+17122,17403,16729,17021,17313,16813,16708,16790,
+16879,16835,16951,16719,17728,17167,17348,17195,
+17772,17454,17852,18208,18147,18094,18080,18260,
+18018,18228,18199,18160,18069,18227,18162,18121,
+18241,18142,18328,18150,18561,18232,18609,18610,
+18264,18390,18388,18284,18285,18388,18552,18486,
+18500,18393,18503,18678,18991,19068,19155,19110,
+19260,19310,19287,19386,19595,19705,19760,20551,
+19829,20053,20004,20133,20143,20258,20388,20936,
+20715,21182,20930,20580,20535,20703,20288,21051,
+21000,20613,21629,21608,21823,21906,22034,21866,
+22236,21794,22398,22531,22789,22818,23721,23840,
+24474,24133,24563,23352,23397,23086,23088,22861,
+22589,22391,22010,20549,20476,20560,20883,20563,
+20406,20877,20829,20697,20744,20712,21414,21651,
+22030,21469,22185,22246,22167,21204,18024,19876,
+27481,32656,32761,33427,33093,33094,33775,33534,
+33042,32886,28179,29037,24938,28606,23447,22897,
+25476,24039,22341,21868,22017,22306,22707,23406,
+23967,23572,25833,29054,29208,29240,32832,33105,
+33221,32896,32691,32934,32992,31619,29793,27639,
+28272,28938,32571,29719,29503,22129,28047,32361,
+30066,30622,30338,29850,30682,29616,28965,28467,
+28251,27191,27966,27059,23736,20026,19677,19380,
+18978,18913,18769,18537,18439,18266,18120,18022,
+18144,17892,17975,17993,17712,17819,18339,18793,
+18413,18491,19765,20217,20652,21138,21712,22854,
+21250,24392,20851,20418,19415,19847,18216,18482,
+19330,18946,18921,18741,17172,16582,17470,17826,
+17156,17487,16840,16089,16681,16864,19828,19815,
+16917,16331,15600,15345,15748,16386,15787,16954,
+16627,16804,16601,16569,17315,18144,17871,17484,
+18096,17728,17876,18021,17937,18015,18192,18301,
+18615,19242,20124,21309,25151,32988,32988,32934,
+32991,33026,33131,33290,33605,33420,34017,35331,
+34822,34805,34131,34347,34360,34330,34119,34040,
+34041,33918,33966,34110,34002,33994,34174,33979,
+33872,33837,33746,33947,33916,33914,33625,33685,
+33753,33638,33602,33912,33819,33837,33603,33549,
+33579,33675,33888,33906,34458,34792,34815,34785,
+34395,34227,34224,34185,34228,34167,34439,34366,
+34225,34064,33954,33882,33889,33890,33861,33922,
+33975,33912,34029,34432,34512,34726,34374,34291,
+34320,34310,34438,34501,35026,34915,35372,35044,
+34925,34893,34653,34486,34414,34366,34382,34368,
+34565,34590,34878,35278,35096,34863,35310,34489,
+34170,34116,34336,34719,34473,34599,34749,35137,
+36180,37612,38499,39125,43376,41183,41707,37905,
+35391,35219,34085,35455,34224,33257,32614,31677,
+30900,30075,29242,28222,27569,27485,27309,27007,
+26720,27249,27494,28179,29490,33387,32700,32301,
+29674,32393,31575,27272,24265,26771,27540,21105,
+20540,20883,20895,23982,20565,20076,19583,19720,
+19922,19753,19896,19995,19959,20021,20119,20175,
+20262,20264,20274,20232,20261,20228,20175,19968,
+20037,20019,19972,19944,20838,22945,26841,29924,
+28646,31765,26546,26721,28794,32820,32988,34410,
+35848,35719,35886,34460,34182,34674,33218,33000,
+29311,24871,22762,22145,22559,22552,22590,22662,
+22657,22871,22928,23064,23101,23061,23205,23204,
+23247,23422,23421,23485,23596,23510,23067,25760,
+32559,33128,30514,26940,28608,28658,24450,25323,
+26556,31893,32746,32974,32959,33013,33286,33026,
+32683,32836,32880,32850,32898,32744,34378,35629,
+33645,33053,33046,33072,33260,33217,33814,35906,
+35498,33246,32979,32401,26263,25071,23042,21263,
+20670,20322,20020,20043,22252,24975,23042,20869,
+27632,31934,32111,23678,26774,28686,31957,32871,
+32958,32125,31759,29747,33188,32029,32915,32931,
+32457,33018,34315,26889,10353,14747,15723,15978,
+16201,15956,16008,15652,15829,15075,14894,14951,
+14827,15473,15360,16131,15854,16222,23333,18426,
+18222,18607,18075,18696,20584,21754,18836,22831,
+23054,21624,23735,19772,18121,19816,18724,10332,
+8367,14134,14974,16410,15465,15956,16793,16080,
+15768,15569,15626,15276,15138,15191,15222,15163,
+15221,15201,14905,14802,15297,15363,14988,14937,
+14752,22407,15600,19374,15633,16215,15489,17614,
+15290,15195,17915,27484,28321,17772,18729,17796,
+18482,22427,30408,23201,23547,24378,26369,22141,
+20229,20346,18399,19191,17673,18348,18432,18160,
+17676,16391,16401,16113,16226,16157,16268,15707,
+16473,16207,16096,15818,15659,15079,15801,14884,
+15448,15606,15966,16695,20686,20951,19067,18825,
+17142,16858,16317,16352,19033,16629,25773,16700,
+25264,17154,16963,17145,15574,16686,16540,16559,
+16913,17040,16995,18150,18254,17542,18177,17352,
+16849,16658,16483,22906,17004,16311,16471,16380,
+18039,17146,18903,17005,16848,16452,16597,17101,
+18159,18056,17250,17526,17116,17361,17456,17712,
+16988,16694,16734,16811,17085,17250,16934,17051,
+17051,16834,16638,17162,17296,17012,16978,17001,
+18141,17257,17761,18165,18273,18726,18353,18336,
+18452,18253,17906,18101,18095,18003,17946,18251,
+18173,18368,18528,18109,18776,18644,18438,18399,
+18021,17956,18068,18465,18366,18356,18286,18507,
+18825,18678,18597,18558,18845,18919,19099,19261,
+19476,19302,19597,19725,19728,20025,19767,19801,
+20633,20000,20163,20247,20422,20634,20568,20834,
+20796,20299,20696,20886,20708,20739,20626,21073,
+20874,21570,21195,22003,21767,22410,21330,21152,
+21573,22305,21993,23073,22920,23487,23644,23514,
+24390,24072,23461,23529,23484,23051,23378,22869,
+22759,22803,22448,22464,22172,20747,20700,20319,
+20384,20576,20765,20559,20618,21086,20976,21610,
+22083,22173,21933,18738,15846,22142,26241,29819,
+32988,32719,33022,33117,33643,34570,33861,33134,
+33072,32866,32944,30965,31564,29366,23634,24447,
+24587,23022,22397,22797,21654,21748,22023,22409,
+22537,22035,21768,21692,25659,25117,31881,32831,
+33279,33050,32840,32816,32538,29338,29631,32998,
+28359,23276,24758,18419,21563,22677,21396,25464,
+28790,25415,24258,24453,27920,30011,27324,25785,
+28938,25875,28074,27045,23933,19324,19592,19655,
+19390,19086,18821,18957,18550,18334,17919,17805,
+17451,17816,17569,17571,17779,18240,19023,18502,
+19041,19861,20625,19383,19728,20469,20217,21454,
+21808,25062,22281,21120,21001,18881,17150,16990,
+18018,18368,18350,18493,16325,17547,17661,16292,
+15155,15101,15044,15706,16228,15957,14725,14737,
+15710,15540,15246,15901,15978,15541,15966,17093,
+16947,16994,17308,17240,17440,18186,18088,17946,
+18050,18192,18110,18217,18354,18351,18393,18411,
+18789,19208,20130,21382,24502,32378,32988,33013,
+33021,33119,33108,33154,33168,33216,33581,33866,
+33894,33942,34449,33925,34349,34113,34929,33996,
+34063,33990,33951,33938,33919,34206,34065,34033,
+33788,33905,33729,33921,33946,33818,33924,33890,
+33928,33839,33912,33914,33818,33721,33687,33679,
+33710,33831,33834,33911,34314,34329,34824,34829,
+34529,34209,34133,34083,34020,34101,33975,34068,
+34055,33993,33868,33872,33870,33876,33878,33881,
+33898,33909,33896,34016,34165,34197,34302,34317,
+34355,34565,34639,34602,34846,34803,35592,35931,
+35516,35312,34833,34640,34565,34484,34525,34542,
+34614,34721,34743,34819,34791,34726,34871,34439,
+34191,34148,34289,34371,34391,34458,34557,35001,
+38028,36747,38592,40846,38699,39984,41129,38113,
+35133,34493,34992,34288,34102,35112,33552,31929,
+31292,30387,29832,29616,28460,27572,27038,26338,
+27009,26472,26090,25873,25932,26620,31883,30301,
+32814,31016,31550,32979,32013,29295,22877,21273,
+21346,22312,20974,23624,19179,19527,19409,19532,
+20004,20072,19902,20054,20136,20190,20242,20318,
+20321,20406,20412,20404,20413,20439,20357,20304,
+20245,20144,20081,20182,20601,23574,26439,29487,
+27925,27079,26403,27261,31194,32635,33325,35613,
+35369,35083,35007,34665,34197,33877,33414,33144,
+32895,24735,23368,22518,22548,22726,22767,22792,
+22888,22957,23127,23184,23280,23328,23403,23390,
+23400,23599,23580,23619,23798,23759,23924,25098,
+32535,32998,31864,27012,29557,30627,24344,25143,
+26586,31470,32944,32974,32995,33096,33646,33475,
+32886,32910,32920,32917,32919,34209,34677,33294,
+33207,33019,33355,33086,33228,33447,35262,36562,
+35252,35287,32993,32454,26136,25657,24859,20731,
+20467,20063,20084,21051,19871,19905,19854,19821,
+20340,22294,21600,22569,24329,28484,26817,32147,
+32987,31131,32987,31011,28956,32841,32989,33076,
+32585,33354,33133,22133,14093,15681,15988,17021,
+16494,16296,16100,16741,15366,15231,15107,15133,
+15409,15891,15826,16636,22849,22362,21810,18155,
+18308,17822,18231,19133,19041,20119,21279,20987,
+21253,23099,17279,26164,25585,20795,22131,21343,
+12777,8132,6918,12882,13923,19989,16846,21282,
+16050,15639,15424,15113,15084,15056,14903,15131,
+15187,15021,15019,15059,15151,15009,15213,15075,
+20539,15417,15241,14883,15690,22413,17075,16806,
+15617,15318,17897,16807,22311,16729,17831,19110,
+21904,24966,18806,19215,29343,24387,20362,19018,
+19183,25221,19438,20037,28033,17271,17838,17615,
+17248,16292,25685,15981,15909,16350,15822,15957,
+15975,16747,16046,15581,15449,15807,16842,14768,
+16161,17886,16363,17187,19437,19743,18576,18111,
+17669,16827,16725,17081,16184,16917,16595,16349,
+16363,16519,17167,16372,15814,16289,16271,17632,
+17442,17240,17330,17192,17607,16768,16665,17173,
+17001,17038,16781,16602,16143,16446,16876,22369,
+19288,17267,17139,18621,16341,16644,16425,16608,
+16880,17201,16996,16707,16592,16876,16733,16370,
+16553,16509,16560,17099,17310,17045,17058,17177,
+17209,16874,17104,18297,17205,17478,17413,17452,
+17524,17917,17969,17623,18180,18556,18430,18270,
+18505,18033,17881,18303,18384,18458,18256,18195,
+18441,18384,18427,18819,18548,18076,18410,18040,
+18448,18088,17871,18219,18601,18696,18576,18660,
+18636,18661,18563,18792,18945,18987,18817,19080,
+19359,19485,19395,19642,19941,19588,19888,20211,
+20133,20016,20395,20344,20332,20439,20781,20441,
+20550,20468,20582,20479,20613,20811,20838,20619,
+20842,21469,21686,17558,22216,21351,21390,21383,
+21464,22088,22469,23278,23037,23039,23646,23847,
+24014,24088,23850,23317,23204,23339,22748,22793,
+22804,23402,22884,22226,22072,20113,20622,20907,
+20410,20466,20812,20535,20984,20376,21582,21099,
+20882,17361,18907,24416,27725,31771,32895,32612,
+32861,33196,33354,34709,34394,33888,33420,33159,
+33094,32991,32988,31959,28902,27663,27665,25071,
+23971,22825,24502,22047,21366,21301,21397,21732,
+21578,21371,21250,21203,22404,25040,26286,28373,
+30887,30132,32696,31819,29316,26940,25221,24480,
+20226,21351,20007,18009,18153,19011,22098,23580,
+26018,29122,24047,24057,24137,32881,26609,25581,
+29325,27879,27965,25896,22904,19347,19785,19389,
+19295,19041,18554,17862,17477,17642,17454,17642,
+17728,17817,17685,17859,19239,19340,18792,17727,
+18704,20122,20862,20541,20197,21511,22135,23765,
+22112,21956,19995,20172,19461,18681,17493,17664,
+17606,17852,16880,16724,14991,15371,16951,15647,
+15216,12837,13565,15313,16098,15152,15856,15195,
+15722,15568,15417,16069,16141,16031,16063,16716,
+16772,17113,17571,17730,17892,18090,18413,18530,
+18531,18456,18530,18513,18726,18699,18807,18738,
+19186,19684,20263,22047,28302,32736,32987,33078,
+33111,33136,33114,33107,33219,33226,33221,33339,
+33456,33491,33738,33687,33913,34237,34344,34324,
+33954,34065,33978,33872,33913,33907,33906,33917,
+33743,33774,33838,33975,33909,33908,33971,33882,
+33800,33840,33753,33753,33757,33680,33675,33684,
+33783,33874,33891,33857,34056,34240,34593,34376,
+34440,34155,34084,34065,33995,33917,33896,33870,
+33873,33885,33880,33813,33830,33855,33852,33855,
+33872,33873,33828,33839,33981,34023,34119,34263,
+34308,34386,34621,35112,35633,35184,35863,36138,
+36505,35871,35157,34841,34782,34582,34590,34567,
+34650,34838,34812,34917,34569,34422,34395,34266,
+34197,34113,34322,34329,34302,34369,34449,34607,
+35460,36558,37728,40524,37312,37992,39252,37627,
+33971,33957,33458,33050,34351,33330,32608,33113,
+33273,32949,32463,29579,28230,27995,28047,26145,
+26970,26297,26517,26430,25606,26135,27699,26904,
+26314,26002,27804,31247,27930,24397,24807,20946,
+20724,21786,22996,24879,19955,21042,20922,19802,
+19959,20112,20133,20217,20238,20337,20414,20432,
+20501,20541,20574,20567,20514,20607,20538,20481,
+20385,20139,20243,20280,21922,24324,26853,28592,
+28386,30194,26887,28737,32264,32689,33285,35789,
+35611,35349,35155,35712,35250,34635,33514,33192,
+32982,30206,23512,22457,22479,22856,22847,22896,
+23091,23159,23216,23305,23409,23478,23580,23586,
+23562,23769,23894,23959,23976,23955,23928,24429,
+31290,32997,30989,27380,30060,30309,24698,25434,
+27090,32160,32635,32935,32982,34048,35715,33200,
+32871,32957,33054,33018,33129,33312,33087,33020,
+33018,33029,33174,33291,33246,33525,34102,34010,
+34756,34549,33135,32729,26098,25481,25406,24484,
+20313,20749,20043,20397,20037,19916,20268,19947,
+20103,20903,21032,21395,24447,26334,25995,29192,
+30687,29851,35121,31243,32461,28965,30600,32503,
+32667,30409,27525,10278,16257,16703,16891,16921,
+16841,16375,16039,15974,14952,15080,15134,14717,
+14781,15214,15972,16407,20080,24105,19528,18797,
+17873,17729,19434,18685,18543,19585,19733,20220,
+21658,20775,23105,26604,22837,21720,23389,26558,
+23427,19417,15759,5991,6357,15583,16691,19785,
+16776,15900,15201,14944,14807,15371,15182,15063,
+15244,15043,14999,14589,14750,14580,14919,15092,
+15890,24057,16233,19721,15984,15993,15726,16818,
+15876,16018,17229,17048,16827,21051,16994,17209,
+17139,20849,17699,18634,19263,18582,17670,17555,
+19206,17597,17729,18888,18683,16976,17769,16771,
+16470,16345,15453,15476,15882,15848,16237,20007,
+15855,16250,15871,15699,15636,15467,15801,16197,
+15240,16792,16686,18080,18675,18899,19377,17526,
+16716,16590,24066,18669,15944,17851,16120,16356,
+15677,16018,15649,15766,15111,15480,18676,16734,
+18447,17385,16987,22266,18429,18709,16484,16743,
+16994,16527,16302,16040,16319,16608,16521,16374,
+15894,16341,17231,16812,16857,16748,16169,16208,
+16361,16651,16423,16624,16428,16488,17300,15896,
+16082,16371,16854,16758,16191,16893,16833,17070,
+16990,16732,16831,17097,17108,17200,17527,17730,
+17996,17702,17989,18017,18399,18350,18207,18438,
+18539,18407,18260,18709,18614,18643,18813,18602,
+18866,18877,18531,18777,17940,18258,18295,18036,
+18102,17858,17724,18107,18476,18534,18652,18654,
+18807,18905,18786,19028,19242,18841,18714,18951,
+19179,19522,19473,19864,19826,20598,20685,19875,
+20469,19880,21342,20320,20362,20577,20514,20545,
+20775,20885,20811,20833,20725,20979,20892,21105,
+21153,21430,19812,25418,20995,21312,20897,22117,
+22986,19440,22719,23172,23220,23163,23470,23894,
+24078,23688,22765,23548,23722,22827,22674,22779,
+22552,22855,22626,22388,21762,21744,20790,21012,
+21193,20688,21045,20565,20817,20978,20571,15380,
+20403,27376,29348,32476,32670,32823,32996,34412,
+33126,33044,34374,36834,35769,33836,33315,33103,
+33051,32934,32988,32829,30615,29194,27258,26310,
+24369,23101,21907,21780,21140,21096,21069,21239,
+21207,21129,21036,20992,20984,22301,25060,26215,
+27107,25425,26780,25416,23880,23743,21791,21592,
+20539,18056,17886,17974,19000,21352,22649,23298,
+26803,29881,25019,24042,24117,32901,28073,25815,
+29951,26247,25425,23968,21360,18033,18364,18048,
+17978,17854,17519,17310,17489,18642,17923,17628,
+18348,18399,18314,17859,18332,18894,19668,17814,
+20197,20916,20700,22033,23364,22507,23097,22497,
+21624,21652,20402,20385,19479,20799,19224,18469,
+18037,17123,17047,17280,17457,17127,14993,15582,
+14856,15202,15237,15429,15207,15619,15724,15571,
+15209,15306,15593,15915,16073,16053,16332,17128,
+17096,17434,17679,18043,18426,18799,18948,19177,
+19233,19229,19112,19047,19020,19017,19191,19182,
+19599,20312,20856,22146,27753,32435,33000,33084,
+33060,33108,33112,33145,33192,33141,33316,33357,
+33410,33630,33444,33898,33814,34032,34359,34208,
+34038,33938,33894,33887,33802,33819,33848,34160,
+33786,33784,33921,33917,34097,34135,33854,33774,
+33769,33742,33921,33741,33663,33677,33699,33702,
+33700,33932,33792,33854,33997,34123,34232,34380,
+34320,34245,34128,34056,34051,34002,33914,33918,
+33845,33876,33864,33789,33822,33831,33842,33870,
+33836,33843,33841,33881,33887,34068,34032,34152,
+34226,34620,34665,35226,35403,35480,35858,36219,
+37313,36138,35220,34938,34972,34857,34668,34734,
+34650,34831,35045,34768,34827,34578,34342,34239,
+34179,34170,34255,34245,34230,34309,34443,34656,
+36015,35119,36168,37526,42561,36677,39519,37609,
+34662,32841,32983,35044,33233,32853,32922,34621,
+36281,34041,33226,31813,31490,30498,28191,26853,
+26780,27552,26918,26814,23592,25169,23345,26177,
+26364,25807,24480,25692,23995,23649,21817,21837,
+22202,22767,25424,24024,22925,19911,21576,19773,
+19993,20182,20260,20319,20444,20524,20514,20592,
+20729,20722,20793,20766,20810,20724,20686,20560,
+20485,20505,20403,20578,22275,24324,27159,28034,
+28925,27042,27699,32251,32855,32965,35658,36093,
+35626,35390,35712,35657,35450,35087,33834,33336,
+33036,28521,23507,22673,22754,22736,22948,23064,
+23319,23354,23433,23459,23542,23656,23712,23786,
+23764,23846,23991,24159,24180,24197,24107,23746,
+27866,32989,30860,27273,27920,30030,26965,26325,
+28846,32801,32919,32718,32970,33774,34957,33261,
+32981,32964,33249,33514,33539,33108,33041,33008,
+33054,33100,33189,33414,33324,33430,33435,33503,
+34785,33574,33059,32193,25690,24747,24735,24580,
+26811,24652,20026,20104,20242,19637,21387,19953,
+19994,20323,20759,21795,22356,23568,21851,18606,
+25612,33567,33039,31318,30150,32955,32991,33354,
+32533,27726,20960,13662,17818,18603,18297,17923,
+16144,15755,15508,15283,14835,15279,15469,15503,
+14936,15454,16209,16619,18812,22335,19135,18432,
+16904,17954,18667,19189,18887,18480,18545,18312,
+18631,19338,19579,22108,25012,22205,21897,23440,
+20810,32237,25205,19859,6024,7548,15006,16497,
+16374,15816,15460,15921,15006,15647,15441,14985,
+14978,15060,14963,14931,14706,14584,14726,14747,
+13958,14919,14944,15217,15834,16010,15804,15837,
+16510,15921,18791,25829,16627,24738,16969,18725,
+18240,18740,17545,17654,17818,17540,18287,17988,
+18145,16486,16853,17334,16901,16434,17150,16685,
+16442,15824,15772,15456,15282,16059,16452,19808,
+16499,16322,16304,15828,15425,18241,21461,16059,
+16116,15685,16375,17727,18355,17765,17928,17320,
+16775,16270,15875,16192,16190,16149,15952,16788,
+15810,15497,15237,16080,15243,15710,16691,21535,
+19796,19309,17673,23524,20349,17848,16400,16305,
+16738,15885,16350,16012,16011,15856,15822,16275,
+16387,16179,16686,16572,16243,16195,15373,15773,
+15831,16533,16384,16424,15901,16554,15426,15204,
+15293,15947,19296,17202,17437,18443,17907,17377,
+16825,17377,17292,17064,17544,17333,17730,17844,
+18467,17639,17891,17827,17961,18081,18492,18455,
+18528,18747,18580,18669,19188,18987,19269,18364,
+19679,18227,18527,18184,18546,18402,18117,17971,
+17929,17964,17810,18357,18208,18495,18602,18921,
+18792,18927,18789,19111,19193,19536,19458,19475,
+19600,19275,20127,20304,19851,20164,22088,22158,
+19822,20205,20905,20520,20471,20793,20667,20422,
+20709,20748,20934,21241,21468,21322,21004,21333,
+20901,22141,20910,20226,21697,21355,22206,22020,
+22238,21843,21873,22637,23112,23136,23376,24046,
+23676,23654,23766,22546,22272,22935,22749,23469,
+22850,23073,22989,23149,22449,22659,22075,20243,
+21396,21030,21007,20673,19476,16136,19874,26406,
+32706,32869,32564,32890,34042,35929,34298,35946,
+33360,34754,34751,35197,34526,34840,33753,33123,
+33056,32982,32942,32913,30917,32013,30024,29076,
+25274,23501,23960,28561,20938,20901,20862,20882,
+20949,20910,20964,20728,20947,20808,20643,20415,
+20218,20006,19109,18337,18237,18219,17919,17883,
+17848,17823,17754,17520,19014,21079,22107,23070,
+27777,30062,27182,23949,24111,24636,30651,27327,
+31466,27382,25218,22996,19049,18437,18081,17937,
+17589,17319,16901,16881,17525,17427,17538,17647,
+17847,19099,18510,17959,17902,19264,20484,18699,
+20710,20554,22099,22171,23454,23529,25213,22761,
+20881,21056,20058,19760,19193,18532,18000,18151,
+18030,17339,17519,17324,17313,16877,15096,15665,
+15937,15076,15120,15723,15506,14787,15715,15520,
+15639,15804,16149,16134,16316,16155,16620,17107,
+17497,17747,18093,18514,18873,19171,19550,19707,
+19705,19641,19642,19551,19287,19286,19650,19679,
+20141,20928,21735,23139,26850,32770,32637,33097,
+33109,33063,33097,33075,33140,33180,33216,33222,
+33447,33782,33438,33695,33684,33816,33982,34038,
+34090,34058,33874,33814,33786,33819,33816,33888,
+33961,33745,33912,33954,33975,33912,33849,33873,
+33822,33776,33778,33675,33696,33762,33727,33721,
+33900,34126,33785,33994,33944,34035,34146,34242,
+34315,34335,34227,34168,34182,34013,34077,34042,
+33900,33906,33819,33792,33852,33888,33931,33906,
+33846,33836,33886,33910,33986,34042,34035,34098,
+34276,34539,34983,35292,35827,35531,35622,35972,
+36667,35992,35310,35481,35062,35052,34887,34956,
+34871,34733,34786,34606,34838,34070,34263,34201,
+34160,34165,34338,34233,34236,34578,34704,34855,
+34759,35098,38430,35821,36606,38246,40191,40005,
+33103,32893,35408,33779,32988,32960,32700,36762,
+37521,37404,38586,35733,34737,33969,33486,31442,
+29321,29121,27189,26665,26619,25524,25940,21407,
+26581,25875,25647,24284,24701,23894,23896,23027,
+23306,22902,22862,22716,21781,24372,19926,19932,
+20198,20289,20421,20592,20460,20705,20730,20751,
+20838,20877,20893,20957,20927,20888,20824,20719,
+20656,20688,20609,20955,22308,24672,27192,27859,
+30618,27146,29950,32462,32637,33149,34997,35076,
+35061,35037,35163,35252,34876,34563,34657,33138,
+32968,24228,23060,22566,22824,22908,23099,23292,
+23331,23388,23534,23676,23727,23811,23916,24014,
+23963,24105,24219,24375,24268,23997,24273,24154,
+25454,32614,32927,28507,30113,29392,29152,29982,
+32459,32547,32850,32883,32997,34302,34119,33078,
+33006,33006,33013,33204,33246,33091,33061,33143,
+33289,33252,33243,33445,33281,33379,33655,34017,
+34299,34570,32920,31955,26553,25254,24699,25500,
+25983,27205,22824,20287,20008,19997,23557,20245,
+20124,20166,20541,20651,21093,22200,19191,23049,
+33126,31689,33637,32343,33411,32990,33071,33430,
+33602,27782,17254,14877,16587,18047,18837,18952,
+18444,15787,16066,15897,15242,14994,15393,15501,
+15811,15911,16418,17935,19119,21799,18882,18144,
+17637,16683,15967,17634,16571,16839,17394,18519,
+18151,18417,19117,20201,22667,25596,21125,22250,
+22170,28569,28029,21876,15450,9632,18077,15366,
+16763,15423,15396,15157,14823,14778,14770,15023,
+14680,15048,15005,14877,14778,14760,14867,14896,
+15170,14730,13426,20613,14715,15610,16096,16238,
+16285,17122,19216,17352,16572,16488,18907,26845,
+21043,19146,17157,17757,17319,17660,24030,23754,
+19125,16820,17562,17037,16500,16435,16188,15892,
+15949,15785,15643,16441,15996,16706,20391,21164,
+18552,16587,16095,15689,15774,15840,15694,14754,
+16025,16768,16457,16419,17136,17176,17568,16902,
+16493,15819,16179,16185,15612,16275,16371,15624,
+15667,15277,20628,17574,23721,17770,16827,19942,
+21184,22984,17022,17301,26290,17648,16881,16659,
+16109,16108,16458,15909,15839,16169,16109,16093,
+15983,15869,16344,16211,15981,15726,16010,15883,
+16053,16352,17320,15537,15918,16035,14715,15732,
+15449,16330,16263,16351,17713,17004,16782,15820,
+16103,15484,17265,17833,18084,17217,17977,17435,
+18048,17775,18160,17815,18033,18256,18328,18389,
+18378,18626,18685,18793,19060,18711,18783,18802,
+18525,18354,18269,18093,18390,18361,18100,17788,
+17889,17669,17872,18170,18502,18904,18582,18888,
+18937,18980,19227,19433,19368,19329,19656,19056,
+19397,19875,19782,19779,19862,20610,26678,19907,
+20943,20141,20835,20973,20544,20566,20648,20695,
+20637,21036,20988,20997,21377,21167,21306,20310,
+21484,21684,23304,23329,21718,22121,23056,21295,
+21972,21358,22095,22624,23013,23265,23286,24285,
+23954,23828,23411,23223,22621,22479,22717,22727,
+22428,22334,22147,23909,22984,22458,22154,22373,
+21530,21368,20376,16642,19059,27561,30846,32835,
+33036,33211,33546,36065,35043,35122,35508,37851,
+35991,35907,35284,34894,34893,33540,33854,33161,
+33027,32977,32988,32941,31082,32593,29793,27832,
+26232,25218,26991,28302,24879,20816,20697,20799,
+20826,20744,20649,20860,20688,23697,22979,22784,
+23522,20817,22035,20394,19242,18488,19017,18084,
+17521,17292,17816,18069,18184,21088,21701,22799,
+26170,28773,27495,24274,24170,24462,29438,26756,
+25017,22160,21286,22224,17985,17358,17458,17693,
+17518,16917,16820,17073,17070,17097,18045,17688,
+17721,18381,18590,19081,19623,18192,19071,20584,
+21606,20696,21091,22357,23956,24509,25531,22092,
+21883,20719,19963,19315,20128,19720,19209,18311,
+17642,17049,17013,16644,16562,16251,16305,16190,
+16439,15731,16032,16689,15975,16429,15907,14607,
+15212,15856,15934,16215,16635,16713,16947,17199,
+17562,17889,18232,18837,19437,19812,20280,20607,
+20344,20397,20358,20374,19956,19746,19980,20432,
+20992,21740,22858,25003,28917,32958,33037,33052,
+33042,33098,33104,33126,33127,33139,33234,33142,
+33509,33189,33906,33914,33832,33847,33821,33967,
+34088,33984,33850,33840,33828,33830,33816,33821,
+34344,33829,33744,33959,33903,33892,33906,33833,
+33918,34296,33812,33850,33759,33802,33735,33864,
+33804,33807,33817,34128,34077,34173,34236,34316,
+34311,34395,34395,34371,34520,34300,34215,34226,
+34078,33907,33855,33844,33906,33990,34003,33982,
+33891,33862,33861,33915,33933,33927,34047,34110,
+34182,34492,35482,35601,36141,35727,35569,35754,
+37036,36287,36594,36174,35328,35124,34881,35267,
+34575,34661,34610,34442,34597,34373,34238,34185,
+34178,34201,34232,34227,34326,34520,34689,34578,
+34651,34978,36033,35966,38374,38054,40037,38968,
+32711,33629,33973,32732,32295,32733,33169,35836,
+40361,41054,38898,38852,38766,37975,35411,33826,
+34530,33803,29883,27804,26286,26143,26850,28666,
+26307,27684,25501,22722,24978,23959,24593,24600,
+25552,23712,24213,22577,21709,21174,20686,20525,
+20200,20415,20564,20753,20604,20862,20904,20862,
+21004,21081,21102,21176,21114,20967,21038,20809,
+20823,20832,20817,20778,22678,24807,26502,27945,
+26844,27037,31912,32839,32742,34112,34857,34875,
+35218,34733,35056,34251,34332,34129,33558,33076,
+32988,25007,23799,23372,23098,23194,23279,23448,
+23467,23268,23559,23890,23954,23998,24112,24146,
+24164,24183,24215,24543,24647,24577,24637,24695,
+24312,27985,31967,30274,32383,32609,32703,32553,
+32643,32740,32872,32949,33545,34945,33804,33020,
+33051,33033,33078,34440,34932,33792,33218,33189,
+33261,33250,33368,33304,33241,34194,33889,34926,
+35659,33877,32916,31989,30208,28125,26707,26320,
+24960,26196,23017,19948,20352,19755,19189,20478,
+20115,20196,20109,20736,21363,20884,18737,25524,
+28875,33236,33015,33111,32887,33213,32983,31693,
+31603,22522,14401,15540,16866,19290,17491,17028,
+16662,16642,16371,16206,15543,15157,15852,15460,
+14651,16518,15993,17439,20533,19983,17053,18691,
+18005,18690,18543,17362,18906,19578,19903,19313,
+18348,18277,18409,19248,20646,25861,22155,21939,
+20810,24950,31182,22772,18379,15500,5160,22273,
+16180,16179,16107,15369,15107,15540,14886,14979,
+15037,14779,14877,14866,15393,16279,14452,17928,
+24831,28752,16603,16137,14736,16374,17628,16292,
+16844,16999,20265,16926,16766,16233,20623,19576,
+17449,17251,17089,19945,19095,16374,24362,19858,
+17319,18832,20394,18332,16386,15925,15933,16296,
+16758,15969,16260,16147,17594,16149,17219,25652,
+20987,19533,17347,17144,17612,16471,16239,16484,
+15354,16673,16334,16705,17839,18579,17383,16762,
+19009,16194,15831,16013,16152,15861,16289,16564,
+15409,14948,15888,16064,15743,16655,16637,20599,
+17151,17390,21161,23055,18792,16525,16322,16239,
+16330,15849,16070,16356,16265,16158,15986,15878,
+16116,16283,16172,16119,16180,15834,15816,15900,
+16166,16338,16583,16182,15710,15553,15552,15621,
+15774,16458,16471,16884,17306,17245,17232,17335,
+17083,17484,17185,17966,17369,15345,15045,17559,
+18046,17949,17454,18229,18120,18274,18585,18432,
+18492,18703,18772,18627,18513,18291,18267,18582,
+18248,18729,18501,18257,18378,18467,18005,18221,
+17842,17751,17947,18087,18137,18270,18702,18822,
+18696,18951,19260,19304,19412,19404,19631,21186,
+19303,19428,20163,19546,19591,20094,20661,20430,
+20669,20256,20608,20472,20632,20675,20553,20756,
+21232,21730,21440,21594,21043,21373,21515,21567,
+21441,22002,20568,21984,21180,21606,21323,20908,
+21342,22038,22825,22343,23164,23333,23719,24324,
+23385,22896,23137,22646,22435,22120,22278,22470,
+22887,21950,22691,22966,22080,22820,22281,22347,
+22055,19201,15552,24234,31950,32164,32876,33108,
+36126,38444,37695,36458,36151,34977,35562,34752,
+35208,34681,35280,35774,35163,33695,33204,33107,
+33197,32993,32979,32988,32881,31434,27891,26827,
+26316,26839,26373,26712,28813,20876,21787,20640,
+20610,20556,20541,20540,21361,25201,23953,23048,
+22734,20784,20907,20297,20964,20151,19306,19079,
+18488,17847,17987,18087,18363,20238,21482,22989,
+27245,28251,28182,24396,24572,27606,32060,24235,
+24408,23327,20880,21947,17880,16877,16617,16419,
+16585,16574,16600,16772,17160,17244,17475,17430,
+17199,17820,17266,18294,21285,22984,24066,22221,
+22624,22321,22443,22791,22321,24147,24601,22305,
+22411,21179,18868,17347,18437,19236,19284,17508,
+18414,17670,16788,16471,16368,15069,17507,15518,
+16158,17490,16402,14794,15423,15231,15334,15325,
+15664,16053,16122,16300,16203,16656,17043,17268,
+17649,17718,18309,18904,19178,20501,26151,27184,
+22524,22924,21717,20801,20289,19974,20431,20946,
+21081,22560,23176,25823,29473,33039,33077,33080,
+33114,33152,33111,33076,33139,33169,33285,33084,
+33200,33369,33843,33907,33776,33891,33780,33788,
+33847,33916,33826,33813,33801,33823,33812,33813,
+34422,34804,33883,33795,33783,33761,33909,33791,
+33867,33669,33855,33816,33670,33705,33717,33745,
+33842,33930,34060,34203,34288,34194,34157,34332,
+34341,34457,34363,34610,34736,34498,34296,34023,
+33944,33914,33966,33957,33989,34088,34095,34012,
+33934,33875,33847,33897,33915,33938,34023,34104,
+34212,34392,34941,35704,35994,35620,35640,35761,
+35872,36168,36627,36318,35519,35281,35219,35025,
+34704,34695,34536,34515,34431,34473,34309,34191,
+34148,34179,34194,34375,34410,34632,34617,34455,
+34566,35125,35819,36196,36691,38787,37921,36558,
+33037,32997,32804,32813,31757,32868,33303,37860,
+39972,39296,38441,37389,36488,36111,37687,36001,
+38368,38277,33312,32859,31910,29882,30345,28924,
+21900,26828,26919,26182,25136,25376,24478,24675,
+26194,25242,23053,20716,20964,19945,20899,20848,
+20472,20601,20715,20753,20829,20902,21058,21098,
+21129,21297,21323,21318,21294,21156,21008,20988,
+21108,21100,21085,21978,23139,24484,26364,26835,
+26913,30171,32597,32794,32991,34401,34639,34650,
+34860,34926,34341,33944,33666,33454,33692,33194,
+32519,26043,25173,23782,22718,23539,23413,23534,
+23715,23529,23757,24116,24198,24186,24220,24396,
+24375,24390,24549,24780,24744,24735,24915,25024,
+24915,24563,30528,32934,32776,32802,32798,32706,
+32613,32614,32830,32822,33867,34127,34845,33126,
+33017,33075,33943,33897,33677,33534,33504,33461,
+33456,33483,33483,33288,33559,33360,33771,35388,
+37119,34050,32385,31869,31705,29901,27643,28209,
+27343,26435,26453,23095,20058,20126,20097,20779,
+20096,20065,20151,20775,20903,20580,20929,25367,
+33050,32983,34185,32769,32977,32988,31529,30942,
+28740,16160,15479,15426,16159,17049,17564,16776,
+15655,15307,16719,16319,16374,16052,15657,15141,
+15187,17028,19056,21013,21676,20762,18392,18163,
+17331,17920,19343,17599,18939,19686,20220,19484,
+18319,17927,18233,19092,20042,22127,22241,22084,
+21390,22572,28314,27604,19321,18796,12931,17049,
+15781,15903,16407,15709,15200,14940,15002,14656,
+14894,14865,15349,15276,16364,16056,14840,14157,
+14532,16223,15424,15555,15407,15796,17557,16640,
+18707,22442,16704,16644,17250,16476,16259,20516,
+16771,17212,18906,20001,16896,18522,16074,16019,
+16888,20211,23118,17571,16128,15774,15947,16464,
+15924,17440,16306,16615,16682,22582,18299,20505,
+20778,20265,19284,19427,17646,17112,17409,18445,
+16871,16719,17191,16887,18264,18952,17458,16032,
+15824,16125,15667,15900,16189,15876,15523,15630,
+18060,24021,17503,16149,16266,16339,18682,23097,
+18582,17369,20472,16707,16767,16966,16491,16356,
+16170,16056,16096,16107,16491,16292,16359,16257,
+16254,16204,15889,15820,15798,16676,16818,16518,
+16511,16373,16542,16293,16845,15557,15822,15947,
+15930,16068,16353,16740,16856,17055,16944,16797,
+16788,17022,16880,17376,16690,16935,16748,17073,
+17015,16848,16204,15954,17072,18960,18148,19028,
+18672,18461,18273,18531,18602,18329,18167,18095,
+18279,18264,18583,18821,18162,17958,17853,17888,
+17839,17801,17808,17881,18184,18186,18366,18473,
+18517,18873,19113,19281,19728,19697,19504,19984,
+19618,19683,20016,20235,20330,20301,20382,20298,
+20565,20878,20666,20730,20991,20889,21062,21151,
+21652,21446,21605,21381,22118,21633,21331,22302,
+22533,24351,23081,23061,21912,22088,21472,20645,
+21112,22911,22149,23788,22775,23889,24142,23619,
+23710,23456,22185,22485,22486,22528,22577,22596,
+22690,22112,22164,22164,20815,20168,17974,17652,
+19368,24276,28891,32235,32421,32964,33117,39858,
+39810,38271,37784,38319,35395,33832,35417,34983,
+33846,35069,36331,35737,34698,35735,33387,33178,
+32997,32951,32988,32916,32988,32355,29570,28002,
+26790,26139,26181,26111,26214,23604,22434,22921,
+23399,20510,20510,20550,20991,25940,23454,23366,
+21921,20442,20360,20988,21653,21193,20024,19437,
+19066,18267,18110,18429,19125,19566,20988,22653,
+27353,28003,25467,24844,25506,32145,28511,21086,
+20021,20460,22336,19946,17687,16812,17074,16507,
+16478,16359,16164,16183,16473,16452,16698,16861,
+16659,22724,20498,25687,21190,24250,21069,20845,
+22174,22063,22914,22409,22428,19895,19155,21602,
+21588,20394,20289,19065,18903,18915,17640,17579,
+18556,17727,18335,16524,16572,16794,18397,18279,
+17454,16795,16023,16046,15865,16939,16079,16257,
+16355,16392,16418,16626,16846,17055,17199,17731,
+17943,18239,18880,19151,19090,20472,22387,23797,
+33113,32047,25002,21091,23907,20300,20772,21141,
+21743,22264,23278,24975,27639,31916,33151,33126,
+33165,33094,33051,33097,33211,33265,33136,33220,
+33238,33423,33214,33910,33714,33956,33900,33916,
+33864,33830,33930,33995,33868,33877,33811,33786,
+33919,33799,33940,33894,33976,33825,33793,33915,
+33747,33762,33915,33935,33988,33857,33819,33771,
+33873,33988,34371,34289,34423,34300,34329,34308,
+34364,34424,34352,34437,34453,34214,34062,33915,
+33909,33962,34027,34111,34056,34173,33918,33935,
+33915,33866,33841,33821,33850,33912,33963,34080,
+34202,34352,34583,35424,35876,35507,35489,35736,
+35745,35619,36526,35517,35898,36608,35425,35111,
+34566,34491,34865,34446,34506,34790,34533,34188,
+34331,34155,34195,34310,34370,34570,34494,34393,
+34598,35124,35745,36492,35594,39480,37735,32846,
+32972,32875,32927,32811,31692,33053,33564,37111,
+40041,39250,36492,36060,35726,35499,36857,37027,
+36749,36275,36741,37713,36132,34747,33203,32727,
+31668,25942,26315,25271,24773,24831,23985,25113,
+24162,22680,22015,22107,22101,22952,20133,20702,
+20532,20561,20761,20880,20941,21107,21243,21282,
+21291,21454,21540,21573,21462,21318,21204,21281,
+21374,21258,21540,22056,22972,24294,26039,26309,
+26952,30018,32762,32863,34512,34602,34820,34884,
+34442,34367,34297,34516,33563,34793,33575,33160,
+32988,29149,26022,25570,24527,24182,23664,23654,
+23800,23909,24039,24243,24358,24385,24523,24624,
+24624,24595,24827,24922,25032,25004,25052,25195,
+25086,25010,25325,32803,32855,32876,32934,32855,
+32847,32587,32756,33015,34398,36552,34307,33192,
+33054,33256,33260,33631,33493,33542,33534,33404,
+33376,33359,33342,33319,36773,33414,34953,37012,
+34842,33071,32970,31860,31951,30596,29676,29164,
+27750,24414,21612,22228,21015,19815,20072,20271,
+21027,21550,23811,30861,24403,22135,19748,26855,
+33754,33264,34500,29806,26985,25107,27672,26904,
+17376,19425,16626,16684,18841,16344,17345,16653,
+17121,16362,17268,16184,15506,14748,17202,19506,
+15905,18746,18235,18947,19641,22348,18395,18524,
+19538,16997,16986,18579,18335,18143,15473,19716,
+18246,18069,18483,19474,20163,22100,23751,20047,
+20778,22398,24777,32655,22176,19396,17073,13071,
+21243,15198,16425,19219,15552,15297,14667,16755,
+15813,14779,15085,16370,19494,18622,18601,15117,
+14634,14978,14994,15075,15438,22100,18622,16221,
+18043,19190,16915,18393,17319,20413,21176,18033,
+18190,17465,18918,17820,16533,15759,16517,15875,
+16186,19529,17338,15948,16873,15984,16656,16412,
+16488,17484,16675,15648,16248,17484,17823,19757,
+21682,21141,20205,19797,18929,17262,17070,16976,
+17109,17657,18287,17846,18830,19018,16096,16977,
+18114,15923,16091,16983,16731,20075,15804,16026,
+20388,21468,16734,21963,22655,27627,17550,17279,
+19776,16761,16779,16837,16878,16896,16682,16263,
+16365,16414,16389,16179,16413,16062,16474,16271,
+16027,16200,15967,16071,16669,16809,16871,16934,
+17601,16945,17081,17153,16726,16267,16414,16402,
+16223,16243,16665,17019,17288,17216,17256,16944,
+17139,17000,16645,16715,16343,16451,16402,16781,
+16895,16480,16559,17058,17455,17075,16905,16202,
+16408,17668,18427,18356,18501,18716,18564,17946,
+18200,17705,18925,18003,19899,17700,17794,18026,
+17963,17727,17892,18176,18044,18171,18304,18221,
+18410,18680,18983,19431,19518,19598,19824,19862,
+20001,19740,20803,20240,20529,21111,21090,20778,
+20789,21058,21673,22032,21115,21354,21163,21452,
+21627,21507,21828,22069,21754,21736,22198,22008,
+23876,21738,23028,23208,22014,21418,21786,21313,
+20791,21336,22470,22521,23625,24582,24129,22600,
+23563,22924,22635,22080,22152,22473,24003,22629,
+21867,21077,18837,21670,26252,27191,33088,33153,
+32059,31388,32253,32724,32866,33513,37132,34895,
+36769,35431,34055,34257,33624,34792,33474,32994,
+33084,33435,34097,34851,33423,34206,33094,33003,
+32920,32949,32988,32931,32819,32758,30083,29400,
+30250,26788,27246,26174,26458,24594,24775,24823,
+22899,24081,21459,20262,20513,22195,25446,22652,
+21612,21444,20857,21446,21690,21692,20871,20055,
+19026,18711,18621,18893,19617,20115,20981,22400,
+27366,27038,26826,26679,27464,31005,27533,18226,
+21165,19944,17103,15923,16231,16755,17051,16656,
+16169,16517,16538,16512,16473,16635,16430,17393,
+16826,18876,18249,18442,20973,20835,20958,23239,
+22419,23292,23710,22976,22257,21031,21759,21342,
+20159,20008,18993,19983,19448,18431,16981,16928,
+16532,15943,17300,18510,16861,16716,18357,21672,
+16986,15808,16496,16143,16446,16880,16373,17490,
+16653,17619,16524,17016,17322,17268,17401,18233,
+18173,18502,19064,19429,19420,20074,20635,21136,
+21738,30990,26631,26327,21441,21229,21280,22302,
+22439,22701,23040,24131,29322,29122,32834,33107,
+33051,33063,33124,33174,33190,33109,33132,33119,
+33425,33517,33698,33604,33521,33591,33689,33687,
+33855,33789,33819,33912,33859,33916,33802,33798,
+33794,33820,33840,33879,33949,33917,33967,33928,
+33831,33868,33918,33978,33955,33914,33798,33786,
+33957,34109,34338,34339,34368,34366,34363,34368,
+34396,34407,34368,34371,34155,34188,34196,34110,
+34005,34086,34104,34105,34017,33973,33866,33837,
+33805,33876,33947,33811,33870,33882,33931,34069,
+34189,34320,34499,34892,35404,35501,35328,35559,
+35421,35326,35517,36235,35298,35413,35252,34916,
+34437,34330,34635,34259,34461,34896,34360,34158,
+34320,34248,34362,34516,34422,34326,34265,34301,
+34371,35076,34665,35184,35735,38365,33236,32838,
+32984,32961,32862,29442,32972,33021,33976,39171,
+40091,36897,36115,35877,35657,35484,35294,35112,
+35502,35916,35640,35294,34713,35135,35177,33909,
+32955,26995,25820,25492,24833,23914,23967,24096,
+23910,23277,22216,20891,20725,20546,22296,25786,
+20676,20722,20937,20984,21087,21257,21381,21466,
+21567,21664,21681,21721,21492,21346,21511,21537,
+21622,21626,21705,21813,21976,24121,26261,26649,
+27765,31029,32827,33181,35311,34906,34845,34745,
+34806,34143,34189,34059,33902,34739,33447,33177,
+33018,32873,32004,28846,27412,24987,24078,23233,
+23937,24061,24198,24411,24567,24594,24726,24816,
+24864,24855,24994,25114,25253,25274,25404,25488,
+25389,25320,25247,31943,32989,32938,32993,32892,
+32687,32538,32815,33046,33381,35459,35218,33178,
+33062,33389,33510,33712,33602,33477,33504,33499,
+33411,33392,33561,33464,33545,33852,36663,34065,
+33210,32871,32937,31410,30782,30828,31827,30311,
+30411,27839,24884,26932,32004,29109,20296,20335,
+20594,20353,20418,20748,21037,22461,18643,28235,
+33548,33164,35130,31833,24567,17007,18095,22166,
+27391,24726,21546,20419,18102,18768,18294,17664,
+17050,16633,15959,15822,17088,16587,13634,18969,
+16291,15494,15488,18733,18221,21934,18863,18087,
+18540,17817,18984,18609,17323,16767,17421,15390,
+18492,18314,19101,19154,19986,23064,23384,22144,
+21759,19703,22452,26497,24627,16677,21834,11333,
+18399,24298,19017,16404,15861,15509,15036,16854,
+25127,18156,15405,16195,16857,17535,29048,17778,
+14693,15057,15235,15357,15374,15792,15538,17991,
+23010,16077,16144,16642,16632,18189,21702,16616,
+17139,17337,16956,17121,16605,17737,17742,16242,
+16306,16533,16188,16269,16134,16401,16022,16325,
+17265,21140,17079,17166,16966,17122,18804,21777,
+23072,21204,20912,20516,20889,17422,17189,16592,
+17748,17331,17752,17451,18383,17796,18161,19391,
+20067,16406,15542,16185,16266,16300,16551,15262,
+19789,17894,16902,19188,17771,17994,17965,18015,
+20307,17101,16941,16875,17001,16833,16656,16191,
+16938,16508,16280,17665,20868,15819,15670,16071,
+16014,16260,16296,16456,16940,18101,17015,19357,
+18975,19474,17724,17232,17372,16927,16338,16553,
+16753,17025,16571,16974,17372,17563,17357,16153,
+16546,16642,16876,17044,16958,16500,16481,16713,
+16572,16684,16388,16685,16856,16902,17091,16829,
+17113,17019,17155,16692,16071,16812,18432,18755,
+18540,18290,19994,18520,17958,20097,18128,17522,
+18453,18006,18309,18315,18364,18190,18149,18277,
+18558,18898,19146,19470,19445,19818,19782,19959,
+19889,19866,22565,21050,21025,20810,21180,21653,
+21162,21123,21279,20986,21446,21855,21263,21185,
+21488,21068,21458,21707,22164,21584,22356,22391,
+24306,23670,22273,22563,21980,26763,24495,24416,
+21671,20395,23362,24696,23986,24443,23697,24042,
+22233,22077,23937,23000,22470,22099,21096,19218,
+17700,24655,32646,32921,33483,38769,38633,41161,
+34768,33297,33000,33110,36108,34715,34566,37763,
+37582,34001,33568,33414,34119,34020,33022,32982,
+27195,28632,28835,29067,31320,29463,30414,30716,
+31591,32988,32813,32820,32864,32764,31197,32364,
+29828,29382,28941,27523,26295,26354,26988,27089,
+30052,27576,24612,22583,20361,20109,24145,23550,
+23960,21269,21006,20930,20959,20922,20578,20137,
+19479,18663,19530,19713,19728,20412,20730,21889,
+27993,28158,27031,28356,33429,32900,31080,18978,
+17895,17828,15572,16365,17058,19147,19949,17925,
+18809,16976,16337,16421,16566,16908,17354,18123,
+18429,18104,20676,23163,22047,21741,21198,22563,
+21488,23116,26460,23937,22116,21709,21882,19582,
+18926,19116,19764,19680,19248,18993,19293,17459,
+18164,17272,17874,17358,17987,19501,19430,17564,
+17436,17726,16599,17286,17499,17391,17395,17250,
+17205,17898,17299,17957,17555,17611,17807,18220,
+18421,18846,18997,19511,19935,21406,21856,24173,
+21839,24341,32936,26092,21530,21700,21667,22107,
+22284,22665,22946,23888,24949,27012,32501,33075,
+33058,33106,33191,33103,33063,33094,33199,33183,
+33864,33439,33594,33818,33515,33531,33597,33618,
+33634,33750,33914,33940,33925,33916,33923,33927,
+33869,33758,33773,33777,33929,33871,34106,33910,
+33907,33877,33972,34089,33938,33991,33923,33942,
+33882,34071,34149,34273,34368,34331,34375,34376,
+34440,34509,34482,34508,34322,34349,34404,34232,
+34234,34242,34191,34070,33975,33916,33908,33837,
+33756,33828,33837,33745,33761,33867,33930,34072,
+34177,34290,34512,34716,35340,36278,35704,35345,
+35306,35110,35217,35250,35429,35020,35263,34847,
+34541,34206,34225,34209,34519,34698,34819,34032,
+34424,34261,34283,34317,34256,34196,34203,34260,
+34312,34621,34273,36115,36441,35515,32898,32957,
+32995,32868,30106,31708,32935,32937,33996,37112,
+37236,36380,36616,36318,35811,35733,36150,36691,
+36206,36041,35231,35039,35144,34716,34153,33510,
+32990,29547,27643,26112,25031,24318,24422,23227,
+23210,21602,21259,21048,22260,21993,22364,26123,
+20919,20908,21012,21157,21219,21360,21558,21669,
+21783,21875,21870,21929,21783,21692,21845,23770,
+22794,21887,21993,21945,22032,24307,26208,27745,
+29727,32701,32895,33264,35044,34785,34714,34602,
+34572,34554,34099,34001,34146,35402,34114,33352,
+33395,33054,32991,32733,30759,26814,24697,24128,
+23592,24014,24413,24595,24795,24864,24966,25074,
+24969,25003,25303,25494,25512,25565,25592,25662,
+25602,25371,25635,29772,33140,33033,33021,33038,
+32832,32593,32776,33238,33175,34137,33815,33166,
+33125,33324,34257,35723,33694,33528,33453,33426,
+33655,33617,33393,33502,34363,35080,34774,34165,
+32990,32679,32844,30359,29403,29714,31259,32991,
+31785,29676,25805,25286,28952,29979,20776,20544,
+20634,20630,21239,21383,20881,21266,20021,30457,
+32656,35307,36201,34618,32148,18840,19416,21326,
+24201,24126,22581,22494,20001,18219,19935,16486,
+15259,15903,16128,16655,19483,17140,17798,16068,
+14868,15029,15819,17723,16563,23256,19005,18538,
+18018,18519,16591,17583,17349,19232,20252,18009,
+17612,18624,18939,19410,20882,27411,25335,22157,
+20643,22713,22000,26387,26771,19589,20514,17529,
+16881,17692,17188,16041,16209,15405,14880,16151,
+15411,15575,15629,16003,16589,15705,16073,15486,
+14911,15079,15193,15239,15260,16168,15280,15702,
+15864,15700,16183,16824,16338,17728,28438,16738,
+17484,17054,16434,17304,15851,16593,18073,16644,
+16282,16488,16200,16362,16555,16056,16634,16605,
+20268,15966,16185,16437,17080,18727,18893,21015,
+21516,21165,21165,21067,19406,17858,17760,17812,
+17693,17441,17418,18645,18069,17350,18105,17439,
+17479,18707,17263,17245,17938,17382,16892,17320,
+17637,17949,17386,17560,21251,22892,17895,24483,
+16983,17097,17067,16991,16890,17181,16185,16299,
+15565,16677,20793,16897,16270,16410,16656,15899,
+16189,16498,16905,16833,18916,17224,18104,17691,
+18346,17994,18599,17781,17412,17220,17247,17106,
+17469,17110,17175,17199,17244,17212,17123,17528,
+17003,16881,17346,17259,17006,16812,16116,16859,
+16580,16740,16480,16588,16396,16495,16611,16616,
+16665,16741,17193,17221,17442,16989,16747,16402,
+16666,16216,16620,17674,17975,18657,17802,18022,
+22728,18508,17963,19390,17613,17952,19413,18442,
+18935,19324,19282,19440,19701,19753,19810,19948,
+20163,20277,20394,20278,21367,21172,21447,21461,
+20855,21022,21172,21485,22131,21945,21545,20930,
+20921,21717,21793,22002,22170,21864,23024,22414,
+22617,22206,24375,23745,22607,22270,22359,23187,
+21129,22982,23612,24721,23804,24480,23802,24348,
+22997,21554,21928,19021,19923,17999,25300,29676,
+32985,33204,33747,33609,35635,40410,37500,37632,
+34808,35261,34106,36762,35313,35192,39736,38792,
+35906,34927,33397,33596,33751,34333,34420,32992,
+32575,24140,20875,16512,26925,29643,28152,30143,
+27773,27402,31052,31386,32280,31817,32826,31284,
+29835,29140,29505,30390,29121,27015,28572,26934,
+28351,26490,24247,23767,20264,20108,20136,23247,
+25788,22392,20865,20231,19784,19231,19623,18846,
+18495,18210,19521,19446,19254,19327,21036,22953,
+28313,28898,29192,31192,30974,27085,16683,18086,
+18390,17250,17256,19973,15449,15482,15422,15561,
+15545,15667,15505,15684,18102,17766,18609,17490,
+18679,19282,21182,20085,19224,21255,20541,21014,
+22880,22071,24369,24749,22225,20917,22419,21219,
+20395,19746,19428,18851,19665,17823,18390,17895,
+17214,17061,17808,17880,16651,17805,16988,17184,
+17627,17157,17079,17640,17450,17796,17391,17403,
+18052,18630,18001,17799,18387,17941,18090,18228,
+18687,19068,19854,20090,20967,26320,32600,28365,
+22951,25122,29686,23303,21792,21894,22291,22514,
+22677,22671,23163,23972,25063,27069,32034,33054,
+33096,33044,33047,33099,33228,33228,33225,33225,
+33712,33438,33909,33923,33684,33557,33585,33582,
+33574,33918,33954,33979,33967,33979,33996,34016,
+34020,33790,33773,33779,34101,33912,34016,33720,
+33924,33912,34014,34377,34304,34272,34169,34113,
+34064,34008,34053,34202,34329,34371,34354,34368,
+34576,34698,34742,34599,34416,34374,34372,34329,
+34361,34416,34470,34215,34065,33953,33895,33853,
+33776,33726,33705,33678,33671,33747,33903,34071,
+34245,34287,34421,34575,34922,35981,35756,35382,
+35109,34945,34967,34867,34915,34803,34929,34656,
+34450,34266,34737,34046,34236,34358,34500,33984,
+34319,34278,34223,34195,34132,34140,34187,34219,
+34284,34581,34011,34692,37431,34353,32844,32898,
+32792,30959,30715,32995,32994,33038,34110,38826,
+39595,37767,36617,35992,35817,35680,36042,35784,
+36030,35777,35772,35843,35999,35752,35052,35021,
+35367,36237,33860,32166,29143,25989,24446,23802,
+23178,21927,20927,23315,22438,21801,22500,25210,
+20994,20975,21152,21273,21374,21507,21648,21847,
+21921,22031,22137,22257,21992,22034,22443,23720,
+22240,22168,21998,22203,22537,23830,26361,28573,
+31920,32886,32795,33732,34602,34776,34709,34754,
+34605,34296,34286,34275,34478,34038,33472,33165,
+33083,33287,33124,33019,33003,30564,25524,24613,
+24357,24239,24697,24651,24991,25125,25203,25290,
+25272,25392,25583,25740,25777,25871,25974,25988,
+25776,25641,25468,26231,32586,33054,33027,33034,
+33010,33012,32834,33068,34865,34210,33308,33145,
+33117,35308,33450,35044,34146,33530,33680,33596,
+33942,33405,33481,33783,33963,34054,33023,32712,
+32551,32657,32905,31085,29103,28542,30585,30627,
+32842,31133,27739,24319,24076,25919,22905,21022,
+21036,22888,20907,21155,21051,22377,21936,27992,
+31077,39112,34255,33184,35438,20667,19472,22301,
+24292,24970,24243,20244,19188,18517,16845,17415,
+17322,17601,16272,17065,18825,17004,16206,16233,
+14734,16113,16265,16349,17003,17766,20319,16983,
+18538,19032,18132,18750,17771,19062,16553,17998,
+18934,18661,18885,19196,20260,25523,26238,21485,
+21732,22917,22359,27747,28302,22172,19102,11865,
+13575,16698,18315,19538,17310,18430,15135,19197,
+21910,15561,15567,16939,22377,18063,18356,15485,
+15446,15434,15469,15669,15357,15582,15453,15836,
+15826,16002,16242,16167,16668,19287,16638,16932,
+16802,16353,17397,20606,16046,17025,19645,16561,
+16629,16881,16428,16614,17760,16077,16940,16840,
+16905,16585,16955,17265,17211,20738,18901,20142,
+20454,20644,20450,21261,19541,18143,18254,17859,
+17974,17015,17790,18084,19463,24734,25133,19097,
+20175,19419,19865,19965,17736,18720,16991,17263,
+17264,17439,17225,17372,17666,17374,20687,21525,
+16870,16941,16923,17907,16995,16781,16710,16867,
+16347,16153,16487,16577,16340,16255,16403,16470,
+16494,16843,17491,17829,18373,18546,18375,19774,
+18090,18189,18070,17847,17429,17490,17582,17403,
+17477,17042,17364,16932,16905,16748,16770,17037,
+16897,16791,16925,17416,17217,16803,16657,16887,
+16956,17330,16773,16512,16482,16394,16667,16387,
+16382,16372,16791,17107,17167,17675,17724,17330,
+17727,18176,17752,17328,17494,17470,17454,16861,
+18888,18503,18053,18022,18366,18994,18240,18525,
+19901,19370,19647,20427,19662,19943,19636,19644,
+19971,20273,20395,20740,20804,21189,21894,21659,
+21332,21096,21297,21813,21222,21638,22524,21332,
+21504,24879,21931,22248,22177,22335,22588,22337,
+23118,23707,23702,22541,23011,21804,22124,22055,
+21786,21999,21867,23750,23889,24159,24006,24625,
+21709,20674,19667,22956,28100,30081,33342,34936,
+35024,35250,37275,38245,39407,38844,40333,37235,
+34457,33558,33356,33300,33987,36207,35006,35535,
+34219,34458,33150,33280,33704,33343,33200,32989,
+32676,22391,21989,20106,18844,18367,21768,24526,
+26502,27034,26822,29322,29548,29412,30147,28184,
+28577,29169,32649,32125,30973,30661,27261,26774,
+28812,28941,25999,23763,21787,20245,19974,20195,
+25905,24003,20861,19368,18088,16492,16573,17442,
+18026,17590,17789,17875,18415,19272,20670,22275,
+30598,31125,31419,31232,32972,28665,17223,18010,
+15885,15480,17849,17586,15828,15786,16506,16643,
+16475,16691,17262,17705,18048,19256,19243,18849,
+18772,18006,19711,20525,19311,19345,21073,20566,
+21228,23355,21886,25338,23686,22636,21977,20172,
+18930,18818,17760,20686,17695,19272,18756,17099,
+17595,17191,16970,17022,16793,17157,17140,18379,
+18085,17227,17988,18407,17901,18164,17822,18096,
+17970,18245,18285,18852,18798,20383,18799,19106,
+19260,19609,19887,21018,22299,29610,24651,22614,
+22477,22691,22913,22974,24642,22429,22787,22882,
+22929,22968,23245,23942,25083,26572,31786,32258,
+33085,33080,33126,33165,33192,33220,33226,33307,
+33668,33513,33594,33757,33680,33577,33587,33599,
+33601,33887,33948,33997,34010,34034,34068,34135,
+34179,33831,33763,33747,33742,33759,33849,33941,
+33917,33985,34053,34393,34437,34483,34372,34235,
+34193,34178,34158,34198,34206,34328,34335,34518,
+34925,35085,34862,34644,34467,34354,34334,34353,
+34432,34521,34534,34363,34200,34034,33900,33878,
+33845,33811,33779,33781,33688,33651,33839,33999,
+34077,34167,34479,35009,36607,36633,36545,35712,
+34856,34797,34804,34732,34662,34579,34685,34451,
+34234,34224,34202,34425,34156,34489,34146,34164,
+34317,34409,34320,34091,34105,34121,34245,34327,
+34579,34427,34059,34386,37391,33577,31886,32477,
+29546,29889,32964,32980,32948,33251,36411,38260,
+38091,36495,36116,35725,35426,35430,35588,35339,
+35310,35259,35190,35128,35339,35571,35625,35511,
+35498,35214,35177,35519,35339,36811,32481,25616,
+24011,22937,21438,25758,24193,21942,22124,23214,
+21153,21115,21254,21469,21432,21495,21715,22012,
+22089,22323,22482,22582,22266,22293,22705,22448,
+22347,22369,22365,22693,23118,24719,27525,31512,
+32556,32815,33063,35569,34991,35351,34754,34490,
+34287,34262,34219,34613,34669,34550,33804,33634,
+33324,33414,33401,33107,33102,32397,32599,26416,
+25434,24859,24882,24864,25135,25472,25545,25617,
+25522,25834,26032,26074,26005,26210,26191,26140,
+25931,25653,25665,26745,30915,33445,33027,33033,
+33050,33020,33089,33069,33658,35005,33847,33154,
+33495,35067,34656,33867,33761,33659,33595,33684,
+33537,33408,33552,33964,35186,33045,32787,32532,
+32596,32867,32892,32752,30277,28965,30711,31489,
+30309,29049,26328,22836,22611,23699,25168,23244,
+20981,21015,21105,21098,21808,30040,22747,24669,
+30904,35631,35925,33177,34530,23486,20323,21048,
+23578,23926,23471,22549,18988,17725,16797,16699,
+16154,18473,18351,17732,16786,15654,15791,15582,
+14956,15373,15378,17899,17073,21025,18828,18201,
+17745,18947,17921,17333,16944,18960,17245,19533,
+19291,18270,18600,18845,19917,23642,27024,21255,
+21962,20412,21679,26285,26454,21627,19569,13636,
+12771,15904,16748,18118,21462,19367,20016,18798,
+20280,20205,20751,15711,23480,18188,16010,16936,
+15864,15924,15622,15576,15647,15875,15736,15994,
+16124,16080,16308,16581,17170,25098,17305,17559,
+17612,17642,16902,16463,17894,16054,22258,17156,
+16759,16785,16715,16912,16711,16787,20134,17523,
+19511,19874,17799,19714,22407,21010,21091,20127,
+21375,20082,20263,20465,19614,18719,18485,18654,
+19233,18486,18267,23529,20844,20713,21721,23199,
+26213,25661,25553,23166,24234,17543,17307,17459,
+17352,18372,17445,17702,16783,19288,25358,17789,
+17245,17274,17147,16728,16725,16585,16402,16587,
+16646,16428,16453,16326,17057,16352,16642,16857,
+16974,17391,18070,18324,19894,18723,18891,18303,
+18604,18441,18040,17935,18172,18177,17753,17328,
+16965,17238,17025,16984,16826,16729,16620,16955,
+16768,16503,17030,16429,16776,16740,16692,16683,
+16974,17628,17146,16572,16620,16515,16582,16305,
+16038,15948,16579,16676,17285,17096,17292,17229,
+17322,17647,17722,18135,17274,17323,17443,17274,
+18276,17430,17780,17307,17779,17597,18669,19661,
+19407,18393,19303,19469,20189,21425,20649,22251,
+21461,20886,21246,20875,21395,20794,21617,21622,
+21426,20928,21513,21702,21911,21423,21064,21778,
+21729,21306,21933,22015,22308,22343,22358,22699,
+23056,24309,23895,22364,22330,22315,22321,22234,
+22117,21967,21907,23179,23943,24192,24389,19617,
+18693,22611,27453,30414,32207,35032,37494,36678,
+37944,37517,37818,37926,38566,40707,38667,34311,
+33373,33141,33051,33098,33103,33210,33096,33100,
+33048,33080,33210,33648,33830,33264,33147,32988,
+30336,26580,21050,23549,24090,19299,18568,17259,
+16084,15852,15611,17238,18601,21298,28218,24077,
+26932,29853,30252,29745,31991,32971,30393,30309,
+29354,28769,28354,25345,21151,20049,23032,23385,
+27660,30513,21806,24306,26966,25353,26724,25190,
+25770,24406,27383,29730,29394,27195,33120,27861,
+29903,30238,32284,31251,32577,20624,17880,15414,
+13845,15750,16722,17359,16302,16932,16311,17000,
+16568,16630,17311,18459,18686,19444,16763,19342,
+19496,19431,18481,19531,18915,20097,21256,21577,
+23383,22720,24455,23842,21730,20166,23194,20301,
+19992,20649,19274,19064,18560,17914,18405,17487,
+17968,17145,17138,17187,17196,17120,16882,16901,
+17133,17433,17871,17669,18042,17565,18444,18277,
+18599,18349,19288,18962,18843,17832,19256,19135,
+19394,20022,20193,21033,21506,22652,22141,22155,
+22285,22400,22665,22728,23045,23195,23629,23421,
+23250,23303,23298,23840,24737,26517,30654,32981,
+33042,33086,33154,33213,33234,33350,33455,33745,
+34220,33876,33614,33672,33712,33670,33674,33753,
+33849,33968,33946,34000,34028,34048,34065,34089,
+34014,33822,33747,33729,33753,33876,33998,34368,
+34155,34071,34150,34383,34362,34357,34305,34245,
+34248,34279,34284,34333,34353,34377,34371,34572,
+35478,37571,35688,34829,34549,34382,34308,34539,
+34583,34605,34582,34366,34158,33970,33965,33928,
+33907,33908,33883,33963,33854,33635,33932,33923,
+34049,34189,34320,34486,34850,35300,35280,35742,
+35366,34758,34643,34650,34805,34646,34509,34470,
+34236,34226,34091,33964,33951,33815,33930,33965,
+34215,34353,34470,34173,34146,34170,34278,34517,
+35135,34972,34857,34196,34826,32949,31893,31800,
+29274,32511,32963,32985,33230,35441,38328,38441,
+37126,36183,35862,35520,35314,35245,35118,35046,
+34767,34587,34528,34488,34741,34878,34878,34882,
+34964,34595,34401,34281,34248,34318,34516,32768,
+32847,32777,32427,29436,23172,24150,22125,22186,
+21565,21302,21440,21611,21691,21811,21948,22062,
+22302,22393,22562,22818,22492,22881,23221,22671,
+22539,22660,22843,23490,24409,28856,32822,32731,
+32829,32824,33495,35509,35427,35162,34392,34404,
+34527,34769,34814,34671,34630,34711,34133,33905,
+33970,33302,34107,34823,35141,33380,33312,32790,
+27552,25623,25142,25605,25472,25416,25728,25995,
+26298,26222,26504,26297,26376,26520,26389,26457,
+26082,25886,25912,26256,30798,33885,33017,33019,
+33171,33029,33688,33910,37044,35311,34326,33481,
+33342,34538,34402,34025,33765,33447,33532,33519,
+33466,34741,34719,34611,33564,32782,32473,32587,
+32775,32848,32593,32697,32934,30569,28785,27925,
+26604,27681,28050,26342,22829,22014,21704,21459,
+21196,21054,21093,21932,21112,20898,20372,24455,
+29089,34012,34490,33279,31656,22266,25434,17593,
+19347,20920,20067,20569,18604,17149,17102,17603,
+17913,17860,17193,15777,16794,15660,16173,15948,
+15099,15438,15681,15753,16257,18203,19602,18423,
+17686,17583,18584,17569,18409,19713,17833,17831,
+18477,18552,18877,19142,19999,23346,27681,20616,
+20632,24186,22056,25452,25027,22292,21335,10957,
+12858,15614,16719,17590,18089,27827,24258,17424,
+16464,19821,21679,15927,16588,16805,15923,15810,
+15692,15727,15592,15741,15353,15825,16069,16006,
+16160,16148,15646,16323,16045,17054,17020,17602,
+17810,16916,16235,15160,18781,19263,17247,17659,
+17133,17765,17316,21362,18396,23440,22887,23472,
+23604,27363,21052,20948,22058,22434,20562,21560,
+20109,20141,20163,19413,25719,22074,18873,18411,
+19173,20646,23324,26285,22936,21560,23698,20268,
+27493,28170,28172,27103,25359,23099,18115,17648,
+25364,19026,18138,17514,23897,19529,18627,17633,
+18063,17882,16826,16670,16695,16252,16212,16687,
+16587,16972,16424,16644,17237,16543,17231,17365,
+17640,18341,18363,19391,18928,25503,18731,18870,
+17991,17798,17399,17644,17929,17789,20688,17292,
+17265,16993,16983,16742,16914,16846,16609,16280,
+16385,17822,16523,16936,17036,16970,16802,16985,
+16743,16763,16830,16717,16496,16583,16489,16501,
+16321,16445,16563,17225,17442,17311,17176,16917,
+16932,16830,17104,17397,16999,17175,17452,17859,
+17459,17301,17547,17517,17896,18297,19039,18387,
+18861,20030,19717,19529,20719,21195,20875,20141,
+19680,19867,20406,20629,21013,21686,21864,20796,
+20628,20760,21167,21965,20536,22978,22130,21561,
+21492,21765,25440,23437,26905,22263,22433,23114,
+27157,22858,21875,22801,22678,22900,22286,22531,
+21925,21679,22740,24985,24826,23628,20999,22575,
+27301,33156,34423,35159,34509,38118,33985,34719,
+36757,36686,36492,36530,37899,36105,35498,33109,
+33036,33098,33329,32982,33003,33042,33011,33009,
+33017,33072,33198,33313,33788,33643,33142,33006,
+31630,29086,21938,20120,21275,24157,25154,21145,
+17050,18828,20213,20855,18237,21899,18280,22386,
+19179,23139,26388,32886,34103,34962,33712,26770,
+27276,29978,27297,31736,33220,33249,34258,33858,
+37032,33360,30492,33043,29097,29822,32939,29440,
+31536,31396,34377,34230,33378,32945,32840,27745,
+29864,32658,32871,19488,18903,17219,14931,13413,
+15640,16746,15645,15963,16731,16836,17044,17077,
+17340,17351,17462,19464,17399,19008,19242,18375,
+17182,17066,19140,19733,19062,20394,22077,19798,
+21785,23837,24461,24823,24250,20865,21259,21703,
+19572,19810,19118,17871,18834,18730,18866,17955,
+17508,16289,15944,16149,16051,16233,16101,16516,
+17250,17258,17274,17315,17808,17840,17688,19594,
+18337,18570,18432,19382,19161,18849,18486,18971,
+20066,19342,20211,20682,21697,22145,21741,21863,
+21870,22226,22546,22922,23289,23794,23684,23345,
+23415,23570,23894,24366,25022,26359,29494,32804,
+33031,33069,33085,33164,33241,33406,33397,33778,
+34267,34551,33630,33771,33788,33838,33891,33856,
+33945,33947,33904,33910,34026,34035,34022,34006,
+33922,33808,33756,33755,33784,33870,34237,34362,
+34255,34181,34274,34410,34477,34265,34222,34210,
+34242,34302,34354,34374,34377,34404,34371,34602,
+35893,36540,35837,35006,34673,34506,34449,34798,
+34765,34632,34647,34331,34082,34035,34186,34086,
+34062,34152,34174,34146,34029,34056,34019,34096,
+34407,34208,34894,34589,34538,34821,35298,34970,
+35286,34813,34728,34611,34635,34770,35161,34760,
+34331,34062,34017,33890,33882,33789,33974,33869,
+34093,34508,34401,34164,34138,34206,34430,34556,
+34942,35532,34239,33147,32989,32355,31590,30438,
+30772,32937,32959,33883,36709,39105,39645,39216,
+37299,36022,35928,35595,35282,35035,34810,34734,
+34551,34388,34266,34232,34176,34392,34374,34236,
+34283,34164,33957,33878,33854,33794,33782,33774,
+33449,32988,32688,30882,23334,22648,22289,22065,
+21906,21538,21619,21897,21849,22049,22122,22257,
+22464,22597,22930,23145,23339,22804,22741,22955,
+22732,22831,23166,25104,27645,32687,32895,32722,
+32805,32938,33061,35113,34907,34607,34686,34595,
+34907,34825,34678,34296,34665,34318,33881,33698,
+33529,33808,33636,33621,34878,36246,33586,33037,
+32916,27574,26054,26109,26094,25473,25839,26142,
+26250,26922,26840,26586,26712,26769,26894,26764,
+26346,26154,26472,32371,32635,35443,33064,33099,
+33667,33014,36574,34655,35303,35176,33832,34118,
+33567,34622,34179,34087,34223,33553,33486,33525,
+34204,35088,37518,33297,32978,32560,32496,32770,
+32790,32937,32887,32996,32959,32915,29672,28191,
+26741,26554,25305,24222,23337,22086,21849,21596,
+21502,21258,21288,21349,21378,20974,20496,25167,
+29110,34038,34109,33056,33636,21894,21551,16365,
+16060,16970,17710,16616,22781,18099,16985,16380,
+18228,16963,16391,16403,15507,15185,15117,15330,
+15473,14698,14937,15153,15476,16338,21945,19343,
+18880,18843,17305,17952,18360,19119,16604,16906,
+17908,18547,19092,19061,20368,22360,25761,21475,
+20331,21774,22050,27504,23247,21821,25406,13513,
+13935,15667,16184,17115,16741,19529,21389,17517,
+17205,16914,16343,15886,16419,15573,15908,16026,
+15975,15738,15755,15340,15650,15851,15851,15983,
+16313,16493,17007,17263,16890,16893,16845,17112,
+17091,16737,18852,20076,21749,18009,19272,18227,
+17053,19352,16413,17211,18873,27000,29043,25245,
+23899,21879,21588,23893,25374,22732,23349,20671,
+20755,20574,20956,20358,23214,19490,18972,21420,
+21336,22458,26628,19017,18549,18482,18015,21921,
+19566,19936,22613,24759,26051,25792,20499,18168,
+18006,24585,24484,21063,18876,18541,18036,18121,
+17907,17616,16975,16604,16076,16505,16611,16773,
+16389,17836,16893,16817,16844,17003,17421,17769,
+18180,18522,19119,30639,19925,19393,19249,20819,
+23580,18849,17036,17113,17529,17603,17693,17354,
+17451,16642,16853,16664,16698,16866,16743,16544,
+17150,16932,17166,16908,16684,16765,16698,16792,
+16709,16779,16800,16752,16445,16626,16736,16585,
+16596,16710,17101,17309,17304,17436,17251,16912,
+17018,17322,17367,17257,17172,17133,16955,17229,
+17168,17358,17727,17467,17805,18028,18213,18450,
+18404,18774,18660,19366,20358,20183,20382,19985,
+19917,20419,20571,20839,21204,20830,20777,21307,
+21219,20939,20925,21043,21567,21024,21808,21020,
+21690,22021,22754,22498,22189,22408,22768,23073,
+23154,23727,25821,23084,22713,22689,22536,23409,
+24855,26786,25221,22692,21345,21329,26876,28336,
+33043,36780,36259,34106,34571,35123,34971,36046,
+37928,36187,37579,37557,39146,38642,33978,33118,
+33000,32891,32462,32206,32703,32917,32911,32973,
+32841,32918,33282,33203,33588,33543,33245,33018,
+33009,32932,19245,19461,19299,19643,22141,25047,
+27405,29484,21414,16964,14352,21922,18529,19065,
+19660,18721,17695,18256,18116,20006,21750,24288,
+27734,27066,27277,27425,23287,29973,32667,35172,
+36302,34503,37648,33963,33138,33246,33858,32133,
+29449,27774,26445,26988,27535,28594,31650,32648,
+19635,20399,20909,15077,14774,14783,11914,14564,
+15413,15789,16491,16058,16124,17019,15703,16453,
+17510,18420,17203,18336,18076,17086,17763,18625,
+19320,17690,17519,19320,19991,20711,20271,21180,
+20682,22899,24885,22521,24345,24596,21285,20719,
+20556,20001,19878,20168,19470,19023,18586,17809,
+17763,18650,17160,16732,15988,16503,16251,16137,
+16611,17012,17044,17160,17641,18050,17687,17778,
+19694,17997,18324,18051,18000,18636,19081,19119,
+19366,19782,19387,20290,20849,21258,21213,21339,
+21397,21715,22116,22586,23121,23562,23369,23248,
+23388,23646,23990,24706,25390,26695,31583,32555,
+33030,33121,33091,33123,33195,33441,33459,33465,
+33987,34409,34380,34137,33950,34125,33999,34023,
+34068,34043,34021,33917,33884,34004,33987,33951,
+33890,33808,33774,33789,33766,33903,34431,34414,
+34299,34316,34354,34521,34827,34420,34220,34205,
+34258,34326,34366,34359,34340,34367,34349,34386,
+35824,36244,36944,35131,34815,34701,34452,34620,
+34719,34587,34423,34257,34108,34267,34376,34256,
+34230,34243,34356,34438,34284,33906,34134,34134,
+34389,34184,34565,35014,34733,34979,35562,35749,
+35174,34798,34791,34668,34683,34819,34790,34428,
+34284,34163,33869,33757,33784,33770,33915,34014,
+34004,34117,34148,34085,34158,34291,34472,34874,
+35098,35811,33837,32982,32942,32200,31176,28702,
+32161,32988,33054,34026,40571,38482,37992,37461,
+36750,35905,36061,35477,35292,35027,34770,34552,
+34434,34291,34224,34157,33921,34086,33959,33899,
+33906,33843,33824,33672,33632,33705,33631,33660,
+33501,33016,32669,32744,24087,23154,22428,22356,
+23127,21592,21772,21940,22031,22291,22206,22262,
+22580,22657,22914,23280,23724,23269,23071,22983,
+22948,23312,23622,26257,29637,32715,32928,32754,
+32749,32896,33474,34794,34887,34860,34749,35053,
+35056,34615,34386,34031,34168,34013,33894,33404,
+33300,33606,34616,34195,34746,35622,33798,34780,
+33280,32842,31583,26736,26683,26601,26356,26088,
+26328,27347,27225,27153,27317,27135,27067,26946,
+26667,26784,29094,32973,33011,35231,33223,33378,
+33544,35102,34270,35919,35586,34850,34854,35545,
+34179,33635,35105,34136,33769,34901,36091,33629,
+34182,36067,33132,33005,32670,32321,32284,32509,
+32615,33802,33640,34356,33126,32988,32199,31834,
+32376,31164,29339,29540,27238,22996,21996,22632,
+23365,21916,21508,21503,21536,21388,20743,21419,
+25971,28021,31976,30272,30062,24348,19021,16890,
+17353,16633,15823,16864,16404,17545,16419,17883,
+16193,17089,16349,15652,15603,14840,14276,14380,
+14871,15453,14318,14472,14374,15570,16623,19718,
+16751,19353,18542,18956,18240,17909,18717,18790,
+18327,19008,19112,19367,20983,23085,25749,20600,
+20673,21582,22365,31695,21984,22023,24726,14229,
+15442,23375,17459,17064,16731,16409,16410,16602,
+16133,17102,15986,16007,15801,15937,16470,16056,
+16034,15486,15239,16134,15629,15765,15985,15969,
+15622,16215,24326,17193,16957,17105,17676,17968,
+16871,19041,17770,16518,16719,18823,18000,18078,
+17820,16827,17195,17113,21554,21564,26531,25503,
+29038,25937,20525,20599,20725,22771,21714,21486,
+20307,24318,20721,20293,18833,18317,18676,18593,
+27908,21483,19146,18778,18401,18256,17513,17232,
+18072,18193,17869,19523,24492,26235,23168,20621,
+24123,24420,23399,18585,24440,27678,23299,17754,
+17948,17335,16907,17300,16613,16716,16880,17090,
+16960,16843,17274,17726,17502,17799,18036,18558,
+18853,19149,19673,20218,20124,19782,18838,21000,
+39267,31935,19914,16540,18032,17379,17484,17558,
+17058,17156,16809,16775,16606,16660,16799,16622,
+16483,16732,17063,16728,16674,17331,16939,16806,
+16596,17356,16562,16809,16467,16513,16534,16565,
+16926,16891,17440,17127,17243,17304,17136,17361,
+17121,17295,16849,17251,17130,17086,17277,17435,
+17472,17838,17949,17637,17836,17844,18481,18564,
+18427,18496,18690,19383,19983,20097,20144,19881,
+19899,19927,20355,20211,20526,20588,20380,20848,
+20350,20896,21190,21224,21354,20525,21051,22061,
+23267,22035,22620,22167,22215,22493,22670,22938,
+23397,24591,29549,22977,23588,22704,23031,19713,
+25066,22666,21801,23657,18879,28903,33033,34084,
+34432,38480,34169,37432,38479,37482,36102,38736,
+41639,42237,42206,39711,40148,41921,34673,33102,
+32383,27971,27872,30290,31051,31186,32628,32988,
+32330,32850,33033,33115,33547,33321,33120,33081,
+33003,29730,20947,19288,19259,19522,19571,19160,
+24562,22854,22008,21626,27126,30998,24140,18812,
+13605,11272,14247,15903,16617,17894,20577,22842,
+22159,22474,25249,27824,30573,27755,32937,33934,
+34989,36468,34953,33180,33027,33359,27726,14750,
+20313,12262,12105,10968,10884,12483,20001,17178,
+17796,16713,13326,13602,11712,15588,16323,16335,
+16789,17715,18003,17172,15555,16059,17085,15875,
+17070,19301,18717,18571,17502,17976,18360,17957,
+17912,18146,18871,19149,20797,19916,22003,20457,
+20048,22254,24536,26830,25021,23801,22037,21519,
+21048,20370,19850,20687,19025,19208,18227,17457,
+17314,15949,16703,16111,15174,16446,17139,17755,
+17118,17205,17113,17306,17666,17448,17758,17734,
+17919,18471,18462,18408,18055,18748,18488,18913,
+19086,19043,19398,19746,20186,20522,20598,20774,
+20881,21170,21572,22079,22476,22865,22810,22893,
+23215,23628,24339,25210,26259,27956,32440,33048,
+33077,33161,33228,33446,33450,33436,33456,33455,
+33894,33930,34243,34193,34176,34143,34075,34045,
+34020,33996,33929,34031,33885,33840,33945,33918,
+33874,33848,33822,33834,33765,33838,34325,34401,
+34344,34352,34837,34741,34858,34512,34445,34263,
+34299,34349,34365,34354,34339,34284,34239,34613,
+35610,37243,35496,34985,34812,34630,34489,34613,
+34605,34427,34365,34183,34228,34368,34473,34488,
+34443,34588,34719,34737,34886,34713,34837,34328,
+34488,34359,34707,34839,34950,34885,35091,35283,
+35107,34802,34699,34660,34709,34795,34993,34351,
+34167,34061,33801,33611,33729,33727,33911,34031,
+34047,33950,34028,33992,34101,34295,34374,34893,
+35401,36244,33270,32911,32690,30772,29346,31755,
+32912,32924,33168,34437,39075,37754,37368,37311,
+36429,35923,35732,35311,35078,34919,34747,34442,
+34284,34165,34122,33974,33795,33848,33776,33738,
+33809,33715,33480,33597,33420,33529,33467,33489,
+33465,33398,33381,32985,32157,23560,22917,22726,
+22521,24083,22216,22134,22262,22398,22614,22936,
+23024,23384,23942,23433,23684,23368,23552,23486,
+23217,23607,25011,31709,32980,32728,32769,32801,
+32885,32967,33129,35274,35338,35134,34520,34405,
+34219,34208,34092,34299,34157,33927,33826,33452,
+33621,33987,35092,34644,34735,34746,35015,33321,
+34893,33062,32225,29875,28076,27913,27083,26835,
+27240,27596,28207,27981,27913,27697,27693,27244,
+27323,29799,32988,33022,33989,33252,33193,34034,
+33251,35240,34440,34776,35276,35322,35541,34382,
+34273,34277,37617,35160,34467,35901,35738,36243,
+34575,34568,33641,33000,32726,32341,32217,32220,
+32403,33033,34320,33897,33585,32988,32825,32531,
+32620,32220,31815,31130,29990,29039,27406,25090,
+26496,24723,21780,21989,22173,22009,21748,20581,
+23629,24395,30912,29502,25843,22217,18505,16914,
+16233,15813,15523,16488,17733,16221,18544,16447,
+16239,16857,15864,15626,16632,15451,15144,15102,
+14510,15171,14866,14892,15128,15517,16079,19178,
+18030,19345,18902,18955,18889,17490,19890,20721,
+19079,18891,19527,19809,21486,24213,24940,20880,
+21368,21744,23001,26463,23868,20295,20891,17272,
+16266,17274,16788,16402,16965,19538,16590,17598,
+16614,26004,16293,16890,15792,16041,16055,15972,
+16049,15841,15935,18599,25841,15886,17388,16976,
+17303,17699,17743,17754,23527,17573,17445,17114,
+16971,26941,18403,16245,16770,27924,19747,19873,
+17613,17475,17055,16944,19123,17341,23895,24704,
+19956,24999,28445,21305,21278,20817,21355,21541,
+21407,26461,24069,18703,18565,19197,18597,26524,
+23016,18966,20031,18581,18299,17622,18414,16881,
+18753,17762,18380,18604,19635,24242,24412,22241,
+21587,25024,24092,18460,18432,18044,18956,26948,
+17624,17520,17579,17455,18142,17361,17754,17199,
+17183,17286,17391,17457,17156,19201,19167,18765,
+19403,19611,20112,20070,20235,19442,18647,19725,
+37072,35852,24508,17913,16872,17500,17551,17412,
+16825,16576,17097,17002,16935,17054,16800,16778,
+16564,16743,16637,16513,16599,16326,16216,16678,
+16596,16526,16920,16599,16606,16534,16491,16493,
+17316,17553,17184,17235,17340,16967,17792,17883,
+17761,17204,17334,17148,17315,17461,17485,17630,
+17679,17850,17816,18210,18432,18571,18429,18571,
+18264,18782,18872,18788,19581,19309,19423,19830,
+20210,20343,20067,19815,19825,20181,20289,20688,
+20847,20825,20659,21048,21515,21362,21648,21531,
+21472,21288,22068,22369,22618,22641,22514,22671,
+22849,23039,23899,23634,24328,23717,25820,24664,
+22804,23622,22452,20700,27828,33112,34674,35910,
+37617,37460,38940,40512,39888,39309,40374,40965,
+41973,40054,40209,42068,40147,39111,37668,32751,
+27869,25569,25501,28506,29308,29992,30382,32887,
+32988,32988,32988,33144,33279,33284,33146,33080,
+33019,31328,28437,19302,19239,19206,19277,19224,
+21864,23070,23044,22347,22136,25848,24585,26484,
+32865,29727,28726,28700,25581,22911,17531,14426,
+25063,24378,22830,22809,25539,34124,33684,33027,
+32985,33487,33941,32013,23103,19702,25482,13430,
+7845,7889,8345,8024,9686,11136,10861,11604,
+11379,11385,12711,15206,17017,18010,17935,17772,
+17860,17732,17394,17419,17713,16437,16874,16692,
+16948,17647,17847,18167,17941,17668,18187,17430,
+18618,19293,19383,19669,18380,20001,21334,21041,
+21465,22060,23257,23958,22260,24794,21412,20814,
+21298,20439,20637,18958,18543,16435,16312,19508,
+18394,16613,16728,16902,16421,16844,16619,17061,
+15933,16849,16753,17691,17213,17706,17797,17645,
+18052,18874,18930,18987,19071,18423,19002,18903,
+18180,18474,18843,19200,19526,19562,19996,20076,
+20277,20526,20919,21445,21822,21868,22202,22458,
+22893,23576,24324,25983,27614,30477,32974,33022,
+33151,33226,33295,33456,33423,33893,33840,33912,
+33906,33893,33962,34029,34062,34063,34044,33984,
+34024,33992,33850,33949,34006,33833,33795,33877,
+33859,33870,33891,33898,33841,33868,34370,34433,
+34351,34347,34866,34836,34924,34805,34569,34353,
+34368,34368,34368,34371,34368,34365,34421,34827,
+35245,35577,35314,34870,34726,34668,34696,34811,
+34367,34652,34338,34195,34331,34326,34525,34588,
+34688,34751,34929,35733,36462,36482,34583,34675,
+34552,34636,34675,34824,34891,34989,35015,35196,
+35043,34873,34792,34710,34762,34821,34716,34367,
+34104,34049,33888,33657,33714,33839,34095,34113,
+34133,34032,34446,34060,34164,34309,34530,35099,
+35482,35424,32985,31254,30930,25740,31403,32205,
+32988,32996,35213,37092,37547,37365,36637,36163,
+36053,35503,35400,35122,34917,34768,34626,34369,
+34199,34098,34013,33937,33834,33691,33661,33621,
+33584,33459,33589,33297,33343,33333,33279,33453,
+33430,33467,33548,32960,32988,29959,24128,23010,
+22164,23809,22050,22275,22413,22540,22755,22926,
+23175,23372,23562,23918,24834,24363,24069,23653,
+23573,24485,28760,32802,32696,32755,32819,32896,
+32816,33020,33626,34773,34782,34424,34497,34427,
+34428,34359,34417,33978,34243,33651,33665,33463,
+33783,34439,34653,34838,34781,33774,35001,34112,
+34261,33264,33003,32980,32887,30678,28934,27729,
+28749,28530,28655,28455,28823,28728,29070,29343,
+31816,32854,32995,33013,34275,34047,33390,33785,
+33224,37014,35739,35475,35980,36435,35205,34552,
+34393,35202,35129,34778,34533,36069,36786,37089,
+35056,36865,33867,33042,32852,32436,32333,32214,
+32291,32685,33006,33262,33108,33048,32866,32748,
+32667,32578,32656,32049,31074,29679,27609,27977,
+27682,27785,26644,23919,23520,23294,23488,22257,
+20583,25295,23494,28842,25464,23598,17669,17608,
+16395,16035,15048,17022,18021,17323,16584,16571,
+16601,15480,16615,16025,15334,15166,15125,15163,
+15145,15039,15006,15192,15307,15582,15954,20463,
+21415,18634,18739,18926,18091,20538,19210,20522,
+18208,18930,19122,19662,23533,28410,21879,21183,
+22899,22439,24258,27024,21124,21445,19736,15699,
+17906,26912,23880,17064,22136,27969,17684,28719,
+15746,15783,19503,24510,15856,15421,16075,16062,
+16893,22086,19077,25023,17393,15798,16241,17592,
+29180,18120,16653,19075,27542,18673,17075,16644,
+16737,19964,16942,16210,16470,18898,17130,17087,
+17161,17088,16747,16584,17313,17175,16538,18024,
+19180,19332,23801,20494,20710,20676,20682,23256,
+25980,21354,19915,18213,18615,19425,20262,19246,
+19040,17928,18435,17445,18520,17988,17130,17173,
+17021,16881,16746,18243,17245,17262,21698,22571,
+22113,22446,23692,20075,26125,18535,19918,18710,
+21178,17653,17920,17767,17608,17768,18096,18424,
+18427,18483,18367,18066,18582,18753,19014,19161,
+19361,19613,20034,19875,19140,21121,22132,27147,
+33029,25539,16726,16521,17211,17805,17648,17437,
+17419,17436,17112,17146,16850,16676,16698,16984,
+16772,16539,16608,17236,16960,16696,16455,16581,
+16083,16337,16372,16107,16734,16556,16556,16845,
+17435,17651,17364,17567,17649,17355,17382,17573,
+17524,17456,17213,16931,17419,17517,17509,17616,
+17912,19030,23890,18402,18442,18435,18719,18631,
+18551,19094,19203,19452,19413,20050,19924,19953,
+20464,20034,19929,20416,20208,20447,20605,20893,
+21031,20885,22326,21246,22086,21238,22120,23172,
+22222,21589,22060,22023,21758,22371,22871,22716,
+23474,23262,23119,24771,23147,25095,23703,23497,
+22853,23097,23245,22595,30888,35449,38520,37514,
+38936,37644,37644,37840,38289,38375,39087,40896,
+39974,38964,40036,39483,34619,33264,32967,29859,
+26354,24585,24150,28205,28452,28867,28996,30168,
+32942,32988,32985,33026,33222,33109,33116,33086,
+33096,31981,29410,29190,19313,19352,19407,19273,
+20726,20805,20408,19486,24826,23593,26701,26436,
+25313,24330,25479,28810,32967,33009,33283,33366,
+33627,33383,34686,33634,29493,29054,28118,22192,
+25272,20909,20442,20448,26156,27206,28669,17272,
+18162,16827,15907,14949,12538,14682,16176,16809,
+16638,16222,16513,17573,16127,16765,16128,16521,
+17597,17012,17389,17696,18312,18495,17609,15186,
+16850,17206,18872,18394,17988,17034,18972,17412,
+17635,17506,18759,19561,19674,20430,20036,22143,
+22206,22414,22775,23109,25036,25095,22311,21408,
+21190,18862,18702,20101,19395,19212,18153,17994,
+18382,15651,16233,17650,16996,16561,18267,17613,
+16053,15474,17117,16966,17313,17520,18279,18546,
+18735,19023,19318,19191,19779,18697,18519,18796,
+18225,17959,20457,18621,18898,19110,19300,19572,
+19500,19587,20127,20739,21129,21365,21580,21866,
+22405,23046,24443,26417,30258,32988,32492,32201,
+33183,33499,33535,33441,33344,33459,34027,34171,
+33894,33881,33840,33880,33937,33978,33958,33964,
+33952,33937,33788,33867,33876,33914,33723,33822,
+33831,33906,33936,33921,33934,34028,34021,34100,
+34323,34315,34827,34937,35280,35255,35184,35193,
+34657,34422,34539,34470,34579,34456,34588,34844,
+36037,35284,34824,34728,34665,34663,34706,34677,
+34327,34404,34494,34437,34381,34469,34536,34840,
+35013,35076,36316,35705,37830,36997,34997,34869,
+34636,34496,34307,34464,34590,34889,35106,35174,
+34941,34921,34998,34730,34717,34796,34681,34382,
+34152,33928,33987,33940,33774,33732,33951,34082,
+34257,34110,34007,34047,34270,34507,34696,34522,
+35016,35317,32962,30813,28548,30648,31415,32963,
+33061,34956,38620,37544,36880,36327,36114,35652,
+35816,35203,35334,34788,34776,34614,34389,34215,
+34206,34095,33918,33828,33758,33676,33559,33496,
+33517,33491,33519,33329,33273,33291,33284,33388,
+33456,33456,33438,33133,32968,32832,25251,26142,
+22730,22497,22149,22261,22479,22602,22828,23012,
+23213,23514,23488,23612,24634,25104,24003,23937,
+23853,23921,29877,32709,32763,32775,32824,32769,
+32742,32970,33942,34971,34863,34665,35261,34750,
+34842,34560,34515,34142,34023,33667,33685,33656,
+33825,34043,34555,34310,34743,33684,33555,35187,
+34965,33635,33365,33110,33054,32975,32074,30988,
+32362,30764,30267,32181,32547,32633,32558,32565,
+32782,32965,33016,34092,35083,33132,33596,34116,
+33523,37293,36522,34811,35490,35466,35700,34526,
+35180,34535,35684,36831,34903,35622,36485,37054,
+36084,35043,33908,33190,33004,32899,32687,32863,
+32350,32332,32560,32931,32973,32930,32929,32758,
+32736,32740,32744,32628,32487,32554,31629,30828,
+30335,30780,29586,25641,25001,24757,24190,23204,
+21117,24240,22214,28845,24216,24370,16856,16533,
+16402,15572,17051,15089,16116,15513,16362,15624,
+16182,15698,16300,15169,15405,15441,15338,15323,
+14935,15044,15169,15324,15225,15460,16187,17297,
+21519,19095,19062,19971,18848,18828,18904,19605,
+19313,19178,19580,19710,21516,28632,23840,23130,
+21540,22650,26505,24745,24063,23304,13212,17298,
+17904,18561,19225,28263,25386,21200,16034,17144,
+15452,15099,15023,15059,14967,15405,15804,15891,
+21909,20385,17448,17885,17279,16848,16563,16530,
+17220,30145,20341,17651,17895,18975,27117,17566,
+17239,16428,17979,16923,16434,16112,16720,16899,
+17128,16801,16446,16659,16084,16582,21321,21032,
+22125,17528,20897,21861,25114,20871,21001,24420,
+24398,22254,19565,18417,18926,19074,22465,22025,
+20574,19426,20275,18240,17665,17178,16467,19004,
+16358,16666,16736,16805,17154,16998,17748,18350,
+22825,23374,22824,20889,19621,18231,18618,18369,
+18622,18283,19077,18030,18306,18744,18032,18102,
+18175,18516,18678,18844,18598,18759,18889,19035,
+19098,19314,21094,20395,29294,25117,32464,40215,
+28760,21633,16058,17184,17480,18290,18190,17697,
+17559,17615,17411,17295,16689,17000,17306,17179,
+16934,16635,16859,17079,16927,16335,16279,16266,
+16150,16569,16618,16496,16770,16773,16851,16917,
+17492,17675,17340,17295,17282,17479,17385,17653,
+17819,16885,17115,17447,17775,17667,18033,18416,
+18093,18189,18519,18447,19079,18963,18711,19162,
+18654,20991,18891,19254,19335,19305,19263,19956,
+20373,20075,20167,20337,20324,20727,21291,21017,
+21119,21230,21195,21363,21764,20998,21168,21603,
+21233,22227,21762,21768,23725,21787,23167,22607,
+22889,23067,23514,23555,24581,24781,24270,23878,
+23541,23996,22874,22030,32562,33045,37884,37433,
+37578,37697,38568,39630,38397,38439,38595,39021,
+39900,38631,38822,34875,33672,33028,31990,28473,
+26280,24544,23417,24201,25968,25959,25683,32964,
+32898,32895,32982,33016,33049,33042,33074,33117,
+33076,33037,31709,29175,21930,19476,19529,19333,
+19406,19428,19317,19654,20613,22313,22155,23398,
+22766,23341,32997,32971,33019,33012,33076,33233,
+32995,32255,27903,24457,28325,28937,24187,20478,
+22383,30646,28164,21813,32482,21639,17673,17357,
+17476,17083,17033,16927,16775,16928,17466,17458,
+17399,16890,17260,16652,16996,16085,16272,16020,
+16638,17373,17065,17814,18210,18663,18329,17466,
+17264,18219,18143,16460,17379,17795,17389,16574,
+18388,18678,19228,18323,19854,20129,19827,19875,
+21267,22906,22157,21967,24171,22095,21993,20871,
+20541,20659,20181,18589,19475,18400,19094,18207,
+18023,15428,18253,16407,16641,16787,16781,15669,
+17367,15603,16419,17527,17634,17865,18761,18685,
+19372,19415,19365,19896,20725,18942,18193,17699,
+17565,17748,18082,18180,18341,18594,18800,18991,
+18974,19332,19711,20058,20312,20578,20917,21387,
+21992,22710,24415,28104,31137,32980,32904,33116,
+33247,33673,33913,33849,33436,33556,33970,34221,
+34039,33955,33853,33816,33835,33883,33911,33996,
+33985,33883,33744,33652,33633,33703,33654,33795,
+33867,33929,33972,33937,33918,33945,34172,34125,
+34348,34302,34332,34581,34771,34827,34828,35178,
+34760,34555,34782,34772,34802,34662,34629,34699,
+34915,34995,35259,34836,34626,34575,34646,34549,
+34645,34467,34745,34452,34365,34443,34596,34937,
+35742,37035,39351,38298,38700,37509,35436,34806,
+34814,34562,34532,34374,34560,34763,34860,34884,
+35054,34998,34826,34862,34737,34648,34447,34351,
+34346,34141,34053,34042,33705,33923,34132,34350,
+34458,34431,33928,34129,34416,34740,34872,34249,
+34494,35911,32967,31269,26414,30249,32316,33184,
+35286,37426,37161,36966,36557,36012,35862,35413,
+35283,35213,34864,34926,34764,34542,34419,34155,
+34078,33912,33861,33790,33685,33589,33525,33440,
+33456,33443,33342,33319,33217,33250,33260,33336,
+33453,33440,33380,33091,33079,32996,32715,25224,
+22950,22763,22818,22579,22542,22585,22737,22790,
+23151,23528,24789,24867,25497,25881,24762,24297,
+24528,25214,31545,32838,32907,33019,32968,32857,
+32704,32988,33313,34428,34838,34033,33819,33849,
+33885,33797,33871,33959,33801,33740,33855,33672,
+34043,34055,33948,33913,34051,34053,33640,33406,
+33441,33835,33651,33240,33084,33003,32847,32826,
+32717,32650,31928,32652,32747,32557,32628,32528,
+32976,33462,33181,35729,33978,33189,33725,33807,
+34097,36585,37271,36519,35043,35134,37368,35535,
+34803,36555,35869,35463,35952,35085,36156,35989,
+34667,34856,33665,33056,33012,33034,32986,32910,
+32637,32538,32745,33003,33189,32982,32904,32847,
+32823,32784,32788,32718,32773,32588,32465,31923,
+31560,32970,31214,29387,26020,25328,24345,23461,
+22512,27044,22196,29631,23301,19729,16264,16368,
+16062,16370,16413,16102,16776,16440,16896,20118,
+18426,16849,16365,15485,16028,15258,15005,14899,
+15187,14849,14965,15297,15278,15534,15659,16376,
+18510,18100,19794,19539,19428,20547,18264,19484,
+19659,19047,19377,19759,22302,25624,22272,21620,
+22327,26240,26679,25655,23829,20126,14857,19356,
+23692,18900,17538,17995,22221,14885,15501,16350,
+15197,15454,15135,15050,14638,17244,17213,15678,
+24557,19938,19239,19392,18738,17261,16220,15629,
+18442,20439,24674,17548,17448,19608,18803,17589,
+17783,16643,16295,17000,16639,16937,16502,16778,
+16635,16489,16323,15539,15706,16002,15995,16462,
+16931,17283,21273,21009,21637,22890,22264,22256,
+23618,23368,25044,20879,19169,24148,23316,20684,
+22602,23304,18073,19221,16631,15983,16223,16178,
+16647,16537,16662,16490,16902,16966,17245,18127,
+17882,17970,18099,18480,18875,23797,18675,23321,
+18397,19149,19230,18843,18901,19767,18453,18522,
+18636,18827,19085,19311,19276,19230,19906,19449,
+19717,22512,18887,24836,32076,32784,31174,30279,
+18541,15928,16543,18161,18121,17993,17579,17250,
+16899,17175,16874,16922,16842,16914,17047,16308,
+16041,16528,16455,16112,16873,16748,16492,16424,
+16357,16242,16896,17249,16926,16937,16866,17045,
+17553,17802,17483,17340,17383,17301,17653,17517,
+17012,17106,17325,17294,17715,17968,18025,18132,
+18236,18348,19009,18123,18726,18714,18530,18789,
+19467,19334,19438,19497,19433,19558,19677,19974,
+20183,20126,20193,20496,20651,20247,20973,21504,
+21438,21104,20992,21269,21234,21302,21592,21447,
+23080,21995,22191,21676,22226,21981,22611,22940,
+23001,23625,23319,23408,23623,24781,23938,24879,
+23973,23762,23779,29794,31650,32821,37542,36559,
+37355,37265,38148,38501,39309,40283,38944,38554,
+38684,36945,33559,33307,33571,32988,30524,27789,
+25959,24163,23058,23292,24173,25426,24450,32820,
+32954,32916,32951,32978,33003,33010,33033,33050,
+33050,33013,32934,30629,27510,21080,20439,20544,
+21201,20020,21474,20205,20299,20543,21373,21537,
+32041,32986,32984,33084,33378,33141,33021,32411,
+27042,25066,24533,25756,26466,32048,21798,24272,
+32941,31008,22409,19953,21992,16680,16731,16440,
+17388,17467,16914,16776,16744,16942,17129,16747,
+16818,16560,16650,16395,15273,15668,16224,16132,
+16285,16029,17319,17280,17782,18354,17484,18065,
+16077,16547,17198,16889,17171,17524,17470,17883,
+18894,19057,19398,19618,20675,20275,19584,21555,
+18395,21717,22552,22581,22194,24200,22503,21693,
+20261,20096,19660,20605,18930,18048,16425,17978,
+17488,17562,17177,17140,16324,16072,17040,16654,
+16559,16451,16242,17461,16632,17895,19199,18467,
+19729,19019,19593,18482,18609,18724,17699,17373,
+17151,17339,17558,18176,17864,18055,18236,18540,
+18609,18792,19191,19551,19898,20166,20323,20997,
+21709,22782,23997,26401,30979,32849,33208,33732,
+33678,33783,33885,33744,34251,33937,34000,34021,
+34239,34500,34110,33849,33778,33822,33908,33991,
+34018,33942,33801,33673,33655,33741,33744,33817,
+33912,33939,34012,33999,33920,33954,34041,34141,
+34211,34299,34250,34327,34586,34834,34829,34834,
+34872,34755,34809,35148,34800,35260,34830,34798,
+35040,35746,35731,35064,34617,34556,34615,34640,
+34922,34648,35438,34473,34500,34533,34658,34912,
+36700,37107,36931,36669,39097,37129,35740,35103,
+34833,35004,34572,34441,34632,34827,34617,34992,
+34938,34776,34980,35027,34774,34593,34355,34150,
+34107,34101,33955,34011,33954,33660,34025,34134,
+34518,34776,33870,34204,34782,34878,34567,34206,
+34550,34314,32977,30456,28537,31046,33036,33759,
+38239,37422,36729,36478,36926,35882,35546,35431,
+35931,35468,35028,35495,35021,34673,34361,34107,
+33948,33831,33759,33709,33648,33549,33477,33376,
+33336,33295,33322,33317,33322,33224,33262,33344,
+33298,33344,33306,33264,33204,33297,32739,28117,
+23698,23168,23800,29892,22477,22632,22861,23169,
+22950,23664,23743,24494,25973,26425,25981,26940,
+31112,32225,32762,32888,33173,33780,33756,33169,
+32943,33023,33078,33293,34306,33495,33546,33835,
+33756,34780,34377,34086,34228,34210,33803,33810,
+33979,34102,33852,33879,33957,33857,33762,33469,
+34083,33547,33487,34285,33408,33009,32978,32959,
+32927,32898,32628,32839,32757,32904,32707,32381,
+33184,33522,33917,36795,34085,33533,33627,33529,
+34275,36018,35930,35888,35993,35269,36296,36852,
+37125,35749,35893,36417,35549,35193,35412,36808,
+34461,34598,33094,33054,33190,33490,33625,32845,
+32925,32839,32991,32942,33095,32949,32910,32934,
+32940,32889,32844,32807,32742,32707,32681,32581,
+32149,32004,31895,30468,26974,25231,24508,22944,
+24739,31239,22166,26418,22251,18708,16126,17430,
+17657,16353,15543,17607,16125,16547,16794,19647,
+19129,17940,17484,15299,15872,15655,15360,15388,
+15506,15586,15507,15669,15490,15521,15792,16358,
+17657,22137,19112,19239,19244,19551,18994,20001,
+18994,19528,20008,20812,22699,19461,23077,21442,
+25777,27052,24959,19182,19337,14708,16801,17679,
+18690,17486,18603,16277,18289,15198,15523,15667,
+15709,16152,26827,15320,16188,28162,17448,16003,
+17713,18276,19557,21936,23268,17514,16538,24064,
+20299,25147,17438,18891,17794,26386,27156,17516,
+17326,16453,16063,16105,16863,18697,16170,16414,
+16635,16483,16062,15507,16364,15861,16266,16136,
+16414,16804,21971,27560,28459,25304,22716,22536,
+24723,26610,24889,23416,24403,25440,23410,20553,
+18675,17238,17208,17301,16161,15779,15807,16299,
+16310,16512,16836,16809,17000,17215,17529,17588,
+17715,18059,18297,18639,18511,18809,23171,18708,
+26472,18699,18926,19206,19073,19008,18873,19103,
+18779,18982,19059,22371,19287,19209,21703,29659,
+24696,23507,27111,29511,27984,21631,18432,16570,
+16635,17929,18521,19738,19047,18005,17676,17202,
+16959,18008,17110,16619,17592,17426,17248,17385,
+17283,16821,16859,16960,16357,16445,16671,16855,
+16289,16363,16681,17429,17152,16806,16891,17034,
+17353,17599,17277,17329,17356,17409,17706,17509,
+17742,17608,17818,17897,17765,17691,18816,18738,
+18655,19517,19054,18457,18485,18767,18775,18617,
+19820,19627,19527,19285,19595,19742,20034,21320,
+20409,20589,20023,20659,20929,20768,20857,20874,
+21723,20861,23490,21537,21092,21432,21568,21216,
+21351,22258,22217,21945,21817,22050,22405,22778,
+23153,23350,23316,23255,23689,24424,24880,23835,
+23733,24210,29866,32690,32904,33031,36060,39306,
+36533,39123,40001,38818,39991,40170,38797,37370,
+35893,34281,33342,33135,33090,32443,28635,27177,
+25283,23913,22824,22491,22980,23526,23745,32792,
+32871,32924,32880,32895,32917,32934,32946,32955,
+32952,32955,32922,30602,27090,28563,25984,24098,
+24904,29786,33096,32988,32978,32988,28041,29326,
+33063,33093,33046,33243,33067,32374,25619,26814,
+29904,24891,24031,26717,30691,25776,23136,32817,
+32998,26280,20761,16839,16515,16248,16488,16693,
+17276,17151,16698,16239,16330,16575,16139,15900,
+16257,16144,15633,15825,15540,16399,15898,16281,
+15786,15866,16029,17064,17109,17228,16227,16793,
+17026,17118,17121,16251,16207,17007,18879,18929,
+18511,20100,17841,19264,19510,20125,19200,20642,
+21359,21500,22073,24184,23278,25050,22908,21515,
+22517,20721,20484,20254,19311,18831,17149,17578,
+16542,17059,16017,18040,15357,15957,16891,16209,
+16326,17179,19059,17731,17718,17539,18258,17877,
+18330,18894,18842,18236,18531,17786,17234,17172,
+16877,17042,17214,17408,17511,17535,17824,18149,
+18321,18522,18844,19245,19557,19957,20241,20646,
+21350,22385,23674,25785,29760,32800,33196,33531,
+33828,33811,33913,33762,33878,33861,34013,34172,
+34258,34605,34143,33852,33749,33775,33881,33993,
+34044,33990,33888,33858,33913,33909,33870,33869,
+33912,33862,33983,34059,34006,34030,34033,34105,
+34200,34201,34152,34223,34369,34548,34817,34744,
+34833,35150,35226,35079,35127,34900,34887,34848,
+35306,35744,35724,34883,34720,34617,34686,34691,
+34981,35056,34781,34536,35950,34782,34965,35369,
+36609,35685,37550,35757,35977,38609,35662,35124,
+34874,34881,34610,34558,34565,34606,34536,34632,
+34743,35380,34748,34870,35580,34674,34398,34182,
+33974,33907,33905,33947,34261,33934,33662,34356,
+34571,34413,33831,34175,34473,34432,35250,33984,
+34881,33465,31630,31032,29461,31251,33260,33905,
+35940,36609,36406,36243,36277,35663,35550,36222,
+36044,35789,35290,35798,34871,34770,34410,34095,
+33876,33777,33689,33621,33557,33474,33381,33327,
+33339,33348,33324,33333,33375,33342,33213,33159,
+33210,33339,33475,33492,33400,33600,33244,31764,
+24391,23693,23336,27857,23814,23296,23364,23727,
+23548,23766,24457,24356,26125,27252,27156,27994,
+32725,32661,32187,33252,33122,33348,33451,33260,
+32979,33024,33236,34291,34953,34094,34326,33912,
+33975,34064,34127,34941,35196,34400,34581,34483,
+33849,34710,33916,33756,33713,33651,33595,33684,
+33645,33963,34834,34173,35786,33066,33039,33016,
+32997,33000,32995,32989,32961,32915,32940,32988,
+33048,33336,35613,36060,34509,33844,33189,33545,
+33641,36186,35491,36553,35703,37179,37319,37182,
+36765,35577,35751,37022,35499,35388,35803,34998,
+37941,33387,33231,33177,33849,34047,34877,33459,
+33123,33066,33061,33099,33202,33085,33174,33060,
+33288,32992,32909,32906,32835,32798,32724,32665,
+32653,32423,32197,31612,29072,25783,25517,24760,
+27465,31051,27555,27395,18228,19556,15546,18489,
+15720,15952,17391,18675,16713,16387,16680,18315,
+18731,18114,17518,16500,15601,17049,16471,15875,
+16286,17139,15933,16119,16567,16641,18296,16642,
+18867,23470,19996,20091,18777,18831,18014,18638,
+19144,19566,20678,22656,25908,22183,23242,27120,
+25284,22764,21024,15114,13547,13020,16071,16681,
+16690,16767,16260,16283,15962,15812,15750,16822,
+15879,15838,16080,16084,16031,16311,15953,16807,
+16839,23425,18027,16174,18663,18048,19781,18113,
+17475,26274,18479,19120,18657,18153,22514,16521,
+16434,16755,16582,15618,15747,15670,16004,16383,
+15882,15930,18375,15759,16443,15664,20187,16128,
+16403,17634,21071,18201,23581,24784,24464,22279,
+25509,22437,24970,26000,23922,21638,20478,20816,
+16692,17659,16560,16292,16141,16072,16281,16710,
+16815,16836,16965,17196,17327,17362,18102,17902,
+20525,18332,18545,18657,18818,18877,19148,20207,
+19422,19358,23937,18974,19269,19054,19128,19298,
+18839,19086,19254,19633,19350,19265,19357,22858,
+29667,30941,20262,18392,18248,19071,19809,18763,
+19084,19503,19438,18900,19081,18750,18435,17035,
+16491,16766,15970,15646,16358,16570,16208,17404,
+17446,17622,16518,16817,17111,16608,16681,16896,
+16854,16541,16067,16939,17023,16890,16836,16937,
+16887,17749,17889,17583,17690,18332,17877,17655,
+17534,17262,17537,17855,17958,17970,18358,18498,
+18414,18974,18760,18623,19110,18932,18984,19533,
+20397,19590,19951,19756,23904,19982,20487,20083,
+20201,19908,20254,20659,20437,20658,20496,20662,
+20914,20769,20862,20801,21078,21312,21395,21305,
+22362,21130,21474,21511,21471,21747,22626,22955,
+22944,23292,23410,23313,23569,23845,24797,24327,
+23906,26666,30305,32611,32864,33348,38358,38883,
+37248,38525,39766,38825,39575,39373,39357,36310,
+36341,33730,33260,33138,32967,31391,27273,25701,
+24495,23507,22302,22083,22136,22402,22875,23814,
+32489,32762,32844,32857,32864,32860,32906,32871,
+32909,32885,32616,30750,28162,26571,31267,33195,
+33034,32669,32970,32988,33003,33004,33066,33252,
+33493,33688,33033,32992,32721,32251,31561,32870,
+32967,30991,25577,32406,28883,29034,27744,20785,
+21049,17469,16749,16530,16609,16521,16458,16656,
+17502,16805,15938,15674,15748,15533,15545,15516,
+15264,15642,15588,15652,15722,15768,15322,16358,
+16050,15768,16053,16119,16573,16128,16349,17117,
+15633,16665,17138,16425,16465,17313,17878,18024,
+19547,17660,18410,17607,19215,19420,20375,20496,
+20619,21918,23050,21523,22303,24957,23900,22959,
+20585,19649,21221,21143,19462,17615,17589,18322,
+18496,18375,16534,17311,16997,17469,15816,15671,
+19401,17055,16670,17251,16804,16963,17451,17682,
+18359,18387,17313,17338,17223,17203,16614,16429,
+16586,16698,16912,17169,17287,17430,17520,17769,
+18048,18378,18632,18868,19410,19854,20175,20916,
+20991,22297,23697,25126,28275,32944,33042,33451,
+33803,34316,33912,33861,33783,33877,33946,33906,
+34337,33962,33903,33842,33738,33744,33850,33978,
+34031,33984,33919,33931,33984,33912,33756,33732,
+33999,33621,33732,33964,33987,34005,34035,34039,
+34099,34095,34131,34249,34311,34363,34616,34715,
+34840,35370,35735,35922,35739,35457,35746,35834,
+36217,35741,34994,34922,34834,34793,34900,35099,
+35553,34919,35481,34859,34745,34641,35481,35982,
+35423,35516,35437,35445,35490,35947,37032,34888,
+34775,34716,34791,34641,34639,34636,34533,34486,
+34761,35199,35180,35124,34788,34873,34332,34023,
+33891,33818,33806,33790,33806,33849,33682,33697,
+33949,34202,33838,33930,34024,34544,35130,34294,
+33893,32867,31044,29333,30876,31001,33150,34308,
+37091,35874,35897,35942,35937,35690,35712,36231,
+36046,35779,35317,35003,35259,34554,34415,34080,
+33888,33717,33686,33618,33621,33461,33334,33270,
+33323,33318,33322,33366,33414,33309,33252,33259,
+33342,33567,33813,33724,33780,34048,33507,33026,
+25301,24063,23523,23485,26095,20655,27567,26281,
+24910,24858,25668,25187,26167,28370,28093,31774,
+32773,32988,33068,33213,33296,33413,33619,33178,
+33010,33032,33452,33286,33869,33565,33584,33542,
+33599,33711,33978,34364,35167,35302,35106,34422,
+34757,34981,34226,33892,33891,33861,34137,34203,
+33762,33552,34389,34369,33963,33177,33085,33010,
+33009,33010,33014,33046,33006,33006,32715,32890,
+33162,34131,38257,35425,35120,33565,33496,33236,
+33360,36237,35140,35993,35713,37499,35589,37168,
+37148,35763,36597,36822,36545,35200,36659,36921,
+33718,33414,33739,35176,34428,33648,33650,34321,
+33537,33172,33258,33855,33472,33528,35606,33139,
+33205,33091,33402,32986,32997,32892,32826,32813,
+32854,32851,32818,32886,32472,31545,30179,27834,
+30577,34245,30360,21600,18477,18703,17309,18815,
+17152,16236,18090,16122,15702,16416,15857,16469,
+18922,20095,16307,16917,15870,15549,15464,15629,
+15962,16086,16433,16206,17246,16512,19553,17170,
+18107,20067,18425,19287,18902,19527,18995,19632,
+19773,19461,20454,28468,25624,23228,24749,22698,
+23026,19401,19752,10815,13014,14243,15778,16538,
+16441,16230,16052,16242,16929,15749,16172,15896,
+16152,15891,15939,16613,15888,17229,18354,16617,
+16613,18447,17040,17155,16953,16506,23295,18638,
+17020,17672,18134,19430,21566,18991,17289,16926,
+16537,16281,16367,15553,15455,15342,15606,15777,
+15635,22453,14787,15640,15301,15569,15563,16131,
+16166,15851,17895,18927,17767,21285,24548,23233,
+17116,16953,18201,18847,20469,19680,17517,18178,
+17067,16146,15939,16140,16006,16281,16304,18348,
+16995,17124,17262,17462,17596,17710,17894,19830,
+18429,18600,18726,18897,18936,18939,18900,18649,
+18538,18507,19232,23242,18705,18612,18971,18990,
+19964,20244,20310,23289,23574,22875,25131,18651,
+19488,21354,19829,18543,18972,19305,19509,19920,
+20027,20571,19838,19613,18717,18118,17708,17154,
+16750,16774,16977,16381,16248,15681,16764,17250,
+17221,16418,16715,15781,16401,16801,15974,16453,
+16727,15659,15969,17241,17231,17622,17415,16774,
+18395,17557,17892,17982,17172,18012,17203,17391,
+17741,18087,18165,17957,18303,18552,18598,18798,
+18578,18517,18400,18551,19590,18942,19175,19648,
+20214,21052,19788,19513,21778,19854,20173,20119,
+20991,20478,20879,21493,20990,20750,20468,20755,
+20752,20339,21157,20913,21360,22010,20802,20940,
+21033,21405,21819,21527,21941,22492,24024,22905,
+23196,24196,25545,27504,28284,25137,24017,24924,
+24444,27752,29418,32660,33019,35587,39357,40567,
+39891,40695,39699,39501,39409,38664,38402,37359,
+36133,34390,33179,33159,32964,30326,27396,25632,
+24325,23038,22111,21782,21751,21759,21975,21792,
+21730,27695,30951,32314,32700,32808,32811,32844,
+32828,32838,31891,29847,29703,26265,26018,28036,
+33130,34432,33012,33035,33033,33044,33204,33126,
+33015,32058,32232,31609,31515,31892,32982,32905,
+29932,28230,26994,32991,30663,23901,18765,18324,
+17955,17492,17139,16690,16774,16456,16510,16860,
+16584,15853,15635,15503,15540,15517,15526,15442,
+15479,15498,15476,15434,15414,15333,15275,15318,
+15403,15137,16412,15587,16243,16578,14191,15903,
+15690,15422,17139,15819,15265,16170,18135,18003,
+18680,17184,19302,18660,17613,18968,18093,19947,
+22490,22516,22764,20654,24144,25027,25129,21421,
+20435,19949,19731,20168,18199,17245,16479,16997,
+16833,16009,16749,15498,15820,14881,18190,17460,
+16661,16824,17496,16551,15972,16998,15381,17172,
+16677,16316,16677,16632,16522,16059,16100,16297,
+16405,16525,16672,16930,17146,17329,17436,17642,
+17943,18258,18551,19011,19402,19854,20127,20811,
+21436,22179,23226,24185,27279,30771,32655,33225,
+33561,33822,33912,33948,33906,33912,34146,34188,
+34248,33901,33912,33987,33760,33724,33787,33861,
+33907,33937,33897,33847,33832,33795,33755,33819,
+33795,33693,33768,33906,33963,34044,34075,33984,
+33983,33994,34112,34329,34346,34377,34494,34685,
+35725,35912,37061,37761,36334,35991,35738,36201,
+36348,35799,35148,35261,35096,35179,35024,36137,
+35712,35325,35585,35043,35583,34841,35881,35355,
+35112,34976,35028,34802,34891,35207,36416,35202,
+34696,34737,34722,34602,34494,34356,34374,34421,
+34738,35589,35028,35255,35219,34491,34329,34173,
+33835,33721,33686,33635,33522,33459,33756,33694,
+33601,33897,33660,34224,34670,34485,34636,33149,
+32991,31074,29926,28830,30984,32280,33273,35088,
+36467,35733,36126,35794,35802,35733,35993,36017,
+35737,35814,35222,34968,35927,34921,34677,34205,
+33912,33774,33586,33510,33462,33416,33247,33159,
+33248,33339,33293,33304,33432,33332,33296,33412,
+33567,34125,34275,34208,34573,34353,36474,27762,
+23889,23409,23058,23260,24426,24287,20655,26380,
+29279,26181,26098,27039,27406,29128,32607,32706,
+32735,32988,32988,32988,32982,33188,33326,33162,
+33032,33072,33136,33462,33970,34308,34614,34648,
+34616,34200,33938,33870,33980,34209,34531,34660,
+34297,34977,35692,36044,34576,34229,35283,34848,
+34452,34641,34135,33577,33468,33503,33162,33020,
+33035,33021,33028,33018,33004,32941,33008,33037,
+33176,34224,36735,35223,35148,33350,33326,33408,
+34623,36467,35802,34866,35970,36985,36775,38191,
+37031,36288,36519,37326,36557,35331,36869,34704,
+35546,36368,35208,36244,34560,34485,34008,33479,
+33366,33250,33167,33879,33297,35031,33558,33591,
+33114,33658,33024,32992,33108,33098,32916,32925,
+32890,32915,32827,32958,32988,32902,32663,32274,
+32959,36516,31146,20829,18165,17536,15604,14944,
+15191,15302,16279,16329,17727,15878,15558,16796,
+19305,20546,16927,16931,16734,15543,15533,15562,
+15342,15875,16054,16834,21787,23895,18311,16980,
+17050,18816,16029,18924,18768,19462,19789,19816,
+20112,20673,22256,26865,24026,29643,22527,21543,
+25461,16089,12387,11963,13842,14835,15114,15556,
+15750,16146,15813,15777,16610,16041,15926,16096,
+17180,16929,23610,16194,16103,16861,18648,21456,
+18064,15928,16584,16496,16863,16739,16740,15954,
+16206,18940,16875,16606,18097,21239,16274,16227,
+15789,15618,15545,15904,17595,14932,15391,17287,
+14977,15835,18930,15333,15285,15816,15600,15951,
+16044,16225,16148,16192,19386,17477,23502,21165,
+18051,18717,17457,18141,16442,17346,17103,16938,
+16065,15999,15948,15939,15932,16057,16428,17439,
+17389,18038,17481,17760,17957,18199,18828,18611,
+18603,18716,18869,19062,19059,18703,18623,18453,
+18214,18191,18582,19009,19597,20870,24111,31842,
+22139,30459,29872,24407,31771,20027,18810,18556,
+18369,18517,18571,20107,19583,19945,20169,20592,
+20665,20583,19622,21213,19386,17975,17499,16932,
+16692,16573,16512,16614,16793,16691,16988,17477,
+17312,16960,16110,17088,16695,16638,16728,16653,
+16990,16595,17116,17903,17931,16408,17304,17324,
+17718,17574,17815,18025,18095,17937,18342,18704,
+18400,17969,18996,17454,17927,18571,19063,18924,
+18935,19032,18347,18394,17991,19181,19599,20012,
+21391,20606,20289,20098,19094,19383,20545,21830,
+20925,20671,20540,21139,20868,20775,20734,20622,
+20627,20796,20834,20817,20910,21276,20970,21042,
+21225,21244,21807,21368,21945,21897,22445,23013,
+23385,29584,31010,30540,33549,27486,24705,25228,
+25557,30096,32700,33076,35308,37335,39850,39893,
+39938,39507,39162,38858,39162,39563,38446,37102,
+37097,37620,33798,35061,32991,31312,27609,25988,
+25017,22920,21931,21750,21705,21729,21717,21741,
+21750,21591,21969,27052,32327,32397,32862,32735,
+32746,32808,31263,27240,29535,27632,26673,25107,
+25478,26622,28096,31392,31356,31912,32609,31655,
+31226,31544,32420,32409,32522,32329,32392,32688,
+31931,32991,25870,21509,19058,18155,17795,17451,
+17480,16970,16779,16526,16386,16526,16773,17204,
+16191,16178,15532,15528,15478,15578,15516,15484,
+15462,15419,15435,15339,15300,15279,15267,15682,
+15309,15363,14987,15287,16158,15494,15856,15009,
+16244,16522,16315,16576,17605,15644,17277,17237,
+17376,18283,17877,16566,19536,17767,17959,20869,
+20316,20492,21311,21867,23662,22431,22623,23485,
+21801,19578,16493,18577,20546,19563,17694,18415,
+16877,18052,17123,15777,15432,15606,15747,15676,
+15159,14711,15020,15426,16290,16437,14783,16623,
+15765,15952,17288,16267,16326,15924,16037,17119,
+16271,16510,16841,16795,16988,17326,17364,17622,
+17812,18186,18593,18918,19359,19747,20237,20907,
+21638,22332,23214,24661,26469,29610,32820,32739,
+33366,33558,33595,33693,33912,34027,34212,34020,
+34347,33846,34022,34099,33881,33774,33800,33814,
+33808,33873,33901,33825,33762,33790,33861,33950,
+33737,33613,33655,33777,33966,34083,34074,33963,
+33906,34081,34277,34307,34464,34641,34758,34809,
+35259,35710,36830,39954,37909,36468,36426,37083,
+36321,36030,35350,35455,35145,35688,35795,35548,
+35642,35321,34976,35037,34918,34775,35299,34968,
+34967,34771,34682,34633,34625,35304,35247,35137,
+34597,34629,34428,34755,34332,34260,34798,34311,
+34589,34897,34842,35066,35706,34580,34812,34026,
+33895,33756,33708,33630,33552,33560,33678,33785,
+33815,33519,34029,34289,34355,34248,33752,32993,
+31022,29892,27606,30177,31623,33018,33822,35193,
+35921,35792,36586,35838,35870,35883,36157,35747,
+35304,35581,35577,34938,34786,34967,34788,34362,
+34068,33900,33318,33518,33438,33302,33170,33071,
+33186,33320,33422,33441,33413,33372,33343,33530,
+33811,34644,39378,35328,35067,33684,27591,23555,
+22999,22855,22933,22947,23261,24585,25004,25935,
+22327,23576,28097,28407,29385,32553,30982,32955,
+32826,33051,33564,33393,33072,33027,33024,33036,
+33144,33242,33295,33297,33825,33996,34573,34434,
+34412,34387,34551,34418,34137,34170,34312,34124,
+34608,34998,34671,34504,34412,34596,34734,35700,
+35739,34878,34866,33764,33843,33450,33233,33107,
+33039,33021,33048,33033,33010,33013,33027,33306,
+33306,35110,36740,37776,34028,34523,33517,33840,
+33695,35153,36967,35031,37065,36896,37087,36928,
+37369,37401,36486,36339,39666,35055,38718,37150,
+37259,36784,37299,36206,35685,34931,34436,33771,
+33390,33335,33395,33117,33642,33212,33363,33165,
+33456,33042,33020,33063,33366,34194,33693,34458,
+33185,33060,32859,32931,32978,32611,32937,32838,
+33084,36697,33975,26047,18315,17050,18792,15759,
+15598,13324,13568,14185,16400,15253,15417,15428,
+16260,16553,16851,19103,18817,18044,16216,16417,
+16101,16597,20054,20480,22156,19581,17421,16349,
+17874,18761,19869,17036,18749,20493,20952,19706,
+20535,22503,27164,28713,25887,23659,20479,18285,
+17757,13631,14796,15030,15375,15291,15348,15474,
+15212,17012,15345,15658,15958,16039,16037,16439,
+16783,21504,28692,18921,16469,16905,16482,20612,
+16326,16527,16744,17953,17796,16340,16562,16429,
+17379,15990,18025,17176,27146,19635,17256,16147,
+15663,15340,15369,15486,15124,15021,15523,14736,
+15225,15579,14887,14951,15369,15594,15609,15391,
+15910,15525,16377,16428,16328,16434,16675,16303,
+18174,16295,16341,16169,16006,16581,15893,16164,
+15974,16014,16059,16125,16479,16600,16803,17487,
+17628,17945,17661,18321,17812,18447,20512,19016,
+18736,18869,19050,19113,19400,18791,18378,18224,
+17934,18128,20985,32893,25668,22626,25787,26661,
+19956,19819,19111,19114,20415,19599,18584,18684,
+18678,19022,18939,19256,19780,19945,20499,20164,
+20100,20337,20103,19470,18734,17735,17315,16617,
+16677,16605,16860,17031,16735,16854,16901,17031,
+17359,16830,17200,17342,17396,16595,16340,16423,
+17620,17941,15666,16437,17693,17778,16871,18003,
+18082,18117,18689,19134,19220,18051,18975,17884,
+19566,18407,17958,18057,18336,18272,18261,18044,
+18859,20215,19461,18494,19056,18964,19175,20142,
+19628,19937,20220,19583,20353,20286,20247,20239,
+20017,20282,20502,20239,20768,20742,20655,20255,
+20460,20403,20881,21021,21291,21324,21464,20977,
+21610,21423,21656,19879,20669,22261,23316,23993,
+31869,31062,32764,33792,33373,26112,25132,28737,
+29730,32753,33137,34746,40423,39381,39683,38589,
+40085,39155,39244,39091,39345,38899,38604,38978,
+41222,35674,33423,33117,32973,32298,28521,26787,
+24780,22749,21828,21669,21717,21666,21729,21799,
+21755,22093,21915,22112,22464,28008,32562,32436,
+32407,32024,29833,28675,22637,22574,22662,24688,
+26317,28870,28577,28326,28293,28557,29374,32936,
+32975,31264,32904,32867,32997,28852,28865,32982,
+27907,29745,32630,19667,17765,16476,16967,16779,
+16761,16568,16453,16644,16739,17106,17068,16482,
+15741,15815,15584,15579,15970,15541,15474,15506,
+15473,15442,15391,15322,15315,15150,15283,15361,
+15283,14980,14156,14327,16650,15670,14664,15745,
+16528,15872,15374,15623,19401,16941,15238,17337,
+17922,17469,18369,19818,19329,20214,19773,20630,
+21715,21846,19864,20876,20541,20143,22239,21162,
+20694,21018,20448,19758,18706,18252,17427,17529,
+18616,16741,17556,17382,14013,15732,17938,16390,
+15754,16494,16906,16293,15384,15668,15009,15710,
+14945,16090,16491,16633,16016,15921,15996,16091,
+16202,16484,16643,16815,16967,17107,17383,17603,
+17912,18155,18489,18867,19314,19878,20366,21181,
+21994,22558,23606,24713,25950,29706,32700,32882,
+33110,33495,33857,33564,33800,33909,33912,33912,
+33873,33825,34349,33930,33846,33813,33855,34011,
+33864,33922,33918,33927,33884,33919,33822,33835,
+33947,33711,33758,33796,34015,34099,34058,33975,
+33912,33939,34257,34514,34346,34614,34554,34779,
+35361,35853,36201,37358,37972,37970,36886,36649,
+36249,35638,35565,35476,35608,35934,35546,36004,
+35592,35198,34967,34762,34725,34783,34577,34937,
+34858,34751,34570,34551,34491,34497,35116,35277,
+34783,34352,34479,34686,34144,34135,34311,33984,
+34375,34802,35895,35735,36007,34711,34527,34404,
+34101,33879,33914,33637,33420,33609,33939,34076,
+34365,33621,34049,34197,33945,34245,34305,32991,
+30011,28793,30495,31779,32439,33285,34550,35649,
+35775,35726,35859,35862,35942,35991,35851,35813,
+35799,35931,35641,34927,35683,35305,34552,34473,
+34296,33912,33749,33612,33495,33363,33008,33036,
+33116,33279,33286,33289,33312,33362,33444,33637,
+34980,35553,33288,33017,32986,28438,23055,22976,
+22958,22941,22960,22972,22990,23089,23324,25459,
+26869,25845,24097,29904,32291,32717,32811,32775,
+33000,33060,33014,33003,33003,33057,33020,33061,
+33260,33430,33868,33626,33677,34415,34310,34361,
+34217,34218,34362,34251,34316,34574,34100,34140,
+34203,34201,34185,34317,34715,34186,34503,34338,
+34323,34710,34477,33849,33517,33351,33207,33103,
+33045,33033,33063,33024,33009,33008,33076,33472,
+33760,34691,36544,37076,34353,34101,33648,34087,
+33291,33907,36093,37627,36786,36879,36997,40001,
+36105,37797,37971,36748,37704,38038,36352,37443,
+37792,37469,37305,36089,36015,33526,34259,34311,
+33958,34158,33254,34338,33702,33526,34541,33160,
+33394,34477,33117,34505,33246,33441,34918,33757,
+34210,34009,33105,32944,32988,32031,32130,32842,
+33021,35361,38660,24972,25311,23721,19257,22802,
+24846,25619,22428,24720,15302,13001,14384,15715,
+15561,15825,18840,20154,20696,18456,19341,21537,
+20685,18839,24399,19174,23166,17820,18742,16943,
+21232,22611,18841,19278,17169,17608,18475,21125,
+22587,23930,27486,30969,23931,23387,18638,14291,
+10399,16041,15765,15777,15431,15364,15264,15723,
+15618,21377,15804,15509,17710,21200,15924,20058,
+17625,17700,17584,19000,17379,16799,16314,16184,
+16547,16251,24603,16411,22482,16962,25044,17785,
+15990,20700,16975,16089,27623,18611,16650,15606,
+15533,15086,14924,15250,15135,14229,14913,14256,
+17370,16857,14800,14882,15285,15153,15336,15128,
+15597,15630,15805,15783,15750,22912,16449,15671,
+15653,15992,15919,15765,16354,15810,15834,16082,
+16150,16158,16209,16409,16872,16893,16980,17024,
+17278,18025,17757,17824,20731,19485,19388,19545,
+19242,18965,18964,18816,19323,19278,23583,21436,
+28761,27578,31689,21543,23294,20774,19029,18642,
+18453,18432,18423,18850,19461,19046,19560,18725,
+18771,18976,19161,20712,19801,20327,20154,19899,
+19674,19228,19341,18462,18049,17642,17237,17075,
+16833,16713,17006,17090,16967,16885,16788,16702,
+16993,16900,17186,17256,17568,17829,17457,17520,
+17990,18619,19297,18420,18617,17808,18807,18498,
+17955,17886,17598,18539,18715,18557,18774,18624,
+19608,18670,19620,18740,18488,18423,18090,18764,
+19224,19143,20087,19455,19274,19648,19783,19494,
+19907,19977,19548,19436,20142,19794,20250,20289,
+20195,20562,20451,20363,20463,20254,20635,20793,
+20526,20421,20772,20987,21504,21375,21469,21424,
+21325,21400,21867,22306,22832,22613,24450,31353,
+32713,33045,34107,33267,29677,27406,28077,30891,
+32852,33024,33723,35863,39903,40339,39119,38854,
+39624,39268,38673,38205,38711,38806,38151,38334,
+36885,33654,33758,33431,33009,32658,29938,27294,
+24300,22562,21375,21771,21594,21909,21662,21754,
+21838,21755,21660,21966,22133,22503,25413,30310,
+31820,30154,27996,23836,22551,22694,22789,23668,
+29715,30811,31395,31298,31661,31864,30699,30798,
+31526,31269,32596,32829,33008,29653,32943,27523,
+29309,31206,19976,18273,16971,16766,16748,16570,
+16481,16427,16423,16429,16479,16408,15994,15713,
+16167,15951,15912,16278,15837,15800,16503,15567,
+15871,15624,15305,15356,15153,15292,15294,15325,
+15473,15714,15094,15366,15066,14157,15708,15890,
+14183,16161,15705,15888,16719,15868,17235,15777,
+17510,15979,18016,19701,18727,19281,18978,19263,
+21699,22436,24630,20762,24070,21065,21284,21660,
+21530,21125,21216,19494,19873,18500,17282,17499,
+17909,18531,18602,16218,16146,15742,17231,16328,
+17691,15936,15843,15444,15715,14998,15623,14910,
+15163,16482,15363,15588,16032,15861,15942,16017,
+16071,16333,16086,16218,16946,17164,17328,17641,
+17821,18090,18359,18855,19240,19576,20523,21202,
+22017,23455,24428,24877,25992,27293,30330,32769,
+32907,33114,33492,33768,33897,33908,33993,34232,
+33943,33849,34050,33643,33901,33717,33872,33922,
+34009,33988,33926,33912,33912,33912,33889,33912,
+33914,33846,33888,33882,33911,33995,34014,33957,
+33923,33978,34276,34370,34626,34744,34629,35191,
+35225,35889,36372,36145,36615,36684,36770,36419,
+36105,36042,35903,36346,36734,36077,35166,35904,
+35529,35202,35007,34788,34824,34610,34497,34854,
+34632,34346,34142,34062,34054,34029,34452,34612,
+34494,34262,34269,33906,33835,34531,34209,34275,
+33912,34419,34968,34722,35124,35040,34383,34270,
+33955,33918,34148,33927,33593,33870,34096,34288,
+34378,33491,33695,33797,34185,35952,33511,32277,
+29773,29700,31292,32994,33285,35088,35524,35769,
+35268,35632,35736,35894,35817,35887,36015,35734,
+35889,36016,35286,35135,35392,34977,34291,34152,
+34188,33894,33762,33603,33466,33363,33063,33016,
+32940,32989,32967,32973,33014,33159,33447,33853,
+34956,33088,32460,29764,25677,23272,23029,24186,
+24346,25512,26140,25180,25723,24258,23421,23620,
+23943,23896,25817,30993,32792,32772,32720,33030,
+33015,33021,33015,33012,33003,33043,33009,33196,
+33449,34130,34226,34182,34379,34473,34266,34209,
+34119,34057,34490,34357,34119,34371,34485,34037,
+34379,34086,33968,34028,34136,34052,33636,33711,
+34005,33839,34210,34004,33910,33593,33390,33142,
+33064,33056,33054,33023,33023,33007,33009,33145,
+33233,33290,36177,36919,33910,33372,33894,35284,
+34090,33261,33323,35830,35643,39103,37697,38537,
+39657,37965,39231,37744,38103,38956,38594,36985,
+37991,37424,35815,35192,34426,35680,34634,35644,
+33948,34419,33352,33447,35622,33819,33647,34075,
+35357,34115,33491,33353,34479,33637,33610,33534,
+34527,33631,34495,33333,32949,32820,32676,32647,
+32808,34335,39837,32655,26438,30036,32132,32709,
+31562,29247,27562,28683,27999,20426,13717,14308,
+16476,17102,19330,20401,21157,19911,24465,25452,
+23836,23472,19336,18548,18706,17975,17898,16548,
+20575,19910,16836,17957,18422,17289,18757,19773,
+20655,24920,27956,25776,25386,22554,19410,10532,
+18409,17168,16897,16332,15652,15396,15358,15447,
+15598,15684,15627,19393,27086,17445,16715,16311,
+22357,18014,16674,19694,20298,17468,16281,16232,
+16007,16061,15837,15249,15429,15736,19113,16656,
+16161,18297,16887,22487,16704,16579,16638,15377,
+16963,14718,14889,15126,15020,14373,19356,15035,
+14358,15081,14424,14752,15488,15039,15633,15448,
+15576,15425,15642,15782,15735,16191,16318,15534,
+15580,15809,15635,15588,15704,15914,15792,16235,
+16151,16384,16640,16915,19077,17042,17334,17296,
+17511,18104,18065,17904,28570,18296,26649,20361,
+19290,18915,19238,19812,19048,20293,22311,28999,
+27452,31572,19776,18236,18463,17880,18054,18356,
+18254,18147,18112,18277,18452,18562,18408,18988,
+19028,18751,18902,19260,19614,19182,19299,19241,
+19247,19006,18746,17703,17554,17151,17094,16842,
+16989,16825,16884,16938,16928,16776,16855,17229,
+17037,17036,17172,17440,17631,17664,18012,17762,
+17862,18218,18153,18556,18780,19520,18945,19029,
+18423,18484,18663,19042,18855,18552,18733,19871,
+19912,19472,19191,19263,19668,19167,18566,18186,
+19664,19528,19257,18778,19167,19584,19419,19755,
+19266,20015,19331,19410,19719,20037,20286,20122,
+19851,20325,20172,20910,20309,20208,20914,21246,
+20709,22561,20662,21125,21294,21385,21201,21392,
+22416,21492,21987,22140,22902,21964,30408,32844,
+33045,33421,33307,31530,28715,24197,29904,31890,
+33020,33420,34671,40248,39862,39577,39081,39727,
+38709,37488,37755,38721,38602,38280,39822,38976,
+35201,33894,34966,33270,33001,32954,32094,29422,
+24891,22533,21978,22025,21836,21775,21857,21882,
+22037,22114,22227,22187,22397,22185,22838,28056,
+27645,26099,23151,22967,22937,22894,22818,27205,
+32826,32820,32893,32988,32979,32993,32873,32103,
+30354,31305,32511,32997,32946,32123,31527,32620,
+28619,18337,18399,17709,17064,16761,16347,16391,
+16889,16406,16436,16304,16226,16149,16251,15937,
+16285,16281,16488,16054,16596,16296,16434,16065,
+15511,15558,15419,15528,15258,15459,15309,14817,
+15114,15485,15123,15624,15300,15012,15561,14504,
+14564,16944,17027,15981,15930,17241,16110,15934,
+16621,17965,17864,16412,19528,19473,20112,20120,
+19377,21325,23205,22724,22659,22744,21675,22431,
+22558,21010,19807,19191,19408,18979,18641,18994,
+18816,19343,18912,16342,18494,18012,16258,15465,
+15946,16529,16241,14903,14781,15918,15349,15750,
+14562,15487,15762,16139,16368,16008,15886,16284,
+16217,16643,16914,16874,17058,17009,17362,17482,
+17760,18030,18343,18721,18993,19575,20292,21034,
+22272,23283,24055,24594,24642,25570,28684,32629,
+32885,32733,33358,33519,33808,33815,33912,34220,
+33850,33831,33864,33810,33881,33782,34124,34162,
+34247,34139,34167,34068,33912,33909,33912,33912,
+33912,33912,33846,33912,33871,33891,33969,33966,
+33922,33903,34585,34809,33893,34661,34650,35377,
+35361,35812,36054,35658,36210,36282,36659,36612,
+36465,36369,36828,37202,35473,35397,35109,35867,
+35517,35247,34935,34793,34828,34659,34864,34544,
+34149,33906,33501,33837,33883,33660,34279,34314,
+34219,34147,33927,33876,33868,33885,34360,34178,
+33984,33912,34361,34310,34766,34813,34506,34308,
+34118,34187,33887,33987,33440,34101,34206,34419,
+34496,33435,33652,33987,34484,34287,32921,31168,
+29457,30010,32996,36366,35072,36336,34714,35853,
+35496,35601,36173,35827,35634,36023,35900,35721,
+35572,35372,35277,35002,35714,34841,34782,34644,
+34316,34019,33783,33560,33443,33009,33078,32990,
+32944,32944,32970,32950,32955,33040,33276,33849,
+34323,32602,29553,28515,28738,27942,28836,28981,
+28707,28934,29550,30426,28207,27870,28233,28025,
+29490,29421,28065,28875,32604,32895,32997,33017,
+33018,33021,33009,33154,33287,33181,33051,33165,
+33696,34164,34776,34935,34344,34649,34229,34410,
+33798,33927,34350,34527,34028,34011,33919,33813,
+34285,33942,33722,33923,33903,33879,33924,33896,
+33349,33327,33343,33735,33383,33543,33390,33126,
+33060,33059,33074,33030,33060,33011,33012,33027,
+33125,33057,34692,36142,36167,33399,33597,33849,
+33897,33855,33633,39135,36828,39216,40331,38966,
+37083,39019,38890,38121,38691,38829,38088,38589,
+37838,36438,36567,34913,35732,34718,34314,34773,
+34242,34020,33833,33756,34712,33598,33543,34759,
+33807,34669,33796,33567,34669,34274,34434,34644,
+34594,34074,34637,33036,33278,33015,32896,32739,
+32792,32847,35778,33016,32143,30045,28070,27484,
+30132,32979,33018,31321,28376,27357,22090,12258,
+14768,17076,19740,20836,19165,20130,25407,22945,
+18828,18117,18543,22164,23155,21278,17107,17284,
+19149,18972,17697,16129,17551,17850,19026,20029,
+23939,25727,31221,25548,25332,24390,15083,17379,
+19605,18235,17388,16410,15836,15612,21638,15568,
+17805,17156,15568,16526,16422,16090,16059,16716,
+17781,22876,16347,16656,16304,16229,15942,16058,
+16080,16096,15926,14940,15336,17437,15864,16147,
+16505,16554,17076,22479,17461,18105,18828,15860,
+15466,15372,15187,14489,15591,15636,14789,17797,
+15021,14148,15052,14407,15515,15416,15161,15192,
+15460,15385,15466,15567,15501,15713,16007,16158,
+15478,15464,15552,15633,15729,15891,15867,15882,
+16213,16694,16458,17008,17169,17387,17258,17631,
+17667,18053,18414,19045,19602,18052,18123,23757,
+22668,20144,26364,30339,23268,22569,23381,31379,
+30090,26562,18087,17960,18324,18611,18636,18199,
+19101,18264,18102,18435,22564,18394,18282,18254,
+18489,18559,18353,18530,18347,18570,18951,18371,
+18717,18890,18609,17675,17364,17035,16693,16617,
+16481,16665,16374,16989,18018,16821,16959,17267,
+17139,17042,17572,17553,17391,17835,18037,17291,
+17940,18539,19072,18785,19115,19000,18666,18722,
+18453,19078,19031,18664,18813,18796,18476,18612,
+18360,18700,18939,18795,19048,19665,19516,19740,
+18951,18576,19317,19166,19121,19041,19253,19716,
+19608,19994,19414,19781,19647,19655,20251,20249,
+20283,20177,20045,20607,20407,20886,20847,21157,
+20730,21180,21279,20562,21634,21572,21063,21540,
+21717,21507,22714,21714,21591,27747,32016,32798,
+33108,33932,30909,27031,25779,27990,32880,33027,
+33382,34812,37923,40353,39572,39352,38706,37693,
+37036,37962,37110,36645,39162,38655,39317,38414,
+34011,33554,33410,33245,33004,32799,32748,30990,
+27942,23100,22360,22083,22066,22244,22487,22709,
+23100,22790,22691,22653,22506,22841,22701,22749,
+22769,22862,23170,23235,23138,23112,22962,32383,
+32705,32832,32875,32919,32988,32993,33003,32982,
+30735,31119,32829,32988,26109,27333,32299,32842,
+18579,19223,19165,18139,17922,17008,16585,16502,
+16509,16492,16392,16308,16271,16277,16282,16440,
+16180,16824,17292,16761,16900,16471,16371,16850,
+16456,16251,15683,15352,15102,15161,15330,15185,
+15347,14967,15441,15501,14807,14315,14411,15071,
+16111,15840,14296,18246,16074,15651,18905,17467,
+18352,18066,19010,17868,17889,19797,19521,20967,
+20896,21153,22457,23040,25861,25799,21996,20744,
+20778,21952,21643,21660,20298,20385,18869,18706,
+18653,17991,18341,17838,17812,16920,15852,15142,
+16453,15648,15102,15093,15600,15912,15119,15351,
+15185,15098,16283,16167,17220,16176,16896,16698,
+16956,16682,16666,17600,17068,17240,17352,17503,
+17722,17924,18304,18544,18993,19425,19807,20441,
+21420,23043,23949,23936,23482,23959,25349,30890,
+32676,32897,33427,33411,33623,33724,34128,34102,
+34351,34161,33911,33909,33921,33984,34296,34313,
+34189,34247,34309,34069,34140,33912,33912,33915,
+33912,33912,33903,33843,33903,33866,33963,33870,
+33915,33957,33939,33922,33878,34020,34341,35187,
+35996,35579,35730,36397,36165,36215,36663,36687,
+38129,37342,36972,35946,34979,35208,35091,35601,
+35410,35088,34840,34682,34746,34539,34692,34784,
+34700,34293,34416,34159,34103,34188,34115,34031,
+33966,33962,33780,33730,33845,33910,34181,34424,
+33912,33912,33923,33912,33912,33912,34005,33910,
+33846,34014,33672,33504,33527,33267,34227,34319,
+34547,33474,33683,34127,34686,33128,30968,30809,
+27914,30004,33129,35857,34587,34275,35799,36366,
+36265,36376,35999,35579,35351,35586,35602,35563,
+35335,35260,35124,35064,35009,35078,34748,34473,
+34185,34050,33833,33412,33284,32969,33135,32895,
+32940,32928,32934,32913,32973,32879,32947,33309,
+34226,32485,29391,30911,32252,31453,32630,32440,
+32952,32968,33020,33014,33020,32993,32999,32843,
+32988,32988,32788,32912,32792,33093,33742,33510,
+33036,33036,33027,33111,33253,33441,33332,33153,
+33301,33645,33864,35035,34486,34168,34248,33795,
+33680,33840,34005,34312,34000,33849,33537,33688,
+33408,33372,33472,33359,33217,33252,33209,33195,
+33234,33187,33150,33133,33104,33135,33093,33060,
+33114,33075,33060,33057,33161,33451,34196,34730,
+35125,36614,36197,38214,36720,37883,33480,33688,
+33986,33805,33490,38752,39252,40119,39489,39387,
+38361,37997,38818,39394,38662,40131,38915,39750,
+38772,37422,37284,35144,36464,34741,35078,34995,
+34338,35146,34628,34704,33471,35247,33770,35157,
+35416,33978,34322,34005,34099,33603,34908,33997,
+34801,35227,34959,36213,33888,33417,33111,32964,
+32982,32653,32756,32973,32395,29288,28353,26840,
+26255,26322,27501,30825,31815,27589,26062,23250,
+14250,15918,18519,18162,20400,22898,22747,21376,
+18109,19092,24101,18950,16902,18243,18755,21583,
+20694,16501,17072,17430,19458,18360,18850,20881,
+24550,25148,30828,24078,26128,25991,17609,27120,
+22994,18989,16596,16077,16022,15743,23720,15209,
+21137,19723,16528,15467,15831,16124,15471,16137,
+16373,24228,16171,16049,15848,15750,15585,15891,
+15226,15073,15318,15360,15245,15280,15588,14886,
+15550,15705,16018,16032,16771,16050,15840,16315,
+15409,14945,14856,14351,15191,14931,16432,14630,
+14368,14625,15030,14359,15214,15201,15049,14973,
+15126,15185,15532,15428,15349,15438,15275,15300,
+15362,15377,15387,15716,15816,15909,16030,15943,
+16415,16734,16733,17385,17275,23120,17328,17317,
+17441,18051,19760,22515,23194,23494,23004,23931,
+32142,26471,30249,22718,21600,29820,27069,23117,
+29590,24809,18565,18792,18695,20016,19035,20627,
+18546,18589,18248,17946,18066,18444,18050,23099,
+18903,17976,18085,17901,17799,18296,17931,17948,
+18024,17535,17430,17299,17037,16824,16841,16926,
+16786,16374,16608,16704,16164,16805,17133,17193,
+17150,17413,17347,17610,17628,17822,17995,18168,
+18385,18538,18707,19000,18885,19061,18873,18947,
+18708,19090,18696,18730,18710,18866,18908,18925,
+19161,19157,19193,19329,18681,18499,19192,19064,
+18669,18685,19069,19035,19224,18993,18774,19797,
+19773,20178,20322,19725,19497,19491,19775,19886,
+19511,19985,19983,20846,19854,20846,20513,20042,
+21217,20222,20348,21493,20705,20940,21542,21541,
+21626,21867,22145,22151,25896,31941,32689,32319,
+33467,33179,32637,27520,29984,33013,33042,33219,
+34250,35437,39699,40614,39231,37953,38723,38130,
+38100,36319,36262,36389,36482,36924,36314,34401,
+34191,33414,33726,33156,33042,33003,32891,31764,
+30347,27126,23157,23147,23058,22987,23277,23949,
+23833,22968,22823,22737,23241,23283,23443,23596,
+23487,23198,23382,23451,23516,23195,29245,32473,
+32673,32847,32876,32926,32956,33000,33009,33007,
+30752,32973,32988,32871,32971,26658,21533,18640,
+18727,19197,19431,18202,17649,16832,16816,16774,
+16615,16484,16423,16493,16490,16499,16401,16571,
+15991,16695,16578,17134,17268,15537,15966,15931,
+16476,15996,14968,15252,14799,14845,15475,15142,
+15784,15637,14170,14656,15432,14539,15539,15819,
+17197,16320,17595,17155,16150,17880,16200,18183,
+17568,17872,18006,17802,18222,18631,19847,19207,
+22076,21210,21975,24143,25200,24267,26306,20756,
+20587,21496,20544,19068,21493,19894,20057,19602,
+19111,19862,19200,17029,18248,17382,18417,17652,
+16824,16332,16695,15294,16023,15662,16022,15460,
+14541,16625,15922,17604,16548,16858,15868,16138,
+17090,17113,17362,25143,17039,17379,17471,17391,
+17748,17895,18117,18428,18783,19188,19612,21633,
+21126,22416,23477,23304,22832,22848,23101,25806,
+31473,32430,32777,33332,33336,33481,33963,34415,
+34574,34341,34262,34178,34129,34020,34132,34169,
+34204,34382,34638,34144,34342,34386,34154,34348,
+34053,34017,34053,33912,33939,33905,33873,33744,
+33751,33915,33765,33809,33893,33945,34529,35209,
+35133,37298,35082,35706,35649,36605,36352,36822,
+36990,36384,35514,35229,34859,34948,35023,35600,
+35085,35157,34654,34485,34430,34302,34571,34566,
+34747,34527,34503,34524,34114,33951,33859,33861,
+33787,33900,33726,33675,33819,33869,34236,34192,
+33921,33912,33821,33901,33912,33912,33912,33912,
+33534,33938,34503,34546,33935,33888,34171,34009,
+34203,33273,33572,34339,34317,31474,30665,29800,
+30260,33005,33702,34407,33972,34923,35187,36718,
+36515,36207,35922,35621,35357,35172,35049,35180,
+34950,35012,35508,35118,34738,34893,34572,34294,
+34073,33788,33768,33193,32972,32971,33110,32919,
+32898,32880,32856,32877,32811,32841,32899,32901,
+34392,32679,32620,32999,33036,33090,33045,33550,
+33552,33385,33063,33420,33111,33173,33523,34108,
+34041,34027,33389,33657,33039,33360,34027,33629,
+33135,33059,33040,33085,33200,33548,33696,33435,
+33329,33456,33617,33922,34521,34217,33953,33885,
+33665,33756,33958,34065,33620,33531,33459,33376,
+33326,33308,33269,33253,33255,33246,33192,33184,
+33147,33141,33127,33123,33102,33112,33098,33085,
+33117,33092,33095,33093,33645,33966,35382,35325,
+35397,33691,33486,34323,35554,36350,34732,33906,
+35176,34039,34197,35208,38859,42342,39294,40635,
+39675,39690,39087,36729,40272,39826,39203,39395,
+39214,38210,37026,34699,36390,35923,35748,35763,
+35082,34542,34293,34426,35269,33598,34620,34697,
+33842,33778,35871,35598,33984,33351,34464,33929,
+34881,34137,36196,35380,35057,33726,33600,32989,
+32893,32492,32637,32582,32612,32496,32584,32795,
+29544,27001,26965,26910,31126,32028,29610,26815,
+24295,16662,14046,16077,19567,18312,25476,28073,
+27828,26520,25419,22736,20939,22230,23538,22868,
+18794,16929,17125,18153,17142,17724,18978,22057,
+24533,25684,24832,23320,25398,25779,16465,25884,
+24384,17524,20673,22593,21159,21791,26325,28584,
+23903,23083,15564,15569,15375,15538,15609,17046,
+15806,15784,17673,16601,15328,15469,15338,15158,
+15162,15064,15042,15093,15159,15144,15170,15126,
+15280,15034,14903,16287,15555,16213,19027,15478,
+15178,14981,15758,15070,14730,15099,14865,14841,
+14303,18178,18803,15368,14990,14985,14985,14815,
+14961,15130,15465,15639,15440,15456,15524,15337,
+15264,15872,15555,15861,15860,16408,16038,16095,
+19224,17574,16935,17213,17511,17898,18119,17801,
+17511,17470,19150,22953,25818,25068,18126,18922,
+22977,19469,19475,19399,19626,19552,21347,19605,
+19496,19359,19446,19441,19634,19582,18921,18662,
+18105,18543,17976,18619,19070,18165,18679,18073,
+21436,22464,20322,21105,17792,17406,18512,17427,
+17301,17109,16626,17067,17088,17032,16731,17004,
+16888,16705,16034,17015,16884,16695,16628,17096,
+17184,17408,17697,17516,17658,17427,17430,18144,
+18057,18124,18912,19130,19014,18712,18959,18784,
+18833,18741,18887,18644,18477,18742,18836,19205,
+19539,19440,18881,19520,18985,19344,18757,19301,
+19248,18866,18809,19038,18795,19030,19245,19563,
+19457,18959,20590,19631,19476,19437,20509,20382,
+19871,20176,20445,25795,21306,23161,20646,20894,
+20810,21063,21024,20723,21094,21051,21683,22537,
+21863,23213,24764,24358,30921,32753,32778,33573,
+34334,32085,28574,28433,31826,32993,33186,34209,
+34760,38948,40158,41038,38577,38983,37776,36981,
+36307,37405,35553,37810,36411,36439,35442,35052,
+33882,33428,33157,33105,33033,32992,32883,31946,
+29365,27978,25698,25416,27278,25989,27197,26596,
+25450,26625,23698,23355,23865,23897,24533,24555,
+24408,23913,24006,23686,23381,23337,30391,32422,
+32727,32844,32912,32974,33012,33015,33009,33012,
+31433,31641,31497,29657,29523,32901,19560,18386,
+18458,18753,19203,18762,17781,17772,17472,17265,
+16755,16549,16545,16524,16588,16589,16745,16665,
+16888,17065,17460,17922,17700,16496,16547,16184,
+16330,16317,15217,14811,14967,15228,15821,14503,
+14637,15231,15027,14522,15325,14333,14193,15297,
+14812,16098,16302,16529,14778,16965,16834,15753,
+17023,18075,18334,19935,18843,18099,18354,18713,
+20126,21012,19849,19937,23994,23578,21211,25198,
+22051,20015,20061,21074,20509,20244,19975,18914,
+19860,18788,18078,18239,18257,18023,17685,17646,
+16480,16547,16210,16398,16406,16148,15101,14844,
+15863,16119,16043,16740,17418,17295,17144,17607,
+17217,17664,18023,17555,16980,17247,17391,17604,
+17748,17961,18117,18387,18705,19077,19565,20385,
+20841,21802,22819,22229,22233,22281,22245,22735,
+25543,30158,32187,33179,33515,33906,33693,33930,
+34131,33933,34368,34380,34264,34209,34221,34200,
+34047,34123,34318,34374,34293,34909,34080,34539,
+34334,34057,34310,33912,33912,33912,33921,33759,
+33579,33453,33456,33453,33601,33762,33974,34377,
+34495,35451,34863,36030,35316,34807,35673,35921,
+35409,35235,35433,35176,34751,34921,34782,34860,
+35264,34772,34522,34466,34392,34399,34316,34350,
+34412,34474,34686,34133,33872,33759,33692,33651,
+33642,33728,33599,33570,33639,33669,33877,34026,
+33799,33765,33467,33446,33891,33912,33804,33734,
+34014,33666,33617,34091,33919,33898,33996,33522,
+34157,33311,34146,34522,32631,30977,29739,30426,
+31350,33495,34677,35743,34641,36531,36581,36989,
+36454,35941,36093,35613,35676,35617,35302,34929,
+34923,34962,35106,34975,34746,34584,34381,34029,
+33888,33697,33473,33052,32951,32988,32988,32922,
+32856,32810,32778,32756,32781,32780,32807,32765,
+32978,32728,33094,34227,34803,34224,33843,33950,
+34579,34586,34773,34498,34114,34902,34729,34986,
+35749,34591,34476,33796,33203,35479,34055,33186,
+33059,33066,33091,33165,33285,33595,33728,33634,
+33586,33549,33642,33851,34176,34180,33984,33789,
+33762,33984,33566,33749,33564,33458,33422,33375,
+33369,33369,33333,33311,33249,33270,33196,33182,
+33197,33191,33149,33131,33180,33178,33140,33141,
+33152,33144,33144,33191,33239,33072,33096,33199,
+33138,33584,34407,33477,34212,38211,38299,33881,
+33870,33774,35609,34878,35693,42543,41026,41968,
+40302,39384,40062,38988,37719,38196,43828,39293,
+39253,37858,36973,37100,36835,36799,36704,36051,
+36729,35764,35046,34355,35065,34833,33529,33678,
+33804,33806,33627,34862,34295,33792,33645,33675,
+33792,34132,34789,35254,34053,34952,34407,32943,
+32925,32868,32560,32714,32720,32709,32613,32585,
+32538,30615,30016,26865,28715,30822,32607,33102,
+29625,25512,17546,14478,17235,25625,23136,21617,
+20808,17381,17319,17286,17396,17605,19142,27066,
+19008,17269,17879,17345,19137,18278,19647,21666,
+23928,26001,25721,22554,28117,25206,24245,23414,
+26439,25521,29669,18454,16980,16848,16777,16551,
+16980,14165,14633,15823,15451,15579,15621,16017,
+15846,15252,15003,14962,15882,15382,15310,14900,
+15114,14768,14726,14802,14908,17340,15493,15268,
+15096,14916,14438,14958,15306,16573,15164,14983,
+15768,15768,15610,15193,14792,14769,15231,16431,
+14480,14766,15226,15358,16371,15163,14649,15110,
+15045,15195,15009,15447,15418,15284,15371,16158,
+15546,15609,16202,16270,16391,16070,16162,16369,
+16895,17081,17081,17348,17688,18857,21083,22087,
+17782,17027,17397,18453,18051,18027,18060,18751,
+18168,18562,18898,18999,19692,19781,19546,20516,
+19992,21260,21864,19649,19298,19179,18795,18455,
+18146,17538,17840,17964,20142,21963,17583,19185,
+17625,17961,19703,18013,17565,17166,17121,17186,
+16856,16836,16707,16421,16111,16460,16654,16794,
+16652,16612,16717,16389,16485,16809,16917,16908,
+17693,16968,17511,16777,18048,17939,18232,18345,
+18513,18524,18339,18425,19311,18680,18493,18499,
+18856,18985,18988,18696,18777,20132,19904,19951,
+19341,18811,19219,19397,18447,19202,19095,19610,
+19245,19016,19189,19072,19278,19387,19009,19447,
+19533,19494,19299,20117,19530,19357,19488,20447,
+19665,20493,19381,20644,21504,20526,20304,20965,
+21339,21558,20329,20781,21514,21381,22407,21654,
+22158,23046,21375,25312,32676,32985,34036,35481,
+33842,29723,28214,29793,33000,33236,33727,34493,
+37324,40376,39931,38736,38849,37861,37564,36627,
+36372,36484,37396,37179,37209,37317,34735,34086,
+33416,33231,33461,33128,33015,32910,32808,31443,
+29315,28413,28534,29500,28789,28572,28079,27520,
+27384,25824,27209,25302,24893,24744,25746,25236,
+24613,24521,23887,23694,23547,23401,32034,32553,
+32772,32881,32913,32995,33011,33018,33011,33012,
+31766,31034,32988,32996,32973,32959,28161,18339,
+18680,18855,19203,19820,19103,18279,17754,17452,
+17133,16622,16339,16443,16578,16759,16945,16927,
+17282,17508,17427,17769,17828,17238,16864,16530,
+16336,15786,15441,15114,15012,15720,14397,14748,
+14871,15402,14056,15283,14403,15058,15450,15552,
+14857,15690,14747,16736,16665,17739,16688,16635,
+17090,17262,17910,18480,18620,19576,19056,20224,
+19525,19235,21524,20811,20711,23209,24154,24355,
+22622,21681,20475,21591,19792,21010,20007,20091,
+19011,18965,18046,18259,18219,18023,16556,17345,
+18127,17887,16845,17272,18214,17514,16038,17643,
+17826,16455,16115,16304,17041,17028,17449,17313,
+19804,17681,18036,17926,17168,17445,17524,17564,
+17779,17969,18203,18355,18575,18918,19257,19839,
+20586,21413,21859,21780,21880,21960,21926,22451,
+22966,24066,26874,30429,32810,33456,33559,33684,
+33495,33595,33770,33992,34510,34293,34324,34197,
+34241,34088,34212,34446,34240,34407,34480,34875,
+34687,34105,34199,33891,33932,33912,33912,33939,
+33768,33855,33607,33555,33676,33844,33970,34290,
+34443,34850,34707,35594,34437,35074,35301,34785,
+34819,34664,34664,34698,34600,34783,34582,34569,
+34697,34479,34545,34646,34490,34414,34424,34389,
+34482,34776,35013,34715,34110,33891,33713,33680,
+33569,33565,33499,33435,33440,33535,33615,33841,
+33703,33642,33456,33517,33590,33912,33780,33357,
+33391,33458,33814,33885,33723,33846,33805,34048,
+34496,33611,34515,34033,30918,29737,30035,31198,
+33483,33893,36446,36957,36174,36300,36396,36219,
+36162,36387,36168,36004,36212,35544,35254,35002,
+34611,34820,34828,34662,34367,34272,34175,33931,
+33516,33348,33154,33042,32894,32958,32981,32866,
+32816,32780,32893,33579,33104,33013,32975,33097,
+32832,32833,33862,37551,36843,36073,35497,35480,
+36209,37636,36414,36473,36421,35933,36039,35598,
+36378,36774,36954,35262,36435,35664,33634,33072,
+33129,33191,33181,33188,33336,33785,33795,33769,
+33792,33825,33867,33980,34029,34329,34048,34011,
+33932,33732,33983,33551,33482,33377,33401,33395,
+33351,33370,33314,33309,33253,33229,33190,33224,
+33205,33198,33175,33198,33272,33526,33483,33976,
+33478,33337,33705,34066,33537,33661,33206,33255,
+33425,33306,33231,33217,33387,34120,35664,34732,
+33858,33903,40134,34608,40333,43142,42029,40993,
+40081,39974,38833,37992,38977,40021,40685,39750,
+39789,39163,38647,37320,36729,36954,36399,35974,
+35100,35569,34604,34155,34732,34439,35356,33372,
+33375,33216,33357,34768,33975,33200,34071,34471,
+33927,34517,34773,34607,34018,34491,36152,32997,
+32981,32874,32890,32490,32581,32785,32499,32518,
+32595,32637,32541,30058,27467,28653,30873,33027,
+33462,25993,22777,20098,18830,19670,17361,15775,
+16373,18807,17038,19119,17769,20019,28227,20531,
+17577,17406,18792,18207,19505,18713,19705,21262,
+21846,26104,25042,22107,32353,24956,14519,18099,
+17835,17185,17576,17484,16833,16551,16243,15540,
+14874,16129,14972,15224,15550,15587,15362,14832,
+16958,14926,15099,14943,14969,14586,15149,14988,
+15413,14827,14730,15192,15201,15618,15540,15130,
+15375,15287,14911,15122,15810,15678,16617,14818,
+15115,15739,15461,15096,15171,14684,15371,15496,
+15307,14077,14876,17095,15651,14611,14944,14766,
+14832,14885,14934,15109,15355,15645,15457,16008,
+15993,16222,16808,16806,16748,16403,16581,16743,
+16954,17085,17267,17753,18510,18310,18717,20988,
+18996,17032,17163,17510,17684,17689,18054,18070,
+18147,18531,19120,19295,19985,19877,20037,19896,
+20002,19595,19413,19560,18959,18576,18785,17931,
+18087,17383,17806,18130,20422,20464,23320,20347,
+17498,19000,17276,17126,16542,16409,16288,16815,
+16269,16368,16254,16273,16552,16426,16893,16513,
+16461,16797,16831,17093,16533,16649,16647,16912,
+17273,17147,17875,17729,18095,18138,18188,19239,
+18624,18507,18393,18366,18300,18137,17991,17991,
+18219,18776,19278,19610,19322,18874,18810,19159,
+19163,18974,19533,20139,20682,20068,19984,18949,
+19396,19247,20244,18664,19295,20254,19545,19304,
+19410,19146,20289,19944,19776,20694,19875,20059,
+20547,20307,19776,20673,20658,21087,21239,20834,
+20836,21513,21555,23123,20526,21339,21759,21877,
+22937,20889,30342,33423,33696,33054,33972,33162,
+28446,27411,29609,33039,33165,33358,35526,37125,
+38101,39416,39003,38027,38031,37342,37872,37809,
+38070,36392,36822,35862,35015,34199,33934,33598,
+33511,33433,33558,33162,33032,32970,32818,32341,
+30402,29442,29451,29619,29836,30180,29496,28893,
+28576,28273,28839,28946,26847,26382,26447,25700,
+24784,24373,24037,23738,23721,29375,32276,32649,
+32877,32907,32950,33030,33068,33026,33026,33000,
+31862,31422,32980,32963,30113,29079,27773,18228,
+18587,18864,19141,19881,18702,18360,17763,17786,
+17259,16671,16476,16324,16398,16861,16872,17252,
+17564,17644,16981,17538,16512,16818,17355,16905,
+16700,15519,15502,15580,15023,15225,15651,14972,
+15738,14232,14994,14463,14877,15198,13907,14454,
+15186,16036,16430,17252,16339,17499,17232,18329,
+17310,15496,18372,19423,18921,18963,19018,19034,
+19860,20154,21036,20327,22200,21463,22947,21393,
+23625,22118,21993,22533,21996,20537,20381,20292,
+20236,18642,19048,17838,18449,17805,18015,17417,
+17486,18464,18238,16731,17437,17550,16992,17476,
+17330,17174,16885,16915,16733,17654,17606,17406,
+17777,17121,17808,17760,17418,17567,17348,17463,
+17748,17918,18199,18288,18448,18799,19114,19527,
+20117,20640,21276,21567,21787,22044,22240,22644,
+23215,24242,24964,26435,29361,33203,33366,33670,
+33972,33597,33797,34425,34532,34405,34347,34308,
+34169,33913,33870,34048,34185,34177,34417,34606,
+34407,34190,34047,34032,34141,33912,33852,33731,
+33921,34011,33985,34037,33908,33873,33939,34174,
+34241,34548,34475,34480,34221,34384,34322,34440,
+34614,34633,34755,34641,34375,34518,34633,34593,
+34541,34364,34014,33910,34191,34269,34434,34479,
+34782,35141,35712,34927,34111,33892,33720,33714,
+33623,33495,33465,33369,33322,33422,33537,33591,
+33591,33537,33498,33788,33453,33452,33331,33849,
+33170,33827,33875,33542,33495,33536,33156,34108,
+34808,34162,36037,33081,30188,29984,30829,32878,
+34086,37215,36679,36584,36017,35875,35860,36110,
+35930,36006,36862,36143,36130,35358,35124,35040,
+34697,34629,34584,34401,34263,34092,33902,33744,
+33377,33108,33020,32941,32847,32815,32793,32847,
+32799,32558,35914,34095,35859,34083,33771,33097,
+33182,33026,33651,35301,34281,34060,34113,34237,
+34396,34749,37358,36955,36470,37302,36348,36570,
+36956,36755,36692,36978,36747,36478,34626,33098,
+33087,33262,33183,33180,33385,33588,33440,33638,
+33664,33727,33904,33907,33954,34157,34223,34545,
+34283,33873,33585,33509,33509,33499,33456,33400,
+33401,33370,33380,33354,33292,33251,33264,33268,
+33293,33430,34290,34089,35585,37936,35049,36394,
+36575,39698,43768,41985,40352,38856,38645,43022,
+40050,37736,39205,34441,33274,33301,33338,34213,
+35457,35859,35816,35571,40050,43668,40358,40554,
+41557,40614,41040,38843,38619,40896,39301,38615,
+38397,37700,37593,37732,36399,35608,35415,35796,
+36045,34334,35056,33815,35577,34087,33898,33807,
+33733,33296,33653,34273,33993,33274,33214,33594,
+35715,33666,35274,34809,34029,33874,35529,34821,
+33242,32958,32765,32604,32608,32691,32661,32616,
+32652,32700,32666,32612,28970,27693,29830,30564,
+31965,31218,28194,24706,19430,18447,18544,16065,
+17253,18267,17874,18645,19049,18963,23873,18230,
+16770,18092,19434,19648,18330,19056,21627,23472,
+22970,28752,22859,20950,32431,24349,9327,17916,
+17748,17216,30126,16436,16305,16248,15934,15441,
+15623,18291,15282,15086,15256,15073,15174,28911,
+17108,15459,14570,15108,14682,15272,15290,15127,
+14773,14925,15217,14830,14742,15250,15563,15301,
+15057,14901,15152,15245,15322,15085,15376,15593,
+15106,16569,15388,15080,14721,15115,15186,15169,
+15275,15367,14828,15736,15099,15024,14148,14934,
+14712,14727,14765,14890,15087,15344,15737,15920,
+15998,16746,17177,16926,16945,16665,16941,16886,
+17034,17318,18058,22682,20296,19064,18302,19955,
+29117,20781,18381,16755,17494,17480,18126,18393,
+18152,18822,24412,18939,19480,19487,19449,19717,
+19767,19198,18964,19039,18223,18105,18061,17318,
+17543,18973,17876,17824,23681,19829,18359,18618,
+16859,17483,16527,16144,16135,16257,16491,16029,
+16416,16113,15848,16091,16395,16400,16587,16769,
+16487,16579,16847,17003,17096,16887,16535,17059,
+17808,17346,17665,17239,18126,18597,17531,17991,
+17882,17916,18281,18487,18294,18267,18342,18390,
+18219,18540,18727,18642,18720,18989,18659,18514,
+18870,19353,19702,20373,19503,18702,19795,20592,
+19293,20358,19347,19590,19596,19995,19837,19320,
+19447,19710,19355,19863,19507,20436,20196,20185,
+19973,20286,20057,20221,20512,20871,22051,21111,
+23034,27192,21940,21531,20808,22905,22591,21837,
+19519,32465,33430,32999,33095,34070,33711,29673,
+28595,31041,32460,33974,33675,34199,35562,39222,
+40182,39729,39279,37714,37365,37294,37034,37651,
+36890,36182,37745,37071,35552,34137,34013,33639,
+33462,33432,33542,33281,33078,32976,32904,32787,
+32705,31809,31860,31641,32134,32286,31661,31401,
+31218,31195,30454,30370,29997,28689,28133,25505,
+25168,24154,24034,23697,25495,31184,32292,32806,
+32877,32934,32979,33100,33117,33056,33019,32986,
+31851,31328,30444,29866,29535,29726,29305,17970,
+18393,18326,18531,19133,19384,18867,18234,18297,
+17520,16405,16506,16515,16317,16750,17208,17266,
+17869,17700,17614,17411,16905,17972,16859,17663,
+16762,16792,16105,16614,15979,15735,15528,15457,
+16050,15321,15204,14868,15054,14393,15093,15982,
+16206,16036,15866,17110,16782,16165,17013,16719,
+17615,17697,17925,18738,19451,18444,20349,19662,
+19756,20133,20796,22435,21684,22783,24177,25380,
+24435,23548,20835,22771,21028,20630,20150,20954,
+20205,19371,18905,19473,19014,18260,17999,17253,
+18348,18134,18312,17876,17912,17523,17293,18111,
+17387,18156,18105,18573,18601,17278,17853,17391,
+17265,17348,17379,17181,17400,17211,17321,17484,
+17786,17966,18216,18338,18459,18690,18921,19257,
+19629,20223,20761,24632,24940,22539,23292,23367,
+32046,28741,26121,26834,28782,32864,33177,33449,
+33921,33531,34546,34539,34559,34437,34410,34326,
+34056,34083,34225,34172,34290,34166,34566,34537,
+34055,34233,33969,34124,34146,33912,33793,33841,
+33948,34029,34368,34722,34227,34366,34427,34803,
+34535,34449,34424,34675,34197,34295,34365,34479,
+34659,34772,34825,34835,34449,34512,34571,34534,
+34476,34452,34513,34464,34391,34338,34300,34598,
+34689,35028,35141,34483,34089,33790,33765,33615,
+33509,33477,33405,33322,33228,33326,33342,33465,
+33486,33508,33647,33456,33423,33462,33505,33603,
+33643,33664,33666,33416,33387,33096,33902,34167,
+35034,34710,33518,32963,32926,30483,32970,33919,
+36849,37322,36306,36128,35711,35616,35950,36069,
+35824,35601,35766,35640,35436,35169,35072,34865,
+34677,34525,34347,34223,34052,33898,33864,33741,
+33300,33038,32901,32881,32913,32820,32892,32986,
+34535,35516,35289,35276,35704,35082,35903,35178,
+35082,35968,34470,35262,34186,34083,34475,35763,
+35322,36259,37918,37457,37521,35130,34701,34664,
+34727,35015,37014,37436,36724,36302,36288,33096,
+33143,33175,33171,33210,33299,33412,33360,33393,
+33541,33704,33832,33888,34004,34004,34288,34311,
+34005,33789,33553,33524,33530,33522,33437,33442,
+33419,33415,33356,33359,33453,34141,33690,35639,
+34510,36557,37695,36218,40264,44889,43836,44156,
+48068,43224,45972,39869,45496,45083,40533,44526,
+45862,42729,38769,37242,35684,34263,33322,33381,
+33850,40988,36597,37569,40989,41738,42388,44361,
+41037,41634,44501,42862,39180,41139,37493,38801,
+38347,37568,36396,35559,36109,36133,36021,35960,
+34932,35281,34159,33546,35097,35747,33587,33509,
+33636,33230,33270,33533,33684,33302,33291,34262,
+33217,33312,34780,36652,35148,33931,36413,34496,
+33984,32982,32991,32878,32746,32727,32709,32712,
+32693,32670,32673,32675,31778,28602,28470,30000,
+32592,32854,30904,27764,23966,17131,19210,21482,
+20275,21049,21417,18711,19765,22793,18591,17961,
+19247,19188,19710,20174,18447,19744,22132,24192,
+23277,25377,20482,22061,31839,23716,9306,11787,
+14826,16289,15911,26870,17409,15538,15939,15519,
+15810,16010,15219,15002,14901,15021,15084,14842,
+14476,15702,15552,16228,15195,16788,15094,14598,
+14982,14466,14385,14952,15035,15060,15605,15669,
+14994,15063,15147,15865,15290,14547,15129,14947,
+15689,15599,15555,15700,15379,15882,14970,15389,
+14997,26811,15452,15364,15317,15297,14702,14672,
+14879,14773,14810,14805,15003,15050,15734,16583,
+16793,16815,17119,16896,17015,17304,17084,17028,
+17538,18357,21494,23994,20604,31096,19981,20607,
+22323,17911,16980,16932,17160,17816,18056,18175,
+18219,18484,21176,18984,19464,19119,18913,19086,
+19130,18579,18930,18285,18387,18285,17433,16698,
+17663,18078,16950,20016,21624,18117,17917,17572,
+17188,17021,16610,16368,16431,16277,16344,16699,
+16027,16056,15822,15879,16113,16299,16593,16462,
+16514,16686,16666,16568,16554,16529,16886,16897,
+17115,17461,17926,18315,18164,18337,17273,16919,
+18270,18394,18656,18404,18590,18644,18633,18295,
+18450,18879,18843,19014,19233,19440,19491,19161,
+19188,19599,19431,19624,20503,20162,20312,21068,
+20531,19818,19326,19002,19518,19359,18987,20409,
+19356,20231,19489,20133,20095,20132,20193,20098,
+20210,20148,19796,20394,20317,20548,20784,20793,
+21221,21282,21535,23598,21766,21885,21796,20622,
+28833,33699,32797,32963,33583,35285,32796,30787,
+32742,33207,33375,33828,34045,34727,38385,39369,
+40774,40296,38778,37614,37149,37079,37884,37700,
+37119,36169,36492,37524,35178,34419,34142,33569,
+33513,33420,33263,33262,33156,33015,32994,32948,
+32883,32883,32851,32840,32811,32838,32811,32820,
+32751,32787,32770,32703,31518,30288,28187,26933,
+25770,25039,29100,30871,31680,32256,32861,32890,
+32904,32945,32984,33086,33109,33059,33023,32897,
+31801,30720,30359,29917,29834,29682,29345,17921,
+18126,18103,18423,18945,19284,18782,18557,18087,
+17631,16863,16293,16642,16197,16541,17294,17160,
+17847,17682,18367,16555,17233,16947,17510,17397,
+17442,16924,16787,16623,16116,15906,15880,15691,
+16071,15513,15654,15226,14842,15271,15715,16004,
+16230,16373,15581,16571,16428,17339,16810,16748,
+16431,16352,17265,17718,18311,17596,19363,19320,
+19571,18966,20056,22098,20655,23629,22629,24005,
+22639,23303,22316,22610,21386,21568,21411,21056,
+19647,20559,19242,20144,19335,18825,18380,17361,
+18530,17463,18845,19077,18981,18475,19286,18492,
+17984,18421,17983,17970,19148,18022,18237,17909,
+17775,17581,17393,17113,17088,17069,17265,17454,
+17676,17881,18080,18220,18449,18589,18959,19136,
+19646,20039,20391,21570,23746,32883,37739,29698,
+27767,25488,32566,32115,29548,30405,32631,32921,
+32937,33551,33933,34013,33849,33959,34597,34435,
+34430,34251,34284,34287,34279,34314,34640,34760,
+34165,34104,34107,33983,33947,33910,33834,33777,
+33891,34131,34375,34609,34920,35023,34830,34690,
+34547,34670,34310,34220,34249,34385,34272,34374,
+34391,34508,34701,34780,34746,34748,34743,34671,
+34455,34536,34618,34860,34746,34469,34532,34573,
+34594,34254,34112,33973,33720,33708,33600,33551,
+33658,33369,33360,33275,33234,33453,33456,33456,
+33391,33365,33453,33378,33370,33484,33521,33597,
+33637,33574,33612,33405,33441,33224,33554,34208,
+34918,34644,32931,33410,34546,33308,34173,36141,
+35731,35510,35861,35910,35760,35568,35689,35923,
+35798,35652,35502,35388,35253,35178,35013,34890,
+34624,34383,34233,34086,34060,33959,33839,33648,
+33182,32864,32833,32875,32830,32840,32712,34671,
+35243,35232,35720,36120,36480,36898,35526,35472,
+36390,37686,35841,34783,35778,36632,36003,36015,
+36353,37207,37716,38460,35206,34473,34456,34623,
+34749,34850,35059,36852,38687,38650,36163,33132,
+33163,33185,33193,33195,33221,33259,33326,33355,
+33398,33498,33536,33624,33812,33894,33876,33869,
+33795,33717,33599,33589,33558,33561,33472,33474,
+33489,33402,33432,33679,37451,37289,37960,37032,
+36287,39791,42511,50544,48600,50012,48048,45844,
+46221,47430,47076,49203,50443,47428,47222,46489,
+47297,48239,40460,40792,37680,35051,37300,34515,
+42565,40970,46527,43107,44643,44956,41707,43236,
+43516,45016,45122,42762,41552,40375,42530,36050,
+35602,35023,34685,36966,36621,36879,36175,35586,
+34712,35810,35302,33895,33643,34621,35958,34392,
+33375,33258,33188,33327,33835,33249,33140,33069,
+33189,33158,33202,33295,34092,36444,35461,35321,
+34348,33538,33018,32991,32815,32760,32750,32730,
+32717,32714,32671,32614,32637,32369,29942,30639,
+29616,31304,32997,32229,29291,23127,21180,23478,
+24794,26129,22878,19287,21397,21794,18627,17872,
+18972,19610,19305,20952,19626,24203,23519,23462,
+25324,24978,20466,21150,27536,22791,7315,12803,
+14793,17175,15349,16632,16004,15081,15510,14795,
+17466,14770,14557,14460,14718,15382,15282,15281,
+15684,14994,17107,16512,15444,15036,14469,14811,
+14725,14733,14754,15039,15162,14991,14943,15255,
+15325,15717,15863,15789,15486,15578,15228,14775,
+15222,15886,15436,15912,15557,21034,15123,16431,
+16089,15773,15437,16041,15028,15294,15167,14651,
+15376,15408,15320,15335,15419,15729,15943,16558,
+17268,17712,17696,17457,16962,16888,17154,17165,
+18278,20534,25698,21725,18511,17920,22254,18430,
+18323,17667,16960,17332,17011,17322,17706,17943,
+18773,19738,18330,18284,18435,18626,18388,18267,
+17987,17810,17726,17503,17704,17568,17475,17300,
+17352,16902,16375,16574,21349,20305,17059,17601,
+16989,15671,14910,15348,15944,16313,16455,16508,
+15627,14740,15978,15972,16247,16556,16645,16530,
+16749,16513,16911,16512,16652,16831,17232,17033,
+17327,17538,18061,18372,18443,18225,18162,18031,
+18348,18265,18301,18049,18009,18066,18264,18637,
+18538,18774,18609,18849,18717,19168,19298,19231,
+21632,20244,22544,19986,19357,19584,20235,20095,
+20367,19740,19893,19419,19086,19023,18779,18808,
+18962,20029,19783,18941,19762,19738,20100,20025,
+20154,20190,20441,20593,20557,21054,20884,22073,
+22059,21621,21889,27915,22089,22321,22904,24534,
+29091,31849,32709,33105,34646,34498,31551,32974,
+33033,33396,33803,34610,34305,36071,36940,39681,
+39114,39379,39751,38530,36581,36713,36711,37594,
+37616,35519,36232,36729,36188,34397,33851,33662,
+33537,33465,33414,33293,33292,33117,33033,33009,
+32998,32947,32934,32931,32926,32913,32927,32910,
+32927,32948,32953,32948,32761,32550,30059,28661,
+26541,29687,31280,31923,32332,32640,32865,32895,
+32927,32967,32967,33038,33061,33017,33003,32892,
+31431,30532,30388,30162,29891,29763,28596,18038,
+18010,18114,18517,19389,18935,19086,19443,18876,
+18067,16375,16673,16670,16633,16424,17154,17151,
+17416,17269,17753,17614,17375,17568,17876,17971,
+17733,17443,16620,16951,16919,16299,15190,16398,
+15825,14931,15147,14540,14573,15225,16187,15318,
+16005,15807,16197,16583,17800,16818,16920,16070,
+16695,16820,16449,18486,17930,18024,18897,20208,
+20015,18876,20460,21777,21786,21385,22204,21687,
+24779,25155,24319,23043,21919,21234,21474,22453,
+19569,19690,19860,19628,17802,19874,20436,19166,
+18791,20245,20019,19244,19308,18441,19599,19041,
+18819,18513,18519,19468,18757,18650,18699,18240,
+17853,17480,17334,17202,16881,16807,17034,17326,
+17644,17724,18060,18198,18386,18535,18789,19106,
+19580,19742,20129,23156,33367,22660,23967,24831,
+22074,22140,22341,26451,31614,29514,31355,32617,
+32476,32522,33490,34155,34210,34177,33782,34770,
+34574,34658,34770,34659,34459,34389,34482,34532,
+34407,34196,34113,34096,34177,34151,33980,33646,
+33846,34182,34257,34531,34815,34713,34512,34427,
+34422,34452,34488,34377,33948,34007,34116,34209,
+34524,34605,34951,35028,35061,34896,34762,35130,
+34692,34809,34812,34801,34590,34492,35231,34680,
+34596,34234,33865,33520,33894,33410,33435,33591,
+33564,33336,33285,33121,33137,33456,33456,33359,
+33303,33291,33306,33285,33336,33144,32977,33380,
+33540,33603,33488,33483,33585,33079,33467,34043,
+36288,33177,33103,35767,35746,29604,36815,36819,
+35348,35451,36339,35562,35703,35427,35501,35695,
+35579,35472,35349,35203,35099,34894,34895,34498,
+34503,34227,34179,34078,33859,33878,33785,33612,
+33071,32955,32850,32860,32851,32904,33084,34863,
+35982,39585,39117,36972,36258,39960,38980,38412,
+38346,38842,38571,35269,40441,35397,34543,34941,
+37661,38950,38027,35303,35001,34872,34832,35151,
+35631,37364,36018,36027,38660,38804,35404,33205,
+33243,33678,33668,33334,33255,33266,33295,33341,
+33389,33393,33542,33605,33630,33674,33683,33666,
+33666,33613,33606,33618,33597,33567,33516,33524,
+33514,33554,33886,38943,36294,43241,49296,44933,
+46636,46337,46278,47043,47785,46958,47412,47184,
+49465,47847,47891,48764,48923,46880,47545,47946,
+48213,47826,46335,45389,40063,36571,41232,42025,
+42917,40433,42278,46701,42540,45273,43044,42519,
+45891,46140,42870,42785,40638,40162,39862,36471,
+35581,34442,34045,33857,35781,34387,36558,36689,
+35360,35691,34397,33884,34229,33778,33308,33263,
+33144,33071,33405,33805,34129,35864,33112,33396,
+33052,33023,34096,35004,33303,34560,34476,34227,
+34567,34342,33222,32965,32954,32795,32799,32760,
+32733,32738,32666,32646,32638,32563,30276,29549,
+29692,30713,30750,32286,29385,24310,21661,21867,
+21881,19039,19831,22093,22632,18832,18158,18219,
+18984,19063,19899,20176,20443,21811,22989,22206,
+24965,24238,20995,21726,25221,15702,8527,14404,
+15593,15498,15119,15864,15054,16015,14432,15316,
+19245,14494,14737,14942,15421,15260,15724,15505,
+15714,15729,15493,15061,14843,15154,15012,14964,
+14988,13866,14885,15604,15199,15428,15247,15426,
+15666,15963,15607,15818,15267,15126,14963,15103,
+15019,15147,15496,15610,16545,15111,16500,16404,
+15158,15464,15934,21648,15930,14950,15485,15213,
+14864,15878,15805,16188,16033,16131,16611,16809,
+21190,17577,18505,18007,17636,17120,17013,17181,
+19214,17727,18250,17952,16416,16394,16609,17112,
+17193,16867,16911,19290,22838,17718,17654,17926,
+17586,18126,17927,17675,17971,18091,17582,17634,
+17591,17530,17547,17361,17327,17101,17226,17067,
+16953,16988,16557,16379,17043,18799,17391,15290,
+15775,15561,16147,16296,16480,15990,15726,15836,
+15268,15675,15320,14761,15636,15744,16146,17214,
+17036,17004,16751,18071,17051,16562,17062,17326,
+17502,18206,18897,16581,17973,18468,18205,18120,
+18274,18271,17949,17759,18066,17979,17888,18241,
+18585,18899,19214,18825,19053,18997,19086,20100,
+20322,23430,20219,19281,20222,19691,20514,19545,
+19899,19299,19361,18948,18484,19848,19039,19258,
+19506,19781,19983,20002,19695,19627,19998,19853,
+20202,19925,20180,20288,20512,20399,20959,20824,
+21645,22179,23072,30581,21379,22231,21708,30011,
+27667,32766,33387,34815,34281,34095,32291,32959,
+33291,33723,33886,34749,34095,34458,37365,39892,
+39584,39638,39339,37707,36535,36633,36904,36196,
+35550,37005,36872,36760,35535,34269,33872,34011,
+33834,33754,33609,33434,33300,33282,33120,33096,
+33045,33012,32972,32968,32959,32949,32946,32976,
+32982,32995,33004,32997,32912,33003,32807,32646,
+31428,30489,31569,32431,32576,32913,32911,32927,
+32958,32964,33027,33064,33096,33048,32968,32863,
+30910,30609,30453,30303,30302,29901,24963,18175,
+17974,18320,19482,19092,19126,20176,19395,17996,
+16916,16683,16719,16202,16676,16605,17226,17473,
+17340,17667,17679,17480,17690,17907,18040,17785,
+17624,18111,17687,17940,16562,16079,16422,16542,
+16197,15834,15859,15929,15944,16228,16040,16167,
+16425,16305,15823,17076,15802,16504,17214,17135,
+17069,17009,17067,17582,18477,19202,18642,18425,
+18643,19575,20064,20996,21019,21792,21922,23046,
+25608,25430,24846,25202,21354,21690,23964,22246,
+22211,21356,20894,20695,19306,19184,19821,18889,
+19818,19694,20421,19137,18164,17746,17380,17407,
+17594,17963,18632,18837,19218,19427,19647,19981,
+18078,17724,17941,17328,17243,17141,16907,17147,
+17416,17692,17805,18018,18281,18543,18804,18993,
+19222,19375,19773,20799,21410,21088,21601,22029,
+22188,22048,22293,22778,28269,31733,28259,28771,
+30627,31860,32685,34140,35907,35620,35116,34402,
+34068,34555,35198,35040,34840,34666,34732,34788,
+34461,34436,34605,34413,34233,33890,34164,33975,
+33956,33990,34047,34208,34361,34610,34241,34445,
+34772,33912,33954,33912,33891,33900,34029,33932,
+34091,34073,34635,34754,34837,34962,34956,34947,
+34949,34929,34852,34754,34461,34300,34208,33954,
+34527,34327,33570,33694,33991,33403,33042,33519,
+33226,33198,33096,33078,33258,33306,33227,33238,
+33388,33033,33138,32971,33488,32758,32685,32905,
+33275,33576,33800,33842,33155,33061,33240,34643,
+35678,32818,34967,35832,36336,32831,36059,35844,
+35088,36258,36049,35349,35330,35349,35439,35301,
+35238,35334,35196,35055,34750,34816,34606,34500,
+34248,34099,34002,33890,33860,33725,33627,33128,
+32815,32977,32903,32892,32922,33017,33456,35343,
+40059,37563,37819,38178,37722,37755,38720,38115,
+39816,40479,41493,39929,37328,34986,34301,34622,
+37644,38231,36441,35421,35730,37143,36361,37156,
+36751,35499,35542,35578,38090,39161,38582,33304,
+33365,35795,35461,34969,33308,33294,33303,33330,
+33396,33412,33465,33531,33550,33549,33594,33610,
+33632,33681,33714,33682,33651,33624,33837,37905,
+35902,38446,36310,43386,41628,47981,47775,50116,
+48890,46585,47166,46684,48055,46716,46805,45554,
+45649,45440,46503,46323,47817,45575,45273,43791,
+46157,48115,48320,46032,42590,45237,37823,43749,
+47124,52191,45264,48450,47283,43683,44658,46326,
+46861,44328,47529,46146,38140,37664,35926,34747,
+34169,34338,34044,34149,33984,34567,34948,36398,
+35470,35310,34731,35004,34812,34021,33252,33176,
+33105,33080,33155,33350,34303,33396,33630,33099,
+33084,33125,33371,33371,34545,35743,33318,33525,
+33430,34452,34545,33059,32988,32887,32826,32783,
+32780,32751,32733,32712,32693,32668,32343,29865,
+29586,29763,32371,29745,28822,24235,22048,17514,
+17438,20179,20795,26974,21216,18808,18754,19620,
+20038,19591,20584,19990,20850,27330,23632,25554,
+23672,23927,20989,24427,19080,6053,12442,15573,
+15722,14893,15891,16257,16051,14421,14400,14202,
+14589,14342,14313,15079,15091,15393,15525,15190,
+15601,15309,16224,16002,15242,15388,15471,15357,
+14901,16038,15714,15900,15665,14990,15429,15429,
+15515,15377,15312,15142,15403,15190,15019,15234,
+15158,14961,15458,15446,15715,15771,15677,15399,
+15433,15622,15861,15737,16426,16207,15331,16059,
+15657,16119,16834,16712,16692,19314,17505,21366,
+17166,17164,17550,18288,17382,17071,17093,17082,
+16440,16851,17198,16458,16462,17155,16860,17262,
+17107,17004,17061,17148,18727,17039,17200,17691,
+17439,17581,17653,17619,17507,17442,17187,17094,
+17147,17282,16944,16642,16590,16743,17079,16851,
+16218,17790,15950,16504,16614,16305,16319,16194,
+16405,16318,16047,15978,15810,15953,15579,16754,
+16031,14844,15490,16214,15613,15814,15983,16914,
+16054,18172,17815,15790,16693,18122,19124,18000,
+18022,18451,18658,18037,17895,17733,18159,18006,
+17816,17769,17967,18136,17945,18012,18260,18336,
+18565,18759,18909,19053,18675,19428,18879,19176,
+19682,20047,21106,20418,25205,19080,19415,19895,
+19614,20024,19382,19103,19318,18797,19671,19258,
+18928,19198,20214,20066,19795,19928,20013,19930,
+19941,20187,20328,20765,20548,21215,21308,24389,
+23377,23229,22983,22284,23021,24819,28596,25598,
+32900,34011,34710,33633,30880,32363,32709,33930,
+35168,35013,34831,35718,35880,35230,39090,39863,
+39307,39316,37837,37889,37125,37593,36495,36570,
+36278,36139,35184,35190,34323,34452,34730,34943,
+34598,34545,34436,33929,33395,33322,33312,33177,
+33090,33019,32938,33009,32998,32967,33004,33006,
+32997,33004,33008,33003,33003,32995,32975,32892,
+32917,32187,32513,32781,32919,33006,32982,32966,
+32964,33028,33056,33147,33063,32973,32942,32734,
+31068,30560,30583,30697,30342,30225,29550,19239,
+18204,19416,19248,19023,20376,20946,18262,17109,
+16749,16746,16616,16439,16821,16974,17232,17513,
+17538,17460,17603,18096,17835,18060,18153,18064,
+18454,17755,20068,17864,18058,16971,16500,17133,
+16341,16367,16627,16352,16088,16320,16461,16495,
+16012,16209,16787,16111,16305,16950,16488,17935,
+16396,16725,18071,17349,18090,18140,18033,18631,
+20187,20868,20844,20204,21516,20787,20946,22955,
+24264,24327,23873,25878,24637,22797,20795,20638,
+21127,23121,22316,21878,20155,21480,19866,19239,
+19263,19253,19273,18849,19193,19958,19986,18986,
+18530,18741,19454,20585,19539,20988,23810,27576,
+19202,17906,18009,17502,16980,17353,16863,17038,
+17238,17452,17631,17884,18137,18372,18632,18728,
+19083,19045,19437,19698,20015,20518,21271,22022,
+22302,22342,22322,22917,23369,26312,28009,27273,
+27152,27745,29136,32413,33579,35225,38285,36352,
+35429,34322,34463,34404,34605,34815,34803,34589,
+34672,34751,35028,34248,34283,34434,34377,34269,
+34167,34260,34097,34353,34483,34252,34144,33939,
+33871,33909,33912,33912,33756,33812,33825,33810,
+33969,33923,34125,34308,34271,34765,34857,34876,
+34878,34851,34829,34629,34188,34224,34021,33858,
+34362,34006,33834,33843,33888,33429,33449,32879,
+33042,33032,32970,33034,33181,33168,33102,33133,
+33372,33003,33391,33496,33593,32877,32769,32860,
+33170,33363,33481,33541,33669,33459,33048,34378,
+33231,33202,35133,34588,34708,35059,35476,36168,
+35433,36056,35818,35977,34988,34803,35199,34968,
+35020,35065,34866,34694,34578,34374,34321,34215,
+34250,34008,33829,33687,33734,33553,33394,33115,
+33018,32895,32947,32876,32768,33729,34621,36747,
+39978,38842,37672,37709,38286,39036,38094,39012,
+40974,39396,39813,38821,34124,33876,34451,35648,
+38076,37845,34571,34316,34418,35120,36340,36935,
+36407,36104,35754,35763,37890,38508,38147,34034,
+34723,36271,35950,35983,33531,33321,33310,33336,
+33348,33423,33463,33501,33539,33579,33633,33626,
+33675,33684,33747,33756,33793,35388,36272,37789,
+37622,38529,42183,43043,46226,48738,47035,47067,
+48214,48644,49755,49056,47682,49133,48774,48078,
+49863,47592,46368,47232,49768,45440,46617,47390,
+48159,49159,45838,47059,43720,44938,40461,45933,
+44958,46278,45331,45105,42901,44260,47090,45274,
+44841,46038,46329,46347,40137,36636,35263,34311,
+34575,34621,34164,34329,34070,34095,33719,35796,
+36596,36538,36156,36198,35637,35332,34119,33067,
+33109,33123,33066,33181,33552,33385,33112,33128,
+33126,33213,33681,34152,33386,33375,34477,35159,
+33033,33521,33887,33441,32997,32913,32810,32879,
+32796,32760,32769,32764,32704,32670,32635,31487,
+29940,30021,30681,31135,31782,29526,24743,21741,
+16429,21860,24893,21947,19274,18785,18970,20262,
+19991,19302,20204,21025,20973,24265,24555,25062,
+28068,23184,20796,19497,13176,5236,14770,16322,
+14980,15192,15372,15105,14155,14296,13822,14250,
+14400,14352,14589,15042,14634,14678,15009,15132,
+15614,15422,16124,18670,15658,15657,15500,15651,
+15100,14960,16374,16591,15946,15513,15341,15765,
+15677,15450,15078,14881,14868,15021,15073,15034,
+15098,15370,15232,15246,15168,15377,14906,15537,
+15438,15739,15711,16031,16438,15966,16720,16869,
+15862,15246,17823,19544,16724,16906,17130,17244,
+17384,17419,17115,16092,17037,18566,25476,17388,
+16992,16708,17294,17748,17164,17136,16836,17172,
+17283,17211,16665,16722,16983,16884,19843,16875,
+17058,16809,17134,16821,16669,16796,16755,16733,
+16659,16642,16443,16389,16440,16677,16761,16547,
+16361,16176,15777,16153,16421,16392,16233,16037,
+16074,15512,15861,15537,15452,15396,15963,15312,
+15232,15598,16068,16128,16568,16470,16867,17589,
+17479,17777,16770,17220,16645,17002,16598,16481,
+17583,18333,18561,17983,18137,17321,17766,17703,
+17352,18127,18073,17931,19428,18688,18399,18830,
+20065,18636,18626,17716,19375,19071,19845,17895,
+19308,19185,18846,19362,19542,19719,19308,18957,
+19348,19365,19417,19430,19317,19434,20264,19707,
+19900,19785,19756,19837,22608,20075,19953,20154,
+19869,20278,20686,20370,20795,21495,21075,21159,
+23724,21929,22444,24056,25757,26410,24673,28581,
+33476,34778,34128,32495,32233,32634,33438,34147,
+35546,35004,35621,35703,35937,36389,37797,39304,
+37415,37353,37047,37746,36956,36748,35864,37558,
+37774,36879,36711,35337,34991,34814,34953,35009,
+35041,34899,34407,34110,33511,33502,33276,33224,
+33229,33108,33063,33036,33012,33009,33015,33025,
+33010,33009,33003,32934,33004,32965,32985,32989,
+32995,32955,32937,32928,32998,33055,33068,33035,
+33095,33060,33120,33123,33043,32979,32930,32823,
+30996,30503,30597,30593,30531,30269,23400,23417,
+19140,19646,19511,19938,21459,18271,17559,16755,
+16778,16745,16741,16732,16943,17184,17378,17328,
+17451,17600,17670,18021,18329,18417,18594,18615,
+18882,17871,18633,17673,18561,17475,17251,16965,
+16143,16295,16013,17292,16807,15987,16549,16872,
+15846,16558,15414,16687,17447,16158,16105,16754,
+16398,15660,16225,16532,18069,17599,18640,18903,
+18995,19909,20349,19932,21963,21361,21895,22364,
+22908,21773,25098,26577,24318,23293,23279,21214,
+21256,22409,22767,22291,20277,20889,21549,21042,
+19233,19310,19452,18790,19382,18927,18317,20211,
+18070,19190,19275,19248,19916,20480,24775,25119,
+19582,18921,19140,17805,17013,17082,16743,16751,
+16976,17341,17487,17748,18009,18212,18573,18543,
+18636,18810,19035,19261,19546,20123,20913,22422,
+25758,22786,24765,23748,24549,25099,28790,27452,
+26323,26648,27530,30108,32745,33624,36007,37456,
+38988,37998,35370,36081,35077,35291,35142,34739,
+35112,34963,34755,34571,34806,34828,34724,34530,
+34461,34517,34492,34218,34404,34178,34221,33994,
+33957,33705,34092,33963,33627,33680,33885,33912,
+33912,33912,34842,33900,34149,34503,34746,34800,
+34827,34949,34708,34408,34151,33966,33442,33834,
+33600,33703,33605,33610,33417,33048,33023,33051,
+33102,33150,33022,33150,33111,33183,33254,33306,
+33386,33410,33539,33568,33589,33339,33516,32767,
+32867,33048,33191,33216,33126,33216,33064,33467,
+33540,33654,34197,33924,33963,34293,34087,36216,
+35553,35623,35711,35108,34779,34719,35223,35340,
+34917,34991,34755,34450,34344,34202,34053,34121,
+34058,33818,33650,33483,33321,33246,33177,33029,
+33016,33010,33002,33017,33552,35318,35622,39737,
+38699,40973,38873,40689,37563,38179,39651,39105,
+38226,38367,39094,35475,33879,34021,34940,36081,
+37369,35398,34419,34504,34718,34852,35061,35592,
+36024,35803,36042,35910,36786,39042,42340,37415,
+38473,36930,36837,37806,34792,33345,33355,33381,
+33390,33394,33459,33486,33549,33583,33646,33684,
+33709,33779,33783,34390,36459,35636,36768,45884,
+45016,46037,46791,48664,49713,47518,48258,48582,
+48981,48860,49938,49111,50604,48135,48319,47673,
+49373,48838,48425,49321,50436,47276,46890,48262,
+48369,48582,47892,47672,45462,42534,47265,44966,
+46435,45930,45751,47949,46180,46609,44152,45842,
+46302,42210,45943,46023,41976,37485,34835,34710,
+34410,34200,34069,33884,33925,35800,34395,34236,
+36270,37110,35600,37445,37036,36945,34203,33137,
+33104,33084,33085,33080,33108,33098,33128,34344,
+33090,33061,33239,33702,33974,34260,33938,33093,
+33015,32891,33015,32991,32996,32987,32934,32892,
+32796,32816,32813,32766,32762,32727,32650,32361,
+31072,30410,30450,30922,31406,32724,27765,25173,
+21213,20750,19274,19477,19359,19100,19446,19470,
+19926,28541,19628,20402,21192,25098,28516,27881,
+27902,26032,22321,20463,18523,9498,15209,16089,
+15893,15201,15558,14642,14855,14293,14331,14528,
+14583,14447,14466,14894,14741,14744,15456,14945,
+15121,15267,14940,15572,15556,15516,15577,15764,
+16047,16931,18573,15933,16419,15648,15846,16387,
+16305,15865,15110,15069,15006,15143,15243,15091,
+15177,15372,15675,15025,15083,15012,14745,14780,
+15391,15679,15751,16079,16344,16593,16583,16966,
+17053,16803,16891,27051,18543,18152,16287,17688,
+17193,17573,17466,18448,16880,28812,17433,16813,
+17578,17611,17597,17669,17451,17493,17159,17746,
+17206,17208,17768,19561,16461,17554,17395,16740,
+16868,16439,16670,16326,16441,16461,16469,16635,
+16572,15886,16021,16078,16022,15679,16014,16170,
+16077,16044,16756,16450,16487,16035,15899,15858,
+16056,15501,15679,15712,15591,15561,16091,15987,
+15744,15726,15711,16209,16468,16870,16880,17010,
+16898,17190,17122,17105,17541,17104,17067,16117,
+15835,15572,16267,15602,15964,17659,18540,18515,
+17570,17610,17958,19737,20497,17708,18720,19050,
+19011,23504,19330,18136,19554,19366,20727,19281,
+19419,19137,18939,18567,19491,19361,18677,19115,
+18909,19377,18936,19122,19173,19336,19683,19654,
+20353,20271,19822,19806,20765,20887,20271,20806,
+21173,21502,20423,20442,20556,20931,21476,21213,
+21613,21946,23987,24878,27585,28169,27201,32868,
+34884,37293,33141,32751,32787,32808,33247,33792,
+34443,35808,37035,37083,36992,36645,37890,37796,
+37810,36807,37107,37062,37798,36320,36756,38408,
+37514,36125,35928,35817,35310,35261,35124,35145,
+34989,34468,34013,34175,33801,33450,33344,33255,
+33279,33204,33242,33198,33102,33128,33078,33063,
+33021,33118,33154,33156,33144,33169,33027,33181,
+33138,33108,33189,33192,33079,33094,33213,33148,
+33148,33192,33138,33117,33029,32946,32935,32884,
+31625,30728,30457,30417,30386,28497,24067,22269,
+21730,21849,22086,22084,17973,17484,16970,16803,
+16473,16738,16791,16764,16852,17124,17251,17454,
+17529,17676,17832,18096,18421,18700,19326,18930,
+18986,18650,18098,17574,17977,18564,17133,16296,
+16531,16578,16599,16056,16959,16957,17191,16253,
+16236,16562,16316,16484,15756,16292,16989,17763,
+17103,17771,16185,16094,17367,18382,17575,18414,
+18839,20317,21063,19356,20779,22242,22563,22014,
+21966,21537,22425,23486,22714,24027,22728,21396,
+21702,22877,22324,22646,21113,20841,21201,21167,
+20801,19446,19749,19992,19370,19164,19436,19395,
+18827,19038,19071,19865,19836,20122,22055,19450,
+19175,20158,18613,17216,17598,17199,16759,16712,
+16765,17064,17439,17853,18101,18167,18341,18483,
+18584,18744,19101,19255,19364,19597,20014,20374,
+21288,21522,22836,23901,24491,25714,25567,26298,
+27051,24741,26141,30870,33747,35980,36648,35483,
+39377,37845,37541,35877,35862,35540,35025,34949,
+35303,35262,34827,34718,34812,35095,34905,34751,
+34731,34534,34738,34635,34692,34263,34356,33951,
+33841,33612,33603,33694,33533,33531,33702,33876,
+33911,33912,33912,34065,34185,34641,34737,34853,
+34857,35143,34300,33768,33865,33628,33440,33426,
+33396,33349,33444,33332,32982,32502,31405,32652,
+33075,33168,33261,33214,33276,33327,33355,33297,
+33489,33525,33591,33664,33624,33603,33648,33555,
+33378,33129,33165,33147,33078,33032,33029,33027,
+33031,33294,33877,33423,33728,34891,32704,36713,
+35676,35547,35100,34756,34574,34992,35755,35373,
+35320,34924,34637,34364,34177,33971,34152,34011,
+33750,33556,33370,33054,33037,33012,33005,33028,
+33030,33031,33043,33258,35035,35817,39330,41087,
+41086,41481,40230,37740,37814,39852,37561,37533,
+38449,39403,38979,33885,33768,34537,35404,36163,
+37410,34901,34381,34438,34625,35268,35305,35115,
+35463,36237,36387,36694,36642,37679,38847,39399,
+37750,37490,37761,37377,34910,33411,33377,33370,
+33425,33470,33498,33519,33536,33576,33687,33741,
+33762,33962,37239,37635,38560,44742,51216,48072,
+48699,46629,47020,47574,49836,50205,50679,49299,
+47636,47787,47790,46970,47613,49172,48493,48462,
+47413,47421,48768,48358,47309,47109,48091,49483,
+48591,47708,47497,48339,47017,46457,48240,46061,
+46601,46338,47188,45021,46084,47326,46902,46566,
+46369,45059,46003,43780,45720,41185,37523,34680,
+34529,34426,34239,34212,34343,34031,34222,34740,
+34739,35195,36951,35816,37509,35346,33280,33415,
+33219,33104,33093,33080,33064,33045,33309,34228,
+33662,33090,33098,33030,33285,33382,33443,33471,
+33024,33021,33009,32943,32993,32978,32896,32829,
+32838,32829,32817,32807,32759,32716,32668,32579,
+31568,30755,30730,31422,32669,32460,32782,28002,
+25005,21551,19332,19590,19550,20136,19952,19813,
+19608,19916,20047,20316,22195,25968,27311,26596,
+28163,25991,24810,20098,7054,13303,16284,16060,
+15382,15129,14647,14347,14607,14457,14553,14112,
+14511,14295,14499,14532,15070,14997,15209,15117,
+15558,15153,15006,15300,15948,15908,15941,16111,
+17759,18367,17640,17162,18073,20861,18279,17388,
+16877,16244,15684,15515,15200,14993,15267,15390,
+15504,15210,14694,14884,14901,14889,14562,15080,
+15687,15804,15972,16203,16277,16340,16241,16499,
+16152,16621,17792,17240,16560,17805,17981,19781,
+17735,16795,16957,16563,16621,16926,17230,16692,
+22487,17918,17412,18338,17196,17404,17153,16530,
+17304,16654,15891,16401,25418,17715,16875,17106,
+16205,16155,16377,16305,15815,15855,16083,15964,
+16212,15956,15750,15582,15413,15912,15593,15949,
+17041,19245,15704,20226,16476,16713,16108,16369,
+16191,16254,15707,15447,15658,15364,15380,15931,
+15589,15932,16113,16365,16520,16593,16903,17044,
+17100,17293,16971,16977,16989,16919,16476,16766,
+16767,17055,16878,17298,16410,15265,15246,16289,
+16900,17561,17737,18078,18579,18822,18906,19048,
+18930,19323,18762,18748,19350,19335,19094,20131,
+18896,19565,19505,19035,19163,19061,19385,18958,
+19216,19767,19452,19152,19263,19925,19380,19661,
+20049,20359,20326,21038,20321,21405,21588,20642,
+20922,20817,20540,21081,20814,21480,21329,20987,
+21780,21883,28741,29320,27793,27908,29469,33465,
+36948,34572,32772,32891,32923,32928,33687,34829,
+35458,36267,36837,37148,37355,36375,38526,37230,
+37354,36884,36621,37497,36372,37248,36504,36366,
+35694,35499,35217,35772,35487,35365,35103,34974,
+34821,34660,34143,34121,33717,33539,33354,33351,
+33163,33325,33256,33201,33160,33291,33161,33073,
+33029,33169,33357,33344,33218,33163,33177,33126,
+33102,33211,33146,33249,33180,33222,33157,33153,
+33294,33206,33155,33078,33045,32994,32939,32883,
+32547,31437,31275,30891,30414,29128,24645,23442,
+23268,23060,23193,19443,17763,16998,16683,16777,
+16776,16791,16620,16746,16796,17103,17250,17457,
+17580,17696,17892,18212,18732,18993,19500,18927,
+18694,20473,19275,19608,18903,18075,17416,16926,
+17085,17027,16593,16505,16487,16400,16201,16719,
+16002,16706,16995,16954,16172,16193,16633,16858,
+16267,16405,17462,16619,18267,18283,18698,17546,
+17709,20742,19043,19110,19761,19040,23143,21941,
+21690,21444,21454,22839,24134,23613,25667,23373,
+24086,23760,23679,21573,22802,21254,21423,21742,
+22254,22077,20746,20884,19896,19656,19605,19506,
+19573,21086,20071,19996,20121,20587,30279,28025,
+19998,19944,18077,18343,16669,16681,16663,16693,
+16764,16908,17447,17664,17916,18189,18333,18471,
+18561,18702,18855,19051,19211,19433,19650,19688,
+19935,20154,20955,22481,26244,23683,24365,23923,
+23823,27327,30165,32044,33714,36256,35183,35770,
+39267,38823,38105,37299,38598,35944,35545,35216,
+36072,35703,34944,35007,35032,35121,35001,34926,
+34828,34829,34568,34821,35010,34509,34228,34047,
+33819,33625,33589,33703,33533,33519,33507,33490,
+33924,33912,33909,33910,34197,34421,34639,34681,
+34716,34570,34251,33731,33862,33543,33250,33072,
+33026,32927,32881,32726,31902,30122,30567,32476,
+33075,33294,33330,33420,33374,33399,33381,33388,
+33513,33570,33589,33635,33468,33516,33323,32557,
+31656,30013,30883,32769,33011,33025,33022,33024,
+33000,32960,32994,32913,33244,33834,33999,35859,
+35595,35166,34781,34597,35519,35397,35457,35453,
+35306,34986,34509,34225,33942,33889,33938,33805,
+33492,33181,33023,33043,33027,33019,33015,33023,
+33045,33039,33129,34014,39639,40067,38419,40215,
+40779,39585,37587,37482,39018,39005,38546,36978,
+38892,36754,34578,34492,34512,35256,35532,36115,
+35778,35496,34374,34420,34477,34603,35255,35368,
+35259,36223,36391,36500,36972,38978,39290,39952,
+39441,39296,37305,38202,34937,33426,33459,33486,
+33443,33504,33526,33543,33596,33633,33618,33692,
+34215,35434,37930,39395,45558,49762,48936,46765,
+47271,46980,48852,49569,50715,48445,49350,48778,
+47594,47860,47601,47109,47988,46558,48153,47308,
+47570,47200,47517,48453,48031,47220,47358,46713,
+46884,48310,48282,47870,45863,47502,47691,45474,
+47379,46880,45305,47099,46829,43828,46274,46895,
+44191,44500,45912,46742,45655,46389,44817,37404,
+34636,34428,34364,34136,33981,34581,34232,34962,
+35718,34170,35240,35154,35336,35023,35720,34398,
+33225,33365,33330,33217,33439,33310,34219,35601,
+35035,33510,33038,33036,33017,33004,33069,33292,
+33039,33027,33019,32994,32964,32934,32869,32844,
+32832,32833,32827,32827,32755,32713,32658,32551,
+32241,31001,30709,32205,32726,32804,32671,30214,
+27202,22446,18784,19042,19688,20211,20453,20469,
+19955,19892,20489,20851,22065,24277,28872,28797,
+28648,25436,23013,17531,4347,12104,15828,15486,
+15449,16047,15233,14778,14234,14480,14893,14495,
+14412,14958,15441,14873,15024,15825,16156,15299,
+16192,15213,14307,15137,15473,15890,17541,18058,
+19323,19707,19654,19579,18222,19237,19737,18510,
+17067,16568,15918,15514,15330,15192,15474,15390,
+14982,15324,15393,15157,14172,14697,14913,14856,
+15387,15455,16167,16056,16677,16074,16362,16175,
+16691,16776,16601,17031,18328,18550,16364,19282,
+21831,17040,16716,16691,17111,17114,16782,17222,
+18513,16926,17183,17442,17516,16963,17070,17001,
+16608,16057,25731,26655,15774,16536,16331,16329,
+16644,16311,16362,16230,15993,15821,15993,16037,
+15825,15533,15623,15583,15215,16077,17028,16162,
+16750,16115,24798,23052,17331,16403,16503,15997,
+17930,16121,16045,15966,15454,15243,15635,16281,
+15828,16118,16132,16514,16826,16782,16838,16920,
+17331,16933,16779,17160,16774,16399,16371,16288,
+16529,16239,16010,16108,16575,16738,16577,16962,
+17353,17619,17253,15107,16861,17933,18389,18474,
+18375,18952,19506,19523,18877,18045,18664,20055,
+19755,18590,18558,18916,18875,18582,19340,19209,
+19099,19287,19058,19452,19104,19900,19921,21207,
+19932,19973,19902,24798,20271,20886,20373,19808,
+21324,20481,20617,20613,21341,21977,23658,21132,
+21946,28424,27499,28894,28153,28732,32136,35475,
+37422,33219,33004,33173,33141,33534,34632,34767,
+35504,36560,37696,36714,36875,38109,37515,37427,
+36801,36558,36747,36652,37497,36660,37712,36278,
+35518,35565,35643,35620,35499,35405,35255,34675,
+34692,34446,34431,34153,33861,33429,33497,33383,
+33285,33363,33365,33344,33215,33194,33187,33122,
+33041,33178,33336,33272,33440,33255,33259,33186,
+33355,33183,33309,33357,33319,33326,33352,33234,
+33364,33314,33243,33155,33096,33006,32953,32921,
+32862,31900,31449,31155,30975,30126,25637,24916,
+24753,24189,20802,18132,17662,17356,16951,16845,
+16789,16806,16761,16713,16743,16800,17087,17343,
+17559,17664,18071,18474,18543,19296,19891,19689,
+19026,18985,18953,18176,18485,18774,18169,18243,
+17648,17638,17413,17299,16485,15975,16410,16218,
+16377,16152,16145,16233,16261,16547,16752,16833,
+16281,16719,17913,17610,16575,17351,17063,18308,
+17846,18446,18180,18933,19942,19614,21984,22041,
+22222,22037,22220,22444,23358,24172,23214,24754,
+23617,23287,22451,22408,23130,23282,20363,21549,
+23250,22098,22085,20425,20658,20144,19901,19840,
+21105,20477,20163,19971,20472,20982,23384,25434,
+24704,19782,16966,17002,16992,16762,16691,16820,
+16689,16734,17098,17445,17894,18001,18273,19045,
+20035,19239,18790,19044,19347,19664,19817,19708,
+19755,19710,19818,20211,21527,24052,26065,23070,
+24174,25192,26342,29880,32730,34430,33709,34020,
+34669,35289,37279,42041,40472,38217,36408,36141,
+36355,35913,35169,35464,35214,35480,35097,35170,
+34719,34983,34743,34493,34429,34570,34733,34323,
+33913,33627,33669,33456,33510,33525,33405,33453,
+33837,33843,33900,33774,34080,34520,34895,34914,
+34833,34876,34991,34014,33490,33113,33015,32837,
+32470,31236,30550,29473,28896,29322,30703,32787,
+33193,33692,33425,33479,33483,33444,33522,33513,
+33532,33625,32473,32780,32250,28492,26226,25057,
+25794,26731,27938,30216,32844,32907,32903,32853,
+32913,32426,31945,31025,31110,33201,34752,35319,
+35320,34569,34725,35551,35157,35590,35646,35455,
+35206,34953,34675,34176,33914,33812,33784,33540,
+33159,33072,33026,33024,33020,33027,33013,33018,
+33119,33076,33924,35503,38758,39924,39670,40361,
+39435,37746,38186,41075,38260,37344,35830,39305,
+38600,35908,34635,35255,34922,36126,37628,38973,
+37461,35850,34448,34658,34750,34830,35325,35518,
+35447,35564,36737,36626,36807,37452,38685,39351,
+39330,38694,39137,37364,33774,33492,33531,33531,
+33471,33495,33534,33612,33612,33634,33723,33838,
+34989,36171,37961,48089,45288,47735,45442,46455,
+46716,49035,48234,47758,48882,49050,47420,48659,
+47687,48406,48579,48531,47261,47330,47139,48132,
+47736,46536,46638,47155,47130,47159,47265,47168,
+47291,45999,48185,46336,46119,47937,48780,47811,
+45884,45699,45818,45151,48195,48591,47399,44757,
+45009,45561,44460,45354,44704,44215,45285,41665,
+37779,34817,34704,34620,34776,34302,34458,35381,
+36705,36998,39555,37504,37437,36065,36173,34218,
+33174,33486,33244,33357,33694,33369,33410,34443,
+33150,33180,33063,33057,33033,33034,33125,33017,
+33033,33033,33005,33013,32946,32926,32887,32880,
+32865,32859,32853,32811,32769,32652,32651,32562,
+32477,30765,30715,32905,33097,33035,34412,32432,
+27272,26332,24029,18645,18546,20097,19861,20511,
+20603,20306,20292,21471,21715,27889,27573,28995,
+27467,24936,22695,15201,6534,13772,15950,15208,
+15685,15631,14996,14923,14439,14771,14890,14838,
+16996,18018,17300,15217,15717,16731,16896,16056,
+16254,16699,15715,16605,16215,16937,18880,19501,
+20295,21489,22048,22656,24158,23098,22206,19736,
+17197,16452,15660,15549,15324,15250,15054,15078,
+15000,15057,15346,14405,14331,14788,15572,15359,
+15130,15355,16035,15983,16209,15911,16002,16269,
+17203,18090,21898,16512,20493,17565,17184,16520,
+16199,16275,17313,16986,18111,18152,16394,17721,
+17558,17295,17794,17285,17174,17055,17365,18246,
+17478,16586,16258,20430,15750,16846,16605,16222,
+16366,16140,16320,15936,15979,15873,15870,15549,
+15878,15823,15679,15542,16360,16054,17412,18702,
+21110,20019,18582,20218,18022,19311,16733,20628,
+17495,17154,16141,16056,15747,15427,15958,15713,
+15654,16090,16218,16404,16608,16995,16969,17001,
+16916,16985,16949,17132,16783,16566,16349,16271,
+16356,16356,16002,15973,16325,16364,16143,16518,
+16474,17074,17070,17341,17206,17856,17968,17517,
+17115,17973,18383,19211,20247,19416,19972,19887,
+20270,19008,18381,18974,19214,18608,18573,19239,
+19082,19174,19185,19833,19596,19603,20139,19846,
+21345,25184,20328,20249,20116,19719,20322,20260,
+20283,20415,20203,20996,20698,21271,21846,21778,
+28248,27885,28778,28242,27462,28956,34500,37353,
+33168,33024,33105,33518,34104,33804,34679,35380,
+34991,35043,35514,36968,36918,36335,37464,37254,
+36930,36960,36557,36736,37587,37095,38029,35946,
+36309,36135,35974,35683,35340,35053,34992,35248,
+34881,34753,34341,34219,33620,33696,33416,33279,
+33441,33417,33379,33207,33182,33158,33184,33165,
+33064,33067,33093,33271,33375,33408,33322,33126,
+33163,33153,33169,33195,33279,33270,33402,33418,
+33352,33316,33176,33147,33131,33034,33010,32951,
+32920,32877,32122,31854,31374,30678,29129,25828,
+24750,21639,19692,18682,17763,17399,16998,16831,
+16821,16740,16763,16781,16809,17049,17225,17420,
+17463,17858,18131,18324,18428,19542,31263,20326,
+19580,19647,19458,18938,19449,18654,18608,17781,
+17829,17007,16349,16844,16692,16253,16313,16422,
+16476,16273,16165,16409,16275,16731,16186,16454,
+16002,15772,18298,17721,18338,17544,17670,17807,
+18058,18502,18804,19053,20520,21492,20420,21532,
+21407,22453,22716,21442,22436,22763,25392,23919,
+26509,24602,24354,22454,22819,23531,23082,22042,
+22142,22128,21818,21268,22194,21392,20821,21081,
+21562,21880,21841,20940,21055,21638,22470,29400,
+27123,24847,18294,18435,19101,18085,16917,16796,
+16938,16884,17112,17457,17621,17901,18117,18850,
+20566,20964,19940,19485,19841,20616,21930,20223,
+19835,19815,19838,19750,20269,20805,21366,22573,
+23203,23247,23802,25806,32571,32948,34023,34123,
+34416,34107,34288,37193,40089,39891,37419,37253,
+36729,36342,35906,36237,36941,35745,35930,35733,
+35237,35248,35070,35013,34827,34791,34825,34386,
+33972,33828,33645,33513,33686,33667,33418,33470,
+33765,33850,33759,33898,34304,33637,33435,33342,
+33390,33600,34025,33963,33471,33324,33041,32660,
+31404,29505,28246,27717,27730,28085,29641,31187,
+33171,34181,34092,33914,33710,33440,32994,32836,
+32733,31116,26262,24100,23415,23295,23165,23652,
+23988,24939,26442,27899,29457,30026,30766,30485,
+30075,30146,29857,29373,29464,32820,34836,35193,
+34980,35853,35104,35379,35253,35694,35793,35462,
+35277,34914,34620,34268,33918,33820,33465,33245,
+33054,33063,33045,33031,33026,33018,33132,33286,
+33243,33223,34391,35508,40782,39433,39468,38289,
+37734,37386,38360,37347,36672,37722,36140,37813,
+36087,36359,36168,34983,35535,36486,37902,37932,
+37580,36437,34725,34819,35765,35244,35444,36087,
+36513,35930,37503,38981,37923,38297,38622,39126,
+39771,40180,37981,36722,34117,33770,33519,33558,
+33498,33578,33576,33603,33678,33718,33770,34254,
+36737,46554,45470,50602,48327,45602,46287,50302,
+48986,46649,47405,48133,46377,48015,47312,47571,
+46782,46343,47115,47201,47374,46907,47038,47350,
+48299,47272,47143,47413,46965,47356,47508,46932,
+47129,47052,47192,47274,47228,47592,47484,46595,
+46668,45702,45711,46767,45723,45978,45338,44778,
+45358,46222,44698,44694,45675,45954,43417,41722,
+40545,37098,35955,35481,34689,35026,36543,35039,
+36042,37146,37478,36044,34200,35456,34319,33364,
+33293,33350,33607,33618,33209,33177,33150,33121,
+33084,33087,33144,33183,33257,33066,33019,33013,
+33013,33006,33003,32959,32930,32916,32892,32885,
+32877,32886,32825,32774,32729,32665,32640,32568,
+32510,31888,31799,32533,32982,33475,34170,32436,
+28419,28992,29696,28784,22981,19388,18919,19878,
+20072,20420,20563,20532,21713,27753,28596,28428,
+28305,25344,20943,12096,6003,14145,15966,16361,
+16236,15890,15716,15063,14892,15105,14523,14757,
+17266,14877,15270,16153,15236,14919,15106,15587,
+15711,16566,16613,18090,19822,19857,19680,19427,
+19998,21384,23466,24600,25197,23811,22273,21224,
+17913,16823,15645,15350,15157,15027,14706,14643,
+14475,14572,14326,14626,14379,14796,14951,15013,
+15043,15297,15769,16125,16443,15898,15873,16537,
+21400,29822,21957,16732,16441,16880,17290,17014,
+16822,17171,17298,17061,17194,17103,17523,17103,
+17465,16599,16389,16608,16565,18903,17454,17174,
+19769,24270,17844,16610,16481,16800,16560,16356,
+16105,16044,15999,15900,15762,15810,15719,15973,
+15823,15277,15404,15831,15486,17054,17789,19446,
+18018,20493,16865,16725,16287,16412,15882,16055,
+15837,15786,16017,15814,15758,15306,15532,16047,
+15799,16125,16143,16398,16626,16317,16672,16830,
+17049,17005,16818,16794,16463,16540,16322,16399,
+15800,16224,16123,16052,16931,17079,16288,15798,
+16629,16866,17139,16967,17951,17140,17982,17685,
+17903,18603,18135,17438,17559,18474,18132,17725,
+17458,18423,19756,19866,20525,20080,19417,20891,
+19733,19378,27481,20285,20244,19371,19385,19441,
+19379,19742,20035,19757,19458,19365,19868,19911,
+19829,20284,20184,20346,20744,21561,21787,26525,
+29698,31688,28936,29921,31881,32910,35391,35920,
+33023,33050,33177,33561,33489,33617,34153,34809,
+34357,35027,36295,36750,36049,36832,36976,38278,
+38973,36837,37158,36650,41066,38367,36723,36229,
+36468,36396,36090,35818,35596,35163,35081,34698,
+34538,34239,34194,33762,33913,33556,33374,33457,
+33353,33352,33321,33173,33188,33289,33224,33104,
+33078,33083,33079,33201,33355,33425,33361,33178,
+33157,33228,33490,33430,33570,33649,33663,33397,
+33367,33317,33285,33228,33237,33098,33013,33014,
+32979,32934,32894,32525,32143,31614,30780,27524,
+23787,21522,19734,18812,18265,17508,17148,16959,
+16861,16811,16804,16767,16827,17032,17124,17465,
+17286,17883,18078,18269,18734,18800,21795,20478,
+19865,19669,19557,18972,19276,19104,19158,18925,
+17181,18155,17785,16388,18585,17875,16431,16313,
+16623,16292,16401,20140,16248,16432,16375,18087,
+17317,17004,17450,18784,18561,17367,17691,17250,
+19072,18056,19135,19602,19752,20570,20763,22872,
+21869,20808,21918,21230,21704,23974,23839,25957,
+23885,25444,25720,24413,23949,22991,22651,22476,
+22403,22281,23163,21920,21456,22176,21903,21764,
+22199,22016,22386,22762,23283,22094,22492,22644,
+27075,19686,19205,18900,19026,18069,16668,16952,
+16752,16851,17544,17215,17334,17565,17741,18864,
+20465,21194,21674,22397,23342,31536,33111,22186,
+20667,20355,19911,20050,20192,26452,22389,21396,
+22218,22205,20792,22432,27186,32718,33402,33570,
+34089,34787,34800,34909,35905,37995,37235,36714,
+37399,37157,36807,37279,36628,37099,36556,36585,
+35511,35707,35409,35267,35061,35010,35187,34721,
+34187,33918,33688,33480,33463,33357,33433,33365,
+33463,33426,33570,33882,34558,33375,33287,33093,
+33067,33136,33159,33159,32819,32280,31114,29832,
+29183,27636,27304,26955,26895,26912,28941,30263,
+31853,31971,33494,34848,34645,33252,31608,28641,
+25158,25100,25425,25328,24621,24527,23793,23592,
+23863,24411,25212,25659,26668,26906,27646,28297,
+28536,29034,28845,28323,28515,30772,33944,33558,
+34827,37662,35187,35046,35052,35378,35553,35353,
+35241,34929,34582,34247,33972,33627,33293,33087,
+33071,33077,33065,33039,33055,33291,33957,34107,
+34389,36462,38802,39035,41505,39366,39119,37646,
+37941,40018,37120,35880,36452,35429,36272,35987,
+36577,35934,35556,35420,35959,36829,39671,39039,
+37100,35000,35457,35452,35173,35587,36732,38538,
+39963,36765,38058,38998,38420,41261,39336,38890,
+39114,40851,39298,41057,35850,33799,33636,34376,
+34960,35271,34073,33719,33770,33813,36195,39494,
+38934,47384,46956,48117,47884,49687,49753,47434,
+49749,48867,48080,46332,46749,46740,47262,46977,
+46754,48360,48153,47772,47905,48156,47932,47324,
+48669,47863,48144,47919,48605,47627,47838,47825,
+49461,48918,49610,47322,47466,47360,46629,46028,
+46140,46928,47335,47205,46100,47401,46245,45906,
+46119,44472,45220,43997,44245,44535,43880,44514,
+41321,37964,35965,36309,37299,37243,38143,36299,
+34804,34138,34613,34899,34503,34288,34167,33510,
+33283,33360,33405,33436,33203,33120,33146,33033,
+33046,33045,33130,33143,33243,33059,33014,33015,
+33048,33017,32939,32921,32916,32908,32892,32879,
+32873,32795,32775,32719,32673,32612,32579,32536,
+32392,33232,32828,32894,34502,33062,34532,33974,
+32155,32770,31788,29926,27849,25517,22277,20742,
+19275,20613,20805,21009,22071,25677,30567,31752,
+29352,26722,24910,12772,12984,13769,17490,16520,
+15894,15651,15691,15254,15477,15346,15326,14200,
+24373,17571,14787,14991,15554,15478,15736,15703,
+15929,16306,16396,16614,17249,19818,19995,18162,
+18311,19143,20761,23777,26784,25772,23061,19902,
+18141,17733,16021,15514,14904,14469,15448,14524,
+14287,14148,14334,14664,14468,14614,15012,15077,
+15417,15422,15828,15942,15711,16429,16326,18625,
+30337,18456,18000,17219,16746,18296,18600,16932,
+16776,16692,17038,17104,17544,17226,17940,18040,
+19009,18420,18074,17540,16419,19064,16794,18974,
+20954,17777,16524,16659,16476,16519,16221,16347,
+15862,16239,15969,16099,15882,15753,15710,16198,
+16132,16542,15069,15730,16178,16690,23936,16968,
+16566,17430,16328,16410,15678,15695,15635,15643,
+15575,15723,16012,15084,15339,15405,15166,15927,
+15815,15864,15942,16427,16400,16530,16564,16449,
+16492,16608,16428,16258,16347,16281,16041,15837,
+16593,16338,16045,16214,16435,16316,16547,16755,
+16551,16961,16917,17835,17271,17472,18073,17784,
+18090,17835,18091,17961,18377,18308,18370,18450,
+18206,18302,18511,19230,18664,18472,17912,17979,
+18468,19008,18280,19118,19761,20197,19684,19530,
+19544,20360,20080,19576,19512,19429,19786,19678,
+19564,20392,20439,20631,21349,22209,22556,30425,
+31811,31947,30300,30982,30639,33366,35554,33576,
+32775,34238,33411,34595,34444,34238,33771,35404,
+34219,35483,37042,35577,38184,37377,39479,38638,
+39174,37145,39029,36795,39996,38440,36711,36306,
+37011,36635,36352,36050,35804,35195,34853,34611,
+34427,34272,34075,33967,33729,33611,33648,33597,
+33486,33336,33296,33253,33186,33274,33186,33069,
+33144,33102,33091,33103,33278,33483,33201,33185,
+33272,33525,33660,33461,33861,33799,33822,33780,
+33539,33375,33355,33302,33131,33201,33111,33079,
+33036,33004,32949,32912,32898,32708,31676,30421,
+23863,22065,20826,19527,18780,17944,17585,17216,
+17028,16814,16803,16613,16773,16950,17155,17187,
+17552,17781,17766,18105,18757,18226,18729,19059,
+19305,18907,18620,18375,18971,19265,19534,18171,
+18841,17406,18568,19008,19655,17691,16332,16155,
+15864,16611,18648,16311,16019,16032,16128,16371,
+18530,16397,17679,18331,17141,17528,17849,18574,
+17087,18936,18981,18535,18342,19941,20603,20547,
+22024,22124,21545,21034,22478,23006,22317,23543,
+25323,25209,26619,24605,24022,23977,25032,22315,
+22378,22720,23079,22784,22392,22707,22574,22902,
+22740,23043,22937,25586,29928,27635,27474,23993,
+20571,20038,19155,18730,19212,18261,16875,17628,
+16720,16872,17080,17601,17212,17089,17356,18097,
+19355,20065,21214,22677,22179,21987,23488,25785,
+21492,21900,21015,19819,19722,19773,20265,20708,
+20526,20799,19964,19867,21903,30993,32700,33231,
+33645,34194,35079,35568,36171,39054,38961,37677,
+35520,37391,36874,36674,36625,36555,36582,36546,
+36675,36675,36111,35833,35572,35484,35271,34930,
+34660,34092,33793,33596,33316,33327,33228,33178,
+33130,33194,33294,33663,34392,33166,32958,32945,
+32881,32561,32328,32131,31509,30884,30675,29513,
+28290,27072,26430,26232,26218,26211,25267,26448,
+22795,23181,24840,24153,27297,26578,26053,26428,
+27054,26581,26122,26070,25386,25218,24775,23982,
+23701,23968,24257,24686,25129,25513,26197,27402,
+28173,27730,27894,27459,27605,28782,33310,36258,
+35287,34860,34953,34972,35238,35265,35234,35225,
+34971,34728,34466,34110,33882,33396,33216,33135,
+33099,33111,33079,33111,34398,36597,34960,35356,
+38542,37865,41220,39984,40527,39732,38494,39114,
+39097,38133,36034,37704,35748,35706,35272,35334,
+36350,35041,36163,36378,36831,37145,38665,39240,
+38434,35391,35695,36450,36246,37782,37260,38172,
+39458,40716,39647,38507,38668,41584,42506,41451,
+39174,39309,41432,37239,35777,35631,34947,34098,
+33960,34076,34411,34099,35364,37111,36844,38887,
+44467,48760,48221,48018,47481,48608,50283,46685,
+48582,46823,46824,46866,47813,47010,48276,46907,
+47503,48222,49081,49620,48576,48540,48610,47699,
+48532,48420,47679,47949,48008,48470,49535,48762,
+48084,47712,47463,47991,46904,46641,46978,47895,
+47239,47136,46320,45612,45736,47166,46553,46169,
+45683,45585,45531,44874,44563,43626,44349,42724,
+38379,38496,39084,36688,36657,36090,34545,34718,
+36543,37155,37780,36542,36018,35244,34845,33684,
+34575,33562,33372,33319,33219,33116,33127,33079,
+33097,33070,33057,33048,33018,33003,33026,33009,
+33020,32982,32922,32916,32922,32904,32870,32838,
+32797,32774,32732,32734,33072,32936,32621,32614,
+32489,32491,32868,33863,33006,34368,35128,33087,
+32928,33624,32907,31896,32088,30128,28786,27480,
+27402,25091,23813,21556,20982,29130,29181,31005,
+31514,28238,23409,12755,7529,16959,16524,16917,
+16343,15864,15867,15615,15719,16317,15255,14820,
+14043,14141,14579,14853,14760,14877,15198,15356,
+15190,15077,15210,15561,16167,16349,16287,16595,
+16703,17287,19406,20943,23370,24420,22990,21157,
+19161,18708,16440,15849,14800,14195,14451,14463,
+14493,14416,14546,14616,14796,14571,14973,15308,
+15525,15688,15726,15911,15561,15777,16887,28337,
+21036,17576,17354,17581,17675,23171,20163,24697,
+19710,23439,18932,20190,22563,21590,22291,20389,
+19041,19113,18256,17783,17619,17423,19101,23753,
+22848,16438,15428,16866,16023,16005,15915,15927,
+16042,15907,15792,15633,15394,15795,15980,15852,
+17180,16314,16607,20817,16540,16142,16181,16058,
+15826,15876,15871,15846,16068,16044,15639,15579,
+15438,15351,15231,15448,15239,15580,15525,15804,
+15498,15804,16227,16136,16217,16178,16109,16046,
+17328,16130,16471,16321,16149,15995,15946,16064,
+16344,16448,16722,18628,16247,16851,16761,16773,
+16269,17540,17231,17245,17277,17379,17543,17463,
+17790,17397,17324,19329,17685,17533,17738,17952,
+17879,17925,17925,17913,17923,17748,18156,17787,
+17883,18256,18497,18223,18915,18681,19118,18915,
+19089,19185,19139,19751,19989,19227,19536,19699,
+19424,20438,20922,21825,22041,22937,29211,30273,
+30933,31605,30295,32997,33659,34407,37701,33003,
+36628,33432,33494,33732,34329,34841,34496,34342,
+34884,35239,36009,37365,39663,40467,38610,39705,
+39778,38014,37368,38481,39271,38108,36996,36558,
+37104,36781,36414,36126,35958,35794,35247,34608,
+34353,34052,33946,33864,33865,33783,33617,33465,
+33510,33462,33307,33304,33342,33213,33129,33230,
+33212,33127,33122,33122,33255,33326,33195,33315,
+33432,33417,33477,33621,33920,34025,33976,33861,
+33687,33555,33511,33303,33495,33349,33198,33094,
+33070,33012,32941,32952,32946,32898,32866,31426,
+25118,23157,21610,20104,19731,18876,18990,17786,
+17170,17021,16904,16836,16864,16862,17008,17289,
+17409,17511,17863,17556,17734,18819,18025,18622,
+18771,18771,18949,19560,18802,19817,18276,20322,
+17949,17439,18486,19801,19350,19221,18129,16863,
+16006,16443,16749,16509,16240,16225,16764,16488,
+15810,17133,17384,17146,18252,17992,18789,17430,
+16992,17926,19480,19368,19787,19327,20512,20537,
+21252,20581,20971,19422,23349,22344,22480,23325,
+24507,22576,23136,25791,21686,24723,25356,25099,
+24672,23460,23583,23616,23322,23329,23231,23044,
+23657,22203,22410,23763,23610,23010,24093,26340,
+20942,21003,20166,19362,18119,18514,17346,16810,
+17284,16804,16743,16932,17169,17215,17373,17406,
+18367,19329,19594,20061,21896,20457,20856,21650,
+21281,21099,20857,29012,19568,19668,19679,19728,
+19716,19797,19819,19975,19938,23313,30386,32518,
+32710,33180,33455,34131,34917,36053,36771,37546,
+37877,36619,36543,36254,36072,36153,36195,36138,
+36497,36882,37081,36479,35973,35316,35178,35205,
+34821,34119,33707,33255,33144,33136,33081,33062,
+33041,33045,33299,33309,33066,32996,32938,32880,
+32832,32346,32156,31961,31551,31461,30407,29120,
+28224,28009,27414,25374,24645,23742,22108,22443,
+23223,24891,25803,26231,27577,28472,28353,27352,
+27354,26601,26228,24611,24974,25161,25535,25075,
+24464,23856,24198,24095,24252,25140,25723,25302,
+25066,30079,26225,26424,26925,27559,28401,36848,
+38317,35469,35171,35410,35136,35017,34989,34904,
+34685,34453,34279,34109,33715,33276,33108,33162,
+33111,33117,33164,33878,36809,37037,36283,36624,
+39021,38030,39108,39837,38449,39568,41292,36568,
+35968,36276,36244,35616,35590,35715,35358,35124,
+35830,34989,38212,36340,36911,38256,37551,37072,
+35773,35013,36421,36548,37318,39123,41214,41045,
+39863,40722,40404,40042,39754,39515,43518,42386,
+40545,40758,41267,39100,36939,39492,37515,35671,
+33909,34426,34845,38061,39348,39751,38238,45130,
+48864,47545,45144,45169,49697,46140,46200,49029,
+46377,47239,49266,48923,48892,48784,48828,47941,
+46908,47553,47809,47094,47814,47522,48352,48630,
+48353,48258,48584,47954,48410,48776,48225,47454,
+46872,46702,47538,46467,47133,47945,46884,46467,
+45418,46254,46063,46499,45726,46290,45457,45667,
+44645,45429,44086,43482,43260,43271,43341,43691,
+40597,40230,37383,36754,36501,37338,38157,40176,
+39008,37650,36963,36490,35013,36852,36465,36274,
+37686,33367,33226,33189,33149,33160,33165,33150,
+33076,33075,33083,33099,33066,33030,33027,33024,
+33021,32912,32911,32911,32937,32850,32822,32793,
+32764,32747,32718,32699,32667,32746,32799,32722,
+32658,32631,32637,33019,32925,33325,32868,32967,
+32973,33732,36154,35751,34934,32736,32832,34450,
+29031,26995,27526,25785,22030,26636,27862,28965,
+31338,26199,21498,10046,9352,15886,18618,19041,
+15897,15570,15499,16914,16857,15801,15324,14630,
+14346,14454,14877,14811,14841,14768,15018,14890,
+14952,14925,15414,14965,15416,16574,15501,15523,
+16078,16710,18066,19263,21108,22997,23974,22191,
+20554,19758,18016,16348,16182,14952,14976,14456,
+14463,14440,14637,14747,14917,14958,14997,15305,
+15855,16101,16157,15999,16212,15809,24010,26854,
+17804,16920,17512,19888,22299,24436,23489,23492,
+23262,25059,22876,22797,24611,26316,26392,23440,
+22628,19029,20713,23980,24462,20369,24554,21944,
+16948,16906,17008,15593,16176,15733,15726,16510,
+15993,15690,15494,15546,15508,15648,15724,15612,
+15725,16191,18719,16362,16338,16324,16047,16542,
+15847,16065,16134,16060,16011,15621,15708,15817,
+15415,15349,15306,15131,15595,15606,15809,16115,
+15886,15867,15933,16010,15864,16010,16094,15882,
+16428,16065,16143,16051,15940,15672,16281,16237,
+16549,16623,16506,16620,16699,16676,17009,17268,
+17466,16632,16655,17022,17496,17451,17398,17503,
+17619,17498,17592,17573,18032,17688,18306,17750,
+17606,18213,17611,17457,17468,17732,17780,17638,
+17763,17302,17529,17941,18183,18029,18480,18644,
+18522,18858,19302,19266,18885,19119,19351,19553,
+19791,19941,20574,21115,21884,25587,30820,31605,
+32157,33033,34320,34968,36284,37437,39749,35412,
+35070,34002,34588,33618,33952,35151,37399,36361,
+36494,37314,38993,39113,39602,39092,39508,40117,
+39922,38679,37849,38892,39548,38232,37206,36573,
+37056,36785,36531,36396,36139,35988,34902,34548,
+34426,34106,34014,33891,33795,33831,33623,33501,
+33513,33672,33795,33569,33546,33486,33405,33240,
+33171,33158,33142,33139,33306,33348,33273,33394,
+33753,33668,33786,33928,33724,33697,33987,34036,
+33861,33630,33456,33533,33441,33284,33249,33181,
+33099,33075,33075,33056,32992,32928,32915,32904,
+31098,23788,22758,21652,20497,19924,18945,19243,
+18741,17781,17161,16960,16917,16920,17020,17142,
+17175,17253,17311,17383,17615,17988,18084,18111,
+18288,17736,17747,19116,19305,19162,18492,18457,
+18078,18147,17930,20136,17473,16769,17484,16353,
+16440,16296,16391,16115,16287,16492,16394,16887,
+20073,16991,17174,19949,18714,17827,18144,19179,
+18212,17793,17925,19425,18988,19583,19395,19071,
+20445,20863,21992,22489,20161,21183,22244,22886,
+22408,23704,24171,23931,24324,28075,27852,25971,
+24578,24015,23954,24138,23288,23034,22590,22900,
+23064,23685,29097,30469,22927,22181,22552,23511,
+20770,21860,20494,19427,18204,16848,17475,17886,
+17282,17694,18345,17138,17118,17181,17599,17442,
+17445,18716,18000,18582,19629,20514,20190,20517,
+20854,20827,20448,20034,20801,19642,19632,19625,
+19392,19638,19781,20343,20001,20595,22867,26676,
+30452,31769,32781,33231,33180,33480,33671,34409,
+34629,34257,35519,35665,36159,36876,36510,36162,
+35980,36057,36276,36645,37146,36461,35652,35459,
+34642,34065,33629,33124,32871,32854,33228,33174,
+33302,33992,33311,33235,32844,32907,32873,32847,
+32739,32581,32553,32088,32109,32360,32064,31758,
+29143,28145,26226,23839,23522,22831,21166,22632,
+24419,25376,25686,25585,25827,25313,25171,26551,
+27643,24453,25083,23194,24474,23922,25169,25539,
+25538,24993,24759,23538,25110,25238,25348,25500,
+25572,25189,26908,27005,26675,27038,27700,34419,
+36873,36604,35244,35736,34439,34575,34723,34484,
+34132,34004,33873,33762,33474,33483,33313,33258,
+33159,33213,33625,35371,37440,37570,37122,38692,
+37664,38449,39082,37933,38739,40326,35611,35874,
+35544,35216,35143,35146,35248,35260,35182,35100,
+35175,35494,35742,35784,38069,36618,35852,36253,
+35094,35846,35596,36836,35878,36454,39188,40458,
+41093,42063,41925,41623,41516,42441,41002,43068,
+41073,40731,39858,39533,36512,34683,34913,33934,
+34527,35598,37607,39567,39771,37736,45116,47277,
+46635,44964,43168,47353,46266,47697,49132,47977,
+50348,49110,48735,49670,47726,48129,48269,47853,
+49855,48099,47683,48948,48378,48877,48307,47871,
+48118,48831,48213,48190,49355,48087,47621,46956,
+46806,46698,46416,46619,46980,46899,47619,46251,
+46631,46710,46896,46993,46063,45579,46027,46679,
+46071,46170,43542,44785,43665,43931,44007,41565,
+40052,41742,37734,38293,38568,37815,37317,34692,
+34299,34218,35073,38205,36194,36447,34728,36813,
+34537,33838,33662,33272,33205,33144,33128,33112,
+33129,33131,33127,33075,33132,33025,33027,33034,
+33027,32917,32910,32908,32890,32802,32782,32775,
+32742,32717,32947,32963,32957,32959,32987,32976,
+32869,32674,33603,32666,32776,32778,33558,34752,
+33211,33044,32996,33206,33552,33339,33096,34924,
+33768,32960,30768,29970,29039,26853,32554,30228,
+27702,23166,13884,10984,9194,16121,16841,20505,
+26888,15923,15556,15462,15647,15513,15236,14877,
+17820,14539,14380,14927,15127,15043,15197,14834,
+14634,14715,15042,15483,15327,15447,15484,15910,
+16470,17046,17500,18629,20105,21203,23031,23769,
+22125,21538,19389,18117,16575,15639,15121,15288,
+15012,14769,14949,14746,15386,14937,15543,15690,
+15915,16118,16420,16085,16521,15920,17126,27435,
+17919,16999,23050,23681,21922,21438,21405,21285,
+20165,22865,21627,22581,23998,25014,25142,22566,
+23756,24432,21950,21888,22015,24290,24459,26352,
+17076,17272,16239,16335,15858,15668,15103,15021,
+15148,16116,15885,15477,15286,15462,15324,15429,
+15064,16030,16134,15876,15916,16371,16249,16110,
+18071,15664,15929,15583,15537,15750,15741,15874,
+15621,15509,15723,15225,15495,15560,15815,15967,
+16112,16122,15959,15813,16028,15948,15896,16110,
+15973,16219,16137,16015,15894,16285,16320,16667,
+16989,16422,16450,16864,16788,16740,16908,17117,
+16917,16604,16882,17107,17110,17009,17083,17399,
+17130,17606,17493,17784,18165,18081,18884,19692,
+17462,17760,17433,17024,17561,17703,17724,17972,
+17515,17724,18078,18411,18414,18591,18536,18364,
+18484,18431,18657,18897,18995,19103,19744,20018,
+20366,20668,20777,20882,26277,31299,32721,33863,
+36971,37441,36531,35151,35756,35508,36633,34840,
+35958,34680,34938,34153,36138,36511,37603,38056,
+37243,39182,38307,38159,38079,38259,39270,39805,
+39959,39342,37363,38877,38799,38501,37638,37296,
+37245,37030,36749,36550,36240,35331,35113,34663,
+34410,34332,34607,34112,34090,33826,33933,33648,
+33690,33720,34114,34047,33981,33840,33467,33225,
+33198,33162,33239,33165,33321,33365,33450,33522,
+33435,33537,33691,33850,34242,33867,34134,35054,
+34571,34137,33789,33790,33462,33492,33513,33386,
+33208,33171,33072,33083,33063,33029,32999,32940,
+32948,25837,23645,22813,21962,20236,19785,19528,
+19824,19360,18384,17754,17304,17084,17154,17274,
+17324,17254,17454,17623,17555,17994,18003,18018,
+17913,18357,17855,18629,19177,19677,19158,19130,
+18807,19745,18272,17346,17335,18039,20901,16461,
+16277,16356,16254,16209,17160,16191,16181,16947,
+20410,17161,24432,27930,28268,17859,19113,17965,
+17911,18064,18965,19469,20394,19341,20103,20275,
+20820,20215,20399,20787,20357,20703,21880,22077,
+22009,23661,22839,24150,23857,25827,28193,27073,
+24451,25270,25209,24588,23445,23120,22893,23826,
+24012,23985,27750,22653,22398,22086,23148,25783,
+26121,21107,21583,19509,18630,17550,18264,17424,
+17719,17475,17380,17562,17490,17295,17872,17334,
+17472,17882,18197,19127,20217,21750,26587,24456,
+23559,22509,22014,23843,20870,21386,19630,20304,
+19491,19687,19846,20844,20192,20319,22658,24170,
+25551,28035,32538,33039,33725,33745,34533,36606,
+37012,34278,34345,35105,34656,36822,35940,35901,
+36494,36243,36096,36165,35664,35787,36484,36553,
+35664,34625,33776,33272,33197,33548,34005,35876,
+35136,34677,34395,33470,33485,33005,32997,32948,
+32894,32685,32145,31854,31836,31736,32376,31999,
+30658,26281,24477,22679,21859,21921,21888,23721,
+24416,25015,25443,24712,23546,24437,24501,23603,
+29316,25592,29000,30013,27930,23719,26434,25288,
+25230,25450,25774,25602,25605,25493,25640,26623,
+27656,34049,33333,30202,27913,28555,28109,30942,
+34209,34605,35816,35257,35369,34488,34047,33926,
+33710,33493,33541,33964,33827,33504,33397,33333,
+33549,33529,34109,34521,37569,38759,38851,38802,
+39963,39023,38233,39634,37608,35836,35470,35401,
+36624,35591,35150,35094,35149,35157,35112,35105,
+35144,35145,36677,35367,35637,35537,35815,36225,
+38002,35460,35363,36713,37451,37983,38833,38154,
+40676,41550,41115,41970,41963,41105,42590,42494,
+42453,43167,38271,38740,35525,38547,37266,35362,
+35681,37500,41538,44268,42559,41146,44858,44063,
+42611,48800,45466,49984,48397,49464,48726,48978,
+48943,48264,48212,48426,49752,48552,48625,47907,
+49108,48381,48741,48763,48555,47982,47914,48822,
+47773,47836,47592,48615,47652,47780,48551,47648,
+47621,47368,46497,46121,47047,46071,47718,46747,
+47085,46626,45962,46102,45741,46210,47088,45595,
+45216,43953,44247,44096,44145,42980,42156,40864,
+41470,38789,37212,37513,37725,37612,37166,36630,
+36258,35792,34307,34079,34140,34741,34597,34757,
+33829,33463,33781,33304,33233,33185,33180,33117,
+33114,33104,33114,33110,33129,33093,33019,32874,
+32809,32921,32910,32904,32848,32788,32772,32761,
+32742,32718,32987,32983,32985,33265,33003,32964,
+32982,32964,32458,32716,32643,32658,32949,32742,
+35076,33822,34659,33637,33152,32991,33646,33318,
+34339,32982,32985,33020,32976,32625,31435,28972,
+25158,26674,20577,16505,10042,15960,16902,15870,
+16311,15620,15298,15144,15225,15210,15473,15124,
+14646,14657,14690,14726,15176,14904,14946,14547,
+14520,14700,15081,15508,15648,15540,15866,16356,
+16774,17154,17776,17774,18001,18732,20499,19833,
+20019,20805,21023,17280,16963,15593,15423,15201,
+14868,15051,15212,15276,15785,15573,15656,15894,
+15999,16188,16461,16791,17778,18290,20856,29381,
+22180,17141,20694,22362,20651,20378,20911,19427,
+19500,20586,22946,22439,22002,22718,22107,23226,
+20652,20557,20916,20116,20891,22095,22667,23004,
+25398,18648,17160,16062,16234,16605,16435,15849,
+15634,15637,15087,15009,15346,15353,15675,15001,
+14876,15176,15306,15469,15666,15946,15963,15549,
+15363,16118,15954,15893,15795,15765,15918,15921,
+15795,15673,15779,15609,15231,15571,15990,16036,
+16103,15679,15978,16063,15720,15762,16148,15969,
+15891,16352,16052,16116,16160,16486,16668,16653,
+16845,16806,16797,16802,17125,17420,17019,16973,
+16872,17211,16965,16944,16956,16983,17319,17280,
+17324,17484,17676,17433,18049,17817,18315,18348,
+18186,17136,17088,16968,17569,17424,17833,17707,
+17418,17604,17476,18293,18468,18573,18232,18532,
+18744,18819,18990,18891,18724,19460,19740,20387,
+20787,21085,21157,21454,29313,31179,33822,35077,
+35638,33297,33829,37846,35756,36000,35886,35552,
+36651,37299,36440,35604,36922,37954,38187,39456,
+39790,38074,37353,38103,38156,38619,39570,40674,
+40016,38945,38016,39295,39429,38231,37746,37381,
+36639,36645,36821,36556,36259,36059,35709,35117,
+34756,34583,34337,34264,34214,33964,33873,33687,
+33578,33502,33467,33474,33656,33687,33285,33401,
+33228,33179,33309,33195,33316,33438,33414,33377,
+33887,33852,33711,33845,34670,34297,33707,34958,
+36037,36317,35063,34080,33698,33697,33696,33424,
+33561,33248,33120,33169,33037,33024,33009,32979,
+32988,32928,26596,24237,22305,21207,20231,19976,
+19998,19937,19533,18955,18012,17845,17692,17564,
+17421,17520,17863,17989,18319,18558,18284,18199,
+17743,18786,18141,17776,18906,18783,19046,18841,
+18372,18097,17715,18023,18066,17548,16531,17702,
+16658,16348,16528,16494,16108,16739,15744,16396,
+17274,22467,16822,18617,18057,18095,20317,19872,
+27073,18870,18564,18592,21130,19528,19550,18915,
+20696,20685,21912,21049,21096,21426,21681,21729,
+22519,22440,22617,22855,23904,25906,24729,21569,
+23157,27669,27399,25617,24805,24715,24451,24885,
+23808,23080,23110,24195,23764,23353,22534,23286,
+22480,21021,21178,20316,19321,20070,18897,18166,
+17997,18243,17587,18132,17817,17610,17184,16881,
+17529,17443,18061,19460,19641,21940,23121,25283,
+28186,28002,26809,20453,19333,20634,23614,22272,
+21737,23124,19641,19854,21137,22233,23712,25710,
+27269,29499,31110,32760,34032,34935,33024,32389,
+33445,32931,32802,32524,32610,34024,34541,34821,
+35152,35879,35907,36084,35385,35385,35981,35319,
+34464,34318,34236,35265,37500,36240,37123,36383,
+36514,34974,34241,33674,33267,33242,32979,32946,
+32881,32879,32131,31282,30951,31478,31634,31770,
+28266,27885,21795,22189,22743,21051,22329,23519,
+24081,24057,23248,23018,22592,21711,22783,32825,
+34965,38287,34088,32995,33013,30132,27561,28425,
+27501,22638,23211,25244,26464,25916,25808,25855,
+27728,31274,33553,33150,30738,30222,29491,29940,
+36400,34147,34570,34692,34629,34361,35052,34074,
+33567,33671,33609,33845,33729,33615,33672,33559,
+33653,34419,35645,34837,38479,39535,38921,38583,
+39960,38028,38611,39747,37949,37001,35903,35514,
+35551,35415,35638,35590,35946,35428,35180,34935,
+35130,35908,36520,35682,35943,36584,37071,37428,
+39604,35611,35541,35178,35235,35467,36003,35992,
+38980,38901,41624,40686,40482,43356,42706,40413,
+40474,45441,40961,42076,40350,43935,40801,41580,
+43156,44998,39060,45758,43778,43026,47024,47062,
+42294,48210,47940,48606,49991,49236,48609,47535,
+48489,51072,48950,50475,49965,47893,47831,47806,
+47721,47622,48003,48243,47657,48460,47390,47724,
+47929,48169,47403,47466,47313,47676,47388,47553,
+47130,47026,46677,46282,46617,46843,46590,46417,
+46446,46376,47106,46423,46258,45219,46664,43524,
+42608,42918,44493,44149,43314,42130,42951,39401,
+39928,39043,38700,38160,39080,37266,36681,36532,
+36729,37224,36966,34991,34810,34623,34361,34512,
+36474,35332,33224,33234,33235,33179,33147,33118,
+33108,33042,33355,33739,33286,33268,33173,32843,
+32804,32906,32898,32895,32838,32807,32778,32758,
+32750,32723,32786,32922,32985,33205,33821,34400,
+33264,33566,32855,32572,32579,32584,32622,32505,
+32660,34031,34481,34776,34366,34097,33688,34725,
+33370,33006,33963,35777,36198,35417,32805,32944,
+33287,32597,28000,20535,8817,15322,16251,15828,
+15837,15875,15728,16763,15448,15402,15600,15726,
+15368,15172,14733,14941,14969,14838,14937,14816,
+14797,14742,15564,15794,15484,15823,16525,16521,
+17185,17392,17623,18819,17836,18345,20553,19329,
+19926,20212,20952,19255,18084,17022,16419,15801,
+15169,15010,15238,15423,15669,15873,15547,16177,
+16392,16568,16556,16857,17082,18589,27724,32136,
+27576,17436,18382,21483,17910,19470,17748,21432,
+20197,18664,22662,21843,22230,20412,20472,21044,
+19792,19251,18195,20220,19394,20209,20075,20490,
+19807,19818,17906,17691,16386,16383,17171,16160,
+16101,16339,16080,15427,14763,14400,14722,14923,
+14963,15487,15594,16038,16077,15928,16095,16007,
+16007,15869,15746,15203,15507,15402,15687,15633,
+15719,15708,15575,15855,15798,15882,16283,16400,
+15888,16136,16336,16065,15750,15894,15958,16005,
+15991,15901,16101,16447,16490,16633,16835,16335,
+16845,16645,16607,17439,17219,17403,16824,16485,
+16866,16572,16764,16986,17072,17340,17245,17598,
+17391,17197,17574,17620,17756,17481,17100,17733,
+17738,17622,17663,17077,18283,17529,17838,18114,
+17848,17737,18187,17947,18636,18825,18738,18738,
+18697,18751,18954,18977,19131,19290,19915,21028,
+21712,21635,24650,23905,29999,34445,33758,34628,
+33225,33315,36048,37504,35016,35266,35009,33980,
+36379,35880,34131,36765,37335,37527,38178,38247,
+38859,37086,37999,38718,39032,40015,38688,39087,
+39448,38704,38852,38845,41225,39286,38940,37743,
+36912,37163,36531,36495,35883,35750,35714,35245,
+35008,34683,34581,34341,34020,33915,33786,33649,
+33593,33581,33864,34389,34338,34164,34470,34093,
+33281,33219,33231,33205,33225,33269,33413,33494,
+33605,33624,33774,33882,33879,34578,33739,33856,
+34500,36538,35009,36695,34020,33940,33729,33660,
+33617,33453,33391,33216,33104,33044,33029,33003,
+33000,32916,30901,25705,23561,21632,21249,20767,
+20271,19965,19642,19563,19154,18567,18330,17969,
+17964,17681,17928,18440,18522,18365,17916,17393,
+17853,17565,18028,18018,18345,18534,19201,18594,
+18360,17719,17418,18058,18724,16521,17260,17429,
+16707,16689,17262,16576,16578,16581,16635,18454,
+22466,18850,19561,18050,18036,17151,17636,17454,
+23838,17802,18267,17837,19393,18590,19472,19134,
+18920,20323,20997,20556,20696,20972,21072,20861,
+20927,20627,23109,21611,23433,23192,23708,24064,
+24971,25820,26748,25874,26628,25188,25048,26066,
+23992,24303,23275,23378,23222,23724,23630,22699,
+23042,21180,22014,20870,20566,20899,20436,19821,
+18677,19497,19277,18324,17719,17358,17138,17046,
+17193,16329,16968,17496,18045,19341,21618,23769,
+24231,23711,21852,19614,18410,18402,18384,18383,
+18346,18353,18336,19263,19596,21319,23940,26515,
+28434,29343,30831,32042,33276,32805,30745,28425,
+28728,30612,31395,31171,30640,31588,33374,33442,
+33468,33900,35199,35473,35628,34943,35259,34719,
+34415,34796,36937,36616,35409,35482,35569,35286,
+35114,35371,35606,34206,33156,33007,32906,32603,
+32196,32370,28695,31066,30414,32619,32562,30626,
+21588,21430,21028,20728,20669,21114,22561,23668,
+23310,23921,21991,20847,21370,28452,31027,31215,
+30041,29936,29713,29675,26364,29360,30830,31288,
+24498,21168,23246,24496,26335,26085,25167,25450,
+25878,27444,29714,29819,30857,31980,29210,30375,
+34904,34275,33914,34067,34039,33805,33961,33732,
+33986,33703,33807,33705,33782,33609,33546,34268,
+33964,35010,37326,36885,38543,39072,39111,38607,
+38324,39173,37786,37616,36498,36397,36846,38169,
+41962,39076,40582,39342,36577,36849,37207,36895,
+35607,36402,37742,38200,37604,37497,38313,37374,
+37560,36771,34578,35169,34635,34737,34540,35004,
+36563,37920,37154,40679,40563,40974,39606,40233,
+41724,35874,39747,46096,47091,43137,45964,38310,
+46525,45286,44135,44315,45649,38904,46202,47614,
+46482,48294,50302,48751,48864,50692,48873,50346,
+49575,47381,49358,47422,47864,48881,47957,48084,
+47784,47892,47904,48837,48126,47652,47994,48432,
+48374,48722,47995,48081,47586,48137,47904,47523,
+47214,46989,47212,48304,46050,44606,45392,45112,
+46381,46368,47649,47250,44537,45358,46713,43913,
+41826,42904,43806,43340,42003,40820,39083,39299,
+39009,38877,38754,38543,39063,37356,36956,36969,
+36949,37186,36124,37264,36810,35428,34390,34923,
+36024,35852,36744,34438,33237,33134,33173,33107,
+33086,33147,33442,33855,33671,33497,33675,33105,
+32988,32901,32888,32875,32856,32802,32786,32780,
+32760,32753,32850,32799,32967,33009,34008,35643,
+33174,33950,33536,32409,29643,29514,32424,32223,
+32212,32559,32470,32268,32190,32596,33203,32646,
+34416,34692,35020,37920,38410,35412,33585,33014,
+33061,33088,32071,24931,18757,19135,14631,16562,
+19602,15966,15821,15521,15651,15474,15631,15773,
+15678,15305,14925,14908,14919,14849,14951,14833,
+15681,15519,15339,15479,15219,16477,16753,16798,
+16838,16847,17823,19944,21921,22342,20517,19872,
+18951,19242,19089,19669,18819,18120,18000,16392,
+16230,15878,15855,15813,15631,15756,15598,16071,
+16408,16549,16749,16737,17021,19414,30201,25348,
+20594,18043,17699,18829,17311,18689,17985,18021,
+18368,19250,21230,21317,20816,19951,19712,19560,
+18120,17986,18315,18727,19330,17663,18553,18201,
+18300,19755,18071,18360,17652,19860,16604,16634,
+16771,16386,16517,15459,15039,14667,15420,15636,
+15011,16617,15087,15445,15744,16268,15967,15888,
+15752,15229,15131,14870,14800,14855,15402,15678,
+15527,16188,15786,16169,16806,16646,17226,17103,
+15870,16362,15541,15647,16440,15376,15720,16035,
+16333,16442,16500,16860,17088,16658,17114,16238,
+16975,17067,16761,17012,16981,17006,16999,16821,
+16702,16508,16566,16662,16855,16850,16784,16650,
+17190,17072,17421,17033,16968,17380,17527,17569,
+17388,17460,17700,17602,17268,17271,17989,17874,
+18083,18396,18205,18370,18330,18863,18342,18901,
+18729,18641,18737,19113,19161,19440,20054,20964,
+21714,22842,23238,29489,33372,34039,35454,33423,
+33219,33285,37209,41060,39133,35878,35758,36006,
+40067,35081,35328,36176,37977,36983,36579,39459,
+38304,37896,38305,39018,38264,39677,38183,38368,
+39318,39681,40615,38714,40340,41093,38536,38546,
+38103,37428,36877,36476,36088,35796,35563,35283,
+35137,34776,34586,34080,33990,33990,33897,33714,
+33580,33578,33997,34122,34327,34346,33685,33546,
+33690,33327,33252,33234,33248,33255,33326,33387,
+33558,33616,33534,33540,33791,34224,34369,35211,
+34215,34237,34555,35371,36228,34257,33954,33759,
+33746,33634,33450,33327,33113,33064,33013,33011,
+32994,32895,31659,26640,24204,22878,22045,21522,
+20670,20169,19874,19614,19388,19360,19156,19070,
+18486,17949,17850,17983,18407,18131,18163,17890,
+17793,17571,17901,18097,18101,18531,18377,18679,
+17961,18933,17367,17906,17479,18706,16645,16311,
+16818,16778,17196,16503,16572,16573,16775,24409,
+17688,20337,17148,17473,18138,17176,17927,17490,
+17135,17209,17434,17700,18174,17995,18274,18549,
+18354,19203,19077,20938,21075,19692,19649,20593,
+21207,22252,22241,22115,22655,23769,23252,24383,
+24967,25968,25881,27552,24758,27919,26415,25380,
+24882,24429,23950,23922,23479,22615,22401,23106,
+22935,23187,22407,21798,20857,22077,23665,22537,
+19601,19450,19288,17936,18830,19449,19350,17313,
+16501,16418,16514,16451,17151,17852,19245,20020,
+21277,25809,25393,21432,19413,19995,22293,21003,
+24630,21897,18354,18498,21452,21438,25525,28706,
+29960,30397,31014,32864,33284,32853,30462,30009,
+31116,30411,28000,28305,27129,25358,25025,25020,
+31673,34392,33646,33616,33843,35466,35038,35208,
+35037,35610,36135,36393,35263,35295,35339,35610,
+35162,35315,34143,34232,33718,32833,32727,32241,
+31668,30442,31077,29886,31510,32395,30834,23058,
+22785,23056,22556,21957,20881,21203,22736,23458,
+23148,24388,20931,22167,26735,29145,29504,30757,
+29763,29575,32523,31799,31262,32299,30495,32970,
+31078,22831,31779,34640,32023,26122,25587,25759,
+31926,35769,35315,33301,31498,31913,32474,32253,
+33403,34186,34374,34179,34161,33978,34098,34428,
+34360,33813,34236,34169,33894,34023,33775,34224,
+35436,34701,38052,38285,37548,39183,38955,37710,
+38844,38769,38115,36888,37388,39893,40190,41643,
+39660,34237,35503,37812,37263,36392,37600,37423,
+35737,35466,35850,36081,37979,36671,39056,35925,
+36165,34676,34154,34382,34647,34667,35328,35534,
+34813,34742,35140,35115,37411,36006,37332,36935,
+36976,34588,37914,46316,45509,44034,47322,47305,
+41968,46958,43484,40201,42666,41121,51323,48354,
+46542,47806,48934,48091,47295,46492,47657,41410,
+43255,41051,40676,42411,46931,47904,48063,48120,
+47823,47844,48342,48446,48567,48729,48528,48335,
+47760,48018,47985,47436,48446,47716,48515,48398,
+45574,48248,47937,45749,43759,42059,42921,42949,
+43323,42126,41356,41851,43635,46756,46319,42433,
+41692,41277,43252,41260,43294,39396,38486,38610,
+39537,38700,38716,38943,38098,37985,37442,37162,
+37509,37116,36522,36816,35733,36354,37046,34767,
+35927,35902,35903,34680,33344,33168,33151,33117,
+33096,33321,33468,33766,34114,33767,33184,33105,
+33004,32951,32907,32862,32862,32781,32712,32718,
+32745,32763,32829,32886,32989,33177,33453,33476,
+33207,33716,34514,32403,27996,27610,27343,28185,
+29055,32245,33506,32578,29839,30409,32115,32187,
+33126,36542,35601,38028,35716,34380,33107,33069,
+33084,32295,30573,27499,21879,13170,12488,17711,
+15696,15855,15815,16181,16180,16008,15775,15638,
+15570,15661,15174,14864,15333,15147,15443,16323,
+14923,15858,17358,15256,15472,16077,16367,16287,
+16359,16918,18294,21096,22656,23328,21056,19515,
+18550,18111,18608,19648,18741,19894,17258,16739,
+16320,16220,16623,16639,16679,16644,16526,16578,
+16956,17839,18003,17546,17850,17832,18582,23149,
+17897,17478,17364,17025,17221,17311,19279,20146,
+18956,19335,21931,21743,21226,20226,19087,18293,
+17340,17467,17409,18165,17457,17454,16790,17355,
+15651,16200,17361,19322,17288,17247,17357,17173,
+17596,16167,16433,16670,15998,15814,15899,16280,
+15714,14715,14046,14334,14112,14758,15661,15720,
+16084,15609,15732,15717,15912,15617,15746,16300,
+16128,16287,15875,16503,16077,16363,16643,16537,
+16110,15890,16195,16173,15967,15681,15969,16086,
+16212,16370,16601,16509,16533,16453,17199,16626,
+16881,17281,16971,17175,17043,16916,17231,16890,
+16789,16458,16475,16715,16956,16869,16783,16554,
+16974,17403,17385,16925,17002,16678,16932,17182,
+17323,17585,18063,17949,17811,17674,18243,17729,
+18348,18577,17911,18120,18297,18843,18561,18636,
+18638,18653,19356,19377,19422,23319,20034,21091,
+21597,22848,25500,29862,33021,34240,33847,33132,
+33282,34645,41098,37670,34033,33057,35486,36641,
+36971,38445,34833,34448,37596,37812,37302,40056,
+36879,38113,38609,38164,37894,39488,37730,37887,
+38706,39468,40014,41892,40178,42243,39594,39303,
+38692,37727,37044,36591,36013,35644,35499,35194,
+35062,34568,34338,34024,33973,33891,33939,33767,
+33721,33705,33710,34107,34180,33924,34005,33817,
+33915,33631,33447,33291,33265,33272,33462,33420,
+33478,33534,33585,33692,33817,33880,33873,34203,
+34528,34428,34506,34725,34927,35675,35351,34451,
+33813,33577,33376,33357,33188,33061,33063,33015,
+32949,32925,32804,26819,24684,23574,23106,22554,
+21098,20429,20003,19815,19691,19526,18855,19620,
+18139,17804,17934,17893,18293,17939,18192,18260,
+18260,18187,18179,18005,18152,18338,17778,17442,
+17568,17490,18144,17064,17505,17324,16935,17001,
+16935,16491,17597,16796,16698,16743,16731,16745,
+16631,16918,16267,16966,17271,17461,16995,17751,
+17007,17089,16247,17297,17661,17946,17318,18376,
+19523,18144,18467,19458,20928,23304,19527,20468,
+21274,21212,22227,22501,23295,22632,22675,23878,
+24640,24117,24846,26727,27362,26256,29508,28239,
+25714,24964,25110,24600,22859,22992,23165,23806,
+23312,21997,22198,22275,25143,24754,24172,22555,
+20531,20621,19863,20542,19744,19933,19320,19347,
+17703,17469,16734,17115,17192,17882,19422,19405,
+24069,23219,27527,32154,24570,22944,20202,19059,
+18375,28937,24772,21753,23571,30379,30944,30916,
+31052,31372,32751,33122,33606,34837,33429,33552,
+33204,32923,33157,32608,29421,25301,24938,24925,
+25007,25413,25229,25884,28987,32573,33051,33279,
+33481,34788,32042,33922,33362,33488,33263,33011,
+33250,34789,33702,33216,33016,33353,32754,31772,
+29170,31296,31032,30973,30884,33207,32736,24179,
+23115,22896,22557,22716,21941,21627,22542,23250,
+24078,23328,23244,32934,30732,31830,30900,31461,
+32406,32202,32813,31653,32229,31739,31816,32847,
+33295,33057,36051,37044,39090,31141,32080,34102,
+37060,36207,35065,37176,35267,32601,33030,32973,
+35539,35229,34763,34473,34482,34076,34286,34288,
+34151,34049,34047,34083,34079,33837,34769,34756,
+34839,38697,37412,37906,37452,39876,41415,38644,
+37639,39858,34056,38470,39140,34725,32913,32913,
+32913,32913,32966,32955,34746,38367,38177,36351,
+35640,35983,36212,36399,38010,37479,36969,39391,
+35229,33787,33732,33897,34149,34311,34697,34885,
+34902,34226,34133,34029,34012,34030,34145,34212,
+34021,34106,35262,37997,40111,41817,46255,46392,
+48468,45844,49303,48294,47460,43731,48565,46203,
+48593,48771,45630,49116,46226,45709,40194,40879,
+39735,38382,37578,37555,38628,39204,40122,43404,
+47684,49536,47556,48076,47873,47607,47403,47893,
+47114,46860,47139,46296,46938,48395,46380,44130,
+45313,43034,42665,41260,41118,41076,41020,41011,
+41032,41220,41316,42032,44107,43809,42556,42703,
+42528,42795,42619,40242,42906,40252,39366,39476,
+38561,37457,39075,37861,37626,38553,37540,37558,
+37169,36890,36639,36240,35896,36880,37226,35701,
+36805,36185,37647,35586,33522,33105,33129,33097,
+33072,33059,33138,33702,33423,33189,33174,33024,
+33127,33072,33065,32965,32934,32907,32817,32762,
+32850,32878,32935,32988,33030,33018,33219,33908,
+34127,33820,35161,32880,26991,26795,26745,27238,
+28145,31809,32216,29287,31123,28654,28820,30093,
+32331,33225,33015,39195,34433,36810,36219,33854,
+34062,32763,31932,28328,25423,17305,10972,13978,
+16126,17544,15777,16604,16269,16556,16199,15979,
+15714,15568,15144,14967,15422,16410,15532,15256,
+15444,15375,15624,15812,15832,15843,15803,15716,
+15842,16146,17124,19727,22451,21953,20381,18707,
+18519,17945,18387,18121,19344,19434,20646,17355,
+16896,16055,17221,18445,16979,17728,17024,17937,
+17937,18076,17724,19620,17511,17520,22107,19149,
+16641,16467,16534,17146,17520,17350,22790,21249,
+20379,22614,21763,20606,20205,19846,17766,17224,
+17014,16986,17236,17088,16904,16830,17080,14620,
+18883,18003,18012,17832,18692,18111,17430,17542,
+18459,17490,16575,16296,16116,15502,15295,15330,
+15516,16056,16112,16319,16604,17359,19819,18176,
+13956,14556,14348,16130,16165,16767,15246,15639,
+16333,16152,16734,15800,15418,15587,15369,15983,
+15813,15998,15606,16045,16060,15873,15752,16589,
+16503,16160,16909,16941,17049,16536,16781,15930,
+16946,16693,16720,17304,18207,17673,16917,16890,
+17004,16887,16849,16987,16914,16908,16979,16717,
+16545,16689,16801,16923,17000,17070,17196,17445,
+17602,17880,17888,18182,17928,17454,17742,17547,
+18033,18856,18104,17868,18560,18522,18588,18670,
+18774,18810,19242,19335,19773,20033,20376,20889,
+22172,27236,32463,34271,33687,34204,33065,33238,
+34654,39480,43543,37989,37035,37560,38145,39293,
+37161,37314,37061,36858,37104,36816,38209,38976,
+37670,37471,37026,37515,37284,37209,38679,39738,
+39333,39680,41287,40795,39992,43079,39653,38040,
+38049,37890,37212,36546,36118,35807,35555,35250,
+34947,34853,34569,34313,34128,34066,34188,33915,
+33728,33798,33804,33915,34023,34214,34451,34266,
+34185,33849,33687,33488,33309,33306,33359,33367,
+33429,33458,33444,33586,33661,33738,33902,34037,
+33940,34023,34602,34555,35412,35664,34831,34512,
+33866,33676,33544,33458,33202,33111,33029,32974,
+32992,32913,32837,28405,26107,24637,23919,23006,
+22167,20855,20361,20261,20229,19835,19078,18567,
+18372,18714,18092,18001,18100,18108,17968,17928,
+17861,17862,17827,17828,17761,17700,17814,22490,
+17958,17399,17788,17469,17691,17047,17287,17011,
+16929,17187,16776,16790,16737,16823,16862,16681,
+16722,16692,16683,16653,16941,17205,16773,17052,
+17262,17181,17080,17835,17515,18148,17422,17894,
+19290,17967,19934,20121,20232,20653,19015,20935,
+21393,22351,21407,21426,22428,21935,21618,22693,
+24531,24201,24643,24074,28217,28587,27972,26943,
+28619,29094,25927,26079,27182,27078,24704,24999,
+26744,25375,24936,25967,28386,26697,30999,24673,
+23494,23038,19809,19984,22287,20923,22404,20176,
+17847,18873,20472,18967,19184,18959,18906,19004,
+19117,22884,27009,24609,22995,20148,17804,17627,
+17619,17627,20468,21129,24162,30894,33503,33385,
+34057,33123,33212,33043,33153,33602,34234,34495,
+35000,36729,38282,35685,32772,27361,25371,25087,
+24831,24754,24690,24662,24649,24662,24679,24906,
+24954,24789,25123,24990,25299,26096,26203,26259,
+30743,32061,32959,33066,32960,32483,32196,32036,
+32774,32341,32005,33966,33791,34581,32997,25950,
+24284,24388,23427,23252,22753,22045,23168,22380,
+23499,26016,28426,34430,34788,35865,32781,31335,
+31510,32216,32721,32329,31289,32908,32852,33347,
+34780,35069,35606,36897,35687,33857,35850,36863,
+36720,37329,36001,37245,41646,36051,33345,33123,
+33612,34831,35754,34876,34900,35048,35046,34661,
+34455,34703,35709,35422,34204,35119,36652,38302,
+37530,40500,37679,36759,38381,38962,38132,36413,
+37228,38754,33162,33009,32961,32913,32913,32913,
+32913,32913,32913,32913,32990,33074,33195,37587,
+37554,37880,39034,38952,36579,38697,35306,34042,
+33611,33576,33615,33752,33753,34023,34169,34008,
+33833,33829,33777,33773,33785,33824,33874,33993,
+35080,33966,35026,36351,37285,40887,45445,45364,
+45209,45667,47996,47485,45631,47654,47151,45792,
+44657,40964,41115,40299,39362,37539,37016,36946,
+36858,36851,36946,37131,37176,37096,37218,37940,
+38849,40449,41898,49566,46351,46962,48079,46648,
+46284,47051,45240,45196,44768,47353,46978,44744,
+42500,41424,41373,41076,41017,41012,41421,42465,
+42886,41694,41586,43593,45061,45927,43011,42866,
+42597,43963,43955,44032,43204,42431,41744,39146,
+37767,38448,38752,36786,38484,37740,37701,37710,
+37854,37734,37150,36662,35977,35768,37890,35295,
+35382,37096,37194,37310,33802,33088,33070,33105,
+33040,33021,33066,33081,33016,33010,32922,32878,
+33429,33564,33291,34308,33276,32955,32800,32801,
+32808,32892,32937,32979,32990,33012,33613,33363,
+34076,35983,34248,31836,27145,26506,26238,27707,
+29644,31824,30816,28642,26775,28386,28702,28284,
+32006,33426,32607,30392,32838,33489,35867,35262,
+33907,34705,32647,32016,29109,22902,17268,10995,
+14802,16201,15819,16537,16289,15738,15977,16162,
+15904,15669,15267,14907,15256,15053,14850,15260,
+15291,15802,15692,15672,15981,15796,15651,15693,
+15642,15987,16632,18285,19524,19632,19430,18721,
+18678,18418,18805,18894,20520,20223,20616,18726,
+17144,17598,18992,18783,18284,18843,18126,17558,
+17825,18418,17811,17067,17006,17553,17448,15831,
+15298,16326,16635,16971,16686,17281,19010,20742,
+22730,22426,20966,19809,18869,17882,17146,16795,
+16751,17094,16535,19102,17147,16602,18081,19010,
+16602,17509,16539,17203,17244,17978,16839,17665,
+18600,17492,19920,16784,17390,16077,15336,15015,
+15148,15689,15861,16039,16469,17018,17458,17142,
+16343,17760,17971,17041,16281,17771,17358,17112,
+17177,16660,16944,16205,16965,16556,17269,16349,
+16002,15971,15855,17417,16239,16335,16205,16591,
+16362,16557,16909,16964,16829,16745,17087,15880,
+17391,18405,19710,16520,16977,17655,17103,16661,
+16499,17172,16836,17166,16931,16933,16803,17160,
+17020,16779,16907,16776,17577,17520,17860,17868,
+17862,18152,18390,18017,18414,18069,17927,18011,
+18441,18067,18175,18195,18908,18597,18741,19548,
+18879,19073,19663,19665,20027,20452,20913,21803,
+23016,29965,32890,32889,33551,33017,33196,34734,
+37827,43150,39798,41496,38405,38076,38052,38637,
+37342,37742,37422,38760,37844,38262,41760,40183,
+39411,38118,37293,37617,39156,38731,39955,41189,
+42722,42436,41749,40074,39831,40179,38430,37841,
+37367,36960,36941,36556,36006,35838,35589,35415,
+35175,34971,34771,34520,34353,34271,34279,33947,
+33836,33921,33841,33792,33773,33930,34097,33915,
+34048,34026,33968,33786,33473,33375,33434,33344,
+33350,33365,33496,33668,33603,33714,33797,33833,
+33987,33993,33705,34165,34681,35207,35385,35086,
+34769,35269,33599,33320,33275,33127,33103,32988,
+32997,32937,32893,32704,27723,25731,24531,23515,
+23508,22349,21502,20829,20675,20709,20063,19229,
+18992,18507,18309,18230,18286,18135,18021,17922,
+17903,17844,17821,18462,17763,17663,17400,17502,
+18289,17505,17331,17523,17589,17664,16844,17064,
+17018,16878,16874,16863,16879,16824,16779,16840,
+16771,16833,16727,16676,16743,16838,16982,17151,
+16977,17088,17007,17301,17191,17295,18090,18268,
+18153,19587,20412,19615,18642,18522,19356,19892,
+19119,19894,21771,22907,22250,21821,22467,22464,
+22692,23047,24061,24909,25947,27932,28365,28408,
+28251,28396,28766,28135,29973,30018,30202,25812,
+26691,26168,26327,29512,32300,33242,28233,25128,
+22815,21462,19743,19065,20552,19497,20055,20313,
+18995,18738,18180,19545,17871,17729,18022,18762,
+19161,18578,19619,20672,19403,20050,18147,17636,
+17672,17878,17865,23081,27342,31393,33062,33501,
+33541,33611,33765,33954,33688,33222,33759,33992,
+34777,35559,35757,36410,34380,33441,32880,32034,
+27836,24749,24710,24681,24673,24523,24596,24609,
+24582,24588,24548,24505,24504,24480,24477,24492,
+24813,27895,31716,31261,31697,32712,31749,31564,
+32332,33426,35256,34929,35966,34596,32472,27786,
+27670,27061,26288,23598,24155,23058,23319,22827,
+28092,33684,32685,34863,35403,33946,32724,32556,
+32607,32271,31865,30715,29392,33938,32928,33840,
+35587,35371,35917,35990,35724,38358,38076,36537,
+37063,36019,36086,37623,36077,37696,39238,35469,
+38097,35469,37065,36085,34828,34842,35118,37427,
+35176,35061,35005,34546,37647,37702,40968,40212,
+41352,38192,36851,36795,41085,39023,39328,40188,
+37037,36669,32913,32913,32913,32913,32913,32913,
+32913,32913,32913,32913,33070,33166,33831,34593,
+34885,34806,36613,37750,39767,35103,33541,33468,
+33495,33528,33562,33633,33633,33712,33709,33670,
+33712,33716,33763,34197,34491,35695,34158,34523,
+35466,34221,34769,36324,37699,42816,43806,46120,
+44270,46595,44678,45683,46135,45209,42371,43939,
+44193,39422,37847,37288,36967,36870,36810,36819,
+36724,36704,36788,36796,37026,36954,36841,36877,
+36951,37168,37758,38421,42358,43657,43806,46373,
+46785,46167,47521,45082,44967,44745,42961,41735,
+41518,41256,41010,41116,41298,42001,42985,45363,
+44971,46171,44787,45898,45689,44614,44996,44744,
+44750,44493,43311,43234,41286,38081,38169,37838,
+37890,37335,37340,36882,36624,37002,37448,37169,
+36984,36924,36930,36462,36066,35500,36783,37517,
+37584,35574,36750,35842,33801,33117,33063,33060,
+33093,33054,33036,33007,33045,33025,32913,32718,
+32967,33437,32988,32916,32916,32892,32871,32937,
+32864,32954,32970,32971,32992,33049,33987,33843,
+34990,34899,30891,28812,28308,28416,27445,25976,
+25622,26688,28219,31260,26556,23969,24228,24505,
+30063,32664,32784,30117,32263,32691,33826,34526,
+37176,34425,32961,32169,30592,28371,23049,14558,
+14790,15684,16548,16569,16658,15866,15801,15947,
+15846,15599,15447,15338,15267,15528,15309,15372,
+15360,15507,15537,15543,15416,15594,15690,15813,
+15675,15698,15988,16246,16620,16904,17826,17754,
+18702,18821,19956,20175,20844,23686,20739,19566,
+18026,16899,19156,16871,19311,16876,17257,17376,
+17551,17319,16837,17532,24214,20948,26484,15018,
+15503,16022,16560,16752,16925,17303,19857,21255,
+22227,20850,18954,18589,17647,17232,17092,16851,
+16704,16520,16143,16134,16443,17122,14325,17197,
+15591,16254,16465,16463,16530,17167,17675,18035,
+18754,17529,17925,19362,19225,18243,15808,15544,
+15501,15579,16077,16328,16521,16694,17127,17577,
+23425,18557,17123,17352,17102,16175,16740,17524,
+16069,16014,17124,16585,16728,16959,17447,17380,
+15785,15843,16390,18134,17014,16300,16563,17541,
+16734,16878,16637,17347,16342,19596,17073,17271,
+17050,17860,17951,17915,16895,16904,17649,16564,
+16815,16582,17102,17178,16865,15890,17242,16924,
+16244,15558,17260,17301,17295,17471,18574,17294,
+17664,18431,17774,17893,17962,17957,17889,18003,
+18287,18213,18381,18469,19037,18730,18914,19470,
+18941,19411,19261,19716,20598,21622,21358,21851,
+25840,32645,33235,33455,33034,33085,34143,37436,
+41310,38959,39699,38715,38190,39087,38646,37734,
+37642,37725,38375,39198,38812,37845,38262,38753,
+40707,38813,37633,38774,37265,39165,38451,39681,
+39589,41123,41644,41825,43581,41021,37569,37086,
+36963,36806,36558,36463,36272,35943,35667,35369,
+35035,34914,34713,34512,34324,34371,34273,34137,
+33968,33962,33750,33842,33702,33705,33624,33624,
+33892,33829,33555,33541,33431,33480,33403,33380,
+33418,33502,33525,33573,33420,33694,33714,33805,
+33729,33998,33755,33788,33935,34050,35172,36600,
+35622,34962,35011,33402,33315,33035,33003,32952,
+33014,33009,32930,32877,32457,27205,24824,24004,
+24128,24030,23364,22688,21945,21742,21258,20211,
+19724,19528,18851,18871,19031,18327,18039,17985,
+18026,18251,19541,21534,17586,17910,20996,19332,
+17622,17545,17548,17410,17429,17457,17300,17183,
+16793,16940,16873,16861,16895,16911,16869,16847,
+16869,16797,16785,16732,16747,16794,16839,16941,
+17072,17075,17136,17204,17138,17044,17257,17315,
+17553,17346,18938,18571,18391,18172,19569,19608,
+19819,20636,20544,21329,20640,21262,20343,21243,
+19408,22283,23133,25128,25958,25722,26026,28497,
+27727,28106,28968,29412,26544,30651,29752,27792,
+30744,27970,28834,27841,26093,24449,23537,21901,
+22467,21375,21096,19579,19431,19419,19434,19792,
+18437,18027,18790,19681,17238,16500,17143,16917,
+17233,16415,16822,16013,21017,19686,18868,18399,
+17855,17707,18133,19593,25892,29410,33088,33219,
+33915,33627,34323,34635,34565,34692,34917,34695,
+34256,35019,35682,36544,34065,34592,33153,32622,
+32222,30453,28698,28107,26869,24741,24552,24732,
+24828,24794,24476,24321,24416,24425,24473,24549,
+25092,25901,27733,30623,31686,31454,29915,30090,
+29764,30666,32576,28956,28434,30360,32679,34080,
+33014,29488,27524,25375,24904,22789,22911,24814,
+24183,32883,32862,33214,31414,32067,33990,34365,
+33186,31519,31036,31570,32925,33203,33346,34564,
+34346,34041,34795,35495,36793,35829,36846,36657,
+36275,35960,35904,35883,37068,36915,36230,37218,
+37293,37818,36546,39748,37889,35880,36540,35487,
+35390,35746,35436,37921,39844,40851,39651,39631,
+39800,37296,36771,38349,37539,38015,39855,43378,
+37033,35809,32913,32913,32913,32913,32913,32913,
+32913,32913,32913,32913,33094,33190,33617,33611,
+35401,36017,38571,33741,33414,33306,33351,33378,
+33393,33414,33501,33566,33567,33593,33579,33636,
+33639,33674,33806,34272,35632,38547,37428,34718,
+36290,36111,36707,37074,39479,42156,43773,47443,
+41753,44943,45588,47351,44560,46263,47668,44834,
+42903,38088,36765,36671,36714,36727,36640,36660,
+36632,36581,36578,36552,36531,36618,36582,36587,
+36625,36637,36633,36604,36653,37560,40107,43718,
+43550,47950,48294,44496,42095,41604,42516,41184,
+41106,41114,41358,41238,41199,43120,45483,46077,
+47600,46580,45438,45215,45342,47295,45163,43878,
+42464,42439,41120,39385,38160,37276,37353,37260,
+37170,36993,37258,37675,36341,37005,37434,37136,
+37072,36757,36593,36198,36275,36193,38152,36900,
+37517,36989,36771,34809,33311,33153,33110,33067,
+33067,33033,33021,33026,32914,32976,32883,32758,
+32724,32961,32955,32764,32808,32885,32771,32822,
+32902,32933,33382,33382,33165,33609,33561,34666,
+35461,31666,28278,28455,27202,26373,28226,28295,
+24890,25171,26734,30329,27366,24251,24443,24417,
+24876,29880,29201,27288,30171,31603,32717,34233,
+33550,33513,32885,32319,30942,28786,26027,17375,
+14926,16368,17063,17083,17533,16980,16372,16075,
+15955,15738,15972,15387,16376,16073,15297,15387,
+15497,15498,15775,15767,15516,15374,15462,15721,
+15637,15794,16028,16119,16135,16404,16229,16176,
+17280,17734,18061,20031,21009,20543,21673,19381,
+18453,19262,18168,16706,17159,18884,16905,17001,
+17050,16398,15998,15888,25914,22854,17859,14925,
+15497,15981,16319,16524,16731,17777,20031,20350,
+20979,19222,18130,17475,17077,16437,16629,16563,
+16715,16662,16347,16058,18832,16766,17637,15313,
+14925,15351,15768,15780,16170,16275,16325,16208,
+16517,16824,16808,17273,16928,15991,16144,15664,
+15633,15594,15850,16320,16663,16911,16897,16963,
+17171,18053,17667,16361,17097,16459,16407,16766,
+16874,17045,18501,15924,15397,16914,18045,16713,
+14908,15926,16746,15916,16487,15972,18238,16987,
+17147,16827,16016,16519,17442,17911,17614,17802,
+17931,17466,17049,16823,17196,18251,17457,17151,
+16911,16800,16996,16700,17331,19218,17428,17540,
+17639,17536,17509,17576,17736,18028,18283,18089,
+18120,18367,18886,18728,18704,19032,18993,18861,
+19267,19246,19688,19137,19713,19759,19804,19797,
+20700,19678,19656,20804,20967,22384,22038,23204,
+32401,33911,35199,34370,33026,33224,35209,38221,
+38854,38249,36618,38592,38445,39913,39339,39107,
+38779,38215,40519,39510,39000,37136,38024,40037,
+41293,38352,39089,37048,37227,38549,40501,37845,
+38353,43290,41495,42717,42318,40753,38278,38543,
+37647,37251,36860,36776,36306,35920,35448,35304,
+35109,34776,34688,34425,34220,34177,34299,34332,
+33997,33897,33980,33777,33727,33768,33699,33679,
+33590,33717,33520,33416,33472,33411,33489,33426,
+33410,33408,33534,33572,33557,33571,33616,33741,
+33735,33932,33765,33638,33801,33898,34197,35129,
+36138,35338,34087,34452,33402,33215,33091,32997,
+33030,33023,32947,32877,32844,32755,27527,25225,
+24965,24556,24161,24216,23402,23094,22802,22002,
+20709,20034,19498,19295,19036,18383,17834,18884,
+19266,17526,17925,17700,17622,17736,18279,17426,
+17623,17544,17454,17334,17295,17219,17165,17063,
+17082,17054,16837,17023,17037,16980,16951,16930,
+16934,16859,16704,16841,16695,16779,16935,16967,
+16622,17041,17059,17422,18579,18153,17556,17541,
+17540,17944,18101,17624,17942,17893,18152,20913,
+18799,20199,18186,19574,18743,18393,18960,21333,
+20734,21036,22122,23056,23823,25279,26515,27156,
+29475,27316,28431,29171,27822,28356,29250,32944,
+29647,34746,30124,27099,26205,24204,22983,21945,
+21628,21649,20736,20471,20624,17867,19924,20378,
+17771,17702,17062,16747,18736,17733,17136,17013,
+17055,18558,16963,16486,19716,22938,20495,18221,
+20106,20478,21812,26683,32618,33249,33157,33622,
+33880,33481,33742,33769,34307,34653,34533,34962,
+34956,35345,35964,36314,35603,35235,35198,35970,
+32958,30466,32709,32066,30192,28554,25281,25552,
+26459,25006,24552,24461,24453,24474,24450,25341,
+31493,32644,30774,29408,26688,26442,28887,27264,
+27063,27332,31078,25506,25260,25491,30223,31329,
+33525,30633,28236,27526,24858,24803,28121,28431,
+26094,32995,33993,36624,36662,34452,32955,32952,
+31998,31772,31174,32006,32191,33033,33733,33522,
+34842,34545,35456,35841,36432,36051,36126,35990,
+36306,36378,35676,36480,36603,35932,36282,38343,
+38157,40091,37659,38034,35830,36909,36956,36677,
+36470,39104,38464,36947,39517,37902,38703,40209,
+40068,39328,35851,39860,36316,39398,37924,36882,
+39509,33261,32913,32913,32913,32913,32913,32913,
+32913,32913,32913,32913,33122,33215,33735,34161,
+34134,33381,33183,33193,33259,33276,33310,33357,
+33342,33403,33441,33456,33459,33503,33592,33609,
+33638,33817,33895,34092,34353,37456,40360,37932,
+40848,38001,38094,37614,39855,41415,41865,45912,
+47285,47862,45346,46843,46365,45519,42951,42506,
+37424,36667,36558,36520,36536,36522,36618,36555,
+36818,36493,36435,36402,36381,36435,36459,36450,
+36397,36372,36435,36410,36210,36018,35925,36076,
+40268,42961,43418,43650,42100,42546,42743,43065,
+41160,41582,41439,42882,41793,42318,43344,44517,
+44104,44754,47641,45493,45780,46410,44874,42698,
+38928,38127,38921,39628,37242,37056,36990,36946,
+37126,37002,36973,38400,36351,36576,37155,37066,
+37080,37033,36849,36905,36597,36348,37382,38952,
+38376,35325,36395,38160,34224,33407,33108,33029,
+33076,33018,33012,32892,32905,32958,32712,32610,
+32509,32704,32964,32913,32940,32952,32892,32822,
+32525,32913,33000,33093,34305,34217,35280,34956,
+33005,29095,27729,27438,25983,24198,26823,25155,
+23904,24781,25865,28700,26444,24033,24109,24745,
+25132,25347,27516,27036,31323,32043,31542,33021,
+33243,33660,33047,32721,31151,29064,26887,21141,
+11310,15844,16902,17195,17070,17085,16901,15905,
+15804,15878,16129,16077,16656,16112,15851,15875,
+16044,15799,15929,15789,15777,15695,15474,15661,
+15714,15721,16206,16249,16185,16569,16479,16273,
+16428,16833,17091,18949,19505,19593,18839,18039,
+18720,17115,17498,16363,16824,16173,14883,18718,
+16470,18174,15935,15260,14256,14227,26490,14745,
+14777,15420,15719,16349,16991,17231,20049,19161,
+19134,17752,17186,16962,16576,16699,16271,16434,
+17097,16965,17780,18195,15452,18292,16461,15335,
+14486,15035,15304,15313,15699,16011,16362,16170,
+16478,16510,18311,16602,16069,17457,17677,16979,
+15387,15303,15843,15716,16148,16539,17151,16664,
+16899,17043,17270,16926,16545,16635,18492,17225,
+16503,17244,17438,17972,16758,16752,17191,18026,
+16026,16476,17587,17750,17265,17058,17661,16268,
+16890,16320,17962,16580,16832,17143,17900,17636,
+17696,18783,18450,28116,18621,18705,18181,16916,
+16496,16342,16673,16314,17148,17038,17147,17178,
+17491,17342,17688,17635,17759,18059,18026,18155,
+18728,18389,18775,18835,18638,19101,19175,19089,
+19953,20992,19496,20059,19248,19836,20230,20067,
+20236,19931,20035,20800,21676,23525,24082,28464,
+33127,33897,36014,33105,33141,34104,36741,39372,
+38215,37251,36876,37043,39795,39351,39549,39647,
+39004,38824,40847,41453,39177,37853,37214,38698,
+38294,40968,39105,37719,40452,37563,37243,38042,
+40523,40533,42148,43316,41705,39453,39333,38610,
+38017,37819,37191,36799,36379,36013,35706,35400,
+35133,34921,34730,34335,34193,34194,34148,33894,
+33963,33996,33831,33652,33619,33661,33721,33780,
+33698,33636,33438,33437,33598,33598,33557,33512,
+33517,33547,33639,33764,33652,33849,33609,33722,
+33969,33812,33620,33696,33654,33796,34005,34056,
+34966,35672,34725,33787,33696,33556,33219,32960,
+33053,32978,33016,32937,32875,32829,32712,31260,
+26757,25034,24902,24924,25084,24436,24019,23362,
+22686,20742,19753,19618,19278,18711,18263,18162,
+18156,18250,17948,17871,17796,17518,17871,17618,
+17288,17518,17535,17364,17271,17209,17169,17046,
+17176,17066,17214,17183,17144,17142,16991,17058,
+16912,16964,16953,16829,16676,16831,17049,16908,
+17052,17352,18845,19666,20169,19616,18829,18923,
+18865,18379,18722,18344,17853,18079,18647,18947,
+18543,19678,18523,20184,19447,20238,19407,20539,
+21115,21745,21418,22303,22999,24018,27802,26885,
+28176,28655,27604,27870,28995,27815,28512,28801,
+28602,30318,25924,24747,24105,23083,21926,21749,
+22719,21233,21111,19504,19881,19138,17992,18019,
+18541,17259,18854,18405,17625,17788,17487,17054,
+16634,17576,18616,20808,22407,22285,19813,21750,
+19145,18325,24714,29757,32583,33152,33153,33505,
+33670,34446,33917,34434,33977,34347,34591,34815,
+35278,34945,35175,35206,35076,35281,34269,32992,
+30669,29120,31041,31657,31102,32657,31215,27378,
+27243,26553,24475,24396,24331,24435,24447,29964,
+32673,33759,33066,30487,27618,24704,24505,23791,
+22671,23513,22245,22675,22852,22878,26176,30756,
+34935,34872,31120,27878,24846,29986,30333,28618,
+32976,33496,36353,35608,33453,33161,33616,29973,
+31733,31129,31973,32189,33264,33008,33475,34644,
+34652,37107,35800,36394,36476,36590,35565,36023,
+35670,36385,36467,36762,36585,36276,36317,38539,
+37419,37803,37682,38713,36938,37635,38280,37336,
+36900,39219,37596,38461,37521,37858,39481,40077,
+39270,35945,35409,38397,38831,34620,34578,34792,
+33966,32973,32949,32913,32913,32913,32913,32913,
+32913,32913,32913,32917,32966,33210,33156,33232,
+33143,33141,33172,33213,33231,33283,33431,33375,
+33351,33400,33435,33410,33534,33522,33535,33567,
+33702,33741,33877,34106,34410,35298,38316,40626,
+42606,44751,43872,42944,41999,39893,39482,46102,
+44516,46253,45624,46447,46988,43908,38626,37062,
+36723,36558,36501,36409,36383,36379,36385,36415,
+36370,36326,36334,36297,36221,36238,36278,36273,
+36197,36059,36168,36069,36064,35953,35701,35457,
+35399,35689,35987,37391,39351,40638,40067,40424,
+39675,42428,44471,46989,42603,44635,47243,42928,
+46258,44970,44880,46390,45364,44130,38826,38123,
+37181,38367,37382,38020,38014,37163,37178,37006,
+37010,36931,36597,36867,37941,36326,36865,37057,
+37200,37139,36999,36903,36430,36488,36147,37316,
+37349,36341,36572,37560,36261,35412,34160,33108,
+33028,33046,33012,33042,33009,33044,32904,32512,
+32333,32373,32988,33078,32958,32997,32899,32826,
+32888,32983,32954,33512,33382,34503,33687,32932,
+31629,28965,27338,28657,27120,24416,23921,23553,
+24468,24054,28691,29655,27696,31762,30823,28126,
+25041,25221,26062,25648,27620,30681,30627,31956,
+33771,34801,33455,34458,31731,28406,26706,21433,
+11553,15321,16767,17008,17051,17187,17010,16635,
+16090,15873,16320,17012,17214,16886,16400,16291,
+16025,15606,16098,16263,15864,15798,15884,15780,
+15894,15870,16103,16049,15885,16535,16370,16433,
+16389,16903,16725,17657,18838,18739,18645,18319,
+20033,18150,17483,16497,16960,16499,15966,15870,
+16972,15901,15676,15451,14048,13923,14994,15024,
+15385,15853,16491,17245,18666,18770,19332,17913,
+17286,16632,16803,16533,16629,16680,16594,16828,
+16482,18378,11101,16638,17469,16335,16361,15355,
+15080,14774,15004,15236,15526,15829,15910,16161,
+17681,16325,16169,16400,15948,16093,16123,15829,
+15279,15247,16144,15838,16094,16428,16347,16383,
+16148,16616,16309,16331,16487,16362,16227,16719,
+16909,17137,17412,18084,16971,16834,17452,17211,
+17304,17412,18501,17995,17973,17556,16280,17039,
+15481,17124,17176,17002,16745,16354,17169,17136,
+17682,17871,17628,17002,23212,17361,16412,17520,
+17694,16678,17100,17162,17613,17334,17512,17279,
+17835,18089,17930,17647,17190,17376,18680,18929,
+18925,19106,19010,19052,18711,19365,19181,19522,
+19381,19083,19218,19175,19206,19380,19382,19715,
+19830,19965,20116,20627,22107,23163,28152,28338,
+34669,34333,35311,33249,33567,36289,39338,37577,
+37739,37503,36531,38367,39003,38798,38245,38880,
+38312,39434,38631,40087,37161,37333,37228,37874,
+38824,41043,40488,39266,38355,38919,39827,39719,
+41016,42200,40276,42872,43187,38847,38043,37747,
+37414,37494,36927,36576,36155,35914,35556,35274,
+35088,34640,34631,34607,34393,34317,34159,34150,
+34039,33906,33798,33878,33774,33614,33680,33727,
+33615,33467,33540,33532,33553,33550,33631,33585,
+33597,33627,33765,33651,33798,33970,34042,33746,
+33974,33807,33957,33863,33826,34042,34137,34038,
+35073,35352,34202,33711,33604,33390,33785,33248,
+33217,33087,33044,33043,32933,32874,32789,32699,
+30683,28779,27630,27082,27025,27393,26175,24763,
+24385,23559,22014,21127,20173,19121,18871,18489,
+18305,18086,18045,17935,17856,17802,17727,17673,
+17686,17550,17541,17460,17388,17352,17272,17235,
+17282,17275,17369,17331,17309,17291,16921,17370,
+17018,17055,16980,16757,16618,16417,16784,17761,
+17870,19144,19583,20400,20343,20057,19513,19064,
+19108,18970,18491,18077,18013,18301,18238,18794,
+19025,18435,18584,19557,19836,19930,19728,19375,
+21246,20895,20850,21721,22322,23380,27016,27419,
+27437,27839,27644,27960,27827,28063,27184,27249,
+27225,27612,27345,24280,23594,22992,22431,22975,
+20994,21487,20871,20317,19374,20226,19335,17665,
+20838,17692,18578,17813,21737,18399,17382,21953,
+18029,17006,16874,16901,18267,16960,22623,18846,
+18964,17673,18862,22113,26802,32629,33468,33659,
+33947,33619,33896,34045,34364,34273,34917,35305,
+34986,35115,35492,35516,35703,35568,34425,33092,
+32661,32336,28656,28531,31459,34777,33240,32242,
+30991,25208,24583,24444,24378,24300,24414,27229,
+32687,33840,34557,32502,27429,25889,24518,23182,
+22401,22249,22873,24796,25208,28319,29928,31815,
+33221,31793,29820,29523,32961,31522,29535,34023,
+33982,34623,37527,34621,33402,34117,32523,31700,
+30397,31932,32718,32268,33825,35523,34227,34150,
+34270,35539,36077,36867,35906,36039,35303,35434,
+35515,35946,36812,36048,35199,36728,36246,36600,
+37446,36837,37661,37800,37686,38943,39112,40384,
+37175,40158,41128,39034,40655,38217,38898,38949,
+44390,35361,36948,40219,38709,37180,33590,33070,
+33018,32991,32967,32913,32913,32913,32913,32913,
+32913,32913,32913,32973,33315,34056,33087,33114,
+33159,33201,33190,33197,33240,33338,33437,33566,
+33508,33554,33537,33579,33531,33534,33522,33611,
+33627,33628,33794,34986,34508,34878,35238,36924,
+38274,37947,37883,40531,41953,42139,46579,46308,
+43625,43734,42867,42801,43161,40218,39619,38824,
+36718,36564,36408,36401,36348,36267,36234,36207,
+36255,36189,36183,36165,36119,36074,36093,36023,
+35980,35968,35958,35848,35756,35738,35585,35528,
+35416,35372,35349,35319,35354,35848,36630,36987,
+37194,38015,38198,38022,37896,38445,41146,41460,
+41280,40718,42293,39896,38183,37113,36994,37560,
+37000,37145,36688,37023,37049,37652,36783,37144,
+37096,37103,36832,36132,36418,36214,37448,37188,
+37077,37258,37396,37221,37067,36362,36600,37451,
+37744,37872,35979,36973,35913,38558,36105,34716,
+33091,33049,33011,33012,33057,33077,33027,32831,
+32604,32391,32781,33106,33449,33074,33076,32970,
+32942,33012,33189,33187,33805,35754,33288,32988,
+32430,29748,28551,27885,25659,26470,25251,23706,
+24116,23847,27534,31647,29985,27337,29796,29460,
+27827,26531,25292,25219,25323,27087,28859,32592,
+33327,35245,34455,35379,32394,29907,27064,24239,
+11857,15061,16803,17291,17291,17500,17367,17242,
+16701,16254,16192,16231,16132,16625,16459,16739,
+16185,15928,15777,16053,16146,16408,16337,16202,
+16268,16236,16090,16208,16576,16236,16377,16608,
+16296,16608,16700,16847,17271,17839,18908,18817,
+17319,15903,17049,17173,16314,18702,16299,16197,
+16080,15483,15822,17850,14207,13822,14096,15240,
+15567,15977,17703,20025,19821,19509,18195,17397,
+16452,16524,16442,16133,16947,16052,16266,17324,
+14475,17001,16691,15974,15921,15980,15241,15014,
+14606,14718,14947,15122,15312,15507,15780,15812,
+15870,16134,16215,16391,16208,15897,16272,16055,
+15931,15984,15978,16338,17135,16833,16387,16495,
+16718,16437,16076,15933,16321,16457,16450,16394,
+16908,16948,17116,17097,17280,16902,16688,16883,
+16766,16432,17600,17779,17396,18168,18071,18364,
+18729,18679,17848,17919,18595,18030,18713,19067,
+19946,20942,21204,21801,20827,19658,19861,19499,
+19305,19329,19503,18879,18882,18987,19174,19279,
+19536,19518,19636,19980,19911,20024,19696,19448,
+19941,19893,20318,21384,21197,22140,22344,21472,
+22130,21657,21459,19551,20868,21744,19362,19553,
+19758,20029,19596,20398,24277,28002,30973,34250,
+34122,36810,34392,33369,36396,37197,37728,36610,
+37243,37554,38644,37794,37329,38347,37761,38013,
+38199,39225,38429,38790,36848,36889,37416,37720,
+37103,40551,39069,37953,37484,38112,38195,38568,
+39561,40992,41424,41085,43047,38099,37520,37230,
+36937,37131,36748,36393,36051,35792,35380,35161,
+35043,34984,34854,34688,34436,34337,34198,34186,
+34011,33903,33913,33876,33745,33833,33774,33720,
+33632,33572,33505,33541,33510,33572,33665,33683,
+33590,33598,33748,33847,33774,33896,33942,33858,
+34030,33870,34032,33964,33816,33955,34000,33980,
+33899,34143,35307,33950,34015,33436,33357,33396,
+33394,33390,33063,33128,32871,32887,32841,32818,
+32760,32727,32565,31754,32739,32712,32675,31689,
+29833,26883,25205,23067,21459,20428,19612,18979,
+18929,18828,18561,18212,18170,18171,18106,17925,
+17805,17699,17661,17583,17487,17398,17307,17225,
+17367,17429,17463,17597,17453,17175,17031,17415,
+20566,19825,18222,18693,19059,20294,20935,20978,
+21324,21177,21117,20564,19780,19398,19111,18913,
+18819,18653,18510,17930,17819,18162,18170,18946,
+18700,19051,19134,19770,19476,18934,19771,20033,
+19935,19566,20452,21781,21623,22738,24499,25858,
+26400,26333,26331,27389,27894,28616,26673,26637,
+26744,26462,27809,24136,23613,24294,22782,22315,
+21193,21031,20172,20034,20259,20652,20590,18993,
+18588,17325,17076,20514,17505,18818,16647,18822,
+17057,21900,16854,19045,17242,17076,17083,17223,
+17431,17818,18509,20830,30758,32678,33104,33714,
+35331,34474,35291,34283,36033,37460,34471,34452,
+34842,35183,35457,36626,37433,36249,36278,35366,
+33084,32788,32399,28080,27721,27656,28179,31431,
+28824,24872,24440,24413,24297,24305,24283,27598,
+32555,34343,34869,30728,27356,26752,24399,26007,
+24780,22206,24724,28875,30525,32550,34512,35975,
+33965,32922,30556,32516,33248,31065,30111,34786,
+35990,36478,35339,34788,35028,32817,32949,32913,
+33585,30655,28923,31980,32968,34113,33148,33372,
+33070,33348,33502,34181,34630,35059,36481,36945,
+35424,35989,37050,35628,35457,36252,35636,36279,
+36663,37148,38635,37822,35793,39036,38345,38019,
+38494,39487,41264,39555,38793,39862,38541,36552,
+35821,38783,38625,38890,39228,35032,33173,33004,
+33000,33013,33659,32918,32913,32913,32913,32913,
+32913,32916,33693,33500,33642,33384,33224,33834,
+33653,33243,33220,33286,33325,33383,33441,33444,
+33452,33433,33531,33487,33487,33493,33498,33552,
+33661,33783,33968,34875,35791,35298,36499,33886,
+33957,33999,33854,34079,34128,35436,35523,35346,
+37034,37487,40490,42183,41335,43753,42464,42594,
+41421,38894,37762,38187,38256,38382,36210,36171,
+36110,36055,36033,36039,36000,35898,35877,35842,
+35811,35724,35764,35637,35764,35602,35631,35528,
+35445,35394,35356,35379,35367,35382,35343,35328,
+35803,35645,35701,36063,36342,36254,36593,37077,
+37169,37942,37430,36732,36720,36682,36549,36556,
+36857,36800,36605,36724,36900,37133,37440,37857,
+37402,36958,38046,36405,36131,36190,36732,36572,
+36859,36927,36711,36369,36228,36017,36156,36555,
+37161,38394,36615,36360,37939,36357,36204,35922,
+33328,33080,33745,33543,33520,34234,34318,33765,
+33024,32685,32610,32853,33308,34186,33322,33135,
+33200,33601,33972,34779,33867,35746,36548,35604,
+33231,32670,30312,28770,26160,24038,23591,23256,
+23874,22979,23758,25186,28493,28805,30059,28608,
+25200,25119,26449,24564,24493,24649,25528,32721,
+33252,33409,33826,33333,31987,29333,28968,24309,
+15345,13941,16324,16856,17497,16929,17055,17151,
+16638,16781,17049,16348,16761,17035,16692,16806,
+16297,15898,15873,16296,16110,16308,16189,16224,
+16363,16319,16370,16591,16518,16695,16378,16594,
+16495,16383,16291,16254,16616,17039,17193,19203,
+18321,16558,16497,16648,16836,15983,16091,15990,
+15785,15759,15375,21529,24399,14445,13950,14622,
+15861,17968,18895,19520,19533,18522,17059,16762,
+16101,16074,16264,15778,16343,17100,15369,18339,
+16405,17091,15525,15431,15618,15950,15051,15135,
+14805,14858,15065,15097,15234,15443,15578,15786,
+15688,15730,15927,16080,15801,16083,15644,16014,
+15768,16323,16710,16947,16848,16425,17823,17034,
+16792,16650,16126,16056,16402,16683,16464,17046,
+16957,16792,17569,17469,17379,17094,16817,17163,
+17307,16910,17175,18175,17205,16772,17327,17643,
+17838,17994,18439,18490,18591,18264,18014,18474,
+18569,18030,18462,18777,18782,19106,18789,18882,
+18531,18942,19273,19307,19302,18697,19181,19182,
+19161,19416,20333,20181,20409,20246,20465,20873,
+20571,20506,20434,21127,20905,21109,22190,21316,
+22102,22374,22351,25849,23375,23427,23985,23621,
+24236,25008,23594,23705,23781,24381,28746,32957,
+36394,34916,36146,33975,37752,38220,37949,38913,
+38446,36576,37260,37326,37058,37818,37987,38363,
+37993,39484,38106,38569,36819,36849,36821,36897,
+39261,39702,43295,42828,41957,40123,38416,38801,
+39453,40469,41543,40487,41920,38766,37748,37547,
+37195,36718,36781,36410,36114,35964,35614,35570,
+35163,35105,34837,34698,34493,34377,34116,34120,
+33896,34035,34087,34095,33965,33936,33873,33714,
+33659,33545,33680,33534,33583,33688,33668,33663,
+33594,33702,33605,33612,33762,33744,33752,33732,
+33902,33840,34125,34169,34074,34025,33999,34008,
+34009,34127,34490,34470,34617,33796,33558,34227,
+33697,33336,33499,33180,33081,33017,32970,32880,
+32831,32819,32814,32859,32870,32846,32789,32823,
+32804,32757,32164,25706,23265,21997,20734,19920,
+20010,19662,19419,18814,18747,18671,18501,18200,
+18105,17901,17889,17724,17421,17579,17620,17523,
+17574,17699,17742,17793,17787,17662,17541,17531,
+17355,19007,20528,21546,21488,21482,22196,22248,
+22905,22469,20991,19479,19242,18995,18566,18614,
+18507,18484,18196,18109,18144,18499,18892,19059,
+18911,18642,18825,19271,18903,20004,18550,19192,
+19534,20220,20880,21514,21403,23161,23420,25667,
+26149,26408,25494,25797,27822,25617,25729,25327,
+25714,27295,24804,24366,22850,23078,22012,21274,
+20085,20826,21561,21070,20608,21875,20037,19351,
+19467,17140,17545,17055,16377,17090,16956,19921,
+18020,16995,24531,16771,17010,16958,16999,17100,
+17770,18776,19198,21003,23632,31940,32936,34053,
+34725,34836,35036,35362,35861,35890,36325,36504,
+36014,35316,35986,36687,36891,36967,36964,35483,
+35835,33009,32675,28966,27853,26998,26373,25824,
+25191,24736,24726,24741,24794,24572,24303,24866,
+33429,34368,34617,32895,30714,25854,24591,27316,
+25951,24035,30149,30820,32445,34040,34637,35569,
+33802,34199,34262,33014,32601,30568,32877,33266,
+35634,35434,37242,34541,33013,33178,33830,32966,
+32832,32997,32799,32864,33574,33750,33762,31347,
+31410,31169,31272,32878,33271,33903,35173,35919,
+36587,37011,37455,36199,37038,35743,35965,34641,
+34065,36426,36012,36522,36063,36378,38475,38598,
+36753,40764,38809,36873,37371,40563,38155,37455,
+40034,38225,39689,37745,34126,33287,33138,33967,
+35147,36558,34814,32913,32913,32913,32913,32913,
+32913,32913,32919,32914,32925,33161,33618,33616,
+33291,32922,33161,33240,33333,33369,33379,33360,
+33360,33381,33423,33395,33479,33511,33483,34110,
+33746,33693,33916,34298,34380,33984,33705,33738,
+33801,33779,34072,37791,37143,34227,34087,34216,
+34398,35079,36096,40782,43634,41808,44535,43423,
+43772,44112,42894,42513,42772,39869,38013,36832,
+36110,36074,35958,35914,35886,35853,35834,35815,
+35756,35739,35659,35674,35691,35606,35544,35521,
+35453,35514,35699,35689,35418,35416,35366,36106,
+36744,36285,36550,37359,37000,36969,36678,37003,
+37347,37584,38116,37666,37720,37844,37534,36535,
+36248,36098,36045,36438,36758,37353,37128,36840,
+36976,36851,36520,37099,38079,36135,36120,36130,
+36111,36685,38166,36696,37054,37934,36133,36131,
+37414,37377,37401,37228,36948,35121,36278,35839,
+35526,34971,34007,34918,34968,34846,34393,34392,
+33819,33231,32923,32859,33009,33408,34564,34219,
+34077,33994,33691,34704,35776,36777,36737,38594,
+36726,35879,33306,31639,25469,23673,23377,23430,
+22548,22604,22705,22683,23157,23478,24303,23549,
+23664,23329,23696,22994,22502,23370,23698,27802,
+33452,33545,33013,32631,30522,28512,28944,25352,
+16881,11523,16110,16808,17040,18103,16911,17094,
+16676,18773,17062,16797,17006,16950,16566,16893,
+16681,16415,16277,16049,16112,16083,16563,16369,
+16421,16377,16216,16337,16349,16284,16254,16266,
+16282,16288,16167,16089,16311,16569,17082,17845,
+18056,17122,16902,16215,16185,15927,16065,15245,
+15930,15774,15366,17884,22941,24776,17744,15190,
+17455,18541,18936,19079,17799,16589,15968,16437,
+16243,15963,15582,15926,16452,15696,18731,16233,
+16062,15621,15885,15306,14895,15399,15524,15079,
+14813,15255,14955,14960,15043,15357,15321,15595,
+16072,16080,16306,16260,15766,15990,16305,15876,
+16028,16570,16511,16774,17900,18759,16610,16227,
+16417,16429,16272,16501,16956,16969,16846,17193,
+16866,17177,17849,19008,17282,17133,17024,16944,
+17418,16985,17133,17242,17398,17838,17465,17560,
+17950,18003,17886,17798,17749,17723,17610,17454,
+17688,17855,18327,18718,18687,19300,18834,18824,
+18932,18961,19336,19897,19437,19326,19311,19603,
+19508,19986,19886,20204,20399,20517,20502,20532,
+20676,20766,21177,21557,21855,21442,22040,21969,
+22358,22290,24620,24063,23326,23748,23198,23800,
+26057,25988,23663,23866,23788,23706,29368,32724,
+34886,35579,38651,36139,37077,37083,38613,39152,
+38238,38192,36624,36764,38364,37804,38067,38426,
+38436,38098,39226,37606,36838,36803,36774,36805,
+37965,39452,39743,39192,38964,39504,39841,39087,
+38983,40101,39537,41800,39589,39756,38553,37851,
+37409,37056,36676,36432,35955,35892,35732,35749,
+35313,35118,34853,34600,34459,34462,34218,34153,
+34066,34137,34152,34141,33880,33780,33642,33690,
+33654,33546,33680,33681,33693,33634,33606,33542,
+33635,33582,33636,33756,33806,33774,33659,33661,
+33632,33654,33662,33763,33975,34054,33895,34091,
+34143,34482,34512,34692,34752,33727,33534,33967,
+34628,34476,33954,33899,33321,33311,32981,32905,
+32889,32892,32938,32941,32937,32802,32751,32859,
+32892,32843,32784,32583,25572,24383,22171,22030,
+21515,21159,20899,20232,19524,19125,19033,18624,
+18396,18234,18075,17988,17868,17604,17808,17867,
+18083,18503,18260,18205,17933,18259,17776,17421,
+18420,18990,18928,21647,22603,22068,22599,23217,
+22167,20492,19724,19261,18868,18612,18395,18267,
+17970,18043,17844,17913,18141,18490,18778,18372,
+19104,18792,19113,18850,19444,19983,19710,19296,
+20088,20215,20518,21615,22508,22447,22903,23682,
+24996,25867,25893,24671,26706,26499,26841,25042,
+25224,25235,24804,23194,23934,22473,22398,22134,
+21196,20794,21280,20343,23692,24727,21697,25682,
+18987,18161,17198,17038,17164,16334,16740,17538,
+18921,22588,17186,16962,16967,16978,16979,17979,
+21354,20677,26073,21409,22866,31657,32893,33869,
+34206,35181,35097,35160,35520,35291,35262,35523,
+36004,37080,36229,35507,35496,35547,34458,33555,
+33561,34317,33505,33073,32104,29172,27420,25808,
+25162,25076,25227,25104,25020,24753,24384,24544,
+27295,31956,33035,32467,29190,27803,28626,28344,
+29352,32576,32960,32948,34409,34197,34748,33504,
+33413,32821,32590,30018,29808,31510,32903,33768,
+34315,35364,35619,35253,36519,33489,33078,35931,
+35145,34399,35652,34386,33471,33153,33208,33414,
+33500,33327,32955,32921,32660,31413,32387,34416,
+34197,34456,35210,36249,37563,36958,33724,35692,
+33957,33027,31675,31866,28659,28647,30490,28121,
+28328,32264,35278,34518,36758,38697,38569,39614,
+37481,34985,33860,34872,33947,33755,38238,42222,
+38843,34229,32913,32913,32913,32913,32913,32913,
+32913,32913,32919,32919,32941,33570,33931,33006,
+33477,33545,33167,33144,33216,33240,33301,33328,
+33272,33268,33332,33454,33440,33532,33900,34371,
+33912,34036,34110,33803,33762,33824,33932,33873,
+33815,34003,34206,36132,41307,42447,36929,35450,
+35601,37324,38131,40887,39859,39261,40374,39212,
+40833,44026,45633,44130,45274,40660,37120,36615,
+36352,36372,36105,35893,35869,35922,35860,35802,
+35736,35735,35693,35644,35637,35608,36031,38631,
+37713,36516,36813,37896,36898,36147,35583,35522,
+36486,36815,36323,36563,37038,37961,38487,38718,
+38859,39467,38232,37435,36966,36994,37521,36417,
+36093,36038,35935,36141,36273,36423,36450,36341,
+35585,36123,36231,36117,37439,39037,36354,36090,
+36029,36271,37554,37482,37933,38451,37983,38625,
+38546,38819,37402,37317,37528,37233,38279,37642,
+37190,35044,35272,35239,35184,35025,34462,34274,
+33879,33515,33099,33012,33007,33021,33168,34073,
+34558,35889,34672,34796,34291,35838,36285,37116,
+36035,37969,35947,32873,26441,23608,23001,22879,
+22676,22726,22445,22451,22760,22493,22453,22467,
+22700,23016,22512,22011,22077,25422,25702,29771,
+32532,32810,33070,30906,29448,28164,26859,25536,
+22357,15924,10769,15305,18618,16745,17596,17151,
+17491,17159,17111,17068,17332,17118,17013,17167,
+17412,15378,16728,16590,16278,16116,16326,16157,
+16200,16401,16363,16518,16234,16296,15804,15636,
+16307,15999,15716,16093,16284,16241,19173,19821,
+18327,18507,16854,16751,17183,16317,16208,16502,
+16207,15996,16107,18490,23664,29787,17228,16315,
+17291,17709,18246,16842,16797,16404,16059,15994,
+16392,15755,16037,15428,20505,14785,16414,16194,
+15374,14476,15435,14929,15894,15393,14951,15552,
+15018,14858,15398,15200,14886,15440,15794,15690,
+16000,16011,16767,15600,15930,15893,16351,15313,
+15652,16029,16154,17127,17821,16161,15609,16802,
+17093,16840,16499,16452,16412,16734,16426,17063,
+16865,17154,17181,17718,16696,17028,16752,16924,
+17119,17020,16997,17850,18873,17622,17475,17475,
+17571,17733,17785,18079,18076,18215,17984,17678,
+17692,17891,18273,18683,18936,18958,18924,18927,
+18939,18764,19011,19215,19380,19347,19821,19725,
+20111,20064,20071,20539,20919,20682,21587,20798,
+21105,21784,21557,21839,22014,21964,22128,21557,
+22326,23823,23158,23365,22809,23157,23341,23355,
+23963,24036,25367,23826,24322,23721,30401,32887,
+36224,36720,36953,38430,37332,36989,37710,38703,
+38404,38679,38025,36897,37174,38466,37951,37977,
+39120,39564,38577,38682,39894,37470,36891,37224,
+39282,39098,39579,39228,38717,38936,39294,39063,
+39454,39548,39235,39408,39483,39018,37980,37099,
+37035,36423,36687,36512,36489,36150,35879,35592,
+35301,35174,34983,34903,34592,34533,34230,33990,
+34098,34201,34248,33972,33822,33756,33898,33795,
+33723,33663,33633,33583,33573,33700,33693,33636,
+33569,33528,33612,33676,33729,33869,33915,33694,
+33629,33522,33522,33522,33522,33614,33865,34099,
+34321,34572,34791,34707,34830,34506,34230,34156,
+34176,34353,34209,34108,33495,33890,33115,33336,
+33511,33020,33012,32987,32781,32420,32494,32784,
+32919,32854,32807,32758,32282,26498,25226,24589,
+24047,23480,22625,21897,20555,19848,19702,19158,
+18944,18509,18366,18315,18153,18474,18224,18482,
+19198,18843,18547,18599,18954,17991,17877,19776,
+20492,21117,21617,21399,22326,24054,22824,22368,
+21055,20313,19602,19102,18725,18578,18375,18304,
+18269,18260,18258,18212,18319,18315,18558,18291,
+18959,18591,20218,20011,20381,20745,19731,20401,
+19792,20311,20740,21703,21315,21870,22886,23676,
+24225,24490,25996,25580,26609,27004,25919,26490,
+25959,24987,24128,24477,22771,22359,22443,21615,
+22146,21825,21003,21075,20873,21585,21807,21462,
+22684,19779,17928,17623,18073,16244,16497,17043,
+17605,16976,16781,16994,17031,17023,16961,17961,
+21950,25289,24462,23645,25369,32595,33393,34554,
+35805,34864,35112,35281,35040,35185,35253,35484,
+35550,35961,36363,36240,36567,33880,33967,33863,
+33687,33569,34394,34085,34736,33475,32716,26553,
+25421,25384,25932,25515,25149,24895,24693,24654,
+26198,33051,34251,30348,29809,28116,30515,30096,
+32946,34875,34458,36363,35863,34269,33398,35206,
+32613,32495,30309,29505,29510,32469,32856,33681,
+35503,37214,36186,33699,34928,35728,35598,36909,
+37160,37713,34941,33970,33199,33402,33613,34236,
+32572,32315,28727,27316,27339,27405,27231,27470,
+32598,36143,36381,37051,37215,36348,33162,32828,
+32226,31056,29250,27308,26704,26617,26916,27177,
+27528,28007,29622,32820,37965,38306,37740,38935,
+37799,34490,35628,34915,33747,39651,40800,39075,
+33975,32927,32913,32913,32913,32913,32913,32913,
+32913,32930,32925,32930,33903,33667,33730,33459,
+33471,33396,32979,32960,33165,33195,33217,33246,
+33231,33270,33310,33359,33378,33373,33222,33467,
+33727,33996,33556,33655,33735,33778,33852,33716,
+33821,34331,34998,38278,41078,38488,41952,39440,
+39768,38078,37607,38147,37868,42612,42745,41429,
+44072,41547,43885,43940,45687,44933,44619,41957,
+42777,39366,37653,36721,36496,36657,36018,35861,
+35870,35749,35669,35652,36133,36209,36307,36807,
+37619,36974,35523,36103,36886,36972,36395,36536,
+36427,36514,36544,36545,36834,38049,38433,38804,
+39464,38562,38184,37655,37430,36973,36156,35934,
+35934,35905,35814,35789,35958,36231,36181,36102,
+35812,35888,35992,35891,36381,36808,37614,38062,
+37187,37761,38075,37830,37509,37620,37556,37339,
+37676,37100,37831,37421,37119,37274,37311,37205,
+37727,36499,36234,36126,37179,36198,34577,35352,
+34267,33531,33794,33834,33036,33027,33094,33275,
+34161,34042,34337,34745,35316,34457,35357,37341,
+36664,36323,38450,32759,28795,25616,24817,23679,
+23626,22731,22509,22603,22552,22353,22218,22188,
+22252,22428,22215,22089,22020,23448,26754,28861,
+33398,32891,32414,30624,29706,30576,32681,32094,
+28281,23276,17646,14700,13497,14076,16539,17595,
+17997,16785,17292,17513,17454,17341,17251,17292,
+17064,17042,17139,18588,16654,16520,16409,16417,
+16176,16483,16515,16235,16234,16352,16126,15657,
+16026,15861,15921,16080,16176,16440,16884,17382,
+18450,18551,18209,17070,16978,16307,16637,16826,
+16582,16410,16689,16552,25848,24958,16193,15663,
+16961,17221,19659,16296,16581,16770,16040,15996,
+16275,15901,13304,16512,15561,17391,16690,17682,
+15346,13575,15593,14157,14473,14871,15060,15438,
+14796,15081,15230,16116,15630,14975,15825,16229,
+15953,16434,15667,15774,15877,15483,15738,15850,
+15813,16221,16008,16554,16098,15947,16758,16423,
+16620,16689,17289,16492,16536,17193,16494,16552,
+18777,16218,17386,17668,16544,16599,16940,16809,
+16563,16739,16879,17094,17340,17484,17439,17476,
+17751,17683,17706,18110,17884,18141,18130,18180,
+18105,18042,18459,18890,18653,19208,19193,19233,
+19151,19086,19230,19637,19927,19768,19840,19955,
+19982,21120,20313,20704,20383,20586,20669,20668,
+20440,21045,20771,23093,21312,22021,21982,22380,
+22330,22053,22716,23017,22882,23075,22980,23502,
+23775,25442,25481,25135,24792,23949,31244,34843,
+35097,34754,34815,37716,37122,37734,37592,38516,
+37728,37915,37593,37569,37672,37847,37583,37933,
+37707,37806,37557,38973,38673,37474,37738,37597,
+37680,38620,40501,39177,39271,39232,39587,39385,
+39760,40395,39267,39375,39810,38064,37032,36997,
+37400,36974,36580,36640,36506,36149,35765,35565,
+35355,35240,34897,34720,34599,34517,34351,33988,
+34151,34203,34065,34050,33994,34000,33923,33855,
+33830,33849,33813,33695,33768,33775,33719,33750,
+33528,33528,33528,33600,33857,33855,33903,33909,
+33786,33583,33562,33594,33522,33522,33522,33522,
+33985,34603,34748,34743,34811,34180,34319,34305,
+34328,34701,35222,34533,33186,34458,33361,33612,
+33390,33207,33006,32899,32304,32375,32419,32411,
+32301,32292,32278,32360,32340,32078,28050,27063,
+26790,26283,25620,24940,23177,21561,21605,20672,
+19872,19204,19112,19276,18914,19059,18894,19567,
+19860,19491,18569,18725,18290,18476,19668,21035,
+22575,26913,24148,24086,22417,23428,23348,22398,
+21657,20394,19353,19041,18871,18659,18399,18312,
+18281,18330,18381,18393,18345,18387,18390,18534,
+18858,19360,19900,20925,21432,21471,19782,20667,
+20962,20080,20708,21843,21052,22186,21956,23184,
+23477,24375,24844,25401,25355,25692,26863,25830,
+25215,25055,24093,24344,22783,22332,23190,21701,
+22260,22281,22384,21817,21160,21126,23172,20968,
+20973,20781,19197,18645,19298,17820,18201,17866,
+16957,17285,17058,17049,17031,16995,17092,19380,
+24118,26939,26145,24747,26136,32367,32996,34827,
+34607,36664,37923,36317,35282,35293,35526,35385,
+35692,38109,36627,36003,33798,34314,34436,35507,
+35313,35616,36780,36898,35618,33883,32899,31224,
+27738,26673,26303,25722,25300,25043,24741,24723,
+24896,35291,34283,31508,32474,31035,32659,33186,
+33780,33976,36847,35358,34031,32928,32826,32873,
+32713,32481,30193,29505,30408,32940,33003,35481,
+34639,34791,34931,34719,35914,34736,39180,37476,
+33690,33506,33553,33426,33602,33621,33833,33088,
+32423,30174,26859,26634,26685,26685,26524,26441,
+26415,26473,27379,31183,31303,28541,29206,26358,
+28144,27915,26931,26719,26691,26818,26914,27171,
+27657,28281,29394,33033,33139,33587,34844,35786,
+36910,37959,37083,39796,39474,40067,39290,34699,
+32913,32913,32913,32913,32913,32913,32913,32913,
+32913,33390,33340,33081,33449,33489,33562,33267,
+33136,33146,32991,33412,33163,33179,33203,33214,
+33483,33469,33270,33274,33331,33350,33462,34135,
+34255,34146,33854,33732,33639,33627,33695,33735,
+33624,33897,34351,34980,37155,41828,44494,41865,
+41894,42986,41766,39844,42645,43389,39620,38336,
+39666,37992,37803,38679,43662,44680,43221,45612,
+49438,44343,43398,44100,40908,38154,38787,41781,
+40122,41226,43056,37284,36221,36162,36524,37749,
+35670,37152,36096,35294,35676,35850,36039,35792,
+35140,34884,34875,35060,35456,36169,36762,38061,
+38331,38202,38031,37371,37208,36573,35866,36049,
+35775,35796,35721,36150,36456,36630,36714,36840,
+37084,37437,36582,36153,35487,35661,36300,36875,
+36712,36672,36702,36501,36486,36450,36540,36914,
+36805,36645,37199,36920,37263,36792,37070,37101,
+37261,37054,37536,37441,35568,35058,34399,34867,
+34817,34132,33862,34136,33283,33138,33192,33214,
+33683,34115,34425,34592,34472,35267,35058,35736,
+36290,35630,35272,34788,33139,32304,29076,24809,
+23853,23382,23756,24114,22443,22086,22237,22219,
+21998,22074,22249,22081,21771,22157,23170,32119,
+33161,32746,32544,30989,32027,33235,33582,31852,
+29784,27151,23255,21852,18069,14850,11063,15106,
+16563,17323,17639,17800,17709,17988,17905,17816,
+17466,17387,16799,16805,16821,17069,16639,16523,
+16398,16480,16306,16101,16467,16647,16330,15925,
+16474,15930,16849,16581,16228,16791,18341,17682,
+17862,18421,18595,17766,17527,16867,17266,17646,
+16710,16693,16226,16181,25107,22176,15780,15793,
+15934,20049,18431,17010,16512,16215,16317,15760,
+15408,15333,17040,16425,17325,14710,15240,15254,
+16492,15897,17505,14752,15672,17783,15651,14682,
+14586,13182,14609,16305,15868,15967,16536,17193,
+16721,16363,16512,15854,15167,15555,15723,16047,
+15930,15438,15298,16627,15831,15534,16905,16389,
+16760,16935,16167,16304,16894,16174,16195,17085,
+17477,16890,16648,17424,16594,16249,17844,17559,
+17263,17203,17161,17317,17619,17423,16782,17887,
+17867,17027,17636,17345,17208,17556,17847,18154,
+18268,18702,18324,18558,18931,19174,19833,20040,
+19347,19489,19906,19800,20585,20281,19923,20132,
+20087,20385,20378,20720,20630,20589,20685,20778,
+20754,20878,20987,21227,21348,21781,22116,22513,
+22315,22321,22440,22887,22966,23040,23064,22910,
+24024,24408,24711,25815,24855,23754,30728,34265,
+35697,35793,35016,37990,37346,37686,37110,36876,
+37278,37212,38928,37175,36507,37291,38666,37452,
+35818,35982,36031,36680,36880,36967,37991,37454,
+38568,39562,40872,39931,39388,42423,38991,38331,
+38863,39928,38303,39522,38712,37592,37808,37507,
+37162,36218,36617,36336,36132,35856,35604,35428,
+35012,34940,34650,34308,34531,34195,34023,34084,
+34281,34251,34141,34032,34062,34100,33929,33958,
+34089,33740,33823,33899,33987,33867,33884,33723,
+33528,33528,33528,33528,33651,33738,33783,33839,
+33939,33870,33552,33561,33648,33643,33675,33522,
+33522,33522,33945,34698,34005,33938,33351,34500,
+34441,34428,34587,33962,33208,33839,34172,34012,
+33511,33127,32984,32794,32284,32671,32452,32460,
+32429,32391,32486,32803,32704,32726,32659,32523,
+31021,30317,29630,29514,28578,26112,23987,23777,
+22004,20876,20731,21050,19782,20043,20245,20525,
+21195,19479,19164,19065,19286,20292,22000,23373,
+25810,26596,28718,29586,27618,26791,24441,23143,
+22113,21175,20537,19083,18711,18552,18567,18472,
+18313,18378,18485,18819,18437,18422,18419,18458,
+18378,19729,20073,20952,21668,21300,20565,20880,
+21324,21474,21124,21436,21036,21781,22191,22761,
+23317,23771,23495,24732,26687,25308,25587,25746,
+24972,23892,23158,23574,23363,22843,22502,22887,
+22286,22191,22347,23157,22143,25103,21297,16620,
+21008,20572,20405,21421,18865,18970,18898,18300,
+18528,17367,17037,16985,17109,17021,19354,21720,
+30576,27613,24743,24323,26982,32643,33674,34195,
+34572,36076,35547,36460,36439,36120,36306,36039,
+35754,35475,35015,35262,34714,34972,36068,38781,
+39399,37724,38817,36783,36987,33357,32842,32433,
+31023,30239,27230,26142,25487,25265,24964,25436,
+24889,28689,32636,31378,33085,32748,33636,34355,
+33911,35044,36076,33690,32823,32555,32823,32892,
+32773,32833,32730,32832,34229,35724,37698,36354,
+38186,35023,35625,35436,37322,35910,34665,35207,
+36081,37966,36270,35311,34902,33621,33791,33783,
+32645,29409,26863,26690,26514,26538,26607,26592,
+26508,26264,26400,26418,26431,26489,26544,26457,
+26523,26547,26568,26614,26664,26779,26948,27473,
+29499,30594,32642,33865,39892,36091,38376,42344,
+42165,42498,38763,38537,38178,36987,34791,32929,
+32913,32913,32913,32913,32913,32913,32913,32913,
+32913,33136,33366,33468,32899,33550,33474,33490,
+33444,33369,33559,33648,33495,33208,33176,33173,
+33213,33277,33192,33257,33278,33447,33751,33867,
+33774,33759,33672,33672,33587,33558,33570,33571,
+33570,33665,33905,35044,36778,36184,35418,35845,
+42642,38640,38501,35738,36886,37385,35945,38001,
+41031,43428,40036,37919,37878,38577,39989,39880,
+38373,38532,42477,42994,42659,44088,43279,40595,
+40213,42307,43615,41349,40216,43101,44012,38721,
+33885,32918,32632,32934,34659,34257,33748,34062,
+33317,34119,35140,35387,36429,37933,37554,36973,
+37173,36672,36612,36366,36547,37367,36571,36513,
+36173,36283,36553,36909,37055,36814,36747,37052,
+37589,37279,37417,36593,36271,36138,35976,36064,
+36285,36357,36656,36146,36472,35946,35902,36444,
+36497,36306,36024,36156,36246,36460,36837,36916,
+37071,37134,37195,37410,36720,35683,35155,34536,
+34223,34147,34190,33931,33687,33469,33210,33336,
+33558,33717,34069,34017,33898,34675,34516,34847,
+34661,35736,34023,33517,33251,33060,32997,32736,
+32437,32634,32982,32610,31696,28146,23097,22281,
+22035,21975,21897,22129,21885,22184,23736,25398,
+33294,33674,33924,33045,33486,36075,33404,32427,
+32228,32855,29835,26418,23769,21858,16806,11561,
+9570,13974,16695,17928,18005,18762,17956,18830,
+17651,17247,17296,17109,16721,17289,16826,16782,
+16188,16773,16423,16300,16897,16591,16548,16635,
+16404,16268,16437,16182,16766,15817,15798,16310,
+16652,16836,18028,18315,18716,18540,18581,18665,
+18439,17652,17176,16785,24582,18015,15092,15715,
+17438,18225,17298,16733,16776,17223,15850,14433,
+16982,15834,15986,15716,15508,15594,14928,15363,
+16045,15914,15709,16374,16149,17946,14326,16776,
+15054,12429,18134,15838,20166,15495,17013,17715,
+17286,16980,16428,16214,16362,15817,15715,15738,
+15888,15491,15472,16193,15855,15988,17130,16098,
+16019,16183,15971,16086,16368,16650,16526,16627,
+16606,16800,17005,16501,16850,17706,17392,17207,
+17491,16143,16627,16950,17523,17510,17434,17658,
+17472,18132,17443,17578,17702,17810,17865,18024,
+17899,17799,18551,18891,19054,19620,18645,19689,
+19548,20090,19927,20010,19999,19713,20101,19971,
+19871,20784,20405,20670,20621,20721,20742,20778,
+20812,21072,21216,21393,21613,21714,22043,21972,
+22087,22365,22524,22952,23142,23224,23493,24180,
+23308,23116,24330,23989,23829,25311,31896,33192,
+35091,33886,36042,37087,37746,37872,37008,37233,
+37160,36895,36870,37412,36956,38363,36599,35969,
+36249,38337,38047,37404,37379,37599,37191,37114,
+38868,39870,40176,40446,42533,39288,38085,37452,
+38031,38704,37908,38030,37869,37287,36924,36714,
+36299,36120,35847,36150,35871,35954,35528,35308,
+35123,34800,34500,34334,34140,34257,34227,34229,
+34356,34255,34171,34095,34149,34082,34030,34120,
+34076,33951,33956,33705,33738,33901,33790,33957,
+33528,33528,33528,33558,33764,33813,33694,33579,
+33617,33752,33693,33528,33556,33911,33950,33675,
+33258,33234,33327,33514,33340,33384,33374,33360,
+33426,33703,34687,34017,33577,34074,34489,34321,
+33460,33577,33147,32731,32583,32469,32509,32416,
+32330,32364,32588,32765,32873,32593,32649,32712,
+32593,32590,32718,32706,32718,31848,30480,27957,
+26705,24498,23914,22485,21500,21642,21677,21910,
+22803,20942,20360,19887,21086,22259,23824,26304,
+29214,32459,32691,32830,32838,30663,26159,23760,
+22555,21920,20873,19743,18689,18891,18374,18346,
+18531,18264,18460,18552,18492,18580,18594,18530,
+19161,18948,20278,21207,21577,21654,20733,20628,
+21629,22668,22155,22563,22205,21469,21931,22721,
+22674,23215,24522,24334,25515,25788,25742,26217,
+24822,24406,23658,23537,23256,23553,22817,23271,
+23715,23357,23389,24428,24515,19854,25653,20392,
+20779,20459,20189,22687,21885,21204,20172,18000,
+18268,18654,18072,17339,17219,17178,18305,21261,
+26743,25675,21332,22621,27672,32580,33456,33329,
+34344,34638,35353,35007,34485,35748,36957,34371,
+34809,34223,33469,33593,33876,33727,33636,33896,
+34166,34024,33889,33879,33390,33126,33009,32847,
+32801,32791,32814,33774,33874,32586,26116,25542,
+25283,25591,29401,31938,32667,34098,33611,33804,
+34548,34642,33896,33057,32818,32829,32579,32826,
+32629,32838,34464,33852,36263,38916,36912,36058,
+36081,36047,34400,33834,34546,36060,34118,34215,
+33796,33477,33441,33482,33933,33308,33658,33211,
+32801,32561,28557,27809,28301,27308,27333,27234,
+26844,26609,26432,26300,26430,26446,26457,26481,
+26490,26504,26538,26647,26715,26730,26957,28945,
+32328,36317,38394,40683,41979,42092,39348,35417,
+34098,34676,33729,33711,33672,33155,32961,32913,
+32913,32913,32913,32913,32913,32913,32913,33077,
+33329,33492,33600,33480,32978,33705,33673,33686,
+33738,33477,33324,33135,33337,33156,33159,33159,
+33184,33213,33162,33201,33227,33404,33465,33533,
+33537,33552,33559,33593,33537,33522,33523,33481,
+33605,33931,34317,35631,35139,34283,34366,34493,
+34769,34838,34726,34663,34653,35322,38537,36569,
+35484,35313,39012,39893,39000,37263,37221,42034,
+40427,41009,40018,37072,36197,37067,39885,39616,
+39946,40455,43865,44956,42448,43041,42159,39358,
+38041,36761,37684,38986,37530,35925,36092,35424,
+36309,36937,37716,40787,42201,38250,35778,34794,
+36951,37884,37412,37317,36826,36592,35861,36900,
+38899,39384,38253,38759,37767,37469,37323,38046,
+38302,37176,38002,37337,37214,36654,36201,35685,
+35815,36150,36304,36665,36463,36266,36540,36113,
+36084,36195,35981,36090,36197,36266,36606,36826,
+36945,36830,36841,36162,35421,34774,34509,34314,
+34098,33912,33775,33696,33638,33555,33417,33359,
+33446,33720,34075,34071,34492,34155,34557,35916,
+34797,34457,35157,33967,35302,35363,34134,33016,
+32790,34920,33474,34045,33280,32862,29555,22606,
+21786,22147,22083,22093,23196,23244,26059,23169,
+32079,33030,32685,33059,36599,34851,33840,34074,
+33275,33071,33100,32976,32496,27829,23995,20690,
+13197,7692,12105,14483,16993,18060,18130,17850,
+18155,17435,17313,17491,16527,16836,16660,16694,
+17169,16365,16521,16524,16154,16477,16350,16624,
+16879,16690,16163,16286,15798,16142,15813,15824,
+15820,16038,16454,18543,18733,18579,18270,18504,
+17975,16803,17217,18231,18556,23231,15320,18321,
+17391,17682,19497,16392,16425,15708,14352,18329,
+15721,15303,15823,15485,16056,16641,15420,15933,
+15903,15774,16008,16032,16149,15859,16758,16201,
+15215,14493,15237,16167,14825,15346,15594,16168,
+15400,16184,16407,16516,15797,15899,15911,15664,
+15797,15211,15681,16183,16318,15843,16573,16767,
+16728,16251,16409,16453,16327,16250,16737,17215,
+16596,16773,16684,16560,16659,16904,17847,17550,
+17275,16673,15967,16148,16154,16655,17767,17803,
+16915,17080,16955,17355,17651,17501,17393,17743,
+18012,17668,18033,18404,18723,19080,19086,19410,
+19968,19949,19665,20066,20271,20300,20036,19876,
+20052,20292,20338,20523,20636,20577,20851,20924,
+20973,20974,21244,21511,21604,21984,22218,22129,
+22227,22785,23068,23286,23323,23553,23784,24822,
+25482,24096,24136,23940,23883,27416,31230,32689,
+33756,33631,35055,36744,37081,39259,37389,37652,
+37489,37535,37758,37110,36136,35857,35183,36127,
+38730,39630,39942,40539,39939,39321,37351,37356,
+37771,38609,39447,41495,42240,42733,38472,37147,
+37286,38614,37741,37070,37667,37392,36932,36619,
+38115,36143,35467,35271,35120,35088,34762,34621,
+34406,34460,34479,34245,34251,34423,34391,34458,
+34578,34283,34138,33997,34062,34120,34282,34197,
+34074,33578,34211,33978,33939,33705,33868,33929,
+33566,33528,33528,33678,33878,33933,33705,33618,
+33528,33605,33692,33528,33559,34034,34233,34262,
+33663,33409,33225,33225,33225,33225,33225,33225,
+34602,34245,34937,34698,34016,33439,34242,33693,
+33965,34165,33540,33053,32994,32777,32700,32430,
+32328,32460,32629,32825,33101,33048,32832,32482,
+32273,32694,32394,32627,32784,32869,32853,32840,
+32799,32646,25971,26562,24753,22602,23695,23807,
+22152,22496,21861,22959,22833,25602,27916,31839,
+32719,32763,32800,32820,32824,31996,26673,22979,
+21447,20801,19458,24264,21981,19260,20645,18576,
+21764,18103,18468,18519,18481,18501,18334,18604,
+18707,19462,22177,20121,20745,21263,20853,20922,
+21428,21856,22411,22332,22348,21863,22113,22777,
+23144,23517,23881,24864,24984,26182,25682,26283,
+24942,24493,25048,25050,22891,23016,23428,23293,
+24135,24099,25245,21658,21184,23254,20715,19874,
+18892,19076,19046,20792,22300,21344,21463,21624,
+16644,19774,17905,19897,20545,20198,17736,17921,
+17901,17931,17985,20118,26159,28338,31693,32548,
+33180,32634,32683,32252,32631,32559,31419,25912,
+29346,27522,27267,29854,32141,33136,33206,33330,
+33440,33555,33432,33426,34164,35520,34392,33652,
+33070,33240,33543,33853,36063,36282,33465,31511,
+27388,28272,28459,31794,32796,33081,33492,34244,
+35340,34099,32996,32823,32814,32888,32938,32948,
+34141,35061,35810,35127,37228,35892,34891,35627,
+34338,33816,33708,34659,33861,33664,33405,33163,
+33079,33112,33159,33084,33528,33645,33683,33708,
+33432,32695,32703,32813,32208,29667,28026,27776,
+27411,26781,26940,26796,26554,26460,26513,26559,
+26585,26614,26646,26763,27021,27400,29765,34542,
+37105,39877,37977,36665,38992,37739,35334,33857,
+33508,33363,33295,33198,33039,32979,32945,32913,
+32913,32913,32913,32913,32913,32913,32896,33296,
+33652,33623,33324,33151,33871,33667,33600,33544,
+33477,33421,33339,33320,33459,33147,33151,33135,
+33138,33163,33149,33205,33182,33271,33330,33353,
+33387,33429,33469,33476,33528,33453,33486,34047,
+35037,36825,34315,34002,34146,34056,34159,34240,
+34385,34409,34389,34326,35643,36134,35952,35528,
+34973,35160,34482,34424,34506,34541,34807,34592,
+34714,35121,35351,35222,37026,36786,37771,38846,
+42810,44935,41533,39315,41877,38344,36390,37357,
+43186,43082,37692,36754,38049,37392,37744,38314,
+39225,37802,38734,43131,36470,34721,34240,35179,
+35809,35975,35916,36034,36416,36621,35846,35441,
+36279,37968,36868,37018,37215,38684,39667,38864,
+37231,37408,37464,37783,37803,36870,36501,35745,
+35640,35443,35374,36015,36117,35988,36036,35902,
+35871,35860,36030,36537,36033,36396,36242,36333,
+36209,36633,37386,36947,35255,35202,35262,34233,
+34028,33912,33675,33592,33510,33456,33423,33496,
+33407,33600,33660,33616,33813,33834,34018,34347,
+34208,34282,34890,34531,34484,34331,34335,33363,
+33800,34548,34692,34556,36010,33957,33306,29897,
+26482,23358,22535,22347,22627,22665,25560,26536,
+30731,30680,32378,33514,33747,35136,35542,33483,
+33911,34845,32988,32373,32301,32920,32293,28768,
+22570,18770,13323,8049,12291,13668,16255,17806,
+18198,17874,17656,17043,16959,16942,16690,16947,
+16194,16781,16353,16446,16187,16665,16290,17166,
+16732,16406,16814,15685,15860,15970,15885,15819,
+15663,16022,16014,16218,16907,17655,17683,17352,
+16421,16403,16221,17061,22785,17859,15385,16216,
+16524,18661,17388,17300,15598,15225,14347,16610,
+15743,16113,16186,15804,15740,15715,15844,16501,
+16029,16209,15975,16748,16203,16206,15418,15738,
+15764,16392,16001,15613,15144,15840,14575,16455,
+16164,17219,16189,15747,16041,15451,15687,16126,
+16624,15834,16174,16129,16486,17288,16810,16557,
+16503,16881,16781,16706,16984,17058,17244,16910,
+17067,16872,17032,16958,17005,17058,16978,17008,
+16782,16953,16663,16749,17006,17577,18474,17797,
+17604,17526,17173,17370,17403,17532,17580,17724,
+17883,17877,18038,18345,18372,18615,18944,19166,
+18883,19665,20248,20479,21797,19869,19913,20185,
+19971,20193,20517,20323,20458,20556,20796,21054,
+21119,21153,21457,21381,21441,21786,21742,22308,
+22269,22223,23767,24097,25050,25674,24390,24480,
+24192,24117,24285,24195,24109,25191,32072,32761,
+33828,33261,34540,35251,37923,35802,36855,37728,
+36942,37730,38385,37671,37296,35340,35404,37124,
+39378,39381,40662,39296,40380,40309,39215,37867,
+38505,38803,40815,41072,42054,42401,38058,37309,
+36886,41385,37957,36949,37287,37160,36870,38082,
+38594,35850,35418,35444,35295,34998,34595,34580,
+34707,34639,34674,34192,34337,34623,34476,34695,
+34389,34011,33912,33849,33981,34032,34042,33867,
+33882,33942,33894,33882,33938,33880,33723,33704,
+33671,33528,33528,33590,34033,34125,34067,33860,
+33661,33528,33528,33528,33528,33736,34217,34533,
+33803,33725,33786,33627,33357,33345,33300,33254,
+33381,33839,34494,34675,34792,33243,34367,34032,
+34275,35229,33712,33366,33174,33265,32976,32992,
+32713,32435,32443,32983,33386,33288,33198,32990,
+32677,32561,32371,32581,32660,32676,32846,32586,
+32629,32454,32801,32731,31075,27630,27113,25639,
+24097,24030,24906,25149,27603,28215,32476,32726,
+32782,32790,32797,32857,32865,32465,28140,22779,
+21730,21089,21193,21176,20962,19673,19206,18756,
+18266,18625,18569,18720,18348,18420,18987,18528,
+20022,22911,20673,21072,20356,20506,20728,21261,
+21067,21163,21549,22129,22629,21582,22240,22413,
+22995,23628,24958,24756,25311,24630,26100,25080,
+25425,24774,24315,24666,23439,24816,23120,23268,
+24207,20625,21916,25534,23511,20997,20856,20339,
+19562,17739,19718,18669,19391,21746,21906,19248,
+17113,18543,18095,19954,18082,17999,18014,17977,
+18036,18015,18114,18035,18147,23984,26805,28419,
+19771,22786,21266,18555,18402,20235,22955,23548,
+24384,24956,28902,30366,32535,33001,33225,33365,
+33379,33428,33562,33912,34447,35476,35636,35175,
+33464,33402,34588,36405,36589,39825,38668,38272,
+34636,30568,31632,33826,36084,35748,35219,33486,
+33032,32955,32841,32813,32885,32971,33026,34630,
+36036,36366,36297,34992,36121,35115,34401,34375,
+33629,33613,33524,34011,34459,33219,33516,33348,
+33380,33372,33323,33327,33108,33080,33013,33028,
+33094,32794,32778,32823,32763,32530,31000,29310,
+28513,28098,28428,32599,28231,26911,26737,27541,
+28033,27637,27258,27302,28089,32961,34176,34200,
+35156,34815,35146,34924,34863,34265,33983,33660,
+33580,33388,33230,33083,32945,32928,32913,32913,
+32913,32913,32913,32913,32913,32989,33366,33718,
+33767,33114,33300,33622,33537,33384,33403,33429,
+33471,33452,33429,33468,33528,33120,33120,33120,
+33120,33120,33162,33208,33213,33238,33269,33328,
+33330,33336,33388,33423,33406,33408,33672,35277,
+33849,33715,34101,34020,33960,34060,34046,34091,
+33996,33997,34109,34514,35272,34818,34579,34464,
+34606,34293,34888,36265,36879,36411,36863,35466,
+35367,35283,37182,39104,40490,37562,42366,37786,
+36342,35826,35473,34750,34538,34449,34449,34394,
+34656,34705,34791,35034,35363,35808,36287,37275,
+37655,36804,36327,35290,35018,35212,35937,37089,
+37500,36828,36542,37725,36831,37389,37856,38163,
+38197,37694,36480,36111,36954,37524,36423,36409,
+36847,36958,36840,37359,36794,36684,36390,36462,
+36509,35772,35430,35386,35383,36141,36521,36092,
+36254,36603,36270,36055,36186,36387,36944,36160,
+36175,36829,36294,36493,36838,36653,34812,34587,
+34153,34069,33648,33573,33508,33442,33474,33511,
+33633,33528,33524,33496,33756,33789,33995,35002,
+35994,34473,33818,35163,34587,34229,34190,33531,
+33261,34230,33403,34086,35226,34618,33601,32992,
+32673,29691,25994,24757,28970,23464,29548,29015,
+31195,32292,32515,33194,33650,34652,33382,32941,
+32544,30209,33406,31317,32959,31851,32714,32433,
+31533,25902,20518,16472,10415,6241,11424,13643,
+15861,16539,17829,16863,17279,17266,16966,17009,
+17078,16457,16878,16727,16534,16278,16028,16833,
+17127,16502,16736,15662,15160,15954,16060,15599,
+15824,15822,15819,15755,16128,16385,17064,16188,
+15783,16281,15892,15481,26598,20113,14256,15039,
+15463,16770,16927,15282,15081,13955,16484,16380,
+15554,15743,16101,15925,15945,15836,16055,15701,
+16273,16177,15873,15956,15836,16161,15570,15720,
+15528,15755,15179,15602,15519,14055,14281,15574,
+15958,16881,13431,14457,15669,16045,16347,16163,
+16154,15900,16578,16788,16515,16470,17109,17226,
+16709,17193,16875,16857,17019,17205,17297,17142,
+17340,17225,17222,17168,16906,17155,17613,17196,
+16731,16850,16846,17203,17149,17258,17519,17854,
+16999,16819,17262,17298,17420,17494,17765,17838,
+17916,18000,18079,18238,18425,18716,18956,19177,
+19078,19020,19488,20129,19435,20345,19839,19908,
+19848,20075,20268,20264,20351,20701,20920,20586,
+20738,21005,21113,21164,21366,21761,21975,22092,
+22055,22666,24629,26152,24687,24659,24408,24420,
+24454,24123,24363,24475,24456,27715,31782,32721,
+33533,33175,33555,35732,37175,34650,35776,35018,
+36507,36853,37926,37689,36967,35700,38912,38708,
+38863,38657,39602,39422,39873,40256,38504,40074,
+39447,39096,39968,40788,42086,37695,36987,36801,
+41743,38801,36687,36513,36795,36603,36906,36363,
+35748,35679,35706,35223,34858,34735,34595,34680,
+34563,34468,34226,34170,34657,34563,34757,34075,
+33951,33972,33996,33933,33840,33892,33798,34048,
+33759,33893,34059,34168,34063,34059,33789,33722,
+33531,33528,33528,33528,33834,33920,34135,34139,
+33903,33528,33528,33528,33528,33576,33600,33528,
+33654,33713,33897,33992,33909,33811,33681,33363,
+33343,33314,33487,34456,34532,33087,34040,34353,
+34549,34905,35106,33786,33322,33280,33155,33243,
+33225,33119,32982,32542,32835,33688,33566,33525,
+33297,33086,32997,32749,32619,32714,32686,32439,
+32520,32498,32527,32790,32880,32159,31767,31317,
+29555,26253,27527,30901,32622,32921,32739,32789,
+32796,32787,32835,32837,32901,32750,27506,24049,
+22684,22038,21793,21927,21297,20752,19414,18545,
+18507,18708,18699,18541,18966,18876,21813,21429,
+21278,21576,20559,20050,20615,19339,20218,20448,
+21060,21579,20943,27016,23005,22307,22259,22775,
+23199,23512,23776,23856,24614,25750,25341,25844,
+27426,26206,24318,24198,24159,24099,24538,26184,
+24606,23161,22365,21296,21851,21256,20727,20493,
+20384,19859,19898,19364,18148,20071,20398,22515,
+21122,17617,19526,19041,21279,22698,21842,21972,
+20093,22347,18561,18528,18253,18065,18231,18302,
+18399,18404,18438,18719,18651,19043,19359,20248,
+21410,21573,24672,27863,32686,32965,33168,33228,
+33323,33477,33591,33975,34461,35658,36134,36066,
+35406,33294,34539,36690,38802,38159,35513,33810,
+33613,33717,35751,34886,33379,33109,33048,33008,
+32983,32878,32753,32875,32979,32996,34723,35593,
+35238,34163,34189,33670,34050,33840,33289,33227,
+33198,33214,33275,34621,34844,33736,33574,33978,
+33555,33801,33558,33478,33234,33187,33078,33024,
+33247,33006,32887,32892,32832,32671,32602,32032,
+30661,32299,32594,33389,35270,32436,30704,29891,
+31910,31948,30417,33249,33568,33349,33183,33438,
+33693,33781,33989,33957,34282,34164,33947,33510,
+33554,33153,33066,33010,32952,32927,32919,32913,
+32913,32913,32913,32913,32913,32913,32959,33001,
+33007,32970,32989,33482,33445,33338,33243,33302,
+33368,33490,33543,33588,33120,33120,33120,33120,
+33120,33120,33120,33204,33202,33254,33230,33273,
+33328,33364,33374,33396,33380,33360,33587,33395,
+33426,33490,33534,33618,33707,33788,33807,33933,
+33878,33940,34575,34353,34126,34107,34143,34152,
+34197,34208,34554,34946,35660,39810,40067,43349,
+41213,43464,40454,37183,33957,33606,33600,34029,
+34043,34106,34011,34004,34100,34149,34250,34407,
+34779,34543,34608,34727,34615,35757,35304,35937,
+35564,34662,34905,35467,35817,37372,42675,38406,
+37463,38027,37265,37584,39024,40320,38809,38209,
+38017,38382,38723,39085,37912,37147,36340,36338,
+36339,36537,36714,36591,36595,36479,36134,36221,
+36359,36417,36154,36013,35579,36011,36171,36188,
+36296,36753,37021,36765,36904,36709,36234,35979,
+35715,35850,36216,36189,36429,36130,37241,35417,
+35249,34096,33720,33547,33483,33447,33423,33411,
+33459,33710,33637,33462,33618,33549,33588,33702,
+35289,35247,34856,33828,34597,35047,34347,33846,
+33192,33232,33666,34011,33884,34699,35617,34972,
+33489,32385,28299,26313,25737,28492,28579,30693,
+32724,32376,32646,32879,33510,33076,32652,32534,
+32499,27540,27742,24875,28096,32438,33129,31855,
+32109,32559,29592,23894,19870,15970,12147,8011,
+9363,13652,16544,17388,17916,17865,18378,17836,
+17312,17678,18373,16743,16110,15701,17544,16541,
+17159,16561,16182,16094,17636,15394,15783,15921,
+15561,15305,15285,16035,16206,16222,16137,16065,
+15888,15636,17764,26875,27855,16670,13971,16127,
+15534,15588,16768,16018,14999,18096,16315,15869,
+15891,16198,16224,16128,16016,15591,16011,16081,
+16063,15951,15926,15819,15959,16080,15916,15555,
+15506,15652,15706,15395,15498,14827,15924,16134,
+16495,17219,16419,16246,16343,15724,17067,16480,
+16248,17919,17206,17380,16980,16804,17258,17330,
+17173,17424,17296,17358,17527,17251,17493,17385,
+17416,17400,17430,17286,17227,17596,17352,17606,
+17145,16972,17143,17455,17413,17095,17208,16983,
+17325,17369,17300,17370,17420,17445,17531,17697,
+17936,18057,18120,18456,18585,18741,18717,18970,
+19062,19118,19301,19436,19510,19712,19762,19746,
+19971,20010,20103,20192,20385,20323,20420,20392,
+20774,20841,21072,21074,21127,21812,21873,22373,
+22781,24411,24783,25674,24972,24694,24532,24422,
+24177,24277,24503,24822,24914,27267,30960,32431,
+34722,33256,33226,34458,36361,34596,35302,35574,
+35625,37036,37256,36879,37083,39886,36456,39146,
+39565,39907,38880,39502,38988,40595,38135,39766,
+37761,38971,40075,40553,41108,37938,37417,37255,
+36390,36514,36272,36584,36105,36169,36439,36034,
+35789,35747,35538,35165,35049,35043,34737,34565,
+34761,34529,34207,34188,34626,34701,34096,33888,
+33955,34069,34083,34010,33869,33825,33846,34041,
+33952,34077,34165,34399,34227,34383,34260,33820,
+33596,33528,33528,33528,33528,33680,34043,33755,
+33675,33528,33528,33528,33530,33528,33528,33532,
+33757,33984,34270,34401,33939,33821,33734,33373,
+33291,33212,33276,33128,33111,33089,33393,33857,
+34023,35232,35442,34178,34276,33528,33284,33308,
+33367,33178,33297,33232,32909,32843,32903,32982,
+33199,33167,33603,33440,33214,33000,32672,32644,
+32709,32677,32725,32648,32637,31678,31774,32447,
+32736,32513,32515,32714,32751,32797,32717,32775,
+32800,32822,32795,32797,32808,32796,32081,27822,
+25266,23892,23052,22585,22408,20553,19236,19083,
+18808,18774,18816,18846,18951,18603,19166,19477,
+21968,22116,19521,19548,20122,19965,19460,20187,
+20502,20686,20147,20319,21834,22154,21368,22519,
+23064,23112,23874,23608,24663,23922,25248,27437,
+27228,25040,24546,24332,24169,23618,24099,24078,
+23258,22812,22163,22104,21137,21588,21471,19451,
+20986,20074,19008,19428,19990,20741,21615,19630,
+19274,19563,20650,18527,18194,18570,18997,19379,
+18735,20981,21815,21702,20133,18299,18350,18309,
+18357,18583,18422,18509,18705,19208,19406,20076,
+21050,30226,32968,32775,32728,32985,32991,33250,
+33321,33528,33661,34059,34567,36444,35510,35989,
+35334,33888,34773,34513,37571,37872,38037,33674,
+33445,33316,33236,33156,33128,33098,33051,33032,
+32991,32849,32729,33796,33225,35875,34041,33655,
+34141,33311,33332,33402,33340,33254,33313,33258,
+33348,33210,33237,33738,34827,37489,35860,36114,
+35005,35071,35907,35401,34151,33438,33088,33031,
+33488,33012,33044,32983,32971,32880,32832,32805,
+32706,32831,33075,33104,33258,33234,33046,33243,
+33130,33051,33027,33023,33042,33073,33126,33198,
+33300,33443,33665,33851,33936,33489,33933,33786,
+33425,33269,33072,32997,32957,32916,32924,32913,
+32913,32913,32913,32913,32913,32913,32913,32967,
+32958,32916,32913,32913,32889,32898,33050,33164,
+33219,33304,33370,33375,33495,33120,33120,33120,
+33120,33120,33120,33180,33207,33243,33275,33313,
+33323,33333,33359,33382,33380,33372,33388,33470,
+33486,33666,33689,33697,33774,33845,34140,34044,
+34164,34522,34547,34132,34035,34083,34071,34146,
+34154,34128,34170,34252,34755,35362,36441,38082,
+39136,43730,42237,38689,38567,35058,37908,35458,
+34499,33876,33903,33980,33971,34248,34473,34786,
+35169,35199,36435,36936,36743,41058,38165,37102,
+37635,37773,37722,38213,40103,36561,38212,37719,
+37607,40788,41100,41187,39401,41489,39048,37176,
+36869,36921,37005,37223,37368,37044,37066,37115,
+36727,37529,37053,36849,36621,36888,36294,36204,
+36546,36324,35985,35919,35469,35472,35618,36078,
+36261,36310,36338,36721,37246,37342,36955,36153,
+35478,35913,35580,35782,35658,35836,35938,36364,
+35326,34927,33973,33625,33492,33423,33426,33410,
+33333,33429,33411,33408,33462,33476,34004,33765,
+33549,33621,35960,34522,33877,33902,33528,33477,
+33192,33192,33213,33891,33759,34807,34922,35130,
+35097,33640,32481,28481,27294,27099,28249,30003,
+31374,31655,33255,33112,33007,32711,32598,32428,
+30178,29703,24674,23882,24174,23908,24621,32001,
+33264,32409,31404,32342,31017,26563,20216,16863,
+11884,5211,10955,15172,17622,18336,17862,18232,
+19320,18160,17982,18515,19110,18293,17192,16978,
+16388,15957,15579,15861,15660,15895,15165,14514,
+15987,15059,15196,15625,15567,16082,15834,15712,
+15923,15297,14741,15980,24930,17742,15076,15024,
+16083,16287,15851,16206,11735,15785,16034,15654,
+16037,15964,16176,16338,16243,15818,15654,15924,
+16645,16159,16188,16076,16101,16144,16017,16097,
+15825,15628,15456,15587,15618,16371,15392,16222,
+15617,16392,16930,16044,16032,16488,16464,16190,
+16209,16724,16336,16867,17178,16824,17334,17406,
+17199,17631,17735,17697,18078,17734,17763,17390,
+17279,17217,17604,17353,17229,17350,17344,17361,
+17323,17607,17454,17300,17295,17308,17307,17442,
+17444,17439,17098,17352,17345,17636,17712,17758,
+17988,18237,18696,18681,18579,18639,18823,18990,
+19124,19221,19314,19401,19545,19668,19746,19717,
+19891,19981,19989,20146,20180,20203,20183,20386,
+20590,20551,21087,21189,21198,21848,21723,23039,
+23580,24744,25074,25071,25629,24881,24667,24568,
+24435,24510,24681,25063,25893,27550,31428,32577,
+33873,33919,33104,35586,34505,33918,34487,33483,
+33536,33559,34428,35982,36631,36865,35184,36002,
+38343,38225,38110,38908,39743,39968,38070,37200,
+37475,37140,39273,36976,36735,36991,36100,36333,
+35859,36100,36090,35815,35937,35847,36309,36254,
+35933,35658,35501,35107,34986,34780,34797,34749,
+34650,34777,34332,34172,34223,34726,33955,33965,
+34128,34251,34175,33984,34015,33906,33827,33924,
+34191,34131,34316,34433,34419,34509,34428,34170,
+33881,33650,33528,33528,33528,33528,33646,33528,
+33528,33528,33528,33606,33659,33528,33528,33688,
+33945,34311,34335,34468,33794,33555,33358,33840,
+33739,33740,33682,33690,33195,33066,33228,33414,
+33817,34247,34136,34611,33954,34140,33479,33525,
+33444,33443,33240,33256,33262,33849,33062,33096,
+33139,33005,33019,32872,32983,33373,32990,33011,
+32649,32544,32331,32307,31648,31683,32127,32809,
+32846,32532,32808,32697,32655,32764,32732,32766,
+32742,32771,32796,32758,32797,32820,32754,32572,
+29538,26293,27278,26637,23009,21729,20168,19280,
+18984,18795,19008,18834,18861,19405,19243,19253,
+19885,19248,19563,19446,19943,19644,19521,19776,
+20232,20313,20684,21147,20695,21486,21752,21762,
+22990,23340,22525,23471,23288,25439,24157,26233,
+23364,24770,24882,24486,24320,23837,23708,23985,
+22641,22431,21997,21491,21756,20249,19575,20013,
+19323,18872,19594,19827,19905,18659,19599,20210,
+18887,18828,18967,18558,18546,18843,18336,18540,
+18528,18432,18582,18515,18465,18416,18384,18418,
+18418,18504,18548,18727,18712,19025,20293,23076,
+29498,32861,32670,32695,32820,32986,33131,33068,
+33372,33942,33970,34640,35508,35584,34217,36604,
+34160,33769,34074,33886,35453,39702,36194,38132,
+34407,33984,33854,34068,35055,33652,34773,33286,
+33095,33007,33002,34027,35340,34749,34852,33603,
+33310,33447,33594,33303,33279,33248,33255,33298,
+33235,33211,33276,33304,34258,34826,35228,36404,
+34319,34617,34892,34539,36102,34985,33110,33394,
+33388,33299,33159,33048,32883,32894,32889,32859,
+32909,32891,33047,33055,33071,32998,32975,32925,
+32946,32961,32953,32989,33072,33036,33148,33164,
+33237,33235,33348,33359,33408,33440,33277,33273,
+33208,33420,33062,32967,32931,32947,32931,32925,
+32914,32913,32913,32913,32913,32913,32913,32913,
+32913,32913,32921,32907,32897,32976,33074,33411,
+33290,33241,33287,33245,33416,33120,33120,33120,
+33120,33120,33175,33168,33191,33227,33333,33265,
+33278,33302,33395,33374,33205,33484,33490,33748,
+33790,33822,33753,33886,33933,34119,34273,34133,
+34329,34510,34244,33993,34029,34101,34033,34085,
+34116,34060,34092,34473,34131,34243,34388,34530,
+34795,36396,38229,36732,34972,40452,38057,38311,
+36729,35688,33789,33734,33810,34231,34458,34882,
+35414,35557,35769,36320,36778,36441,36149,36222,
+37243,37654,38392,39723,41510,39825,40761,41118,
+40188,40626,36872,38121,37636,37250,37173,37088,
+37581,37880,38594,38498,38442,37827,37436,37315,
+37209,37341,37074,37077,37144,36956,37166,36785,
+36602,36621,36281,35926,35975,36463,36064,35733,
+36532,35701,36546,36584,36616,36714,36844,35955,
+35474,36254,36096,35853,35523,35625,35692,36199,
+35150,35145,34370,33955,33704,33467,33392,33375,
+33387,33394,33458,33486,33333,33459,33549,33580,
+33891,33366,34052,34302,34862,33620,33663,33447,
+33478,33249,33188,33549,33785,33609,33885,34864,
+35346,34216,34892,32972,29078,27832,27566,29217,
+31167,30835,32643,32745,32918,32704,32662,32335,
+30390,24040,23035,23421,23442,23335,23407,23784,
+29016,29367,29176,33608,30659,30150,29680,29055,
+23076,15954,8363,9292,14731,17942,18187,18454,
+18565,18982,18279,18108,18121,18033,17669,16890,
+16446,16146,16032,15508,15920,15968,15812,16383,
+16168,15122,14610,14423,16067,15538,15525,15273,
+14749,13844,18158,19905,19353,15323,15014,15695,
+16466,16419,15918,14568,15753,16615,16554,15979,
+15531,15790,16210,16107,16453,16431,15756,16115,
+16011,16360,16760,16246,16058,16098,16572,16355,
+15892,16078,15747,15925,15561,16009,15632,16903,
+16601,16988,16082,16238,16281,16138,16184,16317,
+16283,16745,16593,17097,16861,16899,17387,17255,
+17615,17721,17970,18228,18845,18194,17833,17844,
+18011,17327,17760,17597,17412,17529,17553,17471,
+17355,17292,17362,17228,17152,17419,17283,17196,
+17248,16971,17459,17469,17638,17850,17873,17856,
+17952,18240,18492,18675,18623,18627,18776,18889,
+19089,19232,19379,19465,19622,19699,19797,19869,
+19987,20108,20145,20568,20961,20250,20298,20345,
+20594,20767,21422,21204,22282,21609,23812,22473,
+23389,24557,23961,26901,26547,24957,24804,24606,
+24705,24691,24786,24941,25332,27772,30657,32713,
+32760,33790,34089,36497,36760,36176,36024,33873,
+33630,33347,33864,34347,36667,35772,36748,35919,
+36560,38597,37264,37547,39662,39515,37575,38883,
+38484,38555,38076,38832,37079,36615,36326,36395,
+35796,35713,35563,35532,35365,35410,35643,35862,
+35764,35643,35403,35273,35113,34873,34629,34612,
+34998,34860,34463,34236,34226,33967,33888,33983,
+34228,34320,34176,34104,34122,34195,34100,34062,
+34016,34262,34338,34559,34543,34597,34426,34411,
+34232,34037,33771,33659,33634,33770,33634,33542,
+33528,33605,33770,33725,33699,33702,33701,33571,
+33564,33750,33925,33824,33772,33841,33913,33696,
+34089,33948,33945,34470,33852,33408,33003,33279,
+33537,34133,33900,34387,34468,33977,33698,33789,
+33318,33573,33465,33454,33288,33264,33166,32957,
+32960,33063,33162,32937,32832,33529,33776,33019,
+32860,32724,32070,31740,31608,32241,32830,32803,
+32695,32562,32578,32625,32536,32565,32547,32775,
+32739,32699,32770,32749,32780,32802,32793,32695,
+32531,31247,29276,30419,30216,25820,24722,21903,
+20589,19839,19918,19744,19668,19521,19239,19415,
+19142,19335,19203,19591,19322,19678,19852,19917,
+20114,20202,20355,20462,20618,20766,21208,21504,
+22096,22584,22477,22616,23281,23580,23598,24819,
+27206,25763,26889,23463,23824,24039,23817,23335,
+22464,22958,21123,20882,20394,19596,19012,18548,
+19321,19881,20592,21506,20919,18703,19366,19725,
+20697,19635,20976,19314,18874,18974,20898,20673,
+18747,18582,18619,18710,18700,18597,18548,18613,
+18743,18721,18768,18926,19385,19730,27522,29618,
+32706,32573,32713,32872,32892,32921,33040,33294,
+33405,33531,33907,34418,34202,34518,33819,34301,
+34098,33565,33755,35795,34435,37403,35737,40912,
+37458,36745,38009,39832,37679,39129,35919,38758,
+35760,34699,34343,36908,34697,35549,33833,34169,
+33695,33338,33405,33697,33793,33241,33358,33334,
+33240,33265,33323,33873,33963,34373,36382,33986,
+34029,34172,34746,36801,36294,33722,33678,33557,
+33491,33223,33465,33255,32985,32914,32870,32997,
+33011,33084,33020,33027,33035,33036,32967,32835,
+32904,32922,32907,32847,32900,33094,33120,33173,
+33189,33342,33279,33123,33198,33049,33095,33198,
+33468,33268,32991,32973,32976,32951,32964,32936,
+32960,32931,32916,32913,32913,32913,32913,32913,
+32913,32913,32910,32907,32962,32955,33003,33200,
+33447,33422,33491,33434,33474,33397,33329,33120,
+33147,33125,33169,33234,33192,33261,33264,33315,
+33485,33642,33624,33254,33337,33627,33624,33627,
+33651,33597,33732,34034,34158,34204,34246,34530,
+34593,34519,34295,34023,33993,33993,34053,34017,
+34060,34059,34029,34046,34125,34110,34563,34467,
+34383,34159,34048,34008,34350,35063,34591,35221,
+35649,34956,34456,34752,34432,34413,34872,34728,
+35271,35581,35631,35679,37247,36851,37388,38657,
+39977,40601,42295,40299,37894,36369,35989,36803,
+40986,39699,39086,38690,38791,39521,38034,39239,
+39442,39012,40464,40484,39739,38415,37862,37577,
+37754,37373,37371,37168,37284,36731,37136,37029,
+36673,37354,37103,36432,36483,36406,36402,36399,
+35895,36348,36336,36579,36377,35781,35783,35757,
+35632,35787,35685,35589,35853,35765,35947,36114,
+35481,35248,34942,34195,34086,33565,33403,33391,
+33390,33384,33449,33418,33426,33472,33462,33374,
+33807,33695,33364,33511,33348,33588,33887,34287,
+33306,33347,33237,33228,33676,33669,34616,35674,
+35786,36009,35355,34120,32452,29340,28075,28185,
+28453,30819,32995,32609,32845,32811,32234,32579,
+25715,23418,23289,23303,23145,23116,23141,23201,
+23009,23583,23004,25133,32138,31865,24874,22332,
+23337,23652,17738,14122,9585,15723,17521,18409,
+18182,18399,18610,18796,18587,17767,17590,17505,
+17021,16505,16421,16118,16056,16086,15937,15966,
+15449,15246,15039,15484,15471,15474,15199,14830,
+14304,14243,23226,22772,13887,14939,14985,15711,
+15355,14946,15172,16659,15291,15659,16197,16278,
+16268,15886,16245,16385,16312,16169,15686,16764,
+17171,15514,15708,15851,15811,15429,16218,16464,
+15826,15531,17174,15630,16081,16644,16422,17073,
+16224,16181,16634,16440,16313,16302,16315,16329,
+16489,16566,16616,16797,16681,17052,17377,17406,
+17766,17707,17901,18024,18009,18117,17994,17912,
+17556,18345,17931,17565,17463,17635,17912,17643,
+17197,17354,17078,17661,17256,17337,17502,17555,
+16681,16692,17784,17515,17826,17952,18024,17970,
+18123,18169,18325,18464,18552,18596,18678,18959,
+19248,19399,19487,19574,19648,19848,19875,19964,
+20105,20205,20282,20351,20409,20406,20395,20508,
+20919,20835,21724,20887,21362,21696,22662,23204,
+23054,28875,32488,24764,24976,25134,24679,24718,
+24865,24873,25048,25112,27084,29292,30299,32838,
+33266,33390,33786,34725,36630,37759,34740,35238,
+33669,33971,34164,34160,34529,35349,35430,35691,
+36417,37176,38464,37393,37213,37496,37679,37532,
+37240,37310,38958,39921,37167,39377,36710,35870,
+35778,35595,35634,35630,35555,35347,35276,35691,
+35502,35480,35344,35060,35064,34803,34551,34622,
+34725,34752,34371,34341,34178,33873,33862,34251,
+34285,34356,34290,34245,34212,34073,34207,34152,
+33555,34026,33549,33549,34224,33804,33808,34559,
+34098,33549,33549,33549,33549,33662,33549,33756,
+34247,34310,34329,34428,34341,34200,33804,33915,
+33896,34012,34008,34071,34050,34001,34167,33875,
+33899,33943,34411,34600,34363,34296,33690,33426,
+33265,33153,33826,34606,34019,33956,33933,33604,
+33541,34170,34193,33411,33207,33159,32992,33111,
+32923,32859,32829,32787,32787,32751,34302,32774,
+32678,31745,31745,31621,31976,32624,32709,32948,
+32696,32688,32335,32817,32725,33130,32533,32626,
+32618,32744,32673,32741,32784,32773,32765,32676,
+32586,31927,29634,31884,32183,32337,32562,32141,
+27445,23076,22518,20722,20136,19398,19445,19389,
+19152,19233,19192,19311,19195,19383,19732,19921,
+19857,19973,20049,20367,19695,21427,21218,21117,
+22602,22522,22833,23082,22772,23073,24129,22932,
+25287,23466,25426,23850,24013,23644,22744,22811,
+21513,21964,21925,21230,19506,19013,19291,20064,
+19521,19068,18852,19306,19199,18903,19288,19410,
+18364,18645,18585,18519,18409,19205,20128,18449,
+18562,18657,18602,18779,18767,19338,21747,19050,
+19306,19332,19573,19875,22649,30183,32491,32535,
+32639,32685,32799,32980,33116,33295,33557,33421,
+33300,33385,33325,33510,33552,33675,33738,33727,
+34017,33586,33594,34568,36191,35153,36203,37636,
+37426,40425,39344,38504,39819,40578,38919,37293,
+38008,38629,35300,36802,34834,34860,34086,33738,
+33822,33668,33252,33597,33495,33580,33268,33315,
+33252,33274,33266,33285,33611,37031,35388,34171,
+34166,34270,36669,36806,36024,33990,33951,33489,
+33369,33697,33438,33051,33380,33242,33168,33180,
+33135,33039,33041,33114,33062,33086,33094,33122,
+33109,32985,32818,32974,32980,33135,33135,33145,
+33258,33308,33252,33099,33385,33495,33518,33410,
+33384,33048,32990,32997,32997,32984,32967,32958,
+32949,32952,32923,32915,32929,32913,32913,32911,
+32908,32910,32921,32926,32951,33015,33116,33197,
+33204,33160,33182,33523,33464,33348,33393,33450,
+33297,33120,33237,33181,33186,33231,33240,33420,
+33368,33235,33516,33636,33702,33858,33873,33814,
+33854,33921,34060,34224,34379,34633,34389,34740,
+34655,34599,34418,34275,34103,33993,34031,33975,
+33975,34070,34202,34158,34086,33990,34098,34094,
+34056,34077,34089,34306,34665,34501,34885,35215,
+35710,38864,37518,36523,36612,35523,34449,34767,
+35234,35277,35577,36176,37347,40767,39357,43186,
+41646,39040,38736,39303,37849,36928,38552,41313,
+39043,38210,39495,40486,40332,39981,39239,39506,
+39643,40833,40821,39413,39788,38580,38125,38581,
+38040,37488,37587,36987,37223,37336,37179,36844,
+36918,36975,36703,36939,36693,36915,36609,36681,
+36040,36006,36160,35752,35735,35431,35374,35167,
+35187,35230,35339,35532,35861,35697,36063,36582,
+35822,35134,35094,34356,33852,33661,33418,33400,
+33395,33387,33445,33564,33426,33474,33551,33616,
+34062,34257,34570,33422,33312,33461,33303,33192,
+33156,33157,33547,34034,33396,33318,34274,33797,
+34470,35308,35178,35738,33825,31275,30637,30133,
+28929,29981,31305,32508,33519,33114,32993,32187,
+25092,24293,23409,23325,23167,23070,23043,23005,
+22987,22686,22889,23280,23502,32705,23646,30753,
+29315,27315,25260,20898,16157,13092,14660,17586,
+18487,19009,19415,18636,18441,17834,17715,17148,
+17148,16938,16709,16353,15829,16060,15712,15895,
+15545,15855,15640,15512,15368,15285,15049,14608,
+14123,13436,24998,22356,13467,14298,14917,14946,
+14726,16623,15734,16083,15012,15777,17057,16705,
+16201,15897,15705,16094,16842,16332,16035,16407,
+16129,16218,16368,15853,16126,15712,16057,15846,
+15710,16344,16484,16331,16151,16538,16494,16719,
+16344,15925,16452,16312,16546,16415,16582,16974,
+16950,16893,16792,16964,17139,17190,16839,18538,
+17900,17811,17780,17779,18537,18251,18107,17779,
+17911,17938,18024,18922,17534,17733,17783,17791,
+17664,17428,17420,17378,17396,17402,17550,17270,
+17491,17675,18216,18348,17872,17723,17963,18164,
+18300,18417,18375,18397,18570,18658,18820,18973,
+19134,19283,19462,19616,19659,19815,20026,20046,
+20153,20320,20448,20510,20594,20597,20727,20511,
+20607,20753,20682,21063,21707,22244,23199,23381,
+23670,23966,24253,24359,24735,25911,24972,24906,
+24846,25007,25395,25539,27837,28494,31904,32722,
+33444,33327,33057,33267,35046,35367,35846,36550,
+34190,34162,34599,34752,35088,35271,35910,35996,
+36800,37296,38334,36165,39043,39484,39481,36822,
+36168,37008,37287,36708,36269,37773,35958,35523,
+35638,35670,35508,35361,35535,35652,35133,35241,
+35123,35454,35081,35021,34769,34660,34795,34869,
+34676,34762,34359,34303,34134,33915,33796,34019,
+34376,34407,34239,34180,34167,34205,34212,34326,
+34539,33549,33549,33549,33549,33549,33549,33673,
+33549,33549,33549,33549,33549,33549,33549,34412,
+34483,34539,34413,34329,34327,34182,34224,33915,
+34099,33902,34068,34101,34103,34082,34189,34274,
+34260,34218,34209,34436,34287,34330,34059,33947,
+34820,35255,34638,32750,34320,33839,33763,33625,
+33811,33903,34719,34073,33401,33184,32919,32881,
+32835,32784,32796,32912,32992,32871,32784,32433,
+31632,31658,31793,32292,32529,32380,31979,32693,
+32177,33221,32966,32403,33384,33372,32925,32544,
+32493,32585,32675,32682,32749,32730,32673,32558,
+32425,31841,29520,31788,32115,32379,32506,32223,
+31182,24318,22345,21149,19736,19829,19347,19266,
+19489,19135,19252,19179,19393,19695,19785,20179,
+19906,19951,20624,20940,20259,21099,21309,20820,
+21846,21690,21803,22575,24110,23196,24143,24377,
+25956,23643,25499,24754,24771,24108,23716,22746,
+22557,22447,20861,20406,20293,20194,19445,19470,
+19440,19295,19194,20026,20110,19261,18636,18594,
+18541,18604,18438,18543,18665,18862,18996,18846,
+18765,18945,19118,19436,19662,19553,19934,24411,
+20564,22842,24202,28287,30445,32532,32628,32662,
+32679,32806,32893,32992,33046,33258,33285,33277,
+33181,33287,33435,33383,33492,33594,33864,33963,
+34502,34459,33596,33793,34583,35515,36184,34369,
+34755,34357,36978,36227,37590,35817,35833,39474,
+36182,37924,38587,38714,36885,35628,35116,34857,
+33862,33540,33402,34320,33668,33447,33288,33254,
+33219,33252,33277,33303,33602,33770,33761,33949,
+33875,35037,36759,35399,34454,33602,33192,33148,
+33627,33436,33288,33300,33414,33138,33236,33034,
+33185,33271,33162,33270,33197,33301,33254,33187,
+33595,33470,33465,33058,33231,33076,32931,33124,
+33031,33099,33123,33132,33162,33161,33287,33297,
+33387,33007,33009,33023,33014,33008,32956,32985,
+32964,32972,32959,32948,32919,32895,32950,32943,
+32901,32925,32924,32935,32961,33167,33255,33325,
+33244,33297,33309,33343,33618,33447,33499,33600,
+33495,33536,33321,33261,33183,33232,33244,33303,
+33339,33364,33495,33690,33975,34061,34038,33999,
+34004,33922,33984,34035,34222,34595,34686,34742,
+34999,35413,34871,34674,34376,34566,34566,34326,
+34479,34624,34708,34873,35273,34584,34230,34264,
+34466,34796,35877,36416,39604,38433,38850,37487,
+36186,36942,38146,38202,36932,35505,34353,34497,
+34720,35346,36590,37233,40793,40557,41821,41364,
+38024,36349,39059,37749,36924,37527,38252,37746,
+38286,40023,40208,39927,40543,40851,40535,40617,
+41905,39657,39204,38728,37725,37834,37800,37002,
+37452,37367,36471,36945,37065,37904,37518,37440,
+37489,36860,37022,36496,36377,36397,36500,36474,
+36645,36649,36316,36061,35618,35505,35430,35409,
+34970,35085,34912,35016,35074,35614,35720,36602,
+36591,36184,35032,35664,34117,33861,33510,33407,
+33408,33510,33492,33678,33540,33630,33576,33588,
+33980,34215,33953,34643,33351,33221,33204,33169,
+33783,33147,33147,33163,33268,34106,33897,34316,
+34960,35904,35856,35543,34191,33123,32382,30845,
+29999,29605,29533,31465,33742,33138,32037,31225,
+27264,25916,24603,22998,22991,22800,22638,22971,
+22986,22559,22837,22965,23131,25581,23045,24372,
+31408,29919,26531,24488,25477,17025,11801,15562,
+17733,18738,18687,18388,18224,17895,17907,17581,
+17621,17095,16718,16245,15679,15735,15743,15458,
+15639,15647,15511,15599,15294,15144,14763,14484,
+13647,16371,24489,24588,14074,14690,15016,14836,
+16017,16281,15925,16944,15219,15186,16149,16369,
+16302,16363,17059,14264,14993,16632,15260,16411,
+16002,15801,16281,16548,16152,16164,16262,16642,
+15771,16072,16005,16073,15993,16611,17163,17054,
+16305,16734,16534,16677,16906,16773,16917,16856,
+16715,16983,17029,16979,17651,17209,17295,17486,
+17934,18015,17974,17823,17884,18265,18231,17860,
+18243,17973,18144,17625,17739,17603,17787,17841,
+17595,17652,17679,17614,17710,17650,17577,17785,
+17991,19133,19034,20157,18653,18059,18293,18387,
+18590,18838,18894,19074,19083,19241,19292,19520,
+19854,19868,19695,19688,19905,20040,20015,20421,
+20353,20561,20757,20585,20769,20824,20886,21013,
+20933,21516,21077,21258,22156,22425,23763,23658,
+23561,24574,24655,24312,24861,25170,25144,25048,
+24974,24986,26004,27583,29051,30485,32722,33718,
+36576,36160,32997,33121,34686,35795,35403,34411,
+35258,34817,34984,35208,35244,35115,35374,36106,
+37624,38367,37047,35990,37627,39231,39240,36758,
+36382,36242,35868,35836,35678,35956,35687,35516,
+35231,35634,35132,35116,35340,35033,35340,34984,
+35051,35052,35080,34707,34962,34851,34838,34544,
+34466,34434,34388,34304,34192,33877,33782,34056,
+34216,34233,34252,34269,34252,34227,34257,34351,
+34399,34513,34432,33549,33549,33549,33549,33549,
+33549,33549,33549,33549,33759,33549,34215,34398,
+34438,34347,34227,34182,34118,34136,34056,33956,
+33605,33864,33857,33939,33969,34204,34080,34178,
+34269,34540,34603,34512,34472,33844,33879,34365,
+34740,35526,35334,33658,32903,34065,33618,34220,
+34339,34030,33602,33935,33080,33160,33009,32986,
+32889,32772,32811,32813,32882,32928,32791,31592,
+31470,33942,33897,33459,33388,33333,33992,33597,
+33487,33417,33505,33132,32884,33331,33333,32436,
+32468,32583,32627,32625,32653,32550,32418,32298,
+32139,31973,30175,29586,31868,32201,32254,31839,
+30133,24329,22218,20478,20349,19226,18947,18875,
+19330,18815,19231,19221,19375,19760,19732,20411,
+19974,20027,19982,20195,20370,20541,21177,20354,
+21598,21304,21773,22185,22774,22669,23344,24051,
+24261,28330,26918,23472,23534,24214,22112,21400,
+21036,20203,20736,19639,21146,19677,19623,19626,
+19491,18936,19320,19402,20082,19331,18946,18972,
+18528,18507,18529,19402,19018,19729,20316,20933,
+20974,19675,20942,21182,21589,21639,23686,28187,
+29923,32464,32498,32525,32544,32619,32695,32848,
+32883,33018,33328,33135,33129,33266,33192,33154,
+33252,33325,33356,33330,33419,33491,33710,33682,
+33790,34149,34047,33908,33934,34765,33823,35216,
+35450,34439,34402,34935,35259,35436,35103,35474,
+36509,35907,35854,37158,35019,36254,36264,36485,
+34325,33320,33336,33324,33334,33494,33596,33482,
+33317,33257,33283,33431,33403,33302,33440,35717,
+34718,36866,36428,35280,34172,33438,33205,33462,
+33522,33696,33521,33543,33449,33400,33324,33323,
+33323,33321,33141,33218,33283,33303,33301,33279,
+33449,33429,33550,33471,33589,33225,33327,33384,
+33276,33378,33303,33352,33081,33225,33366,33362,
+33309,33020,33019,32996,33042,32946,32980,32976,
+32956,32943,32964,32970,32967,32941,32979,32980,
+32915,32934,32934,32961,33216,33357,33459,33370,
+33363,33539,33633,33746,34118,33688,33506,33603,
+33691,33243,33368,33312,33225,33193,33223,33271,
+33342,33371,33624,33926,34305,34572,34162,34075,
+34029,33946,33961,34032,34327,34676,34734,34989,
+35319,35449,35350,35055,34790,35109,34971,34752,
+34630,34808,34965,35280,34943,34584,34706,34647,
+34962,35472,35950,36804,36314,34747,34604,34677,
+34164,34239,34473,34895,34709,34505,34428,35433,
+35389,38213,38974,40038,42368,39621,40392,39345,
+36523,37938,36589,36588,36902,37236,37629,37914,
+39573,38797,40230,42143,41163,41235,41126,40784,
+39585,38862,38040,37714,37145,37128,37149,37015,
+36503,36888,36201,37199,36522,37551,37527,37889,
+37191,38195,37681,36767,36924,36684,36544,36015,
+35984,35933,35878,35819,35620,35309,35042,34714,
+34881,34922,34845,34785,35151,35201,35613,35946,
+36828,36365,35294,35273,34389,33803,33640,33453,
+33428,33450,33616,33725,33849,33567,33750,34231,
+34518,33717,33709,35276,33880,33589,33173,33168,
+33168,33168,33180,33159,33177,33160,33244,33827,
+34126,35908,34735,35298,34085,35542,32631,31692,
+30988,30515,30933,31568,33863,32173,32394,31981,
+31032,30279,30336,25870,25235,23934,24010,24210,
+23072,22972,22934,22726,22982,23185,23029,23373,
+24825,27183,29620,25953,28090,23913,16776,11637,
+12983,17143,19035,17826,17769,17302,17217,16989,
+16875,16830,16842,16719,15923,15553,16131,14982,
+15446,15375,15530,15309,15277,15165,14864,14414,
+14219,22044,25962,15576,14388,14437,14996,18148,
+16911,16351,15986,18131,15934,17247,21927,16940,
+16896,15987,16736,15048,15976,16665,16412,16787,
+16021,17029,16142,16988,16572,16420,16018,17318,
+16390,16459,16639,16742,17204,16224,17683,17272,
+17271,17065,16656,17139,17016,17296,16923,16929,
+16790,16916,16977,17421,17370,17394,17355,17770,
+18184,18169,18209,17852,18099,18009,18213,18410,
+17849,18132,17662,17586,18796,17423,20611,17767,
+17767,17980,17628,18352,17921,18318,16662,17880,
+18020,18927,18493,18843,18554,18178,18459,17778,
+18771,18911,19259,19060,19389,19578,19656,19705,
+19708,19870,19932,19998,19935,20140,20305,20501,
+20728,21045,20938,20718,20883,20832,20840,22636,
+20955,21018,21365,21920,21939,25818,23472,24393,
+23779,23733,24165,24489,26542,25866,25500,25206,
+25207,25140,25287,29383,31911,32619,32901,33277,
+32520,32683,32910,33205,35643,36081,38739,36180,
+34211,34902,35685,35130,34588,35109,35187,36369,
+37924,35905,37808,35718,38304,39157,37154,36523,
+36135,35799,35674,35562,36824,36703,35659,35373,
+35412,35196,34938,35339,35211,35025,34800,35040,
+35064,35124,34932,35043,35049,34483,34390,34408,
+34485,34351,34331,34365,34005,33738,33816,34089,
+34065,34126,34089,34097,34118,34197,34275,34144,
+34272,34388,34371,34567,34298,33549,33549,33549,
+33549,33549,33549,33549,34401,34265,34173,34062,
+34211,34155,34084,34089,34140,34038,34016,34008,
+34002,33959,33988,33954,33906,34116,34063,34473,
+34309,34218,34288,34426,34432,34528,34157,33930,
+33974,34059,33787,33422,33432,32616,33597,33917,
+33736,33488,33987,34067,33450,33928,32907,32591,
+32732,32799,32753,32751,32229,31827,31704,31599,
+32206,32677,33109,33978,34063,33957,33582,33774,
+33560,33775,33504,33327,33286,32913,32610,32442,
+32440,32495,32389,32477,32355,32160,31078,28877,
+28161,28294,29903,28930,30199,31439,31257,30033,
+25005,23541,21376,20791,19938,19560,19900,19475,
+19518,19389,19443,19557,19608,20210,19975,19753,
+19747,20220,18947,20610,21452,20171,21080,20718,
+21132,21346,22952,21966,24466,24548,24748,25002,
+23037,25834,24051,22413,21959,22249,22758,21654,
+20508,20558,20333,20131,20038,20469,19983,20250,
+20176,19929,19821,19740,20690,19715,18365,18240,
+18480,18483,18396,18550,19083,19604,20927,22270,
+25722,21125,23926,22803,28052,30506,32333,32346,
+32457,32463,32523,32812,32646,32687,32819,33313,
+33294,33534,33636,33288,33277,33345,33324,33696,
+33219,33516,33432,33405,33378,33379,33220,33612,
+33394,33749,33951,34040,34092,34464,34818,33570,
+35079,34989,35329,34577,34624,34627,34555,34463,
+34482,34152,34176,34137,33799,33948,33841,33686,
+33954,33437,33366,33378,33554,33744,34291,33828,
+33669,33385,33850,33266,33327,33360,34644,34465,
+37019,36408,34375,34052,33482,33479,33676,33597,
+33316,33732,33541,33560,33505,33442,33427,33536,
+33450,33547,33444,33390,33393,33203,33291,33388,
+33384,33506,33574,33591,33502,33628,33679,33375,
+33474,33167,33315,33315,33177,33208,33239,33352,
+33411,33015,33039,33032,32984,33101,33037,32979,
+32982,32960,32984,32982,32946,32923,32972,32991,
+32967,32979,32994,33073,33201,33231,33490,33353,
+33527,33549,33492,33624,33845,33765,33687,33559,
+33758,33601,33288,33273,33255,33181,33129,33468,
+33419,33492,33614,33921,34370,34709,34508,34266,
+34560,34427,34071,34084,34173,34383,34500,34649,
+35487,35202,35213,35228,35474,35589,35335,35417,
+35050,35498,35424,35150,35157,35450,35528,36096,
+35076,35190,35496,35460,34868,34270,34134,34233,
+34192,35579,35316,34599,35273,35919,35880,37897,
+41487,40320,40521,40432,40940,42069,38628,36684,
+36503,36474,36600,36528,38073,37932,38293,38630,
+40836,40133,39456,39958,39900,41208,40674,39929,
+38790,39298,38207,37501,38151,37823,38263,37895,
+36030,36604,36408,37564,36819,36738,38617,38918,
+38619,37377,38215,37190,36567,36490,37003,36527,
+36312,36007,35764,35523,35529,35223,35211,35223,
+34951,34688,34773,34753,34913,35142,35165,35619,
+35562,36267,36139,34946,34500,34278,33877,33798,
+33500,33606,33861,34022,33759,33823,34115,34281,
+34526,34207,34395,34540,33762,33603,34806,33324,
+33243,33256,33126,33141,33119,34443,33255,33177,
+33519,34905,35152,36383,35616,35766,34553,33676,
+32168,31081,31259,31764,33428,32760,32230,32474,
+31824,31948,31782,29236,28902,28320,28447,28226,
+27631,27309,27903,25150,23597,23667,23507,23077,
+23414,24342,31385,28001,28554,32675,26180,18474,
+13686,11531,15881,16971,17522,16818,16425,16452,
+16579,16731,16534,15960,15714,15714,15714,15636,
+15753,15334,15846,15718,15853,15597,14394,14505,
+21912,18686,22284,15297,13734,15712,16016,16563,
+16467,16080,15268,16665,18728,19216,18213,17472,
+17140,16114,16034,15990,16413,16284,16371,15723,
+17094,17037,16935,17255,17131,16485,16999,17070,
+16187,16758,16820,17070,16496,17130,17709,17574,
+18543,17259,16923,17328,16984,17386,16451,16680,
+16733,16990,16774,17103,17347,17622,17384,18210,
+18555,18183,18252,18081,18114,18237,18444,19791,
+18149,18161,18213,17616,17677,17708,18123,18029,
+19761,17807,18462,18033,17946,18011,18271,18202,
+18201,18771,18633,18715,18717,18783,18995,18891,
+18798,19020,19078,19130,19544,19864,20086,20040,
+20289,20485,20844,20390,20202,20502,20651,20726,
+21617,21491,21507,21006,20787,20538,21073,21734,
+21718,21426,20898,22276,21715,23146,22936,23308,
+25986,23505,23106,24926,24370,24488,25710,25558,
+25356,26850,28901,32022,32699,32766,33280,34794,
+33516,33028,32988,34212,35452,37014,38103,38133,
+37120,36350,35877,36551,36801,37580,38049,35472,
+37840,37728,38004,36420,38377,37588,36813,36633,
+36139,36398,35900,35574,35439,35325,35929,35669,
+35484,35228,35443,35779,35537,35543,35091,35095,
+34993,35085,35235,34818,34590,34382,34347,34433,
+34603,34418,34441,34493,33900,33731,33873,33950,
+33993,34100,33998,34010,34110,34014,34131,34123,
+34251,34368,34411,34491,34468,34456,34411,33905,
+33584,33549,33549,33923,34083,34252,34117,34119,
+33972,34041,33947,33886,33930,33915,33824,33856,
+33848,33851,34002,33942,33914,33909,34071,34191,
+34160,34200,34209,34483,34728,34533,33799,33291,
+33465,33895,34869,34835,33824,33416,32436,32457,
+33204,33930,34050,33908,34663,33960,33909,32990,
+32449,32230,31914,31815,31936,31986,32216,32090,
+32150,32799,32831,33629,33407,34169,33583,33490,
+33551,33519,33506,33105,32997,32480,32574,32121,
+32175,32286,32347,32377,31040,28657,27384,26717,
+25932,25405,25075,25188,27682,29373,29146,27523,
+25228,21846,21004,20836,19952,19585,19812,19613,
+19779,19589,19343,19762,19959,20045,19338,19901,
+20679,19659,20933,21929,20462,20698,20801,21902,
+21630,22521,21831,21681,22766,24249,25395,27081,
+25815,26412,23624,22389,22422,22141,21465,21843,
+21663,20353,20370,20586,21595,21045,19752,20011,
+20849,20956,19740,19521,19890,18814,18468,18456,
+18661,18547,18900,19388,19359,20499,24957,27417,
+25809,28556,28733,32423,32358,32500,32490,32606,
+32569,32689,32611,32578,32655,32689,32695,32964,
+32941,33194,32838,32948,32923,33152,33809,33591,
+33698,33626,33419,33514,33239,33320,33502,33357,
+33567,33383,33813,33869,33710,33714,34161,33452,
+34066,34593,34038,34428,34695,34343,34126,34240,
+34314,33990,34188,34989,35117,35109,34658,34362,
+33572,33613,33815,33938,33690,34451,34479,35403,
+35061,35013,33713,33301,33732,34827,35109,35691,
+34830,33943,33788,33791,33776,33774,33699,33820,
+33838,33764,33602,33678,33609,33485,33480,33528,
+33548,33513,33492,33488,33183,33230,33269,33357,
+33410,33467,33425,33564,33588,33372,33217,33186,
+33457,33395,33361,33534,33312,33399,33328,33273,
+33382,33010,33064,33066,33075,33052,32979,33051,
+33056,32986,32949,32983,32958,32981,32949,32952,
+32991,32992,33054,33080,33252,33314,33243,33641,
+33603,33756,33654,33771,33818,34407,33662,33525,
+33396,33332,33337,33249,33288,33424,33322,33354,
+33420,33543,33772,33840,34002,34353,34836,34665,
+34461,34341,34296,34360,34238,34501,34503,34514,
+34681,34866,35409,35192,35532,35896,35790,36057,
+35708,35394,35557,35565,35719,35757,35501,34668,
+34965,35562,35444,35148,34632,34401,34258,35052,
+35420,36824,39439,37350,38790,37359,40073,40892,
+40810,39772,40964,39856,41496,42089,38214,40199,
+37439,36511,36159,36378,37420,37617,38221,39405,
+39825,39596,38868,38361,38253,38223,39654,38395,
+38016,38114,37726,37622,37035,37578,37428,36379,
+36687,35682,36414,35700,35853,36839,37730,37440,
+38418,39153,38705,37569,36983,36655,36325,36761,
+36426,35948,35711,35451,35436,35535,35276,35595,
+35444,34842,34617,34661,34818,35085,35185,35028,
+35389,36062,35760,35598,35310,34570,34570,34208,
+33856,33733,33925,34060,33900,33904,34199,34268,
+34494,34208,34340,34262,34006,34365,33970,34170,
+33473,33444,33195,33177,33100,33195,33091,33239,
+33084,34304,34954,35487,36076,35622,35730,34023,
+32961,32138,31849,32756,33492,33476,32301,32347,
+32236,32990,31785,30414,30252,30188,29739,29375,
+29197,29010,28680,28618,27957,26869,26118,24287,
+25125,23939,24884,28659,31431,30801,31148,27102,
+18501,14835,8138,14211,16362,16538,16052,15914,
+16176,16378,16206,16071,16245,16062,15781,15165,
+15798,15251,15664,16788,16089,15285,16276,18553,
+26356,22110,24995,14544,15665,15868,15826,19682,
+22284,18856,18712,15644,17795,17267,20412,17484,
+17332,17235,15555,15819,18228,17358,16690,17279,
+17328,16722,19115,18040,18654,17267,19756,18380,
+17319,17465,17059,17317,17652,16812,18000,17649,
+17907,17514,17578,17025,16901,16920,16861,16663,
+16958,17019,17274,17159,17117,17628,17821,18296,
+18366,18289,18144,18119,18288,17687,18380,18446,
+18384,18473,18149,17844,17835,17966,18336,18361,
+18197,18591,18545,18315,18249,18273,18468,18491,
+18075,17736,18375,18293,18424,20316,18795,19059,
+19020,19286,19592,19682,19913,20067,20241,20340,
+20241,20470,21738,22017,20791,20625,20749,21165,
+20656,21348,21759,20896,20667,21125,22137,21858,
+21638,20823,22883,21883,25050,23146,23325,23595,
+23111,25046,26010,26250,25600,25560,25843,25624,
+25518,28851,32586,32859,33331,35568,33733,33814,
+32178,32950,33003,33306,33264,37032,37395,38432,
+36637,37884,36572,36917,36818,35949,37065,37328,
+37733,35357,38923,38133,36789,36422,36739,36216,
+35790,35793,35686,35896,35939,35987,35743,35818,
+35386,35854,35925,35802,35568,35190,35212,35184,
+34801,34710,34743,34671,34547,34389,34389,34509,
+34462,34321,34377,34112,33752,33714,33834,34016,
+34028,34041,33969,34001,34070,34210,34242,34270,
+34339,34476,34501,34473,34460,34418,33810,33923,
+34386,34247,34079,33996,34053,34113,34085,33948,
+33847,33750,33710,33685,33734,33657,33882,33914,
+33915,33903,33871,33880,33909,33822,33916,33963,
+34308,34016,34335,34200,34059,33926,33909,33709,
+33918,34027,34698,34812,34217,34014,33772,33194,
+32853,32281,32195,32629,33071,33192,32424,32019,
+32010,32806,33283,33222,32991,32672,32341,32194,
+32181,32370,32682,32992,33720,33252,33920,33471,
+33612,32997,33183,33272,33153,32736,32061,32039,
+32058,32025,32029,32139,30007,28254,27007,26158,
+25617,25060,24511,23881,24166,24910,25019,23938,
+21883,20768,20253,19807,19794,19735,19780,19729,
+19766,19959,20589,19856,19967,20038,19911,20837,
+20665,21592,20550,20575,20985,21052,21105,21495,
+21477,21150,24191,22783,23409,23992,24745,22705,
+24336,23802,22007,22326,22555,21957,21540,21789,
+21633,21363,20601,20572,19818,20362,19701,21640,
+21798,19601,18628,20168,19354,18251,18347,18318,
+18519,18825,19123,19203,20178,22842,29010,29682,
+30411,32255,32511,32630,32539,32565,32357,32612,
+32604,32582,32692,32655,32653,32715,32755,32731,
+32754,32794,32882,33106,32973,33029,33197,33105,
+33347,33420,33075,33357,33402,33311,33438,33444,
+33439,33386,33644,33722,33688,33695,33831,34029,
+33364,33585,33601,34014,34409,34296,34265,34540,
+34164,34302,35688,34539,34416,34280,34924,34451,
+34440,34168,33942,33915,34918,34199,34810,37275,
+36507,34951,34260,34116,35340,34802,35012,33927,
+33718,33716,34107,33978,33924,33915,33960,33987,
+33816,33758,33783,33684,33609,33642,33455,33363,
+33319,33231,33307,33260,33242,33375,33314,33492,
+33466,33405,33291,33504,33355,33444,33516,33405,
+33580,33312,33342,33397,33343,33347,33461,33158,
+33221,33370,33099,33083,33063,33118,33116,33023,
+32977,33021,33011,33002,33013,33019,32990,32993,
+33004,33019,33026,33087,33249,33350,33454,33397,
+33618,33719,33843,33815,34092,34242,33975,33798,
+33636,33675,33535,33555,33324,33234,33261,33387,
+33375,33486,33508,33756,33907,34191,34744,34907,
+34566,34443,34205,34357,34548,34356,34461,34593,
+34661,34773,34824,35346,35301,35910,35429,35624,
+35882,35697,36030,35326,34941,34648,34697,34536,
+34493,34583,34277,34486,35563,36237,36069,35327,
+34494,34468,36543,36910,36654,38891,40485,41187,
+41048,40569,39816,40158,38784,37448,38129,38364,
+37254,36261,36078,36381,39060,38544,39595,38107,
+38769,38455,39396,38794,38566,39071,38776,38268,
+38295,36912,37742,37787,36612,37184,36859,37252,
+36669,35988,35502,35423,35980,36753,36350,37019,
+37827,37302,38151,37362,37378,37538,36354,36145,
+36234,35853,35926,35787,35443,35324,35124,35036,
+35127,35259,35118,34635,34842,34808,34926,34857,
+35031,35167,35796,35773,35346,35034,34707,34182,
+34266,34047,33702,33858,34351,34366,34077,33744,
+33860,33714,33678,33249,33337,34013,34973,34719,
+35715,34802,33562,33972,33782,33210,33104,33103,
+33033,33204,33498,34532,34671,35506,34380,34650,
+33333,32840,31107,31374,34269,33927,32814,32868,
+33287,32673,32170,31383,30853,30039,29182,29475,
+29676,29565,29715,30140,29491,29175,28685,28173,
+27609,27605,24976,25434,29370,32628,31416,30569,
+26937,21519,16489,12949,11912,15014,16113,16317,
+16272,16081,16472,16414,16579,16399,15875,16212,
+15912,15869,17128,16580,15090,16872,17041,16795,
+22761,17736,22252,16663,15879,18575,16252,19250,
+18116,18857,16814,19160,18390,17991,20968,18567,
+18284,17619,17341,16134,18641,18223,18055,17423,
+18073,18627,18752,18986,18336,17715,18383,18301,
+17649,16716,17292,18084,17475,16869,16904,17525,
+17828,17918,18475,17293,17169,17053,19032,17179,
+17210,17174,17221,17310,17669,17688,18352,18399,
+18387,18208,18444,18504,17589,18057,18327,18908,
+18394,18532,19670,18423,18150,18429,18382,17945,
+18206,18370,18900,18339,18163,18168,18018,17859,
+17898,18411,18849,18712,18669,19011,19278,19096,
+19280,19503,19935,20226,20259,20146,20271,20269,
+20416,20963,21106,21256,21231,20670,23187,20742,
+20946,21702,21346,20895,21089,21407,21339,21820,
+22047,22150,23704,22277,22754,23157,23195,23161,
+25422,24015,25245,27051,27431,26768,26105,26581,
+30438,32717,34188,35085,35236,35556,32299,32913,
+33963,36719,34584,35457,36996,36867,36261,36787,
+34026,37250,36483,36921,38786,38325,37803,39568,
+35428,37901,38308,37299,36837,35833,35676,35532,
+35467,35524,35859,36422,35846,36535,36162,35715,
+35373,35345,35240,35206,35058,35226,35061,34738,
+34787,34819,34954,35182,34797,34466,34322,34296,
+34095,34071,33959,33888,33723,33702,33744,33848,
+33924,34051,34085,34115,34170,34106,34104,34282,
+34218,34293,34377,34372,34350,34040,33777,33777,
+34085,34070,34018,34038,33786,33791,33819,33846,
+33700,33591,33561,33510,33598,33548,33672,33927,
+33912,33804,33847,33800,33732,33855,33785,33869,
+33921,33997,34118,34208,34190,34375,33873,33918,
+34044,33895,34192,34208,34674,34443,33885,33701,
+33774,33519,32205,32101,32032,32129,32559,32953,
+33055,33426,32777,32366,32196,32227,32267,32667,
+32429,32283,32407,32769,34343,34139,32994,33856,
+32730,32099,32541,32987,32669,32646,31639,32029,
+32295,32189,32063,31989,30177,28380,26973,25976,
+25168,24601,24183,23560,22729,21928,21345,20841,
+20739,20214,19914,19805,19607,19708,19519,20053,
+20244,20028,19774,20310,19803,19359,20416,20483,
+21921,21519,20945,20969,21315,20549,21588,21255,
+21420,22209,22139,23255,23890,24941,22578,23151,
+23561,22631,21955,21564,21225,21498,20811,20808,
+20865,20750,20422,20243,20222,21018,20802,22004,
+19857,19803,20669,19638,18525,18257,18138,18433,
+18822,18815,19824,20460,21601,25998,26233,28202,
+29778,31863,32520,32565,32588,32593,32695,32589,
+32622,32637,32693,32714,32706,32719,32757,32758,
+32778,32811,32817,32952,32973,32969,32886,32877,
+33034,33381,33541,33600,33370,33264,33245,33285,
+33634,33504,34026,34080,34017,34039,34275,33891,
+33502,34107,33726,33961,33909,33884,34416,34378,
+34519,34449,34083,34733,34188,34359,34370,34576,
+34655,34100,33849,34524,33864,34180,34619,35154,
+34458,34260,33891,33924,34115,33747,33705,33872,
+33707,34143,34120,34080,33910,33895,33852,33859,
+33807,33874,33647,33628,33515,33423,33264,33276,
+33359,33251,33264,33236,33413,33342,33424,33512,
+33441,33419,33484,33400,33539,33496,33430,33477,
+33462,33458,33213,33499,33289,33237,33306,33371,
+33291,33420,33094,33094,33105,33094,33162,33050,
+33095,33049,33050,33009,33041,33032,33033,33021,
+33018,33073,33147,33222,33444,33408,33537,33736,
+33767,34018,33888,34000,34001,33956,34058,33873,
+33692,33741,33705,33564,33387,33350,33459,33229,
+33366,33423,33579,33726,33703,34303,34410,34429,
+34416,34496,34086,34137,34107,34176,34291,34328,
+34593,34421,34620,34932,34908,34846,35023,35047,
+35080,35122,35113,34758,34401,34215,34084,34109,
+34225,33978,34098,34602,34358,35030,35634,34638,
+34444,35534,39270,38190,39418,40498,37713,41446,
+41794,39991,39959,42915,37637,38111,42567,38784,
+37464,38607,37199,36731,36577,36603,37695,37282,
+37164,37630,39687,39913,39424,38503,38379,37456,
+37860,38580,38279,36807,37059,35940,36405,37548,
+37143,35362,35415,35352,35338,35250,35694,35715,
+36784,36821,37539,37279,37314,38166,37455,36110,
+36732,35435,35874,35683,35454,35090,34904,34853,
+35052,35070,35247,35015,34622,35131,34728,35353,
+35127,35413,35554,35641,35995,35509,34984,34568,
+34263,34029,34012,34226,34354,34385,34050,33345,
+33441,33507,33500,33324,33918,33765,34380,34220,
+34292,35303,34500,35076,34539,33735,33180,33094,
+33033,33027,33263,34081,35208,35633,35436,33954,
+33791,32526,30435,29823,34387,33420,33262,34329,
+32591,32865,32211,31535,30918,30309,29434,29676,
+29808,29958,29970,29748,29817,29805,30085,29272,
+27815,28530,28508,27423,30291,30203,31666,32079,
+32942,28628,25209,20505,14954,12498,14361,15836,
+16389,17225,17513,17055,16351,16835,16292,16351,
+17148,16701,16799,15396,16680,16673,16180,25894,
+25365,19065,16164,17015,18409,17343,16650,17063,
+22610,18816,18309,18900,18369,17880,18515,18972,
+18297,18518,20699,18326,18606,19813,18834,18207,
+12221,12252,12447,12697,12474,13347,14163,15079,
+14904,17000,16896,17313,18330,17979,16228,17626,
+18261,18006,17804,17662,17403,17520,17791,17746,
+17356,17656,17780,17620,17823,17970,18309,18702,
+18319,18780,18398,17973,18214,18732,18422,20970,
+18268,19631,18350,18216,18235,18402,18837,18437,
+18335,19058,19074,18631,18399,18270,18585,18225,
+18069,17802,18454,18272,18552,18998,18915,19508,
+19643,19862,19976,19761,19800,20322,20386,20640,
+20786,21309,21661,21177,22855,22611,20964,21371,
+21267,21477,21747,21456,21477,21360,21656,21672,
+21841,22091,22280,23086,23201,23274,24038,23375,
+24264,24417,25382,25770,27556,27762,27024,30070,
+33071,35185,34408,35702,33444,33507,34248,35779,
+37466,38115,39642,38784,38253,36945,37142,36484,
+37763,34674,35575,38859,35427,38973,39218,39537,
+37128,38422,39387,37137,36250,35921,35652,35308,
+35232,35272,35130,35340,35254,35139,35245,35272,
+35451,35268,35157,35148,35277,34719,34755,34723,
+34960,35049,34983,34830,34696,34389,34563,34710,
+34527,33955,33786,33732,33790,33696,33657,33804,
+33870,33992,34041,34074,34024,34170,34111,34093,
+34152,34179,34276,34249,34290,34083,33781,33832,
+33949,33921,33914,33875,33693,33470,33414,33402,
+33479,33452,33398,33374,33390,33477,33566,33639,
+33585,33559,33795,33669,33685,33837,33813,33933,
+34236,34362,34081,34216,34545,34410,33997,34050,
+34829,34476,34452,34720,34617,34200,34526,34730,
+34822,33927,33765,33075,32928,32875,32874,32839,
+32976,32996,32879,32988,33021,33024,33000,32997,
+32964,32637,32503,32097,32470,33877,33915,31974,
+32815,32111,32304,32204,32060,31896,31614,32184,
+32119,32016,32100,30415,29267,27766,26307,25407,
+24943,24494,25723,26466,23615,21258,20751,20441,
+20113,20194,20158,19863,19910,19823,19725,19761,
+20415,20657,20574,21013,20370,21743,20931,20388,
+20799,21121,23095,21246,21209,21778,21179,21286,
+22789,22985,22620,23434,25836,23652,22623,23471,
+23511,23117,21714,22111,22101,21489,21052,21246,
+20957,20353,20495,20337,20511,21799,22185,19950,
+20219,20835,19854,18706,19914,18465,18514,18986,
+19377,20220,20916,21983,23628,24937,25506,26007,
+27035,30249,32454,32591,32622,32726,32613,32640,
+32721,32694,32670,32731,32859,33402,32937,32836,
+33028,32838,32829,32862,32865,32843,32856,32869,
+32875,32880,32857,33099,33423,33249,33156,33452,
+33661,33743,33722,34699,34459,34621,33834,33855,
+33885,33390,33672,34215,33921,33908,34077,34800,
+34920,34332,34325,34358,33727,33570,33612,33733,
+34211,35446,35066,33865,33574,33708,33915,34388,
+33762,33547,33570,33674,33675,33644,33729,33641,
+33595,33629,33690,33753,33638,33675,33707,33663,
+33686,33646,33570,33548,33541,33261,33291,33328,
+33327,33399,33433,33391,33553,33324,33495,33557,
+33613,33432,33544,33509,33469,33550,33456,33432,
+33456,33540,33366,33428,33276,33378,33339,33280,
+33522,33481,33394,33093,33099,33114,33153,33113,
+33087,33060,33035,33033,33064,33052,33066,33117,
+33064,33111,33219,33309,33417,33619,33608,33656,
+33635,33947,33724,34010,34139,33911,33841,33769,
+33729,33750,33725,33727,33658,33461,33528,33348,
+33303,33465,33442,33681,33688,33936,34116,33964,
+33998,33902,33925,33949,34089,34212,34189,34194,
+34426,34613,34507,34680,34863,35025,34739,35204,
+34840,34368,34280,34038,33945,33764,33707,33966,
+33745,33717,33741,33682,34050,34713,35520,37877,
+38317,37859,38245,35874,38333,37803,40191,38295,
+41347,39701,40552,39295,41257,37660,38840,35806,
+35290,35256,35319,35577,35790,36504,36619,38495,
+39642,39371,39192,39642,39915,38718,38597,38783,
+38770,37731,38137,36559,37502,37090,38198,37013,
+37066,35727,36183,35982,34918,35267,35421,36222,
+36031,36383,37067,37067,37935,36509,36947,37836,
+37161,36436,35435,35492,35654,35267,34962,35145,
+34971,35772,35153,35710,34798,35144,34590,34587,
+34806,35393,35390,35970,35081,35355,35088,34545,
+34232,34131,33971,34519,34480,34488,33644,33387,
+33498,33644,33552,33762,33643,34110,34568,34219,
+34212,34627,34902,35485,36410,35763,34560,35097,
+34343,33102,33277,34028,35541,34145,35695,35261,
+34464,32259,30653,30315,34062,33327,34954,33138,
+31865,31884,31863,31416,30852,30129,29268,29342,
+29605,29716,29628,29544,29472,29478,29397,29183,
+28678,29474,29124,29378,29089,29758,33137,33279,
+32362,32296,29759,27599,22838,17322,13051,15100,
+15971,16633,17285,16659,16356,16466,16858,16648,
+16176,17316,15876,17243,16766,21003,21315,24363,
+24937,17437,19881,21774,20188,19277,20519,19240,
+18412,16355,18693,18642,20200,18777,19284,19317,
+18738,18173,17709,16752,13155,13261,12987,12321,
+17503,18439,17822,17776,19985,20060,20256,19296,
+15615,14956,13382,12523,11380,11275,12155,12968,
+13115,15399,16053,16774,17224,17720,17754,17631,
+17895,17834,17983,18134,18177,18483,20176,18660,
+18933,18757,18441,18519,18523,18426,18465,18674,
+18646,18654,18651,18491,18452,18516,18825,19863,
+18640,18874,18739,18483,18389,18402,18374,18412,
+18513,18267,17840,18344,18656,18642,18884,19230,
+19328,19760,19923,20103,20176,20204,20177,21103,
+20249,23750,21337,21513,21233,21441,21043,21258,
+21449,21732,21585,21985,21692,21738,22252,21660,
+21847,22059,22215,22707,22798,23210,24190,24441,
+24576,28101,25985,27843,26949,31663,32649,33537,
+34248,32600,32920,34704,33424,35628,36950,36744,
+37727,38385,38052,35436,38655,34846,35185,35583,
+35515,34466,35737,38918,35498,38311,38403,36369,
+38010,39150,38700,36497,36264,35899,35596,35331,
+35180,35295,35418,35205,35199,35139,35053,34978,
+35080,34773,34852,34811,34773,34656,34614,34815,
+34669,34838,34642,34554,34509,34660,34897,34705,
+35062,33906,33745,33745,33822,33750,33639,33687,
+33906,33996,34111,34215,34125,34120,34285,34271,
+34143,34174,34184,34219,34125,34134,34139,33982,
+33912,33872,33792,33600,33548,33460,33420,33417,
+33427,33466,33441,33331,33199,33214,33340,33411,
+33320,33264,33464,33510,33625,33722,33891,33794,
+33910,33963,34055,34119,34122,34606,34782,34247,
+34338,34446,34482,34425,34836,34544,34104,34654,
+33978,34480,34555,33645,34824,33720,34763,33882,
+34013,33731,33733,33859,33591,33444,33391,33471,
+33360,33001,32642,32676,32761,33008,33921,33720,
+32628,32478,32470,32244,32148,31897,32152,32338,
+32263,32069,31802,29808,29331,27345,26012,25176,
+24959,24255,25631,26358,20802,20701,20493,20319,
+20357,20244,19855,19827,19444,19460,20069,20386,
+20529,20786,20620,21902,22016,20126,20692,20555,
+21193,21219,21352,21656,22686,23029,20594,21639,
+22264,22514,23313,24645,23094,24532,24160,23725,
+23965,22342,21717,20804,21346,21942,21501,20971,
+21970,21976,22251,22175,22715,23033,21839,21465,
+22071,21596,19029,19412,19245,18617,18959,19300,
+20206,21377,26163,30056,28341,25958,26233,26481,
+27350,30635,32463,32548,32627,32594,32644,32751,
+32687,32669,32700,32717,32754,32815,32806,33455,
+33433,33435,33135,33147,33048,33006,32969,32847,
+33014,32876,32904,33174,33051,33098,33075,33138,
+33274,33373,33296,33447,33912,33408,33522,33925,
+33885,33713,33887,34029,34173,34785,34074,34125,
+34067,34291,34610,35256,33936,33978,34843,36419,
+34742,33879,33592,33442,33609,33808,33987,33782,
+33707,33814,33824,33509,33619,33805,33640,33582,
+33675,33699,33563,33586,33571,33570,33531,33614,
+33617,33508,33423,33417,33328,33270,33350,33377,
+33380,33477,33534,33530,33502,33410,33612,33546,
+33568,33624,33624,33555,33554,33582,33630,33297,
+33564,33574,33528,33534,33462,33394,33325,33540,
+33531,33392,33850,33069,33156,33126,33198,33222,
+33234,33245,33048,33070,33069,33076,33097,33111,
+33150,33329,33282,33491,33507,33350,33518,33655,
+33634,33660,33946,34224,34361,33763,33796,33923,
+34065,33875,33853,33758,33740,33709,33697,33600,
+33452,33394,33489,33714,33807,33949,33998,33828,
+33972,34055,33915,33991,33993,34059,34099,34227,
+34296,34434,34645,34280,34313,34292,34513,34367,
+33871,33955,33788,33810,33612,33534,33519,33671,
+34185,34050,33993,34557,34787,34666,35281,36469,
+37403,37221,37946,36798,36256,38640,37770,37802,
+37851,39971,39486,41292,38922,39943,38464,38215,
+36449,36858,36045,36710,36200,39047,37436,37217,
+39262,38735,37823,37123,39648,40272,37983,40096,
+37920,38616,38007,37547,37940,36939,36881,36954,
+37494,36689,35838,35212,34710,35217,35604,35275,
+35433,36130,36433,37185,37668,36594,36555,37068,
+36530,36708,35963,35564,35757,35165,35215,35031,
+35000,35676,35748,35747,35066,35250,34862,35206,
+35221,35345,35850,35611,35879,35922,35532,34862,
+34386,34470,34179,34039,34295,34183,33424,33389,
+33516,33633,33618,33649,33807,34934,35389,34744,
+34143,35229,35691,35313,35270,37072,35974,34246,
+35801,33877,33357,33016,34908,35474,34321,34557,
+34170,32328,31682,31311,34811,34189,35782,32502,
+31464,31554,31632,31035,30520,29560,29247,29265,
+29028,29126,29258,29333,29164,29112,29121,29113,
+29532,29931,30543,30642,30447,30237,30767,32565,
+33121,32808,32593,31851,28089,23601,18309,14076,
+15738,16326,16926,16395,16050,16517,16359,16149,
+16704,16269,17542,17354,17915,18973,25671,23826,
+20678,20838,18580,22031,18756,20542,20074,17920,
+16862,19514,18690,19339,20226,18213,17031,16663,
+13389,11196,11660,16600,17699,18742,18906,18306,
+23981,27915,29541,26876,26111,21189,21702,20565,
+20491,20391,20457,19057,19608,19426,18096,17123,
+14641,14238,13764,11607,11664,14119,16109,16711,
+17001,17988,18102,18548,18755,18755,18785,19143,
+19625,18785,19154,18906,18869,18891,18749,19056,
+18721,19044,18639,18500,18523,18678,18909,18747,
+18666,18745,19226,19079,19196,19335,18675,18745,
+18619,18626,18578,19002,18904,18988,19720,19620,
+19780,20225,19946,20429,20521,20079,20822,21041,
+24299,20490,21606,21078,21587,21459,21546,21760,
+21994,22186,22422,21903,22158,22047,22118,22071,
+22003,22182,22696,23542,23395,23911,24160,24724,
+25392,25159,26607,28678,31418,32130,32445,32772,
+33084,34154,35487,35046,36469,36587,38820,38192,
+38389,39584,37600,36284,36701,35731,37104,35776,
+37544,38297,38072,35638,37611,39792,37501,39105,
+39012,39742,36642,36593,35969,35751,35832,35271,
+35259,35301,35369,35223,35060,35051,35070,34902,
+34749,35187,34791,34824,34805,34493,34659,35136,
+35040,34922,34573,34548,34410,34572,34330,33915,
+33777,33767,33741,33856,33750,33705,33660,33739,
+33879,33992,34035,34192,34178,34182,34173,34200,
+34191,34131,34093,34119,34030,33999,33924,33904,
+33881,33717,33609,33528,33504,33459,33344,33269,
+33304,33278,33281,33327,33197,33097,33042,33029,
+32964,33123,33055,33348,33501,33564,33842,33843,
+33975,34086,34368,34057,34227,34122,34176,34333,
+34765,34818,34667,34758,34467,34175,34561,34161,
+34536,34834,34800,34598,34759,34618,34568,35220,
+34821,34748,34650,33948,33550,33957,33833,33918,
+33606,33483,33249,32991,32577,32690,33002,33057,
+32991,32484,32425,32312,32398,32106,31650,31805,
+32297,32279,32180,31512,29539,26246,24905,23679,
+22437,22481,22775,21954,20751,20523,20550,20637,
+20116,20004,20276,20112,20270,19803,20679,20336,
+21816,22032,21990,22029,22148,21539,21918,21516,
+21960,22525,21690,21042,22272,22570,22431,23430,
+23422,24296,24816,24942,26124,24609,23008,23540,
+22453,23480,22377,21077,22356,21346,21777,21618,
+21906,22611,23383,23532,23600,24672,20855,21186,
+21486,19653,18965,18810,18816,18933,18678,19508,
+19999,22877,30819,31341,30925,28501,27294,27954,
+29292,32358,32500,32595,32676,32680,32687,32685,
+32699,32721,32723,32676,32731,32779,32872,32875,
+33429,32755,33228,33314,33406,33409,33228,33249,
+33195,33405,33171,32895,32898,32940,33008,33007,
+33012,33031,33135,33090,33173,33123,33813,34113,
+34491,34281,33870,34356,34313,33908,33713,33564,
+33368,33495,33464,33489,33590,33527,33672,33686,
+33303,33310,33437,33513,33540,33509,33613,33644,
+33663,33702,33564,33408,33632,33540,33573,33501,
+33535,33505,33488,33526,33462,33488,33529,33535,
+33579,33465,33433,33388,33307,33363,33333,33350,
+33420,33441,33471,33443,33478,33518,33463,33723,
+33651,33699,33647,33596,33546,33630,33381,33365,
+33291,33483,33414,33285,33296,33475,33474,33511,
+33668,33613,33669,33128,33273,33225,33291,33279,
+33289,33161,33333,33261,33474,33213,33123,33240,
+33217,33147,33338,33205,33457,33661,33687,33571,
+33658,33811,33471,34106,33775,33612,33805,33787,
+33984,34080,33984,33827,33687,33709,33717,33705,
+33420,33509,33670,33933,33807,33807,33741,33867,
+33840,34109,34119,33943,33954,34027,34014,34258,
+34244,34254,34929,34221,34038,34186,33939,33871,
+33600,33567,33428,33467,33483,33480,33657,33757,
+33617,33675,33815,33972,34261,34434,35330,34713,
+37636,36183,36361,37163,37582,39054,39463,35472,
+38097,39215,39384,38934,37477,35423,35656,36135,
+37528,37851,37370,36162,35160,35423,36042,36015,
+36159,37524,37410,38788,40643,39883,38581,38439,
+38094,38126,39372,38109,38450,37794,39056,37734,
+37671,36748,36941,35797,35661,34781,35614,35189,
+35406,35721,35470,36441,36391,35919,36644,36333,
+35427,36357,35397,35757,35577,35123,35367,34968,
+35121,36320,35846,36178,35232,35801,34935,34457,
+35356,35427,35701,36159,36148,35425,35762,35355,
+35062,34728,34305,34193,34192,33711,33811,33709,
+33433,33656,33705,33619,33771,34036,34866,35133,
+35006,34187,35067,36678,37511,34212,34625,34203,
+33598,33179,33619,33964,34041,33039,34098,34023,
+33558,32992,32283,32112,33261,33382,33728,32133,
+31340,31062,30865,30351,29754,29239,29150,29016,
+28983,29252,29132,29097,29100,29229,29399,29682,
+29948,30270,30783,31180,31295,31185,31067,30994,
+31679,33237,33085,32594,32295,29799,23594,20330,
+12000,13323,16305,16977,17051,16674,16467,17056,
+15807,17868,17553,17823,18162,19032,25501,25939,
+22194,22510,19017,19891,20231,19525,17927,21282,
+18690,17330,14716,13115,11260,12595,19383,17937,
+16868,18668,20155,21195,25653,27901,31870,28163,
+29347,30334,32538,31742,32779,33258,33836,32949,
+32343,31635,29631,25306,25758,23712,22142,22668,
+24203,21155,20703,22067,20796,18740,15683,12240,
+11637,15002,16418,17839,19266,18486,18621,18591,
+18450,18661,19094,19319,19441,19308,19193,19099,
+18777,19071,19137,18654,18764,18732,18651,18977,
+18819,18889,19141,19143,19247,19002,18976,19428,
+18803,18904,19091,18909,17817,18543,19870,19698,
+20286,20091,20344,20558,20621,20988,21333,21232,
+24156,21644,21423,21682,21587,22290,21991,21895,
+21981,22032,22178,22008,22126,22196,22170,22263,
+22226,22650,22870,23385,24163,24361,24690,25235,
+26160,27069,31878,32280,32027,32715,32816,32908,
+33612,35847,36411,37944,37484,39491,36057,36848,
+36638,37305,36604,36582,35877,35751,36374,37594,
+35681,37183,36211,37977,36771,39718,38080,40476,
+39762,38117,36489,36155,35871,35715,35555,35503,
+35407,35313,35292,35028,35131,35114,34896,35036,
+34748,34618,34504,34866,34596,34560,34579,34784,
+34659,34521,34474,34387,34821,34848,34932,33870,
+33757,33744,33762,33743,33699,33648,33685,33759,
+33898,33942,34083,34147,34017,34135,34107,34241,
+34030,34162,34119,34033,33981,33942,33915,33882,
+33861,33703,33576,33474,33456,33463,33457,33378,
+33300,33192,33170,33211,33113,33087,33011,32936,
+32952,32957,33055,33249,33463,33522,33666,33826,
+33907,33902,34121,34309,34007,34182,34929,34827,
+34749,34824,34854,34518,34809,34204,34428,34307,
+35549,35596,34811,34728,34835,34839,34832,34835,
+34379,34830,34347,34364,33912,34279,34185,33920,
+34147,34002,33486,33889,33881,33954,33436,32799,
+32841,32619,32330,32322,31924,31727,31983,31685,
+31898,31914,32069,28926,25516,23944,22935,22349,
+22007,21497,21573,21083,20795,20509,20490,20181,
+20271,20190,20439,20793,20859,20265,20673,24723,
+23550,22650,22508,22107,22309,22182,21948,21666,
+22806,22266,22270,22586,23316,23816,22704,22335,
+24040,24835,24990,26053,27431,26124,23953,23271,
+22353,22296,21555,22031,21446,21422,21393,21885,
+21042,23779,24232,25406,24592,22558,20679,21923,
+21424,19697,19259,19099,19176,19389,19388,20294,
+23242,26571,31493,31802,31479,30349,29097,29781,
+31275,32415,32576,32970,33524,33704,33276,32958,
+32796,32742,32776,32760,32646,32996,33128,33340,
+33609,33862,33469,33307,33285,33210,33456,33230,
+33213,33000,32886,32904,32898,32904,32917,32991,
+33000,33003,33009,33030,33093,33137,33134,33228,
+33246,33418,33672,33931,33977,34431,33549,33204,
+33217,33237,33245,33320,33220,33246,33294,33254,
+33295,33312,33330,33459,33449,33394,33490,33634,
+33492,33445,33358,33494,33480,33456,33513,33492,
+33490,33467,33441,33435,33401,33358,33347,33446,
+33363,33350,33388,33321,33348,33421,33338,33319,
+33416,33546,33421,33611,33517,33507,33630,33657,
+33627,33703,33652,33639,33713,33491,33284,33422,
+33516,33525,33476,33418,33396,33349,33407,33675,
+33610,33628,33718,33452,33060,33072,33212,33127,
+33305,33291,33197,33146,33305,33463,33188,33372,
+33280,33194,33279,33539,33342,33276,33282,33411,
+33569,33984,34029,34503,34052,33730,33771,34044,
+34005,34001,33891,33848,33846,33781,33787,33765,
+33495,33630,33785,33798,33711,33980,34035,33996,
+33861,33819,33850,33855,33902,34039,34211,34008,
+33861,33861,34050,33809,33855,33735,33616,33540,
+33367,33423,33396,33439,33432,33442,33486,33459,
+33546,33650,33657,33666,33789,33754,34151,35298,
+34448,35106,35604,34997,35334,34775,35226,37158,
+37961,38080,39642,38896,39387,38229,37710,36762,
+35759,37362,36873,36762,35331,35784,36922,37026,
+38998,38820,38969,38685,39396,39641,39524,40007,
+40974,38798,38475,36937,35333,35388,35524,34758,
+34353,34353,34353,34353,36036,36183,34825,35074,
+34839,35298,35615,35209,35289,35882,35857,35958,
+36018,36395,36168,35055,35720,34774,35320,34686,
+35176,35447,35121,35557,35365,35898,35460,35043,
+34715,35595,35673,35553,35619,36407,35998,35878,
+35187,35112,34243,34146,33991,33737,33842,33815,
+33661,33624,33642,33687,33691,33932,35088,35991,
+34880,34945,34878,35406,35606,36439,35346,33690,
+33396,33271,33681,33821,34689,34320,33361,33081,
+33072,33258,32970,32995,33180,33195,33010,31861,
+31401,30449,29718,29087,28912,28617,28968,29152,
+29233,29646,29844,29934,29888,29868,30047,30626,
+30392,30501,30779,31173,31469,31765,31835,31740,
+32328,33603,33846,33207,32248,29717,24045,23712,
+23605,13648,11856,16036,16338,16801,16860,17577,
+16331,19029,17891,18279,21636,22428,25117,24650,
+21477,21677,21174,18855,18209,20092,19803,16485,
+12995,12468,15973,21709,22729,24783,27915,32580,
+26164,22057,32117,31656,32988,31635,30009,30025,
+32701,24507,22968,23095,22995,23085,23492,24753,
+26050,28986,32265,33075,32619,32570,32433,32067,
+32011,31162,31803,28997,25440,24717,23390,22953,
+20463,19362,15254,14066,12588,15513,17034,17780,
+18193,18234,18819,19174,19098,19335,20788,19622,
+19410,19203,19044,18699,18892,19111,19371,19167,
+19425,19113,19278,19598,19446,19649,19058,19689,
+19749,19680,22042,19742,21084,21321,24468,21760,
+21986,20622,21760,20612,20581,21122,21231,21506,
+21628,21954,21658,21481,21595,21711,21864,21929,
+21922,21967,22212,22347,22244,22328,22520,22556,
+22434,22607,23112,23966,24666,24940,24797,24240,
+27066,33021,32442,31773,32453,32524,32416,32996,
+33512,34141,37708,38223,35159,36490,37675,36096,
+36447,36684,36436,35579,35935,37102,36647,35157,
+37214,35994,38761,37511,40677,39981,40314,39116,
+37381,36530,36059,35797,35718,35547,35516,35521,
+35306,35297,35124,35079,35155,34992,34982,34966,
+34938,34511,34446,34631,34749,34657,34749,34670,
+34518,34920,34701,34535,34567,33933,34004,33774,
+33792,33844,33763,33651,33651,33651,33725,33832,
+33915,33946,33990,34050,34178,34119,34055,34143,
+34128,34056,33944,33990,33918,33852,33660,33660,
+33726,33672,33584,33500,33503,33488,33455,33397,
+33315,33202,33144,33087,33013,32988,32946,32936,
+32842,32866,32954,33076,33406,33527,33546,33854,
+33858,33888,33913,34065,34331,34449,34509,34710,
+34833,34965,35376,34872,34737,34836,34843,34731,
+34785,34835,34809,34814,34827,34848,34824,34739,
+34718,34800,34464,33960,34211,33927,33939,33967,
+34032,34011,34279,33917,33940,33966,34062,33697,
+32998,32514,32457,32145,31870,32017,32245,32154,
+32111,31890,28633,25548,24258,22819,22494,21855,
+21471,21218,21017,20679,20590,20624,20363,20511,
+20507,20750,20697,20619,21097,23877,23221,23715,
+22700,22370,22970,21716,22168,22125,22293,21855,
+22269,21933,23790,21626,21198,21306,21048,21716,
+22895,24376,27315,26307,23920,23215,24414,22674,
+22698,21364,21087,21762,21759,21921,22527,22170,
+20991,21177,20543,20626,20037,20862,21581,21377,
+21780,20927,19863,19846,19433,20237,21138,21996,
+23249,28418,31386,31980,31862,31337,30947,30753,
+31891,32564,32641,33600,33444,33904,33444,33467,
+33477,33132,32998,32948,32726,32567,32705,33027,
+34370,34083,33247,33214,33228,33452,33216,33127,
+33163,33207,33133,32963,32880,32886,32915,32919,
+32934,32985,33008,33101,33029,33063,33130,33213,
+33260,33193,33696,33224,33245,33692,33370,33178,
+33231,33155,33117,33105,33131,33135,33320,33206,
+33256,33174,33228,33228,33290,33276,33315,33243,
+33232,33261,33305,33616,33444,33501,33423,33464,
+33450,33469,33460,33476,33420,33380,33364,33406,
+33393,33338,33358,33372,33381,33321,33402,33393,
+33462,33432,33423,33559,33567,33659,33604,33606,
+33726,33626,33530,33597,33640,33418,33486,33510,
+33477,33555,33495,33497,33415,33529,33476,33668,
+33624,33576,33555,33655,33850,33367,33353,33379,
+33173,33151,33298,33130,33382,33209,33537,33480,
+33525,33594,33504,33701,33686,33769,33402,33459,
+33770,33933,34588,34599,34176,33936,34037,33951,
+34062,33851,33735,33853,33705,33681,33624,33610,
+33456,33546,33702,33698,33685,33775,33974,34129,
+33983,33957,34151,34112,33989,34142,34026,33975,
+33795,33633,33620,33472,33440,33358,33331,33268,
+33369,33327,33393,33349,33406,33479,33413,33419,
+33750,33694,33685,33744,33561,33677,33584,33435,
+33606,33531,33629,33730,33798,34418,34244,34344,
+35358,36609,37437,36510,37511,35910,37214,39270,
+37704,37182,36072,36275,37260,38875,38967,37711,
+35802,36582,36687,38417,38899,39554,39639,39127,
+37938,38835,39582,38904,37125,35664,34737,34956,
+34481,34996,35121,34353,34378,34490,35243,35119,
+36190,35631,35882,35143,36196,35853,36390,36119,
+36482,36081,36279,36236,36227,36036,35884,35091,
+34530,34786,34874,34581,35191,35763,35193,35205,
+35487,34315,35239,35229,35660,36189,35531,34845,
+34735,34492,34172,34019,33810,33804,33947,33842,
+33810,33781,33639,33634,33668,34049,33909,34119,
+34494,36331,36360,35644,36804,35057,34530,33820,
+33252,33183,35441,35137,33639,34662,33425,33089,
+33065,34844,33565,33027,33424,33239,32883,32232,
+31900,30636,29683,28981,28601,28722,28983,29362,
+29703,29991,30124,30051,29991,29919,30016,30366,
+30657,31026,31157,31353,31712,31925,32052,32208,
+32820,33105,34647,33835,33396,31956,23811,24084,
+27437,20637,15873,10708,15540,17367,16734,18367,
+18663,18126,19234,22026,22065,21102,21273,20811,
+20298,19092,18109,24123,16819,14086,13257,16338,
+20988,24267,28707,32873,30099,28722,31275,31402,
+31848,29049,26592,28642,29739,29851,31593,32849,
+30759,29837,22222,22021,22172,22043,21943,22024,
+22247,22566,22729,24193,26022,28865,29458,30514,
+31860,32402,32043,32454,32819,32883,32382,27560,
+23249,22724,20901,20364,20557,18289,14657,12650,
+13014,15651,16710,17889,18534,19054,19174,19226,
+19184,19230,19233,18962,19151,19369,19377,19651,
+19958,19754,19554,19470,19290,19649,20209,19448,
+19647,20637,20510,21304,21398,19608,19774,20800,
+20464,20668,20449,20515,20427,20677,20838,21132,
+21390,21226,21480,21516,21546,21828,22018,21997,
+22077,22105,22164,22384,22615,22524,22477,22740,
+22549,23080,23943,24459,24729,24311,25719,28118,
+32997,32681,32721,32323,32417,33147,33081,33381,
+36145,37183,37375,35490,38424,38401,37905,37485,
+36921,36863,36544,35625,36534,38205,38259,37094,
+39305,37097,39220,39807,39353,40404,38425,36736,
+36299,36016,36003,35759,35529,35323,35359,35170,
+35073,34908,34994,34895,34820,34949,34839,34518,
+34720,34646,34342,34410,34569,34605,34489,34529,
+34424,34359,34211,34127,34356,34358,33809,33796,
+33758,33804,33651,33651,33651,33669,33743,33811,
+33897,33916,33916,33916,33914,33907,33917,33912,
+33926,33914,33907,33900,33898,33819,33604,33567,
+33537,33544,33558,33483,33468,33447,33467,33382,
+33312,33204,33081,33019,32971,32956,33003,32859,
+32825,32847,32998,33390,33441,33513,33726,33870,
+33906,33951,34039,34485,34314,34509,34838,34593,
+34753,34650,34644,34827,34783,34924,34986,34908,
+34893,35012,34891,34785,34677,34536,34518,34786,
+34828,34827,34437,34082,34017,33915,33941,33848,
+34050,33993,34110,34131,33963,33882,33474,33364,
+32827,32550,32437,32250,31770,32308,32315,32114,
+31795,27935,25702,24280,22953,22496,21942,21425,
+21146,21234,20829,21026,21056,21021,21015,21287,
+21138,21445,21336,20200,20619,21586,21347,21440,
+21507,21214,21011,21669,22068,21903,22185,21672,
+21946,22972,21027,22978,23184,24049,24234,24151,
+23132,23599,23427,23091,22426,22593,22664,22374,
+21843,21973,21683,21861,22228,22889,22146,22065,
+22341,21461,20962,20853,20925,21837,22257,24640,
+25667,23944,22258,21128,21410,21961,22194,22591,
+23083,26080,31233,32085,32249,31913,31515,31913,
+32478,32602,32661,32727,32820,33276,33375,33915,
+33376,33369,33281,33186,32836,32674,32955,32775,
+34073,33390,33189,33268,33188,33350,33248,33060,
+33003,33210,33018,32978,32905,32886,32908,32922,
+32924,32996,32997,32989,33007,33038,33055,33074,
+33120,33165,33069,33101,33223,33244,33126,33106,
+33076,33084,33120,33234,33014,33138,33126,33141,
+33145,33189,33294,33330,33243,33293,33285,33376,
+33313,33372,33317,33401,33399,33433,33529,33508,
+33515,33588,33535,33473,33492,33506,33420,33386,
+33336,33339,33423,33390,33412,33389,33428,33453,
+33536,33655,33385,33458,33501,33698,33745,33635,
+33736,33669,33725,33657,33634,33518,33563,33362,
+33492,33446,33525,33524,33585,33543,33572,33675,
+33628,33549,33742,33743,33961,33864,33573,33614,
+33450,33308,33372,33462,33327,33396,33258,33609,
+33207,33670,33547,33511,33732,33595,33770,33847,
+34066,33999,34521,34994,34606,34036,34074,34087,
+34083,33885,33794,33779,33683,33552,33593,33664,
+33609,33312,33617,33599,33642,33680,34078,34106,
+34185,34243,34289,34308,34106,34098,33732,33705,
+33742,33542,33242,33228,33269,33368,33385,33336,
+33366,33358,33336,33405,33428,33395,33378,33303,
+33507,33514,33643,33646,33639,33672,33525,33448,
+33609,33676,33753,33796,33720,34089,34341,34605,
+34872,35285,35546,34566,34521,35709,35354,35873,
+36384,36021,37812,37415,37302,36312,36894,35736,
+36559,37074,36711,36752,37479,38196,38426,37522,
+38385,38685,37599,36194,34681,34446,34383,34356,
+34740,34686,35076,35673,35493,34353,34353,34353,
+34796,37156,36173,36516,36243,36450,36195,35883,
+36028,36270,35733,36440,36156,35949,35466,35426,
+35510,35196,35139,35447,35462,34557,35307,35482,
+35093,35040,35711,35041,34755,35058,35217,34692,
+34591,34717,33984,34114,33886,33945,33789,33663,
+33954,33874,33803,33939,33721,33897,34245,34301,
+34751,35184,36240,35550,36138,37591,35820,33816,
+33181,33419,34430,33744,33666,34317,33072,33272,
+33486,34411,32933,32837,33424,33142,33035,32808,
+31677,30362,28946,28462,28200,28700,28885,29169,
+29289,29394,29559,29590,29616,29649,29865,30236,
+30831,31191,31430,31748,31982,32355,32438,32492,
+33057,33762,33697,35098,35472,32073,29397,31097,
+30421,30645,21513,15678,13241,15756,16614,18257,
+20655,23024,23606,23754,21393,19810,18136,19117,
+18288,17688,15088,14801,16955,22265,23230,26520,
+28419,32722,32744,31903,30683,25226,21270,20799,
+21154,21124,21288,21390,22158,24183,27169,28223,
+31188,27416,22002,21608,21780,21523,21705,21800,
+21785,21785,22017,22256,22749,23814,23892,26869,
+27081,26349,25566,28112,31951,29772,32310,32977,
+32790,32767,32548,31328,26668,21806,22084,21312,
+20765,19617,16558,12939,12807,15567,16333,17586,
+18258,18652,18798,19013,19092,19224,19619,19702,
+19707,20028,19701,19496,19530,19434,19401,19703,
+19711,19123,19360,20418,19232,19423,20035,20237,
+20350,20413,20511,20583,20688,20736,21156,21875,
+21410,21411,21410,21426,21516,21714,22019,22120,
+22305,22250,22521,22720,22895,22687,22938,22675,
+29849,24222,24657,24950,24298,28807,32037,33537,
+32925,32907,32550,32734,32929,33486,34347,36733,
+37219,36933,37704,35848,36186,36786,35955,36030,
+35657,36109,35703,35662,36824,37116,38137,38820,
+39178,39751,39449,37638,37526,36927,36353,36247,
+35901,35615,35331,35259,35229,35285,35216,35076,
+35064,35042,34909,35042,34783,34704,34725,35136,
+35297,34864,34512,34411,34308,34374,34233,34221,
+34074,34062,34749,34515,33909,33793,33837,33768,
+33769,33651,33651,33651,33651,33672,33750,33810,
+33900,33949,33921,33918,33897,33912,33905,33860,
+33903,33894,33844,33850,33756,33708,33564,33554,
+33538,33479,33471,33436,33403,33346,33336,33376,
+33308,33181,33096,33003,32985,32986,32906,32842,
+32853,32892,33075,33208,33417,33370,33593,33825,
+33912,33937,33916,33998,34044,34326,34406,34612,
+34470,34440,34731,34827,34833,34791,34839,34822,
+34827,34872,34818,34767,34850,34830,34437,34293,
+33972,33702,33964,33923,33951,33915,33156,33133,
+33916,34343,34329,33906,33453,33939,33421,33222,
+32997,32466,32020,31975,31988,31452,31567,31731,
+27902,25061,23892,22896,22259,21981,21623,21308,
+21327,20884,21438,21046,20816,20901,20917,21553,
+21897,22359,22453,22987,22942,22959,22238,21585,
+21807,22294,22972,23824,24353,23841,23204,24673,
+27064,25631,25645,24751,25209,25524,23766,24300,
+23987,23441,23760,23481,23584,23148,22845,22641,
+22452,21897,21942,22155,22184,22149,22390,21867,
+22106,21534,21093,20907,21477,22824,24450,25975,
+25320,25614,25671,24769,23849,23801,23593,23028,
+23435,24611,29824,32295,32683,32293,31972,32051,
+32418,32565,32642,32715,32995,32976,33183,33228,
+33204,33255,33295,33867,32908,32722,32904,33116,
+33715,33501,33234,33332,33750,33348,33093,33133,
+33028,32914,32923,32910,32910,32922,32916,32916,
+32922,32954,32925,33003,33003,32994,33000,33006,
+33018,33089,33084,33167,33177,33165,33082,33114,
+33320,33215,33210,33154,33112,33057,33145,33273,
+33408,33241,33348,33373,33141,33303,33282,33447,
+33510,33450,33360,33294,33464,33355,33517,33501,
+33564,33348,33381,33611,33590,33543,33561,33480,
+33444,33421,33363,33418,33393,33439,33498,33470,
+33495,33507,33576,33579,33547,33540,33666,33691,
+33579,33563,33762,33756,33564,33630,33564,33453,
+33461,33484,33408,33356,33491,33435,33603,33609,
+33785,33729,33597,33750,33690,33889,33816,33750,
+33444,33437,33247,33278,33192,33189,33362,33368,
+33541,33568,33671,33417,33744,33841,33900,33642,
+33867,34593,35158,34487,34912,34257,34173,34239,
+34157,33866,33735,33672,33627,33570,33556,33587,
+33564,33507,33612,33673,33615,33552,33700,33837,
+33918,33999,33820,33801,33807,33776,33687,33582,
+33486,33236,33183,33345,33355,33393,33332,33311,
+33323,33344,33306,33315,33315,33399,33407,33351,
+33398,33353,33441,33703,33749,33582,33672,33384,
+33663,33818,33797,33657,33901,33747,33808,34491,
+34832,34670,35826,35768,34825,33982,33849,33837,
+34078,34011,34104,35511,35489,36222,36891,36362,
+37443,37905,37832,38820,39181,38069,38334,38048,
+38120,36205,35699,34790,34653,34677,34598,34687,
+34835,35479,35396,35106,35865,35880,34353,34353,
+34353,34957,35808,36099,37407,37419,36654,36090,
+36340,35723,36239,36201,36129,36303,36516,35893,
+35334,35697,36142,35827,34638,35250,34845,35397,
+35116,34342,35243,34910,34935,34735,34365,34151,
+34145,33894,33821,34039,34032,33807,33688,33856,
+34086,34159,33918,33950,33987,34353,34856,35115,
+35249,35460,35360,35502,35796,37176,35547,33813,
+33335,34266,33955,33244,33912,33261,33414,33014,
+33016,33973,33029,32828,33121,33162,32953,32463,
+30858,29229,27724,27876,27773,27953,28487,28927,
+28976,29085,29245,29459,29703,30135,30546,30925,
+31284,31530,32099,32769,32857,32838,32643,32793,
+33129,33474,34398,34392,33918,36252,33134,33015,
+32310,21155,21271,18814,14919,10894,15725,22510,
+23748,23986,23116,21573,20528,18942,17952,17784,
+13800,14475,21979,23494,26841,32046,24907,23937,
+24184,24085,21407,21372,21207,21279,21277,21240,
+21217,21285,21273,21356,21482,23555,23951,25412,
+30056,22990,21304,21600,21442,21370,21462,21732,
+21717,21783,21894,22082,22074,22122,22661,22816,
+23379,25346,27272,25979,26166,28278,28031,28323,
+28917,32635,33396,33599,32686,32561,32661,32213,
+30066,27775,25698,24382,20466,21346,20887,19904,
+16544,14068,15692,16372,18082,18664,18697,18993,
+19335,19737,19675,19437,19080,19077,19042,18523,
+18248,18890,20372,20005,20307,20652,21656,21866,
+22398,20915,20833,20822,20884,20983,21209,22551,
+21560,21462,21071,21387,21195,21742,21974,22458,
+22400,22443,22833,23221,22941,23807,25798,23460,
+23961,24682,24715,24456,26803,32134,33983,32862,
+32937,32945,32670,33400,34031,34942,34314,36911,
+36786,36904,35340,35908,35583,35649,35141,36778,
+35626,35385,34746,35866,35892,36251,37783,37689,
+38280,39030,38184,37154,36594,36180,36033,35582,
+35506,35440,35288,35140,35078,34898,34981,34928,
+34851,34878,34905,34718,35013,34990,35027,35066,
+34781,34695,34658,34803,34552,34504,34423,34257,
+34071,33900,33816,33802,33792,33795,33771,33768,
+33851,33748,33651,33651,33681,33744,33769,33768,
+33819,33808,33722,33729,33762,33792,33815,33756,
+33849,33707,33643,33632,33630,33559,33519,33469,
+33457,33415,33412,33318,33258,33266,33168,33240,
+33269,33225,33174,33008,32909,32892,32900,32888,
+32894,32954,33023,33060,33403,33512,33570,33489,
+33726,33912,33909,33904,34065,34033,34015,34122,
+34309,34380,34755,34730,34704,34659,34593,34767,
+34822,34830,34822,34748,34521,34437,34394,34221,
+34416,34459,34481,34831,34142,33877,33240,33511,
+32703,32676,35009,33914,33572,33209,32995,32963,
+32633,32214,32514,32462,32417,32346,31910,28300,
+25820,24518,23567,22775,22182,21799,21630,21508,
+21324,21422,22156,21988,22073,21976,22094,21995,
+22277,21972,22157,22194,22797,21769,23033,22534,
+22566,23232,23484,24275,24548,25548,24327,26010,
+27612,24882,26739,26087,25044,25032,25070,24679,
+25005,23817,23737,23542,23500,23348,23208,22916,
+22925,21990,22803,22459,22306,22559,25050,22367,
+22205,21426,21327,21479,21747,23378,25766,25747,
+27456,25905,25534,25794,25848,25598,25842,24989,
+24022,23883,24270,29025,31824,32295,31630,31841,
+32088,32372,32589,32808,33384,33146,33291,33227,
+33223,33411,33207,32958,32820,32780,32833,32759,
+32710,32862,33096,33921,33400,33078,33014,33000,
+32938,32904,32910,32908,32904,32896,32901,32901,
+32901,32904,32904,32926,32937,32938,32992,32982,
+32937,33012,33004,33033,33135,33073,33173,33092,
+33084,33036,33095,33021,32988,33080,33120,33308,
+33347,33414,33448,33398,33320,33185,33291,33353,
+33438,33475,33502,33398,33555,33392,33396,33439,
+33391,33415,33453,33587,33438,33637,33625,33606,
+33491,33456,33492,33468,33393,33461,33502,33501,
+33593,33573,33604,33594,33591,33562,33541,33702,
+33618,33736,33560,33698,33687,33515,33591,33388,
+33465,33477,33468,33359,33449,33437,33652,33472,
+33633,33636,33558,33822,33747,33801,33834,33526,
+33585,33420,33147,33495,33162,33213,33343,33429,
+33291,33341,33843,33624,33938,33561,33871,33594,
+33531,34476,34542,35056,34990,34475,34155,34121,
+34166,33875,33741,33672,33591,33537,33516,33354,
+33516,33291,33528,33583,33527,33486,33396,33504,
+33561,33631,33579,33536,33420,33342,33405,33239,
+33385,33288,33242,33378,33335,33333,33339,33295,
+33369,33350,33352,33332,33351,33390,33540,33453,
+33548,33701,33555,33348,33408,33506,33453,33553,
+33735,33586,33806,33975,34380,34136,33714,33723,
+33960,35339,36994,35904,35345,34343,33778,33974,
+34151,34037,34655,35866,35266,34671,35346,37148,
+36357,38215,37831,38163,36369,36142,36431,36129,
+35485,34715,34601,34466,34558,34263,34203,35008,
+35338,35697,35652,35567,34989,35321,36055,34590,
+34353,35665,35346,35450,35024,38755,37388,36522,
+36612,36822,36097,36569,35731,35896,36696,35901,
+36153,35457,36915,36549,36057,35270,35835,34902,
+34692,34822,34518,34511,34617,34069,34113,34176,
+34780,34311,34182,34023,33909,33894,33661,34397,
+34803,34305,34731,34902,35357,35339,36098,34914,
+34575,33854,34293,34692,36556,37400,34998,34319,
+34043,33026,34120,32761,32985,33785,33339,33633,
+33086,32829,32375,32235,32569,33003,32814,32270,
+31089,28767,28191,27780,28012,28377,28739,29089,
+28866,28980,29508,29773,30401,31027,31296,31474,
+31527,31467,31583,32099,32441,32632,32532,32793,
+33363,34498,35863,36074,35851,34645,33501,33029,
+32282,27346,22433,22316,21853,16627,16945,22602,
+22701,21890,20279,19689,19125,16972,13372,14810,
+21816,22215,21492,28569,23413,22453,24268,21280,
+21275,21273,21264,21246,21243,21177,21259,21261,
+21214,21248,21272,21320,21957,25206,24382,29946,
+24735,21647,21567,21618,21618,21608,21701,21764,
+21776,21906,21938,21997,22042,21988,22309,22757,
+23048,23270,27039,27468,27394,25076,26194,27619,
+29448,28708,29315,31172,32757,32688,32910,32731,
+32685,32797,32796,32802,32770,30957,31461,30594,
+28666,26459,26454,22960,20601,17733,15772,16502,
+17754,17721,18247,19191,19469,19905,20025,20335,
+20346,20304,22490,21699,25515,25681,22374,23842,
+20752,20275,21739,20681,20586,20460,20482,21120,
+21097,21549,21447,21715,21408,21789,22027,22560,
+22806,22803,23295,23290,23543,23640,23651,24753,
+24591,24434,24814,25971,32093,31808,32298,32548,
+32550,32931,32909,33672,33819,35438,35003,34835,
+37253,35690,36021,36541,35587,36083,36369,35017,
+35454,35297,35002,34986,35472,36965,37296,37596,
+37490,36953,36377,36891,36464,35995,35897,35330,
+35500,35166,35079,34944,34890,34992,34992,35035,
+34827,34817,34716,34704,34617,34607,34482,34463,
+34421,34473,34551,34730,34461,34787,34952,34260,
+34152,34020,33872,33828,33794,33914,33768,33774,
+33840,33713,33637,33648,33696,33694,33653,33669,
+33666,33624,33557,33661,33630,33630,33594,33675,
+33609,33571,33530,33492,33466,33457,33404,33396,
+33399,33281,33372,33446,33138,33360,33401,33436,
+33336,33189,33058,32988,32876,32853,32864,32857,
+32878,33012,33162,33451,33510,33582,33615,33681,
+33908,33877,33945,34005,34159,34086,34139,34075,
+34406,34761,34782,34784,34581,34738,34793,34813,
+34816,34824,34827,34707,34473,34419,34416,34416,
+34416,34416,33937,33935,33933,33996,33767,33915,
+33847,33816,33416,32974,32928,32989,32759,32594,
+32264,32542,32467,32406,32354,31881,29100,25836,
+24477,23862,23351,22759,22284,21921,21657,21558,
+21912,22482,22192,22912,22750,22361,21726,21783,
+22174,22586,22760,22800,22498,22798,22810,23441,
+23602,24380,24886,24338,24683,25144,24375,26217,
+27969,27699,26541,26184,25398,24813,24608,24683,
+25143,24023,23904,23842,23625,23682,24180,23760,
+23514,23058,22835,22080,24605,24022,23448,22836,
+25808,22050,21765,22068,22533,24302,24451,25656,
+29199,28783,28299,27026,26304,25701,25860,25427,
+24978,24654,24856,24227,23655,24067,25039,26844,
+29285,31950,32427,32733,33183,33021,33282,33222,
+33473,33242,33453,33270,32952,32770,32919,32938,
+32688,33001,33189,34440,33462,33397,33201,32883,
+32937,32907,32889,32899,32910,32884,32892,32886,
+32886,32886,32886,32886,32888,32892,32888,32903,
+32928,32920,33042,33040,33084,33305,32873,32938,
+32997,33052,33000,32952,32978,32925,32880,32964,
+33051,33181,33360,33570,33665,33032,33040,33143,
+33295,33192,33183,33423,33732,33737,33493,33447,
+33403,33504,33568,33596,33587,33619,33648,33755,
+33537,33507,33549,33536,33443,33531,33584,33573,
+33556,33600,33640,33612,33645,33718,33690,33691,
+33510,33774,33607,33687,33619,33532,33426,33476,
+33381,33411,33482,33438,33510,33362,33423,33475,
+33640,33691,33504,33543,33370,33684,33672,33509,
+33359,33304,33384,33219,33339,33456,33547,33571,
+33812,33895,33837,33777,34089,33588,33680,33612,
+33496,33701,34559,34899,35505,34981,34461,34086,
+33982,33810,33597,33647,33561,33557,33447,33463,
+33465,33345,33503,33474,33509,33473,33450,33411,
+33398,33380,33363,33434,33374,33364,33373,33369,
+33346,33363,33339,33369,33373,33336,33307,33300,
+33279,33273,33321,33318,33293,33273,33408,33491,
+33456,33605,33600,33501,33583,33870,33789,33797,
+33840,33915,34169,34023,33854,33897,33951,33816,
+35854,35508,35955,35503,35330,34732,34092,34664,
+34341,34106,34373,34936,35628,36652,37030,37970,
+38479,37829,37870,36377,36525,35296,35648,34713,
+34660,34506,34562,34585,34599,34804,34548,34659,
+35472,35439,35721,35887,35262,35700,35773,36018,
+37452,34350,34350,37117,34472,35666,38172,37021,
+36969,37281,36268,36160,35686,36129,35364,36357,
+35770,35362,35313,36726,35618,36219,36321,35458,
+35908,35529,35625,35478,35190,35177,34342,34367,
+34676,34458,35134,35493,35488,35352,35065,33922,
+34077,34078,34108,34210,34245,34355,34515,34563,
+34089,33596,33336,33312,33714,35265,34568,33446,
+34152,33308,32975,32882,32803,33441,32759,33372,
+32632,32553,31706,31317,31872,33423,31294,32517,
+30516,28759,28512,28466,28197,28791,29463,29976,
+30398,30432,30433,30354,30736,31587,31892,31920,
+31765,31692,31596,31635,32095,32340,32414,32933,
+33385,34176,35990,36394,34466,35825,34510,34166,
+32922,32405,30237,25004,26197,22803,17843,17197,
+18426,19250,19200,16295,13918,15381,26274,25109,
+25608,30034,24126,21785,21609,21617,22150,21320,
+21354,21333,21147,21224,23802,24459,21342,21249,
+21266,21384,21297,20708,24333,25857,29382,32724,
+21648,21555,21555,21598,21667,21647,21684,21788,
+21822,21942,22030,22082,22224,22186,22317,22326,
+22659,22899,25425,27302,26245,27114,26925,27644,
+30005,31630,32110,32270,32274,32554,32871,34070,
+35229,33344,32855,32988,32992,32775,32727,32841,
+32583,32831,32736,32339,30369,28661,26918,23188,
+21724,17799,16835,18795,19794,20354,19840,19517,
+20940,21676,21889,26768,22635,21339,20694,20466,
+20214,20396,20502,20668,20760,20846,20853,20976,
+21183,21588,21580,21803,22110,22200,22472,22883,
+23430,23728,23863,23769,23794,24103,23992,24605,
+24762,24630,26934,28488,32427,32355,33070,33041,
+32010,32523,32974,33509,35699,36069,35759,34990,
+37086,36254,36786,36100,35432,35906,37824,35409,
+35645,35772,35952,35820,37103,36743,37477,36522,
+35954,35559,35505,35482,35219,35069,35356,35843,
+36742,36115,35291,34784,35064,34792,34847,34719,
+34833,34931,34916,34857,34893,34948,35222,34470,
+34371,34377,34437,34713,34482,34408,34475,34860,
+34067,34010,33992,33940,33912,33918,33913,33859,
+33794,33729,33654,33575,33580,33618,33642,33580,
+33558,33549,33542,33543,33543,33499,33534,33521,
+33461,33467,33457,33404,33404,33378,33399,33375,
+33300,33223,33199,33165,33083,33258,33252,33229,
+33170,33249,33141,32977,32914,32853,32715,32663,
+32994,33007,33117,33177,33450,33519,33810,33776,
+33906,33926,34026,33978,34089,34093,34128,34214,
+34185,34437,34650,34716,34641,34623,34824,34795,
+34635,34824,34779,34742,34829,34418,34601,34734,
+34456,34713,33934,34091,34589,33809,33414,33262,
+33306,33384,33361,33303,32995,32927,32543,31575,
+32172,32391,32376,32262,31984,31057,29037,26690,
+25075,24078,23339,22683,22347,21979,21812,21654,
+22029,22385,23237,22815,22699,22953,22714,22559,
+22740,23050,22924,22850,22504,23547,23556,23867,
+24386,24549,24280,24380,25004,25536,25212,26740,
+26868,26844,28209,27368,25147,25158,24891,24954,
+25286,24855,24135,24115,23763,23726,24024,24440,
+24113,23605,23289,22539,22519,26406,23969,23952,
+24209,24040,23055,25197,24080,23805,24826,26132,
+28500,28736,29344,29735,29388,28564,25584,26217,
+26121,25656,24854,24685,24253,24291,24235,24310,
+24304,25091,27553,32684,32720,32706,32864,33598,
+33450,33564,33765,33195,33041,32493,32958,32964,
+32814,33588,33429,34577,33464,32942,32770,32799,
+32802,32817,32877,32913,32913,32926,32898,32874,
+32868,32874,32874,32874,32874,32887,32910,32940,
+32934,33001,33072,33105,32941,32946,33001,33019,
+32901,32916,32972,32991,32808,32736,32778,32751,
+32834,32818,32928,33221,33213,32942,32714,32887,
+33033,33062,33091,33114,33168,33177,33209,33279,
+33373,33511,33435,33803,33429,33500,33532,33595,
+33546,33513,33450,33606,33564,33497,33511,33603,
+33516,33602,33723,33501,33588,33646,33533,33415,
+33627,33600,33558,33645,33546,33511,33449,33309,
+33363,33301,33435,33291,33423,33313,33412,33474,
+33522,33473,33327,33538,33552,33320,33594,33489,
+33278,33396,33354,33458,33497,33267,33473,33322,
+33877,33756,33798,33710,33840,33508,33543,33468,
+33410,33302,33818,34993,34774,34513,34980,34389,
+34143,33849,33756,33688,33578,33575,33570,33543,
+33481,33354,33579,33482,33450,33478,33414,33418,
+33441,33422,33443,33411,33386,33390,33368,33288,
+33347,33309,33297,33348,33368,33321,33328,33305,
+33305,33293,33285,33318,33334,33315,33352,33381,
+33402,33430,33537,33574,33487,33309,33456,33522,
+34092,34073,33781,33597,33786,33819,34204,34236,
+35766,36104,34570,34183,34297,34329,34746,34724,
+35074,35487,35420,36201,35594,36138,35978,36327,
+35178,35878,35359,36234,35854,35580,34320,34564,
+34705,34518,34769,34602,34604,34699,34696,34840,
+35275,34916,34940,35205,35444,35552,35101,35490,
+35637,36334,34350,36197,37611,35208,35239,38384,
+36625,37050,37392,36710,36674,35922,35509,35477,
+35997,35427,35463,36149,36269,35274,34996,35226,
+35091,35442,34875,35262,35387,36035,35433,35448,
+35269,35444,34689,34668,34798,34361,34243,34246,
+34122,34094,34044,34302,34425,34864,35841,36264,
+35156,35694,36324,36091,33636,33343,33003,32693,
+32667,32955,32890,34077,32986,32804,32951,32571,
+32676,32055,31842,31554,31403,31822,30787,31464,
+30020,29235,28968,29654,28933,30441,30599,30484,
+31107,31193,31380,31524,31780,32076,32085,31992,
+31991,31911,31705,31495,31821,32103,32439,33075,
+33485,33751,36893,35039,33887,33431,35326,35286,
+34207,33880,33554,35805,32668,22672,20165,15741,
+16860,19814,14853,14166,27930,32850,32229,32494,
+23211,24033,23118,22855,24555,21988,21366,21329,
+21355,21387,21352,21289,21368,21360,21291,21873,
+31076,30092,28718,26435,28992,31887,30054,22929,
+21499,21408,21594,21577,21659,21693,21723,21782,
+21865,21948,22102,22261,22384,22368,22519,22602,
+23193,23615,23896,23351,26049,26181,26775,28153,
+32180,32551,32586,32607,32633,32661,32685,32757,
+32839,32892,33036,34316,32760,32966,33183,32845,
+32907,32556,32442,32572,32739,32736,32595,32251,
+30602,27246,24448,20122,16738,17038,18870,19918,
+20261,20615,20404,20227,20218,20356,20321,20297,
+20328,20467,20552,20834,21411,20887,21196,21294,
+21648,21598,22157,22044,22270,22407,22461,25129,
+23225,23238,23634,23925,24084,24510,24229,24474,
+25105,25715,27797,30803,32686,33091,33690,32997,
+33016,33267,33951,34511,34461,34960,36487,36747,
+34001,37764,36438,35873,35415,35652,36195,35623,
+35754,35199,36004,36783,36136,36474,36295,35752,
+35402,35441,35051,34791,35246,34991,35346,34971,
+35377,35442,34908,34752,34839,34782,34836,34854,
+34933,34985,35107,35188,34938,34886,34545,34347,
+34278,34381,34287,34208,34176,34156,34089,34126,
+34098,34013,33928,34072,33918,33923,33903,33905,
+33914,33854,33744,33618,33552,33562,33669,33691,
+33570,33494,33482,33504,33555,33460,33407,33388,
+33379,33391,33374,33364,33334,33362,33229,33164,
+33274,33364,33389,33207,33062,33005,32977,33004,
+33003,32991,32980,32955,32856,32769,32711,32745,
+32840,32873,32896,32901,33271,33455,33462,33897,
+33910,33912,33924,33945,34158,34260,34280,34312,
+34289,34378,34582,34425,34593,34254,34599,34116,
+34386,34492,34700,34827,34626,34314,34381,34161,
+34029,34668,34835,34617,33940,33458,33429,32998,
+33012,32997,32673,32349,32554,32379,32479,32441,
+32190,31096,29263,28130,26442,24551,23821,23763,
+23694,23889,23357,22711,22222,21983,21635,21987,
+21992,22790,22866,23229,22735,22644,22864,22851,
+22967,22977,22806,22455,22572,23190,23301,24019,
+23708,24058,24410,23975,24993,25494,25980,26285,
+27004,26121,27278,27205,25753,26004,25688,25616,
+24829,24471,25092,23847,23952,23724,23624,24399,
+24159,23414,22759,23467,22812,24156,24168,24434,
+24736,24010,24180,24264,24410,24853,25162,27474,
+28611,28603,29064,29452,30597,30408,30192,28729,
+27548,25693,25962,25019,24724,24498,24292,24156,
+24516,24849,25290,28359,32598,32697,32726,32955,
+32997,33375,32860,32991,32648,32893,33469,34070,
+33396,33673,33700,33654,33332,32757,32644,32827,
+32826,32799,32834,32865,32898,32916,32916,32889,
+32869,32868,32862,32862,32862,32889,32934,32921,
+32911,33032,33125,32943,33089,33080,32976,33055,
+33009,32960,32972,32887,32919,33042,32836,32699,
+32737,32745,32710,32767,32777,32734,32742,32773,
+32876,32953,32955,33081,33110,33168,33323,33211,
+33259,33241,33456,33459,33615,33398,33393,33502,
+33518,33408,33407,33447,33486,33563,33513,33583,
+33757,33681,33674,33737,33661,33585,33724,33658,
+33537,33571,33639,33603,33407,33386,33420,33404,
+33348,33317,33429,33405,33402,33480,33531,33484,
+33628,33573,33571,33575,33321,33467,33479,33495,
+33448,33392,33226,33228,33341,33523,33339,33615,
+33516,33464,33518,33408,33579,33606,33345,33234,
+33552,33498,34234,34227,34224,34113,34621,34656,
+34063,33906,33764,33594,33517,33510,33517,33512,
+33440,33358,33344,33484,33435,33352,33418,33435,
+33392,33408,33327,33431,33401,33387,33363,33350,
+33351,33305,33325,33357,33373,33351,33307,33308,
+33309,33336,33315,33333,33360,33385,33411,33432,
+33399,33418,33447,33512,33422,33265,33609,33579,
+33536,33437,33691,33805,33435,33538,34093,35207,
+35228,35371,34322,34415,34264,34224,33945,34116,
+33711,34323,34473,34695,34837,34464,34215,33991,
+34377,34563,34944,35004,34776,34143,34381,34494,
+34439,34260,34638,34457,34212,34635,34641,34630,
+34944,35151,35440,35889,35879,35484,35248,34623,
+35301,38124,34350,34351,38688,39398,36135,37534,
+36369,36706,36163,36954,37138,36994,37424,35892,
+35784,35676,35374,36062,36336,35568,35704,35361,
+35449,35521,35260,35241,35307,34716,34742,35946,
+35389,34803,35040,35078,35223,34682,34537,34676,
+34422,34854,34846,35130,35772,35775,36217,36132,
+36488,36306,36430,35736,35427,34007,33966,33963,
+32427,32572,32676,32850,32445,32748,32409,32815,
+32436,31954,31856,31656,31602,31585,31426,30948,
+30384,30660,30586,31658,31026,30883,31378,31368,
+31560,31835,31966,32075,32097,32142,32106,32304,
+32082,31869,31596,31374,31304,31951,32736,33087,
+33416,33839,35767,36252,35284,33645,33284,33828,
+34466,35715,35881,33121,27292,20208,20964,19396,
+15791,17484,22482,32886,32935,31374,23358,23769,
+23823,22357,21420,21161,23427,22041,21517,21395,
+21403,21363,21364,21381,21387,21259,21419,21407,
+21366,22031,23265,25562,23057,21207,21508,21498,
+21571,21628,21627,21687,21601,21743,21782,21834,
+21962,21978,22191,22346,22587,22809,23059,23091,
+23184,24347,23746,27312,25946,25698,32341,32578,
+32598,32591,32610,32617,32651,32685,32713,32718,
+32723,32754,32838,32886,33114,33637,33213,34767,
+32373,32952,32787,32988,32516,32662,32378,32263,
+32814,32613,29833,31238,28531,22332,18571,16935,
+16924,17946,18588,19029,19433,19344,20105,20476,
+20229,20446,20424,20553,21003,21015,21166,21162,
+21580,21803,22224,22637,28663,22423,22351,22635,
+22610,23100,23907,24120,24550,24985,24799,24882,
+25641,30591,32390,32766,32939,33453,33199,32807,
+32947,34416,34167,34644,37050,35157,34777,36345,
+35403,35487,37944,35617,36470,37482,36292,37315,
+34960,37356,37427,36102,36321,34818,35372,35141,
+35361,35450,34866,34771,34666,34741,35009,35136,
+35180,35048,35055,35006,34893,34757,34672,34894,
+35049,34726,34746,34756,34722,34479,34347,34327,
+34261,34335,34155,34199,34227,34164,34282,34214,
+34375,34126,33935,33915,33838,33856,33832,33915,
+33911,33784,33885,33818,33605,33577,33571,33648,
+33690,33540,33456,33398,33365,33473,33484,33288,
+33219,33342,33397,33426,33453,33383,33267,33150,
+33068,33072,33040,32981,32923,32884,32804,32817,
+32814,32864,32883,32774,32724,32670,32699,32967,
+32988,32969,32934,32811,32887,32932,33528,33691,
+33702,33793,33834,33912,33926,33993,34098,34323,
+34475,34091,34230,34683,34672,34104,33945,33620,
+34634,34353,34228,34335,34559,34453,34138,34242,
+34823,34700,34017,34597,33905,33630,33081,32997,
+32731,31772,31167,32254,32541,32305,28161,25777,
+25549,24878,24575,24262,23801,23814,23423,23065,
+22611,22583,22245,22096,21956,21620,22113,22392,
+22362,22677,23124,23308,23376,23383,22968,23129,
+22898,22929,22717,23476,23418,22946,23498,23587,
+23418,23433,23437,23910,24720,25309,26412,26546,
+26745,28053,27083,27679,29038,26165,26000,25485,
+25431,24858,24543,23947,24029,24187,24456,24448,
+24733,24420,24070,23257,23304,23233,23898,25191,
+26439,26924,27355,27874,28305,28730,27331,28265,
+27882,28164,28441,28863,29565,30829,32052,31767,
+31734,31329,29365,26340,25213,24847,24558,24252,
+24476,25138,25418,25803,27375,32438,32702,32665,
+32705,32814,32849,33149,32957,32985,33290,33663,
+33630,33883,33707,33199,32931,32792,32796,32790,
+32796,32841,32772,32772,32778,32797,32826,32855,
+32889,32871,32857,32862,32872,32892,32905,32904,
+33033,33075,33280,33193,32979,32978,32997,33000,
+33068,32967,33157,33285,32899,32868,32886,32854,
+32796,32865,32907,32814,32753,32667,32757,32762,
+32797,32864,33069,33338,33540,33391,33400,33296,
+33159,33272,33298,33352,33463,33458,33456,33419,
+33363,33408,33492,33529,33551,33444,33533,33579,
+33629,33618,33750,33701,33581,33582,33720,33588,
+33633,33498,33477,33458,33446,33393,33395,33390,
+33382,33441,33505,33378,33340,33498,33429,33534,
+33545,33459,33411,33406,33558,33561,33464,33450,
+33469,33559,33340,33343,33435,33405,33447,33366,
+33253,33500,33277,33491,33219,33257,33341,33517,
+33586,33732,33973,34241,33858,33854,34104,34417,
+34321,33695,33620,33486,33512,33520,33450,33462,
+33453,33420,33384,33333,33386,33405,33413,33421,
+33366,33391,33229,33397,33396,33365,33360,33351,
+33357,33336,33287,33264,33273,33388,33323,33336,
+33360,33342,33337,33358,33357,33366,33348,33371,
+33380,33414,33458,33476,33387,33396,33284,33294,
+33476,33590,33702,33724,33649,33807,33972,33589,
+33699,33947,33816,33996,33959,34176,34975,34985,
+34676,34177,34361,34101,34185,34006,34021,33730,
+34221,34424,34284,34181,34086,34031,34235,34029,
+34488,34661,34570,34287,34482,34600,34514,35007,
+34466,34947,35460,34297,35104,36348,35544,34440,
+34551,36135,35438,34350,35690,36687,36319,36270,
+36810,37583,36215,37874,38433,36644,37153,34844,
+35855,36774,36541,37127,37137,37522,36829,35357,
+35775,35481,34976,35145,34993,34562,36045,35314,
+35799,35376,35349,35595,35840,36078,35822,35932,
+36679,35606,36732,36631,38079,37342,38096,37367,
+37131,36324,36531,37179,36845,35874,36249,35139,
+34058,34281,32465,32304,32670,32739,32116,32295,
+32199,32129,32249,32707,31774,31554,31353,31030,
+31346,32526,32418,32417,31900,32081,31989,32037,
+32219,32277,32306,32236,32154,32294,32247,32118,
+31912,31660,31300,31145,31479,32250,32793,33042,
+33300,33675,34687,38684,36088,36739,33430,33143,
+36333,35622,35874,33567,31320,26887,28304,26181,
+19836,21413,24812,23117,21868,21401,20900,21332,
+20418,21272,21167,22023,24434,24157,22412,21568,
+21564,21470,21454,21443,21447,21411,21390,21186,
+21448,21470,21444,21573,21526,21515,21509,21531,
+21589,21633,21649,21708,21774,21782,21907,21933,
+22065,22234,22494,22637,23358,23760,25415,26469,
+24612,31260,32524,32497,32276,32028,32012,32509,
+32602,32634,32657,32685,32721,32728,32734,32736,
+32744,32749,32778,32782,32801,32854,32902,33126,
+33759,36530,33575,32772,32865,32606,32895,32331,
+32735,32885,32842,32677,32588,31501,30075,24029,
+20117,17574,17255,17596,18814,19275,19868,20601,
+20826,20908,20967,21237,21685,28475,21334,21493,
+21358,21840,27888,22791,22061,22053,22134,22422,
+22743,23258,23521,23990,24717,25271,25838,25573,
+28564,32327,33180,32852,32235,33782,32919,33813,
+33263,34785,36139,38367,37626,36517,34266,36724,
+37038,36531,37895,36945,38559,36663,37460,35096,
+37787,37562,37239,35760,35079,34845,35010,34835,
+34810,34978,34955,35038,34956,34540,34964,35124,
+34973,34842,34821,34736,34661,34879,34661,34650,
+34802,35144,34461,34399,34407,34283,34368,34271,
+34260,34390,34371,34704,34392,34371,34438,34368,
+34398,34143,34086,34066,33966,33942,33829,33933,
+33848,33894,33896,33781,33771,33685,33586,33543,
+33524,33430,33458,33344,33241,33159,33105,33267,
+33261,33450,33457,33417,33233,33210,33110,33024,
+32978,32904,32912,32873,32759,32670,32598,32583,
+32706,32769,32754,32737,32661,32600,32609,32754,
+32972,33069,33003,32929,32964,32865,32970,33469,
+33675,33742,33711,33825,33922,34035,34043,34307,
+34076,33984,34064,34236,34057,33607,33700,33841,
+33919,33979,34088,34092,34357,34655,33963,34326,
+34153,34126,34191,33792,33034,32988,32994,32732,
+31782,32421,32077,31893,31977,28828,26238,25141,
+24623,24127,23716,23304,23056,22770,22545,22389,
+22199,22131,22074,22058,21834,21882,21833,22121,
+22216,22371,22465,22584,22759,22472,22892,22939,
+22662,22743,22930,22479,22764,23457,23924,24199,
+23225,23416,23668,24224,24782,25572,25956,25491,
+26718,28053,28789,28079,27671,26925,26494,26577,
+26157,25348,24645,24462,24596,24596,24792,24898,
+24737,24766,24261,23766,23539,23505,23244,23516,
+24942,25993,26285,28566,28479,28008,28747,28730,
+28689,28653,28944,28923,28993,30564,31560,31474,
+32021,32345,32327,29901,26554,25606,25213,25184,
+25077,25682,25931,26751,27999,30779,32492,32144,
+32772,32766,32766,32971,32961,34080,33309,33442,
+33988,33579,33083,32868,32730,32724,32792,32790,
+32760,32726,32724,32724,32762,32792,32784,32787,
+32813,32862,32861,32865,32874,32888,32910,32907,
+33022,33130,33206,33156,33054,33004,32983,32988,
+32973,32905,33372,33225,33277,33168,33101,33169,
+32874,32852,32923,32918,32908,32661,32604,32760,
+32832,32903,33126,33285,33275,33249,33256,33186,
+33159,33174,33271,33383,33288,33447,33504,33561,
+33412,33468,33487,33534,33489,33429,33464,33593,
+33616,33591,33684,33708,33639,33541,33574,33436,
+33665,33658,33662,33663,33708,33471,33580,33498,
+33516,33362,33370,33358,33371,33258,33321,33255,
+33261,33277,33298,33271,33338,33183,33321,33255,
+33360,33290,33360,33525,33636,33543,33192,33472,
+33631,33517,33253,33377,33239,33363,33483,33546,
+33355,33643,33908,34099,33930,33930,33909,34180,
+34180,33832,33678,33515,33446,33297,33385,33440,
+33401,33263,33411,33183,33364,33413,33406,33403,
+33366,33358,33396,33378,33206,33341,33304,33288,
+33302,33324,33285,33310,33321,33222,33381,33378,
+33348,33330,33332,33333,33388,33395,33369,33375,
+33414,33410,33446,33441,33444,33362,33357,33344,
+33410,33356,33561,33556,33544,33604,33588,33402,
+33660,33818,33831,33822,33594,33900,34044,33978,
+33954,33810,33660,34211,34204,34393,33692,33700,
+33951,33771,33781,34073,33716,34077,33765,34031,
+34324,34503,34354,34203,34347,34232,34616,34740,
+34657,34961,34746,35346,35370,35253,34823,34286,
+35176,37026,37281,36371,37908,36851,39462,34492,
+34658,35396,37936,36459,37630,36519,35106,34638,
+36108,36459,37206,37136,38129,38100,37931,36582,
+37714,35648,35136,35623,35555,35658,36009,36623,
+36865,35648,35354,35571,35601,35468,37067,36573,
+35976,35379,36617,35553,35847,35933,35843,36288,
+36573,37430,34930,35814,35817,36416,35089,35397,
+35838,35688,34275,33732,32544,31858,32565,32345,
+31854,32185,32239,32157,31887,31992,32142,32403,
+32252,32268,32443,32364,32355,32395,32382,32408,
+32449,32525,32530,32441,32391,32428,32082,31812,
+31619,31352,30987,30100,31694,32205,32286,32971,
+33110,33182,33734,34272,36254,35260,36158,33638,
+34665,34977,33029,33561,33005,33295,33835,28995,
+23231,22018,22502,22044,20958,21483,21429,21397,
+21339,21273,21390,22970,25911,26353,25224,21833,
+21603,21680,21561,21516,21549,21486,21493,21468,
+21532,21480,21396,21512,21473,21513,21534,21561,
+21633,21666,21723,21794,21849,21918,22016,22141,
+22098,22484,23399,23655,28010,32403,32729,32866,
+32731,32824,32574,32685,32757,32715,32703,32688,
+32713,32731,32752,32764,32769,32778,32777,32781,
+32786,32787,32799,32801,32774,32765,32812,32745,
+32819,32984,33024,33222,33509,32885,32709,32461,
+32187,32524,32649,32910,32936,32596,32798,32679,
+32135,28436,25904,22773,18126,19075,19680,19987,
+20464,20542,21056,21023,20982,21407,21541,21556,
+21822,22809,22401,21898,22222,22422,22535,22617,
+22664,22938,23127,23857,24704,26207,26514,27906,
+32337,32997,33819,33732,32994,33061,32959,34443,
+33866,33749,35618,37139,36021,37132,37047,37109,
+37083,37650,37380,37947,37221,36238,35281,37962,
+37718,37083,35619,35443,35508,35245,35077,35232,
+36126,35927,35688,35309,34913,34014,34919,35076,
+34996,34534,35171,35185,34556,34537,34438,34465,
+34386,34172,34082,34170,34261,34345,34271,34351,
+34406,34386,34646,34472,34661,34560,34372,34165,
+34150,34283,34011,34007,34048,34053,33912,33838,
+33775,33807,33792,33825,33819,33798,33707,33603,
+33527,33465,33517,33255,33116,33108,33050,33072,
+33099,33159,33099,33088,33034,33015,33003,32838,
+32825,32818,32835,32799,32748,32663,32569,32513,
+32542,32631,32659,32685,32625,32571,32537,32826,
+32882,32806,32977,32853,32853,32845,32733,33672,
+33523,33734,33865,33784,33871,33909,34064,33858,
+34003,33837,33952,33936,33954,33702,33629,33520,
+33826,33907,33941,33902,34022,34245,34128,34805,
+34386,34590,33813,33598,33133,32997,32825,31796,
+32645,32569,32142,29587,27447,27035,25773,25137,
+24492,23998,23602,23229,23085,22872,22580,22277,
+22368,22263,22195,22176,22000,22060,22079,22107,
+22197,22294,22061,22526,22275,22404,22419,23667,
+22852,22818,22920,22697,22935,23139,23739,23351,
+23410,23493,24471,24333,25182,25740,25694,25639,
+25536,25317,25491,25307,26554,26657,26320,26958,
+26110,26127,26017,25596,25065,24210,24339,24638,
+24494,24759,24893,24684,24389,23924,23945,23774,
+23787,23681,24825,26305,26509,27440,28099,28877,
+29526,28725,29086,29086,29018,30625,30927,30283,
+31078,31854,32881,32345,31209,27345,26262,26218,
+25882,25643,25866,26673,28126,29064,32647,32671,
+32841,32334,32767,32956,33172,33117,34476,34210,
+34147,33983,33223,32873,32727,32752,32811,32797,
+32682,32730,32722,32728,32745,32804,32802,32823,
+32835,32858,32861,32869,32863,32882,32922,32905,
+32991,33048,33060,33172,33009,32988,32972,32958,
+32875,33186,33549,33407,33424,33458,33449,33357,
+33017,32999,32747,32781,32939,32868,32550,32554,
+32580,32782,33126,33251,33257,33369,33168,33047,
+33075,33142,33262,33483,33333,33282,33341,33282,
+33329,33267,33609,33659,33251,33246,33332,33595,
+33678,33675,33731,33699,33736,33545,33460,33444,
+33394,33371,33353,33394,33395,33473,33455,33393,
+33361,33375,33342,33349,33281,33370,33261,33405,
+33336,33389,33361,33293,33389,33360,33255,33288,
+33449,33522,33489,33423,33340,33416,33398,33363,
+33479,33424,33444,33293,33363,33469,33637,33612,
+33727,33667,33950,33719,33996,33901,34324,34151,
+33917,33661,33687,33599,33458,33468,33470,33339,
+33373,33351,33309,33230,33164,33289,33384,33387,
+33315,33328,33354,33290,33267,33337,33342,33332,
+33306,33336,33303,33246,33220,33336,33429,33428,
+33419,33396,33347,33338,33352,33379,33418,33431,
+33411,33417,33403,33391,33355,33345,33325,33321,
+33220,33238,33498,33504,33504,33414,33521,33531,
+33575,33601,33607,33663,33727,33669,33768,33786,
+33842,33781,33586,33733,34305,33860,33734,33822,
+33863,33874,33828,33739,33941,34254,34266,34370,
+34611,34357,34223,34149,34977,34492,34231,34479,
+34710,34248,34896,34795,34989,34792,35049,34159,
+34171,36924,36661,36816,35476,36297,35503,35976,
+35696,37573,37762,37263,37064,37331,38299,36944,
+38400,38705,37352,36320,35952,38134,38404,38528,
+35832,35927,34345,36068,36471,35913,36255,36721,
+35735,35271,36114,36231,36559,36564,35950,35786,
+35111,34960,36422,36265,36423,35645,35850,34950,
+35415,37244,36003,35079,35307,35056,34268,34838,
+34525,35847,36789,35296,34177,32744,32127,32748,
+32724,32718,32438,32368,32331,32327,32880,32416,
+31896,32137,32423,32719,32706,32649,32642,32623,
+32479,32680,32670,32554,32528,32481,32048,31918,
+31593,31202,30514,29865,31332,32013,32227,32283,
+33039,33219,33207,33331,33867,34071,34960,35910,
+34614,33085,35064,34893,33938,33033,32895,24747,
+22807,22544,22665,22290,21688,21611,21558,21402,
+21441,21408,21672,25820,26923,27384,25640,23040,
+21804,21742,21579,21675,21587,21606,21554,21562,
+21536,21525,21529,21534,21519,21536,21556,21584,
+21677,21696,21754,21839,21941,22104,22430,23152,
+23769,22777,23210,25915,32263,32516,32777,32620,
+32628,32823,32892,32986,32815,32735,32713,32705,
+32699,32754,32787,32769,32781,32837,32808,32799,
+32842,32802,32819,32847,32805,32873,32798,32813,
+32799,32834,32849,33014,33050,33304,35697,32979,
+32226,32270,32840,34179,34146,33321,32780,32761,
+32859,32546,31458,29165,27189,23731,20574,18180,
+18481,19273,20109,21099,21007,21509,21758,21678,
+21513,21630,22072,22053,22311,22659,23117,23004,
+23000,23100,23560,24561,24930,25647,27067,31733,
+33474,34172,31554,34554,31941,33495,35990,38599,
+37069,39201,37323,35393,37771,36924,37057,38696,
+36994,36645,36636,38623,37515,35882,38390,38682,
+38203,36560,35904,36062,35454,35214,35313,35308,
+35274,35501,35788,35274,34793,34154,34389,34734,
+35472,34372,34526,35122,35262,35232,34662,34501,
+33876,34056,34544,34445,34562,34506,34447,34482,
+34469,34455,34477,34545,34506,34435,34377,34332,
+34354,34035,34013,34011,34018,33992,34041,33935,
+33927,33885,33782,33776,33888,33735,33635,33569,
+33498,33457,33539,33390,33207,33081,33015,32913,
+32907,32948,33003,32907,32884,32913,32869,32838,
+32732,32859,32873,32784,32703,32703,32634,32530,
+32486,32502,32539,32660,32607,32701,32583,32820,
+32845,32765,32871,32983,32812,32882,32948,33498,
+33552,33543,33543,33873,33918,33921,33938,33945,
+33467,33538,33773,33845,33507,33776,33911,33495,
+33724,33411,33871,33927,33913,33938,34776,34692,
+34731,34685,34154,33373,32976,32790,32620,32502,
+32583,32209,29003,27484,26364,25502,25092,24640,
+24180,23763,23393,23079,22884,22746,22610,22518,
+22360,22329,22317,22143,22176,22168,22308,22660,
+22852,23052,22629,22617,22351,22353,22306,22514,
+22965,22810,22652,23029,23451,23544,23226,23175,
+23376,23010,23291,23188,24534,24249,24003,25463,
+24945,26162,26587,27502,28462,26305,27831,27028,
+25778,25770,26377,26346,25669,25791,24639,24941,
+24782,24718,24514,24598,24805,24624,24580,24370,
+23959,23760,23749,24330,25581,26355,26818,29009,
+29880,29709,28902,29145,29159,29068,29244,29486,
+29658,30895,32097,32537,32358,32393,28510,27326,
+27150,28242,26198,26328,27052,32308,32508,32595,
+32789,32811,32734,34406,33867,34755,34147,35058,
+33807,34893,33495,33264,32891,32781,32781,32775,
+32745,32730,32729,32727,32753,32780,32789,32830,
+32860,32871,32894,32814,32875,32770,32814,32804,
+32891,32931,32931,33015,33104,32956,32970,32913,
+33180,33468,33498,33561,33669,33705,33800,33462,
+33165,32930,32909,32706,33035,32982,32616,32577,
+32490,32723,32907,33069,33094,33242,32968,32872,
+32902,33183,33414,33621,33416,33437,33390,33260,
+33197,33261,33334,33243,33275,33275,33189,33272,
+33765,33684,33729,33821,33659,33513,33539,33465,
+33429,33477,33390,33375,33446,33437,33342,33305,
+33405,33399,33363,33474,33441,33400,33344,33483,
+33391,33416,33335,33437,33450,33427,33405,33404,
+33532,33483,33456,33480,33318,33436,33331,33430,
+33468,33735,33534,33482,33399,33555,33400,33664,
+33541,33523,33731,33773,33763,34185,33861,34036,
+33792,33763,33718,33629,33462,33441,33411,33438,
+33449,33376,33187,33171,33182,33165,33177,33242,
+33253,33211,33258,33269,33269,33225,33284,33213,
+33246,33193,33170,33170,33310,33394,33417,33422,
+33416,33393,33399,33415,33408,33388,33387,33423,
+33407,33394,33367,33347,33332,33342,33343,33339,
+33176,33417,33417,33424,33369,33452,33447,33338,
+33517,33533,33598,33607,33534,33612,33642,33717,
+33723,33678,33760,33927,33603,33532,33795,33971,
+33785,33540,33909,34077,33777,33901,33898,34194,
+34154,34171,34146,34311,34555,34203,33818,34336,
+34180,34494,34736,34923,34723,34425,33972,34452,
+34165,34505,35002,35883,36129,35624,36408,35100,
+35362,35656,36422,36759,35625,37899,36030,36883,
+36465,37002,36207,37930,38319,38056,36376,36972,
+36618,36897,35722,35538,35863,36099,35882,35033,
+34916,35484,35947,35924,35787,35412,36016,37511,
+35671,36388,36426,35656,35781,35804,35520,34370,
+35727,34785,34704,35212,35051,34811,35029,34953,
+35397,35561,36325,35913,35294,34644,32671,32649,
+32711,32988,32889,32547,32496,32461,32634,32557,
+32229,32693,32944,32727,32835,32784,32778,32789,
+32792,32772,32667,32604,32466,32435,32295,31968,
+31705,31467,31239,31059,31171,31739,31920,32102,
+32617,32912,33369,34014,33714,33415,33625,34351,
+36021,34710,33906,33321,33506,32998,30258,25817,
+23682,23378,22877,22228,22197,21957,22023,21873,
+21364,22826,24477,27440,29644,29961,28368,26922,
+23466,22731,21867,21815,21797,21690,21683,21695,
+21608,21570,21579,21555,21552,21595,21606,21640,
+21833,21846,21885,22115,22021,22190,22460,23419,
+25245,24002,24531,30732,31874,32652,32697,32645,
+32712,32712,32791,32787,32755,32686,32664,32777,
+32757,32791,32790,32850,32844,32847,32867,32876,
+32838,32831,32859,32859,32886,32886,32874,32848,
+32807,32878,32875,32988,32951,33061,33083,33472,
+33646,32918,32350,32434,33661,33863,34751,32807,
+32838,32798,32618,32646,31659,27513,26271,24144,
+22325,18476,18759,19767,20725,21861,21747,21468,
+21717,21617,21871,22002,22074,22503,23137,23367,
+23415,23513,23719,24132,25562,28859,30978,32994,
+33141,32949,32346,34216,32057,35069,39031,37718,
+34786,38307,38190,37782,36685,37597,38466,37270,
+36558,37501,38417,38259,36650,36850,38749,37950,
+37374,35295,35319,34893,35191,35077,34849,35170,
+35761,35247,34697,35148,34290,34072,34212,35191,
+35204,34094,34188,34290,34812,34945,35049,35171,
+34005,33859,33934,34243,34476,34745,34782,34818,
+34798,34611,34456,34442,34544,34707,34367,34350,
+34222,34143,34014,34011,34011,34141,34156,34012,
+33923,33932,33832,33887,33915,33777,33768,33542,
+33462,33486,33441,33237,33166,33052,33003,32895,
+32861,32842,32878,32829,32781,32757,32774,32781,
+32666,32643,32645,32620,32739,32704,32649,32530,
+32486,32462,32567,32649,32604,32648,32644,32718,
+32748,32675,32668,32729,32796,32731,33594,33441,
+33457,33600,33885,33891,33816,33673,33784,33862,
+33955,33934,33899,33612,33441,33490,33457,33381,
+33434,33462,33564,33565,33926,34176,34877,34875,
+34792,34679,33722,33879,33702,32544,32088,32241,
+32346,29164,27119,26010,25329,24629,24296,23745,
+23713,23330,23123,22933,22794,22673,22584,22549,
+22248,22167,22227,22298,22237,22300,22568,22759,
+23103,23394,24043,24714,24613,24288,24025,23369,
+22944,22727,22927,23133,23141,23175,23211,23333,
+23220,23240,23612,23259,23224,24187,24433,24251,
+24176,24735,25099,26808,26924,28990,27591,29293,
+27832,26233,26039,26232,25917,26109,25542,26152,
+25638,25218,24657,24631,24813,24747,24558,24410,
+24114,24024,23971,24000,23997,26249,26136,27750,
+29121,30172,30824,30294,29799,29514,29461,29551,
+29705,30548,31674,32289,32544,32502,29157,27657,
+27548,26885,26673,26748,29466,32428,32582,32627,
+32753,32991,32680,32985,33153,34356,34190,33498,
+32928,32886,32938,32943,32815,32724,32701,32671,
+32670,32688,32745,32746,32758,32808,32820,32775,
+32867,32776,32681,32565,32307,32104,31964,31808,
+31602,32493,32680,32879,32934,32847,32976,33003,
+33305,33681,33782,33881,33736,33781,33827,33465,
+33275,32997,32729,32810,32717,33061,32898,32700,
+32576,32622,32845,32912,32899,32874,32971,32862,
+32917,33199,33113,33162,33202,33298,33465,33319,
+33140,33142,33135,33240,33201,33261,33148,33129,
+33137,33628,33615,33563,33485,33447,33442,33438,
+33424,33420,33501,33441,33397,33402,33392,33318,
+33294,33402,33374,33563,33430,33390,33305,33311,
+33429,33447,33331,33297,33351,33436,33416,33355,
+33378,33261,33668,33580,33294,33447,33520,33669,
+33638,33654,33657,33609,33630,33620,33467,33623,
+33640,33476,33573,33685,34164,33808,33944,33777,
+33768,33642,33498,33456,33429,33266,33251,33264,
+33193,33229,33279,33258,33154,33146,33144,33141,
+33126,33132,33192,33192,33196,33195,33176,33315,
+33300,33309,33275,33264,33399,33339,33329,33360,
+33367,33407,33355,33399,33331,33279,33342,33290,
+33389,33342,33392,33360,33243,33306,33316,33164,
+33194,33292,33225,33274,33422,33560,33514,33485,
+33483,33515,33507,33532,33531,33598,33603,33617,
+33501,33590,33314,33523,33449,33433,33634,33776,
+33835,33845,34007,34137,34146,34183,33920,33927,
+33927,33932,34313,34191,34185,34760,34251,34556,
+34599,34413,34417,34668,34409,34356,34680,34305,
+33840,34285,34243,34341,35829,35756,36035,35016,
+36435,35524,35595,35538,34808,35532,34083,35593,
+34703,37231,36273,36324,36880,35123,36285,36023,
+35405,36514,36279,34598,36075,35697,35488,34826,
+35450,36412,36594,36437,36679,35106,35570,35784,
+35845,37394,35635,34707,34781,34907,34866,35876,
+35298,35775,34782,34638,34351,34638,34418,34721,
+34092,34079,34014,35287,35333,36214,36125,34975,
+32700,32979,32988,32472,32441,32391,32788,32826,
+32510,32629,32880,32967,32568,32851,32865,32774,
+32788,32561,32639,32502,32438,32664,32574,32224,
+32196,32113,32055,32089,31975,31572,31468,32046,
+32334,32940,33038,33418,33153,33092,33568,34005,
+35272,34725,34022,33114,33009,33263,33174,28852,
+23531,23305,22481,22420,22285,22175,22299,21724,
+21696,20981,23061,24643,29049,30029,29391,27813,
+22811,22360,22051,22038,21956,21907,21799,21729,
+21684,21651,21642,21632,21642,21638,21560,21681,
+21903,21951,22521,22836,23505,23604,25230,23820,
+27120,30319,27716,31405,32673,32428,32692,32661,
+32667,32683,32886,32710,32682,32659,32706,32753,
+32811,32823,32838,32874,32888,32892,32874,32904,
+32894,32895,32898,32892,32874,32903,32932,32945,
+32970,32988,32870,32829,32958,33030,33234,33516,
+33894,36316,35355,33919,32411,32570,33288,32985,
+32980,32574,32676,32760,32799,32646,32267,29278,
+26064,24937,18477,18865,20063,21002,21387,21901,
+22149,22152,22021,22088,22056,22373,22647,22890,
+23994,27684,32505,32580,32498,32633,32805,32925,
+33705,32961,33282,33972,34784,36627,36738,36900,
+35399,36423,34756,37449,37477,36582,37905,37465,
+37674,38271,37856,37986,38001,39081,39822,36750,
+35662,35690,34461,34585,34285,34393,34301,34444,
+34558,34668,34683,34812,34098,33997,33933,33902,
+33830,33844,33885,33794,33725,33818,33957,33773,
+33674,33774,33900,33916,34004,34347,34470,34474,
+34380,34605,34695,34038,34051,34365,34448,34372,
+34232,34185,34665,34473,34124,34028,34255,34200,
+33971,33980,33909,33835,33925,33828,33744,33580,
+33463,33339,33217,33102,33129,33046,32904,32823,
+32826,32801,32698,32661,32690,32769,32741,32601,
+32521,32500,32492,32564,32715,32694,32676,32569,
+32519,32466,32473,32598,32553,32573,32691,32610,
+32595,32700,32844,32787,32965,33305,33407,33637,
+33472,33486,33505,33609,33600,33510,33465,33486,
+33564,33624,33547,33452,33482,33480,33370,32999,
+33003,33198,33199,33526,33897,34097,35059,35203,
+34617,34254,33398,32901,32227,32398,32492,32312,
+31767,27746,26311,25232,24756,24240,23903,23545,
+23361,23221,22848,22854,22626,22620,22587,22605,
+22362,22209,22224,22329,22460,22404,22413,22444,
+23157,23656,23960,24600,25941,26570,26946,25542,
+24867,24280,23951,24076,23742,23382,23481,23424,
+23358,23193,23271,23415,23426,24376,24705,24734,
+25327,25314,25509,25798,25527,26913,27956,28009,
+27831,28507,28167,27618,26477,26341,26403,26425,
+26577,26222,25954,25062,24939,24903,24699,24506,
+24229,24031,24116,24070,24202,24096,24402,25836,
+27930,29398,30341,30580,30360,29905,29480,29412,
+29574,31035,31004,31524,32068,29561,28008,28230,
+27856,27365,27108,27152,28127,31980,32354,32614,
+32942,32706,33066,32952,32696,33146,33729,34130,
+33912,32935,32856,32797,32705,32673,32680,32638,
+32569,32559,32604,32679,32765,32787,32729,32666,
+32401,32220,32154,31988,32351,33147,33768,33471,
+33219,32336,31546,31442,31914,32553,32946,33128,
+33231,33310,33349,33677,33266,33450,33401,33344,
+33236,33042,32926,32672,32757,32718,32932,32613,
+32782,32835,32867,32956,33046,32996,32898,32892,
+32943,33070,33201,33258,33271,33225,33127,33120,
+33317,33429,33296,33209,33136,33032,33003,33113,
+33187,33318,33495,33517,33467,33477,33558,33447,
+33511,33543,33536,33457,33306,33282,33405,33386,
+33377,33334,33351,33545,33581,33546,33423,33436,
+33405,33326,33393,33369,33364,33431,33413,33395,
+33447,33474,33498,33445,33604,33543,33484,33548,
+33479,33551,33843,33900,33611,33483,33597,33606,
+33627,33394,33517,33510,33869,34152,34293,33792,
+33600,33496,33520,33356,33356,33273,33222,33297,
+33323,33249,33182,33239,33210,33197,33171,33142,
+33292,33296,33313,33264,33258,33271,33265,33273,
+33269,33288,33315,33309,33423,33383,33318,33268,
+33269,33372,33372,33303,33380,33321,33220,33333,
+33296,33326,33293,33269,33202,33156,33251,33314,
+33347,33307,33320,33372,33447,33519,33435,33435,
+33478,33393,33435,33453,33495,33495,33463,33465,
+33585,33485,33719,33882,33781,33604,34017,34191,
+34333,33866,33669,34056,34014,33729,34161,33765,
+33953,33894,34116,33903,33828,34014,34346,34649,
+34452,34514,34977,34481,34293,34672,34524,34581,
+34251,34200,33991,34227,34560,34509,34422,34569,
+35094,35469,34242,35855,35579,35820,35796,34864,
+36666,36349,36201,34854,33955,35348,36427,35367,
+34968,34932,34447,34817,35278,35318,35296,34673,
+34734,35273,35501,36744,35849,36088,34822,35453,
+35459,36084,35502,34875,35859,35214,35347,35314,
+35175,34540,34213,34724,34425,34608,34380,34764,
+34935,34554,34450,35115,35247,35554,35344,34503,
+34005,32532,32613,32884,32338,32391,32642,32645,
+32558,32882,32617,32367,32775,32420,32793,32678,
+32707,32926,32946,32820,32818,32971,32748,32622,
+32564,32502,32281,32635,32453,31646,31770,31833,
+32418,32325,32783,32721,32091,33429,33231,33631,
+34473,35629,33485,33054,32939,31118,31550,30762,
+23172,22747,22368,22146,22137,22068,22114,22197,
+22185,22479,23877,29482,30360,31148,29082,26280,
+22705,22700,22371,22237,21846,22043,21969,21807,
+21831,21713,21747,21718,21714,21801,21743,21762,
+22258,22764,22790,27477,30417,32613,32700,32586,
+32434,32504,32528,32534,32616,32686,32668,32625,
+32612,32774,32682,32661,32709,32761,32805,32822,
+32840,32874,32880,32886,32900,32898,32905,32910,
+32913,32917,32928,32904,33138,32961,32949,32948,
+32952,33028,32854,33051,33012,32874,33045,33069,
+33493,33811,34815,35309,35184,32839,32517,32623,
+32553,32500,32451,32576,32436,32513,32295,32231,
+26985,25998,25792,19854,19680,20817,21637,21909,
+22300,22461,23166,23328,22953,24074,32320,32424,
+32493,32387,32677,32694,33643,38012,35772,32801,
+35355,32985,36114,37161,36295,37521,34326,35914,
+36054,36096,36573,36627,35879,37289,37530,38059,
+36074,35214,36611,38950,35769,36801,37482,35317,
+35031,34370,34188,34005,34387,34374,34251,34115,
+34074,34021,34004,34057,34187,34040,34221,34344,
+34776,35498,34672,33857,33701,33732,33702,33630,
+33631,33632,33630,33691,33812,33950,34134,34114,
+34341,34452,34318,34137,33877,34127,34083,34224,
+34185,34257,34226,34269,34088,34025,34023,33942,
+33980,33885,33849,33762,33773,33735,33564,33476,
+33254,33144,33014,32979,33033,33000,32846,32781,
+32752,32736,32714,32568,32628,32670,32549,32492,
+32472,32472,32463,32472,32640,32879,32702,32594,
+32514,32442,32512,32550,32576,32465,32568,32704,
+32655,32531,32988,33120,33127,33244,33456,33445,
+33455,33453,33454,33600,33641,33619,33664,33615,
+33616,33591,33480,33404,32883,33414,33047,32961,
+32748,32781,32939,33178,33270,34004,34245,35560,
+34787,34019,32724,32485,32424,32406,32453,32309,
+29134,27330,25960,24800,24348,24068,23794,23635,
+23384,23196,22998,22863,22800,22873,22689,22576,
+22367,22402,22441,22503,22523,22606,22653,22820,
+23613,24221,24398,25099,25091,26205,26757,27710,
+28158,27092,26214,25446,24485,24112,23893,23766,
+23681,23427,23350,23614,23248,23518,23699,24443,
+24783,24849,24915,25140,25990,25725,27140,28082,
+28266,28568,28586,28658,26942,27044,27069,26467,
+26835,26438,25470,25254,24914,24909,25049,24946,
+24724,24519,24331,24225,24246,24198,24447,24492,
+25200,27883,29912,31271,30825,29781,29709,29372,
+29589,29520,29637,30276,29713,28235,28245,28095,
+27833,27349,27351,27468,27486,27757,28455,30123,
+31827,32686,32570,32635,32664,32745,32760,32744,
+32740,32800,32799,32763,32721,32673,32628,32608,
+32555,32585,32652,32667,32697,32656,32688,32457,
+32167,32296,32373,33462,34647,34854,35412,34050,
+33782,33735,33000,32574,32654,32883,33030,33371,
+33467,33123,33123,33126,33344,33305,33330,33174,
+33328,33095,33015,32987,32839,32531,32765,32700,
+32604,32718,32743,32817,32868,32967,32981,33027,
+33054,33151,33177,33221,33247,33193,33051,33072,
+33241,33223,33131,33249,33185,33157,33098,33091,
+33190,33360,33216,33549,33508,33479,33579,33390,
+33380,33385,33282,33369,33282,33561,33416,33471,
+33526,33565,33467,33511,33573,33628,33550,33653,
+33554,33537,33511,33486,33454,33423,33558,33498,
+33518,33462,33418,33543,33438,33495,33560,33690,
+33585,33826,33678,33792,33676,33543,33572,33585,
+33316,33390,33697,33942,33957,34354,33932,33552,
+33453,33372,33332,33292,33331,33339,33339,33259,
+33242,33237,33229,33216,33259,33182,33151,33153,
+33123,33249,33285,33275,33268,33257,33265,33269,
+33273,33222,33234,33222,33276,33339,33334,33286,
+33261,33363,33297,33207,33313,33203,33178,33291,
+33279,33306,33165,33144,33172,33267,33240,33250,
+33243,33284,33258,33258,33281,33264,33292,33426,
+33515,33480,33473,33554,33528,33531,33459,33341,
+33453,33801,34131,34317,34632,34405,34281,33833,
+33915,33697,33678,33969,33717,33820,33826,33895,
+34107,33761,33880,34002,33936,33783,34009,34364,
+34634,34785,34708,34652,34622,34413,34512,34647,
+34379,34306,34316,34284,34447,34307,34293,34271,
+34691,35634,34914,36113,35046,36188,35720,35610,
+35541,35214,35016,35071,34349,34787,34806,33922,
+34339,34577,34470,34107,34561,35266,34914,34940,
+34670,34404,34510,34506,34917,34869,34695,33953,
+33940,34167,34499,34159,33981,33744,34353,34187,
+34366,34383,34545,34614,33947,34974,34644,34752,
+34383,35995,34452,35407,34958,34818,35370,34470,
+34977,33822,34053,32794,32638,32437,32304,32422,
+32468,32499,32532,32454,32472,32697,32816,32867,
+32958,32970,32917,32953,32988,32988,32950,32739,
+32953,32817,32869,32855,32818,32558,32549,32642,
+32145,32394,32546,32577,32377,32537,32880,33291,
+34086,34705,36302,34821,33021,32943,32988,33070,
+32358,24217,18763,20040,21602,22157,22249,22153,
+22628,22626,25000,24549,30051,31461,29216,25426,
+23066,22769,22869,22602,22071,22166,22158,22078,
+22066,21900,21824,21768,21819,21838,21960,22001,
+22917,23391,26433,32541,31906,32543,32550,32568,
+32463,32601,32628,32747,32681,32708,32880,32786,
+32827,32772,32769,32797,32856,32875,32887,32876,
+32886,32886,32916,32922,32919,32922,32922,32922,
+32922,32922,32891,32871,33621,33246,33776,33057,
+34351,33470,33571,33291,33130,33171,33078,33093,
+33541,34005,34842,34095,32513,32822,32703,32688,
+33498,33287,32891,32659,32505,32563,32542,32650,
+32418,32152,32289,31890,26826,24666,22668,23008,
+21819,22525,25011,29216,32250,31982,32592,32658,
+32514,32776,33038,33933,38811,35679,37139,37003,
+34716,34131,37422,37294,37058,35781,36046,36396,
+35896,37554,36861,36897,36464,36749,38009,36114,
+35217,36354,36888,37623,35803,36022,34695,34646,
+34251,33932,33958,34407,34811,34887,34910,34321,
+34657,34460,34368,34233,33990,33990,34279,35349,
+35813,35670,35232,35244,33901,33873,33759,33786,
+33756,33728,33909,33676,33630,33630,33630,33630,
+33739,33693,33802,33850,33837,33831,33973,34008,
+34191,34243,34439,34359,34092,34715,34227,33988,
+33912,33913,33828,33915,33712,33594,33495,33467,
+33312,33112,32927,32883,32832,32856,32777,32694,
+32668,32679,32702,32565,32611,32601,32522,32479,
+32436,32439,32394,32455,32622,32736,32661,32573,
+32611,32466,32427,32548,32604,32596,32569,32670,
+32688,32674,32769,32916,33101,33121,33208,33331,
+33360,33370,33451,33543,33468,33439,33417,33576,
+33681,33614,33567,33367,33167,32997,32907,32684,
+32480,32502,32651,32874,32997,33727,34269,34673,
+33524,32828,32569,32626,32530,32459,32383,31423,
+28111,26154,25312,24755,24319,24076,23776,23643,
+23430,23239,23040,23081,22881,22913,22646,22593,
+22626,22493,22575,22634,22650,22833,23024,23311,
+23806,24270,25510,26364,26394,26836,27111,27952,
+28761,28212,27553,26651,26052,25458,24758,24303,
+24099,23896,23765,23625,23602,23544,23751,23713,
+23797,24321,25161,25102,25195,25711,25701,27228,
+28010,28366,28891,28902,28597,28119,27126,26679,
+27063,27009,25762,25774,25695,25032,25220,25358,
+25489,25375,25172,24711,24339,24289,24393,24460,
+24523,24493,25385,27922,28435,30129,30880,31074,
+31311,31386,29900,30291,29974,28743,28810,28588,
+27803,27066,28169,31538,30336,28016,28494,28730,
+29406,30985,32141,32601,32646,32705,32651,32722,
+32635,32907,32995,32923,32756,32673,32601,32589,
+32598,32597,32661,32669,32650,32652,32570,32293,
+32185,32230,33207,32755,33899,36255,36386,35676,
+35488,34086,33501,33549,33210,32997,33288,33519,
+33345,33217,33123,33123,33360,33537,33120,33021,
+33180,33153,33059,33099,33128,32996,32933,32772,
+32814,32679,32712,32674,32695,32813,32829,33008,
+33097,33176,33210,33294,33386,33239,33196,33078,
+33111,33135,33233,33302,33204,33142,33110,33048,
+33119,33183,33252,33603,33579,33423,33404,33375,
+33348,33315,33324,33378,33377,33590,33567,33351,
+33366,33635,33482,33423,33443,33593,33494,33392,
+33482,33490,33581,33620,33539,33488,33618,33560,
+33477,33572,33563,33435,33645,33411,33433,33627,
+33632,33628,33891,33858,33695,33482,33633,33559,
+33309,33469,33609,34115,34503,34651,34096,33684,
+33326,33399,33266,33265,33222,33330,33297,33249,
+33195,33225,33234,33273,33168,33163,33141,33154,
+33141,33133,33306,33262,33279,33282,33219,33286,
+33311,33298,33272,33191,33221,33189,33210,33270,
+33297,33237,33227,33201,33177,33214,33246,33252,
+33183,33125,33153,33182,33248,33266,33309,33393,
+33386,33339,33352,33396,33351,33444,33450,33417,
+33381,33337,33428,33527,33481,33428,33290,33585,
+34206,34182,34326,33741,33923,34251,34014,34188,
+34434,34082,34123,33834,34185,33952,33867,33853,
+34001,34024,34072,34058,34133,34239,34137,34135,
+34189,34340,34714,34705,34440,34298,34444,34420,
+34124,34432,34404,34397,34346,34106,34488,34183,
+33945,33709,35178,36000,35811,36297,35517,36007,
+34872,35694,35266,34739,34485,34477,34029,34448,
+34365,34372,33819,34071,34630,34666,34587,34618,
+34428,34560,34301,34639,34689,34679,34308,34699,
+34875,34735,34407,34053,34185,33946,33886,33760,
+33625,34233,34733,34826,34758,34356,33660,34509,
+34953,34955,35398,35772,35210,35238,35142,35628,
+34779,34311,34122,33849,33429,32924,32857,32845,
+32754,32749,32775,32705,33334,32827,32988,32898,
+32775,33306,32989,32771,32979,32846,32617,32631,
+32701,34605,33202,33027,33414,33401,32988,32886,
+32579,32298,31991,32345,32270,32759,32054,32649,
+33762,34187,35065,35052,33143,33041,32733,32955,
+32605,32433,29552,32232,32896,29883,26274,22836,
+22984,23581,24225,26322,32307,30957,28197,25232,
+23566,22970,22917,22746,22560,22325,22143,21971,
+22118,22076,22047,22051,22032,22314,22431,23034,
+24558,24397,29571,32519,32523,32534,32580,32490,
+32580,32656,32599,32812,32664,32755,32708,32862,
+32828,32789,32859,32844,32869,32877,32892,32892,
+32908,32860,32826,32898,32908,32910,32910,32929,
+32940,32942,32925,32876,33035,33441,34704,34842,
+34611,34128,33791,33385,33380,33216,33299,33563,
+33401,33296,33042,33042,34353,33695,32775,32806,
+33308,33253,34688,33663,32975,32278,32447,32574,
+32796,32701,32724,32767,32719,32660,32840,32672,
+32598,32154,32386,32544,32746,32835,33188,33032,
+32856,35808,35257,35481,37625,34479,38083,36386,
+35967,35934,37353,34977,35453,36329,35746,35091,
+36222,37617,36839,36641,36056,35604,35841,35161,
+35670,34974,35576,36542,36539,36306,34896,34489,
+34375,34422,34404,34539,34412,34338,34493,34119,
+34371,34639,34662,34997,34841,33947,33957,34091,
+34162,34445,34250,33979,33912,33840,33816,33797,
+33726,33841,33912,33919,34265,34179,34035,34374,
+34403,34280,34359,34403,34369,34398,34316,34081,
+34302,34449,34178,34171,34098,33966,34011,33861,
+33894,33871,33902,33915,33829,33735,33566,33462,
+33318,33117,32937,32776,32714,32757,32718,32646,
+32618,32591,32617,32547,32581,32555,32553,32487,
+32401,32391,32377,32403,32482,32516,32582,32595,
+32646,32532,32423,32535,32605,32611,32586,32984,
+32656,32643,32665,32835,32991,33060,33252,33423,
+33456,33429,33414,33477,33466,33606,33462,33642,
+33552,33568,33489,33384,33054,32948,32946,32861,
+32806,32823,32727,32480,32640,33540,33432,33168,
+32855,32561,32577,32547,32490,32415,32232,29129,
+27228,26029,25061,24711,24385,24234,23916,23913,
+23514,23373,23184,23127,22947,22850,22822,22798,
+22792,22782,22725,23064,23133,23376,23465,23416,
+24254,24615,26442,29244,32586,32241,32730,32604,
+32900,32482,32433,29594,27510,26727,25877,25159,
+24795,24557,24217,23952,23719,23681,23726,23790,
+24253,24192,24774,25007,25526,25584,25836,26220,
+27033,27785,28464,29036,30253,28754,29004,27627,
+27554,27170,26848,26525,25832,26466,26178,25736,
+25868,26125,25722,25247,24961,24491,24530,24654,
+24798,24937,25008,24704,25219,26097,26856,27525,
+27266,27170,28020,29071,29499,29626,29184,29187,
+29360,29037,29208,29357,28953,28977,29061,30091,
+30801,29860,30141,32084,31833,32438,32628,32676,
+32546,32760,32745,32655,32674,32698,32634,32602,
+32632,32625,32660,32631,32664,32676,32500,32213,
+32196,32547,33027,32997,36066,35291,36528,35745,
+36134,34807,34563,33549,33027,33342,33460,33690,
+33468,33675,33402,33765,33576,33462,33489,33243,
+33228,33160,33065,33044,33082,33021,32997,32783,
+32845,32967,32975,32988,32977,32988,32957,32879,
+32883,32842,32986,32957,32953,32945,32933,32871,
+32878,33067,33363,33264,33195,33025,33145,33164,
+33053,33132,33123,33192,33570,33528,33546,33565,
+33417,33422,33750,33480,33417,33349,33315,33360,
+33491,33597,33591,33622,33436,33437,33511,33447,
+33702,33690,33496,33560,33510,33572,33585,33504,
+33587,33576,33640,33559,33635,33454,33531,33521,
+33520,33452,33638,33698,33588,33482,33534,33535,
+33475,33528,33477,33804,34319,34251,34443,33696,
+33563,33352,33186,33148,33243,33221,33212,33253,
+33176,33187,33147,33147,33109,33141,33091,33115,
+33109,33102,33098,33158,33174,33189,33250,33234,
+33222,33236,33175,33268,33258,33277,33270,33249,
+33277,33348,33330,33266,33268,33245,33131,33090,
+33166,33137,33230,33237,33309,33352,33387,33344,
+33382,33428,33424,33401,33450,33419,33507,33456,
+33440,33451,33354,33321,33271,33211,33360,33759,
+34093,35232,34925,34427,34485,34788,34350,34235,
+34717,33882,34359,34429,34367,34204,34171,34020,
+33863,34005,34059,34136,34007,33950,33999,34171,
+34172,34221,34191,34363,34338,34521,34139,34106,
+34227,34292,34377,34256,34189,34219,34437,34239,
+34038,34197,34056,34753,34639,34525,35079,35061,
+35494,34317,34256,34204,33602,34210,33721,34424,
+33846,34287,34411,34131,34672,34559,34212,34534,
+34686,34341,34670,34476,34333,34658,34578,34372,
+34326,34260,34323,34313,34210,34046,33939,34065,
+34020,33743,33691,33967,34011,33672,33979,33956,
+34258,35383,35407,34459,34429,34654,35772,35013,
+35262,34332,34038,33792,33906,33241,33192,33840,
+33395,34461,33944,33389,33293,33219,33174,33161,
+33307,33777,33009,32693,33274,34638,33216,33468,
+33504,34074,33426,33174,32884,32658,32454,32060,
+32105,31617,31829,32517,32715,31902,31424,32217,
+32679,32443,33780,35214,35501,33943,33593,32237,
+32979,32982,31872,32988,32156,29440,32115,25783,
+24863,24079,23344,25326,31871,26550,24937,24523,
+23329,23377,23284,23041,22790,22588,22486,22339,
+22373,22438,22260,22466,22650,22700,23580,24645,
+26844,30018,31686,32525,32551,32571,32571,32620,
+32641,32676,32640,32773,32752,32811,32969,32926,
+32849,32817,32806,32831,32850,32877,32892,32902,
+32910,32962,33159,33360,33039,32874,32881,33027,
+33009,33029,33007,33006,33046,33178,33888,33858,
+34981,34453,34122,33864,34203,33507,33739,33595,
+33665,34365,33382,33862,36069,33833,33039,32741,
+32774,33260,33756,36130,35694,34731,36957,32997,
+33307,32994,32987,32871,32914,32990,32994,33765,
+33768,33480,34295,37678,36667,36782,36667,37705,
+39543,37044,37647,37587,36818,35930,37508,36839,
+38112,36519,35657,35593,35871,36618,36051,36549,
+37472,36973,37671,36550,35251,34956,35793,34945,
+36030,36129,35714,35805,35966,34691,36173,34715,
+33965,33948,34027,34385,34374,34860,34834,34949,
+34287,34527,34581,34580,34890,35286,33724,33792,
+33792,33792,33824,33827,33843,33762,33643,33627,
+33752,33831,33914,34063,34240,34374,34384,34248,
+34380,34473,34386,34401,34357,34363,34216,34354,
+34623,34087,34008,34005,34104,34074,33972,33913,
+33831,33908,33899,33848,33627,33459,33499,33453,
+33281,33143,33003,32831,32693,32670,32738,32693,
+32680,32592,32558,32553,32652,32592,32560,32475,
+32400,32400,32406,32466,32454,32507,32490,32525,
+32564,32501,32415,32484,32640,32699,32597,32546,
+32524,32560,32635,32781,32931,33057,33149,33275,
+33456,33459,33693,33543,33572,33718,33507,33591,
+33432,33489,33455,33483,33204,32976,32950,33216,
+32958,32988,32851,32548,32478,32742,33305,32993,
+32457,32546,32461,32364,32239,32095,28953,27473,
+26157,25550,25394,24784,24582,24528,23501,23694,
+23643,23514,23457,23375,23106,23086,22916,23059,
+23121,23227,23457,23649,23900,24174,24363,24372,
+27648,32302,31956,32836,32976,33058,33839,32998,
+33014,33010,32275,32415,28600,27182,26990,26031,
+25591,24826,24223,24036,24006,23918,23796,23908,
+24303,24047,23430,24175,24936,25369,25638,26151,
+26241,27232,27647,28310,28395,29796,29446,28578,
+28661,27992,27315,26631,26898,26441,26376,26623,
+26496,26352,25707,25175,24801,24636,24593,24854,
+24897,25191,25053,24942,24917,24908,24830,25681,
+26319,26748,27693,28053,29821,31014,31558,31633,
+30201,29565,29784,29889,29763,28218,30513,30701,
+31018,30020,29563,29733,30252,30091,30889,31836,
+32507,32598,32562,32697,32931,33072,32889,32624,
+32584,32577,32590,32669,32699,32701,32595,32112,
+32127,32285,32985,33715,35204,37380,36950,36694,
+36765,35977,35062,33843,33737,34605,33758,33582,
+34137,33659,33781,33925,34254,33738,33630,33612,
+33269,33093,33136,33102,33027,32997,32976,33014,
+33007,32988,32995,32997,32998,33031,33106,33126,
+33172,33120,32996,32991,32990,32937,32974,32988,
+32983,32991,33129,33151,33243,33031,33003,33015,
+33003,33059,33056,33305,33362,33720,33672,33707,
+33483,33483,33334,33330,33430,33419,33401,33449,
+33498,33519,33540,33526,33507,33504,33519,33435,
+33458,33513,33554,33550,33534,33447,33489,33449,
+33453,33488,33463,33442,33639,33531,33437,33460,
+33650,33577,33513,33547,33546,33453,33423,33409,
+33477,33444,33522,33882,34399,34927,34410,34020,
+33544,33294,33203,33225,33261,33206,33228,33220,
+33168,33153,33154,33154,33192,33228,33272,33165,
+33116,33117,33117,33099,33254,33249,33168,33225,
+33270,33231,33147,33195,33227,33218,33284,33264,
+33222,33226,33215,33262,33121,33147,33156,33163,
+33266,33308,33269,33345,33324,33273,33290,33335,
+33437,33419,33291,33339,33452,33515,33442,33408,
+33471,33273,33386,33261,33179,34149,34162,34492,
+34609,34545,34491,34803,34345,34299,34309,34343,
+34448,33828,34308,34966,34297,34139,34082,34018,
+33825,33801,33864,33956,33906,33949,33924,33990,
+34137,34334,34254,34214,34196,34017,34233,34007,
+34290,34284,34092,34427,34196,34005,34173,34014,
+34416,34655,34107,33990,34277,34269,34299,34840,
+33935,34167,33889,34065,34059,34243,33935,33390,
+33677,33600,34209,34427,34609,34498,34615,34096,
+34200,34480,34458,34845,34731,34782,34740,34368,
+34205,34116,34131,33948,33822,34083,34017,33951,
+33901,34044,33815,33769,33782,33898,33723,33891,
+34155,34034,35165,35343,35607,34833,34876,34847,
+34738,35447,34741,35316,34827,35773,35298,35403,
+35921,34608,34280,35106,35271,33758,33542,33422,
+33726,33795,34166,36153,34065,35041,35916,34111,
+35314,35485,34473,35556,34315,32823,32234,32043,
+31814,32173,32398,32412,32253,32454,32988,32220,
+32575,31699,32764,32718,34085,33573,33882,33120,
+33617,33560,33027,32928,32927,33942,31691,30525,
+30681,31417,32334,32570,34097,32322,27070,26590,
+26691,25499,25358,24982,24345,23603,23059,22565,
+22549,22500,22919,24079,23866,24192,25543,27312,
+31075,31775,32378,32503,32476,32592,32689,32643,
+32831,32669,32776,32738,32782,32808,32909,32919,
+32878,32856,32853,32877,32883,32896,32905,32909,
+32965,32964,32949,32937,32961,32865,33402,33001,
+32964,33017,33028,33018,33007,33053,33141,33506,
+34589,34277,33974,33858,33738,33728,33776,34071,
+33987,33932,34863,34970,38246,34909,37326,33072,
+33036,33064,33184,33215,34992,34746,35500,32970,
+32985,32976,32727,32982,34722,36126,34555,35106,
+38274,38655,35481,36145,39354,41820,40680,39657,
+41043,38657,39232,37008,35397,35733,37504,35407,
+36532,36322,37412,35774,35583,37313,36435,36051,
+36252,36841,36518,35663,36338,35279,36303,36701,
+35643,35813,36635,35744,35837,36137,36082,36650,
+34278,33744,34836,34925,34790,34482,34583,34465,
+34172,33952,33942,33926,33743,33730,33715,33548,
+33497,33499,33805,33737,33675,33603,33636,33612,
+33657,33902,33914,33936,34062,34167,34210,34392,
+34363,34372,34374,34318,34239,34324,34109,34092,
+34110,34081,34138,34027,33931,33962,34026,33926,
+33986,33831,33795,33712,33614,33516,33458,33305,
+33239,33139,33052,32938,32808,32673,32653,32678,
+32668,32639,32619,32624,32599,32529,32529,32490,
+32464,32423,32425,32445,32484,32470,32444,32448,
+32459,32457,32496,32495,32550,32712,32674,32608,
+32530,32571,32735,32965,32974,33075,33342,33482,
+33498,33645,33810,33913,33914,33996,33934,33962,
+33937,34034,33930,33863,33426,32964,32802,32767,
+32603,32541,32286,32041,31350,31290,32533,31990,
+31743,31368,31148,31321,31513,31370,28908,27616,
+26793,26064,25701,25026,24527,24209,24199,24152,
+24112,24149,23896,23815,23766,23534,23412,23518,
+23765,23714,23680,24470,24577,28784,32454,32990,
+32996,32955,32997,32997,32994,34801,33527,35292,
+33176,33027,32919,31827,31425,27329,26858,26996,
+25690,25002,24619,24341,24299,24072,24015,24014,
+24073,23722,23942,23792,24204,24328,25206,25611,
+25950,26171,27417,27605,28653,28645,29241,30488,
+28597,28764,28391,27990,26742,27204,27021,26978,
+27120,27195,26707,26422,25854,25751,25596,25971,
+25753,25397,25337,25210,25214,25314,25406,25429,
+25645,26571,27099,27675,27988,28512,30405,31166,
+30484,29732,32309,32514,31002,32508,32614,30996,
+30370,30444,32329,32446,31321,30588,29823,29754,
+30735,31509,32186,32535,32706,32823,32958,32683,
+32615,32568,32591,32624,32638,32619,32085,32073,
+32038,32976,33082,34047,36103,36465,37270,36870,
+36524,35715,36030,34749,33671,33736,33524,33605,
+33803,34175,34377,33999,34028,33853,33697,33454,
+33659,33259,33040,32832,32988,32968,32962,32954,
+32983,32983,32982,33046,33227,33249,33281,33415,
+33385,33318,33279,33188,33120,33117,33138,33153,
+33125,33036,33096,33070,33143,33003,33003,33003,
+33003,33003,33071,33189,33369,33331,33705,33324,
+33660,33441,33506,33550,33448,33378,33381,33526,
+33508,33564,33678,33495,33483,33358,33360,33371,
+33450,33465,33409,33397,33297,33498,33428,33395,
+33534,33495,33480,33584,33375,33548,33480,33633,
+33623,33554,33555,33686,33653,33616,33474,33556,
+33589,33720,33903,33906,34515,33771,34812,33759,
+33524,33336,33375,33345,33201,33284,33195,33227,
+33232,33191,33192,33213,33192,33244,33205,33152,
+33105,33084,33106,33097,33210,33207,33115,33183,
+33160,33150,33171,33144,33191,33250,33138,33104,
+33201,33069,33081,33159,33159,33193,33183,33271,
+33343,33356,33269,33279,33319,33359,33322,33382,
+33375,33419,33407,33351,33428,33366,33365,33387,
+33480,33354,33300,33178,33455,34227,34397,34134,
+34172,33692,33758,33860,33588,33683,34033,34305,
+34257,34602,34235,34446,34326,34433,34169,34245,
+34177,34134,34167,34210,33920,34143,34240,34236,
+34289,34286,34180,34148,34140,34089,34036,33947,
+34050,34094,34089,34197,34396,34410,34296,34680,
+34167,34432,34245,33649,34155,33812,33805,33750,
+33720,33918,33964,33990,33894,34092,34280,34299,
+34108,33967,33826,34093,34253,34236,34158,34108,
+34044,33906,34307,34368,34333,34274,34280,34274,
+34366,34173,34056,34134,34141,34078,33722,33561,
+33958,33861,34083,34002,33954,33705,33575,33855,
+34871,34342,35304,35285,37162,36162,37713,35513,
+35906,35526,35379,37305,35995,34173,35895,35591,
+36881,36086,34767,34718,35637,35016,34754,35834,
+35471,35568,36185,35988,36519,35787,36751,35466,
+36282,36494,36168,35542,35358,35027,34590,33203,
+32432,32112,32420,32831,32653,32896,32988,32193,
+32824,33567,31758,32952,32941,32880,33126,33007,
+33231,33894,34195,33450,33120,33462,34605,33835,
+33708,33293,33352,33756,33773,34129,34238,32707,
+31459,30261,29649,30099,29163,27186,25737,25969,
+24665,23781,23543,23982,25230,26546,29800,30682,
+32526,32446,32379,32526,32564,32625,32653,32656,
+32738,32776,32743,32775,32802,32798,32814,32808,
+32823,32838,32862,32886,32892,32898,32915,32904,
+32941,32940,32929,32913,32969,33001,33011,33012,
+33003,33042,33076,33036,33016,33021,33042,33118,
+34185,33261,34299,34134,33618,33365,33368,33566,
+33525,33893,33759,36030,36277,37946,35097,34777,
+34644,33377,32751,32921,33294,35530,36570,39858,
+33189,38425,36138,36620,35773,36410,37377,35140,
+36650,35965,35913,36860,39245,41697,42258,39099,
+37323,37280,35384,38563,38045,37040,36763,36069,
+36321,34911,35799,36575,37719,35554,36680,36303,
+37503,37819,37033,37014,36748,35474,37757,36291,
+38458,36380,37716,35680,36582,35671,35745,35442,
+33752,34135,33491,33911,33836,33871,33711,33580,
+33452,33425,33459,33537,33486,33468,33470,33468,
+33468,33468,33468,33468,33529,33594,33645,33733,
+33792,33912,34020,34073,34091,34293,34365,34323,
+34377,34280,34357,34239,34164,34129,34096,34164,
+33992,34092,34027,34025,33919,33933,33913,33921,
+33900,33889,33828,33661,33557,33552,33522,33468,
+33362,33231,33110,33004,32925,32811,32691,32661,
+32639,32618,32643,32604,32595,32566,32565,32483,
+32385,32359,32307,32381,32352,32390,32406,32383,
+32437,32423,32408,32469,32482,32566,32691,32782,
+32625,32558,32663,32774,32941,33458,33451,33528,
+33631,33899,33922,34170,34413,34518,34339,33938,
+33852,32879,32730,32670,32532,32333,32025,31749,
+31535,31786,31434,31626,32060,32406,32515,31889,
+31296,31080,31067,31128,31235,31269,30822,27132,
+26278,25989,25335,25114,24741,24618,24539,24507,
+24495,24354,24329,24110,24057,23830,23489,23465,
+23942,24168,24627,25235,32392,32584,32996,33045,
+35070,35400,35648,34124,35335,34872,37212,39290,
+36832,34604,33810,32748,31571,28880,27436,27225,
+25900,25359,24973,25001,24741,24577,24505,24287,
+24239,24190,24170,24063,24504,24810,25445,25472,
+25873,26058,26428,27114,27921,28076,28954,28623,
+30127,30342,28620,28638,28361,27574,27593,27827,
+27597,27300,27319,27564,27361,26880,26124,26019,
+25703,25661,25766,25681,25575,25538,25594,25738,
+25698,26053,26901,27360,27700,28251,28095,28674,
+28983,29345,29473,29469,29761,31510,32294,32148,
+30542,32057,32643,32229,32283,32039,30707,29753,
+29687,29374,29724,30813,31668,32428,32446,32563,
+32495,32518,32550,32502,32397,32005,31878,31926,
+31835,32991,34027,34827,35661,35475,35397,35508,
+36425,35910,35937,35775,34346,35400,34092,34743,
+34541,34426,34766,34290,33939,33831,34015,33729,
+33534,33146,32997,32957,32758,32755,32708,32708,
+32803,32968,32976,33084,33166,33224,33352,33248,
+33300,33388,33461,33302,33291,33272,33231,33263,
+33204,33222,33291,33051,33003,33003,33003,33003,
+33125,33110,33326,33381,33407,33130,33217,33069,
+33069,33376,33610,33647,33451,33333,33558,33559,
+33368,33523,33509,33397,33285,33282,33471,33411,
+33538,33323,33495,33711,33514,33251,33364,33363,
+33525,33509,33479,33516,33384,33395,33488,33508,
+33542,33646,33624,33428,33333,33403,33517,33624,
+33630,33444,33579,34023,33829,33900,35697,34374,
+33940,33524,33384,33395,33357,33315,33300,33245,
+33316,33322,33294,33294,33304,33150,33152,33094,
+33201,33259,33117,33087,33096,33110,33095,33093,
+33128,33111,33083,33090,33105,33102,33117,33108,
+33151,33155,33200,33175,33170,33176,33174,33180,
+33139,33130,33208,33231,33314,33360,33300,33303,
+33402,33428,33402,33471,33487,33538,33510,33502,
+33437,33282,33324,33482,33669,33748,34084,34059,
+33824,33378,33789,34170,34071,34292,34338,34334,
+34098,34077,34815,34125,34137,34262,34326,34132,
+34111,34212,34158,34213,34278,34280,34164,34266,
+34293,34062,34240,34013,33943,34104,34015,34079,
+34006,33885,34067,34018,34186,34071,34172,34058,
+34142,34239,34154,34057,33934,33896,33907,33936,
+34026,33832,33999,33907,34006,34023,33836,33951,
+33843,33768,34155,34069,34128,34082,34212,34211,
+34176,34209,34048,34017,33923,33782,33738,33487,
+33335,33489,33741,33663,33822,33888,33993,33712,
+33813,33840,33884,33981,33819,33802,33788,34673,
+34300,35970,36656,35966,35963,37461,36735,37200,
+37297,36007,36506,37492,35757,36660,35382,35043,
+37869,37065,36665,36000,35994,35898,36351,35658,
+35884,34999,35871,34937,35598,35086,35265,36429,
+35776,35060,35763,35727,36129,34991,36051,34191,
+34558,32781,32583,31910,32610,32721,32814,32991,
+33511,33829,33905,32974,32567,32755,32987,32829,
+33183,33411,34862,33952,33848,34234,33354,34528,
+34113,33432,33906,35243,34108,33707,34734,34931,
+33581,33087,32693,32272,31959,32725,31509,30954,
+29658,27623,26007,26544,28896,32219,32773,32828,
+32297,32618,32656,32601,32588,32622,32663,32684,
+32708,32735,32802,32810,32823,32832,32831,32832,
+32832,32846,32853,32875,32892,32892,32892,32925,
+32922,32922,32886,32922,33023,33114,33012,33011,
+33009,33036,33063,33021,33135,33018,33053,33187,
+33111,33960,33597,33162,34322,33410,33232,33405,
+33634,34139,34261,38253,37207,36688,36497,36663,
+35066,34956,33120,33096,34247,34596,33978,37774,
+36966,37989,37223,36230,34750,35113,33873,35541,
+38025,41361,39986,37830,36696,36114,36467,36710,
+36166,36487,36775,36978,36811,36527,36663,35780,
+35704,35741,36285,36312,37671,37785,37979,37130,
+35470,35585,36415,37554,35701,36851,37632,37947,
+36088,38039,35885,36565,36142,36315,37733,35154,
+34320,34624,33983,34749,33476,33444,33464,33585,
+33660,33794,33739,33540,33534,33545,33543,33647,
+33523,33468,33468,33468,33468,33468,33551,33468,
+33808,33902,33986,34047,34059,34062,34108,34698,
+34127,34108,34291,34200,34236,34040,34083,34341,
+34218,33923,34038,33927,34089,33918,33919,33938,
+33921,33885,33860,33604,33555,33488,33456,33237,
+33315,33144,33105,33068,33003,32995,32925,32754,
+32645,32568,32578,32629,32616,32536,32531,32499,
+32450,32424,32433,32448,32445,32474,32470,32477,
+32481,32472,32334,32395,32372,32464,32600,32935,
+33003,32644,32589,32805,33006,33130,33472,33666,
+33898,33887,33989,33928,34200,34935,33966,33522,
+32890,32680,32282,32162,32124,32188,32238,32250,
+32293,32386,32424,32361,32991,32993,32990,32232,
+31467,31571,31523,31260,31328,31354,31383,29068,
+27479,26316,25905,25594,25398,25074,24908,24906,
+24858,24777,24672,24618,24289,24443,24702,24811,
+25335,25428,30440,32988,32890,33037,35733,35743,
+37575,37315,37830,38736,38956,38403,40809,39801,
+39979,36536,34029,32994,32139,32405,28623,28281,
+27658,26849,26304,25736,25174,25040,24867,24558,
+24270,24279,24220,24194,24126,23925,24514,24909,
+25984,25717,26389,26802,26775,28152,28081,28662,
+28410,30173,30380,30148,28838,28664,28647,28554,
+28245,27813,27817,27811,28044,27690,27127,27398,
+27253,27446,26494,26454,26258,25863,25910,26025,
+26100,26223,27033,27522,28217,28935,28728,28788,
+29175,29220,29332,29791,30025,30583,30659,32492,
+32268,32632,32896,32677,32227,32477,32249,30969,
+29819,28588,28341,28342,29108,31074,32150,32273,
+32386,32350,32434,31964,31893,31831,31803,32034,
+32322,32841,34371,35587,34665,34348,36683,37624,
+36382,37065,35598,35931,36510,34829,35117,35415,
+35335,34864,34475,35031,34605,34550,34086,33730,
+33645,33562,33077,32988,32679,32814,32781,32575,
+32406,32637,32833,33090,33258,33387,33282,33287,
+33461,33415,33324,33461,33306,33285,33360,33288,
+33266,33238,33198,33255,33228,33012,33185,33231,
+33300,33331,33222,33412,33479,33069,33069,33069,
+33157,33282,33575,33438,33523,33434,33341,33459,
+33767,33336,33372,33597,33186,33235,33623,33438,
+33482,33502,33234,33219,33192,33288,33573,33508,
+33219,33402,33412,33314,33447,33336,33382,33303,
+33463,33595,33462,33454,33528,33465,33498,33478,
+33504,33515,33450,33590,33924,34099,34980,33852,
+33650,33370,33327,33234,33534,33467,33450,33293,
+33399,33367,33333,33415,33270,33125,33067,33250,
+33357,33109,33154,33132,33306,33172,33206,33209,
+33174,33217,33213,33224,33147,33159,33168,33162,
+33165,33235,33231,33271,33247,33202,33231,33207,
+33241,33255,33236,33274,33284,33271,33306,33382,
+33383,33441,33438,33393,33333,33491,33627,33537,
+33555,33477,33463,33112,33655,33352,33864,33693,
+33726,33579,33956,34411,33609,34097,34479,34455,
+34557,34291,34040,34363,34237,34236,34128,33962,
+33999,34192,34243,34136,34172,34059,34410,34303,
+34325,34082,34127,34143,34110,34026,34016,33904,
+33940,33962,33984,33921,34165,34237,34127,34143,
+34044,33975,34077,34114,34048,34116,34035,34088,
+33929,33844,33531,33596,33676,33662,33711,33747,
+33575,33850,33894,33952,34146,34212,34194,34078,
+34057,33907,33627,33792,33830,33750,33902,33948,
+33864,33735,33735,33354,33491,33613,33520,33744,
+33717,33838,33510,33470,33768,33771,33437,33833,
+33869,34615,35586,35817,36998,35430,35619,36687,
+37733,36804,38527,36429,36284,36356,37667,37186,
+37630,37309,36469,36492,36321,35804,36023,36102,
+36379,34782,34813,35220,35952,36467,35229,36258,
+34780,34275,35998,34681,35069,35348,35784,35985,
+34118,33733,33428,32643,32955,32800,32858,33113,
+32543,33822,35428,33890,33775,33093,33027,32751,
+33455,33735,33766,33139,33161,33309,33919,34056,
+34359,35656,35220,35457,35893,36399,36034,35454,
+33981,34883,33696,33479,32904,32517,32066,32071,
+31896,30958,30447,32484,32812,32985,32656,32615,
+32746,32626,32588,32595,32668,32679,32700,32709,
+32732,32760,32807,32823,32844,32860,32853,32872,
+32880,32880,32867,32875,32886,32883,32890,32904,
+32921,32905,32909,32931,32909,33012,33003,33057,
+33194,33183,33277,33025,33090,33618,33254,33089,
+33042,33383,33584,33426,33982,33854,33696,33468,
+33784,33750,34032,36374,36972,36159,35968,35833,
+33257,34198,33941,33353,34938,35990,38409,38298,
+37405,36454,35259,35042,34647,34763,36150,41398,
+37409,36891,37579,39624,36837,36302,35562,35141,
+34923,35736,35704,36552,36225,36572,35692,35448,
+35508,36443,36491,36794,35796,36391,36004,36834,
+35526,35861,36702,36690,37365,38088,37220,37638,
+36731,38749,38570,38720,37789,36804,35565,35595,
+33744,33318,33542,33695,33538,33923,34407,35262,
+34952,34962,34863,34017,33581,33614,33613,33621,
+33484,33468,33468,33468,33579,33591,33636,33909,
+33910,33911,33914,33913,33924,33927,34059,34091,
+34131,34135,34144,34064,34028,33984,33984,33927,
+33912,33928,33858,33939,33806,33875,33819,33768,
+33769,33626,33515,33419,33457,33453,33460,33454,
+33231,33159,33158,33165,33021,33003,32994,32952,
+32850,32681,32679,32581,32541,32517,32565,32610,
+32576,32569,32613,32565,32576,32595,32643,32817,
+32985,32997,32915,32655,32457,32388,32481,32761,
+33339,32937,32540,32937,33472,33888,33970,33865,
+33216,33963,32919,33406,33939,33796,32982,32172,
+32010,31998,32306,32448,32453,32537,32781,33033,
+33178,33801,34403,33433,32518,32271,32302,32586,
+32319,32131,31983,31801,31719,31653,30663,29445,
+28529,28341,26826,25753,25539,25515,25335,25359,
+25338,24859,25136,25011,24920,24744,25296,25272,
+26607,30546,32973,32986,32994,33888,36303,36920,
+37484,38460,39360,39972,40209,40270,40139,39583,
+39031,38446,35667,32995,32253,31910,31236,29047,
+27555,27591,27048,25872,25605,25534,25440,25002,
+24678,24337,24158,24230,24282,24337,24156,25299,
+25499,25802,25844,26673,27145,27024,27811,28152,
+28687,28802,28279,30363,30939,30099,29009,29164,
+29025,28788,28572,28397,28701,28603,28619,27753,
+27524,28551,27982,28366,27425,26538,26358,26525,
+26443,26493,27105,28033,28668,29199,29886,30258,
+29962,29993,30352,30554,31042,31388,32078,32596,
+32696,32862,32997,32910,32574,32594,32220,32046,
+31782,30928,28581,28098,27957,28373,29949,30516,
+30833,31198,31557,31830,31818,31771,31893,32361,
+32442,32478,32901,33397,34796,35603,34564,37252,
+35445,36238,36952,36060,35796,35116,36402,35054,
+35695,35305,34947,34338,34823,34191,33941,34171,
+34169,33741,33151,32970,32169,32244,32793,32988,
+32988,32976,32977,33219,33457,33474,33486,33441,
+33522,33370,33376,33282,33318,33468,33390,33265,
+33213,33293,33261,33228,33340,33351,33607,33585,
+33412,33446,33467,33270,33178,33096,33202,33069,
+33382,33381,33456,33371,33375,33525,33438,33231,
+33220,33367,33579,33584,33280,33180,33171,33163,
+33167,33190,33310,33549,33594,33517,33606,33486,
+33561,33408,33418,33410,33301,33463,33490,33455,
+33357,33357,33550,33469,33460,33439,33531,33467,
+33461,33417,33480,33756,34080,34123,34692,33772,
+33403,33156,33210,33155,33225,33417,33433,33441,
+33220,33435,33309,33153,33045,33153,33270,33158,
+33201,33198,33239,33219,33185,33214,33222,33193,
+33179,33174,33170,33201,33167,33263,33226,33177,
+33225,33219,33212,33225,33216,33234,33257,33273,
+33256,33294,33307,33286,33355,33358,33375,33319,
+33444,33432,33354,33487,33172,33542,33611,33543,
+33570,33500,33340,33654,33902,33714,33659,33492,
+33777,34485,34661,34506,34388,34901,34625,34778,
+35034,34483,34317,34326,34221,34204,34193,34178,
+34209,34017,34200,33938,33998,33975,34039,34332,
+34304,34324,33915,34007,34257,34249,34098,33947,
+33752,33978,33830,33986,33948,34009,33742,34098,
+34093,34171,34132,34115,33834,34008,33834,33901,
+33587,33626,33593,33432,33717,33682,33771,33984,
+33963,34072,34052,34106,33864,33796,33888,33762,
+33700,33814,33795,33926,33848,33812,33956,33853,
+33729,33750,33717,33297,33437,33477,33687,33723,
+33668,33657,33525,33737,33385,33581,33743,33396,
+33731,34089,34997,35076,35308,36455,38580,37534,
+37182,37568,39879,38221,36727,38212,37842,37251,
+36981,37563,36654,35910,36320,36342,34923,34788,
+35232,36390,36981,36021,34968,34237,34671,34790,
+34605,34591,35063,34181,35337,36324,36088,34959,
+35193,35022,35751,36473,35958,33961,34515,33899,
+33300,33128,33710,33575,34278,34223,32767,32446,
+33679,33253,33021,33584,33568,33127,33379,34461,
+34197,34351,35447,35706,36051,36288,35433,34817,
+34165,34083,34665,33269,34626,33154,33105,33150,
+32933,32177,32708,32908,32798,32881,32986,32988,
+32771,32716,32747,32707,32715,32709,32709,32733,
+32743,32757,32765,32778,32828,32838,32840,32885,
+32884,32883,32880,32892,32886,32889,32864,32883,
+32916,32929,32907,32934,32934,32937,33003,33003,
+33009,33055,33703,33739,33856,33591,33138,33122,
+33051,33689,33192,33495,33773,34128,33763,33894,
+33550,33441,33427,33577,33921,34540,35850,37070,
+36739,38614,35111,33695,34617,36381,35076,36594,
+35661,35268,35680,35388,35687,35214,35088,35608,
+35379,36606,37070,35193,34640,34983,34774,35475,
+36593,35886,36516,35907,35578,34895,34978,35616,
+34822,34846,34896,36639,35622,36325,37829,36208,
+35729,36825,35868,37383,36831,36600,37352,37483,
+38850,38207,36512,37854,37220,36240,36528,34848,
+34826,33245,33758,34371,33624,33536,33497,33456,
+33563,33588,33655,33751,33831,33912,33711,33486,
+33469,33475,33684,33684,33810,33861,33937,33946,
+34048,33568,33914,33691,33798,33468,33937,34287,
+33996,34063,34065,34117,34249,33932,33839,33937,
+34120,33899,33854,33858,33877,33705,33913,33912,
+33915,33834,33497,33246,33246,33443,33460,33413,
+33468,33280,33312,33204,33178,33143,33011,32991,
+32906,32920,32898,32675,32577,32452,32520,32640,
+32696,32693,32677,32659,32659,32633,32620,32639,
+32874,33055,33024,33036,32806,32524,32358,32209,
+32088,31995,32124,31824,31695,31749,31842,31929,
+32300,32438,32660,32932,32724,32149,31972,32133,
+32040,32735,33196,32953,32997,33563,34198,34800,
+35022,34944,31860,32384,32729,33813,32988,32755,
+32853,32480,32392,32268,32133,31127,30486,29731,
+28938,29929,29157,27546,26844,26044,25701,25781,
+25878,25693,25878,25548,27222,26876,27202,26862,
+31932,32823,32876,33174,34173,36605,37908,38861,
+39115,39792,40277,40507,40649,40797,40620,39770,
+38407,36460,34314,34032,32988,32267,32491,28125,
+27271,27132,26702,26462,26355,26878,26016,25583,
+25110,25003,24702,24480,24249,24169,24354,25105,
+25187,25648,25608,26705,26948,27359,27494,28709,
+28874,28654,28255,28915,30116,31499,31329,30677,
+29283,29271,29556,29830,29331,29475,29275,29133,
+28144,28483,28679,29031,28834,27748,27733,27414,
+27229,27105,27582,28352,29448,30279,30646,30808,
+31009,31180,31307,31473,31525,31560,31518,31502,
+31475,31891,32191,32052,31623,31058,30546,30167,
+30082,30193,30148,29265,27708,28152,28589,29132,
+29640,29997,30316,30663,30879,31114,31398,31368,
+31974,32495,32646,32697,32925,32969,33001,33255,
+34969,35883,35891,35670,36082,36303,35685,35520,
+35746,35730,35136,34557,34293,34206,34053,34088,
+33783,33597,33973,33378,32991,32556,31942,32157,
+32205,32906,33064,33232,33339,33266,33362,33504,
+33616,33537,33462,33449,33349,33293,33391,33252,
+33319,33390,33195,33253,33437,33502,33434,33558,
+33553,33620,33474,33452,33251,33069,33185,33372,
+33420,33427,33605,33558,33495,33485,33393,33246,
+33376,33462,33264,33231,33213,33037,33051,33402,
+33592,33521,33571,33491,33369,33462,33501,33466,
+33655,33597,33559,33587,33414,33375,33429,33450,
+33417,33420,33645,33675,33614,33612,33703,33571,
+33344,33384,33435,33418,33816,33530,34607,34509,
+33193,33412,33453,33123,33161,33209,33170,33179,
+33111,33129,33021,33392,33501,33361,33457,33422,
+33223,33310,33305,33247,33288,33280,33251,33248,
+33240,33246,33263,33306,33261,33260,33290,33283,
+33274,33286,33318,33281,33267,33297,33333,33417,
+33353,33435,33520,33516,33421,33497,33510,33571,
+33416,33453,33529,33496,33273,33132,33149,33180,
+33195,33263,33423,33489,33558,33732,34197,34394,
+34452,34668,34503,34799,34374,34314,34299,34452,
+34547,34581,34440,34179,34945,34528,34506,34532,
+33873,33962,34134,34176,34179,34533,34061,34185,
+34134,34200,34110,33994,33969,33907,34165,33976,
+33746,34107,34050,34074,33992,33862,33705,33973,
+33925,34146,33979,34047,34172,33830,33647,33827,
+33698,33616,33473,33393,33750,33680,33804,33805,
+33737,33762,33882,33948,33882,33909,33946,33990,
+33803,33795,33886,33668,33770,33516,33561,33663,
+33565,33644,33597,33195,33380,33375,33530,33596,
+33574,33663,33639,33642,33441,33321,33359,33509,
+33635,33926,34503,35305,36554,36881,36972,38571,
+37355,39596,37320,36738,36475,36499,35760,35899,
+36443,36039,37198,36135,36355,35196,35784,35302,
+35287,35769,36774,34894,34518,33936,34380,34145,
+33596,34173,34191,34362,34113,34999,35153,35346,
+34896,35315,36147,36597,35732,34876,34982,34014,
+34315,33902,34231,33351,33666,33615,33282,33781,
+33346,33282,34024,34339,34109,33124,33340,33813,
+33515,33829,34260,35088,34978,35040,34764,34623,
+34881,34196,34386,33540,34065,33750,34056,34584,
+34605,33450,33128,33496,33952,33670,33377,32852,
+32796,32761,32736,32723,32706,32716,32721,32742,
+32742,32736,32748,32757,32779,32785,32829,32832,
+32814,32887,32892,33007,33728,33031,33001,32888,
+32911,32913,32939,32931,32928,32952,32942,32994,
+32922,32886,32826,33229,34053,34119,33471,33955,
+33162,33380,33075,33087,33343,33571,33636,34206,
+33790,33344,34185,33465,33498,33870,34042,34516,
+34972,36095,38205,38373,36340,35596,37363,36213,
+35823,36906,36400,37405,36233,37367,38342,37492,
+37313,35890,34970,34932,35271,35152,35109,34819,
+35271,34626,34662,35023,35186,35775,36177,35314,
+37279,36336,36135,36083,36476,37786,36904,36617,
+37133,36602,36763,37834,37429,38205,38392,37242,
+38061,38998,36901,36892,36042,35706,35317,34773,
+33551,34383,34087,34006,33904,34374,34002,34002,
+33891,33778,33798,33798,33795,33758,33557,33572,
+33471,33620,33914,33888,33912,33915,34015,34280,
+34386,34837,34091,34525,34323,34059,34021,34133,
+34077,34098,34107,34089,33981,33967,33657,33917,
+33925,33926,33811,33707,33705,33705,33900,33912,
+33924,33835,33703,33564,33446,33312,33452,33458,
+33411,33375,33290,33432,33135,33204,33088,33096,
+33417,33347,33000,32862,32679,32595,32548,32496,
+32712,32814,32844,32826,32865,33128,32968,32811,
+32875,32588,32598,32499,32547,32568,32574,32444,
+32376,32346,32499,32979,33170,32827,32732,32581,
+32204,32027,31891,31944,32093,32103,32358,32404,
+32996,33962,33529,33903,33918,34574,34898,33512,
+32981,32922,33717,33543,34711,34554,32938,32925,
+32231,32499,32298,32205,32255,31917,31791,31020,
+29794,30015,30303,29154,28044,27089,26883,27718,
+27328,28566,28902,29445,29618,27962,28417,32267,
+32859,32969,33414,33503,34806,37281,38354,39072,
+39605,40173,40712,40977,41137,41316,41433,41052,
+40179,38994,36711,34089,34103,32997,32485,32174,
+30779,28104,28065,27957,27579,27965,26323,25944,
+25806,25345,25104,24891,24633,24517,24433,24290,
+24743,25341,25211,25816,26682,27165,27863,27822,
+28351,29169,29463,29698,30521,31970,32125,32446,
+32127,31917,32159,32058,32359,32361,32541,32571,
+30866,30304,31750,32678,32688,31168,30397,29793,
+29522,28527,28336,28494,29249,30581,31348,31716,
+31710,31709,31808,31865,31565,31527,31421,31318,
+30649,29583,28895,27876,26904,26410,25811,25251,
+25397,25436,25524,25923,26840,27192,27588,27565,
+27919,28473,28935,29311,29605,29847,29924,29721,
+29652,29898,31122,32568,32652,32499,32603,32988,
+32997,34397,34282,33185,33340,34174,34700,35456,
+35913,35244,34524,34378,33882,34174,33816,34057,
+34076,33673,33510,33679,33405,33015,32930,32640,
+32580,32972,33004,32997,33009,33137,33237,33258,
+33525,33600,33498,33489,33328,33383,33256,33502,
+33369,33485,33343,33273,33510,33519,33657,33617,
+33489,33654,33370,33330,33402,33332,33423,33465,
+33546,33592,33645,33600,33498,33200,33151,33462,
+33441,33228,33093,33067,33126,33396,33398,33586,
+33511,33526,33551,33460,33612,33432,33465,33417,
+33393,33494,33405,33555,33507,33444,33429,33410,
+33506,33599,33535,33509,33362,33342,33379,33305,
+33379,33377,33525,33816,34049,34541,34746,33735,
+33231,33089,33018,33319,33173,33126,33045,33102,
+33093,33114,33104,33338,33163,33319,33277,33198,
+33345,33326,33399,33368,33414,33378,33390,33396,
+33309,33323,33370,33369,33453,33345,33330,33373,
+33310,33338,33265,33190,33216,33222,33295,33318,
+33429,33536,33460,33564,33564,33207,33234,33384,
+33201,33359,33423,33354,33229,33092,33077,33090,
+33282,33741,33347,34047,34062,34166,34086,34050,
+34408,34680,34553,34601,34674,34010,34278,33796,
+34005,34326,34201,34524,33837,34106,34662,33772,
+34492,34986,35283,34748,34344,33867,34060,34115,
+34801,33878,34014,33872,33820,33809,33735,34026,
+33875,34317,34032,33951,33978,33903,33858,34065,
+33978,34086,33877,33786,33884,34014,33641,33756,
+33617,33576,33615,33411,33349,33462,33700,33469,
+33430,33475,33456,33539,33624,33629,33545,33562,
+33612,33606,33597,33574,33594,33528,33327,33377,
+33489,33291,33561,33278,33386,33229,33477,33494,
+33269,33438,33277,33456,33469,33560,33585,33714,
+33704,34034,35467,36159,35976,37092,37632,37622,
+37326,36472,36519,35631,35856,35540,35265,35261,
+36558,36990,36428,36171,36607,35754,36006,35859,
+36992,35784,34858,35055,35068,35144,35793,34617,
+34854,34348,35311,34366,33895,34464,35346,34599,
+34860,34957,35595,35674,35226,36186,35201,35451,
+35353,35416,34371,35079,35045,34973,34041,35130,
+34401,34008,33744,33931,34070,33665,33316,33129,
+33284,34054,33525,33781,34569,34083,35220,33855,
+34318,33944,33587,33687,33530,33597,34395,34563,
+34536,33866,34050,34766,34136,33261,33198,32858,
+32832,32807,32771,32750,32736,32713,32705,32706,
+32718,32741,32743,32759,32815,32848,32811,32862,
+32949,32902,32905,32913,32883,32904,32904,32910,
+32910,32908,32919,32917,32922,32952,32952,32966,
+32952,32956,32950,32920,32753,32550,33474,33897,
+34057,33090,33252,33138,33089,33196,33141,33413,
+34060,34153,33612,34091,34608,33584,33901,33677,
+33709,33740,34947,34943,35817,36186,36368,36621,
+37032,38826,36885,36024,35582,36312,34457,34334,
+35405,35753,35181,36093,36153,35787,36691,34809,
+34403,34614,35490,35620,34776,36251,36159,36738,
+35006,36351,37352,37096,35595,35364,36357,36855,
+36240,37043,37684,37733,37867,38517,36755,37842,
+37379,37357,36669,35471,35450,34776,33955,33972,
+34465,34677,33729,33828,34081,34458,33919,34119,
+34331,34800,34212,33884,33907,33710,33545,33797,
+33808,33918,33915,33962,33984,34178,34209,34411,
+34382,34695,34353,34293,34200,34139,34236,34143,
+34136,34098,34083,34064,34026,33935,33669,33729,
+33915,33936,33906,33481,33940,33652,33635,33501,
+33470,33434,33460,33449,33450,33292,33318,33426,
+33129,33234,33162,33084,33057,33055,33028,32983,
+33000,33022,33093,33003,32968,32847,32813,32607,
+32604,32934,33024,33003,32998,33210,33054,33026,
+32961,32808,32835,33010,33003,33211,33138,33000,
+32642,32114,32261,32277,32366,32488,32403,32124,
+32307,32350,32361,32478,32502,32895,32997,33000,
+32996,33616,33844,34735,34483,34090,33046,33591,
+33690,34948,34859,35149,35009,34151,33183,33022,
+32496,32385,32090,32416,32380,32298,31878,31345,
+30886,31051,30458,29530,29154,28953,29157,29712,
+29339,29132,29561,29269,28973,29781,32797,32657,
+32937,33574,35808,35471,37428,37440,37867,38749,
+39470,40045,40415,40709,40989,41217,41460,41506,
+41227,40598,39458,37668,36190,32998,33003,31388,
+32169,32270,32332,32278,32206,32119,29304,27638,
+26644,26466,26303,25874,25321,24975,24826,24733,
+24510,24915,25697,26067,26931,27204,28065,28479,
+28846,29244,30266,31590,31878,31806,31688,32484,
+32537,32785,32562,32672,32649,32798,32837,33077,
+34094,35766,33805,33205,33001,32687,32723,32640,
+32403,32637,32292,31680,30009,30434,31215,31776,
+31993,31833,31761,31412,31142,31020,30889,30324,
+29520,28140,27300,26300,25299,24924,24807,24712,
+24771,24282,24301,24733,25052,25397,25968,26160,
+26353,26428,26979,27904,28438,28931,28855,28719,
+28605,28934,30370,31879,32310,32355,32292,32406,
+32839,33112,32070,33192,33990,33705,33039,33911,
+34615,34902,34443,34404,34513,34027,33969,33793,
+34026,33630,34081,33844,33931,33758,33624,33332,
+33043,32943,32807,32827,32987,32997,33069,33231,
+33317,33424,33315,33481,33426,33402,33501,33429,
+33682,33489,33535,33546,33663,33724,33684,33674,
+33652,33427,33367,33426,33249,33231,33326,33416,
+33228,33265,33169,33158,33209,33108,33078,33117,
+33180,33138,33129,33139,33110,33194,33426,33507,
+33288,33202,33285,33461,33539,33519,33422,33334,
+33456,33567,33471,33655,33472,33593,33504,33421,
+33556,33671,33464,33357,33410,33473,33504,33468,
+33423,33350,33401,33507,33667,33940,34377,33794,
+33293,33495,33150,33098,33187,33364,33234,33179,
+33235,33041,33018,33015,33051,33066,33058,33145,
+33111,33169,33262,33310,33258,33285,33342,33344,
+33240,33221,33287,33284,33311,33267,33198,33201,
+33184,33176,33149,33141,33195,33201,33192,33224,
+33192,33205,33224,33207,33108,33129,33204,33152,
+33277,33238,33224,33223,33157,33072,33052,33168,
+33645,33762,33910,33935,33865,34086,33875,33874,
+34777,34425,34385,33971,34342,34786,33918,34072,
+34587,34229,33868,33444,33527,35073,34796,34605,
+34153,34317,34410,34539,34717,34382,34454,33708,
+33996,34413,33864,34023,33877,34008,33919,34025,
+34335,34371,33889,34198,34029,34141,34172,34173,
+34220,34074,34173,34152,34113,33986,33807,33909,
+33542,33544,33543,33465,33336,33444,33503,33502,
+33474,33434,33304,33333,33392,33348,33387,33368,
+33355,33441,33357,33264,33179,33192,33237,33196,
+33201,33632,33453,33607,33706,33671,33717,34197,
+34168,34459,35065,34455,34886,35856,36464,35198,
+35550,35022,35248,36299,37008,37015,37435,37078,
+37427,36722,36390,36297,35233,36521,35664,36264,
+38471,37499,36165,35819,36192,36438,37025,38394,
+36960,36064,36090,35253,35050,34233,35178,34790,
+33740,34159,33456,33808,33486,34552,34348,33978,
+34816,34801,35145,35145,35460,36031,36230,34614,
+35021,35001,34797,35583,34539,35142,35398,34973,
+35104,35012,34675,35012,34526,34094,34014,33267,
+33365,33249,33510,34203,33417,33316,33571,33445,
+34510,34421,34599,33486,33831,33164,33232,33255,
+33321,33151,33012,33006,33060,33022,32874,32826,
+32887,32847,32817,32782,32760,32760,32778,32789,
+32794,32796,32790,32791,32873,32964,32924,32902,
+32853,32865,32907,32910,32900,32896,32893,32887,
+32907,32910,32910,32919,32940,32943,32940,32939,
+32932,32941,32931,32941,32943,32972,33750,33900,
+34313,33934,33325,33216,34946,33704,33810,33639,
+33507,33639,33555,33825,33816,34434,33917,34337,
+34873,33729,33546,33507,33636,33687,34301,33928,
+34047,34107,33970,34035,34110,34318,34563,35550,
+37204,35844,36449,36609,34474,35568,35599,35691,
+34983,34858,37132,36778,37154,36592,37444,36224,
+36351,36920,35190,35921,36130,36173,37243,37740,
+37614,38652,37480,37503,36371,37985,37756,36877,
+34984,35025,36168,35145,34456,33618,33461,34752,
+35409,33967,33932,34020,33534,33754,33919,34386,
+34286,34219,34039,34092,33912,33582,33923,33849,
+33916,33812,33925,34061,34269,34254,34419,34541,
+34292,34281,34290,34200,34249,34113,34107,34098,
+34282,34099,34037,33984,34105,33997,33919,33856,
+33454,33456,33366,33358,33523,33594,33503,33468,
+33369,33342,33456,33475,33409,33319,33093,33006,
+33006,33006,33018,33139,33056,33172,33231,33274,
+33244,33455,33161,33049,33019,33450,33370,33059,
+32823,32692,32886,33003,33210,33159,33237,33478,
+33455,33261,33288,33309,33012,32494,32058,32097,
+32099,32352,32364,32405,32413,32984,33153,32985,
+32970,32975,32956,32991,33000,33001,33465,33631,
+33876,33849,33590,33561,33483,33777,34120,34532,
+34883,34836,34980,35106,35044,32928,33150,32501,
+32251,32236,32538,32296,32137,32173,32032,31919,
+31969,31476,30732,30312,30414,30737,30913,30648,
+29977,29735,30214,31613,32431,31917,32490,32922,
+32990,33994,34352,33966,34678,35755,37545,38607,
+39381,39882,40285,40603,40882,41155,41380,41451,
+41157,40679,39765,38754,36803,33458,33435,32574,
+32257,31872,31800,31145,31179,31446,31756,31908,
+31545,28677,27725,27124,27054,26366,25974,25547,
+25268,25162,25197,26049,26955,28144,28686,29242,
+30070,30768,31842,31993,32039,32213,32394,32259,
+32469,32694,32856,32845,33952,33606,33717,33559,
+34542,34101,34862,35215,36374,35789,37452,35604,
+33673,32990,32790,32667,32626,32537,32330,31632,
+31931,32028,31830,31380,30883,30164,28749,27369,
+26601,26202,24659,23414,23081,22862,22951,23409,
+23823,24041,23972,24321,24319,24764,25032,25235,
+25452,25587,25475,25950,26490,27000,27548,27657,
+28290,28927,29731,31326,31929,32033,32030,32159,
+31947,31659,32249,32130,32971,34064,33366,34014,
+33153,34169,35205,34435,35457,34494,34045,33936,
+33943,34105,34003,34008,34053,33779,33766,33726,
+33676,33298,32970,32756,32702,32834,32898,33009,
+33149,33232,33404,33291,33365,33467,33357,33470,
+33564,33576,33571,33488,33796,33735,33642,33582,
+33536,33438,33352,33294,33185,33162,33109,33105,
+32962,32961,32949,32967,33409,33418,33477,33227,
+33216,33177,33107,33030,33137,33120,33239,33240,
+33179,33177,33249,33288,33156,33311,33605,33522,
+33432,33306,33558,33557,33677,33993,33576,33548,
+33765,33475,33335,33367,33441,33486,33414,33356,
+33442,33439,33441,33323,33600,33717,34629,34459,
+33742,33127,33057,33049,33124,33290,33470,33263,
+33468,33269,33093,33054,33055,33441,33485,33223,
+33273,33319,33230,33362,33390,33377,33292,33348,
+33225,33276,33183,33237,33251,33200,33247,33216,
+33135,33105,33216,33189,33105,33108,33126,33096,
+33079,33074,33315,33119,33211,33352,33326,33417,
+33267,33205,33255,33426,33139,33118,33156,33184,
+33525,33705,33972,34293,34304,34600,34337,34545,
+34181,33996,33918,33540,33702,34076,33762,33701,
+35020,35255,34049,34719,34133,33908,34507,34203,
+34062,34110,34436,34371,34435,34299,34126,34419,
+34619,34541,34314,34623,34175,34032,34925,34829,
+34404,34130,34368,33902,34368,34477,34228,34404,
+34372,34240,34330,34025,34068,34086,33863,33837,
+33695,33593,33610,33582,33540,33567,33498,33631,
+33653,33378,33567,33485,33531,33515,33538,33490,
+33438,33376,33294,33217,33180,33099,33592,35418,
+34395,34031,35874,34847,34326,35308,35468,36152,
+35497,37834,37576,37342,35838,36317,36500,34959,
+35280,35523,35655,35952,36872,37239,37435,36530,
+36344,35853,35224,35720,35268,34656,36848,38140,
+36771,35726,36066,36470,36905,37296,37788,36951,
+36546,35269,34164,34740,35217,35293,33695,33547,
+33717,34368,34075,33941,33778,33623,34216,34257,
+34406,35278,34944,34710,35679,34876,34966,35973,
+35262,34835,34664,34794,34504,35721,35562,34774,
+34171,34928,33966,34307,34989,34684,34391,34871,
+34452,34225,33546,33676,33181,33414,33136,33183,
+33575,34536,33362,33360,33189,34071,33611,33081,
+33032,33063,33066,33048,33004,32973,32952,32926,
+32877,32844,32819,32813,32825,32827,32820,32835,
+32832,33043,32993,33531,33642,33114,32979,33055,
+32895,32871,32865,32850,32860,32883,32877,32887,
+32907,32910,32937,33432,33667,33519,33677,33570,
+33568,33084,33852,33657,32999,32988,33139,33874,
+34241,34350,33996,33282,33230,33122,33148,33384,
+33184,33333,33304,33279,33360,33802,33784,33471,
+33610,33654,33579,33449,33270,33315,33652,33447,
+33396,33468,34392,34176,34770,34740,35034,36311,
+36510,37218,36729,36132,37236,34868,35181,37056,
+36801,37676,37108,36879,36892,36622,36609,36153,
+37854,37020,37926,37459,36110,37196,37572,38562,
+38223,37808,37854,37390,36204,37182,37813,36558,
+36429,35104,34335,33843,33789,33372,33328,33954,
+33862,33693,33587,33575,33584,33527,33925,34100,
+34769,34842,34158,33568,33635,33909,33882,33927,
+33923,34023,34246,34485,34523,34470,34448,34277,
+34395,34413,34460,34419,34371,34237,34284,34124,
+34013,34091,34035,33919,33908,33916,33801,33826,
+33923,33624,33479,33505,33445,33591,33452,33291,
+33268,33457,33372,33393,33228,33277,33171,33398,
+33439,33454,33389,33389,33356,33451,33461,33496,
+33536,33477,33449,33468,33623,33660,33662,33453,
+33219,32955,32841,33017,33132,33185,33546,33912,
+33965,34025,34062,32811,32220,32087,31913,32241,
+32311,32363,32668,32990,33482,33811,33459,33247,
+33099,33024,32998,33028,33298,33429,33669,33471,
+33336,33336,33435,33462,33750,34083,34452,34624,
+34815,34734,33812,33984,33955,32898,31582,31188,
+31792,32320,32130,32113,32109,32084,31903,32010,
+31980,31755,31483,30971,30825,30651,30760,30569,
+30291,31122,32170,32552,32635,32340,32172,32730,
+33660,33277,33424,33365,34774,36537,37532,38414,
+39398,39928,40220,40489,40754,41019,41194,41157,
+40944,40457,39647,39059,37701,35923,33399,32939,
+32461,32103,31498,31206,31863,31761,31172,31183,
+31719,31881,29619,29760,29253,28113,27016,26484,
+26115,26080,26129,26079,26722,28918,29294,29640,
+30486,31682,32235,32337,32378,32428,32331,32534,
+33116,32885,32950,33090,33519,33724,34243,35775,
+35794,35198,36567,35289,35962,37201,36021,35710,
+35437,35421,34937,34347,32823,32595,32547,32458,
+32156,31643,31734,31176,28689,27194,25489,25432,
+26302,25675,24043,21919,23814,24408,23275,23296,
+23345,23469,23247,23838,24061,24387,24602,24702,
+24920,24889,24667,24486,24701,26304,27033,28877,
+29987,30540,30935,31713,32105,32254,32272,32334,
+32388,32625,32403,32097,32318,32954,33126,33656,
+33654,33612,34280,34772,35000,35324,34623,34528,
+34031,34164,34486,34241,33855,33920,33676,33903,
+33706,33262,33003,32791,32713,32750,32784,32892,
+32951,33093,33155,33115,33273,33420,33471,33593,
+33583,33557,33584,33688,33713,33584,33483,33387,
+33354,33434,33333,33279,33190,33012,32968,32977,
+32964,33300,33318,33231,32996,33025,32925,32928,
+33049,33054,33180,33332,33333,33299,33135,33132,
+33189,33265,33212,33167,33209,33648,33411,33241,
+33344,33642,33432,33747,33829,33631,33609,33618,
+33441,33465,33360,33330,33408,33462,33450,33423,
+33250,33483,33354,33242,33527,34161,33956,34695,
+33954,33903,34013,33276,33317,33435,33267,33158,
+33092,33157,33027,33117,33066,33103,33095,33120,
+33226,33216,33224,33247,33245,33168,33184,33198,
+33192,33171,33207,33119,33189,33204,33198,33171,
+33137,33090,33035,33120,33113,33121,33148,33107,
+33100,33118,33017,33134,33120,33209,33313,33358,
+33301,33393,33377,33374,33135,33129,33099,33087,
+33552,33711,33676,34849,34490,33719,34470,34363,
+34143,33931,34127,33597,33987,34223,34290,34220,
+34208,33996,34849,34943,35016,35054,34526,34419,
+34119,33973,34044,33846,34086,34446,34478,34509,
+34521,34565,34674,34477,34812,34215,34205,34123,
+34458,34440,34374,34361,34314,34836,34471,34424,
+34192,34259,34019,33906,33934,33648,33971,33908,
+33792,33616,33695,33741,33722,33678,33541,33576,
+33515,33501,33530,33614,33629,33591,33554,33504,
+33468,33180,33130,33148,33405,33818,35216,35898,
+36990,36096,36241,36984,36900,36187,35760,37633,
+36862,36631,36559,36621,36522,36216,36605,35421,
+35887,36185,35683,36647,36523,35902,35976,36271,
+36704,36322,35129,35725,35971,36332,35117,35610,
+36466,36249,36623,37685,38741,36742,35946,35114,
+35005,35490,35451,34056,33723,33402,33325,33472,
+33928,33899,33837,33240,34008,34200,33769,33837,
+33940,33864,34434,34381,35088,35341,34625,36018,
+34301,34149,34406,35387,35312,35613,36345,34806,
+35205,35588,35027,35235,34805,34419,35348,34683,
+34692,34194,33549,33138,33081,33011,33020,33754,
+34279,33582,33218,33118,33016,33162,33027,33159,
+33018,32985,33024,33141,33182,33081,32994,32929,
+33093,32862,32847,32901,32917,32917,32892,32915,
+33275,34362,33887,34323,33456,34333,33149,33014,
+32917,32910,32880,32883,32865,32864,32845,32855,
+32907,32949,32983,33306,33052,33033,33164,33911,
+34442,33774,34203,33717,33138,33245,33192,33666,
+34144,34522,33582,33641,33345,33225,33211,33275,
+33649,33996,33870,35402,34947,33873,33705,33541,
+33769,33830,34170,34561,34530,33651,33307,34290,
+34496,34182,34746,35256,35178,34743,35780,34806,
+35677,35037,33930,34734,34381,35028,35844,35672,
+35724,35948,36176,35835,35544,35530,36105,36234,
+36510,35134,35991,36011,37159,36966,37990,37425,
+37705,34724,36373,36258,36348,35772,35492,34056,
+33777,33446,33101,34901,33981,33291,33732,33880,
+33495,33607,33468,33468,33468,34165,33618,33468,
+33682,33816,33540,33751,33867,33892,34091,34084,
+34145,34343,34593,34571,34158,34508,34269,34268,
+34419,34526,34488,34494,34363,34506,34431,34263,
+33962,33927,33929,33887,33920,33894,33737,33693,
+33599,33561,33616,33604,33567,33575,33489,33524,
+33527,33468,33609,33429,33453,33426,33456,33429,
+33390,33516,33461,33468,33531,33819,33792,33898,
+33858,33750,33877,33907,33938,33753,33820,33082,
+33024,33039,32850,32937,33183,33085,33081,33376,
+32328,32028,32392,32160,31918,32013,32505,32587,
+32730,32776,32838,32901,32943,33090,33041,33063,
+33003,33003,33012,33054,33062,33287,33226,33464,
+33392,33337,33474,33896,34002,34107,34037,34292,
+34073,33181,32971,31893,31171,30756,33210,33966,
+33833,33087,32451,32455,32225,32199,32128,31848,
+31683,31693,31614,31299,31101,31077,31119,30818,
+30687,31033,32574,32575,32705,32442,32685,33552,
+34699,34066,34273,34839,35877,36853,37545,38319,
+39118,39588,39965,40248,40470,40669,40802,40718,
+40489,40094,39417,38466,37314,35900,35406,34762,
+33110,32895,32499,32186,32161,32422,32421,32401,
+32352,32241,32178,32286,32173,30357,29197,28725,
+29055,29301,29343,29157,28561,28449,29054,29752,
+30855,31929,32403,32542,32577,32677,32743,32739,
+32853,32836,32991,34404,33361,33533,33592,34285,
+34395,34965,34968,35082,35730,34533,34638,34498,
+34974,34371,34681,35314,34163,32604,32526,32467,
+32380,31177,30982,30844,30634,30678,29793,29665,
+28193,27285,26841,24684,25478,22336,22818,23220,
+23289,23816,23202,23519,23645,23840,23995,24244,
+24618,24606,24172,24705,24345,26124,28541,29373,
+29820,30482,31038,31267,31988,32157,32094,32148,
+32067,32105,32107,32176,32504,32199,32942,32990,
+33068,33511,34335,36339,36146,35175,35485,34483,
+34585,34035,34668,34101,34076,33909,33894,33999,
+33948,33660,33146,33002,32940,32907,32778,32917,
+32963,32983,32996,33186,33368,33333,33372,33512,
+33702,33795,33677,33674,33426,33405,33424,33396,
+33437,33306,33333,33226,33144,32979,32848,32856,
+32807,32845,32755,32703,32697,32704,32805,32911,
+33221,33317,33360,33319,33430,33390,33096,33114,
+33147,33150,33074,33137,33249,33351,33309,33361,
+33565,33624,33489,33771,33668,33273,33301,33321,
+33300,33235,33168,33258,33159,33309,33348,33246,
+33261,33197,33289,33456,33314,33493,33803,35496,
+35596,35595,35683,34179,33234,33476,33337,33389,
+33487,33013,33048,33113,33105,33036,33075,33270,
+33219,33189,33150,33087,33195,33282,33185,33150,
+33033,33078,33049,33117,33210,33202,33244,33226,
+33188,33109,33062,33051,33168,33129,33136,33180,
+33119,33135,33097,33040,33127,33138,33205,33309,
+33339,33250,33272,33222,33118,33098,33143,33087,
+33554,33628,34484,34422,34349,34497,34383,34442,
+33974,34045,34892,33885,34248,34556,34751,34059,
+34599,35032,35160,34952,33908,34890,34674,34681,
+34436,34065,34133,34589,34369,34393,34581,34982,
+34709,34869,34426,34529,34663,35205,34289,34240,
+34219,34305,34167,34524,34863,34380,34415,34666,
+34620,34587,34260,34323,34249,34112,34038,33616,
+33989,33756,33713,33717,33552,33504,33554,33523,
+33488,33595,33642,33687,33644,33406,33387,33431,
+33094,33105,33228,33610,33792,34626,34931,35660,
+36482,35985,36958,36774,36883,35688,35253,35631,
+35932,35796,35750,35702,35323,35800,35766,35108,
+35351,35638,36160,36878,36477,36385,36081,36009,
+37110,36621,37801,36709,35822,35596,36011,38058,
+37701,35814,38075,37626,37986,34723,35450,38247,
+35793,34932,36324,33474,33321,33221,33199,33590,
+33892,34233,34587,34564,34156,34836,33597,34049,
+34480,33895,34283,34094,34511,34494,34353,34806,
+33930,33905,34470,35176,35445,36109,36201,35131,
+35070,34864,36594,35096,35457,35322,34886,33671,
+33702,33481,34041,34455,33456,33281,33060,33063,
+33153,33231,33255,33010,33483,33084,33092,33085,
+33140,33056,33009,33168,33726,33803,33144,33004,
+33144,32853,32913,33125,33744,33555,33998,33456,
+33471,33730,33482,34073,33201,33132,33112,33523,
+33917,33073,34105,32887,32880,32823,32832,32867,
+33003,33167,33202,33678,33493,34239,33954,33894,
+33809,34559,33738,33618,33134,34207,33225,33335,
+33520,33841,33978,34041,33722,33238,33189,33150,
+33226,33230,33252,33609,33984,34078,34153,34392,
+35723,35690,35994,34832,34029,33916,33821,34324,
+34896,34341,34899,34978,34169,35198,34818,34004,
+34124,34031,34080,34036,34410,34566,35375,36573,
+35038,35787,35730,34856,34598,34731,34764,34614,
+34800,33925,34527,34693,34671,34403,34807,35121,
+34580,34862,34529,33751,33438,33375,33084,33378,
+33735,34049,33639,34110,34051,34038,33679,33913,
+33609,33852,34326,33587,33468,33468,33468,33468,
+33545,33889,33468,33468,33912,33912,34197,34181,
+34505,34587,34484,33947,34288,34664,34491,34521,
+34656,34467,34300,34354,34643,34404,34137,34234,
+34072,33894,33849,33897,33864,33911,33891,33841,
+33726,33639,33570,33472,33528,33552,33456,33486,
+33468,33457,33393,33449,33457,33432,33351,33410,
+33459,33615,33813,33906,33908,33945,33913,33903,
+33969,33933,33742,33896,33255,32979,33815,33549,
+33484,33386,33103,32860,33049,33100,33662,32767,
+33005,32930,32369,32421,32421,32499,32580,32670,
+32713,32755,32807,32856,32901,32930,32947,32959,
+32962,32961,32956,32958,32988,33099,33216,33556,
+33228,33306,33493,33503,33683,33831,33892,33480,
+33019,32969,32153,31005,32993,34119,33831,35089,
+33672,34384,33280,32967,32464,32145,32013,31688,
+31302,31446,31570,31413,31287,31091,31040,31098,
+31449,32605,32649,32703,32676,33002,33692,35760,
+34608,34566,33489,35747,36334,36921,37578,38195,
+38728,39198,39584,39897,40149,40353,40545,40612,
+40416,40120,39717,39220,38217,37206,36930,36264,
+35471,34607,34445,33995,33900,33255,33020,32998,
+32291,32253,32226,32315,32071,32115,32088,32093,
+32100,31909,31752,31779,32048,31569,30550,30466,
+30888,31485,32058,32498,32402,32658,32811,32761,
+33243,33669,34486,34298,33389,32744,32866,33381,
+33873,34384,35372,33726,34395,33644,34920,34154,
+35017,34368,33729,32688,32409,32360,32319,32424,
+32340,30522,29881,30083,30605,30647,30500,29550,
+28538,27748,26066,24286,24871,24693,22948,21698,
+24024,24084,23032,23056,23160,23152,23256,23641,
+24235,24039,24165,24363,26517,28100,28802,29037,
+29403,30087,30636,31266,32102,31810,31953,31999,
+31898,31738,31851,31980,32028,32070,32369,32973,
+32987,34965,33515,35107,36204,35004,34443,35672,
+34770,34836,34224,34454,34305,34399,34357,33943,
+33794,33562,33249,33051,33081,33069,33003,33010,
+32992,33108,33182,33348,33426,33430,33453,33678,
+33855,33760,33767,33862,33798,33581,33417,33333,
+33383,33277,33236,33233,33144,33015,32835,32520,
+32345,32422,32609,32682,32738,32797,32838,32850,
+33099,33205,33246,33168,33229,33344,33070,33114,
+33030,33078,33100,33165,33126,33160,33163,33218,
+33291,33319,33247,33309,33291,33336,33350,33405,
+33090,33439,33285,33234,33296,33190,33403,33284,
+33162,33174,33181,33207,33295,33288,33210,33439,
+33608,34108,33764,34274,34878,34554,33503,33249,
+33037,33007,33020,33027,33018,33060,33078,33044,
+33154,33112,33132,33101,33138,33117,33032,33021,
+33045,33042,33146,33156,33120,33175,33281,33274,
+33267,33114,33089,33058,33043,33074,33098,33135,
+33126,33121,33151,33090,33047,33106,33162,33251,
+33144,33189,33120,33062,33089,33108,33045,33080,
+33396,33367,34098,33632,33471,34109,34196,33901,
+34149,33693,34096,34926,34661,34209,34908,35089,
+34932,34736,35105,34861,34608,34657,34338,34434,
+34620,34259,34550,34656,34906,34950,34492,35089,
+34231,34272,34206,34290,34379,34645,34700,34526,
+34403,35118,35054,34710,34597,34598,34894,34200,
+34260,34703,34248,34323,34020,34139,33768,34029,
+34048,33958,33927,33813,33745,33662,33600,33552,
+33593,33635,33569,33482,33577,33407,33299,33189,
+33074,33321,33602,33960,34269,35285,35196,35364,
+35126,36486,37703,36992,36477,35191,35006,34479,
+34540,35006,35235,35634,35251,35644,35552,34974,
+35331,35211,36594,35261,36313,36788,38815,37188,
+37281,36915,37593,36144,35422,34142,35145,35338,
+34602,34956,35199,35180,34650,36333,36310,35649,
+36020,34383,34093,33392,33219,33139,33172,33456,
+34260,34207,34218,34497,34640,34333,34530,33492,
+33795,33763,34137,34111,33792,33598,34119,34630,
+35040,36063,34707,34345,35265,35169,35138,35146,
+35798,36111,35941,36020,34908,35761,35101,34029,
+34874,33939,33827,33701,34194,33872,33406,33237,
+33547,33190,33060,33300,34026,34419,33331,33114,
+33702,33881,33028,33846,33168,33301,33408,33402,
+33759,33006,33461,33076,34012,34014,33891,33765,
+33507,33378,33390,33054,33738,33276,33413,34338,
+34197,33460,33150,33159,32895,32835,32835,32838,
+32947,32932,32949,32985,33078,33095,33027,33021,
+32977,32969,32964,32967,32983,32997,33519,33239,
+33461,33122,33805,33831,34027,34545,34273,33960,
+33604,33558,33437,34123,34140,33759,33947,33543,
+33936,33645,34635,34456,33403,33298,33289,33300,
+33302,33321,33345,33395,33405,33421,33449,33499,
+33752,33771,34014,34067,33785,34217,35263,36186,
+35413,35031,34833,34431,35217,35385,34835,35007,
+35765,34985,34341,34183,33678,33510,33582,33574,
+33572,33418,33291,33192,33234,33269,33084,33475,
+33948,33414,33494,33856,33870,33878,33468,33468,
+33468,33468,33653,33788,33468,33468,33468,33468,
+33468,33468,33468,33468,33579,33913,34031,34290,
+34476,34177,33984,33982,33972,34068,34276,34769,
+34506,34212,34271,34346,34396,34055,33927,34032,
+33946,33413,33915,33898,33912,33700,33804,33773,
+33691,33622,33539,33528,33486,33480,33471,33610,
+33540,33455,33457,33456,33389,33436,33456,33282,
+33451,33515,33974,33903,33915,34011,34026,33885,
+33901,33904,33857,33969,34107,33995,33900,33917,
+33660,33453,33357,33116,32573,32880,33189,32977,
+33081,33012,32897,32700,32703,32703,32695,32699,
+32712,32749,32788,32829,32865,32894,32916,32934,
+32946,32958,32970,33003,33014,33090,33160,33218,
+33239,33098,33090,33090,33090,33105,33437,33258,
+33174,32997,32673,33354,35499,36180,33556,36487,
+35221,36737,33736,33303,32814,32492,31801,31674,
+31044,30936,31212,31147,31429,31041,31191,32545,
+32436,32403,32703,32845,32925,34905,35157,39120,
+38092,35447,36329,35742,35718,36369,37295,37890,
+38530,38951,39292,39588,39852,40079,40296,40488,
+40589,40453,40208,39940,39395,38699,38403,37993,
+37762,37227,36386,35754,33258,35905,37407,35101,
+34286,33699,32634,32207,31917,32083,32108,32108,
+32103,31790,31551,31763,32075,32110,32158,31904,
+31701,31502,31296,31404,32220,32572,32712,32747,
+32825,32461,33904,34277,32933,32664,32277,32712,
+32394,32713,32595,32542,32568,32634,32582,33569,
+33158,33130,32731,32283,32376,32596,32469,31485,
+30100,29430,29322,28985,29025,29649,29380,28785,
+27836,26731,24911,23436,23102,22946,24375,22890,
+22029,22139,23577,22594,22524,22878,23176,23512,
+23673,23834,23619,25938,27246,28338,28477,28780,
+29036,29700,30456,31061,31373,32010,31923,31902,
+31984,32175,32266,32365,32213,32067,32340,32145,
+32934,33467,34241,33505,34605,35355,35109,36012,
+35328,34909,34335,34629,34835,34389,34785,34326,
+33806,33523,33660,33206,33628,33276,33489,33289,
+33355,33296,33198,33349,33601,33570,33558,33840,
+33759,33756,33905,33732,33838,33345,33405,33400,
+33433,33237,33179,33144,32715,32352,32489,32659,
+32913,32972,33078,33325,33423,33348,33276,33069,
+32908,32841,32868,33030,33087,33100,33098,32968,
+33132,33222,33244,33102,33256,33091,33194,33246,
+33222,33306,33357,33361,33576,33372,33279,33427,
+33175,33092,33234,33489,33492,33353,33218,33151,
+33144,33171,33180,33363,33128,33297,33494,33231,
+33162,33321,33328,33231,33416,33669,35292,33486,
+33190,33204,33129,33064,33012,33091,33042,33015,
+33073,33114,33161,33139,33066,33131,33141,33028,
+33021,33048,33136,33123,33129,33107,33210,33262,
+33181,33201,33126,33113,33039,33155,33150,33139,
+33155,33098,33070,33066,33075,33117,33082,33102,
+33105,33103,33245,33260,33162,33201,33021,33156,
+33430,33594,34536,34826,34110,33792,33812,34613,
+33901,34635,34842,34804,33948,35065,34810,35237,
+35103,34997,34071,34907,34758,34826,34788,34280,
+35177,35450,34013,34379,34343,34367,34408,34336,
+34525,34915,34512,34589,34823,34855,34678,34883,
+34586,35056,34869,35154,34760,34042,34275,34348,
+34429,33973,34449,33990,33842,33942,34101,33968,
+34025,33995,33907,33899,33834,33775,33714,33687,
+33636,33594,33655,33554,33474,33452,33228,33086,
+33160,33241,33508,34526,35000,34799,34565,34715,
+36873,36486,36086,35975,35995,35603,34383,34232,
+34812,35037,34394,35425,35346,35637,35514,34443,
+35199,34696,35564,35404,36655,36126,35907,38313,
+37527,36819,36891,36437,35241,34450,33693,33954,
+34705,35160,37465,36939,35719,35578,34749,34219,
+33802,33606,33442,33292,33129,33138,33109,33331,
+33483,33738,33554,33661,34584,34435,34491,34371,
+34148,34109,33731,33710,33845,33939,33597,34419,
+33761,34937,34500,34535,34347,34545,34164,34537,
+34564,34846,35166,34458,35459,35569,34908,35358,
+34600,35105,34496,34107,33888,34455,34889,34541,
+33931,33816,34201,33270,33578,34242,33855,33205,
+34131,33951,34116,33417,33831,33695,34133,33947,
+34060,34988,35192,34812,34239,33699,34147,33491,
+33327,33096,33015,32992,33166,33096,33478,33704,
+33945,32936,32891,32871,32857,32859,32892,32907,
+32913,32900,32899,32940,32940,32938,32940,32934,
+32936,32952,32971,33022,33003,33003,33141,33161,
+33025,33091,33060,33060,33522,33400,34254,33718,
+33749,33663,34611,33717,33783,33800,34019,33840,
+33464,33828,34265,34946,35554,34661,33783,33759,
+33816,33671,33498,33388,33373,33402,33405,33441,
+33489,34026,34470,34189,34632,34905,35284,34815,
+34957,35148,34831,34383,34298,35112,34784,35664,
+34648,33804,33229,33436,33252,33213,33348,33447,
+33479,33436,33617,33347,33098,33509,33421,33429,
+33582,33744,33897,33820,34133,33899,33906,33915,
+33913,34109,34794,34017,33614,33468,33468,33468,
+33468,33845,33920,33933,33972,34131,34397,33948,
+33967,33900,34471,34417,34521,34405,34776,34448,
+34438,34179,34152,34025,33976,33912,33998,33892,
+33003,33481,33535,33657,33657,33695,33616,33552,
+33480,33522,33519,33423,33462,33443,33456,33474,
+33448,33404,33432,33379,33378,33411,33310,33143,
+33168,33417,33840,33912,33879,33921,33795,33464,
+33801,33919,34143,34152,34089,33873,33961,34026,
+33943,33460,33083,33333,33407,33458,33603,33084,
+33524,33678,33460,33014,32715,32701,32703,32706,
+32727,32761,32799,32837,32871,32900,32919,32931,
+32940,32946,32950,32952,32949,32946,33013,33038,
+33122,33090,33090,33102,33096,33453,33484,33510,
+33843,33903,34132,35291,37071,36992,34280,34170,
+35793,35575,34833,35559,35094,32580,31506,31311,
+30480,30129,30493,30872,31058,30898,31218,32429,
+32584,32721,32851,32751,32189,33057,33336,33912,
+33860,33912,33888,34326,34251,35352,36845,37623,
+38152,38567,38962,39309,39608,39876,40106,40312,
+40494,40621,40569,40411,40227,39800,39514,39250,
+39346,39140,38656,38164,38251,39309,37229,38142,
+37962,36729,36513,34319,32638,32234,31977,31824,
+32007,31772,31500,31814,32100,32070,32064,32040,
+31920,31734,31350,31158,30631,30585,32139,32449,
+32556,32661,32750,32730,32574,32686,32049,31971,
+32427,31983,31056,32145,31907,32243,32675,32463,
+32461,32382,32490,32259,32416,32313,29751,28844,
+28673,28578,28661,28606,28457,28363,28137,27655,
+27315,26715,25668,23970,23050,22605,22257,23973,
+22827,22234,22242,23922,22696,22382,23011,23703,
+22933,22903,25374,27595,28468,28791,28827,28895,
+29086,29412,29562,29610,29967,30291,30895,31365,
+32215,32178,32124,32026,31856,31821,32003,32100,
+32265,32975,33014,34395,35640,35925,36195,35013,
+35781,36120,34844,35358,34596,34383,33834,33984,
+33846,34120,34197,33685,33548,33447,33536,33384,
+33470,33569,33579,33522,33414,33681,33602,33560,
+33651,33953,34055,33926,33451,33503,33756,33132,
+33303,33099,32893,33000,33075,33280,33386,33342,
+33421,33485,33555,33559,33561,33690,33704,33781,
+33657,33399,32910,32845,32916,32982,32952,32937,
+32965,33093,33091,33075,33060,33066,33059,33045,
+33146,33581,33393,33510,33367,33344,33375,33417,
+33096,33058,33130,33279,33462,33343,33293,33283,
+33309,33369,33318,33336,33360,33378,33174,33335,
+33408,33298,33189,33271,33457,33220,33285,33823,
+34608,34527,33396,33225,33253,33054,33010,33010,
+33021,33225,33029,33039,33046,33012,33027,32994,
+32997,32995,33044,33105,33170,33203,33175,33149,
+33135,33118,33089,33019,33123,33149,33158,33093,
+33046,33064,33032,33037,33066,33130,33180,33216,
+33120,33192,33231,33195,33050,33100,33243,33579,
+33152,33444,33839,33888,34278,34280,33615,34332,
+34822,34354,34696,34331,35709,35279,35189,35565,
+34626,35488,35527,35069,34556,35025,35043,34656,
+34043,33996,34681,34757,34524,34698,34398,34320,
+34359,34716,34509,34449,34388,34125,34322,35030,
+34788,34875,35261,33960,33966,34275,34144,34338,
+34081,34125,34347,34134,34107,34256,33912,34151,
+34094,34018,33900,33858,33919,33907,33745,33797,
+33628,33659,33558,33497,33428,33455,33213,33123,
+33310,33502,33559,34281,34318,35853,37197,36841,
+36812,36321,35233,35217,35265,35502,35037,33879,
+34266,34118,34335,33957,34258,35626,36578,35866,
+34693,34186,34438,34487,36067,36591,37269,37425,
+38238,34839,34201,33965,34506,33482,34833,35387,
+36960,37020,36013,34580,33719,33449,33307,33234,
+33179,33237,33286,33219,33220,33166,33174,33177,
+33138,33309,34040,33449,33665,33546,33192,33468,
+33692,34783,33960,33649,33720,34255,34011,33922,
+33909,33760,34422,34021,33382,33411,33441,33654,
+33697,33633,34366,34206,34483,34782,34537,35969,
+35701,35055,34671,34472,34740,34723,34375,34182,
+34656,34350,33561,33543,33393,33399,34735,34775,
+33810,33630,34203,34611,34272,34029,34214,33862,
+34778,34176,33402,34240,33761,33358,33338,33121,
+33207,33127,32998,32944,32925,32920,32889,32868,
+32866,32868,32873,32857,32853,32858,32844,32877,
+32878,32892,32883,32898,32920,32899,32907,32940,
+33021,33784,33331,33407,33522,33094,33439,34815,
+33123,33117,33270,33665,33276,33376,35397,34050,
+35901,35610,35946,35917,34743,34543,34248,35582,
+34551,35759,33970,34152,35165,35063,34401,34558,
+34549,34647,34992,34228,33943,33740,33762,33669,
+33721,34080,34003,33879,33960,34063,34250,34488,
+35028,34913,34896,34727,33910,33910,34194,36253,
+34626,34159,33115,33218,33247,33310,33087,33297,
+33615,33843,33604,33184,33933,33924,33696,33822,
+34128,33903,33935,33824,33738,34611,33802,33775,
+33838,33924,34014,34007,34392,34111,33889,33933,
+34031,33944,33996,33789,33843,34185,34102,33765,
+33951,34160,34508,34280,34426,34133,34173,34329,
+34227,34108,33943,34173,33954,33719,33318,33300,
+32898,33465,33686,33574,33527,33516,33465,33395,
+33376,33351,33357,33262,33262,33289,33280,33242,
+33228,33267,33217,33173,33268,33156,33043,33025,
+33043,33010,33399,33485,33675,33498,33869,33759,
+33916,33923,34108,33936,34317,34002,33737,33788,
+33304,32983,33177,33809,33710,33449,33634,33879,
+34049,33951,33712,33578,33532,32893,32700,32703,
+32743,32790,32832,32874,32913,32947,33007,32996,
+32977,32956,32951,32952,32955,32958,32962,33000,
+33133,33177,33746,33513,33890,33912,34319,34206,
+34392,35481,35843,37602,38545,37814,35444,33875,
+33084,33610,32505,31921,32355,31428,30714,29991,
+29322,29040,29097,29654,30751,31545,32285,32617,
+32700,32832,32852,32851,33296,34521,35947,34857,
+34831,34638,34371,33912,34958,35939,36787,37480,
+37957,38411,38818,39160,39457,39720,39965,40194,
+40398,40587,40723,40704,40571,40408,40237,40064,
+39978,39954,40000,40238,40640,41339,41693,41457,
+40893,40496,39333,36827,34116,32884,32414,32412,
+32152,31404,31227,32508,32412,32262,32154,32116,
+32049,31999,31767,30852,30184,29195,29528,30531,
+31656,31969,32065,32040,32151,32162,32157,32219,
+32128,31560,31932,31269,31110,30990,31285,31863,
+31986,32120,31538,30675,29392,28044,28068,28128,
+28319,28258,28094,28299,28338,28425,28203,28180,
+27882,26726,25500,24108,23019,22482,22460,22741,
+21981,22137,24388,22131,22335,23135,21952,21911,
+22930,22563,25673,27844,28756,29054,29301,29336,
+28899,28878,28756,28705,29009,28943,28521,28827,
+30149,31658,31827,32058,32370,32482,32491,32407,
+32277,32147,32256,32397,32975,33629,33149,35363,
+36030,36120,36768,36859,35904,35798,34344,34374,
+34359,34514,34115,34389,33680,33522,33544,33473,
+33713,33522,33653,33627,33816,33615,33515,33600,
+33546,33678,33680,33795,33924,33981,34103,33990,
+33387,33466,33763,33297,33316,33636,33523,33654,
+33664,33586,33455,33531,33562,33730,33648,33667,
+33681,33583,32961,32847,32857,32895,32923,33095,
+33079,33030,33006,32965,32955,32953,32963,33045,
+33271,33706,33390,33216,33129,33108,33160,33057,
+33180,33165,33105,33411,33424,33342,33327,33324,
+33429,33229,33265,33303,33209,33341,33366,33370,
+33411,33308,33406,33301,33250,33409,33385,33464,
+33570,33594,34894,34215,34987,34239,33944,33281,
+33174,33038,33061,33086,33110,33114,33008,33048,
+32998,32994,32994,32994,33138,33124,33130,33091,
+33072,33040,33003,33003,33105,33091,33042,33021,
+33033,33025,33048,33081,33125,33140,33205,33276,
+33183,33228,33243,33413,33104,33086,33243,33291,
+34139,33849,33844,33801,33518,33429,34760,34056,
+35314,33714,35274,35494,34473,34864,35058,35217,
+35135,34931,35753,34593,35355,35145,35286,34858,
+34317,33852,33934,33978,33979,34338,34026,34407,
+34527,34397,34357,34500,34188,34048,33988,33990,
+33863,33951,33907,34225,33731,33966,34267,34092,
+34189,33961,34209,34238,34282,34105,34203,33929,
+33869,33712,33672,33782,33918,33873,33761,33957,
+33979,33922,33666,33558,33500,33311,33063,33182,
+33386,33697,34070,34233,34181,35723,35062,36429,
+37149,36233,35928,34972,34926,35163,34737,34256,
+33989,34236,33842,34446,34904,34070,33601,33494,
+33673,34114,34554,34142,34854,37835,36297,37195,
+34702,33843,34232,34368,34875,34092,36072,34840,
+34237,33819,33504,33273,33257,33274,33390,34299,
+34595,33915,33564,33366,33191,33189,33112,33127,
+33149,33161,33076,33266,33447,33545,33500,33366,
+33675,33345,33943,33559,33871,33669,33316,33374,
+34475,34070,33840,33736,33198,33447,34188,34374,
+33760,34167,34058,34568,35715,35085,34745,34675,
+34219,34389,34695,34932,35396,35019,35217,34435,
+34379,34384,34213,33953,33996,34931,34732,33781,
+35100,35063,34906,35323,35961,34686,35256,34943,
+34086,33888,33644,33403,33430,33125,33036,33073,
+33033,32940,32898,32878,32865,32856,32853,32864,
+32853,32859,32854,32853,32850,32850,32841,32838,
+32872,32839,32861,32866,32877,32900,32956,33032,
+33374,33604,33119,33477,34126,35041,34329,35099,
+34705,35152,34251,34186,34884,34690,35755,34602,
+35812,36288,35684,36112,36015,36052,35538,35463,
+36090,36102,36124,36622,34764,36693,37193,35970,
+34812,35333,35343,35001,35144,35362,35310,35004,
+34341,35046,34488,34050,35222,35203,35142,34060,
+34866,33885,34002,34208,34464,36300,34627,34548,
+33878,33003,33003,33003,33235,33366,33761,33783,
+33444,33831,33689,33875,33549,33661,33455,33617,
+33999,33901,33916,33882,33897,33857,33681,33748,
+33939,34236,34016,34052,34162,34337,34530,34522,
+34185,34134,34080,34264,34393,34038,33422,33185,
+33133,33210,33204,33090,32958,32902,32546,33110,
+33168,33201,33464,33459,33221,33042,32697,32295,
+33281,33287,33387,33360,33365,33171,33155,33129,
+33182,33124,33055,33010,33025,33023,33052,33064,
+33064,33005,33013,33072,32998,33000,33170,33064,
+33002,33314,33345,33434,33570,33847,33800,33689,
+33768,33486,33873,33474,33647,33771,34104,33572,
+32595,32908,32992,33451,34172,34090,34095,34272,
+33932,34027,33825,33627,33173,32806,32748,32763,
+32812,32863,32899,32922,32948,33003,33116,33189,
+33132,33032,32951,32979,32985,32958,32967,33249,
+33351,33455,33885,33639,34023,34455,34367,34515,
+34630,34786,35241,35533,34337,34011,34584,32826,
+32832,31941,31596,29854,28797,28373,28251,28383,
+28761,29262,31917,32139,32130,32238,32401,32562,
+32702,32850,32911,32919,33026,33660,32976,32993,
+33061,32989,34026,33657,35289,36222,36687,37340,
+37933,38296,38677,39016,39298,39559,39818,40051,
+40272,40474,40653,40804,40879,40860,40812,40753,
+40747,40827,40947,41208,41430,41605,41669,41485,
+40858,39685,38580,37513,36341,34233,33188,32947,
+31692,31710,31949,32111,32151,32195,32226,32196,
+32278,32108,31972,32045,30347,29361,28603,28797,
+29680,30445,30640,30902,30840,30586,30719,30825,
+30996,31041,31179,30705,29781,29848,30000,30126,
+30098,30105,29796,29442,28234,28117,27574,27555,
+27516,27493,27506,28350,27882,28183,28297,28563,
+27240,26703,25434,23883,22915,22595,22131,22469,
+22044,21867,22233,22816,22434,22284,22344,22254,
+22476,23392,25822,27207,27993,28884,29123,29193,
+29115,29242,29232,29263,29010,29157,28618,27161,
+26903,27438,28716,30846,32330,32423,32298,32523,
+32641,33108,32442,32249,32242,32991,33136,33663,
+35547,35435,34317,36303,35256,35781,35007,35084,
+34378,34326,33839,33922,33967,33905,33837,33801,
+33964,33655,33620,33891,33843,33644,33711,33940,
+33787,33656,33912,34131,33450,33744,33527,33913,
+33521,33848,34817,34429,33592,34506,33607,33758,
+33621,33732,33873,33747,33675,33594,33817,33786,
+33471,33019,32846,32845,32850,32872,32910,32958,
+33078,33093,33051,33020,32975,32942,32846,32884,
+32958,33062,33171,33299,33192,33231,33238,33237,
+33071,33055,33009,33107,33367,33285,33420,33402,
+33399,33488,33221,33198,33395,33336,33366,33150,
+33266,33401,33492,33579,33423,33162,33510,33534,
+33573,33645,33495,34269,34523,34761,33375,33348,
+33408,33134,33121,33148,33150,33153,33127,33096,
+33091,33030,32994,32989,32992,33027,33078,33068,
+33072,33060,32995,33006,33038,33129,33180,33259,
+33208,33227,33266,33240,33204,33157,33097,33132,
+33216,33262,33252,33232,33060,33226,33322,33177,
+33453,33676,34323,34291,35045,34599,35334,33852,
+34017,35193,34562,34676,36247,34700,34906,35425,
+35571,35369,35425,35386,35615,34963,35160,34834,
+34242,33971,33786,33626,33696,33696,33987,34080,
+34050,34447,34242,34188,34347,34053,33973,34259,
+33937,34050,34242,34171,34110,33679,34169,33972,
+33858,34004,34119,33949,34059,33678,33780,33779,
+33484,33760,33774,34005,33957,33833,33762,33568,
+33429,33952,33669,33456,33303,33385,33297,33323,
+33189,33472,33726,33957,34924,34460,37221,36295,
+36870,37188,35460,35653,34791,34413,34566,34239,
+34390,33762,33824,33904,33991,33459,33759,33784,
+33951,33612,34115,36720,36113,36406,34332,33792,
+34116,33519,33743,34876,33870,33875,33648,33159,
+33131,33137,33111,33127,33149,33305,33636,34392,
+34182,33822,33869,33449,33290,33228,33192,33146,
+33127,33216,33176,33108,33060,33048,33045,33070,
+33046,33356,33537,33477,33669,33150,33618,34636,
+33795,33612,33180,33105,33257,33581,33921,34052,
+33797,34436,34697,34193,34741,35376,34592,35240,
+35472,35613,35508,34579,34575,34170,34644,34162,
+34566,34332,34539,34600,34018,34861,34298,34991,
+35478,35456,35403,35655,35872,34605,36024,34439,
+34647,34192,33194,33543,33025,32961,32919,32899,
+32869,32866,32860,32856,32856,32853,32856,32848,
+32851,32844,32847,32835,32832,32825,32840,32820,
+32853,32867,32919,32986,33355,33286,33540,33717,
+33987,34593,34836,33655,35217,33810,35020,34549,
+33988,34641,34680,34427,34728,34770,35188,35409,
+36440,36474,38302,35947,37103,36185,36009,37982,
+36294,36552,36960,37155,38029,37675,37574,37825,
+36800,35480,37107,36123,36460,35951,35505,36296,
+35160,34751,35461,34620,34913,34418,33886,33796,
+33915,33973,34230,34356,34851,35836,34752,34668,
+33963,33003,33003,33003,33200,33240,33836,33764,
+33665,33540,33595,33860,33568,33255,33263,33456,
+33549,33657,33856,33793,33780,33739,33906,34134,
+34157,34480,34537,34554,34341,34569,34857,35001,
+34726,34812,33891,33682,33728,33767,33694,33714,
+33561,33249,33037,33038,32621,32942,32584,32743,
+33135,32436,32412,32394,32784,32814,33013,33104,
+33006,32994,33069,33235,33210,33108,33024,32939,
+32877,32886,32859,32802,32694,32692,32709,32886,
+32919,32925,33000,33054,33060,33071,33015,32991,
+32976,32976,32973,33050,33126,33258,33483,33365,
+33843,33648,33228,33030,33318,33270,33246,32973,
+32911,32974,33077,32756,33542,33931,33973,34079,
+33936,33821,33757,33033,32939,32878,32835,32887,
+32893,32978,32987,32946,32818,32946,32997,33003,
+33012,33003,32955,32990,32970,32999,33074,33345,
+33969,33854,34073,34105,33934,34456,34659,34033,
+33790,34810,33004,33117,32601,31797,32572,31712,
+29570,28866,28349,28018,27696,27790,27924,28308,
+30237,31989,32168,32023,31822,31794,31986,32110,
+32060,32071,32139,32297,32671,32992,33000,33305,
+33133,33013,33919,34773,35240,35910,36741,37547,
+37932,38266,38589,38889,39186,39471,39730,39983,
+40213,40423,40618,40803,40962,41106,41203,41245,
+41277,41325,41382,41525,41649,41751,41835,41727,
+41240,41012,40399,39284,38445,37605,35618,33837,
+33281,35106,33216,34041,33093,32995,32648,31812,
+31908,32464,32217,32108,32005,30909,29630,28733,
+28554,28841,29155,29580,30267,30263,29985,29777,
+29820,29145,29658,30701,29799,29012,29217,28924,
+28831,28854,27067,28292,28185,27777,27566,27211,
+27237,26936,27076,27307,27477,27237,29072,28379,
+27825,27457,26146,24246,22955,22592,22321,21892,
+21966,22406,23418,22473,21785,23296,22341,23898,
+24045,24464,24679,24804,24882,26604,27693,27835,
+27276,27384,27765,26797,26937,26956,26877,25867,
+24992,25471,26098,27255,29511,31512,32548,32530,
+32421,32619,32567,33345,33228,33307,32835,32295,
+33012,33835,35652,36133,35592,37284,36071,34124,
+34842,34738,34438,34323,34345,34072,33863,34379,
+34038,33976,33960,33921,33885,33809,33884,33962,
+34258,33627,33529,33483,33648,33667,33818,33791,
+33539,33850,33468,33746,33900,33787,33556,33674,
+33694,33811,33693,33727,33615,33169,32834,32834,
+32736,32751,32837,32850,32853,32853,32855,32925,
+33117,33549,33532,33252,32979,32839,32844,32851,
+32877,32890,32883,32900,32943,33137,33150,33171,
+33012,33183,33029,33039,33005,32994,33131,33201,
+33337,33147,33105,33405,33483,33453,33118,33084,
+33094,33186,33378,33204,33280,33091,33510,33523,
+33486,33575,33282,33782,34700,34242,33729,33338,
+32997,33029,33043,33091,33115,33175,33090,33064,
+33145,33117,32995,32985,32985,33186,33138,33099,
+33044,33077,33015,32997,33063,33040,33026,33056,
+33070,33105,33133,33264,33245,33208,33102,33144,
+33260,33270,33424,33415,33129,33150,33223,33177,
+33159,33180,33276,33240,33183,34065,34145,35443,
+35201,33302,35802,35796,35403,35791,35315,36171,
+34611,35751,35220,35428,34962,34997,35675,35715,
+34502,33943,34278,34134,33982,33768,33613,33835,
+33741,33984,34028,33930,33972,34096,33897,33722,
+33733,33771,33870,33636,33754,33921,33879,33963,
+33403,33921,33906,33910,33750,33433,33758,33542,
+33789,33795,33506,33495,33881,33807,33712,33936,
+33727,33658,33625,33540,33234,33271,33238,33196,
+33162,33569,34020,34264,34574,35941,35595,34769,
+36485,36807,37085,37230,35820,34627,34950,33816,
+34320,33588,34026,34225,34295,33501,34197,34599,
+34960,35139,34536,34245,35598,36882,33782,36767,
+35476,35310,34590,35522,33246,33194,33217,33163,
+33156,33125,33128,33078,33138,33267,33266,33515,
+33461,33218,33183,33124,33133,33126,33084,33102,
+33084,33077,33117,33153,33094,33098,33114,33092,
+33153,33158,33058,33105,33275,33235,33118,33144,
+33087,33006,33048,33019,33313,33265,33799,33306,
+33662,33918,34631,34434,35407,34770,34795,34497,
+34064,35141,33774,33684,33414,33404,33204,33201,
+33687,33680,33989,34695,35463,34968,34851,34694,
+34971,35718,35292,36539,35362,35053,34698,36099,
+33632,33049,32964,32905,32879,32863,32851,32853,
+32851,32850,32850,32854,32850,32850,32847,32844,
+32838,32836,32832,32837,32836,32838,32848,32850,
+32865,32880,32895,32999,33704,33420,33377,33417,
+33736,34134,34118,34153,34356,34833,34954,35493,
+35001,35037,34866,34893,34390,34460,34202,34035,
+34314,34303,34329,34134,34391,34188,34604,34476,
+34607,34346,34566,34905,35119,35649,35391,35705,
+36186,37265,36846,36846,37638,36676,35900,37362,
+35496,37197,36447,36102,36196,35746,35244,34698,
+35638,34667,33900,34409,33777,33403,33360,33003,
+33003,33003,33003,33090,33415,33077,33182,33378,
+33330,33369,33396,33579,33653,33663,33726,33663,
+33625,33690,33783,33796,33658,33629,33802,33771,
+34141,34368,34481,34658,35115,35028,34548,35096,
+34708,34616,34011,33595,33549,33421,33229,33211,
+33135,33258,33073,32778,32818,33226,33396,33422,
+33400,33457,33279,33300,33261,33150,32806,32721,
+32802,32944,33427,33465,33315,32848,32882,32742,
+32708,32722,32838,32960,33061,32886,32943,33000,
+32940,32932,32981,33007,33133,33177,33187,33170,
+33015,32982,32988,33019,32988,33051,33079,33432,
+33732,33538,33186,32573,33006,33277,33387,33312,
+32859,32767,32569,32307,32160,33340,33392,33775,
+33810,33564,33095,33024,33130,33009,32918,32811,
+32835,32891,32968,32853,32799,32904,32974,33008,
+32904,32994,32991,33003,33042,33310,33566,33879,
+33873,33716,34158,34473,34302,34209,33711,32898,
+32845,32489,31725,30758,31147,32349,32580,29764,
+28363,27724,27574,27521,27481,27614,27789,28126,
+28993,31280,31972,32074,32101,32076,32101,32274,
+32524,32231,32262,32460,30447,32136,32872,32889,
+32374,33085,33915,34197,35037,35819,36852,37311,
+37732,38115,38481,38829,39123,39421,39693,39972,
+40213,40426,40632,40828,41007,41172,41334,41476,
+41601,41700,41769,41832,41887,41893,41814,41781,
+41637,40885,40377,39440,37315,36006,37186,38212,
+38574,38534,36622,36681,36589,39651,36575,35565,
+35502,34926,34274,32805,32648,32293,32255,32256,
+32154,29264,28512,28514,28613,28800,29195,29052,
+29353,29367,29811,29184,29502,29403,28738,28510,
+29065,28773,28227,28557,27915,27507,27368,27447,
+27641,27345,26967,26749,26719,27312,28993,27693,
+26888,26641,25653,24141,23346,22869,22560,22266,
+22312,22272,21869,21795,21852,22954,27901,26298,
+25572,24759,24078,23898,23769,23571,23414,23414,
+23442,23517,23539,23581,23964,24014,23875,24180,
+24078,24214,24083,24079,24120,24819,25707,27338,
+29831,31854,32598,32698,32490,33432,33356,33916,
+33378,32926,33730,33910,35225,35277,36090,34446,
+35731,35142,34602,34982,34335,34525,34134,34271,
+34473,34185,33911,34208,33820,33947,33438,33387,
+33773,33700,33528,33528,33385,33276,33278,33259,
+33210,33258,33549,33610,33600,33771,33552,33646,
+33761,33569,33355,32820,32724,32696,32634,32607,
+32701,32754,32796,32811,32821,32836,32883,32875,
+32865,32856,32846,32824,32814,32819,32829,32824,
+32872,33043,33003,32961,32851,32868,32916,32938,
+32964,33001,33038,33036,32997,32991,32988,32994,
+32988,32986,32997,33021,33053,33041,33037,32985,
+32985,33043,33018,33153,33418,33513,33554,33314,
+33420,33372,33339,33371,33303,33180,32995,32971,
+32965,32979,33080,33060,33101,33087,33161,33172,
+33079,33080,32986,32979,32982,33088,33023,33096,
+33042,32993,32982,33074,33153,33168,33105,33166,
+33045,33084,33084,33231,33178,33264,33312,33219,
+33228,33189,33170,33081,33205,33156,33749,33760,
+34269,33906,33392,33263,33885,33330,35191,33362,
+34957,35776,36320,34883,36108,34369,36384,37044,
+35465,35350,35823,35650,35819,36612,36021,34913,
+34470,34104,34015,34070,33912,33702,33630,33612,
+33639,33642,33741,33786,33664,33684,33678,33654,
+33750,33720,33918,33918,33792,33795,33927,33777,
+33816,33909,33836,33827,33927,33693,33693,33623,
+33565,33577,33570,33375,33333,33757,33873,33814,
+33599,33791,33435,33453,33309,33313,33240,33122,
+33130,33546,33716,33413,33218,33483,33766,35058,
+35662,37463,36630,35627,35008,34434,34134,34706,
+34578,33647,33438,33890,33247,33613,34359,34001,
+33558,34002,34143,35675,35290,34249,34785,35351,
+34998,33766,34415,34122,33283,33224,33159,33297,
+33387,33183,33124,33158,33183,33068,33169,33235,
+33188,33234,33178,33240,33121,33195,33065,33101,
+33091,33369,33110,33047,33084,33096,33082,33067,
+33090,33191,33165,33055,33058,33032,33009,33010,
+33053,33063,33003,33221,33305,33712,33799,33617,
+33746,34000,35038,35124,34482,34806,33952,33790,
+33663,33627,33290,33078,33081,33022,33087,33092,
+33192,33808,33938,33636,34314,35172,34365,35203,
+35960,36531,34986,34494,34600,33819,34651,34683,
+32876,32868,32865,32862,32856,32847,32852,32850,
+32845,32850,32844,32845,32845,32847,32845,32841,
+32844,32844,32838,32842,32841,32845,32848,32853,
+32860,32865,32888,32902,32916,32931,32931,32945,
+32958,33069,33308,33751,33705,33765,34152,33638,
+33865,33680,33892,34014,33960,34104,33990,33950,
+33753,33501,33501,33470,33709,33583,33492,33608,
+33574,33552,33540,33561,33828,33870,33861,34088,
+34328,34375,35243,36372,36715,37942,37934,38803,
+38748,37897,37449,37827,35528,36474,35832,34841,
+34485,33813,33084,32979,32893,32960,32991,32997,
+33003,33003,33107,33022,33119,33107,33011,33015,
+33060,33097,33026,33095,33209,33879,33458,33515,
+33759,33912,33427,33795,33842,33810,33558,33790,
+33743,33729,34567,34622,35265,35106,34710,34187,
+33971,33264,32934,32518,31986,32010,32404,32331,
+32751,32982,32990,32982,33033,33213,33331,33409,
+33491,33363,33332,33477,33296,33444,33493,33418,
+33333,33153,32847,33143,33120,33206,33055,33153,
+33162,33048,33140,33036,32962,32890,32829,32886,
+32946,32994,32974,33096,33150,33210,33186,33104,
+32992,32970,32964,33033,33000,33040,33163,33297,
+33450,33606,32994,32997,32820,33155,32766,32894,
+32792,32593,32460,32297,32013,33485,33768,33782,
+33847,33658,33171,33031,33130,32985,32787,32874,
+32858,32888,33003,32989,32862,33004,32999,32796,
+32880,33475,33256,33695,33984,34106,34155,34218,
+34371,34061,34735,34505,34092,34977,34743,34831,
+33616,33217,33237,32784,32577,31906,31329,29522,
+27924,27324,27283,27250,27459,27484,27759,28151,
+28242,28871,31391,32086,32100,32256,32399,32520,
+32433,32484,32591,32366,33222,31896,31571,31800,
+31787,32036,33530,33632,34629,35373,36301,37164,
+37716,38181,38574,38905,39213,39495,39780,40039,
+40282,40505,40716,40935,41124,41299,41455,41604,
+41739,41861,41970,42055,42068,41966,41812,41605,
+41282,40896,40492,40142,39967,40260,40737,40538,
+40544,39692,39724,39265,39400,39401,39726,39489,
+40349,40359,38394,37495,35154,33324,33177,32407,
+32410,32358,32120,31845,31836,31833,31844,30909,
+29337,28392,28367,28812,29500,29982,30312,30342,
+29740,28450,28836,28066,28113,27651,27444,27452,
+27288,27327,27864,26665,26501,27024,26815,29703,
+30100,26180,25682,24716,23674,23360,23067,22410,
+22328,24272,22277,22500,23404,24711,24153,23697,
+23733,23316,23373,23493,23249,23214,23289,23283,
+23335,23286,23362,23385,23410,23484,23543,23714,
+23802,23900,23927,24003,24072,24090,24159,24243,
+24450,24510,25095,25876,29790,31398,32763,32869,
+32208,32782,33852,33566,33860,34520,33150,34213,
+35878,35757,35385,35355,34568,34227,34395,34023,
+34233,33762,34078,33864,34082,33758,33572,33462,
+33360,33564,33159,33672,33705,33559,33658,33603,
+33560,33123,33096,33261,33469,33144,33089,32622,
+32430,32445,32430,32429,32417,32497,32497,32572,
+32553,32619,32718,32755,32781,32799,32829,32832,
+32826,32820,32802,32805,32823,32841,32850,32869,
+32983,33224,33189,33149,32986,32853,32845,32855,
+32901,32940,32907,32892,32912,32937,32938,32961,
+32961,32955,32948,32949,32941,32955,32995,32964,
+32967,33099,33438,33450,33843,33785,33551,33300,
+33087,33009,32982,32958,32938,32945,32968,32959,
+33016,33106,33133,33021,33076,33051,33045,33004,
+33003,32985,32982,32996,33113,33037,33092,33015,
+33058,33069,33055,33100,33153,33096,33140,33180,
+33114,33159,33182,33177,33202,33118,33072,33123,
+33084,33089,33072,33032,33052,33107,33348,33830,
+34045,33202,33255,33323,33655,34144,34761,36282,
+36301,36576,36820,34865,34936,36526,36447,37353,
+35977,36456,36638,35616,36520,34987,34602,34255,
+34255,34208,34343,34101,33948,33945,33829,33534,
+33925,34054,34381,34302,34528,34831,34447,34424,
+34359,34287,34292,34353,34482,34167,33969,33947,
+34086,34017,34026,34257,33593,33486,33619,33417,
+33528,33630,33633,33774,33452,33810,33808,33822,
+33830,33729,33755,33556,33417,33253,33325,33127,
+33102,33211,33356,33740,33673,34648,35103,35966,
+35537,36997,35727,34875,34782,35222,33790,33751,
+33651,33988,33471,33494,33307,33924,33804,34143,
+33925,34098,34188,34089,34567,34424,34891,34785,
+34113,33561,33807,33845,33853,33995,33591,33534,
+33468,33639,33609,33274,33251,33134,33117,33121,
+33351,33436,33636,33219,33084,33073,33113,33073,
+33048,33079,33077,33063,33039,33102,33131,33119,
+33094,33109,33120,33114,33167,33112,33077,33051,
+33004,33006,33009,33144,33625,34306,34010,33975,
+34949,34248,33872,33795,33418,33652,33432,33191,
+33009,32986,32970,32962,32965,32985,33292,33857,
+33672,34535,33708,33911,33762,33781,33393,34680,
+33719,34476,34786,33599,33443,33577,33049,32913,
+32860,32868,32868,32864,32855,32850,32849,32837,
+32835,32838,32841,32844,32841,32843,32841,32841,
+32844,32845,32849,32851,32851,32853,32850,32859,
+32877,32865,32866,32881,32898,32888,32904,32913,
+32932,32956,33066,33075,33132,33214,33274,33163,
+33211,33286,33299,33337,33318,33180,33265,33290,
+33251,33162,33184,33180,33223,33291,33303,33219,
+33167,33130,33392,33388,33254,33289,33306,33372,
+33403,33421,33622,33727,33840,34047,34071,33612,
+33483,33468,33413,33129,33053,32940,32910,32909,
+32907,32885,32542,32481,32746,32864,32931,32958,
+32965,32975,32988,32998,32974,32973,32976,32993,
+33045,33102,33005,32999,33006,33003,33105,33090,
+33187,33333,33429,32536,32824,33001,33178,32949,
+32813,32810,33123,33505,33503,32930,32286,32049,
+31732,31753,31959,31608,32076,32884,33360,33417,
+33634,33824,33975,34204,33930,33980,33709,33954,
+33621,33546,33393,33427,33407,33216,33187,33240,
+33210,33150,33251,33291,33455,33324,33231,33191,
+33135,33055,33061,32996,33055,33060,32943,32848,
+32722,32740,32714,33053,33147,32936,32896,32910,
+32996,33158,33450,33168,33130,33252,33117,32886,
+32862,32832,32610,32718,32913,32781,32675,32741,
+32597,32259,32168,32010,32074,33451,33623,33550,
+33101,33000,32995,32892,32664,32814,33078,33057,
+33003,32995,32814,32990,32793,32900,33486,33516,
+33497,33528,33999,33955,34551,34932,35344,35575,
+34541,34317,34652,35688,35898,35763,34402,33672,
+32697,33090,32524,32600,32495,31389,28290,27219,
+27099,27010,27046,27189,27279,27804,28294,29085,
+30077,30714,31907,32059,32202,32392,32415,32564,
+32665,32719,34156,34864,35348,35764,35634,34674,
+32186,33759,33154,33897,35499,36015,36957,37710,
+38283,38701,39013,39297,39564,39819,40049,40278,
+40497,40716,40919,41109,41292,41460,41615,41754,
+41881,41997,42103,42191,42218,42156,42069,41959,
+41805,41657,41589,41339,41260,41245,41166,41047,
+40776,40770,40779,40644,40254,40011,40200,38151,
+38499,37584,37378,37606,37281,36629,36921,35664,
+34209,33080,32602,31860,31616,31718,31992,32101,
+32097,31620,29451,28425,28375,29448,29457,29993,
+29938,29726,29394,28942,28393,28361,28153,27558,
+27535,27396,28384,26623,27285,26862,29366,30448,
+29025,26010,25503,24972,24420,24452,23140,23124,
+22715,22800,24465,22995,23592,24169,23507,23238,
+23238,23382,23353,23289,23267,23255,23320,23334,
+23310,23147,23341,23386,23440,23506,23600,23730,
+23976,24204,24267,24199,24240,24212,24291,24365,
+24484,24615,24813,24957,25372,25754,26399,26862,
+29811,32048,32385,32113,32983,34314,33944,32906,
+33910,34746,33523,34304,34077,34794,34266,33896,
+34208,34452,33839,34081,33903,33914,33885,34147,
+33698,33490,33222,33241,33294,33736,33229,33509,
+33443,33408,32400,32287,32502,32397,32333,32371,
+32469,32557,32649,32648,32646,32611,32563,32461,
+32502,32578,32568,32703,32703,32703,32752,32748,
+32737,32744,32748,32743,32765,32796,32825,32844,
+32847,32856,32862,32841,32839,32836,32823,32833,
+32864,32838,32820,32809,32799,32834,32851,32858,
+32850,32876,32875,32889,32904,32917,32973,33049,
+33024,33077,33350,33144,33021,32995,32960,32935,
+32903,32895,32898,32904,32931,32989,33113,33129,
+33138,33027,33093,33115,33081,33084,33048,33067,
+33012,32995,32988,33117,33177,33171,33093,33143,
+33159,33079,33084,33138,33104,33075,33087,33156,
+33268,33132,33047,33065,33341,33246,33133,33015,
+33135,33008,33084,33173,33208,33373,33254,33045,
+33534,34119,34831,34219,33501,34447,36031,35901,
+37067,36762,35811,35760,35785,35213,35512,34825,
+35324,35627,34661,35262,35055,34656,34851,34956,
+34782,34770,34126,33784,33900,33801,33899,33981,
+34223,34219,34685,34484,35733,35015,34146,34717,
+34420,34856,35364,34290,33933,33737,34308,33938,
+33564,33633,33600,33491,33237,33331,33465,33343,
+33262,33469,33528,33581,33330,33436,33595,33570,
+33960,33873,33915,33705,33642,33467,33309,33171,
+33144,33090,33162,33129,33787,34424,34153,35108,
+34131,35621,35591,35328,34633,34007,33690,33434,
+33318,33708,33711,33901,34117,33435,33339,33326,
+33852,34202,34434,34416,34854,34980,35031,35223,
+34491,33935,33990,34198,33866,33680,33552,33383,
+33174,33231,33159,33118,33082,33147,33042,33357,
+33297,33459,33319,33426,33447,34069,33442,33142,
+33039,33136,33155,33087,33118,33028,33077,33105,
+33053,33036,33051,33072,33096,33080,33025,33009,
+32989,32988,32986,32985,32973,32958,32947,32947,
+32962,32943,32930,32933,32940,32940,32966,33023,
+33008,33029,33019,32955,32990,33078,33697,35209,
+34254,33632,33066,33156,33066,33395,33087,33226,
+33340,32952,32936,32904,32881,32859,32862,32853,
+32881,32880,32880,32865,32856,32850,32847,32843,
+32799,32832,32844,32852,32847,32866,32875,32877,
+32892,32907,32901,32897,32921,32904,32882,32860,
+32860,32856,32861,32865,32874,32881,32888,32885,
+32906,32916,32933,32971,33005,33069,33099,33074,
+33086,33093,33083,33111,33120,33068,33041,33096,
+33108,33086,33111,33157,33124,33148,33159,33087,
+33084,33061,33032,33113,33123,33057,33045,33027,
+32999,32988,32983,32961,32927,32911,32898,32904,
+32903,32882,32868,32867,32846,32799,32832,32568,
+31876,31670,31673,32024,32760,32812,32855,32841,
+32836,32842,32871,32874,32860,32898,32890,32906,
+32918,32931,32966,32976,32996,32979,32965,32976,
+33077,33191,32438,32332,32536,32701,32808,32649,
+32187,31887,31706,31665,31752,31785,31815,31806,
+31860,31927,31992,31981,31974,31907,32506,32541,
+33107,33555,33504,33556,33421,33192,33026,33057,
+33105,33163,33183,33262,33435,33438,33473,33521,
+33558,33379,33473,33393,33549,33444,33394,33246,
+33214,33160,33128,33045,33036,32958,32997,32865,
+32507,32433,32440,32568,32713,32727,32733,33282,
+33530,33675,33824,33926,33781,33983,33835,33093,
+33433,32697,32680,32387,32643,32623,32493,32748,
+32996,32880,32792,34037,33968,34219,33219,33701,
+33819,33915,33069,33756,33182,33297,33260,33349,
+33023,33321,32930,33001,33055,33900,34053,33943,
+33990,33920,34406,35979,36020,34982,34669,33981,
+34026,33846,35641,36712,35499,32480,32765,33300,
+32986,32840,32667,32602,30742,29151,27487,26827,
+26779,26821,26922,27255,27958,28411,30948,31327,
+31500,31789,32037,32020,31999,32022,32246,32520,
+32767,32719,33811,36945,34959,31542,32823,33986,
+36138,35244,34797,34824,35760,36645,37587,38325,
+38722,39075,39366,39646,39918,40146,40373,40589,
+40793,40980,41160,41335,41495,41644,41787,41917,
+42036,42153,42253,42337,42399,42402,42359,42297,
+42214,42108,41999,41892,41784,41694,41619,41422,
+40841,40033,38618,37075,35601,35451,33957,35038,
+37646,30879,33636,32721,37200,33642,35441,31540,
+31230,31601,31695,31281,31572,31350,32006,32117,
+32096,32016,29821,28306,28184,28467,29533,29343,
+29887,29589,29508,29529,29295,28985,28797,27808,
+27934,27437,27957,28554,29571,28541,30438,31245,
+29830,28779,25648,24993,24702,25317,23780,23847,
+25933,26554,25473,24036,23426,23400,23472,23679,
+23088,23715,23299,23313,23311,23303,23307,23336,
+23377,23361,23343,23375,23524,23743,23815,23921,
+24156,24318,24501,24537,24543,24537,24619,24637,
+24809,24924,25065,25249,25704,25662,25978,26514,
+27461,28626,32314,32325,32539,32643,32996,33116,
+33314,33024,33777,33193,33228,33456,33615,34428,
+33999,33991,33004,34698,34027,33818,33948,33572,
+33408,33722,33774,34409,33473,32976,32430,32054,
+32241,32499,32242,32284,32278,32261,32460,32507,
+32509,32478,32472,32423,32422,32406,32422,32487,
+32470,32566,32520,32691,32766,32747,32736,32724,
+32722,32743,32745,32750,32731,32700,32698,32726,
+32796,32853,32849,32796,32751,32709,32704,32717,
+32701,32713,32737,32796,32733,32605,32533,32514,
+32655,32832,32820,32750,32975,33057,33321,32694,
+32415,32550,32413,32402,32416,32436,32535,32541,
+32625,32861,32896,32920,32947,32967,33038,33009,
+33078,33057,33087,33129,33125,33110,33092,33040,
+33009,32982,32979,32991,33102,33184,33134,33066,
+33087,33126,33204,33070,33143,33066,33055,33073,
+33206,33093,33033,33018,33040,33003,33050,33006,
+33033,33089,33290,33139,33071,33393,33355,33237,
+33031,33153,33280,34391,34282,34383,35119,35044,
+34790,35181,34935,35367,34641,34809,34912,33264,
+34938,34999,34672,33996,34233,34077,35097,34629,
+34464,34045,33932,34164,34067,33824,33981,33836,
+33977,34001,34529,34203,34719,34579,34518,34767,
+34683,34972,35317,34354,34417,34422,34197,33537,
+33400,33454,33546,33177,33481,33264,33404,33359,
+33488,33438,33348,33405,33462,33352,33418,33491,
+33556,33840,33974,33782,33840,33824,33533,33507,
+33378,33448,33361,33155,33203,33723,33634,34404,
+34495,34558,34486,35310,35235,34033,33885,33333,
+33222,33214,33226,33539,33905,33437,33598,34257,
+33383,33292,33203,33323,33270,33533,33503,33682,
+33429,33315,33143,33201,33267,33303,33306,33154,
+33081,33213,33135,33062,33069,33033,33021,33024,
+33157,33467,33624,33294,33487,33243,33311,33180,
+33102,33300,33091,33112,33073,33048,33123,33093,
+33097,33072,33074,33049,33052,33042,33060,33064,
+32988,32981,32976,32973,32973,32971,32960,32956,
+32958,32958,32947,32943,32943,32935,32919,32916,
+32887,32895,32926,32936,32927,32922,32913,32910,
+32929,32925,32911,32896,32895,32891,32880,32880,
+32868,32865,32850,32851,32859,32866,32874,32884,
+32934,32932,32913,32898,32889,32877,32856,32836,
+32814,32810,32821,32820,32881,32905,32900,32896,
+32890,32893,32901,32908,32896,32893,32903,32880,
+32865,32853,32867,32883,32890,32883,32878,32870,
+32863,32869,32870,32907,32892,32875,32870,32891,
+33021,33024,33062,33069,33071,33069,33035,33015,
+33007,33009,33004,33009,33003,33021,33006,32997,
+32978,32957,32943,32944,32944,32936,32914,32901,
+32881,32880,32851,32853,32799,32608,32313,31782,
+31543,31509,30984,29816,28335,27632,27540,28352,
+27654,27971,28323,28361,28635,28765,29393,31057,
+31406,32664,32800,32796,32783,32827,32856,32852,
+32862,32858,32889,32902,32917,32924,32931,32878,
+32560,32352,32115,32013,31921,31963,31824,31567,
+31526,31615,31518,31395,31644,31998,32065,32192,
+32166,32071,32169,32367,33211,33519,33924,33790,
+33869,33549,33464,33282,33140,33195,33516,33586,
+33568,33612,33694,33687,33590,33506,33387,33300,
+33393,33486,33358,33384,33345,33338,33243,33137,
+32996,32965,32848,32864,32814,32880,32937,32960,
+32578,32403,32458,32632,32631,32747,32820,33391,
+33233,33773,34394,34341,34633,33942,33344,32522,
+32526,32563,32609,32580,32625,32955,33268,33345,
+33501,33441,33615,33704,33671,33234,33131,33246,
+33179,33684,33627,33493,33349,33265,33255,33255,
+33515,33155,33500,33921,33890,34128,34362,34758,
+34829,34764,34234,34656,35155,35170,36363,34835,
+37065,35286,32544,34171,32583,33325,32746,32715,
+32457,32389,30168,28722,27876,27093,26701,26576,
+26618,26616,26714,26997,27858,29664,30432,31040,
+31552,31629,31360,31496,31537,31446,31345,31341,
+31447,31730,31646,35150,34704,35552,33831,31438,
+32344,33762,33111,36219,36784,37273,38033,38720,
+39110,39441,39708,39964,40221,40458,40670,40869,
+41047,41217,41376,41535,41679,41818,41947,42068,
+42179,42285,42381,42471,42546,42591,42567,42504,
+42426,42330,42225,42102,41959,41763,41551,41308,
+40950,40505,39535,38199,37176,36327,36682,36002,
+33045,37510,38542,38157,34519,32174,31932,32592,
+33520,33928,33590,34248,33164,32236,32245,32139,
+31989,30726,28365,27997,28101,28185,28519,29871,
+28460,28377,26516,28639,28249,28919,29774,30069,
+31194,30834,29310,29467,30358,31555,32708,32325,
+30441,29747,30145,29700,27338,26023,26519,26347,
+25515,25586,24845,23947,23924,23639,23637,23682,
+23742,23806,23550,23409,23479,23747,23376,23458,
+23477,23506,23566,23580,23631,23828,24030,24217,
+24236,24572,24723,24755,24945,24995,25101,25299,
+25347,25569,25733,25863,26097,26478,26419,27039,
+28029,29596,32109,32240,32257,32073,32458,32462,
+32394,32331,32310,32046,32843,33480,33705,33412,
+32932,33897,33877,32965,34380,32847,33643,33981,
+33144,33810,33260,33044,32442,32002,32173,32358,
+32251,32285,32316,32412,32420,32448,32496,32514,
+32497,32502,32489,32419,32376,32342,32301,32290,
+32466,32659,32729,32788,32784,32797,32750,32700,
+32700,32700,32658,32625,32614,32656,32582,32590,
+32592,32642,32698,32717,32704,32679,32688,32574,
+32572,32637,32682,32912,33053,33170,33158,33144,
+33075,33168,33279,32855,32539,32537,32506,32515,
+32529,32651,32664,32554,32373,32483,32572,32701,
+32770,32889,32924,32949,32971,32986,32990,33072,
+33072,33037,33097,33192,33141,33159,33005,33073,
+33033,33009,32985,32987,33057,33096,33078,33045,
+33103,33043,33048,33046,33044,33058,33094,33174,
+33124,33073,33047,33059,33117,33027,33010,33218,
+33328,33341,33126,33105,33249,33272,33220,33164,
+33142,33153,33153,33119,33149,33314,33149,33121,
+33206,33165,33072,33051,33059,33114,33161,33161,
+33153,33192,33210,33162,33191,33212,33244,33225,
+33702,34123,33360,34532,33758,33851,34216,34181,
+33852,34017,34115,33789,34275,34560,34383,34855,
+34760,34860,34767,34856,34495,34187,33996,33498,
+33417,33279,33282,33368,33448,33491,33438,33518,
+33521,33447,33475,33428,33522,33467,33573,33701,
+33459,33891,33296,33708,33405,33644,33918,34005,
+33895,33462,33335,33718,33513,33360,33628,33747,
+34269,34474,34120,33984,33743,33270,33024,33067,
+33104,33199,33210,33142,33494,33358,33274,33069,
+33050,33042,33110,33095,33102,33110,33054,33063,
+33120,33085,33096,33091,33028,33031,33063,33018,
+33017,33004,33024,33030,33049,33089,33030,33024,
+33015,33066,33176,33063,33009,33004,33009,33007,
+33035,33032,33028,33018,33058,33115,33012,33051,
+33035,33017,33087,33058,33031,33039,33042,32987,
+32970,32975,32970,32994,32970,32951,32960,32962,
+32955,32943,32937,32940,32931,32922,32909,32895,
+32895,32896,32893,32924,32928,32926,32922,32913,
+32904,32898,32889,32884,32881,32880,32886,32884,
+32883,32881,32880,32894,32923,32936,32929,32934,
+33514,33645,33360,33680,33124,32932,32913,32896,
+32879,32851,32761,32861,32866,32866,32863,32859,
+32854,32853,32854,32861,32857,32859,32853,32870,
+32865,32864,32868,32881,32881,32883,32872,32880,
+32871,32870,32865,32866,32862,32853,32850,32842,
+32856,32789,32701,32705,32823,32846,33047,33015,
+32986,32967,32948,32926,32904,32874,32853,32859,
+32850,32845,32790,31754,30796,31262,31113,29151,
+27633,26738,25897,26190,26119,25611,26326,26451,
+26120,25646,24831,24645,24750,25177,25907,26010,
+26273,26781,27169,27576,27954,28532,28763,29044,
+29336,29894,30266,30262,30496,31316,31962,32315,
+32654,32724,32825,32845,32860,32871,32841,32794,
+32592,32249,31852,31716,31843,32058,32223,32119,
+32255,34426,33802,33180,32819,32732,32600,32497,
+32593,32530,32388,32343,32303,32741,33285,33934,
+33870,34041,33654,33563,33476,33576,33813,33882,
+33971,33942,33918,33788,33558,33458,33321,33177,
+33442,33089,33247,33141,33175,33188,33073,32913,
+32784,32733,32619,32612,32469,32451,32581,32572,
+32593,32728,32910,32673,32671,32557,32788,33724,
+33432,33876,33861,33957,33472,33102,32715,32233,
+32323,32335,32448,32608,32737,32892,33000,33059,
+33174,33299,33326,33290,33117,32978,33025,33315,
+33193,33183,33273,33532,33706,33681,33543,33391,
+33473,33653,34044,33944,34449,34998,34832,34760,
+34674,34386,34725,34536,34269,33334,34743,34687,
+34260,33279,30639,32844,32471,32577,32334,31299,
+29165,28172,27422,26788,26449,26349,26393,26424,
+26418,26419,26485,26754,27264,28215,29811,30657,
+31629,31975,32095,32154,32202,32148,32223,32296,
+32499,32622,32679,32457,34459,31342,36602,35364,
+35348,36438,36546,37469,37719,38247,38839,39275,
+39585,39793,40059,40321,40569,40775,40971,41136,
+41281,41438,41579,41718,41851,41977,42093,42201,
+42304,42404,42501,42585,42650,42659,42594,42508,
+42411,42297,42172,42027,41871,41683,41495,41277,
+41070,40758,40314,39647,39043,36998,36411,35967,
+35424,39212,39303,37629,33497,30992,32585,33482,
+33861,33913,34491,33960,32988,32311,32136,32001,
+31809,31333,29370,28022,27954,28191,29771,29436,
+29401,29242,29800,30015,30253,30177,30625,30066,
+29553,30708,29575,29468,30148,30270,27660,27380,
+26833,28715,29005,30334,31008,28119,28170,26338,
+27211,26724,26456,26373,26490,26473,24553,24081,
+25100,24153,24929,25156,23562,23553,23650,23643,
+23673,23628,23746,23811,23865,23996,24267,24405,
+24623,24762,25091,25159,25387,25530,25581,25868,
+26090,26427,26704,27011,27410,27774,27966,28382,
+29067,31346,32142,32273,32310,32333,32367,32403,
+32369,32410,32208,32110,32004,31816,31849,31928,
+32031,32422,32275,32082,32134,32262,32215,32147,
+31975,31807,31981,32010,32097,32166,32234,32324,
+32272,32244,32241,32298,32325,32434,32471,32430,
+32376,32322,32258,32223,32136,31993,31974,32011,
+32115,32232,32392,32519,32490,32448,32400,32425,
+32437,32251,32534,32714,32611,32482,32577,32592,
+32604,32634,32658,32701,32714,32583,32559,32538,
+32897,33106,32990,33232,33419,33293,33544,33296,
+32925,32670,32403,32318,32337,32394,32430,32543,
+32721,32793,32796,32735,32676,32588,32548,32655,
+32878,32688,32685,32881,32939,32979,33047,33041,
+33038,33113,33123,33141,33141,33098,33070,33054,
+32991,32985,32987,33129,33120,33041,33032,33027,
+32985,32982,32980,32991,33005,33109,33010,33063,
+33087,33085,33141,33063,33020,32997,33109,33282,
+33342,33227,33150,33285,33314,33288,33174,33237,
+33063,33232,33091,33144,33140,33190,33122,33087,
+33120,33134,33092,33185,33197,33189,33238,33141,
+33130,33124,33137,33140,33059,33111,33074,33075,
+33294,33207,33173,33243,33588,33402,33739,33945,
+33907,33987,33963,33938,34125,34030,33953,34163,
+34070,34143,34278,33948,34230,33683,33574,33554,
+33259,33509,33594,33234,33461,33548,33390,33249,
+33280,33247,33262,33267,33301,33390,33513,33402,
+33354,33331,33321,33463,33775,33381,34067,33739,
+33998,33890,33723,33551,33994,33858,33245,34193,
+33621,33458,33761,32982,32958,32955,32955,32959,
+33059,33084,33103,33066,33054,33003,33045,33049,
+33049,33036,33044,33013,33019,33030,33076,33078,
+33054,33072,33066,33045,33020,33072,33036,33027,
+33021,33022,33054,33024,33039,33028,33026,33043,
+33091,33060,33058,33015,33012,33031,33015,33002,
+32979,32970,32970,32970,32970,32977,32985,32985,
+32985,32986,32988,32986,32982,32972,32971,32969,
+32956,32952,32951,32945,32955,32943,32941,32943,
+32940,32937,32931,32937,32940,32940,32929,32926,
+32907,32881,32865,32866,32884,32890,32893,32884,
+32881,32880,32880,32880,32883,32885,32892,32895,
+32903,32902,32910,32913,32924,32940,33808,33980,
+32920,32920,32923,32934,32932,32926,32908,32886,
+32856,32795,32788,32850,32849,32842,32838,32839,
+32839,32838,32838,32835,32830,32854,32856,32850,
+32853,32863,32867,32867,32872,32880,32883,32888,
+32883,32880,32880,32874,32871,32868,32862,32858,
+32851,32842,32835,32830,32814,32805,32786,32721,
+32641,32235,32552,32725,32752,32567,30749,29796,
+28213,26333,26077,25642,24569,23708,24157,23985,
+23628,23311,23365,23100,22783,22965,23140,23352,
+23454,23442,23661,24070,24390,24582,25054,25104,
+25298,25465,25593,25790,25884,26175,26723,26868,
+26992,27315,28071,27985,28380,28840,29000,29220,
+29787,30573,31251,32103,32072,32136,31993,31849,
+31821,31718,31748,32253,32286,32379,32595,32957,
+33424,33745,33979,34201,33649,33765,33840,32771,
+32601,32848,33215,33350,33485,33894,33909,33981,
+33732,33758,33687,33959,34062,33906,34144,33939,
+33967,33914,33899,33981,33989,33353,33373,33003,
+32963,33030,33229,33286,33336,33168,33060,32877,
+32621,32427,32322,32337,32428,32622,32739,32850,
+32979,33069,33062,33011,33030,33029,32757,31804,
+32525,33252,33459,33034,33005,32791,32724,32314,
+32088,32080,32268,32759,33053,33511,33723,33716,
+33709,33680,33594,33250,32730,33394,33245,33263,
+33865,33291,33788,33526,33788,33768,33780,34227,
+34552,34890,34774,35082,33033,34838,34992,34689,
+34939,36193,33497,33198,33762,31548,32301,32607,
+32446,32115,30717,29859,28562,27840,27135,26706,
+26376,26239,26146,26127,26131,26146,26167,26193,
+26052,26279,26376,26790,27180,28012,29226,30763,
+31565,31729,31921,32145,32286,32367,32415,32688,
+33761,33941,35171,33712,32742,32992,35304,39009,
+33264,37013,37501,38266,38431,38820,39343,39722,
+40005,40263,40501,40708,40893,41076,41242,41390,
+41531,41662,41787,41908,42027,42136,42235,42331,
+42426,42513,42593,42659,42699,42660,42585,42486,
+42372,42256,42130,41976,41815,41640,41452,41194,
+40808,40365,39660,38702,37563,36154,36567,36216,
+37204,34099,35163,38541,37380,36920,35322,35916,
+34075,33895,32822,33474,32049,31940,32170,32175,
+32034,31995,31784,30126,28476,27891,27933,28238,
+28959,29998,30596,29934,28815,27894,26947,26128,
+26386,25906,26034,25922,25798,25936,25903,26603,
+26157,25791,25875,25800,26862,26872,27247,26937,
+27659,27429,26617,26703,26778,26692,26867,26721,
+25359,25668,25987,24369,23886,25101,23727,23858,
+23949,24295,24068,24108,24251,24450,24531,24726,
+24881,25067,25377,25718,25893,26079,26384,26543,
+26886,27219,27687,28178,28639,29373,29952,30889,
+31815,31998,32010,32118,32179,32205,32238,32221,
+32145,32081,32070,31971,31936,31893,31995,32069,
+32133,32210,32231,32127,32034,31958,31999,32026,
+32046,32077,32091,32049,31967,32010,32044,32082,
+32071,32138,32150,32229,32319,32296,32281,32223,
+32178,32142,32086,32013,31982,31914,31929,31965,
+31966,31994,32058,32129,32142,32328,32259,32349,
+32545,32537,32577,32707,32723,32792,32813,32797,
+32703,32733,32637,32637,32614,32700,32833,33113,
+33075,33570,33705,33853,33733,33408,33397,32919,
+32505,32178,32104,32218,32666,32526,32541,32664,
+32751,32793,32709,32707,32724,32772,32704,32689,
+32723,32697,32616,32611,32744,32927,32888,32916,
+32987,33021,33111,33142,33083,33069,33016,33016,
+33021,32984,32982,33152,33117,33050,33048,32982,
+33046,33048,33047,33049,33049,33055,33099,33125,
+33050,33064,33039,32997,32988,33111,32999,33160,
+33196,33165,33164,33198,33120,33194,33210,33163,
+33092,33063,33054,33056,33111,33105,33478,33409,
+33288,33211,33184,33181,33138,33069,33080,33150,
+33204,33225,33249,33177,33199,33134,33173,33130,
+33076,33144,33105,33092,33149,33138,33419,33384,
+33654,33975,33861,33835,33710,33763,33547,33827,
+33674,33483,33645,33309,33401,33272,33087,33090,
+33168,33459,33565,33354,33055,33442,33300,33223,
+33198,33251,33231,33203,33282,33247,33272,33177,
+33342,33270,33214,33181,33205,33129,33203,33092,
+33398,33371,33706,33817,33895,33539,33066,33341,
+34002,33075,33032,32987,32968,32956,32956,32958,
+32955,33121,32985,32973,32966,32958,32956,32958,
+32966,32968,32970,32974,32988,32993,32985,33012,
+33104,33138,33107,33053,33077,33024,33003,33034,
+33018,33027,32989,32999,33082,33078,33066,33018,
+33020,33008,32995,32997,32994,32986,32977,32967,
+32959,32958,32958,32955,32958,32959,32955,32961,
+32958,32958,32962,32961,32957,32956,32956,32943,
+32957,32956,32946,32940,32943,32943,32940,32939,
+32935,32932,32935,32935,32933,32931,32928,32928,
+32925,32918,32913,32913,32905,32898,32880,32880,
+32880,32883,32883,32885,32896,32895,32898,32898,
+32901,32913,32907,32895,32895,32895,32899,32907,
+32865,32859,32853,32850,32838,32823,32805,32778,
+32736,32827,32822,32832,32841,32842,32832,32821,
+32813,32820,32821,32822,32829,32836,32843,32848,
+32845,32847,32853,32861,32863,32867,32866,32867,
+32878,32889,32889,32887,32895,32892,32881,32862,
+32856,32852,32837,32808,32754,32481,30962,32233,
+31102,29744,27215,27355,26136,26603,24612,25304,
+23745,22596,22790,22335,22178,22195,22250,22262,
+22200,22175,22233,22722,22702,22828,22989,23444,
+23374,23314,23392,23752,23938,23999,24111,24110,
+24425,24767,25087,25457,25773,25799,25746,25993,
+25877,26115,26526,26838,27085,27357,27834,28191,
+28686,29061,29888,30798,31677,31907,31892,31911,
+32083,32851,32898,32931,32979,33189,33328,33455,
+33470,33516,33461,33516,33465,33456,33472,33089,
+33259,32747,32730,32997,33216,33489,33379,33462,
+33527,33420,33434,33790,33482,33639,33557,33432,
+33277,33925,33931,33924,33872,33906,33039,32683,
+33021,33467,33456,33926,33478,33060,32835,32539,
+32292,32157,32364,32764,32965,32994,33003,33069,
+33165,33181,33245,33140,33334,33299,33435,31737,
+31891,32695,33926,33536,32840,32621,32555,32493,
+32148,31863,32105,32646,33732,33453,33459,33555,
+33503,33698,33511,32562,32920,33150,33101,33708,
+33915,33741,34672,34412,33297,33519,32129,33274,
+33162,34778,34323,35975,33296,35511,36803,36050,
+36007,34398,33196,32820,32667,32218,31656,30413,
+29727,29535,28506,27936,27557,27052,26684,26311,
+26099,25983,25950,26002,26017,26040,25971,26162,
+26235,26322,26551,27098,27837,29493,30879,31689,
+32058,32103,31973,32097,32068,32070,32201,32378,
+32765,33036,34555,33837,33852,35617,37687,38229,
+38533,38535,38916,39180,39474,39741,40001,40200,
+40407,40635,40836,41005,41156,41307,41446,41578,
+41703,41825,41936,42046,42149,42246,42345,42435,
+42522,42603,42680,42747,42783,42753,42680,42585,
+42475,42351,42213,42081,41951,41804,41685,41564,
+41371,40953,40402,39663,38736,37724,37692,39045,
+38662,38480,36450,38593,35597,34242,36524,34568,
+32680,31968,34785,33174,32589,32370,32335,32252,
+32240,32210,32191,32115,30618,28979,28878,28844,
+28208,27642,27996,27131,26621,26376,26321,25842,
+25896,27486,26507,26454,26395,26352,25645,25401,
+25761,25552,25064,24904,25122,25221,25837,25465,
+25323,25567,25100,26412,26453,26635,27202,28331,
+26399,25973,24244,25294,26751,25986,25563,26369,
+26049,25511,24657,24912,24841,24945,24979,25184,
+25347,25560,25817,26067,26415,26577,26878,27195,
+27562,28014,28468,29020,29722,29892,31362,30955,
+31579,31865,31882,31860,31921,31950,31982,32029,
+32026,31990,32029,32010,32016,32109,32149,32228,
+32224,32157,32212,32256,32239,32295,32302,32255,
+32157,32193,32190,32162,32138,32138,32130,32200,
+32141,32193,32184,32186,32203,32238,32332,32314,
+32282,32310,32294,32264,32256,32199,32103,32040,
+31987,32038,32085,32136,32205,32246,32244,32247,
+32174,32148,32136,32175,32157,32181,32261,32340,
+32500,32595,32657,32671,32688,32698,32770,32867,
+32935,33475,34047,34152,34521,33957,33480,32890,
+32274,32092,32052,32057,32363,32603,32749,32644,
+32613,32601,32669,32690,32711,32730,32745,32760,
+32703,32665,32682,32652,32643,32673,32718,32814,
+32923,33017,33062,33117,33069,33060,33114,33071,
+33100,33022,32982,32977,32979,32985,33039,33002,
+32979,32988,32999,33040,33032,33023,33066,33105,
+32992,32986,32995,32994,33011,33115,33180,33216,
+33172,33184,33167,33093,33205,33206,33187,33225,
+33234,33167,33195,33078,33198,33171,33261,33202,
+33048,33055,33061,33087,33125,33090,33136,33300,
+33105,33134,33127,33151,33276,33247,33125,33126,
+33177,33180,33273,33228,33125,33030,33078,33081,
+33069,33067,33233,33322,33321,33629,33730,33678,
+33675,33693,33488,33314,33251,33134,33317,33619,
+33215,33221,33149,33168,33134,33174,33159,33251,
+33220,33213,33157,33123,33260,33111,33108,33120,
+33184,33251,33273,33303,33432,33339,33101,33647,
+33585,33788,33426,33314,33027,33003,33139,33257,
+33003,33007,33006,32994,32964,32958,32952,32955,
+32955,32950,32946,32943,32941,32940,32940,32941,
+32941,32943,32952,32958,32959,32970,33054,33031,
+33155,33196,33084,33162,33078,33030,33021,33026,
+33014,33003,33019,33030,33012,33018,33045,33028,
+33007,33006,32998,32986,32979,32970,32956,32955,
+32955,32949,32943,32940,32941,32944,32941,32949,
+32947,32943,32937,32937,32943,32940,32940,32940,
+32940,32941,32940,32940,32937,32934,32931,32928,
+32928,32928,32925,32925,32922,32922,32920,32919,
+32916,32913,32913,32911,32910,32902,32889,32880,
+32880,32883,32886,32887,32889,32884,32884,32884,
+32884,32881,32880,32877,32874,32869,32866,32866,
+32843,32828,32813,32798,32790,32791,32769,32682,
+32699,32764,32784,32787,32821,32821,32805,32794,
+32796,32823,32802,32805,32796,32744,32827,32823,
+32827,32839,32838,32835,32831,32827,32820,32821,
+32821,32824,32797,32808,32851,32853,32840,32823,
+32763,32606,32439,32230,31072,29731,26550,26599,
+25310,26001,23857,22828,22913,22863,21912,21843,
+21899,21920,21903,22056,22086,22135,22197,22252,
+22314,22360,22297,22437,22581,22775,22570,22690,
+22656,22793,22867,23001,23024,23265,23403,23474,
+23626,24085,24363,24776,24881,24962,24936,24894,
+25152,25190,25445,25752,25980,26185,26389,26621,
+26979,27403,27942,28431,29430,31402,32214,32405,
+32454,32594,32821,32915,32933,32949,33087,33288,
+33461,33680,33450,33489,33331,33388,33483,33737,
+33664,33394,32961,32773,33006,33423,33180,33824,
+33519,33744,33421,32988,32952,33110,33468,33550,
+33100,32973,32814,32971,33256,33205,32802,32508,
+33596,33664,33481,33583,33095,33001,32654,32326,
+32111,32180,32963,33091,33085,32996,33033,33017,
+33108,33247,33032,33198,33063,33003,33288,31803,
+32695,33821,33021,33035,32995,32875,32899,33372,
+32152,31854,31758,31964,32611,33269,33835,33493,
+33497,33433,33189,31763,32596,34585,34746,34359,
+33834,34778,34828,34467,34811,34542,33840,32983,
+32543,32814,31095,31262,31865,33723,32023,31062,
+31089,31132,30970,30783,30583,30582,30482,30144,
+29692,29132,28509,27970,27556,27093,26670,26365,
+26106,25950,25950,25963,26004,26023,26189,26388,
+26605,26852,26976,28285,29790,31281,31018,30876,
+31252,31632,32317,32553,32577,32403,32439,32646,
+33502,33848,33211,34784,35448,36211,36540,37047,
+37506,38184,39021,39453,39720,40089,40323,40551,
+40768,40943,41089,41224,41353,41474,41592,41710,
+41819,41924,42029,42129,42226,42319,42410,42489,
+42564,42636,42699,42756,42786,42791,42768,42717,
+42642,42546,42435,42327,42228,42131,41998,41883,
+41712,41267,40735,40305,39979,39217,38613,37989,
+36872,37689,33899,32817,36808,35001,31816,36041,
+34725,34845,33004,33219,32801,32345,32102,32410,
+32269,32334,32271,32138,32115,32154,31742,28550,
+27146,26729,26427,25962,25602,25743,25529,25613,
+25526,26084,25670,25575,25561,26308,25963,25765,
+25618,25572,25200,25203,25201,24630,24518,24210,
+24565,24392,25179,24932,24763,24784,24034,24437,
+25212,25237,25650,26028,25257,25974,25321,25749,
+25398,26256,26160,26864,25851,25697,25452,25514,
+25710,25919,26104,26330,26661,26922,27237,27703,
+28011,28326,28843,29424,29989,30936,31564,31688,
+31737,31743,31867,31859,31886,31894,31845,31790,
+31765,31871,31857,31779,31772,31847,31876,31878,
+31842,31899,31938,32130,32096,32079,32134,32214,
+32026,32011,32164,32125,32147,32184,32202,32263,
+32186,32199,32223,32234,32296,32313,32331,32349,
+32379,32415,32327,32268,32215,32154,32094,32029,
+32017,31959,31967,31958,32011,32153,32193,32146,
+32145,32143,32133,32133,32146,32148,32226,32241,
+32319,32334,32394,32440,32508,32467,32590,32711,
+32918,33510,33646,34233,33834,33609,33558,33249,
+32864,32639,32223,32202,31981,32097,32270,32372,
+32648,32622,32697,32700,32690,32711,32748,32800,
+32830,32850,32842,32778,32766,32671,32753,32850,
+32892,32952,33036,33039,33057,33037,33062,33031,
+33036,32990,32927,32931,32944,32989,33054,32978,
+32979,32979,32982,32983,32976,32987,33006,32974,
+32985,33051,33361,33632,33724,33534,33318,33212,
+33306,33198,33101,33461,33449,33253,33327,33243,
+33291,33156,33180,33210,33249,33228,33071,33200,
+33303,33167,33280,33239,33129,33315,33045,33073,
+33054,33271,33301,33189,33348,33250,33159,33249,
+33121,33228,33183,33153,33099,33286,33249,33171,
+33225,33041,33051,33060,33105,33183,33219,33180,
+33141,33130,33111,33081,33091,33142,33205,33153,
+33087,33078,33011,33061,33189,33108,33066,33039,
+33075,33036,33057,33072,33154,33271,33093,33161,
+33204,33087,33129,33099,33472,34077,33126,33015,
+33011,33135,33015,33023,33011,33008,33009,33007,
+33004,33007,33004,32997,32969,32941,32928,32931,
+32940,32946,32953,32956,32965,32964,32971,32967,
+32965,32951,32943,32930,32946,32954,32964,32973,
+32986,32983,33041,33042,32992,32980,32981,32982,
+32982,32982,32980,32982,32983,32985,32983,32979,
+32974,32970,32966,32957,32958,32955,32958,32957,
+32956,32946,32928,32922,32915,32915,32922,32929,
+32935,32937,32938,32938,32937,32933,32930,32926,
+32923,32931,32937,32931,32928,32928,32925,32924,
+32922,32922,32919,32917,32916,32913,32910,32913,
+32913,32913,32913,32910,32904,32898,32898,32887,
+32865,32877,32883,32883,32880,32874,32871,32862,
+32853,32850,32850,32850,32853,32853,32853,32850,
+32784,32773,32760,32752,32743,32733,32719,32694,
+32640,32580,32658,32677,32718,32754,32752,32694,
+32738,32775,32720,32697,32686,32686,32709,32759,
+32767,32806,32820,32821,32815,32802,32793,32775,
+32760,32715,32649,32507,32397,32155,31841,31885,
+30900,28986,28526,26821,25179,24510,23938,23746,
+22568,22194,22371,21891,21762,21756,21766,21795,
+21828,21862,21911,21937,21917,22205,22076,22073,
+22012,22049,22200,22278,22399,22236,22330,22354,
+22639,22746,22782,22791,22763,22785,22834,22878,
+23017,23320,23508,23823,23858,23844,23912,24081,
+24233,24426,24683,24720,24893,25097,25248,25299,
+25479,25726,25979,27168,29193,30820,31599,31941,
+32372,32512,32587,32688,32784,32899,32954,33269,
+33554,33368,33459,33546,33438,33830,33904,33741,
+33366,33426,33447,33463,33651,33342,33593,32897,
+32775,33038,33463,33044,32685,32408,32345,32290,
+32275,32331,32287,32217,32147,32340,32472,32857,
+33105,32968,33024,33000,33095,33239,33066,32291,
+32104,31964,32435,32800,32757,32654,32951,33006,
+33254,33458,33390,33453,32937,32725,32333,32328,
+32394,33972,34332,33813,33949,33942,33897,33921,
+33567,33112,32001,31833,31712,32288,33797,33867,
+33819,33915,33913,33608,31008,32412,33990,33329,
+34741,34710,35571,34909,35573,34569,32147,33439,
+34626,36663,37473,36465,35471,34158,33471,30794,
+30109,30156,30208,30207,30288,30255,30068,29735,
+29473,29328,29034,28156,27659,27159,26666,26388,
+26171,26002,25950,25963,25996,26186,26658,27239,
+28060,30039,31305,31696,31833,31946,31798,32131,
+31978,31434,30929,30444,30490,32173,32724,32985,
+33001,33695,34727,36275,36767,37250,37615,38021,
+38286,38632,38991,39357,39788,40081,40318,40518,
+40699,40878,41046,41188,41341,41491,41619,41730,
+41829,41923,42023,42114,42201,42276,42344,42406,
+42458,42498,42527,42548,42564,42569,42573,42580,
+42583,42572,42541,42480,42411,42318,42197,42016,
+41643,41155,40780,40311,39454,38497,39259,37740,
+37534,36512,37582,31493,32074,37479,35970,34367,
+33589,32916,31776,33383,31906,32052,32047,31798,
+31694,31934,32332,32385,32352,32214,32244,29388,
+27579,26561,25920,25623,25360,25172,25072,24906,
+24683,24682,24540,24619,24089,24075,24434,24333,
+24553,24477,24437,24518,23835,24558,24554,24536,
+24939,24032,23718,24150,23926,23520,23925,23461,
+24180,23877,24155,23548,24669,24577,25598,25346,
+25466,25971,27406,26469,25255,24006,24836,25645,
+26652,25830,26004,26242,26553,26691,27114,27454,
+27903,28157,28811,29525,30224,31040,31541,31587,
+31554,31629,31563,31650,31702,31707,31683,31671,
+31623,31648,31653,31684,31686,31768,31839,31866,
+31833,31807,31788,31834,31789,31723,31817,31971,
+32006,32077,32006,32123,32085,31989,32143,32158,
+32133,32188,32235,32341,32331,32270,32297,32308,
+32325,32316,32326,32279,32234,32277,32230,32132,
+32093,32046,32115,32043,32040,32073,31988,32012,
+32059,31941,31987,32033,32066,32055,32080,32122,
+32191,32262,32187,32227,32258,32375,32465,32714,
+32778,32842,32847,33132,34099,33700,35440,34610,
+33420,32950,32400,32257,32157,32079,31821,31990,
+32307,32754,32710,32764,32760,32652,32706,32747,
+32807,32690,32704,32773,32833,32854,32851,32869,
+32906,32939,32953,32970,33019,33024,33014,32975,
+32951,32940,32942,32967,32973,32973,32973,32976,
+33000,32994,32977,32970,32973,32988,32993,32943,
+32991,33054,33395,33714,33669,33892,33567,33542,
+33492,33105,33373,33301,33095,33255,33155,33036,
+33042,33210,33035,33035,33070,33056,33297,33279,
+33360,33147,33059,33039,33029,33066,33075,33049,
+33177,33291,33233,33180,33191,33114,33129,33226,
+33243,33195,33405,33416,33120,33252,33171,33354,
+33313,33199,33160,33104,32978,32975,32974,32980,
+33008,33118,33082,33078,33100,33097,33179,33140,
+33169,33036,33026,33057,33036,33078,33087,33099,
+33192,33355,33325,33078,33050,32991,32988,32983,
+32964,32959,32965,32970,32976,32971,32992,33048,
+33034,33010,33006,33003,33004,33004,33009,33006,
+33003,33003,32985,32948,32935,32929,32933,32940,
+32955,32968,32970,32964,32958,32955,32938,32940,
+32940,32940,32931,32936,32953,32958,32962,32968,
+32970,32970,32976,32984,32996,33033,33367,32988,
+32988,32988,32986,32979,32973,32971,32970,32967,
+32964,32961,32958,32956,32956,32955,32956,32958,
+32955,32943,32931,32917,32908,32904,32897,32913,
+32922,32928,32934,32938,32934,32931,32928,32928,
+32925,32925,32925,32923,32919,32913,32913,32913,
+32913,32913,32913,32910,32908,32906,32902,32902,
+32899,32902,32898,32896,32895,32890,32887,32883,
+32883,32880,32877,32877,32874,32871,32868,32865,
+32862,32856,32853,32850,32847,32832,32808,32796,
+32709,32706,32698,32674,32649,32621,32587,32548,
+32505,32463,32496,32580,32484,32471,32494,32519,
+32532,32546,32568,32574,32572,32578,32559,32505,
+32506,32519,32559,32636,32619,32570,32514,32452,
+32428,32427,32409,32307,32108,31359,28141,26769,
+25817,24090,24222,23519,22493,22302,22305,22239,
+21929,21736,21756,21750,21748,21747,21747,21759,
+21760,21794,21798,21558,21699,21829,21907,21934,
+21985,22047,22087,22118,22138,22170,22181,22245,
+22220,22210,22203,22236,22308,22365,22415,22767,
+22784,22803,22884,22875,23103,23371,23387,23481,
+23640,23806,24015,24172,24332,24460,24567,24663,
+24822,25203,25827,27672,29563,31182,31966,32142,
+32433,32583,32724,32748,32853,32893,32940,32964,
+33033,33466,33451,33456,33477,33586,33429,33518,
+33497,33547,33937,33895,33911,33635,33571,33455,
+32535,32050,31953,31767,31744,31794,31935,32133,
+32307,32506,32606,32616,32686,32656,32633,32657,
+32592,32625,32755,33015,32979,33096,32604,32228,
+32102,32163,32369,32708,32832,32859,33041,33100,
+33463,33016,33018,33471,33513,33342,32271,32298,
+32686,33020,33469,33899,33822,33828,33862,33913,
+33933,33959,33813,32414,32008,31710,31797,31989,
+32554,33864,33863,33916,33881,33806,32696,32157,
+31918,31907,32442,32430,32309,31865,33027,32304,
+30663,30560,30995,30024,29992,30220,30228,30320,
+30309,30297,30227,30323,30414,30420,30303,29895,
+29754,29449,29115,28355,27899,27358,26878,26599,
+26401,26195,26096,26056,26143,26307,28653,30262,
+30810,30966,31089,31191,31283,31493,31542,31828,
+31956,32419,32565,31551,31714,32552,32904,33000,
+33904,35265,36477,37053,37400,37961,38464,38780,
+39129,39347,39528,39732,39966,40169,40375,40578,
+40757,40914,41062,41207,41339,41472,41598,41718,
+41805,41897,41992,42062,42120,42171,42207,42233,
+42247,42261,42264,42268,42264,42257,42235,42239,
+42248,42264,42257,42239,42213,42158,42063,41942,
+41684,41181,40638,40070,39492,38970,39404,39114,
+37899,36166,37168,37345,37196,33143,34514,32696,
+34158,36675,36623,34797,33356,34193,33951,32779,
+32514,32425,32417,32320,32154,32247,32240,32199,
+31247,28987,27329,26199,25686,25246,24892,24608,
+24459,24242,24107,23916,23715,23900,23699,23683,
+23469,22930,22791,22860,22861,22852,22813,23289,
+23466,23612,23963,23705,23487,24004,23545,23816,
+23621,23721,23803,23002,23665,24268,23347,23638,
+24077,24561,24045,24427,25692,25279,28279,25719,
+25156,25306,25743,25951,26101,26328,26573,26979,
+27298,27559,27960,28473,28855,29784,30587,31635,
+31760,31879,31938,32184,32206,32237,32178,31998,
+31754,31637,31550,31540,31670,31644,31675,31688,
+31697,31686,31641,31706,31706,31761,31807,31836,
+31873,31837,31846,31846,31938,31943,32004,31995,
+32155,32133,32088,32061,32103,32158,32260,32229,
+32282,32312,32337,32339,32352,32327,32332,32327,
+32240,32154,32166,32022,32016,31965,31923,31906,
+31964,31992,32006,32065,32074,32144,32231,32219,
+32279,32346,32360,32397,32296,32277,32379,32385,
+32581,32706,32778,33081,33387,33188,34006,33466,
+33830,34415,33656,33033,32557,32283,32131,32048,
+32118,32543,32701,32530,32473,32634,32742,32712,
+32602,32634,32703,32824,32850,32832,32850,32877,
+32928,32943,32949,32956,32962,32965,32959,32944,
+32940,32934,32934,32957,32966,32953,32943,32949,
+32943,32940,32943,32940,32938,32928,32898,32893,
+32889,32892,32925,32925,32927,32925,32928,32923,
+32926,33018,32980,33081,33082,33011,33015,33024,
+33385,33354,33280,33231,33738,33140,33375,33296,
+33144,33374,34360,33777,33367,33557,34100,33715,
+33342,33046,33152,33426,33298,33267,33236,33243,
+33275,33087,33354,33288,33352,33361,33312,33288,
+33236,33262,33219,33155,33159,33101,33159,33204,
+33099,32955,32961,33126,33079,32990,33059,33012,
+32994,32998,33090,32974,32967,32970,32971,32976,
+32967,32971,32973,32974,32976,32973,32967,32958,
+32949,32955,32961,32967,32970,32973,32989,33008,
+33002,32999,32994,32988,32969,32964,32959,32964,
+32942,32940,32953,32970,32942,32940,32946,32943,
+32946,32955,32958,32958,32958,32943,32929,32934,
+32940,32943,32941,32948,32963,32958,32967,32975,
+32988,32995,33038,33042,33077,33052,32985,32983,
+32980,32979,32976,32973,32970,32966,32961,32959,
+32958,32958,32956,32959,32955,32955,32958,32958,
+32954,32949,32943,32925,32911,32903,32896,32914,
+32919,32925,32937,32934,32925,32923,32920,32914,
+32910,32910,32908,32904,32898,32895,32893,32893,
+32890,32887,32884,32880,32880,32880,32883,32883,
+32880,32877,32874,32873,32872,32874,32872,32871,
+32871,32871,32871,32871,32868,32868,32865,32859,
+32856,32853,32850,32845,32838,32824,32777,32723,
+32631,32601,32567,32529,32493,32456,32427,32403,
+32398,32388,32400,32396,32380,32363,32370,32391,
+32404,32421,32436,32445,32452,32451,32424,32394,
+32380,32215,32263,32169,32165,32191,32063,31870,
+31848,31011,30066,29400,28983,28878,30711,31462,
+30639,30591,29683,23000,21748,21750,21835,21734,
+21740,21745,21711,21626,21560,21516,21722,21760,
+21780,22421,21784,21818,21840,21865,21888,21912,
+21942,21975,22009,22045,22071,22092,22148,22170,
+22185,22194,22228,22288,22225,22390,22369,22635,
+22647,22672,22731,22787,22867,22978,23179,23371,
+23463,23532,23593,23732,23795,23912,24122,24445,
+24878,25221,25959,27402,29613,31553,31881,31920,
+31947,32036,32056,32134,32212,32722,32991,33056,
+33201,33432,33448,33606,33565,33360,33259,33274,
+32965,32442,32531,33435,33331,32646,31653,31521,
+31597,31607,31512,31527,31542,31567,31602,31624,
+31610,31550,31521,31468,31478,31499,31544,31517,
+31527,31526,31524,31545,31608,31650,31653,31752,
+32034,32213,32259,32302,32347,32372,32427,32517,
+32598,32897,32757,32619,32454,32484,32509,32411,
+32420,32407,32433,32476,32477,32526,32486,32427,
+32113,32006,32208,32286,32323,32175,32032,31857,
+31779,31730,31641,31367,31393,31439,31370,31224,
+30951,30788,30712,30752,30726,30636,30707,30762,
+30710,30738,30774,30844,30893,30810,30695,30864,
+30875,30913,30936,30863,30861,30753,30418,30139,
+29752,29337,29016,28313,27945,27573,27183,26913,
+26730,26521,26379,26333,26350,27210,29206,30632,
+31305,31658,31199,30966,31199,31107,31034,30970,
+30858,31038,32138,32056,32522,32855,33064,33677,
+34171,35691,36313,36948,37547,37991,38355,38675,
+39021,39303,39588,39834,40053,40246,40434,40607,
+40761,40916,41064,41204,41338,41468,41589,41697,
+41791,41877,41954,42016,42063,42093,42102,42085,
+42056,42033,42000,41965,41946,41925,41899,41873,
+41851,41865,41861,41830,41777,41754,41681,41584,
+41502,41265,40771,40231,39874,39463,39130,38937,
+38594,37662,36683,36477,36593,35945,36745,35736,
+36070,35786,34949,35003,35424,36539,34719,33021,
+32911,32777,32502,32543,32400,32428,32310,32301,
+32175,32149,32045,29730,27163,25564,24768,24526,
+24228,24032,24003,23873,23526,23542,23223,23317,
+23122,23024,22926,22800,22599,22491,22590,23487,
+22824,22280,22449,22723,22246,22164,21895,23047,
+22831,22614,22475,22749,22594,23167,23532,23199,
+22679,23196,23610,23194,23796,24606,27770,27887,
+26035,23596,25233,25719,25778,25954,26020,26259,
+26487,26654,26810,27135,27387,27573,28014,29205,
+31417,32280,32406,32475,32705,32871,32818,32760,
+32661,32499,32277,32334,32352,32345,32070,31919,
+31845,31815,31720,31821,31834,31818,31815,31794,
+31839,31848,31900,31964,31992,32066,32158,32284,
+32304,32228,32163,32133,32127,32178,32200,32196,
+32242,32278,32324,32384,32427,32391,32358,32349,
+32391,32345,32337,32310,32208,32228,32147,32051,
+32006,31996,32096,32123,32210,32277,32143,32118,
+32298,32394,32517,32565,32580,32554,32463,32378,
+32357,32401,32574,32602,32673,32725,32996,33432,
+34371,34496,33735,34194,33269,32928,32759,32417,
+32256,31937,32038,32127,32218,32419,32716,32765,
+32721,32606,32712,32690,32661,32723,32700,32732,
+32864,32901,32941,32944,32946,32949,32945,32940,
+32940,32937,32937,32939,32940,32937,32940,32939,
+32937,32913,32901,32900,32931,32914,32925,32946,
+32897,32887,32893,32908,32938,32938,32938,32937,
+32937,32939,32972,32984,32985,33021,33045,33047,
+33288,33400,33443,33399,33525,33462,33712,33876,
+33425,33675,33572,33919,33732,33867,33953,33584,
+34297,34602,34242,33839,33576,33312,33378,33036,
+33422,33094,33180,33075,33043,33319,33416,33069,
+33145,33252,33186,33278,33429,33197,33265,33384,
+33273,33205,33116,33102,32931,32974,32987,32995,
+33174,33253,33025,32938,32907,32935,32955,32970,
+32987,32973,32970,32967,32968,32958,32943,32925,
+32955,32959,32962,32965,32968,32971,32973,32964,
+32953,32945,32937,32922,32914,32905,32901,32902,
+32911,32926,32959,32958,32940,32928,32931,32962,
+32972,32970,32985,32982,32979,32958,32902,32928,
+32940,32947,32949,32949,32943,32940,32943,32956,
+33011,33047,32984,32974,32964,32958,32955,32955,
+32955,32955,32956,32955,32956,32955,32956,32965,
+32969,32970,32970,32970,32973,32973,32971,32970,
+32960,32956,32953,32947,32943,32943,32937,32916,
+32912,32895,32895,32895,32903,32903,32895,32893,
+32893,32885,32880,32877,32874,32872,32871,32869,
+32868,32868,32868,32868,32867,32863,32862,32860,
+32856,32851,32850,32851,32851,32850,32848,32845,
+32844,32847,32850,32853,32856,32853,32844,32834,
+32823,32818,32815,32812,32786,32730,32680,32657,
+32569,32524,32449,32389,32361,32339,32331,32327,
+32321,32306,32296,32289,32257,32181,32186,32073,
+32085,32106,32246,32334,32368,32400,32401,32416,
+32210,31846,31795,31783,31791,31781,31741,30590,
+29361,28669,28058,27532,27446,27636,28676,27986,
+27859,29031,30555,29995,30132,25893,21871,21659,
+21657,21696,21753,21751,21742,21742,21785,21748,
+21773,21784,21786,21816,21822,21849,21867,21879,
+21894,21918,21945,21963,21982,22008,22039,22062,
+22083,22086,22035,22107,22145,22263,22153,22193,
+22280,22383,22452,22648,22801,22807,22800,22800,
+22799,22798,22789,22734,22905,23334,23796,24001,
+24279,24577,25936,28504,30138,31309,31835,31863,
+31927,31871,31839,31812,31741,31685,31720,31720,
+31668,31674,31664,31579,31520,31587,31590,31836,
+31886,31805,31781,31773,31682,31660,31689,31706,
+31776,31884,32109,33201,33520,33314,33563,33456,
+33586,33226,33145,32780,32611,32571,32520,32565,
+32514,32544,32630,32483,32466,32508,32528,32484,
+32516,32550,32580,32756,32593,32604,32671,32842,
+32839,32684,32614,32943,32559,32243,32275,32817,
+32736,32888,33357,33519,33453,32673,32610,32682,
+33263,33276,33546,33818,34269,33456,32828,33723,
+33812,33941,34292,34323,34013,34153,34276,33948,
+33392,32391,34298,35400,35792,35787,34719,33084,
+32737,31866,31703,31866,32060,32040,31968,31750,
+31550,31476,31275,31133,30797,30536,30340,30216,
+30082,29908,29506,29135,28657,28484,28104,27597,
+27382,27135,27441,28066,30096,31295,31877,31961,
+32166,32157,32201,31883,31376,30711,30765,30685,
+30520,31237,32265,32848,32945,32974,33016,34073,
+35232,35886,36582,37236,37842,38228,38633,38933,
+39199,39479,39772,39997,40170,40368,40532,40683,
+40836,40977,41117,41254,41379,41496,41603,41700,
+41781,41847,41898,41938,41960,41960,41938,41902,
+41862,41822,41778,41748,41728,41687,41652,41614,
+41605,41608,41589,41522,41479,41401,41336,41304,
+41247,41180,40887,40386,40064,39574,39358,39127,
+38893,38745,38603,38576,38578,38471,38331,37947,
+37536,37239,36851,35718,36195,34613,33252,34071,
+32316,32574,32574,32266,32095,32021,31917,31985,
+32177,32347,32425,32433,32092,29836,28038,26598,
+25387,24297,23842,23531,23366,23179,23211,23151,
+22851,22754,22817,22686,22411,22158,22309,22091,
+22218,22248,22168,22141,22217,22686,22578,21941,
+21955,21951,22051,21935,21749,22038,24389,22371,
+24204,22790,23872,24007,24799,26636,26674,25914,
+24622,24590,25507,25380,25413,25631,26006,25776,
+25982,26286,26575,26764,27437,28210,29818,31340,
+32223,32191,32347,32236,32395,32557,32793,32846,
+32836,32796,32721,32707,32706,32691,32624,32552,
+32460,32452,32292,32202,32019,31997,31984,31974,
+31953,31909,31830,31886,31921,31954,32136,32308,
+32478,32459,32422,32349,32280,32280,32346,32252,
+32271,32382,32397,32508,32570,32553,32525,32546,
+32512,32434,32423,32426,32421,32268,32125,32124,
+32095,32124,32138,32136,32236,32384,32330,32269,
+32313,32291,32366,32426,32528,32534,32542,32552,
+32557,32435,32398,32358,32496,32683,32676,32752,
+32955,34314,34515,35046,34626,34431,34102,33169,
+32993,32487,32262,31833,32134,32087,32482,32633,
+32858,32865,32720,32593,32704,32646,32709,32656,
+32409,32847,32904,32655,32874,32918,32929,32929,
+32931,32937,32945,32934,32928,32919,32911,32905,
+32907,32901,32898,32904,32894,32911,32952,32960,
+32892,32885,32889,32898,32910,32901,32863,32865,
+32882,32925,32959,32960,33162,32969,33213,33270,
+33395,33507,33655,33660,33516,33339,33408,33673,
+33604,33615,33635,33830,33526,33582,33523,33468,
+33543,33783,33855,33378,33424,33516,33675,33639,
+33317,33027,33813,33717,33815,33410,33308,33015,
+33015,33214,33337,33367,33309,33367,33436,33493,
+33390,33381,33336,33339,33267,33189,33197,33119,
+32949,32946,32933,32902,32901,32914,32937,32955,
+32966,32961,32958,32952,32952,32958,32960,32916,
+32934,32955,32958,32942,32956,32954,32942,32910,
+32894,32884,32878,32900,32940,32922,32908,32909,
+32902,32895,32895,32901,32909,32920,32940,32949,
+32955,32955,32958,32949,32940,32929,32922,32914,
+32924,32928,32929,32937,33023,33066,33057,32979,
+32958,32946,32950,32953,32955,32959,32971,32971,
+32970,32973,32973,32970,32970,32970,32970,32984,
+32994,33081,32997,32989,32988,32978,32970,32972,
+32970,32955,32952,32950,32949,32946,32936,32917,
+32894,32880,32877,32877,32877,32877,32877,32874,
+32871,32868,32868,32868,32867,32865,32862,32858,
+32856,32853,32851,32847,32835,32830,32833,32833,
+32833,32832,32830,32827,32824,32821,32820,32812,
+32806,32805,32808,32800,32777,32754,32731,32704,
+32670,32631,32605,32592,32589,32595,32598,32591,
+30798,30783,30937,30918,30883,30936,30843,31046,
+31347,31185,31540,31846,31773,31843,31637,31430,
+31560,31593,31731,31905,32032,32259,32379,32484,
+32466,32401,32058,31682,31366,31292,31275,30834,
+27967,28191,27010,26935,27093,26814,26940,27160,
+29219,30026,30080,30030,28073,27453,28018,23636,
+21780,21761,21875,21909,21790,21766,21769,21735,
+21743,21662,21544,21525,21534,21616,21810,21782,
+21601,21605,21835,21669,21868,21944,21986,21987,
+22026,22056,22125,22119,22122,22041,22029,22073,
+22148,22251,22363,22497,22622,22729,22794,22816,
+22792,22848,22830,22798,22756,22776,23541,24117,
+24461,25779,27946,28221,30359,31008,31808,31878,
+31897,31887,31873,31872,31816,31762,31708,31650,
+31602,31602,32025,31578,31652,31667,31619,31707,
+31758,31803,31863,31883,32616,33876,33765,33328,
+33465,33580,34487,33805,33919,33928,33562,33559,
+33525,33029,33161,33470,33481,33330,33093,33194,
+33294,33354,33479,33444,32949,32623,33000,33134,
+33005,32626,32616,32622,32506,32601,32766,33001,
+33233,33527,33651,33292,32895,32740,32553,33016,
+33206,33421,33457,33338,33456,32418,32578,33456,
+33475,33480,33731,33909,33912,33952,33795,33910,
+33944,33899,33953,33609,34599,34469,34782,36201,
+36944,37530,37797,37911,37509,37150,36690,35299,
+33461,31385,31230,31677,31866,31872,31869,31834,
+31722,31659,31482,31184,31038,30933,30884,30894,
+30999,31093,31122,31044,31023,31050,31071,31410,
+31903,31741,31635,32020,32250,32232,32385,32502,
+32572,32574,32452,31464,30399,30297,30562,31843,
+32327,32259,32409,32996,33760,34590,35100,35670,
+36225,36872,37552,38031,38371,38709,38973,39234,
+39481,39754,39957,40149,40331,40506,40668,40810,
+40936,41059,41175,41288,41391,41498,41593,41676,
+41736,41785,41818,41830,41820,41793,41756,41710,
+41662,41614,41561,41520,41469,41410,41379,41373,
+41353,41348,41304,41265,41251,41232,41196,41154,
+41101,41040,40965,40752,40522,40162,39964,39736,
+39504,39271,38964,38880,38879,38788,38798,38691,
+38932,37641,36510,34711,36151,35345,32941,32204,
+33083,32841,33173,33187,32532,32212,32034,32279,
+32509,32619,32389,32424,32375,32352,32316,31922,
+29874,27252,25488,25184,24343,23939,23649,23300,
+22899,22803,22714,22616,22585,22368,22347,21978,
+22255,22148,22059,21999,22215,21961,22122,21734,
+22419,23232,25704,25869,24432,24456,23670,23256,
+23960,23460,24066,24636,25303,25989,25593,23304,
+24872,25341,25263,25491,25613,25900,26046,26335,
+26849,27488,28238,29108,30231,31377,32091,32406,
+32404,32402,32563,32601,32883,32934,32900,32880,
+32886,32886,32864,32850,32823,32774,32688,32638,
+32586,32531,32522,32454,32408,32382,32277,32196,
+32144,31997,31957,31951,31923,31932,31974,32013,
+32228,32298,32423,32454,32484,32496,32532,32532,
+32516,32491,32442,32410,32421,32441,32404,32363,
+32429,32418,32430,32384,32283,32079,32037,32046,
+32082,32122,32137,32116,32218,32202,32137,32217,
+32244,32259,32259,32289,32385,32515,32511,32490,
+32436,32487,32530,32378,32379,32381,32446,32556,
+32704,32942,33971,35337,35260,35012,35148,34285,
+34452,33852,33063,32848,32658,32070,31888,31968,
+31974,32136,32055,32215,32469,32431,32418,32455,
+32394,32520,32696,32705,32794,32862,32829,32897,
+32906,32916,32909,32899,32904,32892,32874,32875,
+32878,32892,32915,32939,32891,32895,32886,32883,
+32882,32880,32925,33000,32991,32885,32853,32859,
+32922,32904,32889,32910,32922,32873,32877,32906,
+32941,33090,33094,33217,33634,33450,33719,33955,
+33909,34148,34292,34063,33594,33472,33361,33475,
+33483,33279,33192,33223,33282,33427,33551,33527,
+33263,33567,33771,33791,33968,33954,33675,33702,
+33507,33482,33138,33422,33237,33941,34069,34050,
+34107,34699,34354,34377,34812,33995,33942,33663,
+33450,33309,33097,32944,32895,32877,32877,32926,
+32943,32941,32941,32925,32910,32927,32914,32910,
+32880,32875,32895,32895,32895,32875,32872,32889,
+32886,32898,32898,32898,32895,32891,32890,32890,
+32890,32884,32883,32877,32877,32868,32933,32949,
+32962,32955,32941,32938,32928,32893,32885,32922,
+32937,32948,33108,33204,33291,33399,33267,33102,
+33067,33033,33006,33003,33003,33007,33051,33054,
+33067,33017,32984,32929,33090,33090,33102,33119,
+33087,32992,33058,33011,32968,32955,32953,32958,
+32959,32955,32949,32946,32943,32941,32930,32916,
+32902,32895,32889,32886,32883,32883,32883,32883,
+32877,32871,32868,32868,32868,32868,32860,32850,
+32839,32829,32823,32814,32806,32800,32797,32800,
+32803,32806,32804,32761,32707,32662,32635,32605,
+32575,32545,32518,32493,32468,32440,32409,32377,
+32304,32208,32086,31959,31858,31793,31577,31095,
+29889,29833,29665,29611,29546,29438,28057,27759,
+27452,27021,27010,27150,27278,27515,27762,27796,
+28194,28063,28452,30347,31318,32150,32286,32361,
+32335,32298,32239,31811,31581,31321,31379,31139,
+28349,26998,27047,28245,28395,26697,26763,28053,
+27764,29319,31146,31083,30653,30111,29567,26595,
+23146,21872,21744,21746,21678,21545,21516,21504,
+21495,21504,21507,21669,21769,21657,21762,21817,
+21728,21759,21893,21915,21911,21844,21939,21978,
+21957,21931,21857,21745,22073,21947,21864,21884,
+21926,21980,22041,22108,22178,22239,22344,22444,
+22530,22578,22590,22572,22579,22787,23752,24716,
+25054,25155,26141,27663,28598,29532,30513,31455,
+31876,31857,31900,31845,31867,31872,31907,31839,
+31845,31881,31913,32055,32043,32963,32679,32581,
+32285,32698,33513,33403,32877,32551,33471,33882,
+33968,34014,33664,33912,33897,33874,33505,33521,
+33285,32736,32249,32406,32550,32947,33289,33525,
+33212,33456,33517,33496,33304,32754,32331,32482,
+32488,32914,32985,33011,33417,33301,33429,33284,
+33397,33393,33401,33281,33008,32776,32924,32875,
+32863,32835,32937,32843,32256,32269,32721,32979,
+33261,33375,33461,33471,33760,33911,32880,32814,
+32758,32565,32478,32458,32049,31701,32283,33250,
+33947,33053,34685,34786,35175,33351,32133,31161,
+31401,32460,32100,32361,32280,32211,32139,32072,
+31893,31895,31949,31876,31820,31885,31847,31808,
+31597,31526,31508,31384,31443,31599,31757,32088,
+32166,32145,31647,31220,31080,31064,30873,30807,
+31197,31784,31322,30960,31513,32394,32565,32783,
+32951,33040,33388,34349,35421,35978,36225,36612,
+37353,38038,38375,38682,38965,39215,39448,39668,
+39853,40030,40192,40347,40495,40642,40777,40903,
+41019,41126,41224,41319,41409,41486,41552,41608,
+41659,41686,41691,41677,41651,41613,41575,41533,
+41493,41446,41401,41359,41316,41240,41154,41075,
+41029,40962,40887,40854,40836,40800,40768,40737,
+40704,40663,40622,40563,40483,40280,40114,39900,
+39697,39443,39162,38981,38748,38472,37913,37396,
+37069,36681,36642,33510,34917,34562,34540,34428,
+33669,32541,32018,31865,31993,32310,32568,32568,
+32526,32511,32463,32456,32331,32155,32115,31980,
+31853,31900,31182,30324,28053,27910,27156,26890,
+25733,24789,24037,23428,23213,23097,22768,22536,
+22302,22113,21936,22022,22225,22047,22423,24651,
+27053,24893,24158,23989,23922,23466,24720,25046,
+26765,26602,25293,24930,26079,25219,23656,25271,
+26962,25934,25959,25871,25968,26262,26604,27043,
+27663,28392,29254,30421,31864,31795,31850,31927,
+31902,32088,32228,32421,32673,32787,32826,32860,
+32876,32892,32881,32886,32855,32844,32771,32740,
+32709,32700,32672,32654,32526,32550,32337,32267,
+32276,32252,32157,32082,32055,31982,31988,32025,
+32044,32151,32262,32330,32303,32455,32496,32493,
+32475,32440,32426,32417,32349,32298,32277,32134,
+32195,32210,32235,32157,31986,32060,32073,32105,
+32148,32202,32137,32097,32108,32132,32184,32240,
+32235,32260,32248,32190,32207,32248,32421,32545,
+32592,32601,32583,32587,32646,32717,32705,32633,
+32512,32531,32583,32718,32910,33343,34466,34176,
+35075,35439,35472,35392,34899,34662,33659,33297,
+33051,32969,32847,32522,32250,32111,32124,32115,
+32133,32021,32170,32314,32514,32612,32678,32483,
+32616,32668,32700,32765,32808,32807,32793,32820,
+32856,32866,32866,32875,32856,32844,32859,32871,
+32880,32855,32850,32848,32856,32863,32863,32866,
+32865,32865,32883,32865,32889,32911,32907,32946,
+32940,32940,32924,32889,32874,32887,32925,33006,
+33051,33043,33219,33579,33604,33737,33387,33161,
+33345,33529,33611,33425,33393,33162,33025,33183,
+33452,33382,33350,33190,33241,33585,33455,33611,
+33737,33851,33862,34447,34618,34780,34425,34471,
+34546,34296,35054,34568,34607,34067,34000,33777,
+33774,33056,33129,33046,32947,32881,32875,32883,
+32940,32928,32917,32911,32927,32889,32868,32847,
+32839,32826,32821,32821,32820,32846,32865,32872,
+32861,32849,32857,32865,32870,32871,32870,32872,
+32872,32871,32868,32870,32852,32874,32941,32941,
+32941,32933,32916,32895,32889,32880,32903,33159,
+32955,32944,33099,33078,33337,33305,33353,33077,
+33054,32994,33009,33009,33003,33022,33021,33067,
+33034,32970,32964,32956,32949,32938,32937,32937,
+32940,32935,32928,32928,32931,32928,32932,32936,
+32963,32927,32912,32901,32904,32897,32888,32881,
+32880,32878,32877,32875,32874,32871,32868,32865,
+32862,32860,32859,32857,32854,32851,32848,32834,
+32819,32808,32799,32790,32778,32762,32701,32665,
+32631,32602,32574,32546,32517,32487,32457,32424,
+32400,32376,32351,32334,32331,32217,32109,31984,
+31860,31629,31239,30887,30609,30378,29963,29964,
+29712,29802,30219,30392,30034,29154,27959,27416,
+26975,26499,26401,26389,26401,26397,26402,26447,
+26648,26481,26744,26760,26985,26928,27528,28733,
+30641,31982,32014,31815,30927,31202,31218,30525,
+30614,28445,26945,27045,29867,26719,26689,26899,
+27095,30324,30969,31011,31131,31264,31009,30654,
+30162,24165,21822,21775,21673,21723,21801,21845,
+21834,21594,21557,21732,21708,21815,21696,21660,
+21567,21696,21881,21633,21761,21690,21904,21955,
+21981,22023,22045,22019,22038,21968,21902,21910,
+21951,22003,22066,22126,22166,22184,22199,22285,
+22468,22581,22712,22884,23396,23635,23917,24194,
+24603,24735,25396,26148,27206,27765,28162,29342,
+29526,30622,31308,31941,32091,32213,32327,32494,
+32616,32808,33002,33045,33073,33218,33057,33333,
+33447,33365,32850,32345,32647,32895,32415,32561,
+32872,32995,33195,33070,32899,33071,32956,32409,
+32214,32223,32268,32911,33024,33266,33405,33008,
+32393,32010,32417,32325,32341,32355,32668,33001,
+33181,33452,33609,32940,33174,33219,32912,33489,
+33496,33465,33441,33417,33070,32508,32095,32263,
+32796,32991,32933,32901,32971,32815,33420,33597,
+33643,33548,33411,33886,34167,33241,32792,32454,
+32219,32460,32092,32383,32475,32750,32908,32544,
+32181,31128,30919,31012,30986,32470,34961,33249,
+32915,32721,32733,32384,32040,31819,32387,32161,
+31973,31853,31670,31677,31640,31449,31425,31398,
+31216,31089,31032,32238,32372,32748,33459,35065,
+34550,33651,33225,33420,32946,33616,33849,32990,
+33537,32956,33249,33192,33668,33767,34496,34655,
+34798,35751,36339,36780,37195,37236,37236,37641,
+38397,38736,39031,39255,39443,39650,39823,40008,
+40169,40296,40412,40527,40636,40750,40861,40966,
+41061,41152,41233,41307,41373,41432,41475,41504,
+41510,41496,41474,41446,41416,41385,41352,41309,
+41259,41212,41158,41102,41041,40966,40905,40828,
+40737,40639,40543,40476,40421,40370,40329,40285,
+40260,40227,40176,40119,40053,39987,39915,39759,
+39570,39275,39003,38802,37935,37493,36587,35611,
+35209,34388,33510,33123,33057,33894,34139,33731,
+32652,32320,33716,32670,32636,32322,32219,32252,
+32159,32114,32183,32209,32388,32463,32391,32480,
+32401,32118,32109,32163,32233,32385,31938,30747,
+29841,29153,27229,25278,25086,25203,25061,23283,
+22787,22669,21942,21725,22257,25997,26980,24315,
+25920,23846,23716,23565,23448,23303,23558,23332,
+23940,24423,25173,25635,26341,25984,25415,25807,
+26395,26861,26292,26602,26662,26531,26691,27110,
+27674,28491,28989,29889,30923,31969,32088,32208,
+32406,32400,32172,32120,32187,32259,32294,32344,
+32290,32313,32420,32558,32680,32817,32853,32820,
+32841,32808,32766,32714,32603,32547,32527,32592,
+32554,32493,32274,32171,32129,32123,32091,32115,
+32142,32139,32162,32244,32121,32151,32134,32151,
+32212,32253,32181,32262,32238,32293,32387,32302,
+32287,32238,32229,32182,32148,32131,32160,32140,
+32271,32208,32259,32279,32279,32453,32397,32436,
+32297,32373,32408,32270,32253,32192,32109,32169,
+32304,32562,32686,32710,32674,32669,32701,32710,
+32791,32850,32838,32754,32666,32529,32614,32730,
+32816,32945,33251,33347,33213,33159,33142,33989,
+34074,34593,34270,34041,34016,33666,33515,33162,
+33016,32653,32549,32550,32514,32598,32563,32600,
+32580,32664,32727,32782,32706,32743,32759,32743,
+32724,32806,32780,32766,32761,32787,32831,32853,
+32840,32824,32825,32836,32844,32847,32876,32901,
+32846,32860,32886,32853,32885,32851,32848,32859,
+32861,32852,32850,32886,32940,32892,32841,32904,
+32908,32905,32912,32851,32898,33015,32933,33350,
+33084,32999,32832,32830,32943,33042,32991,33027,
+33218,33090,33145,33150,33057,33096,33132,33062,
+33289,33844,33930,33582,33664,33692,33546,33485,
+33623,34113,34389,33663,33942,33921,33214,33050,
+33041,32997,33016,32959,32916,32880,32882,32866,
+32853,32850,32860,32880,32880,32878,32850,32823,
+32817,32798,32784,32769,32784,32797,32803,32802,
+32808,32829,32852,32853,32852,32854,32857,32863,
+32865,32856,32849,32842,32848,32853,32862,32869,
+32871,32868,32877,32901,32916,32925,32928,32931,
+32937,32940,32940,32937,32938,32945,32955,32962,
+32976,32988,32982,32955,32943,32934,32928,32916,
+32896,32895,32893,32892,32890,32892,32895,32895,
+32898,32898,32896,32893,32893,32893,32889,32887,
+32889,32907,32884,32890,32886,32882,32877,32871,
+32868,32862,32856,32853,32845,32836,32821,32820,
+32814,32811,32811,32815,32820,32820,32811,32802,
+32797,32791,32776,32749,32700,32588,32480,32407,
+32400,32398,32382,32364,32346,32322,32287,32242,
+32192,32139,32086,32031,31974,31902,31836,31496,
+31185,30717,30369,29942,29829,29776,29728,29695,
+29511,29770,30053,30504,29792,28684,28294,27888,
+27563,27168,26992,26823,26583,26422,26422,26475,
+26491,26413,26328,26481,26491,26384,26798,27600,
+29528,31174,31074,31033,29535,29541,31095,31165,
+31210,30069,29607,29335,30105,30225,26809,26821,
+26806,26874,27637,30054,29281,31630,28871,27819,
+29326,29979,29589,24963,21828,21805,21797,21795,
+21798,21801,21810,21819,21822,21833,21843,21825,
+21818,21800,21842,21877,21924,21861,21876,21941,
+21972,22020,22062,22101,22129,22077,22033,22012,
+22003,21973,21956,21987,22035,22086,22141,22171,
+22331,22569,22713,22800,22800,22829,23365,23910,
+23979,23881,24576,24950,24926,25196,25665,26394,
+27523,28069,29767,31084,31392,31794,31859,32047,
+32136,32280,32340,32616,32846,32970,33003,33057,
+33083,33096,33245,32999,33032,33201,33319,33292,
+32801,32277,32982,33002,33012,32766,31867,31842,
+32028,31806,32167,32135,32537,33056,33057,32302,
+31700,32045,32398,32544,32553,32630,32728,32663,
+32372,32004,31824,32249,32550,32928,33268,32799,
+33003,32217,31848,32092,32442,32567,33068,33346,
+33855,33861,33867,33669,33461,33043,32414,32541,
+32770,32482,32550,33724,33243,33952,33562,34737,
+33640,34611,34608,36070,35341,35308,35095,34677,
+34854,34314,34104,34386,33328,35750,36139,35433,
+34822,34023,34037,34856,33005,32396,32553,32717,
+31852,31681,31515,31411,31696,32534,32749,32046,
+30682,31118,32518,32701,32931,33486,34137,34176,
+33926,35151,36568,36690,36889,36960,37065,37169,
+37203,37212,37376,37432,37549,37524,37596,37651,
+37761,37930,38076,38203,38337,38455,38524,38800,
+38964,39154,39322,39502,39673,39834,39981,40106,
+40228,40350,40470,40579,40682,40776,40861,40941,
+41013,41082,41147,41203,41247,41283,41302,41302,
+41288,41263,41235,41203,41169,41134,41089,41038,
+40985,40932,40866,40800,40744,40686,40623,40554,
+40468,40375,40281,40185,40089,40005,39932,39848,
+39754,39657,39613,39556,39490,39391,39301,39200,
+39111,38913,38697,38648,37366,36929,36410,35756,
+35174,33658,33140,32988,33003,33004,32993,32806,
+33009,32885,33029,32671,32196,32151,32370,32454,
+32400,32342,32292,32247,32349,32400,32382,32135,
+32154,32121,31998,32054,32106,32103,32401,31992,
+32123,32257,31248,28710,28300,28230,26442,26218,
+25488,25224,24665,24815,24036,23992,23453,23349,
+23520,23193,23471,23262,23493,23397,23573,23457,
+24003,24377,25537,25413,27141,26058,23443,25882,
+26555,26577,26327,26170,26405,27098,28062,28644,
+29104,30265,31813,32508,32679,32442,32814,32950,
+33927,33622,32876,32808,32563,32777,32600,32559,
+32602,32850,32807,32817,32622,32580,32644,32784,
+32860,32885,32889,32846,32793,32681,32651,32561,
+32593,32423,32257,32269,32265,32236,32202,32216,
+32304,32408,32579,32580,32608,32538,32478,32477,
+32402,32438,32466,32432,32460,32445,32425,32406,
+32373,32422,32345,32348,32318,32311,32310,32276,
+32255,32198,32216,32143,32220,32431,32427,32391,
+32304,32288,32343,32133,32024,32058,31988,31938,
+32019,32088,32193,32277,32389,32592,32498,32627,
+32526,32518,32577,32520,32552,32502,32296,32286,
+32414,32428,32403,32427,32436,32404,32369,32375,
+32476,32671,32837,32677,33766,33684,34776,34744,
+33879,33309,32682,32001,31812,31929,32019,32247,
+32423,32498,32567,32652,32553,32424,32571,32552,
+32616,32658,32676,32757,32700,32731,32800,32827,
+32824,32824,32827,32837,32851,32874,32908,32850,
+32895,32923,32928,32857,32882,32923,32964,32872,
+32895,32940,32955,32905,32902,32863,32918,32925,
+32926,32878,32797,32881,32919,32951,32971,32963,
+32848,32841,32962,33000,32946,32916,32886,32919,
+32940,32964,33038,33090,33279,33501,33675,33588,
+33342,33339,33656,33642,33500,33082,32970,32976,
+33018,32965,33047,32982,32985,33011,32994,32962,
+32941,32935,32913,32882,32856,32853,32850,32819,
+32851,32862,32874,32858,32847,32829,32814,32797,
+32788,32791,32780,32760,32750,32739,32733,32730,
+32727,32731,32749,32793,32802,32808,32820,32820,
+32823,32811,32809,32814,32820,32825,32838,32848,
+32872,32892,32898,32908,32913,32913,32917,32925,
+32925,32925,32928,32928,32934,32940,32940,32940,
+32942,32940,32940,32934,32928,32922,32914,32899,
+32895,32895,32895,32895,32905,32901,32895,32889,
+32883,32877,33003,32878,32880,32877,32875,32875,
+32872,32871,32869,32866,32862,32855,32848,32847,
+32845,32854,32876,32935,32959,32876,32823,32805,
+32789,32763,32752,32746,32740,32730,32717,32699,
+32670,32625,32571,32511,32446,32395,32368,32337,
+32301,32265,32224,32181,32136,32088,32037,31983,
+31926,31861,31766,31363,30897,30608,30293,29968,
+29724,29448,29392,29539,29574,29600,29616,29586,
+28708,28686,28756,28776,28802,28780,29339,28948,
+28275,27520,27164,26949,26696,26576,26452,26459,
+26483,26379,26376,26527,27033,27214,29717,31383,
+31440,31266,30982,30785,30456,31974,31846,31983,
+31811,30707,25986,25062,30115,29160,29043,29927,
+29745,28002,27698,27606,27110,29788,29322,27337,
+28785,29090,29631,29014,25825,23326,21748,21829,
+21814,21813,21814,21809,21828,21828,21837,21840,
+21846,21860,21876,21891,21912,21936,21936,21933,
+21933,21948,21974,21998,22014,22038,22046,22023,
+21991,21951,21916,22099,22236,22290,22348,22428,
+22503,22541,22596,22661,22728,22786,22814,22818,
+22881,23300,23404,23448,23407,23989,24159,24558,
+25794,27006,27558,29307,30507,31166,31407,31743,
+31938,32072,32169,32292,32343,32394,32508,32511,
+32629,33026,33101,33060,33073,33054,33029,33006,
+32988,32898,32799,32727,32423,31994,31732,32355,
+32523,32001,31868,31987,31757,31563,31492,31677,
+32250,32113,31976,32152,32748,33007,33029,32859,
+31962,32049,32079,32205,32334,32394,32419,32484,
+32572,32658,32637,32454,32407,32397,32401,32472,
+32773,32715,32699,32712,32646,32386,31864,31698,
+32197,32961,32994,33039,32973,32171,31994,32640,
+32151,32814,33686,33924,33836,34181,33786,33631,
+33804,34335,33981,33789,32931,33642,34348,33181,
+33749,32940,31493,31467,31425,31418,31429,31530,
+31323,31262,30967,30959,31571,31787,32099,31818,
+30585,30326,31368,33343,33067,32451,33617,33750,
+33790,34883,34681,34764,34467,35514,35922,36332,
+36966,37512,38020,38265,38467,38644,38782,38869,
+38932,38973,39024,39087,39154,39225,39299,39390,
+39498,39604,39715,39820,39927,40029,40128,40227,
+40322,40416,40502,40581,40656,40728,40784,40827,
+40874,40923,40968,41009,41043,41067,41079,41076,
+41059,41037,41010,40971,40932,40887,40835,40781,
+40721,40664,40597,40528,40458,40386,40314,40237,
+40174,40080,39991,39901,39802,39694,39573,39447,
+39348,39253,39136,39045,38934,38778,38658,38455,
+38237,38118,37932,37614,37200,36966,36344,35562,
+34809,34155,33792,33744,33950,34398,34382,34252,
+33669,32955,33945,32935,32694,32388,32548,32346,
+32294,32176,32012,32123,32209,32211,32211,32241,
+32357,32314,31629,31752,31869,32067,32163,32104,
+32233,32438,32437,32399,32071,29945,29320,28173,
+26743,24441,23656,23724,23552,23541,23428,23436,
+23295,23571,23556,23564,23654,23537,25083,25345,
+25683,25588,25313,25445,26439,25785,22996,24417,
+27084,26787,26877,27267,28263,29253,30612,32371,
+32416,32385,32524,32802,32987,33597,34380,34850,
+34402,34317,33414,32748,32706,32669,32544,32563,
+32655,32806,32892,32928,32886,32910,32796,32706,
+32783,32793,32776,32724,32649,32559,32420,32379,
+32478,32445,32442,32421,32421,32442,32457,32492,
+32478,32530,32565,32555,32573,32544,32571,32569,
+32565,32557,32473,32443,32511,32413,32367,32411,
+32438,32412,32259,32283,32286,32283,32301,32288,
+32239,32162,32279,32291,32300,32250,32259,32200,
+32360,32139,32094,32056,32073,32016,31993,31951,
+31998,31953,31976,32011,32191,32403,32415,32496,
+32553,32506,32519,32567,32439,32398,32425,32401,
+32407,32341,32421,32442,32554,32664,32718,32704,
+32559,32457,32565,32697,32688,32428,32307,32115,
+31616,31626,31611,31635,31928,32114,32206,32255,
+32298,32311,32325,32382,32391,32337,32388,32365,
+32457,32465,32553,32589,32607,32702,32728,32778,
+32844,32862,32894,32884,32913,32862,32853,32874,
+32893,32901,32907,32866,32750,32786,32816,32846,
+32882,32938,33029,32998,32968,32985,32907,32854,
+32823,32793,32796,32838,32808,32844,32852,32739,
+32796,32819,32763,32813,32714,32627,32733,32768,
+32759,32853,32874,33000,33109,33431,33451,33378,
+33340,33124,33048,32994,32970,32943,32993,32964,
+32878,32854,32856,32865,32865,32878,32874,32859,
+32855,32845,32820,32823,32820,32818,32816,32827,
+32829,32825,32804,32772,32660,32637,32626,32702,
+32718,32680,32659,32586,32651,31702,31156,30998,
+30785,30624,30450,30444,31163,30957,31819,32703,
+32721,32736,32772,32784,32791,32800,32809,32817,
+32827,32839,32850,32857,32860,32863,32866,32871,
+32877,32882,32890,32902,32910,32910,32908,32909,
+32911,32914,32914,32914,32911,32908,32904,32901,
+32898,32898,32898,32898,32896,32893,32889,32884,
+32880,32871,32867,32865,32862,32859,32856,32853,
+32839,32823,32818,32817,32817,32815,32817,32828,
+32841,32820,32805,32794,32788,32770,32752,32742,
+32736,32731,32712,32700,32684,32658,32622,32583,
+32541,32499,32458,32416,32373,32319,32265,32208,
+32152,32095,32039,31983,31920,31845,31760,31407,
+31132,30729,30440,30009,29875,29404,29383,29391,
+29397,29419,29720,29994,30036,29857,29337,28846,
+28291,28282,28186,28322,29094,29942,29738,28808,
+28848,28398,26915,27066,26826,26484,26396,26214,
+26051,26308,26401,26735,27424,28818,31006,31491,
+31763,31822,31707,31350,31664,31810,32097,32202,
+32208,32059,30459,25439,24665,29668,30332,27331,
+27591,27788,29139,30528,28574,28449,28391,28485,
+30117,29979,29211,27870,27848,27990,24257,24367,
+21666,21816,21828,21825,21825,21831,21834,21838,
+21840,21844,21859,21871,21882,21912,22005,21966,
+21933,21920,21939,21963,21987,22005,22037,22062,
+22082,22110,22144,22185,22242,22296,22353,22402,
+22443,22482,22519,22572,22626,22680,22731,22771,
+22797,22872,23215,23493,23861,24045,24758,24909,
+25128,25569,26342,27181,27892,29123,30322,30971,
+31451,31808,31906,31998,32170,32151,32051,32344,
+32412,32409,32223,32199,32474,32274,32464,32619,
+32991,32949,32873,32970,32973,33023,33101,33315,
+33264,33140,33006,33056,32453,32004,31862,31626,
+31511,31823,32260,32820,33021,32552,32094,31888,
+31820,31844,32060,33053,33093,33006,32652,32401,
+32610,32551,32282,32551,32929,32883,32822,32769,
+33174,33033,33162,33246,33012,32975,32769,31667,
+31644,31603,31747,32046,32105,32333,32648,32952,
+33198,33894,33530,33126,32490,33227,34469,34268,
+33955,33249,33903,34372,33438,36063,37091,35745,
+35776,35436,34806,33800,33007,32586,32403,31983,
+31138,31043,31014,31664,32195,32457,32694,32698,
+32691,32995,32913,34483,33910,34638,33977,35154,
+36486,35503,35213,34723,35511,35634,36011,36914,
+37179,37488,38130,38418,38639,38825,38963,39072,
+39176,39264,39341,39409,39473,39533,39596,39659,
+39721,39782,39849,39914,39977,40040,40103,40164,
+40230,40293,40351,40410,40464,40521,40549,40592,
+40638,40677,40717,40756,40790,40818,40838,40844,
+40834,40812,40779,40737,40696,40643,40590,40535,
+40472,40401,40328,40251,40173,40093,40007,39918,
+39823,39721,39630,39544,39451,39352,39258,39129,
+38979,38815,38688,38549,38394,38238,38076,37917,
+37782,37597,37502,37318,36994,36804,36486,35928,
+35181,34988,34400,33612,32932,33669,33826,33954,
+33355,33033,32833,32883,33252,32721,32439,32262,
+31817,31833,31812,31857,31884,31917,31965,32087,
+32577,32394,32274,32301,32234,32278,32337,32271,
+32157,32127,32373,32472,32345,31808,28461,26882,
+25123,24486,24156,23980,23976,23982,23832,23728,
+23707,23594,24048,23967,24021,23755,23823,24005,
+24051,24686,25647,25926,26676,28236,24192,22769,
+26226,27577,28794,29912,31463,32262,32389,32571,
+32665,32724,32828,32892,33021,32949,33207,34074,
+35058,35210,33759,34655,33664,32709,32721,32820,
+32756,32895,34015,33815,34232,33345,34305,33656,
+33018,32855,32752,32497,32587,32629,32624,32556,
+32415,32394,32317,32334,32275,32322,32408,32493,
+32585,32580,32575,32483,32484,32483,32551,32550,
+32519,32463,32419,32342,32307,32270,32291,32367,
+32373,32354,32366,32327,32319,32320,32271,32095,
+31987,32123,32280,32166,32251,32330,32290,32292,
+32127,32013,32032,32275,32316,32280,32290,32278,
+32281,32265,32229,32230,32210,32110,32166,32232,
+32310,32423,32343,32397,32271,32244,32130,31986,
+31990,31986,32001,32002,32120,32048,32107,32147,
+32124,32042,31986,31970,31929,31941,31930,31668,
+31639,31683,31873,31981,32042,32088,32103,32133,
+32151,32155,32155,32146,32117,32115,32107,32099,
+32127,32172,32319,32486,32620,32716,32772,32797,
+32809,32838,32856,32826,32746,32654,32651,32825,
+32827,32720,32700,32622,32729,32760,32682,32803,
+32863,32853,32866,32846,32890,32916,32949,32959,
+32892,32895,32824,32801,32769,32753,32734,32798,
+32862,32822,32748,32694,32618,32674,32669,32691,
+32695,32609,32580,32634,32568,32548,32563,32598,
+32896,32692,32561,32468,32546,32469,32436,32394,
+32316,32282,32265,32221,32195,32194,32202,32234,
+32549,32733,32710,32673,32775,32775,32563,32195,
+32016,31700,30982,29868,29348,29114,28902,28813,
+28881,28920,28549,28029,27384,27042,27069,27429,
+27494,27094,27074,27078,27120,27575,28647,29169,
+28368,27655,29828,32017,32779,32699,32707,32750,
+32772,32777,32785,32795,32804,32811,32814,32821,
+32829,32834,32839,32842,32845,32848,32850,32851,
+32854,32857,32860,32862,32865,32872,32872,32877,
+32875,32875,32872,32872,32868,32864,32863,32860,
+32860,32859,32857,32856,32852,32844,32832,32821,
+32812,32806,32800,32797,32794,32791,32782,32774,
+32767,32761,32754,32743,32736,32728,32721,32713,
+32704,32701,32679,32606,32544,32487,32437,32415,
+32397,32370,32328,32286,32241,32190,32129,32056,
+31969,31864,31810,31786,31355,30934,30541,30237,
+30001,29868,29739,29749,29703,29465,29352,29079,
+28982,29212,28823,28572,28169,28143,28175,28221,
+28140,28476,28782,28527,28768,29627,30253,29649,
+28859,28658,28458,28146,28012,26835,26410,26943,
+26853,25961,25946,25611,26452,28882,31225,31801,
+31965,31830,31842,31800,31616,31426,31517,31539,
+31628,31560,31352,30410,27439,26104,28545,27681,
+25962,24300,24239,23504,27243,29574,28227,30093,
+28973,28552,29988,30324,29208,25898,23443,21983,
+21832,21822,21810,21807,21823,21822,21815,21834,
+21837,21837,21842,21843,21839,21829,21808,21834,
+21900,21898,21901,21924,21945,21960,22005,22048,
+22093,22137,22179,22213,22248,22285,22326,22350,
+22338,22345,22419,22483,22515,22563,22626,22691,
+22757,22805,22947,23283,23499,23853,24107,24435,
+24727,25254,25735,26040,26352,26850,27265,27529,
+27871,29184,30631,31335,31767,32044,32150,31818,
+31770,31802,31956,32166,32117,31956,32080,31932,
+32531,32595,32131,32540,32886,32937,32879,32625,
+32820,32685,32667,32623,32631,32434,32265,32061,
+31847,31848,31869,31800,31572,31452,32139,32901,
+32846,32748,32999,32907,33005,33344,33323,33189,
+33052,32695,31908,32553,33003,33027,33046,33272,
+33171,32991,32796,32625,32106,31711,31671,32787,
+33093,33539,33865,32893,33414,32980,33597,32939,
+32122,33942,33503,33227,34497,33839,34509,34158,
+33954,34111,34371,34397,33852,36396,37093,37335,
+36820,36417,36322,35688,34497,33541,33316,33474,
+33437,32412,31154,31176,30939,32118,33330,34827,
+35856,36180,35985,35697,35088,35488,36294,36648,
+36968,37214,37422,37583,37703,37768,37887,38023,
+38145,38244,38340,38416,38489,38571,38647,38721,
+38793,38874,38949,39023,39102,39177,39246,39313,
+39378,39447,39513,39578,39646,39714,39780,39843,
+39906,39969,40030,40098,40159,40215,40278,40323,
+40351,40400,40443,40482,40515,40544,40569,40584,
+40584,40571,40546,40515,40467,40416,40362,40305,
+40241,40173,40099,40017,39931,39841,39753,39667,
+39571,39469,39366,39264,39155,39011,38883,38770,
+38618,38487,38314,38116,37894,37663,37446,37193,
+36900,36660,36479,36390,36354,36342,36285,36091,
+35733,35516,35136,34557,33945,33210,32971,32959,
+33015,33241,32903,32619,32417,32232,31956,31766,
+32027,32472,32598,32369,32367,32391,32419,32454,
+32490,32485,32415,32394,32408,32403,32342,32146,
+32321,32331,32160,32021,31973,31927,30728,27890,
+26421,25899,24849,24478,24489,24129,24032,24018,
+24071,24103,26298,27861,26305,24977,24894,26624,
+26100,25808,27218,28209,27719,25170,23316,25027,
+26946,28874,30826,32081,32143,32076,32267,32943,
+32409,32543,32852,33303,32736,32420,32601,33252,
+34329,34409,33409,33316,34664,33544,32756,32837,
+32842,33024,33301,33022,33009,33122,32931,32886,
+32755,32703,32672,32520,32342,32104,32112,32104,
+32089,32091,32010,32047,32082,32167,32280,32355,
+32378,32462,32511,32552,32498,32312,32412,32561,
+32694,32644,32505,32505,32430,32562,32423,32346,
+32260,32248,32280,32390,32391,32310,32240,32255,
+32194,32111,32090,32180,32299,32228,32148,32153,
+32227,32256,32277,32263,32250,32213,32238,32297,
+32301,32223,32163,32240,32281,32329,32412,32430,
+32451,32492,32511,32508,32430,32327,32169,32157,
+32130,32101,32070,32028,31980,31990,32004,31988,
+31972,31956,31935,31958,31981,31966,31895,31836,
+31799,31812,31672,31714,31714,31716,31695,31702,
+31724,31728,31746,31823,31887,32033,32133,32177,
+32321,32438,32487,32541,32598,32643,32704,32784,
+32857,32884,32884,32902,32911,32892,32662,32815,
+32820,32841,32839,32829,32631,32701,32740,32584,
+32580,32619,32763,32859,32823,32876,32878,32896,
+32937,32931,32938,32945,32856,32884,32886,32897,
+32839,32574,32445,32524,32536,32453,32546,32916,
+33204,33768,33213,33192,33145,33117,33193,33045,
+32826,32794,32619,32508,33031,32998,32934,32935,
+32924,32879,32858,32848,32858,32763,32285,32009,
+31998,31977,31938,31889,31908,31938,31641,30415,
+29383,28741,27876,27405,27083,26916,26753,26496,
+26325,26207,26050,25842,25840,25631,25632,25755,
+25825,25930,25831,25710,25673,25670,25605,25479,
+25486,25662,26289,27435,26842,27979,28523,30262,
+30678,31342,32651,32553,32593,32408,32541,32694,
+32731,32769,32785,32793,32794,32796,32796,32803,
+32811,32817,32819,32821,32821,32820,32817,32815,
+32812,32812,32817,32822,32824,32824,32820,32817,
+32815,32812,32811,32808,32805,32800,32796,32790,
+32782,32774,32766,32760,32752,32746,32738,32730,
+32726,32721,32716,32712,32707,32703,32691,32656,
+32601,32539,32474,32408,32370,32305,32204,32088,
+31995,31929,31914,31939,31981,32016,32043,31988,
+31887,31813,31785,31647,31269,30776,30339,29694,
+29301,28886,28144,27847,27519,27504,27515,27534,
+27624,27561,27642,27732,27795,27870,27951,28023,
+28175,28212,28852,29544,28941,28885,28643,28377,
+28136,27921,28402,27624,27168,27570,26768,26099,
+25864,25283,24641,24966,25188,25200,26481,25270,
+25762,27544,29215,30213,30421,30264,30514,30519,
+30389,30524,30571,30648,30770,30881,31029,30888,
+27861,25040,23406,24395,24763,22109,21817,21873,
+21882,22028,22312,25149,23694,22020,21816,21837,
+21825,21825,21828,21828,21828,21825,21828,21839,
+21838,21839,21843,21843,21846,21846,21843,21841,
+22056,21964,21919,21912,21927,21947,22014,22080,
+22143,22201,22227,22248,22269,22291,22314,22336,
+22356,22375,22407,22461,22542,22542,22585,22647,
+22704,22752,22791,22875,23051,23237,23371,23555,
+23956,24040,24167,24315,24408,24600,25221,25905,
+25776,26253,26308,26430,26754,27204,27735,28689,
+29464,30616,31265,31718,32063,31568,31350,31905,
+31977,31893,31944,32126,32144,32163,32684,32847,
+32323,32680,33002,32895,31781,31613,31699,31740,
+31774,31743,31561,31604,31841,31793,32232,32589,
+32905,33104,33445,33456,33161,33372,33532,33165,
+32505,32094,31959,33009,33173,33022,32733,32491,
+32327,32400,32085,31653,33362,33323,33719,34281,
+34708,35131,36027,34104,36650,34699,34126,33669,
+34856,32703,33939,33968,33924,34770,33917,33922,
+33804,33315,33330,33158,33951,34885,36474,37877,
+37799,37103,35583,34158,37566,36864,35649,36129,
+35528,35682,33048,32976,31818,31559,31559,31717,
+31839,31974,32525,33046,33957,34470,34672,34872,
+35012,35190,35419,35718,35981,36307,36608,36825,
+37008,37179,37337,37494,37638,37771,37898,38017,
+38136,38253,38364,38482,38585,38682,38770,38852,
+38934,39009,39081,39152,39225,39298,39372,39446,
+39507,39570,39639,39705,39776,39847,39913,39979,
+40038,40089,40131,40170,40209,40242,40272,40298,
+40314,40317,40305,40275,40235,40189,40143,40092,
+40035,39967,39898,39826,39747,39651,39564,39483,
+39396,39300,39189,39075,38956,38833,38723,38592,
+38416,38289,38154,37975,37788,37577,37401,37200,
+36966,36733,36505,36324,36168,36070,36020,35923,
+35765,35671,35174,34539,34335,33514,33000,33004,
+32994,33059,32930,33078,32645,32149,32077,32159,
+32547,32796,32852,32820,32630,32541,32369,32304,
+32130,32218,31983,31902,31945,31950,32206,32426,
+32397,32378,32254,32165,31932,31779,30595,28454,
+26427,25843,25192,24852,25098,24998,25348,25553,
+25398,25566,25803,25480,25458,25443,25804,26088,
+25926,25966,25875,26227,26622,28222,29191,29814,
+30430,31516,32400,32552,32793,33436,32967,33114,
+34493,34913,34921,34705,33897,33135,32984,34071,
+34552,34159,35014,35859,34950,34650,34237,34316,
+33656,33705,33747,32887,32796,32664,32708,32617,
+32557,32562,32616,32700,32838,33024,32697,32709,
+32824,32874,32595,32556,32436,32453,32442,32236,
+32211,32203,32298,32261,32134,32202,32272,32344,
+32298,32226,32373,32406,32523,32567,32511,32443,
+32346,32136,32217,31989,32061,32212,32280,32343,
+32404,32273,32145,32267,32289,32292,32278,32138,
+32067,32072,32118,32112,32104,32057,32066,32137,
+32212,32274,32130,32170,32229,32321,32300,32289,
+32381,32366,32385,32438,32431,32353,32406,32465,
+32508,32406,32271,32184,32146,32172,32171,32133,
+32070,32136,32149,32055,31961,31959,31983,31959,
+31914,31830,31839,31769,31711,31659,31570,31585,
+31581,31677,31793,31881,31930,32014,32166,32264,
+32379,32499,32567,32646,32718,32728,32730,32804,
+32782,32739,32881,32960,32966,32722,32729,32652,
+32589,32728,32709,32692,32703,32538,32425,32447,
+32339,32554,32673,32694,32724,32761,32814,32818,
+32763,32773,32742,32828,32832,32804,32726,32801,
+32814,32815,32849,32871,32855,32865,32838,32643,
+32496,34208,33271,34434,34298,33975,34280,35479,
+34554,34332,33357,32687,32454,32402,32400,32295,
+32242,32163,32208,32383,32404,32190,31823,31293,
+30792,29714,28800,28105,27495,27162,27064,27020,
+26831,26560,26349,26056,25761,25432,25197,24995,
+24815,24670,24546,24297,24075,24015,24022,24189,
+24435,24467,24392,24489,24610,24300,24267,24547,
+24639,24706,24796,24959,24989,25089,25322,24849,
+25098,24984,25321,26632,27468,27861,26505,28587,
+28592,29352,30373,31266,32040,32405,32637,32718,
+32736,32747,32752,32743,32742,32755,32757,32757,
+32758,32761,32764,32764,32767,32767,32769,32770,
+32772,32769,32772,32776,32776,32778,32776,32772,
+32769,32760,32745,32735,32727,32718,32712,32705,
+32699,32680,32653,32625,32596,32568,32541,32516,
+32491,32466,32438,32379,32276,32148,31920,31744,
+31071,30798,30354,29798,29517,28695,28370,28047,
+27525,26792,26373,26175,25974,25943,25839,25792,
+25768,25863,26003,26109,26258,26389,26587,26877,
+27003,27111,27291,27461,27563,27729,28094,28158,
+27993,27580,27552,27537,27551,27582,27502,28032,
+28085,27114,26999,26814,27549,27358,27238,25845,
+26157,25787,25284,24167,23989,23887,23919,23985,
+24356,24897,25473,25740,25961,25744,25745,26609,
+26229,26727,25789,24909,24225,23974,23795,23483,
+23670,23561,23910,24186,22873,21827,21821,21834,
+21817,22053,22708,22359,21798,21832,21828,21825,
+21825,21825,21825,21825,21825,21828,21837,21840,
+21844,21825,21829,21834,21838,21847,21856,21861,
+21862,21904,21903,21912,21930,21962,22028,22087,
+22141,22191,22220,22238,22255,22270,22285,22300,
+22315,22334,22353,22384,22425,22467,22497,22520,
+22544,22564,22617,22687,22743,22773,22793,22881,
+23118,23421,23862,23859,24177,24191,24150,24182,
+24516,24876,24893,25173,25266,25750,25886,26321,
+26538,26671,26942,27635,28119,28857,29857,30475,
+30906,31214,31302,31356,31419,31416,31354,31359,
+31368,31427,31455,31458,31450,31548,31720,31647,
+31635,31638,31698,31965,32688,33066,33015,33005,
+33007,33039,32730,32202,31513,31377,31857,31941,
+31861,31812,31344,31233,31196,31560,31793,31989,
+32320,32778,32887,33000,32777,32705,32789,33425,
+33762,33371,33040,33804,34334,35629,36421,35305,
+33856,35229,33899,33763,33490,33084,32583,34542,
+33711,34131,35808,34660,34053,34240,34889,34950,
+35185,35130,34383,33990,34246,33563,33872,33807,
+33287,33363,33328,32694,32519,32379,32324,32362,
+32393,32400,32442,32438,32430,32192,32138,32076,
+32064,32205,32424,32463,32751,33854,34471,35005,
+35436,35787,36101,36382,36621,36854,37074,37255,
+37434,37597,37740,37872,37989,38088,38182,38275,
+38365,38452,38536,38623,38704,38793,38883,38966,
+39047,39130,39217,39307,39390,39465,39537,39609,
+39675,39741,39797,39849,39894,39934,39969,39997,
+40017,40030,40033,40019,39996,39966,39926,39879,
+39825,39767,39709,39642,39561,39482,39403,39315,
+39220,39124,39020,38911,38794,38668,38532,38382,
+38229,38069,37881,37713,37515,37309,37074,36857,
+36644,36443,36208,36031,35934,35784,35674,35457,
+35160,34725,34332,34163,34125,34965,35403,35114,
+34422,33456,32699,32687,32769,32429,32373,32589,
+32825,32854,32889,32868,32691,32505,32454,32549,
+32370,32299,32234,32410,32415,32460,32520,32461,
+32406,32468,32070,31731,31128,31097,28125,27564,
+26651,26180,25762,25613,25644,25326,24927,24769,
+24683,24209,23961,22832,21094,19253,20151,23590,
+25703,27044,27934,28275,28651,28962,29327,30234,
+31708,32509,32616,32595,32670,32757,33393,32546,
+34272,35705,36048,33720,34040,35664,35556,32978,
+34130,35809,34784,35648,34582,33373,32950,32951,
+32981,32805,32823,32824,32847,32991,33003,33038,
+33007,32700,32653,32529,32391,32271,32225,32343,
+32350,32355,32356,32304,32286,32410,32417,32574,
+32624,32496,32414,32366,32316,32277,32260,32190,
+32139,32137,32104,32134,32124,32145,32184,32290,
+32349,32408,32246,32094,32061,32104,32150,32300,
+32460,32604,32690,32782,32778,32758,32594,32364,
+32226,31998,31980,31942,31937,32042,32103,32122,
+32113,32091,32427,32428,32280,32296,32414,32438,
+32428,32423,32418,32424,32440,32465,32409,32307,
+32415,32497,32277,32426,32423,32426,32346,32249,
+32220,32003,31935,31850,31714,31559,31530,31500,
+31482,31451,31497,31515,31527,31498,31395,31524,
+31586,31666,31743,31832,31961,32221,32252,32372,
+32455,32505,32524,32543,32595,32643,32793,32904,
+32862,32851,32851,32850,32828,32758,32565,32433,
+32406,32401,32658,32555,32431,32278,32166,32148,
+32294,32415,32553,32579,32628,32653,32663,32684,
+32704,32768,32814,32824,32902,33459,34920,35154,
+34834,34457,33271,33431,33463,34671,33266,33009,
+32609,32114,32388,33124,33052,33107,32841,32835,
+32706,32666,32550,32414,32355,32220,32088,31980,
+31868,31483,30134,29503,28387,27504,26922,26602,
+26241,25613,25247,24941,24892,25014,25033,24890,
+24807,24684,24596,24564,24463,24315,24190,24064,
+23958,23840,23730,23642,23559,23532,23784,23999,
+23396,23116,23586,23990,23760,23602,23692,23736,
+23739,23784,23816,23625,23547,23538,23652,23754,
+23690,23787,23889,24032,24184,24331,24753,25134,
+25235,25209,25265,26405,27801,30447,30675,31409,
+32100,32403,32405,32406,32226,32394,32475,32563,
+32638,32689,32677,32667,32655,32649,32649,32643,
+32644,32668,32698,32709,32719,32728,32731,32730,
+32725,32712,32704,32690,32640,32580,32532,32490,
+32473,32457,32429,32431,32337,32158,31988,31837,
+31653,31307,31024,30237,29490,29358,28748,28132,
+27919,27681,27366,27074,26754,26504,26283,26041,
+25845,25734,25658,25497,25262,25206,25222,25216,
+25227,25299,25369,25506,25726,25947,26313,26555,
+27006,27590,27600,27601,27604,27670,27918,28116,
+27643,27757,28330,28318,28380,28875,28606,27201,
+26604,26438,26378,26277,25826,24917,25108,25520,
+25433,24209,23514,23368,23280,23474,23407,23505,
+23598,23454,23451,23804,24174,24729,24795,24163,
+23148,22900,22987,22952,22758,22704,22606,22736,
+22575,22321,22238,22261,22332,22207,22257,22785,
+23569,23361,21870,21850,21838,21828,21825,21825,
+21825,21825,21822,21819,21816,21814,21829,21864,
+21865,21870,21846,21825,21828,21834,21843,21861,
+21879,21900,21919,21922,21945,21961,22037,22072,
+22086,22101,22120,22152,22191,22209,22220,22228,
+22237,22249,22262,22282,22318,22370,22431,22495,
+22524,22560,22631,22716,22797,22794,23751,25081,
+24390,24557,24053,23535,24103,24609,24866,25062,
+25140,25270,25296,25192,25390,25780,25875,26385,
+26748,27054,27405,27540,27990,28572,29340,29500,
+30020,30609,31238,31218,31268,31320,31328,31328,
+31349,31354,31383,31389,31400,31446,31364,31464,
+31667,31815,31882,31855,32010,31897,31811,31873,
+31867,31813,31804,31797,31594,31414,31393,31554,
+32208,32969,33037,32633,32673,32666,32664,32878,
+33439,34785,33378,33163,34458,34880,35297,35502,
+36578,38313,37583,36899,35912,35803,34973,34004,
+33499,34182,32395,32979,35659,37078,33457,33841,
+33907,34743,34563,33749,32448,33779,34870,34351,
+34581,33655,34552,34699,34715,34676,35496,35719,
+34674,35076,35754,36181,34839,33155,34752,34910,
+33893,33426,32367,32377,32484,32589,32631,32674,
+32720,32712,32685,32560,32441,32527,33090,33378,
+33801,34263,34681,35047,35402,35812,36173,36408,
+36700,36966,37065,37122,37157,37231,37308,37397,
+37504,37613,37747,37872,37999,38139,38278,38407,
+38539,38675,38800,38919,39010,39077,39153,39232,
+39300,39349,39395,39446,39500,39547,39591,39634,
+39675,39703,39718,39720,39709,39687,39657,39624,
+39582,39532,39482,39433,39377,39312,39244,39181,
+39105,39021,38931,38837,38741,38641,38535,38430,
+38315,38172,38001,37822,37655,37498,37324,37143,
+36943,36710,36441,36222,36033,35805,35519,35064,
+34761,34303,34683,34494,34743,35213,34827,32940,
+34038,33123,33116,34362,32915,32411,32400,32397,
+32401,32646,32787,32779,32462,32409,32403,32362,
+32326,32331,32382,32389,32380,32376,32379,32362,
+32382,32407,32431,32406,32148,31703,30192,30077,
+29610,26919,25354,25368,24983,24886,24782,24719,
+24680,24798,25359,25709,24449,20136,20151,23521,
+24992,25776,27844,28951,29604,30070,30557,30882,
+31278,31605,31773,31868,32411,32994,33741,34524,
+33078,33363,33114,33045,32952,33536,32643,33404,
+34587,34695,34931,33735,32609,32931,32883,32981,
+32991,32940,33153,33099,33744,33823,34053,34736,
+35123,34953,34392,33854,33178,32797,32703,32770,
+32589,32304,32307,32473,32516,32718,32742,32721,
+32534,32391,32099,32172,32175,32103,32179,32157,
+32173,32177,32174,32159,32148,32121,32103,32078,
+32068,32042,32046,32052,32021,32037,32117,32148,
+32256,32278,32311,32271,32175,32064,31995,32008,
+32118,32261,32337,32616,32823,32830,32637,32443,
+32096,31737,31746,31851,31974,32213,32493,32442,
+32132,32256,32536,32543,32409,32620,32516,32405,
+32352,32385,32607,32556,32421,32423,32424,32405,
+32427,32181,32170,31787,31594,31565,31635,31551,
+31444,31387,31382,31414,31391,31371,31381,31425,
+31494,31560,31727,31983,32208,32654,32820,32879,
+32683,32652,32640,32655,32664,32671,32740,32832,
+32851,32859,32872,32872,32876,32759,32583,32397,
+32446,32448,32229,32158,32325,32468,32707,32700,
+32706,32691,32676,32679,32727,32842,32997,32989,
+33042,33114,33042,32850,33562,33317,33339,33487,
+33319,33351,33203,34098,34377,34743,34659,33275,
+32880,32538,32383,32352,32327,32287,32217,32109,
+31970,31833,31798,31754,31684,31437,31156,29942,
+28576,27427,26853,25998,25475,25144,24730,24479,
+24250,24040,23886,23672,23487,23412,23402,23463,
+23432,23385,23419,23435,23409,23392,23378,23362,
+23349,23343,23348,23369,23397,23411,22807,22755,
+22801,22886,22956,22964,22899,22834,22858,22824,
+22788,22786,22795,22797,22794,22877,22911,22887,
+22812,22821,22794,22854,23196,23347,23372,23429,
+23766,23995,24439,24760,25145,25167,26216,26579,
+27140,27966,28266,28624,29295,30324,31323,31777,
+31703,31252,30981,30954,30875,30959,31009,31142,
+31600,32080,32312,32371,32479,32510,32526,32480,
+32401,32377,32028,31912,31820,30651,31035,30845,
+29736,30061,30256,29684,29601,29314,28688,28152,
+28161,27596,27358,27041,26745,26457,26291,26036,
+25812,25470,25233,25197,25222,25233,25206,25195,
+25179,25145,25111,25099,25103,25119,25128,25121,
+25109,25101,25105,25134,25179,25694,26138,26443,
+26722,27077,27642,28252,28465,27747,27690,27755,
+27683,28515,29303,28397,26993,26790,26361,26500,
+26221,26152,26180,26406,25961,24345,23646,23448,
+23319,23261,23201,23249,23300,23145,23212,23325,
+23349,23349,23331,23271,23169,23115,23209,23431,
+23681,23538,23372,23178,23178,23295,23401,23437,
+23884,23474,23424,22959,22920,21952,21900,21879,
+21870,21921,21914,21843,21828,21828,21828,21828,
+21828,21828,21828,21828,21828,21829,21832,21882,
+21846,21855,21886,21844,21854,21867,21877,21886,
+21896,21913,21929,21942,21959,22020,21948,21813,
+21796,21813,21823,21823,21839,21856,21885,21934,
+21965,21968,21984,22021,22051,22089,22139,22194,
+22307,22726,22880,22587,22775,22730,23263,24896,
+26373,25498,24171,24141,24473,25129,24421,23607,
+23309,23463,24174,24777,25311,26016,26127,26034,
+26097,26311,26487,26883,27065,27374,27630,27940,
+28317,28782,29270,29373,30007,30527,30781,31195,
+31257,31332,31378,31417,31473,31540,31608,31617,
+31586,31533,31591,31616,31655,31740,31707,31670,
+31689,31644,31638,31740,31813,31862,32589,32767,
+32682,32838,32501,32385,32395,32075,32461,33039,
+33423,33373,33837,33872,34881,36714,36070,35811,
+35841,35375,34439,33980,33653,33017,32691,33822,
+33175,31930,32010,33363,33342,33003,33081,33038,
+32717,31543,32931,33462,34177,33885,34497,35007,
+35250,35970,36908,37245,37721,37570,36686,37640,
+38056,37872,37501,37116,36409,36411,34167,35214,
+34109,33510,33315,33903,32511,32160,32038,32103,
+32558,33351,33848,34118,34176,34247,34363,34140,
+34216,34278,34455,34622,34779,34890,34939,34712,
+34512,34629,34910,35289,35567,35931,36178,36496,
+36832,37057,37266,37483,37628,37826,37965,38088,
+38205,38298,38391,38458,38507,38542,38596,38634,
+38691,38761,38847,38907,38991,39068,39135,39194,
+39247,39291,39336,39375,39394,39397,39377,39343,
+39300,39249,39192,39123,39052,38994,38936,38880,
+38824,38763,38701,38643,38584,38522,38447,38361,
+38276,38184,38073,37929,37781,37593,37378,37131,
+36750,36246,35753,34908,33840,33526,33519,34017,
+34048,34131,34746,34800,34719,33495,34020,36251,
+35775,33315,35018,33615,34596,34485,34137,32955,
+32535,32209,32115,32218,32391,32475,32571,32639,
+32586,32502,32530,32378,32355,32499,32391,32124,
+32133,32130,32352,32060,30427,29595,28876,27963,
+25878,25353,23510,23172,24070,25199,25258,24947,
+24396,24556,25149,27105,27052,26668,27293,29031,
+29724,29868,30461,30918,31305,31338,31297,31242,
+31254,31288,31317,31278,31371,31861,32485,32463,
+32475,32493,32745,32822,32832,32860,32889,32494,
+32232,32160,32478,32830,32976,32973,33747,33531,
+34345,33189,33060,33627,32679,33334,32962,33339,
+33135,33284,33242,32964,32871,32795,32714,32733,
+32582,32467,32153,32143,32403,32546,32571,32841,
+33003,33003,33397,32610,32304,32313,32631,32720,
+32778,32765,32745,32850,32821,32605,32771,32493,
+32271,32100,31940,31914,31902,31851,31851,31933,
+31987,32011,32030,31950,31845,32564,33529,32743,
+33900,33548,31950,32755,32857,32369,32187,32230,
+32814,34325,33666,33254,33458,32377,32916,31774,
+33752,33765,33016,33411,33041,32426,32518,32801,
+32455,32454,32526,32424,32284,32401,32175,32204,
+32298,32411,32319,32154,31985,31869,31840,31854,
+31819,31608,31428,31347,31339,31314,31285,31356,
+31431,31488,31833,32211,32505,32805,32846,32864,
+32865,32866,32871,32875,32871,32778,32724,32728,
+32728,32723,32722,32699,32532,32413,32299,32247,
+32179,32082,32182,32391,32193,32232,32435,32422,
+32441,32385,32411,32542,32600,32695,32868,32952,
+32925,33170,33469,33607,33992,33804,34113,33361,
+33420,33434,33006,32697,32705,32726,32859,32865,
+32865,32839,32806,32766,32702,32520,32406,31657,
+30900,30021,29298,28021,27279,26610,26062,25824,
+25544,25195,24808,24517,24175,23880,23443,23352,
+23134,23037,23023,23041,23051,23047,23034,23018,
+23004,23001,23007,23022,23040,23057,23069,23080,
+23086,23084,23066,22989,22602,22145,22172,22254,
+22510,22634,22558,22441,22311,22211,22212,22204,
+22185,22164,22131,22117,22117,22106,22110,22146,
+22219,22413,22281,22455,22675,22797,22934,23132,
+23322,23538,23967,24495,25167,25676,25987,26394,
+26682,27298,28132,28224,28203,28235,28272,28289,
+28391,28434,28368,28344,28233,28190,28215,28287,
+28249,28152,28213,28282,28503,29043,28705,28632,
+28451,28030,27731,27521,27536,27411,27089,27001,
+27010,26879,26767,26522,26296,26340,25765,25565,
+25393,25203,25167,25148,25089,25080,25068,25042,
+25005,24963,24942,24960,24970,24979,24985,24988,
+24990,24990,24991,24990,24988,24966,24930,25110,
+26791,25247,24903,25014,25156,25296,25561,26403,
+26671,27006,27083,27219,27488,27513,27492,27594,
+27624,27220,27034,26531,26573,26867,26779,26217,
+25559,25013,23986,23407,23324,23334,23320,23428,
+24110,24450,23369,23273,23319,23290,23259,23239,
+23235,23250,23295,23342,23349,23361,23433,23448,
+23667,23706,23727,23821,23453,22772,22202,22080,
+22219,22473,22070,22181,22288,22868,22909,22897,
+22151,21866,21854,21848,21883,21871,21851,21839,
+21892,21940,21870,21829,21834,21841,21843,21882,
+21879,21886,21906,21914,21915,21912,21909,21907,
+21907,21907,21915,21933,21961,21992,22002,22028,
+21997,21911,21852,21833,21828,21842,21865,21888,
+21918,21937,21968,21991,22027,22064,22102,22138,
+22167,22194,22212,22242,22265,22300,22415,23133,
+24476,23013,23996,24328,23883,23358,23718,24471,
+23807,23352,23382,23601,23909,24006,24197,24555,
+24304,24051,23969,24423,25101,25763,26072,26340,
+26592,26754,26906,26933,27431,28152,28831,28692,
+28956,29168,29760,30499,30789,30858,30994,31089,
+31116,31156,31187,31202,31247,31364,31440,31429,
+31507,31554,31783,32112,32138,32032,31928,31975,
+32049,32065,32040,32133,32170,32292,32324,32268,
+32215,32471,33060,33549,33447,33799,34968,34615,
+33874,33188,32226,30861,30940,30964,31774,33674,
+33762,33885,32628,34316,34461,34423,33899,34439,
+33162,33913,33534,32979,34390,35016,33993,33612,
+32508,32673,33746,34747,34674,34449,35655,34274,
+36687,36909,37560,38007,38399,38493,37869,37472,
+35914,35885,36993,37771,36693,35393,35220,32985,
+31942,31818,32025,32293,32845,34401,34732,34919,
+34783,34206,34653,34687,34062,33377,33949,33419,
+34043,34880,35929,36165,36393,36573,36809,37038,
+37208,37290,37341,37332,37314,37329,37371,37440,
+37463,37431,37385,37309,37251,37308,37396,37486,
+37560,37641,37826,38073,38250,38396,38481,38537,
+38598,38682,38779,38863,38946,39012,39051,39051,
+39012,38951,38873,38797,38711,38610,38512,38430,
+38332,38216,38121,38013,37886,37807,37770,37738,
+37725,37704,37632,37551,37368,37053,36720,36418,
+35932,35447,35321,34223,34111,33843,35503,35090,
+34268,33918,34466,35244,35670,35839,35426,34204,
+35334,35340,36357,35694,34863,33245,33762,34008,
+33840,33204,33204,32921,32691,32652,32545,32616,
+32682,32798,32745,32381,32581,32777,32886,32888,
+32733,32445,31638,29277,28245,25558,23955,23626,
+23993,22569,21852,21410,22191,24033,24489,25418,
+23796,25382,27015,28035,28677,29430,30014,30346,
+30861,31007,30984,30864,30789,30688,30361,30209,
+30213,30108,29658,29895,29267,28777,28977,28605,
+28420,28569,29395,30411,31424,29922,28401,29299,
+30102,31687,32467,32513,32592,32583,32622,32655,
+32817,32970,32812,32573,32664,32556,32415,32518,
+32747,32724,32598,32364,32446,32535,32578,32490,
+32267,32241,31716,31797,32454,32540,32578,32566,
+32495,32443,32566,32470,32433,32464,32446,32447,
+32481,32560,32425,32351,32312,32402,32322,32139,
+32022,31880,31611,31676,31713,31847,31856,32029,
+32296,32358,32397,32502,32751,33107,33073,32722,
+33601,32217,33019,33183,33078,33645,33961,32274,
+31939,31803,32127,32337,32485,32671,32788,33045,
+33593,33153,33774,32828,32950,32960,32219,33445,
+33268,34085,33282,33822,32854,33084,34075,33703,
+33315,33051,32889,32503,31855,31593,31470,31403,
+31394,31306,31324,31348,31264,31222,31258,31284,
+31366,31532,31725,32226,32590,32808,32857,32898,
+32926,32937,32874,32793,32593,32592,32616,32656,
+32697,32680,32599,32481,32422,32310,32142,31982,
+32019,31987,31944,31962,31986,32014,32055,32143,
+32199,32405,32393,32559,32662,32698,32700,32757,
+32877,33005,33522,33561,34442,34743,34798,34683,
+34242,33279,33144,33017,32968,32863,32742,32685,
+32579,32406,32308,32066,31861,30991,29930,28332,
+27679,26583,25524,24846,24543,24413,24362,24171,
+23935,23548,23873,23265,22878,22795,22780,22779,
+22764,22748,22736,22726,22719,22710,22701,22690,
+22683,22677,22675,22680,22693,22714,22745,22784,
+22809,22824,22665,22187,22144,22147,22154,22146,
+22105,22017,21861,21704,21626,21600,21597,21598,
+21609,21601,21594,21591,21589,21589,21594,21601,
+21642,21795,21982,22159,22323,22706,23040,23660,
+24051,24330,24837,25595,26363,26709,26959,27070,
+28494,28173,28164,28096,28069,28048,28033,27627,
+27345,27011,26952,26833,26713,26634,26505,26418,
+26326,26366,26422,26346,26313,26319,26247,26334,
+26259,25942,25781,25744,25695,25787,25382,25212,
+25227,25219,25187,25121,25049,25009,24810,24732,
+24651,24657,24707,24759,24814,24820,24744,24657,
+24798,24789,24804,24816,24820,24819,24820,24825,
+24837,24851,24870,24890,24901,24906,24912,24921,
+24938,24963,24997,25038,25083,25128,25179,25491,
+27139,27167,27776,28194,27865,27646,27835,27927,
+26390,26314,26368,27056,27412,27444,26911,26368,
+24530,23703,23568,23275,23762,24299,24428,23687,
+23325,23304,23330,23355,23369,23388,23397,23359,
+23406,23134,23253,23346,23385,23357,22802,22873,
+22732,22703,22794,22919,22530,22098,22417,22280,
+22074,22085,22043,21891,21910,21900,21901,21900,
+21901,21900,21900,21883,22055,22274,22080,22020,
+21789,21621,21585,21649,21920,22286,22261,22269,
+22420,22021,21958,21926,21899,21920,21966,21975,
+21978,21978,21981,21990,22005,22012,22017,22064,
+22042,22023,21998,21972,21948,21933,21931,21940,
+21956,21970,21984,21993,22002,22014,22030,22090,
+22236,22394,22479,22359,22304,22268,22219,22200,
+22262,22413,22549,22675,22773,22806,22888,23017,
+23149,23283,23394,23455,23589,23777,23967,24293,
+24182,24295,24490,24576,24627,24868,25122,25215,
+25224,25235,25312,25503,25704,25833,25812,25871,
+26108,26328,26822,27258,27590,27944,28574,29110,
+29445,29604,29904,30191,30356,30720,31007,30988,
+31113,31353,31401,31289,31299,31300,31351,31451,
+31647,31811,31896,32130,31947,32238,32427,32522,
+32597,32134,32457,33484,33564,33060,33927,33313,
+31481,30811,31033,32439,32988,33197,34111,34197,
+33891,33937,34175,33862,32622,32938,34587,35714,
+36381,35624,36021,34828,34883,34255,35022,35001,
+33475,35481,34105,32973,34310,34704,35199,35580,
+34971,35021,34992,35571,35348,34614,34659,34311,
+34328,34832,34374,35784,35778,33567,34701,35303,
+35867,34730,34677,34882,33282,32404,31719,31617,
+32194,31898,31445,31871,32880,34742,35496,35140,
+34413,34642,35412,35499,36111,35869,35403,35670,
+34670,34960,34710,34803,34956,35116,35447,35247,
+35213,35191,35218,34932,34888,35172,35301,35574,
+35751,35811,35754,35838,36245,36022,36023,36061,
+36291,37002,37508,38039,38416,38599,38676,38655,
+38576,38493,38400,38268,38120,37962,37783,37594,
+37398,37233,37053,36771,36515,36348,36163,36050,
+35978,35809,35580,35226,34781,34768,34620,35253,
+35129,35170,34822,35241,34625,35172,34164,33930,
+34102,33452,33419,33251,32889,32973,33607,34281,
+33961,34131,34068,34401,33907,34128,34140,33902,
+34028,34621,34512,34174,33419,33393,33504,33236,
+32961,32860,32812,32796,32778,32813,32379,31256,
+28534,26396,25578,24724,23487,23550,23485,23018,
+22596,22599,23037,23058,23482,25185,24444,25223,
+25744,26964,27670,28799,29418,30197,30702,30808,
+30858,30838,30816,30862,30975,30563,30753,30696,
+30366,30060,29488,28575,27362,27129,28106,27671,
+26970,26268,26287,26443,26382,26471,26516,26359,
+26655,28722,30356,31181,31536,31635,31587,31583,
+31617,30732,30501,32400,32488,32421,32351,32363,
+32380,32349,32295,32117,31958,31884,31765,31319,
+31286,31794,31997,32359,32544,32550,32465,32498,
+32427,32425,32424,32427,32436,32160,32148,32151,
+32079,32161,32211,32277,32240,31956,31773,31543,
+31581,31710,31687,31683,31695,31710,31729,31831,
+32131,32424,32581,32762,32839,32778,32736,32749,
+32790,32544,32302,31644,32624,32264,32130,32127,
+31956,31831,32177,32793,32826,32889,32697,33516,
+33257,33391,32925,32907,32817,32865,32790,32667,
+32928,32672,32193,32117,32128,32168,32067,32598,
+32742,32902,32581,31868,31677,31478,31332,31299,
+31230,31171,31194,31223,31244,31260,31281,31300,
+31350,31403,31533,31789,32291,32700,32828,32884,
+32895,32886,32712,32583,32511,32485,32490,32493,
+32482,32474,32404,32300,32151,32030,31970,31941,
+31945,31948,31924,31839,31605,31818,32017,32246,
+32441,32567,32720,32845,32853,32889,32906,32810,
+32687,32783,32828,32703,32659,32541,33030,33101,
+32865,32847,32556,32399,32301,32043,31494,31706,
+31747,30538,29363,28229,27096,26639,26808,26340,
+25812,25383,25105,24517,23997,23678,23387,23250,
+22989,22805,22777,22748,22717,22686,22657,22630,
+22605,22582,22562,22543,22526,22510,22495,22485,
+22482,22503,22555,22649,22830,23676,23373,21124,
+19807,18977,20325,20876,21399,21903,22049,22132,
+22186,22221,22005,21507,21444,21429,21435,21447,
+21458,21471,21484,21498,21507,21518,21530,21549,
+21577,21601,21721,21919,22123,22353,22888,23549,
+24039,24849,25482,26378,27239,27165,28030,28697,
+28375,28749,30180,30606,29980,29143,28538,27916,
+27342,26985,26749,26442,26433,26565,26139,25831,
+25709,25570,25485,25401,25314,25272,25282,25253,
+25274,25280,25164,24967,24922,24904,24859,24810,
+24763,24718,24664,24591,24540,24459,24394,24421,
+24483,24541,24583,24622,24718,24685,24713,24765,
+24635,24617,24660,24648,24634,24628,24621,24612,
+24601,24600,24613,24706,24858,24903,24915,24926,
+24944,24971,25011,25114,25243,26085,25526,25198,
+25341,25702,25988,26838,26416,26482,26495,26465,
+26212,26580,26403,26345,26200,26323,25997,25863,
+25816,25243,24933,24981,24780,24285,23985,23888,
+23771,23649,23538,23450,23435,23244,23155,23082,
+22985,22884,22799,22635,22477,22369,22240,22005,
+21878,21909,21908,21895,21883,21876,21864,21903,
+21710,21626,21887,21606,21618,21654,21903,21863,
+21866,21898,21900,22006,22294,23034,22481,23229,
+23400,24382,25002,23492,23241,22683,22887,23033,
+23460,24022,22641,23015,23616,24207,23505,23400,
+23455,23397,23250,23113,23335,22807,22644,22352,
+22246,22071,22102,22095,22086,22075,22064,22053,
+22047,22051,22077,22156,22248,22255,22261,22258,
+22244,22227,22209,22204,22200,22195,22212,22328,
+22473,22612,22732,22791,22803,22812,22846,22956,
+23094,23224,23338,23394,23553,23796,23843,24291,
+24524,25529,25805,25509,24996,24690,24642,24606,
+24594,24578,24547,24539,24585,24617,24678,24784,
+24960,25137,25215,25525,25666,26017,26268,26444,
+26592,26829,26902,27078,27183,27450,27621,28319,
+29138,30146,30924,31301,31224,31191,31090,31030,
+31014,31038,31062,31227,31528,31409,31826,31887,
+31937,31950,32001,32052,32103,32250,32280,32481,
+32832,33390,34104,33621,33974,33242,33620,34140,
+34224,33989,34047,34071,34031,35519,36289,35120,
+35494,36489,36018,34761,35973,36024,35806,36006,
+37104,36994,35254,36789,37058,37446,35674,35144,
+35824,36747,36893,36769,35942,35516,33913,33393,
+33284,33545,33787,33628,33075,33768,34517,34840,
+34855,34069,34926,35259,33995,33090,33087,32905,
+31925,31218,30906,31185,33762,33842,33809,33709,
+33361,32793,33318,34172,34387,34515,34789,34972,
+34957,35042,34310,33129,33024,34273,34661,35093,
+33419,34913,34185,33140,34520,34960,34883,34878,
+34519,34447,34129,33066,33018,33177,33847,34666,
+35283,35994,36540,37227,37464,37586,37571,37550,
+37685,37587,37347,37251,37056,36739,36238,35922,
+35709,35298,35430,35342,34955,34665,33700,32662,
+34872,35308,35690,34656,34260,35382,35220,35313,
+35025,35088,34651,34615,34441,34349,32879,32862,
+33549,33274,33445,33598,33632,33489,32760,32682,
+32718,32699,32869,32960,32971,32834,32875,33457,
+32954,32978,33013,33115,33639,32967,32443,32421,
+32442,32499,32433,32059,31218,28142,25728,24117,
+24403,24516,23401,22774,23392,24072,21373,20922,
+21394,20820,22291,23879,25492,27183,27745,27910,
+27879,27439,26328,25624,25803,27855,30051,30570,
+30681,30721,30741,30729,30705,30680,30789,30752,
+30672,30575,30449,30300,29901,29391,28885,28665,
+28206,27639,27229,26700,26310,26367,26615,27333,
+26679,24662,24117,23870,23742,23619,23631,23536,
+23337,23201,22993,22725,22756,23305,23086,23591,
+23475,23673,23903,23829,24051,24102,24235,24619,
+25083,25398,24337,24542,25629,26424,27022,28299,
+29460,30389,30869,31131,31169,31101,31008,31312,
+31423,31588,31761,31859,31854,31768,31681,31794,
+31782,31602,31701,31708,31787,31963,32147,32450,
+32500,32483,32466,32455,32442,32464,32557,32580,
+32577,32555,32484,32417,32184,31958,32079,32104,
+31851,32022,32171,32349,32610,32558,32547,32445,
+32678,32536,32253,31989,33465,33069,32856,32423,
+32527,32415,32422,32788,32871,32955,32948,32823,
+32683,32286,31999,31693,31512,31385,31322,31284,
+31212,31158,31137,31123,31104,31083,31050,31036,
+31020,31088,31164,31201,31236,31464,31624,31814,
+32001,32085,32137,32181,32256,32260,32247,32040,
+31895,31778,31628,31302,31314,31530,31544,31389,
+31178,31230,31181,31443,31862,31931,31949,31967,
+32148,32419,32611,32722,32752,32733,32704,32493,
+32488,32411,32350,32406,32636,32414,31647,30518,
+29577,28455,28041,27537,27278,27234,26502,26142,
+25645,25428,25286,24965,24899,24702,24131,23817,
+23436,23302,23216,23087,22973,22887,22805,22796,
+22800,22789,22743,22693,22645,22599,22555,22516,
+22478,22443,22410,22378,22348,22324,22317,22342,
+22442,22815,23835,25353,24139,20571,18786,18025,
+18936,21144,22824,22227,21998,21981,21984,22046,
+22182,22083,21315,21012,21089,21045,21003,21010,
+21029,21040,21028,20991,20968,20967,20988,21026,
+21162,21287,21390,21482,21571,21654,21871,22116,
+22232,22462,22746,22928,24045,25506,26928,27102,
+27768,29501,29418,30259,30826,29884,28103,27680,
+27354,26896,26486,26406,25924,25786,25674,25565,
+25449,25326,25217,25203,25248,25298,25260,25213,
+25207,25179,25088,25003,24920,24848,24792,24781,
+24787,24777,24772,24708,24629,24640,24643,24652,
+24666,24687,24714,24736,24699,24624,24601,24600,
+24600,24600,24600,24600,24603,24598,24603,24700,
+24631,24919,24809,24793,24795,24869,24925,24966,
+25000,25009,25010,25050,25105,25149,25173,25185,
+25194,25393,25617,25752,25791,25975,26211,26289,
+26328,26474,27364,28344,26957,25714,25176,24791,
+24568,24171,23970,23775,23595,23445,23401,23398,
+23502,23625,23394,23256,23085,22956,22908,22836,
+22749,22641,22519,22386,22260,22193,22136,22079,
+22094,22008,21894,21825,21848,21902,21815,21643,
+21876,21739,21666,21629,21620,21624,21624,21624,
+21807,22354,23352,22753,22774,22612,22794,23301,
+23859,24033,23988,23994,23960,23944,24098,24651,
+24477,23437,22735,23637,25018,25645,25368,24574,
+24662,24938,24477,24000,23694,23284,22847,22278,
+22173,22236,22434,22278,22287,22225,22199,22192,
+22192,22197,22203,22214,22230,22250,22282,22326,
+22387,22445,22423,22290,22201,22350,22578,22712,
+22761,22807,22852,22942,23067,23073,23218,23409,
+23446,23403,23316,23337,23432,23543,23594,23388,
+23383,23394,23323,23267,23270,23325,23375,23418,
+23478,23539,23592,23641,23691,23736,23766,23808,
+23939,23997,24114,24254,24366,24638,25043,25164,
+25090,25002,24894,24975,25330,25717,26177,26480,
+27110,27955,28823,29931,30542,31083,31386,30804,
+30879,31270,31364,31566,31608,31781,31719,31772,
+31899,31952,32058,31986,31950,31906,31793,31869,
+32060,32152,32273,32398,32595,32651,32245,31819,
+31777,32115,32766,32901,33328,33615,34665,34684,
+34614,32990,35545,32937,33396,35172,35937,36396,
+36936,37252,36941,35518,36493,36720,36575,35589,
+34871,35752,35894,36693,38250,38202,37694,37676,
+37557,37051,36829,36987,37161,36562,35894,34020,
+35257,35593,34844,34521,34637,34696,34670,34505,
+34887,34542,34810,34329,34045,33127,31737,31802,
+31789,31743,31731,31666,31723,31884,32757,33082,
+33825,34111,33699,33133,33887,33808,32789,32694,
+32850,35624,35480,34142,34213,33118,32985,32661,
+32706,33697,33737,33776,33908,33948,33266,34047,
+34215,35455,34748,35721,35292,34262,33576,34626,
+35798,34792,35271,35329,35267,35140,34860,34719,
+34832,34790,34510,34162,34636,34405,34247,34099,
+34052,34022,33984,34102,33952,33984,33912,33828,
+33822,33900,33931,33913,33816,33786,33756,33831,
+33444,33004,32970,32853,32826,32707,32677,32649,
+32622,32628,32653,32665,32634,32575,32540,32535,
+32548,32518,32472,32438,32436,32395,32174,31405,
+30127,28857,26083,24591,24609,24441,24205,23850,
+23447,23345,23109,22599,21256,20412,19652,20898,
+22067,23630,25372,25913,25376,24264,23412,23469,
+23219,23130,23128,23497,24075,25158,25703,25701,
+25425,25039,25398,25831,28228,29512,30076,30555,
+30727,30706,30612,30731,30882,30369,30287,29921,
+29774,29333,28713,27987,27540,26629,26675,26760,
+27282,27063,26943,26270,24330,22994,22224,21625,
+21762,21868,21871,21789,21647,21513,21519,21465,
+21321,21609,22149,22437,22629,22854,22872,22716,
+22224,22089,22108,22212,22551,23256,23363,23761,
+24272,24357,24874,25275,25253,25888,26919,26371,
+27339,26826,27391,28326,28454,28572,28590,28572,
+28946,28751,28812,28659,28926,29513,29655,30410,
+31104,31604,32034,32286,32385,32423,32367,32291,
+32235,32088,32070,32011,32004,32057,32229,32367,
+32411,32412,32405,32394,32376,32360,32355,32373,
+32404,32425,32388,32247,32046,32020,32232,32181,
+32193,32284,32295,32265,32170,32058,31954,31801,
+31623,31497,31350,31325,31245,31207,31142,31077,
+31035,30973,30888,30841,30819,30823,30849,30889,
+30903,30857,30751,30678,30748,30999,30735,29950,
+29727,29394,29139,28798,28587,28566,28889,29203,
+29494,29980,30129,30252,30275,30504,30548,30843,
+30939,30481,30724,30538,30500,30104,29667,29440,
+29056,28623,28041,27576,27317,26659,26512,26420,
+26067,25501,25791,26148,25992,25835,25597,25579,
+25173,24540,24071,23991,24010,24079,24042,23966,
+23842,23688,23600,23491,23397,23351,23258,23155,
+23051,22958,22877,22809,22776,22698,22611,22522,
+22429,22332,22275,22289,22311,22324,22333,22338,
+22341,22338,22335,22323,22296,22245,22260,22590,
+23346,23088,21386,21039,20475,20338,20408,21123,
+22309,22860,21959,21612,21618,21626,21588,21523,
+21872,21138,20809,20742,20731,20733,20744,20762,
+20784,20808,20833,20860,20889,20919,20951,20982,
+21002,21008,21021,21095,21193,21287,21379,21479,
+21579,21728,22068,22142,22750,23652,24542,25370,
+26041,26805,27959,28574,28961,28660,27882,27279,
+26918,26712,26464,26270,25945,25764,25442,25195,
+25107,25014,24916,24820,24783,24768,24843,24888,
+24880,24888,24903,24909,24910,24907,24853,24717,
+24608,24600,24613,24631,24651,24672,24687,24699,
+24706,24711,24714,24711,24709,24705,24708,24705,
+24709,24706,24698,24687,24719,24660,24593,24600,
+24640,24770,24987,25260,25257,24897,24775,24789,
+24866,24971,25090,25194,25227,25269,25317,25371,
+25413,25473,25817,25908,26027,26107,26073,26150,
+25529,25698,25689,25655,25642,25642,25628,25563,
+25446,25235,24910,24642,24689,24804,24463,23772,
+24107,24162,23345,23057,23153,23094,22851,23023,
+23231,22457,22204,22204,22347,22789,22308,22623,
+21931,21683,21701,21843,21892,21834,23788,23124,
+22147,22584,22307,22683,22002,21777,21749,21829,
+21910,22180,22161,22482,22557,22977,23163,23346,
+23516,23820,23905,24443,24648,24567,24566,24870,
+25566,25303,25016,24927,24891,25104,25798,25399,
+24832,24380,23989,23898,24012,23898,23414,23568,
+23612,23491,22816,22874,23325,22728,22680,22744,
+22788,22764,22730,22703,22683,22677,22680,22686,
+22677,22626,22570,22519,22483,22463,22469,22509,
+22599,22742,22886,22918,22971,22905,23047,23082,
+23032,22989,23016,22813,22968,23095,23185,23242,
+23262,23287,23307,23323,23336,23349,23361,23373,
+23389,23403,23416,23448,23491,23538,23583,23644,
+23724,23820,23910,23988,24063,24022,23997,24099,
+24448,24623,24707,25188,24994,24878,24996,25145,
+25312,25577,25669,25896,26493,27013,27330,27221,
+27222,27486,28092,28704,29289,29732,29760,30102,
+30272,30532,31058,31585,31441,31423,31271,31244,
+31078,31276,31578,31765,31944,32025,32096,32123,
+32094,32187,32302,32389,32362,32256,32016,31578,
+31398,31781,31595,31274,32250,32882,34810,33459,
+33423,33788,34550,34511,33878,33914,33059,33635,
+34096,34802,33724,34871,35022,33919,33018,35398,
+35784,35915,35424,35446,35814,35392,34532,33969,
+33257,32902,32906,34352,34429,33039,33367,33294,
+33191,32854,32618,32667,32775,32716,32649,32690,
+32712,32708,32733,32682,32501,32421,32377,32113,
+31701,31547,31485,31510,31585,31644,31500,31078,
+31262,32448,32884,32784,32716,32937,33771,33274,
+32726,32887,32767,32973,32823,33394,33299,33415,
+33237,33012,32860,32880,33463,33378,34833,34938,
+35188,34188,35037,34512,36247,36528,36453,36186,
+34324,36303,36012,34771,35187,35366,35319,35897,
+36039,36037,35922,35755,35505,35350,35346,35346,
+35181,34969,34805,34668,34492,34233,34071,34211,
+34304,34218,34080,33672,33914,33215,33018,32793,
+32689,32677,32682,32683,32679,32673,32670,32669,
+32566,31615,28998,26962,24372,24060,24406,24630,
+24639,24373,23378,23337,23448,23658,23741,23721,
+23644,22770,21531,19411,21108,23308,24198,25350,
+24228,23418,22363,21426,21080,21490,22239,22238,
+22276,22576,22719,22783,22356,21960,21563,21491,
+21627,21639,21809,21621,22002,22073,22042,22580,
+24954,25694,23929,24510,25222,26043,26838,26826,
+26164,26621,26510,26625,27790,27795,28668,28764,
+28722,27942,27183,24965,22749,21283,20986,20862,
+20809,20797,20808,20828,20849,20871,20894,20920,
+20947,20977,21024,21064,21072,21025,20978,21046,
+21284,21515,21617,21675,21804,21948,22153,22703,
+23082,23238,23040,22719,22977,23364,23403,23352,
+23610,23715,23799,23994,23972,24043,24305,24520,
+24674,24759,24723,24747,24584,24879,24691,24633,
+24907,25311,25526,26138,26696,27072,27345,27756,
+28140,28476,28848,29371,29463,29922,30420,31395,
+31771,31897,31995,32019,32038,32125,32088,32043,
+32082,32088,32085,32097,32114,32106,32042,31683,
+31171,30627,30255,29764,29036,28704,27516,27066,
+27240,27255,27387,27585,27802,28141,28177,28216,
+28395,28734,28707,28506,28191,28463,28521,28303,
+28254,28089,27967,27401,27689,27896,28213,27537,
+27576,27121,26873,26795,26372,26295,25881,26047,
+26025,25756,25788,26034,26026,26015,26177,26350,
+26252,26264,25858,25851,25949,25962,25945,25660,
+25445,25229,24975,24789,24536,24235,24070,23979,
+23956,23968,23897,23688,23573,23508,23532,23435,
+23395,23376,23409,23427,23401,23375,23279,23172,
+23077,22988,22902,22831,22803,22795,22746,22671,
+22581,22482,22383,22315,22285,22263,22236,22211,
+22201,22200,22200,22194,22209,22289,22376,22450,
+22513,22568,22618,22661,22698,22742,22795,22837,
+22293,21092,20629,20394,20345,20395,21008,21720,
+21594,21499,21488,21894,22429,21517,21572,21627,
+21149,21000,20858,20811,20779,20751,20727,20704,
+20686,20673,20667,20670,20679,20696,20718,20745,
+20774,20805,20833,20862,20905,20952,20963,20965,
+20974,20994,21323,21939,24118,25809,25671,25838,
+25949,25971,26766,28674,28827,28169,27795,27264,
+27249,26967,26702,26535,26445,26292,25820,25666,
+25440,25271,25194,25155,25121,25094,25065,25029,
+24975,24939,24913,24896,24885,24888,24906,25040,
+25320,25497,25226,24982,24680,24633,24605,24601,
+24630,24687,24722,24698,24663,24639,24627,24625,
+24624,24625,24627,24619,24612,24645,24637,24610,
+24606,24606,24606,24659,24692,24655,24619,24760,
+25220,24987,24720,24783,24956,25158,25245,25227,
+25211,25373,25779,25773,25725,25773,25382,25302,
+25331,25450,25360,25223,25068,24638,24834,24567,
+24567,24682,25052,26784,27888,27594,28359,28171,
+27232,25818,25196,25543,24030,23835,23661,23598,
+23385,23416,23436,23263,23067,22921,23236,23508,
+23952,24124,24840,25425,24848,24147,23549,24069,
+25113,24473,23662,23354,22799,22713,23178,23376,
+23410,23457,23628,23265,24036,24758,24188,26790,
+26024,24627,23720,23574,23832,24138,24450,24584,
+24630,24612,24588,24614,24591,24570,24584,24599,
+24642,24649,24548,24399,24280,24234,24240,24264,
+24285,24330,24459,24710,24990,24840,24807,24551,
+24144,23944,24000,23650,23148,22893,22839,22800,
+22764,22733,22711,22700,22699,22712,22735,22769,
+22796,22808,22844,23010,23247,23464,23657,23687,
+23530,23422,23403,23412,23513,24115,23669,23447,
+23407,23403,23398,23386,23394,23538,23973,24018,
+24010,24072,24150,24122,24061,24091,24209,24582,
+24595,24687,24819,24879,24927,25104,25164,25032,
+24863,24684,25004,25470,25684,25486,25597,25893,
+25976,25996,25770,25616,25513,25638,25791,25869,
+26072,26221,26312,26368,26401,26586,26827,26968,
+27005,27081,27133,27115,27255,27418,27582,27601,
+27585,27607,27987,28207,28209,28240,28746,29187,
+29961,30333,31410,31855,31890,32012,32156,32258,
+32274,32233,32208,32189,32204,32445,32524,31981,
+31299,30965,31482,32559,32711,32669,32745,32775,
+32709,32568,32550,32669,32729,32664,32726,32733,
+32712,32617,32638,32278,32216,31858,32157,32259,
+32418,32316,32190,32187,32323,32580,32717,32727,
+32697,32687,32680,32638,32574,32508,32455,32420,
+32416,32410,32395,32391,32376,32340,32320,32338,
+32274,32202,32139,32088,32023,31961,31955,31834,
+31745,31770,31805,31842,31858,31926,32027,32106,
+32173,32238,32302,32367,32387,32478,32593,32777,
+33001,33106,32976,33303,32737,33696,33401,32952,
+32999,34278,34254,35178,35145,35064,35109,35082,
+35209,35418,35188,34995,34945,35176,35215,35031,
+34850,34487,33720,33575,33456,33451,33510,33592,
+33615,33448,32941,32474,32667,32910,32946,32586,
+32548,32532,31929,31290,29785,28152,27390,26736,
+26135,25924,25723,25631,25709,26103,26486,26532,
+25971,25187,23724,23163,22938,22674,22805,23221,
+22736,22636,22662,22558,22410,21664,20976,21298,
+22661,24425,24948,23652,22232,21686,20755,21214,
+20710,20633,21009,22310,23618,24268,23610,22862,
+22435,22187,22208,22288,22704,22398,23776,25779,
+24105,21007,21022,21024,21017,21058,21182,21072,
+20823,20790,21125,21324,21356,21457,21510,21568,
+21603,21577,21959,22167,23236,22640,21318,21246,
+21247,21188,21228,21124,21042,20984,20910,20847,
+20814,20811,20839,20879,20839,20711,20526,20409,
+20424,20550,20665,20754,20823,20877,20910,20937,
+20970,21020,21097,21192,21288,21381,21462,21516,
+21546,21573,21578,21583,21675,21800,21885,21948,
+22011,22059,22086,22098,22134,22184,22196,22197,
+22203,22235,22260,22200,22189,22192,22196,22283,
+22379,22467,22342,22578,22739,22809,22779,22695,
+22749,22834,22956,22935,22895,22929,22864,22777,
+22779,22845,23142,23326,23076,22972,23062,22988,
+23077,22995,23057,23129,23162,23126,23110,23151,
+23250,23394,23764,24020,24067,24008,23994,24097,
+24302,24519,24618,24663,24717,24912,25038,25209,
+25410,25707,25713,25222,25236,25600,25589,25296,
+25188,25304,25134,24990,24987,24741,24627,24617,
+24570,24568,24660,24628,24435,24126,24097,24005,
+24020,23954,23961,23958,23911,23859,23618,23727,
+23986,23517,23984,24166,24069,23893,23564,23570,
+23378,23439,23502,23457,23441,23232,23011,22804,
+22812,22788,22785,22815,22800,22815,22791,22740,
+22730,22794,22804,22800,22772,22731,22667,22618,
+22626,22650,22656,22640,22593,22528,22462,22403,
+22353,22313,22290,22285,22308,22356,22422,22483,
+22888,23553,23428,22787,22256,22234,22388,22406,
+22214,22680,23484,24453,23159,21366,20430,20320,
+20304,20322,20908,21766,22629,22972,22316,21621,
+21548,21574,21570,21553,21469,21292,21149,20518,
+20150,20280,20304,20312,20313,20312,20310,20324,
+20492,20671,20725,20707,20649,20580,20526,20503,
+20503,20511,20526,20541,20553,20584,20621,20647,
+20721,20806,20967,21374,21604,22144,23012,23792,
+25229,28119,28854,28981,29109,29220,29145,29066,
+29166,28659,28243,27684,27117,26860,26488,26371,
+26357,26388,26536,26724,25800,25584,25356,25278,
+25222,25302,25538,25207,25038,25029,25048,26310,
+29001,30222,28413,27140,26940,27094,27012,26742,
+26253,25639,25200,25322,25329,24897,24555,24452,
+24291,24038,23903,23455,23220,23878,24159,24256,
+24387,24302,24255,24308,24493,24359,24147,23988,
+23918,23910,23967,23984,23991,24010,24225,24600,
+25208,25228,25437,25639,25182,25244,25247,25358,
+25005,25348,25463,25880,25798,25752,25936,25872,
+26387,27065,26801,26774,26639,26530,26380,25991,
+25819,25591,25664,25892,25158,25459,25065,25130,
+24847,24492,23953,23937,24037,24060,23985,24672,
+24891,25619,26481,26370,25745,25565,25465,25533,
+25849,26134,26349,26427,26385,26516,26262,26400,
+25977,26013,26437,26334,25458,24888,24672,24582,
+24552,24512,24506,24561,24528,24771,25116,25646,
+26735,26834,25741,24675,24838,24882,25356,25503,
+25431,25944,25735,25680,25454,25370,25470,25653,
+25718,25517,25427,25587,26002,26026,25802,25329,
+25127,24840,24516,24297,24032,23859,23524,23338,
+23109,23008,22998,23014,23030,23045,23058,23078,
+23108,23150,23197,23247,23295,23366,23904,24558,
+24658,24557,24429,24318,24099,23964,23928,23983,
+24511,24929,25233,25164,24902,24696,24649,24664,
+24740,24919,25113,25218,25262,25332,25439,25530,
+25623,25827,25833,25620,25647,25799,25874,25923,
+26049,26252,26550,26894,27186,27816,28582,28518,
+28056,28119,28266,28509,28608,28568,28451,28107,
+27315,26787,26706,26276,26324,27863,29123,29315,
+29172,28854,28656,27936,27579,27506,27164,26953,
+27038,27428,27934,28394,28680,28735,28668,28753,
+28551,28257,28116,28086,28128,28201,28241,28203,
+28374,28974,29963,30561,30921,31041,30606,30426,
+30758,30620,30646,31288,31490,30729,31590,32054,
+32121,32194,32214,32208,32225,32312,32406,32463,
+32478,32481,32474,32460,32452,32455,32466,32464,
+32436,32370,32248,32181,32184,32193,32126,32049,
+31948,31931,31884,31799,31785,31709,31670,31565,
+31474,31486,31497,31772,31969,32019,32053,32094,
+32110,32119,32127,32124,32121,32120,32124,32125,
+32124,32148,32176,32145,32133,32157,32176,32182,
+32170,32142,32110,32111,32121,32137,32152,32158,
+32160,32175,32209,32250,32296,32346,32388,32420,
+32442,32490,32561,32613,32654,32685,32687,32696,
+32698,32700,32707,32720,32736,32719,32694,32683,
+32680,32679,32669,32614,32558,32472,32400,32390,
+32382,32363,32302,32154,31858,31316,30649,29878,
+29181,28451,28035,27720,27612,27690,27402,26979,
+26271,25889,25279,23837,22670,22656,22654,22590,
+22518,22426,22313,22020,21718,22152,21891,25377,
+21570,20770,20906,21109,21321,21583,21962,22248,
+22518,23286,24846,25662,26133,26237,25549,24629,
+23337,21688,21587,22373,23893,25023,25062,25077,
+24889,24735,24563,24507,23709,22757,21947,22217,
+22308,22385,22338,23462,22585,21630,23154,23886,
+22911,22250,22386,21451,21207,21473,21919,22121,
+21543,20994,21143,21206,21233,21253,21267,21267,
+21249,21213,21166,21107,21040,21022,21047,21068,
+21076,21076,21069,21061,21054,21047,21042,21042,
+21040,21036,21025,21011,20999,20987,20965,20940,
+20917,20903,20907,20944,20995,21049,21172,21351,
+21386,21381,21373,21357,21333,21308,21284,21259,
+21234,21208,21176,21149,21149,21186,21246,21311,
+21370,21417,21456,21486,21508,21526,21538,21547,
+21555,21564,21568,21568,21567,21570,21577,21591,
+21615,21636,21669,21684,21625,21550,21525,21531,
+21564,21596,21598,21601,21634,21728,21864,22012,
+22151,22201,22150,22077,22068,22180,22521,22686,
+22683,22707,22787,22802,22802,22827,22861,22938,
+23026,23104,23152,23100,23116,23348,23332,23360,
+23397,23410,23396,23378,23373,23388,23407,23343,
+23298,23286,23289,23295,23280,23253,23239,23229,
+23216,23183,23146,23115,23084,23046,22995,22934,
+22868,22824,22822,22833,22831,22809,22782,22758,
+22731,22701,22666,22623,22572,22518,22459,22392,
+22314,22236,22222,22214,22206,22204,22198,22200,
+22200,22200,22202,22200,22200,22200,22188,22165,
+22153,22144,22163,22177,22185,22186,22184,22180,
+22173,22164,22151,22139,22134,22148,22173,22189,
+22173,22161,22200,22253,22320,22333,22320,22350,
+22356,22206,22886,23558,23961,23628,23199,21941,
+21666,20772,20322,20486,20409,20811,21265,21394,
+21069,21309,22219,21735,21555,21423,21869,22520,
+22251,21899,21447,20728,20314,20260,20235,20214,
+20205,20194,20199,20214,20236,20261,20286,20310,
+20331,20350,20365,20375,20383,20399,20452,20581,
+20469,20535,20629,20693,20712,20726,20742,20777,
+20848,20919,20982,21134,21376,21754,22293,23429,
+24130,25267,25965,27170,28356,28806,28802,29097,
+29274,29631,29463,28969,28571,27859,27578,26957,
+26276,26106,25977,25989,25956,25845,26056,26383,
+26633,26691,25855,25245,25234,25077,25111,25106,
+26672,27938,28265,26238,25299,23772,23566,23552,
+23146,23100,23157,23223,23289,23341,23347,23301,
+23268,23266,23277,23292,23305,23311,23307,23326,
+23445,23580,23814,23985,23872,23667,23490,23400,
+23440,23548,23668,23631,23552,24207,24390,24293,
+24386,24805,25002,25134,25086,25000,24984,24972,
+26730,26529,26363,26382,26399,26316,26298,26336,
+26418,26561,26627,26520,26659,26920,27635,27825,
+27978,28143,27823,27137,26476,26030,25834,25812,
+25843,25731,25831,25973,26022,26110,26394,26747,
+27042,27747,28068,28494,28743,28864,28896,28896,
+28829,28572,27972,27213,25946,25822,25917,25905,
+25815,26139,26391,26604,27016,26999,26560,26124,
+25625,25524,25635,26438,27590,27609,27563,26649,
+25945,25512,25297,25362,25721,26072,26052,26010,
+26134,26259,26363,26545,26949,27018,26514,26250,
+26059,25923,25870,26007,25895,25722,25442,25317,
+25321,25251,25051,25164,25386,25490,25800,25450,
+24826,24782,24554,24584,24607,24603,24796,25132,
+25491,25826,25788,25710,25457,25084,24714,24704,
+24542,24549,24672,24735,24792,24983,25188,25706,
+25739,25458,25923,26200,25899,25773,25738,25777,
+26165,26479,26751,26812,27275,27630,27692,28129,
+28189,28214,28200,28199,28211,28159,28146,28110,
+28056,28038,28116,28293,28585,28786,28471,28116,
+27619,27616,28413,29218,29521,29534,29412,29258,
+29082,29040,29060,28870,28203,27613,27136,26847,
+26615,26837,27013,26991,26928,26863,26853,26895,
+26961,27013,27168,27281,27400,27595,27571,27600,
+27516,27486,27499,27508,27621,27676,27711,27834,
+27927,28073,28245,28198,28186,28227,28353,28531,
+28705,28801,28836,28848,28886,28926,28962,29013,
+29096,29227,29334,29385,29399,29402,29386,29622,
+29874,29791,29723,29706,29689,29649,29643,29517,
+29653,29589,29244,29091,29159,29181,29088,28926,
+28747,28525,28320,28202,28152,28138,28113,28060,
+28161,28265,28308,28345,28396,28725,29394,29529,
+29918,30654,31033,30995,30972,30862,30691,30447,
+30192,29500,29117,28568,28254,28258,28310,28409,
+28529,28692,28710,28761,28713,28832,28892,28888,
+28771,28614,28471,28336,28242,28204,28382,28533,
+28844,29139,29455,29868,30237,30759,31311,31560,
+31711,31838,31935,32003,32034,31995,31965,31887,
+31800,31676,31308,30972,30648,30497,30344,30240,
+29970,29970,30137,30346,30686,30871,30618,30415,
+30142,29672,28115,26174,26192,28170,28065,27920,
+26022,23220,22233,22093,22095,22118,22038,21985,
+21884,21800,21733,21681,21639,21607,21600,21588,
+21559,21526,21507,21497,21415,21320,21289,21264,
+21754,22377,21806,21577,21292,21558,22758,24262,
+25494,24841,24228,25146,25250,25884,25521,25464,
+24496,22851,22651,23737,24601,24152,24211,22794,
+22252,21959,22256,22824,22992,22539,22694,22768,
+22827,22968,23112,23138,22916,22899,22583,22155,
+21702,21525,22441,21656,21444,21464,21453,21396,
+21327,21277,21243,21215,21180,21123,21223,21260,
+21126,21138,21196,21213,21228,21237,21243,21243,
+21247,21248,21255,21291,21282,21276,21270,21271,
+21273,21279,21283,21277,21244,21198,21148,21105,
+21068,21042,21033,21021,21000,20985,20974,20977,
+20988,20998,20997,21006,21084,21211,21340,21441,
+21478,21462,21447,21441,21441,21444,21450,21456,
+21464,21472,21481,21490,21500,21510,21520,21531,
+21541,21552,21562,21574,21585,21597,21606,21617,
+21628,21638,21646,21654,21657,21654,21648,21648,
+21655,21649,21656,21793,21930,21997,22056,22123,
+22157,22186,22210,22237,22280,22340,22407,22476,
+22539,22580,22608,22620,22617,22602,22542,22515,
+22589,22629,22644,22646,22645,22640,22635,22630,
+22624,22616,22607,22597,22588,22579,22569,22560,
+22552,22545,22542,22530,22506,22481,22458,22435,
+22410,22386,22359,22330,22301,22270,22239,22212,
+22201,22201,22206,22214,22224,22236,22248,22258,
+22266,22272,22273,22269,22261,22245,22224,22197,
+22165,22131,22092,22041,21985,22017,22052,22032,
+22071,22086,22104,22110,22100,22080,22087,22174,
+22200,22272,22241,22170,22146,22062,21805,21598,
+21595,21658,22194,22199,21585,21141,21036,21018,
+20802,20369,20368,20446,20580,20627,20711,20846,
+21090,21531,21575,21462,21320,21439,21525,21576,
+21542,21473,22011,21084,20172,20171,20181,20184,
+20174,20140,20091,20047,20022,20014,20022,20043,
+20074,20113,20157,20205,20254,20305,20358,20410,
+20458,20487,20473,20477,20490,20505,20523,20545,
+20578,20625,20665,20670,20643,20628,20477,20419,
+20541,20669,20775,20862,20983,21242,21657,22277,
+22750,23477,23559,23562,23725,23898,24142,24411,
+24979,26923,28609,28994,27974,27776,28851,29652,
+30508,30462,29418,28218,27502,27086,26958,26896,
+27010,27412,28665,28955,27849,25553,24895,24864,
+25028,25426,25821,25809,25020,24594,23998,23343,
+22782,22704,22625,22760,23913,23695,22722,22811,
+22812,22799,22908,23291,23103,22949,22970,23007,
+23074,23170,23269,23365,23477,23576,23603,23531,
+23424,23432,23590,23823,23959,24189,24220,24253,
+24444,25003,25767,26439,26908,26999,27030,26981,
+26333,26619,26643,26471,26482,26628,26760,26845,
+26909,26928,26940,26969,27012,27090,27145,26998,
+27001,26997,26995,27036,27155,27422,27547,27843,
+27643,27728,27872,28031,28170,27759,27345,27009,
+26989,26986,27006,27059,27033,27072,27374,27619,
+27389,26972,26910,26884,26877,26922,26949,26457,
+26310,26315,26343,26309,26257,26214,26172,26139,
+26118,26112,26124,26155,26203,26289,26565,27127,
+27376,27275,26994,26505,26387,26377,26376,26453,
+26441,26416,26398,26396,26397,26389,26409,26997,
+27207,27194,27105,27015,27195,27324,27005,26667,
+26689,26700,26823,27015,26873,26622,26304,26039,
+26046,25806,25662,25506,25642,25823,25959,26113,
+26103,25956,25866,25746,26044,26067,26030,26037,
+26096,26153,26209,26047,26022,26109,26262,26407,
+26566,26790,26999,27110,27208,27197,27111,27050,
+27019,27019,27054,27155,27183,27255,27356,27383,
+27393,27508,27610,27686,27801,27946,28143,28236,
+28494,28686,28747,28815,28770,28619,28461,28296,
+28703,28419,28230,28129,27765,27366,27316,27628,
+27832,27561,27929,28209,28208,27970,27496,27260,
+27561,27595,27480,27228,27537,27598,27580,27493,
+27357,27327,27565,27205,27133,27325,27370,27241,
+27063,26973,26920,26806,26829,27358,27400,27336,
+27181,27092,27165,27668,28116,28635,28711,29040,
+29371,29478,29477,29478,29501,29559,29672,29850,
+29957,29965,29971,29983,29994,30009,30197,30539,
+30731,30999,31114,31098,30939,30855,30838,30951,
+31031,30969,30801,30617,30487,30152,29925,29868,
+29715,29543,29469,29366,29235,29223,29188,28038,
+28002,27360,27024,27054,26990,27021,26708,26327,
+26061,25878,25796,25764,25701,25599,25561,25527,
+25433,25347,25321,25335,25287,25187,25164,25198,
+25272,25432,25441,25476,25762,25809,25785,25677,
+25610,25611,25634,25663,25699,25744,25794,25823,
+25886,25911,25989,26101,26256,26368,26571,27002,
+27261,27610,28222,28851,29200,29560,29900,29811,
+29682,29727,29594,29430,29320,28873,28956,29405,
+29934,30098,29305,28641,28534,28389,28184,28286,
+28185,28222,28523,28837,29173,29577,30138,30511,
+30492,30301,30104,30024,29630,29037,25980,23229,
+22343,21891,21567,21383,21347,21324,21299,21293,
+21321,21435,21704,21274,21296,21231,21222,22113,
+21754,20694,20820,21016,21270,21199,20895,21048,
+21258,21454,21611,21676,21624,21999,22226,22305,
+22399,22615,22531,22273,22063,21813,21054,19701,
+19322,19899,20612,23001,22818,22704,23555,22783,
+22419,22362,22634,22131,21310,21738,22725,22933,
+22146,22446,22317,22185,22281,22317,22272,22053,
+21675,21684,21848,21917,21692,21464,21596,21337,
+21483,21566,21285,21071,20983,20899,20827,20655,
+20679,21021,21248,21164,21294,21309,21283,21256,
+21247,21253,21259,21240,21193,21119,21022,20922,
+20872,20837,20863,20900,20984,21060,21114,21145,
+21165,21182,21205,21238,21281,21328,21381,21429,
+21448,21438,21426,21415,21409,21406,21409,21417,
+21425,21433,21441,21448,21454,21462,21469,21478,
+21487,21496,21508,21520,21535,21553,21569,21586,
+21602,21616,21630,21642,21656,21668,21678,21690,
+21700,21717,21741,21749,21756,21771,21805,21840,
+21869,21896,21921,21941,21959,21973,21984,21992,
+21997,21997,21994,21986,21976,21963,21947,21927,
+21906,21891,21899,21921,21950,21979,22008,22035,
+22060,22084,22106,22125,22140,22150,22155,22150,
+22150,22148,22146,22141,22135,22131,22125,22120,
+22123,22146,22147,22147,22155,22165,22178,22196,
+22219,22246,22278,22311,22347,22386,22426,22472,
+22520,22575,22635,22703,22775,22839,22886,22890,
+22761,22497,22215,22103,22718,24599,24578,23589,
+23206,23137,22575,21718,21463,21497,21464,21429,
+21414,21096,20446,20354,20397,20532,20718,20916,
+21158,21795,21771,21890,21642,22096,21504,21542,
+21469,21989,22005,21613,21496,21561,21324,21384,
+21513,21066,20266,19733,19625,19686,20160,20264,
+20259,20274,20319,20382,20262,20213,20197,20197,
+20200,20208,20220,20241,20265,20292,20318,20336,
+20349,20361,20370,20379,20386,20394,20400,20406,
+20419,20431,20444,20457,20463,20463,20460,20455,
+20449,20443,20436,20427,20417,20404,20397,20405,
+20535,20742,20961,21311,21758,21937,21885,22062,
+22493,22275,22524,22761,22858,23059,23300,23427,
+23610,24221,24981,25116,25197,25891,27144,28228,
+28722,28803,28809,28538,28349,28352,28275,27724,
+27549,27361,27011,26898,26690,26346,26242,26232,
+26691,26190,25929,25266,24374,23776,23238,22795,
+22691,22689,22685,22679,23143,23076,23157,22843,
+22820,22902,22847,22830,22919,22969,23001,23036,
+23079,23123,23164,23205,23247,23296,23343,23379,
+23397,23400,23424,23653,23892,23994,24124,24421,
+24616,24876,25071,25148,25468,25745,25817,26002,
+25181,25322,25634,25754,25891,25941,26134,26363,
+26460,26520,26640,26829,27030,27084,27092,27615,
+27716,27851,27753,27828,27348,27290,27552,27742,
+27945,27875,27807,28156,27882,27628,27640,27605,
+27595,27589,27590,27558,27478,27186,27037,26845,
+26481,26187,25823,25760,25857,26261,26634,27003,
+27310,27337,27513,27252,26954,26484,26206,26193,
+26234,26305,26385,26407,26400,26397,26395,26395,
+26400,26410,26493,26631,26806,26963,26993,26971,
+26910,26904,26938,26963,26979,26997,27001,26997,
+26998,27022,27171,27051,27226,27563,27645,27644,
+27579,27579,27584,27612,27603,27627,27694,27770,
+27765,27735,27654,27600,27705,27678,27460,27411,
+27106,27004,27442,27531,27483,27341,27132,27494,
+28086,29009,29448,29545,29586,29574,29565,29571,
+29594,29616,29605,29538,29406,29201,29032,29049,
+29202,29331,29422,29490,29570,29508,29357,29076,
+28851,28697,28234,27683,27323,27136,27102,27046,
+26889,27131,27488,27600,27677,28036,28585,29187,
+29083,28086,27604,28017,28623,29349,29788,29468,
+29367,29141,28917,28575,28306,28380,28734,28977,
+28815,28688,28494,28218,28123,28145,28128,28159,
+28047,27791,27477,27167,27077,26998,26925,26855,
+26760,26841,26953,26979,26964,26900,26861,26909,
+27004,27135,27257,27201,27312,27483,27471,27531,
+27441,27133,27537,27521,27634,28168,28665,29217,
+29508,29703,29955,30030,29943,29999,30093,30140,
+30147,30219,30412,30650,30645,30867,31175,31256,
+31278,31398,31662,31789,31808,31806,31803,31803,
+31806,31812,31819,31815,31803,31798,31776,31755,
+31748,31734,31704,31656,31593,31526,31452,31338,
+31196,31110,30987,30688,30348,29978,29431,28927,
+28061,27646,27358,27127,26669,25688,24878,24433,
+24369,24366,24345,24360,24423,24539,24831,25206,
+25248,25206,25152,25149,25249,25443,25674,25778,
+25843,25964,26016,26061,26117,26178,26232,26280,
+26328,26406,26751,27057,27501,27715,28040,28343,
+28701,28856,28908,28815,28563,28740,28598,28346,
+28521,28798,28815,28569,28291,27968,27471,27007,
+27126,27449,27646,27717,27764,28012,28242,28149,
+28490,28788,27617,29058,30162,30255,30219,30147,
+30086,30101,30075,30009,29594,24858,22070,21989,
+21974,21986,22065,22032,21927,21628,21511,21351,
+21183,21037,20899,20745,20610,20646,20695,20676,
+20594,20439,20176,19791,19391,19344,19999,20691,
+21186,20802,21037,21293,21450,21627,21959,22358,
+22608,22750,23232,22887,22785,22944,23266,24423,
+24264,22886,21616,21649,20812,20579,20233,17937,
+18312,19439,20222,21681,22218,22303,22839,24753,
+23571,22861,21369,21382,21726,22545,22833,22950,
+22112,21648,21380,21485,22165,23163,23396,21926,
+22420,23545,23772,23163,22674,22323,22130,22127,
+22602,22113,21861,21610,21491,21967,22307,22314,
+21974,21470,21399,21414,21425,21424,21421,21423,
+21467,21795,22670,23116,23049,22545,21822,21506,
+21489,21449,21405,21374,21347,21294,20925,20950,
+21333,21464,21498,21492,21461,21501,21548,21507,
+21519,21487,21489,21500,21509,21518,21526,21535,
+21541,21549,21558,21565,21578,21592,21609,21627,
+21651,21677,21706,21741,21777,21813,21846,21877,
+21900,21916,21924,21928,21924,21916,21906,21893,
+21879,21865,21849,21832,21815,21797,21778,21761,
+21745,21730,21718,21705,21689,21677,21697,21736,
+21796,21879,21955,21993,21977,21949,21919,21891,
+21867,21849,21836,21829,21831,21839,21855,21878,
+21909,21949,21996,22050,22108,22161,22206,22242,
+22281,22338,22415,22485,22478,22337,22245,22351,
+21709,21334,21464,22612,22578,21940,22061,22148,
+21957,21764,21246,20622,20444,21140,21360,21386,
+21443,21798,21991,22108,22569,22784,22923,23358,
+23028,23975,23877,23061,21955,21520,21059,20965,
+21221,21684,22110,21795,21250,21097,21062,20731,
+20300,20236,20233,20257,20298,20352,20407,20458,
+20506,20448,20111,19801,19902,20172,20109,20097,
+20077,19928,19772,19953,20338,20397,20349,20292,
+20271,20282,20295,20304,20310,20313,20313,20313,
+20310,20305,20313,20328,20343,20353,20360,20370,
+20382,20396,20409,20421,20436,20454,20477,20498,
+20516,20534,20556,20583,20590,20586,20581,20552,
+20488,20415,20529,20814,20979,21081,21482,21780,
+22176,22437,22735,23038,23861,24917,25326,25465,
+25655,26374,27922,28422,26304,27001,28400,28775,
+28544,28728,28755,29210,30054,30513,30594,30864,
+30954,30473,29415,28685,27630,26532,25852,25776,
+25737,25708,25794,26002,25261,24494,23797,23054,
+22704,22566,22434,22319,22229,22162,22117,22126,
+22170,22203,22289,22440,22589,22707,22776,22802,
+23027,23276,23412,23565,23724,23875,24016,24253,
+24544,24610,24621,24640,24673,24726,24801,24909,
+25062,25262,25396,25194,25057,25167,25214,25242,
+26351,26418,26332,26163,26095,26018,26034,26346,
+26379,26414,26424,26292,25841,25469,25127,25023,
+25017,25067,25185,25428,25896,26100,26393,26373,
+26427,26475,26544,26576,26584,26343,26109,25745,
+25517,25440,25415,25386,25377,25378,25351,25276,
+25113,24887,24684,24628,24542,24483,24459,24492,
+24505,24493,24321,24378,24556,24639,24640,24589,
+24587,24555,24632,24729,24834,24956,25056,25140,
+25195,25304,25414,25546,25685,25788,25843,25811,
+25723,25719,25725,25724,25742,25850,26190,26658,
+27003,27273,27590,27843,28149,28605,28713,28845,
+29113,29109,28851,28782,28707,28677,28682,28671,
+28668,28690,28731,28796,28917,29094,29274,29406,
+29316,29043,28877,28809,28711,28433,28224,28086,
+27960,28118,28650,28815,28755,28293,27765,27574,
+27001,26731,26535,26952,27280,27116,26508,26308,
+26217,25848,25595,25397,25347,25488,25671,25584,
+25750,26384,26862,26970,27345,27838,28113,28431,
+28183,28251,28344,28401,28499,28276,28198,28190,
+28194,28206,28198,28164,28095,27983,27827,27687,
+27630,27617,27612,27632,27621,27584,27531,27495,
+27381,27350,27344,27389,27513,27523,27561,27575,
+27561,27481,27396,27398,27303,27226,27229,27234,
+27191,27108,27048,27022,27018,27019,27021,27018,
+27015,27007,26994,26970,26943,26919,26900,26887,
+26883,26887,26906,26943,26982,26977,26991,27005,
+27026,27044,27045,27021,27018,27138,27391,27563,
+27734,28219,28815,29059,29334,29483,29523,29575,
+29605,29628,29667,29744,29948,30354,30716,30909,
+31033,31132,31236,31330,31400,31446,31470,31476,
+31471,31462,31456,31447,31438,31446,31507,31604,
+31713,31785,31725,31584,31454,31329,31092,30133,
+28768,27045,26117,25617,25250,25497,24873,24084,
+23937,23988,24007,24009,24006,24003,24003,24030,
+24069,24081,24045,23967,23860,23733,23580,23421,
+23353,23394,23457,23726,24323,24925,25161,25026,
+24961,25365,25731,25846,25588,25059,24523,23823,
+23507,23325,23193,23185,23094,23001,22908,22935,
+22986,23093,23145,22978,22733,22279,22223,22262,
+22347,22273,22245,22434,22518,22731,22596,22479,
+22610,22544,22599,22149,21525,21006,20937,20910,
+20832,20752,20752,21061,22227,23181,22734,21627,
+21565,21629,22104,22600,22386,21643,21159,20995,
+20989,20992,20986,20959,20868,20619,20637,20788,
+20775,20634,20508,20438,20401,20389,20377,20371,
+20371,20376,20403,20604,21162,21873,22608,22956,
+22349,21392,21401,22263,22290,21263,21124,21079,
+21324,21471,20910,21231,21628,21548,19916,20122,
+21785,22280,22535,23571,23742,23891,23748,23500,
+23587,23309,23931,24507,24213,21558,20737,21705,
+21426,20864,21083,23056,23816,23781,23820,24420,
+24867,24191,23682,24396,24497,23782,23188,23163,
+23711,23835,23385,22559,22137,22054,22571,23388,
+23722,23499,23137,22652,22140,22231,22235,21839,
+22147,22216,21858,21615,22242,22044,21742,21653,
+21637,21654,21655,21638,21615,21589,21558,21520,
+21477,21432,21390,21355,21332,21342,21450,21756,
+21447,21470,21360,21519,21748,21690,21621,21572,
+21546,21540,21549,21550,21552,21553,21564,21580,
+21604,21643,21705,21801,21938,22098,22158,21954,
+21698,21663,21672,21690,21709,21727,21739,21744,
+21739,21732,21718,21701,21684,21667,21654,21645,
+21648,21665,21703,21755,21801,21828,21818,21771,
+21713,21649,21604,21576,21571,21589,21684,21886,
+22052,22101,22390,22608,22688,22703,22393,22222,
+21824,21330,21063,20970,20942,20929,21010,21147,
+21281,21454,21579,21550,21532,22048,22437,22506,
+22081,21672,21460,21219,21331,21285,21297,21366,
+21501,21567,21581,21592,21606,21630,21600,21607,
+21573,21418,21373,21309,21222,21242,21199,20737,
+20463,20433,20582,21267,20729,20222,20223,20267,
+20260,20062,19809,20115,20199,20124,20030,19758,
+19635,19730,20040,20295,20166,19705,19659,20052,
+20362,20325,20268,20237,20227,20226,20227,20229,
+20232,20233,20235,20241,20242,20245,20252,20257,
+20262,20268,20268,20270,20277,20284,20291,20298,
+20305,20310,20313,20326,20332,20339,20349,20367,
+20378,20389,20394,20405,20421,20438,20448,20463,
+20484,20490,20493,20499,20533,20552,20840,21376,
+21168,21498,21684,21856,22170,22206,22208,22452,
+22818,23160,23622,24015,24293,24538,24670,24945,
+25337,26525,27894,28695,29185,29739,30031,30324,
+30585,30719,30860,30889,30882,30849,30775,30623,
+30174,29477,28928,28387,27651,27271,27064,27014,
+27327,28201,29621,30364,30228,29867,29103,28035,
+26543,24291,22916,21865,21444,21547,21645,21708,
+22083,22283,22466,22704,22813,22918,23175,23466,
+23610,23741,23819,23947,24242,24453,24644,25024,
+25217,25239,25098,25131,25149,25155,25283,25549,
+25755,25824,25899,25926,25918,25971,26051,26148,
+21602,21588,21569,21558,21561,21560,21502,21412,
+21333,21281,21265,21291,21333,21394,21461,21530,
+21562,21573,21591,21615,21589,21551,21522,21508,
+21508,21517,21531,21546,21561,21573,21576,21577,
+21564,21533,21513,21533,21556,21567,21606,21783,
+21988,22139,22205,22248,22326,22447,22584,22696,
+22754,22786,22865,23071,23277,23404,23546,23769,
+24027,24293,24440,24535,24547,24543,24590,24691,
+24939,25203,25258,25290,25481,25815,25893,25887,
+25991,25943,25605,25719,25866,25974,26016,26025,
+26021,25953,25883,25869,26037,26361,26718,27066,
+27261,27511,27609,27624,27318,27480,27486,27452,
+27403,27367,27203,27153,27114,27073,26893,26665,
+26399,26337,26437,26422,26550,26763,26876,27155,
+27526,27970,28555,28981,28947,28916,28828,28863,
+28953,29043,29096,29217,29392,29463,29469,29421,
+29385,29322,29343,29390,29415,29538,29655,29549,
+29206,28914,28580,28272,28091,28034,27810,27632,
+27559,27618,27733,27705,27672,27651,27634,27548,
+27480,27377,27219,27090,27018,26938,26845,26760,
+26682,26602,26521,26448,26397,26369,26347,26307,
+26236,26136,26008,25866,25803,25779,25792,25804,
+25820,25819,25761,25638,25599,25596,25593,25581,
+25557,25547,25561,25594,25635,25674,25725,25784,
+25797,25773,25773,25548,25349,25363,25755,26314,
+26432,26270,25906,26039,26193,26266,26289,26294,
+26317,26368,26430,26494,26552,26621,26717,26893,
+26980,27018,27093,27155,27257,27420,27463,27402,
+27305,27222,27211,27316,27539,27920,28449,29043,
+29304,29625,29826,29996,30228,30489,30604,30690,
+30814,30942,31057,31135,31153,31142,31122,31090,
+31043,30953,30758,31008,30422,28969,28365,27867,
+27339,26997,26952,26715,26163,26062,25950,25551,
+25036,24770,24987,24904,24573,24415,24117,23664,
+23265,22997,22829,22793,22839,22968,23195,23417,
+23517,23523,23481,23424,23365,23301,23233,23165,
+23097,23025,22946,22851,22749,22638,22406,22308,
+22260,22211,22170,21844,21735,21815,21743,21621,
+21489,21474,21510,21458,21395,21348,21316,21422,
+21403,21222,21138,21018,20941,20861,20797,20752,
+20719,20696,20682,20679,20683,20696,20718,20750,
+20791,20846,20911,20973,21000,20999,20936,20821,
+20709,20616,20547,20513,20529,20546,20517,20496,
+20479,20466,20451,20439,20433,20425,20370,20358,
+20372,20390,20400,20403,20400,20398,20395,20393,
+20392,20389,20389,20386,20386,20388,20392,20408,
+20417,20412,20502,20688,20955,21261,21321,21399,
+21267,21417,21594,21321,22050,21912,21501,21193,
+21289,22108,22488,23143,22763,22441,22436,22484,
+22509,22507,22448,22145,21924,22367,22816,22384,
+22841,22812,22896,23280,22881,22698,22773,23028,
+23387,24059,24267,23846,23133,22627,22161,22177,
+23274,24098,26239,27850,28204,26588,24242,21874,
+21699,22481,21206,20913,20547,19593,18699,19401,
+20574,21675,22215,21702,21023,21195,21883,22485,
+22661,22439,22500,22757,23107,23286,23196,23429,
+23657,23616,23535,24067,24082,22720,22023,21640,
+21485,21688,22270,22503,22689,22921,22812,22637,
+22442,21925,22135,21906,21765,22035,21796,21634,
+21923,23586,24520,25257,25323,24325,24007,23598,
+23313,22677,22294,22116,21965,21828,21763,21759,
+21859,22104,22405,22558,22521,23013,23384,23459,
+23385,23003,22504,22119,21914,21852,21874,21789,
+21559,21342,21181,21049,20938,20918,21141,21519,
+21973,22336,22307,22593,22903,22765,22401,21962,
+21690,21613,21657,21781,21825,21716,21485,21344,
+21342,21420,21498,21551,21582,21590,21550,21316,
+21053,20814,20473,20457,20453,19949,19862,19860,
+19822,19809,20033,20442,20714,20307,20215,20210,
+20220,20231,20238,20241,20239,20236,20230,20227,
+20240,20284,20501,21055,20475,20238,20193,20190,
+20207,20243,20258,20231,20200,20188,20188,20191,
+20190,20190,20190,20190,20190,20190,20190,20190,
+20193,20193,20196,20199,20202,20205,20209,20214,
+20218,20223,20229,20235,20240,20245,20251,20256,
+20262,20265,20271,20274,20278,20287,20298,20310,
+20324,20336,20349,20361,20373,20385,20397,20409,
+20419,20427,20431,20425,20413,20400,20388,20389,
+20448,20683,20949,21087,21335,21562,21666,21825,
+22031,22320,22800,23424,23957,24060,24061,24180,
+24503,25026,25709,26555,27860,28943,29688,30249,
+30483,30534,30531,30520,30510,30508,30522,30543,
+30525,30314,30054,29871,29732,29604,29475,29088,
+28691,28512,28390,28323,28332,28540,28964,29729,
+29933,29421,28618,27567,25860,24453,23379,22323,
+21880,21578,21507,21435,21414,21417,21431,21447,
+21466,21487,21507,21522,21534,21543,21544,21543,
+21545,21547,21550,21558,21567,21572,21590,21628,
+21652,21641,21723,21984,22165,22215,22420,22767,
+22773,22689,22422,22049,21624,21465,21501,21576,
+21505,21502,21499,21498,21496,21496,21498,21499,
+21498,21501,21498,21501,21508,21514,21519,21523,
+21526,21528,21528,21523,21505,21471,21444,21432,
+21403,21400,21477,21624,21667,21615,21565,21597,
+21772,22205,22445,22553,22527,22584,22514,22464,
+22397,22483,22611,22632,22440,22431,22458,22407,
+22342,22140,22098,22078,22052,22128,22203,22226,
+22263,22339,22502,22704,22814,22935,23142,23223,
+23278,23376,23516,23662,23796,24020,24081,24093,
+24240,24297,24699,24738,24630,24621,24778,24883,
+24874,24937,25194,25617,25629,25527,25553,25495,
+25344,25328,25218,25335,25302,25437,25539,25551,
+25578,25614,25654,25698,25744,25794,25941,26193,
+26375,26394,26405,26449,26570,26741,26637,26494,
+26414,26269,26185,26135,26063,25950,25831,25784,
+25782,25839,26122,26386,26583,26537,26554,26609,
+26505,26380,26258,26089,26040,26073,26169,26301,
+26397,26556,26835,26988,27117,27405,27561,27487,
+27465,27504,27434,27284,27156,26959,26695,26461,
+26361,26448,26518,26538,26542,26460,26595,26756,
+26809,27071,27259,27339,27431,27471,27402,27252,
+27055,26952,26747,26506,26287,26076,25859,25736,
+25574,25432,25305,25173,25008,24828,24776,24786,
+24851,24903,24890,24872,24840,24814,24808,24804,
+24804,24846,24927,25014,25107,25200,25285,25356,
+25396,25362,25278,25202,25173,25186,25189,25064,
+25076,25139,25230,25436,25680,25785,25789,25831,
+25831,25846,25859,25932,26005,26040,26024,25915,
+25806,25788,25882,26105,26385,26781,27040,27577,
+28080,28395,28851,29299,29423,29512,29627,29735,
+29829,29899,30048,30321,30494,30610,30678,30679,
+30613,30546,30569,30620,30561,30549,30324,29853,
+29192,28003,26506,25875,25857,25956,26427,27162,
+27639,27599,27349,26590,26189,26205,25042,24291,
+23267,22521,22312,22448,22485,22692,22640,22262,
+22278,22642,22826,22753,22555,22359,22241,22191,
+22136,22059,21959,21846,21728,21632,21583,21519,
+21435,21333,21230,21138,21060,20997,20966,20932,
+20889,20838,20781,20725,20671,20622,20575,20533,
+20496,20461,20432,20403,20379,20363,20351,20340,
+20332,20329,20331,20340,20352,20363,20374,20388,
+20406,20418,20418,20411,20402,20394,20386,20378,
+20371,20365,20358,20352,20347,20341,20337,20332,
+20329,20327,20326,20326,20328,20334,20340,20347,
+20355,20361,20368,20376,20382,20386,20392,20397,
+20400,20400,20400,20394,20380,20364,20351,20365,
+20891,20901,20760,20615,20470,20391,20313,20220,
+20141,20108,20123,19923,19859,19866,19893,19907,
+19906,19890,19861,19830,19810,19802,19797,19788,
+19770,19748,19729,19725,19737,19842,20160,20429,
+20580,20729,20891,21066,21246,21416,21570,21807,
+22477,23141,23488,23310,23013,22707,22410,22105,
+21774,21402,20988,20747,20860,21048,21323,21759,
+22382,22986,23190,23391,22968,22172,22659,23354,
+23697,23402,21927,21742,22462,23222,23676,23786,
+23943,23966,24012,24078,23689,23533,23547,22865,
+22028,21368,21003,20620,20127,20010,19257,19071,
+20774,21648,21000,20711,19416,20329,21156,20709,
+20259,20136,21026,21873,22211,22754,23129,23763,
+23289,22959,22715,23028,23485,23968,24569,26971,
+28759,30000,30519,30501,29208,25850,22729,21443,
+20818,19779,19089,19200,19254,19431,19801,20766,
+21603,21959,22124,22347,22700,23280,24060,24691,
+24645,23739,23355,23202,23131,23113,23100,22943,
+22764,22897,22261,22091,22320,22398,22086,21165,
+20418,20391,20058,19963,19926,19931,19993,20046,
+20079,20109,20143,20182,20216,20242,20254,20248,
+20226,20193,20161,20167,20318,20463,20813,20929,
+21212,21303,21341,21270,21058,20833,20643,20397,
+20301,20256,20223,20200,20182,20171,20164,20160,
+20158,20158,20161,20163,20167,20173,20178,20182,
+20188,20193,20199,20204,20208,20209,20209,20205,
+20199,20193,20187,20179,20173,20166,20160,20154,
+20151,20146,20143,20142,20140,20143,20143,20148,
+20152,20159,20167,20176,20188,20200,20212,20226,
+20241,20257,20273,20290,20307,20322,20335,20338,
+20346,20359,20370,20377,20382,20386,20394,20406,
+20442,20498,20566,20653,20772,20912,20995,21196,
+21576,21847,22239,22685,23135,23515,24000,24351,
+24798,25026,25201,25356,25857,26189,26373,26503,
+26848,27192,28217,29040,29448,29050,28629,28494,
+28407,28482,28434,28414,28645,28833,29264,29775,
+29964,29931,29758,29576,29427,29334,29285,29295,
+29307,29202,28885,28552,28259,27891,27315,27077,
+26928,26889,26506,25767,24947,23914,23147,22416,
+21655,21365,21346,21394,21438,21464,21474,21475,
+21474,21477,21478,21486,21490,21492,21492,21487,
+21484,21480,21477,21474,21469,21468,21465,21462,
+21460,21459,21457,21457,21457,21459,21462,21468,
+21472,21478,21486,21492,21499,21505,21507,21507,
+21487,21483,21480,21472,21477,21496,21522,21549,
+21579,21610,21642,21674,21705,21732,21750,21755,
+21739,21694,21620,21534,21477,21467,21482,21498,
+21510,21519,21531,21543,21552,21648,21781,22021,
+22293,22667,22912,23124,23370,23499,23712,23898,
+23897,23775,23521,23098,22656,22502,22633,22811,
+22980,23119,23232,23323,23394,23451,23494,23530,
+23557,23577,23592,23602,23608,23610,23608,23605,
+23601,23601,23605,23619,23637,23653,23662,23662,
+23666,23691,23737,23793,23848,23875,23865,23838,
+23805,23781,23799,23853,23923,23979,24036,24128,
+24222,24291,24318,24322,24324,24348,24432,24663,
+25108,25263,24974,24765,24649,24580,24564,24570,
+24585,24584,24572,24602,24661,24708,24698,24615,
+24505,24429,24490,24768,25167,25671,26034,26624,
+27115,27759,28268,28725,28987,29278,29211,29159,
+29106,29022,28745,28140,27604,26864,26017,25384,
+24947,24513,24438,24544,24446,24375,24134,24072,
+24087,24141,24243,24378,24507,24585,24701,24910,
+25032,25089,25147,25221,25514,25802,25848,25821,
+25698,25521,25217,25012,25127,25237,25674,25905,
+25897,25827,25797,25781,25778,25827,25997,26269,
+26376,26424,26463,26463,26425,26352,26289,26256,
+26235,26211,26190,26169,26121,26074,26040,26035,
+26034,26027,26011,25977,25894,25689,25390,25197,
+25156,25125,25086,25068,25103,25144,25160,25133,
+25110,25125,25444,26258,26902,27358,27237,26623,
+26163,25931,26292,26858,26916,26725,26431,26293,
+26454,26810,27240,27730,28221,28805,29349,29400,
+29325,29298,29306,29374,29436,29454,29475,29489,
+29448,29442,29406,29370,29452,29571,29589,29463,
+29341,29241,29115,28770,28364,28104,27846,27694,
+27529,27273,27066,26922,26727,26376,26109,25815,
+25415,25000,24455,23955,23484,22877,22833,23087,
+22885,22453,22187,22299,22841,23149,23048,22633,
+22260,22111,22112,22152,22187,22201,22204,22199,
+22169,22082,21955,21816,21695,21613,21562,21491,
+21397,21300,21208,21126,21060,21017,20976,20927,
+20878,20836,20798,20763,20698,20568,20636,20651,
+20604,20548,20497,20456,20424,20397,20378,20361,
+20349,20337,20327,20319,20311,20302,20296,20287,
+20281,20272,20265,20257,20248,20238,20227,20217,
+20205,20194,20182,20172,20163,20154,20146,20139,
+20133,20130,20128,20131,20134,20143,20152,20151,
+20156,20167,20184,20202,20223,20244,20265,20286,
+20307,20326,20346,20364,20379,20391,20397,20400,
+20436,20442,20427,20411,20394,20370,20350,20353,
+20382,20392,20373,20352,20319,20271,20234,20208,
+20190,20181,20175,20172,20172,20173,20177,20182,
+20190,20202,20219,20241,20264,20282,20303,20341,
+20387,20457,20535,20597,20607,20607,20480,20391,
+20330,20257,20217,20199,20196,20190,20201,20221,
+20227,20221,20220,20225,20245,20280,20328,20380,
+20426,20459,20489,20516,20522,20487,20378,20024,
+19821,19862,19938,20054,20078,20049,20212,20241,
+20232,20305,20315,20551,20840,21024,21207,21414,
+21597,21741,21858,21971,22061,22101,22084,22054,
+22257,22704,22665,22600,22931,23697,23780,23278,
+22533,21822,21402,21455,21726,21987,22218,22413,
+22517,22483,22397,22435,22059,21303,21069,21843,
+22070,21788,22149,22900,23819,24632,24833,24493,
+24089,23751,23364,22986,22889,22947,22338,21220,
+20396,20277,20265,20322,20393,20435,20585,21068,
+21402,21550,21590,21582,21525,21410,21192,20823,
+20310,19854,19734,19712,19712,19704,19698,19701,
+19710,19723,19737,19751,19761,19770,19779,19788,
+19798,19809,19813,19813,19818,19825,19849,19892,
+19957,20028,20097,20163,20226,20280,20310,20298,
+20269,20243,20225,20212,20206,20202,20196,20194,
+20190,20191,20193,20190,20182,20175,20170,20161,
+20152,20141,20127,20109,20085,20056,20019,19980,
+19992,20213,20370,20346,20305,20277,20259,20238,
+20213,20166,20111,20067,20037,20021,20011,20002,
+20001,20008,20017,20023,20026,20023,20028,20032,
+20054,20075,20079,20088,20113,20151,20200,20261,
+20325,20361,20365,20433,20693,21051,21195,21241,
+21184,21120,21078,21136,21099,21394,21983,22497,
+23200,23581,24087,24434,24543,24991,25471,25639,
+25646,25613,25578,25552,25580,25643,25698,25731,
+25737,25755,25786,25834,25875,25890,25835,25930,
+26174,26241,26282,26625,27360,28191,28956,29485,
+29951,30066,30090,30090,30105,30088,30021,29918,
+29773,29577,29090,28341,27594,26847,25837,25614,
+24992,24417,23841,23459,22615,22735,22631,22434,
+22328,22356,22365,22034,21630,21532,21506,21492,
+21475,21460,21450,21444,21442,21439,21438,21438,
+21436,21436,21436,21436,21436,21436,21438,21438,
+21439,21441,21441,21444,21444,21447,21450,21450,
+21453,21456,21459,21462,21464,21466,21469,21472,
+21475,21478,21481,21483,21484,21487,21487,21487,
+21483,21443,21411,21380,21348,21330,21324,21330,
+21339,21348,21357,21364,21373,21381,21396,21414,
+21440,21471,21503,21525,21549,21576,21603,21667,
+21870,22131,22332,22557,22849,23003,23219,23358,
+23518,23729,24021,24194,24523,24713,24916,25103,
+25229,25359,25519,25691,25815,25839,25833,25818,
+25820,25918,26084,26054,25970,25914,25873,25837,
+25797,25722,25575,25400,25257,25202,25145,25026,
+24851,24658,24498,24273,24134,24182,24138,24049,
+23994,24070,24264,24387,23976,23510,23461,23505,
+23509,23480,23382,23312,23251,23240,23250,23223,
+23321,23429,23434,23403,23364,23331,23318,23329,
+23370,23440,23533,23640,23730,23768,23626,23537,
+23803,23949,23938,23987,24146,24474,24535,24187,
+23979,23841,23719,23621,23546,23463,23347,23247,
+23171,23123,23122,23211,23479,24021,24685,25326,
+25731,25895,25820,25391,24762,24138,23613,23289,
+23185,23180,23217,23249,23280,23310,23341,23373,
+23406,23440,23475,23507,23527,23516,23459,23417,
+23406,23403,23395,23379,23351,23334,23345,23437,
+23869,24566,24935,25080,25176,25599,26039,26259,
+26488,26578,26867,27007,27021,27050,27123,27214,
+27307,27391,27466,27532,27599,27668,27753,27885,
+28035,28191,28332,28441,28525,28599,28650,28647,
+28371,28074,27705,27203,26777,26433,26097,25764,
+25377,25168,25152,25188,25355,25572,25939,26422,
+26817,26992,27137,27400,27652,27926,28155,28552,
+28789,29165,29399,29436,29425,29426,29413,29391,
+29384,29436,29451,29401,29394,29400,29390,29354,
+29308,29262,29220,29182,29149,29123,29100,29080,
+29052,29012,28981,28945,28891,28815,28725,28610,
+28455,28216,28025,27858,27051,26250,25810,25548,
+25397,25310,25241,25146,25021,24903,24864,24825,
+24676,24416,24213,23887,23445,23011,22616,22253,
+21940,21709,21597,21577,21578,21587,21597,21601,
+21604,21606,21609,21610,21613,21612,21609,21599,
+21577,21543,21496,21444,21387,21327,21267,21205,
+21143,21084,21033,21000,20978,20955,20929,20901,
+20872,20844,20813,20786,20762,20746,20733,20688,
+20623,20551,20483,20431,20403,20392,20382,20373,
+20364,20356,20353,20353,20358,20365,20372,20409,
+20597,20712,20890,21168,21348,21430,21446,21376,
+20900,20932,20957,20842,20616,20402,20273,20192,
+20139,20101,20073,20054,20037,20028,20022,20030,
+20044,20064,20085,20108,20132,20157,20183,20208,
+20233,20253,20267,20271,20272,20279,20292,20305,
+20316,20322,20329,20332,20334,20332,20331,20326,
+20323,20317,20307,20287,20241,20184,20136,20109,
+20101,20109,20130,20160,20200,20250,20313,20401,
+20520,20633,20660,20417,20293,20226,20208,20226,
+20239,20239,20245,20250,20253,20256,20256,20253,
+20246,20230,20202,20182,20179,20181,20185,20191,
+20196,20199,20203,20211,20217,20218,20218,20215,
+20212,20209,20206,20203,20203,20203,20206,20210,
+20216,20224,20235,20247,20261,20276,20292,20309,
+20328,20346,20364,20377,20381,20366,20331,20324,
+20304,20248,20183,20142,20132,20157,20239,20391,
+20585,20688,20469,19951,19930,20125,20335,20441,
+20586,20808,21110,21344,21432,21273,20927,20475,
+20292,20245,20268,20327,20380,20452,20647,20877,
+20862,20899,21012,21180,21399,21654,21930,22197,
+22445,22615,22474,22038,21531,20931,20443,20301,
+20252,20223,20204,20193,20194,20196,20172,20087,
+19963,19821,19720,19699,19724,19765,19816,19870,
+19932,19998,20065,20123,20159,20181,20185,20193,
+20201,20203,20205,20203,20202,20200,20197,20196,
+20193,20190,20189,20187,20185,20185,20185,20188,
+20190,20194,20198,20202,20205,20206,20206,20206,
+20206,20208,20209,20209,20213,20218,20221,20227,
+20232,20238,20245,20253,20261,20269,20278,20289,
+20301,20313,20328,20342,20359,20376,20394,20410,
+20426,20433,20420,20395,20366,20334,20303,20272,
+20242,20209,20173,20135,20095,20057,20021,19990,
+19967,19957,19968,20007,20070,20166,20373,20565,
+20773,21246,21693,22256,22883,23291,23626,23923,
+23919,23783,23703,23436,23183,23273,23580,23872,
+24136,24400,24678,24711,24519,24478,24364,24267,
+24291,24383,24513,24713,25111,25629,25979,26155,
+26309,26712,27471,28182,28500,28709,28932,29007,
+29077,29162,29295,29392,29413,29442,29489,29583,
+29650,29691,29726,29747,29765,29780,29784,29777,
+29760,29700,29537,29253,29124,28906,28485,28284,
+28197,27819,27433,26910,26465,25956,25089,23899,
+22797,22032,21650,21555,21460,21405,21405,21431,
+21386,21321,21270,21240,21225,21219,21220,21229,
+21241,21258,21279,21300,21321,21342,21362,21379,
+21396,21409,21421,21433,21444,21454,21461,21460,
+21462,21460,21460,21460,21460,21460,21460,21460,
+21460,21462,21460,21459,21458,21465,21483,21515,
+21592,21599,21537,21518,21519,21552,21546,21519,
+21439,21422,21403,21384,21369,21362,21381,21426,
+21498,21594,21708,21799,21824,21735,21614,21500,
+21429,21470,21708,22072,21921,21703,21641,21807,
+22063,22257,22486,22679,22750,22782,22815,22842,
+22871,22927,23053,23160,23247,23394,23451,23376,
+23316,23407,23532,23460,23256,23061,22902,22695,
+22495,22421,22361,22251,22218,22219,22260,22332,
+22537,22704,22760,22705,22569,22382,22207,22085,
+22081,22102,22113,22108,22110,22114,22113,22113,
+22114,22113,22109,22097,22079,22056,22032,22014,
+22014,22044,22098,22194,22285,22205,22010,21915,
+21951,21999,21938,21834,21794,21800,21819,21847,
+21885,21930,21985,22043,22099,22144,22180,22208,
+22257,22344,22453,22572,22675,22731,22780,22867,
+22887,22849,22815,22818,22852,22911,23000,23108,
+23216,23310,23368,23400,23501,23639,23766,23857,
+23925,24016,24075,24157,24234,24294,24337,24376,
+24411,24441,24516,24643,24761,24870,24960,25018,
+25063,25132,25165,25137,25213,25479,25722,25846,
+25944,26147,26472,26805,26985,26990,26980,27010,
+26961,26703,26451,26200,25775,25348,25035,24834,
+24560,24195,23982,23835,23718,23665,23660,23691,
+23751,23811,23865,23927,23994,24075,24178,24293,
+24418,24547,24702,24897,25166,25464,25770,26067,
+26336,26561,26731,26905,27071,27229,27445,27679,
+27908,28101,28243,28348,28447,28523,28552,28523,
+28448,28270,28187,28185,28200,28240,28363,28491,
+28566,28665,28749,28791,28812,28815,28809,28815,
+28893,29064,29211,29236,29159,29057,28985,28934,
+28878,28824,28786,28749,28671,28500,28260,27960,
+27605,27291,27060,26882,26694,26422,26056,25744,
+25452,25106,24960,25704,26313,25530,24743,24253,
+24019,24033,24168,24414,24774,25042,25224,25328,
+25211,24924,24807,24862,24741,24588,24402,23911,
+23459,23319,23352,23477,23306,22969,23037,23295,
+22621,22129,21860,21612,21439,21311,21233,21198,
+21192,21192,21187,21170,21143,21107,21069,21034,
+21009,20995,20981,20961,20941,20919,20897,20874,
+20853,20832,20809,20787,20763,20739,20701,20640,
+20566,20493,20433,20397,20362,20316,20269,20222,
+20184,20154,20134,20127,20133,20140,20148,20155,
+20160,20161,20161,20160,20156,20154,20149,20145,
+20142,20140,20139,20137,20137,20137,20137,20137,
+20137,20137,20139,20137,20136,20133,20119,20113,
+20113,20101,20075,20050,20096,20147,20181,20210,
+20234,20253,20272,20291,20310,20327,20335,20331,
+20306,20242,20142,20026,19917,19832,19807,19801,
+19799,19797,19798,19803,19816,19837,19864,19895,
+19929,19966,20005,20046,20085,20122,20160,20192,
+20219,20235,20241,20248,20253,20253,20253,20253,
+20250,20248,20247,20245,20244,20242,20241,20239,
+20238,20236,20235,20233,20232,20230,20229,20227,
+20227,20224,20224,20224,20224,20227,20233,20238,
+20244,20248,20250,20253,20253,20251,20251,20247,
+20244,20242,20238,20234,20229,20225,20221,20220,
+20218,20220,20227,20238,20253,20272,20294,20319,
+20346,20376,20407,20439,20467,20489,20501,20490,
+20455,20380,20292,20206,20130,20106,20112,20141,
+20178,20212,20240,20260,20274,20282,20286,20284,
+20280,20274,20266,20258,20248,20240,20232,20227,
+20229,20233,20239,20246,20254,20261,20268,20272,
+20274,20275,20273,20269,20263,20255,20245,20236,
+20227,20223,20223,20227,20233,20231,20227,20236,
+20254,20267,20271,20267,20259,20248,20237,20226,
+20217,20210,20203,20200,20200,20200,20211,20208,
+20118,19746,19624,19719,19806,19872,19915,19943,
+19960,19968,19972,19972,19971,19969,19969,19971,
+19978,19994,20022,20068,20124,20180,20208,20181,
+20109,20028,19969,19933,19913,19902,19896,19893,
+19891,19893,19894,19897,19899,19902,19906,19911,
+19917,19923,19933,19948,19969,20000,20041,20095,
+20155,20202,20219,20171,20079,20043,20118,20215,
+20288,20276,20136,19974,19932,19931,19937,19955,
+19991,20041,20132,20235,20307,20306,20321,20455,
+20610,20742,20967,21246,21318,21329,21384,21518,
+21836,22216,22434,22541,22646,22737,22854,23034,
+23343,23948,24719,25329,25868,26171,26311,26562,
+26786,26949,27152,27467,27876,28233,28511,28710,
+28827,28891,28935,28967,29003,29037,29069,29100,
+29131,29163,29194,29209,29189,29120,28951,28755,
+28619,28590,28671,28818,28917,28947,29074,29216,
+29318,29336,29250,29070,28790,28546,28258,27769,
+27238,26738,26531,26633,26153,25373,24885,24543,
+24333,24079,23844,23490,23135,22893,22772,22711,
+22623,22525,22429,22336,22203,22056,21951,21838,
+21748,21785,21819,21852,21825,21699,21554,21483,
+21451,21414,21363,21279,21181,21115,21079,21087,
+21117,21161,21210,21263,21317,21367,21400,21423,
+21450,21471,21483,21489,21492,21495,21495,21494,
+21490,21487,21483,21478,21472,21468,21462,21453,
+28407,28343,28233,28083,27835,27445,27057,26733,
+26436,26172,25911,25611,25315,25092,24852,24447,
+23960,23595,23360,23040,22623,22287,21999,21765,
+21618,21501,21402,21324,21302,21370,21557,21833,
+22155,22477,22748,22935,22949,22785,22433,21984,
+21842,21984,22021,21990,21983,21941,21872,21764,
+21618,21503,21417,21338,21267,21225,21216,21252,
+21339,21476,21657,21864,22043,22142,22110,21936,
+21702,21520,21436,21444,21469,21486,21489,21486,
+21483,21481,21477,21465,21432,21368,21294,21227,
+21198,21206,21237,21282,21336,21392,21436,21459,
+21453,21426,21391,21359,21334,21334,21358,21385,
+21417,21450,21478,21514,21564,21593,21610,21617,
+21605,21564,21519,21491,21474,21457,21439,21422,
+21417,21423,21433,21441,21444,21454,21479,21517,
+21588,21708,21831,21933,22020,22038,22173,22687,
+23345,23723,23722,23772,24204,24664,24873,24951,
+25023,25110,25215,25311,25383,25467,25608,25827,
+26179,26591,26741,26599,26534,26610,26705,26844,
+26997,27177,27408,27576,27687,27845,28038,28205,
+28360,28475,28528,28557,28587,28600,28592,28536,
+28400,28263,28189,28154,28162,28191,28200,28197,
+28183,28160,28132,28103,28087,28086,28107,28158,
+28155,28091,27977,27792,27634,27479,27369,27444,
+27597,27804,28027,28122,28141,28151,28149,28153,
+28161,28194,28265,28337,28398,28442,28448,28407,
+28322,28185,27979,27765,27626,27558,27544,27578,
+27644,27738,27851,27972,28091,28194,28265,28299,
+28317,28325,28309,28266,28174,27994,27757,27448,
+27089,26810,26637,26426,26114,25726,25336,25011,
+24777,24624,24533,24489,24486,24490,24498,24513,
+24533,24555,24591,24641,24702,24780,24832,24790,
+24667,24450,24126,23727,23328,22897,22348,21792,
+21361,21096,20953,20891,20853,20835,20836,20849,
+20872,20905,20940,20976,21007,21028,21038,21039,
+21033,21020,21002,20982,20964,20946,20931,20913,
+20887,20853,20815,20773,20728,20681,20635,20590,
+20544,20502,20462,20430,20406,20385,20366,20349,
+20337,20325,20316,20309,20302,20296,20290,20284,
+20278,20275,20269,20265,20259,20254,20250,20244,
+20239,20235,20230,20226,20220,20217,20212,20209,
+20203,20200,20196,20193,20190,20187,20184,20182,
+20178,20176,20173,20169,20164,20154,20139,20121,
+20100,20080,20061,20046,20036,20032,20042,20059,
+20082,20110,20141,20173,20208,20244,20278,20313,
+20345,20376,20400,20420,20425,20418,20382,20315,
+20207,20028,19869,19801,19783,19793,19828,19884,
+19956,20034,20114,20181,20233,20263,20275,20279,
+20280,20283,20283,20286,20286,20286,20284,20284,
+20284,20283,20283,20280,20280,20278,20277,20275,
+20275,20272,20272,20269,20269,20268,20266,20266,
+20265,20265,20262,20262,20259,20256,20254,20253,
+20253,20253,20251,20251,20251,20250,20250,20251,
+20251,20253,20253,20253,20256,20256,20256,20256,
+20259,20259,20259,20259,20259,20259,20259,20259,
+20257,20256,20253,20248,20241,20233,20222,20209,
+20193,20174,20151,20125,20092,20052,20005,19956,
+19896,19843,19815,19823,19858,19911,19963,20016,
+20062,20100,20133,20159,20180,20197,20211,20222,
+20230,20237,20242,20247,20250,20250,20253,20253,
+20253,20253,20253,20253,20251,20250,20250,20248,
+20248,20248,20248,20248,20248,20251,20251,20251,
+20251,20254,20254,20254,20254,20251,20251,20251,
+20251,20251,20252,20254,20254,20254,20254,20256,
+20256,20256,20256,20256,20256,20257,20257,20257,
+20257,20256,20254,20254,20253,20253,20253,20253,
+20254,20254,20256,20257,20260,20261,20263,20266,
+20269,20272,20274,20278,20283,20286,20289,20293,
+20296,20301,20305,20308,20314,20319,20322,20326,
+20332,20335,20340,20346,20349,20353,20359,20366,
+20373,20379,20388,20397,20407,20419,20432,20445,
+20458,20463,20453,20416,20349,20271,20203,20145,
+20119,20160,20253,20335,20368,20376,20375,20376,
+20380,20385,20392,20395,20398,20400,20403,20404,
+20407,20410,20413,20416,20421,20425,20431,20436,
+20440,20442,20448,20464,20500,20585,20718,20869,
+21018,21137,21195,21237,21321,21425,21508,21582,
+21642,21723,21885,22147,22549,22992,23386,23832,
+24323,24767,25113,25324,25528,25899,26281,26573,
+26868,27173,27483,27817,28121,28392,28691,29037,
+29358,29597,29749,29864,29948,29983,29961,29862,
+29616,29178,28668,28217,27787,27323,26859,26456,
+26165,25930,25688,25431,25203,25095,25125,25180,
+25197,25191,25182,25181,25187,25191,25184,25185,
+25209,25230,25215,25197,25206,25242,25269,25264,
+25233,25191,25135,25074,25027,25001,25008,25066,
+25184,25389,25605,25752,25917,26097,26259,26538,
+26896,26988,26872,26921,27102,27223,27280,27427,
+27710,27921,28000,28086,28194,28324,28490,28615,
+28662,28695,28758,28803,28773,28690,28597,28493,
+23979,24041,24041,24006,23921,23790,23674,23614,
+23579,23582,23646,23772,23961,24218,24573,25040,
+25518,25894,26157,26345,26457,26459,26338,26160,
+26009,25911,25847,25794,25744,25696,25647,25596,
+25543,25481,25410,25347,25322,25364,25452,25549,
+25605,25620,25602,25565,25522,25480,25456,25451,
+25450,25425,25366,25287,25194,25109,25052,25050,
+25105,25179,25236,25280,25342,25435,25541,25656,
+25801,25992,26184,26322,26400,26462,26529,26587,
+26604,26573,26535,26521,26532,26546,26566,26589,
+26613,26623,26604,26560,26499,26436,26364,26263,
+26135,26008,25914,25887,25935,26054,26226,26424,
+26628,26822,27006,27208,27434,27666,27871,28026,
+28155,28261,28343,28401,28442,28479,28512,28542,
+28566,28580,28579,28568,28560,28558,28542,28485,
+28378,28233,28050,27840,27621,27409,27222,27069,
+26943,26855,26808,26795,26802,26830,26898,27016,
+27174,27330,27450,27534,27598,27657,27717,27772,
+27825,27872,27906,27917,27903,27870,27813,27722,
+27573,27372,27162,27012,26948,26944,26958,26960,
+26955,26952,26961,26992,27044,27083,27078,27031,
+26961,26885,26806,26718,26626,26530,26426,26326,
+26246,26198,26169,26137,26088,26038,25971,25863,
+25692,25479,25258,25063,24876,24706,24569,24484,
+24435,24373,24259,24101,23931,23781,23653,23539,
+23433,23338,23253,23169,23079,22983,22878,22764,
+22633,22491,22353,22234,22138,22045,21945,21830,
+21714,21616,21558,21540,21573,21656,21795,21993,
+22266,22626,23047,23486,23910,24315,24639,24797,
+24711,24428,24054,23679,23318,22959,22637,22383,
+22201,22062,21939,21804,21657,21521,21404,21307,
+21220,21148,21087,21027,20961,20888,20814,20744,
+20684,20632,20586,20542,20500,20464,20433,20408,
+20394,20392,20403,20427,20458,20496,20536,20577,
+20619,20661,20700,20736,20768,20795,20813,20824,
+20827,20826,20821,20815,20812,20809,20808,20803,
+20796,20787,20775,20761,20748,20732,20715,20699,
+20682,20664,20646,20629,20612,20594,20577,20560,
+20544,20527,20511,20496,20482,20469,20456,20444,
+20433,20423,20416,20409,20404,20400,20397,20393,
+20388,20384,20378,20373,20367,20361,20353,20347,
+20340,20333,20325,20316,20307,20297,20286,20277,
+20264,20251,20238,20224,20210,20195,20179,20164,
+20148,20136,20130,20127,20131,20149,20192,20251,
+20294,20294,20250,20192,20145,20111,20078,20059,
+20064,20091,20134,20190,20263,20351,20429,20481,
+20517,20540,20558,20566,20568,20565,20562,20556,
+20548,20541,20533,20523,20516,20508,20500,20493,
+20485,20479,20475,20469,20464,20458,20455,20451,
+20449,20446,20443,20442,20440,20439,20436,20434,
+20434,20433,20431,20430,20431,20430,20428,20428,
+20425,20425,20424,20421,20416,20413,20410,20406,
+20401,20398,20395,20394,20392,20392,20392,20389,
+20389,20389,20388,20388,20388,20386,20386,20385,
+20385,20385,20385,20383,20383,20383,20382,20382,
+20382,20382,20382,20382,20382,20382,20382,20382,
+20382,20382,20382,20382,20383,20383,20382,20382,
+20383,20383,20385,20383,20383,20382,20380,20379,
+20379,20379,20379,20379,20377,20376,20376,20376,
+20376,20374,20373,20373,20373,20371,20370,20370,
+20368,20367,20367,20365,20364,20364,20362,20361,
+20359,20359,20358,20356,20356,20355,20353,20353,
+20353,20352,20352,20353,20353,20353,20353,20353,
+20353,20353,20353,20353,20353,20352,20352,20352,
+20350,20349,20349,20347,20347,20347,20347,20350,
+20350,20353,20355,20358,20359,20361,20364,20367,
+20368,20370,20373,20374,20377,20379,20381,20383,
+20385,20388,20390,20392,20396,20400,20404,20408,
+20413,20416,20422,20425,20431,20434,20439,20443,
+20448,20452,20457,20460,20464,20469,20472,20475,
+20478,20481,20484,20485,20488,20488,20491,20491,
+20491,20490,20488,20487,20482,20479,20475,20472,
+20467,20463,20462,20460,20458,20458,20457,20456,
+20452,20448,20443,20437,20431,20425,20419,20412,
+20405,20398,20391,20385,20376,20370,20364,20357,
+20349,20343,20337,20332,20326,20319,20314,20310,
+20305,20302,20297,20293,20292,20290,20293,20302,
+20317,20339,20363,20390,20418,20445,20469,20488,
+20502,20508,20505,20490,20463,20427,20382,20337,
+20293,20256,20232,20217,20206,20200,20197,20196,
+20199,20203,20211,20215,20221,20232,20244,20261,
+20280,20301,20326,20355,20396,20449,20511,20574,
+20638,20702,20763,20826,20891,20958,21024,21082,
+21136,21183,21207,21196,21119,20991,20854,20766,
+20721,20706,20698,20683,20669,20657,20642,20629,
+20626,20634,20654,20682,20712,20744,20779,20829,
+20916,21047,21213,21377,21512,21596,21633,21639,
+21633,21623,21621,21625,21634,21653,21685,21735,
+21800,21863,21916,21964,22015,22070,22102,22119,
+22166,22283,22463,22683,22922,23211,23538,23818,
+20647,20656,20664,20668,20670,20670,20670,20670,
+20670,20673,20674,20676,20678,20679,20682,20682,
+20683,20685,20686,20688,20689,20691,20694,20695,
+20698,20700,20703,20706,20709,20710,20713,20715,
+20716,20718,20718,20718,20718,20718,20718,20716,
+20716,20716,20716,20715,20715,20713,20713,20713,
+20712,20710,20710,20709,20707,20706,20706,20704,
+20703,20703,20703,20701,20701,20701,20701,20701,
+20701,20703,20703,20703,20703,20703,20704,20706,
+20706,20707,20707,20707,20710,20710,20712,20713,
+20713,20715,20716,20716,20718,20718,20718,20718,
+20718,20718,20718,20715,20715,20715,20713,20712,
+20710,20710,20707,20706,20704,20701,20700,20698,
+20695,20693,20691,20690,20688,20686,20685,20683,
+20683,20682,20682,20683,20683,20683,20683,20685,
+20685,20685,20688,20689,20691,20692,20695,20697,
+20700,20703,20704,20707,20710,20712,20715,20718,
+20721,20724,20727,20730,20733,20734,20739,20740,
+20743,20746,20748,20751,20751,20754,20754,20755,
+20755,20754,20755,20754,20751,20751,20749,20748,
+20746,20745,20746,20745,20746,20745,20745,20745,
+20742,20740,20737,20733,20727,20721,20715,20709,
+20701,20695,20688,20683,20679,20673,20668,20665,
+20661,20656,20652,20649,20646,20643,20640,20637,
+20635,20634,20631,20631,20628,20628,20626,20625,
+20625,20622,20622,20622,20619,20619,20619,20617,
+20617,20617,20616,20614,20614,20614,20614,20613,
+20613,20613,20613,20613,20611,20611,20611,20611,
+20611,20611,20611,20610,20610,20610,20610,20611,
+20611,20611,20611,20613,20613,20613,20613,20613,
+20613,20613,20613,20613,20613,20613,20610,20610,
+20607,20607,20604,20601,20598,20596,20592,20589,
+20587,20583,20580,20575,20571,20565,20559,20551,
+20541,20530,20520,20509,20499,20487,20478,20469,
+20463,20458,20457,20457,20458,20462,20467,20475,
+20482,20490,20497,20502,20506,20509,20509,20507,
+20502,20494,20485,20475,20463,20448,20434,20419,
+20404,20389,20376,20362,20349,20335,20324,20313,
+20302,20292,20284,20279,20274,20270,20268,20267,
+20268,20269,20269,20272,20275,20277,20280,20283,
+20285,20289,20292,20295,20297,20301,20302,20305,
+20307,20310,20311,20313,20314,20317,20319,20319,
+20322,20323,20323,20325,20325,20325,20326,20326,
+20326,20326,20326,20328,20328,20331,20332,20335,
+20337,20340,20343,20344,20349,20352,20356,20358,
+20362,20366,20370,20374,20379,20385,20389,20393,
+20398,20403,20407,20412,20418,20422,20428,20433,
+20439,20443,20448,20454,20458,20464,20469,20475,
+20479,20484,20488,20494,20499,20505,20508,20512,
+20518,20521,20526,20529,20535,20538,20541,20545,
+20548,20551,20554,20557,20560,20562,20565,20565,
+20568,20568,20569,20571,20571,20571,20569,20568,
+20568,20568,20567,20566,20566,20568,20566,20568,
+20569,20569,20572,20574,20575,20577,20580,20580,
+20581,20581,20581,20580,20578,20575,20572,20569,
+20566,20561,20557,20553,20550,20547,20544,20541,
+20538,20535,20532,20529,20527,20526,20523,20523,
+20521,20521,20520,20520,20520,20520,20521,20521,
+20523,20524,20526,20527,20529,20530,20532,20532,
+20533,20535,20535,20536,20536,20536,20538,20536,
+20538,20536,20536,20536,20536,20535,20535,20535,
+20533,20533,20532,20532,20530,20530,20529,20529,
+20529,20527,20527,20527,20527,20527,20527,20529,
+20529,20527,20528,20529,20529,20527,20527,20526,
+20524,20523,20523,20521,20520,20520,20518,20518,
+20518,20518,20518,20520,20520,20520,20523,20523,
+20523,20526,20529,20529,20532,20535,20538,20541,
+20544,20547,20550,20554,20557,20563,20566,20572,
+20577,20583,20589,20593,20599,20604,20608,20613,
+20617,20622,20626,20630,20634,20637,20639,20641,
+20641,20643,20640,20637,20634,20628,20622,20614,
+20608,20601,20592,20585,20578,20571,20566,20562,
+20559,20557,20556,20554,20554,20553,20553,20554,
+20554,20554,20554,20553,20553,20551,20548,20545,
+20543,20538,20532,20527,20520,20512,20505,20497,
+20487,20478,20469,20460,20450,20440,20433,20424,
+20417,20412,20407,20404,20402,20400,20400,20401,
+20403,20404,20406,20407,20409,20410,20410,20412,
+20413,20412,20413,20413,20413,20415,20415,20415,
+20418,20418,20421,20424,20429,20435,20443,20451,
+20461,20473,20486,20500,20514,20528,20543,20556,
+20570,20581,20592,20600,20608,20613,20616,20616,
+20614,20611,20608,20602,20596,20589,20581,20571,
+20560,20548,20536,20523,20510,20498,20484,20472,
+20458,20445,20433,20421,20408,20397,20385,20373,
+20363,20352,20341,20333,20323,20316,20307,20302,
+20296,20290,20287,20283,20281,20278,20277,20277,
+20278,20280,20285,20290,20298,20307,20319,20331,
+20344,20358,20372,20387,20403,20419,20436,20455,
+20477,20502,20526,20550,20574,20597,20617,20634,
diff --git a/src/exception.c b/src/exception.c
new file mode 100644
index 0000000..4a0eb89
--- /dev/null
+++ b/src/exception.c
@@ -0,0 +1,75 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <cdi.h>
+#include "cdo.h"
+#include "process.h"
+
+static int _ExitOnError   = 1;	/* If set to 1, exit on error       */
+
+void cdiError(int cdiErrno, const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+  printf("\n");
+   fprintf(stderr, "%s: ", processInqPrompt());
+  vfprintf(stderr, fmt, args);
+   fprintf(stderr, "\n");
+
+  va_end(args);
+
+  fprintf(stderr, "%s\n", cdiStringError(cdiErrno));
+
+  if ( _ExitOnError ) exit(EXIT_FAILURE);
+}
+
+
+void cdoAbort(const char *fmt, ...)
+{
+  va_list args;
+	
+  va_start(args, fmt);
+
+  printf("\n");
+   fprintf(stderr, "%s (Abort): ", processInqPrompt());
+  vfprintf(stderr, fmt, args);
+   fprintf(stderr, "\n");
+
+  va_end(args);
+
+  if ( _ExitOnError ) exit(EXIT_FAILURE);
+}
+
+
+void cdoWarning(const char *fmt, ...)
+{
+  va_list args;
+
+  va_start(args, fmt);
+
+   fprintf(stderr, "%s (Warning): ", processInqPrompt());
+  vfprintf(stderr, fmt, args);
+   fprintf(stderr, "\n");
+
+  va_end(args);
+}
+
+
+void cdoPrint(const char *fmt, ...)
+{
+  va_list args;
+
+  if ( ! cdoSilentMode )
+    {
+      va_start(args, fmt);
+
+      fprintf(stderr, "%s: ", processInqPrompt());
+      vfprintf(stderr, fmt, args);
+      fprintf(stderr, "\n");
+
+      va_end(args);
+    }
+}
diff --git a/src/expr.c b/src/expr.c
new file mode 100644
index 0000000..cd1f968
--- /dev/null
+++ b/src/expr.c
@@ -0,0 +1,920 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <errno.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "field.h"
+#include "expr.h"
+#include "expr_yacc.h"
+
+
+static double f_abs(double x)  { return (fabs(x));  }
+static double f_int(double x)  { return ((int)(x)); }
+static double f_nint(double x) { return (NINT(x));  }
+static double f_sqr(double x)  { return (x*x);      }
+
+typedef struct {
+  int type;
+  char *name;                      /* function name            */
+  double (*func)(double);          /* pointer to function      */
+}
+func_t;
+
+static func_t fun_sym_tbl[] =
+{
+  /* scalar functions */
+  {0, "abs",   f_abs},
+  {0, "int",   f_int},
+  {0, "nint",  f_nint},
+  {0, "sqr",   f_sqr},
+  {0, "sqrt",  sqrt},
+  {0, "exp",   exp},
+  {0, "log",   log},
+  {0, "log10", log10},
+  {0, "sin",   sin},
+  {0, "cos",   cos},
+  {0, "tan",   tan},
+  {0, "asin",  asin},
+  {0, "acos",  acos},
+  {0, "atan",  atan},
+
+  /* array functions
+  {1, "min",   min},
+  {1, "max",   max},
+  {1, "sum",   sum},
+  {1, "avg",   avg},
+  {1, "mean",  mean},
+  {1, "std",   std},
+  {1, "var",   var},
+  */
+};
+
+static int NumFunc = sizeof(fun_sym_tbl) / sizeof(fun_sym_tbl[0]);
+
+static
+nodeType *expr_con_con(int oper, nodeType *p1, nodeType *p2)
+{
+  nodeType *p;
+
+  p = (nodeType *) malloc(sizeof(nodeType));
+
+  p->type = typeCon;
+
+  switch ( oper )
+    {
+    case '+':  p->u.con.value = p1->u.con.value + p2->u.con.value; break;
+    case '-':  p->u.con.value = p1->u.con.value - p2->u.con.value; break;
+    case '*':  p->u.con.value = p1->u.con.value * p2->u.con.value; break;
+    case '/':  p->u.con.value = p1->u.con.value / p2->u.con.value; break;
+    case '^':  p->u.con.value = pow(p1->u.con.value, p2->u.con.value); break;
+    default:   cdoAbort("%s: operator %c unsupported!", __func__, oper);
+    }
+
+  return (p);
+}
+
+static
+nodeType *expr_con_var(int oper, nodeType *p1, nodeType *p2)
+{
+  nodeType *p;
+  long ngp, i;
+  long nlev;
+  int nmiss;
+  int gridID, zaxisID;
+  double missval1, missval2;
+
+  gridID   = p2->gridID;
+  zaxisID  = p2->zaxisID;
+  nmiss    = p2->nmiss;
+  missval1 = p2->missval;
+  missval2 = p2->missval;
+
+  ngp  = gridInqSize(gridID);
+  nlev = zaxisInqSize(zaxisID);
+
+  p = (nodeType *) malloc(sizeof(nodeType));
+
+  p->type     = typeVar;
+  p->tmpvar   = 1;
+  p->u.var.nm = strdupx("tmp");
+  p->gridID   = gridID;
+  p->zaxisID  = zaxisID;
+  p->missval  = missval1;
+
+  p->data = (double *) malloc(ngp*nlev*sizeof(double));
+
+  switch ( oper )
+    {
+    case '+':
+      if ( nmiss > 0 )
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = ADD(p1->u.con.value, p2->data[i]);
+	}
+      else
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = p1->u.con.value + p2->data[i];
+	}
+      break;
+    case '-':
+      if ( nmiss > 0 )
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = SUB(p1->u.con.value, p2->data[i]);
+	}
+      else
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = p1->u.con.value - p2->data[i];
+	}
+      break;
+    case '*':
+      if ( nmiss > 0 )
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = MUL(p1->u.con.value, p2->data[i]);
+	}
+      else
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = p1->u.con.value * p2->data[i];
+	}
+      break;
+    case '/':
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = DIV(p1->u.con.value, p2->data[i]);
+	}
+      break;
+    case '^':
+      if ( nmiss > 0 )
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = POW(p1->u.con.value, p2->data[i]);
+	}
+      else
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = pow(p1->u.con.value, p2->data[i]);
+	}
+      break;
+    default:
+      cdoAbort("%s: operator %c unsupported!", __func__, oper);
+    }
+
+  nmiss = 0;
+  for ( i = 0; i < ngp*nlev; i++ )
+    if ( DBL_IS_EQUAL(p->data[i], missval1) ) nmiss++;
+
+  p->nmiss = nmiss;
+
+  if ( p2->tmpvar ) free(p2->data);
+
+  return (p);
+}
+
+static
+nodeType *expr_var_con(int oper, nodeType *p1, nodeType *p2)
+{
+  nodeType *p;
+  long ngp, i;
+  long nlev;
+  int nmiss;
+  int gridID, zaxisID;
+  double missval1, missval2;
+
+  gridID   = p1->gridID;
+  zaxisID  = p1->zaxisID;
+  nmiss    = p1->nmiss;
+  missval1 = p1->missval;
+  missval2 = p1->missval;
+
+  ngp  = gridInqSize(gridID);
+  nlev = zaxisInqSize(zaxisID);
+
+  p = (nodeType *) malloc(sizeof(nodeType));
+
+  p->type     = typeVar;
+  p->tmpvar   = 1;
+  p->u.var.nm = strdupx("tmp");
+  p->gridID   = gridID;
+  p->zaxisID  = zaxisID;
+  p->missval  = missval1;
+
+  p->data = (double *) malloc(ngp*nlev*sizeof(double));
+
+  switch ( oper )
+    {
+    case '+':
+      if ( nmiss > 0 )
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = ADD(p1->data[i], p2->u.con.value);
+	}
+      else
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = p1->data[i] + p2->u.con.value;
+	}
+      break;
+    case '-':
+      if ( nmiss > 0 )
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = SUB(p1->data[i], p2->u.con.value);
+	}
+      else
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = p1->data[i] - p2->u.con.value;
+	}
+      break;
+    case '*':
+      if ( nmiss > 0 )
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = MUL(p1->data[i], p2->u.con.value);
+	}
+      else
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = p1->data[i] * p2->u.con.value;
+	}
+      break;
+    case '/':
+      if ( nmiss > 0 || IS_EQUAL(p2->u.con.value, 0) )
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = DIV(p1->data[i], p2->u.con.value);
+	}
+      else
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = p1->data[i] / p2->u.con.value;
+	}
+      break;
+    case '^':
+      if ( nmiss > 0 )
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = POW(p1->data[i], p2->u.con.value);
+	}
+      else
+	{
+	  for ( i = 0; i < ngp*nlev; i++ )
+	    p->data[i] = pow(p1->data[i], p2->u.con.value);
+	}
+      break;
+    default:
+      cdoAbort("%s: operator %c unsupported!", __func__, oper);
+    }
+
+  nmiss = 0;
+  for ( i = 0; i < ngp*nlev; i++ )
+    if ( DBL_IS_EQUAL(p->data[i], missval1) ) nmiss++;
+
+  p->nmiss = nmiss;
+
+  if ( p1->tmpvar ) free(p1->data);
+
+  return (p);
+}
+
+static
+nodeType *expr_var_var(int oper, nodeType *p1, nodeType *p2)
+{
+  nodeType *p;
+  long ngp, ngp1, ngp2, i;
+  long nlev, nlev1, nlev2, k;
+  long loff1, loff2;
+  int nmiss, nmiss1, nmiss2;
+  double missval1, missval2;
+
+  nmiss1   = p1->nmiss;
+  nmiss2   = p2->nmiss;
+  missval1 = p1->missval;
+  missval2 = p2->missval;
+
+  ngp1 = gridInqSize(p1->gridID);
+  ngp2 = gridInqSize(p2->gridID);
+
+  if ( ngp1 != ngp2 )
+    cdoAbort("number of grid points differ. ngp1 = %d, ngp2 = %d", ngp1, ngp2);
+
+  ngp = ngp1;
+
+  nlev1 = zaxisInqSize(p1->zaxisID);
+  nlev2 = zaxisInqSize(p2->zaxisID);
+
+  p = (nodeType *) malloc(sizeof(nodeType));
+
+  p->type     = typeVar;
+  p->tmpvar   = 1;
+  p->u.var.nm = strdupx("tmp");
+
+  if ( nlev1 > nlev2 )
+    {
+      nlev = nlev1;
+      p->gridID  = p1->gridID;
+      p->zaxisID = p1->zaxisID;
+      p->missval = p1->missval;
+      if ( nlev2 != 1 ) cdoAbort("nlev2 = %d must be 1!", nlev2);
+    }
+  else if ( nlev2 > nlev1 )
+    {
+      nlev = nlev2;
+      p->gridID  = p2->gridID;
+      p->zaxisID = p2->zaxisID;
+      p->missval = p2->missval;
+      if ( nlev1 != 1 ) cdoAbort("nlev1 = %d must be 1!", nlev1);
+    }
+  else
+    {
+      nlev = nlev1;
+      p->gridID  = p1->gridID;
+      p->zaxisID = p1->zaxisID;
+      p->missval = p1->missval;
+    }
+
+  p->data = (double *) malloc(ngp*nlev*sizeof(double));
+
+  for ( k = 0; k < nlev; k++ )
+    {
+      if ( nlev1 == 1 ) loff1 = 0;
+      else              loff1 = k*ngp;
+
+      if ( nlev2 == 1 ) loff2 = 0;
+      else              loff2 = k*ngp;
+
+      switch ( oper )
+	{
+	case '+':
+	  if ( nmiss1 > 0 || nmiss2 > 0 )
+	    {
+	      for ( i = 0; i < ngp; i++ )
+		p->data[i+k*ngp] = ADD(p1->data[i+loff1], p2->data[i+loff2]);
+	    }
+	  else
+	    {
+	      for ( i = 0; i < ngp; i++ )
+		p->data[i+k*ngp] = p1->data[i+loff1] + p2->data[i+loff2];
+	    }
+	  break;
+	case '-':
+	  if ( nmiss1 > 0 || nmiss2 > 0 )
+	    {
+	      for ( i = 0; i < ngp; i++ )
+		p->data[i+k*ngp] = SUB(p1->data[i+loff1], p2->data[i+loff2]);
+	    }
+	  else
+	    {
+	      for ( i = 0; i < ngp; i++ )
+		p->data[i+k*ngp] = p1->data[i+loff1] - p2->data[i+loff2];
+	    }
+	  break;
+	case '*':
+	  if ( nmiss1 > 0 || nmiss2 > 0 )
+	    {
+	      for ( i = 0; i < ngp; i++ )
+		p->data[i+k*ngp] = MUL(p1->data[i+loff1], p2->data[i+loff2]);
+	    }
+	  else
+	    {
+	      for ( i = 0; i < ngp; i++ )
+		p->data[i+k*ngp] = p1->data[i+loff1] * p2->data[i+loff2];
+	    }
+	  break;
+	case '/':
+	  if ( nmiss1 > 0 || nmiss2 > 0 )
+	    {
+	      for ( i = 0; i < ngp; i++ )
+		p->data[i+k*ngp] = DIV(p1->data[i+loff1], p2->data[i+loff2]);
+	    }
+	  else
+	    {
+	      for ( i = 0; i < ngp; i++ )
+		p->data[i+k*ngp] = p1->data[i+loff1] / p2->data[i+loff2];
+	    }
+	  break;
+	case '^':
+	  if ( nmiss1 > 0 || nmiss2 > 0 )
+	    {
+	      for ( i = 0; i < ngp; i++ )
+		p->data[i+k*ngp] = POW(p1->data[i+loff1], p2->data[i+loff2]);
+	    }
+	  else
+	    {
+	      for ( i = 0; i < ngp; i++ )
+		p->data[i+k*ngp] = pow(p1->data[i+loff1], p2->data[i+loff2]);
+	    }
+	  break;
+	default:
+	  cdoAbort("%s: operator %c unsupported!", __func__, oper);
+	}
+    }
+
+  nmiss = 0;
+  for ( i = 0; i < ngp*nlev; i++ )
+    if ( DBL_IS_EQUAL(p->data[i], missval1) ) nmiss++;
+
+  p->nmiss = nmiss;
+
+  if ( p1->tmpvar ) free(p1->data);
+  if ( p2->tmpvar ) free(p2->data);
+
+  return (p);
+}
+
+static
+void ex_copy(nodeType *p2, nodeType *p1)
+{
+  long ngp, ngp1, ngp2, i;
+  long nlev;
+
+  if ( cdoVerbose )
+    printf("\tcopy %s\n", p1->u.var.nm);
+
+  ngp1 = gridInqSize(p1->gridID);
+  ngp2 = gridInqSize(p2->gridID);
+
+  ngp = ngp2;
+  nlev = zaxisInqSize(p2->zaxisID);
+
+  for ( i = 0; i < ngp*nlev; i++ )
+    p2->data[i] = p1->data[i];
+
+  p2->missval = p1->missval;
+  p2->nmiss   = p1->nmiss;
+}
+
+static
+nodeType *expr(int oper, nodeType *p1, nodeType *p2)
+{
+  nodeType *p = NULL;
+
+  if ( p1->type == typeVar && p2->type == typeVar )
+    {
+      p = expr_var_var(oper, p1, p2);
+      if ( cdoVerbose )
+	printf("\t%s %c %s\n", p1->u.var.nm, oper, p2->u.var.nm);
+    }
+  else if ( p1->type == typeCon && p2->type == typeCon )
+    {
+      p = expr_con_con(oper, p1, p2);
+      if ( cdoVerbose )
+	printf("\t%g %c %g\n", p1->u.con.value, oper, p2->u.con.value);
+    }
+  else if ( p1->type == typeVar && p2->type == typeCon )
+    {
+      p = expr_var_con(oper, p1, p2);
+      if ( cdoVerbose )
+	printf("\t%s %c %g\n", p1->u.var.nm, oper, p2->u.con.value);
+    }
+  else if ( p1->type == typeCon && p2->type == typeVar )
+    {
+      p = expr_con_var(oper, p1, p2);
+      if ( cdoVerbose )
+	printf("\t%g %c %s\n", p1->u.con.value, oper, p2->u.var.nm);
+    }
+  else
+    cdoAbort("Internal problem!");
+
+  return (p);
+}
+
+static
+nodeType *ex_fun_con(char *fun, nodeType *p1)
+{
+  nodeType *p;
+  int i;
+  int funcID = -1;
+
+  p = (nodeType *) malloc(sizeof(nodeType));
+
+  p->type = typeCon;
+
+  for ( i = 0; i < NumFunc; i++)
+    if ( fun_sym_tbl[i].type == 0 )
+      if ( strcmp(fun, fun_sym_tbl[i].name) == 0 )
+	{ 
+	  funcID = i;
+	  break;
+	}
+
+  if ( funcID == -1 )
+    cdoAbort("function %s not available!", fun);
+
+  p->u.con.value = fun_sym_tbl[funcID].func(p1->u.con.value);
+
+  return (p);
+}
+
+static
+nodeType *ex_fun_var(char *fun, nodeType *p1)
+{
+  nodeType *p;
+  long ngp, i;
+  long nlev;
+  int gridID, zaxisID;
+  int funcID = -1;
+  int nmiss;
+  double missval;
+
+  gridID  = p1->gridID;
+  zaxisID = p1->zaxisID;
+  nmiss   = p1->nmiss;
+  missval = p1->missval;
+
+  ngp  = gridInqSize(gridID);
+  nlev = zaxisInqSize(zaxisID);
+
+  p = (nodeType *) malloc(sizeof(nodeType));
+
+  p->type     = typeVar;
+  p->tmpvar   = 1;
+  p->u.var.nm = strdupx("tmp");
+  p->gridID   = gridID;
+  p->zaxisID  = zaxisID;
+  p->missval  = missval;
+
+  p->data = (double *) malloc(ngp*nlev*sizeof(double));
+
+  for ( i = 0; i < NumFunc; i++)
+    if ( strcmp(fun, fun_sym_tbl[i].name) == 0 )
+      { 
+	funcID = i;
+	break;
+      }
+
+  if ( funcID == -1 )
+    cdoAbort("function %s not available!", fun);
+
+  if ( nmiss > 0 )
+    {
+      for ( i = 0; i < ngp*nlev; i++ )
+	{
+	  errno = -1;
+	  p->data[i] = DBL_IS_EQUAL(p1->data[i], missval) ? missval : fun_sym_tbl[funcID].func(p1->data[i]);
+	  if ( errno == EDOM || errno == ERANGE ) p->data[i] = missval;
+	  else if ( isnan(p->data[i]) )  p->data[i] = missval;
+	}
+    }
+  else
+    {
+      for ( i = 0; i < ngp*nlev; i++ )
+	{
+	  errno = -1;
+	  p->data[i] = fun_sym_tbl[funcID].func(p1->data[i]);
+	  if ( errno == EDOM || errno == ERANGE ) p->data[i] = missval;
+	  else if ( isnan(p->data[i]) )  p->data[i] = missval;
+	}
+    }
+
+  nmiss = 0;
+  for ( i = 0; i < ngp*nlev; i++ )
+    if ( DBL_IS_EQUAL(p->data[i], missval) ) nmiss++;
+
+  p->nmiss = nmiss;
+
+  if ( p1->tmpvar ) free(p1->data);
+
+  return (p);
+}
+
+static
+nodeType *ex_fun(char *fun, nodeType *p1)
+{
+  nodeType *p = NULL;
+
+  if ( p1->type == typeVar )
+    {
+      p = ex_fun_var(fun, p1);
+      if ( cdoVerbose ) printf("\t%s (%s)\n", fun, p1->u.var.nm);
+    }
+  else if ( p1->type == typeCon )
+    {
+      p = ex_fun_con(fun, p1);
+      if ( cdoVerbose ) printf("\t%s (%g)\n", fun, p1->u.con.value);
+    }
+  else
+    cdoAbort("Internal problem!");
+
+  return (p);
+}
+
+static
+nodeType *ex_uminus_var(nodeType *p1)
+{
+  nodeType *p;
+  long ngp, i;
+  long nlev;
+  int nmiss;
+  int gridID, zaxisID;
+  double missval;
+
+  gridID   = p1->gridID;
+  zaxisID  = p1->zaxisID;
+  nmiss    = p1->nmiss;
+  missval  = p1->missval;
+
+  ngp  = gridInqSize(gridID);
+  nlev = zaxisInqSize(zaxisID);
+
+  p = (nodeType *) malloc(sizeof(nodeType));
+
+  p->type     = typeVar;
+  p->tmpvar   = 1;
+  p->u.var.nm = strdupx("tmp");
+  p->gridID   = gridID;
+  p->zaxisID  = zaxisID;
+  p->missval  = missval;
+
+  p->data = (double *) malloc(ngp*nlev*sizeof(double));
+
+  if ( nmiss > 0 )
+    {
+      for ( i = 0; i < ngp*nlev; i++ )
+	p->data[i] = DBL_IS_EQUAL(p1->data[i], missval) ? missval : -(p1->data[i]);
+    }
+  else
+    {
+      for ( i = 0; i < ngp*nlev; i++ )
+	p->data[i] = -(p1->data[i]);
+    }
+
+  p->nmiss = nmiss;
+  
+  return (p);
+}
+
+static
+nodeType *ex_uminus_con(nodeType *p1)
+{
+  nodeType *p;
+
+  p = (nodeType *) malloc(sizeof(nodeType));
+
+  p->type = typeCon;
+
+  p->u.con.value = -(p1->u.con.value);
+
+  return (p);
+}
+
+static
+nodeType *ex_uminus(nodeType *p1)
+{
+  nodeType *p = NULL;
+
+  if ( p1->type == typeVar )
+    {
+      p = ex_uminus_var(p1);
+      if ( cdoVerbose ) printf("\t- (%s)\n", p1->u.var.nm);
+    }
+  else if ( p1->type == typeCon )
+    {
+      p = ex_uminus_con(p1);
+      if ( cdoVerbose ) printf("\t- (%g)\n", p1->u.con.value);
+    }
+  else
+    cdoAbort("Internal problem!");
+
+  return (p);
+}
+
+
+int exNode(nodeType *p, parse_parm_t *parse_arg)
+{
+  int k;              /* child number */
+
+  if ( ! p ) return(0);
+
+  /* node is leaf */
+  if ( p->type == typeCon || p->type == typeVar || p->u.opr.nops == 0 )
+    {
+      return (0);
+    }
+
+  /* node has children */
+  for ( k = 0; k < p->u.opr.nops; k++ )
+    {
+      exNode(p->u.opr.op[k], parse_arg);
+    }
+
+  return (0);
+}
+
+
+nodeType *expr_run(nodeType *p, parse_parm_t *parse_arg)
+{
+  int gridID1 = -1, zaxisID1 = -1, tsteptype1 = -1;
+  double missval = 0;
+  char varname[256];
+  int varID, nvars;
+  nodeType *rnode = NULL;
+
+  if ( ! p ) return (rnode);
+
+  /*  if ( ! parse_arg->init ) { exNode(p, parse_arg); return (0); } */
+
+  switch ( p->type )
+    {
+    case typeCon:       
+      if ( parse_arg->init )
+	{
+	  if ( parse_arg->debug )
+	    printf("\tpush\t%g\n", p->u.con.value);
+	}
+      else
+	{
+	  rnode = p;
+	}
+
+      break;
+    case typeVar:
+      /*    if ( parse_arg->init ) */
+	{
+	  if ( parse_arg->debug )
+	    printf("\tpush\t%s\n", p->u.var.nm);
+
+	  nvars = vlistNvars(parse_arg->vlistID1);
+	  for ( varID = 0; varID < nvars; varID++ )
+	    {
+	      vlistInqVarName(parse_arg->vlistID1, varID, varname);
+	      if ( strcmp(varname, p->u.var.nm) == 0 ) break;
+	    }
+
+	  if ( varID == nvars )
+	    {
+	      cdoAbort("Variable >%s< not found!", p->u.var.nm);
+	    }
+	  else
+	    {
+	      if ( varID >= MAX_VARS ) cdoAbort("Too many parameter (limit=%d)!", MAX_VARS);
+
+	      if ( parse_arg->var_needed[varID] == 0 )
+		{
+
+		  parse_arg->var[varID] = strdupx(p->u.var.nm);
+		  parse_arg->varID[varID] = varID;
+		  parse_arg->var_needed[varID] = 1;
+		}
+
+	      gridID1  = vlistInqVarGrid(parse_arg->vlistID1, varID);
+	      zaxisID1 = vlistInqVarZaxis(parse_arg->vlistID1, varID);
+	      tsteptype1  = vlistInqVarTsteptype(parse_arg->vlistID1, varID);
+	      missval  = vlistInqVarMissval(parse_arg->vlistID1, varID);
+
+	      parse_arg->missval2 = missval;
+
+	      if ( parse_arg->gridID2 == -1 )
+		parse_arg->gridID2 = gridID1;
+
+	      if ( parse_arg->zaxisID2 == -1 )
+		parse_arg->zaxisID2 = zaxisID1;
+
+	      if ( parse_arg->tsteptype2 == -1 || parse_arg->tsteptype2 == TSTEP_CONSTANT )
+		parse_arg->tsteptype2 = tsteptype1;
+	    }
+	}
+	/* else */
+	{ 
+	  if ( parse_arg->debug )
+	    printf("%s %d %d %d\n", p->u.var.nm, varID, gridID1, zaxisID1);
+	  p->gridID  = gridID1;
+	  p->zaxisID = zaxisID1;
+	  p->missval = missval;
+          p->nmiss   = 0;
+	  if ( ! parse_arg->init )
+	    {
+	      p->data  = parse_arg->vardata1[varID];
+	      p->nmiss = parse_arg->nmiss[varID];
+	    }
+	  p->tmpvar  = 0;
+	  rnode = p;
+	}
+
+      break;
+    case typeFun:
+      if ( parse_arg->init )
+	{
+	  expr_run(p->u.fun.op, parse_arg);
+
+	  if ( parse_arg->debug )
+	    printf("\tcall \t%s\n", p->u.fun.name);
+	}
+      else
+	{
+	  rnode = ex_fun(p->u.fun.name, expr_run(p->u.fun.op, parse_arg));
+	}
+      break;
+    case typeOpr:
+      switch( p->u.opr.oper )
+	{
+        case '=':
+	  parse_arg->gridID2  = -1;
+	  parse_arg->zaxisID2 = -1;
+          parse_arg->tsteptype2  = -1;
+
+	  rnode = expr_run(p->u.opr.op[1], parse_arg);
+
+	  if ( parse_arg->init )
+	    {
+	      if ( parse_arg->debug )
+		printf("\tpop\t%s\n", p->u.opr.op[0]->u.var.nm);
+	      /*
+	      if ( p->u.opr.op[1]->type != typeVar )
+		cdoAbort("Operand not variable!");
+	      */
+	      if ( parse_arg->gridID2 == -1 || parse_arg->zaxisID2 == -1 || parse_arg->tsteptype2 == -1 )
+		cdoAbort("Operand not variable!");
+
+	      varID = vlistDefVar(parse_arg->vlistID2, parse_arg->gridID2, parse_arg->zaxisID2, parse_arg->tsteptype2);
+	      vlistDefVarName(parse_arg->vlistID2, varID, p->u.opr.op[0]->u.var.nm);
+	      vlistDefVarMissval(parse_arg->vlistID2, varID, parse_arg->missval2);
+	    }
+	  else
+	    {
+	      if ( parse_arg->debug )
+		printf("\tpop\t%s\t%s\n", p->u.opr.op[0]->u.var.nm, rnode->u.var.nm);
+
+	      nvars = vlistNvars(parse_arg->vlistID2);
+	      for ( varID = 0; varID < nvars; varID++ )
+		{
+		  vlistInqVarName(parse_arg->vlistID2, varID, varname);
+		  if ( strcmp(varname, p->u.opr.op[0]->u.var.nm) == 0 ) break;
+		}
+
+	      if ( varID == nvars )
+		{
+		  cdoAbort("variable >%s< not found!", p->u.opr.op[0]->u.var.nm);
+		}
+	      else
+		{
+		  parse_arg->gridID2  = vlistInqVarGrid(parse_arg->vlistID2, varID);
+		  parse_arg->zaxisID2 = vlistInqVarZaxis(parse_arg->vlistID2, varID);
+		  parse_arg->tsteptype2  = vlistInqVarTsteptype(parse_arg->vlistID2, varID);
+		  missval  = vlistInqVarMissval(parse_arg->vlistID2, varID);
+	      
+		  p->gridID  = parse_arg->gridID2;
+		  p->zaxisID = parse_arg->zaxisID2;
+		  p->missval = missval;
+		  p->data    = parse_arg->vardata2[varID];
+		  p->tmpvar  = 0;
+
+		  ex_copy(p, rnode);
+
+		  if ( rnode->tmpvar ) free(rnode->data);
+		}
+	    }
+
+	  break;
+        case UMINUS:    
+	  if ( parse_arg->init )
+	    {
+	      expr_run(p->u.opr.op[0], parse_arg);
+
+	      if ( parse_arg->debug )
+		printf("\tneg\n");
+	    }
+	  else
+	    {
+	      rnode = ex_uminus(expr_run(p->u.opr.op[0], parse_arg));
+	    }
+
+	  break;
+        default:
+	  if ( parse_arg->init )
+	    {
+	      expr_run(p->u.opr.op[0], parse_arg);
+	      expr_run(p->u.opr.op[1], parse_arg);
+	      if ( parse_arg->debug )
+		switch( p->u.opr.oper )
+		  {
+		  case '+':  printf("\tadd\n"); break;
+		  case '-':  printf("\tsub\n"); break;
+		  case '*':  printf("\tmul\n"); break;
+		  case '/':  printf("\tdiv\n"); break;
+		  case '<':  printf("\tcompLT\n"); break;
+		  case '>':  printf("\tcompGT\n"); break;
+		  case GE:   printf("\tcompGE\n"); break;
+		  case LE:   printf("\tcompLE\n"); break;
+		  case NE:   printf("\tcompNE\n"); break;
+		  case EQ:   printf("\tcompEQ\n"); break;
+		  }
+	    }
+	  else
+	    {
+	      rnode = expr(p->u.opr.oper, expr_run(p->u.opr.op[0], parse_arg),
+			                  expr_run(p->u.opr.op[1], parse_arg));
+	    }
+        }
+    }
+
+  return (rnode);
+}
diff --git a/src/expr.h b/src/expr.h
new file mode 100644
index 0000000..3ef05b0
--- /dev/null
+++ b/src/expr.h
@@ -0,0 +1,105 @@
+#include <stdio.h>
+
+#ifndef fileno
+int fileno(FILE *stream);
+#endif
+
+#ifndef strdupx
+#ifndef strdup
+char *strdup(const char *s);
+#endif
+#define strdupx  strdup
+/*
+#define strdupx(s)			          \
+({					      	  \
+   const char *__old = (s);			  \
+   size_t __len = strlen(__old) + 1;		  \
+   char *__new = (char *) malloc(__len);	  \
+   (char *) memcpy(__new, __old, __len);	  \
+})
+*/
+#endif
+
+
+typedef enum { typeCon, typeVar, typeFun, typeOpr } nodeEnum;
+
+/* constants */
+typedef struct {
+  double value;               /* value of constant */
+} conNodeType;
+
+/* variables */
+typedef struct {
+  char *nm;                   /* variable name */
+} varNodeType;
+
+/* functions */
+typedef struct {
+  char *name;                 /* function name */
+  struct nodeTypeTag *op;     /* operand       */
+} funNodeType;
+
+/* operators */
+typedef struct {
+  int oper;                   /* operator              */
+  int nops;                   /* number of operands    */
+  struct nodeTypeTag *op[1];  /* operands (expandable) */
+} oprNodeType;
+
+typedef struct nodeTypeTag {
+  int tmpvar;
+  int gridID, zaxisID;
+  int nmiss;
+  double missval;
+  double *data;
+  nodeEnum type;              /* type of node */
+
+  /* union must be last entry in nodeType */
+  /* because operNodeType may dynamically increase */
+  union {
+    conNodeType con;          /* constants   */
+    varNodeType var;          /* variables   */
+    funNodeType fun;          /* functions   */
+    oprNodeType opr;          /* operators   */
+  } u;
+} nodeType;
+
+#define MAX_VARS 1024
+
+typedef struct{ /* prs_sct */
+  int    vlistID1, vlistID2;
+  int    nvars1, nvars2;
+  int    nmiss[MAX_VARS];
+  int    varID[MAX_VARS];
+  int    var_needed[MAX_VARS];
+  char   *var[MAX_VARS];
+  int    init;
+  int    debug;
+  int    gridID2;
+  int    zaxisID2;
+  int    tsteptype2;
+  double missval2;
+  double **vardata1, **vardata2;
+} parse_parm_t;
+
+
+typedef union{
+    double cvalue;              /* constant value */
+    char *varnm;                /* variable name  */
+    char *fname;                /* function name  */
+    nodeType *nPtr;             /* node pointer   */
+} stype_t;
+
+
+#define YYSTYPE        stype_t
+#define YY_EXTRA_TYPE  parse_parm_t *
+
+#define YY_DECL int yylex(YYSTYPE *yylval_param, parse_parm_t *parse_arg, void *yyscanner)
+YY_DECL;
+
+int  yyparse(parse_parm_t *parse_arg, void*);
+void yyerror(void *parse_arg, void *scanner, char *errstr);
+
+int  yylex_init(void **);
+int  yylex_destroy(void *);
+void yyset_extra(YY_EXTRA_TYPE, void *);
diff --git a/src/expr_lex.c b/src/expr_lex.c
new file mode 100644
index 0000000..62d7cf7
--- /dev/null
+++ b/src/expr_lex.c
@@ -0,0 +1,2069 @@
+#line 2 "expr_lex.c"
+
+#line 4 "expr_lex.c"
+
+#define  YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with  platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types. 
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t; 
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+#endif /* ! C99 */
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN               (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN              (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN              (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX               (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX              (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX              (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX              (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX             (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX             (4294967295U)
+#endif
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else	/* ! __cplusplus */
+
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
+#define YY_USE_CONST
+
+#endif	/* defined (__STDC__) */
+#endif	/* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index.  If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* For convenience, these vars (plus the bison vars far below)
+   are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+/* Enter a start condition.  This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yyg->yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.  The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yyg->yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE yyrestart(yyin ,yyscanner )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#define YY_BUF_SIZE 16384
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE   ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+    #define YY_LESS_LINENO(n)
+    
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		*yy_cp = yyg->yy_hold_char; \
+		YY_RESTORE_YY_MORE_OFFSET \
+		yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+		YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+		} \
+	while ( 0 )
+
+#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+	{
+	FILE *yy_input_file;
+
+	char *yy_ch_buf;		/* input buffer */
+	char *yy_buf_pos;		/* current position in input buffer */
+
+	/* Size of input buffer in bytes, not including room for EOB
+	 * characters.
+	 */
+	yy_size_t yy_buf_size;
+
+	/* Number of characters read into yy_ch_buf, not including EOB
+	 * characters.
+	 */
+	int yy_n_chars;
+
+	/* Whether we "own" the buffer - i.e., we know we created it,
+	 * and can realloc() it to grow it, and should free() it to
+	 * delete it.
+	 */
+	int yy_is_our_buffer;
+
+	/* Whether this is an "interactive" input source; if so, and
+	 * if we're using stdio for input, then we want to use getc()
+	 * instead of fread(), to make sure we stop fetching input after
+	 * each newline.
+	 */
+	int yy_is_interactive;
+
+	/* Whether we're considered to be at the beginning of a line.
+	 * If so, '^' rules will be active on the next match, otherwise
+	 * not.
+	 */
+	int yy_at_bol;
+
+    int yy_bs_lineno; /**< The line count. */
+    int yy_bs_column; /**< The column count. */
+    
+	/* Whether to try to fill the input buffer when we reach the
+	 * end of it.
+	 */
+	int yy_fill_buffer;
+
+	int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+	/* When an EOF's been seen but there's still some text to process
+	 * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+	 * shouldn't try reading from the input source any more.  We might
+	 * still have a bunch of tokens to match, though, because of
+	 * possible backing-up.
+	 *
+	 * When we actually see the EOF, we change the status to "new"
+	 * (via yyrestart()), so that the user can continue scanning by
+	 * just pointing yyin at a new input file.
+	 */
+#define YY_BUFFER_EOF_PENDING 2
+
+	};
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
+                          ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
+                          : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
+
+void yyrestart (FILE *input_file ,yyscan_t yyscanner );
+void yy_switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_create_buffer (FILE *file,int size ,yyscan_t yyscanner );
+void yy_delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void yy_flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+void yypop_buffer_state (yyscan_t yyscanner );
+
+static void yyensure_buffer_stack (yyscan_t yyscanner );
+static void yy_load_buffer_state (yyscan_t yyscanner );
+static void yy_init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
+
+#define YY_FLUSH_BUFFER yy_flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+
+YY_BUFFER_STATE yy_scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+YY_BUFFER_STATE yy_scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+
+void *yyalloc (yy_size_t ,yyscan_t yyscanner );
+void *yyrealloc (void *,yy_size_t ,yyscan_t yyscanner );
+void yyfree (void * ,yyscan_t yyscanner );
+
+#define yy_new_buffer yy_create_buffer
+
+#define yy_set_interactive(is_interactive) \
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){ \
+        yyensure_buffer_stack (yyscanner); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+	}
+
+#define yy_set_bol(at_bol) \
+	{ \
+	if ( ! YY_CURRENT_BUFFER ){\
+        yyensure_buffer_stack (yyscanner); \
+		YY_CURRENT_BUFFER_LVALUE =    \
+            yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+	} \
+	YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+	}
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
+
+#define yywrap(n) 1
+#define YY_SKIP_YYWRAP
+
+typedef unsigned char YY_CHAR;
+
+typedef int yy_state_type;
+
+#define yytext_ptr yytext_r
+
+static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state  ,yyscan_t yyscanner);
+static int yy_get_next_buffer (yyscan_t yyscanner );
+static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+	yyg->yytext_ptr = yy_bp; \
+	yyleng = (size_t) (yy_cp - yy_bp); \
+	yyg->yy_hold_char = *yy_cp; \
+	*yy_cp = '\0'; \
+	yyg->yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 14
+#define YY_END_OF_BUFFER 15
+/* This struct is not used in this scanner,
+   but its presence is necessary. */
+struct yy_trans_info
+	{
+	flex_int32_t yy_verify;
+	flex_int32_t yy_nxt;
+	};
+static yyconst flex_int16_t yy_acclist[84] =
+    {   0,
+        4,    4,   15,   13,   14,   12,   13,   14,   12,   14,
+       13,   14,    1,   13,   14,    7,   13,   14,    4,    7,
+       13,   14,    4,   13,   14,    7,   13,   14,    7,   13,
+       14,    7,   13,   14,    6,   13,   14,16389,    4,    6,
+       13,   14,16389,    6,   13,   14,16389,    6,   13,   14,
+    16389,   12,   11,    1,    4,    4,    4,    4,    9,   10,
+        8, 8197,    6,16389,    4,    6,16389,    6,16389,    4,
+        4,    4,    6,16389,    3,    6,16389,    6,16389,    4,
+        2,    6,16389
+    } ;
+
+static yyconst flex_int16_t yy_accept[47] =
+    {   0,
+        1,    2,    3,    4,    6,    9,   11,   13,   16,   19,
+       23,   26,   29,   32,   35,   39,   44,   48,   52,   53,
+       54,   55,   56,   57,   57,   58,   59,   59,   60,   61,
+       62,   62,   63,   65,   65,   68,   70,   70,   71,   72,
+       75,   78,   80,   81,   84,   84
+    } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    2,    3,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    4,    5,    1,    6,    1,    1,    1,    1,    7,
+        8,    8,    9,    1,    9,   10,    8,   11,   11,   11,
+       11,   11,   11,   11,   11,   11,   11,    1,    8,   12,
+       13,   14,    1,    1,   15,   15,   15,   16,   17,   15,
+       15,   15,   18,   15,   15,   16,   19,   15,   15,   20,
+       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
+        1,    1,    1,    8,   21,    1,   15,   15,   15,   16,
+
+       22,   15,   15,   15,   15,   15,   15,   16,   15,   15,
+       15,   15,   15,   15,   15,   15,   15,   15,   15,   15,
+       15,   15,    8,    1,    8,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1
+    } ;
+
+static yyconst flex_int32_t yy_meta[23] =
+    {   0,
+        1,    1,    2,    3,    1,    1,    3,    1,    1,    1,
+        3,    1,    1,    1,    3,    3,    3,    3,    3,    3,
+        3,    3
+    } ;
+
+static yyconst flex_int16_t yy_base[48] =
+    {   0,
+        0,    0,   82,   83,   21,   24,   68,    0,   83,   18,
+       31,   67,   66,   65,   26,   32,   50,   39,   47,   83,
+        0,    0,   83,   47,    0,    0,   53,   83,   83,   83,
+       48,   83,   56,   65,   22,   46,   64,   21,   54,   52,
+       48,   50,   83,   24,   83,   71,   41
+    } ;
+
+static yyconst flex_int16_t yy_def[48] =
+    {   0,
+       45,    1,   45,   45,   45,   45,   45,   46,   45,   45,
+       45,   45,   45,   45,   47,   47,   47,   47,   45,   45,
+       46,   10,   45,   45,   10,   11,   45,   45,   45,   45,
+       45,   45,   18,   45,   17,   18,   45,   45,   45,   18,
+       18,   18,   45,   18,    0,   45,   45
+    } ;
+
+static yyconst flex_int16_t yy_nxt[106] =
+    {   0,
+        4,    5,    6,    5,    7,    8,    9,    9,    9,   10,
+       11,   12,   13,   14,   15,   16,   17,   15,   18,   15,
+       15,   17,   19,   19,   19,   19,   19,   19,   22,   31,
+       45,   38,   32,   23,   24,   31,   23,   40,   32,   24,
+       25,   26,   31,   33,   33,   32,   23,   27,   19,   19,
+       19,   31,   27,   31,   32,   37,   32,   38,   34,   36,
+       35,   34,   41,   39,   39,   42,   33,   44,   33,   43,
+       33,   21,   33,   21,   38,   39,   33,   30,   29,   28,
+       20,   45,    3,   45,   45,   45,   45,   45,   45,   45,
+       45,   45,   45,   45,   45,   45,   45,   45,   45,   45,
+
+       45,   45,   45,   45,   45
+    } ;
+
+static yyconst flex_int16_t yy_chk[106] =
+    {   0,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    1,    1,    1,    1,    1,    1,    1,    1,
+        1,    1,    5,    5,    5,    6,    6,    6,   10,   15,
+       35,   38,   15,   10,   10,   16,   38,   35,   16,   10,
+       11,   11,   18,   47,   44,   18,   11,   11,   19,   19,
+       19,   31,   11,   17,   31,   24,   17,   24,   17,   18,
+       17,   27,   36,   27,   39,   36,   36,   42,   41,   39,
+       42,   46,   40,   46,   37,   34,   33,   14,   13,   12,
+        7,    3,   45,   45,   45,   45,   45,   45,   45,   45,
+       45,   45,   45,   45,   45,   45,   45,   45,   45,   45,
+
+       45,   45,   45,   45,   45
+    } ;
+
+#define YY_TRAILING_MASK 0x2000
+#define YY_TRAILING_HEAD_MASK 0x4000
+#define REJECT \
+{ \
+*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */ \
+yy_cp = yyg->yy_full_match; /* restore poss. backed-over text */ \
+yyg->yy_lp = yyg->yy_full_lp; /* restore orig. accepting pos. */ \
+yyg->yy_state_ptr = yyg->yy_full_state; /* restore orig. state */ \
+yy_current_state = *yyg->yy_state_ptr; /* restore curr. state */ \
+++yyg->yy_lp; \
+goto find_rule; \
+}
+
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+#line 1 "expr_lex.l"
+#line 2 "expr_lex.l"
+#include <string.h>
+#include <stdlib.h>
+#include <math.h>
+
+#ifndef M_E
+#define M_E		2.7182818284590452354	/* e */
+#endif
+
+#ifndef M_PI
+#define M_PI		3.14159265358979323846	/* pi */
+#endif
+
+#include "expr.h"
+#include "expr_yacc.h"
+
+/* Definitions:  LMB92 p. 153
+   Definitions are named regular expressions, e.g., DGT [0-9]
+   Definitions enclosed in braces in rules section, e.g. {DGT}, are interpreted literally
+   DGT [0-9] Digit
+   LPH [A-Za-z_] Alphabetic character
+   LPHDGT [A-Za-z0-9_] Alphanumeric character
+   XPN [eE][+-]?[0-9]+ Real number Exponent */
+#line 513 "expr_lex.c"
+
+#define INITIAL 0
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#ifndef YY_EXTRA_TYPE
+#define YY_EXTRA_TYPE void *
+#endif
+
+/* Holds the entire state of the reentrant scanner. */
+struct yyguts_t
+    {
+
+    /* User-defined. Not touched by flex. */
+    YY_EXTRA_TYPE yyextra_r;
+
+    /* The rest are the same as the globals declared in the non-reentrant scanner. */
+    FILE *yyin_r, *yyout_r;
+    size_t yy_buffer_stack_top; /**< index of top of stack. */
+    size_t yy_buffer_stack_max; /**< capacity of stack. */
+    YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
+    char yy_hold_char;
+    int yy_n_chars;
+    int yyleng_r;
+    char *yy_c_buf_p;
+    int yy_init;
+    int yy_start;
+    int yy_did_buffer_switch_on_eof;
+    int yy_start_stack_ptr;
+    int yy_start_stack_depth;
+    int *yy_start_stack;
+    yy_state_type yy_last_accepting_state;
+    char* yy_last_accepting_cpos;
+
+    int yylineno_r;
+    int yy_flex_debug_r;
+
+    yy_state_type *yy_state_buf;
+    yy_state_type *yy_state_ptr;
+    char *yy_full_match;
+    int yy_lp;
+
+    /* These are only needed for trailing context rules,
+     * but there's no conditional variable for that yet. */
+    int yy_looking_for_trail_begin;
+    int yy_full_lp;
+    int *yy_full_state;
+
+    char *yytext_r;
+    int yy_more_flag;
+    int yy_more_len;
+
+    YYSTYPE * yylval_r;
+
+    }; /* end struct yyguts_t */
+
+static int yy_init_globals (yyscan_t yyscanner );
+
+    /* This must go here because YYSTYPE and YYLTYPE are included
+     * from bison output in section 1.*/
+    #    define yylval yyg->yylval_r
+    
+int yylex_init (yyscan_t* scanner);
+
+int yylex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+
+/* Accessor methods to globals.
+   These are made visible to non-reentrant scanners for convenience. */
+
+int yylex_destroy (yyscan_t yyscanner );
+
+int yyget_debug (yyscan_t yyscanner );
+
+void yyset_debug (int debug_flag ,yyscan_t yyscanner );
+
+YY_EXTRA_TYPE yyget_extra (yyscan_t yyscanner );
+
+void yyset_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+
+FILE *yyget_in (yyscan_t yyscanner );
+
+void yyset_in  (FILE * in_str ,yyscan_t yyscanner );
+
+FILE *yyget_out (yyscan_t yyscanner );
+
+void yyset_out  (FILE * out_str ,yyscan_t yyscanner );
+
+int yyget_leng (yyscan_t yyscanner );
+
+char *yyget_text (yyscan_t yyscanner );
+
+int yyget_lineno (yyscan_t yyscanner );
+
+void yyset_lineno (int line_number ,yyscan_t yyscanner );
+
+YYSTYPE * yyget_lval (yyscan_t yyscanner );
+
+void yyset_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int yywrap (yyscan_t yyscanner );
+#else
+extern int yywrap (yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (yyscan_t yyscanner );
+#else
+static int input (yyscan_t yyscanner );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf".  number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+		{ \
+		int c = '*'; \
+		int n; \
+		for ( n = 0; n < max_size && \
+			     (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+			buf[n] = (char) c; \
+		if ( c == '\n' ) \
+			buf[n++] = (char) c; \
+		if ( c == EOF && ferror( yyin ) ) \
+			YY_FATAL_ERROR( "input in flex scanner failed" ); \
+		result = n; \
+		} \
+	else \
+		{ \
+		errno=0; \
+		while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+			{ \
+			if( errno != EINTR) \
+				{ \
+				YY_FATAL_ERROR( "input in flex scanner failed" ); \
+				break; \
+				} \
+			errno=0; \
+			clearerr(yyin); \
+			} \
+		}\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int yylex \
+               (YYSTYPE * yylval_param ,yyscan_t yyscanner);
+
+#define YY_DECL int yylex \
+               (YYSTYPE * yylval_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+	YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+	register yy_state_type yy_current_state;
+	register char *yy_cp, *yy_bp;
+	register int yy_act;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+#line 35 "expr_lex.l"
+
+
+#line 758 "expr_lex.c"
+
+    yylval = yylval_param;
+
+	if ( !yyg->yy_init )
+		{
+		yyg->yy_init = 1;
+
+#ifdef YY_USER_INIT
+		YY_USER_INIT;
+#endif
+
+        /* Create the reject buffer large enough to save one state per allowed character. */
+        if ( ! yyg->yy_state_buf )
+            yyg->yy_state_buf = (yy_state_type *)yyalloc(YY_STATE_BUF_SIZE  ,yyscanner);
+            if ( ! yyg->yy_state_buf )
+                YY_FATAL_ERROR( "out of dynamic memory in yylex()" );
+
+		if ( ! yyg->yy_start )
+			yyg->yy_start = 1;	/* first start state */
+
+		if ( ! yyin )
+			yyin = stdin;
+
+		if ( ! yyout )
+			yyout = stdout;
+
+		if ( ! YY_CURRENT_BUFFER ) {
+			yyensure_buffer_stack (yyscanner);
+			YY_CURRENT_BUFFER_LVALUE =
+				yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+		}
+
+		yy_load_buffer_state(yyscanner );
+		}
+
+	while ( 1 )		/* loops until end-of-file is reached */
+		{
+		yy_cp = yyg->yy_c_buf_p;
+
+		/* Support of yytext. */
+		*yy_cp = yyg->yy_hold_char;
+
+		/* yy_bp points to the position in yy_ch_buf of the start of
+		 * the current run.
+		 */
+		yy_bp = yy_cp;
+
+		yy_current_state = yyg->yy_start;
+
+		yyg->yy_state_ptr = yyg->yy_state_buf;
+		*yyg->yy_state_ptr++ = yy_current_state;
+
+yy_match:
+		do
+			{
+			register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+			while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+				{
+				yy_current_state = (int) yy_def[yy_current_state];
+				if ( yy_current_state >= 46 )
+					yy_c = yy_meta[(unsigned int) yy_c];
+				}
+			yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+			*yyg->yy_state_ptr++ = yy_current_state;
+			++yy_cp;
+			}
+		while ( yy_base[yy_current_state] != 83 );
+
+yy_find_action:
+		yy_current_state = *--yyg->yy_state_ptr;
+		yyg->yy_lp = yy_accept[yy_current_state];
+find_rule: /* we branch to this label when backing up */
+		for ( ; ; ) /* until we find what rule we matched */
+			{
+			if ( yyg->yy_lp && yyg->yy_lp < yy_accept[yy_current_state + 1] )
+				{
+				yy_act = yy_acclist[yyg->yy_lp];
+				if ( yy_act & YY_TRAILING_HEAD_MASK ||
+				     yyg->yy_looking_for_trail_begin )
+					{
+					if ( yy_act == yyg->yy_looking_for_trail_begin )
+						{
+						yyg->yy_looking_for_trail_begin = 0;
+						yy_act &= ~YY_TRAILING_HEAD_MASK;
+						break;
+						}
+					}
+				else if ( yy_act & YY_TRAILING_MASK )
+					{
+					yyg->yy_looking_for_trail_begin = yy_act & ~YY_TRAILING_MASK;
+					yyg->yy_looking_for_trail_begin |= YY_TRAILING_HEAD_MASK;
+					}
+				else
+					{
+					yyg->yy_full_match = yy_cp;
+					yyg->yy_full_state = yyg->yy_state_ptr;
+					yyg->yy_full_lp = yyg->yy_lp;
+					break;
+					}
+				++yyg->yy_lp;
+				goto find_rule;
+				}
+			--yy_cp;
+			yy_current_state = *--yyg->yy_state_ptr;
+			yyg->yy_lp = yy_accept[yy_current_state];
+			}
+
+		YY_DO_BEFORE_ACTION;
+
+do_action:	/* This label is used only to access EOF actions. */
+
+		switch ( yy_act )
+	{ /* beginning of action switch */
+case 1:
+YY_RULE_SETUP
+#line 37 "expr_lex.l"
+; /* ignore comments */
+	YY_BREAK
+case 2:
+YY_RULE_SETUP
+#line 39 "expr_lex.l"
+{
+                yylval->cvalue = M_PI;
+                return CONSTANT;
+             }
+	YY_BREAK
+case 3:
+YY_RULE_SETUP
+#line 44 "expr_lex.l"
+{
+                yylval->cvalue = M_E;
+                return CONSTANT;
+             }
+	YY_BREAK
+case 4:
+YY_RULE_SETUP
+#line 49 "expr_lex.l"
+{
+               /* constant */
+               /* NB: Tempted to prepend lexer expressions for floats and doubles with [+-]? 
+                so that unary plus/minus is handled in lexer rather than parser.
+                However, this has unintended side effects so let parser handle it for now */
+                yylval->cvalue = strtod(yytext, (char **)NULL);
+                return CONSTANT;
+             } /* end constant */
+	YY_BREAK
+case 5:
+YY_RULE_SETUP
+#line 59 "expr_lex.l"
+{
+                yylval->fname = (char *) strdupx(yytext);
+                return FUNCTION;
+             } /* end functions */
+	YY_BREAK
+case 6:
+YY_RULE_SETUP
+#line 65 "expr_lex.l"
+{
+                yylval->varnm = (char *) strdupx(yytext);
+                return VARIABLE;
+             }
+	YY_BREAK
+case 7:
+YY_RULE_SETUP
+#line 71 "expr_lex.l"
+{
+                return *yytext;
+             }
+	YY_BREAK
+case 8:
+YY_RULE_SETUP
+#line 75 "expr_lex.l"
+return GE;
+	YY_BREAK
+case 9:
+YY_RULE_SETUP
+#line 76 "expr_lex.l"
+return LE;
+	YY_BREAK
+case 10:
+YY_RULE_SETUP
+#line 77 "expr_lex.l"
+return EQ;
+	YY_BREAK
+case 11:
+YY_RULE_SETUP
+#line 78 "expr_lex.l"
+return NE;
+	YY_BREAK
+case 12:
+/* rule 12 can match eol */
+YY_RULE_SETUP
+#line 80 "expr_lex.l"
+;       /* ignore whitespace */
+	YY_BREAK
+case 13:
+YY_RULE_SETUP
+#line 82 "expr_lex.l"
+yyerror(NULL, NULL, "Unknown character");
+	YY_BREAK
+case 14:
+YY_RULE_SETUP
+#line 83 "expr_lex.l"
+ECHO;
+	YY_BREAK
+#line 964 "expr_lex.c"
+			case YY_STATE_EOF(INITIAL):
+				yyterminate();
+
+	case YY_END_OF_BUFFER:
+		{
+		/* Amount of text matched not including the EOB char. */
+		int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+		/* Undo the effects of YY_DO_BEFORE_ACTION. */
+		*yy_cp = yyg->yy_hold_char;
+		YY_RESTORE_YY_MORE_OFFSET
+
+		if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+			{
+			/* We're scanning a new file or input source.  It's
+			 * possible that this happened because the user
+			 * just pointed yyin at a new source and called
+			 * yylex().  If so, then we have to assure
+			 * consistency between YY_CURRENT_BUFFER and our
+			 * globals.  Here is the right place to do so, because
+			 * this is the first action (other than possibly a
+			 * back-up) that will match for the new input source.
+			 */
+			yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+			YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+			}
+
+		/* Note that here we test for yy_c_buf_p "<=" to the position
+		 * of the first EOB in the buffer, since yy_c_buf_p will
+		 * already have been incremented past the NUL character
+		 * (since all states make transitions on EOB to the
+		 * end-of-buffer state).  Contrast this with the test
+		 * in input().
+		 */
+		if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+			{ /* This was really a NUL. */
+			yy_state_type yy_next_state;
+
+			yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
+
+			yy_current_state = yy_get_previous_state( yyscanner );
+
+			/* Okay, we're now positioned to make the NUL
+			 * transition.  We couldn't have
+			 * yy_get_previous_state() go ahead and do it
+			 * for us because it doesn't know how to deal
+			 * with the possibility of jamming (and we don't
+			 * want to build jamming into it because then it
+			 * will run more slowly).
+			 */
+
+			yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
+
+			yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+
+			if ( yy_next_state )
+				{
+				/* Consume the NUL. */
+				yy_cp = ++yyg->yy_c_buf_p;
+				yy_current_state = yy_next_state;
+				goto yy_match;
+				}
+
+			else
+				{
+				yy_cp = yyg->yy_c_buf_p;
+				goto yy_find_action;
+				}
+			}
+
+		else switch ( yy_get_next_buffer( yyscanner ) )
+			{
+			case EOB_ACT_END_OF_FILE:
+				{
+				yyg->yy_did_buffer_switch_on_eof = 0;
+
+				if ( yywrap(yyscanner ) )
+					{
+					/* Note: because we've taken care in
+					 * yy_get_next_buffer() to have set up
+					 * yytext, we can now set up
+					 * yy_c_buf_p so that if some total
+					 * hoser (like flex itself) wants to
+					 * call the scanner after we return the
+					 * YY_NULL, it'll still work - another
+					 * YY_NULL will get returned.
+					 */
+					yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
+
+					yy_act = YY_STATE_EOF(YY_START);
+					goto do_action;
+					}
+
+				else
+					{
+					if ( ! yyg->yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+					}
+				break;
+				}
+
+			case EOB_ACT_CONTINUE_SCAN:
+				yyg->yy_c_buf_p =
+					yyg->yytext_ptr + yy_amount_of_matched_text;
+
+				yy_current_state = yy_get_previous_state( yyscanner );
+
+				yy_cp = yyg->yy_c_buf_p;
+				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				goto yy_match;
+
+			case EOB_ACT_LAST_MATCH:
+				yyg->yy_c_buf_p =
+				&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
+
+				yy_current_state = yy_get_previous_state( yyscanner );
+
+				yy_cp = yyg->yy_c_buf_p;
+				yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+				goto yy_find_action;
+			}
+		break;
+		}
+
+	default:
+		YY_FATAL_ERROR(
+			"fatal flex scanner internal error--no action found" );
+	} /* end of action switch */
+		} /* end of scanning one token */
+} /* end of yylex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ *	EOB_ACT_LAST_MATCH -
+ *	EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ *	EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+	register char *source = yyg->yytext_ptr;
+	register int number_to_move, i;
+	int ret_val;
+
+	if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
+		YY_FATAL_ERROR(
+		"fatal flex scanner internal error--end of buffer missed" );
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+		{ /* Don't try to fill the buffer, so this is an EOF. */
+		if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
+			{
+			/* We matched a single character, the EOB, so
+			 * treat this as a final EOF.
+			 */
+			return EOB_ACT_END_OF_FILE;
+			}
+
+		else
+			{
+			/* We matched some text prior to the EOB, first
+			 * process it.
+			 */
+			return EOB_ACT_LAST_MATCH;
+			}
+		}
+
+	/* Try to read more data. */
+
+	/* First move last chars to start of buffer. */
+	number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+
+	for ( i = 0; i < number_to_move; ++i )
+		*(dest++) = *(source++);
+
+	if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+		/* don't do the read, it's not guaranteed to return an EOF,
+		 * just force an EOF
+		 */
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
+
+	else
+		{
+			int num_to_read =
+			YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+		while ( num_to_read <= 0 )
+			{ /* Not enough room in the buffer - grow it. */
+
+			YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+
+			}
+
+		if ( num_to_read > YY_READ_BUF_SIZE )
+			num_to_read = YY_READ_BUF_SIZE;
+
+		/* Read in more data. */
+		YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+			yyg->yy_n_chars, (size_t) num_to_read );
+
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+		}
+
+	if ( yyg->yy_n_chars == 0 )
+		{
+		if ( number_to_move == YY_MORE_ADJ )
+			{
+			ret_val = EOB_ACT_END_OF_FILE;
+			yyrestart(yyin  ,yyscanner);
+			}
+
+		else
+			{
+			ret_val = EOB_ACT_LAST_MATCH;
+			YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+				YY_BUFFER_EOF_PENDING;
+			}
+		}
+
+	else
+		ret_val = EOB_ACT_CONTINUE_SCAN;
+
+	if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+		/* Extend the array by 50%, plus the number we really need. */
+		yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+		YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) yyrealloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+		if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+			YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+	}
+
+	yyg->yy_n_chars += number_to_move;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+	YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+	yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+	return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+    static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
+{
+	register yy_state_type yy_current_state;
+	register char *yy_cp;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	yy_current_state = yyg->yy_start;
+
+	yyg->yy_state_ptr = yyg->yy_state_buf;
+	*yyg->yy_state_ptr++ = yy_current_state;
+
+	for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
+		{
+		register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+		while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+			{
+			yy_current_state = (int) yy_def[yy_current_state];
+			if ( yy_current_state >= 46 )
+				yy_c = yy_meta[(unsigned int) yy_c];
+			}
+		yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+		*yyg->yy_state_ptr++ = yy_current_state;
+		}
+
+	return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ *	next_state = yy_try_NUL_trans( current_state );
+ */
+    static yy_state_type yy_try_NUL_trans  (yy_state_type yy_current_state , yyscan_t yyscanner)
+{
+	register int yy_is_jam;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
+
+	register YY_CHAR yy_c = 1;
+	while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+		{
+		yy_current_state = (int) yy_def[yy_current_state];
+		if ( yy_current_state >= 46 )
+			yy_c = yy_meta[(unsigned int) yy_c];
+		}
+	yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+	yy_is_jam = (yy_current_state == 45);
+	if ( ! yy_is_jam )
+		*yyg->yy_state_ptr++ = yy_current_state;
+
+	return yy_is_jam ? 0 : yy_current_state;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+    static int yyinput (yyscan_t yyscanner)
+#else
+    static int input  (yyscan_t yyscanner)
+#endif
+
+{
+	int c;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	*yyg->yy_c_buf_p = yyg->yy_hold_char;
+
+	if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+		{
+		/* yy_c_buf_p now points to the character we want to return.
+		 * If this occurs *before* the EOB characters, then it's a
+		 * valid NUL; if not, then we've hit the end of the buffer.
+		 */
+		if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+			/* This was really a NUL. */
+			*yyg->yy_c_buf_p = '\0';
+
+		else
+			{ /* need more input */
+			int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+			++yyg->yy_c_buf_p;
+
+			switch ( yy_get_next_buffer( yyscanner ) )
+				{
+				case EOB_ACT_LAST_MATCH:
+					/* This happens because yy_g_n_b()
+					 * sees that we've accumulated a
+					 * token and flags that we need to
+					 * try matching the token before
+					 * proceeding.  But for input(),
+					 * there's no matching to consider.
+					 * So convert the EOB_ACT_LAST_MATCH
+					 * to EOB_ACT_END_OF_FILE.
+					 */
+
+					/* Reset buffer status. */
+					yyrestart(yyin ,yyscanner);
+
+					/*FALLTHROUGH*/
+
+				case EOB_ACT_END_OF_FILE:
+					{
+					if ( yywrap(yyscanner ) )
+						return EOF;
+
+					if ( ! yyg->yy_did_buffer_switch_on_eof )
+						YY_NEW_FILE;
+#ifdef __cplusplus
+					return yyinput(yyscanner);
+#else
+					return input(yyscanner);
+#endif
+					}
+
+				case EOB_ACT_CONTINUE_SCAN:
+					yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
+					break;
+				}
+			}
+		}
+
+	c = *(unsigned char *) yyg->yy_c_buf_p;	/* cast for 8-bit char's */
+	*yyg->yy_c_buf_p = '\0';	/* preserve yytext */
+	yyg->yy_hold_char = *++yyg->yy_c_buf_p;
+
+	return c;
+}
+#endif	/* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * @param yyscanner The scanner object.
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+    void yyrestart  (FILE * input_file , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	if ( ! YY_CURRENT_BUFFER ){
+        yyensure_buffer_stack (yyscanner);
+		YY_CURRENT_BUFFER_LVALUE =
+            yy_create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+	}
+
+	yy_init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
+	yy_load_buffer_state(yyscanner );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * @param yyscanner The scanner object.
+ */
+    void yy_switch_to_buffer  (YY_BUFFER_STATE  new_buffer , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	/* TODO. We should be able to replace this entire function body
+	 * with
+	 *		yypop_buffer_state();
+	 *		yypush_buffer_state(new_buffer);
+     */
+	yyensure_buffer_stack (yyscanner);
+	if ( YY_CURRENT_BUFFER == new_buffer )
+		return;
+
+	if ( YY_CURRENT_BUFFER )
+		{
+		/* Flush out information for old buffer. */
+		*yyg->yy_c_buf_p = yyg->yy_hold_char;
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+		}
+
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+	yy_load_buffer_state(yyscanner );
+
+	/* We don't actually know whether we did this switch during
+	 * EOF (yywrap()) processing, but the only time this flag
+	 * is looked at is after yywrap() is called, so it's safe
+	 * to go ahead and always set it.
+	 */
+	yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+static void yy_load_buffer_state  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+	yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+	yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+	yyg->yy_hold_char = *yyg->yy_c_buf_p;
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * @param yyscanner The scanner object.
+ * @return the allocated buffer state.
+ */
+    YY_BUFFER_STATE yy_create_buffer  (FILE * file, int  size , yyscan_t yyscanner)
+{
+	YY_BUFFER_STATE b;
+    
+	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_buf_size = size;
+
+	/* yy_ch_buf has to be 2 characters longer than the size given because
+	 * we need to put in 2 end-of-buffer characters.
+	 */
+	b->yy_ch_buf = (char *) yyalloc(b->yy_buf_size + 2 ,yyscanner );
+	if ( ! b->yy_ch_buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+	b->yy_is_our_buffer = 1;
+
+	yy_init_buffer(b,file ,yyscanner);
+
+	return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with yy_create_buffer()
+ * @param yyscanner The scanner object.
+ */
+    void yy_delete_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	if ( ! b )
+		return;
+
+	if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+		YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+	if ( b->yy_is_our_buffer )
+		yyfree((void *) b->yy_ch_buf ,yyscanner );
+
+	yyfree((void *) b ,yyscanner );
+}
+
+#ifndef __cplusplus
+extern int isatty (int );
+#endif /* __cplusplus */
+    
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a yyrestart() or at EOF.
+ */
+    static void yy_init_buffer  (YY_BUFFER_STATE  b, FILE * file , yyscan_t yyscanner)
+
+{
+	int oerrno = errno;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	yy_flush_buffer(b ,yyscanner);
+
+	b->yy_input_file = file;
+	b->yy_fill_buffer = 1;
+
+    /* If b is the current buffer, then yy_init_buffer was _probably_
+     * called from yyrestart() or through yy_get_next_buffer.
+     * In that case, we don't want to reset the lineno or column.
+     */
+    if (b != YY_CURRENT_BUFFER){
+        b->yy_bs_lineno = 1;
+        b->yy_bs_column = 0;
+    }
+
+        b->yy_is_interactive = file ? (isatty( fileno(file) ) > 0) : 0;
+    
+	errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * @param yyscanner The scanner object.
+ */
+    void yy_flush_buffer (YY_BUFFER_STATE  b , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	if ( ! b )
+		return;
+
+	b->yy_n_chars = 0;
+
+	/* We always need two end-of-buffer characters.  The first causes
+	 * a transition to the end-of-buffer state.  The second causes
+	 * a jam in that state.
+	 */
+	b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+	b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+	b->yy_buf_pos = &b->yy_ch_buf[0];
+
+	b->yy_at_bol = 1;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	if ( b == YY_CURRENT_BUFFER )
+		yy_load_buffer_state(yyscanner );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ *  the current state. This function will allocate the stack
+ *  if necessary.
+ *  @param new_buffer The new state.
+ *  @param yyscanner The scanner object.
+ */
+void yypush_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	if (new_buffer == NULL)
+		return;
+
+	yyensure_buffer_stack(yyscanner);
+
+	/* This block is copied from yy_switch_to_buffer. */
+	if ( YY_CURRENT_BUFFER )
+		{
+		/* Flush out information for old buffer. */
+		*yyg->yy_c_buf_p = yyg->yy_hold_char;
+		YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+		YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+		}
+
+	/* Only push if top exists. Otherwise, replace top. */
+	if (YY_CURRENT_BUFFER)
+		yyg->yy_buffer_stack_top++;
+	YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+	/* copied from yy_switch_to_buffer. */
+	yy_load_buffer_state(yyscanner );
+	yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ *  The next element becomes the new top.
+ *  @param yyscanner The scanner object.
+ */
+void yypop_buffer_state (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+	if (!YY_CURRENT_BUFFER)
+		return;
+
+	yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+	YY_CURRENT_BUFFER_LVALUE = NULL;
+	if (yyg->yy_buffer_stack_top > 0)
+		--yyg->yy_buffer_stack_top;
+
+	if (YY_CURRENT_BUFFER) {
+		yy_load_buffer_state(yyscanner );
+		yyg->yy_did_buffer_switch_on_eof = 1;
+	}
+}
+
+/* Allocates the stack if it does not exist.
+ *  Guarantees space for at least one push.
+ */
+static void yyensure_buffer_stack (yyscan_t yyscanner)
+{
+	int num_to_alloc;
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+	if (!yyg->yy_buffer_stack) {
+
+		/* First allocation is just for 2 elements, since we don't know if this
+		 * scanner will even need a stack. We use 2 instead of 1 to avoid an
+		 * immediate realloc on the next call.
+         */
+		num_to_alloc = 1;
+		yyg->yy_buffer_stack = (struct yy_buffer_state**)yyalloc
+								(num_to_alloc * sizeof(struct yy_buffer_state*)
+								, yyscanner);
+		if ( ! yyg->yy_buffer_stack )
+			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+								  
+		memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+				
+		yyg->yy_buffer_stack_max = num_to_alloc;
+		yyg->yy_buffer_stack_top = 0;
+		return;
+	}
+
+	if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
+
+		/* Increase the buffer to prepare for a possible push. */
+		int grow_size = 8 /* arbitrary grow size */;
+
+		num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
+		yyg->yy_buffer_stack = (struct yy_buffer_state**)yyrealloc
+								(yyg->yy_buffer_stack,
+								num_to_alloc * sizeof(struct yy_buffer_state*)
+								, yyscanner);
+		if ( ! yyg->yy_buffer_stack )
+			YY_FATAL_ERROR( "out of dynamic memory in yyensure_buffer_stack()" );
+
+		/* zero only the new slots.*/
+		memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
+		yyg->yy_buffer_stack_max = num_to_alloc;
+	}
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object. 
+ */
+YY_BUFFER_STATE yy_scan_buffer  (char * base, yy_size_t  size , yyscan_t yyscanner)
+{
+	YY_BUFFER_STATE b;
+    
+	if ( size < 2 ||
+	     base[size-2] != YY_END_OF_BUFFER_CHAR ||
+	     base[size-1] != YY_END_OF_BUFFER_CHAR )
+		/* They forgot to leave room for the EOB's. */
+		return 0;
+
+	b = (YY_BUFFER_STATE) yyalloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+	if ( ! b )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_buffer()" );
+
+	b->yy_buf_size = size - 2;	/* "- 2" to take care of EOB's */
+	b->yy_buf_pos = b->yy_ch_buf = base;
+	b->yy_is_our_buffer = 0;
+	b->yy_input_file = 0;
+	b->yy_n_chars = b->yy_buf_size;
+	b->yy_is_interactive = 0;
+	b->yy_at_bol = 1;
+	b->yy_fill_buffer = 0;
+	b->yy_buffer_status = YY_BUFFER_NEW;
+
+	yy_switch_to_buffer(b ,yyscanner );
+
+	return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to yylex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ *       yy_scan_bytes() instead.
+ */
+YY_BUFFER_STATE yy_scan_string (yyconst char * yystr , yyscan_t yyscanner)
+{
+    
+	return yy_scan_bytes(yystr,strlen(yystr) ,yyscanner);
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to yylex() will
+ * scan from a @e copy of @a bytes.
+ * @param bytes the byte buffer to scan
+ * @param len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE yy_scan_bytes  (yyconst char * yybytes, int  _yybytes_len , yyscan_t yyscanner)
+{
+	YY_BUFFER_STATE b;
+	char *buf;
+	yy_size_t n;
+	int i;
+    
+	/* Get memory for full buffer, including space for trailing EOB's. */
+	n = _yybytes_len + 2;
+	buf = (char *) yyalloc(n ,yyscanner );
+	if ( ! buf )
+		YY_FATAL_ERROR( "out of dynamic memory in yy_scan_bytes()" );
+
+	for ( i = 0; i < _yybytes_len; ++i )
+		buf[i] = yybytes[i];
+
+	buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+	b = yy_scan_buffer(buf,n ,yyscanner);
+	if ( ! b )
+		YY_FATAL_ERROR( "bad buffer in yy_scan_bytes()" );
+
+	/* It's okay to grow etc. this buffer, and we should throw it
+	 * away when we're done.
+	 */
+	b->yy_is_our_buffer = 1;
+
+	return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+{
+    	(void) fprintf( stderr, "%s\n", msg );
+	exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+	do \
+		{ \
+		/* Undo effects of setting up yytext. */ \
+        int yyless_macro_arg = (n); \
+        YY_LESS_LINENO(yyless_macro_arg);\
+		yytext[yyleng] = yyg->yy_hold_char; \
+		yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
+		yyg->yy_hold_char = *yyg->yy_c_buf_p; \
+		*yyg->yy_c_buf_p = '\0'; \
+		yyleng = yyless_macro_arg; \
+		} \
+	while ( 0 )
+
+/* Accessor  methods (get/set functions) to struct members. */
+
+/** Get the user-defined data for this scanner.
+ * @param yyscanner The scanner object.
+ */
+YY_EXTRA_TYPE yyget_extra  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yyextra;
+}
+
+/** Get the current line number.
+ * @param yyscanner The scanner object.
+ */
+int yyget_lineno  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    
+        if (! YY_CURRENT_BUFFER)
+            return 0;
+    
+    return yylineno;
+}
+
+/** Get the current column number.
+ * @param yyscanner The scanner object.
+ */
+int yyget_column  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    
+        if (! YY_CURRENT_BUFFER)
+            return 0;
+    
+    return yycolumn;
+}
+
+/** Get the input stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *yyget_in  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yyin;
+}
+
+/** Get the output stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *yyget_out  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yyout;
+}
+
+/** Get the length of the current token.
+ * @param yyscanner The scanner object.
+ */
+int yyget_leng  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yyleng;
+}
+
+/** Get the current token.
+ * @param yyscanner The scanner object.
+ */
+
+char *yyget_text  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yytext;
+}
+
+/** Set the user-defined data. This data is never touched by the scanner.
+ * @param user_defined The data to be associated with this scanner.
+ * @param yyscanner The scanner object.
+ */
+void yyset_extra (YY_EXTRA_TYPE  user_defined , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    yyextra = user_defined ;
+}
+
+/** Set the current line number.
+ * @param line_number
+ * @param yyscanner The scanner object.
+ */
+void yyset_lineno (int  line_number , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+        /* lineno is only valid if an input buffer exists. */
+        if (! YY_CURRENT_BUFFER )
+           yy_fatal_error( "yyset_lineno called with no buffer" , yyscanner); 
+    
+    yylineno = line_number;
+}
+
+/** Set the current column.
+ * @param line_number
+ * @param yyscanner The scanner object.
+ */
+void yyset_column (int  column_no , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+        /* column is only valid if an input buffer exists. */
+        if (! YY_CURRENT_BUFFER )
+           yy_fatal_error( "yyset_column called with no buffer" , yyscanner); 
+    
+    yycolumn = column_no;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * @param yyscanner The scanner object.
+ * @see yy_switch_to_buffer
+ */
+void yyset_in (FILE *  in_str , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    yyin = in_str ;
+}
+
+void yyset_out (FILE *  out_str , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    yyout = out_str ;
+}
+
+int yyget_debug  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yy_flex_debug;
+}
+
+void yyset_debug (int  bdebug , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    yy_flex_debug = bdebug ;
+}
+
+/* Accessor methods for yylval and yylloc */
+
+YYSTYPE * yyget_lval  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    return yylval;
+}
+
+void yyset_lval (YYSTYPE *  yylval_param , yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    yylval = yylval_param;
+}
+
+/* User-visible API */
+
+/* yylex_init is special because it creates the scanner itself, so it is
+ * the ONLY reentrant function that doesn't take the scanner as the last argument.
+ * That's why we explicitly handle the declaration, instead of using our macros.
+ */
+
+int yylex_init(yyscan_t* ptr_yy_globals)
+
+{
+    if (ptr_yy_globals == NULL){
+        errno = EINVAL;
+        return 1;
+    }
+
+    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL );
+
+    if (*ptr_yy_globals == NULL){
+        errno = ENOMEM;
+        return 1;
+    }
+
+    /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
+    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+    return yy_init_globals ( *ptr_yy_globals );
+}
+
+/* yylex_init_extra has the same functionality as yylex_init, but follows the
+ * convention of taking the scanner as the last argument. Note however, that
+ * this is a *pointer* to a scanner, as it will be allocated by this call (and
+ * is the reason, too, why this function also must handle its own declaration).
+ * The user defined value in the first argument will be available to yyalloc in
+ * the yyextra field.
+ */
+
+int yylex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
+
+{
+    struct yyguts_t dummy_yyguts;
+
+    yyset_extra (yy_user_defined, &dummy_yyguts);
+
+    if (ptr_yy_globals == NULL){
+        errno = EINVAL;
+        return 1;
+    }
+	
+    *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+	
+    if (*ptr_yy_globals == NULL){
+        errno = ENOMEM;
+        return 1;
+    }
+    
+    /* By setting to 0xAA, we expose bugs in
+    yy_init_globals. Leave at 0x00 for releases. */
+    memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+    
+    yyset_extra (yy_user_defined, *ptr_yy_globals);
+    
+    return yy_init_globals ( *ptr_yy_globals );
+}
+
+static int yy_init_globals (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+    /* Initialization is the same as for the non-reentrant scanner.
+     * This function is called from yylex_destroy(), so don't allocate here.
+     */
+
+    yyg->yy_buffer_stack = 0;
+    yyg->yy_buffer_stack_top = 0;
+    yyg->yy_buffer_stack_max = 0;
+    yyg->yy_c_buf_p = (char *) 0;
+    yyg->yy_init = 0;
+    yyg->yy_start = 0;
+
+    yyg->yy_start_stack_ptr = 0;
+    yyg->yy_start_stack_depth = 0;
+    yyg->yy_start_stack =  NULL;
+
+    yyg->yy_state_buf = 0;
+    yyg->yy_state_ptr = 0;
+    yyg->yy_full_match = 0;
+    yyg->yy_lp = 0;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+    yyin = stdin;
+    yyout = stdout;
+#else
+    yyin = (FILE *) 0;
+    yyout = (FILE *) 0;
+#endif
+
+    /* For future reference: Set errno on error, since we are called by
+     * yylex_init()
+     */
+    return 0;
+}
+
+/* yylex_destroy is for both reentrant and non-reentrant scanners. */
+int yylex_destroy  (yyscan_t yyscanner)
+{
+    struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+    /* Pop the buffer stack, destroying each element. */
+	while(YY_CURRENT_BUFFER){
+		yy_delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+		YY_CURRENT_BUFFER_LVALUE = NULL;
+		yypop_buffer_state(yyscanner);
+	}
+
+	/* Destroy the stack itself. */
+	yyfree(yyg->yy_buffer_stack ,yyscanner);
+	yyg->yy_buffer_stack = NULL;
+
+    /* Destroy the start condition stack. */
+        yyfree(yyg->yy_start_stack ,yyscanner );
+        yyg->yy_start_stack = NULL;
+
+    yyfree ( yyg->yy_state_buf , yyscanner);
+    yyg->yy_state_buf  = NULL;
+
+    /* Reset the globals. This is important in a non-reentrant scanner so the next time
+     * yylex() is called, initialization will occur. */
+    yy_init_globals( yyscanner);
+
+    /* Destroy the main struct (reentrant only). */
+    yyfree ( yyscanner , yyscanner );
+    yyscanner = NULL;
+    return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+{
+	register int i;
+	for ( i = 0; i < n; ++i )
+		s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+{
+	register int n;
+	for ( n = 0; s[n]; ++n )
+		;
+
+	return n;
+}
+#endif
+
+void *yyalloc (yy_size_t  size , yyscan_t yyscanner)
+{
+	return (void *) malloc( size );
+}
+
+void *yyrealloc  (void * ptr, yy_size_t  size , yyscan_t yyscanner)
+{
+	/* The cast to (char *) in the following accommodates both
+	 * implementations that use char* generic pointers, and those
+	 * that use void* generic pointers.  It works with the latter
+	 * because both ANSI C and C++ allow castless assignment from
+	 * any pointer type to void*, and deal with argument conversions
+	 * as though doing an assignment.
+	 */
+	return (void *) realloc( (char *) ptr, size );
+}
+
+void yyfree (void * ptr , yyscan_t yyscanner)
+{
+	free( (char *) ptr );	/* see yyrealloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
+#line 83 "expr_lex.l"
+
+
+
diff --git a/src/expr_yacc.c b/src/expr_yacc.c
new file mode 100644
index 0000000..769e6ae
--- /dev/null
+++ b/src/expr_yacc.c
@@ -0,0 +1,1928 @@
+/* A Bison parser, made by GNU Bison 2.4.2.  */
+
+/* Skeleton implementation for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
+   Foundation, Inc.
+   
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+   
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+   simplifying the original so-called "semantic" parser.  */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+   infringing on user name space.  This should be done even for local
+   variables, as they might otherwise be expanded by user macros.
+   There are some unavoidable exceptions within include files to
+   define necessary library symbols; they are noted "INFRINGES ON
+   USER NAME SPACE" below.  */
+
+/* Identify Bison output.  */
+#define YYBISON 1
+
+/* Bison version.  */
+#define YYBISON_VERSION "2.4.2"
+
+/* Skeleton name.  */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers.  */
+#define YYPURE 1
+
+/* Push parsers.  */
+#define YYPUSH 0
+
+/* Pull parsers.  */
+#define YYPULL 1
+
+/* Using locations.  */
+#define YYLSP_NEEDED 0
+
+
+
+/* Copy the first part of user declarations.  */
+
+/* Line 189 of yacc.c  */
+#line 1 "expr_yacc.y"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+
+#include "expr.h"
+#include "expr_yacc.h" /* expr_yacc.h (y.tab.h) is produced from expr_yacc.y by parser generator */
+
+/* Bison manual p. 60 describes how to call yyparse() with arguments */
+/* #define YYPARSE_PARAM parse_arg */
+/* #define YYLEX_PARAM   ((parse_parm_t *) parse_arg, void *yyscanner) */
+
+  /* #define YYPURE 1 *//* ??? */
+
+/* prototypes */
+nodeType *expr_opr(int oper, int nops, ...);
+nodeType *expr_var(char *nm);
+nodeType *expr_con(double value);
+nodeType *expr_fun(char *fname, nodeType *p);
+
+void freeNode(nodeType *p);
+int expr_run(nodeType *p, parse_parm_t *parse_arg);
+
+
+
+/* Line 189 of yacc.c  */
+#line 99 "expr_yacc.c"
+
+/* Enabling traces.  */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+
+/* Enabling verbose error messages.  */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* Enabling the token table.  */
+#ifndef YYTOKEN_TABLE
+# define YYTOKEN_TABLE 0
+#endif
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     CONSTANT = 258,
+     VARIABLE = 259,
+     FUNCTION = 260,
+     NE = 261,
+     EQ = 262,
+     LE = 263,
+     GE = 264,
+     UMINUS = 265
+   };
+#endif
+/* Tokens.  */
+#define CONSTANT 258
+#define VARIABLE 259
+#define FUNCTION 260
+#define NE 261
+#define EQ 262
+#define LE 263
+#define GE 264
+#define UMINUS 265
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+
+/* Copy the second part of user declarations.  */
+
+
+/* Line 264 of yacc.c  */
+#line 160 "expr_yacc.c"
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#elif (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+typedef signed char yytype_int8;
+#else
+typedef short int yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+#  define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+#  define YYSIZE_T size_t
+# elif ! defined YYSIZE_T && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#  include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYSIZE_T size_t
+# else
+#  define YYSIZE_T unsigned int
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if defined YYENABLE_NLS && YYENABLE_NLS
+#  if ENABLE_NLS
+#   include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+#   define YY_(msgid) dgettext ("bison-runtime", msgid)
+#  endif
+# endif
+# ifndef YY_
+#  define YY_(msgid) msgid
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E.  */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(e) ((void) (e))
+#else
+# define YYUSE(e) /* empty */
+#endif
+
+/* Identity function, used to suppress warnings about constant conditions.  */
+#ifndef lint
+# define YYID(n) (n)
+#else
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static int
+YYID (int yyi)
+#else
+static int
+YYID (yyi)
+    int yyi;
+#endif
+{
+  return yyi;
+}
+#endif
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols.  */
+
+# ifdef YYSTACK_USE_ALLOCA
+#  if YYSTACK_USE_ALLOCA
+#   ifdef __GNUC__
+#    define YYSTACK_ALLOC __builtin_alloca
+#   elif defined __BUILTIN_VA_ARG_INCR
+#    include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+#   elif defined _AIX
+#    define YYSTACK_ALLOC __alloca
+#   elif defined _MSC_VER
+#    include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+#    define alloca _alloca
+#   else
+#    define YYSTACK_ALLOC alloca
+#    if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+#     include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#     ifndef _STDLIB_H
+#      define _STDLIB_H 1
+#     endif
+#    endif
+#   endif
+#  endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+   /* Pacify GCC's `empty if-body' warning.  */
+#  define YYSTACK_FREE(Ptr) do { /* empty */; } while (YYID (0))
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+    /* The OS might guarantee only one guard page at the bottom of the stack,
+       and a page size can be as small as 4096 bytes.  So we cannot safely
+       invoke alloca (N) if N exceeds 4096.  Use a slightly smaller number
+       to allow for a few compiler-allocated temporary stack slots.  */
+#   define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+#  endif
+# else
+#  define YYSTACK_ALLOC YYMALLOC
+#  define YYSTACK_FREE YYFREE
+#  ifndef YYSTACK_ALLOC_MAXIMUM
+#   define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+#  endif
+#  if (defined __cplusplus && ! defined _STDLIB_H \
+       && ! ((defined YYMALLOC || defined malloc) \
+	     && (defined YYFREE || defined free)))
+#   include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+#   ifndef _STDLIB_H
+#    define _STDLIB_H 1
+#   endif
+#  endif
+#  ifndef YYMALLOC
+#   define YYMALLOC malloc
+#   if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+#  ifndef YYFREE
+#   define YYFREE free
+#   if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+#   endif
+#  endif
+# endif
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
+
+#if (! defined yyoverflow \
+     && (! defined __cplusplus \
+	 || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member.  */
+union yyalloc
+{
+  yytype_int16 yyss_alloc;
+  YYSTYPE yyvs_alloc;
+};
+
+/* The size of the maximum gap between one aligned stack and the next.  */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+   N elements.  */
+# define YYSTACK_BYTES(N) \
+     ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+      + YYSTACK_GAP_MAXIMUM)
+
+/* Copy COUNT objects from FROM to TO.  The source and destination do
+   not overlap.  */
+# ifndef YYCOPY
+#  if defined __GNUC__ && 1 < __GNUC__
+#   define YYCOPY(To, From, Count) \
+      __builtin_memcpy (To, From, (Count) * sizeof (*(From)))
+#  else
+#   define YYCOPY(To, From, Count)		\
+      do					\
+	{					\
+	  YYSIZE_T yyi;				\
+	  for (yyi = 0; yyi < (Count); yyi++)	\
+	    (To)[yyi] = (From)[yyi];		\
+	}					\
+      while (YYID (0))
+#  endif
+# endif
+
+/* Relocate STACK from its old location to the new one.  The
+   local variables YYSIZE and YYSTACKSIZE give the old and new number of
+   elements in the stack, and YYPTR gives the new location of the
+   stack.  Advance YYPTR to a properly aligned location for the next
+   stack.  */
+# define YYSTACK_RELOCATE(Stack_alloc, Stack)				\
+    do									\
+      {									\
+	YYSIZE_T yynewbytes;						\
+	YYCOPY (&yyptr->Stack_alloc, Stack, yysize);			\
+	Stack = &yyptr->Stack_alloc;					\
+	yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+	yyptr += yynewbytes / sizeof (*yyptr);				\
+      }									\
+    while (YYID (0))
+
+#endif
+
+/* YYFINAL -- State number of the termination state.  */
+#define YYFINAL  3
+/* YYLAST -- Last index in YYTABLE.  */
+#define YYLAST   122
+
+/* YYNTOKENS -- Number of terminals.  */
+#define YYNTOKENS  24
+/* YYNNTS -- Number of nonterminals.  */
+#define YYNNTS  6
+/* YYNRULES -- Number of rules.  */
+#define YYNRULES  26
+/* YYNRULES -- Number of states.  */
+#define YYNSTATES  50
+
+/* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
+#define YYUNDEFTOK  2
+#define YYMAXUTOK   265
+
+#define YYTRANSLATE(YYX)						\
+  ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[YYLEX] -- Bison symbol number corresponding to YYLEX.  */
+static const yytype_uint8 yytranslate[] =
+{
+       0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+      22,    23,    15,    13,     2,    14,     2,    16,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,    19,
+       7,     8,     6,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,    17,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,    20,     2,    21,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     2,     2,     2,     2,
+       2,     2,     2,     2,     2,     2,     1,     2,     3,     4,
+       5,     9,    10,    11,    12,    18
+};
+
+#if YYDEBUG
+/* YYPRHS[YYN] -- Index of the first RHS symbol of rule number YYN in
+   YYRHS.  */
+static const yytype_uint8 yyprhs[] =
+{
+       0,     0,     3,     5,     8,     9,    11,    14,    19,    23,
+      25,    28,    30,    32,    35,    39,    43,    47,    51,    55,
+      59,    63,    67,    71,    75,    79,    83
+};
+
+/* YYRHS -- A `-1'-separated list of the rules' RHS.  */
+static const yytype_int8 yyrhs[] =
+{
+      25,     0,    -1,    26,    -1,    26,    27,    -1,    -1,    19,
+      -1,    29,    19,    -1,     4,     8,    29,    19,    -1,    20,
+      28,    21,    -1,    27,    -1,    28,    27,    -1,     3,    -1,
+       4,    -1,    14,    29,    -1,    29,    13,    29,    -1,    29,
+      14,    29,    -1,    29,    15,    29,    -1,    29,    16,    29,
+      -1,    29,     7,    29,    -1,    29,     6,    29,    -1,    29,
+      17,    29,    -1,    29,    12,    29,    -1,    29,    11,    29,
+      -1,    29,     9,    29,    -1,    29,    10,    29,    -1,    22,
+      29,    23,    -1,     5,    22,    29,    23,    -1
+};
+
+/* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
+static const yytype_uint8 yyrline[] =
+{
+       0,    49,    49,    53,    54,    58,    59,    60,    61,    65,
+      66,    70,    71,    72,    73,    74,    75,    76,    77,    78,
+      79,    80,    81,    82,    83,    84,    85
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+   First, the terminals, then, starting at YYNTOKENS, nonterminals.  */
+static const char *const yytname[] =
+{
+  "$end", "error", "$undefined", "CONSTANT", "VARIABLE", "FUNCTION",
+  "'>'", "'<'", "'='", "NE", "EQ", "LE", "GE", "'+'", "'-'", "'*'", "'/'",
+  "'^'", "UMINUS", "';'", "'{'", "'}'", "'('", "')'", "$accept", "program",
+  "function", "stmt", "stmt_list", "expr", 0
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[YYLEX-NUM] -- Internal token number corresponding to
+   token YYLEX-NUM.  */
+static const yytype_uint16 yytoknum[] =
+{
+       0,   256,   257,   258,   259,   260,    62,    60,    61,   261,
+     262,   263,   264,    43,    45,    42,    47,    94,   265,    59,
+     123,   125,    40,    41
+};
+# endif
+
+/* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+static const yytype_uint8 yyr1[] =
+{
+       0,    24,    25,    26,    26,    27,    27,    27,    27,    28,
+      28,    29,    29,    29,    29,    29,    29,    29,    29,    29,
+      29,    29,    29,    29,    29,    29,    29
+};
+
+/* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
+static const yytype_uint8 yyr2[] =
+{
+       0,     2,     1,     2,     0,     1,     2,     4,     3,     1,
+       2,     1,     1,     2,     3,     3,     3,     3,     3,     3,
+       3,     3,     3,     3,     3,     3,     4
+};
+
+/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
+   STATE-NUM when YYTABLE doesn't specify something else to do.  Zero
+   means the default is an error.  */
+static const yytype_uint8 yydefact[] =
+{
+       4,     0,     2,     1,    11,    12,     0,     0,     5,     0,
+       0,     3,     0,     0,     0,    12,    13,     9,     0,     0,
+       0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
+       0,     6,     0,     0,     8,    10,    25,    19,    18,    23,
+      24,    22,    21,    14,    15,    16,    17,    20,     7,    26
+};
+
+/* YYDEFGOTO[NTERM-NUM].  */
+static const yytype_int8 yydefgoto[] =
+{
+      -1,     1,     2,    11,    18,    12
+};
+
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
+#define YYPACT_NINF -18
+static const yytype_int8 yypact[] =
+{
+     -18,     2,    25,   -18,   -18,    -4,   -17,    45,   -18,    25,
+      45,   -18,    89,    45,    45,   -18,   -18,   -18,    21,    59,
+      45,    45,    45,    45,    45,    45,    45,    45,    45,    45,
+      45,   -18,   103,    74,   -18,   -18,   -18,    38,    38,    38,
+      38,    38,    38,    16,    16,    -9,    -9,    -9,   -18,   -18
+};
+
+/* YYPGOTO[NTERM-NUM].  */
+static const yytype_int8 yypgoto[] =
+{
+     -18,   -18,   -18,    -8,   -18,    -7
+};
+
+/* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule which
+   number is the opposite.  If zero, do what YYDEFACT says.
+   If YYTABLE_NINF, syntax error.  */
+#define YYTABLE_NINF -1
+static const yytype_uint8 yytable[] =
+{
+      16,    17,     3,    19,    13,    14,    32,    33,    30,     0,
+      35,     0,     0,    37,    38,    39,    40,    41,    42,    43,
+      44,    45,    46,    47,     4,     5,     6,     0,     4,     5,
+       6,    28,    29,    30,     0,     7,     0,     0,     0,     7,
+       8,     9,    34,    10,     8,     9,     0,    10,     4,    15,
+       6,    26,    27,    28,    29,    30,     0,     0,     0,     7,
+       0,     0,     0,     0,     0,    20,    21,    10,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,     0,     0,     0,
+      20,    21,    36,    22,    23,    24,    25,    26,    27,    28,
+      29,    30,     0,     0,     0,    20,    21,    49,    22,    23,
+      24,    25,    26,    27,    28,    29,    30,     0,    31,    20,
+      21,     0,    22,    23,    24,    25,    26,    27,    28,    29,
+      30,     0,    48
+};
+
+static const yytype_int8 yycheck[] =
+{
+       7,     9,     0,    10,     8,    22,    13,    14,    17,    -1,
+      18,    -1,    -1,    20,    21,    22,    23,    24,    25,    26,
+      27,    28,    29,    30,     3,     4,     5,    -1,     3,     4,
+       5,    15,    16,    17,    -1,    14,    -1,    -1,    -1,    14,
+      19,    20,    21,    22,    19,    20,    -1,    22,     3,     4,
+       5,    13,    14,    15,    16,    17,    -1,    -1,    -1,    14,
+      -1,    -1,    -1,    -1,    -1,     6,     7,    22,     9,    10,
+      11,    12,    13,    14,    15,    16,    17,    -1,    -1,    -1,
+       6,     7,    23,     9,    10,    11,    12,    13,    14,    15,
+      16,    17,    -1,    -1,    -1,     6,     7,    23,     9,    10,
+      11,    12,    13,    14,    15,    16,    17,    -1,    19,     6,
+       7,    -1,     9,    10,    11,    12,    13,    14,    15,    16,
+      17,    -1,    19
+};
+
+/* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+   symbol of state STATE-NUM.  */
+static const yytype_uint8 yystos[] =
+{
+       0,    25,    26,     0,     3,     4,     5,    14,    19,    20,
+      22,    27,    29,     8,    22,     4,    29,    27,    28,    29,
+       6,     7,     9,    10,    11,    12,    13,    14,    15,    16,
+      17,    19,    29,    29,    21,    27,    23,    29,    29,    29,
+      29,    29,    29,    29,    29,    29,    29,    29,    19,    23
+};
+
+#define yyerrok		(yyerrstatus = 0)
+#define yyclearin	(yychar = YYEMPTY)
+#define YYEMPTY		(-2)
+#define YYEOF		0
+
+#define YYACCEPT	goto yyacceptlab
+#define YYABORT		goto yyabortlab
+#define YYERROR		goto yyerrorlab
+
+
+/* Like YYERROR except do call yyerror.  This remains here temporarily
+   to ease the transition to the new meaning of YYERROR, for GCC.
+   Once GCC version 2 has supplanted version 1, this can go.  However,
+   YYFAIL appears to be in use.  Nevertheless, it is formally deprecated
+   in Bison 2.4.2's NEWS entry, where a plan to phase it out is
+   discussed.  */
+
+#define YYFAIL		goto yyerrlab
+#if defined YYFAIL
+  /* This is here to suppress warnings from the GCC cpp's
+     -Wunused-macros.  Normally we don't worry about that warning, but
+     some users do, and we want to make it easy for users to remove
+     YYFAIL uses, which will produce warnings from Bison 2.5.  */
+#endif
+
+#define YYRECOVERING()  (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value)					\
+do								\
+  if (yychar == YYEMPTY && yylen == 1)				\
+    {								\
+      yychar = (Token);						\
+      yylval = (Value);						\
+      yytoken = YYTRANSLATE (yychar);				\
+      YYPOPSTACK (1);						\
+      goto yybackup;						\
+    }								\
+  else								\
+    {								\
+      yyerror (parse_arg, scanner, YY_("syntax error: cannot back up")); \
+      YYERROR;							\
+    }								\
+while (YYID (0))
+
+
+#define YYTERROR	1
+#define YYERRCODE	256
+
+
+/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N].
+   If N is 0, then set CURRENT to the empty location which ends
+   the previous symbol: RHS[0] (always defined).  */
+
+#define YYRHSLOC(Rhs, K) ((Rhs)[K])
+#ifndef YYLLOC_DEFAULT
+# define YYLLOC_DEFAULT(Current, Rhs, N)				\
+    do									\
+      if (YYID (N))                                                    \
+	{								\
+	  (Current).first_line   = YYRHSLOC (Rhs, 1).first_line;	\
+	  (Current).first_column = YYRHSLOC (Rhs, 1).first_column;	\
+	  (Current).last_line    = YYRHSLOC (Rhs, N).last_line;		\
+	  (Current).last_column  = YYRHSLOC (Rhs, N).last_column;	\
+	}								\
+      else								\
+	{								\
+	  (Current).first_line   = (Current).last_line   =		\
+	    YYRHSLOC (Rhs, 0).last_line;				\
+	  (Current).first_column = (Current).last_column =		\
+	    YYRHSLOC (Rhs, 0).last_column;				\
+	}								\
+    while (YYID (0))
+#endif
+
+
+/* YY_LOCATION_PRINT -- Print the location on the stream.
+   This macro was not mandated originally: define only if we know
+   we won't break user code: when these are the locations we know.  */
+
+#ifndef YY_LOCATION_PRINT
+# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+#  define YY_LOCATION_PRINT(File, Loc)			\
+     fprintf (File, "%d.%d-%d.%d",			\
+	      (Loc).first_line, (Loc).first_column,	\
+	      (Loc).last_line,  (Loc).last_column)
+# else
+#  define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+# endif
+#endif
+
+
+/* YYLEX -- calling `yylex' with the right arguments.  */
+
+#ifdef YYLEX_PARAM
+# define YYLEX yylex (&yylval, YYLEX_PARAM)
+#else
+# define YYLEX yylex (&yylval, parse_arg, scanner)
+#endif
+
+/* Enable debugging if requested.  */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+#  include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+#  define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args)			\
+do {						\
+  if (yydebug)					\
+    YYFPRINTF Args;				\
+} while (YYID (0))
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)			  \
+do {									  \
+  if (yydebug)								  \
+    {									  \
+      YYFPRINTF (stderr, "%s ", Title);					  \
+      yy_symbol_print (stderr,						  \
+		  Type, Value, parse_arg, scanner); \
+      YYFPRINTF (stderr, "\n");						  \
+    }									  \
+} while (YYID (0))
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parse_parm_t *parse_arg, void *scanner)
+#else
+static void
+yy_symbol_value_print (yyoutput, yytype, yyvaluep, parse_arg, scanner)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+    parse_parm_t *parse_arg;
+    void *scanner;
+#endif
+{
+  if (!yyvaluep)
+    return;
+  YYUSE (parse_arg);
+  YYUSE (scanner);
+# ifdef YYPRINT
+  if (yytype < YYNTOKENS)
+    YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# else
+  YYUSE (yyoutput);
+# endif
+  switch (yytype)
+    {
+      default:
+	break;
+    }
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT.  |
+`--------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, parse_parm_t *parse_arg, void *scanner)
+#else
+static void
+yy_symbol_print (yyoutput, yytype, yyvaluep, parse_arg, scanner)
+    FILE *yyoutput;
+    int yytype;
+    YYSTYPE const * const yyvaluep;
+    parse_parm_t *parse_arg;
+    void *scanner;
+#endif
+{
+  if (yytype < YYNTOKENS)
+    YYFPRINTF (yyoutput, "token %s (", yytname[yytype]);
+  else
+    YYFPRINTF (yyoutput, "nterm %s (", yytname[yytype]);
+
+  yy_symbol_value_print (yyoutput, yytype, yyvaluep, parse_arg, scanner);
+  YYFPRINTF (yyoutput, ")");
+}
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included).                                                   |
+`------------------------------------------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+#else
+static void
+yy_stack_print (yybottom, yytop)
+    yytype_int16 *yybottom;
+    yytype_int16 *yytop;
+#endif
+{
+  YYFPRINTF (stderr, "Stack now");
+  for (; yybottom <= yytop; yybottom++)
+    {
+      int yybot = *yybottom;
+      YYFPRINTF (stderr, " %d", yybot);
+    }
+  YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top)				\
+do {								\
+  if (yydebug)							\
+    yy_stack_print ((Bottom), (Top));				\
+} while (YYID (0))
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced.  |
+`------------------------------------------------*/
+
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yy_reduce_print (YYSTYPE *yyvsp, int yyrule, parse_parm_t *parse_arg, void *scanner)
+#else
+static void
+yy_reduce_print (yyvsp, yyrule, parse_arg, scanner)
+    YYSTYPE *yyvsp;
+    int yyrule;
+    parse_parm_t *parse_arg;
+    void *scanner;
+#endif
+{
+  int yynrhs = yyr2[yyrule];
+  int yyi;
+  unsigned long int yylno = yyrline[yyrule];
+  YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+	     yyrule - 1, yylno);
+  /* The symbols being reduced.  */
+  for (yyi = 0; yyi < yynrhs; yyi++)
+    {
+      YYFPRINTF (stderr, "   $%d = ", yyi + 1);
+      yy_symbol_print (stderr, yyrhs[yyprhs[yyrule] + yyi],
+		       &(yyvsp[(yyi + 1) - (yynrhs)])
+		       		       , parse_arg, scanner);
+      YYFPRINTF (stderr, "\n");
+    }
+}
+
+# define YY_REDUCE_PRINT(Rule)		\
+do {					\
+  if (yydebug)				\
+    yy_reduce_print (yyvsp, Rule, parse_arg, scanner); \
+} while (YYID (0))
+
+/* Nonzero means print parse trace.  It is left uninitialized so that
+   multiple parsers can coexist.  */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks.  */
+#ifndef	YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+   if the built-in stack extension method is used).
+
+   Do not make this value too large; the results are undefined if
+   YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+   evaluated with infinite-precision integer arithmetic.  */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+

+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+#  if defined __GLIBC__ && defined _STRING_H
+#   define yystrlen strlen
+#  else
+/* Return the length of YYSTR.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static YYSIZE_T
+yystrlen (const char *yystr)
+#else
+static YYSIZE_T
+yystrlen (yystr)
+    const char *yystr;
+#endif
+{
+  YYSIZE_T yylen;
+  for (yylen = 0; yystr[yylen]; yylen++)
+    continue;
+  return yylen;
+}
+#  endif
+# endif
+
+# ifndef yystpcpy
+#  if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+#   define yystpcpy stpcpy
+#  else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+   YYDEST.  */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+#else
+static char *
+yystpcpy (yydest, yysrc)
+    char *yydest;
+    const char *yysrc;
+#endif
+{
+  char *yyd = yydest;
+  const char *yys = yysrc;
+
+  while ((*yyd++ = *yys++) != '\0')
+    continue;
+
+  return yyd - 1;
+}
+#  endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+   quotes and backslashes, so that it's suitable for yyerror.  The
+   heuristic is that double-quoting is unnecessary unless the string
+   contains an apostrophe, a comma, or backslash (other than
+   backslash-backslash).  YYSTR is taken from yytname.  If YYRES is
+   null, do not copy; instead, return the length of what the result
+   would have been.  */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+  if (*yystr == '"')
+    {
+      YYSIZE_T yyn = 0;
+      char const *yyp = yystr;
+
+      for (;;)
+	switch (*++yyp)
+	  {
+	  case '\'':
+	  case ',':
+	    goto do_not_strip_quotes;
+
+	  case '\\':
+	    if (*++yyp != '\\')
+	      goto do_not_strip_quotes;
+	    /* Fall through.  */
+	  default:
+	    if (yyres)
+	      yyres[yyn] = *yyp;
+	    yyn++;
+	    break;
+
+	  case '"':
+	    if (yyres)
+	      yyres[yyn] = '\0';
+	    return yyn;
+	  }
+    do_not_strip_quotes: ;
+    }
+
+  if (! yyres)
+    return yystrlen (yystr);
+
+  return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+/* Copy into YYRESULT an error message about the unexpected token
+   YYCHAR while in state YYSTATE.  Return the number of bytes copied,
+   including the terminating null byte.  If YYRESULT is null, do not
+   copy anything; just return the number of bytes that would be
+   copied.  As a special case, return 0 if an ordinary "syntax error"
+   message will do.  Return YYSIZE_MAXIMUM if overflow occurs during
+   size calculation.  */
+static YYSIZE_T
+yysyntax_error (char *yyresult, int yystate, int yychar)
+{
+  int yyn = yypact[yystate];
+
+  if (! (YYPACT_NINF < yyn && yyn <= YYLAST))
+    return 0;
+  else
+    {
+      int yytype = YYTRANSLATE (yychar);
+      YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]);
+      YYSIZE_T yysize = yysize0;
+      YYSIZE_T yysize1;
+      int yysize_overflow = 0;
+      enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+      char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+      int yyx;
+
+# if 0
+      /* This is so xgettext sees the translatable formats that are
+	 constructed on the fly.  */
+      YY_("syntax error, unexpected %s");
+      YY_("syntax error, unexpected %s, expecting %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s");
+      YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s");
+# endif
+      char *yyfmt;
+      char const *yyf;
+      static char const yyunexpected[] = "syntax error, unexpected %s";
+      static char const yyexpecting[] = ", expecting %s";
+      static char const yyor[] = " or %s";
+      char yyformat[sizeof yyunexpected
+		    + sizeof yyexpecting - 1
+		    + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2)
+		       * (sizeof yyor - 1))];
+      char const *yyprefix = yyexpecting;
+
+      /* Start YYX at -YYN if negative to avoid negative indexes in
+	 YYCHECK.  */
+      int yyxbegin = yyn < 0 ? -yyn : 0;
+
+      /* Stay within bounds of both yycheck and yytname.  */
+      int yychecklim = YYLAST - yyn + 1;
+      int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+      int yycount = 1;
+
+      yyarg[0] = yytname[yytype];
+      yyfmt = yystpcpy (yyformat, yyunexpected);
+
+      for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+	if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR)
+	  {
+	    if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+	      {
+		yycount = 1;
+		yysize = yysize0;
+		yyformat[sizeof yyunexpected - 1] = '\0';
+		break;
+	      }
+	    yyarg[yycount++] = yytname[yyx];
+	    yysize1 = yysize + yytnamerr (0, yytname[yyx]);
+	    yysize_overflow |= (yysize1 < yysize);
+	    yysize = yysize1;
+	    yyfmt = yystpcpy (yyfmt, yyprefix);
+	    yyprefix = yyor;
+	  }
+
+      yyf = YY_(yyformat);
+      yysize1 = yysize + yystrlen (yyf);
+      yysize_overflow |= (yysize1 < yysize);
+      yysize = yysize1;
+
+      if (yysize_overflow)
+	return YYSIZE_MAXIMUM;
+
+      if (yyresult)
+	{
+	  /* Avoid sprintf, as that infringes on the user's name space.
+	     Don't have undefined behavior even if the translation
+	     produced a string with the wrong number of "%s"s.  */
+	  char *yyp = yyresult;
+	  int yyi = 0;
+	  while ((*yyp = *yyf) != '\0')
+	    {
+	      if (*yyp == '%' && yyf[1] == 's' && yyi < yycount)
+		{
+		  yyp += yytnamerr (yyp, yyarg[yyi++]);
+		  yyf += 2;
+		}
+	      else
+		{
+		  yyp++;
+		  yyf++;
+		}
+	    }
+	}
+      return yysize;
+    }
+}
+#endif /* YYERROR_VERBOSE */
+

+
+/*-----------------------------------------------.
+| Release the memory associated to this symbol.  |
+`-----------------------------------------------*/
+
+/*ARGSUSED*/
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, parse_parm_t *parse_arg, void *scanner)
+#else
+static void
+yydestruct (yymsg, yytype, yyvaluep, parse_arg, scanner)
+    const char *yymsg;
+    int yytype;
+    YYSTYPE *yyvaluep;
+    parse_parm_t *parse_arg;
+    void *scanner;
+#endif
+{
+  YYUSE (yyvaluep);
+  YYUSE (parse_arg);
+  YYUSE (scanner);
+
+  if (!yymsg)
+    yymsg = "Deleting";
+  YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+  switch (yytype)
+    {
+
+      default:
+	break;
+    }
+}
+
+/* Prevent warnings from -Wmissing-prototypes.  */
+#ifdef YYPARSE_PARAM
+#if defined __STDC__ || defined __cplusplus
+int yyparse (void *YYPARSE_PARAM);
+#else
+int yyparse ();
+#endif
+#else /* ! YYPARSE_PARAM */
+#if defined __STDC__ || defined __cplusplus
+int yyparse (parse_parm_t *parse_arg, void *scanner);
+#else
+int yyparse ();
+#endif
+#endif /* ! YYPARSE_PARAM */
+
+
+
+
+
+/*-------------------------.
+| yyparse or yypush_parse.  |
+`-------------------------*/
+
+#ifdef YYPARSE_PARAM
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (void *YYPARSE_PARAM)
+#else
+int
+yyparse (YYPARSE_PARAM)
+    void *YYPARSE_PARAM;
+#endif
+#else /* ! YYPARSE_PARAM */
+#if (defined __STDC__ || defined __C99__FUNC__ \
+     || defined __cplusplus || defined _MSC_VER)
+int
+yyparse (parse_parm_t *parse_arg, void *scanner)
+#else
+int
+yyparse (parse_arg, scanner)
+    parse_parm_t *parse_arg;
+    void *scanner;
+#endif
+#endif
+{
+/* The lookahead symbol.  */
+int yychar;
+
+/* The semantic value of the lookahead symbol.  */
+YYSTYPE yylval;
+
+    /* Number of syntax errors so far.  */
+    int yynerrs;
+
+    int yystate;
+    /* Number of tokens to shift before error messages enabled.  */
+    int yyerrstatus;
+
+    /* The stacks and their tools:
+       `yyss': related to states.
+       `yyvs': related to semantic values.
+
+       Refer to the stacks thru separate pointers, to allow yyoverflow
+       to reallocate them elsewhere.  */
+
+    /* The state stack.  */
+    yytype_int16 yyssa[YYINITDEPTH];
+    yytype_int16 *yyss;
+    yytype_int16 *yyssp;
+
+    /* The semantic value stack.  */
+    YYSTYPE yyvsa[YYINITDEPTH];
+    YYSTYPE *yyvs;
+    YYSTYPE *yyvsp;
+
+    YYSIZE_T yystacksize;
+
+  int yyn;
+  int yyresult;
+  /* Lookahead token as an internal (translated) token number.  */
+  int yytoken;
+  /* The variables used to return semantic value and location from the
+     action routines.  */
+  YYSTYPE yyval;
+
+#if YYERROR_VERBOSE
+  /* Buffer for error messages, and its allocated size.  */
+  char yymsgbuf[128];
+  char *yymsg = yymsgbuf;
+  YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N)   (yyvsp -= (N), yyssp -= (N))
+
+  /* The number of symbols on the RHS of the reduced rule.
+     Keep to zero when no symbol should be popped.  */
+  int yylen = 0;
+
+  yytoken = 0;
+  yyss = yyssa;
+  yyvs = yyvsa;
+  yystacksize = YYINITDEPTH;
+
+  YYDPRINTF ((stderr, "Starting parse\n"));
+
+  yystate = 0;
+  yyerrstatus = 0;
+  yynerrs = 0;
+  yychar = YYEMPTY; /* Cause a token to be read.  */
+
+  /* Initialize stack pointers.
+     Waste one element of value and location stack
+     so that they stay on the same level as the state stack.
+     The wasted elements are never initialized.  */
+  yyssp = yyss;
+  yyvsp = yyvs;
+
+  goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate.  |
+`------------------------------------------------------------*/
+ yynewstate:
+  /* In all cases, when you get here, the value and location stacks
+     have just been pushed.  So pushing a state here evens the stacks.  */
+  yyssp++;
+
+ yysetstate:
+  *yyssp = yystate;
+
+  if (yyss + yystacksize - 1 <= yyssp)
+    {
+      /* Get the current used size of the three stacks, in elements.  */
+      YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+      {
+	/* Give user a chance to reallocate the stack.  Use copies of
+	   these so that the &'s don't force the real ones into
+	   memory.  */
+	YYSTYPE *yyvs1 = yyvs;
+	yytype_int16 *yyss1 = yyss;
+
+	/* Each stack pointer address is followed by the size of the
+	   data in use in that stack, in bytes.  This used to be a
+	   conditional around just the two extra args, but that might
+	   be undefined if yyoverflow is a macro.  */
+	yyoverflow (YY_("memory exhausted"),
+		    &yyss1, yysize * sizeof (*yyssp),
+		    &yyvs1, yysize * sizeof (*yyvsp),
+		    &yystacksize);
+
+	yyss = yyss1;
+	yyvs = yyvs1;
+      }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+      goto yyexhaustedlab;
+# else
+      /* Extend the stack our own way.  */
+      if (YYMAXDEPTH <= yystacksize)
+	goto yyexhaustedlab;
+      yystacksize *= 2;
+      if (YYMAXDEPTH < yystacksize)
+	yystacksize = YYMAXDEPTH;
+
+      {
+	yytype_int16 *yyss1 = yyss;
+	union yyalloc *yyptr =
+	  (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+	if (! yyptr)
+	  goto yyexhaustedlab;
+	YYSTACK_RELOCATE (yyss_alloc, yyss);
+	YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+#  undef YYSTACK_RELOCATE
+	if (yyss1 != yyssa)
+	  YYSTACK_FREE (yyss1);
+      }
+# endif
+#endif /* no yyoverflow */
+
+      yyssp = yyss + yysize - 1;
+      yyvsp = yyvs + yysize - 1;
+
+      YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+		  (unsigned long int) yystacksize));
+
+      if (yyss + yystacksize - 1 <= yyssp)
+	YYABORT;
+    }
+
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+  if (yystate == YYFINAL)
+    YYACCEPT;
+
+  goto yybackup;
+
+/*-----------.
+| yybackup.  |
+`-----------*/
+yybackup:
+
+  /* Do appropriate processing given the current state.  Read a
+     lookahead token if we need one and don't already have one.  */
+
+  /* First try to decide what to do without reference to lookahead token.  */
+  yyn = yypact[yystate];
+  if (yyn == YYPACT_NINF)
+    goto yydefault;
+
+  /* Not known => get a lookahead token if don't already have one.  */
+
+  /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol.  */
+  if (yychar == YYEMPTY)
+    {
+      YYDPRINTF ((stderr, "Reading a token: "));
+      yychar = YYLEX;
+    }
+
+  if (yychar <= YYEOF)
+    {
+      yychar = yytoken = YYEOF;
+      YYDPRINTF ((stderr, "Now at end of input.\n"));
+    }
+  else
+    {
+      yytoken = YYTRANSLATE (yychar);
+      YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+    }
+
+  /* If the proper action on seeing token YYTOKEN is to reduce or to
+     detect an error, take that action.  */
+  yyn += yytoken;
+  if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+    goto yydefault;
+  yyn = yytable[yyn];
+  if (yyn <= 0)
+    {
+      if (yyn == 0 || yyn == YYTABLE_NINF)
+	goto yyerrlab;
+      yyn = -yyn;
+      goto yyreduce;
+    }
+
+  /* Count tokens shifted since error; after three, turn off error
+     status.  */
+  if (yyerrstatus)
+    yyerrstatus--;
+
+  /* Shift the lookahead token.  */
+  YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+  /* Discard the shifted token.  */
+  yychar = YYEMPTY;
+
+  yystate = yyn;
+  *++yyvsp = yylval;
+
+  goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state.  |
+`-----------------------------------------------------------*/
+yydefault:
+  yyn = yydefact[yystate];
+  if (yyn == 0)
+    goto yyerrlab;
+  goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction.  |
+`-----------------------------*/
+yyreduce:
+  /* yyn is the number of a rule to reduce with.  */
+  yylen = yyr2[yyn];
+
+  /* If YYLEN is nonzero, implement the default value of the action:
+     `$$ = $1'.
+
+     Otherwise, the following line sets YYVAL to garbage.
+     This behavior is undocumented and Bison
+     users should not rely upon it.  Assigning to YYVAL
+     unconditionally makes the parser a bit smaller, and it avoids a
+     GCC warning that YYVAL may be used uninitialized.  */
+  yyval = yyvsp[1-yylen];
+
+
+  YY_REDUCE_PRINT (yyn);
+  switch (yyn)
+    {
+        case 2:
+
+/* Line 1464 of yacc.c  */
+#line 49 "expr_yacc.y"
+    { return(0); }
+    break;
+
+  case 3:
+
+/* Line 1464 of yacc.c  */
+#line 53 "expr_yacc.y"
+    { expr_run((yyvsp[(2) - (2)].nPtr), (parse_parm_t *) parse_arg); freeNode((yyvsp[(2) - (2)].nPtr)); }
+    break;
+
+  case 5:
+
+/* Line 1464 of yacc.c  */
+#line 58 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr(';', 2, NULL, NULL); }
+    break;
+
+  case 6:
+
+/* Line 1464 of yacc.c  */
+#line 59 "expr_yacc.y"
+    { (yyval.nPtr) = (yyvsp[(1) - (2)].nPtr); }
+    break;
+
+  case 7:
+
+/* Line 1464 of yacc.c  */
+#line 60 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr('=', 2, expr_var((yyvsp[(1) - (4)].varnm)), (yyvsp[(3) - (4)].nPtr)); }
+    break;
+
+  case 8:
+
+/* Line 1464 of yacc.c  */
+#line 61 "expr_yacc.y"
+    { (yyval.nPtr) = (yyvsp[(2) - (3)].nPtr); }
+    break;
+
+  case 9:
+
+/* Line 1464 of yacc.c  */
+#line 65 "expr_yacc.y"
+    { (yyval.nPtr) = (yyvsp[(1) - (1)].nPtr); }
+    break;
+
+  case 10:
+
+/* Line 1464 of yacc.c  */
+#line 66 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr(';', 2, (yyvsp[(1) - (2)].nPtr), (yyvsp[(2) - (2)].nPtr)); }
+    break;
+
+  case 11:
+
+/* Line 1464 of yacc.c  */
+#line 70 "expr_yacc.y"
+    { (yyval.nPtr) = expr_con((yyvsp[(1) - (1)].cvalue)); }
+    break;
+
+  case 12:
+
+/* Line 1464 of yacc.c  */
+#line 71 "expr_yacc.y"
+    { (yyval.nPtr) = expr_var((yyvsp[(1) - (1)].varnm)); }
+    break;
+
+  case 13:
+
+/* Line 1464 of yacc.c  */
+#line 72 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr(UMINUS, 1, (yyvsp[(2) - (2)].nPtr)); }
+    break;
+
+  case 14:
+
+/* Line 1464 of yacc.c  */
+#line 73 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr('+', 2, (yyvsp[(1) - (3)].nPtr), (yyvsp[(3) - (3)].nPtr)); }
+    break;
+
+  case 15:
+
+/* Line 1464 of yacc.c  */
+#line 74 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr('-', 2, (yyvsp[(1) - (3)].nPtr), (yyvsp[(3) - (3)].nPtr)); }
+    break;
+
+  case 16:
+
+/* Line 1464 of yacc.c  */
+#line 75 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr('*', 2, (yyvsp[(1) - (3)].nPtr), (yyvsp[(3) - (3)].nPtr)); }
+    break;
+
+  case 17:
+
+/* Line 1464 of yacc.c  */
+#line 76 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr('/', 2, (yyvsp[(1) - (3)].nPtr), (yyvsp[(3) - (3)].nPtr)); }
+    break;
+
+  case 18:
+
+/* Line 1464 of yacc.c  */
+#line 77 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr('<', 2, (yyvsp[(1) - (3)].nPtr), (yyvsp[(3) - (3)].nPtr)); }
+    break;
+
+  case 19:
+
+/* Line 1464 of yacc.c  */
+#line 78 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr('>', 2, (yyvsp[(1) - (3)].nPtr), (yyvsp[(3) - (3)].nPtr)); }
+    break;
+
+  case 20:
+
+/* Line 1464 of yacc.c  */
+#line 79 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr('^', 2, (yyvsp[(1) - (3)].nPtr), (yyvsp[(3) - (3)].nPtr)); }
+    break;
+
+  case 21:
+
+/* Line 1464 of yacc.c  */
+#line 80 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr(GE, 2, (yyvsp[(1) - (3)].nPtr), (yyvsp[(3) - (3)].nPtr)); }
+    break;
+
+  case 22:
+
+/* Line 1464 of yacc.c  */
+#line 81 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr(LE, 2, (yyvsp[(1) - (3)].nPtr), (yyvsp[(3) - (3)].nPtr)); }
+    break;
+
+  case 23:
+
+/* Line 1464 of yacc.c  */
+#line 82 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr(NE, 2, (yyvsp[(1) - (3)].nPtr), (yyvsp[(3) - (3)].nPtr)); }
+    break;
+
+  case 24:
+
+/* Line 1464 of yacc.c  */
+#line 83 "expr_yacc.y"
+    { (yyval.nPtr) = expr_opr(EQ, 2, (yyvsp[(1) - (3)].nPtr), (yyvsp[(3) - (3)].nPtr)); }
+    break;
+
+  case 25:
+
+/* Line 1464 of yacc.c  */
+#line 84 "expr_yacc.y"
+    { (yyval.nPtr) = (yyvsp[(2) - (3)].nPtr); }
+    break;
+
+  case 26:
+
+/* Line 1464 of yacc.c  */
+#line 85 "expr_yacc.y"
+    { (yyval.nPtr) = expr_fun((yyvsp[(1) - (4)].fname), (yyvsp[(3) - (4)].nPtr)); }
+    break;
+
+
+
+/* Line 1464 of yacc.c  */
+#line 1583 "expr_yacc.c"
+      default: break;
+    }
+  YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+
+  *++yyvsp = yyval;
+
+  /* Now `shift' the result of the reduction.  Determine what state
+     that goes to, based on the state we popped back to and the rule
+     number reduced by.  */
+
+  yyn = yyr1[yyn];
+
+  yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+  if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+    yystate = yytable[yystate];
+  else
+    yystate = yydefgoto[yyn - YYNTOKENS];
+
+  goto yynewstate;
+
+
+/*------------------------------------.
+| yyerrlab -- here on detecting error |
+`------------------------------------*/
+yyerrlab:
+  /* If not already recovering from an error, report this error.  */
+  if (!yyerrstatus)
+    {
+      ++yynerrs;
+#if ! YYERROR_VERBOSE
+      yyerror (parse_arg, scanner, YY_("syntax error"));
+#else
+      {
+	YYSIZE_T yysize = yysyntax_error (0, yystate, yychar);
+	if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM)
+	  {
+	    YYSIZE_T yyalloc = 2 * yysize;
+	    if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM))
+	      yyalloc = YYSTACK_ALLOC_MAXIMUM;
+	    if (yymsg != yymsgbuf)
+	      YYSTACK_FREE (yymsg);
+	    yymsg = (char *) YYSTACK_ALLOC (yyalloc);
+	    if (yymsg)
+	      yymsg_alloc = yyalloc;
+	    else
+	      {
+		yymsg = yymsgbuf;
+		yymsg_alloc = sizeof yymsgbuf;
+	      }
+	  }
+
+	if (0 < yysize && yysize <= yymsg_alloc)
+	  {
+	    (void) yysyntax_error (yymsg, yystate, yychar);
+	    yyerror (parse_arg, scanner, yymsg);
+	  }
+	else
+	  {
+	    yyerror (parse_arg, scanner, YY_("syntax error"));
+	    if (yysize != 0)
+	      goto yyexhaustedlab;
+	  }
+      }
+#endif
+    }
+
+
+
+  if (yyerrstatus == 3)
+    {
+      /* If just tried and failed to reuse lookahead token after an
+	 error, discard it.  */
+
+      if (yychar <= YYEOF)
+	{
+	  /* Return failure if at end of input.  */
+	  if (yychar == YYEOF)
+	    YYABORT;
+	}
+      else
+	{
+	  yydestruct ("Error: discarding",
+		      yytoken, &yylval, parse_arg, scanner);
+	  yychar = YYEMPTY;
+	}
+    }
+
+  /* Else will try to reuse lookahead token after shifting the error
+     token.  */
+  goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR.  |
+`---------------------------------------------------*/
+yyerrorlab:
+
+  /* Pacify compilers like GCC when the user code never invokes
+     YYERROR and the label yyerrorlab therefore never appears in user
+     code.  */
+  if (/*CONSTCOND*/ 0)
+     goto yyerrorlab;
+
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYERROR.  */
+  YYPOPSTACK (yylen);
+  yylen = 0;
+  YY_STACK_PRINT (yyss, yyssp);
+  yystate = *yyssp;
+  goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR.  |
+`-------------------------------------------------------------*/
+yyerrlab1:
+  yyerrstatus = 3;	/* Each real token shifted decrements this.  */
+
+  for (;;)
+    {
+      yyn = yypact[yystate];
+      if (yyn != YYPACT_NINF)
+	{
+	  yyn += YYTERROR;
+	  if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+	    {
+	      yyn = yytable[yyn];
+	      if (0 < yyn)
+		break;
+	    }
+	}
+
+      /* Pop the current state because it cannot handle the error token.  */
+      if (yyssp == yyss)
+	YYABORT;
+
+
+      yydestruct ("Error: popping",
+		  yystos[yystate], yyvsp, parse_arg, scanner);
+      YYPOPSTACK (1);
+      yystate = *yyssp;
+      YY_STACK_PRINT (yyss, yyssp);
+    }
+
+  *++yyvsp = yylval;
+
+
+  /* Shift the error token.  */
+  YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+  yystate = yyn;
+  goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here.  |
+`-------------------------------------*/
+yyacceptlab:
+  yyresult = 0;
+  goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here.  |
+`-----------------------------------*/
+yyabortlab:
+  yyresult = 1;
+  goto yyreturn;
+
+#if !defined(yyoverflow) || YYERROR_VERBOSE
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here.  |
+`-------------------------------------------------*/
+yyexhaustedlab:
+  yyerror (parse_arg, scanner, YY_("memory exhausted"));
+  yyresult = 2;
+  /* Fall through.  */
+#endif
+
+yyreturn:
+  if (yychar != YYEMPTY)
+     yydestruct ("Cleanup: discarding lookahead",
+		 yytoken, &yylval, parse_arg, scanner);
+  /* Do not reclaim the symbols of the rule which action triggered
+     this YYABORT or YYACCEPT.  */
+  YYPOPSTACK (yylen);
+  YY_STACK_PRINT (yyss, yyssp);
+  while (yyssp != yyss)
+    {
+      yydestruct ("Cleanup: popping",
+		  yystos[*yyssp], yyvsp, parse_arg, scanner);
+      YYPOPSTACK (1);
+    }
+#ifndef yyoverflow
+  if (yyss != yyssa)
+    YYSTACK_FREE (yyss);
+#endif
+#if YYERROR_VERBOSE
+  if (yymsg != yymsgbuf)
+    YYSTACK_FREE (yymsg);
+#endif
+  /* Make sure YYID is used.  */
+  return YYID (yyresult);
+}
+
+
+
+/* Line 1684 of yacc.c  */
+#line 88 "expr_yacc.y"
+
+
+#define SIZEOF_NODETYPE ((char *)&p->u.con - (char *)p)
+
+nodeType *expr_con(double value)
+{
+  nodeType *p = NULL;
+  size_t nodeSize;
+
+  /* allocate node */
+  nodeSize = SIZEOF_NODETYPE + sizeof(conNodeType);
+  if ((p = (nodeType *) malloc(nodeSize)) == NULL)
+    yyerror(NULL, NULL, "Out of memory");
+
+  /* copy information */
+  p->type = typeCon;
+  p->u.con.value = value;
+    
+  return p;
+}
+
+nodeType *expr_var(char *nm)
+{
+  nodeType *p = NULL;
+  size_t nodeSize;
+
+  /* allocate node */
+  nodeSize = SIZEOF_NODETYPE + sizeof(varNodeType);
+  if ((p = (nodeType *) malloc(nodeSize)) == NULL)
+    yyerror(NULL, NULL, "Out of memory");
+
+  /* copy information */
+  p->type = typeVar;
+  p->u.var.nm = strdupx(nm);
+
+  return p;
+}
+
+nodeType *expr_fun(char *fname, nodeType *op)
+{
+  nodeType *p = NULL;
+  size_t nodeSize;
+
+  /* allocate node */
+  nodeSize = SIZEOF_NODETYPE + sizeof(funNodeType);
+  if ((p = (nodeType *) malloc(nodeSize)) == NULL)
+    yyerror(NULL, NULL, "Out of memory");
+
+  /* copy information */
+  p->type = typeFun;
+  p->u.fun.name = strdupx(fname);
+  p->u.fun.op   = op;
+
+  return p;
+}
+
+nodeType *expr_opr(int oper, int nops, ...)
+{
+  va_list ap;
+  nodeType *p = NULL;
+  size_t nodeSize;
+  int i;
+
+  /* allocate node */
+  nodeSize = SIZEOF_NODETYPE + sizeof(oprNodeType) + (nops - 1)*sizeof(nodeType*);
+  if ((p = (nodeType *) malloc(nodeSize)) == NULL)
+    yyerror(NULL, NULL, "Out of memory");
+
+  /* copy information */
+  p->type = typeOpr;
+  p->u.opr.oper = oper;
+  p->u.opr.nops = nops;
+  va_start(ap, nops);
+  for (i = 0; i < nops; i++)
+    p->u.opr.op[i] = va_arg(ap, nodeType*);
+  va_end(ap);
+
+  return p;
+}
+
+void freeNode(nodeType *p)
+{
+  int i;
+
+  if ( ! p ) return;
+
+  if (p->type == typeOpr)
+    {
+      for (i = 0; i < p->u.opr.nops; i++)
+	freeNode(p->u.opr.op[i]);
+    }
+  
+  free (p);
+}
+
+void yyerror(void *parse_arg, void *scanner, char *s)
+{
+  fprintf(stdout, "%s\n", s);
+}
+
+/*
+int main(void)
+{
+  int i;
+  static char fexpr[] = "nvar = q*(geosp+234.56); xx = geosp+999-log(aps);";
+
+  parse_parm_t parse_arg;
+
+  printf("%s\n", fexpr);
+
+  yy_scan_string(fexpr);
+
+  parse_arg.nvar = 0;
+  parse_arg.init = 1;
+  parse_arg.debug = 1;
+
+  yyparse((void *)&parse_arg);
+
+  for ( i = 0; i < parse_arg.nvar; i++ )
+    printf("vars %d %s\n", i, parse_arg.var[i]);
+
+  yy_scan_string(fexpr);
+
+  parse_arg.init = 0;
+
+  yyparse((void *)&parse_arg);
+
+  for ( i = 0; i < parse_arg.nvar; i++ )
+    printf("vars %d %s\n", i, parse_arg.var[i]);
+
+  return 0;
+}
+*/
+
diff --git a/src/expr_yacc.h b/src/expr_yacc.h
new file mode 100644
index 0000000..4ee9d50
--- /dev/null
+++ b/src/expr_yacc.h
@@ -0,0 +1,72 @@
+/* A Bison parser, made by GNU Bison 2.4.2.  */
+
+/* Skeleton interface for Bison's Yacc-like parsers in C
+   
+      Copyright (C) 1984, 1989-1990, 2000-2006, 2009-2010 Free Software
+   Foundation, Inc.
+   
+   This program is free software: you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation, either version 3 of the License, or
+   (at your option) any later version.
+   
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+   
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+/* As a special exception, you may create a larger work that contains
+   part or all of the Bison parser skeleton and distribute that work
+   under terms of your choice, so long as that work isn't itself a
+   parser generator using the skeleton or a modified version thereof
+   as a parser skeleton.  Alternatively, if you modify or redistribute
+   the parser skeleton itself, you may (at your option) remove this
+   special exception, which will cause the skeleton and the resulting
+   Bison output files to be licensed under the GNU General Public
+   License without this special exception.
+   
+   This special exception was added by the Free Software Foundation in
+   version 2.2 of Bison.  */
+
+
+/* Tokens.  */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+   /* Put the tokens into the symbol table, so that GDB and other debuggers
+      know about them.  */
+   enum yytokentype {
+     CONSTANT = 258,
+     VARIABLE = 259,
+     FUNCTION = 260,
+     NE = 261,
+     EQ = 262,
+     LE = 263,
+     GE = 264,
+     UMINUS = 265
+   };
+#endif
+/* Tokens.  */
+#define CONSTANT 258
+#define VARIABLE 259
+#define FUNCTION 260
+#define NE 261
+#define EQ 262
+#define LE 263
+#define GE 264
+#define UMINUS 265
+
+
+
+
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+
+# define yystype YYSTYPE /* obsolescent; will be withdrawn */
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+
+
+
diff --git a/src/field.c b/src/field.c
new file mode 100644
index 0000000..0d687fd
--- /dev/null
+++ b/src/field.c
@@ -0,0 +1,593 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include "cdo.h"
+#include "cdo_int.h"
+#include <cdi.h>
+/* RQ */
+#include "nth_element.h"
+#include "merge_sort2.h"
+/* QR */
+
+double crps_det_integrate(double *a, const double d, const int n);
+
+double _FADD_(double x, double y, double missval1, double missval2)
+{
+  return FADD(x,y);
+}
+
+double _FSUB_(double x, double y, double missval1, double missval2)
+{
+  return FSUB(x, y);
+}
+
+double _FMUL_(double x, double y, double missval1, double missval2)
+{
+  return FMUL(x, y);
+}
+
+double _FDIV_(double x, double y, double missval1, double missval2)
+{
+  return FDIV(x, y);
+}
+
+double _FPOW_(double x, double y, double missval1, double missval2)
+{
+  return FPOW(x, y);
+}
+
+double _FSQRT_(double x, double missval1)
+{
+  return FSQRT(x);
+}
+
+
+double fldfun(field_t field, int function)
+{
+  double rval = 0;
+
+  // Why is this not a switch-case statement?
+  if      ( function == func_min  )  rval = fldmin(field);
+  else if ( function == func_max  )  rval = fldmax(field);
+  else if ( function == func_sum  )  rval = fldsum(field);
+  else if ( function == func_mean )  rval = fldmean(field);
+  else if ( function == func_avg  )  rval = fldavg(field);
+  else if ( function == func_std  )  rval = fldstd(field);
+  else if ( function == func_var  )  rval = fldvar(field);
+  
+  else if ( function == func_crps )  rval = fldcrps(field);
+  else if ( function == func_brs )   rval = fldbrs(field);
+
+  else if ( function == func_rank )  rval = fldrank(field);
+  else if ( function == func_roc )   rval = fldroc(field);
+  else cdoAbort("function %d not implemented!", function);
+
+  return rval;
+}
+
+double fldrank(field_t field) 
+{
+  double res = 0;
+  // Using first value as reference (observation)
+  double *array  =  &(field.ptr[1]);
+  double val     = array[-1];
+  double missval = field.missval;
+  int nmiss      = field.nmiss;
+  long len       = field.size-1;
+  int j;
+  
+  if ( nmiss ) 
+    return(missval);
+
+  sort_iter_single(len,array,1);
+
+  if ( val > array[len-1] ) 
+    res=(double)len;
+  else 
+    for ( j=0; j<len; j++ )
+      if ( array[j] >= val ) {
+	res=(double)j; 
+	break;
+      }
+  return res;
+}
+
+
+double fldroc(field_t field) 
+{
+  return field.missval;
+}
+
+double fldcrps(field_t field)
+{
+  long   len     = field.size;
+  int    nmiss   = field.nmiss;
+  double *array  = field.ptr;
+
+  if ( nmiss > 0 ) 
+    cdoAbort("Missing values not implemented in crps calculation");
+  // possible handling of missing values:
+  // (1) strip them off, and sort array without missing values
+  //     using only (len - 1 - nmiss) values
+  // (2) modify merge_sort in a way, that missing values will
+  //     always go to the end of the list
+
+  // Use first value as reference
+  sort_iter_single(len-1,&array[1],ompNumThreads);
+  return crps_det_integrate(&array[1],array[0],len-1);
+
+}
+
+
+double fldbrs(field_t field) 
+{
+  long      len   = field.size;
+  int     nmiss   = field.nmiss;
+  double *array   = field.ptr;
+  double missval  = field.missval;
+
+  double brs = 0;
+  int i,count=0;
+
+  // Using first value as reference
+  if ( nmiss == 0 ) 
+    {
+      for ( i=1; i<len; i++ )
+	brs += (array[i] - array[0]) * (array[i] - array[0]);
+      count = i-1;
+    }
+  else 
+    {
+      if ( DBL_IS_EQUAL(array[0], missval) ) return missval;
+
+      for ( i=1; i<len; i++ )
+	if ( !DBL_IS_EQUAL(array[i], missval) ) 
+	  {
+	    brs += (array[i] - array[0]) * (array[i] - array[0]);
+	    count ++;
+	  }
+    }
+
+  return brs/count;
+}
+
+
+double fldmin(field_t field)
+{
+  long   i;
+  long   len     = field.size;
+  int    nmiss   = field.nmiss;
+  double missval = field.missval;
+  double *array  = field.ptr;
+  double rmin = 0;
+
+  if ( nmiss > 0 )
+    {
+      rmin = DBL_MAX;
+      for ( i = 0; i < len; i++ ) 
+	if ( !DBL_IS_EQUAL(array[i], missval) )
+	  if ( array[i] < rmin ) rmin = array[i];
+
+      if ( IS_EQUAL(rmin, DBL_MAX) )
+	rmin = missval;
+    }
+  else
+    {
+      rmin = array[0];
+      for ( i = 1; i < len; i++ ) 
+	if ( array[i] < rmin )  rmin = array[i];
+    }
+
+  return (rmin);
+}
+
+
+double fldmax(field_t field)
+{
+  long   i;
+  long   len     = field.size;
+  int    nmiss   = field.nmiss;
+  double missval = field.missval;
+  double *array  = field.ptr;
+  double rmax = 0;
+
+  if ( nmiss > 0 )
+    {
+      rmax = -DBL_MAX;
+      for ( i = 0; i < len; i++ )
+        if ( !DBL_IS_EQUAL(array[i], missval) )
+          if ( array[i] > rmax ) rmax = array[i];
+      
+      if ( IS_EQUAL(rmax, -DBL_MAX) )
+        rmax = missval;
+    }
+  else
+    {
+      rmax = array[0];
+      for ( i = 1; i < len; i++ ) 
+        if ( array[i] > rmax )  rmax = array[i];
+    }
+
+  return (rmax);
+}
+
+
+double fldsum(field_t field)
+{
+  long   i;
+  long   nvals   = 0;
+  long   len     = field.size;
+  int    nmiss   = field.nmiss;
+  double missval = field.missval;
+  double *array  = field.ptr;
+  double rsum = 0;
+
+  if ( nmiss > 0 )
+    {
+      for ( i = 0; i < len; i++ ) 
+	if ( !DBL_IS_EQUAL(array[i], missval) )
+	  {
+	    rsum += array[i];
+	    nvals++;
+	  }
+
+      if ( !nvals ) rsum = missval;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+	rsum += array[i];
+    }
+
+  return (rsum);
+}
+
+
+double fldmean(field_t field)
+{
+  long   i;
+  long   len      = field.size;
+  int    nmiss    = field.nmiss;
+  double missval1 = field.missval;
+  double missval2 = field.missval;
+  double *array   = field.ptr;
+  double *w       = field.weight;
+  double rsum = 0, rsumw = 0, ravg = 0;
+
+  if ( nmiss > 0 )
+    {
+      for ( i = 0; i < len; i++ ) 
+	if ( !DBL_IS_EQUAL(array[i], missval1) && !DBL_IS_EQUAL(w[i], missval1) )
+	  {
+	    rsum  += w[i] * array[i];
+	    rsumw += w[i];
+	  }
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+	{
+	  rsum  += w[i] * array[i];
+	  rsumw += w[i];
+	}
+    }
+
+  ravg = DIV(rsum, rsumw);
+
+  return (ravg);
+}
+
+
+double fldavg(field_t field)
+{
+  long   i;
+  long   len      = field.size;
+  int    nmiss    = field.nmiss;
+  double missval1 = field.missval;
+  double missval2 = field.missval;
+  double *array   = field.ptr;
+  double *w       = field.weight;
+  double rsum = 0, rsumw = 0, ravg = 0;
+
+  if ( nmiss > 0 )
+    {
+      for ( i = 0; i < len; i++ ) 
+	if ( !DBL_IS_EQUAL(w[i], missval1) )
+	  {
+	    rsum  = ADD(rsum, MUL(w[i], array[i]));
+	    rsumw = ADD(rsumw, w[i]);
+	  }
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+	{
+	  rsum  += w[i] * array[i];
+	  rsumw += w[i];
+	}
+    }
+
+  ravg = DIV(rsum, rsumw);
+
+  return (ravg);
+}
+
+
+double fldvar(field_t field)
+{
+  long   i;
+  long   len     = field.size;
+  int    nmiss   = field.nmiss;
+  double missval = field.missval;
+  double *array  = field.ptr;
+  double *w      = field.weight;
+  double rsum = 0, rsumw = 0, rvar = 0;
+  double rsumq = 0, rsumwq = 0;
+
+  if ( nmiss > 0 )
+    {
+      for ( i = 0; i < len; i++ ) 
+        if ( !DBL_IS_EQUAL(array[i], missval) && !DBL_IS_EQUAL(w[i], missval) )
+          {
+            rsum   += w[i] * array[i];
+            rsumq  += w[i] * array[i] * array[i];
+            rsumw  += w[i];
+            rsumwq += w[i] * w[i];
+          }
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+        {
+          rsum   += w[i] * array[i];
+          rsumq  += w[i] * array[i] * array[i];
+          rsumw  += w[i];
+          rsumwq += w[i] * w[i];
+        }
+    }
+
+  rvar = IS_NOT_EQUAL(rsumw, 0) ? (rsumq*rsumw - rsum*rsum) / (rsumw*rsumw) : missval;
+  if ( rvar < 0 && rvar > -1.e-5 ) rvar = 0;
+
+  return (rvar);
+}
+
+
+double fldstd(field_t field)
+{
+  double missval = field.missval;
+  double rvar, rstd;
+
+  rvar = fldvar(field);
+
+  if ( DBL_IS_EQUAL(rvar, missval) || rvar < 0 )
+    {
+      rstd = missval;
+    }
+  else
+    {
+      rstd = IS_NOT_EQUAL(rvar, 0) ? sqrt(rvar) : 0;
+    }
+
+  return (rstd);
+}
+
+
+void fldrms(field_t field, field_t field2, field_t *field3)
+{
+  long   i, len;
+  int    rnmiss = 0;
+  int    grid1    = field.grid;
+  //  int    nmiss1   = field.nmiss;
+  double *array1  = field.ptr;
+  int    grid2    = field2.grid;
+  //  int    nmiss2   = field2.nmiss;
+  double *array2  = field2.ptr;
+  double missval1 = field.missval;
+  double missval2 = field2.missval;
+  double *w       = field.weight;
+  double rsum = 0, rsumw = 0, ravg = 0;
+
+  len    = gridInqSize(grid1);
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("fields have different size!");
+
+  /*
+  if ( nmiss1 > 0 )
+  */
+    {
+      for ( i = 0; i < len; i++ ) 
+	if ( !DBL_IS_EQUAL(w[i], missval1) )
+	  {
+	    rsum  = ADD(rsum, MUL(w[i], MUL(SUB(array2[i], array1[i]),
+                                            SUB(array2[i], array1[i]))));
+	    rsumw = ADD(rsumw, w[i]);
+	  }
+    }
+    /*
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+	{
+	  rsum  += w[i] * array1[i];
+	  rsumw += w[i];
+	}
+    }
+    */
+
+  ravg = SQRT(DIV(rsum, rsumw));
+
+  if ( DBL_IS_EQUAL(ravg, missval1) ) rnmiss++;
+
+  field3->ptr[0] = ravg;
+  field3->nmiss  = rnmiss;
+}
+
+
+void varrms(field_t field, field_t field2, field_t *field3)
+{
+  long   i, k, nlev, len;
+  int    rnmiss = 0;
+  int    zaxis    = field.zaxis;
+  int    grid1    = field.grid;
+  //  int    nmiss1   = field.nmiss;
+  double *array1  = field.ptr;
+  int    grid2    = field2.grid;
+  //  int    nmiss2   = field2.nmiss;
+  double *array2  = field2.ptr;
+  double missval1 = field.missval;
+  double missval2 = field2.missval;
+  double *w       = field.weight;
+  double rsum = 0, rsumw = 0, ravg = 0;
+
+  nlev   = zaxisInqSize(zaxis);
+  len    = gridInqSize(grid1);
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("fields have different size!");
+
+  /*
+  if ( nmiss1 > 0 )
+  */
+    {
+      for ( k = 0; k < nlev; k++ )
+	for ( i = 0; i < len; i++ )
+	  /*	  if ( !DBL_IS_EQUAL(w[i], missval1) ) */
+	    {
+	      rsum  = ADD(rsum, MUL(w[i], MUL(SUB(array2[k*len+i], array1[k*len+i]),
+                                              SUB(array2[k*len+i], array1[k*len+i]))));
+	      rsumw = ADD(rsumw, w[i]);
+	    }
+    }
+    /*
+  else
+    {
+      for ( i = 0; i < len; i++ )
+	{
+	  rsum  += w[i] * array1[i];
+	  rsumw += w[i];
+	}
+    }
+    */
+
+  ravg = SQRT(DIV(rsum, rsumw));
+
+  if ( DBL_IS_EQUAL(ravg, missval1) ) rnmiss++;
+
+  field3->ptr[0] = ravg;
+  field3->nmiss  = rnmiss;
+}
+
+/* RQ */
+double fldpctl(field_t field, int p)
+{
+  long   len     = field.size;
+  int    nmiss   = field.nmiss;
+  double missval = field.missval;
+  double *array  = field.ptr;
+  double *array2;
+
+  long i, j;
+  double pctl = missval;
+
+  if ( len - nmiss > 0 )
+    {
+      if ( nmiss > 0 )
+        {
+          array2 = (double *) malloc((len - nmiss)*sizeof(double));
+
+          for ( i = 0, j = 0; i < len; i++ ) 
+            if ( !DBL_IS_EQUAL(array[i], missval) )
+              array2[j++] = array[i];
+
+          pctl = nth_element(array2, j, (int)ceil(j*(p/100.0))-1);
+
+          free(array2);
+        }
+      else
+        {
+          pctl = nth_element(array, len, (int)ceil(len*(p/100.0))-1);
+        }
+    }
+
+  return pctl;
+}
+/* QR */
+
+/*  field_t UTILITIES */
+/*  update the number non missing values */
+void fldunm(field_t *field)
+{
+  long i;
+
+  field->nmiss = 0;
+  for ( i = 0; i < field->size; i++ )
+    if ( DBL_IS_EQUAL(field->ptr[i], field->missval) ) field->nmiss++;
+}
+
+/*  check for non missval values */
+int fldhvs(field_t *fieldPtr, int nlevels)
+{
+  int level;
+  field_t field;
+
+  for ( level = 0; level < nlevels; level++)
+    {
+      field = fieldPtr[level];
+      if ( field.nmiss != field.size )
+        return TRUE;
+    }
+  return FALSE;
+}
+
+
+
+double crps_det_integrate(double *a, const double d, const int n)
+{
+  /* *************************************************************************** */
+  /* This routine finds the area between the cdf described by the ordered array  */
+  /* of doubles (double *a) and the Heavyside function H(d)                      */
+  /* INPUT ARGUMENTS:                                                            */
+  /*     double *a  - ordered array of doubles describing a cdf                  */
+  /*                  as cdf(a[i]) = ( (double)i )/ n                            */
+  /*     double d   - describing a reference value                               */
+  /*     int n      - the length of array a                                      */
+  /* RETURN VALUE:                                                               */
+  /*     double     - area under the curve in units of a                         */
+  /* *************************************************************************** */
+
+  double area = 0; 
+  //  double tmp;
+  int i;
+#if defined (_OPENMP)
+#pragma omp parallel for if ( n>10000 ) shared(a) private(i) \
+  reduction(+:area) schedule(static,10000) 
+#endif                                                     /* **************************** */
+  for ( i=1; i<n; i++ ) {                                  /* INTEGRATE CURVE AREA         */
+    if ( a[i] < d )                                        /* left of heavyside            */
+      area += (a[i]-a[i-1])*(double)i*i/n/n;                   /*                              */
+    else if ( a[i-1] > d )                                 /* right of heavyside           */
+      area += (a[i]-a[i-1])*(1.-(double)i/n)*(1.-(double)i/n);              /*                              */
+    else if ( a[i-1] < d && a[i] > d ) {                   /* hitting jump pf heavyside    */
+      area += (d-a[i-1]) * (double)i*i/n/n;                    /* (occurs exactly once!)       */
+      area += (a[i]-d) * (1.-(double)i/n)*(1.-(double)i/n);                 /* **************************** */
+    }
+  }
+
+
+  return(area);
+}
+
diff --git a/src/field.h b/src/field.h
new file mode 100644
index 0000000..ae746c5
--- /dev/null
+++ b/src/field.h
@@ -0,0 +1,161 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _FIELD_H
+#define _FIELD_H
+
+#define  FIELD_NONE 0
+#define  FIELD_ALL  1
+#define  FIELD_PTR  2
+#define  FILED_WGT  3
+
+
+#define  FADD(x,y)  (DBL_IS_EQUAL((x),missval1) || DBL_IS_EQUAL((y),missval2) ? missval1 : (x)+(y))
+#define  FSUB(x,y)  (DBL_IS_EQUAL((x),missval1) || DBL_IS_EQUAL((y),missval2) ? missval1 : (x)-(y))
+#define  FMUL(x,y)  (DBL_IS_EQUAL((x),0.)||IS_EQUAL((y),0.) ? 0 : DBL_IS_EQUAL((x),missval1) || DBL_IS_EQUAL((y),missval2) ? missval1 : (x)*(y))
+#define  FDIV(x,y)  (DBL_IS_EQUAL((x),missval1) || DBL_IS_EQUAL((y),missval2) || DBL_IS_EQUAL((y),0.) ? missval1 : (x)/(y))
+#define  FPOW(x,y)  (DBL_IS_EQUAL((x),missval1) || DBL_IS_EQUAL((y),missval2) ? missval1 : pow((x),(y)))
+#define  FSQRT(x)   (DBL_IS_EQUAL((x),missval1) || (x)<0 ? missval1 : sqrt(x))
+
+
+double _FADD_(double x, double y, double missval1, double missval2);
+double _FSUB_(double x, double y, double missval1, double missval2);
+double _FMUL_(double x, double y, double missval1, double missval2);
+double _FDIV_(double x, double y, double missval1, double missval2);
+double _FPOW_(double x, double y, double missval1, double missval2);
+double _FSQRT_(double x, double missval1);
+
+
+#define ADD(x,y)  _FADD_(x, y, missval1, missval2)
+#define SUB(x,y)  _FSUB_(x, y, missval1, missval2)
+#define MUL(x,y)  _FMUL_(x, y, missval1, missval2)
+#define DIV(x,y)  _FDIV_(x, y, missval1, missval2)
+#define POW(x,y)  _FPOW_(x, y, missval1, missval2)
+#define SQRT(x)   _FSQRT_(x, missval1)
+
+
+typedef struct {
+  int      grid;
+  int      zaxis;
+  int      size;
+  int      nsamp;
+  int      nmiss;
+  double   missval;
+  double  *weight;
+  double  *ptr;
+}
+field_t;
+
+/* fieldmem.c */
+
+field_t **field_malloc(int vlistID, int ptype);
+field_t **field_calloc(int vlistID, int ptype);
+void      field_free(field_t **field, int vlistID);
+
+/* field.c */
+
+double fldfun(field_t field, int function);
+double fldmin(field_t field);
+double fldmax(field_t field);
+double fldsum(field_t field);
+double fldavg(field_t field);
+double fldmean(field_t field);
+double fldstd(field_t field);
+double fldvar(field_t field);
+/* RQ */
+double fldpctl(field_t field, int k);
+/* QR */
+void   fldunm(field_t *field);
+int    fldhvs(field_t *field, int nlevels);
+
+/* ENS VALIDATION */
+double fldcrps(field_t field);
+double fldbrs(field_t field);
+double fldrank(field_t field);
+double fldroc(field_t field);
+
+/* fieldzon.c */
+
+void zonfun(field_t field1, field_t *field2, int function);
+void zonmin(field_t field1, field_t *field2);
+void zonmax(field_t field1, field_t *field2);
+void zonrange(field_t field1, field_t *field2);
+void zonsum(field_t field1, field_t *field2);
+void zonavg(field_t field1, field_t *field2);
+void zonmean(field_t field1, field_t *field2);
+void zonstd(field_t field1, field_t *field2);
+void zonvar(field_t field1, field_t *field2);
+/* RQ */
+void zonpctl(field_t field1, field_t *field2, int k);
+/* QR */
+
+/* fieldmer.c */
+
+void merfun(field_t field1, field_t *field2, int function);
+void mermin(field_t field1, field_t *field2);
+void mermax(field_t field1, field_t *field2);
+void mersum(field_t field1, field_t *field2);
+void meravg(field_t field1, field_t *field2);
+void mermean(field_t field1, field_t *field2);
+void merstd(field_t field1, field_t *field2);
+void mervar(field_t field1, field_t *field2);
+/* RQ */
+void merpctl(field_t field1, field_t *field2, int k);
+/* QR */
+
+void fldrms(field_t field1, field_t field2, field_t *field3);
+
+void varrms(field_t field1, field_t field2, field_t *field3);
+
+/* fieldc.c */
+
+void farcfun(field_t *field, double rconst, int function);
+
+void farcmul(field_t *field, double rconst);
+void farcdiv(field_t *field, double rconst);
+void farcadd(field_t *field, double rconst);
+void farcsub(field_t *field, double rconst);
+
+void farmod(field_t *field, double divisor);
+
+void farinv(field_t *field);
+
+/* field2.c */
+
+void farfun(field_t *field1, field_t field2, int function);
+
+void faradd(field_t *field1, field_t field2);
+void farsum(field_t *field1, field_t field2);
+void farsumq(field_t *field1, field_t field2);
+void farsumtr(field_t *field1, field_t field2, double refval);
+void farsub(field_t *field1, field_t field2);
+void farmul(field_t *field1, field_t field2);
+void fardiv(field_t *field1, field_t field2);
+void farmin(field_t *field1, field_t field2);
+void farmax(field_t *field1, field_t field2);
+void farvar(field_t *field1, field_t field2, field_t field3);
+void farstd(field_t *field1, field_t field2, field_t field3);
+void farcvar(field_t *field1, field_t field2, double rconst1);
+void farcstd(field_t *field1, field_t field2, double rconst1);
+void farmoq(field_t *field1, field_t field2);
+void faratan2(field_t *field1, field_t field2);
+
+/* RQ */
+void farcount(field_t *field1, field_t field2);
+/* QR */
+
+#endif  /* _FIELD_H */
diff --git a/src/field2.c b/src/field2.c
new file mode 100644
index 0000000..b36f46c
--- /dev/null
+++ b/src/field2.c
@@ -0,0 +1,673 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include "cdo.h"
+#include "cdo_int.h"
+#include <cdi.h>
+
+#ifdef __SSE2__
+#include <emmintrin.h>
+#endif
+
+void farfun(field_t *field1, field_t field2, int function)
+{
+  if      ( function == func_add   ) faradd(field1, field2);
+  else if ( function == func_min   ) farmin(field1, field2);
+  else if ( function == func_max   ) farmax(field1, field2);
+  else if ( function == func_sum   ) farsum(field1, field2);
+  else if ( function == func_mean  ) farsum(field1, field2);
+  else if ( function == func_avg   ) faradd(field1, field2);
+  else if ( function == func_sub   ) farsub(field1, field2);
+  else if ( function == func_mul   ) farmul(field1, field2);
+  else if ( function == func_div   ) fardiv(field1, field2);
+  else if ( function == func_atan2 ) faratan2(field1, field2);
+  else cdoAbort("function %d not implemented!", function);
+}
+
+static
+void arradd(const long n, double * const restrict a, const double * const restrict b)
+{
+  long i;
+ 
+  // SSE2 version is 15% faster than the original loop (tested with gcc47)
+#if 0
+  //#ifdef __SSE2__ /*__SSE2__*/ // bug in this code!!!
+  long residual =  n % 8;
+  long ofs = n - residual;
+
+  __m128d *av = (__m128d *) a; // assume 16-byte aligned
+  __m128d *bv = (__m128d *) b; // assume 16-byte aligned
+  for ( i = 0; i < n/2; i+=4 )
+    {
+      av[i  ] = _mm_add_pd(av[i  ], bv[i  ]);
+      av[i+1] = _mm_add_pd(av[i+1], bv[i+1]);
+      av[i+2] = _mm_add_pd(av[i+2], bv[i+2]);
+      av[i+3] = _mm_add_pd(av[i+3], bv[i+3]);
+    }
+  printf("residual, ofs, n %ld %ld %ld\n", residual, ofs, n);
+  for ( i = 0; i < residual; i++ )  a[ofs+i] += b[ofs+i];
+
+#else
+
+  for ( i = 0; i < n; i++ ) a[i] += b[i];
+
+#endif
+}
+
+void faradd(field_t *field1, field_t field2)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  int    nmiss1   = field1->nmiss;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  /*  double *weight1 = field1->weight; */
+  int    grid2    = field2.grid;
+  int    nmiss2   = field2.nmiss;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ ) 
+	array1[i] = ADD(array1[i], array2[i]);
+
+      field1->nmiss = 0;
+      for ( i = 0; i < len; i++ )
+	if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+    }
+  else
+    {
+      arradd(len, array1, array2);
+    }
+}
+
+
+void farsum(field_t *field1, field_t field2)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  int    nmiss1   = field1->nmiss;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  /*  double *weight1 = field1->weight; */
+  int    grid2    = field2.grid;
+  int    nmiss2   = field2.nmiss;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+	if ( !DBL_IS_EQUAL(array2[i], missval2) )
+	  {
+	    if ( !DBL_IS_EQUAL(array1[i], missval1) )
+	      array1[i] += array2[i];
+	    else
+	      array1[i] = array2[i];
+	  }
+
+      field1->nmiss = 0;
+      for ( i = 0; i < len; i++ )
+	if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+    }
+  else
+    {
+      arradd(len, array1, array2);
+    }
+}
+
+/* 
+ * Compute the occurrence of values in field, if they do not equal refval.
+ * This can be used to compute the lengths of multiple periods in a timeseries.
+ * Missing field values are handled like refval, i.e. they stop a running
+ * period. If there is missing data in the occurence field, missing fields
+ * values do not change anything (they do not start a non-period by setting
+ * occurrence to zero).
+ */
+void farsumtr(field_t *occur, field_t field, double refval)
+{
+  long   i, len;
+  double omissval = occur->missval;
+  double  *oarray = occur->ptr;
+  double fmissval = field.missval;
+  double  *farray = field.ptr;
+
+  len    = gridInqSize(occur->grid);
+  if ( len != gridInqSize(field.grid) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( occur->nmiss > 0 || field.nmiss > 0 )
+    {
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) schedule(static)
+#endif
+      for ( i = 0; i < len; i++ )
+	if ( !DBL_IS_EQUAL(farray[i], fmissval) )
+	  {
+	    if ( !DBL_IS_EQUAL(oarray[i], omissval) )
+	      oarray[i] = (DBL_IS_EQUAL(farray[i], refval)) ? 0.0 : oarray[i] + 1.0;
+	    else
+	      oarray[i] = (DBL_IS_EQUAL(farray[i], refval)) ? 0.0 : 1.0;
+	  }
+	else
+	{
+	  if ( !DBL_IS_EQUAL(oarray[i], omissval) )
+	    oarray[i] = 0.0;
+	}
+
+      occur->nmiss = 0;
+      for ( i = 0; i < len; i++ )
+	if ( DBL_IS_EQUAL(oarray[i], omissval) ) occur->nmiss++;
+    }
+  else
+    {
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared)
+#endif
+      for ( i = 0; i < len; i++ ) 
+	oarray[i] = (DBL_IS_EQUAL(farray[i], refval)) ? 0.0 : oarray[i] + 1.0;
+    }
+}
+
+
+void farsumq(field_t *field1, field_t field2)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  int    nmiss1   = field1->nmiss;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  /*  double *weight1 = field1->weight; */
+  int    grid2    = field2.grid;
+  int    nmiss2   = field2.nmiss;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+	if ( !DBL_IS_EQUAL(array2[i], missval2) )
+	  {
+	    if ( !DBL_IS_EQUAL(array1[i], missval1) )
+	      array1[i] += array2[i]*array2[i];
+	    else
+	      array1[i] = array2[i]*array2[i];
+	  }
+
+      field1->nmiss = 0;
+      for ( i = 0; i < len; i++ )
+	if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+	array1[i] += array2[i]*array2[i];
+    }
+}
+
+
+void farsub(field_t *field1, field_t field2)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  int    nmiss1   = field1->nmiss;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  int    grid2    = field2.grid;
+  int    nmiss2   = field2.nmiss;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ ) 
+	array1[i] = SUB(array1[i], array2[i]);
+
+      field1->nmiss = 0;
+      for ( i = 0; i < len; i++ )
+	if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+	array1[i] -= array2[i];
+    }
+}
+
+
+void farmul(field_t *field1, field_t field2)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  int    nmiss1   = field1->nmiss;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  int    grid2    = field2.grid;
+  int    nmiss2   = field2.nmiss;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ ) 
+	array1[i] = MUL(array1[i], array2[i]);
+
+      field1->nmiss = 0;
+      for ( i = 0; i < len; i++ )
+	if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+	array1[i] *= array2[i];
+    }
+}
+
+
+void fardiv(field_t *field1, field_t field2)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  int    grid2    = field2.grid;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  for ( i = 0; i < len; i++ ) 
+    array1[i] = DIV(array1[i], array2[i]);
+
+  field1->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+}
+
+
+void faratan2(field_t *field1, field_t field2)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  int    grid2    = field2.grid;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  for ( i = 0; i < len; i++ ) 
+    array1[i] = DBL_IS_EQUAL(array1[i],missval1) || DBL_IS_EQUAL(array2[i],missval2) ? missval1 : atan2(array1[i], array2[i]);
+
+  field1->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+}
+
+
+void farmin(field_t *field1, field_t field2)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  int    nmiss1   = field1->nmiss;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  int    grid2    = field2.grid;
+  int    nmiss2   = field2.nmiss;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+	{
+	  array1[i] = DBL_IS_EQUAL(array2[i], missval2) ? array1[i] :
+	              DBL_IS_EQUAL(array1[i], missval1) ? array2[i] :
+		      MIN(array1[i], array2[i]);
+	}
+
+      field1->nmiss = 0;
+      for ( i = 0; i < len; i++ )
+	if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ )
+	array1[i] = MIN(array1[i], array2[i]);
+    }
+}
+
+
+void farmax(field_t *field1, field_t field2)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  int    nmiss1   = field1->nmiss;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  int    grid2    = field2.grid;
+  int    nmiss2   = field2.nmiss;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+	{
+	  array1[i] = DBL_IS_EQUAL(array2[i], missval2) ? array1[i] :
+	              DBL_IS_EQUAL(array1[i], missval1) ? array2[i] :
+		      MAX(array1[i], array2[i]);
+	}
+
+      field1->nmiss = 0;
+      for ( i = 0; i < len; i++ )
+	if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ )
+	array1[i] = MAX(array1[i], array2[i]);
+    }
+}
+
+
+void farvar(field_t *field1, field_t field2, field_t field3)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  int    nmiss1   = field1->nmiss;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  int    grid2    = field2.grid;
+  int    nmiss2   = field2.nmiss;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+  double *array3  = field3.ptr;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+	if ( !DBL_IS_EQUAL(array1[i], missval1) && !DBL_IS_EQUAL(array2[i], missval2) )
+	  {
+	    array1[i] = array2[i]*array3[i] - (array1[i]*array3[i])*(array1[i]*array3[i]);
+	    if ( array1[i] < 0 && array1[i] > -1.e-5 ) array1[i] = 0;
+	  }
+	else
+	  array1[i] = missval1;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ )
+	{
+	  array1[i] = array2[i]*array3[i] - (array1[i]*array3[i])*(array1[i]*array3[i]);
+	  if ( array1[i] < 0 && array1[i] > -1.e-5 ) array1[i] = 0;
+	}
+    }
+
+  field1->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array1[i], missval1) || array1[i] < 0 )
+      {
+	array1[i] = missval1;
+	field1->nmiss++;
+      }
+}
+
+
+void farstd(field_t *field1, field_t field2, field_t field3)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  int    grid2    = field2.grid;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  farvar(field1, field2, field3);
+
+  field1->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array1[i], missval1) || array1[i] < 0 )
+      {
+	array1[i] = missval1;
+	field1->nmiss++;
+      }
+    else
+      {
+	array1[i] = IS_NOT_EQUAL(array1[i], 0) ? sqrt(array1[i]) : 0;
+      }
+}
+
+
+void farcvar(field_t *field1, field_t field2, double rconst1)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  int    nmiss1   = field1->nmiss;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  int    grid2    = field2.grid;
+  int    nmiss2   = field2.nmiss;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+	if ( !DBL_IS_EQUAL(array1[i], missval1) && !DBL_IS_EQUAL(array2[i], missval2) )
+	  {
+	    array1[i] = array2[i]*rconst1 - (array1[i]*rconst1)*(array1[i]*rconst1);
+	    if ( array1[i] < 0 && array1[i] > -1.e-5 ) array1[i] = 0;
+	  }
+	else
+	  array1[i] = missval1;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ )
+	{
+	  array1[i] = array2[i]*rconst1 - (array1[i]*rconst1)*(array1[i]*rconst1);
+	  if ( array1[i] < 0 && array1[i] > -1.e-5 ) array1[i] = 0;
+	}
+    }
+
+  field1->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array1[i], missval1) || array1[i] < 0 )
+      {
+	array1[i] = missval1;
+	field1->nmiss++;
+      }
+}
+
+
+void farcstd(field_t *field1, field_t field2, double rconst1)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  int    grid2    = field2.grid;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  farcvar(field1, field2, rconst1);
+
+  field1->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array1[i], missval1) || array1[i] < 0 )
+      {
+	array1[i] = missval1;
+	field1->nmiss++;
+      }
+    else
+      {
+	array1[i] = IS_NOT_EQUAL(array1[i], 0) ? sqrt(array1[i]) : 0;
+      }
+}
+
+
+void farmoq(field_t *field1, field_t field2)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  int    grid2    = field2.grid;
+  int    nmiss2   = field2.nmiss;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+	if ( !DBL_IS_EQUAL(array2[i], missval2) )
+	  array1[i] = array2[i]*array2[i];
+	else
+	  array1[i] = missval1;
+
+      field1->nmiss = 0;
+      for ( i = 0; i < len; i++ )
+	if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+	array1[i] = array2[i]*array2[i];
+    }
+}
+
+
+/* RQ */
+/**
+ * Counts the number of nonmissing values. The result of the operation
+ * is computed according to the following rules:
+ * 
+ * field1  field2  result
+ * a       b       a + 1
+ * a       miss    a
+ * miss    b       1
+ * miss    miss    miss
+ * 
+ * @param field1 the 1st input field, also holds the result
+ * @param field2 the 2nd input field
+ */  
+void farcount(field_t *field1, field_t field2)
+{
+  long   i, len;
+  int    grid1    = field1->grid;
+  int    nmiss1   = field1->nmiss;
+  double missval1 = field1->missval;
+  double *array1  = field1->ptr;
+  /*  double *weight1 = field1->weight; */
+  int    grid2    = field2.grid;
+  int    nmiss2   = field2.nmiss;
+  double missval2 = field2.missval;
+  double *array2  = field2.ptr;
+
+  len    = gridInqSize(grid1);
+
+  if ( len != gridInqSize(grid2) )
+    cdoAbort("Fields have different gridsize (%s)", __func__);
+
+  if ( nmiss1 > 0 || nmiss2 > 0 )
+    {
+      for ( i = 0; i < len; i++ )
+	if ( !DBL_IS_EQUAL(array2[i], missval2) )
+	  {
+	    if ( !DBL_IS_EQUAL(array1[i], missval1) )
+	      array1[i] += 1.0;
+	    else
+	      array1[i] = 1.0;
+	  }
+
+      field1->nmiss = 0;
+      for ( i = 0; i < len; i++ )
+	if ( DBL_IS_EQUAL(array1[i], missval1) ) field1->nmiss++;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+	array1[i] += 1.0;
+    }
+}
+/* QR */
diff --git a/src/fieldc.c b/src/fieldc.c
new file mode 100644
index 0000000..bfbbb43
--- /dev/null
+++ b/src/fieldc.c
@@ -0,0 +1,150 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include "cdo.h"
+#include "cdo_int.h"
+#include <cdi.h>
+
+
+void farcfun(field_t *field, double rconst, int function)
+{
+  if      ( function == func_add ) farcadd(field, rconst);
+  else if ( function == func_sub ) farcsub(field, rconst);
+  else if ( function == func_mul ) farcmul(field, rconst);
+  else if ( function == func_div ) farcdiv(field, rconst);
+  else if ( function == func_mod ) farmod(field, rconst);
+  else    cdoAbort("function %d not implemented!", function);
+}
+
+void farcmul(field_t *field, double rconst)
+{
+  int i, len;
+  int    grid     = field->grid;
+  int    nmiss    = field->nmiss;
+  double missval1 = field->missval;
+  double missval2 = field->missval;
+  double *array   = field->ptr;
+
+  len    = gridInqSize(grid);
+
+  if ( nmiss > 0 )
+    {
+      for ( i = 0; i < len; i++ ) 
+	array[i] = MUL(array[i], rconst);
+    }
+  else
+    {
+      /*
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i)
+#endif
+      */
+      for ( i = 0; i < len; i++ ) 
+	array[i] *= rconst;
+    }
+}
+
+
+void farcdiv(field_t *field, double rconst)
+{
+  int i, len;
+  int    grid     = field->grid;
+  int    nmiss    = field->nmiss;
+  double missval1 = field->missval;
+  double missval2 = field->missval;
+  double *array   = field->ptr;
+
+  len    = gridInqSize(grid);
+
+  if ( nmiss > 0 || IS_EQUAL(rconst, 0) )
+    {
+      for ( i = 0; i < len; i++ )
+	array[i] = DIV(array[i], rconst);
+
+      if ( IS_EQUAL(rconst, 0) ) field->nmiss = len;
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+	array[i] /= rconst;
+    }
+}
+
+
+void farcadd(field_t *field, double rconst)
+{
+  int i, len;
+  int    grid     = field->grid;
+  int    nmiss    = field->nmiss;
+  double missval1 = field->missval;
+  double missval2 = field->missval;
+  double *array   = field->ptr;
+
+  len    = gridInqSize(grid);
+
+  if ( nmiss > 0 )
+    {
+      for ( i = 0; i < len; i++ ) 
+	array[i] = ADD(array[i], rconst);
+    }
+  else
+    {
+      for ( i = 0; i < len; i++ ) 
+	array[i] += rconst;
+    }
+}
+
+
+void farcsub(field_t *field, double rconst)
+{
+  farcadd(field, -rconst);
+}
+
+
+void farinv(field_t *field)
+{
+  int i, len;
+  int    grid     = field->grid;
+  double missval1 = field->missval;
+  double missval2 = field->missval;
+  double *array   = field->ptr;
+
+  len    = gridInqSize(grid);
+
+  for ( i = 0; i < len; i++ ) 
+    array[i] = DIV(1.0, array[i]);
+
+  field->nmiss = 0;
+  for ( i = 0; i < len; i++ )
+    if ( DBL_IS_EQUAL(array[i], missval1) ) field->nmiss++;
+}
+
+
+void farmod(field_t *field, double divisor)
+{
+  int i, len;
+  int    grid     = field->grid;
+  double missval1 = field->missval;
+  double *array   = field->ptr;
+
+  len    = gridInqSize(grid);
+
+  for ( i = 0; i < len; i++ )
+    {
+      array[i] = DBL_IS_EQUAL(array[i], missval1) ? missval1 : fmod(array[i], divisor);
+    }
+}
diff --git a/src/fieldmem.c b/src/fieldmem.c
new file mode 100644
index 0000000..8953299
--- /dev/null
+++ b/src/fieldmem.c
@@ -0,0 +1,88 @@
+#include <string.h>
+
+#include <cdi.h>
+#include "dmemory.h"
+#include "field.h"
+
+
+field_t **field_allocate(int vlistID, int ptype, int init)
+{
+  int nvars, nlevel;
+  int varID, zaxisID, levelID;
+  int gridID, gridsize;
+  double missval;
+  field_t **field;
+
+  nvars = vlistNvars(vlistID);
+
+  field = (field_t **) malloc(nvars*sizeof(field_t *));
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      gridID   = vlistInqVarGrid(vlistID, varID);
+      gridsize = gridInqSize(gridID);
+      zaxisID  = vlistInqVarZaxis(vlistID, varID);
+      nlevel   = zaxisInqSize(zaxisID);
+      missval  = vlistInqVarMissval(vlistID, varID);
+
+      field[varID] = (field_t *)  malloc(nlevel*sizeof(field_t));
+      for ( levelID = 0; levelID < nlevel; ++levelID )
+	{
+	  field[varID][levelID].grid    = gridID;
+	  field[varID][levelID].nsamp   = 0;
+	  field[varID][levelID].nmiss   = 0;
+	  field[varID][levelID].missval = missval;
+	  field[varID][levelID].ptr     = NULL;
+	  field[varID][levelID].weight  = NULL;
+
+	  if ( ptype == FIELD_ALL || ptype == FIELD_PTR )
+	    {
+	      field[varID][levelID].ptr = (double *) malloc(gridsize*sizeof(double));
+	      if ( init ) memset(field[varID][levelID].ptr, 0, gridsize*sizeof(double));
+	    }
+
+	  if ( ptype == FIELD_ALL || ptype == FIELD_PTR )
+	    {
+	      field[varID][levelID].weight = (double *) malloc(gridsize*sizeof(double));
+	      if ( init ) memset(field[varID][levelID].weight, 0, gridsize*sizeof(double));
+	    }    
+	}
+    }
+
+  return (field);
+}
+
+
+field_t **field_malloc(int vlistID, int ptype)
+{
+  return (field_allocate(vlistID, ptype, 0));
+}
+
+
+field_t **field_calloc(int vlistID, int ptype)
+{
+  return (field_allocate(vlistID, ptype, 1));
+}
+
+
+void field_free(field_t **field, int vlistID)
+{
+  int nvars, nlevel;
+  int varID, levelID;
+
+  nvars = vlistNvars(vlistID);
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      nlevel = zaxisInqSize(vlistInqVarZaxis(vlistID, varID));
+      for ( levelID = 0; levelID < nlevel; ++levelID )
+	{
+	  if ( field[varID][levelID].ptr )    free(field[varID][levelID].ptr);
+       	  if ( field[varID][levelID].weight ) free(field[varID][levelID].weight);
+	}
+
+      free(field[varID]);
+    }
+
+  free(field);
+}
diff --git a/src/fieldmer.c b/src/fieldmer.c
new file mode 100644
index 0000000..1711503
--- /dev/null
+++ b/src/fieldmer.c
@@ -0,0 +1,410 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include "cdo.h"
+#include "cdo_int.h"
+#include <cdi.h>
+/* RQ */
+#include "nth_element.h"
+/* QR */
+
+void merfun(field_t field1, field_t *field2, int function)
+{
+  if      ( function == func_min )  mermin(field1, field2);
+  else if ( function == func_max )  mermax(field1, field2);  
+  else if ( function == func_sum )  mersum(field1, field2);  
+  else if ( function == func_mean ) mermean(field1, field2);  
+  else if ( function == func_avg )  meravg(field1, field2);  
+  else if ( function == func_std )  merstd(field1, field2);  
+  else if ( function == func_var )  mervar(field1, field2);
+  else cdoAbort("function %d not implemented!", function);
+}
+
+
+void mermin(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  int    rnmiss = 0;
+  int    grid    = field1.grid;
+  int    nmiss   = field1.nmiss;
+  double missval = field1.missval;
+  double *array  = field1.ptr;
+  double rmin = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( i = 0; i < nx; i++ )
+    {
+      if ( nmiss > 0 )
+	{
+	  rmin = DBL_MAX;
+	  for ( j = 0; j < ny; j++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval) )
+	      if ( array[j*nx+i] < rmin ) rmin = array[j*nx+i];
+
+	  if ( IS_EQUAL(rmin, DBL_MAX) )
+	    {
+	      rnmiss++;
+	      rmin = missval;
+	    }
+	}
+      else
+	{
+	  rmin = DBL_MAX;
+	  for ( j = 0; j < ny; j++ )
+	    if ( array[j*nx+i] < rmin )  rmin = array[j*nx+i];
+	}
+
+      field2->ptr[i] = rmin;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void mermax(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  int    rnmiss = 0;
+  int    grid    = field1.grid;
+  int    nmiss   = field1.nmiss;
+  double missval = field1.missval;
+  double *array  = field1.ptr;
+  double rmax = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( i = 0; i < nx; i++ )
+    {
+      if ( nmiss > 0 )
+	{
+	  rmax = -DBL_MAX;
+	  for ( j = 0; j < ny; j++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval) )
+	      if ( array[j*nx+i] > rmax ) rmax = array[j*nx+i];
+
+	  if ( IS_EQUAL(rmax, -DBL_MAX) )
+	    {
+	      rnmiss++;
+	      rmax = missval;
+	    }
+	}
+      else
+	{
+	  rmax = DBL_MIN;
+	  for ( j = 0; j < ny; j++ )
+	    if ( array[j*nx+i] > rmax )  rmax = array[j*nx+i];
+	}
+
+      field2->ptr[i] = rmax;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void mersum(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  long   nvals   = 0;
+  int    rnmiss  = 0;
+  int    grid    = field1.grid;
+  int    nmiss   = field1.nmiss;
+  double missval = field1.missval;
+  double *array  = field1.ptr;
+  double rsum = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( i = 0; i < nx; i++ )
+    {
+      if ( nmiss > 0 )
+	{
+	  nvals = 0;
+	  rsum = 0;
+	  for ( j = 0; j < ny; j++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval) )
+	      {
+		rsum += array[j*nx+i];
+		nvals++;
+	      }
+
+	  if ( !nvals )
+	    {
+	      rsum = missval;
+	      rnmiss++;
+	    }
+	}
+      else
+	{
+	  rsum = 0;
+	  for ( j = 0; j < ny; j++ )
+	    rsum += array[j*nx+i];
+	}
+
+      field2->ptr[i] = rsum;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void mermean(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  int    rnmiss = 0;
+  int    grid    = field1.grid;
+  int    nmiss   = field1.nmiss;
+  double missval1 = field1.missval;
+  double missval2 = field1.missval;
+  double *array  = field1.ptr;
+  double *w      = field1.weight;
+  double rsum = 0, rsumw = 0, ravg = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( i = 0; i < nx; i++ )
+    {
+      rsum  = 0;
+      rsumw = 0;
+      if ( nmiss > 0 )
+	{
+	  for ( j = 0; j < ny; j++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval1) &&
+		 !DBL_IS_EQUAL(w[j*nx+i], missval1) )
+	      {
+		rsum  += w[j*nx+i] * array[j*nx+i];
+		rsumw += w[j*nx+i];
+	      }
+	}
+      else
+	{
+	  for ( j = 0; j < ny; j++ )
+	    {
+	      rsum  += w[j*nx+i] * array[j*nx+i];
+	      rsumw += w[j*nx+i];
+	    }
+	}
+
+      ravg = DIV(rsum, rsumw);
+
+      if ( DBL_IS_EQUAL(ravg, missval1) ) rnmiss++;
+
+      field2->ptr[i] = ravg;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void meravg(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  int    rnmiss = 0;
+  int    grid     = field1.grid;
+  int    nmiss    = field1.nmiss;
+  double missval1 = field1.missval;
+  double missval2 = field1.missval;
+  double *array   = field1.ptr;
+  double *w       = field1.weight;
+  double rsum = 0, rsumw = 0, ravg = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( i = 0; i < nx; i++ )
+    {
+      rsum  = 0;
+      rsumw = 0;
+      if ( nmiss > 0 )
+	{
+	  for ( j = 0; j < ny; j++ )
+	    if ( !DBL_IS_EQUAL(w[j*nx+i], missval1) )
+	      {
+		rsum  = ADD(rsum, MUL(w[j*nx+i], array[j*nx+i]));
+		rsumw += w[j*nx+i];
+	      }
+	}
+      else
+	{
+	  for ( j = 0; j < ny; j++ )
+	    {
+	      rsum  += w[j*nx+i] * array[j*nx+i];
+	      rsumw += w[j*nx+i];
+	    }
+	}
+
+      ravg = DIV(rsum, rsumw);
+
+      if ( DBL_IS_EQUAL(ravg, missval1) ) rnmiss++;
+
+      field2->ptr[i] = ravg;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void mervar(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  int    rnmiss = 0;
+  int    grid    = field1.grid;
+  int    nmiss   = field1.nmiss;
+  double missval = field1.missval;
+  double *array  = field1.ptr;
+  double *w      = field1.weight;
+  double rsum = 0, rsumw = 0, rvar = 0;
+  double rsumq = 0, rsumwq = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( i = 0; i < nx; i++ )
+    {
+      rsum   = 0;
+      rsumq  = 0;
+      rsumw  = 0;
+      rsumwq = 0;
+      if ( nmiss > 0 )
+	{
+	  for ( j = 0; j < ny; j++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval) &&
+		 !DBL_IS_EQUAL(w[j*nx+i], missval) )
+	      {
+		rsum   += w[j*nx+i] * array[j*nx+i];
+		rsumq  += w[j*nx+i] * array[j*nx+i] * array[j*nx+i];
+		rsumw  += w[j*nx+i];
+		rsumwq += w[j*nx+i] * w[j*nx+i];
+	      }
+	}
+      else
+	{
+	  for ( j = 0; j < ny; j++ )
+	    {
+	      rsum   += w[j*nx+i] * array[j*nx+i];
+	      rsumq  += w[j*nx+i] * array[j*nx+i] * array[j*nx+i];
+	      rsumw  += w[j*nx+i];
+	      rsumwq += w[j*nx+i] * w[j*nx+i];
+	    }
+	}
+
+      rvar = IS_NOT_EQUAL(rsumw, 0) ? (rsumq*rsumw - rsum*rsum) / (rsumw*rsumw) : missval;
+      if ( rvar < 0 && rvar > -1.e-5 ) rvar = 0;
+
+      if ( DBL_IS_EQUAL(rvar, missval) ) rnmiss++;
+
+      field2->ptr[i] = rvar;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void merstd(field_t field1, field_t *field2)
+{
+  long   i, nx;
+  int    rnmiss = 0;
+  int    grid    = field1.grid;
+  double missval = field1.missval;
+  double rvar, rstd;
+
+  nx    = gridInqXsize(grid);
+
+  mervar(field1, field2);
+
+  for ( i = 0; i < nx; i++ )
+    {
+      rvar = field2->ptr[i];
+
+      if ( DBL_IS_EQUAL(rvar, missval) || rvar < 0 )
+	{
+	  rstd = missval;
+	}
+      else
+	{
+	  rstd = IS_NOT_EQUAL(rvar, 0) ? sqrt(rvar) : 0;
+	}
+
+      if ( DBL_IS_EQUAL(rvar, missval) ) rnmiss++;
+
+      field2->ptr[i] = rstd;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+/* RQ */
+void merpctl(field_t field1, field_t *field2, int p)
+{
+  long   i, j, l, nx, ny;
+  int    rnmiss = 0;
+  int    grid    = field1.grid;
+  int    nmiss   = field1.nmiss;
+  double missval = field1.missval;
+  double *array  = field1.ptr;
+  double *array2;
+
+  nx = gridInqXsize(grid);
+  ny = gridInqYsize(grid);
+  
+  array2 = (double *) malloc(nx*sizeof(double));
+  
+  if ( nmiss > 0 )
+    {
+      for ( i = 0; i < nx; i++ )
+        {
+          for ( j = 0, l = 0; j < ny; j++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval) )
+	      array2[l++] = array[j*nx+i];
+	    
+          if ( l > 0 )
+            {
+              field2->ptr[i] = nth_element(array2, l, (int)ceil(l*(p/100.0))-1);
+            }
+          else
+            {
+              field2->ptr[i] = missval;
+              rnmiss++;
+            }
+        }
+    }
+  else
+    {
+      for ( i = 0; i < nx; i++ )
+      	{
+          if ( ny > 0 )
+            {
+              for ( j = 0; j < ny; j++ )
+                array2[j] = array[j*nx+i];
+              field2->ptr[i] = nth_element(array2, ny, (int)ceil(ny*(p/100.0))-1);
+            }
+          else
+            {
+              field2->ptr[i] = missval;
+              rnmiss++;
+            }
+      	}
+    }
+
+  field2->nmiss = rnmiss;
+}
+/* QR */
diff --git a/src/fieldzon.c b/src/fieldzon.c
new file mode 100644
index 0000000..8e0b74b
--- /dev/null
+++ b/src/fieldzon.c
@@ -0,0 +1,464 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include "cdo.h"
+#include "cdo_int.h"
+#include <cdi.h>
+/* RQ */
+#include "nth_element.h"
+/* QR */
+
+
+void zonfun(field_t field1, field_t *field2, int function)
+{
+  if      ( function == func_min   )  zonmin(field1, field2);
+  else if ( function == func_max   )  zonmax(field1, field2);  
+  else if ( function == func_range )  zonrange(field1, field2);  
+  else if ( function == func_sum   )  zonsum(field1, field2);  
+  else if ( function == func_mean  )  zonmean(field1, field2);  
+  else if ( function == func_avg   )  zonavg(field1, field2);  
+  else if ( function == func_std   )  zonstd(field1, field2);  
+  else if ( function == func_var   )  zonvar(field1, field2);
+  else cdoAbort("function %d not implemented!", function);
+}
+
+
+void zonmin(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  int    rnmiss = 0;
+  int    grid    = field1.grid;
+  int    nmiss   = field1.nmiss;
+  double missval = field1.missval;
+  double *array  = field1.ptr;
+  double rmin = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( j = 0; j < ny; j++ )
+    {
+      if ( nmiss > 0 )
+	{
+	  rmin = DBL_MAX;
+	  for ( i = 0; i < nx; i++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval) )
+	      if ( array[j*nx+i] < rmin ) rmin = array[j*nx+i];
+
+	  if ( IS_EQUAL(rmin, DBL_MAX) )
+	    {
+	      rnmiss++;
+	      rmin = missval;
+	    }
+	}
+      else
+	{
+	  rmin = array[j*nx];
+	  for ( i = 1; i < nx; i++ )
+	    if ( array[j*nx+i] < rmin )  rmin = array[j*nx+i];
+	}
+
+      field2->ptr[j] = rmin;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void zonmax(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  int    rnmiss = 0;
+  int    grid    = field1.grid;
+  int    nmiss   = field1.nmiss;
+  double missval = field1.missval;
+  double *array  = field1.ptr;
+  double rmax = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( j = 0; j < ny; j++ )
+    {
+      if ( nmiss > 0 )
+	{
+	  rmax = -DBL_MAX;
+	  for ( i = 0; i < nx; i++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval) )
+	      if ( array[j*nx+i] > rmax ) rmax = array[j*nx+i];
+
+	  if ( IS_EQUAL(rmax, -DBL_MAX) )
+	    {
+	      rnmiss++;
+	      rmax = missval;
+	    }
+	}
+      else
+	{
+	  rmax = array[j*nx];
+	  for ( i = 1; i < nx; i++ ) 
+	    if ( array[j*nx+i] > rmax )  rmax = array[j*nx+i];
+	}
+
+      field2->ptr[j] = rmax;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void zonrange(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  int    rnmiss = 0;
+  int    grid    = field1.grid;
+  int    nmiss   = field1.nmiss;
+  double missval = field1.missval;
+  double *array  = field1.ptr;
+  double rmin = 0;
+  double rmax = 0;
+  double rrange = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( j = 0; j < ny; j++ )
+    {
+      if ( nmiss > 0 )
+	{
+	  rmin =  DBL_MAX;
+	  rmax = -DBL_MAX;
+	  for ( i = 0; i < nx; i++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval) )
+	      {
+		if      ( array[j*nx+i] < rmin ) rmin = array[j*nx+i];
+		else if ( array[j*nx+i] > rmax ) rmax = array[j*nx+i];
+	      }
+
+	  if ( IS_EQUAL(rmin, DBL_MAX) || IS_EQUAL(rmax, -DBL_MAX) )
+	    {
+	      rnmiss++;
+	      rrange = missval;
+	    }
+	  else
+	    {
+	      rrange = rmax - rmin;
+	    }
+	}
+      else
+	{
+	  rmin = array[j*nx];
+	  rmax = array[j*nx];
+	  for ( i = 1; i < nx; i++ )
+	    {
+	      if      ( array[j*nx+i] < rmin )  rmin = array[j*nx+i];
+	      else if ( array[j*nx+i] > rmax )  rmax = array[j*nx+i];
+	    }
+
+	  rrange = rmax - rmin;
+	}
+
+      field2->ptr[j] = rrange;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void zonsum(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  long   nvals   = 0;
+  int    rnmiss  = 0;
+  int    grid    = field1.grid;
+  int    nmiss   = field1.nmiss;
+  double missval = field1.missval;
+  double *array  = field1.ptr;
+  double rsum = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( j = 0; j < ny; j++ )
+    {
+      if ( nmiss > 0 )
+	{
+	  nvals = 0;
+	  rsum = 0;
+	  for ( i = 0; i < nx; i++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval) )
+	      {
+		rsum += array[j*nx+i];
+		nvals++;
+	      }
+
+	  if ( !nvals )
+	    {
+	      rsum = missval;
+	      rnmiss++;
+	    }
+ 	}
+      else
+	{
+	  rsum = 0;
+	  for ( i = 0; i < nx; i++ )
+	    rsum += array[j*nx+i];
+	}
+
+      field2->ptr[j] = rsum;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void zonmean(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  int    rnmiss = 0;
+  int    grid     = field1.grid;
+  int    nmiss    = field1.nmiss;
+  double missval1 = field1.missval;
+  double missval2 = field1.missval;
+  double *array   = field1.ptr;
+  double rsum = 0, rsumw = 0, ravg = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( j = 0; j < ny; j++ )
+    {
+      rsum  = 0;
+      rsumw = 0;
+      if ( nmiss > 0 )
+	{
+	  for ( i = 0; i < nx; i++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval1) )
+	      {
+		rsum  += array[j*nx+i];
+		rsumw += 1;
+	      }
+	}
+      else
+	{
+	  for ( i = 0; i < nx; i++ )
+	    {
+	      rsum  += array[j*nx+i];
+	      rsumw += 1;
+	    }
+	}
+
+      ravg = DIV(rsum, rsumw);
+
+      if ( DBL_IS_EQUAL(ravg, missval1) ) rnmiss++;
+
+      field2->ptr[j] = ravg;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void zonavg(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  int    rnmiss = 0;
+  int    grid     = field1.grid;
+  int    nmiss    = field1.nmiss;
+  double missval1 = field1.missval;
+  double missval2 = field1.missval;
+  double *array   = field1.ptr;
+  double rsum = 0, rsumw = 0, ravg = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( j = 0; j < ny; j++ )
+    {
+      rsum  = 0;
+      rsumw = 0;
+      if ( nmiss > 0 )
+	{
+	  for ( i = 0; i < nx; i++ )
+	    {
+	      rsum   = ADD(rsum, array[j*nx+i]);
+	      rsumw += 1;
+	    }
+	}
+      else
+	{
+	  for ( i = 0; i < nx; i++ )
+	    {
+	      rsum  += array[j*nx+i];
+	      rsumw += 1;
+	    }
+	}
+
+      ravg = DIV(rsum, rsumw);
+
+      if ( DBL_IS_EQUAL(ravg, missval1) ) rnmiss++;
+
+      field2->ptr[j] = ravg;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void zonvar(field_t field1, field_t *field2)
+{
+  long   i, j, nx, ny;
+  int    rnmiss = 0;
+  int    grid     = field1.grid;
+  int    nmiss    = field1.nmiss;
+  double missval1 = field1.missval;
+  double *array   = field1.ptr;
+  double rsum = 0, rsumw = 0, rvar = 0;
+  double rsumq = 0, rsumwq = 0;
+
+  nx    = gridInqXsize(grid);
+  ny    = gridInqYsize(grid);
+
+  for ( j = 0; j < ny; j++ )
+    {
+      rsum   = 0;
+      rsumq  = 0;
+      rsumw  = 0;
+      rsumwq = 0;
+      if ( nmiss > 0 )
+	{
+	  for ( i = 0; i < nx; i++ )
+	    if ( !DBL_IS_EQUAL(array[j*nx+i], missval1) )
+	      {
+		rsum   += array[j*nx+i];
+		rsumq  += array[j*nx+i] * array[j*nx+i];
+		rsumw  += 1;
+		rsumwq += 1;
+	      }
+	}
+      else
+	{
+	  for ( i = 0; i < nx; i++ )
+	    {
+	      rsum   += array[j*nx+i];
+	      rsumq  += array[j*nx+i] * array[j*nx+i];
+	      rsumw  += 1;
+	      rsumwq += 1;
+	    }
+	}
+
+      rvar = IS_NOT_EQUAL(rsumw, 0) ? (rsumq*rsumw - rsum*rsum) / (rsumw*rsumw) : missval1;
+      if ( rvar < 0 && rvar > -1.e-5 ) rvar = 0;
+
+      if ( DBL_IS_EQUAL(rvar, missval1) ) rnmiss++;
+
+      field2->ptr[j] = rvar;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+
+void zonstd(field_t field1, field_t *field2)
+{
+  long   j, ny;
+  int    rnmiss = 0;
+  int    grid    = field1.grid;
+  double missval = field1.missval;
+  double rvar, rstd;
+
+  ny    = gridInqYsize(grid);
+
+  zonvar(field1, field2);
+
+  for ( j = 0; j < ny; j++ )
+    {
+      rvar = field2->ptr[j];
+
+      if ( DBL_IS_EQUAL(rvar, missval) || rvar < 0 )
+	{
+	  rstd = missval;
+	}
+      else
+	{
+	  rstd = IS_NOT_EQUAL(rvar, 0) ? sqrt(rvar) : 0;
+	}
+
+      if ( DBL_IS_EQUAL(rvar, missval) ) rnmiss++;
+
+      field2->ptr[j] = rstd;
+    }
+
+  field2->nmiss  = rnmiss;
+}
+
+/* RQ */
+void zonpctl(field_t field1, field_t *field2, int p)
+{
+  long   i, j, l, nx, ny;
+  int    rnmiss = 0;
+  int    grid    = field1.grid;
+  int    nmiss   = field1.nmiss;
+  double missval = field1.missval;
+  double *array  = field1.ptr;
+  double *array2;
+
+  nx = gridInqXsize(grid);
+  ny = gridInqYsize(grid);
+  
+  if ( nmiss > 0 )
+    {
+      array2 = (double *) malloc(nx*sizeof(double));
+      
+      for ( j = 0; j < ny; j++ )
+        {
+          for ( i = 0, l = 0; i < nx; i++ )
+            if ( !DBL_IS_EQUAL(array[j*nx+i], missval) )
+              array2[l++] = array[j*nx+i];
+	    
+          if ( l > 0 )
+            {
+              field2->ptr[j] = nth_element(array2, l, (int)ceil(l*(p/100.0))-1);
+            }
+          else
+            {
+              field2->ptr[j] = missval;
+              rnmiss++;
+            }
+        }
+        
+      free(array2);
+    }
+  else
+    {
+      for ( j = 0; j < ny; j++ )
+        {
+          if ( nx > 0 )
+            {
+              field2->ptr[j] = nth_element(&array[j*nx], nx, (int)ceil(nx*(p/100.0))-1);
+            }
+          else
+            {
+              field2->ptr[j] = missval;
+              rnmiss++;
+            }
+        }
+    }
+
+  field2->nmiss = rnmiss;
+}
+/* QR */
diff --git a/src/fouriertrans.c b/src/fouriertrans.c
new file mode 100644
index 0000000..0f0fc90
--- /dev/null
+++ b/src/fouriertrans.c
@@ -0,0 +1,2279 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#ifndef _DMEMORY_H
+#  include "dmemory.h"
+#endif
+
+#if defined (SX)
+#  define  NFFT  1024
+#else
+#  define  NFFT  64
+#endif
+
+#ifndef  M_SQRT2
+#define  M_SQRT2     1.41421356237309504880
+#endif
+
+#define  QUA  0.25
+#define  QT5  0.559016994374947
+
+#define  S36  0.587785252292473
+#define  S60  0.866025403784437
+#define  S72  0.951056516295154
+
+#define  SQ2  0.707106781186547524401
+
+#define  D60  (S60+S60)
+
+
+long get_nfft(void)
+{
+  return ((long) NFFT);
+}
+
+
+void fft_set(double *trigs, long *ifax, long n)
+{
+  long j, k, nfax, len = n;
+  long nhl;
+  double del, angle;
+
+  del = 4.0*asin(1.0) / n;
+  nhl = n / 2;
+  for ( k = 0; k < nhl; k++ )
+    {
+      angle = k * del;
+      trigs[2*k  ] = cos(angle);
+      trigs[2*k+1] = sin(angle);
+    }  
+
+  nfax = 0;
+  for (k = 0; k < 9; ++k) ifax[k] = 0;
+
+  ifax[9] = n;
+
+  if    (n % 8 == 0)  { ifax[++nfax] = 8; n /= 8; }
+  while (n % 6 == 0)  { ifax[++nfax] = 6; n /= 6; }
+  while (n % 5 == 0)  { ifax[++nfax] = 5; n /= 5; }
+  while (n % 4 == 0)  { ifax[++nfax] = 4; n /= 4; }
+  while (n % 3 == 0)  { ifax[++nfax] = 3; n /= 3; }
+  if    (n % 2 == 0)  { ifax[++nfax] = 2; n /= 2; }
+
+  ifax[0] = nfax;
+
+#if defined (CRAY)
+#pragma _CRI novector
+#endif
+#if defined (SX)
+#pragma vdir novector
+#endif
+#if defined (__uxp__)
+#pragma loop scalar
+#endif
+  for ( k = 0; k < nfax / 2; k++ )
+    {
+      j = ifax[k + 1];
+      ifax[k + 1] = ifax[nfax - k];
+      ifax[nfax - k] = j;
+    }
+
+  if ( n > 8 )
+    {
+      fprintf(stderr, "fft does not work with len %ld\n", len);
+      exit(1);
+    }
+}
+
+static
+int rpassc(double *a, double *b, double *c, double *d, double *trigs,
+	   long inc1, long inc2, long inc3, long inc4,
+	   long lot, long n, long ifac, long la)
+{
+  /*
+     rpassc' - performs one pass through data as part;
+     of multiple real fft (fourier synthesis) routine;
+
+     a is first real input vector
+     b is equivalent to a + la * inc1
+     c is first real output vector
+     d is equivalent to c + ifac * la * inc2
+     trigs  is a precalculated list of sines & cosines
+     inc1 is the addressing increment for a;
+     inc2 is the addressing increment for c;
+     inc3 is the increment between input vectors a;
+     inc4 is the increment between output vectors c;
+     lot is the number of vectors;
+     n is the length of the vectors;
+     ifac is the current factor of n;
+     la is the product of previous factors;
+     ierr is an error indicator:;
+     0 - pass completed without error;
+     2 - ifac not catered for;
+     3 - ifac only catered for if la=n/ifac;
+   */
+
+  long i0, i1, i2, i3, i4, i5, i6, i7;
+  long j0, j1, j2, j3, j4, j5, j6, j7;
+  long ia, ib, ic, id, ie, iF;
+  long ja, jb, jc, jd, je, jf;
+  long i, j, k, l, m, ijk;
+  long ibase, jbase;
+  long iink, jink;
+  long jump;
+  long kstop;
+  long kb, kc, kd, ke, kf;
+
+  double c1, c2, c3, c4, c5;
+  double s1, s2, s3, s4, s5;
+  double qqrt5;
+  double ssin36;
+  double ssin72;
+
+  double a10, a11, a20, a21;
+  double b10, b11, b20, b21;
+
+  m = n / ifac;
+  iink = la * inc1;
+  jink = la * inc2;
+  jump = (ifac - 1) * jink;
+  kstop = (n - ifac) / (2 * ifac);
+  ibase = 0;
+  jbase = 0;
+
+  switch (ifac)
+    {
+    case 2:
+      {
+	double a0m1, b0p1;
+
+	i0 = j0 = 0;
+	i1 = i0 + inc1 * (m + m - la);
+	j1 = j0 + jink;
+	if (la != m)
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[j0 + j] = a[i0 + i] + a[i1 + i];
+		    c[j1 + j] = a[i0 + i] - a[i1 + i];
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	    i0 += iink;
+	    iink += iink;
+	    i1 -= iink;
+	    ibase = 0;
+	    jbase += jump;
+	    jump += jump + jink;
+
+	    if (i0 != i1)
+	      {
+		for (k = la; k <= kstop; k += la)
+		  {
+		    kb = k + k;
+		    c1 = trigs[kb  ];
+		    s1 = trigs[kb+1];
+		    ibase = 0;
+		    for (l = 0; l < la; ++l)
+		      {
+			i = ibase;
+			j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+			for (ijk = 0; ijk < lot; ++ijk)
+			  {
+			    a0m1 = a[i0 + i] - a[i1 + i];
+			    b0p1 = b[i0 + i] + b[i1 + i];
+
+			    c[j0 + j] = a[i0 + i] + a[i1 + i];
+			    d[j0 + j] = b[i0 + i] - b[i1 + i];
+			    c[j1 + j] = c1 * a0m1 - s1 * b0p1;
+			    d[j1 + j] = s1 * a0m1 + c1 * b0p1;
+			    i += inc3;
+			    j += inc4;
+			  }
+			ibase += inc1;
+			jbase += inc2;
+		      }
+		    i0 += iink;
+		    i1 -= iink;
+		    jbase += jump;
+		  }		/* End FORK */
+		if (i0 > i1)
+		  return 0;
+	      }			/* End (i0 != i1) */
+	    ibase = 0;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[j0 + j] = a[i0 + i];
+		    c[j1 + j] = -b[i0 + i];
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	else			/* (la != m) */
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[j0 + j] = 2.0 * (a[i0 + i] + a[i1 + i]);
+		    c[j1 + j] = 2.0 * (a[i0 + i] - a[i1 + i]);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	return 0;
+      }
+
+    case 3:
+      {
+	double afa1, a1p2, a1m2, a0mm, a0mp;
+	double bfa1, b1p2, b1m2, b0mm, b0mp;
+
+	i0 = j0 = 0;
+	i1 = i0 + inc1 * (m + m - la);
+	i2 = i1;
+	j1 = j0 + jink;
+	j2 = j1 + jink;
+
+	if (la != m)
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    afa1 = a[i0 + i] - 0.5 * a[i1 + i];
+		    bfa1 = S60 * b[i1 + i];
+
+		    c[j0 + j] = a[i0 + i] + a[i1 + i];
+		    c[j1 + j] = afa1 - bfa1;
+		    c[j2 + j] = afa1 + bfa1;
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	    i0 += iink;
+	    iink += iink;
+	    i1 += iink;
+	    i2 -= iink;
+	    jbase += jump;
+	    jump += jump + jink;
+
+	    if (i0 != i2)
+	      {
+		for (k = la; k <= kstop; k += la)
+		  {
+		    kb = k + k;
+		    kc = kb + kb;
+		    c1 = trigs[kb  ];
+		    s1 = trigs[kb+1];
+		    c2 = trigs[kc  ];
+		    s2 = trigs[kc+1];
+		    ibase = 0;
+		    for (l = 0; l < la; ++l)
+		      {
+			i = ibase;
+			j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+			for (ijk = 0; ijk < lot; ++ijk)
+			  {
+			    a1p2 = a[i0 + i] - 0.5 * (a[i1 + i] + a[i2 + i]);
+			    b1m2 = b[i0 + i] - 0.5 * (b[i1 + i] - b[i2 + i]);
+			    a1m2 = S60 * (a[i1 + i] - a[i2 + i]);
+			    b1p2 = S60 * (b[i1 + i] + b[i2 + i]);
+
+			    a0mm = a1p2 - b1p2;
+			    a0mp = a1p2 + b1p2;
+			    b0mm = b1m2 - a1m2;
+			    b0mp = b1m2 + a1m2;
+
+			    c[j0 + j] = a[i0 + i] + a[i1 + i] + a[i2 + i];
+			    d[j0 + j] = b[i0 + i] + b[i1 + i] - b[i2 + i];
+			    c[j1 + j] = c1 * a0mm - s1 * b0mp;
+			    d[j1 + j] = s1 * a0mm + c1 * b0mp;
+			    c[j2 + j] = c2 * a0mp - s2 * b0mm;
+			    d[j2 + j] = s2 * a0mp + c2 * b0mm;
+			    i += inc3;
+			    j += inc4;
+			  }
+			ibase += inc1;
+			jbase += inc2;
+		      }
+		    i0 += iink;
+		    i1 += iink;
+		    i2 -= iink;
+		    jbase += jump;
+		  }		/* End FORK */
+		if (i0 > i2)
+		  return 0;
+	      }			/* End (i0 != i2) */
+	    ibase = 0;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a0mp = 0.5 * a[i0 + i];
+		    b0mp = S60 * b[i0 + i];
+
+		    c[j0 + j] = a[i0 + i] + a[i1 + i];
+		    c[j1 + j] = a0mp - a[i1 + i] - b0mp;
+		    c[j2 + j] = a[i1 + i] - a0mp - b0mp;
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	else			/* (la != m) */
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a0mp = 2.0 * a[i0 + i] - a[i1 + i];
+		    b0mp = D60 * b[i1 + i];
+
+		    c[j0 + j] = 2.0 * (a[i0 + i] + a[i1 + i]);
+		    c[j1 + j] = a0mp - b0mp;
+		    c[j2 + j] = a0mp + b0mp;
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	return 0;
+      }
+
+    case 4:
+      {
+	double a0m1, a0p2, a1p3, a0m2, a1m3, a0p2ma1p3, a0m2pb1p3, a0m2mb1p3;
+	double b0p1, b0p2, b1p3, b0m2, b1m3, b0p2pa1m3, b0p2ma1m3, b0m2mb1m3;
+
+	i0 = j0 = 0;
+	i1 = i3 = i0 + inc1 * (m + m - la);
+	i2 = i1 + inc1 * (m + m);
+	j1 = j0 + jink;
+	j2 = j1 + jink;
+	j3 = j2 + jink;
+
+	if (la != m)
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a0p2 = a[i0 + i] + a[i2 + i];
+		    a0m2 = a[i0 + i] - a[i2 + i];
+
+		    c[j0 + j] = a0p2 + a[i1 + i];
+		    c[j1 + j] = a0m2 - b[i1 + i];
+		    c[j2 + j] = a0p2 - a[i1 + i];
+		    c[j3 + j] = a0m2 + b[i1 + i];
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	    i0 += iink;
+	    iink += iink;
+	    i1 += iink;
+	    i2 -= iink;
+	    i3 -= iink;
+	    jbase += jump;
+	    jump += jump + jink;
+
+	    if (i1 != i2)
+	      {
+		for (k = la; k <= kstop; k += la)
+		  {
+		    kb = k + k;
+		    kc = kb + kb;
+		    kd = kc + kb;
+		    c1 = trigs[kb  ];
+		    s1 = trigs[kb+1];
+		    c2 = trigs[kc  ];
+		    s2 = trigs[kc+1];
+		    c3 = trigs[kd  ];
+		    s3 = trigs[kd+1];
+		    ibase = 0;
+		    for (l = 0; l < la; ++l)
+		      {
+			i = ibase;
+			j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+			for (ijk = 0; ijk < lot; ++ijk)
+			  {
+			    a0p2 = a[i0 + i] + a[i2 + i];
+			    a0m2 = a[i0 + i] - a[i2 + i];
+			    a1p3 = a[i1 + i] + a[i3 + i];
+			    a1m3 = a[i1 + i] - a[i3 + i];
+			    b0p2 = b[i0 + i] + b[i2 + i];
+			    b0m2 = b[i0 + i] - b[i2 + i];
+			    b1p3 = b[i1 + i] + b[i3 + i];
+			    b1m3 = b[i1 + i] - b[i3 + i];
+
+			    a0p2ma1p3 = a0p2 - a1p3;
+			    a0m2pb1p3 = a0m2 + b1p3;
+			    a0m2mb1p3 = a0m2 - b1p3;
+			    b0p2pa1m3 = b0p2 + a1m3;
+			    b0p2ma1m3 = b0p2 - a1m3;
+			    b0m2mb1m3 = b0m2 - b1m3;
+
+			    c[j0 + j] = a0p2 + a1p3;
+			    d[j0 + j] = b0m2 + b1m3;
+			    c[j2 + j] = c2 * a0p2ma1p3 - s2 * b0m2mb1m3;
+			    d[j2 + j] = s2 * a0p2ma1p3 + c2 * b0m2mb1m3;
+			    c[j1 + j] = c1 * a0m2mb1p3 - s1 * b0p2pa1m3;
+			    d[j1 + j] = s1 * a0m2mb1p3 + c1 * b0p2pa1m3;
+			    c[j3 + j] = c3 * a0m2pb1p3 - s3 * b0p2ma1m3;
+			    d[j3 + j] = s3 * a0m2pb1p3 + c3 * b0p2ma1m3;
+			    i += inc3;
+			    j += inc4;
+			  }
+			ibase += inc1;
+			jbase += inc2;
+		      }
+		    i0 += iink;
+		    i1 += iink;
+		    i2 -= iink;
+		    i3 -= iink;
+		    jbase += jump;
+		  }		/* End FORK */
+		if (i1 > i2)
+		  return 0;
+	      }			/* End (i1 != i2) */
+	    ibase = 0;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a0m1 = a[i0 + i] - a[i1 + i];
+		    b0p1 = b[i0 + i] + b[i1 + i];
+
+		    c[j0 + j] = a[i0 + i] + a[i1 + i];
+		    c[j2 + j] = b[i1 + i] - b[i0 + i];
+
+		    c[j1 + j] = SQ2 * (a0m1 - b0p1);
+		    c[j3 + j] = -SQ2 * (a0m1 + b0p1);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	else			/* (la != m) */
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a0p2 = a[i0 + i] + a[i2 + i];
+		    a0m2 = a[i0 + i] - a[i2 + i];
+
+		    c[j0 + j] = 2.0 * (a0p2 + a[i1 + i]);
+		    c[j1 + j] = 2.0 * (a0m2 - b[i1 + i]);
+		    c[j2 + j] = 2.0 * (a0p2 - a[i1 + i]);
+		    c[j3 + j] = 2.0 * (a0m2 + b[i1 + i]);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	return 0;
+      }
+
+    case 5:
+      {
+	double a1p2, a1m2, a0mm, a0mp, b136, b172, b236, b272;
+
+	i0 = j0 = 0;
+	i1 = i4 = i0 + inc1 * (m + m - la);
+	i2 = i3 = i1 + inc1 * (m + m);
+	j1 = j0 + jink;
+	j2 = j1 + jink;
+	j3 = j2 + jink;
+	j4 = j3 + jink;
+
+	if (la != m)
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a1p2 = QUA * (a[i1 + i] + a[i2 + i]);
+		    a1m2 = QT5 * (a[i1 + i] - a[i2 + i]);
+
+		    a0mp = a[i0 + i] - a1p2 + a1m2;
+		    a0mm = a[i0 + i] - a1p2 - a1m2;
+
+		    b136 = b[i1 + i] * S36;
+		    b172 = b[i1 + i] * S72;
+		    b236 = b[i2 + i] * S36;
+		    b272 = b[i2 + i] * S72;
+
+		    c[j0 + j] = a[i0 + i] + a[i1 + i] + a[i2 + i];
+		    c[j1 + j] = a0mp - b172 - b236;
+		    c[j2 + j] = a0mm - b136 + b272;
+		    c[j3 + j] = a0mm + b136 - b272;
+		    c[j4 + j] = a0mp + b172 + b236;
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	    i0 += iink;
+	    iink += iink;
+	    i1 += iink;
+	    i2 += iink;
+	    i3 -= iink;
+	    i4 -= iink;
+	    jbase += jump;
+	    jump += jump + jink;
+
+	    if (i1 != i3)
+	      {
+		for (k = la; k <= kstop; k += la)
+		  {
+		    kb = k + k;
+		    kc = kb + kb;
+		    kd = kc + kb;
+		    ke = kd + kb;
+		    c1 = trigs[kb  ];
+		    s1 = trigs[kb+1];
+		    c2 = trigs[kc  ];
+		    s2 = trigs[kc+1];
+		    c3 = trigs[kd  ];
+		    s3 = trigs[kd+1];
+		    c4 = trigs[ke  ];
+		    s4 = trigs[ke+1];
+		    ibase = 0;
+		    for (l = 0; l < la; ++l)
+		      {
+			i = ibase;
+			j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+			for (ijk = 0; ijk < lot; ++ijk)
+			  {
+			    a10 = (a[i0 + i] - 0.25 * ((a[i1 + i] + a[i4 + i]) +
+				                       (a[i2 + i] + a[i3 + i]))) +
+			                        QT5 * ((a[i1 + i] + a[i4 + i]) -
+				                       (a[i2 + i] + a[i3 + i]));
+			    a20 = (a[i0 + i] - 0.25 * ((a[i1 + i] + a[i4 + i]) +
+			                	       (a[i2 + i] + a[i3 + i]))) -
+			                        QT5 * ((a[i1 + i] + a[i4 + i]) -
+				                       (a[i2 + i] + a[i3 + i]));
+			    b10 = (b[i0 + i] - 0.25 * ((b[i1 + i] - b[i4 + i]) +
+						       (b[i2 + i] - b[i3 + i]))) +
+			                        QT5 * ((b[i1 + i] - b[i4 + i]) -
+						       (b[i2 + i] - b[i3 + i]));
+			    b20 = (b[i0 + i] - 0.25 * ((b[i1 + i] - b[i4 + i]) +
+						       (b[i2 + i] - b[i3 + i]))) -
+			                        QT5 * ((b[i1 + i] - b[i4 + i]) -
+						       (b[i2 + i] - b[i3 + i]));
+
+			    a11 = S72 * (b[i1 + i] + b[i4 + i]) +
+			          S36 * (b[i2 + i] + b[i3 + i]);
+			    a21 = S36 * (b[i1 + i] + b[i4 + i]) -
+			          S72 * (b[i2 + i] + b[i3 + i]);
+			    b11 = S72 * (a[i1 + i] - a[i4 + i]) +
+			          S36 * (a[i2 + i] - a[i3 + i]);
+			    b21 = S36 * (a[i1 + i] - a[i4 + i]) -
+			          S72 * (a[i2 + i] - a[i3 + i]);
+
+			    c[j0 + j] = a[i0 + i] + ((a[i1 + i] + a[i4 + i]) +
+						     (a[i2 + i] + a[i3 + i]));
+			    d[j0 + j] = b[i0 + i] + ((b[i1 + i] - b[i4 + i]) +
+						     (b[i2 + i] - b[i3 + i]));
+			    c[j1 + j] = c1 * (a10 - a11) - s1 * (b10 + b11);
+			    d[j1 + j] = s1 * (a10 - a11) + c1 * (b10 + b11);
+			    c[j4 + j] = c4 * (a10 + a11) - s4 * (b10 - b11);
+			    d[j4 + j] = s4 * (a10 + a11) + c4 * (b10 - b11);
+			    c[j2 + j] = c2 * (a20 - a21) - s2 * (b20 + b21);
+			    d[j2 + j] = s2 * (a20 - a21) + c2 * (b20 + b21);
+			    c[j3 + j] = c3 * (a20 + a21) - s3 * (b20 - b21);
+			    d[j3 + j] = s3 * (a20 + a21) + c3 * (b20 - b21);
+			    i += inc3;
+			    j += inc4;
+			  }
+			ibase += inc1;
+			jbase += inc2;
+		      }
+		    i0 += iink;
+		    i1 += iink;
+		    i2 += iink;
+		    i3 -= iink;
+		    i4 -= iink;
+		    jbase += jump;
+		  }		/* End FORK */
+		if (i1 > i3)
+		  return 0;
+	      }			/* End (i1 != i3) */
+	    ibase = 0;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[j0 + j] = a[i0 + i] + a[i1 + i] + a[i2 + i];
+		    c[j1 + j] = (QT5 * (a[i0 + i] - a[i1 + i])
+			     + (0.25 * (a[i0 + i] + a[i1 + i]) -
+				        a[i2 + i])) - (S36 * b[i0 + i] +
+						       S72 * b[i1 + i]);
+		    c[j4 + j] = -(QT5 * (a[i0 + i] - a[i1 + i]) +
+				(0.25 * (a[i0 + i] + a[i1 + i]) - a[i2 + i])) -
+		                  (S36 * b[i0 + i] + S72 * b[i1 + i]);
+		    c[j2 + j] =  (QT5 * (a[i0 + i] - a[i1 + i]) -
+				(0.25 * (a[i0 + i] + a[i1 + i]) - a[i2 + i])) -
+		                  (S72 * b[i0 + i] - S36 * b[i1 + i]);
+		    c[j3 + j] = -(QT5 * (a[i0 + i] - a[i1 + i]) -
+				(0.25 * (a[i0 + i] + a[i1 + i]) - a[i2 + i])) -
+		                  (S72 * b[i0 + i] - S36 * b[i1 + i]);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	else
+	  {
+	    qqrt5 = 2.0 * QT5;
+	    ssin36 = 2.0 * S36;
+	    ssin72 = 2.0 * S72;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[j0 + j] = 2.0 * (a[i0 + i] + a[i1 + i] + a[i2 + i]);
+		    c[j1 + j] =(2.0 * (a[i0 + i] - 0.25 * (a[i1 + i] + a[i2 + i])) +
+		       qqrt5 * (a[i1 + i] - a[i2 + i])) - (ssin72 * b[i1 + i] +
+							   ssin36 * b[i2 + i]);
+		    c[j2 + j] =(2.0 * (a[i0 + i] - 0.25 * (a[i1 + i] + a[i2 + i])) -
+		       qqrt5 * (a[i1 + i] - a[i2 + i])) - (ssin36 * b[i1 + i] -
+							   ssin72 * b[i2 + i]);
+		    c[j3 + j] =(2.0 * (a[i0 + i] - 0.25 * (a[i1 + i] + a[i2 + i])) -
+		       qqrt5 * (a[i1 + i] - a[i2 + i])) + (ssin36 * b[i1 + i] -
+							   ssin72 * b[i2 + i]);
+		    c[j4 + j] =(2.0 * (a[i0 + i] - 0.25 * (a[i1 + i] + a[i2 + i])) +
+		       qqrt5 * (a[i1 + i] - a[i2 + i])) + (ssin72 * b[i1 + i] +
+							   ssin36 * b[i2 + i]);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	return 0;
+      }
+
+    case 6:
+      {
+	ia = 0;
+	ib = ia + (2 * m - la) * inc1;
+	ic = ib + 2 * m * inc1;
+	id = ic + 2 * m * inc1;
+	ie = ic;
+	iF = ib;
+	ja = 0;
+	jb = ja + jink;
+	jc = jb + jink;
+	jd = jc + jink;
+	je = jd + jink;
+	jf = je + jink;
+
+	if (la != m)		/* go to 690 */
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[ja + j] = (a[ia + i] + a[id + i]) + (a[ib + i] + a[ic + i]);
+		    c[jd + j] = (a[ia + i] - a[id + i]) - (a[ib + i] - a[ic + i]);
+		    c[jb + j] =((a[ia + i] - a[id + i]) +
+		          0.5 * (a[ib + i] - a[ic + i])) - S60 * (b[ib + i] +
+								  b[ic + i]);
+		    c[jf + j] =((a[ia + i] - a[id + i]) +
+		          0.5 * (a[ib + i] - a[ic + i])) + S60 * (b[ib + i] +
+								  b[ic + i]);
+		    c[jc + j] =((a[ia + i] + a[id + i]) -
+		          0.5 * (a[ib + i] + a[ic + i])) - S60 * (b[ib + i] -
+								  b[ic + i]);
+		    c[je + j] =((a[ia + i] + a[id + i]) -
+		          0.5 * (a[ib + i] + a[ic + i])) + S60 * (b[ib + i] -
+								  b[ic + i]);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	    ia += iink;
+	    iink += iink;
+	    ib += iink;
+	    ic += iink;
+	    id -= iink;
+	    ie -= iink;
+	    iF -= iink;
+	    jbase += jump;
+	    jump += jump + jink;
+
+	    if (ic != id)	/* go to 660 */
+	      {
+		for (k = la; k <= kstop; k += la)
+		  {
+		    kb = k + k;
+		    kc = kb + kb;
+		    kd = kc + kb;
+		    ke = kd + kb;
+		    kf = ke + kb;
+		    c1 = trigs[kb  ];
+		    s1 = trigs[kb+1];
+		    c2 = trigs[kc  ];
+		    s2 = trigs[kc+1];
+		    c3 = trigs[kd  ];
+		    s3 = trigs[kd+1];
+		    c4 = trigs[ke  ];
+		    s4 = trigs[ke+1];
+		    c5 = trigs[kf  ];
+		    s5 = trigs[kf+1];
+		    ibase = 0;
+		    for (l = 0; l < la; ++l)
+		      {
+			i = ibase;
+			j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+			for (ijk = 0; ijk < lot; ++ijk)
+			  {
+			    a11 = a[ie + i] + a[ib + i] + a[ic + i] + a[iF + i];
+			    a20 = a[ia + i] + a[id + i] - 0.5 * a11;
+			    a21 = S60 * ((a[ie + i] + a[ib + i]) -
+					 (a[ic + i] + a[iF + i]));
+			    b11 = b[ib + i] - b[ie + i] + b[ic + i] - b[iF + i];
+			    b20 = b[ia + i] - b[id + i] - 0.5 * b11;
+			    b21 = S60 * ((b[ib + i] - b[ie + i]) -
+					 (b[ic + i] - b[iF + i]));
+
+			    c[ja + j] = a[ia + i] + a[id + i] + a11;
+			    d[ja + j] = b[ia + i] - b[id + i] + b11;
+			    c[jc + j] = c2 * (a20 - b21) - s2 * (b20 + a21);
+			    d[jc + j] = s2 * (a20 - b21) + c2 * (b20 + a21);
+			    c[je + j] = c4 * (a20 + b21) - s4 * (b20 - a21);
+			    d[je + j] = s4 * (a20 + b21) + c4 * (b20 - a21);
+
+			    a11 = (a[ie + i] - a[ib + i]) + (a[ic + i] - a[iF + i]);
+			    b11 = (b[ie + i] + b[ib + i]) - (b[ic + i] + b[iF + i]);
+			    a20 = (a[ia + i] - a[id + i]) - 0.5 * a11;
+			    a21 = S60 * ((a[ie + i] - a[ib + i]) -
+					 (a[ic + i] - a[iF + i]));
+			    b20 = (b[ia + i] + b[id + i]) + 0.5 * b11;
+			    b21 = S60 * ((b[ie + i] + b[ib + i]) +
+					 (b[ic + i] + b[iF + i]));
+
+			    c[jd + j] = c3 * (a[ia + i] - a[id + i] + a11)
+			              - s3 * (b[ia + i] + b[id + i] - b11);
+			    d[jd + j] = s3 * (a[ia + i] - a[id + i] + a11)
+			              + c3 * (b[ia + i] + b[id + i] - b11);
+			    c[jb + j] = c1 * (a20 - b21) - s1 * (b20 - a21);
+			    d[jb + j] = s1 * (a20 - b21) + c1 * (b20 - a21);
+			    c[jf + j] = c5 * (a20 + b21) - s5 * (b20 + a21);
+			    d[jf + j] = s5 * (a20 + b21) + c5 * (b20 + a21);
+			    i += inc3;
+			    j += inc4;
+			  }
+			ibase += inc1;
+			jbase += inc2;
+		      }
+		    ia += iink;
+		    ib += iink;
+		    ic += iink;
+		    id -= iink;
+		    ie -= iink;
+		    iF -= iink;
+		    jbase += jump;
+		  }
+		if (ic > id)
+		  return 0;
+	      }
+	    ibase = 0;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[ja + j] =  a[ib + i] + (a[ia + i] + a[ic + i]);
+		    c[jd + j] =  b[ib + i] - (b[ia + i] + b[ic + i]);
+		    c[jb + j] =  (S60 * (a[ia + i] - a[ic + i])) -
+		                 (0.5 * (b[ia + i] + b[ic + i]) + b[ib + i]);
+		    c[jf + j] = -(S60 * (a[ia + i] - a[ic + i])) -
+		                 (0.5 * (b[ia + i] + b[ic + i]) + b[ib + i]);
+		    c[jc + j] =   S60 * (b[ic + i] - b[ia + i]) +
+		                 (0.5 * (a[ia + i] + a[ic + i]) - a[ib + i]);
+		    c[je + j] =   S60 * (b[ic + i] - b[ia + i]) -
+		                 (0.5 * (a[ia + i] + a[ic + i]) - a[ib + i]);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	else
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[ja + j] = (2.0 * (a[ia + i] + a[id + i])) +
+		                (2.0 * (a[ib + i] + a[ic + i]));
+		    c[jd + j] = (2.0 * (a[ia + i] - a[id + i])) -
+		                (2.0 * (a[ib + i] - a[ic + i]));
+		    c[jb + j] = (2.0 * (a[ia + i] - a[id + i]) +
+		                       (a[ib + i] - a[ic + i])) -
+		                (D60 * (b[ib + i] + b[ic + i]));
+		    c[jf + j] = (2.0 * (a[ia + i] - a[id + i]) +
+		                       (a[ib + i] - a[ic + i])) +
+		                (D60 * (b[ib + i] + b[ic + i]));
+		    c[jc + j] = (2.0 * (a[ia + i] + a[id + i]) -
+			               (a[ib + i] + a[ic + i])) -
+		                (D60 * (b[ib + i] - b[ic + i]));
+		    c[je + j] = (2.0 * (a[ia + i] + a[id + i]) -
+		                       (a[ib + i] + a[ic + i])) +
+                                (D60 * (b[ib + i] - b[ic + i]));
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	return 0;
+      }
+
+    case 8:
+      {
+	double a0p7, a1p5, a2p6, p073, p074, p152;
+	double a0m7, a1m5, a2m6, m073, m074, m152;
+
+	if (la != m)
+	  return 3;
+	i0 = 0;
+	i1 = i0 + iink;
+	i2 = i1 + iink;
+	i3 = i2 + iink;
+	i4 = i3 + iink;
+	i5 = i4 + iink;
+	i6 = i5 + iink;
+	i7 = i6 + iink;
+	j0 = 0;
+	j1 = j0 + jink;
+	j2 = j1 + jink;
+	j3 = j2 + jink;
+	j4 = j3 + jink;
+	j5 = j4 + jink;
+	j6 = j5 + jink;
+	j7 = j6 + jink;
+
+	for (l = 0; l < la; ++l)
+	  {
+	    i = ibase;
+	    j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+	    for (ijk = 0; ijk < lot; ++ijk)
+	      {
+		a0p7 = a[i0 + i] + a[i7 + i];
+		a0m7 = a[i0 + i] - a[i7 + i];
+		a1p5 = a[i1 + i] + a[i5 + i];
+		a1m5 = a[i1 + i] - a[i5 + i];
+		a2p6 = a[i2 + i] + a[i6 + i];
+		a2m6 = a[i2 + i] - a[i6 + i];
+
+		p073 = a0p7 + a[i3 + i];
+		m073 = a0p7 - a[i3 + i];
+
+		p074 = 2.0 * (a0m7 + a[i4 + i]);
+		m074 = 2.0 * (a0m7 - a[i4 + i]);
+
+		p152 = M_SQRT2 * (a1m5 + a2p6);
+		m152 = M_SQRT2 * (a1m5 - a2p6);
+
+		c[j0 + j] = 2.0 * (p073 + a1p5);
+		c[j4 + j] = 2.0 * (p073 - a1p5);
+		c[j2 + j] = 2.0 * (m073 - a2m6);
+		c[j6 + j] = 2.0 * (m073 + a2m6);
+
+		c[j1 + j] = m074 + m152;
+		c[j5 + j] = m074 - m152;
+		c[j3 + j] = p074 - p152;
+		c[j7 + j] = p074 + p152;
+		i += inc3;
+		j += inc4;
+	      }
+	    ibase += inc1;
+	    jbase += inc2;
+	  }
+      }
+    }
+  return 0;
+}
+
+static
+int qpassc(double *a, double *b, double *c, double *d, double *trigs,
+	   long inc1, long inc2, long inc3, long inc4,
+	   long lot, long n, long ifac, long la)
+{
+  /*
+     qpassc - performs one pass through data as part
+     of multiple real fft (fourier analysis) routine.
+
+     a      is first real input vector
+     b      is equivalent to a + ifac * la * inc1
+     c      is first real output vector;
+     d      is equivalent to c + la * inc2
+     trigs  is a precalculated list of sines & cosines
+     inc1   is the addressing increment for a
+     inc2   is the addressing increment for c
+     inc3   is the increment between input vectors a
+     inc4   is the increment between output vectors c
+     lot    is the number of vectors
+     n      is the length of the vectors
+     ifac   is the current factor of n
+     la     is the product of previous factors
+   */
+
+  long i0, i1, i2, i3, i4, i5, i6, i7;
+  long j0, j1, j2, j3, j4, j5, j6, j7;
+  long ia, ib, ic;
+  long ja, jb, jc;
+  long i, j, k, l, m, ijk;
+  long ibase, jbase;
+  long iink, jink;
+  long jump;
+  long kstop;
+  long kb, kc, kd, ke, kf;
+
+  double a0, a1, a2, a3;
+  double b0, b1, b2, b3;
+  double c1, c2, c3, c4, c5;
+  double s1, s2, s3, s4, s5;
+  double w, x, y, z;
+
+  m = n / ifac;
+  iink = la * inc1;
+  jink = la * inc2;
+  jump = (ifac - 1) * iink;
+  kstop = (n - ifac) / (2 * ifac);
+  ibase = 0;
+  jbase = 0;
+
+  switch (ifac)
+    {
+    case 2:
+      {
+	i0 = j0 = 0;
+	i1 = i0 + iink;
+	j1 = j0 + inc2 * (m + m - la);
+	if (la != m)
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[j0 + j] = a[i0 + i] + a[i1 + i];
+		    c[j1 + j] = a[i0 + i] - a[i1 + i];
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	    j0    += jink;
+	    jink  += jink;
+	    j1    -= jink;
+	    ibase += jump;
+	    jump  += jump + iink;
+
+	    if (j0 != j1)
+	      {
+		for (k = la; k <= kstop; k += la)
+		  {
+		    kb = k + k;
+		    c1 = trigs[kb  ];
+		    s1 = trigs[kb+1];
+		    jbase = 0;
+		    for (l = 0; l < la; ++l)
+		      {
+			i = ibase;
+			j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+			for (ijk = 0; ijk < lot; ++ijk)
+			  {
+			    c[j0 + j] = a[i0 + i] + c1 * a[i1 + i] + s1 * b[i1 + i];
+			    c[j1 + j] = a[i0 + i] - c1 * a[i1 + i] - s1 * b[i1 + i];
+			    d[j0 + j] = c1 * b[i1 + i] - s1 * a[i1 + i] + b[i0 + i];
+			    d[j1 + j] = c1 * b[i1 + i] - s1 * a[i1 + i] - b[i0 + i];
+			    i += inc3;
+			    j += inc4;
+			  }
+			ibase += inc1;
+			jbase += inc2;
+		      }
+		    j0 += jink;
+		    j1 -= jink;
+		    ibase += jump;
+		  }		/* End FORK */
+		if (j0 > j1)
+		  return 0;
+	      }			/* End (i0 != i1) */
+	    jbase = 0;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[j0 + j] = a[i0 + i];
+		    d[j1 + j] = -a[i1 + i];
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	else			/* (la != m) */
+	  {
+	    z = 1.0 / n;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[j0 + j] = z * (a[i0 + i] + a[i1 + i]);
+		    c[j1 + j] = z * (a[i0 + i] - a[i1 + i]);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	return 0;
+      }
+
+    case 3:
+      {
+	ia = 0;
+	ib = ia + iink;
+	ic = ib + iink;
+
+	ja = 0;
+	jb = ja + inc2 * (m + m - la);
+	jc = jb;
+
+	if (la != m)		/* else 390 */
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[ja + j] = a[ia + i] + a[ib + i] + a[ic + i];
+		    c[jb + j] = a[ia + i] - 0.5 * (a[ib + i] + a[ic + i]);
+		    d[jb + j] = S60 * (a[ic + i] - a[ib + i]);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	    ja += jink;
+	    jink += jink;
+	    jb += jink;
+	    jc -= jink;
+	    ibase += jump;
+	    jump += jump + iink;
+
+	    if (ja != jc)	/* else  360 */
+	      {
+		for (k = la; k <= kstop; k += la)
+		  {
+		    kb = k + k;
+		    kc = kb + kb;
+		    c1 = trigs[kb  ];
+		    s1 = trigs[kb+1];
+		    c2 = trigs[kc  ];
+		    s2 = trigs[kc+1];
+		    jbase = 0;
+		    for (l = 0; l < la; ++l)
+		      {
+			i = ibase;
+			j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+			for (ijk = 0; ijk < lot; ++ijk)
+			  {
+			    a1 = c1 * a[ib + i] + s1 * b[ib + i] +
+                                 c2 * a[ic + i] + s2 * b[ic + i];
+			    b1 = c1 * b[ib + i] - s1 * a[ib + i] +
+                                 c2 * b[ic + i] - s2 * a[ic + i];
+			    a2 = a[ia + i] - 0.5 * a1;
+			    b2 = b[ia + i] - 0.5 * b1;
+			    a3 = S60 * (c1 * a[ib + i] + s1 * b[ib + i] -
+				        c2 * a[ic + i] - s2 * b[ic + i]);
+			    b3 = S60 * (c1 * b[ib + i] - s1 * a[ib + i] -
+				        c2 * b[ic + i] + s2 * a[ic + i]);
+
+			    c[ja + j] = a[ia + i] + a1;
+			    d[ja + j] = b[ia + i] + b1;
+			    c[jb + j] = a2 + b3;
+			    d[jb + j] = b2 - a3;
+			    c[jc + j] = a2 - b3;
+			    d[jc + j] = -b2 - a3;
+			    i += inc3;
+			    j += inc4;
+			  }
+			ibase += inc1;
+			jbase += inc2;
+		      }
+		    ja += jink;
+		    jb += jink;
+		    jc -= jink;
+		    ibase += jump;
+		  }		/* End FORK */
+		if (ja > jc)
+		  return 0;
+	      }			/* End (ia != ic) */
+	    jbase = 0;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    /* soweit */
+		    c[ja + j] = a[ia + i] + 0.5 * (a[ib + i] - a[ic + i]);
+		    d[ja + j] = -S60 * (a[ib + i] + a[ic + i]);
+		    c[jb + j] = a[ia + i] - a[ib + i] + a[ic + i];
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	else			/* (la != m) */
+	  {
+	    z = 1.0 / n;
+	    y = S60 / n;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[ja + j] = z * (a[ia + i] + a[ib + i] + a[ic + i]);
+		    c[jb + j] = z * (a[ia + i] - 0.5 * (a[ib + i] + a[ic + i]));
+		    d[jb + j] = y * (a[ic + i] - a[ib + i]);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	return 0;
+      }
+
+    case 4:
+      {
+	double a0p2, a1p3;
+
+	i0 = 0;
+	i1 = i0 + iink;
+	i2 = i1 + iink;
+	i3 = i2 + iink;
+	j0 = 0;
+	j1 = j0 + inc2 * (m + m - la);
+	j2 = j1 + inc2 * (m + m);
+	j3 = j1;
+
+	if (la != m)		/*else go to 490 */
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a0p2 = a[i0 + i] + a[i2 + i];
+		    a1p3 = a[i1 + i] + a[i3 + i];
+
+		    c[j0 + j] = a0p2 + a1p3;
+		    c[j2 + j] = a0p2 - a1p3;
+
+		    c[j1 + j] = a[i0 + i] - a[i2 + i];
+		    d[j1 + j] = a[i3 + i] - a[i1 + i];
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	    j0 += jink;
+	    jink += jink;
+	    j1 += jink;
+	    j2 -= jink;
+	    j3 -= jink;
+	    ibase += jump;
+	    jump += jump + iink;
+
+	    if (j1 != j2)	/* else go to 460; */
+	      {
+		for (k = la; k <= kstop; k += la)
+		  {
+		    kb = k + k;
+		    kc = kb + kb;
+		    kd = kc + kb;
+		    c1 = trigs[kb  ];
+		    s1 = trigs[kb+1];
+		    c2 = trigs[kc  ];
+		    s2 = trigs[kc+1];
+		    c3 = trigs[kd  ];
+		    s3 = trigs[kd+1];
+		    jbase = 0;
+		    for (l = 0; l < la; ++l)
+		      {
+			i = ibase;
+			j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+			for (ijk = 0; ijk < lot; ++ijk)
+			  {
+			    a0 = a[i0 + i] + c2 * a[i2 + i] + s2 * b[i2 + i];
+			    a2 = a[i0 + i] - c2 * a[i2 + i] - s2 * b[i2 + i];
+			    b0 = b[i0 + i] + c2 * b[i2 + i] - s2 * a[i2 + i];
+			    b2 = b[i0 + i] - c2 * b[i2 + i] + s2 * a[i2 + i];
+
+			    a1 = c1 * a[i1 + i] + s1 * b[i1 + i] +
+                                 c3 * a[i3 + i] + s3 * b[i3 + i];
+			    a3 = c1 * a[i1 + i] + s1 * b[i1 + i] -
+                                 c3 * a[i3 + i] - s3 * b[i3 + i];
+			    b1 = c1 * b[i1 + i] - s1 * a[i1 + i] +
+                                 c3 * b[i3 + i] - s3 * a[i3 + i];
+			    b3 = c1 * b[i1 + i] - s1 * a[i1 + i] -
+                                 c3 * b[i3 + i] + s3 * a[i3 + i];
+
+			    c[j0 + j] = a0 + a1;
+			    c[j2 + j] = a0 - a1;
+			    d[j0 + j] = b0 + b1;
+			    d[j2 + j] = b1 - b0;
+			    c[j1 + j] = a2 + b3;
+			    c[j3 + j] = a2 - b3;
+			    d[j1 + j] = b2 - a3;
+			    d[j3 + j] = -b2 - a3;
+			    i += inc3;
+			    j += inc4;
+			  }
+			ibase += inc1;
+			jbase += inc2;
+		      }
+		    j0 += jink;
+		    j1 += jink;
+		    j2 -= jink;
+		    j3 -= jink;
+		    ibase += jump;
+		  }		/* End FORK */
+		if (j1 > j2)
+		  return 0;
+	      }			/* End (i1 != i2) */
+	    jbase = 0;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    c[j0 + j] =  a[i0 + i] + SQ2 * (a[i1 + i] - a[i3 + i]);
+		    c[j1 + j] =  a[i0 + i] - SQ2 * (a[i1 + i] - a[i3 + i]);
+		    d[j0 + j] = -a[i2 + i] - SQ2 * (a[i1 + i] + a[i3 + i]);
+		    d[j1 + j] =  a[i2 + i] - SQ2 * (a[i1 + i] + a[i3 + i]);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	else			/* (la != m) */
+	  {
+	    z = 1.0 / n;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a0p2 = a[i0 + i] + a[i2 + i];
+		    a1p3 = a[i1 + i] + a[i3 + i];
+
+		    c[j0 + j] = z * (a0p2 + a1p3);
+		    c[j2 + j] = z * (a0p2 - a1p3);
+		    c[j1 + j] = z * (a[i0 + i] - a[i2 + i]);
+		    d[j1 + j] = z * (a[i3 + i] - a[i1 + i]);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	return 0;
+      }
+
+    case 5:
+      {
+	double a1p4, a2p3, b1p4, b2p3, a025, b025, asps, bsps, a0pq, b0pq;
+	double a1m4, a2m3, b1m4, b2m3, aqrt, bqrt, asms, bsms, a0mq, b0mq;
+
+	i0 = 0;
+	i1 = i0 + iink;
+	i2 = i1 + iink;
+	i3 = i2 + iink;
+	i4 = i3 + iink;
+	j0 = 0;
+	j1 = j0 + inc2 * (m + m - la);
+	j2 = j1 + inc2 * (m + m);
+	j3 = j2;
+	j4 = j1;
+
+	if (la != m)		/* else go to 590; */
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a1p4 = a[i1 + i] + a[i4 + i];
+		    a1m4 = a[i1 + i] - a[i4 + i];
+		    a2p3 = a[i2 + i] + a[i3 + i];
+		    a2m3 = a[i2 + i] - a[i3 + i];
+
+		    a025 = a[i0 + i] - 0.25 * (a1p4 + a2p3);
+		    aqrt = QT5 * (a1p4 - a2p3);
+
+		    c[j0 + j] = a[i0 + i] + a1p4 + a2p3;
+		    c[j1 + j] = a025 + aqrt;
+		    c[j2 + j] = a025 - aqrt;
+		    d[j1 + j] = -S72 * a1m4 - S36 * a2m3;
+		    d[j2 + j] = -S36 * a1m4 + S72 * a2m3;
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	    j0 += jink;
+	    jink += jink;
+	    j1 += jink;
+	    j2 += jink;
+	    j3 -= jink;
+	    j4 -= jink;
+	    ibase += jump;
+	    jump += jump + iink;
+
+	    if (j1 != j3)
+	      {
+		for (k = la; k <= kstop; k += la)
+		  {
+		    kb = k + k;
+		    kc = kb + kb;
+		    kd = kc + kb;
+		    ke = kd + kb;
+		    c1 = trigs[kb  ];
+		    s1 = trigs[kb+1];
+		    c2 = trigs[kc  ];
+		    s2 = trigs[kc+1];
+		    c3 = trigs[kd  ];
+		    s3 = trigs[kd+1];
+		    c4 = trigs[ke  ];
+		    s4 = trigs[ke+1];
+		    jbase = 0;
+		    for (l = 0; l < la; ++l)
+		      {
+			i = ibase;
+			j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+			for (ijk = 0; ijk < lot; ++ijk)
+			  {
+			    a1p4 = c1 * a[i1 + i] + s1 * b[i1 + i] + 
+			           c4 * a[i4 + i] + s4 * b[i4 + i];
+			    a1m4 = c1 * a[i1 + i] + s1 * b[i1 + i] - 
+			           c4 * a[i4 + i] - s4 * b[i4 + i];
+			    a2p3 = c2 * a[i2 + i] + s2 * b[i2 + i] + 
+			           c3 * a[i3 + i] + s3 * b[i3 + i];
+			    a2m3 = c2 * a[i2 + i] + s2 * b[i2 + i] -
+			           c3 * a[i3 + i] - s3 * b[i3 + i];
+			    b1p4 = c1 * b[i1 + i] - s1 * a[i1 + i] + 
+			           c4 * b[i4 + i] - s4 * a[i4 + i];
+			    b1m4 = c1 * b[i1 + i] - s1 * a[i1 + i] -
+			           c4 * b[i4 + i] + s4 * a[i4 + i];
+			    b2p3 = c2 * b[i2 + i] - s2 * a[i2 + i] +
+			           c3 * b[i3 + i] - s3 * a[i3 + i];
+			    b2m3 = c2 * b[i2 + i] - s2 * a[i2 + i] -
+			           c3 * b[i3 + i] + s3 * a[i3 + i];
+
+			    a025 = a[i0 + i] - 0.25 * (a1p4 + a2p3);
+			    aqrt = QT5 * (a1p4 - a2p3);
+			    b025 = b[i0 + i] - 0.25 * (b1p4 + b2p3);
+			    bqrt = QT5 * (b1p4 - b2p3);
+
+			    a0pq = a025 + aqrt;
+			    a0mq = a025 - aqrt;
+			    b0pq = b025 + bqrt;
+			    b0mq = b025 - bqrt;
+
+			    asps = S72 * a1m4 + S36 * a2m3;
+			    asms = S36 * a1m4 - S72 * a2m3;
+			    bsps = S72 * b1m4 + S36 * b2m3;
+			    bsms = S36 * b1m4 - S72 * b2m3;
+
+			    c[j0 + j] = a[i0 + i] + a1p4 + a2p3;
+			    c[j1 + j] = a0pq + bsps;
+			    c[j2 + j] = a0mq + bsms;
+			    c[j3 + j] = a0mq - bsms;
+			    c[j4 + j] = a0pq - bsps;
+			    d[j0 + j] = b[i0 + i] + b1p4 + b2p3;
+			    d[j1 + j] = b0pq - asps;
+			    d[j2 + j] = b0mq - asms;
+			    d[j3 + j] = -b0mq - asms;
+			    d[j4 + j] = -b0pq - asps;
+			    i += inc3;
+			    j += inc4;
+			  }
+			ibase += inc1;
+			jbase += inc2;
+		      }
+		    j0 += jink;
+		    j1 += jink;
+		    j2 += jink;
+		    j3 -= jink;
+		    j4 -= jink;
+		    ibase += jump;
+		  }		/* End FORK */
+		if (j1 > j3)
+		  return 0;
+	      }			/* End (jb != jd) */
+	    jbase = 0;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a1p4 = a[i1 + i] + a[i4 + i];
+		    a1m4 = a[i1 + i] - a[i4 + i];
+		    a2p3 = a[i2 + i] + a[i3 + i];
+		    a2m3 = a[i2 + i] - a[i3 + i];
+
+		    a025 = a[i0 + i] + 0.25 * (a1m4 - a2m3);
+		    aqrt = QT5 * (a1m4 + a2m3);
+
+		    c[j0 + j] = a025 + aqrt;
+		    c[j1 + j] = a025 - aqrt;
+		    c[j2 + j] = a[i0 + i] - a1m4 + a2m3;
+		    d[j0 + j] = -S36 * a1p4 - S72 * a2p3;
+		    d[j1 + j] = -S72 * a1p4 + S36 * a2p3;
+
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	else
+	  {
+	    z = 1.0 / n;
+	    y = QT5 / n;
+	    x = S36 / n;
+	    w = S72 / n;
+
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a1p4 = a[i1 + i] + a[i4 + i];
+		    a1m4 = a[i1 + i] - a[i4 + i];
+		    a2p3 = a[i2 + i] + a[i3 + i];
+		    a2m3 = a[i2 + i] - a[i3 + i];
+
+		    a025 = z * (a[i0 + i] - 0.25 * (a1p4 + a2p3));
+		    aqrt = y * (a1p4 - a2p3);
+
+		    c[j0 + j] = z * (a[i0 + i] + a1p4 + a2p3);
+		    c[j1 + j] = a025 + aqrt;
+		    c[j2 + j] = a025 - aqrt;
+		    d[j1 + j] = -w * a1m4 - x * a2m3;
+		    d[j2 + j] = w * a2m3 - x * a1m4;
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	return 0;
+      }
+
+    case 6:
+      {
+	double ab1a, ab2a, ab3a, ab4a, ab5a;
+	double ab1b, ab2b, ab3b, ab4b, ab5b;
+	double a0p3, a1p4, a1p5, a2p4, a2p5;
+	double a0m3, a1m4, a1m5, a2m4, a2m5;
+	double b1p4, b2p5;
+	double b1m4, b2m5;
+	double ap05, bp05, ap60, bp60;
+	double am05, bm05, am60, bm60;
+
+	i0 = 0;
+	i1 = i0 + iink;
+	i2 = i1 + iink;
+	i3 = i2 + iink;
+	i4 = i3 + iink;
+	i5 = i4 + iink;
+	j0 = 0;
+	j1 = j0 + inc2 * (m + m - la);
+	j2 = j1 + inc2 * (m + m);
+	j3 = j2 + inc2 * (m + m);
+	j4 = j2;
+	j5 = j1;
+
+	if (la != m)
+	  {
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a0p3 = a[i0 + i] + a[i3 + i];
+		    a0m3 = a[i0 + i] - a[i3 + i];
+		    a1p4 = a[i1 + i] + a[i4 + i];
+		    a1m4 = a[i1 + i] - a[i4 + i];
+		    a2p5 = a[i2 + i] + a[i5 + i];
+		    a2m5 = a[i2 + i] - a[i5 + i];
+
+		    c[j0 + j] = a0p3 + a1p4 + a2p5;
+		    c[j3 + j] = a0m3 + a2m5 - a1m4;
+
+		    c[j1 + j] = a0m3 - 0.5 * (a2m5 - a1m4);
+		    c[j2 + j] = a0p3 - 0.5 * (a1p4 + a2p5);
+
+		    d[j1 + j] = S60 * (-a2m5 - a1m4);
+		    d[j2 + j] = S60 * (a2p5 - a1p4);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	    j0 += jink;
+	    jink += jink;
+	    j1 += jink;
+	    j2 += jink;
+	    j3 -= jink;
+	    j4 -= jink;
+	    j5 -= jink;
+	    ibase += jump;
+	    jump += jump + iink;
+
+	    if (j2 != j3)
+	      {
+		for (k = la; k <= kstop; k += la)
+		  {
+		    kb = k + k;
+		    kc = kb + kb;
+		    kd = kc + kb;
+		    ke = kd + kb;
+		    kf = ke + kb;
+		    c1 = trigs[kb  ];
+		    s1 = trigs[kb+1];
+		    c2 = trigs[kc  ];
+		    s2 = trigs[kc+1];
+		    c3 = trigs[kd  ];
+		    s3 = trigs[kd+1];
+		    c4 = trigs[ke  ];
+		    s4 = trigs[ke+1];
+		    c5 = trigs[kf  ];
+		    s5 = trigs[kf+1];
+		    jbase = 0;
+		    for (l = 0; l < la; ++l)
+		      {
+			i = ibase;
+			j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+			for (ijk = 0; ijk < lot; ++ijk)
+			  {
+			    ab1a = c1 * a[i1 + i] + s1 * b[i1 + i];
+			    ab1b = c1 * b[i1 + i] - s1 * a[i1 + i];
+			    ab2a = c2 * a[i2 + i] + s2 * b[i2 + i];
+			    ab2b = c2 * b[i2 + i] - s2 * a[i2 + i];
+			    ab3a = c3 * a[i3 + i] + s3 * b[i3 + i];
+			    ab3b = c3 * b[i3 + i] - s3 * a[i3 + i];
+			    ab4a = c4 * a[i4 + i] + s4 * b[i4 + i];
+			    ab4b = c4 * b[i4 + i] - s4 * a[i4 + i];
+			    ab5a = c5 * a[i5 + i] + s5 * b[i5 + i];
+			    ab5b = c5 * b[i5 + i] - s5 * a[i5 + i];
+
+			    a1p4 = ab1a + ab4a;
+			    a1m4 = ab1a - ab4a;
+			    a2p5 = ab2a + ab5a;
+			    a2m5 = ab2a - ab5a;
+
+			    b1p4 = ab1b + ab4b;
+			    b1m4 = ab1b - ab4b;
+			    b2p5 = ab2b + ab5b;
+			    b2m5 = ab2b - ab5b;
+
+			    ap05 = a[i0 + i] + ab3a - 0.5 * (a1p4 + a2p5);
+			    bp05 = b[i0 + i] + ab3b - 0.5 * (b1p4 + b2p5);
+			    am05 = a[i0 + i] - ab3a - 0.5 * (a2m5 - a1m4);
+			    bm05 = -b[i0 + i] + ab3b - 0.5 * (b1m4 - b2m5);
+
+			    ap60 = S60 * (a2p5 - a1p4);
+			    bp60 = S60 * (b2p5 - b1p4);
+			    am60 = S60 * (-a2m5 - a1m4);
+			    bm60 = S60 * (-b2m5 - b1m4);
+
+			    c[j0 + j] = a[i0 + i] + ab3a + a1p4 + a2p5;
+			    d[j0 + j] = b[i0 + i] + ab3b + b1p4 + b2p5;
+			    c[j1 + j] = am05 - bm60;
+			    d[j1 + j] = am60 - bm05;
+			    c[j2 + j] = ap05 - bp60;
+			    d[j2 + j] = ap60 + bp05;
+			    c[j3 + j] = a[i0 + i] - ab3a - a1m4 + a2m5;
+			    d[j3 + j] = -b[i0 + i] + ab3b + b1m4 - b2m5;
+			    c[j4 + j] = ap05 + bp60;
+			    d[j4 + j] = ap60 - bp05;
+			    c[j5 + j] = am05 + bm60;
+			    d[j5 + j] = am60 + bm05;
+			    i += inc3;
+			    j += inc4;
+			  }
+			ibase += inc1;
+			jbase += inc2;
+		      }
+		    j0 += jink;
+		    j1 += jink;
+		    j2 += jink;
+		    j3 -= jink;
+		    j4 -= jink;
+		    j5 -= jink;
+		    ibase += jump;
+		  }
+		if (j2 > j3)
+		  return 0;
+	      }
+	    jbase = 0;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a1p5 = a[i1 + i] + a[i5 + i];
+		    a1m5 = a[i1 + i] - a[i5 + i];
+		    a2p4 = a[i2 + i] + a[i4 + i];
+		    a2m4 = a[i2 + i] - a[i4 + i];
+
+		    c[j0 + j] =  a[i0 + i] + 0.5 * a2m4 + S60 * a1m5;
+		    d[j0 + j] = -a[i3 + i] - 0.5 * a1p5 - S60 * a2p4;
+		    c[j1 + j] =  a[i0 + i] - a2m4;
+		    d[j1 + j] =  a[i3 + i] - a1p5;
+		    c[j2 + j] =  a[i0 + i] + 0.5 * a2m4 - S60 * a1m5;
+		    d[j2 + j] = -a[i3 + i] - 0.5 * a1p5 + S60 * a2p4;
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	else
+	  {
+	    z = 1.0 / n;
+	    y = S60 / n;
+	    for (l = 0; l < la; ++l)
+	      {
+		i = ibase;
+		j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+		for (ijk = 0; ijk < lot; ++ijk)
+		  {
+		    a0p3 = a[i0 + i] + a[i3 + i];
+		    a0m3 = a[i0 + i] - a[i3 + i];
+		    a1p4 = a[i1 + i] + a[i4 + i];
+		    a1m4 = a[i1 + i] - a[i4 + i];
+		    a2p5 = a[i2 + i] + a[i5 + i];
+		    a2m5 = a[i2 + i] - a[i5 + i];
+
+		    c[j0 + j] = z * (a0p3 + a1p4 + a2p5);
+		    c[j3 + j] = z * (a0m3 + a2m5 - a1m4);
+
+		    c[j1 + j] = z * (a0m3 - 0.5 * (a2m5 - a1m4));
+		    c[j2 + j] = z * (a0p3 - 0.5 * (a1p4 + a2p5));
+
+		    d[j1 + j] = y * (-a2m5 - a1m4);
+		    d[j2 + j] = y * (a2p5 - a1p4);
+		    i += inc3;
+		    j += inc4;
+		  }
+		ibase += inc1;
+		jbase += inc2;
+	      }
+	  }
+	return 0;
+      }
+
+    case 8:
+      {
+	double a0p4, a1p5, a2p6, a3p7;
+	double a0m4, a1m5, a2m6, a3m7;
+
+	if (la != m)
+	  return 3;
+	i0 = 0;
+	i1 = i0 + iink;
+	i2 = i1 + iink;
+	i3 = i2 + iink;
+	i4 = i3 + iink;
+	i5 = i4 + iink;
+	i6 = i5 + iink;
+	i7 = i6 + iink;
+	j0 = 0;
+	j1 = j0 + jink;
+	j2 = j1 + jink;
+	j3 = j2 + jink;
+	j4 = j3 + jink;
+	j5 = j4 + jink;
+	j6 = j5 + jink;
+	j7 = j6 + jink;
+	z = 1.0 / n;
+	y = SQ2 / n;
+
+	for (l = 0; l < la; ++l)
+	  {
+	    i = ibase;
+	    j = jbase;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+	    for (ijk = 0; ijk < lot; ++ijk)
+	      {
+		a0p4 = a[i0 + i] + a[i4 + i];
+		a0m4 = a[i0 + i] - a[i4 + i];
+		a1p5 = a[i1 + i] + a[i5 + i];
+		a1m5 = a[i1 + i] - a[i5 + i];
+		a2p6 = a[i2 + i] + a[i6 + i];
+		a2m6 = a[i2 + i] - a[i6 + i];
+		a3p7 = a[i3 + i] + a[i7 + i];
+		a3m7 = a[i3 + i] - a[i7 + i];
+
+		c[j0 + j] =  z * (a0p4 + a1p5 + a2p6 + a3p7);
+		c[j7 + j] =  z * (a0p4 - a1p5 + a2p6 - a3p7);
+
+		c[j3 + j] =  z * (a0p4 - a2p6);
+		c[j4 + j] =  z * (a3p7 - a1p5);
+
+		c[j1 + j] =  z * a0m4 + y * (a1m5 - a3m7);
+		c[j5 + j] =  z * a0m4 - y * (a1m5 - a3m7);
+		c[j2 + j] = -z * a2m6 - y * (a1m5 + a3m7);
+		c[j6 + j] =  z * a2m6 - y * (a1m5 + a3m7);
+		i += inc3;
+		j += inc4;
+	      }
+	    ibase += inc1;
+	    jbase += inc2;
+	  }
+      }
+    }
+  return 0;
+}
+
+
+
+/* ====================== */
+/* Fast Fourier Transform */
+/* ====================== */
+void fc2gp(double *trig, long *ifax, double *fc, double *gp, long nlat, long nlon, long nlev, long nfc)
+{
+  long lot, fou, ia, ifac, jump, k, la;
+  long lat, lev, lon, nfax, rix, wix;
+  double *wfc, *wgp, *wpt;
+  long nx, nblox, nvex, nvex0, nb;
+  long istart, i, j, ibase, jbase, jj, ii, ix;
+  long *istartv;
+
+
+  /* fc2gp performs fourier to gridpoint transforms using           */
+  /* multiple fast fourier transform of length nlon                 */
+  /*                                                                */
+  /* fc   - real array of fourier coefficients fc[nlev][nfc][nlat]  */
+  /* gp   - real array of gridpoints           gp[nlev][nlat][nlon] */
+  /* nlat - Number of latitudes                                     */
+  /* nlon - Number of longitudes                                    */
+  /* nlev - Number of levels                                        */
+  /* nfc  - Number of fourier coefficients on 1 latitude            */
+
+  /* x(j) = sum(k=0,...,n-1)(c(k)*exp(2*i*j*k*pi/nlon))             */
+  /*        where c(k) = a(k) + i*b(k) and c(n-k) = a(k)-i*b(k)     */
+
+  if ( ifax[9] != nlon ) fprintf(stderr, "fc2gp: wrong initialization!\n");
+
+  nfax = ifax[0];
+
+  jump = (nlon + 2);
+  lot  = nlev * nlat;
+
+  wfc = (double *) malloc(lot*jump*sizeof(double));
+#if ! defined (_OPENMP)
+  wgp = (double *) malloc(lot*jump*sizeof(double));
+#endif
+
+  for ( lev = 0; lev < nlev; ++lev )
+    {
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(lat, fou, wix, rix)
+#endif
+      for ( lat = 0; lat < nlat; ++lat )
+	{
+	  wix = jump * (lat + lev * nlat);
+	  rix = lat + lev * nlat * nfc;
+	  for ( fou = 0; fou < nfc; ++fou )
+	    wfc[wix + fou] = fc[rix + fou * nlat];
+	  for ( fou = nfc; fou < jump; ++fou )
+	    wfc[wix + fou] = 0.0;
+	  /*	  wfc[wix + 1] = 0.5 * wfc[wix]; */
+	}
+    }
+
+  nx = nlon + 1;
+  if ( nlon%2 == 1 ) nx = nlon;
+  nblox = 1 + (lot-1)/NFFT;
+  nvex  = lot - (nblox-1)*NFFT;
+  nvex0 = nvex;
+
+  istartv = (long *) malloc(nblox*sizeof(long));
+
+  istart = 0;
+  for ( nb = 0; nb < nblox; nb++ )
+    {
+      istartv[nb] = istart;
+      istart = istart + nvex*jump;
+      nvex = NFFT;
+    }
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(istart, nvex, ix, ii, jj, i, j, k, ia, la, ifac, ibase, jbase, wgp)
+#endif
+  for ( nb = 0; nb < nblox; nb++ )
+    {
+#if defined (_OPENMP)
+      wgp = (double *) malloc(lot*jump*sizeof(double));
+#endif
+      istart = istartv[nb];
+      if ( nb == 0 ) nvex = nvex0;
+      else           nvex = NFFT;
+
+      i = istart;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+      for ( j = 0; j < nvex; j++ )
+	{
+	  wfc[i+1] = 0.5*wfc[i];
+	  i += jump;
+	}
+      if ( nlon%2 != 1 )
+	{
+	  i = istart + nlon;
+	  for ( j = 0; j < nvex; j++ )
+	    {
+	      wfc[i] = 0.5*wfc[i];
+	      i += jump;
+	    }
+	}
+
+      ia = istart + 1;
+      la = 1;
+      for ( k = 0; k < nfax; ++k )
+	{
+	  ifac = ifax[k + 1];
+
+	  if ( k & 1 )
+	    rpassc(wgp, wgp+la, wfc+ia, wfc+ia+ifac*la, trig,
+		   1, 1, nx, jump, nvex, nlon, ifac, la);
+	  else
+	    rpassc(wfc+ia, wfc+ia+la, wgp, wgp+ifac*la, trig,
+		   1, 1, jump, nx, nvex, nlon, ifac, la);
+
+	  la *= ifac;
+	  ia = istart;
+	}
+
+      /* If necessary, copy results back to a */
+
+      if ( nfax%2 != 0 )
+	{
+	  ibase = 0;
+	  jbase = ia;
+	  for ( jj = 0; jj < nvex; jj++ )
+	    {
+	      i = ibase;
+	      j = jbase;
+	      for ( ii = 0; ii < nlon; ii++ )
+		{
+		  wfc[j++] = wgp[i++];
+		}
+	      ibase = ibase + nx;
+	      jbase = jbase + jump;
+	    }
+	 }
+
+      /* Fill in zeros at end */
+
+      ix = istart + nlon;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+      for ( j = 0; j < nvex; j++ )
+	{
+          wfc[ix]   = 0.0;
+          wfc[ix+1] = 0.0;
+          ix = ix + jump;
+	}
+
+#if defined (_OPENMP)
+      free(wgp);
+#endif
+    }
+
+  wpt = wfc;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(j, lon)
+#endif
+  for ( j = 0; j < lot; ++j )
+    for ( lon = 0; lon < nlon; ++lon )
+      gp[lon + j*nlon] = wpt[lon + j*jump];
+
+  free(istartv);
+#if ! defined (_OPENMP)
+  free(wgp);
+#endif
+  free(wfc);
+}
+
+
+void gp2fc(double *trig, long *ifax, double *gp, double *fc, long nlat, long nlon, long nlev, long nfc)
+{
+  long lot, fou, ia, ifac, jump, k, la;
+  long lat, lev, lon, nfax, rix, wix;
+  double *wfc, *wgp, *wpt;
+  long nx, nblox, nvex, nb;
+  long istart, i, j, ibase, jbase, jj, ii, ix, iz;
+
+
+  /* gp2fc performs gridpoint to fourier transforms using           */
+  /* multiple fast fourier transform of length nlon                 */
+  /*                                                                */
+  /* gp   - real array of gridpoints           gp[nlev][nlat][nlon] */
+  /* fc   - real array of fourier coefficients fc[nlev][nfc][nlat]  */
+  /* nlat - Number of latitudes                                     */
+  /* nlon - Number of longitudes                                    */
+  /* nlev - Number of levels                                        */
+  /* nfc  - Number of fourier coefficients on 1 latitude            */
+
+  /* a(k) =  (1/n) * sum(j=0,...,n-1)(x(j) * cos(2*j*k*pi/n))       */
+  /* b(k) = -(1/n) * sum(j=0,...,n-1)(x(j) * sin(2*j*k*pi/n))       */
+
+  if ( ifax[9] != nlon ) fprintf(stderr, "gp2fc: wrong initialization!\n");
+
+  nfax = ifax[0];
+
+  jump = (nlon + 2);
+  lot  = nlev * nlat;
+
+  wfc = (double *) malloc(lot * jump * sizeof(double));
+  wgp = (double *) malloc(lot * jump * sizeof(double));
+
+  rix = 0;
+  wix = 0;
+  for ( j = 0; j < lot; ++j )
+    {
+      for (lon = 0; lon < nlon; ++lon)
+	wgp[wix + lon] = gp[rix + lon];
+      wgp[wix + nlon] = 0.0;
+      wgp[wix + nlon + 1] = 0.0;
+      rix += nlon;
+      wix += jump;
+    }
+
+  nx = nlon + 1;
+  if ( nlon%2 == 1 ) nx = nlon;
+  nblox = 1 + (lot-1)/NFFT;
+  nvex = lot - (nblox-1)*NFFT;
+
+  istart = 0;
+  for ( nb = 0; nb < nblox; nb++ )
+    {
+      ia = istart;
+      la = nlon;
+
+      for ( k = 0; k < nfax; ++k )
+	{
+	  ifac = ifax[nfax - k];
+	  la /= ifac;
+	  if (k & 1)
+	    qpassc (wfc, wfc+ifac*la, wgp+ia, wgp+ia+la, trig,
+		    1, 1, nx, jump, nvex, nlon, ifac, la);
+	  else
+	    qpassc (wgp+ia, wgp+ia+ifac*la, wfc, wfc+la, trig,
+		    1, 1, jump, nx, nvex, nlon, ifac, la);
+	  ia = istart + 1;
+	}
+
+      /* If necessary, copy results back to a */
+
+      if ( nfax%2 != 0 )
+	{
+	  ibase = 0;
+	  jbase = ia;
+	  for ( jj = 0; jj < nvex; jj++ )
+	    {
+	      i = ibase;
+	      j = jbase;
+	      for ( ii = 0; ii < nlon; ii++ )
+		{
+		  wgp[j++] = wfc[i++];
+		}
+	      ibase = ibase + nx;
+	      jbase = jbase + jump;
+	    }
+	 }
+
+      /* Shift a(0) & fill in zero imag parts */
+
+      ix = istart;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+      for ( j = 0; j < nvex; j++ )
+	{
+          wgp[ix] = wgp[ix+1];
+	  wgp[ix+1] = 0.0;
+          ix = ix + jump;
+	}
+
+      if ( nlon%2 != 1 )
+	{
+	  iz = istart + (nlon+1);
+	  for ( j = 0; j < nvex; j++ )
+	    {
+	      wgp[iz] = 0.0;
+	      iz = iz + jump;
+	    }
+	}
+
+      istart = istart + nvex*jump;
+      nvex = NFFT;
+    }
+
+  wpt = wgp;
+
+  for ( lev = 0; lev < nlev; ++lev )
+    {
+      for ( lat = 0; lat < nlat; ++lat )
+	{
+	  rix = jump * (lat + lev * nlat);
+	  wix = lat + lev * nlat * nfc;
+	  fc[wix] = wpt[rix];
+	  fc[wix + nlat] = 0.0;
+	  for ( fou = 2; fou < nfc; ++fou )
+	    fc[wix + fou * nlat] = wpt[rix + fou];
+	}
+    }
+
+  free(wgp);
+  free(wfc);
+}
diff --git a/src/functs.h b/src/functs.h
new file mode 100644
index 0000000..02d943f
--- /dev/null
+++ b/src/functs.h
@@ -0,0 +1,61 @@
+#ifndef _FUNCTS_H
+#define _FUNCTS_H
+
+#define  func_fld       7
+#define  func_all       8
+#define  func_hrd       9
+
+#define  func_min      10
+#define  func_max      11
+#define  func_range    12
+#define  func_sum      13
+#define  func_avg      14
+#define  func_mean     15
+#define  func_var      16
+#define  func_std      17
+#define  func_pctl     18
+
+#define  func_cor      20
+#define  func_covar    21
+
+#define  func_crps     30
+#define  func_brs      31
+#define  func_rank     32
+#define  func_roc      33
+
+#define  func_add      41
+#define  func_sub      42
+#define  func_mul      43
+#define  func_div      44
+#define  func_mod      45
+
+#define  func_atan2    50
+
+#define  func_read     60
+#define  func_write    61
+
+#define  func_month    84
+#define  func_year     85
+#define  func_time     86
+#define  func_date     87
+#define  func_step     88
+#define  func_datetime 89
+
+#define  func_lon      98
+#define  func_lat      99
+
+enum cmp_flag {
+  CMP_CODE     = 1,
+  CMP_NAME     = 2,
+  CMP_GRID     = 4,
+  CMP_NLEVEL   = 8,
+  CMP_GRIDSIZE = 16,
+  CMP_HRD      = CMP_CODE | CMP_GRIDSIZE,
+  CMP_DIM      =            CMP_GRIDSIZE | CMP_NLEVEL | CMP_GRID,
+  CMP_ALL      = CMP_NAME | CMP_GRIDSIZE | CMP_NLEVEL | CMP_GRID,
+};
+
+void    vlistCompare(int vlistID1, int vlistID2, int flag);
+int     vlistCompareX(int vlistID1, int vlistID2, int flag);
+
+#endif  /* _FUNCTS_H */
diff --git a/src/gradsdeslib.c b/src/gradsdeslib.c
new file mode 100644
index 0000000..ec0dd7e
--- /dev/null
+++ b/src/gradsdeslib.c
@@ -0,0 +1,2281 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <math.h>
+
+#include <cdi.h>
+#include "gradsdeslib.h"
+
+extern int cdoDefaultDataType;
+
+static char pout[512];
+FILE *descr;             /* File descriptor pointer */
+int cal365 = 0;
+int fullyear = -999;
+
+void dsets_init(dsets_t *pfi)
+{
+  int i;
+
+  pfi->name[0]    = 0;
+  pfi->dnam[0]    = 0;
+  pfi->title[0]   = 0;
+  pfi->bswap      = 0;
+  pfi->fhdr       = 0;
+  pfi->xyhdr      = 0;
+  pfi->seqflg     = 0;
+  pfi->yrflg      = 0;
+  pfi->zrflg      = 0;
+  pfi->flt64      = 0;
+  pfi->tmplat     = 0;
+  pfi->pa2mb      = 0;
+  pfi->calendar   = 0;
+  pfi->type       = 1;      /* Assume grid unless told otherwise */
+  pfi->idxflg = 0;       /* Assume binary */
+  pfi->ncflg      = 0;      /* Assume not netcdf */
+
+  pfi->undef = -9.99E33; 
+
+  pfi->pvar1 = NULL;
+  pfi->ens1 = NULL;
+
+  pfi->pchsub1    = NULL;
+
+  for ( i = 0; i < 5; ++i ) pfi->dnum[i]    = 0;
+}
+
+/* Byte swap requested number of 4 byte elements */
+
+void gabswp (void *r, gaint cnt) {
+gaint i;
+char *ch1,*ch2,*ch3,*ch4,cc1,cc2;
+
+  ch1 = (char *)r;
+  ch2 = ch1+1;
+  ch3 = ch2+1;
+  ch4 = ch3+1;
+  for (i=0; i<cnt; i++) {
+    cc1 = *ch1;
+    cc2 = *ch2;
+    *ch1 = *ch4;
+    *ch2 = *ch3;
+    *ch3 = cc2;
+    *ch4 = cc1;
+    ch1+=4; ch2+=4; ch3+=4; ch4+=4;
+  }
+}
+
+/* Byte swap requested number of 2 byte elements */
+
+void gabswp2 (void *r, gaint cnt) {
+gaint i;
+char *ch1,*ch2,cc1;
+
+  ch1 = (char *)r;
+  ch2 = ch1+1;
+  for (i=0; i<cnt; i++) {
+    cc1  = *ch1;
+    *ch1 = *ch2;
+    *ch2 = cc1;
+    ch1+=4; ch2+=4;
+  }
+}
+
+/*mf version
+  convert all upper case alphabetic characters to lower case.
+  The GrADS system is case insensitive, and assumes lower case
+  internally in most cases. Does not turn to lower case if in "'s
+*/
+void lowcas (char *ch) {
+int i;
+int qflag=0;
+
+  while (*ch!='\0' && *ch!='\n') {
+    i = *ch;
+    if(*ch == '\"' && qflag == 0 ) {
+      qflag=1;
+      } else if(*ch == '\"' && qflag == 1 ) {
+	qflag=0;
+      }
+    if (i>64 && i<91 && qflag==0) {
+      i+=32;
+      *ch = i;
+    } else if(i == 95) {
+      *ch=i;
+    }
+    ch++;
+  }
+}
+
+/* Date/Time manipulation routines.  Note that these routines
+   are not particularly efficient, thus Date/Time conversions
+   should be kept to a minimum.                                      */
+
+static gaint mosiz[13] = {0,31,28,31,30,31,30,31,31,30,31,30,31};
+static gaint momn[13] = {0,44640,40320,44640,43200,44640,43200,
+                        44640,44640,43200,44640,43200,44640};
+static gaint mnacum[13] = {0,0,44640,84960,129600,172800,217440,
+                        260640,305280,349920,393120,437760,480960};
+static gaint mnacul[13] = {0,0,44640,86400,131040,174240,218880,
+                        262080,306720,351360,394560,439200,482400};
+
+
+/* Test for leap year.  Rules are:
+
+      Divisible by 4, it is a leap year, unless....
+      Divisible by 100, it is not a leap year, unless...
+      Divisible by 400, it is a leap year.                           */
+
+gaint qleap (gaint year)  {
+gaint i,y;
+
+/*mf - disable if 365 day calendar mf*/
+
+ if(/*mfcmn.*/cal365 == 1) return(0);
+
+  y = year;
+
+  i = y / 4;
+  i = (i*4) - y;
+  if (i!=0) return (0);
+
+  i = y / 100;
+  i = (i*100) - y;
+  if (i!=0) return (1);
+
+  i = y / 400;
+  i = (i*400) - y;
+  if (i!=0) return (0);
+
+  return (1);
+}
+
+/* Add an offset to a time.  Output to dto.                          */
+
+void timadd (struct dt *dtim, struct dt *dto) {
+gaint i;
+gaint cont;
+
+  /* First add months and years.  Normalize as needed.               */
+  dto->mo += dtim->mo;
+  dto->yr += dtim->yr;
+
+  while (dto->mo>12) {
+    dto->mo -= 12;
+    dto->yr++;
+  }
+
+  /* Add minutes, hours, and days directly.  Then normalize
+     to days, then normalize extra days to months/years.             */
+
+  dto->mn += dtim->mn;
+  dto->hr += dtim->hr;
+  dto->dy += dtim->dy;
+
+  if (dto->mn > 59) {
+    i = dto->mn / 60;
+    dto->hr += i;
+    dto->mn = dto->mn - (i*60);
+  }
+  if (dto->hr > 23) {
+    i = dto->hr / 24;
+    dto->dy += i;
+    dto->hr = dto->hr - (i*24);
+  }
+
+  cont = 1;
+  while (dto->dy > mosiz[dto->mo] && cont) {
+    if (dto->mo==2 && qleap(dto->yr)) {
+      if (dto->dy == 29) cont=0;
+      else {
+        dto->dy -= 29;
+        dto->mo++;
+      }
+    } else {
+      dto->dy -= mosiz[dto->mo];
+      dto->mo++;
+    }
+    while (dto->mo > 12) {dto->mo-=12; dto->yr++;}
+  }
+}
+
+/* Subtract an offset from a time.  Subtract minutes/hours/days
+   first so that we will exactly reverse the operation of timadd     */
+
+void timsub (struct dt *dtim, struct dt *dto) {
+gaint s1,s2;
+
+  /* Subtract minutes, hour, and days directly.  Then normalize
+     to days, then normalize deficient days from months/years.       */
+
+  dto->mn = dtim->mn - dto->mn;
+  dto->hr = dtim->hr - dto->hr;
+  dto->dy = dtim->dy - dto->dy;
+  s1 = dto->mo; s2 = dto->yr;
+  dto->mo = dtim->mo;
+  dto->yr = dtim->yr;
+
+  while (dto->mn < 0) {dto->mn+=60; dto->hr--;}
+  while (dto->hr < 0) {dto->hr+=24; dto->dy--;}
+
+  while (dto->dy < 1) {
+    dto->mo--;
+    if (dto->mo < 1) {dto->mo=12; dto->yr--;}
+    if (dto->mo==2 && qleap(dto->yr)) dto->dy += 29;
+    else dto->dy += mosiz[dto->mo];
+  }
+
+  /* Now subtract months and years.  Normalize as needed.            */
+
+  dto->mo = dto->mo - s1;
+  dto->yr = dto->yr - s2;
+
+  while (dto->mo < 1) {dto->mo+=12; dto->yr--;}
+
+  /* Adjust for leaps */
+
+  if (dto->mo==2 && dto->dy==29 && !qleap(dto->yr)) {
+    dto->mo=3; dto->dy=1;
+  }
+}
+
+/* Convert from a t grid coordinate to an absolute time.           */
+
+void gr2t (gadouble *vals, gadouble gr, struct dt *dtim) {
+struct dt stim;
+gadouble *moincr,*mnincr;
+gadouble v;
+
+  /* Get constants associated with this conversion                   */
+  stim.yr = (gaint)(*vals+0.1);
+  stim.mo = (gaint)(*(vals+1)+0.1);
+  stim.dy = (gaint)(*(vals+2)+0.1);
+  stim.hr = (gaint)(*(vals+3)+0.1);
+  stim.mn = (gaint)(*(vals+4)+0.1);
+  moincr = vals+5;
+  mnincr = vals+6;
+
+  /* Initialize output time                                          */
+  dtim->yr = 0;
+  dtim->mo = 0;
+  dtim->dy = 0;
+  dtim->hr = 0;
+  dtim->mn = 0;
+
+  /* Do conversion if increment is in minutes.                       */
+  if (*mnincr>0.1) {
+    v = *mnincr * (gr-1.0);
+    if (v>0.0) v = v + 0.5;   /* round */
+    else v = v - 0.5;
+    dtim->mn = (gaint)v;
+    if (dtim->mn<0) {
+      dtim->mn = -1 * dtim->mn;
+      timsub (&stim,dtim);
+    } else {
+      timadd (&stim,dtim);
+    }
+    return;
+
+  /* Do conversion if increment is in months.  Same as for minutes,
+     except special handling is required for partial months.   
+     JMA There is a bug here, and some precision decisions that need attention */
+
+  } else {
+    v = *moincr * (gr-1.0);
+    if (v<0.0) dtim->mo = (gaint)(v-0.9999); /* round (sort of)       */
+    else dtim->mo = (gaint)(v+0.0001);
+    v = v - (gadouble)dtim->mo;                /* Get fractional month  */
+    if (dtim->mo<0) {
+      dtim->mo = -1 * dtim->mo;
+      timsub (&stim,dtim);
+    } else timadd (&stim,dtim);
+    if (v<0.0001) return;         /* if fraction small, return       */
+
+    if (dtim->mo==2 && qleap(dtim->yr) ) {
+      v = v * 41760.0;
+    } else {
+      v = v * (gadouble)momn[dtim->mo];
+    }
+    stim = *dtim;
+    dtim->yr = 0;
+    dtim->mo = 0;
+    dtim->dy = 0;
+    dtim->hr = 0;
+    dtim->mn = (gaint)(v+0.5);
+    timadd (&stim,dtim);
+    return;
+  }
+}
+
+/* Calculate the difference between two times and return the
+   difference in minutes.   The calculation is time2 - time1, so
+   if time2 is earlier than time1, the result is negative.           */
+
+gaint timdif (struct dt *dtim1, struct dt *dtim2) {
+gaint min1,min2,yr;
+struct dt *temp;
+gaint swap,mo1,mo2;
+
+  swap = 0;
+  if (dtim1->yr > dtim2->yr) {
+    temp = dtim1;
+    dtim1 = dtim2;
+    dtim2 = temp;
+    swap = 1;
+  }
+
+  min1 = 0;
+  min2 = 0;
+
+  yr = dtim1->yr;
+  while (yr < dtim2->yr) {
+    if (qleap(yr)) min2 += 527040L;
+    else min2 += 525600L;
+    yr++;
+  }
+
+  mo1 = dtim1->mo;
+  mo2 = dtim2->mo;
+  if (qleap(dtim1->yr)) {
+    min1 = min1+mnacul[mo1]+(dtim1->dy*1440L)+(dtim1->hr*60L)+dtim1->mn;
+  } else {
+    min1 = min1+mnacum[mo1]+(dtim1->dy*1440L)+(dtim1->hr*60L)+dtim1->mn;
+  }
+  if (qleap(dtim2->yr)) {
+    min2 = min2+mnacul[mo2]+(dtim2->dy*1440L)+(dtim2->hr*60L)+dtim2->mn;
+  } else {
+    min2 = min2+mnacum[mo2]+(dtim2->dy*1440L)+(dtim2->hr*60L)+dtim2->mn;
+  }
+  if (swap) return (min1-min2);
+  else return (min2-min1);
+}
+
+static char *mons[12] = {"jan","feb","mar","apr","may","jun",
+			 "jul","aug","sep","oct","nov","dec"};
+
+/* Parse an absolute date/time value.  Format is:
+
+   12:00z 1jan 1989 (jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec)
+
+   Must have Z or Month abbrev, or value is invalid.  'def' contains
+   higher order missing values (usually from tmin in pst).  Lower order
+   values are defaulted to be: dy = 1, hr = 0, mn = 0.              */
+
+char *adtprs (char *ch, struct dt *def, struct dt *dtim) {
+gaint val,flag,i;
+char *pos;
+char monam[5];
+
+  pos = ch;
+
+  dtim->mn = 0;
+  dtim->hr = 0;
+  dtim->dy = 1;
+
+  if (*ch>='0' && *ch<='9') {
+  flag = 0;
+    ch = intprs (ch,&val);
+    if (*ch == ':' || tolower(*ch) == 'z') {
+      if (val>23) {
+        gaprnt (0,"Syntax Error:  Invalid Date/Time value.\n");
+        sprintf (pout,"  Hour = %i -- greater than 23\n",val);
+        gaprnt (0,pout);
+        return (NULL);
+      }
+      dtim->hr = val;
+      if (*ch == ':') {
+        ch++;
+        if (*ch>='0' && *ch<='9') {
+          ch = intprs (ch,&val);
+          if (val>59) {
+            gaprnt (0,"Syntax Error:  Invalid Date/Time value.\n");
+            sprintf (pout,"  Minute = %i -- greater than 59\n",val);
+            gaprnt (0,pout);
+            return (NULL);
+          }
+          if (tolower(*ch)!='z') {
+            gaprnt (0,"Syntax Error:  Invalid Date/Time value.\n");
+            gaprnt (0,"  'z' delimiter is missing \n");
+            return (NULL);
+          }
+          dtim->mn = val;
+          ch++;
+          if (*ch>='0' && *ch<='9') ch = intprs (ch,&val);
+          else val = def->dy;
+        } else {
+          gaprnt (0,"Syntax Error:  Invalid Date/Time value.\n");
+          gaprnt (0,"  Missing minute value \n");
+          return (NULL);
+        }
+      } else {
+        ch++;
+        if (*ch>='0' && *ch<='9') ch = intprs (ch,&val);
+        else val = def->dy;
+      }
+    } else flag = 2;
+    dtim->dy = val;
+  } else flag = 1;
+
+  monam[0] = tolower(*ch);
+  monam[1] = tolower(*(ch+1));
+  monam[2] = tolower(*(ch+2));
+  monam[3] = '\0';
+
+  i = 0;
+  while (i<12 && !cmpwrd(monam,mons[i]) ) i++;
+  i++;
+
+  if (i==13) {
+    if (flag==1) {
+      gaprnt (0,"Syntax Error:  Invalid Date/Time value.\n");
+      gaprnt (0,"  Expected month abbreviation, none found\n");
+      return (NULL);
+    }
+    if (flag==2) {
+      gaprnt (0,"Syntax Error:  Invalid Date/Time value.\n");
+      gaprnt (0,"  Missing month abbreviation or 'z' delimiter\n");
+      return (NULL);
+    }
+    dtim->mo = def->mo;
+    dtim->yr = def->yr;
+  } else {
+    dtim->mo = i;
+    ch+=3;
+    /* parse year */
+    if (*ch>='0' && *ch<='9') {
+      /* use fullyear only if year 1 = 0001*/
+      if(*(ch+2)>='0' && *(ch+2)<='9') {
+	/*mfcmn.*/fullyear=1;
+      } else {
+	/*mfcmn.*/fullyear=0;
+      }
+      ch = intprs (ch,&val);
+    } else {
+      val = def->yr;
+    }
+
+    /* turn off setting of < 100 years to 1900 or 2000 */
+    if(/*mfcmn.*/fullyear == 0) {
+      if (val<50) val+=2000;
+      else if (val<100) val+=1900;
+    }
+    dtim->yr = val;
+  }
+
+  i = mosiz[dtim->mo];
+  if (dtim->mo==2 && qleap(dtim->yr)) i = 29;
+  if (dtim->dy > i) {
+    gaprnt (0,"Syntax Error:  Invalid Date/Time value.\n");
+    sprintf (pout,"  Day = %i -- greater than %i \n",dtim->dy,i);
+    gaprnt (0,pout);
+    return (NULL);
+  }
+  return (ch);
+}
+
+/* Parse a relative date/time (offset).  Format is:
+
+   nn (yr/mo/dy/hr/mn)
+
+   Examples:  5mo
+              1dy12hr
+              etc.
+
+   Missing values are filled in with 0s.                             */
+
+char *rdtprs (char *ch, struct dt *dtim) {
+gaint flag,val;
+char *pos;
+char id[3];
+
+  pos = ch;
+
+  dtim->yr = 0;
+  dtim->mo = 0;
+  dtim->dy = 0;
+  dtim->hr = 0;
+  dtim->mn = 0;
+
+  flag = 1;
+
+  while (*ch>='0' && *ch<='9') {
+    flag = 0;
+    ch = intprs(ch,&val);
+    id[0] = *ch; id[1] = *(ch+1); id[2] = '\0';
+    if (cmpwrd("yr",id)) dtim->yr = val;
+    else if (cmpwrd("mo",id)) dtim->mo = val;
+    else if (cmpwrd("dy",id)) dtim->dy = val;
+    else if (cmpwrd("hr",id)) dtim->hr = val;
+    else if (cmpwrd("mn",id)) dtim->mn = val;
+    else {
+      gaprnt (0,"Syntax Error:  Invalid Date/Time offset.\n");
+      sprintf (pout,"  Expecting yr/mo/dy/hr/mn, found %s\n",id);
+      gaprnt (0,pout);
+      return (NULL);
+    }
+    ch+=2;
+  }
+  if (flag) {
+    gaprnt (0,"Syntax Error:  Invalid Date/Time offset.\n");
+    gaprnt (0,"  No offset value given\n");
+    return (NULL);
+  }
+  return (ch);
+}
+
+/* Compares two strings.  A match occurs if the leading
+   blank-delimited words in the two strings match.  CR and NULL also
+   serve as delimiters.                                               */
+
+gaint cmpwrd (char *ch1, char *ch2) {
+
+  while (*ch1==' '||*ch1=='\t') ch1++;  /* Advance past leading blanks.     */
+  while (*ch2==' '||*ch2=='\t') ch2++;
+
+  while (*ch1 == *ch2) {
+    if (*ch1==' '||*ch1=='\t'||*ch1=='\0'||*ch1=='\n'||*ch1=='\r' ) return (1);
+    ch1++; ch2++;
+  }
+
+  if ( (*ch1==' '||*ch1=='\t'||*ch1=='\0'||*ch1=='\n'||*ch1=='\r') &&
+       (*ch2==' '||*ch2=='\t'||*ch2=='\0'||*ch2=='\n'||*ch2=='\r') ) return (1);
+  return (0);
+}
+
+
+/* Parses a number in a character string.
+   This routine will detect numbers of the form:
+       nnnn
+       -nnnn
+
+   Args:    ch     - pointer to the number, in character form.
+            val    - integer value returned
+            return value  - address of 1st character past the
+                            number parsed.  NULL if no number found
+                            at pointer ch or if the number is an
+                            invalid format.
+             */
+
+char *intprs (char *ch, int *val) {
+
+int nflag,flag;
+
+  nflag = 0;
+  if (*ch=='-') { nflag = 1; ch++; }
+  else if (*ch=='+') ch++;
+
+  *val = 0;
+  flag = 1;
+
+  while (*ch>='0' && *ch<='9') {
+    *val = *val*10 + (int)(*ch-'0');
+    flag = 0;
+    ch++;
+  }
+
+  if (flag) return (NULL);
+
+  if (nflag) *val = -1 * *val;
+  return (ch);
+}
+
+char *longprs (char *ch, long *val) {
+
+int nflag,flag;
+
+  nflag = 0;
+  if (*ch=='-') { nflag = 1; ch++; }
+  else if (*ch=='+') ch++;
+
+  *val = 0;
+  flag = 1;
+
+  while (*ch>='0' && *ch<='9') {
+    *val = *val*10 + (int)(*ch-'0');
+    flag = 0;
+    ch++;
+  }
+
+  if (flag) return (NULL);
+
+  if (nflag) *val = -1 * *val;
+  return (ch);
+}
+
+/* Moves a pointer to the start of the next blank-delimited word
+   in a string.  If not found, NULL is returned.                     */
+
+char * nxtwrd (char *ch) {
+
+  while (*ch!=' '&&*ch!='\t') {                     /* Skip 1st word  */
+    if (*ch == '\0' || *ch == '\n' || *ch == '\r') return (NULL);
+    ch++;
+  }
+  while (*ch==' '||*ch=='\t') ch++;                 /* Find next word */
+  if (*ch == '\0' || *ch == '\n' || *ch == '\r') return (NULL);
+  return (ch);
+}
+
+/* Copies a string of a specified length, or when \0 or \n is hit.
+   Trailing blanks are removed, and the output string is terminated
+   with '\0'.                                                         */
+
+void getstr (char *ch1, char *ch2, int len) {
+char *ch;
+
+  ch = ch1;
+  while (len>0 && *ch2!='\n' && *ch2!='\0') {
+    *ch1 = *ch2;
+    len--;
+    ch1++;  ch2++;
+  }
+  ch1--;
+  while (ch1>=ch && *ch1==' ') ch1--;
+  ch1++;
+  *ch1 = '\0';
+}
+
+/* Copies a word of a specified length, or when \0 or \n or \r or ' ' is
+   encountered.  The word is terminated with '\0'. ch2 is src, ch1 is dest */
+
+void getwrd (char *ch1, char *ch2, int len) {
+char *ch;
+
+  ch = ch1;
+  while (len>0 && *ch2!='\n' && *ch2!='\0' && *ch2!='\r' && *ch2!=' ' ) {
+    *ch1 = *ch2;
+    len--;
+    ch1++;  ch2++;
+  }
+  *ch1 = '\0';
+}
+
+
+/* Determines word length up to next delimiter */
+
+gaint wrdlen (char *ch2) {
+gaint len;
+  len = 0;
+  while (*ch2!='\n' && *ch2!='\0' && *ch2!=' ' && *ch2!='\t') {
+    len++;
+    ch2++;
+  }
+  return(len);
+}
+
+/* Converts strings to double */
+char * getdbl(char *ch, double *val) {
+  char * pos;
+  double res;
+
+  res = strtod(ch, &pos);
+  if (pos==ch) {
+    return NULL;
+  } else {
+    *val = res;
+    return pos;
+  }
+}
+
+/* Converts strings to double */
+char * getflt(char *ch, float *val) {
+char * pos;
+  *val = (float)strtod(ch, &pos);
+  if (pos==ch) {
+    return NULL;
+  } else {
+    return pos;
+  }
+}
+
+/* Expand file names prefixed with '^' from data descriptor
+   files */
+
+void fnmexp (char *out, char *in1, char *in2) {
+char *pos, *ch, envv[20], *envr, CR=13;
+int i,j;
+
+  if (*in1=='$') {
+    in1++;
+    i = 0;
+    while (*in1!='/' && *in1!='\0' && i<16) {
+      envv[i] = *in1;
+      i++; in1++;
+    }
+    envv[i] = '\0';
+    envr = getenv(envv);
+    if (envr) {
+      i = 0; j = 0;
+      while (*(envr+j)) {
+        *(out+i) = *(envr+j);
+        i++; j++;
+      }
+      /* handle CR for descriptor files created under MS Windows */
+      while (*in1!='\0' && *in1!=' ' && *in1!='\n' && *in1!=CR) {
+        *(out+i) = *in1;
+        i++; in1++;
+      }
+      *(out+i) = '\0';
+    }
+    return;
+  }
+  ch = in2;
+  pos=NULL;
+  while (*ch!='\0' && *ch!=' ' && *ch!='\n') {
+    if (*ch=='/') pos=ch;
+    ch++;
+  }
+  if (pos) pos++;
+  while (pos!=NULL && in2<pos) {
+    *out = *in2;
+    out++; in2++;
+  }
+  in1++;
+  while (*in1!='\0' && *in1!=' ' && *in1!='\n' && *in1!=CR) {
+    *out = *in1;
+    out++; in1++;
+  }
+  *out = '\0';
+}
+
+
+/* Linear conversion routine for dimension conversions.               */
+
+gadouble liconv (gadouble *vals, gadouble v) {
+  return ( (*vals * v) + *(vals+1) );
+}
+
+/* Non-linear scaling routine for discrete levels.  Linear interp
+   between levels.  Scaling beyond upper and lower bounds is
+   linear based on the last and first grid spacing, respectively.
+   In each case a pointer to a list of values is provided.  The
+   list contains in its first element the number of values
+   in the list.    */
+
+/* Convert a grid value to a world coordinate value.
+   This operation needs to be efficient, since it gets done
+   very often.  */
+
+gadouble gr2lev (gadouble *vals, gadouble gr) {
+gaint i;
+  if (gr<1.0) return ( *(vals+1) + (1.0-gr)*(*(vals+1)-*(vals+2)) );
+  if (gr>*vals) {
+    i = (gaint)(*vals+0.1);
+    return ( *(vals+i) + (gr-*vals)*(*(vals+i)-*(vals+i-1)) );
+  }
+  i = (gaint)gr;
+  return (*(vals+i)+((gr-(gadouble)i)*(*(vals+i+1)-*(vals+i))));
+}
+
+/* Convert from world coordinate value to grid value.  This operation
+   is not set up to be efficient, under the assumption that it won't
+   get done all that often.  */
+
+gadouble lev2gr (gadouble *vals, gadouble lev) {
+gaint i,num;
+gadouble gr;
+  num = (gaint)(*vals+0.1);
+  for (i=1; i<num; i++) {
+    if ( (lev >= *(vals+i) && lev <= *(vals+i+1)) ||
+         (lev <= *(vals+i) && lev >= *(vals+i+1)) ) {
+      gr = (gadouble)i + (lev - *(vals+i))/(*(vals+i+1) - *(vals+i));
+      return (gr);
+    }
+  }
+  if (*(vals+1)<*(vals+num)) {
+    if (lev<*(vals+1)) {
+      gr = 1.0 + ((lev-*(vals+1))/(*(vals+2)-*(vals+1)));
+      return (gr);
+    }
+    gr = (gadouble)i + ((lev-*(vals+i))/(*(vals+i)-*(vals+i-1)));
+    return (gr);
+  } else {
+    if (lev>*(vals+1)) {
+      gr = 1.0 + ((lev-*(vals+1))/(*(vals+2)-*(vals+1)));
+      return (gr);
+    }
+    gr = (gadouble)i + ((lev-*(vals+i))/(*(vals+i)-*(vals+i-1)));
+    return (gr);
+  }
+}
+
+/* Process linear scaling args */
+
+gaint deflin (char *ch, dsets_t *pfi, gaint dim, gaint flag) {
+gadouble *vals,v1,v2;
+
+  vals = (gadouble *)galloc(sizeof(gadouble)*6,"vals1");
+  if (vals==NULL) return (-1);
+
+  if ((ch = nxtwrd(ch))==NULL) goto err1;
+  if (getdbl(ch,&v1)==NULL) goto err1;
+  if (flag) v2 = 1.0;
+  else {
+    if ((ch = nxtwrd(ch))==NULL) goto err2;
+    if (getdbl(ch,&v2)==NULL) goto err2;
+  }
+  if (dim!=3 && v2<=0.0) goto err2;
+  *(vals)   = v2;
+  *(vals+1) = v1 - v2;
+  *(vals+2) = -999.9;
+  pfi->grvals[dim] = vals;
+  *(vals+4) = -1.0 * ( (v1-v2)/v2 );
+  *(vals+3) = 1.0/v2;
+  *(vals+5) = -999.9;
+  pfi->abvals[dim] = vals+3;
+  pfi->ab2gr[dim] = liconv;
+  pfi->gr2ab[dim] = liconv;
+  pfi->linear[dim] = 1;
+  return (0);
+
+err1:
+  gaprnt (0,"Open Error:  Missing or invalid dimension");
+  gaprnt (0," starting value\n");
+  gree(vals,"f178");
+  return (1);
+
+err2:
+  gaprnt (0,"Open Error:  Missing or invalid dimension");
+  gaprnt (0," increment value\n");
+  gree(vals,"179");
+  return (1);
+}
+
+/* Process levels values in def record */
+/* Return codes:  -1 is memory allocation error, 1 is other error */
+
+gaint deflev (char *ch, char *rec, dsets_t *pfi, gaint dim) {
+gadouble *vvs,*vals,v1;
+gaint i;
+
+  if (pfi->dnum[dim]==1) {
+    i = deflin (ch, pfi, dim, 1);
+    return (i);
+  }
+
+  vals = (gadouble *)galloc((pfi->dnum[dim]+5)*sizeof(gadouble),"vals2");
+  if (vals==NULL) return (-1);
+
+  vvs = vals;
+  *vvs = (gadouble)pfi->dnum[dim];
+  vvs++;
+  for (i=0; i<pfi->dnum[dim]; i++) {
+    if ( (ch = nxtwrd(ch))==NULL) {
+      if (fgets(rec,256,descr)==NULL) goto err2;
+      ch = rec;
+      while (*ch==' ' || *ch=='\t') ch++;
+      if (*ch=='\0' || *ch=='\n') goto err3;
+    }
+    if (getdbl(ch,&v1)==NULL) goto err1;
+    *vvs = v1;
+    vvs++;
+  }
+  *vvs = -999.9;
+  pfi->abvals[dim] = vals;
+  pfi->grvals[dim] = vals;
+  pfi->ab2gr[dim] = lev2gr;
+  pfi->gr2ab[dim] = gr2lev;
+  pfi->linear[dim] = 0;
+  return (0);
+
+err1:
+  gaprnt (0,"Open Error:  Invalid value in LEVELS data\n");
+  gree(vals,"f180");
+  return (1);
+
+err2:
+  gaprnt (0,"Open Error:  Unexpected EOF reading descriptor file\n");
+  gaprnt (0,"   EOF occurred reading LEVELS values\n");
+  gree(vals,"f181");
+  return (1);
+
+err3:
+  gaprnt (0,"Open Error:  Blank Record found in LEVELS data\n");
+  gree(vals,"f182");
+  return (1);
+}
+
+
+/*  handle var name of the form longnm=>abbrv
+    or just the abbrv with no long name */
+
+gaint getvnm (struct gavar *pvar, char *mrec) {
+gaint ib,i,j,k,len,flag;
+
+  ib = 0;
+  while (*(mrec+ib)==' ') ib++;
+
+  if (*(mrec+ib)=='\0' || *(mrec+ib)=='\n') return(1);
+
+  /* Scan for the '=>' string */
+  len = 0;
+  i = ib;
+  flag = 0;
+
+  while (1) {
+    if (*(mrec+i)==' ' || *(mrec+i)=='\0' || *(mrec+i)=='\n') break;
+    if (*(mrec+i)=='=' && *(mrec+i+1)=='>') {
+      flag = 1;
+      break;
+    }
+    len++ ; i++; 
+  }
+
+  if (flag) {
+    for (j=ib; j<i; j++) {
+      k = j-ib;
+      pvar->longnm[k] = *(mrec+j); 
+      /* substitute ~ for spaces in longname */
+      if (pvar->longnm[k]=='~') pvar->longnm[k]=' '; 
+    }
+    pvar->longnm[len] = '\0';
+    i+=2;
+  } else {
+    i = 0;
+    pvar->longnm[0] = '\0';
+  } 
+
+  if (*(mrec+i)=='\n' || *(mrec+i)=='\0') return (1);
+
+  getwrd (pvar->abbrv, mrec+i, 15);
+  lowcas(pvar->abbrv);
+
+  /* Check if 1st character is lower-case alphabetic */
+  if (islower(*(pvar->abbrv))) return(0);
+  else return (1);
+}
+
+
+/* Given a file name template and a dt structure, fill in to get the file name */
+
+char *gafndt (char *fn, struct dt *dtim, struct dt *dtimi, gadouble *vals, 
+	      struct gachsub *pch1st, struct gaens *ens1st, gaint t, gaint e, gaint *flag) {
+struct gachsub *pchsub;
+struct gaens *ens;
+struct dt stim;
+gaint len,olen,iv,tdif,i,tused,eused;
+char *fnout, *in, *out, *work, *in2, *out2;
+
+  tused = eused = 0;
+  olen = 0;
+  while (*(fn+olen)) olen++;
+  olen+=5;
+  fnout = (char *)galloc(olen,"fnout");
+  if (fnout==NULL) return (NULL);
+
+  in = fn;
+  out = fnout;
+
+  while (*in) {
+    pchsub = pch1st;
+    ens = ens1st;
+    /* handle template strings for initial time */
+    if (*in=='%' && *(in+1)=='i') {
+      tused=1;
+      if (*(in+2)=='x' && *(in+3)=='1') { 
+        sprintf (out,"%i",dtimi->yr/10);
+        while (*out) out++;
+        in+=4;
+      } else if (*(in+2)=='x' && *(in+3)=='3') {
+        sprintf (out,"%03i",dtimi->yr/10);
+        out+=3; in+=4;
+      } else if (*(in+2)=='y' && *(in+3)=='2') {
+        iv = dtimi->yr/100;
+        iv = dtimi->yr - iv*100;
+        sprintf (out,"%02i",iv);
+        out+=2;  in+=4;
+      } else if (*(in+2)=='y' && *(in+3)=='4') {
+        sprintf (out,"%04i",dtimi->yr);
+        out+=4;  in+=4;
+      } else if (*(in+2)=='m' && *(in+3)=='1') {
+          sprintf (out,"%i",dtimi->mo);
+        while (*out) out++;
+        in+=4;
+      } else if (*(in+2)=='m' && *(in+3)=='2') {
+        sprintf (out,"%02i",dtimi->mo);
+        out+=2;  in+=4;
+      } else if (*(in+2)=='m' && *(in+3)=='h') {
+        if (dtimi->dy < 16) *out='a';
+        else *out = 'b';
+        out+=1;  in+=4;
+      } else if (*(in+2)=='m' && *(in+3)=='H') {
+        if (dtimi->dy < 16) *out='A';
+        else *out = 'B';
+        out+=1;  in+=4;
+      } else if (*(in+2)=='m' && *(in+3)=='c') {
+        *out = *(mons[dtimi->mo-1]);
+        *(out+1) = *(mons[dtimi->mo-1]+1);
+        *(out+2) = *(mons[dtimi->mo-1]+2);
+        out+=3;  in+=4;
+      } else if (*(in+2)=='d' && *(in+3)=='1') {
+        sprintf (out,"%i",dtimi->dy);
+        while (*out) out++;
+        in+=4;
+      } else if (*(in+2)=='d' && *(in+3)=='2') {
+        sprintf (out,"%02i",dtimi->dy);
+        out+=2;  in+=4;
+      } else if (*(in+2)=='h' && *(in+3)=='1') {
+        sprintf (out,"%i",dtimi->hr);
+        while (*out) out++;
+        in+=4;
+      } else if (*(in+2)=='h' && *(in+3)=='2') {
+        sprintf (out,"%02i",dtimi->hr);
+        out+=2;  in+=4;
+      } else if (*(in+2)=='h' && *(in+3)=='3') {
+        sprintf (out,"%03i",dtimi->hr);
+        out+=3;  in+=4;
+      } else if (*(in+2)=='n' && *(in+3)=='2') {
+        sprintf (out,"%02i",dtimi->mn);
+        out+=2;  in+=4;
+      } else {
+        *out = *in;
+        in++; out++;
+      }
+    } 
+    /* handle template strings for any time */
+    else if (*in=='%' && *(in+1)=='x' && *(in+2)=='1') { /* x: decades */
+      tused=1;
+      sprintf (out,"%i",dtim->yr/10);
+      while (*out) out++;
+      in+=3;
+    } else if (*in=='%' && *(in+1)=='x' && *(in+2)=='3') { 
+      tused=1;
+      sprintf (out,"%03i",dtim->yr/10);
+      out+=3; in+=3;
+    } else if (*in=='%' && *(in+1)=='y' && *(in+2)=='2') {
+      tused=1;
+      iv = dtim->yr/100;
+      iv = dtim->yr - iv*100;
+      sprintf (out,"%02i",iv);
+      out+=2;  in+=3;
+    } else if (*in=='%' && *(in+1)=='y' && *(in+2)=='4') {
+      tused=1;
+      sprintf (out,"%04i",dtim->yr);
+      out+=4;  in+=3;
+    } else if (*in=='%' && *(in+1)=='m' && *(in+2)=='1') {
+      tused=1;
+      sprintf (out,"%i",dtim->mo);
+      while (*out) out++;
+      in+=3;
+    } else if (*in=='%' && *(in+1)=='m' && *(in+2)=='2') {
+      tused=1;
+      sprintf (out,"%02i",dtim->mo);
+      out+=2;  in+=3;
+    } else if (*in=='%' && *(in+1)=='m' && *(in+2)=='h') {
+      tused=1;
+      if (dtim->dy < 16) *out='a';
+      else *out = 'b';
+      out+=1;  in+=3;
+    } else if (*in=='%' && *(in+1)=='m' && *(in+2)=='H') {
+      tused=1;
+      if (dtim->dy < 16) *out='A';
+      else *out = 'B';
+      out+=1;  in+=3;
+    } else if (*in=='%' && *(in+1)=='m' && *(in+2)=='c') {
+      tused=1;
+      *out = *(mons[dtim->mo-1]);
+      *(out+1) = *(mons[dtim->mo-1]+1);
+      *(out+2) = *(mons[dtim->mo-1]+2);
+      out+=3;  in+=3;
+    } else if (*in=='%' && *(in+1)=='d' && *(in+2)=='1') {
+      tused=1;
+      sprintf (out,"%i",dtim->dy);
+      while (*out) out++;
+      in+=3;
+    } else if (*in=='%' && *(in+1)=='d' && *(in+2)=='2') {
+      tused=1;
+      sprintf (out,"%02i",dtim->dy);
+      out+=2;  in+=3;
+    } else if (*in=='%' && *(in+1)=='h' && *(in+2)=='1') {
+      tused=1;
+      sprintf (out,"%i",dtim->hr);
+      while (*out) out++;
+      in+=3;
+    } else if (*in=='%' && *(in+1)=='h' && *(in+2)=='2') {
+      tused=1;
+      sprintf (out,"%02i",dtim->hr);
+      out+=2;  in+=3;
+    } else if (*in=='%' && *(in+1)=='h' && *(in+2)=='3') {
+      tused=1;
+      sprintf (out,"%03i",dtim->hr);
+      out+=3;  in+=3;
+    } else if (*in=='%' && *(in+1)=='n' && *(in+2)=='2') {
+      tused=1;
+      sprintf (out,"%02i",dtim->mn);
+      out+=2;  in+=3;
+    } 
+    /* forecast times */
+    else if (*in=='%' && *(in+1)=='f' && *(in+2)=='2') {
+      tused=1;
+      stim.yr = (gaint)(*vals+0.1);
+      stim.mo = (gaint)(*(vals+1)+0.1);
+      stim.dy = (gaint)(*(vals+2)+0.1);
+      stim.hr = (gaint)(*(vals+3)+0.1);
+      stim.mn = (gaint)(*(vals+4)+0.1);
+      tdif = timdif(dtimi,dtim);
+      tdif = (tdif+30)/60;
+      if (tdif<99) sprintf (out,"%02i",tdif);
+      else sprintf (out,"%i",tdif);
+      while (*out) out++;
+      in+=3;
+    } else if (*in=='%' && *(in+1)=='f' && *(in+2)=='3') {
+      tused=1;
+      stim.yr = (gaint)(*vals+0.1);
+      stim.mo = (gaint)(*(vals+1)+0.1);
+      stim.dy = (gaint)(*(vals+2)+0.1);
+      stim.hr = (gaint)(*(vals+3)+0.1);
+      stim.mn = (gaint)(*(vals+4)+0.1);
+      tdif = timdif(dtimi,dtim); 
+      tdif = (tdif+30)/60;
+      if (tdif<999) sprintf (out,"%03i",tdif);
+      else sprintf (out,"%i",tdif);
+      while (*out) out++;
+      in+=3;
+    } 
+    /* string substitution */
+    else if (*in=='%' && *(in+1)=='c' && *(in+2)=='h') {
+      tused=1;
+      while (pchsub) {
+        if (t>=pchsub->t1 && (pchsub->t2 == -99 || t<=pchsub->t2) ) {
+          len = wrdlen(pchsub->ch);    /* Reallocate output string */
+          olen += len;
+          work = (char *)galloc(olen,"work");
+          if (work==NULL) {
+            gree(fnout,"f240");
+            return (NULL);
+          }
+          in2 = fnout; 
+	  out2 = work;
+          while (in2!=out) {
+            *out2 = *in2;
+            in2++; out2++;
+          }
+          gree(fnout,"f241");     
+          fnout = work;
+          out = out2;
+          getwrd(out,pchsub->ch,len);
+          out += len;
+          break;
+        }
+        pchsub = pchsub->forw;
+      }
+      in+=3;
+    } 
+    /* ensemble name substitution */
+    else if  (*in=='%' && *(in+1)=='e') {
+      eused=1;
+      if (ens == NULL) {
+	gree(fnout,"f242");
+	return (NULL);
+      } else {
+	/* advance through array of ensemble structures, till we reach ensemble 'e' */
+	i=1;
+	while (i!=e) { i++; ens++; }
+	len = strlen(ens->name);
+	if (len < 1) {
+	  gree(fnout,"f243");
+	  return (NULL);
+	}
+	olen += len;
+	work = (char *)galloc(olen,"work2");     /* Reallocate output string */
+	if (work==NULL) {
+	  gree(fnout,"f244");
+	  return (NULL);
+	}
+	in2 = fnout;            /* copy the string we've got so far */
+	out2 = work;
+	while (in2!=out) {
+	  *out2 = *in2;
+	  in2++; out2++;
+	}
+	gree(fnout,"f245");
+	fnout = work;
+	out = out2;
+	getwrd(out,ens->name,len);
+	out += len;
+      }
+      in+=2;
+    }
+    else {
+      *out = *in;
+      in++; out++;
+    }
+  }
+  *out = '\0';
+  if (eused==1 && tused==1) {
+    *flag = 3;                       /* templating on E and T */
+  } 
+  else if (eused==1 && tused==0) {
+    *flag = 2;                       /* templating only on E */
+  }
+  else if (eused==0 && tused==1) { 
+    *flag = 1;                       /* templating only on T */
+  }
+  else {
+    *flag = 0;                       /* no templating */
+  }
+  return (fnout);
+}
+
+#undef  IsBigendian
+#define IsBigendian()  ( u_byteorder.c[sizeof(long) - 1] )
+
+int read_gradsdes(char *filename, dsets_t *pfi)
+{
+  /* IsBigendian returns 1 for big endian byte order */
+  static union {unsigned long l; unsigned char c[sizeof(long)];} u_byteorder = {1};
+  struct gavar *pvar;
+  struct gaens *ens;
+  struct dt tdef,tdefe,tdefi,dt1,dt2;
+  struct gachsub *pchsub;
+  int status = 0;
+  int reclen;
+  int ichar;
+  char rec[MAX_RECLEN], mrec[MAX_RECLEN];
+  char *ch, *pos;
+  int i, j, ii, jj;
+  off_t levs,acum,acumvz,recacm;
+  gaint acumstride=0;
+  gaint hdrb, trlb;
+  gaint size=0,rc,len,flag,tim1,tim2;
+  gaint flgs[8],e,t;
+  int BYTEORDER = IsBigendian();
+  gadouble *vals;
+  gadouble v1,v2,temp;
+  int err = 0;
+ 
+  hdrb = 0;
+  trlb = 0;
+
+  /* Try to open descriptor file */
+  descr = fopen (filename, "r");
+  if ( descr == NULL )
+    {
+      fprintf(stderr, "fopen failed on %s", filename);
+      return (-1);
+    }
+
+  /* Copy descriptor file name into gafile structure */
+  getwrd (pfi->dnam,filename,MAX_NAMELEN);
+
+  /* initialize error flags */
+  for (i=0;i<8;i++) flgs[i] = 1;
+
+  /* Parse the data descriptor file */
+  while ( fgets(rec, MAX_RECLEN, descr) != NULL )
+    {
+
+      /* Remove any leading blanks from rec */
+      reclen = (int)strlen(rec);
+      jj = 0;
+      while ( jj<reclen && rec[0]==' ' ) 
+	{
+	  for (ii=0; ii<reclen; ii++) rec[ii] = rec[ii+1];
+	  jj++;
+	}
+      /* replace newline with null at end of record */
+      for (ichar = (int)strlen(rec) - 1 ;  ichar >= 0 ;  --ichar)
+	{
+	  if (rec[ichar] == '\n') {
+	    rec[ichar] = '\0' ;
+	    break ; 
+	  }
+	}
+      /* Keep mixed case and lower case versions of rec handy */
+      strcpy (mrec,rec);   
+      lowcas(rec);
+      
+      if (!isalnum(mrec[0]))
+	{
+	  /* check if comment contains attribute metadata */
+	  /*
+	  if ((strncmp("*:attr",mrec,6)==0) || (strncmp("@",mrec,1)==0))
+	    {
+	      if ((ddfattr(mrec,pfi)) == -1) goto retrn;
+	    }
+	  */
+	}
+      else if (cmpwrd("byteswapped",rec))
+	{
+	  pfi->bswap = 1;
+	}
+      else if (cmpwrd("fileheader",rec))
+	{
+	  if ( (ch=nxtwrd(rec))==NULL )
+	    {
+	      gaprnt (1,"Description file warning: Missing fileheader length\n");
+	    }
+	  else
+	    {
+	      ch = longprs(ch,&(pfi->fhdr));
+	      if (ch==NULL)
+		{
+		  gaprnt (1,"Fileheader record invalid\n");
+		  pfi->fhdr = 0;
+		}
+	    }
+	} 
+      else if (cmpwrd("xyheader",rec)) 
+	{
+	  if ( (ch=nxtwrd(rec))==NULL )
+	    {
+	      gaprnt (1,"Description file warning: Missing xy grid header length\n");
+	    } 
+	  else 
+	    {
+	      ch = longprs(ch,&(pfi->xyhdr));
+	      if (ch==NULL)
+		{
+		  gaprnt (1,"xy grid header length invalid\n");
+		  pfi->xyhdr = 0;
+		}
+	      else
+		{
+		  pfi->xyhdr = pfi->xyhdr/4;
+		}
+	    }
+	} 
+      else if (cmpwrd("format",rec) || cmpwrd("options",rec))
+	{
+	  if ( (ch=nxtwrd(rec))==NULL )
+	    {
+	      gaprnt (1,"Description file warning: Missing options keyword\n");
+	    }
+	  else
+	    {
+	      while (ch!=NULL)
+		{
+		  if (cmpwrd("sequential",ch)) pfi->seqflg = 1;
+		  else if (cmpwrd("yrev",ch)) pfi->yrflg = 1;
+		  else if (cmpwrd("zrev",ch)) pfi->zrflg = 1;
+		  else if (cmpwrd("template",ch)) pfi->tmplat = 1;
+		  else if (cmpwrd("flt64",ch)) pfi->flt64 = 1;
+		  else if (cmpwrd("byteswapped",ch)) pfi->bswap = 1;
+#if GRIB2
+		  else if (cmpwrd("pascals",ch)) pfi->pa2mb = 1;
+#endif
+		  else if (cmpwrd("365_day_calendar",ch))
+		    {
+		      pfi->calendar=1;
+		    }
+		  else if (cmpwrd("big_endian",ch))
+		    {
+		      if (!BYTEORDER) pfi->bswap = 1;
+		    }
+		  else if (cmpwrd("little_endian",ch))
+		    {
+		      if (BYTEORDER) pfi->bswap = 1;
+		    }
+		  else {
+		    gaprnt (0,"Open Error:  Data file type invalid\n");
+		    goto err9;
+		  }
+		  ch = nxtwrd(ch);
+		}
+	    }
+	}
+      else if (cmpwrd("trailerbytes",rec))
+	{
+	  if ( (ch=nxtwrd(rec))==NULL )
+	    {
+	      gaprnt (1,"Trailerbytes record invalid\n");
+	    }
+	  else 
+	    {
+	      ch = intprs(ch,&trlb);
+	      if (ch==NULL)
+		{
+		  gaprnt (1,"Trailerbytes record invalid\n");
+		  trlb = 0;
+		}
+	      else 
+		{
+		  trlb = trlb/4;
+		}
+	    }
+	}
+      else if (cmpwrd("headerbytes",rec)|| cmpwrd("theader",rec))
+	{
+	  if ( (ch=nxtwrd(rec))==NULL )
+	    {
+	      gaprnt (1,"headerbytes/theader record invalid\n");
+	    }
+	  else 
+	    {
+	      ch = intprs(ch,&hdrb);
+	      if (ch==NULL)
+		{
+		  gaprnt (1,"headerbytes/theader record invalid\n");
+		  hdrb = 0;
+		}
+	      else
+		{
+		  hdrb = hdrb/4;
+		}
+	    }
+	}
+      /* Handle the chsub records.  time1, time2, then a string,  multiple times */
+      else if (cmpwrd("chsub",rec))
+	{
+	  /* point to first block in chain */
+	  pchsub = pfi->pchsub1;    
+	  if (pchsub!=NULL)
+	    {
+	      while (pchsub->forw!=NULL) {
+		pchsub = pchsub->forw;       /* advance to end of chain */
+	      }
+	    }
+	  flag = 0;
+	  ch = mrec;
+	  while (1) 
+	    {
+	      if ( (ch=nxtwrd(ch)) == NULL ) break;
+	      flag = 1;
+	      if ( (ch = intprs(ch,&tim1)) == NULL) break;
+	      if ( (ch=nxtwrd(ch)) == NULL ) break;
+	      if (*ch=='*' && (*(ch+1)==' '||*(ch+1)=='\t')) tim2 = -99;
+	      else if ( (ch = intprs(ch,&tim2)) == NULL) break;
+	      if ( (ch=nxtwrd(ch)) == NULL ) break;
+	      flag = 0;
+	      if (pchsub) 
+		{   /* chain exists */
+		  pchsub->forw = (struct gachsub *)galloc(sizeof(struct gachsub),"chsubnew");
+		  if (pchsub->forw==NULL) {
+		    gaprnt(0,"Open Error: memory allocation failed for pchsub\n");
+		    goto err8; 
+		  }
+		  pchsub = pchsub->forw;
+		  pchsub->forw = NULL;
+		} 
+	      else 
+		{        /* start a new chain */
+		  pfi->pchsub1 = (struct gachsub *)galloc(sizeof(struct gachsub),"chsub1");
+		  if (pfi->pchsub1==NULL)  {
+		    gaprnt(0,"Open Error: memory allocation failed for pchsub1\n");
+		    goto err8; 
+		  }
+		  pchsub = pfi->pchsub1;
+		  pchsub->forw = NULL;
+		}
+	      len = wrdlen(ch);
+	      if ((pchsub->ch = (char *)galloc(len+1,"chsubstr")) == NULL) goto err8;
+	      getwrd(pchsub->ch,ch,len);
+	      pchsub->t1 = tim1;
+	      pchsub->t2 = tim2;
+	    }
+	  if (flag) 
+	    {
+	      gaprnt (1,"Description file warning: Invalid chsub record; Ignored\n");
+	    }
+	}
+      else if (cmpwrd("title",rec))
+	{
+	  if ( (ch=nxtwrd(mrec))==NULL )
+	    {
+	      gaprnt (1,"Description file warning: Missing title string\n");
+	    } 
+	  else
+	    {
+	      getstr (pfi->title,ch,MAX_NAMELEN);
+	      flgs[7] = 0;
+	    }
+	} 
+      else if (cmpwrd("dset",rec))
+	{
+	  ch = nxtwrd(mrec);
+	  if (ch==NULL) 
+	    {
+	      gaprnt (0,"Descriptor File Error:  Data file name is missing\n");
+	      goto err9;
+	    }
+	  if (*ch=='^' || *ch=='$')
+	    {
+	      fnmexp (pfi->name,ch,filename);
+	    } 
+	  else 
+	    {
+	      getwrd (pfi->name,ch,MAX_NAMELEN);
+	    }
+	  flgs[5] = 0;
+	}   
+      else if (cmpwrd("undef",rec))
+	{
+	  ch = nxtwrd(mrec);
+	  if (ch==NULL)
+	    {
+	      gaprnt (0,"Open Error:  Missing undef value\n");
+	      goto err9;
+	    }
+      
+	  pos = getdbl(ch,&(pfi->undef));
+	  if (pos==NULL)
+	    {
+	      gaprnt (0,"Open Error:  Invalid undef value\n");
+	      goto err9;
+	    } 
+
+	  pfi->ulow = fabs(pfi->undef/EPSILON);
+	  pfi->uhi  = pfi->undef + pfi->ulow;
+	  pfi->ulow = pfi->undef - pfi->ulow;
+	  flgs[4] = 0;
+	}
+      else if (cmpwrd("xdef",rec))
+	{
+	  if (pfi->type == 2) continue;
+	  if ( (ch = nxtwrd(rec)) == NULL) goto err1;
+	  if ( (pos = intprs(ch,&(pfi->dnum[0])))==NULL) goto err1;
+	  if (pfi->dnum[0]<1) 
+	    {
+	      sprintf(pout,"Warning: Invalid XDEF syntax in %s -- Changing size of X axis from %d to 1 \n",
+		      pfi->dnam,pfi->dnum[0]);
+	      gaprnt (1,pout);
+	      pfi->dnum[0] = 1;
+	    }
+	  if (*pos!=' ') goto err1;
+	  if ( (ch = nxtwrd(ch))==NULL) goto err2;
+	  if (cmpwrd("linear",ch)) 
+	    {
+	      rc = deflin(ch, pfi, 0, 0);
+	      if (rc==-1) goto err8; 
+	      if (rc) goto err9;
+	      v2 = *(pfi->grvals[0]);
+	      v1 = *(pfi->grvals[0]+1) + v2;
+	      temp = v1+((gadouble)(pfi->dnum[0]))*v2;
+	      temp=temp-360.0;
+	      if (fabs(temp-v1)<0.01) pfi->wrap = 1;
+	    }
+	  else if (cmpwrd("levels",ch))
+	    {
+	      rc = deflev (ch, rec, pfi, 0);
+	      if (rc==-1)  goto err8; 
+	      if (rc) goto err9;
+	    } else goto err2;
+	  flgs[0] = 0;
+	} 
+      else if (cmpwrd("ydef",rec))
+	{
+	  if (pfi->type == 2) continue;
+	  if ( (ch = nxtwrd(rec)) == NULL) goto err1;
+	  if ( (pos = intprs(ch,&(pfi->dnum[1])))==NULL) goto err1;
+	  if (pfi->dnum[1]<1)
+	    {
+	      sprintf(pout,"Warning: Invalid YDEF syntax in %s -- Changing size of Y axis from %d to 1 \n",
+		      pfi->dnam,pfi->dnum[1]);
+	      gaprnt (1,pout);
+	      pfi->dnum[1] = 1;
+	    }
+	  if (*pos!=' ') goto err1;
+	  if ( (ch = nxtwrd(ch))==NULL) goto err2;
+	  if (cmpwrd("linear",ch))
+	    {
+	      rc = deflin(ch, pfi, 1, 0);
+	      if (rc==-1) goto err8; 
+	      if (rc) goto err9;
+	    }
+	  else if (cmpwrd("levels",ch))
+	    {
+	      rc = deflev (ch, rec, pfi, 1);
+	      if (rc==-1) goto err8;
+	      if (rc) goto err9;
+	    }
+	  flgs[1] = 0;
+	}
+      else if (cmpwrd("zdef",rec))
+	{
+	  if (pfi->type == 2) continue;
+	  if ( (ch = nxtwrd(rec)) == NULL) goto err1;
+	  if ( (pos = intprs(ch,&(pfi->dnum[2])))==NULL) goto err1;
+	  if (pfi->dnum[2]<1)
+	    {
+	      sprintf(pout,"Warning: Invalid ZDEF syntax in %s -- Changing size of Z axis from %d to 1 \n",
+		      pfi->dnam,pfi->dnum[2]);
+	      gaprnt (1,pout);
+	      pfi->dnum[2] = 1;
+	    }
+	  if (*pos!=' ') goto err1;
+	  if ( (ch = nxtwrd(ch))==NULL) goto err2;
+	  if (cmpwrd("linear",ch))
+	    {
+	      rc = deflin(ch, pfi, 2, 0);
+	      if (rc==-1) goto err8; 
+	      if (rc) goto err9;
+	    }
+	  else if (cmpwrd("levels",ch))
+	    {
+	      rc = deflev (ch, rec, pfi, 2);
+	      if (rc==-1) goto err8; 
+	      if (rc) goto err9;
+	    } else goto err2;
+	  flgs[2] = 0;
+	}
+      else if (cmpwrd("tdef",rec))
+	{
+	  if ( (ch = nxtwrd(rec)) == NULL) goto err1;
+	  if ( (pos = intprs(ch,&(pfi->dnum[3])))==NULL) goto err1;
+	  if (pfi->dnum[3]<1)
+	    {
+	      sprintf(pout,"Warning: Invalid TDEF syntax in %s -- Changing size of T axis from %d to 1 \n",
+		      pfi->dnam,pfi->dnum[3]);
+	      gaprnt (1,pout);
+	      pfi->dnum[3] = 1;
+	    }
+	  if (*pos!=' ') goto err1;
+	  if ( (ch = nxtwrd(ch))==NULL) goto err2;
+	  if (cmpwrd("linear",ch))
+	    {
+	      if ( (ch = nxtwrd(ch))==NULL) goto err3a_tdef;
+	      tdef.yr = -1000;
+	      tdef.mo = -1000;
+	      tdef.dy = -1000;
+	      if ( (pos = adtprs(ch,&tdef,&dt1))==NULL) goto err3b_tdef;
+	      if (*pos!=' ' || dt1.yr == -1000 || dt1.mo == -1000.0 ||
+		  dt1.dy == -1000) goto err3c_tdef;
+	      if ( (ch = nxtwrd(ch))==NULL) goto err4a_tdef;
+	      if ( (pos = rdtprs(ch,&dt2))==NULL) goto err4b_tdef;
+	      v1 = (dt2.yr * 12) + dt2.mo;
+	      v2 = (dt2.dy * 1440) + (dt2.hr * 60) + dt2.mn;
+	      /* check if 0 dt */
+	      if ( (v1 == 0) && (v2 == 0) ) goto err4c_tdef;  
+	      if ((vals = (gadouble *)galloc(sizeof(gadouble)*8,"tvals5")) == NULL) goto err8; 
+	      *(vals) = dt1.yr;
+	      *(vals+1) = dt1.mo;
+	      *(vals+2) = dt1.dy;
+	      *(vals+3) = dt1.hr;
+	      *(vals+4) = dt1.mn;
+	      *(vals+5) = v1;
+	      *(vals+6) = v2;
+	      *(vals+7) = -999.9;
+	      pfi->grvals[3] = vals;
+	      pfi->abvals[3] = vals;
+	      pfi->linear[3] = 1;
+	    } else goto err2;
+	  flgs[3] = 0;
+	}
+      else if (cmpwrd("vars",rec))
+	{
+	  if ( (ch = nxtwrd(rec)) == NULL) goto err5;
+	  if ( (pos = intprs(ch,&(pfi->vnum)))==NULL) goto err5;
+	  size = pfi->vnum * (sizeof(struct gavar) + 7 );
+	  if ((pvar = (struct gavar *)galloc(size,"pvar2")) == NULL) goto err8;
+	  pfi->pvar1 = pvar;
+	  i = 0;
+	  while (i<pfi->vnum)
+	    {
+	      /* initialize variables in the pvar structure */
+	      pvar->offset = 0; 
+	      pvar->recoff = 0;
+	      pvar->ncvid = -999;
+	      pvar->sdvid = -999;
+	      pvar->levels = 0;
+	      pvar->dfrm = 0;
+	      pvar->var_t = 0;
+	      pvar->scale = 1;
+	      pvar->add = 0;  
+	      pvar->undef= -9.99E33; 
+	      pvar->vecpair = -999;
+	      pvar->isu = 0;
+	      pvar->isdvar = 0;
+	      pvar->nvardims = 0; 
+
+	      /* get the complete variable declaration */
+	      if (fgets(rec,512,descr)==NULL) 
+		{
+		  gaprnt (0,"Open Error:  Unexpected EOF reading variables\n");
+		  sprintf (pout, "Was expecting %i records.  Found %i.\n", pfi->vnum, i);
+		  gaprnt (2,pout);
+		  goto retrn;
+		}
+	      /* remove any leading blanks from rec */
+	      reclen = strlen(rec);
+	      jj = 0;
+	      while (jj<reclen && rec[0]==' ')
+		{
+		  for (ii=0; ii<reclen; ii++) rec[ii] = rec[ii+1];
+		  jj++;
+		}
+	      /* replace newline with null at end of record */
+	      for (ichar = strlen(rec) - 1 ;  ichar >= 0 ;  --ichar)
+		{
+		  if (rec[ichar] == '\n')
+		    {
+		      rec[ichar] = '\0' ;
+		      break ; 
+		    }
+		}
+	      /* Keep mixed case and lower case versions of rec handy */
+	      strcpy (mrec,rec);
+	      lowcas(rec);
+	      /* Allow comments between VARS and ENDVARS */
+	      if (!isalnum(*(mrec)))
+		{
+		  /* Parse comment if it contains attribute metadata  */
+		  /*
+		  if ((strncmp("*:attr",mrec,6)==0) || (strncmp("@",mrec,1)==0)) {
+		    if ((ddfattr(mrec,pfi)) == -1) goto retrn;
+		    else continue;
+		  }
+		  else */continue; 
+		}
+	      if (cmpwrd("endvars",rec))
+		{
+		  gaprnt (0,"Open Error:  Unexpected ENDVARS record\n");
+		  sprintf (pout, "Was expecting %i records.  Found %i.\n", pfi->vnum, i);
+		  gaprnt (2,pout);
+		  goto err9;
+		}
+	
+	      /* get abbrv and full variable name if there */
+	      if ((getvnm(pvar, mrec))!=0) goto err6;
+
+	      /* parse the levels fields */
+	      if ( (ch=nxtwrd(rec))==NULL) goto err6;
+	      /* begin with 8th element of units aray for levels values */
+	      for (j=0;j<16;j++) pvar->units[j] = -999;
+	      j = 8;          
+	      while (1) 
+		{
+		  if (j==8) {
+		    /* first element is num levels */
+		    if ((ch=intprs(ch,&(pvar->levels)))==NULL) goto err6;      
+		  }
+		  else {
+		    /* remaining elements are grib2 level codes */
+		    if ((ch=getdbl(ch,&(pvar->units[j-1])))==NULL) goto err6;  
+		  }
+		  /* advance through comma-delimited list of levels args */
+		  while (*ch==' ') ch++;
+		  if (*ch=='\0' || *ch=='\n') goto err6;
+		  if (*ch!=',') break;
+		  ch++;
+		  while (*ch==',') { ch++; j++;}  /* advance past back to back commas */
+		  while (*ch==' ') ch++;
+		  if (*ch=='\0' || *ch=='\n') goto err6;
+		  j++;
+		  if (j>15) goto err6;
+		}
+
+	      /* parse the units fields; begin with 0th element for variable units */
+	      j = 0;
+	      pvar->nvardims=0;
+	      while (1)
+		{
+		  if (*ch=='x'||*ch=='y'||*ch=='z'||*ch=='t'||*ch=='e')
+		    { 
+		      if (*(ch+1)!=',' && *(ch+1)!=' ') goto err6;
+		      if (*ch=='x') { pvar->units[j] = -100; pvar->nvardims++; }
+		      if (*ch=='y') { pvar->units[j] = -101; pvar->nvardims++; }
+		      if (*ch=='z') { pvar->units[j] = -102; pvar->nvardims++; }
+		      if (*ch=='t') { pvar->units[j] = -103; pvar->nvardims++; }
+		      if (*ch=='e') { pvar->units[j] = -104; pvar->nvardims++; }
+		      ch++;
+		    } 
+		  else 
+		    {
+		      if ( (ch=getdbl(ch,&(pvar->units[j])))==NULL ) goto err6;
+		      /* no negative array indices for ncflag files */
+		      if ((pfi->ncflg) && (pvar->units[j] < 0))  goto err6;   
+		    }
+		  while (*ch==' ') ch++;
+		  if (*ch=='\0' || *ch=='\n') goto err6;
+		  if (*ch!=',') break;
+		  ch++;
+		  while (*ch==' ') ch++;
+		  if (*ch=='\0' || *ch=='\n') goto err6;
+		  j++;
+		  if (j>8) goto err6;
+		}
+
+	      /* parse the variable description */
+	      getstr (pvar->varnm,mrec+(ch-rec),127);
+
+
+	      /* var_t is for data files with dimension sequence: X, Y, Z, T, V */
+	      if (((int)pvar->units[0]==-1) && 
+		  ((int)pvar->units[1]==20)) 
+		pvar->var_t = 1;
+
+	      /* non-float data types */
+	      if (((int)pvar->units[0]==-1) && 
+		  ((int)pvar->units[1]==40))
+		{
+
+		  if ((int)pvar->units[2]== 1) pvar->dfrm = 1;
+		  if ((int)pvar->units[2]== 2)
+		    {
+		      pvar->dfrm = 2;
+		      if ((int)pvar->units[3]==-1) pvar->dfrm = -2;
+		    }
+		  if ((int)pvar->units[2]== 4) pvar->dfrm = 4;
+		}
+
+	      i++; pvar++;
+	    }
+
+	  /* Get ENDVARS statement and any additional comments */
+	  if (fgets(rec,512,descr)==NULL) {
+	    gaprnt (0,"Open Error:  Missing ENDVARS statement.\n");
+	    goto retrn;
+	  }
+	  /* Remove any leading blanks from rec */
+	  reclen = strlen(rec);
+	  jj = 0;
+	  while (jj<reclen && rec[0]==' ') {
+	    for (ii=0; ii<reclen; ii++) rec[ii] = rec[ii+1];
+	    jj++;
+	  }
+	  /* replace newline with null at end of record */
+	  for (ichar = strlen(rec) - 1 ;  ichar >= 0 ;  --ichar) {
+	    if (rec[ichar] == '\n') {
+	      rec[ichar] = '\0' ;
+	      break ; 
+	    }
+	  }
+	  /* Keep mixed case and lower case versions handy */
+	  strcpy (mrec,rec);
+	  lowcas(rec);
+	  while (!cmpwrd("endvars",rec)) 
+	    {
+	      /* see if it's an attribute comment */
+	      if (!isalnum(*(mrec))) {
+		/*
+		if ((strncmp("*:attr",mrec,6)==0) || (strncmp("@",mrec,1)==0)) {
+		  if ((ddfattr(mrec,pfi)) == -1) goto retrn;
+		}
+		*/
+	      }
+	      else {
+		sprintf(pout,"Open Error:  Looking for \"endvars\", found \"%s\" instead.\n",rec);
+		gaprnt (0,pout);
+		goto err9;
+	      }
+	      /* get a new record */
+	      if (fgets(rec,512,descr)==NULL) {
+		gaprnt (0,"Open Error:  Missing ENDVARS statement.\n");
+		goto retrn;
+	      }
+	      /* Remove any leading blanks from new record */
+	      reclen = strlen(rec);
+	      jj = 0;
+	      while (jj<reclen && rec[0]==' ') {
+		for (ii=0; ii<reclen; ii++) rec[ii] = rec[ii+1];
+		jj++;
+	      }
+	      /* replace newline with null at end of record */
+	      for (ichar = strlen(rec) - 1 ;  ichar >= 0 ;  --ichar) {
+		if (rec[ichar] == '\n') {
+		  rec[ichar] = '\0' ;
+		  break ; 
+		}
+	      }
+	      /* Keep mixed case and lower case versions handy */
+	      strcpy (mrec,rec);
+	      lowcas(rec);
+	    }
+	  /* vars block parsed without error */
+	  flgs[6] = 0;
+
+	} 
+      else
+	{
+	  /* parse error of .ctl file */
+	  gaprnt (0,"Open Error:  Unknown keyword in description file\n");
+	  goto err9;
+	}
+    }
+
+  /* Done scanning!
+     Check if scanned stuff makes sense, and then set things up correctly */
+
+  pfi->ulow = fabs(pfi->undef/EPSILON);
+  pfi->uhi  = pfi->undef + pfi->ulow;
+  pfi->ulow = pfi->undef - pfi->ulow;
+
+  /* If no EDEF entry was found, set up the default values */
+  if (pfi->ens1==NULL) {
+      pfi->dnum[4]=1;
+      /* set up linear scaling */
+      if ((vals = (gadouble *)galloc(sizeof(gadouble)*6,"evals3")) == NULL) goto err8;
+      v1=v2=1;
+      *(vals+1) = v1 - v2;
+      *(vals) = v2;
+      *(vals+2) = -999.9;
+      pfi->grvals[4] = vals;
+      *(vals+4) = -1.0 * ( (v1-v2)/v2 );
+      *(vals+3) = 1.0/v2;
+      *(vals+5) = -999.9;
+      pfi->abvals[4] = vals+3;
+      pfi->ab2gr[4] = liconv;
+      pfi->gr2ab[4] = liconv;
+      pfi->linear[4] = 1;
+      /* Allocate memory and initialize one ensemble structure */
+      ens = (struct gaens *)galloc(sizeof(struct gaens),"ens5");
+      if (ens==NULL) {
+	gaprnt(0,"Open Error: memory allocation failed for default ens\n");
+	goto err8;
+      }
+      pfi->ens1 = ens;
+      sprintf(ens->name,"1");
+      ens->length = pfi->dnum[3];
+      ens->gt = 1;
+      gr2t(pfi->grvals[3],1,&ens->tinit);
+      for (j=0;j<4;j++) ens->grbcode[j] = -999;
+  }
+
+  /* Make sure there are no conflicting options and data types */
+  pvar=pfi->pvar1;
+  for (j=1; j<=pfi->vnum; j++) {
+    if ((int)pvar->units[0]==-1 && (int)pvar->units[1]==20) {
+      if (pfi->tmplat) {
+	gaprnt(0,"Open Error: Variables with transposed VAR-T dimensions cannot be templated together\n");
+	err=1;
+      }
+      if (hdrb>0) {
+	gaprnt(0,"Open Error: Variables with transposed VAR-T dimensions are incompatible with time headers\n");
+	err=1;
+      }
+      if (trlb>0) {
+	gaprnt(0,"Open Error: Variables with transposed VAR-T dimensions are incompatible with TRAILERBYTES\n");
+	err=1;
+      }
+    }
+    pvar++;
+  }
+  if (err) goto retrn;
+
+
+  /* Figure out locations of variables within a time group */
+  pvar = pfi->pvar1;
+
+  /* Grid data */
+  if (pfi->type==1) {
+    pfi->gsiz = pfi->dnum[0] * pfi->dnum[1];
+    /* if (pfi->ppflag) pfi->gsiz = pfi->ppisiz * pfi->ppjsiz; */
+    /* add the XY header to gsiz */
+    if (pfi->xyhdr) {
+      if (pvar->dfrm == 1) {
+	pfi->xyhdr = pfi->xyhdr*4/1;          
+      } 
+      else if (pvar->dfrm ==  2 || pvar->dfrm == -2 ) {
+	pfi->xyhdr = pfi->xyhdr*4/2;
+      }
+      else if (pfi->flt64) {
+        pfi->xyhdr = pfi->xyhdr*4/8;
+      }
+      pfi->gsiz = pfi->gsiz + pfi->xyhdr;
+    }
+
+    /* adjust the size of hdrb and trlb for non-float data */
+    if (pvar->dfrm == 1) {
+      hdrb = hdrb*4/1;
+      trlb = trlb*4/1;
+    } 
+    else if (pvar->dfrm == 2 || pvar->dfrm == -2 ) {
+      hdrb = hdrb*4/2;
+      trlb = trlb*4/2;
+    } 
+    
+    if (pfi->seqflg) {
+      /* pad the grid size with 2 4-byte chunks */
+      if (pvar->dfrm == 1) {
+	pfi->gsiz += 8;
+      } 
+      else if (pvar->dfrm == 2 || pvar->dfrm == -2 ) {
+	pfi->gsiz += 4;
+      } 
+      else {
+	if (pfi->flt64)
+	  pfi->gsiz += 1;
+	else
+	  pfi->gsiz += 2;             
+      }
+      /* pad the header with 2 4-byte chunks*/
+      if (hdrb>0) {
+	if (pvar->dfrm == 1) {
+	  hdrb = hdrb + 8;
+	} 
+	else if (pvar->dfrm == 2 || pvar->dfrm == -2 ) {
+	  hdrb = hdrb + 4;
+	} 
+	else {
+	  hdrb += 2; 
+	}
+      }
+      /* how far we have to go into the file before getting to 1st var */
+      if (pvar->dfrm == 1) {
+	pvar->offset = 4+hdrb;
+	acum = 4+hdrb;
+      } 
+      else if (pvar->dfrm == 2 || pvar->dfrm == -2 ) {
+	pvar->offset = 2+hdrb;
+	acum = 2+hdrb;
+      } 
+      else {
+	pvar->offset = 1+hdrb;
+	acum = 1+hdrb;
+      } 
+    }
+    else {
+      /* how far we have to go into the file before getting to 1st var */
+      pvar->offset = hdrb;
+      acum = hdrb;
+    }
+
+    levs = pvar->levels;
+    if (levs==0) levs=1;
+    pvar->recoff = 0;
+    recacm = 0;
+    pvar++;
+    acumvz=acum;
+
+    for (i=1; i<pfi->vnum; i++) {
+      if (pvar->var_t) {   
+	acum = acum + levs*(pfi->gsiz)*(pfi->dnum[3]); 
+      } else {                              
+	acum = acum + (levs*pfi->gsiz);
+	acumstride = acum ;
+      }
+      recacm += levs;
+      pvar->offset = acum;
+      pvar->recoff = recacm;
+      levs = pvar->levels;
+      if (levs==0) levs=1;
+      pvar++;
+    }
+
+    recacm += levs;
+
+    /* last variable */
+    acum = acum + (levs*pfi->gsiz);
+
+    pfi->tsiz = acum;
+    pfi->trecs = recacm;
+    if (pfi->seqflg) pfi->tsiz-=1;
+    pfi->tsiz += trlb;    
+  } 
+  else {
+    fprintf(stderr, "Grid data type unsupported!");
+    return (-1);
+  }
+
+/* set the global calendar and check if we are trying to change with a new file...
+   we do this here to set the calandar for templating */
+
+  if (/*mfcmn.*/cal365<0) {
+    /*mfcmn.*/cal365=pfi->calendar;
+  } else {
+    if (pfi->calendar != /*mfcmn.*/cal365) {
+      gaprnt(0,"Attempt to change the global calendar...\n");
+      if (/*mfcmn.*/cal365) {
+	gaprnt(0,"The calendar is NOW 365 DAYS and you attempted to open a standard calendar file\n");
+      } else {
+	gaprnt(0,"The calendar is NOW STANDARD and you attempted to open a 365-day calendar file\n");
+      }
+      goto retrn;
+    }
+  }
+
+  /* If the file name is a time series template, figure out
+     which times go with which files, so we don't waste a lot
+     of time later opening and closing files unnecessarily. */
+
+  if (pfi->tmplat) 
+    {
+      /* The fnums array is the size of the time axis 
+	 multiplied by the size of the ensemble axis. 
+	 It contains the t index which generates the filename 
+	 that contains the data for each timestep.
+	 If the ensemble has no data file for a given time, 
+	 the fnums value will be -1 */
+      pfi->fnums = (gaint *)galloc(sizeof(gaint)*pfi->dnum[3]*pfi->dnum[4],"fnums1");   
+      if (pfi->fnums==NULL) {
+	gaprnt(0,"Open Error: memory allocation failed for fnums\n");
+	goto err8;
+      }
+      /* get dt structure for t=1 */
+      gr2t(pfi->grvals[3],1.0,&tdefi); 
+      /* loop over ensembles */
+      ens=pfi->ens1;
+      e=1;
+      while (e<=pfi->dnum[4])
+	{
+	  j = -1; 
+	  t=1;
+	  /* set fnums value to -1 for time steps before ensemble initial time */
+	  while (t<ens->gt) {
+	    pfi->fnums[t-1] = j;                                                    
+	    t++;
+	  }
+	  j = ens->gt;
+	  /* get dt structure for ensemble initial time */
+	  gr2t(pfi->grvals[3],ens->gt,&tdefe);
+	  /* get filename for initial time of current ensemble member  */
+	  ch = gafndt(pfi->name,&tdefe,&tdefe,pfi->abvals[3],pfi->pchsub1,pfi->ens1,ens->gt,e,&flag);   
+	  if (ch==NULL) {
+	    sprintf(pout,"Open Error: couldn't determine data file name for e=%d t=%d\n",e,ens->gt);
+	    gaprnt(0,pout);
+	    goto err8;
+	  }
+	  /* set the pfi->tmplat flag to the flag returned by gafndt */
+	  if (flag==0) {
+	    gaprnt(1,"Warning: OPTIONS keyword \"template\" is used, but the \n");
+	    gaprnt(1,"   DSET entry contains no substitution templates.\n");
+	    pfi->tmplat = 1;
+	  } else {
+	    pfi->tmplat = flag; 
+	  }
+	  /* for non-indexed, non-netcdf/hdf, gridded data */
+	  if (pfi->type==1) {                /* gridded data   */
+	    if (pfi->ncflg==0) {             /* not netcdf/hdf */
+	      if (pfi->idxflg==0) {          /* not indexed    */
+		if ((flag==1) && (pfi->dnum[4]>1)) {
+		  gaprnt(0,"Open Error: If the data type is gridded binary, \n");
+		  gaprnt(0,"  and the E dimension size is greater than 1 \n");
+		  gaprnt(0,"  and templating in the T dimension is used,\n");
+		  gaprnt(0,"  then templating in the E dimension must also be used.\n");
+		  goto retrn;
+		}
+	      }
+	      else if (pfi->idxflg==1) {     /* GRIB1 */
+		if ((flag<2) && (pfi->dnum[4]>1)) {
+		  gaprnt(0,"Open Error: If the data type is GRIB1 \n");
+		  gaprnt(0,"  and the E dimension size is greater than 1 \n");
+		  gaprnt(0,"  then templating in the E dimension must be used.\n");
+		  goto retrn;
+		}
+	      }
+	    }
+	  }
+	  pfi->fnums[t-1] = j;                                                    
+	  /* loop over remaining valid times for this ensemble */
+	  for (t=ens->gt+1; t<ens->gt+ens->length; t++) {
+	    /* get filename for time index=t ens=e */
+	    gr2t(pfi->grvals[3],(gadouble)t,&tdef);
+	    pos = gafndt(pfi->name,&tdef,&tdefe,pfi->abvals[3],pfi->pchsub1,pfi->ens1,t,e,&flag);  
+	    if (pos==NULL) {
+	      sprintf(pout,"Open Error: couldn't determine data file name for e=%d t=%d\n",e,t);
+	      gaprnt(0,pout);
+	      goto err8;
+	    }
+	    if (strcmp(ch,pos)!=0) {    /* filename has changed */
+	      j = t;   
+	      gree(ch,"f176");
+	      ch = pos;
+	    }
+	    else {
+	      gree(pos,"f176a");
+	    }
+	    pfi->fnums[+t-1] = j;                                                    
+	  }
+	  gree(ch,"f177");
+	  
+	  /* set fnums value to -1 for time steps after ensemble final time */
+	  j = -1;
+	  while (t<=pfi->dnum[3]) {
+	    pfi->fnums[t-1] = j;                                                    
+	    t++;
+	  }
+	  e++; ens++;
+	}
+      pfi->fnumc = 0;
+      pfi->fnume = 0;
+    }
+
+
+
+  fclose(descr);
+
+  return (status);
+
+ err1:
+  gaprnt (0,"Open Error:  Missing or invalid dimension size.\n");
+  goto err9;
+
+ err2:
+  gaprnt (0,"Open Error:  Missing or invalid dimension");
+  gaprnt (0," scaling type\n");
+  goto err9;
+
+ err3a_tdef:
+  gaprnt (0,"Open Error:  Start Time missing in tdef card");
+  gaprnt (0," starting value\n");
+  goto err9;
+
+ err3b_tdef:
+  gaprnt (0,"Open Error:  Invalid start time in tdef card");
+  gaprnt (0," starting value\n");
+  goto err9;
+
+ err3c_tdef:
+  gaprnt (0,"Open Error:  Missing or invalid dimension");
+  gaprnt (0," starting value\n");
+  goto err9;
+
+ err3:
+  gaprnt (0,"Open Error:  Missing or invalid dimension");
+  gaprnt (0," starting value\n");
+  goto err9;
+
+ err4a_tdef:
+  gaprnt (0,"Open Error:  Time increment missing in tdef\n");
+  gaprnt (0," use 1 for single time data\n");
+  goto err9;
+
+ err4b_tdef:
+  gaprnt (0,"Open Error:  Invalid time increment in tdef\n");
+  gaprnt (0," use 1 for single time data\n");
+  goto err9;
+
+ err4c_tdef:
+  gaprnt (0,"Open Error:  0 time increment in tdef\n");
+  gaprnt (0," use 1 for single time data\n");
+  goto err9;
+
+ err5:
+  gaprnt (0,"Open Error:  Missing or invalid variable");
+  gaprnt (0," count\n");
+  goto err9;
+
+ err6:
+  gaprnt (0,"Open Error:  Invalid variable record\n");
+  goto err9;
+
+ err6a:
+  gaprnt (0,"Open Error:  Invalid x,y pair\n");
+  goto err9;
+
+ err7a: 
+  gaprnt (0,"Open Error:  EOF occurred reading ensemble names\n");
+  goto err9;
+
+ err7b:
+  gaprnt (0,"Open Error:  Blank record found in EDEF data\n");
+  goto err9;
+
+ err7c:
+  gaprnt (0,"Open Error:  Invalid ensemble grib codes\n");
+  goto err9;
+
+ err7d:
+  gaprnt (0,"Open Error:  Invalid ensemble name\n");
+  goto err9;
+
+ err7e:
+  gaprnt (0,"Open Error:  Invalid ensemble record\n");
+  goto err9;
+
+ err8:
+  gaprnt (0,"Open Error:  Memory allocation Error in gaddes.c\n");
+  goto retrn;
+
+ err9:
+  gaprnt (0,"  --> The invalid description file record is: \n");
+  gaprnt (0,"  --> ");
+  gaprnt (0,mrec);
+  gaprnt (0,"\n");
+
+ retrn:
+  gaprnt (0,"  The data file was not opened. \n");
+  fclose (descr);
+  return(1);
+}
diff --git a/src/gradsdeslib.h b/src/gradsdeslib.h
new file mode 100644
index 0000000..3e805c1
--- /dev/null
+++ b/src/gradsdeslib.h
@@ -0,0 +1,170 @@
+#ifndef  _GRADSDESLIB_H
+#define  _GRADSDESLIB_H
+
+#define  gaint     int
+#define  gadouble  double
+#define  gafloat   float
+#define  galloc(x,y)  malloc(x)
+#define  gree(x,y)    free(x)
+#define  gaprnt(i,ch) printf("%s",ch)
+
+
+/* Handling of missing data values. After the data I/O is done, 
+   grid values are tested to see if they are within a small range 
+   (+-value/EPSILON) of the missing value. If true, then the undef 
+   mask is set to 0. If false, then the grid data values are good, 
+   and the undef mask is set to 1. Everywhere else in the code, 
+   undef tests are done on the mask values, not the data. */
+
+#define EPSILON 1e5
+
+
+/* Date/time structure */
+struct dt {
+  gaint yr;
+  gaint mo;
+  gaint dy;
+  gaint hr;
+  gaint mn;
+};
+
+/* Structure that describes a variable in a file.  These structures
+   are built in arrays that are hung off of gafile structures.         */
+struct gavar {
+  char varnm[128];             /* Variable description.                */
+  char abbrv[16];              /* Variable abbreviation.               */
+  char longnm[257];            /* netcdf/hdf var name if different     */
+  gadouble units[16];          /* Units indicator.                     
+				  Vals 0-7 are for variable codes:
+				  grib, non-float data, nc/hdf dims
+				  Vals  8-11 are for grib level codes  */
+  gaint offset;                /* Offset in grid elements of the start
+                                  of this variable within a time group
+                                  within this file.                    */
+  gaint recoff;                /* Record (XY grid) offset of the start
+                                  of this variable within a time group */
+  gaint ncvid;                 /* netcdf vid for this variable         */
+  gaint sdvid;                 /* hdf vid for this variable            */
+  gaint levels;                /* Number of levels for this variable.
+                                  0 is special and indiates one grid is
+                                  available for the surface only.      */
+  gaint dfrm;                  /* format  type indicator
+  				  1 - unsigned char
+				  4 - int  			       */
+  gaint var_t ;                /* variable t transform                 */
+  gadouble scale;              /* scale factor for unpacking data      */
+  gadouble add;                /* offset value for unpacking data      */
+  gadouble undef;              /* undefined value                      */
+  gaint vecpair;               /* Variable has a vector pair           */
+  gaint isu;                   /* Variable is the u-component of a vector pair */
+  gaint isdvar;                /* Variable is a valid data variable (for SDF files) */
+  gaint nvardims;              /* Number of variable dimensions        */
+  gaint vardimids[100];        /* Variable dimension IDs. 	       */
+};
+
+/* Sructure for string substitution in templating -- the %ch template.  
+   This forms a linked list chained from pchsub1 in gafile */
+struct gachsub {
+  struct gachsub *forw;       /* Forward pointer */
+  gaint t1;                   /* First time for this substitution */
+  gaint t2;                   /* Last time.  -99 indicates open ended */
+  char *ch;                   /* Substitution string */
+};
+
+/* Structure for ensemble metadata */
+struct gaens {
+  char name[16];             /* name of ensemble */
+  gaint length;              /* length of time axis */
+  struct dt tinit;           /* initial time */
+  gaint gt;                  /* initial time in grid units */
+  gaint grbcode[4];          /* grib2 codes */
+};
+
+
+#define  MAX_RECLEN   512
+#define  MAX_NAMELEN  512
+typedef struct {
+  char name[MAX_NAMELEN];
+  char dnam[MAX_NAMELEN];
+  char title[MAX_NAMELEN];
+  int bswap;
+  long gsiz;                   /* Number of elements in a grid (x*y)    */
+                               /* This is for actual grid on disk,
+                                  not psuedo grid (when pp in force) */
+  long tsiz;                   /* Number of elements in an entire time
+                                  group (all variables at all levels
+                                  for one time).                        */
+  gaint trecs;                 /* Number of records (XY grids) per time
+                                  group.                                */
+  long fhdr;
+  struct gachsub *pchsub1;     /* Pointer to first %ch substitution */
+  gaint ncflg;                 /* 1==netcdf  2==hdfsds */
+  long xyhdr;
+  int seqflg;
+  int yrflg;
+  int zrflg;
+  int pa2mb;
+  int calendar;
+  /* init !? */
+  FILE *infile;                /* File pointer.                         */
+  gaint type;                  /* Type of file:  1 = grid
+                                                 2 = simple station
+                                                 3 = mapped station
+                                                 4 = defined grid       */
+  gadouble undef;              /* Global undefined value for this file  */
+  gadouble ulow,uhi;           /* Undefined limits for missing data test  */
+  gaint dnum[5];               /* Dimension sizes for this file.        */
+  gaint vnum;                  /* Number of variables.                  */
+  struct gavar *pvar1;         /* Pointer to an array of structures.
+				  Each structure in the array has info
+				  about the specific variable.          */
+  struct gaens *ens1;          /* pointer to array of ensemble structures */
+  gaint wrap;                  /* The grid globally 'wraps' in X        */
+  gadouble (*gr2ab[5]) (double *, double);
+                               /* Addresses of routines to do conversion
+                                  from grid coordinates to absolute
+                                  coordinates for X, Y, Z.  All Date/time
+                                  conversions handled by gr2t.          */
+  gadouble (*ab2gr[5]) (double *, double);
+                               /* Addresses of routines to do conversion
+                                  from absolute coordinates to grid
+                                  coordinates for X,Y,Z.  All date/time
+                                  conversions handled by t2gr.          */
+  gadouble *grvals[5];         /* Pointers to conversion information for
+                                  grid-to-absolute conversion routines. */
+  gadouble *abvals[5];         /* Pointers to conversion information for
+                                  absolute-to-grid conversion routines. */
+  gaint linear[5];             /* Indicates if a dimension has a linear
+                                  grid/absolute coord transformation
+                                  (Time coordinate always linear).      */
+  gaint idxflg;                /* File records are indexed; 1==grib,station 2==grib2 */
+  gaint flt64;                 /* 20120711 Uwe Schulzweida: added support for 64 bit floats */ 
+  gaint tmplat;                /* File name templating:
+                                   3==templating on E and T 
+                                   2==templating only on E 
+                                   1==templating only on T, or when 
+                                      ddf has 'options template', but no % in dset 
+                                   0==no templating  */
+  gaint *fnums;                /* File number for each time */
+  gaint fnumc;                 /* Current file number that is open */
+  gaint fnume;                 /* Current ensemble file number that is open */
+}
+dsets_t;
+
+void dsets_init(dsets_t *dsets);
+
+int read_gradsdes(char *filename, dsets_t *pfi);
+
+gadouble liconv (gadouble *, gadouble);
+gadouble gr2lev (gadouble *, gadouble);
+gadouble lev2gr (gadouble *, gadouble);
+void gr2t (gadouble *, gadouble, struct dt *);
+char *gafndt (char *, struct dt *, struct dt *, gadouble *, 
+	      struct gachsub *, struct gaens *, gaint, gaint, gaint *);
+
+gaint cmpwrd (char *ch1, char *ch2);
+char *intprs (char *ch, int *val);
+void gabswp (void *r, gaint cnt);
+void gabswp2 (void *r, gaint cnt);
+
+#endif  /* _GRADSDESLIB_H */
diff --git a/src/grid.c b/src/grid.c
new file mode 100644
index 0000000..185d560
--- /dev/null
+++ b/src/grid.c
@@ -0,0 +1,1714 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdarg.h> /* va_list */
+
+#if defined (HAVE_LIBPROJ)
+#  include "proj_api.h"
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "error.h"
+#include "grid.h"
+
+
+void gridToDegree(const char *units, const char *string, int gridsize, double *array)
+{
+  long i;
+
+  if ( memcmp(units, "radian", 6) == 0 )
+    {
+      for ( i = 0; i < gridsize; i++ ) array[i] *= rad2deg;
+    }
+  else if ( memcmp(units, "degree", 6) == 0 )
+    {
+      /* No conversion necessary */
+    }
+  else
+    {
+      cdoWarning("Unknown units supplied for %s: %s", string, "proceeding assuming degrees!");
+    }
+}
+
+
+int gridToZonal(int gridID1)
+{
+  int gridID2;
+  int gridtype, gridsize;
+  double  xval = 0;
+  double *yvals;
+
+  gridtype = gridInqType(gridID1);
+  gridsize = gridInqYsize(gridID1);
+  gridID2  = gridCreate(gridtype, gridsize);
+	  
+  if ( gridtype == GRID_LONLAT   ||
+       gridtype == GRID_GAUSSIAN ||
+       gridtype == GRID_GENERIC )
+    {
+      gridDefXsize(gridID2, 1);
+      gridDefYsize(gridID2, gridsize);
+
+      gridDefXvals(gridID2, &xval);
+
+      if ( gridInqYvals(gridID1, NULL) )
+	{
+	  yvals = (double *) malloc(gridsize*sizeof(double));
+
+	  gridInqYvals(gridID1, yvals);
+	  gridDefYvals(gridID2, yvals);
+
+	  free(yvals);
+	}
+    }
+  else
+    {
+      Error("Gridtype %s unsupported!", gridNamePtr(gridtype));
+    }
+
+  return (gridID2);
+}
+
+
+int gridToMeridional(int gridID1)
+{
+  int gridID2;
+  int gridtype, gridsize;
+  double *xvals;
+  double  yval = 0;
+
+  gridtype = gridInqType(gridID1);
+  gridsize = gridInqXsize(gridID1);
+  gridID2  = gridCreate(gridtype, gridsize);
+	  
+  if ( gridtype == GRID_LONLAT   ||
+       gridtype == GRID_GAUSSIAN ||
+       gridtype == GRID_GENERIC )
+    {
+      gridDefXsize(gridID2, gridsize);
+      gridDefYsize(gridID2, 1);
+
+      if ( gridInqXvals(gridID1, NULL) )
+	{
+	  xvals = (double *) malloc(gridsize*sizeof(double));
+
+	  gridInqXvals(gridID1, xvals);
+	  gridDefXvals(gridID2, xvals);
+
+	  free(xvals);
+	}
+
+      gridDefYvals(gridID2, &yval);
+    }
+  else
+    {
+      Error("Gridtype %s unsupported!", gridNamePtr(gridtype));
+    }
+
+  return (gridID2);
+}
+
+
+void gridGenXbounds(int nx, double *xvals, double *xbounds)
+{
+  int i;
+
+  for ( i = 0; i < nx-1; i++ )
+    {
+      xbounds[2*i+1]   = 0.5*(xvals[i] + xvals[i+1]);
+      xbounds[2*(i+1)] = 0.5*(xvals[i] + xvals[i+1]);
+    }
+
+  xbounds[0]      = 2*xvals[0] - xbounds[1];
+  xbounds[2*nx-1] = 2*xvals[nx-1] - xbounds[2*(nx-1)];
+}
+
+
+void gridGenYbounds(int ny, double *yvals, double *ybounds)
+{
+  int i;
+
+  for ( i = 0; i < ny-1; i++ )
+    {
+      ybounds[2*i+1]   = 0.5*(yvals[i] + yvals[i+1]);
+      ybounds[2*(i+1)] = 0.5*(yvals[i] + yvals[i+1]);
+    }
+
+  ybounds[0]      = 2*yvals[0] - ybounds[1];
+  ybounds[2*ny-1] = 2*yvals[ny-1] - ybounds[2*(ny-1)];
+
+  if ( yvals[0] > yvals[ny-1] )
+    {
+      if ( ybounds[0]      >  88 ) ybounds[0]      =  90;
+      if ( ybounds[2*ny-1] < -88 ) ybounds[2*ny-1] = -90;
+    }
+  else
+    {
+      if ( ybounds[0]      < -88 ) ybounds[0]      = -90;
+      if ( ybounds[2*ny-1] >  88 ) ybounds[2*ny-1] =  90;
+    }
+}
+
+
+void gridGenYboundsM(int ny, double *yvals, double *ybounds)
+{
+  int i;
+
+  for ( i = 0; i < ny-1; i++ )
+    {
+      ybounds[2*i+1]   = 0.5*(yvals[i] + yvals[i+1]);
+      ybounds[2*(i+1)] = 0.5*(yvals[i] + yvals[i+1]);
+    }
+
+  ybounds[0]      = 2*yvals[0] - ybounds[1];
+  ybounds[2*ny-1] = 2*yvals[ny-1] - ybounds[2*(ny-1)];
+}
+
+
+void gridGenRotBounds(int gridID, int nx, int ny,
+		      double *xbounds, double *ybounds, double *xbounds2D, double *ybounds2D)
+{
+  long i, j, index;
+  double minlon, maxlon;
+  double minlat, maxlat;
+  double xpole, ypole, angle;
+
+  xpole = gridInqXpole(gridID);
+  ypole = gridInqYpole(gridID);
+  angle = gridInqAngle(gridID);
+
+  for ( j = 0; j < ny; j++ )
+    {
+      if ( ybounds[0] > ybounds[1] )
+	{
+	  maxlat = ybounds[2*j];
+	  minlat = ybounds[2*j+1];
+	}
+      else
+	{
+	  maxlat = ybounds[2*j+1];
+	  minlat = ybounds[2*j];
+	}
+
+      for ( i = 0; i < nx; i++ )
+	{
+	  minlon = xbounds[2*i];
+	  maxlon = xbounds[2*i+1];
+
+	  index = j*4*nx + 4*i;
+	  xbounds2D[index+0] = lamrot_to_lam(minlat, minlon, ypole, xpole, angle);
+	  xbounds2D[index+1] = lamrot_to_lam(minlat, maxlon, ypole, xpole, angle);
+	  xbounds2D[index+2] = lamrot_to_lam(maxlat, maxlon, ypole, xpole, angle);
+	  xbounds2D[index+3] = lamrot_to_lam(maxlat, minlon, ypole, xpole, angle);
+
+	  ybounds2D[index+0] = phirot_to_phi(minlat, minlon, ypole, angle);
+	  ybounds2D[index+1] = phirot_to_phi(minlat, maxlon, ypole, angle);
+	  ybounds2D[index+2] = phirot_to_phi(maxlat, maxlon, ypole, angle);
+	  ybounds2D[index+3] = phirot_to_phi(maxlat, minlon, ypole, angle);
+	}
+    }
+}
+
+static
+void gridGenXbounds2D(int nx, int ny, const double * restrict xbounds, double * restrict xbounds2D)
+{
+  long i, j, index;
+  double minlon, maxlon;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none)        \
+  shared(nx, ny, xbounds, xbounds2D)	      \
+  private(i, j, minlon, maxlon, index)
+#endif
+  for ( i = 0; i < nx; ++i )
+    {
+      minlon = xbounds[2*i  ];
+      maxlon = xbounds[2*i+1];
+
+      for ( j = 0; j < ny; ++j )
+	{
+	  index = j*4*nx + 4*i;
+	  xbounds2D[index  ] = minlon;
+	  xbounds2D[index+1] = maxlon;
+	  xbounds2D[index+2] = maxlon;
+	  xbounds2D[index+3] = minlon;
+	}
+    }
+}
+
+static
+void gridGenYbounds2D(int nx, int ny, const double * restrict ybounds, double * restrict ybounds2D)
+{
+  long i, j, index;
+  double minlat, maxlat;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none)        \
+  shared(nx, ny, ybounds, ybounds2D)	      \
+  private(i, j, minlat, maxlat, index)
+#endif
+  for ( j = 0; j < ny; ++j )
+    {
+      if ( ybounds[0] > ybounds[1] )
+	{
+	  maxlat = ybounds[2*j  ];
+	  minlat = ybounds[2*j+1];
+	}
+      else
+	{
+	  maxlat = ybounds[2*j+1];
+	  minlat = ybounds[2*j  ];
+	}
+
+      for ( i = 0; i < nx; ++i )
+	{
+	  index = j*4*nx + 4*i;
+	  ybounds2D[index  ] = minlat;
+	  ybounds2D[index+1] = minlat;
+	  ybounds2D[index+2] = maxlat;
+	  ybounds2D[index+3] = maxlat;
+	}
+    }
+}
+
+static
+char *gen_param(const char *fmt, ...)
+{
+  va_list args;
+  char str[256];
+  char *rstr;
+  int len;
+
+  va_start(args, fmt);
+
+  len = vsprintf(str, fmt, args);
+
+  va_end(args);
+
+  len++;
+  rstr = (char *) malloc(len*sizeof(char));
+  memcpy(rstr, str, len*sizeof(char));
+
+  return (rstr);
+}
+
+static
+void lcc_to_geo(int gridID, int gridsize, double *xvals, double *yvals)
+{
+  double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
+  double zlat, zlon;
+  double xi, xj;
+  int projflag, scanflag;
+  int status;
+  long i;
+  proj_info_t proj;
+
+  gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm,
+	     &projflag, &scanflag);
+  /*
+    while ( originLon < 0 ) originLon += 360;
+    while ( lonParY   < 0 ) lonParY   += 360;
+  */
+  if ( IS_NOT_EQUAL(xincm, yincm) )
+    Warning("X and Y increment must be equal on Lambert Conformal grid (Xinc = %g, Yinc = %g)\n", 
+	    xincm, yincm);
+  /*
+  if ( IS_NOT_EQUAL(lat1, lat2) )
+    Warning("Lat1 and Lat2 must be equal on Lambert Conformal grid (Lat1 = %g, Lat2 = %g)\n", 
+	    lat1, lat2);
+  */
+  map_set(PROJ_LC, originLat, originLon, xincm, lonParY, lat1, lat2, &proj);
+
+  for ( i = 0; i < gridsize; i++ )
+    {
+      xi = xvals[i];
+      xj = yvals[i];
+      // status = W3FB12(xi, xj, originLat, originLon, xincm, lonParY, lat1, &zlat, &zlon);
+      ijll_lc(xi, xj, proj, &zlat, &zlon);
+      xvals[i] = zlon;
+      yvals[i] = zlat;
+    }
+}
+
+static
+void sinusoidal_to_geo(int gridsize, double *xvals, double *yvals)
+{
+#if defined (HAVE_LIBPROJ)
+  projPJ   *libProj;
+  char *params[20];
+  int nbpar=0;
+  projUV data, res;
+  long i;
+
+  nbpar = 0;
+  params[nbpar++] = (char*) "proj=sinu";
+  params[nbpar++] = (char*) "ellps=WGS84";
+
+  if ( cdoVerbose )
+    for ( i = 0; i < nbpar; ++i )
+      cdoPrint("Proj.param[%ld] = %s", i+1, params[i]);
+
+  libProj = pj_init(nbpar, params);
+  if ( !libProj )
+    cdoAbort("proj error: %s", pj_strerrno(pj_errno));
+
+  /* libProj->over = 1; */		/* allow longitude > 180� */
+
+  for ( i = 0; i < gridsize; i++ )
+    {
+      data.u = xvals[i];
+      data.v = yvals[i];
+      res = pj_inv(data, libProj);
+      xvals[i] = res.u*rad2deg;
+      yvals[i] = res.v*rad2deg;
+    }
+#else
+  cdoAbort("proj4 support not compiled in!");
+#endif
+}
+
+static
+void laea_to_geo(int gridID, int gridsize, double *xvals, double *yvals)
+{
+#if defined (HAVE_LIBPROJ)
+  projPJ   *libProj;
+  char *params[20];
+  int nbpar=0;
+  projUV data, res;
+  double a, lon_0, lat_0;
+  long i;
+
+  gridInqLaea(gridID, &a , &lon_0, &lat_0);
+
+  nbpar = 0;
+  params[nbpar++] = gen_param("proj=laea");
+  if ( a > 0 ) params[nbpar++] = gen_param("a=%g", a);
+  params[nbpar++] = gen_param("lon_0=%g", lon_0);
+  params[nbpar++] = gen_param("lat_0=%g", lat_0);
+
+  if ( cdoVerbose )
+    for ( i = 0; i < nbpar; ++i )
+      cdoPrint("Proj.param[%d] = %s", i+1, params[i]);
+
+  libProj = pj_init(nbpar, &params[0]);
+  if ( !libProj )
+    cdoAbort("proj error: %s", pj_strerrno(pj_errno));
+
+  for ( i = 0; i < nbpar; ++i ) free(params[i]);
+
+  /* libProj->over = 1; */		/* allow longitude > 180� */
+
+  for ( i = 0; i < gridsize; i++ )
+    {
+      data.u = xvals[i];
+      data.v = yvals[i];
+      res = pj_inv(data, libProj);
+      xvals[i] = res.u*rad2deg;
+      yvals[i] = res.v*rad2deg;
+    }
+#else
+  cdoAbort("proj4 support not compiled in!");
+#endif
+}
+
+static
+void lcc2_to_geo(int gridID, int gridsize, double *xvals, double *yvals)
+{
+#if defined (HAVE_LIBPROJ)
+  projPJ   *libProj;
+  char *params[20];
+  int nbpar=0;
+  projUV data, res;
+  double a, lon_0, lat_0, lat_1, lat_2;
+  long i;
+
+  gridInqLcc2(gridID, &a , &lon_0, &lat_0, &lat_1, &lat_2);
+
+  nbpar = 0;
+  params[nbpar++] = gen_param("proj=lcc");
+  if ( a > 0 ) params[nbpar++] = gen_param("a=%g", a);
+  params[nbpar++] = gen_param("lon_0=%g", lon_0);
+  params[nbpar++] = gen_param("lat_0=%g", lat_0);
+  params[nbpar++] = gen_param("lat_1=%g", lat_1);
+  params[nbpar++] = gen_param("lat_2=%g", lat_2);
+
+  if ( cdoVerbose )
+    for ( i = 0; i < nbpar; ++i )
+      cdoPrint("Proj.param[%d] = %s", i+1, params[i]);
+  
+  libProj = pj_init(nbpar, &params[0]);
+  if ( !libProj )
+    cdoAbort("proj error: %s", pj_strerrno(pj_errno));
+
+  for ( i = 0; i < nbpar; ++i ) free(params[i]);
+
+  /* libProj->over = 1; */		/* allow longitude > 180� */
+  
+  for ( i = 0; i < gridsize; i++ )
+    {
+      data.u = xvals[i];
+      data.v = yvals[i];
+      res = pj_inv(data, libProj);
+      xvals[i] = res.u*rad2deg;
+      yvals[i] = res.v*rad2deg;
+    }
+#else
+  cdoAbort("proj4 support not compiled in!");
+#endif
+}
+
+int    qu2reg3(double *pfield, int *kpoint, int klat, int klon,
+	       double msval, int *kret, int omisng, int operio, int oveggy);
+
+void field2regular(int gridID1, int gridID2, double missval, double *array, int nmiss)
+{
+  int nlon, nlat;
+  int gridtype;
+  int lmiss, lperio, lveggy;
+  int iret;
+  int *rowlonptr;
+
+  gridtype = gridInqType(gridID1);
+
+  if ( gridtype != GRID_GAUSSIAN_REDUCED ) Error("Not a reduced gaussian grid!");
+
+  nlat = gridInqYsize(gridID1);
+  nlon = 2*nlat;
+
+  rowlonptr = (int *) malloc(nlat*sizeof(int));
+
+  if ( gridInqSize(gridID2) != nlon*nlat ) Error("Gridsize differ!");
+
+  gridInqRowlon(gridID1, rowlonptr);
+
+  lmiss = nmiss > 0;
+  lperio = 1;
+  lveggy = 0;
+
+  (void) qu2reg3(array, rowlonptr, nlat, nlon, missval, &iret, lmiss, lperio, lveggy);
+
+  free(rowlonptr);
+}
+
+
+int gridToRegular(int gridID1)
+{
+  int gridID2;
+  int gridtype, gridsize;
+  int nx, ny;
+  long i;
+  double *xvals = NULL, *yvals = NULL;
+
+  gridtype = gridInqType(gridID1);
+
+  if ( gridtype != GRID_GAUSSIAN_REDUCED ) Error("Not a reduced gaussian grid!");
+
+  ny = gridInqYsize(gridID1);
+  nx = 2*ny;
+  gridsize = nx*ny;
+
+  gridID2  = gridCreate(GRID_GAUSSIAN, gridsize);
+	  
+  gridDefXsize(gridID2, nx);
+  gridDefYsize(gridID2, ny);
+  
+  xvals = (double *) malloc(nx*sizeof(double));
+  yvals = (double *) malloc(ny*sizeof(double));
+
+  for ( i = 0; i < nx; ++i ) xvals[i] = i * 360./nx;
+  gridInqYvals(gridID1, yvals);
+
+  gridDefXvals(gridID2, xvals);
+  gridDefYvals(gridID2, yvals);
+
+  free(xvals);
+  free(yvals);
+
+  return (gridID2);
+}
+
+static
+void gridCopyMask(int gridID1, int gridID2, long gridsize)
+{
+  if ( gridInqMask(gridID1, NULL) )
+    {
+      int *mask;
+      mask = (int *) malloc(gridsize*sizeof(int));
+      gridInqMask(gridID1, mask);
+      gridDefMask(gridID2, mask);
+      free(mask);
+    }
+}
+
+static
+int check_range(long n, double *vals, double valid_min, double valid_max)
+{
+  int status = 0;
+  long i;
+
+  for ( i = 0; i < n; ++i )
+    {
+      if ( vals[i] < valid_min || vals[i] > valid_max )
+	{
+	  status = 1;
+	  break;
+	}
+    }
+
+  return (status);
+}
+
+
+int gridToCurvilinear(int gridID1, int lbounds)
+{
+  int gridID2;
+  int gridtype, gridsize;
+  long index;
+
+  gridtype = gridInqType(gridID1);
+  gridsize = gridInqSize(gridID1);
+  gridID2  = gridCreate(GRID_CURVILINEAR, gridsize);
+  gridDefPrec(gridID2, DATATYPE_FLT32);
+	  
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_LCC:
+    case GRID_LCC2:
+    case GRID_LAEA:
+    case GRID_SINUSOIDAL:
+      {
+	long i, j;
+	int nx, ny;
+	double *xvals = NULL, *yvals = NULL;
+	double *xvals2D, *yvals2D;
+	double *xbounds = NULL, *ybounds = NULL;
+	double *xbounds2D, *ybounds2D;
+	char xunits[CDI_MAX_NAME], yunits[CDI_MAX_NAME];
+	double xscale = 1, yscale = 1;
+
+	nx = gridInqXsize(gridID1);
+	ny = gridInqYsize(gridID1);
+
+	gridInqXunits(gridID1, xunits);
+	gridInqYunits(gridID1, yunits);
+
+	if ( gridtype == GRID_LAEA )
+	  {
+	    int lvalid_xunits = FALSE;
+	    int lvalid_yunits = FALSE;
+	    int len;
+	    len = (int) strlen(xunits);
+	    if ( len == 1 && memcmp(xunits, "m",  1) == 0 ) lvalid_xunits = TRUE;
+	    if ( len == 1 && memcmp(xunits, "km", 2) == 0 ) lvalid_xunits = TRUE;
+	    len = (int) strlen(yunits);
+	    if ( len == 1 && memcmp(yunits, "m",  1) == 0 ) lvalid_yunits = TRUE;
+	    if ( len == 1 && memcmp(yunits, "km", 2) == 0 ) lvalid_yunits = TRUE;
+
+	    if ( lvalid_xunits == FALSE )
+	      cdoWarning("Possibly wrong result! Invalid x-coordinate units: \"%s\" (expected \"m\" or \"km\")", xunits);
+	    if ( lvalid_yunits == FALSE )
+	      cdoWarning("Possibly wrong result! Invalid y-coordinate units: \"%s\" (expected \"m\" or \"km\")", yunits);
+	  }
+
+	if ( memcmp(xunits, "km", 2) == 0 ) xscale = 1000;
+	if ( memcmp(yunits, "km", 2) == 0 ) yscale = 1000;
+
+	gridDefXsize(gridID2, nx);
+	gridDefYsize(gridID2, ny);
+
+	xvals2D = (double *) malloc(gridsize*sizeof(double));
+	yvals2D = (double *) malloc(gridsize*sizeof(double));
+
+
+	if ( gridtype == GRID_LCC )
+	  {
+	    for ( j = 0; j < ny; j++ )
+	      for ( i = 0; i < nx; i++ )
+		{
+		  xvals2D[j*nx+i] = i+1;
+		  yvals2D[j*nx+i] = j+1;
+		}
+
+	    lcc_to_geo(gridID1, gridsize, xvals2D, yvals2D);
+	  }
+	else
+	  {
+	    if ( ! (gridInqXvals(gridID1, NULL) && gridInqYvals(gridID1, NULL)) )
+	      Error("Grid has no values");
+
+	    xvals = (double *) malloc(nx*sizeof(double));
+	    yvals = (double *) malloc(ny*sizeof(double));
+
+	    gridInqXvals(gridID1, xvals);
+	    gridInqYvals(gridID1, yvals);
+
+	    if ( gridIsRotated(gridID1) )
+	      {
+		double xpole, ypole, angle;
+		
+		xpole = gridInqXpole(gridID1);
+		ypole = gridInqYpole(gridID1);
+		angle = gridInqAngle(gridID1);
+		
+		for ( j = 0; j < ny; j++ )
+		  for ( i = 0; i < nx; i++ )
+		    {
+		      xvals2D[j*nx+i] = lamrot_to_lam(yvals[j], xvals[i], ypole, xpole, angle);
+		      yvals2D[j*nx+i] = phirot_to_phi(yvals[j], xvals[i], ypole, angle);
+		    }	    
+	      }
+	    else
+	      {
+		for ( j = 0; j < ny; j++ )
+		  for ( i = 0; i < nx; i++ )
+		    {
+		      xvals2D[j*nx+i] = xscale*xvals[i];
+		      yvals2D[j*nx+i] = yscale*yvals[j];
+		    }
+
+		if ( gridtype == GRID_SINUSOIDAL )
+		  {
+		    sinusoidal_to_geo(gridsize, xvals2D, yvals2D);
+		    /* correct_sinxvals(nx, ny, xvals2D); */
+		  }
+		else if ( gridtype == GRID_LAEA )
+		  {
+		    laea_to_geo(gridID1, gridsize, xvals2D, yvals2D);
+		  }
+		else if ( gridtype == GRID_LCC2 )
+		  {
+		    lcc2_to_geo(gridID1, gridsize, xvals2D, yvals2D);
+		  }
+	      }
+	  }
+
+	gridDefXvals(gridID2, xvals2D);
+	gridDefYvals(gridID2, yvals2D);
+
+	if ( xvals2D ) free(xvals2D);
+	if ( yvals2D ) free(yvals2D);
+
+	if ( !lbounds ) goto NO_BOUNDS;
+
+	if ( gridtype == GRID_LCC )
+	  {		
+	    xbounds2D = (double *) malloc(4*gridsize*sizeof(double));
+	    ybounds2D = (double *) malloc(4*gridsize*sizeof(double));
+
+	    for ( j = 0; j < ny; j++ )
+	      for ( i = 0; i < nx; i++ )
+		{
+		  index = j*4*nx + 4*i;
+
+		  xbounds2D[index+0] = i+1.5;
+		  ybounds2D[index+0] = j+1.5;
+
+		  xbounds2D[index+1] = i+0.5;
+		  ybounds2D[index+1] = j+1.5;
+
+		  xbounds2D[index+2] = i+0.5;
+		  ybounds2D[index+2] = j+0.5;
+
+		  xbounds2D[index+3] = i+1.5;
+		  ybounds2D[index+3] = j+0.5;
+		}
+
+	    lcc_to_geo(gridID1, 4*gridsize, xbounds2D, ybounds2D);
+
+	    gridDefXbounds(gridID2, xbounds2D);
+	    gridDefYbounds(gridID2, ybounds2D);
+
+	    free(xbounds2D);
+	    free(ybounds2D);
+	  }
+	else
+	  {
+	    if ( gridInqXbounds(gridID1, NULL) )
+	      {
+		xbounds = (double *) malloc(2*nx*sizeof(double));
+		gridInqXbounds(gridID1, xbounds);
+		if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN )
+		  if ( check_range(2*nx, xbounds, -720, 720) )
+		    {
+		      cdoWarning("longitude bounds out of range, skipped!");
+		      free(xbounds);
+		      xbounds = NULL;
+		    }
+	      }
+	    else if ( nx > 1 )
+	      {
+		xbounds = (double *) malloc(2*nx*sizeof(double));
+		gridGenXbounds(nx, xvals, xbounds);
+	      }
+
+	    if ( gridInqYbounds(gridID1, NULL) )
+	      {
+		ybounds = (double *) malloc(2*ny*sizeof(double));
+		gridInqYbounds(gridID1, ybounds);
+		if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN )
+		  if ( check_range(2*ny, ybounds, -180, 180) )
+		    {
+		      cdoWarning("latitude bounds out of range, skipped!");
+		      free(ybounds);
+		      ybounds = NULL;
+		    }
+	      }
+	    else if ( ny > 1 )
+	      {
+		ybounds = (double *) malloc(2*ny*sizeof(double));
+		if ( gridtype == GRID_SINUSOIDAL || 
+		     gridtype == GRID_LAEA       || 
+		     gridtype == GRID_LCC2 )
+		  gridGenYboundsM(ny, yvals, ybounds);
+		else
+		  gridGenYbounds(ny, yvals, ybounds);
+	      }
+
+	    if ( xbounds && ybounds )
+	      {
+		xbounds2D = (double *) malloc(4*gridsize*sizeof(double));
+		ybounds2D = (double *) malloc(4*gridsize*sizeof(double));
+
+		if ( gridIsRotated(gridID1) )
+		  {
+		    gridGenRotBounds(gridID1, nx, ny, xbounds, ybounds, xbounds2D, ybounds2D);
+		  }
+		else
+		  {
+		    if ( gridtype == GRID_SINUSOIDAL ||
+			 gridtype == GRID_LAEA       || 
+			 gridtype == GRID_LCC2 )
+		      {
+			for ( j = 0; j < ny; j++ )
+			  for ( i = 0; i < nx; i++ )
+			    {
+			      index = j*4*nx + 4*i;
+
+			      xbounds2D[index+0] = xscale*xbounds[2*i];
+			      ybounds2D[index+0] = yscale*ybounds[2*j];
+
+			      xbounds2D[index+1] = xscale*xbounds[2*i];
+			      ybounds2D[index+1] = yscale*ybounds[2*j+1];
+
+			      xbounds2D[index+2] = xscale*xbounds[2*i+1];
+			      ybounds2D[index+2] = yscale*ybounds[2*j+1];
+
+			      xbounds2D[index+3] = xscale*xbounds[2*i+1];
+			      ybounds2D[index+3] = yscale*ybounds[2*j];
+			    }
+			
+			if ( gridtype == GRID_SINUSOIDAL )
+			  {
+			    sinusoidal_to_geo(4*gridsize, xbounds2D, ybounds2D);
+			    /*
+			    xvals2D = (double *) malloc(gridsize*sizeof(double));
+			    for ( j = 0; j < 4; ++j )
+			      {
+				for ( i = 0; i < gridsize; ++i ) xvals2D[i] = xbounds2D[i*4+j];
+				correct_sinxvals(nx, ny, xvals2D);
+				for ( i = 0; i < gridsize; ++i ) xbounds2D[i*4+j] = xvals2D[i];
+			      }
+			    free(xvals2D);
+			    */
+			  }
+			else if ( gridtype == GRID_LAEA )
+			  laea_to_geo(gridID1, 4*gridsize, xbounds2D, ybounds2D);
+			else if ( gridtype == GRID_LCC2 )
+			  lcc2_to_geo(gridID1, 4*gridsize, xbounds2D, ybounds2D);
+		      }
+		    else
+		      {
+			gridGenXbounds2D(nx, ny, xbounds, xbounds2D);
+			gridGenYbounds2D(nx, ny, ybounds, ybounds2D);
+		      }
+		  }
+		
+		gridDefXbounds(gridID2, xbounds2D);
+		gridDefYbounds(gridID2, ybounds2D);
+		
+		if ( xbounds )  free(xbounds);
+		if ( ybounds )  free(ybounds);
+		if ( xbounds2D) free(xbounds2D);
+		if ( ybounds2D) free(ybounds2D);
+	      }
+	  }
+
+      NO_BOUNDS:
+
+	if ( xvals ) free(xvals);
+	if ( yvals ) free(yvals);
+
+	gridCopyMask(gridID1, gridID2, gridsize);
+
+	break;
+      }
+    default:
+      {
+	Error("Grid type >%s< unsupported!", gridNamePtr(gridtype));
+	break;
+      }
+    }
+
+  return (gridID2);
+}
+
+
+int gridToUnstructured(int gridID1, int lbounds)
+{
+  int gridID2;
+  int gridtype, gridsize;
+
+  gridtype = gridInqType(gridID1);
+  gridsize = gridInqSize(gridID1);
+  gridID2  = gridCreate(GRID_UNSTRUCTURED, gridsize);
+  gridDefPrec(gridID2, DATATYPE_FLT32);
+	  
+  switch (gridtype)
+    {
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+      {
+	long i, j;
+	int nx, ny;
+	double *xvals, *yvals;
+	double *xvals2D, *yvals2D;
+
+	gridDefXname(gridID2, "lon");
+	gridDefYname(gridID2, "lat");
+	gridDefXlongname(gridID2, "longitude");
+	gridDefYlongname(gridID2, "latitude");
+	gridDefXunits(gridID2, "degrees_east");
+	gridDefYunits(gridID2, "degrees_north");
+
+	gridDefNvertex(gridID2, 4);
+
+	nx = gridInqXsize(gridID1);
+	ny = gridInqYsize(gridID1);
+	 
+	gridDefXsize(gridID2, gridsize);
+	gridDefYsize(gridID2, gridsize);
+
+	xvals = (double *) malloc(nx*sizeof(double));
+	yvals = (double *) malloc(ny*sizeof(double));
+
+	xvals2D = (double *) malloc(gridsize*sizeof(double));
+	yvals2D = (double *) malloc(gridsize*sizeof(double));
+
+	gridInqXvals(gridID1, xvals);
+	gridInqYvals(gridID1, yvals);
+
+	if ( gridIsRotated(gridID1) )
+	  {
+	    double xpole, ypole, angle;
+	    
+	    xpole = gridInqXpole(gridID1);
+	    ypole = gridInqYpole(gridID1);
+	    angle = gridInqAngle(gridID1);
+		
+	    for ( j = 0; j < ny; j++ )
+	      for ( i = 0; i < nx; i++ )
+		{
+		  xvals2D[j*nx+i] = lamrot_to_lam(yvals[j], xvals[i], ypole, xpole, angle);
+		  yvals2D[j*nx+i] = phirot_to_phi(yvals[j], xvals[i], ypole, angle);
+		}
+	  }
+	else
+	  {
+	    for ( j = 0; j < ny; j++ )
+	      for ( i = 0; i < nx; i++ )
+		{
+		  xvals2D[j*nx+i] = xvals[i];
+		  yvals2D[j*nx+i] = yvals[j];
+		}
+	  }
+
+	gridDefXvals(gridID2, xvals2D);
+	gridDefYvals(gridID2, yvals2D);
+
+	free(xvals2D);
+	free(yvals2D);
+
+	if ( lbounds )
+	  {
+	    double *xbounds = NULL, *ybounds = NULL;
+	    double *xbounds2D, *ybounds2D;
+
+	    if ( gridInqXbounds(gridID1, NULL) )
+	      {
+		xbounds = (double *) malloc(2*nx*sizeof(double));
+		gridInqXbounds(gridID1, xbounds);
+	      }
+	    else if ( nx > 1 )
+	      {
+		xbounds = (double *) malloc(2*nx*sizeof(double));
+		gridGenXbounds(nx, xvals, xbounds);
+	      }
+
+	    if ( gridInqYbounds(gridID1, NULL) )
+	      {
+		ybounds = (double *) malloc(2*ny*sizeof(double));
+		gridInqYbounds(gridID1, ybounds);
+	      }
+	    else if ( ny > 1 )
+	      {
+		ybounds = (double *) malloc(2*ny*sizeof(double));
+		gridGenYbounds(ny, yvals, ybounds);
+	      }
+
+	    if ( xbounds && ybounds )
+	      {
+		xbounds2D = (double *) malloc(4*gridsize*sizeof(double));
+		ybounds2D = (double *) malloc(4*gridsize*sizeof(double));
+
+		if ( gridIsRotated(gridID1) )
+		  {
+		    gridGenRotBounds(gridID1, nx, ny, xbounds, ybounds, xbounds2D, ybounds2D);
+		  }
+		else
+		  {
+		    gridGenXbounds2D(nx, ny, xbounds, xbounds2D);
+		    gridGenYbounds2D(nx, ny, ybounds, ybounds2D);
+		  }
+
+		gridDefXbounds(gridID2, xbounds2D);
+		gridDefYbounds(gridID2, ybounds2D);
+
+		free(xbounds);
+		free(ybounds);
+		free(xbounds2D);
+		free(ybounds2D);
+	      }
+	    }
+
+	free(xvals);
+	free(yvals);
+
+	gridCopyMask(gridID1, gridID2, gridsize);
+
+	break;
+      }
+    case GRID_CURVILINEAR:
+      {
+	gridID2 = gridDuplicate(gridID1);
+	gridChangeType(gridID2, GRID_UNSTRUCTURED);
+	gridDefXsize(gridID2, gridsize);
+	gridDefYsize(gridID2, gridsize);
+
+	break;
+      }
+    case GRID_GME:
+      {
+	int nd, ni, ni2, ni3;
+	long i, j;
+	int nv = 6;
+	int *imask;
+	double *xvals, *yvals;
+	double *xbounds = NULL, *ybounds = NULL;
+
+	nd  = gridInqGMEnd(gridID1);
+	ni  = gridInqGMEni(gridID1);
+	ni2 = gridInqGMEni2(gridID1);
+	ni3 = gridInqGMEni3(gridID1);
+
+	imask   = (int *) malloc(gridsize*sizeof(int));
+	xvals   = (double *) malloc(gridsize*sizeof(double));
+	yvals   = (double *) malloc(gridsize*sizeof(double));
+	if ( lbounds )
+	  {
+	    xbounds = (double *) malloc(nv*gridsize*sizeof(double));
+	    ybounds = (double *) malloc(nv*gridsize*sizeof(double));
+	  }
+
+	gme_grid(lbounds, gridsize, xvals, yvals, xbounds, ybounds, imask, ni, nd, ni2, ni3);
+	
+	for ( i = 0; i < gridsize; i++ )
+	  {
+	    xvals[i] *= RAD2DEG;
+	    yvals[i] *= RAD2DEG;
+
+	    if ( lbounds )
+	      for ( j = 0; j < nv; j++ )
+		{
+		  xbounds[i*nv + j] *= RAD2DEG;
+		  ybounds[i*nv + j] *= RAD2DEG;
+		}
+	    /* printf("%d %g %g\n", i, xvals[i], yvals[i]); */
+	  }
+	
+	gridDefXsize(gridID2, gridsize);
+	gridDefYsize(gridID2, gridsize);
+
+	gridDefXvals(gridID2, xvals);
+	gridDefYvals(gridID2, yvals);
+
+	gridDefMaskGME(gridID2, imask);
+
+	gridDefNvertex(gridID2, nv);
+
+	if ( lbounds )
+	  {
+	    gridDefXbounds(gridID2, xbounds);
+	    gridDefYbounds(gridID2, ybounds);
+	  }
+
+	gridDefXunits(gridID2, "degrees_east");
+	gridDefYunits(gridID2, "degrees_north");
+
+	free (imask);
+	free (xvals);
+	free (yvals);
+	if ( xbounds ) free (xbounds);
+	if ( ybounds ) free (ybounds);
+	
+	gridCopyMask(gridID1, gridID2, gridsize);
+
+	break;
+      }
+    default:
+      {
+	Error("Grid type >%s< unsupported!", gridNamePtr(gridtype));
+	break;
+      }
+    }
+
+  return (gridID2);
+}
+
+
+int gridCurvilinearToRegular(int gridID1)
+{
+  int gridID2 = -1;
+  int gridtype, gridsize;
+  long index;
+  long i, j;
+  int nx, ny;
+  int lx = TRUE, ly = TRUE;
+  double *xvals = NULL, *yvals = NULL;
+  double *xvals2D = NULL, *yvals2D = NULL;
+	
+  gridtype = gridInqType(gridID1);
+  gridsize = gridInqSize(gridID1);
+
+  if ( gridtype != GRID_CURVILINEAR ) return (gridID2);
+
+  nx = gridInqXsize(gridID1);
+  ny = gridInqYsize(gridID1);
+	
+  xvals2D = (double *) malloc(gridsize*sizeof(double));
+  yvals2D = (double *) malloc(gridsize*sizeof(double));
+
+  gridInqXvals(gridID1, xvals2D);
+  gridInqYvals(gridID1, yvals2D);
+
+  xvals = (double *) malloc(nx*sizeof(double));
+  yvals = (double *) malloc(ny*sizeof(double));
+
+  for ( i = 0; i < nx; i++ ) xvals[i] = xvals2D[i];
+  for ( j = 0; j < ny; j++ ) yvals[j] = yvals2D[j*nx];
+
+  for ( j = 1; j < ny; j++ )
+    for ( i = 0; i < nx; i++ )
+      {
+	if ( IS_NOT_EQUAL(xvals[i], xvals2D[j*nx+i]) )
+	  {
+	    lx = FALSE;
+	    j = ny;
+	    break;
+	  }
+      }
+	
+  for ( i = 1; i < nx; i++ )
+    for ( j = 0; j < ny; j++ )
+      {
+	if ( IS_NOT_EQUAL(yvals[j], yvals2D[j*nx+i]) )
+	  {
+	    ly = FALSE;
+	    i = nx;
+	    break;
+	  }
+      }
+
+  free(xvals2D);
+  free(yvals2D);
+
+  if ( lx && ly )
+    {
+      char xunits[CDI_MAX_NAME], yunits[CDI_MAX_NAME];
+      
+      gridID2  = gridCreate(GRID_LONLAT, gridsize);
+      gridDefXsize(gridID2, nx);
+      gridDefYsize(gridID2, ny);
+      
+      //  gridDefPrec(gridID2, DATATYPE_FLT32);
+
+      gridInqXunits(gridID1, xunits);
+      gridInqYunits(gridID1, yunits);
+
+      gridToDegree(xunits, "grid1 center lon", nx, xvals);
+      gridToDegree(yunits, "grid1 center lat", ny, yvals);
+
+      gridDefXvals(gridID2, xvals);
+      gridDefYvals(gridID2, yvals);
+    }
+
+  free(xvals);
+  free(yvals);
+
+  return (gridID2);
+}
+
+
+int referenceToGrid(int gridID1)
+{
+  int gridID2 = -1;
+  int gridtype, gridsize;
+  int offset = 7;
+  char gridfile[8912];
+
+  gridsize = gridInqSize(gridID1);
+
+  if ( gridInqReference(gridID1, NULL) )
+    {
+      int streamID;
+      int number, position;
+
+      number = gridInqNumber(gridID1);
+      position = gridInqPosition(gridID1);
+      gridInqReference(gridID1, gridfile);
+
+      if ( gridfile[offset] != '/' ) offset--;
+      streamID = streamOpenRead(&gridfile[offset]);
+      if ( streamID >= 0 )
+	{
+	  int vlistID, gridID = -1;
+	  int ngrids;
+	  vlistID = streamInqVlist(streamID);
+	  ngrids = vlistNgrids(vlistID);
+	  if ( position > 0 && position <= ngrids )
+	    {
+	      gridID = vlistGrid(vlistID, position-1);
+	      if ( gridInqSize(gridID) == gridsize )
+		gridID2 = gridDuplicate(gridID);
+	      else
+		cdoWarning("Grid size %d on position %d do not match! Reference=%s", gridsize, position, gridfile);
+	    }
+	  else
+	    cdoWarning("Grid position %d not available! Reference=%s", position, gridfile);
+
+	  streamClose(streamID);
+	}
+      else
+	cdoWarning("Reference to grid not found! Path=%s", gridfile);
+    }
+  else
+    {
+      cdoWarning("No reference to grid found!");
+    }
+
+  return (gridID2);
+}
+
+
+static
+double areas(struct cart *dv1, struct cart *dv2, struct cart *dv3)
+{
+  double a1, a2, a3;
+  double ca1, ca2, ca3;
+  double s12, s23, s31;
+
+  struct cart u12, u23, u31;
+
+  double areas;
+
+  /* compute cross products Uij = Vi X Vj */
+
+  u12.x[0] = dv1->x[1]*dv2->x[2] - dv1->x[2]*dv2->x[1];
+  u12.x[1] = dv1->x[2]*dv2->x[0] - dv1->x[0]*dv2->x[2];
+  u12.x[2] = dv1->x[0]*dv2->x[1] - dv1->x[1]*dv2->x[0];
+  
+  u23.x[0] = dv2->x[1]*dv3->x[2] - dv2->x[2]*dv3->x[1];
+  u23.x[1] = dv2->x[2]*dv3->x[0] - dv2->x[0]*dv3->x[2];
+  u23.x[2] = dv2->x[0]*dv3->x[1] - dv2->x[1]*dv3->x[0];
+  
+  u31.x[0] = dv3->x[1]*dv1->x[2] - dv3->x[2]*dv1->x[1];
+  u31.x[1] = dv3->x[2]*dv1->x[0] - dv3->x[0]*dv1->x[2];
+  u31.x[2] = dv3->x[0]*dv1->x[1] - dv3->x[1]*dv1->x[0];
+  
+  /* normalize Uij to unit vectors */
+  
+  s12 = u12.x[0]*u12.x[0]+u12.x[1]*u12.x[1]+u12.x[2]*u12.x[2];
+  s23 = u23.x[0]*u23.x[0]+u23.x[1]*u23.x[1]+u23.x[2]*u23.x[2];
+  s31 = u31.x[0]*u31.x[0]+u31.x[1]*u31.x[1]+u31.x[2]*u31.x[2];
+
+  /* test for a degenerate triangle associated with collinear vertices */
+  
+  if ( !(fabs(s12) > 0.0) || !(fabs(s23) > 0.0) || !(fabs(s31) > 0.0) ) {
+    areas = 0.0;
+    return areas;
+  }
+
+  s12 = sqrt(s12);
+  s23 = sqrt(s23);
+  s31 = sqrt(s31);
+  
+  u12.x[0] = u12.x[0]/s12; u12.x[1] = u12.x[1]/s12; u12.x[2] = u12.x[2]/s12;
+  u23.x[0] = u23.x[0]/s23; u23.x[1] = u23.x[1]/s23; u23.x[2] = u23.x[2]/s23;
+  u31.x[0] = u31.x[0]/s31; u31.x[1] = u31.x[1]/s31; u31.x[2] = u31.x[2]/s31;
+  
+  /*
+   *  Compute interior angles Ai as the dihedral angles between planes:
+   *  CA1 = cos(A1) = -<U12,U31>
+   *  CA2 = cos(A2) = -<U23,U12>
+   *  CA3 = cos(A3) = -<U31,U23>
+   */
+
+  ca1 = -( u12.x[0]*u31.x[0]+u12.x[1]*u31.x[1]+u12.x[2]*u31.x[2] );
+  ca2 = -( u23.x[0]*u12.x[0]+u23.x[1]*u12.x[1]+u23.x[2]*u12.x[2] );
+  ca3 = -( u31.x[0]*u23.x[0]+u31.x[1]*u23.x[1]+u31.x[2]*u23.x[2] );
+
+#if ! defined (FMAX)
+#define  FMAX(a,b)  ((a) > (b) ? (a) : (b))
+#endif
+#if ! defined (FMIN)
+#define  FMIN(a,b)  ((a) < (b) ? (a) : (b))
+#endif
+
+  ca1 = FMAX(ca1, -1.0);
+  ca1 = FMIN(ca1, +1.0);
+  ca2 = FMAX(ca2, -1.0);
+  ca2 = FMIN(ca2, +1.0);
+  ca3 = FMAX(ca3, -1.0);
+  ca3 = FMIN(ca3, +1.0);
+  
+  a1 = acos(ca1);
+  a2 = acos(ca2);
+  a3 = acos(ca3);
+  
+  /* compute AREAS = A1 + A2 + A3 - PI */
+  
+  areas = a1 + a2 + a3 - M_PI;
+
+  if ( areas < 0.0 ) {
+    areas = 0.0;
+  }
+
+  return areas;
+}
+
+static
+double cell_area(long i, long nv, double *grid_center_lon, double *grid_center_lat,
+		 double *grid_corner_lon, double *grid_corner_lat, int *status)
+{
+  long k;
+  double xa;
+  double area;
+  struct geo p1, p2, p3;
+  struct cart c1, c2, c3;
+
+  area = 0;
+      
+  p3.lon = grid_center_lon[i]; 
+  p3.lat = grid_center_lat[i];
+  c3 = gc2cc(&p3);
+      
+  for ( k = 1; k < nv; ++k )
+    {
+      p1.lon = grid_corner_lon[i*nv+k-1]; 
+      p1.lat = grid_corner_lat[i*nv+k-1];
+      c1 = gc2cc(&p1);
+      p2.lon = grid_corner_lon[i*nv+k]; 
+      p2.lat = grid_corner_lat[i*nv+k];
+      c2 = gc2cc(&p2);
+
+      xa = areas(&c1, &c2, &c3);
+      area += xa;
+    }
+
+  p1.lon = grid_corner_lon[i*nv+0]; 
+  p1.lat = grid_corner_lat[i*nv+0];
+  c1 = gc2cc(&p1);
+  p2.lon = grid_corner_lon[i*nv+nv-1]; 
+  p2.lat = grid_corner_lat[i*nv+nv-1];
+  c2 = gc2cc(&p2);
+
+  xa = areas(&c1, &c2, &c3);
+  area += xa;
+
+  return (area);
+}
+
+
+int gridGenArea(int gridID, double *area)
+{
+  int status = 0;
+  int gridtype;
+  int lgrid_gen_bounds = FALSE;
+  int lgriddestroy = FALSE;
+  long i;
+  long nv, gridsize;
+  double total_area;
+  double *grid_center_lon = NULL;
+  double *grid_center_lat = NULL;
+  double *grid_corner_lon = NULL;
+  double *grid_corner_lat = NULL;
+  int *grid_mask = NULL;
+
+  gridsize = gridInqSize(gridID);
+  gridtype = gridInqType(gridID);
+
+  if ( gridtype != GRID_LONLAT      &&
+       gridtype != GRID_GAUSSIAN    &&
+       gridtype != GRID_LCC         &&
+       gridtype != GRID_LCC2        &&
+       gridtype != GRID_LAEA        &&
+       gridtype != GRID_SINUSOIDAL  &&
+       gridtype != GRID_GME         &&
+       gridtype != GRID_REFERENCE   &&
+       gridtype != GRID_CURVILINEAR &&
+       gridtype != GRID_UNSTRUCTURED )
+    {
+      cdoAbort("Internal error! Unsupported gridtype: %s", gridNamePtr(gridtype)); 
+    }
+
+  if ( gridtype != GRID_UNSTRUCTURED && gridtype != GRID_CURVILINEAR )
+    {
+      if ( gridtype == GRID_GME )
+	{
+	  lgriddestroy = TRUE;
+	  gridID = gridToUnstructured(gridID, 1);
+	  grid_mask = (int *) malloc(gridsize*sizeof(int));
+	  gridInqMaskGME(gridID, grid_mask);
+	}
+      else if ( gridtype == GRID_REFERENCE )
+	{
+	  lgriddestroy = TRUE;
+	  gridID = referenceToGrid(gridID);
+	  if ( gridID == -1 ) return (1);
+	}
+      else
+	{
+	  lgriddestroy = TRUE;
+	  gridID = gridToCurvilinear(gridID, 1);
+	  lgrid_gen_bounds = TRUE;
+	}
+    }
+
+  gridtype = gridInqType(gridID);
+
+  if ( gridtype == GRID_UNSTRUCTURED )
+    nv = gridInqNvertex(gridID);
+  else
+    nv = 4;
+  
+  grid_center_lon = (double *) malloc(gridsize*sizeof(double));
+  grid_center_lat = (double *) malloc(gridsize*sizeof(double));
+
+  gridInqXvals(gridID, grid_center_lon);
+  gridInqYvals(gridID, grid_center_lat);
+
+  grid_corner_lon = (double *) malloc(nv*gridsize*sizeof(double));
+  grid_corner_lat = (double *) malloc(nv*gridsize*sizeof(double));
+
+  if ( gridInqYbounds(gridID, NULL) && gridInqXbounds(gridID, NULL) )
+    {
+      gridInqXbounds(gridID, grid_corner_lon);
+      gridInqYbounds(gridID, grid_corner_lat);
+    }
+  else
+    {
+      if ( lgrid_gen_bounds )
+	{
+	  int nlon = gridInqXsize(gridID);
+	  int nlat = gridInqYsize(gridID);
+	  double dlon = 0;
+	  if ( nlon == 1 )
+	    {
+	      dlon = 1;
+	    }
+	  genXbounds(nlon, nlat, grid_center_lon, grid_corner_lon, dlon);
+	  genYbounds(nlon, nlat, grid_center_lat, grid_corner_lat);
+	}
+      else
+	{
+	  status = 1;
+	  return (status);
+	}
+    }
+  
+  /* Convert lat/lon units if required */
+  {
+    char units[CDI_MAX_NAME];
+
+    gridInqXunits(gridID, units);
+
+    if ( memcmp(units, "radian", 6) == 0 )
+      {
+	/* No conversion necessary */
+      }
+    else if ( memcmp(units, "degree", 6) == 0 )
+      {
+	for ( i = 0; i < gridsize; ++i )
+	  {
+	    grid_center_lon[i] *= deg2rad;
+	    grid_center_lat[i] *= deg2rad;
+	  }
+	for ( i = 0; i < gridsize*nv; ++i )
+	  {
+	    grid_corner_lon[i] *= deg2rad;
+	    grid_corner_lat[i] *= deg2rad;
+	  }
+      }
+    else
+      {
+	cdoWarning("Unknown units supplied for grid1 center lat/lon: proceeding assuming radians");
+      }
+  }
+
+  if ( lgriddestroy ) gridDestroy(gridID);
+
+  total_area = 0;
+#if defined (_OPENMP)
+#pragma omp parallel for default(none)        \
+  shared(gridsize, area, nv, grid_center_lon, grid_center_lat, grid_corner_lon, grid_corner_lat, status) \
+  private(i)
+#endif
+  for ( i = 0; i < gridsize; ++i )
+    {
+      area[i] = cell_area(i, nv, grid_center_lon, grid_center_lat, grid_corner_lon, grid_corner_lat, &status);
+      /*
+      if (  area[i] < 0.009 && fabs(grid_corner_lat[i*nv+1]) > 89)
+      printf("%d %g %g %g %g %g %g %g %g %g\n", i, area[i]*6371000*6371000, grid_center_lon[i], grid_center_lat[i],
+	     grid_corner_lon[i*nv], grid_corner_lat[i*nv],
+	     grid_corner_lon[i*nv+1], grid_corner_lat[i*nv+1],
+	     grid_corner_lon[i*nv+2], grid_corner_lat[i*nv+2]);
+      */
+      //     total_area += area[i];
+    }
+
+  //  if ( cdoVerbose ) cdoPrint("Total area = %g", total_area);
+
+  free(grid_center_lon);
+  free(grid_center_lat);
+  free(grid_corner_lon);
+  free(grid_corner_lat);
+  if ( grid_mask ) free(grid_mask);
+
+  return (status);
+}
+
+
+int gridGenWeights(int gridID, double *grid_area, double *grid_wgts)
+{
+  int i, nvals, gridsize, gridtype;
+  int status = 0;
+  int *grid_mask = NULL;
+  double total_area;
+
+  gridtype = gridInqType(gridID);
+  gridsize = gridInqSize(gridID);
+  
+  if ( gridtype == GRID_GME )
+    {
+      gridID = gridToUnstructured(gridID, 1);	  
+      grid_mask = (int *) malloc(gridsize*sizeof(int));
+      gridInqMaskGME(gridID, grid_mask);
+    }
+
+  total_area = 0;
+  nvals = 0;
+  for ( i = 0; i < gridsize; i++ )
+    {
+      if ( grid_mask )
+	if ( grid_mask[i] == 0 ) continue;
+      total_area += grid_area[i];
+      nvals++;
+    }
+
+  if ( cdoVerbose ) cdoPrint("Total area = %g", total_area);
+
+  for ( i = 0; i < gridsize; i++ )
+    {
+      if ( grid_mask )
+	if ( grid_mask[i] == 0 )
+	  {
+	    grid_wgts[i] = 0;
+	    continue;
+	  }
+      
+      grid_wgts[i] = grid_area[i] / total_area;
+    }
+  
+  if ( grid_mask ) free(grid_mask);
+
+  return (status);
+}
+
+
+static
+int gridWeightsOld(int gridID, double *weights)
+{
+  int status = FALSE;
+  long i, j;
+  int len;
+
+  len = gridInqSize(gridID);
+
+  if ( gridHasArea(gridID) )
+    {
+      gridInqArea(gridID, weights);
+    }
+  else
+    {
+      int gridtype = gridInqType(gridID);
+
+      if ( gridtype == GRID_LONLAT || gridtype == GRID_GAUSSIAN )
+	{
+	  int     nlat, nlon;
+	  int     datapoint;
+	  double *lats = NULL, *lons = NULL;
+	  double sumw;
+	  double phi1, phi2, theta1, theta2, sindphi;
+
+	  nlon = gridInqXsize(gridID);
+	  nlat = gridInqYsize(gridID);
+
+	  lons = 1 + (double *) malloc((nlon+2)*sizeof(double));
+	  lats = 1 + (double *) malloc((nlat+2)*sizeof(double));
+
+	  gridInqXvals(gridID, lons);
+	  gridInqYvals(gridID, lats);
+
+	  /* Interpolate to find latitudes outside boundaries. */
+	  lats[-1]   = 2*lats[0] - lats[1];
+	  lats[nlat] = 2*lats[nlat-1] - lats[nlat-2];
+	  lons[-1]   = 2*lons[0] - lons[1];
+	  lons[nlon] = 2*lons[nlon-1] - lons[nlon-2];
+  
+	  /*  Calculate weights.  */
+	  /*  phi 1 and 2 and theta 1 and 2 represent respectively the boundary */
+	  /*  latitudes and longitudes of a particular grid square.             */
+	  datapoint = 0;
+	  sumw = 0;
+	  for ( j = 0; j < nlat; j++ )
+	    {
+	      phi1 = (lats[j-1]+lats[j])/2*deg2rad;
+	      phi2 = (lats[j+1]+lats[j])/2*deg2rad;
+	      if ( phi1 < (-1*M_PI/2) ) phi1 = -1*M_PI/2;
+	      if ( phi1 > (   M_PI/2) ) phi1 =    M_PI/2;
+	      if ( phi2 > (   M_PI/2) ) phi2 =    M_PI/2;
+	      if ( phi2 < (-1*M_PI/2) ) phi2 = -1*M_PI/2;
+	      sindphi = sin(phi2)-sin(phi1);
+	      for( i = 0; i < nlon; i++ )
+		{
+		  if ( lons[i] >= lons[0]+360 || fabs(lats[j]) > 90 )
+		    weights[datapoint] = 0;
+		  else
+		    {
+		      theta1 = (lons[i-1]+lons[i])/2*deg2rad;
+		      theta2 = (lons[i+1]+lons[i])/2*deg2rad;
+		      weights[datapoint] = fabs((theta2-theta1)*sindphi);
+		      sumw += weights[datapoint];
+		    }
+		  datapoint++;
+		}
+	    }
+
+	  /* Normalise weights.  */
+	  if( IS_NOT_EQUAL(sumw, 0) )
+	    for( i = 0; i < datapoint; i++ ) weights[i] /= sumw;
+
+	  if ( lons-1 ) free(lons-1);
+	  if ( lats-1 ) free(lats-1);
+	}
+      else
+	{
+	  status = TRUE;
+
+	  for ( i = 0; i < len; i++ ) weights[i] = 1./len;
+	}
+    }
+
+  return (status);
+}
+
+
+int gridWeights(int gridID, double *grid_wgts)
+{
+  int i, gridsize, gridtype;
+  int a_status, w_status;
+  double *grid_area;
+
+  gridtype = gridInqType(gridID);
+  gridsize = gridInqSize(gridID);
+  
+  grid_area = (double *) malloc(gridsize*sizeof(double));
+
+  a_status = 0;
+
+  if ( gridHasArea(gridID) )
+    {
+      if ( cdoVerbose ) cdoPrint("Using existing grid cell area!");
+      gridInqArea(gridID, grid_area);
+    }
+  else
+    {
+      if ( gridtype == GRID_LONLAT      ||
+	   gridtype == GRID_GAUSSIAN    ||
+	   gridtype == GRID_LCC         ||
+	   gridtype == GRID_LCC2        ||
+	   gridtype == GRID_LAEA        ||
+	   gridtype == GRID_SINUSOIDAL  ||
+	   gridtype == GRID_GME         ||
+	   gridtype == GRID_REFERENCE   ||
+	   gridtype == GRID_CURVILINEAR ||
+	   gridtype == GRID_UNSTRUCTURED )
+	{
+	  a_status = gridGenArea(gridID, grid_area);
+	}
+      else
+	{
+	  a_status = 1;
+	}
+    }
+
+  if ( a_status == 0 )
+    {
+      w_status = gridGenWeights(gridID, grid_area, grid_wgts);
+    }
+  else
+    {
+      for ( i = 0; i < gridsize; ++i )
+	grid_wgts[i] = 1./gridsize;
+
+      w_status = 1;
+    }
+  /*
+  for ( i = 0; i < gridsize; ++i ) 
+    printf("weights: %d %d %d %g %g\n", a_status, w_status, i, grid_area[i], grid_wgts[i]);
+  */
+  free(grid_area);
+
+  return (w_status);
+}
diff --git a/src/grid.h b/src/grid.h
new file mode 100644
index 0000000..bd6fc80
--- /dev/null
+++ b/src/grid.h
@@ -0,0 +1,84 @@
+#ifndef _GRID_H
+#define _GRID_H
+
+#define  deg2rad  (M_PI/180.)   /* conversion for deg to rad */
+#define  rad2deg  (180./M_PI)   /* conversion for rad to deg */
+
+
+int referenceToGrid(int gridID);
+void gridToDegree(const char *units, const char *string, int gridsize, double *array);
+int gridToZonal(int gridID);
+int gridToMeridional(int gridID);
+int gridToUnstructured(int gridID, int lbounds);
+int gridToCurvilinear(int gridID, int lbounds);
+int gridCurvilinearToRegular(int gridID);
+int gridToRegular(int gridID);
+void field2regular(int gridID1, int gridID2, double missval, double *array, int nmiss);
+
+/* GME grid */
+struct cart {
+  double x[3];
+};
+
+struct geo {
+  double lon;
+  double lat;
+};
+
+void correct_sinxvals(int xsize, int ysize, double *xvals);
+
+struct cart gc2cc(struct geo *position);
+void factorni(int kni, int *kni2, int *kni3);
+void gme_grid_restore(double *p, int ni, int nd);
+void gme_grid(int lbounds, int gridsize, double *rlon, double *rlat,
+	      double *blon, double *blat, int *imask,
+              int ni, int nd, int ni2, int ni3);
+
+/* Rotated grid */
+double lamrot_to_lam(double phis, double rlas, double polphi, double pollam, double polgam);
+double phirot_to_phi(double phis, double rlas, double polphi, double polgam);
+double rl_to_rls(double phi, double rla, double polphi, double pollam);
+double ph_to_phs(double phi, double rla, double polphi, double pollam);
+void usvs_to_uv(double us, double vs, double phi, double rla,
+		double polphi, double pollam, double *u, double *v);
+
+
+// Projection codes for proj_info structure:
+#define PROJ_LATLON  0
+#define PROJ_MERC    1
+#define PROJ_LC      3
+#define PROJ_PS      5
+
+
+typedef struct {
+  int       code;     // Integer code for projection type
+  double    lat1;     // SW latitude (1,1) in degrees (-90->90N)
+  double    lon1;     // SW longitude (1,1) in degrees (-180->180E)
+  double    dx;       // Grid spacing in meters at truelats, used
+                      // only for ps, lc, and merc projections
+  double    dlat;     // Lat increment for lat/lon grids
+  double    dlon;     // Lon increment for lat/lon grids
+  double    stdlon;   // Longitude parallel to y-axis (-180->180E)
+  double    truelat1; // First true latitude (all projections)
+  double    truelat2; // Second true lat (LC only)
+  double    cone;     // Cone factor for LC projections
+  double    polei;    // Computed i-location of pole point
+  double    polej;    // Computed j-location of pole point
+  double    rsw;      // Computed radius to SW corner
+  double    rebydx;   // Earth radius divided by dx
+  int       hemi;     // 1 for NH, -1 for SH
+  int       init;     // Flag to indicate if this struct is ready for use
+} proj_info_t;
+
+/* Lambert Conformal grid (new version) */
+void map_set(int proj_code, double lat1, double lon1, double dx, double stdlon,
+	     double truelat1, double truelat2, proj_info_t *proj);
+void ijll_lc(double i, double j, proj_info_t proj, double *lat, double *lon);
+
+/* Lambert Conformal grid (old version) */
+/*
+int W3FB12(double xi, double xj, double alat1, double elon1, double dx,
+	   double elonv, double alatan, double *alat, double *elon);
+*/
+
+#endif  /* _GRID_H */
diff --git a/src/grid_gme.c b/src/grid_gme.c
new file mode 100644
index 0000000..ef2795a
--- /dev/null
+++ b/src/grid_gme.c
@@ -0,0 +1,1590 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+
+#ifndef M_PI
+#define M_PI		3.14159265358979323846	/* pi */
+#endif
+
+struct dimension {
+  int lower;
+  int extent;
+  int mult;
+};
+
+struct array {
+  char *addr;
+  int rank;
+  int offset;
+  struct dimension dim[3];  
+};
+
+struct cart {
+  double x[3];
+};
+
+struct geo {
+  double lon;
+  double lat;
+};
+
+struct polygon {
+  int type;
+  struct geo center;
+  struct geo boundary[6];
+};
+
+const double pid5   =   0.2*M_PI;
+const double pid180 = 180.0/M_PI;
+
+const int ispokes[12] = { 1,0,-1,-1,0,1,0,1,1,0,-1,-1,};
+
+const int pentagon = 5;
+const int hexagon  = 6;
+
+/*****************************************************************************/
+
+void factorni(int kni, int *kni2, int *kni3)
+{
+  /**********************************************************************/
+  /* factorni computes the factors of the integer input kni, assuming   */ 
+  /* that kni decomposes into kni3 factors (kni3 either 0 or 1) of "3"  */
+  /* and kni2 (kni2 > 0) factors of "2". The subroutine returns the     */
+  /* number of factors of "3", kni3, number of factors of "2", kni2.    */
+  /* Bails out in case of error.                                        */
+  /**********************************************************************/
+  /*  Author: D. Majewski, DWD, January 2000                            */
+  /**********************************************************************/ 
+  /*  Input                                                             */
+  /*  kni     INT   number of intervals on a main triangle side         */
+  /**********************************************************************/
+  /*  Output                                                            */
+  /*  kni2    INT      exponent of "2", kni2 > 0                        */ 
+  /*  kni3    INT      exponent of "3", either 0 or 1                   */
+  /**********************************************************************/
+
+  int mx;
+
+  mx = kni;
+  
+  *kni2  = 0;
+  *kni3  = 0;
+
+  while (mx > 1) { 
+      if (mx%2 == 0) {
+	*kni2 = *kni2 + 1;
+	mx    = mx/2;
+      } else if (mx%3 == 0) {
+	*kni3 = *kni3 + 1;
+	mx    = mx/3;
+      } else {
+	/* error return */
+      }
+  }
+
+  /* kni3 must not be greater than */
+  
+  if (*kni3 > 1) {
+    /* error return */
+  }
+}
+
+/*****************************************************************************/
+
+static
+int pow_ii(int x, int n)
+{
+  int pow;
+  
+  if (n <= 0) {
+    if (n == 0 || x == 1)
+      return 1;
+    if (x != -1)
+      return x == 0 ? 1/x : 0;
+    n = -n;
+  }
+  for (pow = 1; ;) {
+    if (n & 01)
+      pow *= x;
+    if (n >>= 1)
+      x *= x;
+    else
+      break;
+  }
+  
+  return (pow);
+}
+
+/*****************************************************************************/
+
+static
+struct cart circum_center(struct cart *v0, struct cart *v1, struct cart *v2)
+{
+  double cnorm;
+
+  struct cart center;
+  struct cart e1;
+  struct cart e2;
+  struct cart cu;
+
+  double *ptmp1;
+  double *ptmp2;
+  double *ptmp3;
+
+  int j;
+
+  ptmp1 = ((double *)e1.x);
+  ptmp2 = ((double *)v1->x);
+  ptmp3 = ((double *)v0->x);
+
+  for (j = 0; j < 3; j++) {
+    {
+      *ptmp1 = *ptmp2 - *ptmp3;
+      ptmp1++;
+    }
+    ptmp3++;
+    ptmp2++;
+  }
+  
+  ptmp1 = ((double *)e2.x);
+  ptmp2 = ((double *)v2->x);
+  ptmp3 = ((double *)v0->x);
+  for (j = 0; j < 3; j++) {
+    { 
+      *ptmp1 = *ptmp2 - *ptmp3;
+      ptmp1++;
+    }
+    ptmp3++;
+    ptmp2++;
+  }
+
+  cu.x[0] = e1.x[1]*e2.x[2] - e1.x[2]*e2.x[1];
+  cu.x[1] = e1.x[2]*e2.x[0] - e1.x[0]*e2.x[2];
+  cu.x[2] = e1.x[0]*e2.x[1] - e1.x[1]*e2.x[0];
+
+  cnorm = sqrt(cu.x[0]*cu.x[0] 
+	      +cu.x[1]*cu.x[1] 
+	      +cu.x[2]*cu.x[2]);
+
+  ptmp1 = ((double *)center.x);
+  ptmp2 = ((double *)cu.x);
+  for (j = 0; j < 3; j++) {
+    {
+      *ptmp1 = *ptmp2/cnorm;
+      ptmp1++;
+    }
+    ptmp2++;
+  }
+  
+  return (center);
+}
+
+/*****************************************************************************/
+
+struct cart gc2cc(struct geo *position)
+{
+  double cln;
+  double sln;
+  double clt;
+  double slt;
+  
+  struct cart x;
+
+  sln = sin(position->lon);
+  cln = cos(position->lon);
+  slt = sin(position->lat);
+  clt = cos(position->lat);
+
+  x.x[0] = cln*clt;
+  x.x[1] = sln*clt;
+  x.x[2] = slt;
+
+  return (x);
+}
+
+/*****************************************************************************/
+
+static
+struct geo cc2gc(struct cart *x)
+{
+  struct geo position;
+
+  double tln;
+  double tlt;
+  double r;
+
+  if ( !(fabs(x->x[0]) > 0.0) ) {
+    if (x->x[1] >= 0.0) {
+      position.lon = 0.5*M_PI;
+    } else {
+      position.lon = 1.5*M_PI;
+    }
+  } else {
+    tln = x->x[1]/x->x[0];
+    position.lon = atan(tln);
+    if (x->x[0] < 0.0) {
+      position.lon = position.lon + M_PI;
+    }
+    if (position.lon < 0.0) {
+      position.lon = position.lon + 2*M_PI;
+    }
+  }
+
+  r = sqrt(x->x[0]*x->x[0] + x->x[1]*x->x[1]);
+
+  if ( !(fabs(r) > 0.0) ) {
+    if (x->x[2] > 0.0) {
+      position.lat =  0.5*M_PI;
+    } else {
+      position.lat = -0.5*M_PI;
+    }
+  } else {
+    tlt = x->x[2]/r;
+    position.lat = atan(tlt);
+  }
+
+  return (position);
+}
+
+/*****************************************************************************/
+
+static
+void boundary(struct polygon *poly, 
+              int kip1s, int kip1e, int kip2s, int kip2e, int knd)
+{
+  struct polygon *ptmp1;
+
+  struct cart c;
+  struct cart x1;
+  struct cart x2;
+  struct cart v[6];
+
+  int j1, j2, jd;
+  int jm, jm1, jm2;
+
+  struct array polyinfo;
+
+  int tmp1, tmp2, tmp3, tmp4, tmp5;
+
+  polyinfo.rank = 3;
+  polyinfo.offset = 0;
+  polyinfo.dim[0].lower = kip1s;
+  tmp1 = kip1e - polyinfo.dim[0].lower + 1;
+  if (tmp1 < 0) tmp1 = 0;
+  polyinfo.dim[0].extent = tmp1;
+  polyinfo.dim[0].mult = 1;
+  polyinfo.offset -= polyinfo.dim[0].lower;
+  tmp2 = tmp1;
+  polyinfo.dim[1].lower = kip2s;
+  tmp1 = kip2e - polyinfo.dim[1].lower + 1;
+  if (tmp1 < 0) tmp1 = 0;
+  polyinfo.dim[1].extent = tmp1;
+  polyinfo.dim[1].mult = tmp2;
+  polyinfo.offset -= polyinfo.dim[1].lower*polyinfo.dim[1].mult;
+  tmp2 *= tmp1;
+  polyinfo.dim[2].lower = 1;
+  tmp1 = knd;
+  if (tmp1 < 0) tmp1 = 0;
+  polyinfo.dim[2].extent = tmp1;
+  polyinfo.dim[2].mult = tmp2;
+  polyinfo.offset -= polyinfo.dim[2].mult;
+  tmp4 = polyinfo.dim[1].mult;
+  tmp5 = polyinfo.dim[2].mult;
+  tmp3 = polyinfo.offset;
+
+  for (jd = 1; jd <= knd; jd++) {
+    for (j2 = kip2s; j2 <= kip2e; j2++) {
+      for (j1 = kip1s; j1 <= kip1e; j1++) {
+	ptmp1 = &poly[j1+tmp4*j2+tmp5*jd+tmp3];
+	c = gc2cc(&ptmp1->center);
+	for (jm = 1; jm <= ptmp1->type; jm++) {
+	  jm1 = jm;
+	  jm2 = (jm % ptmp1->type) + 1;
+	  x1 = gc2cc(&ptmp1->boundary[jm1-1]);
+	  x2 = gc2cc(&ptmp1->boundary[jm2-1]);
+	  if (jd < 6) {
+	    v[jm-1] = circum_center(&c,&x1,&x2);
+	  } else {
+	    v[jm-1] = circum_center(&c,&x2,&x1);
+	  }
+	}
+	if ( jd < 6 )
+	  for(jm = 0; jm < ptmp1->type; jm++)
+	    ptmp1->boundary[jm] = cc2gc(&v[jm]);
+	else
+	  for(jm = 0; jm < ptmp1->type; jm++)
+	    ptmp1->boundary[ptmp1->type-jm-1] = cc2gc(&v[jm]);
+      }
+    }
+  }
+
+  return;
+}
+
+/*****************************************************************************/
+
+static
+void neighbours(double *px1, double *px2, 
+                int kipx1s, int kipx1e, int kipx2s, int kipx2e, int kndx,
+                struct polygon *poly, 
+                int kip1s, int kip1e, int kip2s, int kip2e, int knd)
+{
+  struct polygon *ptmp1;
+
+  int j1, j2, jd, jm, js1, js2;
+
+  struct array px1info, px2info, polyinfo;
+
+  int tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9;
+  int tmp10, tmp11, tmp12, tmp13, tmp14, tmp15;
+
+  px1info.rank = 3;
+  px1info.offset = 0;
+  px1info.dim[0].lower = kipx1s;
+  tmp1 =  kipx1e - px1info.dim[0].lower + 1;
+  if (tmp1 < 0) tmp1 = 0;
+  px1info.dim[0].extent = tmp1;
+  px1info.dim[0].mult = 1;
+  px1info.offset -= px1info.dim[0].lower;
+  tmp2 = tmp1;
+  px1info.dim[1].lower = kipx2s;
+  tmp1 = kipx2e - px1info.dim[1].lower + 1;
+  if (tmp1 < 0) tmp1 = 0;
+  px1info.dim[1].extent = tmp1;
+  px1info.dim[1].mult = tmp2;
+  px1info.offset -= px1info.dim[1].lower*px1info.dim[1].mult;
+  tmp2 *= tmp1;
+  px1info.dim[2].lower = 1;
+  tmp1 = kndx;
+  if (tmp1 < 0) tmp1 = 0;
+  px1info.dim[2].extent = tmp1;
+  px1info.dim[2].mult = tmp2;
+  px1info.offset -= px1info.dim[2].mult;
+  tmp4 = px1info.dim[1].mult;
+  tmp5 = px1info.dim[2].mult;
+  tmp3 = px1info.offset;
+
+  px2info.rank = 3;
+  px2info.offset = 0;
+  px2info.dim[0].lower = kipx1s;
+  tmp6 = kipx1e - px2info.dim[0].lower + 1;
+  if (tmp6 < 0) tmp6 = 0;
+  px2info.dim[0].extent = tmp6;
+  px2info.dim[0].mult = 1;
+  px2info.offset -= px2info.dim[0].lower;
+  tmp7 = tmp6;
+  px2info.dim[1].lower = kipx2s;
+  tmp6 = kipx2e - px2info.dim[1].lower + 1;
+  if (tmp6 < 0) tmp6 = 0;
+  px2info.dim[1].extent = tmp6;
+  px2info.dim[1].mult = tmp7;
+  px2info.offset -= px2info.dim[1].lower*px2info.dim[1].mult;
+  tmp7 *= tmp6;
+  px2info.dim[2].lower = 1;
+  tmp6 =  kndx;
+  if (tmp6 < 0) tmp6 = 0;
+  px2info.dim[2].extent = tmp6;
+  px2info.dim[2].mult = tmp7;
+  px2info.offset -= px2info.dim[2].mult;
+  tmp9 = px2info.dim[1].mult;
+  tmp10 = px2info.dim[2].mult;
+  tmp8 = px2info.offset;
+
+  polyinfo.rank = 3;
+  polyinfo.offset = 0;
+  polyinfo.dim[0].lower = kip1s;
+  tmp11 = kip1e - polyinfo.dim[0].lower + 1;
+  if (tmp11 < 0) tmp11 = 0;
+  polyinfo.dim[0].extent = tmp11;
+  polyinfo.dim[0].mult = 1;
+  polyinfo.offset -= polyinfo.dim[0].lower;
+  tmp12 = tmp11;
+  polyinfo.dim[1].lower = kip2s;
+  tmp11 = kip2e - polyinfo.dim[1].lower + 1;
+  if (tmp11 < 0) tmp11 = 0;
+  polyinfo.dim[1].extent = tmp11;
+  polyinfo.dim[1].mult = tmp12;
+  polyinfo.offset -= polyinfo.dim[1].lower*polyinfo.dim[1].mult;
+  tmp12 *= tmp11;
+  polyinfo.dim[2].lower = 1;
+  tmp11 =  knd;
+  if (tmp11 < 0) tmp11 = 0;
+  polyinfo.dim[2].extent = tmp11;
+  polyinfo.dim[2].mult = tmp12;
+  polyinfo.offset -= polyinfo.dim[2].mult;
+  tmp14 = polyinfo.dim[1].mult;
+  tmp15 = polyinfo.dim[2].mult;
+  tmp13 = polyinfo.offset;
+
+  for (jd = 1; jd <= kndx; jd++) {
+    for (j2 = kipx2s+1; j2 <= kipx2e-1; j2++) {
+      for (j1 = kipx1s+1; j1 <= kipx1e-1; j1++) {
+
+	ptmp1 = &poly[j1+tmp14*j2+tmp15*jd+tmp13];
+
+	ptmp1->center.lon = px1[j1+tmp4*j2+tmp5 *jd+tmp3];
+	ptmp1->center.lat = px2[j1+tmp9*j2+tmp10*jd+tmp8];
+
+	if (j1 == kipx1s+1 && j2 == kipx2s+1) {
+
+	  ptmp1->type = pentagon;
+
+	  for (jm = 1; jm <= 5; jm++) {
+
+	    if (jd < 6) {
+	      ptmp1->boundary[jm-1].lon 
+		= px1[kipx1s+1+tmp4*(kipx2s+2)+tmp5 *(jm)+tmp3];
+	      ptmp1->boundary[jm-1].lat 
+		= px2[kipx1s+1+tmp9*(kipx2s+2)+tmp10*(jm)+tmp8];
+	    } else {
+	      ptmp1->boundary[jm-1].lon 
+		= px1[ kipx1s+1+tmp4*( kipx2s+2)+tmp5*(jm+5)+tmp3];
+	      ptmp1->boundary[jm-1].lat 
+		= px2[ kipx1s+1+tmp9*( kipx2s+2)+tmp10*(jm+5)+tmp8];
+	    }
+
+	  }
+
+	} else if (j1 == kipx1e-1 && j2 == kipx2s+1) {
+
+	  ptmp1->type = pentagon;
+
+	  ptmp1->boundary[0].lon = px1[kipx1e-1+tmp4*(kipx2s+2)+tmp5 *jd+tmp3];
+	  ptmp1->boundary[0].lat = px2[kipx1e-1+tmp9*(kipx2s+2)+tmp10*jd+tmp8];
+	  ptmp1->boundary[1].lon = px1[kipx1e-2+tmp4*(kipx2s+2)+tmp5 *jd+tmp3];
+	  ptmp1->boundary[1].lat = px2[kipx1e-2+tmp9*(kipx2s+2)+tmp10*jd+tmp8];
+	  ptmp1->boundary[2].lon = px1[kipx1e-2+tmp4*(kipx2s+1)+tmp5 *jd+tmp3];
+	  ptmp1->boundary[2].lat = px2[kipx1e-2+tmp9*(kipx2s+1)+tmp10*jd+tmp8];
+	  ptmp1->boundary[3].lon = px1[kipx1e-1+tmp4*(kipx2s)  +tmp5 *jd+tmp3];
+	  ptmp1->boundary[3].lat = px2[kipx1e-1+tmp9*(kipx2s)  +tmp10*jd+tmp8];
+	  ptmp1->boundary[4].lon = px1[kipx1e  +tmp4*(kipx2s+1)+tmp5 *jd+tmp3];
+	  ptmp1->boundary[4].lat = px2[kipx1e  +tmp9*(kipx2s+1)+tmp10*jd+tmp8];
+
+	} else if (j1 == kipx1s+1 && j2 == kipx2e-1) {
+
+	  ptmp1->type = pentagon;
+
+	  ptmp1->boundary[0].lon = px1[kipx1s+2+tmp4*(kipx2e-2)+tmp5 *jd+tmp3];
+	  ptmp1->boundary[0].lat = px2[kipx1s+2+tmp9*(kipx2e-2)+tmp10*jd+tmp8];
+	  ptmp1->boundary[1].lon = px1[kipx1s+2+tmp4*(kipx2e-1)+tmp5 *jd+tmp3];
+	  ptmp1->boundary[1].lat = px2[kipx1s+2+tmp9*(kipx2e-1)+tmp10*jd+tmp8];
+	  ptmp1->boundary[2].lon = px1[kipx1s+1+tmp4*(kipx2e)  +tmp5 *jd+tmp3];
+	  ptmp1->boundary[2].lat = px2[kipx1s+1+tmp9*(kipx2e)  +tmp10*jd+tmp8];
+	  ptmp1->boundary[3].lon = px1[kipx1s  +tmp4*(kipx2e-1)+tmp5 *jd+tmp3];
+	  ptmp1->boundary[3].lat = px2[kipx1s  +tmp9*(kipx2e-1)+tmp10*jd+tmp8];
+	  ptmp1->boundary[4].lon = px1[kipx1s+1+tmp4*(kipx2e-2)+tmp5 *jd+tmp3];
+	  ptmp1->boundary[4].lat = px2[kipx1s+1+tmp9*(kipx2e-2)+tmp10*jd+tmp8];
+
+	} else if (j1 == kipx1e-1 && j2 == kipx2e-1) {
+
+	  ptmp1->type = pentagon;
+
+	  ptmp1->boundary[0].lon = px1[kipx1e  +tmp4*(kipx2e)  +tmp5 *jd+tmp3];
+	  ptmp1->boundary[0].lat = px2[kipx1e  +tmp9*(kipx2e)  +tmp10*jd+tmp8];
+	  ptmp1->boundary[1].lon = px1[kipx1e-2+tmp4*(kipx2e)  +tmp5 *jd+tmp3];
+	  ptmp1->boundary[1].lat = px2[kipx1e-2+tmp9*(kipx2e)  +tmp10*jd+tmp8];
+	  ptmp1->boundary[2].lon = px1[kipx1e-2+tmp4*(kipx2e-1)+tmp5 *jd+tmp3];
+	  ptmp1->boundary[2].lat = px2[kipx1e-2+tmp9*(kipx2e-1)+tmp10*jd+tmp8];
+	  ptmp1->boundary[3].lon = px1[kipx1e-1+tmp4*(kipx2e-2)+tmp5 *jd+tmp3];
+	  ptmp1->boundary[3].lat = px2[kipx1e-1+tmp9*(kipx2e-2)+tmp10*jd+tmp8];
+	  ptmp1->boundary[4].lon = px1[kipx1e  +tmp4*(kipx2e-2)+tmp5 *jd+tmp3];
+	  ptmp1->boundary[4].lat = px2[kipx1e  +tmp9*(kipx2e-2)+tmp10*jd+tmp8];
+
+	} else {
+
+	  for(jm = 1; jm <= 6; jm++) {
+
+	    ptmp1->type = hexagon;
+
+	    js1 = j1+ispokes[jm-1];
+	    js2 = j2+ispokes[jm+5];
+
+	    ptmp1->boundary[jm-1].lon = px1[js1+tmp4*js2+tmp5 *jd+tmp3];
+	    ptmp1->boundary[jm-1].lat = px2[js1+tmp9*js2+tmp10*jd+tmp8];
+
+	  }
+
+	}
+
+      }
+
+    }
+
+  }
+
+  return;
+}
+
+/*****************************************************************************/
+
+static
+void xd(double *p, int kip1s, int kip1e, int kip2s, int kip2e, int knd,
+	double *px, int kipx1s, int kipx1e, int kipx2s, int kipx2e, int kndx)
+{
+  int mi1sm1, mi1ep1, mi2sm1, mi2ep1;
+  int mns, mpe, mpw, maw, mae, mpp;
+  int j, j1, j2, jd;
+
+  struct array pinfo, pxinfo;
+
+  int tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9, tmp10;
+
+  pinfo.rank = 3;
+  pinfo.offset = 0;
+  pinfo.dim[0].lower = kip1s;
+  tmp1 =  kip1e - pinfo.dim[0].lower+1;
+  if (tmp1 < 0) tmp1 = 0;
+  pinfo.dim[0].extent = tmp1;
+  pinfo.dim[0].mult = 1;
+  pinfo.offset -= pinfo.dim[0].lower;
+  tmp2 = tmp1;
+  pinfo.dim[1].lower = kip2s;
+  tmp1 =  kip2e - pinfo.dim[1].lower+1;
+  if (tmp1 < 0) tmp1 = 0;
+  pinfo.dim[1].extent = tmp1;
+  pinfo.dim[1].mult = tmp2;
+  pinfo.offset -= pinfo.dim[1].lower*pinfo.dim[1].mult;
+  tmp2 *= tmp1;
+  pinfo.dim[2].lower = 1;
+  tmp1 =  knd;
+  if (tmp1 < 0) tmp1 = 0;
+  pinfo.dim[2].extent = tmp1;
+  pinfo.dim[2].mult = tmp2;
+  pinfo.offset -= pinfo.dim[2].mult;
+  tmp4 = pinfo.dim[1].mult;
+  tmp5 = pinfo.dim[2].mult;
+  tmp3 = pinfo.offset;
+
+  pxinfo.rank = 3;
+  pxinfo.offset = 0;
+  pxinfo.dim[0].lower = kipx1s;
+  tmp6 =  kipx1e - pxinfo.dim[0].lower+1;
+  if (tmp6 < 0) tmp6 = 0;
+  pxinfo.dim[0].extent = tmp6;
+  pxinfo.dim[0].mult = 1;
+  pxinfo.offset -= pxinfo.dim[0].lower;
+  tmp7 = tmp6;
+  pxinfo.dim[1].lower = kipx2s;
+  tmp6 =  kipx2e - pxinfo.dim[1].lower+1;
+  if (tmp6 < 0) tmp6 = 0;
+  pxinfo.dim[1].extent = tmp6;
+  pxinfo.dim[1].mult = tmp7;
+  pxinfo.offset -= pxinfo.dim[1].lower*pxinfo.dim[1].mult;
+  tmp7 *= tmp6;
+  pxinfo.dim[2].lower = 1;
+  tmp6 =  kndx;
+  if (tmp6 < 0) tmp6 = 0;
+  pxinfo.dim[2].extent = tmp6;
+  pxinfo.dim[2].mult = tmp7;
+  pxinfo.offset -= pxinfo.dim[2].mult;
+  tmp9 = pxinfo.dim[1].mult;
+  tmp10 = pxinfo.dim[2].mult;
+  tmp8 = pxinfo.offset;
+  tmp1 = pxinfo.dim[0].extent;
+  tmp2 = pxinfo.dim[1].extent;
+  tmp6 = pxinfo.dim[2].extent;
+  
+  for(jd = 1;jd <= knd;jd++) {
+    for(j2 = kip2s;j2 <= kip2e;j2++) {
+      for(j1 = kip1s;j1 <= kip1e; j1++) {
+	px[j1+tmp9*j2+tmp10*jd+tmp8] = p[j1+tmp4*j2+tmp5*jd+tmp3];
+      }
+    }
+  }
+
+  mi1sm1 =  kip1s-1;
+  mi1ep1 =  kip1e+1;
+  mi2sm1 =  kip2s-1;
+  mi2ep1 =  kip2e+1;
+
+  for(jd = 1; jd <= knd; jd++) {
+    mns = (jd-1)/5;
+    mpe = jd+1-(jd/(5*(1+mns)))*5;
+    mpw = jd-1+((mns*10+6-jd)/(5*(1+mns)))*5;
+    mae = jd+5-9*mns-5*(jd/10);
+    maw = jd+4+((6-jd)/5)*5-9*mns;
+    mpp = jd+3-((jd+2)/5)*5+5*mns;
+    for(j = kip2s; j <= kip1e; j++) {
+      px[j     +tmp9*mi2sm1+tmp10*jd+tmp8] 
+	= p[kip1s+1  +tmp4*j          +tmp5*mpw+tmp3];
+      px[mi1sm1+tmp9*(j+1) +tmp10*jd+tmp8] 
+	= p[j-1      +tmp4*(kip2s+1)  +tmp5*mpe+tmp3];
+      px[mi1ep1+tmp9*j     +tmp10*jd+tmp8] 
+	= p[kip1e+1-j+tmp4*(kip2e-1)  +tmp5*maw+tmp3];
+      px[j-1   +tmp9*mi2ep1+tmp10*jd+tmp8] 
+	= p[kip1e-1  +tmp4*(kip2e+1-j)+tmp5*mae+tmp3];
+    }
+    px[mi1sm1+tmp9*kip2s +tmp10*jd+tmp8] = p[kip1s+1+tmp4*kip2s+tmp5*mpp+tmp3];
+    px[kip1s +tmp9*mi2sm1+tmp10*jd+tmp8] = p[kip1s+1+tmp4*kip2s+tmp5*mpp+tmp3];
+
+    px[mi1ep1+tmp9*mi2sm1+tmp10*jd+tmp8] = px[kip1e +tmp9*mi2sm1+tmp10*jd+tmp8];
+    px[mi1sm1+tmp9*mi2ep1+tmp10*jd+tmp8] = px[mi1sm1+tmp9*kip2e +tmp10*jd+tmp8];
+
+    px[mi1ep1+tmp9*kip2e +tmp10*jd+tmp8] = p[kip1e-1+tmp4*kip2s+tmp5*mae+tmp3];
+    px[kip1e +tmp9*mi2ep1+tmp10*jd+tmp8] = p[kip1e-1+tmp4*kip2s+tmp5*mae+tmp3];
+
+    px[mi1sm1+tmp9*mi2sm1+tmp10*jd+tmp8] = px[kip1s+tmp9*mi2sm1+tmp10*jd+tmp8];
+    px[mi1ep1+tmp9*mi2ep1+tmp10*jd+tmp8] = px[kip1e+tmp9*mi2ep1+tmp10*jd+tmp8];
+  }
+
+  return;
+}
+
+/*****************************************************************************/
+
+static
+void tricntr(double *pxn, 
+             int kig1s, int kig1e, int kig2s, int kig2e, int knd, 
+             int kjd, int kni)
+{
+  int id1, id2, id3, ioffset;
+  double r1, r2, r3;
+
+  int j, mi1, mi2;
+  double zxnorm;
+
+  id1 = kig1e-kig1s+1;
+  id2 = id1*(kig2e-kig2s+1);
+  id3 = id2*3;
+  ioffset = -(id1+id2+id3);
+    
+  for (j = 1; j <= 2; ++j) 
+    {
+      mi1 = j*kni/3;
+      mi2 = (j-1)*kni+1;
+      pxn[mi1+id1*(mi1+1)+id2*1+id3*kjd+ioffset] 
+        = pxn[mi2-1+id1*(mi2)+id2*1+id3*kjd+ioffset] 
+	+pxn[kni+id1*1+id2*1+id3*kjd+ioffset] 
+	+pxn[0+id1*(kni+1)+id2*1+id3*kjd+ioffset];
+      pxn[mi1+id1*(mi1+1)+id2*2+id3*kjd+ioffset] 
+        = pxn[mi2-1+id1*(mi2)+id2*2+id3*kjd+ioffset] 
+	+pxn[kni+id1*1+id2*2+id3*kjd+ioffset] 
+	+pxn[0+id1*(kni+1)+id2*2+id3*kjd+ioffset];
+      pxn[mi1+id1*(mi1+1)+id2*3+id3*kjd+ioffset] 
+        = pxn[mi2-1+id1*(mi2)+id2*3+id3*kjd+ioffset] 
+	+pxn[kni+id1*1+id2*3+id3*kjd+ioffset] 
+	+pxn[0+id1*(kni+1)+id2*3+id3*kjd+ioffset];
+      /* Normalize to unit-sphere */
+      
+      r1 = pxn[mi1+id1*(mi1+1)+id2*1+id3*kjd+ioffset];
+      r2 = pxn[mi1+id1*(mi1+1)+id2*2+id3*kjd+ioffset];
+      r3 = pxn[mi1+id1*(mi1+1)+id2*3+id3*kjd+ioffset];
+      zxnorm = 1.0/sqrt(r1*r1+r2*r2+r3*r3);
+      
+      pxn[mi1+id1*(mi1+1)+id2*1+id3*kjd+ioffset] 
+        = zxnorm*pxn[mi1+id1*(mi1+1)+id2*1+id3*kjd+ioffset];
+      pxn[mi1+id1*(mi1+1)+id2*2+id3*kjd+ioffset] 
+        = zxnorm*pxn[mi1+id1*(mi1+1)+id2*2+id3*kjd+ioffset];
+      pxn[mi1+id1*(mi1+1)+id2*3+id3*kjd+ioffset] 
+        = zxnorm*pxn[mi1+id1*(mi1+1)+id2*3+id3*kjd+ioffset];
+    }
+  
+  return;
+} /* tricntr */
+
+/****************************************************************************/
+
+static
+void gcpt(double *pxn, 
+          int kig1s, int kig1e, int kig2s, int kig2e, int knd, 
+          int kjd, double pgamma, 
+          int ki1, int kj1, int ki2, int kj2, int ki, int kj)
+{
+  int id1, id2, id3, ioffset;
+  double r1, r2, r3;
+    
+  double zbeta, zalpha, zchord, ztheta;
+    
+  /* Calculate "zchord", the Cartesian distance between x1 and x2 */
+
+  id1 = kig1e-kig1s+1;
+  id2 = id1*(kig2e-kig2s+1);
+  id3 = id2*3;
+  ioffset = -(id1+id2+id3);
+
+  r1 = (pxn[ki2+id1*kj2+id2*1+id3*kjd+ioffset] 
+	-pxn[ki1+id1*kj1+id2*1+id3*kjd+ioffset]);
+  r2 = (pxn[ki2+id1*kj2+id2*2+id3*kjd+ioffset] 
+	-pxn[ki1+id1*kj1+id2*2+id3*kjd+ioffset]);
+  r3 = (pxn[ki2+id1*kj2+id2*3+id3*kjd+ioffset] 
+	-pxn[ki1+id1*kj1+id2*3+id3*kjd+ioffset]);
+  
+  zchord = sqrt((r1*r1)+(r2*r2)+(r3*r3));
+    
+  /* Calculate "ztheta", the great circle angle between x1 and x2 */
+  ztheta = 2.0*asin(zchord*0.5);
+    
+  /* Calculate the weighting factors which follow from the condition */
+  /* that x is a point on the unit-sphere, too. */
+  zbeta = sin(pgamma*ztheta)/sin(ztheta);
+  zalpha = sin((1.0-pgamma)*ztheta)/sin(ztheta);
+    
+  /* Store the (x,y,z) coordinates of the point x into the array pxn */
+  pxn[ki+id1*kj+id2*1+id3*kjd+ioffset] 
+    = zalpha*pxn[ki1+id1*kj1+id2*1+id3*kjd+ioffset] 
+    +zbeta *pxn[ki2+id1*kj2+id2*1+id3*kjd+ioffset];
+  pxn[ki+id1*kj+id2*2+id3*kjd+ioffset] 
+    = zalpha*pxn[ki1+id1*kj1+id2*2+id3*kjd+ioffset] 
+    +zbeta *pxn[ki2+id1*kj2+id2*2+id3*kjd+ioffset];
+  pxn[ki+id1*kj+id2*3+id3*kjd+ioffset] 
+    = zalpha*pxn[ki1+id1*kj1+id2*3+id3*kjd+ioffset] 
+    +zbeta *pxn[ki2+id1*kj2+id2*3+id3*kjd+ioffset];
+
+  return;
+} /* gcpt */
+
+/****************************************************************************/
+
+static
+void glo_coor(double *pxn, double *prlon, double *prlat, 
+              int kig1s, int kig1e, int kig2s, int kig2e, int knd, 
+              int kni2, int kni3)
+{
+  int id1, id2, id3, ioffset, joffset;
+
+  double zsgn;
+  int j1, j2;
+  double zrlon, zcosw, zsinw;
+  int jb, jd, ml, mm;
+  double zgamma, zw;
+  int mi1, mi2, ml2, ml3, mni;
+
+  int *mcosv;
+
+  /*
+   * Calculate the Cartesian coordinates of the gridpoints of the
+   * icosahedral grid on the unit sphere.  The grid resolution   
+   * corresponds to a subdivision of the edges of the original   
+   * icosahedral triangles into mni equal parts.                 
+   */  
+
+  if ((mcosv = (int *) malloc (knd*sizeof(int))) == NULL ) 
+    {
+      perror("malloc mcosv");
+      exit (-1);
+    }
+
+  id1 = kig1e-kig1s+1;
+  id2 = id1*(kig2e-kig2s+1);
+  id3 = id2*3;
+  ioffset = -(id1+id2+id3);
+  joffset = -(id1+id2);
+
+  /* Compute angles associated with the icosahedron. */
+
+  zw = acos(1.0/(sin(pid5)*2.0))*2.0;
+  zcosw = cos(zw);
+  zsinw = sin(zw);
+  mni = pow_ii(2, kni2)*pow_ii(3, kni3);
+  
+  /*     Compute the local array mcosv, i.e. the meridian angle locations */
+
+  for (jd = 1; jd <= knd; ++jd) 
+    {
+      if (jd % 2 == 1) 
+        {
+          mcosv[(jd+1)/2-1] = jd-2-knd*((jd-1)/7);
+        } else {
+          mcosv[jd/2+4]     = jd-2-knd*((jd-1)/7);
+        }
+    }
+
+  /**************************************************************************/
+  /*     Loop over the ten diamonds computing diamond vertices (x,y,z)      */
+  /*     coordinates and then iteratively bisecting them kni2 times.        */
+  /*     First a trisection is performed, if required (kni3=1).             */
+
+  for (jd = 1; jd <= knd; ++jd) 
+    {
+      
+      /*     Toggle the hemisphere */
+      if (jd >= 6) 
+        {
+          zsgn = -1.0;
+        } else {
+          zsgn =  1.0;
+        }
+      
+      /*     Compute the meridian angle for each diamond "home" vertex. */
+      zrlon = mcosv[jd-1]*pid5;
+      
+      /*     Every diamond has one vertex at a pole (N or S). */
+      /*     Label this point (0,1,,) in each diamond, and */
+      /*     initialize it to have the (x,y,z) coordinates of */
+      /*     the pole point on the unit sphere. */
+      pxn[0+id1*1+id2*1+id3*jd+ioffset] = 0.0;
+      pxn[0+id1*1+id2*2+id3*jd+ioffset] = 0.0;
+      pxn[0+id1*1+id2*3+id3*jd+ioffset] = zsgn;
+      
+      /*     Now initialize the (x,y,z) coordinates of the "home" vertex, */
+      /*     which defines which diamond we are talking about, and label  */
+      /*     this point (mni,1,,). */
+      pxn[mni+id1*1+id2*1+id3*jd+ioffset] = zsinw*cos(zrlon);
+      pxn[mni+id1*1+id2*2+id3*jd+ioffset] = zsinw*sin(zrlon);
+      pxn[mni+id1*1+id2*3+id3*jd+ioffset] = zcosw*zsgn;
+      
+      /*     Next initialize the (x,y,z) coordinates for the corner of the */
+      /*     diamond on the same latitude as the (mni,1,,) vertex, which   */
+      /*     is (0,mni+1,,) */
+      pxn[0+id1*(mni+1)+id2*1+id3*jd+ioffset] = zsinw*cos(zrlon+2*pid5);
+      pxn[0+id1*(mni+1)+id2*2+id3*jd+ioffset] = zsinw*sin(zrlon+2*pid5);
+      pxn[0+id1*(mni+1)+id2*3+id3*jd+ioffset] = zcosw*zsgn;
+      
+      /*     Initialize the last diamond vertex, which is located */
+      /*     in the opposite hemisphere as (mni,mni+1,,)          */
+      pxn[mni+id1*(mni+1)+id2*1+id3*jd+ioffset] = zsinw*cos(zrlon+pid5);
+      pxn[mni+id1*(mni+1)+id2*2+id3*jd+ioffset] = zsinw*sin(zrlon+pid5);
+      pxn[mni+id1*(mni+1)+id2*3+id3*jd+ioffset] = -(zcosw*zsgn);
+    
+      /***********************************************************************/
+      /*     First a trisection is performed, if required (kni3=1).          */
+      
+      if (kni3 == 1) 
+        {
+          ml3 = mni/3;
+          
+          /*     Trisect the rows of the diamond. */
+          for (j1 = 1; j1 <= 2; ++j1) 
+            {
+              for (j2 = 1; j2 <= 2; ++j2) 
+                {
+                  mi1 = (j1-1)*mni;
+                  mi2 = j2*ml3+1;
+                  zgamma = (double) j2/3.0;
+                  gcpt(pxn, kig1s, kig1e, kig2s, kig2e, knd, jd, 
+                       zgamma, mi1, 1, mi1, mni+1, mi1, mi2);
+                }
+            }
+          
+          /*     Trisect the columns of the diamond. */
+          for (j1 = 1; j1 <= 2; ++j1) 
+            {
+              for (j2 = 1; j2 <= 2; ++j2) 
+                {
+                  mi1 = j2*ml3;
+                  mi2 = (j1-1)*mni+1;
+                  zgamma = (double) j2/3.0;
+                  gcpt(pxn, kig1s, kig1e, kig2s, kig2e, knd, jd,
+                       zgamma, 0, mi2, mni, mi2, mi1, mi2);
+                }
+            }
+      
+          /*     Trisect the diagonal of the diamond. */
+          for (j2 = 1; j2 <= 2; ++j2) 
+            {
+              mi1 = mni-j2*ml3;
+              mi2 = j2*ml3+1;
+              zgamma = (double) j2/(float)3.;
+              gcpt(pxn, kig1s, kig1e, kig2s, kig2e, knd, jd, 
+                   zgamma, mni, 1, 0, mni+1, mi1, mi2);
+            }
+          
+          /*     Compute coordinates of icosahedral triangle centers. */
+          tricntr(pxn, kig1s, kig1e, kig2s, kig2e, knd, jd, mni);
+          
+        }
+      
+      /***********************************************************************/
+      /*     Find the coordinates of the triangle nodes by iteratively       */
+      /*     bisecting the diamond intervals.                                */
+      
+      for (jb = 0; jb <= kni2-1; ++jb) 
+        {
+          mm = pow_ii(3, kni3)*pow_ii(2, jb);
+          ml = mni/mm;
+          ml2 = ml/2;
+          
+          /*     Compute the rows of the diamond. */
+          
+          for (j1 = 1; j1 <= mm+1; ++j1) 
+            {
+              for (j2 = 1; j2 <= mm; ++j2) 
+                {
+                  mi1 = (j1-1)*ml;
+                  mi2 = (j2-1)*ml+ml2+1;
+                  gcpt(pxn, kig1s, kig1e, kig2s, kig2e, knd, jd, 
+                       0.5, mi1, mi2-ml2, mi1, mi2+ml2, mi1, mi2);
+                }
+            }
+          
+          /*     Compute the columns of diamond. */
+          
+          for (j1 = 1; j1 <= mm+1; ++j1) 
+            {
+              for (j2 = 1; j2 <= mm; ++j2) 
+                {
+                  mi1 = (j2-1)*ml+ml2;
+                  mi2 = (j1-1)*ml+1;
+                  gcpt(pxn, kig1s, kig1e, kig2s, kig2e, knd, jd,
+                       0.5, mi1-ml2, mi2, mi1+ml2, mi2, mi1, mi2);
+                }
+            }
+          
+          /*     Compute the diagonals of the diamond. */
+          
+          for (j1 = 1; j1 <= mm; ++j1) 
+            {
+              for (j2 = 1; j2 <= mm; ++j2) 
+                {
+                  mi1 = (j1-1)*ml+ml2;
+                  mi2 = (j2-1)*ml+ml2+1;
+                  gcpt(pxn, kig1s, kig1e, kig2s, kig2e, knd, jd,
+                       0.5, mi1-ml2, mi2+ml2, mi1+ml2, mi2-ml2, mi1, mi2);
+                }
+            }
+          
+        }
+      
+      /***********************************************************************/
+      /* Set pxn to 0 if it is less than 2.5 e-14 to avoid round-off errors  */
+      
+      for (j2 = kig2s; j2 <= kig2e; ++j2) 
+        {
+          for (j1 = kig1s; j1 <= kig1e; ++j1) 
+            {
+              if (fabs(pxn[j1+id1*j2+id2*1+id3*jd+ioffset]) < 2.5e-14) 
+                {
+                  pxn[j1+id1*j2+id2*1+id3*jd+ioffset] = 0.0;
+                }
+              if (fabs(pxn[j1+id1*j2+id2*2+id3*jd+ioffset]) < 2.5e-14) 
+                {
+                  pxn[j1+id1*j2+id2*2+id3*jd+ioffset] = 0.0;
+                }
+              if (fabs(pxn[j1+id1*j2+id2*3+id3*jd+ioffset]) < 2.5e-14) 
+                {
+                  pxn[j1+id1*j2+id2*3+id3*jd+ioffset] = 0.0;
+                }
+            }
+        }
+    }
+  
+  /*************************************************************************/
+  /*     Calculate the longitude "prlon" and the latitude "prlat";         */
+  /*     only for the core of the diamonds, not the extended ones.         */
+  
+  for (jd = 1; jd <= knd; ++jd) 
+    {
+      for (j2 = kig2s; j2 <= kig2e; ++j2) 
+        {
+          for (j1 = kig1s; j1 <= kig1e; ++j1) 
+            {
+              prlon[j1+id1*j2+id2*jd+joffset] 
+                = atan2(pxn[j1+id1*j2+id2*2+id3*jd+ioffset],
+                        pxn[j1+id1*j2+id2*1+id3*jd+ioffset]+1.0e-20);
+              prlat[j1+id1*j2+id2*jd+joffset] 
+                = asin(pxn[j1+id1*j2+id2*3+id3*jd+ioffset]);
+            }
+        }
+    }
+  
+  free(mcosv);
+  
+  return;
+} /* glo_coor */
+
+/*****************************************************************************/
+
+static
+void initmask(int *mask, int ni, int nd)
+{
+  int jd;
+
+  int tmp1, tmp2, tmp3, tmp4, tmp5, tmp6, tmp7, tmp8, tmp9;
+
+  int *ptmp1;
+  char *ptmp2;
+
+  struct array section;
+  struct array maskinfo;
+
+  maskinfo.rank = 3;
+  maskinfo.offset = 0;
+  maskinfo.dim[0].lower = 0;
+  tmp1 =  ni+1;
+  if (tmp1 < 0) tmp1 = 0;
+  maskinfo.dim[0].extent = tmp1;
+  maskinfo.dim[0].mult = 1;
+  maskinfo.offset -= 0;
+  tmp2 = tmp1;
+  maskinfo.dim[1].lower = 1;
+  tmp1 =  ni+1;
+  if (tmp1 < 0) tmp1 = 0;
+  maskinfo.dim[1].extent = tmp1;
+  maskinfo.dim[1].mult = tmp2;
+  maskinfo.offset -= maskinfo.dim[1].mult;
+  tmp2 *= tmp1;
+  maskinfo.dim[2].lower = 1;
+  tmp1 =  nd;
+  if (tmp1 < 0) tmp1 = 0;
+  maskinfo.dim[2].extent = tmp1;
+  maskinfo.dim[2].mult = tmp2;
+  maskinfo.offset -= maskinfo.dim[2].mult;
+  tmp4 = maskinfo.dim[1].mult;
+  tmp5 = maskinfo.dim[2].mult;
+  tmp3 = maskinfo.offset;
+  tmp1 = maskinfo.dim[0].extent;
+  tmp2 = maskinfo.dim[1].extent;
+  tmp9 = maskinfo.dim[2].extent;
+
+  ptmp1 = mask;
+  for (tmp8 = 0; tmp8 < tmp9; tmp8++)  {
+    for (tmp7 = 0; tmp7 < tmp2; tmp7++)  {
+      for (tmp6 = 0; tmp6 < tmp1; tmp6++)  
+	*ptmp1++ = 1;
+    }
+  }
+
+  for (jd = 1; jd <= 10; jd++) {
+    switch (jd) {
+    case 1:
+      break;
+    case 3:
+    case 4:
+    case 2:
+      tmp1 = 1;
+      ptmp1 = mask;
+      tmp2 = maskinfo.dim[0].extent;
+      if (tmp2 < 0) tmp2 = 0;
+      tmp1 *= maskinfo.dim[0].extent;
+      tmp1 *= maskinfo.dim[1].extent;
+      ptmp1 += tmp1*(jd-1);
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  
+	*ptmp1++ = 0;
+      break;
+    case 5:
+      tmp1 = 1;
+      ptmp1 = mask;
+      tmp2 = maskinfo.dim[0].extent;
+      if (tmp2 < 0) tmp2 = 0;
+      tmp1 *= maskinfo.dim[0].extent;
+      tmp1 *= maskinfo.dim[1].extent;
+      ptmp1 += tmp1*(jd-1);
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  
+	*ptmp1++ = 0;
+
+      tmp1 = 4;
+      section.addr = (char *)mask;
+      section.offset = 0;
+      tmp1 *= maskinfo.dim[0].extent;
+      section.dim[0].mult = tmp1;
+      section.dim[0].extent = maskinfo.dim[1].extent;
+      if (section.dim[0].extent < 0) section.dim[0].extent = 0;
+      section.offset -= section.dim[0].mult;
+      section.dim[0].lower = 1;
+      tmp1 *= maskinfo.dim[1].extent;
+      section.addr += tmp1*(jd-1);
+      tmp2 = section.dim[0].extent;
+      ptmp2 = section.addr;
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  {
+	*((int *)ptmp2) = 0;
+	ptmp2 += section.dim[0].mult;
+      }
+      break;
+    case 6:
+
+      tmp1 = 1;
+      ptmp1 = mask;
+      tmp2 = maskinfo.dim[0].extent;
+      if (tmp2 < 0) tmp2 = 0;
+      tmp1 *= maskinfo.dim[0].extent;
+      ptmp1 += tmp1*ni;
+      tmp1 *= maskinfo.dim[1].extent;
+      ptmp1 += tmp1*(jd-1);
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  
+	*ptmp1++ = 0;
+
+      tmp1 = 4;
+      section.addr = (char *)mask;
+      section.offset = 0;
+      section.addr += tmp1*ni;
+      tmp1 *= maskinfo.dim[0].extent;
+      section.dim[0].mult = tmp1;
+      section.dim[0].extent = maskinfo.dim[1].extent;
+      if (section.dim[0].extent < 0) section.dim[0].extent = 0;
+      section.offset -= section.dim[0].mult;
+      section.dim[0].lower = 1;
+      tmp1 *= maskinfo.dim[1].extent;
+      section.addr += tmp1*(jd-1);
+      tmp2 = section.dim[0].extent;
+      ptmp2 = section.addr;
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  {
+	*((int *)ptmp2) = 0;
+	ptmp2 += section.dim[0].mult;
+      }
+      break;
+    case 8:
+    case 9:
+    case 7:
+      tmp1 = 1;
+      ptmp1 = mask;
+      tmp2 = maskinfo.dim[0].extent;
+      if (tmp2 < 0) tmp2 = 0;
+      tmp1 *= maskinfo.dim[0].extent;
+      tmp1 *= maskinfo.dim[1].extent;
+      ptmp1 += tmp1*(jd-1);
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  
+	*ptmp1++ = 0;
+
+      tmp1 = 1;
+      ptmp1 = mask;
+      tmp2 = maskinfo.dim[0].extent;
+      if (tmp2 < 0) tmp2 = 0;
+      tmp1 *= maskinfo.dim[0].extent;
+      ptmp1 += tmp1*ni;
+      tmp1 *= maskinfo.dim[1].extent;
+      ptmp1 += tmp1*(jd-1);
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  
+	*ptmp1++ = 0;
+
+      tmp1 = 4;
+      section.addr = (char *)mask;
+      section.offset = 0;
+      section.addr += tmp1*ni;
+      tmp1 *= maskinfo.dim[0].extent;
+      section.dim[0].mult = tmp1;
+      section.dim[0].extent = maskinfo.dim[1].extent;
+      if (section.dim[0].extent < 0) section.dim[0].extent = 0;
+      section.offset -= section.dim[0].mult;
+      section.dim[0].lower = 1;
+      tmp1 *= maskinfo.dim[1].extent;
+      section.addr += tmp1*(jd-1);
+      tmp2 = section.dim[0].extent;
+      ptmp2 = section.addr;
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  {
+	*((int *)ptmp2) = 0;
+	ptmp2 += section.dim[0].mult;
+      }
+      break;
+    case 10:
+
+      tmp1 = 1;
+      ptmp1 = mask;
+      tmp2 = maskinfo.dim[0].extent;
+      if (tmp2 < 0) tmp2 = 0;
+      tmp1 *= maskinfo.dim[0].extent;
+      tmp1 *= maskinfo.dim[1].extent;
+      ptmp1 += tmp1*(jd-1);
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  
+	*ptmp1++ = 0;
+
+      tmp1 = 1;
+      ptmp1 = mask;
+      tmp2 = maskinfo.dim[0].extent;
+      if (tmp2 < 0) tmp2 = 0;
+      tmp1 *= maskinfo.dim[0].extent;
+      ptmp1 += tmp1*ni;
+      tmp1 *= maskinfo.dim[1].extent;
+      ptmp1 += tmp1*(jd-1);
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  
+	*ptmp1++ = 0;
+
+      tmp1 = 4;
+      section.addr = (char *)mask;
+      section.offset = 0;
+      tmp1 *= maskinfo.dim[0].extent;
+      section.dim[0].mult = tmp1;
+      section.dim[0].extent = maskinfo.dim[1].extent;
+      if (section.dim[0].extent < 0) section.dim[0].extent = 0;
+      section.offset -= section.dim[0].mult;
+      section.dim[0].lower = 1;
+      tmp1 *= maskinfo.dim[1].extent;
+      section.addr += tmp1*(jd-1);
+      tmp2 = section.dim[0].extent;
+      ptmp2 = section.addr;
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  {
+	*((int *)ptmp2) = 0;
+	ptmp2 += section.dim[0].mult;
+      }
+
+      tmp1 = 4;
+      section.addr = (char *)mask;
+      section.offset = 0;
+      section.addr += tmp1*ni;
+      tmp1 *= maskinfo.dim[0].extent;
+      section.dim[0].mult = tmp1;
+      section.dim[0].extent = maskinfo.dim[1].extent;
+      if (section.dim[0].extent < 0) section.dim[0].extent = 0;
+      section.offset -= section.dim[0].mult;
+      section.dim[0].lower = 1;
+      tmp1 *= maskinfo.dim[1].extent;
+      section.addr += tmp1*(jd-1);
+      tmp2 = section.dim[0].extent;
+      ptmp2 = section.addr;
+      for (tmp6 = 0; tmp6 < tmp2; tmp6++)  {
+	*((int *)ptmp2) = 0;
+	ptmp2 += section.dim[0].mult;
+      }
+
+    }
+  }
+
+  return;
+}
+
+/*****************************************************************************/
+
+void gme_grid_restore(double *p, int ni, int nd)
+{
+  int j, jd;
+    
+  int tmp1, tmp2, tmp3, tmp4, tmp5;
+
+  struct array pinfo;
+
+  pinfo.rank = 3;
+  pinfo.offset = 0;
+  pinfo.dim[0].lower = 0;
+  tmp1 = ni+1;
+  if (tmp1 < 0) tmp1 = 0;
+  pinfo.dim[0].extent = tmp1;
+  pinfo.dim[0].mult = 1;
+  pinfo.offset -= 0;
+  tmp2 = tmp1;
+  pinfo.dim[1].lower = 1;
+  tmp1 = ni+1;
+  if (tmp1 < 0) tmp1 = 0;
+  pinfo.dim[1].extent = tmp1;
+  pinfo.dim[1].mult = tmp2;
+  pinfo.offset -= pinfo.dim[1].mult;
+  tmp2 *= tmp1;
+  pinfo.dim[2].lower = 1;
+  tmp1 =  nd;
+  if (tmp1 < 0) tmp1 = 0;
+  pinfo.dim[2].extent = tmp1;
+  pinfo.dim[2].mult = tmp2;
+  pinfo.offset -= pinfo.dim[2].mult;
+  tmp4 = pinfo.dim[1].mult;
+  tmp5 = pinfo.dim[2].mult;
+  tmp3 = pinfo.offset;
+
+  for (jd = 1; jd <= 10; jd++) {
+    switch (jd) {
+    case 1:
+      break;
+    case 3:
+    case 4:
+    case 2:
+      for (j = 0; j <= ni; j++) {
+	p[j+tmp4+tmp5*jd+tmp3] = p[tmp4*(j+1)+tmp5*(jd-1)+tmp3];
+      }
+      break;
+    case 5:
+      for (j = 0; j <= ni; j++) {
+	p[j+tmp4+tmp5*jd+tmp3] = p[tmp4*(j+1)+tmp5*(jd-1)+tmp3];
+      }
+      for (j = 0; j <= ni; j++) {
+	p[tmp4*(j+1)+tmp5*5+tmp3] = p[j+tmp4+tmp5+tmp3];
+      }
+      break;
+    case 6:
+      for (j = 0; j <= ni; j++) {
+	p[j+tmp4*(ni+1)+tmp5*6+tmp3] = p[ni+tmp4*(ni+1-j)+tmp5*2+tmp3];
+      }
+      for (j = 0; j <= ni; j++) {
+	p[ni+tmp4*(j+1)+tmp5*6+tmp3] = p[ni-j+tmp4*(ni+1)+tmp5+tmp3];
+      }
+      break;
+    case 8:
+    case 9:
+    case 7:
+      for (j = 0; j <= ni; j++) {
+	p[j+tmp4*(ni+1)+tmp5*jd+tmp3] = p[ni+tmp4*(ni+1-j)+tmp5*(jd-4)+tmp3];
+      }
+      for (j = 0; j <= ni; j++) {
+	p[ni+tmp4*(j+1)+tmp5*jd+tmp3] = p[ni-j+tmp4*(ni+1)+tmp5*(jd-5)+tmp3];
+      }
+      for (j = 0; j <= ni; j++) {
+	p[j+tmp4+tmp5*jd+tmp3] = p[tmp4*(j+1)+tmp5*(jd-1)+tmp3];
+      }
+      break;
+    case 10:
+      for (j = 0; j <= ni; j++) {
+	p[j+tmp4+tmp5*10+tmp3] = p[tmp4*(j+1)+tmp5*9+tmp3];
+      }
+      for (j = 0; j <= ni; j++) {
+	p[tmp4*(j+1)+tmp5*10+tmp3] = p[j+tmp4+tmp5*6+tmp3];
+      }
+      for (j = 0; j <= ni; j++) {
+	p[j+tmp4*(ni+1)+tmp5*10+tmp3] = p[ni+tmp4*(ni+1-j)+tmp5+tmp3];
+      }
+      for (j = 0; j <= ni; j++) {
+	p[ni+tmp4*(j+1)+tmp5*10+tmp3] = p[ni-j+tmp4*(ni+1)+tmp5*5+tmp3];
+      }
+    }
+  }
+
+  return;
+}
+
+/*****************************************************************************/
+
+
+void gme_grid(int lbounds, int gridsize, double *rlon, double *rlat,
+	      double *blon, double *blat, int *imask,
+              int ni, int nd, int ni2, int ni3)
+{
+  int im1s, im1e, im2s, im2e;
+  int i, j;
+  double *xn;
+  double *rlonx, *rlatx;
+
+  /* check gridsize */
+  if ( (ni+1)*(ni+1)*nd != gridsize )
+    {
+      fprintf(stderr, "gme_grid: Calculation of the global GME grid failed (ni=%d)!\n", ni);
+      if ( (ni+1)*(ni+1)*nd > gridsize )
+	{
+	  fprintf(stderr, "gme_grid: Resulting grid size is greater than the predetermined grid size of %d.\n", gridsize);
+	  fprintf(stderr, "gme_grid: Maybe this is only a part of a global GME grid without further information.\n");
+	}
+      exit (-1);
+    }
+
+  xn    = (double *) malloc(gridsize*3*sizeof(double));
+  rlonx = (double *) malloc((ni+3)*(ni+3)*nd*sizeof(double));
+  rlatx = (double *) malloc((ni+3)*(ni+3)*nd*sizeof(double));
+
+  im1s = 0;
+  im1e = ni;
+  im2s = 1;
+  im2e = ni+1;
+
+  glo_coor(xn, rlon, rlat, im1s, im1e, im2s, im2e, nd, ni2, ni3);
+
+  xd(rlon,im1s,im1e,im2s,im2e,nd,rlonx,im1s-1,im1e+1,im2s-1,im2e+1,nd);
+  xd(rlat,im1s,im1e,im2s,im2e,nd,rlatx,im1s-1,im1e+1,im2s-1,im2e+1,nd);
+
+  initmask(imask,ni,nd);
+
+  if ( lbounds )
+    {
+      struct polygon *poly;
+      
+      poly  = (struct polygon *) malloc((ni+1)*(ni+1)*nd*sizeof(struct polygon));
+
+      neighbours(rlonx,rlatx,im1s-1,im1e+1,im2s-1,im2e+1,nd, poly,im1s,im1e,im2s,im2e,nd);
+
+      boundary(poly,im1s,im1e,im2s,im2e,nd);
+
+      for ( i = 0; i < gridsize; i++ )
+	{
+	  for ( j = 0; j < poly[i].type; j++ )
+	    {
+	      blon[i*6+j] = poly[i].boundary[j].lon;
+	      blat[i*6+j] = poly[i].boundary[j].lat;
+	    }
+	  if ( poly[i].type == pentagon )
+	    {
+	      blon[i*6+5] = blon[i*6+4];
+	      blat[i*6+5] = blat[i*6+4];
+	    }
+	}
+      
+      free(poly);
+    }
+
+  free(rlatx);
+  free(rlonx);
+  free(xn);
+}
+
+/*
+int main(int argc, char *argv[])
+{
+  struct polygon *poly;
+
+  double *xn, *rlat, *rlon;
+  double *rlatx, *rlonx; 
+
+  double *area, total_area;
+
+  int *mask;
+
+  int ni;
+  int ni2, ni3;
+  int nd;
+
+  int im1s, im1e, im2s, im2e;
+
+  int j1, j2, jd;
+
+  nd = 10;
+
+  ni = 2;
+
+  factorni(ni, &ni2, &ni3);  
+
+  if (( poly  = (struct polygon *) malloc((ni+1)*(ni+1)*nd*sizeof(struct polygon))) == NULL) {
+    perror("malloc poly");
+    exit (-1);
+  } 
+  
+  if (( xn  = (double *) malloc((ni+1)*(ni+1)*3*nd*sizeof(double))) == NULL) {
+    perror("malloc xn");
+    exit (-1);
+  } 
+  
+  if ((rlon = (double *) malloc((ni+1)*(ni+1)*nd*sizeof(double))) == NULL) {
+    perror("malloc rlon");
+    exit (-1);
+  } 
+  
+  if ((rlat = (double *) malloc((ni+1)*(ni+1)*nd*sizeof(double))) == NULL) {
+    perror("malloc rlat");
+    exit (-1);
+  } 
+
+  if ((rlonx = (double *) malloc((ni+3)*(ni+3)*nd*sizeof(double))) == NULL) {
+    perror("malloc rlonx");
+    exit (-1);
+  } 
+  
+  if ((rlatx = (double *) malloc((ni+3)*(ni+3)*nd*sizeof(double))) == NULL) {
+    perror("malloc rlatx");
+    exit (-1);
+  } 
+
+  if ((mask = (int *) malloc((ni+1)*(ni+1)*nd*sizeof(int))) == NULL) {
+    perror("malloc mask");
+    exit (-1);
+  } 
+
+  if (( area  = (double *) malloc((ni+1)*(ni+1)*nd*sizeof(double))) == NULL) {
+    perror("malloc area");
+    exit (-1);
+  } 
+
+  im1s = 0;
+  im1e = ni;
+  im2s = 1;
+  im2e = ni+1;
+
+  glo_coor(xn,rlon,rlat,im1s,im1e,im2s,im2e,nd,ni2,ni3);
+
+  xd(rlon,im1s,im1e,im2s,im2e,nd,rlonx,im1s-1,im1e+1,im2s-1,im2e+1,nd);
+  xd(rlat,im1s,im1e,im2s,im2e,nd,rlatx,im1s-1,im1e+1,im2s-1,im2e+1,nd);
+
+  initmask(mask,ni,nd);
+
+  {
+    FILE *out;
+    int id1, id2, ioffset;
+
+    id1 = ni+1;
+    id2 = id1*(ni+1);
+    ioffset = -(id1+id2);
+    
+    if ((out  = fopen("mask.dat", "w")) == NULL) {
+      perror("couldn't open mask.dat");
+      exit (-1);
+    }
+
+    for (jd = 1; jd <= nd; jd++) {
+      fprintf(out,"%d-------------------------------------------------\n", jd);
+      for (j2 = 1; j2 <= ni+1; j2++) {
+	for (j1 = 0; j1 <= ni; j1++) {
+	      fprintf(out,"%8d", mask[j1+id1*j2+id2*jd+ioffset]);
+	} 
+        fprintf(out,"\n");
+      }
+    }
+
+    fclose (out);
+  }
+
+  neighbours(rlonx,rlatx,im1s-1,im1e+1,im2s-1,im2e+1,nd,
+             poly,im1s,im1e,im2s,im2e,nd);
+
+  boundary(poly,im1s,im1e,im2s,im2e,nd);
+
+  {
+    FILE *out;
+    int id1, id2, ioffset;
+    int jm;
+
+    id1 = ni+1;
+    id2 = id1*(ni+1);
+    ioffset = -(id1+id2);
+
+    if ((out  = fopen("dual.dat", "w")) == NULL) {
+      perror("couldn't open dual.dat");
+      exit (-1);
+    }
+
+    for (jd = 1; jd <= nd; jd++) {
+      for (j2 = 1; j2 <= ni+1; j2++) {
+	for (j1 = 0; j1 <= ni; j1++) {
+ 	  if (mask[j1+id1*j2+id2*jd+ioffset]) {
+	    fprintf(out,">\n");
+	    for (jm = 1; jm <= poly[j1+id1*j2+id2*jd+ioffset].type; jm++) {
+	      fprintf(out,"%8.2f%8.2f\n",
+		 pid180*poly[j1+id1*j2+id2*jd+ioffset].boundary[jm-1].lon,
+		 pid180*poly[j1+id1*j2+id2*jd+ioffset].boundary[jm-1].lat);
+	    }
+ 	  } 
+	}
+      }
+    }
+    fclose (out);
+  }
+
+  {
+    struct geo p1, p2, p3;
+
+    struct cart c1, c2, c3;
+
+    int id1, id2, ioffset;
+    int jm, jl;
+    
+    id1 = ni+1;
+    id2 = id1*(ni+1);
+    ioffset = -(id1+id2);
+   
+    total_area = 0.0;
+
+    for (jd = 1; jd <= nd; jd++) {
+      for (j2 = 1; j2 <= ni+1; j2++) {
+	for (j1 = 0; j1 <= ni; j1++) {
+	  area[j1+id1*j2+id2*jd+ioffset] = 0.0;
+ 	  if (mask[j1+id1*j2+id2*jd+ioffset]) {
+	    p3.lon = poly[j1+id1*j2+id2*jd+ioffset].center.lon; 
+	    p3.lat = poly[j1+id1*j2+id2*jd+ioffset].center.lat;
+	    c3 = gc2cc(&p3);
+	    for (jm = 1; jm <= poly[j1+id1*j2+id2*jd+ioffset].type; jm++) {
+	      jl = jm-1;
+	      if (jm == poly[j1+id1*j2+id2*jd+ioffset].type) {
+		p1.lon = poly[j1+id1*j2+id2*jd+ioffset].boundary[0].lon;
+                p1.lat = poly[j1+id1*j2+id2*jd+ioffset].boundary[0].lat;
+		p2.lon = poly[j1+id1*j2+id2*jd+ioffset].boundary[jl].lon;
+                p2.lat = poly[j1+id1*j2+id2*jd+ioffset].boundary[jl].lat;
+		c1 = gc2cc(&p1);
+		c2 = gc2cc(&p2);
+	      } else {
+		p1.lon = poly[j1+id1*j2+id2*jd+ioffset].boundary[jl].lon;
+                p1.lat = poly[j1+id1*j2+id2*jd+ioffset].boundary[jl].lat;
+		p2.lon = poly[j1+id1*j2+id2*jd+ioffset].boundary[jl+1].lon;
+                p2.lat = poly[j1+id1*j2+id2*jd+ioffset].boundary[jl+1].lat;
+		c1 = gc2cc(&p1);
+		c2 = gc2cc(&p2);
+	      }
+	      area[j1+id1*j2+id2*jd+ioffset] = area[j1+id1*j2+id2*jd+ioffset] + areas(&c1, &c2, &c3);
+	    }
+	    total_area = total_area+area[j1+id1*j2+id2*jd+ioffset];
+	  }
+	}
+      } 
+    }
+  }
+
+  free(poly);
+  free(xn);
+  free(rlon);
+  free(rlat);
+  free(rlonx);
+  free(rlatx);
+  free(mask);
+  free(area);
+
+  return(0);
+}
+*/
diff --git a/src/grid_lcc.c b/src/grid_lcc.c
new file mode 100644
index 0000000..563539e
--- /dev/null
+++ b/src/grid_lcc.c
@@ -0,0 +1,332 @@
+#include <stdio.h>
+#include <math.h>
+#include "grid.h"
+
+#ifndef IS_EQUAL
+#  define IS_NOT_EQUAL(x,y) (x < y || y < x)
+#  define IS_EQUAL(x,y)     (!IS_NOT_EQUAL(x,y))
+#endif
+
+#ifndef  M_PI
+#define  M_PI		3.14159265358979323846	/* pi */
+#endif
+
+const double pi = M_PI;
+#define deg_per_rad  (180./pi)
+#define rad_per_deg  (pi / 180.)
+
+// Mean Earth Radius in m.  The value below is consistent with NCEP's routines and grids.
+const double earth_radius_m = 6371200.;
+// const double earth_radius_m = 6370000.; //  consistent with rest of MM5 system
+#define radians_per_degree  (pi / 180.)
+ 
+
+static
+void map_init(proj_info_t *proj)
+{
+  // Initializes the map projection structure to missing values
+
+  proj->lat1     = -999.9;
+  proj->lon1     = -999.9;
+  proj->dx       = -999.9;
+  proj->stdlon   = -999.9;
+  proj->truelat1 = -999.9;
+  proj->truelat2 = -999.9;
+  proj->cone     = -999.9;
+  proj->polei    = -999.9;
+  proj->polej    = -999.9;
+  proj->rsw      = -999.9;
+  proj->hemi     = 0;
+  proj->init     = 0;
+}
+
+static
+double lc_cone(double truelat1, double truelat2)
+{
+  // Subroutine to compute the cone factor of a Lambert Conformal projection
+    
+  // Input Args
+  //    truelat1   (-90 -> 90 degrees N)
+  //    truelat2     "   "  "   "     "
+
+  // First, see if this is a secant or tangent projection.  For tangent
+  // projections, truelat1 = truelat2 and the cone is tangent to the 
+  // Earth's surface at this latitude.  For secant projections, the cone
+  // intersects the Earth's surface at each of the distinctly different
+  // latitudes
+
+  double cone;
+
+  if (fabs(truelat1-truelat2) > 0.1)
+    {
+      cone = log10(cos(truelat1*rad_per_deg)) - 
+  	     log10(cos(truelat2*rad_per_deg));
+      cone = cone /(log10(tan((45.0 - fabs(truelat1)/2.0) * rad_per_deg)) -
+		    log10(tan((45.0 - fabs(truelat2)/2.0) * rad_per_deg)));   
+    }
+  else
+    {
+      cone = sin(fabs(truelat1)*rad_per_deg);
+    }
+
+  return cone;
+}
+
+static
+void set_lc(proj_info_t *proj)
+{
+  // Initialize the remaining items in the proj structure for a
+  // lambert conformal grid.
+
+  double  arg;
+  double  deltalon1;
+  double  tl1r;
+  double  ctl1r;
+
+  // Compute cone factor
+  proj->cone = lc_cone(proj->truelat1, proj->truelat2);
+  // fprintf(stdout, "Computed cone factor: %g\n", proj->cone);
+
+  // Compute longitude differences and ensure we stay out of the
+  // forbidden "cut zone"
+  deltalon1 = proj->lon1 - proj->stdlon;
+  if (deltalon1 > +180.) deltalon1 = deltalon1 - 360.;
+  if (deltalon1 < -180.) deltalon1 = deltalon1 + 360.;
+
+  // Convert truelat1 to radian and compute COS for later use
+  tl1r = proj->truelat1 * rad_per_deg;
+  ctl1r = cos(tl1r);
+
+  // Compute the radius to our known lower-left (SW) corner
+  proj->rsw = proj->rebydx * ctl1r/proj->cone *
+    pow((tan((90.*proj->hemi-proj->lat1)*rad_per_deg/2.) /
+	 tan((90.*proj->hemi-proj->truelat1)*rad_per_deg/2.)), proj->cone);
+
+  // Find pole point
+  arg = proj->cone*(deltalon1*rad_per_deg);
+  proj->polei = 1. - proj->hemi * proj->rsw * sin(arg);
+  proj->polej = 1. + proj->rsw * cos(arg)  ;
+  // fprintf(stdout, "Computed pole (x,y) = %g %g\n", proj->polei, proj->polej);
+}
+
+
+void map_set(int proj_code, double lat1, double lon1, double dx, double stdlon,
+	     double truelat1, double truelat2, proj_info_t *proj)
+{
+  // Given a partially filled proj_info structure, this routine computes
+  // polei, polej, rsw, and cone (if LC projection) to complete the 
+  // structure.  This allows us to eliminate redundant calculations when
+  // calling the coordinate conversion routines multiple times for the
+  // same map.
+  // This will generally be the first routine called when a user wants
+  // to be able to use the coordinate conversion routines, and it
+  // will call the appropriate subroutines based on the 
+  // proj->code which indicates which projection type  this is.
+    
+  // First, check for validity of mandatory variables in proj
+  /*
+  if ( fabs(lat1) > 90. ) {
+    PRINT '(A)', 'Latitude of origin corner required as follows:'
+      PRINT '(A)', '    -90N <= lat1 < = 90.N'
+      STOP 'MAP_INIT'
+    }
+    if ( fabs(lon1) > 180.) {
+      PRINT '(A)', 'Longitude of origin required as follows:'
+      PRINT '(A)', '   -180E <= lon1 <= 180W'
+      STOP 'MAP_INIT'
+    }
+    if ((dx <= 0.).AND.(proj_code .NE. PROJ_LATLON)) {
+      PRINT '(A)', 'Require grid spacing (dx) in meters be positive//'
+      STOP 'MAP_INIT'
+    }
+    if ((fabs(stdlon) > 180.).AND.(proj_code != PROJ_MERC)) {
+      PRINT '(A)', 'Need orientation longitude (stdlon) as: '
+      PRINT '(A)', '   -180E <= lon1 <= 180W' 
+      STOP 'MAP_INIT'
+    }
+    if (fabs(truelat1)>90.) {
+      PRINT '(A)', 'Set true latitude 1 for all projections//'
+      STOP 'MAP_INIT'
+    }
+  */
+  map_init(proj);
+
+  proj->code     = proj_code;
+  proj->lat1     = lat1;
+  proj->lon1     = lon1;
+  proj->dx       = dx;
+  proj->stdlon   = stdlon;
+  proj->truelat1 = truelat1;
+  proj->truelat2 = truelat2;
+
+  if ( proj->code != PROJ_LATLON )
+    {
+      proj->dx = dx;
+      if (truelat1 < 0.)
+	proj->hemi = -1;
+      else
+	proj->hemi =  1;
+
+      proj->rebydx = earth_radius_m / dx;
+    }
+  /*
+ pick_proj: SELECT CASE(proj->code)
+
+      CASE(PROJ_PS)
+        PRINT '(A)', 'Setting up POLAR STEREOGRAPHIC map...'
+        CALL set_ps(proj)
+
+      CASE(PROJ_LC)
+  */
+  // fprintf(stdout, "Setting up LAMBERT CONFORMAL map...\n");
+  if (fabs(proj->truelat2) > 90.)
+    {
+      // fprintf(stdout, "Second true latitude not set, assuming a tangent\n");
+      // fprintf(stdout, "projection at truelat1: %g\n", proj->truelat1);
+      proj->truelat2 = proj->truelat1;
+    }
+
+  set_lc(proj);
+  /*
+      CASE (PROJ_MERC)
+        PRINT '(A)', 'Setting up MERCATOR map...'
+        CALL set_merc(proj)
+   
+      CASE (PROJ_LATLON)
+        PRINT '(A)', 'Setting up CYLINDRICAL EQUIDISTANT LATLON map...'
+        // Convert lon1 to 0->360 notation
+        if (proj->lon1 < 0.) proj->lon1 = proj->lon1 + 360.
+   
+      CASE DEFAULT
+        PRINT '(A,I2)', 'Unknown projection code: ', proj->code
+        STOP 'MAP_INIT'
+    
+    END SELECT pick_proj
+  */
+
+  proj->init = 1;
+}
+
+
+void ijll_lc(double i, double j, proj_info_t proj, double *lat, double *lon)
+{
+  // Subroutine to convert from the (i,j) cartesian coordinate to the 
+  // geographical latitude and longitude for a Lambert Conformal projection.
+
+  // History:
+  // 25 Jul 01: Corrected by B. Shaw, NOAA/FSL
+  // 10 Sep 09: Converted to ANSI C: Uwe Schulzweida, MPIMET
+
+  // Input Args
+  // double, INTENT(IN)              :: i        // Cartesian X coordinate
+  // double, INTENT(IN)              :: j        // Cartesian Y coordinate
+  // TYPE(proj_info),INTENT(IN)      :: proj     // Projection info structure
+
+  // Output Args                 
+  // double, INTENT(OUT)             :: lat      // Latitude (-90->90 deg N)
+  // double, INTENT(OUT)             :: lon      // Longitude (-180->180 E)
+
+  // Locals 
+  double  inew;
+  double  jnew;
+  double  r;
+  double  chi,chi1,chi2;
+  double  r2;
+  double  xx;
+  double  yy;
+
+  chi1 = (90. - proj.hemi*proj.truelat1)*rad_per_deg;
+  chi2 = (90. - proj.hemi*proj.truelat2)*rad_per_deg;
+    
+  // See if we are in the southern hemispere and flip the indices if we are. 
+  if ( proj.hemi == -1 )
+    { 
+      inew = -i + 2.;
+      jnew = -j + 2.;
+    }
+  else
+    {
+      inew = i;
+      jnew = j;
+    }
+
+  // Compute radius**2 to i/j location
+  xx = inew - proj.polei;
+  yy = proj.polej - jnew;
+  r2 = (xx*xx + yy*yy);
+  r  = sqrt(r2)/proj.rebydx;
+   
+  // Convert to lat/lon
+  if ( IS_EQUAL(r2, 0.) )
+    {
+      *lat = proj.hemi * 90.;
+      *lon = proj.stdlon;
+    }
+  else
+    {
+      // Longitude
+      *lon = proj.stdlon + deg_per_rad * atan2(proj.hemi*xx,yy)/proj.cone;
+      *lon = fmod(*lon+360., 360.);
+
+      // Latitude.  Latitude determined by solving an equation adapted 
+      // from:
+      //  Maling, D.H., 1973: Coordinate Systems and Map Projections
+      // Equations #20 in Appendix I.  
+        
+      if ( IS_EQUAL(chi1, chi2) )
+	chi = 2.0*atan( pow( r/tan(chi1), (1./proj.cone) ) * tan(chi1*0.5) );
+      else
+	chi = 2.0*atan( pow( r*proj.cone/sin(chi1), (1./proj.cone) ) * tan(chi1*0.5)) ;
+
+      *lat = (90.0-chi*deg_per_rad)*proj.hemi;
+    }
+
+  if ( *lon > +180. ) *lon = *lon - 360.;
+  if ( *lon < -180. ) *lon = *lon + 360.;
+}
+
+/*
+int main(void)
+{
+  int    status = 0;
+  int    nlon = 245;
+  int    nlat = 277;
+  double xi, xj;
+  double lat_ll_p   =  47.806;
+  double lon_ll_p   = -10.063;
+  double lat_tan_p  =  59.2;
+  double dx_p       =  11000.0;
+  double lon_xx_p   = -10.0;
+  double zlat, zlon;
+  proj_info_t proj;
+
+  map_set(PROJ_LC, lat_ll_p, 360.+lon_ll_p, dx_p, 360.+lon_xx_p, lat_tan_p, lat_tan_p, &proj);
+
+  xi = 1;
+  xj = 1;
+  ijll_lc(xi, xj, proj, &zlat, &zlon);
+  printf("1 1 47.806 349.937 0\n");
+  printf("%g %g %g %g %d\n", xj, xi, zlat, zlon, status);
+
+  xi = nlon;
+  xj = nlat;
+  ijll_lc(xi, xj, proj, &zlat, &zlon);
+  printf("277 245 63.086 51.4192 0\n");
+  printf("%g %g %g %g %d\n", xj, xi, zlat, zlon, status);
+			  
+
+  {
+    int i, j;
+    for ( j = 1; j <= nlat; j++ )
+      for ( i = 1; i <= nlon; i++ )
+	{
+	  xi = i;
+	  xj = j;
+	  ijll_lc(xi, xj, proj, &zlat, &zlon);
+	  if ( zlon < 0 ) zlon+=360;
+	}
+  }
+			
+  return (0);
+}
+*/
diff --git a/src/grid_rot.c b/src/grid_rot.c
new file mode 100644
index 0000000..b88f877
--- /dev/null
+++ b/src/grid_rot.c
@@ -0,0 +1,264 @@
+#include <stdio.h>
+#include <math.h>
+
+#ifndef M_PI
+#define M_PI		3.14159265358979323846	/* pi */
+#endif
+
+#ifndef  rad2deg
+#define  rad2deg  (180./M_PI)   /* conversion for rad to deg */
+#endif
+
+#ifndef  deg2rad
+#define  deg2rad  (M_PI/180.)   /* conversion for deg to rad */
+#endif
+
+
+double lamrot_to_lam(double phirot, double lamrot, double polphi, double pollam, double polgam)
+{
+  /*
+    This function converts lambda from one rotated system to lambda in another
+    system. If the optional argument polgam is present, the other system
+    can also be a rotated one, where polgam is the angle between the two
+    north poles.
+    If polgam is not present, the other system is the real geographical
+    system.
+
+    phirot : latitude in the rotated system
+    lamrot : longitude in the rotated system (E>0)
+    polphi : latitude of the rotated north pole
+    pollam : longitude of the rotated north pole
+
+    result : longitude in the geographical system
+  */
+  double zsinpol, zcospol, zlampol;
+  double zphirot, zlamrot, zarg1, zarg2;
+  double zgam;
+
+  zsinpol = sin(deg2rad*polphi);
+  zcospol = cos(deg2rad*polphi);
+
+  zlampol = deg2rad*pollam;
+  zphirot = deg2rad*phirot;
+  if ( lamrot > 180.0 ) lamrot -= 360.0;
+  zlamrot = deg2rad*lamrot;
+
+  if ( polgam > 0 )
+    {
+      zgam  = deg2rad*polgam;
+      zarg1 = sin(zlampol) *                                               
+ 	    (- zsinpol*cos(zphirot) * (cos(zlamrot)*cos(zgam) - sin(zlamrot)*sin(zgam)) 
+ 	     + zcospol*sin(zphirot))                                              
+	- cos(zlampol)*cos(zphirot) * (sin(zlamrot)*cos(zgam) + cos(zlamrot)*sin(zgam));
+
+      zarg2 = cos(zlampol) *                                               
+ 	    (- zsinpol*cos(zphirot) * (cos(zlamrot)*cos(zgam) - sin(zlamrot)*sin(zgam)) 
+	     + zcospol*sin(zphirot))                                              
+	+ sin(zlampol)*cos(zphirot) * (sin(zlamrot)*cos(zgam) + cos(zlamrot)*sin(zgam));
+      }
+  else
+    {
+      zarg1 = sin(zlampol)*(- zsinpol*cos(zlamrot)*cos(zphirot)  +
+      		              zcospol*           sin(zphirot)) -
+	      cos(zlampol)*           sin(zlamrot)*cos(zphirot);
+      zarg2 = cos(zlampol)*(- zsinpol*cos(zlamrot)*cos(zphirot)  +
+                              zcospol*           sin(zphirot)) +
+              sin(zlampol)*           sin(zlamrot)*cos(zphirot);
+    }
+
+  if ( fabs(zarg2) < 1.0e-20 ) zarg2 = 1.0e-20;
+
+  return (rad2deg*atan2(zarg1, zarg2));
+}
+
+
+double phirot_to_phi(double phirot, double lamrot, double polphi, double polgam)
+{
+  /*
+    This function converts phi from one rotated system to phi in another
+    system. If the optional argument polgam is present, the other system
+    can also be a rotated one, where polgam is the angle between the two
+    north poles.
+    If polgam is not present, the other system is the real geographical
+    system.
+
+    phirot : latitude in the rotated system
+    lamrot : longitude in the rotated system (E>0)
+    polphi : latitude of the rotated north pole
+    polgam : angle between the north poles of the systems
+
+    result : latitude in the geographical system
+  */
+  double zsinpol, zcospol;
+  double zphirot, zlamrot, zarg;
+  double zgam;
+
+  zsinpol = sin(deg2rad*polphi);
+  zcospol = cos(deg2rad*polphi);
+
+  zphirot   = deg2rad*phirot;
+  if ( lamrot > 180.0 ) lamrot -= 360.0;
+  zlamrot   = deg2rad*lamrot;
+
+  if ( polgam > 0 )
+    {
+      zgam = deg2rad*polgam;
+      zarg = zsinpol*sin(zphirot) +
+             zcospol*cos(zphirot)*(cos(zlamrot)*cos(zgam) - sin(zgam)*sin(zlamrot));
+    }
+  else
+    zarg   = zcospol*cos(zphirot)*cos(zlamrot) + zsinpol*sin(zphirot);
+
+  return (rad2deg*asin(zarg));
+}
+
+static
+double rl_to_rls(double phi, double rla, double polphi, double pollam)
+{
+  /*
+    Umrechnung von rla (geo. System) auf rlas (rot. System)
+
+    phi    : Breite im geographischen System (N>0)
+    rla    : Laenge im geographischen System (E>0)
+    polphi : Geographische Breite des Nordpols des rot. Systems
+    pollam : Geographische Laenge des Nordpols des rot. Systems
+
+    result : Rotierte Laenge
+  */
+  double zsinpol, zcospol, zlampol;
+  double zphi, zrla, zarg1, zarg2;
+
+  zsinpol = sin(deg2rad*polphi);
+  zcospol = cos(deg2rad*polphi);
+  zlampol =     deg2rad*pollam;
+
+  if ( rla > 180.0 ) rla -= 360.0;
+
+  zrla = deg2rad*rla;
+  zphi = deg2rad*phi;
+
+  zarg1  = - sin(zrla-zlampol)*cos(zphi);
+  zarg2  = - zsinpol*cos(zphi)*cos(zrla-zlampol)+zcospol*sin(zphi);
+
+  if ( fabs(zarg2) < 1.0e-20 ) zarg2 = 1.0e-20;
+
+  return (rad2deg*atan2(zarg1,zarg2));
+}
+
+static
+double ph_to_phs(double phi, double rla, double polphi, double pollam)
+{
+  /*
+    Umrechnung von phi (geo. System) auf phis (rot. System)
+
+    phi    : Breite im geographischen System (N>0)
+    rla    : Laenge im geographischen System (E>0)
+    polphi : Geographische Breite des Nordpols des rot. Systems
+    pollam : Geographische Laenge des Nordpols des rot. Systems
+
+    result : Rotierte Breite
+  */
+  double zsinpol, zcospol, zlampol;
+  double zphi, zrla, zarg;
+
+  zsinpol = sin(deg2rad*polphi);
+  zcospol = cos(deg2rad*polphi);
+  zlampol =     deg2rad*pollam;
+
+  zphi = deg2rad*phi;
+  if ( rla > 180.0 ) rla -= 360.0;
+  zrla = deg2rad*rla;
+
+  zarg = zcospol*cos(zphi)*cos(zrla-zlampol) + zsinpol*sin(zphi);
+
+  return (rad2deg*asin(zarg));
+}
+
+
+void usvs_to_uv(double us, double vs, double phi, double rla,
+		double polphi, double pollam, double *u, double *v)
+{
+  /*
+    Umrechnen der windkomponente us, vs im rotierten sphaerischen
+    system in die windkomponenten u, v, im geographischen system
+
+    us     : 'zonaler wind im rotierten system
+    vs     : 'merid. wind im rotierten  system
+    phi    : breite im geographischen system (n>0)
+    rla    : laenge im geographischen system (e>0)
+    polphi : geographische breite des n-pols des rot. sys.
+    pollam : geographische laenge des n-pols des rot. sys.
+ 
+    u      : zonaler wind im geographischen system
+    v      : merid. wind im geographischen system
+  */
+  double zpolphi, zpollam, zrla, zphi, pollamd, zrlas, zarg, zbeta;
+
+  /* umrechnung von grad in bogenmass */
+  zpolphi = polphi*deg2rad;
+  zpollam = pollam*deg2rad;
+  zrla    = rla   *deg2rad;
+  zphi    = phi   *deg2rad;
+  pollamd = pollam;
+  if ( pollamd < 0.0 ) pollamd += 360.0;
+
+  /* laenge im rotierten system berechnen */
+  zrlas = rl_to_rls(phi, rla, polphi, pollam)*deg2rad;
+
+  /* winkel zbeta berechen (schnittwinkel der breitenkreise) */
+  zarg = - sin(zpolphi)*sin(zrla-zpollam)*sin(zrlas) - cos(zrla-zpollam)*cos(zrlas);
+  if ( zarg >  1.0 ) zarg =  1.0;
+  if ( zarg < -1.0 ) zarg = -1.0;
+  /*
+  zbeta = acos(zarg);
+  zbeta = sign(zbeta, -(rla - (pollamd-180.0)));
+  */
+  zbeta = fabs(acos(zarg));
+  /*  if ( -(rla - (pollamd-180.0)) < 0 ) zbeta = -zbeta;*/
+  if ( (-(rla - (pollamd-180.0)) < 0) && (-(rla - (pollamd-180.0)) >= -180) ) zbeta = -zbeta;
+
+  /* us - wind transformieren */
+  *u = us*cos(zbeta) - vs*sin(zbeta);
+  
+  /* vs - wind transformieren */
+  *v = us*sin(zbeta) + vs*cos(zbeta);
+}
+
+/*
+int main(void)
+{
+  double polphi, pollam;
+  double x0, y0, x1, y1, x2, y2;
+  int i;
+
+  polphi = 90.0;
+  pollam = 0.0;
+
+  polphi = 32.5;
+  pollam = -170.0;
+
+  x0 = -20.0;
+  y0 = 0.0;
+
+  for ( i = 0; i < 10; i++ )
+    {
+      x0 = i *20.0;
+      printf("%g %g\n", x0, y0);
+
+      x1 = rls_to_rl(y0, x0, polphi, pollam);
+      y1 = phs_to_ph(y0, x0, polphi);
+
+      printf("%g %g\n", x1, y1);
+
+      x2 = rl_to_rls(y1, x1, polphi, pollam);
+      y2 = ph_to_phs(y1, x1, polphi, pollam);
+
+      printf("%g %g\n", x2, y2);
+    }
+
+  usvs_to_uv(30.0, 20.0, 30.0, 0.0, polphi, pollam, &x1, &x2);
+  printf("usvs_to_uv %g %g %g %g\n", polphi, pollam, x1, x2);
+
+  return (0);
+}
+*/
diff --git a/src/griddes.c b/src/griddes.c
new file mode 100644
index 0000000..0804432
--- /dev/null
+++ b/src/griddes.c
@@ -0,0 +1,1851 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+#  include "netcdf.h"
+#endif
+
+#include <ctype.h>
+
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#include <unistd.h>
+
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "grid.h"
+#include "griddes.h"
+#include "error.h"
+
+#define  deg2rad  (M_PI/180.)   /* conversion for deg to rad */
+#define  rad2deg  (180./M_PI)   /* conversion for rad to deg */
+
+#define  cmpstr(s1, s2, len)  (memcmp(s1, s2, len = strlen(s2)))
+
+/*
+int  extInqPrec(int fileID);
+
+int  extReadHeader(int fileID, int *header);
+int  extReadDataDP(int fileID, double *data);
+
+int  extOpen(const char *filename, const char *mode);
+void extClose(int fileID);
+*/
+
+#define UNDEFID -1
+
+#define MAX_LINE_LEN 65536
+
+
+void gridInit(grid_t *grid)
+{
+  grid->mask          = NULL;
+  grid->xvals         = NULL;
+  grid->yvals         = NULL;
+  grid->xbounds       = NULL;
+  grid->ybounds       = NULL;
+  grid->area          = NULL;
+  grid->type          = UNDEFID;
+  grid->size          = 0;
+  grid->xsize         = 0;
+  grid->ysize         = 0;
+  grid->np            = 0;
+  grid->lcomplex      = 1;
+  grid->xpole         = 0;
+  grid->ypole         = 0;
+  grid->prec          = 0;
+  grid->isRotated     = FALSE;
+  grid->ntr           = 0;
+  grid->nvertex       = 0;
+  grid->genBounds     = FALSE;
+
+  grid->originLon     = 0;
+  grid->originLat     = 0;
+  grid->lonParY       = 0;
+  grid->lat1          = 0;
+  grid->lat2          = 0;
+  grid->projflag      = 0;
+  grid->scanflag      = 64;
+  grid->def_originLon = FALSE;
+  grid->def_originLat = FALSE;
+  grid->def_lonParY   = FALSE;
+  grid->def_lat1      = FALSE;
+  grid->def_lat2      = FALSE;
+
+  grid->a             = 0;
+  grid->lon_0         = 0;
+  grid->lat_0         = 0;
+  grid->lat_1         = 0;
+  grid->lat_2         = 0;
+  grid->def_lon_0     = FALSE;
+  grid->def_lat_0     = FALSE;
+  grid->def_lat_1     = FALSE;
+  grid->def_lat_2     = FALSE;
+
+  grid->def_xfirst    = FALSE;
+  grid->def_yfirst    = FALSE;
+  grid->def_xlast     = FALSE;
+  grid->def_ylast     = FALSE;
+  grid->def_xinc      = FALSE;
+  grid->def_yinc      = FALSE;
+  grid->xfirst        = 0;
+  grid->yfirst        = 0;
+  grid->xlast         = 0;
+  grid->ylast         = 0;
+  grid->xinc          = 0;
+  grid->yinc          = 0;
+  grid->nd            = 0;
+  grid->ni            = 0;
+  grid->ni2           = 0;
+  grid->ni3           = 0;
+  grid->number        = 0;
+  grid->position      = 0;
+  grid->path[0]       = 0;
+  grid->xname[0]      = 0;
+  grid->xlongname[0]  = 0;
+  grid->xunits[0]     = 0;
+  grid->yname[0]      = 0;
+  grid->ylongname[0]  = 0;
+  grid->yunits[0]     = 0;
+}
+
+
+int getoptname(char *optname, const char *optstring, int nopt)
+{
+  int i, nerr = 0;
+  size_t namelen;
+  const char *pname;
+  const char *pend;
+
+  pname = optstring;
+  pend  = optstring;
+
+  for ( i = 0; i < nopt; i++ )
+    {
+      pend = strchr(pname, ',');
+      if ( pend == NULL )
+	break;
+      else
+	pname = pend + 1;
+    }
+
+  if ( pend )
+    {
+      pend = strchr(pname, ',');
+      if ( pend == NULL )
+	namelen = strlen(pname);
+      else
+	namelen = pend - pname;
+
+      memcpy(optname, pname, namelen);
+      optname[namelen] = '\0';
+    }
+  else
+    nerr = 1;
+
+  return (nerr);
+}
+
+
+int gridDefine(grid_t grid)
+{
+  int gridID = UNDEFID;
+  int i;
+
+  switch ( grid.type )
+    {
+    case GRID_GENERIC:
+    case GRID_LONLAT:
+    case GRID_GAUSSIAN:
+    case GRID_SINUSOIDAL:
+      {
+	if ( grid.size != 1 )
+	  {
+	    if ( grid.xsize == 0 ) Error("xsize undefined!");
+	    if ( grid.ysize == 0 ) Error("ysize undefined!");
+	  }
+
+	if ( grid.size == 0 ) grid.size = grid.xsize*grid.ysize;
+
+	if ( grid.size != grid.xsize*grid.ysize )
+	  Error("Inconsistent grid declaration: xsize*ysize!=gridsize! (xsize=%d ysize=%d gridsize=%d)",
+		grid.xsize, grid.ysize, grid.size);
+
+	gridID = gridCreate(grid.type, grid.size);
+
+	if ( grid.xsize > 0 ) gridDefXsize(gridID, grid.xsize);
+	if ( grid.ysize > 0 ) gridDefYsize(gridID, grid.ysize);
+	if ( grid.np    > 0 ) gridDefNP(gridID, grid.np);
+
+	gridDefPrec(gridID, grid.prec);
+
+	if ( (grid.def_xfirst || grid.def_xlast || grid.def_xinc) && grid.xvals == NULL )
+	  {
+	    grid.xvals = (double *) malloc(grid.xsize*sizeof(double));
+	    gridGenXvals(grid.xsize, grid.xfirst, grid.xlast, grid.xinc, grid.xvals);
+
+	    if ( grid.genBounds && grid.xbounds == NULL && grid.xsize > 1 )
+	      {
+		grid.nvertex = 2;
+		grid.xbounds = (double *) malloc(grid.xsize*grid.nvertex*sizeof(double));
+		for ( i = 0; i < (int) grid.xsize-1; i++ )
+		  {
+		    grid.xbounds[2*i+1]   = 0.5*(grid.xvals[i] + grid.xvals[i+1]);
+		    grid.xbounds[2*(i+1)] = 0.5*(grid.xvals[i] + grid.xvals[i+1]);
+		  }
+		grid.xbounds[0] = 2*grid.xvals[0] - grid.xbounds[1];
+		grid.xbounds[2*grid.xsize-1] = 2*grid.xvals[grid.xsize-1] - grid.xbounds[2*(grid.xsize-1)];
+	      }
+	  }
+
+	if ( (grid.def_yfirst || grid.def_ylast || grid.def_yinc) && grid.yvals == NULL )
+	  {
+	    if ( ! grid.def_ylast ) grid.ylast = grid.yfirst;
+	    grid.yvals = (double *) malloc(grid.ysize*sizeof(double));
+	    gridGenYvals(grid.type, grid.ysize, grid.yfirst, grid.ylast, grid.yinc, grid.yvals);
+
+	    if ( grid.genBounds && grid.ybounds == NULL && grid.ysize > 1 )
+	      {
+		grid.nvertex = 2;
+		grid.ybounds = (double *) malloc(grid.ysize*grid.nvertex*sizeof(double));
+		for ( i = 0; i < (int) grid.ysize-1; i++ )
+		  {
+		    grid.ybounds[2*i+1]   = 0.5*(grid.yvals[i] + grid.yvals[i+1]);
+		    grid.ybounds[2*(i+1)] = 0.5*(grid.yvals[i] + grid.yvals[i+1]);
+		  }
+
+		if ( grid.yvals[0] > grid.yvals[grid.ysize-1] )
+		  {
+		    grid.ybounds[0] = 90;
+		    grid.ybounds[grid.ysize*grid.nvertex-1] = -90;
+		  }
+		else
+		  {
+		    grid.ybounds[0] = -90;
+		    grid.ybounds[grid.ysize*grid.nvertex-1] = 90;
+		  }
+	      }
+	  }
+
+	if ( grid.xvals )
+	  {
+	    gridDefXvals(gridID, grid.xvals);
+	    free(grid.xvals);
+	  }
+
+	if ( grid.yvals )
+	  {
+	    gridDefYvals(gridID, grid.yvals);
+	    free(grid.yvals);
+	  }
+
+	if ( grid.nvertex )
+	  gridDefNvertex(gridID, grid.nvertex);
+
+	if ( grid.xbounds )
+	  {
+	    gridDefXbounds(gridID, grid.xbounds);
+	    free(grid.xbounds);
+	  }
+
+	if ( grid.ybounds )
+	  {
+	    gridDefYbounds(gridID, grid.ybounds);
+	    free(grid.ybounds);
+	  }
+
+	if ( grid.isRotated )
+	  {
+	    gridDefXpole(gridID, grid.xpole);
+	    gridDefYpole(gridID, grid.ypole);
+	  }
+
+	if ( grid.mask )
+	  {
+	    gridDefMask(gridID, grid.mask);
+	    free(grid.mask);
+	  }
+
+	break;
+      }
+    case GRID_CURVILINEAR:
+    case GRID_UNSTRUCTURED:
+      {
+	if ( grid.size == 0 )
+	  {
+	    if ( grid.type == GRID_CURVILINEAR )
+	      grid.size = grid.xsize*grid.ysize;
+	    else
+	      grid.size = grid.xsize;
+	  }
+
+	gridID = gridCreate(grid.type, grid.size);
+
+	gridDefPrec(gridID, grid.prec);
+
+	if ( grid.type == GRID_CURVILINEAR )
+	  {
+	    if ( grid.xsize == 0 ) Error("xsize undefined!");
+	    if ( grid.ysize == 0 ) Error("ysize undefined!");
+	    gridDefXsize(gridID, grid.xsize);
+	    gridDefYsize(gridID, grid.ysize);
+	  }
+	else
+	  {
+	    gridDefNvertex(gridID, grid.nvertex);
+	  }
+
+	if ( grid.xvals )
+	  {
+	    gridDefXvals(gridID, grid.xvals);
+	    free(grid.xvals);
+	  }
+
+	if ( grid.yvals )
+	  {
+	    gridDefYvals(gridID, grid.yvals);
+	    free(grid.yvals);
+	  }
+
+	if ( grid.area )
+	  {
+	    gridDefArea(gridID, grid.area);
+	    free(grid.area);
+	  }
+
+	if ( grid.xbounds )
+	  {
+	    gridDefXbounds(gridID, grid.xbounds);
+	    free(grid.xbounds);
+	  }
+
+	if ( grid.ybounds )
+	  {
+	    gridDefYbounds(gridID, grid.ybounds);
+	    free(grid.ybounds);
+	  }
+
+	if ( grid.mask )
+	  {
+	    gridDefMask(gridID, grid.mask);
+	    free(grid.mask);
+	  }
+
+	break;
+      }
+    case GRID_LCC:
+      {
+	if ( grid.xsize == 0 ) Error("xsize undefined!");
+	if ( grid.ysize == 0 ) Error("ysize undefined!");
+
+	if ( grid.size == 0 ) grid.size = grid.xsize*grid.ysize;
+
+	gridID = gridCreate(grid.type, grid.size);
+
+	gridDefPrec(gridID, grid.prec);
+
+	gridDefXsize(gridID, grid.xsize);
+	gridDefYsize(gridID, grid.ysize);
+
+	if ( grid.def_originLon == FALSE ) Error("originLon undefined!");
+	if ( grid.def_originLat == FALSE ) Error("originLat undefined!");
+	if ( grid.def_lonParY   == FALSE ) Error("lonParY undefined!");
+	if ( grid.def_lat1      == FALSE ) Error("lat1 undefined!");
+	if ( grid.def_lat2      == FALSE ) Error("lat2 undefined!");
+	if ( grid.def_xinc      == FALSE ) Error("xinc undefined!");
+	if ( grid.def_yinc      == FALSE ) Error("yinc undefined!");
+
+	gridDefLCC(gridID, grid.originLon, grid.originLat, grid.lonParY,
+		   grid.lat1, grid.lat2, grid.xinc, grid.yinc, grid.projflag, grid.scanflag);
+
+	if ( grid.mask )
+	  {
+	    gridDefMask(gridID, grid.mask);
+	    free(grid.mask);
+	  }
+
+	break;
+      }
+    case GRID_LCC2:
+      {
+	if ( grid.xsize == 0 ) Error("xsize undefined!");
+	if ( grid.ysize == 0 ) Error("ysize undefined!");
+
+	if ( grid.size == 0 ) grid.size = grid.xsize*grid.ysize;
+
+	gridID = gridCreate(grid.type, grid.size);
+
+	gridDefPrec(gridID, grid.prec);
+
+	gridDefXsize(gridID, grid.xsize);
+	gridDefYsize(gridID, grid.ysize);
+
+	if ( grid.def_xfirst && grid.def_xinc && grid.xvals == NULL )
+	  {
+	    grid.xvals = (double *) malloc(grid.xsize*sizeof(double));
+	    for ( i = 0; i < grid.xsize; ++i )
+	      grid.xvals[i] = grid.xfirst + i*grid.xinc;
+	  }
+
+	if ( grid.def_yfirst && grid.def_yinc && grid.yvals == NULL )
+	  {
+	    grid.yvals = (double *) malloc(grid.ysize*sizeof(double));
+	    for ( i = 0; i < grid.ysize; ++i )
+	      grid.yvals[i] = grid.yfirst + i*grid.yinc;
+	  }
+
+	if ( grid.xvals )
+	  {
+	    gridDefXvals(gridID, grid.xvals);
+	    free(grid.xvals);
+	  }
+
+	if ( grid.yvals )
+	  {
+	    gridDefYvals(gridID, grid.yvals);
+	    free(grid.yvals);
+	  }	
+
+	if ( grid.def_lon_0     == FALSE ) Error("lon_0 undefined!");
+	if ( grid.def_lat_0     == FALSE ) Error("lat_0 undefined!");
+	if ( grid.def_lat_1     == FALSE ) Error("lat_1 undefined!");
+	if ( grid.def_lat_2     == FALSE ) grid.def_lat_2 = grid.def_lat_1;
+
+	gridDefLcc2(gridID, grid.a, grid.lon_0, grid.lat_0, grid.lat_1, grid.lat_2);
+
+	if ( grid.mask )
+	  {
+	    gridDefMask(gridID, grid.mask);
+	    free(grid.mask);
+	  }
+
+	break;
+      }
+    case GRID_SPECTRAL:
+      {
+	if ( grid.ntr == 0 )
+	  Error("truncation undefined!");
+	if ( grid.size == 0 )
+	  grid.size = (grid.ntr+1) * (grid.ntr+2);
+
+	gridID = gridCreate(grid.type, grid.size);
+
+	gridDefPrec(gridID, grid.prec);
+
+	gridDefTrunc(gridID, grid.ntr);
+
+	gridDefComplexPacking(gridID, grid.lcomplex);
+
+	break;
+      }
+    case GRID_GME:
+      {
+	if ( grid.nd   == 0 ) Error("nd undefined!");
+	if ( grid.ni   == 0 ) Error("ni undefined!");
+	if ( grid.size == 0 ) Error("size undefined!");
+
+	gridID = gridCreate(grid.type, grid.size);
+
+	gridDefPrec(gridID, grid.prec);
+
+	gridDefGMEnd(gridID, grid.nd);
+	gridDefGMEni(gridID, grid.ni);
+	gridDefGMEni2(gridID, grid.ni2);
+	gridDefGMEni3(gridID, grid.ni3);
+	
+	if ( grid.mask )
+	  {
+	    gridDefMask(gridID, grid.mask);
+	    free(grid.mask);
+	  }
+
+	break;
+      }
+    case GRID_REFERENCE:
+      {
+	gridID = gridCreate(grid.type, grid.size);
+
+	gridDefNumber(gridID, grid.number);
+	gridDefPosition(gridID, grid.position);
+	if ( *grid.path ) gridDefReference(gridID, grid.path);
+
+	break;
+      }
+    default:
+      {
+	if ( grid.type == -1 )
+	  Error("Undefined grid type!");
+	else
+	  Error("Unsupported grid type: %s", gridNamePtr(grid.type));
+      }
+    }
+
+  if ( grid.xname[0]     ) gridDefXname(gridID, grid.xname);
+  if ( grid.xlongname[0] ) gridDefXlongname(gridID, grid.xlongname);
+  if ( grid.xunits[0]    ) gridDefXunits(gridID, grid.xunits);
+  if ( grid.yname[0]     ) gridDefYname(gridID, grid.yname);
+  if ( grid.ylongname[0] ) gridDefYlongname(gridID, grid.ylongname);
+  if ( grid.yunits[0]    ) gridDefYunits(gridID, grid.yunits);
+
+  return (gridID);
+}
+
+static
+char *skipSeparator(char *pline)
+{
+  while ( isspace((int) *pline) ) pline++;
+  if ( *pline == '=' || *pline == ':' ) pline++;
+  while ( isspace((int) *pline) ) pline++;
+
+  return (pline);
+}
+
+
+void fnmexp2(char *out, char *in1, const char *in2)
+{
+  const char *pos, *ch;
+  char envv[20], *envr;
+  int i,j;
+
+  if ( *in1=='$' )
+    {
+      in1++;
+      i = 0;
+      while (*in1!='/' && *in1!='\0' && i<16)
+	{
+	  envv[i] = *in1;
+	  i++; in1++;
+	}
+      envv[i] = '\0';
+      envr = getenv(envv);
+      if (envr)
+	{
+	  i = 0; j = 0;
+	  while (*(envr+j))
+	    {
+	      *(out+i) = *(envr+j);
+	      i++; j++;
+	    }
+	  while (*in1!='\0' && *in1!=' ' && *in1!='\n')
+	    {
+	      *(out+i) = *in1;
+	      i++; in1++;
+	    }
+	  *(out+i) = '\0';
+	}
+      return;
+    }
+  ch = in2;
+  pos=NULL;
+  while (*ch!='\0' && *ch!=' ' && *ch!='\n')
+    {
+      if (*ch=='/') pos=ch;
+      ch++;
+    }
+  if (pos) pos++;
+  while (pos!=NULL && in2<pos)
+    {
+      *out = *in2;
+      out++; in2++;
+    }
+  in1++;
+  while (*in1!='\0' && *in1!=' ' && *in1!='\n')
+    {
+      *out = *in1;
+      out++; in1++;
+    }
+  *out = '\0';
+}
+
+/*
+double *readfield(grid_t *grid, int record, char *format, char *filename)
+{
+  int fileID, rxysize, ierr, irec;
+  double *vals;
+
+  if ( grid->size == 0 )  Error("grid size = 0!");
+  if ( format == NULL )   Error("format undefined!");
+  if ( filename == NULL ) Error("file name undefined!");
+
+  vals = (double *) malloc(grid->size*sizeof(double));
+
+  if ( strcmp(format, "extra") == 0 )
+    {
+      int header[4];
+      fileID = extOpen(filename, "r");
+      if ( fileID == UNDEFID ) SysError(filename);
+
+      for ( irec = 0; irec < record; irec++ )
+	{
+	  ierr = extReadHeader(fileID, header);
+	  if ( ierr <= 0 ) Error("Record %d unexpected EOF in file %s", irec+1, filename);
+	}
+      grid->prec   = extInqPrec(fileID);
+      rxysize = header[3];
+      if ( rxysize != (int) grid->size ) Error("unexpected record size of %d!", rxysize);
+      ierr = extReadDataDP(fileID, vals);
+      extClose(fileID);
+    }
+  else
+    Error("format %s unsupported!", format);
+
+  return (vals);
+}
+*/
+/*
+double *readfield4(grid_t *grid, int record, char *format, char *filename)
+{
+  int fileID, rxysize, ierr, irec;
+  double *vals;
+
+  if ( grid->size == 0 )  Error("grid size = 0!");
+  if ( format == NULL )   Error("format undefined!");
+  if ( filename == NULL ) Error("file name undefined!");
+
+  vals  = (double *) malloc(4*grid->size*sizeof(double));
+
+  if ( strcmp(format, "extra") == 0 )
+    {
+      int header[4];
+      fileID = extOpen(filename, "r");
+      if ( fileID == UNDEFID ) SysError(filename);
+
+      for ( irec = 0; irec < record; irec++ )
+	{
+	  ierr = extReadHeader(fileID, header);
+	  if ( ierr <= 0 ) Error("Record %d unexpected EOF in file %s", irec+1, filename);
+	}
+      grid->prec   = extInqPrec(fileID);
+      rxysize = header[3];
+      if ( rxysize != (int) (4*grid->size) ) Error("unexpected record size of %d!", rxysize);
+      ierr = extReadDataDP(fileID, vals);
+
+      extClose(fileID);
+    }
+  else
+    Error("format %s unsupported!", format);
+
+  return (vals);
+}
+*/
+
+double readflt(const char *name, const char *pline)
+{
+  double val;
+  char *endptr;
+
+  val = strtod(pline, &endptr);
+  if ( pline == endptr )
+    Warning("Couldn't read value for %s, set to zero!", name);
+
+  return (val);
+}
+
+
+int gridFromFile(FILE *gfp, const char *dname)
+{
+  char line[MAX_LINE_LEN], *pline;
+  int gridID = -1;
+  int size;
+  size_t len;
+  grid_t grid;
+
+  gridInit(&grid);
+
+  while ( readline(gfp, line, MAX_LINE_LEN) )
+    {
+      if ( line[0] == '#' ) continue;
+      if ( line[0] == '\0' ) continue;
+      pline = line;
+      while ( isspace((int) *pline) ) pline++;
+      if ( pline[0] == '\0' ) continue;
+      if ( cmpstr(pline, "gridtype", len) == 0 )
+	{
+	  pline = skipSeparator(pline + len);
+	  if ( cmpstr(pline, "lonlat", len)  == 0 ||
+	       cmpstr(pline, "latlon", len)  == 0 )
+	    {
+	      grid.type = GRID_LONLAT;
+	      grid.nvertex = 2;
+	    }
+	  else if ( cmpstr(pline, "gaussian", len)  == 0 )
+	    {
+	      grid.type = GRID_GAUSSIAN;
+	      grid.nvertex = 2;
+	    }
+	  else if ( cmpstr(pline, "curvilinear", len)  == 0 )
+	    {
+	      grid.type = GRID_CURVILINEAR;
+	      grid.nvertex = 4;
+	    }
+	  else if ( cmpstr(pline, "spectral", len)  == 0 )
+	    grid.type = GRID_SPECTRAL;
+	  else if ( cmpstr(pline, "unstructured", len)  == 0 )
+	    grid.type = GRID_UNSTRUCTURED;
+	  else if ( cmpstr(pline, "cell", len)  == 0 )
+	    grid.type = GRID_UNSTRUCTURED;
+	  else if ( cmpstr(pline, "gme", len)  == 0 )
+	    grid.type = GRID_GME;
+	  else if ( cmpstr(pline, "reference", len)  == 0 )
+	    grid.type = GRID_REFERENCE;
+	  else if ( cmpstr(pline, "lcc2", len)  == 0 )
+	    grid.type = GRID_LCC2;
+	  else if ( cmpstr(pline, "lcc", len)  == 0 )
+	    grid.type = GRID_LCC;
+	  else if ( cmpstr(pline, "lambert", len)  == 0 )
+	    grid.type = GRID_LCC;
+	  else if ( cmpstr(pline, "sinusoidal", len)  == 0 )
+	    grid.type = GRID_SINUSOIDAL;
+	  else if ( cmpstr(pline, "laea", len)  == 0 )
+	    grid.type = GRID_LAEA;
+	  else if ( cmpstr(pline, "generic", len)  == 0 )
+	    grid.type = GRID_GENERIC;
+	  else
+	    Warning("Invalid grid name : %s", pline);
+	}
+      else if ( cmpstr(pline, "gridprec", len)  == 0 )
+	{
+	  grid.prec = atol(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "gridsize", len)  == 0 )
+	{
+	  grid.size = atol(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "truncation", len)  == 0 )
+	{
+	  grid.ntr = atoi(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "np", len)  == 0 )
+	{
+	  grid.np = atoi(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "complexpacking", len)  == 0 )
+	{
+	  grid.lcomplex = atoi(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "xname", len)  == 0 )
+	{
+	  strcpy(grid.xname, skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "xlongname", len)  == 0 )
+	{
+	  strcpy(grid.xlongname, skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "xunits", len)  == 0 )
+	{
+	  strcpy(grid.xunits, skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "yname", len)  == 0 )
+	{
+	  strcpy(grid.yname, skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "ylongname", len)  == 0 )
+	{
+	  strcpy(grid.ylongname, skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "yunits", len)  == 0 )
+	{
+	  strcpy(grid.yunits, skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "nvertex", len)  == 0 )
+	{
+	  grid.nvertex = atol(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "ni", len)  == 0 )
+	{
+	  grid.ni = atol(skipSeparator(pline + len));
+          grid.nd = 10;
+	}
+      else if ( cmpstr(pline, "position", len)  == 0 )
+	{
+	  grid.position = atol(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "number", len)  == 0 )
+	{
+	  grid.number = atol(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "path", len)  == 0 )
+	{
+	  strcpy(grid.path, skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "xsize", len)  == 0 )
+	{
+	  grid.xsize = atol(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "nlon", len)  == 0 )
+	{
+	  grid.xsize = atol(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "ysize", len)  == 0 )
+	{
+	  grid.ysize = atol(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "nlat", len)  == 0 )
+	{
+	  grid.ysize = atol(skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "xfirst", len)  == 0 )
+	{
+	  grid.xfirst = readflt("xfirst", skipSeparator(pline + len));
+	  grid.def_xfirst = TRUE;
+	}
+      else if ( cmpstr(pline, "lonfirst", len)  == 0 )
+	{
+	  grid.xfirst = readflt("lonfirst", skipSeparator(pline + len));
+	  grid.def_xfirst = TRUE;
+	}
+      else if ( cmpstr(pline, "yfirst", len)  == 0 )
+	{
+	  grid.yfirst = readflt("yfirst", skipSeparator(pline + len));
+	  grid.def_yfirst = TRUE;
+	}
+      else if ( cmpstr(pline, "latfirst", len)  == 0 )
+	{
+	  grid.yfirst = readflt("latfirst", skipSeparator(pline + len));
+	  grid.def_yfirst = TRUE;
+	}
+      else if ( cmpstr(pline, "xlast", len)  == 0 )
+	{
+	  grid.xlast = readflt("xlast", skipSeparator(pline + len));
+	  grid.def_xlast = TRUE;
+	}
+      else if ( cmpstr(pline, "lonlast", len)  == 0 )
+	{
+	  grid.xlast = readflt("lonlast", skipSeparator(pline + len));
+	  grid.def_xlast = TRUE;
+	}
+      else if ( cmpstr(pline, "ylast", len)  == 0 )
+	{
+	  grid.ylast = readflt("ylast", skipSeparator(pline + len));
+	  grid.def_ylast = TRUE;
+	}
+      else if ( cmpstr(pline, "latlast", len)  == 0 )
+	{
+	  grid.ylast = readflt("latlast", skipSeparator(pline + len));
+	  grid.def_ylast = TRUE;
+	}
+      else if ( cmpstr(pline, "xinc", len)  == 0 )
+	{
+	  grid.xinc = readflt("xinc", skipSeparator(pline + len));
+	  grid.def_xinc = TRUE;
+	}
+      else if ( cmpstr(pline, "loninc", len)  == 0 )
+	{
+	  grid.xinc = readflt("loninc", skipSeparator(pline + len));
+	  grid.def_xinc = TRUE;
+	}
+      else if ( cmpstr(pline, "yinc", len)  == 0 )
+	{
+	  grid.yinc = readflt("yinc", skipSeparator(pline + len));
+	  grid.def_yinc = TRUE;
+	}
+      else if ( cmpstr(pline, "latinc", len)  == 0 )
+	{
+	  grid.yinc = readflt("latinc", skipSeparator(pline + len));
+	  grid.def_yinc = TRUE;
+	}
+      else if ( cmpstr(pline, "originLon", len)  == 0 )
+	{
+	  grid.originLon = readflt("originLon", skipSeparator(pline + len));
+	  grid.def_originLon = TRUE;
+	}
+      else if ( cmpstr(pline, "originLat", len)  == 0 )
+	{
+	  grid.originLat = readflt("originLat", skipSeparator(pline + len));
+	  grid.def_originLat = TRUE;
+	}
+      else if ( cmpstr(pline, "lonParY", len)  == 0 )
+	{
+	  grid.lonParY = readflt("lonParY", skipSeparator(pline + len));
+	  grid.def_lonParY = TRUE;
+	}
+      else if ( cmpstr(pline, "lat1", len)  == 0 )
+	{
+	  grid.lat1 = readflt("lat1", skipSeparator(pline + len));
+	  grid.def_lat1 = TRUE;
+	}
+      else if ( cmpstr(pline, "lat2", len)  == 0 )
+	{
+	  grid.lat2 = readflt("lat2", skipSeparator(pline + len));
+	  grid.def_lat2 = TRUE;
+	}
+      else if ( cmpstr(pline, "projection", len)  == 0 )
+	{
+	  pline = skipSeparator(pline + len);
+	  if      ( cmpstr(pline, "north", len) == 0 )
+	    {
+	      grid.projflag = 0;
+	      grid.scanflag = 64;
+	    }
+	  else if ( cmpstr(pline, "south", len) == 0 )
+	    {
+	      grid.projflag = 128;
+	      grid.scanflag = 64;
+	    }
+	  else
+	    Warning("Invalid projection : %s", pline);
+	}
+      else if ( cmpstr(pline, "a", len)  == 0 )
+	{
+	  grid.a = readflt("a", skipSeparator(pline + len));
+	}
+      else if ( cmpstr(pline, "lon_0", len)  == 0 )
+	{
+	  grid.lon_0 = readflt("lon_0", skipSeparator(pline + len));
+	  grid.def_lon_0 = TRUE;
+	}
+      else if ( cmpstr(pline, "lat_0", len)  == 0 )
+	{
+	  grid.lat_0 = readflt("lat_0", skipSeparator(pline + len));
+	  grid.def_lat_0 = TRUE;
+	}
+      else if ( cmpstr(pline, "lat_1", len)  == 0 )
+	{
+	  grid.lat_1 = readflt("lat_1", skipSeparator(pline + len));
+	  grid.def_lat_1 = TRUE;
+	}
+      else if ( cmpstr(pline, "lat_2", len)  == 0 )
+	{
+	  grid.lat_2 = readflt("lat_2", skipSeparator(pline + len));
+	  grid.def_lat_2 = TRUE;
+	}
+      else if ( cmpstr(pline, "xnpole", len)  == 0 )
+	{
+	  grid.xpole = readflt("xnpole", skipSeparator(pline + len));
+	  grid.isRotated = TRUE;
+	}
+      else if ( cmpstr(pline, "lonpole", len)  == 0 )
+	{
+	  grid.xpole = readflt("lonpole", skipSeparator(pline + len));
+	  grid.isRotated = TRUE;
+	}
+      else if ( cmpstr(pline, "ynpole", len)  == 0 )
+	{
+	  grid.ypole = readflt("ynpole", skipSeparator(pline + len));
+	  grid.isRotated = TRUE;
+	}
+      else if ( cmpstr(pline, "latpole", len)  == 0 )
+	{
+	  grid.ypole = readflt("latpole", skipSeparator(pline + len));
+	  grid.isRotated = TRUE;
+	}
+      else if ( cmpstr(pline, "gridlatlon", len)  == 0 )
+	{
+	  int i;
+	  double flat = 0, flon = 0;
+	  if ( grid.size == 0 ) grid.size = grid.xsize * grid.ysize;
+	  
+	  grid.xvals = (double *) malloc(grid.size*sizeof(double));
+	  grid.yvals = (double *) malloc(grid.size*sizeof(double));
+	  for ( i = 0; i < (int) grid.size; i++ )
+	    {
+	      if ( ! readline(gfp, line, MAX_LINE_LEN) )
+		{
+		  Warning("Incomplete command: >gridlatlon<");
+		  break;
+		}
+	      sscanf(line, "%lg %lg", &flat, &flon);
+	      grid.yvals[i] = flat;
+	      grid.xvals[i] = flon;
+	    }
+	}
+      else if ( cmpstr(pline, "mask", len)  == 0 )
+	{
+	  int i = 0;
+	  long lval;
+	  char *endptr;
+
+	  size = grid.size;
+
+	  if ( size > 0 )
+	    {
+	      long count = 0;
+	      pline = skipSeparator(pline + len);
+	      grid.mask = (int *) malloc(size*sizeof(int));
+
+	      for ( i = 0; i < size; i++ )
+		{
+		  endptr = pline;
+		  lval = strtol(pline, &endptr, 10);
+		  if ( pline == endptr )
+		    {
+		      if ( ! readline(gfp, line, MAX_LINE_LEN) )
+			{
+			  Warning("Incomplete command: >mask<");
+			  break;
+			}
+		      pline = line;
+		      lval = strtol(pline, &endptr, 10);
+		    }
+		  grid.mask[i] = (int)lval;
+		  if ( grid.mask[i] == 1 ) count++;
+		  pline = endptr;
+		}
+
+	      if ( count == size )
+		{
+		  free(grid.mask);
+		  grid.mask = NULL;
+		}
+	    }
+	  else
+	    Warning("gridsize undefined!");
+	}
+      else if ( cmpstr(pline, "xvals", len)  == 0 )
+	{
+	  int i = 0;
+	  double fval;
+	  char *endptr;
+
+	  if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_UNSTRUCTURED )
+	    size = grid.size;
+	  else
+	    size = grid.xsize;
+
+	  if ( size > 0 )
+	    {
+	      pline = skipSeparator(pline + len);
+	      grid.xvals = (double *) malloc(size*sizeof(double));
+
+	      for ( i = 0; i < size; i++ )
+		{
+		  endptr = pline;
+		  fval = strtod(pline, &endptr);
+		  if ( pline == endptr )
+		    {
+		      if ( ! readline(gfp, line, MAX_LINE_LEN) )
+			{
+			  Warning("Incomplete command: >xvals<");
+			  break;
+			}
+		      pline = line;
+		      fval = strtod(pline, &endptr);
+		    }
+		  grid.xvals[i] = fval;
+		  pline = endptr;
+		}
+	    }
+	  else
+	    Warning("xsize or gridsize undefined!");
+	}
+      else if ( cmpstr(pline, "yvals", len)  == 0 )
+	{
+	  int i = 0;
+	  double fval;
+	  char *endptr;
+
+	  if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_UNSTRUCTURED )
+	    size = grid.size;
+	  else
+	    size = grid.ysize;
+
+	  if ( size > 0 )
+	    {
+	      pline = skipSeparator(pline + len);
+	      grid.yvals = (double *) malloc(size*sizeof(double));
+
+	      for ( i = 0; i < size; i++ )
+		{
+		  endptr = pline;
+		  fval = strtod(pline, &endptr);
+		  if ( pline == endptr )
+		    {
+		      if ( ! readline(gfp, line, MAX_LINE_LEN) )
+			{
+			  Warning("Incomplete command: >yvals<");
+			  break;
+			}
+		      pline = line;
+		      fval = strtod(pline, &endptr);
+		    }
+		  grid.yvals[i] = fval;
+		  pline = endptr;
+		}
+	    }
+	  else
+	    Warning("ysize or gridsize undefined!");
+	}
+      else if ( cmpstr(pline, "xbounds", len)  == 0 )
+	{
+	  int i = 0;
+	  double fval;
+	  char *endptr;
+
+	  if ( grid.nvertex == 0 )
+	    {
+	      if ( grid.type == GRID_CURVILINEAR ) grid.nvertex = 4;
+	    }
+
+	  if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_UNSTRUCTURED )
+	    size = grid.size;
+	  else
+	    size = grid.xsize;
+
+	  if ( size > 0 && grid.nvertex > 0 )
+	    {	  
+	      pline = skipSeparator(pline + len);
+	      grid.xbounds = (double *) malloc(size*grid.nvertex*sizeof(double));
+
+	      for ( i = 0; i < (int) (size*grid.nvertex); i++ )
+		{
+		  endptr = pline;
+		  fval = strtod(pline, &endptr);
+		  if ( pline == endptr )
+		    {
+		      if ( ! readline(gfp, line, MAX_LINE_LEN) )
+			{
+			  Warning("Incomplete command: >xbounds<");
+			  break;
+			}
+		      pline = line;
+		      fval = strtod(pline, &endptr);
+		    }
+		  grid.xbounds[i] = fval;
+		  pline = endptr;
+		}
+	    }
+	  else
+	    {
+	      if ( size         == 0 ) Warning("xsize or gridsize undefined!");
+	      if ( grid.nvertex == 0 ) Warning("nvertex undefined!");
+	    }
+	}
+      else if ( cmpstr(pline, "ybounds", len)  == 0 )
+	{
+	  int i = 0;
+	  double fval;
+	  char *endptr;
+
+	  if ( grid.nvertex == 0 )
+	    {
+	      if ( grid.type == GRID_CURVILINEAR ) grid.nvertex = 4;
+	    }
+
+	  if ( grid.type == GRID_CURVILINEAR || grid.type == GRID_UNSTRUCTURED )
+	    size = grid.size;
+	  else
+	    size = grid.ysize;
+
+	  if ( size > 0 && grid.nvertex > 0 )
+	    {	  
+	      pline = skipSeparator(pline + len);
+	      grid.ybounds = (double *) malloc(size*grid.nvertex*sizeof(double));
+
+	      for ( i = 0; i < (int) (size*grid.nvertex); i++ )
+		{
+		  endptr = pline;
+		  fval = strtod(pline, &endptr);
+		  if ( pline == endptr )
+		    {
+		      if ( ! readline(gfp, line, MAX_LINE_LEN) )
+			{
+			  Warning("Incomplete command: >ybounds<");
+			  break;
+			}
+		      pline = line;
+		      fval = strtod(pline, &endptr);
+		    }
+		  grid.ybounds[i] = fval;
+		  pline = endptr;
+		}
+	    }
+	  else
+	    {
+	      if ( grid.ysize   == 0 ) Warning("ysize or gridsize undefined!");
+	      if ( grid.nvertex == 0 ) Warning("nvertex undefined!");
+	    }
+	}
+      else
+	{
+	  if ( grid.type != UNDEFID )
+	    Warning("Invalid grid command : >%s<", pline);
+	}
+    }
+  /*
+  printf("gridtype %d\n", grid.type);
+  printf("gridsize %d\n", grid.size);
+  printf("xsize %d\n", grid.xsize);
+  printf("ysize %d\n", grid.ysize);
+  */
+  if ( grid.type != UNDEFID ) gridID = gridDefine(grid);
+
+  return (gridID);
+}
+
+
+void skip_nondigit_lines(FILE *gfp)
+{
+  int c;
+
+  if ( feof(gfp) ) return;
+
+  while (1)
+    {
+      do
+	c = fgetc(gfp);
+      while ( (isspace(c) || c == ',') && c != EOF );
+
+      if ( c == EOF || isdigit (c) || c == '.' || c == '+' || c == '-' ) break;
+      else
+	while ( c != '\n' && c != EOF )
+	  c = fgetc(gfp);
+    }
+
+  ungetc(c, gfp);
+}
+
+
+int input_ival(FILE *gfp, int *ival)
+{
+  int read_items;
+
+  skip_nondigit_lines(gfp);
+
+  if ( feof(gfp) ) return(0);
+
+  *ival = 0;
+  read_items = fscanf(gfp, "%d", ival);
+
+  return (read_items);
+}
+
+
+int input_darray(FILE *gfp, int n_values, double *array)
+{
+  int i;
+  int read_items;
+
+  if ( n_values <= 0 ) return (0);
+
+  read_items = 0;
+  for ( i = 0; i < n_values; i++ )
+    {
+      skip_nondigit_lines(gfp);
+
+      if ( feof(gfp) ) break;
+
+      read_items += fscanf(gfp, "%lg", &array[i]);
+
+      if ( feof(gfp) ) break;
+    }
+
+  return (read_items);
+}
+
+
+int gridFromPingo(FILE *gfp, const char *dname)
+{
+  int gridID = -1;
+  int i;
+  int nlon, nlat;
+  int lgauss = FALSE;
+  grid_t grid;
+
+  gridInit(&grid);
+
+  if ( ! input_ival(gfp, &nlon) ) return (gridID);
+  if ( ! input_ival(gfp, &nlat) ) return (gridID);
+
+  if ( nlon > 0 && nlon < 9999 && nlat > 0 && nlat < 9999 )
+    {
+      grid.xsize = nlon;
+      grid.ysize = nlat;
+
+      grid.xvals = (double *) malloc(grid.xsize*sizeof(double));
+      grid.yvals = (double *) malloc(grid.ysize*sizeof(double));
+
+      if ( ! input_ival(gfp, &nlon) ) return (gridID);
+      if ( nlon == 2 )
+	{
+	  if ( input_darray(gfp, 2, grid.xvals) != 2 ) return (gridID);
+	  grid.xvals[1] -= 360 * floor((grid.xvals[1] - grid.xvals[0]) / 360);
+
+	  if ( grid.xsize > 1 )
+	    if ( IS_EQUAL(grid.xvals[0], grid.xvals[1]) )
+	      grid.xvals[1] += 360;
+
+	  for ( i = 0; i < (int)grid.xsize; i++ )
+	    grid.xvals[i] = grid.xvals[0] + i*(grid.xvals[1] - grid.xvals[0]);
+	}
+      else if ( nlon == (int)grid.xsize )
+	{
+	  if ( input_darray(gfp, nlon, grid.xvals) != nlon ) return (gridID);
+	  for ( i = 0; i < nlon - 1; i++ )
+	    if ( grid.xvals[i+1] <= grid.xvals[i] ) break;
+
+	  for ( i++; i < nlon; i++ )
+	    {
+	      grid.xvals[i] += 360;
+	      if ( i < nlon - 1 && grid.xvals[i+1] + 360 <= grid.xvals[i] )
+		{
+		  Message("Longitudes are not in ascending order!");
+		  return (gridID);
+		}
+	    }
+	}
+      else
+	return (gridID);
+
+      if ( ! input_ival(gfp, &nlat) ) return (gridID);
+      if ( nlat == 2 )
+	{
+	  if ( input_darray(gfp, 2, grid.yvals) != 2 ) return (gridID);
+	  for ( i = 0; i < (int)grid.ysize; i++ )
+	    grid.yvals[i] = grid.yvals[0] + i*(grid.yvals[1] - grid.yvals[0]);
+	}
+      else if ( nlat == (int)grid.ysize )
+	{
+	  if ( input_darray(gfp, nlat, grid.yvals) != nlat ) return (gridID);
+	}
+      else
+	return (gridID);
+
+      if ( grid.yvals[0]      >  90.001  || 
+	   grid.yvals[nlat-1] >  90.001  || 
+	   grid.yvals[0]      < -90.001  || 
+	   grid.yvals[nlat-1] < -90.001 )
+	{
+	  Message("Latitudes must be between 90 and -90!");
+	  return (gridID);
+	}
+
+      for ( i = 0; i < nlat - 1; i++ )
+	if ( IS_EQUAL(grid.yvals[i+1], grid.yvals[i]) || (i < nlat - 2 &&
+	    ((grid.yvals[i+1] > grid.yvals[i]) != (grid.yvals[i+2] > grid.yvals[i+1]))) )
+	  {
+	    Message("Latitudes must be in descending or ascending order!");
+	    return (gridID);
+	  }
+		    
+      if ( nlat > 2 ) /* check if gaussian */
+	{
+	  double *yvals, *yw;
+	  yvals = (double *) malloc(grid.ysize*sizeof(double));
+	  yw    = (double *) malloc(grid.ysize*sizeof(double));
+	  gaussaw(yvals, yw, grid.ysize);
+	  free(yw);
+	  for ( i = 0; i < (int) grid.ysize; i++ )
+	    yvals[i] = asin(yvals[i])*rad2deg;
+
+	  for ( i = 0; i < (int) grid.ysize; i++ )
+	    if ( fabs(yvals[i] - grid.yvals[i]) > ((yvals[0] - yvals[1])/500) ) break;
+		      
+	  if ( i == (int) grid.ysize ) lgauss = TRUE;
+
+	  free(yvals);
+	}
+
+      if ( lgauss )
+	grid.type = GRID_GAUSSIAN;
+      else
+	grid.type = GRID_LONLAT;
+    }
+  
+  if ( grid.type != UNDEFID ) gridID = gridDefine(grid);
+
+  return (gridID);
+}
+
+
+int nfc2nlat(int nfc, int ntr)
+{
+  int nlat;
+
+  nlat = nfc / (ntr+1);
+  nlat /= 2;
+
+  return (nlat);
+}
+
+
+int nlat2ntr(int nlat)
+{
+  int ntr;
+
+  ntr = (nlat*2 - 1) / 3;
+
+  return (ntr);
+}
+
+
+int nlat2ntr_linear(int nlat)
+{
+  int ntr;
+
+  ntr = (nlat*2 - 1) / 2;
+
+  return (ntr);
+}
+
+
+int ntr2nlat(int ntr)
+{
+  int nlat, nlat2;
+
+  nlat = NINT((ntr*3.+1.)/2.);
+  if ( (nlat % 2) > 0 )
+    {
+      nlat  = nlat + 1;
+      nlat2 = NINT(((ntr+1)*3.+1.)/2.);
+      /*
+      if ( nlat == nlat2 )
+	Error("Computation of latitudes failed for truncation %d", ntr);
+      */
+    }
+
+  return (nlat);
+}
+
+
+int ntr2nlat_linear(int ntr)
+{
+  int nlat, nlat2;
+
+  nlat = NINT((ntr*2.+1.)/2.);
+  if ( (nlat % 2) > 0 )
+    {
+      nlat  = nlat + 1;
+      nlat2 = NINT(((ntr+1)*2.+1.)/2.);
+      /*
+      if ( nlat == nlat2 )
+	Error("Computation of latitudes failed for truncation %d", ntr);
+      */
+    }
+
+  return (nlat);
+}
+
+
+int compNlon(int nlat)
+{
+  int nlon, n;
+
+  nlon = 2 * nlat;
+
+  /* check that FFT works with nlon */
+  while ( 1 )
+    {
+      n = nlon;
+      if    ( n % 8 == 0 )  { n /= 8; }
+      while ( n % 6 == 0 )  { n /= 6; }
+      while ( n % 5 == 0 )  { n /= 5; }
+      while ( n % 4 == 0 )  { n /= 4; }
+      while ( n % 3 == 0 )  { n /= 3; }
+      if    ( n % 2 == 0 )  { n /= 2; }
+
+      if ( n <= 8 ) break;
+
+      nlon = nlon + 2;
+
+      if ( nlon > 9999 )
+	{
+	  nlon = 2 * nlat;
+	  fprintf(stderr, "FFT does not work with len %d!\n", nlon);
+	  break;
+	}
+    }
+
+  return (nlon);
+}
+
+static
+void gen_grid_lonlat(grid_t *grid, const char *pline, double inc, double lon1, double lon2, double lat1, double lat2)
+{
+  int nlon, nlat, i;
+  int gridtype = GRID_LONLAT;
+  char *endptr;
+
+  if ( *pline != 0 )
+    {
+      if ( *pline == '_' ) pline++;
+      else return;
+
+      if ( *pline == 0 ) return;
+
+      if ( ! isdigit((int) *pline) && !ispunct((int) *pline) ) return;
+
+      endptr = (char *) pline;
+      inc = strtod(pline, &endptr);
+      if ( *endptr != 0 ) return;
+
+      if ( inc < 1e-9 ) inc = 1;
+    }
+
+  grid->type = gridtype;
+
+  nlon = (int) ((lon2 - lon1)/inc + 0.5);
+  nlat = (int) ((lat2 - lat1)/inc + 0.5);
+  grid->xsize = nlon;
+  grid->ysize = nlat;
+
+  grid->xvals = (double *) malloc(grid->xsize*sizeof(double));
+  grid->yvals = (double *) malloc(grid->ysize*sizeof(double));
+
+  for ( i = 0; i < nlon; ++i ) grid->xvals[i] = lon1 + inc/2 + i*inc;
+  for ( i = 0; i < nlat; ++i ) grid->yvals[i] = lat1 + inc/2 + i*inc;
+}
+
+
+int gridFromName(const char *gridname)
+{
+  const char *pline;
+  int gridID = UNDEFID;
+  grid_t grid;
+  size_t len;
+  char *endptr;
+
+  gridInit(&grid);
+
+  if ( gridname[0] == 't' && gridname[1] == 'l' ) /* tl<RES>grid or tl<RES>spec */
+    {
+      pline = &gridname[2];
+      if ( isdigit((int) *pline) )
+	{
+	  grid.ntr = atoi(pline);
+	  while ( isdigit((int) *pline) ) pline++;
+	  if      ( cmpstr(pline, "grid", len) == 0 ) grid.type = GRID_GAUSSIAN;
+	  else if ( cmpstr(pline, "zon",  len) == 0 ) grid.type = GRID_GAUSSIAN;
+	  else if ( cmpstr(pline, "spec", len) == 0 ) grid.type = GRID_SPECTRAL;
+	  else if ( cmpstr(pline, "",     len) == 0 ) grid.type = GRID_SPECTRAL;
+      
+	  if ( pline[len] != 0 ) return (gridID);
+
+	  if ( grid.type == GRID_GAUSSIAN )
+	    {
+	      grid.ysize = ntr2nlat_linear(grid.ntr);
+	      grid.np    = grid.ysize/2;
+	      if ( cmpstr(pline, "zon",  len) == 0 )
+		grid.xsize = 1;
+	      else
+		grid.xsize = compNlon(grid.ysize);
+
+	      grid.def_xfirst = TRUE;
+	      grid.def_yfirst = TRUE;	      
+	    }
+	}
+    }
+  else if ( gridname[0] == 't' ) /* t<RES>grid or t<RES>spec */
+    {
+      pline = &gridname[1];
+      if ( isdigit((int) *pline) )
+	{
+	  grid.ntr = atoi(pline);
+	  while ( isdigit((int) *pline) ) pline++;
+	  if      ( cmpstr(pline, "grid", len) == 0 ) grid.type = GRID_GAUSSIAN;
+	  else if ( cmpstr(pline, "zon",  len) == 0 ) grid.type = GRID_GAUSSIAN;
+	  else if ( cmpstr(pline, "spec", len) == 0 ) grid.type = GRID_SPECTRAL;
+	  else if ( cmpstr(pline, "",     len) == 0 ) grid.type = GRID_SPECTRAL;
+     
+	  if ( pline[len] != 0 ) return (gridID);
+
+	  if ( grid.type == GRID_GAUSSIAN )
+	    {
+	      grid.ysize = ntr2nlat(grid.ntr);
+	      grid.np    = grid.ysize/2;
+	      if ( cmpstr(pline, "zon",  len) == 0 )
+		grid.xsize = 1;
+	      else
+		grid.xsize = compNlon(grid.ysize);
+
+	      grid.def_xfirst = TRUE;
+	      grid.def_yfirst = TRUE;	      
+	    }
+	}
+    }
+  else if ( gridname[0] == 'r' ) /* r<LON>x<LAT> */
+    {
+      pline = &gridname[1];
+      if ( isdigit((int) *pline) )
+	{
+	  grid.type = GRID_LONLAT;
+	  grid.xsize = atoi(pline);
+	  while ( isdigit((int) *pline) ) pline++;
+	  pline++;
+	  grid.ysize = atoi(pline);
+	  while ( isdigit((int) *pline) ) pline++;
+
+	  grid.def_xfirst = TRUE;
+	  grid.def_yfirst = TRUE;
+	}
+    }
+  else if ( gridname[0] == 'l' &&  gridname[1] == 'o' && gridname[2] == 'n' ) /* lon=<LON>_lat=<LAT> */
+    {
+      /* only one gridpoint */
+      pline = &gridname[3];
+      if ( *pline == '=' ) pline++;
+      if ( isdigit((int) *pline) || ispunct((int) *pline) || *pline == '-' )
+	{
+	  grid.type = GRID_LONLAT;
+	  grid.xsize = 1;
+	  grid.ysize = 1;
+	  grid.xvals = (double *) malloc(sizeof(double));
+	  grid.yvals = (double *) malloc(sizeof(double));
+	  grid.xvals[0] = atof(pline);
+	  while ( isdigit((int) *pline) || ispunct((int) *pline) || *pline == '-' ) pline++;
+	  if ( *pline == '_' ) pline++;
+	  if ( ! (pline[0] == 'l' &&  pline[1] == 'a' && pline[2] == 't') ) return(gridID);
+	  pline += 3;
+	  if ( *pline == '=' ) pline++;
+	  if ( isdigit((int) *pline) || ispunct((int) *pline) || *pline == '-' )
+	    grid.yvals[0] = atof(pline);
+	  else
+	    return (gridID);
+	}
+    }
+  else if ( gridname[0] == 'g' && gridname[1] == 'm' && gridname[2] == 'e' ) /* gme<NI> */
+    {
+      pline = &gridname[3];
+      if ( isdigit((int) *pline) )
+	{
+	  long ni = strtol(pline, &endptr, 10);
+	  if ( *endptr == 0 )
+	    {
+	      grid.type = GRID_GME;
+	      grid.ni   = ni;
+	      grid.nd   = 10;
+	      factorni(grid.ni, &grid.ni2, &grid.ni3);
+	      grid.size = (grid.ni+1)*(grid.ni+1)*10;
+	    }
+	}
+    }
+  else if ( gridname[0] == 'n' && gridname[1] == 'i' ) /* ni<NI> */
+    {
+      pline = &gridname[2];
+      if ( isdigit((int) *pline) )
+	{
+	  long ni = strtol(pline, &endptr, 10);
+	  if ( *endptr == 0 )
+	    {
+	      grid.type = GRID_GME;
+	      grid.ni   = ni;
+	      grid.nd   = 10;
+	      factorni(grid.ni, &grid.ni2, &grid.ni3);
+	      grid.size = (grid.ni+1)*(grid.ni+1)*10;
+	    }
+	}
+    }
+  else if ( gridname[0] == 'n' ) /* n<N> */
+    {
+      pline = &gridname[1];
+      if ( isdigit((int) *pline) )
+	{
+	  long np = strtol(pline, &endptr, 10);
+	  pline = endptr;
+
+	  if ( cmpstr(pline, "zon",  len) == 0 )
+	    {
+	      grid.xsize = 1;
+	      pline += 3;
+	    }
+	  else if ( *pline == 'b' )
+	    {
+	      grid.genBounds = TRUE;
+	      pline++;
+	    }
+
+	  if ( *pline == 0 )
+	    {
+	      grid.type  = GRID_GAUSSIAN;
+	      grid.np    = np;
+	      grid.ysize = np*2;
+	      if ( !grid.xsize ) grid.xsize = compNlon(grid.ysize);
+
+	      grid.def_xfirst = TRUE;
+	      grid.def_yfirst = TRUE;	      
+	    }
+	}
+    }
+  else if ( gridname[0] == 'g' && isdigit(gridname[1])) /* g<LON>x<LAT> or g<SIZE> */
+    {
+      pline = &gridname[1];
+      if ( isdigit((int) *pline) )
+	{
+	  grid.type = GRID_GENERIC;
+	  grid.xsize = atoi(pline);
+	  while ( isdigit((int) *pline) ) pline++;
+	  if ( *pline )
+	    {
+	      pline++;
+	      grid.ysize = atoi(pline);
+	      while ( isdigit((int) *pline) ) pline++;
+	    }
+	  else if ( grid.xsize == 1 )
+	    {
+	      grid.size  = 1;
+	      grid.xsize = 0;
+	    }
+	}
+    }
+  else if ( strncmp(gridname, "germany", 7) == 0 ) /* germany_Xdeg */
+    {
+      double lon1 =   5.6, lon2 = 15.2;
+      double lat1 =  47.1, lat2 = 55.1;
+      double dll = 0.1;
+
+      pline = &gridname[7];
+
+      gen_grid_lonlat(&grid, pline, dll, lon1, lon2, lat1, lat2);
+    }
+  else if ( strncmp(gridname, "europe", 6) == 0 ) /* europe_Xdeg */
+    {
+      double lon1 = -30, lon2 = 60;
+      double lat1 =  30, lat2 = 80;
+      double dll = 1;
+
+      pline = &gridname[6];
+
+      gen_grid_lonlat(&grid, pline, dll, lon1, lon2, lat1, lat2);
+    }
+  else if ( strncmp(gridname, "africa", 6) == 0 ) /* africa_Xdeg */
+    {
+      double lon1 = -20, lon2 = 60;
+      double lat1 = -40, lat2 = 40;
+      double dll = 1;
+
+      pline = &gridname[6];
+
+      gen_grid_lonlat(&grid, pline, dll, lon1, lon2, lat1, lat2);
+    }
+  else if ( strncmp(gridname, "global", 6) == 0 ) /* global_Xdeg */
+    {
+      double lon1 = -180, lon2 = 180;
+      double lat1 =  -90, lat2 =  90;
+      double dll = 1;
+
+      pline = &gridname[6];
+  
+      gen_grid_lonlat(&grid, pline, dll, lon1, lon2, lat1, lat2);
+    }
+
+  if ( grid.type != -1 ) gridID = gridDefine(grid);
+
+  return (gridID);
+}
+
+
+int cdoDefineGrid(const char *gridfile)
+{
+  FILE *gfp;
+  char buffer[4];
+  int gridID = -1;
+  size_t len;
+  struct stat filestat;
+  int fileno;
+  int isreg = FALSE;
+
+  fileno = open(gridfile, O_RDONLY);
+  if ( fileno >= 0 )
+    {
+      if ( fstat(fileno, &filestat) == 0 )
+	isreg = S_ISREG(filestat.st_mode);
+    }
+
+  if ( fileno == -1 || !isreg )
+    {
+      if ( isreg ) close(fileno);
+
+      gridID = gridFromName(gridfile);
+
+      if ( gridID == -1 ) cdoAbort("Open failed on %s!", gridfile);
+    }
+  else
+    {
+      if ( read(fileno, buffer, 4) != 4 )
+	SysError("Read grid from %s failed!", gridfile);
+
+      close(fileno);
+
+      if ( cmpstr(buffer, "CDF", len) == 0 )
+	{
+	  if ( cdoDebug ) cdoPrint("Grid from netCDF file");
+	  gridID = gridFromNCfile(gridfile);
+	}
+
+      if ( gridID == -1 )
+	{
+	  if ( cmpstr(buffer+1, "HDF", len) == 0 )
+	    {
+	      if ( cdoDebug ) cdoPrint("Grid from netCDF4 file");
+	      gridID = gridFromNCfile(gridfile);
+	    }
+	}
+
+      if ( gridID == -1 )
+	{
+	  if ( cmpstr(buffer+1, "HDF", len) == 0 )
+	    {
+	      if ( cdoDebug ) cdoPrint("Grid from HDF5 file");
+	      gridID = gridFromH5file(gridfile);
+	    }
+	}
+
+      if ( gridID == -1 )
+	{
+	  int streamID;
+	  if ( cdoDebug ) cdoPrint("Grid from CDI file");
+	  openLock();
+	  streamID = streamOpenRead(gridfile);
+	  openUnlock();
+	  if ( streamID >= 0 )
+	    {
+	      int vlistID;
+	      vlistID = streamInqVlist(streamID);
+	      gridID  = vlistGrid(vlistID, 0);
+	      streamClose(streamID);
+	    }
+	}
+
+      if ( gridID == -1 )
+	{
+	  if ( cdoDebug ) cdoPrint("grid from ASCII file");
+	  gfp = fopen(gridfile, "r");
+	  gridID = gridFromFile(gfp, gridfile);
+	  fclose(gfp);
+	}
+
+      if ( gridID == -1 )
+	{
+	  if ( cdoDebug ) cdoPrint("grid from PINGO file");
+	  gfp = fopen(gridfile, "r");
+	  gridID = gridFromPingo(gfp, gridfile);
+	  fclose(gfp);
+	}
+
+      if ( gridID == -1 ) cdoAbort("Invalid grid description file %s!", gridfile);
+    }
+
+  return (gridID);
+}
+
+
+void defineGrid(const char *gridarg)
+{
+  char gridfile[4096];
+  int nfile = 0;
+
+  while ( getoptname(gridfile, gridarg, nfile++) == 0 )
+    {      
+      (void) cdoDefineGrid(gridfile);
+    }
+}
diff --git a/src/griddes.h b/src/griddes.h
new file mode 100644
index 0000000..50b5837
--- /dev/null
+++ b/src/griddes.h
@@ -0,0 +1,72 @@
+#ifndef _GRIDDES_H
+#define _GRIDDES_H
+
+typedef struct {
+  int    *mask;
+  double *xvals;
+  double *yvals;
+  double *xbounds;
+  double *ybounds;
+  double *area;
+  double  xfirst, yfirst;
+  double  xlast, ylast;
+  double  xinc, yinc;
+  double  xpole, ypole, angle;    /* rotated north pole             */
+  double  originLon;              /* lambert                        */
+  double  originLat;
+  double  lonParY;
+  double  lat1;
+  double  lat2;
+  int     projflag;
+  int     scanflag;
+  int     def_originLon;
+  int     def_originLat;
+  int     def_lonParY;
+  int     def_lat1;
+  int     def_lat2;
+  double  a;
+  double  lon_0;
+  double  lat_0;
+  double  lat_1;
+  double  lat_2;
+  int     def_lon_0;
+  int     def_lat_0;
+  int     def_lat_1;
+  int     def_lat_2;
+  int     prec;
+  int     isRotated;              /* TRUE for rotated grids         */
+  int     type;
+  int     ntr;
+  int    *rowlon;
+  int     genBounds;
+  int     nvertex;
+  int     size;
+  int     xsize;
+  int     ysize;
+  int     np;
+  int     lcomplex;
+  int     def_xfirst;
+  int     def_yfirst;
+  int     def_xlast;
+  int     def_ylast;
+  int     def_xinc;
+  int     def_yinc;
+  int     nd, ni, ni2, ni3;
+  int     number, position;
+  char    path[16384];
+  char    xname[CDI_MAX_NAME];
+  char    xlongname[CDI_MAX_NAME];
+  char    xunits[CDI_MAX_NAME];
+  char    yname[CDI_MAX_NAME];
+  char    ylongname[CDI_MAX_NAME];
+  char    yunits[CDI_MAX_NAME];
+}
+grid_t;
+
+void gridInit(grid_t *grid);
+int gridDefine(grid_t grid);
+
+int gridFromNCfile(const char *gridfile);
+int gridFromH5file(const char *gridfile);
+
+#endif  /* _GRIDDES_H */
diff --git a/src/griddes_h5.c b/src/griddes_h5.c
new file mode 100644
index 0000000..22e917f
--- /dev/null
+++ b/src/griddes_h5.c
@@ -0,0 +1,552 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#define H5_USE_16_API
+
+#if  defined  (HAVE_LIBHDF5)
+#  include "hdf5.h"
+#endif
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "griddes.h"
+#include "error.h"
+
+
+#if  defined  (HAVE_LIBHDF5)
+static
+void nce(int istat)
+{
+  /*
+    This routine provides a simple interface to netCDF error message routine.
+  */
+  /*
+  if ( istat != NC_NOERR ) cdoAbort(nc_strerror(istat));
+  */
+}
+#endif
+
+
+#if  defined  (HAVE_LIBHDF5)
+static herr_t
+obj_info(hid_t loc_id, const char *name, void *objname)
+{
+  H5G_obj_t obj_type;
+  H5G_stat_t statbuf;
+  herr_t lexist = 0;
+
+  H5Gget_objinfo(loc_id, name, FALSE, &statbuf);
+
+  if ( strcmp(name, (char *) objname) == 0 )
+    {
+      lexist = 1;
+
+      obj_type = statbuf.type;
+
+      switch (obj_type) {
+      case H5G_GROUP:
+	if ( cdoVerbose ) cdoPrint(" Object with name %s is a group", name);
+	break;
+      case H5G_DATASET: 
+	if ( cdoVerbose ) cdoPrint(" Object with name %s is a dataset", name);
+	break;
+      case H5G_TYPE: 
+	if ( cdoVerbose ) cdoPrint(" Object with name %s is a named datatype", name);
+	break;
+      default:
+	/*cdoAbort(" Unable to identify an object %s", name);*/
+	break;
+      }
+  }
+
+  return lexist;
+}
+#endif
+
+
+#if  defined  (HAVE_LIBHDF5)
+static
+int h5find_object(hid_t file_id, char *name)
+{
+  int lexist = 0;
+
+  lexist = (int) H5Giterate(file_id, "/", NULL, obj_info, (void *) name);
+
+  return lexist;
+}
+#endif
+
+static
+void fill_gridvals(int xsize, int ysize, double *xvals, double *yvals)
+{
+  int i, j, ii, jj;
+  int index, index2;
+  double xmin, xmax, ymin, ymax;
+
+  xmin = -180;
+  xmax =  180;
+  ymin = -90;
+  ymax =  90;
+
+  for ( ii = 0; ii < xsize/2; ++ii )
+    {
+      index2 = ysize/2*xsize + ii;
+      if ( xvals[index2] > -180 && xvals[index2] < 360 )
+	{
+	  xmin = xvals[index2];
+	  break;
+	}
+    }
+
+  for ( ii = xsize-1; ii > xsize/2; --ii )
+    {
+      index2 = ysize/2*xsize + ii;
+      if ( xvals[index2] > -180 && xvals[index2] < 360 )
+	{
+	  xmax = xvals[index2];
+	  break;
+	}
+    }
+  /*
+  for ( jj = 0; jj < ysize; ++jj )
+    {
+      index2 = jj*xsize + xsize/2;
+      if ( xvals[index2] < -180 || xvals[index2] > 360 ) xvals[index2] = 0;
+      index2 = jj*xsize + xsize/2-1;
+      if ( xvals[index2] < -180 || xvals[index2] > 360 ) xvals[index2] = 0;
+    }
+  */
+  for ( jj = 0; jj < ysize/2; ++jj )
+    {
+      index2 = jj*xsize + xsize/2;
+      if ( yvals[index2] > -90 && yvals[index2] < 90 )
+	{
+	  ymax = yvals[index2];
+	  break;
+	}
+    }
+
+  for ( jj = ysize-1; jj > ysize/2; --jj )
+    {
+      index2 = jj*xsize + xsize/2;
+      if ( yvals[index2] > -90 && yvals[index2] < 90 )
+	{
+	  ymin = yvals[index2];
+	  break;
+	}
+    }
+
+  /* printf("xmin %g, xmax %g, ymin %g, ymax %g\n", xmin, xmax, ymin, ymax); */
+  
+  for ( i = 0; i < xsize*ysize; ++i )
+    {
+      if ( xvals[i] > -180 && xvals[i] < 360 )
+	{
+	  if ( xvals[i] < xmin ) xmin = xvals[i];
+	  if ( xvals[i] > xmax ) xmax = xvals[i];
+	}
+
+      if ( yvals[i] > -90 && yvals[i] < 90 )
+	{
+	  if ( yvals[i] < ymin ) ymin = yvals[i];
+	  if ( yvals[i] > ymax ) ymax = yvals[i];
+	}
+    }
+
+  for ( j = 0; j < ysize; ++j )
+    for ( i = 0; i < xsize; ++i )
+      {
+	index = j*xsize + i;
+
+	if ( xvals[index] < -180 || xvals[index] > 360 )
+	  {
+	    if ( i < xsize/2 )
+	      xvals[index] = xmin;
+	    else
+	      xvals[index] = xmax;
+	    /*
+	    if ( j < ysize/2 )
+	      for ( jj = j+1; jj < ysize/2; ++jj )
+		{
+		  index2 = jj*xsize + i;
+		  if ( xvals[index2] > -180 && xvals[index2] < 360 )
+		    {
+		      xvals[index] = xvals[index2];
+		      break;
+		    }
+		}
+	    else
+	      for ( jj = j-1; jj > ysize/2; --jj )
+		{
+		  index2 = jj*xsize + i;
+		  if ( xvals[index2] > -180 && xvals[index2] < 360 )
+		    {
+		      xvals[index] = xvals[index2];
+		      break;
+		    }
+		}
+	    */
+	    /*
+	    if ( i < xsize/2 )
+	      {
+		xvals[index] = xmin;
+		for ( ii = i+1; ii < xsize/2; ++ii )
+		  {
+		    index2 = j*xsize + ii;
+		    if ( xvals[index2] > -180 && xvals[index2] < 360 )
+		      {
+			xvals[index] = (xmin*(ii-i) + xvals[index2]*(i))/ii;
+			break;
+		      }
+		  }
+	      }
+	    else
+	      {
+		for ( ii = i-1; ii >= xsize/2; --ii )
+		  {
+		    index2 = j*xsize + ii;
+		    if ( xvals[index2] > -180 && xvals[index2] < 360 )
+		      {
+			xvals[index] = (xmax*(i-ii) + xvals[index2]*((xsize-1)-i))/(xsize-1-ii);
+			break;
+		      }
+		  }
+	      }
+	    */
+	  }
+
+	if ( yvals[index] < -90 || yvals[index] > 90 )
+	  {
+	    if ( j < ysize/2 )
+	      yvals[index] = ymax;
+	    else
+	      yvals[index] = ymin;
+
+	    if ( i < xsize/2 )
+	      for ( ii = i+1; ii < xsize/2; ++ii )
+		{
+		  index2 = j*xsize + ii;
+		  if ( yvals[index2] > -90 && yvals[index2] < 90 )
+		    {
+		      yvals[index] = yvals[index2];
+		      break;
+		    }
+		}
+	    else
+	      for ( ii = i-1; ii > xsize/2; --ii )
+		{
+		  index2 = j*xsize + ii;
+		  if ( yvals[index2] > -90 && yvals[index2] < 90 )
+		    {
+		      yvals[index] = yvals[index2];
+		      break;
+		    }
+		}
+	  }
+      }
+}
+
+
+void correct_sinxvals(int xsize, int ysize, double *xvals)
+{
+  long i, j, istart, index;
+  double xmin, xmax;
+
+  xmin = -180;
+  xmax =  180;
+
+  for ( j = 0; j < ysize; ++j )
+    {
+      istart = xsize/2-1;
+      xmin = xvals[j*xsize+istart];
+      for ( i = istart-1; i >= 0; i-- )
+	{
+	  index = j*xsize+i;
+	  if ( xvals[index] > xmin ) break;
+	  xmin = xvals[index];
+	}
+
+      if ( i >= 0 )
+	{
+	  istart = i;
+	  // printf("%d %d %g\n",j,i, xmin);
+	  for ( i = 0; i <= istart; ++i )
+	    {
+	      index = j*xsize+i;
+	      xvals[index] = xmin;
+	    }
+	}
+
+      istart = xsize/2;
+      xmax = xvals[j*xsize+istart];
+      for ( i = istart+1; i < xsize; i++ )
+	{
+	  index = j*xsize+i;
+	  if ( xvals[index] < xmax ) break;
+	  xmax = xvals[index];
+	}
+
+      if ( i < xsize )
+	{
+	  istart = i;
+	  // printf("%d %d %g\n",j,i, xmax);
+	  for ( i = istart; i < xsize; ++i )
+	    {
+	      index = j*xsize+i;
+	      xvals[index] = xmax;
+	    }
+	}
+    }
+}
+
+
+int gridFromH5file(const char *gridfile)
+{
+  int gridID = -1;
+#if  defined  (HAVE_LIBHDF5)
+  hid_t	  file_id;	/* HDF5 File ID	        	*/
+  hid_t	  lon_id = -1;	/* Dataset ID	        	*/
+  hid_t	  lat_id = -1;	/* Dataset ID	        	*/
+  hid_t   dataspace;   
+  hsize_t dims_out[9];  /* dataset dimensions           */
+  herr_t  status;	/* Generic return value		*/
+  int     rank;
+  grid_t    grid;
+
+
+  gridInit(&grid);
+
+  /* Open an existing file. */
+  file_id = H5Fopen(gridfile, H5F_ACC_RDONLY, H5P_DEFAULT);
+  if ( file_id < 0 ) return(gridID);
+
+  if ( h5find_object(file_id, "lon") > 0 && 
+       h5find_object(file_id, "lat") > 0 )
+    {
+      lon_id = H5Dopen(file_id, "/lon");
+      lat_id = H5Dopen(file_id, "/lat");
+    }
+  else if ( h5find_object(file_id, "Longitude") > 0 && 
+	    h5find_object(file_id, "Latitude") > 0 )
+    {
+      lon_id = H5Dopen(file_id, "/Longitude");
+      lat_id = H5Dopen(file_id, "/Latitude");
+    }
+  
+  if ( lon_id >= 0 && lat_id >= 0 )
+    {
+      hid_t type_id;
+      hid_t native_type;
+      int ftype = 0;
+
+      dataspace = H5Dget_space(lon_id);    /* dataspace handle */
+      rank      = H5Sget_simple_extent_ndims(dataspace);
+      status    = H5Sget_simple_extent_dims(dataspace, dims_out, NULL);
+
+      if ( rank != 2 )
+	{
+	  cdoWarning("Unexpected rank = %d!", rank);
+	  goto RETURN;
+	}
+      /*
+      printf("\nRank: %d\nDimensions: %lu x %lu \n", rank,
+	     (unsigned long)(dims_out[1]), (unsigned long)(dims_out[0]));
+      */
+
+      type_id = H5Dget_type(lon_id);  /* get datatype*/
+
+      native_type = H5Tget_native_type(type_id, H5T_DIR_ASCEND);
+      if      ( H5Tequal(native_type, H5T_NATIVE_SCHAR)  > 0 ) {ftype=0;}
+      else if ( H5Tequal(native_type, H5T_NATIVE_UCHAR)  > 0 ) {ftype=0;}
+      else if ( H5Tequal(native_type, H5T_NATIVE_SHORT)  > 0 ) {ftype=0;}
+      else if ( H5Tequal(native_type, H5T_NATIVE_USHORT) > 0 ) {ftype=0;}
+      else if ( H5Tequal(native_type, H5T_NATIVE_INT)    > 0 ) {ftype=0;}
+      else if ( H5Tequal(native_type, H5T_NATIVE_UINT)   > 0 ) {ftype=0;}
+      else if ( H5Tequal(native_type, H5T_NATIVE_FLOAT)  > 0 ) {ftype=1;}
+      else if ( H5Tequal(native_type, H5T_NATIVE_DOUBLE) > 0 ) {ftype=1;}
+      else
+	{
+	  cdoWarning("Grid has unsupported native datatype!");
+	  goto RETURN;
+	}
+      H5Tclose(native_type);
+
+      grid.xsize = (int)dims_out[1];
+      grid.ysize = (int)dims_out[0];
+      grid.size  = grid.xsize*grid.ysize;
+
+      grid.xvals = (double *) malloc(grid.size*sizeof(double));
+      grid.yvals = (double *) malloc(grid.size*sizeof(double));
+
+      if ( ftype )
+	{
+	  status = H5Dread(lon_id, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, grid.xvals);
+	  status = H5Dread(lat_id, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, grid.yvals);
+	}
+      else
+	{
+	  int *iarray, i;
+	  iarray = (int *) malloc(grid.size*sizeof(int));
+	  status = H5Dread(lon_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, iarray);
+	  for ( i = 0; i < grid.size; ++i ) grid.xvals[i] = iarray[i];
+	  status = H5Dread(lat_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, iarray);
+	  for ( i = 0; i < grid.size; ++i ) grid.yvals[i] = iarray[i];
+	  free(iarray);
+	}
+
+      status = H5Sclose(dataspace);
+
+      /* Close the dataset. */
+      status = H5Dclose(lon_id);
+      status = H5Dclose(lat_id);
+
+      fill_gridvals(grid.xsize, grid.ysize, grid.xvals, grid.yvals);
+
+      grid.type = GRID_CURVILINEAR;
+      grid.prec = DATATYPE_FLT32;
+
+      gridID = gridDefine(grid);
+    }
+  else  if ( h5find_object(file_id, "where") > 0 )
+    {
+      double xscale = 1, yscale = 1;
+      double xoffset = 0, yoffset = 0;
+      hid_t grp_id;
+      hid_t att_id;
+      int i;
+
+      grp_id = H5Gopen(file_id, "/where/lon/what");
+      if ( grp_id >= 0 )
+	{
+	  att_id = H5Aopen_name(grp_id, "gain");
+	  if ( att_id >= 0 )
+	    {
+	      status = H5Aread(att_id, H5T_NATIVE_DOUBLE, &xscale);
+	      H5Aclose(att_id);
+	    }
+
+	  att_id = H5Aopen_name(grp_id, "offset");
+	  if ( att_id >= 0 )
+	    {
+	      status = H5Aread(att_id, H5T_NATIVE_DOUBLE, &xoffset);
+	      H5Aclose(att_id);
+	    }
+	  
+	  H5Gclose(grp_id);
+	}
+
+      grp_id = H5Gopen(file_id, "/where/lat/what");
+      if ( grp_id >= 0 )
+	{
+	  att_id = H5Aopen_name(grp_id, "gain");
+	  if ( att_id >= 0 )
+	    {
+	      status = H5Aread(att_id, H5T_NATIVE_DOUBLE, &yscale);
+	      H5Aclose(att_id);
+	    }
+
+	  att_id = H5Aopen_name(grp_id, "offset");
+	  if ( att_id >= 0 )
+	    {
+	      status = H5Aread(att_id, H5T_NATIVE_DOUBLE, &yoffset);
+	      H5Aclose(att_id);
+	    }
+	  
+	  H5Gclose(grp_id);
+	}
+
+      /* Open an existing dataset. */
+      lon_id = H5Dopen(file_id, "/where/lon/data");
+      if ( lon_id >= 0 )
+	lat_id = H5Dopen(file_id, "/where/lat/data");
+
+      if ( lon_id >= 0 && lat_id >= 0 )
+	{
+	  hid_t type_id;
+	  hid_t native_type;
+	  int ftype = 0;
+
+	  dataspace = H5Dget_space(lon_id);    /* dataspace handle */
+	  rank      = H5Sget_simple_extent_ndims(dataspace);
+	  status    = H5Sget_simple_extent_dims(dataspace, dims_out, NULL);
+
+	  if ( rank != 2 )
+	    {
+	      cdoWarning("Unexpected rank = %d!", rank);
+	      goto RETURN;
+	    }
+	  /*
+	  printf("\nRank: %d\nDimensions: %lu x %lu \n", rank,
+		 (unsigned long)(dims_out[1]), (unsigned long)(dims_out[0]));
+	  */
+
+	  type_id = H5Dget_type(lon_id);  /* get datatype*/
+
+	  native_type = H5Tget_native_type(type_id, H5T_DIR_ASCEND);
+	  if      ( H5Tequal(native_type, H5T_NATIVE_SCHAR)  > 0 ) {ftype=0;}
+	  else if ( H5Tequal(native_type, H5T_NATIVE_UCHAR)  > 0 ) {ftype=0;}
+	  else if ( H5Tequal(native_type, H5T_NATIVE_SHORT)  > 0 ) {ftype=0;}
+	  else if ( H5Tequal(native_type, H5T_NATIVE_USHORT) > 0 ) {ftype=0;}
+	  else if ( H5Tequal(native_type, H5T_NATIVE_INT)    > 0 ) {ftype=0;}
+	  else if ( H5Tequal(native_type, H5T_NATIVE_UINT)   > 0 ) {ftype=0;}
+	  else if ( H5Tequal(native_type, H5T_NATIVE_FLOAT)  > 0 ) {ftype=1;}
+	  else if ( H5Tequal(native_type, H5T_NATIVE_DOUBLE) > 0 ) {ftype=1;}
+	  else
+	    {
+	      cdoWarning("Grid has unsupported native datatype!");
+	      goto RETURN;
+	    }
+	  H5Tclose(native_type);
+
+	  grid.xsize = (int)dims_out[1];
+	  grid.ysize = (int)dims_out[0];
+	  grid.size  = grid.xsize*grid.ysize;
+
+	  grid.xvals = (double *) malloc(grid.size*sizeof(double));
+	  grid.yvals = (double *) malloc(grid.size*sizeof(double));
+
+	  if ( ftype )
+	    {
+	      status = H5Dread(lon_id, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, grid.xvals);
+	      status = H5Dread(lat_id, H5T_NATIVE_DOUBLE, H5S_ALL, H5S_ALL, H5P_DEFAULT, grid.yvals);
+	    }
+	  else
+	    {
+	      int *iarray, i;
+	      iarray = (int *) malloc(grid.size*sizeof(int));
+	      status = H5Dread(lon_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, iarray);
+	      for ( i = 0; i < grid.size; ++i ) grid.xvals[i] = iarray[i];
+	      status = H5Dread(lat_id, H5T_NATIVE_INT, H5S_ALL, H5S_ALL, H5P_DEFAULT, iarray);
+	      for ( i = 0; i < grid.size; ++i ) grid.yvals[i] = iarray[i];
+	      free(iarray);
+	    }
+
+	  status = H5Sclose(dataspace);
+	  
+	  /* Close the dataset. */
+	  status = H5Dclose(lon_id);
+	  status = H5Dclose(lat_id);
+
+	  for ( i = 0; i < grid.size; ++i ) grid.xvals[i] = grid.xvals[i]*xscale + xoffset;
+	  for ( i = 0; i < grid.size; ++i ) grid.yvals[i] = grid.yvals[i]*yscale + yoffset;
+
+	  grid.type = GRID_CURVILINEAR;
+	  grid.prec = DATATYPE_FLT32;
+
+	  gridID = gridDefine(grid);
+	}
+    }
+
+  /* Close file */
+  status = H5Fclose(file_id);
+
+ RETURN:
+
+#else
+  cdoWarning("HDF5 support not compiled in!");
+#endif
+
+  return (gridID);
+}
diff --git a/src/griddes_nc.c b/src/griddes_nc.c
new file mode 100644
index 0000000..edfa39e
--- /dev/null
+++ b/src/griddes_nc.c
@@ -0,0 +1,332 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if  defined  (HAVE_LIBNETCDF)
+#  include "netcdf.h"
+#endif
+
+#include <stdio.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "griddes.h"
+#include "error.h"
+
+
+#if  defined  (HAVE_LIBNETCDF)
+static void nce(int istat)
+{
+  /*
+    This routine provides a simple interface to netCDF error message routine.
+  */
+
+  if ( istat != NC_NOERR ) cdoAbort(nc_strerror(istat));
+}
+#endif
+
+
+int cdf_openread(const char *filename)
+{
+  int fileID = -1;
+#if  defined  (HAVE_LIBNETCDF)
+  int nc_file_id;      /* netCDF grid file id           */
+
+  openLock();
+  nce(nc_open(filename, NC_NOWRITE, &nc_file_id));
+  openUnlock();
+  fileID = nc_file_id;
+#else
+  cdoWarning("netCDF support not compiled in!");
+#endif
+
+  return (fileID);
+}
+
+
+int gridFromNCfile(const char *gridfile)
+{
+  int gridID = -1;
+#if  defined  (HAVE_LIBNETCDF)
+  int nc_file_id;      /* netCDF grid file id           */
+  int nc_gridsize_id;  /* netCDF grid size dim id       */
+  int nc_gridcorn_id;  /* netCDF grid corner dim id     */
+  int nc_gridrank_id;  /* netCDF grid rank dim id       */
+  int nc_griddims_id;  /* netCDF grid dimension size id */
+  int nc_gridclat_id;  /* netCDF grid corner lat var id */
+  int nc_gridclon_id;  /* netCDF grid corner lon var id */
+  int nc_gridlat_id;   /* netCDF grid center lat var id */
+  int nc_gridlon_id;   /* netCDF grid center lon var id */
+  int nc_gridmask_id;  /* netCDF grid mask id           */
+
+  nc_type xtype;
+  size_t attlen;
+  size_t grid_rank, grid_size, grid_nvertex;
+  int grid_dims[2];
+  grid_t grid;
+
+
+  gridInit(&grid);
+
+  /* open grid file and read grid size/name data */
+  
+  nc_file_id = cdf_openread(gridfile);
+
+  if ( nc_inq_dimid(nc_file_id, "grid_size", &nc_gridsize_id)    == NC_NOERR &&
+       nc_inq_dimid(nc_file_id, "grid_rank", &nc_gridrank_id)    == NC_NOERR &&
+       nc_inq_dimid(nc_file_id, "grid_corners", &nc_gridcorn_id) == NC_NOERR )
+    {
+      nce(nc_inq_dimlen(nc_file_id, nc_gridsize_id, &grid_size)); grid.size = (int) grid_size;
+      nce(nc_inq_dimlen(nc_file_id, nc_gridrank_id, &grid_rank));
+      nce(nc_inq_dimlen(nc_file_id, nc_gridcorn_id, &grid_nvertex)); grid.nvertex = (int) grid_nvertex;
+  
+      /* check variables */
+      if ( nc_inq_varid(nc_file_id, "grid_dims", &nc_griddims_id)       != NC_NOERR || 
+	   nc_inq_varid(nc_file_id, "grid_center_lat", &nc_gridlat_id)  != NC_NOERR || 
+	   nc_inq_varid(nc_file_id, "grid_center_lon", &nc_gridlon_id)  != NC_NOERR || 
+	   nc_inq_varid(nc_file_id, "grid_corner_lat", &nc_gridclat_id) != NC_NOERR || 
+	   nc_inq_varid(nc_file_id, "grid_corner_lon", &nc_gridclon_id) != NC_NOERR ) return (gridID);
+
+      nce(nc_get_var_int(nc_file_id, nc_griddims_id, grid_dims));
+
+      if ( grid_rank == 1 )
+	{
+	  grid.type = GRID_UNSTRUCTURED;
+	  if ( (size_t)grid_dims[0] != grid_size ) return(gridID);
+	}
+      else
+	{
+	  grid.type = GRID_CURVILINEAR;
+	  if ( grid.nvertex != 4 )
+	    Error("curvilinear grid with %d corners unsupported", grid.nvertex);
+
+	  grid.xsize = grid_dims[0];
+	  grid.ysize = grid_dims[1];
+	  if ( (size_t)grid_dims[0]*grid_dims[1] != grid_size ) return(gridID);
+	}
+
+      /* allocate grid coordinates and read data */
+
+      grid.xvals   = (double *) malloc(grid.size*sizeof(double));
+      grid.yvals   = (double *) malloc(grid.size*sizeof(double));
+      grid.xbounds = (double *) malloc(grid.nvertex*grid.size*sizeof(double));
+      grid.ybounds = (double *) malloc(grid.nvertex*grid.size*sizeof(double));
+
+      nce(nc_inq_vartype(nc_file_id, nc_gridlat_id, &xtype));
+      if ( xtype == NC_FLOAT )  grid.prec = DATATYPE_FLT32;
+      else                      grid.prec = DATATYPE_FLT64;
+
+      nce(nc_get_var_double(nc_file_id, nc_gridlon_id, grid.xvals));
+      nce(nc_get_var_double(nc_file_id, nc_gridlat_id, grid.yvals));
+      nce(nc_get_var_double(nc_file_id, nc_gridclon_id, grid.xbounds));
+      nce(nc_get_var_double(nc_file_id, nc_gridclat_id, grid.ybounds));
+
+      nce(nc_inq_attlen(nc_file_id, nc_gridlon_id, "units", &attlen));
+      nce(nc_get_att_text(nc_file_id, nc_gridlon_id, "units", grid.xunits));
+      grid.xunits[attlen] = 0;
+      nce(nc_inq_attlen(nc_file_id, nc_gridlat_id, "units", &attlen));
+      nce(nc_get_att_text(nc_file_id, nc_gridlat_id, "units", grid.yunits));
+      grid.yunits[attlen] = 0;
+
+      if ( nc_inq_varid(nc_file_id, "grid_imask", &nc_gridmask_id) == NC_NOERR )
+	{
+	  int i;
+	  grid.mask = (int *) malloc(grid.size*sizeof(int));
+	  nce(nc_get_var_int(nc_file_id, nc_gridmask_id, grid.mask));
+	  for ( i = 0; i < grid.size; ++i )
+	    if ( grid.mask[i] != 1 ) break;
+
+	  if ( i == grid.size )
+	    {
+	      free(grid.mask);
+	      grid.mask = NULL;
+	    }
+	}
+
+      gridID = gridDefine(grid);
+    }
+
+  nce(nc_close(nc_file_id));
+
+#else
+  cdoWarning("netCDF support not compiled in!");
+#endif
+
+  return (gridID);
+}
+
+
+void writeNCgrid(const char *gridfile, int gridID, int *grid_imask)
+{
+#if  defined  (HAVE_LIBNETCDF)
+  int nc_file_id;      /* netCDF grid file id           */
+  int nc_gridsize_id;  /* netCDF grid size dim id       */
+  int nc_gridcorn_id;  /* netCDF grid corner dim id     */
+  int nc_gridrank_id;  /* netCDF grid rank dim id       */
+  int nc_griddims_id;  /* netCDF grid dimension size id */
+  int nc_gridclat_id;  /* netCDF grid corner lat var id */
+  int nc_gridclon_id;  /* netCDF grid corner lon var id */
+  int nc_gridlat_id;   /* netCDF grid center lat var id */
+  int nc_gridlon_id;   /* netCDF grid center lon var id */
+  int nc_gridxsize_id, nc_gridysize_id, nc_grdimask_id;
+
+  nc_type xtype;
+  size_t grid_rank = 0, len;
+  int grid_dims[2];
+  int nc_dims_id[3], ndims;
+  int gridtype;
+  int gridsize;
+  double *vals;
+  char units[CDI_MAX_NAME];
+
+
+  gridtype = gridInqType(gridID);
+  gridsize = gridInqSize(gridID);
+
+  if ( gridInqPrec(gridID) == DATATYPE_FLT64 ) xtype = NC_DOUBLE;
+  else                                         xtype = NC_FLOAT;
+
+  if ( gridtype == GRID_CURVILINEAR )
+    {
+      grid_rank = 2;
+      grid_dims[0] = gridInqXsize(gridID);
+      grid_dims[1] = gridInqYsize(gridID);
+    }
+  else if ( gridtype == GRID_UNSTRUCTURED )
+    {
+      grid_rank = 1;
+      grid_dims[0] = gridInqSize(gridID);
+    }
+  else
+    {
+    }
+
+  gridInqYunits(gridID, units);
+  if      ( memcmp(units, "degrees", 7) == 0 )
+    units[7] = 0;
+  else if ( memcmp(units, "radian", 6) == 0 )
+    units[6] = 0;
+  else
+    cdoWarning("Unknown units supplied for grid!");
+
+  /* create netCDF dataset for this grid */
+  
+  nce(nc_create(gridfile, NC_CLOBBER, &nc_file_id));
+
+  len = strlen(gridfile);
+  if ( gridfile[len-2] == 'n' && gridfile[len-1] == 'c' ) len -= 3;
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "title", len, gridfile));
+
+  /* define grid size dimension */
+
+  nce(nc_def_dim (nc_file_id, "grid_size", gridsize, &nc_gridsize_id));
+  if ( gridtype == GRID_CURVILINEAR )
+    {
+      nce(nc_def_dim(nc_file_id, "grid_xsize", gridInqXsize(gridID), &nc_gridxsize_id));
+      nce(nc_def_dim(nc_file_id, "grid_ysize", gridInqYsize(gridID), &nc_gridysize_id));
+    }
+
+  /* define grid corner dimension */
+
+  nce(nc_def_dim(nc_file_id, "grid_corners", gridInqNvertex(gridID), &nc_gridcorn_id));
+
+  /* define grid rank dimension */
+
+  nce(nc_def_dim(nc_file_id, "grid_rank", grid_rank, &nc_gridrank_id));
+
+  /* define grid dimension size array */
+
+  nce(nc_def_var(nc_file_id, "grid_dims", NC_INT, 1, &nc_gridrank_id, &nc_griddims_id));
+
+  /* define grid center latitude array */
+
+  if ( gridtype == GRID_CURVILINEAR )
+    {
+      ndims = 2;
+      nc_dims_id[0] = nc_gridysize_id;
+      nc_dims_id[1] = nc_gridxsize_id;
+    }
+  else
+    {
+      ndims = 1;
+      nc_dims_id[0] = nc_gridsize_id;
+    }
+
+  nce(nc_def_var(nc_file_id, "grid_center_lat", xtype, ndims, nc_dims_id, &nc_gridlat_id));
+
+  nce(nc_put_att_text(nc_file_id, nc_gridlat_id, "units", strlen(units), units));
+  nce(nc_put_att_text(nc_file_id, nc_gridlat_id, "bounds", 15, "grid_corner_lat"));
+
+  /* define grid center longitude array */
+
+  nce(nc_def_var(nc_file_id, "grid_center_lon", xtype, ndims, nc_dims_id, &nc_gridlon_id));
+ 
+  nce(nc_put_att_text(nc_file_id, nc_gridlon_id, "units", strlen(units), units));
+  nce(nc_put_att_text(nc_file_id, nc_gridlon_id, "bounds", 15, "grid_corner_lon"));
+
+  /* define grid mask */
+
+  nce(nc_def_var(nc_file_id, "grid_imask", NC_INT, ndims, nc_dims_id, &nc_grdimask_id));
+
+  nce(nc_put_att_text(nc_file_id, nc_grdimask_id, "units", 8, "unitless"));
+  nce(nc_put_att_text(nc_file_id, nc_grdimask_id, "coordinates", 31, "grid_center_lon grid_center_lat"));
+
+  /* define grid corner latitude array */
+
+  if ( gridtype == GRID_CURVILINEAR )
+    {
+      ndims = 3;
+      nc_dims_id[0] = nc_gridysize_id;
+      nc_dims_id[1] = nc_gridxsize_id;
+      nc_dims_id[2] = nc_gridcorn_id;
+    }
+  else
+    {
+      ndims = 2;
+      nc_dims_id[0] = nc_gridsize_id;
+      nc_dims_id[1] = nc_gridcorn_id;
+    }
+
+  nce(nc_def_var(nc_file_id, "grid_corner_lat", xtype, ndims, nc_dims_id, &nc_gridclat_id));
+
+  nce(nc_put_att_text(nc_file_id, nc_gridclat_id, "units", strlen(units), units));
+
+  /* define grid corner longitude array */
+
+  nce(nc_def_var(nc_file_id, "grid_corner_lon", xtype, ndims, nc_dims_id, &nc_gridclon_id));
+
+  nce(nc_put_att_text(nc_file_id, nc_gridclon_id, "units", strlen(units), units));
+
+  /* end definition stage */
+
+  nce(nc_enddef(nc_file_id));
+
+  /*  write grid data */
+
+  nce(nc_put_var_int(nc_file_id, nc_griddims_id, grid_dims));
+
+  nce(nc_put_var_int(nc_file_id, nc_grdimask_id, grid_imask));
+
+  vals = (double *) malloc(gridInqNvertex(gridID)*gridsize*sizeof(double));
+
+  gridInqYvals(gridID, vals);
+  nce(nc_put_var_double(nc_file_id, nc_gridlat_id, vals));
+
+  gridInqXvals(gridID, vals);
+  nce(nc_put_var_double(nc_file_id, nc_gridlon_id, vals));
+
+  gridInqYbounds(gridID, vals);
+  nce(nc_put_var_double(nc_file_id, nc_gridclat_id, vals));
+
+  gridInqXbounds(gridID, vals);
+  nce(nc_put_var_double(nc_file_id, nc_gridclon_id, vals));
+
+  free(vals);
+
+  nce(nc_close(nc_file_id));
+
+#else
+  Error("netCDF support not compiled in!");
+#endif
+}
diff --git a/src/hetaeta.c b/src/hetaeta.c
new file mode 100644
index 0000000..afec87a
--- /dev/null
+++ b/src/hetaeta.c
@@ -0,0 +1,1113 @@
+/*
+#define  NGP    100000
+#define  OUTPUT 1
+#define  OPOINT 34179
+*/
+
+#if defined (_OPENMP)
+#  include <omp.h>
+#endif
+
+#include <math.h>
+#include <stdlib.h>
+#include <stdio.h>
+
+#include "hetaeta.h"
+
+const double ap0  = 100000.0;
+const double apr  = 101325.0;   /* reference pressure */
+const double aipr = 1.0/101325.0;
+
+const double p_firef = 40000.0; /* pressure of reference geopotential */
+
+const double epsilon = 0.622;
+const double rair    = 287.04;
+const double cpair   = 1004.6;
+
+const double eta_pbl = 0.8;     /* upper limit of BPL eta coordiante */
+
+const double g = 9.81;
+
+#if defined (OUTPUT)
+FILE *old, *new;
+#endif
+
+
+static
+long int_index(long n, double *x1, double x2)
+{
+  long klo, khi, k;
+
+  klo = 0;
+  khi = n-1;
+
+  while ( khi-klo > 1 )
+    {
+      k = (khi+klo)/2;
+      if (x1[k] > x2)
+	khi = k;
+      else
+	klo = k;
+    }
+
+  /*
+  for ( klo = 0; klo < n-1; klo++ )
+    if ( x2 >= x1[klo] && x2 < x1[klo+1] ) break;
+  */
+  /* printf("%d %d %g %g %g\n", klo, khi, x1[klo], x1[klo+1], x2); */
+
+  return (klo);
+}
+
+static
+double esat(double temperature)
+{
+  double zes;
+  double es;
+  double tc;
+
+  tc = temperature-273.16;
+
+  if ( tc < 0.0 )
+    zes = 21.8745584*tc / (temperature-7.66);
+  else
+    zes = 17.2693882*tc / (temperature-35.86);
+
+  es = 610.78*exp(zes);
+
+  return es;
+}
+
+
+#define MAX_VARS  512
+
+/* Source from INTERA */
+
+void hetaeta_sc(int ltq, int lpsmod, long ij, long ngp, long nlev1, long nlev2, long nvars,
+		const double *restrict af1, const double *restrict bf1, const double *restrict etah2,
+		const double *restrict af2, const double *restrict bf2, const double *restrict w1, 
+		const double *restrict w2, const long *restrict jl1, const long *restrict jl2,
+		const double *restrict ah1, const double *restrict bh1, const double *restrict ps1, 
+		double epsm1i, const double *restrict q1, const double *restrict t1, 
+		const double *restrict fis1, const double *restrict fis2, double *restrict ps2,
+		const double *restrict ah2, const double *restrict bh2, double *restrict *restrict vars1,
+		double *restrict *restrict vars2, double *restrict t2, double *restrict q2,
+		double *restrict tscor, double *restrict pscor, double *restrict secor, long jblt,
+		double *restrict ph1, double *restrict lnph1, double *restrict fi1, double *restrict pf1,
+		double *restrict lnpf1, double *restrict tv1, double *restrict theta1, double *restrict rh1,
+		double *restrict zvar, double *restrict ph2, double *restrict lnph2, double *restrict fi2,
+		double *restrict pf2, double *restrict rh2, double *restrict wgt, long *restrict idx,
+		double *restrict rh_pbl, double *restrict theta_pbl, double *restrict *restrict vars_pbl, 
+		double *restrict zt2, double *restrict zq2)
+{
+  long k, iv, ijk, ijk1, ijk2;
+  long jlev = 0, jlevr, jnop;
+  long klo;
+  long nlev1p1, nlev2p1;
+  long jjblt;
+  double zq1, zt1;
+  double zdff, zdffl, ztv, zb, zbb, zc, zps;
+  double zsump, zsumpp, zsumt, zsumtp;
+  double dfi, fiadj = 0, dteta = 0;
+  double pbl_lim, pbl_lim_need;
+  double rair_d_cpair;
+
+  rair_d_cpair = rair/cpair;
+
+  nlev1p1 = nlev1+1;
+  nlev2p1 = nlev2+1;
+
+  /******* initialise atmospheric fields in old system */
+  
+  /* pressure */
+  ph1[0]       =  0.0;
+  lnph1[0]     = -1.0; 
+  for ( k = 1; k < nlev1p1; ++k )
+    {
+      ph1[k]   = ah1[k]+bh1[k]*ps1[ij];
+      lnph1[k] = log(ph1[k]);
+    } 
+
+  for ( k = 0; k < nlev1; ++k )
+    {
+      pf1[k]   = af1[k]+bf1[k]*ps1[ij];
+      lnpf1[k] = log(pf1[k]);
+    }
+
+  /* virtual temperature, relative humidity, potential temperature */
+  if ( ltq )
+    for ( k = 0; k < nlev1; ++k )
+      {
+	ijk = k*ngp+ij;
+	zq1 = q1[ijk];
+	zt1 = t1[ijk];
+	tv1[k]    = (1.0+epsm1i*zq1)*zt1;
+	rh1[k]    = zq1*pf1[k]/(epsilon*esat(zt1));
+	theta1[k] = zt1*pow(apr/pf1[k], rair_d_cpair);
+      }
+
+  /* ****** integrate hydrostatic equation, using interpolated orography */
+  if ( ltq )
+    {
+      fi1[0] = 0.0;
+      fi1[nlev1] = fis1[ij];
+      for ( k = nlev1-1; k > 0; --k )
+	{
+	  fi1[k] = fi1[k+1]+rair*tv1[k]*(lnph1[k+1]-lnph1[k]);
+	}
+    }
+#if defined (OUTPUT)
+  if ( ij == OPOINT )
+    for ( k = nlev1-1; k >= 0; --k )
+      { 
+	ijk = k*ngp+ij;
+	if ( ltq ) { t = t1[ijk]; q = q1[ijk]; fi = fi1[k]; }
+	else       { t = 0; q = 0; fi = 0; }
+	fprintf(old, "%3d %18.10f %18.10f %18.10f %18.10f", k, fi/g, pf1[k], t, q);
+	for ( iv = 0; iv < nvars; ++iv ) fprintf(old, " %18.10f", vars1[iv][ijk]);
+	fprintf(old, "\n");
+      }
+#endif
+
+  /******* find new surface pressure
+	   extra-/interpolate to new orography
+	   linear regression works not well for extrapolation
+	   separation necessary
+  */
+  if ( ltq )
+    {
+      for ( k = nlev1-2; k > 0; --k )
+	{
+	  /* find index for regression, 1 <= jlev <= nlevec-2 */
+	  jlev = k;
+	  if (fis2[ij] < fi1[k]) break;
+	}
+      zdff = fi1[jlev+1]-fis2[ij];
+      
+      /* get the number of points used for estimation of regression coefficients */
+      jlevr = 0;
+      for ( k = jlev-1; k > 0; --k )
+	{
+	  jlevr = k;
+	  zdffl = fi1[k]-fi1[jlev+1];
+	  if (zdffl >= zdff) break;
+	}
+
+      jnop = jlev+1-jlevr+1;
+
+      /*
+	get coefficients of regression between Tv and lnP ::Tv = B*lnP + C
+	using three levels surounding new orography geopotential
+      */
+      zsumt  = 0.0;
+      zsump  = 0.0;
+      zsumpp = 0.0;
+      zsumtp = 0.0;
+
+      for ( k = jlevr; k <= jlev+1; ++k )
+	{
+	  zsumt  = zsumt  + tv1[k];
+	  zsump  = zsump  + lnpf1[k];
+	  zsumpp = zsumpp + lnpf1[k]*lnpf1[k];
+	  zsumtp = zsumtp + tv1[k]*lnpf1[k];
+	}
+
+      /* final regression coefficients */
+      zb = jnop*zsumpp - zsump*zsump;
+      zc = (zsumt*zsumpp-zsump*zsumtp)/zb;
+      zb = (jnop*zsumtp-zsump*zsumt)/zb;
+
+      /* calculate preliminary surface pressure, adjust to middle level */
+      zps = lnph1[jlev];
+
+      /* calculate preliminary pressure */
+      if ( fabs(zb) < 1.0e-20 )
+	{
+	  /* constant virtual temperature near new surface */
+	  ps2[ij] = exp(zps+(fi1[jlev]-fis2[ij])/(zc*rair));
+	}
+      else
+	{
+	  /* virtual temperatur not constant near new surface */
+	  zbb = zc*zc + zb*(zps*(zb*zps+2.0*zc)+2.0*(fi1[jlev]-fis2[ij])/rair);
+	  ps2[ij] = exp((sqrt(zbb)-zc)/zb);
+	}
+    }
+  else
+    {
+      ps2[ij] = ps1[ij];
+    }
+
+
+  ph2[0]   =  0.0;
+  lnph2[0] = -1.0; 
+  for ( k = 1; k < nlev2p1; ++k )
+    {
+      ph2[k]   = ah2[k]+bh2[k]* ps2[ij];
+      lnph2[k] = log(ph2[k]);
+    } 
+
+  for ( k = 0; k < nlev2; ++k )
+    {
+      pf2[k]   = af2[k]+bf2[k]* ps2[ij];
+      /* lnpf2[k] = log(pf2[k]); */
+    }
+
+  /******* find reference geopotential,  */
+
+  if ( lpsmod && ltq )
+    {
+      /* using old pressure at half levels
+	 find first level below reference pressure */
+      for ( k = 1; k < nlev1p1; ++k )
+	{
+	  jlev = k;
+	  if ( ph1[k] > p_firef ) break;
+	}
+	  
+      fiadj = fi1[jlev]+(fi1[jlev-1]-fi1[jlev])*
+	log(ph1[jlev]/p_firef)/log(ph1[jlev]/ph1[jlev-1]);
+    }
+
+  /******* find the new boundary layer top */
+
+  /* using the pressure from the old system */
+  pbl_lim = ps1[ij]*eta_pbl;
+  jjblt = nlev2-1;
+  for ( k = nlev2-1; k > 0; --k )
+    {
+      /* find the next upper level in new system */
+      pbl_lim_need = ps2[ij] *etah2[k];
+      if (pbl_lim > pbl_lim_need) break;
+      jjblt = jjblt-1;
+    }
+
+  /* correct the merging level */
+  if ( jblt < jjblt ) jjblt = jblt;
+
+  /******* PBL profile interpolation */
+  /* tension spline interpolation with full eta levels */
+
+  if ( ltq )
+    for ( k = jjblt; k < nlev2; ++k )
+      {
+	theta_pbl[k] = w1[k]*theta1[jl1[k]] + w2[k]*theta1[jl2[k]];
+	rh_pbl[k]    = w1[k]*rh1[jl1[k]]    + w2[k]*rh1[jl2[k]];
+      }
+
+  for ( iv = 0; iv < nvars; ++iv )
+    for ( k = jjblt; k < nlev2; ++k )
+      {
+	ijk1 = jl1[k]*ngp+ij;
+	ijk2 = jl2[k]*ngp+ij;
+	vars_pbl[iv][k] = w1[k]*vars1[iv][ijk1] + w2[k]*vars1[iv][ijk2];
+      }
+
+  /******* linear interpolation using pressure in free atmosphere
+	   pressure in new system using preliminary pressure */
+
+  for ( k = 0; k <= jjblt; ++k )
+    {
+      idx[k] = int_index(nlev1, pf1, pf2[k]);
+    }
+
+  for ( k = 0; k <= jjblt; ++k )
+    {
+      wgt[k] = (pf1[idx[k]+1]-pf2[k])/(pf1[idx[k]+1]-pf1[idx[k]]);
+    }
+
+  if ( ltq )
+    {
+      for ( k = 0; k < nlev1; ++k )
+	{
+	  ijk = k*ngp+ij;
+	  zvar[k] = t1[ijk];
+	}
+
+      for ( k = 0; k <= jjblt; ++k )
+	{
+	  klo = idx[k];
+	  zt2[k] = wgt[k]*zvar[klo] + (1-wgt[k])*zvar[klo+1];
+	  rh2[k] = wgt[k]*rh1[klo]  + (1-wgt[k])*rh1[klo+1];
+	}
+    }
+
+  for ( iv = 0; iv < nvars; ++iv )
+    {
+      for ( k = 0; k < nlev1; ++k )
+	{
+	  ijk = k*ngp+ij;
+	  zvar[k] = vars1[iv][ijk];
+	}
+      for ( k = 0; k <= jjblt; ++k )
+	{
+	  ijk = k*ngp+ij;
+	  klo = idx[k];
+	  vars2[iv][ijk] = wgt[k]*zvar[klo] + (1-wgt[k])*zvar[klo+1];
+	}
+    }
+
+  /******* merge boundary layer and free atmosphere */
+
+  if ( ltq )
+    {
+      /* correction of potential temperature at top of PBL */
+      dteta = zt2[jjblt]*pow(apr/pf2[jjblt], rair_d_cpair)-theta_pbl[jjblt];
+	  
+      /* merge top layer values */
+      rh2[jjblt] = 0.5*(rh2[jjblt]+rh_pbl[jjblt]);
+    }
+
+  ijk = jjblt*ngp+ij;
+  for ( iv = 0; iv < nvars; ++iv )
+    {
+      vars2[iv][ijk] = 0.5*(vars2[iv][ijk]+vars_pbl[iv][jjblt]);
+    }
+
+  /* correct boundary profile values */
+  if ( ltq )
+    for ( k = jjblt+1; k < nlev2; ++k ) 
+      {
+	zt2[k] = (theta_pbl[k]+dteta)*pow(pf2[k]/apr, rair_d_cpair);
+	rh2[k] = rh_pbl[k];
+      }
+
+  for ( iv = 0; iv < nvars; ++iv )
+    for ( k = jjblt+1; k < nlev2; ++k ) 
+      {
+	ijk = k*ngp+ij;
+	vars2[iv][ijk] = vars_pbl[iv][k];
+      }
+
+  if ( ltq )
+    for ( k = 0; k < nlev2; ++k )
+      {
+	zq2[k] = rh2[k]*epsilon*esat(zt2[k])/pf2[k];
+      }
+
+  /******* reference level correction */
+  if ( lpsmod && ltq )
+    {
+      /* integrate hydrostatic equation with preliminary temperature and pressure */
+      fi2[nlev2] = fis2[ij];
+      fi2[0]     = -1.0; /* top not defined, infinity */
+    
+      /* problem at top level, top pressure is zero per definition */
+      for ( k = nlev2-1; k > 0; --k )
+	{
+	  fi2[k] = fi2[k+1]+rair*zt2[k]*(lnph2[k+1]-lnph2[k])*(1.0+epsm1i*zq2[k]);
+	}
+
+      /* search next level above reference level in new system */
+      for ( k = nlev2-1; k > 0; --k )
+	{ 
+	  jlev = k; 
+	  if (ph2[k] < p_firef) break;
+	}
+	  
+      /* correct surface pressure */
+      dfi = fiadj-(fi2[jlev+1]+(fi2[jlev]-fi2[jlev+1])* 
+		   log(ph2[jlev+1]/p_firef)/log(ph2[jlev+1]/ph2[jlev]));
+      ztv     = (1.0+epsm1i*zq2[nlev2-1])*zt2[nlev2-1];
+      ps2[ij] = ps2[ij] *exp(dfi/(rair*ztv));
+    }
+
+  /******* final calculation of specific humidity profiles */
+  if ( ltq )
+    {
+      for ( k = 0; k < nlev2; ++k )
+	pf2[k] = af2[k] + bf2[k]* ps2[ij];
+
+      for ( k = 0; k < nlev2; ++k )
+	zq2[k] = rh2[k]*epsilon*esat(zt2[k])/pf2[k];
+    }
+
+#if defined (OUTPUT)
+  if ( ij == OPOINT )
+    for ( k = nlev2-1; k >= 0; --k )
+      { 
+	ijk = k*ngp+ij;
+	if ( ltq ) { t = t2[k]; q = zq2[k]; fi = fi2[k]; }
+	else       { t = 0; q = 0; fi = 0; }
+	fprintf(new, "%3d %18.10f %18.10f %18.10f %18.10f", k, fi/g, pf2[k], t, q);
+	for ( iv = 0; iv < nvars; ++iv ) fprintf(new, " %18.10f", vars2[iv][ijk]);
+	fprintf(new, "\n");
+      }
+#endif
+
+  if ( ltq )
+    {
+      /* calculate surface temperature correction (old version) */
+      tscor[ij] = dteta*pow(ps2[ij]/apr, rair_d_cpair);
+      pscor[ij] = pow(ps2[ij]/ps1[ij], rair_d_cpair);
+
+      /* correction term of static energy of lowest layer */
+      secor[ij] = tv1[nlev1-1]*(cpair+rair*(1.0-ph1[nlev1-1]
+					    /(ps1[ij]-ph1[nlev1-1])*log(ps1[ij]/ph1[nlev1-1])));
+    }
+
+  if ( ltq )
+    for ( k = 0; k < nlev2; ++k ) 
+      {
+	ijk = k*ngp+ij;
+	t2[ijk] = zt2[k];
+	q2[ijk] = zq2[k];
+      }
+}
+
+
+void hetaeta(int ltq, int ngp, const int *imiss,
+	     int nlev1, const double *restrict ah1, const double *restrict bh1,
+             const double *restrict fis1, const double *restrict ps1, 
+             const double *restrict t1, const double *restrict q1,
+             int nlev2, const double *restrict ah2, const double *restrict bh2, 
+             const double *restrict fis2, double *restrict ps2, 
+             double *restrict t2, double *restrict q2,
+	     int nvars, double *restrict *restrict vars1, double *restrict *restrict vars2,
+	     double *restrict tscor, double *restrict pscor,
+	     double *restrict secor)
+{
+  double epsm1i;
+  long jblt;
+  long k, iv, ij;
+  long jlev = 0;
+  double *zt2 = NULL, *zq2 = NULL;
+  double /* *etah1,*/ *ph1, *lnph1, *fi1;
+  double *af1, *bf1, *etaf1, *pf1, *lnpf1;
+  double *tv1, *theta1, *rh1;
+  double *etah2, *ph2, *lnph2, *fi2;
+  double *af2, *bf2, *etaf2, *pf2/*, *lnpf2*/;
+  double *zvar;
+  double *rh_pbl = NULL;
+  double *theta_pbl = NULL;
+  double *rh2;
+  double *w1, *w2;
+  double *wgt;
+  long *idx;
+  long *jl1, *jl2;
+  long nlev1p1;
+  long nlev2p1;
+  int lpsmod = 1;
+#if defined (_OPENMP)
+  double **zt2_2, **zq2_2;
+  double **ph1_2, **lnph1_2, **fi1_2, **pf1_2, **lnpf1_2, **tv1_2, **theta1_2, **rh1_2, **zvar_2;
+  double **ph2_2, **lnph2_2, **fi2_2, **pf2_2;
+  double **rh_pbl_2, **theta_pbl_2, **rh2_2;
+  double **wgt_2;
+  double ***vars_pbl_2;
+  long **idx_2;
+  long i;
+  extern int ompNumThreads;
+  double *vars_pbl[MAX_VARS];
+#else
+  double **vars_pbl = NULL;
+#endif
+#if defined (OUTPUT)
+  double t, q, fi;
+
+  old = fopen("old.dat","w");
+  new = fopen("new.dat","w");
+#endif
+
+  nlev1p1 = nlev1+1;
+  nlev2p1 = nlev2+1;
+
+#if defined (_OPENMP)
+  ph1_2    = (double **) malloc(ompNumThreads*sizeof(double *));
+  lnph1_2  = (double **) malloc(ompNumThreads*sizeof(double *));
+  fi1_2    = (double **) malloc(ompNumThreads*sizeof(double *));
+
+  pf1_2    = (double **) malloc(ompNumThreads*sizeof(double *));
+  lnpf1_2  = (double **) malloc(ompNumThreads*sizeof(double *));
+  tv1_2    = (double **) malloc(ompNumThreads*sizeof(double *));
+  theta1_2 = (double **) malloc(ompNumThreads*sizeof(double *));
+  rh1_2    = (double **) malloc(ompNumThreads*sizeof(double *));
+  zvar_2   = (double **) malloc(ompNumThreads*sizeof(double *));
+
+  ph2_2    = (double **) malloc(ompNumThreads*sizeof(double *));
+  lnph2_2  = (double **) malloc(ompNumThreads*sizeof(double *));
+  fi2_2    = (double **) malloc(ompNumThreads*sizeof(double *));
+
+  pf2_2    = (double **) malloc(ompNumThreads*sizeof(double *));
+  rh2_2    = (double **) malloc(ompNumThreads*sizeof(double *));
+  wgt_2    = (double **) malloc(ompNumThreads*sizeof(double *));
+  idx_2    = (long **)   malloc(ompNumThreads*sizeof(long *));
+
+  if ( ltq )
+    {
+      zt2_2       = (double **) malloc(ompNumThreads*sizeof(double *));
+      zq2_2       = (double **) malloc(ompNumThreads*sizeof(double *));
+      rh_pbl_2    = (double **) malloc(ompNumThreads*sizeof(double *));
+      theta_pbl_2 = (double **) malloc(ompNumThreads*sizeof(double *));
+    }
+
+  if ( nvars > 0 )
+    {
+      vars_pbl_2  = (double ***) malloc(ompNumThreads*sizeof(double **));
+    }
+
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      ph1_2[i]    = (double *) malloc(nlev1p1*sizeof(double));
+      lnph1_2[i]  = (double *) malloc(nlev1p1*sizeof(double));
+      fi1_2[i]    = (double *) malloc(nlev1p1*sizeof(double));
+
+      pf1_2[i]    = (double *) malloc(nlev1*sizeof(double));
+      lnpf1_2[i]  = (double *) malloc(nlev1*sizeof(double));
+      tv1_2[i]    = (double *) malloc(nlev1*sizeof(double));
+      theta1_2[i] = (double *) malloc(nlev1*sizeof(double));
+      rh1_2[i]    = (double *) malloc(nlev1*sizeof(double));
+      zvar_2[i]   = (double *) malloc(nlev1*sizeof(double));
+
+      ph2_2[i]    = (double *) malloc(nlev2p1*sizeof(double));
+      lnph2_2[i]  = (double *) malloc(nlev2p1*sizeof(double));
+      fi2_2[i]    = (double *) malloc(nlev2p1*sizeof(double));
+
+      pf2_2[i]    = (double *) malloc(nlev2*sizeof(double));
+      rh2_2[i]    = (double *) malloc(nlev2*sizeof(double));
+      wgt_2[i]    = (double *) malloc(nlev2*sizeof(double));
+      idx_2[i]    = (long *)   malloc(nlev2*sizeof(long));
+
+      if ( ltq )
+	{
+	  zt2_2[i]       = (double *) malloc(nlev2*sizeof(double));
+	  zq2_2[i]       = (double *) malloc(nlev2*sizeof(double));
+	  rh_pbl_2[i]    = (double *) malloc(nlev2*sizeof(double));
+	  theta_pbl_2[i] = (double *) malloc(nlev2*sizeof(double));
+	}
+
+      if ( nvars > 0 )
+	{
+	  if ( nvars > MAX_VARS )
+	    {
+	      fprintf(stderr, "Too many vars (max = %d)!\n", MAX_VARS);
+	      exit(-1);
+	    }
+	  vars_pbl_2[i]  = (double **) malloc(nvars*sizeof(double *));
+	  for ( iv = 0; iv < nvars; ++iv )
+	    vars_pbl_2[i][iv] = (double *) malloc(nlev2*sizeof(double));
+	}
+    }
+#else
+  /* etah1  = (double *) malloc(nlev1p1*sizeof(double)); */
+  ph1    = (double *) malloc(nlev1p1*sizeof(double));
+  lnph1  = (double *) malloc(nlev1p1*sizeof(double));
+  fi1    = (double *) malloc(nlev1p1*sizeof(double));
+
+  pf1    = (double *) malloc(nlev1*sizeof(double));
+  lnpf1  = (double *) malloc(nlev1*sizeof(double));
+  tv1    = (double *) malloc(nlev1*sizeof(double));
+  theta1 = (double *) malloc(nlev1*sizeof(double));
+  rh1    = (double *) malloc(nlev1*sizeof(double));
+  zvar   = (double *) malloc(nlev1*sizeof(double));
+
+  ph2    = (double *) malloc(nlev2p1*sizeof(double));
+  lnph2  = (double *) malloc(nlev2p1*sizeof(double));
+  fi2    = (double *) malloc(nlev2p1*sizeof(double));
+
+  pf2    = (double *) malloc(nlev2*sizeof(double));
+  /* lnpf2  = (double *) malloc(nlev2*sizeof(double)); */
+  rh2    = (double *) malloc(nlev2*sizeof(double));
+  wgt    = (double *) malloc(nlev2*sizeof(double));
+  idx    = (long *)   malloc(nlev2*sizeof(long));
+
+  if ( ltq )
+    {
+      zt2       = (double *) malloc(nlev2*sizeof(double));
+      zq2       = (double *) malloc(nlev2*sizeof(double));
+      rh_pbl    = (double *) malloc(nlev2*sizeof(double));
+      theta_pbl = (double *) malloc(nlev2*sizeof(double));
+    }
+
+  if ( nvars > 0 )
+    {
+      vars_pbl  = (double **) malloc(nvars*sizeof(double *));
+      for ( iv = 0; iv < nvars; ++iv )
+	vars_pbl[iv] = (double *) malloc(nlev2*sizeof(double));
+    }
+#endif
+  
+  af1    = (double *) malloc(nlev1*sizeof(double));
+  bf1    = (double *) malloc(nlev1*sizeof(double));
+  etaf1  = (double *) malloc(nlev1*sizeof(double));
+
+  etah2  = (double *) malloc(nlev2p1*sizeof(double));
+
+  af2    = (double *) malloc(nlev2*sizeof(double));
+  bf2    = (double *) malloc(nlev2*sizeof(double));
+  etaf2  = (double *) malloc(nlev2*sizeof(double));
+
+  w1     = (double *) malloc(nlev2*sizeof(double));
+  w2     = (double *) malloc(nlev2*sizeof(double));
+  jl1    = (long *)   malloc(nlev2*sizeof(long));
+  jl2    = (long *)   malloc(nlev2*sizeof(long));
+
+
+  /******* set coordinate system ETA's, A's, B's
+	   calculate half and full level ETA
+	   set the boundary layer index */
+
+  /* input system */
+
+  for ( k = 0; k < nlev1; ++k )
+    {
+      af1[k] = 0.5*(ah1[k]+ah1[k+1]);
+      bf1[k] = 0.5*(bh1[k]+bh1[k+1]);
+    }
+
+  /* etah1[nlev1] = ah1[nlev1]*aipr+bh1[nlev1]; */
+  for ( k = 0; k < nlev1; ++k )
+    { 
+      /* etah1[k] = ah1[k]*aipr+bh1[k]; */
+      etaf1[k] = af1[k]*aipr+bf1[k];
+    }
+
+  /* output system */
+
+  /* calculates full level VCT */
+  for ( k = 0; k < nlev2; ++k )
+    {
+      af2[k] = 0.5*(ah2[k]+ah2[k+1]);
+      bf2[k] = 0.5*(bh2[k]+bh2[k+1]);
+    }
+
+  etah2[nlev2] = ah2[nlev2]*aipr+bh2[nlev2];
+  jblt = nlev2;
+  for ( k = nlev2-1; k >= 0; --k )
+    { 
+      etah2[k] = ah2[k]*aipr+bh2[k];
+      etaf2[k] = af2[k]*aipr+bf2[k];
+      if (etah2[k] > eta_pbl) jblt = k;
+    }
+
+  /* calculate weights for PBL interpolation */
+  for ( k = 0; k < nlev2; ++k )
+    {
+      /* scan through new vertical levels
+	 set changes outside the full level eta's of old system to constant */
+      if ( etaf2[k] <= etaf1[0] )
+	{
+	  /* at top of atmosphere */
+	  jl1[k] = 0;
+	  jl2[k] = 1;
+	  w2[k]  = 0.0;
+	}
+      else if ( etaf2[k] >= etaf1[nlev1-1])
+	{
+	  /* at surface of atmosphere */
+	  jl1[k] = nlev1-2;
+	  jl2[k] = nlev1-1;
+	  w2[k]  = 1.0;
+	}
+      else
+	{
+	  for ( jlev = nlev1-2; jlev >= 1; jlev-- )
+	    {
+	      jl1[k] = jlev; /* find nearest eta level below */
+	      if (etaf2[k] > etaf1[jlev]) break;
+	    }
+	  jl2[k] = jl1[k]+1;
+	  w2[k]  = log(etaf2[k]/etaf1[jl1[k]]) / log(etaf1[jl2[k]]/etaf1[jl1[k]]);
+	}
+      w1[k] = 1.0-w2[k];
+    }
+
+  epsm1i = 1.0/epsilon-1.0;
+
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(ngp, ph1_2, lnph1_2, fi1_2, pf1_2, lnpf1_2, tv1_2, theta1_2, rh1_2, zvar_2, ph2_2, lnph2_2, \
+	 fi2_2, pf2_2, rh_pbl_2, zt2_2, zq2_2, theta_pbl_2, rh2_2, wgt_2, idx_2, vars_pbl_2, \
+	 af1, bf1, etah2, af2, bf2, w1, w2, jl1, jl2,	\
+	 ltq, nvars, imiss, ah1, bh1, ps1, nlev1, epsm1i, q1, t1, fis1, fis2, ps2, \
+	 ah2, bh2, nlev2, vars1, vars2, t2, q2, tscor, pscor, secor, jblt) \
+  firstprivate(lpsmod) \
+  private(ij, ph1, lnph1, fi1, pf1, lnpf1, tv1, theta1, rh1, zvar, ph2, lnph2, fi2, pf2, rh_pbl, \
+          theta_pbl, rh2, wgt, idx, vars_pbl, zt2, zq2) \
+  schedule(dynamic,1)
+#endif
+  for ( ij = 0; ij < ngp; ++ij )
+    {
+#if defined (_OPENMP)
+      int ompthID;
+      long iv;      
+
+      ompthID = omp_get_thread_num();
+
+      ph1    = ph1_2[ompthID];
+      lnph1  = lnph1_2[ompthID];
+      fi1    = fi1_2[ompthID];
+
+      pf1    = pf1_2[ompthID];
+      lnpf1  = lnpf1_2[ompthID];
+      tv1    = tv1_2[ompthID];
+      theta1 = theta1_2[ompthID];
+      rh1    = rh1_2[ompthID];
+      zvar   = zvar_2[ompthID];
+
+      ph2    = ph2_2[ompthID];
+      lnph2  = lnph2_2[ompthID];
+      fi2    = fi2_2[ompthID];
+
+      pf2    = pf2_2[ompthID];
+      rh2    = rh2_2[ompthID];
+      wgt    = wgt_2[ompthID];
+      idx    = idx_2[ompthID];
+
+      zt2       = NULL;
+      zq2       = NULL;
+      rh_pbl    = NULL;
+      theta_pbl = NULL;
+
+      if ( ltq )
+	{
+	  zt2       = zt2_2[ompthID];
+	  zq2       = zq2_2[ompthID];
+	  rh_pbl    = rh_pbl_2[ompthID];
+	  theta_pbl = theta_pbl_2[ompthID];
+	}
+
+      if ( nvars > 0 )
+	{
+	  for ( iv = 0; iv < nvars; ++iv )
+	    vars_pbl[iv] = vars_pbl_2[ompthID][iv];
+	}
+#endif
+
+      if ( imiss )
+	if ( imiss[ij] ) continue;
+
+      hetaeta_sc(ltq, lpsmod, ij, ngp, nlev1, nlev2, nvars,
+		 af1, bf1, etah2, af2, bf2, w1, w2, jl1, jl2,
+		 ah1, bh1, ps1, epsm1i, q1, t1, fis1, fis2, ps2,
+		 ah2, bh2, vars1, vars2, t2, q2, tscor, pscor, secor, jblt,
+		 ph1, lnph1, fi1, pf1, lnpf1, tv1, theta1, rh1, zvar, 
+                 ph2, lnph2, fi2, pf2, rh2, wgt, idx,
+		 rh_pbl, theta_pbl, vars_pbl, zt2, zq2);
+
+    } /* end for ij */
+
+#if defined (OUTPUT)
+  fclose(old);
+  fclose(new);
+#endif
+
+
+#if defined (_OPENMP)
+  for ( i = 0; i < ompNumThreads; i++ )
+    {
+      free(ph1_2[i]);    
+      free(lnph1_2[i]);  
+      free(fi1_2[i]);    
+
+      free(pf1_2[i]);    
+      free(lnpf1_2[i]);  
+      free(tv1_2[i]);    
+      free(theta1_2[i]); 
+      free(rh1_2[i]);    
+      free(zvar_2[i]);    
+
+      free(ph2_2[i]);       
+      free(lnph2_2[i]);     
+      free(fi2_2[i]);
+
+      free(pf2_2[i]);       
+      /* free(lnpf2_2[i]); */
+      free(rh2_2[i]);      
+      free(wgt_2[i]); 
+      free(idx_2[i]); 
+
+      if ( ltq )
+	{
+	  free(zt2_2[i]); 
+	  free(zq2_2[i]); 
+	  free(rh_pbl_2[i]); 
+	  free(theta_pbl_2[i]); 
+	}   
+
+      if ( nvars > 0 )
+	{
+	  for ( iv = 0; iv < nvars; ++iv )
+	    free(vars_pbl_2[i][iv]);
+	  
+	  free(vars_pbl_2[i]);
+	}
+    }
+
+  free(ph1_2);
+  free(lnph1_2);
+  free(fi1_2);
+
+  free(pf1_2);
+  free(lnpf1_2);
+  free(tv1_2);
+  free(theta1_2);
+  free(rh1_2);
+  free(zvar_2);
+
+  free(ph2_2);
+  free(lnph2_2);
+  free(fi2_2);
+
+  free(pf2_2);
+  free(rh2_2);
+  free(wgt_2);
+  free(idx_2);
+
+  if ( ltq )
+    {
+      free(zt2_2);
+      free(zq2_2);
+      free(rh_pbl_2);
+      free(theta_pbl_2);
+    }
+
+  if ( nvars > 0 )
+    {
+      free(vars_pbl_2);
+    }
+#else
+  /* free(etah1); */     
+  free(ph1);    
+  free(lnph1);  
+  free(fi1);    
+
+  free(pf1);    
+  free(lnpf1);  
+  free(tv1);    
+  free(theta1); 
+  free(rh1);    
+  free(zvar);    
+
+  free(ph2);       
+  free(lnph2);     
+  free(fi2);
+
+  free(pf2);       
+  /* free(lnpf2); */
+  free(rh2);      
+  free(wgt); 
+  free(idx); 
+
+  if ( ltq )
+    {
+      free(zt2); 
+      free(zq2); 
+      free(rh_pbl); 
+      free(theta_pbl); 
+    }   
+
+  if ( nvars > 0 )
+    {
+      for ( iv = 0; iv < nvars; ++iv )
+	free(vars_pbl[iv]);
+
+      free(vars_pbl);
+    }
+#endif
+
+  free(af1);    
+  free(bf1);    
+  free(etaf1);  
+
+  free(etah2);
+
+  free(af2);       
+  free(bf2);       
+  free(etaf2);     
+
+  free(w1);       
+  free(w2);       
+  free(jl1);      
+  free(jl2);      
+
+  return;
+}
+
+/*
+int main (int argc, char *argv[])
+{
+  double a2[41] = {
+       0.00000000000000000,       2000.00000000000000000,       4000.00000000000000000,
+    6000.00000000000000000,       8000.00000000000000000,       9976.13671875000000000,
+   11902.14453125000000000,      13722.03125000000000000,      15379.80468750000000000,
+   16819.47265625000000000,      18045.18359375000000000,      19027.69531250000000000,
+   19755.10937500000000000,      20222.20312500000000000,      20429.86328125000000000,
+   20384.48046875000000000,      20097.40234375000000000,      19584.32812500000000000,
+   18864.75000000000000000,      17961.35937500000000000,      16899.46875000000000000,
+   15706.44921875000000000,      14411.12500000000000000,      13043.21875000000000000,
+   11632.75781250000000000,      10209.50000000000000000,       8802.35546875000000000,
+    7438.80468750000000000,       6144.31640625000000000,       4941.77734375000000000,
+    3850.91333007812500000,       2887.69653320312500000,       2063.77978515625000000,
+    1385.91259765625000000,        855.36181640625000000,        467.33349609375000000,
+     210.39390563964843750,         65.88919067382812500,          7.36769962310791016,
+       0.00000000000000000,          0.00000000000000000 };
+
+  double b2[41] = {
+    0.00000000000000000,    0.00000000000000000,    0.00000000000000000,
+    0.00000000000000000,    0.00000000000000000,    0.00039085815660655,
+    0.00182679994031787,    0.00513499975204468,    0.01114289835095406,
+    0.02067789807915688,    0.03412120044231415,    0.05169039964675903,
+    0.07353377342224121,    0.09967470169067383,    0.13002246618270874,
+    0.16438430547714233,    0.20247590541839600,    0.24393308162689209,
+    0.28832298517227173,    0.33515489101409912,    0.38389205932617188,
+    0.43396288156509399,    0.48477149009704590,    0.53570991754531860,
+    0.58616840839385986,    0.63554751873016357,    0.68326860666275024,
+    0.72878581285476685,    0.77159661054611206,    0.81125342845916748,
+    0.84737491607666016,    0.87965691089630127,    0.90788388252258301,
+    0.93194031715393066,    0.95182150602340698,    0.96764522790908813,
+    0.97966271638870239,    0.98827010393142700,    0.99401938915252686,
+    0.99763011932373047,    1.00000000000000000 };
+
+  double a1[20] = {
+       0.00000000000000000,       2000.00000000000000000,       4000.00000000000000000,   
+    6046.10937500000000000,       8267.92968750000000000,      10609.51171875000000000,   
+   12851.10156250000000000,      14698.50000000000000000,      15861.12890625000000000,   
+   16116.23828125000000000,      15356.92187500000000000,      13621.46093750000000000,  
+   11101.55859375000000000,       8127.14453125000000000,       5125.14062500000000000,   
+    2549.96899414062500000,        783.19506835937500000,          0.00000000000000000,   
+       0.00000000000000000,          0.00000000000000000 };  
+
+  double b1[20] = {
+    0.00000000000000000,    0.00000000000000000,    0.00000000000000000,
+    0.00033899326808751,    0.00335718691349030,    0.01307003945112228,
+    0.03407714888453484,    0.07064980268478394,    0.12591671943664551,
+    0.20119541883468628,    0.29551959037780762,    0.40540921688079834,
+    0.52493220567703247,    0.64610791206359863,    0.75969839096069336,
+    0.85643762350082397,    0.92874687910079956,    0.97298520803451538,
+    0.99228149652481079,    1.00000000000000000 };
+
+  double iu1[19] = {
+    0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+    0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+    0.0, 0.0, 0.0 };
+
+  double iv1[19] = {
+    0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+    0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0,
+    0.0, 0.0, 0.0 };
+
+  double it1[19] = {
+    224.2257,  212.7505,  209.553,  208.7785,  211.7619,  220.2336,  221.2698,
+    220.3876,  227.1461,  237.6735, 248.1776,  258.1013,  264.4792,  269.1322,
+    271.9017,  275.6761,  279.819,  282.2512,  284.141 };
+
+  double iq1[19] = {
+    2.512447e-06,  2.176736e-06,  2.170464e-06,  2.01653e-06,  1.805185e-06,
+    1.726813e-06,  3.75322e-06,   8.901303e-06,  3.285719e-05, 0.0001270178,
+    0.0003347051,  0.0007223329,  0.001228461,   0.001733165,  0.002967748,
+    0.004558741,   0.004706143,   0.004668835,   0.004677606 };
+
+  double icl1[19] = {
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  -4.987459e-40,  -4.791847e-39,  -3.970467e-23,
+    -1.902515e-23,  -1.694066e-21,  -3.705769e-22,  -1.799945e-21,  -4.632211e-22,
+    2.072752e-05,  0.000149563,  -1.482308e-20,  -2.541099e-21,  5.033612e-05 };
+
+  double ici1[19] = {
+    -4.408104e-37, 0.0,  0.0,  -2.003328e-25,  -9.305782e-24,  -2.15067e-23,  -9.926167e-23,
+    -1.958764e-21,  -8.735027e-22,  -2.779327e-22,  -2.117582e-21,  -1.323489e-21,  -8.470329e-22,
+    -4.102816e-22,  -1.429368e-21,  -2.646978e-21,  -5.029258e-22,  -8.205632e-22,  -1.588187e-21 };
+
+  double icc1[19] = {
+    0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,  0.0,
+    0.0,  0.0,  0.4445496,  0.0,  0.0,  0.001098633} ;
+
+  double ifis1 = 9.121094, ips1 = 102511.8;
+
+  double *fis1, *ps1;
+  double *fis2, *ps2;
+  
+  double *t1, *q1, *u1, *v1, *cl1, *ci1, *cc1;
+  double *t2, *q2, *u2, *v2, *cl2, *ci2, *cc2;
+  double *vars1[5];
+  double *vars2[5];
+
+  double *tscor, *pscor, *secor; 
+  int ij, k;
+  int ltq = 1;
+
+  fis1 = (double *) malloc(NGP*sizeof(double));
+  ps1  = (double *) malloc(NGP*sizeof(double));
+  fis2 = (double *) malloc(NGP*sizeof(double));
+  ps2  = (double *) malloc(NGP*sizeof(double));
+
+  tscor  = (double *) malloc(NGP*sizeof(double));
+  pscor  = (double *) malloc(NGP*sizeof(double));
+  secor  = (double *) malloc(NGP*sizeof(double));
+
+  t1  = (double *) malloc(NGP*19*sizeof(double));
+  q1  = (double *) malloc(NGP*19*sizeof(double));
+  u1  = (double *) malloc(NGP*19*sizeof(double));
+  v1  = (double *) malloc(NGP*19*sizeof(double));
+  cl1 = (double *) malloc(NGP*19*sizeof(double));
+  ci1 = (double *) malloc(NGP*19*sizeof(double));
+  cc1 = (double *) malloc(NGP*19*sizeof(double));
+
+  t2  = (double *) malloc(NGP*40*sizeof(double));
+  q2  = (double *) malloc(NGP*40*sizeof(double));
+  u2  = (double *) malloc(NGP*40*sizeof(double));
+  v2  = (double *) malloc(NGP*40*sizeof(double));
+  cl2 = (double *) malloc(NGP*40*sizeof(double));
+  ci2 = (double *) malloc(NGP*40*sizeof(double));
+  cc2 = (double *) malloc(NGP*40*sizeof(double));
+
+  for ( ij = 0; ij < NGP; ++ij )
+    {
+      ps1[ij]  = ips1;
+      fis1[ij] = ifis1;
+    }
+
+  for ( k = 0; k < 19; ++k )
+    for ( ij = 0; ij < NGP; ++ij )
+      {
+	t1[k*NGP+ij] = it1[k];
+	q1[k*NGP+ij] = iq1[k];
+	u1[k*NGP+ij] = iu1[k];
+	v1[k*NGP+ij] = iv1[k];
+	cl1[k*NGP+ij] = icl1[k];
+	ci1[k*NGP+ij] = ici1[k];
+	cc1[k*NGP+ij] = icc1[k];
+      }
+
+  vars1[0] = u1;
+  vars1[1] = v1;
+  vars1[2] = cl1;
+  vars1[3] = ci1;
+  vars1[4] = cc1;
+
+  vars2[0] = u2;
+  vars2[1] = v2;
+  vars2[2] = cl2;
+  vars2[3] = ci2;
+  vars2[4] = cc2;
+
+  for ( ij = 0; ij < NGP; ++ij )
+    {
+      fis2[ij] = fis1[ij];
+    }
+
+  if ( ltq )
+    hetaeta(ltq, NGP,
+	    19, a1, b1,
+	    fis1, ps1,
+	    t1, q1,
+	    40, a2, b2,
+	    fis2, ps2,
+	    t2, q2,
+	    5, vars1, vars2,
+	    tscor, pscor, secor);
+  else
+    hetaeta(ltq, NGP,
+	    19, a1, b1,
+	    fis1, ps1,
+	    NULL, NULL,
+	    40, a2, b2,
+	    fis2, ps2,
+	    NULL, NULL,
+	    5, vars1, vars2,
+	    NULL, NULL, NULL);
+
+  return 0;
+}
+*/
diff --git a/src/hetaeta.h b/src/hetaeta.h
new file mode 100644
index 0000000..9dace37
--- /dev/null
+++ b/src/hetaeta.h
@@ -0,0 +1,15 @@
+#ifndef _HETAETA_H
+#define _HETAETA_H
+
+void hetaeta(int ltq, int ngp, const int *imiss,
+	     int nlev1, const double *restrict ah1, const double *restrict bh1,
+             const double *restrict fis1, const double *restrict ps1, 
+             const double *restrict t1, const double *restrict q1,
+             int nlev2, const double *restrict ah2, const double *restrict bh2, 
+             const double *restrict fis2, double *restrict ps2, 
+             double *restrict t2, double *restrict q2,
+	     int nvars, double *restrict *restrict vars1, double *restrict *restrict vars2,
+	     double *restrict tscor, double *restrict pscor,
+	     double *restrict secor);
+
+#endif  /* _HETAETA_H */
diff --git a/src/history.c b/src/history.c
new file mode 100644
index 0000000..5da8c0d
--- /dev/null
+++ b/src/history.c
@@ -0,0 +1,105 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <string.h>
+#include <time.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+
+static char *ghistory = NULL;
+static size_t ghistorysize = 0;
+
+static char strtime[32];
+
+void init_strtime()
+{
+  time_t tp;
+  struct tm *ltime;
+
+  tp = time(NULL);
+
+  if ( tp != -1 )
+    {
+      ltime = localtime(&tp);
+      (void) strftime(strtime, sizeof(strtime), "%a %b %d %H:%M:%S %Y: ", ltime);
+    }
+}
+
+
+char *get_strtimeptr()
+{
+  if ( strlen(strtime) == 0 )
+    init_strtime();
+
+  return (strtime);
+}
+
+
+void cdoInqHistory(int fileID)
+{
+  if ( ghistory )
+    {
+      free(ghistory);
+      ghistorysize = 0;
+      ghistory = NULL;
+    }
+
+  ghistorysize = streamInqHistorySize(fileID);
+  if ( ghistorysize > 0 )
+    {
+      size_t len;
+      ghistory = (char *) malloc(ghistorysize+1);
+      ghistory[ghistorysize] = 0;
+      streamInqHistoryString(fileID, ghistory);
+      len = strlen(ghistory);
+      if ( len < ghistorysize )
+	{
+	  /* printf("%d %d\n", len, ghistorysize); */
+	  ghistorysize = len;
+	}
+    }
+}
+
+
+void cdoDefHistory(int fileID, char *histstring)
+{
+  char *history = NULL;
+  size_t historysize = 0;
+  char *strtimeptr;
+  extern int cdoDisableHistory;
+
+  strtimeptr = get_strtimeptr();
+  
+  historysize = ghistorysize+strlen(strtimeptr)+strlen(histstring)+2;
+  history = (char *) malloc(historysize);
+
+  strcpy(history, strtimeptr);
+  strcat(history, histstring);
+
+  if ( cdoDisableHistory == FALSE )
+    if ( ghistory )
+      {
+	strcat(history, "\n");
+	strcat(history, ghistory);
+      }
+
+  streamDefHistory(fileID, strlen(history), history);
+  
+  free(history);
+}
diff --git a/src/institution.c b/src/institution.c
new file mode 100644
index 0000000..adb1579
--- /dev/null
+++ b/src/institution.c
@@ -0,0 +1,117 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "error.h"
+
+#ifndef UNDEFID
+#define UNDEFID  CDI_UNDEFID
+#endif
+
+int cdoDefaultInstID = UNDEFID;
+
+static
+int readInstitution(const char *instfile)
+{
+  int instID = UNDEFID;
+  char line[1024], *pline;
+  int lnr = 0;
+  int nvar = 0, maxvar = 4;
+  char name[1024], longname[1024];
+  int center = UNDEFID, subcenter = UNDEFID;
+  FILE *instfp;
+
+  instfp = fopen(instfile, "r");
+
+  if ( instfp == NULL ) return (instID);
+
+  while ( readline(instfp, line, 1024) )
+    {
+      lnr++;
+      if ( line[0] == '#' ) continue;
+      if ( nvar == maxvar ) break;
+      nvar++;
+
+      pline = line;
+      while ( isspace((int) *pline) ) pline++;
+
+      if ( nvar == 1 )
+	{
+	  if ( isdigit((int) pline[0]) )
+	    maxvar = 4;
+	  else
+	    maxvar = 2;
+	}
+
+      if ( nvar == 1 && maxvar == 4 )
+	{
+	  center = atoi(pline);
+	}
+
+      if ( nvar == 2 && maxvar == 4 )
+	{
+	  if ( ! isdigit((int) pline[0]) )
+	    Error("wrong format in line %d. Missing subcenter!", lnr);
+
+	  subcenter = atoi(pline);
+	}
+
+      if ( (nvar == 3 && maxvar == 4) || (nvar == 1 && maxvar == 2) )
+	{
+	  strcpy(name, pline);
+	}
+
+      if ( (nvar == 4 && maxvar == 4) || (nvar == 2 && maxvar == 2) )
+	{
+	  strcpy(longname, pline);
+	}
+    }
+
+  fclose(instfp);
+
+  instID = institutInq(center, subcenter, name, longname);
+  if ( instID == UNDEFID )
+    instID = institutDef(center, subcenter, name, longname);
+
+  return (instID);
+}
+
+
+void defineInstitution(char *instarg)
+{
+  char *instname;
+  int instID;
+
+  instname = instarg;
+
+  instID = readInstitution(instname);
+
+  if ( instID == UNDEFID )
+    instID = institutInq(0, 0, instname, NULL);
+
+  if ( instID == UNDEFID )
+    Error("institution <%s> not found", instname);
+
+  cdoDefaultInstID = instID;
+}
diff --git a/src/interpol.c b/src/interpol.c
new file mode 100644
index 0000000..de1bc23
--- /dev/null
+++ b/src/interpol.c
@@ -0,0 +1,1382 @@
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "grid.h"
+#include "util.h"  /* progressStatus */
+
+
+/**
+* Find the interval i-1 .. i in which an element x fits
+* and return i, the bigger one of the interval borders
+* or x itself if it is an interval border.
+* If the index of x is 0, return 1, thus the bigger border. (strange?)
+*
+* If no interval can be found return the length of the array.
+* TODO: Check whether the as strange marked behavior is intended.
+
+* @param *array ascending sorted list        TODO: check whether descending also needed
+* @param nelem  length of the sorted list
+* @param x      the element to find a position for 
+*/
+static
+long find_element(double x, long nelem, const double *array)
+{
+  long ii;
+  long mid = 0;
+  long first = 1;
+  long last = nelem;
+
+  if ( array[0] < array[nelem-1] ) // ascending order
+    {
+      /* return the length of the array if x is out of bounds */
+      if ( x < array[0] || x > array[nelem-1] ) return (nelem);
+
+      /* search for the interval in which x fits */
+      // implementation: binary search algorithm
+      for ( ii = 1; ii < nelem; ii++ )
+	{
+	  // binary search: divide search room in the middle
+	  mid = first + ((last - first) / 2);
+      
+	  /* return the bigger interval border of the interval in which x fits */
+	  if ( x >= array[mid-1] && x <= array[mid] ) break;
+
+	  // binary search: ignore half of the search room
+	  if ( x > array[mid] )
+	    first = mid;
+	  else
+	    last = mid;
+	}
+    }
+  else
+    {
+      /* return the length of the array if x is out of bounds */
+      if ( x < array[nelem-1] || x > array[0] ) return (nelem);
+
+      /* search for the interval in which x fits */
+      // implementation: binary search algorithm
+      for ( ii = 1; ii < nelem; ii++ )
+	{
+	  // binary search: divide search room in the middle
+	  mid = first + ((last - first) / 2);
+      
+	  /* return the bigger interval border of the interval in which x fits */
+	  if ( x >= array[mid] && x <= array[mid-1] ) break;
+
+	  // binary search: ignore half of the search room
+	  if ( x < array[mid] )
+	    first = mid;
+	  else
+	    last = mid;
+	}
+    }
+
+  return (mid);
+}
+
+static
+long find_element_old(double x, long nelem, const double *array)
+{
+  long ii;
+
+  if ( array[0] < array[nelem-1] )
+    {
+      for ( ii = 1; ii < nelem; ii++ )
+	if ( x >= array[ii-1] && x <= array[ii] ) break;
+    }
+  else
+    {
+      for ( ii = 1; ii < nelem; ii++ )
+	if ( x >= array[ii] && x <= array[ii-1] ) break;
+    }
+
+  return (ii);
+}
+
+
+double intlinarr2p(long nxm, long nym, double **fieldm, const double *xm, const double *ym,
+		   double x, double y)
+{
+  long ii, jj;
+  double value = 0;
+
+  for ( jj = 1; jj < nym; jj++ )
+    if ( y >= MIN(ym[jj-1], ym[jj]) && y <= MAX(ym[jj-1], ym[jj]) ) break;
+
+  for ( ii = 1; ii < nxm; ii++ )
+    if ( x >= xm[ii-1] && x <= xm[ii] ) break;
+
+  if ( jj < nym && ii < nxm )
+    {
+      value = fieldm[jj-1][ii-1] * (x-xm[ii]) * (y-ym[jj])
+	          / ((xm[ii-1]-xm[ii]) * (ym[jj-1]-ym[jj]))
+            + fieldm[jj-1][ii] * (x-xm[ii-1]) * (y-ym[jj])
+                  / ((xm[ii]-xm[ii-1]) * (ym[jj-1]-ym[jj]))
+            + fieldm[jj][ii-1] * (x-xm[ii]) * (y-ym[jj-1])
+                  / ((xm[ii-1]-xm[ii]) * (ym[jj]-ym[jj-1]))
+            + fieldm[jj][ii] * (x-xm[ii-1]) * (y-ym[jj-1])
+                  / ((xm[ii]-xm[ii-1]) * (ym[jj]-ym[jj-1]));
+    }
+
+  return value;
+}
+
+static
+void intlinarr2(double missval,
+		long nxm, long nym,  double **fieldm, const double *xm, const double *ym,
+		long gridsize2, double *field, const double *x, const double *y)
+{
+  long i, ii, jj;
+  double findex = 0;
+
+  progressInit();
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(ompNumThreads, field, fieldm, x, y, xm, ym, nxm, nym, findex, gridsize2, missval) \
+  private(i, jj, ii)
+#endif
+  for ( i = 0; i < gridsize2; ++i )
+    {
+      field[i] = missval;
+
+#if defined (_OPENMP)
+#pragma omp atomic
+#endif
+      findex++;
+      if ( ompNumThreads == 1 ) progressStatus(0, 1, findex/gridsize2);
+
+      jj = find_element(y[i], nym, ym);
+	  
+      if ( jj < nym )
+	{
+	  ii = find_element(x[i], nxm, xm);
+	  
+	  if ( ii < nxm )
+	    {
+	      field[i] = fieldm[jj-1][ii-1] * (x[i]-xm[ii]) * (y[i]-ym[jj])
+		                   / ((xm[ii-1]-xm[ii]) * (ym[jj-1]-ym[jj]))
+		       + fieldm[jj-1][ii] * (x[i]-xm[ii-1]) * (y[i]-ym[jj])
+		                   / ((xm[ii]-xm[ii-1]) * (ym[jj-1]-ym[jj]))
+		       + fieldm[jj][ii-1] * (x[i]-xm[ii]) * (y[i]-ym[jj-1])
+		                  / ((xm[ii-1]-xm[ii]) * (ym[jj]-ym[jj-1]))
+		       + fieldm[jj][ii] * (x[i]-xm[ii-1]) * (y[i]-ym[jj-1])
+		                   / ((xm[ii]-xm[ii-1]) * (ym[jj]-ym[jj-1]));
+	    }
+	}
+    }
+ 
+  if ( findex < gridsize2 ) progressStatus(0, 1, 1);
+}
+
+
+double intlin(double x, double y1, double x1, double y2, double x2)
+{
+  /*
+    xlin - lineare interpolation
+
+    Uwe Schulzweida  04/05/1995
+  */
+  double value;
+  
+  value = (y2*(x-x1)+y1*(x2-x)) / (x2-x1);
+
+  return (value);
+}
+
+
+void intlinarr(long nxm, double *ym, double *xm, int nx, double *y, double *x)
+{
+  /*
+    xlinarr - lineare interpolation over 1D array
+
+    Uwe Schulzweida  04/05/1995
+  */
+  long j, jj;
+
+  for ( jj = 1; jj < nxm; jj++ )
+    for ( j = 0; j < nx; j++ )
+      if ( x[j] >= xm[jj-1] && x[j] <= xm[jj] )
+	y[j] = intlin(x[j], ym[jj-1], xm[jj-1], ym[jj], xm[jj]);
+}
+
+
+void intgrid(field_t *field1, field_t *field2)
+{
+  int nlon1, nlat1;
+  int nlon2, nlat2;
+  int ilat;
+  int gridID1, gridID2;
+  int i, nmiss;
+  double *lon1, *lat1;
+  double **array1_2D = NULL;
+  double **field;
+  double *array = NULL;
+  double *array1, *array2;
+  double missval;
+  /* static int index = 0; */
+
+  gridID1 = field1->grid;
+  gridID2 = field2->grid;
+  array1  = field1->ptr;
+  array2  = field2->ptr;
+  missval = field1->missval;
+
+  if ( ! (gridInqXvals(gridID1, NULL) && gridInqYvals(gridID1, NULL)) )
+    cdoAbort("Source grid has no values");
+
+  nlon1 = gridInqXsize(gridID1);
+  nlat1 = gridInqYsize(gridID1);
+  lon1 = (double *) malloc(nlon1*sizeof(double));
+  lat1 = (double *) malloc(nlat1*sizeof(double));
+  gridInqXvals(gridID1, lon1);
+  gridInqYvals(gridID1, lat1);
+
+  nlon2 = gridInqXsize(gridID2);
+  nlat2 = gridInqYsize(gridID2);
+
+  array1_2D = (double **) malloc(nlat1*sizeof(double *));
+  for ( ilat = 0; ilat < nlat1; ilat++ )
+    array1_2D[ilat] = array1 + ilat*nlon1;
+
+  if ( nlon2 == 1 && nlat2 == 1 )
+    {
+      double lon2, lat2;
+
+      gridInqXvals(gridID2, &lon2);
+      gridInqYvals(gridID2, &lat2);
+
+      if ( lon2 < lon1[0] ) lon2 += 360;
+
+      if ( lon2 > lon1[nlon1-1] )
+	{
+	  field  = array1_2D;
+	  array1_2D = (double **) malloc(nlat1*sizeof(double *));
+	  lon1 = (double *) realloc(lon1, (nlon1+1)*sizeof(double));
+	  array = (double *) malloc(nlat1*(nlon1+1)*sizeof(double));
+
+	  for ( ilat = 0; ilat < nlat1; ilat++ )
+	    {
+	      array1_2D[ilat] = array + ilat*(nlon1+1);  
+	      memcpy(array1_2D[ilat], field[ilat], nlon1*sizeof(double));
+	      array1_2D[ilat][nlon1] = array1_2D[ilat][0];
+	      lon1[nlon1] = lon1[0] + 360;
+	    }
+	  nlon1++;
+	  free(field);
+	}
+
+      if ( lon2 < lon1[0] || lon2 > lon1[nlon1-1] )
+	cdoAbort("Longitude %f out of bounds (%f to %f)!", lon2, lon1[0], lon1[nlon1-1]);
+
+      if ( lat2 < MIN(lat1[0], lat1[nlat1-1]) ||
+	   lat2 > MAX(lat1[0], lat1[nlat1-1]) )
+	cdoAbort("Latitude %f out of bounds (%f to %f)!", lat2, lat1[0], lat1[nlat1-1]);
+
+      *array2 = intlinarr2p(nlon1, nlat1, array1_2D, lon1, lat1, lon2, lat2);
+      /*
+      printf("%5d %f %f %f\n", index++, lon2, lat2, *array2);
+      */
+    }
+  else
+    {
+      int gridsize2;
+      double *lon2, *lat2;
+
+      if ( gridInqType(gridID2) == GRID_GME ) gridID2 = gridToUnstructured(gridID2, 0);
+
+      if ( gridInqType(gridID2) != GRID_UNSTRUCTURED && gridInqType(gridID2) != GRID_CURVILINEAR )
+	gridID2 = gridToCurvilinear(gridID2, 0);
+
+      if ( ! (gridInqXvals(gridID2, NULL) && gridInqYvals(gridID2, NULL)) )
+	cdoAbort("Target grid has no values");
+
+      gridsize2 = gridInqSize(gridID2);
+
+      lon2 = (double *) malloc(gridsize2*sizeof(double));
+      lat2 = (double *) malloc(gridsize2*sizeof(double));
+      gridInqXvals(gridID2, lon2);
+      gridInqYvals(gridID2, lat2);
+
+      intlinarr2(missval,
+		 nlon1, nlat1, array1_2D, lon1, lat1,
+		 gridsize2, array2, lon2, lat2);
+
+      nmiss = 0;
+      for ( i = 0; i < gridsize2; ++i )
+	if ( DBL_IS_EQUAL(array2[i], missval) ) nmiss++;
+
+      field2->nmiss = nmiss;
+
+      free(lon2);
+      free(lat2);
+    }
+
+  if (array) free(array);
+  free(lon1);
+  free(lat1);
+  free(array1_2D);
+}
+
+
+/* source code from pingo */
+void interpolate(field_t *field1, field_t *field2)
+{
+  int i;
+  double *lono_array, *lato_array, *lono, *lato;
+  double *lon_array, *lat_array, *lon, *lat;
+  int gridsize_i, gridsize_o;
+  int gridIDi;
+  double *arrayIn;
+  int gridIDo;
+  double *arrayOut;
+  double missval;
+  int nmiss;
+  long ilon, ilat, nxlon, nxlat, olon, olat;
+  long l11, l12, l21, l22, l1, l2;
+  double volon1, volon2, volat1, volat2;
+  double *volon11, *volon12;
+  double *volon21, *volon22;
+  double vilon1, vilon2, vilat1, vilat2;
+  double vlon1, vlon2, vlat1, vlat2;
+  long *ilon11, *ilon12;
+  long *ilon21, *ilon22;
+  long *ilat1, *ilat2;
+  long ilon1, ilon2;
+  double sum, wsum;
+  int k, n;
+  double *xin_array, *xlon, *xlat;
+  double **in0, **xin, **xout;
+  int wrap_around, xlat_is_ascending;
+  double a11, a12, a21, a22, b11, b12, b21, b22, t;
+  double faclon1, faclon2, faclat1, faclat2;
+  int nlon, nlat, out_nlon, out_nlat;
+
+  gridIDi  = field1->grid;
+  gridIDo  = field2->grid;
+  arrayIn  = field1->ptr;
+  arrayOut = field2->ptr;
+  missval  = field1->missval;
+
+  gridsize_i = gridInqSize(gridIDi);
+  gridsize_o = gridInqSize(gridIDo);
+
+  nlon  = gridInqXsize(gridIDi);
+  nlat  = gridInqYsize(gridIDi);
+  out_nlon = gridInqXsize(gridIDo);
+  out_nlat = gridInqYsize(gridIDo);
+
+  lon_array = (double *) malloc((nlon + 2) * sizeof(double));
+  lat_array = (double *) malloc((nlat + 2) * sizeof(double));
+  lon = lon_array + 1;
+  lat = lat_array + 1;
+
+  if ( ! (gridInqXvals(gridIDi, NULL) && gridInqYvals(gridIDi, NULL)) )
+    cdoAbort("Source grid has no values");
+
+  if ( ! (gridInqXvals(gridIDo, NULL) && gridInqYvals(gridIDo, NULL)) )
+    cdoAbort("Target grid has no values");
+
+  gridInqXvals(gridIDi, lon);
+  gridInqYvals(gridIDi, lat);
+
+  /* Convert lat/lon units if required */
+  {
+    char units[CDI_MAX_NAME];
+    gridInqXunits(gridIDi, units);
+    gridToDegree(units, "grid1 center lon", nlon, lon);
+    gridInqYunits(gridIDi, units);
+    gridToDegree(units, "grid1 center lat", nlat, lat);
+  }
+
+  if ( nlon > 1 )
+    {
+      lon[-1] = lon[nlon - 1] - 360 > 2*lon[0] - lon[1] ?
+	        lon[nlon - 1] - 360 : 2*lon[0] - lon[1];
+      lon[nlon] = lon[0] + 360 < 2*lon[nlon-1] - lon[nlon-2] ?
+ 	          lon[0] + 360 : 2*lon[nlon-1] - lon[nlon-2];
+    }
+  else
+    {
+      lon[-1] = lon[0] - 360;
+      lon[ 1] = lon[0] + 360;
+    }
+
+  if ( nlat > 1 )
+    {
+      lat[-1]   = 2*lat[0] - lat[1];
+      lat[nlat] = 2*lat[nlat-1] - lat[nlat-2];
+    }
+  else
+    {
+      lat[-1] = lat[0] - 10;
+      lat[ 1] = lat[nlat-1] + 10;
+    }
+
+  if ( lat[-1]   < -90 ) lat[-1] = -99;
+  if ( lat[-1]   >  90 ) lat[-1] =  99;
+  if ( lat[nlat] < -90 ) lat[nlat] = -99;
+  if ( lat[nlat] >  90 ) lat[nlat] =  99;
+
+  lono_array = (double *) malloc((out_nlon < 2 ? 4 : out_nlon + 2) * sizeof(double));
+  lono = lono_array + 1;
+  lato_array = (double *) malloc((out_nlat < 2 ? 4 : out_nlat + 2) * sizeof(double));
+  lato = lato_array + 1;
+
+  gridInqXvals(gridIDo, lono);
+  gridInqYvals(gridIDo, lato);
+
+  /* Convert lat/lon units if required */
+  {
+    char units[CDI_MAX_NAME];
+    gridInqXunits(gridIDo, units);
+    gridToDegree(units, "grid2 center lon", out_nlon, lono);
+    gridInqYunits(gridIDo, units);
+    gridToDegree(units, "grid2 center lat", out_nlat, lato);
+  }
+
+  for ( i = 0; i < out_nlon - 1; i++ )
+    if (lono[i + 1] <= lono[i]) break;
+
+  for ( i++; i < out_nlon; i++ )
+    {
+      lono[i] += 360;
+      if ( i < out_nlon - 1 && lono[i + 1] + 360 <= lono[i] )
+	cdoAbort("Longitudes of output grid are not in ascending order!");
+    }
+
+  if ( lono[out_nlon - 1] - lono[0] >= 360 )
+    cdoAbort("The area covered by the longitudes of output grid must not overlap!");
+
+  if ( lato[0] >  90.001 || lato[out_nlat - 1] >  90.001 ||
+       lato[0] < -90.001 || lato[out_nlat - 1] < -90.001 )
+    {
+      cdoAbort("Latitudes of output grid must be between 90 and -90!");
+    }
+
+  for ( i = 0; i < out_nlat - 1; i++ )
+    if ( IS_EQUAL(lato[i + 1], lato[i]) || (i < out_nlat - 2 &&
+	((lato[i + 1] > lato[i]) != (lato[i + 2] > lato[i + 1]))) )
+      {
+	cdoAbort("Latitudes of output grid must be in descending or ascending order!");
+      }
+
+  if ( out_nlon > 1 )
+    {
+      lono[-1] = lono[out_nlon - 1] - 360 > 2 * lono[0] - lono[1] ?
+	            lono[out_nlon - 1] - 360 : 2 * lono[0] - lono[1];
+      lono[out_nlon] = lono[0] + 360 < 2 * lono[out_nlon - 1] - lono[out_nlon - 2] ?
+	                  lono[0] + 360 : 2 * lono[out_nlon - 1] - lono[out_nlon - 2];
+    }
+  else
+    {
+      lono[-1] = lono[0] - 360;
+      lono[ 1] = lono[0] + 360;
+    }
+
+  if ( out_nlat > 1 )
+    {
+      lato[-1]   = 2*lato[0] - lato[1];
+      lato[out_nlat] = 2*lato[out_nlat-1] - lato[out_nlat-2];
+    }
+  else
+    {
+      lato[-1] = lato[0] - 10;
+      lato[ 1] = lato[out_nlat-1] + 10;
+    }
+
+  if ( lato[-1]   < -90 ) lato[-1] = -99;
+  if ( lato[-1]   >  90 ) lato[-1] =  99;
+  if ( lato[out_nlat] < -90 ) lato[out_nlat] = -99;
+  if ( lato[out_nlat] >  90 ) lato[out_nlat] =  99;
+
+  nxlon = 2*nlon + 1;
+  nxlat = 2*nlat + 1;
+  xin_array = (double *) malloc(nxlon * nxlat * sizeof(double));
+  xin = (double **) malloc(nxlat * sizeof(double *));
+
+  for (ilat = 0; ilat < nxlat; ilat++)
+    xin[ilat] = xin_array + ilat * nxlon;
+
+  xlon = (double *) malloc(nxlon * sizeof (double));
+  for ( ilon = 0; ilon < nlon; ilon++ )
+    {
+      xlon[2*ilon + 1] = lon[ilon];
+      xlon[2*ilon] = (lon[ilon - 1] + lon[ilon]) / 2;
+    }
+  xlon[2 * nlon] = (lon[nlon - 1] + lon[nlon]) / 2;
+
+  xlat = (double *) malloc((2 * nlat + 1) * sizeof (double));
+  for ( ilat = 0; ilat < nlat; ilat++ )
+    {
+      xlat[2*ilat + 1] = lat[ilat];
+      xlat[2*ilat] = (lat[ilat - 1] + lat[ilat]) / 2;
+    }
+  xlat[2 * nlat] = (lat[nlat - 1] + lat[nlat]) / 2;
+
+  in0 = (double **) malloc(nlat * sizeof (double *));
+  for (ilat = 0; ilat < nlat; ilat++)
+    in0[ilat] = arrayIn + ilat * nlon;
+
+  ilon11 = (long *) malloc(out_nlon * sizeof(long));
+  ilon12 = (long *) malloc(out_nlon * sizeof(long));
+  ilon21 = (long *) malloc(out_nlon * sizeof(long));
+  ilon22 = (long *) malloc(out_nlon * sizeof(long));
+  volon11 = (double *) malloc(out_nlon * sizeof(double));
+  volon12 = (double *) malloc(out_nlon * sizeof(double));
+  volon21 = (double *) malloc(out_nlon * sizeof(double));
+  volon22 = (double *) malloc(out_nlon * sizeof(double));
+
+  for (olon = 0; olon < out_nlon; olon++)
+    {
+      volon1 = (lono[olon - 1] + lono[olon]) / 2;
+      volon2 = (lono[olon] + lono[olon + 1]) / 2;
+      if ( IS_EQUAL(volon1, volon2) ) volon2 += 360;
+      volon2 -= 360 * floor((volon1 - xlon[0]) / 360);
+      volon1 -= 360 * floor((volon1 - xlon[0]) / 360);
+      volon21[olon] = volon1;
+      volon22[olon] = volon2;
+      for (l21 = 0; l21 < nxlon && xlon[l21] < volon1; l21++);
+      for (l22 = l21; l22 < nxlon && xlon[l22] < volon2; l22++);
+      volon1 -= 360;
+      volon2 -= 360;
+      volon11[olon] = volon1;
+      volon12[olon] = volon2;
+      for (l11 = 0; xlon[l11] < volon1; l11++);
+      for (l12 = l11; l12 < nxlon && xlon[l12] < volon2; l12++);
+      ilon11[olon] = l11;
+      ilon12[olon] = l12;
+      ilon21[olon] = l21;
+      ilon22[olon] = l22;
+    }
+
+  ilat1 = (long *) malloc(out_nlat * sizeof(long));
+  ilat2 = (long *) malloc(out_nlat * sizeof(long));
+
+  xlat_is_ascending = xlat[0] <= xlat[nxlat - 1];
+  for ( olat = 0; olat < out_nlat; olat++ )
+    {
+      volat1 = (lato[olat - 1] + lato[olat]) / 2;
+      volat2 = (lato[olat] + lato[olat + 1]) / 2;
+      if (!xlat_is_ascending)
+	{
+	  if (volat1 > volat2)
+	    {
+	      for (l1 =  0; l1 < nxlat && xlat[l1] > volat1; l1++);
+	      for (l2 = l1; l2 < nxlat && xlat[l2] > volat2; l2++);
+	    }
+	  else
+	    {
+	      for (l1 =  0; l1 < nxlat && xlat[l1] > volat2; l1++);
+	      for (l2 = l1; l2 < nxlat && xlat[l2] > volat1; l2++);
+	    }
+	}
+      else
+	{
+	  if (volat1 < volat2)
+	    {
+	      for (l1 =  0; l1 < nxlat && xlat[l1] < volat1; l1++);
+	      for (l2 = l1; l2 < nxlat && xlat[l2] < volat2; l2++);
+	    }
+	  else
+	    {
+	      for (l1 =  0; l1 < nxlat && xlat[l1] < volat2; l1++);
+	      for (l2 = l1; l2 < nxlat && xlat[l2] < volat1; l2++);
+	    }
+	}
+
+      ilat1[olat] = l1;
+      ilat2[olat] = l2;
+    }
+
+  xout = (double **) malloc(out_nlat * sizeof (double *));
+  for (olat = 0; olat < out_nlat; olat++)
+    xout[olat] = arrayOut + olat * out_nlon;
+
+  wrap_around = nlon > 1 && (lon[nlon - 1] >= lon[-1] + 360 - 0.001
+			      || lon[nlon] >= lon[ 0] + 360 - 0.001);
+
+  for (ilat = 0; ilat < nlat; ilat++)
+#if defined (SX)
+#pragma vdir nodep
+#endif
+    for (ilon = 0; ilon < nlon; ilon++)
+      xin[2 * ilat + 1][2 * ilon + 1] = in0[ilat][ilon];
+
+  for (ilat = 0; ilat < nxlat; ilat += 2)
+#if defined (SX)
+#pragma vdir nodep
+#endif
+    for (ilon = 1; ilon < nxlon; ilon += 2)
+      {
+	sum = 0;
+	n = 0;
+	if (ilat > 0 && !DBL_IS_EQUAL(xin[ilat - 1][ilon], missval))
+	  {
+	    sum += xin[ilat - 1][ilon];
+	    n++;
+	  }
+	if (ilat < nxlat - 1 && !DBL_IS_EQUAL(xin[ilat + 1][ilon], missval))
+	  {
+	    sum += xin[ilat + 1][ilon];
+	    n++;
+	  }
+	xin[ilat][ilon] = n ? sum / n : missval;
+      }
+
+  for ( ilat = 1; ilat < nxlat; ilat += 2 )
+#if defined (SX)
+#pragma vdir nodep
+#endif
+    for ( ilon = 0; ilon < nxlon; ilon += 2 )
+      {
+	sum = 0;
+	n = 0;
+	if (ilon > 0 && !DBL_IS_EQUAL(xin[ilat][ilon - 1], missval))
+	  {
+	    sum += xin[ilat][ilon - 1];
+	    n++;
+	  }
+	if (ilon == 0 && wrap_around && !DBL_IS_EQUAL(xin[ilat][2 * nlon - 1], missval))
+	  {
+	    sum += xin[ilat][2 * nlon - 1];
+	    n++;
+	  }
+	if (ilon < nxlon - 1 && !DBL_IS_EQUAL(xin[ilat][ilon + 1], missval))
+	  {
+	    sum += xin[ilat][ilon + 1];
+	    n++;
+	  }
+	if (ilon == nxlon - 1 && wrap_around && !DBL_IS_EQUAL(xin[ilat][1], missval))
+	  {
+	    sum += xin[ilat][1];
+	    n++;
+	  }
+	xin[ilat][ilon] = n ? sum / n : missval;
+      }
+
+  for ( ilat = 0; ilat < nxlat; ilat += 2 )
+#if defined (SX)
+#pragma vdir nodep
+#endif
+    for ( ilon = 0; ilon < nxlon; ilon += 2 )
+      {
+	sum = 0;
+	n = 0;
+	if (ilon > 0 && !DBL_IS_EQUAL(xin[ilat][ilon - 1], missval))
+	  {
+	    sum += xin[ilat][ilon - 1];
+	    n++;
+	  }
+	if (ilon == 0 && wrap_around && !DBL_IS_EQUAL(xin[ilat][2 * nlon - 1], missval))
+	  {
+	    sum += xin[ilat][2 * nlon - 1];
+	    n++;
+	  }
+	if (ilon < nxlon - 1 && !DBL_IS_EQUAL(xin[ilat][ilon + 1], missval))
+	  {
+	    sum += xin[ilat][ilon + 1];
+	    n++;
+	  }
+	if (ilon == nxlon - 1 && wrap_around && !DBL_IS_EQUAL(xin[ilat][1], missval))
+	  {
+	    sum += xin[ilat][1];
+	    n++;
+	  }
+	if (ilat > 0 && !DBL_IS_EQUAL(xin[ilat - 1][ilon], missval))
+	  {
+	    sum += xin[ilat - 1][ilon];
+	    n++;
+	  }
+	if (ilat < nxlat - 1 && !DBL_IS_EQUAL(xin[ilat + 1][ilon], missval))
+	  {
+	    sum += xin[ilat + 1][ilon];
+	    n++;
+	  }
+	xin[ilat][ilon] = n ? sum / n : missval;
+      }
+
+  for ( olat = 0; olat < out_nlat; olat++ )
+    {
+      if ( lato[-1] < lato[out_nlat] )
+	{
+	  volat1 = (lato[olat - 1] + lato[olat]) / 2;
+	  volat2 = (lato[olat] + lato[olat + 1]) / 2;
+	}
+      else
+	{
+	  volat2 = (lato[olat - 1] + lato[olat]) / 2;
+	  volat1 = (lato[olat] + lato[olat + 1]) / 2;
+	}
+
+      for ( olon = 0; olon < out_nlon; olon++ )
+	{
+	  sum = 0;
+	  wsum = 0;
+	  for (k = 0; k < 2; k++)
+	    {
+	      if (k == 0)
+		{
+		  ilon1 = ilon11[olon];
+		  ilon2 = ilon12[olon];
+		  volon1 = volon11[olon];
+		  volon2 = volon12[olon];
+		}
+	      else
+		{
+		  ilon1 = ilon21[olon];
+		  ilon2 = ilon22[olon];
+		  volon1 = volon21[olon];
+		  volon2 = volon22[olon];
+		}
+
+	      for ( ilon = ilon1; ilon <= ilon2; ilon++ )
+		{
+		  if ( ilon == 0 || ilon == nxlon ) continue;
+		  vilon1 = xlon[ilon - 1];
+		  vilon2 = xlon[ilon];
+		  for ( ilat = ilat1[olat]; ilat <= ilat2[olat]; ilat++ )
+		    {
+		      if ( ilat == 0 || ilat == nxlat ) continue;
+		      if ( xlat_is_ascending )
+			{
+			  vilat1 = xlat[ilat - 1];
+			  vilat2 = xlat[ilat];
+			  a11 = xin[ilat - 1][ilon - 1];
+			  a12 = xin[ilat - 1][ilon];
+			  a21 = xin[ilat][ilon - 1];
+			  a22 = xin[ilat][ilon];
+			}
+		      else
+			{
+			  vilat1 = xlat[ilat];
+			  vilat2 = xlat[ilat - 1];
+			  a11 = xin[ilat][ilon - 1];
+			  a12 = xin[ilat][ilon];
+			  a21 = xin[ilat - 1][ilon - 1];
+			  a22 = xin[ilat - 1][ilon];
+			}
+		      if ( DBL_IS_EQUAL(a11, missval) || DBL_IS_EQUAL(a12, missval) ||
+			   DBL_IS_EQUAL(a21, missval) || DBL_IS_EQUAL(a22, missval) )
+			{
+			  continue;
+			}
+		      if ( volon1 <= vilon1 && vilon2 <= volon2 &&
+			   volat1 <= vilat1 && vilat2 <= volat2 )
+			{
+			  vlon1 = vilon1 * M_PI / 180;
+			  vlon2 = vilon2 * M_PI / 180;
+			  vlat1 = vilat1 * M_PI / 180;
+			  vlat2 = vilat2 * M_PI / 180;
+			  b11 = a11;
+			  b12 = a12;
+			  b21 = a21;
+			  b22 = a22;
+			}
+		      else
+			{
+			  vlon1 = (volon1 <= vilon1 ? vilon1 : volon1);
+			  vlon2 = (vilon2 <= volon2 ? vilon2 : volon2);
+			  vlat1 = (volat1 <= vilat1 ? vilat1 : volat1);
+			  vlat2 = (vilat2 <= volat2 ? vilat2 : volat2);
+			  if ( vlon1 >= vlon2 - (volon2 - volon1) * 1e-5 ||
+			       vlat1 >= vlat2 - (volat2 - volat1) * 1e-5)
+			    {
+			      continue;
+			    }
+			  faclon1 = (vlon1 - vilon1) / (vilon2 - vilon1);
+			  faclon2 = (vlon2 - vilon1) / (vilon2 - vilon1);
+			  faclat1 = (vlat1 - vilat1) / (vilat2 - vilat1);
+			  faclat2 = (vlat2 - vilat1) / (vilat2 - vilat1);
+			  vlon1 *= M_PI / 180;
+			  vlon2 *= M_PI / 180;
+			  vlat1 *= M_PI / 180;
+			  vlat2 *= M_PI / 180;
+			  b11 = a11 + (a12 - a11)*faclon1 + (a21 - a11)*faclat1
+			      + (a22 - a12 - a21 + a11)*faclon1*faclat1;
+			  b12 = a11 + (a12 - a11)*faclon2 + (a21 - a11)*faclat1
+			      + (a22 - a12 - a21 + a11)*faclon2*faclat1;
+			  b21 = a11 + (a12 - a11)*faclon1 + (a21 - a11)*faclat2
+			      + (a22 - a12 - a21 + a11)*faclon1*faclat2;
+			  b22 = a11 + (a12 - a11)*faclon2 + (a21 - a11)*faclat2
+			      + (a22 - a12 - a21 + a11)*faclon2*faclat2;
+			}
+		      wsum += (vlon2 - vlon1) * (sin(vlat2) - sin(vlat1));
+		      t = 2 * sin((vlat2 + vlat1) / 2) *
+		  	      sin((vlat2 - vlat1) / 2) / (vlat2 - vlat1);
+		      sum += (vlon2 - vlon1) / 2 * ((b11 + b12) * (t - sin(vlat1)) +
+				                    (b21 + b22) * (sin(vlat2) - t));
+		    }
+		}
+	    }
+	  xout[olat][olon] = IS_NOT_EQUAL(wsum, 0) ? sum / wsum : missval;
+	}
+    }
+
+  nmiss = 0;
+  for ( i = 0; i < gridsize_o; i++ )
+    if ( DBL_IS_EQUAL(arrayOut[i], missval) ) nmiss++;
+
+  field2->nmiss = nmiss;
+
+  free(lon_array);
+  free(lat_array);
+  free(lono_array);
+  free(lato_array);
+  free(xin);
+  free(xin_array);
+  free(xlon);
+  free(xlat);
+  free(in0);
+  free(ilon11);
+  free(ilon12);
+  free(ilon21);
+  free(ilon22);
+  free(volon11);
+  free(volon12);
+  free(volon21);
+  free(volon22);
+  free(ilat1);
+  free(ilat2);
+  free(xout);
+}
+
+
+/* source code from pingo */
+void contrast(void)
+{
+  int rec = 1;
+  int nlat, nlon;
+  int i, j, size = 0;
+  double missval;
+  double **work;
+  double **in;
+  double **out;
+  double *lon;
+  double *lat;
+
+  static double *xin_array, **xin, **xout, **xwork[17];
+  static double **r, **r_bar, **r_new, **r_bar_new;
+  static double **p, **p_bar, **p_new, **p_bar_new, **swap;
+  static double a0, a1, a2, a3, a4, a5, a6, a7, a8;
+  static double dlon0, dlon1, dslat0, dslat1;
+  static double w00, w01, w10, w11, wsum;
+  static double lon0, lon1, lon2, lat0, lat1, lat2;
+  static double flat00, flat01, flat10, flat11;
+  static long ilon, ilat;
+  static int determine_matrix, wrap_around, stop_iteration;
+  static double table[2][2][2][4]
+     = { {{{8 / 32., 8 / 32., 8 / 32., 8 / 32.},
+	  {12 / 32., 8 / 32., 0, 12 / 32.}},
+	 {{12 / 32., 0, 8 / 32., 12 / 32.},
+	  {16 / 32., 0, 0, 16 / 32.}}},
+	 {{{0, 12 / 32., 12 / 32., 8 / 32.},
+	   {0, 16 / 32., 0, 16 / 32.}},
+	  {{0, 0, 16 / 32., 16 / 32.},
+	   {0, 0, 0, 32 / 32.}}}
+     };
+  static double *case_table;
+  static double f;
+  static double nom, denom, a, b;
+  static const double eps = 1e-20;
+  static double max;
+  static int iter;
+  static float iter_sum = 0, iter_n = 0;
+
+  nlat = 0;
+  nlon = 0;
+  missval = 0;
+  work = 0;
+  in = 0;
+  out = 0;
+  lon = 0;
+  lat = 0;
+
+  if (rec == 1)
+    {
+      xin_array = (double *) malloc((nlat + 2) * (nlon + 2) * sizeof(double));
+      xin = (double **) malloc((nlat + 2) * sizeof(double *));
+      *xin = *(xin + 1);
+      for (ilat = -1; ilat <= nlat; ilat++)
+	xin[ilat] = xin_array + (ilat + 1) * (nlon + 2) + 1;
+      xout = (double **) malloc(nlat * sizeof(double *));
+      for (ilat = 0; ilat < nlat; ilat++)
+	xout[ilat] = out[0] + ilat * nlon;
+      for (j = 0; j < 17; j++)
+	{
+	  xwork[j] = (double **) malloc(nlat * sizeof(double *));
+	  for (ilat = 0; ilat < nlat; ilat++)
+	    xwork[j][ilat] = work[j] + ilat * nlon;
+	}
+      wrap_around = nlon > 1 && (lon[nlon - 1] >= lon[-1] + 360 - 0.001
+				 || lon[nlon] >= lon[0] + 360 - 0.001);
+      determine_matrix = TRUE;
+    }
+  else
+    {
+      determine_matrix = FALSE;
+      for (i = 0; i < size; i++)
+	if ( DBL_IS_EQUAL(in[0][i], missval) != DBL_IS_EQUAL(out[0][i], missval) )
+	  {
+	    determine_matrix = TRUE;
+	    break;
+	  }
+    }
+  for (ilon = 0; ilon < nlon; ilon++)
+    {
+      for (ilat = 0; ilat < nlat; ilat++)
+	xin[ilat][ilon] = in[0][ilon + ilat * nlon];
+      xin[-1][ilon] = xin[nlat][ilon] = missval;
+    }
+  if (wrap_around)
+    for (ilat = -1; ilat <= nlat; ilat++)
+      {
+	xin[ilat][-1] = xin[ilat][nlon - 1];
+	xin[ilat][nlon] = xin[ilat][0];
+      }
+  else
+    for (ilat = -1; ilat <= nlat; ilat++)
+      xin[ilat][-1] = xin[ilat][nlon] = missval;
+
+  if (determine_matrix)
+    {
+      for (ilon = 0; ilon < nlon; ilon++)
+	{
+	  lon1 = lon[ilon];
+	  lon0 = (lon[ilon - 1] + lon1) / 2;
+	  lon2 = (lon[ilon + 1] + lon1) / 2;
+	  dlon0 = lon1 - lon0;
+	  dlon1 = lon2 - lon1;
+	  for (ilat = 0; ilat < nlat; ilat++)
+	    {
+	      lat1 = lat[ilat] * M_PI / 180;
+	      lat0 = (lat[ilat - 1] * M_PI / 180 + lat1) / 2;
+	      lat2 = (lat[ilat + 1] * M_PI / 180 + lat1) / 2;
+	      dslat0 = sin (lat1) - sin (lat0);
+	      dslat1 = sin (lat2) - sin (lat1);
+	      flat00 = 2 / (lat1 - lat0) * sin ((lat1 + lat0) / 2) * 
+		       sin ((lat1 - lat0) /2) - sin (lat0);
+	      flat01 = dslat0 - flat00;
+	      flat10 = 2 / (lat2 - lat1) * sin ((lat2 + lat1) / 2) * 
+                       sin ((lat2 - lat1) / 2) - sin (lat1);
+	      flat11 = dslat1 - flat10;
+	      flat00 /= 2;
+	      flat01 /= 2;
+	      flat10 /= 2;
+	      flat11 /= 2;
+	      if ( DBL_IS_EQUAL(xin[ilat][ilon], missval) )
+		{
+		  xwork[4][ilat][ilon] = 1;
+		  xwork[0][ilat][ilon] = xwork[1][ilat][ilon]
+		    = xwork[2][ilat][ilon] = xwork[3][ilat][ilon]
+		    = xwork[5][ilat][ilon] = xwork[6][ilat][ilon]
+		    = xwork[7][ilat][ilon] = xwork[8][ilat][ilon] = 0;
+		}
+	      else
+		{
+		  w00 = dslat0 * dlon0;
+		  w01 = dslat0 * dlon1;
+		  w10 = dslat1 * dlon0;
+		  w11 = dslat1 * dlon1;
+		  wsum = w00 + w01 + w10 + w11;
+
+		  a4 = dlon0 * flat01;
+		  if ( DBL_IS_EQUAL(xin[ilat - 1][ilon], missval) )
+		    {
+		      a1 = 0;
+		      a4 += dlon0 * flat00;
+		    }
+		  else
+		    {
+		      a1 = dlon0 * flat00 / 2;
+		      a4 += a1;
+		    }
+		  if ( DBL_IS_EQUAL(xin[ilat][ilon - 1], missval) )
+		    {
+		      a3 = 0;
+		      a4 += dlon0 * flat01;
+		    }
+		  else
+		    {
+		      a3 = dlon0 * flat01 / 2;
+		      a4 += a3;
+		    }
+		  case_table = table[DBL_IS_EQUAL(xin[ilat - 1][ilon - 1], missval)]
+		                    [DBL_IS_EQUAL(xin[ilat - 1][ilon], missval)]
+		                    [DBL_IS_EQUAL(xin[ilat][ilon - 1], missval)];
+		  f = dlon0 * flat00;
+		  a0 = case_table[0] * f;
+		  a1 += case_table[1] * f;
+		  a3 += case_table[2] * f;
+		  a4 += case_table[3] * f;
+		  xwork[0][ilat][ilon] = a0;
+		  xwork[1][ilat][ilon] = a1;
+		  xwork[3][ilat][ilon] = a3;
+		  xwork[4][ilat][ilon] = a4;
+
+		  a4 = dlon1 * flat01;
+		  if ( DBL_IS_EQUAL(xin[ilat - 1][ilon], missval) )
+		    {
+		      a1 = 0;
+		      a4 += dlon1 * flat00;
+		    }
+		  else
+		    {
+		      a1 = dlon1 * flat00 / 2;
+		      a4 += a1;
+		    }
+
+		  if ( DBL_IS_EQUAL(xin[ilat][ilon + 1], missval) )
+		    {
+		      a5 = 0;
+		      a4 += dlon1 * flat01;
+		    }
+		  else
+		    {
+		      a5 = dlon1 * flat01 / 2;
+		      a4 += a5;
+		    }
+		  case_table = table[DBL_IS_EQUAL(xin[ilat - 1][ilon + 1], missval)]
+		                    [DBL_IS_EQUAL(xin[ilat - 1][ilon], missval)]
+		                    [DBL_IS_EQUAL(xin[ilat][ilon + 1], missval)];
+		  f = dlon1 * flat00;
+		  a2 = case_table[0] * f;
+		  a1 += case_table[1] * f;
+		  a5 += case_table[2] * f;
+		  a4 += case_table[3] * f;
+		  xwork[2][ilat][ilon] += a2;
+		  xwork[1][ilat][ilon] += a1;
+		  xwork[5][ilat][ilon] += a5;
+		  xwork[4][ilat][ilon] += a4;
+
+		  a4 = dlon0 * flat10;
+		  if ( DBL_IS_EQUAL(xin[ilat + 1][ilon], missval) )
+		    {
+		      a7 = 0;
+		      a4 += dlon0 * flat11;
+		    }
+		  else
+		    {
+		      a7 = dlon0 * flat11 / 2;
+		      a4 += a7;
+		    }
+
+		  if ( DBL_IS_EQUAL(xin[ilat][ilon - 1], missval))
+		    {
+		      a3 = 0;
+		      a4 += dlon0 * flat10;
+		    }
+		  else
+		    {
+		      a3 = dlon0 * flat10 / 2;
+		      a4 += a3;
+		    }
+
+		  case_table = table[DBL_IS_EQUAL(xin[ilat + 1][ilon - 1], missval)]
+		                    [DBL_IS_EQUAL(xin[ilat + 1][ilon], missval)]
+		                    [DBL_IS_EQUAL(xin[ilat][ilon - 1], missval)];
+		  f = dlon0 * flat11;
+		  a6 = case_table[0] * f;
+		  a7 += case_table[1] * f;
+		  a3 += case_table[2] * f;
+		  a4 += case_table[3] * f;
+		  xwork[6][ilat][ilon] += a6;
+		  xwork[7][ilat][ilon] += a7;
+		  xwork[3][ilat][ilon] += a3;
+		  xwork[4][ilat][ilon] += a4;
+
+		  a4 = dlon1 * flat10;
+		  if ( DBL_IS_EQUAL(xin[ilat + 1][ilon], missval) )
+		    {
+		      a7 = 0;
+		      a4 += dlon1 * flat11;
+		    }
+		  else
+		    {
+		      a7 = dlon1 * flat11 / 2;
+		      a4 += a7;
+		    }
+
+		  if ( DBL_IS_EQUAL(xin[ilat][ilon + 1], missval) )
+		    {
+		      a5 = 0;
+		      a4 += dlon1 * flat10;
+		    }
+		  else
+		    {
+		      a5 = dlon1 * flat10 / 2;
+		      a4 += a5;
+		    }
+
+		  case_table = table[DBL_IS_EQUAL(xin[ilat + 1][ilon + 1], missval)]
+		                    [DBL_IS_EQUAL(xin[ilat + 1][ilon], missval)]
+		                    [DBL_IS_EQUAL(xin[ilat][ilon + 1], missval)];
+		  f = dlon1 * flat11;
+		  a8 = case_table[0] * f;
+		  a7 += case_table[1] * f;
+		  a5 += case_table[2] * f;
+		  a4 += case_table[3] * f;
+		  xwork[8][ilat][ilon] += a8;
+		  xwork[7][ilat][ilon] += a7;
+		  xwork[5][ilat][ilon] += a5;
+		  xwork[4][ilat][ilon] += a4;
+
+		  xwork[0][ilat][ilon] /= wsum;
+		  xwork[1][ilat][ilon] /= wsum;
+		  xwork[2][ilat][ilon] /= wsum;
+		  xwork[3][ilat][ilon] /= wsum;
+		  xwork[4][ilat][ilon] /= wsum;
+		  xwork[5][ilat][ilon] /= wsum;
+		  xwork[6][ilat][ilon] /= wsum;
+		  xwork[7][ilat][ilon] /= wsum;
+		  xwork[8][ilat][ilon] /= wsum;
+		}
+	    }
+	}
+    }
+
+  /* Solve sparse linear equation system
+     xin[ilat][ilon] = xwork[0][ilat][ilon]*xout[ilat-1][ilon-1] 
+                     + xwork[1][ilat][ilon]*xout[ilat-1][ilon  ] 
+	             + xwork[2][ilat][ilon]*xout[ilat-1][ilon+1] 
+	             + xwork[3][ilat][ilon]*xout[ilat  ][ilon-1] 
+	             + xwork[4][ilat][ilon]*xout[ilat  ][ilon  ] 
+	             + xwork[5][ilat][ilon]*xout[ilat  ][ilon+1] 
+	             + xwork[6][ilat][ilon]*xout[ilat+1][ilon-1] 
+	             + xwork[7][ilat][ilon]*xout[ilat+1][ilon  ] 
+	             + xwork[8][ilat][ilon]*xout[ilat+1][ilon+1]
+     using the biconjugate gradient method */
+
+  max = 0;
+  for (ilat = 0; ilat < nlat; ilat++)
+    for (ilon = 0; ilon < nlon; ilon++)
+      {
+	f = xin[ilat][ilon];
+	if (!DBL_IS_EQUAL(f, missval) && f > max)
+	  max = f;
+      }
+
+  r = xwork[9];
+  r_bar = xwork[10];
+  r_new = xwork[11];
+  r_bar_new = xwork[12];
+  p = xwork[13];
+  p_bar = xwork[14];
+  p_new = xwork[15];
+  p_bar_new = xwork[16];
+
+  for (ilat = 0; ilat < nlat; ilat++)
+    for (ilon = 0; ilon < nlon; ilon++)
+      xout[ilat][ilon] = xin[ilat][ilon];
+
+  for (ilat = 0; ilat < nlat; ilat++)
+    for (ilon = 0; ilon < nlon; ilon++)
+      r[ilat][ilon] = r_bar[ilat][ilon]
+	            = p[ilat][ilon]
+	            = p_bar[ilat][ilon]
+	            = xin[ilat][ilon] - (xwork[0][ilat][ilon] * xin[ilat - 1][ilon - 1]
+	                              + xwork[1][ilat][ilon] * xin[ilat - 1][ilon]
+	                              + xwork[2][ilat][ilon] * xin[ilat - 1][ilon + 1]
+	                              + xwork[3][ilat][ilon] * xin[ilat][ilon - 1]
+	                              + xwork[4][ilat][ilon] * xin[ilat][ilon]
+	                              + xwork[5][ilat][ilon] * xin[ilat][ilon + 1]
+	                              + xwork[6][ilat][ilon] * xin[ilat + 1][ilon - 1]
+	                              + xwork[7][ilat][ilon] * xin[ilat + 1][ilon]
+	                              + xwork[8][ilat][ilon] * xin[ilat + 1][ilon + 1]);
+
+  for (iter = 1;; iter++)
+    {
+      stop_iteration = TRUE;
+      for (ilat = 0; ilat < nlat; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  if (fabs (r[ilat][ilon]) > eps * max)
+	    {
+	      stop_iteration = FALSE;
+	      break;
+	    }
+      if (stop_iteration)
+	break;
+      /*
+      if (user_asked)
+	{
+	  lock ();
+	  fprintf (stderr,
+		   "%s: Status: Raising contrast of record %d"
+		   " iteration step %d", prompt, rec, iter);
+	  if (iter_n)
+	    fprintf (stderr, " of approximately %d.\n",
+		     (int) (iter_sum / iter_n));
+	  else
+	    fputs (".\n", stderr);
+	  fflush (stderr);
+	  unlock ();
+	  user_asked = FALSE;
+	}
+      */
+      if (iter == 1)
+	{
+	  nom = 0;
+	  for (ilat = 0; ilat < nlat; ilat++)
+	    for (ilon = 0; ilon < nlon; ilon++)
+	      nom += r[ilat][ilon] * r_bar[ilat][ilon];
+	}
+      for (ilat = 0; ilat < nlat; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  r_new[ilat][ilon] = xwork[4][ilat][ilon] * p[ilat][ilon];
+      for (ilat = 1; ilat < nlat; ilat++)
+	{
+	  for (ilon = 1; ilon < nlon; ilon++)
+	    r_new[ilat][ilon] +=
+	      xwork[0][ilat][ilon] * p[ilat - 1][ilon - 1];
+	  r_new[ilat][0] += xwork[0][ilat][0] * p[ilat - 1][nlon - 1];
+	}
+      for (ilat = 1; ilat < nlat; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  r_new[ilat][ilon] += xwork[1][ilat][ilon] * p[ilat - 1][ilon];
+      for (ilat = 1; ilat < nlat; ilat++)
+	{
+	  for (ilon = 0; ilon < nlon - 1; ilon++)
+	    r_new[ilat][ilon] +=
+	      xwork[2][ilat][ilon] * p[ilat - 1][ilon + 1];
+	  r_new[ilat][nlon - 1] +=
+	    xwork[2][ilat][nlon - 1] * p[ilat - 1][0];
+	}
+      for (ilat = 0; ilat < nlat; ilat++)
+	{
+	  for (ilon = 1; ilon < nlon; ilon++)
+	    r_new[ilat][ilon] += xwork[3][ilat][ilon] * p[ilat][ilon - 1];
+	  r_new[ilat][0] += xwork[3][ilat][0] * p[ilat][nlon - 1];
+	}
+      for (ilat = 0; ilat < nlat; ilat++)
+	{
+	  for (ilon = 0; ilon < nlon - 1; ilon++)
+	    r_new[ilat][ilon] +=
+	      xwork[5][ilat][ilon] * p[ilat][ilon + 1];
+	  r_new[ilat][nlon - 1] +=
+	    xwork[5][ilat][nlon - 1] * p[ilat][0];
+	}
+      for (ilat = 0; ilat < nlat - 1; ilat++)
+	{
+	  for (ilon = 1; ilon < nlon; ilon++)
+	    r_new[ilat][ilon] +=
+	      xwork[6][ilat][ilon] * p[ilat + 1][ilon - 1];
+	  r_new[ilat][0] += xwork[6][ilat][0] * p[ilat + 1][nlon - 1];
+	}
+      for (ilat = 0; ilat < nlat - 1; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  r_new[ilat][ilon] += xwork[7][ilat][ilon] * p[ilat + 1][ilon];
+      for (ilat = 0; ilat < nlat - 1; ilat++)
+	{
+	  for (ilon = 0; ilon < nlon - 1; ilon++)
+	    r_new[ilat][ilon] +=
+	      xwork[8][ilat][ilon] * p[ilat + 1][ilon + 1];
+	  r_new[ilat][nlon - 1] +=
+	    xwork[8][ilat][nlon - 1] * p[ilat + 1][0];
+	}
+      denom = 0;
+      for (ilat = 0; ilat < nlat; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  denom += p_bar[ilat][ilon] * r_new[ilat][ilon];
+
+      if ( IS_EQUAL(denom, 0) ) break;
+
+      a = nom / denom;
+
+      for (ilat = 0; ilat < nlat; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  r_new[ilat][ilon] = r[ilat][ilon] - a * r_new[ilat][ilon];
+      for (ilat = 0; ilat < nlat; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  r_bar_new[ilat][ilon] =
+	    xwork[4][ilat][ilon] * p_bar[ilat][ilon];
+      for (ilat = 1; ilat < nlat; ilat++)
+	{
+	  for (ilon = 1; ilon < nlon; ilon++)
+	    r_bar_new[ilat][ilon] += xwork[8][ilat - 1][ilon - 1] * p_bar[ilat - 1][ilon - 1];
+
+	  r_bar_new[ilat][0] += xwork[8][ilat - 1][nlon - 1] * p_bar[ilat - 1][nlon - 1];
+	}
+
+      for (ilat = 1; ilat < nlat; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  r_bar_new[ilat][ilon] += xwork[7][ilat - 1][ilon] * p_bar[ilat - 1][ilon];
+
+      for (ilat = 1; ilat < nlat; ilat++)
+	{
+	  for (ilon = 0; ilon < nlon - 1; ilon++)
+	    r_bar_new[ilat][ilon] += xwork[6][ilat - 1][ilon + 1] * p_bar[ilat - 1][ilon + 1];
+
+	  r_bar_new[ilat][nlon - 1] += xwork[6][ilat - 1][0] * p_bar[ilat - 1][0];
+	}
+      for (ilat = 0; ilat < nlat; ilat++)
+	{
+	  for (ilon = 1; ilon < nlon; ilon++)
+	    r_bar_new[ilat][ilon] += xwork[5][ilat][ilon - 1] * p_bar[ilat][ilon - 1];
+	  r_bar_new[ilat][0] += xwork[5][ilat][nlon - 1] * p_bar[ilat][nlon - 1];
+	}
+
+      for (ilat = 0; ilat < nlat; ilat++)
+	{
+	  for (ilon = 0; ilon < nlon - 1; ilon++)
+	    r_bar_new[ilat][ilon] += xwork[3][ilat][ilon + 1] * p_bar[ilat][ilon + 1];
+
+	  r_bar_new[ilat][nlon - 1] += xwork[3][ilat][0] * p_bar[ilat][0];
+	}
+      for (ilat = 0; ilat < nlat - 1; ilat++)
+	{
+	  for (ilon = 1; ilon < nlon; ilon++)
+	    r_bar_new[ilat][ilon] += xwork[2][ilat + 1][ilon - 1] * p_bar[ilat + 1][ilon - 1];
+	  r_bar_new[ilat][0] += xwork[2][ilat + 1][nlon - 1] * p_bar[ilat + 1][nlon - 1];
+	}
+      for (ilat = 0; ilat < nlat - 1; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  r_bar_new[ilat][ilon] += xwork[1][ilat + 1][ilon] * p_bar[ilat + 1][ilon];
+      for (ilat = 0; ilat < nlat - 1; ilat++)
+	{
+	  for (ilon = 0; ilon < nlon - 1; ilon++)
+	    r_bar_new[ilat][ilon] += xwork[0][ilat + 1][ilon + 1] * p_bar[ilat + 1][ilon + 1];
+	  r_bar_new[ilat][nlon - 1] += xwork[0][ilat + 1][0] * p_bar[ilat + 1][0];
+	}
+      for (ilat = 0; ilat < nlat; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  r_bar_new[ilat][ilon] = r_bar[ilat][ilon] - a * r_bar_new[ilat][ilon];
+      denom = nom;
+      nom = 0;
+      for (ilat = 0; ilat < nlat; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  nom += r_bar_new[ilat][ilon] * r_new[ilat][ilon];
+      if ( IS_EQUAL(denom, 0) )
+	break;
+      b = nom / denom;
+      for (ilat = 0; ilat < nlat; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  {
+	    p_new[ilat][ilon] = r_new[ilat][ilon] + b * p[ilat][ilon];
+	    p_bar_new[ilat][ilon] = r_bar_new[ilat][ilon] + b * p_bar[ilat][ilon];
+	  }
+      for (ilat = 0; ilat < nlat; ilat++)
+	for (ilon = 0; ilon < nlon; ilon++)
+	  if ( !DBL_IS_EQUAL(xout[ilat][ilon], missval) )
+	    xout[ilat][ilon] += a * p[ilat][ilon];
+      swap = r_new;
+      r_new = r;
+      r = swap;
+      swap = r_bar_new;
+      r_bar_new = r_bar;
+      r_bar = swap;
+      swap = p_new;
+      p_new = p;
+      p = swap;
+      swap = p_bar_new;
+      p_bar_new = p_bar;
+      p_bar = swap;
+    }
+  iter_sum = iter_sum * 0.9 + iter;
+  iter_n = iter_n * 0.9 + 1;
+
+  free(xin_array);
+  free(xin);
+  free(xout);
+  for (j = 0; j < 17; j++)
+    free(xwork[j]);
+}
diff --git a/src/interpol.h b/src/interpol.h
new file mode 100644
index 0000000..d73a138
--- /dev/null
+++ b/src/interpol.h
@@ -0,0 +1,3 @@
+
+void intgrid(field_t *field1, field_t *field2);
+void interpolate(field_t *field1, field_t *field2);
diff --git a/src/job.c b/src/job.c
new file mode 100644
index 0000000..de5e79d
--- /dev/null
+++ b/src/job.c
@@ -0,0 +1,764 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+
+#include <sys/types.h>  /* fstat */
+#include <sys/stat.h>
+#include <unistd.h>
+
+#include "cdo.h"
+
+#if  defined  (HAVE_LIBDRMAA)
+#  include "drmaa.h"
+#endif
+
+#define  GRID_TMPDIR  "/opt/griddata/tmp"
+
+int ftpget(int flag, const char *url, const char *path, const char *target, const char *source);
+
+#if  defined  (HAVE_LIBDRMAA)
+static drmaa_job_template_t *create_job_template(const char *expname, const char *jobfilename, const char *jobname, const char *tmppath)
+{
+  drmaa_job_template_t *job = NULL;
+
+  char error[DRMAA_ERROR_STRING_BUFFER];
+  char name[DRMAA_ATTR_BUFFER], value[DRMAA_ATTR_BUFFER];
+  char attr[1024];
+
+  long size;
+  char *dir, *ptr;
+
+  drmaa_attr_names_t *job_attributes;
+
+  int drmaa_errno;
+
+  char host[1024];
+
+  char *output_path;
+
+  int len, len1, len2;
+
+  /* determine hostname */
+
+#if defined (HAVE_GETHOSTNAME)
+  gethostname(host, sizeof(host));  
+#else
+  fprintf(stderr, "Function gethostname not available!\n");
+  exit(EXIT_FAILURE);
+#endif
+
+  /* determine current path */
+
+  size = pathconf(".", _PC_PATH_MAX);
+  if ( (dir = (char *)malloc((size_t)size)) != NULL )
+    {
+      ptr = getcwd(dir, (size_t)size);
+    }
+
+  /* generate DRMAA conform output path */
+  
+  len1 = strlen(host);
+  /*len2 = strlen(dir);*/
+  len2 = strlen(GRID_TMPDIR);
+  len = len1+len2+2;
+
+  output_path = (char *) malloc(len*sizeof(char));
+  /*
+  strcpy(output_path, host);
+  strcat(output_path, ":");
+  */
+  strcpy(output_path, ":");
+  strcat(output_path, GRID_TMPDIR);
+
+  /* need to allow chdir on execution host, not thread save! */
+
+  /* setenv("SGE_DRMAA_ALLOW_CWD", "yes", 1); */
+
+  /* allocate job template */
+
+  if (drmaa_allocate_job_template(&job, NULL, 0) != DRMAA_ERRNO_SUCCESS)
+    return NULL;
+
+  /* the job's name */
+  drmaa_set_attribute(job, DRMAA_JOB_NAME, jobname, NULL, 0);
+
+  /* the job to be run */
+  drmaa_set_attribute(job, DRMAA_REMOTE_COMMAND, jobfilename, NULL, 0);
+
+  /* submit state */
+  drmaa_set_attribute(job, DRMAA_JS_STATE, "drmaa_active", NULL, 0);
+
+  /* working directory on execution host */
+  /* drmaa_set_attribute(job, DRMAA_WD, GRID_TMPDIR, NULL, 0); */
+  drmaa_set_attribute(job, DRMAA_WD, tmppath, NULL, 0);
+
+  /* path for output */
+  /* drmaa_set_attribute(job, DRMAA_OUTPUT_PATH, output_path, NULL, 0); */
+
+  /* join output/error file */
+  drmaa_set_attribute(job, DRMAA_JOIN_FILES, "n", NULL, 0);
+
+  /* transfer files */
+  /* drmaa_set_attribute(job, DRMAA_TRANSFER_FILES, "ieo", NULL, 0); */
+  
+  /* some native SGE commands necessary */
+  sprintf(attr, "-cwd -b n -q %s.q", expname);
+  drmaa_set_attribute(job, DRMAA_NATIVE_SPECIFICATION, attr, NULL, 0);  
+
+  /* print out job attributes */
+  drmaa_get_attribute_names (&job_attributes, error, DRMAA_ERROR_STRING_BUFFER);
+
+  if ( cdoVerbose )
+    while ((drmaa_errno = drmaa_get_next_attr_name(job_attributes, name, DRMAA_ATTR_BUFFER)) == DRMAA_ERRNO_SUCCESS) {
+      drmaa_get_attribute (job, name, value, DRMAA_ATTR_BUFFER, error,  DRMAA_ERROR_STRING_BUFFER);
+
+      fprintf (stderr, "name: %-25s \t %s\n", name, value);
+    }
+
+  free(dir);
+
+  return job;
+}
+#endif
+
+
+#if  defined  (HAVE_LIBDRMAA)
+static int drmaa_submit(const char *expname, const char *jobfilename, const char *jobname, const char *tmppath, const char *ftppath)
+{
+  char status[DRMAA_ERROR_STRING_BUFFER];
+  char jobid[DRMAA_JOBNAME_BUFFER], jobout[DRMAA_JOBNAME_BUFFER];
+  int drmaa_errno, stat;
+  drmaa_job_template_t *job;
+  int aborted, exited, signaled, exit_status;
+  drmaa_attr_values_t *rusage = NULL;
+  char usage[DRMAA_ERROR_STRING_BUFFER];
+  int stdout_is_tty = 0;
+  int errnum;
+
+  { /* check character device on stdout */
+    struct stat statbuf;
+    fstat(1, &statbuf);
+    if ( S_ISCHR(statbuf.st_mode) ) stdout_is_tty = 1;  
+  }
+
+  if ( drmaa_init(NULL, status, sizeof(status)-1) != DRMAA_ERRNO_SUCCESS )
+    {
+      fprintf(stderr, "drmaa_init() failed: %s\n", status);
+      return 1;
+    }
+
+  /* submit some sequential jobs */
+
+  if ( !(job = create_job_template(expname, jobfilename, jobname, tmppath)) )
+    {
+      fprintf(stderr, "create_job_template() failed\n");
+      return 1;
+    }
+
+  while ( (drmaa_errno = drmaa_run_job(jobid, sizeof(jobid)-1, job, status, sizeof(status)-1))
+	  == DRMAA_ERRNO_DRM_COMMUNICATION_FAILURE )
+    {
+      fprintf(stderr, "drmaa_run_job() failed - retry: %s\n", status);
+      sleep(1);
+    }
+
+  if ( drmaa_errno != DRMAA_ERRNO_SUCCESS )
+    {
+      fprintf(stderr, "drmaa_run_job() failed: %s\n", status);
+      return 1;
+    }
+
+  if ( stdout_is_tty )
+    {
+      fprintf(stdout, "%s job %s ", expname, jobid);
+      fprintf(stdout, "submitted ");
+      fflush(stdout);
+    }
+
+  if ( stdout_is_tty )
+    {
+      int iwait;
+      const char waitc[] = "|/-\\";
+
+      iwait = 0;
+      while ( 1 )
+	{
+	  sleep (1);
+	
+	  errnum = drmaa_job_ps(jobid, &stat, status, DRMAA_ERROR_STRING_BUFFER);
+         
+	  if ( errnum != DRMAA_ERRNO_SUCCESS ) break;
+
+	  if ( stat == DRMAA_PS_QUEUED_ACTIVE ||
+	       stat == DRMAA_PS_SYSTEM_ON_HOLD ||
+	       stat == DRMAA_PS_USER_ON_HOLD ||
+	       stat == DRMAA_PS_USER_SYSTEM_ON_HOLD )
+	    {
+	      fprintf(stdout, "\b\b\b\b\b\b\b\b\b\bqueued   ");
+	      fprintf(stdout, "%c", (int)waitc[iwait%4]);
+	      fflush(stdout);
+              iwait++;
+	    }
+	  else
+	    break;
+	}
+
+      iwait = 0;
+      while ( 1 )
+	{
+	  sleep (1);
+	
+	  errnum = drmaa_job_ps(jobid, &stat, status, DRMAA_ERROR_STRING_BUFFER);
+
+	  if ( errnum != DRMAA_ERRNO_SUCCESS ) break;
+
+	  if ( stat == DRMAA_PS_RUNNING )
+	    {
+	      fprintf(stdout, "\b\b\b\b\b\b\b\b\b\brunning  ");
+	      fprintf(stdout, "%c", (int)waitc[iwait%4]);
+	      fflush(stdout);
+              iwait++;
+	    }
+	  else
+	    break;
+	}
+    }
+
+  drmaa_delete_job_template(job, NULL, 0);
+
+  /* wait for job */
+
+  drmaa_errno = drmaa_wait(jobid, jobout, sizeof(jobout)-1, 
+			   &stat, DRMAA_TIMEOUT_WAIT_FOREVER, &rusage, status, sizeof(status)-1);
+
+  if ( drmaa_errno != DRMAA_ERRNO_SUCCESS )
+    {
+      fprintf(stderr, "drmaa_wait(%s) failed: %s\n", jobout, status);
+      return 1;
+    }
+  
+  /*
+   * report how job finished 
+   */
+  drmaa_wifaborted(&aborted, stat, NULL, 0);
+  if ( aborted )
+    {
+      fprintf(stderr, "job %s never ran\n", jobid);
+      return 1;
+    }
+  else
+    {
+      drmaa_wifexited(&exited, stat, NULL, 0);
+      if ( exited )
+	{
+	  drmaa_wexitstatus(&exit_status, stat, NULL, 0);
+	  if ( stdout_is_tty )
+	    {
+	      fprintf(stdout, "\b\b\b\b\b\b\b\b\b\bfinished  \n");
+	    } 
+
+	  if ( exit_status )
+	    fprintf(stdout, "%s job %s exit status %d\n", expname, jobid, exit_status);
+	}
+      else 
+	{
+	  drmaa_wifsignaled(&signaled, stat, NULL, 0);
+	  if ( signaled )
+	    {
+	      char termsig[DRMAA_SIGNAL_BUFFER+1];
+	      drmaa_wtermsig(termsig, DRMAA_SIGNAL_BUFFER, stat, NULL, 0);
+	      fprintf(stderr, "job %s finished due to signal %s\n", jobid, termsig);
+	    }
+	  else
+	    fprintf(stderr, "job %s finished with unclear conditions\n", jobid);
+	}
+    }
+
+  if ( stdout_is_tty ) fprintf(stdout, "\n");
+
+  if ( cdoVerbose )
+    {
+      fprintf(stderr, "Job usage:\n");
+                
+      while (drmaa_get_next_attr_value (rusage, usage, DRMAA_ERROR_STRING_BUFFER) == DRMAA_ERRNO_SUCCESS) {
+	fprintf(stderr, "  %s\n", usage);
+      }
+    }
+                
+  drmaa_release_attr_values (rusage);
+
+  if ( drmaa_exit(status, sizeof(status)-1) != DRMAA_ERRNO_SUCCESS )
+    {
+      fprintf(stderr, "drmaa_exit() failed: %s\n", status);
+      return 1;
+    }
+
+  {
+    char commandline[1024];
+    char ftp_url[4096];
+    char outname[1024];
+    char errname[1024];
+    int status;
+
+    sprintf(ftp_url, "ftp://%s.zmaw.de", expname);
+
+    sprintf(outname, "%s.o%s", jobname, jobid);
+    sprintf(errname, "%s.e%s", jobname, jobid);
+
+    status = ftpget(0, ftp_url, ftppath, outname, outname);
+    if ( status == 0 )
+      {
+	sprintf(commandline, "cat %s | grep -v tty  | grep -v shell | grep -v SunOS | grep -v logout\n", outname);
+	status = system(commandline);
+      }
+
+    status = ftpget(0, ftp_url, ftppath, errname, errname);
+    if ( status == 0 )
+      {
+	sprintf(commandline, "cat %s | grep -v cannot | grep -v resize | grep -v rm\n", errname);
+	status = system(commandline);
+      }
+
+    sprintf(commandline, "rm -f %s %s\n", outname, errname);
+    status = system(commandline);
+  }
+
+  return 0;
+}
+#endif
+
+
+int job_submit(const char *expname, const char *jobfilename, const char *jobname, const char *tmppath, const char *ftppath)
+{
+  int status = 0;
+#if  defined  (HAVE_LIBDRMAA)
+
+  status = drmaa_submit(expname, jobfilename, jobname, tmppath, ftppath);
+#else
+  fprintf(stderr, "DRMAA support not compiled in!\n");
+#endif
+  return (status);
+}
+
+
+
+#if  defined  (HAVE_LIBCURL)
+#  include <curl/curl.h>
+#  include <curl/types.h>
+#  include <curl/easy.h>
+#endif
+
+struct FtpFile {
+  const char *filename;
+  FILE *stream;
+};
+
+
+int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream)
+{
+  struct FtpFile *out=(struct FtpFile *)stream;
+  if(out && !out->stream) {
+    out->stream=fopen(out->filename, "wb");
+    if(!out->stream)
+      return -1;
+  }
+  return fwrite(buffer, size, nmemb, out->stream);
+}
+
+
+int my_progress_func(int *stdout_is_tty,
+                     double t, /* dltotal */
+                     double d, /* dlnow */
+                     double ultotal,
+                     double ulnow)
+{
+  if ( *stdout_is_tty )
+    {
+      fprintf(stdout, "\b\b\b\b\b%4d%%", (int) (d*100/t));
+      fflush(stdout);
+    }
+
+  return 0;
+}
+
+
+int ftpget(int flag, const char *url, const char *path, const char *target, const char *source)
+{
+  int status = 0;
+#if  defined  (HAVE_LIBCURL)
+  CURL *curl;
+  CURLcode res;
+  struct curl_slist* commands = NULL ;
+  struct FtpFile ftpfile={
+    NULL, /* name to store the file as if succesful */
+    NULL
+  };
+  char filename[8192];
+  char ftpcommand[1024];
+  char errorbuffer[CURL_ERROR_SIZE];
+  int stdout_is_tty = 0;
+  char prompt[1024];
+
+  { /* check character device on stdout */
+    struct stat statbuf;
+    fstat(1, &statbuf);
+    if ( S_ISCHR(statbuf.st_mode) ) stdout_is_tty = 1;  
+  }
+
+  sprintf(filename, "%s%s", path, source);
+
+  sprintf(ftpcommand, "PWD");
+  commands = curl_slist_append(commands, ftpcommand) ;
+
+  sprintf(ftpcommand, "DELE %s\n", filename);
+  commands = curl_slist_append(commands, ftpcommand) ;
+
+  sprintf(filename, "%s%s%s", url, path, source);
+
+  if ( flag )
+    {
+      /*
+      sprintf(prompt, "Download %-40s ", filename);
+      */
+      sprintf(prompt, "Download %-30s ", source);
+      fprintf(stdout, "%s     ", prompt);
+    }
+
+  ftpfile.filename = target;
+
+  curl_global_init(CURL_GLOBAL_DEFAULT);
+
+  curl = curl_easy_init();
+
+  if ( curl )
+    {
+      curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_REQUIRED);
+
+      if ( cdoVerbose )
+	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+      else
+	curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
+
+      if ( flag )
+	{
+	  curl_easy_setopt(curl, CURLOPT_NOPROGRESS, FALSE);
+	  curl_easy_setopt(curl, CURLOPT_PROGRESSFUNCTION, my_progress_func);
+	  curl_easy_setopt(curl, CURLOPT_PROGRESSDATA, &stdout_is_tty);
+	}
+
+      curl_easy_setopt(curl, CURLOPT_FTP_SSL, CURLFTPSSL_CONTROL); 
+      curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_TLS);
+
+      curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+      curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
+
+      curl_easy_setopt(curl, CURLOPT_SSLKEYPASSWD, "");
+
+      curl_easy_setopt(curl, CURLOPT_URL, filename);
+
+      /* define callback */
+
+      curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite);
+
+      /* set a pointer to struct to pass to the callback */
+
+      curl_easy_setopt(curl, CURLOPT_WRITEDATA, &ftpfile);
+
+      curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorbuffer);
+
+      curl_easy_setopt(curl, CURLOPT_POSTQUOTE, commands);
+
+      res = curl_easy_perform(curl);
+
+      curl_slist_free_all(commands);
+
+      curl_easy_cleanup(curl);
+
+      if ( CURLE_OK != res )
+	{
+	  if ( flag )
+	    {
+	      /* fprintf(stderr, "curl told us %d\n", res); */
+	      fprintf(stderr, "%s\n", errorbuffer);
+	    }
+	  status = -2;
+	}
+    }
+  else
+    {
+      status = -1;
+    }
+
+  if ( ftpfile.stream ) fclose(ftpfile.stream);
+
+  curl_global_cleanup();
+
+  if ( flag ) fprintf(stdout, "\n");
+#else
+  fprintf(stderr, "CURL support not compiled in!\n");
+#endif
+
+  return (status);
+}
+
+
+int ftprmd(const char *url, const char *path)
+{
+  int status = 0;
+#if  defined  (HAVE_LIBCURL)
+  CURL *curl;
+  CURLcode res;
+  struct curl_slist* commands = NULL ;
+  char filename[8192];
+  char ftpcommand[1024];
+  char errorbuffer[CURL_ERROR_SIZE];
+
+  sprintf(ftpcommand, "RMD %s\n", path);
+  commands = curl_slist_append(commands, ftpcommand) ;
+
+  /* sprintf(filename, "%s%s/tmp", url, path); */
+  sprintf(filename, "%s/tmp", url); /* dummy parameter, not used! */
+  /* sprintf(filename, "%s", url);*/
+
+  curl_global_init(CURL_GLOBAL_DEFAULT);
+
+  curl = curl_easy_init();
+
+  if ( curl )
+    {
+      curl_easy_setopt(curl, CURLOPT_NETRC, CURL_NETRC_REQUIRED);
+
+      if ( cdoVerbose )
+	curl_easy_setopt(curl, CURLOPT_VERBOSE, 1L);
+      else
+	curl_easy_setopt(curl, CURLOPT_VERBOSE, 0L);
+
+      curl_easy_setopt(curl, CURLOPT_FTP_SSL, CURLFTPSSL_CONTROL); 
+      curl_easy_setopt(curl, CURLOPT_FTPSSLAUTH, CURLFTPAUTH_TLS);
+
+      curl_easy_setopt(curl, CURLOPT_SSL_VERIFYPEER, 0L);
+      curl_easy_setopt(curl, CURLOPT_SSL_VERIFYHOST, 0L);
+
+      curl_easy_setopt(curl, CURLOPT_SSLKEYPASSWD, "");
+
+      curl_easy_setopt(curl, CURLOPT_URL, filename);
+
+      curl_easy_setopt(curl, CURLOPT_ERRORBUFFER, errorbuffer);
+
+      curl_easy_setopt(curl, CURLOPT_PREQUOTE, commands);
+
+      res = curl_easy_perform(curl);
+
+      curl_slist_free_all(commands);
+
+      curl_easy_cleanup(curl);
+
+      if ( CURLE_OK != res )
+	{
+	  status = -2;
+	}
+    }
+  else
+    {
+      status = -1;
+    }
+
+  curl_global_cleanup();
+
+#else
+  fprintf(stderr, "CURL support not compiled in!\n");
+#endif
+
+  return (status);
+}
+
+
+#define  DEFAULT_CDO_REMOTE_PATH  "/client/bin/cdo"
+const char *cdojobfiles  = "ftp_files";
+
+void exp_run(int argc, char *argv[], char *cdoExpName)
+{
+  char commandline[65536];
+  int i;
+  int status;
+  char jobname[1024];
+  char jobfilename[1024];
+  char ftp_url[4096];
+  char ftpfile[1024];
+  char ftppath[4096];
+  char tmppath[4096];
+  char ftppath0[4096];
+  char tmppath0[4096];
+  char tmpdir[1024];
+  FILE *jobfilep, *ftpfilep;
+  char *envstr;
+  size_t len;
+  char host[1024];
+
+#if defined (HAVE_GETHOSTNAME)
+  gethostname(host, sizeof(host));
+#else
+  fprintf(stderr, "Function gethostname not available!\n");
+  exit(EXIT_FAILURE);
+#endif
+
+  sprintf(tmpdir, "cdo_%s_%d", host, (int) getpid());
+  /*
+  printf("tmpdir: >%s<\n", tmpdir);
+  */
+
+  envstr = getenv("CDO_REMOTE_PATH");
+  if ( envstr )
+    {
+      if ( cdoVerbose )
+	fprintf(stderr, "CDO_REMOTE_PATH        = %s\n", envstr);
+
+      strcpy(commandline, envstr);
+    }
+  else
+    {
+      strcpy(commandline, DEFAULT_CDO_REMOTE_PATH);
+    }
+
+  envstr = getenv("CDO_REMOTE_TMP");
+  if ( envstr )
+    {
+      if ( cdoVerbose )
+	fprintf(stderr, "CDO_REMOTE_TMP         = %s\n", envstr);
+
+      strcpy(tmppath, envstr);
+    }
+  else
+    {
+      sprintf(tmppath, "/%s/tmp", cdoExpName);
+    }
+
+  envstr = getenv("CDO_REMOTE_FTP");
+  if ( envstr )
+    {
+      if ( cdoVerbose )
+	fprintf(stderr, "CDO_REMOTE_FTP         = %s\n", envstr);
+
+      strcpy(ftppath, envstr);
+    }
+  else
+    {
+      strcpy(ftppath, tmppath);
+    }
+
+  len = strlen("scratch");
+  if ( strlen(tmppath) > len+1 )
+    if ( memcmp(tmppath+1, "scratch", len) == 0 )
+      {
+	strcpy(ftppath, tmppath+len+1);
+      }
+
+  len = strlen(cdoExpName);
+  if ( strlen(tmppath) > len+1 )
+    if ( memcmp(tmppath+1, cdoExpName, len) == 0 )
+      {
+	strcpy(ftppath, tmppath+len+1);
+      }
+
+  strcat(tmppath, "/");
+  strcat(ftppath, "/");
+
+  strcpy(tmppath0, tmppath);
+  strcpy(ftppath0, ftppath);
+
+  strcat(tmppath, tmpdir);
+  strcat(ftppath, tmpdir);
+
+  strcat(tmppath, "/");
+  strcat(ftppath, "/");
+
+  if ( cdoVerbose )
+    {
+      fprintf(stdout, "tmppath: >%s<\n", tmppath);
+      fprintf(stdout, "ftppath: >%s<\n", ftppath);
+    }
+
+  for ( i = 1; i < argc; i++ )
+    {
+      strcat(commandline, " ");
+      strcat(commandline, argv[i]);
+    }
+  /*
+  printf("command: >%s<\n", commandline);
+  */
+  sprintf(jobfilename, "%s/cdojob_%s_%d.sh", GRID_TMPDIR, host, (int) getpid());
+
+  jobfilep = fopen(jobfilename, "w");
+
+  if ( jobfilep == NULL )
+    {
+      fprintf(stderr, "Open failed on %s\n", jobfilename);
+      perror(jobfilename);
+      exit(EXIT_FAILURE);
+    }
+
+  fprintf(jobfilep, "#!/bin/csh\n"); /* not used !!! */
+  fprintf(jobfilep, "#uname -s\n");
+  fprintf(jobfilep, "#pwd\n");
+  fprintf(jobfilep, "#env\n");
+  fprintf(jobfilep, "#echo\n");
+  fprintf(jobfilep, "#echo $SHELL\n");
+  fprintf(jobfilep, "#ls -l %s\n", tmppath);
+  fprintf(jobfilep, "mkdir %s\n", tmppath);
+  fprintf(jobfilep, "cd %s\n", tmppath);
+  fprintf(jobfilep, "#echo $LD_LIBRARY_PATH\n");
+  fprintf(jobfilep, "#setenv LD_LIBRARY_PATH /opt/gridware/sge/lib/${SGE_ARCH}:$LD_LIBRARY_PATH\n");
+  fprintf(jobfilep, "%s\n", commandline);
+  
+  fclose(jobfilep);
+      
+  /*sprintf(jobname, "cdo_%s", cdoExpName); */
+  sprintf(jobname, "cdo_%s_%s", host, cdoExpName);
+
+  if ( cdoVerbose)
+    {
+      sprintf(commandline, "cat %s\n", jobfilename);
+      status = system(commandline);
+    }
+
+  status = job_submit(cdoExpName, jobfilename, jobname, tmppath0, ftppath0);
+  if ( status != 0 )
+    {
+      fprintf(stderr, "Abort: %s job failed!\n", cdoExpName);
+      exit(EXIT_FAILURE);
+    }
+
+  sprintf(commandline, "rm -f %s\n", jobfilename);
+  status = system(commandline);
+
+  sprintf(commandline, "rm -f %s\n", cdojobfiles);
+  status = system(commandline);
+
+  sprintf(ftp_url, "ftp://%s.zmaw.de", cdoExpName);
+
+  status = ftpget(0, ftp_url, ftppath, cdojobfiles, cdojobfiles);
+
+  if ( status == 0 )
+    {
+      ftpfilep = fopen(cdojobfiles, "r");
+      if ( ftpfilep )
+	{
+	  while ( fscanf(ftpfilep, "%s\n", ftpfile) == 1 )
+	    {
+	      ftpget(1, ftp_url, ftppath, ftpfile, ftpfile);
+	    }
+
+	  fclose(ftpfilep);
+	}
+    }
+
+  sprintf(commandline, "rm -f %s\n", cdojobfiles);
+  status = system(commandline);
+
+  status = ftprmd(ftp_url, ftppath);
+}
diff --git a/src/juldate.c b/src/juldate.c
new file mode 100644
index 0000000..736ec05
--- /dev/null
+++ b/src/juldate.c
@@ -0,0 +1,68 @@
+#include <cdi.h>
+#include "cdo_int.h"
+
+
+void encode_caldaysec(int calendar, int year, int month, int day, int hour, int minute, int second,
+		      int *julday, int *secofday);
+void decode_caldaysec(int calendar, int julday, int secofday, 
+		      int *year, int *month, int *day, int *hour, int *minute, int *second);
+
+
+juldate_t juldate_encode(int calendar, int date, int time)
+{
+  int year, month, day, hour, minute, second;
+  juldate_t juldate;
+
+  cdiDecodeDate(date, &year, &month, &day);
+  cdiDecodeTime(time, &hour, &minute, &second);
+
+  encode_caldaysec(calendar, year, month, day, hour, minute, second,
+		   &juldate.julday, &juldate.secofday);
+
+  return (juldate);
+}
+
+
+void juldate_decode(int calendar, juldate_t juldate, int *date, int *time)
+{
+  int year, month, day, hour, minute, second;
+  
+  decode_caldaysec(calendar, juldate.julday, juldate.secofday, 
+		   &year, &month, &day, &hour, &minute, &second);
+
+  *date = cdiEncodeDate(year, month, day);
+  *time = cdiEncodeTime(hour, minute, second);
+}
+
+
+juldate_t juldate_sub(juldate_t juldate2, juldate_t juldate1)
+{
+  juldate_t juldate;
+
+  (void) julday_sub(juldate1.julday, juldate1.secofday, juldate2.julday, juldate2.secofday, 
+		    &juldate.julday, &juldate.secofday);
+
+  return (juldate);
+}
+
+
+juldate_t juldate_add_seconds(int seconds, juldate_t juldate)
+{
+  juldate_t juldate_new;
+
+  juldate_new = juldate;
+
+  julday_add_seconds(seconds, &juldate_new.julday, &juldate_new.secofday);
+
+  return (juldate_new);
+}
+
+
+double juldate_to_seconds(juldate_t juldate)
+{
+  double seconds;
+
+  seconds = juldate.julday*86400. + juldate.secofday;
+
+  return (seconds);
+}
diff --git a/src/kvlist.c b/src/kvlist.c
new file mode 100644
index 0000000..68002b1
--- /dev/null
+++ b/src/kvlist.c
@@ -0,0 +1,427 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+/* key value list */
+
+/*
+  list type 1:
+  ============
+
+  &parameter
+    name:              ps
+    standard_name:     surface_air_pressure
+    units:             Pa
+    cell_methods:      "time: mean"
+    cell_measures:     "area: areacella"
+    long_name:         "Surface Air Pressure"
+    comment:           "not, in general, the same as mean sea-level pressure"
+    valid_min:         4.791e+04
+    valid_max:         1.119e+05
+
+  list type 2: one entry on each line
+  ============
+
+  variable_entry:    ps
+    standard_name:     surface_air_pressure
+    units:             Pa
+    cell_methods:      time: mean
+    cell_measures:     area: areacella
+    long_name:         Surface Air Pressure
+    comment:           not, in general, the same as mean sea-level pressure
+    valid_min:         4.791e+04
+    valid_max:         1.119e+05
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <errno.h>
+#include <assert.h>
+
+
+#define MAX_KVLISTS    4096
+#define MAX_KVELEMENTS 1024
+
+typedef struct {
+  char name[128];
+  char *value;
+} kvelement_t;
+
+typedef struct {
+  char name[128];
+  int num_elements;
+  kvelement_t elements[MAX_KVELEMENTS];
+} kvlist_t;
+
+typedef struct {
+  char *filename;
+  char *buffer;
+  char *bufferp;
+  size_t buffersize;
+  int num_lists;
+  kvlist_t lists[MAX_KVLISTS];
+} kvl_t;
+
+
+static
+int kvlNewList(kvl_t *kvl)
+{
+  assert(kvl != NULL);
+
+  kvl->num_lists++;
+  assert(kvl->num_lists < MAX_KVLISTS);
+
+  return (kvl->num_lists-1);
+}
+
+static
+int kvlNewListElement(kvl_t *kvl, int listID)
+{
+  assert(kvl != NULL);
+
+  kvl->lists[listID].num_elements++;
+  assert(kvl->lists[listID].num_elements < MAX_KVELEMENTS);
+
+  return (kvl->lists[listID].num_elements-1);
+}
+
+static
+int kvlAddList(kvl_t *kvl, const char *name)
+{
+  int listID = kvlNewList(kvl);
+
+  strcpy(kvl->lists[listID].name, name);
+
+  return (listID);
+}
+
+static
+void kvlAddListElement(kvl_t *kvl, int listID, const char *name, const char *value)
+{
+  int elemID = kvlNewListElement(kvl, listID);
+
+  strcpy(kvl->lists[listID].elements[elemID].name, name);
+  kvl->lists[listID].elements[elemID].value = strdup(value);
+}
+
+static
+char *readLineFromBuffer(char *buffer, size_t *buffersize, char *line, size_t len)
+{
+  int ichar;
+  size_t ipos = 0;
+
+  while ( *buffersize )
+    {
+      ichar = *buffer;
+      (*buffersize)--;
+      buffer++;
+      if ( ichar == '\r' ) break;
+      if ( ichar == '\n' ) break;
+      line[ipos++] = ichar;
+      if ( ipos >= len )
+        {
+          fprintf(stderr, "readLineFromBuffer: end of line not found (maxlen = %ld)!\n", len);
+          break;
+        }
+    }
+  line[ipos] = 0;
+
+  if ( *buffersize == 0 && ipos == 0 ) buffer = NULL;
+
+  return (buffer);
+}
+
+static
+void pfree(void *ptr)
+{
+  if ( ptr ) free(ptr);
+}
+
+static
+char *skipSeparator(char *pline)
+{
+  while ( isspace((int) *pline) ) pline++;
+  if ( *pline == '=' || *pline == ':' ) pline++;
+  while ( isspace((int) *pline) ) pline++;
+
+  return (pline);
+}
+
+static
+char *getElementName(char *pline, char *name)
+{
+  int pos = 0, len;
+
+  while ( isspace((int) *pline) ) pline++;
+  len = strlen(pline);
+  while ( pos < len && !isspace((int) *(pline+pos)) && *(pline+pos) != '=' && *(pline+pos) != ':' ) pos++;
+
+  strncpy(name, pline, pos);
+  name[pos] = 0;
+
+  pline += pos;
+  return (pline);
+}
+
+static
+char *getElementValue(char *pline)
+{
+  int len;
+
+  while ( isspace((int) *pline) ) pline++;
+  len = strlen(pline);
+  while ( isspace((int) *(pline+len-1)) && len ) { *(pline+len-1) = 0; len--;}
+
+  return (pline);
+}
+
+static
+void kvlParseBuffer(kvl_t *kvl)
+{
+  char line[4096];
+  char name[256];
+  char *pline;
+  char *buffer = kvl->buffer;
+  size_t buffersize = kvl->buffersize;
+  int linenumber = 0;
+  char listkey1[] = "axis_entry:";
+  char listkey2[] = "variable_entry:";
+  int listtype = 0;
+  int listID = -1;
+
+  while ( (buffer = readLineFromBuffer(buffer, &buffersize, line, sizeof(line))) )
+    {
+      linenumber++;
+      pline = line;
+      while ( isspace((int) *pline) ) pline++;
+      if ( *pline == '#' || *pline == '!' || *pline == '\0' ) continue;
+      //  len = (int) strlen(pline);
+      if ( listtype == 0 && *pline == '&' )
+	{
+	  listtype = 1;
+	}
+      
+      if ( strncmp(pline, listkey1, strlen(listkey1)) == 0 )
+	{
+	  pline += strlen(listkey1);
+
+	  listtype = 2;
+
+	  listID = kvlAddList(kvl, "axis");
+
+	  pline = skipSeparator(pline);
+	  pline = getElementValue(pline);
+
+	  if ( *pline ) kvlAddListElement(kvl, listID, "name", pline);
+	}
+      else if ( strncmp(pline, listkey2, strlen(listkey2)) == 0 )
+	{
+	  pline += strlen(listkey2);
+
+	  listtype = 2;
+
+	  listID = kvlAddList(kvl, "variable");
+
+	  pline = skipSeparator(pline);
+	  pline = getElementValue(pline);
+
+	  if ( *pline ) kvlAddListElement(kvl, listID, "name", pline);
+	}
+      else
+	{
+	  pline = getElementName(pline, name);
+	  pline = skipSeparator(pline);
+	  pline = getElementValue(pline);
+
+	  if ( listID == -1 ) listID = kvlAddList(kvl, "global");
+
+	  if ( *pline ) kvlAddListElement(kvl, listID, name, pline);
+
+	    {
+	      //fprintf(stderr, "%d skip line %3d: %s\n", newlist, linenumber, pline);
+	    }
+	}
+
+      //   printf("%s\n", pline);
+    }
+}
+
+
+void *kvlParseFile(const char *filename)
+{
+  kvl_t *kvl = NULL;
+  FILE *fp;
+  char *buffer;
+  size_t filesize;
+  size_t nitems;
+
+  assert(filename != NULL);
+
+  fp = fopen(filename, "r");
+  if ( fp == NULL )
+    {
+      fprintf(stderr, "Open failed on %s: %s\n", filename, strerror(errno));
+      return (kvl);
+    }
+
+  /* file size */
+  fseek(fp, 0L, SEEK_END);
+  filesize = (size_t) ftell(fp);
+  fseek(fp, 0L, SEEK_SET);
+
+  buffer = (char *) malloc(filesize);
+  nitems = fread(buffer, 1, filesize, fp);
+
+  fclose(fp);
+
+  if ( nitems != filesize )
+    {
+      fprintf(stderr, "Read failed on %s!\n", filename);
+      return (kvl);
+    }
+ 
+  kvl = (kvl_t *) calloc(1, sizeof(kvl_t));
+  kvl->buffer = buffer;
+  kvl->buffersize = filesize;
+  kvl->filename = strdup(filename);
+
+  kvlParseBuffer(kvl);
+  
+  return ((void *) kvl);
+}
+
+
+void kvlDelete(void *kvlist)
+{
+  kvl_t *kvl = (kvl_t *) kvlist;
+
+  assert(kvl != NULL);
+
+  pfree(kvl->filename);
+  pfree(kvl->buffer);
+
+  free(kvl);
+}
+
+
+int kvlGetNumLists(void *kvlist)
+{
+  kvl_t *kvl = (kvl_t *) kvlist;
+
+  assert(kvl != NULL);
+
+  return(kvl->num_lists);
+}
+
+
+const char *kvlGetListName(void *kvlist, int listID)
+{
+  kvl_t *kvl = (kvl_t *) kvlist;
+  char *listname = NULL;
+  
+  assert(listID < kvl->num_lists);
+  
+  listname = kvl->lists[listID].name;
+
+  return (listname);
+}
+
+int kvlGetListNumElements(void *kvlist, int listID)
+{
+  kvl_t *kvl = (kvl_t *) kvlist;
+  int nelements = 0;
+
+  assert(listID < kvl->num_lists);
+
+  nelements = kvl->lists[listID].num_elements;
+
+  return (nelements);
+}
+
+
+const char *kvlGetListElementName(void *kvlist, int listID, int elemID)
+{
+  kvl_t *kvl = (kvl_t *) kvlist;
+  char *ename = NULL;
+
+  assert(listID < kvl->num_lists);
+  assert(elemID < kvl->lists[listID].num_elements);
+
+  ename = kvl->lists[listID].elements[elemID].name;
+
+  return (ename);
+}
+
+
+const char *kvlGetListElementValue(void *kvlist, int listID, int elemID)
+{
+  kvl_t *kvl = (kvl_t *) kvlist;
+  char *evalue = NULL;
+
+  assert(listID < kvl->num_lists);
+  assert(elemID < kvl->lists[listID].num_elements);
+
+  evalue = kvl->lists[listID].elements[elemID].value;
+
+  return (evalue);
+}
+
+/*
+int main(int argc, char *argv[])
+{
+  char *filename;
+  void *kvlist;
+  int nlists, listID;
+  int nelements, elemID;
+  const char *listname;
+  const char *ename;
+  const char *evalue;
+
+  if ( argc != 2 ) 
+    {
+      fprintf(stderr, "usage: kvlist filename\n");
+      return (1);
+    }
+
+  filename = argv[1];
+
+  printf("Parse file: %s\n", filename);
+
+  kvlist = kvlParseFile(filename);
+  nlists = kvlGetNumLists(kvlist);
+  printf("# Number of lists: %d\n", nlists);
+  for ( listID = 0; listID < nlists; ++listID )
+    {
+      listname = kvlGetListName(kvlist, listID);
+      nelements = kvlGetListNumElements(kvlist, listID);
+      printf("# list ID: %d;   Number of elements: %d\n", listID, nelements);
+      printf("&%s\n", listname);
+      for ( elemID = 0; elemID < nelements; ++elemID )
+	{
+	  ename  = kvlGetListElementName(kvlist, listID, elemID);
+	  evalue = kvlGetListElementValue(kvlist, listID, elemID);
+	  printf("  %s = %s\n", ename, evalue);
+	}
+      printf("/\n");
+    }
+
+  kvlDelete(kvlist);
+
+  return (0);
+}
+*/
diff --git a/src/kvlist.h b/src/kvlist.h
new file mode 100644
index 0000000..45de11f
--- /dev/null
+++ b/src/kvlist.h
@@ -0,0 +1,32 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _KVLIST_H
+#define _KVLIST_H
+
+void *kvlParseFile(const char *filename);
+
+void kvlDelete(void *kvlist);
+
+int kvlGetNumLists(void *kvlist);
+const char *kvlGetListName(void *kvlist, int listID);
+
+int kvlGetListNumElements(void *kvlist, int listID);
+const char *kvlGetListElementName(void *kvlist, int listID, int elemID);
+const char *kvlGetListElementValue(void *kvlist, int listID, int elemID);
+
+#endif  /* _KVLIST_H */
diff --git a/src/legendre.c b/src/legendre.c
new file mode 100644
index 0000000..775b5d9
--- /dev/null
+++ b/src/legendre.c
@@ -0,0 +1,457 @@
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include <stdlib.h> /* malloc zhlp3 */
+
+
+void jspleg1(double *pleg, double plat, int ktrunc, double *work)
+{
+  /*
+     jspleg1 - Routine to calculate legendre functions
+
+     Purpose
+     --------
+
+     This routine calculates the legendre functions for one latitude.
+     (but not their derivatives)
+
+
+     Interface
+     ----------
+
+     jspleg1( pleg, plat, ktrunc)
+
+
+     Input parameters
+     ----------------
+
+     plat      - Latitude in radians
+     ktrunc    - Spectral truncation
+
+
+     Output parameters
+     -----------------
+
+     pleg      - Array of legendre functions for one latitude.
+                 The array must be at least (KTRUNC+1)*(KTRUNC+4)/2 
+                 words long.
+
+     Method
+     ------
+
+     Recurrence relation with explicit relations for P(m,m) and 
+     P(m,m+1)
+
+
+     AUTHOR
+     ------
+
+     J.D.Chambers         ECMWF        9 November 1993
+
+
+     Modifications
+     -------------
+
+     None
+
+  */
+  int itout1, i1m, ilm, jm, jcn, im2;
+  double zsin, zcos, zf1m, zre1, zf2m, zn, ze1, ze2;
+  double *zhlp1, *zhlp2, *zhlp3;
+
+
+  /* Initialization */
+
+  itout1 = ktrunc+1;
+  /*  zsin   = sin(plat); */
+  zsin   = plat;
+  zcos   = sqrt(1.-zsin*zsin);
+
+  zhlp1 = work;
+  zhlp2 = work + itout1;
+  zhlp3 = work + itout1 + itout1;
+
+  /*  Step 1.        M = 0, N = 0 and N = 1 */
+
+  ilm     = 1;
+  pleg[0] = 1.0;
+  zf1m    = sqrt(3.0);
+  pleg[1] = zf1m*zsin;
+
+  /*  Step 2.       Sum for M = 0 to T (T = truncation) */
+
+  for ( jm = 1; jm < itout1; jm++ )
+    {
+      zhlp1[jm] = sqrt(2.*jm+3.);
+      zhlp2[jm] = 1./sqrt(2.*jm);
+    }
+
+  zhlp1[0] = sqrt(3.);
+
+  for ( jm = 0; jm < itout1; jm++ )
+    {
+      i1m  = jm - 1;
+      zre1 = zhlp1[jm];
+      ze1  = 1./zre1;
+
+      /*   Step 3.       M > 0 only */
+
+      if ( i1m != -1 )
+	{
+          zf2m = zf1m*zcos*zhlp2[jm];
+          zf1m = zf2m*zre1;
+
+	  /*  Step 4.       N = M and N = M+1 */
+
+          ilm       = ilm+1;
+          pleg[ilm] = zf2m;
+          ilm       = ilm+1;
+          pleg[ilm] = zf1m*zsin;
+
+	  /* When output truncation is reached, return to calling program */
+
+          if ( jm == (itout1-1) ) break;
+	}
+
+      /*  Step 5.       Sum for N = M+2 to T+1 */
+
+      im2 = i1m+2;
+
+      for ( jcn = im2; jcn < itout1; jcn++ )
+	{
+          zn         = jcn + 1;
+	  zhlp3[jcn] = sqrt((4.*zn*zn-1.)/(zn*zn-jm*jm));
+	}
+
+      for ( jcn = im2; jcn < itout1; jcn++ )
+	{
+          ze2        = zhlp3[jcn];
+          ilm        = ilm+1;
+          pleg[ilm]  = ze2*(zsin*pleg[ilm-1]-ze1*pleg[ilm-2]);
+          ze1        = 1./ze2;
+	}
+    }
+}
+
+
+/* ============================================= */
+/* phcs - Compute values of Legendre polynomials */
+/*        and their meridional derivatives       */
+/* ============================================= */
+
+void phcs(double *pnm, double *hnm, int waves, double pmu,
+	  double *ztemp1, double *ztemp2)
+{
+  int twowaves;
+
+  int jk, jn, jm;
+
+  double jnmjk;
+  double zcos2;
+  double lat;
+  double zan;
+  double zsinpar;
+  double zcospar;
+  double zsqp;
+  double zcosfak;
+  double zsinfak;
+  double zq;
+  double zwm2;
+  double zw;
+  double zwq;
+  double zq2m1;
+  double zwm2q2;
+  double z2q2;
+  double zcnm;
+  double zdnm;
+  double zenm;
+
+  twowaves  = waves << 1;
+
+  zcos2     = sqrt(1.0 - pmu*pmu);
+  lat       = acos(pmu);
+  zan       = 1.0;
+
+  ztemp1[0] = 0.5;
+
+  for ( jn = 1; jn < twowaves; jn++ )
+    {
+      zsqp    = 1.0 / sqrt((double)(jn + jn*jn));
+      zan    *= sqrt(1.0 - 1.0/(4*jn*jn));
+
+      zcospar = cos(lat * jn);
+      zsinpar = sin(lat * jn) * jn * zsqp;
+      zcosfak = 1.0;
+
+      for ( jk = 2; jk < jn; jk += 2 )
+	{
+	  jnmjk = jn - jk;
+	  zcosfak *= (jk-1.0) * (jn+jnmjk+2.0) / (jk * (jn+jnmjk+1.0));
+	  zsinfak  = zcosfak * (jnmjk) * zsqp;
+	  zcospar += zcosfak * cos(lat * jnmjk);
+	  zsinpar += zsinfak * sin(lat * jnmjk);
+	}
+
+      /*  code for jk == jn */
+
+      if ((jn & 1) == 0)
+	{
+	  zcosfak *= (double)((jn-1) * (jn+2)) / (double)(jn * (jn+1));
+	  zcospar += zcosfak * 0.5;
+	}
+      ztemp1[jn  ] = zan * zcospar;
+      ztemp2[jn-1] = zan * zsinpar;
+    }
+
+  memcpy(pnm, ztemp1, waves*sizeof(double));
+  pnm += waves;
+  memcpy(pnm, ztemp2, waves*sizeof(double));
+  pnm += waves;
+
+  hnm[0] = 0.0;
+  for (jn = 1; jn < waves; jn++)
+    hnm[jn] = jn * (pmu * ztemp1[jn] - sqrt((jn+jn+1.0) / (jn+jn-1.0)) * ztemp1[jn-1]);
+
+  hnm += waves;
+
+  hnm[0] = pmu * ztemp2[0];
+
+  for (jn = 1; jn < waves; jn++)
+    hnm[jn] = (jn+1) * pmu * ztemp2[jn]
+            - sqrt(((jn+jn+3.0)*((jn+1)*(jn+1)-1.0)) / (jn+jn+1.0)) * ztemp2[jn-1];
+	    
+  hnm += waves;
+
+  for (jm = 2; jm < waves; jm++)
+    {
+      pnm[0] = sqrt(1.0 + 1.0 / (jm+jm)) * zcos2 * ztemp2[0];
+      hnm[0] = jm * pmu * pnm[0];
+#if defined (CRAY)
+#pragma _CRI novector
+#endif
+#if defined (__uxp__)
+#pragma loop scalar
+#endif
+      for (jn = 1; jn < twowaves-jm; jn++)
+	{
+          zq      = jm + jm + jn - 1;
+          zwm2    = zq + jn;
+          zw      = zwm2 + 2;
+          zwq     = zw*zq;
+          zq2m1   = zq*zq - 1.;
+          zwm2q2  = zwm2*zq2m1;
+          z2q2    = zq2m1*2;
+          zcnm    = sqrt((zwq*(zq-2.))/(zwm2q2-z2q2));
+          zdnm    = sqrt((zwq*(jn+1.))/zwm2q2);
+          zenm    = sqrt(zw * jn /((zq+1.0) * zwm2));
+          pnm[jn] = zcnm * ztemp1[jn] - pmu
+                  * (zdnm * ztemp1[jn+1] - zenm * pnm[jn-1]);
+          hnm[jn] = (jm + jn) * pmu * pnm[jn]
+                  - sqrt(zw * jn * (zq+1) / zwm2) * pnm[jn-1];
+	}
+      memcpy(ztemp1, ztemp2, twowaves*sizeof(double));
+      memcpy(ztemp2, pnm   , twowaves*sizeof(double));
+      pnm += waves;
+      hnm += waves;
+    }
+}
+
+
+/* to slow for nec, 2.0 instead of 2.3 GFlops ( vector length too small ) */
+void sp2fctest(double *sa, double *fa, double *poli, int nlev, int nlat, int nfc, int nt)
+{
+  int lev, jm, jn, latn, lats, nsp2, is;
+  double sar, sai;
+  double *far, *fai, *pol;
+  double *sal, *fal;
+  double pval;
+
+  nsp2 = (nt+1)*(nt+2);
+
+  for ( lev = 0; lev < nlev; lev++ )
+    {
+      pol = poli;
+      fal = fa + lev*nfc*nlat;
+      sal = sa + lev*nsp2;
+      memset(fal, 0, nfc*nlat*sizeof(double));
+
+      for ( jm = 0; jm <= nt; jm++ )
+	{
+	  for ( jn = 0; jn <= nt - jm; jn++ )
+	    {
+	      is = (jn+1)%2 * 2 - 1;
+	      sar = *sal++;
+	      sai = *sal++;
+	      far = fal;
+	      fai = fal + nlat;
+#if defined (SX)
+#pragma vdir nodep
+#endif
+	      for ( latn = 0; latn < nlat/2; latn++ )
+		{
+		  lats = nlat - latn - 1;
+		  pval = pol[latn];
+		  far[latn] += pval * sar;
+		  fai[latn] += pval * sai;
+		  far[lats] += pval * sar * is;
+		  fai[lats] += pval * sai * is;
+		}
+	      pol += nlat;
+	    }
+	  fal += 2 * nlat;
+	}
+    }
+}
+
+
+void sp2fc(const double *sa, double *fa, const double *poli, long nlev, long nlat, long nfc, long nt)
+{
+  long lev, jmm, jfc, lat, nsp2;
+  double sar, sai;
+  double *fal;
+  double * restrict far, * restrict fai;
+  const double * restrict pol;
+  const double * restrict sal;
+
+  nsp2 = (nt+1)*(nt+2);
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(jmm, jfc, lat, pol, sar, sai, sal, far, fai, fal)
+#endif
+  for ( lev = 0; lev < nlev; lev++ )
+    {
+      pol = poli;
+      fal = fa + lev*nfc*nlat;
+      sal = sa + lev*nsp2;
+      memset(fal, 0, nfc*nlat*sizeof(double));
+
+      for ( jmm = 0; jmm <= nt; jmm++ )
+	{
+	  for ( jfc = jmm; jfc <= nt; jfc++ )
+	    {
+	      sar = *sal++;
+	      sai = *sal++;
+	      far = fal;
+	      fai = fal + nlat;
+	      for ( lat = 0; lat < nlat; lat++ )
+		{
+		  far[lat] += pol[lat] * sar;
+		  fai[lat] += pol[lat] * sai;
+		}
+	      pol += nlat;
+	    }
+	  fal += 2 * nlat;
+	}
+    }
+}
+
+
+void fc2sp(double *fa, double *sa, double *poli, int nlev, int nlat, int nfc, int nt)
+{
+  int lev, jmm, jfc, lat, nsp2;
+  double sar, sai, *far, *fai, *pol;
+  double *sal, *fal;
+
+  nsp2 = (nt+1)*(nt+2);
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(jmm, jfc, lat, pol, sar, sai, sal, far, fai, fal)
+#endif
+  for ( lev = 0; lev < nlev; lev++ )
+    {
+      pol = poli;
+      fal = fa + lev*nfc*nlat;
+      sal = sa + lev*nsp2;
+      for ( jmm = 0; jmm <= nt; jmm++ )
+	{
+	  for ( jfc = jmm; jfc <= nt; jfc++ )
+	    {
+	      far = fal;
+	      fai = fal + nlat;
+	      sar = 0.0;
+	      sai = 0.0;
+	      for ( lat = 0; lat < nlat; lat++ )
+		{
+		  sar += pol[lat] * far[lat];
+		  sai += pol[lat] * fai[lat];
+		}
+	      *sal++ = sar;
+	      *sal++ = sai;
+	      pol += nlat;
+	    }
+	  fal += 2 * nlat;
+	}
+    }
+}
+
+/* ======================================== */
+/* Convert Spectral Array to new truncation */
+/* ======================================== */
+
+void sp2sp(double *arrayIn, int truncIn, double *arrayOut, int truncOut)
+{
+  int n, m;
+
+  if ( truncOut <= truncIn )
+    {
+      for ( n = 0; n <= truncOut; n++ )
+	{
+	  for ( m = n; m <= truncOut; m++ )
+	    {
+	      *arrayOut++ = *arrayIn++ ;
+	      *arrayOut++ = *arrayIn++ ;
+	    }
+	  arrayIn += 2 * (truncIn-truncOut);
+	}
+    }
+  else
+    {
+      for ( n = 0; n <= truncIn; n++ )
+	{
+	  for ( m = n; m <= truncIn; m++ )
+	    {
+	      *arrayOut++ = *arrayIn++ ;
+	      *arrayOut++ = *arrayIn++ ;
+	    }
+	  for ( m = truncIn+1; m <= truncOut; ++m )
+	    {
+	      *arrayOut++ = 0.0;
+	      *arrayOut++ = 0.0;
+	    }
+	}
+      for ( n = truncIn+1; n <= truncOut; ++n )
+	for ( m = n; m <= truncOut; ++m )
+	  {
+	    *arrayOut++ = 0.0;
+	    *arrayOut++ = 0.0;
+	  }
+    }
+}
+
+/* ======================================== */
+/* Cut spectral wave numbers                */
+/* ======================================== */
+
+void spcut(double *arrayIn, double *arrayOut, int trunc, int *waves)
+{
+  int n, m;
+
+  for ( n = 0; n <= trunc; n++ )
+    {
+      for ( m = n; m <= trunc; m++ )
+	{
+	  if ( waves[m] )
+	    {
+	      *arrayOut++ = *arrayIn++;
+	      *arrayOut++ = *arrayIn++;
+	    }
+	  else
+	    {
+	      *arrayOut++ = 0.0;
+	      *arrayOut++ = 0.0;
+	      arrayIn++;
+	      arrayIn++;
+	    }
+	}
+    }
+}
diff --git a/src/list.c b/src/list.c
new file mode 100644
index 0000000..3cc8f57
--- /dev/null
+++ b/src/list.c
@@ -0,0 +1,238 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>
+#include <float.h>
+#include "dmemory.h"
+#include "list.h"
+
+
+#define  DEFAULT_ALLINC  1024
+
+
+static void listInit(LIST *list, int type)
+{
+  list->array  = NULL;
+  list->nalloc = 0;
+  list->allinc = DEFAULT_ALLINC;
+  list->type   = type;
+}
+
+
+LIST *listNew(int type)
+{
+  LIST *list = NULL;
+
+  if ( type != INT_LIST && type != FLT_LIST )
+    {
+      fprintf(stderr, "%s: type %d unsupported!\n", __func__, type);
+    }
+  else
+    {
+      list = (LIST *) malloc(sizeof(LIST));
+      listInit(list, type);
+    }
+
+  return (list);
+}
+
+
+void listDelete(LIST *list)
+{
+  if ( list )
+    {
+      if ( list->array ) free(list->array);
+      free(list);
+    }
+}
+
+
+void *listArrayPtr(LIST *list)
+{
+  return (list->array);
+}
+
+
+static void listCheck(LIST *list, int num)
+{
+  while ( list->nalloc < (num+1) )
+    {
+      list->nalloc += list->allinc;
+      if ( list->type == INT_LIST )
+	list->array = (int *) realloc(list->array, list->nalloc*sizeof(int));
+      else
+	list->array = (double *) realloc(list->array, list->nalloc*sizeof(double));
+    }
+}
+
+
+void listSetInt(LIST *list, int num, int ival)
+{
+  listCheck(list, num);
+
+  ((int *) list->array)[num] = ival;
+}
+
+
+void listSetFlt(LIST *list, int num, double fval)
+{
+  listCheck(list, num);
+
+  ((double *) list->array)[num] = fval;
+}
+
+
+int listGetInt(LIST *list, int num)
+{
+  int ival;
+
+  ival = ((int *) list->array)[num];
+
+  return (ival);
+}
+
+
+double listGetFlt(LIST *list, int num)
+{
+  double fval;
+
+  fval = ((double *) list->array)[num];
+
+  return (fval);
+}
+
+
+static
+void split_intstring(const char *intstr, int *first, int *last, int *inc)
+{
+  int i, start;
+  int istrlen;
+
+  istrlen = strlen(intstr);
+  *first = atoi(intstr);
+  *last  = *first;
+  *inc   = 1;
+
+  start = 1;
+  for ( i = start; i < istrlen; i++ )
+    {
+      if ( ! isdigit(intstr[i]) )
+	{
+	  if ( intstr[i] == '/' )
+	    *last = atoi(intstr+i+1);
+	  else
+	    fprintf(stderr, "Syntax error in >%.*s<! Character %c not allowed.\n",
+		    istrlen, intstr, intstr[i]);
+	  break;
+	}
+    }
+
+  if ( i < istrlen )
+    {
+      start = i+1;
+      for ( i = start; i < istrlen; i++ )
+	{
+	  if ( ! isdigit(intstr[i]) )
+	    {
+	      if ( intstr[i] == '/' )
+		*inc = atoi(intstr+i+1);
+	      else
+		fprintf(stderr, "Syntax error in >%.*s<! Character %c not allowed.\n",
+			istrlen, intstr, intstr[i]);
+	      break;
+	    }
+	}
+    }
+}
+
+
+int args2intlist(int argc, char **argv, LIST *list)
+{
+  int nint = 0;
+  int ival;
+  int first, last, inc;
+  int iarg;
+
+  for ( iarg = 0; iarg < argc; iarg++ )
+    {
+      split_intstring(argv[iarg], &first, &last, &inc);
+
+      if ( inc >= 0 )
+	{
+	  for ( ival = first; ival <= last; ival += inc )
+	    listSetInt(list, nint++, ival);
+	}
+      else
+	{
+	  for ( ival = first; ival >= last; ival += inc )
+	    listSetInt(list, nint++, ival);
+	}
+    }
+
+  return (nint);
+}
+
+
+int args2fltlist(int argc, char **argv, LIST *list)
+{
+  int i, nint = 0;
+  int ival;
+  int first, last, inc;
+  int iarg;
+  int len;
+  double tmp_val;
+
+  for ( iarg = 0; iarg < argc; iarg++ )
+    {
+      len = (int) strlen(argv[iarg]);
+      for ( i = 0; i < len; i++ )
+	if ( argv[iarg][i] != '/' && argv[iarg][i] != '-' && ! isdigit(argv[iarg][i]) ) break;
+      
+      if ( i != len )
+	{
+	  /*
+	  if      ( strcmp(argv[iarg],  "inf") == 0 )
+	    tmp_val =  DBL_MAX;
+	  else if ( strcmp(argv[iarg], "-inf") == 0 )
+	    tmp_val = -DBL_MAX;
+	  else  
+	  */                                    
+	    tmp_val = atof(argv[iarg]);
+
+	  listSetFlt(list, nint++, tmp_val);
+	}
+      else
+	{
+	  split_intstring(argv[iarg], &first, &last, &inc);
+
+	  if ( inc >= 0 )
+	    {
+	      for ( ival = first; ival <= last; ival += inc )
+		listSetFlt(list, nint++, (double) ival);
+	    }
+	  else
+	    {
+	      for ( ival = first; ival >= last; ival += inc )
+		listSetFlt(list, nint++, (double) ival);
+	    }
+	}
+    }
+
+  return (nint);
+}
diff --git a/src/list.h b/src/list.h
new file mode 100644
index 0000000..f20c9be
--- /dev/null
+++ b/src/list.h
@@ -0,0 +1,44 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _LIST_H
+#define _LIST_H
+
+#define  INT_LIST  1
+#define  FLT_LIST  2
+
+
+typedef struct {
+  void *array;
+  int nalloc;
+  int allinc;
+  int type;
+}
+LIST;
+
+
+LIST *listNew(int type);
+void listDelete(LIST *list);
+void *listArrayPtr(LIST *list);
+void listSetInt(LIST *list, int num, int ival);
+void listSetFlt(LIST *list, int num, double fval);
+int listGetInt(LIST *list, int num);
+double listGetFlt(LIST *list, int num);
+int args2intlist(int argc, char **argv, LIST *list);
+int args2fltlist(int argc, char **argv, LIST *list);
+
+#endif  /* _LIST_H */
diff --git a/src/magics_template_parser.c b/src/magics_template_parser.c
new file mode 100644
index 0000000..6ad4af6
--- /dev/null
+++ b/src/magics_template_parser.c
@@ -0,0 +1,241 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h" /* HAVE_LIBMAGICS */
+#endif
+
+#include "magics_template_parser.h"
+#include "StringUtilities.h"
+
+#include "magics_api.h"
+
+#define DBG 0 
+
+
+extern xmlNode *magics_node;
+
+
+/* Recursive function that sets the Magics parameters from the XML structure */
+
+int magics_template_parser( xmlNode *a_node ) 
+
+{
+    int param_set_flag;
+    xmlNode *cur_node = NULL;
+    xmlChar    *param_name,*param_type,*param_value,*value;
+
+    if( a_node == NULL )
+        return 0;
+
+#if 0
+    fprintf( stdout,"Parsing the magics Node \n");
+#endif
+
+    if( !strcmp( a_node->name, "magics" ) )
+    {
+ 	value = xmlGetProp( a_node, "version" );
+
+        if( value )
+        {
+	    	if( DBG )
+			printf( "Version %s \n", value ); 
+
+		if( atof( value ) > 3.0f ) 
+		{
+			return 1;
+		}
+        }
+
+    }
+
+
+    for ( cur_node = a_node->children; cur_node; cur_node = cur_node->next )
+    {
+	param_name = NULL;
+	param_type = NULL;
+	param_value = NULL;
+
+        if ( cur_node->type == XML_ELEMENT_NODE )
+        {
+		
+	    if( DBG )
+            	printf( "Node Name: %s \n", cur_node->name );
+
+#if 0
+            fprintf( stdout,"Node Name: %s \n", cur_node->name );
+#endif
+
+	    if( cur_node->properties == NULL )
+	    {
+		if( cur_node->children == NULL )
+		{
+			printf( "NO ATTRIBUTES!!!\n" );
+		}
+	    }
+	    else
+	    {
+		
+		param_name = xmlGetProp( cur_node,"parameter");
+		param_type = xmlGetProp(cur_node,"type");
+		param_value = xmlGetProp(cur_node,"value");
+#if 0
+    		printf( "\t\tAttr name: %s Type: %s Value: %s \n", param_name,param_type,param_value);
+#endif
+		
+    		param_set_flag = SetMagicsParameterValue( param_name, param_type, param_value );
+		
+		if( param_set_flag )
+			printf(" Error in Setting the Parameter %s\n",param_name );
+	    }
+        }
+    }
+    return 0;
+}
+
+int SetMagicsParameterValue( char *param_name, char *param_type, char *param_value )
+
+{
+	int i, ret_flag = 0;
+	int split_str_count = 0;
+	char **split_str = NULL;
+	char *sep_char = ",";
+	char *search_char = ";";
+	double *float_param_list = NULL;
+	int *int_param_list = NULL;
+
+	if( param_name == NULL )
+	  {
+		ret_flag = 1;
+		return ret_flag;
+	  }
+
+	if( param_value == NULL )
+		ret_flag = 2;
+
+
+	
+   	/*   MAGICS++ ENV RELATED PARAMETERS   */
+	if( !strcmp( param_type,"environvar" ) )
+	  {
+		if( !strcmp( param_name,"quiet_option" ) )
+		  {
+			if( !strcmp( param_value, "off" ) || !strcmp( param_value, "OFF" ) )
+			  {
+#if 0
+				printf( "Quiet Option %s \n", param_value ); 
+#endif
+				if( !unsetenv( "MAGPLUS_QUIET" ) )
+				  {
+				      if( DBG )
+					  fprintf( stderr, "Quiet Option %s is un-set successfully!!! \n", param_value ); 
+				  }
+				else
+					fprintf( stderr, "Quiet Option %s COULDN'T be UNSET!!!\n", param_value ); 
+			  }
+
+			if( !strcmp( param_value, "on" ) || !strcmp( param_value, "ON" ) )
+			  {
+#if 0
+				printf( "Quiet Option %s \n", param_value ); 
+#endif
+				if( !setenv( "MAGPLUS_QUIET","1",1 ) )
+				  {
+					if( DBG )
+					  fprintf( stderr, "Quiet Option %s is set successfully!!! \n", param_value ); 
+				  }
+				else
+					fprintf( stderr, "Quiet Option %s COULDN'T be SET!!!\n", param_value ); 
+			  }
+		  }
+	  }
+
+    	/*   MAGICS++ FLOAT TYPE PARAMETERS   */
+	else if( !strcmp( param_type,"float" ) )
+	  {
+		mag_setr( param_name, atof( param_value ) );		
+	  }
+
+    	/*   MAGICS++ FLOAT ARRAY  TYPE    PARAMETERS   */
+	else if( !strcmp( param_type,"floatarray" ) )
+	  {
+
+#if 0
+	        fprintf(stderr, "param_name : %s\tparam_value: %s\n", param_name, param_value);
+#endif
+		if( strchr( param_value,';') )
+		    sep_char = ";";
+		split_str_count = StringSplitWithSeperator( param_value, sep_char, &split_str );
+		if( split_str_count )
+		  {
+			float_param_list = ( double *) malloc ( sizeof( double ) * split_str_count );
+			for( i = 0; i < split_str_count; i++ )
+			  {
+#if 0
+			        fprintf(stderr, "%d %d %s\n", i, split_str_count, split_str[i]);
+#endif
+				float_param_list[i] = atof( split_str[i] );			
+			  }
+			mag_set1r( param_name, float_param_list, split_str_count );		
+			free( float_param_list );
+			free( split_str );
+		  }
+
+	  }
+
+    	/*   MAGICS++ INT TYPE    PARAMETERS   */
+	else if( !strcmp( param_type,"int" ) )
+	  {
+		mag_seti( param_name, atoi( param_value ) );		
+	  }
+
+    	/*   MAGICS++ INT ARRAY  TYPE    PARAMETERS   */
+	else if( !strcmp( param_type,"intarray" ) )
+	  {
+	        if( strchr( param_value,';') )
+		    sep_char = ";";
+		split_str_count = StringSplitWithSeperator( param_value, sep_char, &split_str );
+		if( split_str_count )
+		  {
+			int_param_list = ( int *) malloc ( sizeof( int ) * split_str_count );
+			for( i = 0; i < split_str_count; i++ )
+			{
+				int_param_list[i] = atoi( split_str[i] );			
+			}
+			mag_set1i( param_name, int_param_list, split_str_count );		
+			free( int_param_list );
+			free( split_str );
+		  }
+	  }
+
+    	/*   MAGICS++ STRING TYPE    PARAMETERS   */
+	else if( !strcmp( param_type,"string" ) )
+	  {
+		mag_setc( param_name, param_value );		
+	  }
+
+    	/*   MAGICS++ STRINGARRAY  TYPE    PARAMETERS   */
+	else if( !strcmp( param_type,"stringarray" ) )
+	  {
+		if( DBG )
+		  fprintf(stderr, "Input strarr is %s  Sep char is %s Search char is %s\n",param_value , sep_char, search_char );
+		if( strstr( param_value,";") )
+		{
+		  sep_char = ";";
+		}
+		
+		if( DBG )
+		  fprintf( stderr, "Input strarr is %s  Sep char is %s\n",param_value , sep_char );
+		split_str_count = StringSplitWithSeperator( param_value, sep_char, &split_str );
+		
+		if( DBG )
+		  fprintf( stderr, "Input strarr is %s split str count is %d Sep char is %s\n",param_value, split_str_count, sep_char );
+		
+		mag_set1c( param_name, (const char**)split_str, split_str_count );		
+		free( split_str );
+	  }
+	else 
+	  {
+		ret_flag = 3;
+		fprintf(stderr, "Unknown Parameter Type\n" );
+	  }
+
+	return ret_flag;
+}
diff --git a/src/magics_template_parser.h b/src/magics_template_parser.h
new file mode 100644
index 0000000..01192b2
--- /dev/null
+++ b/src/magics_template_parser.h
@@ -0,0 +1,15 @@
+#ifndef MAGICS_TEMPLATE_PARSER_HH
+#define MAGICS_TEMPLATE_PARSER_HH
+#endif
+
+#include<stdio.h>
+#include<string.h>
+#include<stdlib.h>
+#include<locale.h>
+
+#include<libxml/parser.h>
+#include<libxml/tree.h>
+
+int magics_template_parser( xmlNode * a_node );
+
+int SetMagicsParameterValue( char *param_name, char *param_type, char *param_value );
diff --git a/src/mask.h b/src/mask.h
new file mode 100644
index 0000000..5c1b968
--- /dev/null
+++ b/src/mask.h
@@ -0,0 +1,8101 @@
+/* cdo outputf,"%2g",32 -int -selcode,172 -seltimestep,3 r720x360testfile.nc > mask */
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,
+0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,
+1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,1,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,
+0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,
+0,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,0,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,0,0,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,1,1,1,1,0,0,0,0,
+0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,0,
+1,1,1,0,1,1,0,0,1,1,0,0,0,1,1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,
+0,0,0,0,0,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,0,0,0,
+0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,0,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,
+0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,
+0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
+0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,0,1,1,1,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,1,
+0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,
+0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,
+0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,
+0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,
+0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,
+0,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,
+0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,0,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,0,0,
+0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,0,0,0,0,
+0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,
+1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,0,0,0,1,0,0,1,1,1,1,1,1,0,1,1,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,
+1,1,1,1,1,1,1,1,0,0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,
+1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,
+1,1,1,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,0,1,1,1,1,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,
+1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,1,0,0,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,
+1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,1,1,1,1,1,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,0,1,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,
+1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,
+0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,
+0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,
+1,1,1,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,1,
+1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,1,1,0,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,1,1,0,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,1,
+1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,1,1,1,0,0,0,0,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,
+1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,
+1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,1,1,0,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,1,1,1,1,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,
+1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,1,
+1,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,0,0,
+0,0,1,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,
+1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,1,
+1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,0,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,0,0,1,1,1,
+1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,0,0,
+0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,1,1,1,
+1,1,1,0,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+0,0,1,1,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,0,0,0,0,
+0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,0,0,1,1,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,0,0,0,0,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,1,1,1,0,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,0,1,0,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,1,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,0,0,0,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,1,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,0,0,0,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,1,1,1,
+1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,1,0,
+0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,0,1,1,1,0,0,0,1,1,0,0,0,
+1,1,1,1,1,1,0,0,0,0,0,1,1,0,0,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,
+1,0,0,0,0,1,1,1,1,1,1,0,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,1,1,1,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,
+0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,0,1,1,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,0,0,0,
+0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,1,
+1,1,1,1,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,
+0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,
+1,1,0,1,1,0,0,0,0,0,1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,1,1,1,0,1,1,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,1,1,1,0,1,1,0,1,
+1,1,1,1,1,0,0,0,0,0,1,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,
+0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,0,1,0,0,0,0,0,1,1,1,1,1,1,0,0,
+1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,1,1,
+1,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,1,1,1,1,1,0,1,
+1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,
+0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,1,0,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,
+1,1,1,1,1,1,1,0,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,
+0,0,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,0,1,1,0,0,1,1,1,1,1,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,0,0,0,0,0,0,0,
+0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,1,1,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,
+1,1,0,0,0,0,0,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,0,0,
+0,0,0,0,0,0,0,0,1,1,1,1,0,0,0,1,1,1,1,1,0,0,1,1,1,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,1,1,1,1,1,1,1,1,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,0,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,0,0,0,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,
+1,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,0,0,1,1,
+0,0,1,1,1,1,1,1,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,
+1,1,1,1,1,1,1,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,1,1,1,1,
+1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
diff --git a/src/merge_sort2.c b/src/merge_sort2.c
new file mode 100644
index 0000000..38d3a8e
--- /dev/null
+++ b/src/merge_sort2.c
@@ -0,0 +1,354 @@
+#include "merge_sort2.h"
+
+static
+void merge_lists(int *nl, const double *restrict l1, const double *restrict l2, long *idx)
+{      
+  /*
+    This routine writes to idx a list of indices relative to *l11 and *l12
+    --> l1, and l2 need to be allocated in 
+        a signle block of memory
+    The order is thus, that (I) l1[idx[i]]<=l1[idx[i+1]]	
+		       where 0 <= i < nl
+  */    		       
+
+  const int n1=nl[0], n2=nl[1];
+  int i1=0, i2=0, i=0, ii=0;
+
+  while ( i2 < n2 && i1 < n1 ) 
+    {
+      if ( l1[i1] < l2[i2] )
+	{ idx[i] = i1;    i1++; i++; }
+      else
+	{ idx[i] = n1+i2; i2++; i++; }
+    }
+
+  for ( ii=i1; i1 < n1; ii++ ) {idx[i] = i1;    i++; i1++; }
+  for ( ii=i2; i2 < n2; ii++ ) {idx[i] = n1+i2; i++; i2++; }
+
+  return;
+}
+
+static
+void sort_par(long num_links, double *restrict add1, int parent, int par_depth)
+{
+  /*
+    This routine is the core of merge-sort. It does the following
+     + split the address-arrays into two segments, 
+     + sort each array seperately (this can be done in parallel as there
+       is no data dependency)
+       - the routine sort_iter, which is called for sorting the sub-arrays
+         EITHER calls this routine again, which means, that the sub-arrays
+	 are further split 
+	 OR     it calls sort_add, which actually sorts the sublist sequentially
+     + merge the sorted arrays together
+     For the merge step additional memory is needed as it cannot work in place. 
+     Therefor, the merge sort algorith in this implementation uses at maximum 
+     twice as much memory as the sequential sort_add.
+
+     Parameters:
+     -----------
+       long num_links    | length of arrays add1 and add2 (MUST be of same length
+       int *add1         | arrays with addresses, that are used as sorting criteria (ascending)
+       int parent        | the parent of this sort_par. This parameter is used to find 
+                           the recursion depth and determine the actual position of the
+			   sub-array within the original array 
+  */
+#define NSPLIT 2
+  int nsplit = NSPLIT;                      /* (only 2 allowed) number of segments to split 
+						the data */
+  int nl[NSPLIT];                            /* number of links in each sub-array              */
+  int who_am_i,depth,my_depth;               /* current depth, depth of children and index
+						to be parent in next call to sort_par          */
+  int add_srt[NSPLIT], add_end[NSPLIT];      /* arrays for start and end index of sub array    */
+  double *add1s[NSPLIT];                     /* pointers to sub arrays for sort and merge step */
+  double *tmp;                               /* pointer to buffer for merging of address lists */
+  long *idx;                                 /* index list to merge sub-arrays                 */
+  long i;   
+
+  if ( nsplit != 2 )
+    {
+      cdoAbort("Error: splitting into more than two subsegments not allowed\n"
+	     "       in this implementation of merge sort\n");
+    }
+
+  idx = (long *) malloc(num_links*sizeof(long));
+
+  /* SPLIT AND SORT THE DATA FRAGMENTS */
+  add_srt[0] = 0;                  add_srt[1] = num_links/nsplit;
+  add1s[0]   = &add1[add_srt[0]];  add1s[1]   = &add1[add_srt[1]];
+  nl[0]      = num_links/nsplit;   nl[1]      = num_links-nl[0];
+  add_end[0] = nl[0];              add_end[1] = num_links;
+
+  depth = (int) (log(parent)/log(2));
+
+#if defined (_OPENMP)
+  /* Allow for nested parallelism */
+  if ( omp_in_parallel() && depth<par_depth ) 
+    {
+      omp_set_nested(1);            
+      if ( omp_get_nested() == 0 )
+	cdoWarning("openMP implementation seems to not support nested parallelism.\n"
+	       "Maximum of CPUs used is 2 instead of %i.\n", omp_get_num_threads());
+    }                                    
+#endif
+
+#if defined (_OPENMP)
+#pragma omp parallel for if(depth<par_depth) \
+  private(i,who_am_i,my_depth) \
+  num_threads(2)
+#endif
+  for ( i=0; i < nsplit; i++ )
+    {
+      who_am_i = nsplit*parent+i;
+      my_depth = (int) (log(parent)/log(2))+1;
+
+#if defined (_OPENMP)
+      /*      if ( 0 )
+      	cdoPrint("I am %i (parent %i), my_depth is: %i thread_num %i (%i) \n",
+	who_am_i,parent,my_depth,omp_get_thread_num()+1,omp_get_num_threads());
+      */
+#endif
+            
+      sort_iter_single(nl[i], add1s[i], who_am_i);
+
+    }
+
+  /* ********************************* */
+  /*              TO DO                */
+  /* THIS BIT NEEDS TO BE PARALLELIZED */
+  /* ********************************* */
+  /* Idea I: one CPU merges top-down, the other one bottom-up */
+  /*         ideally they should meet in the middle :)        */
+  {
+    //    uint64_t end,start;
+    //    start = mach_absolute_time();                         /* ********************** */
+    merge_lists(nl,add1s[0],add1s[1], idx);                     /* MERGE THE SEGMENTS     */
+    //    end = mach_absolute_time();                           /* ********************** */
+    //    merge_time += end-start;
+  }
+
+  tmp = malloc(num_links*sizeof(double));
+
+#if defined (_OPENMP)
+#pragma omp parallel for if ( depth < par_depth /* && num_links > 4096*/ ) \
+    private(i) num_threads(2) schedule(static,1024)
+#endif
+  for ( i=0; i < num_links; i++ )
+    tmp[i] = add1[idx[i]];
+  
+  memcpy(add1,tmp,num_links*sizeof(double));
+  
+  free(tmp);
+  free(idx);
+
+  tmp=NULL;
+
+  return;
+}
+
+static
+void sort_add(long num_links, double *restrict add1)
+{
+  /*
+    This routine sorts address and weight arrays based on the
+    destination address with the source address as a secondary
+    sorting criterion. The method is a standard heap sort.
+
+    Input and Output arrays:
+    
+       long num_links; ! num of links for this mapping
+       double *add1    ! destination address array [num_links]
+  */
+
+  /* Local variables */
+
+  double add1_tmp;         /* temp for addresses during swap     */
+  long lvl, final_lvl;     /* level indexes for heap sort levels */
+  long chk_lvl1, chk_lvl2, max_lvl;
+  long i;
+
+  if ( num_links <= 1 ) return;
+
+  /*
+    start at the lowest level (N/2) of the tree and shift lower 
+    values to the bottom of the tree, promoting the larger numbers
+  */
+  for ( lvl = num_links/2-1; lvl >= 0; lvl-- )
+    {
+      final_lvl = lvl;
+      add1_tmp = add1[lvl];
+
+      /* Loop until proper level is found for this link, or reach bottom */
+
+      for ( i = 0; i < num_links; i++ ) /* while ( TRUE ) */
+	{
+	  /* Find the largest of the two daughters */
+
+          chk_lvl1 = 2*final_lvl+1;
+          chk_lvl2 = 2*final_lvl+2;
+          if ( chk_lvl1 == num_links-1 ) chk_lvl2 = chk_lvl1;
+
+          if (add1[chk_lvl1] >  add1[chk_lvl2])
+            max_lvl = chk_lvl1;
+          else 
+            max_lvl = chk_lvl2;
+
+          /*
+	    If the parent is greater than both daughters,
+	    the correct level has been found
+	  */
+          if (add1_tmp >  add1[max_lvl])
+	    {
+	      add1[final_lvl] = add1_tmp;
+	      break;
+	    }
+	  else
+	    {
+	      /*
+		Otherwise, promote the largest daughter and push
+		down one level in the tree.  If haven"t reached
+		the end of the tree, repeat the process.  Otherwise
+		store last values and exit the loop
+	      */
+	      add1[final_lvl] = add1[max_lvl];
+	      final_lvl = max_lvl;
+	      if ( 2*final_lvl+1 >= num_links )
+		{
+		  add1[final_lvl] = add1_tmp;
+		  break;
+		}
+	    }
+	}
+
+      if ( i == num_links ) {
+	cdoAbort("Internal problem; link 1 not found!\n");
+	exit(1);
+      }
+    }
+
+  /*
+    Now that the heap has been sorted, strip off the top (largest)
+    value and promote the values below
+  */
+
+  for ( lvl = num_links-1; lvl >= 2; lvl-- )
+    {
+      /* Move the top value and insert it into the correct place */
+
+      add1_tmp = add1[lvl];
+      add1[lvl] = add1[0];
+
+      /* As above this loop sifts the tmp values down until proper level is reached */
+
+      final_lvl = 0;
+
+      for ( i = 0; i < num_links; i++ ) /* while ( TRUE ) */
+	{
+	  /* Find the largest of the two daughters */
+
+          chk_lvl1 = 2*final_lvl+1;
+          chk_lvl2 = 2*final_lvl+2;
+          if ( chk_lvl2 >= lvl ) chk_lvl2 = chk_lvl1;
+
+          if (add1[chk_lvl1] >  add1[chk_lvl2]) 
+            max_lvl = chk_lvl1;
+          else 
+            max_lvl = chk_lvl2;
+
+          /*
+	    If the parent is greater than both daughters,
+	    the correct level has been found
+	  */
+          if (add1_tmp >  add1[max_lvl]) 
+	    {
+	      add1[final_lvl] = add1_tmp;
+	      break;
+	    }
+	  else
+	    {
+	      /*
+		Otherwise, promote the largest daughter and push
+		down one level in the tree.  If haven't reached
+		the end of the tree, repeat the process.  Otherwise
+		store last values and exit the loop
+	      */
+	      add1[final_lvl] = add1[max_lvl];
+
+	      final_lvl = max_lvl;
+	      if ( 2*final_lvl+1 >= lvl )
+		{
+		  add1[final_lvl] = add1_tmp;
+		  break;
+		}
+	    }
+	}
+
+      if ( i == num_links ) {
+	cdoAbort("Internal problem; link 2 not found!\n");
+      }
+    }
+
+  /* Swap the last two entries */
+  add1_tmp = add1[1];
+  add1[1]  = add1[0];
+  add1[0]  = add1_tmp;
+
+} /* sort_add */
+
+
+void sort_iter_single(long num_links, double *restrict add1, int parent)
+{
+  /*
+    This routine is an interface between the parallelized (merge-sort) 
+    and the sequential sorting algorithm for addresses implemented in
+    the library. 
+    It iterates 1 level into the binary tree if the single data chunks
+    to sort are larger than the maximum size prescribed. Otherwise, it
+    just sorts the chunk using the sort_add routine as implemented 
+    originally. 
+    Note, that even on a single CPU, the merge sort algorithm can be
+    considerably faster (up to about 30% for a reasonable chunk size)
+  */
+
+  /* Parameters as in sort_par 
+     additional parameters 
+     int mod;      (enum TPAR_MODE) determines wether tomake use of merge sort
+     int parent;   !!! CAUTION !!!
+                   + determines level and position of data chunk within 
+                     the original heap (level = log_2(who_am_i)) if sort_iter(...) has not
+		     been called before
+		   + determines number of threads to use on first call of sort_iter(...)
+  */
+
+  static int MERGE_SORT_LIMIT_SIZE = 16384; 
+  static int first_sort_iter_call = 1;
+  static double merge_time;
+
+  int par_depth = 1;
+              
+  if ( first_sort_iter_call )
+    {
+      first_sort_iter_call = 0; 
+      par_depth = (int)(log(parent)/log(2));
+      MERGE_SORT_LIMIT_SIZE = num_links/parent/2 ;
+      if ( MERGE_SORT_LIMIT_SIZE < 4096 ) MERGE_SORT_LIMIT_SIZE = 4096;
+      parent = 1;
+    }
+ 
+  if ( num_links > MERGE_SORT_LIMIT_SIZE )
+    sort_par(num_links, add1, parent, par_depth);
+  else
+    sort_add(num_links,add1);
+
+  if ( parent == 1 ) {
+    first_sort_iter_call = 1;
+    //    mach_timebase_info_data_t info = {0,0};
+    //    mach_timebase_info(&info);
+    //    merge_time = merge_time * (info.numer / info.denom)/1000./num_links;
+    //    fprintf(stderr,"%12.8g ",merge_time);
+    
+    merge_time = 0;
+  }
+
+  return;
+}
diff --git a/src/merge_sort2.h b/src/merge_sort2.h
new file mode 100644
index 0000000..27c023c
--- /dev/null
+++ b/src/merge_sort2.h
@@ -0,0 +1,19 @@
+#ifndef _MERGE_SORT2_H_
+#define _MERGE_SORT2_H_
+
+/* MERGE SORT DEFINES */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <math.h>
+#include <string.h>
+#include <time.h>
+#include "cdo.h"
+
+#if defined (_OPENMP)
+#include <omp.h>
+#endif
+
+void sort_iter_single(long num_links, double *restrict add1, int parent);
+
+#endif
diff --git a/src/modules.c b/src/modules.c
new file mode 100644
index 0000000..9e9cbc3
--- /dev/null
+++ b/src/modules.c
@@ -0,0 +1,1038 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if defined (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <cdi.h>
+#include "cdo.h"
+#include "operator_help.h"
+#include "modules.h"
+#include "error.h"
+
+
+#define  MAX_MOD_OPERATORS  128         /* maximum number of operators for a module */
+
+typedef struct {
+  void  *(*func)(void *);               /* Module                   */
+  char **help;                          /* Help                     */
+  char  *operators[MAX_MOD_OPERATORS];  /* Operator names           */
+  short  number;                        /* Allowed number type      */
+  short  streamInCnt;                   /* Number of input streams  */
+  short  streamOutCnt;                  /* Number of output streams */
+}
+modules_t;
+
+
+void *Arith(void *argument);
+void *Arithc(void *argument);
+void *Arithdays(void *argument);
+void *Arithlat(void *argument);
+void *Cat(void *argument);
+void *CDItest(void *argument);
+void *CDIread(void *argument);
+void *CDIwrite(void *argument);
+void *Change(void *argument);
+void *Change_e5slm(void *argument);
+void *Cloudlayer(void *argument);
+void *Command(void *argument);
+void *Comp(void *argument);
+void *Compc(void *argument);
+void *Complextorect(void *argument);
+void *Cond(void *argument);
+void *Cond2(void *argument);
+void *Condc(void *argument);
+void *Consecstat(void *argument);
+void *Copy(void *argument);
+void *Deltime(void *argument);
+void *Derivepar(void *argument);
+void *Detrend(void *argument);
+void *Diff(void *argument);
+void *Duplicate(void *argument);
+void *Echam5ini(void *argument);
+void *Enlarge(void *argument);
+void *Enlargegrid(void *argument);
+void *Ensstat(void *argument);
+void *Ensstat3(void *argument);
+void *Ensval(void *argument);
+void *Eofcoeff(void *argument);
+void *Eofcoeff3d(void *argument);
+void *EOFs(void *argument);
+void *EOF3d(void *argument);
+void *Expr(void *argument);
+void *FC(void *argument);
+void *Filedes(void *argument);
+void *Fillmiss(void *argument);
+void *Filter(void *argument);
+void *Fldrms(void *argument);
+void *Fldstat(void *argument);
+void *Fldstat2(void *argument);
+void *Fourier(void *argument);
+void *Gather(void *argument);
+void *Gengrid(void *argument);
+void *Gradsdes(void *argument);
+void *Gridboxstat(void *argument);
+void *Gridcell(void *argument);
+void *Harmonic(void *argument);
+void *Histogram(void *argument);
+void *Importamsr(void *argument);
+void *Importbinary(void *argument);
+void *Importcmsaf(void *argument);
+void *Importobs(void *argument);
+void *Info(void *argument);
+void *Input(void *argument);
+void *Intgrid(void *argument);
+void *Intgridtraj(void *argument);
+void *Intlevel(void *argument);
+void *Intlevel3d(void *argument);
+void *Inttime(void *argument);
+void *Intntime(void *argument);
+void *Intyear(void *argument);
+void *Invert(void *argument);
+void *Invertlev(void *argument);
+void *Isosurface(void *argument);
+void *Kvl(void *argument);
+void *Log(void *argument);
+void *Maskbox(void *argument);
+void *Mastrfu(void *argument);
+void *Math(void *argument);
+void *Merge(void *argument);
+void *Mergegrid(void *argument);
+void *Mergetime(void *argument);
+void *Merstat(void *argument);
+void *Monarith(void *argument);
+void *Mrotuv(void *argument);
+void *Mrotuvb(void *argument);
+void *Ninfo(void *argument);
+void *Nmltest(void *argument);
+void *Output(void *argument);
+void *Outputgmt(void *argument);
+void *Pressure(void *argument);
+void *Pinfo(void *argument);
+void *Regres(void *argument);
+void *Remap(void *argument);
+void *Remapeta(void *argument);
+void *Replace(void *argument);
+void *Replacevalues(void *argument);
+void *Rotuv(void *argument);
+void *Rhopot(void *argument);
+void *Runpctl(void *argument);
+void *Runstat(void *argument);
+void *Seascount(void *argument);
+void *Seaspctl(void *argument);
+void *Seasstat(void *argument);
+void *Selbox(void *argument);
+void *Select(void *argument);
+void *Selvar(void *argument);
+void *Seloperator(void *argument);
+void *Selrec(void *argument);
+void *Seltime(void *argument);
+void *Set(void *argument);
+void *Setbox(void *argument);
+void *Setgatt(void *argument);
+void *Setgrid(void *argument);
+void *Sethalo(void *argument);
+void *Setmiss(void *argument);
+void *Setpartab(void *argument);
+void *Setrcaname(void *argument);
+void *Settime(void *argument);
+void *Setzaxis(void *argument);
+void *Scatter(void *argument);
+void *Showinfo(void *argument);
+void *Sinfo(void *argument);
+void *Smooth9(void *argument);
+void *Sort(void *argument);
+void *Sorttimestamp(void *argument);
+void *Specinfo(void *argument);
+void *Spectral(void *argument);
+void *Spectrum(void *argument);
+void *Split(void *argument);
+void *Splitrec(void *argument);
+void *Splitsel(void *argument);
+void *Splittime(void *argument);
+void *Splityear(void *argument);
+void *SSOpar(void *argument);
+void *Subtrend(void *argument);
+void *Tee(void *argument);
+void *Template1(void *argument);
+void *Template2(void *argument);
+void *Test(void *argument);
+void *Test2(void *argument);
+void *Testdata(void *argument);
+void *Tests(void *argument);
+void *Timsort(void *argument);
+void *Timcount(void *argument);
+void *Timpctl(void *argument);
+void *Timselpctl(void *argument);
+void *Timselstat(void *argument);
+void *Timstat(void *argument);
+void *Timstat2(void *argument);
+void *Timstat3(void *argument);
+void *Tinfo(void *argument);
+void *Tocomplex(void *argument);
+void *Transpose(void *argument);
+void *Trend(void *argument);
+void *Trms(void *argument);
+void *Tstepcount(void *argument);
+void *Vardup(void *argument);
+void *Vargen(void *argument);
+void *Varrms(void *argument);
+void *Vertint(void *argument);
+void *Vertstat(void *argument);
+void *Vertwind(void *argument);
+void *Wind(void *argument);
+void *Writegrid(void *argument);
+void *Writerandom(void *argument);
+void *YAR(void *argument);
+void *Ydayarith(void *argument);
+void *Ydaypctl(void *argument);
+void *Ydaystat(void *argument);
+void *Ydrunpctl(void *argument);
+void *Ydrunstat(void *argument);
+void *Yhourarith(void *argument);
+void *Yhourstat(void *argument);
+void *Ymonarith(void *argument);
+void *Ymonpctl(void *argument);
+void *Ymonstat(void *argument);
+void *Yseaspctl(void *argument);
+void *Yseasstat(void *argument);
+void *Zonstat(void *argument);
+
+void *EcaCfd(void *argument);
+void *EcaCsu(void *argument);
+void *EcaCwdi(void *argument);
+void *EcaCwfi(void *argument);
+void *EcaEtr(void *argument);
+void *EcaFd(void *argument);
+void *EcaGsl(void *argument);
+void *EcaHd(void *argument);
+void *EcaHwdi(void *argument);
+void *EcaHwfi(void *argument);
+void *EcaId(void *argument);
+void *EcaSu(void *argument);
+void *EcaTr(void *argument);
+void *EcaTg10p(void *argument);
+void *EcaTg90p(void *argument);
+void *EcaTn10p(void *argument);
+void *EcaTn90p(void *argument);
+void *EcaTx10p(void *argument);
+void *EcaTx90p(void *argument);
+
+void *EcaCdd(void *argument);
+void *EcaCwd(void *argument);
+void *EcaRr1(void *argument);
+void *EcaPd(void *argument);
+void *EcaR75p(void *argument);
+void *EcaR75ptot(void *argument);
+void *EcaR90p(void *argument);
+void *EcaR90ptot(void *argument);
+void *EcaR95p(void *argument);
+void *EcaR95ptot(void *argument);
+void *EcaR99p(void *argument);
+void *EcaR99ptot(void *argument);
+void *EcaRx1day(void *argument);
+void *EcaRx5day(void *argument);
+void *EcaSdii(void *argument);
+
+void *Fdns(void *argument);
+void *Strwin(void *argument);
+void *Strbre(void *argument);
+void *Strgal(void *argument);
+void *Hurr(void *argument);
+
+void *Hi(void *argument);
+void *Wct(void *argument);
+
+#if defined(HAVE_LIBMAGICS) && defined(HAVE_LIBXML2)
+void *Magplot(void *argument);
+void *Magvector(void *argument);
+void *Maggraph(void *argument);
+#endif
+
+
+#define  ArithOperators         {"add",  "sub",  "mul",  "div", "min", "max", "atan2"}
+#define  ArithcOperators        {"addc", "subc", "mulc", "divc", "mod"}
+#define  ArithdaysOperators     {"muldpm", "divdpm", "muldpy", "divdpy", "muldoy"}
+#define  ArithlatOperators      {"mulcoslat", "divcoslat"}
+#define  CatOperators           {"cat"}
+#define  CDItestOperators       {"ncopy"}
+#define  CDIreadOperators       {"cdiread"}
+#define  CDIwriteOperators      {"cdiwrite"}
+#define  ChangeOperators        {"chcode", "chtabnum", "chparam", "chname", "chunit", "chlevel", "chlevelc", "chlevelv", "chltype"}
+#define  Change_e5slmOperators  {"change_e5slm", "change_e5lsm", "change_e5mask"}
+#define  CloudlayerOperators    {"cloudlayer"}
+#define  CommandOperators       {"command", "com", "cmd"}
+#define  CompOperators          {"eq",  "ne",  "le",  "lt",  "ge",  "gt"}
+#define  CompcOperators         {"eqc", "nec", "lec", "ltc", "gec", "gtc"}
+#define  ComplextorectOperators {"complextorect"}
+#define  CondOperators          {"ifthen",  "ifnotthen"}
+#define  Cond2Operators         {"ifthenelse"}
+#define  CondcOperators         {"ifthenc", "ifnotthenc"}
+#define  ConsecstatOperators    {"consects", "consecsum"}
+#define  CopyOperators          {"copy", "selall", "szip"}
+#define  DeltimeOperators       {"delday", "del29feb"}
+#define  DeriveparOperators     {"geopotheight"}
+#define  DetrendOperators       {"detrend"}
+#define  DiffOperators          {"diff", "diff2", "diffp", "diffn", "diffc", "sdiff"}
+#define  DuplicateOperators     {"duplicate"}
+#define  Echam5iniOperators     {"import_e5ml", "import_e5res", \
+                                 "export_e5ml", "export_e5res"}
+#define  EnlargeOperators       {"enlarge"}
+#define  EnlargegridOperators   {"enlargegrid"}
+#define  EnsstatOperators       {"ensmin", "ensmax", "enssum", "ensmean", "ensavg", "ensvar", "ensstd", "enspctl"}
+#define  Ensstat3Operators      {"ensrkhist_space","ensrkhist_time","ensroc"}
+#define  EnsvalOperators        {"enscrps","ensbrs"}
+#define  EofcoeffOperators      {"eofcoeff"}
+#define  Eofcoeff3dOperators    {"eofcoeff3d"}
+#define  EOFsOperators          {"eof", "eofspatial", "eoftime"}
+#define  EOF3dOperators         {"eof3d","eof3dspatial","eof3dtime"}
+#define  ExprOperators          {"expr", "exprf", "aexpr", "aexprf"}
+#define  FCOperators            {"fc2sp", "sp2fc", "fc2gp", "gp2fc"}
+#define  FiledesOperators       {"filedes", "griddes", "griddes2", "zaxisdes", "vct", "vct2", "pardes", \
+                                 "vlist", "partab", "partab2"}
+#define  FillmissOperators      {"fillmiss"}
+#define  FilterOperators        {"bandpass", "highpass", "lowpass"}
+#define  FldrmsOperators        {"fldrms"}
+#define  FldstatOperators       {"fldmin", "fldmax", "fldsum", "fldmean", "fldavg", "fldvar", "fldstd", "fldpctl"}
+#define  FldcorOperators        {"fldcor"}
+#define  FldcovarOperators      {"fldcovar"}
+#define  FourierOperators       {"fourier"}
+#define  GatherOperators        {"gather"}
+#define  GengridOperators       {"gengrid"}
+#define  GradsdesOperators      {"gradsdes1", "gradsdes2", "dumpmap"}
+#define  GridboxstatOperators   {"gridboxmin", "gridboxmax", "gridboxsum", "gridboxmean", "gridboxavg", \
+                                 "gridboxvar", "gridboxstd"}
+#define  GridcellOperators      {"gridarea", "gridweights", "gridmask", "griddx", "griddy"}
+#define  HarmonicOperators      {"harmonic"}
+#define  HistogramOperators     {"histcount", "histsum", "histmean", "histfreq"}
+#define  ImportamsrOperators    {"import_amsr"}
+#define  ImportbinaryOperators  {"import_binary", "import_grads"}
+#define  ImportcmsafOperators   {"import_cmsaf"}
+#define  ImportobsOperators     {"import_obs"}
+#define  InfoOperators          {"info", "infop", "infon", "infoc", "map"}
+#define  InputOperators         {"input", "inputsrv", "inputext"}
+#define  IntgridOperators       {"intgridbil", "intpoint", "interpolate", "boxavg", "thinout"}
+#define  IntgridtrajOperators   {"intgridtraj"}
+#define  IntlevelOperators      {"intlevel", "intlevelx"}
+#define  Intlevel3dOperators    {"intlevel3d", "intlevelx3d"}
+#define  InttimeOperators       {"inttime"}
+#define  IntntimeOperators      {"intntime"}
+#define  IntyearOperators       {"intyear"}
+#define  InvertOperators        {"invertlat", "invertlon", "invertlatdes", "invertlondes", \
+                                 "invertlatdata", "invertlondata"}
+#define  InvertlevOperators     {"invertlev"}
+#define  IsosurfaceOperators    {"isosurface"}
+#define  KvlOperators           {"read_cmor_table", "conv_cmor_table"}
+#define  LogOperators           {"dumplogs", "daylogs", "monlogs", "dumplogo", \
+                                 "snamelogo", "scalllogo", "smemlogo", "stimelogo", "sperclogo"}
+#define  MaskboxOperators       {"masklonlatbox", "maskindexbox"}
+#define  MaskregionOperators    {"maskregion"}
+#define  MastrfuOperators       {"mastrfu"}
+#define  MathOperators          {"abs", "int", "nint", "sqr", "sqrt", "exp", "ln", "log10", "sin", \
+                                 "cos", "tan", "asin", "acos", "atan", "pow", "reci"}
+#define  MergeOperators         {"merge"}
+#define  MergegridOperators     {"mergegrid"}
+#define  MergetimeOperators     {"mergetime"}
+#define  MerstatOperators       {"mermin", "mermax", "mersum", "mermean", "meravg", "mervar", "merstd", "merpctl"}
+#define  MonarithOperators      {"monadd", "monsub", "monmul", "mondiv"}
+#define  MrotuvOperators        {"mrotuv"}
+#define  MrotuvbOperators       {"mrotuvb"}
+#define  NinfoOperators         {"nyear", "nmon", "ndate", "ntime", "ncode", "npar", "nlevel"}
+#define  NmltestOperators       {"nmltest"}
+#define  OutputOperators        {"output", "outputint", "outputsrv", "outputext", "outputf", "outputts", \
+                                 "outputfld", "outputarr", "outputxyz", "outputtab"}
+#define  OutputgmtOperators     {"gridverify", "outputcenter", "outputcenter2", "outputcentercpt", "outputbounds", \
+                                 "outputboundscpt", "outputvector", "outputtri", "outputvrml"}
+#define  PressureOperators      {"pressure_fl", "pressure_hl", "deltap"}
+#define  PinfoOperators         {"pinfo", "pinfov"}
+#define  RegresOperators        {"regres"}
+#define  RemapOperators         {"remap"}
+#define    RemapgridOperators   {"remapcon", "remapbil", "remapbic", "remapdis", "remapnn", "remaplaf", "remapcon2", "remapsum"}
+#define    GenweightsOperators  {"gencon", "genbil", "genbic", "gendis", "gennn", "genlaf", "gencon2"}
+#define  RemapetaOperators      {"remapeta", "remapeta_s", "remapeta_z"}
+#define  ReplaceOperators       {"replace"}
+#define  ReplacevaluesOperators {"setvals", "setrtoc", "setrtoc2"}
+#define  RhopotOperators        {"rhopot"}
+#define  RotuvOperators         {"rotuvb"}
+#define  RunpctlOperators       {"runpctl"}
+#define  RunstatOperators       {"runmin",  "runmax",  "runsum",  "runmean",  "runavg",  "runvar",  "runstd"}
+#define  SeascountOperators     {"seascount"}
+#define  SeaspctlOperators      {"seaspctl"}
+#define  SeasstatOperators      {"seasmin",  "seasmax",  "seassum",  "seasmean",  "seasavg",  "seasvar",  "seasstd"}
+#define  SelboxOperators        {"sellonlatbox", "selindexbox"}
+#define  SelectOperators        {"select", "delete"}
+#define  SelvarOperators        {"selparam", "selcode", "selname", "selstdname", "sellevel", "sellevidx", "selgrid", \
+                                 "selzaxis", "seltabnum", "delparam", "delcode", "delname", "selltype"}
+#define  SeloperatorOperators   {"seloperator"}
+#define  SelrecOperators        {"selrec"}
+#define  SeltimeOperators       {"seltimestep", "selyear", "selseas", "selmon", "selday", "selhour", "seldate", \
+                                 "seltime", "selsmon"}
+#define  SetOperators           {"setcode", "setparam", "setname", "setunit", "setlevel", "setltype", "settabnum"}
+#define  SetboxOperators        {"setclonlatbox", "setcindexbox"}
+#define  SetgattOperators       {"setgatt", "setgatts"}
+#define  SetgridOperators       {"setgrid", "setgridtype", "setgridarea", "setgridmask", "unsetgridmask", "setgridnumber"}
+#define  SethaloOperators       {"sethalo", "tpnhalo"}
+#define  SetmissOperators       {"setmissval", "setctomiss", "setmisstoc", "setrtomiss", "setvrange"}
+#define  SetpartabOperators     {"setpartab", "setpartabc", "setpartabp", "setpartabn"}
+#define  SetrcanameOperators    {"setrcaname"}
+#define  SettimeOperators       {"setyear", "setmon", "setday", "setdate", "settime", "settunits", \
+                                 "settaxis", "setreftime", "setcalendar", "shifttime"}
+#define  SetzaxisOperators      {"setzaxis"}
+#define  ScatterOperators       {"scatter"}
+#define  ShowinfoOperators      {"showyear", "showmon", "showdate", "showtime", "showtimestamp", "showcode", "showunit", \
+                                 "showparam", "showname", "showstdname", "showlevel", "showltype", "showformat"}
+#define  SinfoOperators         {"sinfo", "sinfop", "sinfon", "sinfoc", "seinfo", "seinfop", "seinfon", "seinfoc"}
+#define  Smooth9Operators       {"smooth9"}
+#define  SortOperators          {"sortcode", "sortname", "sortlevel"}
+#define  SorttimestampOperators {"sorttimestamp", "sorttaxis"}
+#define  SpecinfoOperators      {"specinfo"}
+#define  SpectralOperators      {"gp2sp", "gp2spl", "sp2gp", "sp2gpl", "sp2sp", "spcut"}
+#define  SpectrumOperators      {"spectrum"}
+#define  SplitOperators         {"splitcode", "splitparam", "splitname", "splitlevel", "splitgrid", "splitzaxis", "splittabnum"}
+#define  SplitrecOperators      {"splitrec"}
+#define  SplitselOperators      {"splitsel"}
+#define  SplittimeOperators     {"splithour", "splitday", "splitmon", "splitseas"}
+#define  SplityearOperators     {"splityear"}
+#define  SSOparOperators        {"ssopar"}
+#define  SubtrendOperators      {"subtrend"}
+#define  TeeOperators           {"tee"}
+#define  Template1Operators     {"template1"}
+#define  Template2Operators     {"template2"}
+#define  TestOperators          {"test"}
+#define  Test2Operators         {"test2"}
+#define  TestdataOperators      {"testdata"}
+#define  TestsOperators         {"normal", "studentt", "chisquare", "beta", "fisher"}
+#define  TimsortOperators       {"timsort"}
+#define  TimcountOperators      {"timcount"}
+#define    YearcountOperators   {"yearcount"}
+#define    MoncountOperators    {"moncount"}
+#define    DaycountOperators    {"daycount"}
+#define    HourcountOperators   {"hourcount"}
+#define  TimpctlOperators       {"timpctl"}
+#define    YearpctlOperators    {"yearpctl"}
+#define    MonpctlOperators     {"monpctl"}
+#define    DaypctlOperators     {"daypctl"}
+#define    HourpctlOperators    {"hourpctl"}
+#define  TimselpctlOperators    {"timselpctl"}
+#define  TimselstatOperators    {"timselmin", "timselmax", "timselsum", "timselmean", "timselavg", "timselvar", "timselstd"}
+#define  TimstatOperators       {"timmin",  "timmax",  "timsum",  "timmean",  "timavg",  "timvar",  "timstd"}
+#define    YearstatOperators    {"yearmin", "yearmax", "yearsum", "yearmean", "yearavg", "yearvar", "yearstd"}
+#define    MonstatOperators     {"monmin",  "monmax",  "monsum",  "monmean",  "monavg",  "monvar",  "monstd"}
+#define    DaystatOperators     {"daymin",  "daymax",  "daysum",  "daymean",  "dayavg",  "dayvar",  "daystd"}
+#define    HourstatOperators    {"hourmin", "hourmax", "hoursum", "hourmean", "houravg", "hourvar", "hourstd"}
+#define  TimcorOperators        {"timcor"}
+#define  TimcovarOperators      {"timcovar"}
+#define  Timstat3Operators      {"meandiff2test", "varquot2test"}
+#define  TinfoOperators         {"tinfo"}
+#define  TocomplexOperators     {"retocomplex", "imtocomplex"}
+#define  TransposeOperators     {"transxy"}
+#define  TrendOperators         {"trend"}
+#define  TrmsOperators          {"trms"}
+#define  TstepcountOperators    {"tstepcount"}
+#define  VardupOperators        {"pardup", "parmul"}
+#define  VargenOperators        {"random", "const", "for", "topo", "temp", "mask", "stdatm"}
+#define  VarrmsOperators        {"varrms"}
+#define  VertintOperators       {"ml2pl", "ml2hl", "ml2plx", "ml2hlx", \
+                                 "ml2pl_lp", "ml2hl_lp", "ml2plx_lp", "ml2hlx_lp"}
+#define  VertstatOperators      {"vertmin", "vertmax", "vertsum", "vertmean", "vertavg", "vertvar", "vertstd"}
+#define  VertwindOperators      {"vertwind"}
+#define  WindOperators          {"uv2dv", "uv2dvl", "dv2uv", "dv2uvl", "dv2ps"}
+#define  WritegridOperators     {"writegrid"}
+#define  WriterandomOperators   {"writerandom"}
+#define  YAROperators           {"yarbil", "yarnn", "yarcon"}
+#define  YdayarithOperators     {"ydayadd", "ydaysub", "ydaymul", "ydaydiv"}
+#define  YdaypctlOperators      {"ydaypctl"}
+#define  YdaystatOperators      {"ydaymin", "ydaymax", "ydaysum", "ydaymean", "ydayavg", "ydayvar", "ydaystd"}
+#define  YdrunpctlOperators     {"ydrunpctl"}
+#define  YdrunstatOperators     {"ydrunmin", "ydrunmax", "ydrunsum", "ydrunmean", "ydrunavg", "ydrunvar", "ydrunstd"}
+#define  YhourarithOperators    {"yhouradd", "yhoursub", "yhourmul", "yhourdiv"}
+#define  YhourstatOperators     {"yhourmin", "yhourmax", "yhoursum", "yhourmean", "yhouravg", "yhourvar", "yhourstd"}
+#define  YmonarithOperators     {"ymonadd", "ymonsub", "ymonmul", "ymondiv"}
+#define  YmonpctlOperators      {"ymonpctl"}
+#define  YmonstatOperators      {"ymonmin", "ymonmax", "ymonsum", "ymonmean", "ymonavg", "ymonvar", "ymonstd"}
+#define  YseaspctlOperators     {"yseaspctl"}
+#define  YseasstatOperators     {"yseasmin", "yseasmax", "yseassum", "yseasmean", "yseasavg", "yseasvar", "yseasstd"}
+#define  ZonstatOperators       {"zonmin", "zonmax", "zonrange", "zonsum", "zonmean", "zonavg", "zonvar", "zonstd", "zonpctl"}
+
+#define  EcaCfdOperators        {"eca_cfd"}
+#define  EcaCsuOperators        {"eca_csu"}
+#define  EcaCwfiOperators       {"eca_cwfi"}
+#define  EcaHwdiOperators       {"eca_hwdi"}
+#define  EcaEtrOperators        {"eca_etr"}
+#define  EcaFdOperators         {"eca_fd"}
+#define  EcaGslOperators        {"eca_gsl"}
+#define  EcaHdOperators         {"eca_hd"}
+#define  EcaCwdiOperators       {"eca_cwdi"}
+#define  EcaHwfiOperators       {"eca_hwfi"}
+#define  EcaIdOperators         {"eca_id"}
+#define  EcaSuOperators         {"eca_su"}
+#define  EcaTrOperators         {"eca_tr"}
+#define  EcaTg10pOperators      {"eca_tg10p"}
+#define  EcaTg90pOperators      {"eca_tg90p"}
+#define  EcaTn10pOperators      {"eca_tn10p"}
+#define  EcaTn90pOperators      {"eca_tn90p"}
+#define  EcaTx10pOperators      {"eca_tx10p"}
+#define  EcaTx90pOperators      {"eca_tx90p"}
+
+#define  EcaCddOperators        {"eca_cdd"}
+#define  EcaCwdOperators        {"eca_cwd"}
+#define  EcaRr1Operators        {"eca_rr1"}
+/*
+#define  EcaR10mmOperators      {"eca_r10mm"}
+#define  EcaR20mmOperators      {"eca_r20mm"}
+*/
+#define  EcaPdOperators         {"eca_pd", "eca_r10mm", "eca_r20mm"}
+#define  EcaR75pOperators       {"eca_r75p"}
+#define  EcaR75ptotOperators    {"eca_r75ptot"}
+#define  EcaR90pOperators       {"eca_r90p"}
+#define  EcaR90ptotOperators    {"eca_r90ptot"}
+#define  EcaR95pOperators       {"eca_r95p"}
+#define  EcaR95ptotOperators    {"eca_r95ptot"}
+#define  EcaR99pOperators       {"eca_r99p"}
+#define  EcaR99ptotOperators    {"eca_r99ptot"}
+#define  EcaRx1dayOperators     {"eca_rx1day"}
+#define  EcaRx5dayOperators     {"eca_rx5day"}
+#define  EcaSdiiOperators       {"eca_sdii"}
+
+#define  FdnsOperators          {"fdns"}
+
+#define  StrwinOperators        {"strwin"}
+#define  StrbreOperators        {"strbre"}
+#define  StrgalOperators        {"strgal"}
+#define  HurrOperators          {"hurr"}
+
+#define  HiOperators            {"hi"}
+#define  WctOperators           {"wct"}
+
+#if defined(HAVE_LIBMAGICS) && defined(HAVE_LIBXML2)
+#define  MagplotOperators       {"contour", "shaded", "grfill"}
+#define  MagvectorOperators     {"vector", "stream"}
+#define  MaggraphOperators      {"graph"}
+#endif
+
+static modules_t Modules[] =
+{
+  /* stream out -1 means usage of obase */
+  /*
+    function        help function      operator names          number     num streams
+                                                               type       in  out
+  */
+  { Arith,          ArithHelp,         ArithOperators,         CDI_REAL,  2,  1 },
+  { Arithc,         ArithcHelp,        ArithcOperators,        CDI_REAL,  1,  1 },
+  { Arithdays,      ArithdaysHelp,     ArithdaysOperators,     CDI_REAL,  1,  1 },
+  { Arithlat,       NULL,              ArithlatOperators,      CDI_REAL,  1,  1 },
+  { Cat,            CopyHelp,          CatOperators,           CDI_REAL, -1,  1 },
+  { CDItest,        NULL,              CDItestOperators,       CDI_REAL,  1,  1 },
+  { CDIread,        NULL,              CDIreadOperators,       CDI_REAL,  1,  0 },
+  { CDIwrite,       NULL,              CDIwriteOperators,      CDI_REAL,  0,  1 },
+  { Change,         ChangeHelp,        ChangeOperators,        CDI_REAL,  1,  1 },
+  { Change_e5slm,   NULL,              Change_e5slmOperators,  CDI_REAL,  1,  1 },
+  { Cloudlayer,     NULL,              CloudlayerOperators,    CDI_REAL,  1,  1 },
+  { Command,        NULL,              CommandOperators,       CDI_REAL,  1,  0 },
+  { Comp,           CompHelp,          CompOperators,          CDI_REAL,  2,  1 },
+  { Compc,          CompcHelp,         CompcOperators,         CDI_REAL,  1,  1 },
+  { Complextorect,  NULL,              ComplextorectOperators, CDI_COMP,  1,  2 },
+  { Cond,           CondHelp,          CondOperators,          CDI_REAL,  2,  1 },
+  { Cond2,          Cond2Help,         Cond2Operators,         CDI_REAL,  3,  1 },
+  { Condc,          CondcHelp,         CondcOperators,         CDI_REAL,  1,  1 },
+  { Consecstat,     ConsecstatHelp,    ConsecstatOperators,    CDI_REAL,  1,  1 },
+  { Copy,           CopyHelp,          CopyOperators,          CDI_REAL, -1,  1 },
+  { Deltime,        NULL,              DeltimeOperators,       CDI_REAL,  1,  1 },
+  { Derivepar,      NULL,              DeriveparOperators,     CDI_REAL,  1,  1 },
+  { Detrend,        DetrendHelp,       DetrendOperators,       CDI_REAL,  1,  1 },
+  { Diff,           DiffHelp,          DiffOperators,          CDI_REAL,  2,  0 },
+  { Duplicate,      NULL,              DuplicateOperators,     CDI_REAL,  1,  1 },
+  { Echam5ini,      NULL,              Echam5iniOperators,     CDI_REAL,  1,  1 },
+  { Enlarge,        EnlargeHelp,       EnlargeOperators,       CDI_REAL,  1,  1 },
+  { Enlargegrid,    NULL,              EnlargegridOperators,   CDI_REAL,  1,  1 },
+  { Ensstat,        EnsstatHelp,       EnsstatOperators,       CDI_REAL, -1,  1 },
+  { Ensstat3,       Ensstat2Help,      Ensstat3Operators,      CDI_REAL, -1,  1 },
+  { Ensval,         EnsvalHelp,        EnsvalOperators,        CDI_REAL, -1,  1 },
+  { Eofcoeff,       EofcoeffHelp,      EofcoeffOperators,      CDI_REAL,  2, -1 },
+  { Eofcoeff3d,     EofcoeffHelp,      Eofcoeff3dOperators,    CDI_REAL,  2, -1 },
+  { EOFs,           EOFsHelp,          EOFsOperators,          CDI_REAL,  1,  2 },
+  { EOF3d,          NULL,              EOF3dOperators,         CDI_REAL,  1,  2 },
+  { Expr,           ExprHelp,          ExprOperators,          CDI_REAL,  1,  1 },
+  { FC,             NULL,              FCOperators,            CDI_REAL,  1,  1 },
+  { Filedes,        FiledesHelp,       FiledesOperators,       CDI_BOTH,  1,  0 },
+  { Fillmiss,       NULL,              FillmissOperators,      CDI_REAL,  1,  1 },
+  { Filter,         FilterHelp,        FilterOperators,        CDI_REAL,  1,  1 },
+  { Fldrms,         NULL,              FldrmsOperators,        CDI_REAL,  2,  1 },
+  { Fldstat,        FldstatHelp,       FldstatOperators,       CDI_REAL,  1,  1 },
+  { Fldstat2,       FldcorHelp,        FldcorOperators,        CDI_REAL,  2,  1 },
+  { Fldstat2,       FldcovarHelp,      FldcovarOperators,      CDI_REAL,  2,  1 },
+  { Fourier,        NULL,              FourierOperators,       CDI_COMP,  1,  1 },
+  { Gather,         NULL,              GatherOperators,        CDI_REAL, -1,  1 },
+  { Gengrid,        NULL,              GengridOperators,       CDI_REAL,  2,  1 },
+  { Gradsdes,       GradsdesHelp,      GradsdesOperators,      CDI_REAL,  1,  0 },
+  { Gridboxstat,    GridboxstatHelp,   GridboxstatOperators,   CDI_REAL,  1,  1 },
+  { Gridcell,       GridcellHelp,      GridcellOperators,      CDI_REAL,  1,  1 },
+  { Harmonic,       NULL,              HarmonicOperators,      CDI_REAL,  1,  1 },
+  { Histogram,      HistogramHelp,     HistogramOperators,     CDI_REAL,  1,  1 },
+  { Importamsr,     ImportamsrHelp,    ImportamsrOperators,    CDI_REAL,  1,  1 },
+  { Importbinary,   ImportbinaryHelp,  ImportbinaryOperators,  CDI_REAL,  1,  1 },
+  { Importcmsaf,    ImportcmsafHelp,   ImportcmsafOperators,   CDI_REAL,  1,  1 },
+  { Importobs,      NULL,              ImportobsOperators,     CDI_REAL,  1,  1 },
+  { Info,           InfoHelp,          InfoOperators,          CDI_BOTH, -1,  0 },
+  { Input,          InputHelp,         InputOperators,         CDI_REAL,  0,  1 },
+  { Intgrid,        NULL,              IntgridOperators,       CDI_REAL,  1,  1 },
+  { Intgridtraj,    NULL,              IntgridtrajOperators,   CDI_REAL,  1,  1 },
+  { Intlevel,       IntlevelHelp,      IntlevelOperators,      CDI_REAL,  1,  1 },
+  { Intlevel3d,     Intlevel3dHelp,    Intlevel3dOperators,    CDI_REAL,  2,  1 },
+  { Inttime,        InttimeHelp,       InttimeOperators,       CDI_REAL,  1,  1 },
+  { Intntime,       InttimeHelp,       IntntimeOperators,      CDI_REAL,  1,  1 },
+  { Intyear,        IntyearHelp,       IntyearOperators,       CDI_REAL,  2, -1 },
+  { Invert,         InvertHelp,        InvertOperators,        CDI_REAL,  1,  1 },
+  { Invertlev,      InvertlevHelp,     InvertlevOperators,     CDI_REAL,  1,  1 },
+  { Isosurface,     NULL,              IsosurfaceOperators,    CDI_REAL,  1,  1 },
+  { Kvl,            NULL,              KvlOperators,           CDI_REAL,  0,  0 },
+  { Log,            NULL,              LogOperators,           CDI_REAL,  1,  0 },
+  { Maskbox,        MaskboxHelp,       MaskboxOperators,       CDI_REAL,  1,  1 },
+  { Maskbox,        MaskregionHelp,    MaskregionOperators,    CDI_REAL,  1,  1 },
+  { Mastrfu,        MastrfuHelp,       MastrfuOperators,       CDI_REAL,  1,  1 },
+  { Math,           MathHelp,          MathOperators,          CDI_REAL,  1,  1 },
+  { Merge,          MergeHelp,         MergeOperators,         CDI_REAL, -1,  1 },
+  { Mergegrid,      NULL,              MergegridOperators,     CDI_REAL,  2,  1 },
+  { Mergetime,      MergeHelp,         MergetimeOperators,     CDI_REAL, -1,  1 },
+  { Merstat,        MerstatHelp,       MerstatOperators,       CDI_REAL,  1,  1 },
+  { Monarith,       MonarithHelp,      MonarithOperators,      CDI_REAL,  2,  1 },
+  { Mrotuv,         NULL,              MrotuvOperators,        CDI_REAL,  1,  2 },
+  { Mrotuvb,        NULL,              MrotuvbOperators,       CDI_REAL,  2,  1 },
+  { Ninfo,          NinfoHelp,         NinfoOperators,         CDI_BOTH,  1,  0 },
+  { Nmltest,        NULL,              NmltestOperators,       CDI_REAL,  0,  0 },
+  { Output,         OutputHelp,        OutputOperators,        CDI_REAL, -1,  0 },
+  { Outputgmt,      NULL,              OutputgmtOperators,     CDI_REAL,  1,  0 },
+  { Pressure,       NULL,              PressureOperators,      CDI_REAL,  1,  1 },
+  { Pinfo,          NULL,              PinfoOperators,         CDI_REAL,  1,  1 },
+  { Regres,         RegresHelp,        RegresOperators,        CDI_REAL,  1,  1 },
+  { Remap,          RemapHelp,         RemapOperators,         CDI_REAL,  1,  1 },
+  { Remap,          RemapgridHelp,     RemapgridOperators,     CDI_REAL,  1,  1 },
+  { Remap,          GenweightsHelp,    GenweightsOperators,    CDI_REAL,  1,  1 },
+  { Remapeta,       RemapetaHelp,      RemapetaOperators,      CDI_REAL,  1,  1 },
+  { Replace,        ReplaceHelp,       ReplaceOperators,       CDI_REAL,  2,  1 },
+  { Replacevalues,  ReplacevaluesHelp, ReplacevaluesOperators, CDI_REAL,  1,  1 },
+  { Rhopot,         NULL,              RhopotOperators,        CDI_REAL,  1,  1 },
+  { Rotuv,          RotuvHelp,         RotuvOperators,         CDI_REAL,  1,  1 },
+  { Runpctl,        RunpctlHelp,       RunpctlOperators,       CDI_REAL,  1,  1 },
+  { Runstat,        RunstatHelp,       RunstatOperators,       CDI_REAL,  1,  1 },
+  { Seascount,      NULL,              SeascountOperators,     CDI_REAL,  1,  1 },
+  { Seaspctl,       SeaspctlHelp,      SeaspctlOperators,      CDI_REAL,  3,  1 },
+  { Seasstat,       SeasstatHelp,      SeasstatOperators,      CDI_REAL,  1,  1 },
+  { Selbox,         SelboxHelp,        SelboxOperators,        CDI_BOTH,  1,  1 },
+  { Select,         NULL,              SelectOperators,        CDI_BOTH, -1,  1 },
+  { Selvar,         SelvarHelp,        SelvarOperators,        CDI_BOTH,  1,  1 },
+  { Selrec,         SelvarHelp,        SelrecOperators,        CDI_BOTH,  1,  1 },
+  { Seloperator,    NULL,              SeloperatorOperators,   CDI_REAL,  1,  1 },
+  { Seltime,        SeltimeHelp,       SeltimeOperators,       CDI_BOTH,  1,  1 },
+  { Set,            SetHelp,           SetOperators,           CDI_BOTH,  1,  1 },
+  { Setbox,         SetboxHelp,        SetboxOperators,        CDI_REAL,  1,  1 },
+  { Setgatt,        SetgattHelp,       SetgattOperators,       CDI_BOTH,  1,  1 },
+  { Setgrid,        SetgridHelp,       SetgridOperators,       CDI_BOTH,  1,  1 },
+  { Sethalo,        SethaloHelp,       SethaloOperators,       CDI_REAL,  1,  1 },
+  { Setmiss,        SetmissHelp,       SetmissOperators,       CDI_REAL,  1,  1 },
+  { Setpartab,      SetHelp,           SetpartabOperators,     CDI_REAL,  1,  1 },
+  { Setrcaname,     NULL,              SetrcanameOperators,    CDI_REAL,  1,  1 },
+  { Settime,        SettimeHelp,       SettimeOperators,       CDI_BOTH,  1,  1 },
+  { Setzaxis,       SetzaxisHelp,      SetzaxisOperators,      CDI_BOTH,  1,  1 },
+  { Scatter,        NULL,              ScatterOperators,       CDI_REAL,  1,  1 },
+  { Showinfo,       ShowinfoHelp,      ShowinfoOperators,      CDI_BOTH,  1,  0 },
+  { Sinfo,          SinfoHelp,         SinfoOperators,         CDI_BOTH, -1,  0 },
+  { Smooth9,        Smooth9Help,       Smooth9Operators,       CDI_REAL,  1,  1 },
+  { Sort,           NULL,              SortOperators,          CDI_REAL,  1,  1 },
+  { Sorttimestamp,  NULL,              SorttimestampOperators, CDI_REAL, -1,  1 },
+  { Specinfo,       NULL,              SpecinfoOperators,      CDI_REAL,  0,  0 },
+  { Spectral,       SpectralHelp,      SpectralOperators,      CDI_REAL,  1,  1 },
+  { Spectrum,       NULL,              SpectrumOperators,      CDI_REAL,  1,  1 },
+  { Split,          SplitHelp,         SplitOperators,         CDI_BOTH,  1, -1 },
+  { Splitrec,       SplitHelp,         SplitrecOperators,      CDI_BOTH,  1, -1 },
+  { Splitsel,       SplitselHelp,      SplitselOperators,      CDI_BOTH,  1, -1 },
+  { Splittime,      SplittimeHelp,     SplittimeOperators,     CDI_BOTH,  1, -1 },
+  { Splityear,      SplittimeHelp,     SplityearOperators,     CDI_BOTH,  1, -1 },
+  { SSOpar,         NULL,              SSOparOperators,        CDI_REAL,  1,  1 },
+  { Subtrend,       SubtrendHelp,      SubtrendOperators,      CDI_REAL,  3,  1 },
+  { Template1,      NULL,              Template1Operators,     CDI_REAL,  1,  1 },
+  { Tee,            NULL,              TeeOperators,           CDI_REAL,  2,  1 },
+  { Template2,      NULL,              Template2Operators,     CDI_REAL,  1,  1 },
+  { Test,           NULL,              TestOperators,          CDI_REAL,  1,  1 },
+  { Test2,          NULL,              Test2Operators,         CDI_REAL,  2,  1 },
+  { Testdata,       NULL,              TestdataOperators,      CDI_REAL,  1,  1 },
+  { Tests,          NULL,              TestsOperators,         CDI_REAL,  1,  1 },
+  { Timcount,       NULL,              TimcountOperators,      CDI_REAL,  1,  1 },
+  { Timcount,       NULL,              YearcountOperators,     CDI_REAL,  1,  1 },
+  { Timcount,       NULL,              MoncountOperators,      CDI_REAL,  1,  1 },
+  { Timcount,       NULL,              DaycountOperators,      CDI_REAL,  1,  1 },
+  { Timcount,       NULL,              HourcountOperators,     CDI_REAL,  1,  1 },
+  { Timpctl,        TimpctlHelp,       TimpctlOperators,       CDI_REAL,  3,  1 },
+  { Timpctl,        YearpctlHelp,      YearpctlOperators,      CDI_REAL,  3,  1 },
+  { Timpctl,        MonpctlHelp,       MonpctlOperators,       CDI_REAL,  3,  1 },
+  { Timpctl,        DaypctlHelp,       DaypctlOperators,       CDI_REAL,  3,  1 },
+  { Timpctl,        HourpctlHelp,      HourpctlOperators,      CDI_REAL,  3,  1 },
+  { Timselpctl,     TimselpctlHelp,    TimselpctlOperators,    CDI_REAL,  3,  1 },
+  { Timsort,        TimsortHelp,       TimsortOperators,       CDI_REAL,  1,  1 },
+  { Timselstat,     TimselstatHelp,    TimselstatOperators,    CDI_REAL,  1,  1 },
+  { Timstat,        TimstatHelp,       TimstatOperators,       CDI_REAL,  1,  1 },
+  { Timstat,        YearstatHelp,      YearstatOperators,      CDI_REAL,  1,  1 },
+  { Timstat,        MonstatHelp,       MonstatOperators,       CDI_REAL,  1,  1 },
+  { Timstat,        DaystatHelp,       DaystatOperators,       CDI_REAL,  1,  1 },
+  { Timstat,        HourstatHelp,      HourstatOperators,      CDI_REAL,  1,  1 },
+  { Timstat2,       TimcorHelp,        TimcorOperators,        CDI_REAL,  2,  1 },
+  { Timstat2,       TimcovarHelp,      TimcovarOperators,      CDI_REAL,  2,  1 },
+  { Timstat3,       NULL,              Timstat3Operators,      CDI_REAL,  2,  1 },
+  { Tinfo,          NULL,              TinfoOperators,         CDI_BOTH,  1,  0 },
+  { Tocomplex,      NULL,              TocomplexOperators,     CDI_REAL,  1,  1 },
+  { Transpose,      NULL,              TransposeOperators,     CDI_REAL,  1,  1 },
+  { Trend,          TrendHelp,         TrendOperators,         CDI_REAL,  1,  2 },
+  { Trms,           NULL,              TrmsOperators,          CDI_REAL,  2,  1 },
+  { Tstepcount,     NULL,              TstepcountOperators,    CDI_REAL,  1,  1 },
+  { Vardup,         NULL,              VardupOperators,        CDI_REAL,  1,  1 },
+  { Vargen,         VargenHelp,        VargenOperators,        CDI_REAL,  0,  1 },
+  { Varrms,         NULL,              VarrmsOperators,        CDI_REAL,  2,  1 },
+  { Vertint,        IntvertHelp,       VertintOperators,       CDI_REAL,  1,  1 },
+  { Vertstat,       VertstatHelp,      VertstatOperators,      CDI_REAL,  1,  1 },
+  { Vertwind,       NULL,              VertwindOperators,      CDI_REAL,  1,  1 },
+  { Wind,           WindHelp,          WindOperators,          CDI_REAL,  1,  1 },
+  { Writegrid,      NULL,              WritegridOperators,     CDI_REAL,  1,  1 },  /* no cdi output */
+  { Writerandom,    NULL,              WriterandomOperators,   CDI_REAL,  1,  1 },
+  { YAR,            NULL,              YAROperators,           CDI_REAL,  1,  1 },
+  { Ydayarith,      YdayarithHelp,     YdayarithOperators,     CDI_REAL,  2,  1 },
+  { Ydaypctl,       YdaypctlHelp,      YdaypctlOperators,      CDI_REAL,  3,  1 },
+  { Ydaystat,       YdaystatHelp,      YdaystatOperators,      CDI_REAL,  1,  1 },
+  { Ydrunpctl,      YdrunpctlHelp,     YdrunpctlOperators,     CDI_REAL,  3,  1 },
+  { Ydrunstat,      YdrunstatHelp,     YdrunstatOperators,     CDI_REAL,  1,  1 },
+  { Yhourarith,     YhourarithHelp,    YhourarithOperators,    CDI_REAL,  2,  1 },
+  { Yhourstat,      YhourstatHelp,     YhourstatOperators,     CDI_REAL,  1,  1 },
+  { Ymonarith,      YmonarithHelp,     YmonarithOperators,     CDI_REAL,  2,  1 },
+  { Ymonpctl,       YmonpctlHelp,      YmonpctlOperators,      CDI_REAL,  3,  1 },
+  { Ymonstat,       YmonstatHelp,      YmonstatOperators,      CDI_REAL,  1,  1 },
+  { Yseaspctl,      YseaspctlHelp,     YseaspctlOperators,     CDI_REAL,  3,  1 },
+  { Yseasstat,      YseasstatHelp,     YseasstatOperators,     CDI_REAL,  1,  1 },
+  { Zonstat,        ZonstatHelp,       ZonstatOperators,       CDI_REAL,  1,  1 },
+  { EcaCfd,         EcaCfdHelp,        EcaCfdOperators,        CDI_REAL,  1,  1 },
+  { EcaCsu,         EcaCsuHelp,        EcaCsuOperators,        CDI_REAL,  1,  1 },
+  { EcaCwdi,        EcaCwdiHelp,       EcaCwdiOperators,       CDI_REAL,  2,  1 },
+  { EcaCwfi,        EcaCwfiHelp,       EcaCwfiOperators,       CDI_REAL,  2,  1 },
+  { EcaEtr,         EcaEtrHelp,        EcaEtrOperators,        CDI_REAL,  2,  1 },
+  { EcaFd,          EcaFdHelp,         EcaFdOperators,         CDI_REAL,  1,  1 },
+  { EcaGsl,         EcaGslHelp,        EcaGslOperators,        CDI_REAL,  2,  1 },
+  { EcaHd,          EcaHdHelp,         EcaHdOperators,         CDI_REAL,  1,  1 },
+  { EcaHwdi,        EcaHwdiHelp,       EcaHwdiOperators,       CDI_REAL,  2,  1 },
+  { EcaHwfi,        EcaHwfiHelp,       EcaHwfiOperators,       CDI_REAL,  2,  1 },
+  { EcaId,          EcaIdHelp,         EcaIdOperators,         CDI_REAL,  1,  1 },
+  { EcaSu,          EcaSuHelp,         EcaSuOperators,         CDI_REAL,  1,  1 },
+  { EcaTr,          EcaTrHelp,         EcaTrOperators,         CDI_REAL,  1,  1 },
+  { EcaTg10p,       EcaTg10pHelp,      EcaTg10pOperators,      CDI_REAL,  2,  1 },
+  { EcaTg90p,       EcaTg90pHelp,      EcaTg90pOperators,      CDI_REAL,  2,  1 },
+  { EcaTn10p,       EcaTn10pHelp,      EcaTn10pOperators,      CDI_REAL,  2,  1 },
+  { EcaTn90p,       EcaTn90pHelp,      EcaTn90pOperators,      CDI_REAL,  2,  1 },
+  { EcaTx10p,       EcaTx10pHelp,      EcaTx10pOperators,      CDI_REAL,  2,  1 },
+  { EcaTx90p,       EcaTx90pHelp,      EcaTx90pOperators,      CDI_REAL,  2,  1 },
+  { EcaCdd,         EcaCddHelp,        EcaCddOperators,        CDI_REAL,  1,  1 },
+  { EcaCwd,         EcaCwdHelp,        EcaCwdOperators,        CDI_REAL,  1,  1 },
+  { EcaRr1,         EcaRr1Help,        EcaRr1Operators,        CDI_REAL,  1,  1 },
+  { EcaPd,          EcaPdHelp,         EcaPdOperators,         CDI_REAL,  1,  1 },
+  { EcaR75p,        EcaR75pHelp,       EcaR75pOperators,       CDI_REAL,  2,  1 },
+  { EcaR75ptot,     EcaR75ptotHelp,    EcaR75ptotOperators,    CDI_REAL,  2,  1 },
+  { EcaR90p,        EcaR90pHelp,       EcaR90pOperators,       CDI_REAL,  2,  1 },
+  { EcaR90ptot,     EcaR90ptotHelp,    EcaR90ptotOperators,    CDI_REAL,  2,  1 },
+  { EcaR95p,        EcaR95pHelp,       EcaR95pOperators,       CDI_REAL,  2,  1 },
+  { EcaR95ptot,     EcaR95ptotHelp,    EcaR95ptotOperators,    CDI_REAL,  2,  1 },
+  { EcaR99p,        EcaR99pHelp,       EcaR99pOperators,       CDI_REAL,  2,  1 },
+  { EcaR99ptot,     EcaR99ptotHelp,    EcaR99ptotOperators,    CDI_REAL,  2,  1 },
+  { EcaRx1day,      EcaRx1dayHelp,     EcaRx1dayOperators,     CDI_REAL,  1,  1 },
+  { EcaRx5day,      EcaRx5dayHelp,     EcaRx5dayOperators,     CDI_REAL,  1,  1 },
+  { EcaSdii,        EcaSdiiHelp,       EcaSdiiOperators,       CDI_REAL,  1,  1 },
+  { Fdns,           FdnsHelp,          FdnsOperators,          CDI_REAL,  2,  1 },
+  { Strwin,         StrwinHelp,        StrwinOperators,        CDI_REAL,  1,  1 },
+  { Strbre,         StrbreHelp,        StrbreOperators,        CDI_REAL,  1,  1 },
+  { Strgal,         StrgalHelp,        StrgalOperators,        CDI_REAL,  1,  1 },
+  { Hurr,           HurrHelp,          HurrOperators,          CDI_REAL,  1,  1 },
+  /*  { Hi,             NULL,              HiOperators,        CDI_REAL,  3,  1 }, */
+  { Wct,            WctHelp,           WctOperators,           CDI_REAL,  2,  1 },
+#if defined(HAVE_LIBMAGICS) && defined(HAVE_LIBXML2)
+  { Magplot,        NULL,              MagplotOperators,       CDI_REAL,  1,  1 },
+  { Magvector,      NULL,              MagvectorOperators,     CDI_REAL,  1,  1 },
+  { Maggraph,       NULL,              MaggraphOperators,      CDI_REAL, -1,  1 },
+#endif
+};							       
+							       
+static int NumModules = sizeof(Modules) / sizeof(Modules[0]);
+
+static char *opalias[][2] =
+{
+  {"anomaly",             "ymonsub"    },
+  {"deltap_fl",           "deltap"     },
+  {"diffv",               "diffn"      },
+  {"covar0",              "timcovar"   },
+  {"covar0r",             "fldcovar"   },
+  {"ggstat",              "info"       },
+  {"ggstats",             "sinfo"      },
+  {"globavg",             "fldavg"     },
+  {"gradsdes",            "gradsdes2"  },
+  {"infos",               "sinfo"      },
+  {"infov",               "infon"      },
+  {"intgrid",             "intgridbil" },
+  {"log",                 "ln"         },
+  {"lmean",               "ymonmean"   },
+  {"lmmean",              "ymonmean"   },
+  {"lmavg",               "ymonavg"    },
+  {"lmstd",               "ymonstd"    },
+  {"lsmean",              "yseasmean"  },
+  {"chvar",               "chname"     },
+  {"ncode",               "npar"       },
+  {"nvar",                "npar"       },
+  {"outputkey",           "outputtab"  },
+  {"vardes",              "pardes"     },
+  {"delvar",              "delname"    },
+  {"vardup",              "pardup"     },
+  {"varmul",              "parmul"     },
+  {"read_e5ml",           "import_e5ml"},
+  {"remapcon1",           "remaplaf"   },
+  {"remapdis1",           "remapnn"    },
+  {"showvar",             "showname"   },
+  {"selgridname",         "selgrid"    },
+  {"selzaxisname",        "selzaxis"   },
+  {"selvar",              "selname"    },
+  {"setvar",              "setname"    },
+  {"setpartabv",          "setpartabn" },
+  {"sinfov",              "sinfon"     },
+  {"sortvar",             "sortname"   },
+  {"splitvar",            "splitname"  },
+  {"sort",                "timsort"    },
+  {"write_e5ml",          "export_e5ml"},
+  {"eca_r1mm",            "eca_rr1"    },
+  {"fpressure",           "pressure_fl"},
+  {"hpressure",           "pressure_hl"},
+  {"ensrkhistspace",      "ensrkhist_space"},
+  {"ensrkhisttime",       "ensrkhist_time"}
+};
+
+static int nopalias = sizeof(opalias) / (2*sizeof(opalias[0][0]));
+
+
+static
+int similar(const char *a, const char *b, int alen, int blen)
+{
+  if ( alen > 2 && blen > 2 && strstr(b, a) )
+    return TRUE;
+
+  while ( *a && *b && *a == *b )
+    { 
+      a++;
+      b++;
+    }
+  if ( !*a && !*b )
+    return TRUE;
+  /*
+    printf("%d %d %s %s\n", alen, blen, a, b);
+  */
+  if ( alen >= 2 && blen >= 1 && *a && similar(a+1, b, alen-2, blen-1) )
+    return TRUE;
+
+  if ( alen >= 1 && blen >= 2 && *b && similar(a, b+1, alen-1, blen-2) )
+    return TRUE;
+
+  return FALSE; 
+}
+
+
+char *operatorAlias(char *operatorName)
+{
+  char *operatorNameNew;
+  int i;
+
+  operatorNameNew = operatorName;
+
+  for ( i = 0; i < nopalias; i++ )
+    {
+      /*   printf("%d %d %s %s\n", nopalias, i, opalias[i][0], opalias[i][1]); */
+      if ( strcmp(operatorName, opalias[i][0]) == 0 ) break;
+    }
+
+  if ( i < nopalias )
+    {
+      /* fprintf(stdout, "%s is an alias for %s\n", operatorName, opalias[i][1]); */
+      operatorNameNew = opalias[i][1];
+    }
+
+  return (operatorNameNew);
+}
+
+static
+int operatorInqModID(char *operatorName)
+{
+  int i, j, modID = -1;
+
+  if ( operatorName )
+    {
+      for ( i = 0; i < NumModules; i++ )
+	{
+	  j = 0;
+	  for ( j = 0; j < MAX_MOD_OPERATORS; j++ )
+	    {
+	      if ( Modules[i].operators[j] == NULL ) break;
+
+	      if ( operatorName[0] == Modules[i].operators[j][0] )
+		{
+		  if ( strcmp(operatorName, Modules[i].operators[j]) == 0 )
+		    {
+		      modID = i;
+		      break;
+		    }
+		}
+	    }
+	  if ( modID != -1 ) break;
+	}
+    }
+
+  if ( modID == -1 && *operatorName == 0 )
+    Error("Operator name missing!");
+
+  if ( modID == -1 )
+    {
+      FILE *fp;
+      int nbyte;
+      int error = TRUE;
+      fp = fopen(operatorName, "r");
+      if ( fp )
+	{
+	  fclose(fp);
+	  fprintf(stderr, "Use commandline option -h for help.");
+	  Error("operator missing! %s is a file on disk!", operatorName);
+	}
+
+      fprintf(stderr, "Operator >%s< not found!\n", operatorName);
+      fprintf(stderr, "Similar operators are:\n");
+      nbyte = fprintf(stderr, "   ");
+      if ( operatorName )
+	for ( i = 0; i < NumModules; i++ )
+	  {
+	    if ( Modules[i].help == NULL ) continue;
+	    j = 0;
+	    while ( Modules[i].operators[j] )
+	      {
+		if( similar(operatorName, Modules[i].operators[j],
+			    strlen(operatorName), strlen(Modules[i].operators[j])) )
+		  {
+		    if ( nbyte > 75 )
+		      {
+			fprintf(stdout, "\n");
+			nbyte = fprintf(stderr, "   ");
+		      }
+		    nbyte += fprintf(stderr, " %s", Modules[i].operators[j]);
+		    error = FALSE ;
+		  }
+		j++;
+	      }
+	  }
+      if ( error )
+	fprintf(stderr, "(not found)\n") ;
+      else
+	fprintf(stderr, "\n");
+
+      exit(EXIT_FAILURE);
+    }
+
+  if ( modID != -1 )
+    if ( ! Modules[modID].func )
+      Error("Module for operator >%s< not installed!", operatorName);
+
+  return (modID);
+}
+
+void *(*operatorModule(char *operatorName))(void *)
+{
+  int modID;
+  modID = operatorInqModID(operatorName);
+  return (Modules[modID].func);
+}
+
+char **operatorHelp(char *operatorName)
+{
+  int modID;
+  modID = operatorInqModID(operatorName);
+  return (Modules[modID].help);
+}
+
+int operatorStreamInCnt(char *operatorName)
+{
+  int modID;
+  modID = operatorInqModID(operatorAlias(operatorName));
+  return (Modules[modID].streamInCnt);
+}
+
+int operatorStreamOutCnt(char *operatorName)
+{
+  int modID;
+  modID = operatorInqModID(operatorAlias(operatorName));
+  return (Modules[modID].streamOutCnt);
+}
+
+int operatorStreamNumber(char *operatorName)
+{
+  int modID;
+  modID = operatorInqModID(operatorAlias(operatorName));
+  return (Modules[modID].number);
+}
+
+int cmpname(const void *s1, const void *s2)
+{
+  char **c1 = (char **) s1;
+  char **c2 = (char **) s2;
+
+  return (strcmp((const char *)*c1, (const char *)*c2));
+}
+
+void operatorPrintAll(void)
+{
+  int i, j, nbyte, nop = 0;
+  char *opernames[4096];
+  FILE *pout = stderr;
+
+  for ( i = 0; i < NumModules; i++ )
+    {
+      j = 0;
+      while ( Modules[i].operators[j] )
+	{
+	  opernames[nop++] = Modules[i].operators[j++];
+	}
+    }
+  /*
+   * Add operator aliases
+   */
+  for ( i = 0; i < nopalias; i++ )
+    {
+      opernames[nop++] = opalias[i][0];
+    }
+
+  qsort(opernames, nop, sizeof(char *), cmpname);
+
+  nbyte = fprintf(pout, "   ");
+  for ( i = 0; i < nop; i++ )
+    {
+      if ( nbyte > 85 )
+	{
+	  fprintf(pout, "\n");
+	  nbyte = fprintf(pout, "   ");
+	}
+      nbyte += fprintf(pout, " %s", opernames[i]);
+    }
+  fprintf(pout, "\n");
+}
diff --git a/src/modules.h b/src/modules.h
new file mode 100644
index 0000000..e02a657
--- /dev/null
+++ b/src/modules.h
@@ -0,0 +1,31 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _MODULES_H
+#define _MODULES_H
+
+void *(*operatorModule(char *operatorName))(void *);
+
+char **operatorHelp(char *operatorName);
+
+int operatorStreamInCnt(char *operatorName);
+int operatorStreamOutCnt(char *operatorName);
+int operatorStreamNumber(char *operatorName);
+
+void operatorPrintAll(void);
+
+#endif  /* _MODULES_H */
diff --git a/src/namelist.c b/src/namelist.c
new file mode 100644
index 0000000..d5f68a8
--- /dev/null
+++ b/src/namelist.c
@@ -0,0 +1,584 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <stdarg.h>
+
+#include "namelist.h"
+
+#if ! defined (strdup)
+char *strdup(const char *s);
+#endif
+int readline(FILE *fp, char *line, int len);
+
+
+#define  func_1         -1 /* nptype */
+#define  func_2         -2 /* nptype */
+#define  func_3         -3 /* nptype */
+#define  NML_NIX         0 /* nptype */
+#define  NML_TEXTU       5
+#define  NML_TEXTL       6
+#define  NML_NPR         7
+#define  NML_NUMBER      8 /* nptype */
+#define  NML_KEYWORD     9 /* nptype */
+
+#define  PRINT_ALL       2
+#define  PRINT_MIN       3
+
+#undef   TRUE
+#define  TRUE   1
+#undef   FALSE
+#define  FALSE  0
+
+#undef   MIN
+#define  MIN(a,b)  ((a) < (b) ? (a) : (b))
+#undef   MAX
+#define  MAX(a,b)  ((a) > (b) ? (a) : (b))
+#undef   NINT
+#define  NINT(x)   ((x) < 0 ? (int)((x)-0.5) : (int)((x)+0.5))
+
+struct PGMSTAT
+{
+  int intract;
+};
+
+struct PGMSTAT pgmstat;
+
+
+static void namelist_init(namelist_t *namelist, const char *name)
+{
+  namelist->size = 0;
+  namelist->dis  = 1;
+  namelist->name = strdup(name);
+}
+
+
+namelist_t *namelistNew(const char *name)
+{
+  namelist_t *namelist;
+
+  namelist = (namelist_t *) malloc(sizeof(namelist_t));
+
+  namelist_init(namelist, name);
+
+  return (namelist);
+}
+
+
+void namelistDelete(namelist_t *nml)
+{
+  int i, iocc;
+
+  if ( nml )
+    {
+      for ( i = 0; i < nml->size; i++ )
+	{
+	  if ( nml->entry[i]->name ) free(nml->entry[i]->name);
+	  if ( nml->entry[i]->type == NML_WORD )
+	    for ( iocc = 0; iocc < nml->entry[i]->occ; iocc++ )
+	      {
+		if ( ((char **)nml->entry[i]->ptr)[iocc] )
+		  {
+		    free(((char **)nml->entry[i]->ptr)[iocc]);
+		    ((char **)nml->entry[i]->ptr)[iocc] = NULL;
+		  }
+	      }
+
+	  free(nml->entry[i]);
+	}
+      
+      if ( nml->name ) free(nml->name);
+      free(nml);
+    }
+}
+
+
+void namelistReset(namelist_t *nml)
+{
+  int i, iocc;
+
+  if ( nml )
+    {
+      for ( i = 0; i < nml->size; i++ )
+	{
+	  if ( nml->entry[i]->type == NML_WORD )
+	    for ( iocc = 0; iocc < nml->entry[i]->occ; iocc++ )
+	      {
+		if ( ((char **)nml->entry[i]->ptr)[iocc] )
+		  {
+		    free(((char **)nml->entry[i]->ptr)[iocc]);
+		    ((char **)nml->entry[i]->ptr)[iocc] = NULL;
+		  }
+	      }
+	  else if ( nml->entry[i]->type == NML_TEXT )
+	    ((char *)nml->entry[i]->ptr)[0] = 0;
+
+	  nml->entry[i]->occ = 0;
+	}
+    }
+}
+
+
+void namelistPrint(namelist_t *nml)
+{
+  nml_entry_t *entry;
+  int i, j, nout;
+
+  if ( nml == NULL ) return;
+
+  fprintf(stdout, "Namelist: %s\n", nml->name);
+  fprintf(stdout, " Num  Name             Type  Size   Dis   Occ  Entries\n");
+
+  for ( i = 0; i < nml->size; i++ )
+    {
+      entry = nml->entry[i];
+      fprintf(stdout, "%4d  %-16s %4d  %4d  %4d  %4d ",
+	      i+1, nml->entry[i]->name, nml->entry[i]->type, (int)nml->entry[i]->size,
+	      nml->entry[i]->dis, nml->entry[i]->occ);
+      nout = nml->entry[i]->occ;
+      if ( entry->type >= NML_TEXT )
+	{
+	  if ( nout > 32 ) nout = 32;
+	}
+      else
+	{
+	  if ( nout > 8 ) nout = 8;
+	}
+
+      if      ( entry->type >= NML_TEXT )
+	fprintf(stdout, "'%s'", ((char *)entry->ptr));
+      else if ( entry->type == NML_WORD )
+	for ( j = 0; j < nout; j++ )
+	  fprintf(stdout, " %s", ((char **)entry->ptr)[j]);
+      else if ( entry->type == NML_INT )
+	for ( j = 0; j < nout; j++ )
+	  fprintf(stdout, " %d", ((int *)entry->ptr)[j]);
+      else if ( entry->type == NML_FLT )
+	for ( j = 0; j < nout; j++ )
+	  fprintf(stdout, " %g", ((double *)entry->ptr)[j]);
+      
+      fprintf(stdout, "\n");
+    }
+}
+
+
+int namelistAdd(namelist_t *nml, const char *name, int type, int dis, void *ptr, size_t size)
+{
+  nml_entry_t *nml_entry;
+  int entry = 0;
+
+  if ( nml->size >= MAX_NML_ENTRY )
+    {
+      fprintf(stderr, "Too many namelist entries in %s! (Max = %d)\n", nml->name, MAX_NML_ENTRY);
+      return (-1);
+    }
+
+  nml_entry = (nml_entry_t *) malloc(sizeof(nml_entry_t));
+
+  nml_entry->name = strdup(name);
+  nml_entry->type = type;
+  nml_entry->ptr  = ptr;
+  nml_entry->size = size;
+  nml_entry->dis  = dis;
+  nml_entry->occ  = 0;
+
+  entry = nml->size;
+  nml->entry[nml->size++] = nml_entry;
+
+  return (entry);
+}
+
+
+int namelistNum(namelist_t *nml, const char *name)
+{
+  nml_entry_t *entry;
+  int i, nocc = 0;
+
+  if ( nml == NULL ) return (nocc);
+
+  for ( i = 0; i < nml->size; i++ )
+    {
+      entry = nml->entry[i];
+      if ( strcmp(name, entry->name) == 0 )
+	{
+	  nocc = entry->occ;
+	  break;
+	}
+    }
+
+  if ( i == nml->size )
+    fprintf(stderr, "Namelist entry %s not found in %s\n", name, nml->name);
+
+  return (nocc);
+}
+
+
+static void getnite(FILE *nmlfp, namelist_t *nml)
+{
+  int nst, i, j;
+  int linelen;
+
+  nst = nml->line.namitl + 1;
+
+  while ( TRUE )
+    {
+      for ( i = nst; i < MAX_LINE_LEN; i++ )
+	{
+	  if ( nml->line.linelc[i] == 0 ) break;
+
+          if      (   nml->line.linelc[i] == ' ' ) continue;
+	  else if (   nml->line.linelc[i] == '=' ) continue;
+          else if (   nml->line.linelc[i] == ',' ) continue;
+          else if ( ((nml->line.linelc[i] >= 'a')  &&
+		     (nml->line.linelc[i] <= 'z')) ||
+	             (nml->line.linelc[i] == '_')  ||
+	             (nml->line.linelc[i] == '/')  ||
+	             (nml->line.linelc[i] == '$')  ||
+		     (nml->line.linelc[i] == '&') )
+	    {
+	      nml->line.nptype = NML_KEYWORD;
+	      nml->line.namitf = i;
+	      for ( j = nml->line.namitf+1; j < MAX_LINE_LEN; j++ )
+		{
+		  if ( !(islower((int) nml->line.linelc[j]) ||
+			 (((int) nml->line.linelc[j]) == '_') ||
+			 isdigit((int) nml->line.linelc[j])) )
+		    {
+		      nml->line.namitl = j - 1;
+		      return;
+		    }
+		}
+	      nml->line.namitl = MAX_LINE_LEN;
+	      return;
+	    }
+          else if ( nml->line.linelc[i] == '\'' ||
+		    nml->line.linelc[i] == '\"' ||
+		    nml->line.linelc[i] == '`')
+	    {
+	      nml->line.nptype = NML_TEXT;
+	      nml->line.namitf = i;
+	      for ( j = nml->line.namitf+1; j < MAX_LINE_LEN; j++ )
+		if (nml->line.linelc[j] == nml->line.linelc[nml->line.namitf])
+		  {
+ 		    nml->line.namitl = j;
+		    return;
+		  }
+	      nml->line.namitl = MAX_LINE_LEN + 1;
+	      return;
+	    }
+          else if ( (nml->line.linelc[i] >= '0'  &&
+		     nml->line.linelc[i] <= '9') ||
+		     nml->line.linelc[i] == '+'  ||
+		     nml->line.linelc[i] == '-'  ||
+		     nml->line.linelc[i] == '.' )
+	    {
+	      nml->line.nptype = NML_NUMBER;
+	      nml->line.namitf = i;
+	      for ( j = i+1; j < MAX_LINE_LEN; j++)
+		{
+		  if ( nml->line.linelc[j] >= '0' && nml->line.linelc[j] <= '9' ) continue;
+	          else if ( nml->line.linelc[j] == '+' ) continue;
+		  else if ( nml->line.linelc[j] == '-' ) continue;
+         	  else if ( nml->line.linelc[j] == '.' ) continue;
+		  else if ( nml->line.linelc[j] == 'e' ) continue;
+                  else
+		    {
+		      nml->line.namitl = j - 1;
+		      return;
+		    }
+		}
+	      nml->line.namitl = MAX_LINE_LEN;
+	      return;
+	    }
+        }
+
+      if ( ! readline(nmlfp, nml->line.lineac, MAX_LINE_LEN) ) break;
+
+      linelen = strlen(nml->line.lineac);
+
+      for ( i = 0; i < linelen+1; i++ )
+	{
+	  nml->line.linelc[i] = tolower(nml->line.lineac[i]);
+	  nml->line.lineuc[i] = toupper(nml->line.lineac[i]);
+        }
+      nst = 0;
+    }
+
+  nml->line.nptype = NML_NIX;
+}
+
+
+static void rdnlsgl(namelist_t *nml, void *var, int ntyp, int nlen, int *nocc)
+{
+  if ( nml->line.nptype == NML_NUMBER )
+    {
+      if ( *nocc >= nlen )
+	{
+	  nml->line.nptype = func_1;
+          return;
+	}
+      else if ( ntyp == NML_INT )
+	{
+	  ((int *)var)[*nocc] = atoi(&nml->line.lineac[nml->line.namitf]);
+          *nocc += 1;
+	}
+      else if ( ntyp == NML_FLT )
+	{
+	  ((double *)var)[*nocc] = atof(&nml->line.lineac[nml->line.namitf]);
+          *nocc += 1;
+	}
+      else
+	{
+          nml->line.nptype = func_2;
+          return;
+        }
+    }
+  else if ( nml->line.nptype == NML_TEXT )
+    {
+      int i, j=0, newnocc;
+
+      newnocc = MIN(nlen, *nocc+nml->line.namitl-nml->line.namitf-1);
+
+      ((char *)var)[newnocc] = 0;
+      if      ( ntyp == NML_TEXT )
+	for (i=*nocc; i<newnocc; i++)
+	  ((char *)var)[i] = nml->line.lineac[nml->line.namitf+1+j++];
+      else if ( ntyp == NML_TEXTU )
+	for (i=*nocc; i<newnocc; i++)
+	  ((char *)var)[i] = nml->line.lineuc[nml->line.namitf+1+j++];
+      else if ( ntyp == NML_TEXTL )
+	for (i=*nocc; i<newnocc; i++)
+	  ((char *)var)[i] = nml->line.linelc[nml->line.namitf+1+j++];
+      else
+	{
+	  nml->line.nptype = func_3;
+	  return;
+	}
+
+      *nocc = newnocc;
+    }
+  else if ( nml->line.nptype == NML_WORD )
+    {
+      int i, len;
+
+      if ( *nocc < nlen )
+	{
+	  len = nml->line.namitl - nml->line.namitf + 1;
+	  ((char **)var)[*nocc] = (char*) calloc((size_t)len+1, sizeof(char));
+	  for ( i = 0; i < len; i++ )
+	    ((char **)var)[*nocc][i] = nml->line.lineac[nml->line.namitf+i];
+	  *nocc += 1;
+	}
+    }
+  else
+    {
+      fprintf(stderr, "Namelist parameter type %d unknown!\n", nml->line.nptype);
+      return;
+    }
+
+  nml->line.nptype = ntyp;
+}
+
+
+static void nml_print_entry(nml_entry_t *entry, int ife)
+{
+  int nout, j;
+
+  if ( entry->size == 0 ) return;
+
+  if ( entry->type == NML_NPR ) return;
+
+  nout = entry->occ;
+
+  if ( ife != PRINT_ALL )
+    if ( entry->occ > entry->dis ) nout = entry->dis;
+
+  if ( nout == 0 ) return;
+
+  printf(" %-24s", entry->name);
+
+  if      ( entry->type >= NML_TEXT )
+    printf("'%s'", ((char *)entry->ptr));
+  else if ( entry->type == NML_WORD )
+    for ( j = 0; j < nout; j++ )
+      printf(" %s", ((char **)entry->ptr)[j]);
+  else if ( entry->type == NML_INT )
+    for ( j = 0; j < nout; j++ )
+      printf(" %d", ((int *)entry->ptr)[j]);
+  else if ( entry->type == NML_FLT )
+    for ( j = 0; j < nout; j++ )
+      printf(" %g", ((double *)entry->ptr)[j]);
+
+  printf("\n");
+}
+
+
+static void nml_print(namelist_t *nml, int ife)
+{
+  int i;
+
+  for ( i = 0; i < nml->size; i++ )
+    nml_print_entry(nml->entry[i], ife);
+}
+
+#define  MAX_WORD_LEN  256
+
+void namelistRead(FILE *nmlfp, namelist_t *nml)
+{
+  /*
+    cn  name
+    nt  type
+    nl  size length
+    nc  occ count
+    no  dis list
+  */
+  int clear = FALSE;
+  int j, jj, match = -1, wordmatch = -1;
+  size_t len;
+  char namecx[MAX_WORD_LEN], *pnamecx = NULL;
+  int nparam;
+
+  nparam = nml->size;
+
+  nml->line.namitl = MAX_LINE_LEN;
+
+ L2000:
+
+  getnite(nmlfp, nml);
+
+  if ( nml->line.nptype == NML_NIX )
+    {
+      goto L3000;
+    }
+  else if ( nml->line.nptype == NML_KEYWORD )
+    {
+      memset(namecx, '\0', MAX_WORD_LEN);
+      len = (size_t) (nml->line.namitl - nml->line.namitf + 1);
+
+      if ( nml->line.lineac[nml->line.namitf] == '/' || 
+	   nml->line.lineac[nml->line.namitf] == '$' || 
+	   nml->line.lineac[nml->line.namitf] == '&' )
+	{
+          if ( nml->line.namitl-nml->line.namitf > MAX_WORD_LEN ) goto L3000;
+
+          if ( nml->line.namitf < nml->line.namitl)
+	    pnamecx = &nml->line.linelc[nml->line.namitf+1];
+
+	  if ( pnamecx )
+	    if ( memcmp(pnamecx, "select", 6) == 0 || 
+		 memcmp(pnamecx, "params", 6) == 0 || 
+		 memcmp(pnamecx, nml->name, strlen(nml->name)) == 0 )
+	      goto L2000;
+
+	  goto L3000;
+        }
+
+      if ( nml->line.namitl-nml->line.namitf >= MAX_WORD_LEN ) goto L3000;
+
+      pnamecx = &nml->line.linelc[nml->line.namitf];
+      memcpy(namecx, pnamecx, len);
+
+      if ( len == 5 )
+	if ( memcmp(pnamecx, "clear", len) == 0 )
+	  {
+	    clear = TRUE;
+	    goto L2000;
+	  }
+
+      match = -1;
+      for ( j = 0; j < nparam; j++ )
+	{
+	  if ( strlen(nml->entry[j]->name) == len )
+	    if ( memcmp(pnamecx, nml->entry[j]->name, len) == 0 )
+	      {
+		jj = j;
+		while ( nml->entry[jj]->type == NML_NPR ) jj--;
+		if ( match == -1 )
+		  match = jj;
+		else if ( match != jj )
+		  match = -2;
+		break;
+	      }
+	}
+
+      if ( match < 0 )
+	{
+	  if ( wordmatch >= 0 )
+	    {
+	      match = wordmatch;
+	      nml->line.nptype = NML_WORD;
+	      goto L777;
+	    }
+
+          printf(" * unidentified or ambiguous parameter <%s>\n", namecx);
+	  printf(" * valid parameters and values specified so far are\n");
+
+	  nml_print(nml, PRINT_ALL);
+
+          if ( ! pgmstat.intract )
+	    {
+	      fprintf(stderr, "Namelist error!\n");
+	      return;
+	    }
+        }
+      else
+	{
+          if ( clear ) nml->entry[match]->occ = 0;
+	  if ( nml->entry[match]->type == NML_WORD )
+	    wordmatch = match;
+	  else
+	    wordmatch = -1;
+        }
+      clear = FALSE;
+    }
+  else
+    {
+    L777:
+      j = match;
+      wordmatch = -1;
+
+      if ( j < 0 )
+	{
+	  fprintf(stderr, "Error in namelist!\n");
+	  goto L3000;
+	}
+
+      rdnlsgl(nml, nml->entry[j]->ptr, nml->entry[j]->type, (int)nml->entry[j]->size, &nml->entry[j]->occ);
+
+      if ( nml->line.nptype != nml->entry[j]->type )
+	{
+	  printf(" * value ignored for parameter <%s> %d\n", namecx, nml->line.nptype);
+	  printf(" * valid parameters and values specified so far are\n");
+
+	  nml_print(nml, PRINT_ALL);
+
+	  if ( ! pgmstat.intract ) fprintf(stderr, "Namelist error!\n");
+        }
+    }
+
+  goto L2000;
+
+ L3000:
+
+  if ( nml->dis == 0 ) return;
+
+  nml_print(nml, PRINT_MIN);
+}
+
diff --git a/src/namelist.h b/src/namelist.h
new file mode 100644
index 0000000..4378e43
--- /dev/null
+++ b/src/namelist.h
@@ -0,0 +1,74 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _NAMELIST_H
+#define _NAMELIST_H
+
+#include <stdio.h>
+
+
+#define  NML_INT         1
+#define  NML_FLT      2
+#define  NML_WORD        3
+#define  NML_TEXT        4
+
+#define NML_DEF_INT(name, size, val)  int sel##name[size]; int nsel##name = 0; int name = 0
+#define NML_DEF_FLT(name, size, val)  double sel##name[size]; int nsel##name = 0; double name = 0
+#define NML_ADD_INT(nml, name) namelistAdd(nml, #name, NML_INT, 0, sel##name, sizeof(sel##name)/sizeof(int))
+#define NML_ADD_FLT(nml, name) namelistAdd(nml, #name, NML_FLT, 0, sel##name, sizeof(sel##name)/sizeof(double))
+#define NML_NUM(nml, name)   nsel##name = namelistNum(nml, #name)
+#define NML_PAR(name)        nsel##name, sel##name, name
+
+#define MAX_NML_ENTRY  256
+
+#define MAX_LINE_LEN  4096
+
+typedef struct
+{
+  int nptype, namitf, namitl;
+  char lineac[MAX_LINE_LEN], lineuc[MAX_LINE_LEN], linelc[MAX_LINE_LEN];
+} nml_line_t;
+
+typedef struct
+{
+  char  *name;
+  void  *ptr;
+  int    type;
+  int    occ;
+  int    dis;
+  size_t size;
+} nml_entry_t;
+
+typedef struct
+{
+  int          size;
+  int          dis;
+  char        *name;
+  nml_line_t   line;
+  nml_entry_t *entry[MAX_NML_ENTRY];
+} namelist_t;
+
+
+namelist_t *namelistNew(const char *name);
+void namelistDelete(namelist_t *nml);
+void namelistReset(namelist_t *nml);
+int  namelistAdd(namelist_t *nml, const char *name, int type, int dis, void *ptr, size_t size);
+void namelistPrint(namelist_t *nml);
+void namelistRead(FILE *nmlfp, namelist_t *nml);
+int  namelistNum(namelist_t *nml, const char *name);
+
+#endif  /* _NAMELIST_H */
diff --git a/src/normal.c b/src/normal.c
new file mode 100644
index 0000000..d028489
--- /dev/null
+++ b/src/normal.c
@@ -0,0 +1,17 @@
+#include <cdi.h>
+#include "cdo.h"
+
+void nospec(int vlistID)
+{
+  int gridID, gridtype;
+  int varID, nvars;
+
+  nvars = vlistNvars(vlistID);
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      gridID = vlistInqVarGrid(vlistID, varID);
+      gridtype = gridInqType(gridID);
+      if ( gridtype == GRID_SPECTRAL )
+	cdoAbort("Operator not defined for spectral fields");
+    }
+}
diff --git a/src/nth_element.c b/src/nth_element.c
new file mode 100644
index 0000000..ae47a86
--- /dev/null
+++ b/src/nth_element.c
@@ -0,0 +1,71 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+#include <assert.h>
+#include <stdlib.h>
+#include "nth_element.h"
+
+#define SWAP(a, b) {t = (a); (a) = (b); (b) = t;}
+
+double nth_element(double array[], int length, int n)
+{
+  int i, j, k = 0, l = length-1, m;
+  double a,t;
+
+  assert( array != NULL );
+  assert( l >= 0 );
+  assert( n >= 0 );
+  assert( n <= l );
+
+  for ( ; ; )
+    {
+      if ( l <= k+1 )
+        { 
+          if ( l == k+1 && array[l] < array[k] ) 
+            SWAP(array[k], array[l])
+          return array[n];
+        } 
+      else 
+        {
+          m = (k+l) >> 1; 
+          SWAP(array[m],array[k+1]);
+          
+          if ( array[k] > array[l] ) 
+            SWAP(array[k], array[l])
+          if ( array[k+1] > array[l] ) 
+            SWAP(array[k+1], array[l])
+          if ( array[k] > array[k+1] ) 
+            SWAP(array[k], array[k+1])
+
+          i = k+1; 
+          j = l;
+          a = array[k+1]; 
+
+          for ( ; ; ) 
+            { 
+              do i++; while ( array[i] < a ); 
+              do j--; while ( array[j] > a ); 
+              if ( j < i ) break; 
+              SWAP(array[i], array[j])
+            } 
+
+          array[k+1] = array[j]; 
+          array[j] = a;
+          if ( j >= n ) l = j-1; 
+          if ( j <= n ) k = i; 
+        }
+    }
+}
diff --git a/src/nth_element.h b/src/nth_element.h
new file mode 100644
index 0000000..0ccba51
--- /dev/null
+++ b/src/nth_element.h
@@ -0,0 +1,39 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef NTH_ELEMENT_H_
+#define NTH_ELEMENT_H_
+
+/**
+ * Finds the nth smallest value of an array of values. The array elements
+ * are rearranged as far as necessary to get the nth element to its proper
+ * position, with no element less than the nth element placed after it.
+ * Based on the Quicksort algorithm.
+ * 
+ * @param array   the array
+ * @param length  the length of the array
+ * @param n       the ordinal number of the element to be found. Must be
+ *                in the interval [0, length - 1]
+ * 
+ * @return the nth smallest value in the input array
+ * 
+ * @author Ralf Quast
+ * @version 1.0
+ */
+double nth_element(double array[], int length, int n);
+
+#endif /*NTH_ELEMENT_H_*/
diff --git a/src/operator_help.h b/src/operator_help.h
new file mode 100644
index 0000000..c96d1ca
--- /dev/null
+++ b/src/operator_help.h
@@ -0,0 +1,4771 @@
+/* Automatically created with makedoc, don't edit! */
+
+static char *InfoHelp[] = {
+    "NAME",
+    "    info, infon, map - Information and simple statistics",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifiles",
+    "",
+    "DESCRIPTION",
+    "    This module writes information about the structure and contents ",
+    "    of all input files to standard output.  All input files need to have ",
+    "    the same structure with the same variables on different timesteps.",
+    "    The information displayed depends on the chosen operator.",
+    "",
+    "OPERATORS",
+    "    info   Dataset information listed by parameter identifier",
+    "           Prints information and simple statistics for each field of all",
+    "           input datasets. For each field the operator prints one line with ",
+    "           the following elements:",
+    "           - Date and Time",
+    "           - Level, Gridsize and number of Missing values",
+    "           - Minimum, Mean and Maximum \\",
+    "           The mean value is computed without the use of area weights!",
+    "           - Parameter identifier",
+    "    infon  Dataset information listed by parameter name",
+    "           The same as operator info but using the name instead of the",
+    "           identifier to label the parameter.",
+    "    map    Dataset information and simple map",
+    "           Prints information, simple statistics and a map for each field of all input",
+    "           datasets. The map will be printed only for fields on a regular lon/lat grid.",
+    NULL
+};
+
+static char *SinfoHelp[] = {
+    "NAME",
+    "    sinfo, sinfon - Short information",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifiles",
+    "",
+    "DESCRIPTION",
+    "    This module writes information about the structure of ifiles to standard output.",
+    "    ifiles is an unlimited number of input files. All input files need to have ",
+    "    the same structure with the same variables on different timesteps.",
+    "    The information displayed depends on the chosen operator.",
+    "",
+    "OPERATORS",
+    "    sinfo   Short information listed by parameter identifier",
+    "            Prints short information of a dataset. The information is divided into",
+    "            4 sections. Section 1 prints one line per parameter with the following ",
+    "            information:",
+    "            - institute and source",
+    "            - timestep type",
+    "            - number of levels and z-axis number",
+    "            - horizontal grid size and number",
+    "            - data type",
+    "            - parameter identifier",
+    "            Section 2 and 3 gives a short overview of all grid and vertical coordinates.",
+    "            And the last section contains short information of the time coordinate.",
+    "    sinfon  Short information listed by parameter name",
+    "            The same as operator sinfo but using the name instead of the ",
+    "            identifier to label the parameter.",
+    NULL
+};
+
+static char *DiffHelp[] = {
+    "NAME",
+    "    diff, diffn - Compare two datasets field by field",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile1 ifile2",
+    "",
+    "DESCRIPTION",
+    "    Compares the contents of two datasets field by field. The input",
+    "    datasets need to have the same structure and its fields need to have ",
+    "    the same header information and dimensions.",
+    "",
+    "OPERATORS",
+    "    diff   Compare two datasets listed by parameter id",
+    "           Provides statistics on differences between two datasets.",
+    "           For each pair of fields the operator prints one line with the following information:",
+    "           - Date and Time",
+    "           - Level, Gridsize and number of Missing values",
+    "           - Occurrence of coefficient pairs with different signs (S)",
+    "           - Occurrence of zero values (Z)",
+    "           - Maxima of absolute difference of coefficient pairs",
+    "           - Maxima of relative difference of non-zero coefficient pairs with equal signs",
+    "           - Parameter identifier",
+    "    diffn  Compare two datasets listed by parameter name",
+    "           The same as operator diff. Using the name instead of the",
+    "           identifier to label the parameter.",
+    NULL
+};
+
+static char *NinfoHelp[] = {
+    "NAME",
+    "    npar, nlevel, nyear, nmon, ndate, ntime - ",
+    "    Print the number of parameters, levels or times",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile",
+    "",
+    "DESCRIPTION",
+    "    This module prints the number of variables, levels or times of the ",
+    "    input dataset.",
+    "",
+    "OPERATORS",
+    "    npar    Number of parameters",
+    "            Prints the number of parameters (variables).",
+    "    nlevel  Number of levels",
+    "            Prints the number of levels for each variable.",
+    "    nyear   Number of years",
+    "            Prints the number of different years.",
+    "    nmon    Number of months",
+    "            Prints the number of different combinations of years and months.",
+    "    ndate   Number of dates",
+    "            Prints the number of different dates.",
+    "    ntime   Number of timesteps",
+    "            Prints the number of timesteps.",
+    NULL
+};
+
+static char *ShowinfoHelp[] = {
+    "NAME",
+    "    showformat, showcode, showname, showstdname, showlevel, showltype, showyear, ",
+    "    showmon, showdate, showtime, showtimestamp - Show variables, levels or times",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile",
+    "",
+    "DESCRIPTION",
+    "    This module prints the format, variables, levels or times of the input dataset.",
+    "",
+    "OPERATORS",
+    "    showformat     Show file format",
+    "                   Prints the file format of the input dataset.",
+    "    showcode       Show code numbers",
+    "                   Prints the code number of all variables.",
+    "    showname       Show variable names",
+    "                   Prints the name of all variables.",
+    "    showstdname    Show standard names",
+    "                   Prints the standard name of all variables.",
+    "    showlevel      Show levels",
+    "                   Prints all levels for each variable.",
+    "    showltype      Show GRIB level types",
+    "                   Prints the GRIB level type for all z-axes.",
+    "    showyear       Show years",
+    "                   Prints all years.",
+    "    showmon        Show months",
+    "                   Prints all months.",
+    "    showdate       Show date information",
+    "                   Prints date information of all timesteps (format YYYY-MM-DD).",
+    "    showtime       Show time information",
+    "                   Prints time information of all timesteps (format hh:mm:ss).",
+    "    showtimestamp  Show timestamp",
+    "                   Prints timestamp of all timesteps (format YYYY-MM-DDThh:mm:ss).",
+    NULL
+};
+
+static char *FiledesHelp[] = {
+    "NAME",
+    "    pardes, griddes, zaxisdes, vct - Dataset description",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile",
+    "",
+    "DESCRIPTION",
+    "    This module prints the description of the parameters, the grids,",
+    "    the z-axis or the vertical coordinate table.",
+    "",
+    "OPERATORS",
+    "    pardes    Parameter description",
+    "              Prints a table with a description of all variables.",
+    "              For each variable the operator prints one line listing the",
+    "              code, name, description and units.",
+    "    griddes   Grid description",
+    "              Prints the description of all grids.",
+    "    zaxisdes  Z-axis description",
+    "              Prints the description of all z-axes.",
+    "    vct       Vertical coordinate table",
+    "              Prints the vertical coordinate table.",
+    NULL
+};
+
+static char *CopyHelp[] = {
+    "NAME",
+    "    copy, cat - Copy datasets",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifiles ofile",
+    "",
+    "DESCRIPTION",
+    "    This module contains operators to copy or concatenate datasets.",
+    "    ifiles is an unlimited number of input files. All input files need to have ",
+    "    the same structure with the same variables on different timesteps.",
+    "",
+    "OPERATORS",
+    "    copy  Copy datasets",
+    "          Copies all input datasets to ofile. ",
+    "    cat   Concatenate datasets",
+    "          Concatenates all input datasets and appends the result to the end ",
+    "          of ofile. If ofile does not exist it will be created.",
+    NULL
+};
+
+static char *ReplaceHelp[] = {
+    "NAME",
+    "    replace - Replace variables",
+    "",
+    "SYNOPSIS",
+    "    replace  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    The replace operator replaces variables of ifile1 with variables from ifile2 and write",
+    "    the result to ofile. Both input datasets need to have the same number of timesteps.",
+    NULL
+};
+
+static char *MergeHelp[] = {
+    "NAME",
+    "    merge, mergetime - Merge datasets",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifiles ofile",
+    "",
+    "DESCRIPTION",
+    "    This module reads datasets from several input files,",
+    "    merges them and writes the resulting dataset to ofile.",
+    "",
+    "OPERATORS",
+    "    merge      Merge datasets with different fields",
+    "               Merges time series of different fields from several input datasets.",
+    "               The number of fields per timestep written to ofile",
+    "               is the sum of the field numbers per timestep in all input datasets.",
+    "               The time series on all input datasets are required to have different",
+    "               fields and the same number of timesteps.",
+    "               The fields in each different input file either have to be different variables",
+    "               or different levels of the same variable. A mixture of different variables on",
+    "               different levels in different input files is not allowed.",
+    "    mergetime  Merge datasets sorted by date and time",
+    "               Merges all timesteps of all input files sorted by date and time.",
+    "               All input files need to have the same structure with the same variables ",
+    "               on different timesteps.",
+    "               After this operation every input timestep is in ofile and",
+    "               all timesteps are sorted by date and time.",
+    "",
+    "ENVIRONMENT",
+    "    SKIP_SAME_TIME",
+    "        If set to 1, skips all timesteps with a double entry of the same timestamp.",
+    NULL
+};
+
+static char *SplitHelp[] = {
+    "NAME",
+    "    splitcode, splitparam, splitname, splitlevel, splitgrid, splitzaxis, ",
+    "    splittabnum - Split a dataset",
+    "",
+    "SYNOPSIS",
+    "    <operator>[,swap]  ifile obase",
+    "",
+    "DESCRIPTION",
+    "    This module splits ifile into pieces. The output files will be named <obase><xxx><suffix>",
+    "    where suffix is the filename extension derived from the file format. xxx and the contents ",
+    "    of the output files depends on the chosen operator. ",
+    "",
+    "OPERATORS",
+    "    splitcode    Split code numbers",
+    "                 Splits a dataset into pieces, one for each different code number.",
+    "                 xxx will have three digits with the code number.",
+    "    splitparam   Split parammeter identifiers",
+    "                 Splits a dataset into pieces, one for each different parammeter identifier.",
+    "                 xxx will be a string with the parammeter identifier.",
+    "    splitname    Split variable names",
+    "                 Splits a dataset into pieces, one for each variable name.",
+    "                 xxx will be a string with the variable name.",
+    "    splitlevel   Split levels",
+    "                 Splits a dataset into pieces, one for each different level.",
+    "                 xxx will have six digits with the level.",
+    "    splitgrid    Split grids",
+    "                 Splits a dataset into pieces, one for each different grid.",
+    "                 xxx will have two digits with the grid number.",
+    "    splitzaxis   Split z-axes",
+    "                 Splits a dataset into pieces, one for each different z-axis.",
+    "                 xxx will have two digits with the z-axis number.",
+    "    splittabnum  Split parameter table numbers",
+    "                 Splits a dataset into pieces, one for each GRIB1 parameter table number.",
+    "                 xxx will have three digits with the GRIB1 parameter table number.",
+    "",
+    "PARAMETER",
+    "    swap  STRING  Swap the position of obase and xxx in the output filename",
+    "",
+    "ENVIRONMENT",
+    "    CDO_FILE_SUFFIX",
+    "        This environment variable can be used to set the default file suffix. This suffix will be",
+    "        added to the output file names instead of the filename extension derived from the file format. ",
+    "        Set this variable to NULL to disable the adding of a file suffix.",
+    NULL
+};
+
+static char *SplittimeHelp[] = {
+    "NAME",
+    "    splithour, splitday, splitmon, splitseas, splityear - ",
+    "    Split timesteps of a dataset",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile obase",
+    "",
+    "DESCRIPTION",
+    "    This module splits ifile into  timesteps pieces. The output files will be named",
+    "    <obase><xxx><suffix> where suffix is the filename extension derived from the file format. ",
+    "    xxx and the contents of the output files depends on the chosen operator. ",
+    "",
+    "OPERATORS",
+    "    splithour  Split hours",
+    "               Splits a file into pieces, one for each different hour.",
+    "               xxx will have two digits with the hour.",
+    "    splitday   Split days",
+    "               Splits a file into pieces, one for each different day.",
+    "               xxx will have two digits with the day.",
+    "    splitmon   Split months",
+    "               Splits a file into pieces, one for each different month.",
+    "               xxx will have two digits with the month.",
+    "    splitseas  Split seasons",
+    "               Splits a file into pieces, one for each different season.",
+    "               xxx will have three characters with the season.",
+    "    splityear  Split years",
+    "               Splits a file into pieces, one for each different year.",
+    "               xxx will have four digits with the year.",
+    "",
+    "ENVIRONMENT",
+    "    CDO_FILE_SUFFIX",
+    "        This environment variable can be used to set the default file suffix. This suffix will be",
+    "        added to the output file names instead of the filename extension derived from the file format. ",
+    "        Set this variable to NULL to disable the adding of a file suffix.",
+    NULL
+};
+
+static char *SplitselHelp[] = {
+    "NAME",
+    "    splitsel - Split selected timesteps",
+    "",
+    "SYNOPSIS",
+    "    splitsel,nsets[,noffset[,nskip]]  ifile obase",
+    "",
+    "DESCRIPTION",
+    "    This operator splits ifile into pieces, one for each adjacent",
+    "    sequence t_1, ...., t_n of timesteps of the same selected time range.",
+    "    The output files will be named <obase><nnnnnn><suffix> where nnnnnn is the ",
+    "    sequence number and suffix is the filename extension derived from the file format.",
+    "",
+    "PARAMETER",
+    "    nsets    INTEGER  Number of input timesteps for each output file",
+    "    noffset  INTEGER  Number of input timesteps skipped before the first timestep range (optional)",
+    "    nskip    INTEGER  Number of input timesteps skipped between timestep ranges (optional)",
+    "",
+    "ENVIRONMENT",
+    "    CDO_FILE_SUFFIX",
+    "        This environment variable can be used to set the default file suffix. This suffix will be",
+    "        added to the output file names instead of the filename extension derived from the file format. ",
+    "        Set this variable to NULL to disable the adding of a file suffix.",
+    NULL
+};
+
+static char *SelvarHelp[] = {
+    "NAME",
+    "    selparam, delparam, selcode, delcode, selname, delname, selstdname, sellevel, ",
+    "    sellevidx, selgrid, selzaxis, selltype, seltabnum - Select fields",
+    "",
+    "SYNOPSIS",
+    "    selparam,params  ifile ofile",
+    "    delparam,params  ifile ofile",
+    "    selcode,codes  ifile ofile",
+    "    delcode,codes  ifile ofile",
+    "    selname,names  ifile ofile",
+    "    delname,names  ifile ofile",
+    "    selstdname,stdnames  ifile ofile",
+    "    sellevel,levels  ifile ofile",
+    "    sellevidx,levidx  ifile ofile",
+    "    selgrid,grids  ifile ofile",
+    "    selzaxis,zaxes  ifile ofile",
+    "    selltype,ltypes  ifile ofile",
+    "    seltabnum,tabnums  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module selects some fields from ifile and writes them to ofile.",
+    "    The fields selected depends on the chosen operator and the parameters.",
+    "",
+    "OPERATORS",
+    "    selparam    Select parameters by identifier",
+    "                Selects all fields with parameter identifiers in a user given list.",
+    "    delparam    Delete parameters by identifier",
+    "                Deletes all fields with parameter identifiers in a user given list.",
+    "    selcode     Select parameters by code number",
+    "                Selects all fields with code numbers in a user given list.",
+    "    delcode     Delete parameters by code number",
+    "                Deletes all fields with code numbers in a user given list.",
+    "    selname     Select parameters by name",
+    "                Selects all fields with parameter names in a user given list.",
+    "    delname     Delete parameters by name",
+    "                Deletes all fields with parameter names in a user given list.",
+    "    selstdname  Select parameters by standard name",
+    "                Selects all fields with standard names in a user given list.",
+    "    sellevel    Select levels",
+    "                Selects all fields with levels in a user given list.",
+    "    sellevidx   Select levels by index",
+    "                Selects all fields with index of levels in a user given list.",
+    "    selgrid     Select grids",
+    "                Selects all fields with grids in a user given list.",
+    "    selzaxis    Select z-axes",
+    "                Selects all fields with z-axes in a user given list.",
+    "    selltype    Select GRIB level types",
+    "                Selects all fields with GRIB level type in a user given list.",
+    "    seltabnum   Select parameter table numbers",
+    "                Selects all fields with parameter table numbers in a user given list.",
+    "",
+    "PARAMETER",
+    "    params    INTEGER  Comma separated list of parameter identifiers",
+    "    codes     INTEGER  Comma separated list of code numbers",
+    "    names     STRING   Comma separated list of variable names",
+    "    stdnames  STRING   Comma separated list of standard names",
+    "    levels    FLOAT    Comma separated list of levels",
+    "    levidx    INTEGER  Comma separated list of index of levels",
+    "    ltypes    INTEGER  Comma separated list of GRIB level types",
+    "    grids     STRING   Comma separated list of grid names or numbers",
+    "    zaxes     STRING   Comma separated list of z-axis names or numbers",
+    "    tabnums   INTEGER  Comma separated list of parameter table numbers",
+    NULL
+};
+
+static char *SeltimeHelp[] = {
+    "NAME",
+    "    seltimestep, seltime, selhour, selday, selmon, selyear, selseas, seldate, ",
+    "    selsmon - Select timesteps",
+    "",
+    "SYNOPSIS",
+    "    seltimestep,timesteps  ifile ofile",
+    "    seltime,times  ifile ofile",
+    "    selhour,hours  ifile ofile",
+    "    selday,days  ifile ofile",
+    "    selmon,months  ifile ofile",
+    "    selyear,years  ifile ofile",
+    "    selseas,seasons  ifile ofile",
+    "    seldate,date1[,date2]  ifile ofile",
+    "    selsmon,month[,nts1[,nts2]]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module selects user specified timesteps from ifile and writes them to ofile.",
+    "    The timesteps selected depends on the chosen operator and the parameters.",
+    "",
+    "OPERATORS",
+    "    seltimestep  Select timesteps",
+    "                 Selects all timesteps with a timestep in a user given list.",
+    "    seltime      Select times",
+    "                 Selects all timesteps with a time in a user given list.",
+    "    selhour      Select hours",
+    "                 Selects all timesteps with a hour in a user given list.",
+    "    selday       Select days",
+    "                 Selects all timesteps with a day in a user given list.",
+    "    selmon       Select months",
+    "                 Selects all timesteps with a month in a user given list.",
+    "    selyear      Select years",
+    "                 Selects all timesteps with a year in a user given list.",
+    "    selseas      Select seasons",
+    "                 Selects all timesteps with a month of a season in a user given list.",
+    "    seldate      Select dates",
+    "                 Selects all timesteps with a date in a user given range.",
+    "    selsmon      Select single month",
+    "                 Selects a month and optional an unlimited number of timesteps before and after this month.",
+    "",
+    "PARAMETER",
+    "    timesteps  INTEGER  Comma separated list of timesteps",
+    "    times      STRING   Comma separated list of times (format hh:mm:ss)",
+    "    hours      INTEGER  Comma separated list of hours",
+    "    days       INTEGER  Comma separated list of days",
+    "    months     INTEGER  Comma separated list of months",
+    "    years      INTEGER  Comma separated list of years",
+    "    seasons    STRING   Comma separated list of seasons (DJF, MAM, JJA, SON)",
+    "    date1      STRING   Start date (format YYYY-MM-DDThh:mm:ss)",
+    "    date2      STRING   End date (format YYYY-MM-DDThh:mm:ss) [default: date1]",
+    "    nts1       INTEGER  Number of timesteps before the selected month [default: 0]",
+    "    nts2       INTEGER  Number of timesteps after the selected month [default: nts1]",
+    NULL
+};
+
+static char *SelboxHelp[] = {
+    "NAME",
+    "    sellonlatbox, selindexbox - Select a box of a field",
+    "",
+    "SYNOPSIS",
+    "    sellonlatbox,lon1,lon2,lat1,lat2  ifile ofile",
+    "    selindexbox,idx1,idx2,idy1,idy2  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Selects a box of the rectangular understood field.",
+    "    All input fields need to have the same horizontal grid.",
+    "",
+    "OPERATORS",
+    "    sellonlatbox  Select a longitude/latitude box",
+    "                  Selects a longitude/latitude box. The user has to give the ",
+    "                  longitudes and latitudes of the edges of the box. ",
+    "                  Considered are only those grid cells with the grid center inside the lon/lat box.",
+    "    selindexbox   Select an index box",
+    "                  Selects an index box. The user has to give the indexes of the ",
+    "                  edges of the box. The index of the left edge may be greater ",
+    "                  then that of the right edge.",
+    "",
+    "PARAMETER",
+    "    lon1  FLOAT    Western longitude",
+    "    lon2  FLOAT    Eastern longitude",
+    "    lat1  FLOAT    Southern or northern latitude",
+    "    lat2  FLOAT    Northern or southern latitude",
+    "    idx1  INTEGER  Index of first longitude",
+    "    idx2  INTEGER  Index of last longitude",
+    "    idy1  INTEGER  Index of first latitude",
+    "    idy2  INTEGER  Index of last latitude",
+    NULL
+};
+
+static char *CondHelp[] = {
+    "NAME",
+    "    ifthen, ifnotthen - Conditional select one field",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    This module selects field elements from ifile2 with respect to ifile1 and writes them ",
+    "    to ofile. The fields in ifile1 are handled as a mask. A value ",
+    "    not equal to zero is treated as \"true\", zero is treated as \"false\".",
+    "    The number of fields in ifile1 has either to be the same as in ifile2 or the",
+    "    same as in one timestep of ifile2 or only one.",
+    "    The fields in ofile inherit the meta data from ifile2.",
+    "",
+    "OPERATORS",
+    "    ifthen     If then",
+    "                        / i_2(t,x) if i_1([t,]x) NE 0  AND  i_1([t,]x) NE miss",
+    "               o(t,x) =",
+    "                        \\ miss     if i_1([t,]x) EQ 0  OR   i_1([t,]x) EQ miss",
+    "    ifnotthen  If not then",
+    "                        / i_2(t,x) if i_1([t,]x) EQ 0  AND  i_1([t,]x) NE miss",
+    "               o(t,x) = ",
+    "                        \\ miss     if i_1([t,]x) NE 0  OR   i_1([t,]x) EQ miss",
+    NULL
+};
+
+static char *Cond2Help[] = {
+    "NAME",
+    "    ifthenelse - Conditional select  two fields",
+    "",
+    "SYNOPSIS",
+    "    ifthenelse  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator selects field elements from ifile2 or ifile3 with respect to",
+    "    ifile1 and writes them to ofile. The fields in ifile1 are handled as a mask.",
+    "    A value not equal to zero is treated as \"true\", zero is treated as \"false\".",
+    "    The number of fields in ifile1 has either to be the same as in ifile2 or the ",
+    "    same as in one timestep of ifile2 or only one.",
+    "    ifile2 and ifile3 need to have the same number of fields.",
+    "    The fields in ofile inherit the meta data from ifile2.",
+    "    ",
+    "              / i_2(t,x) if i_1([t,]x) NE 0  AND  i_1([t,]x) NE miss",
+    "    o(t,x) = <  i_3(t,x) if i_1([t,]x) EQ 0  AND  i_1([t,]x) NE miss",
+    "              \\ miss     if i_1([t,]x) EQ miss",
+    NULL
+};
+
+static char *CondcHelp[] = {
+    "NAME",
+    "    ifthenc, ifnotthenc - Conditional select a constant",
+    "",
+    "SYNOPSIS",
+    "    <operator>,c  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module creates fields with a constant value or missing value.",
+    "    The fields in ifile are handled as a mask. A value not equal ",
+    "    to zero is treated as \"true\", zero is treated as \"false\".",
+    "",
+    "OPERATORS",
+    "    ifthenc     If then constant",
+    "                         / c      if i(t,x) NE 0  AND  i(t,x) NE miss",
+    "                o(t,x) =",
+    "                         \\ miss   if i(t,x) EQ 0  OR   i(t,x) EQ miss",
+    "    ifnotthenc  If not then constant",
+    "                         / c      if i(t,x) EQ 0  AND  i(t,x) NE miss",
+    "                o(t,x) =",
+    "                         \\ miss   if i(t,x) NE 0  OR   i(t,x) EQ miss",
+    "",
+    "PARAMETER",
+    "    c  FLOAT  Constant",
+    NULL
+};
+
+static char *CompHelp[] = {
+    "NAME",
+    "    eq, ne, le, lt, ge, gt - Comparison of two fields",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    This module compares two datasets field by field. The resulting",
+    "    field is a mask containing 1 if the comparison is true and 0 if not. ",
+    "    The number of fields in ifile1 should be the same as in ifile2.",
+    "    One of the input files can contain only one timestep or one field.",
+    "    The fields in ofile inherit the meta data from ifile1 or ifile2.",
+    "    The type of comparison depends on the chosen operator.",
+    "",
+    "OPERATORS",
+    "    eq  Equal",
+    "                  /   1   if i_1(t,x) EQ i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "        o(t,x) = <    0   if i_1(t,x) NE i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "                  \\  miss if i_1(t,x) EQ miss      OR   i_2(t,x) EQ miss",
+    "    ne  Not equal",
+    "                  /   1   if i_1(t,x) NE i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "        o(t,x) = <    0   if i_1(t,x) EQ i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "                  \\  miss if i_1(t,x) EQ miss      OR   i_2(t,x) EQ miss",
+    "    le  Less equal",
+    "                  /   1   if i_1(t,x) LE i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "        o(t,x) = <    0   if i_1(t,x) GT i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "                  \\  miss if i_1(t,x) EQ miss      OR   i_2(t,x) EQ miss",
+    "    lt  Less than",
+    "                  /   1   if i_1(t,x) LT i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "        o(t,x) = <    0   if i_1(t,x) GE i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "                  \\  miss if i_1(t,x) EQ miss      OR   i_2(t,x) EQ miss",
+    "    ge  Greater equal",
+    "                  /   1   if i_1(t,x) GE i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "        o(t,x) = <    0   if i_1(t,x) LT i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "                  \\  miss if i_1(t,x) EQ miss      OR   i_2(t,x) EQ miss",
+    "    gt  Greater than",
+    "                  /   1   if i_1(t,x) GT i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "        o(t,x) = <    0   if i_1(t,x) LE i_2(t,x)  AND  i_1(t,x),i_2(t,x) NE miss",
+    "                  \\  miss if i_1(t,x) EQ miss      OR   i_2(t,x) EQ miss",
+    NULL
+};
+
+static char *CompcHelp[] = {
+    "NAME",
+    "    eqc, nec, lec, ltc, gec, gtc - Comparison of a field with a constant",
+    "",
+    "SYNOPSIS",
+    "    <operator>,c  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module compares all fields of a dataset with a constant. The resulting",
+    "    field is a mask containing 1 if the comparison is true and 0 if not.",
+    "    The type of comparison depends on the chosen operator.",
+    "",
+    "OPERATORS",
+    "    eqc  Equal constant",
+    "                   /   1   if i(t,x) EQ c     AND  i(t,x),c NE miss",
+    "         o(t,x) = <    0   if i(t,x) NE c     AND  i(t,x),c NE miss",
+    "                   \\  miss if i(t,x) EQ miss  OR   c EQ miss",
+    "    nec  Not equal constant",
+    "                   /   1   if i(t,x) NE c     AND  i(t,x),c NE miss",
+    "         o(t,x) = <    0   if i(t,x) EQ c     AND  i(t,x),c NE miss",
+    "                   \\  miss if i(t,x) EQ miss  OR   c EQ miss",
+    "    lec  Less equal constant",
+    "                   /   1   if i(t,x) LE c     AND  i(t,x),c NE miss",
+    "         o(t,x) = <    0   if i(t,x) GT c     AND  i(t,x),c NE miss",
+    "                   \\  miss if i(t,x) EQ miss  OR   c EQ miss",
+    "    ltc  Less than constant",
+    "                   /   1   if i(t,x) LT c     AND  i(t,x),c NE miss",
+    "         o(t,x) = <    0   if i(t,x) GE c     AND  i(t,x),c NE miss",
+    "                   \\  miss if i(t,x) EQ miss  OR   c EQ miss",
+    "    gec  Greater equal constant",
+    "                   /   1   if i(t,x) GE c     AND  i(t,x),c NE miss",
+    "         o(t,x) = <    0   if i(t,x) LT c     AND  i(t,x),c NE miss",
+    "                   \\  miss if i(t,x) EQ miss  OR   c EQ miss",
+    "    gtc  Greater than constant",
+    "                   /   1   if i(t,x) GT c     AND  i(t,x),c NE miss",
+    "         o(t,x) = <    0   if i(t,x) LE c     AND  i(t,x),c NE miss",
+    "                   \\  miss if i(t,x) EQ miss  OR   c EQ miss",
+    "",
+    "PARAMETER",
+    "    c  FLOAT  Constant",
+    NULL
+};
+
+static char *SetHelp[] = {
+    "NAME",
+    "    setpartab, setcode, setparam, setname, setunit, setlevel, setltype - ",
+    "    Set field info",
+    "",
+    "SYNOPSIS",
+    "    setpartab,table  ifile ofile",
+    "    setcode,code  ifile ofile",
+    "    setparam,param  ifile ofile",
+    "    setname,name  ifile ofile",
+    "    setunit,unit  ifile ofile",
+    "    setlevel,level  ifile ofile",
+    "    setltype,ltype  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module sets some field information. Depending on the chosen",
+    "    operator the parameter table, code number, parameter identifier, variable name or",
+    "    level is set.",
+    "",
+    "OPERATORS",
+    "    setpartab  Set parameter table",
+    "               Sets the parameter table for all variables.",
+    "    setcode    Set code number",
+    "               Sets the code number for all variables to the same given value.",
+    "    setparam   Set parameter identifier",
+    "               Sets the parameter identifier of the first variable.",
+    "    setname    Set variable name",
+    "               Sets the name of the first variable.",
+    "    setunit    Set variable unit",
+    "               Sets the unit of the first variable.",
+    "    setlevel   Set level",
+    "               Sets the first level of all variables.",
+    "    setltype   Set GRIB level type",
+    "               Sets the GRIB level type of all variables.",
+    "",
+    "PARAMETER",
+    "    table  STRING   Parameter table file or name",
+    "    code   INTEGER  Code number",
+    "    param  STRING   Parameter identifier (format: code[.tabnum] or num[.cat[.dis]])",
+    "    name   STRING   Variable name",
+    "    level  FLOAT    New level",
+    "    ltype  INTEGER  GRIB level type",
+    NULL
+};
+
+static char *SettimeHelp[] = {
+    "NAME",
+    "    setdate, settime, setday, setmon, setyear, settunits, settaxis, setreftime, ",
+    "    setcalendar, shifttime - Set time",
+    "",
+    "SYNOPSIS",
+    "    setdate,date  ifile ofile",
+    "    settime,time  ifile ofile",
+    "    setday,day  ifile ofile",
+    "    setmon,month  ifile ofile",
+    "    setyear,year  ifile ofile",
+    "    settunits,units  ifile ofile",
+    "    settaxis,date,time[,inc]  ifile ofile",
+    "    setreftime,date,time[,units]  ifile ofile",
+    "    setcalendar,calendar  ifile ofile",
+    "    shifttime,sval  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module sets the time axis or part of the time axis. Which part of the",
+    "    time axis is overwritten depends on the chosen operator.",
+    "",
+    "OPERATORS",
+    "    setdate      Set date",
+    "                 Sets the date in every timestep to the same given value.",
+    "    settime      Set time of the day",
+    "                 Sets the time in every timestep to the same given value.",
+    "    setday       Set day",
+    "                 Sets the day in every timestep to the same given value.",
+    "    setmon       Set month",
+    "                 Sets the month in every timestep to the same given value.",
+    "    setyear      Set year",
+    "                 Sets the year in every timestep to the same given value.",
+    "    settunits    Set time units",
+    "                 Sets the base units of a relative time axis.",
+    "    settaxis     Set time axis",
+    "                 Sets the time axis.",
+    "    setreftime   Set reference time",
+    "                 Sets the reference time of a relative time axis.",
+    "    setcalendar  Set calendar",
+    "                 Sets the calendar of a relative time axis.",
+    "    shifttime    Shift timesteps",
+    "                 Shifts all timesteps by the parameter sval.",
+    "",
+    "PARAMETER",
+    "    day       INTEGER  Value of the new day",
+    "    month     INTEGER  Value of the new month",
+    "    year      INTEGER  Value of the new year",
+    "    units     STRING   Base units of the time axis (seconds, minutes, hours, days, months, years)",
+    "    date      STRING   Date (format: YYYY-MM-DD)",
+    "    time      STRING   Time (format: hh:mm:ss)",
+    "    inc       STRING   Optional increment (seconds, minutes, hours, days, months, years) [default: 0hour]",
+    "    calendar  STRING   Calendar (standard, proleptic, 360days, 365days, 366days)",
+    "    sval      STRING   Shift value (e.g. -3hour)",
+    NULL
+};
+
+static char *ChangeHelp[] = {
+    "NAME",
+    "    chcode, chparam, chname, chunit, chlevel, chlevelc, chlevelv - ",
+    "    Change field header",
+    "",
+    "SYNOPSIS",
+    "    chcode,oldcode,newcode[,...]  ifile ofile",
+    "    chparam,oldparam,newparam,...  ifile ofile",
+    "    chname,oldname,newname,...  ifile ofile",
+    "    chunit,oldunit,newunit,...  ifile ofile",
+    "    chlevel,oldlev,newlev,...  ifile ofile",
+    "    chlevelc,code,oldlev,newlev  ifile ofile",
+    "    chlevelv,name,oldlev,newlev  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module reads fields from ifile, changes some header values",
+    "    and writes the results to ofile. The kind of changes depends on ",
+    "    the chosen operator.",
+    "",
+    "OPERATORS",
+    "    chcode    Change code number",
+    "              Changes some user given code numbers to new user given values.",
+    "    chparam   Change parameter identifier",
+    "              Changes some user given parameter identifiers to new user given values.",
+    "    chname    Change variable name",
+    "              Changes some user given variable names to new user given names.",
+    "    chunit    Change variable unit",
+    "              Changes some user given variable units to new user given units.",
+    "    chlevel   Change level",
+    "              Changes some user given levels to new user given values.",
+    "    chlevelc  Change level of one code",
+    "              Changes one level of a user given code number.",
+    "    chlevelv  Change level of one variable",
+    "              Changes one level of a user given variable name.",
+    "",
+    "PARAMETER",
+    "    code                   INTEGER  Code number",
+    "    oldcode,newcode,...    INTEGER  Pairs of old and new code numbers",
+    "    oldparam,newparam,...  STRING   Pairs of old and new parameter identifiers",
+    "    name                   STRING   Variable name",
+    "    oldname,newname,...    STRING   Pairs of old and new variable names",
+    "    oldlev                 FLOAT    Old level",
+    "    newlev                 FLOAT    New level",
+    "    oldlev,newlev,...      FLOAT    Pairs of old and new levels",
+    NULL
+};
+
+static char *SetgridHelp[] = {
+    "NAME",
+    "    setgrid, setgridtype, setgridarea - Set grid information",
+    "",
+    "SYNOPSIS",
+    "    setgrid,grid  ifile ofile",
+    "    setgridtype,gridtype  ifile ofile",
+    "    setgridarea,gridarea  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module modifies the metadata of the horizontal grid. Depending on the ",
+    "    chosen operator a new grid description is set, the coordinates are converted",
+    "    or the grid cell area is added.",
+    "",
+    "OPERATORS",
+    "    setgrid      Set grid",
+    "                 Sets a new grid description. The input fields need to have the same grid size",
+    "                 as the size of the target grid description.",
+    "    setgridtype  Set grid type",
+    "                 Sets the grid type of all input fields. The following grid types are available:",
+    "                 curvilinear "    "                 Converts regular grid to curvilinear grid",
+    "                 unstructured"    "                 Converts grid type to unstructured grid",
+    "                 dereference "    "                 Dereference grid type REFERENCE",
+    "                 regular     "    "                 Converts reduced Gaussian grid to regular Gaussian grid",
+    "    setgridarea  Set grid cell area",
+    "                 Sets the grid cell area. The parameter gridarea is the path to a data file,",
+    "                 the first field is used as grid cell area. The input fields need to have the same",
+    "                 grid size as the grid cell area. The grid cell area is used to compute",
+    "                 the weights of each grid cell if needed by an operator, e.g. for fldmean.",
+    "",
+    "PARAMETER",
+    "    grid      STRING  Grid description file or name",
+    "    gridtype  STRING  Grid type (curvilinear, unstructured, regular or dereference)",
+    "    gridarea  STRING  Data file, the first field is used as grid cell area",
+    NULL
+};
+
+static char *SetzaxisHelp[] = {
+    "NAME",
+    "    setzaxis - Set z-axis type",
+    "",
+    "SYNOPSIS",
+    "    setzaxis,zaxis  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator sets the z-axis description of all variables with the",
+    "    same number of level as the new z-axis.",
+    "",
+    "PARAMETER",
+    "    zaxis  STRING  Z-axis description file or name of the target z-axis",
+    NULL
+};
+
+static char *SetgattHelp[] = {
+    "NAME",
+    "    setgatt, setgatts - Set global attribute",
+    "",
+    "SYNOPSIS",
+    "    setgatt,attname,attstring  ifile ofile",
+    "    setgatts,attfile  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module sets global text attributes of a dataset. Depending on the chosen ",
+    "    operator the attributes are read from a file or can be specified by a parameter.",
+    "",
+    "OPERATORS",
+    "    setgatt   Set global attribute",
+    "              Sets one user defined global text attribute.",
+    "    setgatts  Set global attributes",
+    "              Sets user defined global text attributes. The name and text",
+    "              of the global attributes are read from a file.",
+    "",
+    "PARAMETER",
+    "    attname,attstring  STRING  Name and text of the global attribute (without spaces!)",
+    "    attfile            STRING  File name which contains global text attributes",
+    NULL
+};
+
+static char *InvertHelp[] = {
+    "NAME",
+    "    invertlat - Invert latitudes",
+    "",
+    "SYNOPSIS",
+    "    invertlat  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator inverts the latitudes of all fields with a regular lon/lat grid. ",
+    NULL
+};
+
+static char *InvertlevHelp[] = {
+    "NAME",
+    "    invertlev - Invert levels",
+    "",
+    "SYNOPSIS",
+    "    invertlev  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator inverts the levels of all non hybrid 3D variables.",
+    NULL
+};
+
+static char *MaskregionHelp[] = {
+    "NAME",
+    "    maskregion - Mask regions",
+    "",
+    "SYNOPSIS",
+    "    maskregion,regions  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Masks different regions of fields with a regular lon/lat grid. The elements ",
+    "    inside a region are untouched, the elements outside are set to missing value.",
+    "    Considered are only those grid cells with the grid center inside the regions.",
+    "    All input fields must have the same horizontal grid.",
+    "    The user has to give ASCII formatted files with different regions.",
+    "    A region is defined by a polygon. Each line of a polygon description file ",
+    "    contains the longitude and latitude of one point.",
+    "    Each polygon description file can contain one or more polygons separated",
+    "    by a line with the character \\&.",
+    "",
+    "PARAMETER",
+    "    regions  STRING Comma separated list of ASCII formatted files with different regions",
+    NULL
+};
+
+static char *MaskboxHelp[] = {
+    "NAME",
+    "    masklonlatbox, maskindexbox - Mask a box",
+    "",
+    "SYNOPSIS",
+    "    masklonlatbox,lon1,lon2,lat1,lat2  ifile ofile",
+    "    maskindexbox,idx1,idx2,idy1,idy2  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Masks a box of the rectangular understood field. The elements inside ",
+    "    the box are untouched, the elements outside are set to missing value.",
+    "    All input fields need to have the same horizontal grid.",
+    "    Use sellonlatbox or selindexbox if only the data inside the box are needed.",
+    "",
+    "OPERATORS",
+    "    masklonlatbox  Mask a longitude/latitude box",
+    "                   Masks a longitude/latitude box. The user has to give the ",
+    "                   longitudes and latitudes of the edges of the box.",
+    "                   Considered are only those grid cells with the grid center inside the lon/lat box.",
+    "    maskindexbox   Mask an index box",
+    "                   Masks an index box. The user has to give the indexes of the ",
+    "                   edges of the box. The index of the left edge can be greater ",
+    "                   then the one of the right edge.",
+    "",
+    "PARAMETER",
+    "    lon1  FLOAT    Western longitude",
+    "    lon2  FLOAT    Eastern longitude",
+    "    lat1  FLOAT    Southern or northern latitude",
+    "    lat2  FLOAT    Northern or southern latitude",
+    "    idx1  INTEGER  Index of first longitude",
+    "    idx2  INTEGER  Index of last longitude",
+    "    idy1  INTEGER  Index of first latitude",
+    "    idy2  INTEGER  Index of last latitude",
+    NULL
+};
+
+static char *SetboxHelp[] = {
+    "NAME",
+    "    setclonlatbox, setcindexbox - Set a box to constant",
+    "",
+    "SYNOPSIS",
+    "    setclonlatbox,c,lon1,lon2,lat1,lat2  ifile ofile",
+    "    setcindexbox,c,idx1,idx2,idy1,idy2  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Sets a box of the rectangular understood field to a constant value. ",
+    "    The elements outside the box are untouched, the elements inside are ",
+    "    set to the given constant. All input fields need to have the same ",
+    "    horizontal grid.",
+    "",
+    "OPERATORS",
+    "    setclonlatbox  Set a longitude/latitude box to constant",
+    "                   Sets the values of a longitude/latitude box to a constant value. The ",
+    "                   user has to give the longitudes and latitudes of the edges of the box.",
+    "    setcindexbox   Set an index box to constant",
+    "                   Sets the values of an index box to a constant value. The user has to ",
+    "                   give the indexes of the edges of the box. The index of the left edge ",
+    "                   can be greater than the one of the right edge.",
+    "",
+    "PARAMETER",
+    "    c     FLOAT    Constant",
+    "    lon1  FLOAT    Western longitude",
+    "    lon2  FLOAT    Eastern longitude",
+    "    lat1  FLOAT    Southern or northern latitude",
+    "    lat2  FLOAT    Northern or southern latitude",
+    "    idx1  INTEGER  Index of first longitude",
+    "    idx2  INTEGER  Index of last longitude",
+    "    idy1  INTEGER  Index of first latitude",
+    "    idy2  INTEGER  Index of last latitude",
+    NULL
+};
+
+static char *EnlargeHelp[] = {
+    "NAME",
+    "    enlarge - Enlarge fields",
+    "",
+    "SYNOPSIS",
+    "    enlarge,grid  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Enlarge all fields of ifile to a user given grid. Normally only the last ",
+    "    field element is used for the enlargement. If however the input and output",
+    "    grid are regular lon/lat grids, a zonal or meridional enlargement is possible.",
+    "    Zonal enlargement takes place, if the xsize of the input field is 1 and ",
+    "    the ysize of both grids are the same. For meridional enlargement the ysize",
+    "    have to be 1 and the xsize of both grids should have the same size.",
+    "",
+    "PARAMETER",
+    "    grid  STRING  Target grid description file or name",
+    NULL
+};
+
+static char *SetmissHelp[] = {
+    "NAME",
+    "    setmissval, setctomiss, setmisstoc, setrtomiss, setvrange - Set missing value",
+    "",
+    "SYNOPSIS",
+    "    setmissval,newmiss  ifile ofile",
+    "    setctomiss,c  ifile ofile",
+    "    setmisstoc,c  ifile ofile",
+    "    setrtomiss,rmin,rmax  ifile ofile",
+    "    setvrange,rmin,rmax  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module sets part of a field to missing value or missing values",
+    "    to a constant value. Which part of the field is set depends on the ",
+    "    chosen operator.",
+    "",
+    "OPERATORS",
+    "    setmissval  Set a new missing value",
+    "                         / newmiss   if i(t,x) EQ miss",
+    "                o(t,x) = ",
+    "                         \\ i(t,x)    if i(t,x) NE miss",
+    "    setctomiss  Set constant to missing value",
+    "                         / miss   if i(t,x) EQ c",
+    "                o(t,x) = ",
+    "                         \\ i(t,x) if i(t,x) NE c",
+    "    setmisstoc  Set missing value to constant",
+    "                         / c      if i(t,x) EQ miss",
+    "                o(t,x) = ",
+    "                         \\ i(t,x) if i(t,x) NE miss",
+    "    setrtomiss  Set range to missing value",
+    "                         / miss   if i(t,x) GE rmin AND i(t,x) LE rmax",
+    "                o(t,x) = ",
+    "                         \\ i(t,x) if i(t,x) LT rmin OR  i(t,x) GT rmax",
+    "    setvrange   Set valid range",
+    "                         / miss   if i(t,x) LT rmin OR  i(t,x) GT rmax",
+    "                o(t,x) = ",
+    "                         \\ i(t,x) if i(t,x) GE rmin AND i(t,x) LE rmax",
+    "",
+    "PARAMETER",
+    "    newmiss  FLOAT  New missing value",
+    "    c        FLOAT  Constant",
+    "    rmin     FLOAT  Lower bound",
+    "    rmax     FLOAT  Upper bound",
+    NULL
+};
+
+static char *ExprHelp[] = {
+    "NAME",
+    "    expr, exprf - Evaluate expressions",
+    "",
+    "SYNOPSIS",
+    "    expr,instr  ifile ofile",
+    "    exprf,filename  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module arithmetically processes every timestep of the input dataset.",
+    "    Each individual assignment statement have to end with a semi-colon.",
+    "    The basic arithmetic operations addition +, subtraction -, multiplication *,",
+    "    division / and exponentiation ^ can be used.",
+    "    The following intrinsic functions are available:",
+    "    abs(x)  "    "    Absolute value of x",
+    "    int(x)  "    "    Integer value of x",
+    "    nint(x) "    "    Nearest integer value of x",
+    "    sqr(x)  "    "    Square of x",
+    "    sqrt(x) "    "    Square Root of x",
+    "    exp(x)  "    "    Exponential of x",
+    "    log(x)  "    "    Natural logarithm of x",
+    "    log10(x)"    "    Base 10 logarithm of x",
+    "    sin(x)  "    "    Sine of x, where x is specified in radians",
+    "    cos(x)  "    "    Cosine of x, where x is specified in radians",
+    "    tan(x)  "    "    Tangent of x, where x is specified in radians",
+    "    asin(x) "    "    Arc-sine of x, where x is specified in radians",
+    "    acos(x) "    "    Arc-cosine of x, where x is specified in radians",
+    "    atan(x) "    "    Arc-tangent of x, where x is specified in radians",
+    "",
+    "OPERATORS",
+    "    expr   Evaluate expressions",
+    "           The processing instructions are read from the parameter.",
+    "    exprf  Evaluate expressions from script file",
+    "           Contrary to expr the processing instructions are read from a file.",
+    "",
+    "PARAMETER",
+    "    instr     STRING  Processing instructions (without spaces!)",
+    "    filename  STRING  File with processing instructions",
+    NULL
+};
+
+static char *MathHelp[] = {
+    "NAME",
+    "    abs, int, nint, pow, sqr, sqrt, exp, ln, log10, sin, cos, tan, asin, acos, ",
+    "    reci - Mathematical functions",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module contains some standard mathematical functions.",
+    "    All trigonometric functions calculate with radians.",
+    "",
+    "OPERATORS",
+    "    abs    Absolute value",
+    "           o(t,x) = abs(i(t,x))",
+    "    int    Integer value",
+    "           o(t,x) = int(i(t,x))",
+    "    nint   Nearest integer value",
+    "           o(t,x) = nint(i(t,x))",
+    "    pow    Power",
+    "           o(t,x) = i(t,x)^y",
+    "    sqr    Square",
+    "           o(t,x) = i(t,x)^2",
+    "    sqrt   Square root",
+    "           o(t,x) = sqrt(i(t,x))",
+    "    exp    Exponential",
+    "           o(t,x) = e^i(t,x)",
+    "    ln     Natural logarithm",
+    "           o(t,x) = ln(i(t,x))",
+    "    log10  Base 10 logarithm",
+    "           o(t,x) = log10(i(t,x))",
+    "    sin    Sine",
+    "           o(t,x) = sin(i(t,x))",
+    "    cos    Cosine",
+    "           o(t,x) = cos(i(t,x))",
+    "    tan    Tangent",
+    "           o(t,x) = tan(i(t,x))",
+    "    asin   Arc sine",
+    "           o(t,x) = asin(i(t,x))",
+    "    acos   Arc cosine",
+    "           o(t,x) = acos(i(t,x))",
+    "    reci   Reciprocal value",
+    "           o(t,x) = 1 / i(t,x)",
+    NULL
+};
+
+static char *ArithcHelp[] = {
+    "NAME",
+    "    addc, subc, mulc, divc - Arithmetic with a constant",
+    "",
+    "SYNOPSIS",
+    "    <operator>,c  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module performs simple arithmetic with all field elements of a dataset and ",
+    "    a constant. The fields in ofile inherit the meta data from ifile.",
+    "",
+    "OPERATORS",
+    "    addc  Add a constant",
+    "          o(t,x) = i(t,x) + c",
+    "    subc  Subtract a constant",
+    "          o(t,x) = i(t,x) - c",
+    "    mulc  Multiply with a constant",
+    "          o(t,x) = i(t,x) * c",
+    "    divc  Divide by a constant",
+    "          o(t,x) = i(t,x) / c",
+    "",
+    "PARAMETER",
+    "    c  FLOAT  Constant",
+    NULL
+};
+
+static char *ArithHelp[] = {
+    "NAME",
+    "    add, sub, mul, div, min, max, atan2 - Arithmetic on two datasets",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    This module performs simple arithmetic of two datasets.",
+    "    The number of fields in ifile1 should be the same as in ifile2.",
+    "    One of the input files can contain only one timestep or one variable.",
+    "    The fields in ofile inherit the meta data from ifile1 or ifile2.",
+    "",
+    "OPERATORS",
+    "    add    Add two fields",
+    "           o(t,x) = i_1(t,x) + i_2(t,x)",
+    "    sub    Subtract two fields",
+    "           o(t,x) = i_1(t,x) - i_2(t,x)",
+    "    mul    Multiply two fields",
+    "           o(t,x) = i_1(t,x) * i_2(t,x)",
+    "    div    Divide two fields",
+    "           o(t,x) = i_1(t,x) / i_2(t,x)",
+    "    min    Minimum of two fields",
+    "           o(t,x) = min(i_1(t,x), i_2(t,x))",
+    "    max    Maximum of two fields",
+    "           o(t,x) = max(i_1(t,x), i_2(t,x))",
+    "    atan2  Arc tangent of two fields",
+    "           The atan2 operator calculates the arc tangent of two fields. The result is",
+    "           in radians, which is between -PI and PI (inclusive).",
+    "           ",
+    "           o(t,x) = atan2(i_1(t,x), i_2(t,x))",
+    NULL
+};
+
+static char *MonarithHelp[] = {
+    "NAME",
+    "    monadd, monsub, monmul, mondiv - Monthly arithmetic",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    This module performs simple arithmetic of a time series and one",
+    "    timestep with the same month and year. For each field in ifile1",
+    "    the corresponding field of the timestep in ifile2 with the",
+    "    same month and year is used. The header information in ifile1",
+    "    have to be the same as in ifile2. Usually ifile2 is generated",
+    "    by an operator of the module MONSTAT.",
+    "",
+    "OPERATORS",
+    "    monadd  Add monthly time series",
+    "            Adds a time series and a monthly time series.",
+    "    monsub  Subtract monthly time series",
+    "            Subtracts a time series and a monthly time series.",
+    "    monmul  Multiply monthly time series",
+    "            Multiplies a time series and a monthly time series.",
+    "    mondiv  Divide monthly time series",
+    "            Divides a time series and a monthly time series.",
+    NULL
+};
+
+static char *YmonarithHelp[] = {
+    "NAME",
+    "    ymonadd, ymonsub, ymonmul, ymondiv - Multi-year monthly arithmetic",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    This module performs simple arithmetic of a time series and one",
+    "    timestep with the same month of year. For each field in ifile1",
+    "    the corresponding field of the timestep in ifile2 with the",
+    "    same month of year is used. The header information in ifile1",
+    "    have to be the same as in ifile2. Usually ifile2 is generated",
+    "    by an operator of the module YMONSTAT.",
+    "",
+    "OPERATORS",
+    "    ymonadd  Add multi-year monthly time series",
+    "             Adds a time series and a multi-year monthly time series.",
+    "    ymonsub  Subtract multi-year monthly time series",
+    "             Subtracts a time series and a multi-year monthly time series.",
+    "    ymonmul  Multiply multi-year monthly time series",
+    "             Multiplies a time series and a multi-year monthly time series.",
+    "    ymondiv  Divide multi-year monthly time series",
+    "             Divides a time series and a multi-year monthly time series.",
+    NULL
+};
+
+static char *YdayarithHelp[] = {
+    "NAME",
+    "    ydayadd, ydaysub, ydaymul, ydaydiv - Multi-year daily arithmetic",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    This module performs simple arithmetic of a time series and one",
+    "    timestep with the same day of year. For each field in ifile1",
+    "    the corresponding field of the timestep in ifile2 with the",
+    "    same day of year is used. The header information in ifile1",
+    "    have to be the same as in ifile2. Usually ifile2 is generated",
+    "    by an operator of the module YDAYSTAT.",
+    "",
+    "OPERATORS",
+    "    ydayadd  Add multi-year daily time series",
+    "             Adds a time series and a multi-year daily time series.",
+    "    ydaysub  Subtract multi-year daily time series",
+    "             Subtracts a time series and a multi-year daily time series.",
+    "    ydaymul  Multiply multi-year daily time series",
+    "             Multiplies a time series and a multi-year daily time series.",
+    "    ydaydiv  Divide multi-year daily time series",
+    "             Divides a time series and a multi-year daily time series.",
+    NULL
+};
+
+static char *YhourarithHelp[] = {
+    "NAME",
+    "    yhouradd, yhoursub, yhourmul, yhourdiv - Multi-year hourly arithmetic",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    This module performs simple arithmetic of a time series and one",
+    "    timestep with the same hour and day of year. For each field in ifile1",
+    "    the corresponding field of the timestep in ifile2 with the",
+    "    same hour and day of year is used. The header information in ifile1",
+    "    have to be the same as in ifile2. Usually ifile2 is generated",
+    "    by an operator of the module YHOURSTAT.",
+    "",
+    "OPERATORS",
+    "    yhouradd  Add multi-year hourly time series",
+    "              Adds a time series and a multi-year hourly time series.",
+    "    yhoursub  Subtract multi-year hourly time series",
+    "              Subtracts a time series and a multi-year hourly time series.",
+    "    yhourmul  Multiply multi-year hourly time series",
+    "              Multiplies a time series and a multi-year hourly time series.",
+    "    yhourdiv  Divide multi-year hourly time series",
+    "              Divides a time series and a multi-year hourly time series.",
+    NULL
+};
+
+static char *ArithdaysHelp[] = {
+    "NAME",
+    "    muldpm, divdpm, muldpy, divdpy - Arithmetic with days",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module multiplies or divides each timestep of a dataset with the corresponding",
+    "    days per month or days per year. The result of these functions depends on the used",
+    "    calendar of the input data.",
+    "",
+    "OPERATORS",
+    "    muldpm  Multiply with days per month",
+    "            o(t,x) = i(t,x) * days_per_month",
+    "    divdpm  Divide by days per month",
+    "            o(t,x) = i(t,x) / days_per_month",
+    "    muldpy  Multiply with days per year",
+    "            o(t,x) = i(t,x) * days_per_year",
+    "    divdpy  Divide by days per year",
+    "            o(t,x) = i(t,x) / days_per_year",
+    NULL
+};
+
+static char *ConsecstatHelp[] = {
+    "NAME",
+    "    consecsum, consects - Consecute timestep periods",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes periods over all timesteps in ifile where a",
+    "    certain property is valid. The propery can be chosen by creating a mask from",
+    "    the original data, which is the expected input format for operators of this",
+    "    module. Depending on the operator full information about each period or",
+    "    just its length and ending date are computed.",
+    "",
+    "OPERATORS",
+    "    consecsum  Consecutive Sum",
+    "               This operator computes periods of consecutive timesteps similar to a",
+    "               runsum, but periods are finished, when the mask value is 0. That way",
+    "               multiple periods can be found. Timesteps from the input are preserved. Missing",
+    "               values are handled like 0, i.e. finish periods of consecutive timesteps.",
+    "    consects   Consecutive Timesteps",
+    "               In contrast to the operator above consects only computes the lenght of each",
+    "               period together with its last timestep. To be able to perform statistical",
+    "               analysis like min, max or mean, everything else is set to missing value.",
+    NULL
+};
+
+static char *EnsstatHelp[] = {
+    "NAME",
+    "    ensmin, ensmax, enssum, ensmean, ensavg, ensvar, ensstd, enspctl - ",
+    "    Statistical values over an ensemble",
+    "",
+    "SYNOPSIS",
+    "    ensmin  ifiles ofile",
+    "    ensmax  ifiles ofile",
+    "    enssum  ifiles ofile",
+    "    ensmean  ifiles ofile",
+    "    ensavg  ifiles ofile",
+    "    ensvar  ifiles ofile",
+    "    ensstd  ifiles ofile",
+    "    enspctl,p  ifiles ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values over an ensemble of input files.",
+    "    Depending on the chosen operator the minimum, maximum, sum, average, variance,",
+    "    standard deviation or a certain percentile over all input files is written",
+    "    to ofile.",
+    "    All input files need to have the same structure with the same variables.",
+    "    The date information of a timestep in ofile is the date of the first input file.",
+    "",
+    "OPERATORS",
+    "    ensmin   Ensemble minimum",
+    "             o(t,x) = min{i1(t,x), i2(t,x), ..., in(t,x)}",
+    "    ensmax   Ensemble maximum",
+    "             o(t,x) = max{i1(t,x), i2(t,x), ..., in(t,x)}",
+    "    enssum   Ensemble sum",
+    "             o(t,x) = sum{i1(t,x), i2(t,x), ..., in(t,x)}",
+    "    ensmean  Ensemble mean",
+    "             o(t,x) = mean{i1(t,x), i2(t,x), ..., in(t,x)}",
+    "    ensavg   Ensemble average",
+    "             o(t,x) = avg{i1(t,x), i2(t,x), ..., in(t,x)}",
+    "    ensvar   Ensemble variance",
+    "             o(t,x) = var{i1(t,x), i2(t,x), ..., in(t,x)}",
+    "    ensstd   Ensemble standard deviation",
+    "             o(t,x) = std{i1(t,x), i2(t,x), ..., in(t,x)}",
+    "    enspctl  Ensemble percentiles",
+    "             o(t,x) = pth percentile {i1(t,x), i2(t,x), ..., in(t,x)}",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    NULL
+};
+
+static char *Ensstat2Help[] = {
+    "NAME",
+    "    ensrkhistspace, ensrkhisttime, ensroc - Statistical values over an ensemble",
+    "",
+    "SYNOPSIS",
+    "    <operator>  obsfile ensfiles ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values over the ensemble of ensfiles using",
+    "    obsfile as a reference. Depending on the operator a ranked Histogram or ",
+    "    a roc-curve over all Ensembles ensfiles",
+    "    with reference to obsfile is written to ofile. ",
+    "    The date and grid information of a timestep in ofile is the date of the ",
+    "    first input file. Thus all input files are required to have the same structure in ",
+    "    terms of the gridsize, variable definitions and number of timesteps. ",
+    "    ",
+    "    All Operators in this module use obsfile as the reference (for instance ",
+    "    an observation) whereas ensfiles are understood as an ensemble consisting ",
+    "    of n (where n is the number of ensfiles) members. ",
+    "    ",
+    "    The operators ensrkhistspace and ensrkhisttime compute Ranked Histograms. ",
+    "    Therefor the vertical axis is utilized as the Histogram axis, which prohibits",
+    "    the use of files containing more than one level. The histogram axis has ",
+    "    nensfiles+1 bins with level 0 containing for each grid point the number of ",
+    "    observations being smaller as all ensembles and level nensfiles+1 indicating",
+    "    the number of observations being larger than all ensembles. ",
+    "    ",
+    "    ensrkhistspace computes a ranked histogram at each timestep reducing each ",
+    "    horizontal grid to a 1x1 grid and keeping the time axis as in obsfile. ",
+    "    Contrary ensrkhistspace  computes a histogram at each grid point keeping the ",
+    "    horizontal grid for each variable and reducing the time-axis. The time infor-",
+    "    mation is that from the last timestep in obsfile. ",
+    "",
+    "OPERATORS",
+    "    ensrkhistspace  Ranked Histogram averaged over time",
+    "    ensrkhisttime   Ranked Histogram averaged over space",
+    "    ensroc          Ensemble Receiver Operating characteristics",
+    NULL
+};
+
+static char *EnsvalHelp[] = {
+    "NAME",
+    "    enscrps, ensbrs - Ensemble validation tools",
+    "",
+    "SYNOPSIS",
+    "    enscrps  rfile ifiles ofilebase",
+    "    ensbrs,x  rfile ifiles ofilebase",
+    "",
+    "DESCRIPTION",
+    "    This module computes ensemble validation scores and their decomposition such as ",
+    "    the Brier and cumulative ranked probability score (CRPS). ",
+    "    The first file is used as a reference it can be a climatology, observation or ",
+    "    reanalysis against which the skill of the ensembles given in ifiles is measured. ",
+    "    Depending on the operator a number of output files is generated each containing ",
+    "    the skill score and its decomposition corresponding to the operator. ",
+    "    The output is averaged  over horizontal fields using appropriate weights ",
+    "    for each level and timestep in rfile. ",
+    "    ",
+    "    All input files need to have the same structure with the same variables.",
+    "    The date information of a timestep in ofile is the date of the first input file.",
+    "    The output files are named as ",
+    "    <ofilebase>.<type>.<filesuffix> where <type> depends on the ",
+    "    operator and <filesuffix> is determined from the output file type. ",
+    "    There are three output files for operator enscrps and four output files ",
+    "    for operator ensbrs.",
+    "    ",
+    "    The CRPS and its decomposition into Reliability and the potential ",
+    "    CRPS are calculated by an appropriate averaging over the field ",
+    "    members (note, that the CRPS does *not* average linearly). ",
+    "    In the three output files ",
+    "    <type> has the following meaning:",
+    "    crps for the CRPS, reli for the reliability ",
+    "    and crpspot for the potential crps. The relation ",
+    "    CRPS = CRPS_{pot} + RELI",
+    "    holds. 	  ",
+    "    ",
+    "    The Brier score of the Ensemble given by ifiles with respect to the ",
+    "    reference given in rfile and the threshold x is calculated. ",
+    "    In the four output files <type> has the following meaning: ",
+    "    brs for the Brier score wrt threshold  x; ",
+    "    brsreli for the Brier score reliability wrt threshold x;",
+    "    brsreso for the Brier score resolution wrt threshold x;",
+    "    brsunct for the Brier score uncertainty wrt threshold x.",
+    "    In analogy to the CRPS the following relation holds:",
+    "    BRS(x) = RELI(x)-RESO(x)+ UNCT(x).",
+    "    ",
+    "    The implementation of the decomposition of the CRPS and Brier Score follows ",
+    "      Hans Hersbach (2000): Decomposition of the Continuous Ranked Probability ",
+    "      Score for Ensemble Prediction Systems, in: Weather and Forecasting (15) ",
+    "      pp. 559-570. ",
+    "    ",
+    "    The CRPS code decomposition has been verified against the CRAN - ensemble ",
+    "    validation package from R. Differences occur when grid-cell area is not ",
+    "    uniform as the implementation in R does not account for that. ",
+    "    ",
+    "",
+    "OPERATORS",
+    "    enscrps  Ensemble CRPS and decomposition",
+    "    ensbrs   Ensemble Brier score",
+    "             Ensemble Brier Score and Decomposition",
+    NULL
+};
+
+static char *FldstatHelp[] = {
+    "NAME",
+    "    fldmin, fldmax, fldsum, fldmean, fldavg, fldvar, fldstd, fldpctl - ",
+    "    Statistical values over a field",
+    "",
+    "SYNOPSIS",
+    "    fldmin  ifile ofile",
+    "    fldmax  ifile ofile",
+    "    fldsum  ifile ofile",
+    "    fldmean  ifile ofile",
+    "    fldavg  ifile ofile",
+    "    fldvar  ifile ofile",
+    "    fldstd  ifile ofile",
+    "    fldpctl,p  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values of the input fields.",
+    "    According to the chosen operator the field minimum, maximum,",
+    "    sum, average, variance, standard deviation or a certain percentile",
+    "    is written to ofile.",
+    "",
+    "OPERATORS",
+    "    fldmin   Field minimum",
+    "             For every gridpoint x_1, ..., x_n of the same field it is:",
+    "             ",
+    "             o(t,1) = min{i(t,x'), x_1<x'<=x_n}",
+    "    fldmax   Field maximum",
+    "             For every gridpoint x_1, ..., x_n of the same field it is:",
+    "             ",
+    "             o(t,1) = max{i(t,x'), x_1<x'<=x_n}",
+    "    fldsum   Field sum",
+    "             For every gridpoint x_1, ..., x_n of the same field it is:",
+    "             ",
+    "             o(t,1) = sum{i(t,x'), x_1<x'<=x_n}",
+    "    fldmean  Field mean",
+    "             For every gridpoint x_1, ..., x_n of the same field it is:",
+    "             ",
+    "             o(t,1) = mean{i(t,x'), x_1<x'<=x_n}",
+    "             weighted by area weights obtained by the input field.",
+    "    fldavg   Field average",
+    "             For every gridpoint x_1, ..., x_n of the same field it is:",
+    "             ",
+    "             o(t,1) = avg{i(t,x'), x_1<x'<=x_n}",
+    "             weighted by area weights obtained by the input field.",
+    "    fldvar   Field variance",
+    "             For every gridpoint x_1, ..., x_n of the same field it is:",
+    "             ",
+    "             o(t,1) = var{i(t,x'), x_1<x'<=x_n}",
+    "             weighted by area weights obtained by the input field.",
+    "    fldstd   Field standard deviation",
+    "             For every gridpoint x_1, ..., x_n of the same field it is:",
+    "             ",
+    "             o(t,1) = std{i(t,x'), x_1<x'<=x_n}",
+    "             weighted by area weights obtained by the input field.",
+    "    fldpctl  Field percentiles",
+    "             For every gridpoint x_1, ..., x_n of the same field it is:",
+    "             ",
+    "             o(t,1) = pth percentile {i(t,x'), x_1<x'<=x_n}",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    NULL
+};
+
+static char *ZonstatHelp[] = {
+    "NAME",
+    "    zonmin, zonmax, zonsum, zonmean, zonavg, zonvar, zonstd, zonpctl - ",
+    "    Zonal statistical values",
+    "",
+    "SYNOPSIS",
+    "    zonmin  ifile ofile",
+    "    zonmax  ifile ofile",
+    "    zonsum  ifile ofile",
+    "    zonmean  ifile ofile",
+    "    zonavg  ifile ofile",
+    "    zonvar  ifile ofile",
+    "    zonstd  ifile ofile",
+    "    zonpctl,p  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes zonal statistical values of the input fields.",
+    "    According to the chosen operator the zonal minimum, maximum, ",
+    "    sum, average, variance, standard deviation or a certain percentile",
+    "    is written to ofile. All input fields need to have the same",
+    "    regular lonlat grid. ",
+    "",
+    "OPERATORS",
+    "    zonmin   Zonal minimum",
+    "             For every latitude the minimum over all longitudes is computed.",
+    "    zonmax   Zonal maximum",
+    "             For every latitude the maximum over all longitudes is computed.",
+    "    zonsum   Zonal sum",
+    "             For every latitude the sum over all longitudes is computed.",
+    "    zonmean  Zonal mean",
+    "             For every latitude the mean over all longitudes is computed.",
+    "    zonavg   Zonal average",
+    "             For every latitude the average over all longitudes is computed.",
+    "    zonvar   Zonal variance",
+    "             For every latitude the variance over all longitudes is computed.",
+    "    zonstd   Zonal standard deviation",
+    "             For every latitude the standard deviation over all longitudes is computed.",
+    "    zonpctl  Zonal percentiles",
+    "             For every latitude the pth percentile over all longitudes is computed.",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    NULL
+};
+
+static char *MerstatHelp[] = {
+    "NAME",
+    "    mermin, mermax, mersum, mermean, meravg, mervar, merstd, merpctl - ",
+    "    Meridional statistical values",
+    "",
+    "SYNOPSIS",
+    "    mermin  ifile ofile",
+    "    mermax  ifile ofile",
+    "    mersum  ifile ofile",
+    "    mermean  ifile ofile",
+    "    meravg  ifile ofile",
+    "    mervar  ifile ofile",
+    "    merstd  ifile ofile",
+    "    merpctl,p  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes meridional statistical values of the input fields.",
+    "    According to the chosen operator the meridional minimum, maximum,",
+    "    sum, average, variance, standard deviation or a certain percentile is",
+    "    written to ofile. All input fields need to have the same regular lon/lat",
+    "    grid. ",
+    "",
+    "OPERATORS",
+    "    mermin   Meridional minimum",
+    "             For every longitude the minimum over all latitudes is computed.",
+    "    mermax   Meridional maximum",
+    "             For every longitude the maximum over all latitudes is computed.",
+    "    mersum   Meridional sum",
+    "             For every longitude the sum over all latitudes is computed.",
+    "    mermean  Meridional mean",
+    "             For every longitude the area weighted mean over all latitudes is computed.",
+    "    meravg   Meridional average",
+    "             For every longitude the area weighted average over all latitudes is computed.",
+    "    mervar   Meridional variance",
+    "             For every longitude the variance over all latitudes is computed.",
+    "    merstd   Meridional standard deviation",
+    "             For every longitude the standard deviation over all latitudes is computed.",
+    "    merpctl  Meridional percentiles",
+    "             For every longitude the pth percentile over all latitudes is computed.",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    NULL
+};
+
+static char *GridboxstatHelp[] = {
+    "NAME",
+    "    gridboxmin, gridboxmax, gridboxsum, gridboxmean, gridboxavg, gridboxvar, ",
+    "    gridboxstd - Statistical values over grid boxes",
+    "",
+    "SYNOPSIS",
+    "    <operator>,nx,ny  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values over surrounding grid boxes.",
+    "    According to the chosen operator the minimum, maximum, sum, average, ",
+    "    variance, or standard deviation of the neighboring grid boxes is written to ofile.",
+    "    All gridbox operators only works on quadrilateral curvilinear grids.",
+    "",
+    "OPERATORS",
+    "    gridboxmin   Gridbox minimum",
+    "    gridboxmax   Gridbox maximum",
+    "    gridboxsum   Gridbox sum",
+    "    gridboxmean  Gridbox mean",
+    "    gridboxavg   Gridbox average",
+    "    gridboxvar   Gridbox variance",
+    "    gridboxstd   Gridbox standard deviation",
+    "",
+    "PARAMETER",
+    "    nx  INTEGER  Number of grid boxes in x direction",
+    "    ny  INTEGER  Number of grid boxes in y direction",
+    NULL
+};
+
+static char *VertstatHelp[] = {
+    "NAME",
+    "    vertmin, vertmax, vertsum, vertmean, vertavg, vertvar, vertstd - ",
+    "    Vertical statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values over all levels of the input variables.",
+    "    According to chosen operator the vertical minimum, maximum, sum, average, variance",
+    "    or standard deviation is written to ofile.",
+    "",
+    "OPERATORS",
+    "    vertmin   Vertical minimum",
+    "              For every gridpoint the minimum over all levels is computed.",
+    "    vertmax   Vertical maximum",
+    "              For every gridpoint the maximum over all levels is computed.",
+    "    vertsum   Vertical sum",
+    "              For every gridpoint the sum over all levels is computed.",
+    "    vertmean  Vertical mean",
+    "              For every gridpoint the mean over all levels is computed.",
+    "    vertavg   Vertical average",
+    "              For every gridpoint the average over all levels is computed.",
+    "    vertvar   Vertical variance",
+    "              For every gridpoint the variance over all levels is computed.",
+    "    vertstd   Vertical standard deviation",
+    "              For every gridpoint the standard deviation over all levels is computed.",
+    NULL
+};
+
+static char *TimselstatHelp[] = {
+    "NAME",
+    "    timselmin, timselmax, timselsum, timselmean, timselavg, timselvar, timselstd - ",
+    "    Time range statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>,nsets[,noffset[,nskip]]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values for a selected number of timesteps.",
+    "    According to the chosen operator the minimum, maximum, sum, average,",
+    "    variance or standard deviation of the selected timesteps is written to ofile.",
+    "    The date information of a timestep in ofile is the date of the last ",
+    "    contributing timestep in ifile.",
+    "",
+    "OPERATORS",
+    "    timselmin   Time range minimum",
+    "                For every adjacent sequence t1, ...., tn of timesteps of the same ",
+    "                selected time range it is",
+    "                ",
+    "                o(t,x) = min{i(t',x), t1 < t' <= tn}",
+    "    timselmax   Time range maximum",
+    "                For every adjacent sequence t1, ...., tn of timesteps of the same ",
+    "                selected time range it is",
+    "                ",
+    "                o(t,x) = max{i(t',x), t1 < t' <= tn}",
+    "    timselsum   Time range sum",
+    "                For every adjacent sequence t1, ...., tn of timesteps of the same ",
+    "                selected time range it is",
+    "                ",
+    "                o(t,x) = sum{i(t',x), t1 < t' <= tn}",
+    "    timselmean  Time range mean",
+    "                For every adjacent sequence t1, ...., tn of timesteps of the same ",
+    "                selected time range it is",
+    "                ",
+    "                o(t,x) = mean{i(t',x), t1 < t' <= tn}",
+    "    timselavg   Time range average",
+    "                For every adjacent sequence t1, ...., tn of timesteps of the same ",
+    "                selected time range it is",
+    "                ",
+    "                o(t,x) = avg{i(t',x), t1 < t' <= tn}",
+    "    timselvar   Time range variance",
+    "                For every adjacent sequence t1, ...., tn of timesteps of the same ",
+    "                selected time range it is",
+    "                ",
+    "                o(t,x) = var{i(t',x), t1 < t' <= tn}",
+    "    timselstd   Time range standard deviation",
+    "                For every adjacent sequence t1, ...., tn of timesteps of the same ",
+    "                selected time range it is",
+    "                ",
+    "                o(t,x) = std{i(t',x), t1 < t' <= tn}",
+    "",
+    "PARAMETER",
+    "    nsets    INTEGER  Number of input timesteps for each output timestep ",
+    "    noffset  INTEGER  Number of input timesteps skipped before the first timestep range (optional)",
+    "    nskip    INTEGER  Number of input timesteps skipped between timestep ranges (optional)",
+    NULL
+};
+
+static char *TimselpctlHelp[] = {
+    "NAME",
+    "    timselpctl - Time range percentile values",
+    "",
+    "SYNOPSIS",
+    "    timselpctl,p,nsets[,noffset[,nskip]]  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator computes percentile values over a selected number of time",
+    "    steps in ifile1.",
+    "    The algorithm uses histograms with minimum and maximum bounds given in",
+    "    ifile2 and ifile3, respectively. The default number of",
+    "    histogram bins is 101. The default can be overridden by setting the",
+    "    environment variable CDO_PCTL_NBINS to a different value. The files",
+    "    ifile2 and ifile3 should be the result of corresponding",
+    "    timselmin and timselmax operations, respectively.",
+    "    The date information of a timestep in ofile is the date of the last ",
+    "    contributing timestep in ifile.",
+    "    For every adjacent sequence t1, ...., tn of timesteps of the same ",
+    "    selected time range it is",
+    "    ",
+    "    o(t,x) = pth percentile {i(t',x), t1 < t' <= tn}",
+    "",
+    "PARAMETER",
+    "    p        FLOAT    Percentile number in {0, ..., 100}",
+    "    nsets    INTEGER  Number of input timesteps for each output timestep ",
+    "    noffset  INTEGER  Number of input timesteps skipped before the first timestep range (optional)",
+    "    nskip    INTEGER  Number of input timesteps skipped between timestep ranges (optional)",
+    "",
+    "ENVIRONMENT",
+    "    CDO_PCTL_NBINS",
+    "        Sets the number of histogram bins. The default number is 101.",
+    NULL
+};
+
+static char *RunstatHelp[] = {
+    "NAME",
+    "    runmin, runmax, runsum, runmean, runavg, runvar, runstd - ",
+    "    Running statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>,nts  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes running statistical values over a selected number",
+    "    of timesteps. Depending on the chosen operator the minimum, maximum,",
+    "    sum, average, variance or standard deviation of a selected number of consecutive ",
+    "    timesteps read from ifile is written to ofile. The date information ",
+    "    in ofile is the date of the middle contributing timestep in ifile.",
+    "",
+    "OPERATORS",
+    "    runmin   Running minimum",
+    "             o(t+(nts-1)/2,x) = min{i(t,x), i(t+1,x), ..., i(t+nts-1,x)}",
+    "    runmax   Running maximum",
+    "             o(t+(nts-1)/2,x) = max{i(t,x), i(t+1,x), ..., i(t+nts-1,x)}",
+    "    runsum   Running sum",
+    "             o(t+(nts-1)/2,x) = sum{i(t,x), i(t+1,x), ..., i(t+nts-1,x)}",
+    "    runmean  Running mean",
+    "             o(t+(nts-1)/2,x) = mean{i(t,x), i(t+1,x), ..., i(t+nts-1,x)}",
+    "    runavg   Running average",
+    "             o(t+(nts-1)/2,x) = avg{i(t,x), i(t+1,x), ..., i(t+nts-1,x)}",
+    "    runvar   Running variance",
+    "             o(t+(nts-1)/2,x) = var{i(t,x), i(t+1,x), ..., i(t+nts-1,x)}",
+    "    runstd   Running standard deviation",
+    "             o(t+(nts-1)/2,x) = std{i(t,x), i(t+1,x), ..., i(t+nts-1,x)}",
+    "",
+    "PARAMETER",
+    "    nts  INTEGER  Number of timesteps",
+    "",
+    "ENVIRONMENT",
+    "    RUNSTAT_DATE",
+    "        Sets the date information in ofile to the \"first\", \"last\" or \"middle\" contributing",
+    "        timestep in ifile.",
+    NULL
+};
+
+static char *RunpctlHelp[] = {
+    "NAME",
+    "    runpctl - Running percentile values",
+    "",
+    "SYNOPSIS",
+    "    runpctl,p,nts  ifile1 ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes running percentiles over a selected number of time",
+    "    steps in ifile1.",
+    "    The date information in ofile is the date of the medium contributing",
+    "    timestep in ifile1.",
+    "    ",
+    "    o(t+(nts-1)/2,x) = pth percentile {i(t,x), i(t+1,x), ..., i(t+nts-1,x)}",
+    "",
+    "PARAMETER",
+    "    p    FLOAT    Percentile number in {0, ..., 100}",
+    "    nts  INTEGER  Number of timesteps",
+    NULL
+};
+
+static char *TimstatHelp[] = {
+    "NAME",
+    "    timmin, timmax, timsum, timmean, timavg, timvar, timstd - ",
+    "    Statistical values over all timesteps",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical  values over all timesteps in ifile.",
+    "    Depending on the chosen operator the minimum, maximum, sum, average, variance",
+    "    or standard deviation of all timesteps read from ifile is written to ofile.",
+    "    The date information of a timestep in ofile is the date of the last ",
+    "    contributing timestep in ifile.",
+    "",
+    "OPERATORS",
+    "    timmin   Time minimum",
+    "             o(1,x) = min{i(t',x), t_1<t'<=t_n}",
+    "    timmax   Time maximum",
+    "             o(1,x) = max{i(t',x), t_1<t'<=t_n}",
+    "    timsum   Time sum",
+    "             o(1,x) = sum{i(t',x), t_1<t'<=t_n}",
+    "    timmean  Time mean",
+    "             o(1,x) = mean{i(t',x), t_1<t'<=t_n}",
+    "    timavg   Time average",
+    "             o(1,x) = avg{i(t',x), t_1<t'<=t_n}",
+    "    timvar   Time variance",
+    "             o(1,x) = var{i(t',x), t_1<t'<=t_n}",
+    "    timstd   Time standard deviation",
+    "             o(1,x) = std{i(t',x), t_1<t'<=t_n}",
+    NULL
+};
+
+static char *TimpctlHelp[] = {
+    "NAME",
+    "    timpctl - Percentile values over all timesteps",
+    "",
+    "SYNOPSIS",
+    "    timpctl,p  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator computes percentiles over all timesteps in ifile1.",
+    "    The algorithm uses histograms with minimum and maximum bounds given in",
+    "    ifile2 and ifile3, respectively. The default number of",
+    "    histogram bins is 101. The default can be overridden by setting the",
+    "    environment variable CDO_PCTL_NBINS to a different value. The files",
+    "    ifile2 and ifile3 should be the result of corresponding",
+    "    timmin and timmax operations, respectively.",
+    "    The date information of a timestep in ofile is the date of the",
+    "    last contributing timestep in ifile1.",
+    "    ",
+    "    o(1,x) = pth percentile {i(t',x), t_1<t'<=t_n}",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    "",
+    "ENVIRONMENT",
+    "    CDO_PCTL_NBINS",
+    "        Sets the number of histogram bins. The default number is 101.",
+    NULL
+};
+
+static char *HourstatHelp[] = {
+    "NAME",
+    "    hourmin, hourmax, hoursum, hourmean, houravg, hourvar, hourstd - ",
+    "    Hourly statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values over timesteps of the same hour.",
+    "    Depending on the chosen operator the minimum, maximum, sum, average, variance",
+    "    or standard deviation of timesteps of the same hour is written to ofile.",
+    "    The date information of a timestep in ofile is the date of the last ",
+    "    contributing timestep in ifile.",
+    "",
+    "OPERATORS",
+    "    hourmin   Hourly minimum",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same hour it is:",
+    "              ",
+    "              o(t,x) = min{i(t',x), t_1<t'<=t_n}",
+    "    hourmax   Hourly maximum",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same hour it is:",
+    "              ",
+    "              o(t,x) = max{i(t',x), t_1<t'<=t_n}",
+    "    hoursum   Hourly sum",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same hour it is:",
+    "              ",
+    "              o(t,x) = sum{i(t',x), t_1<t'<=t_n}",
+    "    hourmean  Hourly mean",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same hour it is:",
+    "              ",
+    "              o(t,x) = mean{i(t',x), t_1<t'<=t_n}",
+    "    houravg   Hourly average",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same hour it is:",
+    "              ",
+    "              o(t,x) = avg{i(t',x), t_1<t'<=t_n}",
+    "    hourvar   Hourly variance",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same hour it is:",
+    "              ",
+    "              o(t,x) = var{i(t',x), t_1<t'<=t_n}",
+    "    hourstd   Hourly standard deviation",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same hour it is:",
+    "              ",
+    "              o(t,x) = std{i(t',x), t_1<t'<=t_n}",
+    NULL
+};
+
+static char *HourpctlHelp[] = {
+    "NAME",
+    "    hourpctl - Hourly percentile values",
+    "",
+    "SYNOPSIS",
+    "    hourpctl,p  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator computes percentiles over all timesteps of the same hour in ifile1.",
+    "    The algorithm uses histograms with minimum and maximum bounds given in",
+    "    ifile2 and ifile3, respectively. The default number of",
+    "    histogram bins is 101. The default can be overridden by setting the",
+    "    environment variable CDO_PCTL_NBINS to a different value. The files",
+    "    ifile2 and ifile3 should be the result of corresponding",
+    "    hourmin and hourmax operations, respectively.",
+    "    The date information of a timestep in ofile is the date of the",
+    "    last contributing timestep in ifile1.",
+    "    For every adjacent sequence t_1, ...,t_n of timesteps of the same hour it is:",
+    "    ",
+    "    o(t,x) = pth percentile {i(t',x), t_1<t'<=t_n}",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    "",
+    "ENVIRONMENT",
+    "    CDO_PCTL_NBINS",
+    "        Sets the number of histogram bins. The default number is 101.",
+    NULL
+};
+
+static char *DaystatHelp[] = {
+    "NAME",
+    "    daymin, daymax, daysum, daymean, dayavg, dayvar, daystd - ",
+    "    Daily statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values over timesteps of the same day.",
+    "    Depending on the chosen operator the minimum, maximum, sum, average, variance",
+    "    or standard deviation of timesteps of the same day is written to ofile.",
+    "    The date information of a timestep in ofile is the date of the last ",
+    "    contributing timestep in ifile.",
+    "",
+    "OPERATORS",
+    "    daymin   Daily minimum",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same day it is",
+    "             ",
+    "             o(t,x) = min{i(t',x), t_1<t'<=t_n}",
+    "    daymax   Daily maximum",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same day it is",
+    "             ",
+    "             o(t,x) = max{i(t',x), t_1<t'<=t_n}",
+    "    daysum   Daily sum",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same day it is",
+    "             ",
+    "             o(t,x) = sum{i(t',x), t_1<t'<=t_n}",
+    "    daymean  Daily mean",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same day it is",
+    "             ",
+    "             o(t,x) = mean{i(t',x), t_1<t'<=t_n}",
+    "    dayavg   Daily average",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same day it is",
+    "             ",
+    "             o(t,x) = avg{i(t',x), t_1<t'<=t_n}",
+    "    dayvar   Daily variance",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same day it is",
+    "             ",
+    "             o(t,x) = var{i(t',x), t_1<t'<=t_n}",
+    "    daystd   Daily standard deviation",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same day it is",
+    "             ",
+    "             o(t,x) = std{i(t',x), t_1<t'<=t_n}",
+    NULL
+};
+
+static char *DaypctlHelp[] = {
+    "NAME",
+    "    daypctl - Daily percentile values",
+    "",
+    "SYNOPSIS",
+    "    daypctl,p  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator computes percentiles over all timesteps of the same day in ifile1.",
+    "    The algorithm uses histograms with minimum and maximum bounds given in",
+    "    ifile2 and ifile3, respectively. The default number of",
+    "    histogram bins is 101. The default can be overridden by defining the",
+    "    environment variable CDO_PCTL_NBINS. The files ifile2 and",
+    "    ifile3 should be the result of corresponding daymin and daymax",
+    "    operations, respectively.",
+    "    The date information of a timestep in ofile is the date of the",
+    "    last contributing timestep in ifile1.",
+    "    For every adjacent sequence t_1, ...,t_n of timesteps of the same day it is",
+    "    ",
+    "    o(t,x) = pth percentile {i(t',x), t_1<t'<=t_n}",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    "",
+    "ENVIRONMENT",
+    "    CDO_PCTL_NBINS",
+    "        Sets the number of histogram bins. The default number is 101.",
+    NULL
+};
+
+static char *MonstatHelp[] = {
+    "NAME",
+    "    monmin, monmax, monsum, monmean, monavg, monvar, monstd - ",
+    "    Monthly statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values over timesteps of the same month.",
+    "    Depending on the chosen operator the minimum, maximum, sum, average, variance",
+    "    or standard deviation of timesteps of the same month is written to ofile.",
+    "    The date information of a timestep in ofile is the date of the last ",
+    "    contributing timestep in ifile.",
+    "",
+    "OPERATORS",
+    "    monmin   Monthly minimum",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same month it is:",
+    "             ",
+    "             o(t,x) = min{i(t',x), t_1<t'<=t_n}",
+    "    monmax   Monthly maximum",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same month it is",
+    "             ",
+    "             o(t,x) = max{i(t',x), t_1<t'<=t_n}",
+    "    monsum   Monthly sum",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same month it is",
+    "             ",
+    "             o(t,x) = sum{i(t',x), t_1<t'<=t_n}",
+    "    monmean  Monthly mean",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same month it is",
+    "             ",
+    "             o(t,x) = mean{i(t',x), t_1<t'<=t_n}",
+    "    monavg   Monthly average",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same month it is",
+    "             ",
+    "             o(t,x) = avg{i(t',x), t_1<t'<=t_n}",
+    "    monvar   Monthly variance",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same month it is",
+    "             ",
+    "             o(t,x) = var{i(t',x), t_1 < t' <= t_n}",
+    "    monstd   Monthly standard deviation",
+    "             For every adjacent sequence t_1, ...,t_n of timesteps of the same month it is",
+    "             ",
+    "             o(t,x) = std{i(t',x), t_1 < t' <= t_n}",
+    NULL
+};
+
+static char *MonpctlHelp[] = {
+    "NAME",
+    "    monpctl - Monthly percentile values",
+    "",
+    "SYNOPSIS",
+    "    monpctl,p  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator computes percentiles over all timesteps of the same month in ifile1.",
+    "    The algorithm uses histograms with minimum and maximum bounds given in",
+    "    ifile2 and ifile3, respectively. The default number of",
+    "    histogram bins is 101. The default can be overridden by setting the",
+    "    environment variable CDO_PCTL_NBINS to a different value. The files",
+    "    ifile2 and ifile3 should be the result of corresponding",
+    "    monmin and monmax operations, respectively.",
+    "    The date information of a timestep in ofile is the date of the",
+    "    last contributing timestep in ifile1.",
+    "    For every adjacent sequence t_1, ...,t_n of timesteps of the same month it is:",
+    "    ",
+    "    o(t,x) = pth percentile {i(t',x), t_1<t'<=t_n}",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    "",
+    "ENVIRONMENT",
+    "    CDO_PCTL_NBINS",
+    "        Sets the number of histogram bins. The default number is 101.",
+    NULL
+};
+
+static char *YearstatHelp[] = {
+    "NAME",
+    "    yearmin, yearmax, yearsum, yearmean, yearavg, yearvar, yearstd - ",
+    "    Yearly statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values over timesteps of the same year.",
+    "    Depending on the chosen operator the minimum, maximum, sum, average, variance",
+    "    or standard deviation of timesteps of the same year is written to ofile.",
+    "    The date information of a timestep in ofile is the date of the last ",
+    "    contributing timestep in ifile.",
+    "",
+    "OPERATORS",
+    "    yearmin   Yearly minimum",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same year it is",
+    "              ",
+    "              o(t,x) = min{i(t',x), t_1<t'<=t_n}",
+    "    yearmax   Yearly maximum",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same year it is",
+    "              ",
+    "              o(t,x) = max{i(t',x), t_1<t'<=t_n}",
+    "    yearsum   Yearly sum",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same year it is",
+    "              ",
+    "              o(t,x) = sum{i(t',x), t_1<t'<=t_n}",
+    "    yearmean  Yearly mean",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same year it is",
+    "              ",
+    "              o(t,x) = mean{i(t',x), t_1<t'<=t_n}",
+    "    yearavg   Yearly average",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same year it is",
+    "              ",
+    "              o(t,x) = avg{i(t',x), t_1<t'<=t_n}",
+    "    yearvar   Yearly variance",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same year it is",
+    "              ",
+    "              o(t,x) = var{i(t',x), t_1 < t' <= t_n}",
+    "    yearstd   Yearly standard deviation",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same year it is",
+    "              ",
+    "              o(t,x) = std{i(t',x), t_1 < t' <= t_n}",
+    NULL
+};
+
+static char *YearpctlHelp[] = {
+    "NAME",
+    "    yearpctl - Yearly percentile values",
+    "",
+    "SYNOPSIS",
+    "    yearpctl,p  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator computes percentiles over all timesteps of the same year in ifile1.",
+    "    The algorithm uses histograms with minimum and maximum bounds given in",
+    "    ifile2 and ifile3, respectively. The default number of",
+    "    histogram bins is 101. The default can be overridden by setting the",
+    "    environment variable CDO_PCTL_NBINS to a different value. The files",
+    "    ifile2 and ifile3 should be the result of corresponding",
+    "    yearmin and yearmax operations, respectively.",
+    "    The date information of a timestep in ofile is the date of the",
+    "    last contributing timestep in ifile1.",
+    "    For every adjacent sequence t_1, ...,t_n of timesteps of the same year it is",
+    "    ",
+    "    o(t,x) = pth percentile {i(t',x), t_1<t'<=t_n}",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    "",
+    "ENVIRONMENT",
+    "    CDO_PCTL_NBINS",
+    "        Sets the number of histogram bins. The default number is 101.",
+    NULL
+};
+
+static char *SeasstatHelp[] = {
+    "NAME",
+    "    seasmin, seasmax, seassum, seasmean, seasavg, seasvar, seasstd - ",
+    "    Seasonal statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values over timesteps of the same season.",
+    "    Depending on the chosen operator the minimum, maximum, sum, average, variance",
+    "    or standard deviation of timesteps of the same season is written to ofile.",
+    "    The date information of a timestep in ofile is the date of the last ",
+    "    contributing timestep in ifile. Be careful about the first and the last ",
+    "    output timestep , they may be incorrect values if the seasons have incomplete ",
+    "    timesteps.",
+    "",
+    "OPERATORS",
+    "    seasmin   Seasonal minimum",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is",
+    "              ",
+    "              o(t,x) = min{i(t',x), t1 < t' <= tn}",
+    "    seasmax   Seasonal maximum",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is",
+    "              ",
+    "              o(t,x) = max{i(t',x), t1 < t' <= tn}",
+    "    seassum   Seasonal sum",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is",
+    "              ",
+    "              o(t,x) = sum{i(t',x), t1 < t' <= tn}",
+    "    seasmean  Seasonal mean",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is",
+    "              ",
+    "              o(t,x) = mean{i(t',x), t1 < t' <= tn}",
+    "    seasavg   Seasonal average",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is",
+    "              ",
+    "              o(t,x) = avg{i(t',x), t1 < t' <= tn}",
+    "    seasvar   Seasonal variance",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is",
+    "              ",
+    "              o(t,x) = var{i(t',x), t1 < t' <= tn}",
+    "    seasstd   Seasonal standard deviation",
+    "              For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is",
+    "              ",
+    "              o(t,x) = std{i(t',x), t1 < t' <= tn}",
+    NULL
+};
+
+static char *SeaspctlHelp[] = {
+    "NAME",
+    "    seaspctl - Seasonal percentile values",
+    "",
+    "SYNOPSIS",
+    "    seaspctl,p  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator computes percentiles over all timesteps in ifile1 of the same season.",
+    "    The algorithm uses histograms with minimum and maximum bounds given in",
+    "    ifile2 and ifile3, respectively. The default number of",
+    "    histogram bins is 101. The default can be overridden by setting the",
+    "    environment variable CDO_PCTL_NBINS to a different value. The files",
+    "    ifile2 and ifile3 should be the result of corresponding",
+    "    seasmin and seasmax operations, respectively.",
+    "    The date information of a timestep in ofile is the date of the",
+    "    last contributing timestep in ifile1. Be careful about the first",
+    "    and the last output timestep , they may be incorrect values if the seasons",
+    "    have incomplete timesteps.",
+    "    For every adjacent sequence t_1, ...,t_n of timesteps of the same season it is",
+    "    ",
+    "    o(t,x) = pth percentile {i(t',x), t1 < t' <= tn}",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    "",
+    "ENVIRONMENT",
+    "    CDO_PCTL_NBINS",
+    "        Sets the number of histogram bins. The default number is 101.",
+    NULL
+};
+
+static char *YhourstatHelp[] = {
+    "NAME",
+    "    yhourmin, yhourmax, yhoursum, yhourmean, yhouravg, yhourvar, yhourstd - ",
+    "    Multi-year hourly statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values of each hour and day of year.",
+    "    Depending on the chosen operator the minimum, maximum, sum, average, variance",
+    "    or standard deviation of each hour and day of year in ifile is written to ofile.",
+    "    The date information in an output field is the date of the last contributing input field.",
+    "",
+    "OPERATORS",
+    "    yhourmin   Multi-year hourly minimum",
+    "               o(0001,x) = min{i(t,x), day(i(t)) = 0001}",
+    "                                ...",
+    "               o(8784,x) = min{i(t,x), day(i(t)) = 8784}",
+    "    yhourmax   Multi-year hourly maximum",
+    "               o(0001,x) = max{i(t,x), day(i(t)) = 0001}",
+    "                                ...",
+    "               o(8784,x) = max{i(t,x), day(i(t)) = 8784}",
+    "    yhoursum   Multi-year hourly sum",
+    "               o(0001,x) = sum{i(t,x), day(i(t)) = 0001}",
+    "                                ...",
+    "               o(8784,x) = sum{i(t,x), day(i(t)) = 8784}",
+    "    yhourmean  Multi-year hourly mean",
+    "               o(0001,x) = mean{i(t,x), day(i(t)) = 0001}",
+    "                                ...",
+    "               o(8784,x) = mean{i(t,x), day(i(t)) = 8784}",
+    "    yhouravg   Multi-year hourly average",
+    "               o(0001,x) = avg{i(t,x), day(i(t)) = 0001}",
+    "                                ...",
+    "               o(8784,x) = avg{i(t,x), day(i(t)) = 8784}",
+    "    yhourvar   Multi-year hourly variance",
+    "               o(0001,x) = var{i(t,x), day(i(t)) = 0001}",
+    "                                ...",
+    "               o(8784,x) = var{i(t,x), day(i(t)) = 8784}",
+    "    yhourstd   Multi-year hourly standard deviation",
+    "               o(0001,x) = std{i(t,x), day(i(t)) = 0001}",
+    "                                ...",
+    "               o(8784,x) = std{i(t,x), day(i(t)) = 8784}",
+    NULL
+};
+
+static char *YdaystatHelp[] = {
+    "NAME",
+    "    ydaymin, ydaymax, ydaysum, ydaymean, ydayavg, ydayvar, ydaystd - ",
+    "    Multi-year daily statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values of each day of year.",
+    "    Depending on the chosen operator the minimum, maximum, sum, average, variance",
+    "    or standard deviation of each day of year in ifile is written to ofile.",
+    "    The date information in an output field is the date of the last contributing input field.",
+    "",
+    "OPERATORS",
+    "    ydaymin   Multi-year daily minimum",
+    "              o(001,x) = min{i(t,x), day(i(t)) = 001}",
+    "                               ...",
+    "              o(366,x) = min{i(t,x), day(i(t)) = 366}",
+    "    ydaymax   Multi-year daily maximum",
+    "              o(001,x) = max{i(t,x), day(i(t)) = 001}",
+    "                               ...",
+    "              o(366,x) = max{i(t,x), day(i(t)) = 366}",
+    "    ydaysum   Multi-year daily sum",
+    "              o(001,x) = sum{i(t,x), day(i(t)) = 001}",
+    "                               ...",
+    "              o(366,x) = sum{i(t,x), day(i(t)) = 366}",
+    "    ydaymean  Multi-year daily mean",
+    "              o(001,x) = mean{i(t,x), day(i(t)) = 001}",
+    "                               ...",
+    "              o(366,x) = mean{i(t,x), day(i(t)) = 366}",
+    "    ydayavg   Multi-year daily average",
+    "              o(001,x) = avg{i(t,x), day(i(t)) = 001}",
+    "                               ...",
+    "              o(366,x) = avg{i(t,x), day(i(t)) = 366}",
+    "    ydayvar   Multi-year daily variance",
+    "              o(001,x) = var{i(t,x), day(i(t)) = 001}",
+    "                               ...",
+    "              o(366,x) = var{i(t,x), day(i(t)) = 366}",
+    "    ydaystd   Multi-year daily standard deviation",
+    "              o(001,x) = std{i(t,x), day(i(t)) = 001}",
+    "                               ...",
+    "              o(366,x) = std{i(t,x), day(i(t)) = 366}",
+    NULL
+};
+
+static char *YdaypctlHelp[] = {
+    "NAME",
+    "    ydaypctl - Multi-year daily percentile values",
+    "",
+    "SYNOPSIS",
+    "    ydaypctl,p  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator writes a certain percentile of each day of year in ifile1 to ofile.",
+    "    The algorithm uses histograms with minimum and maximum bounds given in",
+    "    ifile2 and ifile3, respectively. The default number of",
+    "    histogram bins is 101. The default can be overridden by setting the",
+    "    environment variable CDO_PCTL_NBINS to a different value. The files",
+    "    ifile2 and ifile3 should be the result of corresponding",
+    "    ydaymin and ydaymax operations, respectively.",
+    "    The date information in an output field is the date of the last",
+    "    contributing input field.",
+    "    ",
+    "    o(001,x) = pth percentile {i(t,x), day(i(t)) = 001}",
+    "                     ...",
+    "    o(366,x) = pth percentile {i(t,x), day(i(t)) = 366}",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    "",
+    "ENVIRONMENT",
+    "    CDO_PCTL_NBINS",
+    "        Sets the number of histogram bins. The default number is 101.",
+    NULL
+};
+
+static char *YmonstatHelp[] = {
+    "NAME",
+    "    ymonmin, ymonmax, ymonsum, ymonmean, ymonavg, ymonvar, ymonstd - ",
+    "    Multi-year monthly statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values of each month of year.",
+    "    Depending on the chosen operator the minimum, maximum, sum, average, variance",
+    "    or standard deviation of each month of year in ifile is written to ofile.",
+    "    The date information in an output field is the date of the last contributing input field.",
+    "",
+    "OPERATORS",
+    "    ymonmin   Multi-year monthly minimum",
+    "              o(01,x) = min{i(t,x), month(i(t)) = 01}",
+    "                               ...",
+    "              o(12,x) = min{i(t,x), month(i(t)) = 12}",
+    "    ymonmax   Multi-year monthly maximum",
+    "              o(01,x) = max{i(t,x), month(i(t)) = 01}",
+    "                               ...",
+    "              o(12,x) = max{i(t,x), month(i(t)) = 12}",
+    "    ymonsum   Multi-year monthly sum",
+    "              o(01,x) = sum{i(t,x), month(i(t)) = 01}",
+    "                               ...",
+    "              o(12,x) = sum{i(t,x), month(i(t)) = 12}",
+    "    ymonmean  Multi-year monthly mean",
+    "              o(01,x) = mean{i(t,x), month(i(t)) = 01}",
+    "                               ...",
+    "              o(12,x) = mean{i(t,x), month(i(t)) = 12}",
+    "    ymonavg   Multi-year monthly average",
+    "              o(01,x) = avg{i(t,x), month(i(t)) = 01}",
+    "                               ...",
+    "              o(12,x) = avg{i(t,x), month(i(t)) = 12}",
+    "    ymonvar   Multi-year monthly variance",
+    "              o(01,x) = var{i(t,x), month(i(t)) = 01}",
+    "                               ...",
+    "              o(12,x) = var{i(t,x), month(i(t)) = 12}",
+    "    ymonstd   Multi-year monthly standard deviation",
+    "              o(01,x) = std{i(t,x), month(i(t)) = 01}",
+    "                               ...",
+    "              o(12,x) = std{i(t,x), month(i(t)) = 12}",
+    NULL
+};
+
+static char *YmonpctlHelp[] = {
+    "NAME",
+    "    ymonpctl - Multi-year monthly percentile values",
+    "",
+    "SYNOPSIS",
+    "    ymonpctl,p  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator writes a certain percentile of each month of year in ifile1 to ofile.",
+    "    The algorithm uses histograms with minimum and maximum bounds given in",
+    "    ifile2 and ifile3, respectively. The default number of",
+    "    histogram bins is 101. The default can be overridden by setting the",
+    "    environment variable CDO_PCTL_NBINS to a different value. The files",
+    "    ifile2 and ifile3 should be the result of corresponding",
+    "    ymonmin and ymonmax operations, respectively.",
+    "    The date information in an output field is the date of the last",
+    "    contributing input field.",
+    "    ",
+    "    o(01,x) = pth percentile {i(t,x), month(i(t)) = 01}",
+    "                     ...",
+    "    o(12,x) = pth percentile {i(t,x), month(i(t)) = 12}",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    "",
+    "ENVIRONMENT",
+    "    CDO_PCTL_NBINS",
+    "        Sets the number of histogram bins. The default number is 101.",
+    NULL
+};
+
+static char *YseasstatHelp[] = {
+    "NAME",
+    "    yseasmin, yseasmax, yseassum, yseasmean, yseasavg, yseasvar, yseasstd - ",
+    "    Multi-year seasonal statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module computes statistical values of each season.",
+    "    Depending on the chosen operator the minimum, maximum, sum, average, variance",
+    "    or standard deviation of each season in ifile is written to ofile.",
+    "    The date information in an output field is the date of the last contributing input field.",
+    "",
+    "OPERATORS",
+    "    yseasmin   Multi-year seasonal minimum",
+    "               o(1,x) = min{i(t,x), month(i(t)) = 12, 01, 02}",
+    "               o(2,x) = min{i(t,x), month(i(t)) = 03, 04, 05}",
+    "               o(3,x) = min{i(t,x), month(i(t)) = 06, 07, 08}",
+    "               o(4,x) = min{i(t,x), month(i(t)) = 09, 10, 11}",
+    "    yseasmax   Multi-year seasonal maximum",
+    "               o(1,x) = max{i(t,x), month(i(t)) = 12, 01, 02}",
+    "               o(2,x) = max{i(t,x), month(i(t)) = 03, 04, 05}",
+    "               o(3,x) = max{i(t,x), month(i(t)) = 06, 07, 08}",
+    "               o(4,x) = max{i(t,x), month(i(t)) = 09, 10, 11}",
+    "    yseassum   Multi-year seasonal sum",
+    "               o(1,x) = sum{i(t,x), month(i(t)) = 12, 01, 02}",
+    "               o(2,x) = sum{i(t,x), month(i(t)) = 03, 04, 05}",
+    "               o(3,x) = sum{i(t,x), month(i(t)) = 06, 07, 08}",
+    "               o(4,x) = sum{i(t,x), month(i(t)) = 09, 10, 11}",
+    "    yseasmean  Multi-year seasonal mean",
+    "               o(1,x) = mean{i(t,x), month(i(t)) = 12, 01, 02}",
+    "               o(2,x) = mean{i(t,x), month(i(t)) = 03, 04, 05}",
+    "               o(3,x) = mean{i(t,x), month(i(t)) = 06, 07, 08}",
+    "               o(4,x) = mean{i(t,x), month(i(t)) = 09, 10, 11}",
+    "    yseasavg   Multi-year seasonal average",
+    "               o(1,x) = avg{i(t,x), month(i(t)) = 12, 01, 02}",
+    "               o(2,x) = avg{i(t,x), month(i(t)) = 03, 04, 05}",
+    "               o(3,x) = avg{i(t,x), month(i(t)) = 06, 07, 08}",
+    "               o(4,x) = avg{i(t,x), month(i(t)) = 09, 10, 11}",
+    "    yseasvar   Multi-year seasonal variance",
+    "               o(1,x) = var{i(t,x), month(i(t)) = 12, 01, 02}",
+    "               o(2,x) = var{i(t,x), month(i(t)) = 03, 04, 05}",
+    "               o(3,x) = var{i(t,x), month(i(t)) = 06, 07, 08}",
+    "               o(4,x) = var{i(t,x), month(i(t)) = 09, 10, 11}",
+    "    yseasstd   Multi-year seasonal standard deviation",
+    "               o(1,x) = std{i(t,x), month(i(t)) = 12, 01, 02}",
+    "               o(2,x) = std{i(t,x), month(i(t)) = 03, 04, 05}",
+    "               o(3,x) = std{i(t,x), month(i(t)) = 06, 07, 08}",
+    "               o(4,x) = std{i(t,x), month(i(t)) = 09, 10, 11}",
+    NULL
+};
+
+static char *YseaspctlHelp[] = {
+    "NAME",
+    "    yseaspctl - Multi-year seasonal percentile values",
+    "",
+    "SYNOPSIS",
+    "    yseaspctl,p  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator writes a certain percentile of each season in ifile1 to ofile.",
+    "    The algorithm uses histograms with minimum and maximum bounds given in",
+    "    ifile2 and ifile3, respectively. The default number of",
+    "    histogram bins is 101. The default can be overridden by setting the",
+    "    environment variable CDO_PCTL_NBINS to a different value. The files",
+    "    ifile2 and ifile3 should be the result of corresponding",
+    "    yseasmin and yseasmax operations, respectively.",
+    "    The date information in an output field is the date of the last",
+    "    contributing input field.",
+    "    ",
+    "    o(1,x) = pth percentile {i(t,x), month(i(t)) = 12, 01, 02}",
+    "    o(2,x) = pth percentile {i(t,x), month(i(t)) = 03, 04, 05}",
+    "    o(3,x) = pth percentile {i(t,x), month(i(t)) = 06, 07, 08}",
+    "    o(4,x) = pth percentile {i(t,x), month(i(t)) = 09, 10, 11}",
+    "",
+    "PARAMETER",
+    "    p  FLOAT  Percentile number in {0, ..., 100}",
+    "",
+    "ENVIRONMENT",
+    "    CDO_PCTL_NBINS",
+    "        Sets the number of histogram bins. The default number is 101.",
+    NULL
+};
+
+static char *YdrunstatHelp[] = {
+    "NAME",
+    "    ydrunmin, ydrunmax, ydrunsum, ydrunmean, ydrunavg, ydrunvar, ydrunstd - ",
+    "    Multi-year daily running statistical values",
+    "",
+    "SYNOPSIS",
+    "    <operator>,nts  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module writes running statistical values for each day of year",
+    "    in ifile to ofile. Depending on the chosen operator, the minimum,",
+    "    maximum, sum, average, variance or standard deviation of all timesteps in",
+    "    running windows of wich the medium timestep corresponds to a certain day of",
+    "    year is computed. The date information in an output field is the date of the",
+    "    medium timestep in the last contributing running window.",
+    "    Note that the operator have to be applied to a continuous time series of daily",
+    "    measurements in order to yield physically meaningful results. Also note that",
+    "    the output time series begins (nts-1)/2 timesteps after the first timestep",
+    "    of the input time series and ends (nts-1)/2 timesteps before the last one.",
+    "    For input data which are complete but not continuous, such as time series of",
+    "    daily measurements for the same month or season within different years, the",
+    "    operator yields physically meaningful results only if the input time series",
+    "    does include the (nts-1)/2 days before and after each period of interest.",
+    "",
+    "OPERATORS",
+    "    ydrunmin   Multi-year daily running minimum",
+    "               o(001,x) = min{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 001}",
+    "                                ...",
+    "               o(366,x) = min{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 366}",
+    "    ydrunmax   Multi-year daily running maximum",
+    "               o(001,x) = max{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 001}",
+    "                                ...",
+    "               o(366,x) = max{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 366}",
+    "    ydrunsum   Multi-year daily running sum",
+    "               o(001,x) = sum{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 001}",
+    "                                ...",
+    "               o(366,x) = sum{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 366}",
+    "    ydrunmean  Multi-year daily running mean",
+    "               o(001,x) = mean{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 001}",
+    "                                ...",
+    "               o(366,x) = mean{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 366}",
+    "    ydrunavg   Multi-year daily running average",
+    "               o(001,x) = avg{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 001}",
+    "                                ...",
+    "               o(366,x) = avg{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 366}",
+    "    ydrunvar   Multi-year daily running variance",
+    "               o(001,x) = var{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 001}",
+    "                                ...",
+    "               o(366,x) = var{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 366}",
+    "    ydrunstd   Multi-year daily running standard deviation",
+    "               o(001,x) = std{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[i(t+(nts-1)/2)] = 001}",
+    "                                ...",
+    "               o(366,x) = std{i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[i(t+(nts-1)/2)] = 366}",
+    "",
+    "PARAMETER",
+    "    nts  INTEGER  Number of timesteps",
+    NULL
+};
+
+static char *YdrunpctlHelp[] = {
+    "NAME",
+    "    ydrunpctl - Multi-year daily running percentile values",
+    "",
+    "SYNOPSIS",
+    "    ydrunpctl,p,nts  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator writes running percentile values for each day of year ",
+    "    in ifile1 to ofile. A certain percentile is computed for all",
+    "    timesteps in running windows of which the medium timestep corresponds",
+    "    to a certain day of year. ",
+    "    The algorithm uses histograms with minimum and maximum bounds given in",
+    "    ifile2 and ifile3, respectively. The default number of",
+    "    histogram bins is 101. The default can be overridden by setting the",
+    "    environment variable CDO_PCTL_NBINS to a different value. The files",
+    "    ifile2 and ifile3 should be the result of corresponding",
+    "    ydrunmin and ydrunmax operations, respectively.",
+    "    The date information in an output field is the date of the medium time",
+    "    step in the last contributing running window.",
+    "    Note that the operator have to be applied to a continuous time series of daily",
+    "    measurements in order to yield physically meaningful results. Also note that",
+    "    the output time series begins (nts-1)/2 timesteps after the first timestep ",
+    "    of the input time series and ends (nts-1)/2 timesteps before the last.",
+    "    For input data which are complete but not continuous, such as time series of",
+    "    daily measurements for the same month or season within different years, the",
+    "    operator only yields physically meaningful results if the input time series",
+    "    does include the (nts-1)/2 days before and after each period of interest.",
+    "    ",
+    "    o(001,x) = pth percentile {i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 001}",
+    "                     ...",
+    "    o(366,x) = pth percentile {i(t,x), i(t+1,x), ..., i(t+nts-1,x); day[(i(t+(nts-1)/2)] = 366}",
+    "",
+    "PARAMETER",
+    "    p    FLOAT    Percentile number in {0, ..., 100}",
+    "    nts  INTEGER  Number of timesteps",
+    "",
+    "ENVIRONMENT",
+    "    CDO_PCTL_NBINS",
+    "        Sets the number of histogram bins. The default number is 101.",
+    NULL
+};
+
+static char *FldcorHelp[] = {
+    "NAME",
+    "    fldcor - Correlation in grid space",
+    "",
+    "SYNOPSIS",
+    "    fldcor  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    The correlation coefficient is a quantity that gives the quality of a least ",
+    "    squares fitting to the original data. This operator correlates all gridpoints",
+    "    of two fields for each timestep. With",
+    "    ",
+    "    S(t) = {x, i_1(t,x) != missval and i_2(t,x) != missval}",
+    "    it is",
+    "    ",
+    "    o(t,1) = Cor{(i_1(t,x), i_2(t,x)), x_1 < x <= x_n}",
+    "    where w(x) are the area weights obtained by the input streams.",
+    "    For every timestep t only those field elements x belong to the sample,",
+    "    which have i_1(t,x) \\neq missval and i_2(t,x) \\neq missval.",
+    NULL
+};
+
+static char *TimcorHelp[] = {
+    "NAME",
+    "    timcor - Correlation over time",
+    "",
+    "SYNOPSIS",
+    "    timcor  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    The correlation coefficient is a quantity that gives the quality of a least ",
+    "    squares fitting to the original data. This operator correlates each gridpoint",
+    "    of two fields over all timesteps. With",
+    "    ",
+    "    S(x) = {t, i_1(t,x) != missval and i_2(t,x) != missval}",
+    "    it is",
+    "    ",
+    "    o(1,x) = Cor{(i_1(t,x), i_2(t,x)), t_1 < t <= t_n}",
+    "    For every gridpoint x only those timesteps t belong to the sample,",
+    "    which have i_1(t,x) \\neq missval and i_2(t,x) \\neq missval.",
+    NULL
+};
+
+static char *FldcovarHelp[] = {
+    "NAME",
+    "    fldcovar - Covariance in grid space",
+    "",
+    "SYNOPSIS",
+    "    fldcovar  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator calculates the covariance of two fields over all gridpoints",
+    "    for each timestep. With",
+    "    ",
+    "    S(t) = {x, i_1(t,x) != missval and i_2(t,x) != missval}",
+    "    it is",
+    "    ",
+    "    o(t,1) = Covar{(i_1(t,x), i_2(t,x)), x_1 < x <= x_n}",
+    "    where w(x) are the area weights obtained by the input streams.",
+    "    For every timestep t only those field elements x belong to the sample,",
+    "    which have i_1(t,x) \\neq missval and i_2(t,x) \\neq missval.",
+    NULL
+};
+
+static char *TimcovarHelp[] = {
+    "NAME",
+    "    timcovar - Covariance over time",
+    "",
+    "SYNOPSIS",
+    "    timcovar  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator calculates the covariance of two fields at each gridpoint",
+    "    over all timesteps. With",
+    "    ",
+    "    S(x) = {t, i_1(t,x) != missval and i_2(t,x) != missval}",
+    "    it is",
+    "    ",
+    "    o(1,x) = Covar{(i_1(t,x), i_2(t,x)), t_1 < t <= t_n}",
+    "    For every gridpoint x only those timesteps t belong to the sample,",
+    "    which have i_1(t,x) \\neq missval and i_2(t,x) \\neq missval.",
+    NULL
+};
+
+static char *RegresHelp[] = {
+    "NAME",
+    "    regres - Regression",
+    "",
+    "SYNOPSIS",
+    "    regres  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    The values of the input file ifile are assumed to be distributed as",
+    "    N(a+b*t,S^2) with unknown a, b and S^2. This operator estimates the",
+    "    parameter b. For every field element x only those timesteps ",
+    "    t belong to the sample S(x), which have i(t,x) NE miss.",
+    NULL
+};
+
+static char *DetrendHelp[] = {
+    "NAME",
+    "    detrend - Detrend time series",
+    "",
+    "SYNOPSIS",
+    "    detrend  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Every time series in ifile is linearly detrended. For every field element x ",
+    "    only those timesteps t belong to the sample S(x), which have i(t,x) NE miss.",
+    NULL
+};
+
+static char *TrendHelp[] = {
+    "NAME",
+    "    trend - Trend of time series",
+    "",
+    "SYNOPSIS",
+    "    trend  ifile ofile1 ofile2",
+    "",
+    "DESCRIPTION",
+    "    The values of the input file ifile are assumed to be distributed as",
+    "    N(a+b*t,S^2) with unknown a, b and S^2. This operator estimates the",
+    "    parameter a and b. For every field element x only those timesteps ",
+    "    t belong to the sample S(x), which have i(t,x) NE miss.",
+    "    Thus the estimation for a is stored in ofile1 and that for b is stored ",
+    "    in ofile2. To subtract the trend from the data see operator subtrend.",
+    NULL
+};
+
+static char *SubtrendHelp[] = {
+    "NAME",
+    "    subtrend - Subtract a trend",
+    "",
+    "SYNOPSIS",
+    "    subtrend  ifile1 ifile2 ifile3 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator is for subtracting a trend computed by the operator trend.",
+    "    It is",
+    "    ",
+    "    o(t,x) = i_1(t,x) - (i_2(1,x) + i_3(1,x)*t)",
+    "    where t is the timesteps.",
+    NULL
+};
+
+static char *EOFsHelp[] = {
+    "NAME",
+    "    eof, eoftime, eofspatial, eof3d - Empirical Orthogonal Functions",
+    "",
+    "SYNOPSIS",
+    "    <operator>,neof  ifile ofile1 ofile2",
+    "",
+    "DESCRIPTION",
+    "    This module calculates empirical orthogonal functions of the data in ifile ",
+    "    as the eigen values of the scatter matrix (covariance matrix) S of the data",
+    "    sample z(t). A more detailed description can be found above.",
+    "    ",
+    "    Please note, that the input data are assumed to be anomalies.",
+    "    ",
+    "    If operator eof is chosen, the EOFs are computed in either time or spatial",
+    "    space, whichever is the fastest. If the user already knows, which computation",
+    "    is faster, the module can be forced to perform a computation in time- or gridspace",
+    "    by using the operators eoftime or eofspatial, respectively. This can enhance ",
+    "    performance, especially for very long time series, where the number of timesteps",
+    "    is larger than the number of grid-points. Data in ifile are assumed to be anomalies.",
+    "    If they are not, the behavior of this module is not well defined. ",
+    "    After execution ofile1 will contain all eigen-values and ofile2 the",
+    "    eigenvectors e_j. All EOFs and eigen-values are computed. However, only the first ",
+    "    neof EOFs are written to ofile2. Nonetheless, ofile1 contains all eigen-values. ",
+    "    Note, thate the resulting EOF in ofile2 is e_j and thus not weighted for consistency.",
+    "    ",
+    "    Missing values are not fully supported. Support is only checked for non-changing",
+    "    masks of missing values in time. Although there still will be results, they are",
+    "    not trustworthy, and a warning will occur. In the latter case we suggest to ",
+    "    replace missing values by 0 in ifile. ",
+    "",
+    "OPERATORS",
+    "    eof         Calculate EOFs in spatial or time space",
+    "    eoftime     Calculate EOFs in time space",
+    "    eofspatial  Calculate EOFs in spatial space",
+    "    eof3d       Calculate 3-Dimensional EOFs in time space",
+    "",
+    "PARAMETER",
+    "    neof  INTEGER  Number of eigen functions",
+    "",
+    "ENVIRONMENT",
+    "    CDO_SVD_MODE   ",
+    "        Is used to choose the algorithm for eigenvalue calculation. Options are 'jacobi' for ",
+    "        a one-sided parallel jacobi-algorithm (only executed in parallel if -P flag is set)",
+    "        and  'danielson_lanczos' for a non-parallel d/l algorithm. The default setting is 'jacobi'.",
+    "        ",
+    "    MAX_JACOBI_ITER",
+    "        Is the maximum integer number of annihilation sweeps that is executed if the ",
+    "        jacobi-algorithm is used to compute the eigen values. The default value is 12.",
+    "        ",
+    "    FNORM_PRECISION",
+    "        Is the Frobenius norm of the matrix consisting of an annihilation pair",
+    "        of eigenvectors that is used to determine if the eigenvectors have reached ",
+    "        a sufficient level of convergence. If all annihilation-pairs of vectors have ",
+    "        a norm below this value, the computation is considered to have converged ",
+    "        properly. Otherwise, a warning will occur. The default value 1e-12.",
+    NULL
+};
+
+static char *EofcoeffHelp[] = {
+    "NAME",
+    "    eofcoeff - Principal coefficients of EOFs",
+    "",
+    "SYNOPSIS",
+    "    eofcoeff  ifile1 ifile2 obase",
+    "",
+    "DESCRIPTION",
+    "    This module calculates the time series of the principal coefficients for given EOF",
+    "    (empirical orthogonal functions) and data. Time steps in ifile1 are ",
+    "    assumed to be the EOFs, Time steps in ifile2 are assumed to be the",
+    "    time series. Weights are taken into account, which is why EOF output is not weighted. ",
+    "    Note, that this operator calculates a weighted dot product of the fields in",
+    "    ifile1 and ifile2.",
+    "    ",
+    "    There will be a separate file containing a time series of principal coefficients",
+    "    with time information from ifile2 for each EOF in ifile1. Output files",
+    "    will be numbered as <obase><neof><suffix> where neof+1 is the number of the",
+    "    EOF (timestep) in ifile1 and suffix is the filename extension derived from the file format. ",
+    "",
+    "ENVIRONMENT",
+    "    CDO_FILE_SUFFIX",
+    "        This environment variable can be used to set the default file suffix. This suffix will be",
+    "        added to the output file names instead of the filename extension derived from the file format. ",
+    "        Set this variable to NULL to disable the adding of a file suffix.",
+    NULL
+};
+
+static char *RemapgridHelp[] = {
+    "NAME",
+    "    remapbil, remapbic, remapdis, remapnn, remapcon, remapcon2, remaplaf - ",
+    "    SCRIP grid interpolation",
+    "",
+    "SYNOPSIS",
+    "    <operator>,grid  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module contains operators to remap all input fields to a new horizontal grid.",
+    "    Each operator uses a different remapping method. The interpolation is based",
+    "    on an adapted SCRIP library version. For a detailed description of the remapping ",
+    "    methods see SCRIP.",
+    "",
+    "OPERATORS",
+    "    remapbil   Bilinear interpolation",
+    "               Performs a bilinear interpolation on all input fields.",
+    "               This interpolation method only works on quadrilateral curvilinear grids.",
+    "    remapbic   Bicubic interpolation",
+    "               Performs a bicubic interpolation on all input fields.",
+    "               This interpolation method only works on quadrilateral curvilinear grids.",
+    "    remapdis   Distance-weighted average remapping",
+    "               Performs a distance-weighted average remapping of the four nearest neighbor ",
+    "               values on all input fields.",
+    "    remapnn    Nearest neighbor remapping",
+    "               Performs a nearest neighbor remapping on all input fields.",
+    "    remapcon   First order conservative remapping",
+    "               Performs a first order conservative remapping on all input fields.",
+    "    remapcon2  Second order conservative remapping",
+    "               Performs a second order conservative remapping on all input fields.",
+    "    remaplaf   Largest area fraction remapping",
+    "               Performs a largest area fraction remapping on all input fields.",
+    "",
+    "PARAMETER",
+    "    grid  STRING  Target grid description file or name",
+    "",
+    "ENVIRONMENT",
+    "    REMAP_EXTRAPOLATE",
+    "        This variable is used to switch the extrapolation feature 'on' or 'off'.",
+    "        By default the extrapolation is enabled for remapdis, remapnn",
+    "        and for circular grids.",
+    "    REMAP_AREA_MIN   ",
+    "        This variable is used to set the minimum destination area fraction. The default",
+    "        of this variable is 0.0.",
+    NULL
+};
+
+static char *GenweightsHelp[] = {
+    "NAME",
+    "    genbil, genbic, gendis, gennn, gencon, gencon2, genlaf - ",
+    "    Generate SCRIP grid interpolation weights",
+    "",
+    "SYNOPSIS",
+    "    <operator>,grid  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Interpolation between different horizontal grids can be a very time-consuming ",
+    "    process. Especially if the data are on an unstructured or a large grid. ",
+    "    In this case the SCRIP interpolation process can be split ",
+    "    into two parts. Firstly the generation of the interpolation weights, which is ",
+    "    the most time-consuming part. These interpolation weights can be reused for ",
+    "    every remapping process with the operator remap. This method should be ",
+    "    used only if all input fields are on the same grid and a possibly",
+    "    mask (missing values) does not change. This module contains operators to ",
+    "    generate SCRIP interpolation weights of the first input field.",
+    "    Each operator is using a different interpolation method.",
+    "",
+    "OPERATORS",
+    "    genbil   Generate bilinear interpolation weights",
+    "             Generates bilinear interpolation weights and writes the result to a file. ",
+    "             This interpolation method only works on quadrilateral curvilinear grids.",
+    "    genbic   Generate bicubic interpolation weights",
+    "             Generates bicubic interpolation weights and writes the result to a file.",
+    "             This interpolation method only works on quadrilateral curvilinear grids.",
+    "    gendis   Generate distance-weighted average remap weights",
+    "             Generates distance-weighted average remapping weights of the four",
+    "             nearest neighbor values and writes the result to a file.",
+    "    gennn    Generate nearest neighbor remap weights",
+    "             Generates nearest neighbor remapping weights and writes the result to a file.",
+    "    gencon   Generate 1st order conservative remap weights",
+    "             Generates first order conservative remapping weights and",
+    "             writes the result to a file.",
+    "    gencon2  Generate 2nd order conservative remap weights",
+    "             Generates second order conservative remapping weights and",
+    "             writes the result to a file.",
+    "    genlaf   Generate largest area fraction remap weights",
+    "             Generates largest area fraction remapping weights and",
+    "             writes the result to a file.",
+    "",
+    "PARAMETER",
+    "    grid  STRING  Target grid description file or name",
+    "",
+    "ENVIRONMENT",
+    "    REMAP_EXTRAPOLATE",
+    "        This variable is used to switch the extrapolation feature 'on' or 'off'.",
+    "        By default the extrapolation is enabled for remapdis, remapnn",
+    "        and for circular grids.",
+    "    REMAP_AREA_MIN   ",
+    "        This variable is used to set the minimum destination area fraction. The default",
+    "        of this variable is 0.0.",
+    NULL
+};
+
+static char *RemapHelp[] = {
+    "NAME",
+    "    remap - SCRIP grid remapping",
+    "",
+    "SYNOPSIS",
+    "    remap,grid,weights  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator remaps all input fields to a new horizontal grid. The remap type and ",
+    "    the interpolation weights of one input grid are read from a netCDF file. More weights ",
+    "    are computed if the input fields are on different grids. The netCDF file with the ",
+    "    weights should follow the SCRIP convention. Normally these weights come from ",
+    "    a previous call to module GENWEIGHTS or were created by the original",
+    "    SCRIP package.",
+    "",
+    "PARAMETER",
+    "    grid     STRING  Target grid description file or name",
+    "    weights  STRING  Interpolation weights (SCRIP netCDF file)",
+    "",
+    "ENVIRONMENT",
+    "    REMAP_EXTRAPOLATE",
+    "        This variable is used to switch the extrapolation feature 'on' or 'off'.",
+    "        By default the extrapolation is enabled for remapdis, remapnn",
+    "        and for circular grids.",
+    "    REMAP_AREA_MIN   ",
+    "        This variable is used to set the minimum destination area fraction. The default",
+    "        of this variable is 0.0.",
+    NULL
+};
+
+static char *RemapetaHelp[] = {
+    "NAME",
+    "    remapeta - Remap vertical hybrid level",
+    "",
+    "SYNOPSIS",
+    "    remapeta,vct[,oro]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator interpolates between different vertical hybrid levels. ",
+    "    This include the preparation of consistent data for the free atmosphere.",
+    "    The procedure for the vertical interpolation is based on the HIRLAM scheme",
+    "    and was adapted from INTERA.",
+    "    The vertical interpolation is based on the vertical integration of the",
+    "    hydrostatic equation with few adjustments. The basic tasks are the following one:",
+    "    - at first integration of hydrostatic equation",
+    "    - extrapolation of surface pressure",
+    "    - Planetary Boundary-Layer (PBL) profile interpolation",
+    "    - interpolation in free atmosphere",
+    "    - merging of both profiles",
+    "    - final surface pressure correction",
+    "    ",
+    "    The vertical interpolation corrects the surface pressure. This is simply",
+    "    a cut-off or an addition of air mass. This mass correction should not",
+    "    influence the geostrophic velocity field in the middle troposhere. Therefore",
+    "    the total mass above a given reference level is conserved. As reference level",
+    "    the geopotential height of the 400 hPa level is used. Near the surface the",
+    "    correction can affect the vertical structure of the PBL. Therefore the",
+    "    interpolation is done using the potential temperature. But in the free",
+    "    atmosphere above a certain n (n=0.8 defining the top of the PBL) the",
+    "    interpolation is done linearly. After the interpolation both profiles",
+    "    are merged. With the resulting temperature/pressure correction the hydrostatic",
+    "    equation is integrated again and adjusted to the reference level finding",
+    "    the final surface pressure correction. A more detailed description of",
+    "    the interpolation can be found in INTERA.",
+    "    All input fields have to be on the same horizontal grid.",
+    "",
+    "PARAMETER",
+    "    vct  STRING  File name of an ASCII dataset with the vertical coordinate table",
+    "    oro  STRING  File name with the orography (surf. geopotential) of the target dataset (optional)",
+    "",
+    "ENVIRONMENT",
+    "    REMAPETA_PTOP",
+    "        Sets the minimum pressure level for condensation.",
+    "        Above this level the humidity is set to the constant 1.E-6.",
+    "        The default value is 0 Pa.",
+    NULL
+};
+
+static char *IntvertHelp[] = {
+    "NAME",
+    "    ml2pl, ml2hl - Vertical interpolation",
+    "",
+    "SYNOPSIS",
+    "    ml2pl,plevels  ifile ofile",
+    "    ml2hl,hlevels  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Interpolate 3D variables on hybrid model levels to pressure or height levels.",
+    "    The input file should contain the log. surface pressure or the surface pressure.",
+    "    To interpolate the temperature, the orography (surface geopotential) is also needed.",
+    "    The pressure, temperature, and orography are identified by their code numbers.",
+    "    Supported parameter tables are: WMO standard table number 2 and ECMWF local table number 128.",
+    "    Use the alias  ml2plx/ml2hlx or the environment variable EXTRAPOLATE",
+    "    to extrapolate missing values. All input fields have to be on the same horizontal grid.",
+    "",
+    "OPERATORS",
+    "    ml2pl  Model to pressure level interpolation",
+    "           Interpolates 3D variables on hybrid model levels to pressure levels.",
+    "    ml2hl  Model to height level interpolation",
+    "           Interpolates 3D variables on hybrid model levels to height levels.",
+    "           The procedure is the same as for the operator mh2pl except for",
+    "           the pressure levels being calculated from the heights by:",
+    "           plevel = 101325*exp(hlevel/-7000)",
+    "",
+    "PARAMETER",
+    "    plevels  FLOAT  Pressure levels in pascal",
+    "    hlevels  FLOAT  Height levels in meter (max level: 65535 m)",
+    "",
+    "ENVIRONMENT",
+    "    EXTRAPOLATE",
+    "        If set to 1 extrapolate missing values.",
+    NULL
+};
+
+static char *IntlevelHelp[] = {
+    "NAME",
+    "    intlevel - Linear level interpolation",
+    "",
+    "SYNOPSIS",
+    "    intlevel,levels  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator performs a linear vertical interpolation of non hybrid ",
+    "    3D variables.",
+    "",
+    "PARAMETER",
+    "    levels  FLOAT  Target levels",
+    NULL
+};
+
+static char *Intlevel3dHelp[] = {
+    "NAME",
+    "    intlevel3d, intlevelx3d - ",
+    "    Linear level interpolation from/to 3d vertical coordinates",
+    "",
+    "SYNOPSIS",
+    "    <operator>,icoordinate  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator performs a linear vertical interpolation of 3D variables fields",
+    "    with given 3D vertical coordinates.",
+    "",
+    "OPERATORS",
+    "    intlevel3d   Linear level interpolation onto a 3d vertical coordinate",
+    "                 To interpolate 3D variables from one set of 3d height levels",
+    "                 into another one where",
+    "                 - icoordinate contains a single 3d variable,",
+    "                   which represents the input 3d vert. coordinate",
+    "                 - ifile1 contains the source data,",
+    "                   which the vertical coordinate from icoordinate belongs to",
+    "                 - ifile2 only contains the target 3d height levels",
+    "                 ",
+    "                 call",
+    "                    cdo intlevel3,icoordinate ifile1 ifile2 ofile",
+    "    intlevelx3d  like intlevel3d but with extrapolation",
+    "",
+    "PARAMETER",
+    "    icoordinate  STRING  filename for vertical source coordinates variable",
+    "    ifile2       STRING target vertical coordinate field (intlevel3d only)",
+    NULL
+};
+
+static char *InttimeHelp[] = {
+    "NAME",
+    "    inttime, intntime - Time interpolation",
+    "",
+    "SYNOPSIS",
+    "    inttime,date,time[,inc]  ifile ofile",
+    "    intntime,n  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module performs linear interpolation between timesteps.",
+    "",
+    "OPERATORS",
+    "    inttime   Interpolation between timesteps",
+    "              This operator creates a new dataset by linear interpolation between timesteps.",
+    "              The user has to define the start date/time with an optional increment.",
+    "    intntime  Interpolation between timesteps",
+    "              This operator performs linear interpolation between timesteps.",
+    "              The user has to define the number of timesteps from one timestep",
+    "              to the next.",
+    "",
+    "PARAMETER",
+    "    date  STRING  Start date (format YYYY-MM-DD)",
+    "    time  STRING  Start time (format hh:mm:ss)",
+    "    inc   STRING  Optional increment (seconds, minutes, hours, days, months, years) [default: 0hour]",
+    "    n     INTEGER Number of timesteps from one timestep to the next",
+    NULL
+};
+
+static char *IntyearHelp[] = {
+    "NAME",
+    "    intyear - Year interpolation",
+    "",
+    "SYNOPSIS",
+    "    intyear,years  ifile1 ifile2 obase",
+    "",
+    "DESCRIPTION",
+    "    This operator performs linear interpolation between two years, timestep by timestep.",
+    "    The input files need to have the same structure with the same variables.",
+    "    The output files will be named <obase><yyyy><suffix> where yyyy will be the year and ",
+    "    suffix is the filename extension derived from the file format.",
+    "",
+    "PARAMETER",
+    "    years  INTEGER  Comma separated list of years",
+    "",
+    "ENVIRONMENT",
+    "    CDO_FILE_SUFFIX",
+    "        This environment variable can be used to set the default file suffix. This suffix will be",
+    "        added to the output file names instead of the filename extension derived from the file format. ",
+    "        Set this variable to NULL to disable the adding of a file suffix.",
+    NULL
+};
+
+static char *SpectralHelp[] = {
+    "NAME",
+    "    sp2gp, sp2gpl, gp2sp, gp2spl, sp2sp - Spectral transformation",
+    "",
+    "SYNOPSIS",
+    "    sp2gp  ifile ofile",
+    "    sp2gpl  ifile ofile",
+    "    gp2sp  ifile ofile",
+    "    gp2spl  ifile ofile",
+    "    sp2sp,trunc  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module transforms fields on Gaussian grids to spectral coefficients ",
+    "    and vice versa.",
+    "",
+    "OPERATORS",
+    "    sp2gp   Spectral to gridpoint",
+    "            Convert all fields with spectral coefficients to a regular Gaussian",
+    "            grid. The number of latitudes of the resulting Gaussian grid is ",
+    "            calculated from the triangular truncation by:",
+    "            ",
+    "               nlat = NINT((trunc*3 + 1.)/2.)",
+    "    sp2gpl  Spectral to gridpoint (linear)",
+    "            Convert all fields with spectral coefficients to a regular Gaussian",
+    "            grid. The number of latitudes of the resulting Gaussian grid",
+    "            is calculated from the triangular truncation by:",
+    "            ",
+    "               nlat = NINT((trunc*2 + 1.)/2.)",
+    "            ",
+    "            Use this operator to convert ERA40 data e.g. from TL159 to N80.",
+    "    gp2sp   Gridpoint to spectral",
+    "            Convert all Gaussian gridpoint fields to spectral coefficients.",
+    "            The triangular truncation of the resulting spherical harmonics",
+    "            is calculated from the number of latitudes by:",
+    "            ",
+    "               trunc = (nlat*2 - 1) / 3",
+    "    gp2spl  Gridpoint to spectral (linear)",
+    "            Convert all Gaussian gridpoint fields to spectral coefficients.",
+    "            The triangular truncation of the resulting spherical harmonics",
+    "            is calculated from the number of latitudes by:",
+    "            ",
+    "               trunc = (nlat*2 - 1) / 2",
+    "            ",
+    "            Use this operator to convert ERA40 data e.g. from N80 to TL159",
+    "            instead of T106.",
+    "    sp2sp   Spectral to spectral",
+    "            Change the triangular truncation of all spectral fields.",
+    "            The operator performs downward conversion by cutting the resolution.",
+    "            Upward conversions are achieved by filling in zeros.",
+    "",
+    "PARAMETER",
+    "    trunc  INTEGER  New spectral resolution",
+    "    wnums  INTEGER  Comma separated list of wave numbers",
+    NULL
+};
+
+static char *WindHelp[] = {
+    "NAME",
+    "    dv2uv, dv2uvl, uv2dv, uv2dvl, dv2ps - Wind transformation",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module converts relative divergence and vorticity to U and V wind and vice versa.",
+    "    Divergence and vorticity are spherical harmonic coefficients in spectral space and",
+    "    U and V are on a regular Gaussian grid.",
+    "",
+    "OPERATORS",
+    "    dv2uv   Divergence and vorticity to U and V wind",
+    "            Calculate U and V wind on a Gaussian grid from spherical harmonic ",
+    "            coefficients of relative divergence and vorticity. The divergence and vorticity ",
+    "            need to have the names sd and svo or code numbers 155 and 138.",
+    "            The number of latitudes of the resulting Gaussian grid is calculated ",
+    "            from the triangular truncation by:",
+    "            ",
+    "               nlat = NINT((trunc*3 + 1.)/2.)",
+    "    dv2uvl  Divergence and vorticity to U and V wind (linear)",
+    "            Calculate U and V wind on a Gaussian grid from spherical harmonic ",
+    "            coefficients of relative divergence and vorticity. The divergence and vorticity ",
+    "            need tohave the names sd and svo or code numbers 155 and 138.",
+    "            The number of latitudes of the resulting Gaussian grid is calculated ",
+    "            from the triangular truncation by:",
+    "            ",
+    "               nlat = NINT((trunc*2 + 1.)/2.)",
+    "    uv2dv   U and V wind to divergence and vorticity",
+    "            Calculate spherical harmonic coefficients of relative divergence and vorticity",
+    "            from U and V wind. The U and V wind need to be on a Gaussian grid and need to have the ",
+    "            names u and v or the code numbers 131 and 132.",
+    "            The triangular truncation of the resulting spherical harmonics",
+    "            is calculated from the number of latitudes by:",
+    "            ",
+    "               trunc = (nlat*2 - 1) / 3",
+    "    uv2dvl  U and V wind to divergence and vorticity (linear)",
+    "            Calculate spherical harmonic coefficients of relative divergence and vorticity",
+    "            from U and V wind. The U and V wind need to be on a Gaussian grid and need to have the ",
+    "            names u and v or the code numbers 131 and 132.",
+    "            The triangular truncation of the resulting spherical harmonics",
+    "            is calculated from the number of latitudes by:",
+    "            ",
+    "               trunc = (nlat*2 - 1) / 2",
+    "    dv2ps   D and V to velocity potential and stream function",
+    "            Calculate spherical harmonic coefficients of velocity potential and stream function from ",
+    "            spherical harmonic coefficients of relative divergence and vorticity. The divergence and ",
+    "            vorticity need to have the names sd and svo or code numbers 155 and 138.",
+    NULL
+};
+
+static char *ImportbinaryHelp[] = {
+    "NAME",
+    "    import_binary - Import binary data sets",
+    "",
+    "SYNOPSIS",
+    "    import_binary  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator imports gridded binary data sets via a GrADS data descriptor file.",
+    "    The GrADS data descriptor file contains a complete description of the binary data as well ",
+    "    as instructions on where to find the data and how to read it. The descriptor file is an ASCII ",
+    "    file that can be created easily with a text editor. The general contents of a gridded data ",
+    "    descriptor file are as follows:",
+    "    - Filename for the binary data",
+    "    - Missing or undefined data value",
+    "    - Mapping between grid coordinates and world coordinates",
+    "    - Description of variables in the binary data set ",
+    "    ",
+    "    A detailed description of the components of a GrADS data descriptor file can be found in GrADS.",
+    "    Here is a list of the supported components:",
+    "    BYTESWAPPED, CHSUB, DSET, ENDVARS, FILEHEADER, HEADERBYTES, OPTIONS, TDEF, TITLE, ",
+    "    TRAILERBYTES, UNDEF, VARS, XDEF, XYHEADER, YDEF, ZDEF",
+    NULL
+};
+
+static char *ImportcmsafHelp[] = {
+    "NAME",
+    "    import_cmsaf - Import CM-SAF HDF5 files",
+    "",
+    "SYNOPSIS",
+    "    import_cmsaf  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator imports gridded CM-SAF (Satellite Application Facility on Climate Monitoring)",
+    "    HDF5 files. CM-SAF exploits data from polar-orbiting and geostationary satellites in order ",
+    "    to provide climate monitoring products of the following parameters: ",
+    "    ",
+    "    Cloud parameters: cloud fraction (CFC), cloud type (CTY), cloud phase (CPH), ",
+    "                      cloud top height, pressure and temperature (CTH,CTP,CTT), ",
+    "                      cloud optical thickness (COT), cloud water path (CWP).",
+    "    ",
+    "    Surface radiation components: Surface albedo (SAL); surface incoming (SIS) ",
+    "                      and net (SNS) shortwave radiation; surface downward (SDL) ",
+    "                      and outgoing (SOL) longwave radiation, surface net longwave ",
+    "                      radiation (SNL) and surface radiation budget (SRB).",
+    "    ",
+    "    Top-of-atmosphere radiation components: Incoming (TIS) and reflected (TRS) ",
+    "                      solar radiative flux at top-of-atmosphere. Emitted thermal ",
+    "                      radiative flux at top-of-atmosphere (TET).",
+    "    ",
+    "    Water vapour:     Vertically integrated water vapour (HTW), layered vertically ",
+    "                      integrated water vapour and layer mean temperature and relative ",
+    "                      humidity for 5 layers (HLW), temperature and mixing ratio at ",
+    "                      6 pressure levels. ",
+    "    ",
+    "    Daily and monthly mean products can be ordered via the CM-SAF web page (www.cmsaf.eu). ",
+    "    Products with higher spatial and temporal resolution, i.e. instantaneous swath-based products,",
+    "    are available on request (contact.cmsaf at dwd.de). All products are distributed free-of-charge.",
+    "    More information on the data is available on the CM-SAF homepage (www.cmsaf.eu).",
+    "    ",
+    "    Daily and monthly mean products are provided in equal-area projections. CDO reads the ",
+    "    projection parameters from the metadata in the HDF5-headers in order to allow spatial ",
+    "    operations like remapping. For spatial operations with instantaneous products on original ",
+    "    satellite projection, additional files with arrays of latitudes and longitudes are needed.",
+    "    These can be obtained from CM-SAF together with the data.",
+    "    ",
+    NULL
+};
+
+static char *ImportamsrHelp[] = {
+    "NAME",
+    "    import_amsr - Import AMSR binary files",
+    "",
+    "SYNOPSIS",
+    "    import_amsr  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator imports gridded binary AMSR (Advanced Microwave Scanning Radiometer) data.",
+    "    The binary data files are available from the AMSR ftp site (ftp://ftp.ssmi.com/amsre).",
+    "    Each file consists of twelve (daily) or five (averaged) 0.25 x 0.25 degree ",
+    "    grid (1440,720) byte maps. For daily files, six daytime maps in the following",
+    "    order, Time (UTC), Sea Surface Temperature (SST), 10 meter Surface Wind Speed (WSPD),",
+    "    Atmospheric Water Vapor (VAPOR), Cloud Liquid Water (CLOUD), and Rain Rate (RAIN), ",
+    "    are followed by six nighttime maps in the same order. Time-Averaged files contain ",
+    "    just the geophysical layers in the same order [SST, WSPD, VAPOR, CLOUD, RAIN].",
+    "    More information to the data is available on the AMSR homepage http://www.remss.com/amsr.",
+    NULL
+};
+
+static char *InputHelp[] = {
+    "NAME",
+    "    input, inputsrv, inputext - Formatted input",
+    "",
+    "SYNOPSIS",
+    "    input,grid  ofile",
+    "    inputsrv  ofile",
+    "    inputext  ofile",
+    "",
+    "DESCRIPTION",
+    "    This module reads time series of one 2D variable from standard input.",
+    "    All input fields need to have the same horizontal grid. The format of the ",
+    "    input depends on the chosen operator.",
+    "",
+    "OPERATORS",
+    "    input     ASCII input",
+    "              Reads fields with ASCII numbers from standard input and stores them",
+    "              in ofile. The numbers read are exactly that ones which are ",
+    "              written out by output.",
+    "    inputsrv  SERVICE ASCII input",
+    "              Reads fields with ASCII numbers from standard input and stores them ",
+    "              in ofile. Each field should have a header of 8 integers (SERVICE likely).",
+    "              The numbers that are read are exactly that ones which are written out by outputsrv.",
+    "    inputext  EXTRA ASCII input",
+    "              Read fields with ASCII numbers from standard input and stores them ",
+    "              in ofile. Each field should have header of 4 integers (EXTRA likely).",
+    "              The numbers read are exactly that ones which are written out by outputext.",
+    "",
+    "PARAMETER",
+    "    grid  STRING  Grid description file or name",
+    NULL
+};
+
+static char *OutputHelp[] = {
+    "NAME",
+    "    output, outputf, outputint, outputsrv, outputext - Formatted output",
+    "",
+    "SYNOPSIS",
+    "    output  ifiles",
+    "    outputf,format,nelem  ifiles",
+    "    outputint  ifiles",
+    "    outputsrv  ifiles",
+    "    outputext  ifiles",
+    "",
+    "DESCRIPTION",
+    "    This module prints all values of all input datasets to standard output.",
+    "    All input fields need to have the same horizontal grid. All input files ",
+    "    need to have the same structure with the same variables.",
+    "    The format of the output depends on the chosen operator.",
+    "",
+    "OPERATORS",
+    "    output     ASCII output",
+    "               Prints all values to standard output.",
+    "               Each row has 6 elements with the C-style format \"%13.6g\".",
+    "    outputf    Formatted output",
+    "               Prints all values to standard output.",
+    "               The format and number of elements for each row have to be specified by the parameters",
+    "               format and nelem.",
+    "    outputint  Integer output",
+    "               Prints all values rounded to the nearest integer to standard output.",
+    "    outputsrv  SERVICE ASCII output",
+    "               Prints all values to standard output.",
+    "               Each field with a header of 8 integers (SERVICE likely).",
+    "    outputext  EXTRA ASCII output",
+    "               Prints all values to standard output.",
+    "               Each field with a header of 4 integers (EXTRA likely).",
+    "",
+    "PARAMETER",
+    "    format  STRING  C-style format for one element (e.g. %13.6g)",
+    "    nelem   INTEGER Number of elements for each row (nelem max = gridsize)",
+    NULL
+};
+
+static char *GradsdesHelp[] = {
+    "NAME",
+    "    gradsdes1, gradsdes2 - GrADS data descriptor file",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile",
+    "",
+    "DESCRIPTION",
+    "    Creates a GrADS data descriptor file. Supported file formats are GRIB1,",
+    "    SERVICE, EXTRA and IEG. For GRIB1 files the GrADS map file is also ",
+    "    generated. For SERVICE and EXTRA files the grid have to be specified with",
+    "    the CDO option '-g <grid>'. This module takes ifile in order to create ",
+    "    filenames for the descriptor (ifile.ctl) and the map (ifile.gmp) file.",
+    "    \"gradsdes\" is an alias for gradsdes2.",
+    "",
+    "OPERATORS",
+    "    gradsdes1  GrADS data descriptor file (version 1 GRIB map)",
+    "               Creates a GrADS data descriptor file. Generated a machine",
+    "               specific version 1 GrADS map file for GRIB1 datasets.",
+    "    gradsdes2  GrADS data descriptor file (version 2 GRIB map)",
+    "               Creates a GrADS data descriptor file. Generated a machine ",
+    "               independent version 2 GrADS map file for GRIB1 datasets.",
+    "               This map file can be used only with GrADS version 1.8 or newer. ",
+    NULL
+};
+
+static char *FilterHelp[] = {
+    "NAME",
+    "    bandpass, lowpass, highpass - Time series filtering",
+    "",
+    "SYNOPSIS",
+    "    bandpass,fmin,fmax  ifile ofile",
+    "    lowpass,fmax  ifile ofile",
+    "    highpass,fmin  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module takes the time series for each gridpoint in ifile and fills it with zeros (zero-",
+    "    padding) up to the next time-step-number that is a power of 2. Then it (fast fourier) transforms ",
+    "    the time series with 2^n elements into the frequency domain.",
+    "    According to the particular operator and its parameters certain frequencies are filtered ",
+    "    (set to zero) in the frequency domain and the spectrum is (inverse fast fourier) transformed ",
+    "    back into the time domain. This time series is cut to the original number of timesteps from",
+    "    ifile and written to ofile.",
+    "    To determine the frequency the time-axis of ifile is used. (Data should have a constant time ",
+    "    increment since this assumption applies for transformation. However, the time increment ",
+    "    has to be different from zero.)",
+    "    All frequencies given as parameter are interpreted per year. This is done by the ",
+    "    assumption of a 365-day calendar. Consequently if you want to perform multiyear-filtering ",
+    "    accurately you have to delete the 29th of February. If your ifile has a 360 year calendar",
+    "    the frequency parameters fmin respectively fmax should be multiplied with a factor of",
+    "    360/365 in order to obtain accurate results.  ",
+    "    For the set up of a frequency filter the frequency parameters have to be adjusted to a ",
+    "    frequency in the data. Here fmin is rounded down and fmax is always rounded up. ",
+    "    Consequently it is possible to use bandpass with fmin=fmax without getting a zero-field 	",
+    "    for ofile. ",
+    "    Hints for efficient usage: ",
+    "    - to avoid effects of zero-padding cut or extend your time series down/up to the nearest power of two",
+    "    - to get reliable results the time-series has to be detrended (cdo detrend)",
+    "    - the lowest frequency greater zero that can be contained in ifile is 1/(N*dT), ",
+    "    - the greatest frequency is 1/(2dT) (Nyquist frequency),",
+    "    with N the number of timesteps and dT the time increment of ifile in years. ",
+    "",
+    "OPERATORS",
+    "    bandpass  Bandpass filtering",
+    "              Bandpass filtering (pass for frequencies between fmin and fmax).",
+    "              Suppresses all variability outside the frequency range specified",
+    "              by [fmin,fmax].",
+    "    lowpass   Lowpass filtering",
+    "              Lowpass filtering (pass for frequencies lower than fmax).",
+    "              Suppresses all variability with frequencies greater than fmax. ",
+    "    highpass  Highpass filtering",
+    "              Highpass filtering (pass for frequencies greater than fmin). ",
+    "              Suppresses all variabilty with frequencies lower than fmin. ",
+    "",
+    "PARAMETER",
+    "    fmin  FLOAT	Minimum frequency per year that passes the filter.",
+    "    fmax  FLOAT	Maximum frequency per year that passes the filter.  ",
+    NULL
+};
+
+static char *GridcellHelp[] = {
+    "NAME",
+    "    gridarea, gridweights - Grid cell quantities",
+    "",
+    "SYNOPSIS",
+    "    <operator>  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module reads the grid cell area of the first grid from the input stream.",
+    "    If the grid cell area is missing it will be computed from the ",
+    "    grid description. Depending on the chosen operator the grid cell area or weights",
+    "    are written to the output stream.",
+    "",
+    "OPERATORS",
+    "    gridarea     Grid cell area",
+    "                 Writes the grid cell area to the output stream. If the grid cell area have to",
+    "                 be computed it is scaled with the earth radius to square meters.",
+    "    gridweights  Grid cell weights",
+    "                 Writes the grid cell area weights to the output stream.",
+    "",
+    "ENVIRONMENT",
+    "    PLANET_RADIUS",
+    "        This variable is used to scale the computed grid cell areas to square meters. ",
+    "        By default PLANET_RADIUS is set to an earth radius of 6371000 meter.",
+    NULL
+};
+
+static char *Smooth9Help[] = {
+    "NAME",
+    "    smooth9 - 9 point smoothing",
+    "",
+    "SYNOPSIS",
+    "    smooth9  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Performs a 9 point smoothing on all fields with a quadrilateral curvilinear grid.",
+    "    The result at each grid point is a weighted average of the grid point plus",
+    "    the 8 surrounding points. The center point receives a weight of 1.0, the ",
+    "    points at each side and above and below receive a weight of 0.5, and corner ",
+    "    points receive a weight of 0.3.",
+    "    All 9 points are multiplied by their weights and summed, then divided by ",
+    "    the total weight to obtain the smoothed value. Any missing data points are ",
+    "    not included in the sum; points beyond the grid boundary are considered to ",
+    "    be missing. Thus the final result may be the result of an averaging with less ",
+    "    than 9 points.",
+    NULL
+};
+
+static char *ReplacevaluesHelp[] = {
+    "NAME",
+    "    setvals, setrtoc, setrtoc2 - Replace variable values",
+    "",
+    "SYNOPSIS",
+    "    setvals,oldval,newval[,...]  ifile ofile",
+    "    setrtoc,rmin,rmax,c  ifile ofile",
+    "    setrtoc2,rmin,rmax,c,c2  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module replaces old variable values with new values, depending on the operator.",
+    "",
+    "OPERATORS",
+    "    setvals   Set list of old values to new values",
+    "              Supply a list of n pairs of old and new values.",
+    "    setrtoc   Set range to constant",
+    "                       / c      if i(t,x) GE rmin AND i(t,x) LE rmax",
+    "              o(t,x) = ",
+    "                       \\ i(t,x) if i(t,x) LT rmin AND i(t,x) GT rmax",
+    "    setrtoc2  Set range to constant others to constant2",
+    "                       / c      if i(t,x) GE rmin AND i(t,x) LE rmax",
+    "              o(t,x) = ",
+    "                       \\ c2     if i(t,x) LT rmin AND i(t,x) GT rmax",
+    "",
+    "PARAMETER",
+    "    oldval,newval,...  FLOAT   Pairs of old and new values",
+    "    rmin               FLOAT   Lower bound",
+    "    rmax               FLOAT   Upper bound",
+    "    c                  FLOAT   New value - inside range",
+    "    c2                 FLOAT   New value - outside range",
+    NULL
+};
+
+static char *TimsortHelp[] = {
+    "NAME",
+    "    timsort - Timsort",
+    "",
+    "SYNOPSIS",
+    "    timsort  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Sorts the elements in ascending order over all timesteps for every field position.",
+    "    After sorting it is:",
+    "    ",
+    "    o(t_1,x) <= o(t_2,x)      forall (t_1<t_2),x",
+    NULL
+};
+
+static char *VargenHelp[] = {
+    "NAME",
+    "    const, random, stdatm - Generate a field",
+    "",
+    "SYNOPSIS",
+    "    const,const,grid  ofile",
+    "    random,grid[,seed]  ofile",
+    "    stdatm,levels  ofile",
+    "",
+    "DESCRIPTION",
+    "    Generates a dataset with one or more fields. The field size",
+    "    is specified by the user given grid description.",
+    "    According to the chosen operator all field elements",
+    "    are constant or filled with random numbers.",
+    "",
+    "OPERATORS",
+    "    const   Create a constant field",
+    "            Creates a constant field. All field elements of the grid",
+    "            have the same value.",
+    "    random  Create a field with random numbers",
+    "            Creates a field with rectangularly distrubuted random numbers in the interval [0,1].",
+    "    stdatm  Create values for pressure and temperature for hydrostatic atmosphere",
+    "            Creates pressure and temperature values for the given list of vertical levels.",
+    "            The formulars are:",
+    "            ",
+    "            P(z) = P_0 * exp(-1 * g/R * H/T_0 * log( (exp(z/H)*T_0 + T_Delta)/(T_0 + T_Delta))",
+    "            T(z) = T_0 + T_Delta * exp(-z/H)",
+    "            ",
+    "            with the following constants",
+    "            ",
+    "            T_0     = 213 K           Offset to get a surface temperature of 288K",
+    "            T_Delta = 75 K            Temperature lapse rate for 10Km",
+    "            P_0     = 1013.25 hPa     Surface pressure",
+    "            H       = 10000.0 m       Scale height",
+    "            g       = 9.80665 m/s**2  Earth gravity",
+    "            R       = 287.05 J/kg*K   Gas constant for air",
+    "            ",
+    "            This is the solution for the hydrostatic equations and is only valid for the",
+    "            troposphere (constant positive lapse rate). The temperature increase in the",
+    "            stratosphere and other effects of the upper atmosphere are not taken into",
+    "            account.",
+    "",
+    "PARAMETER",
+    "    const   FLOAT   Constant",
+    "    seed    INTEGER The seed for a new sequence of pseudo-random numbers [default: 1]",
+    "    grid    STRING  Target grid description file or name",
+    "    levels  FLOAT   Target levels in metre above surface",
+    NULL
+};
+
+static char *RotuvHelp[] = {
+    "NAME",
+    "    rotuvb - Rotation",
+    "",
+    "SYNOPSIS",
+    "    rotuvb,u,v,...  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This is a special operator for datsets with wind components on a rotated grid, ",
+    "    e.g. data from the regional model REMO. It performs a backward transformation of ",
+    "    velocity components U and V from a rotated spherical system to a geographical system.",
+    "",
+    "PARAMETER",
+    "    u,v,...  STRING  Pairs of zonal and meridional velocity components (use variable names or code numbers)",
+    NULL
+};
+
+static char *MastrfuHelp[] = {
+    "NAME",
+    "    mastrfu - Mass stream function",
+    "",
+    "SYNOPSIS",
+    "    mastrfu  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This is a special operator for the post processing of the atmospheric ",
+    "    general circulation model ECHAM. It computes the mass stream function ",
+    "    (code number 272). The input dataset have to be a zonal mean of v-velocity [m/s]",
+    "    (code number 132) on pressure levels.",
+    NULL
+};
+
+static char *HistogramHelp[] = {
+    "NAME",
+    "    histcount, histsum, histmean, histfreq - Histogram",
+    "",
+    "SYNOPSIS",
+    "    <operator>,bounds  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This module creates bins for a histogram of the input data.",
+    "    The bins have to be adjacent and have non-overlapping intervals.",
+    "    The user has to define the bounds of the bins. The first value",
+    "    is the lower bound and the second value the upper bound of the",
+    "    first bin. The bounds of the second bin are defined by the",
+    "    second and third value, aso.",
+    "    Only 2-dimensional input fields are allowed. The ouput file ",
+    "    contains one vertical level for each of the bins requested.",
+    "",
+    "OPERATORS",
+    "    histcount  Histogram count",
+    "               Number of elements in the bin range.",
+    "    histsum    Histogram sum",
+    "               Sum of elements in the bin range.",
+    "    histmean   Histogram mean",
+    "               Mean of elements in the bin range.",
+    "    histfreq   Histogram frequency",
+    "               Relative frequency of elements in the bin range.",
+    "",
+    "PARAMETER",
+    "    bounds  FLOAT  Comma separated list of the bin bounds (-inf and inf valid)",
+    NULL
+};
+
+static char *SethaloHelp[] = {
+    "NAME",
+    "    sethalo - Set the left and right bounds of a field",
+    "",
+    "SYNOPSIS",
+    "    sethalo,lhalo,rhalo  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    This operator sets the left and right bounds of the rectangularly",
+    "    understood fields. Positive numbers of the parameter lhalo enlarges ",
+    "    the left bound by the given number of columns from the right bound. The",
+    "    parameter rhalo does the similar for the right bound.",
+    "    Negative numbers of the parameter lhalo/rhalo can be used to remove",
+    "    the given number of columns of the left and right bounds.",
+    "",
+    "PARAMETER",
+    "    lhalo  INTEGER  Left halo",
+    "    rhalo  INTEGER  Right halo",
+    NULL
+};
+
+static char *WctHelp[] = {
+    "NAME",
+    "    wct - Windchill temperature",
+    "",
+    "SYNOPSIS",
+    "    wct  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 and ifile2 be time series of temperature and wind",
+    "    speed records, then a corresponding time series of resulting windchill",
+    "    temperatures is written to ofile. The wind chill temperature",
+    "    calculation is only valid for a temperature of T <= 33 °C and a wind speed",
+    "    of v >= 1.39 m/s. Whenever these conditions are not satisfied, a missing",
+    "    value is written to ofile. Note that temperature and wind speed records",
+    "    have to be given in units of °C and m/s, respectively.",
+    NULL
+};
+
+static char *FdnsHelp[] = {
+    "NAME",
+    "    fdns - Frost days where no snow index per time period",
+    "",
+    "SYNOPSIS",
+    "    fdns  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series of the daily minimum temperature TN",
+    "    and ifile2 be a corresponding series of daily surface snow",
+    "    amounts. Then the number of days where TN < 0 °C and the surface ",
+    "    snow amount is less than 1 cm is counted. The temperature TN",
+    "    have to be given in units of Kelvin.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    NULL
+};
+
+static char *StrwinHelp[] = {
+    "NAME",
+    "    strwin - Strong wind days index per time period",
+    "",
+    "SYNOPSIS",
+    "    strwin[,v]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily maximum horizontal wind speed",
+    "    VX, then the number of days where VX > v is counted. The horizontal wind",
+    "    speed v is an optional parameter with default v = 10.5 m/s. A further",
+    "    output variable is the maximum number of consecutive days with maximum wind",
+    "    speed greater than or equal to v. Note that both VX and v have to be given in",
+    "    units of m/s. Also note that the horizontal wind speed is defined as the",
+    "    square root of the sum of squares of the zonal and meridional wind speeds.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "",
+    "PARAMETER",
+    "    v  FLOAT   Horizontal wind speed threshold (m/s, default v = 10.5 m/s)",
+    NULL
+};
+
+static char *StrbreHelp[] = {
+    "NAME",
+    "    strbre - Strong breeze days index per time period",
+    "",
+    "SYNOPSIS",
+    "    strbre  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily maximum horizontal wind speed",
+    "    VX, then the number of days where VX is greater than or equal to 10.5 m/s ",
+    "    is counted. A further output variable is the maximum number of consecutive",
+    "    days with maximum wind speed greater than or equal to 10.5 m/s. Note that",
+    "    VX is defined as the square root of the sum of squares of the zonal and",
+    "    meridional wind speeds and have to be given in units of m/s.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    NULL
+};
+
+static char *StrgalHelp[] = {
+    "NAME",
+    "    strgal - Strong gale days index per time period",
+    "",
+    "SYNOPSIS",
+    "    strgal  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily maximum horizontal wind speed",
+    "    VX, then the number of days where VX is greater than or equal to 20.5 m/s ",
+    "    is counted. A further output variable is the maximum number of consecutive",
+    "    days with maximum wind speed greater than or equal to 20.5 m/s. Note that",
+    "    VX is defined as the square root of the sum of square of the zonal and",
+    "    meridional wind speeds and have to be given in units of m/s.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    NULL
+};
+
+static char *HurrHelp[] = {
+    "NAME",
+    "    hurr - Hurricane days index per time period",
+    "",
+    "SYNOPSIS",
+    "    hurr  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily maximum horizontal wind speed",
+    "    VX, then the number of days where VX is greater than or equal to 32.5 m/s",
+    "    is counted. A further output variable is the maximum number of consecutive",
+    "    days with maximum wind speed greater than or equal to 32.5 m/s. Note that",
+    "    VX is defined as the square root of the sum of squares of the zonal and",
+    "    meridional wind speeds and have to be given in units of m/s.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    NULL
+};
+
+static char *EcaCddHelp[] = {
+    "NAME",
+    "    eca_cdd - Consecutive dry days index per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_cdd[,R]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily precipitation amount RR, then the largest number ",
+    "    of consecutive days where RR is less than R is counted. R is an optional parameter with ",
+    "    default R = 1 mm. A further output variable is the number of dry periods of more than 5 days.",
+    "    The date information of a timestep in ofile is the date of the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - consecutive_dry_days_index_per_time_period",
+    "    - number_of_cdd_periods_with_more_than_5days_per_time_period",
+    "",
+    "PARAMETER",
+    "    R  FLOAT   Precipitation threshold (mm, default: R = 1 mm)",
+    NULL
+};
+
+static char *EcaCfdHelp[] = {
+    "NAME",
+    "    eca_cfd - Consecutive frost days index per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_cfd  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily minimum temperature TN, then the largest number of",
+    "    consecutive days where TN < 0 °C is counted. Note that TN have to be given in units of Kelvin.",
+    "    The date information of a timestep in ofile is the date of the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - consecutive_frost_days_index_per_time_period",
+    NULL
+};
+
+static char *EcaCsuHelp[] = {
+    "NAME",
+    "    eca_csu - Consecutive summer days index per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_csu[,T]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily maximum temperature TX,",
+    "    then the largest number of consecutive days where TX > T is counted.",
+    "    The number T is an optional parameter with default T = 25 °C.",
+    "    Note that TN have to be given in units of Kelvin, whereas T have to be given",
+    "    in degrees Celsius.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - consecutive_summer_days_index_per_time_period",
+    "",
+    "PARAMETER",
+    "    T  FLOAT   Temperature threshold (� Celsius, default: T = 25� Celsius)",
+    NULL
+};
+
+static char *EcaCwdHelp[] = {
+    "NAME",
+    "    eca_cwd - Consecutive wet days index per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_cwd[,R]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily precipitation amount RR, then the largest number ",
+    "    of consecutive days where RR is at least R is counted. R is an optional parameter with ",
+    "    default R = 1 mm. A further output variable is the number of wet periods of more than 5 days.",
+    "    The date information of a timestep in ofile is the date of the last contributing ",
+    "    timestep in ifile.",
+    "    The following variables are created: ",
+    "    - consecutive_wet_days_index_per_time_period",
+    "    - number_of_cwd_periods_with_more_than_5days_per_time_period",
+    "",
+    "PARAMETER",
+    "    R  FLOAT   Precipitation threshold (mm, default: R = 1 mm)",
+    NULL
+};
+
+static char *EcaCwdiHelp[] = {
+    "NAME",
+    "    eca_cwdi - Cold wave duration index wrt mean of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_cwdi[,nday[,T]]  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series of the daily minimum temperature TN,",
+    "    and let ifile2 be the mean TNnorm of daily minimum temperatures",
+    "    for any period used as reference. Then counted is the number of days",
+    "    where, in intervals of at least nday consecutive days, TN < TNnorm - T.",
+    "    The numbers nday and T are optional parameters with default nday = 6",
+    "    and T = 5 °C. A further output variable is the number of cold",
+    "    waves longer than or equal to nday days.",
+    "    TNnorm is calculated as the mean of minimum temperatures of a five day ",
+    "    window centred on each calendar day of a given climate reference period.",
+    "    Note that both TN and TNnorm have to be given in the same units.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - cold_wave_duration_index_wrt_mean_of_reference_period",
+    "    - cold_waves_per_time_period",
+    "",
+    "PARAMETER",
+    "    nday  INTEGER  Number of consecutive days (default: nday = 6)",
+    "    T     FLOAT    Temperature offset (� Celsius, default: T = 5� Celsius)",
+    NULL
+};
+
+static char *EcaCwfiHelp[] = {
+    "NAME",
+    "    eca_cwfi - Cold-spell days index wrt 10th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_cwfi[,nday]  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series of the daily mean temperature TG, and ",
+    "    ifile2 be the 10th percentile TGn10 of daily mean temperatures",
+    "    for any period used as reference. Then counted is the number of days",
+    "    where, in intervals of at least nday consecutive days, TG < TGn10. The",
+    "    number nday is an optional parameter with default nday = 6. A further",
+    "    output variable is the number of cold-spell periods longer than or",
+    "    equal to nday days.",
+    "    TGn10 is calculated as the 10th percentile of daily mean temperatures of a five ",
+    "    day window centred on each calendar day of a given climate reference period.",
+    "    Note that both TG and TGn10 have to be given in the same units.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - cold_spell_days_index_wrt_10th_percentile_of_reference_period",
+    "    - cold_spell_periods_per_time_period",
+    "",
+    "PARAMETER",
+    "    nday  INTEGER  Number of consecutive days (default: nday = 6)",
+    NULL
+};
+
+static char *EcaEtrHelp[] = {
+    "NAME",
+    "    eca_etr - Intra-period extreme temperature range",
+    "",
+    "SYNOPSIS",
+    "    eca_etr  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 and ifile2 be time series of thr maximum and minimum",
+    "    temperature TX and TN, respectively. Then the extreme temperature",
+    "    range is the difference of the maximum of TX and the minimum of TN.",
+    "    Note that TX and TN have to be given in the same units.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timesteps in ifile1 and ifile2.",
+    "    The following variables are created: ",
+    "    - intra_period_extreme_temperature_range",
+    NULL
+};
+
+static char *EcaFdHelp[] = {
+    "NAME",
+    "    eca_fd - Frost days index per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_fd  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily minimum temperature TN,",
+    "    then the number of days where TN < 0 °C is counted. Note",
+    "    that TN have to be given in units of Kelvin.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - frost_days_index_per_time_period",
+    NULL
+};
+
+static char *EcaGslHelp[] = {
+    "NAME",
+    "    eca_gsl - Thermal Growing season length index",
+    "",
+    "SYNOPSIS",
+    "    eca_gsl[,nday[,T[,fland]]]  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series of the daily mean temperature TG,",
+    "    and ifile2 be a land-water mask.",
+    "    Within a period of 12 months, the thermal growing season length is officially",
+    "    defined as the number of days between:",
+    "    - frist occurrence of at least nday consecutive days with TG $>$ @math{T}",
+    "    - first occurrence of at least nday consecutive days with TG $<$ @math{T} within the last 6 months",
+    "    On northern hemispere, this period corresponds with the regular year, whereas",
+    "    on southern hemispere, it starts at july $1^{st}$. Please note, that this",
+    "    definition may lead to weird results concerning values TG = T: In the first",
+    "    half of the period, these days do not contribute to the gsl, but they do within",
+    "    the second half. Moreover this definition could lead to discontinuous values in",
+    "    equatorial regions.",
+    "    ",
+    "    The numbers nday and T are optional parameter with default nday = 6",
+    "    and T = 5 °C. The number fland is an optional parameter with",
+    "    default value fland = 0.5 and denotes the fraction of a grid point that",
+    "    have to be covered by land in order to be included in the calculation. A",
+    "    further output variable is the start day of year of the growing season.",
+    "    Note that TG have to be given in units of Kelvin, whereas T have to be given",
+    "    in degrees Celsius.",
+    "    ",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - thermal_growing_season_length",
+    "    - day_of_year_of_growing_season_start",
+    "",
+    "PARAMETER",
+    "    nday   INTEGER  Number of consecutive days (default: nday = 6)",
+    "    T      FLOAT   Temperature threshold (degree Celsius, default: T = 5� Celsius)",
+    "    fland  FLOAT   Land fraction threshold (default: fland = 0.5)",
+    NULL
+};
+
+static char *EcaHdHelp[] = {
+    "NAME",
+    "    eca_hd - Heating degree days per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_hd[,T1[,T2]]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily mean temperature TG, then",
+    "    the heating degree days are defined as the sum of T1 - TG, where only",
+    "    values TG < T2 are considered. If T1 and T2 are omitted, a temperature",
+    "    of 17 °C is used for both parameters. If only T1 is given, T2 is",
+    "    set to T1. Note that TG have to be given in units of kelvin, whereas T1",
+    "    and T2 have to be given in degrees Celsius.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - heating_degree_days_per_time_period",
+    "",
+    "PARAMETER",
+    "    T1  FLOAT   Temperature limit (� Celsius, default: T1 = 17� Celsius)",
+    "    T2  FLOAT   Temperature limit (� Celsius, default: T2 = T1)",
+    NULL
+};
+
+static char *EcaHwdiHelp[] = {
+    "NAME",
+    "    eca_hwdi - Heat wave duration index wrt mean of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_hwdi[,nday[,T]]  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series of the daily maximum temperature TX,",
+    "    and let ifile2 be the mean TXnorm of daily maximum temperatures",
+    "    for any period used as reference. Then counted is the number of days",
+    "    where, in intervals of at least nday consecutive days, TX > TXnorm + T.",
+    "    The numbers nday and T are optional parameters with default nday = 6",
+    "    and T = 5 °C. A further output variable is the number of heat",
+    "    waves longer than or equal to nday days. ",
+    "    TXnorm is calculated as the mean of maximum temperatures of a five day ",
+    "    window centred on each calendar day of a given climate reference period.",
+    "    Note that both TX and TXnorm have to be given in the same units.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - heat_wave_duration_index_wrt_mean_of_reference_period",
+    "    - heat_waves_per_time_period",
+    "",
+    "PARAMETER",
+    "    nday  INTEGER  Number of consecutive days (default: nday = 6)",
+    "    T     FLOAT    Temperature offset (� Celsius, default: T = 5� Celsius)",
+    NULL
+};
+
+static char *EcaHwfiHelp[] = {
+    "NAME",
+    "    eca_hwfi - Warm spell days index wrt 90th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_hwfi[,nday]  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series of the daily mean temperature TG, and ",
+    "    ifile2 be the 90th percentile TGn90 of daily mean temperatures",
+    "    for any period used as reference. Then counted is the number of days",
+    "    where, in intervals of at least nday consecutive days, TG > TGn90. The",
+    "    number nday is an optional parameter with default nday = 6. A further",
+    "    output variable is the number of warm-spell periods longer than or",
+    "    equal to nday days. ",
+    "    TGn90 is calculated as the 90th percentile of daily mean temperatures of a five ",
+    "    day window centred on each calendar day of a given climate reference period.",
+    "    Note that both TG and TGn90 have to be given in the same units.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - warm_spell_days_index_wrt_90th_percentile_of_reference_period",
+    "    - warm_spell_periods_per_time_period",
+    "",
+    "PARAMETER",
+    "    nday  INTEGER  Number of consecutive days (default: nday = 6)",
+    NULL
+};
+
+static char *EcaIdHelp[] = {
+    "NAME",
+    "    eca_id - Ice days index per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_id  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily maximum temperature TX,",
+    "    then the number of days where TX < 0 °C is counted. Note",
+    "    that TX have to be given in units of Kelvin.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - ice_days_index_per_time_period",
+    NULL
+};
+
+static char *EcaR75pHelp[] = {
+    "NAME",
+    "    eca_r75p - Moderate wet days wrt 75th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_r75p  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series RR of the daily precipitation amount at wet days (precipitation >= 1 mm)",
+    "    and ifile2 be the 75th percentile RRn75 of the daily precipitation amount at wet days for any period ",
+    "    used as reference. Then the percentage of wet days with RR > RRn75 is calculated. ",
+    "    RRn75 is calculated as the 75th percentile of all wet days of a given climate reference period.",
+    "    Usually ifile2 is generated by the operator ydaypctl,75.",
+    "    The date information of a timestep in ofile is the date of the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - moderate_wet_days_wrt_75th_percentile_of_reference_period",
+    NULL
+};
+
+static char *EcaR75ptotHelp[] = {
+    "NAME",
+    "    eca_r75ptot - Precipitation percent due to R75p days",
+    "",
+    "SYNOPSIS",
+    "    eca_r75ptot  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series RR of the daily precipitation amount at wet days (precipitation >= 1 mm)",
+    "    and ifile2 be the 75th percentile RRn75 of the daily precipitation amount at wet days for any period ",
+    "    used as reference. Then the ratio of the precipitation sum at wet days with RR > RRn75 to the total ",
+    "    precipitation sum is calculated. ",
+    "    RRn75 is calculated as the 75th percentile of all wet days of a given climate reference period.",
+    "    Usually ifile2 is generated by the operator ydaypctl,75.",
+    "    The date information of a timestep in ofile is the date of the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - precipitation_percent_due_to_R75p_days",
+    NULL
+};
+
+static char *EcaR90pHelp[] = {
+    "NAME",
+    "    eca_r90p - Wet days wrt 90th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_r90p  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series RR of the daily precipitation amount at wet days (precipitation >= 1 mm)",
+    "    and ifile2 be the 90th percentile RRn90 of the daily precipitation amount at wet days for any period ",
+    "    used as reference. Then the percentage of wet days with RR > RRn90 is calculated. ",
+    "    RRn90 is calculated as the 90th percentile of all wet days of a given climate reference period.",
+    "    Usually ifile2 is generated by the operator ydaypctl,90.",
+    "    The date information of a timestep in ofile is the date of the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - wet_days_wrt_90th_percentile_of_reference_period",
+    NULL
+};
+
+static char *EcaR90ptotHelp[] = {
+    "NAME",
+    "    eca_r90ptot - Precipitation percent due to R90p days",
+    "",
+    "SYNOPSIS",
+    "    eca_r90ptot  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series RR of the daily precipitation amount at wet days (precipitation >= 1 mm)",
+    "    and ifile2 be the 90th percentile RRn90 of the daily precipitation amount at wet days for any period ",
+    "    used as reference. Then the ratio of the precipitation sum at wet days with RR > RRn90 to the total ",
+    "    precipitation sum is calculated. ",
+    "    RRn90 is calculated as the 90th percentile of all wet days of a given climate reference period.",
+    "    Usually ifile2 is generated by the operator ydaypctl,90.",
+    "    The date information of a timestep in ofile is the date of the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - precipitation_percent_due_to_R90p_days",
+    NULL
+};
+
+static char *EcaR95pHelp[] = {
+    "NAME",
+    "    eca_r95p - Very wet days wrt 95th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_r95p  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series RR of the daily precipitation amount at wet days (precipitation >= 1 mm)",
+    "    and ifile2 be the 95th percentile RRn95 of the daily precipitation amount at wet days for any period ",
+    "    used as reference. Then the percentage of wet days with RR > RRn95 is calculated. ",
+    "    RRn95 is calculated as the 95th percentile of all wet days of a given climate reference period.",
+    "    Usually ifile2 is generated by the operator ydaypctl,95.",
+    "    The date information of a timestep in ofile is the date of the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - very_wet_days_wrt_95th_percentile_of_reference_period",
+    NULL
+};
+
+static char *EcaR95ptotHelp[] = {
+    "NAME",
+    "    eca_r95ptot - Precipitation percent due to R95p days",
+    "",
+    "SYNOPSIS",
+    "    eca_r95ptot  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series RR of the daily precipitation amount at wet days (precipitation >= 1 mm)",
+    "    and ifile2 be the 95th percentile RRn95 of the daily precipitation amount at wet days for any period ",
+    "    used as reference. Then the ratio of the precipitation sum at wet days with RR > RRn95 to the total ",
+    "    precipitation sum is calculated. ",
+    "    RRn95 is calculated as the 95th percentile of all wet days of a given climate reference period.",
+    "    Usually ifile2 is generated by the operator ydaypctl,95.",
+    "    The date information of a timestep in ofile is the date of the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - precipitation_percent_due_to_R95p_days",
+    NULL
+};
+
+static char *EcaR99pHelp[] = {
+    "NAME",
+    "    eca_r99p - Extremely wet days wrt 99th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_r99p  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series RR of the daily precipitation amount at wet days (precipitation >= 1 mm)",
+    "    and ifile2 be the 99th percentile RRn99 of the daily precipitation amount at wet days for any period ",
+    "    used as reference. Then the percentage of wet days with RR > RRn99 is calculated. ",
+    "    RRn99 is calculated as the 99th percentile of all wet days of a given climate reference period.",
+    "    Usually ifile2 is generated by the operator ydaypctl,99.",
+    "    The date information of a timestep in ofile is the date of the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - extremely_wet_days_wrt_99th_percentile_of_reference_period",
+    NULL
+};
+
+static char *EcaR99ptotHelp[] = {
+    "NAME",
+    "    eca_r99ptot - Precipitation percent due to R99p days",
+    "",
+    "SYNOPSIS",
+    "    eca_r99ptot  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series RR of the daily precipitation amount at wet days (precipitation >= 1 mm)",
+    "    and ifile2 be the 99th percentile RRn99 of the daily precipitation amount at wet days for any period ",
+    "    used as reference. Then the ratio of the precipitation sum at wet days with RR > RRn99 to the total ",
+    "    precipitation sum is calculated. ",
+    "    RRn99 is calculated as the 99th percentile of all wet days of a given climate reference period.",
+    "    Usually ifile2 is generated by the operator ydaypctl,99.",
+    "    The date information of a timestep in ofile is the date of the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - precipitation_percent_due_to_R99p_days",
+    NULL
+};
+
+static char *EcaPdHelp[] = {
+    "NAME",
+    "    eca_pd, eca_r10mm, eca_r20mm - Precipitation days index per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_pd,x  ifile ofile",
+    "    eca_r10mm  ifile ofile",
+    "    eca_r20mm  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily precipitation amount RR in [mm] (or alternatively in [kg m-2]),",
+    "    then the number of days where RR is at least x mm is counted. ",
+    "    eca_r10mm and eca_r20mm are specific ECA operators with a daily precipitation amount of 10 and 20 mm respectively.",
+    "    The date information of a timestep in ofile is the date of the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - precipitation_days_index_per_time_period",
+    "",
+    "OPERATORS",
+    "    eca_pd     Precipitation days index per time period",
+    "               Generic ECA operator with daily precipitation sum exceeding x mm.",
+    "    eca_r10mm  Heavy precipitation days index per time period",
+    "               Specific ECA operator with daily precipitation sum exceeding 10 mm.",
+    "    eca_r20mm  Very heavy precipitation days index per time period",
+    "               Specific ECA operator with daily precipitation sum exceeding 20 mm.",
+    "",
+    "PARAMETER",
+    "    x  FLOAT   Daily precipitation amount threshold in [mm]",
+    NULL
+};
+
+static char *EcaRr1Help[] = {
+    "NAME",
+    "    eca_rr1 - Wet days index per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_rr1[,R]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily precipitation amount RR in [mm] (or alternatively in [kg m-2]),",
+    "    then the number of days where RR is at least R is counted. R is an optional parameter with ",
+    "    default R = 1 mm. The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - wet_days_index_per_time_period",
+    "",
+    "PARAMETER",
+    "    R  FLOAT   Precipitation threshold (mm, default: R = 1 mm)",
+    NULL
+};
+
+static char *EcaRx1dayHelp[] = {
+    "NAME",
+    "    eca_rx1day - Highest one day precipitation amount per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_rx1day[,mode]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily precipitation amount RR,",
+    "    then the maximum of RR is written to ofile. If the optional",
+    "    parameter mode is set to 'm' the maximum daily precipitation",
+    "    amounts are determined for each month. ",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - highest_one_day_precipitation_amount_per_time_period",
+    "",
+    "PARAMETER",
+    "    mode  STRING   Operation mode (optional). If mode = 'm' then maximum daily precipitation amounts are determined for each month",
+    NULL
+};
+
+static char *EcaRx5dayHelp[] = {
+    "NAME",
+    "    eca_rx5day - Highest five-day precipitation amount per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_rx5day[,x]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of 5-day precipitation totals RR,",
+    "    then the maximum of RR is written to ofile. A further output",
+    "    variable is the number of 5 day period with precipitation totals",
+    "    greater than x mm, where x is an optional parameter with default",
+    "    x = 50 mm.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - highest_five_day_precipitation_amount_per_time_period",
+    "    - number_of_5day_heavy_precipitation_periods_per_time_period",
+    "",
+    "PARAMETER",
+    "    x  FLOAT   Precipitation threshold (mm, default: x = 50 mm)",
+    NULL
+};
+
+static char *EcaSdiiHelp[] = {
+    "NAME",
+    "    eca_sdii - Simple daily intensity index per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_sdii[,R]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily precipitation amount RR, then the mean ",
+    "    precipitation amount at wet days (RR > R) is written to ofile. ",
+    "    R is an optional parameter with default R = 1 mm.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - simple_daily_intensitiy_index_per_time_period",
+    "",
+    "PARAMETER",
+    "    R  FLOAT   Precipitation threshold (mm, default: R = 1 mm)",
+    NULL
+};
+
+static char *EcaSuHelp[] = {
+    "NAME",
+    "    eca_su - Summer days index per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_su[,T]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily maximum temperature TX,",
+    "    then the number of days where TX > T is counted. The number T is",
+    "    an optional parameter with default T = 25 °C. Note that TX",
+    "    have to be given in units of Kelvin, whereas T have to be given in degrees Celsius.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - summer_days_index_per_time_period",
+    "",
+    "PARAMETER",
+    "    T  FLOAT   Temperature threshold (degree Celsius, default: T = 25� Celsius)",
+    NULL
+};
+
+static char *EcaTg10pHelp[] = {
+    "NAME",
+    "    eca_tg10p - Cold days percent wrt 10th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_tg10p  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series of the daily mean temperature TG, and",
+    "    ifile2 be the 10th percentile TGn10 of daily mean temperatures",
+    "    for any period used as reference. Then the percentage of time where ",
+    "    TG < TGn10 is calculated.",
+    "    TGn10 is calculated as the 10th percentile of daily mean temperatures of a five ",
+    "    day window centred on each calendar day of a given climate reference period.",
+    "    Note that both TG and TGn10 have to be given in the same units.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - cold_days_percent_wrt_10th_percentile_of_reference_period",
+    NULL
+};
+
+static char *EcaTg90pHelp[] = {
+    "NAME",
+    "    eca_tg90p - Warm days percent wrt 90th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_tg90p  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series of the daily mean temperature TG, and",
+    "    ifile2 be the 90th percentile TGn90 of daily mean temperatures",
+    "    for any period used as reference. Then the percentage of time where TG > TGn90 ",
+    "    is calculated. ",
+    "    TGn90 is calculated as the 90th percentile of daily mean temperatures of a five ",
+    "    day window centred on each calendar day of a given climate reference period.",
+    "    Note that both TG and TGn90 have to be given in the same units.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - warm_days_percent_wrt_90th_percentile_of_reference_period",
+    NULL
+};
+
+static char *EcaTn10pHelp[] = {
+    "NAME",
+    "    eca_tn10p - Cold nights percent wrt 10th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_tn10p  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time serie of the daily minimum temperature TN, and",
+    "    ifile2 be the 10th percentile TNn10 of daily minimum temperatures",
+    "    for any period used as reference. Then the percentage of time where TN < TNn10 ",
+    "    is calculated.",
+    "    TNn10 is calculated as the 10th percentile of daily minimum temperatures of a five ",
+    "    day window centred on each calendar day of a given climate reference period.",
+    "    Note that both TN and TNn10 have to be given in the same units.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - cold_nights_percent_wrt_10th_percentile_of_reference_period",
+    NULL
+};
+
+static char *EcaTn90pHelp[] = {
+    "NAME",
+    "    eca_tn90p - Warm nights percent wrt 90th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_tn90p  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series of the daily minimum temperature TN, and",
+    "    ifile2 be the 90th percentile TNn90 of daily minimum temperatures",
+    "    for any period used as reference. Then the percentage of time where TN > TNn90 ",
+    "    is calculated.",
+    "    TNn90 is calculated as the 90th percentile of daily minimum temperatures of a five ",
+    "    day window centred on each calendar day of a given climate reference period.",
+    "    Note that both TN and TNn90 have to be given in the same units.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - warm_nights_percent_wrt_90th_percentile_of_reference_period",
+    NULL
+};
+
+static char *EcaTrHelp[] = {
+    "NAME",
+    "    eca_tr - Tropical nights index per time period",
+    "",
+    "SYNOPSIS",
+    "    eca_tr[,T]  ifile ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile be a time series of the daily minimum temperature TN,",
+    "    then the number of days where TN > T is counted. The number T is",
+    "    an optional parameter with default T = 20 °C. Note that TN",
+    "    have to be given in units of Kelvin, whereas T have to be given in degrees Celsius.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile.",
+    "    The following variables are created: ",
+    "    - tropical_nights_index_per_time_period",
+    "",
+    "PARAMETER",
+    "    T  FLOAT   Temperature threshold (� Celsius, default: T = 20� Celsius)",
+    NULL
+};
+
+static char *EcaTx10pHelp[] = {
+    "NAME",
+    "    eca_tx10p - Very cold days percent wrt 10th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_tx10p  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series of the daily maximum temperature TX, and",
+    "    ifile2 be the 10th percentile TXn10 of daily maximum temperatures",
+    "    for any period used as reference. Then the percentage of time where TX < TXn10.",
+    "    is calculated.",
+    "    TXn10 is calculated as the 10th percentile of daily maximum temperatures of a five ",
+    "    day window centred on each calendar day of a given climate reference period.",
+    "    Note that both TX and TXn10 have to be givenin the same units.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - very_cold_days_percent_wrt_10th_percentile_of_reference_period",
+    NULL
+};
+
+static char *EcaTx90pHelp[] = {
+    "NAME",
+    "    eca_tx90p - Very warm days percent wrt 90th percentile of reference period",
+    "",
+    "SYNOPSIS",
+    "    eca_tx90p  ifile1 ifile2 ofile",
+    "",
+    "DESCRIPTION",
+    "    Let ifile1 be a time series of the daily maximum temperature TX, and",
+    "    ifile2 be the 90th percentile TXn90 of daily maximum temperatures",
+    "    for any period used as reference. Then the percentage of time where TX > TXn90.",
+    "    is calculated.",
+    "    TXn90 is calculated as the 90th percentile of daily maximum temperatures of a five ",
+    "    day window centred on each calendar day of a given climate reference period.",
+    "    Note that both TX and TXn90 have to be given in the same units.",
+    "    The date information of a timestep in ofile is the date of",
+    "    the last contributing timestep in ifile1.",
+    "    The following variables are created: ",
+    "    - very_warm_days_percent_wrt_90th_percentile_of_reference_period",
+    NULL
+};
diff --git a/src/par_io.c b/src/par_io.c
new file mode 100644
index 0000000..78f4ed3
--- /dev/null
+++ b/src/par_io.c
@@ -0,0 +1,111 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if  defined  (HAVE_LIBPTHREAD)
+#  include <pthread.h>
+#endif
+
+#include <string.h> /* memcpy */
+
+#include "cdo.h"
+#include "par_io.h"
+#include "pstream.h"
+
+
+void *readRecord(void *arg)
+{
+  int streamID;
+  int *varID, *levelID, *nmiss;
+  double *array;
+  read_arg_t *read_arg = (read_arg_t *) arg;
+
+  streamID = read_arg->streamID;
+  varID    = read_arg->varID;
+  levelID  = read_arg->levelID;
+  nmiss    = read_arg->nmiss;
+  array    = read_arg->array;
+
+  /* fprintf(stderr, "streamInqRecord: streamID = %d\n", streamID); */
+  streamInqRecord(streamID, varID, levelID);
+  streamReadRecord(streamID, array, nmiss);
+  /* fprintf(stderr, "readRecord: varID %d levelID %d\n", *varID, *levelID); */
+
+  return (NULL);
+}
+
+
+void parReadRecord(int streamID, int *varID, int *levelID, double *array, int *nmiss, par_io_t *parIO)
+{
+  int lpario = FALSE;
+  int recID = 0, nrecs = 0;
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_t thrID;
+  /* pthread_attr_t attr; */
+  int rval;
+#endif
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( parIO )
+    {
+      lpario = TRUE;
+      recID = parIO->recID;
+      nrecs = parIO->nrecs;
+      thrID = parIO->thrID;
+    }
+#endif
+
+  if ( recID == 0 || lpario == FALSE )
+    {
+      read_arg_t read_arg;
+      read_arg.streamID = streamID;
+      read_arg.varID    = varID;
+      read_arg.levelID  = levelID;
+      read_arg.nmiss    = nmiss;
+      read_arg.array    = array;
+
+      readRecord(&read_arg);
+    }
+#if  defined  (HAVE_LIBPTHREAD)
+  else
+    {
+      /* fprintf(stderr, "parIO1: %ld streamID %d %d %d\n", (long)thrID, streamID, recID, nrecs); */
+      rval = pthread_join(thrID, NULL);
+      if ( rval != 0 ) cdoAbort("pthread_join failed!");
+
+      *varID    = parIO->varID;
+      *levelID  = parIO->levelID;
+      *nmiss    = parIO->nmiss;
+      /* fprintf(stderr, "parIO2: %ld streamID %d %d %d\n", (long)thrID, streamID, *varID, *levelID); */
+      memcpy(array, parIO->array, parIO->array_size*sizeof(double));
+    }
+
+  if ( lpario && nrecs > 1 )
+    {
+      read_arg_t *read_arg = &(parIO->read_arg);
+      if ( (recID+1) < nrecs )
+	{
+	  if ( recID == 0 )
+	    {
+	      pthread_attr_init(&parIO->attr);
+	      pthread_attr_setdetachstate(&parIO->attr, PTHREAD_CREATE_JOINABLE);
+	    }
+
+	  read_arg->streamID = streamID;
+	  read_arg->varID    = &parIO->varID;
+	  read_arg->levelID  = &parIO->levelID;
+	  read_arg->nmiss    = &parIO->nmiss;
+	  read_arg->array    = parIO->array;
+
+	  /* fprintf(stderr, "pthread_create: streamID %d %d\n", read_arg->streamID,streamID); */
+	  rval = pthread_create(&thrID, &parIO->attr, readRecord, read_arg);
+	  if ( rval != 0 ) cdoAbort("pthread_create failed!");
+
+	  /* fprintf(stderr, "thrID = %ld\n", (long) thrID); */
+	  parIO->thrID = thrID;
+	}
+      else
+	pthread_attr_destroy(&parIO->attr);
+    }
+#endif
+}
diff --git a/src/par_io.h b/src/par_io.h
new file mode 100644
index 0000000..b6505e8
--- /dev/null
+++ b/src/par_io.h
@@ -0,0 +1,37 @@
+#ifndef _PAR_IO_H
+#define _PAR_IO_H
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if  defined  (HAVE_LIBPTHREAD)
+#  include <pthread.h>
+#endif
+
+
+typedef struct {
+  int streamID;
+  int *varID, *levelID, *nmiss;
+  double *array;
+}
+read_arg_t;
+
+
+typedef struct {
+  int varID, levelID, nmiss;
+  double *array;
+  int array_size;
+  int recID, nrecs;
+  read_arg_t read_arg;
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_t thrID;
+  pthread_attr_t attr;
+#endif
+}
+par_io_t;
+
+
+void parReadRecord(int streamID, int *varID, int *levelID, double *array, int *nmiss, par_io_t *parIO);
+
+#endif  /* _PAR_IO_H */
diff --git a/src/percentiles.c b/src/percentiles.c
new file mode 100644
index 0000000..97b9a1b
--- /dev/null
+++ b/src/percentiles.c
@@ -0,0 +1,426 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <assert.h>
+#include <stdlib.h>
+#include <math.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "nth_element.h"
+#include "percentiles.h"
+
+#define NBINS_DEFAULT   101
+#define NBINS_MINIMUM    11
+
+#define DBL_CAPACITY(n) ((int)(((n) * sizeof(int)) / sizeof(double)))
+#define DBL_PTR(p)      ((double *) (p))
+#define INT_PTR(p)      ((int *) (p))
+
+
+static int histGetEnvNBins()
+{
+  const char *str = getenv("CDO_PCTL_NBINS");
+  
+  return str != NULL ? MAX(atoi(str), NBINS_MINIMUM) : NBINS_DEFAULT;
+}
+
+
+static void histDefBounds(HISTOGRAM *hist, double a, double b)
+{
+  int i;
+  
+  assert( hist != NULL );
+  assert( hist->nbins > 0 );
+  
+  hist->min   = MIN(a, b);
+  hist->max   = MAX(a, b);
+  hist->step  = (hist->max - hist->min) / hist->nbins;
+  hist->nsamp = 0;
+
+  for ( i = 0; i < hist->nbins; i++ )
+    INT_PTR(hist->ptr)[i] = 0;
+}
+
+
+static void histBinValue(HISTOGRAM *hist, double value)
+{
+  int bin;
+  
+  assert( hist->step > 0 );
+
+  bin = MIN((int)((value - hist->min) / hist->step), hist->nbins - 1);
+  if ( bin >= 0 && bin < hist->nbins )
+    INT_PTR(hist->ptr)[bin]++;
+}
+
+
+static void histBin(HISTOGRAM *hist)
+{
+  int i;
+  double *values;
+  
+  assert( hist->nsamp == DBL_CAPACITY(hist->nbins) );
+
+  values = (double *) malloc(hist->nsamp * sizeof(double));
+
+  for ( i = 0; i < hist->nsamp; i++ )
+    values[i] = DBL_PTR(hist->ptr)[i];
+  for ( i = 0; i < hist->nbins; i++ )
+    INT_PTR(hist->ptr)[i] = 0;
+  for ( i = 0; i < hist->nsamp; i++ )
+    histBinValue(hist, values[i]);
+      
+  free(values);
+}
+
+
+static int histAddValue(HISTOGRAM *hist, double value)
+{
+  assert( hist != NULL );
+  assert( hist->nbins > 0 );
+
+  /* 2011-08-01 Uwe Schulzweida: added check for rounding errors */
+  if ( value < hist->min && (hist->min-value) < 1e5 ) value = hist->min;
+  if ( value > hist->max && (value-hist->max) < 1e5 ) value = hist->max;
+
+  if ( IS_EQUAL(hist->min, hist->max) )
+    return 0;
+  if ( value < hist->min || value > hist->max )
+    return 1;
+
+  if ( hist->nsamp < DBL_CAPACITY(hist->nbins) )
+    {
+      DBL_PTR(hist->ptr)[hist->nsamp] = value;
+      hist->nsamp++;
+    } 
+  else if ( hist->nsamp > DBL_CAPACITY(hist->nbins) )
+    {
+      histBinValue(hist, value);
+      hist->nsamp++;
+    }
+  else
+    {
+      histBin(hist);
+      histBinValue(hist, value);
+      hist->nsamp++; 
+    }
+  
+  return 0;
+}
+
+
+static double histGetPercentile(const HISTOGRAM *hist, double p)
+{
+  double s, t;
+  int i = 0, count = 0;
+  
+  assert( hist != NULL );
+  assert( hist->nsamp > 0 );
+  assert( hist->nbins > 0 );
+  assert( p >= 0 );
+  assert( p <= 100 );
+  
+  s = hist->nsamp * (p / 100.0);
+  
+  if ( hist->nsamp > DBL_CAPACITY(hist->nbins) )
+    { 
+      do count += INT_PTR(hist->ptr)[i++]; while ( count < s );
+  
+      assert( i > 0 );
+      assert( i - 1 < hist->nbins );
+      assert( INT_PTR(hist->ptr)[i - 1] > 0 );
+      assert( hist->step > 0.0 );
+  
+      t = (count - s) / INT_PTR(hist->ptr)[i - 1];
+      return hist->min + (i - t) * hist->step;
+    }
+  else
+    {
+      return (double)nth_element(DBL_PTR(hist->ptr), hist->nsamp, (int)ceil(s) - 1);
+    } 
+}
+
+
+HISTOGRAM_SET *hsetCreate(int nvars)
+{
+  int varID;
+  HISTOGRAM_SET *hset;
+  
+  assert( nvars > 0);
+  
+  hset = (HISTOGRAM_SET *) malloc(sizeof(HISTOGRAM_SET));
+  if ( hset == NULL )
+    cdoAbort("Not enough memory (%s)", __func__);
+    
+  hset->nvars   = nvars;
+  hset->nlevels = (int *) malloc(nvars * sizeof(int));
+  hset->grids   = (int *) malloc(nvars * sizeof(int));
+  hset->histograms = (HISTOGRAM ***) malloc(nvars * sizeof(HISTOGRAM **));
+  if ( hset->histograms == NULL )
+    cdoAbort("Not enough memory (%s)", __func__);
+  
+  for ( varID = 0; varID < nvars; varID++ )
+    {
+      hset->nlevels[varID]    = 0;
+      hset->grids[varID]      = 0;
+      hset->histograms[varID] = NULL;
+    }
+  
+  return hset;
+}
+
+
+void hsetCreateVarLevels(HISTOGRAM_SET *hset, int varID, int nlevels, int grid)
+{
+  int nvars, nhists, nbins, levelID, histID;
+  HISTOGRAM *hists;
+  
+  nbins = histGetEnvNBins();
+  
+  assert( hset != NULL );
+  assert( nlevels > 0 );
+  assert( nbins   > 0 );
+  
+  nvars = hset->nvars;
+
+  assert( nvars > 0 );
+  
+  if ( varID < 0 || varID >= nvars )
+    cdoAbort("Illegal argument: varID %d is undefined (%s)", varID, __func__);
+    
+  nhists = gridInqSize(grid);
+  
+  assert( nhists > 0 );
+    
+  hset->nlevels[varID] = nlevels;
+  hset->grids[varID]   = grid;
+
+  hset->histograms[varID] = (HISTOGRAM **) malloc(nlevels * sizeof(HISTOGRAM *));
+  if ( hset->histograms[varID] == NULL )
+    cdoAbort("Not enough memory (%s)", __func__);
+
+  for ( levelID = 0; levelID < nlevels; levelID++ )
+    {
+      hists = hset->histograms[varID][levelID] = (HISTOGRAM *) malloc(nhists * sizeof(HISTOGRAM));
+      if ( hists == NULL )
+        cdoAbort("Not enough memory (%s)", __func__);
+        
+      for ( histID = 0; histID < nhists; histID++ )
+        {
+          hists[histID].min = 0.0;
+          hists[histID].max = 0.0;
+          hists[histID].step = 0.0;
+          hists[histID].nbins = nbins;
+          hists[histID].nsamp = 0;
+
+          hists[histID].ptr = malloc(nbins * sizeof(int));
+          if ( hists[histID].ptr == NULL )
+            cdoAbort("Not enough memory (%s)", __func__);
+        }
+    }
+}
+
+
+void hsetDestroy(HISTOGRAM_SET *hset)
+{
+  int varID, levelID, histID, nhists;
+  
+  if ( hset != NULL )
+    {
+      for ( varID = hset->nvars; varID-- > 0; )
+        {
+          nhists = gridInqSize(hset->grids[varID]);
+          for ( levelID = hset->nlevels[varID]; levelID-- > 0; )
+            {
+              for ( histID = nhists; histID-- > 0; )
+                free(hset->histograms[varID][levelID][histID].ptr);
+              free(hset->histograms[varID][levelID]);
+            }
+          free(hset->histograms[varID]);
+        }
+      
+      free(hset->histograms);
+      free(hset->grids);
+      free(hset->nlevels);
+      free(hset);
+      
+      hset = NULL;  
+    }
+}
+
+
+void hsetDefVarLevelBounds(HISTOGRAM_SET *hset, int varID, int levelID, const field_t *field1, const field_t *field2)
+{
+  const double *array1 = field1->ptr;
+  const double *array2 = field2->ptr;
+  
+  int i, nvars, nlevels, nhists, grid;
+  double a, b;
+  HISTOGRAM *hists;
+  
+  assert( hset   != NULL );
+  assert( field1 != NULL );
+  assert( field2 != NULL );
+  assert( array1 != NULL );
+  assert( array2 != NULL );
+     
+  nvars = hset->nvars;
+  
+  assert( nvars > 0 );
+  
+  if ( varID < 0 || varID >= nvars )
+    cdoAbort("Illegal argument: varID %d is undefined (%s)", varID, __func__);
+
+  nlevels = hset->nlevels[varID];
+  
+  assert( nlevels > 0 );
+  
+  if ( levelID < 0 || levelID >= nlevels )
+    cdoAbort("Illegal argument: levelID %d is undefined (%s)", levelID, __func__);
+
+  grid = hset->grids[varID];
+  
+  if ( grid != field1->grid || grid != field2->grid )
+    cdoAbort("Grids are different", __func__);
+  
+  hists  = hset->histograms[varID][levelID];
+  
+  assert( hists != NULL );
+  
+  nhists = gridInqSize(grid);
+  
+  assert( nhists > 0 );
+         
+  for ( i = 0; i < nhists; i++ )
+    {
+      a = array1[i];
+      b = array2[i];
+      
+      if ( DBL_IS_EQUAL(a, field1->missval) || DBL_IS_EQUAL(b, field2->missval) || DBL_IS_EQUAL(a, b) )
+        histDefBounds(&hists[i], 0.0, 0.0);
+      else  
+        histDefBounds(&hists[i], a, b);
+    }
+}
+
+
+void hsetAddVarLevelValues(HISTOGRAM_SET *hset, int varID, int levelID, const field_t *field)
+{
+  const double *array = field->ptr;
+  int i, grid, nvars, nlevels, nhists, nign = 0;
+  HISTOGRAM *hists;
+  
+  assert( hset  != NULL );
+  assert( field != NULL );
+  assert( array != NULL );
+  
+  nvars = hset->nvars;
+  
+  assert( nvars > 0 );
+  
+  if ( varID < 0 || varID >= nvars )
+    cdoAbort("Illegal argument: varID %d is undefined (%s)", varID, __func__);
+
+  nlevels = hset->nlevels[varID];
+  
+  assert( nlevels > 0);
+  
+  if ( levelID < 0 || levelID >= nlevels )
+    cdoAbort("Illegal argument: levelID %d is undefined (%s)", levelID, __func__);
+    
+  grid = hset->grids[varID];
+  if ( grid != field->grid )
+    cdoAbort("Grids are different", __func__);
+
+  hists  = hset->histograms[varID][levelID];
+  
+  assert( hists != NULL );
+  
+  nhists = gridInqSize(grid);
+  
+  assert( nhists > 0 );
+  
+  if ( field->nmiss )
+    {
+      for ( i = 0; i < nhists; i++ )
+        if ( !DBL_IS_EQUAL(array[i], field->missval) )
+          nign += histAddValue(&hists[i], array[i]);
+    }
+  else
+    {
+      for ( i = 0; i < nhists; i++ )
+        nign += histAddValue(&hists[i], array[i]); 
+    }
+    
+  if ( nign )  
+    cdoWarning("%d out of %d grid values are out of bounds and have been ignored (%s)", nign, nhists, __func__);
+}
+
+
+void hsetGetVarLevelPercentiles(field_t *field, const HISTOGRAM_SET *hset, int varID, int levelID, double p)
+{
+  double *array = field->ptr;
+  int i, nvars, nlevels, nhists, grid;
+  HISTOGRAM *hists;
+  
+  assert( hset  != NULL );
+  assert( field != NULL );
+  assert( array != NULL );
+  
+  nvars = hset->nvars;
+
+  assert( nvars > 0 );
+    
+  if ( varID < 0 || varID >= nvars )
+    cdoAbort("Illegal argument: varID %d is undefined (%s)", varID, __func__);
+
+  nlevels = hset->nlevels[varID];
+
+  assert( nlevels > 0 );
+  
+  if ( levelID < 0 || levelID >= nlevels )
+    cdoAbort("Illegal argument: levelID %d is undefined (%s)", levelID, __func__);
+
+  grid = hset->grids[varID];
+  
+  if ( grid != field->grid )
+    cdoAbort("Grids are different (%s)", __func__);
+
+  hists  = hset->histograms[varID][levelID];
+
+  assert( hists != NULL );
+
+  nhists = gridInqSize(grid);
+
+  assert( nhists > 0 );
+ 
+  field->nmiss = 0;
+  for ( i = 0; i < nhists; i++ )
+    {
+      if ( hists[i].nsamp )
+        {
+          array[i] = histGetPercentile(&hists[i], p);
+        }
+      else
+        {
+          array[i] = field->missval;
+          field->nmiss++;
+        }
+    } 
+}
diff --git a/src/percentiles.h b/src/percentiles.h
new file mode 100644
index 0000000..5f455eb
--- /dev/null
+++ b/src/percentiles.h
@@ -0,0 +1,50 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2006 Brockmann Consult
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef PERCENTILES_H_
+#define PERCENTILES_H_
+
+#include "field.h"
+
+typedef struct {
+  double min;
+  double max;
+  double step;
+  int    nbins;
+  int    nsamp;
+  void  *ptr;
+}
+HISTOGRAM;
+
+typedef struct {
+  int    nvars;
+  int   *nlevels;
+  int   *grids;
+  HISTOGRAM ***histograms;
+}
+HISTOGRAM_SET;
+
+
+HISTOGRAM_SET *hsetCreate(int nvars);
+void hsetCreateVarLevels(HISTOGRAM_SET *hset, int varID, int nlevels, int nhists);
+void hsetDestroy(HISTOGRAM_SET *hset);
+
+void hsetDefVarLevelBounds(HISTOGRAM_SET *hset, int varID, int levelID, const field_t *min, const field_t *max);
+void hsetAddVarLevelValues(HISTOGRAM_SET *histField, int varID, int levelID, const field_t *field);
+void hsetGetVarLevelPercentiles(field_t *field, const HISTOGRAM_SET *hset, int varID, int levelID, double pn); 
+
+#endif /*PERCENTILES_H_*/
diff --git a/src/pipe.c b/src/pipe.c
new file mode 100644
index 0000000..82b57c7
--- /dev/null
+++ b/src/pipe.c
@@ -0,0 +1,616 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <time.h> // time()
+#include "pipe.h"
+#include "pstream_int.h"
+#include <cdi.h>
+#include "cdo.h"
+#include "error.h"
+#include "dmemory.h"
+
+#if  defined  (HAVE_LIBPTHREAD)
+
+static int PipeDebug = 0;
+
+static
+void pipe_init(pipe_t *pipe)
+{
+  pthread_mutexattr_t m_attr;
+  pthread_condattr_t c_attr;
+
+  pthread_mutexattr_init(&m_attr);
+  pthread_condattr_init(&c_attr);
+  /*
+#if defined (_POSIX_THREAD_PROCESS_SHARED)
+  if ( PipeDebug )
+    {
+      Message("setpshared mutexattr to PTHREAD_PROCESS_SHARED");
+      Message("setpshared condattr to PTHREAD_PROCESS_SHARED");
+    }
+
+  pthread_mutexattr_setpshared(&m_attr, PTHREAD_PROCESS_SHARED);
+  pthread_condattr_setpshared(&c_attr, PTHREAD_PROCESS_SHARED);
+
+  if ( PipeDebug )
+    {
+      int pshared;
+      pthread_mutexattr_getpshared(&m_attr, &pshared);
+      if ( pshared == PTHREAD_PROCESS_SHARED )
+	Message("getpshared mutexattr is PTHREAD_PROCESS_SHARED");
+      else if ( pshared == PTHREAD_PROCESS_PRIVATE )
+	Message("getpshared mutexattr is PTHREAD_PROCESS_PRIVATE");
+
+      pthread_condattr_getpshared(&c_attr, &pshared);
+      if ( pshared == PTHREAD_PROCESS_SHARED )
+	Message("getpshared condattr is PTHREAD_PROCESS_SHARED");
+      else if ( pshared == PTHREAD_PROCESS_PRIVATE )
+	Message("getpshared condattr is PTHREAD_PROCESS_PRIVATE");
+    }
+#else
+  if ( PipeDebug )
+    Message("_POSIX_THREAD_PROCESS_SHARED undefined");
+#endif
+  */
+  pipe->EOP     = 0;
+
+  pipe->recIDr  = -1;
+  pipe->recIDw  = -1;
+  pipe->tsIDr   = -1;
+  pipe->tsIDw   = -1;
+
+  pipe->nvals   = 0;
+  pipe->nmiss   = 0;
+  pipe->data    = NULL;
+  pipe->hasdata = 0;
+  pipe->usedata = TRUE;
+  pipe->pstreamptr_in = 0;
+
+  pipe->mutex = (pthread_mutex_t *) malloc(sizeof(pthread_mutex_t));
+  pthread_mutex_init(pipe->mutex, &m_attr);
+
+  pipe->tsDef = (pthread_cond_t *) malloc(sizeof(pthread_cond_t));
+  pthread_cond_init(pipe->tsDef, &c_attr);
+  pipe->tsInq = (pthread_cond_t *) malloc(sizeof(pthread_cond_t));
+  pthread_cond_init(pipe->tsInq, &c_attr);
+
+  pipe->recDef = (pthread_cond_t *) malloc(sizeof(pthread_cond_t));
+  pthread_cond_init(pipe->recDef, &c_attr);
+  pipe->recInq = (pthread_cond_t *) malloc(sizeof(pthread_cond_t));
+  pthread_cond_init(pipe->recInq, &c_attr);
+  
+  pipe->vlistDef = (pthread_cond_t *) malloc(sizeof(pthread_cond_t));
+  pthread_cond_init(pipe->vlistDef, &c_attr);
+  pipe->isclosed = (pthread_cond_t *) malloc(sizeof(pthread_cond_t));
+  pthread_cond_init(pipe->isclosed, &c_attr);
+
+  pipe->writeCond = (pthread_cond_t *) malloc(sizeof(pthread_cond_t));
+  pthread_cond_init(pipe->writeCond, &c_attr);
+
+  pipe->readCond = (pthread_cond_t *) malloc(sizeof(pthread_cond_t));
+  pthread_cond_init(pipe->readCond, &c_attr);
+
+  pthread_mutexattr_destroy(&m_attr);
+  pthread_condattr_destroy(&c_attr);
+}
+
+
+pipe_t *pipeNew()
+{
+  pipe_t *pipe;
+
+  pipe = (pipe_t *) malloc(sizeof(pipe_t));
+
+  pipe_init(pipe);
+
+  return (pipe);
+}
+
+
+void pipeDelete(pipe_t *pipe)
+{
+  if ( pipe )
+    {
+      if ( pipe->mutex )     free(pipe->mutex);
+      if ( pipe->tsDef )     free(pipe->tsDef);
+      if ( pipe->tsInq )     free(pipe->tsInq);
+      if ( pipe->recDef )    free(pipe->recDef);
+      if ( pipe->recInq )    free(pipe->recInq);
+      if ( pipe->vlistDef )  free(pipe->vlistDef);
+      if ( pipe->isclosed )  free(pipe->isclosed);
+      if ( pipe->writeCond ) free(pipe->writeCond);
+      if ( pipe->readCond )  free(pipe->readCond);
+      free(pipe);
+    }
+}
+
+
+void pipeDefVlist(pstream_t *pstreamptr, int vlistID)
+{
+  char *pname = pstreamptr->name;
+  pipe_t *pipe = pstreamptr->pipe;
+
+  if ( PipeDebug ) Message("%s pstreamID %d", pname, pstreamptr->self);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  pstreamptr->vlistID = vlistID;
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK  
+
+  pthread_cond_signal(pipe->vlistDef);
+}
+
+#define TIMEOUT  1 // wait 1 seconds
+#define MIN_WAIT_CYCLES   10
+#define MAX_WAIT_CYCLES 3600
+int processNumsActive(void);
+
+int pipeInqVlist(pstream_t *pstreamptr)
+{
+  char *pname = pstreamptr->name;
+  pipe_t *pipe = pstreamptr->pipe;
+  int vlistID = -1;
+  struct timespec time_to_wait;
+  int retcode = 0;
+  int nwaitcycles = 0;
+
+  time_to_wait.tv_sec  = 0;
+  time_to_wait.tv_nsec = 0;
+
+  if ( PipeDebug ) Message("%s pstreamID %d", pname, pstreamptr->self);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  time_to_wait.tv_sec = time(NULL);
+  while ( pstreamptr->vlistID == -1 && retcode == 0 )
+    {
+      time_to_wait.tv_sec += TIMEOUT;
+      // fprintf(stderr, "tvsec %g\n", (double) time_to_wait.tv_sec);
+      if ( PipeDebug ) Message("%s wait of vlistDef", pname);
+      // pthread_cond_wait(pipe->vlistDef, pipe->mutex);
+      retcode = pthread_cond_timedwait(pipe->vlistDef, pipe->mutex, &time_to_wait);
+      // fprintf(stderr, "self %d retcode %d %d %d\n", pstreamptr->self, retcode, processNumsActive(), pstreamptr->vlistID);
+      if ( retcode != 0 && nwaitcycles++ < MAX_WAIT_CYCLES )
+	{
+	  if ( processNumsActive() > 1 || (processNumsActive() == 1 && nwaitcycles < MIN_WAIT_CYCLES) ) retcode = 0;
+	}
+    }
+
+  if ( retcode == 0 )
+    vlistID = pstreamptr->vlistID;
+  else if ( PipeDebug ) 
+    Message("%s timeout!", pname);
+
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+
+  return (vlistID);
+}
+
+
+int pipeInqTimestep(pstream_t *pstreamptr, int tsID)
+{
+  char *pname = pstreamptr->name;
+  pipe_t *pipe = pstreamptr->pipe;
+  int nrecs;
+
+  if ( PipeDebug ) Message("%s pstreamID %d", pname, pstreamptr->self);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  pipe->usedata = FALSE;
+  pipe->recIDr  = -1;
+  if ( tsID != pipe->tsIDr+1 )
+    {
+      if ( ! (tsID == pipe->tsIDr && pipe->tsIDr == pipe->tsIDw && pipe->recIDr == -1) ) 
+	Error("%s unexpected tsID %d %d %d", pname, tsID, pipe->tsIDr+1, pipe->tsIDw);
+    }
+  
+  pipe->tsIDr = tsID;
+  while ( pipe->tsIDw != tsID )
+    {
+      if ( pipe->EOP )
+	{
+	  if ( PipeDebug ) Message("%s EOP", pname);
+	  break;
+	}
+      if ( pipe->hasdata )
+	{
+	  if ( PipeDebug ) Message("%s has data", pname);
+	  pipe->hasdata = 0;
+	  pipe->data = NULL;
+	  pthread_cond_signal(pipe->readCond);
+	}
+      else
+	if ( PipeDebug ) Message("%s has no data", pname);
+
+      pthread_cond_signal(pipe->recInq); /* o.k. ??? */
+
+      if ( PipeDebug ) Message("%s wait of tsDef", pname);
+      pthread_cond_wait(pipe->tsDef, pipe->mutex);
+    }
+
+  if ( pipe->EOP )
+    nrecs = 0;
+  else
+    nrecs = pipe->nrecs;
+
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+
+  pthread_cond_signal(pipe->tsInq);
+
+  return (nrecs);
+}
+
+
+void pipeDefTimestep(pstream_t *pstreamptr, int tsID)
+{
+  char *pname = pstreamptr->name;
+  pipe_t *pipe = pstreamptr->pipe;
+  int nrecs;
+
+  if ( PipeDebug ) Message("%s pstreamID %d", pname, pstreamptr->self);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  pipe->recIDw = -1;
+  pipe->tsIDw++;
+  if ( tsID != pipe->tsIDw )
+    Error("unexpected tsID %d(%d) for %s", tsID, pipe->tsIDw, pname);
+
+  if ( tsID == 0 )
+    nrecs = vlistNrecs(pstreamptr->vlistID);
+  else
+    {
+      int vlistID, varID;
+      vlistID = pstreamptr->vlistID;
+      nrecs = 0;
+      for ( varID = 0; varID < vlistNvars(vlistID); varID++ )
+	if ( vlistInqVarTsteptype(vlistID, varID) != TSTEP_CONSTANT )
+	  nrecs += zaxisInqSize(vlistInqVarZaxis(vlistID, varID));
+      // Message("nrecs = %d nvars = %d", nrecs, vlistNvars(vlistID));
+    }
+
+  pipe->nrecs = nrecs;
+  if ( PipeDebug ) Message("%s nrecs %d tsID %d %d %d", pname, nrecs, tsID, pipe->tsIDw, pipe->tsIDr);
+  if ( nrecs == 0 ) pipe->EOP = TRUE;
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+
+  pthread_cond_signal(pipe->tsDef);
+  //sleep(1);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  while ( pipe->tsIDr < tsID )
+    {
+      if ( pipe->EOP )
+	{
+	  if ( PipeDebug ) Message("EOP");
+	  break;
+	}
+      if ( PipeDebug ) Message("%s wait of tsInq (tsID %d %d)", pname, tsID, pipe->tsIDr);
+      pthread_cond_wait(pipe->tsInq, pipe->mutex);
+    }
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+}
+
+
+int pipeInqRecord(pstream_t *pstreamptr, int *varID, int *levelID)
+{
+  char *pname = pstreamptr->name;
+  pipe_t *pipe = pstreamptr->pipe;
+  int condSignal = FALSE;
+
+  if ( PipeDebug ) Message("%s pstreamID %d", pname, pstreamptr->self);
+ 
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  if ( PipeDebug ) Message("%s has no data %d %d", pname, pipe->recIDr, pipe->recIDw);
+  if ( pipe->hasdata || pipe->usedata )
+    {
+      pipe->hasdata = 0;
+      pipe->data = NULL;
+      pipe->usedata = FALSE;
+      condSignal = TRUE;
+    }	  
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+
+  if ( condSignal ) pthread_cond_signal(pipe->readCond);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  pipe->usedata = TRUE;
+  pipe->recIDr++;
+  
+  if ( PipeDebug ) Message("%s recID %d %d", pname, pipe->recIDr, pipe->recIDw);  
+
+  while ( pipe->recIDw != pipe->recIDr )
+    {
+      if ( pipe->EOP )
+	{
+	  if ( PipeDebug ) Message("EOP");
+	  break;
+	}
+      if ( PipeDebug ) Message("%s wait of recDef", pname);
+      pthread_cond_wait(pipe->recDef, pipe->mutex);
+    }
+
+  if ( pipe->EOP )
+    {
+      *varID   = -1;
+      *levelID = -1;
+    }
+  else
+    {
+      *varID   = pipe->varID;
+      *levelID = pipe->levelID;
+    }
+
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+
+  pthread_cond_signal(pipe->recInq);
+
+  return (0);
+}
+
+
+void pipeDefRecord(pstream_t *pstreamptr, int varID, int levelID)
+{
+  char *pname = pstreamptr->name;
+  pipe_t *pipe = pstreamptr->pipe;
+  int condSignal = FALSE;
+
+  if ( PipeDebug ) Message("%s pstreamID %d", pname, pstreamptr->self);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  if ( PipeDebug ) Message("%s has data %d %d", pname, pipe->recIDr, pipe->recIDw);
+  if ( pipe->hasdata )
+    {
+      pipe->hasdata = 0;
+      pipe->data = NULL;
+      condSignal = TRUE;
+    }
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+
+  if ( condSignal ) pthread_cond_signal(pipe->readCond);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  pipe->usedata = TRUE;
+  pipe->recIDw++;
+  pipe->varID   = varID;
+  pipe->levelID = levelID;
+  if ( PipeDebug ) Message("%s recID %d %d", pname, pipe->recIDr, pipe->recIDw);  
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+
+  pthread_cond_signal(pipe->recDef);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  while ( pipe->recIDr < pipe->recIDw )
+    {
+      if ( pipe->tsIDw != pipe->tsIDr ) break;
+      if ( pipe->EOP ) break;
+      if ( PipeDebug ) Message("%s wait of recInq %d", pname, pipe->recIDr);
+      pthread_cond_wait(pipe->recInq, pipe->mutex);
+    }
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+}
+
+
+void pipeCopyRecord(pstream_t *pstreamptr_out, pstream_t *pstreamptr_in)
+{
+  char *ipname = pstreamptr_in->name;
+  char *opname = pstreamptr_out->name;
+  pipe_t *pipe = pstreamptr_out->pipe;
+
+  if ( PipeDebug ) Message("%s pstreamIDin %d", ipname, pstreamptr_in->self);
+  if ( PipeDebug ) Message("%s pstreamIDout %d", opname, pstreamptr_out->self);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  pipe->hasdata = 2; /* pipe */
+  pipe->pstreamptr_in = pstreamptr_in;
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+
+  pthread_cond_signal(pipe->writeCond);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  while ( pipe->hasdata )
+    {
+      if ( pipe->usedata == FALSE ) break;
+
+      if ( pipe->recIDw != pipe->recIDr ) break;
+
+      if ( pipe->EOP )
+	{
+	  if ( PipeDebug ) Message("EOP");
+	  break;
+	}
+      if ( PipeDebug ) Message("%s wait of readCond", opname);
+      pthread_cond_wait(pipe->readCond, pipe->mutex);
+    }
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+}
+
+
+void pipeReadRecord(pstream_t *pstreamptr, double *data, int *nmiss)
+{
+  char *pname = pstreamptr->name;
+  pipe_t *pipe = pstreamptr->pipe;
+
+  *nmiss = 0;
+  if ( PipeDebug ) Message("%s pstreamID %d", pname, pstreamptr->self);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  while ( pipe->hasdata == 0 )
+    {
+      if ( PipeDebug ) Message("%s wait of writeCond", pname);
+      pthread_cond_wait(pipe->writeCond, pipe->mutex);
+    }
+
+  if ( pipe->hasdata == 2 )
+    {
+      pstream_t *pstreamptr_in;
+
+      pstreamptr_in = pipe->pstreamptr_in;
+      /*
+      if ( pstreamptr_in->ispipe )
+	{
+	  pstreamptr_in = pstreamptr_in->pipe->pstreamptr_in;
+	  if ( pstreamptr_in->ispipe )
+	    Error("istream is pipe");
+	}
+      */
+      pstreamptr = pstreamptr_in;
+      while ( pstreamptr_in->ispipe )
+	{
+	  if ( PipeDebug ) fprintf(stderr, "%s: istream %d is pipe\n", __func__, pstreamptr_in->self);
+	  pstreamptr    = pstreamptr_in;
+	  pstreamptr_in = pstreamptr_in->pipe->pstreamptr_in;
+	  if ( pstreamptr_in == 0 ) break;
+	}
+
+      if ( pstreamptr_in == 0 )
+	{
+	  if ( PipeDebug ) fprintf(stderr, "pstreamID = %d\n", pstreamptr->self);
+	  if ( pstreamptr->pipe->hasdata == 1 )
+	    {
+	      int vlistID, datasize;
+
+	      if ( ! pstreamptr->pipe->data )
+		Error("No data pointer for %s", pname);
+
+	      vlistID = pstreamptr->vlistID;
+	      datasize = gridInqSize(vlistInqVarGrid(vlistID, pstreamptr->pipe->varID));
+	      if ( vlistNumber(vlistID) != CDI_REAL ) datasize *= 2;
+	      memcpy(data, pstreamptr->pipe->data, datasize*sizeof(double));
+	      *nmiss = pstreamptr->pipe->nmiss;
+	    }
+	  else
+	    Error("Internal problem! istream undefined");
+	}
+      else
+	{
+	  if ( PipeDebug ) fprintf(stderr, "%s: istream %d is file\n", __func__, pstreamptr_in->self);
+	  streamReadRecord(pstreamptr_in->fileID, data, nmiss);
+	}
+    }
+  else if ( pipe->hasdata == 1 )
+    {
+      int vlistID, datasize;
+
+      if ( ! pipe->data )
+	Error("No data pointer for %s", pname);
+
+      vlistID = pstreamptr->vlistID;
+      datasize = gridInqSize(vlistInqVarGrid(vlistID, pipe->varID));
+      pipe->nvals += datasize;
+      if ( vlistNumber(vlistID) != CDI_REAL ) datasize *= 2;
+      memcpy(data, pipe->data, datasize*sizeof(double));
+      *nmiss = pipe->nmiss;
+    }
+  else
+    {
+      Error("data type %d not implemented", pipe->hasdata);
+    }
+
+  if ( PipeDebug ) Message("%s read record %d", pname, pipe->recIDr);
+ 
+
+  pipe->hasdata = 0;
+  pipe->data = NULL;
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+
+  pthread_cond_signal(pipe->readCond);
+}
+
+
+void pipeWriteRecord(pstream_t *pstreamptr, double *data, int nmiss)
+{
+  char *pname = pstreamptr->name;
+  pipe_t *pipe = pstreamptr->pipe;
+
+  if ( PipeDebug ) Message("%s pstreamID %d", pname, pstreamptr->self);
+
+  /*
+  if ( ! pipe->usedata ) return;
+  */
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  pipe->hasdata = 1; /* data pointer */
+  pipe->data    = data;
+  pipe->nmiss   = nmiss;
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+
+  pthread_cond_signal(pipe->writeCond);
+
+  if ( PipeDebug ) Message("%s write record %d", pname, pipe->recIDw);
+
+  // LOCK
+  pthread_mutex_lock(pipe->mutex);
+  while ( pipe->hasdata )
+    {
+      if ( pipe->usedata == FALSE ) break;
+      /*     
+      printf("ts ids %d %d\n", pipe->tsIDw, pipe->tsIDr);
+      printf("rec ids %d %d\n", pipe->recIDw, pipe->recIDr);
+      */
+      if ( pipe->recIDw != pipe->recIDr ) break;
+
+      if ( pipe->EOP )
+	{
+	  if ( PipeDebug ) Message("EOP");
+	  break;
+	}
+      if ( PipeDebug ) Message("%s wait of readCond", pname);
+      pthread_cond_wait(pipe->readCond, pipe->mutex);
+    }
+  pthread_mutex_unlock(pipe->mutex);
+  // UNLOCK
+}
+
+
+void pipeDebug(int debug)
+{
+  PipeDebug = debug;
+}
+
+#endif
diff --git a/src/pipe.h b/src/pipe.h
new file mode 100644
index 0000000..ed460ca
--- /dev/null
+++ b/src/pipe.h
@@ -0,0 +1,107 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _PIPE_H
+#define _PIPE_H
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <sys/types.h>
+
+#if  defined  (HAVE_LIBPTHREAD)
+
+#include <pthread.h>
+#include "pthread_debug.h"
+
+#endif
+
+typedef struct {
+  short       check_datarange;
+  int         gridsize;
+  int         datatype;
+  double      missval;
+  double      addoffset;
+  double      scalefactor;
+} varlist_t;
+
+
+typedef struct {
+  int            self;
+  int            mode;
+  int            fileID;
+  int            vlistID;
+  int            tsID;
+  int            filetype;
+  int            ispipe;
+  int            isopen;
+  int            tsID0;
+  int            mfiles;
+  int            nfiles;
+  int            varID;           /* next varID defined with streamDefVar */
+  char          *name;
+  char         **mfnames;
+  varlist_t     *varlist;
+#if  defined  (HAVE_LIBPTHREAD)
+  struct pipe_s *pipe;
+  pthread_t     rthreadID; /* read  thread ID */
+  pthread_t     wthreadID; /* write thread ID */
+#endif
+} pstream_t;
+
+
+#if  defined  (HAVE_LIBPTHREAD)
+
+struct pipe_s {
+  int     nrecs, EOP;
+  int     varID, levelID;
+  int     recIDr, recIDw, tsIDr, tsIDw;
+  int     hasdata, usedata;
+  int     nmiss;
+  double *data;
+  pstream_t *pstreamptr_in;
+  /* unsigned long */ off_t nvals;
+  pthread_mutex_t *mutex;
+  pthread_cond_t *tsDef, *tsInq, *vlistDef, *isclosed;
+  pthread_cond_t *recDef, *recInq;
+  pthread_cond_t *writeCond, *readCond;
+};
+
+typedef struct pipe_s pipe_t;
+
+pipe_t *pipeNew(void);
+void    pipeDelete(pipe_t *pipe);
+
+void  pipeDebug(int debug);
+
+void  pipeDefVlist(pstream_t *pstreamptr, int vlistID);
+int   pipeInqVlist(pstream_t *pstreamptr);
+
+void  pipeDefTimestep(pstream_t *pstreamptr, int tsID);
+int   pipeInqTimestep(pstream_t *pstreamptr, int tsID);
+
+void  pipeDefRecord(pstream_t *pstreamptr, int  varID, int  levelID);
+int   pipeInqRecord(pstream_t *pstreamptr, int *varID, int *levelID);
+
+void  pipeReadRecord(pstream_t *pstreamptr, double *data, int *nmiss);
+void  pipeWriteRecord(pstream_t *pstreamptr, double *data, int nmiss);
+void  pipeCopyRecord(pstream_t *pstreamptr_dest, pstream_t *pstreamptr_src);
+
+#endif
+
+#endif  /* _PIPE_H */
diff --git a/src/printinfo.h b/src/printinfo.h
new file mode 100644
index 0000000..cb1bd9a
--- /dev/null
+++ b/src/printinfo.h
@@ -0,0 +1,383 @@
+#define DATE_FORMAT "%5.4d-%2.2d-%2.2d"
+#define TIME_FORMAT "%2.2d:%2.2d:%2.2d"
+
+void date2str(int date, char *datestr, int maxlen)
+{
+  int year, month, day;
+  int len;
+
+  cdiDecodeDate(date, &year, &month, &day);
+
+  len = sprintf(datestr, DATE_FORMAT, year, month, day);
+
+  if ( len > ( maxlen-1) )
+    fprintf(stderr, "Internal problem (%s): sizeof input string is too small!\n", __func__);
+}
+
+
+void time2str(int time, char *timestr, int maxlen)
+{
+  int hour, minute, second;
+  int len;
+
+  cdiDecodeTime(time, &hour, &minute, &second);
+
+  len = sprintf(timestr, TIME_FORMAT, hour, minute, second);
+
+  if ( len > ( maxlen-1) )
+    fprintf(stderr, "Internal problem (%s): sizeof input string is too small!\n", __func__);
+}
+
+
+void printFiletype(int streamID, int vlistID)
+{
+  int filetype;
+
+  filetype = streamInqFiletype(streamID);
+
+  switch ( filetype )
+    {
+    case FILETYPE_GRB:
+      printf("GRIB");
+      break;
+    case FILETYPE_GRB2:
+      printf("GRIB2");
+      break;
+    case FILETYPE_NC:
+      printf("netCDF");
+      break;
+    case FILETYPE_NC2:
+      printf("netCDF2");
+      break;
+    case FILETYPE_NC4:
+      printf("netCDF4");
+      break;
+    case FILETYPE_NC4C:
+      printf("netCDF4 classic");
+      break;
+    case FILETYPE_SRV:
+      printf("SERVICE");
+      break;
+    case FILETYPE_EXT:
+      printf("EXTRA");
+      break;
+    case FILETYPE_IEG:
+      printf("IEG");
+      break;
+    default:
+      printf("  File format: unsupported filetype %d" , filetype);
+    }
+
+  if ( filetype == FILETYPE_SRV || filetype == FILETYPE_EXT || filetype == FILETYPE_IEG )
+    {
+      switch ( streamInqByteorder(streamID) )
+	{
+	case CDI_BIGENDIAN:
+	  printf("  BIGENDIAN"); break;
+	case CDI_LITTLEENDIAN:
+	  printf("  LITTLEENDIAN"); break;
+	default:
+	  printf("  byteorder: %d undefined", streamInqByteorder(streamID)); break;
+	}
+    }
+
+  if ( filetype == FILETYPE_GRB || filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C )
+    {
+      int nvars, varID;
+      int comptype;
+
+      nvars = vlistNvars(vlistID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  comptype = vlistInqVarCompType(vlistID, varID);
+	  if ( comptype )
+	    {
+	      if ( comptype == COMPRESS_SZIP )
+		printf(" SZIP");
+	      else if ( comptype == COMPRESS_ZIP )
+		printf(" ZIP");
+
+	      break;
+	    }
+	}
+    }
+
+  if ( filetype == FILETYPE_GRB2 )
+    {
+      int nvars, varID;
+      int comptype;
+
+      nvars = vlistNvars(vlistID);
+
+      for ( varID = 0; varID < nvars; varID++ )
+	{
+	  comptype = vlistInqVarCompType(vlistID, varID);
+	  if ( comptype )
+	    {
+	      if ( comptype == COMPRESS_JPEG )
+		printf(" JPEG");
+
+	      break;
+	    }
+	}
+    }
+
+  printf("\n");
+}
+
+static
+void printGridInfo(int vlistID)
+{
+  int ngrids, index;
+  int gridID, gridtype, trunc, gridsize, xsize, ysize;
+  int nbyte0;
+  char xname[CDI_MAX_NAME], yname[CDI_MAX_NAME], xunits[CDI_MAX_NAME], yunits[CDI_MAX_NAME];
+
+  ngrids = vlistNgrids(vlistID);
+  for ( index = 0; index < ngrids; index++ )
+    {
+      gridID   = vlistGrid(vlistID, index);
+      gridtype = gridInqType(gridID);
+      trunc    = gridInqTrunc(gridID);
+      gridsize = gridInqSize(gridID);
+      xsize    = gridInqXsize(gridID);
+      ysize    = gridInqYsize(gridID);
+      gridInqXname(gridID, xname);
+      gridInqYname(gridID, yname);
+      gridInqXunits(gridID, xunits);
+      gridInqYunits(gridID, yunits);
+
+      nbyte0   = fprintf(stdout, "  %4d : %-12s > ", index+1, gridNamePtr(gridtype));
+
+      if ( gridtype == GRID_LONLAT   ||
+	   gridtype == GRID_LCC2 ||
+	   gridtype == GRID_LAEA ||
+	   gridtype == GRID_SINUSOIDAL ||
+	   gridtype == GRID_GAUSSIAN ||
+	   gridtype == GRID_GAUSSIAN_REDUCED )
+	{
+	  double xfirst = 0.0, xlast = 0.0;
+	  double yfirst = 0.0, ylast = 0.0;
+	  double xinc = 0.0, yinc = 0.0;
+
+	  yfirst = gridInqYval(gridID, 0);
+	  ylast  = gridInqYval(gridID, ysize-1);
+	  yinc   = gridInqYinc(gridID);
+
+	  if ( gridtype == GRID_GAUSSIAN_REDUCED )
+	    fprintf(stdout, "size : dim = %d  nlat = %d", gridsize, ysize);
+	  else
+	    fprintf(stdout, "size      : dim = %d  nlon = %d  nlat = %d", gridsize, xsize, ysize);
+	  
+	  if ( gridtype == GRID_GAUSSIAN || gridtype == GRID_GAUSSIAN_REDUCED )
+	    fprintf(stdout, "  np = %d", gridInqNP(gridID));
+
+	  fprintf(stdout, "\n");
+
+	  if ( xsize > 0 )
+	    {
+	      if ( gridtype == GRID_GAUSSIAN_REDUCED )
+		{
+		  fprintf(stdout, "size : dim = %d  nlat = %d\n", gridsize, ysize);
+		  fprintf(stdout, "%*s", nbyte0, "");
+		  fprintf(stdout, "longitude : reduced\n");
+		}
+	      else
+		{
+		  xfirst = gridInqXval(gridID, 0);
+		  xlast  = gridInqXval(gridID, xsize-1);
+		  xinc   = gridInqXinc(gridID);
+		  fprintf(stdout, "%*s", nbyte0, "");
+		  fprintf(stdout, "%-9s : first = %.9g", xname, xfirst);
+		  if ( xsize > 1 ) fprintf(stdout, "  last = %.9g", xlast);
+		  if ( IS_NOT_EQUAL(xinc, 0) )
+		    fprintf(stdout, "  inc = %.9g", xinc);
+		  fprintf(stdout, "  %s", xunits);
+		  if ( gridIsCircular(gridID) )
+		    fprintf(stdout, "  circular");
+		  fprintf(stdout, "\n");
+		}
+	    }
+
+	  if ( ysize > 0 )
+	    {
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "%-9s : first = %.9g", yname, yfirst);
+	      if ( ysize > 1 ) fprintf(stdout, "  last = %.9g", ylast);
+	      if ( IS_NOT_EQUAL(yinc, 0) && 
+		   (gridtype == GRID_LONLAT || gridtype == GRID_SINUSOIDAL || 
+		    gridtype == GRID_LCC2 || gridtype == GRID_LAEA) )
+		fprintf(stdout, "  inc = %.9g", yinc);
+	      fprintf(stdout, "  %s", yunits);
+	      fprintf(stdout, "\n");
+	    }
+
+	  if ( gridIsRotated(gridID) )
+	    {
+	      double lonpole, latpole, angle;
+	      lonpole = gridInqXpole(gridID);
+	      latpole = gridInqYpole(gridID);
+	      angle   = gridInqAngle(gridID);
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "northpole : lon = %.9g  lat = %.9g", lonpole, latpole);
+	      if ( angle > 0 ) fprintf(stdout, "  angle = %.9g", angle);
+	      fprintf(stdout, "\n");
+	    }
+
+	  if ( gridInqXbounds(gridID, NULL) || gridInqYbounds(gridID, NULL) )
+	    {
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "available :");
+	      if ( gridInqXbounds(gridID, NULL) ) fprintf(stdout, " xbounds");
+	      if ( gridInqYbounds(gridID, NULL) ) fprintf(stdout, " ybounds");
+	      if ( gridInqMask(gridID, NULL) )    fprintf(stdout, " mask");
+	      fprintf(stdout, "\n");
+	    }
+
+	  if ( gridtype == GRID_LAEA )
+	    {
+	      double a, lon_0, lat_0;
+	      gridInqLaea(gridID, &a, &lon_0, &lat_0);
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "projpar   : a = %g  lon_0 = %g  lat_0 = %g\n", a, lon_0, lat_0);
+	    }
+
+	  if ( gridtype == GRID_LCC2 )
+	    {
+	      double a, lon_0, lat_0, lat_1, lat_2;
+	      gridInqLcc2(gridID, &a, &lon_0, &lat_0, &lat_1, &lat_2);
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "projpar   : a = %7.0f  lon_0 = %g  lat_0 = %g  lat_1 = %g  lat_2 = %g\n",
+		      a, lon_0, lat_0, lat_1, lat_2);
+	    }
+	}
+      else if ( gridtype == GRID_SPECTRAL )
+	{
+	  fprintf(stdout, "size      : dim = %d  nsp = %d  truncation = %d\n", gridsize, gridsize/2, trunc);
+	  fprintf(stdout, "%*s", nbyte0, "");
+	  fprintf(stdout, "            complexPacking = %d\n", gridInqComplexPacking(gridID));
+	}
+      else if ( gridtype == GRID_FOURIER )
+	{
+	  fprintf(stdout, "size      : dim = %d  nfc = %d  truncation = %d\n", gridsize, gridsize/2, trunc);
+	}
+      else if ( gridtype == GRID_GME )
+	{
+	  int ni, nd;
+	  ni = gridInqGMEni(gridID);
+	  nd = gridInqGMEnd(gridID);
+	  fprintf(stdout, "size      : dim = %d  nd = %d  ni = %d\n", gridsize, nd, ni);
+	}
+      else if ( gridtype == GRID_REFERENCE )
+	{
+	  int number, position;
+	  number   = gridInqNumber(gridID);
+	  position = gridInqPosition(gridID);
+	  fprintf(stdout, "size      : dim = %d\n", gridsize);
+	  fprintf(stdout, "%*s", nbyte0, "");
+	  fprintf(stdout, "grid      : number = %d  position = %d\n", number, position);
+	  if ( gridInqReference(gridID, NULL) )
+	    {
+	      char reference_link[8192];
+	      gridInqReference(gridID, reference_link);
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "path      : %s\n", reference_link);
+	    }
+	}
+      else if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED )
+	{
+	  if ( gridtype == GRID_CURVILINEAR )
+	    fprintf(stdout, "size      : dim = %d  nx = %d  ny = %d\n", gridsize, xsize, ysize);
+	  else
+	    fprintf(stdout, "size      : dim = %d  nvertex = %d\n", gridsize, gridInqNvertex(gridID));
+
+	  if ( gridInqXvals(gridID, NULL) && gridInqYvals(gridID, NULL) )
+	    {
+	      int i;
+	      double *xvals, *yvals;
+	      double xfirst, xlast, yfirst, ylast;
+	      xvals = (double *) malloc(gridsize*sizeof(double));
+	      yvals = (double *) malloc(gridsize*sizeof(double));
+
+	      gridInqXvals(gridID, xvals);
+	      gridInqYvals(gridID, yvals);
+
+	      xfirst = xvals[0];
+	      xlast  = xvals[0];
+	      yfirst = yvals[0];
+	      ylast  = yvals[0];
+	      for ( i = 1; i < gridsize; i++ )
+		{
+		  if ( xvals[i] < xfirst ) xfirst = xvals[i];
+		  if ( xvals[i] > xlast )  xlast  = xvals[i];
+		  if ( yvals[i] < yfirst ) yfirst = yvals[i];
+		  if ( yvals[i] > ylast )  ylast  = yvals[i];
+		}
+
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "%-9s : min = %.9g  max = %.9g  %s", xname, xfirst, xlast, xunits);
+	      if ( gridIsCircular(gridID) )
+		fprintf(stdout, "  circular");
+	      fprintf(stdout, "\n");
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "%-9s : min = %.9g  max = %.9g  %s\n", yname, yfirst, ylast, yunits);
+ 
+	      free(xvals);
+	      free(yvals);
+	    }
+	}
+      else if ( gridtype == GRID_LCC )
+	{
+	  double originLon, originLat, lonParY, lat1, lat2, xincm, yincm;
+	  int projflag, scanflag;
+
+	  gridInqLCC(gridID, &originLon, &originLat, &lonParY, &lat1, &lat2, &xincm, &yincm,
+		     &projflag, &scanflag);
+
+	  fprintf(stdout, "size      : dim = %d  nx = %d  ny = %d  ", gridsize, xsize, ysize);
+	  if ( (projflag&128) == 0 )
+	    fprintf(stdout, "North Pole\n");
+	  else
+	    fprintf(stdout, "South Pole\n");
+	  fprintf(stdout, "%*s", nbyte0, "");
+	  fprintf(stdout, "            originLon = %g  originLat = %g  lonParY = %g\n",
+		  originLon, originLat, lonParY);
+	  fprintf(stdout, "%*s", nbyte0, "");
+	  fprintf(stdout, "            lat1 = %g  lat2 = %g  xinc = %g m  yinc = %g m\n",
+		  lat1, lat2, xincm, yincm);
+	}
+      else /* if ( gridtype == GRID_GENERIC ) */
+	{
+	  if ( ysize == 0 )
+	    fprintf(stdout, "size      : dim = %d\n", gridsize);
+	  else
+	    {
+	      fprintf(stdout, "size      : dim = %d  nx = %d  ny = %d\n", gridsize, xsize, ysize);
+	      if ( gridIsCircular(gridID) )
+		{
+		  fprintf(stdout, "%*s", nbyte0, "");
+		  fprintf(stdout, "longitude :  circular\n");
+		}
+	    }
+	}
+
+      if ( gridtype == GRID_CURVILINEAR || gridtype == GRID_UNSTRUCTURED ||
+	   gridtype == GRID_GENERIC || gridtype == GRID_LCC )
+	{
+	  if ( gridInqXvals(gridID, NULL) || gridInqYvals(gridID, NULL) || gridHasArea(gridID) ||
+	       gridInqXbounds(gridID, NULL) || gridInqYbounds(gridID, NULL) )
+	    {
+	      fprintf(stdout, "%*s", nbyte0, "");
+	      fprintf(stdout, "available :");
+	      if ( gridInqXvals(gridID, NULL) )   fprintf(stdout, " xvals");
+	      if ( gridInqYvals(gridID, NULL) )   fprintf(stdout, " yvals");
+	      if ( gridInqXbounds(gridID, NULL) ) fprintf(stdout, " xbounds");
+	      if ( gridInqYbounds(gridID, NULL) ) fprintf(stdout, " ybounds");
+	      if ( gridHasArea(gridID) )          fprintf(stdout, " area");
+	      if ( gridInqMask(gridID, NULL) )    fprintf(stdout, " mask");
+	      fprintf(stdout, "\n");
+	    }
+	}
+    }
+}
diff --git a/src/process.c b/src/process.c
new file mode 100644
index 0000000..9eb2da0
--- /dev/null
+++ b/src/process.c
@@ -0,0 +1,1005 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if  defined  (HAVE_PTHREAD_H)
+#  include <pthread.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <glob.h>
+
+#include "cdo.h"
+#include "cdo_int.h"
+#include "error.h"
+#include "modules.h"
+#include "util.h"
+#include "pstream_int.h"
+#include "dmemory.h"
+
+
+#define  MAX_PROCESS    128
+#define  MAX_STREAM      64
+#define  MAX_OPERATOR   128
+#define  MAX_OARGC     4096
+#define  MAX_FILES    65536
+
+
+typedef struct {
+  int         f1;
+  int         f2;
+  const char *name;
+  const char *enter;
+}
+operator_t;
+
+typedef struct {
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_t threadID;
+  int       l_threadID;
+#endif
+  short      nchild;
+  short      nstream;
+  short      streams[MAX_STREAM];
+  double     s_utime;
+  double     s_stime;
+  double     a_utime;
+  double     a_stime;
+  double     cputime;
+
+  off_t      nvals;
+  short      nvars;
+  int        ntimesteps;
+  short      streamCnt;
+  char     **streamNames;
+  char      *xoperator;
+  char      *operatorName;
+  char      *operatorArg;
+  int        oargc;
+  char      *oargv[MAX_OARGC];
+  char       prompt[64];
+  short      noper;
+  operator_t operator[MAX_OPERATOR];
+}
+process_t;
+
+
+static process_t Process[MAX_PROCESS];
+
+static int NumProcess = 0;
+static int NumProcessActive = 0;
+
+#if  defined  (HAVE_LIBPTHREAD)
+pthread_mutex_t processMutex = PTHREAD_MUTEX_INITIALIZER;
+#endif
+
+
+int processCreate(void)
+{
+  int processID;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_mutex_lock(&processMutex);
+#endif
+
+  processID = NumProcess++;
+  NumProcessActive++;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_mutex_unlock(&processMutex);  
+#endif
+
+  if ( processID >= MAX_PROCESS )
+    Error("Limit of %d processes reached!", MAX_PROCESS);
+
+#if  defined  (HAVE_LIBPTHREAD)
+  Process[processID].threadID     = pthread_self();
+  Process[processID].l_threadID   = 1;
+#endif
+  Process[processID].nstream      = 0;
+  Process[processID].nchild       = 0;
+
+  cdoProcessTime(&Process[processID].s_utime, &Process[processID].s_stime);
+  Process[processID].a_utime      = 0;
+  Process[processID].a_stime      = 0;
+  Process[processID].cputime      = 0;
+
+  Process[processID].oargc        = 0;
+  Process[processID].xoperator    = NULL;
+  Process[processID].operatorName = NULL;
+  Process[processID].operatorArg  = NULL;
+
+  Process[processID].noper        = 0;
+
+  return (processID);
+}
+
+
+int processSelf(void)
+{
+  int processID = 0;
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_t thID = pthread_self();
+
+  pthread_mutex_lock(&processMutex);
+
+  for ( processID = 0; processID < NumProcess; processID++ )
+    if ( Process[processID].l_threadID )
+      if ( pthread_equal(Process[processID].threadID, thID) ) break;
+
+  if ( processID == NumProcess )
+    {
+      if ( NumProcess > 0 )
+	Error("Internal problem, process not found!");
+      else
+	processID = 0;
+    }
+
+  pthread_mutex_unlock(&processMutex);  
+
+#endif
+
+  return (processID);
+}
+
+
+int processNums(void)
+{
+  int pnums = 0;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_mutex_lock(&processMutex);
+#endif
+
+  pnums = NumProcess;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_mutex_unlock(&processMutex);  
+#endif
+
+  return (pnums);
+}
+
+
+int processNumsActive(void)
+{
+  int pnums = 0;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_mutex_lock(&processMutex);
+#endif
+
+  pnums = NumProcessActive;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_mutex_unlock(&processMutex);  
+#endif
+
+  return (pnums);
+}
+
+
+void processAddNvals(off_t nvals)
+{
+  int processID = processSelf();
+
+  Process[processID].nvals += nvals;
+}
+
+
+off_t processInqNvals(int processID)
+{
+  off_t nvals = 0;
+
+  nvals = Process[processID].nvals;
+
+  return (nvals);
+}
+
+
+void processAddStream(int streamID)
+{
+  int processID = processSelf();
+  int sindex;
+
+  if ( pstreamIsPipe(streamID) ) Process[processID].nchild++;
+
+  sindex = Process[processID].nstream++;
+
+  if ( sindex >= MAX_STREAM )
+    Error("limit of %d streams per process reached!", MAX_STREAM);
+
+  Process[processID].streams[sindex] = streamID;
+}
+
+
+void processDefCputime(int processID, double cputime)
+{
+  Process[processID].cputime = cputime;
+}
+
+
+double processInqCputime(int processID)
+{
+  return (Process[processID].cputime);
+}
+
+
+void processStartTime(double *utime, double *stime)
+{
+  int processID = processSelf();
+
+  *utime = Process[processID].s_utime;
+  *stime = Process[processID].s_stime;
+}
+
+
+void processEndTime(double *utime, double *stime)
+{
+  *utime = Process[0].a_utime;
+  *stime = Process[0].a_stime;
+}
+
+
+void processAccuTime(double utime, double stime)
+{
+  Process[0].a_utime += utime;
+  Process[0].a_stime += stime;
+}
+
+
+int processInqStreamNum(void)
+{
+  int processID = processSelf();
+
+  return (Process[processID].nstream);
+}
+
+
+int processInqChildNum(void)
+{
+  int processID = processSelf();
+
+  return (Process[processID].nchild);
+}
+
+
+int processInqStreamID(int streamindex)
+{
+  int processID = processSelf();
+
+  return (Process[processID].streams[streamindex]);
+}
+
+
+const char *processInqOpername2(int processID)
+{
+  return (Process[processID].operatorName);
+}
+
+
+const char *processInqOpername(void)
+{
+  int processID = processSelf();
+
+  return (Process[processID].operatorName);
+}
+
+
+void processDefPrompt(char *opername)
+{
+  int processID = processSelf();
+  extern char *Progname;
+
+  if ( processID == 0 )
+    sprintf(Process[processID].prompt, "%s %s", Progname, opername);
+  else
+    sprintf(Process[processID].prompt, "%s(%d) %s", Progname, processID+1, opername);
+}
+
+
+const char *processInqPrompt(void)
+{
+  int processID = processSelf();
+
+  return (Process[processID].prompt);
+}
+
+/* Convert a wildcard pattern into a list of blank-separated
+   filenames which match the wildcard.  */
+char *glob_pattern(const char *restrict wildcard)
+{
+  char *gfilename;
+  size_t cnt, length = 0;
+  glob_t glob_results;
+  char **p;
+
+  glob(wildcard, GLOB_NOCHECK, 0, &glob_results);
+
+  /* How much space do we need?  */
+  for ( p = glob_results.gl_pathv, cnt = glob_results.gl_pathc; cnt; p++, cnt-- )
+    length += strlen(*p) + 1;
+
+  /* Allocate the space and generate the list.  */
+  gfilename = (char *) calloc(length, sizeof(char));
+  for ( p = glob_results.gl_pathv, cnt = glob_results.gl_pathc; cnt; p++, cnt-- )
+    {
+      strcat(gfilename, *p);
+      if ( cnt > 1 ) strcat(gfilename, " ");
+    }
+
+  globfree(&glob_results);
+
+  return gfilename;
+}
+
+
+int cdoStreamCnt(void)
+{
+  int processID = processSelf();
+  int cnt;
+
+  cnt = Process[processID].streamCnt;
+
+  return (cnt);
+}
+
+
+const char *cdoStreamName(int cnt)
+{
+  int processID = processSelf();
+
+  if ( cnt > Process[processID].streamCnt || cnt < 0 )
+    Error("count %d out of range!", cnt);
+
+  return (Process[processID].streamNames[cnt]);
+}
+
+
+const char *processOperator(void)
+{
+  int processID = processSelf();
+
+  return (Process[processID].xoperator);
+}
+
+static
+char *getOperatorArg(const char *xoperator)
+{
+  char *commapos;
+  char *operatorArg = NULL;
+  size_t len;
+
+  if ( xoperator )
+    {
+      commapos = strchr(xoperator, ',');
+
+      if ( commapos )
+	{
+	  len = strlen(commapos+1);
+	  if ( len )
+	    {
+	      operatorArg = (char *) malloc(len+1);
+	      strcpy(operatorArg, commapos+1);
+	    }
+	}
+    }
+
+  return (operatorArg);
+}
+
+static int skipInputStreams(int argc, char *argv[], int globArgc, int nstreams);
+
+static
+int getGlobArgc(int argc, char *argv[], int globArgc)
+{
+  int streamInCnt;
+  int streamOutCnt;
+  char *opername;
+  char *comma_position;
+  const char *caller = processInqPrompt();
+  /*
+  { int i;
+  for ( i = 0; i < argc; i++ )
+    printf("%d %d %s\n", globArgc, i, argv[i]);
+  }
+  */
+  opername = &argv[globArgc][1];
+  comma_position = strchr(opername, ',');
+  if ( comma_position ) *comma_position = 0;
+
+  streamInCnt  = operatorStreamInCnt(opername);
+  streamOutCnt = operatorStreamOutCnt(opername);
+
+  if ( streamInCnt == -1 )
+    {
+      /*
+      int i;
+
+      for ( i = globArgc+1; i < argc; i++ )
+	if ( argv[i][0] == '-' ) break;
+
+      printf("%d %d %d\n", i, argc, globArgc);
+      if ( i < argc )
+      */
+      streamInCnt = 1;
+      /*
+      Errorc("Unlimited input streams not allowed in CDO pipes (Operator %s)!", opername);
+      */
+    }
+
+  if ( streamOutCnt > 1 )
+    Errorc("More than one output stream not allowed in CDO pipes (Operator %s)!", opername);
+
+  globArgc++;
+
+  if ( streamInCnt > 0 )
+    globArgc = skipInputStreams(argc, argv, globArgc, streamInCnt);
+  if ( comma_position ) *comma_position = ',';
+
+  return (globArgc);
+}
+
+static
+int skipInputStreams(int argc, char *argv[], int globArgc, int nstreams)
+{
+  const char *caller = processInqPrompt();
+
+  while ( nstreams > 0 )
+    {
+      if ( globArgc >= argc )
+	{
+	  Errorc("Too few arguments. Check command line!");
+	  break;
+	}
+      if ( argv[globArgc][0] == '-' )
+	{
+	  globArgc = getGlobArgc(argc, argv, globArgc);
+	}
+      else
+	globArgc++;
+
+      nstreams--;
+    }
+
+  return (globArgc);
+}
+
+static
+int getStreamCnt(int argc, char *argv[])
+{
+  int streamCnt = 0;
+  int globArgc = 1;
+
+  while ( globArgc < argc )
+    {
+      if ( argv[globArgc][0] == '-' )
+	{
+	  globArgc = getGlobArgc(argc, argv, globArgc);
+	}
+      else
+	globArgc++;
+
+      streamCnt++;
+    }
+
+  return (streamCnt);
+}
+
+static
+void setStreamNames(int argc, char *argv[])
+{
+  int processID = processSelf();
+  int i;
+  int globArgc = 1;
+  int globArgcStart;
+  char *streamname;
+  int len;
+
+  while ( globArgc < argc )
+    {
+      //     printf("arg %d %d %s\n", argc, globArgc, argv[globArgc]);
+      if ( argv[globArgc][0] == '-' )
+	{
+	  globArgcStart = globArgc;
+
+	  globArgc = getGlobArgc(argc, argv, globArgc);
+	  //	  printf("globArgc %d\n", globArgc);
+	  len = 0;
+	  for ( i = globArgcStart; i < globArgc; i++ ) len += strlen(argv[i]) + 1;
+	  streamname = (char *) malloc(len);
+	  memcpy(streamname, argv[globArgcStart], len);
+	  for ( i = 1; i < len-1; i++ ) if ( streamname[i] == '\0' ) streamname[i] = ' ';
+	  Process[processID].streamNames[Process[processID].streamCnt++] = streamname;
+	  // printf("streamname1: %s\n", streamname);
+	}
+      else
+	{
+	  len = strlen(argv[globArgc]) + 1;
+	  streamname = (char *) malloc(len);
+	  strcpy(streamname, argv[globArgc]);
+	  Process[processID].streamNames[Process[processID].streamCnt++] = streamname;
+	  // printf("streamname2: %s\n", streamname);
+	  globArgc++;
+	}
+    }
+}
+
+static
+int expand_wildcards(int processID, int streamCnt)
+{
+  int i;
+  const char *streamname0 = Process[processID].streamNames[0];
+  int len = strlen(streamname0);
+
+  for ( i = 0; i < len; ++i ) if ( streamname0[i] == '?' || streamname0[i] == '*' ) break;
+  if ( i < len )
+    {
+      char *pattern = glob_pattern(streamname0);
+      if ( strcmp(streamname0, pattern) != 0 )
+	{
+	  int gargc = 0;
+	  char *gargv[MAX_FILES];
+	  int len;
+	  gargv[gargc++] = pattern;
+	  len = strlen(pattern);
+	  for ( i = 1; i < len; ++i )
+	    if ( pattern[i] == ' ' )
+	      {
+		pattern[i] = 0;
+		i++;
+		gargv[gargc++] = &pattern[i];
+		if ( gargc >= MAX_FILES )
+		  Error("Internal problem! More than %d arguments.", MAX_FILES);
+	      }
+
+	  // for ( i = 0; i < gargc; ++i ) printf("pattern %d >%s<\n", i+1, gargv[i]);
+
+	  streamCnt = streamCnt - 1 + gargc;
+	  
+	  /*
+	  for ( i = 0; i < Process[processID].streamCnt; ++i )
+	    printf("stream %d <%s>\n", i+1, Process[processID].streamNames[i]);
+	  */
+	  Process[processID].streamNames = (char **) realloc(Process[processID].streamNames, streamCnt*sizeof(char *));
+	      
+	  // move output streams to the end
+	  for ( i = 1; i < Process[processID].streamCnt; ++i )
+	    Process[processID].streamNames[i+gargc-1] = Process[processID].streamNames[i];
+
+	  free(Process[processID].streamNames[0]);
+
+	  for ( i = 0; i < gargc; ++i )
+	    {
+	      char *streamname;
+	      len = strlen(gargv[i]) + 1;
+	      streamname = (char *) malloc(len);
+	      strcpy(streamname, gargv[i]);
+	      Process[processID].streamNames[i] = streamname;
+	    }
+	  
+	  Process[processID].streamCnt = streamCnt;
+	  /*
+	  for ( i = 0; i < Process[processID].streamCnt; ++i )
+	    printf("stream %d <%s>\n", i+1, Process[processID].streamNames[i]);
+	  */
+	}
+      
+      free(pattern);
+    }
+
+  return 1;
+}
+
+static
+int checkStreamCnt(void)
+{
+  int processID = processSelf();
+  int streamInCnt, streamOutCnt;
+  int streamInCnt0;
+  int streamCnt = 0;
+  int i, j;
+  int obase = FALSE;
+  int status = 0;
+  const char *caller = processInqPrompt();
+
+  streamInCnt  = operatorStreamInCnt(Process[processID].operatorName);
+  streamOutCnt = operatorStreamOutCnt(Process[processID].operatorName);
+
+  streamInCnt0 = streamInCnt;
+
+  if ( streamOutCnt == -1 )
+    {
+      streamOutCnt = 1;
+      obase = TRUE;
+    }
+
+  if ( streamInCnt == -1 && streamOutCnt == -1 )
+    Errorc("I/O stream counts unlimited no allowed!");
+    
+  // printf(" streamInCnt, streamOutCnt %d %d\n", streamInCnt, streamOutCnt);
+  if ( streamInCnt == -1 )
+    {
+      streamInCnt = Process[processID].streamCnt - streamOutCnt;
+      if ( streamInCnt < 1 ) Errorc("Input streams missing!");
+    }
+
+  if ( streamOutCnt == -1 )
+    {
+      streamOutCnt = Process[processID].streamCnt - streamInCnt;
+      if ( streamInCnt < 1 ) Errorc("Output streams missing!");
+    }
+  // printf(" streamInCnt, streamOutCnt %d %d\n", streamInCnt, streamOutCnt);
+
+  streamCnt = streamInCnt + streamOutCnt;
+  // printf(" streamCnt %d %d\n", Process[processID].streamCnt, streamCnt);
+
+  if ( Process[processID].streamCnt > streamCnt )
+    Errorc("Too many streams!"
+	   " Operator needs %d input and %d output streams.", streamInCnt, streamOutCnt);
+
+  if ( Process[processID].streamCnt < streamCnt )
+    Errorc("Too few streams specified!"
+	   " Operator needs %d input and %d output streams.", streamInCnt, streamOutCnt);
+
+
+  for ( i = streamInCnt; i < streamCnt; i++ )
+    {
+      if ( Process[processID].streamNames[i][0] == '-' )
+	{
+	  Errorc("Output file name %s must not begin with \"-\"!\n",
+		 Process[processID].streamNames[i]);
+	}
+      else if ( !obase )
+	{
+	  for ( j = 0; j < streamInCnt; j++ ) /* does not work with files in pipes */
+	    if ( strcmp(Process[processID].streamNames[i], Process[processID].streamNames[j]) == 0 )
+	      Errorc("Output file name %s is equal to input file name"
+		     " on position %d!\n", Process[processID].streamNames[i], j+1);
+	}
+    }
+
+  if ( streamInCnt == 1 && streamInCnt0 == -1 )
+    status = expand_wildcards(processID, streamCnt);
+
+  return (status);
+}
+
+static
+void setStreams(const char *argument)
+{
+  int processID = processSelf();
+  int streamCnt;
+  int i;
+  int status;
+  int argc = 0;
+  char *argv[MAX_FILES];
+  char *string;
+  size_t arglen;
+
+  arglen = 1 + strlen(argument);
+  string = (char *) malloc(arglen);
+  strcpy(string, argument);
+
+  argv[argc++] = string;
+  for ( i = 1; i < (int) arglen-1; i++ )
+    {
+      if ( string[i] == ' ' )
+	{
+	  string[i] = '\0';
+	  argv[argc++] = &string[i+1];
+	  if ( argc >= MAX_FILES )
+	    Error("Internal problem! More than %d arguments.", MAX_FILES);
+	}
+    }
+
+  streamCnt = getStreamCnt(argc, argv);
+
+  Process[processID].nvals = 0;
+  Process[processID].nvars = 0;
+  Process[processID].ntimesteps = 0;
+
+  Process[processID].streamCnt  = 0; /* filled in setStreamNames */
+  if ( streamCnt )
+    Process[processID].streamNames = (char **) malloc(streamCnt*sizeof(char *));
+  for ( i = 0; i < streamCnt; i++ ) Process[processID].streamNames[i] = NULL;
+
+  setStreamNames(argc, argv);
+
+  status = checkStreamCnt();
+
+  if ( status == 0 && Process[processID].streamCnt != streamCnt )
+    Error("Internal problem with stream count %d %d", Process[processID].streamCnt, streamCnt);
+
+  /*
+  for ( i = 0; i < streamCnt; i++ )
+    fprintf(stderr, "stream %d %s\n", i+1, Process[processID].streamNames[i]);
+  */
+
+  free(argv[0]);
+}
+
+
+void processDefArgument(const char *argument)
+{
+  int processID = processSelf();
+  char *operatorArg;
+  char *commapos;
+  int oargc = 0;
+  char **oargv = Process[processID].oargv;
+
+  /* printf("argument: %s\n", argument); */
+  Process[processID].xoperator    = getOperator(argument);
+  Process[processID].operatorName = getOperatorName(Process[processID].xoperator);
+  Process[processID].operatorArg  = getOperatorArg(Process[processID].xoperator);
+  operatorArg = Process[processID].operatorArg;
+
+  if ( operatorArg )
+    {
+      oargv[oargc++] = operatorArg;
+      /*printf("%d %s\n", oargc, operatorArg);*/
+
+      commapos = operatorArg;
+      while ( (commapos = strchr(commapos, ',')) != NULL )
+	{
+	  *commapos++ = '\0';
+	  if ( strlen(commapos) )
+	    {
+	      if ( oargc >= MAX_OARGC )
+		cdoAbort("Too many parameter (limit=%d)!", MAX_OARGC);
+
+	      oargv[oargc++] = commapos;
+	    }
+	}
+      Process[processID].oargc = oargc;
+    }
+
+  processDefPrompt(Process[processID].operatorName);
+
+  setStreams(argument);
+}
+
+
+void processDefVarNum(int nvars, int streamID)
+{
+  int processID = processSelf();
+
+  /*  if ( streamID == Process[processID].streams[0] ) */
+    Process[processID].nvars += nvars;
+}
+
+
+int processInqVarNum(void)
+{
+  int processID = processSelf();
+
+  return (Process[processID].nvars);
+}
+
+
+void processDefTimesteps(int streamID)
+{
+  int processID = processSelf();
+  /*
+  int i;
+  printf("streamID %d %d %d %d\n", streamID, Process[processID].streams[0], Process[processID].streams[1], processID);
+
+  for ( i = 0; i < Process[processID].nstream; i++)
+    printf("streamID %d %d %d %d << \n", processID, Process[processID].nstream, i, Process[processID].streams[i]);
+  */
+  /*  if ( streamID == Process[processID].streams[0] )*/
+    Process[processID].ntimesteps++;
+}
+
+
+int processInqTimesteps(void)
+{
+  int processID = processSelf();
+
+  return (Process[processID].ntimesteps);
+}
+
+
+void processDelete(void)
+{
+  int processID = processSelf();
+
+  //fprintf(stderr, "delete processID %d\n", processID);
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_mutex_lock(&processMutex);
+#endif
+
+  Process[processID].l_threadID = 0;
+  NumProcessActive--;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  pthread_mutex_unlock(&processMutex);  
+#endif
+}
+
+
+int operatorArgc(void)
+{
+  int processID = processSelf();
+
+  return (Process[processID].oargc);
+}
+
+
+char **operatorArgv(void)
+{
+  int processID = processSelf();
+
+  return (Process[processID].oargv);
+}
+
+
+void operatorCheckArgc(int numargs)
+{
+  int processID = processSelf();
+  int argc = Process[processID].oargc;
+
+  if ( argc < numargs )
+    cdoAbort("Too few arguments! Need %d found %d.", numargs, argc);
+  else if ( argc > numargs )
+    cdoAbort("Too many arguments! Need %d found %d.", numargs, argc);
+}
+
+
+void operatorInputArg(const char *enter)
+{
+  int processID = processSelf();
+  int oargc;
+
+  oargc = Process[processID].oargc;
+
+  if ( oargc == 0 )
+    {
+      char line[1024];
+      char *pline = line;
+      size_t pos, len, linelen;
+      int lreadline = 1;
+
+      if ( enter ) fprintf(stderr, "%-16s : Enter %s > ", processInqPrompt(), enter);
+
+      while ( lreadline )
+	{
+	  readline(stdin, pline, 1024);
+
+	  lreadline = 0;
+	  while ( 1 )
+	    {
+	      pos = 0;
+	      while ( pline[pos] == ' ' || pline[pos] == ',' ) pos++;
+	      pline += pos;
+	      linelen = strlen(pline);
+	      if ( linelen > 0 )
+		{
+		  if ( pline[0] == '\\' )
+		    {
+		      lreadline = 1;
+		      break;
+		    }
+		  len = 0;
+		  while ( pline[len] != ' '  && pline[len] != ',' &&
+			  pline[len] != '\\' && len < linelen ) len++;
+
+		  Process[processID].oargv[oargc] = (char *) malloc(len+1);
+		  memcpy(Process[processID].oargv[oargc], pline, len);
+		  Process[processID].oargv[oargc][len] = '\0';
+		  oargc++;
+
+		  pline += len;
+		}
+	      else
+		break;
+	    }
+	}
+
+      Process[processID].oargc = oargc;
+    }
+}
+
+
+int cdoOperatorAdd(const char *name, int f1, int f2, const char *enter)
+{
+  int processID = processSelf();
+  int operID = Process[processID].noper;
+
+  if ( operID < MAX_OPERATOR )
+    {
+      Process[processID].operator[operID].f1     = f1;
+      Process[processID].operator[operID].f2     = f2;
+      Process[processID].operator[operID].name   = name;
+      Process[processID].operator[operID].enter  = enter;
+
+      Process[processID].noper++;
+    }
+  else
+    {
+      cdoAbort("Maximum of %d operators reached!", MAX_OPERATOR);
+    }
+
+  return (operID);
+}
+
+
+int cdoOperatorID(void)
+{
+  int processID = processSelf();
+  int operID = -1;
+
+  if ( Process[processID].noper > 0 )
+    {
+      for ( operID = 0; operID < Process[processID].noper; operID++ )
+	if ( Process[processID].operator[operID].name )
+	  if ( strcmp(Process[processID].operatorName, Process[processID].operator[operID].name) == 0 ) break;
+
+      if ( operID == Process[processID].noper )
+	cdoAbort("Operator not callable by this name!");
+    }
+  else
+    {
+      cdoAbort("Operator not initialized!");
+    }
+
+  return (operID);
+}
+
+
+int cdoOperatorF1(int operID)
+{
+  int processID = processSelf();
+
+  return (Process[processID].operator[operID].f1);
+}
+
+
+int cdoOperatorF2(int operID)
+{
+  int processID = processSelf();
+
+  return (Process[processID].operator[operID].f2);
+}
+
+
+const char *cdoOperatorName(int operID)
+{
+  int processID = processSelf();
+
+  return (Process[processID].operator[operID].name);
+}
+
+
+const char *cdoOperatorEnter(int operID)
+{
+  int processID = processSelf();
+
+  return (Process[processID].operator[operID].enter);
+}
+
+
+int cdoStreamNumber()
+{
+  int processID = processSelf();
+
+  return (operatorStreamNumber(Process[processID].operatorName));
+}
diff --git a/src/process.h b/src/process.h
new file mode 100644
index 0000000..2693775
--- /dev/null
+++ b/src/process.h
@@ -0,0 +1,53 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _PROCESS_H
+#define _PROCESS_H
+
+#include <sys/types.h> /* off_t */
+
+int  processSelf(void);
+int  processCreate(void);
+void processDelete(void);
+int  processInqTimesteps(void);
+void processDefTimesteps(int streamID);
+int  processInqVarNum(void);
+int  processInqStreamNum(void);
+int  processInqStreamID(int streamindex);
+void processAddStream(int streamID);
+void processDefVarNum(int nvars, int streamID);
+void processDefArgument(const char *argument);
+
+void processStartTime(double *utime, double *stime);
+void processEndTime(double *utime, double *stime);
+void processAccuTime(double utime, double stime);
+
+void processDefCputime(int processID, double cputime);
+double processInqCputime(int processID);
+
+void processAddNvals(off_t nvals);
+off_t processInqNvals(int processID);
+int processNums(void);
+
+int  processInqChildNum(void);
+
+const char *processOperatorArg(void);
+const char *processInqOpername(void);
+const char *processInqOpername2(int processID);
+const char *processInqPrompt(void);
+
+#endif  /* _PROCESS_H */
diff --git a/src/pstream.c b/src/pstream.c
new file mode 100644
index 0000000..87da21c
--- /dev/null
+++ b/src/pstream.c
@@ -0,0 +1,1714 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#if defined (_OPENMP)
+#  include <omp.h>
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <stdarg.h>
+#include <errno.h>
+#include <sys/stat.h> /* stat */
+
+FILE *popen(const char *command, const char *type);
+int pclose(FILE *stream);
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "dtypes.h"
+#include "modules.h"
+#include "pstream_int.h"
+#include "cdo_int.h"
+#include "util.h"
+#include "pipe.h"
+#include "error.h"
+#include "dmemory.h"
+
+
+extern int timer_read, timer_write;
+
+static int PSTREAM_Debug = 0;
+
+#define  MAX_PSTREAMS  4096
+
+static int _pstream_max = MAX_PSTREAMS;
+
+static void pstream_initialize(void);
+
+static int _pstream_init = FALSE;
+
+#if  defined  (HAVE_LIBPTHREAD)
+#include <pthread.h>
+#include "pthread_debug.h"
+
+static int pthreadScope = 0;
+
+static pthread_mutex_t streamOpenReadMutex  = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t streamOpenWriteMutex = PTHREAD_MUTEX_INITIALIZER;
+static pthread_mutex_t streamMutex          = PTHREAD_MUTEX_INITIALIZER;
+
+static pthread_once_t _pstream_init_thread = PTHREAD_ONCE_INIT;
+static pthread_mutex_t _pstream_mutex;
+
+#  define PSTREAM_LOCK()           pthread_mutex_lock(&_pstream_mutex)
+#  define PSTREAM_UNLOCK()         pthread_mutex_unlock(&_pstream_mutex)
+#  define PSTREAM_INIT()	  \
+   if ( _pstream_init == FALSE ) pthread_once(&_pstream_init_thread, pstream_initialize)
+
+#else
+
+#  define PSTREAM_LOCK()
+#  define PSTREAM_UNLOCK()
+#  define PSTREAM_INIT()	  \
+   if ( _pstream_init == FALSE ) pstream_initialize()
+
+#endif
+
+
+typedef struct _pstreamPtrToIdx {
+  int idx;
+  pstream_t *ptr;
+  struct _pstreamPtrToIdx *next;
+} pstreamPtrToIdx;
+
+
+static pstreamPtrToIdx *_pstreamList  = NULL;
+static pstreamPtrToIdx *_pstreamAvail = NULL;
+
+
+static
+void pstream_list_new(void)
+{
+  assert(_pstreamList == NULL);
+
+  _pstreamList = (pstreamPtrToIdx *) malloc(_pstream_max*sizeof(pstreamPtrToIdx));
+}
+
+static
+void pstream_list_delete(void)
+{
+  if ( _pstreamList ) free(_pstreamList);
+}
+
+static
+void pstream_init_pointer(void)
+{
+  int  i;
+  
+  for ( i = 0; i < _pstream_max; i++ )
+    {
+      _pstreamList[i].next = _pstreamList + i + 1;
+      _pstreamList[i].idx  = i;
+      _pstreamList[i].ptr  = 0;
+    }
+
+  _pstreamList[_pstream_max-1].next = 0;
+
+  _pstreamAvail = _pstreamList;
+}
+
+static
+pstream_t *pstream_to_pointer(int idx)
+{
+  pstream_t *pstreamptr = NULL;
+
+  PSTREAM_INIT();
+
+  if ( idx >= 0 && idx < _pstream_max )
+    {
+      PSTREAM_LOCK();
+
+      pstreamptr = _pstreamList[idx].ptr;
+
+      PSTREAM_UNLOCK();
+    }
+  else
+    Error("pstream index %d undefined!", idx);
+
+  return (pstreamptr);
+}
+
+/* Create an index from a pointer */
+static
+int pstream_from_pointer(pstream_t *ptr)
+{
+  int      idx = -1;
+  pstreamPtrToIdx *newptr;
+
+  if ( ptr )
+    {
+      PSTREAM_LOCK();
+
+      if ( _pstreamAvail )
+	{
+	  newptr        = _pstreamAvail;
+	  _pstreamAvail = _pstreamAvail->next;
+	  newptr->next  = 0;
+	  idx	        = newptr->idx;
+	  newptr->ptr   = ptr;
+      
+	  if ( PSTREAM_Debug )
+	    Message("Pointer %p has idx %d from pstream list", ptr, idx);
+	}
+      else
+	Warning("Too many open pstreams (limit is %d)!", _pstream_max);
+
+      PSTREAM_UNLOCK();
+    }
+  else
+    Error("Internal problem (pointer %p undefined)", ptr);
+
+  return (idx);
+}
+
+static
+void pstream_init_entry(pstream_t *pstreamptr)
+{
+  pstreamptr->self       = pstream_from_pointer(pstreamptr);
+
+  pstreamptr->isopen     = TRUE;
+  pstreamptr->ispipe     = FALSE;
+  pstreamptr->fileID     = -1;
+  pstreamptr->vlistID    = -1;
+  pstreamptr->tsID       = -1;
+  pstreamptr->filetype   = -1;
+  pstreamptr->name       = NULL;
+  pstreamptr->tsID0      = 0;
+  pstreamptr->mfiles     = 0;
+  pstreamptr->nfiles     = 0;
+  pstreamptr->varID      = -1;
+  pstreamptr->name       = NULL;
+  pstreamptr->mfnames    = NULL;
+  pstreamptr->varlist    = NULL;
+#if  defined  (HAVE_LIBPTHREAD)
+  pstreamptr->pipe       = NULL;
+  //  pstreamptr->rthreadID  = 0;
+  //  pstreamptr->wthreadID  = 0;
+#endif
+}
+
+static
+pstream_t *pstream_new_entry(void)
+{
+  pstream_t *pstreamptr;
+
+  pstreamptr = (pstream_t *) malloc(sizeof(pstream_t));
+
+  if ( pstreamptr ) pstream_init_entry(pstreamptr);
+
+  return (pstreamptr);
+}
+
+static
+void pstream_delete_entry(pstream_t *pstreamptr)
+{
+  int idx;
+
+  idx = pstreamptr->self;
+
+  PSTREAM_LOCK();
+
+  free(pstreamptr);
+
+  _pstreamList[idx].next = _pstreamAvail;
+  _pstreamList[idx].ptr  = 0;
+  _pstreamAvail   	 = &_pstreamList[idx];
+
+  PSTREAM_UNLOCK();
+
+  if ( PSTREAM_Debug )
+    Message("Removed idx %d from pstream list", idx);
+}
+
+static
+void pstream_initialize(void)
+{
+  char *env;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  /* initialize global API mutex lock */
+  pthread_mutex_init(&_pstream_mutex, NULL);
+#endif
+
+  env = getenv("PSTREAM_DEBUG");
+  if ( env ) PSTREAM_Debug = atoi(env);
+
+  env = getenv("PSTREAM_MAX");
+  if ( env ) _pstream_max = atoi(env);
+
+  if ( PSTREAM_Debug )
+    Message("PSTREAM_MAX = %d", _pstream_max);
+
+  pstream_list_new();
+  atexit(pstream_list_delete);
+
+  pstream_init_pointer();
+
+  _pstream_init = TRUE;
+}
+
+static
+int pstreamFindID(const char *name)
+{
+  int pstreamID;
+  pstream_t *pstreamptr;
+
+  for ( pstreamID = 0; pstreamID < _pstream_max; pstreamID++ )
+    {
+      pstreamptr = pstream_to_pointer(pstreamID);
+
+      if ( pstreamptr )
+	if ( pstreamptr->name )
+	  if ( strcmp(pstreamptr->name, name) == 0 ) break;
+    }
+
+  if ( pstreamID == _pstream_max ) pstreamID = -1;
+
+  return (pstreamID);
+}
+
+
+int pstreamIsPipe(int pstreamID)
+{
+  pstream_t *pstreamptr;
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+  return (pstreamptr->ispipe);
+}
+
+
+int pstreamOpenRead(const char *argument)
+{
+  char *operatorArg = NULL;
+  char *operatorName = NULL;
+  int ispipe = FALSE;
+  int fileID;
+  int pstreamID;
+  pstream_t *pstreamptr;
+
+  PSTREAM_INIT();
+
+  pstreamptr = pstream_new_entry();
+  if ( ! pstreamptr ) Error("No memory");
+
+  pstreamID = pstreamptr->self;
+
+  ispipe = argument[0] == '-';
+
+  if ( ispipe )
+    {
+#if  defined  (HAVE_LIBPTHREAD)
+      char *newarg;
+      char *pipename = (char *) malloc(16);
+      int rval;
+      pthread_t thrID;
+      pthread_attr_t attr;
+      // struct sched_param param;
+      size_t len;
+      size_t stacksize;
+      int status;
+
+      operatorArg = getOperator(argument);
+      operatorName = getOperatorName(operatorArg);
+      free(operatorArg);
+
+      len = strlen(argument);
+      newarg = (char *) malloc(len+16);
+      strcpy(newarg, argument);
+      sprintf(pipename, "(pipe%d.%d)", processSelf() + 1, processInqChildNum() + 1);
+      newarg[len] = ' ';
+      strcpy(&newarg[len+1], pipename);
+
+      pstreamptr->ispipe = TRUE;
+      pstreamptr->name   = pipename;
+      pstreamptr->rthreadID = pthread_self();
+      pstreamptr->pipe   = pipeNew();
+ 
+      if ( ! cdoSilentMode )
+	fprintf(stderr, "%s: Started child process \"%s\".\n", processInqPrompt(), newarg+1);
+
+      status = pthread_attr_init(&attr);
+      if ( status ) SysError("pthread_attr_init failed for '%s'\n", newarg+1);
+      status = pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
+      if ( status ) SysError("pthread_attr_setdetachstate failed for '%s'\n", newarg+1);
+      /*
+      param.sched_priority = 0;
+      status = pthread_attr_setschedparam(&attr, &param);
+      if ( status ) SysError("pthread_attr_setschedparam failed for '%s'\n", newarg+1);
+      */
+      /* status = pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED); */
+      /* if ( status ) SysError("pthread_attr_setinheritsched failed for '%s'\n", newarg+1); */
+
+      pthread_attr_getscope(&attr, &pthreadScope);
+
+      /* status = pthread_attr_setscope(&attr, PTHREAD_SCOPE_PROCESS); */
+      /* if ( status ) SysError("pthread_attr_setscope failed for '%s'\n", newarg+1); */
+      /* If system scheduling scope is specified, then the thread is scheduled against all threads in the system */
+      /* pthread_attr_setscope(&attr, PTHREAD_SCOPE_SYSTEM); */
+
+      status = pthread_attr_getstacksize(&attr, &stacksize);
+      if ( stacksize < 2097152 )
+	{
+	  stacksize = 2097152;
+	  pthread_attr_setstacksize(&attr, stacksize);
+	}
+      rval = pthread_create(&thrID, &attr, operatorModule(operatorName), newarg);
+      if ( rval != 0 )
+	{
+	  errno = rval;
+	  SysError("pthread_create failed for '%s'\n", newarg+1);
+	}
+
+      /* free(operatorName); */
+      processAddStream(pstreamID);
+      /*      pipeInqInfo(pstreamID); */
+      if ( PSTREAM_Debug ) Message("pipe %s", pipename);
+#else
+      cdoAbort("Cannot use pipes, pthread support not compiled in!");
+#endif
+    }
+  else
+    {
+      extern int cdoDefaultFileType/*, cdoDefaultInstID*/;
+      size_t len, i;
+      int nfiles = 1, j;
+      char *filename = NULL;
+      const char *pch;
+
+      len = strlen(argument);
+
+      for ( i = 0; i < len; i++ )
+	if ( argument[i] == ':' ) break;
+
+      if ( i < len )
+	{
+	  pch = &argument[i+1];
+	  len -= (i+1);
+	  if ( len && ( memcmp(argument, "filelist:", 9) == 0 || 
+			memcmp(argument, "flist:", 6) == 0 ) )
+	    {
+	      for ( i = 0; i < len; i++ ) if ( pch[i] == ',' ) nfiles++;
+
+	      if ( nfiles == 1 )
+		{
+		  char line[4096];
+		  FILE *fp, *fp2;
+		  fp = fopen(pch, "r");
+		  if ( fp == NULL ) cdoAbort("Open failed on %s", pch);
+
+		  if ( cdoVerbose )
+		    cdoPrint("Reading file names from %s", pch);
+
+		  /* find number of files */
+		  nfiles = 0;
+		  while ( readline(fp, line, 4096) )
+		    {
+		      if ( line[0] == '#' || line[0] == '\0' ||
+			   line[0] == ' ' ) continue;
+
+		      fp2 = fopen(line, "r" );
+		      if ( fp2 == NULL ) cdoAbort("Open failed on %s", line);
+		      fclose(fp2);
+		      nfiles++;
+		      if ( cdoVerbose )
+			cdoPrint("File number %d is %s", nfiles, line);
+		    }
+
+		  if ( nfiles == 0 ) cdoAbort("No imput file found in %s", pch);
+
+		  pstreamptr->mfiles = nfiles;
+		  pstreamptr->mfnames = (char **) malloc(nfiles*sizeof(char *));
+		  
+		  rewind(fp);
+
+		  nfiles = 0;
+		  while ( readline(fp, line, 4096) )
+		    {
+		      if ( line[0] == '#' || line[0] == '\0' ||
+			   line[0] == ' ' ) continue;
+
+		      pstreamptr->mfnames[nfiles] = strdupx(line);
+		      nfiles++;
+		    }
+
+		  fclose(fp);
+		}
+	      else
+		{
+		  char line[65536];
+
+		  pstreamptr->mfiles = nfiles;
+		  pstreamptr->mfnames = (char **) malloc(nfiles*sizeof(char *));
+		  
+		  strcpy(line, pch);
+		  for ( i = 0; i < len; i++ ) if ( line[i] == ',' ) line[i] = 0;
+
+		  i = 0;
+		  for ( j = 0; j < nfiles; j++ )
+		    {
+		      pstreamptr->mfnames[j] = strdupx(&line[i]);
+		      i += strlen(&line[i]) + 1;
+		    }
+		}
+	    }
+	  else if ( len && memcmp(argument, "ls:", 3) == 0 )
+	    {
+	      char line[4096];
+	      char command[4096];
+	      char *fnames[16384];
+	      FILE *pfp;
+
+	      strcpy(command, "ls ");
+	      strcat(command, pch);
+
+	      pfp = popen(command, "r");
+	      if ( pfp == 0 )
+		SysError("popen %s failed", command);
+
+	      nfiles = 0;
+	      while ( readline(pfp, line, 4096) )
+		{
+		  if ( nfiles >= 16384 ) cdoAbort("Too many input files (limit: 16384)");
+		  fnames[nfiles++] = strdupx(line);
+		}
+
+	      pclose(pfp);
+
+	      pstreamptr->mfiles = nfiles;
+	      pstreamptr->mfnames = (char **) malloc(nfiles*sizeof(char *));
+
+	      for ( j = 0; j < nfiles; j++ )
+		pstreamptr->mfnames[j] = fnames[j];
+	    }
+	}
+
+      if ( pstreamptr->mfiles )
+	{
+	  len = strlen(pstreamptr->mfnames[0]);
+	  filename = (char *) malloc(len+1);
+	  strcpy(filename, pstreamptr->mfnames[0]);
+	  pstreamptr->nfiles = 1;
+	}
+      else
+	{
+	  len = strlen(argument);
+	  /*
+	  if ( cdoExpMode == CDO_EXP_REMOTE )
+	    {
+	      char datapath[] = "/scratch/localA/m214003/data/";
+	      len += strlen(datapath);
+
+	      filename = (char *) malloc(len+1);
+
+	      strcpy(filename, datapath);
+	      strcat(filename, argument);
+	    }
+	  else
+	  */
+	    {
+	      filename = (char *) malloc(len+1);
+
+	      strcpy(filename, argument);
+	    }
+	}
+
+      if ( PSTREAM_Debug ) Message("file %s", filename);
+
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO )
+	pthread_mutex_lock(&streamMutex);
+      else
+	pthread_mutex_lock(&streamOpenReadMutex);
+#endif
+      fileID = streamOpenRead(filename);
+      if ( fileID < 0 ) cdiError(fileID, "Open failed on >%s<", filename);
+
+      if ( cdoDefaultFileType == CDI_UNDEFID )
+	cdoDefaultFileType = streamInqFiletype(fileID);
+      /*
+      if ( cdoDefaultInstID == CDI_UNDEFID )
+	cdoDefaultInstID = streamInqInstID(fileID);
+      */
+      cdoInqHistory(fileID);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO )
+	pthread_mutex_unlock(&streamMutex);
+      else
+	pthread_mutex_unlock(&streamOpenReadMutex);
+#endif
+
+      pstreamptr->mode   = 'r';
+      pstreamptr->name   = filename;
+      pstreamptr->fileID = fileID;
+    }
+
+  if ( pstreamID < 0 ) cdiError(pstreamID, "Open failed on %s", argument);
+  
+  return (pstreamID);
+}
+
+static
+void query_user_exit(const char *argument)
+{
+  /* modified code from NCO */
+#define USR_RPL_MAX_LNG 10 /* Maximum length for user reply */
+#define USR_RPL_MAX_NBR 10 /* Maximum number of chances for user to reply */
+  char usr_rpl[USR_RPL_MAX_LNG];
+  int usr_rpl_int;
+  short nbr_itr=0;
+  size_t usr_rpl_lng = 0;
+
+  /* Initialize user reply string */
+  usr_rpl[0]='z';
+  usr_rpl[1]='\0';
+
+  while ( !(usr_rpl_lng == 1 && 
+	    (*usr_rpl == 'o' || *usr_rpl == 'O' || *usr_rpl == 'e' || *usr_rpl == 'E')) )
+    {
+      if ( nbr_itr++ > USR_RPL_MAX_NBR )
+	{
+	  (void)fprintf(stdout,"\n%s: ERROR %d failed attempts to obtain valid interactive input.\n",
+			processInqPrompt(), nbr_itr-1);
+	  exit(EXIT_FAILURE);
+	}
+
+      if ( nbr_itr > 1 ) (void)fprintf(stdout,"%s: ERROR Invalid response.\n", processInqPrompt());
+      (void)fprintf(stdout,"%s: %s exists ---`e'xit, or `o'verwrite (delete existing file) (e/o)? ",
+		    processInqPrompt(), argument);
+      (void)fflush(stdout);
+      if ( fgets(usr_rpl, USR_RPL_MAX_LNG, stdin) == NULL ) continue;
+
+      /* Ensure last character in input string is \n and replace that with \0 */
+      usr_rpl_lng = strlen(usr_rpl);
+      if ( usr_rpl_lng >= 1 )
+	if ( usr_rpl[usr_rpl_lng-1] == '\n' )
+	  {
+	    usr_rpl[usr_rpl_lng-1] = '\0';
+	    usr_rpl_lng--;
+	  }
+    }
+
+  /* Ensure one case statement for each exit condition in preceding while loop */
+  usr_rpl_int=(int)usr_rpl[0];
+  switch(usr_rpl_int)
+    {
+    case 'E':
+    case 'e':
+      exit(EXIT_SUCCESS);
+      break;
+    case 'O':
+    case 'o':
+      break;
+    default:
+      exit(EXIT_FAILURE);
+      break;
+    } /* end switch */
+}
+
+
+int pstreamOpenWrite(const char *argument, int filetype)
+{
+  int fileID;
+  int pstreamID = -1;
+  int ispipe;
+  pstream_t *pstreamptr;
+
+  PSTREAM_INIT();
+
+  ispipe = memcmp(argument, "(pipe", 5) == 0;
+
+  if ( ispipe )
+    {
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( PSTREAM_Debug ) Message("pipe %s", argument);
+      pstreamID = pstreamFindID(argument);
+      if ( pstreamID == -1 )
+	Error("%s not open", argument);
+
+      pstreamptr = pstream_to_pointer(pstreamID);
+
+      pstreamptr->wthreadID = pthread_self();
+      pstreamptr->filetype = filetype;
+      processAddStream(pstreamID);
+#endif
+    }
+  else
+    {
+      /* extern int cdoDefaultInstID; */
+      char *filename = (char *) malloc(strlen(argument)+1);
+
+      pstreamptr = pstream_new_entry();
+      if ( ! pstreamptr ) Error("No memory");
+
+      pstreamID = pstreamptr->self;
+  
+      if ( PSTREAM_Debug ) Message("file %s", argument);
+
+      if ( filetype == CDI_UNDEFID ) filetype = FILETYPE_GRB;
+
+      if ( cdoInteractive )
+	{
+	  int rstatus;
+	  struct stat stbuf;
+
+	  rstatus = stat(argument, &stbuf);
+	  /* If permanent file already exists, query user whether to overwrite or exit */
+	  if ( rstatus != -1 ) query_user_exit(argument);
+	}
+
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_write);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO )
+	pthread_mutex_lock(&streamMutex);
+      else
+	pthread_mutex_lock(&streamOpenWriteMutex);
+#endif
+      fileID = streamOpenWrite(argument, filetype);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO )
+	pthread_mutex_unlock(&streamMutex);
+      else
+	pthread_mutex_unlock(&streamOpenWriteMutex);
+#endif
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_write);
+      if ( fileID < 0 ) cdiError(fileID, "Open failed on %s", argument);
+
+      cdoDefHistory(fileID, commandLine());
+
+      if ( cdoDefaultByteorder != CDI_UNDEFID )
+	streamDefByteorder(fileID, cdoDefaultByteorder);
+
+      if ( cdoCompress )
+	{
+	  if      ( filetype == FILETYPE_GRB )
+	    {
+	      cdoCompType  = COMPRESS_SZIP;
+	      cdoCompLevel = 0;
+	    }
+	  else if ( filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C )
+	    {
+	      cdoCompType  = COMPRESS_ZIP;
+	      cdoCompLevel = 1;
+	    }
+	}
+
+      if ( cdoCompType != COMPRESS_NONE )
+	{
+	  streamDefCompType(fileID, cdoCompType);
+	  streamDefCompLevel(fileID, cdoCompLevel);
+
+	  if ( cdoCompType == COMPRESS_SZIP && (filetype != FILETYPE_GRB && filetype != FILETYPE_NC4 && filetype != FILETYPE_NC4C) )
+	    cdoWarning("SZIP compression not available for non GRIB1/netCDF4 data!");
+
+	  if ( cdoCompType == COMPRESS_JPEG && filetype != FILETYPE_GRB2 )
+	    cdoWarning("SZIP compression not available for non GRIB2 data!");
+
+	  if ( cdoCompType == COMPRESS_ZIP && (filetype != FILETYPE_NC4 && filetype != FILETYPE_NC4C) )
+	    cdoWarning("Deflate compression not available for non netCDF4 data!");
+	}
+      /*
+      if ( cdoDefaultInstID != CDI_UNDEFID )
+	streamDefInstID(fileID, cdoDefaultInstID);
+      */
+      strcpy(filename, argument);
+
+      pstreamptr->mode     = 'w';
+      pstreamptr->name     = filename;
+      pstreamptr->fileID   = fileID;
+      pstreamptr->filetype = filetype;
+   }
+
+  return (pstreamID);
+}
+
+
+int pstreamOpenAppend(const char *argument)
+{
+  int fileID;
+  int pstreamID = -1;
+  int ispipe;
+  pstream_t *pstreamptr;
+
+  ispipe = memcmp(argument, "(pipe", 5) == 0;
+
+  if ( ispipe )
+    {
+      if ( PSTREAM_Debug ) Message("pipe %s", argument);
+      cdoAbort("this operator doesn't work with pipes!");
+    }
+  else
+    {
+      char *filename = (char *) malloc(strlen(argument)+1);
+
+      pstreamptr = pstream_new_entry();
+      if ( ! pstreamptr ) Error("No memory");
+
+      pstreamID = pstreamptr->self;
+  
+      if ( PSTREAM_Debug ) Message("file %s", argument);
+
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_write);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO )
+	pthread_mutex_lock(&streamMutex);
+      else
+	pthread_mutex_lock(&streamOpenReadMutex);
+#endif
+      fileID = streamOpenAppend(argument);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO )
+	pthread_mutex_unlock(&streamMutex);
+      else
+	pthread_mutex_unlock(&streamOpenReadMutex);
+#endif
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_write);
+      if ( fileID < 0 ) cdiError(fileID, "Open failed on %s", argument);
+      /*
+      cdoInqHistory(fileID);
+      cdoDefHistory(fileID, commandLine());
+      */
+      strcpy(filename, argument);
+
+      pstreamptr->mode   = 'a';
+      pstreamptr->name   = filename;
+      pstreamptr->fileID = fileID;
+    }
+
+  return (pstreamID);
+}
+
+
+void pstreamClose(int pstreamID)
+{
+  pstream_t *pstreamptr;
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+  if ( pstreamptr == NULL )
+    Error("Internal problem, stream %d not open!", pstreamID);
+
+  if ( pstreamptr->ispipe )
+    {
+#if  defined  (HAVE_LIBPTHREAD)
+      pipe_t *pipe;
+      int lread = FALSE, lwrite = FALSE;
+      pthread_t threadID = pthread_self();
+
+      if      ( pthread_equal(threadID, pstreamptr->rthreadID) ) lread  = TRUE;
+      else if ( pthread_equal(threadID, pstreamptr->wthreadID) ) lwrite = TRUE;
+      else Error("Internal problem! Close pipe %s", pstreamptr->name);
+
+      if ( lread )
+	{
+	  pipe = pstreamptr->pipe;
+	  pthread_mutex_lock(pipe->mutex);
+	  pipe->EOP = TRUE;
+	  if ( PSTREAM_Debug ) Message("%s read closed", pstreamptr->name);
+	  pthread_mutex_unlock(pipe->mutex);     
+	  pthread_cond_signal(pipe->tsDef);
+	  pthread_cond_signal(pipe->tsInq);
+	 
+	  pthread_cond_signal(pipe->recInq);
+	 
+	  pthread_mutex_lock(pipe->mutex);
+	  pstreamptr->isopen = FALSE;
+	  pthread_mutex_unlock(pipe->mutex);     
+	  pthread_cond_signal(pipe->isclosed);
+
+	  pthread_join(pstreamptr->wthreadID, NULL);
+
+	  processAddNvals(pipe->nvals);
+	  pipeDelete(pipe);
+	  pstream_delete_entry(pstreamptr);
+	}
+      else
+	{
+	  pipe = pstreamptr->pipe;
+	  pthread_mutex_lock(pipe->mutex);
+	  pipe->EOP = TRUE;
+	  if ( PSTREAM_Debug ) Message("%s write closed", pstreamptr->name);
+	  pthread_mutex_unlock(pipe->mutex);     
+	  pthread_cond_signal(pipe->tsDef);
+	  pthread_cond_signal(pipe->tsInq);
+
+	  pthread_mutex_lock(pipe->mutex);
+	  while ( pstreamptr->isopen )
+	    {
+	      if ( PSTREAM_Debug ) Message("wait of read close");
+	      pthread_cond_wait(pipe->isclosed, pipe->mutex);
+	    }
+	  pthread_mutex_unlock(pipe->mutex);
+	}
+#else
+      cdoAbort("Cannot use pipes, pthread support not compiled in!");
+#endif
+    }
+  else
+    {
+      if ( PSTREAM_Debug )
+	Message("%s fileID %d\n", pstreamptr->name, pstreamptr->fileID);
+
+      if ( pstreamptr->mode == 'r' )
+	{
+	  processAddNvals(streamNvals(pstreamptr->fileID));
+	}
+
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+      streamClose(pstreamptr->fileID);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+
+      if ( cdoExpMode == CDO_EXP_REMOTE )
+	{
+	  if ( pstreamptr->mode == 'w' )
+	    {
+	      extern const char *cdojobfiles;
+	      FILE *fp = fopen(cdojobfiles, "a");
+	      fprintf(fp, "%s\n", pstreamptr->name);
+	      fclose(fp);
+	    }
+	}
+
+      if ( pstreamptr->name )
+	{
+	  free(pstreamptr->name);
+	  pstreamptr->name = NULL;
+	}
+
+      if ( pstreamptr->varlist )
+	{
+	  free(pstreamptr->varlist);
+	  pstreamptr->varlist = NULL;
+	}
+
+      pstream_delete_entry(pstreamptr);
+    }
+}
+
+
+int pstreamInqVlist(int pstreamID)
+{
+  int vlistID;
+  pstream_t *pstreamptr;
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr->ispipe )
+    {
+      vlistID = pipeInqVlist(pstreamptr);
+      if ( vlistID == -1 )
+	cdoAbort("Couldn't read data from input stream %s!", pstreamptr->name);
+    }
+  else
+#endif
+    {
+      extern int cdoDefaultTimeType;
+
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_read);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+      vlistID = streamInqVlist(pstreamptr->fileID);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_read);
+
+      if ( cdoDefaultTimeType != CDI_UNDEFID )
+	taxisDefType(vlistInqTaxis(vlistID), cdoDefaultTimeType);
+
+      pstreamptr->vlistID = vlistID;
+    }
+
+  if ( vlistNumber(vlistID) == CDI_COMP && cdoStreamNumber() == CDI_REAL )
+    cdoAbort("Complex fields are not supported by this operator!");
+
+  if ( vlistNumber(vlistID) == CDI_REAL && cdoStreamNumber() == CDI_COMP )
+    cdoAbort("This operator needs complex fields!");
+
+  processDefVarNum(vlistNvars(vlistID), pstreamID);
+
+  return (vlistID);
+}
+
+
+const char *cdoComment(void)
+{
+  static char comment[256];
+  static int init = 0;
+  int size = 0;
+  extern char CDO_Version[];
+
+  if ( ! init )
+    {
+      init = 1;
+
+      size = strlen(CDO_Version);
+
+      strncat(comment, CDO_Version, size);
+    }
+
+  return (comment);
+}
+
+static
+void pstreamDefVarlist(pstream_t *pstreamptr, int vlistID)
+{
+  int varID, nvars;
+  int laddoffset, lscalefactor;
+  int datatype, filetype;
+  varlist_t *varlist;
+
+  filetype = pstreamptr->filetype;
+
+  if ( pstreamptr->vlistID != -1 )
+    cdoAbort("Internal problem, vlist already defined!");
+
+  if ( pstreamptr->varlist != NULL )
+    cdoAbort("Internal problem, varlist already allocated!");
+
+  nvars = vlistNvars(vlistID);
+  varlist = (varlist_t *) malloc(nvars*sizeof(varlist_t));
+
+  for ( varID = 0; varID < nvars; ++varID )
+    {
+      varlist[varID].gridsize    = gridInqSize(vlistInqVarGrid(vlistID, varID));
+      varlist[varID].datatype    = vlistInqVarDatatype(vlistID, varID);
+      varlist[varID].missval     = vlistInqVarMissval(vlistID, varID);
+      varlist[varID].addoffset   = vlistInqVarAddoffset(vlistID, varID);
+      varlist[varID].scalefactor = vlistInqVarScalefactor(vlistID, varID);
+
+      varlist[varID].check_datarange = FALSE;
+
+      laddoffset   = IS_NOT_EQUAL(varlist[varID].addoffset, 0);
+      lscalefactor = IS_NOT_EQUAL(varlist[varID].scalefactor, 1);
+
+      datatype = varlist[varID].datatype;
+
+      if ( filetype == FILETYPE_NC || filetype == FILETYPE_NC2 || filetype == FILETYPE_NC4 || filetype == FILETYPE_NC4C )
+	{
+	  if ( datatype == DATATYPE_UINT8 && (filetype == FILETYPE_NC || filetype == FILETYPE_NC2) )
+	    {
+	      datatype = DATATYPE_INT16;
+	      varlist[varID].datatype = datatype;
+	    }
+
+	  if ( datatype == DATATYPE_UINT16 && (filetype == FILETYPE_NC || filetype == FILETYPE_NC2) )
+	    {
+	      datatype = DATATYPE_INT32;
+	      varlist[varID].datatype = datatype;
+	    }
+
+	  if ( laddoffset || lscalefactor )
+	    {
+	      if ( datatype == DATATYPE_INT8   ||
+		   datatype == DATATYPE_UINT8  ||
+		   datatype == DATATYPE_INT16  ||
+		   datatype == DATATYPE_UINT16 )
+		varlist[varID].check_datarange = TRUE;
+	    }
+	  else if ( cdoCheckDatarange )
+	    {
+	      varlist[varID].check_datarange = TRUE;
+	    }
+	}
+    }
+
+  pstreamptr->varlist = varlist;
+  pstreamptr->vlistID = vlistID; /* used for -r/-a */
+}
+
+
+void pstreamDefVlist(int pstreamID, int vlistID)
+{
+  pstream_t *pstreamptr;
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr->ispipe )
+    {
+      int vlistIDcp = vlistDuplicate(vlistID);
+      /*    pipeDefVlist(pstreamptr, vlistID);*/
+      pipeDefVlist(pstreamptr, vlistIDcp);
+    }
+  else
+#endif
+    {
+      if ( cdoDefaultDataType != CDI_UNDEFID )
+	{
+	  int varID, nvars = vlistNvars(vlistID);
+
+	  for ( varID = 0; varID < nvars; ++varID )
+	    vlistDefVarDatatype(vlistID, varID, cdoDefaultDataType);
+
+	  if ( cdoDefaultDataType == DATATYPE_FLT64 || cdoDefaultDataType == DATATYPE_FLT32 )
+	    {
+	      for ( varID = 0; varID < nvars; varID++ )
+		{
+		  vlistDefVarAddoffset(vlistID, varID, 0.0);
+		  vlistDefVarScalefactor(vlistID, varID, 1.0);
+		}
+	    }
+	}
+
+      if ( cdoChunkType != CDI_UNDEFID )
+	{
+	  int varID, nvars = vlistNvars(vlistID);
+
+	  for ( varID = 0; varID < nvars; ++varID )
+	    vlistDefVarChunkType(vlistID, varID, cdoChunkType);
+	}
+
+      vlistDefAttTxt(vlistID, CDI_GLOBAL, "CDO", (int)strlen(cdoComment())+1, cdoComment());
+
+      pstreamDefVarlist(pstreamptr, vlistID);
+
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_write);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+      streamDefVlist(pstreamptr->fileID, vlistID);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_write);
+    }
+}
+
+
+int pstreamInqRecord(int pstreamID, int *varID, int *levelID)
+{
+  pstream_t *pstreamptr;
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr->ispipe )
+    pipeInqRecord(pstreamptr, varID, levelID);
+  else
+#endif
+    {
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_read);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+      streamInqRecord(pstreamptr->fileID, varID, levelID);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_read);
+    }
+
+  return (0);
+}
+
+
+void pstreamDefRecord(int pstreamID, int varID, int levelID)
+{
+  pstream_t *pstreamptr;
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+  
+  pstreamptr->varID = varID;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr->ispipe )
+    {
+      pipeDefRecord(pstreamptr, varID, levelID);
+    }
+  else
+#endif
+    {
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_write);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+      streamDefRecord(pstreamptr->fileID, varID, levelID);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_write);
+    }
+}
+
+
+void pstreamReadRecord(int pstreamID, double *data, int *nmiss)
+{
+  pstream_t *pstreamptr;
+
+  if ( data == NULL ) cdoAbort("Data pointer not allocated (pstreamReadRecord)!");
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr->ispipe )
+    pipeReadRecord(pstreamptr, data, nmiss);
+  else
+#endif
+    {
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_read);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+      streamReadRecord(pstreamptr->fileID, data, nmiss);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_read);
+    }
+}
+
+
+void pstreamCheckDatarange(pstream_t *pstreamptr, int varID, double *array, int nmiss)
+{
+  long i, ivals, gridsize;
+  int datatype;
+  double missval, addoffset, scalefactor;
+  double arrmin, arrmax, smin, smax;
+  double vmin = 0, vmax = 0;
+
+  gridsize    = pstreamptr->varlist[varID].gridsize;
+  datatype    = pstreamptr->varlist[varID].datatype;
+  missval     = pstreamptr->varlist[varID].missval;
+  addoffset   = pstreamptr->varlist[varID].addoffset;
+  scalefactor = pstreamptr->varlist[varID].scalefactor;
+
+  ivals   = 0;
+  arrmin  =  1.e300;
+  arrmax  = -1.e300;
+  if ( nmiss > 0 )
+    {
+      for ( i = 0; i < gridsize; ++i )
+	{
+	  if ( !DBL_IS_EQUAL(array[i], missval) )
+	    {
+	      if ( array[i] < arrmin ) arrmin = array[i];
+	      if ( array[i] > arrmax ) arrmax = array[i];
+	      ivals++;
+	    }
+	}
+    }
+  else
+    {
+      for ( i = 0; i < gridsize; ++i )
+	{
+	  if ( array[i] < arrmin ) arrmin = array[i];
+	  if ( array[i] > arrmax ) arrmax = array[i];
+	}
+      ivals = gridsize;
+    }
+
+  if ( ivals > 0 )
+    {
+      smin = (arrmin - addoffset)/scalefactor;
+      smax = (arrmax - addoffset)/scalefactor;
+
+      if ( datatype == DATATYPE_INT8  || datatype == DATATYPE_UINT8 ||
+	   datatype == DATATYPE_INT16 || datatype == DATATYPE_UINT16 )
+	{
+	  smin = NINTD(smin);
+	  smax = NINTD(smax);
+	}
+
+      if      ( datatype == DATATYPE_INT8   ) { vmin =        -128.; vmax =        127.; }
+      else if ( datatype == DATATYPE_UINT8  ) { vmin =           0.; vmax =        255.; }
+      else if ( datatype == DATATYPE_INT16  ) { vmin =      -32768.; vmax =      32767.; }
+      else if ( datatype == DATATYPE_UINT16 ) { vmin =           0.; vmax =      65535.; }
+      else if ( datatype == DATATYPE_INT32  ) { vmin = -2147483648.; vmax = 2147483647.; }
+      else if ( datatype == DATATYPE_UINT32 ) { vmin =           0.; vmax = 4294967295.; }
+      else if ( datatype == DATATYPE_FLT32  ) { vmin = -3.40282e+38; vmax = 3.40282e+38; }
+      else                                    { vmin =     -1.e+300; vmax =     1.e+300; }
+
+      if ( smin < vmin || smax > vmax )
+	cdoWarning("Some data values (min=%g max=%g) are outside the\n"
+		   "    valid range (%g - %g) of the used output precision!\n"
+		   "    Use the CDO option%s -b 64 to increase the output precision.",
+		   smin, smax, vmin, vmax, (datatype == DATATYPE_FLT32) ? "" : " -b 32 or");
+    }
+}
+
+
+void pstreamWriteRecord(int pstreamID, double *data, int nmiss)
+{
+  pstream_t *pstreamptr;
+
+  if ( data == NULL ) cdoAbort("Data pointer not allocated (pstreamWriteRecord)!");
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr->ispipe )
+    {
+      pipeWriteRecord(pstreamptr, data, nmiss);
+    }
+  else
+#endif
+    {
+      int varID = pstreamptr->varID;
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_write);
+
+      if ( pstreamptr->varlist )
+	if ( pstreamptr->varlist[varID].check_datarange )
+	  pstreamCheckDatarange(pstreamptr, varID, data, nmiss);
+
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+      streamWriteRecord(pstreamptr->fileID, data, nmiss);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_write);
+    }
+}
+
+
+void pstreamWriteRecordF(int pstreamID, float *data, int nmiss)
+{
+  pstream_t *pstreamptr;
+
+  if ( data == NULL ) cdoAbort("Data pointer not allocated (pstreamWriteRecord)!");
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr->ispipe )
+    {
+      cdoAbort("pipeWriteRecord not implemented for memtype float!");
+      //pipeWriteRecord(pstreamptr, data, nmiss);
+    }
+  else
+#endif
+    {
+      // int varID = pstreamptr->varID;
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_write);
+      /*
+      if ( pstreamptr->varlist )
+	if ( pstreamptr->varlist[varID].check_datarange )
+	  pstreamCheckDatarange(pstreamptr, varID, data, nmiss);
+      */
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+      streamWriteRecordF(pstreamptr->fileID, data, nmiss);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_write);
+    }
+}
+
+
+int pstreamInqTimestep(int pstreamID, int tsID)
+{
+  int nrecs = 0;
+  pstream_t *pstreamptr;
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr->ispipe )
+    nrecs = pipeInqTimestep(pstreamptr, tsID);
+  else
+#endif
+    {
+      extern int cdoDefaultTimeType;
+
+      if ( pstreamptr->mfiles ) tsID -= pstreamptr->tsID0;
+
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_read);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+      nrecs = streamInqTimestep(pstreamptr->fileID, tsID);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_read);
+
+      if ( nrecs == 0 && pstreamptr->mfiles &&
+	   (pstreamptr->nfiles < pstreamptr->mfiles) )
+	{
+	  size_t len;
+	  int nfile = pstreamptr->nfiles;
+	  char *filename = NULL;
+	  int fileID;
+	  int vlistIDold, vlistIDnew;
+
+	  pstreamptr->tsID0 += tsID;
+
+	  vlistIDold = vlistDuplicate(streamInqVlist(pstreamptr->fileID));
+	  streamClose(pstreamptr->fileID);
+
+	  len = strlen(pstreamptr->mfnames[nfile]);
+	  filename = (char *) malloc(len+1);
+	  strcpy(filename, pstreamptr->mfnames[nfile]);
+	  pstreamptr->nfiles++;
+
+#if  defined  (HAVE_LIBPTHREAD)
+	  if ( cdoLockIO )
+	    pthread_mutex_lock(&streamMutex);
+	  else
+	    pthread_mutex_lock(&streamOpenReadMutex);
+#endif
+	  if ( cdoVerbose ) cdoPrint("Continuation file: %s", filename);
+
+	  if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_read);
+	  fileID = streamOpenRead(filename);
+	  vlistIDnew = streamInqVlist(fileID);
+	  if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_read);
+
+	  vlistCompare(vlistIDold, vlistIDnew, CMP_HRD);
+	  vlistDestroy(vlistIDold);
+#if  defined  (HAVE_LIBPTHREAD)
+	  if ( cdoLockIO )
+	    pthread_mutex_unlock(&streamMutex);
+	  else
+	    pthread_mutex_unlock(&streamOpenReadMutex);
+#endif
+	  if ( fileID < 0 ) cdiError(fileID, "Open failed on >%s<", filename);
+
+	  free(pstreamptr->name);
+
+	  pstreamptr->name   = filename;
+	  pstreamptr->fileID = fileID;
+
+	  if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_read);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+	  nrecs = streamInqTimestep(pstreamptr->fileID, 0);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+	  if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_read);
+	}
+
+      if ( tsID == 0 && cdoDefaultTimeType != CDI_UNDEFID )
+	taxisDefType(vlistInqTaxis(pstreamptr->vlistID), cdoDefaultTimeType);
+    }
+
+  if ( nrecs && tsID != pstreamptr->tsID )
+    {
+      processDefTimesteps(pstreamID);
+      pstreamptr->tsID = tsID;
+    }
+
+  return (nrecs);
+}
+
+
+void pstreamDefTimestep(int pstreamID, int tsID)
+{
+  pstream_t *pstreamptr;
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr->ispipe )
+    pipeDefTimestep(pstreamptr, tsID);
+  else
+#endif
+    {
+      extern int cdoDefaultTimeType;
+      if ( tsID == 0 && cdoDefaultTimeType != CDI_UNDEFID )
+	{
+	  int taxisID, vlistID;
+	  vlistID = pstreamptr->vlistID;
+	  taxisID = vlistInqTaxis(vlistID);
+      	  taxisDefType(taxisID, cdoDefaultTimeType);
+	}
+
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_start(timer_write);
+      /* don't use sync -> very slow on GPFS */
+      //  if ( tsID > 0 ) streamSync(pstreamptr->fileID);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+      streamDefTimestep(pstreamptr->fileID, tsID);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+      if ( processNums() == 1 && ompNumThreads == 1 ) timer_stop(timer_write);
+    }
+}
+
+
+void pstreamCopyRecord(int pstreamIDdest, int pstreamIDsrc)
+{
+  pstream_t *pstreamptr_dest, *pstreamptr_src;
+
+  if ( PSTREAM_Debug )
+    Message("pstreamIDdest = %d  pstreamIDsrc = %d", pstreamIDdest, pstreamIDsrc);
+
+  pstreamptr_dest = pstream_to_pointer(pstreamIDdest);
+  pstreamptr_src  = pstream_to_pointer(pstreamIDsrc);
+  /*
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr_dest->ispipe || pstreamptr_src->ispipe )
+    {
+      pipeCopyRecord(pstreamptr_dest, pstreamptr_src);
+    }
+  else
+#endif
+  */
+    {
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_lock(&streamMutex);
+#endif
+      streamCopyRecord(pstreamptr_dest->fileID, pstreamptr_src->fileID);
+#if  defined  (HAVE_LIBPTHREAD)
+      if ( cdoLockIO ) pthread_mutex_unlock(&streamMutex);
+#endif
+    }
+}
+
+
+void pstreamDebug(int debug)
+{
+  PSTREAM_Debug = debug;
+}
+
+
+void cdoInitialize(void *argument)
+{
+#if defined (_OPENMP)
+  omp_set_num_threads(ompNumThreads); /* Have to be called for every module (pthread)! */
+#endif
+
+  processCreate();
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( PSTREAM_Debug )
+     Message("process %d  thread %ld", processSelf(), pthread_self());
+#endif
+
+  processDefArgument((const char*) argument);
+}
+
+
+void cdoFinish(void)
+{
+  int processID = processSelf();
+  int sindex, pstreamID;
+  int nstream;
+  INT64 nvals;
+  int nvars, ntimesteps;
+  char memstring[32] = {""};
+  double s_utime, s_stime;
+  double e_utime, e_stime;
+  double c_cputime = 0, c_usertime = 0, c_systime = 0;
+  double p_cputime = 0, p_usertime = 0, p_systime = 0;
+  pstream_t *pstreamptr;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( PSTREAM_Debug )
+    Message("process %d  thread %ld", processID, pthread_self());
+#endif
+
+  nvals = processInqNvals(processID);
+  nvars = processInqVarNum();
+  ntimesteps = processInqTimesteps();
+
+  if ( !cdoSilentMode )
+    {
+      if ( nvals > 0 )
+	{
+	  if ( sizeof(INT64) > sizeof(long) )
+#if defined (_WIN32)
+	    fprintf(stderr, "%s: Processed %I64d value%s from %d variable%s",
+#else
+	    fprintf(stderr, "%s: Processed %jd value%s from %d variable%s",
+#endif
+		    processInqPrompt(),
+		    nvals, nvals > 1 ? "s" : "",
+		    nvars, nvars > 1 ? "s" : "");
+	  else
+	    fprintf(stderr, "%s: Processed %ld value%s from %d variable%s",
+		    processInqPrompt(),
+		    (long) nvals, nvals > 1 ? "s" : "",
+		    nvars, nvars > 1 ? "s" : "");
+	}
+      else if ( nvars > 0 )
+	{
+	  fprintf(stderr, "%s: Processed %d variable%s",
+		  processInqPrompt(),
+		  nvars, nvars > 1 ? "s" : "");
+	}
+      else
+	{
+	  fprintf(stderr, "%s: ", processInqPrompt());
+	}
+
+      if ( ntimesteps > 0 )
+	fprintf(stderr, " over %d timestep%s", ntimesteps, ntimesteps > 1 ? "s" : "");
+
+      //  fprintf(stderr, ".");
+    }
+  /*
+    fprintf(stderr, "%s: Processed %d variable%s %d timestep%s.",
+	    processInqPrompt(), nvars, nvars > 1 ? "s" : "",
+	    ntimesteps, ntimesteps > 1 ? "s" : "");
+  */
+  processStartTime(&s_utime, &s_stime);
+  cdoProcessTime(&e_utime, &e_stime);
+
+  c_usertime = e_utime - s_utime;
+  c_systime  = e_stime - s_stime;
+  c_cputime  = c_usertime + c_systime;
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pthreadScope == PTHREAD_SCOPE_PROCESS )
+    {
+      c_usertime /= processNums();
+      c_systime  /= processNums();
+      c_cputime  /= processNums();
+    }
+#endif
+
+  processDefCputime(processID, c_cputime);  
+
+  processAccuTime(c_usertime, c_systime);
+
+  if ( processID == 0 )
+    {
+      int mu[] = {'b', 'k', 'm', 'g', 't'};
+      int muindex = 0;
+      long memmax;
+      extern int cdoLogOff;
+
+      memmax = memTotal();
+      while ( memmax > 9999 )
+	{
+	  memmax /= 1024;
+	  muindex++;
+	}
+
+      if ( memmax )
+	sprintf(memstring, " %ld%c ", memmax, mu[muindex]);
+
+      processEndTime(&p_usertime, &p_systime);
+      p_cputime  = p_usertime + p_systime;
+
+      if ( cdoLogOff == 0 )
+	{
+	  cdologs(processNums()); 
+	  cdologo(processNums()); 
+	  cdolog(processInqPrompt(), p_cputime); 
+	}
+    }
+
+#if defined (HAVE_SYS_TIMES_H)
+  if ( cdoBenchmark )
+    fprintf(stderr, " ( %.2fs %.2fs %.2fs %s)\n", c_usertime, c_systime, c_cputime, memstring);
+  else
+    {
+      if ( ! cdoSilentMode )
+	fprintf(stderr, " ( %.2fs )\n", c_cputime);
+    }
+
+  if ( cdoBenchmark && processID == 0 )
+    fprintf(stderr, "total: user %.2fs  sys %.2fs  cpu %.2fs  mem%s\n",
+	    p_usertime, p_systime, p_cputime, memstring);
+#else
+  fprintf(stderr, "\n");
+#endif
+
+  nstream = processInqStreamNum();
+  for ( sindex = 0; sindex < nstream; sindex++ )
+    {
+      pstreamID = processInqStreamID(sindex);
+      pstreamptr = pstream_to_pointer(pstreamID);
+      if ( PSTREAM_Debug )
+	Message("process %d  stream %d  close streamID %d",
+		processID, sindex, pstreamID);
+      if ( pstreamptr ) pstreamClose(pstreamID);
+    }
+
+  processDelete();
+}
+
+
+int pstreamInqFiletype(int pstreamID)
+{
+  int filetype;
+  pstream_t *pstreamptr;
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr->ispipe )
+    filetype = pstreamptr->filetype;
+  else
+#endif
+    filetype = streamInqFiletype(pstreamptr->fileID);
+
+  return (filetype);
+}
+
+
+int pstreamInqByteorder(int pstreamID)
+{
+  int byteorder;
+  pstream_t *pstreamptr;
+
+  pstreamptr = pstream_to_pointer(pstreamID);
+
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( pstreamptr->ispipe )
+    byteorder = pstreamptr->filetype;
+  else
+#endif
+    byteorder = streamInqByteorder(pstreamptr->fileID);
+
+  return (byteorder);
+}
+
+
+void openLock(void)
+{
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( cdoLockIO )
+    pthread_mutex_lock(&streamMutex);
+  else
+    pthread_mutex_lock(&streamOpenReadMutex);
+#endif  
+}
+
+
+void openUnlock(void)
+{
+#if  defined  (HAVE_LIBPTHREAD)
+  if ( cdoLockIO )
+    pthread_mutex_unlock(&streamMutex);
+  else
+    pthread_mutex_unlock(&streamOpenReadMutex);
+#endif
+}
diff --git a/src/pstream.h b/src/pstream.h
new file mode 100644
index 0000000..a9bf19f
--- /dev/null
+++ b/src/pstream.h
@@ -0,0 +1,67 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _PSTREAM_H
+#define _PSTREAM_H
+
+#define  streamOpenWrite          pstreamOpenWrite
+#define  streamOpenRead           pstreamOpenRead
+#define  streamOpenAppend         pstreamOpenAppend
+#define  streamClose              pstreamClose
+
+#define  streamInqFiletype        pstreamInqFiletype
+#define  streamInqByteorder       pstreamInqByteorder
+
+#define  streamInqVlist           pstreamInqVlist
+#define  streamDefVlist           pstreamDefVlist
+
+#define  streamDefTimestep        pstreamDefTimestep
+#define  streamInqTimestep        pstreamInqTimestep
+
+#define  streamDefRecord          pstreamDefRecord
+#define  streamInqRecord          pstreamInqRecord
+
+#define  streamWriteRecord        pstreamWriteRecord
+#define  streamWriteRecordF       pstreamWriteRecordF
+#define  streamReadRecord         pstreamReadRecord
+
+#define  streamCopyRecord         pstreamCopyRecord
+
+
+int     pstreamOpenWrite(const char *streamname, int filetype);
+int     pstreamOpenRead(const char *streamname);
+int     pstreamOpenAppend(const char *streamname);
+void    pstreamClose(int pstreamID);
+
+int     pstreamInqFiletype(int pstreamID);
+int     pstreamInqByteorder(int pstreamID);
+
+void    pstreamDefVlist(int pstreamID, int vlistID);
+int     pstreamInqVlist(int pstreamID);
+
+void    pstreamDefTimestep(int pstreamID, int tsID);
+int     pstreamInqTimestep(int pstreamID, int tsID);
+
+void    pstreamDefRecord(int pstreamID, int  varID, int  levelID);
+int     pstreamInqRecord(int pstreamID, int *varID, int *levelID);
+
+void    pstreamWriteRecord(int pstreamID, double *data, int nmiss);
+void    pstreamWriteRecordF(int pstreamID, float *data, int nmiss);
+void    pstreamReadRecord(int pstreamID, double *data, int *nmiss);
+void    pstreamCopyRecord(int pstreamIDdest, int pstreamIDsrc);
+
+#endif  /* _PSTREAM_H */
diff --git a/src/pstream_int.h b/src/pstream_int.h
new file mode 100644
index 0000000..f2561b2
--- /dev/null
+++ b/src/pstream_int.h
@@ -0,0 +1,26 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _PSTREAM_INT_H
+#define _PSTREAM_INT_H
+
+#include "pipe.h"
+
+void  pstreamDebug(int debug);
+int   pstreamIsPipe(int streamID);
+
+#endif  /* _PSTREAM_INT_H */
diff --git a/src/pthread_debug.c b/src/pthread_debug.c
new file mode 100644
index 0000000..9063e71
--- /dev/null
+++ b/src/pthread_debug.c
@@ -0,0 +1,241 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+
+
+
+#if  defined  (HAVE_LIBPTHREAD)
+#include <pthread.h>
+#include <errno.h>
+#include "error.h"
+
+
+#define POUT2(caller, x, a, b)     pout2(caller, #x, x, #a, a, #b, b)
+#define POUT3(caller, x, a, b, c)  pout3(caller, #x, x, #a, a, #b, b, #c, c)
+
+
+static void pout2(const char *caller,
+		  const char *sval, int ival, 
+		  const char *sval1, int oval1,
+		  const char *sval2, int oval2)
+{
+  if ( ival == oval1 )
+    fprintf(stderr, "%-18s :  %-14s = %s\n", caller, sval, sval1);
+  else if ( ival == oval2 )
+    fprintf(stderr, "%-18s :  %-14s = %s\n", caller, sval, sval2);
+  else
+    fprintf(stderr, "%-18s :  %-14s = %d\n", caller, sval, ival);
+}
+
+
+static void pout3(const char *caller,
+		  const char *sval, int ival, 
+		  const char *sval1, int oval1,
+		  const char *sval2, int oval2,
+		  const char *sval3, int oval3)
+{
+  if ( ival == oval1 )
+    fprintf(stderr, "%-18s :  %-14s = %s\n", caller, sval, sval1);
+  else if ( ival == oval2 )
+    fprintf(stderr, "%-18s :  %-14s = %s\n", caller, sval, sval2);
+  else if ( ival == oval3 )
+    fprintf(stderr, "%-18s :  %-14s = %s\n", caller, sval, sval3);
+  else
+    fprintf(stderr, "%-18s :  %-14s = %d\n", caller, sval, ival);
+}
+
+
+void print_pthread_attr(const char *caller, pthread_attr_t *attr)
+{
+  struct sched_param param;
+  int detachstate, policy, inherit, scope, priority;
+  size_t stacksize;
+
+  pthread_attr_getdetachstate(attr, &detachstate);
+  POUT2(caller, detachstate, PTHREAD_CREATE_JOINABLE, PTHREAD_CREATE_DETACHED);
+
+#if defined (SCHED_FIFO)
+  pthread_attr_getschedpolicy(attr, &policy);
+  POUT3(caller, policy, SCHED_FIFO, SCHED_RR, SCHED_OTHER);
+  pthread_attr_getschedparam(attr, &param);
+  priority = param.sched_priority;
+  fprintf(stderr, "%-18s :  %-14s = %d\n", caller, "priority", priority);
+#endif
+
+#if defined (PTHREAD_INHERIT_SCHED)
+  pthread_attr_getinheritsched(attr, &inherit);
+  POUT2(caller, inherit, PTHREAD_INHERIT_SCHED, PTHREAD_EXPLICIT_SCHED);
+#endif
+
+  pthread_attr_getscope(attr, &scope);
+  POUT2(caller, scope, PTHREAD_SCOPE_SYSTEM, PTHREAD_SCOPE_PROCESS);
+
+  pthread_attr_getstacksize(attr, &stacksize);
+  fprintf(stderr, "%-18s :  %-14s = %ld\n", caller, "stacksize", (long) stacksize);
+}
+
+
+void print_pthread_mutexattr(const char *caller,  pthread_mutexattr_t *m_attr)
+{
+  /*
+#if defined (_POSIX_THREAD_PRIO_PROTECT) && defined (_POSIX_THREAD_PRIO_INHERIT)
+  {
+  int protocol;
+  pthread_mutexattr_getprotocol(m_attr, &protocol);
+  POUT3(caller, protocol, PTHREAD_PRIO_INHERIT, PTHREAD_PRIO_PROTECT, PTHREAD_PRIO_NONE);
+  }
+#endif
+  */
+#if defined (PTHREAD_MUTEX_FAST_NP)
+  {
+  int kind;
+  pthread_mutexattr_getkind_np(m_attr, &kind);
+  POUT3(caller, kind, PTHREAD_MUTEX_FAST_NP, PTHREAD_MUTEX_RECURSIVE_NP, PTHREAD_MUTEX_ERRORCHECK_NP);
+  }
+#endif
+
+#if defined (_POSIX_THREAD_PROCESS_SHARED)
+  {
+  int pshared;
+  pthread_mutexattr_getpshared(m_attr, &pshared);
+  POUT2(caller, pshared, PTHREAD_PROCESS_SHARED, PTHREAD_PROCESS_PRIVATE);
+  }
+#endif
+}
+
+
+void print_pthread_condattr(const char *caller, pthread_condattr_t *c_attr)
+{
+#if defined (_POSIX_THREAD_PROCESS_SHARED)
+  {
+  int pshared;
+  pthread_condattr_getpshared(c_attr, &pshared);
+  POUT2(caller, pshared, PTHREAD_PROCESS_SHARED, PTHREAD_PROCESS_PRIVATE);
+  }
+#endif
+}
+
+
+int PTHREAD_Debug = 0;
+
+
+void Pthread_debug(int debug)
+{
+  PTHREAD_Debug = debug;
+}
+
+
+int Pthread_create(const char *caller, pthread_t *th,
+		   pthread_attr_t *attr, void * (*start_routine)(void *), void *arg)
+{
+  int status;
+
+  if ( PTHREAD_Debug ) Message("+%s", __func__);
+
+  if ( PTHREAD_Debug )
+    {
+      Message("+%s attributes:", __func__);
+      if ( attr )
+	print_pthread_attr(__func__, attr);
+      else
+	Message("  default attributes");
+    }
+
+  status = pthread_create(th, attr, start_routine, arg);
+
+  //if ( PTHREAD_Debug ) Message("-%s (thID = %ld, status = %d)", __func__, (long) *th, status);
+
+  return (status);
+}
+
+
+int Pthread_join(const char *caller, pthread_t th, void **thread_return)
+{
+  int status;
+
+  //  if ( PTHREAD_Debug ) Message("+%s (thID = %ld)", __func__, (void *) th);
+
+  status = pthread_join(th, thread_return);
+
+  // if ( PTHREAD_Debug ) Message("-%s (thID = %ld, status = %d)", __func__, (void *) th, status);
+
+  return (status);
+}
+
+
+void Pthread_mutex_lock(const char *caller, pthread_mutex_t *mutex)
+{
+  int status;
+
+  if ( PTHREAD_Debug ) Message("+%s (mutex = %p)", __func__, (void *) mutex);
+
+  status = pthread_mutex_lock(mutex);
+  if ( status != 0 )
+    {
+      switch (status)
+	{
+	case EINVAL:
+	  Error("The mutex has not been properly initialized!");
+	  break;
+	case EDEADLK:
+	  Error("The mutex is already locked by the calling thread!");
+	  break;
+	default:
+	  Error("Status %d unknown!", status, (void *) mutex);
+	}
+    }
+
+  if ( PTHREAD_Debug ) Message("-%s (mutex = %p)", __func__, (void *) mutex);
+}
+
+
+void Pthread_mutex_unlock(const char *caller, pthread_mutex_t *mutex)
+{
+  int status;
+
+  if ( PTHREAD_Debug ) Message("+%s (mutex = %p)", __func__, (void *) mutex);
+
+  status = pthread_mutex_unlock(mutex);
+  if ( status != 0 )
+    {
+      switch (status)
+	{
+	case EINVAL:
+	  Error("The mutex has not been properly initialized!");
+	  break;
+	case EPERM:
+	  Error("The calling thread does not own the mutex!");
+	  break;
+	default:
+	  Error("Status %d unknown!", status);
+	}
+    }
+
+  if ( PTHREAD_Debug ) Message("-%s (mutex = %p)", __func__, (void *) mutex);
+}
+
+
+void Pthread_cond_signal(const char *caller, pthread_cond_t *cond)
+{
+  if ( PTHREAD_Debug ) Message("+%s (cond = %p)", __func__, (void *) cond);
+
+  pthread_cond_signal(cond);
+
+  if ( PTHREAD_Debug ) Message("-%s (cond = %p)", __func__, (void *) cond);
+}
+
+
+void Pthread_cond_wait(const char *caller, pthread_cond_t *cond, pthread_mutex_t *mutex)
+{
+  if ( PTHREAD_Debug ) Message("+%s (cond = %p, mutex =  %p)",
+			       __func__, (void *) cond, (void *) mutex);
+
+  pthread_cond_wait(cond, mutex);
+
+  if ( PTHREAD_Debug ) Message("-%s (cond = %p, mutex = %p)",
+			       __func__, (void *) cond, (void *) mutex);
+}
+
+#endif
diff --git a/src/pthread_debug.h b/src/pthread_debug.h
new file mode 100644
index 0000000..9ca4f64
--- /dev/null
+++ b/src/pthread_debug.h
@@ -0,0 +1,31 @@
+#ifndef _PTHREAD_DEBUG_H
+#define _PTHREAD_DEBUG_H
+
+void Pthread_debug(int debug);
+
+int Pthread_create(const char *caller, pthread_t *th,
+		   pthread_attr_t *attr, void * (*start_routine)(void *), void *arg);
+
+int Pthread_join(const char *caller, pthread_t th, void **thread_return);
+
+void Pthread_mutex_lock(const char *caller, pthread_mutex_t *mutex);
+void Pthread_mutex_unlock(const char *caller, pthread_mutex_t *mutex);
+
+void Pthread_cond_signal(const char *caller, pthread_cond_t *cond);
+void Pthread_cond_wait(const char *caller, pthread_cond_t *cond, pthread_mutex_t *mutex);
+
+void print_pthread_attr(const char *caller, pthread_attr_t *attr);
+void print_pthread_mutexattr(const char *caller,  pthread_mutexattr_t *m_attr);
+void print_pthread_condattr(const char *caller, pthread_condattr_t *c_attr);
+
+
+#define  pthread_create(a, b, c, d)    Pthread_create(__func__, a, b, c, d)
+#define  pthread_join(a, b)            Pthread_join(__func__, a, b)
+
+#define  pthread_mutex_lock(a)         Pthread_mutex_lock(__func__, a)
+#define  pthread_mutex_unlock(a)       Pthread_mutex_unlock(__func__, a)
+
+#define  pthread_cond_signal(a)        Pthread_cond_signal(__func__, a)
+#define  pthread_cond_wait(a, b)       Pthread_cond_wait(__func__, a, b)
+
+#endif  /* _PTHREAD_DEBUG_H */
diff --git a/src/readline.c b/src/readline.c
new file mode 100644
index 0000000..82a7b97
--- /dev/null
+++ b/src/readline.c
@@ -0,0 +1,40 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <stdio.h>
+
+int readline(FILE *fp, char *line, int len)
+{
+  int ichar, ipos = 0;
+
+  while ( (ichar = fgetc(fp)) != EOF )
+    {
+      if ( ichar == '\r' ) break;
+      if ( ichar == '\n' ) break;
+      line[ipos++] = ichar;
+      if ( ipos >= len )
+	{
+	  fprintf(stderr, "readline Warning: end of line not found (maxlen = %d)!\n", len);
+	  break;
+	}
+    }
+  line[ipos] = 0;
+
+  if ( feof(fp) && ipos == 0 ) return (0);
+
+  return (1);
+}
diff --git a/src/realtime.c b/src/realtime.c
new file mode 100644
index 0000000..eb4bb23
--- /dev/null
+++ b/src/realtime.c
@@ -0,0 +1,248 @@
+/* Portable CPU-timer (User + Sys); also WALL CLOCK-timer */
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <unistd.h>
+#include <time.h>
+#include <sys/types.h>
+#include <sys/time.h>
+#if defined (HAVE_SYS_TIMES_H)
+#include <sys/times.h>
+#endif
+/* #include <sys/param.h> */
+#ifdef __XT3__
+#include <catamount/dclock.h>
+#endif
+
+#ifdef __XT3__
+static double clock0 = -1.0;
+#endif
+
+/* extern clock_t times (struct tms *buffer); */
+#define clock_ticks ( (double) sysconf(_SC_CLK_TCK) )
+
+int util_cputime(double *user_time, double *system_time)
+{
+#ifdef __XT3__
+  *user_time   = dclock()-clock0;
+  *system_time = (double) 0;
+#else
+#if defined (HAVE_SYS_TIMES_H)
+  struct tms tbuf;
+  if (times(&tbuf) == ((clock_t)-1)) return ((int) (-1)); 
+
+  *user_time   = ((double) tbuf.tms_utime) / clock_ticks; 
+  *system_time = ((double) tbuf.tms_stime) / clock_ticks;
+#else
+  *user_time   = 0; 
+  *system_time = 0;
+#endif
+#endif
+
+  return (0);
+}
+
+double util_walltime(void)
+{
+  double time_in_secs = 0;
+#if defined (HAVE_SYS_TIMES_H)
+  static double time_init = 0.;
+
+  struct timeval tbuf;
+  if (gettimeofday(&tbuf,NULL) == -1) perror("UTIL_WALLTIME");
+
+  if (time_init == 0.) time_init =
+    (double) tbuf.tv_sec + (tbuf.tv_usec / 1000000.0);
+
+  time_in_secs =
+  (double) tbuf.tv_sec + (tbuf.tv_usec / 1000000.0) - time_init;
+#endif
+
+  return (time_in_secs);
+}
+ 
+/****************************************************************************/
+
+#ifdef _AIX
+
+/*
+ * High-Resolution Time
+ * pwr4: measurement (util_read_real_time) overhead ~ 0.07 us
+ *       conversion  (util_diff_real_time) overhead ~ 0.3 us
+ */
+
+#include <sys/systemcfg.h>
+
+static double aix_rt_tconv, aix_rt_fhigh;
+
+void util_init_real_time(void)
+{
+  double tb_top, tb_bot;
+
+  if (_system_configuration.implementation == POWER_RS2) {
+    aix_rt_fhigh = 1.0;
+    aix_rt_tconv = 1.0;
+  } else  {
+    /* powerpc family */ 
+    aix_rt_fhigh = 4.294967296;
+    tb_top = (double) _system_configuration.Xint;
+    tb_bot = (double) _system_configuration.Xfrac;
+    aix_rt_tconv = tb_top/tb_bot; 
+  }
+}
+
+void util_get_real_time_size(int *rt_size) 
+{ 
+  /* fortran out:  integer*4:: rt_size(4) */
+  *rt_size = (int) sizeof(struct timebasestruct);
+}
+
+void util_read_real_time(void *it) 
+{ 
+  /* fortran out:  integer*4:: it(4)
+   * raw values - not yet scaled to real time
+   */
+  read_real_time( (struct timebasestruct*) it, TIMEBASE_SZ );
+}
+
+void util_diff_real_time(void *it1, void *it2, double *t) 
+{
+  /* fortran in:  integer*4:: it1(4), it2(4)
+   * fortran out: real*8:: t
+   * t is the real time diff between measurements it1 and it2
+   */
+  
+  struct timebasestruct *tb1, *tb2;
+  
+  tb1 = (struct timebasestruct *) it1;
+  tb2 = (struct timebasestruct *) it2;
+  
+  *t = aix_rt_tconv*(aix_rt_fhigh*( (double) (tb2->tb_high - tb1->tb_high) ) 
+      +1.0e-9*( (double)tb2->tb_low - (double)tb1->tb_low ));
+} 
+
+#elif defined (_HIGH_RESOLUTION_TIMER) && (defined (SX) || defined (ES)) 
+
+#define CPU_CLOCK 2.0e-9    /* SX-6: 500 MHz */
+
+long long int irtc(void);   /* provided as assembler routine */   
+
+void util_init_real_time() 
+{
+}
+
+void util_get_real_time_size(int *rt_size) 
+{ 
+  *rt_size = (int) sizeof(double);
+}
+
+void util_read_real_time(void *it) 
+{ 
+  double *t;
+  t = (double *) it;
+  *t = CPU_CLOCK*irtc();
+}
+
+void util_diff_real_time(void *it1, void *it2, double *t) 
+{
+  double *t1, *t2;
+  t1 = (double*) it1;
+  t2 = (double*) it2;
+  *t = *t2 - *t1;
+} 
+
+#elif defined (_HIGH_RESOLUTION_TIMER) && defined (LINUX)
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <asm/msr.h>
+
+static double cpu_clock;
+
+void util_init_real_time() 
+{
+  double freq = 0.0;
+  FILE *cpuinfo;
+  char line[256];
+  
+  if ((cpuinfo = fopen ("/proc/cpuinfo", "r")) == NULL) {
+    fprintf (stderr, "Couldn't open /proc/cpuinfo ...\n");
+    exit(-1);
+  }
+
+  while (! feof(cpuinfo)) {
+    (void) fgets (line, 255, cpuinfo);
+    if (strstr(line, "cpu MHz") != NULL) {
+      sscanf (line, "cpu MHz         : %lf", &freq);
+      break;
+    }
+  }
+  if (freq == 0.0) {
+    fprintf (stderr, "Couldn't find cpu MHz in /proc/cpuinfo ...\n");
+    exit(-1);
+  }
+
+  cpu_clock = freq*10e6;
+}
+
+void util_get_real_time_size(int *rt_size)
+{ 
+  *rt_size = (int) sizeof(double);
+}
+
+void util_read_real_time(void *it)
+{ 
+  long long llt;
+  double *t;
+  t = (double *) it;
+  rdtscll(llt);
+  *t = (double) llt/cpu_freq;
+}
+
+void util_diff_real_time(void *it1, void *it2, double *t)
+{
+  double *t1, *t2;
+  t1 = (double*) it1;
+  t2 = (double*) it2;
+  *t = *t2 - *t1;
+} 
+
+#else
+
+/* fall back to util_walltime */
+
+void util_init_real_time(void)
+{
+}
+
+void util_get_real_time_size(int *rt_size)
+{ 
+  *rt_size = (int) sizeof(double);
+}
+
+void util_read_real_time(void *it)
+{ 
+  double *t;
+  t = (double *) it;
+  *t=util_walltime();
+}
+
+void util_diff_real_time(void *it1, void *it2, double *t)
+{
+  double *t1, *t2;
+  t1 = (double*) it1;
+  t2 = (double*) it2;
+  *t = *t2 - *t1;
+} 
+
+#endif
+
+
+
+
+
diff --git a/src/remap.h b/src/remap.h
new file mode 100644
index 0000000..22637aa
--- /dev/null
+++ b/src/remap.h
@@ -0,0 +1,186 @@
+#if defined (_OPENMP)
+#include <omp.h>
+#endif
+
+#define  RESTR_TYPE  int  /* restrict data types: 0 -> double, float; 1 -> int */
+
+typedef RESTR_TYPE restr_t;
+/*
+#if RESTR_TYPE == int
+#  define RESTR_SCALE(x) ((int) (0.5+100000000*(x)))
+#  define RESTR_ABS(x)   abs(x)
+#else
+#  define RESTR_SCALE(x) (x)
+#  define RESTR_ABS(x)   fabs(x)
+#endif
+*/
+
+#  define RESTR_SFAC     100000000
+#  define RESTR_SCALE(x) ((int) (0.5+RESTR_SFAC*(x)))
+#  define RESTR_ABS(x)   abs(x)
+/*
+#  define RESTR_SFAC     1.
+#  define RESTR_SCALE(x) (x)
+#  define RESTR_ABS(x)   fabs(x)
+*/
+
+#define TINY_FRAC 1.e-10
+
+#define  NORM_OPT_NONE      1
+#define  NORM_OPT_DESTAREA  2
+#define  NORM_OPT_FRACAREA  3
+
+#define  MAP_TYPE_CONSERV   1
+#define  MAP_TYPE_BILINEAR  2
+#define  MAP_TYPE_BICUBIC   3
+#define  MAP_TYPE_DISTWGT   4
+#define  MAP_TYPE_DISTWGT1  5
+
+#define  SUBMAP_TYPE_NONE   0
+#define  SUBMAP_TYPE_LAF    1
+#define  SUBMAP_TYPE_SUM    2
+
+#define  RESTRICT_LATITUDE  1
+#define  RESTRICT_LATLON    2
+
+
+typedef struct {
+  int      pinit;            /* TRUE if the pointers are initialized     */
+  int      gridID1;
+  int      gridID2;
+  int      store_link_fast;
+  int      lextrapolate;
+  int      non_global;
+  int      grid1_is_cyclic, grid2_is_cyclic;
+  long     grid1_size, grid2_size; /* total points on each grid */
+  int      grid1_rank, grid2_rank; /* rank of each grid */
+  long     grid1_corners, grid2_corners; /* number of corners for each grid cell */
+
+  int      grid1_dims[2], grid2_dims[2]; /* size of each grid dimension */
+
+  int      grid1_nvgp;         /* size of grid1_vgpm           */
+  int     *grid1_vgpm;         /* flag which cells are valid   */
+
+  int      grid2_nvgp;         /* size of grid2_vgpm           */
+  int     *grid2_vgpm;         /* flag which cells are valid   */
+
+  int     *grid1_mask;         /* flag which cells participate */
+  int     *grid2_mask;         /* flag which cells participate */
+
+  double  *grid1_center_lat;   /* lat/lon coordinates for      */
+  double  *grid1_center_lon;   /* each grid center in radians  */
+  double  *grid2_center_lat; 
+  double  *grid2_center_lon;
+  double  *grid1_area;         /* tot area of each grid1 cell     */
+  double  *grid2_area;         /* tot area of each grid2 cell     */
+  /* double  *grid1_area_in; */     /* area of grid1 cell from file    */
+  /* double  *grid2_area_in; */     /* area of grid2 cell from file    */
+  double  *grid1_frac;         /* fractional area of grid cells   */
+  double  *grid2_frac;         /* participating in remapping      */
+
+  double  *grid1_corner_lat;   /* lat/lon coordinates for         */
+  double  *grid1_corner_lon;   /* each grid corner in radians     */
+  double  *grid2_corner_lat; 
+  double  *grid2_corner_lon;
+
+  int      lneed_grid1_corners;
+  int      lneed_grid2_corners;
+  int      luse_grid1_corners;  /* use corners for bounding boxes  */
+  int      luse_grid2_corners;  /* use corners for bounding boxes  */
+  /* int      luse_grid1_area;   */ /* use area from grid file         */
+  /* int      luse_grid2_area;   */ /* use area from grid file         */
+
+  restr_t *grid1_bound_box;    /* lat/lon bounding box for use    */
+  restr_t *grid2_bound_box;    /* in restricting grid searches    */
+
+  double   threshhold;         /* threshold for coord transformation */
+  int      restrict_type;
+  int      num_srch_bins;      /* num of bins for restricted srch */
+
+  int     *bin_addr1;       /* min,max adds for grid1 cells in this lat bin  */
+  int     *bin_addr2;       /* min,max adds for grid2 cells in this lat bin  */
+
+  restr_t *bin_lats;        /* min,max latitude for each search bin   */
+  restr_t *bin_lons;        /* min,max longitude for each search bin  */
+}
+remapgrid_t;
+
+typedef struct {
+  int   option;
+  int   max_links;
+  int   num_blks;
+  int  *num_links;
+  int **src_add;
+  int **dst_add;
+  int **w_index;
+}
+remaplink_t;
+
+typedef struct {
+  int   pinit;            /* TRUE if the pointers are initialized     */
+  long  max_links;        /* current size of link arrays              */
+  long  num_links;        /* actual number of links for remapping     */
+  long  num_wts;          /* num of weights used in remapping         */
+  int   map_type;         /* identifier for remapping method          */
+  int   norm_opt;         /* option for normalization (conserv only)  */
+  int   resize_increment; /* default amount to increase array size    */
+
+  int  *grid1_add;        /* grid1 address for each link              */
+  int  *grid2_add;        /* grid2 address for each link              */
+
+  double *wts;            /* map weights for each link [max_links*num_wts] */
+
+  remaplink_t  links;
+}
+remapvars_t;
+
+typedef struct {
+  int gridID;
+  int gridsize;
+  int nmiss;
+  remapgrid_t grid;
+  remapvars_t vars;
+}
+remap_t;
+
+void remap_set_max_iter(long max_iter);
+
+void remapGridInit(int map_type, int lextrapolate, int gridID1, int gridID2, remapgrid_t *rg);
+void remapVarsInit(int map_type, remapgrid_t *rg, remapvars_t *rv);
+
+void remapVarsFree(remapvars_t *rv);
+void remapGridFree(remapgrid_t *rg);
+
+void remap(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict map_wts, 
+	   long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array, 
+	   const double *restrict src_grad1, const double *restrict src_grad2, const double *restrict src_grad3,
+	   remaplink_t links);
+
+void remap_laf(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict map_wts,
+	       long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array);
+
+void remap_sum(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict map_wts,
+	       long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array);
+
+void remap_bilin(remapgrid_t *rg, remapvars_t *rv);
+void remap_bicub(remapgrid_t *rg, remapvars_t *rv);
+void remap_conserv(remapgrid_t *rg, remapvars_t *rv);
+void remap_distwgt(remapgrid_t *rg, remapvars_t *rv);
+void remap_distwgt1(remapgrid_t *rg, remapvars_t *rv);
+
+void resize_remap_vars(remapvars_t *rv, int increment);
+
+void remap_stat(int remap_order, remapgrid_t rg, remapvars_t rv, const double *restrict array1, 
+		const double *restrict array2, double missval);
+void remap_gradients(remapgrid_t rg, const double *restrict array, double *restrict grad1_lat,
+		     double *restrict grad1_lon, double *restrict grad1_latlon);
+
+void reorder_links(remapvars_t *rv);
+
+void sort_add(long num_links, long num_wts, int *restrict add1, int *restrict add2, double *restrict weights);
+void sort_iter(long num_links, long num_wts, int *restrict add1, int *restrict add2, double *restrict weights, int parent);
+
+void write_remap_scrip(const char *interp_file, int map_type, int submap_type, 
+		       int remap_order, remapgrid_t rg, remapvars_t rv);
+void read_remap_scrip(const char *interp_file, int gridID1, int gridID2, int *map_type, int *submap_type,
+		      int *remap_order, remapgrid_t *rg, remapvars_t *rv);
diff --git a/src/remaplib.c b/src/remaplib.c
new file mode 100644
index 0000000..740bc02
--- /dev/null
+++ b/src/remaplib.c
@@ -0,0 +1,6489 @@
+/*
+  This is a C library of the Fortran SCRIP version 1.4
+
+  ===>>> Please send bug reports to Uwe.Schulzweida at zmaw.de <<<===
+
+  Spherical Coordinate Remapping and Interpolation Package (SCRIP)
+  ================================================================
+
+  SCRIP is a software package which computes addresses and weights for
+  remapping and interpolating fields between grids in spherical coordinates.
+  It was written originally for remapping fields to other grids in a coupled
+  climate model, but is sufficiently general that it can be used in other 
+  applications as well. The package should work for any grid on the surface
+  of a sphere. SCRIP currently supports four remapping options:
+
+  Conservative remapping
+  ----------------------
+  First- and second-order conservative remapping as described in
+  Jones (1999, Monthly Weather Review, 127, 2204-2210).
+
+  Bilinear interpolation
+  ----------------------
+  Slightly generalized to use a local bilinear approximation
+  (only logically-rectangular grids).
+
+  Bicubic interpolation
+  ----------------------
+  Similarly generalized (only logically-rectangular grids).
+
+  Distance-weighted averaging
+  ---------------------------
+  Distance-weighted average of a user-specified number of nearest neighbor values.
+
+  Documentation
+  =============
+
+  http://climate.lanl.gov/Software/SCRIP/SCRIPusers.pdf
+
+*/
+/*
+  2012-01-16 Uwe Schulzweida: alloc grid2_bound_box only for conservative remapping
+  2011-01-07 Uwe Schulzweida: Changed remap weights from 2D to 1D array
+  2009-05-25 Uwe Schulzweida: Changed restrict data type from double to int
+  2009-01-11 Uwe Schulzweida: OpenMP parallelization
+ */
+
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <limits.h>
+#include <time.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "grid.h"
+#include "remap.h"
+#include "util.h"  /* progressStatus */
+
+
+/* used for store_link_fast */
+
+#define BLK_SIZE 4096
+#define BLK_NUM(x) (x/grid_store->blk_size)
+#define BLK_IDX(x) (x%grid_store->blk_size)
+struct grid_layer
+{
+  int *grid2_link;
+  struct grid_layer *next;
+};
+
+typedef struct grid_layer grid_layer_t;
+
+typedef struct
+{
+  int blk_size;
+  int max_size;
+  int nblocks;
+  int *blksize;
+  int *nlayers;
+  grid_layer_t **layers;
+} grid_store_t;
+
+
+/* constants */
+
+/* #define  BABY_STEP  0.001 */ /* original value */
+#define  BABY_STEP  0.001
+
+#define  ZERO     0.0
+#define  ONE      1.0
+#define  TWO      2.0
+#define  THREE    3.0
+#define  HALF     0.5
+#define  QUART    0.25
+#define  BIGNUM   1.e+20
+#define  TINY     1.e-14
+#define  PI       M_PI
+#define  PI2      TWO*PI
+#define  PIH      HALF*PI
+
+
+/* static double north_thresh =  1.45;  */ /* threshold for coord transformation */
+/* static double south_thresh = -2.00;  */ /* threshold for coord transformation */
+static double north_thresh =  2.00;  /* threshold for coord transformation */
+static double south_thresh = -2.00;  /* threshold for coord transformation */
+
+double intlin(double x, double y1, double x1, double y2, double x2);
+
+extern int timer_remap, timer_remap_con, timer_remap_con_l1, timer_remap_con_l2;
+extern int timer_remap_bil, timer_remap_nn;
+
+
+void remapGridFree(remapgrid_t *rg)
+{
+  if ( rg->pinit == TRUE )
+    {
+      rg->pinit = FALSE;
+
+      if ( rg->grid1_vgpm ) free(rg->grid1_vgpm);
+      if ( rg->grid2_vgpm ) free(rg->grid2_vgpm);
+      free(rg->grid1_mask);
+      free(rg->grid2_mask);
+      free(rg->grid1_center_lat);
+      free(rg->grid1_center_lon);
+      free(rg->grid2_center_lat);
+      free(rg->grid2_center_lon);
+      if ( rg->grid1_area ) free(rg->grid1_area);
+      if ( rg->grid2_area ) free(rg->grid2_area);
+      if ( rg->grid1_frac ) free(rg->grid1_frac);
+      if ( rg->grid2_frac ) free(rg->grid2_frac);
+
+      if ( rg->grid1_corner_lat ) free(rg->grid1_corner_lat);
+      if ( rg->grid1_corner_lon ) free(rg->grid1_corner_lon);
+      if ( rg->grid2_corner_lat ) free(rg->grid2_corner_lat);
+      if ( rg->grid2_corner_lon ) free(rg->grid2_corner_lon);
+
+      if ( rg->grid1_bound_box ) free(rg->grid1_bound_box);
+      if ( rg->grid2_bound_box ) free(rg->grid2_bound_box);
+
+      free(rg->bin_addr1);
+      free(rg->bin_addr2);
+      if ( rg->bin_lats ) free(rg->bin_lats);
+      if ( rg->bin_lons ) free(rg->bin_lons);
+    }
+  else
+    fprintf(stderr, "%s Warning: grid not initialized!\n", __func__);
+
+} /* remapGridFree */
+
+/*****************************************************************************/
+
+void remapVarsFree(remapvars_t *rv)
+{
+  long i, num_blks;
+
+  if ( rv->pinit == TRUE )
+    {
+      rv->pinit = FALSE;
+
+      free(rv->grid1_add);
+      free(rv->grid2_add);
+      free(rv->wts);
+
+      if ( rv->links.option == TRUE )
+	{
+	  rv->links.option = FALSE;
+
+	  if ( rv->links.num_blks )
+	    {
+	      free(rv->links.num_links);
+	      num_blks = rv->links.num_blks;
+	      for ( i = 0; i < num_blks; ++i )
+		{
+		  free(rv->links.src_add[i]);
+		  free(rv->links.dst_add[i]);
+		  free(rv->links.w_index[i]);
+		}
+	      free(rv->links.src_add);
+	      free(rv->links.dst_add);
+	      free(rv->links.w_index);
+	    }
+	}
+    }
+  else
+    fprintf(stderr, "%s Warning: vars not initialized!\n", __func__);
+
+} /* remapVarsFree */
+
+/*****************************************************************************/
+
+void genXbounds(long xsize, long ysize, const double *restrict grid_center_lon, 
+		double *restrict grid_corner_lon, double dlon)
+{
+  long i, j, index;
+  double minlon, maxlon;
+
+  if ( ! (dlon > 0) ) dlon = 360./xsize;
+  /*
+  if ( xsize == 1 || (grid_center_lon[xsize-1]-grid_center_lon[0]+dlon) < 359 )
+    cdoAbort("Cannot calculate Xbounds for %d vals with dlon = %g", xsize, dlon);
+  */
+  for ( i = 0; i < xsize; ++i )
+    {
+      minlon = grid_center_lon[i] - HALF*dlon;
+      maxlon = grid_center_lon[i] + HALF*dlon;
+      for ( j = 0; j < ysize; ++j )
+	{
+	  index = (j<<2)*xsize + (i<<2);
+	  grid_corner_lon[index  ] = minlon;
+	  grid_corner_lon[index+1] = maxlon;
+	  grid_corner_lon[index+2] = maxlon;
+	  grid_corner_lon[index+3] = minlon;
+	}
+    }
+}
+
+
+double genYmin(double y1, double y2)
+{
+  double ymin, dy;
+
+  dy = y2 - y1;
+  ymin = y1 - dy/2;
+
+  if ( y1 < -85 && ymin < -87.5 ) ymin = -90;
+
+  if ( cdoVerbose )
+    cdoPrint("genYmin: y1 = %g  y2 = %g  dy = %g  ymin = %g", y1, y2, dy, ymin);
+
+  return (ymin);
+}
+
+
+double genYmax(double y1, double y2)
+{
+  double ymax, dy;
+
+  dy = y1 - y2;
+  ymax = y1 + dy/2;
+
+  if ( y1 > 85 && ymax > 87.5 ) ymax = 90;
+
+  if ( cdoVerbose )
+    cdoPrint("genYmax: y1 = %g  y2 = %g  dy = %g  ymax = %g", y1, y2, dy, ymax);
+
+  return (ymax);
+}
+
+
+
+/*****************************************************************************/
+
+void genYbounds(long xsize, long ysize, const double *restrict grid_center_lat,
+		double *restrict grid_corner_lat)
+{
+  long i, j, index;
+  double minlat, maxlat;
+  double firstlat, lastlat;
+
+  firstlat = grid_center_lat[0];
+  lastlat  = grid_center_lat[xsize*ysize-1];
+
+  // if ( ysize == 1 ) cdoAbort("Cannot calculate Ybounds for 1 value!");
+
+  for ( j = 0; j < ysize; ++j )
+    {
+      if ( ysize == 1 )
+	{
+	  minlat = grid_center_lat[0] - 360./ysize;
+	  maxlat = grid_center_lat[0] + 360./ysize;
+	}
+      else
+	{
+	  index = j*xsize;
+	  if ( firstlat > lastlat )
+	    {
+	      if ( j == 0 )
+		maxlat = genYmax(grid_center_lat[index], grid_center_lat[index+xsize]);
+	      else
+		maxlat = 0.5*(grid_center_lat[index]+grid_center_lat[index-xsize]);
+
+	      if ( j == (ysize-1) )
+		minlat = genYmin(grid_center_lat[index], grid_center_lat[index-xsize]);
+	      else
+		minlat = 0.5*(grid_center_lat[index]+grid_center_lat[index+xsize]);
+	    }
+	  else
+	    {
+	      if ( j == 0 )
+		minlat = genYmin(grid_center_lat[index], grid_center_lat[index+xsize]);
+	      else
+		minlat = 0.5*(grid_center_lat[index]+grid_center_lat[index-xsize]);
+
+	      if ( j == (ysize-1) )
+		maxlat = genYmax(grid_center_lat[index], grid_center_lat[index-xsize]);
+	      else
+		maxlat = 0.5*(grid_center_lat[index]+grid_center_lat[index+xsize]);
+	    }
+	}
+
+      for ( i = 0; i < xsize; ++i )
+	{
+	  index = (j<<2)*xsize + (i<<2);
+	  grid_corner_lat[index  ] = minlat;
+	  grid_corner_lat[index+1] = minlat;
+	  grid_corner_lat[index+2] = maxlat;
+	  grid_corner_lat[index+3] = maxlat;
+	}
+    }
+}
+
+/*****************************************************************************/
+
+void remapGridInitPointer(remapgrid_t *rg)
+{
+  rg->pinit = TRUE;
+
+  rg->grid1_nvgp       = 0;
+  rg->grid2_nvgp       = 0;
+  
+  rg->grid1_vgpm       = NULL;
+  rg->grid2_vgpm       = NULL;
+
+  rg->grid1_mask       = NULL;
+  rg->grid2_mask       = NULL;
+  rg->grid1_center_lat = NULL;
+  rg->grid1_center_lon = NULL;
+  rg->grid2_center_lat = NULL;
+  rg->grid2_center_lon = NULL;
+  rg->grid1_area       = NULL;
+  rg->grid2_area       = NULL;
+  rg->grid1_frac       = NULL;
+  rg->grid2_frac       = NULL;
+
+  rg->grid1_corner_lat = NULL;
+  rg->grid1_corner_lon = NULL;
+  rg->grid2_corner_lat = NULL;
+  rg->grid2_corner_lon = NULL;
+
+  rg->grid1_bound_box  = NULL;
+  rg->grid2_bound_box  = NULL;
+
+  rg->bin_addr1        = NULL;
+  rg->bin_addr2        = NULL;
+  rg->bin_lats         = NULL;
+  rg->bin_lons         = NULL;
+}
+
+/*****************************************************************************/
+
+void remapGridRealloc(int map_type, remapgrid_t *rg)
+{
+  long nalloc;
+
+  if ( rg->grid1_nvgp )
+    rg->grid1_vgpm     = (int *) realloc(rg->grid1_vgpm, rg->grid1_nvgp*sizeof(int));
+
+  if ( rg->grid2_nvgp )
+    rg->grid2_vgpm     = (int *) realloc(rg->grid2_vgpm, rg->grid2_nvgp*sizeof(int));
+
+  rg->grid1_mask       = (int *) realloc(rg->grid1_mask, rg->grid1_size*sizeof(int));
+  rg->grid2_mask       = (int *) realloc(rg->grid2_mask, rg->grid2_size*sizeof(int));
+  rg->grid1_center_lat = (double *) realloc(rg->grid1_center_lat, rg->grid1_size*sizeof(double));
+  rg->grid1_center_lon = (double *) realloc(rg->grid1_center_lon, rg->grid1_size*sizeof(double));
+  rg->grid2_center_lat = (double *) realloc(rg->grid2_center_lat, rg->grid2_size*sizeof(double));
+  rg->grid2_center_lon = (double *) realloc(rg->grid2_center_lon, rg->grid2_size*sizeof(double));
+
+  if ( map_type == MAP_TYPE_CONSERV )
+    {
+      rg->grid1_area = (double *) realloc(rg->grid1_area, rg->grid1_size*sizeof(double));
+      rg->grid2_area = (double *) realloc(rg->grid2_area, rg->grid2_size*sizeof(double));
+
+      memset(rg->grid1_area, 0, rg->grid1_size*sizeof(double));
+      memset(rg->grid2_area, 0, rg->grid2_size*sizeof(double));
+    }
+
+  rg->grid1_frac = (double *) realloc(rg->grid1_frac, rg->grid1_size*sizeof(double));
+  rg->grid2_frac = (double *) realloc(rg->grid2_frac, rg->grid2_size*sizeof(double));
+
+  memset(rg->grid1_frac, 0, rg->grid1_size*sizeof(double));
+  memset(rg->grid2_frac, 0, rg->grid2_size*sizeof(double));
+
+  if ( rg->lneed_grid1_corners )
+    {
+      if ( rg->grid1_corners == 0 )
+	{
+	  cdoAbort("grid1 corner missing!");
+	}
+      else
+	{
+	  nalloc = rg->grid1_corners*rg->grid1_size;
+	  rg->grid1_corner_lat = (double *) realloc(rg->grid1_corner_lat, nalloc*sizeof(double));
+	  rg->grid1_corner_lon = (double *) realloc(rg->grid1_corner_lon, nalloc*sizeof(double));
+	  
+	  memset(rg->grid1_corner_lat, 0, nalloc*sizeof(double));
+	  memset(rg->grid1_corner_lon, 0, nalloc*sizeof(double));
+	}
+    }
+
+  if ( rg->lneed_grid2_corners )
+    {
+      if ( rg->grid2_corners == 0 )
+	{
+	  cdoAbort("grid2 corner missing!");
+	}
+      else
+	{
+	  nalloc = rg->grid2_corners*rg->grid2_size;
+	  rg->grid2_corner_lat = (double *) realloc(rg->grid2_corner_lat, nalloc*sizeof(double));
+	  rg->grid2_corner_lon = (double *) realloc(rg->grid2_corner_lon, nalloc*sizeof(double));
+  
+	  memset(rg->grid2_corner_lat, 0, nalloc*sizeof(double));
+	  memset(rg->grid2_corner_lon, 0, nalloc*sizeof(double));
+	}
+    }
+
+  rg->grid1_bound_box = (restr_t *) realloc(rg->grid1_bound_box, 4*rg->grid1_size*sizeof(restr_t));
+  if ( rg->luse_grid2_corners )
+    rg->grid2_bound_box = (restr_t *) realloc(rg->grid2_bound_box, 4*rg->grid2_size*sizeof(restr_t));
+}
+
+/*****************************************************************************/
+static
+void boundbox_from_corners(long size, long nc, const double *restrict corner_lon,
+			   const double *restrict corner_lat, restr_t *restrict bound_box)
+{
+  long i4, inc, i, j;
+  restr_t clon, clat;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none)        \
+  shared(bound_box, corner_lat, corner_lon, nc, size)	\
+  private(i4, inc, i, j, clon, clat)
+#endif
+  for ( i = 0; i < size; ++i )
+    {
+      i4 = i<<2; // *4
+      inc = i*nc;
+      clat = RESTR_SCALE(corner_lat[inc]);
+      clon = RESTR_SCALE(corner_lon[inc]);
+      bound_box[i4  ] = clat;
+      bound_box[i4+1] = clat;
+      bound_box[i4+2] = clon;
+      bound_box[i4+3] = clon;
+      for ( j = 1; j < nc; ++j )
+	{
+	  clat = RESTR_SCALE(corner_lat[inc+j]);
+	  clon = RESTR_SCALE(corner_lon[inc+j]);
+	  if ( clat < bound_box[i4  ] ) bound_box[i4  ] = clat;
+	  if ( clat > bound_box[i4+1] ) bound_box[i4+1] = clat;
+	  if ( clon < bound_box[i4+2] ) bound_box[i4+2] = clon;
+	  if ( clon > bound_box[i4+3] ) bound_box[i4+3] = clon;
+	}
+    }
+}
+
+static
+void boundbox_from_center(int lonIsCyclic, long size, long nx, long ny, const double *restrict center_lon,
+			  const double *restrict center_lat, restr_t *restrict bound_box)
+{
+  long n4, i, j, k, n, ip1, jp1;
+  long n_add, e_add, ne_add;
+  restr_t tmp_lats[4], tmp_lons[4];  /* temps for computing bounding boxes */
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none)        \
+  shared(lonIsCyclic, size, nx, ny, center_lon, center_lat, bound_box)	\
+  private(n4, i, j, k, n, ip1, jp1, n_add, e_add, ne_add, tmp_lats, tmp_lons)
+#endif
+  for ( n = 0; n < size; n++ )
+    {
+      n4 = n<<2;
+
+      /* Find N,S and NE points to this grid point */
+      
+      j = n/nx;
+      i = n - j*nx;
+
+      if ( i < (nx-1) )
+	ip1 = i + 1;
+      else
+	{
+	  /* 2009-01-09 Uwe Schulzweida: bug fix */
+	  if ( lonIsCyclic )
+	    ip1 = 0;
+	  else
+	    ip1 = i;
+	}
+
+      if ( j < (ny-1) )
+	jp1 = j + 1;
+      else
+	{
+	  /* 2008-12-17 Uwe Schulzweida: latitute cyclic ??? (bug fix) */
+	  jp1 = j;
+	}
+
+      n_add  = jp1*nx + i;
+      e_add  = j  *nx + ip1;
+      ne_add = jp1*nx + ip1;
+
+      /* Find N,S and NE lat/lon coords and check bounding box */
+
+      tmp_lats[0] = RESTR_SCALE(center_lat[n]);
+      tmp_lats[1] = RESTR_SCALE(center_lat[e_add]);
+      tmp_lats[2] = RESTR_SCALE(center_lat[ne_add]);
+      tmp_lats[3] = RESTR_SCALE(center_lat[n_add]);
+
+      tmp_lons[0] = RESTR_SCALE(center_lon[n]);
+      tmp_lons[1] = RESTR_SCALE(center_lon[e_add]);
+      tmp_lons[2] = RESTR_SCALE(center_lon[ne_add]);
+      tmp_lons[3] = RESTR_SCALE(center_lon[n_add]);
+
+      bound_box[n4  ] = tmp_lats[0];
+      bound_box[n4+1] = tmp_lats[0];
+      bound_box[n4+2] = tmp_lons[0];
+      bound_box[n4+3] = tmp_lons[0];
+
+      for ( k = 1; k < 4; k++ )
+	{
+	  if ( tmp_lats[k] < bound_box[n4  ] ) bound_box[n4  ] = tmp_lats[k];
+	  if ( tmp_lats[k] > bound_box[n4+1] ) bound_box[n4+1] = tmp_lats[k];
+	  if ( tmp_lons[k] < bound_box[n4+2] ) bound_box[n4+2] = tmp_lons[k];
+	  if ( tmp_lons[k] > bound_box[n4+3] ) bound_box[n4+3] = tmp_lons[k];
+	}
+    }
+}
+
+static
+void scale2(long nvals, double scalefactor, double *restrict vec1, double *restrict vec2)
+{
+  long n;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) shared(nvals, scalefactor, vec1, vec2)
+#endif
+  for ( n = 0; n < nvals; ++n )
+    {
+      vec1[n] *= scalefactor;
+      vec2[n] *= scalefactor;
+    }
+}
+
+static
+void check_lon_range(long nlons, double *lons)
+{
+  long n;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) shared(nlons, lons)
+#endif
+  for ( n = 0; n < nlons; ++n )
+    {
+      if ( lons[n] > PI2  ) lons[n] -= PI2;
+      if ( lons[n] < ZERO ) lons[n] += PI2;
+    }
+}
+
+static
+void check_lat_range(long nlats, double *lats)
+{
+  long n;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) shared(nlats, lats)
+#endif
+  for ( n = 0; n < nlats; ++n )
+    {
+      if ( lats[n] >  PIH ) lats[n] =  PIH;
+      if ( lats[n] < -PIH ) lats[n] = -PIH;
+    }
+}
+
+static
+void check_lon_boundbox_range(long nlons, restr_t *bound_box)
+{
+  long n, n4;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) shared(nlons, bound_box) private(n4)
+#endif
+  for ( n = 0; n < nlons; ++n )
+    {
+      n4 = n<<2;
+      if ( RESTR_ABS(bound_box[n4+3] - bound_box[n4+2]) > RESTR_SCALE(PI) )
+	{
+	  bound_box[n4+2] = 0;
+	  bound_box[n4+3] = RESTR_SCALE(PI2);
+	}
+    }
+}
+
+static
+void check_lat_boundbox_range(long nlats, restr_t *restrict bound_box, double *restrict lats)
+{
+  long n, n4;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) shared(nlats, bound_box, lats) private(n4)
+#endif
+  for ( n = 0; n < nlats; ++n )
+    {
+      n4 = n<<2;
+      if ( RESTR_SCALE(lats[n]) < bound_box[n4  ] ) bound_box[n4  ] = RESTR_SCALE(-PIH);
+      if ( RESTR_SCALE(lats[n]) > bound_box[n4+1] ) bound_box[n4+1] = RESTR_SCALE( PIH);
+    }
+}
+
+static
+int expand_lonlat_grid(int gridID)
+{
+  char units[CDI_MAX_NAME];
+  int gridIDnew;
+  long nx, ny, nxp4, nyp4;
+  double *xvals, *yvals;
+
+  nx = gridInqXsize(gridID);
+  ny = gridInqYsize(gridID);
+  nxp4 = nx+4;
+  nyp4 = ny+4;
+
+  xvals = (double *) malloc(nxp4*sizeof(double));
+  yvals = (double *) malloc(nyp4*sizeof(double));
+  gridInqXvals(gridID, xvals+2);
+  gridInqYvals(gridID, yvals+2);
+
+  gridIDnew = gridCreate(GRID_LONLAT, nxp4*nyp4);
+  gridDefXsize(gridIDnew, nxp4);
+  gridDefYsize(gridIDnew, nyp4);
+	      
+  gridInqXunits(gridID,    units);
+  gridDefXunits(gridIDnew, units);
+  gridInqYunits(gridID,    units);
+  gridDefYunits(gridIDnew, units);
+
+  xvals[0] = xvals[2] - 2*gridInqXinc(gridID);
+  xvals[1] = xvals[2] - gridInqXinc(gridID);
+  xvals[nxp4-2] = xvals[nx+1] + gridInqXinc(gridID);
+  xvals[nxp4-1] = xvals[nx+1] + 2*gridInqXinc(gridID);
+
+  yvals[0] = yvals[2] - 2*gridInqYinc(gridID);
+  yvals[1] = yvals[2] - gridInqYinc(gridID);
+  yvals[nyp4-2] = yvals[ny+1] + gridInqYinc(gridID);
+  yvals[nyp4-1] = yvals[ny+1] + 2*gridInqYinc(gridID);
+
+  gridDefXvals(gridIDnew, xvals);
+  gridDefYvals(gridIDnew, yvals);
+
+  free(xvals);
+  free(yvals);
+
+  if ( gridIsRotated(gridID) )
+    {
+      gridDefXpole(gridIDnew, gridInqXpole(gridID));
+      gridDefYpole(gridIDnew, gridInqYpole(gridID));
+    }
+
+  return(gridIDnew);
+}
+
+static
+int expand_curvilinear_grid(int gridID)
+{
+  char units[CDI_MAX_NAME];
+  int gridIDnew;
+  long gridsize, gridsize_new;
+  long nx, ny, nxp4, nyp4;
+  long i,j;
+  double *xvals, *yvals;
+
+  gridsize = gridInqSize(gridID);
+  nx = gridInqXsize(gridID);
+  ny = gridInqYsize(gridID);
+  nxp4 = nx+4;
+  nyp4 = ny+4;
+  gridsize_new = gridsize + 4*(nx+2) + 4*(ny+2);
+
+  xvals = (double *) malloc(gridsize_new*sizeof(double));
+  yvals = (double *) malloc(gridsize_new*sizeof(double));
+  gridInqXvals(gridID, xvals);
+  gridInqYvals(gridID, yvals);
+
+  gridIDnew = gridCreate(GRID_CURVILINEAR, nxp4*nyp4);
+  gridDefXsize(gridIDnew, nxp4);
+  gridDefYsize(gridIDnew, nyp4);
+
+  gridInqXunits(gridID,   units);
+  gridDefXunits(gridIDnew, units);
+  gridInqYunits(gridID,   units);
+  gridDefYunits(gridIDnew, units);
+
+  for ( j = ny-1; j >= 0; j-- )
+    for ( i = nx-1; i >= 0; i-- )
+      xvals[(j+2)*(nx+4)+i+2] = xvals[j*nx+i];
+
+  for ( j = ny-1; j >= 0; j-- )
+    for ( i = nx-1; i >= 0; i-- )
+      yvals[(j+2)*(nx+4)+i+2] = yvals[j*nx+i];
+
+  for ( j = 2; j < nyp4-2; j++ )
+    {
+      xvals[j*nxp4  ] = intlin(3.0, xvals[j*nxp4+3], 0.0, xvals[j*nxp4+2], 1.0);
+      xvals[j*nxp4+1] = intlin(2.0, xvals[j*nxp4+3], 0.0, xvals[j*nxp4+2], 1.0); 
+      yvals[j*nxp4  ] = intlin(3.0, yvals[j*nxp4+3], 0.0, yvals[j*nxp4+2], 1.0); 
+      yvals[j*nxp4+1] = intlin(2.0, yvals[j*nxp4+3], 0.0, yvals[j*nxp4+2], 1.0); 
+
+      xvals[j*nxp4+nxp4-2] = intlin(2.0, xvals[j*nxp4+nxp4-4], 0.0, xvals[j*nxp4+nxp4-3], 1.0); 
+      xvals[j*nxp4+nxp4-1] = intlin(3.0, xvals[j*nxp4+nxp4-4], 0.0, xvals[j*nxp4+nxp4-3], 1.0); 
+      yvals[j*nxp4+nxp4-2] = intlin(2.0, yvals[j*nxp4+nxp4-4], 0.0, yvals[j*nxp4+nxp4-3], 1.0); 
+      yvals[j*nxp4+nxp4-1] = intlin(3.0, yvals[j*nxp4+nxp4-4], 0.0, yvals[j*nxp4+nxp4-3], 1.0); 
+    }
+
+  for ( i = 0; i < nxp4; i++ )
+    {
+      xvals[0*nxp4+i] = intlin(3.0, xvals[3*nxp4+i], 0.0, xvals[2*nxp4+i], 1.0);
+      xvals[1*nxp4+i] = intlin(2.0, xvals[3*nxp4+i], 0.0, xvals[2*nxp4+i], 1.0);
+      yvals[0*nxp4+i] = intlin(3.0, yvals[3*nxp4+i], 0.0, yvals[2*nxp4+i], 1.0);
+      yvals[1*nxp4+i] = intlin(2.0, yvals[3*nxp4+i], 0.0, yvals[2*nxp4+i], 1.0);
+
+      xvals[(nyp4-2)*nxp4+i] = intlin(2.0, xvals[(nyp4-4)*nxp4+i], 0.0, xvals[(nyp4-3)*nxp4+i], 1.0);
+      xvals[(nyp4-1)*nxp4+i] = intlin(3.0, xvals[(nyp4-4)*nxp4+i], 0.0, xvals[(nyp4-3)*nxp4+i], 1.0);
+      yvals[(nyp4-2)*nxp4+i] = intlin(2.0, yvals[(nyp4-4)*nxp4+i], 0.0, yvals[(nyp4-3)*nxp4+i], 1.0);
+      yvals[(nyp4-1)*nxp4+i] = intlin(3.0, yvals[(nyp4-4)*nxp4+i], 0.0, yvals[(nyp4-3)*nxp4+i], 1.0);
+    }
+  /*
+    {
+    FILE *fp;
+    fp = fopen("xvals.asc", "w");
+    for ( i = 0; i < gridsize_new; i++ ) fprintf(fp, "%g\n", xvals[i]);
+    fclose(fp);
+    fp = fopen("yvals.asc", "w");
+    for ( i = 0; i < gridsize_new; i++ ) fprintf(fp, "%g\n", yvals[i]);
+    fclose(fp);
+    }
+  */
+  gridDefXvals(gridIDnew, xvals);
+  gridDefYvals(gridIDnew, yvals);
+  
+  free(xvals);
+  free(yvals);
+
+  return(gridIDnew);
+}
+
+static
+void calc_lat_bins(remapgrid_t *rg, int map_type)
+{
+  long nbins;
+  long n;      /* Loop counter                  */
+  long nele;   /* Element loop counter          */
+  long n2, nele4;
+  double dlat;                /* lat/lon intervals for search bins  */
+  long grid1_size, grid2_size;
+
+  grid1_size = rg->grid1_size;
+  grid2_size = rg->grid2_size;
+
+  nbins = rg->num_srch_bins;
+  dlat = PI/nbins;
+
+  if ( cdoVerbose )
+    cdoPrint("Using %d latitude bins to restrict search.", nbins);
+
+  rg->bin_lats  = (restr_t *) realloc(rg->bin_lats, 2*nbins*sizeof(restr_t));
+  rg->bin_lons  = (restr_t *) realloc(rg->bin_lons, 2*nbins*sizeof(restr_t));
+  for ( n = 0; n < nbins; ++n )
+    {
+      n2 = n<<1;
+      rg->bin_lats[n2  ] = RESTR_SCALE((n  )*dlat - PIH);
+      rg->bin_lats[n2+1] = RESTR_SCALE((n+1)*dlat - PIH);
+      rg->bin_lons[n2  ] = 0;
+      rg->bin_lons[n2+1] = RESTR_SCALE(PI2);
+    }
+
+  rg->bin_addr1 = (int *) realloc(rg->bin_addr1, 2*nbins*sizeof(int));
+  for ( n = 0; n < nbins; ++n )
+    {
+      n2 = n<<1;
+      rg->bin_addr1[n2  ] = grid1_size;
+      rg->bin_addr1[n2+1] = 0;
+    }
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  private(n, n2, nele4)		       \
+  shared(grid1_size, nbins, rg)
+#endif
+  for ( nele = 0; nele < grid1_size; ++nele )
+    {
+      nele4 = nele<<2;
+      for ( n = 0; n < nbins; ++n )
+	{
+	  n2 = n<<1;
+	  if ( rg->grid1_bound_box[nele4  ] <= rg->bin_lats[n2+1] &&
+	       rg->grid1_bound_box[nele4+1] >= rg->bin_lats[n2  ] )
+	    {
+#if defined (_OPENMP)
+#pragma omp critical
+#endif
+	      {
+		rg->bin_addr1[n2  ] = MIN(nele, rg->bin_addr1[n2  ]);
+		rg->bin_addr1[n2+1] = MAX(nele, rg->bin_addr1[n2+1]);
+	      }
+	    }
+	}
+    }
+
+  if ( map_type == MAP_TYPE_CONSERV )
+    {
+      rg->bin_addr2 = (int *) realloc(rg->bin_addr2, 2*nbins*sizeof(int));
+      for ( n = 0; n < nbins; ++n )
+	{
+	  n2 = n<<1;
+	  rg->bin_addr2[n2  ] = grid2_size;
+	  rg->bin_addr2[n2+1] = 0;
+	}
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  private(n, n2, nele4)		       \
+  shared(grid2_size, nbins, rg)
+#endif
+      for ( nele = 0; nele < grid2_size; ++nele )
+	{
+	  nele4 = nele<<2;
+	  for ( n = 0; n < nbins; n++ )
+	    {
+	      n2 = n<<1;
+	      if ( rg->grid2_bound_box[nele4  ] <= rg->bin_lats[n2+1] &&
+		   rg->grid2_bound_box[nele4+1] >= rg->bin_lats[n2  ] )
+		{
+#if defined (_OPENMP)
+#pragma omp critical
+#endif
+		  {
+		    rg->bin_addr2[n2  ] = MIN(nele, rg->bin_addr2[n2  ]);
+		    rg->bin_addr2[n2+1] = MAX(nele, rg->bin_addr2[n2+1]);
+		  }
+		}
+	    }
+	}
+
+      free(rg->bin_lats); rg->bin_lats = NULL;
+      free(rg->bin_lons); rg->bin_lons = NULL;
+    }
+
+  if ( map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1 )
+    {
+      free(rg->grid1_bound_box); rg->grid1_bound_box = NULL;
+    }
+}
+
+static
+void calc_lonlat_bins(remapgrid_t *rg, int map_type)
+{
+  long i, j;   /* Logical 2d addresses          */
+  long nbins;
+  long n;      /* Loop counter                  */
+  long nele;   /* Element loop counter          */
+  long n2, nele4;
+  double dlat, dlon;                /* lat/lon intervals for search bins  */
+  long grid1_size, grid2_size;
+
+  grid1_size = rg->grid1_size;
+  grid2_size = rg->grid2_size;
+
+  nbins = rg->num_srch_bins;
+
+  dlat = PI /nbins;
+  dlon = PI2/nbins;
+
+  if ( cdoVerbose )
+    cdoPrint("Using %d lat/lon boxes to restrict search.", nbins);
+
+  rg->bin_addr1 = (int *) realloc(rg->bin_addr1, 2*nbins*nbins*sizeof(int));
+  if ( map_type == MAP_TYPE_CONSERV )
+    rg->bin_addr2 = (int *) realloc(rg->bin_addr2, 2*nbins*nbins*sizeof(int));
+  rg->bin_lats  = (restr_t *) realloc(rg->bin_lats, 2*nbins*nbins*sizeof(restr_t));
+  rg->bin_lons  = (restr_t *) realloc(rg->bin_lons, 2*nbins*nbins*sizeof(restr_t));
+
+  n = 0;
+  for ( j = 0; j < nbins; j++ )
+    for ( i = 0; i < nbins; i++ )
+      {
+	n2 = n<<1;
+	rg->bin_lats[n2  ]  = RESTR_SCALE((j  )*dlat - PIH);
+	rg->bin_lats[n2+1]  = RESTR_SCALE((j+1)*dlat - PIH);
+	rg->bin_lons[n2  ]  = RESTR_SCALE((i  )*dlon);
+	rg->bin_lons[n2+1]  = RESTR_SCALE((i+1)*dlon);
+	rg->bin_addr1[n2  ] = grid1_size;
+	rg->bin_addr1[n2+1] = 0;
+	if ( map_type == MAP_TYPE_CONSERV )
+	  {
+	    rg->bin_addr2[n2  ] = grid2_size;
+	    rg->bin_addr2[n2+1] = 0;
+	  }
+
+	n++;
+      }
+
+  rg->num_srch_bins = nbins*nbins;
+
+  for ( nele = 0; nele < grid1_size; nele++ )
+    {
+      nele4 = nele<<2;
+      for ( n = 0; n < nbins*nbins; n++ )
+	if ( rg->grid1_bound_box[nele4  ] <= rg->bin_lats[2*n+1] &&
+	     rg->grid1_bound_box[nele4+1] >= rg->bin_lats[2*n  ] &&
+	     rg->grid1_bound_box[nele4+2] <= rg->bin_lons[2*n+1] &&
+	     rg->grid1_bound_box[nele4+3] >= rg->bin_lons[2*n  ] )
+	  {
+	    rg->bin_addr1[2*n  ] = MIN(nele,rg->bin_addr1[2*n  ]);
+	    rg->bin_addr1[2*n+1] = MAX(nele,rg->bin_addr1[2*n+1]);
+	  }
+    }
+  
+  if ( map_type == MAP_TYPE_CONSERV )
+    {
+      for ( nele = 0; nele < grid2_size; nele++ )
+	{
+	  nele4 = nele<<2;
+	  for ( n = 0; n < nbins*nbins; n++ )
+	    if ( rg->grid2_bound_box[nele4  ] <= rg->bin_lats[2*n+1] &&
+		 rg->grid2_bound_box[nele4+1] >= rg->bin_lats[2*n  ] &&
+		 rg->grid2_bound_box[nele4+2] <= rg->bin_lons[2*n+1] &&
+		 rg->grid2_bound_box[nele4+3] >= rg->bin_lons[2*n  ] )
+	      {
+		rg->bin_addr2[2*n  ] = MIN(nele,rg->bin_addr2[2*n  ]);
+		rg->bin_addr2[2*n+1] = MAX(nele,rg->bin_addr2[2*n+1]);
+	      }
+	}
+  
+      free(rg->bin_lats); rg->bin_lats = NULL;
+      free(rg->bin_lons); rg->bin_lons = NULL;
+    }
+
+  if ( map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1 )
+    { 
+      free(rg->grid1_bound_box); rg->grid1_bound_box = NULL;
+    }
+}
+
+/*****************************************************************************/
+
+void remapGridInit(int map_type, int lextrapolate, int gridID1, int gridID2, remapgrid_t *rg)
+{
+  char units[CDI_MAX_NAME];
+  long i, i4;
+  long nx, ny;
+  long grid1_size, grid2_size;
+  int lgrid1_destroy = FALSE, lgrid2_destroy = FALSE;
+  int lgrid1_gen_bounds = FALSE, lgrid2_gen_bounds = FALSE;
+  int gridID1_gme = -1;
+  int gridID2_gme = -1;
+
+  rg->store_link_fast = FALSE;
+
+  north_thresh =  rg->threshhold;
+  south_thresh = -rg->threshhold;
+
+  if ( cdoVerbose ) cdoPrint("threshhold: north=%g  south=%g", north_thresh, south_thresh);
+
+  if ( lextrapolate > 0 )
+    rg->lextrapolate = TRUE;
+  else
+    rg->lextrapolate = FALSE;
+
+  if ( map_type == MAP_TYPE_CONSERV )
+    {
+      rg->luse_grid1_corners  = TRUE;
+      rg->luse_grid2_corners  = TRUE;
+      rg->lneed_grid1_corners = TRUE;
+      rg->lneed_grid2_corners = TRUE;
+    }
+  else
+    {
+      rg->luse_grid1_corners  = FALSE;
+      rg->luse_grid2_corners  = FALSE;
+      rg->lneed_grid1_corners = FALSE;
+      rg->lneed_grid2_corners = FALSE;
+    }
+
+  /* Initialize all pointer */
+  if ( rg->pinit == FALSE ) remapGridInitPointer(rg);
+
+  rg->gridID1 = gridID1;
+  rg->gridID2 = gridID2;
+
+  if ( !rg->lextrapolate && gridInqSize(rg->gridID1) > 1 &&
+       (map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1) &&
+       ((gridInqType(gridID1) == GRID_LONLAT && gridIsRotated(gridID1)) ||
+	(gridInqType(gridID1) == GRID_LONLAT && rg->non_global)) )
+    {
+      rg->gridID1 = gridID1 = expand_lonlat_grid(gridID1);
+    }
+
+  if ( gridInqType(rg->gridID1) == GRID_REFERENCE )
+    {
+      rg->gridID1 = gridID1 = referenceToGrid(gridID1);
+      if ( gridID1 == -1 ) cdoAbort("grid1 reference not found!");
+    }
+
+  if ( gridInqType(rg->gridID2) == GRID_REFERENCE )
+    {
+      rg->gridID2 = gridID2 = referenceToGrid(gridID2);
+      if ( gridID2 == -1 ) cdoAbort("grid2 reference not found!");
+    }
+
+  if ( gridInqSize(rg->gridID1) > 1 && 
+       (gridInqType(rg->gridID1) == GRID_LCC || 
+	gridInqType(rg->gridID1) == GRID_LAEA || 
+	gridInqType(rg->gridID1) == GRID_SINUSOIDAL) )
+    {
+      rg->gridID1 = gridID1 = gridToCurvilinear(rg->gridID1, 1);
+    }
+
+  if ( !rg->lextrapolate && gridInqSize(rg->gridID1) > 1 &&
+       (map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1) &&
+       (gridInqType(gridID1) == GRID_CURVILINEAR && rg->non_global) )
+    {
+      rg->gridID1 = gridID1 = expand_curvilinear_grid(gridID1);
+    }
+
+  if ( map_type == MAP_TYPE_DISTWGT || map_type == MAP_TYPE_DISTWGT1 )
+    {
+      if ( gridInqType(rg->gridID1) == GRID_UNSTRUCTURED )
+	{
+	  rg->luse_grid1_corners  = TRUE;
+	  rg->lneed_grid1_corners = FALSE; /* full grid search */
+	}
+      if ( gridInqType(rg->gridID2) == GRID_UNSTRUCTURED )
+	{
+	  rg->luse_grid2_corners  = TRUE;
+	  rg->lneed_grid2_corners = FALSE; /* full grid search */
+	}
+    }
+
+  if ( gridInqType(rg->gridID1) != GRID_UNSTRUCTURED && gridInqType(rg->gridID1) != GRID_CURVILINEAR )
+    {
+      if ( gridInqType(rg->gridID1) == GRID_GME )
+	{
+	  gridID1_gme = gridToUnstructured(rg->gridID1, 1);
+	  rg->grid1_nvgp = gridInqSize(gridID1_gme);
+	  gridID1 = gridDuplicate(gridID1_gme);
+	  gridCompress(gridID1);
+	  rg->luse_grid1_corners = TRUE;
+	}
+      else
+	{
+	  lgrid1_destroy = TRUE;
+	  gridID1 = gridToCurvilinear(rg->gridID1, 1);
+	  lgrid1_gen_bounds = TRUE;
+	}
+    }
+
+  if ( gridInqType(rg->gridID2) != GRID_UNSTRUCTURED && gridInqType(rg->gridID2) != GRID_CURVILINEAR )
+    {
+      if ( gridInqType(rg->gridID2) == GRID_GME )
+	{
+	  gridID2_gme = gridToUnstructured(rg->gridID2, 1);
+	  rg->grid2_nvgp = gridInqSize(gridID2_gme);
+	  gridID2 = gridDuplicate(gridID2_gme);
+	  gridCompress(gridID2);
+	  rg->luse_grid2_corners = TRUE;
+	}
+      else
+	{
+	  lgrid2_destroy = TRUE;
+	  gridID2 = gridToCurvilinear(rg->gridID2, 1);
+	  lgrid2_gen_bounds = TRUE;
+	}
+    }
+
+  grid1_size = rg->grid1_size = gridInqSize(gridID1);
+  grid2_size = rg->grid2_size = gridInqSize(gridID2);
+
+  rg->grid1_is_cyclic = gridIsCircular(gridID1);
+  rg->grid2_is_cyclic = gridIsCircular(gridID2);
+
+  if ( gridInqType(gridID1) == GRID_UNSTRUCTURED )
+    rg->grid1_rank = 1;
+  else
+    rg->grid1_rank = 2;
+
+  if ( gridInqType(gridID2) == GRID_UNSTRUCTURED )
+    rg->grid2_rank = 1;
+  else
+    rg->grid2_rank = 2;
+
+  if ( gridInqType(gridID1) == GRID_UNSTRUCTURED )
+    rg->grid1_corners = gridInqNvertex(gridID1);
+  else
+    rg->grid1_corners = 4;
+
+  if ( gridInqType(gridID2) == GRID_UNSTRUCTURED )
+    rg->grid2_corners = gridInqNvertex(gridID2);
+  else
+    rg->grid2_corners = 4;
+
+  remapGridRealloc(map_type, rg);
+
+  rg->grid1_dims[0] = gridInqXsize(gridID1);
+  rg->grid1_dims[1] = gridInqYsize(gridID1);
+ 
+  gridInqXvals(gridID1, rg->grid1_center_lon);
+  gridInqYvals(gridID1, rg->grid1_center_lat);
+
+  if ( rg->lneed_grid1_corners )
+    {
+      if ( gridInqYbounds(gridID1, NULL) && gridInqXbounds(gridID1, NULL) )
+	{
+	  gridInqXbounds(gridID1, rg->grid1_corner_lon);
+	  gridInqYbounds(gridID1, rg->grid1_corner_lat);
+	}
+      else if ( lgrid1_gen_bounds )
+	{
+	  genXbounds(rg->grid1_dims[0], rg->grid1_dims[1], rg->grid1_center_lon, rg->grid1_corner_lon, 0);
+	  genYbounds(rg->grid1_dims[0], rg->grid1_dims[1], rg->grid1_center_lat, rg->grid1_corner_lat);
+	}
+      else
+	{
+	  cdoAbort("grid1 corner missing!");
+	}
+    }
+
+  /* Initialize logical mask */
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) shared(grid1_size, rg)
+#endif
+  for ( i = 0; i < grid1_size; ++i ) rg->grid1_mask[i] = TRUE;
+
+  if ( gridInqType(rg->gridID1) == GRID_GME ) gridInqMaskGME(gridID1_gme, rg->grid1_vgpm);
+
+  /* Convert lat/lon units if required */
+
+  gridInqYunits(gridID1, units);
+
+  if ( memcmp(units, "degree", 6) == 0 )
+    {
+      scale2(rg->grid1_size, DEG2RAD, rg->grid1_center_lat, rg->grid1_center_lon);
+
+      /* Note: using units from latitude instead from bounds */
+      if ( rg->grid1_corners && rg->lneed_grid1_corners )
+	scale2(rg->grid1_corners*rg->grid1_size, DEG2RAD, rg->grid1_corner_lat, rg->grid1_corner_lon);
+    }
+  else if ( memcmp(units, "radian", 6) == 0 )
+    {
+      /* No conversion necessary */
+    }
+  else
+    {
+      cdoWarning("Unknown units supplied for grid1 center lat/lon: proceeding assuming radians");
+    }
+
+  if ( lgrid1_destroy ) gridDestroy(gridID1);
+
+  /* Data for grid 2 */
+
+  rg->grid2_dims[0] = gridInqXsize(gridID2);
+  rg->grid2_dims[1] = gridInqYsize(gridID2);
+
+  gridInqXvals(gridID2, rg->grid2_center_lon);
+  gridInqYvals(gridID2, rg->grid2_center_lat);
+
+  if ( rg->lneed_grid2_corners )
+    {
+      if ( gridInqYbounds(gridID2, NULL) && gridInqXbounds(gridID2, NULL) )
+	{
+	  gridInqXbounds(gridID2, rg->grid2_corner_lon);
+	  gridInqYbounds(gridID2, rg->grid2_corner_lat);
+	}
+      else if ( lgrid2_gen_bounds )
+	{
+	  genXbounds(rg->grid2_dims[0], rg->grid2_dims[1], rg->grid2_center_lon, rg->grid2_corner_lon, 0);
+	  genYbounds(rg->grid2_dims[0], rg->grid2_dims[1], rg->grid2_center_lat, rg->grid2_corner_lat);
+	}
+      else
+	{
+	  cdoAbort("grid2 corner missing!");
+	}
+    }
+
+  /* Initialize logical mask */
+
+  if ( gridInqMask(rg->gridID2, NULL) )
+    {
+      gridInqMask(rg->gridID2, rg->grid2_mask);
+      for ( i = 0; i < grid2_size; ++i )
+	{
+	  if ( rg->grid2_mask[i] > 0 && rg->grid2_mask[i] < 255 )
+	    rg->grid2_mask[i] = TRUE;
+	  else
+	    rg->grid2_mask[i] = FALSE;
+	}
+    }
+  else
+    {
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) shared(grid2_size, rg)
+#endif
+      for ( i = 0; i < grid2_size; ++i ) rg->grid2_mask[i] = TRUE;
+    }
+
+  if ( gridInqType(rg->gridID2) == GRID_GME ) gridInqMaskGME(gridID2_gme, rg->grid2_vgpm);
+
+  /* Convert lat/lon units if required */
+
+  gridInqYunits(gridID2, units);
+
+  if ( memcmp(units, "degree", 6) == 0 )
+    {
+      scale2(rg->grid2_size, DEG2RAD, rg->grid2_center_lat, rg->grid2_center_lon);
+
+      /* Note: using units from latitude instead from bounds */
+      if ( rg->grid2_corners && rg->lneed_grid2_corners )
+	scale2( rg->grid2_corners*rg->grid2_size, DEG2RAD, rg->grid2_corner_lat, rg->grid2_corner_lon);
+    }
+  else if ( memcmp(units, "radian", 6) == 0 )
+    {
+      /* No conversion necessary */
+    }
+  else
+    {
+      cdoWarning("Unknown units supplied for grid2 center lat/lon: proceeding assuming radians");
+    }
+
+  if ( lgrid2_destroy ) gridDestroy(gridID2);
+
+  /* Convert longitudes to 0,2pi interval */
+
+  check_lon_range(rg->grid1_size, rg->grid1_center_lon);
+  check_lon_range(rg->grid2_size, rg->grid2_center_lon);
+
+  if ( rg->grid1_corners && rg->lneed_grid1_corners )
+    check_lon_range(rg->grid1_corners*rg->grid1_size, rg->grid1_corner_lon);
+
+  if ( rg->grid2_corners && rg->lneed_grid2_corners )
+    check_lon_range(rg->grid2_corners*rg->grid2_size, rg->grid2_corner_lon);
+
+
+  /*  Make sure input latitude range is within the machine values for +/- pi/2 */
+
+  check_lat_range(rg->grid1_size, rg->grid1_center_lat);
+  check_lat_range(rg->grid2_size, rg->grid2_center_lat);
+
+  if ( rg->grid1_corners && rg->lneed_grid1_corners )
+    check_lat_range(rg->grid1_corners*rg->grid1_size, rg->grid1_corner_lat);
+  
+  if ( rg->grid2_corners && rg->lneed_grid2_corners )
+    check_lat_range(rg->grid2_corners*rg->grid2_size, rg->grid2_corner_lat);
+
+
+  /*  Compute bounding boxes for restricting future grid searches */
+
+  if ( rg->luse_grid1_corners )
+    {
+      if ( rg->lneed_grid1_corners )
+	{
+	  if ( cdoVerbose ) cdoPrint("Grid1: boundbox_from_corners");
+
+	  boundbox_from_corners(rg->grid1_size, rg->grid1_corners, 
+				rg->grid1_corner_lon, rg->grid1_corner_lat, rg->grid1_bound_box);
+	}
+      else /* full grid search */
+	{
+	  if ( cdoVerbose ) cdoPrint("Grid1: bounds missing -> full grid search!");
+
+	  for ( i = 0; i < grid1_size; ++i )
+	    {
+	      i4 = i<<2;
+	      rg->grid1_bound_box[i4  ] = RESTR_SCALE(-PIH);
+	      rg->grid1_bound_box[i4+1] = RESTR_SCALE( PIH);
+	      rg->grid1_bound_box[i4+2] = 0;
+	      rg->grid1_bound_box[i4+3] = RESTR_SCALE(PI2);
+	    }
+	}
+    }
+  else
+    {
+      if ( rg->grid1_rank != 2 ) cdoAbort("Internal problem, grid1 rank = %d!", rg->grid1_rank);
+
+      nx = rg->grid1_dims[0];
+      ny = rg->grid1_dims[1];
+
+      if ( cdoVerbose ) cdoPrint("Grid1: boundbox_from_center");
+
+      boundbox_from_center(rg->grid1_is_cyclic, rg->grid1_size, nx, ny, 
+			   rg->grid1_center_lon, rg->grid1_center_lat, rg->grid1_bound_box);
+    }
+
+
+  if ( rg->luse_grid2_corners )
+    {
+      if ( rg->lneed_grid2_corners )
+	{
+	  if ( cdoVerbose ) cdoPrint("Grid2: boundbox_from_corners");
+
+	  boundbox_from_corners(rg->grid2_size, rg->grid2_corners, 
+				rg->grid2_corner_lon, rg->grid2_corner_lat, rg->grid2_bound_box);
+	}
+      else /* full grid search */
+	{
+	  if ( cdoVerbose ) cdoPrint("Grid2: bounds missing -> full grid search!");
+
+	  for ( i = 0; i < grid2_size; ++i )
+	    {
+	      i4 = i<<2;
+	      rg->grid2_bound_box[i4  ] = RESTR_SCALE(-PIH);
+	      rg->grid2_bound_box[i4+1] = RESTR_SCALE( PIH);
+	      rg->grid2_bound_box[i4+2] = 0;
+	      rg->grid2_bound_box[i4+3] = RESTR_SCALE(PI2);
+	    }
+	}
+    }
+
+  check_lon_boundbox_range(rg->grid1_size, rg->grid1_bound_box);
+  if ( rg->lneed_grid2_corners )
+    check_lon_boundbox_range(rg->grid2_size, rg->grid2_bound_box);
+
+
+  /* Try to check for cells that overlap poles */
+
+  check_lat_boundbox_range(rg->grid1_size, rg->grid1_bound_box, rg->grid1_center_lat);
+  if ( rg->lneed_grid2_corners )
+    check_lat_boundbox_range(rg->grid2_size, rg->grid2_bound_box, rg->grid2_center_lat);
+
+
+  /*
+    Set up and assign address ranges to search bins in order to 
+    further restrict later searches
+  */
+  if ( rg->restrict_type == RESTRICT_LATITUDE )
+    {
+      calc_lat_bins(rg, map_type);
+    }
+  else if ( rg->restrict_type == RESTRICT_LATLON )
+    {
+      calc_lonlat_bins(rg, map_type);
+    }
+  else
+    cdoAbort("Unknown search restriction method!");
+
+}  /* remapGridInit */
+
+/*****************************************************************************/
+
+/*
+    This routine initializes some variables and provides an initial
+    allocation of arrays (fairly large so frequent resizing unnecessary).
+*/
+void remapVarsInit(int map_type, remapgrid_t *rg, remapvars_t *rv)
+{
+  /* Initialize all pointer */
+  if ( rv->pinit == FALSE )
+    {
+      rv->pinit = TRUE;
+
+      rv->grid1_add = NULL;
+      rv->grid2_add = NULL;
+      rv->wts       = NULL;
+    }
+
+  /* Determine the number of weights */
+
+  if      ( map_type == MAP_TYPE_CONSERV  ) rv->num_wts = 3;
+  else if ( map_type == MAP_TYPE_BILINEAR ) rv->num_wts = 1;
+  else if ( map_type == MAP_TYPE_BICUBIC  ) rv->num_wts = 4;
+  else if ( map_type == MAP_TYPE_DISTWGT  ) rv->num_wts = 1;
+  else if ( map_type == MAP_TYPE_DISTWGT1 ) rv->num_wts = 1;
+  else cdoAbort("Unknown mapping method!");
+
+  /*
+    Initialize num_links and set max_links to four times the largest 
+    of the destination grid sizes initially (can be changed later).
+    Set a default resize increment to increase the size of link
+    arrays if the number of links exceeds the initial size
+  */
+  rv->num_links = 0;
+  rv->max_links = 4 * rg->grid2_size;
+
+  rv->resize_increment = (int) (0.1 * MAX(rg->grid1_size, rg->grid2_size));
+
+  /*  Allocate address and weight arrays for mapping 1 */
+
+  rv->grid1_add = (int *) realloc(rv->grid1_add, rv->max_links*sizeof(int));
+  rv->grid2_add = (int *) realloc(rv->grid2_add, rv->max_links*sizeof(int));
+
+  rv->wts = (double *) realloc(rv->wts, rv->num_wts*rv->max_links*sizeof(double));
+
+  rv->links.option    = FALSE;
+  rv->links.max_links = 0;
+  rv->links.num_blks  = 0;
+  rv->links.num_links = NULL;
+  rv->links.src_add   = NULL;
+  rv->links.dst_add   = NULL;
+  rv->links.w_index   = NULL;
+
+} /* remapVarsInit */
+
+/*****************************************************************************/
+
+/*
+   This routine resizes remapping arrays by increasing(decreasing)
+   the max_links by increment
+*/
+void resize_remap_vars(remapvars_t *rv, int increment)
+{
+  /*
+    Input variables:
+    int  increment  ! the number of links to add(subtract) to arrays
+  */
+
+  /*  Reallocate arrays at new size */
+
+  rv->max_links += increment;
+
+  if ( rv->max_links )
+    {
+      rv->grid1_add = (int *) realloc(rv->grid1_add, rv->max_links*sizeof(int));
+      rv->grid2_add = (int *) realloc(rv->grid2_add, rv->max_links*sizeof(int));
+
+      rv->wts = (double *) realloc(rv->wts, rv->num_wts*rv->max_links*sizeof(double));
+    }
+
+} /* resize_remap_vars */
+
+
+/*
+  -----------------------------------------------------------------------
+
+  Performs the remapping based on weights computed elsewhere
+     
+  -----------------------------------------------------------------------
+*/
+void remap(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict map_wts, 
+	   long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array, 
+	   const double *restrict src_grad1, const double *restrict src_grad2, const double *restrict src_grad3,
+	   remaplink_t links)
+{
+  /*
+    Input arrays:
+
+    int *dst_add         ! destination address for each link
+    int *src_add         ! source      address for each link
+
+    int num_wts          ! num of weights used in remapping
+
+    double *map_wts      ! remapping weights for each link
+
+    double *src_array    ! array with source field to be remapped
+
+    optional:
+
+    double *src_grad1    ! gradient arrays on source grid necessary for
+    double *src_grad2    ! higher-order remappings
+    double *src_grad3
+
+    output variables:
+
+    double *dst_array    ! array for remapped field on destination grid
+  */
+
+  /* Local variables */
+  long n;
+  int iorder;
+
+  /* Check the order of the interpolation */
+
+  if ( src_grad1 )
+    iorder = 2;
+  else
+    iorder = 1;
+
+  for ( n = 0; n < dst_size; ++n ) dst_array[n] = missval;
+
+  if ( cdoTimer ) timer_start(timer_remap);
+
+#ifdef SX
+#pragma cdir nodep
+#endif
+  for ( n = 0; n < num_links; ++n ) dst_array[dst_add[n]] = ZERO;
+
+  if ( iorder == 1 )   /* First order remapping */
+    {
+      if ( links.option == TRUE )
+	{
+	  long j;
+	  for ( j = 0; j < links.num_blks; ++j )
+	    {
+#ifdef SX
+#pragma cdir nodep
+#endif
+	      for ( n = 0; n < links.num_links[j]; ++n )
+		{
+		  dst_array[links.dst_add[j][n]] += src_array[links.src_add[j][n]]*map_wts[num_wts*links.w_index[j][n]];
+		}
+	    }
+	}
+      else
+	{
+	  for ( n = 0; n < num_links; ++n )
+	    {
+	      /*
+		printf("%5d %5d %5d %g # dst_add src_add n\n", dst_add[n], src_add[n], n, map_wts[num_wts*n]);
+	      */
+	      dst_array[dst_add[n]] += src_array[src_add[n]]*map_wts[num_wts*n];
+	    }
+	}
+    }
+  else                 /* Second order remapping */
+    {
+      if ( num_wts == 3 )
+	{
+	  for ( n = 0; n < num_links; ++n )
+	    {
+	      dst_array[dst_add[n]] += src_array[src_add[n]]*map_wts[num_wts*n] +
+                                       src_grad1[src_add[n]]*map_wts[num_wts*n+1] +
+                                       src_grad2[src_add[n]]*map_wts[num_wts*n+2];
+	    }
+	}
+      else if ( num_wts == 4 )
+	{
+      	  for ( n = 0; n < num_links; ++n )
+	    {
+              dst_array[dst_add[n]] += src_array[src_add[n]]*map_wts[num_wts*n] +
+                                       src_grad1[src_add[n]]*map_wts[num_wts*n+1] +
+                                       src_grad2[src_add[n]]*map_wts[num_wts*n+2] +
+                                       src_grad3[src_add[n]]*map_wts[num_wts*n+3];
+	    }
+	}
+    }
+
+  if ( cdoTimer ) timer_stop(timer_remap);
+}
+
+static
+long get_max_add(long num_links, long size, const int *restrict add)
+{
+  long n, i;
+  long max_add;
+  int *isum;
+
+  isum = (int *) malloc(size*sizeof(int));
+  memset(isum, 0, size*sizeof(int));
+
+  for ( n = 0; n < num_links; ++n ) isum[add[n]]++;
+
+  max_add = 0;
+  for ( i = 0; i < size; ++i ) if ( isum[i] > max_add ) max_add = isum[i];
+  free(isum);
+
+  return (max_add);
+}
+
+static 
+long binary_search_int(const int *array, long len, int value)
+{       
+  long low = 0, high = len - 1, midpoint = 0;
+ 
+  while ( low <= high )
+    {
+      midpoint = low + (high - low)/2;      
+ 
+      // check to see if value is equal to item in array
+      if ( value == array[midpoint] ) return midpoint;
+
+      if ( value < array[midpoint] )
+	high = midpoint - 1;
+      else
+	low  = midpoint + 1;
+    }
+ 
+  // item was not found
+  return -1L;
+}
+
+/*
+  -----------------------------------------------------------------------
+
+  Performs the remapping based on weights computed elsewhere
+     
+  -----------------------------------------------------------------------
+*/
+void remap_laf(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict map_wts,
+	       long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array)
+{
+  /*
+    Input arrays:
+
+    int *dst_add         ! destination address for each link
+    int *src_add         ! source      address for each link
+
+    int num_wts          ! num of weights used in remapping
+
+    double *map_wts      ! remapping weights for each link
+
+    double *src_array    ! array with source field to be remapped
+
+    output variables:
+
+    double *dst_array    ! array for remapped field on destination grid
+  */
+
+  /* Local variables */
+  long i, n, k, ncls, imax;
+  long max_cls;
+  double wts;
+  double *src_cls;
+  double *src_wts;
+#if defined (_OPENMP)
+  double **src_cls2;
+  double **src_wts2;
+  int ompthID;
+#endif
+
+  for ( i = 0; i < dst_size; ++i ) dst_array[i] = missval;
+
+  if ( num_links == 0 ) return;
+
+  max_cls = get_max_add(num_links, dst_size, dst_add);
+
+#if defined (_OPENMP)
+  src_cls2 = (double **) malloc(ompNumThreads*sizeof(double *));
+  src_wts2 = (double **) malloc(ompNumThreads*sizeof(double *));
+  for ( i = 0; i < ompNumThreads; ++i )
+    {
+      src_cls2[i] = (double *) malloc(max_cls*sizeof(double));
+      src_wts2[i] = (double *) malloc(max_cls*sizeof(double));
+    }
+#else
+  src_cls = (double *) malloc(max_cls*sizeof(double));
+  src_wts = (double *) malloc(max_cls*sizeof(double));
+#endif
+
+  for ( n = 0; n < num_links; ++n )
+    if ( DBL_IS_EQUAL(dst_array[dst_add[n]], missval) ) dst_array[dst_add[n]] = ZERO;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(dst_size, src_cls2, src_wts2, num_links, dst_add, src_add, src_array, map_wts, \
+	 num_wts, dst_array, max_cls)					\
+  private(i, n, k, ompthID, src_cls, src_wts, ncls, imax, wts) \
+  schedule(dynamic,1)
+#endif
+  for ( i = 0; i < dst_size; ++i )
+    {
+#if defined (_OPENMP)
+      ompthID = omp_get_thread_num();
+      src_cls = src_cls2[ompthID];
+      src_wts = src_wts2[ompthID];
+#endif
+      memset(src_cls, 0, max_cls*sizeof(double));
+      memset(src_wts, 0, max_cls*sizeof(double));
+      /*
+      ncls = 0;
+      for ( n = 0; n < num_links; n++ )
+	{
+	  if ( i == dst_add[n] )
+	    {
+	      for ( k = 0; k < ncls; k++ )
+		if ( IS_EQUAL(src_array[src_add[n]], src_cls[k]) ) break;
+	      
+	      if ( k == ncls )
+		{
+		  src_cls[k] = src_array[src_add[n]];
+		  ncls++;
+		}
+	      
+	      src_wts[k] += map_wts[num_wts*n];
+	    }
+	}
+      */
+      /* only for sorted dst_add! */
+      {
+      long min_add = 1, max_add = 0;
+
+      n = binary_search_int(dst_add, num_links, (int)i);
+
+      if ( n >= 0 && n < num_links )
+	{
+	  min_add = n;
+	  
+	  for ( n = min_add+1; n < num_links; ++n )
+	    if ( i != dst_add[n] ) break;
+
+	  max_add = n;
+
+	  for ( n = min_add; n > 0; --n )
+	    if ( i != dst_add[n-1] ) break;
+
+	  min_add = n;
+	}
+
+      ncls = 0;
+      for ( n = min_add; n < max_add; ++n )
+	{
+	  for ( k = 0; k < ncls; ++k )
+	    if ( IS_EQUAL(src_array[src_add[n]], src_cls[k]) ) break;
+	      
+	  if ( k == ncls )
+	    {
+	      src_cls[k] = src_array[src_add[n]];
+	      ncls++;
+	    }
+	      
+	  src_wts[k] += map_wts[num_wts*n];
+	}
+      }
+      
+      if ( ncls )
+	{
+	  imax = 0;
+	  wts = src_wts[0];
+	  for ( k = 1; k < ncls; ++k )
+	    {
+	      if ( src_wts[k] > wts )
+		{
+		  wts  = src_wts[k];
+		  imax = k;
+		}
+	    }
+
+	  dst_array[i] = src_cls[imax];
+	}
+    }
+
+#if defined (_OPENMP)
+  for ( i = 0; i < ompNumThreads; ++i )
+    {
+      free(src_cls2[i]);
+      free(src_wts2[i]);
+    }
+
+  free(src_cls2);
+  free(src_wts2);
+#else
+  free(src_cls);
+  free(src_wts);
+#endif
+}
+
+/*
+  -----------------------------------------------------------------------
+
+  Performs the remapping based on weights computed elsewhere
+     
+  -----------------------------------------------------------------------
+*/
+void remap_sum(double *restrict dst_array, double missval, long dst_size, long num_links, double *restrict map_wts,
+	       long num_wts, const int *restrict dst_add, const int *restrict src_add, const double *restrict src_array)
+{
+  /*
+    Input arrays:
+
+    int *dst_add         ! destination address for each link
+    int *src_add         ! source      address for each link
+
+    int num_wts          ! num of weights used in remapping
+
+    double *map_wts      ! remapping weights for each link
+
+    double *src_array    ! array with source field to be remapped
+
+    output variables:
+
+    double *dst_array    ! array for remapped field on destination grid
+  */
+  /* Local variables */
+  long n;
+
+  for ( n = 0; n < dst_size; ++n ) dst_array[n] = missval;
+
+#ifdef SX
+#pragma cdir nodep
+#endif
+  for ( n = 0; n < num_links; ++n )
+    if ( DBL_IS_EQUAL(dst_array[dst_add[n]], missval) ) dst_array[dst_add[n]] = ZERO;
+
+  for ( n = 0; n < num_links; ++n )
+    {
+      /*
+	printf("%5d %5d %5d %g # dst_add src_add n\n", dst_add[n], src_add[n], n, map_wts[num_wts*n]);
+      */
+      //dst_array[dst_add[n]] += src_array[src_add[n]]*map_wts[num_wts*n];
+      dst_array[dst_add[n]] += src_array[src_add[n]]*map_wts[num_wts*n];
+      printf("%ld %d %d %g %g %g\n", n, dst_add[n], src_add[n],
+	     src_array[src_add[n]], map_wts[num_wts*n], dst_array[dst_add[n]]);
+    }
+}
+
+
+#define  DEFAULT_MAX_ITER  100
+
+static long    Max_Iter = DEFAULT_MAX_ITER;  /* Max iteration count for i,j iteration */
+static double  converge = 1.e-10;            /* Convergence criterion */
+
+void remap_set_max_iter(long max_iter)
+{
+  if ( max_iter > 0 ) Max_Iter = max_iter;
+}
+
+
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/*                                                                         */
+/*      BILINEAR INTERPOLATION                                             */
+/*                                                                         */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+static
+int grid_search(remapgrid_t *rg, int *restrict src_add, double *restrict src_lats, 
+		double *restrict src_lons,  double plat, double plon, const int *restrict src_grid_dims,
+		const double *restrict src_center_lat, const double *restrict src_center_lon,
+		const restr_t *restrict src_grid_bound_box, const int *restrict src_bin_add)
+{
+  /*
+    Output variables:
+
+    int    src_add[4]              ! address of each corner point enclosing P
+    double src_lats[4]             ! latitudes  of the four corner points
+    double src_lons[4]             ! longitudes of the four corner points
+
+    Input variables:
+
+    double plat                    ! latitude  of the search point
+    double plon                    ! longitude of the search point
+
+    int src_grid_dims[2]           ! size of each src grid dimension
+
+    double src_center_lat[]        ! latitude  of each src grid center 
+    double src_center_lon[]        ! longitude of each src grid center
+
+    restr_t src_grid_bound_box[][4] ! bound box for source grid
+
+    int src_bin_add[][2]           ! latitude bins for restricting
+  */
+  /*  Local variables */
+  long n, n2, next_n, srch_add, srch_add4;    /* dummy indices                    */
+  long nx, ny;                                /* dimensions of src grid           */
+  long min_add, max_add;                      /* addresses for restricting search */
+  long i, j, jp1, ip1, n_add, e_add, ne_add;  /* addresses                        */
+  long nbins;
+  /* Vectors for cross-product check */
+  double vec1_lat, vec1_lon;
+  double vec2_lat, vec2_lon, cross_product;
+  double coslat_dst, sinlat_dst, coslon_dst, sinlon_dst;
+  double dist_min, distance; /* For computing dist-weighted avg */
+  int scross[4], scross_last = 0;
+  int search_result = 0;
+  restr_t rlat, rlon;
+
+  nbins = rg->num_srch_bins;
+
+  rlat = RESTR_SCALE(plat);
+  rlon = RESTR_SCALE(plon);
+
+  /* restrict search first using bins */
+
+  for ( n = 0; n < 4; ++n ) src_add[n] = 0;
+
+  min_add = rg->grid1_size-1;
+  max_add = 0;
+
+  for ( n = 0; n < nbins; ++n )
+    {
+      n2 = n<<1;
+      if ( rlat >= rg->bin_lats[n2] && rlat <= rg->bin_lats[n2+1] &&
+	   rlon >= rg->bin_lons[n2] && rlon <= rg->bin_lons[n2+1] )
+	{
+	  if ( src_bin_add[n2  ] < min_add ) min_add = src_bin_add[n2  ];
+	  if ( src_bin_add[n2+1] > max_add ) max_add = src_bin_add[n2+1];
+	}
+    }
+ 
+  /* Now perform a more detailed search */
+
+  nx = src_grid_dims[0];
+  ny = src_grid_dims[1];
+
+  /* srch_loop */
+  for ( srch_add = min_add; srch_add <= max_add; ++srch_add )
+    {
+      srch_add4 = srch_add<<2;
+      /* First check bounding box */
+      if ( rlat >= src_grid_bound_box[srch_add4  ] && 
+           rlat <= src_grid_bound_box[srch_add4+1] &&
+           rlon >= src_grid_bound_box[srch_add4+2] &&
+	   rlon <= src_grid_bound_box[srch_add4+3] )
+	{
+	  /* We are within bounding box so get really serious */
+
+          /* Determine neighbor addresses */
+          j = srch_add/nx;
+          i = srch_add - j*nx;
+
+          if ( i < (nx-1) )
+            ip1 = i + 1;
+          else
+	    {
+	      /* 2009-01-09 Uwe Schulzweida: bug fix */
+	      if ( rg->grid1_is_cyclic )
+		ip1 = 0;
+	      else
+		ip1 = i;
+	    }
+
+          if ( j < (ny-1) )
+            jp1 = j + 1;
+          else
+	    {
+	      /* 2008-12-17 Uwe Schulzweida: latitute cyclic ??? (bug fix) */
+	      jp1 = j;
+	    }
+
+          n_add  = jp1*nx + i;
+          e_add  = j  *nx + ip1;
+	  ne_add = jp1*nx + ip1;
+
+          src_lats[0] = src_center_lat[srch_add];
+          src_lats[1] = src_center_lat[e_add];
+          src_lats[2] = src_center_lat[ne_add];
+          src_lats[3] = src_center_lat[n_add];
+
+          src_lons[0] = src_center_lon[srch_add];
+          src_lons[1] = src_center_lon[e_add];
+          src_lons[2] = src_center_lon[ne_add];
+          src_lons[3] = src_center_lon[n_add];
+
+	  /* For consistency, we must make sure all lons are in same 2pi interval */
+
+          vec1_lon = src_lons[0] - plon;
+          if      ( vec1_lon >  PI ) src_lons[0] -= PI2;
+          else if ( vec1_lon < -PI ) src_lons[0] += PI2;
+
+          for ( n = 1; n < 4; ++n )
+	    {
+	      vec1_lon = src_lons[n] - src_lons[0];
+	      if      ( vec1_lon >  PI ) src_lons[n] -= PI2;
+	      else if ( vec1_lon < -PI ) src_lons[n] += PI2;
+	    }
+
+          /* corner_loop */
+          for ( n = 0; n < 4; ++n )
+	    {
+	      next_n = (n+1)%4;
+
+	      /*
+		Here we take the cross product of the vector making 
+		up each box side with the vector formed by the vertex
+		and search point.  If all the cross products are 
+		positive, the point is contained in the box.
+	      */
+	      vec1_lat = src_lats[next_n] - src_lats[n];
+	      vec1_lon = src_lons[next_n] - src_lons[n];
+	      vec2_lat = plat - src_lats[n];
+	      vec2_lon = plon - src_lons[n];
+
+	      /* Check for 0,2pi crossings */
+
+	      if      ( vec1_lon >  THREE*PIH ) vec1_lon -= PI2;
+	      else if ( vec1_lon < -THREE*PIH ) vec1_lon += PI2;
+
+	      if      ( vec2_lon >  THREE*PIH ) vec2_lon -= PI2;
+	      else if ( vec2_lon < -THREE*PIH ) vec2_lon += PI2;
+
+	      cross_product = vec1_lon*vec2_lat - vec2_lon*vec1_lat;
+
+	      /* If cross product is less than ZERO, this cell doesn't work    */
+	      /* 2008-10-16 Uwe Schulzweida: bug fix for cross_product eq zero */
+
+	      scross[n] = cross_product < 0 ? -1 : cross_product > 0 ? 1 : 0;
+
+	      if ( n == 0 ) scross_last = scross[n];
+
+	      if ( (scross[n] < 0 && scross_last > 0) || (scross[n] > 0 && scross_last < 0) ) break;
+
+	      scross_last = scross[n];
+	    } /* corner_loop */
+
+	  if ( n >= 4 )
+	    {
+	      n = 0;
+	      if      ( scross[0]>=0 && scross[1]>=0 && scross[2]>=0 && scross[3]>=0 ) n = 4;
+	      else if ( scross[0]<=0 && scross[1]<=0 && scross[2]<=0 && scross[3]<=0 ) n = 4;
+	    }
+
+	  /* If cross products all same sign, we found the location */
+          if ( n >= 4 )
+	    {
+	      src_add[0] = srch_add;
+	      src_add[1] = e_add;
+	      src_add[2] = ne_add;
+	      src_add[3] = n_add;
+
+	      search_result = 1;
+
+	      return (search_result);
+	    }
+
+	  /* Otherwise move on to next cell */
+
+        } /* Bounding box check */
+    } /* srch_loop */
+
+  /*
+    If no cell found, point is likely either in a box that straddles either pole or is outside 
+    the grid. Fall back to a distance-weighted average of the four closest points.
+    Go ahead and compute weights here, but store in src_lats and return -add to prevent the 
+    parent routine from computing bilinear weights.
+  */
+  if ( ! rg->lextrapolate ) return (search_result);
+
+  /*
+    printf("Could not find location for %g %g\n", plat*RAD2DEG, plon*RAD2DEG);
+    printf("Using nearest-neighbor average for this point\n");
+  */
+  coslat_dst = cos(plat);
+  sinlat_dst = sin(plat);
+  coslon_dst = cos(plon);
+  sinlon_dst = sin(plon);
+
+  dist_min = BIGNUM;
+  for ( n = 0; n < 4; ++n ) src_lats[n] = BIGNUM;
+  for ( srch_add = min_add; srch_add <= max_add; ++srch_add )
+    {
+      distance = acos(coslat_dst*cos(src_center_lat[srch_add])*
+		     (coslon_dst*cos(src_center_lon[srch_add]) +
+                      sinlon_dst*sin(src_center_lon[srch_add]))+
+		      sinlat_dst*sin(src_center_lat[srch_add]));
+
+      if ( distance < dist_min )
+	{
+          for ( n = 0; n < 4; ++n )
+	    {
+	      if ( distance < src_lats[n] )
+		{
+		  for ( i = 3; i > n; --i )
+		    {
+		      src_add [i] = src_add [i-1];
+		      src_lats[i] = src_lats[i-1];
+		    }
+		  search_result = -1;
+		  src_add [n] = srch_add;
+		  src_lats[n] = distance;
+		  dist_min = src_lats[3];
+		  break;
+		}
+	    }
+        }
+    }
+
+  for ( n = 0; n < 4; ++n ) src_lons[n] = ONE/(src_lats[n] + TINY);
+  distance = 0.0;
+  for ( n = 0; n < 4; ++n ) distance += src_lons[n];
+  for ( n = 0; n < 4; ++n ) src_lats[n] = src_lons[n]/distance;
+
+  return (search_result);
+}  /* grid_search */
+
+
+/*
+  This routine stores the address and weight for four links associated with one destination
+  point in the appropriate address and weight arrays and resizes those arrays if necessary.
+*/
+static
+void store_link_bilin(remapvars_t *rv, int dst_add, const int *restrict src_add, const double *restrict weights)
+{
+  /*
+    Input variables:
+    int dst_add       ! address on destination grid
+    int src_add[4]    ! addresses on source grid
+    double weights[4] ! array of remapping weights for these links
+  */
+  long n;             /* dummy index */
+  long num_links_old; /* placeholder for old link number */
+
+  /*
+     Increment number of links and check to see if remap arrays need
+     to be increased to accomodate the new link.  Then store the link.
+  */
+  num_links_old = rv->num_links;
+  rv->num_links = num_links_old + 4;
+
+  if ( rv->num_links >= rv->max_links ) 
+    resize_remap_vars(rv, rv->resize_increment);
+
+  for ( n = 0; n < 4; ++n )
+    {
+      rv->grid1_add[num_links_old+n] = src_add[n];
+      rv->grid2_add[num_links_old+n] = dst_add;
+      rv->wts      [num_links_old+n] = weights[n];
+    }
+
+} /* store_link_bilin */
+
+static
+long find_ij_weights(double plon, double plat, double *restrict src_lats, double *restrict src_lons,
+		     double *ig, double *jg)
+{
+  long iter;                     /*  iteration counters   */
+  double iguess, jguess;         /*  current guess for bilinear coordinate  */
+  double deli, delj;             /*  corrections to i,j                     */
+  double dth1, dth2, dth3;       /*  some latitude  differences             */
+  double dph1, dph2, dph3;       /*  some longitude differences             */
+  double dthp, dphp;             /*  difference between point and sw corner */
+  double mat1, mat2, mat3, mat4; /*  matrix elements                        */
+  double determinant;            /*  matrix determinant                     */
+
+  /* Iterate to find i,j for bilinear approximation  */
+
+  dth1 = src_lats[1] - src_lats[0];
+  dth2 = src_lats[3] - src_lats[0];
+  dth3 = src_lats[2] - src_lats[1] - dth2;
+
+  dph1 = src_lons[1] - src_lons[0];
+  dph2 = src_lons[3] - src_lons[0];
+  dph3 = src_lons[2] - src_lons[1];
+
+  if ( dph1 >  THREE*PIH ) dph1 -= PI2;
+  if ( dph2 >  THREE*PIH ) dph2 -= PI2;
+  if ( dph3 >  THREE*PIH ) dph3 -= PI2;
+  if ( dph1 < -THREE*PIH ) dph1 += PI2;
+  if ( dph2 < -THREE*PIH ) dph2 += PI2;
+  if ( dph3 < -THREE*PIH ) dph3 += PI2;
+
+  dph3 = dph3 - dph2;
+
+  iguess = HALF;
+  jguess = HALF;
+
+  for ( iter = 0; iter < Max_Iter; ++iter )
+    {
+      dthp = plat - src_lats[0] - dth1*iguess - dth2*jguess - dth3*iguess*jguess;
+      dphp = plon - src_lons[0];
+      
+      if ( dphp >  THREE*PIH ) dphp -= PI2;
+      if ( dphp < -THREE*PIH ) dphp += PI2;
+
+      dphp = dphp - dph1*iguess - dph2*jguess - dph3*iguess*jguess;
+
+      mat1 = dth1 + dth3*jguess;
+      mat2 = dth2 + dth3*iguess;
+      mat3 = dph1 + dph3*jguess;
+      mat4 = dph2 + dph3*iguess;
+
+      determinant = mat1*mat4 - mat2*mat3;
+
+      deli = (dthp*mat4 - dphp*mat2)/determinant;
+      delj = (dphp*mat1 - dthp*mat3)/determinant;
+
+      if ( fabs(deli) < converge && fabs(delj) < converge ) break;
+
+      iguess += deli;
+      jguess += delj;
+    }
+
+  *ig = iguess;
+  *jg = jguess;
+
+  return (iter);
+}
+
+/*
+  -----------------------------------------------------------------------
+
+  This routine computes the weights for a bilinear interpolation.
+
+  -----------------------------------------------------------------------
+*/
+void remap_bilin(remapgrid_t *rg, remapvars_t *rv)
+{
+  /*   Local variables */
+  int  lwarn = TRUE;
+  int  search_result;
+  long grid2_size;
+  long dst_add;                  /*  destination addresss */
+  long n, icount;
+  long iter;                     /*  iteration counters   */
+
+  int src_add[4];                /*  address for the four source points     */
+
+  double src_lats[4];            /*  latitudes  of four bilinear corners    */
+  double src_lons[4];            /*  longitudes of four bilinear corners    */
+  double wgts[4];                /*  bilinear weights for four corners      */
+
+  double plat, plon;             /*  lat/lon coords of destination point    */
+  double iguess, jguess;         /*  current guess for bilinear coordinate  */
+  double sum_wgts;               /*  sum of weights for normalization       */
+
+  if ( cdoTimer ) timer_start(timer_remap_bil);
+
+  if ( ompNumThreads == 1 ) progressInit();
+
+  grid2_size = rg->grid2_size;
+
+  /* Compute mappings from grid1 to grid2 */
+
+  if ( rg->grid1_rank != 2 )
+    cdoAbort("Can not do bilinear interpolation when grid1_rank != 2"); 
+
+  /* Loop over destination grid */
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(ompNumThreads, cdoTimer, cdoVerbose, grid2_size, rg, rv, Max_Iter, converge, lwarn) \
+  private(dst_add, n, icount, iter, src_add, src_lats, src_lons, \
+	  wgts, plat, plon, iguess, jguess, sum_wgts, search_result)					\
+  schedule(dynamic,1)
+#endif
+  /* grid_loop1 */
+  for ( dst_add = 0; dst_add < grid2_size; ++dst_add )
+    {
+      if ( ompNumThreads == 1 ) progressStatus(0, 1, (dst_add+1.)/grid2_size);
+
+      if ( ! rg->grid2_mask[dst_add] ) continue;
+
+      plat = rg->grid2_center_lat[dst_add];
+      plon = rg->grid2_center_lon[dst_add];
+
+      /* Find nearest square of grid points on source grid  */
+
+      search_result = grid_search(rg, src_add, src_lats, src_lons, 
+				  plat, plon, rg->grid1_dims,
+				  rg->grid1_center_lat, rg->grid1_center_lon,
+				  rg->grid1_bound_box, rg->bin_addr1);
+     
+
+      /* Check to see if points are land points */
+      if ( search_result > 0 )
+	{
+	  for ( n = 0; n < 4; ++n )
+	    if ( ! rg->grid1_mask[src_add[n]] ) search_result = 0;
+	}
+
+      /* If point found, find local i,j coordinates for weights  */
+      if ( search_result > 0 )
+	{
+          rg->grid2_frac[dst_add] = ONE;
+
+	  iter = find_ij_weights(plon, plat, src_lats, src_lons, &iguess, &jguess);
+
+          if ( iter < Max_Iter )
+	    {
+	      /* Successfully found i,j - compute weights */
+
+	      wgts[0] = (ONE-iguess)*(ONE-jguess);
+	      wgts[1] = iguess*(ONE-jguess);
+	      wgts[2] = iguess*jguess;
+	      wgts[3] = (ONE-iguess)*jguess;
+
+#if defined (_OPENMP)
+#pragma omp critical
+#endif
+	      store_link_bilin(rv, dst_add, src_add, wgts);
+	    }
+          else
+	    {
+	      if ( cdoVerbose )
+		{
+		  cdoPrint("Point coords: %g %g", plat, plon);
+		  cdoPrint("Src grid lats: %g %g %g %g", src_lats[0], src_lats[1], src_lats[2], src_lats[3]);
+		  cdoPrint("Src grid lons: %g %g %g %g", src_lons[0], src_lons[1], src_lons[2], src_lons[3]);
+		  cdoPrint("Src grid addresses: %d %d %d %d", src_add[0], src_add[1], src_add[2], src_add[3]);
+		  cdoPrint("Src grid lats: %g %g %g %g",
+			   rg->grid1_center_lat[src_add[0]], rg->grid1_center_lat[src_add[1]],
+			   rg->grid1_center_lat[src_add[2]], rg->grid1_center_lat[src_add[3]]);
+		  cdoPrint("Src grid lons: %g %g %g %g",
+			   rg->grid1_center_lon[src_add[0]], rg->grid1_center_lon[src_add[1]],
+			   rg->grid1_center_lon[src_add[2]], rg->grid1_center_lon[src_add[3]]);
+		  cdoPrint("Current i,j : %g %g", iguess, jguess);
+		}
+
+	      if ( cdoVerbose || lwarn )
+		{
+		  lwarn = FALSE;
+		  //  cdoWarning("Iteration for i,j exceed max iteration count of %d!", Max_Iter);
+		  cdoWarning("Bilinear interpolation failed for some grid points - use a distance-weighted average instead!");
+		}
+
+	      search_result = -1;
+	    }
+	}
+
+      /*
+	Search for bilinear failed - use a distance-weighted average instead (this is typically near the pole)
+      */
+      if ( search_result < 0 )
+	{
+          icount = 0;
+          for ( n = 0; n < 4; ++n )
+	    {
+	      if ( rg->grid1_mask[src_add[n]] )
+		icount++;
+	      else
+		src_lats[n] = ZERO;
+	    }
+
+          if ( icount > 0 )
+	    {
+	      /* Renormalize weights */
+	      sum_wgts = 0.0;
+	      /* 2012-05-08 Uwe Schulzweida: using absolute value of src_lats (bug fix) */
+	      for ( n = 0; n < 4; ++n ) sum_wgts += fabs(src_lats[n]);
+	      for ( n = 0; n < 4; ++n ) wgts[n] = fabs(src_lats[n])/sum_wgts;
+
+	      rg->grid2_frac[dst_add] = ONE;
+
+#if defined (_OPENMP)
+#pragma omp critical
+#endif
+	      store_link_bilin(rv, dst_add, src_add, wgts);
+	    }
+        }
+    } /* grid_loop1 */
+
+  if ( cdoTimer ) timer_stop(timer_remap_bil);
+} /* remap_bilin */
+
+
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/*                                                                         */
+/*      BICUBIC INTERPOLATION                                              */
+/*                                                                         */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+/*
+  This routine stores the address and weight for four links 
+  associated with one destination point in the appropriate address 
+  and weight arrays and resizes those arrays if necessary.
+*/
+static
+void store_link_bicub(remapvars_t *rv, int dst_add, const int *restrict src_add, double weights[4][4])
+{
+  /*
+    Input variables:
+    int dst_add          ! address on destination grid
+    int src_add[4]       ! addresses on source grid
+    double weights[4][4] ! array of remapping weights for these links
+  */
+  long n, k;          /* dummy index */
+  long num_links_old; /* placeholder for old link number */
+
+  /*
+     Increment number of links and check to see if remap arrays need
+     to be increased to accomodate the new link.  then store the link.
+  */
+  num_links_old = rv->num_links;
+  rv->num_links = num_links_old + 4;
+
+  if ( rv->num_links >= rv->max_links ) 
+    resize_remap_vars(rv, rv->resize_increment);
+
+  for ( n = 0; n < 4; ++n )
+    {
+      rv->grid1_add[num_links_old+n] = src_add[n];
+      rv->grid2_add[num_links_old+n] = dst_add;
+      for ( k = 0; k < 4; ++k )
+	rv->wts[4*(num_links_old+n)+k] = weights[k][n];
+    }
+
+} /* store_link_bicub */
+
+
+/*
+  -----------------------------------------------------------------------
+
+  This routine computes the weights for a bicubic interpolation.
+
+  -----------------------------------------------------------------------
+*/
+void remap_bicub(remapgrid_t *rg, remapvars_t *rv)
+{
+  /*   Local variables */
+  int  lwarn = TRUE;
+  int  search_result;
+  long n, icount;
+  long dst_add;        /*  destination addresss */
+  long iter;           /*  iteration counters   */
+
+  int src_add[4];     /* address for the four source points */
+
+  double src_lats[4]; /*  latitudes  of four bilinear corners */
+  double src_lons[4]; /*  longitudes of four bilinear corners */
+  double wgts[4][4];  /*  bicubic weights for four corners    */
+
+  double plat, plon;             /*  lat/lon coords of destination point    */
+  double iguess, jguess;         /*  current guess for bilinear coordinate  */
+  double sum_wgts;               /*  sum of weights for normalization       */
+
+  if ( ompNumThreads == 1 ) progressInit();
+
+  /* Compute mappings from grid1 to grid2 */
+
+  if ( rg->grid1_rank != 2 )
+    cdoAbort("Can not do bicubic interpolation when grid1_rank != 2"); 
+
+  /* Loop over destination grid */
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(ompNumThreads, cdoTimer, cdoVerbose, rg, rv, Max_Iter, converge, lwarn)	\
+  private(dst_add, n, icount, iter, src_add, src_lats, src_lons, wgts, plat, plon, iguess, jguess, \
+	  sum_wgts, search_result)					\
+  schedule(dynamic,1)
+#endif
+  /* grid_loop1 */
+  for ( dst_add = 0; dst_add < rg->grid2_size; ++dst_add )
+    {
+      if ( ompNumThreads == 1 ) progressStatus(0, 1, (dst_add+1.)/rg->grid2_size);
+
+      if ( ! rg->grid2_mask[dst_add] ) continue;
+
+      plat = rg->grid2_center_lat[dst_add];
+      plon = rg->grid2_center_lon[dst_add];
+
+      /* Find nearest square of grid points on source grid  */
+      search_result = grid_search(rg, src_add, src_lats, src_lons, 
+				  plat, plon, rg->grid1_dims,
+				  rg->grid1_center_lat, rg->grid1_center_lon,
+				  rg->grid1_bound_box, rg->bin_addr1);
+
+      /* Check to see if points are land points */
+      if ( search_result > 0 )
+	{
+	  for ( n = 0; n < 4; ++n )
+	    if ( ! rg->grid1_mask[src_add[n]] ) search_result = 0;
+	}
+
+      /* If point found, find local i,j coordinates for weights  */
+      if ( search_result > 0 )
+	{
+          rg->grid2_frac[dst_add] = ONE;
+
+	  iter = find_ij_weights(plon, plat, src_lats, src_lons, &iguess, &jguess);
+
+          if ( iter < Max_Iter )
+	    {
+	      /* Successfully found i,j - compute weights */
+
+	      wgts[0][0] = (ONE - jguess*jguess*(THREE-TWO*jguess))*
+		           (ONE - iguess*iguess*(THREE-TWO*iguess));
+	      wgts[0][1] = (ONE - jguess*jguess*(THREE-TWO*jguess))*
+                                  iguess*iguess*(THREE-TWO*iguess);
+	      wgts[0][2] =        jguess*jguess*(THREE-TWO*jguess)*
+                                  iguess*iguess*(THREE-TWO*iguess);
+	      wgts[0][3] =        jguess*jguess*(THREE-TWO*jguess)*
+                           (ONE - iguess*iguess*(THREE-TWO*iguess));
+	      wgts[1][0] = (ONE - jguess*jguess*(THREE-TWO*jguess))*
+                                  iguess*(iguess-ONE)*(iguess-ONE);
+	      wgts[1][1] = (ONE - jguess*jguess*(THREE-TWO*jguess))*
+                                  iguess*iguess*(iguess-ONE);
+	      wgts[1][2] =        jguess*jguess*(THREE-TWO*jguess)*
+                                  iguess*iguess*(iguess-ONE);
+	      wgts[1][3] =        jguess*jguess*(THREE-TWO*jguess)*
+                                  iguess*(iguess-ONE)*(iguess-ONE);
+	      wgts[2][0] =        jguess*(jguess-ONE)*(jguess-ONE)*
+                           (ONE - iguess*iguess*(THREE-TWO*iguess));
+	      wgts[2][1] =        jguess*(jguess-ONE)*(jguess-ONE)*
+                                  iguess*iguess*(THREE-TWO*iguess);
+	      wgts[2][2] =        jguess*jguess*(jguess-ONE)*
+                                  iguess*iguess*(THREE-TWO*iguess);
+	      wgts[2][3] =        jguess*jguess*(jguess-ONE)*
+                           (ONE - iguess*iguess*(THREE-TWO*iguess));
+	      wgts[3][0] =        iguess*(iguess-ONE)*(iguess-ONE)*
+                                  jguess*(jguess-ONE)*(jguess-ONE);
+              wgts[3][1] =        iguess*iguess*(iguess-ONE)*
+                                  jguess*(jguess-ONE)*(jguess-ONE);
+	      wgts[3][2] =        iguess*iguess*(iguess-ONE)*
+                                  jguess*jguess*(jguess-ONE);
+	      wgts[3][3] =        iguess*(iguess-ONE)*(iguess-ONE)*
+                                  jguess*jguess*(jguess-ONE);
+
+#if defined (_OPENMP)
+#pragma omp critical
+#endif
+	      store_link_bicub(rv, dst_add, src_add, wgts);
+	    }
+          else
+	    {
+	      if ( cdoVerbose || lwarn )
+		{
+		  lwarn = FALSE;
+		  // cdoWarning("Iteration for i,j exceed max iteration count of %d!", Max_Iter);
+		  cdoWarning("Bicubic interpolation failed for some grid points - use a distance-weighted average instead!");
+		}
+
+	      search_result = -1;
+	    }
+	}
+	  
+      /*
+	Search for bicubic failed - use a distance-weighted average instead (this is typically near the pole)
+      */
+      if ( search_result < 0 )
+	{
+          icount = 0;
+          for ( n = 0; n < 4; ++n )
+	    {
+	      if ( rg->grid1_mask[src_add[n]] )
+		icount++;
+	      else
+		src_lats[n] = ZERO;
+	    }
+
+          if ( icount > 0 )
+	    {
+	      /* Renormalize weights */
+	      sum_wgts = 0.0;
+	      /* 2012-05-08 Uwe Schulzweida: using absolute value of src_lats (bug fix) */
+	      for ( n = 0; n < 4; ++n ) sum_wgts += fabs(src_lats[n]);
+	      for ( n = 0; n < 4; ++n ) wgts[0][n] = fabs(src_lats[n])/sum_wgts;
+	      for ( n = 0; n < 4; ++n ) wgts[1][n] = ZERO;
+	      for ( n = 0; n < 4; ++n ) wgts[2][n] = ZERO;
+	      for ( n = 0; n < 4; ++n ) wgts[3][n] = ZERO;
+
+	      rg->grid2_frac[dst_add] = ONE;
+
+#if defined (_OPENMP)
+#pragma omp critical
+#endif
+	      store_link_bicub(rv, dst_add, src_add, wgts);
+	    }
+        }
+    } /* grid_loop1 */
+
+} /* remap_bicub */
+
+
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/*                                                                         */
+/*      INTERPOLATION USING A DISTANCE-WEIGHTED AVERAGE                    */
+/*                                                                         */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+#define  num_neighbors  4  /* num nearest neighbors to interpolate from */
+
+static
+void get_restrict_add(remapgrid_t *rg, double plat, double plon, const int *restrict src_bin_add,
+		      long *minadd, long *maxadd)
+{
+  long n, n2, nmax;
+  long min_add = 0, max_add = 0, nm1, np1, i, j, ip1, im1, jp1, jm1;
+  long nbins;
+  restr_t rlat, rlon;
+
+  nbins = rg->num_srch_bins;
+  rlat = RESTR_SCALE(plat);
+  rlon = RESTR_SCALE(plon);
+
+  if ( rg->restrict_type == RESTRICT_LATITUDE )
+    {
+      for ( n = 0; n < nbins; ++n )
+	{
+	  n2 = n<<1;
+	  if ( rlat >= rg->bin_lats[n2  ] && rlat <= rg->bin_lats[n2+1] )
+	    {
+	      min_add = src_bin_add[n2  ];
+	      max_add = src_bin_add[n2+1];
+
+	      nm1 = MAX(n-1, 0);
+	      np1 = MIN(n+1, rg->num_srch_bins-1);
+
+	      min_add = MIN(min_add, src_bin_add[2*nm1  ]);
+	      max_add = MAX(max_add, src_bin_add[2*nm1+1]);
+	      min_add = MIN(min_add, src_bin_add[2*np1  ]);
+	      max_add = MAX(max_add, src_bin_add[2*np1+1]);
+	    }
+	}
+    }
+  else if ( rg->restrict_type == RESTRICT_LATLON )
+    {
+      n = 0;
+      nmax = NINT(sqrt((double)rg->num_srch_bins)) - 1;
+      for ( j = 0; j < nmax; ++j )
+	{
+	  jp1 = MIN(j+1,nmax);
+	  jm1 = MAX(j-1,0);
+	  for ( i = 0; i < nmax; ++i )
+	    {
+	      ip1 = MIN(i+1, nmax);
+	      im1 = MAX(i-1, 0);
+
+	      n = n+1;
+	      if ( rlat >= rg->bin_lats[2*n  ] && rlat <= rg->bin_lats[2*n+1] &&
+		   rlon >= rg->bin_lons[2*n  ] && rlon <= rg->bin_lons[2*n+1] )
+		{
+		  min_add = src_bin_add[2*n  ];
+		  max_add = src_bin_add[2*n+1];
+
+		  nm1 = (jm1-1)*nmax + im1;
+		  np1 = (jp1-1)*nmax + ip1;
+		  nm1 = MAX(nm1, 0);
+		  np1 = MIN(np1, rg->num_srch_bins-1);
+
+		  min_add = MIN(min_add, src_bin_add[2*nm1  ]);
+		  max_add = MAX(max_add, src_bin_add[2*nm1+1]);
+		  min_add = MIN(min_add, src_bin_add[2*np1  ]);
+		  max_add = MAX(max_add, src_bin_add[2*np1+1]);
+		}
+	    }
+	}
+    }
+  else
+    cdoAbort("Unknown search restriction method!");
+
+  *minadd = min_add;
+  *maxadd = max_add;
+  /*
+  if ( cdoVerbose )
+    printf("plon %g plat %g min_add %ld max_add %ld diff %ld\n",
+	   plon, plat, min_add, max_add, max_add-min_add);
+  */
+}
+
+/*
+   This routine finds the closest num_neighbor points to a search 
+   point and computes a distance to each of the neighbors.
+*/
+static
+void grid_search_nbr(remapgrid_t *rg, int *restrict nbr_add, double *restrict nbr_dist, 
+		     double plat, double plon, double coslat_dst, double coslon_dst, 
+		     double sinlat_dst, double sinlon_dst, const int *restrict src_bin_add,
+		     const double *restrict sinlat, const double *restrict coslat,
+		     const double *restrict sinlon, const double *restrict coslon)
+{
+  /*
+    Output variables:
+
+    int nbr_add[num_neighbors]     ! address of each of the closest points
+    double nbr_dist[num_neighbors] ! distance to each of the closest points
+
+    Input variables:
+
+    int src_bin_add[][2]  ! search bins for restricting search
+
+    double plat,         ! latitude  of the search point
+    double plon,         ! longitude of the search point
+    double coslat_dst,   ! cos(lat)  of the search point
+    double coslon_dst,   ! cos(lon)  of the search point
+    double sinlat_dst,   ! sin(lat)  of the search point
+    double sinlon_dst    ! sin(lon)  of the search point
+  */
+  /*  Local variables */
+  long n, nadd, nchk;
+  long min_add, max_add;
+  double distance;     /* Angular distance */
+
+  /* Loop over source grid and find nearest neighbors                         */
+  /* restrict the search using search bins expand the bins to catch neighbors */
+
+  get_restrict_add(rg, plat, plon, src_bin_add, &min_add, &max_add);
+
+  /* Initialize distance and address arrays */
+  for ( n = 0; n < num_neighbors; ++n )
+    {
+      nbr_add[n]  = 0;
+      nbr_dist[n] = BIGNUM;
+    }
+
+  for ( nadd = min_add; nadd <= max_add; ++nadd )
+    {
+      /* Find distance to this point */
+      distance =  sinlat_dst*sinlat[nadd] + coslat_dst*coslat[nadd]*
+	         (coslon_dst*coslon[nadd] + sinlon_dst*sinlon[nadd]);
+      /* 2008-07-30 Uwe Schulzweida: check that distance is inside the range of -1 to 1,
+                                     otherwise the result of acos(distance) is NaN */
+      if ( distance >  1 ) distance =  1;
+      if ( distance < -1 ) distance = -1;
+      distance = acos(distance);
+
+      /* Uwe Schulzweida: if distance is zero, set to small number */
+      if ( IS_EQUAL(distance, 0) ) distance = TINY;
+
+      /* Store the address and distance if this is one of the smallest four so far */
+      for ( nchk = 0; nchk < num_neighbors; ++nchk )
+	{
+          if ( distance < nbr_dist[nchk] )
+	    {
+	      for ( n = num_neighbors-1; n > nchk; --n )
+		{
+		  nbr_add[n]  = nbr_add[n-1];
+		  nbr_dist[n] = nbr_dist[n-1];
+		}
+	      nbr_add[nchk]  = nadd + 1;
+	      nbr_dist[nchk] = distance;
+	      break;
+	    }
+        }
+    }
+
+}  /*  grid_search_nbr  */
+
+/*
+  This routine stores the address and weight for this link in
+  the appropriate address and weight arrays and resizes those
+  arrays if necessary.
+*/
+static
+void store_link_nbr(remapvars_t *rv, int add1, int add2, double weights)
+{
+  /*
+    Input variables:
+    int  add1         ! address on grid1
+    int  add2         ! address on grid2
+    double weights    ! remapping weight for this link
+  */
+  long nlink;
+
+  /*
+     Increment number of links and check to see if remap arrays need
+     to be increased to accomodate the new link.  Then store the link.
+  */
+  nlink = rv->num_links;
+
+  rv->num_links++;
+  if ( rv->num_links >= rv->max_links ) 
+    resize_remap_vars(rv, rv->resize_increment);
+
+  rv->grid1_add[nlink] = add1;
+  rv->grid2_add[nlink] = add2;
+
+  rv->wts[nlink] = weights;
+
+} /* store_link_nbr */
+
+
+/*
+  -----------------------------------------------------------------------
+
+   This routine computes the inverse-distance weights for a
+   nearest-neighbor interpolation.
+
+  -----------------------------------------------------------------------
+*/
+void remap_distwgt(remapgrid_t *rg, remapvars_t *rv)
+{
+  /*  Local variables */
+
+  long grid1_size;
+  long grid2_size;
+  long n;
+  long dst_add;                   /* destination address                     */
+  int nbr_mask[num_neighbors];    /* mask at nearest neighbors               */
+  int nbr_add[num_neighbors];     /* source address at nearest neighbors     */
+  double nbr_dist[num_neighbors]; /* angular distance four nearest neighbors */
+  double coslat_dst;       /* cos(lat) of destination grid point */
+  double coslon_dst;       /* cos(lon) of destination grid point */
+  double sinlat_dst;       /* sin(lat) of destination grid point */
+  double sinlon_dst;       /* sin(lon) of destination grid point */
+  double dist_tot;         /* sum of neighbor distances (for normalizing) */
+  double *coslat, *sinlat; /* cosine, sine of grid lats (for distance)    */
+  double *coslon, *sinlon; /* cosine, sine of grid lons (for distance)    */
+  double wgtstmp;          /* hold the link weight                        */
+
+  if ( ompNumThreads == 1 ) progressInit();
+
+  /* Compute mappings from grid1 to grid2 */
+
+  grid1_size = rg->grid1_size;
+  grid2_size = rg->grid2_size;
+
+  /* Compute cos, sin of lat/lon on source grid for distance calculations */
+
+  coslat = (double *) malloc(grid1_size*sizeof(double));
+  coslon = (double *) malloc(grid1_size*sizeof(double));
+  sinlat = (double *) malloc(grid1_size*sizeof(double));
+  sinlon = (double *) malloc(grid1_size*sizeof(double));
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(rg, grid1_size, coslat, coslon, sinlat, sinlon)
+#endif
+  for ( n = 0; n < grid1_size; ++n )
+    {
+      coslat[n] = cos(rg->grid1_center_lat[n]);
+      coslon[n] = cos(rg->grid1_center_lon[n]);
+      sinlat[n] = sin(rg->grid1_center_lat[n]);
+      sinlon[n] = sin(rg->grid1_center_lon[n]);
+    }
+
+  /* Loop over destination grid  */
+  /* grid_loop1 */
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(ompNumThreads, cdoTimer, rg, rv, grid2_size, coslat, coslon, sinlat, sinlon)	\
+  private(dst_add, n, coslat_dst, coslon_dst, sinlat_dst, sinlon_dst, dist_tot, \
+	  nbr_add, nbr_dist, nbr_mask, wgtstmp)	\
+  schedule(dynamic,1)
+#endif
+  for ( dst_add = 0; dst_add < grid2_size; ++dst_add )
+    {
+      if ( ompNumThreads == 1 ) progressStatus(0, 1, (dst_add+1.)/grid2_size);
+
+      if ( ! rg->grid2_mask[dst_add] ) continue;
+
+      coslat_dst = cos(rg->grid2_center_lat[dst_add]);
+      coslon_dst = cos(rg->grid2_center_lon[dst_add]);
+      sinlat_dst = sin(rg->grid2_center_lat[dst_add]);
+      sinlon_dst = sin(rg->grid2_center_lon[dst_add]);
+	
+      /* Find nearest grid points on source grid and distances to each point */
+
+      grid_search_nbr(rg, nbr_add, nbr_dist, 
+		      rg->grid2_center_lat[dst_add],
+		      rg->grid2_center_lon[dst_add],
+		      coslat_dst, coslon_dst, 
+		      sinlat_dst, sinlon_dst,
+		      rg->bin_addr1,
+		      sinlat, coslat, sinlon, coslon);
+
+      /*
+         Compute weights based on inverse distance
+	 if mask is false, eliminate those points
+      */
+      dist_tot = ZERO;
+      for ( n = 0; n < num_neighbors; ++n )
+	{
+	  nbr_mask[n] = FALSE;
+
+	  /* Uwe Schulzweida: check if nbr_add is valid */
+	  if ( nbr_add[n] > 0 )
+	    if ( rg->grid1_mask[nbr_add[n]-1] )
+	      {
+		nbr_dist[n] = ONE/nbr_dist[n];
+		dist_tot = dist_tot + nbr_dist[n];
+		nbr_mask[n] = TRUE;
+	      }
+	}
+
+      /* Normalize weights and store the link */
+
+      for ( n = 0; n < num_neighbors; ++n )
+	{
+          if ( nbr_mask[n] )
+	    {
+	      wgtstmp = nbr_dist[n]/dist_tot;
+
+	      rg->grid2_frac[dst_add] = ONE;
+#if defined (_OPENMP)
+#pragma omp critical
+#endif
+	      store_link_nbr(rv, nbr_add[n]-1, dst_add, wgtstmp);
+	    }
+	}
+
+    } /* grid_loop1 */
+
+  free(coslat);
+  free(coslon);
+  free(sinlat);
+  free(sinlon);
+
+}  /* remap_distwgt */
+
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/*                                                                         */
+/*      INTERPOLATION USING A DISTANCE-WEIGHTED AVERAGE WITH 1 NEIGHBOR    */
+/*                                                                         */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+/*
+   This routine finds the closest num_neighbor points to a search 
+   point and computes a distance to each of the neighbors.
+*/
+static
+void grid_search_nbr1(remapgrid_t *rg, int *restrict nbr_add, double *restrict nbr_dist, 
+		      double plat, double plon, double coslat_dst, double coslon_dst, 
+		      double sinlat_dst, double sinlon_dst, const int *restrict src_bin_add, 
+                      const double *restrict sinlat, const double *restrict coslat,
+		      const double *restrict sinlon, const double *restrict coslon)
+{
+  /*
+    Output variables:
+
+    int nbr_add[0]     ! address of each of the closest points
+    double nbr_dist[0] ! distance to each of the closest points
+
+    Input variables:
+
+    int src_bin_add[][2] ! search bins for restricting search
+
+    double plat,         ! latitude  of the search point
+    double plon,         ! longitude of the search point
+    double coslat_dst,   ! cos(lat)  of the search point
+    double coslon_dst,   ! cos(lon)  of the search point
+    double sinlat_dst,   ! sin(lat)  of the search point
+    double sinlon_dst    ! sin(lon)  of the search point
+  */
+  /*  Local variables */
+  long nadd;
+  long min_add, max_add;
+  double distance;     /* Angular distance */
+
+  /* Loop over source grid and find nearest neighbors                         */
+  /* restrict the search using search bins expand the bins to catch neighbors */
+
+  get_restrict_add(rg, plat, plon, src_bin_add, &min_add, &max_add);
+
+  /* Initialize distance and address arrays */
+  nbr_add[0]  = 0;
+  nbr_dist[0] = BIGNUM;
+
+  // printf("%g %g  min %d  max %d  range %d\n", plon, plat, min_add, max_add, max_add-min_add);
+  for ( nadd = min_add; nadd <= max_add; ++nadd )
+    {
+      /* Find distance to this point */
+      distance =  sinlat_dst*sinlat[nadd] + coslat_dst*coslat[nadd]*
+	         (coslon_dst*coslon[nadd] + sinlon_dst*sinlon[nadd]);
+      /* 2008-07-30 Uwe Schulzweida: check that distance is inside the range of -1 to 1,
+                                     otherwise the result of acos(distance) is NaN */
+      if ( distance >  1 ) distance =  1;
+      if ( distance < -1 ) distance = -1;
+      distance = acos(distance);
+
+      /* Store the address and distance if this is the smallest so far */
+      if ( distance < nbr_dist[0] )
+	{
+	  nbr_add[0]  = nadd + 1;
+	  nbr_dist[0] = distance;
+        }
+    }
+
+}  /*  grid_search_nbr1  */
+
+/*
+  This routine stores the address and weight for this link in
+  the appropriate address and weight arrays and resizes those
+  arrays if necessary.
+*/
+static
+void store_link_nbr1(remapvars_t *rv, int add1, int add2, double weights)
+{
+  /*
+    Input variables:
+    int  add1         ! address on grid1
+    int  add2         ! address on grid2
+    double weights    ! remapping weight for this link
+  */
+  long nlink;
+
+  /*
+     Increment number of links and check to see if remap arrays need
+     to be increased to accomodate the new link.  Then store the link.
+  */
+  nlink = rv->num_links;
+
+  rv->num_links++;
+  if ( rv->num_links >= rv->max_links ) 
+    resize_remap_vars(rv, rv->resize_increment);
+
+  rv->grid1_add[nlink] = add1;
+  rv->grid2_add[nlink] = add2;
+
+  rv->wts[nlink] = weights;
+
+} /* store_link_nbr1 */
+
+
+/*
+  -----------------------------------------------------------------------
+
+   This routine computes the inverse-distance weights for a
+   nearest-neighbor interpolation.
+
+  -----------------------------------------------------------------------
+*/
+void remap_distwgt1(remapgrid_t *rg, remapvars_t *rv)
+{
+
+  /*  Local variables */
+  long grid1_size;
+  long grid2_size;
+  long n;
+  long dst_add;            /* destination address */
+  int nbr_mask;            /* mask at nearest neighbors */
+  int nbr_add;             /* source address at nearest neighbors     */
+  double nbr_dist;         /* angular distance four nearest neighbors */
+  double coslat_dst;       /* cos(lat) of destination grid point */
+  double coslon_dst;       /* cos(lon) of destination grid point */
+  double sinlat_dst;       /* sin(lat) of destination grid point */
+  double sinlon_dst;       /* sin(lon) of destination grid point */
+  double *coslat, *sinlat; /* cosine, sine of grid lats (for distance)    */
+  double *coslon, *sinlon; /* cosine, sine of grid lons (for distance)    */
+  double wgtstmp;          /* hold the link weight                        */
+
+  if ( cdoTimer ) timer_start(timer_remap_nn);
+
+  if ( ompNumThreads == 1 ) progressInit();
+
+  /* Compute mappings from grid1 to grid2 */
+
+  grid1_size = rg->grid1_size;
+  grid2_size = rg->grid2_size;
+
+  /* Compute cos, sin of lat/lon on source grid for distance calculations */
+
+  coslat = (double *) malloc(grid1_size*sizeof(double));
+  coslon = (double *) malloc(grid1_size*sizeof(double));
+  sinlat = (double *) malloc(grid1_size*sizeof(double));
+  sinlon = (double *) malloc(grid1_size*sizeof(double));
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(rg, grid1_size, coslat, coslon, sinlat, sinlon)
+#endif
+  for ( n = 0; n < grid1_size; ++n )
+    {
+      coslat[n] = cos(rg->grid1_center_lat[n]);
+      coslon[n] = cos(rg->grid1_center_lon[n]);
+      sinlat[n] = sin(rg->grid1_center_lat[n]);
+      sinlon[n] = sin(rg->grid1_center_lon[n]);
+    }
+
+  /* Loop over destination grid  */
+  /* grid_loop1 */
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(ompNumThreads, cdoTimer, rg, rv, grid2_size, coslat, coslon, sinlat, sinlon)	\
+  private(dst_add, n, coslat_dst, coslon_dst, sinlat_dst, sinlon_dst,   \
+	  nbr_add, nbr_dist, nbr_mask, wgtstmp)	\
+  schedule(dynamic,1)
+#endif
+  for ( dst_add = 0; dst_add < grid2_size; ++dst_add )
+    {
+      if ( ompNumThreads == 1 ) progressStatus(0, 1, (dst_add+1.)/grid2_size);
+
+      if ( ! rg->grid2_mask[dst_add] ) continue;
+
+      coslat_dst = cos(rg->grid2_center_lat[dst_add]);
+      coslon_dst = cos(rg->grid2_center_lon[dst_add]);
+      sinlat_dst = sin(rg->grid2_center_lat[dst_add]);
+      sinlon_dst = sin(rg->grid2_center_lon[dst_add]);
+	
+      /* Find nearest grid points on source grid and  distances to each point */
+
+      grid_search_nbr1(rg, &nbr_add, &nbr_dist,
+		       rg->grid2_center_lat[dst_add],
+		       rg->grid2_center_lon[dst_add],
+		       coslat_dst, coslon_dst, 
+		       sinlat_dst, sinlon_dst,
+		       rg->bin_addr1,
+		       sinlat, coslat, sinlon, coslon);
+
+      /*
+         Compute weights based on inverse distance
+         if mask is false, eliminate those points
+      */
+      nbr_mask = FALSE;
+
+      /* Uwe Schulzweida: check if nbr_add is valid */
+      if ( nbr_add > 0 )
+	if ( rg->grid1_mask[nbr_add-1] )
+	  {
+	    nbr_mask = TRUE;
+	  }
+
+      /* Store the link */
+
+      if ( nbr_mask )
+	{
+	  wgtstmp = ONE;
+
+	  rg->grid2_frac[dst_add] = ONE;
+#if defined (_OPENMP)
+#pragma omp critical
+#endif
+	  store_link_nbr1(rv, nbr_add-1, dst_add, wgtstmp);
+	}
+
+    } /* grid_loop1 */
+
+  free(coslat);
+  free(coslon);
+  free(sinlat);
+  free(sinlon);
+
+  if ( cdoTimer ) timer_stop(timer_remap_nn);
+}  /* remap_distwgt1 */
+
+
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+/*                                                                         */
+/*      CONSERVATIVE INTERPOLATION                                         */
+/*                                                                         */
+/* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! */
+
+/*
+    This routine is identical to the intersection routine except
+    that a coordinate transformation (using a Lambert azimuthal
+    equivalent projection) is performed to treat polar cells more
+    accurately.
+*/
+static
+void pole_intersection(long *location, double *intrsct_lat, double *intrsct_lon, int *lcoinc,
+		       int *lthresh, double beglat, double beglon, double endlat, double endlon,
+		       double *begseg, int lrevers,
+		       long num_srch_cells, long srch_corners, const int *restrict srch_add,
+		       const double *restrict srch_corner_lat, const double *restrict srch_corner_lon,
+		       int *luse_last, double *intrsct_x, double *intrsct_y,
+		       int *avoid_pole_count, double *avoid_pole_offset)
+{
+  /*
+    Intent(in): 
+    double beglat, beglon,  ! beginning lat/lon endpoints for segment
+    double endlat, endlon   ! ending    lat/lon endpoints for segment
+    int    lrevers          ! flag true if segment integrated in reverse
+
+    Intent(inout) :
+    double begseg[2] ! begin lat/lon of full segment
+    int *location    ! address in destination array containing this
+                     ! segment -- also may contain last location on entry
+    int *lthresh     ! flag segment crossing threshold boundary
+
+    intent(out): 
+    *int lcoinc      ! flag segment coincident with grid line
+    double *intrsct_lat, *intrsct_lon ! lat/lon coords of next intersect.
+  */
+  /* Local variables */
+  long n, next_n, cell;
+  long ioffset;
+  int loutside; /* flags points outside grid */
+
+  double pi4, rns;           /*  north/south conversion */
+  double x1, x2;             /*  local x variables for segment */
+  double y1, y2;             /*  local y variables for segment */
+  double begx, begy;         /*  beginning x,y variables for segment */
+  double endx, endy;         /*  beginning x,y variables for segment */
+  double begsegx, begsegy;   /*  beginning x,y variables for segment */
+  double grdx1, grdx2;       /*  local x variables for grid cell */
+  double grdy1, grdy2;       /*  local y variables for grid cell */
+  double vec1_y, vec1_x;     /*  vectors and cross products used */
+  double vec2_y, vec2_x;     /*  during grid search */
+  double cross_product, eps; /*  eps=small offset away from intersect */
+  double s1, s2, determ;     /*  variables used for linear solve to   */
+  double mat1, mat2, mat3, mat4, rhs1, rhs2;  /* find intersection */
+
+  double *srch_corner_x;     /*  x of each corner of srch cells */
+  double *srch_corner_y;     /*  y of each corner of srch cells */
+
+  /*printf("pole_intersection: %g %g %g %g\n", beglat, beglon, endlat, endlon);*/
+
+  /* Initialize defaults, flags, etc. */
+
+  if ( ! *lthresh ) *location = -1;
+  *lcoinc      = FALSE;
+  *intrsct_lat = endlat;
+  *intrsct_lon = endlon;
+
+  loutside = FALSE;
+  s1 = ZERO;
+
+  /* Convert coordinates */
+
+  srch_corner_x = (double *) malloc(srch_corners*num_srch_cells*sizeof(double));
+  srch_corner_y = (double *) malloc(srch_corners*num_srch_cells*sizeof(double));
+
+  if ( beglat > ZERO )
+    {
+      pi4 = QUART*PI;
+      rns = ONE;
+    }
+  else
+    {
+      pi4 = -QUART*PI;
+      rns = -ONE;
+    }
+
+  if ( *luse_last )
+    {
+      x1 = *intrsct_x;
+      y1 = *intrsct_y;
+    }
+  else
+    {
+      x1 = rns*TWO*sin(pi4 - HALF*beglat)*cos(beglon);
+      y1 =     TWO*sin(pi4 - HALF*beglat)*sin(beglon);
+      *luse_last = TRUE;
+    }
+
+  x2 = rns*TWO*sin(pi4 - HALF*endlat)*cos(endlon);
+  y2 =     TWO*sin(pi4 - HALF*endlat)*sin(endlon);
+
+  for ( n = 0; n < srch_corners*num_srch_cells; ++n )
+    {
+      srch_corner_x[n] = rns*TWO*sin(pi4 - HALF*srch_corner_lat[n])*
+	                         cos(srch_corner_lon[n]);
+      srch_corner_y[n] =     TWO*sin(pi4 - HALF*srch_corner_lat[n])*
+	                         sin(srch_corner_lon[n]);
+    }
+
+  begx = x1;
+  begy = y1;
+  endx = x2;
+  endy = y2;
+  begsegx = rns*TWO*sin(pi4 - HALF*begseg[0])*cos(begseg[1]);
+  begsegy =     TWO*sin(pi4 - HALF*begseg[0])*sin(begseg[1]);
+  *intrsct_x = endx;
+  *intrsct_y = endy;
+
+  /*
+     Search for location of this segment in ocean grid using cross
+     product method to determine whether a point is enclosed by a cell
+  */
+  while ( TRUE ) /* srch_loop */
+    {
+      /* If last segment crossed threshold, use that location */
+
+      if ( *lthresh )
+	{
+	  for ( cell=0; cell < num_srch_cells; ++cell )
+	    if ( srch_add[cell] == *location )
+	      {
+		eps = TINY;
+		goto after_srch_loop;
+	      }
+	}
+
+      /* Otherwise normal search algorithm */
+
+      for ( cell = 0; cell < num_srch_cells; ++cell ) /* cell_loop  */
+	{
+	  ioffset = cell*srch_corners;
+	  for ( n = 0; n < srch_corners; ++n ) /* corner_loop */
+	    {
+	      next_n = (n+1)%srch_corners;
+	      /*
+		Here we take the cross product of the vector making 
+		up each cell side with the vector formed by the vertex
+		and search point.  If all the cross products are 
+		positive, the point is contained in the cell.
+	      */
+	      vec1_x = srch_corner_x[ioffset+next_n] - srch_corner_x[ioffset+n];
+	      vec1_y = srch_corner_y[ioffset+next_n] - srch_corner_y[ioffset+n];
+	      vec2_x = x1 - srch_corner_x[ioffset+n];
+	      vec2_y = y1 - srch_corner_y[ioffset+n];
+
+	      /* If endpoint coincident with vertex, offset the endpoint */
+
+	      if ( IS_EQUAL(vec2_x, 0) && IS_EQUAL(vec2_y, 0) )
+		{
+		  x1 += 1.e-10*(x2 - x1);
+		  y1 += 1.e-10*(y2 - y1);
+		  vec2_x = x1 - srch_corner_x[ioffset+n];
+		  vec2_y = y1 - srch_corner_y[ioffset+n];
+		}
+
+	      cross_product = vec1_x*vec2_y - vec2_x*vec1_y;
+
+	      /*
+		If the cross product for a side is ZERO, the point 
+                  lies exactly on the side or the length of a side
+                  is ZERO.  If the length is ZERO set det > 0.
+                  otherwise, perform another cross 
+                  product between the side and the segment itself. 
+	        If this cross product is also ZERO, the line is 
+	          coincident with the cell boundary - perform the 
+                  dot product and only choose the cell if the dot 
+                  product is positive (parallel vs anti-parallel).
+	      */
+	      if ( IS_EQUAL(cross_product, 0) )
+		{
+		  if ( IS_NOT_EQUAL(vec1_x, 0) || IS_NOT_EQUAL(vec1_y, 0) )
+		    {
+		      vec2_x = x2 - x1;
+		      vec2_y = y2 - y1;
+		      cross_product = vec1_x*vec2_y - vec2_x*vec1_y;
+		    }
+		  else
+		    cross_product = ONE;
+
+		  if ( IS_EQUAL(cross_product, 0) )
+		    {
+		      *lcoinc = TRUE;
+		      cross_product = vec1_x*vec2_x + vec1_y*vec2_y;
+		      if ( lrevers ) cross_product = -cross_product;
+		    }
+		}
+
+	      /* If cross product is less than ZERO, this cell doesn't work */
+
+	      if ( cross_product < ZERO ) break; /* corner_loop */
+	     
+	    } /* corner_loop */
+
+	  /* If cross products all positive, we found the location */
+
+	  if  ( n >= srch_corners )
+	    {
+	      *location = srch_add[cell];
+	      /*
+		If the beginning of this segment was outside the
+		grid, invert the segment so the intersection found
+		will be the first intersection with the grid
+	      */
+	      if ( loutside )
+		{
+		  x2 = begx;
+		  y2 = begy;
+		  *location = -1;
+		  eps  = -TINY;
+		}
+	      else
+		eps  = TINY;
+            
+	      goto after_srch_loop;
+	    }
+
+	  /* Otherwise move on to next cell */
+
+	} /* cell_loop */
+
+     /*
+       If no cell found, the point lies outside the grid.
+       take some baby steps along the segment to see if any
+       part of the segment lies inside the grid.  
+     */
+      loutside = TRUE;
+      s1 = s1 + BABY_STEP;
+      x1 = begx + s1*(x2 - begx);
+      y1 = begy + s1*(y2 - begy);
+
+      /* Reached the end of the segment and still outside the grid return no intersection */
+
+      if ( s1 >= ONE )
+	{
+          free(srch_corner_y);
+          free(srch_corner_x);
+          *luse_last = FALSE;
+          return;
+	}
+    } /* srch_loop */
+
+ after_srch_loop:
+
+  /*
+    Now that a cell is found, search for the next intersection.
+    Loop over sides of the cell to find intersection with side
+    must check all sides for coincidences or intersections
+  */
+
+  ioffset = cell*srch_corners;
+
+  for ( n = 0; n < srch_corners; ++n ) /* intrsct_loop */
+    {
+      next_n = (n+1)%srch_corners;
+
+      grdy1 = srch_corner_y[ioffset+n];
+      grdy2 = srch_corner_y[ioffset+next_n];
+      grdx1 = srch_corner_x[ioffset+n];
+      grdx2 = srch_corner_x[ioffset+next_n];
+
+      /* Set up linear system to solve for intersection */
+
+      mat1 = x2 - x1;
+      mat2 = grdx1 - grdx2;
+      mat3 = y2 - y1;
+      mat4 = grdy1 - grdy2;
+      rhs1 = grdx1 - x1;
+      rhs2 = grdy1 - y1;
+
+      determ = mat1*mat4 - mat2*mat3;
+
+      /*
+         If the determinant is ZERO, the segments are either 
+           parallel or coincident.  Coincidences were detected 
+           above so do nothing.
+         If the determinant is non-ZERO, solve for the linear 
+           parameters s for the intersection point on each line 
+           segment.
+         If 0<s1,s2<1 then the segment intersects with this side.
+           Return the point of intersection (adding a small
+           number so the intersection is off the grid line).
+      */
+      if ( fabs(determ) > 1.e-30 )
+	{
+          s1 = (rhs1*mat4 - mat2*rhs2)/determ;
+          s2 = (mat1*rhs2 - rhs1*mat3)/determ;
+
+	  /* Uwe Schulzweida: s1 >= ZERO! (bug fix) */
+          if ( s2 >= ZERO && s2 <= ONE && s1 >= ZERO && s1 <= ONE )
+	    {
+	      /*
+		Recompute intersection based on full segment
+		so intersections are consistent for both sweeps
+	      */
+	      if ( ! loutside )
+		{
+		  mat1 = x2 - begsegx;
+		  mat3 = y2 - begsegy;
+		  rhs1 = grdx1 - begsegx;
+		  rhs2 = grdy1 - begsegy;
+		}
+	      else
+		{
+		  mat1 = x2 - endx;
+		  mat3 = y2 - endy;
+		  rhs1 = grdx1 - endx;
+		  rhs2 = grdy1 - endy;
+		}
+
+	      determ = mat1*mat4 - mat2*mat3;
+
+	      /*
+		Sometimes due to roundoff, the previous 
+		determinant is non-ZERO, but the lines
+		are actually coincident.  If this is the
+		case, skip the rest.
+	      */
+	      if ( IS_NOT_EQUAL(determ, 0) )
+	       {
+		 s1 = (rhs1*mat4 - mat2*rhs2)/determ;
+		 s2 = (mat1*rhs2 - rhs1*mat3)/determ;
+
+		 if ( ! loutside )
+		   {
+		     *intrsct_x = begsegx + s1*mat1;
+		     *intrsct_y = begsegy + s1*mat3;
+		   }
+		 else 
+		   {
+		     *intrsct_x = endx + s1*mat1;
+		     *intrsct_y = endy + s1*mat3;
+		   }
+
+		 /* Convert back to lat/lon coordinates */
+
+		 *intrsct_lon = rns*atan2(*intrsct_y, *intrsct_x);
+		 if ( *intrsct_lon < ZERO ) 
+		   *intrsct_lon = *intrsct_lon + PI2;
+		 
+		 if ( fabs(*intrsct_x) > 1.e-10 )
+		   *intrsct_lat = (pi4 - asin(rns*HALF*(*intrsct_x)/cos(*intrsct_lon)))*TWO;
+		 else if ( fabs(*intrsct_y) > 1.e-10 )
+		   *intrsct_lat = (pi4 - asin(HALF*(*intrsct_y)/sin(*intrsct_lon)))*TWO;
+		 else
+		   *intrsct_lat = TWO*pi4;
+
+		 /* Add offset in transformed space for next pass. */
+
+		 if ( s1 - eps/determ < ONE )
+		   {
+		     *intrsct_x = *intrsct_x - mat1*(eps/determ);
+		     *intrsct_y = *intrsct_y - mat3*(eps/determ);
+		   }
+		 else
+		   {
+		     if ( ! loutside)
+		       {
+			 *intrsct_x = endx;
+			 *intrsct_y = endy;
+			 *intrsct_lat = endlat;
+			 *intrsct_lon = endlon;
+		       }
+		     else 
+		       {
+			 *intrsct_x = begsegx;
+			 *intrsct_y = begsegy;
+			 *intrsct_lat = begseg[0];
+			 *intrsct_lon = begseg[1];
+		       }
+		   }
+
+		 break; /* intrsct_loop */
+	       }
+	    }
+	}
+ 
+      /* No intersection this side, move on to next side */
+
+    } /* intrsct_loop */
+
+  free(srch_corner_y);
+  free(srch_corner_x);
+
+  /*
+     If segment manages to cross over pole, shift the beginning 
+     endpoint in order to avoid hitting pole directly
+     (it is ok for endpoint to be pole point)
+  */
+
+  if ( fabs(*intrsct_x) < 1.e-10 && fabs(*intrsct_y) < 1.e-10 &&
+       (IS_NOT_EQUAL(endx, 0) && IS_NOT_EQUAL(endy, 0)) )
+    {
+      if ( *avoid_pole_count > 2 )
+	{
+	  *avoid_pole_count  = 0;
+	  *avoid_pole_offset = 10.*(*avoid_pole_offset);
+        }
+
+      cross_product = begsegx*(endy-begsegy) - begsegy*(endx-begsegx);
+      *intrsct_lat = begseg[0];
+      if ( cross_product*(*intrsct_lat) > ZERO )
+	{
+          *intrsct_lon = beglon    + *avoid_pole_offset;
+          begseg[1]    = begseg[1] + *avoid_pole_offset;
+	}
+      else
+	{
+          *intrsct_lon = beglon    - *avoid_pole_offset;
+          begseg[1]    = begseg[1] - *avoid_pole_offset;
+        }
+
+      *avoid_pole_count = *avoid_pole_count + 1;
+      *luse_last = FALSE;
+    }
+  else
+    {
+      *avoid_pole_count  = 0;
+      *avoid_pole_offset = TINY;
+    }
+
+  /*
+     If the segment crosses a pole threshold, reset the intersection
+     to be the threshold latitude and do not reuse x,y intersect
+     on next entry.  Only check if did not cross threshold last
+     time - sometimes the coordinate transformation can place a
+     segment on the other side of the threshold again
+  */
+  if ( *lthresh )
+    {
+      if ( *intrsct_lat > north_thresh || *intrsct_lat < south_thresh )
+	*lthresh = FALSE;
+    }
+  else if ( beglat > ZERO && *intrsct_lat < north_thresh )
+    {
+      mat4 = endlat - begseg[0];
+      mat3 = endlon - begseg[1];
+      if ( mat3 >  PI ) mat3 = mat3 - PI2;
+      if ( mat3 < -PI ) mat3 = mat3 + PI2;
+      *intrsct_lat = north_thresh - TINY;
+      s1 = (north_thresh - begseg[0])/mat4;
+      *intrsct_lon = begseg[1] + s1*mat3;
+      *luse_last = FALSE;
+      *lthresh = TRUE;
+    }
+  else if ( beglat < ZERO && *intrsct_lat > south_thresh )
+    {
+      mat4 = endlat - begseg[0];
+      mat3 = endlon - begseg[1];
+      if ( mat3 >  PI ) mat3 = mat3 - PI2;
+      if ( mat3 < -PI ) mat3 = mat3 + PI2;
+      *intrsct_lat = south_thresh + TINY;
+      s1 = (south_thresh - begseg[0])/mat4;
+      *intrsct_lon = begseg[1] + s1*mat3;
+      *luse_last = FALSE;
+      *lthresh = TRUE;
+    }
+
+  /* If reached end of segment, do not use x,y intersect on next entry */
+
+  if ( IS_EQUAL(*intrsct_lat, endlat) && IS_EQUAL(*intrsct_lon, endlon) ) *luse_last = FALSE;
+
+}  /* pole_intersection */
+
+
+/*
+   This routine finds the next intersection of a destination grid line with 
+   the line segment given by beglon, endlon, etc.
+   A coincidence flag is returned if the segment is entirely coincident with 
+   an ocean grid line.  The cells in which to search for an intersection must 
+   have already been restricted in the calling routine.
+*/
+static
+void intersection(long *location, double *intrsct_lat, double *intrsct_lon, int *lcoinc,
+		  double beglat, double beglon, double endlat, double endlon, double *begseg,
+		  int lbegin, int lrevers,
+		  long num_srch_cells, long srch_corners, const int *restrict srch_add,
+		  const double *restrict srch_corner_lat, const double *restrict srch_corner_lon,
+		  int *last_loc, int *lthresh, double *intrsct_lat_off, double *intrsct_lon_off,
+		  int *luse_last, double *intrsct_x, double *intrsct_y,
+		  int *avoid_pole_count, double *avoid_pole_offset)
+{
+  /*
+    Intent(in): 
+    int lbegin,             ! flag for first integration along this segment
+    int lrevers             ! flag whether segment integrated in reverse
+    double beglat, beglon,  ! beginning lat/lon endpoints for segment
+    double endlat, endlon   ! ending    lat/lon endpoints for segment
+
+    Intent(inout) :: 
+    double *begseg          ! begin lat/lon of full segment
+
+    intent(out): 
+    int *location           ! address in destination array containing this segment
+    int *lcoinc             ! flag segments which are entirely coincident with a grid line
+    double *intrsct_lat, *intrsct_lon ! lat/lon coords of next intersect.
+  */
+  /* Local variables */
+  long n, next_n, cell;
+  long ioffset;
+
+  int  loutside;             /* flags points outside grid */
+
+  double lon1, lon2;         /* local longitude variables for segment */
+  double lat1, lat2;         /* local latitude  variables for segment */
+  double grdlon1, grdlon2;   /* local longitude variables for grid cell */
+  double grdlat1, grdlat2;   /* local latitude  variables for grid cell */
+  double vec1_lat, vec1_lon; /* vectors and cross products used */
+  double vec2_lat, vec2_lon; /* during grid search */
+  double cross_product; 
+  double eps, offset;        /* small offset away from intersect */
+  double s1, s2, determ;     /* variables used for linear solve to */
+  double mat1 = 0, mat2, mat3 = 0, mat4, rhs1, rhs2;  /* find intersection */
+
+  /* Initialize defaults, flags, etc. */
+
+  *location    = -1;
+  *lcoinc      = FALSE;
+  *intrsct_lat = endlat;
+  *intrsct_lon = endlon;
+
+  if ( num_srch_cells == 0 ) return;
+
+  if ( beglat > north_thresh || beglat < south_thresh )
+    {
+      if ( *lthresh ) *location = *last_loc;
+      pole_intersection(location,
+			intrsct_lat, intrsct_lon, lcoinc, lthresh,
+			beglat, beglon, endlat, endlon, begseg, lrevers,
+			num_srch_cells, srch_corners, srch_add,
+			srch_corner_lat, srch_corner_lon,
+			luse_last, intrsct_x, intrsct_y,
+			avoid_pole_count, avoid_pole_offset);
+
+      if ( *lthresh )
+	{
+          *last_loc = *location;
+          *intrsct_lat_off = *intrsct_lat;
+          *intrsct_lon_off = *intrsct_lon;
+        }
+      return;
+    }
+
+  loutside = FALSE;
+  if ( lbegin )
+    {
+      lat1 = beglat;
+      lon1 = beglon;
+    }
+  else
+    {
+      lat1 = *intrsct_lat_off;
+      lon1 = *intrsct_lon_off;
+    }
+
+  lat2 = endlat;
+  lon2 = endlon;
+  if      ( (lon2-lon1) >  THREE*PIH ) lon2 -= PI2;
+  else if ( (lon2-lon1) < -THREE*PIH ) lon2 += PI2;
+
+  s1 = ZERO;
+
+  /*
+     Search for location of this segment in ocean grid using cross
+     product method to determine whether a point is enclosed by a cell
+  */
+  while ( TRUE ) /* srch_loop */
+    {
+      /* If last segment crossed threshold, use that location */
+
+      if ( *lthresh )
+       {
+         for ( cell = 0; cell < num_srch_cells; ++cell )
+	   if ( srch_add[cell] == *last_loc )
+	     {
+               *location = *last_loc;
+               eps = TINY;
+               goto after_srch_loop;
+	     }
+       }
+
+      /* Otherwise normal search algorithm */
+
+      for ( cell = 0; cell < num_srch_cells; ++cell ) /* cell_loop  */
+	{
+	  ioffset = cell*srch_corners;
+	  for ( n = 0; n < srch_corners; n++ ) /* corner_loop */
+	    {
+	      next_n = (n+1)%srch_corners;
+	      /*
+		Here we take the cross product of the vector making 
+		up each cell side with the vector formed by the vertex
+		and search point.  If all the cross products are 
+		positive, the point is contained in the cell.
+	      */
+	      vec1_lat = srch_corner_lat[ioffset+next_n] - srch_corner_lat[ioffset+n];
+	      vec1_lon = srch_corner_lon[ioffset+next_n] - srch_corner_lon[ioffset+n];
+	      vec2_lat = lat1 - srch_corner_lat[ioffset+n];
+	      vec2_lon = lon1 - srch_corner_lon[ioffset+n];
+
+	      /* If endpoint coincident with vertex, offset the endpoint */
+
+	      if ( IS_EQUAL(vec2_lat, 0) && IS_EQUAL(vec2_lon, 0) )
+		{
+		  lat1 += 1.e-10*(lat2-lat1);
+		  lon1 += 1.e-10*(lon2-lon1);
+		  vec2_lat = lat1 - srch_corner_lat[ioffset+n];
+		  vec2_lon = lon1 - srch_corner_lon[ioffset+n];
+		}
+
+	      /* Check for 0,2pi crossings */
+
+	      if      ( vec1_lon >  PI ) vec1_lon -= PI2;
+	      else if ( vec1_lon < -PI ) vec1_lon += PI2;
+
+	      if      ( vec2_lon >  PI ) vec2_lon -= PI2;
+	      else if ( vec2_lon < -PI ) vec2_lon += PI2;
+
+	      cross_product = vec1_lon*vec2_lat - vec2_lon*vec1_lat;
+
+	      /*
+	       If the cross product for a side is ZERO, the point 
+                 lies exactly on the side or the side is degenerate
+                 (ZERO length).  If degenerate, set the cross 
+                 product to a positive number.  Otherwise perform 
+                 another cross product between the side and the 
+                 segment itself. 
+	       If this cross product is also ZERO, the line is 
+                 coincident with the cell boundary - perform the 
+                 dot product and only choose the cell if the dot 
+                 product is positive (parallel vs anti-parallel).
+	      */
+	      if ( IS_EQUAL(cross_product, 0) )
+		{
+		  if ( IS_NOT_EQUAL(vec1_lat, 0) || IS_NOT_EQUAL(vec1_lon, 0) )
+		    {
+		      vec2_lat = lat2 - lat1;
+		      vec2_lon = lon2 - lon1;
+
+		      if      ( vec2_lon >  PI ) vec2_lon -= PI2;
+		      else if ( vec2_lon < -PI ) vec2_lon += PI2;
+
+		      cross_product = vec1_lon*vec2_lat - vec2_lon*vec1_lat;
+		    }
+		  else
+		    cross_product = ONE;
+
+		  if ( IS_EQUAL(cross_product, 0) )
+		    {
+		      *lcoinc = TRUE;
+		      cross_product = vec1_lon*vec2_lon + vec1_lat*vec2_lat;
+		      if ( lrevers ) cross_product = -cross_product;
+		    }
+		}
+
+	      /* If cross product is less than ZERO, this cell doesn't work */
+
+	      if ( cross_product < ZERO ) break; /* corner_loop */
+
+	    } /* corner_loop */
+
+	  /* If cross products all positive, we found the location */
+
+	  if ( n >= srch_corners )
+	    {
+	      *location = srch_add[cell];
+	      /*
+		If the beginning of this segment was outside the
+		grid, invert the segment so the intersection found
+		will be the first intersection with the grid
+	      */
+	      if ( loutside )
+		{
+		  lat2 = beglat;
+		  lon2 = beglon;
+		  *location = -1;
+		  eps  = -TINY;
+		}
+	      else
+		eps  = TINY;
+
+	      goto after_srch_loop;
+	    }
+
+	  /* Otherwise move on to next cell */
+
+	} /* cell_loop */
+
+      /*
+	If still no cell found, the point lies outside the grid.
+	Take some baby steps along the segment to see if any
+	part of the segment lies inside the grid.  
+      */
+      loutside = TRUE;
+      s1 = s1 + BABY_STEP;
+      lat1 = beglat + s1*(endlat - beglat);
+      lon1 = beglon + s1*(lon2   - beglon);
+
+      /* Reached the end of the segment and still outside the grid return no intersection */
+
+      if ( s1 >= ONE ) return;
+
+    } /* srch_loop */
+
+ after_srch_loop:
+
+  /*
+    Now that a cell is found, search for the next intersection.
+    Loop over sides of the cell to find intersection with side
+    must check all sides for coincidences or intersections
+  */
+
+  ioffset = cell*srch_corners;
+
+  for ( n = 0; n < srch_corners; ++n ) /* intrsct_loop */
+    {
+      next_n = (n+1)%srch_corners;
+
+      grdlon1 = srch_corner_lon[ioffset+n];
+      grdlon2 = srch_corner_lon[ioffset+next_n];
+      grdlat1 = srch_corner_lat[ioffset+n];
+      grdlat2 = srch_corner_lat[ioffset+next_n];
+
+      /* Set up linear system to solve for intersection */
+
+      mat1 = lat2 - lat1;
+      mat2 = grdlat1 - grdlat2;
+      mat3 = lon2 - lon1;
+      mat4 = grdlon1 - grdlon2;
+      rhs1 = grdlat1 - lat1;
+      rhs2 = grdlon1 - lon1;
+
+      if      ( mat3 >  PI ) mat3 -= PI2;
+      else if ( mat3 < -PI ) mat3 += PI2;
+
+      if      ( mat4 >  PI ) mat4 -= PI2;
+      else if ( mat4 < -PI ) mat4 += PI2;
+
+      if      ( rhs2 >  PI ) rhs2 -= PI2;
+      else if ( rhs2 < -PI ) rhs2 += PI2;
+
+      determ = mat1*mat4 - mat2*mat3;
+
+      /*
+         If the determinant is ZERO, the segments are either 
+           parallel or coincident.  Coincidences were detected 
+           above so do nothing.
+         If the determinant is non-ZERO, solve for the linear 
+           parameters s for the intersection point on each line 
+           segment.
+         If 0<s1,s2<1 then the segment intersects with this side.
+           Return the point of intersection (adding a small
+           number so the intersection is off the grid line).
+      */
+      if ( fabs(determ) > 1.e-30 )
+	{
+	  s1 = (rhs1*mat4 - mat2*rhs2)/determ;
+	  s2 = (mat1*rhs2 - rhs1*mat3)/determ;
+
+	  if ( s2 >= ZERO && s2 <= ONE && s1 >= ZERO && s1 <= ONE )
+	    {
+	      /*
+		Recompute intersection based on full segment
+		so intersections are consistent for both sweeps
+	      */
+	      if ( ! loutside )
+		{
+		  mat1 = lat2 - begseg[0];
+		  mat3 = lon2 - begseg[1];
+		  rhs1 = grdlat1 - begseg[0];
+		  rhs2 = grdlon1 - begseg[1];
+		}
+	      else
+		{
+		  mat1 = begseg[0] - endlat;
+		  mat3 = begseg[1] - endlon;
+		  rhs1 = grdlat1 - endlat;
+		  rhs2 = grdlon1 - endlon;
+		}
+
+	      if      ( mat3 >  PI ) mat3 -= PI2;
+	      else if ( mat3 < -PI ) mat3 += PI2;
+
+	      if      ( rhs2 > PI  ) rhs2 -= PI2;
+	      else if ( rhs2 < -PI ) rhs2 += PI2;
+
+	      determ = mat1*mat4 - mat2*mat3;
+
+	      /*
+		Sometimes due to roundoff, the previous 
+		determinant is non-ZERO, but the lines
+		are actually coincident.  If this is the
+		case, skip the rest.
+	      */
+	      if ( IS_NOT_EQUAL(determ, 0) )
+		{
+		  s1 = (rhs1*mat4 - mat2*rhs2)/determ;
+		  s2 = (mat1*rhs2 - rhs1*mat3)/determ;
+
+		  offset = s1 + eps/determ;
+		  if ( offset > ONE ) offset = ONE;
+
+		  if ( ! loutside )
+		    {
+		      *intrsct_lat = begseg[0] + mat1*s1;
+		      *intrsct_lon = begseg[1] + mat3*s1;
+		      *intrsct_lat_off = begseg[0] + mat1*offset;
+		      *intrsct_lon_off = begseg[1] + mat3*offset;
+		    }
+		  else
+		    {
+		      *intrsct_lat = endlat + mat1*s1;
+		      *intrsct_lon = endlon + mat3*s1;
+		      *intrsct_lat_off = endlat + mat1*offset;
+		      *intrsct_lon_off = endlon + mat3*offset;
+		    }
+		  break; /* intrsct_loop */
+		}
+	    }
+	}
+
+      /* No intersection this side, move on to next side */
+
+    } /* intrsct_loop */
+
+  /*
+     If the segment crosses a pole threshold, reset the intersection
+     to be the threshold latitude.  Only check if this was not a
+     threshold segment since sometimes coordinate transform can end
+     up on other side of threshold again.
+  */
+  if ( *lthresh )
+    {
+      if ( *intrsct_lat < north_thresh || *intrsct_lat > south_thresh )
+	*lthresh = FALSE;
+    }
+  else if ( lat1 > ZERO && *intrsct_lat > north_thresh )
+    {
+      *intrsct_lat = north_thresh + TINY;
+      *intrsct_lat_off = north_thresh + eps*mat1;
+      s1 = (*intrsct_lat - begseg[0])/mat1;
+      *intrsct_lon     = begseg[1] + s1*mat3;
+      *intrsct_lon_off = begseg[1] + (s1+eps)*mat3;
+      *last_loc = *location;
+      *lthresh = TRUE;
+    }
+  else if ( lat1 < ZERO && *intrsct_lat < south_thresh )
+    {
+      *intrsct_lat = south_thresh - TINY;
+      *intrsct_lat_off = south_thresh + eps*mat1;
+      s1 = (*intrsct_lat - begseg[0])/mat1;
+      *intrsct_lon     = begseg[1] + s1*mat3;
+      *intrsct_lon_off = begseg[1] + (s1+eps)*mat3;
+      *last_loc = *location;
+      *lthresh = TRUE;
+    }
+
+}  /* intersection */
+
+
+/*
+   This routine computes the line integral of the flux function 
+   that results in the interpolation weights.  The line is defined
+   by the input lat/lon of the endpoints.
+*/
+static
+void line_integral(double *weights, double in_phi1, double in_phi2, 
+		   double theta1, double theta2, double grid1_lon, double grid2_lon)
+{
+  /*
+    Intent(in): 
+    double in_phi1, in_phi2,     ! Longitude endpoints for the segment
+    double theta1, theta2,       ! Latitude  endpoints for the segment
+    double grid1_lon,            ! Reference coordinates for each
+    double grid2_lon             ! Grid (to ensure correct 0,2pi interv.)
+
+    Intent(out):
+    double weights[6]            ! Line integral contribution to weights
+  */
+
+  /*  Local variables  */
+  double dphi, sinth1, sinth2, costh1, costh2, fac;
+  double phi1, phi2;
+  double f1, f2, fint;
+
+  /*  Weights for the general case based on a trapezoidal approx to the integrals. */
+
+  sinth1 = sin(theta1);
+  sinth2 = sin(theta2);
+  costh1 = cos(theta1);
+  costh2 = cos(theta2);
+
+  dphi = in_phi1 - in_phi2;
+  if      ( dphi >  PI ) dphi -= PI2;
+  else if ( dphi < -PI ) dphi += PI2;
+      
+  dphi = HALF*dphi;
+
+  /*
+     The first weight is the area overlap integral. The second and
+     fourth are second-order latitude gradient weights.
+  */
+  weights[0] = dphi*(sinth1 + sinth2);
+  weights[1] = dphi*(costh1 + costh2 + (theta1*sinth1 + theta2*sinth2));
+  weights[3] = weights[0];
+  weights[4] = weights[1];
+
+  /*
+     The third and fifth weights are for the second-order phi gradient
+     component.  Must be careful of longitude range.
+  */
+  f1 = HALF*(costh1*sinth1 + theta1);
+  f2 = HALF*(costh2*sinth2 + theta2);
+
+  phi1 = in_phi1 - grid1_lon;
+  if      ( phi1 >  PI ) phi1 -= PI2;
+  else if ( phi1 < -PI ) phi1 += PI2;
+
+  phi2 = in_phi2 - grid1_lon;
+  if      ( phi2 >  PI ) phi2 -= PI2;
+  else if ( phi2 < -PI ) phi2 += PI2;
+
+  if ( (phi2-phi1) <  PI && (phi2-phi1) > -PI )
+    weights[2] = dphi*(phi1*f1 + phi2*f2);
+  else
+    {
+      if ( phi1 > ZERO )
+	fac = PI;
+      else
+	fac = -PI;
+
+      fint = f1 + (f2-f1)*(fac-phi1)/fabs(dphi);
+      weights[2] = HALF*phi1*(phi1-fac)*f1 -
+	           HALF*phi2*(phi2+fac)*f2 +
+	           HALF*fac*(phi1+phi2)*fint;
+    }
+
+  phi1 = in_phi1 - grid2_lon;
+  if      ( phi1 >  PI ) phi1 -= PI2;
+  else if ( phi1 < -PI ) phi1 += PI2;
+
+  phi2 = in_phi2 - grid2_lon;
+  if      ( phi2 >  PI ) phi2 -= PI2;
+  else if ( phi2 < -PI ) phi2 += PI2;
+
+  if ( (phi2-phi1) <  PI  && (phi2-phi1) > -PI )
+    weights[5] = dphi*(phi1*f1 + phi2*f2);
+  else
+    {
+      if ( phi1 > ZERO ) fac =  PI;
+      else               fac = -PI;
+
+      fint = f1 + (f2-f1)*(fac-phi1)/fabs(dphi);
+      weights[5] = HALF*phi1*(phi1-fac)*f1 -
+     	           HALF*phi2*(phi2+fac)*f2 +
+	           HALF*fac*(phi1+phi2)*fint;
+    }
+
+}  /* line_integral */
+
+static
+void grid_store_init(grid_store_t *grid_store, long gridsize)
+{
+  long iblk;
+  long blksize[] = {128, 256, 512, 1024, 2048, 4096, 8192};
+  long nblks = sizeof(blksize)/sizeof(long);
+  long nblocks;
+
+  for ( iblk = nblks-1; iblk >= 0; --iblk )
+    if ( gridsize/blksize[iblk] > 99 ) break;
+
+  if ( iblk < 0 ) iblk = 0;
+
+  /* grid_store->blk_size = BLK_SIZE; */
+  grid_store->blk_size = blksize[iblk];
+  grid_store->max_size = gridsize;
+
+  grid_store->nblocks = grid_store->max_size/grid_store->blk_size;
+  if ( grid_store->max_size%grid_store->blk_size > 0 ) grid_store->nblocks++;
+
+  if ( cdoVerbose )
+    fprintf(stdout, "blksize = %d  lastblksize = %d  max_size = %d  nblocks = %d\n", 
+	    grid_store->blk_size, grid_store->max_size%grid_store->blk_size, 
+	    grid_store->max_size, grid_store->nblocks);
+
+  grid_store->blksize = (int *) malloc(grid_store->nblocks*sizeof(int));
+  grid_store->nlayers = (int *) malloc(grid_store->nblocks*sizeof(int));
+  grid_store->layers  = (grid_layer_t **) malloc(grid_store->nblocks*sizeof(grid_layer_t *));
+
+  nblocks = grid_store->nblocks;
+  for ( iblk = 0; iblk < nblocks; ++iblk )
+    {
+      grid_store->blksize[iblk] = grid_store->blk_size;
+      grid_store->nlayers[iblk] = 0;
+      grid_store->layers[iblk]  = NULL;
+    }
+  if ( grid_store->max_size%grid_store->blk_size > 0 )
+    grid_store->blksize[grid_store->nblocks-1] = grid_store->max_size%grid_store->blk_size;
+}
+
+static
+void grid_store_delete(grid_store_t *grid_store)
+{
+  grid_layer_t *grid_layer, *grid_layer_f;
+  long ilayer;
+  long i, j;
+  long iblk;
+
+  for ( iblk = 0; iblk < grid_store->nblocks; ++iblk )
+    {
+      j = 0;
+      grid_layer = grid_store->layers[iblk];
+      for ( ilayer = 0; ilayer < grid_store->nlayers[iblk]; ++ilayer )
+	{
+	  if ( cdoVerbose )
+	    {
+	      for ( i = 0; i < grid_store->blksize[iblk]; ++i )
+		if ( grid_layer->grid2_link[i] != -1 ) j++;
+	    }
+	      
+	  grid_layer_f = grid_layer;
+	  free(grid_layer->grid2_link);
+	  grid_layer = grid_layer->next;
+	  free(grid_layer_f);
+	}
+
+      if ( cdoVerbose )
+	{
+	  fprintf(stderr, "block = %ld nlayers = %d  allocated = %d  used = %ld\n",
+		  iblk+1, grid_store->nlayers[iblk], 
+		  grid_store->nlayers[iblk]*grid_store->blksize[iblk], j);
+	}
+    }
+
+  free(grid_store->blksize);
+  free(grid_store->layers);
+  free(grid_store->nlayers);  
+}
+
+/*
+    This routine stores the address and weight for this link in the appropriate 
+    address and weight arrays and resizes those arrays if necessary.
+*/
+static
+void store_link_cnsrv_fast(remapvars_t *rv, long add1, long add2, double *weights, grid_store_t *grid_store)
+{
+  /*
+    Input variables:
+    int  add1         ! address on grid1
+    int  add2         ! address on grid2
+    double weights[6] ! array of remapping weights for this link
+  */
+  /* Local variables */
+  long nlink; /* link index */
+  long ilayer, i, iblk, iadd2;
+  long nlayer, blksize;
+  int lstore_link;
+  grid_layer_t *grid_layer, **grid_layer2;
+
+  /*  If all weights are ZERO, do not bother storing the link */
+
+  if ( IS_EQUAL(weights[0], 0) && IS_EQUAL(weights[1], 0) && IS_EQUAL(weights[2], 0) &&
+       IS_EQUAL(weights[3], 0) && IS_EQUAL(weights[4], 0) && IS_EQUAL(weights[5], 0) ) return;
+
+  /* If the link already exists, add the weight to the current weight arrays */
+
+  iblk  = BLK_NUM(add2);
+  iadd2 = BLK_IDX(add2);
+
+  lstore_link = FALSE;
+  grid_layer2 = &grid_store->layers[iblk];
+  nlayer = grid_store->nlayers[iblk];
+  for ( ilayer = 0; ilayer < nlayer; ++ilayer )
+    {
+      grid_layer = *grid_layer2;
+      nlink = grid_layer->grid2_link[iadd2];
+      if ( nlink == -1 )
+	{
+	  break;
+	}
+      else if ( add1 == rv->grid1_add[nlink] )
+	{
+	  lstore_link = TRUE;
+	  break;
+	}
+      grid_layer2 = &(*grid_layer2)->next;
+    }
+
+  if ( lstore_link )
+    {
+      rv->wts[3*nlink  ] += weights[0];
+      rv->wts[3*nlink+1] += weights[1];
+      rv->wts[3*nlink+2] += weights[2];
+	      
+      return;
+    }
+
+  /*
+     If the link does not yet exist, increment number of links and 
+     check to see if remap arrays need to be increased to accomodate 
+     the new link. Then store the link.
+  */
+  nlink = rv->num_links;
+
+  if ( ilayer < grid_store->nlayers[iblk] )
+    {
+      grid_layer->grid2_link[iadd2] = nlink;
+    }
+  else
+    {
+      grid_layer = (grid_layer_t *) malloc(sizeof(grid_layer_t));
+      grid_layer->next = NULL;
+      grid_layer->grid2_link = (int *) malloc(grid_store->blksize[iblk]*sizeof(int));
+
+      blksize = grid_store->blksize[iblk];
+      for ( i = 0; i < blksize; ++i )
+	grid_layer->grid2_link[i] = -1;
+
+      grid_layer->grid2_link[iadd2] = nlink;
+      *grid_layer2 = grid_layer;
+      grid_store->nlayers[iblk]++;
+    }
+
+  rv->num_links++;
+  if ( rv->num_links >= rv->max_links )
+    resize_remap_vars(rv, rv->resize_increment);
+
+  rv->grid1_add[nlink] = add1;
+  rv->grid2_add[nlink] = add2;
+
+  rv->wts[3*nlink  ] = weights[0];
+  rv->wts[3*nlink+1] = weights[1];
+  rv->wts[3*nlink+2] = weights[2];
+
+}  /* store_link_cnsrv_fast */
+
+
+/*
+    This routine stores the address and weight for this link in the appropriate 
+    address and weight arrays and resizes those arrays if necessary.
+*/
+static
+void store_link_cnsrv(remapvars_t *rv, long add1, long add2, double *restrict weights,
+		      int *link_add1[2], int *link_add2[2])
+{
+  /*
+    Input variables:
+    int  add1         ! address on grid1
+    int  add2         ! address on grid2
+    double weights[6] ! array of remapping weights for this link
+  */
+  /* Local variables */
+  long nlink, min_link, max_link; /* link index */
+
+  /*  If all weights are ZERO, do not bother storing the link */
+
+  if ( IS_EQUAL(weights[0], 0) && IS_EQUAL(weights[1], 0) && IS_EQUAL(weights[2], 0) &&
+       IS_EQUAL(weights[3], 0) && IS_EQUAL(weights[4], 0) && IS_EQUAL(weights[5], 0) ) return;
+
+  /*  Restrict the range of links to search for existing links */
+
+  min_link = MIN(link_add1[0][add1], link_add2[0][add2]);
+  max_link = MAX(link_add1[1][add1], link_add2[1][add2]);
+  if ( min_link == -1 )
+    {
+      min_link = 0;
+      max_link = -1;
+    }
+
+  /* If the link already exists, add the weight to the current weight arrays */
+
+#if  defined (SX)
+#define STRIPED 1
+#if STRIPED
+#define STRIPLENGTH 4096
+  {
+    long ilink = max_link + 1;
+    long strip, estrip;
+    nlink = 0;
+    for ( strip=min_link; strip <= max_link; strip+=STRIPLENGTH )
+      {
+	estrip = MIN(max_link-strip+1, STRIPLENGTH);
+	for ( nlink = 0; nlink < estrip; ++nlink )
+	  {
+	    if ( add2 == rv->grid2_add[strip+nlink] &&
+		 add1 == rv->grid1_add[strip+nlink] )
+	      ilink = strip + nlink;
+	  }
+	if (ilink != (max_link + 1)) break;
+      }
+    nlink += strip;
+    if (ilink != (max_link + 1)) nlink = ilink;
+  }
+#else
+  {
+    long ilink = max_link + 1;
+    for ( nlink = min_link; nlink <= max_link; ++nlink )
+      {
+	if ( add2 == rv->grid2_add[nlink] )
+	  if ( add1 == rv->grid1_add[nlink] ) ilink = nlink;
+      }
+    if ( ilink != (max_link + 1) ) nlink = ilink;
+  }
+#endif
+#else
+  for ( nlink = min_link; nlink <= max_link; ++nlink )
+    {
+      if ( add2 == rv->grid2_add[nlink] )
+	if ( add1 == rv->grid1_add[nlink] ) break;
+    }
+#endif
+
+  if ( nlink <= max_link )
+    {
+      rv->wts[3*nlink  ] += weights[0];
+      rv->wts[3*nlink+1] += weights[1];
+      rv->wts[3*nlink+2] += weights[2];
+
+      return;
+    }
+
+  /*
+     If the link does not yet exist, increment number of links and 
+     check to see if remap arrays need to be increased to accomodate 
+     the new link. Then store the link.
+  */
+  nlink = rv->num_links;
+
+  rv->num_links++;
+  if ( rv->num_links >= rv->max_links )
+    resize_remap_vars(rv, rv->resize_increment);
+
+  rv->grid1_add[nlink] = add1;
+  rv->grid2_add[nlink] = add2;
+
+  rv->wts[3*nlink  ] = weights[0];
+  rv->wts[3*nlink+1] = weights[1];
+  rv->wts[3*nlink+2] = weights[2];
+
+  if ( link_add1[0][add1] == -1 ) link_add1[0][add1] = (int)nlink;
+  if ( link_add2[0][add2] == -1 ) link_add2[0][add2] = (int)nlink;
+  link_add1[1][add1] = (int)nlink;
+  link_add2[1][add2] = (int)nlink;
+
+}  /* store_link_cnsrv */
+
+static
+long get_srch_cells(long grid1_add, long nbins, int *bin_addr1, int *bin_addr2,
+		    restr_t *grid1_bound_box, restr_t *grid2_bound_box, long grid2_size, int *srch_add)
+{
+  long num_srch_cells;  /* num cells in restricted search arrays   */
+  long min_add;         /* addresses for restricting search of     */
+  long max_add;         /* destination grid                        */
+  long n, n2;           /* generic counters                        */
+  long grid2_add;       /* current linear address for grid2 cell   */
+  long grid1_addm4, grid2_addm4;
+  int  lmask;
+  restr_t bound_box_lat1, bound_box_lat2, bound_box_lon1, bound_box_lon2;
+
+  /* Restrict searches first using search bins */
+
+  min_add = grid2_size - 1;
+  max_add = 0;
+
+  for ( n = 0; n < nbins; ++n )
+    {
+      n2 = n<<1;
+      if ( grid1_add >= bin_addr1[n2] && grid1_add <= bin_addr1[n2+1] )
+	{
+	  if ( bin_addr2[n2  ] < min_add ) min_add = bin_addr2[n2  ];
+	  if ( bin_addr2[n2+1] > max_add ) max_add = bin_addr2[n2+1];
+	}
+    }
+
+  /* Further restrict searches using bounding boxes */
+
+  grid1_addm4 = grid1_add<<2;
+  bound_box_lat1 = grid1_bound_box[grid1_addm4  ];
+  bound_box_lat2 = grid1_bound_box[grid1_addm4+1];
+  bound_box_lon1 = grid1_bound_box[grid1_addm4+2];
+  bound_box_lon2 = grid1_bound_box[grid1_addm4+3];
+
+  num_srch_cells = 0;
+  for ( grid2_add = min_add; grid2_add <= max_add; ++grid2_add )
+    {
+      grid2_addm4 = grid2_add<<2;
+      lmask = (grid2_bound_box[grid2_addm4  ] <= bound_box_lat2)  &&
+	      (grid2_bound_box[grid2_addm4+1] >= bound_box_lat1)  &&
+	      (grid2_bound_box[grid2_addm4+2] <= bound_box_lon2)  &&
+	      (grid2_bound_box[grid2_addm4+3] >= bound_box_lon1);
+
+      if ( lmask )
+	{
+	  srch_add[num_srch_cells] = grid2_add;
+	  num_srch_cells++;
+	}
+    }
+
+  return (num_srch_cells);
+}
+
+#if defined (_OPENMP)
+static
+void *alloc_srch_corner(size_t n)
+{
+  return (malloc(n*sizeof(double)));
+}
+
+static
+void free_srch_corner(void *p)
+{
+  free(p);
+}
+#endif
+
+/*
+  -----------------------------------------------------------------------
+
+   This routine traces the perimeters of every grid cell on each
+   grid checking for intersections with the other grid and computing
+   line integrals for each subsegment.
+
+  -----------------------------------------------------------------------
+*/
+void remap_conserv(remapgrid_t *rg, remapvars_t *rv)
+{
+  /* local variables */
+
+  int lcheck = TRUE;
+
+  long ioffset;
+  long max_subseg = 100000; /* max number of subsegments per segment to prevent infinite loop */
+                            /* 1000 is too small!!! */
+  long grid1_size;
+  long grid2_size;
+  long grid1_corners;
+  long grid2_corners;
+  long grid1_add;       /* current linear address for grid1 cell   */
+  long grid2_add;       /* current linear address for grid2 cell   */
+  long n, n3, k;        /* generic counters                        */
+  long corner;          /* corner of cell that segment starts from */
+  long next_corn;       /* corner of cell that segment ends on     */
+  long nbins, num_links;
+  long num_subseg;      /* number of subsegments                   */
+
+  int lcoinc;           /* flag for coincident segments            */
+  int lrevers;          /* flag for reversing direction of segment */
+  int lbegin;           /* flag for first integration of a segment */
+
+  double intrsct_lat, intrsct_lon;         /* lat/lon of next intersect  */
+  double beglat, endlat, beglon, endlon;   /* endpoints of current seg.  */
+  double norm_factor = 0;                  /* factor for normalizing wts */
+
+  double *grid2_centroid_lat, *grid2_centroid_lon;   /* centroid coords  */
+  double *grid1_centroid_lat, *grid1_centroid_lon;   /* on each grid     */
+
+  double begseg[2];         /* begin lat/lon for full segment */
+  double weights[6];        /* local wgt array */
+
+  long    max_srch_cells;   /* num cells in restricted search arrays  */
+  long    num_srch_cells;   /* num cells in restricted search arrays  */
+  long    srch_corners;     /* num of corners of srch cells           */
+  long    nsrch_corners;
+  int    *srch_add;         /* global address of cells in srch arrays */
+#if defined (_OPENMP)
+  int **srch_add2;
+  int ompthID, i;
+#endif
+  double *srch_corner_lat;  /* lat of each corner of srch cells */
+  double *srch_corner_lon;  /* lon of each corner of srch cells */
+
+  int *link_add1[2];        /* min,max link add to restrict search */
+  int *link_add2[2];        /* min,max link add to restrict search */
+
+  /* Intersection */
+  int last_loc = -1;        /* save location when crossing threshold  */
+  int lthresh = FALSE;      /* flags segments crossing threshold bndy */
+  double intrsct_lat_off = 0, intrsct_lon_off = 0; /* lat/lon coords offset for next search */
+
+  /* Pole_intersection */
+  /* Save last intersection to avoid roundoff during coord transformation */
+  int luse_last = FALSE;
+  double intrsct_x, intrsct_y;      /* x,y for intersection */
+  /* Variables necessary if segment manages to hit pole */
+  int avoid_pole_count = 0;         /* count attempts to avoid pole  */
+  double avoid_pole_offset = TINY;  /* endpoint offset to avoid pole */
+  grid_store_t *grid_store = NULL;
+
+  if ( ompNumThreads == 1 ) progressInit();
+
+  nbins = rg->num_srch_bins;
+
+  if ( rg->store_link_fast )
+    {
+      grid_store = (grid_store_t *) malloc(sizeof(grid_store_t));
+      grid_store_init(grid_store, rg->grid2_size);
+    }
+
+  if ( cdoVerbose )
+    {
+      cdoPrint("north_thresh: %g", north_thresh);
+      cdoPrint("south_thresh: %g", south_thresh);
+    }
+
+  if ( cdoTimer ) timer_start(timer_remap_con);
+
+  grid1_size = rg->grid1_size;
+  grid2_size = rg->grid2_size;
+
+  grid1_corners = rg->grid1_corners;
+  grid2_corners = rg->grid2_corners;
+
+  if ( ! rg->store_link_fast )
+    {
+      link_add1[0] = (int *) malloc(grid1_size*sizeof(int));
+      link_add1[1] = (int *) malloc(grid1_size*sizeof(int));
+      link_add2[0] = (int *) malloc(grid2_size*sizeof(int));
+      link_add2[1] = (int *) malloc(grid2_size*sizeof(int));
+
+#if defined (SX)
+#pragma vdir nodep
+#endif
+      for ( n = 0; n < grid1_size; ++n )
+	{
+	  link_add1[0][n] = -1;
+	  link_add1[1][n] = -1;
+	}
+
+#if defined (SX)
+#pragma vdir nodep
+#endif
+      for ( n = 0; n < grid2_size; ++n )
+	{
+	  link_add2[0][n] = -1;
+	  link_add2[1][n] = -1;
+	}
+    }
+
+  /* Initialize centroid arrays */
+
+  grid1_centroid_lat = (double *) malloc(grid1_size*sizeof(double));
+  grid1_centroid_lon = (double *) malloc(grid1_size*sizeof(double));
+  grid2_centroid_lat = (double *) malloc(grid2_size*sizeof(double));
+  grid2_centroid_lon = (double *) malloc(grid2_size*sizeof(double));
+
+  for ( n = 0; n < grid1_size; ++n )
+    {
+      grid1_centroid_lat[n] = 0;
+      grid1_centroid_lon[n] = 0;
+    }
+
+  for ( n = 0; n < grid2_size; ++n )
+    {
+      grid2_centroid_lat[n] = 0;
+      grid2_centroid_lon[n] = 0;
+    }
+
+  /*  Integrate around each cell on grid1 */
+
+#if defined (_OPENMP)
+  srch_add2 = (int **) malloc(ompNumThreads*sizeof(int *));
+  for ( i = 0; i < ompNumThreads; ++i )
+    srch_add2[i] = (int *) malloc(grid2_size*sizeof(int));
+#else
+  srch_add = (int *) malloc(grid2_size*sizeof(int));
+#endif
+
+  srch_corners    = grid2_corners;
+  max_srch_cells  = 0;
+  srch_corner_lat = NULL;
+  srch_corner_lon = NULL;
+
+  if ( cdoTimer ) timer_start(timer_remap_con_l1);
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(ompNumThreads, cdoTimer, nbins, grid1_centroid_lon, grid1_centroid_lat, \
+         grid_store, link_add1, link_add2,	 \
+         rv, cdoVerbose, max_subseg, \
+	 grid1_corners,	srch_corners, rg, grid2_size, grid1_size, srch_add2) \
+  private(ompthID, srch_add, n, k, num_srch_cells, max_srch_cells, \
+	  grid1_add, grid2_add, ioffset, nsrch_corners, corner, next_corn, beglat, beglon, \
+	  endlat, endlon, lrevers, begseg, lbegin, num_subseg, srch_corner_lat, srch_corner_lon, \
+	  weights, intrsct_lat, intrsct_lon, intrsct_lat_off, intrsct_lon_off, intrsct_x, intrsct_y, \
+	  last_loc, lcoinc, lthresh, luse_last, avoid_pole_count, avoid_pole_offset)
+#endif
+  for ( grid1_add = 0; grid1_add < grid1_size; ++grid1_add )
+    {
+#if defined (_OPENMP)
+      ompthID = omp_get_thread_num();
+      srch_add = srch_add2[ompthID];
+#endif
+
+      if ( ompNumThreads == 1 ) progressStatus(0, 0.5, (grid1_add+1.)/grid1_size);
+
+      lthresh   = FALSE;
+      luse_last = FALSE;
+      avoid_pole_count  = 0;
+      avoid_pole_offset = TINY;
+
+      /* Get search cells */
+      num_srch_cells = get_srch_cells(grid1_add, nbins, rg->bin_addr1, rg->bin_addr2,
+				      rg->grid1_bound_box, rg->grid2_bound_box , grid2_size, srch_add);
+
+      if ( num_srch_cells == 0 ) continue;
+
+      /* Create search arrays */
+
+#if defined (_OPENMP)
+	  srch_corner_lat = (double *) alloc_srch_corner(srch_corners*num_srch_cells);
+	  srch_corner_lon = (double *) alloc_srch_corner(srch_corners*num_srch_cells);
+#else
+      if ( num_srch_cells > max_srch_cells )
+	{
+	  max_srch_cells = num_srch_cells;
+	  srch_corner_lat = (double *) realloc(srch_corner_lat, srch_corners*num_srch_cells*sizeof(double));
+	  srch_corner_lon = (double *) realloc(srch_corner_lon, srch_corners*num_srch_cells*sizeof(double));
+	}
+#endif
+
+      /* gather1 */
+      for ( n = 0; n < num_srch_cells; ++n )
+	{
+	  grid2_add = srch_add[n];
+	  ioffset = grid2_add*srch_corners;
+
+	  nsrch_corners = n*srch_corners;
+	  for ( k = 0; k < srch_corners; k++ )
+	    {
+	      srch_corner_lat[nsrch_corners+k] = rg->grid2_corner_lat[ioffset+k];
+	      srch_corner_lon[nsrch_corners+k] = rg->grid2_corner_lon[ioffset+k];
+	    }
+	}
+
+      /* Integrate around this cell */
+
+      ioffset = grid1_add*grid1_corners;
+
+      for ( corner = 0; corner < grid1_corners; ++corner )
+	{
+          next_corn = (corner+1)%grid1_corners;
+
+          /* Define endpoints of the current segment */
+
+          beglat = rg->grid1_corner_lat[ioffset+corner];
+          beglon = rg->grid1_corner_lon[ioffset+corner];
+          endlat = rg->grid1_corner_lat[ioffset+next_corn];
+          endlon = rg->grid1_corner_lon[ioffset+next_corn];
+          lrevers = FALSE;
+
+	  /*  To ensure exact path taken during both sweeps, always integrate segments in the same direction (SW to NE). */
+          if ( (endlat < beglat) || (IS_EQUAL(endlat, beglat) && endlon < beglon) )
+	    {
+	      beglat = rg->grid1_corner_lat[ioffset+next_corn];
+	      beglon = rg->grid1_corner_lon[ioffset+next_corn];
+	      endlat = rg->grid1_corner_lat[ioffset+corner];
+	      endlon = rg->grid1_corner_lon[ioffset+corner];
+	      lrevers = TRUE;
+	    }
+
+          begseg[0] = beglat;
+          begseg[1] = beglon;
+          lbegin = TRUE;
+
+          /*
+	    If this is a constant-longitude segment, skip the rest 
+	    since the line integral contribution will be ZERO.
+          */
+          if ( IS_NOT_EQUAL(endlon, beglon) )
+	    {
+	      num_subseg = 0;
+	      /*
+		Integrate along this segment, detecting intersections 
+		and computing the line integral for each sub-segment
+	      */
+	      while ( IS_NOT_EQUAL(beglat, endlat) || IS_NOT_EQUAL(beglon, endlon) )
+		{
+		  /*  Prevent infinite loops if integration gets stuck near cell or threshold boundary */
+		  num_subseg++;
+		  if ( num_subseg >= max_subseg )
+		    cdoAbort("Integration stalled: num_subseg exceeded limit (grid1[%d]: lon1=%g lon2=%g lat1=%g lat2=%g)!",
+			     grid1_add, beglon, endlon, beglat, endlat);
+
+		  /* Uwe Schulzweida: skip very small regions */
+		  if ( num_subseg%1000 == 0 )
+		    {
+		      if ( fabs(beglat-endlat) < 1.e-10 || fabs(beglon-endlon) < 1.e-10 )
+			{
+			  if ( cdoVerbose )
+			    cdoPrint("Skip very small region (grid1[%d]): lon=%g dlon=%g lat=%g dlat=%g",
+				     grid1_add, beglon, endlon-beglon, beglat, endlat-beglat);
+			  break;
+			}
+		    }
+
+		  /* Find next intersection of this segment with a gridline on grid 2. */
+
+		  intersection(&grid2_add, &intrsct_lat, &intrsct_lon, &lcoinc,
+			       beglat, beglon, endlat, endlon, begseg, 
+			       lbegin, lrevers,
+                               num_srch_cells, srch_corners, srch_add,
+			       srch_corner_lat, srch_corner_lon,
+			       &last_loc, &lthresh, &intrsct_lat_off, &intrsct_lon_off,
+			       &luse_last, &intrsct_x, &intrsct_y,
+			       &avoid_pole_count, &avoid_pole_offset);
+
+		  lbegin = FALSE;
+
+		  /* Compute line integral for this subsegment. */
+
+		  if ( grid2_add != -1 )
+		    line_integral(weights, beglon, intrsct_lon, beglat, intrsct_lat,
+				  rg->grid1_center_lon[grid1_add], rg->grid2_center_lon[grid2_add]);
+		  else
+		    line_integral(weights, beglon, intrsct_lon, beglat, intrsct_lat,
+				  rg->grid1_center_lon[grid1_add], rg->grid1_center_lon[grid1_add]);
+
+		  /* If integrating in reverse order, change sign of weights */
+
+		  if ( lrevers ) for ( k = 0; k < 6; ++k ) weights[k] = -weights[k];
+
+		  /*
+		    Store the appropriate addresses and weights. 
+		    Also add contributions to cell areas and centroids.
+		  */
+		  if ( grid2_add != -1 )
+		    if ( rg->grid1_mask[grid1_add] )
+		      {
+#if defined (_OPENMP)
+#pragma omp critical
+#endif
+			{
+			  if ( rg->store_link_fast )
+			    store_link_cnsrv_fast(rv, grid1_add, grid2_add, weights, grid_store);
+			  else
+			    store_link_cnsrv(rv, grid1_add, grid2_add, weights, link_add1, link_add2);
+
+			  rg->grid2_frac[grid2_add] += weights[3];
+			}
+			rg->grid1_frac[grid1_add] += weights[0];
+		      }
+
+		  rg->grid1_area[grid1_add]     += weights[0];
+		  grid1_centroid_lat[grid1_add] += weights[1];
+		  grid1_centroid_lon[grid1_add] += weights[2];
+
+		  /* Reset beglat and beglon for next subsegment. */
+		  beglat = intrsct_lat;
+		  beglon = intrsct_lon;
+		}
+	    }
+          /* End of segment */
+        }
+#if defined (_OPENMP)
+      free_srch_corner(srch_corner_lat);
+      free_srch_corner(srch_corner_lon);
+#endif
+    }
+
+  if ( cdoTimer ) timer_stop(timer_remap_con_l1);
+
+  /* Finished with all cells: deallocate search arrays */
+
+#if ! defined (_OPENMP)
+  if ( srch_corner_lon ) free(srch_corner_lon);
+  if ( srch_corner_lat ) free(srch_corner_lat);
+#endif
+
+#if defined (_OPENMP)
+  for ( i = 0; i < ompNumThreads; ++i )
+    free(srch_add2[i]);
+
+  free(srch_add2);
+#else
+  free(srch_add);
+#endif
+
+  /* Integrate around each cell on grid2 */
+
+#if defined (_OPENMP)
+  srch_add2 = (int **) malloc(ompNumThreads*sizeof(int *));
+  for ( i = 0; i < ompNumThreads; ++i )
+    srch_add2[i] = (int *) malloc(grid1_size*sizeof(int));
+#else
+  srch_add = (int *) malloc(grid1_size*sizeof(int));
+#endif
+
+  srch_corners    = grid1_corners;
+  max_srch_cells  = 0;
+  srch_corner_lat = NULL;
+  srch_corner_lon = NULL;
+
+  if ( cdoTimer ) timer_start(timer_remap_con_l2);
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(ompNumThreads, cdoTimer, nbins, grid2_centroid_lon, grid2_centroid_lat, \
+         grid_store, link_add1, link_add2, \
+         rv, cdoVerbose, max_subseg, \
+	 grid2_corners, srch_corners, rg, grid2_size, grid1_size, srch_add2) \
+  private(ompthID, srch_add, n, k, num_srch_cells, max_srch_cells, \
+	  grid1_add, grid2_add, ioffset, nsrch_corners, corner, next_corn, beglat, beglon, \
+	  endlat, endlon, lrevers, begseg, lbegin, num_subseg, srch_corner_lat, srch_corner_lon, \
+	  weights, intrsct_lat, intrsct_lon, intrsct_lat_off, intrsct_lon_off, intrsct_x, intrsct_y, \
+	  last_loc, lcoinc, lthresh, luse_last, avoid_pole_count, avoid_pole_offset)
+#endif
+  for ( grid2_add = 0; grid2_add < grid2_size; ++grid2_add )
+    {
+#if defined (_OPENMP)
+      ompthID = omp_get_thread_num();
+      srch_add = srch_add2[ompthID];
+#endif
+
+      if ( ompNumThreads == 1 ) progressStatus(0.5, 0.5, (grid2_add+1.)/grid2_size);
+
+      lthresh   = FALSE;
+      luse_last = FALSE;
+      avoid_pole_count  = 0;
+      avoid_pole_offset = TINY;
+
+      /* Get search cells */
+      num_srch_cells = get_srch_cells(grid2_add, nbins, rg->bin_addr2, rg->bin_addr1,
+				      rg->grid2_bound_box, rg->grid1_bound_box , grid1_size, srch_add);
+
+      if ( num_srch_cells == 0 ) continue;
+
+      /* Create search arrays */
+      
+#if defined (_OPENMP)
+	  srch_corner_lat = (double *) alloc_srch_corner(srch_corners*num_srch_cells);
+	  srch_corner_lon = (double *) alloc_srch_corner(srch_corners*num_srch_cells);
+#else
+      if ( num_srch_cells > max_srch_cells )
+	{
+	  max_srch_cells = num_srch_cells;
+	  srch_corner_lat = (double *) realloc(srch_corner_lat, srch_corners*num_srch_cells*sizeof(double));
+	  srch_corner_lon = (double *) realloc(srch_corner_lon, srch_corners*num_srch_cells*sizeof(double));
+	}
+#endif
+
+      /* gather2 */
+      for ( n = 0; n < num_srch_cells; ++n )
+	{
+	  grid1_add = srch_add[n];
+	  ioffset = grid1_add*srch_corners;
+
+	  nsrch_corners = n*srch_corners;
+	  for ( k = 0; k < srch_corners; ++k )
+	    {
+	      srch_corner_lat[nsrch_corners+k] = rg->grid1_corner_lat[ioffset+k];
+	      srch_corner_lon[nsrch_corners+k] = rg->grid1_corner_lon[ioffset+k];
+	    }
+	}
+
+      /* Integrate around this cell */
+
+      ioffset = grid2_add*grid2_corners;
+
+      for ( corner = 0; corner < grid2_corners; ++corner )
+	{
+          next_corn = (corner+1)%grid2_corners;
+
+          beglat = rg->grid2_corner_lat[ioffset+corner];
+          beglon = rg->grid2_corner_lon[ioffset+corner];
+          endlat = rg->grid2_corner_lat[ioffset+next_corn];
+          endlon = rg->grid2_corner_lon[ioffset+next_corn];
+          lrevers = FALSE;
+
+	  /* To ensure exact path taken during both sweeps, always integrate in the same direction */
+          if ( (endlat < beglat) || (IS_EQUAL(endlat, beglat) && endlon < beglon) )
+	    {
+	      beglat = rg->grid2_corner_lat[ioffset+next_corn];
+	      beglon = rg->grid2_corner_lon[ioffset+next_corn];
+	      endlat = rg->grid2_corner_lat[ioffset+corner];
+	      endlon = rg->grid2_corner_lon[ioffset+corner];
+	      lrevers = TRUE;
+	    }
+
+          begseg[0] = beglat;
+          begseg[1] = beglon;
+          lbegin = TRUE;
+
+          /*
+	    If this is a constant-longitude segment, skip the rest 
+	    since the line integral contribution will be ZERO.
+          */
+          if ( IS_NOT_EQUAL(endlon, beglon) )
+	    {
+	      num_subseg = 0;
+	      /*
+		Integrate along this segment, detecting intersections 
+		and computing the line integral for each sub-segment
+	      */
+	      while ( IS_NOT_EQUAL(beglat, endlat) || IS_NOT_EQUAL(beglon, endlon) )
+		{
+		  /*  Prevent infinite loops if integration gets stuck near cell or threshold boundary */
+		  num_subseg++;
+		  if ( num_subseg >= max_subseg )
+		    cdoAbort("Integration stalled: num_subseg exceeded limit (grid2[%d]: lon1=%g lon2=%g lat1=%g lat2=%g)!",
+			     grid2_add, beglon, endlon, beglat, endlat);
+
+		  /* Uwe Schulzweida: skip very small regions */
+		  if ( num_subseg%1000 == 0 )
+		    {
+		      if ( fabs(beglat-endlat) < 1.e-10 || fabs(beglon-endlon) < 1.e-10 )
+			{
+			  if ( cdoVerbose )
+			    cdoPrint("Skip very small region (grid2[%d]): lon=%g dlon=%g lat=%g dlat=%g",
+				     grid2_add, beglon, endlon-beglon, beglat, endlat-beglat);
+			  break;
+			}
+		    }
+
+		  /* Find next intersection of this segment with a gridline on grid 2. */
+
+		  intersection(&grid1_add, &intrsct_lat, &intrsct_lon, &lcoinc,
+			       beglat, beglon, endlat, endlon, begseg,
+			       lbegin, lrevers,
+                               num_srch_cells, srch_corners, srch_add,
+			       srch_corner_lat, srch_corner_lon,
+			       &last_loc, &lthresh, &intrsct_lat_off, &intrsct_lon_off,
+			       &luse_last, &intrsct_x, &intrsct_y,
+			       &avoid_pole_count, &avoid_pole_offset);
+
+		  lbegin = FALSE;
+
+		  /* Compute line integral for this subsegment. */
+
+		  if ( grid1_add != -1 )
+		    line_integral(weights, beglon, intrsct_lon, beglat, intrsct_lat,
+				  rg->grid1_center_lon[grid1_add], rg->grid2_center_lon[grid2_add]);
+		  else
+		    line_integral(weights, beglon, intrsct_lon, beglat, intrsct_lat,
+				  rg->grid2_center_lon[grid2_add], rg->grid2_center_lon[grid2_add]);
+
+		  /* If integrating in reverse order, change sign of weights */
+
+		  if ( lrevers ) for ( k = 0; k < 6; ++k ) weights[k] = -weights[k];
+
+		  /*
+		    Store the appropriate addresses and weights. 
+		    Also add contributions to cell areas and centroids.
+		    If there is a coincidence, do not store weights
+		    because they have been captured in the previous loop.
+		    The grid1 mask is the master mask
+		  */
+		  if ( ! lcoinc && grid1_add != -1 )
+		    if ( rg->grid1_mask[grid1_add] )
+		      {
+#if defined (_OPENMP)
+#pragma omp critical
+#endif
+			{
+			  if ( rg->store_link_fast )
+			    store_link_cnsrv_fast(rv, grid1_add, grid2_add, weights, grid_store);
+			  else
+			    store_link_cnsrv(rv, grid1_add, grid2_add, weights, link_add1, link_add2);
+
+			  rg->grid1_frac[grid1_add] += weights[0];
+			}
+			rg->grid2_frac[grid2_add] += weights[3];
+		      }
+
+		  rg->grid2_area[grid2_add]     += weights[3];
+		  grid2_centroid_lat[grid2_add] += weights[4];
+		  grid2_centroid_lon[grid2_add] += weights[5];
+
+		  /* Reset beglat and beglon for next subsegment. */
+		  beglat = intrsct_lat;
+		  beglon = intrsct_lon;
+		}
+	    }
+          /* End of segment */
+	}
+#if defined (_OPENMP)
+      free_srch_corner(srch_corner_lat);
+      free_srch_corner(srch_corner_lon);
+#endif
+    }
+
+  if ( cdoTimer ) timer_stop(timer_remap_con_l2);
+
+  /* Finished with all cells: deallocate search arrays */
+
+#if ! defined (_OPENMP)
+  if ( srch_corner_lon ) free(srch_corner_lon);
+  if ( srch_corner_lat ) free(srch_corner_lat);
+#endif
+
+#if defined (_OPENMP)
+  for ( i = 0; i < ompNumThreads; ++i )
+    free(srch_add2[i]);
+
+  free(srch_add2);
+#else
+  free(srch_add);
+#endif
+
+  /*
+     Correct for situations where N/S pole not explicitly included in
+     grid (i.e. as a grid corner point). If pole is missing from only
+     one grid, need to correct only the area and centroid of that 
+     grid.  If missing from both, do complete weight calculation.
+  */
+
+  /* North Pole */
+  weights[0] =  PI2;
+  weights[1] =  PI*PI;
+  weights[2] =  ZERO;
+  weights[3] =  PI2;
+  weights[4] =  PI*PI;
+  weights[5] =  ZERO;
+
+  grid1_add = -1;
+  /* pole_loop1 */
+  for ( n = 0; n < grid1_size; ++n )
+    if ( rg->grid1_area[n] < -THREE*PIH && rg->grid1_center_lat[n] > ZERO )
+      {
+	grid1_add = n;
+#ifndef SX
+	break;
+#endif
+      }
+
+  grid2_add = -1;
+  /* pole_loop2 */
+  for ( n = 0; n < grid2_size; ++n )
+    if ( rg->grid2_area[n] < -THREE*PIH && rg->grid2_center_lat[n] > ZERO )
+      {
+	grid2_add = n;
+#ifndef SX
+	break;
+#endif
+      }
+
+  if ( grid1_add != -1 )
+    {
+      rg->grid1_area[grid1_add]     += weights[0];
+      grid1_centroid_lat[grid1_add] += weights[1];
+      grid1_centroid_lon[grid1_add] += weights[2];
+    }
+
+  if ( grid2_add != -1 )
+    {
+      rg->grid2_area[grid2_add]     += weights[3];
+      grid2_centroid_lat[grid2_add] += weights[4];
+      grid2_centroid_lon[grid2_add] += weights[5];
+    }
+
+  if ( grid1_add != -1 && grid2_add != -1 )
+    {
+      if ( rg->store_link_fast )
+	store_link_cnsrv_fast(rv, grid1_add, grid2_add, weights, grid_store);
+      else
+	store_link_cnsrv(rv, grid1_add, grid2_add, weights, link_add1, link_add2);
+
+      rg->grid1_frac[grid1_add] += weights[0];
+      rg->grid2_frac[grid2_add] += weights[3];
+    }
+
+  /* South Pole */
+  weights[0] =  PI2;
+  weights[1] = -PI*PI;
+  weights[2] =  ZERO;
+  weights[3] =  PI2;
+  weights[4] = -PI*PI;
+  weights[5] =  ZERO;
+
+  grid1_add = -1;
+  /* pole_loop3 */
+  for ( n = 0; n < grid1_size; ++n )
+    if ( rg->grid1_area[n] < -THREE*PIH && rg->grid1_center_lat[n] < ZERO )
+      {
+	grid1_add = n;
+#ifndef SX
+	break;
+#endif
+      }
+
+  grid2_add = -1;
+  /* pole_loop4 */
+  for ( n = 0; n < grid2_size; ++n )
+    if ( rg->grid2_area[n] < -THREE*PIH && rg->grid2_center_lat[n] < ZERO )
+      {
+	grid2_add = n;
+#ifndef SX
+	break;
+#endif
+      }
+
+  if ( grid1_add != -1 )
+    {
+      rg->grid1_area[grid1_add]     += weights[0];
+      grid1_centroid_lat[grid1_add] += weights[1];
+      grid1_centroid_lon[grid1_add] += weights[2];
+    }
+
+  if ( grid2_add != -1 )
+    {
+      rg->grid2_area[grid2_add]     += weights[3];
+      grid2_centroid_lat[grid2_add] += weights[4];
+      grid2_centroid_lon[grid2_add] += weights[5];
+    }
+
+  if ( grid1_add != -1 && grid2_add != -1 )
+    {
+      if ( rg->store_link_fast )
+	store_link_cnsrv_fast(rv, grid1_add, grid2_add, weights, grid_store);
+      else
+	store_link_cnsrv(rv, grid1_add, grid2_add, weights, link_add1, link_add2);
+
+      rg->grid1_frac[grid1_add] += weights[0];
+      rg->grid2_frac[grid2_add] += weights[3];
+    }
+
+  if ( rg->store_link_fast )
+    {
+      grid_store_delete(grid_store);
+      free(grid_store);
+    }
+
+
+  /* Finish centroid computation */
+
+  for ( n = 0; n < grid1_size; ++n )
+    if ( IS_NOT_EQUAL(rg->grid1_area[n], 0) )
+      {
+        grid1_centroid_lat[n] /= rg->grid1_area[n];
+        grid1_centroid_lon[n] /= rg->grid1_area[n];
+      }
+
+  for ( n = 0; n < grid2_size; ++n )
+    if ( IS_NOT_EQUAL(rg->grid2_area[n], 0) )
+      {
+        grid2_centroid_lat[n] /= rg->grid2_area[n];
+        grid2_centroid_lon[n] /= rg->grid2_area[n];
+      }
+
+  /* 2010-10-08 Uwe Schulzweida: remove all links with weights < 0 */
+
+  /* 
+  if ( 1 )
+    {
+      num_links = rv->num_links;
+
+      if ( cdoVerbose )
+	for ( n = 0; n < num_links; n++ )
+	  printf("wts1: %d %g\n", n, rv->wts[3*n]);
+
+      for ( n = 0; n < num_links; n++ )
+	{
+	  if ( rv->wts[3*n] < 0 )
+	    {
+	      int i, n2, nd;
+     
+	      for ( n2 = n+1; n2 < num_links; n2++ )
+		if ( rv->wts[3*n2] >= 0 ) break;
+
+	      nd = n2-n;
+	      num_links -= nd;
+	      for ( i = n; i < num_links; i++ )
+		{
+		  rv->wts[3*i]   = rv->wts[3*(i+nd)];
+		  rv->wts[3*i+1] = rv->wts[3*(i+nd)+1];
+		  rv->wts[3*i+2] = rv->wts[3*(i+nd)+2];
+		  
+		  rv->grid1_add[i] = rv->grid1_add[i+nd];
+		  rv->grid2_add[i] = rv->grid2_add[i+nd];
+		}
+	    }
+	}
+
+     if ( cdoVerbose ) cdoPrint("Removed number of links = %ld", rv->num_links - num_links);
+
+      rv->num_links = num_links;
+    }
+  */
+
+  /* Include centroids in weights and normalize using destination area if requested */
+
+  num_links = rv->num_links;
+
+  if ( rv->norm_opt == NORM_OPT_DESTAREA )
+    {
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(num_links, rv, rg, grid1_centroid_lat, grid1_centroid_lon)		\
+  private(n, n3, grid1_add, grid2_add, weights, norm_factor)
+#endif
+      for ( n = 0; n < num_links; ++n )
+	{
+	  n3 = n*3;
+	  grid1_add = rv->grid1_add[n]; grid2_add = rv->grid2_add[n];
+	  weights[0] = rv->wts[n3]; weights[1] = rv->wts[n3+1]; weights[2] = rv->wts[n3+2];
+
+          if ( IS_NOT_EQUAL(rg->grid2_area[grid2_add], 0) )
+	    norm_factor = ONE/rg->grid2_area[grid2_add];
+          else
+            norm_factor = ZERO;
+
+	  rv->wts[n3  ] =  weights[0]*norm_factor;
+	  rv->wts[n3+1] = (weights[1] - weights[0]*grid1_centroid_lat[grid1_add])*norm_factor;
+	  rv->wts[n3+2] = (weights[2] - weights[0]*grid1_centroid_lon[grid1_add])*norm_factor;
+	}
+    }
+  else if ( rv->norm_opt == NORM_OPT_FRACAREA )
+    {
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(num_links, rv, rg, grid1_centroid_lat, grid1_centroid_lon)		\
+  private(n, n3, grid1_add, grid2_add, weights, norm_factor)
+#endif
+      for ( n = 0; n < num_links; ++n )
+	{
+	  n3 = n*3;
+	  grid1_add = rv->grid1_add[n]; grid2_add = rv->grid2_add[n];
+	  weights[0] = rv->wts[n3]; weights[1] = rv->wts[n3+1]; weights[2] = rv->wts[n3+2];
+
+          if ( IS_NOT_EQUAL(rg->grid2_frac[grid2_add], 0) )
+	    norm_factor = ONE/rg->grid2_frac[grid2_add];
+          else
+            norm_factor = ZERO;
+
+	  rv->wts[n3  ] =  weights[0]*norm_factor;
+	  rv->wts[n3+1] = (weights[1] - weights[0]*grid1_centroid_lat[grid1_add])*norm_factor;
+	  rv->wts[n3+2] = (weights[2] - weights[0]*grid1_centroid_lon[grid1_add])*norm_factor;
+	}
+    }
+  else if ( rv->norm_opt == NORM_OPT_NONE )
+    {
+#if defined (SX)
+#pragma vdir nodep
+#endif
+#if defined (_OPENMP)
+#pragma omp parallel for default(none) \
+  shared(num_links, rv, rg, grid1_centroid_lat, grid1_centroid_lon)	\
+  private(n, n3, grid1_add, grid2_add, weights, norm_factor)
+#endif
+      for ( n = 0; n < num_links; ++n )
+	{
+	  n3 = n*3;
+	  grid1_add = rv->grid1_add[n]; grid2_add = rv->grid2_add[n];
+	  weights[0] = rv->wts[n3]; weights[1] = rv->wts[n3+1]; weights[2] = rv->wts[n3+2];
+
+          norm_factor = ONE;
+
+	  rv->wts[n3  ] =  weights[0]*norm_factor;
+	  rv->wts[n3+1] = (weights[1] - weights[0]*grid1_centroid_lat[grid1_add])*norm_factor;
+	  rv->wts[n3+2] = (weights[2] - weights[0]*grid1_centroid_lon[grid1_add])*norm_factor;
+	}
+    }
+
+  if ( cdoVerbose )
+    cdoPrint("Total number of links = %ld", rv->num_links);
+
+  for ( n = 0; n < grid1_size; ++n )
+    if ( IS_NOT_EQUAL(rg->grid1_area[n], 0) ) rg->grid1_frac[n] /= rg->grid1_area[n];
+
+  for ( n = 0; n < grid2_size; ++n )
+    if ( IS_NOT_EQUAL(rg->grid2_area[n], 0) ) rg->grid2_frac[n] /= rg->grid2_area[n];
+
+  /* Perform some error checking on final weights  */
+
+  if ( lcheck )
+    {
+      for ( n = 0; n < grid1_size; ++n )
+	{
+	  if ( rg->grid1_area[n] < -.01 )
+	    cdoPrint("Grid 1 area error: %d %g", n, rg->grid1_area[n]);
+
+	  if ( grid1_centroid_lat[n] < -PIH-.01 || grid1_centroid_lat[n] > PIH+.01 )
+	    cdoPrint("Grid 1 centroid lat error: %d %g", n, grid1_centroid_lat[n]);
+
+	  grid1_centroid_lat[n] = 0;
+	  grid1_centroid_lon[n] = 0;
+	}
+
+      for ( n = 0; n < grid2_size; ++n )
+	{
+	  if ( rg->grid2_area[n] < -.01 )
+	    cdoPrint("Grid 2 area error: %d %g", n, rg->grid2_area[n]);
+	  if ( grid2_centroid_lat[n] < -PIH-.01 || grid2_centroid_lat[n] > PIH+.01 )
+	    cdoPrint("Grid 2 centroid lat error: %d %g", n, grid2_centroid_lat[n]);
+
+	  grid2_centroid_lat[n] = 0;
+	  grid2_centroid_lon[n] = 0;
+	}
+
+      for ( n = 0; n < num_links; ++n )
+	{
+	  grid1_add = rv->grid1_add[n];
+	  grid2_add = rv->grid2_add[n];
+
+	  if ( rv->wts[3*n] < -0.01 )
+	    cdoPrint("Map 1 weight < 0! grid1idx=%d grid2idx=%d nlink=%d wts=%g",
+		     grid1_add, grid2_add, n, rv->wts[3*n]);
+
+	  if ( rv->norm_opt != NORM_OPT_NONE && rv->wts[3*n] > 1.01 )
+	    cdoPrint("Map 1 weight > 1! grid1idx=%d grid2idx=%d nlink=%d wts=%g",
+		     grid1_add, grid2_add, n, rv->wts[3*n]);
+	}
+
+      for ( n = 0; n < num_links; ++n )
+	{
+	  grid2_add = rv->grid2_add[n];
+	  grid2_centroid_lat[grid2_add] += rv->wts[3*n];
+	}
+
+      /* 2012-01-24 Uwe Schulzweida: changed [grid2_add] to [n] (bug fix) */
+      for ( n = 0; n < grid2_size; ++n )
+	{
+	  if ( rv->norm_opt == NORM_OPT_DESTAREA )
+	    norm_factor = rg->grid2_frac[n];
+	  else if ( rv->norm_opt == NORM_OPT_FRACAREA )
+	    norm_factor = ONE;
+	  else if ( rv->norm_opt == NORM_OPT_NONE )
+	    norm_factor = rg->grid2_area[n];
+	    
+	  if ( grid2_centroid_lat[n] > 0 && fabs(grid2_centroid_lat[n] - norm_factor) > .01 )
+	    cdoPrint("Error: sum of wts for map1 %d %g %g", n, grid2_centroid_lat[n], norm_factor);
+	}
+    } // lcheck
+
+  free(grid1_centroid_lat);
+  free(grid1_centroid_lon);
+  free(grid2_centroid_lat);
+  free(grid2_centroid_lon);
+
+  if ( ! rg->store_link_fast )
+    {
+      free(link_add1[0]);
+      free(link_add1[1]);
+      free(link_add2[0]);
+      free(link_add2[1]);
+    }
+
+  if ( cdoTimer ) timer_stop(timer_remap_con);
+
+} /* remap_conserv */
+
+/*****************************************************************************/
+
+void remap_stat(int remap_order, remapgrid_t rg, remapvars_t rv, const double *restrict array1, 
+		const double *restrict array2, double missval)
+{
+  long n, ns, i;
+  long idiff, imax, imin, icount;
+  int *grid2_count;
+  double minval, maxval, sum;
+	  
+  if ( remap_order == 2 )
+    cdoPrint("Second order mapping from grid1 to grid2:");
+  else
+    cdoPrint("First order mapping from grid1 to grid2:");
+  cdoPrint("----------------------------------------");
+
+  ns = 0;
+  sum = 0;
+  minval =  DBL_MAX;
+  maxval = -DBL_MAX;
+  for ( n = 0; n < rg.grid1_size; ++n )
+    {
+      if ( !DBL_IS_EQUAL(array1[n], missval) )
+	{
+	  if ( array1[n] < minval ) minval = array1[n];
+	  if ( array1[n] > maxval ) maxval = array1[n];
+	  sum += array1[n];
+	  ns++;
+	}
+    }
+  if ( ns > 0 ) sum /= ns;
+  cdoPrint("Grid1 min,mean,max: %g %g %g", minval, sum, maxval);
+
+  ns = 0;
+  sum = 0;
+  minval =  DBL_MAX;
+  maxval = -DBL_MAX;
+  for ( n = 0; n < rg.grid2_size; ++n )
+    {
+      if ( !DBL_IS_EQUAL(array2[n], missval) )
+	{
+	  if ( array2[n] < minval ) minval = array2[n];
+	  if ( array2[n] > maxval ) maxval = array2[n];
+	  sum += array2[n];
+	  ns++;
+	}
+    }
+  if ( ns > 0 ) sum /= ns;
+  cdoPrint("Grid2 min,mean,max: %g %g %g", minval, sum, maxval);
+
+  /* Conservation Test */
+
+  if ( rg.grid1_area )
+    {
+      cdoPrint("Conservation:");
+      sum = 0;
+      for ( n = 0; n < rg.grid1_size; ++n )
+	if ( !DBL_IS_EQUAL(array1[n], missval) )
+	  sum += array1[n]*rg.grid1_area[n]*rg.grid1_frac[n];
+      cdoPrint("Grid1 Integral = %g", sum);
+
+      sum = 0;
+      for ( n = 0; n < rg.grid2_size; ++n )
+	if ( !DBL_IS_EQUAL(array2[n], missval) )
+	  sum += array2[n]*rg.grid2_area[n]*rg.grid2_frac[n];
+      cdoPrint("Grid2 Integral = %g", sum);
+      /*
+      for ( n = 0; n < rg.grid1_size; n++ )
+       fprintf(stderr, "1 %d %g %g %g\n", n, array1[n], rg.grid1_area[n], rg.grid1_frac[n]);
+      for ( n = 0; n < rg.grid2_size; n++ )
+	fprintf(stderr, "2 %d %g %g %g\n", n, array2[n], rg.grid2_area[n], rg.grid2_frac[n]);
+      */
+    }
+
+  cdoPrint("number of sparse matrix entries %d", rv.num_links);
+  cdoPrint("total number of dest cells %d", rg.grid2_size);
+
+  grid2_count = (int *) malloc(rg.grid2_size*sizeof(int));
+
+  for ( n = 0; n < rg.grid2_size; ++n ) grid2_count[n] = 0;
+
+#if defined (SX)
+#pragma vdir nodep
+#endif
+  for ( n = 0; n < rv.num_links; ++n ) grid2_count[rv.grid2_add[n]]++;
+
+  imin = INT_MAX;
+  imax = INT_MIN;
+  for ( n = 0; n < rg.grid2_size; ++n )
+    {
+      if ( grid2_count[n] > 0 )
+	if ( grid2_count[n] < imin ) imin = grid2_count[n];
+      if ( grid2_count[n] > imax ) imax = grid2_count[n];
+    }
+
+  idiff =  (imax - imin)/10 + 1;
+  icount = 0;
+  for ( i = 0; i < rg.grid2_size; ++i )
+    if ( grid2_count[i] > 0 ) icount++;
+
+  cdoPrint("number of cells participating in remap %d", icount);
+
+  if ( icount )
+    {
+      cdoPrint("min no of entries/row = %d", imin);
+      cdoPrint("max no of entries/row = %d", imax);
+
+      imax = imin + idiff;
+      for ( n = 0; n < 10; ++n )
+	{
+	  icount = 0;
+	  for ( i = 0; i < rg.grid2_size; ++i )
+	    if ( grid2_count[i] >= imin && grid2_count[i] < imax ) icount++;
+
+	  if ( icount )
+	    cdoPrint("num of rows with entries between %d - %d  %d", imin, imax-1, icount);
+
+	  imin = imin + idiff;
+	  imax = imax + idiff;
+	}
+    }
+
+  free(grid2_count);
+
+} /* remap_stat */
+
+/*****************************************************************************/
+
+void remap_gradients(remapgrid_t rg, const double *restrict array, double *restrict grad1_lat,
+		     double *restrict grad1_lon, double *restrict grad1_latlon)
+{
+  long n, nx, ny, grid1_size;
+  long i, j, ip1, im1, jp1, jm1, in, is, ie, iw, ine, inw, ise, isw;
+  double delew, delns;
+  double grad1_lat_zero, grad1_lon_zero;
+
+  if ( rg.grid1_rank != 2 )
+    cdoAbort("Internal problem (remap_gradients), grid1 rank = %d!", rg.grid1_rank);
+
+  grid1_size = rg.grid1_size;
+  nx = rg.grid1_dims[0];
+  ny = rg.grid1_dims[1];
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(none)        \
+  shared(grid1_size, grad1_lat, grad1_lon, grad1_latlon, rg, nx, ny, array) \
+  private(n, i, j, ip1, im1, jp1, jm1, in, is, ie, iw, ine, inw, ise, isw, delew, delns, grad1_lat_zero, grad1_lon_zero)
+#endif
+  for ( n = 0; n < grid1_size; ++n )
+    {
+      grad1_lat[n] = ZERO;
+      grad1_lon[n] = ZERO;
+      grad1_latlon[n] = ZERO;
+
+      if ( rg.grid1_mask[n] )
+	{
+	  delew = HALF;
+	  delns = HALF;
+
+	  j = n/nx + 1;
+	  i = n - (j-1)*nx + 1;
+
+	  ip1 = i + 1;
+	  im1 = i - 1;
+	  jp1 = j + 1;
+	  jm1 = j - 1;
+
+	  if ( ip1 > nx ) ip1 = ip1 - nx;
+	  if ( im1 <  1 ) im1 = nx;
+	  if ( jp1 > ny )
+	    {
+              jp1 = j;
+              delns = ONE;
+            }
+	  if ( jm1 < 1 )
+	    {
+              jm1 = j;
+              delns = ONE;
+            }
+
+	  in  = (jp1-1)*nx + i - 1;
+	  is  = (jm1-1)*nx + i - 1;
+	  ie  = (j  -1)*nx + ip1 - 1;
+	  iw  = (j  -1)*nx + im1 - 1;
+
+	  ine = (jp1-1)*nx + ip1 - 1;
+	  inw = (jp1-1)*nx + im1 - 1;
+	  ise = (jm1-1)*nx + ip1 - 1;
+	  isw = (jm1-1)*nx + im1 - 1;
+
+	  /* Compute i-gradient */
+
+	  if ( ! rg.grid1_mask[ie] )
+	    {
+              ie = n;
+              delew = ONE;
+            }
+	  if ( ! rg.grid1_mask[iw] )
+	    {
+              iw = n;
+              delew = ONE;
+            }
+ 
+	  grad1_lat[n] = delew*(array[ie] - array[iw]);
+
+	  /* Compute j-gradient */
+
+	  if ( ! rg.grid1_mask[in] )
+	    {
+              in = n;
+              delns = ONE;
+            }
+	  if ( ! rg.grid1_mask[is] )
+	    {
+              is = n;
+              delns = ONE;
+            }
+ 
+	  grad1_lon[n] = delns*(array[in] - array[is]);
+
+	  /* Compute ij-gradient */
+
+	  delew = HALF;
+	  if ( jp1 == j || jm1 == j )
+	    delns = ONE;
+	  else 
+	    delns = HALF;
+
+	  if ( ! rg.grid1_mask[ine] )
+	    {
+              if ( in != n )
+		{
+		  ine = in;
+		  delew = ONE;
+		}
+              else if ( ie != n )
+		{
+		  ine = ie;
+		  inw = iw;
+		  if ( inw == n ) delew = ONE;
+		  delns = ONE;
+		}
+              else
+		{
+		  ine = n;
+		  inw = iw;
+		  delew = ONE;
+		  delns = ONE;
+		}
+	    }
+
+	  if ( ! rg.grid1_mask[inw] )
+	    {
+              if ( in != n )
+		{
+		  inw = in;
+		  delew = ONE;
+		}
+              else if ( iw != n )
+		{
+		  inw = iw;
+		  ine = ie;
+		  if ( ie == n ) delew = ONE;
+		  delns = ONE;
+		}
+              else
+		{
+		  inw = n;
+		  ine = ie;
+		  delew = ONE;
+		  delns = ONE;
+		}
+	    }
+
+	  grad1_lat_zero = delew*(array[ine] - array[inw]);
+
+	  if ( ! rg.grid1_mask[ise] )
+	    {
+              if ( is != n )
+		{
+		  ise = is;
+		  delew = ONE;
+		}
+              else if ( ie != n )
+		{
+		  ise = ie;
+		  isw = iw;
+		  if ( isw == n ) delew = ONE;
+		  delns = ONE;
+		}
+              else
+		{
+		  ise = n;
+		  isw = iw;
+		  delew = ONE;
+		  delns = ONE;
+		}
+	    }
+
+	  if ( ! rg.grid1_mask[isw] )
+	    {
+              if ( is != n )
+		{
+		  isw = is;
+		  delew = ONE;
+		}
+              else if ( iw != n )
+		{
+		  isw = iw;
+		  ise = ie;
+		  if ( ie == n ) delew = ONE;
+		  delns = ONE;
+		}
+              else
+		{
+		  isw = n;
+		  ise = ie;
+		  delew = ONE;
+		  delns = ONE;
+		}
+	    }
+
+	  grad1_lon_zero = delew*(array[ise] - array[isw]);
+
+	  grad1_latlon[n] = delns*(grad1_lat_zero - grad1_lon_zero);
+	}
+    }
+} /* remap_gradients */
+
+/*****************************************************************************/
+
+void reorder_links(remapvars_t *rv)
+{
+  long j, nval = 0, num_blks = 0;
+  long lastval;
+  long nlinks;
+  long max_links = 0;
+  long n;
+  long num_links;
+
+  num_links = rv->num_links;
+
+  printf("reorder_links\n");
+  printf("  num_links %ld\n", num_links);
+  rv->links.option = TRUE;
+
+  lastval = -1;
+  for ( n = 0; n < num_links; n++ )
+    {
+      if ( rv->grid2_add[n] == lastval ) nval++;
+      else
+	{
+	  if ( nval > num_blks ) num_blks = nval;
+	  nval = 1;
+	  max_links++;
+	  lastval = rv->grid2_add[n];
+	}
+    }
+
+  if ( num_blks )
+    {
+      rv->links.max_links = max_links;
+      rv->links.num_blks  = num_blks;
+
+      printf("num_links %ld  max_links %ld  num_blks %ld\n", rv->num_links, max_links, num_blks);
+
+      rv->links.num_links = (int *)  malloc(num_blks*sizeof(int));
+      rv->links.dst_add   = (int **) malloc(num_blks*sizeof(int *));
+      rv->links.src_add   = (int **) malloc(num_blks*sizeof(int *));
+      rv->links.w_index   = (int **) malloc(num_blks*sizeof(int *));
+    }
+
+  for ( j = 0; j < num_blks; j++ )
+    {
+      rv->links.dst_add[j] = (int *) malloc(max_links*sizeof(int));
+      rv->links.src_add[j] = (int *) malloc(max_links*sizeof(int));
+      rv->links.w_index[j] = (int *) malloc(max_links*sizeof(int));
+    }
+
+  for ( j = 0; j < num_blks; j++ )
+    {
+      nval = 0;
+      lastval = -1;
+      nlinks = 0;
+
+      for ( n = 0; n < num_links; n++ )
+	{
+	  if ( rv->grid2_add[n] == lastval ) nval++;
+	  else
+	    {
+	      nval = 1;
+	      lastval = rv->grid2_add[n];
+	    }
+	  
+	  if ( nval == j+1 )
+	    {
+	      rv->links.dst_add[j][nlinks] = rv->grid2_add[n];
+	      rv->links.src_add[j][nlinks] = rv->grid1_add[n];
+	      rv->links.w_index[j][nlinks] = n;
+	      nlinks++;
+	    }
+	}
+
+      rv->links.num_links[j] = nlinks;
+      printf("loop %ld  nlinks %ld\n", j+1, nlinks);
+    }
+}
+
+
+/*****************************************************************************/
+
+#if  defined  (HAVE_LIBNETCDF)
+#  include "netcdf.h"
+#endif
+
+
+#if  defined  (HAVE_LIBNETCDF)
+static
+void nce(int istat)
+{
+  /*
+    This routine provides a simple interface to netCDF error message routine.
+  */
+
+  if ( istat != NC_NOERR ) cdoAbort(nc_strerror(istat));
+}
+#endif
+
+
+void write_remap_scrip(const char *interp_file, int map_type, int submap_type, 
+		       int remap_order, remapgrid_t rg, remapvars_t rv)
+{
+  /*
+    Writes remap data to a netCDF file using SCRIP conventions
+  */
+  /*
+    Input variables:
+
+    interp_file  ! filename for remap data
+  */
+
+#if  defined  (HAVE_LIBNETCDF)
+
+  /* Local variables */
+
+  int nc_file_id;           /* id for netCDF file                       */
+  int nc_srcgrdsize_id;     /* id for source grid size                  */
+  int nc_dstgrdsize_id;     /* id for destination grid size             */
+  int nc_srcgrdcorn_id = 0; /* id for number of source grid corners     */
+  int nc_dstgrdcorn_id = 0; /* id for number of dest grid corners       */
+  int nc_srcgrdrank_id;     /* id for source grid rank                  */
+  int nc_dstgrdrank_id;     /* id for dest grid rank                    */
+  int nc_numlinks_id;       /* id for number of links in mapping        */
+  int nc_numwgts_id;        /* id for number of weights for mapping     */
+  int nc_srcgrddims_id;     /* id for source grid dimensions            */
+  int nc_dstgrddims_id;     /* id for dest grid dimensions              */
+  int nc_srcgrdcntrlat_id;  /* id for source grid center latitude       */
+  int nc_dstgrdcntrlat_id;  /* id for dest grid center latitude         */
+  int nc_srcgrdcntrlon_id;  /* id for source grid center longitude      */
+  int nc_dstgrdcntrlon_id;  /* id for dest grid center longitude        */
+  int nc_srcgrdimask_id;    /* id for source grid mask                  */
+  int nc_dstgrdimask_id;    /* id for dest grid mask                    */
+  int nc_srcgrdcrnrlat_id;  /* id for latitude of source grid corners   */
+  int nc_srcgrdcrnrlon_id;  /* id for longitude of source grid corners  */
+  int nc_dstgrdcrnrlat_id;  /* id for latitude of dest grid corners     */
+  int nc_dstgrdcrnrlon_id;  /* id for longitude of dest grid corners    */
+  int nc_srcgrdarea_id;     /* id for area of source grid cells         */
+  int nc_dstgrdarea_id;     /* id for area of dest grid cells           */
+  int nc_srcgrdfrac_id;     /* id for area fraction on source grid      */
+  int nc_dstgrdfrac_id;     /* id for area fraction on dest grid        */
+  int nc_srcadd_id;         /* id for map source address                */
+  int nc_dstadd_id;         /* id for map destination address           */
+  int nc_rmpmatrix_id;      /* id for remapping matrix                  */
+
+  int nc_dims2_id[2];       /* netCDF ids for 2d array dims             */
+
+  char map_name[] = "SCRIP remapping with CDO";
+  char normalize_opt[64] = "unknown";
+  char map_method[64] = "unknown";
+  char tmp_string[64] = "unknown";
+  char history[1024] = "date and time";
+  char grid1_name[64] = "source grid";
+  char grid2_name[64] = "dest grid";
+  char grid1_units[] = "radians";
+  char grid2_units[] = "radians";
+  time_t date_and_time_in_sec;
+  struct tm *date_and_time;
+  long i;
+  int writemode = NC_CLOBBER;
+
+  switch ( rv.norm_opt )
+    {
+    case NORM_OPT_NONE:
+      strcpy(normalize_opt, "none");
+      break;
+    case NORM_OPT_FRACAREA:
+      strcpy(normalize_opt, "fracarea");
+      break;
+    case NORM_OPT_DESTAREA:
+      strcpy(normalize_opt, "destarea");
+      break;
+    }
+
+  switch ( map_type )
+    {
+    case MAP_TYPE_CONSERV:
+      if ( submap_type == SUBMAP_TYPE_LAF )
+	{
+	  strcpy(map_method, "Largest area fraction");
+	  break;
+	}
+      else
+	{
+	  strcpy(map_method, "Conservative remapping");
+	  break;
+	}
+    case MAP_TYPE_BILINEAR:
+      strcpy(map_method, "Bilinear remapping");
+      break;
+    case MAP_TYPE_DISTWGT:
+      strcpy(map_method, "Distance weighted avg of nearest neighbors");
+      break;
+    case MAP_TYPE_DISTWGT1:
+      strcpy(map_method, "Nearest neighbor");
+      break;
+    case MAP_TYPE_BICUBIC:
+      strcpy(map_method, "Bicubic remapping");
+      break;
+    }
+
+  {
+    size_t filesize;
+    size_t nele1, nele2;
+
+    nele1 = 4*8 + 4;
+    nele2 = 4*8 + 4;
+    if ( rg.lneed_grid1_corners ) nele1 += rg.grid1_corners*2*8;
+    if ( rg.lneed_grid2_corners ) nele2 += rg.grid2_corners*2*8;
+    filesize = rg.grid1_size*(nele1) +
+               rg.grid2_size*(nele2) +
+               rv.num_links*(4 + 4 + rv.num_wts*8);
+
+    if ( cdoVerbose )
+      cdoPrint("Filesize for remap weights: ~%lu", (unsigned long) filesize);
+    
+    if ( filesize > 0x7FFFFC00 ) /* 2**31 - 1024 (<2GB) */
+      {
+#if  defined  (NC_64BIT_OFFSET)
+	writemode = NC_CLOBBER | NC_64BIT_OFFSET;
+#else
+	cdoAbort("Filesize for remap weights maybe too large!");
+#endif
+      }
+  }
+
+  /* Create netCDF file for mapping and define some global attributes */
+  nce(nc_create(interp_file, writemode, &nc_file_id));
+
+  /* Map name */
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "title", strlen(map_name), map_name));
+
+  /* Normalization option */
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "normalization", strlen(normalize_opt), normalize_opt));
+
+  /* Map method */
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "map_method", strlen(map_method), map_method));
+
+  /* Remap order */
+  if ( map_type == MAP_TYPE_CONSERV && submap_type == SUBMAP_TYPE_NONE )
+    nce(nc_put_att_int(nc_file_id, NC_GLOBAL, "remap_order", NC_INT, 1L, &remap_order));
+
+  /* History */
+  date_and_time_in_sec = time(NULL);
+
+  if ( date_and_time_in_sec != -1 )
+    {
+      date_and_time = localtime(&date_and_time_in_sec);
+      (void) strftime(history, 1024, "%d %b %Y : ", date_and_time);
+      strcat(history, commandLine());
+    }
+
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "history", strlen(history), history));
+
+  /* File convention */
+  strcpy(tmp_string, "SCRIP");
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "conventions", strlen(tmp_string), tmp_string));
+
+  /* Source and destination grid names */
+  gridName(gridInqType(rg.gridID1), grid1_name);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "source_grid", strlen(grid1_name), grid1_name));
+
+  gridName(gridInqType(rg.gridID2), grid2_name);
+  nce(nc_put_att_text(nc_file_id, NC_GLOBAL, "dest_grid", strlen(grid2_name), grid2_name));
+
+  /* Prepare netCDF dimension info */
+
+  /* Define grid size dimensions */
+  nce(nc_def_dim(nc_file_id, "src_grid_size", rg.grid1_size, &nc_srcgrdsize_id));
+  nce(nc_def_dim(nc_file_id, "dst_grid_size", rg.grid2_size, &nc_dstgrdsize_id));
+
+  /* Define grid corner dimension */
+  if ( rg.lneed_grid1_corners )
+    nce(nc_def_dim(nc_file_id, "src_grid_corners", rg.grid1_corners, &nc_srcgrdcorn_id));
+  if ( rg.lneed_grid2_corners )
+    nce(nc_def_dim(nc_file_id, "dst_grid_corners", rg.grid2_corners, &nc_dstgrdcorn_id));
+
+  /* Define grid rank dimension */
+  nce(nc_def_dim(nc_file_id, "src_grid_rank", rg.grid1_rank, &nc_srcgrdrank_id));
+  nce(nc_def_dim(nc_file_id, "dst_grid_rank", rg.grid2_rank, &nc_dstgrdrank_id));
+
+  /* Define map size dimensions */
+  nce(nc_def_dim(nc_file_id, "num_links", rv.num_links, &nc_numlinks_id));
+  nce(nc_def_dim(nc_file_id, "num_wgts", rv.num_wts, &nc_numwgts_id));
+       
+  /* Define grid dimensions */
+  nce(nc_def_var(nc_file_id, "src_grid_dims", NC_INT, 1, &nc_srcgrdrank_id, &nc_srcgrddims_id));
+  nce(nc_def_var(nc_file_id, "dst_grid_dims", NC_INT, 1, &nc_dstgrdrank_id, &nc_dstgrddims_id));
+
+  /* Define all arrays for netCDF descriptors */
+
+  /* Define grid center latitude array */
+  nce(nc_def_var(nc_file_id, "src_grid_center_lat", NC_DOUBLE, 1, &nc_srcgrdsize_id, &nc_srcgrdcntrlat_id));
+  nce(nc_def_var(nc_file_id, "dst_grid_center_lat", NC_DOUBLE, 1, &nc_dstgrdsize_id, &nc_dstgrdcntrlat_id));
+
+  /* Define grid center longitude array */
+  nce(nc_def_var(nc_file_id, "src_grid_center_lon", NC_DOUBLE, 1, &nc_srcgrdsize_id, &nc_srcgrdcntrlon_id));
+  nce(nc_def_var(nc_file_id, "dst_grid_center_lon", NC_DOUBLE, 1, &nc_dstgrdsize_id, &nc_dstgrdcntrlon_id));
+
+  /* Define grid corner lat/lon arrays */
+
+  nc_dims2_id[0] = nc_srcgrdsize_id;
+  nc_dims2_id[1] = nc_srcgrdcorn_id;
+
+  if ( rg.lneed_grid1_corners )
+    {
+      nce(nc_def_var(nc_file_id, "src_grid_corner_lat", NC_DOUBLE, 2, nc_dims2_id, &nc_srcgrdcrnrlat_id));
+      nce(nc_def_var(nc_file_id, "src_grid_corner_lon", NC_DOUBLE, 2, nc_dims2_id, &nc_srcgrdcrnrlon_id));
+    }
+
+  nc_dims2_id[0] = nc_dstgrdsize_id;
+  nc_dims2_id[1] = nc_dstgrdcorn_id;
+
+  if ( rg.lneed_grid2_corners )
+    {
+      nce(nc_def_var(nc_file_id, "dst_grid_corner_lat", NC_DOUBLE, 2, nc_dims2_id, &nc_dstgrdcrnrlat_id));
+      nce(nc_def_var(nc_file_id, "dst_grid_corner_lon", NC_DOUBLE, 2, nc_dims2_id, &nc_dstgrdcrnrlon_id));
+    }
+
+  /* Define units for all coordinate arrays */
+  nce(nc_put_att_text(nc_file_id, nc_srcgrdcntrlat_id, "units", 7, grid1_units));
+  nce(nc_put_att_text(nc_file_id, nc_dstgrdcntrlat_id, "units", 7, grid2_units));
+  nce(nc_put_att_text(nc_file_id, nc_srcgrdcntrlon_id, "units", 7, grid1_units));
+  nce(nc_put_att_text(nc_file_id, nc_dstgrdcntrlon_id, "units", 7, grid2_units));
+  if ( rg.lneed_grid1_corners )
+    {
+      nce(nc_put_att_text(nc_file_id, nc_srcgrdcrnrlat_id, "units", 7, grid1_units));
+      nce(nc_put_att_text(nc_file_id, nc_srcgrdcrnrlon_id, "units", 7, grid1_units));
+    }
+  if ( rg.lneed_grid2_corners )
+    {
+      nce(nc_put_att_text(nc_file_id, nc_dstgrdcrnrlat_id, "units", 7, grid2_units));
+      nce(nc_put_att_text(nc_file_id, nc_dstgrdcrnrlon_id, "units", 7, grid2_units));
+    }
+
+  /* Define grid mask */
+
+  nce(nc_def_var(nc_file_id, "src_grid_imask", NC_INT, 1, &nc_srcgrdsize_id, &nc_srcgrdimask_id));
+  nce(nc_put_att_text(nc_file_id, nc_srcgrdimask_id, "units", 8, "unitless"));
+
+  nce(nc_def_var(nc_file_id, "dst_grid_imask", NC_INT, 1, &nc_dstgrdsize_id, &nc_dstgrdimask_id));
+  nce(nc_put_att_text(nc_file_id, nc_dstgrdimask_id, "units", 8, "unitless"));
+
+  /* Define grid area arrays */
+
+  nce(nc_def_var(nc_file_id, "src_grid_area", NC_DOUBLE, 1, &nc_srcgrdsize_id, &nc_srcgrdarea_id));
+  nce(nc_put_att_text(nc_file_id, nc_srcgrdarea_id, "units", 14, "square radians"));
+
+  nce(nc_def_var(nc_file_id, "dst_grid_area", NC_DOUBLE, 1, &nc_dstgrdsize_id, &nc_dstgrdarea_id));   
+  nce(nc_put_att_text(nc_file_id, nc_dstgrdarea_id, "units", 14, "square radians"));
+
+  /* Define grid fraction arrays */
+
+  nce(nc_def_var(nc_file_id, "src_grid_frac", NC_DOUBLE, 1, &nc_srcgrdsize_id, &nc_srcgrdfrac_id));
+  nce(nc_put_att_text(nc_file_id, nc_srcgrdfrac_id, "units", 8, "unitless"));
+
+  nce(nc_def_var(nc_file_id, "dst_grid_frac", NC_DOUBLE, 1, &nc_dstgrdsize_id, &nc_dstgrdfrac_id));
+  nce(nc_put_att_text(nc_file_id, nc_dstgrdfrac_id, "units", 8, "unitless"));
+
+  /* Define mapping arrays */
+
+  nce(nc_def_var(nc_file_id, "src_address", NC_INT, 1, &nc_numlinks_id, &nc_srcadd_id));      
+  nce(nc_def_var(nc_file_id, "dst_address", NC_INT, 1, &nc_numlinks_id, &nc_dstadd_id));
+
+  nc_dims2_id[0] = nc_numlinks_id;
+  nc_dims2_id[1] = nc_numwgts_id;
+
+  nce(nc_def_var(nc_file_id, "remap_matrix", NC_DOUBLE, 2, nc_dims2_id, &nc_rmpmatrix_id));
+
+  /* End definition stage */
+  
+  nce(nc_enddef(nc_file_id));
+
+
+  /* Write mapping data */
+
+  nce(nc_put_var_int(nc_file_id, nc_srcgrddims_id, rg.grid1_dims));
+  nce(nc_put_var_int(nc_file_id, nc_dstgrddims_id, rg.grid2_dims));
+
+  nce(nc_put_var_int(nc_file_id, nc_srcgrdimask_id, rg.grid1_mask));
+  nce(nc_put_var_int(nc_file_id, nc_dstgrdimask_id, rg.grid2_mask));
+
+  nce(nc_put_var_double(nc_file_id, nc_srcgrdcntrlat_id, rg.grid1_center_lat)); 
+  nce(nc_put_var_double(nc_file_id, nc_srcgrdcntrlon_id, rg.grid1_center_lon));
+
+  if ( rg.lneed_grid1_corners )
+    {
+      nce(nc_put_var_double(nc_file_id, nc_srcgrdcrnrlat_id, rg.grid1_corner_lat));
+      nce(nc_put_var_double(nc_file_id, nc_srcgrdcrnrlon_id, rg.grid1_corner_lon));
+    }
+
+  nce(nc_put_var_double(nc_file_id, nc_dstgrdcntrlat_id, rg.grid2_center_lat));
+  nce(nc_put_var_double(nc_file_id, nc_dstgrdcntrlon_id, rg.grid2_center_lon));
+
+  if ( rg.lneed_grid2_corners )
+    {
+      nce(nc_put_var_double(nc_file_id, nc_dstgrdcrnrlat_id, rg.grid2_corner_lat));
+      nce(nc_put_var_double(nc_file_id, nc_dstgrdcrnrlon_id, rg.grid2_corner_lon));
+    }
+  /*
+  if ( luse_grid1_area )
+    nce(nc_put_var_double(nc_file_id, nc_srcgrdarea_id, rg.grid1_area_in));
+  else
+  */
+  if ( map_type == MAP_TYPE_CONSERV )
+    nce(nc_put_var_double(nc_file_id, nc_srcgrdarea_id, rg.grid1_area));
+
+  nce(nc_put_var_double(nc_file_id, nc_srcgrdfrac_id, rg.grid1_frac));
+
+  /*
+  if ( luse_grid2_area )
+    nce(nc_put_var_double(nc_file_id, nc_dstgrdarea_id, rg.grid2_area_in));
+  else
+  */
+  if ( map_type == MAP_TYPE_CONSERV )
+    nce(nc_put_var_double(nc_file_id, nc_dstgrdarea_id, rg.grid2_area));
+
+  nce(nc_put_var_double(nc_file_id, nc_dstgrdfrac_id, rg.grid2_frac));
+
+  for ( i = 0; i < rv.num_links; i++ )
+    {
+      rv.grid1_add[i]++;
+      rv.grid2_add[i]++;
+    }
+
+  nce(nc_put_var_int(nc_file_id, nc_srcadd_id, rv.grid1_add));
+  nce(nc_put_var_int(nc_file_id, nc_dstadd_id, rv.grid2_add));
+
+  nce(nc_put_var_double(nc_file_id, nc_rmpmatrix_id, rv.wts));
+
+  nce(nc_close(nc_file_id));
+
+#else
+  cdoAbort("netCDF support not compiled in!");
+#endif
+
+}  /* write_remap_scrip */
+
+/*****************************************************************************/
+
+void read_remap_scrip(const char *interp_file, int gridID1, int gridID2, int *map_type, int *submap_type,
+		      int *remap_order, remapgrid_t *rg, remapvars_t *rv)
+{
+  /*
+    The routine reads a netCDF file to extract remapping info
+    in SCRIP format
+  */
+  /*
+    Input variables
+
+    interp_file        ! filename for remap data
+  */
+#if  defined  (HAVE_LIBNETCDF)
+
+  /* Local variables */
+
+  int status;
+  int nc_file_id;           /* id for netCDF file                       */
+  int nc_srcgrdsize_id;     /* id for source grid size                  */
+  int nc_dstgrdsize_id;     /* id for destination grid size             */
+  int nc_srcgrdcorn_id;     /* id for number of source grid corners     */
+  int nc_dstgrdcorn_id;     /* id for number of dest grid corners       */
+  int nc_srcgrdrank_id;     /* id for source grid rank                  */
+  int nc_dstgrdrank_id;     /* id for dest grid rank                    */
+  int nc_numlinks_id;       /* id for number of links in mapping        */
+  int nc_numwgts_id;        /* id for number of weights for mapping     */
+  int nc_srcgrddims_id;     /* id for source grid dimensions            */
+  int nc_dstgrddims_id;     /* id for dest grid dimensions              */
+  int nc_srcgrdcntrlat_id;  /* id for source grid center latitude       */
+  int nc_dstgrdcntrlat_id;  /* id for dest grid center latitude         */
+  int nc_srcgrdcntrlon_id;  /* id for source grid center longitude      */
+  int nc_dstgrdcntrlon_id;  /* id for dest grid center longitude        */
+  int nc_srcgrdimask_id;    /* id for source grid mask                  */
+  int nc_dstgrdimask_id;    /* id for dest grid mask                    */
+  int nc_srcgrdcrnrlat_id;  /* id for latitude of source grid corners   */
+  int nc_srcgrdcrnrlon_id;  /* id for longitude of source grid corners  */
+  int nc_dstgrdcrnrlat_id;  /* id for latitude of dest grid corners     */
+  int nc_dstgrdcrnrlon_id;  /* id for longitude of dest grid corners    */
+  int nc_srcgrdarea_id;     /* id for area of source grid cells         */
+  int nc_dstgrdarea_id;     /* id for area of dest grid cells           */
+  int nc_srcgrdfrac_id;     /* id for area fraction on source grid      */
+  int nc_dstgrdfrac_id;     /* id for area fraction on dest grid        */
+  int nc_srcadd_id;         /* id for map source address                */
+  int nc_dstadd_id;         /* id for map destination address           */
+  int nc_rmpmatrix_id;      /* id for remapping matrix                  */
+
+  long i;                   /* dummy index */
+
+  char map_name[1024];
+  char map_method[64];      /* character string for map_type             */
+  char normalize_opt[64];   /* character string for normalization option */
+  char convention[64];      /* character string for output convention    */
+  char grid1_name[64];      /* grid name for source grid                 */
+  char grid2_name[64];      /* grid name for dest   grid                 */
+  char grid1_units[64];
+  char grid2_units[64];
+  size_t attlen, dimlen;
+
+  int gridID1_gme_c = -1;
+
+
+  /* Open file and read some global information */
+
+  /* nce(nc_open(interp_file, NC_NOWRITE, &nc_file_id)); */
+  nc_file_id = cdf_openread(interp_file);
+
+  /* Map name */
+
+  nce(nc_get_att_text(nc_file_id, NC_GLOBAL, "title", map_name));
+  nce(nc_inq_attlen(nc_file_id, NC_GLOBAL, "title", &attlen));
+  map_name[attlen] = 0;
+
+  if ( cdoVerbose )
+    {
+      cdoPrint("Reading remapping: %s", map_name);
+      cdoPrint("From file: %s", interp_file);
+    }
+
+  /* Normalization option */
+
+  nce(nc_get_att_text(nc_file_id, NC_GLOBAL, "normalization", normalize_opt));
+  nce(nc_inq_attlen(nc_file_id, NC_GLOBAL, "normalization", &attlen));
+  normalize_opt[attlen] = 0;
+
+  if ( strcmp(normalize_opt, "none") == 0 )
+    rv->norm_opt = NORM_OPT_NONE;
+  else if ( strcmp(normalize_opt, "fracarea") == 0 )
+    rv->norm_opt = NORM_OPT_FRACAREA;
+  else if ( strcmp(normalize_opt, "destarea") == 0 )
+    rv->norm_opt = NORM_OPT_DESTAREA;
+  else
+    {
+      cdoPrint("normalize_opt = %s", normalize_opt);
+      cdoAbort("Invalid normalization option");
+    }
+
+  if ( cdoVerbose )
+    cdoPrint("normalize_opt = %s", normalize_opt);
+
+  /* Map method */
+
+  nce(nc_get_att_text (nc_file_id, NC_GLOBAL, "map_method", map_method));
+  nce(nc_inq_attlen(nc_file_id, NC_GLOBAL, "map_method", &attlen));
+  map_method[attlen] = 0;
+
+  *submap_type = SUBMAP_TYPE_NONE;
+  *remap_order = 1;
+
+  if ( memcmp(map_method, "Conservative", 12) == 0 )
+    {
+      int iatt;
+      rv->map_type = MAP_TYPE_CONSERV;
+      status = nc_get_att_int(nc_file_id, NC_GLOBAL, "remap_order", &iatt);
+      if ( status == NC_NOERR ) *remap_order = iatt;
+    }
+  else if ( memcmp(map_method, "Bilinear", 8) == 0 ) rv->map_type = MAP_TYPE_BILINEAR;
+  else if ( memcmp(map_method, "Distance", 8) == 0 ) rv->map_type = MAP_TYPE_DISTWGT;
+  else if ( memcmp(map_method, "Nearest", 7) == 0 )  rv->map_type = MAP_TYPE_DISTWGT1;
+  else if ( memcmp(map_method, "Bicubic", 7) == 0 )  rv->map_type = MAP_TYPE_BICUBIC;
+  else if ( memcmp(map_method, "Largest", 7) == 0 )
+    {
+      rv->map_type = MAP_TYPE_CONSERV;
+      *submap_type = SUBMAP_TYPE_LAF;
+    }
+  else
+    {
+      cdoPrint("map_type = %s", map_method);
+      cdoAbort("Invalid Map Type");
+    }
+
+  if ( cdoVerbose )
+    cdoPrint("map_type = %s", map_method);
+
+  *map_type = rv->map_type;
+
+  /* File convention */
+
+  nce(nc_get_att_text (nc_file_id, NC_GLOBAL, "conventions", convention));
+  nce(nc_inq_attlen(nc_file_id, NC_GLOBAL, "conventions", &attlen));
+  convention[attlen] = 0;
+
+  if ( strcmp(convention, "SCRIP") != 0 )
+    {
+      cdoPrint("convention = %s", convention);
+      if ( strcmp(convention, "NCAR-CSM") == 0 )
+        cdoAbort("Unsupported file convention!");
+      else
+        cdoAbort("Unknown file convention!");
+    }
+
+  /* Read some additional global attributes */
+
+  /* Source and destination grid names */
+
+  nce(nc_get_att_text (nc_file_id, NC_GLOBAL, "source_grid", grid1_name));
+  nce(nc_inq_attlen(nc_file_id, NC_GLOBAL, "source_grid", &attlen));
+  grid1_name[attlen] = 0;
+  
+  nce(nc_get_att_text (nc_file_id, NC_GLOBAL, "dest_grid", grid2_name));
+  nce(nc_inq_attlen(nc_file_id, NC_GLOBAL, "dest_grid", &attlen));
+  grid2_name[attlen] = 0;
+ 
+  if ( cdoVerbose )
+    cdoPrint("Remapping between: %s and %s", grid1_name, grid2_name);
+
+  /* Read dimension information */
+
+  nce(nc_inq_dimid(nc_file_id, "src_grid_size", &nc_srcgrdsize_id));
+  nce(nc_inq_dimlen(nc_file_id, nc_srcgrdsize_id, &dimlen));
+  rg->grid1_size = dimlen;
+  /*
+  if (  rg->grid1_size != gridInqSize(gridID1) )
+    cdoAbort("Source grids have different size!");
+  */
+  nce(nc_inq_dimid(nc_file_id, "dst_grid_size", &nc_dstgrdsize_id));
+  nce(nc_inq_dimlen(nc_file_id, nc_dstgrdsize_id, &dimlen));
+  rg->grid2_size = dimlen;
+  /*
+  if ( rg->grid2_size != gridInqSize(gridID2) )
+    cdoAbort("Target grids have different size!");
+  */
+  rg->grid1_corners = 0;
+  rg->luse_grid1_corners = FALSE;
+  rg->lneed_grid1_corners = FALSE;
+  status = nc_inq_dimid(nc_file_id, "src_grid_corners", &nc_srcgrdcorn_id);
+  if ( status == NC_NOERR )
+    {
+      nce(nc_inq_dimlen(nc_file_id, nc_srcgrdcorn_id, &dimlen));
+      rg->grid1_corners = dimlen;
+      rg->luse_grid1_corners = TRUE;
+      rg->lneed_grid1_corners = TRUE;
+    }
+
+  rg->grid2_corners = 0;
+  rg->luse_grid2_corners = FALSE;
+  rg->lneed_grid2_corners = FALSE;
+  status = nc_inq_dimid(nc_file_id, "dst_grid_corners", &nc_dstgrdcorn_id);
+  if ( status == NC_NOERR )
+    {
+      nce(nc_inq_dimlen(nc_file_id, nc_dstgrdcorn_id, &dimlen));
+      rg->grid2_corners = dimlen;
+      rg->luse_grid2_corners = TRUE;
+      rg->lneed_grid2_corners = TRUE;
+    }
+
+  nce(nc_inq_dimid(nc_file_id, "src_grid_rank", &nc_srcgrdrank_id));
+  nce(nc_inq_dimlen(nc_file_id, nc_srcgrdrank_id, &dimlen));
+  rg->grid1_rank = dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "dst_grid_rank", &nc_dstgrdrank_id));
+  nce(nc_inq_dimlen(nc_file_id, nc_dstgrdrank_id, &dimlen));
+  rg->grid2_rank = dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "num_links", &nc_numlinks_id));
+  nce(nc_inq_dimlen(nc_file_id, nc_numlinks_id, &dimlen));
+  rv->num_links = dimlen;
+
+  nce(nc_inq_dimid(nc_file_id, "num_wgts", &nc_numwgts_id));
+  nce(nc_inq_dimlen(nc_file_id, nc_numwgts_id, &dimlen));
+  rv->num_wts = dimlen;
+
+  rg->gridID1 = gridID1;
+  rg->gridID2 = gridID2;
+
+  /* Initialize all pointer */
+  rg->pinit = FALSE;
+  remapGridInitPointer(rg);
+
+  if ( gridInqType(gridID1) == GRID_GME )
+    {
+      rg->grid1_nvgp = gridInqSize(gridID1);
+      gridID1_gme_c = gridToUnstructured(gridID1, 1);
+    }
+
+  remapGridRealloc(rv->map_type, rg);
+
+  if ( gridInqType(gridID1) == GRID_GME ) gridInqMaskGME(gridID1_gme_c, rg->grid1_vgpm);    
+
+  rv->pinit = TRUE;
+  rv->wts = NULL;
+
+  rv->max_links = rv->num_links;
+
+  rv->resize_increment = (int) (0.1 * MAX(rg->grid1_size, rg->grid2_size));
+
+  /* Allocate address and weight arrays for mapping 1 */
+
+  rv->grid1_add = (int *) malloc(rv->num_links*sizeof(int));
+  rv->grid2_add = (int *) malloc(rv->num_links*sizeof(int));
+
+  rv->wts = (double *) malloc(rv->num_wts*rv->num_links*sizeof(double));
+
+  /* Get variable ids */
+
+  nce(nc_inq_varid(nc_file_id, "src_grid_dims", &nc_srcgrddims_id));
+  nce(nc_inq_varid(nc_file_id, "src_grid_imask", &nc_srcgrdimask_id));
+  nce(nc_inq_varid(nc_file_id, "src_grid_center_lat", &nc_srcgrdcntrlat_id));
+  nce(nc_inq_varid(nc_file_id, "src_grid_center_lon", &nc_srcgrdcntrlon_id));
+  if ( rg->grid1_corners )
+    {
+      nce(nc_inq_varid(nc_file_id, "src_grid_corner_lat", &nc_srcgrdcrnrlat_id));
+      nce(nc_inq_varid(nc_file_id, "src_grid_corner_lon", &nc_srcgrdcrnrlon_id));
+    }
+  nce(nc_inq_varid(nc_file_id, "src_grid_area", &nc_srcgrdarea_id));
+  nce(nc_inq_varid(nc_file_id, "src_grid_frac", &nc_srcgrdfrac_id));
+  nce(nc_inq_varid(nc_file_id, "dst_grid_dims", &nc_dstgrddims_id));
+  nce(nc_inq_varid(nc_file_id, "dst_grid_imask", &nc_dstgrdimask_id));
+  nce(nc_inq_varid(nc_file_id, "dst_grid_center_lat", &nc_dstgrdcntrlat_id));
+  nce(nc_inq_varid(nc_file_id, "dst_grid_center_lon", &nc_dstgrdcntrlon_id));
+  if ( rg->grid2_corners )
+    {
+      nce(nc_inq_varid(nc_file_id, "dst_grid_corner_lat", &nc_dstgrdcrnrlat_id));
+      nce(nc_inq_varid(nc_file_id, "dst_grid_corner_lon", &nc_dstgrdcrnrlon_id));
+    }
+  nce(nc_inq_varid(nc_file_id, "dst_grid_area", &nc_dstgrdarea_id));
+  nce(nc_inq_varid(nc_file_id, "dst_grid_frac", &nc_dstgrdfrac_id));    
+  nce(nc_inq_varid(nc_file_id, "src_address", &nc_srcadd_id));
+  nce(nc_inq_varid(nc_file_id, "dst_address", &nc_dstadd_id));
+  nce(nc_inq_varid(nc_file_id, "remap_matrix", &nc_rmpmatrix_id));
+
+  /* Read all variables */
+
+  nce(nc_get_var_int(nc_file_id, nc_srcgrddims_id, rg->grid1_dims));
+
+  nce(nc_get_var_int(nc_file_id, nc_srcgrdimask_id, rg->grid1_mask));
+
+  nce(nc_get_var_double(nc_file_id, nc_srcgrdcntrlat_id, rg->grid1_center_lat));
+  nce(nc_get_var_double(nc_file_id, nc_srcgrdcntrlon_id, rg->grid1_center_lon));
+
+  nce(nc_get_att_text(nc_file_id, nc_srcgrdcntrlat_id, "units", grid1_units));
+  nce(nc_inq_attlen(nc_file_id, nc_srcgrdcntrlat_id, "units", &attlen));
+  grid1_units[attlen] = 0;
+
+  if ( memcmp(grid1_units, "degree", 6) == 0 )
+    scale2(rg->grid1_size, DEG2RAD, rg->grid1_center_lat, rg->grid1_center_lon);
+  else if ( memcmp(grid1_units, "radian", 6) != 0 )
+    cdoPrint("Unknown units supplied for grid1 center lat/lon: proceeding assuming radians");
+
+  if ( rg->grid1_corners )
+    {
+      nce(nc_get_var_double(nc_file_id, nc_srcgrdcrnrlat_id, rg->grid1_corner_lat));
+      nce(nc_get_var_double(nc_file_id, nc_srcgrdcrnrlon_id, rg->grid1_corner_lon));
+
+      nce(nc_get_att_text(nc_file_id, nc_srcgrdcrnrlat_id, "units", grid1_units));
+      nce(nc_inq_attlen(nc_file_id, nc_srcgrdcrnrlat_id, "units", &attlen));
+      grid1_units[attlen] = 0;
+
+      if ( memcmp(grid1_units, "degree", 6) == 0 )
+	scale2( rg->grid1_corners*rg->grid1_size, DEG2RAD, rg->grid1_corner_lat, rg->grid1_corner_lon);
+      else if ( memcmp(grid1_units, "radian", 6) != 0 )
+	cdoPrint("Unknown units supplied for grid1 corner lat/lon: proceeding assuming radians");
+    }
+
+  if ( rv->map_type == MAP_TYPE_CONSERV )
+    nce(nc_get_var_double(nc_file_id, nc_srcgrdarea_id, rg->grid1_area));
+
+  nce(nc_get_var_double(nc_file_id, nc_srcgrdfrac_id, rg->grid1_frac));
+
+  nce(nc_get_var_int(nc_file_id, nc_dstgrddims_id, rg->grid2_dims));
+
+  nce(nc_get_var_int(nc_file_id, nc_dstgrdimask_id, rg->grid2_mask));
+
+  nce(nc_get_var_double(nc_file_id, nc_dstgrdcntrlat_id, rg->grid2_center_lat));
+  nce(nc_get_var_double(nc_file_id, nc_dstgrdcntrlon_id, rg->grid2_center_lon));
+
+  nce(nc_get_att_text(nc_file_id, nc_dstgrdcntrlat_id, "units", grid2_units));
+  nce(nc_inq_attlen(nc_file_id, nc_dstgrdcntrlat_id, "units", &attlen));
+  grid2_units[attlen] = 0;
+
+  if ( memcmp(grid2_units, "degree", 6) == 0 )
+    scale2(rg->grid2_size, DEG2RAD, rg->grid2_center_lat, rg->grid2_center_lon);
+  else if ( memcmp(grid2_units, "radian", 6) != 0 )
+    cdoPrint("Unknown units supplied for grid2 center lat/lon: proceeding assuming radians");
+
+  if ( rg->grid2_corners )
+    {
+      nce(nc_get_var_double(nc_file_id, nc_dstgrdcrnrlat_id, rg->grid2_corner_lat));
+      nce(nc_get_var_double(nc_file_id, nc_dstgrdcrnrlon_id, rg->grid2_corner_lon));
+
+      nce(nc_get_att_text(nc_file_id, nc_dstgrdcrnrlat_id, "units", grid2_units));
+      nce(nc_inq_attlen(nc_file_id, nc_dstgrdcrnrlat_id, "units", &attlen));
+      grid2_units[attlen] = 0;
+      
+      if ( memcmp(grid2_units, "degree", 6) == 0 )
+	scale2( rg->grid2_corners*rg->grid2_size, DEG2RAD, rg->grid2_corner_lat, rg->grid2_corner_lon);
+      else if ( memcmp(grid2_units, "radian", 6) != 0 )
+	cdoPrint("Unknown units supplied for grid2 corner lat/lon: proceeding assuming radians");
+    }
+
+  if ( rv->map_type == MAP_TYPE_CONSERV )
+    nce(nc_get_var_double(nc_file_id, nc_dstgrdarea_id, rg->grid2_area));
+
+  nce(nc_get_var_double(nc_file_id, nc_dstgrdfrac_id, rg->grid2_frac));
+
+  nce(nc_get_var_int(nc_file_id, nc_srcadd_id, rv->grid1_add));
+  nce(nc_get_var_int(nc_file_id, nc_dstadd_id, rv->grid2_add));
+
+  for ( i = 0; i < rv->num_links; i++ )
+    {
+      rv->grid1_add[i]--;
+      rv->grid2_add[i]--;
+    }
+
+  nce(nc_get_var_double(nc_file_id, nc_rmpmatrix_id, rv->wts));
+
+  /* Close input file */
+
+  nce(nc_close(nc_file_id));
+
+#else
+  cdoAbort("netCDF support not compiled in!");
+#endif
+
+  rv->links.option    = FALSE;
+  rv->links.max_links = 0;
+  rv->links.num_blks  = 0;
+  rv->links.num_links = NULL;
+  rv->links.src_add   = NULL;
+  rv->links.dst_add   = NULL;
+  rv->links.w_index   = NULL;
+}  /* read_remap_scrip */
diff --git a/src/remapsort.c b/src/remapsort.c
new file mode 100644
index 0000000..b0b40f3
--- /dev/null
+++ b/src/remapsort.c
@@ -0,0 +1,795 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+
+#include "cdo.h"
+#include "remap.h"
+
+/*****************************************************************************/
+
+static
+int isSorted(int *restrict array1, int *restrict array2, const long size)
+{
+  for ( long idx = 1; idx < size; ++idx )
+    {
+      if (  (array1[idx-1] >  array1[idx]) ||
+	   ((array1[idx-1] == array1[idx]) &&
+	    (array2[idx-1] >  array2[idx])) )
+	{
+	  return 0;
+	}
+    }
+
+  return 1;
+}
+
+static
+void swap(int *restrict v1, int *restrict v2)
+{
+  const int tmp = *v1;
+  *v1 = *v2;
+  *v2 = tmp;
+}
+
+static
+void heapify(const long pos, const long size, int *restrict arr1, int *restrict arr2, int *restrict arr3)
+{
+  const long leftChild = pos*2 + 1;
+  
+  if ( leftChild < size )
+    {
+      long maxIter = pos;
+      if (  (arr1[leftChild] >  arr1[maxIter]) ||
+	   ((arr1[leftChild] == arr1[maxIter]) &&
+	    (arr2[leftChild] >  arr2[maxIter])) )
+	{
+	  maxIter = leftChild;
+	}
+
+      const long rightChild = leftChild + 1;
+      if ( rightChild < size )
+	if (  (arr1[rightChild] >  arr1[maxIter]) ||
+	     ((arr1[rightChild] == arr1[maxIter]) &&
+	      (arr2[rightChild] >  arr2[maxIter])) )
+	  {
+	    maxIter = rightChild;
+	  }
+ 
+      if ( maxIter != pos )
+	{
+	  swap(&arr1[maxIter], &arr1[pos]);
+	  swap(&arr2[maxIter], &arr2[pos]);
+	  swap(&arr3[maxIter], &arr3[pos]);
+	  heapify(maxIter, size, arr1, arr2, arr3);
+	}
+    }
+}
+
+/* remap_heapsort is 30% faster than remap_heapsort_recursiv ! */
+static
+void remap_heapsort_recursiv(const long num_links, int *restrict arr1, int *restrict arr2, int *restrict arr3)
+{
+  long lvl;     /* level indexes for heap sort levels */
+
+  for ( lvl = num_links/2-1; lvl >= 0; --lvl )
+    {
+      heapify(lvl, num_links, arr1, arr2, arr3);
+    }
+
+  for ( lvl = num_links-1; lvl > 0; --lvl )
+    {
+      swap(&arr1[0], &arr1[lvl]);
+      swap(&arr2[0], &arr2[lvl]);
+      swap(&arr3[0], &arr3[lvl]);
+      heapify(0, lvl, arr1, arr2, arr3);
+    }
+}
+
+static
+void remap_heapsort(const long num_links, int *restrict add1, int *restrict add2, int *restrict idx)
+{
+  int add1_tmp, add2_tmp;  /* temp for addresses during swap     */
+  int idx_tmp;
+  long lvl, final_lvl;     /* level indexes for heap sort levels */
+  long chk_lvl1, max_lvl;
+  long i;
+
+  /*
+    start at the lowest level (N/2) of the tree and shift lower 
+    values to the bottom of the tree, promoting the larger numbers
+  */
+  for ( lvl = num_links/2-1; lvl >= 0; --lvl )
+    {
+      final_lvl = lvl;
+      add1_tmp = add1[lvl];
+      add2_tmp = add2[lvl];
+      idx_tmp  = idx[lvl];
+
+      /* Loop until proper level is found for this link, or reach bottom */
+
+      for ( i = 0; i < num_links; ++i ) /* while ( TRUE ) */
+	{
+	  /* Find the largest of the two daughters */
+
+          chk_lvl1 = 2*final_lvl+1;
+          max_lvl  = 2*final_lvl+2;
+          if ( chk_lvl1 == num_links-1 ) max_lvl = chk_lvl1;
+
+          if ( (add1[chk_lvl1] >  add1[max_lvl]) ||
+	      ((add1[chk_lvl1] == add1[max_lvl]) &&
+               (add2[chk_lvl1] >  add2[max_lvl])) )
+	    {
+	      max_lvl = chk_lvl1;
+	    }
+
+          /*
+	    If the parent is greater than both daughters,
+	    the correct level has been found
+	  */
+          if ( (add1_tmp >  add1[max_lvl]) ||
+              ((add1_tmp == add1[max_lvl]) &&
+               (add2_tmp >  add2[max_lvl])) )
+	    {
+	      add1[final_lvl] = add1_tmp;
+	      add2[final_lvl] = add2_tmp;
+	      idx[final_lvl]  = idx_tmp;
+
+	      break;
+	    }
+	  else
+	    {
+	      /*
+		Otherwise, promote the largest daughter and push
+		down one level in the tree.  If haven't reached
+		the end of the tree, repeat the process.  Otherwise
+		store last values and exit the loop
+	      */
+	      add1[final_lvl] = add1[max_lvl];
+	      add2[final_lvl] = add2[max_lvl];
+	      idx[final_lvl]  = idx[max_lvl];
+
+	      final_lvl = max_lvl;
+	      if ( 2*final_lvl+1 >= num_links )
+		{
+		  add1[final_lvl] = add1_tmp;
+		  add2[final_lvl] = add2_tmp;
+		  idx[final_lvl]  = idx_tmp;
+
+		  break;
+		}
+	    }
+	}
+
+      if ( i == num_links ) cdoAbort("Internal problem, link 1 not found!");
+    }
+
+  /*
+    Now that the heap has been sorted, strip off the top (largest)
+    value and promote the values below
+  */
+  for ( lvl = num_links-1; lvl >= 2; --lvl )
+    {
+      /* Move the top value and insert it into the correct place */
+
+      add1_tmp  = add1[lvl];
+      add1[lvl] = add1[0];
+
+      add2_tmp  = add2[lvl];
+      add2[lvl] = add2[0];
+
+      idx_tmp  = idx[lvl];
+      idx[lvl] = idx[0];
+
+      /* As above this loop sifts the tmp values down until proper level is reached */
+
+      final_lvl = 0;
+
+      for ( i = 0; i < num_links; ++i ) /* while ( TRUE ) */
+	{
+	  /* Find the largest of the two daughters */
+
+          chk_lvl1 = 2*final_lvl+1;
+          max_lvl  = 2*final_lvl+2;
+          if ( max_lvl >= lvl ) max_lvl = chk_lvl1;
+
+          if ( (add1[chk_lvl1] >  add1[max_lvl]) ||
+              ((add1[chk_lvl1] == add1[max_lvl]) &&
+               (add2[chk_lvl1] >  add2[max_lvl])) )
+	    {
+	      max_lvl = chk_lvl1;
+	    }
+
+          /*
+	    If the parent is greater than both daughters,
+	    the correct level has been found
+	  */
+          if ( (add1_tmp >  add1[max_lvl]) ||
+              ((add1_tmp == add1[max_lvl]) &&
+               (add2_tmp >  add2[max_lvl])) )
+	    {
+	      add1[final_lvl] = add1_tmp;
+	      add2[final_lvl] = add2_tmp;
+	      idx[final_lvl]  = idx_tmp;
+
+	      break;
+	    }
+	  else
+	    {
+	      /*
+		Otherwise, promote the largest daughter and push
+		down one level in the tree.  If haven't reached
+		the end of the tree, repeat the process.  Otherwise
+		store last values and exit the loop
+	      */
+	      add1[final_lvl] = add1[max_lvl];
+	      add2[final_lvl] = add2[max_lvl];
+	      idx[final_lvl]  = idx[max_lvl];
+
+	      final_lvl = max_lvl;
+	      if ( 2*final_lvl+1 >= lvl )
+		{
+		  add1[final_lvl] = add1_tmp;
+		  add2[final_lvl] = add2_tmp;
+		  idx[final_lvl]  = idx_tmp;
+
+		  break;
+		}
+	    }
+	}
+
+      if ( i == num_links ) cdoAbort("Internal problem, link 2 not found!");
+    }
+
+  /* Swap the last two entries */
+
+  add1_tmp = add1[1];
+  add1[1]  = add1[0];
+  add1[0]  = add1_tmp;
+
+  add2_tmp = add2[1];
+  add2[1]  = add2[0];
+  add2[0]  = add2_tmp;
+
+  idx_tmp  = idx[1];
+  idx[1]   = idx[0];
+  idx[0]   = idx_tmp;
+}
+
+
+void sort_add(long num_links, long num_wts, int *restrict add1, int *restrict add2, double *restrict weights)
+{
+  /*
+    This routine sorts address and weight arrays based on the destination address with the 
+    source address as a secondary sorting criterion. The method is a standard heap sort.
+  */
+  /*
+    Input and Output arrays:
+    
+       long num_links; ! num of links for this mapping
+       long num_wts;   ! num of weights for this mapping
+       add1,           ! destination address array [num_links]
+       add2            ! source      address array
+       weights         ! remapping weights [num_links*num_wts]
+  */
+
+  /* Local variables */
+
+  int *idx;
+  long i, n;
+  double *wgt_tmp;
+
+  if ( num_links <= 1 ) return;
+
+  idx = (int *) malloc(num_links*sizeof(int));
+  for ( i = 0; i < num_links; ++i ) idx[i] = i;
+
+  remap_heapsort(num_links, add1, add2, idx);
+
+  wgt_tmp = (double*) malloc(num_wts*num_links*sizeof(double));
+  memcpy(wgt_tmp, weights, num_wts*num_links*sizeof(double));
+
+  for ( i = 0; i < num_links; ++i )
+    for ( n = 0; n < num_wts; ++n )
+      weights[num_wts*i+n] = wgt_tmp[num_wts*idx[i]+n];
+
+  free(wgt_tmp);
+  free(idx);
+
+  if ( cdoVerbose ) 
+    if ( !isSorted(add1, add2, num_links) ) fprintf(stderr, ">>>> sort_add failed!!!\n");
+} /* sort_add */
+
+/*****************************************************************************/
+
+void sort_add_orig(long num_links, long num_wts, int *restrict add1, int *restrict add2, double *restrict weights)
+{
+  /*
+    This routine sorts address and weight arrays based on the
+    destination address with the source address as a secondary
+    sorting criterion. The method is a standard heap sort.
+  */
+  /*
+    Input and Output arrays:
+    
+       long num_links; ! num of links for this mapping
+       long num_wts;   ! num of weights for this mapping
+       add1,           ! destination address array [num_links]
+       add2            ! source      address array
+       weights         ! remapping weights [num_links*num_wts]
+  */
+
+  /* Local variables */
+
+  int add1_tmp, add2_tmp;  /* temp for addresses during swap     */
+  long lvl, final_lvl;     /* level indexes for heap sort levels */
+  long chk_lvl1, chk_lvl2, max_lvl;
+  long i, n;
+  double wgttmp[4];        /* temp for holding wts during swap   */
+
+  if ( num_links <= 1 ) return;
+
+  /*
+  for ( n = 0; n < num_links; n++ )
+    printf("in: %5d %5d %5d # dst_add src_add n\n", add1[n]+1, add2[n]+1, n+1);
+  */
+  /*
+    start at the lowest level (N/2) of the tree and shift lower 
+    values to the bottom of the tree, promoting the larger numbers
+  */
+  for ( lvl = num_links/2-1; lvl >= 0; lvl-- )
+    {
+      final_lvl = lvl;
+      add1_tmp = add1[lvl];
+      add2_tmp = add2[lvl];
+      for ( n = 0; n < num_wts; n++ )
+	wgttmp[n] = weights[num_wts*lvl+n];
+
+      /* Loop until proper level is found for this link, or reach bottom */
+
+      for ( i = 0; i < num_links; i++ ) /* while ( TRUE ) */
+	{
+	  /* Find the largest of the two daughters */
+
+          chk_lvl1 = 2*final_lvl+1;
+          chk_lvl2 = 2*final_lvl+2;
+          if ( chk_lvl1 == num_links-1 ) chk_lvl2 = chk_lvl1;
+
+          if ((add1[chk_lvl1] >  add1[chk_lvl2]) ||
+	     ((add1[chk_lvl1] == add1[chk_lvl2]) &&
+              (add2[chk_lvl1] >  add2[chk_lvl2])))
+            max_lvl = chk_lvl1;
+          else 
+            max_lvl = chk_lvl2;
+
+          /*
+	    If the parent is greater than both daughters,
+	    the correct level has been found
+	  */
+          if ((add1_tmp >  add1[max_lvl]) ||
+             ((add1_tmp == add1[max_lvl]) &&
+              (add2_tmp >  add2[max_lvl])))
+	    {
+	      add1[final_lvl] = add1_tmp;
+	      add2[final_lvl] = add2_tmp;
+	      for ( n = 0; n < num_wts; n++ )
+		weights[num_wts*final_lvl+n] = wgttmp[n];
+
+	      break;
+	    }
+	  else
+	    {
+	      /*
+		Otherwise, promote the largest daughter and push
+		down one level in the tree.  If haven"t reached
+		the end of the tree, repeat the process.  Otherwise
+		store last values and exit the loop
+	      */
+	      add1[final_lvl] = add1[max_lvl];
+	      add2[final_lvl] = add2[max_lvl];
+	      for ( n = 0; n < num_wts; n++ )
+		weights[num_wts*final_lvl+n] = weights[num_wts*max_lvl+n];
+
+	      final_lvl = max_lvl;
+	      if ( 2*final_lvl+1 >= num_links )
+		{
+		  add1[final_lvl] = add1_tmp;
+		  add2[final_lvl] = add2_tmp;
+		  for ( n = 0; n < num_wts; n++ )
+		    weights[num_wts*final_lvl+n] = wgttmp[n];
+
+		  break;
+		}
+	    }
+	}
+
+      if ( i == num_links ) cdoAbort("Internal problem, link 1 not found!");
+    }
+
+  /*
+    Now that the heap has been sorted, strip off the top (largest)
+    value and promote the values below
+  */
+  for ( lvl = num_links-1; lvl >= 2; lvl-- )
+    {
+      /* Move the top value and insert it into the correct place */
+
+      add1_tmp = add1[lvl];
+      add1[lvl] = add1[0];
+
+      add2_tmp = add2[lvl];
+      add2[lvl] = add2[0];
+
+      for ( n = 0; n < num_wts; n++ )
+        wgttmp[n] = weights[num_wts*lvl+n];
+
+      for ( n = 0; n < num_wts; n++ )
+        weights[num_wts*lvl+n] = weights[n];
+
+      /* As above this loop sifts the tmp values down until proper level is reached */
+
+      final_lvl = 0;
+
+      for ( i = 0; i < num_links; i++ ) /* while ( TRUE ) */
+	{
+	  /* Find the largest of the two daughters */
+
+          chk_lvl1 = 2*final_lvl+1;
+          chk_lvl2 = 2*final_lvl+2;
+          if ( chk_lvl2 >= lvl ) chk_lvl2 = chk_lvl1;
+
+          if ((add1[chk_lvl1] >  add1[chk_lvl2]) ||
+             ((add1[chk_lvl1] == add1[chk_lvl2]) &&
+              (add2[chk_lvl1] >  add2[chk_lvl2])))
+            max_lvl = chk_lvl1;
+          else 
+            max_lvl = chk_lvl2;
+
+          /*
+	    If the parent is greater than both daughters,
+	    the correct level has been found
+	  */
+          if ((add1_tmp >  add1[max_lvl]) ||
+             ((add1_tmp == add1[max_lvl]) &&
+              (add2_tmp >  add2[max_lvl])))
+	    {
+	      add1[final_lvl] = add1_tmp;
+	      add2[final_lvl] = add2_tmp;
+	      for ( n = 0; n < num_wts; n++ )
+		weights[num_wts*final_lvl+n] = wgttmp[n];
+
+	      break;
+	    }
+	  else
+	    {
+	      /*
+		Otherwise, promote the largest daughter and push
+		down one level in the tree.  If haven't reached
+		the end of the tree, repeat the process.  Otherwise
+		store last values and exit the loop
+	      */
+	      add1[final_lvl] = add1[max_lvl];
+	      add2[final_lvl] = add2[max_lvl];
+	      for ( n = 0; n < num_wts; n++ )
+		weights[num_wts*final_lvl+n] = weights[num_wts*max_lvl+n];
+
+	      final_lvl = max_lvl;
+	      if ( 2*final_lvl+1 >= lvl )
+		{
+		  add1[final_lvl] = add1_tmp;
+		  add2[final_lvl] = add2_tmp;
+		  for ( n = 0; n < num_wts; n++ )
+		    weights[num_wts*final_lvl+n] = wgttmp[n];
+
+		  break;
+		}
+	    }
+	}
+
+      if ( i == num_links ) cdoAbort("Internal problem, link 2 not found!");
+    }
+
+  /* Swap the last two entries */
+
+  add1_tmp = add1[1];
+  add1[1]  = add1[0];
+  add1[0]  = add1_tmp;
+
+  add2_tmp = add2[1];
+  add2[1]  = add2[0];
+  add2[0]  = add2_tmp;
+
+  for ( n = 0; n < num_wts; n++ ) wgttmp[n]          = weights[num_wts+n];
+  for ( n = 0; n < num_wts; n++ ) weights[num_wts+n] = weights[n];
+  for ( n = 0; n < num_wts; n++ ) weights[n]         = wgttmp[n];
+  /*
+  for ( n = 0; n < num_links; n++ )
+    printf("out: %5d %5d %5d # dst_add src_add n\n", add1[n]+1, add2[n]+1, n+1);
+  */
+} /* sort_add_orig */
+
+
+/* ******************************************************************************** 
+     XXX       XXX    XXXXXXXXXX    XXXXXXXXXX       XXXXXXXXXXX   XXXXXXXXXX
+    XXXX     XXXX    XXXXXXXXXX    XXXXXXXXXXX     XXXXXXXXXXX    XXXXXXXXXX
+    XXXXX   XXXXX    XXX           XXX     XXX     XXX            XXX
+    XXXXXX XXXXXX    XXXXXXXXX     XXXX  XXXX      XXX            XXXXXXXX
+    XXX  XXX  XXX    XXXXXXXXX     XXXXXXX         XXX     XXXX   XXXXXXXX
+    XXX   X   XXX    XXX           XXX XXXX        XXX      XXX   XXX
+    XXX       XXX    XXXXXXXXXX    XXX   XXXX      XXXXXXXXXXXX   XXXXXXXXXX
+    XXX       XXX    XXXXXXXXXX    XXX     XXXX     XXXXXXXXXX    XXXXXXXXXX
+
+
+           XXXXXXXXXXX      XXXXXXXX     XXXXXXXXXX      XXXXXXXXXXXXX
+          XXXXXXXXXXX      XXX    XXX    XXXXXXXXXXX     XXXXXXXXXXXXX
+          XXX             XXX      XXX   XXX     XXX          XXX
+          XXXXXXXXXXX     XXX      XXX   XXXX  XXXX           XXX
+           XXXXXXXXXXX    XXX      XXX   XXXXXXXX             XXX
+                   XXX    XXX      XXX   XXX XXXX             XXX
+           XXXXXXXXXXX     XXX    XXX    XXX   XXXX           XXX
+          XXXXXXXXXXX       XXXXXXXX     XXX     XXXX         XXX
+********************************************************************************** */
+
+/* MERGE SORT DEFINES */
+//#define MERGE_SORT_CHUNKS          64
+#define MERGE_SORT_LIMIT_SIZE      4096 //num_links/(MERGE_SORT_CHUNKS*omp_get_num_procs())
+
+
+static
+void merge_lists(int *nl, int *l11, int *l12, int *l21, int *l22, long *idx)
+{      
+  /*
+    This routine writes to idx a list of indices relative to *l11 and *l12
+    --> l11, l12, and l21,l22 each need to be allocated in 
+        a signle block of memory
+    The order is thus, that (I) l11[idx[i]]<l11[idx[i+1]]	
+                        OR (II) l11[idx[i]]==l11[idx[i+1]] && l21[idx[i]]<l21[idx[i+1]]
+		       where 0 <= i < nl
+  */    		       
+  int i1=0, i2=0, i=0, ii;
+  const int n1=nl[0], n2=nl[1];
+
+  i=0;
+  while ( i2 < n2 && i1 < n1 ) 
+    {
+      if ( ( l11[i1] < l21[i2] ) ||
+	   ( l11[i1] == l21[i2] && l12[i1] < l22[i2] ) )
+	{ idx[i] = i1;    i1++; }
+      else
+	{ idx[i] = n1+i2; i2++; }
+      i++;
+    }
+
+  for ( ii=i1; i1 < n1; ii++ ) {idx[i] = i1;    i++; i1++; }
+  for ( ii=i2; i2 < n2; ii++ ) {idx[i] = n1+i2; i++; i2++; }
+}
+
+static
+void sort_par(long num_links, long num_wts, int *restrict add1, int *restrict add2, 
+	      double *restrict weights, int parent, int par_depth)
+{
+  /*
+    This routine is the core of merge-sort. It does the following
+     + split the address-arrays into two segments, 
+     + sort each array seperately (this can be done in parallel as there
+       is no data dependency)
+       - the routine sort_iter, which is called for sorting the sub-arrays
+         EITHER calls this routine againg, which means, that the sub-arrays
+	 are further split 
+	 OR     it calls sort_add, which actually sorts the sublist sequentially
+     + merge the sorted arrays together
+     For the merge step additional memory is needed as it cannot work in place. 
+     Therefor, the merge sort algorith in this implementation uses at maximum 
+     twice as much memory as the sequential sort_add.
+
+     Parameters:
+     -----------
+       long num_links    | length of arrays add1 and add2 (MUST be of same length
+       int *add1 *add2   | arrays with addresses, that are used as sorting criteria (ascending)
+       double ** weights | weights for each address that have to be kept in the same order 
+                           as add1[] and add2[]
+       int parent        | the parent of this sort_par. This parameter is used to find 
+                           the recursion depth and determine the actual position of the
+			   sub-array within the original array 
+  */
+
+
+  const int nsplit = 2;                      /* (only 2 allowed) number of segments to split the data */
+  int nl[nsplit];                            /* number of links in each sub-array              */
+  int who_am_i,depth;                        /* current depth, depth of children and index
+						to be parent in next call to sort_par          */
+  int add_srt[nsplit], add_end[nsplit];      /* arrays for start and end index of sub array    */
+  int *add1s[nsplit], *add2s[nsplit];        /* pointers to sub arrays for sort and merge step */
+  int *tmp;                                  /* pointer to buffer for merging of address lists */
+  double *tmp2 = NULL;                       /* pointer to buffer for merging weight lists     */
+  double *wgttmp = NULL;                     /* pointer to buffer for swap weights             */
+  long *idx;                                 /* index list to merge sub-arrays                 */
+  long i,n,m;   
+
+  // printf("sort_par: parent = %d numlinks = %ld\n", parent, num_links);
+  if ( nsplit != 2 )
+    {
+      fprintf(stderr,"Error: splitting into more than two subsegments not allowed\n"
+	     "       in this implementation of merge sort\n");
+      exit(-1);
+    }
+
+  idx = (long *) malloc(num_links*sizeof(long));
+
+  /* SPLIT AND SORT THE DATA FRAGMENTS */
+  /*
+  for ( i=0; i<nsplit; i++)
+    {
+      add_srt[i]= i * num_links/nsplit;
+      add_end[i]= (i+1) * num_links/nsplit;
+      add1s[i]  = &(add1[add_srt[i]]);
+      add2s[i]  = &(add2[add_srt[i]]);
+      nl[i]     = add_end[i]-add_srt[i];
+    }
+  */
+  add_srt[0] = 0;                  add_srt[1] = num_links/nsplit;
+  add1s[0]   = &add1[add_srt[0]];  add1s[1]   = &add1[add_srt[1]];
+  add2s[0]   = &add2[add_srt[0]];  add2s[1]   = &add2[add_srt[1]];
+  nl[0]      = num_links/nsplit;   nl[1]      = num_links-nl[0];
+  add_end[0] = nl[0];              add_end[1] = num_links;
+
+  depth = (int) (log(parent)/log(2));
+
+#if defined (_OPENMP)
+  /* Allow for nested parallelism */
+  if ( omp_in_parallel() && depth<par_depth ) 
+    {
+      omp_set_nested(1);            
+      if ( omp_get_nested() == 0 )
+	printf("Warning: OpenMP implementation seems to not support nested parallelism.\n"
+	       "Maximum of CPUs used is 2 instead of %i.\n", ompNumThreads);
+    }                                    
+#endif
+
+  //  printf("I am %i nl[0] %i nl[1] %i\n",parent,nl[0],nl[1]);
+  //  printf("add_srt[0] %i add_Srt[1] %i\n",add_srt[0],add_srt[1]);
+  //  if ( 1 )
+  //      printf("\n\nSplitting thread into %i!! (I AM %i) depth %i parallel_depth %i add_srt[0]%i add_srt[1] %i\n",
+  //	     nsplit,parent,depth,par_depth,add_srt[0],add_srt[1]);
+
+#if defined (_OPENMP)
+#pragma omp parallel for if ( depth < par_depth ) \
+        private(i, n, m, wgttmp, who_am_i)   \
+        shared(weights) num_threads(2)
+#endif
+  for ( i=0; i < nsplit; i++ )
+    {
+
+      who_am_i = nsplit*parent+i;
+      //    my_depth = (int) (log(parent)/log(2))+1;
+
+#if defined (_OPENMP)
+      //      if ( 1 )
+      //	printf("I am %i (parent %i), my_depth is: %i thread_num %i (%i) \n",
+      //	       who_am_i,parent,my_depth,omp_get_thread_num()+1,omp_get_num_threads());
+#endif
+            
+      wgttmp = (double *) malloc(num_wts*nl[i]*sizeof(double));
+       
+      for ( m = 0; m < nl[i]; m++ )
+	for ( n = 0; n < num_wts; n++ )                      
+	  wgttmp[num_wts*m+n] = weights[num_wts*(add_srt[i]+m)+n];
+
+      sort_iter(nl[i], num_wts, add1s[i], add2s[i], wgttmp, who_am_i);
+
+      for ( m = 0; m < nl[i]; m++ )
+	for ( n = 0; n < num_wts; n++ )
+	  weights[num_wts*(add_srt[i]+m)+n] = wgttmp[num_wts*m+n];
+
+      free(wgttmp);
+    }
+
+  /* ********************************* */
+  /*              TO DO                */
+  /* THIS BIT NEEDS TO BE PARALLELIZED */
+  /* ********************************* */
+  /* Idea I: one CPU merges top-down, the other one bottom-up */
+                                                              /* ********************** */
+  merge_lists(nl,add1s[0],add2s[0],add1s[1],add2s[1], idx);   /* MERGE THE SEGMENTS     */
+                                                              /* ********************** */
+  tmp = (int *) malloc(num_links*sizeof(int));
+  
+#if defined (_OPENMP)
+#pragma omp parallel for if ( depth < par_depth ) private(i) num_threads(2)
+#endif
+  for ( i = 0; i < num_links; i++ )
+    tmp[i] = add1[idx[i]];
+  
+#if defined (_OPENMP)
+#pragma omp parallel for if ( depth < par_depth ) private(i) num_threads(2)
+#endif
+  for ( i = 0; i < num_links; i++ )
+    {
+      add1[i] = tmp[i];
+      tmp[i] = add2[idx[i]];
+    }
+  
+#if defined (_OPENMP)
+#pragma omp parallel for if ( depth < par_depth ) private(i) num_threads(2)
+#endif
+  for ( i = 0; i < num_links; i++ )
+    add2[i] = tmp[i];
+  
+  free(tmp);
+  tmp = NULL;
+  
+  tmp2 = (double *) malloc(num_links*num_wts*sizeof(double) );
+  
+#if defined (_OPENMP)
+#pragma omp parallel for if ( depth < par_depth ) private(i,n) num_threads(2)
+#endif
+  for ( i = 0; i < num_links; i++ )
+    for ( n = 0; n < num_wts; n++ )
+      tmp2[num_wts*i + n] = weights[num_wts*idx[i]+n];
+  
+#if defined (_OPENMP)
+#pragma omp parallel for if ( depth < par_depth ) private(i,n) num_threads(2)
+#endif
+  for ( i = 0; i < num_links; i++ )
+    for ( n = 0; n < num_wts; n++ )
+      weights[num_wts*i+n] = tmp2[num_wts*i+n];
+  
+  free(tmp2);
+  tmp2 = NULL;
+  
+  free(idx);
+}
+
+
+void sort_iter(long num_links, long num_wts, int *restrict add1, int *restrict add2, double *restrict weights, int parent)
+{
+  /*
+    This routine is an interface between the parallelized (merge-sort) 
+    and the sequential sorting algorithm for addresses implemented in
+    the library. 
+    It iterates 1 level into the binary tree if the single data chunks
+    to sort are larger than the maximum size prescribed. Otherwise, it
+    just sorts the chunk using the sort_add routine as implemented 
+    originally. 
+    Note, that even on a single CPU, the merge sort algorithm can be
+    considerably faster (up to about 30% for a reasonable chunk size)
+  */
+
+  /* Parameters as in sort_par 
+     additional parameters 
+     int mod;      (enum TPAR_MODE) determines wether tomake use of merge sort
+     int parent;   !!! CAUTION !!!
+                   + determines level and position of data chunk within 
+                     the original heap (level = log_2(who_am_i)) if sort_iter(...) has not
+		     been called before
+		   + determines number of threads to use on first call of sort_iter(...)
+  */
+  static int first_sort_iter_call = 1;
+  static int par_depth = 1;
+  static int nthreads = 1;
+
+  if ( first_sort_iter_call )
+    {
+      first_sort_iter_call = 0;
+      nthreads = parent;
+      par_depth = (int)(log(parent)/log(2));
+      parent = 1;
+    }
+
+  // fprintf(stdout, "parent %d par_depth %d num_links %ld\n", parent, par_depth, num_links);
+
+  if ( num_links > MERGE_SORT_LIMIT_SIZE && parent <= (nthreads-1) )
+    {
+      sort_par(num_links, num_wts, add1, add2, weights, parent, par_depth);
+      if ( cdoVerbose ) fprintf(stderr, "sort_iter: Finished iteration parent %i\n", parent);
+    }
+  else
+    {
+      // printf("sort_add: parent %d, par_depth %d num_links %ld\n", parent, par_depth, num_links);
+      sort_add(num_links, num_wts, add1, add2, weights);
+    }
+}
diff --git a/src/results_template_parser.c b/src/results_template_parser.c
new file mode 100644
index 0000000..c8872f0
--- /dev/null
+++ b/src/results_template_parser.c
@@ -0,0 +1,121 @@
+#include "template_parser.h"
+#include "magics_template_parser.h"
+#include "results_template_parser.h"
+
+#define DBG_MSG 0 
+
+
+/* extern int GetMagicsParameterInfo( const char *user_name, char **magics_name, char **magics_type ); */
+
+extern int GetMagicsParameterInfo(  char *user_name, xmlChar *param_value );
+
+extern xmlNode *results_node;
+
+
+/* Recursive function that sets the results parameters from the XML structure */
+
+int results_template_parser( xmlNode * a_node, const char *varname ) 
+
+{
+    xmlNode *cur_node = NULL;
+    xmlAttrPtr attr = NULL;
+    xmlChar    *param_name,*param_value,*value;
+    char       *param_type;
+
+	
+    if( a_node == NULL )
+	return 1;
+
+    if( !strcmp( a_node->name, "results" ) )
+    {
+ 	value = xmlGetProp( a_node, "version" );
+
+	if( value )
+	{
+    		if( DBG_MSG )
+			printf( "Version %s \n", value ); 
+
+		if( atof( value ) > 3.0f ) 
+		{
+			return 1;
+		}
+	}
+    }
+
+
+    for ( cur_node = a_node->children; cur_node; cur_node = cur_node->next )
+    {
+	param_name = NULL;
+	param_type = NULL;
+	param_value = NULL;
+
+        if ( cur_node->type == XML_ELEMENT_NODE )
+        {
+		
+	    if( DBG_MSG )
+            	printf( "Node Name: %s \n", cur_node->name );
+
+	    if( cur_node->properties == NULL )
+	    {
+		if( cur_node->children == NULL )
+		{
+			printf( "NO ATTRIBUTES!!!\n" );
+		}
+	    }
+	    else
+	    {
+		
+		/* 	Loop Over the attributes and get the corresponding
+                   	Magics Parameter name and type, set the value 
+		*/
+
+#if 0
+	      printf( "Finding varname = %s  result_name = %s\n", varname, xmlGetProp( cur_node,"name") );
+#endif
+
+	      if ( strcmp( varname, xmlGetProp( cur_node,"name" ) ) == 0 )
+	      {
+#if 0
+	          printf( "Found varname = %s  result_name = %s\n", varname, xmlGetProp( cur_node,"name") );
+#endif
+
+		  for( attr = cur_node->properties; attr; attr = attr->next )
+		  {	
+		      if( attr != NULL )
+		      {
+
+			  param_value = xmlNodeGetContent( attr->children );
+
+			  /* if( !GetMagicsParameterInfo( attr->name, &magics_param_name, &param_type ) ) */
+			  if( !GetMagicsParameterInfo( (char *) attr->name, param_value ) )
+			  {
+
+#if 0
+			      printf("Done corresponding Magics Parameter found!\n");
+			      printf("Setting corresponding Magics Parameter %s and type %s!\n",magics_param_name, param_type );
+	  		      fprintf(stderr, "param_value: %s\n", param_value);
+			      SetMagicsParameterValue( magics_param_name, param_type, param_value );
+#endif
+
+			  }
+			  else
+			  {
+#if 0
+			      printf("No corresponding Magics Parameter found!\n");
+#endif
+			  }
+		      }	
+		  }	
+
+		  break;
+	      }
+	      else
+	      {
+	   	  fprintf(stderr,"Var Name not matching resetting Magics Params!\n");
+		  /* Call the Reset functions of all the features to Reset the magics params to default */
+	      }
+	    }
+        }
+    }
+    return 0;
+}
diff --git a/src/results_template_parser.h b/src/results_template_parser.h
new file mode 100644
index 0000000..09eeb6a
--- /dev/null
+++ b/src/results_template_parser.h
@@ -0,0 +1,13 @@
+#ifndef RESULTS_TEMPLATE_PARSER_HH
+#define RESULTS_TEMPLATE_PARSER_HH
+
+#include<stdio.h>
+#include<string.h>
+#include<stdlib.h>
+
+#include<libxml/parser.h>
+#include<libxml/tree.h>
+
+ int results_template_parser( xmlNode * a_node, const char *varname ); 
+
+#endif
diff --git a/src/specspace.c b/src/specspace.c
new file mode 100644
index 0000000..be50f9e
--- /dev/null
+++ b/src/specspace.c
@@ -0,0 +1,689 @@
+#include <stdio.h>
+#include <math.h>
+#include <string.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#ifndef _DMEMORY_H
+#  include "dmemory.h"
+#endif
+
+#ifndef _ERROR_H
+#  include "error.h"
+#endif
+#include "specspace.h"
+
+
+#define  SQUARE_RADIUS   (-PlanetRadius * PlanetRadius)
+#define  C_EARTH_RADIUS  (6371000.0)
+double PlanetRadius = C_EARTH_RADIUS;
+
+
+void geninx(long ntr, double *f, double *g)
+{
+  long m2,n2;
+  long m, n ;
+
+  for ( m = 0; m <= ntr; m++ )
+    {
+      m2 = m * m;
+      for ( n = m; n <= ntr; n++ )
+	{
+	  n2 = n * n;
+	  if ( n )
+	    {
+	      *g++ = -PlanetRadius / n * sqrt((double)(n2-m2)/(double)(4*n2-1));
+	      *f++ = -PlanetRadius * m / (double)(n2+n);
+	    }
+	  else
+	    {
+	      *g++ = 0.0;
+	      *f++ = 0.0;
+	    }
+	}
+    }
+}
+
+
+void legini_old(int ntr, int nlat, double *poli, double *pold,
+		double *pol2, double *pol3, double *coslat, double *rcoslat, int flag)
+{
+  int waves, dimsp;
+  int jgl, jm, jn;
+  int jsp;
+  int pdim;
+  double *gmu, *gwt, *pnm;
+  double *hnm, gmusq, *ztemp1, *ztemp2;
+
+  waves =  ntr + 1;
+  dimsp = (ntr + 1) * (ntr + 2);
+  pdim  = dimsp / 2 * nlat;
+
+  gmu  = (double *) malloc(nlat * sizeof(double));
+  gwt  = (double *) malloc(nlat * sizeof(double));
+
+  gaussaw(gmu, gwt, nlat);
+
+#if ! defined (_OPENMP)
+  pnm    = (double *) malloc(dimsp * sizeof(double));
+  hnm    = (double *) malloc(dimsp * sizeof(double));
+  ztemp1 = (double *) malloc((waves<<1) * sizeof(double));
+  ztemp2 = (double *) malloc((waves<<1) * sizeof(double));
+#endif
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(jm, jn, jsp, gmusq, hnm, pnm, ztemp1, ztemp2)
+#endif
+  for ( jgl = 0; jgl < nlat; jgl++ )
+    {
+#if defined (_OPENMP)
+      pnm    = (double *) malloc(dimsp * sizeof(double));
+      hnm    = (double *) malloc(dimsp * sizeof(double));
+      ztemp1 = (double *) malloc((waves<<1) * sizeof(double));
+      ztemp2 = (double *) malloc((waves<<1) * sizeof(double));
+#endif
+      gmusq = 1.0 - gmu[jgl]*gmu[jgl];
+      coslat[jgl] =  sqrt(gmusq);
+      rcoslat[jgl] = 1.0 / coslat[jgl];
+
+      phcs(pnm, hnm, waves, gmu[jgl], ztemp1, ztemp2);
+
+      jsp = jgl;
+      for ( jm = 0; jm < waves; jm++ )
+	for ( jn = 0; jn < waves - jm; jn++ )
+	  {
+	              poli[jsp] = pnm[jm*waves+jn] * 2.0;
+	              pold[jsp] = pnm[jm*waves+jn] * gwt[jgl];
+	    if (flag) pol2[jsp] = hnm[jm*waves+jn] * gwt[jgl] /
+                                  (PlanetRadius    * gmusq);
+	    if (flag) pol3[jsp] = pnm[jm*waves+jn] * gwt[jgl] * jm /
+                                  (PlanetRadius    * gmusq);
+	    jsp += nlat;
+	  }
+#if defined (_OPENMP)
+      free(ztemp2);
+      free(ztemp1);
+      free(pnm);
+      free(hnm);
+#endif
+    }
+
+#if ! defined (_OPENMP)
+  free(ztemp2);
+  free(ztemp1);
+  free(pnm);
+  free(hnm);
+#endif
+  free(gwt);
+  free(gmu);
+}
+
+
+void legini(int ntr, int nlat, double *poli, double *pold, double *rcoslat)
+{
+  int waves, dimsp, dimpnm;
+  int jgl, jm, jn, is;
+  int isp, latn, lats;
+  double *gmu, *gwt, *pnm, *work;
+
+  waves  =  ntr + 1;
+  dimsp  = (ntr + 1)*(ntr + 2);
+  dimpnm = (ntr + 1)*(ntr + 4)/2;
+
+  gmu  = (double *) malloc(nlat * sizeof(double));
+  gwt  = (double *) malloc(nlat * sizeof(double));
+  pnm  = (double *) malloc(dimpnm * sizeof(double));
+  work = (double *) malloc(3*waves * sizeof(double));
+
+  gaussaw(gmu, gwt, nlat);
+  for ( jgl = 0; jgl < nlat; jgl++ ) gwt[jgl] *= 0.5;
+
+  for ( jgl = 0; jgl < nlat; jgl++ )
+    rcoslat[jgl] = 1.0 / sqrt(1.0 - gmu[jgl]*gmu[jgl]);
+
+  for ( jgl = 0; jgl < nlat/2; jgl++ )
+    {
+      jspleg1(pnm, gmu[jgl], ntr, work);
+
+      latn = jgl;
+      isp = 0;
+      for ( jm = 0; jm < waves; jm++ )
+	{
+#if defined (SX)
+#pragma vdir nodep
+#endif
+	  for ( jn = 0; jn < waves - jm; jn++ )
+	    {
+	      is = (jn+1)%2 * 2 - 1;
+	      lats = latn - jgl + nlat - jgl - 1;
+	      poli[latn] = pnm[isp];
+	      pold[latn] = pnm[isp] * gwt[jgl];
+	      poli[lats] = pnm[isp] * is;
+	      pold[lats] = pnm[isp] * gwt[jgl] * is;
+	      latn += nlat;
+	      isp++;
+	    }
+	  isp++;
+	}
+    }
+
+  free(work);
+  free(pnm);
+  free(gwt);
+  free(gmu);
+}
+
+
+void grid2spec(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut)
+{
+  int ntr, nlat, nlon, nfc;
+  int nlev = 1;
+  int waves;
+  double *fpwork;
+    
+  ntr  = gridInqTrunc(gridIDout);
+  nlon = gridInqXsize(gridIDin);
+  nlat = gridInqYsize(gridIDin);
+
+  waves = ntr + 1;
+  nfc   = waves * 2;
+
+  fpwork = (double *) malloc(nlat*nfc*nlev*sizeof(double));
+
+  gp2fc(sptrans->trig, sptrans->ifax, arrayIn, fpwork, nlat, nlon, nlev, nfc);
+  fc2sp(fpwork, arrayOut, sptrans->pold, nlev, nlat, nfc, ntr);
+
+  free(fpwork);
+}
+	   
+   
+void spec2grid(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut)
+{
+  int ntr, nlat, nlon, nfc;
+  int nlev = 1;
+  int waves;
+  double *fpwork;
+    
+  ntr  = gridInqTrunc(gridIDin);
+  nlon = gridInqXsize(gridIDout);
+  nlat = gridInqYsize(gridIDout);
+
+  waves = ntr + 1;
+  nfc   = waves * 2;
+
+  fpwork = (double *) malloc(nlat*nfc*nlev*sizeof(double));
+
+  sp2fc(arrayIn, fpwork, sptrans->poli, nlev, nlat, nfc, ntr);
+  fc2gp(sptrans->trig, sptrans->ifax, fpwork, arrayOut, nlat, nlon, nlev, nfc);
+
+  free(fpwork);
+}
+
+
+void four2spec(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut)
+{
+  int ntr, nlat, nfc;
+  int nlev = 1;
+  int waves;
+    
+  ntr  = gridInqTrunc(gridIDout);
+  nlat = sptrans->nlat;
+
+  waves = ntr + 1;
+  nfc   = waves * 2;
+
+  fc2sp(arrayIn, arrayOut, sptrans->pold, nlev, nlat, nfc, ntr);
+}
+
+
+void spec2four(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut)
+{
+  int ntr, nlat, nfc;
+  int nlev = 1;
+  int waves;
+    
+  ntr  = gridInqTrunc(gridIDin);
+  nfc  = gridInqSize(gridIDout);
+  nlat = nfc2nlat(nfc, ntr);
+
+  waves = ntr + 1;
+  nfc   = waves * 2;
+
+  sp2fc(arrayIn, arrayOut, sptrans->poli, nlev, nlat, nfc, ntr);
+}
+
+
+void four2grid(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut)
+{
+  int ntr, nlat, nlon, nfc;
+  int nlev = 1;
+  int waves;
+
+  ntr  = gridInqTrunc(gridIDin);
+  nlon = gridInqXsize(gridIDout);
+  nlat = gridInqYsize(gridIDout);
+
+  waves = ntr + 1;
+  nfc   = waves * 2;
+
+  fc2gp(sptrans->trig, sptrans->ifax, arrayIn, arrayOut, nlat, nlon, nlev, nfc);
+}
+
+
+void grid2four(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut)
+{
+  int nlat, nlon, nfc, ntr;
+  int nlev = 1;
+  int waves;
+
+  ntr  = gridInqTrunc(gridIDout);
+  nlon = gridInqXsize(gridIDin);
+  nlat = gridInqYsize(gridIDin);
+
+  waves = ntr + 1;
+  nfc   = waves * 2;
+
+  gp2fc(sptrans->trig, sptrans->ifax, arrayIn, arrayOut, nlat, nlon, nlev, nfc);
+}
+
+
+void spec2spec(int gridIDin, double *arrayIn, int gridIDout, double *arrayOut)
+{
+  int ntrIn, ntrOut;
+
+  ntrIn  = gridInqTrunc(gridIDin);
+  ntrOut = gridInqTrunc(gridIDout);
+
+  sp2sp(arrayIn, ntrIn, arrayOut, ntrOut);
+}
+
+
+void speccut(int gridIDin, double *arrayIn, double *arrayOut, int *waves)
+{
+  int ntr;
+
+  ntr = gridInqTrunc(gridIDin);
+
+  spcut(arrayIn, arrayOut, ntr, waves);
+}
+
+
+SPTRANS *sptrans_new(int nlon, int nlat, int ntr, int flag)
+{
+  SPTRANS *sptrans;
+  int nsp;
+
+  sptrans = (SPTRANS *) malloc(sizeof(SPTRANS));
+
+  sptrans->nlon = nlon;
+  sptrans->nlat = nlat;
+  sptrans->ntr  = ntr;
+
+  nsp = (ntr + 1)*(ntr + 2);
+  sptrans->poldim = nsp / 2 * nlat;
+
+  sptrans->trig = (double *) malloc(nlon * sizeof(double));
+  fft_set(sptrans->trig, sptrans->ifax, nlon);
+
+  sptrans->poli = (double *) malloc(sptrans->poldim * sizeof(double));
+  sptrans->pold = (double *) malloc(sptrans->poldim * sizeof(double));
+  if ( flag )
+    {
+      sptrans->pol2 = (double *) malloc(sptrans->poldim * sizeof(double));
+      sptrans->pol3 = (double *) malloc(sptrans->poldim * sizeof(double));
+    }
+  else
+    {
+      sptrans->pol2 = NULL;
+      sptrans->pol3 = NULL;
+    }
+
+  sptrans->coslat  = (double *) malloc(nlat * sizeof(double));
+  sptrans->rcoslat = (double *) malloc(nlat * sizeof(double));
+
+  if ( flag )
+    legini_old(ntr, nlat, sptrans->poli, sptrans->pold,
+	       sptrans->pol2, sptrans->pol3, sptrans->coslat, sptrans->rcoslat, flag);
+  else
+    legini(ntr, nlat, sptrans->poli, sptrans->pold, sptrans->rcoslat);
+
+  return (sptrans);
+}
+
+
+void sptrans_delete(SPTRANS *sptrans)
+{
+  if ( sptrans )
+    {
+      if ( sptrans->trig ) { free(sptrans->trig);  sptrans->trig = NULL; }
+      if ( sptrans->poli ) { free(sptrans->poli);  sptrans->poli = NULL; }
+      if ( sptrans->pold ) { free(sptrans->pold);  sptrans->pold = NULL; }
+      if ( sptrans->pol2 ) { free(sptrans->pol2);  sptrans->pol2 = NULL; }
+      if ( sptrans->pol3 ) { free(sptrans->pol3);  sptrans->pol3 = NULL; }
+      if ( sptrans->coslat  ) { free(sptrans->coslat);   sptrans->coslat = NULL; }
+      if ( sptrans->rcoslat ) { free(sptrans->rcoslat);  sptrans->rcoslat = NULL; }
+
+      free(sptrans); sptrans = NULL;
+    }
+}
+
+
+DVTRANS *dvtrans_new(int ntr)
+{
+  DVTRANS *dvtrans;
+  int dimsp;
+
+  dvtrans = (DVTRANS *) malloc(sizeof(DVTRANS));
+
+  dvtrans->ntr = ntr;
+
+  dimsp = (ntr + 1)*(ntr + 2);
+  dvtrans->fdim = dimsp / 2;
+
+  dvtrans->f1 = (double *) malloc(dvtrans->fdim * sizeof(double));
+  dvtrans->f2 = (double *) malloc(dvtrans->fdim * sizeof(double));
+
+  geninx(ntr, dvtrans->f1, dvtrans->f2);
+
+  return (dvtrans);
+}
+
+
+void dvtrans_delete(DVTRANS *dvtrans)
+{
+  if ( dvtrans )
+    {
+      if ( dvtrans->f1 ) { free(dvtrans->f1);  dvtrans->f1 = NULL; }
+      if ( dvtrans->f2 ) { free(dvtrans->f2);  dvtrans->f2 = NULL; }
+
+      free(dvtrans); dvtrans = NULL;
+    }
+}
+
+
+void uv2dv(double *fu, double *fv, double *sd, double *sv,
+           double *pol2, double *pol3, int klev, int nlat, int nt)
+{
+  int lev, jmm, jfc, lat, nfc, nsp2;
+  double dir, dii, vor, voi;
+  double *ufr, *ufi, *vfr, *vfi;
+  double *ful, *fvl, *sdl, *svl;
+  double *po2, *po3;
+
+  nsp2 = (nt+1)*(nt+2);
+  nfc  = (nt+1)*2;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(jmm, jfc, lat, po2, po3, ful, fvl, sdl, svl, ufr, ufi, vfr, vfi, dir, dii, vor, voi)
+#endif
+  for ( lev = 0; lev < klev; lev++ )
+    {
+      po2 = pol2;
+      po3 = pol3;
+      ful = fu + lev*nfc*nlat;
+      fvl = fv + lev*nfc*nlat;
+      sdl = sd + lev*nsp2;
+      svl = sv + lev*nsp2;
+      for ( jmm = 0; jmm <= nt; jmm++ )
+	{
+	  for  ( jfc = jmm; jfc <= nt; jfc++ )
+	    {
+	      ufr = ful;
+	      ufi = ful + nlat;
+	      vfr = fvl;
+	      vfi = fvl + nlat;
+	      dir = 0.0;
+	      dii = 0.0;
+	      vor = 0.0;
+	      voi = 0.0;
+	      for ( lat = 0; lat < nlat; lat++ )
+		{
+		  dir += vfr[lat] * po2[lat] - ufi[lat] * po3[lat];
+		  dii += vfi[lat] * po2[lat] + ufr[lat] * po3[lat];
+		  vor -= ufr[lat] * po2[lat] + vfi[lat] * po3[lat];
+		  voi -= ufi[lat] * po2[lat] - vfr[lat] * po3[lat];
+		}
+	      *sdl++ = dir;
+	      *sdl++ = dii;
+	      *svl++ = vor;
+	      *svl++ = voi;
+	      po2 += nlat;
+	      po3 += nlat;
+	    }
+	  ful += 2 * nlat;
+	  fvl += 2 * nlat;
+	}
+    }
+}
+
+
+void dv2uv(double *d, double *o, double *u, double *v, double *f, double *g,
+	   int nt, int nsp, int nlev)
+{
+  /* d(nsp,nlev), o(nsp,nlev)     ! divergence, vorticity        */
+  /* u(nsp,nlev), v(nsp,nlev)     ! zonal wind, meridional wind  */
+  /* f(nsp/2)   , g(nsp/2)        ! factor tables                */
+
+  int l, m, n;
+  int i;
+
+  for ( l = 0; l < nlev; l++ )
+    {
+      i = 0;
+
+      for ( m = 0; m < nt-1; m++ )
+	{
+	  /*********/
+	  /* n = m */
+	  /*********/
+
+	  if ( m == 0 )
+	    {
+	      *u++ = -g[i+1] * o[2*(i+1)  ];
+	      *u++ = -g[i+1] * o[2*(i+1)+1];
+	      *v++ =  g[i+1] * d[2*(i+1)  ];
+	      *v++ =  g[i+1] * d[2*(i+1)+1];
+	    }
+	  else
+	    {
+	      *u++ = -f[i] * d[2*i+1] - g[i+1] * o[2*(i+1)  ];
+	      *u++ =  f[i] * d[2*i  ] - g[i+1] * o[2*(i+1)+1];
+	      *v++ = -f[i] * o[2*i+1] + g[i+1] * d[2*(i+1)  ];
+	      *v++ =  f[i] * o[2*i  ] + g[i+1] * d[2*(i+1)+1];
+	    }
+	  ++i;
+
+	  /****************/
+	  /* m < n < nt-1 */
+	  /****************/
+
+	  for ( n = m+1; n < nt-1; n++ )
+	    {
+	      *u++ =  g[i] * o[2*(i-1)  ] - f[i] * d[2*i+1] - g[i+1] * o[2*(i+1)  ];
+	      *u++ =  g[i] * o[2*(i-1)+1] + f[i] * d[2*i  ] - g[i+1] * o[2*(i+1)+1];
+	      *v++ = -g[i] * d[2*(i-1)  ] - f[i] * o[2*i+1] + g[i+1] * d[2*(i+1)  ];
+	      *v++ = -g[i] * d[2*(i-1)+1] + f[i] * o[2*i  ] + g[i+1] * d[2*(i+1)+1];
+	      ++i;
+	    }
+
+	  /************/
+	  /* n = nt-1 */
+	  /************/
+
+	  *u++ =  g[i] * o[2*(i-1)  ] - f[i] * d[2*i+1];
+	  *u++ =  g[i] * o[2*(i-1)+1] + f[i] * d[2*i  ];
+	  *v++ = -g[i] * d[2*(i-1)  ] - f[i] * o[2*i+1];
+	  *v++ = -g[i] * d[2*(i-1)+1] + f[i] * o[2*i  ];
+	  ++i;
+
+	  /**********/
+	  /* n = nt */
+	  /**********/
+
+	  *u++ =  g[i] * o[2*(i-1)  ];
+	  *u++ =  g[i] * o[2*(i-1)+1];
+	  *v++ = -g[i] * d[2*(i-1)  ];
+	  *v++ = -g[i] * d[2*(i-1)+1];
+	  ++i;
+	}
+
+      /***************************/
+      /* m = nt-1  and  n = nt-1 */
+      /***************************/
+
+      *u++ = -f[i] * d[2*i+1];
+      *u++ =  f[i] * d[2*i  ];
+      *v++ = -f[i] * o[2*i+1];
+      *v++ =  f[i] * o[2*i  ];
+      ++i;
+
+      /*************************/
+      /* m = nt-1  and  n = nt */
+      /*************************/
+
+      *u++ =  g[i] * o[2*(i-1)  ];
+      *u++ =  g[i] * o[2*(i-1)+1];
+      *v++ = -g[i] * d[2*(i-1)  ];
+      *v++ = -g[i] * d[2*(i-1)+1];
+      ++i;
+
+      /***********************/
+      /* m = nt  and  n = nt */
+      /***********************/
+
+      *u++ = 0.0;
+      *u++ = 0.0;
+      *v++ = 0.0;
+      *v++ = 0.0;
+
+      d += nsp;
+      o += nsp;
+    }
+}
+
+
+void dv2ps(const double * restrict div, double * restrict pot, long nlev, long ntr)
+{
+  long l, m, n;
+  double fact;
+
+  for ( l = 0; l <  nlev; l++ )
+    {
+      /* m == 0 */
+      *pot++ = 0.0;
+      *pot++ = 0.0;
+      div += 2;
+
+      for ( n = 1; n <= ntr; n++ )
+	{
+	  fact = SQUARE_RADIUS / (n*n + n);
+	  *pot++ = *div++ * fact;
+	  *pot++ = *div++ * fact;
+	}
+
+      /* m >= 0 */
+      for ( m = 1; m <= ntr; m++ )
+	for ( n = m; n <= ntr; n++ )
+	  {
+	    fact = SQUARE_RADIUS / (n*n + n);
+	    *pot++ = *div++ * fact;
+	    *pot++ = *div++ * fact;
+	  }
+    }
+}
+
+
+void scaluv(double *fu, double *rclat, int nlat, int lot)
+{
+  int l,lat;
+
+  for (l = 0; l < lot; l++)
+    for (lat = 0; lat < nlat; lat++)
+      {
+        *fu *= rclat[lat];
+        fu++;
+      }
+}
+
+
+void trans_uv2dv(SPTRANS *sptrans, int nlev,
+		 int gridID1, double *gu, double *gv,
+		 int gridID2, double *sd, double *svo)
+{
+  int ntr, nlat, nlon, nfc;
+  int waves;
+  double *fpwork1, *fpwork2;
+
+  if ( gridInqType(gridID1) != GRID_GAUSSIAN )
+    Warning("unexpected grid1 type: %s", gridNamePtr(gridInqType(gridID1)));
+
+  if ( gridInqType(gridID2) != GRID_SPECTRAL )
+    Warning("unexpected grid2 type: %s", gridNamePtr(gridInqType(gridID2)));
+    
+  ntr  = gridInqTrunc(gridID2);
+  nlon = gridInqXsize(gridID1);
+  nlat = gridInqYsize(gridID1);
+
+  waves = ntr + 1;
+  nfc   = waves * 2;
+
+  fpwork1 = (double *) malloc(nlat*nfc*nlev*sizeof(double));
+  fpwork2 = (double *) malloc(nlat*nfc*nlev*sizeof(double));
+
+  gp2fc(sptrans->trig, sptrans->ifax, gu, fpwork1, nlat, nlon, nlev, nfc);
+  gp2fc(sptrans->trig, sptrans->ifax, gv, fpwork2, nlat, nlon, nlev, nfc);
+
+  scaluv(fpwork1, sptrans->coslat, nlat, nfc*nlev);
+  scaluv(fpwork2, sptrans->coslat, nlat, nfc*nlev);
+
+  uv2dv(fpwork1, fpwork2, sd, svo, sptrans->pol2, sptrans->pol3, nlev, nlat, ntr);
+
+  free(fpwork1);
+  free(fpwork2);
+}
+
+
+void trans_dv2uv(SPTRANS *sptrans, DVTRANS *dvtrans, int nlev,
+		 int gridID1, double *sd, double *svo,
+		 int gridID2, double *gu, double *gv)
+{
+  int ntr, nlat, nlon, nfc;
+  int waves;
+  int dimsp;
+  double *fpwork;
+  double *su, *sv;
+
+  if ( gridInqType(gridID1) != GRID_SPECTRAL )
+    Warning("unexpected grid1 type: %s", gridNamePtr(gridInqType(gridID1)));
+
+  if ( gridInqType(gridID2) != GRID_GAUSSIAN )
+    Warning("unexpected grid2 type: %s", gridNamePtr(gridInqType(gridID2)));
+
+  ntr  = gridInqTrunc(gridID1);
+  nlon = gridInqXsize(gridID2);
+  nlat = gridInqYsize(gridID2);
+
+  waves = ntr + 1;
+  nfc   = waves * 2;
+
+  dimsp = (ntr + 1)*(ntr + 2);
+
+  su = gu;
+  sv = gv;
+
+  dv2uv(sd, svo, su, sv, dvtrans->f1, dvtrans->f2, ntr, dimsp, nlev);
+
+  fpwork = (double *) malloc(nlat*nfc*nlev*sizeof(double));
+
+  sp2fc(su, fpwork, sptrans->poli, nlev, nlat, nfc, ntr);
+  scaluv(fpwork, sptrans->rcoslat, nlat, nfc*nlev);
+  fc2gp(sptrans->trig, sptrans->ifax, fpwork, gu, nlat, nlon, nlev, nfc);
+
+  sp2fc(sv, fpwork, sptrans->poli, nlev, nlat, nfc, ntr);
+  scaluv(fpwork, sptrans->rcoslat, nlat, nfc*nlev);
+  fc2gp(sptrans->trig, sptrans->ifax, fpwork, gv, nlat, nlon, nlev, nfc);
+
+  free(fpwork);
+}
+
diff --git a/src/specspace.h b/src/specspace.h
new file mode 100644
index 0000000..249da57
--- /dev/null
+++ b/src/specspace.h
@@ -0,0 +1,65 @@
+
+typedef struct {
+  long nlon;
+  long nlat;
+  long ntr;
+  long poldim;
+  long ifax[10];
+  double *trig;
+  double *poli;
+  double *pold;
+  double *pol2;    /* only for uv2dv  */
+  double *pol3;    /* only for uv2dv  */
+  double *coslat;  /* only for scaluv with uv2dv */
+  double *rcoslat; /* only for scaluv with dv2uv */
+}
+SPTRANS;
+
+typedef struct {
+  int ntr;
+  int fdim;
+  double *f1;
+  double *f2;
+}
+DVTRANS;
+
+void dv2ps(const double * restrict div, double * restrict pot, long nlev, long ntr);
+
+SPTRANS *sptrans_new(int nlon, int nlat, int ntr, int flag);
+void sptrans_delete(SPTRANS *sptrans);
+
+DVTRANS *dvtrans_new(int ntr);
+void dvtrans_delete(DVTRANS *dvtrans);
+
+void trans_uv2dv(SPTRANS *sptrans, int nlev,
+		 int gridID1, double *gu, double *gv,
+		 int gridID2, double *sd, double *svo);
+
+void trans_dv2uv(SPTRANS *sptrans, DVTRANS *dvtrans, int nlev,
+		 int gridID1, double *sd, double *svo,
+		 int gridID2, double *gu, double *gv);
+
+void grid2spec(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut);
+void spec2grid(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut);
+void four2spec(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut);
+void spec2four(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut);
+void four2grid(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut);
+void grid2four(SPTRANS *sptrans, int gridIDin, double *arrayIn, int gridIDout, double *arrayOut);
+
+void spec2spec(int gridIDin, double *arrayIn, int gridIDout, double *arrayOut);
+void speccut(int gridIDin, double *arrayIn, double *arrayOut, int *waves);
+
+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 nlev, int nlat, int nfc, int nt);
+
+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);
+
+void sp2sp(double *arrayIn, int ntrIn, double *arrayOut, int ntrOut);
+void spcut(double *arrayIn, double *arrayOut, int ntr, int *waves);
+
+void phcs(double *pnm, double *hnm, int waves, double pmu,
+	  double *ztemp1, double *ztemp2);
+void jspleg1(double *pleg, double plat, int ntr, double *work);
+
+void fft_set(double *trigs, long *ifax, long n);
diff --git a/src/statistic.c b/src/statistic.c
new file mode 100644
index 0000000..038cfac
--- /dev/null
+++ b/src/statistic.c
@@ -0,0 +1,1495 @@
+/* This source code is copied from PINGO version 1.5 */
+
+/* ********************************** */
+/* HEADER FOR PARALLEL EIGEN SOLUTION */
+/*  -->SEE END OF ROUTINE             */
+/* ********************************** */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <time.h>
+
+#define PI_QU 1*atan(1)
+#define PI_HA 2*atan(1)
+#define PI    4*atan(1)
+#define FNORM_PRECISION 1e-12
+#define MAX_JACOBI_ITER 12
+
+int jacobi_1side(double **M, double *A, long n);
+void annihilate_1side(double **M, long i, long j, long k, long n);
+
+int n_finished;
+
+// global variables to handle environment settings 
+double fnorm_precision;
+int max_jacobi_iter;
+
+/* **************************************** */
+/* ENDOF HEADER FOR PARALLEL EIGEN SOLUTION */
+/*  -->SEE END OF ROUTINE                   */
+/* **************************************** */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <float.h>
+#include <math.h>
+
+#include "cdo.h"
+#include "cdo_int.h"
+#include "statistic.h"
+
+#ifndef  M_2_SQRTPI
+# define M_2_SQRTPI	1.12837916709551257390	/* 2/sqrt(pi) */
+#endif
+#ifndef  M_SQRT2
+# define M_SQRT2	1.41421356237309504880	/* sqrt(2) */
+#endif
+
+
+void make_symmetric_matrix_triangular (double **a, int n,
+                                       double *d, double *e, const char *prompt);
+double pythagoras (double a, double b);
+void eigen_solution_of_triangular_matrix (double *d, double *e, int n,
+                                          double **a, int n_eig, const char *prompt);
+int lu_decomposition (double **a, int n, int *index, int *sign);
+void lu_backsubstitution (double **a, int n, int *index, double *b);
+
+// moved to statistic.h to make heap_sort accessible for other modules
+// void heap_sort (double *eig_val, double **a, int n);
+
+static double gamma_help_1 (double a, double x, const char *prompt);
+static double gamma_help_2 (double a, double x, const char *prompt);
+static double beta_help (double a, double b, double x, const char *prompt);
+
+
+void eigen_solution_of_symmetric_matrix (double **a, double *eig_val,
+					 int n, int n_eig, const char *prompt)
+/* After return the rows (!!!) of a are the eigenvectors */
+{
+  double *e;
+  int i, j;
+  double temp;
+  
+  e = (double *) malloc (n * sizeof (double));
+  
+  make_symmetric_matrix_triangular (a, n, eig_val, e, prompt);
+  
+  eigen_solution_of_triangular_matrix (eig_val, e, n, a, n_eig, prompt);
+  
+  free (e);
+
+  for (i = 0; i < n; i++)
+    for (j = i + 1; j < n; j++)
+      {
+        temp = a[i][j];
+        a[i][j] = a[j][i];
+        a[j][i] = temp;
+      }
+  heap_sort (eig_val, a, n);
+}
+
+
+void heap_sort (double *eig_val, double **a, int n)
+{
+  int i, j, j_next, k1, k2;
+  double temp;
+  double *temp_p;
+  
+  /* First part of heap sort: */
+  for (i = n / 2 - 1; i >= 0; i--)
+    {
+      for (j = i; 2 * j + 1 < n; j = j_next)
+        {
+          k1 = 2 * j + 1;
+          k2 = 2 * j + 2;
+          j_next = j;
+          if (eig_val[k1] < eig_val[j_next])
+            j_next = k1;
+          if (k2 < n && eig_val[k2] < eig_val[j_next])
+            j_next = k2;
+          if (j == j_next)
+            break;
+          temp = eig_val[j_next];
+          eig_val[j_next] = eig_val[j];
+          eig_val[j] = temp;
+          temp_p = a[j_next];
+          a[j_next] = a[j];
+          a[j] = temp_p;
+        }
+    }
+  /* Second part of head sort: */
+  for (i = n - 1; i > 0; i--)
+    {
+      temp = eig_val[i];
+      eig_val[i] = eig_val[0];
+      eig_val[0] = temp;
+      temp_p = a[i];
+      a[i] = a[0];
+      a[0] = temp_p;
+      for (j = 0; 2 * j + 1 < i; j = j_next)
+        {
+          k1 = 2 * j + 1;
+          k2 = 2 * j + 2;
+          j_next = j;
+          if (eig_val[k1] < eig_val[j_next])
+            j_next = k1;
+          if (k2 < i && eig_val[k2] < eig_val[j_next])
+            j_next = k2;
+          if (j == j_next)
+            break;
+          temp = eig_val[j_next];
+          eig_val[j_next] = eig_val[j];
+          eig_val[j] = temp;
+          temp_p = a[j_next];
+          a[j_next] = a[j];
+          a[j] = temp_p;
+        }
+    }
+}
+
+
+void make_symmetric_matrix_triangular (double **a, int n,
+				       double *d, double *e, const char *prompt)
+{
+  int i, j, k;
+  double f, g, h, hh, scale;
+  
+  for (i = n - 1; i >= 1; i--)
+    {
+      h = scale = 0;
+      if (i > 1)
+        {
+          for (k = 0; k < i; k++)
+            scale += fabs (a[i][k]);
+          if ( DBL_IS_EQUAL(scale, 0.) )
+            e[i] = a[i][i - 1];
+          else
+            {
+              for (k = 0; k < i; k++)
+                {
+                  a[i][k] /= scale;
+                  h += a[i][k] * a[i][k];
+                }
+              f = a[i][i - 1];
+              g = f >= 0 ? -sqrt (h) : sqrt (h);
+              e[i] = scale * g;
+              h -= f * g;
+              a[i][i - 1] = f - g;
+              f = 0;
+              for (j = 0; j < i; j++)
+                {
+                  a[j][i] = a[i][j] / h;
+                  g = 0;
+                  for (k = 0; k <= j; k++)
+                    g += a[j][k] * a[i][k];
+                  for (k = j + 1; k < i; k++)
+                    g += a[k][j] * a[i][k];
+                  e[j] = g / h;
+                  f += e[j] * a[i][j];
+                }
+              hh = f / (2 * h);
+              for (j = 0; j < i; j++)
+                {
+                  f = a[i][j];
+                  e[j] = g = e[j] - hh * f;
+                  for (k = 0; k <= j; k++)
+                    a[j][k] -= f * e[k] + g * a[i][k];
+                }
+            }
+        }
+      else
+        e[i] = a[i][i - 1];
+      d[i] = h;
+      /*
+       if (user_asked)
+       {
+       lock ();
+       fprintf (stderr,
+		   "%s: Status: Computing eigen solution pass 1 of 3"
+		   " cycle %ld of %ld.\n",
+		   prompt, (long) (n - i), (long) (n - 1));
+       fflush (stderr);
+       unlock ();
+       user_asked = FALSE;
+       }
+       */
+    }
+  
+  d[0] = e[0] = 0;
+  for (i = 0; i < n; i++)
+    {
+      if ( fabs(d[i]) > 0 )
+        {
+          for (j = 0; j < i; j++)
+            {
+              g = 0;
+              for (k = 0; k < i; k++)
+                g += a[i][k] * a[k][j];
+              for (k = 0; k < i; k++)
+                a[k][j] -= g * a[k][i];
+            }
+        }
+      d[i] = a[i][i];
+      a[i][i] = 1;
+      for (j = 0; j < i; j++)
+        a[j][i] = a[i][j] = 0;
+      /*
+       if (user_asked)
+       {
+       lock ();
+       fprintf (stderr,
+		   "%s: Status: Computing eigen solution pass 2 of 3"
+		   " cycle %ld of %ld.\n", prompt, (long) (i + 1), (long) n);
+       fflush (stderr);
+       unlock ();
+       user_asked = FALSE;
+       }
+       */
+    }
+}
+
+
+double pythagoras (double a, double b)
+{
+  double abs_a, abs_b, sqr;
+  abs_a = fabs (a);
+  abs_b = fabs (b);
+  if (abs_a > abs_b)
+    {
+      sqr = abs_b / abs_a;
+      sqr *= sqr;
+      return abs_a * sqrt (1 + sqr);
+    }
+  else if (abs_b > abs_a)
+    {
+      sqr = abs_a / abs_b;
+      sqr *= sqr;
+      return abs_b * sqrt (1 + sqr);
+    }
+  else
+    return M_SQRT2 * abs_a;
+}
+
+#define MAX_ITER 1000
+
+void eigen_solution_of_triangular_matrix (double *d, double *e, int n,
+					  double **a, int n_eig, const char *prompt)
+{
+  int i, k, l, m, iter;
+  double b, c, f, g, p, r, s;
+  static const double eps = 1e-6;
+  
+  for (i = 1; i < n; i++)
+    e[i - 1] = e[i];
+  
+  e[n - 1] = 0;
+  for (l = 0; l < n_eig; l++)
+    {
+      iter = 0;
+      while (1)
+        {
+          for (m = l; m < n - 1; m++)
+            if (fabs (e[m]) <= eps * (fabs (d[m]) + fabs (d[m + 1])))
+              break;
+          if (m == l)
+            {
+	      // printf("found solution after %i Iteration\n", iter++);
+              break;
+            }
+          iter++;
+          if (iter == MAX_ITER)
+            {
+              fprintf (stderr, "%s: ERROR! Too many iterations while"
+                       " determining the eigensolution!\n", prompt);
+              exit (1);
+            }
+          g = (d[l + 1] - d[l]) / (2 * e[l]);
+          r = pythagoras (g, 1);
+          g = d[m] - d[l] + e[l] / (g + (fabs(g) > 0 ? (g >= 0 ? fabs (r) : -fabs (r)) : r));
+          s = c = 1;
+          p = 0;
+          for (i = m - 1; i >= l; i--)
+            {
+              f = s * e[i];
+              b = c * e[i];
+              e[i + 1] = r = pythagoras (f, g);
+              
+              if ( DBL_IS_EQUAL(r, 0.) )
+                {
+                  d[i + 1] -= p;
+                  e[m] = 0;
+                  break;
+                }
+              
+              s = f / r;
+              c = g / r;
+              g = d[i + 1] - p;
+              r = (d[i] - g) * s + 2 * c * b;
+              p = s * r;
+              d[i + 1] = g + p;
+              g = c * r - b;
+              for (k = 0; k < n; k++)
+                {
+                  f = a[k][i + 1];
+                  a[k][i + 1] = s * a[k][i] + c * f;
+                  a[k][i] = c * a[k][i] - s * f;
+                }
+            }
+          
+          if ( DBL_IS_EQUAL(r, 0.) && i >= l ) continue;
+          
+          d[l] -= p;
+          e[l] = g;
+          e[m] = 0;
+        }
+      /*
+       if (user_asked)
+       {
+       lock ();
+       fprintf (stderr,
+		   "%s: Status: Computing eigen solution pass 3 of 3"
+		   " cycle %ld of %ld.\n", prompt, (long) (l + 1), (long) n);
+       fflush (stderr);
+       unlock ();
+       user_asked = FALSE;
+       }
+       */
+    }
+}
+
+
+int solution_of_linear_equation (double **a, double *b, int n)
+{
+  int *index;
+  int sign;
+  int not_singular;
+  
+  index = (int *) malloc (n * sizeof (int));
+  
+  not_singular = lu_decomposition (a, n, index, &sign);
+  
+  if (not_singular)
+    lu_backsubstitution (a, n, index, b);
+  
+  free (index);
+  
+  return not_singular;
+}
+
+
+int inverse_of_matrix (double **a, double **b, int n)
+{
+  int *index;
+  int sign;
+  int i, j;
+  int not_singular;
+  double *col;
+  
+  index = (int *) malloc (n * sizeof (int));
+  col = (double *) malloc (n * sizeof (double));
+  
+  not_singular = lu_decomposition (a, n, index, &sign);
+  
+  if (not_singular)
+    {
+      for (i = 0; i < n; i++)
+        {
+          for (j = 0; j < n; j++)
+            col[j] = 0;
+          col[i] = 1;
+          lu_backsubstitution (a, n, index, col);
+          for (j = 0; j < n; j++)
+            b[j][i] = col[j];
+        }
+    }
+  
+  free (index);
+  free (col);
+
+  return not_singular;
+}
+
+
+int lu_decomposition (double **a, int n, int *index, int *sign)
+{
+  int i, imax = 0, j, k;
+  double big, sum, temp;
+  double *v;
+  
+  v = (double *) malloc (n * sizeof (double));
+  *sign = 1;
+  for (i = 0; i < n; i++)
+    {
+      big = 0;
+      for (j = 0; j < n; j++)
+        if ((temp = fabs (a[i][j])) > big)
+          big = temp;
+      
+      if ( DBL_IS_EQUAL(big, 0.) ) return 0;
+      
+      v[i] = 1 / big;
+    }
+  for (j = 0; j < n; j++)
+    {
+      for (i = 0; i < j; i++)
+        {
+          sum = a[i][j];
+          for (k = 0; k < i; k++)
+            sum -= a[i][k] * a[k][j];
+          a[i][j] = sum;
+        }
+      big = 0;
+      for (i = j; i < n; i++)
+        {
+          sum = a[i][j];
+          for (k = 0; k < j; k++)
+            sum -= a[i][k] * a[k][j];
+          a[i][j] = sum;
+          if ((temp = v[i] * fabs (sum)) >= big)
+            {
+              big = temp;
+              imax = i;
+            }
+        }
+      if (j != imax)
+        {
+          for (k = 0; k < n; k++)
+            {
+              temp = a[imax][k];
+              a[imax][k] = a[j][k];
+              a[j][k] = temp;
+            }
+          *sign = -*sign;
+          v[imax] = v[j];
+        }
+      index[j] = imax;
+      
+      if ( DBL_IS_EQUAL(a[j][j], 0.) ) return 0;
+      
+      if (j != n)
+        {
+          temp = 1 / a[j][j];
+          for (i = j + 1; i < n; i++)
+            a[i][j] *= temp;
+        }
+    }
+
+  free (v);
+
+  return 1;
+}
+
+
+void lu_backsubstitution (double **a, int n, int *index, double *b)
+{
+  int i, ii, ip, j;
+  double sum;
+  
+  ii = 0;
+  for (i = 0; i < n; i++)
+    {
+      ip = index[i];
+      sum = b[ip];
+      b[ip] = b[i];
+      
+      if (ii)
+        for (j = ii; j < i; j++) sum -= a[i][j] * b[j];
+      else if ( fabs(sum) > 0 )
+        ii = i;
+      
+      b[i] = sum;
+    }
+  for (i = n - 1; i >= 0; i--)
+    {
+      sum = b[i];
+      for (j = i + 1; j < n; j++)
+        sum -= a[i][j] * b[j];
+      b[i] = sum / a[i][i];
+    }
+}
+
+
+void fft (double *real, double *imag, int n, int sign)
+{				/* n must be a power of 2 */
+  /* sign should be 1 (FT) or -1 (reverse FT) */
+  int i, j, j1, j2;
+  int bit;
+  double temp_r, temp_i, norm;
+  double w_r, w_i, ww_r, ww_i;
+  int step;
+  
+  /* Bit reversal part */
+  for (i = j = 0; i < n; i++)	/* The bit pattern of i and j are reverse */
+    {
+      if (i > j)
+        {
+          temp_r = real[i];
+          real[i] = real[j];
+          real[j] = temp_r;
+          temp_i = imag[i];
+          imag[i] = imag[j];
+          imag[j] = temp_i;
+        }
+      for (bit = n >> 1; j & bit; bit >>= 1)
+        j ^= bit;
+      j |= bit;
+    }
+  /* Danielson-Lanczos Part */
+  for (step = 1; step < n; step <<= 1)
+    {
+      w_r = cos (M_PI / step);
+      w_i = sin (M_PI / step) * sign;
+      ww_r = 1;
+      ww_i = 0;
+      for (i = 0; i < step; i++)
+        {
+          for (j1 = i, j2 = i + step; j2 < n; j1 += 2 * step, j2 += 2 * step)
+            {
+              temp_r = ww_r * real[j2] - ww_i * imag[j2];
+              temp_i = ww_r * imag[j2] + ww_i * real[j2];
+              real[j2] = real[j1] - temp_r;
+              imag[j2] = imag[j1] - temp_i;
+              real[j1] += temp_r;
+              imag[j1] += temp_i;
+            }
+          temp_r = ww_r;
+          ww_r = ww_r * w_r - ww_i * w_i;
+          ww_i = temp_r * w_i + ww_i * w_r;
+        }
+    }
+  norm = sqrt (n);
+  for (i = 0; i < n; i++)
+    {
+      real[i] /= norm;
+      imag[i] /= norm;
+    }
+}
+
+
+void ft (double *real, double *imag, int n, int sign)
+{				/* sign should be 1 (FT) or -1 (reverse FT) */
+  int j, k;
+  static double *work_r = 0, *work_i = 0;
+  double sum_r, sum_i, norm;
+  double w_r, w_i, ww_r, ww_i, temp_r;
+  
+  if (!work_r)
+    {
+      work_r = (double *) malloc (n * sizeof (double));
+      /* free_at_exit (work_r); */
+    }
+  if (!work_i)
+    {
+      work_i = (double *) malloc (n * sizeof (double));
+      /* free_at_exit (work_i); */
+    }
+  
+  for (k = 0; k < n; k++)
+    {
+      w_r = cos (2 * M_PI * k / n);
+      w_i = sin (2 * M_PI * k / n) * sign;
+      ww_r = 1;
+      ww_i = 0;
+      sum_r = 0;
+      sum_i = 0;
+      for (j = 0; j < n; j++)
+        {
+          sum_r += real[j] * ww_r - imag[j] * ww_i;
+          sum_i += real[j] * ww_i + imag[j] * ww_r;
+          temp_r = ww_r;
+          ww_r = ww_r * w_r - ww_i * w_i;
+          ww_i = temp_r * w_i + ww_i * w_r;
+        }
+      work_r[k] = sum_r;
+      work_i[k] = sum_i;
+    }
+  norm = sqrt (n);
+  for (k = 0; k < n; k++)
+    {
+      real[k] = work_r[k] / norm;
+      imag[k] = work_i[k] / norm;
+    }
+}
+
+/* reentrant version of ft */
+void ft_r(double *real, double *imag, int n, int sign, double *work_r, double *work_i)
+{				/* sign should be 1 (FT) or -1 (reverse FT) */
+  int j, k;
+  double sum_r, sum_i, norm;
+  double w_r, w_i, ww_r, ww_i, temp_r;
+    
+  for (k = 0; k < n; k++)
+    {
+      w_r = cos (2 * M_PI * k / n);
+      w_i = sin (2 * M_PI * k / n) * sign;
+      ww_r = 1;
+      ww_i = 0;
+      sum_r = 0;
+      sum_i = 0;
+      for (j = 0; j < n; j++)
+        {
+          sum_r += real[j] * ww_r - imag[j] * ww_i;
+          sum_i += real[j] * ww_i + imag[j] * ww_r;
+          temp_r = ww_r;
+          ww_r = ww_r * w_r - ww_i * w_i;
+          ww_i = temp_r * w_i + ww_i * w_r;
+        }
+      work_r[k] = sum_r;
+      work_i[k] = sum_i;
+    }
+  norm = sqrt (n);
+  for (k = 0; k < n; k++)
+    {
+      real[k] = work_r[k] / norm;
+      imag[k] = work_i[k] / norm;
+    }
+}
+
+
+double lngamma (double x)
+{
+  double a, b, temp, ser;
+  static double cof[6] =
+  { 76.18009172947146, -86.50532032941677, 24.01409824083091,
+    -1.231739572450155, 0.1208650973866179e-2, -0.5395239384953e-5
+  };
+  int j;
+  
+  a = b = x;
+  temp = a + 5.5;
+  temp -= (a + 0.5) * log (temp);
+  ser = 1.000000000190015;
+  for (j = 0; j <= 5; j++)
+    ser += cof[j] / ++b;
+  return -temp + log (2.5066282746310005 * ser / a);
+}
+
+
+double incomplete_gamma (double a, double x, const char *prompt)
+{
+  if (x < 0 || a <= 0)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"incomplete_gamma\")\n", prompt);
+      exit (4);
+    }
+  if (x < (a + 1))
+    return gamma_help_1 (a, x, prompt);
+  else
+    return 1 - gamma_help_2 (a, x, prompt);
+}
+
+static
+double gamma_help_1 (double a, double x, const char *prompt)
+{
+  int i;
+  double ap, del, gln, sum;
+  static const double eps = 1e-20;
+  
+  gln = lngamma (a);
+  ap = a;
+  del = sum = 1 / a;
+  for (i = 1; i <= 100; i++)
+    {
+      ap++;
+      del *= x / ap;
+      sum += del;
+      if (fabs (del) < fabs (sum) * eps)
+        return sum * exp (-x + a * log (x) - (gln));
+    }
+  fprintf (stderr,
+           "%s: ERROR! Too many iterations in routine \"gamma_help_1\"!\n",
+           prompt);
+  exit (1);
+  return 0;
+}
+
+static
+double gamma_help_2 (double a, double x, const char *prompt)
+{
+  int i;
+  double an, b, c, d, del, gln, h;
+  double const very_small = 1000 * DBL_MIN;
+  static const double eps = 1e-20;
+  
+  gln = lngamma (a);
+  b = x + 1 - a;
+  c = 1 / very_small;
+  d = 1 / b;
+  h = d;
+  for (i = 1; i <= 100; i++)
+    {
+      an = -i * (i - a);
+      b += 2;
+      d = an * d + b;
+      if (fabs (d) < very_small)
+        d = very_small;
+      c = b + an / c;
+      if (fabs (c) < very_small)
+        c = very_small;
+      d = 1 / d;
+      del = d * c;
+      h *= del;
+      if (fabs (del - 1) < eps)
+        return exp (-x + a * log (x) - gln) * h;
+    }
+  fprintf (stderr,
+           "%s: ERROR! Too many iterations in routine \"gamma_help_2\"!\n",
+           prompt);
+  exit (1);
+  return -1;
+}
+
+
+double beta (double a, double b, const char *prompt)
+{
+  if (a <= 0 || b <= 0)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"beta\")\n", prompt);
+      exit (4);
+    }
+  return exp (lngamma (a) + lngamma (b) - lngamma (a + b));
+}
+
+
+double incomplete_beta (double a, double b, double x, const char *prompt)
+{
+  double c;
+  
+  if (a <= 0 || b <= 0)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"incomplete_beta\")\n", prompt);
+      exit (4);
+    }
+  
+  if (x < 0 || x > 1)
+    {
+      fprintf (stderr, "%s: Value out of range (0-1)!\n", prompt);
+      exit (4);
+    }
+  
+  c = (DBL_IS_EQUAL(x, 0.) || DBL_IS_EQUAL(x, 1.)) ? 0 :
+  exp (lngamma (a + b) - lngamma (a) - lngamma (b) + a * log (x) + b * log (1 - x));
+  
+  if (x < (a + 1) / (a + b + 2))
+    return c * beta_help (a, b, x, prompt) / a;
+  else
+    return 1 - c * beta_help (b, a, 1 - x, prompt) / b;
+}
+
+static
+double beta_help (double a, double b, double x, const char *prompt)
+{
+  int m, m2;
+  double aa, c, d, del, h, qab, qam, qap;
+  double const very_small = 1000 * DBL_MIN;
+  static const double eps = 3e-07;
+  
+  qab = a + b;
+  qap = a + 1;
+  qam = a - 1;
+  c = 1;
+  d = 1 - qab * x / qap;
+  if (fabs (d) < very_small)
+    d = very_small;
+  d = 1 / d;
+  h = d;
+  for (m = 1; m <= 100; m++)
+    {
+      m2 = 2 * m;
+      aa = m * (b - m) * x / ((qam + m2) * (a + m2));
+      d = 1 + aa * d;
+      if (fabs (d) < very_small)
+        d = very_small;
+      c = 1 + aa / c;
+      if (fabs (c) < very_small)
+        c = very_small;
+      d = 1 / d;
+      h *= d * c;
+      aa = -(a + m) * (qab + m) * x / ((a + m2) * (qap + m2));
+      d = 1 + aa * d;
+      if (fabs (d) < very_small)
+        d = very_small;
+      c = 1 + aa / c;
+      if (fabs (c) < very_small)
+        c = very_small;
+      d = 1 / d;
+      del = d * c;
+      h *= del;
+      if (fabs (del - 1.0) < eps)
+        return h;
+    }
+  fprintf (stderr,
+           "%s: ERROR! Too many iterations in routine \"beta_help\"!\n",
+           prompt);
+  exit (1);
+  return -1;
+}
+
+
+double normal_density (double x)
+{
+  return M_2_SQRTPI / 2 / M_SQRT2 * exp (-x * x / 2);
+}
+
+
+double normal (double x, const char *prompt)
+{
+  return x > 0 ? 0.5 * (1 + incomplete_gamma (0.5, x * x / 2, prompt)) :
+  x < 0 ? 0.5 * (1 - incomplete_gamma (0.5, x * x / 2, prompt)) : 0.5;
+}
+
+
+double normal_inv (double p, const char *prompt)
+{
+  static double last_p = 0.5, last_x = 0;
+  double x, xx;
+  static const double eps = 1e-10;
+  
+  if (p <= 0 || p >= 1)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"normal_inv\")\n", prompt);
+      exit (4);
+    }
+  
+  if ( DBL_IS_EQUAL(p, last_p) )
+    return last_x;
+  if ( DBL_IS_EQUAL(p, 0.5) )
+    return 0;
+  else if (p < 0.5)
+    return -normal_inv (1 - p, prompt);
+  else
+    {
+      x = 0;
+      while (TRUE)
+        {
+          xx = x - (normal (x, prompt) - p) / normal_density (x);
+          if (fabs (xx - x) < x * eps)
+            break;
+          x = xx;
+        }
+      last_p = p;
+      last_x = x;
+      return x;
+    }
+}
+
+
+double student_t_density (double n, double x, const char *prompt)
+{
+  if (n <= 0)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"student_t_density\")\n", prompt);
+      exit (4);
+    }
+  return exp (lngamma ((n + 1) / 2) - lngamma (n / 2)) / sqrt (n / 2)
+  * pow ((1 + x * x / n), -(n + 1) / 2);
+}
+
+
+double student_t (double n, double x, const char *prompt)
+{
+  if (n <= 0)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"student_t\")\n", prompt);
+      exit (4);
+    }
+  if (x > 0)
+    return 1 - 0.5 * incomplete_beta (n / 2, 0.5, n / (n + x * x), prompt);
+  else if (x < 0)
+    return 0.5 * incomplete_beta (n / 2, 0.5, n / (n + x * x), prompt);
+  else
+    return 0.5;
+}
+
+
+double student_t_inv (double n, double p, const char *prompt)
+{
+  static double last_n = 1, last_p = 0.5, last_x = 0;
+  double x, xx;
+  static const double eps = 1e-10;
+  
+  if (n <= 0 || p <= 0 || p >= 1)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"student_t_inv\")\n", prompt);
+      exit (4);
+    }
+  
+  if ( DBL_IS_EQUAL(n, last_n) && DBL_IS_EQUAL(p, last_p) )
+    return last_x;
+  if ( DBL_IS_EQUAL(p, 0.5) )
+    return 0;
+  else if (p < 0.5)
+    return -student_t_inv (n, 1 - p, prompt);
+  else
+    {
+      x = 0;
+      while (TRUE)
+        {
+          xx = x - (student_t (n, x, prompt) - p)
+          / student_t_density (n, x, prompt);
+          if (fabs (xx - x) < x * eps)
+            break;
+          x = xx;
+        }
+      last_n = n;
+      last_p = p;
+      last_x = x;
+      return x;
+    }
+}
+
+
+double chi_square_density (double n, double x, const char *prompt)
+{
+  if (n <= 0)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"chi_square_density\")\n", prompt);
+      exit (4);
+    }
+  return x <= 0 ? 0 : pow (2, -n / 2) * 
+  pow (x, n / 2 - 1) * exp (-x / 2 - lngamma (n / 2));
+}
+
+
+double chi_square (double n, double x, const char *prompt)
+{
+  if (n <= 0)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"chi_square\")\n", prompt);
+      exit (4);
+    }
+  return x <= 0 ? 0 : incomplete_gamma (n / 2, x / 2, prompt);
+}
+
+
+double chi_square_inv (double n, double p, const char *prompt)
+{
+  static double last_n = -1, last_p = -1, last_x = -1;
+  static double last_last_n = -1, last_last_p = -1, last_last_x = -1;
+  double x, xx;
+  static const double eps = 1e-10;
+  
+  if (n <= 0 || p <= 0 || p >= 1)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"chi_square_inv\")\n", prompt);
+      exit (4);
+    }
+  
+  if ( DBL_IS_EQUAL(n, last_n) && DBL_IS_EQUAL(p, last_p) )
+    return last_x;
+  
+  if (DBL_IS_EQUAL(n, last_last_n) && DBL_IS_EQUAL(p, last_last_p) )
+    return last_last_x;
+  
+  x = n;
+  while (TRUE)
+    {
+      xx = x - (chi_square (n, x, prompt) - p)
+      / chi_square_density (n, x, prompt);
+      if (fabs (xx - x) < x * eps)
+        break;
+      if (xx < 0)
+        x /= 2;
+      else
+        x = xx;
+    }
+  
+  last_last_n = last_n;
+  last_last_p = last_p;
+  last_last_x = last_x;
+  last_n = n;
+  last_p = p;
+  last_x = x;
+  return x;
+}
+
+
+void chi_square_constants (double n, double p, double *c1, double *c2, const char *prompt)
+{
+  double delta_c1, delta_c2;
+  static double last_n, last_p, last_c1, last_c2;
+  double a11, a12, a21, a22, b1, b2;
+  double det;
+  static const double eps = 1e-10;
+  
+  if (n <= 0 || p <= 0 || p >= 1)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"chi_square_constants\")\n", prompt);
+      exit (4);
+    }
+  
+  if ( DBL_IS_EQUAL(n, last_n) && DBL_IS_EQUAL(p, last_p) )
+    {
+      *c1 = last_c1;
+      *c2 = last_c2;
+      return;
+    }
+  
+  *c1 = n;
+  *c2 = n;
+  
+  while (TRUE)
+    {
+      a11 = -chi_square_density (n, *c1, prompt);
+      a12 = chi_square_density (n, *c2, prompt);
+      a21 = -chi_square_density (n + 2, *c1, prompt);
+      a22 = chi_square_density (n + 2, *c2, prompt);
+      b1 = p + chi_square (n, *c1, prompt) - chi_square (n, *c2, prompt);
+      b2 =
+      p + chi_square (n + 2, *c1, prompt) - chi_square (n + 2, *c2, prompt);
+      /* Solve ((a11,a12),(a21,a22))*(delta_c1,delta_c2)==(b1,b2) */
+      det = a11 * a22 - a12 * a21;
+      delta_c1 = (b1 * a22 - b2 * a12) / det;
+      delta_c2 = (b2 * a11 - b1 * a21) / det;
+      if (fabs (delta_c1) < *c1 * eps && fabs (delta_c2) < *c2 * eps)
+        break;
+      if (*c1 + delta_c1 >= n)
+        *c1 = (n + *c1) / 2;
+      else if (*c1 + delta_c1 <= 0)
+        *c1 /= 2;
+      else
+        *c1 += delta_c1;
+      if (*c2 + delta_c2 <= n)
+        *c2 = (n + *c2) / 2;
+      else
+        *c2 += delta_c2;
+    }
+  
+  last_n = n;
+  last_p = p;
+  last_c1 = *c1;
+  last_c2 = *c2;
+  return;
+}
+
+
+double beta_distr_density (double a, double b, double x, const char *prompt)
+{
+  if (a <= 0 || b <= 0)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"beta_distr_density\")\n", prompt);
+      exit (4);
+    }
+  return x <= 0 ? 0 : x >= 1 ? 1 : pow (x, a - 1) 
+  * pow (1 - x, b - 1) / beta (a, b, prompt);
+}
+
+
+double beta_distr (double a, double b, double x, const char *prompt)
+{
+  return incomplete_beta (a, b, x, prompt);
+}
+
+
+double beta_distr_inv (double a, double b, double p, const char *prompt)
+{
+  static double last_a = -1, last_b, last_p = -1, last_x = -1;
+  static double last_last_a = -1, last_last_b = -1, last_last_p = -1,
+  last_last_x = -1;
+  double xx, x;
+  static const double eps = 1e-10;
+  
+  if (a <= 0 || b <= 0 || p <= 0 || p >= 1)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"beta_distr_inv\")\n", prompt);
+      exit (4);
+    }
+  
+  if ( DBL_IS_EQUAL(a, last_a) && DBL_IS_EQUAL(b, last_b) && DBL_IS_EQUAL(p, last_p) )
+    return last_x;
+  
+  if ( DBL_IS_EQUAL(a, last_last_a) && DBL_IS_EQUAL(b, last_last_b) && DBL_IS_EQUAL(p, last_last_p) )
+    return last_last_x;
+  
+  x = a / (a + b);
+  while (TRUE)
+    {
+      xx = x - (beta_distr (a, b, x, prompt) - p)
+      / beta_distr_density (a, b, x, prompt);
+      if (fabs (xx - x) < x * eps)
+        break;
+      if (xx <= 0)
+        x /= 2;
+      else if (xx >= 1)
+        x = (1 + x) / 2;
+      else
+        x = xx;
+    }
+#if 0
+  for (x_l = 0, x_r = 1; fabs (x_l - x_r) > eps;
+       x = (x_l+x_r) / 2, beta_distr (a, b, x, prompt) < p ? (x_l=x):(x_r=x));
+#endif
+  
+  last_last_a = last_a;
+  last_last_b = last_b;
+  last_last_p = last_p;
+  last_last_x = last_x;
+  last_a = a;
+  last_b = b;
+  last_p = p;
+  last_x = x;
+  return x;
+}
+
+
+void beta_distr_constants(double a, double b, double p, double *c1, double *c2,
+                          const char *prompt)
+{
+  double delta_c1, delta_c2;
+  static double last_a, last_b, last_p, last_c1, last_c2;
+  double a11, a12, a21, a22, b1, b2;
+  double det;
+  static const double eps = 1e-10;
+  
+  if (a <= 0 || b <= 0 || p <= 0 || p >= 1)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"beta_distr_constants\")\n", prompt);
+      exit (4);
+    }
+  
+  if ( DBL_IS_EQUAL(a, last_a) && DBL_IS_EQUAL(b, last_b) && DBL_IS_EQUAL(p, last_p) )
+    {
+      *c1 = last_c1;
+      *c2 = last_c2;
+      return;
+    }
+  
+#if 0
+  *c1 = a / (a + b);
+  *c2 = a / (a + b);
+#endif
+  *c1 = beta_distr_inv (a, b, p / 2, prompt);
+  *c2 = beta_distr_inv (a, b, 1 - p / 2, prompt);
+  
+  while (TRUE)
+    {
+      a11 = -beta_distr_density (a, b, *c1, prompt);
+      a12 =  beta_distr_density (a, b, *c2, prompt);
+      a21 = -beta_distr_density (a + 1, b, *c1, prompt);
+      a22 =  beta_distr_density (a + 1, b, *c2, prompt);
+      b1 =
+      p + beta_distr (a, b, *c1, prompt) - beta_distr (a, b, *c2, prompt);
+      b2 =
+      p + beta_distr (a + 1, b, *c1, prompt) - beta_distr (a + 1, b, *c2,
+                                                           prompt);
+      /* Solve ((a11,a12),(a21,a22))*(delta_c1,delta_c2)==(b1,b2) */
+      det = a11 * a22 - a12 * a21;
+      delta_c1 = (b1 * a22 - b2 * a12) / det;
+      delta_c2 = (b2 * a11 - b1 * a21) / det;
+      if (fabs (delta_c1) < *c1 * eps && fabs (delta_c2) < *c2 * eps)
+        break;
+      if (*c1 + delta_c1 >= a / (a + b))
+        *c1 = (a / (a + b) + *c1) / 2;
+      else if (*c1 + delta_c1 <= 0)
+        *c1 /= 2;
+      else
+        *c1 += delta_c1;
+      if (*c2 + delta_c2 >= 1)
+        *c2 = (1 + *c2) / 2;
+      else if (*c2 + delta_c2 <= a / (a + b))
+        *c2 = (a / (a + b) + *c2) / 2;
+      else
+        *c2 += delta_c2;
+    }
+  
+  last_a = a;
+  last_b = b;
+  last_p = p;
+  last_c1 = *c1;
+  last_c2 = *c2;
+  return;
+}
+
+
+double fisher(double m, double n, double x, const char *prompt)
+{
+  if (m <= 0 || n <= 0)
+    {
+      fprintf (stderr,
+               "%s: IMPLEMENTATION ERROR! (Invalid argument in function "
+               "\"fisher\")\n", prompt);
+      exit (4);
+    }
+  return incomplete_beta (m / 2, n / 2, n / (n + m * x), prompt);
+}
+
+/* ******************************************************************************** */
+/*                                                                                  */
+/*   P A R A L L E L   S O L U T I O N   O F   T H E   E I G E N   P R O B L E M    */
+/*                     WITH ONE SIDED JACOBI ALGORITHM                              */
+/*                                                                                  */
+/* ******************************************************************************** */
+
+
+void parallel_eigen_solution_of_symmetric_matrix(double **M, double *A, int n1, int n2, const char func[])
+{
+  func = "statistics-module";
+
+  char *envstr;
+  /* Get Environment variables if set */
+  envstr = getenv("MAX_JACOBI_ITER");
+  if ( envstr ) 
+    max_jacobi_iter = atoi(envstr);
+  else
+    max_jacobi_iter = MAX_JACOBI_ITER;
+  if ( cdoVerbose )
+    cdoPrint("Using MAX_JACOBI_ITER %i from %s",
+	     max_jacobi_iter, envstr?"Environment":"default");
+
+   
+  envstr = getenv("FNORM_PRECISION");
+  if ( envstr ) 
+    fnorm_precision = strtod(envstr,NULL);
+  else
+    fnorm_precision = FNORM_PRECISION;
+
+  if ( cdoVerbose ) 
+    cdoPrint("Using FNORM_PRECISION %g from %s",
+	     fnorm_precision,envstr?"Environment":"default");
+
+  if ( n1 != n2 )
+    {
+      fprintf(stderr, 
+	      "WARNING: Parallel eigenvalue computation of non-squared matrices\n"
+	      "         Not implemented yet.\n"
+	      "         Using sequential algorithm");                              
+      eigen_solution_of_symmetric_matrix(M,A,n1,n2,func);
+    }
+  else
+    jacobi_1side(M,A,n1);
+
+  return;
+}
+
+/* ******************************************************************************** */
+/* This routine rotates columns/rows i and j of a symmetric Matrix M in a fashion,  */
+/* thus that the dot product of columns i and j 0 afterwards                        */
+/*                                                                                  */
+/* As this is done by a right-multiplication with a rotation matrix, which only     */
+/* changes columns i and j, this can be carried out for n/2 pairs of columns at     */
+/* the same time.                                                                   */
+/* ******************************************************************************** */
+void annihilate_1side(double **M, long i, long j, long k, long n)
+{
+
+  double tk, ck, sk, alpha=0, beta=0, gamma=0, zeta=0;
+  double tmp, *mi=NULL, *mj=NULL;
+  //  int first_annihilation = 0;
+  long r;
+
+  i--; j--;
+
+  mi = malloc(n*sizeof(double));
+  mj = malloc(n*sizeof(double));
+
+  if ( ! mj || ! mi) 
+    fprintf(stderr, 
+	    "ERROR: allocation error - cannot allocate memory\n"
+	    "ERROR: check stacksize and physically available memory\n");
+
+  if ( j < i ) { int tmp = i; i = j; j = tmp; }
+  
+  for ( r=0; r<n; r++ ) {
+      alpha += M[j][r]*M[j][r];
+      beta  += M[i][r]*M[i][r];
+      gamma += M[i][r]*M[j][r];
+  }
+
+  // 2011-08-15 Cedrick Ansorge: bug fix
+  //  tmp = fabs(gamma/sqrt(alpha/beta));
+  tmp = fabs(gamma/sqrt(alpha*beta));
+
+  if ( tmp < fnorm_precision ) {
+#if defined (_OPENMP)
+    #pragma omp critical 
+#endif
+    {
+      n_finished++;
+    }
+    free(mi);
+    free(mj);
+    return;
+  }
+  
+  zeta = (beta-alpha)/(2.*gamma);  // tan(2*theta)
+  tk = 1./(fabs(zeta)+sqrt(1.+zeta*zeta)); 
+  tk = zeta>0? tk : -tk;       // = cot(2*theta)
+  ck = 1./sqrt(1.+tk*tk);      // = cos(theta)
+  sk = ck*tk;                  // = sin(theta)
+  
+  // calculate a_i,j - tilde
+  for ( r=0; r<n; r++ ) {
+    mi[r] =  ck*M[i][r]  + sk*M[j][r];
+    mj[r] = -sk*M[i][r]  + ck*M[j][r];
+  }
+  
+  for ( r=0; r<n; r++ ) {
+    M[i][r] = mi[r];
+    M[j][r] = mj[r];
+  }
+
+  free(mi);
+  free(mj);
+
+  return;
+}
+
+
+int jacobi_1side(double **M, double *A, long n)
+{  
+  long i,j,k,m,r;
+  long idx;
+  long i_ann,j_ann;
+  int n_iter = 0;
+  int count=0;
+  int **annihilations = NULL, *annihilations_buff = NULL;
+
+  if ( n > 0 )
+    {
+      annihilations_buff = malloc (n*n*2*sizeof(int));
+      annihilations = malloc((n*n)*sizeof(int*));
+    }
+
+  for(i=0;i<n*n;i++)
+    annihilations[i] = & annihilations_buff[2*i];
+
+  for( k=1; k<n+1; k++ ) {
+    if ( k < n ) {
+      for ( i=1;i<=(int)ceil(1./2.*(n-k));i++ ) {
+	j = n-k+2-i;
+        annihilations[count][0] = i;
+        annihilations[count][1] = j;
+	count++;
+      }
+      if ( k > 2 ) {
+        for ( i=n-k+2;i<=n-(int)floor(1./2.*k);i++ ) {
+          j = 2*n-k+2-i;
+          annihilations[count][0] = i;
+          annihilations[count][1] = j;
+          count++;
+        }
+      }
+    }
+    else if ( k == n ) {
+      for(i=2;i<=(int)ceil(1./2.*n);i++) {
+        j = n+2-i;
+        annihilations[count][0] = i;
+        annihilations[count][1] = j;
+        count++;
+      }
+    }
+  }
+
+  //  fprintf(stderr, "%i annihilations per sweep\n",count);
+
+  n_finished = 0;
+
+  //  override global openmp settings works
+  //  omp_set_num_threads(2);
+
+  while ( n_iter < max_jacobi_iter && n_finished < count ) {
+    n_finished = 0;
+    if ( n%2 == 1 ) {
+      for(m=0;m<n;m++) {
+#if defined (_OPENMP)
+	#pragma omp parallel for private(i,idx,i_ann,j_ann) shared(M,annihilations,n) reduction(+:n_finished)
+#endif
+        for(i=0;i<n/2;i++) {
+          idx = m*(n/2)+i;
+	  i_ann = annihilations[idx][0];
+	  j_ann = annihilations[idx][1];
+          if ( i_ann != j_ann && i_ann && j_ann ) 
+	    annihilate_1side(M,i_ann,j_ann,0,n);
+	}
+      }
+    }
+    else { // n%2 == 0                                                                               
+      for(m=0;m<n;m++) {
+#if defined (_OPENMP)
+	#pragma omp parallel for private(i,idx,i_ann,j_ann) shared(M,annihilations,n) reduction(+:n_finished)
+#endif
+        for(i=0;i<n/2-(m%2);i++) {
+	  idx = m/2 * ( n/2 + n/2-1);
+          if ( m % 2 ) idx += n/2;
+	  i_ann = annihilations[idx+i][0];
+	  j_ann = annihilations[idx+i][1];
+          if ( i_ann && j_ann && i_ann != j_ann ) 
+	    annihilate_1side(M,i_ann,j_ann,0,n);
+        }
+      }
+    }
+    n_iter++;
+  }
+
+  if ( cdoVerbose ) 
+    cdoPrint("Finished one-sided jacobi scheme for eigenvalue computation after %i iterations",n_iter);
+
+  //  fprintf(stderr,"finished after %i sweeps (n_finished %i)\n",n_iter,n_finished);
+
+  if ( n_iter == max_jacobi_iter && n_finished < count)
+    {
+      fprintf(stderr, 
+	      "statistics-module (Warning): Eigenvalue computation with one-sided jacobi scheme\n"
+	      "                             did not converge properly. %i of %i pairs of columns did\n"
+	      "                             not achieve requested orthogonality of %10.6g\n",
+	      count-n_finished,count, fnorm_precision);
+
+      if ( n_finished == 0 ) {
+	//	Do not overwrite results in case of insufficient convergence
+	cdoWarning("Setting Matrix and Eigenvalues to 0 before return");
+	for ( i=0; i<n; i++ ) {
+	  memset(M[i],0,n*sizeof(double));
+	  memset(A,0,n*sizeof(double));
+	}
+	return -1;
+      }
+    }
+  // calculate  eigen values as sqrt(||m_i||)
+  for ( i=0; i<n; i++ )
+    {
+      A[i] = 0;
+      for ( r=0; r<n; r++ )
+	A[i] += M[i][r] * M[i][r];
+      A[i] = sqrt(A[i]);
+      for ( r=0; r<n; r++ )
+	M[i][r] /= A[i];
+    }
+
+  heap_sort(A,M,n);
+  
+  if ( annihilations      ) free(annihilations);
+  if ( annihilations_buff ) free(annihilations_buff);
+  
+  return n_iter;
+}
+
diff --git a/src/statistic.h b/src/statistic.h
new file mode 100644
index 0000000..7f6c8e7
--- /dev/null
+++ b/src/statistic.h
@@ -0,0 +1,39 @@
+#ifndef _STATISTIC_H
+
+#define _STATISTIC_H
+
+void eigen_solution_of_symmetric_matrix (double **a, double *eig_val, int n, int n_eig, const char *prompt);
+int solution_of_linear_equation (double **a, double *b, int n);
+int inverse_of_matrix (double **a, double **b, int n);
+void fft(double *real, double *imag, int n, int sign);
+void ft (double *real, double *imag, int n, int sign);
+void ft_r(double *real, double *imag, int n, int sign, double *work_r, double *work_i);
+double lngamma (double x);
+double beta (double a, double b, const char *prompt);
+double incomplete_gamma (double a, double x, const char *prompt);
+double incomplete_beta (double a, double b, double x, const char *prompt);
+double normal_density (double x);
+double normal (double x, const char *prompt);
+double normal_inv (double p, const char *prompt);
+double student_t_density (double n, double x, const char *prompt);
+double student_t (double n, double x, const char *prompt);
+double student_t_inv (double n, double p, const char *prompt);
+double chi_square_density (double n, double x, const char *prompt);
+double chi_square (double n, double x, const char *prompt);
+double chi_square_inv (double n, double p, const char *prompt);
+void chi_square_constants (double n, double p, double *c1, double *c2, const char *prompt);
+double beta_distr_density (double a, double b, double x, const char *prompt);
+double beta_distr (double a, double b, double x, const char *prompt);
+double beta_distr_inv (double a, double b, double p, const char *prompt);
+void beta_distr_constants (double a, double b, double p, double *c1, double *c2, const char *prompt);
+double fisher (double m, double n, double x, const char *prompt);
+
+// make heap sort accessible for eigen value computation in EOFs.c
+void heap_sort (double *eig_val, double **a, int n);
+
+// make parallel eigen solution accessible for eigen value computation in EOF3d.c
+void parallel_eigen_solution_of_symmetric_matrix(double **M, double *A, 
+						 int n1, int n2, const char func[]);
+
+
+#endif
diff --git a/src/table.c b/src/table.c
new file mode 100644
index 0000000..2738af6
--- /dev/null
+++ b/src/table.c
@@ -0,0 +1,66 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "error.h"
+
+
+#ifndef  UNDEFID
+#define  UNDEFID  CDI_UNDEFID
+#endif
+
+
+int defineTable(char *tablearg)
+{
+  char *tablename;
+  int tableID = UNDEFID;
+
+  tablename = tablearg;
+
+  tableID = tableRead(tablename);
+
+  if ( tableID == UNDEFID )
+    {
+      char *tablepath = getenv("CD_TABLEPATH");
+
+      if ( tablepath )
+	{
+	  char *tablefile = NULL;
+	  int len = sizeof(tablepath) + sizeof(tablename) + 3;
+	  tablefile = (char *) malloc(len);
+	  strcpy(tablefile, tablepath);
+	  strcat(tablefile, "/");
+	  strcat(tablefile, tablename);
+	  tableID = tableRead(tablefile);
+	  free(tablefile);
+	}
+    }
+
+  if ( tableID == UNDEFID )
+    tableID = tableInq(-1, 0, tablename);
+
+  if ( tableID == UNDEFID )
+    Error("table <%s> not found", tablename);
+
+  return (tableID);
+}
diff --git a/src/temp.h b/src/temp.h
new file mode 100644
index 0000000..80343df
--- /dev/null
+++ b/src/temp.h
@@ -0,0 +1,32401 @@
+/* cdo outputf,"%6g",8 -int -mulc,500 -subc,220 -selcode,169 -seltimestep,3 r720x360testfile.nc > temp */
+10446,10450,10455,10464,10467,10472,10479,10483,
+10486,10493,10497,10500,10500,10501,10501,10501,
+10501,10498,10487,10482,10476,10465,10460,10449,
+10424,10412,10400,10376,10364,10354,10334,10324,
+10314,10294,10284,10275,10257,10248,10238,10222,
+10218,10215,10206,10202,10198,10190,10186,10182,
+10174,10171,10167,10159,10155,10151,10143,10138,
+10135,10136,10136,10137,10138,10139,10144,10166,
+10175,10186,10207,10215,10221,10231,10237,10242,
+10252,10255,10255,10257,10257,10258,10259,10261,
+10263,10268,10270,10272,10276,10279,10281,10285,
+10288,10290,10291,10290,10288,10286,10285,10283,
+10283,10283,10283,10283,10283,10283,10292,10297,
+10301,10310,10315,10319,10326,10330,10333,10340,
+10343,10346,10350,10353,10355,10360,10363,10368,
+10377,10381,10384,10393,10399,10255,10271,10279,
+10288,10302,10308,10313,10323,10328,10334,10343,
+10348,10353,10364,10369,10374,10390,10399,10408,
+10424,10433,10441,10445,10447,10448,10451,10453,
+10447,10421,10407,10394,10368,10354,10343,10323,
+10313,10302,10282,10273,10265,10250,10242,10234,
+10216,10202,10185,10153,10136,10120,10086,10066,
+10047,10008,9989,9969,9911,9873,9834,9755,
+9715,9674,9596,9559,9526,9461,9427,9395,
+9340,9313,9286,9230,9203,9182,9154,9140,
+9126,9098,9086,9088,9094,9280,9287,9301,
+9307,9314,9326,9333,9339,9351,9357,9363,
+9375,9380,9385,9395,9396,9397,9398,9399,
+9400,9229,9233,9237,9245,9249,9253,9257,
+9259,9261,9265,9267,9270,9282,9288,9293,
+9304,9310,9320,9347,9360,9374,9401,9414,
+9423,9439,9447,9456,9472,9478,9483,9491,
+9496,9500,9507,9504,9500,9491,9487,9489,
+9490,9490,9489,9488,9488,9487,9498,9509,
+9521,9544,9555,9566,9589,9600,9611,9633,
+9644,9655,9677,9688,9700,9722,9733,9742,
+9757,9764,9772,9787,9794,9797,9802,9805,
+9808,9814,9818,9822,9831,9836,9840,9848,
+9853,9859,9869,9874,9879,9890,9898,9907,
+9923,9931,9939,9956,9965,9973,9990,9999,
+10007,10028,10038,10049,10070,10080,10090,10099,
+10103,10107,10116,10120,10118,10100,10092,10084,
+10067,10059,10049,10028,10018,10007,9987,9976,
+9964,9940,9928,9916,9892,9882,9872,9851,
+9840,9830,9809,9799,9790,9770,9759,9750,
+9733,9727,9720,9708,9701,9694,9684,9680,
+9676,9668,9663,9660,9665,9668,9671,9677,
+9680,9682,9681,9681,9681,9681,9680,9677,
+9669,9665,9661,9652,9649,9647,9643,9641,
+9639,9635,9635,9634,9633,9632,9632,9628,
+9623,9617,9606,9600,9594,9585,9579,9574,
+9563,9558,9553,9553,9555,9556,9560,9561,
+9563,9564,9564,9565,9566,9566,9565,9561,
+9558,9556,9552,9550,9549,9549,9549,9549,
+9548,9548,9549,9551,9552,9553,9555,9557,
+9558,9560,9561,9563,9565,9566,9567,9570,
+9571,9572,9569,9564,9560,9550,9546,9541,
+9533,9530,9526,9518,9514,9511,9509,9508,
+9508,9507,9506,9505,9503,9502,9501,9499,
+9497,9496,9493,9491,9489,9485,9485,9486,
+9488,9489,9490,9492,9495,9497,9502,9505,
+9507,9509,9508,9507,9507,9506,9505,9502,
+9501,9499,9496,9495,9494,9489,9486,9484,
+9478,9475,9473,9466,9463,9459,9452,9448,
+9444,9432,9427,9422,9411,9405,9401,9394,
+9391,9387,9381,9379,9377,9373,9372,9370,
+9367,9366,9365,9364,9363,9362,9361,9360,
+9360,9359,9359,9359,9352,9347,9341,9330,
+9324,9318,9307,9301,9297,9286,9280,9275,
+9265,9261,9257,9247,9243,9240,9238,9237,
+9236,9234,9234,9237,9244,9248,9252,9258,
+9262,9267,9275,9279,9283,9292,9296,9300,
+9309,9313,9318,9326,9328,9330,9335,9338,
+9340,9344,9346,9348,9352,9354,9356,9355,
+9354,9352,9349,9348,9347,9345,9345,9344,
+9343,9342,9342,9343,9343,9344,9345,9346,
+9347,9348,9349,9350,9352,9354,9355,9358,
+9360,9361,9365,9376,9387,9410,9422,9432,
+9457,9471,9486,9515,9530,9544,9565,9572,
+9579,9591,9598,9605,9621,9629,9636,9653,
+9661,9670,9692,9704,9715,9739,9751,9762,
+9787,9799,9811,9836,9847,9860,9885,9899,
+9912,9937,9951,9965,9994,10007,10022,10050,
+10066,10081,10111,10126,10141,10167,10174,10180,
+10194,10201,10208,10219,10224,10229,10240,10245,
+10251,10253,10252,10252,10251,10250,10250,10244,
+10241,10238,10231,10228,10222,10206,10197,10189,
+10172,10165,10166,10172,10174,10177,10183,10191,
+10203,10382,10397,10412,10439,10442,10444,10448,
+10450,10452,10454,10452,10450,10446,10444,10443,
+10473,10480,10487,10500,10507,10512,10523,10529,
+10534,10544,10549,10553,10556,10558,10559,10562,
+10563,10562,10554,10549,10546,10536,10531,10519,
+10496,10484,10472,10448,10437,10427,10407,10397,
+10387,10368,10358,10349,10332,10323,10314,10299,
+10295,10292,10284,10280,10276,10269,10265,10262,
+10256,10252,10248,10240,10236,10232,10223,10219,
+10216,10217,10218,10218,10219,10220,10226,10248,
+10258,10269,10291,10300,10306,10316,10320,10325,
+10336,10338,10339,10340,10340,10340,10341,10343,
+10344,10348,10349,10351,10355,10357,10359,10363,
+10364,10366,10366,10365,10363,10359,10357,10355,
+10353,10352,10352,10350,10349,10349,10357,10361,
+10365,10373,10377,10380,10385,10387,10390,10396,
+10398,10400,10403,10405,10406,10409,10412,10416,
+10423,10425,10429,10436,10440,10290,10304,10312,
+10319,10333,10338,10341,10350,10354,10359,10367,
+10371,10376,10384,10388,10392,10406,10414,10422,
+10437,10445,10452,10453,10453,10453,10453,10453,
+10445,10416,10401,10385,10355,10340,10328,10304,
+10293,10281,10257,10246,10237,10217,10209,10199,
+10179,10162,10144,10109,10090,10073,10036,10014,
+9994,9953,9932,9911,9850,9810,9770,9689,
+9647,9607,9526,9488,9454,9387,9353,9320,
+9263,9235,9208,9151,9123,9101,9073,9058,
+9044,9015,9004,9005,9011,9197,9204,9217,
+9224,9230,9242,9248,9254,9266,9272,9278,
+9290,9296,9301,9310,9311,9312,9315,9316,
+9317,9148,9152,9157,9165,9170,9174,9180,
+9182,9185,9191,9193,9197,9210,9216,9222,
+9236,9243,9254,9282,9297,9311,9340,9353,
+9363,9382,9391,9400,9420,9426,9432,9443,
+9449,9455,9465,9464,9461,9455,9453,9457,
+9462,9463,9464,9466,9467,9468,9483,9497,
+9509,9535,9549,9561,9587,9600,9613,9638,
+9651,9663,9689,9702,9715,9740,9753,9763,
+9782,9791,9799,9818,9826,9832,9841,9846,
+9850,9860,9866,9872,9884,9890,9896,9909,
+9915,9922,9935,9941,9948,9963,9972,9981,
+10001,10009,10019,10038,10048,10057,10077,10087,
+10096,10118,10130,10140,10163,10174,10184,10195,
+10201,10206,10215,10220,10219,10207,10200,10193,
+10180,10174,10166,10148,10140,10132,10115,10106,
+10096,10077,10067,10057,10038,10029,10020,10004,
+9995,9987,9970,9963,9954,9938,9930,9922,
+9909,9904,9899,9888,9883,9879,9872,9868,
+9865,9859,9855,9853,9859,9862,9866,9873,
+9876,9878,9878,9879,9879,9879,9879,9876,
+9869,9866,9862,9855,9853,9851,9848,9846,
+9845,9842,9841,9841,9840,9840,9839,9835,
+9830,9825,9815,9810,9804,9795,9790,9785,
+9775,9770,9765,9764,9765,9766,9768,9769,
+9770,9769,9769,9769,9768,9768,9766,9760,
+9758,9756,9750,9747,9746,9743,9742,9740,
+9737,9736,9736,9736,9735,9735,9734,9734,
+9734,9733,9733,9732,9731,9731,9731,9730,
+9729,9729,9723,9717,9712,9700,9694,9688,
+9678,9674,9669,9658,9653,9649,9643,9641,
+9638,9633,9632,9629,9623,9620,9617,9612,
+9609,9606,9599,9596,9592,9587,9585,9584,
+9582,9581,9580,9579,9579,9580,9581,9582,
+9582,9582,9579,9577,9572,9569,9567,9562,
+9559,9556,9551,9549,9546,9538,9535,9531,
+9523,9519,9515,9507,9502,9498,9488,9484,
+9478,9465,9460,9453,9440,9433,9429,9420,
+9416,9411,9402,9398,9395,9390,9387,9384,
+9379,9377,9375,9371,9369,9367,9363,9361,
+9359,9356,9354,9352,9344,9338,9332,9318,
+9311,9304,9292,9285,9279,9266,9259,9253,
+9241,9235,9229,9216,9211,9207,9202,9200,
+9197,9192,9190,9191,9195,9197,9199,9203,
+9205,9207,9211,9214,9215,9219,9222,9224,
+9229,9232,9234,9238,9239,9240,9241,9242,
+9243,9244,9244,9244,9245,9245,9245,9241,
+9237,9234,9228,9224,9221,9216,9215,9212,
+9208,9205,9203,9200,9199,9198,9195,9194,
+9193,9192,9191,9191,9190,9189,9189,9188,
+9188,9188,9190,9200,9211,9232,9244,9255,
+9278,9293,9307,9336,9350,9366,9386,9393,
+9399,9413,9420,9426,9442,9451,9459,9475,
+9484,9494,9517,9530,9543,9568,9581,9593,
+9621,9633,9647,9674,9688,9702,9731,9745,
+9759,9789,9804,9820,9853,9870,9886,9920,
+9937,9955,9990,10007,10025,10056,10065,10074,
+10091,10100,10109,10125,10132,10139,10154,10161,
+10169,10174,10174,10175,10177,10178,10179,10177,
+10175,10174,10172,10171,10166,10152,10144,10136,
+10122,10116,10119,10129,10133,10138,10148,10158,
+10174,10370,10387,10405,10438,10444,10448,10456,
+10460,10464,10469,10469,10469,10468,10468,10468,
+10740,10741,10748,10759,10759,10778,10777,10780,
+10783,10772,10776,10780,10756,10754,10753,10750,
+10749,10744,10730,10722,10715,10701,10693,10681,
+10653,10641,10628,10601,10590,10584,10562,10552,
+10542,10534,10524,10511,10491,10482,10472,10458,
+10455,10456,10460,10457,10454,10445,10444,10443,
+10438,10438,10436,10420,10397,10393,10389,10387,
+10386,10392,10396,10401,10412,10417,10392,10412,
+10423,10431,10451,10460,10466,10476,10482,10486,
+10495,10499,10499,10498,10498,10499,10498,10499,
+10499,10500,10500,10501,10502,10503,10505,10507,
+10507,10507,10504,10501,10498,10494,10491,10488,
+10485,10485,10487,10473,10472,10471,10474,10472,
+10473,10480,10481,10483,10485,10486,10488,10490,
+10491,10493,10492,10492,10492,10493,10496,10498,
+10503,10506,10508,10513,10517,10369,10382,10391,
+10399,10414,10418,10423,10431,10434,10438,10447,
+10451,10455,10463,10467,10472,10486,10496,10504,
+10520,10530,10538,10541,10543,10546,10548,10549,
+10542,10515,10502,10489,10462,10448,10437,10417,
+10405,10394,10372,10363,10354,10336,10327,10318,
+10299,10284,10266,10233,10216,10199,10164,10144,
+10125,10085,10065,10046,9990,9953,9917,9842,
+9804,9767,9693,9658,9627,9562,9530,9500,
+9446,9420,9393,9340,9312,9292,9260,9245,
+9229,9196,9182,9180,9179,9339,9340,9345,
+9346,9348,9351,9352,9354,9358,9360,9362,
+9365,9367,9369,9371,9370,9368,9365,9363,
+9362,9206,9207,9209,9213,9215,9217,9219,
+9220,9221,9225,9226,9229,9239,9245,9251,
+9262,9268,9278,9304,9318,9332,9359,9373,
+9383,9402,9413,9423,9442,9451,9458,9471,
+9478,9485,9498,9499,9498,9497,9497,9502,
+9509,9512,9515,9521,9524,9527,9544,9557,
+9572,9599,9612,9626,9653,9666,9678,9705,
+9717,9730,9756,9768,9781,9805,9818,9828,
+9845,9854,9863,9880,9887,9891,9900,9904,
+9908,9916,9920,9924,9934,9939,9944,9954,
+9959,9964,9973,9978,9983,9994,10002,10009,
+10024,10032,10039,10053,10061,10069,10084,10091,
+10098,10116,10125,10133,10151,10160,10168,10174,
+10177,10180,10185,10188,10185,10169,10161,10152,
+10135,10128,10118,10097,10088,10078,10057,10047,
+10035,10012,10001,9989,9966,9956,9946,9925,
+9916,9906,9885,9876,9866,9847,9838,9828,
+9811,9804,9799,9785,9778,9772,9761,9757,
+9752,9743,9738,9735,9738,9740,9742,9747,
+9749,9751,9750,9750,9750,9751,9751,9748,
+9742,9740,9737,9733,9731,9731,9731,9732,
+9732,9733,9735,9736,9740,9742,9745,9747,
+9745,9744,9741,9739,9738,9735,9735,9734,
+9732,9731,9731,9738,9744,9749,9758,9763,
+9768,9776,9780,9784,9790,9794,9796,9797,
+9798,9798,9798,9798,9799,9800,9800,9800,
+9800,9800,9801,9801,9801,9800,9799,9798,
+9796,9792,9789,9786,9780,9776,9772,9764,
+9759,9755,9739,9729,9717,9695,9683,9672,
+9648,9636,9625,9600,9587,9575,9553,9544,
+9533,9510,9500,9488,9465,9454,9441,9418,
+9406,9393,9369,9356,9344,9320,9309,9300,
+9282,9273,9264,9248,9241,9234,9221,9215,
+9210,9197,9189,9180,9165,9157,9150,9135,
+9129,9122,9110,9104,9098,9086,9080,9074,
+9062,9057,9052,9042,9037,9032,9022,9018,
+9013,9002,8996,8991,8980,8975,8972,8968,
+8966,8964,8960,8960,8960,8961,8961,8962,
+8963,8964,8965,8969,8971,8972,8976,8979,
+8981,8985,8987,8989,8987,8984,8980,8972,
+8968,8965,8957,8953,8949,8940,8936,8932,
+8925,8923,8919,8912,8908,8907,8908,8908,
+8909,8910,8910,8915,8924,8928,8933,8941,
+8946,8951,8960,8965,8968,8977,8982,8987,
+8997,9002,9007,9015,9017,9020,9024,9027,
+9029,9033,9035,9037,9040,9042,9044,9041,
+9039,9037,9033,9031,9029,9027,9026,9024,
+9022,9022,9022,9023,9023,9024,9025,9025,
+9027,9029,9030,9032,9035,9037,9039,9043,
+9045,9047,9052,9064,9078,9103,9118,9132,
+9163,9181,9199,9237,9256,9275,9305,9316,
+9328,9350,9362,9375,9402,9416,9429,9459,
+9473,9489,9526,9545,9563,9602,9621,9640,
+9681,9702,9734,9782,9802,9825,9869,9890,
+9913,9956,9978,10001,10054,10081,10115,10158,
+10183,10212,10277,10316,10357,10340,10357,10380,
+10412,10427,10442,10474,10489,10486,10520,10531,
+10540,10521,10525,10528,10533,10541,10548,10559,
+10568,10515,10515,10516,10512,10517,10506,10485,
+10467,10461,10462,10468,10471,10473,10480,10487,
+10497,10686,10700,10718,10753,10756,10757,10757,
+10758,10758,10758,10756,10752,10750,10749,10746,
+11062,11048,11051,11059,11063,11068,11075,11096,
+11113,11109,11117,11125,11109,11114,11080,11073,
+11072,11069,11058,11051,11046,11036,11031,11020,
+11000,10988,10977,10957,10948,10939,10924,10918,
+10909,10894,10886,10882,10875,10883,10894,10876,
+10886,10866,10869,10849,10850,10826,10829,10840,
+10841,10852,10864,10872,10868,10861,10857,10852,
+10847,10843,10866,10877,10888,10884,10894,10915,
+10920,10927,10944,10949,10955,10964,10962,10965,
+10971,10974,10975,10968,10970,10965,10969,10973,
+10954,10958,10963,10960,10943,10946,10948,10956,
+10953,10925,10924,10924,10924,10929,10901,10900,
+10877,10875,10862,10854,10852,10851,10843,10843,
+10845,10847,10849,10842,10853,10853,10854,10852,
+10844,10844,10839,10833,10832,10829,10829,10828,
+10829,10828,10829,10830,10831,10699,10709,10714,
+10718,10727,10729,10731,10735,10735,10735,10742,
+10746,10749,10757,10761,10765,10778,10786,10794,
+10808,10816,10823,10826,10825,10827,10829,10831,
+10824,10801,10790,10778,10757,10745,10735,10718,
+10709,10700,10681,10674,10666,10650,10641,10632,
+10613,10598,10584,10553,10537,10521,10488,10470,
+10453,10416,10397,10379,10325,10291,10257,10187,
+10152,10117,10047,10012,9981,9919,9887,9857,
+9804,9778,9752,9698,9671,9649,9616,9598,
+9582,9549,9534,9528,9520,9661,9659,9657,
+9655,9654,9651,9650,9650,9648,9647,9646,
+9644,9644,9643,9641,9637,9634,9628,9625,
+9623,9475,9475,9475,9476,9476,9477,9478,
+9478,9478,9480,9481,9483,9492,9497,9502,
+9513,9519,9528,9554,9567,9581,9608,9622,
+9632,9653,9663,9674,9695,9704,9712,9727,
+9735,9743,9757,9759,9760,9762,9763,9769,
+9779,9783,9787,9795,9799,9801,9818,9832,
+9845,9871,9883,9896,9921,9932,9944,9966,
+9978,9989,10010,10021,10031,10051,10061,10069,
+10082,10088,10093,10105,10110,10112,10114,10115,
+10117,10118,10120,10121,10124,10126,10127,10129,
+10131,10132,10134,10135,10136,10140,10144,10148,
+10156,10160,10163,10172,10175,10179,10188,10192,
+10197,10208,10215,10220,10233,10239,10245,10247,
+10248,10249,10250,10251,10246,10226,10216,10207,
+10187,10176,10166,10142,10131,10119,10095,10083,
+10070,10044,10030,10016,9990,9977,9965,9940,
+9928,9916,9890,9879,9866,9840,9829,9816,
+9794,9784,9774,9755,9745,9735,9718,9711,
+9703,9687,9680,9674,9671,9670,9669,9667,
+9667,9665,9660,9658,9655,9652,9650,9645,
+9636,9632,9630,9623,9621,9620,9619,9619,
+9619,9620,9621,9623,9628,9631,9633,9637,
+9637,9637,9636,9636,9637,9638,9639,9640,
+9643,9644,9645,9657,9665,9672,9685,9693,
+9700,9711,9716,9721,9731,9736,9740,9744,
+9745,9747,9749,9749,9751,9753,9754,9754,
+9753,9752,9752,9751,9749,9747,9742,9739,
+9736,9728,9723,9718,9708,9702,9696,9682,
+9675,9668,9646,9633,9620,9592,9578,9564,
+9535,9521,9507,9476,9461,9446,9420,9406,
+9393,9366,9352,9339,9311,9298,9283,9256,
+9242,9227,9200,9185,9172,9144,9132,9122,
+9100,9090,9081,9061,9053,9046,9031,9025,
+9018,9005,8995,8986,8969,8962,8954,8938,
+8931,8924,8910,8904,8897,8884,8878,8872,
+8860,8854,8848,8837,8831,8825,8815,8809,
+8804,8792,8785,8779,8766,8761,8757,8753,
+8750,8747,8743,8742,8742,8742,8742,8742,
+8744,8745,8747,8751,8753,8755,8758,8760,
+8763,8768,8770,8773,8772,8768,8765,8757,
+8754,8750,8744,8740,8737,8730,8727,8723,
+8719,8716,8715,8710,8708,8708,8713,8715,
+8716,8721,8724,8731,8747,8755,8762,8778,
+8787,8795,8811,8820,8829,8846,8855,8864,
+8882,8891,8901,8919,8925,8933,8949,8956,
+8964,8978,8985,8993,9007,9014,9021,9029,
+9032,9036,9041,9044,9048,9054,9057,9060,
+9066,9069,9073,9081,9084,9088,9096,9100,
+9104,9114,9117,9121,9129,9133,9137,9146,
+9152,9155,9166,9179,9195,9228,9273,9287,
+9325,9355,9387,9428,9435,9454,9523,9572,
+9594,9610,9659,9668,9684,9597,9614,9651,
+9670,9689,9734,9757,9779,9824,9847,9872,
+9921,9945,9968,10016,10039,10067,10112,10135,
+10159,10204,10229,10252,10298,10319,10341,10383,
+10406,10429,10471,10493,10512,10548,10560,10572,
+10595,10607,10618,10636,10645,10653,10678,10709,
+10718,10748,10730,10737,10727,10733,10710,10729,
+10749,10744,10727,10732,10704,10693,10688,10683,
+10698,10696,10702,10690,10700,10715,10739,10749,
+10769,10951,10968,10987,11004,11010,11016,11025,
+11029,11034,11040,11051,11065,11062,11065,11058,
+11527,11540,11554,11598,11613,11620,11618,11614,
+11609,11610,11573,11584,11525,11511,11508,11499,
+11494,11486,11466,11458,11445,11429,11425,11415,
+11383,11372,11359,11333,11317,11306,11281,11271,
+11260,11237,11227,11218,11204,11201,11208,11246,
+11256,11257,11256,11272,11285,11300,11294,11280,
+11272,11287,11287,11344,11350,11355,11363,11375,
+11376,11394,11403,11410,11419,11424,11435,11442,
+11452,11463,11481,11490,11491,11493,11496,11495,
+11497,11492,11486,11480,11475,11469,11460,11447,
+11443,11432,11427,11422,11411,11407,11393,11392,
+11388,11383,11375,11370,11348,11341,11340,11339,
+11322,11325,11299,11308,11299,11283,11285,11296,
+11283,11247,11249,11250,11251,11252,11253,11253,
+11254,11254,11256,11256,11256,11256,11259,11262,
+11266,11268,11271,11284,11295,11174,11174,11178,
+11185,11199,11205,11212,11224,11231,11215,11221,
+11223,11225,11227,11228,11230,11237,11242,11249,
+11257,11263,11267,11267,11266,11265,11261,11259,
+11253,11224,11210,11193,11164,11150,11139,11117,
+11105,11093,11070,11059,11049,11030,11019,11008,
+10986,10970,10954,10920,10903,10885,10850,10832,
+10813,10774,10756,10736,10683,10650,10616,10549,
+10516,10484,10420,10390,10363,10307,10279,10253,
+10207,10184,10162,10118,10095,10078,10051,10038,
+10025,9999,9987,9984,9980,10110,10109,10109,
+10109,10109,10108,10108,10107,10105,10104,10103,
+10100,10099,10098,10093,10089,10083,10074,10069,
+10064,9925,9923,9920,9915,9912,9910,9904,
+9901,9898,9893,9890,9889,9891,9892,9893,
+9897,9900,9906,9924,9933,9943,9963,9973,
+9980,9994,10001,10008,10024,10030,10035,10045,
+10049,10054,10064,10064,10062,10059,10057,10059,
+10065,10067,10069,10073,10075,10077,10091,10103,
+10116,10140,10152,10164,10188,10200,10212,10235,
+10247,10257,10281,10292,10302,10324,10335,10343,
+10358,10364,10371,10382,10387,10390,10392,10393,
+10394,10394,10395,10395,10395,10394,10393,10391,
+10390,10388,10384,10382,10380,10375,10375,10374,
+10373,10372,10371,10369,10368,10367,10365,10365,
+10364,10366,10367,10368,10372,10374,10375,10369,
+10365,10362,10356,10354,10345,10319,10305,10293,
+10266,10254,10239,10211,10196,10182,10154,10138,
+10123,10091,10076,10060,10029,10014,10000,9970,
+9955,9940,9909,9894,9880,9848,9833,9816,
+9788,9775,9762,9736,9722,9709,9685,9674,
+9663,9640,9629,9619,9610,9606,9603,9595,
+9592,9589,9578,9573,9568,9559,9555,9549,
+9537,9532,9527,9518,9515,9513,9511,9511,
+9512,9513,9516,9518,9525,9528,9532,9539,
+9539,9540,9542,9543,9545,9548,9549,9551,
+9556,9558,9561,9574,9582,9590,9605,9612,
+9619,9630,9634,9639,9647,9651,9653,9653,
+9653,9652,9648,9646,9644,9640,9636,9633,
+9625,9620,9616,9605,9598,9592,9578,9570,
+9561,9544,9534,9524,9503,9492,9481,9458,
+9446,9434,9405,9387,9371,9336,9318,9300,
+9265,9249,9231,9198,9180,9164,9135,9122,
+9108,9081,9068,9054,9028,9015,9003,8979,
+8966,8955,8931,8921,8909,8887,8879,8872,
+8857,8851,8844,8834,8829,8826,8819,8816,
+8813,8807,8801,8796,8786,8781,8776,8767,
+8762,8758,8749,8745,8741,8731,8725,8720,
+8711,8706,8701,8690,8684,8678,8668,8663,
+8656,8642,8634,8628,8614,8608,8603,8595,
+8591,8589,8582,8580,8579,8578,8577,8577,
+8577,8578,8580,8583,8585,8587,8590,8593,
+8595,8602,8604,8607,8607,8604,8600,8592,
+8590,8586,8579,8575,8572,8566,8562,8560,
+8556,8554,8552,8549,8547,8548,8554,8558,
+8562,8570,8574,8584,8603,8614,8625,8646,
+8658,8671,8697,8711,8725,8755,8770,8786,
+8818,8835,8851,8883,8899,8915,8946,8963,
+8980,9013,9029,9046,9079,9095,9112,9136,
+9148,9160,9179,9189,9198,9215,9223,9231,
+9244,9250,9254,9258,9287,9295,9332,9277,
+9280,9284,9287,9290,9383,9373,9356,9313,
+9318,9323,9362,9384,9412,9407,9425,9445,
+9487,9511,9536,9587,9733,9747,9823,9840,
+9875,9902,9923,9931,9973,9977,9948,10000,
+10075,10082,10077,10112,10215,10287,10313,10320,
+10358,10378,10388,10398,10424,10393,10433,10454,
+10476,10513,10532,10550,10586,10604,10624,10657,
+10674,10692,10729,10746,10762,10837,10865,10917,
+10901,10868,10945,10970,10995,10944,10994,10934,
+10941,10954,10963,10970,10977,10973,10979,10992,
+10996,11020,11018,11049,11056,11105,11105,11097,
+11100,11101,11120,11137,11143,11163,11170,11206,
+11225,11384,11398,11413,11470,11467,11470,11485,
+11484,11496,11544,11544,11547,11529,11510,11522,
+12590,12598,12622,12819,12854,12893,12954,12955,
+12951,12867,12700,12739,12767,12775,12659,12665,
+12667,12666,12658,12653,12648,12639,12634,12627,
+12612,12607,12601,12593,12589,12581,12570,12565,
+12543,12504,12539,12618,12802,12884,12918,12985,
+13017,13047,13061,13035,13071,13199,13226,13255,
+13310,13344,13379,13458,13498,13514,13536,13550,
+13571,13632,13668,13675,13558,13465,13225,13225,
+13223,13216,13207,13247,13261,13425,13400,13353,
+13199,13034,13001,13154,13153,13123,13007,12849,
+12846,12663,12641,12623,12590,12576,12574,12676,
+12727,12846,12827,12767,12662,12501,12499,12499,
+12507,12516,12532,12598,12614,12629,12657,12615,
+12763,12769,12769,12764,12757,12754,12750,12732,
+12720,12706,12670,12658,12640,12589,12565,12527,
+12477,12458,12444,12372,12351,12336,12299,12155,
+12117,12062,12053,11998,11968,11955,11956,11971,
+11957,11931,11931,11928,11872,11873,11884,11895,
+11916,11932,11910,11938,11897,11903,11919,11926,
+11925,11915,11906,11898,11885,11880,11879,11875,
+11871,11870,11863,11842,11832,11823,11817,11812,
+11798,11785,11769,11737,11723,11710,11686,11673,
+11658,11635,11623,11612,11574,11547,11522,11473,
+11453,11439,11414,11403,11393,11377,11369,11362,
+11358,11357,11356,11354,11353,11356,11373,11380,
+11386,11398,11405,11537,11566,11579,11591,11613,
+11621,11627,11632,11633,11632,11627,11622,11615,
+11597,11587,11575,11546,11526,11506,11464,11440,
+11418,11371,11347,11323,11162,11140,11120,11081,
+11062,11044,11010,10996,10982,10965,10959,10953,
+10946,10944,10947,10965,10976,10987,11011,11023,
+11032,11049,11057,11066,11083,11089,11092,11098,
+11100,11102,11102,11094,11085,11064,11052,11041,
+11012,10997,10981,10957,10945,10932,10918,10917,
+10915,10912,10911,10911,10910,10911,10912,10916,
+10919,10923,10932,10938,10945,10961,10969,10977,
+10990,10998,11006,11023,11032,11037,11046,11050,
+11055,11064,11069,11074,11083,11086,11089,11093,
+11095,11101,11104,11104,11105,11106,11109,11113,
+11117,11118,11118,11115,11112,11108,11097,11090,
+11084,11071,11064,11057,11042,11034,11024,10994,
+10979,10964,10936,10923,10902,10848,10822,10796,
+10744,10717,10690,10633,10606,10579,10522,10491,
+10460,10400,10377,10348,10295,10271,10245,10196,
+10172,10147,10096,10071,10047,9995,9968,9943,
+9895,9874,9853,9811,9789,9776,9727,9721,
+9696,9661,9643,9627,9608,9601,9595,9587,
+9583,9578,9568,9559,9546,9535,9523,9513,
+9498,9483,9475,9459,9459,9462,9444,9438,
+9428,9419,9417,9417,9421,9424,9428,9427,
+9422,9420,9417,9415,9412,9413,9412,9412,
+9410,9410,9410,9421,9427,9434,9447,9453,
+9458,9465,9468,9471,9475,9476,9475,9470,
+9466,9463,9453,9447,9443,9432,9425,9419,
+9403,9395,9386,9369,9358,9347,9323,9310,
+9297,9266,9251,9234,9200,9182,9164,9126,
+9106,9088,9043,9017,8993,8942,8918,8892,
+8845,8822,8799,8755,8732,8712,8677,8661,
+8645,8616,8602,8589,8563,8550,8540,8519,
+8509,8501,8484,8476,8469,8456,8452,8449,
+8446,8445,8444,8443,8445,8446,8451,8453,
+8455,8458,8456,8454,8450,8447,8445,8440,
+8437,8434,8428,8425,8423,8413,8408,8402,
+8392,8386,8382,8369,8362,8356,8343,8337,
+8330,8312,8303,8295,8279,8271,8266,8258,
+8256,8253,8248,8246,8247,8250,8252,8254,
+8258,8262,8266,8275,8280,8285,8296,8301,
+8307,8321,8327,8334,8340,8337,8337,8330,
+8328,8326,8323,8322,8321,8317,8316,8313,
+8312,8311,8310,8309,8309,8311,8376,8360,
+8344,8374,8358,8363,8407,8408,8419,8455,
+8467,8484,8520,8566,8589,8631,8652,8674,
+8722,8749,8776,8838,8869,9106,9151,9108,
+9026,9191,9207,9330,9532,9551,9569,9628,
+9648,9686,9711,9736,9751,9848,9862,9837,
+9568,9579,9584,9594,9597,9597,9593,9591,
+9590,9588,9590,9590,9595,9600,9604,9618,
+9628,9637,9663,9688,9715,9846,9802,9834,
+9905,9944,9984,10069,10114,10161,10249,10286,
+10326,10406,10449,10493,10728,10799,10842,10919,
+10969,11003,11086,11117,11128,11059,10930,10945,
+10970,10980,10988,11001,11008,11016,11033,11042,
+11053,11081,11098,11119,11163,11189,11215,11272,
+11299,11330,11394,11428,11464,11624,11791,11814,
+11777,11763,11806,11924,11940,12063,12111,12132,
+12151,12193,12212,12229,12254,12263,12275,12285,
+12287,12288,12283,12278,12275,12279,12270,12258,
+12212,12189,12166,12066,12002,12003,11952,12088,
+12101,12175,12227,12240,12312,12283,12255,12346,
+12348,12310,12325,12418,12458,12460,12476,12541,
+13435,13498,13559,13677,13733,13786,13876,13915,
+13944,13844,13815,13881,13922,14039,14198,14326,
+14346,14361,14398,14391,14180,13948,13678,13702,
+13777,13538,13532,13530,13526,13521,13516,13511,
+13487,13473,13508,13556,13658,13705,13797,14228,
+14178,14214,14145,14267,14388,14442,14465,14487,
+14523,14543,14572,14572,14581,14592,14622,14627,
+14607,14572,14580,14592,14522,14392,14247,13623,
+13592,13560,13489,13480,13441,13326,13368,13340,
+13555,13584,13191,13102,13062,13026,12937,12903,
+12883,12854,12847,12842,12844,12864,12904,13370,
+13656,13686,13757,13799,13838,13890,13666,13529,
+13170,13168,13228,13048,13068,13090,13136,13156,
+13174,13206,13220,13573,13597,13598,13596,13572,
+13559,13547,13502,13460,13432,13345,13319,13276,
+13190,13146,13080,12846,12674,12660,12603,12570,
+12408,12342,12312,12286,12225,12200,12175,12130,
+12109,12092,12066,12056,12100,12154,12145,12119,
+12129,12103,12115,12139,12156,12172,12203,12234,
+12250,12300,12306,12317,12325,12339,12354,12363,
+12375,12391,12396,12409,12424,12425,12434,12440,
+12451,12446,12440,12425,12416,12405,12377,12362,
+12344,12317,12305,12297,12255,12228,12202,12151,
+12128,12113,12090,12081,12072,12061,12057,12055,
+12061,12065,12071,12085,12089,12102,12139,12159,
+12177,12332,12351,12382,12440,12466,12493,12542,
+12562,12579,12605,12615,12622,12627,12625,12620,
+12601,12588,12572,12530,12502,12471,12405,12370,
+12332,12254,12213,12172,11987,11948,11909,11832,
+11796,11759,11692,11660,11631,11584,11563,11545,
+11514,11502,11496,11501,11506,11512,11531,11541,
+11549,11566,11576,11586,11607,11616,11622,11632,
+11637,11641,11646,11639,11630,11607,11594,11581,
+11548,11527,11505,11464,11445,11425,11395,11385,
+11375,11352,11340,11329,11305,11294,11283,11262,
+11253,11244,11229,11223,11218,11212,11210,11207,
+11200,11199,11198,11201,11203,11202,11200,11201,
+11202,11207,11211,11215,11225,11230,11234,11243,
+11247,11251,11255,11256,11255,11258,11263,11275,
+11289,11299,11308,11322,11331,11340,11347,11349,
+11349,11350,11350,11346,11338,11332,11325,11297,
+11283,11269,11244,11234,11215,11163,11140,11121,
+11076,11037,11018,10981,10971,10941,10882,10847,
+10812,10745,10711,10674,10602,10567,10532,10426,
+10386,10345,10261,10217,10177,10099,10062,10025,
+9962,9938,9923,9853,9834,9798,9741,9726,
+9685,9648,9629,9612,9594,9592,9591,9590,
+9590,9593,9588,9585,9584,9580,9579,9578,
+9564,9561,9577,9572,9577,9574,9556,9514,
+9487,9456,9446,9438,9420,9418,9440,9374,
+9359,9357,9360,9358,9357,9350,9344,9340,
+9337,9336,9336,9347,9355,9364,9378,9384,
+9390,9398,9401,9404,9408,9409,9408,9400,
+9395,9389,9377,9369,9363,9348,9340,9332,
+9312,9302,9293,9270,9257,9243,9215,9198,
+9181,9145,9127,9107,9066,9045,9023,8979,
+8957,8934,8883,8856,8829,8773,8746,8718,
+8669,8644,8620,8574,8551,8531,8499,8483,
+8469,8444,8431,8421,8400,8390,8382,8367,
+8360,8353,8342,8338,8334,8326,8325,8326,
+8328,8329,8331,8334,8338,8341,8350,8354,
+8358,8363,8363,8362,8361,8360,8359,8357,
+8356,8354,8352,8351,8350,8344,8342,8340,
+8334,8332,8329,8322,8319,8315,8308,8305,
+8300,8289,8283,8277,8264,8259,8257,8252,
+8250,8247,8243,8242,8243,8245,8247,8248,
+8251,8254,8257,8263,8266,8269,8276,8281,
+8285,8294,8299,8303,8304,8300,8297,8289,
+8286,8283,8280,8280,8279,8279,8280,8281,
+8291,8296,8302,8315,8322,8332,8355,8367,
+8378,8397,8406,8573,8451,8464,8476,8612,
+8649,8531,8561,8577,8594,8631,8650,8671,
+8715,8740,8765,8818,8843,8870,8927,8958,
+9068,9054,9088,9123,9482,9486,9569,9659,
+9720,9750,9849,9888,9897,9987,10026,10034,
+10044,10058,10053,10067,10044,10046,10073,10085,
+10054,9916,9831,9756,9757,9791,9981,9919,
+9841,9796,9823,9850,9881,9970,10008,10112,
+10335,10393,10447,10533,10588,10643,10748,10794,
+10828,10913,10960,11009,11108,11154,11198,11284,
+11329,11370,11444,11435,11431,11310,11163,11169,
+11183,11190,11192,11199,11203,11210,11229,11240,
+11255,11291,11317,11345,11414,11450,11489,11579,
+11625,11671,11882,12048,12116,12244,12297,12355,
+12485,12550,12615,12726,12775,12817,12840,12838,
+12816,12768,12832,12690,12710,12709,12703,12689,
+12676,12674,12634,12610,12577,12497,12459,12422,
+12356,12332,12320,12307,12303,12300,12410,12415,
+12424,12448,12462,12476,12512,12552,12569,12656,
+12715,12808,12970,13021,13082,13202,13260,13317,
+13892,13826,13880,14008,14059,14186,14517,14603,
+14629,14392,14337,14262,14161,14226,14070,13919,
+13898,13868,13802,13776,13757,13747,13789,13913,
+14396,14640,14764,14924,14625,14376,14070,13747,
+13747,13822,13859,13669,13802,13893,13995,14587,
+14898,14989,15053,15092,15125,15175,15215,15225,
+15264,15279,15288,15271,15243,15206,15084,14766,
+14434,13712,13613,13520,13384,13335,13280,13174,
+13132,13099,13141,13111,13074,13000,12964,12932,
+12878,12848,12812,12839,12831,12794,13751,13829,
+13925,14078,14133,14198,14319,14360,14385,14462,
+14497,14528,14562,14557,14540,14473,14435,13361,
+13135,14076,13963,13882,13857,13844,13847,13842,
+13842,13861,13870,13879,13913,13926,13947,14003,
+14026,14057,13966,13947,13921,13880,13886,13877,
+13887,13792,13659,13107,13084,13000,12938,12903,
+12871,12665,12637,12608,12557,12530,12506,12804,
+12818,12755,12496,12387,12445,12730,12764,12779,
+12655,12481,12475,12494,12507,12521,12580,12607,
+12603,12745,12766,12749,12796,12825,12824,12867,
+12891,12921,12946,12970,12986,13015,13033,13050,
+13062,13050,13051,13033,13025,12993,12959,12937,
+12916,12870,12847,12824,12753,12706,12660,12570,
+12526,12491,12431,12404,12378,12331,12309,12290,
+12270,12263,12259,12253,12255,12267,12313,12341,
+12508,12575,12614,12668,12785,12842,12904,13023,
+13084,13138,13243,13292,13337,13415,13445,13471,
+13507,13518,13524,13517,13502,13481,13426,13392,
+13355,13267,13219,13169,13061,12918,12862,12751,
+12694,12638,12528,12475,12424,12331,12288,12247,
+12171,12136,12109,12071,12056,12044,12026,12020,
+12012,12000,11996,11994,11994,11993,11991,11988,
+11988,11989,11989,11979,11968,11946,11935,11924,
+11896,11878,11859,11820,11804,11790,11770,11766,
+11760,11747,11739,11730,11709,11698,11686,11663,
+11650,11638,11614,11602,11590,11571,11562,11551,
+11528,11517,11508,11496,11490,11481,11465,11459,
+11454,11447,11447,11447,11450,11452,11454,11459,
+11462,11464,11465,11465,11465,11464,11468,11473,
+11481,11484,11486,11504,11512,11522,11541,11549,
+11556,11573,11583,11590,11597,11595,11591,11568,
+11548,11525,11484,11480,11441,11380,11366,11317,
+11275,11257,11245,11236,11237,11202,11194,11151,
+11126,11041,11003,10962,10872,10823,10785,10687,
+10636,10587,10484,10430,10382,10274,10224,10172,
+10068,10036,9993,9930,9893,9852,9770,9743,
+9738,9693,9655,9648,9650,9644,9638,9641,
+9657,9685,9708,9698,9718,9743,9743,9734,
+9727,9715,9723,9746,9728,9731,9726,9692,
+9659,9613,9594,9577,9563,9517,9489,9385,
+9337,9320,9289,9287,9307,9289,9276,9281,
+9292,9297,9301,9326,9339,9351,9375,9393,
+9409,9403,9417,9441,9527,9519,9530,9511,
+9495,9477,9437,9416,9396,9353,9333,9293,
+9239,9225,9205,9159,9135,9112,9070,9049,
+9028,8981,8958,8934,8887,8863,8839,8790,
+8765,8741,8687,8658,8629,8570,8542,8513,
+8463,8439,8416,8372,8350,8331,8303,8292,
+8281,8261,8253,8245,8230,8224,8219,8211,
+8207,8204,8198,8196,8193,8189,8190,8193,
+8197,8200,8202,8206,8209,8213,8219,8222,
+8226,8229,8227,8225,8222,8220,8218,8215,
+8214,8213,8210,8210,8209,8206,8205,8204,
+8203,8202,8202,8199,8198,8197,8195,8193,
+8191,8183,8178,8174,8166,8161,8160,8159,
+8157,8156,8155,8155,8157,8162,8165,8168,
+8174,8177,8182,8192,8197,8202,8213,8218,
+8224,8236,8242,8248,8251,8247,8242,8234,
+8230,8227,8222,8220,8220,8220,8220,8221,
+8229,8235,8241,8262,8273,8289,8326,8347,
+8367,8407,8426,8451,8499,8521,8543,8962,
+8606,8624,8996,9061,9190,8732,8747,8760,
+8790,8805,8821,8855,8872,8890,8931,8956,
+8981,9036,9065,9095,9162,9197,9233,9304,
+9343,9382,9459,9499,9542,9997,10017,10053,
+10120,10160,10188,10231,10237,10259,10327,10343,
+10342,10235,10159,10063,10295,10282,10261,10155,
+10023,9995,10009,10030,10055,10110,10141,10249,
+10378,10488,10549,10660,10733,10793,10832,10831,
+10851,10856,11110,11158,11255,11305,11351,11448,
+11502,11551,11606,11613,11579,11530,11443,11349,
+11369,11379,11391,11414,11429,11446,11486,11508,
+11532,11585,11614,11646,11751,11800,11851,11955,
+12008,12064,12177,12236,12296,12416,12471,12528,
+12834,13038,13089,13205,13263,13323,13432,13477,
+13517,13584,13603,13578,13415,13463,13345,13120,
+13090,13064,13000,12972,12941,12973,12964,12970,
+12805,12797,12801,12820,12830,12842,12995,13014,
+13039,13090,13117,13174,13372,13402,13438,13499,
+13498,13479,13824,13903,14065,13993,13980,13967,
+13191,13191,13187,13173,13162,13149,13117,13098,
+13080,13075,13070,13131,13119,13119,13189,14242,
+14468,14656,14859,14990,15111,15331,15436,15541,
+15751,15855,15962,16212,16301,16342,16114,16083,
+15942,15390,15169,15038,15299,15499,16019,16255,
+16612,16640,16862,16947,17027,17301,17421,17572,
+17819,17839,17876,17983,18014,18019,18061,17998,
+17982,18028,17974,17968,18009,17946,17816,17659,
+17605,17565,17429,17371,17210,16933,16786,16563,
+16325,16257,16198,16261,15677,15562,15367,15268,
+15215,15131,15083,15044,15977,16062,16154,16330,
+16429,16470,16382,16034,16268,15201,15735,15947,
+16040,15925,15906,15903,15918,15906,15910,15856,
+16012,15143,15239,15158,14135,13603,13409,13322,
+13489,13559,13847,13892,13942,14022,14081,14146,
+14283,14356,14433,14584,14707,14823,14844,14835,
+14782,14694,14473,14451,14419,14409,14395,14379,
+14387,14391,14425,14431,14472,14447,13674,13515,
+14284,14266,14279,14299,13523,13786,14020,13988,
+13970,13930,13931,13897,13949,13527,13279,13260,
+13248,13243,13241,13241,13240,13207,13213,13446,
+13491,13503,13498,13554,13497,13531,13399,13575,
+13399,13422,13524,13544,13549,13492,13474,13460,
+13440,13381,13361,13346,13314,13246,13215,13190,
+13127,13087,13044,12935,12882,12829,12864,12818,
+12770,12668,12626,12603,12573,12569,12571,12594,
+12615,12638,12708,12753,12803,12915,12972,13031,
+13144,13198,13249,13335,13362,13385,13417,13426,
+13431,13426,13417,13404,13368,13346,13213,13171,
+13149,13127,13082,13059,13039,13008,12995,12982,
+12960,12949,12945,12951,12954,12957,12961,12961,
+12956,12941,12932,12923,12901,12886,12868,12829,
+12810,12791,12753,12722,12690,12630,12601,12575,
+12525,12499,12473,12429,12411,12394,12403,12419,
+12434,12466,12482,12497,12521,12531,12539,12549,
+12551,12550,12544,12537,12529,12507,12494,12477,
+12434,12412,12389,12344,12322,12295,12239,12213,
+12188,12142,12121,12102,12067,12050,12036,12007,
+11994,11980,11953,11938,11924,11897,11888,11880,
+11859,11848,11840,11826,11819,11809,11795,11797,
+11788,11774,11769,11763,11750,11751,11746,11735,
+11732,11747,11706,11677,11628,11544,11514,11499,
+11493,11478,11440,11385,11276,11276,11189,11159,
+11152,11198,11176,11182,11110,11066,11042,10961,
+10914,10872,10787,10740,10693,10593,10546,10485,
+10329,10293,10257,10227,10202,10188,10148,10132,
+10137,10088,10060,10011,9995,10028,10018,10017,
+9988,9953,9965,9975,9992,10038,10036,10013,
+9874,9879,9854,9883,9871,9883,9892,9904,
+9916,9932,9935,9923,9865,9912,9919,9911,
+9899,9895,9844,9805,9798,9815,9786,9769,
+9804,9772,9755,9818,9836,9873,9947,9943,
+9934,9879,9862,9829,9756,9702,9651,9555,
+9500,9439,9333,9273,9224,9132,9097,9053,
+9003,8982,8959,8910,8885,8859,8801,8772,
+8746,8698,8675,8655,8613,8591,8570,8527,
+8505,8482,8426,8394,8362,8300,8269,8242,
+8186,8160,8138,8090,8067,8046,8013,7999,
+7984,7958,7944,7932,7909,7897,7884,7862,
+7850,7840,7826,7817,7811,7798,7795,7794,
+7792,7791,7789,7787,7789,7791,7794,7796,
+7799,7801,7799,7798,7796,7796,7798,7800,
+7803,7805,7813,7818,7823,7830,7833,7836,
+7840,7842,7844,7842,7840,7838,7829,7822,
+7814,7792,7779,7765,7737,7723,7714,7696,
+7687,7679,7666,7662,7661,7665,7668,7673,
+7686,7695,7707,7734,7750,7767,7805,7826,
+7847,7890,7913,7934,7965,7972,7980,7994,
+8000,8006,8014,8019,8023,8031,8035,8040,
+8053,8062,8072,8089,8102,8124,8175,8202,
+8233,8296,8333,8375,8465,8509,8555,9273,
+8632,8672,8748,8785,8820,8885,8919,8947,
+9270,9104,9152,9108,9126,9142,9273,9847,
+10056,9282,9312,9396,10079,9720,10058,10287,
+9550,9575,9629,9655,9681,10056,10121,10044,
+10022,10330,10299,10071,9938,9961,10005,10026,
+10047,10083,10101,10119,10156,10175,10197,10247,
+10276,10306,10371,10417,10465,10564,10811,10853,
+10951,10989,11021,11092,11053,10994,11072,11071,
+11090,11128,11184,11194,11225,11253,11282,11394,
+11411,11408,11442,11474,11508,11689,11673,11652,
+11737,11783,11829,12158,12163,12090,12112,12159,
+12207,12367,12339,12382,12466,12506,12549,12880,
+12910,12906,12802,12850,12897,12991,13029,13066,
+13143,13184,13225,13314,13361,13412,13987,14187,
+14468,14697,13902,14012,14132,14475,14279,13979,
+14090,13812,13806,13796,13774,13712,13668,13630,
+13565,13536,13529,13606,13861,14361,14791,14979,
+14981,14799,14735,14648,14377,13973,13920,13772,
+13696,13616,13496,13417,13343,13252,13225,13207,
+15198,15090,14960,14709,13963,13845,14038,14132,
+14146,13975,13911,13892,14204,14237,14288,14461,
+14491,14535,14655,14678,14505,14504,14629,14755,
+15079,15282,15520,15894,16043,16229,16354,17222,
+17336,17526,17525,17525,17580,17625,17716,17939,
+18014,18078,18203,18233,18225,18307,18329,18040,
+18329,18068,18071,17500,17507,17559,17598,17590,
+17581,17594,17595,17598,17591,17580,17565,17516,
+17519,17482,17451,17421,17444,17437,17437,17429,
+17420,17395,17379,17452,17461,17419,17336,17273,
+17165,16921,16841,16801,16663,16635,17013,17130,
+17200,17216,17137,17026,16963,17217,17022,16963,
+16905,16910,16965,17117,17108,17109,17127,17092,
+17058,16947,16909,16821,16706,16681,16217,15337,
+15049,14973,15718,15753,15321,15416,15672,15581,
+15610,15636,15672,15474,15396,15374,15311,15299,
+15280,15295,15346,15455,15613,15453,15372,15187,
+15157,15116,15047,15040,15041,15089,15054,15093,
+13601,13643,13686,14995,13941,13778,14734,14840,
+14876,14868,13847,13831,14577,13718,13675,14261,
+14131,13563,13935,13918,13844,13820,13784,13733,
+13728,13752,13830,13171,13204,13602,13622,13679,
+13738,13862,13819,13674,14051,13910,13967,14179,
+14023,14060,14144,14206,14313,14124,14119,14149,
+13996,13948,13891,13749,13679,13610,13584,13512,
+13436,13299,13228,13189,13132,13115,13103,13103,
+13101,13108,13134,13154,13179,13253,13288,13313,
+13382,13413,13441,13470,13473,13477,13467,13456,
+13442,13403,13380,13353,13300,13274,13251,13091,
+13070,13067,13072,13078,13089,13129,13151,13174,
+13216,13237,13263,13327,13355,13382,13426,13445,
+13455,13464,13465,13463,13452,13441,13424,13388,
+13369,13349,13306,13271,13234,13162,13128,13095,
+13031,12997,12965,12910,12884,12863,12859,12874,
+12889,12922,12937,12952,12978,12988,12996,13004,
+13003,13000,12982,12969,12954,12916,12893,12865,
+12799,12765,12730,12661,12626,12586,12506,12468,
+12432,12367,12337,12310,12261,12241,12221,12185,
+12170,12154,12125,12109,12094,12067,12059,12049,
+12028,12014,12001,11973,11962,11951,11928,11917,
+11908,11902,11893,11885,11882,11861,11840,11798,
+11781,11757,11751,11767,11757,11723,11694,11657,
+11576,11544,11517,11520,11498,11479,11378,11343,
+11308,11267,11257,11214,11129,11083,11041,10962,
+10925,10882,10792,10746,10700,10627,10617,10574,
+10490,10453,10420,10345,10310,10281,10233,10211,
+10190,10137,10092,10063,10098,10081,10137,10139,
+10126,10082,10042,10015,9990,9993,10017,10019,
+10004,10001,9997,9952,9916,9871,9923,9973,
+10001,10036,10047,10022,10077,10103,10121,10145,
+10144,10135,9999,10074,10103,10127,10122,10121,
+10110,10150,10108,10115,10117,10125,10129,10104,
+10086,9972,9940,9874,9722,9671,9594,9447,
+9354,9308,9186,9137,9101,9040,9013,8988,
+8993,8978,8962,8914,8883,8853,8787,8748,
+8711,8643,8615,8588,8530,8498,8467,8407,
+8376,8343,8266,8222,8184,8153,8088,8040,
+7972,7941,7913,7860,7833,7808,7777,7760,
+7746,7715,7703,7690,7664,7649,7634,7618,
+7609,7601,7587,7580,7573,7560,7558,7558,
+7557,7557,7557,7560,7560,7562,7568,7571,
+7575,7578,7576,7574,7572,7572,7573,7576,
+7578,7582,7591,7596,7603,7613,7618,7623,
+7632,7636,7641,7646,7648,7648,7647,7645,
+7640,7625,7616,7605,7583,7571,7564,7549,
+7543,7536,7524,7521,7521,7524,7527,7531,
+7542,7549,7558,7580,7591,7604,7632,7649,
+7666,7703,7723,7743,7772,7781,7789,7805,
+7814,7822,7841,7850,7860,7880,7888,7900,
+7959,7936,7951,7989,8011,8038,8105,8141,
+8178,8261,8442,8478,8447,8455,8497,8610,
+9006,9111,9132,9090,9011,9413,9557,9236,
+9028,9061,9723,9365,9218,9228,9271,9306,
+9346,9422,9449,10274,9568,9626,9716,9675,
+10693,9753,9822,9853,9882,9933,9954,9970,
+9986,9990,9992,9980,10081,9980,10373,10105,
+10022,10057,10140,10163,10569,10603,10273,10539,
+10682,10715,10816,10893,10980,10680,10746,10811,
+10938,11000,11055,11232,11317,11355,11255,11403,
+11420,11323,11310,11321,11344,11360,11507,11419,
+11440,11464,11677,11606,11613,11698,11746,11798,
+12199,11967,12031,12160,12227,12353,12426,12480,
+12540,12921,12913,12818,12812,12850,12888,12959,
+12996,13034,13216,13903,14085,13730,13666,13656,
+13403,13450,13504,13612,13677,13785,13930,14044,
+14228,14124,14195,14268,14384,14448,14522,14306,
+14256,14190,14044,13966,13878,13712,13631,13554,
+13407,13339,13299,13226,13383,13423,13539,13523,
+13507,13481,13483,13573,13765,13940,14711,14803,
+14897,14996,15164,15231,15286,15336,15327,15298,
+14686,14929,15569,16164,16254,16360,16504,16502,
+16487,16454,16370,16241,15764,15730,15737,15842,
+15929,16054,16453,16636,16925,17609,17800,17955,
+18211,18433,18552,18416,18451,18420,18281,18262,
+18200,18121,18186,18374,17766,17418,16904,16826,
+16815,16807,16849,17220,17260,17507,17573,17607,
+17664,17715,17756,17721,17722,17741,17577,17607,
+17629,17613,17573,17523,17422,17422,17360,17419,
+17436,17453,17441,17418,17381,17262,17204,17140,
+17052,17033,17023,17007,16997,16992,17016,17004,
+16993,16962,16962,16968,17028,17151,17178,17343,
+17447,17525,17519,17485,17464,17446,17437,17644,
+17294,17191,17139,17019,17204,16988,17189,17009,
+17196,17146,17127,17090,17047,16952,16967,16888,
+16929,16973,16943,16895,16842,16723,16664,16761,
+16713,16715,16712,16650,16632,16615,16580,16529,
+16472,16397,16364,16265,16266,16252,16245,16247,
+16248,16234,16005,15841,15680,15414,13661,13671,
+15107,15257,15343,13799,13830,13871,15144,15267,
+15588,13978,13985,15305,13920,14980,14992,14820,
+14745,14686,14557,14483,14426,14156,14109,14087,
+14136,14204,14378,13280,13303,13328,13438,13512,
+13556,13837,14472,14553,14047,14106,14251,14535,
+14612,14708,14715,14744,14796,14727,14688,14685,
+14579,14521,14497,14313,14202,14096,14154,13769,
+13691,13737,13723,13680,13621,13628,13625,13662,
+13553,13604,13675,13768,13752,13909,13925,13990,
+14113,14177,14224,14293,14316,14340,14424,14395,
+14405,14500,14539,14534,14570,14458,14388,14459,
+14367,14379,14347,14332,14316,14292,14268,14245,
+14185,14153,14124,14071,14040,14010,13965,13941,
+13917,13871,13848,13827,13788,13767,13744,13698,
+13676,13657,13624,13594,13567,13518,13497,13478,
+13443,13423,13404,13371,13356,13342,13344,13359,
+13374,13401,13413,13424,13439,13444,13446,13442,
+13435,13426,13398,13381,13359,13307,13278,13244,
+13164,13122,13080,12995,12951,12903,12808,12763,
+12720,12640,12603,12569,12506,12478,12452,12404,
+12382,12361,12321,12301,12282,12244,12232,12217,
+12187,12170,12150,12111,12092,12073,12035,12019,
+12004,11983,11973,11965,11944,11934,11925,11887,
+11863,11843,11840,11859,11854,11796,11760,11718,
+11640,11611,11590,11531,11490,11449,11347,11303,
+11251,11159,11138,11135,11165,11075,11074,11009,
+10974,10936,10845,10799,10751,10657,10609,10563,
+10443,10405,10370,10365,10335,10308,10243,10215,
+10198,10132,10101,10135,10125,10149,10158,10187,
+10193,10194,10153,10121,10082,10088,10096,10109,
+10108,10105,10097,9949,9839,9949,10025,10059,
+10098,10158,10176,10198,10254,10268,10300,10328,
+10335,10333,10277,10322,10332,10322,10302,10280,
+10272,10279,10252,10261,10278,10284,10207,10160,
+10073,9925,9806,9700,9507,9424,9354,9280,
+9253,9227,9183,9160,9138,9090,9065,9039,
+8983,8955,8926,8869,8838,8806,8741,8705,
+8668,8590,8549,8507,8424,8381,8339,8250,
+8201,8313,8905,8022,7970,7879,7835,7797,
+7730,7701,7671,7614,7588,7561,7531,7516,
+7506,7482,7470,7460,7442,7435,7426,7427,
+7407,7395,7380,7372,7364,7348,7344,7344,
+7343,7343,7343,7345,7349,7354,7364,7368,
+7378,7381,7379,7378,7376,7375,7375,7375,
+7375,7375,7378,7379,7381,7382,7383,7384,
+7389,7392,7395,7399,7402,7405,7410,7413,
+7415,7414,7414,7414,7412,7412,7416,7424,
+7427,7431,7437,7442,7449,7462,7467,7473,
+7486,7493,7500,7513,7521,7529,7546,7555,
+7565,7590,7602,7616,7633,7636,7640,7651,
+7660,7675,7688,7701,7715,7745,7759,7777,
+7818,7840,7862,7913,7942,7976,8058,8099,
+8142,8227,8273,8505,8768,8938,8973,9015,
+8776,9170,9290,9411,8913,8965,9561,8974,
+9027,9053,9085,9147,9172,9197,9257,9291,
+9323,9390,9453,9495,9581,9629,9681,9776,
+10789,9901,9970,9999,10785,10168,10028,10048,
+10216,10078,10084,10533,10765,10828,10102,10101,
+10105,10119,10132,10147,10185,10207,10228,10277,
+10310,10355,10453,10514,10578,10868,11117,11037,
+11309,11413,11467,11157,11182,11221,11313,11295,
+11315,11542,11542,11390,11429,11451,11666,11714,
+11540,11567,11643,11687,11933,11854,11918,11983,
+12119,12187,12257,12399,12467,12527,12650,12705,
+12756,12846,12886,12930,13014,13055,13096,13177,
+13219,13259,13338,13379,13418,13490,13519,13556,
+14560,14216,14654,14763,14868,14979,15192,15314,
+15416,14702,14503,14531,14551,14576,14630,14383,
+14318,14266,14275,14468,14776,15201,15353,15473,
+15447,15318,15200,15023,14935,14836,14798,14646,
+14476,14380,14449,14419,14183,14742,14848,14896,
+14904,14927,14964,14979,14286,14408,14433,14506,
+19275,19154,19147,19175,19194,19117,19042,18979,
+18888,17422,17465,17502,17523,17515,17498,17447,
+17417,17382,17317,17299,17285,17259,17243,17238,
+17247,17263,17265,17415,17516,17615,17898,18007,
+18084,18158,18170,18172,18122,18092,18066,18032,
+18025,18025,18044,18061,18083,18133,18159,18182,
+18214,18224,18228,18249,18261,18274,18296,18302,
+18304,18299,18293,18284,18259,18245,18227,18189,
+18172,18157,18132,18122,18113,18092,18083,18070,
+18051,18048,18052,18063,18060,18035,17965,17953,
+17949,17956,17966,17982,18007,18002,17982,17882,
+17781,17698,17658,17757,17838,17867,17814,17649,
+17961,17955,17976,17985,17965,17955,17950,17927,
+17890,17868,17853,17824,17699,17559,17358,17128,
+17155,17251,17520,17579,17618,17642,17651,17606,
+17479,17491,17434,17335,17230,17161,17025,16970,
+16925,16802,16785,16787,16594,16549,16510,16487,
+16482,16546,16616,16632,16614,16567,16582,16564,
+16552,16599,16588,16430,16257,16127,15992,15887,
+15749,15747,15576,15363,14976,14969,15088,13903,
+13875,13847,13790,13781,13775,13628,13596,14455,
+14543,14530,14494,14874,13766,13813,13941,14889,
+15002,15100,15251,14352,15191,15364,14530,15212,
+15324,14588,15200,15187,15188,15122,15055,15019,
+14947,14825,14780,14236,14200,14478,14362,14441,
+14423,14506,14543,14513,14465,14497,14520,14612,
+14679,14768,14776,14850,14823,14866,14890,14870,
+14941,14895,14863,14907,14946,15232,14721,15012,
+14774,15175,15267,15299,15513,15611,15551,15484,
+15533,15595,15724,15641,15671,15740,15753,15749,
+15688,15634,15633,15362,15253,15101,14741,14547,
+14359,14120,13943,13822,13595,13521,13471,13444,
+13468,13516,13666,13729,13794,13926,13989,14045,
+14129,14151,14166,14169,14158,14139,14106,14090,
+14072,14027,14001,13974,13921,13894,13869,13824,
+13805,13788,13757,13746,13734,13711,13698,13682,
+13641,13619,13593,13538,13507,13470,13394,13355,
+13316,13240,13203,13166,13097,13065,13036,12981,
+12957,12933,12889,12868,12846,12804,12787,12769,
+12726,12702,12674,12618,12587,12554,12487,12454,
+12420,12352,12321,12292,12257,12234,12215,12148,
+12126,12098,12047,12026,11990,11894,11843,11796,
+11712,11666,11618,11561,11576,11471,11436,11399,
+11380,11563,11510,11461,11424,11469,11430,11336,
+11297,11255,11182,11146,11104,11003,10955,10901,
+10801,10769,10729,10649,10608,10565,10461,10402,
+10323,10310,10308,10301,10258,10103,10080,10094,
+10049,10155,10201,10230,10257,10307,10319,10319,
+10203,10255,10266,10299,10312,10316,10322,10328,
+10332,10364,10393,10415,10466,10495,10515,10529,
+10523,10547,10540,10520,10501,10520,10505,10503,
+10182,10029,9868,9538,9460,9393,9334,9315,
+9302,9278,9267,9256,9229,9216,9200,9161,
+9142,9124,9089,9071,9055,9022,9006,8987,
+8945,8923,8902,8845,8813,8777,8711,8656,
+8825,10002,9716,9328,8337,8195,8139,9201,
+9024,8821,8643,8705,8531,7653,7615,7579,
+8625,8435,7460,7408,7618,7599,7331,8424,
+8338,8179,7279,7255,7216,7198,7180,7145,
+7129,7113,7084,7070,7053,7022,7012,7155,
+7031,7021,7015,7011,7014,7018,7025,7031,
+7037,7046,7047,7048,7049,7049,7050,7052,
+7053,7055,7057,7058,7059,7061,7062,7063,
+7067,7070,7073,7076,7079,7082,7089,7094,
+7096,7100,7102,7105,7112,7116,7124,7140,
+7147,7154,7163,7169,7175,7187,7193,7198,
+7210,7217,7225,7244,7255,7267,7296,7311,
+7328,7364,7383,7403,7431,7439,7448,7466,
+7477,7488,7513,7528,7544,7577,7593,7614,
+7664,7689,7715,7766,7843,7821,7897,7989,
+7969,8051,8120,8173,8264,8325,8360,8465,
+8518,8633,8668,8765,8803,8926,8969,9051,
+9080,9132,9255,9357,9439,9756,9749,9678,
+9703,10379,10362,10487,10488,10590,9798,9818,
+9881,9775,9801,9817,9833,9871,9892,9919,
+10019,10080,10824,10118,10147,10176,10232,10261,
+10288,10332,10529,10880,10393,10402,10411,11003,
+10416,10906,10465,10497,10532,10644,10687,11177,
+10836,10844,10899,11017,11076,11135,11630,11461,
+11325,11654,11737,11786,11907,11993,12044,11785,
+11836,11882,11993,12047,12100,12199,12247,12294,
+12383,12436,12492,12656,12668,12717,13444,13571,
+13666,13904,14000,14114,14357,14469,14566,14683,
+14770,14861,15075,15178,15325,15611,15741,15838,
+14284,14291,14300,14341,14350,14352,14374,15724,
+15816,14403,14373,14347,14377,14426,14438,14595,
+14531,14430,16061,16166,16200,14666,14608,16528,
+16142,16652,15150,15363,15644,16122,16263,16527,
+16934,17489,17584,17609,18121,18237,18425,18776,
+18856,18951,19019,19083,19150,19325,19365,19262,
+17526,17519,17528,17651,17943,18062,18228,18268,
+18294,18293,18276,18255,18206,18184,18150,18030,
+17955,17902,17824,17810,17814,17845,17866,17905,
+18019,18065,18117,18200,18236,18270,18297,18296,
+18296,18295,18290,18294,18309,18323,18345,18368,
+18356,18318,18199,18152,18130,18125,18136,18158,
+18206,18231,18254,18280,18295,18311,18382,18429,
+18472,18502,18497,18485,18452,18432,18412,18376,
+18359,18346,18329,18324,18323,18328,18341,18352,
+18358,18354,18341,18339,18321,18309,18336,18346,
+18389,18497,18549,18609,18763,18823,18883,18968,
+18986,19004,19010,19003,18988,18960,18938,18910,
+18838,18781,18725,18575,18529,18530,18473,18403,
+18331,18194,18104,18001,17841,17897,17835,17737,
+17704,17764,17839,17805,17764,17644,17645,17614,
+17542,17508,17449,17448,17404,17392,17299,17274,
+17189,17106,17079,16930,16861,16812,16829,16738,
+16719,16687,16616,16586,16626,16592,16630,16636,
+16617,16593,16556,16451,16398,16376,16275,16208,
+16152,16058,15964,15869,15645,15515,15396,15121,
+14960,14666,14594,15047,14942,14703,14652,14643,
+14850,14793,14818,14845,14759,14789,14799,14847,
+14882,14982,15157,15495,14420,14433,15173,15239,
+15257,15285,15514,15756,14756,14762,14765,15480,
+14735,14703,15308,15384,14618,15221,15232,15311,
+15523,15420,15507,14775,15532,14852,15449,15479,
+15503,15502,15590,15635,15583,15559,15568,15540,
+15447,15477,15430,15205,15212,15244,15460,15291,
+15725,15491,15545,15595,15656,15689,15707,15970,
+16076,16011,15898,15928,15845,16042,15842,16187,
+16204,16387,16332,15854,15827,15686,15365,15168,
+14965,14574,14382,14262,14049,13937,13889,13901,
+13918,13961,14116,14172,14228,14382,14457,14522,
+14624,14652,14671,14680,14671,14652,14603,14575,
+14540,14458,14413,14366,14272,14225,14181,14099,
+14062,14027,13964,13939,13917,13877,13857,13836,
+13784,13757,13726,13662,13627,13587,13506,13465,
+13424,13349,13314,13280,13221,13198,13177,13145,
+13133,13124,13109,13102,13096,13086,13083,13077,
+13058,13045,13027,12986,12962,12934,12876,12843,
+12810,12742,12709,12676,12641,12621,12591,12513,
+12472,12442,12367,12326,12272,12141,12079,12016,
+11897,11840,11795,11757,11722,11547,11444,11428,
+11405,11468,11261,11224,11143,11101,11107,11115,
+11148,11164,11130,11111,11085,10998,10917,10825,
+10740,10702,10664,10595,10562,10529,10465,10434,
+10405,10349,10321,10277,10077,10057,10085,10034,
+10163,10150,10149,10065,10170,10211,10225,10233,
+10280,10301,10315,10340,10352,10369,10401,10422,
+10443,10490,10525,10553,10590,10608,10611,10624,
+10615,10629,10504,10113,9777,9550,9489,9444,
+9402,9386,9377,9375,9376,9376,9373,9369,
+9363,9342,9332,9319,9295,9286,9270,9231,
+9213,9194,9157,9138,9121,9134,9096,9064,
+9002,8968,9117,8911,8848,8789,8665,8609,
+8545,9963,9726,9435,8217,8090,8018,7929,
+7881,9215,8829,8646,8624,8581,8432,8288,
+7944,8458,7416,7603,8240,8754,7507,7479,
+7229,8257,7214,7179,7135,7117,7099,7064,
+7049,7037,7016,8239,7836,7444,7647,6981,
+6982,6982,6978,6968,6964,6961,6947,6939,
+6930,6956,6922,6904,6867,6855,6842,6821,
+6813,6805,6793,6788,6785,6783,6784,6786,
+6792,6796,6800,6811,6817,6825,6842,6853,
+6862,6875,6882,6888,6904,6913,6924,6944,
+6953,6960,6967,6970,6975,6983,6986,6989,
+6997,7003,7010,7029,7041,7054,7088,7107,
+7128,7174,7200,7225,7262,7273,7284,7306,
+7319,7334,7364,7381,7396,7431,7450,7469,
+7521,7550,7581,7648,7754,7734,7842,7924,
+7948,8009,8102,8132,8245,8298,8346,8442,
+8495,8537,8640,8669,8721,8802,8869,8869,
+8995,9045,9048,9151,9251,9665,9850,9476,
+9924,10117,9753,10192,10408,10459,10530,10558,
+10598,10561,10081,10591,10593,10564,10142,10141,
+10619,10713,10707,10160,10181,10202,10243,10260,
+10309,10336,10351,10363,10384,10393,10403,10439,
+10461,10473,10518,10546,10578,10666,10711,10761,
+11327,10939,10996,11116,11179,11256,11333,11379,
+11424,11522,11577,11627,11910,12118,12225,11943,
+12025,12414,12621,12701,12254,12346,12389,12429,
+12498,12529,12558,12616,12648,12684,12801,12849,
+12899,12995,13059,13138,14038,14294,14434,14902,
+13829,13968,14261,14392,15634,15984,16128,16196,
+16402,16420,14832,14866,14850,14821,14747,14799,
+14813,16603,16519,16510,14785,14793,14808,14832,
+14877,16415,16431,15110,15099,16355,16315,16359,
+15702,15811,16968,16657,17776,18207,18018,17624,
+19050,19261,19359,19377,19078,19000,18884,17965,
+17712,17639,17484,17419,17488,17544,17552,17549,
+18423,18414,18401,18380,18371,18365,18357,18353,
+18350,18348,18347,18347,18345,18344,18342,18336,
+18330,18325,18314,18311,18312,18316,18322,18327,
+18332,18333,18333,18335,18341,18461,18506,18528,
+18546,18536,18468,18358,18190,18116,18043,17955,
+17948,17947,17942,17960,17979,18014,18029,18042,
+18057,18060,18057,18038,18020,18001,17970,17971,
+17992,18077,18135,18198,18299,18337,18358,18376,
+18378,18383,18380,18377,18377,18364,18360,18354,
+18342,18339,18336,18328,18324,18319,18290,18259,
+18217,18096,18031,17973,18021,18080,18161,18256,
+18315,18384,18560,18648,18735,18871,18910,18933,
+18927,18929,18938,18886,18843,18796,18635,18538,
+18410,18126,17946,17788,18026,18025,17955,17943,
+17884,17740,17453,17360,17264,17154,17136,17139,
+17119,17104,17064,16976,16924,16872,16798,16738,
+16658,16553,16466,16411,16353,16389,16371,16308,
+16321,16292,16184,16160,16164,15865,16071,16003,
+16012,15961,15936,15873,15825,15713,15667,15645,
+15612,15509,15466,15382,15139,14984,14910,14710,
+14591,14577,14555,14543,14534,14409,14349,14881,
+14338,14938,14356,14857,14309,14702,14470,14795,
+14661,14590,14696,14967,14527,15160,15334,14625,
+15160,15165,15661,14803,14803,15622,15887,14855,
+15600,15627,15792,15535,15568,15571,15645,15831,
+14984,15864,16051,15132,16126,15312,16244,16284,
+16362,16427,16549,16607,16640,16715,16728,16757,
+16634,16618,16614,16594,16543,16510,16415,16453,
+16458,16593,16571,16628,16683,16747,16768,16797,
+16826,16751,16619,16004,16488,15773,16596,16038,
+16941,16536,17059,16913,16617,16546,16345,16224,
+16066,15693,15478,15251,14701,14466,14331,14350,
+14445,14524,14780,14890,14987,15168,15243,15301,
+15377,15391,15395,15391,15380,15359,15308,15278,
+15238,15137,15077,15012,14874,14801,14728,14583,
+14511,14442,14310,14249,14195,14095,14050,14007,
+13922,13882,13841,13761,13720,13676,13586,13541,
+13497,13415,13377,13340,13278,13252,13230,13197,
+13184,13174,13160,13155,13149,13138,13135,13131,
+13113,13100,13085,13048,13026,13004,12954,12927,
+12901,12846,12819,12792,12734,12705,12676,12663,
+12637,12606,12541,12500,12449,12323,12261,12205,
+12126,12113,12106,12008,11961,11920,11883,11728,
+11707,11696,11480,11465,11416,11367,11318,11313,
+11341,11309,11089,11089,11092,10924,10912,10876,
+10765,10720,10674,10587,10541,10499,10420,10384,
+10346,10279,10256,10239,10169,10131,10139,10112,
+10056,10175,10169,10231,10256,10276,10296,10302,
+10327,10340,10353,10376,10386,10409,10454,10475,
+10493,10525,10539,10550,10555,10540,10535,10229,
+9848,9680,9486,9443,9393,9367,9360,9354,
+9343,9338,9332,9333,9335,9335,9331,9329,
+9324,9304,9295,9284,9264,9255,9248,9221,
+9207,9192,9163,9147,9132,9206,9154,9104,
+9027,8988,8945,8848,10040,9958,9603,9373,
+8534,8321,8243,9533,9231,9006,7963,7813,
+7765,7724,8818,8692,8587,8476,8428,8307,
+8546,8601,8406,7637,7549,7520,8925,8673,
+8300,7872,8015,7075,7023,7000,6979,6961,
+6961,6962,7692,7854,6875,6835,6825,6820,
+6810,6802,6795,7751,7172,7648,7327,7273,
+6997,6935,6919,6900,6864,6848,6830,6800,
+6847,6747,6544,6512,6502,6490,6487,6484,
+6483,6484,6487,6494,6500,6507,6529,6541,
+6552,6571,6583,6595,6627,6643,6664,6706,
+6725,6742,6772,6786,6801,6829,6840,6849,
+6866,6874,6881,6896,6904,6914,6934,6948,
+6964,7001,7024,7048,7084,7094,7107,7134,
+7148,7164,7199,7217,7239,7285,7308,7336,
+7400,7435,7469,7542,7571,7687,7764,7767,
+7881,7978,8011,8076,8197,8233,8304,8404,
+8452,8503,8590,8639,8703,8747,8783,8811,
+8873,8918,8930,9047,9053,9102,9239,9255,
+9353,9431,9641,9516,9703,9726,9757,9887,
+9930,9912,9994,10188,10178,10203,10589,10221,
+10650,10456,10690,10883,11015,10961,10820,10820,
+10324,10325,10844,10879,10915,10900,10837,10795,
+10888,10858,10488,10534,10588,10716,10786,10857,
+11007,11084,11157,11422,11400,11398,11498,11537,
+11571,11640,11676,11714,11797,11843,11890,11982,
+12034,12095,12237,12862,12941,12486,12536,12577,
+12638,12660,12682,12728,12755,12782,12839,12869,
+12900,12965,13018,13093,13268,13367,13471,13706,
+13845,15271,14291,14444,14598,16099,16225,16395,
+16731,16698,15670,17066,16966,16539,17180,17190,
+17180,17159,17172,16349,15814,17198,17193,15704,
+15784,15906,16795,16800,17115,17338,17825,18074,
+17990,18129,18103,18568,18517,18699,18506,18655,
+18604,18192,17944,17881,17757,17688,17640,17779,
+17925,18063,18253,18321,18392,18461,18466,18450,
+18394,18393,18392,18388,18388,18388,18399,18411,
+18424,18447,18456,18466,18470,18472,18469,18466,
+18464,18460,18451,18451,18451,18445,18441,18433,
+18400,18376,18352,18315,18322,18356,18433,18598,
+18647,18729,18728,18718,18692,18676,18660,18631,
+18618,18609,18602,18604,18612,18638,18659,18682,
+18739,18771,18802,18863,18887,18906,18922,18917,
+18903,18835,18790,18740,18629,18569,18505,18368,
+18302,18239,18019,17972,17926,17842,17804,17767,
+17696,17661,17627,17562,17530,17500,17544,17519,
+17498,17455,17431,17408,17350,17319,17286,17214,
+17176,17139,17067,17030,16995,16928,16897,16867,
+16806,16780,16752,16694,16662,16626,16539,16489,
+16431,16319,16322,16294,16358,16367,16356,16418,
+16420,16414,16459,16359,16385,16350,16338,16248,
+16258,16192,16133,16120,16810,15995,15965,16001,
+15998,16913,17134,17040,17256,17216,17049,16840,
+16773,16709,16664,16625,16622,16646,16641,16646,
+16507,16443,16349,16173,16074,15985,15794,15682,
+15613,15043,13929,13820,13861,13850,13845,13884,
+13929,13975,14071,14120,14172,14154,14188,14221,
+14300,14340,14376,14451,14488,14526,14602,14639,
+14677,14747,14781,14813,14862,14881,14900,14951,
+14979,15008,15070,15098,15642,15193,15175,15197,
+15249,15455,15855,15992,16019,16128,16299,16373,
+16465,16542,16731,16867,17044,17163,17235,17363,
+17405,17435,17472,17481,17485,17349,17375,17341,
+17386,17421,17467,17542,17591,17652,17741,17779,
+17856,17997,18065,18116,18064,18052,18032,17867,
+17767,17603,16517,17272,16275,16294,17284,16418,
+16658,17058,17830,17179,17310,18135,17610,17667,
+17701,17935,17673,17627,17683,17399,17321,17179,
+17121,17084,17095,17132,17194,17348,17414,17463,
+17494,17468,17385,17203,17063,16903,16569,16410,
+16255,15948,15795,15643,15351,15215,15087,14856,
+14755,14661,14497,14423,14353,14238,14198,14169,
+14151,14163,14184,14242,14268,14287,14297,14285,
+14262,14189,14137,14079,13952,13888,13827,13716,
+13670,13630,13573,13556,13547,13544,13552,13560,
+13572,13573,13569,13548,13529,13506,13442,13404,
+13362,13265,13214,13162,13056,13005,12951,12837,
+12775,12709,12575,12512,12439,12320,12309,12201,
+12055,12039,12070,12049,11986,11932,11874,11890,
+11912,11998,12014,12021,12015,12002,11983,11922,
+11888,11848,11757,11704,11658,11500,11428,11354,
+11221,11186,11153,11108,11092,11049,10979,10923,
+10899,10808,10767,10731,10675,10652,10632,10607,
+10591,10572,10526,10507,10486,10446,10426,10404,
+10367,10366,10362,10338,10327,10334,10390,10407,
+10377,10281,10098,9911,9453,9413,9356,9364,
+9364,9339,9377,9399,9422,9465,9473,9483,
+9496,9527,9472,9502,9480,9456,9415,9393,
+9371,9316,9289,9262,9213,9191,9166,9111,
+9087,9074,9087,9052,9025,8986,8966,8944,
+8894,9036,8934,8813,9116,9587,9555,9444,
+9311,9405,9224,9140,9008,9070,8980,9016,
+8738,8864,8418,8136,7582,7462,7402,7579,
+9103,8839,7450,7316,7260,7208,7108,7060,
+8713,7870,7529,7903,6967,6778,6751,7748,
+6723,6821,6654,6627,6601,7052,6522,6582,
+7803,7322,6462,6424,6656,7466,6426,6527,
+7308,6433,6435,6404,6415,7188,6432,6440,
+6446,6972,6971,6487,6463,6454,6448,6449,
+6164,6163,6166,6172,6175,6181,6195,6205,
+6209,6215,6219,6224,6233,6239,6248,6268,
+6279,6292,6323,6342,6363,6407,6429,6453,
+6498,6520,6543,6584,6601,6619,6650,6666,
+6680,6711,6726,6745,6765,6768,6774,6794,
+6808,6826,6873,6899,6927,6986,7016,7049,
+7127,7167,7209,7293,7336,7383,7486,7539,
+7592,7694,7747,7804,7916,7970,8022,8123,
+8164,8201,8276,8318,8360,8460,8514,8561,
+8683,8753,8808,8962,9022,9092,9249,9318,
+9382,9674,9510,9545,9603,9644,9608,9628,
+9632,9635,9647,9645,9652,9705,9731,9745,
+9772,9844,9882,9994,10162,10394,10689,10729,
+10825,10847,10947,10986,10604,10854,10873,10882,
+10851,10887,10897,10672,10717,10826,10884,10950,
+11399,11212,11754,11410,11749,12028,12220,12232,
+12269,12336,12361,12418,12440,12438,12353,12216,
+12257,12301,12409,12465,12518,12624,12800,12796,
+12777,12802,12826,12882,12912,12941,13020,13065,
+13116,14038,14248,14339,14937,15201,13970,14278,
+14463,16011,16650,15132,15308,15643,15749,17482,
+17833,16111,16221,16430,16529,16700,18122,18407,
+18806,18443,17917,17379,17327,17357,17420,17733,
+17942,18162,18318,18463,18572,18735,18783,18782,
+18762,18722,18670,18539,18466,18395,18257,18193,
+18141,18091,18099,18132,18239,18283,18317,18337,
+18343,18343,18350,18353,18361,18384,18387,18389,
+18812,18798,18783,18755,18743,18734,18733,18740,
+18751,18780,18797,18814,18845,18857,18864,18867,
+18861,18851,18822,18803,18785,18749,18734,18721,
+18705,18701,18700,18702,18720,18755,18820,18849,
+19013,19085,19074,19054,19009,18986,18964,18924,
+18910,18898,18884,18881,18880,18885,18893,18906,
+18953,18987,19027,19112,19147,19174,19188,19174,
+19148,19046,18981,18911,18758,18679,18596,18304,
+18223,18146,18007,17948,17899,17830,17810,17799,
+17797,17799,17801,17800,17795,17785,17753,17730,
+17704,17634,17594,17549,17557,17507,17456,17351,
+17301,17252,17156,17110,17066,16984,16946,16909,
+16836,16799,16762,16687,16651,16614,16533,16489,
+16442,16342,16297,16250,16172,16143,16135,16242,
+16286,16347,16418,16397,16378,16392,16357,16329,
+16273,16247,16222,16202,16215,16882,17049,17210,
+17321,17352,17398,17434,17342,17293,17243,17145,
+17097,17055,16966,16913,16857,16750,16702,16638,
+16490,16397,16309,16120,16026,15936,15765,15654,
+15577,15453,15368,15306,15239,15167,15097,14993,
+14929,14851,14714,14511,14395,13860,13911,13968,
+14074,14125,14176,14284,14341,14402,14529,14595,
+14664,14800,14868,14933,15040,15082,15121,15194,
+15228,15265,15345,15386,15425,15494,15522,15557,
+15619,15679,15864,16389,16553,16671,16817,16903,
+16992,17193,17243,17312,17434,17514,17602,17658,
+17682,17691,17662,17675,17669,17552,17519,17578,
+17711,17784,17775,17866,17917,18015,18199,18294,
+18317,18345,18352,18429,18369,18321,18270,18091,
+18000,17916,17695,17556,17378,16356,17582,16499,
+17979,16831,16898,18132,18116,17088,18078,17641,
+18169,17839,18185,18022,18124,18157,18185,18214,
+18219,18224,18238,18225,18211,18163,18120,18062,
+17883,17753,17597,17229,17032,16845,16548,16424,
+16306,16055,15924,15794,15549,15443,15347,15193,
+15131,15075,14989,14954,14923,14878,14867,14862,
+14873,14888,14909,14952,14967,14974,14954,14924,
+14882,14757,14675,14583,14383,14283,14185,14012,
+13940,13880,13799,13777,13765,13771,13789,13808,
+13847,13863,13874,13878,13870,13854,13802,13766,
+13725,13625,13568,13508,13389,13338,13289,13169,
+13101,13033,12935,12859,12801,12689,12682,12635,
+12642,12569,12524,12465,12372,12294,12225,12154,
+12085,11961,11912,11931,11896,11878,11847,11800,
+11769,11736,11659,11613,11579,11498,11419,11363,
+11292,11272,11236,11200,11195,11188,11149,11110,
+11081,11020,10988,10951,10888,10862,10841,10797,
+10772,10738,10674,10639,10615,10584,10553,10509,
+10409,10344,10299,10059,9850,9782,9604,9567,
+9536,9524,9472,9502,9649,9690,9791,9791,
+9815,9845,9804,9825,9840,9899,9924,9907,
+9805,9802,9802,9851,9794,9701,9618,9614,
+9588,9506,9479,9464,9412,9391,9376,9310,
+9278,9248,9184,9181,9189,9082,9039,8997,
+8907,8857,8806,8789,8707,8639,8515,8451,
+8384,8256,8696,9391,9107,8943,7952,7842,
+7951,9009,8609,8694,8470,8284,7631,7571,
+7447,8864,8670,7255,7170,7097,6965,8558,
+8322,7585,6724,6671,6592,6556,6521,6660,
+8107,7688,6393,6374,6362,6327,6316,7659,
+7120,6926,6301,6515,6353,6331,6331,6307,
+6300,6303,7156,6270,6288,6284,6287,6676,
+6663,6645,6364,6323,6361,6339,6339,6442,
+6315,6319,6047,6049,6060,6072,6102,6118,
+6127,6144,6152,6161,6177,6186,6196,6215,
+6221,6227,6237,6246,6258,6298,6321,6346,
+6403,6434,6465,6527,6554,6580,6626,6646,
+6665,6697,6711,6723,6727,6719,6713,6706,
+6706,6710,6724,6738,6756,6800,6829,6860,
+6944,6988,7035,7132,7182,7235,7353,7417,
+7480,7609,7674,7744,7864,7924,7982,8090,
+8132,8166,8232,8267,8302,8382,8421,8462,
+8549,8600,8654,8783,8855,8911,9251,9142,
+9213,9347,9602,9605,9812,9792,9882,9954,
+9936,9941,10030,9780,10121,9997,9991,9787,
+9752,9821,9864,9854,9897,9942,10037,10188,
+10139,10221,10298,10350,10727,10816,10962,11016,
+10997,10925,10980,11086,11049,11179,11149,11176,
+11415,11538,11197,11842,11745,11457,11601,11669,
+11731,12177,12348,12424,12502,12559,12601,12679,
+12749,12871,12890,12877,12606,13257,13350,13286,
+13262,13339,13226,13085,13128,13165,13263,13311,
+13360,13512,13632,13796,14093,14241,14391,14692,
+14855,16124,16640,16917,15766,16144,16970,17168,
+17688,16530,16622,18240,16870,18487,17252,18323,
+18467,18627,18664,18564,18322,18344,18450,18607,
+18675,18742,18877,18938,18994,19056,19056,19038,
+18966,18919,18868,18759,18707,18658,18571,18536,
+18508,18478,18475,18478,18507,18530,18558,18627,
+18665,18701,18765,18792,18811,18834,18836,18833,
+19301,19305,19307,19321,19331,19344,19562,19620,
+19596,19418,19430,19432,19435,19435,19431,19405,
+19384,19359,19299,19265,19231,19165,19133,19105,
+19056,19036,19017,18987,18982,18986,18995,18999,
+19136,19168,19150,19127,19080,19057,19037,19002,
+18986,18972,18947,18937,18928,18924,18933,18952,
+19016,19059,19101,19167,19178,19175,19119,19069,
+19007,18836,18741,18644,18447,18348,18116,17919,
+17831,17755,17640,17604,17580,17563,17568,17580,
+17618,17639,17660,17692,17701,17704,17694,17681,
+17664,17615,17584,17548,17466,17422,17375,17381,
+17337,17292,17204,17161,17120,17041,17004,16967,
+16893,16854,16815,16730,16684,16636,16529,16473,
+16417,16304,16253,16204,16122,16099,16119,16213,
+16292,16372,16597,16717,16776,16917,16955,16987,
+16831,16653,16399,17312,17481,17350,17459,17452,
+17486,17365,17302,17233,17078,17007,16932,16784,
+16715,16638,16459,16367,16330,16228,16193,16163,
+16146,16137,16099,16000,15943,15876,15722,15659,
+15596,15466,15418,15370,15254,15161,15113,15040,
+15036,15022,14970,14937,14913,14757,14679,14614,
+14460,14173,14071,14203,14279,14358,14525,14612,
+14700,14879,14967,15056,15218,15289,15354,15475,
+15530,15586,15689,15739,15787,15875,15914,15949,
+15999,16024,16053,16135,16184,16240,16367,16429,
+16489,16589,16726,16788,17293,17359,17404,17417,
+17417,17470,17679,17819,17814,18002,18083,18140,
+18210,18202,18220,18269,18250,18276,18340,18337,
+18366,18367,18366,18347,18264,18210,18153,18091,
+18073,18068,18090,18092,18097,18077,18068,18075,
+18264,17359,17395,17382,17395,18332,18043,17892,
+17988,18004,17713,17802,17969,18047,18119,18257,
+18253,18246,18195,18126,18043,17854,17744,17621,
+17329,17162,17000,16708,16600,16527,16453,16427,
+16399,16337,16310,16291,16255,16246,16242,16246,
+16248,16250,16270,16273,16271,16259,16248,16231,
+16190,16168,16145,16101,16079,16051,15981,15936,
+15882,15749,15669,15581,15396,15303,15222,15044,
+14965,14893,14767,14713,14664,14582,14549,14517,
+14457,14424,14391,14319,14279,14236,14142,14091,
+14041,13931,13876,13820,13709,13651,13590,13450,
+13386,13327,13290,13242,13189,13139,13134,13061,
+12916,12854,12783,12643,12590,12523,12370,12342,
+12280,12165,12096,12043,11930,11879,11827,11736,
+11683,11638,11536,11483,11416,11301,11276,11230,
+11036,11031,11030,11013,11022,11043,11017,10958,
+10959,10956,10936,10902,10856,10825,10783,10631,
+10544,10419,10171,10035,9920,9773,9753,9732,
+9705,9701,9696,9700,9707,9724,9766,9863,
+10074,9874,9909,9951,10028,10064,10097,10150,
+10166,10176,10424,10367,10150,10119,10115,10128,
+10112,10065,9928,9844,9809,9777,9754,9715,
+9678,9634,9615,9596,9560,9541,9514,9458,
+9415,9372,9331,9305,9227,9094,9031,8967,
+8838,8771,8706,8590,8532,8583,8389,8323,
+8261,8147,8093,8290,8892,8853,7928,8753,
+8664,8513,7650,8591,8527,7487,7667,7601,
+7470,7401,8915,7269,7173,7095,8567,8291,
+6826,8128,7938,6668,6579,6539,6502,6425,
+7764,6508,6380,6357,6340,6313,6307,7666,
+7033,6535,6422,6306,6385,6347,6311,6301,
+7098,6686,6615,6556,6476,6534,6561,6458,
+6588,6401,6327,6368,6304,6360,6280,6398,
+6286,6544,6299,6022,6037,6050,6080,6097,
+6109,6126,6135,6145,6171,6185,6201,6228,
+6241,6252,6270,6281,6294,6320,6336,6354,
+6397,6424,6453,6514,6544,6572,6623,6648,
+6672,6715,6733,6751,6760,6753,6742,6719,
+6708,6697,6686,6685,6688,6698,6710,6729,
+6797,6840,6887,6989,7042,7097,7215,7275,
+7336,7458,7520,7590,7736,7812,7884,8018,
+8297,8092,8176,8218,8258,8340,8376,8412,
+8490,8530,8574,8655,8710,8765,8863,8908,
+8950,9025,9058,9088,9143,9169,9195,9252,
+9284,9318,9404,9415,9459,9662,9733,9928,
+10152,10181,10193,10302,10400,10313,10206,10307,
+10465,10273,10239,10279,10358,10394,10475,10511,
+10544,10729,10819,10915,11040,10695,10733,10780,
+10904,11041,11058,11192,11277,11352,11548,11820,
+11948,11791,11848,11903,12000,12348,12090,12630,
+12215,12563,12757,12439,12498,13012,12757,13189,
+13328,13407,13493,13579,13611,13448,13514,13977,
+14399,13924,14063,14865,15337,14604,14693,14874,
+15021,15192,15567,16056,16317,17410,16127,16139,
+16254,17192,17312,17811,18030,18299,18768,18923,
+18771,19122,19177,18878,18826,18952,19030,19146,
+19185,19220,19250,19243,19222,19151,19109,19069,
+19000,18974,18958,18956,18964,18973,18990,18998,
+19004,19013,19020,19030,19091,19106,19090,19123,
+19144,19165,19211,19226,19244,19616,19302,19299,
+21047,21065,21064,21032,20588,21134,20557,21116,
+21151,20449,21036,21000,20926,20882,20269,20749,
+20710,20719,20639,20428,20112,20091,19978,19954,
+19862,19894,19795,19675,19655,19567,19449,19392,
+19337,19388,19358,19332,19291,19273,19258,19233,
+19221,19212,19193,19186,19181,19179,19182,19187,
+19206,19220,19241,19286,19319,19344,19391,19411,
+19424,19406,19385,19263,19204,19161,19106,18965,
+18884,18799,18613,18517,18423,18237,18147,18062,
+17904,17833,17767,17650,17600,17555,17482,17456,
+17434,17399,17382,17363,17319,17291,17259,17182,
+17138,17092,16992,16939,16886,16901,16856,16813,
+16731,16692,16656,16585,16549,16512,16428,16384,
+16340,16247,16200,16154,16064,16020,15977,15946,
+16003,16050,16257,16420,16518,16627,16657,16676,
+16730,16751,16780,16811,16762,16753,16730,16706,
+16652,16591,16541,16470,16309,16243,16156,15989,
+15913,15839,15684,15611,15526,15381,15310,15253,
+15159,15188,15275,15443,15489,15514,15551,15549,
+15527,15460,15426,15380,15289,15265,15246,15190,
+15107,15064,14989,14963,14946,14732,14772,14775,
+14811,14731,14701,14635,14593,14556,14483,14502,
+14571,14722,14805,14988,15089,15190,15299,15521,
+15632,15737,15921,15997,16057,16134,16149,16148,
+16085,16042,16002,15963,15979,16032,16224,16341,
+16467,16725,16845,16947,17194,17240,17261,17221,
+17394,17620,17760,17808,17730,17908,17968,17977,
+18009,18049,18084,18129,18129,18117,18080,18001,
+17905,17778,17875,17930,17878,17837,17811,17925,
+18049,18181,18474,18588,18713,18872,18941,19011,
+19147,19197,19238,19248,19256,19257,19275,19292,
+19309,19353,19372,19385,19409,19430,19463,19514,
+19532,19546,19534,19455,19329,18948,18743,18526,
+18056,17851,17734,17112,17076,17041,17001,16996,
+16998,17065,17140,17240,17400,17490,17590,17789,
+17877,17958,18135,18194,18233,18257,18246,18223,
+18150,18103,18052,17933,17864,17783,17591,17482,
+17360,17085,16931,16767,16426,16255,16086,15770,
+15626,15492,15261,15163,15075,14933,14883,14847,
+14816,14818,14826,14838,14831,14813,14745,14698,
+14646,14529,14468,14408,14284,14219,14151,13981,
+13886,13784,13559,13440,13305,13008,12862,12716,
+12434,12300,12174,11938,11830,11728,11543,11460,
+11394,11268,11213,11169,11020,10961,10897,10787,
+10732,10740,10585,10536,10500,10439,10404,10377,
+10367,10379,10387,10391,10458,10421,10473,10336,
+10299,10342,10362,10348,10375,10353,10511,10404,
+10470,10502,10542,10554,10626,10190,10213,10758,
+10258,10697,10284,10755,10312,10882,10755,10638,
+10465,10250,10614,10224,10129,10091,10086,9991,
+9943,9893,9819,9780,9746,9695,9673,9649,
+9605,9584,9563,9534,9522,9510,9485,9471,
+9457,9415,9391,9367,9307,9274,9233,9160,
+9104,9045,8932,8879,8824,8724,8680,8640,
+8573,8538,8500,8406,8458,8371,8257,8213,
+8173,8103,8066,8048,7925,8021,7857,7744,
+7660,7622,7543,7526,7459,8694,8412,8212,
+8031,8111,8054,7067,7024,7105,6998,8174,
+7952,6867,6840,6817,6770,6918,8096,6672,
+6629,6594,6529,6499,7685,6444,6420,6402,
+6370,6354,6338,6332,6295,6274,6239,6225,
+6213,6215,6203,6199,6207,6213,6222,6234,
+6241,6249,6263,6271,6279,6287,6290,6293,
+6304,6309,6317,6326,6331,6043,6081,6097,
+6108,6118,6125,6130,6147,6157,6168,6193,
+6204,6217,6245,6262,6280,6319,6340,6364,
+6409,6432,6457,6494,6505,6512,6527,6536,
+6547,6575,6590,6606,6632,6639,6649,6665,
+6672,6676,6685,6683,6678,6661,6649,6643,
+6665,6686,6711,6779,6822,6876,6997,7056,
+7113,7215,7262,7314,7417,7469,7525,7643,
+7700,7750,7857,7913,7968,8080,8134,8177,
+8241,8279,8316,8396,8447,8830,8956,8905,
+9007,9065,9084,9121,9309,9225,9254,9321,
+9327,9386,9265,9323,9382,9720,9576,9641,
+9701,9742,9780,9843,9869,9893,9941,9964,
+9990,10041,10068,10103,10204,10232,10290,10375,
+10393,10425,10435,10466,10476,10504,10533,10567,
+10655,10715,10786,10951,11085,11194,11351,11428,
+11493,11746,11673,11721,11905,11853,11990,11994,
+12116,12124,12290,12382,12506,12775,12763,12848,
+12989,13060,13128,13268,13378,13489,14031,13853,
+13987,14612,14500,14749,15569,15571,16165,16877,
+17393,17759,17530,18200,18277,18616,18693,18738,
+18172,17789,17220,17424,17674,17853,18829,19058,
+19091,19575,19809,19987,20192,20199,20177,20096,
+20035,19957,19772,19679,19595,19472,19442,19439,
+19495,19535,19577,19651,19680,19706,19848,19857,
+19760,19771,19780,19794,20110,20050,20009,20009,
+20529,20356,20233,20749,20776,20444,20956,21001,
+21390,21512,21518,21541,21547,21538,21556,21588,
+21546,21517,21486,21454,21431,21401,21367,21292,
+21244,21203,20997,20814,20571,20721,20662,20518,
+20383,20164,20107,20072,19969,19893,19787,19737,
+19687,19675,19654,19633,19602,19589,19594,19549,
+19535,19522,19500,19488,19481,19473,19473,19475,
+19485,19493,19505,19535,19553,19574,19612,19627,
+19635,19612,19501,19471,19396,19344,19279,19117,
+19026,18928,18725,18618,18512,18306,18207,18110,
+17928,17843,17764,17619,17552,17492,17387,17346,
+17311,17254,17230,17209,17169,17147,17125,17071,
+17040,17005,16923,16878,16829,16732,16685,16762,
+16687,16654,16622,16564,16535,16504,16423,16378,
+16328,16220,16163,16105,15989,15933,15880,15782,
+15745,15737,15884,15974,16042,16144,16200,16234,
+16272,16285,16300,16364,16432,16444,16432,16451,
+16451,16379,16367,16330,16227,16154,16086,15928,
+15841,15755,15547,15461,15386,15215,15129,15071,
+15045,15023,15038,15160,15242,15297,15341,15354,
+15358,15352,15334,15284,15208,15222,15242,15220,
+15186,15140,15007,14952,14907,14704,14715,14702,
+14676,14639,14621,14518,14473,14449,14523,14540,
+14485,14710,14834,15056,15228,15360,15492,15746,
+15862,15965,16120,16174,16212,16240,16237,16224,
+16164,16137,16121,16140,16184,16262,16505,16648,
+16802,17121,17271,17398,17663,17716,17736,17675,
+17650,17924,17933,17910,17758,17672,17653,17591,
+17525,17514,17520,17570,17534,17536,17431,17398,
+17357,17300,17305,17340,17552,17589,17568,17916,
+18093,18251,18589,18753,18905,19042,19102,19151,
+19293,19365,19406,19458,19495,19530,19610,19658,
+19709,19799,19835,19867,19927,19959,19993,20058,
+20080,20079,20076,20042,20016,19975,19940,19913,
+19822,19757,19678,19461,19307,19101,18677,18474,
+18238,17257,17173,17167,17041,16994,16975,17000,
+17033,17076,17273,17354,17422,17525,17567,17603,
+17665,17690,17711,17734,17733,17717,17653,17601,
+17536,17351,17229,17086,16751,16557,16346,15867,
+15600,15342,14840,14651,14504,14322,14277,14255,
+14271,14316,14389,14606,14719,14813,14895,14890,
+14855,14741,14671,14598,14453,14381,14306,14134,
+14044,13948,13744,13635,13509,13220,13076,12932,
+12657,12529,12411,12199,12103,12013,11841,11758,
+11676,11506,11416,11323,11131,11045,10951,10775,
+10694,10615,10485,10432,10442,10335,10415,10430,
+10430,10435,10295,10448,10505,10381,10302,10174,
+10420,10102,10043,10007,10002,10015,10043,10104,
+10363,10155,10208,10232,10256,10393,10736,10308,
+10715,10309,10397,10279,10283,10254,10199,10458,
+10127,10045,10007,9971,9851,9799,9742,9643,
+9601,9568,9523,9506,9491,9466,9454,9442,
+9413,9395,9376,9340,9322,9300,9253,9227,
+9202,9137,9103,9068,8996,8957,8912,8810,
+8759,8710,8614,8567,8522,8456,8435,8424,
+8399,8390,8368,8435,8393,8313,8167,8155,
+8170,8231,8208,8179,8094,8133,7943,7702,
+7604,7432,7359,7335,7570,7626,7617,7739,
+7546,7506,7410,7228,7175,7093,6895,7949,
+7693,6776,6736,6705,6650,6621,6590,6585,
+6532,6506,6469,6454,6437,6535,6471,6411,
+6402,6400,6399,6397,6398,6395,6392,6391,
+6391,6397,6406,6415,6437,6450,6463,6483,
+6491,6499,6508,6510,6512,6507,6503,6500,
+6504,6510,6514,6511,6508,6505,6215,6223,
+6226,6212,6206,6200,6193,6196,6206,6229,
+6246,6259,6290,6309,6329,6380,6397,6413,
+6458,6482,6498,6515,6519,6525,6533,6542,
+6553,6578,6593,6612,6633,6636,6640,6648,
+6650,6652,6656,6656,6651,6633,6621,6611,
+6621,6635,6658,6716,6752,6793,6893,6950,
+7007,7115,7166,7217,7316,7367,7419,7527,
+7577,7621,7719,7774,7830,7941,7985,8028,
+8105,8140,8173,8238,8282,8328,8422,8468,
+8517,8648,8701,8737,8882,8861,8901,9051,
+9164,9194,9417,9280,9340,9564,9726,9801,
+9848,9853,9757,9802,9816,9824,9828,9827,
+9825,9836,9852,9878,9955,10001,10053,10243,
+10207,10318,10370,10452,10523,10611,10608,10654,
+10759,10818,10880,11015,11088,11168,11305,11463,
+11507,11567,11622,11672,11763,11808,11852,11957,
+12012,12086,12476,12462,12591,13014,13193,13289,
+13454,13620,13709,13964,14068,14260,14515,14361,
+14448,14705,14841,15066,15650,15918,16078,16588,
+16850,17074,17364,17504,17619,18328,18856,19054,
+19328,19342,19425,18460,18086,18261,18741,19041,
+19356,19877,20091,20228,20332,20310,20267,20138,
+20058,19976,19831,19776,19738,19721,19747,19784,
+19889,19891,19915,19944,19953,19958,19963,19966,
+19975,20391,20422,20471,20502,20557,20466,21017,
+20966,20967,21278,21286,21265,21409,21412,21428,
+21823,21852,21928,21968,22011,22053,22123,22091,
+22090,22073,22047,22018,21952,21908,21868,21762,
+21702,21624,21479,21427,21378,21319,21269,20829,
+20828,20811,20868,20617,20493,20644,20538,20501,
+20464,20299,20029,20287,20131,20063,19776,19980,
+19656,19628,19671,19613,19587,19571,19573,19576,
+19578,19579,19579,19571,19563,19554,19526,19506,
+19469,19294,19257,19218,19140,19099,19049,18929,
+18864,18795,18646,18569,18492,18335,18255,18174,
+18008,17926,17845,17685,17606,17530,17386,17324,
+17266,17172,17132,17100,17055,17042,17030,17009,
+16998,16981,16933,16901,16864,16777,16730,16684,
+16596,16679,16644,16578,16620,16549,16424,16362,
+16304,16178,16110,16043,15908,15843,15781,15679,
+15653,15662,15715,15731,15742,15777,15784,15781,
+15768,15760,15765,15863,15862,15811,15698,15677,
+15678,15754,15762,15780,15751,15725,15698,15608,
+15547,15454,15279,15209,15102,14959,14925,14905,
+14895,14933,15018,15136,15153,15175,15193,15198,
+15205,15180,15138,15108,15074,15083,15072,15068,
+15081,15068,15007,14970,14902,14872,14707,14651,
+14587,14561,14533,14444,14392,14333,14320,14325,
+14366,14684,14950,15123,15445,15507,15646,15884,
+15979,16057,16158,16188,16215,16268,16301,16340,
+16423,16480,16549,16728,16839,16968,17268,17424,
+17576,17859,17976,18056,18125,18193,18146,17943,
+17807,17885,17999,17895,17594,17182,16998,16808,
+16830,16887,16952,17127,17168,17202,17210,17193,
+17185,17169,17178,17211,17312,17359,17383,17915,
+18220,18490,19002,19233,19436,19570,19623,19672,
+19745,19783,19806,19881,19932,19977,20081,20135,
+20185,20296,20353,20401,20506,20564,20631,20730,
+20743,20722,20629,20510,20366,20102,20000,19909,
+19706,19612,19530,19444,19453,19458,19577,19631,
+19645,19464,19295,19114,18351,17747,17317,17084,
+16971,16883,16886,16879,16876,16870,16870,16873,
+16930,16984,17062,17281,17408,17532,17777,17889,
+17987,18125,18158,18162,18089,18012,17912,17645,
+17485,17380,16981,16833,16707,16555,16497,16450,
+16423,16407,16389,16309,16242,16181,15942,15818,
+15653,15356,15209,15068,14810,14714,14596,14383,
+14294,14211,14054,13975,13881,13649,13527,13401,
+13142,13011,12883,12628,12500,12371,12108,11972,
+11837,11559,11424,11288,11012,10958,10860,10581,
+10612,10554,10225,10246,10281,10283,10257,10204,
+10141,10072,10012,10129,10123,9979,9919,9908,
+9887,9976,10013,10039,10200,10189,10238,10352,
+10399,10389,10481,10364,10526,10207,10209,10205,
+10149,10379,10105,10167,9999,10044,9875,9839,
+9801,9715,9674,9633,9570,9547,9527,9491,
+9473,9457,9429,9417,9405,9380,9364,9346,
+9300,9272,9241,9177,9143,9107,9032,8994,
+8958,8880,8842,8807,8742,8711,8674,8590,
+8547,8504,8417,8373,8327,8255,8235,8221,
+8252,8404,8450,8461,8391,8329,8217,8190,
+8239,8256,8258,8228,8110,7989,7979,7659,
+7527,7399,7252,7492,7474,7424,7471,7431,
+7579,7658,7616,7778,7671,7618,6840,6816,
+6785,6731,6807,7737,6690,6680,6674,6664,
+6663,6668,6684,6691,6701,6720,6730,6739,
+6754,6759,6762,6763,6759,6754,6738,6729,
+6720,6709,6710,6711,6714,6715,6716,6716,
+6715,6715,6712,6712,6715,6720,6724,6732,
+6748,6755,6761,6763,6762,6759,6467,6474,
+6472,6450,6440,6429,6403,6384,6373,6346,
+6334,6326,6322,6332,6343,6363,6375,6388,
+6415,6433,6449,6473,6482,6489,6499,6507,
+6515,6540,6557,6575,6604,6614,6623,6639,
+6645,6651,6666,6672,6674,6673,6670,6667,
+6674,6679,6689,6725,6748,6776,6850,6890,
+6933,7027,7077,7130,7234,7284,7333,7431,
+7471,7502,7576,7619,7666,7767,7811,7854,
+7938,7978,8015,8094,8146,8196,8296,8345,
+8396,8506,8562,8619,8730,8787,8832,8925,
+8972,9020,9171,9313,9405,9396,9466,9580,
+9748,9811,9888,9947,9954,9776,9784,9782,
+9780,9774,9775,9780,9806,9830,9861,9948,
+10006,10062,10200,10284,10377,10536,10618,10698,
+10849,10924,10998,11144,11208,11274,11401,11465,
+11518,11670,11703,11763,11879,11930,11976,12066,
+12191,12351,12721,12952,13130,13413,13615,13813,
+14036,14196,14303,14549,14632,14697,14808,14885,
+15196,15362,15453,15582,15715,15969,16182,16640,
+16842,17082,17551,17715,17875,18177,18336,18488,
+18988,19179,19511,18947,18840,18935,19267,19520,
+19848,20309,20439,20522,20552,20513,20443,20254,
+20158,20072,19955,19928,19929,20015,20071,20126,
+20275,20294,20216,20210,20198,20183,20164,20447,
+20477,20614,20589,20719,21141,21212,21165,21571,
+21627,21657,21691,21700,21684,21827,21864,21865,
+22137,22024,22405,22520,22543,22379,22966,22914,
+22966,23086,23052,23117,23169,23191,23178,23114,
+23065,23004,22877,22808,22744,22627,22581,22528,
+22426,22387,22314,22187,22049,21911,21167,21424,
+20834,20978,20159,20590,19833,20341,19548,20175,
+20186,19504,20049,20090,20086,20024,19982,19966,
+19903,19913,19713,19839,19754,19653,19268,19257,
+19256,19252,19249,19238,19622,19169,19095,18922,
+18828,18732,18545,18457,18380,18238,18174,18109,
+17975,17904,17828,17586,17510,17442,17338,17304,
+17282,17262,17263,17271,17300,17319,17337,17360,
+17363,17355,17329,17274,17214,17069,16991,16909,
+16739,16655,16804,16484,16379,16291,16132,16063,
+15997,15868,15805,15881,15776,15725,15676,15588,
+15549,15512,15447,15415,15381,15314,15275,15229,
+15137,15096,15060,14999,14965,14927,14867,14800,
+14731,14584,14506,14451,14426,14410,14392,14373,
+14366,14387,14453,14512,14574,14807,14918,14993,
+15072,15100,15105,15104,15097,15083,15063,15016,
+14989,14914,14723,14709,14755,14623,14697,14715,
+14712,14709,14707,14706,14667,14207,14184,14299,
+14320,14260,13959,13857,13865,13882,13977,14066,
+14184,14480,14760,14924,15199,15199,15293,15442,
+15514,15600,15842,16013,16211,16688,16959,17290,
+17715,17922,18090,18280,18297,18273,18118,17992,
+17845,17539,17382,17194,16830,16686,16724,16682,
+16771,16846,16709,16613,16316,16412,16405,16424,
+16624,16717,16852,16981,17042,17052,17058,17109,
+17091,17108,17138,17120,17059,17060,17076,18071,
+18572,19038,19914,20297,20601,20767,20792,20838,
+20888,20882,20887,20881,20888,20886,20904,20923,
+20951,21026,21076,21141,21287,21306,21186,21062,
+21002,20866,20192,20118,20049,19960,19834,19682,
+19341,19151,18954,18730,18708,18740,18920,19027,
+19110,19235,19295,19466,19564,19365,18903,18171,
+17963,17779,17616,17565,17534,17521,17517,17501,
+17392,17312,17208,17076,17056,17058,17216,17341,
+17470,17685,17756,17799,17820,17799,17758,17627,
+17538,17439,17221,17109,17000,16801,16719,16646,
+16523,16467,16413,16300,16242,16180,16048,15974,
+15895,15715,15620,15522,15328,15234,15142,14959,
+14873,14791,14632,14552,14458,14225,14093,13951,
+13623,13439,13245,12823,12599,12371,11908,11684,
+11474,11113,10958,10997,10660,10592,10451,10169,
+10053,9994,9886,9817,9755,9725,9504,9475,
+9424,9388,9414,9466,9491,9514,9555,9571,
+9585,9600,9604,9607,9612,9613,9617,9640,
+9642,9657,9687,9705,9757,9771,9751,9746,
+9689,9657,9619,9531,9488,9451,9394,9374,
+9358,9341,9339,9337,9333,9329,9322,9299,
+9278,9257,9213,9191,9172,9135,9118,9100,
+9063,9042,9017,8967,8940,8912,8855,8828,
+8801,8745,8719,8696,8654,8634,8608,8538,
+8499,8455,8356,8301,8244,8122,8063,8009,
+7923,7897,7877,8125,8128,8063,7900,7769,
+7677,7672,7744,7732,7673,7583,7517,7440,
+7379,7290,7498,7459,7462,7425,7412,7393,
+7345,7316,7283,7206,7182,7170,7192,7209,
+7225,7256,7267,7281,7335,7332,7344,7381,
+7400,7422,7465,7487,7508,7545,7560,7572,
+7589,7591,7592,7585,7574,7560,7526,7507,
+7488,7451,7438,7425,7402,7391,7382,7370,
+7365,7362,7362,7365,7369,7381,7387,7397,
+7419,7432,7446,7465,7475,7483,7499,7260,
+7272,7274,7272,7267,7255,7248,7240,7224,
+7215,7207,7186,7177,7173,7164,7158,7160,
+7168,7149,7140,7105,7090,7082,7063,7058,
+7057,7053,7046,7039,7008,6980,6949,6886,
+6859,6832,6791,6774,6759,6732,6722,6712,
+6715,6718,6724,6740,6753,6772,6834,6868,
+6903,6977,7020,7072,7187,7245,7299,7399,
+7430,7445,7474,7489,7506,7545,7558,7574,
+7616,7642,7671,7751,7814,7879,8008,8073,
+8137,8264,8327,8387,8502,8556,8611,8731,
+8768,8814,8901,8946,8992,9089,9138,9187,
+9287,9335,9383,9518,9501,9623,9715,9998,
+9899,9976,9701,10060,9785,9820,9859,9948,
+9997,10048,10162,10237,10319,10503,10741,10700,
+10910,11013,11108,11253,11305,11340,11398,11584,
+11574,11507,11720,11805,11781,11872,11999,12902,
+12666,13191,13193,13444,13507,13670,13778,13781,
+13624,13700,13840,14161,14267,14385,14620,14620,
+14686,14525,15331,15069,15195,15340,16238,16456,
+16079,16013,16292,16498,17493,18261,18446,18613,
+18681,18797,19288,19337,19383,19199,19737,20012,
+20327,20578,20762,20902,20999,21008,20999,20877,
+20786,20691,20535,20484,20449,20445,20468,20490,
+20522,20529,20533,20545,20550,20559,20596,20628,
+20668,21468,21605,21687,21817,21857,21897,21947,
+21954,21961,21981,22006,22020,22093,22170,22220,
+21654,21300,21327,21349,21549,21446,21648,21949,
+22143,22610,22719,22748,23186,23554,23456,23568,
+23617,23568,23479,23413,23335,23189,23116,23049,
+22925,22867,22807,22665,22562,22471,22158,22022,
+21864,21175,20701,21289,20746,21025,20243,20709,
+20167,20704,20561,20553,20516,20357,20317,20272,
+20144,20137,20014,19534,19542,19573,20325,20238,
+19777,19757,20096,19649,19506,19412,19298,19034,
+18903,18781,18552,18453,18373,18241,18185,18134,
+18049,18011,17976,17898,17861,17947,18149,17581,
+17566,17571,17590,17615,17657,17668,17668,17638,
+17598,17600,17436,17352,17267,17094,17009,16927,
+16774,16704,16632,16631,16514,16428,16286,16222,
+16160,16038,15976,15914,15931,15878,15824,15718,
+15668,15622,15535,15495,15457,15390,15355,15318,
+15250,15219,15189,15123,15080,15031,14908,14834,
+14753,14586,14553,14573,14646,14653,14639,14638,
+14654,14677,14736,14794,14825,14916,14956,14993,
+15037,15040,15018,14920,14917,14932,14842,14801,
+14826,14844,14767,14790,14801,14755,14790,14785,
+14775,14788,14798,14730,14470,14431,14392,14174,
+14244,14250,14250,14255,14269,14299,14404,14482,
+14571,14894,14978,15042,15067,15032,14850,14882,
+14986,15167,15734,16118,16491,17335,17746,18120,
+18630,18735,18720,18315,18004,17605,16933,16673,
+16463,16186,16116,16039,16017,16060,16282,16416,
+16469,16521,16222,16097,15999,16316,16541,16695,
+16863,16897,16947,17040,17084,17130,17192,17170,
+17191,17201,17227,17322,17427,17433,17506,18246,
+18803,19273,20111,20493,20788,20916,20976,21011,
+21064,21094,21087,21037,21068,21022,21057,21069,
+21066,21082,21094,21106,20901,20739,20388,19483,
+19567,19700,19964,19956,19870,19541,19382,19248,
+18926,18771,18652,18577,18644,18820,19262,19468,
+19631,19793,19795,19746,19384,19165,18943,18515,
+18339,18169,18013,17971,17942,17922,17904,17858,
+17702,17625,17578,17606,17668,17728,17814,17827,
+17818,17752,17695,17625,17481,17407,17330,17165,
+17080,16992,16812,16721,16632,16482,16439,16418,
+16420,16422,16415,16363,16316,16257,16107,16023,
+15935,15738,15637,15539,15348,15257,15168,14984,
+14899,14820,14669,14590,14495,14265,14139,14002,
+13692,13519,13337,12940,12727,12506,12045,11812,
+11584,11146,10945,10757,10513,10445,10330,10084,
+10148,10063,9851,9792,9738,9525,9484,9445,
+9268,9296,9320,9367,9387,9406,9439,9451,
+9458,9458,9452,9444,9425,9420,9417,9429,
+9446,9465,9517,9538,9561,9601,9609,9601,
+9556,9524,9487,9411,9375,9344,9298,9282,
+9271,9262,9262,9262,9260,9255,9247,9221,
+9202,9182,9147,9132,9119,9097,9088,9077,
+9054,9042,9027,8993,8969,8943,8882,8850,
+8820,8755,8724,8696,8642,8614,8582,8502,
+8459,8412,8308,8250,8194,8081,8026,7975,
+7893,7860,7833,7784,7764,7765,7858,7789,
+7717,7613,7585,7553,7521,7500,7465,7448,
+7425,7406,7703,7704,7698,7695,7660,7605,
+7530,7504,7489,7436,7426,7428,7477,7511,
+7550,7635,7678,7722,7804,7838,7866,7906,
+7921,7935,7960,7972,7986,8013,8026,8036,
+8051,8058,8062,8062,8055,8047,8026,8014,
+8004,7986,7985,7984,7989,7995,8002,8018,
+8028,8038,8060,8072,8084,8108,8121,8132,
+8154,8165,8174,8180,8183,8187,8197,7984,
+7992,7989,7984,7977,7952,7935,7915,7869,
+7843,7818,7773,7770,7771,7725,7645,7622,
+7597,7761,7572,7537,7513,7506,7504,7501,
+7491,7501,7461,7472,7418,7392,7387,7330,
+7289,7255,7213,7186,7167,7128,7108,7091,
+7067,7047,7025,6978,6957,6943,6954,6975,
+7003,7066,7100,7139,7229,7279,7327,7416,
+7443,7456,7477,7488,7499,7524,7530,7537,
+7563,7581,7603,7676,7739,7804,7943,8015,
+8089,8233,8304,8373,8499,8557,8610,8710,
+8756,8799,8886,8929,8974,9071,9121,9172,
+9266,9308,9347,9413,9437,9460,9497,9513,
+9531,9572,9768,9718,9709,9757,10308,9914,
+10361,10022,10131,10199,10273,10643,10533,10620,
+10942,11015,11113,11237,11439,11369,11427,11451,
+11459,11465,11490,11529,12069,12127,11959,12184,
+12529,12573,13450,13168,13299,13215,13415,13459,
+13569,13665,13825,14110,14278,14438,14658,14641,
+14703,14517,14382,14359,15271,15665,15794,16513,
+16562,16674,17033,16550,16674,16868,17895,18224,
+17753,18703,18946,19102,19085,19203,19360,19708,
+19975,20547,20777,20920,20944,21004,21082,21132,
+21163,21142,21056,21003,20960,20907,20886,20871,
+20748,20699,20667,20640,20638,20647,20696,20737,
+21205,21511,21632,21790,21893,21938,21966,21947,
+21945,21929,21919,21843,21735,21125,21070,21846,
+21083,21136,21216,21230,21267,21251,21227,21475,
+21447,21434,22178,22263,22645,22864,23025,23453,
+23601,23751,23912,23932,23927,23806,23718,23629,
+23473,23404,23335,23174,23076,22957,22678,22524,
+22367,22038,21860,21564,20827,21427,21313,21156,
+21125,20456,20941,20870,20843,20846,20763,20425,
+20066,20092,20117,20777,20797,20310,20273,20222,
+20143,19917,19799,19678,19428,19311,19194,18949,
+18842,18752,18598,18538,18497,18417,18372,18323,
+18215,18162,18114,18028,17984,17956,17913,17893,
+17884,17858,17860,17861,17837,17809,17771,17651,
+17577,17496,17322,17233,17145,16983,16910,16841,
+17162,17320,16656,16524,16478,16459,16358,16308,
+16260,16163,16112,16060,16090,16043,15996,15905,
+15862,15825,15755,15722,15691,15631,15596,15557,
+15474,15428,15378,15261,15191,15114,14947,14859,
+14776,14666,14693,14703,14724,14760,14757,14683,
+14700,14737,14789,14813,14843,14906,14912,14882,
+14902,14934,14948,14941,14938,14928,14892,14827,
+14792,14838,14834,14833,14801,14788,14814,14866,
+14836,14869,14821,14742,14612,14641,14694,14736,
+14677,14685,14694,14736,14778,14837,15122,15217,
+15307,15421,15421,15375,15114,14906,14679,14161,
+14122,14179,14805,15343,15940,17117,17681,18042,
+18388,18290,18015,17173,16749,16407,15997,15884,
+15834,15893,15989,16064,16188,16212,16200,16223,
+16185,15963,15776,15695,15758,16578,16858,17034,
+17095,17142,17184,17251,17277,17311,17417,17483,
+17573,17717,17737,17674,17646,17715,17849,18796,
+19266,19636,20357,20690,20961,21054,21076,21099,
+21115,21114,21113,21086,21056,21007,21027,21039,
+21007,20942,20887,20790,20463,19335,19138,19198,
+19308,19454,19676,19660,19604,19449,19359,19269,
+19118,19075,19076,19226,19362,19516,19839,19980,
+20083,20154,20120,20038,19648,19400,19154,18737,
+18570,18442,18387,18392,18403,18422,18434,18459,
+18538,18582,18622,18681,18699,18702,18685,18660,
+18619,18473,18345,18171,17811,17677,17594,17531,
+17519,17500,17436,17392,17340,17203,17118,17017,
+16811,16721,16647,16539,16493,16443,16313,16231,
+16136,15905,15781,15657,15413,15294,15178,14942,
+14833,14729,14533,14439,14335,14097,13970,13836,
+13544,13386,13224,12881,12699,12510,12120,11923,
+11726,11332,11134,10942,10576,10421,10280,10205,
+10100,10007,9848,9782,9720,9601,9541,9477,
+9248,9249,9251,9260,9268,9278,9307,9321,
+9334,9349,9352,9354,9356,9361,9370,9407,
+9436,9466,9528,9558,9584,9611,9608,9590,
+9521,9477,9429,9336,9297,9265,9224,9212,
+9203,9194,9191,9187,9170,9158,9144,9113,
+9094,9079,9057,9051,9049,9054,9057,9058,
+9048,9032,9010,8955,8922,8887,8818,8784,
+8750,8681,8649,8619,8562,8535,8503,8424,
+8382,8337,8238,8188,8142,8055,8014,7976,
+7905,7871,7843,7787,7759,7736,7707,7715,
+7816,7791,7755,7696,7620,7610,7596,7535,
+7523,7517,7793,7825,7830,7804,7778,7756,
+7780,7786,7780,7763,7775,7800,7889,7946,
+8007,8134,8195,8248,8328,8354,8372,8387,
+8390,8392,8397,8405,8416,8450,8470,8491,
+8538,8562,8587,8631,8644,8655,8671,8676,
+8681,8692,8701,8712,8733,8746,8758,8783,
+8796,8809,8840,8855,8872,8910,8929,8946,
+8973,8983,8990,8989,8985,8981,8973,8778,
+8775,8750,8734,8727,8773,8799,8797,8750,
+8849,8421,8316,8270,8229,8156,9036,8925,
+8036,8010,8829,7994,8788,8635,7891,7880,
+8351,7867,8494,7902,8220,8378,7805,7724,
+8024,7865,7564,7704,7502,7531,7417,7467,
+7391,7340,7325,7281,7252,7227,7191,7178,
+7172,7190,7209,7236,7299,7332,7366,7440,
+7467,7483,7512,7524,7535,7553,7553,7554,
+7565,7575,7591,7654,7715,7779,7925,8002,
+8081,8244,8325,8402,8545,8608,8666,8763,
+8804,8842,8911,8944,8979,9057,9100,9146,
+9239,9284,9326,9399,9425,9447,9479,9491,
+9504,9534,9555,9584,9660,9707,9761,9880,
+9942,10005,10125,10191,10258,10395,10643,10539,
+10689,10784,11109,11162,11654,11354,11910,11686,
+11440,11855,11496,11531,11626,11691,11802,12050,
+12933,12988,13100,12709,13341,13124,13216,13248,
+13434,13576,13599,13919,14051,14165,14475,14604,
+14491,13872,13908,13909,15090,15461,15784,15949,
+16366,16823,17338,17478,17732,16952,16953,18210,
+18385,18234,18325,18441,18549,18756,19171,19484,
+19837,20334,20546,20756,21420,21592,21884,21924,
+21828,21673,21461,21390,21397,21437,21478,21532,
+21558,21132,21043,20922,20882,20856,20855,20871,
+20911,21068,21134,21799,22002,22014,22028,21307,
+21893,21808,21801,21649,21163,21088,21059,21098,
+26243,26243,26261,26270,26296,26296,26303,26303,
+26309,26308,26302,26302,26301,26301,26294,26293,
+26296,26296,26311,26311,26352,26365,26379,26379,
+26364,26364,26292,26259,26172,26172,26285,26285,
+26345,26361,26365,26365,22728,22943,22764,21372,
+22292,21064,21789,21842,21891,21822,21683,20858,
+20788,20725,20637,20454,20348,20251,20058,19980,
+19925,20514,20462,20917,20781,20471,20537,19452,
+19714,20505,19361,20266,19591,18677,19111,18567,
+18461,18417,18387,18291,18225,18174,18073,18030,
+19329,17869,17808,17741,17803,17644,18896,17344,
+17266,17188,17081,17222,17006,16927,17779,18223,
+16760,16710,16663,16581,16560,16553,16563,16578,
+16594,16613,16610,16593,16521,16601,16554,16462,
+16423,16395,16350,16330,16306,16240,16190,16128,
+15979,15900,15822,15686,15630,15584,15518,15496,
+15478,15442,15422,15401,15360,15341,15325,15296,
+15281,15267,15242,15233,15232,15259,15284,15308,
+15365,15384,15393,15392,15379,15360,15285,15263,
+15251,15253,15260,15267,15273,15269,15273,15276,
+15291,15325,15430,15502,15582,15742,15813,15873,
+15950,15968,15980,16014,16047,16093,16217,16282,
+16336,16374,16355,16315,16144,16010,15854,15494,
+15301,14981,15025,15293,15715,16751,17225,17598,
+17845,17744,17536,16982,16754,16578,16447,16510,
+16652,16957,17077,17147,17138,17055,16926,16609,
+16504,16468,16489,16535,16592,16705,16764,16832,
+16900,16852,16799,17095,17224,17226,17299,17422,
+17734,18191,18299,18405,18480,18694,18864,19395,
+19633,19881,20447,20739,20997,21118,21143,21149,
+21106,21046,20965,20644,20639,20658,20585,20525,
+20467,20333,20223,19997,19372,19018,18891,19098,
+19226,19378,19692,19775,19846,19960,19999,20028,
+20060,20070,20089,20163,20232,21979,20326,20349,
+20351,20283,20219,20154,19972,19882,19806,19703,
+19668,19639,19660,19668,19680,20914,20951,20946,
+21206,21298,21335,21335,21224,21073,20695,20532,
+20398,20181,18627,18640,18743,18757,18727,18584,
+18513,18438,19030,19032,18980,18802,17843,17779,
+17672,17616,17553,17378,17268,17144,16857,16755,
+16577,16207,16034,15873,15589,15459,15332,15064,
+14938,14817,14590,14482,14505,14108,13933,13758,
+13395,13208,13024,12661,12571,12370,12233,11883,
+11755,11512,11392,11268,11204,11049,10906,10631,
+10497,10365,10114,10000,9894,9725,9625,9550,
+9338,9358,9384,9445,9473,9496,9519,9514,
+9496,9436,9389,9341,9257,9232,9222,9252,
+9288,9330,9424,9470,9509,9551,9550,9528,
+9455,9412,9371,9302,9279,9263,9242,9233,
+9221,9183,9157,9126,9056,9026,9001,8967,
+8957,8953,8963,8973,8987,9001,8997,8984,
+8933,8896,8854,8766,8725,8686,8618,8588,
+8558,8496,8465,8434,8369,8335,8299,8222,
+8185,8151,8089,8060,8041,8004,7984,7964,
+7919,7899,7884,7857,7856,7860,7893,7924,
+8050,8149,8161,8169,8149,8158,8150,8126,
+8093,8037,8198,8197,8227,8250,8275,8314,
+8411,8457,8507,8611,8667,8725,8864,8939,
+9016,9175,9254,9326,9447,9494,9532,9581,
+9596,9604,9620,9630,9644,9686,9708,9726,
+9769,9793,9817,9880,9904,9928,9986,10017,
+10051,10127,10168,10207,10278,10303,10322,10334,
+10329,10319,10295,10282,10272,10261,10260,10259,
+10257,10253,10245,10208,10183,10162,10150,9994,
+10039,10142,10100,10609,9640,9603,9558,10938,
+9489,9409,10515,10523,10406,10174,10293,10310,
+8864,10434,10170,9918,9984,9905,9864,10002,
+8643,8607,10049,8561,8498,9875,9696,8440,
+9590,8365,9459,9296,9375,9466,8223,9439,
+8977,8179,9026,8917,8042,8862,7999,8619,
+8361,8283,7922,7897,7825,7784,7739,7665,
+7645,7633,7632,7640,7653,7693,7710,7724,
+7749,7756,7762,7789,7824,7861,7946,7996,
+8051,8180,8254,8330,8482,8556,8626,8748,
+8801,8850,8937,8974,9010,9076,9105,9132,
+9180,9202,9224,9273,9299,9329,9396,9431,
+9465,9541,9576,9607,9672,9685,9726,9828,
+9890,9960,10116,10202,10286,10433,10499,10558,
+10668,10719,10769,10873,10928,10985,11103,11158,
+11212,11364,11538,11777,11484,11535,11596,12340,
+11821,12122,12001,12044,12720,12327,12898,12528,
+12925,13075,13369,13573,13401,13818,14131,14255,
+14299,14169,14122,13985,13914,14017,14167,14492,
+14697,16046,15598,15803,16016,16608,16897,17052,
+17322,17487,17650,18144,18021,17837,18121,18230,
+18165,18863,18954,18915,18783,19395,19172,19594,
+19852,20109,20561,20730,20893,21228,21410,21610,
+22035,22366,22393,21614,21561,21530,21456,21427,
+21398,21336,21322,21336,21602,21635,21738,21774,
+21747,21712,21485,21533,21581,26233,26241,26241,
+26259,26259,26280,26291,26325,26325,26326,26326,
+26335,26334,26323,26323,26325,26325,26313,26311,
+26313,26313,26327,26327,26385,26412,26417,26417,
+26416,26416,26413,26412,26406,26406,26424,26424,
+26418,26412,26391,26391,26386,26386,26375,26367,
+26336,23132,22549,22154,21135,20892,20924,20500,
+20488,20239,20187,19865,19855,19786,19980,21454,
+21389,21247,21102,20539,21631,20595,20540,20314,
+20150,19980,20982,20775,19165,20544,20397,20315,
+18739,18688,20077,19810,18368,18275,18099,18022,
+17953,17903,18078,19095,17496,17409,17339,18799,
+18690,17080,17000,17184,18203,16898,16860,16806,
+16706,16871,17265,16601,16585,16588,16647,16687,
+16727,16779,16783,16766,16677,16617,16686,16578,
+16536,16504,16469,16463,16457,16435,16410,16371,
+16258,16192,16125,16006,15958,15921,15876,15865,
+15857,15846,15840,15830,15809,15797,15784,15762,
+15756,15745,15715,15706,15701,15720,15737,15756,
+15789,15799,15799,15785,15767,15745,15696,15677,
+15673,15689,15701,15713,15734,15745,15762,15800,
+15826,15858,15945,16007,16080,16243,16323,16393,
+16492,16513,16519,16502,16486,16474,16463,16460,
+16455,16438,16429,16426,16394,16357,16310,16190,
+16133,16114,16156,16423,16771,17521,17823,18019,
+17928,17683,17391,16932,16992,16938,17009,17128,
+17284,17464,17600,17684,17716,17671,17592,17392,
+17312,17263,17172,17137,17109,17082,17093,17125,
+17131,17151,17270,17349,17369,17481,18251,18328,
+18388,18590,18694,18649,18605,18938,19268,19695,
+19934,20168,20523,20696,20929,21011,21023,21023,
+20986,20949,20657,20411,20501,20527,20368,20321,
+20257,20089,19923,19482,18836,18892,19016,19289,
+19440,19608,19938,20020,20092,20257,20352,20456,
+20714,23039,22779,22532,22464,22409,22143,22069,
+21997,21869,21819,20719,22329,22372,22549,22749,
+23311,23496,24124,23837,24324,24734,24833,25039,
+25019,24756,21902,22091,22065,22063,21765,21567,
+21424,21138,20919,19147,18578,18331,18151,17922,
+17928,17962,18010,18006,17983,17893,17829,17759,
+17604,17526,17450,17294,17212,17127,16939,16836,
+16724,16479,16299,16129,15806,15657,15515,15229,
+15099,14979,14760,14658,14538,14392,14181,13987,
+13586,13383,13186,12791,12598,12415,12623,12528,
+12396,11924,11464,11338,11215,11092,10964,11077,
+10586,10427,10156,10040,9935,9768,9698,9641,
+9641,9680,9536,9562,9572,9575,9549,9518,
+9474,9364,9304,9248,9174,9150,9146,9193,
+9239,9293,9406,9459,9503,9551,9551,9531,
+9459,9415,9372,9295,9263,9237,9190,9167,
+9141,9083,9052,9023,8968,8950,8937,8932,
+8938,8950,8983,8998,9007,9001,8980,8950,
+8863,8810,8756,8644,8593,8548,8480,8452,
+8427,8377,8351,8326,8274,8247,8217,8150,
+8115,8081,8009,7973,7945,7889,7862,7837,
+7793,7780,7789,7821,7855,7892,7982,8022,
+8090,8245,8291,8334,8348,8369,8361,8299,
+8272,8251,8488,8515,8549,8632,8679,8727,
+8830,8883,8938,9056,9122,9192,9359,9449,
+9543,9732,9825,9911,10058,10119,10171,10251,
+10281,10303,10347,10371,10399,10466,10498,10523,
+10575,10599,10621,10656,10660,10664,10694,10720,
+10755,10846,10904,10962,11072,11117,11153,11191,
+11192,11185,11160,11139,11115,11074,11058,11044,
+11027,11016,11006,10928,10891,10853,10779,10748,
+10525,10449,10483,11294,11494,11375,11285,11610,
+11517,11442,11598,9924,11533,11323,11251,9715,
+11060,11025,10979,10850,9368,10748,10603,9297,
+10655,10410,10374,10356,10171,9024,10273,10004,
+9886,9828,8587,9886,8537,8494,9865,8454,
+9533,9402,9336,9223,8457,9300,9353,9085,
+8351,8343,9160,8884,8220,8723,8474,8452,
+8048,8008,7907,7873,7838,7799,7794,7796,
+7817,7833,7847,7885,7922,7958,8039,8084,
+8132,8244,8304,8368,8496,8557,8617,8718,
+8763,8805,8884,8924,8965,9045,9082,9117,
+9175,9199,9220,9262,9284,9309,9381,9421,
+9465,9558,9605,9650,9731,9769,9806,9884,
+9926,9974,10085,10153,10223,10365,10436,10503,
+10601,10652,10703,10806,10861,10918,11030,11090,
+11147,11247,11290,11332,11416,11462,11514,11644,
+11954,11789,12358,11980,12013,12119,12116,12582,
+12763,12432,12665,12978,12963,12927,13613,13730,
+13809,13908,14118,13916,14049,13950,14085,14420,
+14594,14782,15152,15341,15496,16288,16092,16153,
+16712,16906,17143,17480,17683,17807,18219,18398,
+18536,17922,18250,18457,19036,19324,19598,20179,
+20473,24085,24315,24304,24384,21168,21607,22205,
+22405,22392,22350,22153,22091,21836,21807,21792,
+21753,21670,21624,21586,21587,21631,21660,21728,
+21749,21776,26235,26235,26253,26259,26275,26275,
+26259,26259,26280,26291,26325,26325,26326,26326,
+26335,26334,26323,26323,26325,26325,26313,26311,
+26313,26313,26327,26327,26385,26412,26417,26417,
+26416,26416,26413,26412,26406,26406,26424,26424,
+26418,26412,26391,26391,26386,26386,26375,26367,
+26336,26336,25643,23184,22754,21537,22146,21119,
+21555,21604,21690,21834,21914,21978,22101,22221,
+22233,21472,21086,21081,21983,21007,20982,20846,
+20719,20579,21516,21388,19871,21157,19620,19451,
+19134,18988,20345,18568,18414,18279,18057,18116,
+19439,19262,19126,17631,17500,17435,18881,17225,
+17164,17109,17031,16995,16962,17690,18048,16824,
+16700,16650,16610,16574,16576,16592,16659,16695,
+16733,16762,16739,16685,16510,16416,16474,16347,
+16305,16281,16270,16280,16302,16350,16363,16362,
+16318,16279,16235,16149,16116,16094,16093,16112,
+16136,16182,16196,16204,16203,16195,16185,16171,
+16168,16169,16168,16169,16173,16192,16204,16215,
+16233,16238,16239,16232,16222,16212,16195,16191,
+16195,16220,16240,16263,16321,16352,16388,16446,
+16465,16480,16509,16535,16571,16666,16720,16777,
+16879,16912,16932,16928,16906,16875,16803,16773,
+16748,16721,16725,16745,16790,16811,16842,16921,
+16965,17013,17154,17262,17247,17549,17666,17731,
+17607,17477,17349,17378,17356,17350,17333,17315,
+17325,17533,17726,17802,18146,18248,18300,18270,
+18204,18115,17865,17715,17553,17230,17074,16943,
+16974,17145,17363,17846,18079,18337,18635,18654,
+18684,18816,18912,19016,19169,19298,19306,19578,
+19873,20165,20596,20764,20893,20903,20897,20893,
+20749,20358,20263,20363,20333,20301,20240,20204,
+20124,19808,19284,18954,19059,19178,19353,19711,
+19898,20097,20491,20610,20706,23550,23567,23614,
+23484,23473,23216,22921,22823,22753,22552,22512,
+22494,22541,22610,22706,23682,23784,23927,23727,
+24176,24394,24656,24867,24972,25147,25104,25031,
+24858,25008,25302,24979,22341,22351,22553,22482,
+22376,21434,21299,21025,21109,19848,19624,19011,
+18774,18576,18231,18110,17965,17855,17814,17768,
+17651,17584,17514,17371,17299,17227,17081,17001,
+16913,16952,16834,16409,16075,15924,15780,15490,
+15364,15249,15048,14952,14837,14548,14524,14287,
+13844,13624,13407,12976,12766,12563,12192,12382,
+12328,11668,11522,11385,11248,11118,10983,10702,
+10641,10667,10483,10182,10037,9901,9844,9788,
+9597,9607,9627,9606,9561,9514,9417,9364,
+9312,9216,9178,9148,9123,9131,9152,9232,
+9287,9341,9442,9485,9519,9549,9543,9515,
+9433,9384,9337,9244,9203,9165,9094,9061,
+9029,8965,8938,8915,8885,8881,8884,8915,
+8936,8960,9004,9015,9015,8982,8948,8904,
+8800,8746,8694,8590,8546,8506,8441,8415,
+8391,8345,8322,8296,8236,8201,8162,8070,
+8018,7965,7854,7800,7762,7701,7676,7662,
+7675,7781,7851,7951,7970,7984,8178,8205,
+8221,8224,8306,8373,8458,8493,8531,8547,
+8547,8559,8837,8884,8931,9028,9075,9123,
+9236,9300,9371,9528,9615,9708,9915,10020,
+10124,10321,10412,10493,10633,10694,10748,10844,
+10888,10927,11010,11058,11109,11225,11279,11323,
+11405,11436,11461,11483,11470,11451,11425,11425,
+11434,11487,11536,11594,11734,11807,11877,11996,
+12051,12088,12108,12106,12101,12095,12094,12094,
+12091,12090,12080,12690,12648,12641,12562,12568,
+12546,12474,12429,12429,12679,12597,12553,12269,
+12228,12217,10779,12176,12090,11923,11904,11843,
+11683,10185,11508,11348,11242,11235,11089,11025,
+10953,9558,11043,10924,10734,10672,10594,9215,
+10698,9084,10359,9012,10353,10075,8894,10121,
+9736,9635,8763,8637,9731,8566,8539,9524,
+9571,9511,9534,8564,9478,8519,9274,8462,
+9155,9012,8382,8960,8307,8635,8163,8100,
+8012,7973,7955,7972,8006,8039,8112,8152,
+8198,8304,8363,8424,8546,8602,8654,8734,
+8767,8797,8855,8887,8922,9001,9044,9086,
+9162,9193,9221,9269,9290,9313,9375,9412,
+9451,9542,9591,9641,9742,9789,9835,9925,
+9970,10018,10121,10181,10243,10363,10420,10473,
+10568,10620,10648,10733,10779,10832,10949,11009,
+11069,11176,11224,11267,11346,11388,11436,11557,
+11622,11693,11834,11885,12434,12019,12563,12517,
+12181,12215,12706,12415,12584,12797,12644,12737,
+12869,13571,13608,13877,14249,14490,14693,15222,
+14447,15648,15046,15731,15944,15685,15786,15896,
+16717,16990,17335,17931,17988,18408,18930,19181,
+19514,20216,20562,20870,20262,20345,20511,24536,
+24571,24548,24474,24356,24369,21480,24081,24323,
+24489,24450,24833,24986,22301,22333,22387,26428,
+26402,26383,26314,26314,26197,26197,26204,26209,
+26228,26228,26235,26235,26253,26259,26275,26275,
+26444,26444,26436,26439,26447,26447,26437,26437,
+26429,26426,26424,26424,26418,26418,26413,26408,
+26384,26384,26357,26357,26338,26335,26340,26340,
+25835,25825,25842,25834,25809,25804,25777,25754,
+25741,25715,25691,25683,25659,25663,25674,26343,
+26363,26363,26344,26344,25508,25458,25131,25109,
+25058,25058,25051,25060,25056,25062,25349,25325,
+25185,22838,22107,22046,22677,22635,22655,22372,
+22204,20495,21962,20132,20127,21544,21265,19696,
+20461,20099,18786,19564,19469,19462,19308,19268,
+18822,19060,17945,17848,17627,17757,17396,17202,
+17102,17025,17409,16857,16812,16776,16774,16778,
+16794,16793,16779,16759,16727,16685,16569,16506,
+16438,16293,16215,16134,15989,15931,15888,16007,
+16017,16042,16119,16165,16212,16288,16311,16313,
+16271,16242,16220,16224,16255,16304,16459,16551,
+16640,16760,16779,16773,16706,16669,16646,16683,
+16755,16858,17102,17202,17268,17314,17304,17285,
+17254,17251,17262,17329,17376,17424,17489,17495,
+17483,17418,17373,17330,17267,17257,17262,17307,
+17336,17363,17402,17419,17438,17468,17482,17496,
+17519,17523,17522,17505,17487,17464,17401,17366,
+17332,17280,17272,17278,17286,17288,17306,17375,
+17417,17459,17528,17553,17576,17601,17609,17614,
+17589,17563,17533,17501,17526,17597,17866,18034,
+18221,18484,18570,18605,18317,18061,17701,17168,
+17157,17227,18012,18231,18424,18627,18689,18743,
+18851,18902,18927,19435,19574,19704,19984,20155,
+20181,19854,19776,19874,19943,19866,20053,20142,
+20202,20314,20558,20635,20709,20597,20449,20360,
+20362,20395,20361,20336,20352,20384,20404,20424,
+20326,20358,20470,20762,23290,23411,23935,24201,
+24298,24314,24402,24413,24351,24288,24115,24403,
+23925,23941,24172,24208,24246,24294,24453,24526,
+24582,24404,24769,24871,24997,24992,25040,25044,
+25114,25196,25245,25357,25599,25180,25112,25209,
+25057,25033,25012,25012,25038,25634,25203,25183,
+25195,25380,25338,25375,23179,23031,22823,21841,
+21643,21640,21255,20550,20390,19955,19690,20560,
+19334,19178,19927,18776,18671,18566,18346,18230,
+18108,17806,17651,17498,17207,17065,16925,16763,
+16715,16652,16359,16115,15647,15215,14989,14970,
+14302,14044,13799,13324,13096,12875,12456,12261,
+12078,11791,11613,11457,11320,11193,11065,10810,
+10686,10566,10344,10251,10161,10004,9926,9852,
+9635,9634,9632,9613,9596,9573,9521,9486,
+9451,9390,9371,9360,9368,9384,9406,9459,
+9485,9507,9533,9539,9539,9517,9494,9451,
+9348,9297,9247,9164,9135,9117,9091,9083,
+9074,9056,9049,9043,9033,9032,9035,9052,
+9065,9080,9101,9102,9093,9037,8992,8940,
+8824,8765,8710,8593,8539,8488,8390,8342,
+8292,8182,8128,8079,8004,7975,7954,7915,
+7899,7886,7881,7909,7970,8115,8180,8242,
+8357,8398,8434,8531,8498,8522,8579,8625,
+8677,8783,8834,8881,8961,8997,9034,9114,
+9156,9198,9506,9562,9618,9731,9792,9855,
+10010,10099,10194,10397,10503,10610,10837,10946,
+11054,11264,11367,11466,11657,11749,11839,12005,
+12080,12143,12253,12299,12341,12415,12436,12444,
+12448,12445,12441,12432,12421,12417,12421,12443,
+12476,12624,13509,12835,13874,14052,14159,14361,
+14450,14560,14740,14784,14801,14846,14832,14817,
+14794,14902,14885,14796,14763,14715,14632,14590,
+14525,14373,14308,14249,14138,14074,13999,13796,
+13698,13610,13215,13123,13013,12834,12694,12594,
+12380,12271,10814,12021,11836,11658,11634,10118,
+10062,11370,11250,11130,10979,10907,10852,10723,
+10649,10614,10464,9508,10636,10455,10334,10297,
+10195,10152,9339,10309,9562,9557,9549,10119,
+10334,10222,10235,10312,10008,10049,9073,9884,
+9788,8943,8913,10003,9919,8881,9756,9682,
+8768,8774,9451,8707,9199,8577,8521,8493,
+8607,8461,8478,8512,8596,8642,8686,8757,
+8787,8817,8878,8908,8939,9003,9034,9063,
+9121,9147,9175,9235,9263,9299,9370,9403,
+9434,9496,9528,9564,9648,9698,9752,9875,
+9943,10013,10157,10232,10304,10428,10481,10527,
+10606,10637,10671,10737,10774,10811,10885,10930,
+10975,11064,11108,11151,11235,11280,11327,11425,
+11477,11528,11603,11632,11659,11700,11719,11747,
+11815,11852,11897,12001,12062,12121,12259,12334,
+12394,12529,12655,12785,13100,13270,13444,13794,
+13985,14176,14542,14719,14905,15284,15478,15695,
+16813,16349,16851,17869,18095,18320,18891,19197,
+19591,20375,20849,21368,21171,20945,24420,24632,
+24634,24497,24454,24393,24432,24436,24688,24710,
+24918,24926,25201,25340,26511,26511,26492,26492,
+26461,26449,26423,26423,26389,26389,26381,26379,
+26377,26377,26389,26389,26401,26406,26421,26421,
+26444,26444,26436,26439,26447,26447,26437,26437,
+26429,26426,26424,26424,26418,26418,26413,26408,
+26384,26384,26357,26357,26338,26335,26340,26340,
+25841,25833,25863,25835,25828,25834,25845,25853,
+25842,25829,25886,25831,25786,25734,25699,26343,
+26363,26363,26344,26344,25586,25507,25456,25385,
+25122,25100,25064,25045,25051,25087,25240,25494,
+25490,25500,25474,25445,25443,25417,25145,22310,
+22077,21822,25106,22326,24274,20302,20095,19876,
+19365,19157,19040,18805,18745,20141,19761,19807,
+18531,18380,18408,18308,17885,17783,17690,17572,
+17511,17460,17465,17684,17612,17242,17208,17187,
+17184,17186,17183,17151,17114,17060,16885,16779,
+16675,16465,16390,16344,16311,16308,16319,16373,
+16571,16610,16687,16726,16766,16839,16870,16888,
+16882,16860,16836,16811,16827,16867,17015,17110,
+17204,17352,17392,17405,17378,17358,17352,17448,
+17564,17708,18038,18158,18231,18253,18222,18178,
+18077,18042,18019,18009,18012,18011,17984,17954,
+17918,17840,17805,17782,17777,17796,17824,17895,
+17929,17959,18000,18019,18041,18072,18082,18086,
+18071,18048,18017,17940,17898,17857,17782,17748,
+17717,17661,17635,17614,17542,17500,17478,17504,
+17541,17590,17680,17716,17746,17785,17801,17820,
+17858,17887,17924,18029,18097,18174,18319,18376,
+18417,18397,18315,18028,17666,17541,17512,18325,
+18859,18791,18588,18499,18406,18082,17844,17628,
+17409,17403,17437,17954,18607,19396,19820,19936,
+20007,20132,20285,20300,20049,20217,20135,20502,
+20237,20210,20477,20566,20584,20637,20659,20632,
+20664,20684,20711,20795,20802,20708,21003,21363,
+23479,23820,24254,24349,24099,24132,24434,24470,
+24535,24556,24616,24597,24544,24704,24623,24626,
+24421,24505,24543,24561,24601,24745,24883,24944,
+25037,25103,25127,25200,25220,25197,25277,25677,
+25338,25763,25807,25362,25488,25836,25805,25281,
+25391,25631,25601,25583,25455,25420,25087,25080,
+25064,25063,25407,25438,25419,25368,25250,24550,
+22293,22957,21912,22575,22287,21830,21138,21000,
+21378,21223,20669,20469,20951,20677,20145,20256,
+19797,19829,19199,18986,18660,18531,18125,17679,
+17448,17213,16716,16544,16223,15602,15305,15021,
+14533,14277,14049,13632,13427,13224,12816,12614,
+12414,12052,11872,11689,11543,11430,11324,11133,
+11042,10951,10765,10673,10574,10362,10250,10136,
+9983,9946,9767,9718,9700,9684,9661,9649,
+9635,9607,9595,9587,9581,9586,9595,9624,
+9642,9657,9674,9678,9679,9668,9652,9619,
+9545,9509,9477,9428,9416,9411,9406,9403,
+9397,9378,9366,9352,9324,9313,9306,9308,
+9317,9331,9359,9365,9360,9305,9258,9200,
+9064,8994,8927,8793,8731,8676,8583,8546,
+8515,8477,8471,8473,8492,8503,8511,8514,
+8508,8502,8492,8492,8509,8564,8593,8623,
+8674,8703,8739,8816,8861,8915,9042,9093,
+9142,9231,9271,9307,9376,9411,9447,9521,
+9559,9598,9885,9942,9998,10111,10171,10233,
+10384,10471,10563,10760,10861,10964,11183,11290,
+11394,11598,11699,11799,11993,12089,12181,12355,
+12433,12502,12624,12679,12734,12838,12878,12906,
+12990,12993,12997,13036,13049,13063,13816,13133,
+13187,14086,14055,13420,13590,13708,13884,14947,
+15038,15115,15248,15276,15185,14421,15270,15265,
+15364,14380,15252,15249,15224,15169,14850,15002,
+14943,14600,14516,14687,14603,14527,14589,14416,
+14296,14164,13703,13560,13445,13193,13063,12911,
+12752,12569,11062,12247,12096,11945,11785,11701,
+11607,11436,11380,10000,11263,11028,9921,10955,
+10825,10735,10623,10586,10653,10508,10446,10369,
+10369,10255,10199,9699,9715,10485,9770,10508,
+10454,9662,10371,10471,10036,10081,10030,9205,
+9202,10210,10160,10257,9044,10295,10144,8925,
+8909,9847,8839,9053,9489,9275,8753,8761,
+8811,8653,8645,8648,8674,8695,8720,8763,
+8786,8811,8873,8906,8939,9002,9027,9048,
+9083,9100,9122,9181,9223,9271,9366,9412,
+9453,9534,9576,9620,9719,9775,9834,9962,
+10027,10090,10210,10268,10324,10418,10460,10501,
+10581,10622,10663,10745,10787,10826,10913,10955,
+11002,11085,11132,11179,11274,11320,11365,11449,
+11488,11523,11570,11590,11612,11655,11680,11713,
+11790,11831,11874,11965,12008,12056,12156,12211,
+12271,12419,12530,12675,12993,13160,13329,13662,
+13840,14018,14366,14541,14716,15083,15270,15460,
+15905,16152,16482,17482,17805,18363,18849,19042,
+19441,20460,20980,21360,21849,24796,24586,24593,
+24612,24549,24509,24465,24513,24565,24790,24808,
+24968,24959,25203,25359,26511,26511,26492,26492,
+26461,26449,26423,26423,26389,26389,26381,26379,
+26377,26377,26389,26389,26401,26406,26421,26421,
+26501,26501,26511,26510,26496,26496,26468,26468,
+26453,26448,26440,26440,26394,26394,25313,25415,
+25421,25526,25701,25752,25801,25963,26039,26066,
+26093,26017,26042,25983,25980,25972,26060,26024,
+26110,26086,25966,26044,25921,25822,25746,25729,
+25724,25714,25725,25729,25716,25688,25647,25627,
+25443,25337,25137,25141,25183,25188,25335,25426,
+25576,25591,25583,25566,25362,25323,25352,25315,
+25257,25152,24948,24837,22261,21791,21660,21503,
+21054,20746,20482,20268,20193,20126,19957,19925,
+19799,19443,19231,19020,18824,19078,19051,18858,
+18762,19043,19002,18611,18555,18337,18499,18424,
+18092,18252,18056,18016,17967,17906,17860,17632,
+17507,17314,17243,17197,17177,17191,17209,17227,
+17217,17357,17326,17317,17316,17341,17364,17394,
+17450,17471,17491,17536,17572,17628,17816,17939,
+18089,18341,18446,18533,18655,18708,18758,18865,
+18931,19013,19210,19299,19367,19398,19359,19299,
+19164,19091,19025,18917,18866,18815,18710,18660,
+18621,18594,18609,18642,18752,18815,18868,18941,
+18952,18944,18878,18837,18801,18737,18713,18692,
+18657,18632,18600,18529,18493,18458,18405,18393,
+18392,18405,18401,18380,18258,18271,18259,18184,
+18138,18095,18037,18002,17951,17980,18049,18109,
+18180,18199,18205,18190,18174,18157,18149,18166,
+18197,18275,18294,18166,18101,18050,18753,18665,
+18488,18416,18497,18653,18882,19183,19217,19228,
+19175,19040,18802,18628,18677,18709,19239,19578,
+19882,20372,20556,20690,20751,20683,20635,20481,
+20280,20208,20285,20361,20581,20707,20772,20826,
+20966,21062,21163,21390,21568,23717,23649,23854,
+24007,24254,24372,24413,24232,24168,24234,24295,
+24288,24286,24318,24354,24617,24371,24595,24625,
+24556,24614,24815,24806,24786,24917,25077,25104,
+25101,25235,25496,25286,25675,25338,25316,25439,
+25683,25426,25512,25825,25757,25735,25716,25729,
+25687,25648,25602,25568,25543,25469,25519,25389,
+25434,25024,25041,25244,25396,25277,25389,25254,
+25256,25174,23024,22931,22819,21960,22029,21845,
+22325,22115,21731,21746,21732,21709,21620,21537,
+21425,21578,20736,20428,19776,19442,19117,18509,
+18223,17948,17919,17092,16768,16173,15824,15497,
+14898,14683,14415,13987,13799,13606,13224,13035,
+12842,12452,12267,12090,11922,11800,11691,11492,
+11397,11303,11110,11009,10901,10659,10528,10393,
+10198,10145,10099,9881,9865,9857,9867,9875,
+9882,9890,9889,9884,9869,9862,9859,9862,
+9867,9869,9859,9854,9850,9845,9844,9830,
+9800,9788,9776,9759,9756,9755,9747,9738,
+9726,9690,9670,9648,9608,9595,9590,9602,
+9619,9640,9680,9691,9690,9639,9592,9536,
+9408,9347,9297,9205,9171,9144,9108,9096,
+9089,9089,9097,9110,9146,9165,9179,9196,
+9198,9197,9185,9180,9189,9210,9219,9229,
+9254,9277,9310,9390,9437,9486,9587,9623,
+9657,9722,9754,9782,9831,9852,9875,9923,
+9950,9981,10058,10292,10343,10452,10510,10574,
+10732,10822,10919,11122,11225,11330,11550,11656,
+11757,11953,12049,12145,12340,12437,12537,12734,
+12831,12923,13099,13186,13272,13506,13593,13619,
+13657,13676,13695,14292,14054,13614,13541,13547,
+13552,13655,13733,13817,15130,15190,15169,14559,
+14666,14754,14884,14927,15891,15915,15966,15991,
+15891,16001,16017,15898,15903,15009,15796,15785,
+15782,15614,15345,15276,15067,15110,15005,14774,
+14457,14194,14088,13917,13762,13391,13254,13120,
+11446,12713,12486,12223,12210,12050,12026,11884,
+11782,11540,10202,10083,11186,11020,9747,10963,
+10971,10825,10663,10603,10601,10493,10450,10384,
+10298,10239,9948,9736,9764,10679,9795,10800,
+9724,10848,9666,9648,10318,10252,10164,9325,
+9337,10124,10131,9790,9283,10372,9248,9181,
+9041,9008,9191,9498,8894,8884,8890,8928,
+8928,8872,8804,8806,8804,8805,8808,8811,
+8819,8835,8887,8920,8953,9014,9037,9053,
+9076,9086,9101,9158,9197,9239,9326,9369,
+9410,9495,9543,9596,9722,9793,9867,10019,
+10092,10159,10271,10321,10366,10445,10483,10522,
+10613,10698,10780,10882,10876,10977,11008,11103,
+11122,11162,11262,11292,11374,11422,11417,11477,
+11530,11523,11539,11545,11552,11578,11597,11626,
+11707,11753,11806,11920,11978,12045,12174,12238,
+12303,12441,12541,12670,12948,13098,13255,13583,
+13770,13960,14339,14531,14725,15124,15326,15520,
+15922,16144,16391,17035,18105,18665,19152,19523,
+19933,20827,21222,21708,22156,22312,25243,25199,
+25145,25088,24712,24680,24603,24603,24594,24613,
+24664,24658,24799,24827,26450,26450,26532,26532,
+26562,26565,26550,26550,26532,26532,26518,26516,
+26516,26516,26498,26498,26524,26538,26550,26550,
+26519,26519,26527,26524,26503,26503,26475,26475,
+26461,26454,26437,26437,26364,26364,25350,25411,
+25424,25534,25763,25850,25948,26085,26135,26147,
+26062,26102,26053,26000,26023,26030,26079,26082,
+26005,25985,25971,25946,25948,25891,25889,25875,
+25866,25886,25820,25792,25769,25815,25822,25807,
+25767,25807,25726,25192,25194,25167,25212,25333,
+25366,25277,25301,25150,25155,25160,25191,25199,
+25228,25247,25306,25327,25316,25294,25261,25222,
+25206,25194,25147,25169,25126,25093,24964,24830,
+24673,22984,22783,22617,21866,21729,21780,21452,
+21830,21788,21242,21513,21427,21286,21228,20799,
+20760,20781,21083,20818,20832,20955,20734,20657,
+20580,20413,20349,20304,20275,20287,20302,20302,
+20277,20240,20221,20149,20072,19942,19892,19848,
+19782,19757,19736,19716,19717,19733,19841,19953,
+20097,20437,20614,20774,20999,21059,21083,20980,
+20866,20742,20591,20573,20608,20665,20615,20555,
+20403,20316,20253,20223,20239,20269,20353,20391,
+20425,20472,20485,20490,20480,20466,20410,20305,
+20244,20155,19885,19737,19601,19372,19280,19196,
+19060,19028,19025,19054,19060,19065,19099,19138,
+19188,19274,19286,19269,19106,18966,18825,18689,
+18716,18719,18746,18703,18656,18545,18564,18591,
+18590,18565,18535,18455,18410,18364,18285,18257,
+18258,18292,18357,18873,20765,20666,20455,19724,
+19129,18770,18583,18820,19019,19197,19497,19620,
+19526,19439,19383,19381,19388,19354,19149,18987,
+18815,18638,18677,18835,19445,19829,20126,20741,
+20985,21239,21598,21574,21430,21157,23257,23263,
+23415,23522,23755,24103,24282,24461,24518,24563,
+24532,24438,24334,24320,24301,24334,24423,24854,
+24825,24591,24917,24720,24833,25072,25093,25115,
+25149,25156,25222,25265,25327,25441,25737,25698,
+25716,25718,25878,25764,25752,25738,25733,25828,
+25793,25816,25837,25827,25841,25682,25740,25730,
+25744,25757,25752,25724,25708,25781,25714,25696,
+25647,25759,25784,25672,25559,25412,25425,25381,
+25309,24889,24777,24809,25090,24917,24728,22601,
+22272,22205,21452,21911,21289,21841,21766,21804,
+21693,21147,20949,20733,20336,19918,19637,19168,
+18948,18791,18334,18111,17851,17257,16898,16522,
+15745,15350,14992,14419,14176,13969,13626,13484,
+13360,13144,13046,12947,12878,12774,12659,12386,
+12230,12064,11712,11535,11358,11010,10842,10679,
+10463,10417,10386,10376,10399,10442,10406,10495,
+10579,10706,10740,10756,10731,10702,10668,10604,
+10583,10564,10542,10540,10541,10539,10531,10507,
+10447,10415,10384,10334,10322,10320,10328,10333,
+10335,10330,10327,10321,10312,10311,10316,10344,
+10364,10387,10430,10446,10459,10467,10467,10466,
+10464,10465,10469,10469,10466,10463,10444,10429,
+10413,10383,10378,10381,10414,10443,10476,10546,
+10573,10593,10601,10592,10585,10561,10550,10543,
+10542,10555,10579,10630,10654,10674,10705,10704,
+10700,10693,10692,10693,10699,10704,10710,10725,
+10739,10757,10812,10852,11063,11172,11229,11290,
+11427,11500,11572,11715,11787,11858,12026,12111,
+12201,12402,12520,12654,12971,13147,13328,14128,
+14521,14904,15257,15472,15469,15192,15380,15447,
+15382,15164,14940,14948,14952,14870,14840,14770,
+14791,15051,16174,16302,16623,16703,16218,16178,
+16211,17238,17243,16144,17128,15869,17066,17008,
+15807,17072,17099,17034,15747,15776,15839,15880,
+16812,16033,16531,16407,16184,16058,15737,15382,
+15243,14890,14412,14160,13971,13634,13392,13501,
+13226,13024,12749,12174,11060,12031,11831,11789,
+11817,10409,11723,11446,9826,10902,10681,10539,
+10442,9366,9357,10655,10543,9371,10272,10131,
+9343,10267,10207,10410,10433,10446,9687,9684,
+10740,9659,9676,10723,10324,9462,9477,9488,
+9481,9461,9400,9362,9367,9378,9333,9194,
+9180,9163,9121,9090,9085,9081,9089,9083,
+9088,9099,9104,9106,9103,9096,9089,9053,
+9036,9021,9014,9020,9032,9066,9081,9092,
+9114,9126,9154,9232,9271,9309,9386,9428,
+9469,9566,9623,9686,9825,9895,9963,10094,
+10156,10215,10322,10380,10435,10534,10579,10620,
+10702,10744,10789,10914,10995,11064,11194,11232,
+11284,11386,11455,11526,11574,11595,11624,11682,
+11744,11754,11833,11861,11913,11956,11986,11931,
+11916,12009,11937,11968,12049,12046,12160,12219,
+12279,12398,12485,12603,12864,13010,13170,13521,
+13726,13935,14349,14552,14754,15160,15372,15582,
+15993,16194,16396,16859,17123,17410,18070,18443,
+19827,21182,21555,21935,22556,22058,21487,25396,
+25474,25470,25310,25352,25287,25132,25072,25083,
+25077,25046,25111,25048,25298,25278,26454,26454,
+26535,26552,26564,26564,26570,26570,26559,26550,
+26536,26536,26530,26530,26540,26543,26551,26551,
+26538,26538,26537,26528,26490,26490,26478,26478,
+26472,26461,26417,26417,26266,26266,25334,25385,
+25411,25567,25819,25905,25999,26140,26174,26174,
+26158,26102,26050,26016,26001,25978,26046,26028,
+25975,25967,25923,25938,25929,25916,25887,25860,
+25866,25882,25907,25920,25929,25897,25893,25879,
+25830,25373,25274,25071,24998,24947,24958,25021,
+24994,25005,25072,25075,24943,24966,24982,25036,
+25035,25031,25080,25113,25156,25186,25291,25347,
+25342,25136,25105,25050,25032,25037,25090,25086,
+25106,25080,25077,25051,24907,24812,24598,22655,
+22551,22460,22363,22363,22360,22598,22560,22518,
+22127,22095,22199,22011,22009,22006,22176,21946,
+21905,21782,21715,21649,21569,21560,21573,21616,
+21621,21606,21636,21582,21521,21386,21325,21273,
+21179,21132,21080,20970,20923,20884,20864,20890,
+20941,21089,21172,21234,21324,21326,21286,21081,
+20938,20813,20686,20691,20709,20747,23578,20730,
+20455,20370,20308,20300,20377,20535,22747,22764,
+22568,22574,22587,22716,22747,20379,20341,20432,
+20470,20453,20240,20085,19920,19574,19425,19320,
+19261,19289,19327,19374,19378,19368,19366,19394,
+19421,19417,19387,19346,19202,19132,19152,19112,
+19111,19106,19071,19047,19010,18937,18918,18915,
+18930,18955,18981,19057,19098,19115,19123,19192,
+19541,20516,20767,20782,20803,20788,20749,20219,
+19745,19424,19257,19126,19090,18951,19065,19174,
+19193,19150,19105,19129,19150,19168,19078,18960,
+18841,18707,18741,18788,18967,19167,19451,20239,
+20591,20919,21464,21724,21951,24016,23790,23733,
+23807,23885,23750,24036,24247,24397,24480,24500,
+24483,24420,24441,24481,24554,24625,25034,25055,
+24781,25160,25148,25143,25142,25159,25161,25125,
+25098,25159,25177,25341,25449,25622,25721,25735,
+25796,25777,25853,25789,25827,25750,25818,25891,
+25838,25882,25891,25907,25823,25792,25786,25767,
+25838,25928,25938,25909,25901,25811,25850,25825,
+25819,25765,25757,25742,25759,25722,25628,25492,
+25457,25411,25368,25346,25327,25221,25100,25001,
+22781,22777,21841,21809,22092,22185,22052,22116,
+22145,21742,21409,21055,20748,20617,20727,20242,
+20108,19955,19627,19479,19289,18677,18353,18039,
+17276,16970,16588,15813,15475,15152,14560,14299,
+14054,13630,13443,13273,13116,12983,12848,12563,
+12413,12257,11932,11774,11622,11357,11246,11143,
+11033,11021,11007,10993,11002,11029,11155,11241,
+11328,11316,11351,11356,11281,11215,11143,11011,
+10963,10925,10888,10888,10892,10895,10885,10856,
+10781,10743,10711,10671,10673,10690,10743,10770,
+10796,10835,10854,10870,10898,10911,10924,10945,
+10957,10968,10997,11013,11031,11064,11077,11087,
+11096,11099,11100,11089,11081,11070,11041,11023,
+11005,10973,10969,10976,11024,11064,11110,11200,
+11235,11257,11261,11247,11231,11193,11175,11163,
+11154,11161,11174,11200,11208,11212,11204,11186,
+11169,11140,11132,11128,11126,11127,11128,11133,
+11140,11153,11199,11232,11424,11510,11551,11590,
+11682,11731,11783,11897,11960,12030,12212,12310,
+12417,12670,12821,12989,13669,13999,14352,15066,
+15373,15621,15830,15895,16027,15932,15893,15718,
+15650,15979,15959,16049,16065,16155,16288,16539,
+16508,16740,16868,16904,16989,17003,17011,16884,
+16757,16664,16554,17690,17622,17697,17618,16434,
+17721,16487,16563,16540,17776,17747,17577,17530,
+16384,17151,16598,16757,16391,16366,16183,15757,
+15562,15336,14700,14446,14225,13838,13697,13478,
+13149,13199,12988,12379,11139,12036,11823,11892,
+11799,11494,11316,10161,10962,9691,9586,10610,
+10499,10423,9388,10512,10670,9424,10600,10608,
+9418,10629,10585,10904,10872,9686,10954,9721,
+9715,10774,10703,9724,10223,9535,9552,9564,
+9557,9544,9493,9493,9563,9490,9332,9302,
+9281,9235,9221,9207,9211,9215,9229,9237,
+9246,9258,9260,9259,9251,9244,9237,9205,
+9186,9169,9144,9137,9135,9146,9153,9163,
+9188,9208,9236,9306,9340,9372,9435,9471,
+9508,9603,9662,9726,9862,9926,9985,10095,
+10150,10205,10318,10384,10450,10568,10618,10662,
+10739,10778,10817,10912,10965,11024,11209,11273,
+11346,11509,11619,11701,11843,11883,11897,11870,
+11907,11994,12037,12139,12207,12323,12311,12066,
+12094,12466,12120,12140,12229,12553,12331,12740,
+12456,12575,12668,12792,13061,13216,13370,13675,
+13846,14032,14384,14550,14717,15052,15233,15413,
+15770,15955,16141,16555,16785,17025,17529,17803,
+18095,18586,18837,20376,21612,21918,22306,22687,
+25450,25671,25526,25490,25575,25125,24961,24949,
+25102,25133,25169,25140,25091,25065,25779,25779,
+26351,26420,26521,26521,26642,26642,26643,26618,
+26582,26582,26587,26587,26563,26558,26554,26554,
+26538,26538,26537,26528,26490,26490,26478,26478,
+26472,26461,26417,26417,26266,26266,25351,25439,
+25487,25662,25870,25959,26065,26171,26191,26129,
+26058,26106,26061,26030,26043,25972,25985,25994,
+25993,26010,25966,25956,25940,25869,25886,25885,
+25905,25889,25887,25884,25886,25864,25846,25818,
+25244,25074,25059,24987,24964,24957,24965,24958,
+24938,24903,24888,24882,24904,24893,25044,25080,
+25239,25321,25353,25350,25360,25202,25240,25249,
+25438,25416,25394,25343,25295,25039,25273,25256,
+25053,25110,25367,25178,25403,25223,25112,25203,
+25016,25171,24888,25052,24669,24559,24510,24425,
+24197,24045,22318,22223,22215,22220,22066,21986,
+21929,21661,21574,21489,21376,21366,21391,21505,
+21566,21602,21600,21709,21669,21584,21569,21581,
+21655,21699,21730,21747,21732,21711,21650,21612,
+21578,21569,21592,21609,21565,21524,21473,21320,
+21235,21164,21098,21108,24104,24049,21256,21141,
+23630,20878,20815,20863,20966,21176,23259,23322,
+23150,23329,23858,24141,20714,20674,20679,20744,
+20716,20626,20277,20080,19907,19628,19531,19455,
+19378,19373,19384,19428,19438,19441,19434,19415,
+19382,19324,19318,19305,19247,19226,19243,19332,
+19376,19401,19389,19349,19299,19232,19232,19277,
+19456,19589,19729,19965,20024,20032,19968,20316,
+20583,20783,20853,20857,20918,20812,20497,19517,
+19294,19199,19127,19072,18990,18726,18549,18430,
+18358,18300,18473,18604,18631,18710,18876,18870,
+18799,18661,18643,18700,18964,19131,19289,19715,
+19994,20319,21044,21452,21864,22636,24255,24184,
+24095,24281,24201,24302,24399,24431,24432,24471,
+24447,24530,24568,24621,24721,25091,25096,24895,
+25222,25210,25203,25206,25193,25112,25002,25165,
+25248,25285,25378,25553,25625,25674,25725,25819,
+25890,25920,25862,25976,25919,26001,25905,25926,
+25927,25924,25943,25939,25930,25989,25978,25908,
+25915,25941,25882,25902,25852,25835,25777,25770,
+25726,25788,25716,25726,25716,25716,25685,25640,
+25612,25586,25533,25497,25483,25428,25358,25297,
+25153,25039,23396,23215,23082,23037,22789,22563,
+22464,22074,21883,21615,21354,21340,21234,21093,
+20994,20842,20466,20255,20027,19572,19353,19140,
+18704,18477,18230,17667,17346,17007,16296,15984,
+15624,14944,14637,14345,13928,13691,13464,13038,
+12837,12641,12270,12108,11973,11814,11783,11763,
+11787,11813,11823,11813,11806,11808,11865,11918,
+11978,12082,11968,11968,11878,11799,11713,11544,
+11480,11431,11385,11386,11391,11388,11370,11331,
+11238,11194,11160,11131,11141,11168,11240,11277,
+11311,11371,11403,11434,11496,11524,11549,11587,
+11599,11609,11627,11635,11644,11656,11659,11661,
+11665,11672,11684,11708,11717,11722,11705,11681,
+11650,11588,11573,11577,11646,11707,11773,11894,
+11937,11965,11976,11963,11946,11896,11866,11836,
+11780,11760,11748,11726,11716,11705,11676,11650,
+11624,11582,11566,11556,11546,11543,11539,11535,
+11536,11542,11568,11589,11610,11799,11816,11830,
+11874,11904,11941,12043,12106,12179,12380,12494,
+12622,12924,13100,13294,14678,15004,15222,15719,
+15924,16054,16269,16367,16486,16595,16610,16468,
+16161,16047,16186,16316,16212,16356,16393,16536,
+16657,16836,16879,16885,16864,16856,16850,16842,
+16826,16802,16731,16715,16745,18263,17092,18375,
+17377,18610,18679,18663,18107,18539,18240,18184,
+17913,16617,17268,16648,16838,16454,16455,16083,
+15868,15641,15028,14728,14559,14052,13662,13250,
+12852,12484,12353,12819,12585,12470,10834,10755,
+11974,11561,10377,10249,11227,10868,10628,9567,
+10618,10618,10583,10561,9568,10542,9511,9518,
+10606,9484,9515,10811,10798,10783,9861,11062,
+9890,10993,10961,9957,10769,9672,9678,9680,
+9664,9652,9803,9741,9771,9548,9618,9494,
+9450,9429,9409,9378,9374,9373,9381,9384,
+9387,9382,9377,9369,9355,9348,9341,9313,
+9297,9283,9261,9254,9247,9251,9255,9262,
+9303,9327,9359,9437,9470,9500,9557,9589,
+9618,9696,9744,9798,9907,9957,10002,10091,
+10140,10191,10303,10371,10435,10551,10601,10646,
+10735,10780,10835,10958,11091,11207,11214,11274,
+11339,11541,11638,11762,12010,12195,12132,11927,
+12453,12244,12325,12390,12462,12557,12561,12606,
+12672,12590,12724,12740,12817,12425,13010,12632,
+12590,13203,12810,13227,13225,13382,13817,13816,
+13971,14145,14427,14580,14742,15047,15233,15403,
+15688,15819,15942,16261,16478,16723,17244,17498,
+17743,17942,18001,18080,18461,18773,20169,21622,
+22094,22496,25564,25598,25828,25382,25176,25114,
+25256,25229,25307,25337,25330,25374,25779,25779,
+26351,26420,26521,26521,26642,26642,26643,26618,
+26582,26582,26587,26587,26563,26558,26554,26554,
+25411,25398,25386,25389,25455,25477,25286,25289,
+25167,25163,25086,25178,25226,25285,25360,25609,
+25716,25869,25964,26018,26002,26016,25966,25986,
+25947,25987,25869,25985,25991,25968,25935,25892,
+25931,25991,25933,25891,25932,25933,25923,25907,
+25919,25926,25926,25914,25912,25778,25600,25466,
+25263,25167,25028,25006,24999,25030,25082,25101,
+25245,25343,25387,25434,25260,25499,25481,25470,
+25472,25449,25121,25381,25197,25239,25418,25405,
+25399,25466,25471,25495,25293,25482,25423,25354,
+25332,25004,25030,25330,24942,24986,25216,25150,
+25097,24744,24899,25113,24722,24719,24677,24622,
+24896,24520,24518,24821,25019,25220,25037,24839,
+24820,24727,24800,24811,21613,21671,21801,22032,
+22088,22107,22123,24044,23966,23861,23911,23917,
+23977,23982,24333,24480,24597,24612,24971,25035,
+25080,24825,24850,24837,24793,24819,25012,25046,
+24968,24957,24912,24894,24711,21965,21933,21973,
+24338,24349,24624,24718,24778,25053,25231,25235,
+25167,25082,24743,24510,21280,21265,21240,21179,
+21132,21079,21009,21028,21077,21148,21155,21131,
+20948,20786,20597,20310,20281,20324,20621,20790,
+20933,21088,21094,21062,20928,20874,20854,20919,
+20976,21022,21039,21011,20979,20988,21062,21189,
+21524,21702,21883,22209,22280,22244,21917,21704,
+21510,21290,21215,21262,21371,21357,21292,21113,
+21007,20912,20838,20869,20924,21008,20993,20940,
+20759,20658,20560,20388,20305,20199,19864,19629,
+19360,19339,19261,19246,19185,19176,19242,19588,
+19849,20166,20929,21316,21666,22771,23221,24602,
+24476,24384,24472,24246,24196,24297,24445,24538,
+24638,25089,24849,24923,25279,25221,25377,25319,
+25341,25332,25480,25605,25516,25553,25578,25584,
+25726,25836,25928,25947,25998,26043,26028,26038,
+26073,26060,26083,26087,26117,26123,26122,26213,
+26134,26234,26230,26185,26162,26093,26146,26055,
+26020,26021,26005,25983,26003,26003,26054,26037,
+25982,25952,25925,25904,25800,25828,25781,25748,
+25722,25714,25681,25648,25606,25562,25549,25524,
+25476,25466,25481,25386,25284,25397,25287,25229,
+23300,22840,22532,22182,21831,21669,21419,21172,
+20976,20727,20174,19890,19657,19277,19103,18923,
+18549,18350,18139,17691,17464,17241,16831,16651,
+16492,16231,16127,16033,15965,15869,15759,15493,
+15331,15153,14779,14609,14447,14156,14027,13907,
+13729,13680,13653,13639,13635,13624,13590,13560,
+13522,13435,13389,13342,13242,13188,13132,13018,
+12968,12924,12861,12845,12839,12827,12813,12785,
+12714,12683,12664,12667,12693,12732,12706,12764,
+12821,12921,12970,13020,13121,13171,13219,13312,
+13358,13403,13493,13533,13562,13577,13557,13521,
+13420,13364,13309,13194,13133,13071,12944,12892,
+12861,12891,12963,13064,13309,13424,13514,13593,
+13590,13570,13514,13491,13478,13452,13427,13390,
+13280,13217,13158,13059,13020,12988,12926,12886,
+12845,12772,12744,12720,12686,12673,12658,12623,
+12604,12586,12550,12534,12517,12474,12446,12417,
+12522,12528,12548,12623,12672,12728,12886,12971,
+13066,13306,14070,14644,15246,15591,15800,16168,
+16297,16469,16760,16905,16968,17134,17205,17277,
+17218,17122,16811,16706,16860,16937,17252,17418,
+17556,17693,17660,17576,17324,17212,17121,16982,
+16973,17010,17099,17105,17110,18181,19003,19214,
+19695,19722,19708,19532,19393,19357,19270,19084,
+18878,18279,17670,17751,17097,17068,16965,16513,
+16260,16044,15610,15315,14861,13936,13549,13286,
+12864,13025,12890,12644,12629,12643,12340,11985,
+11758,11491,11357,11241,11031,10972,10933,10844,
+10058,10898,10809,9980,11101,10989,11007,11166,
+10090,11610,10123,11589,10144,11383,11465,11469,
+11430,11646,11596,11458,10381,11405,10411,10760,
+10933,10393,10525,10262,10297,10257,10113,10075,
+10017,9986,9961,9921,9908,9898,9876,9865,
+9855,9840,9837,9836,9837,9839,9840,9831,
+9825,9820,9811,9806,9809,9827,9832,9834,
+9828,9823,9829,9865,9885,9909,9956,9980,
+10000,10043,10068,10094,10146,10170,10191,10252,
+10295,10345,10466,10541,10613,10742,10797,10847,
+10958,11022,11092,11248,11325,11400,11535,11596,
+11793,11995,12114,12163,12017,12227,12473,12473,
+12831,12729,12830,12874,12965,12948,12950,12988,
+12965,13017,13162,13248,13447,13534,13551,13648,
+13493,13323,13772,13364,13664,14382,13911,14133,
+14766,14815,14852,14720,15202,15208,15788,15882,
+15876,16145,16310,16465,16664,16906,17416,17629,
+17779,17702,17572,17498,17358,17492,17728,19172,
+19495,19474,20904,21217,21223,24522,24759,25095,
+25428,25297,25395,25478,25516,25604,26414,26414,
+26415,26435,26536,26536,26549,26549,26587,26591,
+26578,26578,26567,26567,26576,26591,26569,26569,
+25415,25402,25388,25394,25421,25421,25295,25297,
+25180,25221,25187,25255,25307,25425,25572,25741,
+25824,25894,25937,25966,25952,25948,25926,25911,
+25838,25914,25892,25953,26016,25990,25934,25935,
+25962,25946,25935,25944,25957,25955,25928,25888,
+25894,25871,25821,25812,25754,25464,25389,25303,
+25150,25089,25043,25029,25016,25046,25254,25107,
+25113,25158,25263,25352,25413,25136,25114,25129,
+25166,25177,25384,25450,25461,25483,25468,25492,
+25514,25515,25507,25533,25464,25282,25246,25495,
+25486,25365,25291,25274,25371,25297,24998,25024,
+24934,25241,24940,24943,25195,24784,24823,24777,
+25064,24677,24643,24927,25053,25020,24939,24713,
+24742,24655,24717,24648,24129,22425,22529,23910,
+23893,23965,24283,24393,24381,24393,24481,24531,
+24720,24767,25001,25107,25164,25177,25318,25313,
+25331,25302,25316,25303,25273,25258,25317,25255,
+25158,25109,25007,24980,24816,24612,24478,24471,
+24448,24448,24710,24811,25018,25359,25271,25216,
+25093,24930,22622,22083,21708,21664,21595,21435,
+21369,21307,21262,21322,21431,21647,21733,21796,
+21815,21754,21659,21457,21397,21390,21519,21623,
+21717,21829,21820,21768,21570,21475,21424,21451,
+21488,21530,21537,21498,21447,21370,21365,21402,
+21549,21622,21681,21793,21865,21916,21855,21754,
+21636,21398,22553,22479,21166,21063,20937,20569,
+20351,20158,20006,20063,20209,20654,20837,20963,
+21053,21052,21042,21036,21050,21049,20937,20796,
+20592,20072,19791,19800,19975,19921,19778,19652,
+19794,20021,20715,21098,21576,22686,23137,23428,
+24639,24593,24591,24400,24407,24474,24592,24691,
+24794,24951,25262,25181,25341,25326,25428,25382,
+25425,25441,25538,25563,25593,25652,25681,25789,
+25933,25981,26040,26001,26126,26157,26218,26159,
+26182,26073,26064,26290,26215,26227,26307,26311,
+26290,26286,26265,26174,26163,26212,26177,26084,
+26080,26027,26017,26063,26115,26094,26083,26024,
+26034,26022,26035,26090,25941,25927,25891,25818,
+25805,25787,25706,25597,25557,25616,25598,25507,
+25364,25457,25445,25305,25411,25346,25401,25348,
+25244,22981,23017,22823,22374,22177,22042,21783,
+21589,21419,21138,21008,20904,20623,20431,20201,
+19639,19321,18984,18308,17998,17716,17245,17056,
+16893,16632,16530,16443,16429,16372,16324,16255,
+16232,16210,16152,16113,16039,15785,15610,15412,
+14983,14787,14629,14457,14434,14436,14500,14516,
+14508,14426,14364,14297,14165,14104,14048,13936,
+13883,13833,13758,13743,13743,13768,13781,13780,
+13751,13730,13712,13701,13715,13738,13795,13714,
+13741,13790,13821,13860,13964,14027,14096,14249,
+14331,14417,14592,14672,14730,14744,14683,14579,
+14283,14122,13972,13734,13650,13592,13561,13598,
+13675,13931,14099,14276,14605,14722,14787,14754,
+14679,14592,14447,14404,14382,14359,14335,14293,
+14157,14079,14008,13902,13867,13838,13769,13715,
+13656,13538,13490,13454,13408,13391,13375,13331,
+13302,13274,13209,13174,13137,13047,12990,12929,
+12834,12805,12791,12807,12832,13009,13141,13217,
+13305,13549,13718,14731,15416,15624,15814,16165,
+16302,16463,16784,16995,17117,17330,17418,17499,
+17735,17855,17773,17674,17650,17689,17819,18001,
+18133,18103,18165,18380,18677,18769,18601,17809,
+17764,17763,17778,17740,17727,19405,19609,19702,
+20207,20464,20447,20257,20142,20033,19826,19663,
+19228,18070,17635,17967,17403,17202,16781,16301,
+16097,15896,15459,15146,14954,14426,14123,13829,
+13364,13258,13291,13214,13170,13075,12704,12398,
+12251,11925,11785,11660,11470,11408,11350,11276,
+11253,11266,11293,11265,11303,11406,11537,11588,
+11668,11318,11805,11970,11691,12165,12354,12213,
+12100,12201,11914,11742,11713,11884,10886,11783,
+10894,10895,10822,10784,10743,10668,10627,10585,
+10501,10465,10435,10384,10364,10345,10314,10299,
+10284,10257,10250,10245,10247,10250,10250,10237,
+10224,10215,10200,10195,10195,10210,10215,10215,
+10201,10190,10190,10218,10238,10261,10307,10327,
+10337,10352,10361,10373,10404,10419,10431,10469,
+10499,10536,10638,10713,10789,10933,10997,11055,
+11165,11222,11281,11411,11479,11550,11695,11753,
+11818,11966,12038,12549,12538,12357,12241,12537,
+12380,12338,12440,13126,12569,13188,13039,13141,
+13126,12800,13150,13236,13419,13689,13447,13598,
+13369,13674,13454,13890,14133,14089,14440,14350,
+14644,14650,14907,15119,15180,15553,15814,15993,
+16251,16271,16409,16670,16791,16959,17308,17478,
+17622,17811,17879,17951,18028,18114,18392,19543,
+19314,18772,19113,19604,20099,20745,21173,21578,
+22299,22596,24984,25263,25385,25454,26414,26414,
+26415,26435,26536,26536,26549,26549,26587,26591,
+26578,26578,26567,26567,26576,26591,26569,26569,
+24906,24860,24864,24907,24938,24922,24938,24964,
+24934,25124,25203,25342,25537,25657,25751,25881,
+25904,25933,25962,25975,26001,25999,25962,25886,
+25819,25808,25822,25978,25953,25946,25930,25952,
+25944,25910,25893,25964,25987,25986,25952,25887,
+25857,25818,25755,25560,25442,25226,25172,25143,
+25149,25089,25103,25300,25347,25191,25281,25444,
+25460,25485,25498,25269,25378,25397,25504,25481,
+25395,25479,25480,25130,25525,25541,25168,25575,
+25432,25167,25555,25155,25549,25528,25509,25535,
+25091,25370,25409,25347,25056,25472,25423,24992,
+24977,25321,25143,24881,24927,25202,24965,25194,
+24822,25135,24744,24950,25033,25007,24933,24665,
+24728,24692,24784,24737,24417,24392,24194,24205,
+24102,24147,24222,24262,24362,24532,24711,24776,
+24930,24971,25058,25111,25165,25180,25231,25235,
+25268,25244,25254,25235,25297,25295,25417,25435,
+25394,25379,25103,25011,24655,24244,23842,23822,
+23825,23826,24134,24350,25076,25232,25190,25134,
+25062,23364,22670,22405,22299,22254,22188,22018,
+21924,21829,21663,21650,21708,21904,22004,22095,
+22270,22343,22393,22432,22427,22406,22322,22258,
+22183,22042,21983,21932,21807,21745,21702,21686,
+22947,23574,23936,23939,23870,23641,23457,21502,
+21512,21568,21618,22904,23200,23242,23046,23032,
+23145,23023,22758,21143,20994,20919,20838,20906,
+21022,21144,24117,24207,23998,23443,23078,21060,
+20550,20284,20037,19754,19786,19924,20322,20462,
+20504,20273,20013,19699,19004,18871,19211,19156,
+19156,19398,20080,20614,21264,22470,22976,23372,
+24609,24586,24549,24522,24496,24552,24895,24979,
+24879,25194,25096,25353,25384,25467,25455,25577,
+25524,25618,25581,25629,25705,25965,26011,25931,
+26086,26091,26093,26150,26203,26230,26247,26265,
+26374,26291,26291,26299,26312,26425,26424,26380,
+26355,26300,26233,26271,26375,26252,26219,26214,
+26170,26164,26217,26162,26179,26179,26058,26038,
+26046,26070,26065,26060,26131,26127,26087,25960,
+25975,25890,25756,25673,25715,25508,25425,25447,
+25380,25354,25385,25391,25492,25473,25453,25417,
+25352,25230,23564,23061,22954,22799,22664,22504,
+22391,22298,22054,21955,21842,21566,21394,21202,
+20735,20464,20166,19535,19238,18968,18528,18354,
+18199,17899,17746,17591,17400,17254,17120,16911,
+16901,16957,17217,17368,17450,17375,17215,16982,
+16343,15993,15680,15267,15187,15176,15314,15356,
+15345,15175,15051,14930,14757,14714,14696,14702,
+14712,14718,14726,14737,14754,14799,14818,14824,
+14808,14795,14786,14805,14834,14869,14926,14840,
+14843,14838,14850,14882,15019,15121,15237,15482,
+15599,15711,15901,15970,16007,15926,15788,15589,
+15105,14880,14702,14514,14510,14560,14780,14923,
+15077,15397,15565,15733,16008,16085,16100,15961,
+15838,15709,15511,15455,15415,15335,15269,15176,
+14938,14823,14729,14631,14616,14608,14566,14511,
+14440,14286,14223,14176,14124,14105,14083,14018,
+13978,13938,13857,13815,13770,13655,13580,13494,
+13339,13276,13228,13174,13164,13162,13224,13270,
+13335,13685,13821,14763,15452,15714,15881,16117,
+16237,16377,16722,16958,17198,17490,17626,17747,
+17935,18073,18210,18367,18352,18409,18532,18713,
+18870,18762,18438,18582,18793,18642,19366,18641,
+18723,18749,18809,18746,18709,19813,20153,20217,
+20271,20771,20921,21057,20948,20761,20385,20072,
+19384,18382,18504,18385,17732,17432,17072,16552,
+16282,16046,15701,15518,15323,14907,14816,14844,
+14436,13991,13829,13616,13476,13004,12581,12953,
+12804,12568,12441,12325,12153,12101,12067,12108,
+12113,12121,12196,12211,12189,12196,12269,12391,
+12618,12685,12698,12480,12776,12538,11328,12808,
+12576,12629,12461,11525,12324,12197,11574,12132,
+11542,11579,11442,11559,11314,11220,11175,11114,
+11031,10982,10950,10901,10882,10867,10837,10819,
+10799,10756,10737,10724,10718,10726,10737,10738,
+10734,10725,10696,10680,10666,10649,10638,10623,
+10581,10559,10548,10558,10575,10595,10642,10663,
+10671,10679,10684,10693,10721,10734,10745,10768,
+10783,10802,10864,10921,10983,11107,11162,11212,
+11303,11354,11413,11558,11642,11732,11901,11975,
+12043,12167,12226,12290,12378,12366,12377,12404,
+12448,12467,12593,12692,12770,12980,13013,13013,
+13005,13099,13099,13264,13393,13551,13730,13741,
+13752,13812,13855,13885,14182,14321,14452,14698,
+14799,14942,15282,15427,15715,16044,16215,16332,
+16517,16695,16737,17002,17118,17276,17457,17587,
+17758,18208,18482,18752,19127,19220,19214,18793,
+18642,18657,19603,19788,19890,20462,20824,20996,
+21642,22014,22278,25208,25376,25502,25665,25744,
+25633,26377,26470,26470,26513,26513,26526,26530,
+26543,26543,26540,26540,26515,26508,26464,26464,
+24927,24830,24807,24926,24977,24984,25090,25161,
+25191,25426,25557,25609,25764,25787,25807,25877,
+25926,25950,26116,26067,26018,25982,25887,25870,
+25830,25841,25929,25898,25915,25916,25994,26020,
+25948,25964,25986,25980,25963,25948,25898,25852,
+25836,25838,25571,25498,25338,25260,25262,25281,
+25212,25213,25357,25509,25515,25332,25241,25176,
+25275,25211,25539,25265,25358,25637,25656,25701,
+25708,25709,25353,25285,25683,25672,25629,25154,
+25642,25147,25254,25644,25208,25063,25117,25623,
+25601,25170,25622,25562,25228,25135,25059,25440,
+25368,25326,25012,25032,25419,25375,25103,25436,
+25401,25326,24990,25287,24915,25171,24774,24758,
+24808,25074,25064,24944,24672,24574,24382,24309,
+24192,24197,24236,24287,24394,24609,24787,24845,
+24990,25042,25107,25107,25077,25053,24997,24965,
+24997,24969,24971,24914,24995,24997,25168,25232,
+25205,25222,25098,25103,24967,24760,24476,24353,
+24218,24186,24403,24672,24924,24994,25021,25007,
+24938,24845,24676,23759,23402,23304,23234,23333,
+23276,23093,22790,22823,22932,23072,23154,23542,
+24416,24734,25073,25517,25640,25693,25645,25559,
+25482,25350,25284,25255,25216,25191,25150,25020,
+24951,24882,24761,24718,24685,24593,24544,24508,
+24402,24151,23498,23306,23522,23576,23520,23622,
+23866,24427,24125,23954,23542,23424,23356,23990,
+24377,24798,24830,24821,24849,24996,24110,23966,
+23517,23226,22911,22431,22269,22155,21622,20988,
+20205,19965,20048,19803,19295,19257,19384,19981,
+20048,20270,21137,21626,22025,23079,23498,23878,
+24858,24917,24865,24762,24818,24929,25130,25113,
+24956,25375,25440,25382,25445,25487,25523,25596,
+25754,25685,25933,25900,25991,26071,26082,26087,
+26068,26009,26132,26206,26341,26299,26173,26125,
+26292,26152,26179,26214,26363,26324,26328,26304,
+26429,26426,26328,26411,26275,26239,26188,26152,
+26207,26184,26221,26214,26131,26174,26052,26018,
+26001,26004,26098,26014,26093,26007,25994,25970,
+25961,25945,25944,25904,25860,25821,25789,25684,
+25733,25723,25685,25607,25513,25552,25566,25566,
+25551,25519,25441,25392,25386,25354,25302,25215,
+25109,25016,22582,22359,22180,21916,21852,21833,
+21830,21805,21757,21585,21508,21467,21505,21547,
+21557,21359,21129,20835,20258,19952,19684,19283,
+19151,19072,19134,19320,19513,19903,20078,20207,
+20120,19917,19674,19200,19015,18871,18690,18567,
+18390,17914,17677,17493,17375,17438,17554,17822,
+17920,17970,17922,17839,17733,17508,17402,17301,
+17157,17126,17131,17297,17442,17604,17864,17919,
+17909,17684,17603,17550,17599,17710,17862,18192,
+18331,18440,18620,18735,18875,19091,19095,19028,
+18800,18716,18688,18817,18935,19041,19091,19016,
+18889,18601,18497,18436,18407,18399,18373,18243,
+18154,18064,17927,17881,17831,17651,17492,17286,
+16812,16601,16441,16300,16302,16318,16313,16266,
+16197,16037,15967,15910,15810,15751,15676,15490,
+15392,15304,15152,15084,15018,14865,14766,14652,
+14429,14326,14234,14093,14042,14002,13998,14003,
+14009,14042,14073,14130,15111,15318,15476,15886,
+16183,16353,16687,16870,16987,17209,17322,17656,
+18214,18411,18581,18879,18997,19072,18968,17870,
+18042,18488,18706,18943,19392,19562,19658,19677,
+19690,19726,20008,20129,20222,20386,20854,21333,
+21192,21550,21410,21739,21624,21417,21157,20092,
+20416,19877,19711,19477,18235,18475,18128,17711,
+17393,17094,16460,16305,16153,16175,16011,15851,
+15378,15119,14869,14485,14115,13917,13811,13822,
+13753,13657,13566,13470,13310,13264,13263,13364,
+13460,13552,13637,13638,13653,13662,13665,13713,
+13820,13876,13899,13924,13890,13849,13846,13787,
+13803,13839,13642,13665,13552,13336,13304,13010,
+12444,12839,12497,12248,12207,12101,12029,11978,
+11881,11842,11813,11753,11732,11718,11711,11711,
+11710,11692,11674,11654,11615,11600,11590,11578,
+11572,11562,11532,11513,11502,11493,11488,11482,
+11460,11442,11427,11405,11395,11388,11381,11376,
+11360,11323,11306,11293,11282,11278,11272,11266,
+11267,11272,11301,11343,11393,11495,11541,11581,
+11656,11705,11764,11925,12019,12116,12301,12374,
+12428,12503,12525,12562,12610,12635,12666,12748,
+12814,12886,13019,13099,13139,13192,13221,13204,
+13307,13467,13562,13835,13933,14087,14237,14320,
+14440,15207,15261,15391,15591,15668,15417,15914,
+16060,16163,16763,17010,17033,17057,17151,17087,
+17404,17738,17985,18217,18355,18381,18463,18737,
+19028,19524,19837,20121,20450,20398,20263,19786,
+19559,19299,20666,20892,21131,21470,21629,21786,
+21960,22085,22227,22591,24967,25466,25557,25640,
+25674,26370,26467,26467,26507,26507,26510,26513,
+26525,26525,26531,26531,26490,26472,26426,26426,
+25148,25086,25002,25091,25127,25146,25216,25289,
+25394,25532,25664,25740,25916,26018,26056,26099,
+26118,26127,26128,26040,25986,25942,25794,25846,
+25864,25911,25985,25965,25951,25956,26024,25983,
+25829,25974,26033,26027,25984,25959,25944,25867,
+25779,25658,25312,25228,25181,25276,25233,25231,
+25533,25520,25507,25310,25139,25214,25299,25604,
+25416,25498,25680,25674,25411,25707,25723,25776,
+25780,25662,25686,25820,25818,25825,25697,25849,
+25828,25571,25503,25750,25387,25715,25319,25649,
+25184,25646,25085,25028,25091,25580,25554,25073,
+25569,25044,25428,25449,25050,25105,25019,24982,
+25266,25027,25425,25037,25402,25269,24930,25232,
+25069,24973,24932,24847,24699,24711,24408,24414,
+24570,24469,24430,24469,24534,24673,24763,24847,
+25008,25043,25052,25000,24963,24928,24868,24847,
+24851,24799,24821,24750,24673,24643,24546,24553,
+24557,24620,24631,24662,24591,24509,24609,24519,
+24262,24191,24161,24196,24356,24411,24570,24638,
+24575,24583,24558,24513,24403,24373,24345,24386,
+24346,24328,24997,25299,25470,25375,25147,24935,
+24782,24869,24984,25277,25422,25512,25472,25435,
+25395,25310,25277,25244,25157,25102,25049,24970,
+24948,24942,24940,24924,24899,24790,24732,24679,
+24636,24632,24616,24125,23757,23716,23890,24009,
+24141,24863,24857,24766,24676,24733,24843,24968,
+24975,24958,24206,24142,24149,24226,24182,24118,
+23507,23003,22515,22326,22169,22088,21903,21686,
+21177,20258,20318,20168,19655,19436,19134,19961,
+20325,20683,21636,22175,22632,23470,23907,24168,
+25009,24975,24849,24993,25128,25092,25325,25336,
+25325,25337,25434,25417,25458,25504,25573,25783,
+25763,25757,25873,25969,25945,26070,26022,26053,
+26190,26143,26334,26386,26299,26276,26310,26193,
+26236,26257,26300,26358,26324,26294,26288,26359,
+26360,26264,26299,26391,26285,26242,26214,26187,
+26186,26244,26165,26222,26137,26185,26058,26048,
+26115,26115,26091,26088,25984,26026,25923,25951,
+25923,25916,25927,25911,25879,25782,25746,25780,
+25758,25761,25729,25677,25615,25660,25616,25628,
+25566,25569,25572,25511,25478,25488,25454,25412,
+25376,25329,25067,25005,24964,24951,25025,22837,
+22729,22640,22516,22281,22216,22215,22399,22543,
+22664,22646,22476,22234,21764,21526,21336,21069,
+20966,20868,20756,20822,20907,21159,21315,21522,
+21717,21647,21495,21048,20817,20610,20336,20211,
+20071,19757,19622,19532,19539,19618,19716,19864,
+19882,19852,19652,19507,19357,19107,19015,18939,
+18837,18817,18827,18955,19063,19182,19369,19393,
+19358,19073,18950,18851,18809,18884,19005,19284,
+19405,19509,19749,19919,20111,20431,20513,20549,
+20564,20588,20641,20811,20888,20921,20774,20591,
+20370,19951,19813,19733,19674,19653,19612,19448,
+19337,19222,19037,18969,18902,18710,18553,18354,
+17897,17693,17537,17391,17379,17383,17359,17305,
+17230,17059,16982,16913,16777,16695,16595,16363,
+16245,16137,15948,15860,15776,15587,15470,15338,
+15057,14913,14774,14537,14449,14387,14383,14400,
+14418,14429,14422,14419,14452,14696,15021,15711,
+15941,16069,16471,16556,16827,17039,17230,17475,
+17960,18187,18358,18571,18642,18689,18379,18271,
+18479,18933,19138,19379,19902,20132,20316,20448,
+20384,20341,20345,20431,20567,20886,20976,21277,
+21607,21414,22102,20985,21073,21622,21474,20439,
+21114,20481,20275,19966,19215,18940,18773,18377,
+18038,17776,17166,16957,16797,16508,16357,16191,
+15862,15676,15457,15063,14727,14696,14494,14385,
+14302,14184,14123,14096,14075,14075,14089,14098,
+14122,14137,14174,14140,14120,14090,14095,14169,
+14207,14254,14317,14397,14373,14377,14319,14301,
+14273,13239,14260,14003,13087,13872,13653,13572,
+13422,13274,13251,12707,12654,12508,12448,12392,
+12304,12267,12234,12171,12140,12114,12085,12081,
+12082,12087,12085,12080,12057,12042,12024,11991,
+11972,11951,11898,11869,11840,11801,11793,11792,
+11797,11799,11806,11819,11820,11818,11809,11800,
+11779,11728,11703,11679,11645,11629,11610,11580,
+11566,11554,11542,11561,11589,11659,11700,11742,
+11832,11884,11937,12051,12108,12168,12293,12352,
+12411,12556,12632,12674,12825,12877,12937,13056,
+13132,13181,13333,13395,13465,13553,13608,13651,
+13816,13922,14049,14330,14370,14440,14617,14762,
+14854,15244,15514,15803,15962,16047,15985,16333,
+16718,16834,17575,17677,17783,18025,18010,18046,
+18365,18535,18555,18653,18826,18839,18979,19192,
+19592,20414,20785,21047,21213,21116,20993,20709,
+20613,20672,20971,21201,21158,21108,20971,21493,
+21908,22078,22298,23419,24070,24527,26301,26301,
+26333,26361,26475,26475,26545,26545,26531,26525,
+26508,26508,26455,26455,26402,26382,26342,26342,
+25142,25099,25049,25141,25207,25235,25314,25410,
+25484,25668,25692,25827,26032,26029,26067,26116,
+26105,26129,26074,26010,25946,25948,25911,25874,
+25882,25920,25947,25980,25963,25956,25980,25962,
+25770,25897,25980,26014,25986,25939,25907,25682,
+25540,25354,25185,25168,25196,25184,25260,25542,
+25537,25493,25275,25301,25545,25649,25488,25725,
+25752,25781,25670,25804,25827,25833,25620,25642,
+25921,25792,25944,25928,25927,25939,25944,25951,
+25959,25954,25955,25761,25919,25900,25864,25792,
+25757,25300,25681,25223,25624,25101,25126,25050,
+24994,25066,25517,24908,24984,24871,25351,24933,
+24918,25328,25040,25036,24998,25387,24935,25017,
+25307,25249,25176,24789,24946,24944,24846,24539,
+24548,24495,24588,24615,24684,24800,24851,24924,
+25004,24973,24954,24887,24843,24818,24785,24758,
+24775,24742,24777,24725,24665,24616,24493,24442,
+24421,24478,24533,24556,24506,24304,24266,24343,
+24169,24172,24142,24120,24224,24234,24310,24410,
+24418,24477,24454,24379,24343,24324,24296,24712,
+24949,24820,24492,24504,24513,24406,24457,24371,
+24293,24625,24954,25638,25539,25304,24864,24621,
+24530,24663,24868,25049,25112,25090,25028,24985,
+25004,25026,25054,25043,25005,24895,24852,24830,
+24834,24834,24830,24781,24745,24684,24545,24530,
+24581,25012,24999,24921,24766,24751,24795,24979,
+25066,25124,24719,24694,24642,24583,24242,24033,
+23371,22753,22203,22189,22055,21963,22042,21604,
+21233,20642,20396,20346,19446,19196,18945,19123,
+19387,19716,20787,21461,22175,23518,23962,24200,
+24913,24957,25114,25085,25196,25361,25269,25247,
+25363,25346,25464,25445,25535,25579,25652,25674,
+25710,25831,25809,25850,25976,26133,26096,26136,
+26308,26317,26318,26254,26255,26244,26210,26216,
+26297,26247,26263,26273,26296,26294,26340,26266,
+26261,26229,26359,26353,26248,26239,26211,26174,
+26149,26140,26136,26132,26175,26119,26015,26020,
+25999,25995,26055,26001,26032,26005,25929,25861,
+25858,25885,25813,25791,25738,25752,25715,25709,
+25699,25702,25681,25594,25552,25539,25588,25604,
+25656,25728,25699,25665,25581,25530,25492,25474,
+25483,25437,25262,25220,25186,25169,25226,25187,
+23446,23292,23129,22858,22799,22814,23016,23156,
+23276,23318,23223,23091,22910,22826,22777,22708,
+22642,22541,22324,22312,22326,22473,22604,22793,
+22998,22949,22818,22384,22143,21920,21624,21514,
+21411,21221,21154,21119,21144,21188,21231,21263,
+21233,21158,20892,20748,20631,20527,20533,20555,
+20606,20621,20632,20664,20692,20724,20767,20753,
+20700,20425,20312,20215,20155,20211,20309,20550,
+20665,20770,20962,21045,21119,21236,21287,21339,
+21469,21553,21644,21796,21828,21814,21632,21477,
+21303,20980,20858,20761,20614,20546,20466,20258,
+20141,20031,19868,19811,19749,19576,19437,19260,
+18863,18693,18570,18482,18491,18505,18489,18431,
+18342,18115,17998,17886,17669,17552,17426,17150,
+17011,16882,16629,16507,16395,16185,16082,15971,
+15748,15618,15473,15172,15037,14930,14871,14879,
+14894,14895,14864,14822,14743,14728,14748,14905,
+15397,15575,16038,16176,16383,16638,16774,17011,
+17461,17463,17615,17936,18044,18328,18369,18593,
+18819,19216,19368,19552,20034,20317,20601,21020,
+21094,21080,20926,20899,20885,21142,21316,21535,
+21784,21635,21413,20867,20735,21219,21732,21781,
+21630,21113,20812,20549,20050,19632,19318,18433,
+18099,17872,17451,17257,17069,16716,16568,16410,
+16104,16020,15870,15593,15303,15143,15069,14954,
+14831,14673,14570,14489,14457,14511,14539,14591,
+14605,14611,14604,14581,14581,14613,14651,14687,
+14804,14855,14889,14856,14839,14816,14762,14758,
+14708,14554,14517,13689,14279,14242,14088,13986,
+13925,13816,13810,13199,13129,12947,12877,12817,
+12735,12713,12671,12621,12595,12570,12528,12516,
+12511,12523,12538,12553,12577,12578,12570,12537,
+12510,12478,12402,12359,12317,12246,12215,12186,
+12147,12139,12139,12152,12155,12157,12157,12154,
+12138,12103,12084,12063,12023,12000,11973,11932,
+11916,11900,11869,11873,11880,11908,11933,11966,
+12056,12114,12174,12289,12341,12391,12472,12549,
+12601,12705,12785,12852,13022,13107,13281,13317,
+13406,13504,13748,14061,13911,14006,13844,14067,
+14604,14566,14749,14965,14803,14830,15016,15228,
+15285,15658,16034,16237,16585,16690,16790,17160,
+17307,17801,18119,18309,18525,18719,18646,18924,
+19359,19364,19260,19268,19177,19077,19303,19878,
+20303,21395,21750,22010,22098,21997,21769,21541,
+21478,21521,21665,22027,22227,22536,22574,22630,
+23007,23407,23909,25296,25666,25781,26301,26301,
+26333,26361,26475,26475,26545,26545,26531,26525,
+26508,26508,26455,26455,26402,26382,26342,26342,
+26370,26370,26374,26377,26388,26388,26331,26331,
+26294,26294,26333,26333,26340,26340,26300,26287,
+26257,26257,26248,26248,26308,26315,26289,26289,
+26234,26234,26235,26234,26230,26230,26189,26189,
+25632,25511,25506,25503,25428,25466,25376,25300,
+25272,25264,25318,25336,25511,25615,25512,25401,
+25453,25524,25687,25758,25778,25815,25849,25831,
+25839,25716,25823,25905,25932,26002,25878,26034,
+26050,26069,26082,26017,26044,26106,26119,26111,
+26098,26154,26130,26087,26053,26137,26123,26099,
+26089,26056,26030,26034,26026,26030,25993,25856,
+25695,25720,25654,25204,25079,25030,25175,25002,
+24878,24910,24801,24808,24769,24823,24967,24913,
+24809,24809,25156,25153,25225,24860,25185,25143,
+25006,25076,25228,25183,25137,25033,24955,24897,
+24854,24822,24800,24800,24820,24810,24754,24706,
+24666,24604,24616,24592,24469,24413,24334,24226,
+24207,24216,24257,24309,24324,24146,24084,23984,
+23837,23864,24020,24040,24035,24089,24214,24381,
+24670,24363,24203,24063,24710,24262,24435,25249,
+25538,25620,23507,23561,24093,24074,23960,24550,
+24916,25007,25024,24451,24664,24302,24359,24109,
+24109,23917,23991,24020,24202,24217,23924,23697,
+23841,23780,23979,24031,24109,24180,24389,24487,
+24656,24709,24624,24568,24566,24550,24616,24668,
+24738,24756,24695,24626,24569,24592,24674,24828,
+24911,24934,24997,25050,25175,25381,25311,25110,
+24686,24609,24199,23424,23103,22769,21216,21343,
+21651,21218,20886,20639,19681,19594,19336,19696,
+19984,20186,21513,22156,23051,23734,24420,24966,
+25093,25179,25198,25330,25380,25402,25425,25466,
+25383,25385,25413,25491,25554,25584,25613,25758,
+25774,25841,25973,25969,26030,26147,26177,26218,
+26248,26291,26299,26173,26250,26318,26413,26399,
+26304,26233,26259,26252,26334,26328,26226,26225,
+26350,26191,26152,26124,26108,26077,26204,26182,
+26274,26172,26042,26010,25971,26044,26007,26007,
+25964,25928,25901,25890,25854,25833,25829,25791,
+25778,25763,25757,25715,25690,25624,25628,25607,
+25607,25621,25610,25584,25575,25595,25607,25608,
+25615,25589,25662,25602,25572,25577,25559,25515,
+25468,25471,25387,25325,25368,25308,25281,25279,
+25306,25287,25225,25144,25093,23712,23654,23638,
+25013,23496,23469,23443,23457,23406,23353,23226,
+23149,23068,22968,23005,23061,23214,23311,23416,
+23534,23545,23549,23535,23518,23497,23519,23603,
+23653,23714,23727,23765,23772,23757,23747,23747,
+23733,23688,23593,23589,23563,23542,23457,23391,
+23179,22999,22897,22733,22657,22578,22414,22331,
+22245,22003,21936,21883,21854,21875,21910,21985,
+22008,22013,21947,21889,21896,22023,22158,22264,
+22451,22615,22691,22952,23047,23113,22682,22375,
+22305,22327,22250,22135,21874,21749,21633,21424,
+21323,21222,21006,20893,20774,20522,20382,20236,
+19989,19924,19917,20083,20211,20324,20399,20341,
+20215,19806,19586,19382,19038,18877,18725,18421,
+18262,18103,17768,17596,17433,17142,17022,16921,
+16795,16744,16685,16508,16388,16260,16080,16016,
+15970,15897,15851,15805,15705,15658,15628,15637,
+15678,15746,15890,15958,16027,16187,16305,16459,
+16797,16969,17140,17672,17895,18155,18698,18959,
+19198,19603,19728,19873,20338,20697,21122,21806,
+21964,22016,21967,21915,21890,22142,22286,22357,
+22715,22819,22780,22277,22023,21921,21937,21716,
+21535,21486,21346,21222,20844,20454,20067,19429,
+19144,18875,18385,18174,17979,17627,17465,17314,
+17109,16950,16799,16508,16387,16264,16024,15923,
+15842,15673,15543,15745,15678,15637,15566,15460,
+15432,15432,15548,15618,15699,15763,15779,15784,
+15820,15884,15916,15983,16007,16018,15966,15950,
+15918,15052,15871,15786,15519,15544,15344,15197,
+14636,15143,14845,14745,14383,14335,14283,14215,
+14154,14023,14053,13976,13965,13956,13904,13854,
+13797,13699,13674,13672,13709,13731,13744,13729,
+13702,13669,13608,13588,13574,13555,13539,13515,
+13458,13430,13415,13413,13415,13415,13405,13393,
+13367,13316,13296,13277,13228,13191,13147,13066,
+13039,13021,13012,13028,13043,13049,13041,13028,
+13014,13028,13052,13133,13196,13244,13337,13494,
+13564,13612,13450,13673,13649,13948,13861,14308,
+14489,14619,14455,14526,15230,15260,14802,15353,
+15025,15692,15250,16134,16164,16076,16644,16101,
+17056,17174,16717,16982,18226,18292,18456,19166,
+19554,19629,20165,20306,20484,20330,20673,20807,
+21065,21010,21094,20825,20726,20466,20922,21206,
+21892,22778,23169,23180,23549,24736,25157,25299,
+25367,25411,25488,25926,25339,25766,25902,26100,
+26210,25987,25891,26008,25725,25615,26401,26401,
+26429,26443,26482,26482,26521,26521,26424,26400,
+26371,26371,26406,26406,26410,26409,26401,26401,
+26370,26370,26374,26377,26388,26388,26331,26331,
+26294,26294,26333,26333,26340,26340,26300,26287,
+26257,26257,26248,26248,26308,26315,26289,26289,
+26234,26234,26235,26234,26230,26230,26189,26189,
+25607,25392,25390,25400,25374,25342,25310,25277,
+25264,25284,25369,25600,25578,25625,25463,25591,
+25549,25670,25748,25786,25824,25810,25845,25730,
+25827,25912,25930,25716,25747,25831,25827,25953,
+25975,26021,26186,26215,26212,26237,26219,26208,
+26213,26134,26112,26177,26147,26174,26191,26198,
+26186,26155,26154,26130,26128,26021,25988,26025,
+26063,26040,25978,25951,25880,25714,25644,25632,
+25550,24985,25001,24831,24741,24732,24682,24745,
+24701,24845,24738,24709,25189,25013,24833,25228,
+25120,25156,25320,25298,25260,25172,25049,24963,
+24842,24797,24755,24742,24776,24773,24748,24725,
+24701,24658,24665,24663,24568,24534,24471,24363,
+24328,24318,24325,24371,24381,24186,24095,23782,
+23740,23781,23937,23932,23924,23913,24213,24565,
+25091,24454,24158,24073,24031,23943,23938,23731,
+23466,23396,23494,24400,25163,25302,25312,25009,
+25383,25220,24704,24591,24582,24157,24042,23924,
+23966,23837,24032,24291,24313,24323,24200,23961,
+23977,23738,23601,23426,23437,23532,23570,23753,
+23837,23925,23942,24076,24082,24107,24274,24284,
+24315,24344,24312,24257,24289,24327,24407,24438,
+24448,24452,24524,24762,24900,25050,24911,24698,
+25098,24924,24863,24275,24006,23883,22491,21582,
+21532,21214,20594,20221,19379,19424,19418,19858,
+20360,21060,22752,23325,23838,24480,24706,25007,
+25025,25062,25191,25437,25475,25481,25398,25384,
+25447,25495,25511,25492,25504,25521,25575,25727,
+25794,25849,25895,25859,25799,25969,26095,26149,
+26264,26274,26288,26142,26163,26306,26327,26348,
+26344,26389,26389,26322,26301,26242,26203,26361,
+26259,26289,26285,26166,26122,26315,26253,26201,
+26246,26182,26109,26114,25984,26002,26013,26023,
+25977,25920,25901,25915,25920,25894,25884,25826,
+25799,25784,25738,25718,25707,25668,25647,25616,
+25586,25599,25593,25606,25596,25594,25579,25585,
+25579,25604,25613,25608,25615,25629,25652,25658,
+25630,25625,25573,25522,25540,25452,25424,25391,
+25379,25372,25331,25288,25257,25253,25141,25139,
+25186,25173,25106,25108,25088,25071,25068,25049,
+25100,25089,23517,23532,23553,23657,23711,23769,
+23806,23794,23785,23775,23785,23817,23931,23996,
+24060,24202,24255,24303,25493,24398,24407,24481,
+24485,24488,24483,24504,24546,24480,24348,24348,
+24303,24310,24248,23936,23841,23841,23631,23444,
+23366,23216,23117,23015,22929,22956,23010,23188,
+23233,23271,23372,23419,23442,23491,23492,23561,
+25563,25661,23824,23868,23863,23865,24000,23986,
+23899,23748,23635,23498,22876,22804,22688,22528,
+22402,22221,21805,21581,21370,21075,20984,20918,
+20857,20881,20955,21225,21372,21485,21512,21402,
+21227,20813,20521,20196,19766,19568,19373,18971,
+18766,18570,18220,18070,17931,17663,17527,17397,
+17206,17139,17081,16954,16868,16770,16618,16549,
+16493,16402,16356,16311,16215,16163,16121,16092,
+16110,16156,16270,16326,16380,16493,16584,16715,
+17032,17212,17400,17936,18179,18439,19003,19294,
+19578,20076,20247,20435,20985,21370,21790,22400,
+22510,22510,22383,22301,22255,22399,22597,22799,
+22959,23144,23243,23216,23055,22845,22740,22583,
+22446,22127,21984,21830,21610,21226,20829,20168,
+19860,19558,18991,18751,18547,18218,18098,17973,
+17695,17536,17385,17110,16976,16860,16610,16481,
+16363,16136,16043,16001,16366,16354,16303,16119,
+16075,16045,16034,16070,16104,16229,16295,16314,
+16404,16477,16537,16656,16650,16652,16610,16556,
+16546,16373,16339,15670,15629,16252,15595,15542,
+15969,15832,15593,15223,15592,15194,15443,14989,
+14879,14823,14779,14741,14727,14703,14605,14532,
+14449,14310,14277,14278,14359,14418,14468,14522,
+14520,14503,14449,14424,14402,14364,14340,14313,
+14258,14239,14234,14257,14271,14277,14249,14214,
+14161,14060,14023,13997,13959,13934,13901,13830,
+13799,13776,13752,13761,13771,13770,13758,13741,
+13710,13706,13713,13759,13800,13852,13938,13965,
+14268,14286,14036,14071,14407,14561,14405,14882,
+14677,14767,14923,14988,15104,15914,15851,15543,
+15687,15806,16179,16626,16218,16368,16682,16824,
+17005,18015,18247,18410,18861,18280,18435,20473,
+19875,20174,21139,21243,21430,21409,21384,21456,
+21595,21662,20962,21436,21437,21453,21736,22334,
+23044,23830,26216,25288,26346,26320,26329,26178,
+26265,26323,26229,26184,26232,26143,26159,25998,
+26137,25858,25781,25721,25866,25883,26401,26401,
+26429,26443,26482,26482,26521,26521,26424,26400,
+26371,26371,26406,26406,26410,26409,26401,26401,
+26610,26610,26599,26594,26581,26581,26556,26556,
+26534,26534,26556,26556,26551,26551,26544,26541,
+26530,26530,26550,26550,26540,26535,26517,26517,
+26508,26508,26517,26518,26515,26515,26485,26485,
+25638,25583,25561,25561,25552,25550,25549,25549,
+25554,25560,25649,25633,25598,25646,25693,25671,
+25708,25705,25628,25713,25731,25735,25700,25701,
+25716,25752,25889,25917,26032,26041,26204,26265,
+26329,26327,26304,26294,26276,26294,26295,26295,
+26216,26205,26193,26166,26164,26159,26169,26131,
+26207,26238,26170,26170,26144,26127,26118,26178,
+26171,26166,26119,26078,26067,26102,26064,26013,
+25800,25716,25586,25019,24959,24815,24691,24722,
+24621,24598,24716,24621,24600,25018,25019,25008,
+24929,24863,25187,25189,25261,25283,25257,25186,
+24991,24894,24818,24719,24720,24707,24731,24710,
+24702,24692,24728,24722,24577,24547,24494,24445,
+24417,24405,24500,24512,24565,24396,24117,23991,
+23773,23791,23992,24019,24051,24264,25257,25445,
+25175,24546,24475,24554,24567,24482,24296,24194,
+24250,24628,24353,24400,24536,24614,24403,24174,
+24048,24017,23659,23620,23469,23485,23388,23386,
+23382,23362,23330,23330,23169,23180,23177,23282,
+23116,23111,23080,23074,23072,23096,23119,23390,
+23424,23487,23527,23481,23523,23550,23656,23710,
+23754,23807,23825,23826,23878,23922,23958,23912,
+24164,24155,24257,24354,24793,24898,24329,24903,
+25126,24703,24379,24117,24197,24302,23266,22807,
+22275,22382,21411,20355,19755,20111,19882,20002,
+20522,21315,23055,23791,24241,24689,24459,24687,
+25032,25121,25311,25610,25583,25488,25335,25382,
+25377,25393,25430,25437,25409,25367,25526,25629,
+25752,25782,25812,25773,25811,25961,26046,26114,
+26174,26211,26248,26214,26207,26243,26147,26306,
+26347,26346,26419,26396,26379,26301,26252,26320,
+26334,26288,26272,26173,26097,26216,26176,26191,
+26146,26139,26076,25984,25929,25946,25842,25856,
+25834,25786,25770,25764,25781,25779,25762,25741,
+25721,25715,25706,25703,25698,25690,25684,25678,
+25669,25670,25666,25668,25664,25660,25650,25648,
+25648,25643,25602,25614,25613,25624,25630,25653,
+25681,25665,25684,25671,25661,25625,25595,25578,
+25455,25431,25418,25422,25436,25459,25444,25457,
+25480,25474,25464,25470,25484,25492,25499,25503,
+25530,25552,25601,25608,25632,24865,25019,25104,
+25351,26033,26098,26123,26192,26192,25677,25675,
+25645,25666,25685,25701,25720,25719,25705,25686,
+25690,25701,25723,25734,25751,25731,25710,25692,
+25656,25639,24725,24661,24620,24588,24506,24487,
+24481,24336,24305,24287,25634,25644,25657,25677,
+25740,25751,25777,25780,25771,25750,25765,25799,
+25920,25970,26002,26006,25991,25974,25957,25946,
+25950,24525,24515,24453,24376,24174,24095,23192,
+23140,22952,22458,22273,22141,22094,22158,22239,
+22367,22419,22485,22714,22868,25621,22750,22582,
+22682,22143,21892,21269,20615,20419,20209,19675,
+19371,19081,18629,18474,18355,18151,18047,17939,
+17772,17710,17652,17519,17426,17318,17144,17062,
+16994,16897,16856,16822,16739,16684,16632,16578,
+16589,16636,16776,16847,16909,17007,17081,17193,
+17503,17698,17909,18335,18689,18916,19370,19613,
+19870,20373,20566,20770,21297,21632,21995,22600,
+22740,22780,22751,22684,22653,22658,22789,23001,
+23315,23424,23563,23909,24042,24041,24045,23946,
+23786,23293,22987,22674,22137,21876,21549,20914,
+20592,20260,19644,19378,19157,18783,18633,18510,
+18251,18110,17970,17728,17612,17498,17252,17124,
+16994,16747,16645,16571,16511,16494,16469,16580,
+16559,16557,16438,16445,16435,16506,16675,16803,
+16972,17052,17087,17213,17195,17169,17161,17158,
+17148,17090,17001,16917,16831,16743,16191,16144,
+16614,16510,15891,15846,16272,15977,15693,15686,
+15641,15627,15609,15555,15515,15473,15342,15257,
+15169,15035,15014,15030,15150,15234,15314,15423,
+15446,15450,15423,15402,15382,15348,15327,15301,
+15243,15216,15198,15184,15178,15167,15112,15066,
+15003,14875,14821,14779,14722,14699,14675,14641,
+14636,14638,14663,14689,14711,14719,14707,14683,
+14622,14597,14576,14570,15050,15002,14646,14680,
+14722,15097,15077,14738,15068,14859,14940,15337,
+15195,15281,15450,15560,15881,16007,16123,16204,
+16349,16654,16527,16769,16872,17059,17446,17634,
+17839,18314,18890,18728,19101,19260,20698,21301,
+21560,21757,22001,22165,22228,22160,22132,22127,
+22225,22284,22215,22389,22491,22750,23669,24299,
+25088,26423,26458,26423,26359,26310,26163,26259,
+26223,26284,26174,26116,26235,26259,26231,26200,
+26276,26179,26097,26180,26064,26061,25901,25821,
+25735,26312,26350,26350,26333,26333,26343,26357,
+26417,26417,26483,26483,26537,26556,26598,26598,
+26671,26671,26643,26636,26620,26620,26621,26621,
+26602,26602,26617,26617,26574,26574,26565,26563,
+26559,26559,26579,26579,26558,26551,26537,26537,
+26538,26538,26562,26578,26577,26577,26527,26527,
+26512,26502,26465,26465,26467,26467,26473,26474,
+26471,26471,26482,26482,26466,26461,26449,26449,
+26429,26429,26394,26378,26329,26329,26190,26190,
+26181,25809,25977,25989,26150,26160,26312,26378,
+26468,26479,26439,26428,26412,26402,26398,26405,
+26352,26353,26328,26316,26305,26310,26399,26402,
+26390,26394,26399,26402,26224,26239,26341,26349,
+26324,26311,26293,26260,26246,26229,26228,26217,
+26216,26210,26175,26142,26120,26083,26021,25889,
+25734,25496,25202,25422,24589,24505,24573,24953,
+24760,24918,24794,24557,24333,24947,25005,25088,
+25144,25111,25037,24897,24813,24762,24691,24654,
+24655,24600,24644,24642,24714,24687,24633,24572,
+24520,24531,24581,24500,24460,24051,23865,23790,
+23685,23680,23859,24447,25353,25770,25985,24776,
+24547,25875,25030,24209,24363,24807,24927,24987,
+25256,25100,24658,24161,24358,24333,24159,24184,
+24185,24202,23794,23666,23534,23537,23426,23450,
+23487,23508,23465,23488,23277,23287,23194,23155,
+23094,23087,23039,23026,22924,22915,22930,22943,
+22975,22996,23046,23316,23227,23272,23357,23404,
+23469,23408,23389,23375,23521,23576,23549,23531,
+23542,23555,23719,24379,24585,24876,24099,24736,
+24233,24434,23425,23751,23361,22727,22812,24911,
+25240,24836,24399,23830,22816,22759,22573,22623,
+22707,23051,24539,24850,24781,24583,24528,24709,
+25011,25135,25378,25541,25544,25499,25335,25367,
+25379,25484,25294,25359,25208,25271,25331,25468,
+25493,25554,25505,25510,25591,25837,25771,25768,
+25797,25703,25914,26152,26123,26135,25910,25994,
+25980,26208,26234,26257,26257,26256,26224,26322,
+26357,26367,26257,26210,26198,26099,26012,26105,
+26064,26116,26092,26015,25964,25982,26239,26239,
+26297,26320,26380,26380,26419,26419,26463,26475,
+26494,26494,26495,26495,26500,26500,26497,26497,
+26488,26488,26485,26485,26483,26483,26485,26485,
+26482,25677,25655,25649,25650,25656,25666,25688,
+25693,25691,25698,25688,25702,25723,25726,25735,
+25758,25767,25781,25781,25790,25797,25842,25845,
+25839,25878,25889,25888,25926,25944,25952,25983,
+25953,25962,25968,25991,25828,26098,26044,26035,
+26070,26070,26132,25706,25748,25750,25777,25779,
+25878,25881,25878,25885,25909,25909,25890,25903,
+25895,25898,25900,25905,25922,25937,25922,25954,
+25917,25922,25977,26013,26076,26090,26259,26268,
+26184,26152,26130,26126,26137,26127,26139,26126,
+26189,26176,26192,26180,26195,26154,26172,26159,
+26132,26136,26152,26182,26214,26230,26258,26266,
+26277,26291,26288,26281,26270,26280,25776,26308,
+26296,26343,24328,23729,23410,23716,23960,25737,
+26211,26173,26138,26206,26269,26342,26262,24554,
+24283,24050,22904,22537,22166,21957,21718,21174,
+20888,20629,20263,20134,20013,19791,19690,19606,
+19504,19449,19370,19102,18911,18698,18343,18185,
+18051,17873,17827,17824,17918,17977,18022,18026,
+17988,17956,17948,17994,18071,18271,18396,18541,
+18833,18995,19169,19527,19715,20040,20416,20616,
+20842,21294,21436,21566,21832,22002,22206,22831,
+23143,23411,23705,23739,23744,23661,23655,23683,
+23864,25675,25736,25913,26223,26223,26074,26074,
+26135,26183,26374,26374,24770,24191,23669,22686,
+22240,21851,21243,21023,20846,20507,20322,20124,
+19715,19518,19339,19060,18949,18852,18682,18594,
+18500,18306,18209,18113,17955,17889,17831,17735,
+17696,17659,17578,17549,17482,17327,17277,17260,
+17385,17688,18124,18136,18301,18390,18440,18386,
+18360,18241,18217,18131,18045,17355,17899,17715,
+17718,17189,17220,17712,17717,17265,17726,17628,
+17421,17161,17106,16972,16918,16884,16877,16897,
+16923,16981,17017,17056,17126,17145,17152,17142,
+17134,17132,17177,17228,17292,17421,17466,17492,
+17468,17423,17361,17212,17136,17072,16987,16965,
+16940,16882,16839,16784,16653,16586,16528,16486,
+16507,16557,16991,17425,17587,17775,17587,17712,
+17554,17568,17248,17350,17411,17482,17516,17462,
+17377,17133,17082,16896,16043,16113,16209,16432,
+16596,16706,17147,17287,17279,17596,17718,17806,
+18005,18032,18171,18607,18881,19231,19966,20198,
+20378,21071,21607,22338,23079,23417,23610,23798,
+23917,24085,24151,24179,24225,24521,24683,24834,
+25182,25348,25468,26048,26035,26082,26222,26260,
+26263,25965,25905,25843,25858,25886,25943,25868,
+25868,25831,26043,25809,25946,26127,26105,26070,
+26091,26194,26177,26069,25949,25788,25546,25470,
+25586,26326,26363,26363,26354,26354,26387,26407,
+26470,26470,26538,26538,26592,26612,26657,26657,
+26765,26765,26722,26716,26705,26705,26737,26737,
+26728,26725,26721,26721,26652,26652,26637,26635,
+26638,26638,26632,26632,26609,26600,26580,26580,
+26567,26567,26597,26631,26643,26643,26591,26591,
+26581,26574,26555,26555,26563,26563,26568,26568,
+26566,26566,26611,26611,26599,26595,26591,26591,
+26586,26586,26577,26571,26552,26552,26521,26521,
+26463,26431,26331,26331,26040,26049,26084,26125,
+26259,26262,26411,26408,26388,26362,26286,26268,
+26224,26229,26231,26253,26292,26312,26491,26491,
+26502,26489,26455,26453,26343,26296,26302,26370,
+26355,26361,26424,26423,26495,26498,26493,26480,
+26425,26400,26326,26270,26215,26180,26138,26115,
+26072,25868,25726,25492,24931,24916,24798,24594,
+24737,24709,24977,24866,24716,24573,24410,24552,
+25148,25210,25226,25143,25114,25061,24939,24902,
+24894,24868,24997,24981,24969,24989,24955,24880,
+24694,24692,24709,24670,24580,24164,24137,24089,
+24188,24157,24205,25499,25842,25941,25743,25490,
+25874,25552,24591,24510,24642,24750,24918,24947,
+26522,26522,26577,26577,26559,25108,24531,24552,
+24317,24327,24244,24253,24466,24470,24522,24535,
+24621,24621,24516,24528,24299,24307,24259,24190,
+23924,23928,23865,23859,23536,23379,23643,23645,
+23984,23987,24052,24066,24049,24061,24013,24272,
+24216,23898,23292,23249,23367,23437,23445,23630,
+23516,23549,23742,23891,24289,25008,24748,24654,
+22935,22520,23039,22668,22821,24079,24524,24256,
+24341,24513,24415,23897,23528,23712,24079,24257,
+23695,23843,24985,24935,24859,24569,24507,24619,
+24968,24977,25049,25166,25386,25316,25419,25424,
+25461,25506,25160,25106,25170,25242,25397,25400,
+25497,25501,25442,25352,25500,25691,25664,25709,
+25700,25702,25679,25972,26060,26073,25773,25781,
+25949,26246,26297,26313,26196,26202,26212,26147,
+26162,26166,26093,26117,26050,26022,25981,25976,
+25775,25775,25775,26085,26288,26288,26363,26363,
+26404,26422,26469,26469,26486,26486,26502,26511,
+26543,26543,26542,26542,26544,26544,26538,26538,
+26525,26525,26514,26511,26511,26511,26520,26520,
+26524,26525,26525,26525,26489,26489,26416,26397,
+26382,26382,26374,26374,26329,26310,26266,26266,
+26186,26186,25766,25757,25788,25799,25766,25799,
+25848,25951,26013,26000,26032,26001,26057,26089,
+26084,26109,26111,26108,25909,25946,26097,26097,
+26219,26219,26275,25749,25811,25818,25811,25808,
+25824,25839,25850,25855,25879,25892,25952,25982,
+25991,26002,25995,26018,25998,26012,25944,25958,
+25954,25962,25988,26007,26021,26034,26046,26013,
+26025,26010,26295,26295,26377,26377,26393,25811,
+25946,25945,26079,26058,26140,26108,26133,26097,
+26103,26125,26164,26226,26258,26253,26231,26203,
+26192,26208,26241,26282,26324,26340,26345,26422,
+26366,26311,26125,25991,25008,25569,25789,26199,
+26185,26112,26020,26030,26124,26236,26342,26374,
+26357,25805,25406,25291,23500,22963,22513,21850,
+21613,21416,21130,21011,20873,20595,20497,20430,
+20374,20323,20228,19892,19677,19454,19114,18962,
+18816,18553,18468,18455,18637,18784,18922,19044,
+18995,18911,18745,18740,18800,19055,19220,19386,
+19637,19747,19864,20139,20310,20622,21027,21242,
+21492,21977,22140,22283,22463,22499,22619,22960,
+23188,23408,23876,24061,24173,24329,24372,26493,
+26672,26672,26698,26670,26647,26647,25970,25970,
+26100,26176,26433,26433,26376,25922,24913,23424,
+22888,22424,21796,21625,21511,21300,21158,20982,
+20554,20335,20135,19846,19753,19686,19580,19509,
+19418,19199,19070,18928,18692,18596,18516,18414,
+18383,18357,18290,18241,18200,18198,18174,18130,
+18091,18211,18334,18731,18856,18533,19083,19075,
+18942,18926,18547,18935,18839,18514,18649,18448,
+17944,18411,18417,17903,18377,17884,17891,18337,
+17840,18058,17812,17780,17776,17782,17842,17880,
+17915,17986,18031,18085,18200,18248,18281,18312,
+18323,18343,18439,18510,18581,18675,18687,18676,
+18605,18553,18495,18348,18259,18164,17979,17900,
+17830,17718,17663,17619,17580,17571,17565,17614,
+17673,18611,18736,18642,18598,18501,18500,18538,
+18649,18745,18745,18702,18686,18669,18638,18555,
+18500,18360,18219,18209,17963,17616,17734,18165,
+18298,18412,17942,18672,18873,19123,18785,19317,
+19468,19542,19338,20413,20742,20968,21386,21606,
+22291,22332,22828,23583,24390,24693,24990,25273,
+25227,25257,25514,25517,25512,25968,26067,26125,
+26242,26249,26251,26132,26069,26082,26115,26123,
+26038,25832,25849,25866,25920,25957,25888,25847,
+25595,25571,25682,25631,25635,25948,25958,25989,
+25876,25843,25803,25794,25679,25592,26436,26436,
+26460,26470,26501,26501,26573,26573,26627,26642,
+26668,26668,26717,26717,26739,26748,26768,26768,
+26765,26765,26722,26716,26705,26705,26737,26737,
+26728,26725,26721,26721,26652,26652,26637,26635,
+26638,26638,26632,26632,26609,26600,26580,26580,
+26567,26567,26597,26631,26643,26643,26591,26591,
+26581,26574,26555,26555,26563,26563,26568,26568,
+26566,26566,26611,26611,26599,26595,26591,26591,
+26586,26586,26577,26571,26552,26552,26521,26521,
+26463,26431,26331,26331,26040,26052,26097,26154,
+26294,26292,26436,26431,26387,26369,26298,26294,
+26261,26269,26266,26276,26309,26311,26491,26491,
+26507,26508,26499,26498,26455,26456,26420,26413,
+26400,26402,26471,26454,26478,26523,26517,26554,
+26503,26485,26402,26351,26310,26290,26268,26230,
+26208,26099,26007,25924,25745,25630,25541,24904,
+24798,24747,24751,25057,24921,24723,24468,24228,
+24610,24978,25124,25231,25244,25206,25090,25047,
+25033,24981,25082,25053,25021,25021,24994,24984,
+24841,24850,24770,24608,24476,24080,24079,24020,
+24104,24182,24819,25755,25856,25883,25854,25883,
+25911,24685,24654,25089,24837,24773,24678,24599,
+26522,26522,26577,26577,26559,25215,24627,24637,
+24331,24338,24258,24286,24508,24519,24585,24599,
+24675,24656,24550,24556,24340,24343,24292,24177,
+23899,23913,23861,23856,23551,23405,23659,23665,
+24008,24028,24102,24124,24113,24119,24128,24365,
+24214,23767,23283,23272,23292,23350,23349,23864,
+23611,23483,24207,24669,24822,24315,24596,23857,
+24053,23930,22940,22839,23912,23993,24306,24300,
+24532,24765,24348,23912,24127,24481,25017,25073,
+24518,24536,25010,24807,24560,24501,24679,24668,
+24982,24840,24783,24534,24487,24558,25315,25367,
+25435,25430,24966,24488,24743,25067,25168,25469,
+25615,25498,25546,25330,25290,25424,25550,25647,
+25580,25581,25543,25770,25788,25896,25827,25708,
+25845,26150,26174,26214,26048,25968,26080,26074,
+26007,26049,25993,26049,26021,25995,25963,25959,
+25775,25775,25775,26085,26288,26288,26363,26363,
+26404,26422,26469,26469,26486,26486,26502,26511,
+26543,26543,26542,26542,26544,26544,26538,26538,
+26525,26525,26514,26511,26511,26511,26520,26520,
+26524,26525,26525,26525,26489,26489,26416,26397,
+26382,26382,26374,26374,26329,26310,26266,26266,
+26186,26186,25748,25767,25787,25799,25828,25813,
+25798,25869,25909,25976,26014,26008,26005,26037,
+26042,26054,26041,26038,25865,25946,26097,26097,
+26219,26219,26275,25789,25899,25885,25862,25861,
+25890,25882,25899,25904,25932,25936,25991,26012,
+26028,26039,26048,26055,26059,26039,25978,25986,
+25980,25988,26012,26017,26033,26038,26043,26049,
+26033,26015,26295,26295,26377,26377,26393,25827,
+25980,25981,26131,26107,26168,26073,26104,26072,
+26146,26171,26188,26249,26313,26329,26310,25901,
+25891,25872,25879,25962,26129,26166,26185,26246,
+26282,26341,26309,26252,26268,26243,26216,26214,
+26218,26215,26211,26244,26282,26323,26360,26382,
+26375,26412,26424,26358,26334,25792,25095,23097,
+22801,22491,22135,21966,21776,21444,21375,21365,
+21424,21368,21216,20674,20356,20065,19709,19582,
+19450,19153,19031,18987,19200,19413,19625,19831,
+19793,19695,19450,19435,19520,19874,20076,20267,
+20473,20519,20582,20815,20998,21201,21761,21995,
+22252,22706,22867,23009,23507,23443,23449,23584,
+23606,23653,24239,24392,25860,25957,26493,26493,
+26672,26672,26698,26670,26647,26647,25970,25970,
+26100,26176,26433,26433,26336,26544,26315,24482,
+23817,23383,22745,22555,22436,22205,22049,21856,
+21383,21142,20931,20657,20591,20556,20471,20405,
+20324,20104,19968,19816,19514,19382,19272,19131,
+19089,19052,19075,19067,19006,18904,18895,18909,
+19212,19211,18993,19721,19716,19737,19824,19818,
+19788,19827,19655,19669,19478,19042,19362,19153,
+18601,19032,19045,18997,18950,18588,19040,18982,
+18972,18751,19070,18829,18840,18853,18876,18877,
+18881,18930,18987,19067,19269,19363,19434,19504,
+19518,19539,19631,19698,19762,19826,19812,19773,
+19663,19611,19565,19470,19406,19327,19155,19117,
+19190,19683,19698,19681,19803,19870,19982,20003,
+20087,20379,19914,19907,19648,19716,19645,19636,
+19716,19665,19597,19464,19440,19384,19278,19262,
+19246,19241,19218,19213,19216,19259,19144,19323,
+19608,19673,19709,19918,20141,20718,20871,20939,
+20347,21171,21480,21892,22287,22166,23085,22840,
+23316,25882,26007,25355,26188,25894,26284,26319,
+26343,26301,26193,25924,26152,26225,26240,26265,
+26301,26271,26203,26165,26103,26065,26043,25995,
+26004,25983,25973,25971,25905,25892,25848,25602,
+25375,25319,25330,25370,25402,25507,25518,25507,
+25630,25730,25746,25586,25547,25516,26436,26436,
+26460,26470,26501,26501,26573,26573,26627,26642,
+26668,26668,26717,26717,26739,26748,26768,26768,
+26828,26828,26809,26797,26768,26768,26771,26771,
+26808,26817,26822,26822,26814,26814,26809,26806,
+26797,26797,26794,26794,26788,26785,26772,26772,
+26751,26751,26744,26741,26737,26737,26737,26737,
+26726,26716,26682,26682,26623,26623,26619,26618,
+26614,26614,26588,26588,26574,26570,26559,26559,
+26551,26551,26542,26539,26529,26529,26512,26512,
+26503,26501,26538,26538,26505,26505,26474,26462,
+26430,26430,25966,25966,26004,25988,25945,25939,
+25936,25934,25949,25962,25976,25980,26042,26045,
+26045,26060,26089,26093,26132,26132,26209,26232,
+26268,26268,26405,26405,26435,26441,26438,26438,
+26402,26402,26437,26456,26537,26537,26499,26477,
+26380,26332,26270,26257,26253,26212,26165,26020,
+25864,25795,25478,25591,25123,25142,25225,25015,
+24975,24952,24957,24942,24929,25024,25232,25343,
+25423,25458,25442,25407,25363,25334,25317,25310,
+25345,25356,26333,26333,24891,24676,24439,24466,
+25001,25244,25474,25722,26424,26424,26539,26539,
+26630,26649,26655,26655,26652,26652,26630,26619,
+26622,26622,26700,26700,26725,26731,26735,26735,
+26747,26747,26772,26779,26784,26784,26754,26754,
+26758,26757,26741,26741,26809,26809,26829,26835,
+26843,26843,26844,26844,26826,26824,26838,26838,
+26840,26840,26842,26842,26841,26841,26841,26841,
+26865,26873,26891,26891,26752,26752,26503,26436,
+26356,26356,24057,23935,23640,23482,23158,23113,
+23467,23443,23016,23503,23463,23421,23272,22007,
+21995,21373,23093,22234,23533,24590,24985,24643,
+24576,24736,24769,24686,24690,24362,24787,24917,
+25072,24931,24908,24619,24604,24643,24112,23939,
+24527,24933,25046,25166,24288,24141,24425,25168,
+25080,25325,25485,25453,25414,25390,25422,25401,
+25385,25330,25301,25341,25390,25536,25647,25688,
+25692,25807,25864,25941,26106,26163,26127,26061,
+25913,25722,25683,25738,25866,26015,26077,26077,
+26080,26080,26213,26244,26323,26323,26373,26373,
+26407,26423,26469,26469,26486,26486,26489,26493,
+26508,26508,26535,26535,26548,26551,26555,26555,
+26544,26544,26541,26539,26534,26534,26540,26540,
+26543,26543,26540,26540,26525,26525,26519,26516,
+26507,26507,26504,26504,26506,26503,26491,26491,
+26458,26458,26400,26369,26265,26265,26104,26104,
+25826,25866,25888,25904,25923,25929,25915,25956,
+25945,25939,25916,25920,25798,26166,26217,26217,
+26280,26280,26336,26355,26395,26395,26433,26433,
+26445,26445,26433,26433,26404,26404,26366,25813,
+25941,25940,25957,25968,26003,26035,26057,26065,
+26029,26029,26291,26331,26379,26379,26423,26423,
+26444,26452,26473,26473,26472,26472,26444,26427,
+26372,26372,26347,26347,25967,26123,26216,26201,
+26110,26049,26046,26049,26102,26139,26080,26160,
+26108,25818,25802,25778,26177,26228,26176,26191,
+26240,26279,26329,26367,26398,26446,26430,26443,
+26395,26386,26409,26382,26338,26314,26258,26221,
+26235,26284,26345,26404,26496,26557,26538,26460,
+26296,26224,26297,26323,24618,23367,23244,23209,
+23194,23181,23080,22502,22120,21792,21540,21501,
+21434,21171,21009,20882,20924,21114,21362,21731,
+21774,21749,21584,21590,21721,22214,22438,22631,
+22799,22844,22906,23170,23377,23756,23977,24127,
+24299,25999,25940,25954,26557,26557,25941,25966,
+26007,26018,26197,26197,26161,26085,26712,26712,
+26755,26755,26771,26752,26696,26696,26686,26686,
+26584,26538,26386,26386,26207,26207,26287,26302,
+26429,26429,26556,25483,25310,24886,24604,24281,
+23691,23442,23230,22920,22795,22650,22318,22159,
+22029,21839,21754,21656,21372,21207,21077,21003,
+20972,20974,20963,20963,20980,21016,21074,21552,
+21330,21191,21086,21117,21257,21482,21799,21843,
+21834,21634,21515,21355,21091,21055,20909,20791,
+20757,20710,20683,20711,20508,20586,20887,20852,
+21166,21337,21133,21049,21091,21144,21263,21313,
+21358,21432,21522,21683,22125,22320,22436,22384,
+22275,22185,22231,22428,22806,23531,23713,23743,
+23629,23486,23177,22966,22845,22671,22425,22336,
+22275,22085,21998,21945,21951,22049,22173,22361,
+22469,22495,22389,22256,22083,21776,21687,21584,
+21352,21169,21031,20803,20740,20733,20816,20886,
+20947,20974,20926,20858,20803,20786,20885,21070,
+21151,21129,21258,21351,21509,22046,22405,22738,
+23170,23350,23567,24235,25662,25681,25938,25953,
+26126,26243,26419,26430,26397,26372,26372,26401,
+26424,26424,26412,26389,26393,26407,26323,26270,
+26124,26101,26139,26224,26241,26248,26200,26174,
+26138,26010,25906,25901,25832,25808,25767,25603,
+25712,25691,25722,25714,25702,25675,25698,25722,
+25792,25801,25742,26504,26615,26615,26690,26690,
+26727,26740,26766,26766,26790,26790,26785,26782,
+26771,26771,26789,26789,26820,26837,26885,26885,
+26828,26828,26809,26797,26768,26768,26771,26771,
+26808,26817,26822,26822,26814,26814,26809,26806,
+26797,26797,26794,26794,26788,26785,26772,26772,
+26751,26751,26744,26741,26737,26737,26737,26737,
+26726,26716,26682,26682,26623,26623,26619,26618,
+26614,26614,26588,26588,26574,26570,26559,26559,
+26551,26551,26542,26539,26529,26529,26512,26512,
+26503,26501,26538,26538,26505,26505,26474,26462,
+26430,26430,25968,25969,26005,26007,25966,25967,
+25968,25969,25985,25999,26010,26013,26081,26079,
+26076,26067,26092,26099,26138,26135,26211,26232,
+26268,26268,26405,26405,26435,26441,26438,26438,
+26402,26402,26437,26458,26537,26537,26529,26524,
+26425,26382,26360,26340,26357,26350,26340,26300,
+26182,26118,25872,25729,25747,25665,25400,25352,
+25306,25145,25166,25042,24932,24889,24650,24870,
+25021,25405,25516,25548,25481,25439,25400,25342,
+25360,25359,26333,26333,24984,24600,24368,24459,
+25006,25235,25486,25688,26424,26424,26539,26539,
+26630,26649,26655,26655,26652,26652,26630,26619,
+26622,26622,26700,26700,26725,26731,26735,26735,
+26747,26747,26772,26779,26784,26784,26754,26754,
+26758,26757,26741,26741,26809,26809,26829,26835,
+26843,26843,26844,26844,26826,26824,26838,26838,
+26840,26840,26842,26842,26841,26841,26841,26841,
+26865,26873,26891,26891,26752,26752,26503,26436,
+26356,26356,23590,23847,23637,23349,23000,22955,
+22911,23362,23326,22500,23188,22089,24305,24477,
+23369,23720,22659,22601,22838,23738,24225,23318,
+24156,24428,24602,24741,24759,25071,25220,25261,
+25073,24956,24825,24478,24509,24559,24496,24105,
+23777,23763,24311,24508,24885,24484,24411,24452,
+24314,24740,25296,25348,25357,25216,25213,25138,
+25145,25184,25178,25209,25288,25365,25485,25530,
+25573,25681,25736,25786,26007,25980,26050,26087,
+26020,25955,25815,25620,25793,25832,26077,26077,
+26080,26080,26213,26244,26323,26323,26373,26373,
+26407,26423,26469,26469,26486,26486,26489,26493,
+26508,26508,26535,26535,26548,26551,26555,26555,
+26544,26544,26541,26539,26534,26534,26540,26540,
+26543,26543,26540,26540,26525,26525,26519,26516,
+26507,26507,26504,26504,26506,26503,26491,26491,
+26458,26458,26400,26369,26265,26265,26104,26104,
+25835,25858,25884,25901,25924,25914,25901,25871,
+25869,25883,25921,25937,25797,26166,26217,26217,
+26280,26280,26336,26355,26395,26395,26433,26433,
+26445,26445,26433,26433,26404,26404,26366,25818,
+25951,25942,25963,25978,26000,26020,26058,26062,
+26029,26029,26291,26331,26379,26379,26423,26423,
+26444,26452,26473,26473,26472,26472,26444,26427,
+26372,26372,26347,26347,26100,26164,26275,26270,
+26347,26294,26264,26080,26080,26104,26341,26295,
+26280,25864,25831,25813,25900,26170,26320,26377,
+26404,26431,26476,26494,26510,26538,26506,26506,
+26444,26423,26420,26248,26187,26208,26261,26270,
+26280,26257,26272,26294,26405,26468,26505,26565,
+26558,26509,26272,26352,26358,26308,26267,26271,
+26121,23506,23537,23456,23279,23103,22753,22653,
+22519,22060,21788,21558,21404,21561,21859,22558,
+22768,22873,22858,22856,22914,23136,25973,26015,
+26007,26011,26102,26152,26133,26176,26068,26070,
+26061,26060,25985,25991,26557,26557,25961,25984,
+26011,26015,26197,26197,26161,26085,26712,26712,
+26755,26755,26771,26752,26696,26696,26686,26686,
+26584,26538,26386,26386,26207,26207,26287,26302,
+26429,26429,26556,26556,26556,25264,25234,25130,
+24772,24598,24457,24224,24079,23907,23524,23338,
+23184,22987,22916,22824,22518,22352,22189,21983,
+21999,22052,22213,22407,22453,22619,22702,22612,
+22479,22403,22256,22243,22388,22573,22887,22981,
+22829,22507,22388,22256,22059,22019,21948,21892,
+21894,21764,21777,21803,21835,22178,22527,22840,
+23225,23206,23197,22720,22768,22659,22455,22288,
+22089,22060,22258,22627,23069,23283,23530,23876,
+23982,24084,24752,25247,25527,25568,25542,25583,
+25333,25157,24945,24591,24417,24259,23910,23754,
+23597,23300,23165,23055,23049,23191,23454,24036,
+24133,24046,23674,23428,23143,22616,22381,22210,
+21933,21853,21797,21725,21721,21729,21761,21771,
+21772,21777,21713,21676,21717,21709,21792,22051,
+22168,22248,22367,22434,22542,23020,23348,23625,
+24140,24225,24533,25440,25692,25735,25926,25947,
+26108,26191,26355,26344,26406,26414,26429,26377,
+26415,26415,26433,26413,26433,26451,26417,26460,
+26382,26205,26148,26232,26211,26271,26226,26192,
+26166,26109,26015,25980,25909,25865,25823,25511,
+25604,25502,25551,25757,25636,25759,25697,25643,
+25648,25715,25723,26504,26615,26615,26690,26690,
+26727,26740,26766,26766,26790,26790,26785,26782,
+26771,26771,26789,26789,26820,26837,26885,26885,
+27011,27011,26991,26984,26974,26974,26989,26989,
+26999,27004,27019,27019,27022,27022,27014,27009,
+26995,26995,26974,26974,26965,26961,26944,26944,
+26916,26916,26885,26875,26859,26859,26863,26863,
+26857,26850,26825,26825,26810,26810,26799,26794,
+26778,26778,26748,26748,26713,26697,26653,26653,
+26641,26641,26626,26615,26597,26597,26567,26567,
+26550,26545,26534,26534,26513,26513,26507,26503,
+26487,26487,26458,26458,25707,25710,25701,25701,
+25702,25702,25704,25701,26438,26438,26433,26433,
+26475,26513,25757,25757,25804,25804,25887,25953,
+26111,26111,26174,26174,26170,26170,26174,26174,
+26169,26169,26220,26246,26319,26319,26343,26346,
+26242,26196,26132,26126,26139,26121,26147,26159,
+26210,26215,26171,26078,26020,25882,25843,25786,
+25545,25482,25370,25288,25465,25430,25340,25263,
+25191,25172,25282,25485,25651,25640,25618,25569,
+25559,25549,25388,25409,25332,24759,25087,25140,
+25383,25476,25583,25696,26596,26596,26669,26669,
+26741,26760,26792,26792,26811,26811,26823,26827,
+26833,26833,26856,26856,26878,26882,26888,26888,
+26898,26898,26901,26900,26892,26892,26887,26887,
+26895,26900,26915,26915,26962,26962,27018,27034,
+27058,27058,27066,27066,27062,27060,27052,27052,
+27036,27036,27021,27014,26990,26990,26963,26963,
+26943,26933,26906,26906,26841,26841,26767,26748,
+26720,26720,25574,25556,25514,25354,24651,24618,
+24446,24451,24080,23573,23681,22982,22233,24338,
+24462,21964,21747,22671,22206,22789,23319,24007,
+23837,23946,24298,25033,24883,24930,25054,25208,
+25349,25283,25164,25007,24535,24690,24708,24381,
+23991,23667,23635,23632,24288,24624,24587,23958,
+23937,24056,24939,24677,25048,24663,24621,24587,
+25114,25176,25135,25098,25162,25205,25394,25425,
+25487,25549,25593,25606,25727,25788,25837,25905,
+25916,25910,25886,25895,25655,25759,25636,25643,
+25763,25807,25766,26196,26266,26266,26330,26330,
+26380,26397,26436,26436,26459,26459,26474,26482,
+26507,26507,26522,26522,26533,26538,26549,26549,
+26550,26550,26547,26545,26541,26541,26541,26541,
+26544,26544,26541,26541,26529,26529,26522,26519,
+26510,26510,26508,26508,26510,26510,26510,26510,
+26507,26507,26487,26476,26441,26441,26383,26383,
+25741,25745,25756,25759,25776,25786,25769,25769,
+25763,25765,25757,25755,25712,26270,26278,26278,
+26311,26311,26337,26359,26444,26444,26490,26490,
+26509,26510,26494,26494,26454,26454,26397,25722,
+25820,25816,25819,25822,25825,25828,25836,25839,
+26341,26341,26365,26381,26432,26432,26467,26467,
+26483,26490,26508,26508,26487,26487,26452,26436,
+26390,26390,26359,26359,25924,25982,26066,26067,
+26249,26246,26318,26323,26319,26287,26350,26331,
+26366,26333,26211,26204,25884,25948,26321,26495,
+26496,26509,26506,26510,26351,26334,26305,26305,
+26168,26080,26055,26100,26096,26097,26100,26091,
+26159,26172,26199,26224,26336,26368,26406,26427,
+26400,26384,26263,26279,26314,26318,26300,26270,
+26292,26324,25145,26353,26073,23796,23359,23393,
+23152,22352,21976,21604,21393,21548,21891,22877,
+23276,23506,26175,26290,26219,26200,26089,26100,
+26061,26061,25955,25929,25889,25894,25844,25844,
+25814,25802,25771,25772,26633,26633,25790,25804,
+25841,25841,25905,25906,25858,25824,26802,26802,
+26822,26822,26834,26821,26801,26801,26757,26757,
+26675,26640,26538,26538,26055,26055,26176,26229,
+26420,26420,26566,26566,26281,25109,25112,25106,
+25040,25014,25013,25055,25022,24918,24602,24457,
+24353,24302,24316,24293,24076,23902,23750,23592,
+23597,23610,23878,23697,23999,23941,23668,24066,
+24006,23617,23860,23834,23895,24109,24460,24542,
+24310,23515,23195,23068,22890,22826,22752,22728,
+22751,22810,22908,22976,23148,23494,23912,24251,
+24981,26116,26088,24486,24325,23958,23188,22781,
+22436,22632,22976,23324,24329,24968,25525,26191,
+26346,26370,26565,26561,26559,26506,26239,26239,
+26114,26063,25995,25744,25695,25565,25361,25264,
+25164,24921,24779,24658,24708,24937,25230,26528,
+26483,26485,26455,26411,24722,23688,23358,23137,
+22768,22685,22727,22831,22886,22962,22968,22914,
+22868,22924,22957,23101,23262,23379,23473,23742,
+23918,24077,24300,24417,24629,26483,26486,26486,
+26486,26486,26522,25772,25931,26505,26549,26549,
+25787,25847,26015,26030,26339,26337,26391,26401,
+26408,26398,26404,26341,26396,26447,26425,26447,
+26445,26433,26409,26295,26245,26295,26226,26208,
+26206,26112,25967,25939,25823,25803,25765,25712,
+25721,25746,25704,25618,25699,25701,25686,25675,
+25667,25676,25691,26641,26680,26680,26730,26730,
+26767,26782,26823,26823,26854,26854,26858,26857,
+26851,26851,26895,26895,26944,26965,27019,27019,
+27101,27101,27082,27076,27068,27068,27081,27081,
+27085,27088,27101,27101,27103,27103,27094,27090,
+27072,27072,27049,27049,27037,27031,27016,27016,
+26985,26985,26949,26938,26918,26918,26912,26912,
+26905,26899,26878,26878,26870,26870,26858,26852,
+26835,26835,26803,26803,26766,26751,26708,26708,
+26692,26692,26678,26673,26655,26655,26626,26626,
+26608,26602,26588,26588,26571,26571,26566,26562,
+26549,26549,26528,26528,26511,26505,26499,26499,
+26490,26490,26487,26487,26489,26489,26484,26484,
+26502,26503,26488,26488,26474,26474,26420,25827,
+26024,26024,26066,26066,26057,26055,26059,26059,
+26064,26064,26118,26144,26221,26221,26246,26246,
+26154,26125,26062,26055,26083,26083,26109,26125,
+26187,26189,26220,26213,26197,26173,26092,26078,
+26019,26010,25916,25836,26353,26353,26441,26441,
+26416,26419,26462,26462,26456,26456,26433,26424,
+26396,26396,25466,25431,25438,25480,26504,26504,
+26568,26568,26604,26620,26666,26666,26732,26732,
+26797,26815,26847,26847,26869,26869,26884,26889,
+26898,26898,26920,26920,26939,26945,26951,26951,
+26956,26956,26949,26948,26947,26947,26953,26953,
+26966,26972,26995,26995,27042,27042,27100,27118,
+27146,27146,27162,27162,27159,27156,27142,27142,
+27121,27121,27106,27097,27070,27070,27038,27038,
+27012,27001,26968,26968,26924,26924,26875,26860,
+26840,26840,26843,26843,26867,26889,25382,25285,
+24887,24833,24432,24568,24239,24136,23552,23538,
+23055,23020,23413,23360,23706,22944,22817,23475,
+23440,23699,24594,24983,25109,24188,24939,24990,
+25262,25375,25307,24599,24678,24876,24667,24456,
+24158,23687,23583,23511,23463,23460,23497,23613,
+23775,23860,23911,24237,24007,24061,24116,24337,
+24669,24639,24655,24780,24999,25005,25294,25324,
+25403,25414,25472,25529,25619,25657,25657,25697,
+25760,25799,25833,25835,25869,25886,25876,25839,
+25787,25720,25619,25623,26268,26268,26322,26322,
+26364,26379,26409,26409,26435,26435,26456,26466,
+26493,26493,26510,26510,26521,26526,26539,26539,
+26543,26543,26541,26539,26535,26535,26537,26537,
+26540,26540,26538,26538,26527,26527,26520,26517,
+26509,26509,26507,26507,26510,26511,26513,26513,
+26512,26512,26500,26493,26471,26471,26436,26436,
+26419,26408,26373,26373,26278,26278,26274,26270,
+26308,26308,26335,26335,26310,26306,26307,26307,
+26335,26335,26355,26376,26461,26461,26501,26501,
+26517,26518,26500,26500,26457,26457,26399,26384,
+26371,26371,26407,26407,26426,26435,26418,26418,
+26395,26395,26397,26407,26451,26451,26480,26480,
+26489,26495,26517,26517,26501,26501,26463,26447,
+26410,26410,26378,26378,26377,25855,26038,26034,
+26214,26214,26319,26341,26362,26350,26380,26387,
+26455,26415,26375,26362,26221,26054,26007,26089,
+26171,26353,26439,26435,26197,25938,26134,26165,
+26091,26085,25894,25879,25906,25931,25981,25993,
+26078,26114,26138,26139,26258,26257,26257,26193,
+26173,26166,26165,26179,26213,26222,26217,26198,
+26176,26188,26307,26364,26306,26314,26099,24424,
+24338,24238,24220,24325,24057,24083,24217,25919,
+26082,26102,26321,26330,26216,26178,26057,26057,
+26034,26030,25866,26485,26532,26532,26583,26583,
+26632,26650,26720,26720,26657,26657,26646,26647,
+26662,26662,26619,26619,26727,26787,26831,26831,
+26822,26822,26824,26822,26814,26814,26772,26772,
+26716,26688,26617,26617,25983,25983,26091,26155,
+26365,26365,26548,26380,26441,26099,25968,25968,
+25757,25757,25829,25882,25939,25939,26037,26134,
+26287,26080,26298,26298,26077,26077,26031,26016,
+25990,25990,26003,26003,26027,26075,26290,25662,
+26114,26190,26342,26362,26390,26421,26403,26374,
+26326,26283,26166,25778,25411,25327,25516,25749,
+25903,25989,26371,26369,26265,26242,26205,26203,
+26174,26173,26177,26189,26225,26225,26223,25814,
+25704,25076,25171,25542,26334,26373,26438,26468,
+26563,26563,26566,26566,26539,26490,26258,26262,
+26024,26025,26524,26273,26331,26332,26353,26353,
+26560,26382,26440,26439,26480,26480,26550,26549,
+26475,26475,26464,26436,26313,26120,26024,25963,
+25827,25788,25800,25888,25999,26117,26179,26149,
+26204,26132,26098,26120,25979,26007,25943,25893,
+26541,26541,26497,26497,26501,26502,26506,26506,
+26507,26507,26546,26552,26548,26548,26576,26576,
+25779,25838,25987,25993,26308,26299,26359,26373,
+26374,26388,26366,26359,26344,26346,26346,26343,
+26323,26320,26329,26324,26304,26270,26326,26322,
+26325,26283,26104,26084,25900,25874,25811,25789,
+25793,25793,26525,26525,26567,26584,26621,26621,
+26666,26666,26704,26717,26746,26746,26791,26791,
+26829,26846,26892,26892,26928,26928,26936,26938,
+26939,26939,26983,26983,27032,27053,27107,27107,
+27351,27351,27341,27338,27329,27329,27323,27323,
+27320,27319,27319,27319,27315,27315,27302,27296,
+27271,27271,27237,27237,27214,27204,27178,27178,
+27136,27136,27097,27085,27056,27056,27035,27035,
+27022,27018,27009,27009,26996,26996,26989,26984,
+26966,26966,26934,26934,26902,26894,26883,26883,
+26856,26856,26841,26837,26826,26826,26813,26813,
+26797,26789,26766,26766,26756,26756,26745,26740,
+26730,26730,26717,26717,26707,26698,26687,26687,
+26685,26685,26684,26681,26671,26671,26655,26655,
+26617,26604,26577,26577,26552,26552,26556,26555,
+26547,26547,26561,26561,26560,26562,26572,26572,
+26601,26601,26572,26544,26429,26429,26487,26487,
+26580,26595,26592,26592,26592,26592,26572,26562,
+26529,26529,26558,26558,26593,26606,26633,26633,
+26630,26630,26635,26638,26648,26648,26673,26673,
+26670,26670,26673,26673,26651,26651,26667,26674,
+26689,26689,26710,26710,26726,26734,26756,26756,
+26762,26762,26784,26795,26825,26825,26885,26885,
+26927,26940,26962,26962,26976,26976,26998,27007,
+27027,27027,27079,27079,27098,27104,27110,27110,
+27096,27096,27068,27070,27108,27108,27147,27147,
+27172,27182,27210,27210,27268,27268,27323,27341,
+27379,27379,27397,27397,27398,27395,27374,27374,
+27352,27352,27344,27337,27307,27307,27270,27270,
+27246,27234,27200,27200,27160,27160,27124,27107,
+27080,27080,27051,27051,27030,27023,27008,27008,
+26955,26955,26888,26864,26812,26812,24908,24882,
+23810,23514,22924,23174,23019,22610,22863,23193,
+23483,23503,23769,24318,24790,24437,25202,25045,
+25246,25210,25217,25161,24784,24891,24796,24787,
+24624,24449,24134,23631,23491,23449,23475,23576,
+23765,23895,24169,23884,23901,23867,23883,24107,
+24179,24392,24465,24798,24897,25067,25274,25296,
+25404,25482,26202,26202,26373,26373,26455,26470,
+26469,26469,26433,26433,26393,26382,26369,26369,
+25621,25547,25405,25586,26318,26318,26322,26322,
+26317,26315,26313,26313,26356,26356,26384,26398,
+26436,26436,26469,26469,26483,26488,26497,26497,
+26503,26503,26507,26507,26505,26505,26521,26521,
+26525,26526,26523,26523,26514,26514,26511,26509,
+26503,26503,26499,26499,26507,26508,26508,26508,
+26501,26501,26490,26485,26472,26472,26465,26465,
+26458,26455,26451,26451,26413,26413,26385,26379,
+26372,26372,26362,26362,26380,26385,26391,26391,
+26417,26417,26433,26443,26475,26475,26501,26501,
+26504,26502,26483,26483,26435,26435,26382,26372,
+26377,26377,26429,26429,26431,26437,26467,26467,
+26482,26482,26482,26484,26493,26493,26501,26501,
+26487,26492,26532,26532,26549,26549,26502,26490,
+26478,26478,26451,26451,26437,26433,26427,26427,
+26428,26428,26080,26125,26199,26198,26269,26276,
+26257,26257,26230,26227,26125,26111,25896,25792,
+25782,25778,25740,25756,26324,26376,26505,26505,
+26624,26624,26635,26636,26630,26630,26619,26619,
+26597,26564,26424,26424,26295,26295,26216,26195,
+26197,26197,26531,26531,26547,26563,26629,26629,
+26580,26580,26049,26083,26147,26155,26144,26152,
+26047,25977,26004,26005,25974,25976,26027,26033,
+26012,26030,26473,26473,26570,26596,26631,26631,
+26639,26639,26647,26650,26663,26663,26684,26684,
+26714,26724,26757,26757,26762,26762,26794,26806,
+26837,26837,26851,26851,26858,26864,26885,26885,
+26847,26847,26838,26834,26823,26823,26807,26807,
+26804,26799,26770,26770,26703,26703,26683,25804,
+25959,25959,26212,26212,25949,26442,26529,26529,
+26543,26543,26611,25846,25920,25920,26004,26004,
+25906,25861,26682,26682,26533,26533,26508,26512,
+26578,26578,26586,26586,25966,26069,26373,25985,
+26042,26178,26313,26455,26566,26566,26566,26534,
+26549,26562,26565,26559,26495,26501,26511,26519,
+26519,26520,26402,26402,26281,26232,26109,26108,
+26150,26150,26179,26198,26257,26257,26219,26216,
+26196,26183,26231,26256,26401,26401,26386,26401,
+26492,26492,26546,26546,26410,26391,26355,26355,
+26253,26253,26473,26393,26387,26387,26321,26323,
+26353,26374,26437,26439,26488,26486,26456,26410,
+26336,26333,26394,26394,26409,26374,26214,26202,
+25966,25966,25953,25985,26167,26411,26291,26282,
+26309,26263,26286,26314,26263,26253,26070,26023,
+26485,26485,26592,26592,26581,26579,26582,26582,
+26588,26588,26588,26588,26586,26586,26573,26573,
+25897,25924,25980,25983,26123,26112,26163,26179,
+26156,26152,26104,26115,26053,26017,25985,25990,
+25941,25946,25957,25985,26062,26044,26140,26165,
+26216,26237,26190,26187,26099,26088,25850,26527,
+26582,26582,26631,26631,26674,26693,26741,26741,
+26834,26834,26896,26916,26949,26949,26983,26983,
+27025,27046,27104,27104,27154,27154,27175,27186,
+27217,27217,27235,27235,27273,27289,27332,27332,
+27351,27351,27341,27338,27329,27329,27323,27323,
+27320,27319,27319,27319,27315,27315,27302,27296,
+27271,27271,27237,27237,27214,27204,27178,27178,
+27136,27136,27097,27085,27056,27056,27035,27035,
+27022,27018,27009,27009,26996,26996,26989,26984,
+26966,26966,26934,26934,26902,26894,26883,26883,
+26856,26856,26841,26837,26826,26826,26813,26813,
+26797,26789,26766,26766,26756,26756,26745,26740,
+26730,26730,26717,26717,26707,26698,26687,26687,
+26685,26685,26684,26681,26671,26671,26655,26655,
+26617,26604,26577,26577,26552,26552,26556,26555,
+26547,26547,26561,26561,26560,26562,26572,26572,
+26601,26601,26572,26544,26429,26429,26487,26487,
+26580,26595,26592,26592,26592,26592,26572,26562,
+26529,26529,26558,26558,26593,26606,26633,26633,
+26630,26630,26635,26638,26648,26648,26673,26673,
+26670,26670,26673,26673,26651,26651,26667,26674,
+26689,26689,26710,26710,26726,26734,26756,26756,
+26762,26762,26784,26795,26825,26825,26885,26885,
+26927,26940,26962,26962,26976,26976,26998,27007,
+27027,27027,27079,27079,27098,27104,27110,27110,
+27096,27096,27068,27070,27108,27108,27147,27147,
+27172,27182,27210,27210,27268,27268,27323,27341,
+27379,27379,27397,27397,27398,27395,27374,27374,
+27352,27352,27344,27337,27307,27307,27270,27270,
+27246,27234,27200,27200,27160,27160,27124,27107,
+27080,27080,27051,27051,27030,27023,27008,27008,
+26955,26955,26888,26864,26812,26812,24983,24984,
+23976,23840,23174,22867,22754,22850,22537,22646,
+23523,23424,23893,24066,24411,24257,24911,24639,
+24671,24942,25024,24985,25061,25026,24904,24753,
+24651,24666,24539,24357,23674,23580,23554,23585,
+23758,23965,24162,24056,23869,23785,23763,23804,
+23982,24256,24308,24720,24807,24871,25064,25098,
+25371,25474,26202,26202,26373,26373,26455,26470,
+26469,26469,26433,26433,26393,26382,26369,26369,
+25587,25471,25424,25779,26318,26318,26322,26322,
+26317,26315,26313,26313,26356,26356,26384,26398,
+26436,26436,26469,26469,26483,26488,26497,26497,
+26503,26503,26507,26507,26505,26505,26521,26521,
+26525,26526,26523,26523,26514,26514,26511,26509,
+26503,26503,26499,26499,26507,26508,26508,26508,
+26501,26501,26490,26485,26472,26472,26465,26465,
+26458,26455,26451,26451,26413,26413,26385,26379,
+26372,26372,26362,26362,26380,26385,26391,26391,
+26417,26417,26433,26443,26475,26475,26501,26501,
+26504,26502,26483,26483,26435,26435,26382,26372,
+26377,26377,26429,26429,26431,26437,26467,26467,
+26482,26482,26482,26484,26493,26493,26501,26501,
+26487,26492,26532,26532,26549,26549,26502,26490,
+26478,26478,26451,26451,26437,26433,26427,26427,
+26428,26428,26078,26122,26202,26206,26297,26297,
+26276,26265,26237,26234,26169,26160,25950,25792,
+25827,25819,25762,25757,26324,26376,26505,26505,
+26624,26624,26635,26636,26630,26630,26619,26619,
+26597,26564,26424,26424,26295,26295,26216,26195,
+26197,26197,26531,26531,26547,26563,26629,26629,
+26580,26580,26052,26093,26156,26162,26132,26119,
+26013,25991,26018,26017,25981,25984,26045,26051,
+26026,26048,26473,26473,26570,26596,26631,26631,
+26639,26639,26647,26650,26663,26663,26684,26684,
+26714,26724,26757,26757,26762,26762,26794,26806,
+26837,26837,26851,26851,26858,26864,26885,26885,
+26847,26847,26838,26834,26823,26823,26807,26807,
+26804,26799,26770,26770,26703,26703,26683,25804,
+25959,25959,26212,26212,25949,26442,26529,26529,
+26543,26543,26611,25846,25920,25920,26004,26004,
+25906,25861,26682,26682,26533,26533,26508,26512,
+26578,26578,26586,26586,25966,26070,26373,26551,
+26526,26521,26520,26510,26566,26566,26566,26566,
+26566,26540,26566,26566,26433,26433,26541,26532,
+26448,26448,26401,26401,26281,26234,26111,26111,
+26153,26152,26180,26198,26257,26257,26218,26217,
+26204,26214,26264,26260,26396,26398,26386,26401,
+26492,26492,26546,26546,26410,26391,26355,26355,
+26253,26253,26372,26391,26385,26387,26318,26320,
+26346,26376,26437,26438,26488,26488,26461,26440,
+26372,26371,26414,26410,26415,26364,26200,26201,
+25966,25970,25972,26007,26200,26465,26265,26261,
+26308,26266,26310,26293,26217,26194,26005,25990,
+26485,26485,26592,26592,26581,26579,26582,26582,
+26588,26588,26588,26588,26586,26586,26573,26573,
+25895,25927,25981,25976,26087,26098,26170,26186,
+26177,26165,26116,26112,26037,26007,25996,25997,
+25935,25943,25955,25980,26058,26063,26140,26139,
+26201,26241,26193,26197,26116,26119,25878,26527,
+26582,26582,26631,26631,26674,26693,26741,26741,
+26834,26834,26896,26916,26949,26949,26983,26983,
+27025,27046,27104,27104,27154,27154,27175,27186,
+27217,27217,27235,27235,27273,27289,27332,27332,
+27658,27658,27657,27654,27643,27643,27624,27624,
+27610,27605,27591,27591,27571,27571,27546,27535,
+27506,27506,27467,27467,27432,27417,27378,27378,
+27325,27325,27285,27270,27243,27243,27219,27219,
+27196,27188,27173,27173,27161,27161,27149,27142,
+27120,27120,27087,27087,27060,27050,27025,27025,
+27007,27007,26994,26990,26980,26980,26971,26971,
+26963,26958,26943,26943,26924,26924,26913,26909,
+26901,26901,26892,26892,26890,26892,26901,26901,
+26910,26910,26906,26903,26892,26892,26869,26869,
+26840,26826,26783,26783,26750,26750,26744,26744,
+26747,26747,26751,26751,26750,26750,26752,26752,
+26750,26750,26752,26754,26761,26761,26768,26768,
+26786,26790,26795,26795,26771,26771,26776,26776,
+26777,26777,26782,26782,26790,26794,26803,26803,
+26815,26815,26897,26924,26975,26975,27011,27011,
+27036,27046,27071,27071,27096,27096,27108,27112,
+27118,27118,27119,27119,27115,27113,27108,27108,
+27117,27117,27138,27147,27171,27171,27209,27209,
+27243,27256,27284,27284,27311,27311,27336,27346,
+27374,27374,27399,27399,27412,27416,27423,27423,
+27415,27415,27410,27412,27423,27423,27450,27450,
+27481,27495,27531,27531,27586,27586,27630,27645,
+27675,27675,27693,27693,27692,27690,27678,27678,
+27667,27667,27654,27648,27628,27628,27601,27601,
+27589,27582,27557,27557,27515,27515,27472,27457,
+27418,27418,27369,27369,27325,27305,27265,27265,
+27182,27182,27117,27093,27042,27042,27014,27014,
+26984,25554,25029,24954,24069,23931,22900,22580,
+23202,23742,23604,23135,24172,24104,24145,24226,
+24074,23926,23595,23987,24865,24866,24544,24659,
+24563,25081,25074,25039,24742,24599,24417,24312,
+24296,24298,24213,24225,24410,24386,24313,24307,
+24086,24121,24318,24502,24931,25005,25299,25261,
+25341,25480,26422,26422,26285,26285,26259,26280,
+26450,26450,26460,26460,26449,26447,26446,26446,
+26448,26448,26428,26423,26409,26409,26403,26403,
+26414,26413,26394,26394,26347,26347,26360,26362,
+26357,26357,26423,26423,26466,26478,26491,26491,
+26501,26501,26510,26514,26524,26524,26518,26518,
+26512,26509,26503,26503,26490,26490,26483,26482,
+26483,26483,26486,26486,26491,26491,26486,26486,
+26480,26480,26472,26468,26455,26455,26432,26432,
+26400,26395,26404,26404,26459,26459,26467,26466,
+26446,26446,26407,26407,26411,26416,26423,26423,
+26437,26437,26447,26452,26466,26466,26469,26469,
+26463,26456,26428,26428,26393,26393,26366,26362,
+26372,26372,26362,26362,26395,26411,26451,26451,
+26455,26455,26447,26446,26451,26451,26442,26442,
+26489,26516,26548,26548,26577,26577,26598,26605,
+26618,26618,26636,26636,26657,26661,26662,26662,
+26661,26661,26664,26666,26675,26675,26682,26682,
+26675,26677,26689,26689,26729,26729,26724,26722,
+26719,26719,26744,26744,26776,26785,26795,26795,
+26796,26796,26791,26790,26791,26791,26795,26795,
+26804,26809,26818,26818,26825,26825,26817,26818,
+26827,26827,26790,26790,26785,26779,26757,26757,
+26721,26721,26696,26688,26673,26673,26654,26654,
+26644,26640,26632,26632,26636,26636,26666,26674,
+26687,26687,26739,26739,26771,26780,26792,26792,
+26780,26780,26775,26774,26773,26773,26779,26779,
+26790,26796,26812,26812,26834,26834,26861,26873,
+26902,26902,26914,26914,26921,26923,26927,26927,
+26928,26928,26928,26924,26911,26911,26876,26876,
+26866,26865,26867,26867,26854,26854,26843,26837,
+26813,26813,26786,26786,26766,26757,26740,26740,
+26752,26752,26756,26755,26740,26740,26720,26720,
+26724,26723,26708,26708,26680,26680,26647,26636,
+26616,26616,26646,26646,26653,25758,25929,25930,
+25992,25994,26194,26250,26352,26356,26221,26221,
+26113,26077,26022,26022,26050,26050,25988,25952,
+25909,25910,26626,26626,26635,26645,26677,26677,
+26715,26715,26702,26692,26659,26659,25916,25915,
+25996,26007,25984,25985,26011,26015,26025,26011,
+26002,26005,25963,25963,25812,26647,26644,26644,
+26641,26641,25953,25982,26034,26032,26086,26084,
+26046,26053,26115,26122,26216,26216,26219,26218,
+26211,26212,26243,26242,26193,26168,26090,26086,
+26096,26095,26153,26173,26177,26174,26144,26136,
+26109,26109,26078,26075,25917,25916,25775,26651,
+26694,26694,26750,26750,26756,26752,26727,26727,
+26727,26727,26716,26711,26696,26696,26696,26696,
+26697,26697,26696,26696,26673,26673,26654,26653,
+26668,26668,26710,26710,26751,26770,26824,26824,
+26879,26879,26881,26877,26858,26858,26767,26767,
+26698,26674,26626,26626,26665,26665,26761,26791,
+26845,26845,26921,26921,26991,27020,27100,27100,
+27168,27168,27224,27244,27289,27289,27329,27329,
+27376,27397,27457,27457,27509,27509,27534,27543,
+27561,27561,27585,27585,27612,27622,27645,27645,
+27658,27658,27657,27654,27643,27643,27624,27624,
+27610,27605,27591,27591,27571,27571,27546,27535,
+27506,27506,27467,27467,27432,27417,27378,27378,
+27325,27325,27285,27270,27243,27243,27219,27219,
+27196,27188,27173,27173,27161,27161,27149,27142,
+27120,27120,27087,27087,27060,27050,27025,27025,
+27007,27007,26994,26990,26980,26980,26971,26971,
+26963,26958,26943,26943,26924,26924,26913,26909,
+26901,26901,26892,26892,26890,26892,26901,26901,
+26910,26910,26906,26903,26892,26892,26869,26869,
+26840,26826,26783,26783,26750,26750,26744,26744,
+26747,26747,26751,26751,26750,26750,26752,26752,
+26750,26750,26752,26754,26761,26761,26768,26768,
+26786,26790,26795,26795,26771,26771,26776,26776,
+26777,26777,26782,26782,26790,26794,26803,26803,
+26815,26815,26897,26924,26975,26975,27011,27011,
+27036,27046,27071,27071,27096,27096,27108,27112,
+27118,27118,27119,27119,27115,27113,27108,27108,
+27117,27117,27138,27147,27171,27171,27209,27209,
+27243,27256,27284,27284,27311,27311,27336,27346,
+27374,27374,27399,27399,27412,27416,27423,27423,
+27415,27415,27410,27412,27423,27423,27450,27450,
+27481,27495,27531,27531,27586,27586,27630,27645,
+27675,27675,27693,27693,27692,27690,27678,27678,
+27667,27667,27654,27648,27628,27628,27601,27601,
+27589,27582,27557,27557,27515,27515,27472,27457,
+27418,27418,27369,27369,27325,27305,27265,27265,
+27182,27182,27117,27093,27042,27042,27014,27014,
+26984,25508,25014,24999,24115,24041,23002,22558,
+22359,22253,24222,24063,24498,24797,23704,23855,
+23360,22878,22659,22982,23371,23438,24076,24308,
+24465,24672,24916,24903,24751,24687,24727,24678,
+24466,24411,24321,24304,24404,24424,24356,24355,
+24196,24126,24349,24513,24924,25001,25212,25254,
+25341,25473,26422,26422,26285,26285,26259,26280,
+26450,26450,26460,26460,26449,26447,26446,26446,
+26448,26448,26428,26423,26409,26409,26403,26403,
+26414,26413,26394,26394,26347,26347,26360,26362,
+26357,26357,26423,26423,26466,26478,26491,26491,
+26501,26501,26510,26514,26524,26524,26518,26518,
+26512,26509,26503,26503,26490,26490,26483,26482,
+26483,26483,26486,26486,26491,26491,26486,26486,
+26480,26480,26472,26468,26455,26455,26432,26432,
+26400,26395,26404,26404,26459,26459,26467,26466,
+26446,26446,26407,26407,26411,26416,26423,26423,
+26437,26437,26447,26452,26466,26466,26469,26469,
+26463,26456,26428,26428,26393,26393,26366,26362,
+26372,26372,26362,26362,26395,26411,26451,26451,
+26455,26455,26447,26446,26451,26451,26442,26442,
+26489,26516,26548,26548,26577,26577,26598,26605,
+26618,26618,26636,26636,26657,26661,26662,26662,
+26661,26661,26664,26666,26675,26675,26682,26682,
+26675,26677,26689,26689,26729,26729,26724,26722,
+26719,26719,26744,26744,26776,26785,26795,26795,
+26796,26796,26791,26790,26791,26791,26795,26795,
+26804,26809,26818,26818,26825,26825,26817,26818,
+26827,26827,26790,26790,26785,26779,26757,26757,
+26721,26721,26696,26688,26673,26673,26654,26654,
+26644,26640,26632,26632,26636,26636,26666,26674,
+26687,26687,26739,26739,26771,26780,26792,26792,
+26780,26780,26775,26774,26773,26773,26779,26779,
+26790,26796,26812,26812,26834,26834,26861,26873,
+26902,26902,26914,26914,26921,26923,26927,26927,
+26928,26928,26928,26924,26911,26911,26876,26876,
+26866,26865,26867,26867,26854,26854,26843,26837,
+26813,26813,26786,26786,26766,26757,26740,26740,
+26752,26752,26756,26755,26740,26740,26720,26720,
+26724,26723,26708,26708,26680,26680,26647,26636,
+26616,26616,26646,26646,26653,25759,25931,25931,
+25995,25995,26194,26253,26356,26356,26221,26221,
+26113,26076,26020,26022,26049,26050,25988,25955,
+25910,25910,26626,26626,26635,26645,26677,26677,
+26715,26715,26702,26692,26659,26659,25916,25916,
+25998,26009,25990,25993,26014,26013,26023,26010,
+26004,26005,25961,25962,25812,26647,26644,26644,
+26641,26641,25952,25986,26035,26032,26095,26096,
+26057,26062,26122,26122,26216,26216,26219,26218,
+26212,26212,26243,26243,26194,26169,26091,26091,
+26097,26095,26155,26169,26171,26173,26161,26162,
+26168,26159,26101,26100,25927,25930,25778,26651,
+26694,26694,26750,26750,26756,26752,26727,26727,
+26727,26727,26716,26711,26696,26696,26696,26696,
+26697,26697,26696,26696,26673,26673,26654,26653,
+26668,26668,26710,26710,26751,26770,26824,26824,
+26879,26879,26881,26877,26858,26858,26767,26767,
+26698,26674,26626,26626,26665,26665,26761,26791,
+26845,26845,26921,26921,26991,27020,27100,27100,
+27168,27168,27224,27244,27289,27289,27329,27329,
+27376,27397,27457,27457,27509,27509,27534,27543,
+27561,27561,27585,27585,27612,27622,27645,27645,
+27873,27873,27867,27863,27849,27849,27829,27829,
+27814,27807,27788,27788,27755,27755,27724,27713,
+27680,27680,27632,27632,27588,27569,27523,27523,
+27467,27467,27428,27414,27382,27382,27349,27349,
+27325,27316,27297,27297,27278,27278,27260,27252,
+27229,27229,27200,27200,27173,27161,27132,27132,
+27111,27111,27097,27091,27075,27075,27058,27058,
+27043,27036,27021,27021,27002,27002,26991,26988,
+26982,26982,26976,26976,26980,26984,26998,26998,
+27011,27011,27019,27019,27015,27015,26997,26997,
+26972,26961,26928,26928,26901,26901,26899,26900,
+26908,26908,26918,26918,26924,26926,26933,26933,
+26940,26940,26949,26955,26974,26974,27000,27000,
+27021,27029,27048,27048,27054,27054,27062,27066,
+27076,27076,27082,27082,27088,27091,27106,27106,
+27140,27140,27198,27218,27266,27266,27302,27302,
+27329,27341,27374,27374,27409,27409,27420,27422,
+27421,27421,27411,27411,27394,27387,27370,27370,
+27370,27370,27387,27395,27418,27418,27453,27453,
+27484,27496,27523,27523,27549,27549,27577,27589,
+27618,27618,27645,27645,27655,27658,27660,27660,
+27650,27650,27642,27642,27647,27647,27668,27668,
+27698,27712,27748,27748,27798,27798,27840,27853,
+27880,27880,27892,27892,27895,27894,27888,27888,
+27876,27876,27864,27859,27846,27846,27830,27830,
+27822,27818,27806,27806,27773,27773,27732,27716,
+27675,27675,27622,27622,27571,27549,27491,27491,
+27401,27401,27328,27301,27244,27244,27198,27198,
+27147,27124,25594,25600,25528,25520,25418,25237,
+24664,24584,25590,25591,26991,27016,27001,27001,
+25604,22840,22839,22798,23972,24148,24863,25035,
+24930,25000,25156,25174,24987,24978,25083,25019,
+24984,24841,24514,24463,24451,24444,24498,24512,
+24466,24457,24576,24680,24991,25040,25489,25543,
+25590,25617,26420,26420,26338,26338,26239,26231,
+26291,26291,26370,26370,26376,26375,26363,26363,
+26358,26358,26365,26365,26359,26359,26344,26344,
+26367,26393,26382,26382,26381,26381,26391,26398,
+26421,26421,26451,26451,26472,26480,26494,26494,
+26510,26510,26522,26524,26521,26521,26510,26510,
+26503,26500,26489,26489,26473,26473,26467,26466,
+26469,26469,26473,26473,26476,26476,26471,26471,
+26388,26388,26394,26419,26421,26421,26424,26424,
+26428,26427,26420,26420,26430,26430,26448,26452,
+26455,26455,26419,26419,26429,26432,26437,26437,
+26450,26450,26451,26453,26462,26462,26466,26466,
+26461,26446,26380,26380,26359,26359,26345,26345,
+26357,26357,26369,26369,26389,26395,26405,26405,
+26434,26434,26427,26432,26470,26470,26434,26434,
+26468,26490,26536,26536,26598,26598,26621,26629,
+26644,26644,26652,26652,26656,26657,26660,26660,
+26674,26674,26701,26712,26736,26736,26759,26759,
+26772,26778,26794,26794,26779,26779,26780,26783,
+26794,26794,26816,26816,26819,26822,26827,26827,
+26823,26823,26844,26850,26855,26855,26867,26867,
+26880,26885,26898,26898,26903,26903,26906,26905,
+26897,26897,26893,26893,26882,26878,26864,26864,
+26846,26846,26844,26842,26838,26838,26821,26821,
+26803,26799,26787,26787,26802,26802,26830,26838,
+26857,26857,26888,26888,26905,26906,26892,26892,
+26872,26872,26867,26867,26870,26870,26856,26856,
+26858,26864,26893,26893,26930,26930,26944,26951,
+26974,26974,27004,27004,27018,27022,27027,27027,
+27016,27016,27020,27019,27010,27010,26971,26971,
+26945,26943,26955,26955,26967,26967,26965,26963,
+26960,26960,26938,26938,26924,26913,26871,26871,
+26860,26860,26834,26829,26831,26831,26849,26849,
+26842,26840,26829,26829,26800,26800,26774,26765,
+26745,26745,26749,26749,26744,26740,26725,26725,
+25805,25805,25834,25846,25885,25885,25858,25858,
+25837,25828,25805,25805,25801,25801,25780,25771,
+25752,25752,26761,26761,26777,26784,26801,26801,
+26827,26827,26825,26822,26810,26810,26802,26802,
+26826,26835,26851,26851,25708,25708,25713,25710,
+25703,25703,26925,26925,26909,26904,26894,26894,
+26887,26887,26881,26882,25707,25707,25720,25720,
+25710,25710,25721,25721,25734,25734,25730,25732,
+25741,25741,25810,25810,25808,25803,25785,25785,
+25730,25730,25735,25738,25742,25741,25735,25735,
+25729,25724,26875,26875,26901,26901,26922,26928,
+26943,26943,26957,26957,26958,26954,26933,26933,
+26937,26937,26935,26934,26933,26933,26942,26942,
+26948,26949,26951,26951,26949,26949,26955,26959,
+26976,26976,27015,27015,27060,27077,27118,27118,
+27164,27164,27167,27159,27115,27115,27060,27060,
+27003,26988,26971,26971,26982,26982,27014,27040,
+27135,27135,27234,27234,27308,27336,27400,27400,
+27471,27471,27538,27562,27617,27617,27665,27665,
+27710,27730,27787,27787,27843,27843,27873,27880,
+27888,27888,27891,27891,27891,27890,27882,27882,
+27952,27952,27943,27938,27923,27923,27903,27903,
+27888,27882,27860,27860,27823,27823,27793,27780,
+27746,27746,27694,27694,27647,27628,27580,27580,
+27523,27523,27483,27468,27435,27435,27399,27399,
+27373,27363,27342,27342,27322,27322,27303,27296,
+27273,27273,27244,27244,27216,27206,27175,27175,
+27154,27154,27138,27132,27113,27113,27090,27090,
+27072,27064,27049,27049,27028,27028,27017,27014,
+27008,27008,27005,27005,27010,27015,27030,27030,
+27047,27047,27057,27059,27059,27059,27045,27045,
+27023,27012,26983,26983,26960,26960,26958,26960,
+26967,26967,26980,26980,26988,26992,27003,27003,
+27012,27012,27025,27032,27054,27054,27086,27086,
+27111,27121,27144,27144,27160,27160,27171,27175,
+27188,27188,27194,27194,27200,27205,27222,27222,
+27259,27259,27309,27328,27373,27373,27409,27409,
+27437,27449,27483,27483,27520,27520,27531,27532,
+27530,27530,27518,27518,27498,27490,27469,27469,
+27466,27466,27482,27489,27511,27511,27545,27545,
+27575,27586,27612,27612,27639,27639,27668,27679,
+27710,27710,27738,27738,27749,27752,27752,27752,
+27741,27741,27732,27730,27732,27732,27752,27752,
+27781,27794,27830,27830,27880,27880,27920,27933,
+27960,27960,27973,27973,27978,27977,27973,27973,
+27961,27961,27950,27946,27934,27934,27923,27923,
+27916,27913,27903,27903,27872,27872,27833,27816,
+27775,27775,27719,27719,27665,27642,27582,27582,
+27499,27499,27420,27392,27332,27332,27281,27281,
+27240,27219,27159,27159,27047,27047,27016,27005,
+26973,26973,26935,26935,27050,27070,27049,27049,
+26986,26986,26804,26736,26575,26575,26747,23579,
+25056,25051,25031,25129,25060,25094,25055,25118,
+25149,25153,24848,24816,24752,24679,24733,24735,
+24661,24646,24765,24853,25091,25143,26545,26545,
+26487,26464,26410,26410,26341,26341,26241,26228,
+26266,26266,26342,26342,26353,26354,26345,26345,
+26345,26345,26354,26355,26352,26352,26342,26342,
+26357,26367,26387,26387,26391,26391,26404,26412,
+26436,26436,26458,26458,26474,26480,26495,26495,
+26511,26511,26523,26524,26517,26517,26507,26507,
+26497,26493,26482,26482,26466,26466,26460,26459,
+26461,26461,26466,26466,26466,26465,26458,26458,
+26373,26373,26379,26380,26359,26359,26370,26370,
+26389,26395,26422,26422,26425,26425,26443,26448,
+26454,26454,26412,26412,26422,26424,26433,26433,
+26446,26446,26448,26450,26458,26458,26462,26462,
+26454,26439,26373,26373,26359,26359,26351,26352,
+26362,26362,26371,26371,26386,26391,26396,26396,
+26425,26425,26422,26429,26495,26495,26462,26462,
+26486,26499,26541,26541,26598,26598,26613,26619,
+26635,26635,26643,26643,26644,26644,26647,26647,
+26675,26675,26712,26716,26737,26737,26763,26763,
+26773,26777,26789,26789,26797,26797,26799,26802,
+26814,26814,26835,26835,26839,26840,26842,26842,
+26839,26839,26857,26864,26876,26876,26892,26892,
+26909,26915,26928,26928,26941,26941,26940,26937,
+26927,26927,26927,26927,26922,26918,26907,26907,
+26889,26889,26890,26889,26885,26885,26870,26870,
+26853,26849,26840,26840,26854,26854,26882,26889,
+26910,26910,26936,26936,26950,26949,26932,26932,
+26911,26911,26903,26902,26904,26904,26889,26889,
+26891,26898,26930,26930,26969,26969,26978,26985,
+27007,27007,27041,27041,27054,27058,27062,27062,
+27051,27051,27055,27054,27046,27046,27009,27009,
+26984,26981,26994,26994,27011,27011,27013,27014,
+27017,27017,26997,26997,26982,26971,26932,26932,
+26915,26915,26886,26880,26877,26877,26901,26901,
+26893,26890,26881,26881,26857,26857,26834,26826,
+26813,26813,26809,26809,26799,26796,26785,26785,
+26786,26786,26753,26747,26731,26731,26771,26771,
+26783,26784,26787,26787,26797,26797,26799,26801,
+26805,26805,26814,26814,26832,26839,26856,26856,
+26875,26875,26875,26873,26867,26867,26866,26866,
+26895,26905,26927,26927,26970,26970,27009,27022,
+27045,27045,27026,27026,27005,26999,26991,26991,
+26986,26986,26988,26992,27013,27013,27032,27032,
+27040,27039,27030,27030,27002,27002,26987,26975,
+26930,26930,26905,26905,26906,26907,26912,26912,
+26947,26947,26958,26959,26954,26954,26953,26953,
+26961,26966,26987,26987,27007,27007,27022,27027,
+27033,27033,27037,27037,27036,27032,27016,27016,
+27022,27022,27024,27025,27028,27028,27039,27039,
+27045,27046,27047,27047,27049,27049,27059,27065,
+27084,27084,27122,27122,27164,27179,27216,27216,
+27253,27253,27257,27249,27210,27210,27171,27171,
+27125,27115,27109,27109,27120,27120,27147,27172,
+27269,27269,27372,27372,27446,27472,27534,27534,
+27605,27605,27674,27699,27756,27756,27802,27802,
+27845,27865,27919,27919,27973,27973,28000,28007,
+28011,28011,28006,28006,27997,27991,27970,27970,
+28137,28137,28117,28110,28092,28092,28075,28075,
+28061,28054,28030,28030,27990,27990,27956,27941,
+27903,27903,27843,27843,27792,27772,27722,27722,
+27662,27662,27617,27600,27562,27562,27518,27518,
+27486,27474,27448,27448,27425,27425,27411,27403,
+27382,27382,27356,27356,27329,27318,27288,27288,
+27262,27262,27244,27234,27208,27208,27167,27167,
+27139,27130,27108,27108,27084,27084,27072,27068,
+27064,27064,27066,27066,27079,27085,27101,27101,
+27126,27126,27145,27151,27161,27161,27156,27156,
+27143,27137,27118,27118,27101,27101,27102,27104,
+27112,27112,27127,27127,27142,27149,27169,27169,
+27191,27191,27212,27221,27250,27250,27290,27290,
+27330,27344,27382,27382,27413,27413,27431,27439,
+27456,27456,27464,27464,27475,27482,27506,27506,
+27539,27539,27572,27586,27623,27623,27662,27662,
+27691,27703,27735,27735,27771,27771,27784,27787,
+27786,27786,27768,27768,27744,27734,27710,27710,
+27699,27699,27710,27716,27737,27737,27765,27765,
+27792,27801,27826,27826,27856,27856,27884,27897,
+27929,27929,27963,27963,27978,27982,27981,27981,
+27966,27966,27950,27946,27940,27940,27955,27955,
+27983,27996,28031,28031,28078,28078,28119,28132,
+28160,28160,28181,28181,28190,28192,28191,28191,
+28180,28180,28172,28169,28162,28162,28161,28161,
+28156,28152,28140,28140,28114,28114,28079,28064,
+28021,28021,27960,27960,27897,27872,27808,27808,
+27727,27727,27629,27595,27533,27533,27507,27507,
+27519,27515,27483,27483,27392,27392,27330,27306,
+27247,27247,27206,27206,27168,27154,27125,27125,
+27013,27013,26931,26908,26870,26870,26780,26780,
+26715,26694,26658,26658,26646,26646,26604,26599,
+26616,26616,25344,25283,25119,25041,25088,25092,
+25183,25183,25276,25313,25379,25399,26521,26521,
+26424,26398,26368,26368,26313,26313,26268,26257,
+26251,26251,26252,26252,26273,26281,26295,26295,
+26326,26326,26335,26338,26340,26340,26351,26351,
+26361,26366,26421,26421,26414,26414,26439,26445,
+26452,26452,26466,26466,26477,26482,26495,26495,
+26507,26507,26513,26513,26505,26505,26493,26493,
+26477,26471,26460,26460,26443,26443,26437,26435,
+26435,26435,26438,26438,26429,26424,26409,26409,
+26382,26382,26373,26326,26299,26299,26314,26314,
+26338,26346,26416,26416,26424,26424,26438,26442,
+26446,26446,26369,26369,26364,26370,26406,26406,
+26419,26419,26433,26437,26445,26445,26444,26444,
+26426,26416,26384,26384,26391,26391,26401,26403,
+26403,26403,26380,26380,26383,26386,26413,26413,
+26419,26419,26435,26451,26510,26510,26541,26541,
+26559,26565,26575,26575,26575,26575,26556,26556,
+26573,26573,26587,26587,26590,26590,26589,26589,
+26672,26672,26726,26728,26748,26748,26786,26786,
+26797,26801,26809,26809,26831,26831,26841,26845,
+26858,26858,26870,26870,26879,26880,26875,26875,
+26865,26865,26865,26873,26914,26914,26946,26946,
+26969,26978,27000,27000,27032,27032,27025,27021,
+27006,27006,27006,27006,27007,27007,27006,27006,
+26979,26979,26977,26975,26971,26971,26960,26960,
+26957,26955,26950,26950,26949,26949,26981,26992,
+27015,27015,27031,27031,27044,27045,27036,27036,
+27013,27013,26994,26989,26984,26984,26975,26975,
+26992,27003,27036,27036,27064,27064,27063,27067,
+27085,27085,27120,27120,27133,27137,27142,27142,
+27144,27144,27139,27135,27124,27124,27106,27106,
+27096,27095,27104,27104,27121,27121,27143,27150,
+27162,27162,27140,27140,27119,27112,27098,27098,
+27072,27072,27049,27037,26998,26998,27024,27024,
+27024,27023,27018,27018,27019,27019,27002,27002,
+27019,27019,27006,27006,26984,26973,26943,26943,
+26907,26907,26887,26882,26873,26873,26871,26871,
+26874,26875,26880,26880,26899,26899,26915,26920,
+26928,26928,26931,26931,26966,26977,27003,27003,
+27005,27005,27000,26999,27003,27003,27032,27032,
+27055,27065,27090,27090,27148,27148,27187,27200,
+27223,27223,27227,27227,27226,27226,27227,27227,
+27236,27236,27258,27266,27284,27284,27299,27299,
+27291,27287,27277,27277,27260,27260,27236,27228,
+27212,27212,27201,27201,27207,27212,27226,27226,
+27243,27243,27250,27250,27248,27248,27243,27243,
+27242,27241,27237,27237,27241,27241,27248,27248,
+27242,27242,27233,27233,27228,27228,27229,27229,
+27244,27244,27256,27260,27271,27271,27281,27281,
+27282,27282,27281,27281,27281,27281,27294,27299,
+27322,27322,27359,27359,27386,27396,27417,27417,
+27426,27426,27427,27428,27431,27431,27432,27432,
+27436,27439,27454,27454,27495,27495,27552,27579,
+27652,27652,27747,27747,27819,27845,27904,27904,
+27974,27974,28042,28066,28122,28122,28162,28162,
+28195,28211,28253,28253,28294,28294,28308,28310,
+28305,28305,28283,28283,28251,28234,28184,28184,
+28137,28137,28117,28110,28092,28092,28075,28075,
+28061,28054,28030,28030,27990,27990,27956,27941,
+27903,27903,27843,27843,27792,27772,27722,27722,
+27662,27662,27617,27600,27562,27562,27518,27518,
+27486,27474,27448,27448,27425,27425,27411,27403,
+27382,27382,27356,27356,27329,27318,27288,27288,
+27262,27262,27244,27234,27208,27208,27167,27167,
+27139,27130,27108,27108,27084,27084,27072,27068,
+27064,27064,27066,27066,27079,27085,27101,27101,
+27126,27126,27145,27151,27161,27161,27156,27156,
+27143,27137,27118,27118,27101,27101,27102,27104,
+27112,27112,27127,27127,27142,27149,27169,27169,
+27191,27191,27212,27221,27250,27250,27290,27290,
+27330,27344,27382,27382,27413,27413,27431,27439,
+27456,27456,27464,27464,27475,27482,27506,27506,
+27539,27539,27572,27586,27623,27623,27662,27662,
+27691,27703,27735,27735,27771,27771,27784,27787,
+27786,27786,27768,27768,27744,27734,27710,27710,
+27699,27699,27710,27716,27737,27737,27765,27765,
+27792,27801,27826,27826,27856,27856,27884,27897,
+27929,27929,27963,27963,27978,27982,27981,27981,
+27966,27966,27950,27946,27940,27940,27955,27955,
+27983,27996,28031,28031,28078,28078,28119,28132,
+28160,28160,28181,28181,28190,28192,28191,28191,
+28180,28180,28172,28169,28162,28162,28161,28161,
+28156,28152,28140,28140,28114,28114,28079,28064,
+28021,28021,27960,27960,27897,27872,27808,27808,
+27727,27727,27629,27595,27533,27533,27507,27507,
+27519,27515,27483,27483,27392,27392,27330,27306,
+27247,27247,27206,27206,27168,27154,27125,27125,
+27013,27013,26931,26908,26870,26870,26780,26780,
+26715,26694,26658,26658,26646,26646,26604,26599,
+26616,26616,25414,25329,25156,25044,25116,25145,
+25250,25229,25310,25342,25404,25427,26521,26521,
+26424,26398,26368,26368,26313,26313,26268,26257,
+26251,26251,26252,26252,26273,26281,26295,26295,
+26326,26326,26335,26338,26340,26340,26351,26351,
+26361,26366,26421,26421,26414,26414,26439,26445,
+26452,26452,26466,26466,26477,26482,26495,26495,
+26507,26507,26513,26513,26505,26505,26493,26493,
+26477,26471,26460,26460,26443,26443,26437,26435,
+26435,26435,26438,26438,26429,26424,26409,26409,
+26382,26382,26373,26326,26299,26299,26314,26314,
+26338,26346,26416,26416,26424,26424,26438,26442,
+26446,26446,26369,26369,26364,26370,26406,26406,
+26419,26419,26433,26437,26445,26445,26444,26444,
+26426,26416,26384,26384,26391,26391,26401,26403,
+26403,26403,26380,26380,26383,26386,26413,26413,
+26419,26419,26435,26451,26510,26510,26541,26541,
+26559,26565,26575,26575,26575,26575,26556,26556,
+26573,26573,26587,26587,26590,26590,26589,26589,
+26672,26672,26726,26728,26748,26748,26786,26786,
+26797,26801,26809,26809,26831,26831,26841,26845,
+26858,26858,26870,26870,26879,26880,26875,26875,
+26865,26865,26865,26873,26914,26914,26946,26946,
+26969,26978,27000,27000,27032,27032,27025,27021,
+27006,27006,27006,27006,27007,27007,27006,27006,
+26979,26979,26977,26975,26971,26971,26960,26960,
+26957,26955,26950,26950,26949,26949,26981,26992,
+27015,27015,27031,27031,27044,27045,27036,27036,
+27013,27013,26994,26989,26984,26984,26975,26975,
+26992,27003,27036,27036,27064,27064,27063,27067,
+27085,27085,27120,27120,27133,27137,27142,27142,
+27144,27144,27139,27135,27124,27124,27106,27106,
+27096,27095,27104,27104,27121,27121,27143,27150,
+27162,27162,27140,27140,27119,27112,27098,27098,
+27072,27072,27049,27037,26998,26998,27024,27024,
+27024,27023,27018,27018,27019,27019,27002,27002,
+27019,27019,27006,27006,26984,26973,26943,26943,
+26907,26907,26887,26882,26873,26873,26871,26871,
+26874,26875,26880,26880,26899,26899,26915,26920,
+26928,26928,26931,26931,26966,26977,27003,27003,
+27005,27005,27000,26999,27003,27003,27032,27032,
+27055,27065,27090,27090,27148,27148,27187,27200,
+27223,27223,27227,27227,27226,27226,27227,27227,
+27236,27236,27258,27266,27284,27284,27299,27299,
+27291,27287,27277,27277,27260,27260,27236,27228,
+27212,27212,27201,27201,27207,27212,27226,27226,
+27243,27243,27250,27250,27248,27248,27243,27243,
+27242,27241,27237,27237,27241,27241,27248,27248,
+27242,27242,27233,27233,27228,27228,27229,27229,
+27244,27244,27256,27260,27271,27271,27281,27281,
+27282,27282,27281,27281,27281,27281,27294,27299,
+27322,27322,27359,27359,27386,27396,27417,27417,
+27426,27426,27427,27428,27431,27431,27432,27432,
+27436,27439,27454,27454,27495,27495,27552,27579,
+27652,27652,27747,27747,27819,27845,27904,27904,
+27974,27974,28042,28066,28122,28122,28162,28162,
+28195,28211,28253,28253,28294,28294,28308,28310,
+28305,28305,28283,28283,28251,28234,28184,28184,
+28404,28404,28370,28359,28341,28341,28326,28326,
+28308,28300,28276,28276,28238,28238,28200,28184,
+28143,28143,28085,28085,28029,28008,27958,27958,
+27898,27898,27849,27831,27786,27786,27738,27738,
+27698,27683,27645,27645,27613,27613,27592,27584,
+27557,27557,27526,27526,27499,27487,27458,27458,
+27422,27422,27393,27380,27343,27343,27290,27290,
+27253,27239,27210,27210,27176,27176,27154,27148,
+27136,27136,27142,27142,27159,27167,27189,27189,
+27225,27225,27256,27266,27288,27288,27297,27297,
+27294,27291,27281,27281,27275,27275,27276,27277,
+27281,27281,27299,27299,27322,27333,27363,27363,
+27403,27403,27441,27457,27500,27500,27554,27554,
+27608,27628,27676,27676,27716,27716,27739,27748,
+27769,27769,27789,27789,27803,27810,27828,27828,
+27849,27849,27869,27879,27909,27909,27952,27952,
+27983,27995,28022,28022,28053,28053,28069,28073,
+28073,28073,28056,28056,28033,28024,28003,28003,
+27994,27994,28005,28010,28030,28030,28053,28053,
+28076,28085,28108,28108,28142,28142,28173,28184,
+28215,28215,28251,28251,28271,28275,28271,28271,
+28246,28246,28226,28222,28217,28217,28233,28233,
+28257,28267,28297,28297,28339,28339,28377,28391,
+28425,28425,28460,28460,28473,28476,28478,28478,
+28478,28478,28476,28475,28474,28474,28478,28478,
+28478,28475,28465,28465,28448,28448,28422,28409,
+28371,28371,28320,28320,28259,28234,28168,28168,
+28084,28084,27983,27951,27894,27894,27874,27874,
+27891,27886,27841,27841,27719,27719,27629,27596,
+27523,27523,27454,27454,27402,27386,27358,27358,
+27288,27288,27213,27190,27143,27143,27031,27031,
+26932,26900,26842,26842,26822,26822,26785,26774,
+26760,26760,26713,26713,26683,26672,26632,26632,
+26615,26615,26570,26553,26512,26512,26473,26473,
+26464,26460,26452,26452,26457,26457,26428,26419,
+26396,26396,26379,26379,26351,26348,26360,26360,
+26392,26392,26415,26415,26392,26392,26363,26363,
+26327,26319,26314,26314,26324,26324,26334,26338,
+26344,26344,26354,26354,26364,26368,26380,26380,
+26399,26399,26404,26403,26391,26391,26367,26367,
+26360,26358,26352,26352,26343,26343,26336,26337,
+26348,26348,26418,26418,26418,26418,26418,26418,
+26407,26407,26392,26391,26393,26393,26410,26410,
+26398,26392,26376,26376,26384,26384,26387,26391,
+26405,26405,26407,26407,26408,26405,26393,26393,
+26333,26333,26320,26322,26341,26341,26372,26372,
+26340,26319,26299,26299,26375,26375,26399,26412,
+26455,26455,26491,26491,26496,26494,26478,26478,
+26507,26507,26512,26517,26537,26537,26531,26531,
+26551,26558,26570,26570,26575,26575,26575,26576,
+26582,26582,26606,26606,26620,26634,26668,26668,
+26707,26707,26745,26759,26793,26793,26819,26819,
+26845,26849,26842,26842,26880,26880,26916,26925,
+26943,26943,26955,26955,26945,26941,26930,26930,
+26914,26914,26917,26918,26925,26925,26937,26937,
+26951,26967,27037,27037,27085,27085,27088,27089,
+27086,27086,27094,27094,27091,27089,27081,27081,
+27067,27067,27058,27054,27048,27048,27045,27045,
+27046,27048,27057,27057,27075,27075,27096,27105,
+27125,27125,27133,27133,27140,27140,27136,27136,
+27119,27119,27104,27099,27091,27091,27095,27095,
+27118,27130,27165,27165,27184,27184,27184,27186,
+27195,27195,27214,27214,27215,27214,27210,27210,
+27207,27207,27204,27203,27201,27201,27186,27186,
+27181,27182,27191,27191,27210,27210,27231,27238,
+27254,27254,27253,27253,27242,27237,27222,27222,
+27215,27215,27205,27200,27186,27186,27215,27215,
+27230,27233,27230,27230,27244,27244,27246,27248,
+27257,27257,27241,27241,27219,27211,27185,27185,
+27152,27152,27139,27136,27132,27132,27112,27112,
+27104,27105,27115,27115,27118,27118,27132,27138,
+27156,27156,27179,27179,27191,27196,27211,27211,
+27223,27223,27228,27231,27243,27243,27261,27261,
+27290,27302,27342,27342,27387,27387,27422,27435,
+27466,27466,27464,27464,27465,27466,27474,27474,
+27491,27491,27508,27515,27532,27532,27533,27533,
+27526,27523,27516,27516,27508,27508,27499,27497,
+27495,27495,27503,27503,27515,27521,27537,27537,
+27544,27544,27545,27544,27542,27542,27539,27539,
+27529,27523,27507,27507,27498,27498,27498,27496,
+27482,27482,27463,27463,27455,27454,27457,27457,
+27477,27477,27495,27501,27516,27516,27521,27521,
+27512,27509,27501,27501,27502,27502,27512,27519,
+27544,27544,27580,27580,27611,27623,27649,27649,
+27672,27672,27689,27696,27713,27713,27730,27730,
+27758,27772,27814,27814,27882,27882,27953,27983,
+28063,28063,28164,28164,28242,28270,28338,28338,
+28413,28413,28476,28500,28551,28551,28591,28591,
+28614,28623,28643,28643,28657,28657,28653,28649,
+28631,28631,28594,28594,28550,28530,28469,28469,
+28404,28404,28370,28359,28341,28341,28326,28326,
+28308,28300,28276,28276,28238,28238,28200,28184,
+28143,28143,28085,28085,28029,28008,27958,27958,
+27898,27898,27849,27831,27786,27786,27738,27738,
+27698,27683,27645,27645,27613,27613,27592,27584,
+27557,27557,27526,27526,27499,27487,27458,27458,
+27422,27422,27393,27380,27343,27343,27290,27290,
+27253,27239,27210,27210,27176,27176,27154,27148,
+27136,27136,27142,27142,27159,27167,27189,27189,
+27225,27225,27256,27266,27288,27288,27297,27297,
+27294,27291,27281,27281,27275,27275,27276,27277,
+27281,27281,27299,27299,27322,27333,27363,27363,
+27403,27403,27441,27457,27500,27500,27554,27554,
+27608,27628,27676,27676,27716,27716,27739,27748,
+27769,27769,27789,27789,27803,27810,27828,27828,
+27849,27849,27869,27879,27909,27909,27952,27952,
+27983,27995,28022,28022,28053,28053,28069,28073,
+28073,28073,28056,28056,28033,28024,28003,28003,
+27994,27994,28005,28010,28030,28030,28053,28053,
+28076,28085,28108,28108,28142,28142,28173,28184,
+28215,28215,28251,28251,28271,28275,28271,28271,
+28246,28246,28226,28222,28217,28217,28233,28233,
+28257,28267,28297,28297,28339,28339,28377,28391,
+28425,28425,28460,28460,28473,28476,28478,28478,
+28478,28478,28476,28475,28474,28474,28478,28478,
+28478,28475,28465,28465,28448,28448,28422,28409,
+28371,28371,28320,28320,28259,28234,28168,28168,
+28084,28084,27983,27951,27894,27894,27874,27874,
+27891,27886,27841,27841,27719,27719,27629,27596,
+27523,27523,27454,27454,27402,27386,27358,27358,
+27288,27288,27213,27190,27143,27143,27031,27031,
+26932,26900,26842,26842,26822,26822,26785,26774,
+26760,26760,26713,26713,26683,26672,26632,26632,
+26615,26615,26570,26553,26512,26512,26473,26473,
+26464,26460,26452,26452,26457,26457,26428,26419,
+26396,26396,26379,26379,26351,26348,26360,26360,
+26392,26392,26415,26415,26392,26392,26363,26363,
+26327,26319,26314,26314,26324,26324,26334,26338,
+26344,26344,26354,26354,26364,26368,26380,26380,
+26399,26399,26404,26403,26391,26391,26367,26367,
+26360,26358,26352,26352,26343,26343,26336,26337,
+26348,26348,26418,26418,26418,26418,26418,26418,
+26407,26407,26392,26391,26393,26393,26410,26410,
+26398,26392,26376,26376,26384,26384,26387,26391,
+26405,26405,26407,26407,26408,26405,26393,26393,
+26333,26333,26320,26322,26341,26341,26372,26372,
+26340,26319,26299,26299,26375,26375,26399,26412,
+26455,26455,26491,26491,26496,26494,26478,26478,
+26507,26507,26512,26517,26537,26537,26531,26531,
+26551,26558,26570,26570,26575,26575,26575,26576,
+26582,26582,26606,26606,26620,26634,26668,26668,
+26707,26707,26745,26759,26793,26793,26819,26819,
+26845,26849,26842,26842,26880,26880,26916,26925,
+26943,26943,26955,26955,26945,26941,26930,26930,
+26914,26914,26917,26918,26925,26925,26937,26937,
+26951,26967,27037,27037,27085,27085,27088,27089,
+27086,27086,27094,27094,27091,27089,27081,27081,
+27067,27067,27058,27054,27048,27048,27045,27045,
+27046,27048,27057,27057,27075,27075,27096,27105,
+27125,27125,27133,27133,27140,27140,27136,27136,
+27119,27119,27104,27099,27091,27091,27095,27095,
+27118,27130,27165,27165,27184,27184,27184,27186,
+27195,27195,27214,27214,27215,27214,27210,27210,
+27207,27207,27204,27203,27201,27201,27186,27186,
+27181,27182,27191,27191,27210,27210,27231,27238,
+27254,27254,27253,27253,27242,27237,27222,27222,
+27215,27215,27205,27200,27186,27186,27215,27215,
+27230,27233,27230,27230,27244,27244,27246,27248,
+27257,27257,27241,27241,27219,27211,27185,27185,
+27152,27152,27139,27136,27132,27132,27112,27112,
+27104,27105,27115,27115,27118,27118,27132,27138,
+27156,27156,27179,27179,27191,27196,27211,27211,
+27223,27223,27228,27231,27243,27243,27261,27261,
+27290,27302,27342,27342,27387,27387,27422,27435,
+27466,27466,27464,27464,27465,27466,27474,27474,
+27491,27491,27508,27515,27532,27532,27533,27533,
+27526,27523,27516,27516,27508,27508,27499,27497,
+27495,27495,27503,27503,27515,27521,27537,27537,
+27544,27544,27545,27544,27542,27542,27539,27539,
+27529,27523,27507,27507,27498,27498,27498,27496,
+27482,27482,27463,27463,27455,27454,27457,27457,
+27477,27477,27495,27501,27516,27516,27521,27521,
+27512,27509,27501,27501,27502,27502,27512,27519,
+27544,27544,27580,27580,27611,27623,27649,27649,
+27672,27672,27689,27696,27713,27713,27730,27730,
+27758,27772,27814,27814,27882,27882,27953,27983,
+28063,28063,28164,28164,28242,28270,28338,28338,
+28413,28413,28476,28500,28551,28551,28591,28591,
+28614,28623,28643,28643,28657,28657,28653,28649,
+28631,28631,28594,28594,28550,28530,28469,28469,
+28689,28689,28649,28637,28618,28618,28604,28604,
+28586,28577,28551,28551,28513,28513,28473,28458,
+28417,28417,28360,28360,28304,28283,28234,28234,
+28179,28179,28130,28110,28062,28062,28008,28008,
+27962,27943,27899,27899,27857,27857,27823,27809,
+27774,27774,27735,27735,27705,27692,27660,27660,
+27617,27617,27577,27560,27513,27513,27454,27454,
+27411,27394,27354,27354,27309,27309,27278,27268,
+27250,27250,27252,27252,27270,27281,27312,27312,
+27364,27364,27406,27420,27451,27451,27474,27474,
+27480,27480,27475,27475,27470,27470,27467,27467,
+27469,27469,27486,27486,27512,27525,27562,27562,
+27617,27617,27667,27688,27744,27744,27815,27815,
+27877,27899,27952,27952,27993,27993,28012,28021,
+28042,28042,28063,28063,28078,28083,28093,28093,
+28105,28105,28122,28131,28157,28157,28199,28199,
+28232,28244,28270,28270,28296,28296,28312,28315,
+28317,28317,28303,28303,28284,28277,28263,28263,
+28267,28267,28284,28291,28309,28309,28326,28326,
+28341,28348,28372,28372,28407,28407,28438,28449,
+28475,28475,28507,28507,28529,28532,28525,28525,
+28497,28497,28481,28478,28480,28480,28497,28497,
+28514,28521,28540,28540,28569,28569,28606,28622,
+28662,28662,28701,28701,28718,28723,28730,28730,
+28736,28736,28738,28739,28741,28741,28749,28749,
+28755,28756,28755,28755,28747,28747,28728,28720,
+28698,28698,28669,28669,28626,28606,28551,28551,
+28483,28483,28402,28377,28329,28329,28298,28298,
+28282,28259,28163,28163,27953,27953,27809,27760,
+27666,27666,27605,27605,27591,27587,27578,27578,
+27540,27540,27482,27457,27390,27390,27294,27294,
+27207,27175,27111,27111,27065,27065,27026,27006,
+26944,26944,26880,26880,26826,26806,26764,26764,
+26755,26755,26706,26679,26596,26596,26556,26556,
+26575,26577,26566,26566,26561,26561,26543,26530,
+26486,26486,26446,26446,26429,26429,26440,26440,
+26449,26449,26456,26455,26443,26443,26427,26427,
+26423,26417,26391,26391,26380,26380,26375,26376,
+26382,26382,26388,26388,26401,26412,26454,26454,
+26487,26487,26491,26491,26487,26487,26467,26467,
+26464,26456,26451,26451,26451,26451,26446,26444,
+26443,26443,26458,26458,26475,26481,26498,26498,
+26513,26513,26519,26519,26514,26514,26509,26509,
+26497,26488,26459,26459,26427,26427,26400,26395,
+26392,26392,26391,26391,26427,26467,26476,26476,
+26420,26420,26424,26425,26431,26431,26427,26427,
+26420,26435,26435,26435,26488,26488,26511,26520,
+26539,26539,26559,26559,26575,26581,26592,26592,
+26604,26604,26610,26612,26614,26614,26614,26614,
+26626,26630,26637,26637,26640,26640,26644,26622,
+26616,26616,26652,26652,26680,26692,26720,26720,
+26756,26756,26792,26806,26843,26843,26865,26865,
+26880,26886,26911,26911,26931,26931,26942,26948,
+26966,26966,26984,26984,26992,26994,26995,26995,
+26988,26988,26983,26988,27015,27015,27037,27037,
+27049,27057,27083,27083,27120,27120,27130,27132,
+27139,27139,27152,27152,27156,27155,27150,27150,
+27138,27138,27128,27125,27116,27116,27122,27122,
+27129,27132,27142,27142,27158,27158,27174,27182,
+27202,27202,27217,27217,27218,27217,27213,27213,
+27200,27200,27186,27183,27179,27179,27195,27195,
+27223,27235,27265,27265,27287,27287,27288,27288,
+27288,27288,27284,27284,27271,27266,27254,27254,
+27248,27248,27244,27242,27236,27236,27224,27224,
+27217,27217,27221,27221,27240,27240,27258,27265,
+27281,27281,27288,27288,27290,27290,27288,27288,
+27291,27291,27295,27298,27310,27310,27340,27340,
+27359,27365,27378,27378,27392,27392,27395,27395,
+27392,27392,27385,27385,27370,27363,27344,27344,
+27316,27316,27290,27283,27273,27273,27251,27251,
+27252,27253,27255,27255,27259,27259,27276,27283,
+27302,27302,27313,27313,27323,27327,27340,27340,
+27356,27356,27374,27382,27406,27406,27429,27429,
+27448,27457,27484,27484,27536,27536,27568,27577,
+27591,27591,27603,27603,27612,27616,27628,27628,
+27649,27649,27668,27674,27691,27691,27702,27702,
+27710,27710,27706,27706,27700,27700,27695,27694,
+27696,27696,27709,27709,27723,27728,27743,27743,
+27752,27752,27752,27752,27750,27750,27743,27743,
+27731,27724,27707,27707,27689,27689,27679,27674,
+27652,27652,27628,27628,27617,27615,27615,27615,
+27629,27629,27645,27651,27663,27663,27661,27661,
+27648,27644,27635,27635,27641,27641,27659,27668,
+27697,27697,27741,27741,27777,27792,27828,27828,
+27864,27864,27894,27906,27931,27931,27961,27961,
+28000,28017,28069,28069,28146,28146,28224,28257,
+28343,28343,28452,28452,28540,28574,28654,28654,
+28737,28737,28799,28821,28872,28872,28916,28916,
+28937,28944,28954,28954,28950,28950,28935,28927,
+28901,28901,28864,28864,28822,28803,28751,28751,
+28808,28808,28769,28758,28739,28739,28724,28724,
+28707,28698,28672,28672,28633,28633,28593,28577,
+28537,28537,28480,28480,28424,28404,28356,28356,
+28302,28302,28254,28234,28186,28186,28130,28130,
+28079,28059,28013,28013,27968,27968,27932,27917,
+27879,27879,27836,27836,27802,27790,27757,27757,
+27712,27712,27669,27650,27599,27599,27538,27538,
+27491,27472,27429,27429,27380,27380,27345,27334,
+27313,27313,27315,27315,27335,27345,27381,27381,
+27437,27437,27484,27500,27535,27535,27562,27562,
+27571,27572,27570,27570,27565,27565,27561,27560,
+27559,27559,27576,27576,27602,27616,27654,27654,
+27714,27714,27767,27790,27849,27849,27926,27926,
+27990,28014,28067,28067,28107,28107,28128,28135,
+28155,28155,28174,28174,28188,28193,28202,28202,
+28213,28213,28228,28237,28261,28261,28303,28303,
+28337,28348,28375,28375,28398,28398,28413,28417,
+28419,28419,28407,28407,28389,28383,28374,28374,
+28383,28383,28402,28409,28426,28426,28440,28440,
+28453,28461,28483,28483,28517,28517,28548,28559,
+28584,28584,28614,28614,28634,28637,28632,28632,
+28601,28601,28587,28585,28588,28588,28603,28603,
+28620,28626,28640,28640,28666,28666,28702,28717,
+28760,28760,28800,28800,28819,28825,28832,28832,
+28838,28838,28841,28842,28845,28845,28856,28856,
+28864,28866,28869,28869,28865,28865,28849,28843,
+28827,28827,28805,28805,28771,28754,28703,28703,
+28638,28638,28563,28539,28492,28492,28459,28459,
+28435,28409,28298,28298,28064,28064,27901,27846,
+27739,27739,27682,27682,27686,27686,27685,27685,
+27651,27651,27595,27570,27498,27498,27404,27404,
+27319,27289,27223,27223,27175,27175,27132,27109,
+27035,27035,26965,26965,26908,26888,26847,26847,
+26842,26842,26794,26765,26674,26674,26632,26632,
+26653,26655,26644,26644,26624,26624,26597,26582,
+26525,26525,26485,26485,26469,26467,26474,26474,
+26475,26475,26478,26476,26466,26466,26455,26455,
+26455,26449,26423,26423,26405,26405,26395,26394,
+26399,26399,26404,26404,26423,26437,26488,26488,
+26529,26529,26534,26535,26532,26532,26516,26516,
+26514,26512,26507,26507,26503,26503,26496,26494,
+26491,26491,26505,26505,26524,26530,26547,26547,
+26554,26554,26557,26557,26550,26550,26542,26542,
+26529,26520,26490,26490,26463,26463,26434,26427,
+26421,26421,26415,26415,26438,26445,26459,26459,
+26454,26454,26460,26462,26465,26465,26458,26458,
+26438,26439,26452,26452,26525,26525,26549,26556,
+26571,26571,26587,26587,26603,26609,26626,26626,
+26633,26633,26639,26640,26640,26640,26640,26640,
+26648,26650,26655,26655,26659,26659,26650,26638,
+26636,26636,26674,26674,26700,26712,26742,26742,
+26778,26778,26812,26827,26862,26862,26882,26882,
+26894,26902,26930,26930,26950,26950,26959,26965,
+26982,26982,27002,27002,27012,27016,27024,27024,
+27022,27022,27020,27025,27050,27050,27071,27071,
+27081,27087,27102,27102,27133,27133,27144,27149,
+27158,27158,27172,27172,27177,27177,27174,27174,
+27164,27164,27154,27150,27141,27141,27149,27149,
+27158,27162,27171,27171,27186,27186,27201,27209,
+27227,27227,27242,27242,27243,27243,27239,27239,
+27228,27228,27216,27213,27210,27210,27228,27228,
+27257,27269,27299,27299,27320,27320,27322,27322,
+27318,27318,27307,27307,27291,27285,27270,27270,
+27263,27263,27258,27256,27248,27248,27237,27237,
+27231,27230,27235,27235,27252,27252,27269,27276,
+27291,27291,27299,27299,27303,27304,27307,27307,
+27317,27317,27327,27333,27354,27354,27386,27386,
+27407,27414,27429,27429,27444,27444,27447,27447,
+27442,27442,27437,27437,27422,27416,27399,27399,
+27372,27372,27344,27337,27325,27325,27301,27301,
+27302,27302,27304,27304,27310,27310,27327,27334,
+27353,27353,27363,27363,27375,27380,27392,27392,
+27409,27409,27430,27439,27466,27466,27490,27490,
+27508,27517,27543,27543,27593,27593,27623,27632,
+27644,27644,27659,27659,27670,27674,27687,27687,
+27711,27711,27731,27738,27756,27756,27768,27768,
+27778,27779,27777,27777,27773,27773,27770,27770,
+27773,27773,27787,27787,27801,27807,27821,27821,
+27830,27830,27831,27830,27829,27829,27821,27821,
+27807,27801,27784,27784,27763,27763,27750,27742,
+27718,27718,27692,27692,27680,27677,27675,27675,
+27686,27686,27700,27705,27714,27714,27710,27710,
+27697,27693,27685,27685,27694,27694,27715,27725,
+27758,27758,27805,27805,27844,27860,27899,27899,
+27940,27940,27973,27986,28015,28015,28049,28049,
+28091,28110,28165,28165,28245,28245,28327,28361,
+28451,28451,28564,28564,28656,28691,28775,28775,
+28861,28861,28922,28944,28994,28994,29040,29040,
+29060,29066,29073,29073,29064,29064,29047,29038,
+29010,29010,28974,28974,28934,28917,28867,28867,
+29128,29128,29097,29088,29070,29070,29054,29054,
+29038,29029,29004,29004,28963,28963,28924,28908,
+28867,28867,28810,28810,28759,28740,28693,28693,
+28642,28642,28600,28582,28532,28532,28466,28466,
+28410,28387,28337,28337,28288,28288,28250,28233,
+28186,28186,28132,28132,28093,28078,28041,28041,
+27992,27992,27943,27922,27863,27863,27794,27794,
+27738,27716,27664,27664,27602,27602,27560,27547,
+27523,27523,27523,27523,27545,27557,27599,27599,
+27669,27669,27727,27748,27794,27794,27830,27830,
+27844,27847,27849,27849,27846,27846,27837,27834,
+27828,27828,27840,27840,27866,27879,27921,27921,
+27986,27986,28046,28071,28135,28135,28224,28224,
+28296,28321,28374,28374,28411,28411,28432,28439,
+28454,28454,28465,28465,28474,28478,28488,28488,
+28500,28500,28513,28520,28543,28543,28581,28581,
+28614,28626,28652,28652,28672,28672,28680,28683,
+28687,28687,28677,28677,28668,28667,28672,28672,
+28695,28695,28717,28725,28741,28741,28749,28749,
+28756,28760,28778,28778,28808,28808,28839,28849,
+28874,28874,28896,28896,28913,28915,28911,28911,
+28882,28882,28868,28865,28865,28865,28878,28878,
+28894,28899,28908,28908,28920,28920,28958,28974,
+29019,29019,29061,29061,29082,29087,29093,29093,
+29096,29096,29100,29103,29111,29111,29127,29127,
+29139,29144,29157,29157,29163,29163,29156,29154,
+29147,29147,29148,29148,29134,29124,29085,29085,
+29024,29024,28959,28936,28886,28886,28849,28849,
+28820,28788,28658,28658,28389,28389,28184,28113,
+27966,27966,27919,27919,27971,27986,28006,28006,
+27961,27961,27903,27876,27796,27796,27695,27695,
+27614,27585,27522,27522,27484,27484,27431,27401,
+27303,27303,27222,27222,27180,27167,27143,27143,
+27150,27150,27107,27081,26990,26990,26932,26932,
+26940,26935,26904,26904,26835,26835,26766,26733,
+26639,26639,26601,26601,26581,26575,26566,26566,
+26548,26548,26548,26547,26539,26539,26531,26531,
+26520,26516,26505,26505,26482,26482,26456,26451,
+26453,26453,26447,26447,26497,26521,26591,26591,
+26651,26651,26669,26672,26669,26669,26667,26667,
+26665,26664,26662,26662,26647,26647,26635,26632,
+26632,26632,26649,26649,26661,26663,26663,26663,
+26646,26646,26629,26624,26608,26608,26601,26601,
+26593,26588,26567,26567,26548,26548,26534,26530,
+26522,26522,26498,26498,26507,26510,26520,26520,
+26527,26527,26532,26534,26537,26537,26520,26520,
+26504,26502,26506,26506,26604,26604,26626,26632,
+26649,26649,26657,26657,26664,26667,26677,26677,
+26687,26687,26691,26693,26698,26698,26693,26693,
+26684,26681,26675,26675,26684,26684,26667,26666,
+26678,26678,26694,26694,26715,26727,26769,26769,
+26817,26817,26856,26870,26896,26896,26916,26916,
+26938,26947,26967,26967,26997,26997,27016,27025,
+27046,27046,27068,27068,27075,27083,27111,27111,
+27129,27129,27142,27144,27140,27140,27144,27144,
+27146,27147,27153,27153,27168,27168,27179,27185,
+27198,27198,27213,27213,27222,27225,27230,27230,
+27221,27221,27217,27215,27204,27204,27214,27214,
+27224,27227,27235,27235,27246,27246,27259,27266,
+27282,27282,27291,27291,27295,27296,27298,27298,
+27291,27291,27280,27278,27275,27275,27298,27298,
+27326,27338,27366,27366,27388,27388,27393,27393,
+27383,27383,27362,27362,27339,27330,27307,27307,
+27291,27291,27281,27277,27270,27270,27261,27261,
+27260,27260,27265,27265,27283,27283,27297,27300,
+27310,27310,27318,27318,27326,27331,27343,27343,
+27370,27370,27401,27415,27454,27454,27496,27496,
+27522,27531,27546,27546,27556,27556,27562,27562,
+27556,27556,27553,27553,27537,27530,27515,27515,
+27493,27493,27471,27464,27447,27447,27418,27418,
+27410,27409,27415,27415,27424,27424,27439,27446,
+27465,27465,27482,27482,27503,27510,27529,27529,
+27548,27548,27566,27574,27599,27599,27628,27628,
+27656,27667,27696,27696,27734,27734,27758,27766,
+27781,27781,27801,27801,27817,27823,27836,27836,
+27861,27861,27890,27900,27920,27920,27933,27933,
+27942,27945,27948,27948,27950,27950,27951,27952,
+27958,27958,27974,27974,27990,27996,28010,28010,
+28018,28018,28019,28019,28018,28018,28007,28007,
+27995,27990,27973,27973,27947,27947,27921,27910,
+27882,27882,27857,27857,27841,27837,27827,27827,
+27823,27823,27827,27827,27825,27825,27817,27817,
+27808,27805,27801,27801,27822,27822,27854,27869,
+27912,27912,27971,27971,28017,28035,28079,28079,
+28131,28131,28170,28184,28217,28217,28264,28264,
+28314,28337,28395,28395,28482,28482,28573,28611,
+28714,28714,28842,28842,28944,28983,29072,29072,
+29162,29162,29221,29243,29291,29291,29336,29336,
+29356,29361,29364,29364,29348,29348,29327,29318,
+29297,29297,29263,29263,29229,29215,29174,29174,
+29128,29128,29097,29088,29070,29070,29054,29054,
+29038,29029,29004,29004,28963,28963,28924,28908,
+28867,28867,28810,28810,28759,28740,28693,28693,
+28642,28642,28600,28582,28532,28532,28466,28466,
+28410,28387,28337,28337,28288,28288,28250,28233,
+28186,28186,28132,28132,28093,28078,28041,28041,
+27992,27992,27943,27922,27863,27863,27794,27794,
+27738,27716,27664,27664,27602,27602,27560,27547,
+27523,27523,27523,27523,27545,27557,27599,27599,
+27669,27669,27727,27748,27794,27794,27830,27830,
+27844,27847,27849,27849,27846,27846,27837,27834,
+27828,27828,27840,27840,27866,27879,27921,27921,
+27986,27986,28046,28071,28135,28135,28224,28224,
+28296,28321,28374,28374,28411,28411,28432,28439,
+28454,28454,28465,28465,28474,28478,28488,28488,
+28500,28500,28513,28520,28543,28543,28581,28581,
+28614,28626,28652,28652,28672,28672,28680,28683,
+28687,28687,28677,28677,28668,28667,28672,28672,
+28695,28695,28717,28725,28741,28741,28749,28749,
+28756,28760,28778,28778,28808,28808,28839,28849,
+28874,28874,28896,28896,28913,28915,28911,28911,
+28882,28882,28868,28865,28865,28865,28878,28878,
+28894,28899,28908,28908,28920,28920,28958,28974,
+29019,29019,29061,29061,29082,29087,29093,29093,
+29096,29096,29100,29103,29111,29111,29127,29127,
+29139,29144,29157,29157,29163,29163,29156,29154,
+29147,29147,29148,29148,29134,29124,29085,29085,
+29024,29024,28959,28936,28886,28886,28849,28849,
+28820,28788,28658,28658,28389,28389,28184,28113,
+27966,27966,27919,27919,27971,27986,28006,28006,
+27961,27961,27903,27876,27796,27796,27695,27695,
+27614,27585,27522,27522,27484,27484,27431,27401,
+27303,27303,27222,27222,27180,27167,27143,27143,
+27150,27150,27107,27081,26990,26990,26932,26932,
+26940,26935,26904,26904,26835,26835,26766,26733,
+26639,26639,26601,26601,26581,26575,26566,26566,
+26548,26548,26548,26547,26539,26539,26531,26531,
+26520,26516,26505,26505,26482,26482,26456,26451,
+26453,26453,26447,26447,26497,26521,26591,26591,
+26651,26651,26669,26672,26669,26669,26667,26667,
+26665,26664,26662,26662,26647,26647,26635,26632,
+26632,26632,26649,26649,26661,26663,26663,26663,
+26646,26646,26629,26624,26608,26608,26601,26601,
+26593,26588,26567,26567,26548,26548,26534,26530,
+26522,26522,26498,26498,26507,26510,26520,26520,
+26527,26527,26532,26534,26537,26537,26520,26520,
+26504,26502,26506,26506,26604,26604,26626,26632,
+26649,26649,26657,26657,26664,26667,26677,26677,
+26687,26687,26691,26693,26698,26698,26693,26693,
+26684,26681,26675,26675,26684,26684,26667,26666,
+26678,26678,26694,26694,26715,26727,26769,26769,
+26817,26817,26856,26870,26896,26896,26916,26916,
+26938,26947,26967,26967,26997,26997,27016,27025,
+27046,27046,27068,27068,27075,27083,27111,27111,
+27129,27129,27142,27144,27140,27140,27144,27144,
+27146,27147,27153,27153,27168,27168,27179,27185,
+27198,27198,27213,27213,27222,27225,27230,27230,
+27221,27221,27217,27215,27204,27204,27214,27214,
+27224,27227,27235,27235,27246,27246,27259,27266,
+27282,27282,27291,27291,27295,27296,27298,27298,
+27291,27291,27280,27278,27275,27275,27298,27298,
+27326,27338,27366,27366,27388,27388,27393,27393,
+27383,27383,27362,27362,27339,27330,27307,27307,
+27291,27291,27281,27277,27270,27270,27261,27261,
+27260,27260,27265,27265,27283,27283,27297,27300,
+27310,27310,27318,27318,27326,27331,27343,27343,
+27370,27370,27401,27415,27454,27454,27496,27496,
+27522,27531,27546,27546,27556,27556,27562,27562,
+27556,27556,27553,27553,27537,27530,27515,27515,
+27493,27493,27471,27464,27447,27447,27418,27418,
+27410,27409,27415,27415,27424,27424,27439,27446,
+27465,27465,27482,27482,27503,27510,27529,27529,
+27548,27548,27566,27574,27599,27599,27628,27628,
+27656,27667,27696,27696,27734,27734,27758,27766,
+27781,27781,27801,27801,27817,27823,27836,27836,
+27861,27861,27890,27900,27920,27920,27933,27933,
+27942,27945,27948,27948,27950,27950,27951,27952,
+27958,27958,27974,27974,27990,27996,28010,28010,
+28018,28018,28019,28019,28018,28018,28007,28007,
+27995,27990,27973,27973,27947,27947,27921,27910,
+27882,27882,27857,27857,27841,27837,27827,27827,
+27823,27823,27827,27827,27825,27825,27817,27817,
+27808,27805,27801,27801,27822,27822,27854,27869,
+27912,27912,27971,27971,28017,28035,28079,28079,
+28131,28131,28170,28184,28217,28217,28264,28264,
+28314,28337,28395,28395,28482,28482,28573,28611,
+28714,28714,28842,28842,28944,28983,29072,29072,
+29162,29162,29221,29243,29291,29291,29336,29336,
+29356,29361,29364,29364,29348,29348,29327,29318,
+29297,29297,29263,29263,29229,29215,29174,29174,
+29498,29498,29485,29481,29474,29474,29460,29460,
+29443,29435,29414,29414,29372,29372,29334,29318,
+29276,29276,29221,29221,29175,29158,29112,29112,
+29064,29064,29027,29009,28963,28963,28898,28898,
+28843,28822,28771,28771,28725,28725,28693,28678,
+28634,28634,28575,28575,28530,28511,28466,28466,
+28411,28411,28363,28341,28284,28284,28207,28207,
+28140,28114,28049,28049,27977,27977,27929,27915,
+27891,27891,27893,27893,27917,27930,27976,27976,
+28050,28050,28117,28141,28194,28194,28235,28235,
+28251,28255,28258,28258,28255,28255,28243,28239,
+28230,28230,28235,28235,28254,28263,28298,28298,
+28357,28357,28415,28439,28503,28503,28591,28591,
+28667,28694,28753,28753,28799,28799,28823,28831,
+28841,28841,28839,28839,28837,28839,28850,28850,
+28870,28870,28886,28894,28913,28913,28945,28945,
+28975,28986,29010,29010,29025,29025,29031,29032,
+29032,29032,29029,29029,29031,29034,29049,29049,
+29068,29068,29089,29095,29113,29113,29118,29118,
+29124,29128,29140,29140,29161,29161,29185,29195,
+29218,29218,29239,29239,29248,29249,29246,29246,
+29224,29224,29203,29197,29184,29184,29188,29188,
+29206,29213,29228,29228,29251,29251,29290,29306,
+29349,29349,29382,29382,29395,29397,29395,29395,
+29394,29394,29395,29401,29434,29434,29450,29450,
+29441,29442,29459,29459,29509,29509,29506,29496,
+29449,29449,29464,29464,29520,29529,29518,29518,
+29439,29439,29378,29353,29293,29293,29269,29269,
+29266,29246,29146,29146,28917,28917,28698,28615,
+28419,28419,28389,28389,28516,28551,28599,28599,
+28537,28537,28465,28434,28351,28351,28214,28214,
+28077,28036,27965,27965,27954,27954,27868,27822,
+27678,27678,27567,27567,27532,27522,27511,27511,
+27495,27495,27455,27433,27365,27365,27290,27290,
+27244,27226,27182,27182,27131,27131,27086,27067,
+27018,27018,26950,26950,26882,26861,26822,26822,
+26837,26837,26825,26818,26795,26795,26761,26761,
+26724,26709,26671,26671,26629,26629,26619,26612,
+26591,26591,26604,26604,26638,26650,26674,26674,
+26753,26753,26790,26805,26849,26849,26872,26872,
+26878,26879,26877,26877,26871,26871,26865,26865,
+26871,26871,26886,26886,26892,26891,26880,26880,
+26844,26844,26808,26796,26769,26769,26749,26749,
+26744,26743,26742,26742,26716,26716,26676,26667,
+26657,26657,26645,26645,26633,26628,26609,26609,
+26595,26595,26590,26584,26589,26589,26593,26593,
+26599,26600,26603,26603,26637,26637,26668,26676,
+26683,26683,26685,26685,26700,26693,26673,26673,
+26767,26767,26696,26689,26674,26674,26650,26650,
+26631,26628,26636,26636,26664,26664,26647,26653,
+26702,26702,26781,26781,26816,26830,26865,26865,
+26913,26913,26954,26967,26994,26994,27011,27011,
+27033,27044,27077,27077,27116,27116,27145,27158,
+27187,27187,27216,27216,27236,27239,27237,27237,
+27238,27238,27224,27218,27203,27203,27190,27190,
+27185,27185,27185,27185,27193,27193,27204,27209,
+27220,27220,27239,27239,27257,27261,27269,27269,
+27269,27269,27267,27268,27274,27274,27292,27292,
+27301,27304,27310,27310,27318,27318,27331,27336,
+27346,27346,27353,27353,27359,27360,27360,27360,
+27354,27354,27351,27351,27357,27357,27373,27373,
+27396,27405,27425,27425,27439,27439,27442,27441,
+27433,27433,27414,27414,27391,27382,27353,27353,
+27320,27320,27299,27294,27289,27289,27293,27293,
+27300,27303,27313,27313,27329,27329,27344,27349,
+27358,27358,27362,27362,27366,27370,27382,27382,
+27420,27420,27467,27487,27538,27538,27592,27592,
+27625,27635,27654,27654,27660,27660,27661,27661,
+27660,27660,27648,27648,27631,27624,27607,27607,
+27589,27589,27583,27579,27566,27566,27541,27541,
+27534,27533,27534,27534,27547,27547,27561,27568,
+27589,27589,27618,27618,27642,27652,27674,27674,
+27693,27693,27716,27727,27756,27756,27786,27786,
+27817,27831,27867,27867,27902,27902,27923,27929,
+27947,27947,27970,27970,27989,27997,28017,28017,
+28050,28050,28083,28094,28120,28120,28139,28139,
+28148,28151,28156,28156,28164,28164,28167,28169,
+28175,28175,28193,28193,28211,28217,28233,28233,
+28244,28244,28250,28252,28253,28253,28238,28238,
+28223,28217,28202,28202,28171,28171,28137,28125,
+28093,28093,28061,28061,28041,28033,28015,28015,
+27995,27995,27983,27978,27967,27967,27964,27964,
+27968,27972,27984,27984,28017,28017,28062,28083,
+28135,28135,28202,28202,28258,28280,28332,28332,
+28386,28386,28424,28438,28470,28470,28524,28524,
+28579,28602,28665,28665,28762,28762,28863,28906,
+29020,29020,29164,29164,29274,29314,29405,29405,
+29493,29493,29550,29571,29613,29613,29650,29650,
+29666,29668,29666,29666,29639,29639,29616,29607,
+29586,29586,29569,29569,29555,29549,29526,29526,
+29498,29498,29485,29481,29474,29474,29460,29460,
+29443,29435,29414,29414,29372,29372,29334,29318,
+29276,29276,29221,29221,29175,29158,29112,29112,
+29064,29064,29027,29009,28963,28963,28898,28898,
+28843,28822,28771,28771,28725,28725,28693,28678,
+28634,28634,28575,28575,28530,28511,28466,28466,
+28411,28411,28363,28341,28284,28284,28207,28207,
+28140,28114,28049,28049,27977,27977,27929,27915,
+27891,27891,27893,27893,27917,27930,27976,27976,
+28050,28050,28117,28141,28194,28194,28235,28235,
+28251,28255,28258,28258,28255,28255,28243,28239,
+28230,28230,28235,28235,28254,28263,28298,28298,
+28357,28357,28415,28439,28503,28503,28591,28591,
+28667,28694,28753,28753,28799,28799,28823,28831,
+28841,28841,28839,28839,28837,28839,28850,28850,
+28870,28870,28886,28894,28913,28913,28945,28945,
+28975,28986,29010,29010,29025,29025,29031,29032,
+29032,29032,29029,29029,29031,29034,29049,29049,
+29068,29068,29089,29095,29113,29113,29118,29118,
+29124,29128,29140,29140,29161,29161,29185,29195,
+29218,29218,29239,29239,29248,29249,29246,29246,
+29224,29224,29203,29197,29184,29184,29188,29188,
+29206,29213,29228,29228,29251,29251,29290,29306,
+29349,29349,29382,29382,29395,29397,29395,29395,
+29394,29394,29395,29401,29434,29434,29450,29450,
+29441,29442,29459,29459,29509,29509,29506,29496,
+29449,29449,29464,29464,29520,29529,29518,29518,
+29439,29439,29378,29353,29293,29293,29269,29269,
+29266,29246,29146,29146,28917,28917,28698,28615,
+28419,28419,28389,28389,28516,28551,28599,28599,
+28537,28537,28465,28434,28351,28351,28214,28214,
+28077,28036,27965,27965,27954,27954,27868,27822,
+27678,27678,27567,27567,27532,27522,27511,27511,
+27495,27495,27455,27433,27365,27365,27290,27290,
+27244,27226,27182,27182,27131,27131,27086,27067,
+27018,27018,26950,26950,26882,26861,26822,26822,
+26837,26837,26825,26818,26795,26795,26761,26761,
+26724,26709,26671,26671,26629,26629,26619,26612,
+26591,26591,26604,26604,26638,26650,26674,26674,
+26753,26753,26790,26805,26849,26849,26872,26872,
+26878,26879,26877,26877,26871,26871,26865,26865,
+26871,26871,26886,26886,26892,26891,26880,26880,
+26844,26844,26808,26796,26769,26769,26749,26749,
+26744,26743,26742,26742,26716,26716,26676,26667,
+26657,26657,26645,26645,26633,26628,26609,26609,
+26595,26595,26590,26584,26589,26589,26593,26593,
+26599,26600,26603,26603,26637,26637,26668,26676,
+26683,26683,26685,26685,26700,26693,26673,26673,
+26767,26767,26696,26689,26674,26674,26650,26650,
+26631,26628,26636,26636,26664,26664,26647,26653,
+26702,26702,26781,26781,26816,26830,26865,26865,
+26913,26913,26954,26967,26994,26994,27011,27011,
+27033,27044,27077,27077,27116,27116,27145,27158,
+27187,27187,27216,27216,27236,27239,27237,27237,
+27238,27238,27224,27218,27203,27203,27190,27190,
+27185,27185,27185,27185,27193,27193,27204,27209,
+27220,27220,27239,27239,27257,27261,27269,27269,
+27269,27269,27267,27268,27274,27274,27292,27292,
+27301,27304,27310,27310,27318,27318,27331,27336,
+27346,27346,27353,27353,27359,27360,27360,27360,
+27354,27354,27351,27351,27357,27357,27373,27373,
+27396,27405,27425,27425,27439,27439,27442,27441,
+27433,27433,27414,27414,27391,27382,27353,27353,
+27320,27320,27299,27294,27289,27289,27293,27293,
+27300,27303,27313,27313,27329,27329,27344,27349,
+27358,27358,27362,27362,27366,27370,27382,27382,
+27420,27420,27467,27487,27538,27538,27592,27592,
+27625,27635,27654,27654,27660,27660,27661,27661,
+27660,27660,27648,27648,27631,27624,27607,27607,
+27589,27589,27583,27579,27566,27566,27541,27541,
+27534,27533,27534,27534,27547,27547,27561,27568,
+27589,27589,27618,27618,27642,27652,27674,27674,
+27693,27693,27716,27727,27756,27756,27786,27786,
+27817,27831,27867,27867,27902,27902,27923,27929,
+27947,27947,27970,27970,27989,27997,28017,28017,
+28050,28050,28083,28094,28120,28120,28139,28139,
+28148,28151,28156,28156,28164,28164,28167,28169,
+28175,28175,28193,28193,28211,28217,28233,28233,
+28244,28244,28250,28252,28253,28253,28238,28238,
+28223,28217,28202,28202,28171,28171,28137,28125,
+28093,28093,28061,28061,28041,28033,28015,28015,
+27995,27995,27983,27978,27967,27967,27964,27964,
+27968,27972,27984,27984,28017,28017,28062,28083,
+28135,28135,28202,28202,28258,28280,28332,28332,
+28386,28386,28424,28438,28470,28470,28524,28524,
+28579,28602,28665,28665,28762,28762,28863,28906,
+29020,29020,29164,29164,29274,29314,29405,29405,
+29493,29493,29550,29571,29613,29613,29650,29650,
+29666,29668,29666,29666,29639,29639,29616,29607,
+29586,29586,29569,29569,29555,29549,29526,29526,
+29776,29776,29774,29774,29775,29775,29770,29770,
+29758,29752,29730,29730,29690,29690,29651,29634,
+29593,29593,29540,29540,29495,29477,29434,29434,
+29393,29393,29359,29343,29299,29299,29244,29244,
+29197,29178,29133,29133,29090,29090,29061,29049,
+29014,29014,28962,28962,28917,28898,28849,28849,
+28794,28794,28748,28727,28672,28672,28592,28592,
+28524,28498,28430,28430,28355,28355,28306,28291,
+28265,28265,28261,28261,28283,28297,28345,28345,
+28424,28424,28489,28512,28562,28562,28602,28602,
+28617,28620,28618,28618,28607,28607,28595,28591,
+28583,28583,28585,28585,28597,28604,28631,28631,
+28683,28683,28737,28758,28816,28816,28901,28901,
+28980,29009,29081,29081,29138,29138,29165,29172,
+29179,29179,29166,29166,29155,29155,29162,29162,
+29181,29181,29196,29203,29218,29218,29244,29244,
+29270,29280,29302,29302,29320,29320,29324,29325,
+29324,29324,29326,29326,29336,29340,29348,29348,
+29352,29352,29363,29368,29382,29382,29389,29389,
+29396,29400,29413,29413,29426,29426,29442,29450,
+29471,29471,29490,29490,29496,29497,29496,29496,
+29479,29479,29458,29450,29434,29434,29430,29430,
+29444,29452,29479,29479,29521,29521,29560,29576,
+29610,29610,29631,29631,29629,29627,29619,29619,
+29613,29613,29616,29624,29659,29659,29672,29672,
+29656,29657,29677,29677,29749,29749,29758,29753,
+29715,29715,29735,29735,29795,29805,29802,29802,
+29745,29745,29701,29683,29640,29640,29644,29644,
+29663,29652,29579,29579,29394,29394,29189,29107,
+28902,28902,28861,28861,28977,29009,29057,29057,
+29010,29010,28941,28908,28809,28809,28649,28649,
+28494,28445,28351,28351,28316,28316,28219,28171,
+28022,28022,27895,27895,27843,27826,27794,27794,
+27747,27747,27699,27675,27608,27608,27520,27520,
+27452,27428,27378,27378,27333,27333,27299,27285,
+27250,27250,27186,27186,27112,27087,27036,27036,
+27030,27030,26999,26983,26936,26936,26880,26880,
+26840,26825,26791,26791,26757,26757,26744,26740,
+26730,26730,26749,26749,26791,26806,26839,26839,
+26913,26913,26972,26993,27033,27033,27056,27056,
+27058,27057,27053,27053,27045,27045,27039,27038,
+27041,27041,27047,27047,27043,27039,27019,27019,
+26975,26975,26935,26921,26887,26887,26860,26860,
+26858,26860,26871,26871,26858,26858,26838,26828,
+26803,26803,26783,26783,26764,26756,26732,26732,
+26719,26719,26720,26721,26723,26723,26728,26728,
+26730,26730,26723,26723,26737,26737,26750,26754,
+26757,26757,26757,26757,26773,26778,26791,26791,
+26804,26804,26793,26787,26770,26770,26740,26740,
+26727,26725,26729,26729,26753,26753,26775,26784,
+26809,26809,26850,26850,26881,26891,26920,26920,
+26965,26965,27006,27018,27046,27046,27061,27061,
+27085,27098,27141,27141,27195,27195,27231,27245,
+27276,27276,27302,27302,27310,27311,27310,27310,
+27304,27304,27288,27280,27257,27257,27235,27235,
+27225,27222,27218,27218,27218,27218,27226,27230,
+27246,27246,27269,27269,27292,27299,27309,27309,
+27313,27313,27318,27322,27335,27335,27354,27354,
+27363,27366,27372,27372,27380,27380,27391,27395,
+27407,27407,27415,27415,27419,27420,27420,27420,
+27416,27416,27416,27417,27423,27423,27438,27438,
+27455,27461,27473,27473,27478,27478,27475,27472,
+27460,27460,27438,27438,27419,27409,27382,27382,
+27347,27347,27326,27320,27316,27316,27324,27324,
+27334,27338,27348,27348,27365,27365,27379,27382,
+27393,27393,27400,27400,27405,27409,27424,27424,
+27468,27468,27527,27549,27608,27608,27667,27667,
+27703,27715,27736,27736,27745,27745,27743,27742,
+27742,27742,27736,27736,27721,27715,27695,27695,
+27674,27674,27674,27673,27665,27665,27644,27644,
+27641,27640,27639,27639,27646,27646,27661,27669,
+27693,27693,27731,27731,27759,27769,27793,27793,
+27812,27812,27836,27846,27877,27877,27908,27908,
+27941,27955,27993,27993,28028,28028,28049,28058,
+28078,28078,28103,28103,28125,28134,28161,28161,
+28205,28205,28241,28254,28281,28281,28307,28307,
+28322,28326,28332,28332,28341,28341,28348,28351,
+28358,28358,28377,28377,28395,28402,28419,28419,
+28435,28435,28448,28450,28451,28451,28437,28437,
+28422,28415,28395,28395,28364,28364,28333,28319,
+28285,28285,28244,28244,28218,28209,28186,28186,
+28155,28155,28136,28132,28122,28122,28126,28126,
+28146,28156,28185,28185,28233,28233,28287,28309,
+28369,28369,28438,28438,28498,28520,28573,28573,
+28625,28625,28660,28674,28705,28705,28756,28756,
+28810,28835,28901,28901,29007,29007,29109,29152,
+29267,29267,29412,29412,29523,29564,29656,29656,
+29740,29740,29791,29808,29846,29846,29877,29877,
+29887,29887,29879,29879,29848,29848,29825,29817,
+29801,29801,29793,29793,29794,29793,29789,29789,
+29883,29883,29884,29885,29889,29889,29888,29888,
+29879,29873,29851,29851,29812,29812,29773,29757,
+29716,29716,29663,29663,29618,29600,29559,29559,
+29521,29521,29489,29473,29431,29431,29379,29379,
+29335,29317,29275,29275,29233,29233,29206,29194,
+29163,29163,29115,29115,29070,29051,29005,29005,
+28949,28949,28904,28884,28830,28830,28750,28750,
+28682,28655,28589,28589,28513,28513,28466,28450,
+28424,28424,28418,28418,28439,28453,28502,28502,
+28581,28581,28644,28666,28715,28715,28754,28754,
+28766,28768,28762,28762,28749,28749,28735,28731,
+28721,28721,28722,28722,28733,28740,28764,28764,
+28817,28817,28871,28893,28950,28950,29033,29033,
+29112,29142,29216,29216,29276,29276,29303,29309,
+29315,29315,29298,29298,29284,29281,29285,29285,
+29302,29302,29316,29322,29336,29336,29360,29360,
+29384,29394,29417,29417,29434,29434,29438,29438,
+29437,29437,29442,29442,29452,29456,29463,29463,
+29462,29462,29467,29471,29484,29484,29492,29492,
+29499,29502,29514,29514,29525,29525,29538,29545,
+29565,29565,29583,29583,29589,29590,29589,29589,
+29574,29574,29553,29547,29533,29533,29526,29526,
+29536,29544,29575,29575,29626,29626,29666,29680,
+29711,29711,29724,29724,29716,29712,29702,29702,
+29697,29697,29703,29711,29745,29745,29756,29756,
+29739,29741,29764,29764,29843,29843,29862,29860,
+29832,29832,29853,29853,29905,29914,29910,29910,
+29859,29859,29824,29809,29777,29777,29790,29790,
+29816,29809,29749,29749,29585,29585,29388,29307,
+29102,29102,29049,29049,29147,29175,29218,29218,
+29183,29183,29119,29085,28980,28980,28813,28813,
+28657,28605,28503,28503,28452,28452,28355,28308,
+28170,28170,28044,28044,27977,27954,27906,27906,
+27846,27846,27793,27767,27697,27697,27602,27602,
+27528,27503,27448,27448,27404,27404,27372,27358,
+27327,27327,27267,27267,27193,27168,27115,27115,
+27097,27097,27057,27039,26985,26985,26922,26922,
+26878,26863,26830,26830,26802,26802,26793,26790,
+26786,26786,26807,26807,26850,26867,26907,26907,
+26979,26979,27044,27064,27104,27104,27128,27128,
+27128,27127,27122,27122,27113,27113,27106,27105,
+27105,27105,27108,27108,27101,27095,27074,27074,
+27028,27028,26987,26972,26938,26938,26910,26910,
+26908,26910,26921,26921,26911,26911,26893,26883,
+26856,26856,26834,26834,26814,26806,26784,26784,
+26771,26771,26773,26774,26775,26775,26779,26779,
+26781,26780,26777,26777,26781,26781,26792,26795,
+26797,26797,26798,26798,26811,26817,26834,26834,
+26842,26842,26832,26826,26809,26809,26779,26779,
+26768,26766,26770,26770,26790,26790,26818,26828,
+26847,26847,26881,26881,26907,26918,26943,26943,
+26987,26987,27027,27041,27068,27068,27085,27085,
+27111,27125,27172,27172,27229,27229,27266,27279,
+27310,27310,27336,27336,27341,27341,27341,27341,
+27334,27334,27315,27306,27283,27283,27257,27257,
+27245,27242,27236,27236,27232,27232,27238,27243,
+27258,27258,27285,27285,27307,27314,27327,27327,
+27333,27333,27340,27344,27360,27360,27380,27380,
+27387,27390,27398,27398,27406,27406,27417,27422,
+27432,27432,27440,27440,27445,27446,27446,27446,
+27444,27444,27444,27445,27451,27451,27466,27466,
+27479,27484,27495,27495,27498,27498,27492,27488,
+27473,27473,27450,27450,27430,27421,27394,27394,
+27360,27360,27341,27336,27332,27332,27341,27341,
+27349,27353,27364,27364,27381,27381,27393,27398,
+27409,27409,27417,27417,27424,27428,27445,27445,
+27494,27494,27556,27581,27642,27642,27703,27703,
+27739,27751,27773,27773,27783,27783,27780,27779,
+27779,27779,27775,27775,27762,27756,27736,27736,
+27716,27716,27716,27716,27709,27709,27691,27691,
+27688,27687,27686,27686,27691,27691,27705,27713,
+27739,27739,27778,27778,27806,27817,27840,27840,
+27860,27860,27883,27893,27923,27923,27954,27954,
+27987,28002,28039,28039,28076,28076,28098,28107,
+28129,28129,28156,28156,28177,28188,28217,28217,
+28264,28264,28303,28316,28345,28345,28374,28374,
+28391,28396,28404,28404,28413,28413,28422,28424,
+28433,28433,28452,28452,28470,28478,28495,28495,
+28513,28513,28527,28530,28530,28530,28517,28517,
+28503,28496,28475,28475,28444,28444,28412,28399,
+28363,28363,28319,28319,28292,28281,28257,28257,
+28223,28223,28205,28200,28192,28192,28201,28201,
+28227,28240,28275,28275,28329,28329,28386,28411,
+28472,28472,28542,28542,28601,28623,28674,28674,
+28725,28725,28759,28773,28804,28804,28855,28855,
+28908,28932,29001,29001,29107,29107,29210,29253,
+29366,29366,29510,29510,29620,29661,29752,29752,
+29834,29834,29882,29898,29934,29934,29963,29963,
+29971,29970,29960,29960,29927,29927,29904,29897,
+29882,29882,29878,29878,29883,29885,29888,29888,
+30144,30144,30154,30158,30169,30169,30177,30177,
+30173,30167,30146,30146,30111,30111,30076,30060,
+30016,30016,29964,29964,29921,29904,29868,29868,
+29840,29840,29812,29799,29758,29758,29713,29713,
+29675,29661,29625,29625,29590,29590,29567,29558,
+29536,29536,29498,29498,29459,29443,29402,29402,
+29351,29351,29309,29290,29237,29237,29160,29160,
+29095,29070,29009,29009,28938,28938,28893,28879,
+28851,28851,28841,28841,28862,28876,28925,28925,
+29000,29000,29056,29076,29119,29119,29152,29152,
+29156,29154,29136,29136,29109,29109,29091,29084,
+29070,29070,29066,29066,29074,29081,29106,29106,
+29169,29169,29229,29253,29311,29311,29392,29392,
+29469,29499,29571,29571,29632,29632,29658,29663,
+29664,29664,29637,29637,29612,29605,29595,29595,
+29602,29602,29610,29614,29626,29626,29647,29647,
+29669,29677,29699,29699,29716,29716,29719,29719,
+29719,29719,29728,29728,29736,29738,29738,29738,
+29725,29725,29720,29720,29729,29729,29737,29737,
+29740,29743,29751,29751,29757,29757,29765,29770,
+29788,29788,29801,29801,29804,29805,29805,29805,
+29797,29797,29784,29781,29781,29781,29763,29763,
+29761,29768,29804,29804,29882,29882,29925,29938,
+29956,29956,29949,29949,29921,29912,29898,29898,
+29901,29901,29915,29923,29949,29949,29957,29957,
+29946,29950,29986,29986,30087,30087,30135,30147,
+30161,30161,30181,30181,30187,30184,30166,30166,
+30131,30131,30120,30118,30117,30117,30152,30152,
+30195,30198,30174,30174,30068,30068,29900,29828,
+29634,29634,29532,29532,29542,29548,29568,29568,
+29582,29582,29535,29502,29380,29380,29210,29210,
+29063,29009,28883,28883,28775,28775,28686,28654,
+28579,28579,28465,28465,28343,28298,28191,28191,
+28097,28097,28024,27991,27900,27900,27786,27786,
+27701,27672,27608,27608,27559,27559,27521,27507,
+27478,27478,27434,27434,27371,27348,27299,27299,
+27245,27245,27180,27155,27093,27093,27013,27013,
+26953,26936,26909,26909,26905,26905,26909,26913,
+26925,26925,26957,26957,26999,27020,27085,27085,
+27158,27158,27216,27237,27279,27279,27299,27299,
+27300,27299,27294,27294,27284,27284,27274,27271,
+27264,27264,27256,27256,27242,27233,27207,27207,
+27161,27161,27121,27107,27078,27078,27052,27052,
+27046,27045,27048,27048,27037,27037,27012,27003,
+26978,26978,26953,26953,26936,26931,26919,26919,
+26912,26912,26911,26910,26910,26910,26910,26910,
+26909,26908,26902,26902,26900,26900,26904,26905,
+26904,26904,26909,26909,26923,26926,26938,26938,
+26942,26942,26937,26933,26916,26916,26889,26889,
+26879,26878,26881,26881,26889,26889,26906,26914,
+26937,26937,26963,26963,26981,26989,27009,27009,
+27046,27046,27087,27100,27132,27132,27156,27156,
+27190,27207,27259,27259,27320,27320,27356,27369,
+27394,27394,27418,27418,27422,27423,27421,27421,
+27412,27412,27392,27383,27359,27359,27328,27328,
+27308,27301,27288,27288,27273,27273,27278,27283,
+27300,27300,27331,27331,27354,27361,27375,27375,
+27386,27386,27400,27407,27427,27427,27445,27445,
+27454,27458,27470,27470,27481,27481,27488,27492,
+27501,27501,27510,27510,27516,27517,27521,27521,
+27522,27522,27521,27522,27527,27527,27539,27539,
+27547,27549,27555,27555,27554,27554,27544,27538,
+27517,27517,27486,27486,27461,27451,27425,27425,
+27399,27399,27388,27386,27386,27386,27391,27391,
+27396,27398,27405,27405,27421,27421,27434,27440,
+27452,27452,27465,27465,27478,27486,27514,27514,
+27577,27577,27649,27677,27747,27747,27810,27810,
+27847,27860,27882,27882,27891,27891,27887,27886,
+27886,27886,27888,27888,27879,27874,27857,27857,
+27844,27844,27843,27841,27837,27837,27825,27825,
+27820,27819,27817,27817,27817,27817,27830,27838,
+27864,27864,27901,27901,27927,27937,27959,27959,
+27980,27980,28001,28009,28032,28032,28062,28062,
+28094,28108,28145,28145,28189,28189,28216,28227,
+28254,28254,28287,28287,28311,28323,28354,28354,
+28409,28409,28457,28473,28509,28509,28542,28542,
+28568,28577,28592,28592,28602,28602,28613,28618,
+28630,28630,28648,28648,28668,28675,28695,28695,
+28716,28716,28729,28732,28731,28731,28722,28722,
+28713,28707,28686,28686,28654,28654,28621,28607,
+28566,28566,28518,28518,28486,28473,28443,28443,
+28410,28410,28394,28391,28392,28392,28420,28420,
+28462,28479,28529,28529,28599,28599,28668,28694,
+28759,28759,28832,28832,28885,28906,28951,28951,
+28995,28995,29029,29042,29077,29077,29127,29127,
+29176,29200,29267,29267,29373,29373,29471,29512,
+29622,29622,29757,29757,29858,29895,29981,29981,
+30057,30057,30100,30115,30147,30147,30168,30168,
+30171,30169,30155,30155,30118,30118,30093,30087,
+30075,30075,30078,30078,30097,30106,30128,30128,
+30144,30144,30154,30158,30169,30169,30177,30177,
+30173,30167,30146,30146,30111,30111,30076,30060,
+30016,30016,29964,29964,29921,29904,29868,29868,
+29840,29840,29812,29799,29758,29758,29713,29713,
+29675,29661,29625,29625,29590,29590,29567,29558,
+29536,29536,29498,29498,29459,29443,29402,29402,
+29351,29351,29309,29290,29237,29237,29160,29160,
+29095,29070,29009,29009,28938,28938,28893,28879,
+28851,28851,28841,28841,28862,28876,28925,28925,
+29000,29000,29056,29076,29119,29119,29152,29152,
+29156,29154,29136,29136,29109,29109,29091,29084,
+29070,29070,29066,29066,29074,29081,29106,29106,
+29169,29169,29229,29253,29311,29311,29392,29392,
+29469,29499,29571,29571,29632,29632,29658,29663,
+29664,29664,29637,29637,29612,29605,29595,29595,
+29602,29602,29610,29614,29626,29626,29647,29647,
+29669,29677,29699,29699,29716,29716,29719,29719,
+29719,29719,29728,29728,29736,29738,29738,29738,
+29725,29725,29720,29720,29729,29729,29737,29737,
+29740,29743,29751,29751,29757,29757,29765,29770,
+29788,29788,29801,29801,29804,29805,29805,29805,
+29797,29797,29784,29781,29781,29781,29763,29763,
+29761,29768,29804,29804,29882,29882,29925,29938,
+29956,29956,29949,29949,29921,29912,29898,29898,
+29901,29901,29915,29923,29949,29949,29957,29957,
+29946,29950,29986,29986,30087,30087,30135,30147,
+30161,30161,30181,30181,30187,30184,30166,30166,
+30131,30131,30120,30118,30117,30117,30152,30152,
+30195,30198,30174,30174,30068,30068,29900,29828,
+29634,29634,29532,29532,29542,29548,29568,29568,
+29582,29582,29535,29502,29380,29380,29210,29210,
+29063,29009,28883,28883,28775,28775,28686,28654,
+28579,28579,28465,28465,28343,28298,28191,28191,
+28097,28097,28024,27991,27900,27900,27786,27786,
+27701,27672,27608,27608,27559,27559,27521,27507,
+27478,27478,27434,27434,27371,27348,27299,27299,
+27245,27245,27180,27155,27093,27093,27013,27013,
+26953,26936,26909,26909,26905,26905,26909,26913,
+26925,26925,26957,26957,26999,27020,27085,27085,
+27158,27158,27216,27237,27279,27279,27299,27299,
+27300,27299,27294,27294,27284,27284,27274,27271,
+27264,27264,27256,27256,27242,27233,27207,27207,
+27161,27161,27121,27107,27078,27078,27052,27052,
+27046,27045,27048,27048,27037,27037,27012,27003,
+26978,26978,26953,26953,26936,26931,26919,26919,
+26912,26912,26911,26910,26910,26910,26910,26910,
+26909,26908,26902,26902,26900,26900,26904,26905,
+26904,26904,26909,26909,26923,26926,26938,26938,
+26942,26942,26937,26933,26916,26916,26889,26889,
+26879,26878,26881,26881,26889,26889,26906,26914,
+26937,26937,26963,26963,26981,26989,27009,27009,
+27046,27046,27087,27100,27132,27132,27156,27156,
+27190,27207,27259,27259,27320,27320,27356,27369,
+27394,27394,27418,27418,27422,27423,27421,27421,
+27412,27412,27392,27383,27359,27359,27328,27328,
+27308,27301,27288,27288,27273,27273,27278,27283,
+27300,27300,27331,27331,27354,27361,27375,27375,
+27386,27386,27400,27407,27427,27427,27445,27445,
+27454,27458,27470,27470,27481,27481,27488,27492,
+27501,27501,27510,27510,27516,27517,27521,27521,
+27522,27522,27521,27522,27527,27527,27539,27539,
+27547,27549,27555,27555,27554,27554,27544,27538,
+27517,27517,27486,27486,27461,27451,27425,27425,
+27399,27399,27388,27386,27386,27386,27391,27391,
+27396,27398,27405,27405,27421,27421,27434,27440,
+27452,27452,27465,27465,27478,27486,27514,27514,
+27577,27577,27649,27677,27747,27747,27810,27810,
+27847,27860,27882,27882,27891,27891,27887,27886,
+27886,27886,27888,27888,27879,27874,27857,27857,
+27844,27844,27843,27841,27837,27837,27825,27825,
+27820,27819,27817,27817,27817,27817,27830,27838,
+27864,27864,27901,27901,27927,27937,27959,27959,
+27980,27980,28001,28009,28032,28032,28062,28062,
+28094,28108,28145,28145,28189,28189,28216,28227,
+28254,28254,28287,28287,28311,28323,28354,28354,
+28409,28409,28457,28473,28509,28509,28542,28542,
+28568,28577,28592,28592,28602,28602,28613,28618,
+28630,28630,28648,28648,28668,28675,28695,28695,
+28716,28716,28729,28732,28731,28731,28722,28722,
+28713,28707,28686,28686,28654,28654,28621,28607,
+28566,28566,28518,28518,28486,28473,28443,28443,
+28410,28410,28394,28391,28392,28392,28420,28420,
+28462,28479,28529,28529,28599,28599,28668,28694,
+28759,28759,28832,28832,28885,28906,28951,28951,
+28995,28995,29029,29042,29077,29077,29127,29127,
+29176,29200,29267,29267,29373,29373,29471,29512,
+29622,29622,29757,29757,29858,29895,29981,29981,
+30057,30057,30100,30115,30147,30147,30168,30168,
+30171,30169,30155,30155,30118,30118,30093,30087,
+30075,30075,30078,30078,30097,30106,30128,30128,
+30427,30427,30451,30460,30479,30479,30499,30499,
+30502,30500,30485,30485,30458,30458,30428,30415,
+30374,30374,30319,30319,30277,30261,30227,30227,
+30204,30204,30182,30171,30133,30133,30089,30089,
+30058,30048,30024,30024,30007,30007,29992,29986,
+29967,29967,29941,29941,29917,29906,29878,29878,
+29840,29840,29802,29786,29738,29738,29667,29667,
+29610,29589,29536,29536,29475,29475,29440,29429,
+29411,29411,29411,29411,29433,29445,29485,29485,
+29538,29538,29577,29592,29627,29627,29648,29648,
+29634,29626,29592,29592,29549,29549,29523,29514,
+29496,29496,29485,29485,29496,29505,29540,29540,
+29614,29614,29687,29715,29783,29783,29864,29864,
+29926,29950,30003,30003,30047,30047,30056,30056,
+30043,30043,30008,30008,29975,29964,29938,29938,
+29924,29924,29927,29930,29943,29943,29966,29966,
+29987,29994,30010,30010,30023,30023,30028,30030,
+30035,30035,30044,30044,30048,30047,30039,30039,
+30020,30020,30010,30008,30009,30009,30008,30008,
+30007,30006,30007,30007,30008,30008,30011,30014,
+30023,30023,30028,30028,30024,30023,30019,30019,
+30010,30010,30001,29999,29997,29997,29992,29992,
+30005,30013,30045,30045,30098,30098,30132,30141,
+30158,30158,30147,30147,30117,30108,30098,30098,
+30119,30119,30135,30142,30159,30159,30185,30185,
+30209,30224,30276,30276,30370,30370,30438,30464,
+30520,30520,30534,30534,30493,30478,30449,30449,
+30435,30435,30435,30436,30440,30440,30340,30340,
+30390,30424,30542,30542,30475,30475,30330,30268,
+30104,30104,29977,29977,29926,29919,29929,29929,
+29991,29991,29972,29947,29839,29839,29681,29681,
+29546,29491,29353,29353,29214,29214,29132,29108,
+29065,29065,28957,28957,28808,28749,28600,28600,
+28457,28457,28350,28305,28189,28189,28045,28045,
+27928,27885,27791,27791,27712,27712,27664,27647,
+27609,27609,27579,27579,27541,27526,27491,27491,
+27433,27433,27359,27330,27257,27257,27165,27165,
+27098,27080,27057,27057,27072,27072,27089,27097,
+27126,27126,27173,27173,27227,27252,27320,27320,
+27386,27386,27433,27449,27479,27479,27490,27490,
+27487,27486,27483,27483,27480,27480,27471,27466,
+27454,27454,27432,27432,27404,27392,27362,27362,
+27326,27326,27297,27285,27260,27260,27237,27237,
+27222,27218,27211,27211,27191,27191,27163,27152,
+27125,27125,27103,27103,27091,27088,27080,27080,
+27070,27070,27064,27063,27061,27061,27061,27061,
+27059,27057,27052,27052,27047,27047,27044,27043,
+27041,27041,27047,27047,27050,27050,27049,27049,
+27049,27049,27052,27052,27048,27048,27029,27029,
+27022,27021,27023,27023,27024,27024,27030,27033,
+27045,27045,27067,27067,27084,27090,27107,27107,
+27140,27140,27179,27194,27232,27232,27276,27276,
+27324,27344,27395,27395,27451,27451,27485,27497,
+27519,27519,27538,27538,27543,27543,27543,27543,
+27530,27530,27509,27500,27471,27471,27432,27432,
+27408,27399,27380,27380,27360,27360,27359,27361,
+27373,27373,27403,27403,27433,27443,27462,27462,
+27476,27476,27491,27498,27518,27518,27540,27540,
+27552,27558,27574,27574,27588,27588,27591,27592,
+27598,27598,27610,27610,27618,27620,27624,27624,
+27628,27628,27632,27633,27634,27634,27636,27636,
+27637,27637,27636,27636,27632,27632,27625,27620,
+27602,27602,27568,27568,27537,27525,27499,27499,
+27479,27479,27479,27481,27487,27487,27489,27489,
+27486,27486,27485,27485,27495,27495,27511,27518,
+27537,27537,27558,27558,27587,27601,27648,27648,
+27729,27729,27807,27838,27912,27912,27981,27981,
+28020,28032,28051,28051,28052,28052,28049,28049,
+28049,28049,28046,28046,28036,28031,28018,28018,
+28011,28011,28009,28009,28007,28007,28002,28002,
+28000,28000,28002,28002,28004,28004,28016,28023,
+28048,28048,28073,28073,28085,28089,28097,28097,
+28117,28117,28135,28142,28156,28156,28180,28180,
+28211,28224,28266,28266,28318,28318,28353,28367,
+28403,28403,28444,28444,28474,28487,28522,28522,
+28578,28578,28635,28657,28706,28706,28746,28746,
+28781,28794,28822,28822,28841,28841,28856,28862,
+28879,28879,28898,28898,28917,28924,28945,28945,
+28962,28962,28969,28971,28974,28974,28970,28970,
+28962,28957,28942,28942,28911,28911,28872,28855,
+28812,28812,28764,28764,28729,28716,28685,28685,
+28666,28666,28665,28669,28686,28686,28740,28740,
+28802,28829,28898,28898,28986,28986,29060,29089,
+29156,29156,29225,29225,29272,29290,29330,29330,
+29369,29369,29401,29415,29451,29451,29500,29500,
+29545,29565,29624,29624,29717,29717,29805,29841,
+29936,29936,30052,30052,30137,30168,30238,30238,
+30304,30304,30344,30357,30384,30384,30397,30397,
+30392,30388,30370,30370,30337,30337,30309,30300,
+30287,30287,30305,30305,30339,30352,30388,30388,
+30427,30427,30451,30460,30479,30479,30499,30499,
+30502,30500,30485,30485,30458,30458,30428,30415,
+30374,30374,30319,30319,30277,30261,30227,30227,
+30204,30204,30182,30171,30133,30133,30089,30089,
+30058,30048,30024,30024,30007,30007,29992,29986,
+29967,29967,29941,29941,29917,29906,29878,29878,
+29840,29840,29802,29786,29738,29738,29667,29667,
+29610,29589,29536,29536,29475,29475,29440,29429,
+29411,29411,29411,29411,29433,29445,29485,29485,
+29538,29538,29577,29592,29627,29627,29648,29648,
+29634,29626,29592,29592,29549,29549,29523,29514,
+29496,29496,29485,29485,29496,29505,29540,29540,
+29614,29614,29687,29715,29783,29783,29864,29864,
+29926,29950,30003,30003,30047,30047,30056,30056,
+30043,30043,30008,30008,29975,29964,29938,29938,
+29924,29924,29927,29930,29943,29943,29966,29966,
+29987,29994,30010,30010,30023,30023,30028,30030,
+30035,30035,30044,30044,30048,30047,30039,30039,
+30020,30020,30010,30008,30009,30009,30008,30008,
+30007,30006,30007,30007,30008,30008,30011,30014,
+30023,30023,30028,30028,30024,30023,30019,30019,
+30010,30010,30001,29999,29997,29997,29992,29992,
+30005,30013,30045,30045,30098,30098,30132,30141,
+30158,30158,30147,30147,30117,30108,30098,30098,
+30119,30119,30135,30142,30159,30159,30185,30185,
+30209,30224,30276,30276,30370,30370,30438,30464,
+30520,30520,30534,30534,30493,30478,30449,30449,
+30435,30435,30435,30436,29092,29017,29237,30340,
+30390,30424,30542,30542,30475,30475,30330,30268,
+30104,30104,29977,29977,29926,29919,29929,29929,
+29991,29991,29972,29947,29839,29839,29681,29681,
+29546,29491,29353,29353,29214,29214,29132,29108,
+29065,29065,28957,28957,28808,28749,28600,28600,
+28457,28457,28350,28305,28189,28189,28045,28045,
+27928,27885,27791,27791,27712,27712,27664,27647,
+27609,27609,27579,27579,27541,27526,27491,27491,
+27433,27433,27359,27330,27257,27257,27165,27165,
+27098,27080,27057,27057,27072,27072,27089,27097,
+27126,27126,27173,27173,27227,27252,27320,27320,
+27386,27386,27433,27449,27479,27479,27490,27490,
+27487,27486,27483,27483,27480,27480,27471,27466,
+27454,27454,27432,27432,27404,27392,27362,27362,
+27326,27326,27297,27285,27260,27260,27237,27237,
+27222,27218,27211,27211,27191,27191,27163,27152,
+27125,27125,27103,27103,27091,27088,27080,27080,
+27070,27070,27064,27063,27061,27061,27061,27061,
+27059,27057,27052,27052,27047,27047,27044,27043,
+27041,27041,27047,27047,27050,27050,27049,27049,
+27049,27049,27052,27052,27048,27048,27029,27029,
+27022,27021,27023,27023,27024,27024,27030,27033,
+27045,27045,27067,27067,27084,27090,27107,27107,
+27140,27140,27179,27194,27232,27232,27276,27276,
+27324,27344,27395,27395,27451,27451,27485,27497,
+27519,27519,27538,27538,27543,27543,27543,27543,
+27530,27530,27509,27500,27471,27471,27432,27432,
+27408,27399,27380,27380,27360,27360,27359,27361,
+27373,27373,27403,27403,27433,27443,27462,27462,
+27476,27476,27491,27498,27518,27518,27540,27540,
+27552,27558,27574,27574,27588,27588,27591,27592,
+27598,27598,27610,27610,27618,27620,27624,27624,
+27628,27628,27632,27633,27634,27634,27636,27636,
+27637,27637,27636,27636,27632,27632,27625,27620,
+27602,27602,27568,27568,27537,27525,27499,27499,
+27479,27479,27479,27481,27487,27487,27489,27489,
+27486,27486,27485,27485,27495,27495,27511,27518,
+27537,27537,27558,27558,27587,27601,27648,27648,
+27729,27729,27807,27838,27912,27912,27981,27981,
+28020,28032,28051,28051,28052,28052,28049,28049,
+28049,28049,28046,28046,28036,28031,28018,28018,
+28011,28011,28009,28009,28007,28007,28002,28002,
+28000,28000,28002,28002,28004,28004,28016,28023,
+28048,28048,28073,28073,28085,28089,28097,28097,
+28117,28117,28135,28142,28156,28156,28180,28180,
+28211,28224,28266,28266,28318,28318,28353,28367,
+28403,28403,28444,28444,28474,28487,28522,28522,
+28578,28578,28635,28657,28706,28706,28746,28746,
+28781,28794,28822,28822,28841,28841,28856,28862,
+28879,28879,28898,28898,28917,28924,28945,28945,
+28962,28962,28969,28971,28974,28974,28970,28970,
+28962,28957,28942,28942,28911,28911,28872,28855,
+28812,28812,28764,28764,28729,28716,28685,28685,
+28666,28666,28665,28669,28686,28686,28740,28740,
+28802,28829,28898,28898,28986,28986,29060,29089,
+29156,29156,29225,29225,29272,29290,29330,29330,
+29369,29369,29401,29415,29451,29451,29500,29500,
+29545,29565,29624,29624,29717,29717,29805,29841,
+29936,29936,30052,30052,30137,30168,30238,30238,
+30304,30304,30344,30357,30384,30384,30397,30397,
+30392,30388,30370,30370,30337,30337,30309,30300,
+30287,30287,30305,30305,30339,30352,30388,30388,
+30637,30637,30672,30685,30717,30717,30751,30751,
+30764,30766,30759,30759,30740,30740,30718,30707,
+30672,30672,30614,30614,30570,30555,30522,30522,
+30498,30498,30477,30467,30437,30437,30395,30395,
+30368,30361,30349,30349,30346,30346,30340,30335,
+30320,30320,30301,30301,30288,30283,30267,30267,
+30245,30245,30216,30201,30158,30158,30092,30092,
+30039,30021,29983,29983,29948,29948,29916,29908,
+29897,29897,29906,29906,29924,29931,29953,29953,
+29982,29982,30009,30021,30054,30054,30056,30056,
+30022,30007,29966,29966,29920,29920,29893,29884,
+29867,29867,29862,29862,29878,29888,29926,29926,
+30000,30000,30067,30093,30157,30157,30229,30229,
+30277,30294,30328,30328,30348,30348,30341,30335,
+30308,30308,30266,30266,30231,30218,30188,30188,
+30161,30161,30156,30157,30169,30169,30192,30192,
+30213,30219,30235,30235,30249,30249,30256,30258,
+30265,30265,30274,30274,30277,30276,30267,30267,
+30248,30248,30239,30236,30231,30231,30222,30222,
+30210,30206,30199,30199,30212,30212,30211,30208,
+30195,30195,30186,30186,30183,30181,30172,30172,
+30151,30151,30141,30139,30139,30139,30161,30161,
+30203,30216,30236,30236,30235,30235,30249,30257,
+30281,30281,30287,30287,30273,30271,30271,30271,
+30298,30298,30310,30314,30322,30322,30377,30377,
+30454,30481,30543,30543,30599,30599,30670,30701,
+30788,30788,30795,30795,30719,30698,30664,30664,
+30666,30666,30576,29197,28909,28817,29183,29453,
+29632,29718,29638,29741,29876,30689,30555,30504,
+30382,30382,30270,30270,30209,30200,30212,30212,
+30290,30290,30289,30271,30184,30184,30038,30038,
+29896,29841,29705,29705,29574,29574,29497,29468,
+29400,29400,29283,29283,29155,29098,28942,28942,
+28759,28759,28613,28553,28396,28396,28216,28216,
+28071,28019,27903,27903,27824,27824,27773,27753,
+27702,27702,27675,27675,27673,27668,27651,27651,
+27606,27606,27540,27509,27428,27428,27335,27335,
+27266,27250,27230,27230,27245,27245,27271,27283,
+27321,27321,27372,27372,27424,27447,27507,27507,
+27568,27568,27606,27620,27647,27647,27657,27657,
+27655,27654,27653,27653,27653,27653,27643,27638,
+27621,27621,27591,27591,27559,27547,27513,27513,
+27478,27478,27453,27442,27418,27418,27396,27396,
+27383,27378,27364,27364,27338,27338,27304,27292,
+27263,27263,27245,27245,27235,27232,27223,27223,
+27214,27214,27208,27206,27206,27206,27209,27209,
+27208,27207,27203,27203,27198,27198,27191,27189,
+27186,27186,27189,27189,27184,27181,27172,27172,
+27169,27169,27174,27175,27174,27174,27159,27159,
+27153,27151,27150,27150,27140,27140,27137,27139,
+27148,27148,27166,27166,27179,27184,27200,27200,
+27232,27232,27271,27288,27331,27331,27384,27384,
+27439,27461,27512,27512,27567,27567,27604,27616,
+27639,27639,27653,27653,27656,27656,27654,27654,
+27643,27643,27625,27614,27583,27583,27537,27537,
+27507,27496,27473,27473,27453,27453,27445,27446,
+27454,27454,27488,27488,27522,27534,27554,27554,
+27572,27572,27587,27592,27610,27610,27633,27633,
+27649,27655,27670,27670,27682,27682,27685,27686,
+27691,27691,27702,27702,27711,27713,27716,27716,
+27721,27721,27726,27726,27723,27723,27716,27716,
+27710,27707,27698,27698,27692,27692,27690,27687,
+27677,27677,27650,27650,27622,27610,27585,27585,
+27569,27569,27571,27574,27581,27581,27579,27579,
+27573,27572,27573,27573,27582,27582,27599,27609,
+27636,27636,27674,27674,27713,27732,27790,27790,
+27883,27883,27967,28001,28079,28079,28156,28156,
+28198,28210,28225,28225,28222,28222,28220,28220,
+28218,28218,28209,28209,28197,28192,28180,28180,
+28175,28175,28172,28171,28168,28168,28174,28174,
+28177,28178,28179,28179,28180,28180,28193,28199,
+28219,28219,28234,28234,28231,28230,28225,28225,
+28237,28237,28253,28258,28271,28271,28289,28289,
+28320,28336,28383,28383,28441,28441,28483,28501,
+28544,28544,28590,28590,28623,28637,28677,28677,
+28741,28741,28802,28825,28877,28877,28924,28924,
+28964,28978,29014,29014,29049,29049,29071,29080,
+29099,29099,29119,29119,29135,29142,29159,29159,
+29170,29170,29173,29174,29179,29179,29182,29182,
+29176,29174,29164,29164,29137,29137,29096,29080,
+29034,29034,28984,28984,28951,28940,28919,28919,
+28914,28914,28928,28938,28971,28971,29041,29041,
+29119,29152,29239,29239,29339,29339,29415,29443,
+29508,29508,29571,29571,29616,29632,29671,29671,
+29707,29707,29738,29751,29785,29785,29826,29826,
+29868,29886,29939,29939,30019,30019,30094,30126,
+30204,30204,30299,30299,30368,30392,30449,30449,
+30507,30507,30544,30556,30584,30584,30586,30586,
+30567,30557,30530,30530,30493,30493,30466,30459,
+30452,30452,30482,30482,30528,30546,30590,30590,
+30719,30719,30758,30774,30811,30811,30850,30850,
+30868,30871,30868,30868,30852,30852,30835,30824,
+30791,30791,30733,30733,30689,30674,30642,30642,
+30617,30617,30597,30588,30559,30559,30519,30519,
+30495,30488,30481,30481,30482,30482,30478,30475,
+30464,30464,30447,30447,30438,30434,30424,30424,
+30405,30405,30380,30367,30327,30327,30265,30265,
+30216,30199,30166,30166,30138,30138,30107,30099,
+30090,30090,30100,30100,30114,30120,30134,30134,
+30155,30155,30176,30186,30217,30217,30213,30213,
+30173,30156,30113,30113,30065,30065,30040,30032,
+30017,30017,30015,30015,30031,30042,30079,30079,
+30150,30150,30214,30238,30297,30297,30363,30363,
+30406,30421,30449,30449,30460,30460,30447,30438,
+30407,30407,30361,30361,30326,30312,30280,30280,
+30250,30250,30241,30241,30252,30252,30275,30275,
+30295,30301,30316,30316,30332,30332,30340,30343,
+30350,30350,30360,30360,30364,30363,30355,30355,
+30337,30337,30328,30325,30319,30319,30307,30307,
+30289,30284,30274,30274,30288,30288,30285,30280,
+30261,30261,30248,30248,30246,30243,30231,30231,
+30206,30206,30196,30194,30196,30196,30225,30225,
+30277,30292,30311,30311,30297,30297,30303,30309,
+30331,30331,30341,30341,30337,30337,30341,30341,
+30367,30367,30380,30383,30392,30392,30457,30457,
+30549,30581,30647,30647,30697,30697,30766,30799,
+30888,30888,30890,30890,30807,30784,30747,30747,
+29831,29955,30174,30663,30410,30383,30630,30745,
+30797,30700,30889,30889,30781,30781,30652,30605,
+30497,30497,30393,30393,30331,30321,30335,30335,
+30419,30419,30421,30404,30321,30321,30174,30174,
+30027,29970,29832,29832,29705,29705,29630,29600,
+29526,29526,29406,29406,29280,29222,29063,29063,
+28870,28870,28715,28650,28486,28486,28298,28298,
+28142,28087,27964,27964,27882,27882,27829,27807,
+27754,27754,27729,27729,27732,26591,27715,27715,
+27669,27669,27602,27572,27491,27491,27400,27400,
+27334,27317,27299,27299,27317,27317,27346,27360,
+27400,27400,27454,27454,27506,27528,27585,27585,
+27642,27642,27679,27691,27717,27717,27727,27727,
+27727,27727,27727,27727,27727,27727,27716,27711,
+27692,27692,27660,27660,27627,27613,27579,27579,
+27544,27544,27518,27508,27483,27483,27464,27464,
+27450,27444,27429,27429,27400,27400,27367,27354,
+27326,27326,27308,27308,27299,27296,27288,27288,
+27277,27277,27272,27271,27271,27271,27275,27275,
+27275,27274,27270,27270,27265,27265,27257,27255,
+27252,27252,27253,27253,27245,27241,27228,27228,
+27224,27224,27230,27231,27229,27229,27216,27216,
+27210,27208,27205,27205,27194,27194,27188,27188,
+27194,27194,27209,27209,27221,27227,27242,27242,
+27273,27273,27312,27329,27373,27373,27430,27430,
+27487,27508,27561,27561,27615,27615,27653,27666,
+27689,27689,27703,27703,27705,27705,27702,27702,
+27692,27692,27674,27663,27631,27631,27583,27583,
+27550,27539,27513,27513,27493,27493,27483,27483,
+27492,27492,27526,27526,27561,27573,27594,27594,
+27613,27613,27628,27634,27652,27652,27674,27674,
+27690,27696,27710,27710,27721,27721,27724,27726,
+27731,27731,27742,27742,27750,27752,27755,27755,
+27759,27759,27763,27763,27758,27758,27748,27748,
+27738,27735,27725,27725,27719,27719,27719,27718,
+27712,27712,27688,27688,27661,27651,27626,27626,
+27611,27611,27615,27617,27624,27624,27620,27620,
+27613,27613,27615,27615,27623,27623,27642,27652,
+27683,27683,27726,27726,27769,27791,27853,27853,
+27951,27951,28038,28072,28153,28153,28233,28233,
+28276,28288,28303,28303,28299,28299,28299,28298,
+28296,28296,28283,28283,28270,28265,28253,28253,
+28248,28248,28243,28242,28239,28239,28248,28248,
+28254,28255,28257,28257,28257,28257,28268,28274,
+28293,28293,28302,28302,28296,28292,28284,28284,
+28292,28292,28306,28311,28323,28323,28341,28341,
+28373,28388,28439,28439,28499,28499,28544,28561,
+28606,28606,28654,28654,28688,28704,28746,28746,
+28813,28813,28877,28899,28951,28951,29001,29001,
+29042,29058,29097,29097,29137,29137,29163,29172,
+29193,29193,29214,29214,29229,29236,29251,29251,
+29258,29258,29259,29260,29267,29267,29274,29274,
+29270,29268,29261,29261,29236,29236,29195,29177,
+29132,29132,29082,29082,29050,29041,29023,29023,
+29025,29025,29046,29056,29094,29094,29170,29170,
+29253,29288,29380,29380,29483,29483,29559,29588,
+29651,29651,29712,29712,29756,29772,29809,29809,
+29842,29842,29874,29886,29920,29920,29959,29959,
+29999,30016,30067,30067,30141,30141,30212,30240,
+30312,30312,30397,30397,30460,30482,30533,30533,
+30589,30589,30624,30635,30663,30663,30661,30661,
+30636,30625,30594,30594,30556,30556,30530,30524,
+30518,30518,30553,30553,30602,30622,30669,30669,
+30925,30925,30974,30994,31044,31044,31098,31098,
+31126,31133,31141,31141,31138,31138,31132,31125,
+31096,31096,31040,31040,30996,30981,30952,30952,
+30924,30924,30903,30895,30874,30874,30843,30843,
+30825,30820,30817,30817,30828,30828,30836,30837,
+30836,30836,30825,30825,30824,30823,30822,30822,
+30812,30812,30797,30789,30760,30760,30712,30712,
+30677,30667,30645,30645,30627,30627,30596,30588,
+30576,30576,30580,30580,30582,30582,30580,30580,
+30579,30579,30584,30589,30607,30607,30589,30589,
+30539,30520,30475,30475,30431,30431,30412,30407,
+30404,30404,30413,30413,30426,30434,30461,30461,
+30516,30516,30563,30582,30623,30623,30670,30670,
+30701,30710,30725,30725,30716,30716,30686,30673,
+30632,30632,30581,30581,30543,30529,30494,30494,
+30455,30455,30438,30435,30440,30440,30461,30461,
+30478,30484,30500,30500,30521,30521,30535,30540,
+30549,30549,30559,30559,30566,30567,30566,30566,
+30555,30555,30546,30543,30535,30535,30520,30520,
+30488,30477,30460,30460,30466,30466,30457,30450,
+30423,30423,30403,30403,30397,30393,30376,30376,
+30342,30342,30333,30332,30339,30339,30382,30382,
+30449,30468,30494,30494,30471,30471,30464,30462,
+30461,30461,30475,30475,30498,30505,30519,30519,
+30540,30540,30555,30562,30583,30583,30671,30671,
+30785,30824,30904,30904,30963,30963,31029,31056,
+31128,31128,31112,31112,31022,30049,29930,29887,
+30079,30353,30885,30968,31127,31060,31121,31295,
+31419,31446,31174,31174,31033,31033,30923,30884,
+30809,30809,30728,30728,30671,30663,30680,30680,
+30770,30770,30769,30752,30664,30664,30499,30499,
+30328,30264,30117,30117,29997,29997,29926,29897,
+29821,29821,29692,29692,29554,29493,29323,29323,
+29117,29117,28957,28892,28733,28733,28541,28541,
+28365,28302,28164,28164,28072,28072,28013,27991,
+27937,27937,27911,27911,27907,27901,27871,27871,
+27803,27803,27731,27702,27630,27630,27558,27558,
+27504,27491,27481,27481,27507,27507,27546,27562,
+27607,27607,27670,27670,27725,27746,27796,27796,
+27842,27842,27874,27884,27907,27907,27920,27920,
+27924,27926,27931,27931,27931,27931,27918,27910,
+27883,27883,27845,27845,27812,27799,27764,27764,
+27725,27725,27695,27683,27658,27658,27640,27640,
+27627,27621,27604,27604,27576,27576,27542,27530,
+27506,27506,27492,27492,27485,27481,27471,27471,
+27464,27464,27461,27461,27462,27462,27467,27467,
+27470,27470,27466,27466,27458,27458,27450,27446,
+27439,27439,27434,27434,27421,27415,27398,27398,
+27389,27389,27392,27392,27390,27390,27377,27377,
+27369,27366,27360,27360,27349,27349,27337,27333,
+27327,27327,27333,27333,27343,27348,27362,27362,
+27390,27390,27429,27447,27493,27493,27552,27552,
+27610,27633,27690,27690,27748,27748,27787,27799,
+27822,27822,27836,27836,27840,27841,27838,27838,
+27828,27828,27807,27797,27762,27762,27711,27711,
+27672,27657,27627,27627,27602,27602,27593,27593,
+27604,27604,27641,27641,27673,27683,27704,27704,
+27727,27727,27747,27754,27770,27770,27789,27789,
+27802,27807,27817,27817,27825,27825,27831,27834,
+27843,27843,27853,27853,27857,27857,27857,27857,
+27858,27858,27857,27855,27846,27846,27826,27826,
+27812,27808,27799,27799,27797,27797,27805,27808,
+27811,27811,27799,27799,27780,27772,27751,27751,
+27741,27741,27746,27747,27749,27749,27739,27739,
+27732,27732,27738,27738,27750,27750,27770,27782,
+27820,27820,27879,27879,27933,27960,28031,28031,
+28139,28139,28236,28274,28364,28364,28451,28451,
+28496,28508,28527,28527,28525,28525,28524,28523,
+28518,28518,28500,28500,28484,28478,28462,28462,
+28453,28453,28448,28446,28441,28441,28454,28454,
+28465,28467,28470,28470,28471,28471,28478,28481,
+28491,28491,28488,28488,28473,28467,28456,28456,
+28456,28456,28463,28466,28474,28474,28496,28496,
+28532,28549,28606,28606,28672,28672,28721,28740,
+28787,28787,28837,28837,28875,28892,28942,28942,
+29022,29022,29087,29110,29161,29161,29216,29216,
+29260,29279,29325,29325,29379,29379,29413,29424,
+29450,29450,29474,29474,29489,29494,29501,29501,
+29500,29500,29499,29500,29509,29509,29527,29527,
+29532,29533,29534,29534,29511,29511,29471,29454,
+29407,29407,29360,29360,29336,29331,29327,29327,
+29345,29345,29378,29393,29439,29439,29527,29527,
+29619,29657,29752,29752,29861,29861,29937,29964,
+30022,30022,30076,30076,30116,30131,30165,30165,
+30195,30195,30225,30238,30267,30267,30300,30300,
+30336,30352,30397,30397,30460,30460,30516,30538,
+30592,30592,30651,30651,30695,30712,30752,30752,
+30796,30796,30828,30840,30866,30866,30851,30851,
+30813,30799,30760,30760,30723,30723,30701,30696,
+30694,30694,30734,30734,30791,30812,30865,30865,
+30925,30925,30974,30994,31044,31044,31098,31098,
+31126,31133,31141,31141,31138,31138,31132,31125,
+31096,31096,31040,31040,30996,30981,30952,30952,
+30924,30924,30903,30895,30874,30874,30843,30843,
+30825,30820,30817,30817,30828,30828,30836,30837,
+30836,30836,30825,30825,30824,30823,30822,30822,
+30812,30812,30797,30789,30760,30760,30712,30712,
+30677,30667,30645,30645,30627,30627,30596,30588,
+30576,30576,30580,30580,30582,30582,30580,30580,
+30579,30579,30584,30589,30607,30607,30589,30589,
+30539,30520,30475,30475,30431,30431,30412,30407,
+30404,30404,30413,30413,30426,30434,30461,30461,
+30516,30516,30563,30582,30623,30623,30670,30670,
+30701,30710,30725,30725,30716,30716,30686,30673,
+30632,30632,30581,30581,30543,30529,30494,30494,
+30455,30455,30438,30435,30440,30440,30461,30461,
+30478,30484,30500,30500,30521,30521,30535,30540,
+30549,30549,30559,30559,30566,30567,30566,30566,
+30555,30555,30546,30543,30535,30535,30520,30520,
+30488,30477,30460,30460,30466,30466,30457,30450,
+30423,30423,30403,30403,30397,30393,30376,30376,
+30342,30342,30333,30332,30339,30339,30382,30382,
+30449,30468,30494,30494,30471,30471,30464,30462,
+30461,30461,30475,30475,30498,30505,30519,30519,
+30540,30540,30555,30562,30583,30583,30671,30671,
+30785,30824,30904,30904,30963,30963,31029,31056,
+31128,31128,31112,31112,31022,30433,30330,30312,
+30555,30803,30885,31339,31346,31153,31252,31472,
+31515,31446,31174,31174,31033,31033,30923,30884,
+30809,30809,30728,30728,30671,30663,30680,30680,
+30770,30770,30769,30752,30664,30664,30499,30499,
+30328,30264,30117,30117,29997,29997,29926,29897,
+29821,29821,29692,29692,29554,29493,29323,29323,
+29117,29117,28957,28892,28733,28733,28541,28541,
+28365,28302,28164,28164,28072,28072,28013,27991,
+27937,27937,27911,27911,27907,27901,27871,27871,
+27803,27803,27731,27702,27630,27630,27558,27558,
+27504,27491,27481,27481,27507,27507,27546,27562,
+27607,27607,27670,27670,27725,27746,27796,27796,
+27842,27842,27874,27884,27907,27907,27920,27920,
+27924,27926,27931,27931,27931,27931,27918,27910,
+27883,27883,27845,27845,27812,27799,27764,27764,
+27725,27725,27695,27683,27658,27658,27640,27640,
+27627,27621,27604,27604,27576,27576,27542,27530,
+27506,27506,27492,27492,27485,27481,27471,27471,
+27464,27464,27461,27461,27462,27462,27467,27467,
+27470,27470,27466,27466,27458,27458,27450,27446,
+27439,27439,27434,27434,27421,27415,27398,27398,
+27389,27389,27392,27392,27390,27390,27377,27377,
+27369,27366,27360,27360,27349,27349,27337,27333,
+27327,27327,27333,27333,27343,27348,27362,27362,
+27390,27390,27429,27447,27493,27493,27552,27552,
+27610,27633,27690,27690,27748,27748,27787,27799,
+27822,27822,27836,27836,27840,27841,27838,27838,
+27828,27828,27807,27797,27762,27762,27711,27711,
+27672,27657,27627,27627,27602,27602,27593,27593,
+27604,27604,27641,27641,27673,27683,27704,27704,
+27727,27727,27747,27754,27770,27770,27789,27789,
+27802,27807,27817,27817,27825,27825,27831,27834,
+27843,27843,27853,27853,27857,27857,27857,27857,
+27858,27858,27857,27855,27846,27846,27826,27826,
+27812,27808,27799,27799,27797,27797,27805,27808,
+27811,27811,27799,27799,27780,27772,27751,27751,
+27741,27741,27746,27747,27749,27749,27739,27739,
+27732,27732,27738,27738,27750,27750,27770,27782,
+27820,27820,27879,27879,27933,27960,28031,28031,
+28139,28139,28236,28274,28364,28364,28451,28451,
+28496,28508,28527,28527,28525,28525,28524,28523,
+28518,28518,28500,28500,28484,28478,28462,28462,
+28453,28453,28448,28446,28441,28441,28454,28454,
+28465,28467,28470,28470,28471,28471,28478,28481,
+28491,28491,28488,28488,28473,28467,28456,28456,
+28456,28456,28463,28466,28474,28474,28496,28496,
+28532,28549,28606,28606,28672,28672,28721,28740,
+28787,28787,28837,28837,28875,28892,28942,28942,
+29022,29022,29087,29110,29161,29161,29216,29216,
+29260,29279,29325,29325,29379,29379,29413,29424,
+29450,29450,29474,29474,29489,29494,29501,29501,
+29500,29500,29499,29500,29509,29509,29527,29527,
+29532,29533,29534,29534,29511,29511,29471,29454,
+29407,29407,29360,29360,29336,29331,29327,29327,
+29345,29345,29378,29393,29439,29439,29527,29527,
+29619,29657,29752,29752,29861,29861,29937,29964,
+30022,30022,30076,30076,30116,30131,30165,30165,
+30195,30195,30225,30238,30267,30267,30300,30300,
+30336,30352,30397,30397,30460,30460,30516,30538,
+30592,30592,30651,30651,30695,30712,30752,30752,
+30796,30796,30828,30840,30866,30866,30851,30851,
+30813,30799,30760,30760,30723,30723,30701,30696,
+30694,30694,30734,30734,30791,30812,30865,30865,
+31152,31152,31216,31241,31303,31303,31373,31373,
+31415,31428,31455,31455,31472,31472,31474,31470,
+31450,31450,31400,31400,31358,31344,31319,31319,
+31293,31293,31268,31258,31238,31238,31217,31217,
+31208,31205,31205,31205,31223,31223,31246,31252,
+31261,31261,31260,31260,31262,31262,31257,31257,
+31227,31227,31221,31217,31206,31206,31189,31189,
+31182,31178,31166,31166,31138,31138,31102,31091,
+31069,31069,31049,31049,31022,31015,31008,31008,
+30996,30996,30976,30972,30969,30969,30940,30940,
+30882,30864,30830,30830,30796,30796,30794,30798,
+30822,30822,30836,30836,30834,30831,30816,30816,
+30853,30853,30881,30891,30914,30914,30938,30938,
+30956,30966,31000,31000,30976,30976,30932,30911,
+30847,30847,30794,30794,30770,30758,30720,30720,
+30660,30660,30631,30623,30615,30615,30622,30622,
+30634,30641,30663,30663,30698,30698,30725,30736,
+30762,30762,30777,30777,30775,30775,30779,30779,
+30789,30789,30790,30788,30779,30779,30762,30762,
+30736,30726,30701,30701,30682,30682,30665,30658,
+30636,30636,30619,30619,30610,30604,30581,30581,
+30538,30538,30520,30516,30514,30514,30555,30555,
+30629,30653,30702,30702,30727,30727,30708,30692,
+30632,30632,30632,30632,30690,30707,30732,30732,
+30733,30733,30758,30775,30835,30835,30934,30934,
+31029,31068,31168,31168,31295,31295,31350,31360,
+31352,31352,31302,31302,31331,30633,30640,31297,
+31112,31276,31542,31677,32025,31750,32002,32002,
+31716,31632,31493,31493,31368,31368,31282,31254,
+31196,31196,31132,31132,31088,31084,31111,31111,
+31210,31210,31201,31176,31066,31066,30857,30857,
+30638,30561,30390,30390,30266,30266,30196,30167,
+30089,30089,29943,29943,29787,29721,29553,29553,
+29366,29366,29245,29202,29108,29108,28957,28957,
+28779,28713,28556,28556,28425,28425,28352,28329,
+28286,28286,28248,28248,28212,28188,28107,28107,
+27956,27956,27862,27834,27788,27788,27759,27759,
+27723,27717,27721,27721,27764,27764,27812,27831,
+27877,27877,27936,27936,27989,28009,28056,28056,
+28101,28101,28128,28137,28158,28158,28175,28175,
+28184,28187,28192,28192,28189,28189,28173,28165,
+28138,28138,28099,28099,28067,28053,28020,28020,
+27975,27975,27940,27927,27901,27901,27881,27881,
+27868,27863,27851,27851,27828,27828,27799,27790,
+27775,27775,27771,27771,27770,27768,27761,27761,
+27748,27748,27743,27742,27743,27743,27749,27749,
+27751,27750,27742,27742,27730,27730,27717,27713,
+27702,27702,27689,27689,27676,27671,27655,27655,
+27642,27642,27640,27640,27637,27637,27625,27625,
+27610,27604,27591,27591,27573,27573,27558,27552,
+27539,27539,27536,27536,27545,27549,27561,27561,
+27583,27583,27612,27626,27668,27668,27731,27731,
+27793,27816,27877,27877,27938,27938,27973,27984,
+28001,28001,28015,28015,28026,28027,28021,28021,
+27999,27999,27973,27962,27927,27927,27879,27879,
+27838,27824,27795,27795,27768,27768,27760,27760,
+27772,27772,27802,27802,27825,27834,27854,27854,
+27879,27879,27898,27905,27923,27923,27941,27941,
+27950,27953,27961,27961,27970,27970,27980,27985,
+27999,27999,28007,28007,28002,27999,27990,27990,
+27983,27983,27977,27973,27963,27963,27942,27942,
+27933,27932,27933,27933,27939,27939,27956,27962,
+27977,27977,27980,27980,27968,27962,27942,27942,
+27939,27939,27949,27952,27957,27957,27954,27954,
+27957,27960,27968,27968,27981,27981,28002,28013,
+28051,28051,28112,28112,28174,28203,28289,28289,
+28414,28414,28522,28563,28661,28661,28751,28751,
+28798,28811,28834,28834,28841,28841,28841,28840,
+28831,28831,28808,28808,28786,28777,28752,28752,
+28733,28733,28725,28723,28716,28716,28721,28721,
+28730,28733,28740,28740,28745,28745,28746,28746,
+28745,28745,28735,28735,28723,28719,28711,28711,
+28708,28708,28711,28713,28719,28719,28748,28748,
+28793,28813,28873,28873,28939,28939,28988,29007,
+29051,29051,29104,29104,29148,29168,29223,29223,
+29310,29310,29379,29404,29461,29461,29518,29518,
+29565,29586,29641,29641,29706,29706,29749,29763,
+29797,29797,29826,29826,29844,29849,29854,29854,
+29849,29849,29847,29849,29860,29860,29879,29879,
+29891,29894,29900,29900,29880,29880,29849,29835,
+29797,29797,29757,29757,29743,29742,29749,29749,
+29781,29781,29821,29839,29889,29889,29981,29981,
+30071,30107,30197,30197,30299,30299,30366,30390,
+30442,30442,30490,30490,30522,30535,30562,30562,
+30591,30591,30618,30629,30658,30658,30690,30690,
+30720,30733,30769,30769,30819,30819,30861,30876,
+30908,30908,30936,30936,30963,30974,31005,31005,
+31019,31019,31053,31069,31115,31115,31095,31095,
+31037,31017,30978,30978,30942,30942,30916,30911,
+30912,30912,30950,30950,31003,31024,31079,31079,
+31152,31152,31216,31241,31303,31303,31373,31373,
+31415,31428,31455,31455,31472,31472,31474,31470,
+31450,31450,31400,31400,31358,31344,31319,31319,
+31293,31293,31268,31258,31238,31238,31217,31217,
+31208,31205,31205,31205,31223,31223,31246,31252,
+31261,31261,31260,31260,31262,31262,31257,31257,
+31227,31227,31221,31217,31206,31206,31189,31189,
+31182,31178,31166,31166,31138,31138,31102,31091,
+31069,31069,31049,31049,31022,31015,31008,31008,
+30996,30996,30976,30972,30969,30969,30940,30940,
+30882,30864,30830,30830,30796,30796,30794,30798,
+30822,30822,30836,30836,30834,30831,30816,30816,
+30853,30853,30881,30891,30914,30914,30938,30938,
+30956,30966,31000,31000,30976,30976,30932,30911,
+30847,30847,30794,30794,30770,30758,30720,30720,
+30660,30660,30631,30623,30615,30615,30622,30622,
+30634,30641,30663,30663,30698,30698,30725,30736,
+30762,30762,30777,30777,30775,30775,30779,30779,
+30789,30789,30790,30788,30779,30779,30762,30762,
+30736,30726,30701,30701,30682,30682,30665,30658,
+30636,30636,30619,30619,30610,30604,30581,30581,
+30538,30538,30520,30516,30514,30514,30555,30555,
+30629,30653,30702,30702,30727,30727,30708,30692,
+30632,30632,30632,30632,30690,30707,30732,30732,
+30733,30733,30758,30775,30835,30835,30934,30934,
+31029,31068,31168,31168,31295,31295,31350,31360,
+31352,31352,31302,31302,30895,30623,30674,30812,
+31030,31050,31257,31687,31772,31828,32032,32002,
+31716,31632,31493,31493,31368,31368,31282,31254,
+31196,31196,31132,31132,31088,31084,31111,31111,
+31210,31210,31201,31176,31066,31066,30857,30857,
+30638,30561,30390,30390,30266,30266,30196,30167,
+30089,30089,29943,29943,29787,29721,29553,29553,
+29366,29366,29245,29202,29108,29108,28957,28957,
+28779,28713,28556,28556,28425,28425,28352,28329,
+28286,28286,28248,28248,28212,28188,28107,28107,
+27956,27956,27862,27834,27788,27788,27759,27759,
+27723,27717,27721,27721,27764,27764,27812,27831,
+27877,27877,27936,27936,27989,28009,28056,28056,
+28101,28101,28128,28137,28158,28158,28175,28175,
+28184,28187,28192,28192,28189,28189,28173,28165,
+28138,28138,28099,28099,28067,28053,28020,28020,
+27975,27975,27940,27927,27901,27901,27881,27881,
+27868,27863,27851,27851,27828,27828,27799,27790,
+27775,27775,27771,27771,27770,27768,27761,27761,
+27748,27748,27743,27742,27743,27743,27749,27749,
+27751,27750,27742,27742,27730,27730,27717,27713,
+27702,27702,27689,27689,27676,27671,27655,27655,
+27642,27642,27640,27640,27637,27637,27625,27625,
+27610,27604,27591,27591,27573,27573,27558,27552,
+27539,27539,27536,27536,27545,27549,27561,27561,
+27583,27583,27612,27626,27668,27668,27731,27731,
+27793,27816,27877,27877,27938,27938,27973,27984,
+28001,28001,28015,28015,28026,28027,28021,28021,
+27999,27999,27973,27962,27927,27927,27879,27879,
+27838,27824,27795,27795,27768,27768,27760,27760,
+27772,27772,27802,27802,27825,27834,27854,27854,
+27879,27879,27898,27905,27923,27923,27941,27941,
+27950,27953,27961,27961,27970,27970,27980,27985,
+27999,27999,28007,28007,28002,27999,27990,27990,
+27983,27983,27977,27973,27963,27963,27942,27942,
+27933,27932,27933,27933,27939,27939,27956,27962,
+27977,27977,27980,27980,27968,27962,27942,27942,
+27939,27939,27949,27952,27957,27957,27954,27954,
+27957,27960,27968,27968,27981,27981,28002,28013,
+28051,28051,28112,28112,28174,28203,28289,28289,
+28414,28414,28522,28563,28661,28661,28751,28751,
+28798,28811,28834,28834,28841,28841,28841,28840,
+28831,28831,28808,28808,28786,28777,28752,28752,
+28733,28733,28725,28723,28716,28716,28721,28721,
+28730,28733,28740,28740,28745,28745,28746,28746,
+28745,28745,28735,28735,28723,28719,28711,28711,
+28708,28708,28711,28713,28719,28719,28748,28748,
+28793,28813,28873,28873,28939,28939,28988,29007,
+29051,29051,29104,29104,29148,29168,29223,29223,
+29310,29310,29379,29404,29461,29461,29518,29518,
+29565,29586,29641,29641,29706,29706,29749,29763,
+29797,29797,29826,29826,29844,29849,29854,29854,
+29849,29849,29847,29849,29860,29860,29879,29879,
+29891,29894,29900,29900,29880,29880,29849,29835,
+29797,29797,29757,29757,29743,29742,29749,29749,
+29781,29781,29821,29839,29889,29889,29981,29981,
+30071,30107,30197,30197,30299,30299,30366,30390,
+30442,30442,30490,30490,30522,30535,30562,30562,
+30591,30591,30618,30629,30658,30658,30690,30690,
+30720,30733,30769,30769,30819,30819,30861,30876,
+30908,30908,30936,30936,30963,30974,31005,31005,
+31019,31019,31053,31069,31115,31115,31095,31095,
+31037,31017,30978,30978,30942,30942,30916,30911,
+30912,30912,30950,30950,31003,31024,31079,31079,
+31331,31331,31402,31429,31498,31498,31587,31587,
+31658,31681,31730,31730,31757,31757,31759,31756,
+31737,31737,31694,31694,31654,31641,31620,31620,
+31605,31605,31584,31574,31545,31545,31515,31515,
+31504,31502,31505,31505,31528,31528,31558,31568,
+31588,31588,31598,31598,31605,31605,31599,31599,
+31568,31568,31551,31545,31525,31525,31511,31511,
+31515,31514,31504,31504,31467,31467,31431,31420,
+31400,31400,31378,31378,31349,31341,31329,31329,
+31316,31316,31288,31279,31264,31264,31227,31227,
+31173,31157,31131,31131,31103,31103,31102,31105,
+31122,31122,31128,31128,31121,31113,31085,31085,
+31081,31081,31082,31083,31088,31088,31101,31101,
+31123,31132,31155,31155,31116,31116,31065,31043,
+30979,30979,30931,30931,30918,30909,30878,30878,
+30819,30819,30783,30771,30749,30749,30754,30754,
+30780,30791,30818,30818,30847,30847,30874,30885,
+30916,30916,30931,30931,30928,30928,30933,30933,
+30950,30950,30953,30951,30940,30940,30927,30927,
+30915,30907,30881,30881,30841,30841,30819,30812,
+30798,30798,30787,30787,30780,30774,30753,30753,
+30712,30712,30694,30690,30690,30690,30722,30722,
+30779,30799,30843,30843,30877,30877,30863,30849,
+30795,30795,30799,30799,30858,30877,30909,30909,
+30920,30920,30952,30970,31034,31034,31132,31132,
+31220,31259,31370,31370,31529,31529,31578,31577,
+31524,31524,31449,31449,30836,30721,30997,31352,
+31321,31237,31390,31846,31925,31887,32049,32049,
+31913,31863,31747,31747,31657,31657,31587,31561,
+31502,31502,31432,31432,31381,31372,31380,29357,
+31446,28937,28945,31381,31254,31254,31029,31029,
+30800,30719,30546,30546,30423,30423,30362,30338,
+30279,30279,30147,30147,29992,29929,29770,29770,
+29593,29593,29492,29460,29399,29399,29277,29277,
+29116,29052,28899,28899,28756,28756,28649,28611,
+28524,28524,28470,28470,28447,28424,28336,28336,
+28144,28144,28039,28011,27977,27977,27985,27985,
+27970,27970,27986,27986,28035,28035,28082,28098,
+28139,28139,28189,28189,28237,28256,28301,28301,
+28345,28345,28371,28380,28398,28398,28417,28417,
+28425,28428,28431,28431,28427,28427,28414,28406,
+28385,28385,28346,28346,28311,28298,28264,28264,
+28216,28216,28180,28168,28141,28141,28125,28125,
+28117,28114,28109,28109,28093,28093,28075,28071,
+28067,28067,28070,28070,28074,28074,28067,28067,
+28047,28047,28036,28034,28033,28033,28035,28035,
+28031,28028,28016,28016,28001,28001,27984,27977,
+27964,27964,27950,27950,27940,27936,27929,27929,
+27920,27920,27913,27911,27905,27905,27888,27888,
+27869,27860,27838,27838,27813,27813,27795,27788,
+27772,27772,27764,27764,27765,27766,27771,27771,
+27785,27785,27807,27820,27859,27859,27925,27925,
+27989,28014,28075,28075,28136,28136,28169,28177,
+28188,28188,28195,28195,28198,28196,28183,28183,
+28157,28157,28131,28119,28085,28085,28040,28040,
+28005,27993,27967,27967,27944,27944,27936,27937,
+27948,27948,27969,27969,27986,27992,28007,28007,
+28025,28025,28042,28049,28065,28065,28083,28083,
+28091,28095,28105,28105,28126,28126,28145,28153,
+28171,28171,28175,28175,28166,28160,28142,28142,
+28125,28125,28116,28112,28103,28103,28090,28090,
+28086,28087,28093,28093,28099,28099,28111,28117,
+28132,28132,28138,28138,28127,28119,28095,28095,
+28093,28093,28119,28130,28160,28160,28194,28194,
+28224,28234,28254,28254,28269,28269,28290,28299,
+28330,28330,28372,28372,28426,28456,28547,28547,
+28688,28688,28803,28845,28945,28945,29034,29034,
+29082,29097,29127,29127,29144,29144,29147,29146,
+29137,29137,29109,29109,29078,29064,29029,29029,
+28995,28995,28980,28976,28968,28968,28965,28965,
+28963,28964,28969,28969,28979,28979,28984,28986,
+28992,28992,28985,28985,28975,28972,28966,28966,
+28967,28967,28973,28976,28986,28986,29015,29015,
+29061,29082,29136,29136,29199,29199,29248,29268,
+29318,29318,29377,29377,29423,29442,29497,29497,
+29580,29580,29650,29675,29737,29737,29801,29801,
+29857,29881,29940,29940,30007,30007,30057,30075,
+30113,30113,30145,30145,30165,30171,30178,30178,
+30178,30178,30177,30178,30183,30183,30191,30191,
+30200,30204,30215,30215,30209,30209,30192,30183,
+30155,30155,30127,30127,30118,30119,30131,30131,
+30169,30169,30213,30231,30283,30283,30365,30365,
+30444,30475,30552,30552,30643,30643,30708,30730,
+30780,30780,30817,30817,30833,30840,30857,30857,
+30887,30887,30915,30926,30958,30958,30991,30991,
+31013,31024,31053,31053,31101,31101,31135,31145,
+31160,31160,31150,31150,31129,31124,31122,31122,
+31133,31133,31161,31174,31212,31212,31203,31203,
+31172,31162,31144,31144,31118,31118,31096,31093,
+31098,31098,31132,31132,31177,31197,31250,31250,
+31411,31411,31482,31509,31569,31569,31668,31668,
+31761,31793,31851,31851,31874,31874,31875,31871,
+31856,31856,31814,31814,31773,31761,31743,31743,
+31735,31735,31715,31704,31670,31670,31632,31632,
+31616,31613,31615,31615,31643,31643,31676,31688,
+31713,31713,31729,31729,31741,31743,31737,31737,
+31704,31704,31681,31672,31645,31645,31631,31631,
+31637,31637,31626,31626,31587,31587,31551,31542,
+31523,31523,31502,31502,31472,31464,31449,31449,
+31436,31436,31408,31399,31382,31382,31341,31341,
+31289,31273,31248,31248,31225,31225,31222,31224,
+31233,31233,31234,31234,31225,31217,31186,31186,
+31166,31166,31156,31153,31149,31149,31159,31159,
+31180,31188,31203,31203,31161,31161,31111,31090,
+31029,31029,30984,30984,30971,30964,30936,30936,
+30883,30883,30846,30834,30810,30810,30816,30816,
+30847,30859,30888,30888,30911,30911,30935,30946,
+30976,30976,30992,30992,30989,30989,30994,30994,
+31011,31011,31015,31013,31002,31002,30992,30992,
+30986,30979,30953,30953,30905,30905,30881,30874,
+30863,30863,30854,30854,30848,30842,30823,30823,
+30785,30785,30769,30766,30768,30768,30796,30796,
+30842,30859,30897,30897,30928,30928,30920,30910,
+30866,30866,30874,30874,30927,30945,30978,30978,
+30999,30999,31033,31052,31112,31112,31207,31207,
+31295,31335,31449,31449,31617,31617,31665,31662,
+31596,31596,31288,31496,30299,30088,30706,31335,
+31968,32081,32036,32081,32163,32336,32069,32069,
+31987,31950,31850,31850,31775,31775,31711,31685,
+31624,31624,31549,31549,31492,31479,31475,31475,
+31520,31520,31474,31438,31305,31305,31079,31079,
+30853,30775,30605,30605,30488,30488,30433,30414,
+30368,30368,30246,30246,30093,30032,29877,29877,
+29702,29702,29605,29575,29522,29522,29411,29411,
+29256,29195,29046,29046,28901,28901,28779,28733,
+28620,28620,28558,28558,28546,28525,28438,28438,
+28235,28235,28126,28098,28068,28068,28090,28090,
+28087,28090,28109,28109,28156,28156,28201,28216,
+28255,28255,28301,28301,28346,28365,28410,28410,
+28453,28453,28477,28486,28504,28504,28522,28522,
+28531,28533,28537,28537,28534,28534,28520,28513,
+28494,28494,28455,28455,28419,28405,28372,28372,
+28323,28323,28287,28274,28249,28249,28233,28233,
+28227,28225,28223,28223,28213,28213,28200,28198,
+28198,28198,28205,28205,28210,28210,28202,28202,
+28179,28179,28167,28164,28161,28161,28161,28161,
+28154,28150,28136,28136,28119,28119,28100,28094,
+28080,28080,28066,28066,28058,28056,28051,28051,
+28044,28044,28036,28033,28027,28027,28008,28008,
+27985,27975,27950,27950,27923,27923,27902,27895,
+27879,27879,27869,27869,27867,27867,27869,27869,
+27879,27879,27899,27911,27950,27950,28017,28017,
+28080,28105,28166,28166,28226,28226,28257,28265,
+28272,28272,28273,28273,28272,28269,28254,28254,
+28226,28226,28200,28188,28155,28155,28112,28112,
+28080,28069,28045,28045,28022,28022,28015,28016,
+28026,28026,28045,28045,28057,28062,28075,28075,
+28090,28090,28105,28111,28128,28128,28144,28144,
+28153,28158,28169,28169,28195,28195,28221,28231,
+28257,28257,28261,28261,28245,28236,28214,28214,
+28193,28193,28182,28178,28168,28168,28157,28157,
+28156,28157,28164,28164,28167,28167,28175,28180,
+28195,28195,28202,28202,28187,28179,28154,28154,
+28153,28153,28185,28201,28247,28247,28300,28300,
+28343,28358,28384,28384,28400,28400,28422,28431,
+28460,28460,28494,28494,28539,28566,28658,28658,
+28807,28807,28925,28969,29069,29069,29156,29156,
+29201,29216,29249,29249,29276,29276,29282,29282,
+29272,29272,29238,29238,29202,29187,29146,29146,
+29100,29100,29085,29081,29077,29077,29068,29068,
+29058,29057,29061,29061,29075,29075,29087,29091,
+29105,29105,29100,29100,29087,29082,29076,29076,
+29082,29082,29090,29093,29103,29103,29134,29134,
+29180,29200,29253,29253,29310,29310,29359,29380,
+29435,29435,29497,29497,29543,29563,29616,29616,
+29697,29697,29765,29792,29854,29854,29923,29923,
+29983,30007,30069,30069,30136,30136,30188,30207,
+30246,30246,30279,30279,30299,30304,30313,30313,
+30315,30315,30313,30314,30316,30316,30318,30318,
+30326,30330,30342,30342,30344,30344,30334,30326,
+30302,30302,30281,30281,30275,30276,30290,30290,
+30328,30328,30373,30392,30443,30443,30521,30521,
+30594,30624,30695,30695,30781,30781,30845,30869,
+30924,30924,30953,30953,30954,30956,30967,30967,
+31001,31001,31031,31044,31078,31078,31110,31110,
+31127,31135,31164,31164,31218,31218,31254,31262,
+31272,31272,31241,31241,31188,31174,31154,31154,
+31168,31168,31191,31200,31226,31226,31224,31224,
+31215,31212,31208,31208,31190,31190,31174,31173,
+31180,31180,31213,31213,31250,31268,31320,31320,
+31645,31645,31709,31722,31730,31730,31860,31860,
+32051,32107,32196,32196,32179,32179,32171,32169,
+32168,32168,32132,32132,32085,32074,32063,32063,
+32083,32083,32064,32049,31994,31994,31927,31927,
+31880,31870,31866,31866,31914,31914,31957,31972,
+32008,32008,32049,32049,32086,32092,32092,32092,
+32048,32048,32002,31981,31926,31926,31898,31898,
+31910,31909,31895,31895,31843,31843,31820,31814,
+31808,31808,31789,31789,31760,31750,31727,31727,
+31716,31716,31701,31694,31672,31672,31630,31630,
+31581,31565,31535,31535,31527,31527,31515,31508,
+31485,31485,31466,31466,31459,31451,31422,31422,
+31362,31362,31321,31307,31279,31279,31276,31276,
+31296,31295,31275,31275,31240,31240,31202,31187,
+31149,31149,31111,31111,31086,31080,31073,31073,
+31048,31048,31014,31005,30991,30991,31007,31007,
+31049,31064,31098,31098,31091,31091,31098,31105,
+31129,31129,31140,31140,31139,31140,31145,31145,
+31159,31159,31162,31160,31147,31147,31150,31150,
+31166,31164,31138,31138,31068,31068,31038,31031,
+31027,31027,31027,31027,31023,31020,31009,31009,
+30986,30986,30982,30984,30996,30996,31006,31006,
+31013,31016,31024,31024,31032,31032,31045,31050,
+31067,31067,31089,31089,31108,31119,31154,31154,
+31215,31215,31254,31269,31305,31305,31388,31388,
+31479,31521,31643,31643,31821,31821,31870,31865,
+31792,31792,31401,30892,29989,29458,30424,31180,
+32027,32141,32245,32184,32180,32375,32119,32119,
+32156,32156,32120,32120,32085,32085,32030,32005,
+31927,31927,31829,31829,31752,31726,31674,31674,
+31636,31636,31546,31498,31351,31351,31141,31141,
+30951,30885,30750,30750,30658,30658,30635,30632,
+30636,30636,30556,30556,30421,30364,30216,30216,
+30038,30038,29940,29911,29861,29861,29763,29763,
+29632,29581,29450,29450,29317,29317,29150,29075,
+28867,28867,28773,28773,28807,28801,28735,28735,
+28517,28517,28401,28373,28345,28345,28404,28404,
+28440,28453,28478,28478,28511,28511,28544,28555,
+28583,28583,28623,28623,28666,28682,28723,28723,
+28757,28757,28779,28787,28803,28803,28817,28817,
+28827,28830,28839,28839,28839,28839,28828,28822,
+28806,28806,28767,28767,28725,28711,28675,28675,
+28629,28629,28591,28580,28557,28557,28547,28547,
+28546,28547,28552,28552,28561,28561,28566,28570,
+28581,28581,28596,28596,28603,28602,28591,28591,
+28562,28562,28545,28539,28527,28527,28516,28516,
+28502,28495,28477,28477,28455,28455,28433,28426,
+28413,28413,28405,28405,28405,28405,28409,28409,
+28405,28405,28397,28394,28385,28385,28361,28361,
+28329,28316,28284,28284,28250,28250,28224,28215,
+28195,28195,28179,28179,28172,28169,28164,28164,
+28164,28164,28176,28187,28226,28226,28295,28295,
+28355,28380,28437,28437,28494,28494,28519,28523,
+28520,28520,28498,28498,28479,28472,28453,28453,
+28428,28428,28401,28389,28357,28357,28323,28323,
+28298,28289,28268,28268,28252,28252,28244,28244,
+28252,28252,28262,28262,28264,28264,28264,28264,
+28270,28270,28283,28289,28305,28305,28319,28319,
+28330,28335,28350,28350,28393,28393,28448,28471,
+28533,28533,28542,28542,28492,28474,28433,28433,
+28406,28406,28388,28381,28365,28365,28357,28357,
+28365,28366,28367,28367,28349,28349,28346,28348,
+28364,28364,28362,28362,28334,28322,28295,28295,
+28297,28297,28352,28383,28485,28485,28605,28605,
+28694,28722,28775,28775,28793,28793,28813,28823,
+28851,28851,28863,28863,28866,28882,28965,28965,
+29144,29144,29275,29322,29424,29424,29499,29499,
+29524,29537,29579,29579,29647,29647,29666,29667,
+29654,29654,29595,29595,29545,29523,29463,29463,
+29371,29371,29360,29361,29378,29378,29357,29357,
+29311,29300,29295,29295,29328,29328,29370,29388,
+29442,29442,29445,29445,29401,29389,29377,29377,
+29402,29402,29421,29427,29444,29444,29478,29478,
+29523,29541,29583,29583,29618,29618,29665,29690,
+29771,29771,29841,29841,29888,29907,29954,29954,
+30023,30023,30086,30111,30175,30175,30256,30256,
+30332,30361,30431,30431,30496,30496,30544,30562,
+30603,30603,30637,30637,30654,30660,30672,30672,
+30675,30675,30671,30669,30663,30663,30651,30651,
+30650,30654,30673,30673,30698,30698,30703,30703,
+30695,30695,30691,30691,30695,30698,30712,30712,
+30747,30747,30792,30810,30857,30857,30924,30924,
+30983,31006,31056,31056,31129,31129,31199,31230,
+31317,31317,31313,31313,31252,31236,31221,31221,
+31268,31268,31313,31333,31384,31384,31409,31409,
+31397,31400,31431,31431,31531,31531,31580,31591,
+31596,31596,31495,31495,31997,31263,31185,31185,
+31219,31219,31219,31213,31179,31179,31207,31207,
+31285,31310,31358,31358,31378,31378,31386,31393,
+31417,31417,31442,31442,31446,31457,31510,31510,
+31645,31645,31709,31722,31730,31730,31860,31860,
+32051,32107,32196,32196,32179,32179,32171,32169,
+32168,32168,32132,32132,32085,32074,32063,32063,
+32083,32083,32064,32049,31994,31994,31927,31927,
+31880,31870,31866,31866,31914,31914,31957,31972,
+32008,32008,32049,32049,32086,32092,32092,32092,
+32048,32048,32002,31981,31926,31926,31898,31898,
+31910,31909,31895,31895,31843,31843,31820,31814,
+31808,31808,31789,31789,31760,31750,31727,31727,
+31716,31716,31701,31694,31672,31672,31630,31630,
+31581,31565,31535,31535,31527,31527,31515,31508,
+31485,31485,31466,31466,31459,31451,31422,31422,
+31362,31362,31321,31307,31279,31279,31276,31276,
+31296,31295,31275,31275,31240,31240,31202,31187,
+31149,31149,31111,31111,31086,31080,31073,31073,
+31048,31048,31014,31005,30991,30991,31007,31007,
+31049,31064,31098,31098,31091,31091,31098,31105,
+31129,31129,31140,31140,31139,31140,31145,31145,
+31159,31159,31162,31160,31147,31147,31150,31150,
+31166,31164,31138,31138,31068,31068,31038,31031,
+31027,31027,31027,31027,31023,31020,31009,31009,
+30986,30986,30982,30984,30996,30996,31006,31006,
+31013,31016,31024,31024,31032,31032,31045,31050,
+31067,31067,31089,31089,31108,31119,31154,31154,
+31215,31215,31254,31269,31305,31305,31388,31388,
+31479,31521,31643,31643,31821,31821,31870,31865,
+31792,31792,31576,30761,26575,29165,30409,31556,
+32130,32240,32639,32750,32890,33233,32119,32119,
+32156,32156,32120,32120,32085,32085,32030,32005,
+31927,31927,31829,31829,31752,31726,31674,31674,
+31636,31636,31546,31498,31351,31351,31141,31141,
+30951,30885,30750,30750,30658,30658,30635,30632,
+30636,30636,30556,30556,30421,30364,30216,30216,
+30038,30038,29940,29911,29861,29861,29763,29763,
+29632,29581,29450,29450,29317,29317,29150,29075,
+28867,28867,28773,28773,28807,28801,28735,28735,
+28517,28517,28401,28373,28345,28345,28404,28404,
+28440,28453,28478,28478,28511,28511,28544,28555,
+28583,28583,28623,28623,28666,28682,28723,28723,
+28757,28757,28779,28787,28803,28803,28817,28817,
+28827,28830,28839,28839,28839,28839,28828,28822,
+28806,28806,28767,28767,28725,28711,28675,28675,
+28629,28629,28591,28580,28557,28557,28547,28547,
+28546,28547,28552,28552,28561,28561,28566,28570,
+28581,28581,28596,28596,28603,28602,28591,28591,
+28562,28562,28545,28539,28527,28527,28516,28516,
+28502,28495,28477,28477,28455,28455,28433,28426,
+28413,28413,28405,28405,28405,28405,28409,28409,
+28405,28405,28397,28394,28385,28385,28361,28361,
+28329,28316,28284,28284,28250,28250,28224,28215,
+28195,28195,28179,28179,28172,28169,28164,28164,
+28164,28164,28176,28187,28226,28226,28295,28295,
+28355,28380,28437,28437,28494,28494,28519,28523,
+28520,28520,28498,28498,28479,28472,28453,28453,
+28428,28428,28401,28389,28357,28357,28323,28323,
+28298,28289,28268,28268,28252,28252,28244,28244,
+28252,28252,28262,28262,28264,28264,28264,28264,
+28270,28270,28283,28289,28305,28305,28319,28319,
+28330,28335,28350,28350,28393,28393,28448,28471,
+28533,28533,28542,28542,28492,28474,28433,28433,
+28406,28406,28388,28381,28365,28365,28357,28357,
+28365,28366,28367,28367,28349,28349,28346,28348,
+28364,28364,28362,28362,28334,28322,28295,28295,
+28297,28297,28352,28383,28485,28485,28605,28605,
+28694,28722,28775,28775,28793,28793,28813,28823,
+28851,28851,28863,28863,28866,28882,28965,28965,
+29144,29144,29275,29322,29424,29424,29499,29499,
+29524,29537,29579,29579,29647,29647,29666,29667,
+29654,29654,29595,29595,29545,29523,29463,29463,
+29371,29371,29360,29361,29378,29378,29357,29357,
+29311,29300,29295,29295,29328,29328,29370,29388,
+29442,29442,29445,29445,29401,29389,29377,29377,
+29402,29402,29421,29427,29444,29444,29478,29478,
+29523,29541,29583,29583,29618,29618,29665,29690,
+29771,29771,29841,29841,29888,29907,29954,29954,
+30023,30023,30086,30111,30175,30175,30256,30256,
+30332,30361,30431,30431,30496,30496,30544,30562,
+30603,30603,30637,30637,30654,30660,30672,30672,
+30675,30675,30671,30669,30663,30663,30651,30651,
+30650,30654,30673,30673,30698,30698,30703,30703,
+30695,30695,30691,30691,30695,30698,30712,30712,
+30747,30747,30792,30810,30857,30857,30924,30924,
+30983,31006,31056,31056,31129,31129,31199,31230,
+31317,31317,31313,31313,31252,31236,31221,31221,
+31268,31268,31313,31333,31384,31384,31409,31409,
+31397,31400,31431,31431,31531,31531,31580,31591,
+31596,31596,31495,31495,31315,31263,31185,31185,
+31219,31219,31219,31213,31179,31179,31207,31207,
+31285,31310,31358,31358,31378,31378,31386,31393,
+31417,31417,31442,31442,31446,31457,31510,31510,
+31918,31918,31988,32007,32027,32027,32184,32184,
+32395,32456,32545,32545,32510,32510,32500,32500,
+32513,32513,32483,32483,32428,32413,32387,32387,
+32382,32382,32350,32333,32275,32275,32203,32203,
+32151,32140,32140,32140,32204,32204,32255,32271,
+32306,32306,32344,32344,32372,32377,32371,32371,
+32325,32325,32273,32251,32188,32188,32155,32155,
+32167,32166,32150,32150,32094,32094,32082,32082,
+32096,32096,32083,32083,32047,32035,32014,32014,
+32018,32018,32020,32020,32018,32018,31970,31970,
+31895,31872,31828,31828,31816,31816,31797,31786,
+31751,31751,31709,31709,31676,31664,31628,31628,
+31582,31582,31539,31521,31476,31476,31446,31446,
+31434,31424,31388,31388,31367,31367,31341,31330,
+31305,31305,31278,31278,31252,31246,31243,31243,
+31235,31235,31216,31211,31207,31207,31227,31227,
+31265,31278,31308,31308,31297,31297,31299,31301,
+31316,31316,31324,31324,31325,31325,31327,31327,
+31330,31330,31325,31321,31309,31309,31318,31318,
+31341,31341,31323,31323,31258,31258,31234,31231,
+31238,31238,31245,31245,31245,31245,31242,31242,
+31233,31233,31237,31241,31253,31253,31251,31251,
+31239,31236,31231,31231,31230,31230,31250,31259,
+31292,31292,31311,31311,31313,31320,31351,31351,
+31421,31421,31453,31462,31473,31473,31549,31549,
+31657,31703,31821,31821,31981,31981,32046,32053,
+32028,31251,31474,30566,28871,26575,29706,31370,
+32088,32201,32914,34114,34153,34285,34842,34717,
+34591,32289,32391,32391,32390,32390,32363,32344,
+32283,32283,32172,32172,32059,32015,31907,31907,
+31795,31795,31667,31613,31471,31471,31297,31297,
+31152,31109,31038,31038,31020,31020,31048,31063,
+31117,31117,31089,31089,30988,30944,30829,30829,
+30679,30679,30583,30549,30480,30480,30348,30348,
+30186,30124,29973,29973,29828,29828,29655,29578,
+29365,29365,29250,29250,29264,29260,29226,29226,
+29095,29095,29014,28992,28958,28958,29003,29003,
+29021,29025,29025,29025,29023,29023,29031,29034,
+29045,29045,29069,29069,29101,29114,29144,29144,
+29167,29167,29186,29193,29208,29208,29218,29218,
+29233,29239,29256,29256,29261,29261,29253,29248,
+29230,29230,29192,29192,29148,29132,29093,29093,
+29049,29049,29014,29003,28976,28976,28965,28965,
+28971,28978,29002,29002,29034,29034,29058,29069,
+29095,29095,29122,29122,29130,29128,29111,29111,
+29073,29073,29045,29034,29008,29008,28985,28985,
+28969,28962,28937,28937,28905,28905,28883,28878,
+28869,28869,28874,28874,28883,28888,28904,28904,
+28909,28909,28903,28900,28891,28891,28859,28859,
+28819,28803,28765,28765,28726,28726,28698,28688,
+28667,28667,28652,28652,28645,28642,28635,28635,
+28624,28624,28623,28629,28659,28659,28724,28724,
+28779,28800,28852,28852,28901,28901,28913,28910,
+28885,28885,28832,28832,28790,28776,28746,28746,
+28713,28713,28679,28668,28640,28640,28622,28622,
+28605,28599,28585,28585,28571,28571,28560,28557,
+28554,28554,28550,28550,28537,28530,28514,28514,
+28505,28505,28510,28514,28528,28528,28544,28544,
+28551,28556,28574,28574,28636,28636,28724,28759,
+28848,28848,28870,28870,28820,28801,28756,28756,
+28722,28722,28687,28673,28632,28632,28606,28606,
+28606,28601,28578,28578,28503,28503,28474,28470,
+28480,28480,28496,28496,28502,28503,28506,28506,
+28545,28545,28635,28682,28821,28821,28992,28992,
+29118,29161,29250,29250,29306,29306,29344,29359,
+29393,29393,29388,29388,29356,29365,29441,29441,
+29651,29651,29779,29819,29893,29893,29937,29937,
+29936,29944,29986,29986,30081,30081,30104,30104,
+30080,30080,30012,30012,29958,29936,29882,29882,
+29806,29806,29799,29801,29817,29817,29772,29772,
+29693,29672,29642,29642,29668,29668,29726,29755,
+29839,29839,29851,29851,29795,29782,29776,29776,
+29835,29835,29881,29897,29933,29933,29979,29979,
+30017,30034,30079,30079,30126,30126,30172,30194,
+30257,30257,30306,30306,30337,30348,30380,30380,
+30434,30434,30490,30513,30579,30579,30670,30670,
+30757,30792,30874,30874,30946,30946,30986,31001,
+31030,31030,31057,31057,31070,31075,31084,31084,
+31085,31085,31075,31070,31054,31054,31034,31034,
+31029,31031,31049,31049,31088,31088,31110,31116,
+31123,31123,31133,31133,31151,31159,31180,31180,
+31211,31211,31248,31264,31305,31305,31361,31361,
+31406,31422,31453,31453,31495,31495,31547,31570,
+31637,31637,31602,31602,31520,31499,31474,31474,
+31530,31530,31583,31604,31657,31657,31682,31682,
+31670,31672,31695,31695,31782,31782,31828,31839,
+31847,31847,31738,31738,31548,31487,31377,31377,
+31346,31346,31325,31319,31309,31309,31342,31342,
+31402,31426,31493,31493,31578,31578,31618,31633,
+31668,31668,31700,31700,31708,31720,31776,31776,
+31918,31918,31988,32007,32027,32027,32184,32184,
+32395,32456,32545,32545,32510,32510,32500,32500,
+32513,32513,32483,32483,32428,32413,32387,32387,
+32382,32382,32350,32333,32275,32275,32203,32203,
+32151,32140,32140,32140,32204,32204,32255,32271,
+32306,32306,32344,32344,32372,32377,32371,32371,
+32325,32325,32273,32251,32188,32188,32155,32155,
+32167,32166,32150,32150,32094,32094,32082,32082,
+32096,32096,32083,32083,32047,32035,32014,32014,
+32018,32018,32020,32020,32018,32018,31970,31970,
+31895,31872,31828,31828,31816,31816,31797,31786,
+31751,31751,31709,31709,31676,31664,31628,31628,
+31582,31582,31539,31521,31476,31476,31446,31446,
+31434,31424,31388,31388,31367,31367,31341,31330,
+31305,31305,31278,31278,31252,31246,31243,31243,
+31235,31235,31216,31211,31207,31207,31227,31227,
+31265,31278,31308,31308,31297,31297,31299,31301,
+31316,31316,31324,31324,31325,31325,31327,31327,
+31330,31330,31325,31321,31309,31309,31318,31318,
+31341,31341,31323,31323,31258,31258,31234,31231,
+31238,31238,31245,31245,31245,31245,31242,31242,
+31233,31233,31237,31241,31253,31253,31251,31251,
+31239,31236,31231,31231,31230,31230,31250,31259,
+31292,31292,31311,31311,31313,31320,31351,31351,
+31421,31421,31453,31462,31473,31473,31549,31549,
+31657,31703,31821,31821,31981,31981,32046,32053,
+32028,31226,31313,30400,26575,26575,29418,31335,
+31957,32280,33271,34506,34298,34233,34919,35098,
+35092,32289,32391,32391,32390,32390,32363,32344,
+32283,32283,32172,32172,32059,32015,31907,31907,
+31795,31795,31667,31613,31471,31471,31297,31297,
+31152,31109,31038,31038,31020,31020,31048,31063,
+31117,31117,31089,31089,30988,30944,30829,30829,
+30679,30679,30583,30549,30480,30480,30348,30348,
+30186,30124,29973,29973,29828,29828,29655,29578,
+29365,29365,29250,29250,29264,29260,29226,29226,
+29095,29095,29014,28992,28958,28958,29003,29003,
+29021,29025,29025,29025,29023,29023,29031,29034,
+29045,29045,29069,29069,29101,29114,29144,29144,
+29167,29167,29186,29193,29208,29208,29218,29218,
+29233,29239,29256,29256,29261,29261,29253,29248,
+29230,29230,29192,29192,29148,29132,29093,29093,
+29049,29049,29014,29003,28976,28976,28965,28965,
+28971,28978,29002,29002,29034,29034,29058,29069,
+29095,29095,29122,29122,29130,29128,29111,29111,
+29073,29073,29045,29034,29008,29008,28985,28985,
+28969,28962,28937,28937,28905,28905,28883,28878,
+28869,28869,28874,28874,28883,28888,28904,28904,
+28909,28909,28903,28900,28891,28891,28859,28859,
+28819,28803,28765,28765,28726,28726,28698,28688,
+28667,28667,28652,28652,28645,28642,28635,28635,
+28624,28624,28623,28629,28659,28659,28724,28724,
+28779,28800,28852,28852,28901,28901,28913,28910,
+28885,28885,28832,28832,28790,28776,28746,28746,
+28713,28713,28679,28668,28640,28640,28622,28622,
+28605,28599,28585,28585,28571,28571,28560,28557,
+28554,28554,28550,28550,28537,28530,28514,28514,
+28505,28505,28510,28514,28528,28528,28544,28544,
+28551,28556,28574,28574,28636,28636,28724,28759,
+28848,28848,28870,28870,28820,28801,28756,28756,
+28722,28722,28687,28673,28632,28632,28606,28606,
+28606,28601,28578,28578,28503,28503,28474,28470,
+28480,28480,28763,29105,28340,28503,28506,28506,
+28545,28545,28635,28682,28821,28821,28992,28992,
+29118,29161,29250,29250,29306,29306,29344,29359,
+29393,29393,29388,29388,29356,29365,29441,29441,
+29651,29651,29779,29819,29893,29893,29937,29937,
+29936,29944,29986,29986,30081,30081,30104,30104,
+30080,30080,30012,30012,29958,29936,29882,29882,
+29806,29806,29799,29801,29817,29817,29772,29772,
+29693,29672,29642,29642,29668,29668,29726,29755,
+29839,29839,29851,29851,29795,29782,29776,29776,
+29835,29835,29881,29897,29933,29933,29979,29979,
+30017,30034,30079,30079,30126,30126,30172,30194,
+30257,30257,30306,30306,30337,30348,30380,30380,
+30434,30434,30490,30513,30579,30579,30670,30670,
+30757,30792,30874,30874,30946,30946,30986,31001,
+31030,31030,31057,31057,31070,31075,31084,31084,
+31085,31085,31075,31070,31054,31054,31034,31034,
+31029,31031,31049,31049,31088,31088,31110,31116,
+31123,31123,31133,31133,31151,31159,31180,31180,
+31211,31211,31248,31264,31305,31305,31361,31361,
+31406,31422,31453,31453,31495,31495,31547,31570,
+31637,31637,31602,31602,31520,31499,31474,31474,
+31530,31530,31583,31604,31657,31657,31682,31682,
+31670,31672,31695,31695,31782,31782,31828,31839,
+31847,31847,31738,31738,31548,31487,31377,31377,
+31346,31346,31325,31319,31309,31309,31342,31342,
+31402,31426,31493,31493,31578,31578,31618,31633,
+31668,31668,31700,31700,31708,31720,31776,31776,
+32195,32195,32277,32306,32374,32374,32534,32534,
+32695,32739,32798,32798,32758,32758,32753,32757,
+32784,32784,32759,32759,32696,32673,32617,32617,
+32549,32549,32503,32486,32450,32450,32402,32402,
+32370,32365,32374,32374,32440,32440,32483,32494,
+32507,32507,32511,32511,32506,32502,32489,32489,
+32467,32467,32433,32417,32365,32365,32339,32339,
+32351,32350,32337,32337,32286,32286,32276,32277,
+32295,32295,32285,32285,32251,32242,32231,32231,
+32258,32258,32273,32277,32282,32282,32225,32225,
+32129,32096,32034,32034,32001,32001,31977,31967,
+31944,31944,31886,31886,31841,31824,31779,31779,
+31722,31722,31683,31670,31639,31639,31609,31609,
+31589,31580,31553,31553,31525,31525,31496,31485,
+31457,31457,31445,31445,31423,31416,31404,31404,
+31397,31397,31395,31396,31406,31406,31419,31419,
+31449,31461,31489,31489,31505,31505,31512,31516,
+31523,31523,31525,31525,31525,31524,31519,31519,
+31505,31505,31492,31487,31479,31479,31482,31482,
+31490,31488,31472,31472,31436,31436,31424,31424,
+31432,31432,31443,31443,31446,31446,31444,31444,
+31438,31438,31439,31439,31439,31439,31429,31429,
+31425,31425,31428,31428,31432,31432,31445,31451,
+31468,31468,31476,31476,31487,31494,31519,31519,
+31567,31567,31582,31584,31578,31578,31659,31659,
+31796,31845,31959,31959,32075,32075,32155,32178,
+32215,31367,31267,30411,26575,26575,29809,31061,
+31291,31785,32847,33684,33400,33496,34788,35198,
+35415,32444,32490,32490,32609,32609,32612,32608,
+32587,32587,32481,32481,32331,32270,32120,32120,
+31972,31972,31842,31795,31684,31684,31551,31551,
+31435,31408,31386,31386,31439,31439,31498,31523,
+31590,31590,31583,31583,31507,31475,31392,31392,
+31291,31291,31201,31164,31070,31070,30879,30879,
+30654,30570,30376,30376,30196,30196,30057,30005,
+29882,29882,29771,29771,29715,29703,29698,29698,
+29640,29640,29585,29566,29532,29532,29534,29534,
+29531,29527,29507,29507,29487,29487,29478,29475,
+29470,29470,29479,29479,29495,29503,29525,29525,
+29546,29546,29560,29565,29580,29580,29591,29591,
+29607,29614,29629,29629,29637,29637,29629,29622,
+29599,29599,29558,29558,29513,29497,29457,29457,
+29415,29415,29382,29372,29345,29345,29338,29338,
+29355,29365,29398,29398,29443,29443,29482,29498,
+29536,29536,29563,29563,29571,29570,29554,29554,
+29507,29507,29466,29452,29419,29419,29391,29391,
+29369,29358,29326,29326,29290,29290,29272,29268,
+29266,29266,29282,29282,29302,29311,29337,29337,
+29351,29351,29347,29343,29327,29327,29286,29286,
+29245,29228,29190,29190,29158,29158,29135,29128,
+29109,29109,29099,29099,29100,29099,29095,29095,
+29082,29082,29074,29076,29094,29094,29148,29148,
+29197,29216,29262,29262,29303,29303,29303,29296,
+29258,29258,29183,29183,29120,29097,29047,29047,
+28998,28998,28958,28944,28919,28919,28907,28907,
+28897,28893,28880,28880,28859,28859,28841,28835,
+28823,28823,28809,28809,28789,28779,28752,28752,
+28724,28724,28716,28714,28716,28716,28723,28723,
+28728,28734,28757,28757,28837,28837,28942,28982,
+29080,29080,29117,29117,29099,29091,29066,29066,
+29046,29046,29002,28980,28917,28917,28862,28862,
+28841,28824,28757,28757,28607,28607,28546,28534,
+28536,28536,28584,28584,28658,28685,28744,28744,
+28837,28837,28954,29006,29147,29147,29321,29321,
+29450,29498,29607,29607,29714,29714,29777,29799,
+29841,29841,29832,29832,29780,29786,29864,29864,
+30099,30099,30214,30242,30267,30267,30262,30262,
+30232,30232,30262,30262,30367,30367,30386,30383,
+30345,30345,30295,30295,30257,30246,30224,30224,
+30213,30213,30217,30219,30226,30226,30164,30164,
+30062,30030,29971,29971,29960,29960,30009,30039,
+30133,30133,30159,30159,30106,30097,30107,30107,
+30209,30209,30285,30312,30375,30375,30433,30433,
+30463,30479,30532,30532,30615,30615,30662,30676,
+30702,30702,30709,30709,30699,30698,30701,30701,
+30769,30769,30826,30850,30912,30912,31002,31002,
+31088,31122,31207,31207,31286,31286,31324,31336,
+31356,31356,31376,31376,31386,31389,31392,31392,
+31384,31384,31368,31361,31343,31343,31323,31323,
+31315,31317,31332,31332,31372,31372,31401,31410,
+31424,31424,31443,31443,31467,31478,31507,31507,
+31537,31537,31571,31586,31625,31625,31674,31674,
+31716,31729,31754,31754,31773,31773,31797,31807,
+31837,31837,31783,31783,31726,31714,31707,31707,
+31781,31781,31840,31859,31902,31902,31936,31936,
+31946,31950,31961,31961,31990,31990,32024,32036,
+32062,32062,32013,32013,31905,31863,31762,31762,
+31650,31650,31609,31606,31632,31632,31639,31639,
+31620,31626,31674,31674,31805,31805,31869,31889,
+31926,31926,31974,31974,32003,32020,32077,32077,
+32307,32307,32391,32424,32505,32505,32661,32661,
+32802,32841,32888,32888,32850,32850,32847,32853,
+32883,32883,32862,32862,32798,32772,32708,32708,
+32622,32622,32572,32555,32526,32526,32486,32486,
+32460,32457,32468,32468,32535,32535,32574,32583,
+32589,32589,32580,32580,32563,32556,32543,32543,
+32532,32532,32504,32488,32440,32440,32413,32413,
+32424,32423,32409,32409,32361,32361,32353,32354,
+32372,32372,32362,32362,32328,32320,32312,32312,
+32348,32348,32368,32373,32379,32379,32321,32321,
+32218,32184,32117,32117,32077,32077,32050,32042,
+32020,32020,31959,31959,31910,31891,31844,31844,
+31785,31785,31748,31735,31711,31711,31680,31680,
+31658,31648,31625,31625,31595,31595,31567,31555,
+31527,31527,31519,31519,31497,31490,31475,31475,
+31470,31470,31473,31477,31492,31492,31502,31502,
+31529,31540,31568,31568,31591,31591,31603,31606,
+31612,31612,31612,31612,31611,31609,31603,31603,
+31584,31584,31568,31563,31555,31555,31557,31557,
+31560,31558,31543,31543,31514,31514,31506,31506,
+31514,31514,31527,31527,31531,31532,31530,31530,
+31524,31524,31523,31522,31519,31519,31507,31507,
+31507,31508,31512,31512,31516,31516,31527,31532,
+31545,31545,31549,31549,31563,31570,31593,31593,
+31632,31632,31641,31641,31632,31632,31716,31716,
+31863,31915,32026,32026,32129,32129,32214,32242,
+32298,31546,31562,31464,31020,30624,30884,30666,
+30633,31687,32558,32212,31883,32364,34443,34935,
+35219,35624,35452,35263,32709,32709,32720,32721,
+32716,32716,32616,32616,32453,32387,32219,32219,
+32056,32056,31925,31879,31780,31780,31666,31666,
+31565,31545,31542,31542,31616,31616,31684,31712,
+31781,31781,31782,31782,31716,31688,31617,31617,
+31531,31531,31442,31403,31296,31296,31090,31090,
+30855,30767,30563,30563,30373,30373,30243,30198,
+30102,30102,29992,29992,29913,29897,29898,29898,
+29862,29862,29813,29796,29760,29760,29748,29748,
+29738,29731,29705,29705,29678,29678,29664,29659,
+29649,29649,29652,29652,29662,29668,29686,29686,
+29705,29705,29717,29723,29736,29736,29750,29750,
+29765,29771,29784,29784,29791,29791,29781,29774,
+29749,29749,29705,29705,29661,29643,29602,29602,
+29561,29561,29532,29521,29497,29497,29493,29493,
+29514,29526,29561,29561,29611,29611,29654,29671,
+29713,29713,29741,29741,29748,29747,29732,29732,
+29681,29681,29636,29620,29585,29585,29555,29555,
+29530,29518,29483,29483,29446,29446,29430,29427,
+29428,29428,29448,29448,29472,29483,29511,29511,
+29529,29529,29526,29522,29504,29504,29460,29460,
+29418,29402,29366,29366,29338,29338,29318,29311,
+29293,29293,29287,29287,29292,29292,29290,29290,
+29276,29276,29266,29267,29282,29282,29330,29330,
+29375,29393,29438,29438,29475,29475,29471,29462,
+29420,29420,29338,29338,29265,29239,29181,29181,
+29127,29127,29085,29071,29045,29045,29035,29035,
+29028,29024,29009,29009,28979,28979,28957,28949,
+28932,28932,28917,28917,28895,28884,28853,28853,
+28819,28819,28803,28799,28795,28795,28798,28798,
+28803,28809,28836,28836,28920,28920,29031,29074,
+29176,29176,29224,29224,29222,29218,29204,29204,
+29189,29189,29146,29125,29058,29058,28992,28992,
+28956,28932,28847,28847,28675,28675,28607,28594,
+28597,28597,28657,28657,28752,28787,28866,28866,
+28982,28982,29109,29162,29299,29299,29470,29470,
+29601,29650,29763,29763,29882,29882,29951,29973,
+30016,30016,30005,30005,29953,29959,30037,30037,
+30273,30273,30381,30404,30417,30417,30399,30399,
+30364,30363,30389,30389,30491,30491,30507,30502,
+30459,30459,30415,30415,30389,30382,30371,30371,
+30373,30373,30380,30382,30387,30387,30326,30326,
+30226,30194,30130,30130,30103,30103,30148,30175,
+30271,30271,30303,30303,30257,30250,30263,30263,
+30370,30370,30454,30485,30559,30559,30626,30626,
+30653,30670,30723,30723,30813,30813,30858,30870,
+30884,30884,30877,30877,30853,30847,30841,30841,
+30912,30912,30967,30990,31049,31049,31134,31134,
+31216,31250,31334,31334,31414,31414,31451,31463,
+31481,31481,31500,31500,31509,31511,31512,31512,
+31500,31500,31481,31473,31455,31455,31435,31435,
+31428,31429,31445,31445,31485,31485,31516,31526,
+31544,31544,31565,31565,31592,31604,31633,31633,
+31664,31664,31696,31711,31749,31749,31800,31800,
+31843,31856,31880,31880,31890,31890,31901,31906,
+31919,31919,31859,31859,31813,31803,31800,31800,
+31876,31876,31937,31958,32003,32003,32042,32042,
+32058,32062,32068,32068,32080,32080,32109,32123,
+32157,32157,32131,32131,32048,32011,31914,31914,
+31777,31777,31731,31729,31769,31769,31771,31771,
+31730,31730,31772,31772,31910,31910,31976,31997,
+32031,32031,32083,32083,32119,32138,32196,32196,
+32593,32593,32674,32710,32799,32799,32931,32931,
+33022,33046,33072,33072,33052,33052,33058,33066,
+33102,33102,33090,33090,33031,33006,32935,32935,
+32830,32830,32775,32760,32742,32742,32715,32715,
+32695,32693,32707,32707,32773,32773,32802,32806,
+32795,32795,32762,32762,32724,32715,32705,32705,
+32722,32722,32705,32691,32639,32639,32602,32602,
+32598,32594,32581,32581,32549,32549,32543,32543,
+32549,32549,32537,32537,32504,32498,32497,32497,
+32549,32549,32574,32581,32588,32588,32531,32531,
+32427,32393,32323,32323,32274,32274,32243,32232,
+32210,32210,32145,32145,32094,32075,32028,32028,
+31966,31966,31931,31923,31914,31914,31886,31886,
+31858,31848,31827,31827,31802,31802,31776,31766,
+31741,31741,31733,31733,31707,31699,31685,31685,
+31686,31686,31699,31707,31732,31732,31735,31735,
+31757,31766,31791,31791,31824,31824,31846,31853,
+31862,31862,31857,31857,31850,31847,31838,31838,
+31816,31816,31797,31791,31779,31779,31780,31780,
+31781,31778,31762,31762,31733,31733,31725,31726,
+31736,31736,31755,31755,31763,31765,31764,31764,
+31757,31757,31750,31747,31740,31740,31736,31736,
+31739,31740,31742,31742,31743,31743,31750,31753,
+31760,31760,31759,31759,31780,31787,31803,31803,
+31819,31819,31820,31819,31814,31814,31913,31913,
+32080,32136,32249,32249,32328,32328,32419,32455,
+32544,32544,32758,31809,31213,30960,31501,31453,
+31265,32079,32896,32201,31754,32192,34192,34720,
+35021,35351,35158,35041,33005,33005,33028,33039,
+33069,33069,32993,32993,32817,32739,32527,32527,
+32317,32317,32180,32137,32057,32057,32001,32001,
+31959,31959,32000,32000,32099,32099,32174,32204,
+32273,32273,32284,32284,32241,32223,32176,32176,
+32117,32117,32020,31970,31823,31823,31611,31611,
+31412,31333,31139,31139,30928,30928,30808,30771,
+30708,30708,30594,30594,30480,30456,30449,30449,
+30430,30430,30387,30371,30329,30329,30296,30296,
+30268,30256,30217,30217,30181,30181,30160,30152,
+30134,30134,30121,30121,30119,30120,30128,30128,
+30138,30138,30148,30153,30166,30166,30181,30181,
+30193,30196,30198,30198,30191,30191,30173,30162,
+30130,30130,30079,30079,30030,30012,29971,29971,
+29936,29936,29914,29907,29894,29894,29909,29909,
+29939,29953,29992,29992,30047,30047,30096,30116,
+30162,30162,30189,30189,30193,30191,30175,30175,
+30120,30120,30068,30049,30011,30011,29972,29972,
+29937,29923,29884,29884,29847,29847,29837,29837,
+29847,29847,29879,29879,29911,29924,29957,29957,
+29980,29980,29985,29982,29960,29960,29907,29907,
+29863,29849,29825,29825,29818,29818,29809,29804,
+29787,29787,29790,29790,29806,29811,29818,29818,
+29811,29811,29802,29800,29801,29801,29830,29830,
+29866,29882,29922,29922,29951,29951,29938,29925,
+29875,29875,29776,29776,29682,29649,29575,29575,
+29511,29511,29466,29451,29421,29421,29415,29415,
+29414,29407,29378,29378,29307,29307,29261,29247,
+29222,29222,29202,29202,29182,29172,29137,29137,
+29085,29085,29046,29033,29005,29005,28994,28994,
+29006,29015,29052,29052,29144,29144,29265,29314,
+29434,29434,29526,29526,29573,29586,29603,29603,
+29606,29606,29583,29569,29525,29525,29427,29427,
+29325,29278,29148,29148,28956,28956,28891,28883,
+28909,28909,28992,28992,29109,29157,29278,29278,
+29463,29463,29607,29658,29764,29764,29920,29920,
+30055,30104,30214,30214,30330,30330,30391,30409,
+30435,30435,30427,30427,30399,30409,30488,30488,
+30691,30691,30774,30791,30786,30786,30770,30770,
+30754,30755,30775,30775,30841,30841,30840,30828,
+30773,30773,30747,30747,30763,30768,30774,30774,
+30765,30765,30769,30772,30781,30781,30756,30756,
+30708,30687,30632,30632,30569,30569,30591,30613,
+30698,30698,30750,30750,30736,30737,30752,30752,
+30823,30823,30907,30946,31056,31056,31148,31148,
+31183,31201,31251,31251,31320,31320,31349,31355,
+31357,31357,31325,31325,31276,31262,31243,31243,
+31300,31300,31345,31363,31407,31407,31468,31468,
+31530,31556,31627,31627,31702,31702,31741,31754,
+31776,31776,31797,31797,31806,31807,31800,31800,
+31772,31772,31745,31736,31716,31716,31705,31705,
+31703,31707,31723,31723,31765,31765,31799,31811,
+31835,31835,31867,31867,31899,31912,31938,31938,
+31966,31966,31996,32009,32049,32049,32113,32113,
+32174,32192,32218,32218,32208,32208,32182,32170,
+32133,32133,32063,32063,32047,32043,32043,32043,
+32093,32093,32162,32190,32265,32265,32326,32326,
+32349,32352,32346,32346,32325,32325,32352,32370,
+32428,32428,32449,32449,32407,32379,32281,32281,
+32112,32112,32070,32076,32146,32146,32153,32153,
+32096,32091,32115,32115,32228,32228,32275,32287,
+32297,32297,32345,32345,32405,32429,32495,32495,
+32593,32593,32674,32710,32799,32799,32931,32931,
+33022,33046,33072,33072,33052,33052,33058,33066,
+33102,33102,33090,33090,33031,33006,32935,32935,
+32830,32830,32775,32760,32742,32742,32715,32715,
+32695,32693,32707,32707,32773,32773,32802,32806,
+32795,32795,32762,32762,32724,32715,32705,32705,
+32722,32722,32705,32691,32639,32639,32602,32602,
+32598,32594,32581,32581,32549,32549,32543,32543,
+32549,32549,32537,32537,32504,32498,32497,32497,
+32549,32549,32574,32581,32588,32588,32531,32531,
+32427,32393,32323,32323,32274,32274,32243,32232,
+32210,32210,32145,32145,32094,32075,32028,32028,
+31966,31966,31931,31923,31914,31914,31886,31886,
+31858,31848,31827,31827,31802,31802,31776,31766,
+31741,31741,31733,31733,31707,31699,31685,31685,
+31686,31686,31699,31707,31732,31732,31735,31735,
+31757,31766,31791,31791,31824,31824,31846,31853,
+31862,31862,31857,31857,31850,31847,31838,31838,
+31816,31816,31797,31791,31779,31779,31780,31780,
+31781,31778,31762,31762,31733,31733,31725,31726,
+31736,31736,31755,31755,31763,31765,31764,31764,
+31757,31757,31750,31747,31740,31740,31736,31736,
+31739,31740,31742,31742,31743,31743,31750,31753,
+31760,31760,31759,31759,31780,31787,31803,31803,
+31819,31819,31820,31819,31814,31814,31913,31913,
+32080,32136,32249,32249,32328,32328,32419,32455,
+32544,32544,32758,31829,30650,30262,31177,31555,
+31129,31563,32232,32181,31867,32162,33856,34443,
+34789,34936,34746,34752,33005,33005,33028,33039,
+33069,33069,32993,32993,32817,32739,32527,32527,
+32317,32317,32180,32137,32057,32057,32001,32001,
+31959,31959,32000,32000,32099,32099,32174,32204,
+32273,32273,32284,32284,32241,32223,32176,32176,
+32117,32117,32020,31970,31823,31823,31611,31611,
+31412,31333,31139,31139,30928,30928,30808,30771,
+30708,30708,30594,30594,30480,30456,30449,30449,
+30430,30430,30387,30371,30329,30329,30296,30296,
+30268,30256,30217,30217,30181,30181,30160,30152,
+30134,30134,30121,30121,30119,30120,30128,30128,
+30138,30138,30148,30153,30166,30166,30181,30181,
+30193,30196,30198,30198,30191,30191,30173,30162,
+30130,30130,30079,30079,30030,30012,29971,29971,
+29936,29936,29914,29907,29894,29894,29909,29909,
+29939,29953,29992,29992,30047,30047,30096,30116,
+30162,30162,30189,30189,30193,30191,30175,30175,
+30120,30120,30068,30049,30011,30011,29972,29972,
+29937,29923,29884,29884,29847,29847,29837,29837,
+29847,29847,29879,29879,29911,29924,29957,29957,
+29980,29980,29985,29982,29960,29960,29907,29907,
+29863,29849,29825,29825,29818,29818,29809,29804,
+29787,29787,29790,29790,29806,29811,29818,29818,
+29811,29811,29802,29800,29801,29801,29830,29830,
+29866,29882,29922,29922,29951,29951,29938,29925,
+29875,29875,29776,29776,29682,29649,29575,29575,
+29511,29511,29466,29451,29421,29421,29415,29415,
+29414,29407,29378,29378,29307,29307,29261,29247,
+29222,29222,29202,29202,29182,29172,29137,29137,
+29085,29085,29046,29033,29005,29005,28994,28994,
+29006,29015,29052,29052,29144,29144,29265,29314,
+29434,29434,29526,29526,29573,29586,29603,29603,
+29606,29606,29583,29569,29525,29525,29427,29427,
+29325,29278,29148,29148,28956,28956,28891,28883,
+28909,28909,28992,28992,29109,29157,29278,29278,
+29463,29463,29607,29658,29764,29764,29920,29920,
+30055,30104,30214,30214,30330,30330,30391,30409,
+30435,30435,30427,30427,30399,30409,30488,30488,
+30691,30691,30774,30791,30786,30786,30770,30770,
+30754,30755,30775,30775,30841,30841,30840,30828,
+30773,30773,30747,30747,30763,30768,30774,30774,
+30765,30765,30769,30772,30781,30781,30756,30756,
+30708,30687,30632,30632,30569,30569,30591,30613,
+30698,30698,30750,30750,30736,30737,30752,30752,
+30823,30823,30907,30946,31056,31056,31148,31148,
+31183,31201,31251,31251,31320,31320,31349,31355,
+31357,31357,31325,31325,31276,31262,31243,31243,
+31300,31300,31345,31363,31407,31407,31468,31468,
+31530,31556,31627,31627,31702,31702,31741,31754,
+31776,31776,31797,31797,31806,31807,31800,31800,
+31772,31772,31745,31736,31716,31716,31705,31705,
+31703,31707,31723,31723,31765,31765,31799,31811,
+31835,31835,31867,31867,31899,31912,31938,31938,
+31966,31966,31996,32009,32049,32049,32113,32113,
+32174,32192,32218,32218,32208,32208,32182,32170,
+32133,32133,32063,32063,32047,32043,32043,32043,
+32093,32093,32162,32190,32265,32265,32326,32326,
+32349,32352,32346,32346,32325,32325,32352,32370,
+32428,32428,32449,32449,32407,32379,32281,32281,
+32112,32112,32070,32076,32146,32146,32153,32153,
+32096,32091,32115,32115,32228,32228,32275,32287,
+32297,32297,32345,32345,32405,32429,32495,32495,
+32861,32861,32930,32957,33023,33023,33112,33112,
+33156,33171,33200,33200,33235,33235,33259,33269,
+33295,33295,33289,33289,33252,33235,33189,33189,
+33114,33114,33069,33054,33030,33030,32998,32998,
+32973,32970,32979,32979,33039,33039,33056,33055,
+33033,33033,32991,32991,32949,32940,32940,32940,
+32988,32988,32972,32956,32884,32884,32817,32817,
+32780,32769,32753,32753,32754,32754,32749,32745,
+32729,32729,32702,32702,32668,32662,32664,32664,
+32721,32721,32746,32750,32749,32749,32705,32705,
+32627,32600,32549,32549,32513,32513,32478,32464,
+32424,32424,32372,32372,32326,32307,32261,32261,
+32231,32231,32212,32206,32195,32195,32174,32174,
+32148,32139,32117,32117,32094,32094,32076,32069,
+32054,32054,32038,32038,32025,32021,32017,32017,
+32021,32021,32030,32034,32045,32045,32049,32049,
+32055,32059,32076,32076,32104,32104,32130,32137,
+32153,32153,32150,32150,32138,32133,32121,32121,
+32103,32103,32090,32085,32077,32077,32077,32077,
+32072,32067,32044,32044,32012,32012,32007,32007,
+32017,32017,32035,32035,32043,32044,32043,32043,
+32039,32039,32032,32030,32026,32026,32029,32029,
+32031,32032,32032,32032,32035,32035,32043,32045,
+32049,32049,32052,32052,32055,32057,32066,32066,
+32080,32080,32084,32090,32113,32113,32231,32231,
+32402,32459,32575,32575,32654,32654,32739,32770,
+32846,32305,32856,32407,31281,26575,30733,31692,
+31618,31634,32140,33091,33174,33404,34090,34404,
+34705,33537,33580,33580,33392,33392,33432,33453,
+33517,33517,33488,33488,33339,33259,33009,33009,
+32725,32725,32552,32498,32398,32398,32392,32392,
+32429,32451,32518,32518,32592,32592,32655,32680,
+32746,32746,32766,32766,32756,32748,32717,32717,
+32659,32659,32531,32464,32250,32250,32094,32094,
+32053,32021,31906,31906,31687,31687,31544,31494,
+31388,31388,31262,31262,31165,31132,31071,31071,
+31014,31014,30972,30959,30935,30935,30915,30915,
+30867,30847,30797,30797,30749,30749,30726,30717,
+30696,30696,30672,30672,30657,30653,30645,30645,
+30642,30642,30651,30655,30667,30667,30678,30678,
+30685,30684,30674,30674,30636,30636,30593,30576,
+30531,30531,30475,30475,30425,30409,30371,30371,
+30345,30345,30338,30339,30346,30346,30381,30381,
+30412,30424,30455,30455,30504,30504,30550,30568,
+30610,30610,30641,30641,30646,30643,30624,30624,
+30566,30566,30515,30497,30458,30458,30410,30410,
+30370,30354,30317,30317,30281,30281,30271,30272,
+30291,30291,30336,30336,30376,30391,30426,30426,
+30458,30458,30474,30476,30467,30467,30412,30412,
+30336,30324,30341,30341,30428,30428,30434,30424,
+30362,30362,30367,30367,30424,30440,30468,30468,
+30477,30477,30469,30466,30457,30457,30449,30449,
+30435,30438,30468,30468,30533,30533,30516,30496,
+30415,30415,30285,30285,30155,30116,30047,30047,
+30051,30051,30016,29997,29934,29934,29929,29929,
+29964,29955,29882,29882,29662,29662,29552,29523,
+29484,29484,29473,29473,29499,29502,29486,29486,
+29424,29424,29361,29334,29260,29260,29258,29258,
+29341,29369,29424,29424,29462,29462,29574,29629,
+29787,29787,29960,29960,30079,30117,30187,30187,
+30219,30219,30254,30268,30308,30308,30184,30184,
+29959,29878,29696,29696,29545,29545,29526,29539,
+29623,29623,29724,29724,29804,29846,29977,29977,
+30225,30225,30357,30387,30407,30407,30515,30515,
+30660,30706,30789,30789,30841,30841,30854,30852,
+30834,30834,30847,30847,30895,30919,30990,30990,
+31078,31078,31124,31137,31158,31158,31211,31211,
+31285,31306,31339,31339,31321,31321,31282,31261,
+31200,31200,31196,31196,31260,31273,31274,31274,
+31196,31196,31178,31179,31203,31203,31279,31279,
+31373,31391,31390,31390,31291,31291,31268,31270,
+31305,31305,31367,31367,31417,31425,31417,31417,
+31351,31351,31400,31441,31599,31599,31743,31743,
+31815,31836,31870,31870,31858,31858,31857,31860,
+31871,31871,31831,31831,31762,31745,31725,31725,
+31762,31762,31788,31797,31815,31815,31825,31825,
+31820,31827,31866,31866,31952,31952,32000,32016,
+32047,32047,32085,32085,32123,32128,32116,32116,
+32043,32043,31993,31976,31942,31942,31942,31942,
+31974,31988,32021,32021,32066,32066,32101,32113,
+32139,32139,32185,32185,32233,32248,32271,32271,
+32271,32271,32286,32294,32320,32320,32443,32443,
+32614,32660,32717,32717,32662,32662,32572,32526,
+32389,32389,32321,32321,32343,32346,32334,32334,
+32303,32303,32375,32419,32567,32567,32663,32663,
+32671,32668,32648,32648,32612,32612,32648,32674,
+32766,32766,32815,32815,32772,32711,32449,32449,
+32288,32288,31957,32308,32564,32564,32620,32620,
+32638,32643,32651,32651,32643,32643,32610,32592,
+32537,32537,32558,32558,32644,32678,32759,32759,
+32861,32861,32930,32957,33023,33023,33112,33112,
+33156,33171,33200,33200,33235,33235,33259,33269,
+33295,33295,33289,33289,33252,33235,33189,33189,
+33114,33114,33069,33054,33030,33030,32998,32998,
+32973,32970,32979,32979,33039,33039,33056,33055,
+33033,33033,32991,32991,32949,32940,32940,32940,
+32988,32988,32972,32956,32884,32884,32817,32817,
+32780,32769,32753,32753,32754,32754,32749,32745,
+32729,32729,32702,32702,32668,32662,32664,32664,
+32721,32721,32746,32750,32749,32749,32705,32705,
+32627,32600,32549,32549,32513,32513,32478,32464,
+32424,32424,32372,32372,32326,32307,32261,32261,
+32231,32231,32212,32206,32195,32195,32174,32174,
+32148,32139,32117,32117,32094,32094,32076,32069,
+32054,32054,32038,32038,32025,32021,32017,32017,
+32021,32021,32030,32034,32045,32045,32049,32049,
+32055,32059,32076,32076,32104,32104,32130,32137,
+32153,32153,32150,32150,32138,32133,32121,32121,
+32103,32103,32090,32085,32077,32077,32077,32077,
+32072,32067,32044,32044,32012,32012,32007,32007,
+32017,32017,32035,32035,32043,32044,32043,32043,
+32039,32039,32032,32030,32026,32026,32029,32029,
+32031,32032,32032,32032,32035,32035,32043,32045,
+32049,32049,32052,32052,32055,32057,32066,32066,
+32080,32080,32084,32090,32113,32113,32231,32231,
+32402,32459,32575,32575,32654,32654,32739,32770,
+32846,32846,32513,32760,32480,31077,30940,31266,
+31757,32049,32378,32927,33061,33380,33915,34120,
+34536,33537,33580,33580,33392,33392,33432,33453,
+33517,33517,33488,33488,33339,33259,33009,33009,
+32725,32725,32552,32498,32398,32398,32392,32392,
+32429,32451,32518,32518,32592,32592,32655,32680,
+32746,32746,32766,32766,32756,32748,32717,32717,
+32659,32659,32531,32464,32250,32250,32094,32094,
+32053,32021,31906,31906,31687,31687,31544,31494,
+31388,31388,31262,31262,31165,31132,31071,31071,
+31014,31014,30972,30959,30935,30935,30915,30915,
+30867,30847,30797,30797,30749,30749,30726,30717,
+30696,30696,30672,30672,30657,30653,30645,30645,
+30642,30642,30651,30655,30667,30667,30678,30678,
+30685,30684,30674,30674,30636,30636,30593,30576,
+30531,30531,30475,30475,30425,30409,30371,30371,
+30345,30345,30338,30339,30346,30346,30381,30381,
+30412,30424,30455,30455,30504,30504,30550,30568,
+30610,30610,30641,30641,30646,30643,30624,30624,
+30566,30566,30515,30497,30458,30458,30410,30410,
+30370,30354,30317,30317,30281,30281,30271,30272,
+30291,30291,30336,30336,30376,30391,30426,30426,
+30458,30458,30474,30476,30467,30467,30412,30412,
+30336,30324,30341,30341,30428,30428,30434,30424,
+30362,30362,30367,30367,30424,30440,30468,30468,
+30477,30477,30469,30466,30457,30457,30449,30449,
+30435,30438,30468,30468,30533,30533,30516,30496,
+30415,30415,30285,30285,30155,30116,30047,30047,
+30051,30051,30016,29997,29934,29934,29929,29929,
+29964,29955,29882,29882,29662,29662,29552,29523,
+29484,29484,29473,29473,29499,29502,29486,29486,
+29424,29424,29361,29334,29260,29260,29258,29258,
+29341,29369,29424,29424,29462,29462,29574,29629,
+29787,29787,29960,29960,30079,30117,30187,30187,
+30219,30219,30254,30268,30308,30308,30184,30184,
+29959,29878,29696,29696,29545,29545,29526,29539,
+29623,29623,29724,29724,29804,29846,29977,29977,
+30225,30225,30357,30387,30407,30407,30515,30515,
+30660,30706,30789,30789,30841,30841,30854,30852,
+30834,30834,30847,30847,30895,30919,30990,30990,
+31078,31078,31124,31137,31158,31158,31211,31211,
+31285,31306,31339,31339,31321,31321,31282,31261,
+31200,31200,31196,31196,31260,31273,31274,31274,
+31196,31196,31178,31179,31203,31203,31279,31279,
+31373,31391,31390,31390,31291,31291,31268,31270,
+31305,31305,31367,31367,31417,31425,31417,31417,
+31351,31351,31400,31441,31599,31599,31743,31743,
+31815,31836,31870,31870,31858,31858,31857,31860,
+31871,31871,31831,31831,31762,31745,31725,31725,
+31762,31762,31788,31797,31815,31815,31825,31825,
+31820,31827,31866,31866,31952,31952,32000,32016,
+32047,32047,32085,32085,32123,32128,32116,32116,
+32043,32043,31993,31976,31942,31942,31942,31942,
+31974,31988,32021,32021,32066,32066,32101,32113,
+32139,32139,32185,32185,32233,32248,32271,32271,
+32271,32271,32286,32294,32320,32320,32443,32443,
+32614,32660,32717,32717,32662,32662,32572,32526,
+32389,32389,32321,32321,32343,32346,32334,32334,
+32303,32303,32375,32419,32567,32567,32663,32663,
+32671,32668,32648,32648,32612,32612,32648,32674,
+32766,32766,32815,32815,32772,32711,32449,32449,
+32289,32022,31883,31847,32564,32564,32620,32620,
+32638,32643,32651,32651,32643,32643,32610,32592,
+32537,32537,32558,32558,32644,32678,32759,32759,
+33182,33182,33243,33260,33291,33291,33342,33342,
+33365,33375,33401,33401,33449,33449,33476,33486,
+33505,33505,33499,33499,33473,33463,33430,33430,
+33374,33374,33332,33318,33289,33289,33250,33250,
+33216,33208,33203,33203,33236,33236,33246,33245,
+33229,33229,33191,33191,33152,33144,33146,33146,
+33191,33191,33179,33165,33105,33105,33046,33046,
+33006,32993,32968,32968,32957,32957,32941,32933,
+32910,32910,32878,32878,32844,32838,32836,32836,
+32882,32882,32888,32885,32865,32865,32831,32831,
+32796,32784,32759,32759,32734,32734,32694,32675,
+32621,32621,32568,32568,32539,32524,32485,32485,
+32468,32468,32460,32457,32453,32453,32441,32441,
+32423,32415,32395,32395,32373,32373,32356,32350,
+32335,32335,32318,32318,32310,32307,32304,32304,
+32298,32298,32299,32300,32307,32307,32310,32310,
+32310,32312,32318,32318,32334,32334,32351,32359,
+32376,32376,32378,32378,32365,32359,32341,32341,
+32322,32322,32312,32310,32306,32306,32305,32305,
+32299,32293,32269,32269,32239,32239,32239,32241,
+32254,32254,32268,32268,32274,32274,32272,32272,
+32269,32269,32272,32274,32279,32279,32285,32285,
+32287,32287,32288,32288,32292,32292,32299,32299,
+32302,32302,32306,32306,32308,32309,32314,32314,
+32328,32328,32341,32350,32386,32386,32492,32492,
+32634,32685,32797,32797,32897,32897,32986,33016,
+33078,33078,32568,32943,33066,31740,31049,30865,
+31475,31824,32094,32569,32999,33502,33878,33859,
+34150,33571,33580,33580,33674,33674,33740,33768,
+33844,33844,33846,33846,33730,33654,33393,33393,
+33060,33060,32867,32808,32710,32710,32738,32738,
+32819,32850,32927,32927,32978,32978,33021,33038,
+33078,33078,33080,33080,33069,33062,33040,33040,
+33001,33001,32881,32815,32605,32605,32470,32470,
+32461,32441,32355,32355,32167,32167,32031,31981,
+31868,31868,31739,31739,31639,31601,31511,31511,
+31394,31394,31345,31340,31360,31360,31363,31363,
+31328,31311,31264,31264,31213,31213,31187,31176,
+31151,31151,31115,31115,31089,31079,31059,31059,
+31047,31047,31051,31054,31062,31062,31068,31068,
+31069,31066,31049,31049,30996,30996,30936,30914,
+30861,30861,30802,30802,30757,30742,30714,30714,
+30695,30695,30696,30700,30721,30721,30759,30759,
+30783,30791,30807,30807,30840,30840,30877,30892,
+30930,30930,30966,30966,30977,30976,30959,30959,
+30904,30904,30856,30839,30799,30799,30751,30751,
+30709,30691,30649,30649,30611,30611,30605,30609,
+30635,30635,30691,30691,30743,30762,30808,30808,
+30855,30855,30889,30900,30916,30916,30895,30895,
+30848,30847,30891,30891,30983,30983,30985,30970,
+30895,30895,30900,30900,30970,30993,31038,31038,
+31075,31075,31073,31069,31048,31048,31007,31007,
+30952,30943,30955,30955,31026,31026,31003,30979,
+30882,30882,30748,30748,30621,30583,30515,30515,
+30516,30516,30472,30447,30368,30368,30344,30344,
+30361,30344,30240,30240,29966,29966,29836,29802,
+29765,29765,29752,29752,29775,29777,29763,29763,
+29709,29709,29662,29644,29602,29602,29628,29628,
+29725,29760,29837,29837,29905,29905,30037,30098,
+30271,30271,30466,30466,30609,30657,30757,30757,
+30822,30822,30890,30919,30991,30991,30861,30861,
+30596,30504,30305,30305,30176,30176,30178,30202,
+30313,30313,30443,30443,30526,30568,30696,30696,
+30925,30925,31044,31069,31077,31077,31138,31138,
+31224,31251,31297,31297,31338,31338,31325,31310,
+31251,31251,31274,31274,31375,31407,31467,31467,
+31466,31466,31480,31490,31523,31523,31588,31588,
+31672,31696,31731,31731,31706,31706,31674,31661,
+31625,31625,31629,31629,31681,31689,31675,31675,
+31580,31580,31560,31563,31598,31598,31707,31707,
+31836,31867,31895,31895,31826,31826,31792,31783,
+31777,31777,31813,31813,31859,31866,31854,31854,
+31783,31783,31832,31875,32042,32042,32202,32202,
+32291,32313,32335,32335,32274,32274,32248,32242,
+32240,32240,32191,32191,32121,32103,32089,32089,
+32134,32134,32151,32153,32146,32146,32141,32141,
+32137,32142,32170,32170,32233,32233,32271,32285,
+32312,32312,32335,32335,32349,32346,32322,32322,
+32244,32244,32196,32181,32155,32155,32157,32157,
+32187,32200,32237,32237,32288,32288,32318,32327,
+32340,32340,32381,32381,32432,32448,32471,32471,
+32467,32467,32490,32505,32552,32552,32704,32704,
+32891,32942,33005,33005,32942,32942,32855,32812,
+32685,32685,32617,32617,32635,32634,32615,32615,
+32561,32561,32622,32664,32813,32813,32900,32900,
+32894,32890,32875,32875,32861,32861,32911,32941,
+33044,33044,33116,33116,33115,30724,30524,30923,
+31710,31392,31136,31034,31381,32725,32940,32940,
+32997,33009,33016,33016,32960,32960,32920,32906,
+32876,32876,32894,32894,32951,32978,33056,33056,
+33340,33340,33396,33410,33422,33422,33457,33457,
+33471,33478,33501,33501,33549,33549,33575,33584,
+33599,33599,33594,33594,33574,33564,33537,33537,
+33486,33486,33446,33431,33401,33401,33359,33359,
+33320,33309,33297,33297,33316,33316,33322,33322,
+33312,33312,33280,33280,33242,33235,33237,33237,
+33277,33277,33266,33255,33204,33204,33151,33151,
+33113,33100,33071,33071,33049,33049,33027,33018,
+32993,32993,32961,32961,32928,32921,32917,32917,
+32956,32956,32954,32947,32916,32916,32887,32887,
+32872,32867,32854,32854,32832,32832,32791,32770,
+32714,32714,32664,32664,32637,32626,32591,32591,
+32577,32577,32571,32569,32566,32566,32556,32556,
+32541,32534,32515,32515,32493,32493,32477,32470,
+32455,32455,32438,32438,32432,32430,32426,32426,
+32415,32415,32413,32414,32420,32420,32421,32421,
+32420,32420,32422,32422,32431,32431,32447,32454,
+32469,32469,32473,32473,32460,32453,32433,32433,
+32413,32413,32404,32402,32400,32400,32398,32398,
+32391,32385,32362,32362,32334,32334,32336,32339,
+32352,32352,32366,32366,32371,32371,32369,32369,
+32368,32368,32376,32379,32388,32388,32395,32395,
+32396,32397,32397,32397,32401,32401,32407,32409,
+32410,32410,32413,32413,32416,32417,32422,32422,
+32436,32436,32453,32465,32505,32505,32601,32601,
+32728,32775,32884,32884,32997,32997,33089,33119,
+33175,33175,33220,33339,33183,32045,31256,30694,
+30418,30866,31741,33055,33157,33409,34394,34328,
+34432,35174,35424,33607,33769,33769,33861,33894,
+33970,33970,33984,33984,33884,33812,33551,33551,
+33201,33201,32998,32937,32839,32839,32879,32879,
+32976,33012,33094,33094,33137,33137,33172,33184,
+33212,33212,33204,33204,33191,33184,33166,33166,
+33138,33138,33028,32966,32765,32765,32634,32634,
+32623,32604,32525,32525,32355,32355,32226,32177,
+32065,32065,31935,31935,31832,31791,31691,31691,
+31558,31558,31511,31509,31549,31549,31561,31561,
+31527,31510,31463,31463,31410,31410,31382,31370,
+31342,31342,31301,31301,31268,31257,31232,31232,
+31216,31216,31218,31220,31226,31226,31229,31229,
+31228,31224,31205,31205,31147,31147,31085,31061,
+31006,31006,30947,30947,30904,30890,30866,30866,
+30849,30849,30851,30856,30880,30880,30919,30919,
+30937,30943,30953,30953,30979,30979,31012,31026,
+31063,31063,31099,31099,31112,31112,31096,31096,
+31045,31045,30998,30980,30940,30940,30893,30893,
+30850,30833,30788,30788,30750,30750,30747,30752,
+30782,30782,30841,30841,30898,30920,30972,30972,
+31028,31028,31072,31087,31115,31115,31111,31111,
+31081,31085,31138,31138,31225,31225,31222,31206,
+31125,31125,31130,31130,31203,31228,31279,31279,
+31330,31330,31332,31327,31300,31300,31246,31246,
+31173,31159,31162,31162,31234,31234,31209,31184,
+31085,31085,30952,30952,30832,30794,30727,30727,
+30719,30719,30669,30641,30557,30557,30523,30523,
+30530,30508,30394,30394,30111,30111,29978,29946,
+29914,29914,29898,29898,29914,29914,29897,29897,
+29844,29844,29809,29798,29777,29777,29815,29815,
+29915,29952,30039,30039,30130,30130,30270,30334,
+30506,30506,30703,30703,30848,30899,31005,31005,
+31082,31082,31159,31190,31269,31269,31140,31140,
+30868,30774,30574,30574,30455,30455,30465,30491,
+30610,30610,30750,30750,30838,30880,31003,31003,
+31214,31214,31326,31351,31365,31365,31409,31409,
+31463,31479,31510,31510,31555,31555,31537,31517,
+31440,31440,31466,31466,31588,31624,31678,31678,
+31643,31643,31643,31651,31688,31688,31751,31751,
+31829,31852,31887,31887,31866,31866,31844,31836,
+31815,31815,31821,31821,31861,31864,31842,31842,
+31746,31746,31726,31730,31768,31768,31880,31880,
+32007,32041,32078,32078,32033,32033,31999,31988,
+31966,31966,31986,31986,32022,32028,32019,32019,
+31963,31963,32016,32060,32228,32228,32392,32392,
+32486,32507,32524,32524,32447,32447,32409,32399,
+32388,32388,32335,32335,32265,32250,32237,32237,
+32286,32286,32298,32297,32279,32279,32273,32273,
+32278,32284,32309,32309,32359,32359,32390,32402,
+32427,32427,32439,32439,32436,32429,32399,32399,
+32325,32325,32283,32270,32252,32252,32257,32257,
+32282,32295,32332,32332,32386,32386,32415,32422,
+32427,32427,32465,32465,32519,32535,32559,32559,
+32556,32556,32585,32602,32661,32661,32820,32820,
+33007,33057,33121,33121,33061,33061,32979,32939,
+32823,32823,32755,32755,32764,32762,32739,32739,
+32680,32680,32735,32774,32915,32915,32994,32994,
+32983,32978,32966,32966,32969,32969,33026,33058,
+33162,33162,33242,33242,33259,33261,31930,31709,
+30810,30724,30900,30889,30763,30945,33045,33045,
+33132,33150,33159,33159,33091,33091,33058,33050,
+33044,33044,33065,33065,33102,33125,33200,33200,
+33859,33859,33906,33905,33854,33854,33836,33836,
+33834,33834,33837,33837,33856,33856,33871,33876,
+33888,33888,33885,33885,33875,33868,33848,33848,
+33806,33806,33768,33754,33720,33720,33669,33669,
+33611,33591,33549,33549,33516,33516,33515,33520,
+33542,33542,33533,33533,33507,33501,33498,33498,
+33509,33509,33505,33502,33492,33492,33479,33479,
+33461,33448,33403,33403,33326,33326,33284,33271,
+33250,33250,33224,33224,33194,33186,33173,33173,
+33184,33184,33150,33130,33060,33060,33050,33050,
+33102,33118,33143,33143,33124,33124,33072,33053,
+33011,33011,32973,32973,32949,32940,32919,32919,
+32903,32903,32898,32896,32890,32890,32884,32884,
+32878,32873,32858,32858,32831,32831,32811,32804,
+32790,32790,32779,32779,32774,32771,32759,32759,
+32737,32737,32726,32724,32727,32727,32725,32725,
+32718,32716,32709,32709,32706,32706,32712,32716,
+32726,32726,32731,32731,32716,32709,32682,32682,
+32656,32656,32645,32642,32640,32640,32637,32637,
+32631,32625,32605,32605,32587,32587,32593,32597,
+32614,32614,32627,32627,32630,32631,32631,32631,
+32640,32640,32664,32673,32697,32697,32707,32707,
+32705,32704,32702,32702,32705,32705,32708,32708,
+32706,32706,32702,32702,32709,32713,32722,32722,
+32744,32744,32776,32792,32836,32836,32896,32896,
+32962,32995,33095,33095,33254,33254,33359,33390,
+33443,33443,33509,33549,33343,32293,31506,30858,
+30124,30557,31586,32886,32797,32918,34220,34576,
+34606,34800,35028,35145,33918,33918,34149,34207,
+34262,34262,34300,34300,34259,34204,33962,33962,
+33576,33576,33347,33280,33177,33177,33239,33239,
+33371,33417,33516,33516,33549,33549,33562,33562,
+33547,33547,33503,33503,33476,33469,33464,33464,
+33487,33487,33424,33382,33242,33242,33106,33106,
+33019,32985,32900,32900,32803,32803,32713,32674,
+32577,32577,32446,32446,32320,32271,32157,32157,
+32018,32018,31996,32011,32111,32111,32138,32138,
+32083,32061,32010,32010,31951,31951,31911,31895,
+31856,31856,31799,31799,31749,31731,31692,31692,
+31668,31668,31664,31662,31659,31659,31655,31655,
+31647,31641,31616,31616,31561,31561,31503,31480,
+31424,31424,31368,31368,31338,31328,31311,31311,
+31295,31295,31293,31296,31313,31313,31341,31341,
+31345,31344,31337,31337,31343,31343,31366,31377,
+31408,31408,31443,31443,31458,31460,31455,31455,
+31417,31417,31372,31354,31315,31315,31273,31273,
+31229,31211,31162,31162,31126,31126,31129,31137,
+31176,31176,31254,31254,31324,31353,31428,31428,
+31520,31520,31597,31627,31693,31693,31749,31749,
+31776,31799,31880,31880,31910,31910,31883,31861,
+31775,31775,31775,31775,31844,31871,31937,31937,
+32034,32034,32049,32044,32002,32002,31907,31907,
+31784,31754,31727,31727,31799,31799,31773,31749,
+31652,31652,31544,31544,31463,31432,31362,31362,
+31298,31298,31220,31187,31094,31094,31026,31026,
+30987,30954,30825,30825,30567,30567,30463,30442,
+30442,30442,30417,30417,30388,30375,30335,30335,
+30282,30282,30294,30309,30377,30377,30461,30461,
+30543,30583,30705,30705,30898,30898,31068,31132,
+31276,31276,31444,31444,31566,31611,31713,31713,
+31810,31810,31890,31920,31987,31987,31866,31866,
+31620,31535,31354,31354,31263,31263,31286,31315,
+31436,31436,31597,31597,31709,31751,31846,31846,
+31963,31963,32060,32094,32169,32169,32174,32174,
+32107,32092,32086,32086,32180,32180,32163,32134,
+32010,32010,32042,32042,32212,32255,32296,32296,
+32173,32173,32137,32139,32181,32181,32212,32212,
+32230,32239,32264,32264,32291,32291,32322,32337,
+32380,32380,32382,32382,32351,32336,32288,32288,
+32209,32209,32198,32204,32241,32241,32310,32310,
+32375,32397,32448,32448,32511,32511,32504,32491,
+32432,32432,32393,32393,32372,32370,32380,32380,
+32436,32436,32531,32581,32734,32734,32893,32893,
+32991,33011,33012,33012,32899,32899,32829,32805,
+32758,32758,32689,32689,32632,32620,32616,32616,
+32669,32669,32666,32656,32609,32609,32622,32622,
+32687,32707,32736,32736,32732,32732,32735,32739,
+32751,32751,32714,32714,32639,32615,32564,32564,
+32529,32529,32522,32524,32545,32545,32559,32559,
+32563,32572,32607,32607,32680,32680,32700,32700,
+32680,32680,32706,32706,32764,32782,32815,32815,
+32829,32829,32879,32907,32998,32998,33160,33160,
+33314,33356,33414,33414,33383,33383,33338,33316,
+33251,33251,33183,33183,33146,33132,33095,33095,
+33052,33052,33079,33099,33180,33180,33216,33216,
+33195,33193,33205,33205,33275,33275,33354,33388,
+33480,33480,33575,33575,33648,33711,33956,32614,
+31840,31967,31305,31229,30898,31079,33198,33198,
+33423,33471,33491,33491,33436,33436,33465,33493,
+33607,33607,33654,33654,33609,33611,33669,33669,
+33859,33859,33906,33905,33854,33854,33836,33836,
+33834,33834,33837,33837,33856,33856,33871,33876,
+33888,33888,33885,33885,33875,33868,33848,33848,
+33806,33806,33768,33754,33720,33720,33669,33669,
+33611,33591,33549,33549,33516,33516,33515,33520,
+33542,33542,33533,33533,33507,33501,33498,33498,
+33509,33509,33505,33502,33492,33492,33479,33479,
+33461,33448,33403,33403,33326,33326,33284,33271,
+33250,33250,33224,33224,33194,33186,33173,33173,
+33184,33184,33150,33130,33060,33060,33050,33050,
+33102,33118,33143,33143,33124,33124,33072,33053,
+33011,33011,32973,32973,32949,32940,32919,32919,
+32903,32903,32898,32896,32890,32890,32884,32884,
+32878,32873,32858,32858,32831,32831,32811,32804,
+32790,32790,32779,32779,32774,32771,32759,32759,
+32737,32737,32726,32724,32727,32727,32725,32725,
+32718,32716,32709,32709,32706,32706,32712,32716,
+32726,32726,32731,32731,32716,32709,32682,32682,
+32656,32656,32645,32642,32640,32640,32637,32637,
+32631,32625,32605,32605,32587,32587,32593,32597,
+32614,32614,32627,32627,32630,32631,32631,32631,
+32640,32640,32664,32673,32697,32697,32707,32707,
+32705,32704,32702,32702,32705,32705,32708,32708,
+32706,32706,32702,32702,32709,32713,32722,32722,
+32744,32744,32776,32792,32836,32836,32896,32896,
+32962,32995,33095,33095,33254,33254,33359,33390,
+33443,33443,33509,33509,33668,32626,31807,31092,
+30364,30797,31649,32733,32725,32913,34467,34583,
+34631,34896,34708,34541,34674,33918,34149,34207,
+34262,34262,34300,34300,34259,34204,33962,33962,
+33576,33576,33347,33280,33177,33177,33239,33239,
+33371,33417,33516,33516,33549,33549,33562,33562,
+33547,33547,33503,33503,33476,33469,33464,33464,
+33487,33487,33424,33382,33242,33242,33106,33106,
+33019,32985,32900,32900,32803,32803,32713,32674,
+32577,32577,32446,32446,32320,32271,32157,32157,
+32018,32018,31996,32011,32111,32111,32138,32138,
+32083,32061,32010,32010,31951,31951,31911,31895,
+31856,31856,31799,31799,31749,31731,31692,31692,
+31668,31668,31664,31662,31659,31659,31655,31655,
+31647,31641,31616,31616,31561,31561,31503,31480,
+31424,31424,31368,31368,31338,31328,31311,31311,
+31295,31295,31293,31296,31313,31313,31341,31341,
+31345,31344,31337,31337,31343,31343,31366,31377,
+31408,31408,31443,31443,31458,31460,31455,31455,
+31417,31417,31372,31354,31315,31315,31273,31273,
+31229,31211,31162,31162,31126,31126,31129,31137,
+31176,31176,31254,31254,31324,31353,31428,31428,
+31520,31520,31597,31627,31693,31693,31749,31749,
+31776,31799,31880,31880,31910,31910,31883,31861,
+31775,31775,31775,31775,31844,31871,31937,31937,
+32034,32034,32049,32044,32002,32002,31907,31907,
+31784,31754,31727,31727,31799,31799,31773,31749,
+31652,31652,31544,31544,31463,31432,31362,31362,
+31298,31298,31220,31187,31094,31094,31026,31026,
+30987,30954,30825,30825,30567,30567,30463,30442,
+30442,30442,30417,30417,30388,30375,30335,30335,
+30282,30282,30294,30309,30377,30377,30461,30461,
+30543,30583,30705,30705,30898,30898,31068,31132,
+31276,31276,31444,31444,31566,31611,31713,31713,
+31810,31810,31890,31920,31987,31987,31866,31866,
+31620,31535,31354,31354,31263,31263,31286,31315,
+31436,31436,31597,31597,31709,31751,31846,31846,
+31963,31963,32060,32094,32169,32169,32174,32174,
+32107,32092,32086,32086,32180,32180,32163,32134,
+32010,32010,32042,32042,32212,32255,32296,32296,
+32173,32173,32137,32139,32181,32181,32212,32212,
+32230,32239,32264,32264,32291,32291,32322,32337,
+32380,32380,32382,32382,32351,32336,32288,32288,
+32209,32209,32198,32204,32241,32241,32310,32310,
+32375,32397,32448,32448,32511,32511,32504,32491,
+32432,32432,32393,32393,32372,32370,32380,32380,
+32436,32436,32531,32581,32734,32734,32893,32893,
+32991,33011,33012,33012,32899,32899,32829,32805,
+32758,32758,32689,32689,32632,32620,32616,32616,
+32669,32669,32666,32656,32609,32609,32622,32622,
+32687,32707,32736,32736,32732,32732,32735,32739,
+32751,32751,32714,32714,32639,32615,32564,32564,
+32529,32529,32522,32524,32545,32545,32559,32559,
+32563,32572,32607,32607,32680,32680,32700,32700,
+32680,32680,32706,32706,32764,32782,32815,32815,
+32829,32829,32879,32907,32998,32998,33160,33160,
+33314,33356,33414,33414,33383,33383,33338,33316,
+33251,33251,33183,33183,33146,33132,33095,33095,
+33052,33052,33079,33099,33180,33180,33216,33216,
+33195,33193,33205,33205,33275,33275,33354,33388,
+33480,33480,33575,33575,33648,33711,33956,33956,
+32531,31857,32163,31583,31273,30923,33198,33198,
+33423,33471,33491,33491,33436,33436,33465,33493,
+33607,33607,33654,33654,33609,33611,33669,33669,
+34321,34321,34356,34345,34258,34258,34201,34201,
+34180,34172,34148,34148,34128,34128,34139,34149,
+34183,34183,34196,34196,34191,34186,34166,34166,
+34128,34128,34093,34081,34051,34051,34005,34005,
+33950,33930,33884,33884,33841,33841,33841,33846,
+33879,33879,33896,33896,33899,33896,33883,33883,
+33833,33833,33808,33804,33807,33807,33818,33818,
+33822,33814,33772,33772,33678,33678,33637,33629,
+33626,33626,33604,33604,33565,33550,33513,33513,
+33469,33469,33410,33385,33317,33317,33324,33324,
+33403,33427,33467,33467,33452,33452,33406,33390,
+33355,33355,33324,33324,33312,33309,33302,33302,
+33295,33295,33287,33283,33275,33275,33271,33271,
+33271,33269,33257,33257,33230,33230,33206,33199,
+33188,33188,33179,33179,33166,33160,33141,33141,
+33113,33113,33096,33091,33088,33088,33082,33082,
+33075,33071,33062,33062,33056,33056,33056,33057,
+33060,33060,33059,33059,33042,33032,33001,33001,
+32969,32969,32956,32953,32946,32946,32934,32934,
+32920,32914,32897,32897,32888,32888,32897,32903,
+32923,32923,32937,32937,32940,32941,32946,32946,
+32970,32970,33007,33022,33056,33056,33074,33074,
+33070,33069,33065,33065,33071,33071,33077,33078,
+33077,33077,33054,33054,33034,33031,33039,33039,
+33087,33087,33131,33148,33193,33193,33230,33230,
+33255,33277,33363,33363,33534,33534,33633,33660,
+33692,33692,33748,33748,33789,33802,31850,30800,
+30294,31043,31799,32409,32685,33313,34728,35109,
+35214,35279,35591,35056,35138,34279,34484,34529,
+34548,34548,34587,34587,34571,34531,34346,34346,
+34019,34019,33766,33684,33525,33525,33532,33532,
+33652,33695,33791,33791,33796,33796,33814,33821,
+33839,33839,33808,33808,33777,33774,33793,33793,
+33875,33875,33856,33835,33747,33747,33621,33621,
+33498,33456,33370,33370,33312,33312,33233,33196,
+33089,33089,32965,32965,32858,32815,32709,32709,
+32570,32570,32557,32580,32705,32705,32735,32735,
+32674,32653,32612,32612,32569,32569,32524,32504,
+32448,32448,32372,32372,32305,32281,32225,32225,
+32185,32185,32173,32169,32162,32162,32153,32153,
+32147,32142,32121,32121,32080,32080,32037,32018,
+31970,31970,31933,31933,31917,31909,31886,31886,
+31842,31842,31821,31816,31812,31812,31807,31807,
+31791,31784,31765,31765,31772,31772,31790,31798,
+31823,31823,31845,31845,31850,31850,31850,31850,
+31831,31831,31794,31778,31737,31737,31698,31698,
+31668,31654,31616,31616,31586,31586,31597,31610,
+31665,31665,31762,31762,31856,31895,31999,31999,
+32133,32133,32262,32314,32445,32445,32564,32564,
+32629,32655,32723,32723,32720,32720,32703,32692,
+32656,32656,32663,32663,32693,32709,32753,32753,
+32846,32846,32863,32859,32822,32822,32701,32701,
+32529,32485,32434,32434,32513,32513,32502,32484,
+32409,32409,32317,32317,32235,32200,32106,32106,
+31978,31978,31886,31854,31785,31785,31697,31697,
+31609,31569,31457,31457,31299,31299,31244,31233,
+31235,31235,31169,31169,31066,31025,30926,30926,
+30842,30842,30881,30918,31066,31066,31210,31210,
+31298,31341,31476,31476,31704,31704,31894,31963,
+32120,32120,32281,32281,32372,32409,32503,32503,
+32620,32620,32696,32719,32761,32761,32654,32654,
+32451,32380,32228,32228,32160,32160,32177,32197,
+32280,32280,32409,32409,32509,32541,32592,32592,
+32606,32606,32661,32688,32772,32772,32746,32746,
+32626,32593,32554,32554,32627,32627,32621,32604,
+32523,32523,32570,32570,32727,32762,32781,32781,
+32621,32621,32568,32565,32600,32600,32623,32623,
+32636,32645,32676,32676,32720,32720,32768,32790,
+32848,32848,32841,32841,32780,32757,32710,32710,
+32662,32662,32662,32668,32699,32699,32736,32736,
+32758,32773,32819,32819,32917,32917,32924,32915,
+32855,32855,32793,32793,32745,32740,32767,32767,
+32892,32892,33003,33049,33170,33170,33303,33303,
+33391,33409,33410,33410,33309,33309,33234,33206,
+33136,33136,33069,33069,33040,33037,33053,33053,
+33114,33114,33107,33093,33031,33031,33043,33043,
+33118,33135,33143,33143,33084,33084,33058,33053,
+33050,33050,33007,33007,32936,32913,32868,32868,
+32845,32845,32848,32855,32883,32883,32901,32901,
+32903,32910,32939,32939,32993,32993,33000,32996,
+32969,32969,33009,33009,33101,33130,33179,33179,
+33179,33179,33206,33205,33172,33172,33337,33337,
+33691,33772,33822,33822,33813,33813,33792,33782,
+33752,33752,33691,33691,33628,33603,33547,33547,
+33482,33482,33475,33480,33516,33516,33538,33538,
+33541,33549,33593,33593,33708,33708,33785,33810,
+33860,33860,33916,33916,33967,33989,34049,34049,
+34222,34222,34299,32450,31172,30212,30391,31188,
+31533,32256,33847,33847,33811,33811,33850,33887,
+34032,34032,34101,34101,34053,34055,34116,34116,
+34321,34321,34356,34345,34258,34258,34201,34201,
+34180,34172,34148,34148,34128,34128,34139,34149,
+34183,34183,34196,34196,34191,34186,34166,34166,
+34128,34128,34093,34081,34051,34051,34005,34005,
+33950,33930,33884,33884,33841,33841,33841,33846,
+33879,33879,33896,33896,33899,33896,33883,33883,
+33833,33833,33808,33804,33807,33807,33818,33818,
+33822,33814,33772,33772,33678,33678,33637,33629,
+33626,33626,33604,33604,33565,33550,33513,33513,
+33469,33469,33410,33385,33317,33317,33324,33324,
+33403,33427,33467,33467,33452,33452,33406,33390,
+33355,33355,33324,33324,33312,33309,33302,33302,
+33295,33295,33287,33283,33275,33275,33271,33271,
+33271,33269,33257,33257,33230,33230,33206,33199,
+33188,33188,33179,33179,33166,33160,33141,33141,
+33113,33113,33096,33091,33088,33088,33082,33082,
+33075,33071,33062,33062,33056,33056,33056,33057,
+33060,33060,33059,33059,33042,33032,33001,33001,
+32969,32969,32956,32953,32946,32946,32934,32934,
+32920,32914,32897,32897,32888,32888,32897,32903,
+32923,32923,32937,32937,32940,32941,32946,32946,
+32970,32970,33007,33022,33056,33056,33074,33074,
+33070,33069,33065,33065,33071,33071,33077,33078,
+33077,33077,33054,33054,33034,33031,33039,33039,
+33087,33087,33131,33148,33193,33193,33230,33230,
+33255,33277,33363,33363,33534,33534,33633,33660,
+33692,33692,33748,33450,33242,33802,31946,30907,
+29987,30811,31756,32340,32500,33183,34360,34855,
+35021,35402,35436,35356,35390,35650,34484,34529,
+34548,34548,34587,34587,34571,34531,34346,34346,
+34019,34019,33766,33684,33525,33525,33532,33532,
+33652,33695,33791,33791,33796,33796,33814,33821,
+33839,33839,33808,33808,33777,33774,33793,33793,
+33875,33875,33856,33835,33747,33747,33621,33621,
+33498,33456,33370,33370,33312,33312,33233,33196,
+33089,33089,32965,32965,32858,32815,32709,32709,
+32570,32570,32557,32580,32705,32705,32735,32735,
+32674,32653,32612,32612,32569,32569,32524,32504,
+32448,32448,32372,32372,32305,32281,32225,32225,
+32185,32185,32173,32169,32162,32162,32153,32153,
+32147,32142,32121,32121,32080,32080,32037,32018,
+31970,31970,31933,31933,31917,31909,31886,31886,
+31842,31842,31821,31816,31812,31812,31807,31807,
+31791,31784,31765,31765,31772,31772,31790,31798,
+31823,31823,31845,31845,31850,31850,31850,31850,
+31831,31831,31794,31778,31737,31737,31698,31698,
+31668,31654,31616,31616,31586,31586,31597,31610,
+31665,31665,31762,31762,31856,31895,31999,31999,
+32133,32133,32262,32314,32445,32445,32564,32564,
+32629,32655,32723,32723,32720,32720,32703,32692,
+32656,32656,32663,32663,32693,32709,32753,32753,
+32846,32846,32863,32859,32822,32822,32701,32701,
+32529,32485,32434,32434,32513,32513,32502,32484,
+32409,32409,32317,32317,32235,32200,32106,32106,
+31978,31978,31886,31854,31785,31785,31697,31697,
+31609,31569,31457,31457,31299,31299,31244,31233,
+31235,31235,31169,31169,31066,31025,30926,30926,
+30842,30842,30881,30918,31066,31066,31210,31210,
+31298,31341,31476,31476,31704,31704,31894,31963,
+32120,32120,32281,32281,32372,32409,32503,32503,
+32620,32620,32696,32719,32761,32761,32654,32654,
+32451,32380,32228,32228,32160,32160,32177,32197,
+32280,32280,32409,32409,32509,32541,32592,32592,
+32606,32606,32661,32688,32772,32772,32746,32746,
+32626,32593,32554,32554,32627,32627,32621,32604,
+32523,32523,32570,32570,32727,32762,32781,32781,
+32621,32621,32568,32565,32600,32600,32623,32623,
+32636,32645,32676,32676,32720,32720,32768,32790,
+32848,32848,32841,32841,32780,32757,32710,32710,
+32662,32662,32662,32668,32699,32699,32736,32736,
+32758,32773,32819,32819,32917,32917,32924,32915,
+32855,32855,32793,32793,32745,32740,32767,32767,
+32892,32892,33003,33049,33170,33170,33303,33303,
+33391,33409,33410,33410,33309,33309,33234,33206,
+33136,33136,33069,33069,33040,33037,33053,33053,
+33114,33114,33107,33093,33031,33031,33043,33043,
+33118,33135,33143,33143,33084,33084,33058,33053,
+33050,33050,33007,33007,32936,32913,32868,32868,
+32845,32845,32848,32855,32883,32883,32901,32901,
+32903,32910,32939,32939,32993,32993,33000,32996,
+32969,32969,33009,33009,33101,33130,33179,33179,
+33179,33179,33206,38899,38914,38919,33337,33337,
+33691,33772,33822,33822,33813,33813,33792,33782,
+33752,33752,33691,33691,33628,33603,33547,33547,
+33482,33482,33475,33480,33516,33516,33538,33538,
+33541,33549,33593,33593,33708,33708,33785,33810,
+33860,33860,33916,33916,33967,33989,34049,34049,
+34222,34222,34299,34302,32820,31978,30369,30296,
+30891,33682,33847,33847,33811,33811,33850,33887,
+34032,34032,34101,34101,34053,34055,34116,34116,
+34537,34537,34560,34548,34464,34464,34401,34401,
+34374,34360,34319,34319,34265,34265,34285,34303,
+34377,34377,34419,34419,34421,34417,34398,34398,
+34361,34361,34333,34322,34299,34299,34268,34268,
+34231,34219,34193,34193,34176,34176,34177,34181,
+34200,34200,34232,34232,34269,34272,34246,34246,
+34123,34123,34059,34044,34028,34028,34040,34040,
+34066,34067,34047,34047,33974,33974,33953,33952,
+33967,33967,33942,33942,33882,33855,33783,33783,
+33676,33676,33609,33590,33558,33558,33580,33580,
+33644,33664,33697,33697,33688,33688,33661,33648,
+33613,33613,33588,33588,33584,33583,33581,33581,
+33576,33576,33572,33571,33568,33568,33570,33570,
+33572,33572,33571,33571,33567,33567,33522,33510,
+33501,33501,33486,33486,33469,33462,33440,33440,
+33410,33410,33390,33385,33377,33377,33370,33370,
+33363,33361,33358,33358,33358,33358,33356,33355,
+33352,33352,33341,33341,33318,33307,33278,33278,
+33249,33249,33238,33234,33226,33226,33208,33208,
+33189,33182,33166,33166,33156,33156,33165,33171,
+33191,33191,33209,33209,33211,33212,33216,33216,
+33244,33244,33284,33300,33341,33341,33365,33365,
+33365,33365,33365,33365,33384,33384,33390,33390,
+33385,33385,33345,33345,33290,33278,33277,33277,
+33342,33342,33390,33409,33449,33449,33479,33479,
+33492,33508,33581,33581,33733,33733,33813,33831,
+33840,33840,33866,33866,32799,33903,32160,31309,
+30048,31017,31924,32478,32507,32724,33678,34020,
+34529,35178,35527,35475,35405,35629,35819,34717,
+34727,34727,34753,34753,34716,34684,34562,34562,
+34367,34367,34125,34032,33808,33808,33718,33718,
+33783,33808,33874,33874,33839,33839,33892,33924,
+34033,34033,34049,34049,34013,34014,34054,34054,
+34189,34189,34208,34201,34148,34148,34047,34047,
+33930,33890,33803,33803,33737,33737,33640,33592,
+33455,33455,33340,33340,33277,33249,33166,33166,
+33034,33034,33015,33033,33138,33138,33154,33154,
+33052,33025,32994,32994,33032,33032,33003,32980,
+32898,32898,32800,32800,32722,32694,32631,32631,
+32576,32576,32556,32551,32550,32550,32566,32566,
+32593,32596,32585,32585,32531,32531,32482,32462,
+32407,32407,32383,32383,32393,32387,32347,32347,
+32235,32235,32188,32179,32185,32185,32162,32162,
+32109,32095,32080,32080,32115,32115,32147,32161,
+32197,32197,32206,32206,32176,32170,32167,32167,
+32189,32189,32158,32137,32067,32067,32032,32032,
+32039,32037,32015,32015,31966,31966,31984,32005,
+32090,32090,32204,32204,32311,32357,32479,32479,
+32634,32634,32822,32908,33146,33146,33314,33314,
+33346,33357,33376,33376,33358,33358,33370,33380,
+33419,33419,33438,33438,33413,33408,33406,33406,
+33454,33454,33461,33460,33448,33448,33328,33328,
+33134,33085,33032,33032,33132,33132,33143,33137,
+33095,33095,33007,33007,32897,32851,32731,32731,
+32562,32562,32474,32453,32429,32429,32345,32345,
+32229,32191,32120,32120,32098,32098,32087,32078,
+32049,32049,31924,31924,31741,31671,31504,31504,
+31370,31370,31404,31449,31636,31636,31824,31824,
+31926,31970,32089,32089,32264,32264,32445,32518,
+32702,32702,32859,32859,32915,32942,33021,33021,
+33159,33159,33224,33240,33252,33252,33156,33156,
+32990,32931,32804,32804,32743,32743,32735,32738,
+32763,32763,32841,32841,32921,32942,32967,32967,
+32933,32933,32951,32966,33023,33023,32990,32990,
+32889,32856,32794,32794,32770,32770,32776,32782,
+32803,32803,32872,32872,32966,32985,32981,32981,
+32850,32850,32801,32796,32812,32812,32851,32851,
+32908,32928,32972,32972,32998,32998,33019,33027,
+33047,33047,33022,33022,32970,32955,32924,32924,
+32907,32907,32921,32930,32966,32966,33007,33007,
+33043,33056,33091,33091,33141,33141,33151,33147,
+33122,33122,33086,33086,33054,33055,33091,33091,
+33218,33218,33307,33341,33417,33417,33510,33510,
+33579,33594,33607,33607,33562,33562,33507,33481,
+33405,33405,33354,33354,33355,33362,33396,33396,
+33466,33466,33467,33455,33394,33394,33385,33385,
+33425,33428,33401,33401,33306,33306,33261,33249,
+33233,33233,33222,33222,33220,33216,33196,33196,
+33156,33156,33141,33139,33144,33144,33155,33155,
+33170,33176,33192,33192,33197,33197,33191,33188,
+33181,33181,33263,33263,33408,33451,33524,33524,
+33502,33502,33364,38588,38620,38679,39691,39075,
+34079,34155,34189,34189,34196,34196,34185,34179,
+34160,34160,34108,34108,34048,34020,33947,33947,
+33841,33841,33809,33807,33832,33832,33871,33871,
+33914,33936,34006,34006,34126,34126,34177,34186,
+34182,34182,34174,34174,34168,34172,34198,34198,
+34280,34280,34364,34407,34538,34538,31899,30771,
+30491,30963,33986,33986,34043,34043,34051,34071,
+34159,34159,34244,34244,34261,34281,34363,34363,
+34630,34630,34650,34638,34555,34555,34489,34489,
+34458,34443,34396,34396,34335,34335,34357,34379,
+34464,34464,34515,34515,34517,34514,34495,34495,
+34458,34458,34430,34422,34401,34401,34377,34377,
+34348,34339,34320,34320,34310,34310,34311,34314,
+34328,34328,34364,34364,34409,34413,34382,34382,
+34240,34240,34165,34144,34120,34120,34130,34130,
+34164,34168,34154,34154,34091,34091,34075,34075,
+34094,34094,34067,34067,34000,33970,33889,33889,
+33766,33766,33698,33680,33660,33660,33685,33685,
+33745,33763,33793,33793,33783,33783,33759,33749,
+33715,33715,33692,33692,33693,33693,33694,33694,
+33687,33687,33686,33686,33690,33690,33698,33698,
+33702,33703,33705,33705,33707,33707,33655,33642,
+33631,33631,33615,33615,33596,33588,33566,33566,
+33536,33536,33516,33509,33500,33500,33492,33492,
+33486,33484,33483,33483,33485,33485,33483,33481,
+33476,33476,33462,33462,33436,33425,33397,33397,
+33370,33370,33360,33356,33347,33347,33327,33327,
+33308,33300,33284,33284,33274,33274,33282,33288,
+33308,33308,33327,33327,33328,33329,33335,33335,
+33363,33363,33403,33420,33461,33461,33486,33486,
+33488,33488,33489,33489,33510,33510,33514,33513,
+33506,33506,33459,33459,33394,33381,33378,33378,
+33448,33448,33498,33515,33555,33555,33585,33585,
+33594,33610,33676,33676,33819,33819,33889,33903,
+33901,33901,33913,33913,32273,33942,33962,31546,
+30652,31312,31822,32464,32475,32643,32364,32661,
+33226,34277,34741,35091,35568,35737,34765,34780,
+34788,34788,34830,34830,34793,34765,34669,34669,
+34514,34514,34273,34175,33927,33927,33794,33794,
+33827,33845,33903,33903,33876,33876,33957,34002,
+34147,34147,34178,34178,34135,34135,34178,34178,
+34330,34330,34361,34359,34317,34317,34225,34225,
+34115,34075,33987,33987,33912,33912,33807,33757,
+33606,33606,33495,33495,33451,33427,33355,33355,
+33227,33227,33206,33220,33314,33314,33324,33324,
+33213,33185,33157,33157,33215,33215,33188,33165,
+33076,33076,32972,32972,32892,32862,32797,32797,
+32736,32736,32716,32712,32716,32716,32739,32739,
+32777,32783,32773,32773,32715,32715,32665,32644,
+32590,32590,32572,32572,32589,32583,32536,32536,
+32399,32399,32342,32333,32342,32342,32313,32313,
+32250,32233,32216,32216,32257,32257,32291,32305,
+32344,32344,32349,32349,32312,32304,32303,32303,
+32341,32341,32314,32293,32216,32216,32182,32182,
+32202,32203,32189,32189,32138,32138,32158,32179,
+32270,32270,32389,32389,32504,32553,32688,32688,
+32860,32860,33072,33169,33439,33439,33625,33625,
+33651,33658,33664,33664,33642,33642,33662,33678,
+33740,33740,33761,33761,33720,33708,33690,33690,
+33717,33717,33716,33716,33710,33710,33593,33593,
+33400,33350,33299,33299,33400,33400,33412,33406,
+33363,33363,33276,33276,33169,33124,33009,33009,
+32844,32844,32762,32744,32731,32731,32644,32644,
+32516,32478,32420,32420,32442,32442,32449,32444,
+32412,32412,32270,32270,32057,31976,31780,31780,
+31620,31620,31648,31694,31893,31893,32094,32094,
+32202,32246,32358,32358,32512,32512,32687,32760,
+32950,32950,33103,33103,33145,33167,33235,33235,
+33366,33366,33423,33434,33436,33436,33345,33345,
+33197,33143,33026,33026,32966,32966,32948,32945,
+32950,32950,33006,33006,33076,33093,33111,33111,
+33065,33065,33071,33081,33126,33126,33090,33090,
+32999,32966,32898,32898,32843,32843,32853,32866,
+32921,32921,32996,32996,33068,33080,33068,33068,
+32948,32948,32903,32896,32911,32911,32955,32955,
+33023,33046,33094,33094,33114,33114,33127,33130,
+33135,33135,33105,33105,33059,33045,33021,33021,
+33013,33013,33031,33042,33077,33077,33121,33121,
+33161,33174,33206,33206,33240,33240,33251,33250,
+33237,33237,33211,33211,33184,33187,33227,33227,
+33352,33352,33434,33464,33526,33526,33606,33606,
+33669,33685,33702,33702,33676,33676,33631,33607,
+33535,33535,33487,33487,33490,33498,33534,33534,
+33608,33608,33611,33600,33541,33541,33525,33525,
+33552,33550,33512,33512,33409,33409,33358,33343,
+33321,33321,33321,33321,33341,33341,33330,33330,
+33284,33284,33262,33257,33255,33255,33264,33264,
+33283,33289,33299,33299,33288,33288,33278,33276,
+33275,33275,33370,33370,33530,33579,33663,33663,
+33644,33644,33492,38004,37395,37482,38440,38769,
+38484,34297,34328,34328,34353,34353,34351,34348,
+34333,34333,34282,34282,34215,34186,34109,34109,
+34002,34002,33966,33962,33979,33979,34019,34019,
+34071,34095,34169,34169,34285,34285,34327,34331,
+34310,34310,34279,34279,34253,34250,34262,34262,
+34317,34317,34402,34454,34627,34627,33595,32847,
+31884,30404,30727,30837,34129,34129,34121,34134,
+34214,34214,34304,34304,34347,34374,34464,34464,
+34889,34889,34914,34903,34827,34827,34750,34750,
+34699,34677,34626,34626,34570,34570,34602,34630,
+34729,34729,34789,34789,34785,34779,34754,34754,
+34710,34710,34682,34674,34657,34657,34650,34650,
+34653,34653,34647,34647,34632,34632,34629,34630,
+34638,34638,34668,34668,34705,34705,34669,34669,
+34533,34533,34444,34414,34356,34356,34351,34351,
+34398,34408,34409,34409,34363,34363,34349,34347,
+34356,34356,34318,34318,34250,34220,34141,34141,
+34024,34024,33962,33946,33934,33934,33963,33963,
+34017,34031,34048,34048,34016,34016,33987,33975,
+33945,33945,33941,33941,33964,33969,33974,33974,
+33953,33953,33963,33971,34009,34009,34047,34047,
+34064,34070,34078,34078,34076,34076,34013,33996,
+33972,33972,33952,33952,33935,33927,33907,33907,
+33879,33879,33858,33851,33839,33839,33830,33830,
+33824,33823,33822,33822,33826,33826,33824,33822,
+33814,33814,33790,33790,33762,33753,33728,33728,
+33705,33705,33698,33696,33689,33689,33669,33669,
+33649,33642,33623,33623,33610,33610,33618,33624,
+33644,33644,33659,33659,33661,33663,33671,33671,
+33697,33697,33733,33748,33786,33786,33809,33809,
+33814,33815,33813,33813,33820,33820,33811,33804,
+33779,33779,33723,33723,33662,33649,33649,33649,
+33721,33721,33770,33788,33829,33829,33865,33865,
+33885,33900,33955,33955,34058,34058,34095,34096,
+34063,34063,34031,34031,34030,34034,34050,31621,
+30924,31165,31545,32434,32652,32720,32749,32986,
+33496,33923,34284,34815,35533,35765,34854,34863,
+34874,34874,35079,35079,35071,35062,35029,35029,
+34913,34913,34659,34549,34249,34249,33979,33979,
+33892,33888,33954,33954,34073,34073,34281,34371,
+34611,34611,34659,34659,34567,34553,34579,34579,
+34748,34748,34797,34801,34773,34773,34702,34702,
+34617,34582,34488,34488,34370,34370,34236,34174,
+33999,33999,33899,33899,33901,33893,33850,33850,
+33742,33742,33706,33708,33750,33750,33740,33740,
+33654,33632,33604,33604,33641,33641,33606,33582,
+33496,33496,33395,33395,33315,33286,33219,33219,
+33150,33150,33132,33134,33161,33161,33203,33203,
+33248,33255,33244,33244,33175,33175,33131,33114,
+33078,33078,33074,33074,33091,33081,33013,33013,
+32831,32831,32759,32749,32770,32770,32735,32735,
+32651,32628,32595,32595,32620,32620,32642,32653,
+32685,32685,32695,32695,32670,32669,32686,32686,
+32757,32757,32747,32730,32657,32657,32632,32632,
+32666,32674,32679,32679,32654,32654,32673,32691,
+32763,32763,32886,32886,33030,33096,33283,33283,
+33543,33543,33807,33921,34220,34220,34433,34433,
+34475,34488,34507,34507,34488,34488,34508,34526,
+34595,34595,34615,34615,34562,34543,34494,34494,
+34457,34457,34421,34412,34400,34400,34311,34311,
+34165,34129,34091,34091,34163,34163,34125,34094,
+33979,33979,33892,33892,33859,33849,33829,33829,
+33781,33781,33735,33719,33688,33688,33568,33568,
+33414,33373,33325,33325,33408,33408,33462,33473,
+33483,33483,33340,33340,33067,32959,32685,32685,
+32429,32429,32418,32457,32663,32663,32882,32882,
+33001,33043,33137,33137,33242,33242,33389,33455,
+33634,33634,33761,33761,33768,33772,33785,33785,
+33831,33831,33841,33839,33823,33823,33753,33753,
+33652,33614,33521,33521,33454,33454,33412,33397,
+33364,33364,33369,33369,33404,33413,33420,33420,
+33388,33388,33380,33379,33384,33384,33341,33341,
+33286,33261,33196,33196,33101,33101,33115,33137,
+33239,33239,33314,33314,33341,33341,33314,33314,
+33215,33215,33187,33188,33218,33218,33269,33269,
+33334,33356,33402,33402,33421,33421,33422,33419,
+33402,33402,33369,33369,33334,33324,33311,33311,
+33320,33320,33341,33350,33380,33380,33423,33423,
+33469,33484,33511,33511,33523,33523,33539,33545,
+33559,33559,33552,33552,33535,33540,33584,33584,
+33699,33699,33770,33794,33842,33842,33912,33912,
+33969,33987,34013,34013,34018,34018,34004,33995,
+33962,33962,33908,33908,33864,33857,33869,33869,
+33951,33951,33963,33955,33903,33903,33878,33878,
+33882,33873,33825,33825,33729,33729,33673,33654,
+33616,33616,33621,33621,33663,33671,33665,33665,
+33608,33608,33580,33571,33559,33559,33565,33565,
+33588,33591,33591,33591,33557,33557,33541,33539,
+33546,33546,33653,33653,33825,33882,33999,33999,
+34062,34062,38941,37334,36711,36612,37755,38059,
+38023,34581,34626,34626,34749,34749,34796,34805,
+34805,34805,34737,34737,34621,34584,34512,34512,
+34482,34482,34462,34456,34446,34446,34457,34457,
+34490,34507,34557,34557,34632,34632,34649,34646,
+34614,34614,34553,34553,34488,34470,34452,34452,
+34482,34482,34556,34591,34684,34684,34797,33454,
+32584,31757,31553,31476,34306,34306,34225,34235,
+34364,34364,34474,34474,34567,34608,34720,34720,
+34889,34889,34914,34903,34827,34827,34750,34750,
+34699,34677,34626,34626,34570,34570,34602,34630,
+34729,34729,34789,34789,34785,34779,34754,34754,
+34710,34710,34682,34674,34657,34657,34650,34650,
+34653,34653,34647,34647,34632,34632,34629,34630,
+34638,34638,34668,34668,34705,34705,34669,34669,
+34533,34533,34444,34414,34356,34356,34351,34351,
+34398,34408,34409,34409,34363,34363,34349,34347,
+34356,34356,34318,34318,34250,34220,34141,34141,
+34024,34024,33962,33946,33934,33934,33963,33963,
+34017,34031,34048,34048,34016,34016,33987,33975,
+33945,33945,33941,33941,33964,33969,33974,33974,
+33953,33953,33963,33971,34009,34009,34047,34047,
+34064,34070,34078,34078,34076,34076,34013,33996,
+33972,33972,33952,33952,33935,33927,33907,33907,
+33879,33879,33858,33851,33839,33839,33830,33830,
+33824,33823,33822,33822,33826,33826,33824,33822,
+33814,33814,33790,33790,33762,33753,33728,33728,
+33705,33705,33698,33696,33689,33689,33669,33669,
+33649,33642,33623,33623,33610,33610,33618,33624,
+33644,33644,33659,33659,33661,33663,33671,33671,
+33697,33697,33733,33748,33786,33786,33809,33809,
+33814,33815,33813,33813,33820,33820,33811,33804,
+33779,33779,33723,33723,33662,33649,33649,33649,
+33721,33721,33770,33788,33829,33829,33865,33865,
+33885,33900,33955,33955,34058,34058,34095,34096,
+34063,34063,34031,34031,34030,32207,32427,32174,
+31449,31310,31498,32674,33134,33431,33650,33856,
+33958,34061,34397,34989,35703,35992,34854,34863,
+34874,34874,35079,35079,35071,35062,35029,35029,
+34913,34913,34659,34549,34249,34249,33979,33979,
+33892,33888,33954,33954,34073,34073,34281,34371,
+34611,34611,34659,34659,34567,34553,34579,34579,
+34748,34748,34797,34801,34773,34773,34702,34702,
+34617,34582,34488,34488,34370,34370,34236,34174,
+33999,33999,33899,33899,33901,33893,33850,33850,
+33742,33742,33706,33708,33750,33750,33740,33740,
+33654,33632,33604,33604,33641,33641,33606,33582,
+33496,33496,33395,33395,33315,33286,33219,33219,
+33150,33150,33132,33134,33161,33161,33203,33203,
+33248,33255,33244,33244,33175,33175,33131,33114,
+33078,33078,33074,33074,33091,33081,33013,33013,
+32831,32831,32759,32749,32770,32770,32735,32735,
+32651,32628,32595,32595,32620,32620,32642,32653,
+32685,32685,32695,32695,32670,32669,32686,32686,
+32757,32757,32747,32730,32657,32657,32632,32632,
+32666,32674,32679,32679,32654,32654,32673,32691,
+32763,32763,32886,32886,33030,33096,33283,33283,
+33543,33543,33807,33921,34220,34220,34433,34433,
+34475,34488,34507,34507,34488,34488,34508,34526,
+34595,34595,34615,34615,34562,34543,34494,34494,
+34457,34457,34421,34412,34400,34400,34311,34311,
+34165,34129,34091,34091,34163,34163,34125,34094,
+33979,33979,33892,33892,33859,33849,33829,33829,
+33781,33781,33735,33719,33688,33688,33568,33568,
+33414,33373,33325,33325,33408,33408,33462,33473,
+33483,33483,33340,33340,33067,32959,32685,32685,
+32429,32429,32418,32457,32663,32663,32882,32882,
+33001,33043,33137,33137,33242,33242,33389,33455,
+33634,33634,33761,33761,33768,33772,33785,33785,
+33831,33831,33841,33839,33823,33823,33753,33753,
+33652,33614,33521,33521,33454,33454,33412,33397,
+33364,33364,33369,33369,33404,33413,33420,33420,
+33388,33388,33380,33379,33384,33384,33341,33341,
+33286,33261,33196,33196,33101,33101,33115,33137,
+33239,33239,33314,33314,33341,33341,33314,33314,
+33215,33215,33187,33188,33218,33218,33269,33269,
+33334,33356,33402,33402,33421,33421,33422,33419,
+33402,33402,33369,33369,33334,33324,33311,33311,
+33320,33320,33341,33350,33380,33380,33423,33423,
+33469,33484,33511,33511,33523,33523,33539,33545,
+33559,33559,33552,33552,33535,33540,33584,33584,
+33699,33699,33770,33794,33842,33842,33912,33912,
+33969,33987,34013,34013,34018,34018,34004,33995,
+33962,33962,33908,33908,33864,33857,33869,33869,
+33951,33951,33963,33955,33903,33903,33878,33878,
+33882,33873,33825,33825,33729,33729,33673,33654,
+33616,33616,33621,33621,33663,33671,33665,33665,
+33608,33608,33580,33571,33559,33559,33565,33565,
+33588,33591,33591,33591,33557,33557,33541,33539,
+33546,33546,33653,33653,33825,33882,33999,33999,
+34062,34062,38289,36994,37011,37350,37641,37718,
+37576,34581,34626,34626,34749,34749,34796,34805,
+34805,34805,34737,34737,34621,34584,34512,34512,
+34482,34482,34462,34456,34446,34446,34457,34457,
+34490,34507,34557,34557,34632,34632,34649,34646,
+34614,34614,34553,34553,34488,34470,34452,34452,
+34482,34482,34556,34591,34684,34684,34797,34797,
+33030,32488,32478,32630,34306,34306,32722,34235,
+34364,34364,34474,34474,34567,34608,34720,34720,
+35190,35190,35239,35237,35174,35174,35082,35082,
+34998,34971,34926,34926,34929,34929,34975,35002,
+35086,35086,35122,35122,35090,35073,35023,35023,
+34957,34957,34921,34909,34887,34887,34909,34909,
+34965,34976,34980,34980,34925,34925,34908,34907,
+34919,34919,34909,34909,34877,34864,34838,34838,
+34807,34807,34740,34705,34598,34598,34564,34564,
+34613,34624,34631,34631,34591,34591,34556,34543,
+34508,34508,34461,34461,34419,34403,34371,34371,
+34338,34338,34297,34278,34231,34231,34243,34243,
+34300,34311,34308,34308,34229,34229,34164,34139,
+34081,34081,34089,34089,34160,34176,34189,34189,
+34134,34134,34159,34183,34281,34281,34368,34368,
+34406,34415,34421,34421,34388,34388,34323,34313,
+34325,34325,34331,34331,34329,34325,34306,34306,
+34273,34273,34255,34248,34235,34235,34225,34225,
+34216,34213,34205,34205,34198,34198,34194,34193,
+34187,34187,34167,34167,34142,34132,34108,34108,
+34086,34086,34078,34076,34072,34072,34062,34062,
+34046,34038,34018,34018,34002,34002,34010,34017,
+34040,34040,34051,34051,34054,34057,34068,34068,
+34088,34088,34113,34125,34154,34154,34171,34171,
+34169,34166,34153,34153,34125,34125,34082,34060,
+33994,33994,33944,33944,33932,33933,33951,33951,
+34007,34007,34051,34070,34117,34117,34181,34181,
+34241,34263,34312,34312,34350,34350,34337,34319,
+34241,34241,34132,34132,34091,32698,33554,33395,
+32054,32038,32451,33137,33297,33532,34016,34422,
+35033,36487,36523,36490,36394,36881,37177,36707,
+36014,35584,35457,35416,35505,35527,35550,35550,
+35367,35367,35093,34979,34679,34679,34266,34266,
+33994,33960,34062,34062,34517,34517,34935,35084,
+35406,35406,35424,35424,35217,35166,35112,35112,
+35240,35240,35273,35273,35235,35235,35192,35192,
+35166,35139,35034,35034,34832,34832,34655,34581,
+34384,34384,34302,34302,34356,34365,34357,34357,
+34281,34281,34216,34194,34141,34141,34118,34118,
+34104,34093,34056,34056,33998,33998,33942,33922,
+33875,33875,33817,33817,33761,33739,33684,33684,
+33609,33609,33602,33613,33671,33671,33713,33713,
+33724,33722,33698,33698,33633,33633,33621,33624,
+33653,33653,33682,33682,33684,33669,33588,33588,
+33394,33394,33329,33324,33368,33368,33340,33340,
+33237,33202,33126,33126,33065,33065,33030,33020,
+33009,33009,33026,33026,33053,33069,33123,33123,
+33218,33218,33239,33236,33199,33199,33182,33182,
+33194,33201,33223,33223,33260,33260,33257,33254,
+33237,33237,33327,33327,33503,33591,33852,33852,
+34257,34257,34551,34656,34883,34883,35134,35134,
+35316,35374,35478,35478,35487,35487,35489,35491,
+35501,35501,35511,35511,35507,35495,35436,35436,
+35310,35310,35211,35180,35129,35129,35097,35097,
+35081,35075,35063,35063,35028,35028,34835,34730,
+34399,34399,34289,34289,34442,34513,34720,34720,
+34974,34974,35000,34980,34852,34852,34659,34659,
+34482,34432,34357,34357,34391,34391,34482,34525,
+34651,34651,34565,34565,34267,34139,33799,33799,
+33409,33409,33322,33339,33508,33508,33709,33709,
+33829,33870,33953,33953,34026,34026,34137,34188,
+34334,34334,34433,34433,34437,34425,34363,34363,
+34228,34228,34164,34149,34139,34139,34111,34111,
+34064,34040,33969,33969,33872,33872,33813,33794,
+33756,33756,33720,33720,33698,33696,33708,33708,
+33750,33750,33739,33725,33670,33670,33616,33616,
+33603,33594,33563,33563,33488,33488,33500,33518,
+33598,33598,33650,33650,33656,33650,33614,33614,
+33519,33519,33522,33540,33627,33627,33675,33675,
+33676,33680,33703,33703,33747,33747,33757,33757,
+33743,33743,33722,33722,33706,33703,33702,33702,
+33717,33717,33734,33741,33757,33757,33790,33790,
+33838,33854,33886,33886,33903,33903,33925,33935,
+33962,33962,33960,33960,33936,33937,33967,33967,
+34059,34059,34135,34167,34245,34245,34341,34341,
+34416,34439,34478,34478,34481,34481,34514,34534,
+34597,34597,34514,34514,34326,34276,34217,34217,
+34305,34305,34325,34320,34277,34277,34249,34249,
+34243,34237,34213,34213,34173,34173,34126,34104,
+34044,34044,34016,34016,34026,34024,34003,34003,
+33950,33950,33926,33922,33919,33919,33929,33929,
+33946,33950,33952,33952,33932,33932,33914,33909,
+33902,33902,33972,33972,34093,34148,34299,34299,
+34527,34527,34837,34895,34874,34874,34789,34789,
+34698,34704,34824,34824,35150,35150,35298,35333,
+35359,35359,35232,35232,34997,34942,34903,34903,
+35096,35096,35143,35139,35074,35074,34998,34998,
+34940,34922,34886,34886,34868,34868,34868,34871,
+34886,34886,34843,34843,34757,34733,34697,34697,
+34710,34710,34739,34754,34794,34794,34818,34818,
+34839,34827,34745,34745,34519,34519,34451,32464,
+32624,34468,34692,34692,34787,34835,34975,34975,
+35190,35190,35239,35237,35174,35174,35082,35082,
+34998,34971,34926,34926,34929,34929,34975,35002,
+35086,35086,35122,35122,35090,35073,35023,35023,
+34957,34957,34921,34909,34887,34887,34909,34909,
+34965,34976,34980,34980,34925,34925,34908,34907,
+34919,34919,34909,34909,34877,34864,34838,34838,
+34807,34807,34740,34705,34598,34598,34564,34564,
+34613,34624,34631,34631,34591,34591,34556,34543,
+34508,34508,34461,34461,34419,34403,34371,34371,
+34338,34338,34297,34278,34231,34231,34243,34243,
+34300,34311,34308,34308,34229,34229,34164,34139,
+34081,34081,34089,34089,34160,34176,34189,34189,
+34134,34134,34159,34183,34281,34281,34368,34368,
+34406,34415,34421,34421,34388,34388,34323,34313,
+34325,34325,34331,34331,34329,34325,34306,34306,
+34273,34273,34255,34248,34235,34235,34225,34225,
+34216,34213,34205,34205,34198,34198,34194,34193,
+34187,34187,34167,34167,34142,34132,34108,34108,
+34086,34086,34078,34076,34072,34072,34062,34062,
+34046,34038,34018,34018,34002,34002,34010,34017,
+34040,34040,34051,34051,34054,34057,34068,34068,
+34088,34088,34113,34125,34154,34154,34171,34171,
+34169,34166,34153,34153,34125,34125,34082,34060,
+33994,33994,33944,33944,33932,33933,33951,33951,
+34007,34007,34051,34070,34117,34117,34181,34181,
+34241,34263,34312,34312,34350,34350,34337,34319,
+34241,34241,34132,34132,34091,32755,33560,33770,
+32173,32244,32879,33375,33254,33468,33755,34467,
+35380,37085,37193,36688,36620,37085,37374,36342,
+35860,35591,35410,35416,35505,35527,35550,35550,
+35367,35367,35093,34979,34679,34679,34266,34266,
+33994,33960,34062,34062,34517,34517,34935,35084,
+35406,35406,35424,35424,35217,35166,35112,35112,
+35240,35240,35273,35273,35235,35235,35192,35192,
+35166,35139,35034,35034,34832,34832,34655,34581,
+34384,34384,34302,34302,34356,34365,34357,34357,
+34281,34281,34216,34194,34141,34141,34118,34118,
+34104,34093,34056,34056,33998,33998,33942,33922,
+33875,33875,33817,33817,33761,33739,33684,33684,
+33609,33609,33602,33613,33671,33671,33713,33713,
+33724,33722,33698,33698,33633,33633,33621,33624,
+33653,33653,33682,33682,33684,33669,33588,33588,
+33394,33394,33329,33324,33368,33368,33340,33340,
+33237,33202,33126,33126,33065,33065,33030,33020,
+33009,33009,33026,33026,33053,33069,33123,33123,
+33218,33218,33239,33236,33199,33199,33182,33182,
+33194,33201,33223,33223,33260,33260,33257,33254,
+33237,33237,33327,33327,33503,33591,33852,33852,
+34257,34257,34551,34656,34883,34883,35134,35134,
+35316,35374,35478,35478,35487,35487,35489,35491,
+35501,35501,35511,35511,35507,35495,35436,35436,
+35310,35310,35211,35180,35129,35129,35097,35097,
+35081,35075,35063,35063,35028,35028,34835,34730,
+34399,34399,34289,34289,34442,34513,34720,34720,
+34974,34974,35000,34980,34852,34852,34659,34659,
+34482,34432,34357,34357,34391,34391,34482,34525,
+34651,34651,34565,34565,34267,34139,33799,33799,
+33409,33409,33322,33339,33508,33508,33709,33709,
+33829,33870,33953,33953,34026,34026,34137,34188,
+34334,34334,34433,34433,34437,34425,34363,34363,
+34228,34228,34164,34149,34139,34139,34111,34111,
+34064,34040,33969,33969,33872,33872,33813,33794,
+33756,33756,33720,33720,33698,33696,33708,33708,
+33750,33750,33739,33725,33670,33670,33616,33616,
+33603,33594,33563,33563,33488,33488,33500,33518,
+33598,33598,33650,33650,33656,33650,33614,33614,
+33519,33519,33522,33540,33627,33627,33675,33675,
+33676,33680,33703,33703,33747,33747,33757,33757,
+33743,33743,33722,33722,33706,33703,33702,33702,
+33717,33717,33734,33741,33757,33757,33790,33790,
+33838,33854,33886,33886,33903,33903,33925,33935,
+33962,33962,33960,33960,33936,33937,33967,33967,
+34059,34059,34135,34167,34245,34245,34341,34341,
+34416,34439,34478,34478,34481,34481,34514,34534,
+34597,34597,34514,34514,34326,34276,34217,34217,
+34305,34305,34325,34320,34277,34277,34249,34249,
+34243,34237,34213,34213,34173,34173,34126,34104,
+34044,34044,34016,34016,34026,34024,34003,34003,
+33950,33950,33926,33922,33919,33919,33929,33929,
+33946,33950,33952,33952,33932,33932,33914,33909,
+33902,33902,33972,33972,34093,34148,34299,34299,
+34527,34527,34837,34895,34874,34874,34789,34789,
+37449,34704,34824,34824,35150,35150,35298,35333,
+35359,35359,35232,35232,34997,34942,34903,34903,
+35096,35096,35143,35139,35074,35074,34998,34998,
+34940,34922,34886,34886,34868,34868,34868,34871,
+34886,34886,34843,34843,34757,34733,34697,34697,
+34710,34710,34739,34754,34794,34794,34818,34818,
+34839,34827,34745,34745,34519,34519,34451,32608,
+32483,32831,34692,34692,34787,34835,34975,34975,
+35368,35368,35433,35440,35408,35408,35338,35338,
+35257,35232,35185,35185,35174,35174,35207,35227,
+35299,35299,35329,35329,35295,35279,35235,35235,
+35187,35187,35152,35137,35102,35102,35101,35101,
+35134,35139,35132,35132,35071,35071,35052,35051,
+35070,35070,35058,35058,35016,35007,34995,34995,
+35009,35009,34951,34914,34783,34783,34733,34733,
+34785,34797,34804,34804,34758,34758,34731,34721,
+34704,34704,34672,34672,34635,34624,34599,34599,
+34589,34589,34555,34539,34488,34488,34489,34489,
+34535,34542,34532,34532,34450,34450,34378,34348,
+34276,34276,34275,34275,34343,34359,34372,34372,
+34320,34320,34350,34378,34484,34484,34577,34577,
+34618,34628,34636,34636,34611,34611,34576,34576,
+34613,34613,34643,34643,34652,34649,34628,34628,
+34583,34583,34559,34552,34541,34541,34529,34529,
+34520,34517,34507,34507,34499,34499,34496,34494,
+34489,34489,34467,34467,34439,34428,34401,34401,
+34377,34377,34368,34366,34365,34365,34362,34362,
+34351,34346,34329,34329,34314,34314,34322,34328,
+34346,34346,34356,34356,34361,34364,34373,34373,
+34382,34382,34400,34409,34434,34434,34452,34452,
+34455,34449,34422,34422,34351,34351,34286,34257,
+34182,34182,34141,34141,34149,34156,34179,34179,
+34225,34225,34273,34295,34352,34352,34424,34424,
+34484,34504,34540,34540,34544,34544,34503,34474,
+34372,34372,34215,34215,34132,32707,33370,34064,
+32787,32799,33192,33838,34280,34603,34759,35262,
+35943,37231,36979,36572,36690,37173,37392,36504,
+36097,35924,36017,35949,35663,35697,35743,35743,
+35755,35755,35537,35441,35183,35183,34748,34748,
+34408,34355,34431,34431,34943,34943,35423,35591,
+35956,35956,35966,35966,35713,35640,35533,35533,
+35608,35608,35614,35602,35541,35541,35490,35490,
+35471,35446,35339,35339,35125,35125,34963,34898,
+34740,34740,34686,34686,34748,34759,34756,34756,
+34682,34682,34607,34575,34492,34492,34460,34460,
+34464,34457,34417,34417,34332,34332,34273,34254,
+34217,34217,34167,34167,34111,34089,34030,34030,
+33941,33941,33932,33943,34008,34008,34044,34044,
+34038,34032,34007,34007,33962,33962,33971,33985,
+34045,34045,34084,34084,34074,34055,33974,33974,
+33799,33799,33743,33742,33793,33793,33782,33782,
+33701,33671,33595,33595,33514,33514,33471,33461,
+33453,33453,33465,33465,33485,33496,33532,33532,
+33595,33595,33620,33624,33619,33619,33635,33635,
+33675,33689,33721,33721,33744,33744,33721,33708,
+33666,33666,33745,33745,33926,34017,34286,34286,
+34703,34703,35001,35104,35327,35327,35590,35590,
+35807,35880,36019,36019,36075,36075,36092,36095,
+36091,36091,36103,36103,36117,36107,36048,36048,
+35898,35898,35763,35717,35623,35623,35600,35600,
+35635,35640,35632,35632,35539,35539,35317,35205,
+34865,34865,34758,34758,34928,35009,35242,35242,
+35533,35533,35586,35577,35476,35476,35295,35295,
+35108,35053,34967,34967,34975,34975,35049,35091,
+35220,35220,35164,35164,34913,34804,34512,34512,
+34171,34171,34072,34073,34178,34178,34325,34325,
+34425,34459,34524,34524,34574,34574,34635,34662,
+34734,34734,34770,34770,34748,34725,34633,34633,
+34457,34457,34376,34358,34350,34350,34343,34343,
+34335,34323,34276,34276,34180,34180,34115,34092,
+34046,34046,34000,34000,33968,33965,33975,33975,
+34025,34025,34018,34006,33950,33950,33905,33905,
+33901,33897,33886,33886,33855,33855,33861,33868,
+33899,33899,33925,33925,33937,33933,33904,33904,
+33821,33821,33828,33846,33932,33932,33975,33975,
+33961,33960,33969,33969,34000,34000,34003,34000,
+33985,33985,33971,33971,33968,33968,33968,33968,
+33969,33969,33983,33991,34014,34014,34064,34064,
+34131,34153,34197,34197,34215,34215,34243,34258,
+34303,34303,34323,34323,34313,34316,34339,34339,
+34401,34401,34484,34524,34642,34642,34748,34748,
+34798,34815,34853,34853,34874,34874,34909,34926,
+34977,34977,34885,34885,34697,34643,34565,34565,
+34603,34603,34604,34597,34560,34560,34543,34543,
+34549,34549,34535,34535,34498,34498,34447,34423,
+34355,34355,34323,34323,34333,34331,34311,34311,
+34257,34257,34231,34225,34220,34220,34217,34217,
+34216,34213,34202,34202,34179,34179,34155,34147,
+34132,34132,34181,34181,34274,34322,34466,34466,
+34707,34707,34869,34902,34905,34905,34844,34844,
+34793,34819,35005,35005,35442,35442,35645,35695,
+35738,35738,35620,35620,35388,35337,35306,35306,
+35522,35522,35564,35552,35455,35455,35344,35344,
+35264,35236,35172,35172,35109,35109,35088,35085,
+35091,35091,35047,35047,34964,34938,34891,34891,
+34870,34870,34879,34887,34923,34923,34944,34944,
+34952,34943,34886,34886,34788,34788,33770,32079,
+32057,32642,34773,34773,34960,35023,35157,35157,
+35438,35438,35508,35519,35504,35504,35445,35445,
+35372,35347,35298,35298,35274,35274,35297,35314,
+35381,35381,35409,35409,35376,35362,35325,35325,
+35290,35290,35257,35241,35199,35199,35181,35181,
+35196,35196,35179,35179,35120,35120,35102,35103,
+35125,35125,35117,35117,35079,35070,35066,35066,
+35094,35094,35039,35000,34860,34860,34805,34805,
+34857,34870,34878,34878,34829,34829,34806,34801,
+34798,34798,34775,34775,34740,34728,34707,34707,
+34700,34700,34670,34654,34605,34605,34602,34602,
+34639,34644,34632,34632,34552,34552,34479,34450,
+34373,34373,34365,34365,34425,34440,34451,34451,
+34405,34405,34436,34465,34570,34570,34661,34661,
+34701,34711,34723,34723,34705,34705,34685,34691,
+34740,34740,34781,34781,34793,34791,34767,34767,
+34714,34714,34687,34679,34669,34669,34657,34657,
+34650,34647,34637,34637,34630,34630,34627,34625,
+34619,34619,34596,34596,34566,34553,34525,34525,
+34500,34500,34491,34489,34489,34489,34489,34489,
+34480,34476,34462,34462,34448,34448,34455,34460,
+34476,34476,34485,34485,34490,34492,34500,34500,
+34507,34507,34520,34528,34550,34550,34570,34570,
+34578,34572,34539,34539,34447,34447,34373,34342,
+34266,34266,34229,34229,34243,34251,34275,34275,
+34318,34318,34368,34390,34454,34454,34527,34527,
+34581,34598,34629,34629,34620,34620,34569,34538,
+34427,34427,34253,34253,34154,32954,32970,33764,
+33839,33021,32582,33295,34264,35432,36103,36097,
+36201,36335,36291,36177,36577,37038,37181,36447,
+36287,36248,36349,35581,35713,35752,35815,35815,
+35894,35894,35699,35617,35405,35405,34977,34977,
+34625,34566,34626,34626,35134,35134,35625,35799,
+36175,36175,36184,36184,35918,35839,35711,35711,
+35759,35759,35751,35733,35657,35657,35598,35598,
+35580,35553,35446,35446,35236,35236,35088,35031,
+34896,34896,34857,34857,34918,34929,34924,34924,
+34849,34849,34770,34736,34646,34646,34611,34611,
+34618,34611,34571,34571,34483,34483,34424,34406,
+34370,34370,34318,34318,34259,34235,34173,34173,
+34077,34077,34065,34077,34143,34143,34175,34175,
+34165,34158,34135,34135,34099,34099,34119,34136,
+34205,34205,34248,34248,34232,34213,34132,34132,
+33966,33966,33916,33916,33967,33967,33966,33966,
+33898,33871,33801,33801,33716,33716,33674,33666,
+33663,33663,33672,33672,33683,33690,33713,33713,
+33756,33756,33778,33785,33792,33792,33828,33828,
+33885,33904,33939,33939,33947,33947,33916,33899,
+33850,33850,33926,33926,34107,34196,34461,34461,
+34868,34868,35165,35269,35496,35496,35764,35764,
+35988,36063,36216,36216,36294,36294,36321,36325,
+36319,36319,36334,36334,36353,36345,36288,36288,
+36136,36136,35990,35938,35823,35823,35798,35798,
+35846,35854,35844,35844,35730,35730,35507,35399,
+35080,35080,34978,34978,35139,35216,35439,35439,
+35718,35718,35779,35777,35704,35704,35535,35535,
+35343,35287,35197,35197,35196,35196,35259,35296,
+35416,35416,35369,35369,35146,35050,34793,34793,
+34489,34489,34392,34387,34462,34462,34581,34581,
+34672,34701,34760,34760,34802,34802,34841,34857,
+34893,34893,34898,34898,34861,34834,34734,34734,
+34550,34550,34466,34449,34441,34441,34444,34444,
+34450,34444,34407,34407,34316,34316,34249,34225,
+34173,34173,34125,34125,34094,34091,34099,34099,
+34145,34145,34139,34129,34080,34080,34041,34041,
+34036,34035,34031,34031,34023,34023,34025,34027,
+34033,34033,34047,34047,34062,34061,34038,34038,
+33960,33960,33966,33983,34064,34064,34103,34103,
+34087,34085,34090,34090,34112,34112,34111,34107,
+34091,34091,34082,34082,34085,34085,34084,34084,
+34075,34075,34087,34094,34124,34124,34182,34182,
+34259,34285,34333,34333,34349,34349,34381,34398,
+34453,34453,34483,34483,34482,34486,34507,34507,
+34555,34555,34642,34687,34825,34825,34931,34931,
+34966,34979,35013,35013,35045,35045,35075,35088,
+35123,35123,35029,35029,34856,34804,34723,34723,
+34732,34732,34722,34714,34680,34680,34668,34668,
+34683,34684,34674,34674,34632,34632,34577,34552,
+34483,34483,34452,34452,34465,34464,34446,34446,
+34389,34389,34362,34355,34348,34348,34339,34339,
+34327,34321,34304,34304,34278,34278,34251,34239,
+34211,34211,34253,34253,34338,34382,34523,34523,
+34760,34760,34880,34906,34919,34919,34869,34869,
+34830,34868,35096,35096,35565,35565,35788,35842,
+35891,35891,35784,35784,35568,35519,35491,35491,
+35696,35696,35727,35712,35601,35601,35481,35481,
+35399,35369,35298,35298,35220,35220,35188,35181,
+35177,35177,35129,35129,35050,35024,34973,34973,
+34937,34937,34940,34949,34988,34988,35012,35012,
+35018,35010,34966,34966,34046,33774,33118,31369,
+31224,31643,34862,34862,35049,35111,35235,35235,
+35598,35598,35676,35700,35738,35738,35737,35737,
+35703,35683,35620,35620,35513,35513,35492,35498,
+35549,35549,35582,35582,35569,35567,35568,35568,
+35595,35595,35574,35555,35485,35485,35389,35389,
+35304,35276,35220,35220,35183,35183,35180,35187,
+35223,35223,35253,35253,35260,35266,35286,35286,
+35322,35322,35261,35219,35064,35064,35001,35001,
+35057,35069,35072,35072,35009,35009,35018,35034,
+35105,35105,35129,35129,35090,35077,35046,35046,
+35023,35023,34999,34989,34964,34964,34952,34952,
+34955,34952,34934,34934,34884,34884,34822,34792,
+34707,34707,34662,34662,34671,34674,34674,34674,
+34667,34667,34701,34722,34800,34800,34864,34864,
+34889,34899,34923,34923,34948,34948,34999,35026,
+35111,35111,35177,35177,35194,35191,35159,35159,
+35060,35060,35019,35010,35007,35007,34994,34994,
+34999,35000,34998,34998,34999,34999,34998,34995,
+34983,34983,34947,34947,34907,34892,34860,34860,
+34835,34835,34823,34820,34819,34819,34826,34826,
+34826,34825,34819,34819,34812,34812,34815,34817,
+34824,34824,34826,34826,34831,34832,34837,34837,
+34833,34833,34834,34837,34852,34852,34885,34885,
+34923,34920,34867,34867,34708,34708,34610,34579,
+34517,34517,34487,34487,34500,34507,34530,34530,
+34566,34566,34621,34648,34730,34730,34793,34793,
+34808,34812,34817,34817,34791,34791,34727,34690,
+34573,34573,34372,34372,34239,32922,33006,33733,
+33498,32941,32444,33397,34779,35690,36648,36114,
+36146,36058,36164,36185,36482,36698,36818,36899,
+36851,36864,36691,36444,36014,34771,34612,34628,
+34635,36136,35996,35981,36049,36049,35736,35736,
+35436,35374,35363,35363,35712,35712,36142,36305,
+36691,36691,36710,36710,36439,36351,36178,36178,
+36140,36140,36072,36031,35897,35897,35793,35793,
+35747,35717,35619,35619,35465,35465,35392,35373,
+35346,35346,35360,35360,35397,35400,35375,35375,
+35280,35280,35200,35169,35091,35091,35052,35052,
+35040,35030,34994,34994,34943,34943,34893,34873,
+34820,34820,34739,34739,34653,34619,34535,34535,
+34415,34415,34391,34399,34462,34462,34488,34488,
+34472,34467,34461,34461,34466,34466,34506,34529,
+34608,34608,34649,34649,34619,34598,34527,34527,
+34407,34407,34370,34370,34408,34408,34434,34434,
+34426,34419,34389,34389,34325,34325,34312,34317,
+34352,34352,34347,34347,34300,34282,34237,34237,
+34183,34183,34185,34194,34236,34236,34344,34344,
+34490,34527,34567,34567,34487,34487,34425,34406,
+34368,34368,34441,34441,34600,34674,34880,34880,
+35180,35180,35458,35570,35849,35849,36127,36127,
+36321,36393,36559,36559,36712,36712,36783,36799,
+36810,36810,36842,36842,36870,36868,36830,36830,
+36719,36719,36557,36489,36309,36309,36243,36243,
+36281,36282,36251,36251,36094,36094,35946,35888,
+35748,35748,35686,35686,35725,35750,35834,35834,
+35933,35933,35996,36024,36103,36103,36020,36020,
+35815,35755,35656,35656,35641,35641,35649,35657,
+35687,35687,35657,35657,35556,35516,35416,35416,
+35324,35324,35264,35247,35218,35218,35245,35245,
+35299,35320,35362,35362,35397,35397,35372,35350,
+35266,35266,35160,35160,35064,35024,34920,34920,
+34786,34786,34722,34708,34697,34697,34717,34717,
+34763,34772,34769,34769,34708,34708,34641,34613,
+34539,34539,34495,34495,34491,34490,34488,34488,
+34486,34486,34486,34486,34491,34491,34476,34476,
+34450,34449,34467,34467,34544,34544,34532,34511,
+34421,34421,34393,34393,34437,34447,34448,34448,
+34394,34394,34383,34388,34423,34423,34450,34450,
+34460,34462,34462,34462,34443,34443,34424,34417,
+34402,34402,34402,34402,34419,34420,34409,34409,
+34352,34352,34352,34363,34416,34416,34514,34514,
+34627,34661,34723,34723,34729,34729,34769,34795,
+34879,34879,34951,34951,34989,35002,35023,35023,
+35027,35027,35128,35188,35389,35389,35489,35489,
+35446,35440,35455,35455,35523,35523,35514,35499,
+35424,35424,35339,35339,35293,35270,35204,35204,
+35091,35091,35036,35020,34996,34996,35008,35008,
+35060,35069,35061,35061,34973,34973,34900,34873,
+34807,34807,34793,34793,34833,34839,34833,34833,
+34768,34768,34729,34717,34699,34699,34659,34659,
+34612,34594,34553,34553,34506,34506,34471,34439,
+34314,34314,34353,34353,34429,34469,34591,40416,
+34782,34782,34885,34915,39746,34956,34932,34932,
+34915,34998,35431,35431,35892,35892,36144,36206,
+36260,36260,36223,36223,36125,36098,36067,36067,
+36130,36130,36088,36051,35911,35911,35793,35793,
+35746,35723,35663,35663,35570,35570,35498,35470,
+35402,35402,35330,35330,35277,35255,35196,35196,
+35110,35110,35116,35135,35230,35230,35287,35287,
+35295,35296,35292,35292,35276,34342,33941,32579,
+32032,31747,32062,32764,35382,35390,35451,35451,
+35598,35598,35676,35700,35738,35738,35737,35737,
+35703,35683,35620,35620,35513,35513,35492,35498,
+35549,35549,35582,35582,35569,35567,35568,35568,
+35595,35595,35574,35555,35485,35485,35389,35389,
+35304,35276,35220,35220,35183,35183,35180,35187,
+35223,35223,35253,35253,35260,35266,35286,35286,
+35322,35322,35261,35219,35064,35064,35001,35001,
+35057,35069,35072,35072,35009,35009,35018,35034,
+35105,35105,35129,35129,35090,35077,35046,35046,
+35023,35023,34999,34989,34964,34964,34952,34952,
+34955,34952,34934,34934,34884,34884,34822,34792,
+34707,34707,34662,34662,34671,34674,34674,34674,
+34667,34667,34701,34722,34800,34800,34864,34864,
+34889,34899,34923,34923,34948,34948,34999,35026,
+35111,35111,35177,35177,35194,35191,35159,35159,
+35060,35060,35019,35010,35007,35007,34994,34994,
+34999,35000,34998,34998,34999,34999,34998,34995,
+34983,34983,34947,34947,34907,34892,34860,34860,
+34835,34835,34823,34820,34819,34819,34826,34826,
+34826,34825,34819,34819,34812,34812,34815,34817,
+34824,34824,34826,34826,34831,34832,34837,34837,
+34833,34833,34834,34837,34852,34852,34885,34885,
+34923,34920,34867,34867,34708,34708,34610,34579,
+34517,34517,34487,34487,34500,34507,34530,34530,
+34566,34566,34621,34648,34730,34730,34793,34793,
+34808,34812,34817,34817,34791,34791,34727,34690,
+34573,34573,34372,34372,34239,32817,32975,33844,
+33306,32799,32444,33908,35107,35673,36453,36621,
+36125,35903,36002,36180,36098,36360,36549,37065,
+37136,37202,36865,36452,35972,34778,34710,34776,
+34873,34917,35013,35120,36049,36049,35736,35736,
+35436,35374,35363,35363,35712,35712,36142,36305,
+36691,36691,36710,36710,36439,36351,36178,36178,
+36140,36140,36072,36031,35897,35897,35793,35793,
+35747,35717,35619,35619,35465,35465,35392,35373,
+35346,35346,35360,35360,35397,35400,35375,35375,
+35280,35280,35200,35169,35091,35091,35052,35052,
+35040,35030,34994,34994,34943,34943,34893,34873,
+34820,34820,34739,34739,34653,34619,34535,34535,
+34415,34415,34391,34399,34462,34462,34488,34488,
+34472,34467,34461,34461,34466,34466,34506,34529,
+34608,34608,34649,34649,34619,34598,34527,34527,
+34407,34407,34370,34370,34408,34408,34434,34434,
+34426,34419,34389,34389,34325,34325,34312,34317,
+34352,34352,34347,34347,34300,34282,34237,34237,
+34183,34183,34185,34194,34236,34236,34344,34344,
+34490,34527,34567,34567,34487,34487,34425,34406,
+34368,34368,34441,34441,34600,34674,34880,34880,
+35180,35180,35458,35570,35849,35849,36127,36127,
+36321,36393,36559,36559,36712,36712,36783,36799,
+36810,36810,36842,36842,36870,36868,36830,36830,
+36719,36719,36557,36489,36309,36309,36243,36243,
+36281,36282,36251,36251,36094,36094,35946,35888,
+35748,35748,35686,35686,35725,35750,35834,35834,
+35933,35933,35996,36024,36103,36103,36020,36020,
+35815,35755,35656,35656,35641,35641,35649,35657,
+35687,35687,35657,35657,35556,35516,35416,35416,
+35324,35324,35264,35247,35218,35218,35245,35245,
+35299,35320,35362,35362,35397,35397,35372,35350,
+35266,35266,35160,35160,35064,35024,34920,34920,
+34786,34786,34722,34708,34697,34697,34717,34717,
+34763,34772,34769,34769,34708,34708,34641,34613,
+34539,34539,34495,34495,34491,34490,34488,34488,
+34486,34486,34486,34486,34491,34491,34476,34476,
+34450,34449,34467,34467,34544,34544,34532,34511,
+34421,34421,34393,34393,34437,34447,34448,34448,
+34394,34394,34383,34388,34423,34423,34450,34450,
+34460,34462,34462,34462,34443,34443,34424,34417,
+34402,34402,34402,34402,34419,34420,34409,34409,
+34352,34352,34352,34363,34416,34416,34514,34514,
+34627,34661,34723,34723,34729,34729,34769,34795,
+34879,34879,34951,34951,34989,35002,35023,35023,
+35027,35027,35128,35188,35389,35389,35489,35489,
+35446,35440,35455,35455,35523,35523,35514,35499,
+35424,35424,35339,35339,35293,35270,35204,35204,
+35091,35091,35036,35020,34996,34996,35008,35008,
+35060,35069,35061,35061,34973,34973,34900,34873,
+34807,34807,34793,34793,34833,34839,34833,34833,
+34768,34768,34729,34717,34699,34699,34659,34659,
+34612,34594,34553,34553,34506,34506,34471,34439,
+34314,34314,34353,34353,34429,41038,41241,41478,
+34782,34782,34885,40743,40635,40081,34932,34932,
+34915,34998,35431,35431,35892,35892,36144,36206,
+36260,36260,36223,36223,36125,36098,36067,36067,
+36130,36130,36088,36051,35911,35911,35793,35793,
+35746,35723,35663,35663,35570,35570,35498,35470,
+35402,35402,35330,35330,35277,35255,35196,35196,
+35110,35110,35116,35135,35230,35230,35287,35287,
+35295,35296,35292,35292,35276,34596,34400,33437,
+33120,32705,31844,32072,32951,35390,35451,35451,
+35855,35855,35914,35932,35966,35966,35969,35969,
+35941,35924,35864,35864,35760,35760,35734,35738,
+35780,35780,35825,35825,35840,35845,35859,35859,
+35880,35880,35850,35829,35753,35753,35635,35635,
+35522,35488,35430,35430,35421,35421,35415,35415,
+35421,35421,35444,35444,35467,35478,35504,35504,
+35538,35538,35475,35431,35273,35273,35216,35216,
+35287,35302,35309,35309,35236,35236,35256,35280,
+35384,35384,35429,35429,35393,35382,35358,35358,
+35350,35350,35338,35333,35316,35316,35289,35289,
+35261,35251,35224,35224,35193,35193,35148,35126,
+35058,35058,35005,35005,34987,34982,34973,34973,
+34968,34968,35004,35026,35102,35102,35137,35137,
+35123,35121,35127,35127,35161,35161,35228,35265,
+35378,35378,35475,35475,35523,35533,35529,35529,
+35461,35461,35426,35417,35402,35402,35384,35384,
+35394,35397,35403,35403,35406,35406,35400,35395,
+35378,35378,35335,35335,35286,35269,35233,35233,
+35209,35209,35195,35192,35186,35186,35192,35192,
+35201,35204,35210,35210,35210,35210,35210,35210,
+35207,35207,35201,35201,35204,35205,35206,35206,
+35192,35192,35179,35176,35177,35177,35206,35206,
+35244,35238,35174,35174,35002,35002,34894,34858,
+34789,34789,34762,34762,34790,34801,34833,34833,
+34869,34869,34908,34925,34975,34975,35001,35001,
+34986,34980,34967,34967,34930,34930,34863,34827,
+34714,34714,34508,34508,34390,32476,33023,34535,
+33582,32970,32293,34048,34685,35416,36311,36169,
+36107,36136,36082,36514,36174,36099,35923,36811,
+37205,37323,37073,36853,36605,35932,35919,35930,
+35968,36054,36159,36326,36501,36677,36488,36488,
+36307,36257,36184,36184,36324,36324,36625,36748,
+37064,37064,37091,37091,36879,36801,36627,36627,
+36527,36527,36423,36371,36219,36219,36094,36094,
+36026,35997,35918,35918,35836,35836,35797,35787,
+35781,35781,35795,35795,35813,35809,35768,35768,
+35657,35657,35587,35563,35519,35519,35475,35475,
+35428,35412,35376,35376,35368,35368,35341,35324,
+35273,35273,35178,35178,35075,35035,34937,34937,
+34805,34805,34784,34796,34877,34877,34894,34894,
+34842,34830,34819,34819,34858,34858,34904,34925,
+34985,34985,35022,35022,35003,34988,34933,34933,
+34841,34841,34817,34820,34859,34859,34910,34910,
+34948,34955,34954,34954,34899,34899,34895,34904,
+34950,34950,34925,34925,34838,34808,34746,34746,
+34698,34698,34699,34706,34743,34743,34872,34872,
+35054,35100,35150,35150,35049,35049,34997,34985,
+34978,34978,35053,35053,35183,35238,35381,35381,
+35565,35565,35779,35872,36123,36123,36363,36363,
+36528,36592,36753,36753,36929,36929,37029,37058,
+37104,37104,37184,37184,37246,37261,37278,37278,
+37257,37257,37119,37049,36842,36842,36760,36760,
+36807,36811,36783,36783,36635,36635,36517,36476,
+36388,36388,36312,36312,36275,36266,36263,36263,
+36261,36261,36301,36333,36445,36445,36406,36406,
+36237,36186,36104,36104,36080,36080,36047,36034,
+36002,36002,35965,35965,35926,35914,35889,35889,
+35887,35887,35851,35831,35767,35767,35727,35727,
+35722,35724,35739,35739,35771,35771,35731,35700,
+35586,35586,35465,35465,35378,35343,35258,35258,
+35161,35161,35111,35099,35086,35086,35101,35101,
+35141,35152,35162,35162,35131,35131,35085,35063,
+35002,35002,34982,34982,35004,35006,34996,34996,
+34953,34953,34945,34949,34975,34975,34983,34983,
+34966,34966,34980,34980,35047,35047,35017,34988,
+34872,34872,34841,34841,34906,34924,34946,34946,
+34917,34917,34890,34882,34866,34866,34874,34874,
+34901,34908,34911,34911,34876,34876,34848,34841,
+34828,34828,34827,34827,34838,34838,34825,34825,
+34770,34770,34770,34782,34838,34838,34938,34938,
+35040,35072,35132,35132,35144,35144,35180,35202,
+35270,35270,35353,35353,35423,35444,35481,35481,
+35486,35486,35580,35636,35826,35826,35921,35921,
+35882,35878,35894,35894,35961,35961,35927,35896,
+35770,35770,35683,35683,35689,35679,35625,35625,
+35484,35484,35424,35411,35404,35404,35424,35424,
+35469,35474,35453,35453,35337,35337,35249,35217,
+35149,35149,35123,35123,35145,35148,35138,35138,
+35080,35080,35036,35021,34994,34994,34958,34958,
+34922,34907,34871,34871,34796,34796,34751,34714,
+37503,38534,40070,39250,40735,41139,41341,41067,
+41073,41306,41523,40039,39534,39266,39452,39392,
+39709,39837,39671,39166,36350,36350,36581,36643,
+36726,36726,36747,36747,36714,36697,36649,36649,
+36597,36597,36502,36452,36297,36297,36163,36163,
+36103,36079,36014,36014,35935,35935,35855,35821,
+35730,35730,35633,35633,35562,35539,35491,35491,
+35455,35455,35461,35473,35529,35529,35578,35578,
+35614,35622,35624,35624,35573,35573,34539,34346,
+35945,35945,35962,35962,33771,35738,35753,35753,
+35855,35855,35914,35932,35966,35966,35969,35969,
+35941,35924,35864,35864,35760,35760,35734,35738,
+35780,35780,35825,35825,35840,35845,35859,35859,
+35880,35880,35850,35829,35753,35753,35635,35635,
+35522,35488,35430,35430,35421,35421,35415,35415,
+35421,35421,35444,35444,35467,35478,35504,35504,
+35538,35538,35475,35431,35273,35273,35216,35216,
+35287,35302,35309,35309,35236,35236,35256,35280,
+35384,35384,35429,35429,35393,35382,35358,35358,
+35350,35350,35338,35333,35316,35316,35289,35289,
+35261,35251,35224,35224,35193,35193,35148,35126,
+35058,35058,35005,35005,34987,34982,34973,34973,
+34968,34968,35004,35026,35102,35102,35137,35137,
+35123,35121,35127,35127,35161,35161,35228,35265,
+35378,35378,35475,35475,35523,35533,35529,35529,
+35461,35461,35426,35417,35402,35402,35384,35384,
+35394,35397,35403,35403,35406,35406,35400,35395,
+35378,35378,35335,35335,35286,35269,35233,35233,
+35209,35209,35195,35192,35186,35186,35192,35192,
+35201,35204,35210,35210,35210,35210,35210,35210,
+35207,35207,35201,35201,35204,35205,35206,35206,
+35192,35192,35179,35176,35177,35177,35206,35206,
+35244,35238,35174,35174,35002,35002,34894,34858,
+34789,34789,34762,34762,34790,34801,34833,34833,
+34869,34869,34908,34925,34975,34975,35001,35001,
+34986,34980,34967,34967,34930,34930,34863,34827,
+34714,34714,34508,34508,34390,32707,33334,35128,
+33675,32619,31833,33611,34804,35427,35863,35725,
+35943,36431,36806,36966,36308,36101,36146,36767,
+37213,37513,37486,37466,37428,36958,36919,36904,
+36956,36993,37082,37282,37395,37449,36488,36488,
+36307,36257,36184,36184,36324,36324,36625,36748,
+37064,37064,37091,37091,36879,36801,36627,36627,
+36527,36527,36423,36371,36219,36219,36094,36094,
+36026,35997,35918,35918,35836,35836,35797,35787,
+35781,35781,35795,35795,35813,35809,35768,35768,
+35657,35657,35587,35563,35519,35519,35475,35475,
+35428,35412,35376,35376,35368,35368,35341,35324,
+35273,35273,35178,35178,35075,35035,34937,34937,
+34805,34805,34784,34796,34877,34877,34894,34894,
+34842,34830,34819,34819,34858,34858,34904,34925,
+34985,34985,35022,35022,35003,34988,34933,34933,
+34841,34841,34817,34820,34859,34859,34910,34910,
+34948,34955,34954,34954,34899,34899,34895,34904,
+34950,34950,34925,34925,34838,34808,34746,34746,
+34698,34698,34699,34706,34743,34743,34872,34872,
+35054,35100,35150,35150,35049,35049,34997,34985,
+34978,34978,35053,35053,35183,35238,35381,35381,
+35565,35565,35779,35872,36123,36123,36363,36363,
+36528,36592,36753,36753,36929,36929,37029,37058,
+37104,37104,37184,37184,37246,37261,37278,37278,
+37257,37257,37119,37049,36842,36842,36760,36760,
+36807,36811,36783,36783,36635,36635,36517,36476,
+36388,36388,36312,36312,36275,36266,36263,36263,
+36261,36261,36301,36333,36445,36445,36406,36406,
+36237,36186,36104,36104,36080,36080,36047,36034,
+36002,36002,35965,35965,35926,35914,35889,35889,
+35887,35887,35851,35831,35767,35767,35727,35727,
+35722,35724,35739,35739,35771,35771,35731,35700,
+35586,35586,35465,35465,35378,35343,35258,35258,
+35161,35161,35111,35099,35086,35086,35101,35101,
+35141,35152,35162,35162,35131,35131,35085,35063,
+35002,35002,34982,34982,35004,35006,34996,34996,
+34953,34953,34945,34949,34975,34975,34983,34983,
+34966,34966,34980,34980,35047,35047,35017,34988,
+34872,34872,34841,34841,34906,34924,34946,34946,
+34917,34917,34890,34882,34866,34866,34874,34874,
+34901,34908,34911,34911,34876,34876,34848,34841,
+34828,34828,34827,34827,34838,34838,34825,34825,
+34770,34770,34770,34782,34838,34838,34938,34938,
+35040,35072,35132,35132,35144,35144,35180,35202,
+35270,35270,35353,35353,35423,35444,35481,35481,
+35486,35486,35580,35636,35826,35826,35921,35921,
+35882,35878,35894,35894,35961,35961,35927,35896,
+35770,35770,35683,35683,35689,35679,35625,35625,
+35484,35484,35424,35411,35404,35404,35424,35424,
+35469,35474,35453,35453,35337,35337,35249,35217,
+35149,35149,35123,35123,35145,35148,35138,35138,
+35080,35080,35036,35021,34994,34994,34958,34958,
+34922,34907,34871,34871,34796,34796,34751,37498,
+38393,39409,40456,40900,40893,41348,41430,41176,
+40603,40151,40186,39915,39299,38836,38321,38562,
+38993,39228,38917,38956,36350,36350,36581,36643,
+36726,36726,36747,36747,36714,36697,36649,36649,
+36597,36597,36502,36452,36297,36297,36163,36163,
+36103,36079,36014,36014,35935,35935,35855,35821,
+35730,35730,35633,35633,35562,35539,35491,35491,
+35455,35455,35461,35473,35529,35529,35578,35578,
+35614,35622,35624,35624,35573,34382,34287,34402,
+35945,35945,35962,35962,35772,35738,35753,35753,
+36122,36122,36147,36147,36125,36125,36083,36083,
+36031,36012,35971,35971,35941,35941,35948,35959,
+36003,36003,36059,36059,36094,36101,36099,36099,
+36059,36059,36012,35991,35930,35930,35852,35852,
+35785,35765,35737,35737,35748,35748,35718,35701,
+35644,35644,35619,35619,35628,35632,35649,35649,
+35677,35677,35615,35571,35417,35417,35376,35376,
+35467,35489,35506,35506,35429,35429,35439,35459,
+35547,35547,35582,35582,35549,35541,35533,35533,
+35554,35554,35556,35552,35535,35535,35496,35496,
+35459,35446,35416,35416,35387,35387,35364,35353,
+35325,35325,35294,35294,35277,35270,35248,35248,
+35209,35209,35240,35265,35361,35361,35378,35378,
+35314,35296,35267,35267,35276,35276,35311,35332,
+35399,35399,35493,35493,35583,35613,35673,35673,
+35700,35700,35698,35691,35662,35662,35645,35645,
+35674,35684,35702,35702,35700,35700,35682,35674,
+35651,35651,35611,35611,35568,35552,35516,35516,
+35492,35492,35482,35479,35474,35474,35477,35477,
+35487,35492,35503,35503,35510,35510,35510,35509,
+35503,35503,35494,35494,35497,35497,35495,35495,
+35475,35475,35451,35443,35428,35428,35432,35432,
+35440,35427,35358,35358,35227,35227,35125,35086,
+34994,34994,34967,34967,35021,35041,35087,35087,
+35128,35128,35136,35135,35121,35121,35099,35099,
+35073,35064,35047,35047,35009,35009,34951,34921,
+34826,34826,34632,34632,34518,33022,33462,34577,
+33534,32221,30932,32796,34315,34324,35223,35427,
+35765,36588,37306,37233,36518,36315,36413,36856,
+36986,37259,37846,38016,38103,37964,37901,37872,
+37932,37915,37929,38038,37859,37778,36934,36934,
+36830,36791,36699,36699,36706,36706,36896,36980,
+37212,37212,37262,37262,37151,37101,36966,36966,
+36846,36846,36739,36690,36555,36555,36429,36429,
+36338,36306,36243,36243,36217,36217,36168,36144,
+36075,36075,36044,36044,36051,36043,35994,35994,
+35877,35877,35826,35815,35816,35816,35775,35775,
+35688,35662,35622,35622,35646,35646,35644,35638,
+35608,35608,35527,35527,35427,35387,35290,35290,
+35158,35158,35148,35167,35271,35271,35273,35273,
+35161,35131,35093,35093,35148,35148,35182,35193,
+35216,35216,35248,35248,35257,35250,35210,35210,
+35122,35122,35108,35115,35166,35166,35233,35233,
+35291,35304,35313,35313,35256,35256,35243,35247,
+35278,35278,35235,35235,35132,35106,35072,35072,
+35111,35111,35127,35131,35131,35131,35227,35227,
+35389,35434,35492,35492,35436,35436,35424,35426,
+35458,35458,35544,35544,35654,35697,35799,35799,
+35914,35914,36057,36121,36293,36293,36477,36477,
+36623,36677,36806,36806,36944,36944,37042,37077,
+37153,37153,37276,37276,37371,37404,37475,37475,
+37546,37546,37463,37409,37223,37223,37179,37179,
+37268,37288,37297,37297,37201,37201,37070,37009,
+36841,36841,36710,36710,36658,36644,36629,36629,
+36627,36627,36630,36635,36666,36666,36617,36617,
+36513,36483,36430,36430,36404,36404,36361,36342,
+36295,36295,36243,36243,36198,36180,36138,36138,
+36090,36090,36052,36040,36015,36015,35961,35961,
+35891,35874,35852,35852,35881,35881,35862,35845,
+35778,35778,35722,35722,35695,35679,35627,35627,
+35538,35538,35490,35476,35460,35460,35447,35447,
+35443,35442,35438,35438,35426,35426,35409,35400,
+35375,35375,35388,35388,35430,35437,35428,35428,
+35367,35367,35346,35345,35361,35361,35383,35383,
+35396,35397,35390,35390,35369,35369,35327,35304,
+35234,35234,35234,35234,35305,35326,35357,35357,
+35339,35339,35299,35282,35229,35229,35217,35217,
+35247,35254,35261,35261,35233,35233,35210,35204,
+35194,35194,35182,35182,35172,35169,35165,35165,
+35163,35163,35177,35189,35232,35232,35297,35297,
+35351,35372,35418,35418,35455,35455,35476,35484,
+35504,35504,35563,35563,35644,35672,35728,35728,
+35762,35762,35833,35870,35983,35983,36076,36076,
+36110,36125,36164,36164,36197,36197,36153,36119,
+35994,35994,35896,35896,35882,35870,35829,35829,
+35751,35751,35724,35721,35735,35735,35745,35745,
+35748,35740,35696,35696,35577,35577,35486,35453,
+35380,35380,35324,35324,35306,35299,35276,35276,
+35235,35235,35198,35185,35160,35160,35158,35158,
+35172,35173,35163,35163,35085,35085,34895,37952,
+39105,40163,41442,41678,41817,42244,42250,42176,
+41586,41346,40970,40607,39872,39213,37858,37428,
+37516,38485,38716,38758,36762,36762,36927,36986,
+37112,37112,37166,37166,37135,37116,37047,37047,
+36942,36942,36825,36771,36620,36620,36460,36460,
+36353,36317,36244,36244,36198,36198,36142,36117,
+36049,36049,35938,35938,35814,35784,35755,35755,
+35828,35828,35826,35815,35758,35758,35759,35759,
+35832,35843,35830,35830,35704,34463,35797,35842,
+35976,35976,36036,36036,36000,35999,36031,36031,
+36227,36227,36242,36237,36197,36197,36136,36136,
+36074,36054,36021,36021,36021,36021,36040,36052,
+36094,36094,36152,36152,36194,36201,36193,36193,
+36133,36133,36081,36059,36007,36007,35944,35944,
+35894,35881,35863,35863,35879,35879,35842,35819,
+35741,35741,35701,35701,35704,35707,35718,35718,
+35741,35741,35676,35634,35484,35484,35448,35448,
+35545,35567,35587,35587,35511,35511,35518,35535,
+35616,35616,35646,35646,35615,35608,35606,35606,
+35638,35638,35646,35644,35628,35628,35586,35586,
+35546,35532,35501,35501,35474,35474,35460,35454,
+35439,35439,35417,35417,35401,35393,35366,35366,
+35315,35315,35345,35372,35472,35472,35482,35482,
+35401,35377,35336,35336,35332,35332,35355,35370,
+35422,35422,35513,35513,35616,35653,35736,35736,
+35800,35800,35812,35808,35775,35775,35760,35760,
+35797,35808,35830,35830,35825,35825,35803,35794,
+35767,35767,35728,35728,35687,35673,35637,35637,
+35612,35612,35604,35602,35596,35596,35599,35599,
+35610,35615,35628,35628,35638,35638,35638,35637,
+35630,35630,35621,35621,35623,35623,35619,35619,
+35596,35596,35568,35558,35537,35537,35531,35531,
+35527,35511,35440,35440,35327,35327,35227,35188,
+35090,35090,35064,35064,35124,35145,35192,35192,
+35231,35231,35227,35219,35182,35182,35146,35146,
+35117,35108,35088,35088,35051,35051,34997,34968,
+34881,34881,34691,34691,34573,34557,33385,33683,
+34565,33060,31231,30787,32540,33476,33724,34899,
+35660,36958,37520,37820,36870,36957,37144,37582,
+37952,38294,38490,38602,38624,38560,38562,38506,
+38392,38355,38316,38119,38015,37947,37093,37093,
+37015,36980,36882,36882,36860,36860,37009,37079,
+37278,37278,37340,37340,37264,37225,37105,37105,
+36977,36977,36868,36820,36692,36692,36566,36566,
+36466,36433,36373,36373,36364,36364,36311,36283,
+36193,36193,36147,36147,36148,36138,36087,36087,
+35968,35968,35924,35919,35935,35935,35897,35897,
+35799,35770,35728,35728,35761,35761,35768,35766,
+35748,35748,35674,35674,35577,35539,35442,35442,
+35311,35311,35305,35326,35437,35437,35433,35433,
+35300,35265,35219,35219,35278,35278,35308,35316,
+35327,35327,35355,35355,35374,35371,35337,35337,
+35255,35255,35246,35255,35308,35308,35379,35379,
+35441,35456,35467,35467,35411,35411,35395,35396,
+35421,35421,35371,35371,35264,35238,35215,35215,
+35281,35281,35302,35303,35292,35292,35376,35376,
+35529,35572,35632,35632,35592,35592,35592,35601,
+35645,35645,35733,35733,35835,35872,35960,35960,
+36050,36050,36168,36219,36361,36361,36525,36525,
+36664,36714,36826,36826,36940,36940,37034,37071,
+37159,37159,37298,37298,37403,37442,37531,37531,
+37632,37632,37573,37527,37358,37358,37340,37340,
+37453,37480,37508,37508,37434,37434,37298,37231,
+37032,37032,36879,36879,36821,36804,36784,36784,
+36783,36783,36773,36770,36769,36769,36716,36716,
+36633,36609,36565,36565,36536,36536,36488,36468,
+36414,36414,36356,36356,36309,36290,36243,36243,
+36180,36180,36144,36135,36124,36124,36064,36064,
+35974,35950,35917,35917,35942,35942,35931,35919,
+35868,35868,35836,35836,35829,35819,35778,35778,
+35693,35693,35646,35632,35613,35613,35589,35589,
+35568,35562,35552,35552,35548,35548,35542,35538,
+35527,35527,35551,35551,35598,35606,35598,35598,
+35534,35534,35509,35507,35519,35519,35548,35548,
+35572,35574,35559,35559,35507,35507,35460,35439,
+35384,35384,35394,35394,35465,35485,35520,35520,
+35510,35510,35468,35448,35382,35382,35362,35362,
+35389,35397,35405,35405,35381,35381,35359,35353,
+35344,35344,35329,35329,35310,35306,35306,35306,
+35324,35324,35344,35355,35391,35391,35440,35440,
+35476,35492,35533,35533,35579,35579,35595,35599,
+35602,35602,35652,35652,35732,35759,35820,35820,
+35868,35868,35931,35962,36049,36049,36142,36142,
+36202,36223,36270,36270,36292,36292,36243,36207,
+36073,36073,35970,35970,35962,35953,35917,35917,
+35857,35857,35841,35841,35857,35857,35863,35863,
+35853,35841,35790,35790,35670,35670,35578,35546,
+35472,35472,35408,35408,35377,35365,35339,35339,
+35303,35303,35268,35257,35234,35234,35247,35247,
+35283,35291,35293,35293,35217,35217,34984,39420,
+40656,41722,42525,42393,42731,43319,43277,42908,
+42955,42678,42239,42170,41702,41257,39842,39149,
+38540,37736,38031,38299,36913,36913,37066,37125,
+37264,37264,37330,37330,37302,37282,37205,37205,
+37080,37080,36958,36904,36757,36757,36591,36591,
+36466,36425,36348,36348,36313,36313,36264,36243,
+36182,36182,36065,36065,35922,35887,35862,35862,
+35971,35971,35967,35948,35854,35854,35837,35837,
+35916,35927,35908,35908,34607,35763,35838,35878,
+36005,36005,36080,36080,36092,36102,36141,36141,
+36463,36463,36470,36463,36412,36412,36320,36320,
+36220,36196,36177,36177,36256,36256,36292,36301,
+36313,36313,36356,36356,36404,36411,36396,36396,
+36313,36313,36263,36247,36215,36215,36190,36190,
+36174,36171,36167,36167,36182,36182,36138,36110,
+36016,36016,35961,35961,35958,35957,35949,35949,
+35934,35934,35866,35827,35702,35702,35672,35672,
+35753,35772,35792,35792,35733,35733,35733,35744,
+35798,35798,35811,35811,35786,35784,35795,35795,
+35843,35843,35870,35876,35880,35880,35843,35843,
+35794,35778,35750,35750,35739,35739,35744,35747,
+35756,35756,35749,35749,35735,35725,35691,35691,
+35627,35627,35653,35679,35782,35782,35778,35778,
+35673,35637,35569,35569,35530,35530,35531,35538,
+35572,35572,35652,35652,35755,35799,35916,35916,
+36062,36062,36110,36116,36091,36091,36092,36092,
+36138,36152,36175,36175,36162,36162,36125,36110,
+36072,36072,36036,36036,36003,35990,35958,35958,
+35937,35937,35933,35931,35928,35928,35929,35929,
+35941,35946,35963,35963,35976,35976,35980,35980,
+35976,35976,35966,35966,35966,35964,35956,35956,
+35928,35928,35891,35876,35838,35838,35805,35805,
+35778,35757,35682,35682,35614,35614,35534,35500,
+35408,35408,35378,35378,35420,35433,35459,35459,
+35466,35466,35434,35416,35351,35351,35301,35301,
+35280,35272,35254,35254,35216,35216,35169,35144,
+35071,35071,34886,34886,34727,34695,34692,33445,
+34706,33582,31687,30722,32813,33851,33274,34074,
+35424,37277,37720,38060,37310,37413,37613,38058,
+38439,38555,38599,38746,38717,38538,38565,38515,
+38351,38315,38256,37892,37723,37794,37325,37325,
+37274,37245,37145,37145,37213,37213,37295,37340,
+37480,37480,37564,37564,37552,37531,37436,37436,
+37290,37290,37174,37128,37015,37015,36889,36889,
+36777,36741,36676,36676,36662,36662,36601,36569,
+36467,36467,36404,36404,36385,36370,36310,36310,
+36198,36198,36168,36170,36208,36208,36185,36185,
+36096,36069,36026,36026,36046,36046,36068,36077,
+36099,36099,36061,36061,35983,35951,35866,35866,
+35746,35746,35742,35762,35869,35869,35854,35854,
+35707,35667,35611,35611,35674,35674,35698,35703,
+35700,35700,35722,35722,35745,35747,35734,35734,
+35694,35694,35702,35713,35761,35761,35821,35821,
+35871,35883,35893,35893,35847,35847,35823,35819,
+35819,35819,35754,35754,35651,35627,35611,35611,
+35699,35699,35722,35721,35695,35695,35757,35757,
+35881,35916,35971,35971,35955,35955,35971,35986,
+36044,36044,36121,36121,36191,36217,36279,36279,
+36344,36344,36416,36446,36522,36522,36650,36650,
+36781,36816,36862,36862,36862,36862,36928,36966,
+37083,37083,37245,37245,37359,37403,37507,37507,
+37635,37635,37639,37625,37545,37545,37649,37649,
+37873,37937,38036,38036,38012,38012,37867,37786,
+37529,37529,37331,37331,37252,37229,37197,37197,
+37209,37209,37183,37168,37113,37113,37038,37038,
+36969,36946,36898,36898,36848,36848,36789,36763,
+36699,36699,36628,36628,36573,36553,36509,36509,
+36457,36457,36432,36428,36433,36433,36372,36372,
+36263,36233,36185,36185,36207,36207,36202,36195,
+36162,36162,36157,36157,36178,36178,36155,36155,
+36084,36084,36036,36019,35988,35988,35937,35937,
+35881,35865,35840,35840,35844,35844,35862,35870,
+35895,35895,35929,35929,35961,35966,35960,35960,
+35916,35916,35898,35896,35903,35903,35944,35944,
+35992,35998,35977,35977,35880,35880,35821,35802,
+35764,35764,35773,35773,35821,35840,35883,35883,
+35918,35918,35886,35863,35780,35780,35739,35739,
+35751,35754,35757,35757,35744,35744,35729,35724,
+35716,35716,35694,35694,35659,35654,35663,35663,
+35722,35722,35747,35754,35760,35760,35766,35766,
+35767,35773,35800,35800,35859,35859,35874,35875,
+35864,35864,35881,35881,35920,35938,35992,35992,
+36072,36072,36136,36161,36220,36220,36318,36318,
+36418,36449,36506,36506,36504,36504,36450,36396,
+36181,36181,36071,36071,36169,36182,36152,36152,
+36099,36099,36077,36073,36071,36071,36065,36065,
+36053,36040,35983,35983,35859,35859,35774,35745,
+35687,35687,35623,35623,35572,35554,35522,35522,
+35495,35495,35471,35466,35459,35459,35510,35510,
+35609,35987,36647,37302,35639,35639,35392,40913,
+41849,42895,42916,42865,42981,43734,43575,43126,
+42325,42913,42385,42531,42443,42082,40626,39537,
+38517,37329,37679,38084,37148,37148,37378,37453,
+37597,37597,37683,37683,37666,37644,37556,37556,
+37398,37398,37279,37234,37125,37125,36966,36966,
+36811,36762,36671,36671,36642,36642,36597,36576,
+36518,36518,36386,36386,36206,36163,36128,36128,
+36263,36263,36257,36231,36104,36104,36040,36040,
+36082,36085,36059,34639,34728,35945,35990,36028,
+36174,36174,36277,36277,36313,36330,36380,36380,
+36463,36463,36470,36463,36412,36412,36320,36320,
+36220,36196,36177,36177,36256,36256,36292,36301,
+36313,36313,36356,36356,36404,36411,36396,36396,
+36313,36313,36263,36247,36215,36215,36190,36190,
+36174,36171,36167,36167,36182,36182,36138,36110,
+36016,36016,35961,35961,35958,35957,35949,35949,
+35934,35934,35866,35827,35702,35702,35672,35672,
+35753,35772,35792,35792,35733,35733,35733,35744,
+35798,35798,35811,35811,35786,35784,35795,35795,
+35843,35843,35870,35876,35880,35880,35843,35843,
+35794,35778,35750,35750,35739,35739,35744,35747,
+35756,35756,35749,35749,35735,35725,35691,35691,
+35627,35627,35653,35679,35782,35782,35778,35778,
+35673,35637,35569,35569,35530,35530,35531,35538,
+35572,35572,35652,35652,35755,35799,35916,35916,
+36062,36062,36110,36116,36091,36091,36092,36092,
+36138,36152,36175,36175,36162,36162,36125,36110,
+36072,36072,36036,36036,36003,35990,35958,35958,
+35937,35937,35933,35931,35928,35928,35929,35929,
+35941,35946,35963,35963,35976,35976,35980,35980,
+35976,35976,35966,35966,35966,35964,35956,35956,
+35928,35928,35891,35876,35838,35838,35805,35805,
+35778,35757,35682,35682,35614,35614,35534,35500,
+35408,35408,35378,35378,35420,35433,35459,35459,
+35466,35466,35434,35416,35351,35351,35301,35301,
+35280,35272,35254,35254,35216,35216,35169,35144,
+35071,35071,34886,34886,34727,34695,34692,33340,
+34632,34166,32153,29933,32190,34196,33813,34459,
+35807,37430,37636,37946,37549,37762,37965,38036,
+38304,38506,38573,38685,38657,38434,38460,38377,
+38174,38186,38046,37624,37507,37674,37325,37325,
+37274,37245,37145,37145,37213,37213,37295,37340,
+37480,37480,37564,37564,37552,37531,37436,37436,
+37290,37290,37174,37128,37015,37015,36889,36889,
+36777,36741,36676,36676,36662,36662,36601,36569,
+36467,36467,36404,36404,36385,36370,36310,36310,
+36198,36198,36168,36170,36208,36208,36185,36185,
+36096,36069,36026,36026,36046,36046,36068,36077,
+36099,36099,36061,36061,35983,35951,35866,35866,
+35746,35746,35742,35762,35869,35869,35854,35854,
+35707,35667,35611,35611,35674,35674,35698,35703,
+35700,35700,35722,35722,35745,35747,35734,35734,
+35694,35694,35702,35713,35761,35761,35821,35821,
+35871,35883,35893,35893,35847,35847,35823,35819,
+35819,35819,35754,35754,35651,35627,35611,35611,
+35699,35699,35722,35721,35695,35695,35757,35757,
+35881,35916,35971,35971,35955,35955,35971,35986,
+36044,36044,36121,36121,36191,36217,36279,36279,
+36344,36344,36416,36446,36522,36522,36650,36650,
+36781,36816,36862,36862,36862,36862,36928,36966,
+37083,37083,37245,37245,37359,37403,37507,37507,
+37635,37635,37639,37625,37545,37545,37649,37649,
+37873,37937,38036,38036,38012,38012,37867,37786,
+37529,37529,37331,37331,37252,37229,37197,37197,
+37209,37209,37183,37168,37113,37113,37038,37038,
+36969,36946,36898,36898,36848,36848,36789,36763,
+36699,36699,36628,36628,36573,36553,36509,36509,
+36457,36457,36432,36428,36433,36433,36372,36372,
+36263,36233,36185,36185,36207,36207,36202,36195,
+36162,36162,36157,36157,36178,36178,36155,36155,
+36084,36084,36036,36019,35988,35988,35937,35937,
+35881,35865,35840,35840,35844,35844,35862,35870,
+35895,35895,35929,35929,35961,35966,35960,35960,
+35916,35916,35898,35896,35903,35903,35944,35944,
+35992,35998,35977,35977,35880,35880,35821,35802,
+35764,35764,35773,35773,35821,35840,35883,35883,
+35918,35918,35886,35863,35780,35780,35739,35739,
+35751,35754,35757,35757,35744,35744,35729,35724,
+35716,35716,35694,35694,35659,35654,35663,35663,
+35722,35722,35747,35754,35760,35760,35766,35766,
+35767,35773,35800,35800,35859,35859,35874,35875,
+35864,35864,35881,35881,35920,35938,35992,35992,
+36072,36072,36136,36161,36220,36220,36318,36318,
+36418,36449,36506,36506,36504,36504,36450,36396,
+36181,36181,36071,36071,36169,36182,36152,36152,
+36099,36099,36077,36073,36071,36071,36065,36065,
+36053,36040,35983,35983,35859,35859,35774,35745,
+35687,35687,35623,35623,35572,35554,35522,35522,
+35495,35495,35471,35466,35459,35459,35510,35510,
+35609,35637,35680,35680,38623,39406,40709,42375,
+41414,42583,42658,43481,43622,43879,43460,42902,
+42793,43084,43019,42810,42695,42338,41035,40200,
+38966,37887,38190,38366,38707,37148,37378,37453,
+37597,37597,37683,37683,37666,37644,37556,37556,
+37398,37398,37279,37234,37125,37125,36966,36966,
+36811,36762,36671,36671,36642,36642,36597,36576,
+36518,36518,36386,36386,36206,36163,36128,36128,
+36263,36263,36257,36231,36104,36104,36040,36040,
+36082,36085,36059,34844,35945,35945,35990,36028,
+36174,36174,36277,36277,36313,36330,36380,36380,
+36634,36634,36675,36684,36689,36689,36599,36599,
+36449,36416,36402,36402,36550,36550,36581,36576,
+36516,36516,36511,36511,36552,36559,36555,36555,
+36504,36504,36475,36466,36451,36451,36448,36448,
+36448,36447,36440,36440,36437,36437,36411,36397,
+36351,36351,36329,36329,36333,36327,36293,36293,
+36201,36201,36126,36096,36024,36024,35989,35989,
+36007,36011,36015,36015,35994,35994,35992,35993,
+36006,36006,35998,35998,35987,35988,36005,36005,
+36046,36046,36091,36109,36159,36159,36144,36144,
+36082,36064,36043,36043,36065,36065,36086,36092,
+36104,36104,36103,36103,36095,36090,36068,36068,
+36026,36026,36051,36073,36155,36155,36138,36138,
+36032,35993,35906,35906,35817,35817,35807,35817,
+35877,35877,35940,35940,35989,36021,36134,36134,
+36337,36337,36428,36450,36466,36466,36509,36509,
+36568,36583,36599,36599,36561,36561,36513,36491,
+36425,36425,36378,36378,36343,36330,36299,36299,
+36284,36284,36280,36279,36277,36277,36281,36281,
+36290,36295,36307,36307,36319,36319,36328,36330,
+36332,36332,36318,36318,36309,36305,36298,36298,
+36273,36273,36235,36218,36174,36174,36122,36122,
+36067,36042,35966,35966,35940,35940,35901,35883,
+35835,35835,35791,35791,35765,35753,35712,35712,
+35641,35641,35591,35574,35535,35535,35519,35519,
+35530,35531,35523,35523,35476,35476,35426,35402,
+35330,35330,35148,35148,34959,34899,34789,34789,
+33542,34357,33253,28358,29480,32552,34825,35562,
+36742,37117,37140,37205,37259,37531,37723,37961,
+38336,38648,38507,38515,38530,38363,38344,38257,
+38032,37914,38026,37286,37347,37347,37882,37875,
+37787,37363,37318,37439,37493,37493,37559,37596,
+37717,37717,37806,37806,37802,37784,37700,37700,
+37555,37555,37447,37407,37317,37317,37200,37200,
+37095,37056,36965,36965,36865,36865,36796,36772,
+36725,36725,36675,36675,36629,36606,36541,36541,
+36449,36449,36424,36424,36451,36451,36459,36459,
+36432,36418,36375,36375,36316,36316,36333,36351,
+36427,36427,36445,36445,36398,36377,36317,36317,
+36222,36222,36209,36218,36282,36282,36267,36267,
+36165,36136,36099,36099,36150,36150,36178,36186,
+36198,36198,36213,36213,36208,36211,36225,36225,
+36281,36281,36316,36328,36349,36349,36360,36360,
+36360,36358,36352,36352,36332,36332,36305,36292,
+36254,36254,36182,36182,36106,36085,36055,36055,
+36082,36082,36091,36091,36080,36080,36125,36125,
+36209,36232,36264,36264,36241,36241,36250,36260,
+36302,36302,36347,36347,36379,36396,36451,36451,
+36553,36553,36619,36637,36666,36666,36773,36773,
+36907,36924,36873,36873,36716,36716,36828,39320,
+39555,37010,37175,37175,37282,37320,37403,37403,
+37502,37502,37535,37531,37483,37483,37764,37764,
+38180,38308,38534,38534,38571,38571,38432,38348,
+38064,38064,37837,37837,37740,37715,37684,37684,
+37731,37731,37718,37703,37637,37637,37530,37530,
+37412,37369,37275,37275,37187,37187,37108,37078,
+37006,37006,36923,36923,36855,36840,36825,36825,
+36856,36856,36855,36851,36832,36832,36776,36776,
+36703,36681,36647,36647,36662,36662,36640,36624,
+36560,36560,36524,36524,36525,36521,36498,36498,
+36446,36446,36397,36378,36324,36324,36249,36249,
+36174,36151,36113,36113,36113,36113,36142,36160,
+36217,36217,36236,36236,36208,36201,36192,36192,
+36216,36216,36227,36230,36238,36238,36286,36286,
+36347,36359,36355,36355,36274,36274,36211,36186,
+36128,36128,36091,36091,36089,36098,36151,36151,
+36274,36274,36284,36270,36194,36194,36134,36134,
+36107,36098,36085,36085,36086,36086,36076,36071,
+36056,36056,36025,36025,35982,35976,35990,35990,
+36070,36070,36080,36073,36030,36030,35995,35995,
+35981,35982,36001,36001,36055,36055,36089,36100,
+36127,36127,36103,36103,36042,36033,36049,36049,
+36169,36169,36265,36302,36393,36393,36502,36502,
+36591,36618,36666,36666,36650,36650,36617,37659,
+37640,37487,38132,38329,38149,36329,36292,36292,
+36208,36208,36157,36139,36104,36104,36093,36093,
+36138,36140,36106,36106,35987,35987,35917,35898,
+35875,35875,35835,35835,35793,35779,35753,35753,
+35725,35725,35713,35711,35716,35716,35667,36806,
+35800,35875,36113,38588,36054,41168,42271,43799,
+42721,42587,43783,44147,44349,43930,43391,43230,
+43438,43245,43012,42752,42671,42558,41774,41396,
+40928,39893,39577,39212,38374,38182,37661,37722,
+37813,37813,37903,37903,37895,37878,37793,37793,
+37628,37628,37544,37521,37496,37496,37385,37385,
+37228,37175,37071,37071,37017,37017,36950,36920,
+36835,36835,36682,36682,36494,36441,36366,36366,
+36426,36426,36427,36419,36369,36369,36282,36282,
+36211,36195,36188,36188,36240,36240,36332,36371,
+36473,36473,36520,36520,36511,36515,36546,36546,
+36634,36634,36675,36684,36689,36689,36599,36599,
+36449,36416,36402,36402,36550,36550,36581,36576,
+36516,36516,36511,36511,36552,36559,36555,36555,
+36504,36504,36475,36466,36451,36451,36448,36448,
+36448,36447,36440,36440,36437,36437,36411,36397,
+36351,36351,36329,36329,36333,36327,36293,36293,
+36201,36201,36126,36096,36024,36024,35989,35989,
+36007,36011,36015,36015,35994,35994,35992,35993,
+36006,36006,35998,35998,35987,35988,36005,36005,
+36046,36046,36091,36109,36159,36159,36144,36144,
+36082,36064,36043,36043,36065,36065,36086,36092,
+36104,36104,36103,36103,36095,36090,36068,36068,
+36026,36026,36051,36073,36155,36155,36138,36138,
+36032,35993,35906,35906,35817,35817,35807,35817,
+35877,35877,35940,35940,35989,36021,36134,36134,
+36337,36337,36428,36450,36466,36466,36509,36509,
+36568,36583,36599,36599,36561,36561,36513,36491,
+36425,36425,36378,36378,36343,36330,36299,36299,
+36284,36284,36280,36279,36277,36277,36281,36281,
+36290,36295,36307,36307,36319,36319,36328,36330,
+36332,36332,36318,36318,36309,36305,36298,36298,
+36273,36273,36235,36218,36174,36174,36122,36122,
+36067,36042,35966,35966,35940,35940,35901,35883,
+35835,35835,35791,35791,35765,35753,35712,35712,
+35641,35641,35591,35574,35535,35535,35519,35519,
+35530,35531,35523,35523,35476,35476,35426,35402,
+35330,35330,35148,35148,34959,34899,34789,34789,
+33418,34047,33484,28703,28148,31549,34588,35338,
+36654,37699,37091,37200,37505,37435,37583,38019,
+38395,38734,38601,38618,38647,38363,38303,38235,
+37859,37744,37648,37286,37829,37787,37703,37606,
+37534,37104,36869,36895,37493,37493,37559,37596,
+37717,37717,37806,37806,37802,37784,37700,37700,
+37555,37555,37447,37407,37317,37317,37200,37200,
+37095,37056,36965,36965,36865,36865,36796,36772,
+36725,36725,36675,36675,36629,36606,36541,36541,
+36449,36449,36424,36424,36451,36451,36459,36459,
+36432,36418,36375,36375,36316,36316,36333,36351,
+36427,36427,36445,36445,36398,36377,36317,36317,
+36222,36222,36209,36218,36282,36282,36267,36267,
+36165,36136,36099,36099,36150,36150,36178,36186,
+36198,36198,36213,36213,36208,36211,36225,36225,
+36281,36281,36316,36328,36349,36349,36360,36360,
+36360,36358,36352,36352,36332,36332,36305,36292,
+36254,36254,36182,36182,36106,36085,36055,36055,
+36082,36082,36091,36091,36080,36080,36125,36125,
+36209,36232,36264,36264,36241,36241,36250,36260,
+36302,36302,36347,36347,36379,36396,36451,36451,
+36553,36553,36619,36637,36666,36666,36773,36773,
+36907,36924,36873,36873,36716,36716,38586,38642,
+38993,39101,38972,37998,37282,37320,37403,37403,
+37502,37502,37535,37531,37483,37483,37764,37764,
+38180,38308,38534,38534,38571,38571,38432,38348,
+38064,38064,37837,37837,37740,37715,37684,37684,
+37731,37731,37718,37703,37637,37637,37530,37530,
+37412,37369,37275,37275,37187,37187,37108,37078,
+37006,37006,36923,36923,36855,36840,36825,36825,
+36856,36856,36855,36851,36832,36832,36776,36776,
+36703,36681,36647,36647,36662,36662,36640,36624,
+36560,36560,36524,36524,36525,36521,36498,36498,
+36446,36446,36397,36378,36324,36324,36249,36249,
+36174,36151,36113,36113,36113,36113,36142,36160,
+36217,36217,36236,36236,36208,36201,36192,36192,
+36216,36216,36227,36230,36238,36238,36286,36286,
+36347,36359,36355,36355,36274,36274,36211,36186,
+36128,36128,36091,36091,36089,36098,36151,36151,
+36274,36274,36284,36270,36194,36194,36134,36134,
+36107,36098,36085,36085,36086,36086,36076,36071,
+36056,36056,36025,36025,35982,35976,35990,35990,
+36070,36070,36080,36073,36030,36030,35995,35995,
+35981,35982,36001,36001,36055,36055,36089,36100,
+36127,36127,36103,36103,36042,36033,36049,36049,
+36169,36169,36265,36302,36393,36393,36502,36502,
+36591,36618,36666,36666,36650,36650,36617,38126,
+38072,38316,39218,39469,39223,38292,37730,36292,
+36208,36208,36157,36139,36104,36104,36093,36093,
+36138,36140,36106,36106,35987,35987,35917,35898,
+35875,35875,35835,35835,35793,35779,35753,35753,
+35725,35725,35713,35711,35716,35716,37256,38180,
+38727,35875,36113,39405,41841,42267,42897,43331,
+42976,43309,43932,44303,44212,44381,44475,44114,
+43515,43523,43200,42802,42565,42517,41701,41406,
+41100,39971,39440,38823,38375,38319,37661,37722,
+37813,37813,37903,37903,37895,37878,37793,37793,
+37628,37628,37544,37521,37496,37496,37385,37385,
+37228,37175,37071,37071,37017,37017,36950,36920,
+36835,36835,36682,36682,36494,36441,36366,36366,
+36426,36426,36427,36419,36369,36369,36282,36282,
+36211,36195,36188,36188,36240,36240,36332,36371,
+36473,36473,36520,36520,36511,36515,36546,36546,
+36804,36804,36849,36859,36861,36861,36788,36788,
+36667,36639,36626,36626,36738,36738,36754,36744,
+36682,36682,36674,36674,36711,36716,36707,36707,
+36646,36646,36627,36625,36632,36632,36644,36644,
+36644,36641,36628,36628,36605,36605,36576,36563,
+36529,36529,36509,36509,36511,36506,36475,36475,
+36396,36396,36342,36324,36285,36285,36242,36242,
+36216,36208,36195,36195,36191,36191,36192,36192,
+36192,36192,36185,36185,36190,36196,36222,36222,
+36262,36262,36305,36324,36376,36376,36353,36353,
+36277,36259,36244,36244,36302,36302,36337,36345,
+36356,36356,36360,36360,36362,36360,36349,36349,
+36319,36319,36332,36344,36391,36391,36372,36372,
+36300,36272,36205,36205,36119,36119,36107,36117,
+36173,36173,36223,36223,36251,36275,36370,36370,
+36550,36550,36633,36654,36675,36675,36725,36725,
+36787,36805,36837,36837,36832,36832,36799,36777,
+36700,36700,36637,36637,36594,36580,36546,36546,
+36531,36531,36528,36527,36526,36526,36532,36532,
+36538,36541,36548,36548,36553,36553,36562,36563,
+36564,36564,36547,36547,36533,36528,36520,36520,
+36502,36502,36469,36454,36408,36408,36349,36349,
+36286,36256,36172,36172,36149,36149,36127,36119,
+36100,36100,36059,36059,36006,35981,35914,35914,
+35812,35812,35758,35742,35718,35718,35709,35709,
+35716,35713,35693,35693,35626,35626,35570,35546,
+35480,35480,35314,35314,35130,35063,34917,34917,
+33311,33655,34026,30002,27970,30981,35041,35505,
+36590,38257,37527,37457,37726,37553,37792,38178,
+38441,38747,38801,38835,38827,38435,38333,38229,
+37762,37642,37539,37574,37493,37402,37574,37493,
+37228,37074,36885,36898,36741,37582,37684,37726,
+37838,37838,37959,37959,38000,37998,37947,37947,
+37806,37806,37701,37663,37580,37580,37448,37448,
+37327,37282,37182,37182,37071,37071,37007,36989,
+36961,36961,36910,36910,36849,36826,36773,36773,
+36728,36728,36720,36722,36739,36739,36742,36742,
+36722,36710,36667,36667,36604,36604,36624,36644,
+36729,36729,36753,36753,36706,36685,36631,36631,
+36549,36549,36527,36530,36566,36566,36552,36552,
+36479,36460,36431,36431,36468,36468,36481,36483,
+36477,36477,36480,36480,36478,36484,36517,36517,
+36607,36607,36651,36662,36672,36672,36674,36674,
+36675,36674,36666,36666,36640,36640,36606,36589,
+36535,36535,36463,36463,36401,36382,36349,36349,
+36347,36347,36343,36341,36327,36327,36354,36354,
+36415,36431,36453,36453,36427,36427,36426,36431,
+36454,36454,36478,36478,36497,36510,36558,36558,
+36658,36658,36719,36735,36748,36748,36824,36824,
+36925,36925,36823,36823,36636,39341,37987,38072,
+38507,38371,37985,38924,37203,36836,36452,36358,
+37260,37295,36832,37507,37445,37445,37782,37782,
+38340,38502,38757,38757,38855,38855,38756,38687,
+38442,38442,38230,38230,38126,38097,38056,38056,
+38087,38087,38075,38063,38014,38014,37914,37914,
+37784,37736,37625,37625,37517,37517,37437,37409,
+37349,37349,37273,37273,37207,37189,37168,37168,
+37180,37180,37162,37149,37103,37103,37048,37048,
+37003,36986,36951,36951,36933,36933,36895,36874,
+36802,36802,36754,36754,36748,36743,36723,36723,
+36688,36688,36648,36630,36577,36577,36511,36511,
+36452,36435,36410,36410,36417,36417,36441,36454,
+36495,36495,36502,36502,36468,36461,36454,36454,
+36483,36483,36504,36511,36529,36529,36568,36568,
+36606,36613,36605,36605,36543,36543,36486,36464,
+36406,36406,36363,36363,36346,36353,36402,36402,
+36534,36534,36546,36530,36445,36445,36367,36367,
+36315,36300,36279,36279,36293,36293,36293,36291,
+36281,36281,36257,36257,36221,36216,36231,36231,
+36306,36306,36316,36309,36269,36269,36221,36221,
+36183,36177,36181,36181,36233,36233,36271,36287,
+36322,36322,36290,36290,36204,36186,36184,36184,
+36290,36290,36387,36427,36528,36528,36638,36638,
+36723,36751,36807,36807,36816,36816,37476,38657,
+38962,39376,40316,40486,40272,38969,38223,38131,
+37152,36292,36238,36219,37925,38099,37097,36157,
+36174,36179,36187,36187,36100,36100,36034,36013,
+35977,35977,35952,35952,35937,35929,35907,35907,
+35857,35857,35834,35825,35806,35806,37888,39302,
+40168,36049,36266,41107,42714,40799,41975,42037,
+43728,44101,44652,44784,44550,44755,45307,44013,
+43299,43104,43031,42825,42440,42509,41452,41263,
+40943,39843,39030,38411,38423,38623,38606,37824,
+37953,37953,38067,38067,38111,38106,38043,38043,
+37868,37868,37769,37741,37702,37702,37591,37591,
+37442,37392,37291,37291,37235,37235,37165,37132,
+37041,37041,36871,36871,36661,36599,36500,36500,
+36530,36530,36548,36553,36565,36565,36493,36493,
+36386,36366,36373,36373,36491,36491,36591,36625,
+36691,36691,36702,36702,36676,36676,36703,36703,
+36882,36882,36927,36934,36928,36928,36864,36864,
+36764,36741,36726,36726,36814,36814,36821,36811,
+36756,36756,36749,36749,36785,36790,36776,36776,
+36709,36709,36691,36692,36713,36713,36729,36729,
+36728,36724,36707,36707,36674,36674,36642,36629,
+36595,36595,36575,36575,36576,36570,36545,36545,
+36479,36479,36439,36425,36400,36400,36353,36353,
+36309,36296,36276,36276,36278,36278,36281,36280,
+36277,36277,36273,36273,36286,36294,36325,36325,
+36364,36364,36405,36423,36470,36470,36443,36443,
+36360,36341,36329,36329,36405,36405,36445,36455,
+36463,36463,36468,36468,36475,36475,36467,36467,
+36441,36441,36448,36455,36485,36485,36467,36467,
+36416,36394,36340,36340,36259,36259,36249,36257,
+36309,36309,36354,36354,36374,36395,36479,36479,
+36642,36642,36717,36736,36757,36757,36806,36806,
+36867,36887,36926,36926,36940,36940,36917,36896,
+36817,36817,36749,36749,36702,36685,36651,36651,
+36635,36635,36633,36632,36632,36632,36638,36638,
+36643,36645,36650,36650,36653,36653,36661,36662,
+36661,36661,36642,36642,36628,36623,36615,36615,
+36597,36597,36566,36551,36506,36506,36445,36445,
+36379,36348,36260,36260,36235,36235,36217,36214,
+36209,36209,36169,36169,36105,36078,36002,36002,
+35890,35890,35836,35821,35802,35802,35794,35794,
+35795,35789,35761,35761,35684,35684,35626,35601,
+35539,35539,35381,35381,35197,35129,34970,34970,
+33263,33371,33834,28851,27190,31106,35981,36399,
+36533,38132,37836,37183,36765,37007,37330,38197,
+38379,38531,39036,39093,39016,38706,38550,38282,
+37855,37843,37832,37526,37364,37340,37636,37475,
+37267,37075,37017,36990,36479,36558,36945,37774,
+37886,37886,38021,38021,38086,38091,38056,38056,
+37917,37917,37812,37775,37695,37695,37555,37555,
+37424,37378,37275,37275,37165,37165,37106,37090,
+37065,37065,37014,37014,36949,36926,36880,36880,
+36858,36858,36860,36862,36874,36874,36872,36872,
+36851,36839,36797,36797,36737,36737,36758,36780,
+36864,36864,36885,36885,36836,36815,36760,36760,
+36683,36683,36659,36659,36685,36685,36673,36673,
+36613,36596,36572,36572,36602,36602,36607,36604,
+36588,36588,36585,36585,36588,36596,36636,36636,
+36735,36735,36782,36793,36798,36798,36800,36800,
+36807,36807,36799,36799,36767,36767,36728,36709,
+36650,36650,36578,36578,36523,36506,36470,36470,
+36458,36458,36449,36445,36428,36428,36448,36448,
+36500,36514,36531,36531,36507,36507,36501,36503,
+36515,36515,36532,36532,36548,36559,36603,36603,
+36697,36697,36757,36771,36780,36780,36842,36842,
+36926,36920,36803,36803,40855,40124,38477,38159,
+37793,37556,37954,40462,38960,39037,38234,35824,
+36379,35866,36882,36767,37352,37275,37225,37824,
+38403,38572,38840,38840,38959,38959,38881,38822,
+38601,38601,38400,38400,38294,38263,38216,38216,
+38235,38235,38223,38214,38174,38174,38080,38080,
+37949,37900,37784,37784,37670,37670,37591,37564,
+37511,37511,37440,37440,37376,37357,37328,37328,
+37324,37324,37292,37274,37216,37216,37161,37161,
+37128,37114,37079,37079,37042,37042,36997,36973,
+36901,36901,36848,36848,36840,36835,36817,36817,
+36789,36789,36753,36735,36685,36685,36628,36628,
+36579,36565,36549,36549,36560,36560,36581,36591,
+36621,36621,36622,36622,36591,36584,36578,36578,
+36605,36605,36627,36636,36661,36661,36694,36694,
+36718,36720,36710,36710,36654,36654,36602,36581,
+36526,36526,36482,36482,36465,36470,36516,36516,
+36645,36645,36653,36636,36546,36546,36458,36458,
+36398,36382,36357,36357,36377,36377,36382,36381,
+36375,36375,36355,36355,36324,36320,36336,36336,
+36406,36406,36416,36412,36377,36377,36326,36326,
+36276,36266,36264,36264,36314,36314,36354,36370,
+36407,36407,36372,36372,36282,36262,36254,36254,
+36348,36348,36443,36483,36589,36589,36699,36699,
+36782,36811,36874,36874,36896,36896,36896,39366,
+39914,40289,41638,41670,41512,40556,40026,39633,
+38698,39029,38783,40178,40838,41755,39510,38203,
+37580,36210,36236,36236,36144,36144,36078,36057,
+36015,36015,35997,35997,35996,35991,35971,35971,
+35904,35904,35875,35865,35843,38136,40379,41511,
+42244,43172,43497,36322,41439,41980,42330,42976,
+43581,43807,45221,44924,44512,45908,44991,44347,
+44035,43021,42913,42513,42424,42119,40990,40832,
+40814,39800,39216,38846,38257,38437,38448,37869,
+38006,38006,38144,38144,38211,38214,38160,38160,
+37980,37980,37871,37838,37783,37783,37666,37666,
+37523,37474,37376,37376,37321,37321,37251,37218,
+37126,37126,36947,36947,36727,36662,36553,36553,
+36573,36573,36601,36614,36652,36652,36589,36589,
+36470,36450,36461,36461,36599,36599,36701,36731,
+36783,36783,36781,36781,36751,36750,36776,36776,
+37131,37131,37149,37138,37068,37068,37039,37039,
+37053,37052,37037,37037,36985,36985,36964,36960,
+36966,36966,36992,36992,37026,37026,36991,36991,
+36875,36875,36859,36868,36929,36929,36962,36962,
+36950,36940,36904,36904,36840,36840,36785,36763,
+36709,36709,36668,36668,36658,36659,36669,36669,
+36703,36703,36720,36725,36728,36728,36674,36674,
+36582,36555,36516,36516,36528,36528,36538,36541,
+36546,36546,36561,36561,36598,36614,36659,36659,
+36703,36703,36726,36733,36743,36743,36681,36681,
+36576,36554,36552,36552,36679,36679,36734,36744,
+36739,36739,36745,36745,36763,36767,36767,36767,
+36746,36746,36726,36717,36689,36689,36686,36686,
+36721,36731,36744,36744,36720,36720,36716,36719,
+36742,36742,36766,36766,36781,36792,36831,36831,
+36891,36891,36912,36916,36915,36915,36939,36939,
+36981,37004,37070,37070,37171,37171,37200,37191,
+37120,37120,37040,37040,36982,36963,36924,36924,
+36909,36909,36908,36908,36913,36913,36918,36918,
+36919,36919,36917,36917,36911,36911,36911,36909,
+36902,36902,36881,36881,36867,36862,36853,36853,
+36836,36836,36805,36790,36746,36746,36684,36684,
+36625,36592,36493,36493,36433,36433,36419,36421,
+36448,36448,36424,36424,36357,36327,36246,36246,
+36132,36132,36083,36072,36067,36067,36044,36044,
+36004,35982,35916,35916,35799,35799,35727,35703,
+35651,35651,35514,35514,35340,35271,35103,35103,
+35013,33630,33695,28991,28368,31293,35852,36632,
+36871,38000,37853,37014,36466,36707,36953,38114,
+38293,38395,39158,39345,39363,38818,38676,38384,
+38116,38009,38010,37652,37484,37508,37716,37640,
+37429,37143,36873,36772,36509,36421,37791,37840,
+37996,37996,38167,38167,38317,38351,38372,38372,
+38234,38234,38129,38092,38016,38016,37847,37847,
+37678,37625,37524,37524,37458,37458,37419,37405,
+37379,37379,37320,37320,37249,37231,37216,37216,
+37285,37285,37320,37326,37321,37321,37283,37283,
+37222,37203,37164,37164,37163,37163,37193,37209,
+37259,37259,37244,37244,37168,37139,37074,37074,
+37003,37003,36974,36970,36980,36980,36978,36978,
+36954,36947,36933,36933,36941,36941,36909,36889,
+36821,36821,36800,36800,36834,36850,36903,36903,
+36991,36991,37033,37042,37043,37043,37074,37074,
+37133,37144,37142,37142,37069,37069,37012,36988,
+36923,36923,36855,36855,36813,36799,36765,36765,
+36738,36738,36714,36702,36669,36669,36670,36670,
+36708,36718,36732,36732,36712,36712,36690,36680,
+36657,36657,36654,36654,36675,36685,36715,36715,
+36767,36767,36818,36831,36844,36844,36859,36859,
+36880,36863,36759,36759,41149,39776,39467,41711,
+38817,37912,41194,41865,41202,40197,40037,38057,
+38166,37235,37017,35914,35597,35669,35043,35832,
+36970,38668,38958,38958,39105,39105,39114,39098,
+39005,39005,38871,38871,38760,38722,38645,38645,
+38593,38593,38578,38578,38588,38588,38534,38534,
+38425,38382,38275,38275,38150,38150,38083,38066,
+38048,38048,38005,38005,37953,37928,37857,37857,
+37732,37732,37632,37593,37497,37497,37440,37440,
+37447,37439,37393,37393,37279,37279,37210,37184,
+37125,37125,37075,37075,37064,37059,37048,37048,
+37034,37034,37013,37003,36971,36971,36960,36960,
+36969,36976,37000,37000,37042,37042,37041,37034,
+37000,37000,36985,36985,36995,36996,36993,36993,
+36972,36972,36989,37004,37060,37060,37065,37065,
+37018,37002,36963,36963,36928,36928,36898,36885,
+36854,36854,36831,36831,36831,36837,36868,36868,
+36937,36937,36908,36879,36758,36758,36643,36643,
+36567,36548,36521,36521,36562,36562,36584,36591,
+36604,36604,36610,36610,36598,36598,36612,36612,
+36652,36652,36675,36683,36701,36701,36656,36656,
+36568,36545,36520,36520,36567,36567,36600,36611,
+36636,36636,36616,36616,36559,36544,36526,36526,
+36552,36552,36622,36657,36767,36767,36880,36880,
+36962,36997,37089,37089,37179,37179,37208,39453,
+40030,40727,41875,41879,41852,41358,41012,40514,
+39372,39886,40157,40875,41579,41779,40987,41100,
+40139,38164,36477,36477,36223,36223,36158,36131,
+36061,36061,36085,36085,36129,36135,36127,36127,
+35958,35958,35912,35907,38270,39593,41581,42717,
+43496,41009,43835,43486,42936,42089,42595,42913,
+42647,43250,44267,44725,45401,45762,44084,43980,
+43801,43045,42545,42214,42201,41723,40976,40859,
+40814,40286,39857,39446,38668,38722,38579,38001,
+38091,38091,38400,38400,38538,38563,38550,38550,
+38354,38354,38177,38109,37944,37944,37778,37778,
+37660,37621,37541,37541,37501,37501,37441,37412,
+37326,37326,37125,37125,36867,36791,36667,36667,
+36687,36687,36752,36787,36900,36900,36882,36882,
+36763,36742,36756,36756,36897,36897,36979,36999,
+37020,37020,37004,37004,36973,36973,37007,37007,
+37131,37131,37149,37138,37068,37068,37039,37039,
+37053,37052,37037,37037,36985,36985,36964,36960,
+36966,36966,36992,36992,37026,37026,36991,36991,
+36875,36875,36859,36868,36929,36929,36962,36962,
+36950,36940,36904,36904,36840,36840,36785,36763,
+36709,36709,36668,36668,36658,36659,36669,36669,
+36703,36703,36720,36725,36728,36728,36674,36674,
+36582,36555,36516,36516,36528,36528,36538,36541,
+36546,36546,36561,36561,36598,36614,36659,36659,
+36703,36703,36726,36733,36743,36743,36681,36681,
+36576,36554,36552,36552,36679,36679,36734,36744,
+36739,36739,36745,36745,36763,36767,36767,36767,
+36746,36746,36726,36717,36689,36689,36686,36686,
+36721,36731,36744,36744,36720,36720,36716,36719,
+36742,36742,36766,36766,36781,36792,36831,36831,
+36891,36891,36912,36916,36915,36915,36939,36939,
+36981,37004,37070,37070,37171,37171,37200,37191,
+37120,37120,37040,37040,36982,36963,36924,36924,
+36909,36909,36908,36908,36913,36913,36918,36918,
+36919,36919,36917,36917,36911,36911,36911,36909,
+36902,36902,36881,36881,36867,36862,36853,36853,
+36836,36836,36805,36790,36746,36746,36684,36684,
+36625,36592,36493,36493,36433,36433,36419,36421,
+36448,36448,36424,36424,36357,36327,36246,36246,
+36132,36132,36083,36072,36067,36067,36044,36044,
+36004,35982,35916,35916,35799,35799,35727,35703,
+35651,35651,35514,35514,35340,35271,35103,35103,
+35013,33961,33638,29256,29126,31341,35568,36915,
+37399,37933,38009,37505,36945,36782,37016,38131,
+38309,38354,39259,39451,39435,38952,38681,38483,
+38254,38084,38036,37696,37557,37685,37705,37595,
+37435,37103,36928,36757,36290,36119,36105,37840,
+37996,37996,38167,38167,38317,38351,38372,38372,
+38234,38234,38129,38092,38016,38016,37847,37847,
+37678,37625,37524,37524,37458,37458,37419,37405,
+37379,37379,37320,37320,37249,37231,37216,37216,
+37285,37285,37320,37326,37321,37321,37283,37283,
+37222,37203,37164,37164,37163,37163,37193,37209,
+37259,37259,37244,37244,37168,37139,37074,37074,
+37003,37003,36974,36970,36980,36980,36978,36978,
+36954,36947,36933,36933,36941,36941,36909,36889,
+36821,36821,36800,36800,36834,36850,36903,36903,
+36991,36991,37033,37042,37043,37043,37074,37074,
+37133,37144,37142,37142,37069,37069,37012,36988,
+36923,36923,36855,36855,36813,36799,36765,36765,
+36738,36738,36714,36702,36669,36669,36670,36670,
+36708,36718,36732,36732,36712,36712,36690,36680,
+36657,36657,36654,36654,36675,36685,36715,36715,
+36767,36767,36818,36831,36844,36844,36859,36859,
+36880,36863,36759,36759,41316,40757,38530,44399,
+40089,36545,35358,35909,41030,39578,39194,38502,
+37116,37062,34479,34865,34327,32882,33549,34706,
+36017,38668,38958,38958,39105,39105,39114,39098,
+39005,39005,38871,38871,38760,38722,38645,38645,
+38593,38593,38578,38578,38588,38588,38534,38534,
+38425,38382,38275,38275,38150,38150,38083,38066,
+38048,38048,38005,38005,37953,37928,37857,37857,
+37732,37732,37632,37593,37497,37497,37440,37440,
+37447,37439,37393,37393,37279,37279,37210,37184,
+37125,37125,37075,37075,37064,37059,37048,37048,
+37034,37034,37013,37003,36971,36971,36960,36960,
+36969,36976,37000,37000,37042,37042,37041,37034,
+37000,37000,36985,36985,36995,36996,36993,36993,
+36972,36972,36989,37004,37060,37060,37065,37065,
+37018,37002,36963,36963,36928,36928,36898,36885,
+36854,36854,36831,36831,36831,36837,36868,36868,
+36937,36937,36908,36879,36758,36758,36643,36643,
+36567,36548,36521,36521,36562,36562,36584,36591,
+36604,36604,36610,36610,36598,36598,36612,36612,
+36652,36652,36675,36683,36701,36701,36656,36656,
+36568,36545,36520,36520,36567,36567,36600,36611,
+36636,36636,36616,36616,36559,36544,36526,36526,
+36552,36552,36622,36657,36767,36767,36880,36880,
+36962,36997,37089,37089,37179,37179,37208,39497,
+40262,40891,42103,42149,42164,41990,41784,41114,
+40535,40543,40604,41822,42007,41963,41408,40902,
+40260,39745,40079,39451,36223,36223,36158,36131,
+36061,36061,36085,36085,36129,36135,36127,36127,
+35958,35958,35912,35907,39536,41123,42817,43996,
+44928,43770,44383,44291,43190,42546,43049,42655,
+42575,43010,43904,43947,44501,44481,43992,43730,
+43228,42642,42147,42010,41720,41437,41081,41061,
+41119,40633,40372,40027,39127,39088,38834,37946,
+37882,38091,38400,38400,38538,38563,38550,38550,
+38354,38354,38177,38109,37944,37944,37778,37778,
+37660,37621,37541,37541,37501,37501,37441,37412,
+37326,37326,37125,37125,36867,36791,36667,36667,
+36687,36687,36752,36787,36900,36900,36882,36882,
+36763,36742,36756,36756,36897,36897,36979,36999,
+37020,37020,37004,37004,36973,36973,37007,37007,
+37396,37396,37396,37378,37287,37287,37275,37275,
+37334,37343,37336,37336,37247,37247,37216,37215,
+37236,37236,37259,37259,37275,37268,37219,37219,
+37092,37092,37072,37080,37138,37138,37171,37171,
+37164,37157,37128,37128,37069,37069,37007,36978,
+36900,36900,36842,36842,36829,36832,36858,36858,
+36938,36938,36971,36977,36972,36972,36920,36920,
+36841,36818,36790,36790,36812,36812,36820,36820,
+36814,36814,36848,36848,36924,36952,37016,37016,
+37067,37067,37074,37070,37044,37044,36966,36966,
+36867,36846,36842,36842,36956,36956,36991,36991,
+36956,36956,36985,36985,37071,37092,37113,37113,
+37061,37061,37034,37022,36993,36993,37011,37011,
+37080,37103,37146,37146,37160,37160,37166,37170,
+37183,37183,37195,37195,37200,37204,37222,37222,
+37247,37247,37237,37229,37201,37201,37216,37216,
+37264,37285,37340,37340,37407,37407,37430,37425,
+37377,37377,37305,37305,37246,37227,37194,37194,
+37178,37178,37182,37186,37198,37198,37208,37208,
+37208,37206,37195,37195,37173,37173,37160,37154,
+37137,37137,37112,37112,37098,37094,37086,37086,
+37063,37063,37022,37004,36952,36952,36892,36892,
+36841,36815,36737,36737,36678,36678,36665,36667,
+36689,36689,36660,36660,36589,36559,36479,36479,
+36373,36373,36332,36325,36334,36334,36299,36299,
+36225,36193,36104,36104,35979,35979,35890,35858,
+35789,35789,35653,35653,35484,35419,35261,35261,
+35186,33757,32024,28331,30896,33194,34960,36329,
+36623,37306,38102,38274,38216,37257,36675,38216,
+38856,38775,39322,39453,39243,39132,38908,38554,
+38445,38185,38092,37692,37876,37923,37645,37197,
+36903,36992,37045,37000,36264,35683,35412,36405,
+38023,38023,38172,38172,38371,38429,38524,38524,
+38469,38469,38404,38378,38311,38311,38139,38139,
+37961,37904,37799,37799,37742,37742,37708,37696,
+37673,37673,37612,37612,37536,37519,37513,37513,
+37609,37609,37668,37682,37698,37698,37665,37665,
+37596,37573,37527,37527,37522,37522,37538,37546,
+37571,37571,37520,37520,37411,37377,37320,37320,
+37309,37309,37303,37303,37308,37308,37326,37326,
+37341,37342,37337,37337,37310,37310,37264,37242,
+37177,37177,37150,37150,37174,37185,37221,37221,
+37278,37278,37298,37298,37276,37276,37299,37299,
+37368,37381,37378,37378,37297,37297,37236,37212,
+37152,37152,37083,37083,37029,37010,36971,36971,
+36938,36938,36905,36890,36851,36851,36838,36838,
+36860,36867,36879,36879,36869,36869,36838,36822,
+36772,36772,36751,36751,36771,36781,36804,36804,
+36837,36837,36891,36907,36934,36934,36893,36893,
+36857,36841,36797,36797,41667,41568,40991,38594,
+40510,41423,40807,40424,39042,37117,37435,36486,
+34904,34187,34408,35711,33546,33920,32661,32643,
+32602,34726,36341,39031,39241,39241,39300,39311,
+39307,39307,39233,39233,39146,39114,39039,39039,
+38971,38971,38957,38958,38974,38974,38941,38941,
+38870,38839,38754,38754,38625,38625,38567,38556,
+38561,38561,38516,38516,38439,38403,38302,38302,
+38142,38142,38026,37981,37878,37878,37820,37820,
+37833,37827,37785,37785,37671,37671,37592,37563,
+37493,37493,37405,37405,37343,37327,37302,37302,
+37314,37314,37330,37338,37358,37358,37387,37387,
+37414,37425,37456,37456,37490,37490,37471,37456,
+37392,37392,37368,37368,37397,37403,37402,37402,
+37361,37361,37361,37368,37405,37405,37388,37388,
+37326,37306,37266,37266,37243,37243,37217,37206,
+37172,37172,37159,37159,37175,37183,37207,37207,
+37235,37235,37200,37174,37078,37078,36973,36973,
+36893,36870,36832,36832,36848,36848,36854,36855,
+36855,36855,36879,36879,36909,36917,36930,36930,
+36926,36926,36944,36955,36994,36994,36968,36968,
+36886,36864,36830,36830,36850,36850,36861,36864,
+36866,36866,36851,36851,36830,36823,36809,36809,
+36805,36805,36847,36872,36954,36954,37054,37054,
+37138,37176,37283,37283,37392,37392,37381,39841,
+40672,41637,42498,42596,42697,42784,43066,42720,
+43330,43402,43168,44341,43144,42350,42739,44562,
+44439,45238,45412,45268,44608,44143,43633,43027,
+41363,40349,36126,36126,36187,36200,36204,40112,
+40683,41194,41824,42189,42836,44232,44850,43136,
+44428,44812,44465,42962,42532,40425,42054,44146,
+44292,44306,44042,43717,43432,43379,43332,43351,
+42984,42651,41992,41572,41308,41213,41077,41093,
+41302,40620,40121,39702,39695,38957,37900,36973,
+37074,37456,38712,38712,38802,38819,38807,38807,
+38623,38623,38437,38363,38177,38177,38022,38022,
+37938,37905,37822,37822,37733,37733,37645,37607,
+37503,37503,37322,37322,37127,37071,36989,36989,
+37021,37021,37079,37108,37198,37198,37174,37174,
+37065,37044,37048,37048,37159,37159,37218,37231,
+37238,37238,37238,37238,37239,37248,37289,37289,
+37396,37396,37396,37378,37287,37287,37275,37275,
+37334,37343,37336,37336,37247,37247,37216,37215,
+37236,37236,37259,37259,37275,37268,37219,37219,
+37092,37092,37072,37080,37138,37138,37171,37171,
+37164,37157,37128,37128,37069,37069,37007,36978,
+36900,36900,36842,36842,36829,36832,36858,36858,
+36938,36938,36971,36977,36972,36972,36920,36920,
+36841,36818,36790,36790,36812,36812,36820,36820,
+36814,36814,36848,36848,36924,36952,37016,37016,
+37067,37067,37074,37070,37044,37044,36966,36966,
+36867,36846,36842,36842,36956,36956,36991,36991,
+36956,36956,36985,36985,37071,37092,37113,37113,
+37061,37061,37034,37022,36993,36993,37011,37011,
+37080,37103,37146,37146,37160,37160,37166,37170,
+37183,37183,37195,37195,37200,37204,37222,37222,
+37247,37247,37237,37229,37201,37201,37216,37216,
+37264,37285,37340,37340,37407,37407,37430,37425,
+37377,37377,37305,37305,37246,37227,37194,37194,
+37178,37178,37182,37186,37198,37198,37208,37208,
+37208,37206,37195,37195,37173,37173,37160,37154,
+37137,37137,37112,37112,37098,37094,37086,37086,
+37063,37063,37022,37004,36952,36952,36892,36892,
+36841,36815,36737,36737,36678,36678,36665,36667,
+36689,36689,36660,36660,36589,36559,36479,36479,
+36373,36373,36332,36325,36334,36334,36299,36299,
+36225,36193,36104,36104,35979,35979,35890,35858,
+35789,35789,35653,35653,35484,35419,35261,35261,
+34074,33867,32104,28130,30905,33404,35473,36422,
+36082,36968,37667,37682,38024,37732,36474,38042,
+38914,38997,39281,39484,39292,39117,38874,38610,
+38457,38124,37935,37782,37991,37978,37576,37165,
+36803,37008,37134,36834,36078,35612,35459,36171,
+38023,38023,38172,38172,38371,38429,38524,38524,
+38469,38469,38404,38378,38311,38311,38139,38139,
+37961,37904,37799,37799,37742,37742,37708,37696,
+37673,37673,37612,37612,37536,37519,37513,37513,
+37609,37609,37668,37682,37698,37698,37665,37665,
+37596,37573,37527,37527,37522,37522,37538,37546,
+37571,37571,37520,37520,37411,37377,37320,37320,
+37309,37309,37303,37303,37308,37308,37326,37326,
+37341,37342,37337,37337,37310,37310,37264,37242,
+37177,37177,37150,37150,37174,37185,37221,37221,
+37278,37278,37298,37298,37276,37276,37299,37299,
+37368,37381,37378,37378,37297,37297,37236,37212,
+37152,37152,37083,37083,37029,37010,36971,36971,
+36938,36938,36905,36890,36851,36851,36838,36838,
+36860,36867,36879,36879,36869,36869,36838,36822,
+36772,36772,36751,36751,36771,36781,36804,36804,
+36837,36837,36891,36907,36934,36934,36893,36893,
+36857,36841,36797,36797,42274,43603,40945,37953,
+41837,41724,39020,40670,40062,38539,38238,37209,
+35862,35447,34506,35678,34939,33467,31454,30850,
+31090,33655,33834,34935,39241,39241,39300,39311,
+39307,39307,39233,39233,39146,39114,39039,39039,
+38971,38971,38957,38958,38974,38974,38941,38941,
+38870,38839,38754,38754,38625,38625,38567,38556,
+38561,38561,38516,38516,38439,38403,38302,38302,
+38142,38142,38026,37981,37878,37878,37820,37820,
+37833,37827,37785,37785,37671,37671,37592,37563,
+37493,37493,37405,37405,37343,37327,37302,37302,
+37314,37314,37330,37338,37358,37358,37387,37387,
+37414,37425,37456,37456,37490,37490,37471,37456,
+37392,37392,37368,37368,37397,37403,37402,37402,
+37361,37361,37361,37368,37405,37405,37388,37388,
+37326,37306,37266,37266,37243,37243,37217,37206,
+37172,37172,37159,37159,37175,37183,37207,37207,
+37235,37235,37200,37174,37078,37078,36973,36973,
+36893,36870,36832,36832,36848,36848,36854,36855,
+36855,36855,36879,36879,36909,36917,36930,36930,
+36926,36926,36944,36955,36994,36994,36968,36968,
+36886,36864,36830,36830,36850,36850,36861,36864,
+36866,36866,36851,36851,36830,36823,36809,36809,
+36805,36805,36847,36872,36954,36954,37054,37054,
+37138,37176,37283,37283,37392,37392,37381,39955,
+40877,41718,42645,42779,42895,42969,43045,43681,
+44664,43444,43354,43868,43334,44188,45873,45908,
+44456,45816,46199,46322,45979,45721,45454,43435,
+43145,42636,41459,40979,40260,41824,42275,41882,
+41586,42587,42590,42732,43353,44728,44718,44472,
+44871,43919,43020,43365,43552,42284,41303,44639,
+44479,44514,43854,43632,43298,43006,42918,42815,
+42678,43149,41977,41298,41146,41035,41589,41160,
+41229,40141,39475,39495,40101,39306,37828,36530,
+36730,37197,38712,38712,38802,38819,38807,38807,
+38623,38623,38437,38363,38177,38177,38022,38022,
+37938,37905,37822,37822,37733,37733,37645,37607,
+37503,37503,37322,37322,37127,37071,36989,36989,
+37021,37021,37079,37108,37198,37198,37174,37174,
+37065,37044,37048,37048,37159,37159,37218,37231,
+37238,37238,37238,37238,37239,37248,37289,37289,
+37592,37592,37587,37571,37501,37501,37482,37482,
+37508,37514,37515,37515,37487,37487,37469,37465,
+37461,37461,37454,37454,37447,37435,37383,37383,
+37275,37275,37247,37247,37274,37274,37298,37298,
+37308,37309,37303,37303,37273,37273,37214,37182,
+37087,37087,37021,37021,37012,37014,37038,37038,
+37103,37103,37108,37100,37055,37055,37009,37009,
+36979,36973,36973,36973,37005,37005,37003,36997,
+36968,36968,37017,37017,37133,37174,37259,37259,
+37317,37317,37315,37305,37255,37255,37182,37182,
+37115,37098,37086,37086,37142,37142,37136,37122,
+37054,37054,37120,37120,37300,37344,37388,37388,
+37284,37284,37256,37253,37267,37267,37298,37298,
+37345,37363,37401,37401,37425,37425,37442,37451,
+37475,37475,37487,37487,37478,37482,37505,37505,
+37560,37560,37551,37539,37484,37484,37499,37499,
+37573,37592,37610,37610,37559,37559,37533,37523,
+37503,37503,37457,37457,37410,37399,37390,37390,
+37355,37355,37360,37365,37386,37386,37408,37408,
+37409,37405,37385,37385,37348,37348,37326,37318,
+37298,37298,37267,37267,37248,37241,37228,37228,
+37212,37212,37150,37123,37049,37049,36987,36987,
+36958,36945,36911,36911,36883,36883,36870,36866,
+36860,36860,36811,36811,36738,36709,36635,36635,
+36541,36541,36507,36503,36516,36516,36473,36473,
+36379,36341,36250,36250,36146,36146,36049,36008,
+35905,35905,35758,35758,35595,35534,35386,35386,
+33985,34066,32675,28155,30186,32563,36212,35614,
+36561,36856,37424,37439,37970,37895,37022,38167,
+38953,39058,39602,39562,39353,39009,38714,38608,
+38314,38049,37921,37838,37892,37858,37388,37098,
+36835,36855,36872,36409,35781,35720,35543,35831,
+36367,37996,38125,38125,38302,38364,38494,38494,
+38558,38558,38551,38540,38487,38487,38335,38335,
+38175,38123,38017,38017,37939,37939,37897,37884,
+37862,37862,37803,37803,37726,37708,37690,37690,
+37749,37749,37811,37835,37889,37889,37891,37891,
+37843,37822,37766,37766,37710,37710,37702,37705,
+37727,37727,37656,37656,37517,37482,37444,37444,
+37514,37514,37545,37552,37560,37560,37591,37591,
+37627,37633,37627,37627,37570,37570,37536,37526,
+37510,37510,37491,37491,37477,37474,37474,37474,
+37491,37491,37476,37463,37408,37408,37397,37397,
+37437,37444,37440,37440,37387,37387,37341,37322,
+37277,37277,37199,37199,37117,37091,37042,37042,
+37016,37016,36986,36973,36940,36940,36922,36922,
+36927,36930,36937,36937,36936,36936,36905,36887,
+36829,36829,36799,36799,36816,36825,36852,36852,
+36883,36883,36944,36963,36997,36997,36910,36910,
+36839,36825,36825,36825,41757,41182,41013,42149,
+41878,41932,38077,37948,40444,38677,37463,36832,
+36326,35981,35864,36064,35608,35060,32577,31408,
+30638,31694,31674,32320,39293,39293,39387,39409,
+39424,39424,39390,39390,39341,39320,39269,39269,
+39226,39226,39210,39203,39189,39189,39158,39158,
+39122,39101,39033,39033,38908,38908,38856,38849,
+38866,38866,38797,38797,38669,38622,38515,38515,
+38400,38400,38314,38281,38201,38201,38142,38142,
+38132,38125,38098,38098,38045,38045,37979,37948,
+37854,37854,37713,37713,37581,37545,37500,37500,
+37543,37543,37601,37629,37711,37711,37764,37764,
+37767,37768,37769,37769,37763,37763,37734,37716,
+37661,37661,37640,37640,37666,37672,37672,37672,
+37639,37639,37615,37606,37586,37586,37559,37559,
+37538,37530,37508,37508,37482,37482,37444,37425,
+37372,37372,37352,37352,37378,37387,37410,37410,
+37424,37424,37415,37406,37372,37372,37307,37307,
+37231,37205,37149,37149,37117,37117,37085,37072,
+37041,37041,37072,37072,37144,37163,37180,37180,
+37138,37138,37133,37138,37166,37166,37159,37159,
+37122,37109,37081,37081,37063,37063,37048,37041,
+37020,37020,37005,37005,37005,37005,37007,37007,
+37014,37014,37038,37049,37088,37088,37171,37171,
+37261,37300,37406,37406,37497,37497,37472,40453,
+41373,42087,42974,42961,43021,42934,42626,43466,
+44313,43736,43330,43107,43381,43784,44782,45257,
+44673,46032,45663,46421,46145,45731,44689,45306,
+45110,45029,42892,42673,42585,42882,42983,42960,
+43187,43147,43618,44892,44862,45542,44814,44970,
+44798,43693,43473,43980,43203,42834,42652,45512,
+44536,44484,43924,43507,43134,42663,42548,42438,
+42338,42620,42086,41432,41227,41027,42007,41282,
+41161,40400,39480,39579,40090,39338,38076,36450,
+36480,37025,38883,38883,38909,38906,38866,38866,
+38711,38711,38572,38520,38398,38398,38299,38299,
+38246,38214,38110,38110,37934,37934,37797,37743,
+37611,37611,37480,37480,37404,37384,37369,37369,
+37411,37411,37420,37420,37409,37409,37341,37341,
+37254,37235,37230,37230,37306,37306,37351,37362,
+37372,37372,37402,37402,37450,37469,37519,37519,
+37679,37679,37671,37656,37592,37592,37571,37571,
+37588,37591,37598,37598,37594,37594,37580,37573,
+37555,37555,37535,37535,37519,37506,37454,37454,
+37357,37357,37326,37323,37335,37335,37354,37354,
+37374,37378,37380,37380,37359,37359,37299,37267,
+37166,37166,37100,37100,37092,37095,37118,37118,
+37177,37177,37171,37157,37096,37096,37052,37052,
+37042,37042,37053,37053,37087,37087,37081,37072,
+37035,37035,37089,37089,37220,37264,37358,37358,
+37419,37419,37415,37401,37341,37341,37274,37274,
+37223,37210,37196,37196,37229,37229,37209,37189,
+37112,37112,37191,37191,37401,37454,37505,37505,
+37384,37384,37355,37355,37383,37383,37418,37418,
+37457,37472,37508,37508,37539,37539,37560,37570,
+37598,37598,37610,37610,37599,37602,37627,37627,
+37692,37692,37684,37670,37605,37605,37619,37619,
+37700,37717,37720,37720,37628,37628,37583,37571,
+37558,37558,37520,37520,37477,37469,37469,37469,
+37429,37429,37434,37440,37465,37465,37491,37491,
+37493,37489,37465,37465,37423,37423,37397,37387,
+37365,37365,37334,37334,37311,37303,37288,37288,
+37271,37271,37202,37172,37088,37088,37027,37027,
+37008,37002,36985,36985,36967,36967,36953,36946,
+36929,36929,36872,36872,36797,36768,36697,36697,
+36609,36609,36578,36575,36590,36590,36544,36544,
+36443,36404,36311,36311,36214,36214,36112,36069,
+35953,35953,35802,35802,35642,35582,35438,35438,
+35375,34698,33474,27775,27684,30970,35133,35884,
+35591,36099,37209,37796,38672,39276,38859,37942,
+38332,38965,39876,39648,39394,38765,38617,38669,
+38065,38001,37961,37564,37588,37567,37276,37093,
+36736,36727,36931,36774,36580,36616,36524,36430,
+36474,36743,37373,37607,38278,38340,38484,38484,
+38593,38593,38610,38604,38559,38559,38417,38417,
+38268,38217,38114,38114,38029,38029,37983,37969,
+37947,37947,37888,37888,37813,37795,37772,37772,
+37815,37815,37877,37901,37967,37967,37981,37981,
+37940,37920,37861,37861,37786,37786,37769,37770,
+37792,37792,37716,37716,37570,37535,37507,37507,
+37605,37605,37648,37658,37666,37666,37699,37699,
+37744,37751,37745,37745,37678,37678,37648,37642,
+37645,37645,37628,37628,37600,37591,37579,37579,
+37578,37578,37550,37532,37466,37466,37443,37443,
+37472,37476,37470,37470,37427,37427,37383,37366,
+37324,37324,37244,37244,37151,37123,37071,37071,
+37049,37049,37020,37008,36978,36978,36958,36958,
+36958,36959,36964,36964,36964,36964,36932,36914,
+36853,36853,36819,36819,36834,36842,36872,36872,
+36901,36901,36962,36980,37014,37014,36906,36906,
+36821,36808,43104,42722,40602,41632,41588,39128,
+41850,41721,39818,39793,40928,40354,40087,40791,
+37284,37347,37103,36705,36283,36163,35930,33532,
+30748,30019,30594,31335,33828,35657,39421,39447,
+39471,39471,39457,39457,39424,39409,39369,39369,
+39333,39333,39313,39303,39278,39278,39248,39248,
+39223,39207,39147,39147,39026,39026,38978,38973,
+38994,38994,38915,38915,38769,38718,38610,38610,
+38512,38512,38438,38409,38337,38337,38278,38278,
+38259,38252,38230,38230,38202,38202,38142,38110,
+38009,38009,37850,37850,37697,37655,37601,37601,
+37651,37651,37721,37756,37857,37857,37917,37917,
+37909,37906,37896,37896,37874,37874,37841,37824,
+37774,37774,37755,37755,37778,37783,37785,37785,
+37757,37757,37724,37709,37666,37666,37634,37634,
+37629,37625,37611,37611,37584,37584,37541,37519,
+37456,37456,37433,37433,37464,37474,37497,37497,
+37505,37505,37506,37505,37497,37497,37450,37450,
+37377,37349,37287,37287,37234,37234,37187,37170,
+37128,37128,37161,37161,37247,37267,37285,37285,
+37227,37227,37214,37216,37236,37236,37235,37235,
+37214,37205,37179,37179,37150,37150,37125,37113,
+37083,37083,37066,37066,37075,37078,37087,37087,
+37100,37100,37119,37127,37152,37152,37229,37229,
+37322,37361,37466,37466,37548,37548,39614,41784,
+42101,42670,43177,43738,43457,42842,42221,43874,
+44861,43545,43549,44104,44362,44513,44410,44322,
+44274,45578,46019,46859,45629,45335,44913,44833,
+45564,45232,44481,45164,46344,44629,44156,44659,
+45553,46514,47259,44497,42184,44033,43604,43419,
+43592,44455,44031,44117,43297,42982,43093,44044,
+44317,44200,44222,43406,42969,42526,42757,42946,
+43233,43250,42280,42018,41639,41573,41750,42049,
+41871,40785,40337,40158,39162,38695,37761,36219,
+35944,36545,38956,38956,38957,38947,38894,38894,
+38747,38747,38626,38583,38486,38486,38409,38409,
+38367,38336,38224,38224,38017,38017,37863,37803,
+37663,37663,37553,37553,37523,37518,37527,37527,
+37570,37570,37562,37550,37504,37504,37421,37421,
+37340,37322,37315,37315,37382,37382,37421,37429,
+37435,37435,37474,37474,37541,37565,37618,37618,
+37921,37921,37905,37888,37825,37825,37803,37803,
+37820,37830,37860,37860,37901,37901,37880,37861,
+37787,37787,37724,37724,37692,37678,37642,37642,
+37601,37601,37567,37553,37517,37517,37524,37524,
+37565,37576,37588,37588,37562,37562,37500,37468,
+37372,37372,37317,37317,37322,37328,37349,37349,
+37393,37393,37363,37338,37243,37243,37202,37202,
+37228,37240,37270,37270,37303,37303,37286,37270,
+37213,37213,37268,37268,37413,37462,37564,37564,
+37635,37635,37631,37615,37544,37544,37508,37508,
+37525,37528,37528,37528,37513,37513,37476,37455,
+37387,37387,37475,37475,37686,37739,37792,37792,
+37677,37677,37647,37646,37671,37671,37700,37700,
+37726,37739,37779,37779,37830,37830,37859,37871,
+37899,37899,37917,37917,37918,37922,37946,37946,
+38005,38005,37997,37983,37924,37924,37924,37924,
+37978,37984,37960,37960,37828,37828,37759,37740,
+37711,37711,37667,37667,37627,37621,37634,37634,
+37604,37604,37613,37622,37654,37654,37690,37690,
+37692,37687,37657,37657,37609,37609,37578,37566,
+37538,37538,37500,37500,37467,37455,37425,37425,
+37395,37395,37309,37271,37165,37165,37121,37121,
+37157,37166,37174,37174,37154,37154,37126,37111,
+37066,37066,36988,36988,36908,36879,36816,36816,
+36759,36759,36737,36734,36738,36738,36694,36694,
+36603,36565,36466,36466,36346,36346,36233,36185,
+36061,36061,35914,35914,35760,35702,35559,35559,
+35496,34265,33241,27768,26723,29753,34182,35066,
+35022,36214,37916,38572,38579,38949,39241,38227,
+38198,38818,39102,39124,39303,38650,38631,38652,
+38040,37975,37874,37543,37539,37567,37174,37013,
+36940,37004,37159,36966,36905,36967,36854,36888,
+36956,37032,36852,36961,38257,38308,38490,38490,
+38650,38650,38717,38729,38716,38716,38621,38621,
+38514,38476,38391,38391,38310,38310,38256,38236,
+38194,38194,38135,38135,38083,38067,38042,38042,
+38046,38046,38075,38090,38137,38137,38145,38145,
+38112,38093,38033,38033,37941,37941,37918,37919,
+37944,37944,37888,37888,37769,37744,37737,37737,
+37860,37860,37909,37917,37911,37911,37938,37938,
+37990,38000,38000,38000,37934,37934,37910,37907,
+37918,37918,37899,37899,37859,37844,37808,37808,
+37768,37768,37723,37702,37636,37636,37600,37600,
+37602,37599,37581,37581,37536,37536,37478,37456,
+37396,37396,37308,37308,37219,37192,37144,37144,
+37127,37127,37103,37092,37067,37067,37050,37050,
+37049,37047,37041,37041,37018,37018,36981,36964,
+36913,36913,36875,36875,36877,36882,36906,36906,
+36924,36924,36962,36970,36976,36976,36804,36804,
+36691,36683,44031,42029,41984,41331,41206,41692,
+41922,42042,41627,41154,39800,38763,39635,38314,
+38275,38049,37828,37477,36760,36657,36255,34330,
+31799,30315,29594,30700,32594,33994,39473,39507,
+39576,39576,39615,39615,39641,39643,39623,39623,
+39574,39574,39541,39525,39481,39481,39452,39452,
+39442,39432,39395,39395,39312,39312,39281,39277,
+39291,39291,39200,39200,39045,38992,38887,38887,
+38814,38814,38757,38735,38675,38675,38612,38612,
+38572,38562,38553,38553,38577,38577,38538,38510,
+38411,38411,38263,38263,38123,38081,38013,38013,
+38017,38017,38064,38092,38188,38188,38232,38232,
+38202,38188,38152,38152,38096,38096,38065,38056,
+38043,38043,38036,38036,38040,38042,38046,38046,
+38046,38046,38004,37978,37892,37892,37845,37845,
+37856,37858,37857,37857,37841,37841,37783,37751,
+37651,37651,37623,37623,37678,37695,37719,37719,
+37711,37711,37737,37755,37813,37813,37811,37811,
+37752,37724,37650,37650,37550,37550,37483,37461,
+37415,37415,37441,37441,37518,37534,37534,37534,
+37449,37449,37409,37398,37389,37389,37382,37382,
+37381,37378,37362,37362,37329,37329,37294,37276,
+37226,37226,37200,37200,37216,37223,37247,37247,
+37288,37288,37322,37336,37369,37369,37454,37454,
+37543,37579,37666,37666,37722,37722,40057,42228,
+42424,42906,42603,42269,42699,43943,42791,43990,
+43821,44013,43786,45039,45466,44862,44632,45182,
+44314,45849,46269,46277,45911,45813,45956,46051,
+46047,45693,45874,46122,46409,44535,44970,44343,
+46206,46404,47120,44263,43871,44228,43789,43611,
+43374,44428,44597,44461,44339,43862,43413,43968,
+44253,44007,43582,42974,42506,42598,42985,43151,
+43018,43310,42441,42529,41982,41705,41499,41640,
+41802,41456,41254,41133,39633,39138,38387,36287,
+36010,36672,39124,39124,39102,39081,38996,38996,
+38837,38837,38736,38706,38653,38653,38612,38612,
+38587,38558,38441,38441,38201,38201,38037,37978,
+37847,37847,37789,37789,37834,37851,37892,37892,
+37924,37924,37890,37867,37780,37780,37680,37680,
+37606,37591,37591,37591,37677,37677,37700,37695,
+37651,37651,37679,37679,37775,37807,37873,37873,
+37921,37921,37905,37888,37825,37825,37803,37803,
+37820,37830,37860,37860,37901,37901,37880,37861,
+37787,37787,37724,37724,37692,37678,37642,37642,
+37601,37601,37567,37553,37517,37517,37524,37524,
+37565,37576,37588,37588,37562,37562,37500,37468,
+37372,37372,37317,37317,37322,37328,37349,37349,
+37393,37393,37363,37338,37243,37243,37202,37202,
+37228,37240,37270,37270,37303,37303,37286,37270,
+37213,37213,37268,37268,37413,37462,37564,37564,
+37635,37635,37631,37615,37544,37544,37508,37508,
+37525,37528,37528,37528,37513,37513,37476,37455,
+37387,37387,37475,37475,37686,37739,37792,37792,
+37677,37677,37647,37646,37671,37671,37700,37700,
+37726,37739,37779,37779,37830,37830,37859,37871,
+37899,37899,37917,37917,37918,37922,37946,37946,
+38005,38005,37997,37983,37924,37924,37924,37924,
+37978,37984,37960,37960,37828,37828,37759,37740,
+37711,37711,37667,37667,37627,37621,37634,37634,
+37604,37604,37613,37622,37654,37654,37690,37690,
+37692,37687,37657,37657,37609,37609,37578,37566,
+37538,37538,37500,37500,37467,37455,37425,37425,
+37395,37395,37309,37271,37165,37165,37121,37121,
+37157,37166,37174,37174,37154,37154,37126,37111,
+37066,37066,36988,36988,36908,36879,36816,36816,
+36759,36759,36737,36734,36738,36738,36694,36694,
+36603,36565,36466,36466,36346,36346,36233,36185,
+36061,36061,35914,35914,35760,35702,35559,35559,
+35496,33745,32792,28260,26996,28733,33028,34027,
+34270,36123,37124,38756,38475,38506,38706,38679,
+38518,38989,39132,38997,39144,38749,38617,38521,
+38124,38151,38047,37687,37597,37673,37152,37240,
+37141,37144,37113,36900,36874,36863,36717,36745,
+36852,36897,36173,36084,36856,38308,38490,38490,
+38650,38650,38717,38729,38716,38716,38621,38621,
+38514,38476,38391,38391,38310,38310,38256,38236,
+38194,38194,38135,38135,38083,38067,38042,38042,
+38046,38046,38075,38090,38137,38137,38145,38145,
+38112,38093,38033,38033,37941,37941,37918,37919,
+37944,37944,37888,37888,37769,37744,37737,37737,
+37860,37860,37909,37917,37911,37911,37938,37938,
+37990,38000,38000,38000,37934,37934,37910,37907,
+37918,37918,37899,37899,37859,37844,37808,37808,
+37768,37768,37723,37702,37636,37636,37600,37600,
+37602,37599,37581,37581,37536,37536,37478,37456,
+37396,37396,37308,37308,37219,37192,37144,37144,
+37127,37127,37103,37092,37067,37067,37050,37050,
+37049,37047,37041,37041,37018,37018,36981,36964,
+36913,36913,36875,36875,36877,36882,36906,36906,
+36924,36924,36962,36970,36976,36976,36804,36804,
+36691,36683,43144,41542,41699,41651,40995,40992,
+41228,41554,41276,40514,39247,38242,38455,38501,
+39133,38401,38289,38203,38340,37922,37424,36434,
+35481,31620,30212,31428,32659,32992,35025,39507,
+39576,39576,39615,39615,39641,39643,39623,39623,
+39574,39574,39541,39525,39481,39481,39452,39452,
+39442,39432,39395,39395,39312,39312,39281,39277,
+39291,39291,39200,39200,39045,38992,38887,38887,
+38814,38814,38757,38735,38675,38675,38612,38612,
+38572,38562,38553,38553,38577,38577,38538,38510,
+38411,38411,38263,38263,38123,38081,38013,38013,
+38017,38017,38064,38092,38188,38188,38232,38232,
+38202,38188,38152,38152,38096,38096,38065,38056,
+38043,38043,38036,38036,38040,38042,38046,38046,
+38046,38046,38004,37978,37892,37892,37845,37845,
+37856,37858,37857,37857,37841,37841,37783,37751,
+37651,37651,37623,37623,37678,37695,37719,37719,
+37711,37711,37737,37755,37813,37813,37811,37811,
+37752,37724,37650,37650,37550,37550,37483,37461,
+37415,37415,37441,37441,37518,37534,37534,37534,
+37449,37449,37409,37398,37389,37389,37382,37382,
+37381,37378,37362,37362,37329,37329,37294,37276,
+37226,37226,37200,37200,37216,37223,37247,37247,
+37288,37288,37322,37336,37369,37369,37454,37454,
+37543,37579,37666,37666,37722,37722,40421,42215,
+42707,42942,42005,42411,42484,43289,43476,43833,
+43637,43777,44308,45382,45674,44429,44641,45388,
+45247,45634,45913,45957,46163,46882,45987,45638,
+44753,44679,45719,45979,46225,44885,45423,45527,
+45890,45294,44520,44156,43752,43487,44155,43990,
+42637,44562,45586,44796,44609,44258,43807,44171,
+43972,43930,43326,42861,42639,42864,42614,42489,
+42980,42487,42403,42227,42102,41999,41361,41545,
+41717,41127,41156,40988,39777,39463,38888,36420,
+36187,36978,39124,39124,39102,39081,38996,38996,
+38837,38837,38736,38706,38653,38653,38612,38612,
+38587,38558,38441,38441,38201,38201,38037,37978,
+37847,37847,37789,37789,37834,37851,37892,37892,
+37924,37924,37890,37867,37780,37780,37680,37680,
+37606,37591,37591,37591,37677,37677,37700,37695,
+37651,37651,37679,37679,37775,37807,37873,37873,
+38178,38178,38162,38142,38062,38062,38057,38057,
+38121,38146,38209,38209,38268,38268,38208,38163,
+37997,37997,37876,37876,37840,37833,37837,37837,
+37894,37894,37867,37841,37742,37742,37719,37719,
+37777,37789,37792,37792,37722,37722,37656,37630,
+37563,37563,37538,37538,37559,37569,37595,37595,
+37629,37629,37586,37555,37448,37448,37410,37410,
+37460,37476,37510,37510,37530,37530,37496,37474,
+37400,37400,37432,37432,37553,37596,37690,37690,
+37780,37780,37789,37777,37708,37708,37735,37735,
+37855,37887,37926,37926,37875,37875,37855,37851,
+37854,37854,37914,37914,38004,38027,38059,38059,
+38042,38042,38018,38006,37969,37969,37956,37956,
+37975,37988,38032,38032,38100,38100,38132,38141,
+38156,38156,38196,38196,38247,38262,38288,38288,
+38290,38290,38283,38279,38261,38261,38231,38231,
+38196,38181,38140,38140,38081,38081,38023,37999,
+37932,37932,37863,37863,37815,37808,37827,37827,
+37789,37789,37788,37793,37816,37816,37845,37845,
+37847,37843,37821,37821,37784,37784,37750,37735,
+37699,37699,37657,37657,37622,37609,37579,37579,
+37562,37562,37479,37439,37323,37323,37291,37291,
+37357,37372,37376,37376,37304,37304,37241,37214,
+37140,37140,37036,37036,36945,36917,36868,36868,
+36864,36864,36856,36851,36834,36834,36809,36809,
+36775,36748,36641,36641,36446,36446,36311,36263,
+36159,36159,36029,36029,35882,35824,35677,35677,
+35601,33968,33473,30431,27356,27298,31425,32282,
+33006,34549,35950,36609,36766,37760,38279,39400,
+39263,39354,39542,39159,39029,38847,38786,38686,
+38367,38257,38266,37922,37782,37653,37329,37442,
+37609,37457,37346,37224,37216,37202,37076,36931,
+36909,36768,36129,35978,36067,37756,38573,38573,
+38682,38682,38772,38794,38816,38816,38782,38782,
+38736,38719,38680,38680,38641,38641,38580,38549,
+38464,38464,38400,38400,38382,38376,38356,38356,
+38321,38321,38287,38274,38241,38241,38194,38194,
+38151,38132,38084,38084,38024,38024,38018,38024,
+38058,38058,38071,38071,38051,38051,38069,38069,
+38138,38138,38149,38144,38110,38110,38113,38113,
+38151,38162,38174,38174,38151,38151,38118,38104,
+38066,38066,38036,38036,38020,38009,37974,37974,
+37909,37909,37876,37865,37847,37847,37823,37823,
+37799,37786,37745,37745,37663,37663,37565,37525,
+37418,37418,37329,37329,37279,37263,37233,37233,
+37209,37209,37183,37173,37147,37147,37141,37141,
+37155,37153,37130,37130,37054,37054,37008,36996,
+36975,36975,36941,36941,36910,36904,36907,36907,
+36884,36884,36862,36853,36831,36831,36670,36670,
+36563,42332,40075,41138,40099,42688,39270,42380,
+41677,41049,40781,39372,38587,38210,37622,37731,
+38584,38621,39016,39031,39190,39323,39239,38458,
+36822,32174,33424,34790,34279,32731,32939,36503,
+37492,39647,39736,39736,39849,39872,39871,39871,
+39771,39771,39710,39688,39641,39641,39604,39604,
+39581,39573,39561,39561,39558,39558,39548,39541,
+39521,39521,39443,39443,39338,39299,39215,39215,
+39139,39139,39079,39053,38989,38989,38910,38910,
+38847,38834,38826,38826,38876,38876,38863,38846,
+38773,38773,38712,38712,38690,38673,38604,38604,
+38473,38473,38423,38414,38420,38420,38401,38401,
+38357,38338,38284,38284,38211,38211,38203,38212,
+38261,38261,38276,38276,38248,38244,38253,38253,
+38302,38302,38273,38248,38146,38146,38079,38079,
+38073,38073,38078,38078,38095,38095,38028,37984,
+37832,37832,37798,37798,37894,37921,37957,37957,
+37924,37924,37974,38007,38123,38123,38163,38163,
+38124,38100,38020,38020,37875,37875,37804,37788,
+37778,37778,37783,37783,37792,37786,37749,37749,
+37656,37656,37590,37566,37513,37513,37468,37468,
+37452,37448,37443,37443,37449,37449,37423,37405,
+37342,37342,37300,37300,37301,37309,37347,37347,
+37435,37435,37523,37562,37666,37666,37783,37783,
+37850,37873,37920,37920,37841,39738,40704,42728,
+43256,44175,45178,44818,44615,43935,44537,45059,
+44687,44781,45051,46214,45937,45373,46224,46031,
+45606,45632,45530,46495,46970,46672,46388,46845,
+46188,45901,46326,46404,46601,46322,46302,46546,
+45375,44461,44183,43723,43570,43639,43180,43961,
+44754,45557,46389,45857,44632,44564,44426,43128,
+43023,43000,43053,43237,42966,42758,42587,42424,
+42889,42396,42490,41407,41542,41511,41436,41469,
+41753,41312,40968,41043,40616,39961,39239,37103,
+36609,36874,37452,39327,39308,39283,39172,39172,
+38946,38946,38819,38784,38733,38733,38696,38696,
+38673,38648,38549,38549,38350,38350,38230,38191,
+38116,38116,38099,38099,38154,38171,38200,38200,
+38199,38199,38177,38165,38126,38126,38049,38049,
+37963,37950,37975,37975,38141,38141,38139,38106,
+37947,37947,37906,37906,38003,38037,38111,38111,
+38178,38178,38162,38142,38062,38062,38057,38057,
+38121,38146,38209,38209,38268,38268,38208,38163,
+37997,37997,37876,37876,37840,37833,37837,37837,
+37894,37894,37867,37841,37742,37742,37719,37719,
+37777,37789,37792,37792,37722,37722,37656,37630,
+37563,37563,37538,37538,37559,37569,37595,37595,
+37629,37629,37586,37555,37448,37448,37410,37410,
+37460,37476,37510,37510,37530,37530,37496,37474,
+37400,37400,37432,37432,37553,37596,37690,37690,
+37780,37780,37789,37777,37708,37708,37735,37735,
+37855,37887,37926,37926,37875,37875,37855,37851,
+37854,37854,37914,37914,38004,38027,38059,38059,
+38042,38042,38018,38006,37969,37969,37956,37956,
+37975,37988,38032,38032,38100,38100,38132,38141,
+38156,38156,38196,38196,38247,38262,38288,38288,
+38290,38290,38283,38279,38261,38261,38231,38231,
+38196,38181,38140,38140,38081,38081,38023,37999,
+37932,37932,37863,37863,37815,37808,37827,37827,
+37789,37789,37788,37793,37816,37816,37845,37845,
+37847,37843,37821,37821,37784,37784,37750,37735,
+37699,37699,37657,37657,37622,37609,37579,37579,
+37562,37562,37479,37439,37323,37323,37291,37291,
+37357,37372,37376,37376,37304,37304,37241,37214,
+37140,37140,37036,37036,36945,36917,36868,36868,
+36864,36864,36856,36851,36834,36834,36809,36809,
+36775,36748,36641,36641,36446,36446,36311,36263,
+36159,36159,36029,36029,35882,35824,35677,35677,
+35601,35601,33226,31378,28667,26590,28791,31694,
+33786,35592,36744,36267,35786,37043,37924,38918,
+39337,39518,39361,39130,38963,38856,38896,38698,
+38310,38244,38266,38092,37892,37724,37443,37447,
+37398,37463,37510,37556,37296,37305,37254,37089,
+36855,36615,36302,35864,35479,36825,37931,38573,
+38682,38682,38772,38794,38816,38816,38782,38782,
+38736,38719,38680,38680,38641,38641,38580,38549,
+38464,38464,38400,38400,38382,38376,38356,38356,
+38321,38321,38287,38274,38241,38241,38194,38194,
+38151,38132,38084,38084,38024,38024,38018,38024,
+38058,38058,38071,38071,38051,38051,38069,38069,
+38138,38138,38149,38144,38110,38110,38113,38113,
+38151,38162,38174,38174,38151,38151,38118,38104,
+38066,38066,38036,38036,38020,38009,37974,37974,
+37909,37909,37876,37865,37847,37847,37823,37823,
+37799,37786,37745,37745,37663,37663,37565,37525,
+37418,37418,37329,37329,37279,37263,37233,37233,
+37209,37209,37183,37173,37147,37147,37141,37141,
+37155,37153,37130,37130,37054,37054,37008,36996,
+36975,36975,36941,36941,36910,36904,36907,36907,
+36884,36884,36862,36853,36831,36831,36670,36670,
+40004,42735,43160,37328,35224,42273,42588,42899,
+41691,42118,39932,39637,39821,38348,37584,37446,
+38483,39221,39429,39286,39624,39839,38815,38937,
+37478,34198,32822,33006,33203,32659,32795,35904,
+37291,39647,39736,39736,39849,39872,39871,39871,
+39771,39771,39710,39688,39641,39641,39604,39604,
+39581,39573,39561,39561,39558,39558,39548,39541,
+39521,39521,39443,39443,39338,39299,39215,39215,
+39139,39139,39079,39053,38989,38989,38910,38910,
+38847,38834,38826,38826,38876,38876,38863,38846,
+38773,38773,38712,38712,38690,38673,38604,38604,
+38473,38473,38423,38414,38420,38420,38401,38401,
+38357,38338,38284,38284,38211,38211,38203,38212,
+38261,38261,38276,38276,38248,38244,38253,38253,
+38302,38302,38273,38248,38146,38146,38079,38079,
+38073,38073,38078,38078,38095,38095,38028,37984,
+37832,37832,37798,37798,37894,37921,37957,37957,
+37924,37924,37974,38007,38123,38123,38163,38163,
+38124,38100,38020,38020,37875,37875,37804,37788,
+37778,37778,37783,37783,37792,37786,37749,37749,
+37656,37656,37590,37566,37513,37513,37468,37468,
+37452,37448,37443,37443,37449,37449,37423,37405,
+37342,37342,37300,37300,37301,37309,37347,37347,
+37435,37435,37523,37562,37666,37666,37783,37783,
+37850,37873,37920,37920,39688,40324,41238,43565,
+44284,44904,45207,45251,44899,43916,44381,44429,
+44621,45032,45948,45841,46152,45384,45596,45392,
+45656,44378,44709,45529,47140,47553,47591,47174,
+46591,46313,46396,46557,46606,46283,46060,45436,
+45415,45121,45010,44406,44233,43734,44674,43882,
+44540,45392,40794,45603,44574,44449,44289,43167,
+43172,43107,43207,43148,42988,42631,42526,42455,
+42571,42687,42119,41241,41468,41746,41800,41392,
+41359,41187,40898,41514,40571,39641,38963,37299,
+36810,36965,37451,39327,39308,39283,39172,39172,
+38946,38946,38819,38784,38733,38733,38696,38696,
+38673,38648,38549,38549,38350,38350,38230,38191,
+38116,38116,38099,38099,38154,38171,38200,38200,
+38199,38199,38177,38165,38126,38126,38049,38049,
+37963,37950,37975,37975,38141,38141,38139,38106,
+37947,37947,37906,37906,38003,38037,38111,38111,
+38346,38346,38323,38304,38233,38233,38234,38234,
+38305,38331,38384,38384,38421,38421,38363,38323,
+38180,38180,38075,38075,38044,38038,38044,38044,
+38093,38093,38070,38049,37966,37966,37937,37937,
+37965,37967,37954,37954,37877,37877,37811,37788,
+37733,37733,37712,37712,37729,37737,37757,37757,
+37782,37782,37746,37721,37632,37632,37612,37612,
+37669,37685,37715,37715,37716,37716,37680,37661,
+37600,37600,37624,37624,37712,37745,37818,37818,
+37902,37902,37923,37919,37877,37877,37921,37921,
+38040,38072,38114,38114,38068,38068,38073,38083,
+38132,38132,38189,38189,38227,38241,38270,38270,
+38305,38305,38299,38290,38245,38245,38214,38214,
+38210,38214,38237,38237,38289,38289,38314,38322,
+38337,38337,38382,38382,38438,38454,38476,38476,
+38464,38464,38456,38453,38444,38444,38403,38403,
+38341,38319,38273,38273,38231,38231,38191,38174,
+38126,38126,38059,38059,37997,37983,37974,37974,
+37926,37926,37910,37908,37912,37912,37923,37923,
+37923,37920,37908,37908,37887,37887,37861,37848,
+37811,37811,37764,37764,37725,37710,37674,37674,
+37643,37643,37569,37536,37443,37443,37417,37417,
+37469,37478,37471,37471,37389,37389,37316,37286,
+37204,37204,37097,37097,37007,36980,36934,36934,
+36935,36935,36928,36923,36901,36901,36881,36881,
+36854,36826,36712,36712,36491,36491,36351,36305,
+36216,36216,36104,36104,35981,35931,35807,35807,
+35742,35742,33619,32762,30137,27717,25972,29868,
+32560,35153,36290,35879,36500,37675,38388,38813,
+39348,39606,39192,39125,38952,38880,38690,38675,
+38449,38433,38389,38146,38033,37985,37549,37447,
+37494,37376,37499,37483,37369,37337,37198,37189,
+37061,36801,36374,35898,35114,35880,37228,38685,
+38765,38765,38849,38871,38896,38896,38882,38882,
+38859,38850,38829,38829,38807,38807,38748,38716,
+38620,38620,38559,38559,38554,38549,38531,38531,
+38481,38481,38425,38402,38341,38341,38271,38271,
+38216,38197,38154,38154,38121,38121,38128,38136,
+38174,38174,38214,38214,38236,38247,38274,38274,
+38317,38317,38312,38302,38257,38257,38245,38245,
+38270,38279,38295,38295,38295,38295,38257,38236,
+38174,38174,38144,38144,38146,38138,38096,38096,
+37999,37999,37962,37954,37956,37956,37931,37931,
+37891,37873,37821,37821,37731,37731,37624,37578,
+37457,37457,37382,37382,37373,37366,37345,37345,
+37298,37298,37260,37247,37216,37216,37201,37201,
+37205,37198,37162,37162,37072,37072,37023,37009,
+36991,36991,36959,36959,36923,36914,36907,36907,
+36849,36849,36744,36709,36643,36643,36640,38612,
+44454,42458,42656,37782,42053,42307,42211,42944,
+41034,40635,39491,39158,40293,38210,38051,37156,
+38454,37795,39124,39569,39819,39990,38994,38118,
+37053,34939,32930,31671,32412,32725,32945,35905,
+37692,39667,39854,39854,39975,40002,40009,40009,
+39915,39915,39855,39836,39800,39800,39758,39758,
+39714,39701,39687,39687,39702,39702,39694,39688,
+39663,39663,39596,39596,39515,39486,39420,39420,
+39360,39360,39303,39279,39213,39213,39132,39132,
+39068,39053,39046,39046,39100,39100,39091,39076,
+39006,39006,38946,38946,38923,38906,38845,38845,
+38738,38738,38675,38655,38614,38614,38561,38561,
+38512,38491,38433,38433,38358,38358,38354,38365,
+38423,38423,38435,38435,38395,38390,38403,38403,
+38473,38473,38446,38418,38301,38301,38227,38227,
+38224,38224,38225,38225,38230,38230,38171,38132,
+38006,38006,37969,37969,38044,38063,38087,38087,
+38052,38052,38104,38137,38254,38254,38291,38291,
+38248,38225,38153,38153,38024,38024,37966,37955,
+37959,37959,37955,37955,37934,37923,37882,37882,
+37813,37813,37752,37726,37664,37664,37611,37611,
+37592,37587,37575,37575,37569,37569,37543,37527,
+37474,37474,37437,37437,37435,37444,37488,37488,
+37596,37596,37700,37744,37859,37859,37960,37960,
+37986,37994,38006,38006,40226,41157,41630,44484,
+44383,44914,43799,45335,44556,44677,45622,45799,
+46155,46234,46066,46048,45915,45333,45050,45089,
+44563,44910,45341,45643,47226,47784,47317,47675,
+46623,47193,46779,46163,46626,46342,46196,45447,
+46373,45942,45503,43907,43421,43716,44427,44685,
+44884,45360,45660,45093,44116,44136,43950,42995,
+43057,43006,43282,43403,43194,42726,42555,42419,
+42523,42048,42222,41218,41486,41454,41030,40834,
+40960,40694,40541,40867,39886,39274,38905,37591,
+37271,37472,37963,39450,39437,39411,39294,39294,
+39040,39040,38901,38863,38811,38811,38780,38780,
+38765,38748,38671,38671,38505,38505,38415,38388,
+38347,38347,38361,38361,38427,38442,38450,38450,
+38390,38390,38360,38351,38339,38339,38293,38293,
+38228,38219,38246,38246,38383,38383,38380,38351,
+38215,38215,38170,38170,38240,38264,38311,38311,
+38421,38421,38392,38374,38308,38308,38312,38312,
+38383,38407,38454,38454,38476,38476,38424,38388,
+38264,38264,38174,38174,38143,38138,38140,38140,
+38178,38178,38157,38139,38072,38072,38041,38041,
+38052,38049,38027,38027,37948,37948,37884,37862,
+37812,37812,37791,37791,37804,37811,37829,37829,
+37848,37848,37817,37796,37717,37717,37705,37705,
+37764,37782,37807,37807,37800,37800,37765,37748,
+37697,37697,37717,37717,37790,37817,37881,37881,
+37959,37959,37984,37984,37957,37957,38004,38004,
+38116,38146,38185,38185,38146,38146,38162,38179,
+38248,38248,38305,38305,38324,38333,38362,38362,
+38421,38421,38424,38416,38372,38372,38334,38334,
+38318,38317,38331,38331,38373,38373,38394,38401,
+38417,38417,38462,38462,38516,38532,38551,38551,
+38535,38535,38526,38523,38517,38517,38472,38472,
+38402,38379,38331,38331,38294,38294,38261,38248,
+38213,38213,38150,38150,38081,38062,38040,38040,
+37985,37985,37963,37957,37953,37953,37956,37956,
+37953,37951,37943,37943,37932,37932,37910,37898,
+37859,37859,37811,37811,37768,37752,37712,37712,
+37674,37674,37604,37574,37496,37496,37471,37471,
+37515,37521,37508,37508,37424,37424,37348,37317,
+37233,37233,37127,37127,37040,37012,36966,36966,
+36966,36966,36959,36953,36930,36930,36910,36910,
+36883,36855,36736,36736,36507,36507,36367,36322,
+36239,36239,36137,36137,36025,35979,35867,35867,
+35807,35807,33466,34738,31058,28855,25874,27571,
+30335,32257,31461,31835,35685,38093,38965,38803,
+39160,39233,38984,38884,38842,38827,38773,38646,
+38550,38476,38466,38372,38309,38212,37673,37765,
+37774,37235,37211,37243,37679,37875,37793,37514,
+37236,36843,35988,35969,36546,36811,37084,38738,
+38807,38807,38887,38908,38932,38932,38924,38924,
+38908,38902,38887,38887,38873,38873,38814,38783,
+38683,38683,38625,38625,38625,38622,38603,38603,
+38548,38548,38486,38460,38389,38389,38310,38310,
+38251,38231,38190,38190,38168,38168,38181,38191,
+38229,38229,38279,38279,38316,38330,38361,38361,
+38395,38395,38384,38373,38323,38323,38305,38305,
+38324,38331,38348,38348,38357,38357,38317,38295,
+38223,38223,38193,38193,38202,38195,38150,38150,
+38037,38037,37996,37990,37999,37999,37973,37973,
+37927,37907,37851,37851,37759,37759,37648,37601,
+37475,37475,37408,37408,37417,37416,37398,37398,
+37339,37339,37296,37280,37246,37246,37225,37225,
+37223,37215,37174,37174,37081,37081,37030,37016,
+36996,36996,36964,36964,36927,36919,36908,36908,
+36837,36837,36691,36644,36555,36555,39151,44355,
+43281,39011,42767,44051,40496,38263,38722,42620,
+42086,41650,40301,41504,41834,39292,39103,39017,
+38648,38847,39062,39368,39416,39372,38818,37819,
+37264,35879,34981,33364,32704,32830,34114,37354,
+37668,37904,39908,39908,40028,40054,40066,40066,
+39978,39978,39924,39907,39879,39879,39834,39834,
+39778,39763,39746,39746,39763,39763,39757,39749,
+39721,39721,39660,39660,39589,39562,39505,39505,
+39455,39455,39402,39378,39310,39310,39230,39230,
+39168,39153,39146,39146,39201,39201,39192,39175,
+39106,39106,39041,39041,39008,38991,38934,38934,
+38848,38848,38787,38762,38702,38702,38636,38636,
+38586,38564,38506,38506,38431,38431,38426,38437,
+38495,38495,38505,38505,38461,38455,38469,38469,
+38548,38548,38520,38490,38368,38368,38291,38291,
+38291,38291,38289,38289,38284,38284,38229,38196,
+38086,38086,38049,38049,38109,38124,38139,38139,
+38105,38105,38156,38189,38302,38302,38335,38335,
+38290,38266,38200,38200,38083,38083,38032,38023,
+38032,38032,38025,38025,37994,37979,37941,37941,
+37884,37884,37827,37802,37737,37737,37682,37682,
+37664,37657,37641,37641,37626,37626,37598,37584,
+37539,37539,37505,37505,37502,37510,37557,37557,
+37673,37673,37781,37825,37942,37942,38032,38032,
+38039,38040,38036,38036,41470,43113,43273,44511,
+44819,45393,44176,45374,45625,45752,45988,46340,
+46714,46282,46597,46495,46479,45846,45691,45577,
+45599,45961,45503,44941,46340,47078,48472,48002,
+47527,47504,45740,45914,46472,46253,46477,46320,
+44328,43570,43674,44496,45056,44934,45174,44982,
+44795,44722,44693,44553,43886,43662,43757,42697,
+42635,42621,43470,43429,43310,42748,42511,42276,
+41842,41975,42119,41418,40989,40738,40402,40426,
+40239,40745,40855,40402,40036,39536,39058,37456,
+37410,37732,39501,39501,39492,39466,39347,39347,
+39084,39084,38940,38901,38849,38849,38821,38821,
+38810,38796,38727,38727,38577,38577,38500,38479,
+38453,38453,38480,38480,38550,38564,38561,38561,
+38473,38473,38436,38428,38427,38427,38395,38395,
+38344,38339,38362,38362,38479,38479,38477,38454,
+38339,38339,38298,38298,38354,38372,38404,38404,
+38615,38615,38564,38548,38514,38514,38519,38519,
+38561,38570,38571,38571,38521,38521,38510,38512,
+38533,38533,38534,38534,38517,38506,38466,38466,
+38390,38390,38374,38378,38416,38416,38398,38398,
+38329,38303,38247,38247,38185,38185,38131,38111,
+38066,38066,38034,38034,38023,38021,38018,38018,
+38022,38022,38011,38006,37982,37982,38005,38005,
+38064,38080,38095,38095,38060,38060,38041,38039,
+38045,38045,38063,38063,38077,38083,38101,38101,
+38139,38139,38178,38193,38227,38227,38253,38253,
+38265,38269,38280,38280,38289,38289,38349,38383,
+38499,38499,38571,38571,38569,38576,38614,38614,
+38717,38717,38759,38767,38761,38761,38722,38722,
+38666,38647,38614,38614,38606,38606,38612,38617,
+38637,38637,38664,38664,38677,38681,38685,38685,
+38681,38681,38669,38663,38643,38643,38597,38597,
+38543,38522,38476,38476,38423,38423,38421,38428,
+38471,38471,38438,38438,38341,38303,38214,38214,
+38133,38133,38091,38079,38055,38055,38032,38032,
+38016,38014,38018,38018,38047,38047,38045,38035,
+37987,37987,37928,37928,37870,37846,37785,37785,
+37712,37712,37661,37648,37639,37639,37620,37620,
+37601,37591,37556,37556,37491,37491,37428,37401,
+37325,37325,37236,37236,37168,37143,37090,37090,
+37051,37051,37031,37023,37006,37006,36969,36969,
+36912,36875,36743,36743,36520,36520,36391,36353,
+36292,36292,36224,36224,36150,36122,36056,36056,
+36019,36019,36100,34772,31056,28998,27496,26901,
+29458,30663,30091,30927,33706,36735,38290,38821,
+39040,38982,38850,38906,38894,38924,38721,38799,
+38526,38395,38335,38355,38341,38132,37917,37960,
+37787,37539,37365,37266,37324,37536,37565,37067,
+36435,35939,35418,35719,36273,36552,37136,38916,
+38972,38972,39028,39039,39041,39041,39020,39020,
+38998,38990,38975,38975,38966,38966,38917,38890,
+38809,38809,38763,38763,38768,38766,38750,38750,
+38700,38700,38644,38621,38557,38557,38471,38471,
+38392,38370,38335,38335,38346,38346,38374,38386,
+38423,38423,38474,38474,38521,38538,38570,38570,
+38594,38594,38580,38567,38516,38516,38483,38483,
+38478,38479,38494,38494,38524,38524,38481,38455,
+38362,38362,38334,38334,38362,38355,38292,38292,
+38124,38124,38064,38055,38071,38071,38042,38042,
+37981,37957,37895,37895,37809,37809,37703,37657,
+37532,37532,37503,37503,37574,37587,37580,37580,
+37470,37470,37400,37377,37327,37327,37278,37278,
+37246,37229,37179,37179,37106,37106,37053,37034,
+36987,36987,36954,36954,36934,36928,36921,36921,
+36821,36821,36544,36449,36257,36257,39286,39963,
+42921,41629,42365,43577,44010,43413,42325,42192,
+41566,40507,42182,42177,42192,40419,40206,39281,
+39021,39153,39170,39044,38924,39009,38562,37767,
+36811,35518,34843,33901,32482,32586,34230,37311,
+37670,37697,40074,40074,40136,40154,40178,40178,
+40164,40164,40154,40154,40168,40168,40119,40119,
+40019,39989,39936,39936,39916,39916,39892,39881,
+39849,39849,39789,39789,39730,39714,39690,39690,
+39689,39689,39658,39639,39576,39576,39509,39509,
+39466,39456,39449,39449,39487,39487,39466,39444,
+39360,39360,39221,39221,39081,39046,39007,39007,
+39096,39096,39089,39067,38966,38966,38878,38878,
+38830,38810,38761,38761,38705,38705,38687,38688,
+38709,38709,38693,38693,38645,38639,38656,38656,
+38739,38739,38700,38664,38520,38520,38444,38444,
+38467,38468,38451,38451,38379,38379,38350,38344,
+38341,38341,38314,38314,38280,38267,38242,38242,
+38221,38221,38257,38278,38347,38347,38341,38341,
+38273,38252,38210,38210,38179,38179,38169,38169,
+38182,38182,38169,38169,38123,38110,38088,38088,
+38089,38089,38065,38049,37997,37997,37955,37955,
+37942,37932,37892,37892,37814,37814,37781,37773,
+37768,37768,37760,37760,37757,37765,37815,37815,
+37936,37936,38031,38067,38149,38149,38176,38176,
+38112,38091,38047,38047,42525,44447,44769,44395,
+44280,45081,44761,45591,45478,45658,46031,46373,
+45765,46257,47177,47506,47092,46249,45786,45990,
+45907,46033,45728,44480,46604,47205,48482,48013,
+47876,47583,45887,45978,46201,45602,46681,46823,
+44616,44420,43814,43216,45107,44934,45006,44496,
+44400,43950,43820,43911,43463,43395,43507,43494,
+43415,43292,43293,43397,43358,42900,42659,42431,
+41810,41665,42218,41774,41435,40869,40214,40189,
+40237,40171,40040,39965,39590,39547,39031,37332,
+37267,37651,39615,39615,39618,39596,39489,39489,
+39222,39222,39075,39036,38986,38986,38967,38967,
+38970,38963,38921,38921,38816,38816,38773,38766,
+38771,38771,38830,38830,38921,38929,38884,38884,
+38682,38682,38610,38600,38622,38622,38642,38642,
+38655,38658,38659,38659,38642,38642,38667,38681,
+38733,38733,38755,38755,38752,38743,38702,38702,
+38615,38615,38564,38548,38514,38514,38519,38519,
+38561,38570,38571,38571,38521,38521,38510,38512,
+38533,38533,38534,38534,38517,38506,38466,38466,
+38390,38390,38374,38378,38416,38416,38398,38398,
+38329,38303,38247,38247,38185,38185,38131,38111,
+38066,38066,38034,38034,38023,38021,38018,38018,
+38022,38022,38011,38006,37982,37982,38005,38005,
+38064,38080,38095,38095,38060,38060,38041,38039,
+38045,38045,38063,38063,38077,38083,38101,38101,
+38139,38139,38178,38193,38227,38227,38253,38253,
+38265,38269,38280,38280,38289,38289,38349,38383,
+38499,38499,38571,38571,38569,38576,38614,38614,
+38717,38717,38759,38767,38761,38761,38722,38722,
+38666,38647,38614,38614,38606,38606,38612,38617,
+38637,38637,38664,38664,38677,38681,38685,38685,
+38681,38681,38669,38663,38643,38643,38597,38597,
+38543,38522,38476,38476,38423,38423,38421,38428,
+38471,38471,38438,38438,38341,38303,38214,38214,
+38133,38133,38091,38079,38055,38055,38032,38032,
+38016,38014,38018,38018,38047,38047,38045,38035,
+37987,37987,37928,37928,37870,37846,37785,37785,
+37712,37712,37661,37648,37639,37639,37620,37620,
+37601,37591,37556,37556,37491,37491,37428,37401,
+37325,37325,37236,37236,37168,37143,37090,37090,
+37051,37051,37031,37023,37006,37006,36969,36969,
+36912,36875,36743,36743,36520,36520,36391,36353,
+36292,36292,36224,36224,36150,36122,36056,36056,
+36019,36019,36100,35124,32187,29610,26830,27610,
+29922,29153,30181,30714,33416,35810,37698,38831,
+38940,38991,38796,38918,38981,38764,38702,38724,
+38549,38476,38401,38416,38488,38369,38117,38028,
+37735,37646,37632,37452,37084,37101,37077,36799,
+35957,35549,35740,35880,35841,36229,37041,38916,
+38972,38972,39028,39039,39041,39041,39020,39020,
+38998,38990,38975,38975,38966,38966,38917,38890,
+38809,38809,38763,38763,38768,38766,38750,38750,
+38700,38700,38644,38621,38557,38557,38471,38471,
+38392,38370,38335,38335,38346,38346,38374,38386,
+38423,38423,38474,38474,38521,38538,38570,38570,
+38594,38594,38580,38567,38516,38516,38483,38483,
+38478,38479,38494,38494,38524,38524,38481,38455,
+38362,38362,38334,38334,38362,38355,38292,38292,
+38124,38124,38064,38055,38071,38071,38042,38042,
+37981,37957,37895,37895,37809,37809,37703,37657,
+37532,37532,37503,37503,37574,37587,37580,37580,
+37470,37470,37400,37377,37327,37327,37278,37278,
+37246,37229,37179,37179,37106,37106,37053,37034,
+36987,36987,36954,36954,36934,36928,36921,36921,
+36821,36821,36544,36449,36257,36257,39203,37966,
+42867,41696,42212,43315,41524,43637,42781,40478,
+40549,41305,41694,41994,42848,40955,41727,39889,
+39338,39369,39479,38867,38824,38879,38287,37721,
+36868,35666,35503,34817,32834,32663,34003,36919,
+37503,37668,40074,40074,40136,40154,40178,40178,
+40164,40164,40154,40154,40168,40168,40119,40119,
+40019,39989,39936,39936,39916,39916,39892,39881,
+39849,39849,39789,39789,39730,39714,39690,39690,
+39689,39689,39658,39639,39576,39576,39509,39509,
+39466,39456,39449,39449,39487,39487,39466,39444,
+39360,39360,39221,39221,39081,39046,39007,39007,
+39096,39096,39089,39067,38966,38966,38878,38878,
+38830,38810,38761,38761,38705,38705,38687,38688,
+38709,38709,38693,38693,38645,38639,38656,38656,
+38739,38739,38700,38664,38520,38520,38444,38444,
+38467,38468,38451,38451,38379,38379,38350,38344,
+38341,38341,38314,38314,38280,38267,38242,38242,
+38221,38221,38257,38278,38347,38347,38341,38341,
+38273,38252,38210,38210,38179,38179,38169,38169,
+38182,38182,38169,38169,38123,38110,38088,38088,
+38089,38089,38065,38049,37997,37997,37955,37955,
+37942,37932,37892,37892,37814,37814,37781,37773,
+37768,37768,37760,37760,37757,37765,37815,37815,
+37936,37936,38031,38067,38149,38149,38176,38176,
+38112,38091,38047,38047,44154,44773,45033,43939,
+44329,45724,45578,44978,45836,46268,46343,45901,
+45618,46585,47388,47587,47235,46318,46128,46564,
+46704,47168,45733,44108,47789,47080,47148,46735,
+46789,46507,45266,45368,45857,46639,44820,43944,
+43654,44017,42874,44497,44481,43980,44574,44347,
+44072,43836,43735,43608,43198,43230,43394,43528,
+43423,43268,43413,43239,43260,42805,42609,42274,
+41500,41788,41979,41970,41702,40949,39876,39783,
+39740,39682,39902,39877,39272,39186,38895,37601,
+37503,37819,39615,39615,39618,39596,39489,39489,
+39222,39222,39075,39036,38986,38986,38967,38967,
+38970,38963,38921,38921,38816,38816,38773,38766,
+38771,38771,38830,38830,38921,38929,38884,38884,
+38682,38682,38610,38600,38622,38622,38642,38642,
+38655,38658,38659,38659,38642,38642,38667,38681,
+38733,38733,38755,38755,38752,38743,38702,38702,
+38854,38854,38784,38766,38744,38744,38732,38732,
+38740,38739,38728,38728,38693,38693,38705,38717,
+38766,38766,38803,38803,38815,38808,38760,38760,
+38632,38632,38596,38597,38638,38638,38633,38633,
+38577,38555,38508,38508,38460,38460,38419,38404,
+38372,38372,38342,38342,38319,38309,38280,38280,
+38234,38234,38221,38222,38237,38237,38282,38282,
+38339,38352,38368,38368,38337,38337,38329,38333,
+38356,38356,38392,38392,38417,38424,38436,38436,
+38438,38438,38457,38466,38491,38491,38499,38499,
+38489,38488,38493,38493,38519,38519,38590,38628,
+38750,38750,38823,38823,38815,38820,38847,38847,
+38933,38933,38977,38988,38997,38997,38971,38971,
+38921,38902,38858,38858,38820,38820,38823,38831,
+38869,38869,38905,38905,38920,38920,38910,38910,
+38871,38871,38839,38826,38798,38798,38746,38746,
+38693,38673,38620,38620,38552,38552,38547,38555,
+38604,38604,38582,38582,38497,38461,38361,38361,
+38232,38232,38175,38160,38143,38143,38119,38119,
+38102,38101,38109,38109,38150,38150,38148,38139,
+38096,38096,38028,38028,37956,37924,37840,37840,
+37730,37730,37689,37690,37734,37734,37739,37739,
+37708,37692,37647,37647,37573,37573,37509,37483,
+37411,37411,37331,37331,37275,37251,37184,37184,
+37097,37097,37049,37033,37004,37004,36947,36947,
+36866,36824,36694,36694,36503,36503,36397,36369,
+36336,36336,36311,36311,36279,36271,36260,36260,
+36271,36271,36272,35272,31562,30353,28603,28336,
+27889,28992,29245,30421,34411,35034,36351,38366,
+38041,38171,38680,38580,38772,38807,38726,38652,
+38585,38545,38639,38850,38715,38551,38289,38226,
+38085,37966,38007,37960,37869,37650,37505,37342,
+36709,36104,36067,35835,35591,35667,36299,39002,
+39031,39031,39063,39068,39059,39059,39041,39041,
+39025,39019,39005,39005,38995,38995,38981,38973,
+38952,38952,38937,38937,38936,38931,38904,38904,
+38842,38842,38795,38776,38731,38731,38661,38661,
+38590,38569,38539,38539,38551,38551,38581,38593,
+38631,38631,38677,38677,38719,38735,38769,38769,
+38805,38805,38797,38786,38741,38741,38692,38692,
+38657,38649,38646,38646,38669,38669,38622,38593,
+38499,38499,38445,38445,38437,38419,38335,38335,
+38154,38154,38083,38069,38072,38072,38043,38043,
+37994,37973,37920,37920,37835,37835,37745,37708,
+37612,37612,37592,37592,37653,37664,37657,37657,
+37564,37564,37487,37456,37380,37380,37298,37298,
+37238,37216,37167,37167,37123,37123,37078,37056,
+36995,36995,36958,36958,36939,36924,36870,36870,
+36658,36658,36278,36153,35912,35912,44693,43706,
+42021,40018,39185,43234,42660,42130,41387,40116,
+40138,41242,42184,41753,40885,40405,39632,39601,
+39754,39898,39919,39402,39237,39091,39230,39237,
+38924,38354,38027,36927,32978,33165,35167,36850,
+36784,37106,40146,40146,40229,40257,40315,40315,
+40386,40386,40420,40432,40464,40464,40398,40398,
+40264,40226,40170,40170,40174,40174,40157,40111,
+39900,39900,39832,39832,39783,39791,39876,39876,
+39922,39922,39913,39897,39829,39829,39785,39785,
+39786,39784,39777,39777,39760,39760,39715,39688,
+39601,39601,39444,39444,39273,39230,39186,39186,
+39297,39297,39302,39284,39190,39190,39112,39112,
+39076,39063,39031,39031,38999,38999,38971,38962,
+38942,38942,38891,38891,38827,38814,38815,38815,
+38882,38882,38847,38816,38693,38693,38631,38631,
+38655,38655,38629,38629,38531,38531,38513,38517,
+38555,38555,38525,38525,38448,38424,38376,38376,
+38356,38356,38374,38383,38417,38417,38396,38396,
+38339,38324,38310,38310,38340,38340,38359,38366,
+38386,38386,38371,38371,38315,38299,38274,38274,
+38283,38283,38273,38263,38228,38228,38193,38193,
+38179,38168,38123,38123,38037,38037,38007,38003,
+38007,38007,37999,37999,37985,37994,38048,38048,
+38198,38198,38288,38314,38359,38359,38359,38359,
+38290,38265,38218,38218,43282,44229,45311,43625,
+43733,44531,45237,45473,45933,46701,46638,46877,
+47029,46627,46666,47043,46698,45992,45735,45613,
+45949,47127,47424,46627,48040,48468,48315,47539,
+46618,46005,44221,44720,44618,43728,43267,42839,
+44208,43493,43382,42978,43801,43874,43937,43427,
+43170,43646,43626,43609,43826,43404,43050,43651,
+43587,43296,42761,42640,42562,42447,42305,42030,
+42030,42031,41868,41745,41470,40956,39799,39298,
+38823,39097,39490,39618,39370,39287,39284,38623,
+38375,38590,39739,39739,39743,39723,39621,39621,
+39362,39362,39227,39194,39162,39162,39144,39144,
+39130,39120,39084,39084,39016,39016,39010,39017,
+39057,39057,39128,39128,39204,39207,39144,39144,
+38922,38922,38841,38829,38849,38849,38886,38886,
+38930,38938,38934,38934,38863,38863,38897,38927,
+39046,39046,39102,39102,39091,39074,39002,39002,
+38854,38854,38784,38766,38744,38744,38732,38732,
+38740,38739,38728,38728,38693,38693,38705,38717,
+38766,38766,38803,38803,38815,38808,38760,38760,
+38632,38632,38596,38597,38638,38638,38633,38633,
+38577,38555,38508,38508,38460,38460,38419,38404,
+38372,38372,38342,38342,38319,38309,38280,38280,
+38234,38234,38221,38222,38237,38237,38282,38282,
+38339,38352,38368,38368,38337,38337,38329,38333,
+38356,38356,38392,38392,38417,38424,38436,38436,
+38438,38438,38457,38466,38491,38491,38499,38499,
+38489,38488,38493,38493,38519,38519,38590,38628,
+38750,38750,38823,38823,38815,38820,38847,38847,
+38933,38933,38977,38988,38997,38997,38971,38971,
+38921,38902,38858,38858,38820,38820,38823,38831,
+38869,38869,38905,38905,38920,38920,38910,38910,
+38871,38871,38839,38826,38798,38798,38746,38746,
+38693,38673,38620,38620,38552,38552,38547,38555,
+38604,38604,38582,38582,38497,38461,38361,38361,
+38232,38232,38175,38160,38143,38143,38119,38119,
+38102,38101,38109,38109,38150,38150,38148,38139,
+38096,38096,38028,38028,37956,37924,37840,37840,
+37730,37730,37689,37690,37734,37734,37739,37739,
+37708,37692,37647,37647,37573,37573,37509,37483,
+37411,37411,37331,37331,37275,37251,37184,37184,
+37097,37097,37049,37033,37004,37004,36947,36947,
+36866,36824,36694,36694,36503,36503,36397,36369,
+36336,36336,36311,36311,36279,36271,36260,36260,
+36271,36271,36272,34423,31698,31408,27810,27050,
+28661,29733,29616,30693,33541,34809,36299,38386,
+38274,38087,38740,38756,38632,38623,38667,38664,
+38702,38744,38841,38893,38872,38692,38396,38270,
+38220,38045,38176,38238,37844,37735,37678,37204,
+36632,36162,35874,35594,35497,35724,36052,36520,
+39031,39031,39063,39068,39059,39059,39041,39041,
+39025,39019,39005,39005,38995,38995,38981,38973,
+38952,38952,38937,38937,38936,38931,38904,38904,
+38842,38842,38795,38776,38731,38731,38661,38661,
+38590,38569,38539,38539,38551,38551,38581,38593,
+38631,38631,38677,38677,38719,38735,38769,38769,
+38805,38805,38797,38786,38741,38741,38692,38692,
+38657,38649,38646,38646,38669,38669,38622,38593,
+38499,38499,38445,38445,38437,38419,38335,38335,
+38154,38154,38083,38069,38072,38072,38043,38043,
+37994,37973,37920,37920,37835,37835,37745,37708,
+37612,37612,37592,37592,37653,37664,37657,37657,
+37564,37564,37487,37456,37380,37380,37298,37298,
+37238,37216,37167,37167,37123,37123,37078,37056,
+36995,36995,36958,36958,36939,36924,36870,36870,
+36658,36658,36278,36153,35912,35912,44673,42091,
+41465,39583,38705,43080,42641,42225,40124,40146,
+40186,41677,41982,40368,40419,41865,39944,39709,
+39637,39749,39771,39746,39859,39924,40010,40214,
+40021,39756,39409,37932,33256,33070,35282,36755,
+36606,36900,40146,40146,40229,40257,40315,40315,
+40386,40386,40420,40432,40464,40464,40398,40398,
+40264,40226,40170,40170,40174,40174,40157,40111,
+39900,43010,42888,43733,39783,39791,39876,39876,
+39922,39922,39913,39897,39829,39829,39785,39785,
+39786,39784,39777,39777,39760,39760,39715,39688,
+39601,39601,39444,39444,39273,39230,39186,39186,
+39297,39297,39302,39284,39190,39190,39112,39112,
+39076,39063,39031,39031,38999,38999,38971,38962,
+38942,38942,38891,38891,38827,38814,38815,38815,
+38882,38882,38847,38816,38693,38693,38631,38631,
+38655,38655,38629,38629,38531,38531,38513,38517,
+38555,38555,38525,38525,38448,38424,38376,38376,
+38356,38356,38374,38383,38417,38417,38396,38396,
+38339,38324,38310,38310,38340,38340,38359,38366,
+38386,38386,38371,38371,38315,38299,38274,38274,
+38283,38283,38273,38263,38228,38228,38193,38193,
+38179,38168,38123,38123,38037,38037,38007,38003,
+38007,38007,37999,37999,37985,37994,38048,38048,
+38198,38198,38288,38314,38359,38359,38359,38359,
+38290,38265,38218,38218,44485,45361,44607,43849,
+44373,44902,45902,46740,46279,46410,46545,46895,
+46404,45987,47280,47503,47396,46381,46084,46000,
+45692,46929,47396,47431,47069,48612,48648,47989,
+47577,46298,44905,45123,44769,43111,43041,42988,
+43195,42762,43197,43649,44090,43983,43610,43501,
+43124,43671,43911,45489,43815,43422,43098,43664,
+43444,43104,42551,42492,42473,42434,42334,42264,
+41863,41632,41979,42160,41230,40736,39647,38938,
+38389,39088,39390,39637,39374,39268,39174,38769,
+38626,38983,39739,39739,39743,39723,39621,39621,
+39362,39362,39227,39194,39162,39162,39144,39144,
+39130,39120,39084,39084,39016,39016,39010,39017,
+39057,39057,39128,39128,39204,39207,39144,39144,
+38922,38922,38841,38829,38849,38849,38886,38886,
+38930,38938,38934,38934,38863,38863,38897,38927,
+39046,39046,39102,39102,39091,39074,39002,39002,
+39045,39045,38967,38946,38913,38913,38880,38880,
+38861,38859,38866,38866,38911,38911,38922,38920,
+38898,38898,38913,38913,38959,38963,38938,38938,
+38826,38826,38757,38735,38696,38696,38695,38695,
+38720,38724,38717,38717,38673,38673,38641,38632,
+38618,38618,38599,38599,38579,38564,38512,38512,
+38412,38412,38382,38382,38412,38412,38461,38461,
+38507,38519,38540,38540,38531,38531,38522,38521,
+38523,38523,38583,38583,38672,38698,38738,38738,
+38724,38724,38707,38698,38668,38668,38669,38669,
+38708,38719,38743,38743,38755,38755,38807,38838,
+38936,38936,39000,39000,39001,39002,39005,39005,
+39024,39024,39037,39039,39037,39037,39031,39031,
+39024,39018,38993,38993,38949,38949,38962,38975,
+39035,39035,39103,39103,39152,39158,39140,39140,
+39040,39040,38982,38965,38935,38935,38878,38878,
+38816,38792,38730,38730,38653,38653,38620,38612,
+38610,38610,38579,38579,38535,38512,38444,38444,
+38340,38340,38301,38293,38291,38291,38274,38274,
+38256,38251,38249,38249,38266,38266,38241,38224,
+38169,38169,38089,38089,38007,37971,37874,37874,
+37726,37726,37686,37692,37762,37762,37802,37802,
+37801,37793,37750,37750,37651,37651,37578,37549,
+37476,37476,37398,37398,37345,37318,37233,37233,
+37099,37099,37018,36992,36941,36941,36865,36865,
+36769,36727,36610,36610,36459,36459,36381,36363,
+36354,36354,36369,36369,36373,36381,36419,36419,
+36487,36487,36507,33458,33170,32768,28341,27357,
+28790,30488,29960,30030,33472,34986,36131,37751,
+38438,38580,38620,38867,38734,38621,38671,38720,
+38865,39044,39117,39091,38974,38894,38516,38336,
+38146,38108,38252,38320,37936,37873,37877,37157,
+36641,36349,35877,35396,35291,35713,35787,36177,
+39016,39016,39042,39040,39004,39004,38995,38995,
+38993,38989,38971,38971,38945,38945,38977,38998,
+39065,39065,39099,39099,39090,39079,39037,39037,
+38953,38953,38902,38886,38859,38859,38811,38811,
+38763,38749,38719,38719,38705,38705,38725,38738,
+38779,38779,38818,38818,38846,38859,38893,38893,
+38950,38950,38955,38948,38909,38909,38851,38851,
+38793,38775,38747,38747,38741,38741,38691,38665,
+38583,38583,38494,38494,38422,38387,38285,38285,
+38135,38135,38060,38041,38016,38016,37987,37987,
+37966,37953,37913,37913,37827,37827,37758,37734,
+37680,37680,37645,37645,37636,37632,37621,37621,
+37596,37596,37535,37504,37405,37405,37299,37299,
+37223,37199,37150,37150,37130,37130,37093,37073,
+37009,37009,36970,36970,36946,36919,36801,36801,
+36464,36464,36051,35924,35701,35701,44695,44522,
+43432,41197,41548,43095,42058,42144,41133,40738,
+42243,42208,42419,40497,41396,42581,40580,40040,
+39382,39532,39537,40065,40336,40406,39953,40063,
+39243,39939,39751,38252,35540,34094,35217,36490,
+36575,36789,37445,37656,38248,40316,40454,40454,
+40559,40559,40609,40625,40653,40653,40578,40578,
+40430,40395,40362,40362,40442,40442,40462,40417,
+44607,43257,43016,43996,45100,42664,40021,40021,
+40082,40082,40083,40066,39979,39979,39958,39958,
+40011,40021,40013,40013,39936,39936,39869,39840,
+39760,39760,39632,39632,39501,39462,39394,39394,
+39398,39398,39382,39370,39321,39321,39276,39276,
+39254,39246,39228,39228,39214,39214,39179,39164,
+39115,39115,39035,39035,38950,38928,38909,38909,
+38953,38953,38931,38913,38837,38837,38792,38792,
+38798,38794,38765,38765,38683,38683,38658,38655,
+38668,38668,38632,38632,38569,38548,38504,38504,
+38476,38476,38479,38482,38496,38496,38481,38481,
+38453,38449,38456,38456,38500,38500,38528,38539,
+38562,38562,38548,38548,38493,38474,38433,38433,
+38407,38407,38390,38383,38363,38363,38333,38333,
+38311,38300,38268,38268,38220,38220,38196,38188,
+38174,38174,38146,38146,38120,38128,38191,38191,
+38380,38380,38470,38492,38507,38507,38517,38517,
+38495,38486,38464,38464,44449,45471,44817,45277,
+45207,44603,46778,45481,47143,46631,47136,47369,
+46400,45999,47368,47073,45739,46127,46114,45927,
+45755,47007,47386,47081,46601,47820,46939,47553,
+47094,46307,45544,45439,44196,43060,42987,43640,
+42287,42197,42539,43677,43432,43662,43689,44708,
+43104,43663,45187,45595,43879,43357,42952,43713,
+43392,43228,42617,42415,42454,42424,42610,42406,
+42010,41624,42031,41807,41192,40461,39664,38812,
+38519,39292,39281,39494,39599,39098,38658,38757,
+38973,39910,39832,39832,39828,39805,39695,39695,
+39446,39446,39327,39301,39293,39293,39270,39270,
+39223,39205,39160,39160,39114,39114,39135,39153,
+39220,39220,39287,39287,39329,39327,39275,39275,
+39113,39113,39047,39034,39034,39034,39054,39054,
+39091,39098,39099,39099,39049,39049,39075,39096,
+39180,39180,39239,39239,39261,39255,39198,39198,
+39128,39128,39048,39025,38989,38989,38947,38947,
+38918,38914,38927,38927,39001,39001,39010,39003,
+38955,38955,38962,38962,39022,39031,39016,39016,
+38913,38913,38831,38800,38731,38731,38732,38732,
+38791,38803,38812,38812,38768,38768,38741,38734,
+38725,38725,38712,38712,38692,38676,38616,38616,
+38496,38496,38462,38462,38496,38496,38545,38545,
+38584,38596,38618,38618,38619,38619,38611,38608,
+38602,38602,38670,38670,38782,38815,38867,38867,
+38848,38848,38818,38801,38752,38752,38751,38751,
+38807,38825,38854,38854,38860,38860,38905,38931,
+39018,39018,39077,39077,39080,39080,39073,39073,
+39065,39065,39065,39064,39057,39057,39059,39059,
+39070,39069,39052,39052,39007,39007,39024,39041,
+39107,39107,39187,39187,39249,39257,39237,39237,
+39112,39112,39045,39025,38995,38995,38935,38935,
+38871,38844,38778,38778,38698,38698,38653,38639,
+38616,38616,38583,38583,38554,38537,38479,38479,
+38382,38382,38351,38346,38351,38351,38339,38339,
+38320,38315,38307,38307,38315,38315,38280,38261,
+38200,38200,38115,38115,38030,37992,37889,37889,
+37729,37729,37689,37697,37776,37776,37828,37828,
+37838,37831,37789,37789,37681,37681,37604,37574,
+37501,37501,37424,37424,37373,37343,37252,37252,
+37099,37099,37004,36973,36913,36913,36829,36829,
+36730,36688,36578,36578,36444,36444,36377,36364,
+36367,36367,36399,36399,36422,36437,36496,36496,
+36586,36586,36612,34868,34494,34141,30559,30778,
+29405,28738,29637,29188,31162,34761,36341,37983,
+38840,38823,38416,38556,38689,38764,38826,38684,
+38973,39180,39382,39337,39155,39055,38666,38495,
+38622,38553,38545,38664,38606,38434,38054,37558,
+37321,36698,35884,35528,35271,35224,35134,35474,
+35784,35801,36385,39026,38980,38980,38975,38975,
+38979,38976,38956,38956,38918,38918,38970,39003,
+39109,39109,39167,39167,39155,39143,39096,39096,
+39005,39005,38954,38939,38917,38917,38878,38878,
+38840,38827,38799,38799,38774,38774,38791,38802,
+38843,38843,38879,38879,38900,38911,38946,38946,
+39010,39010,39021,39015,38979,38979,38917,38917,
+38848,38827,38788,38788,38770,38770,38718,38692,
+38615,38615,38512,38512,38416,38375,38266,38266,
+38128,38128,38051,38029,37994,37994,37964,37964,
+37953,37944,37909,37909,37823,37823,37764,37746,
+37709,37709,37666,37666,37631,37620,37605,37605,
+37606,37606,37550,37519,37414,37414,37299,37299,
+37218,37192,37143,37143,37131,37131,37097,37079,
+37015,37015,36973,36973,36945,36911,36768,36768,
+36382,36382,35960,35833,35617,38809,44679,44416,
+40006,42135,42402,42686,42595,42261,41861,40533,
+40090,41275,42552,40412,41339,40478,40135,40324,
+39838,39679,39942,40092,40438,40459,41056,40091,
+39846,39585,38622,36998,36729,36834,36700,36527,
+36718,36966,38011,38633,39121,39571,39465,40516,
+40632,40632,40688,40706,40733,40733,40655,40655,
+40506,40471,40448,40448,40554,40554,40590,44056,
+44110,43972,43548,43224,43198,41954,41525,40079,
+40146,40146,40151,40132,40040,40040,40028,40028,
+40103,40117,40109,40109,40007,40007,39932,39903,
+39829,39829,39713,39713,39598,39560,39483,39483,
+39445,39445,39420,39409,39380,39380,39349,39349,
+39332,39326,39313,39313,39304,39304,39268,39249,
+39190,39190,39099,39099,39007,38983,38955,38955,
+38989,38989,38973,38960,38903,38903,38864,38864,
+38860,38854,38824,38824,38750,38750,38722,38717,
+38721,38721,38683,38683,38626,38606,38563,38563,
+38533,38533,38529,38530,38535,38535,38523,38523,
+38507,38507,38521,38521,38571,38571,38603,38615,
+38639,38639,38625,38625,38569,38549,38503,38503,
+38463,38463,38443,38436,38422,38422,38393,38393,
+38369,38359,38331,38331,38299,38299,38278,38269,
+38247,38247,38214,38214,38182,38190,38257,38257,
+38458,38458,38549,38567,38573,38573,38589,38589,
+38588,38585,38574,42630,45293,45212,45329,45288,
+45219,46566,46224,46031,48099,47958,47147,46814,
+47221,47468,48064,45674,45757,44828,45484,45424,
+45048,45004,44501,44987,46918,45608,45785,44716,
+44135,43574,43075,42913,43165,42733,42064,41924,
+43637,43296,42882,42633,43688,44047,44136,43901,
+43578,43645,44061,45193,44796,43049,42743,43485,
+43472,43347,42718,42268,42031,42180,42219,42002,
+42050,41797,41966,41550,40779,40317,40317,40445,
+40510,39882,39549,39652,39297,38668,38508,39999,
+39954,39954,39876,39876,39869,39844,39730,39730,
+39485,39485,39372,39348,39348,39348,39322,39322,
+39260,39239,39190,39190,39160,39160,39193,39215,
+39293,39293,39357,39357,39386,39382,39336,39336,
+39199,39199,39136,39123,39115,39115,39129,39129,
+39162,39170,39173,39173,39130,39130,39150,39168,
+39238,39238,39298,39298,39336,39333,39283,39283,
+39333,39333,39255,39231,39198,39198,39145,39145,
+39098,39090,39094,39094,39171,39171,39173,39160,
+39091,39091,39102,39102,39190,39211,39224,39224,
+39155,39155,39072,39035,38935,38935,38947,38947,
+39049,39074,39096,39096,39046,39046,39018,39010,
+39002,39002,38993,38993,38974,38960,38902,38902,
+38789,38789,38757,38757,38797,38797,38825,38825,
+38828,38832,38847,38847,38878,38878,38878,38875,
+38857,38857,38924,38924,39055,39094,39157,39157,
+39138,39138,39106,39089,39037,39037,39044,39044,
+39109,39129,39160,39160,39163,39163,39188,39201,
+39244,39244,39271,39271,39270,39264,39237,39237,
+39187,39187,39166,39158,39144,39144,39157,39157,
+39196,39205,39211,39211,39181,39181,39205,39223,
+39290,39290,39374,39374,39443,39452,39425,39425,
+39278,39278,39198,39174,39134,39134,39072,39072,
+39013,38986,38912,38912,38811,38811,38750,38728,
+38680,38680,38642,38642,38632,38618,38561,38561,
+38444,38444,38422,38424,38460,38460,38469,38469,
+38458,38452,38435,38435,38414,38414,38366,38342,
+38275,38275,38178,38178,38085,38045,37941,37941,
+37784,37784,37746,37752,37819,37819,37867,37867,
+37876,37868,37823,37823,37713,37713,37632,37599,
+37520,37520,37445,37445,37400,37370,37266,37266,
+37080,37080,36955,36912,36825,36825,36736,36736,
+36657,36625,36544,36544,36452,36452,36414,36413,
+36441,36441,36539,36539,36632,36672,36776,36776,
+36883,36883,36912,35075,34616,33936,32545,32283,
+30924,28716,30143,30341,30113,32795,35536,38389,
+39091,39026,38541,38436,38600,38442,38639,38731,
+39039,39157,39260,39292,39174,39134,38781,38673,
+38800,39007,38976,38944,38666,38466,38140,37854,
+37545,36855,36107,36017,35871,35690,35355,35157,
+35075,34969,35178,36632,38934,38934,38934,38934,
+38943,38939,38912,38912,38781,38781,38891,38956,
+39170,39170,39303,39303,39310,39304,39267,39267,
+39184,39184,39133,39119,39096,39096,39061,39061,
+39029,39018,38994,38994,38970,38970,38977,38982,
+39003,39003,39014,39014,39014,39020,39049,39049,
+39128,39128,39148,39145,39112,39112,39038,39038,
+38944,38914,38850,38850,38805,38805,38746,38719,
+38647,38647,38528,38528,38407,38360,38249,38249,
+38125,38125,38042,38013,37955,37955,37918,37918,
+37919,37915,37892,37892,37822,37822,37782,37770,
+37756,37756,37698,37698,37621,37598,37565,37565,
+37575,37575,37528,37500,37403,37403,37296,37296,
+37213,37185,37134,37134,37117,37117,37086,37068,
+37013,37013,36958,36958,36894,36842,36646,36646,
+36202,36202,35804,35690,35514,39287,44049,43991,
+43631,41360,41676,41918,42670,42294,42221,41055,
+40818,41547,40640,39850,40504,40143,40019,40116,
+40340,40119,40157,40477,40655,40895,41325,40739,
+40386,40402,40335,36942,36400,37291,37192,36822,
+37110,37391,38516,39220,39461,39262,38741,40695,
+40780,40780,40845,40865,40900,40900,40841,40841,
+40722,40697,40688,40688,40798,40798,40841,43836,
+44286,44431,43487,43691,42990,41292,41467,40167,
+40247,40247,40249,40230,40137,40137,40147,40147,
+40256,40276,40270,40270,40135,40135,40059,40034,
+39986,39986,39903,39903,39819,39784,39692,39692,
+39582,39582,39545,39539,39546,39546,39545,39545,
+39537,39533,39518,39518,39494,39494,39455,39436,
+39382,39382,39291,39291,39191,39164,39123,39123,
+39140,39140,39137,39132,39111,39111,39067,39067,
+39023,39007,38966,38966,38921,38921,38906,38904,
+38911,38911,38877,38877,38820,38799,38755,38755,
+38719,38719,38705,38700,38688,38688,38680,38680,
+38683,38688,38712,38712,38762,38762,38799,38811,
+38843,38843,38820,38820,38749,38723,38666,38666,
+38614,38614,38590,38583,38572,38572,38544,38544,
+38514,38505,38487,38487,38487,38487,38473,38465,
+38433,38433,38402,38402,38387,38397,38464,38464,
+38642,38642,38721,38738,38743,38743,38793,38793,
+38852,38869,38890,43462,45559,45741,46721,45578,
+45860,47687,48469,47924,46402,47810,46468,46314,
+46785,47624,46962,45311,45336,45757,46414,45341,
+45334,45205,45046,45478,45911,45537,45584,44499,
+44039,43781,42552,42519,43135,42715,41952,41766,
+42146,42170,42472,42562,43317,44040,45070,44452,
+43968,43925,44203,45262,44966,43293,43027,43239,
+43178,43065,42292,42246,42361,42584,42350,42191,
+41858,41900,41979,41196,40942,40577,40321,40771,
+40980,40370,39738,39628,39067,38814,39005,40124,
+40031,40031,40022,40022,40016,39989,39861,39861,
+39606,39606,39492,39469,39470,39470,39414,39414,
+39308,39280,39246,39246,39299,39299,39370,39400,
+39482,39482,39541,39541,39559,39556,39523,39523,
+39428,39428,39367,39347,39310,39310,39311,39311,
+39355,39365,39372,39372,39320,39320,39319,39327,
+39365,39365,39428,39428,39505,39514,39484,39484,
+39333,39333,39255,39231,39198,39198,39145,39145,
+39098,39090,39094,39094,39171,39171,39173,39160,
+39091,39091,39102,39102,39190,39211,39224,39224,
+39155,39155,39072,39035,38935,38935,38947,38947,
+39049,39074,39096,39096,39046,39046,39018,39010,
+39002,39002,38993,38993,38974,38960,38902,38902,
+38789,38789,38757,38757,38797,38797,38825,38825,
+38828,38832,38847,38847,38878,38878,38878,38875,
+38857,38857,38924,38924,39055,39094,39157,39157,
+39138,39138,39106,39089,39037,39037,39044,39044,
+39109,39129,39160,39160,39163,39163,39188,39201,
+39244,39244,39271,39271,39270,39264,39237,39237,
+39187,39187,39166,39158,39144,39144,39157,39157,
+39196,39205,39211,39211,39181,39181,39205,39223,
+39290,39290,39374,39374,39443,39452,39425,39425,
+39278,39278,39198,39174,39134,39134,39072,39072,
+39013,38986,38912,38912,38811,38811,38750,38728,
+38680,38680,38642,38642,38632,38618,38561,38561,
+38444,38444,38422,38424,38460,38460,38469,38469,
+38458,38452,38435,38435,38414,38414,38366,38342,
+38275,38275,38178,38178,38085,38045,37941,37941,
+37784,37784,37746,37752,37819,37819,37867,37867,
+37876,37868,37823,37823,37713,37713,37632,37599,
+37520,37520,37445,37445,37400,37370,37266,37266,
+37080,37080,36955,36912,36825,36825,36736,36736,
+36657,36625,36544,36544,36452,36452,36414,36413,
+36441,36441,36539,36539,36632,36672,36776,36776,
+36883,36883,36912,34912,34345,33553,32719,31575,
+31148,29250,29844,29957,29464,30539,34018,38425,
+38998,39014,38621,38536,38330,38242,38515,38696,
+38925,39214,39231,39223,39339,39341,38950,38776,
+38831,39232,39303,39206,38665,38490,38279,37989,
+37622,36938,36512,36297,36131,35864,35530,35462,
+35530,35248,35079,35674,36084,36489,38934,38934,
+38943,38939,38912,38912,38781,38781,38891,38956,
+39170,39170,39303,39303,39310,39304,39267,39267,
+39184,39184,39133,39119,39096,39096,39061,39061,
+39029,39018,38994,38994,38970,38970,38977,38982,
+39003,39003,39014,39014,39014,39020,39049,39049,
+39128,39128,39148,39145,39112,39112,39038,39038,
+38944,38914,38850,38850,38805,38805,38746,38719,
+38647,38647,38528,38528,38407,38360,38249,38249,
+38125,38125,38042,38013,37955,37955,37918,37918,
+37919,37915,37892,37892,37822,37822,37782,37770,
+37756,37756,37698,37698,37621,37598,37565,37565,
+37575,37575,37528,37500,37403,37403,37296,37296,
+37213,37185,37134,37134,37117,37117,37086,37068,
+37013,37013,36958,36958,36894,36842,36646,36646,
+36202,36202,35804,35690,35514,38767,38574,44628,
+44023,41149,41029,42102,42463,42107,41133,40605,
+42121,40926,41557,40173,39818,40637,41282,40175,
+40069,40044,40349,40744,40824,40844,40629,40704,
+40771,40571,40239,37333,36051,36665,36809,36983,
+37502,37952,38777,39393,39406,38499,38334,40695,
+40780,40780,40845,40865,40900,40900,40841,40841,
+40722,40697,40688,40688,40798,40798,40841,43757,
+44349,43906,43680,43505,42258,41343,41544,42831,
+40247,40247,40249,40230,40137,40137,40147,40147,
+40256,40276,40270,40270,40135,40135,40059,40034,
+39986,39986,39903,39903,39819,39784,39692,39692,
+39582,39582,39545,39539,39546,39546,39545,39545,
+39537,39533,39518,39518,39494,39494,39455,39436,
+39382,39382,39291,39291,39191,39164,39123,39123,
+39140,39140,39137,39132,39111,39111,39067,39067,
+39023,39007,38966,38966,38921,38921,38906,38904,
+38911,38911,38877,38877,38820,38799,38755,38755,
+38719,38719,38705,38700,38688,38688,38680,38680,
+38683,38688,38712,38712,38762,38762,38799,38811,
+38843,38843,38820,38820,38749,38723,38666,38666,
+38614,38614,38590,38583,38572,38572,38544,38544,
+38514,38505,38487,38487,38487,38487,38473,38465,
+38433,38433,38402,38402,38387,38397,38464,38464,
+38642,38642,38721,38738,38743,38743,38793,38793,
+38852,38869,38890,38890,46845,46147,47292,46818,
+47371,47790,48237,46891,47823,45480,47178,46626,
+47080,46506,46376,45733,46002,45286,45592,45478,
+45255,44740,44887,45326,46314,46063,45474,44685,
+44301,43867,42632,42795,42777,42902,42469,42535,
+42497,42562,43029,43082,43068,43709,44232,44347,
+44424,45074,44648,45224,45313,43668,42924,43089,
+43051,42993,42389,42426,42527,42402,42136,42126,
+41934,41854,41711,41062,40991,40814,40597,40896,
+41049,40859,40255,39527,38779,38867,40141,40124,
+40031,40031,40022,40022,40016,39989,39861,39861,
+39606,39606,39492,39469,39470,39470,39414,39414,
+39308,39280,39246,39246,39299,39299,39370,39400,
+39482,39482,39541,39541,39559,39556,39523,39523,
+39428,39428,39367,39347,39310,39310,39311,39311,
+39355,39365,39372,39372,39320,39320,39319,39327,
+39365,39365,39428,39428,39505,39514,39484,39484,
+39505,39505,39438,39422,39405,39405,39362,39362,
+39310,39293,39254,39254,39230,39230,39218,39214,
+39197,39197,39248,39248,39349,39379,39424,39424,
+39412,39412,39375,39356,39296,39296,39323,39323,
+39408,39425,39431,39431,39365,39365,39317,39299,
+39260,39260,39234,39234,39219,39213,39196,39196,
+39169,39169,39167,39172,39198,39198,39181,39181,
+39120,39106,39100,39100,39163,39163,39181,39183,
+39174,39174,39214,39214,39292,39315,39357,39357,
+39349,39349,39354,39359,39378,39378,39400,39400,
+39423,39430,39449,39449,39475,39475,39479,39476,
+39457,39457,39437,39437,39419,39408,39373,39373,
+39326,39326,39304,39297,39280,39280,39292,39292,
+39331,39343,39367,39367,39377,39377,39402,39415,
+39456,39456,39504,39504,39545,39547,39517,39517,
+39399,39399,39323,39297,39238,39238,39183,39183,
+39151,39130,39055,39055,38926,38926,38863,38843,
+38810,38810,38775,38775,38754,38731,38638,38638,
+38446,38446,38412,38420,38498,38498,38543,38543,
+38546,38543,38521,38521,38469,38469,38423,38403,
+38349,38349,38248,38248,38132,38091,37998,37998,
+37913,37913,37878,37872,37879,37879,37867,37867,
+37834,37816,37760,37760,37675,37675,37593,37557,
+37459,37459,37379,37379,37342,37316,37219,37219,
+37037,37037,36898,36848,36740,36740,36673,36673,
+36655,36644,36611,36611,36545,36545,36525,36533,
+36587,36587,36764,36764,36962,37028,37167,37167,
+37220,37220,37220,34765,34629,34372,32432,30925,
+28650,28200,28255,28312,29744,29495,32543,38204,
+38139,38487,39118,39409,39044,38227,38607,38922,
+38954,39191,39342,39664,39515,39495,39417,38982,
+38923,39379,39329,39392,38834,38727,38466,38084,
+37841,37530,37193,36706,36365,36172,36061,36076,
+36222,36436,36220,35843,35691,35783,35312,36178,
+37109,37278,36976,36933,38699,38699,38872,38954,
+39192,39192,39388,39388,39431,39440,39441,39441,
+39410,39410,39365,39347,39303,39303,39250,39250,
+39203,39190,39172,39172,39179,39179,39174,39167,
+39136,39136,39103,39103,39078,39076,39091,39091,
+39173,39173,39193,39191,39159,39159,39076,39076,
+38961,38922,38839,38839,38779,38779,38712,38683,
+38606,38606,38506,38506,38421,38384,38286,38286,
+38146,38146,38054,38022,37957,37957,37910,37910,
+37899,37895,37882,37882,37849,37849,37822,37812,
+37788,37788,37724,37724,37647,37619,37552,37552,
+37485,37485,37432,37412,37359,37359,37290,37290,
+37223,37198,37138,37138,37083,37083,37047,37034,
+37004,37004,36921,36921,36784,36708,36465,36465,
+36043,36043,35743,35654,35506,38383,38663,44071,
+44138,39180,38711,40376,40268,40451,40332,41348,
+42287,41636,39903,39819,40058,40448,41523,40716,
+40792,40669,40174,39917,40217,39941,40538,40942,
+41501,41548,40657,38961,36631,36772,37413,37791,
+38041,38449,39061,38964,38776,38132,38739,40814,
+40853,40853,40911,40932,40978,40978,40971,40971,
+40931,40921,40912,40912,40922,40922,40924,43437,
+42216,42327,42042,42306,42642,43319,42195,42912,
+40262,40262,40249,40234,40174,40174,40198,40198,
+40299,40318,40310,40310,40178,40178,40127,40115,
+40112,40112,40061,40061,39987,39954,39861,39861,
+39738,39738,39703,39699,39718,39718,39729,39729,
+39730,39724,39692,39692,39612,39612,39576,39568,
+39563,39563,39509,39509,39422,39397,39361,39361,
+39378,39378,39381,39379,39368,39368,39293,39293,
+39188,39157,39105,39105,39103,39103,39126,39140,
+39190,39190,39171,39171,39087,39059,39003,39003,
+38969,38969,38950,38943,38924,38924,38912,38912,
+38910,38913,38924,38924,38954,38954,38988,39003,
+39044,39044,39002,39002,38893,38859,38796,38796,
+38766,38766,38744,38735,38713,38713,38675,38675,
+38638,38628,38616,38616,38637,38637,38633,38628,
+38603,38603,38608,38608,38639,38656,38705,38705,
+38781,38781,38837,38857,38904,38904,39018,39018,
+39144,39180,39234,39234,46531,48033,48004,47582,
+47956,47415,46644,46240,45519,45043,45230,45619,
+46719,46085,45834,44935,45436,47007,45886,45568,
+45094,45251,46071,46041,46523,45693,44902,43812,
+44275,45075,43437,43400,43213,41890,42269,42263,
+43673,44015,43308,44573,44903,44430,44563,45267,
+44559,45022,44922,44386,44021,43196,42907,42487,
+42273,42190,41776,41922,42389,42615,42110,41798,
+42035,41856,41863,41905,41514,41758,41277,40948,
+40438,40214,39825,39512,38665,40250,40199,40186,
+40176,40176,40196,40196,40197,40171,40035,40035,
+39755,39755,39621,39589,39562,39562,39456,39456,
+39305,39277,39288,39288,39488,39488,39603,39635,
+39681,39681,39728,39728,39760,39763,39744,39744,
+39656,39656,39584,39556,39490,39490,39493,39493,
+39571,39587,39588,39588,39487,39487,39453,39448,
+39459,39459,39527,39527,39632,39652,39644,39644,
+39505,39505,39438,39422,39405,39405,39362,39362,
+39310,39293,39254,39254,39230,39230,39218,39214,
+39197,39197,39248,39248,39349,39379,39424,39424,
+39412,39412,39375,39356,39296,39296,39323,39323,
+39408,39425,39431,39431,39365,39365,39317,39299,
+39260,39260,39234,39234,39219,39213,39196,39196,
+39169,39169,39167,39172,39198,39198,39181,39181,
+39120,39106,39100,39100,39163,39163,39181,39183,
+39174,39174,39214,39214,39292,39315,39357,39357,
+39349,39349,39354,39359,39378,39378,39400,39400,
+39423,39430,39449,39449,39475,39475,39479,39476,
+39457,39457,39437,39437,39419,39408,39373,39373,
+39326,39326,39304,39297,39280,39280,39292,39292,
+39331,39343,39367,39367,39377,39377,39402,39415,
+39456,39456,39504,39504,39545,39547,39517,39517,
+39399,39399,39323,39297,39238,39238,39183,39183,
+39151,39130,39055,39055,38926,38926,38863,38843,
+38810,38810,38775,38775,38754,38731,38638,38638,
+38446,38446,38412,38420,38498,38498,38543,38543,
+38546,38543,38521,38521,38469,38469,38423,38403,
+38349,38349,38248,38248,38132,38091,37998,37998,
+37913,37913,37878,37872,37879,37879,37867,37867,
+37834,37816,37760,37760,37675,37675,37593,37557,
+37459,37459,37379,37379,37342,37316,37219,37219,
+37037,37037,36898,36848,36740,36740,36673,36673,
+36655,36644,36611,36611,36545,36545,36525,36533,
+36587,36587,36764,36764,36962,37028,37167,37167,
+37220,37220,37220,34217,34363,34470,31379,30087,
+28075,28758,28057,28140,29545,29533,31931,37471,
+37538,38273,39694,39723,39720,38638,38755,38953,
+39050,39286,39517,40010,39841,39630,39475,39039,
+39026,39554,39598,39531,38911,38746,38472,38392,
+38205,37882,37269,36774,36636,36910,36873,36729,
+36237,36541,36507,35836,36064,36091,34954,35410,
+35925,36157,35566,35658,38699,38699,38872,38954,
+39192,39192,39388,39388,39431,39440,39441,39441,
+39410,39410,39365,39347,39303,39303,39250,39250,
+39203,39190,39172,39172,39179,39179,39174,39167,
+39136,39136,39103,39103,39078,39076,39091,39091,
+39173,39173,39193,39191,39159,39159,39076,39076,
+38961,38922,38839,38839,38779,38779,38712,38683,
+38606,38606,38506,38506,38421,38384,38286,38286,
+38146,38146,38054,38022,37957,37957,37910,37910,
+37899,37895,37882,37882,37849,37849,37822,37812,
+37788,37788,37724,37724,37647,37619,37552,37552,
+37485,37485,37432,37412,37359,37359,37290,37290,
+37223,37198,37138,37138,37083,37083,37047,37034,
+37004,37004,36921,36921,36784,36708,36465,36465,
+36043,36043,35743,35654,35506,38397,43742,43914,
+43818,41593,38457,40982,39899,39694,39633,40485,
+42358,42919,40918,40161,40603,41242,40792,40446,
+40288,40285,40372,40344,40294,40271,40843,41039,
+41232,41997,41593,39953,38588,37911,37775,37721,
+38081,38508,39014,38851,38553,38926,39960,40814,
+40853,40853,40911,40932,40978,40978,40971,40971,
+40931,40921,40912,40912,40922,40922,40924,43343,
+42814,43438,42502,41932,41949,42378,41510,42712,
+40262,40262,40249,40234,40174,40174,40198,40198,
+40299,40318,40310,40310,40178,40178,40127,40115,
+40112,40112,40061,40061,39987,39954,39861,39861,
+39738,39738,39703,39699,39718,39718,39729,39729,
+39730,39724,39692,39692,39612,39612,39576,39568,
+39563,39563,39509,39509,39422,39397,39361,39361,
+39378,39378,39381,39379,39368,39368,39293,39293,
+39188,39157,39105,39105,39103,39103,39126,39140,
+39190,39190,39171,39171,39087,39059,39003,39003,
+38969,38969,38950,38943,38924,38924,38912,38912,
+38910,38913,38924,38924,38954,38954,38988,39003,
+39044,39044,39002,39002,38893,38859,38796,38796,
+38766,38766,38744,38735,38713,38713,38675,38675,
+38638,38628,38616,38616,38637,38637,38633,38628,
+38603,38603,38608,38608,38639,38656,38705,38705,
+38781,38781,38837,38857,38904,38904,39018,39018,
+39144,39180,39234,39234,39424,47130,48473,47439,
+48132,46649,46766,46042,46907,45709,45889,45781,
+46166,45939,45832,45674,45730,46335,45845,45448,
+44690,45893,46091,45885,44916,44540,44248,43848,
+44312,44963,43635,43481,43430,42573,42554,43144,
+43674,43499,43507,43795,44004,43829,45079,44955,
+45431,44800,44529,44241,43517,43138,43056,42367,
+42148,41996,41731,41873,42584,42201,41994,41799,
+41782,42319,42183,41861,41863,42012,41717,41073,
+40179,39720,39323,40235,40250,40250,40199,40186,
+40176,40176,40196,40196,40197,40171,40035,40035,
+39755,39755,39621,39589,39562,39562,39456,39456,
+39305,39277,39288,39288,39488,39488,39603,39635,
+39681,39681,39728,39728,39760,39763,39744,39744,
+39656,39656,39584,39556,39490,39490,39493,39493,
+39571,39587,39588,39588,39487,39487,39453,39448,
+39459,39459,39527,39527,39632,39652,39644,39644,
+39635,39635,39571,39557,39549,39549,39516,39516,
+39475,39457,39411,39411,39359,39359,39346,39344,
+39348,39348,39409,39409,39510,39541,39588,39588,
+39582,39582,39566,39558,39532,39532,39562,39562,
+39621,39632,39631,39631,39575,39575,39525,39506,
+39455,39455,39424,39424,39416,39413,39411,39411,
+39409,39409,39412,39415,39429,39429,39397,39397,
+39322,39304,39296,39296,39369,39369,39401,39408,
+39410,39410,39431,39431,39467,39479,39501,39501,
+39493,39493,39510,39522,39564,39564,39591,39591,
+39596,39599,39614,39614,39646,39646,39641,39632,
+39591,39591,39547,39547,39508,39493,39456,39456,
+39425,39425,39414,39410,39399,39399,39407,39407,
+39433,39443,39464,39464,39479,39479,39493,39500,
+39515,39515,39547,39547,39584,39586,39563,39563,
+39465,39465,39390,39362,39296,39296,39239,39239,
+39205,39185,39119,39119,39011,39011,38950,38929,
+38887,38887,38844,38844,38818,38793,38691,38691,
+38486,38486,38440,38446,38520,38520,38568,38568,
+38575,38573,38556,38556,38513,38513,38457,38429,
+38351,38351,38246,38246,38152,38117,38041,38041,
+37966,37966,37919,37904,37877,37877,37834,37834,
+37784,37761,37700,37700,37615,37615,37539,37506,
+37419,37419,37334,37334,37285,37256,37158,37158,
+36987,36987,36858,36813,36721,36721,36674,36674,
+36674,36672,36660,36660,36623,36623,36624,36639,
+36716,36716,36947,36947,37205,37286,37435,37435,
+37434,37434,37407,34942,34658,34531,29498,29242,
+28534,28914,27949,27826,29924,30554,31914,36389,
+37112,38215,39698,39717,39782,39058,39113,39113,
+39292,39515,39482,40256,40018,39793,39451,39261,
+39224,39547,39621,39479,38992,38818,38538,38508,
+38494,38227,37733,37494,37372,37601,37587,37297,
+36927,37077,36937,36278,36474,36383,35391,34985,
+35025,35914,35869,35834,37381,38198,39026,39091,
+39271,39271,39476,39476,39546,39563,39582,39582,
+39561,39561,39508,39485,39419,39419,39346,39346,
+39294,39279,39257,39257,39266,39266,39254,39242,
+39201,39201,39150,39150,39103,39094,39097,39097,
+39178,39178,39194,39189,39148,39148,39060,39060,
+38942,38900,38804,38804,38725,38725,38657,38629,
+38558,38558,38471,38471,38399,38366,38270,38270,
+38127,38127,38039,38009,37951,37951,37899,37899,
+37875,37866,37847,37847,37823,37823,37799,37790,
+37764,37764,37700,37700,37625,37595,37522,37522,
+37443,37443,37402,37389,37367,37367,37316,37316,
+37248,37220,37152,37152,37081,37081,37044,37032,
+37009,37009,36902,36902,36713,36622,36356,36356,
+35982,35982,35772,35716,37702,38753,43438,43818,
+43292,41145,40512,39776,39477,39564,39678,40115,
+40856,42264,40774,41300,41941,41591,41878,41804,
+41214,41073,40439,40210,40575,40424,41017,41366,
+41401,42264,42255,41252,39441,38007,37564,38030,
+38540,38899,39426,39664,39745,40456,41060,40839,
+40892,40892,40943,40961,40995,40995,41011,41011,
+41021,41023,41028,41028,41009,41009,41000,43217,
+43152,44232,42971,42397,41473,42643,41103,41866,
+40275,40275,40267,40260,40234,40234,40262,40262,
+40335,40347,40337,40337,40235,40235,40198,40191,
+40194,40194,40148,40148,40073,40040,39953,39953,
+39841,39841,39802,39796,39804,39804,39809,39809,
+39812,39807,39779,39779,39707,39707,39680,39676,
+39684,39684,39651,39651,39585,39566,39537,39537,
+39544,39544,39532,39524,39495,39495,39408,39408,
+39299,39268,39223,39223,39241,39241,39278,39298,
+39360,39360,39345,39345,39258,39231,39178,39178,
+39159,39159,39146,39140,39126,39126,39103,39103,
+39082,39077,39073,39073,39091,39091,39116,39127,
+39157,39157,39113,39113,39015,38984,38929,38929,
+38911,38911,38882,38869,38829,38829,38788,38788,
+38757,38750,38745,38745,38770,38770,38768,38763,
+38743,38743,38773,38773,38842,38868,38924,38924,
+38971,38971,39011,39029,39073,39073,39204,39204,
+39357,39401,39468,39468,39617,45186,47331,47750,
+48603,47587,47813,47618,47994,46135,45987,45755,
+45569,45810,45970,45696,45882,46009,45263,44536,
+44364,46056,46090,45801,44731,44171,43898,43856,
+44146,44215,43674,43517,43387,42908,43401,43309,
+43119,43162,44355,43510,44015,44879,43735,44861,
+44837,44677,44638,44558,43199,42956,42719,42025,
+41973,41945,42235,42425,42157,42515,42230,41871,
+41791,42329,42316,41598,41510,41939,41701,40898,
+40032,39177,38849,40304,40284,40284,40268,40265,
+40268,40268,40285,40285,40269,40237,40096,40096,
+39821,39821,39692,39661,39636,39636,39552,39552,
+39444,39432,39484,39484,39718,39718,39825,39848,
+39859,39859,39882,39882,38163,39920,39907,39907,
+39837,39837,39768,39741,39668,39668,39664,39664,
+39737,39751,39744,39744,39637,39637,39600,39593,
+39599,39599,39666,39666,39768,39788,39780,39780,
+39695,39695,39632,39618,39613,39613,39587,39587,
+39550,39534,39486,39486,39424,39424,39412,39411,
+39423,39423,39487,39487,39588,39617,39664,39664,
+39658,39658,39649,39646,39635,39635,39666,39666,
+39712,39719,39716,39716,39667,39667,39618,39597,
+39544,39544,39510,39510,39506,39506,39508,39508,
+39515,39515,39519,39521,39531,39531,39492,39492,
+39413,39395,39384,39384,39464,39464,39501,39509,
+39515,39515,39529,39529,39548,39553,39564,39564,
+39557,39557,39579,39593,39645,39645,39674,39674,
+39672,39674,39685,39685,39719,39719,39712,39700,
+39651,39651,39594,39594,39547,39530,39492,39492,
+39471,39471,39466,39463,39456,39456,39462,39462,
+39481,39488,39506,39506,39522,39522,39531,39534,
+39539,39539,39563,39563,39599,39602,39584,39584,
+39494,39494,39421,39391,39321,39321,39261,39261,
+39225,39206,39143,39143,39049,39049,38990,38968,
+38921,38921,38874,38874,38844,38818,38716,38716,
+38507,38507,38457,38461,38531,38531,38578,38578,
+38585,38584,38570,38570,38533,38533,38471,38440,
+38346,38346,38240,38240,38160,38130,38060,38060,
+37988,37988,37933,37914,37872,37872,37816,37816,
+37758,37734,37671,37671,37585,37585,37511,37481,
+37401,37401,37315,37315,37258,37227,37130,37130,
+36963,36963,36841,36799,36717,36717,36679,36679,
+36684,36685,36682,36682,36659,36659,36671,36690,
+36776,36776,37030,37030,37314,37401,37553,37553,
+37526,37526,37486,37461,35100,34625,28913,29046,
+30054,29639,29030,27558,30454,31766,32539,35898,
+37311,37682,39060,39511,39577,39875,39902,39857,
+39885,40178,40515,40605,40394,39964,38683,38934,
+39013,38865,39261,39407,39078,38929,38662,38619,
+38607,38543,38409,38309,38327,38375,38254,38148,
+37784,37572,37119,37025,37179,36975,36560,36216,
+35767,35689,36040,36104,37195,38012,39093,39152,
+39312,39312,39518,39518,39599,39621,39646,39646,
+39629,39629,39571,39545,39468,39468,39388,39388,
+39333,39317,39293,39293,39301,39301,39285,39273,
+39229,39229,39172,39172,39114,39101,39099,39099,
+39180,39180,39192,39186,39139,39139,39049,39049,
+38931,38887,38787,38787,38699,38699,38629,38602,
+38536,38536,38455,38455,38387,38355,38260,38260,
+38116,38116,38030,38002,37948,37948,37893,37893,
+37863,37852,37830,37830,37807,37807,37786,37776,
+37751,37751,37686,37686,37611,37582,37507,37507,
+37426,37426,37391,37382,37373,37373,37330,37330,
+37259,37231,37159,37159,37081,37081,37044,37032,
+37013,37013,36893,36893,36680,36583,36308,36308,
+35959,35959,35786,37829,40193,38710,43863,43674,
+43237,42214,42659,41658,40415,40128,40253,40695,
+41433,40875,40825,40733,40649,40924,40591,40581,
+42567,43438,41962,41688,41363,40918,41177,41417,
+41720,41599,41358,41295,39606,39050,38811,38806,
+38942,39511,40833,41563,42607,42259,40849,40849,
+40910,40910,40957,40972,41000,41000,41025,41025,
+41057,41066,41077,41077,41049,41049,41034,43958,
+44168,44046,42564,40893,40715,41690,41293,41091,
+42703,40281,40277,40274,40263,40263,40294,40294,
+40350,40360,40348,40348,40263,40263,40233,40228,
+40231,40231,40185,40185,40109,40077,39992,39992,
+39886,39886,39847,39840,39841,39841,39842,39842,
+39845,39841,39817,39817,39751,39751,39729,39727,
+39738,39738,39714,39714,39658,39642,39616,39616,
+39618,39618,39598,39587,39547,39547,39455,39455,
+39349,39319,39279,39279,39303,39303,39346,39368,
+39434,39434,39423,39423,39335,39307,39257,39257,
+39245,39245,39237,39232,39218,39218,39192,39192,
+39160,39152,39140,39140,39153,39153,39174,39182,
+39206,39206,39163,39163,39072,39044,38994,38994,
+38980,38980,38947,38931,38883,38883,38840,38840,
+38813,38808,38805,38805,38834,38834,38832,38827,
+38807,38807,38849,38849,38936,38966,39026,39026,
+39064,39064,39098,39113,39153,39153,39288,39288,
+39453,39500,39571,39571,39696,39696,39725,45919,
+48015,47902,45576,45421,45174,45497,45507,45561,
+45212,44493,45414,45285,45454,45359,43754,44216,
+45327,46283,46060,45954,45203,44644,43971,43973,
+43983,44136,44465,44700,43973,43919,44056,43496,
+44786,44560,44833,43652,42930,43333,42958,43258,
+43650,43848,43350,43435,42978,42600,42352,41755,
+41718,42047,41956,42164,42278,42669,42518,42198,
+42044,41626,41181,41139,41596,41637,41377,40426,
+39418,38699,40331,40331,40300,40300,40299,40300,
+40309,40309,40323,40323,40298,40263,40120,40120,
+39848,39848,39723,39694,39672,39672,39602,39602,
+39519,39516,39586,39586,39829,39829,39928,39948,
+39940,39940,38397,39954,39985,39990,39981,39981,
+39919,39919,39853,39826,39751,39751,39743,39743,
+39812,39824,39814,39814,39709,39709,39672,39665,
+39670,39670,39734,39734,39835,39852,39842,39842,
+39870,39870,39803,39791,39793,39793,39785,39785,
+39778,39771,39745,39745,39701,39701,39696,39698,
+39712,39712,39768,39768,39856,39878,39899,39899,
+39843,39843,39838,39843,39878,39878,39900,39900,
+39896,39894,39889,39889,39887,39887,39860,39845,
+39800,39800,39777,39777,39787,39790,39791,39791,
+39779,39779,39770,39766,39758,39758,39724,39724,
+39668,39656,39655,39655,39735,39735,39781,39794,
+39812,39812,39803,39803,39768,39757,39741,39741,
+39735,39735,39757,39772,39826,39826,39852,39852,
+39845,39844,39850,39850,39868,39868,39854,39842,
+39799,39799,39723,39723,39640,39616,39580,39580,
+39605,39605,39627,39633,39647,39647,39643,39643,
+39625,39619,39610,39610,39608,39608,39590,39580,
+39549,39549,39563,39563,39619,39630,39630,39630,
+39563,39563,39494,39464,39384,39384,39300,39300,
+39229,39207,39163,39163,39150,39150,39102,39076,
+38992,38992,38924,38924,38890,38866,38779,38779,
+38612,38612,38552,38546,38569,38569,38582,38582,
+38578,38578,38581,38581,38591,38591,38506,38451,
+38267,38267,38161,38161,38174,38170,38128,38128,
+38007,38007,37918,37884,37809,37809,37725,37725,
+37661,37632,37559,37559,37455,37455,37400,37385,
+37364,37364,37285,37285,37184,37142,37036,37036,
+36888,36888,36806,36787,36770,36770,36759,36759,
+36743,36742,36753,36753,36779,36779,36827,36860,
+36977,36977,37280,37280,37611,37704,37836,37836,
+37715,37715,37635,35297,34786,33966,29100,29915,
+31166,29851,29216,28844,31284,31965,32304,35890,
+36973,36969,38901,39282,39434,39965,39901,40110,
+40174,40062,40334,40461,40255,39876,38612,38789,
+39091,38702,39053,39245,39215,39207,38956,38746,
+38737,38728,38754,38494,38506,38341,38222,38208,
+37802,37451,37223,37299,37300,36978,36759,36448,
+35647,35561,35582,35292,36757,37725,37893,39300,
+39494,39494,39657,39657,39770,39800,39840,39840,
+39805,39805,39726,39688,39578,39578,39476,39476,
+39417,39398,39362,39362,39346,39346,39328,39319,
+39292,39292,39229,39229,39133,39109,39083,39083,
+39161,39161,39159,39144,39071,39071,38974,38974,
+38867,38823,38710,38710,38589,38589,38519,38497,
+38454,38454,38387,38387,38322,38290,38198,38198,
+38060,38060,37988,37967,37933,37933,37877,37877,
+37819,37799,37755,37755,37715,37715,37691,37682,
+37664,37664,37606,37606,37535,37509,37454,37454,
+37408,37408,37402,37404,37422,37422,37387,37387,
+37301,37268,37187,37187,37106,37106,37067,37055,
+37030,37030,36864,36864,36580,36466,36182,36182,
+35947,35947,35836,39284,41950,43235,44203,43632,
+42552,40499,40688,41519,41371,40758,40595,40677,
+40962,41136,42312,41200,41093,40959,41013,41103,
+41800,44073,44250,42129,41926,41329,41112,41224,
+41159,41716,42202,41695,40135,39306,38877,39384,
+39607,39646,41340,42172,42235,43248,40872,40872,
+40959,40959,40991,40994,40981,40981,41017,41017,
+41102,41128,41170,41170,41153,41153,41122,41106,
+43784,44203,43398,40311,39412,40644,41097,40686,
+42333,40289,40321,40336,40376,40376,40402,40402,
+40394,40391,40382,40382,40378,40378,40364,40356,
+40331,40331,40264,40264,40178,40147,40078,40078,
+40015,40015,39972,39956,39917,39917,39888,39888,
+39886,39886,39887,39887,39885,39885,39883,39882,
+39876,39876,39863,39863,39850,39845,39830,39830,
+39807,39807,39750,39719,39626,39626,39535,39535,
+39482,39468,39456,39456,39487,39487,39532,39552,
+39611,39611,39602,39602,39531,39510,39481,39481,
+39497,39497,39507,39509,39510,39510,39467,39467,
+39394,39372,39335,39335,39337,39337,39334,39330,
+39314,39314,39285,39285,39252,39242,39224,39224,
+39216,39216,39168,39141,39056,39056,39007,39007,
+39007,39009,39022,39022,39046,39046,39041,39036,
+39017,39017,39089,39089,39225,39271,39364,39364,
+39423,39423,39439,39439,39424,39424,39531,39531,
+39700,39749,39821,39821,39812,39812,39852,39905,
+40131,44405,43713,43826,44424,44753,44958,45138,
+45218,45448,45685,45073,45387,44311,43980,45481,
+46312,46047,46026,45905,45207,44953,44670,44087,
+44412,44104,43730,43598,43576,43498,43363,43348,
+43976,43620,43624,43255,43146,42946,43488,43568,
+43652,44222,44676,43773,43232,42927,42427,41640,
+41751,41670,42341,42303,42252,42591,42463,42311,
+42226,41658,40985,41038,41800,41833,40960,40157,
+39349,40353,40345,40345,40374,40374,40392,40399,
+40414,40414,40396,40396,40325,40281,40131,40131,
+39888,39888,39797,39781,39796,39796,39831,39831,
+39889,39925,40044,40044,40223,40223,40264,40258,
+40191,39111,40163,40163,40183,40186,40184,40184,
+40151,40151,40105,40084,40020,40020,39999,39999,
+40032,40035,40018,40018,39950,39950,39935,39936,
+39956,39956,40007,40007,40072,40077,40038,40038,
+39870,39870,39803,39791,39793,39793,39785,39785,
+39778,39771,39745,39745,39701,39701,39696,39698,
+39712,39712,39768,39768,39856,39878,39899,39899,
+39843,39843,39838,39843,39878,39878,39900,39900,
+39896,39894,39889,39889,39887,39887,39860,39845,
+39800,39800,39777,39777,39787,39790,39791,39791,
+39779,39779,39770,39766,39758,39758,39724,39724,
+39668,39656,39655,39655,39735,39735,39781,39794,
+39812,39812,39803,39803,39768,39757,39741,39741,
+39735,39735,39757,39772,39826,39826,39852,39852,
+39845,39844,39850,39850,39868,39868,39854,39842,
+39799,39799,39723,39723,39640,39616,39580,39580,
+39605,39605,39627,39633,39647,39647,39643,39643,
+39625,39619,39610,39610,39608,39608,39590,39580,
+39549,39549,39563,39563,39619,39630,39630,39630,
+39563,39563,39494,39464,39384,39384,39300,39300,
+39229,39207,39163,39163,39150,39150,39102,39076,
+38992,38992,38924,38924,38890,38866,38779,38779,
+38612,38612,38552,38546,38569,38569,38582,38582,
+38578,38578,38581,38581,38591,38591,38506,38451,
+38267,38267,38161,38161,38174,38170,38128,38128,
+38007,38007,37918,37884,37809,37809,37725,37725,
+37661,37632,37559,37559,37455,37455,37400,37385,
+37364,37364,37285,37285,37184,37142,37036,37036,
+36888,36888,36806,36787,36770,36770,36759,36759,
+36743,36742,36753,36753,36779,36779,36827,36860,
+36977,36977,37280,37280,37611,37704,37836,37836,
+37715,37715,37635,34971,34798,33431,29001,30514,
+31590,30216,29669,28702,31415,31253,31347,35466,
+36271,36554,38883,39290,39435,40091,40001,39935,
+39957,40054,40175,40251,40176,39562,38850,38948,
+39220,38944,38778,38659,39140,39168,39200,38755,
+38514,38739,38950,38721,38622,38421,38379,38377,
+38000,37509,37176,37185,37202,37185,36877,36635,
+35440,35657,35799,35775,36527,36863,37016,39300,
+39494,39494,39657,39657,39770,39800,39840,39840,
+39805,39805,39726,39688,39578,39578,39476,39476,
+39417,39398,39362,39362,39346,39346,39328,39319,
+39292,39292,39229,39229,39133,39109,39083,39083,
+39161,39161,39159,39144,39071,39071,38974,38974,
+38867,38823,38710,38710,38589,38589,38519,38497,
+38454,38454,38387,38387,38322,38290,38198,38198,
+38060,38060,37988,37967,37933,37933,37877,37877,
+37819,37799,37755,37755,37715,37715,37691,37682,
+37664,37664,37606,37606,37535,37509,37454,37454,
+37408,37408,37402,37404,37422,37422,37387,37387,
+37301,37268,37187,37187,37106,37106,37067,37055,
+37030,37030,36864,36864,36580,36466,36182,36182,
+35947,35947,35836,43299,43731,44109,43468,43784,
+43050,40339,40136,40763,41676,41243,40864,40910,
+40701,40957,42021,41789,42013,41091,40989,41107,
+41527,41849,42726,44332,42389,41301,41169,41056,
+40769,40638,40648,40453,40541,40010,38634,40000,
+40581,39526,42375,43070,42546,40766,40872,40872,
+40959,40959,40991,40994,40981,40981,41017,41017,
+41102,41128,41170,41170,41153,41153,41122,41106,
+43726,43869,43891,41204,39306,41062,41001,40321,
+42039,40289,40321,40336,40376,40376,40402,40402,
+40394,40391,40382,40382,40378,40378,40364,40356,
+40331,40331,40264,40264,40178,40147,40078,40078,
+40015,40015,39972,39956,39917,39917,39888,39888,
+39886,39886,39887,39887,39885,39885,39883,39882,
+39876,39876,39863,39863,39850,39845,39830,39830,
+39807,39807,39750,39719,39626,39626,39535,39535,
+39482,39468,39456,39456,39487,39487,39532,39552,
+39611,39611,39602,39602,39531,39510,39481,39481,
+39497,39497,39507,39509,39510,39510,39467,39467,
+39394,39372,39335,39335,39337,39337,39334,39330,
+39314,39314,39285,39285,39252,39242,39224,39224,
+39216,39216,39168,39141,39056,39056,39007,39007,
+39007,39009,39022,39022,39046,39046,39041,39036,
+39017,39017,39089,39089,39225,39271,39364,39364,
+39423,39423,39439,39439,39424,39424,39531,39531,
+39700,39749,39821,39821,39812,39812,39852,39905,
+40131,40131,40349,40349,43158,43922,44447,44738,
+44548,45204,43630,45280,45487,44391,44101,45785,
+46563,45900,45867,45839,45089,44837,44822,44402,
+44145,44033,43586,43370,43393,43217,43336,43816,
+43719,43663,43577,43499,43212,43103,43854,43957,
+43828,44353,43745,43467,43268,42916,42342,41662,
+41695,41920,42366,42325,42295,42753,42688,42477,
+41664,41041,40762,41348,41665,41446,40765,40158,
+39522,40353,40345,40345,40374,40374,40392,40399,
+40414,40414,40396,40396,40325,40281,40131,40131,
+39888,39888,39797,39781,39796,39796,39831,39831,
+39889,39925,40044,40044,40223,40223,40264,40258,
+39634,40191,40163,40163,40183,40186,40184,40184,
+40151,40151,40105,40084,40020,40020,39999,39999,
+40032,40035,40018,40018,39950,39950,39935,39936,
+39956,39956,40007,40007,40072,40077,40038,40038,
+40091,40091,40042,40028,40013,40013,39992,39992,
+39978,39972,39956,39956,39940,39940,39941,39942,
+39948,39948,40000,40000,40086,40106,40123,40123,
+40059,40059,40052,40058,40096,40096,40106,40106,
+40076,40069,40070,40070,40100,40100,40094,40088,
+40057,40057,40040,40040,40045,40044,40033,40033,
+40004,40004,39995,39992,39988,39988,39960,39960,
+39915,39903,39891,39891,39934,39934,39960,39966,
+39976,39976,39959,39959,39919,39909,39896,39896,
+39910,39910,39940,39957,40011,40011,40049,40049,
+40056,40057,40052,40052,40027,40027,40002,39992,
+39966,39966,39897,39897,39801,39774,39733,39733,
+39761,39761,39783,39791,39805,39805,39793,39793,
+39755,39742,39716,39716,39696,39696,39663,39647,
+39602,39602,39597,39597,39630,39634,39630,39630,
+39578,39578,39516,39490,39417,39417,39327,39327,
+39241,39216,39172,39172,39170,39170,39123,39097,
+39012,39012,38938,38938,38897,38875,38805,38805,
+38685,38685,38628,38614,38603,38603,38576,38576,
+38544,38538,38542,38542,38590,38590,38512,38457,
+38255,38255,38140,38140,38159,38153,38102,38102,
+37958,37958,37854,37817,37731,37731,37619,37619,
+37522,37485,37393,37393,37278,37278,37244,37244,
+37274,37274,37218,37218,37103,37061,36969,36969,
+36872,36872,36838,36839,36879,36879,36907,36907,
+36902,36906,36930,36930,36983,36983,37061,37105,
+37246,37246,37523,37523,37782,37846,37909,37909,
+37732,37732,37638,35216,34078,31497,29088,30800,
+31371,30299,29103,27059,29688,31552,31396,34773,
+36014,36996,38742,39366,39388,39745,39878,40149,
+39975,39772,39839,39695,39824,39749,39671,39396,
+39504,38970,38694,38676,38853,38652,38607,38632,
+38675,38700,38494,38570,38353,37897,37785,37740,
+37768,37433,36938,36206,36564,36921,36697,36518,
+35755,35590,36353,37067,37629,37777,37706,38824,
+39665,39665,39764,39764,39885,39921,39975,39975,
+39953,39953,39882,39846,39739,39739,39638,39638,
+39579,39556,39503,39503,39447,39447,39400,39382,
+39339,39339,39266,39266,39166,39135,39085,39085,
+39123,39123,39092,39067,38971,38971,38866,38866,
+38765,38722,38603,38603,38465,38465,38400,38382,
+38358,38358,38310,38310,38253,38225,38144,38144,
+38024,38024,37955,37933,37890,37890,37840,37840,
+37800,37784,37742,37742,37686,37686,37650,37635,
+37602,37602,37549,37549,37504,37487,37449,37449,
+37416,37416,37410,37413,37429,37429,37395,37395,
+37312,37281,37206,37206,37128,37128,37080,37060,
+37010,37010,36827,36827,36554,36454,36221,36221,
+35941,35941,38171,40578,42215,43476,42144,43229,
+42541,41162,40611,39799,40755,40660,40602,40476,
+40566,40607,40599,40755,40680,40960,40986,40982,
+41540,41415,41092,40836,40784,40818,41515,41302,
+41167,40818,40791,41139,41532,41229,40160,42363,
+41227,40730,41955,42132,43612,43310,40892,40892,
+40977,40977,40995,40995,40976,40976,41026,41026,
+41128,41160,41220,41220,41234,41234,41196,41167,
+41053,43503,45202,44182,42126,39862,40414,39448,
+41360,42049,40406,40416,40451,40451,40467,40467,
+40443,40439,40444,40444,40481,40481,40466,40451,
+40393,40393,40306,40306,40218,40191,40137,40137,
+40114,40114,40081,40064,40014,40014,39973,39973,
+39968,39969,39983,39983,40011,40011,40021,40022,
+40016,40016,40001,40001,39987,39980,39960,39960,
+39918,39918,39848,39813,39712,39712,39648,39648,
+39647,39651,39673,39673,39726,39726,39777,39797,
+39846,39846,39843,39843,39792,39776,39751,39751,
+39759,39759,39764,39765,39764,39764,39710,39710,
+39618,39589,39535,39535,39522,39522,39508,39502,
+39480,39480,39457,39457,39440,39436,39429,39429,
+39428,39428,39373,39341,39236,39236,39180,39180,
+39193,39200,39219,39219,39243,39243,39253,39255,
+39257,39257,39325,39325,39434,39473,39562,39562,
+39646,39646,39681,39687,39682,39682,39791,39791,
+39954,39998,40058,40058,40036,40036,40086,40120,
+40239,40239,40438,40438,40614,40692,40912,40912,
+41017,41017,43862,45058,45456,45165,45659,44854,
+45688,45713,45628,45667,44947,44630,44535,44493,
+44389,44123,43307,43333,43328,43432,43670,44156,
+43446,43707,43878,43608,43449,43464,43626,43749,
+43817,44187,43956,43911,43464,43078,42777,42309,
+42125,42293,42303,42532,42852,43290,42943,41863,
+39887,40203,40748,41002,40625,40318,40223,40504,
+40436,40421,40412,40412,40422,40422,40441,40450,
+40474,40474,40447,40447,40366,40323,40194,40194,
+40012,40012,39963,39962,40007,40007,40083,40083,
+40176,40216,40321,40321,40435,40435,40423,40397,
+40283,40283,40245,40245,40292,40306,40333,40333,
+40337,40337,40311,40296,40244,40244,40214,40214,
+40216,40213,40191,40191,40153,40153,40152,40157,
+40181,40181,40215,40215,40244,40243,40206,40206,
+40091,40091,40042,40028,40013,40013,39992,39992,
+39978,39972,39956,39956,39940,39940,39941,39942,
+39948,39948,40000,40000,40086,40106,40123,40123,
+40059,40059,40052,40058,40096,40096,40106,40106,
+40076,40069,40070,40070,40100,40100,40094,40088,
+40057,40057,40040,40040,40045,40044,40033,40033,
+40004,40004,39995,39992,39988,39988,39960,39960,
+39915,39903,39891,39891,39934,39934,39960,39966,
+39976,39976,39959,39959,39919,39909,39896,39896,
+39910,39910,39940,39957,40011,40011,40049,40049,
+40056,40057,40052,40052,40027,40027,40002,39992,
+39966,39966,39897,39897,39801,39774,39733,39733,
+39761,39761,39783,39791,39805,39805,39793,39793,
+39755,39742,39716,39716,39696,39696,39663,39647,
+39602,39602,39597,39597,39630,39634,39630,39630,
+39578,39578,39516,39490,39417,39417,39327,39327,
+39241,39216,39172,39172,39170,39170,39123,39097,
+39012,39012,38938,38938,38897,38875,38805,38805,
+38685,38685,38628,38614,38603,38603,38576,38576,
+38544,38538,38542,38542,38590,38590,38512,38457,
+38255,38255,38140,38140,38159,38153,38102,38102,
+37958,37958,37854,37817,37731,37731,37619,37619,
+37522,37485,37393,37393,37278,37278,37244,37244,
+37274,37274,37218,37218,37103,37061,36969,36969,
+36872,36872,36838,36839,36879,36879,36907,36907,
+36902,36906,36930,36930,36983,36983,37061,37105,
+37246,37246,37523,37523,37782,37846,37909,37909,
+37732,37732,37638,34643,34209,30580,29976,30964,
+30687,30014,29235,27360,30418,31700,31948,35093,
+36237,37440,38930,39219,39306,39235,39455,39455,
+39685,40030,39554,39373,39488,39556,39789,39581,
+39346,38991,38553,38580,38716,38862,38567,38702,
+38233,38441,38855,38264,38261,37672,37459,37325,
+37448,37182,36814,36648,36823,37227,36763,36484,
+36155,35891,36591,37255,37957,38106,38107,38714,
+39322,39665,39764,39764,39885,39921,39975,39975,
+39953,39953,39882,39846,39739,39739,39638,39638,
+39579,39556,39503,39503,39447,39447,39400,39382,
+39339,39339,39266,39266,39166,39135,39085,39085,
+39123,39123,39092,39067,38971,38971,38866,38866,
+38765,38722,38603,38603,38465,38465,38400,38382,
+38358,38358,38310,38310,38253,38225,38144,38144,
+38024,38024,37955,37933,37890,37890,37840,37840,
+37800,37784,37742,37742,37686,37686,37650,37635,
+37602,37602,37549,37549,37504,37487,37449,37449,
+37416,37416,37410,37413,37429,37429,37395,37395,
+37312,37281,37206,37206,37128,37128,37080,37060,
+37010,37010,36827,36827,36554,36454,36221,36221,
+35941,38668,39750,43847,44011,42309,43723,44119,
+43526,41862,41241,40637,40587,40691,40332,40656,
+40572,40490,40549,40595,40616,41535,40998,41148,
+41712,41466,41129,40457,40452,40801,41797,41687,
+41318,41623,41998,41467,40546,40034,39777,42162,
+42535,41271,42515,42311,43751,43518,43519,40892,
+40977,40977,40995,40995,40976,40976,41026,41026,
+41128,41160,41220,41220,41234,41234,41196,41167,
+41053,43730,44382,43325,43845,42668,41541,40172,
+40974,41750,40406,40416,40451,40451,40467,40467,
+40443,40439,40444,40444,40481,40481,40466,40451,
+40393,40393,40306,40306,40218,40191,40137,40137,
+40114,40114,40081,40064,40014,40014,39973,39973,
+39968,39969,39983,39983,40011,40011,40021,40022,
+40016,40016,40001,40001,39987,39980,39960,39960,
+39918,39918,39848,39813,39712,39712,39648,39648,
+39647,39651,39673,39673,39726,39726,39777,39797,
+39846,39846,39843,39843,39792,39776,39751,39751,
+39759,39759,39764,39765,39764,39764,39710,39710,
+39618,39589,39535,39535,39522,39522,39508,39502,
+39480,39480,39457,39457,39440,39436,39429,39429,
+39428,39428,39373,39341,39236,39236,39180,39180,
+39193,39200,39219,39219,39243,39243,39253,39255,
+39257,39257,39325,39325,39434,39473,39562,39562,
+39646,39646,39681,39687,39682,39682,39791,39791,
+39954,39998,40058,40058,40036,40036,40086,40120,
+40239,40239,40438,40438,40614,40692,40912,40912,
+41017,41017,40960,44357,44612,44240,45476,45330,
+45164,45605,45494,45590,44892,44575,44382,44461,
+44404,43945,43261,43061,43121,43944,43701,43581,
+43491,43926,43696,43477,43452,43656,44049,44164,
+44316,44190,44175,44025,43755,43365,42962,42176,
+42273,42523,42449,42559,42898,43557,42927,41974,
+40046,40478,40832,40087,39657,39721,40504,40504,
+40436,40421,40412,40412,40422,40422,40441,40450,
+40474,40474,40447,40447,40366,40323,40194,40194,
+40012,40012,39963,39962,40007,40007,40083,40083,
+40176,40216,40321,40321,40435,40435,40423,40397,
+40283,40283,40245,40245,40292,40306,40333,40333,
+40337,40337,40311,40296,40244,40244,40214,40214,
+40216,40213,40191,40191,40153,40153,40152,40157,
+40181,40181,40215,40215,40244,40243,40206,40206,
+40271,40271,40244,40229,40182,40182,40125,40125,
+40085,40072,40053,40053,40064,40064,40070,40069,
+40062,40062,40112,40112,40204,40229,40261,40261,
+40226,40226,40218,40220,40237,40237,40234,40234,
+40207,40202,40207,40207,40240,40240,40243,40241,
+40224,40224,40207,40207,40196,40189,40165,40165,
+40125,40125,40121,40122,40131,40131,40111,40111,
+40069,40055,40027,40027,40024,40024,40019,40016,
+40006,40006,39995,39995,39989,39990,40004,40004,
+40041,40041,40080,40097,40148,40148,40198,40198,
+40226,40228,40212,40212,40138,40138,40103,40095,
+40090,40090,40044,40044,39959,39932,39882,39882,
+39880,39880,39881,39881,39881,39881,39862,39862,
+39830,39817,39787,39787,39757,39757,39722,39708,
+39668,39668,39637,39637,39625,39617,39590,39590,
+39543,39543,39495,39474,39422,39422,39345,39345,
+39266,39238,39178,39178,39127,39127,39074,39051,
+38995,38995,38930,38930,38877,38853,38793,38793,
+38708,38708,38659,38645,38624,38624,38572,38572,
+38509,38496,38487,38487,38549,38549,38503,38462,
+38303,38303,38177,38177,38133,38107,38023,38023,
+37877,37877,37780,37747,37675,37675,37548,37548,
+37414,37365,37253,37253,37132,37132,37111,37118,
+37175,37175,37145,37145,37041,37006,36938,36938,
+36893,36893,36897,36913,36982,36982,37047,37047,
+37070,37082,37115,37115,37157,37157,37234,37277,
+37415,37415,37601,37601,37728,37754,37753,37753,
+37611,37611,37590,34688,33417,29821,29667,30684,
+30404,30179,29049,27878,30406,32322,33270,35266,
+36384,37578,38732,39336,39195,39220,39324,39287,
+39644,39927,39834,39468,39394,39651,39751,39498,
+39359,38854,38583,38621,38813,38710,38792,38559,
+38597,38384,38595,38243,38180,37680,37420,37204,
+37699,37192,36930,36815,36977,37270,37040,36824,
+36390,36293,36939,37581,38128,38015,37991,38761,
+39269,39738,39816,39816,39928,39963,40025,40025,
+40026,40026,39978,39952,39870,39870,39784,39784,
+39725,39701,39634,39634,39543,39543,39461,39427,
+39345,39345,39266,39266,39191,39165,39106,39106,
+39098,39098,39044,39010,38903,38903,38796,38796,
+38702,38660,38544,38544,38403,38403,38341,38326,
+38309,38309,38271,38271,38221,38198,38128,38128,
+38026,38026,37950,37921,37850,37850,37811,37811,
+37817,37813,37791,37791,37726,37726,37672,37648,
+37589,37589,37540,37540,37523,37514,37486,37486,
+37443,37443,37422,37418,37416,37416,37380,37380,
+37308,37281,37216,37216,37139,37139,37081,37054,
+36979,36979,36824,36824,36639,36573,36426,36426,
+36187,39425,39591,42280,42818,43003,44097,43867,
+37927,42368,41528,41377,40857,40642,40433,40743,
+40508,40563,40655,40692,40944,41263,41260,41381,
+41612,41478,41091,40216,40250,40958,41626,41816,
+42207,42129,41708,41132,40483,40148,39942,41219,
+41510,40523,43387,43437,43597,43587,43465,43786,
+40974,40974,40980,40982,40984,40984,41043,41043,
+41131,41162,41231,41231,41289,41289,41285,41261,
+41151,43934,44600,44023,44041,43194,42624,41202,
+40623,41430,42141,40476,40479,40479,40481,40481,
+40481,40485,40503,40503,40540,40540,40512,40491,
+40413,40413,40313,40313,40225,40199,40155,40155,
+40156,40156,40141,40132,40099,40099,40069,40069,
+40065,40067,40077,40077,40096,40096,40109,40113,
+40119,40119,40093,40093,40054,40039,40000,40000,
+39949,39949,39886,39859,39781,39781,39750,39750,
+39779,39794,39841,39841,39919,39919,39973,39992,
+40028,40028,40031,40031,39998,39985,39956,39956,
+39933,39933,39918,39912,39899,39899,39839,39839,
+39750,39720,39662,39662,39632,39632,39623,39621,
+39623,39623,39601,39601,39565,39554,39540,39540,
+39545,39545,39493,39463,39363,39363,39306,39306,
+39314,39318,39335,39335,39358,39358,39388,39402,
+39443,39443,39487,39487,39523,39543,39601,39601,
+39701,39701,39770,39794,39842,39842,39972,39972,
+40122,40161,40203,40203,40153,40153,40206,40244,
+40382,40382,40557,40557,40697,40754,40895,40895,
+40993,40993,41001,43836,43740,43993,44036,44554,
+45296,45658,45548,45548,44823,44729,44547,44138,
+44212,44029,43401,43306,43130,43882,43395,43417,
+43805,43989,43713,43589,43652,43958,44010,44026,
+44268,43828,43904,43694,43963,43359,43133,42856,
+42876,42990,42880,42964,43092,42936,42603,41822,
+40508,40495,40196,39268,39138,40588,40548,40548,
+40525,40514,40486,40486,40448,40448,40454,40461,
+40492,40492,40476,40476,40412,40380,40283,40283,
+40151,40151,40130,40137,40197,40197,40249,40249,
+40284,40302,40359,40359,40435,40435,40397,40364,
+40232,40232,40212,40212,40306,40338,40399,40399,
+40432,40432,40421,40408,40358,40358,40320,40320,
+40304,40297,40272,40272,40248,40248,40251,40256,
+40275,40275,40294,40294,40304,40304,40295,40295,
+40349,40349,40332,40316,40257,40257,40185,40185,
+40133,40119,40099,40099,40121,40121,40127,40126,
+40114,40114,40163,40163,40256,40282,40321,40321,
+40299,40299,40293,40293,40300,40300,40293,40293,
+40267,40263,40268,40268,40301,40301,40308,40308,
+40299,40299,40279,40279,40262,40253,40223,40223,
+40179,40179,40178,40181,40195,40195,40179,40179,
+40140,40126,40091,40091,40068,40068,40051,40045,
+40024,40024,40017,40017,40025,40031,40054,40054,
+40100,40100,40141,40160,40207,40207,40261,40261,
+40299,40301,40280,40280,40186,40186,40147,40140,
+40143,40143,40106,40106,40027,40001,39948,39948,
+39932,39932,39924,39922,39915,39915,39893,39893,
+39862,39849,39816,39816,39781,39781,39747,39733,
+39695,39695,39656,39656,39624,39610,39574,39574,
+39529,39529,39486,39468,39424,39424,39353,39353,
+39276,39247,39180,39180,39109,39109,39054,39034,
+38986,38986,38925,38925,38867,38844,38787,38787,
+38716,38716,38671,38657,38632,38632,38569,38569,
+38494,38476,38462,38462,38529,38529,38495,38461,
+38322,38322,38191,38191,38120,38086,37987,37987,
+37840,37840,37747,37715,37650,37650,37517,37517,
+37368,37314,37194,37194,37074,37074,37057,37067,
+37134,37134,37113,37113,37015,36984,36928,36928,
+36906,36906,36927,36948,37032,37032,37111,37111,
+37146,37161,37197,37197,37232,37232,37306,37348,
+37483,37483,37629,37629,37697,37706,37679,37679,
+37558,37558,37567,34908,32544,28745,29650,29650,
+30073,29714,28507,30138,32910,33315,34564,35462,
+35558,37095,39063,39145,39329,39156,39033,38851,
+39161,39382,39241,39496,39498,39473,39682,39183,
+38822,38582,38651,38856,38654,37875,38437,38444,
+38570,38466,38298,38231,38135,37833,37724,37825,
+37786,37790,37439,36984,37025,37012,37221,36958,
+36455,36715,37152,38031,38635,38532,38259,38688,
+39031,39767,39841,39841,39949,39984,40049,40049,
+40060,40060,40021,39999,39927,39927,39848,39848,
+39790,39764,39692,39692,39586,39586,39489,39450,
+39351,39351,39269,39269,39203,39177,39115,39115,
+39087,39087,39021,38986,38875,38875,38766,38766,
+38675,38634,38520,38520,38380,38380,38319,38303,
+38290,38290,38255,38255,38209,38186,38122,38122,
+38028,38028,37949,37917,37834,37834,37799,37799,
+37824,37826,37810,37810,37743,37743,37680,37654,
+37585,37585,37539,37539,37534,37528,37504,37504,
+37457,37457,37429,37422,37412,37412,37374,37374,
+37308,37283,37221,37221,37148,37148,37084,37054,
+36968,36968,36824,36824,36674,36622,36511,36511,
+40443,40926,41003,41208,43429,43837,43870,44037,
+43694,41561,41290,41096,41050,41051,41078,40935,
+40943,41027,41152,41333,41637,41801,41719,41564,
+41286,41358,41734,41505,42351,42878,43216,42862,
+41918,41126,41196,41737,41792,41666,41318,41252,
+40966,41372,42960,44139,44111,44723,44156,44325,
+45611,45010,40973,40976,40987,40987,41048,41048,
+41130,41161,41234,41234,41311,41311,41321,41301,
+44132,44000,42936,43424,43318,43036,42135,42380,
+40761,40671,41123,40503,40494,40494,40490,40490,
+40501,40507,40529,40529,40563,40563,40531,40507,
+40421,40421,40317,40317,40230,40205,40166,40166,
+40174,40174,40169,40162,40137,40137,40112,40112,
+40108,40109,40119,40119,40134,40134,40149,40155,
+40166,40166,40137,40137,40088,40069,40022,40022,
+39966,39966,39907,39882,39816,39816,39799,39799,
+39840,39859,39917,39917,40004,40004,40059,40076,
+40107,40107,40113,40113,40088,40076,40046,40046,
+40010,40010,39986,39977,39959,39959,39896,39896,
+39809,39780,39719,39719,39683,39683,39676,39676,
+39687,39687,39667,39667,39622,39609,39591,39591,
+39597,39597,39549,39519,39423,39423,39367,39367,
+39371,39375,39390,39390,39413,39413,39452,39471,
+39528,39528,39562,39562,39568,39579,39625,39625,
+39729,39729,39812,39842,39914,39914,40051,40051,
+40195,40231,40265,40265,40205,40205,40258,40299,
+40445,40445,40609,40609,40733,40780,40890,40890,
+40984,40984,41020,41022,40996,42782,44535,45516,
+45761,46027,45725,45580,44941,44836,44542,43838,
+44035,44188,43672,43376,43401,43705,43750,43818,
+43713,43655,43847,43716,44049,44150,44068,44121,
+44390,43341,43247,43402,43571,43446,43326,43645,
+43522,43398,43448,43291,43168,42342,42159,41905,
+40637,39530,38687,38750,40622,40622,40567,40567,
+40561,40552,40516,40516,40461,40461,40461,40467,
+40500,40500,40490,40490,40435,40408,40327,40327,
+40216,40216,40206,40216,40281,40281,40323,40323,
+40335,40344,40381,40381,40439,40439,40390,40353,
+40217,40217,40206,40206,40319,40357,40432,40432,
+40476,40476,40469,40458,40409,40409,40369,40369,
+40346,40337,40311,40311,40291,40291,40296,40299,
+40316,40316,40329,40390,40091,40333,40336,40336,
+40506,40506,40505,40491,40428,40428,40348,40348,
+40283,40265,40239,40239,40259,40259,40260,40257,
+40242,40242,40282,40282,40364,40390,40438,40438,
+40450,40450,40452,40452,40453,40453,40449,40449,
+40435,40432,40433,40433,40447,40447,40453,40454,
+40454,40454,40433,40433,40405,40393,40361,40361,
+40329,40329,40338,40344,40370,40370,40368,40368,
+40344,40333,40296,40296,40245,40245,40212,40200,
+40174,40174,40173,40173,40194,40204,40230,40230,
+40267,40267,40292,40300,40322,40322,40371,40371,
+40421,40424,40394,40394,40277,40277,40230,40223,
+40234,40234,40219,40219,40166,40145,40098,40098,
+40062,40062,40038,40029,40007,40007,39966,39966,
+39914,39894,39847,39847,39804,39804,39775,39764,
+39740,39740,39691,39691,39629,39606,39560,39560,
+39525,39525,39489,39473,39429,39429,39359,39359,
+39282,39252,39179,39179,39099,39099,39040,39016,
+38964,38964,38902,38902,38845,38824,38771,38771,
+38715,38715,38672,38656,38619,38619,38542,38542,
+38449,38424,38389,38389,38436,38436,38419,38397,
+38304,38304,38174,38174,38055,38007,37883,37883,
+37738,37738,37656,37631,37585,37585,37458,37458,
+37295,37240,37128,37128,37047,37047,37030,37034,
+37068,37068,37058,37058,37008,36995,36975,36975,
+36988,36988,37048,37084,37204,37204,37310,37310,
+37348,37361,37385,37385,37382,37382,37415,37440,
+37533,37533,37562,37562,37508,37487,37434,37434,
+37453,37453,35883,34283,30904,28533,29784,29900,
+30004,29714,29617,31163,31999,32170,33521,35844,
+36733,37745,39002,39036,39147,39032,38979,38810,
+38876,38964,39136,39127,39471,39604,39431,39275,
+38937,39002,38882,38567,38295,38397,38433,38248,
+38204,38087,38060,38102,37948,37694,37804,37680,
+37413,37444,37465,37496,37133,37089,37015,36703,
+36579,37389,37591,37708,38171,38332,38611,38759,
+39004,39523,39943,39943,40036,40067,40132,40132,
+40151,40151,40128,40113,40061,40061,39989,39989,
+39925,39896,39815,39815,39689,39689,39573,39526,
+39411,39411,39309,39309,39234,39203,39122,39122,
+39056,39056,38977,38939,38829,38829,38726,38726,
+38645,38609,38509,38509,38386,38386,38324,38306,
+38282,38282,38243,38243,38204,38185,38133,38133,
+38056,38056,37973,37937,37838,37838,37799,37799,
+37837,37841,37825,37825,37747,37747,37688,37668,
+37619,37619,37594,37594,37596,37592,37569,37569,
+37520,37520,37479,37465,37432,37432,37386,37386,
+37332,37311,37265,37265,37212,37212,37138,37100,
+36980,36980,36830,36830,36711,36674,36609,36609,
+40167,39480,40429,41254,42817,42284,44061,44158,
+42623,41345,41373,41104,41078,40948,41184,41291,
+41268,41378,41716,41882,41908,41841,41645,41274,
+41292,41987,42283,42492,42057,42219,43722,43473,
+41920,42290,43040,42017,42002,41991,41936,42353,
+42448,42525,42773,43926,44297,44551,44896,44820,
+44523,45055,44518,40965,40987,40987,41012,41012,
+41091,41126,41218,41218,41320,41320,41357,41349,
+43922,44279,44070,43673,44113,44348,43584,42963,
+41934,40440,41008,40563,40552,40552,40556,40556,
+40584,40591,40605,40605,40595,40595,40546,40520,
+40440,40440,40352,40352,40284,40264,40231,40231,
+40232,40232,40235,40235,40234,40234,40216,40216,
+40201,40199,40206,40206,40234,40234,40261,40271,
+40298,40298,40279,40279,40230,40208,40148,40148,
+40057,40057,40008,39993,39967,39967,39976,39976,
+40023,40045,40105,40105,40188,40188,40235,40248,
+40267,40267,40277,40277,40271,40265,40242,40242,
+40194,40194,40153,40137,40098,40098,40032,40032,
+39955,39928,39877,39877,39852,39852,39849,39851,
+39864,39864,39841,39841,39785,39767,39739,39739,
+39739,39739,39702,39681,39616,39616,39572,39572,
+39569,39570,39582,39582,39607,39607,39662,39689,
+39771,39771,39794,39794,39758,39756,39776,39776,
+39867,39867,39954,39990,40084,40084,40216,40216,
+40336,40364,40387,40387,40321,40321,40378,40420,
+40573,40573,40714,40714,40789,40820,40896,40896,
+40997,40997,41072,41083,42896,42558,44945,45674,
+45665,45696,45391,45056,44898,44536,44062,43804,
+43983,44296,43760,43579,43580,44089,44124,43945,
+43883,44589,44038,43752,43757,43672,43542,43686,
+43739,43504,43549,43103,42777,42910,43230,43415,
+43561,43636,43404,42961,42517,42256,41995,41611,
+40305,39314,38030,38100,40653,40653,40633,40633,
+40588,40569,40525,40525,40504,40504,40507,40508,
+40515,40515,40528,40528,40539,40534,40501,40501,
+40423,40423,40413,40420,40465,40465,40493,40493,
+40496,40497,40500,40500,40500,40500,40444,40414,
+40316,40316,40335,40335,40459,40498,40572,40572,
+40604,40604,40594,40584,40537,40537,40501,40501,
+40480,40471,40447,40447,40423,40423,40416,40413,
+40410,40410,40462,40011,39711,40424,40447,40447,
+40506,40506,40505,40491,40428,40428,40348,40348,
+40283,40265,40239,40239,40259,40259,40260,40257,
+40242,40242,40282,40282,40364,40390,40438,40438,
+40450,40450,40452,40452,40453,40453,40449,40449,
+40435,40432,40433,40433,40447,40447,40453,40454,
+40454,40454,40433,40433,40405,40393,40361,40361,
+40329,40329,40338,40344,40370,40370,40368,40368,
+40344,40333,40296,40296,40245,40245,40212,40200,
+40174,40174,40173,40173,40194,40204,40230,40230,
+40267,40267,40292,40300,40322,40322,40371,40371,
+40421,40424,40394,40394,40277,40277,40230,40223,
+40234,40234,40219,40219,40166,40145,40098,40098,
+40062,40062,40038,40029,40007,40007,39966,39966,
+39914,39894,39847,39847,39804,39804,39775,39764,
+39740,39740,39691,39691,39629,39606,39560,39560,
+39525,39525,39489,39473,39429,39429,39359,39359,
+39282,39252,39179,39179,39099,39099,39040,39016,
+38964,38964,38902,38902,38845,38824,38771,38771,
+38715,38715,38672,38656,38619,38619,38542,38542,
+38449,38424,38389,38389,38436,38436,38419,38397,
+38304,38304,38174,38174,38055,38007,37883,37883,
+37738,37738,37656,37631,37585,37585,37458,37458,
+37295,37240,37128,37128,37047,37047,37030,37034,
+37068,37068,37058,37058,37008,36995,36975,36975,
+36988,36988,37048,37084,37204,37204,37310,37310,
+37348,37361,37385,37385,37382,37382,37415,37440,
+37533,37533,37562,37562,37508,37487,37434,37434,
+37453,35630,34982,31692,28951,28738,30039,30015,
+29974,30311,30455,31524,32117,33543,35348,37257,
+38104,38442,38904,38985,39037,38910,38936,38900,
+38881,39094,39466,39457,39614,39544,39126,39214,
+38965,38996,38771,38321,38248,38390,38332,38080,
+37784,37508,37813,37965,38024,37509,37460,37785,
+37390,37576,37620,37733,37450,37371,37420,37286,
+36999,37721,37807,37844,37698,37952,38525,38639,
+38948,39432,39943,39943,40036,40067,40132,40132,
+40151,40151,40128,40113,40061,40061,39989,39989,
+39925,39896,39815,39815,39689,39689,39573,39526,
+39411,39411,39309,39309,39234,39203,39122,39122,
+39056,39056,38977,38939,38829,38829,38726,38726,
+38645,38609,38509,38509,38386,38386,38324,38306,
+38282,38282,38243,38243,38204,38185,38133,38133,
+38056,38056,37973,37937,37838,37838,37799,37799,
+37837,37841,37825,37825,37747,37747,37688,37668,
+37619,37619,37594,37594,37596,37592,37569,37569,
+37520,37520,37479,37465,37432,37432,37386,37386,
+37332,37311,37265,37265,37212,37212,37138,37100,
+36980,36980,36830,36830,36711,36674,36609,36609,
+43219,41068,39857,40484,41860,42058,43127,42529,
+41380,41477,41681,41595,41494,41466,41460,41627,
+41786,41887,42203,41918,41844,41518,41677,41377,
+41423,41885,42641,41397,41158,41581,43828,43609,
+42950,42457,42939,42247,42046,42017,42563,43039,
+43010,43015,43542,43784,44173,44511,44344,44282,
+43761,43590,44071,40965,40987,40987,41012,41012,
+41091,41126,41218,41218,41320,41320,41357,41349,
+44065,44144,44125,43623,44301,45022,44594,43672,
+42294,41110,40968,40563,40552,40552,40556,40556,
+40584,40591,40605,40605,40595,40595,40546,40520,
+40440,40440,40352,40352,40284,40264,40231,40231,
+40232,40232,40235,40235,40234,40234,40216,40216,
+40201,40199,40206,40206,40234,40234,40261,40271,
+40298,40298,40279,40279,40230,40208,40148,40148,
+40057,40057,40008,39993,39967,39967,39976,39976,
+40023,40045,40105,40105,40188,40188,40235,40248,
+40267,40267,40277,40277,40271,40265,40242,40242,
+40194,40194,40153,40137,40098,40098,40032,40032,
+39955,39928,39877,39877,39852,39852,39849,39851,
+39864,39864,39841,39841,39785,39767,39739,39739,
+39739,39739,39702,39681,39616,39616,39572,39572,
+39569,39570,39582,39582,39607,39607,39662,39689,
+39771,39771,39794,39794,39758,39756,39776,39776,
+39867,39867,39954,39990,40084,40084,40216,40216,
+40336,40364,40387,40387,40321,40321,40378,40420,
+40573,40573,40714,40714,40789,40820,40896,40896,
+40997,40997,41072,41083,43147,43467,44901,45068,
+45206,45171,44804,44373,44769,44252,43813,43578,
+43919,44221,43799,43727,43581,44375,44628,44213,
+43945,43992,43850,43705,43496,43158,42428,42375,
+42483,42961,43130,43150,42583,42424,42408,40458,
+40456,40456,43391,42902,42584,42161,41742,40378,
+39957,39348,37913,37931,40653,40653,40633,40633,
+40588,40569,40525,40525,40504,40504,40507,40508,
+40515,40515,40528,40528,40539,40534,40501,40501,
+40423,40423,40413,40420,40465,40465,40493,40493,
+40496,40497,40500,40500,40500,40500,40444,40414,
+40316,40316,40335,40335,40459,40498,40572,40572,
+40604,40604,40594,40584,40537,40537,40501,40501,
+40480,40471,40447,40447,40423,40423,40416,40413,
+40410,40410,40410,40410,40337,40424,40447,40447,
+40612,40612,40616,40611,40581,40581,40529,40529,
+40469,40451,40414,40414,40398,40398,40387,40383,
+40374,40374,40395,40395,40443,40463,40508,40508,
+40553,40553,40572,40577,40587,40587,40600,40600,
+40603,40601,40590,40590,40561,40561,40549,40547,
+40549,40549,40531,40531,40497,40487,40468,40468,
+40469,40469,40494,40505,40537,40537,40550,40550,
+40548,40543,40520,40520,40471,40471,40447,40441,
+40433,40433,40438,40438,40452,40455,40456,40456,
+40446,40446,40423,40411,40378,40378,40398,40398,
+40449,40454,40430,40430,40330,40330,40282,40270,
+40263,40263,40257,40257,40235,40225,40196,40196,
+40163,40163,40132,40119,40085,40085,40005,40005,
+39906,39873,39805,39805,39767,39767,39748,39743,
+39738,39738,39701,39701,39641,39622,39583,39583,
+39566,39566,39523,39502,39432,39432,39344,39344,
+39263,39236,39179,39179,39145,39145,39079,39044,
+38939,38939,38863,38863,38831,38815,38765,38765,
+38688,38688,38634,38614,38565,38565,38484,38484,
+38397,38370,38316,38316,38304,38304,38276,38257,
+38194,38194,38077,38077,37947,37896,37772,37772,
+37640,37640,37573,37554,37528,37528,37432,37432,
+37295,37254,37189,37189,37198,37198,37164,37141,
+37063,37063,37043,37043,37087,37100,37127,37127,
+37139,37139,37215,37259,37408,37408,37514,37514,
+37519,37516,37495,37495,37407,37407,37378,37383,
+37443,37443,37442,37442,37400,37382,37336,35873,
+34169,32466,30468,27286,28114,29321,29776,29924,
+30165,33049,32783,32874,37055,38673,38918,38603,
+38591,38521,38588,38531,38519,38344,38425,38720,
+39109,39362,39515,39341,39135,39040,38946,38884,
+38598,38741,38793,38763,38212,38261,38424,38229,
+38188,38238,37803,37617,37535,37380,37305,37283,
+37443,37447,37467,37315,37570,37584,37371,37252,
+37424,37139,37388,38021,37886,37848,37999,37993,
+38521,39200,40094,40094,40156,40179,40237,40237,
+40244,40244,40222,40210,40171,40171,40095,40095,
+40020,39988,39901,39901,39774,39774,39669,39629,
+39531,39531,39408,39408,39280,39231,39117,39117,
+39032,39032,38954,38921,38831,38831,38738,38738,
+38665,38634,38558,38558,38471,38471,38408,38384,
+38329,38329,38277,38277,38243,38228,38186,38186,
+38123,38123,38045,38009,37911,37911,37848,37848,
+37842,37833,37792,37792,37702,37702,37677,37678,
+37707,37707,37716,37716,37693,37681,37649,37649,
+37610,37610,37565,37546,37492,37492,37436,37436,
+37386,37372,37347,37347,37345,37345,37273,37229,
+37080,37080,36886,36886,36714,36661,36569,36569,
+43732,40918,40025,40654,40939,41015,41266,41179,
+41183,40942,40954,41257,41508,41767,41791,42102,
+41948,41698,40677,41631,41351,42346,42170,41593,
+41940,41378,41333,41347,41299,41178,41757,42455,
+43091,43369,42040,41609,42091,42311,42686,42995,
+43448,43792,44597,44688,44688,44632,44309,43734,
+42872,43140,43731,43330,43199,43232,43438,40986,
+41048,41079,41174,41174,41261,41261,41288,41283,
+41231,44028,44437,44499,44362,44134,44934,44686,
+41879,40487,40665,40699,40647,40647,40681,40681,
+40717,40720,40696,40696,40591,40591,40520,40498,
+40451,40451,40410,40410,40388,40377,40344,40344,
+40292,40292,40285,40287,40304,40304,40285,40285,
+40243,40237,40249,40249,40323,40323,40378,40397,
+40441,40441,40455,40455,40438,40422,40356,40356,
+40211,40211,40164,40161,40191,40191,40216,40216,
+40234,40243,40270,40270,40305,40305,40328,40336,
+40350,40350,40360,40360,40364,40363,40353,40353,
+40326,40326,40278,40256,40192,40192,40120,40120,
+40060,40044,40021,40021,40044,40044,40045,40042,
+40026,40026,39990,39990,39941,39925,39891,39891,
+39869,39869,39853,39848,39840,39840,39826,39826,
+39816,39816,39824,39824,39851,39851,39905,39930,
+40005,40005,40030,40030,40007,40005,40018,40018,
+40071,40071,40132,40160,40236,40236,40342,40342,
+40436,40460,40482,40482,40444,40444,40501,40539,
+40671,40671,40789,40789,40847,40876,40961,40961,
+41099,41099,41181,41205,41241,41241,41280,43132,
+43536,44354,44251,43635,43609,43543,43365,43518,
+43733,44173,44038,43837,43793,43980,44485,44274,
+43814,43814,43726,43583,42924,42215,40780,40197,
+40312,40882,41443,41714,40605,40605,40645,40654,
+40661,40661,43087,43266,43525,42727,42234,42055,
+40542,39399,38489,40733,40716,40716,40643,40643,
+40501,40466,40431,40431,40555,40555,40585,40578,
+40515,40515,40554,40554,40677,40708,40734,40734,
+40656,40656,40615,40604,40591,40591,40620,40620,
+40679,40691,40693,40693,40618,40618,40584,40577,
+40579,40579,40633,40633,40716,40739,40764,40764,
+40733,40733,40702,40688,40648,40648,40630,40630,
+40638,40636,40617,40617,40562,40562,40525,40510,
+40473,40473,40478,40478,40522,39880,39634,40574,
+40612,40612,40616,40611,40581,40581,40529,40529,
+40469,40451,40414,40414,40398,40398,40387,40383,
+40374,40374,40395,40395,40443,40463,40508,40508,
+40553,40553,40572,40577,40587,40587,40600,40600,
+40603,40601,40590,40590,40561,40561,40549,40547,
+40549,40549,40531,40531,40497,40487,40468,40468,
+40469,40469,40494,40505,40537,40537,40550,40550,
+40548,40543,40520,40520,40471,40471,40447,40441,
+40433,40433,40438,40438,40452,40455,40456,40456,
+40446,40446,40423,40411,40378,40378,40398,40398,
+40449,40454,40430,40430,40330,40330,40282,40270,
+40263,40263,40257,40257,40235,40225,40196,40196,
+40163,40163,40132,40119,40085,40085,40005,40005,
+39906,39873,39805,39805,39767,39767,39748,39743,
+39738,39738,39701,39701,39641,39622,39583,39583,
+39566,39566,39523,39502,39432,39432,39344,39344,
+39263,39236,39179,39179,39145,39145,39079,39044,
+38939,38939,38863,38863,38831,38815,38765,38765,
+38688,38688,38634,38614,38565,38565,38484,38484,
+38397,38370,38316,38316,38304,38304,38276,38257,
+38194,38194,38077,38077,37947,37896,37772,37772,
+37640,37640,37573,37554,37528,37528,37432,37432,
+37295,37254,37189,37189,37198,37198,37164,37141,
+37063,37063,37043,37043,37087,37100,37127,37127,
+37139,37139,37215,37259,37408,37408,37514,37514,
+37519,37516,37495,37495,37407,37407,37378,37383,
+37443,37443,37442,37442,37400,35458,35485,35554,
+31843,30019,28235,27318,29259,30016,29563,28902,
+30915,35510,35365,35613,38243,38679,38602,38515,
+38495,38488,38337,38266,38378,38213,38360,38786,
+38788,38845,39224,39282,39213,38994,38931,38886,
+38674,38517,38536,38663,38174,38208,38530,38433,
+38495,38327,37650,37667,37281,37152,37145,37134,
+37318,37487,37296,37086,37102,37341,37352,37264,
+37770,37231,37339,37552,37660,37563,37756,38007,
+38516,39100,40094,40094,40156,40179,40237,40237,
+40244,40244,40222,40210,40171,40171,40095,40095,
+40020,39988,39901,39901,39774,39774,39669,39629,
+39531,39531,39408,39408,39280,39231,39117,39117,
+39032,39032,38954,38921,38831,38831,38738,38738,
+38665,38634,38558,38558,38471,38471,38408,38384,
+38329,38329,38277,38277,38243,38228,38186,38186,
+38123,38123,38045,38009,37911,37911,37848,37848,
+37842,37833,37792,37792,37702,37702,37677,37678,
+37707,37707,37716,37716,37693,37681,37649,37649,
+37610,37610,37565,37546,37492,37492,37436,37436,
+37386,37372,37347,37347,37345,37345,37273,37229,
+37080,37080,36886,36886,36714,36661,36569,36569,
+44161,41021,40869,39628,40446,41015,41190,41060,
+41101,41028,40936,40964,41340,41478,41441,41615,
+41420,41372,41636,42173,42422,42302,41745,41366,
+41044,40990,40954,41475,41533,41880,41494,41653,
+41211,44317,43981,43484,43612,43820,43844,43668,
+43808,43940,44657,44786,44745,44025,43267,42741,
+42215,42491,43066,43469,43029,43451,43502,43707,
+41048,41079,41174,41174,41261,41261,41288,41283,
+41231,43469,44050,44758,44439,43976,44443,44951,
+42533,40764,40430,40699,40647,40647,40681,40681,
+40717,40720,40696,40696,40591,40591,40520,40498,
+40451,40451,40410,40410,40388,40377,40344,40344,
+40292,40292,40285,40287,40304,40304,40285,40285,
+40243,40237,40249,40249,40323,40323,40378,40397,
+40441,40441,40455,40455,40438,40422,40356,40356,
+40211,40211,40164,40161,40191,40191,40216,40216,
+40234,40243,40270,40270,40305,40305,40328,40336,
+40350,40350,40360,40360,40364,40363,40353,40353,
+40326,40326,40278,40256,40192,40192,40120,40120,
+40060,40044,40021,40021,40044,40044,40045,40042,
+40026,40026,39990,39990,39941,39925,39891,39891,
+39869,39869,39853,39848,39840,39840,39826,39826,
+39816,39816,39824,39824,39851,39851,39905,39930,
+40005,40005,40030,40030,40007,40005,40018,40018,
+40071,40071,40132,40160,40236,40236,40342,40342,
+40436,40460,40482,40482,40444,40444,40501,40539,
+40671,40671,40789,40789,40847,40876,40961,40961,
+41099,41099,41181,41205,41241,41241,41280,41280,
+41271,43910,43877,43205,42862,43322,43535,43597,
+43728,43833,44135,43899,43748,43978,44355,44433,
+43718,43747,43771,43378,42750,42060,40188,39926,
+40129,40577,40933,41325,40605,40605,40645,40654,
+40661,40661,42855,43284,43237,42654,41175,40115,
+40551,39366,38461,40733,40716,40716,40643,40643,
+40501,40466,40431,40431,40555,40555,40585,40578,
+40515,40515,40554,40554,40677,40708,40734,40734,
+40656,40656,40615,40604,40591,40591,40620,40620,
+40679,40691,40693,40693,40618,40618,40584,40577,
+40579,40579,40633,40633,40716,40739,40764,39058,
+40733,40733,40702,40688,40648,40648,40630,40630,
+40638,40636,40617,40617,40562,40562,40525,40510,
+40473,40473,40478,40478,40522,40539,40574,40065,
+40712,40712,40727,40725,40699,40699,40651,40651,
+40596,40578,40541,40541,40519,40519,40507,40503,
+40497,40497,40513,40513,40551,40567,40607,40607,
+40650,40650,40665,40668,40672,40672,40677,40677,
+40674,40670,40653,40653,40624,40624,40609,40605,
+40602,40602,40587,40587,40564,40557,40549,40549,
+40559,40559,40585,40595,40629,40629,40645,40645,
+40648,40646,40632,40632,40593,40593,40575,40571,
+40569,40569,40573,40573,40581,40582,40576,40576,
+40552,40552,40512,40495,40442,40442,40444,40444,
+40481,40483,40457,40457,40367,40367,40314,40299,
+40275,40275,40264,40264,40259,40253,40227,40227,
+40177,40177,40139,40124,40086,40086,40000,40000,
+39899,39866,39801,39801,39767,39767,39752,39747,
+39742,39742,39706,39706,39648,39630,39591,39591,
+39574,39574,39524,39497,39414,39414,39322,39322,
+39248,39221,39168,39168,39134,39134,39066,39030,
+38920,38920,38841,38841,38810,38796,38754,38754,
+38697,38697,38647,38626,38566,38566,38473,38473,
+38380,38348,38283,38283,38250,38250,38207,38183,
+38113,38113,38004,38004,37892,37847,37737,37737,
+37612,37612,37541,37520,37485,37485,37410,37410,
+37313,37286,37250,37250,37280,37280,37238,37208,
+37100,37100,37080,37080,37151,37175,37225,37225,
+37256,37256,37335,37379,37521,37521,37622,37622,
+37617,37606,37557,37557,37425,37425,37364,37359,
+37397,37397,37405,37405,35320,33611,33308,33085,
+29464,27838,27466,28996,35890,35831,30004,30714,
+33150,35974,35798,36241,38257,38174,38296,38733,
+38517,38493,38274,38378,38587,38362,38527,38910,
+38524,38732,38834,39114,39077,39032,38758,38902,
+38908,38279,38419,38310,38061,38164,38474,38739,
+38738,38520,37943,37658,37188,37054,36954,36783,
+36836,36962,36957,36953,36977,37287,37724,37448,
+37923,37649,37295,37319,37123,37198,37306,38034,
+38495,38855,40156,40156,40201,40221,40277,40277,
+40296,40296,40280,40268,40228,40228,40147,40147,
+40061,40025,39932,39932,39804,39804,39702,39663,
+39570,39570,39448,39448,39316,39266,39149,39149,
+39056,39056,38981,38950,38867,38867,38782,38782,
+38716,38690,38622,38622,38538,38538,38470,38443,
+38379,38379,38324,38324,38294,38280,38242,38242,
+38179,38179,38102,38068,37973,37973,37900,37900,
+37876,37862,37820,37820,37743,37743,37732,37738,
+37781,37781,37793,37793,37758,37744,37705,37705,
+37665,37665,37612,37588,37520,37520,37467,37467,
+37443,37438,37434,37434,37455,37455,37404,37369,
+37246,37246,37087,37087,36933,36887,36810,36810,
+43348,41199,41461,39437,40418,41057,41185,40977,
+40613,40749,40882,41037,41032,41545,41484,41663,
+41364,41446,42226,42463,42496,42102,41669,41250,
+40638,40751,41135,41335,41597,41597,41797,41206,
+40455,43864,44377,44007,44317,44474,45199,44509,
+44539,44278,44715,43753,44484,43126,41639,41132,
+42754,42321,42402,42423,42358,42727,44252,43558,
+43322,41050,41128,41128,41226,41226,41257,41258,
+41234,41234,41211,44079,45041,44496,44345,44104,
+43114,42670,41001,40725,40698,40698,40732,40732,
+40769,40770,40737,40737,40611,40611,40534,40510,
+40470,40470,40438,40438,40424,40416,40385,40385,
+40332,40332,40327,40332,40361,40361,40352,40352,
+40318,40312,40321,40321,40382,40382,40433,40454,
+40503,40503,40537,40537,40549,40542,40489,40489,
+40341,40341,40296,40293,40324,40324,40341,40341,
+40341,40344,40356,40356,40379,40379,40394,40400,
+40413,40413,40420,40420,40420,40418,40405,40405,
+40372,40372,40325,40303,40241,40241,40175,40175,
+40126,40114,40105,40105,40147,40147,40149,40143,
+40112,40112,40065,40065,40015,40001,39976,39976,
+39979,39979,39979,39979,39980,39980,39978,39978,
+39976,39978,39989,39989,40011,40011,40055,40077,
+40140,40140,40169,40169,40159,40163,40187,40187,
+40250,40250,40301,40323,40376,40376,40461,40461,
+40547,40568,40590,40590,40552,40552,40597,40628,
+40734,40734,40845,40845,40915,40946,41034,41034,
+41163,41163,41223,41237,41248,41248,41256,41256,
+41251,43143,43318,42797,42714,43043,43397,43417,
+43189,42133,42313,43484,43267,44125,44066,44043,
+43770,43707,43818,43072,42283,42229,40327,40187,
+40409,40518,40733,40733,40736,40736,40781,40798,
+40836,40836,40840,43413,42900,41327,41448,39649,
+40953,39943,39097,40754,40743,40743,40659,40659,
+40507,40468,40428,40428,40547,40547,40589,40590,
+40557,40557,40606,40606,40716,40746,40782,40782,
+40744,40744,40716,40706,40686,40686,40716,40716,
+40779,40792,40790,40790,40703,40703,40680,40683,
+40720,40720,40779,40779,40834,40846,40855,40855,
+40813,40813,40784,40771,40739,40739,40716,40716,
+40713,40708,40688,40688,40645,40645,40610,40594,
+40553,40553,40548,40548,40583,40599,40644,40644,
+40758,40758,40781,40780,40754,40754,40707,40707,
+40654,40636,40599,40599,40576,40576,40563,40559,
+40554,40554,40569,40569,40604,40618,40656,40656,
+40696,40696,40708,40710,40711,40711,40712,40712,
+40705,40700,40681,40681,40653,40653,40637,40633,
+40627,40627,40612,40612,40594,40591,40587,40587,
+40600,40600,40626,40637,40670,40670,40687,40687,
+40692,40691,40680,40680,40647,40647,40632,40629,
+40629,40629,40632,40632,40636,40635,40628,40628,
+40599,40599,40553,40533,40473,40473,40466,40466,
+40497,40497,40469,40469,40383,40383,40330,40312,
+40281,40281,40268,40268,40270,40265,40240,40240,
+40181,40181,40139,40123,40083,40083,39997,39997,
+39896,39864,39801,39801,39768,39768,39754,39750,
+39744,39744,39709,39709,39652,39632,39595,39595,
+39577,39577,39522,39494,39404,39404,39310,39310,
+39240,39215,39161,39161,39128,39128,39058,39022,
+38912,38912,38833,38833,38801,38787,38748,38748,
+38703,38703,38656,38633,38569,38569,38470,38470,
+38373,38340,38269,38269,38227,38227,38175,38151,
+38076,38076,37969,37969,37869,37828,37723,37723,
+37602,37602,37528,37506,37465,37465,37398,37398,
+37323,37302,37278,37278,37316,37316,37271,37239,
+37121,37121,37099,37099,37181,37210,37269,37269,
+37309,37309,37390,37434,37571,37571,37670,37670,
+37661,37647,37588,37588,37436,37436,37362,37352,
+37381,37381,35594,32674,30942,29806,28435,27431,
+27422,28165,27479,29881,30037,30194,33075,35437,
+36618,36743,36468,37026,38132,38567,38873,38514,
+38505,38622,38479,38530,38483,38608,38576,38533,
+38446,38200,37931,38459,38832,38765,38432,38472,
+38554,38222,38182,37879,37783,37792,37896,38401,
+38400,38211,37757,37296,37156,37093,36933,36587,
+36402,36632,36537,36421,36518,36682,37382,37461,
+37849,37828,37254,37091,36820,37019,36981,38020,
+38569,39102,40182,40182,40219,40238,40294,40294,
+40320,40320,40306,40295,40254,40254,40170,40170,
+40079,40042,39946,39946,39817,39817,39716,39676,
+39587,39587,39465,39465,39334,39284,39166,39166,
+39071,39071,38997,38966,38886,38886,38804,38804,
+38744,38718,38654,38654,38570,38570,38499,38471,
+38402,38402,38346,38346,38319,38305,38268,38268,
+38205,38205,38129,38095,38003,38003,37925,37925,
+37893,37879,37837,37837,37766,37766,37761,37769,
+37817,37817,37828,37828,37789,37772,37730,37730,
+37690,37690,37632,37607,37532,37532,37482,37482,
+37471,37470,37476,37476,37507,37507,37466,37436,
+37327,37327,37187,37187,37045,37003,36932,36932,
+43701,43173,40514,38799,39856,40446,40828,40631,
+40268,40226,40286,40046,40037,40535,40953,40757,
+40570,41083,42068,42519,42463,41999,41177,41037,
+40896,40762,41129,41465,41691,41519,42062,42629,
+42528,42539,42615,43465,43434,42287,42586,42674,
+43630,43998,44243,42254,41192,42478,42786,43195,
+42766,42397,40785,41476,42075,41883,43363,43479,
+43314,41036,41105,41105,41211,41211,41244,41248,
+41235,41235,41214,41214,41174,41156,43939,44152,
+43586,43211,40892,41757,42004,40719,40754,40754,
+40790,40790,40754,40754,40622,40622,40542,40518,
+40479,40479,40450,40450,40439,40431,40403,40403,
+40350,40350,40348,40354,40387,40387,40385,40385,
+40355,40350,40356,40356,40409,40409,40458,40477,
+40528,40528,40571,40571,40598,40594,40549,40549,
+40403,40403,40358,40354,40383,40383,40395,40395,
+40388,40388,40394,40394,40413,40413,40425,40430,
+40442,40442,40448,40448,40445,40442,40426,40426,
+40390,40390,40344,40323,40262,40262,40200,40200,
+40155,40146,40144,40144,40194,40194,40195,40188,
+40151,40151,40099,40099,40049,40034,40014,40014,
+40031,40031,40039,40041,40045,40045,40047,40047,
+40049,40052,40064,40064,40084,40084,40124,40143,
+40201,40201,40231,40231,40228,40234,40265,40265,
+40334,40334,40382,40400,40442,40442,40516,40516,
+40600,40621,40641,40641,40604,40604,40642,40669,
+40762,40762,40871,40871,40946,40979,41068,41068,
+41192,41192,41241,41250,41249,41249,41244,41244,
+41240,41232,42834,41906,41890,42942,43060,42921,
+41968,41962,41644,41724,42165,42571,43355,43547,
+43760,43711,43699,43068,42632,42560,41194,40772,
+40835,40818,40799,40799,40799,40799,40845,40865,
+40918,40918,40921,42019,41434,41804,41564,41614,
+41138,40305,39913,40764,40756,40756,40668,40668,
+40514,40474,40430,40430,40540,40540,40587,40592,
+40579,40579,40632,40632,40730,40757,40797,40797,
+40779,40779,40758,40751,40730,40730,40760,40760,
+40824,40837,40834,40834,40743,40743,40726,40733,
+40785,40785,40843,40843,40885,39020,40895,40895,
+40850,40850,40823,40811,40783,40783,40757,40757,
+40746,40739,40719,40719,40684,40684,40650,40635,
+40593,40593,40582,40582,40610,40626,40675,40675,
+40905,40905,40958,40959,40912,40912,40851,40851,
+40802,40787,40757,40757,40745,40745,40742,40742,
+40744,40744,40767,40767,40811,40824,40848,40848,
+40846,40846,40835,40829,40807,40807,40779,40779,
+40746,40736,40722,40722,40738,40738,40730,40723,
+40695,40695,40683,40683,40691,40695,40704,40704,
+40712,40712,40727,40736,40763,40763,40776,40776,
+40773,40771,40768,40768,40754,40754,40743,40739,
+40731,40731,40718,40718,40713,40710,40703,40703,
+40687,40687,40650,40633,40584,40584,40562,40562,
+40557,40549,40507,40507,40434,40434,40375,40351,
+40295,40295,40274,40274,40291,40288,40253,40253,
+40149,40149,40088,40067,40029,40029,39964,39964,
+39899,39878,39835,39835,39804,39804,39786,39779,
+39761,39761,39717,39717,39664,39644,39601,39601,
+39563,39563,39495,39461,39355,39355,39264,39264,
+39213,39190,39131,39131,39060,39060,38995,38966,
+38895,38895,38824,38824,38768,38753,38730,38730,
+38755,38755,38728,38707,38625,38625,38499,38499,
+38372,38330,38246,38246,38199,38199,38125,38088,
+37975,37975,37879,37879,37837,37814,37745,37745,
+37628,37628,37531,37494,37404,37404,37362,37362,
+37371,37375,37382,37382,37395,37395,37350,37322,
+37226,37226,37209,37209,37272,37300,37377,37377,
+37467,37467,37549,37587,37685,37685,37770,37770,
+37764,37748,37672,37672,37514,37514,37436,37420,
+37414,36219,34735,32305,29695,28341,27246,27258,
+28700,28707,28549,29556,28436,28856,33919,35275,
+36374,37674,38049,38087,38375,38726,38747,38677,
+38723,38651,38495,38512,38431,38424,38225,38324,
+38138,37700,37453,37998,38510,38786,38466,38444,
+38655,38293,37904,37770,37761,37632,37774,38231,
+38277,38070,37632,37260,37122,37400,37113,36695,
+36392,36946,37063,36327,36446,36641,37310,37558,
+38085,38130,37561,37275,37113,36805,37188,37649,
+38131,39012,40189,40189,40214,40231,40296,40296,
+40372,40372,40374,40364,40310,40310,40215,40215,
+40111,40069,39966,39966,39838,39838,39730,39688,
+39587,39587,39480,39480,39390,39352,39257,39257,
+39160,39160,39090,39061,38989,38989,38921,38921,
+38878,38855,38786,38786,38674,38674,38590,38558,
+38490,38490,38438,38438,38413,38399,38356,38356,
+38281,38281,38206,38174,38094,38094,38024,38024,
+37994,37983,37962,37962,37932,37932,37925,37927,
+37939,37939,37922,37922,37876,37856,37806,37806,
+37749,37749,37674,37640,37544,37544,37517,37517,
+37574,37593,37638,37638,37675,37675,37679,37674,
+37650,37650,37614,37614,37544,37524,37493,37493,
+43498,41222,39140,38924,39700,40446,40065,39789,
+39755,39565,39608,39837,39549,40138,40270,40667,
+40960,41093,41687,41857,42615,42312,42009,41901,
+40991,41081,41306,41896,41919,41438,41799,42077,
+42102,42846,43083,43488,43674,42612,41402,41994,
+42900,43631,43052,41615,40440,42144,43581,43328,
+43133,42898,42833,42590,42375,42572,42823,43221,
+43358,40967,41033,41033,41178,41178,41237,41249,
+41248,41248,41220,41220,41174,41154,41103,41103,
+44525,41575,40611,42348,42431,40743,40761,40761,
+40786,40786,40761,40761,40668,40668,40593,40567,
+40512,40512,40466,40466,40438,40428,40409,40409,
+40400,40400,40422,40435,40479,40479,40510,40510,
+40522,40521,40508,40508,40473,40473,40483,40493,
+40535,40535,40604,40604,40679,40695,40694,40694,
+40600,40600,40552,40539,40517,40517,40489,40489,
+40463,40459,40461,40461,40497,40497,40518,40525,
+40539,40539,40535,40535,40515,40504,40466,40466,
+40395,40395,40351,40337,40306,40306,40267,40267,
+40237,40232,40241,40241,40298,40298,40299,40290,
+40243,40243,40174,40174,40107,40095,40104,40104,
+40207,40207,40233,40233,40205,40205,40206,40206,
+40234,40244,40263,40263,40270,40270,40291,40303,
+40341,40341,40373,40373,40393,40410,40477,40477,
+40602,40602,40652,40661,40656,40656,40706,40706,
+40794,40814,40830,40830,40776,40776,40776,40785,
+40826,40826,40925,40925,41041,41083,41173,41173,
+41249,41249,41255,41246,41200,41200,41183,41183,
+41194,41196,42645,42456,41165,41651,43120,42754,
+41421,41421,41427,41859,41525,41353,41780,43189,
+43339,43399,43437,43010,42368,41027,41808,41018,
+41117,41124,41059,41059,41017,41017,41057,41083,
+41166,41166,41211,40902,40754,42135,41958,41878,
+41201,40293,40835,40811,40775,40775,40710,40710,
+40620,40587,40511,40511,40457,40457,40509,40549,
+40685,40685,40743,40743,40697,40689,40698,40698,
+40784,40784,40833,40846,40870,40870,40900,40900,
+40926,40929,40921,40921,40864,40864,40864,40875,
+40927,40927,40962,40962,40968,40969,40967,40967,
+40955,40955,40949,40946,40939,40939,40887,40887,
+40813,40794,40768,40768,40790,40790,40787,40781,
+40755,40755,40708,40708,40668,40671,40728,40728,
+40905,40905,40958,40959,40912,40912,40851,40851,
+40802,40787,40757,40757,40745,40745,40742,40742,
+40744,40744,40767,40767,40811,40824,40848,40848,
+40846,40846,40835,40829,40807,40807,40779,40779,
+40746,40736,40722,40722,40738,40738,40730,40723,
+40695,40695,40683,40683,40691,40695,40704,40704,
+40712,40712,40727,40736,40763,40763,40776,40776,
+40773,40771,40768,40768,40754,40754,40743,40739,
+40731,40731,40718,40718,40713,40710,40703,40703,
+40687,40687,40650,40633,40584,40584,40562,40562,
+40557,40549,40507,40507,40434,40434,40375,40351,
+40295,40295,40274,40274,40291,40288,40253,40253,
+40149,40149,40088,40067,40029,40029,39964,39964,
+39899,39878,39835,39835,39804,39804,39786,39779,
+39761,39761,39717,39717,39664,39644,39601,39601,
+39563,39563,39495,39461,39355,39355,39264,39264,
+39213,39190,39131,39131,39060,39060,38995,38966,
+38895,38895,38824,38824,38768,38753,38730,38730,
+38755,38755,38728,38707,38625,38625,38499,38499,
+38372,38330,38246,38246,38199,38199,38125,38088,
+37975,37975,37879,37879,37837,37814,37745,37745,
+37628,37628,37531,37494,37404,37404,37362,37362,
+37371,37375,37382,37382,37395,37395,37350,37322,
+37226,37226,37209,37209,37272,37300,37377,37377,
+37467,37467,37549,37587,37685,37685,37770,37770,
+37764,37748,37672,37672,37514,37514,37436,37420,
+36424,36115,31672,29569,29853,28757,28382,28670,
+29352,28833,27902,29096,28393,29745,35077,35743,
+36421,38073,38424,38409,38726,38966,38952,38853,
+38752,38576,38554,38540,38489,38300,38080,37956,
+37624,37429,37519,37902,38207,38373,38213,38282,
+38270,38045,38117,37861,37704,37642,37548,37835,
+37947,37824,37608,37510,37393,37445,37585,37443,
+36472,36852,37302,36498,36643,36868,37540,37789,
+38141,38198,37622,37162,37382,37289,37537,37354,
+37956,38788,40189,40189,40214,40231,40296,40296,
+40372,40372,40374,40364,40310,40310,40215,40215,
+40111,40069,39966,39966,39838,39838,39730,39688,
+39587,39587,39480,39480,39390,39352,39257,39257,
+39160,39160,39090,39061,38989,38989,38921,38921,
+38878,38855,38786,38786,38674,38674,38590,38558,
+38490,38490,38438,38438,38413,38399,38356,38356,
+38281,38281,38206,38174,38094,38094,38024,38024,
+37994,37983,37962,37962,37932,37932,37925,37927,
+37939,37939,37922,37922,37876,37856,37806,37806,
+37749,37749,37674,37640,37544,37544,37517,37517,
+37574,37593,37638,37638,37675,37675,37679,37674,
+37650,37650,37614,37614,37544,37524,37493,37493,
+43430,41653,39448,39451,39298,39734,39817,38995,
+38792,38906,38990,38719,39251,39455,39938,40674,
+40907,40992,41332,41853,42294,42227,42102,41855,
+41194,41137,41284,41485,41326,41549,42030,42064,
+41785,42025,42649,42237,42522,42649,41685,41285,
+42447,42910,42068,41215,40509,42746,43094,42520,
+42738,43055,43244,43156,42821,42755,42823,43062,
+43275,40967,41033,41033,41178,41178,41237,41249,
+41248,41248,41220,41220,41174,41154,41103,41103,
+43832,41514,39844,41859,40743,40743,40761,40761,
+40786,40786,40761,40761,40668,40668,40593,40567,
+40512,40512,40466,40466,40438,40428,40409,40409,
+40400,40400,40422,40435,40479,40479,40510,40510,
+40522,40521,40508,40508,40473,40473,40483,40493,
+40535,40535,40604,40604,40679,40695,40694,40694,
+40600,40600,40552,40539,40517,40517,40489,40489,
+40463,40459,40461,40461,40497,40497,40518,40525,
+40539,40539,40535,40535,40515,40504,40466,40466,
+40395,40395,40351,40337,40306,40306,40267,40267,
+40237,40232,40241,40241,40298,40298,40299,40290,
+40243,40243,40174,40174,40107,40095,40104,40104,
+40207,40207,40233,40233,40205,40205,40206,40206,
+40234,40244,40263,40263,40270,40270,40291,40303,
+40341,40341,40373,40373,40393,40410,40477,40477,
+40602,40602,40652,40661,40656,40656,40706,40706,
+40794,40814,40830,40830,40776,40776,40776,40785,
+40826,40826,40925,40925,41041,41083,41173,41173,
+41249,41249,41255,41246,41200,41200,41183,41183,
+41194,41196,41197,41197,42098,42765,42984,41402,
+41421,41421,41427,41732,41255,41585,41776,42319,
+42378,42765,42687,42438,41494,41584,42130,41018,
+41117,41124,41059,41059,41017,41017,41057,41083,
+41166,41166,41211,41035,40843,42162,41076,41500,
+41244,40913,40835,40811,40775,40775,40710,40710,
+40620,40587,40511,40511,40457,40457,40509,40549,
+40685,40685,40743,40743,40697,40689,40698,40698,
+40784,40784,40833,40846,40870,40870,40900,40900,
+40926,40929,40921,40921,40864,40864,40864,40875,
+40927,40927,40962,40962,40968,40969,40967,40967,
+40955,40955,40949,40946,40939,40939,40887,40887,
+40813,40794,40768,40768,40790,40790,40787,40781,
+40755,40755,40708,40708,40668,40671,40728,40728,
+41028,41028,41087,41092,41061,41061,41009,41009,
+40964,40948,40916,40916,40897,40897,40891,40890,
+40891,40891,40914,40914,40954,40964,40972,40972,
+40945,40945,40928,40923,40909,40909,40886,40886,
+40859,40855,40859,40859,40904,40904,40888,40871,
+40801,40801,40778,40778,40806,40817,40841,40841,
+40859,40859,40870,40876,40892,40892,40891,40891,
+40873,40867,40855,40855,40837,40837,40819,40811,
+40795,40795,40770,40770,40755,40751,40746,40746,
+40743,40743,40717,40705,40666,40666,40637,40637,
+40617,40604,40562,40562,40499,40499,40434,40408,
+40336,40336,40300,40300,40312,40307,40270,40270,
+40158,40158,40085,40059,40007,40007,39953,39953,
+39916,39902,39874,39874,39846,39846,39817,39803,
+39763,39763,39707,39707,39658,39639,39595,39595,
+39549,39549,39482,39450,39353,39353,39273,39273,
+39231,39212,39154,39154,39074,39074,39006,38978,
+38909,38909,38834,38834,38775,38757,38729,38729,
+38744,38744,38713,38690,38607,38607,38483,38483,
+38360,38318,38232,38232,38172,38172,38086,38046,
+37927,37927,37839,37839,37814,37799,37750,37750,
+37658,37658,37573,37538,37449,37449,37410,37410,
+37425,37431,37450,37450,37470,37470,37437,37416,
+37342,37342,37333,37333,37389,37421,37518,37518,
+37659,37659,37743,37770,37827,37827,37875,37875,
+37841,37813,37704,37704,37555,37555,37492,36918,
+35595,32523,29194,29896,30659,30400,30126,29997,
+29789,28405,29016,33706,35492,35841,36716,37258,
+38062,38619,38750,39075,39476,39304,39305,39394,
+39413,39480,38617,38404,38472,38306,38180,38165,
+37392,37338,37862,38033,38273,38432,38204,38248,
+38021,38007,37773,37737,37710,37930,38036,37406,
+37439,37481,37623,37606,37521,37526,37545,37788,
+36863,36718,37219,36534,36466,36886,37658,37887,
+38426,37983,37123,36559,37178,37413,37628,37718,
+37721,38280,40183,40183,40205,40221,40287,40287,
+40393,40393,40413,40407,40359,40359,40270,40270,
+40175,40134,40026,40026,39880,39880,39766,39725,
+39628,39628,39534,39534,39461,39429,39347,39347,
+39258,39258,39197,39173,39111,39111,39054,39054,
+39022,39004,38942,38942,38835,38835,38756,38727,
+38665,38665,38606,38606,38557,38535,38474,38474,
+38389,38389,38322,38298,38241,38241,38188,38188,
+38161,38154,38143,38143,38131,38131,38114,38108,
+38095,38095,38044,38044,37973,37948,37891,37891,
+37839,37839,37771,37740,37655,37655,37646,37646,
+37724,37754,37823,37823,37888,37888,37942,37963,
+38011,38011,38053,38053,38035,38026,37995,37995,
+37981,40910,38425,38986,38033,38111,38243,37908,
+37300,37852,38083,37937,38598,38728,39243,40321,
+40247,40562,40563,41312,41412,41299,40713,40793,
+41434,41435,41187,40696,40513,40124,40376,39996,
+39273,40305,40715,40474,41247,42026,42148,42828,
+41949,41643,41819,41114,41651,37876,41102,41216,
+42015,41058,40700,42437,42309,42437,43026,43238,
+42829,40923,40983,40983,41119,41119,41191,41212,
+41240,41240,41215,41215,41144,41120,41065,41065,
+43347,42654,43312,42710,40757,40757,40750,40750,
+40749,40745,40724,40724,40669,40669,40609,40587,
+40538,40538,40503,40503,40483,40478,40473,40473,
+40493,40493,40520,40533,40569,40569,40609,40609,
+40636,40636,40610,40610,40532,40532,40516,40519,
+40550,40550,40622,40622,40710,40733,40761,40761,
+40726,40726,40693,40677,40635,40635,40599,40599,
+40582,40576,40566,40566,40564,40564,40574,40580,
+40601,40601,40590,40590,40549,40530,40478,40478,
+40402,40402,40368,40359,40349,40349,40327,40327,
+40304,40301,40312,40312,40366,40366,40371,40364,
+40327,40327,40270,40270,40218,40212,40232,40232,
+40342,40342,40376,40378,40356,40356,40368,40368,
+40403,40415,40438,40438,40449,40449,40466,40476,
+40507,40507,40526,40526,40532,40548,40616,40616,
+40759,40759,40811,40820,40807,40807,40860,40860,
+40960,40986,41015,41015,40980,40980,40960,40953,
+40940,40940,40991,40991,41085,41120,41202,41202,
+41280,41280,41302,41303,41288,41288,41286,41286,
+41289,41291,41295,41295,41428,41428,41446,41445,
+41426,41426,41425,41425,41757,41093,41111,40708,
+40903,40180,39783,39979,39716,40391,41867,41944,
+41137,41132,41075,41075,41005,41005,41014,41026,
+41076,41076,41104,41027,40763,41740,40647,40915,
+40928,40928,40865,40841,40786,40786,40737,40737,
+40696,40673,40597,40597,40478,40478,40512,40551,
+40710,40710,40757,40757,40671,40656,40667,40667,
+40812,40812,40908,40940,41003,41003,41035,41035,
+41026,41021,41007,41007,40980,40980,40995,41007,
+41053,41053,41081,41081,41092,41095,41097,41097,
+41084,41084,41064,41054,41022,41022,40947,40947,
+40859,40840,40833,40833,40915,40915,40930,40926,
+40887,40887,40832,40832,40792,40796,40855,40855,
+41028,41028,41087,41092,41061,41061,41009,41009,
+40964,40948,40916,40916,40897,40897,40891,40890,
+40891,40891,40914,40914,40954,40964,40972,40972,
+40945,40945,40928,40923,40909,40909,40886,40886,
+40859,40855,40859,40859,40904,40904,40888,40871,
+40801,40801,40778,40778,40806,40817,40841,40841,
+40859,40859,40870,40876,40892,40892,40891,40891,
+40873,40867,40855,40855,40837,40837,40819,40811,
+40795,40795,40770,40770,40755,40751,40746,40746,
+40743,40743,40717,40705,40666,40666,40637,40637,
+40617,40604,40562,40562,40499,40499,40434,40408,
+40336,40336,40300,40300,40312,40307,40270,40270,
+40158,40158,40085,40059,40007,40007,39953,39953,
+39916,39902,39874,39874,39846,39846,39817,39803,
+39763,39763,39707,39707,39658,39639,39595,39595,
+39549,39549,39482,39450,39353,39353,39273,39273,
+39231,39212,39154,39154,39074,39074,39006,38978,
+38909,38909,38834,38834,38775,38757,38729,38729,
+38744,38744,38713,38690,38607,38607,38483,38483,
+38360,38318,38232,38232,38172,38172,38086,38046,
+37927,37927,37839,37839,37814,37799,37750,37750,
+37658,37658,37573,37538,37449,37449,37410,37410,
+37425,37431,37450,37450,37470,37470,37437,37416,
+37342,37342,37333,37333,37389,37421,37518,37518,
+37659,37659,37743,37770,37827,37827,37875,37875,
+37841,37813,37704,37704,37555,37555,37492,36396,
+33785,30181,28119,30304,31258,31680,30850,30522,
+31041,31972,33553,36443,36973,37110,37615,38083,
+38424,38703,38939,39163,39484,39402,39437,39571,
+39345,39126,38505,38536,38660,38447,38227,38044,
+37318,37509,37939,38073,38238,38226,38273,38261,
+38055,38053,37859,37781,37622,37766,37813,37378,
+37367,37364,37685,37561,37444,37659,37493,37576,
+37366,37367,37493,36549,36529,37098,37661,37980,
+38487,37933,37339,36785,36711,36877,37285,37650,
+37347,38014,40183,40183,40205,40221,40287,40287,
+40393,40393,40413,40407,40359,40359,40270,40270,
+40175,40134,40026,40026,39880,39880,39766,39725,
+39628,39628,39534,39534,39461,39429,39347,39347,
+39258,39258,39197,39173,39111,39111,39054,39054,
+39022,39004,38942,38942,38835,38835,38756,38727,
+38665,38665,38606,38606,38557,38535,38474,38474,
+38389,38389,38322,38298,38241,38241,38188,38188,
+38161,38154,38143,38143,38131,38131,38114,38108,
+38095,38095,38044,38044,37973,37948,37891,37891,
+37839,37839,37771,37740,37655,37655,37646,37646,
+37724,37754,37823,37823,37888,37888,37942,37963,
+38011,38011,38053,38053,38035,38026,37995,37995,
+37981,41158,40600,39371,39224,38656,36475,36121,
+36017,37160,37417,37202,38020,38506,38806,39703,
+39941,39772,40101,41169,40986,40130,39650,40153,
+40154,40681,40833,40133,39897,39558,38340,38533,
+39131,40173,40393,39762,39722,39726,40620,43565,
+42586,41872,42010,42006,41077,41193,40388,40198,
+41984,41451,41283,41813,41919,41954,42879,43101,
+42761,40923,40983,40983,41119,41119,41191,41212,
+41240,41240,41215,41215,41144,41120,41065,41065,
+40996,40996,44383,43430,40757,40757,40750,40750,
+40749,40745,40724,40724,40669,40669,40609,40587,
+40538,40538,40503,40503,40483,40478,40473,40473,
+40493,40493,40520,40533,40569,40569,40609,40609,
+40636,40636,40610,40610,40532,40532,40516,40519,
+40550,40550,40622,40622,40710,40733,40761,40761,
+40726,40726,40693,40677,40635,40635,40599,40599,
+40582,40576,40566,40566,40564,40564,40574,40580,
+40601,40601,40590,40590,40549,40530,40478,40478,
+40402,40402,40368,40359,40349,40349,40327,40327,
+40304,40301,40312,40312,40366,40366,40371,40364,
+40327,40327,40270,40270,40218,40212,40232,40232,
+40342,40342,40376,40378,40356,40356,40368,40368,
+40403,40415,40438,40438,40449,40449,40466,40476,
+40507,40507,40526,40526,40532,40548,40616,40616,
+40759,40759,40811,40820,40807,40807,40860,40860,
+40960,40986,41015,41015,40980,40980,40960,40953,
+40940,40940,40991,40991,41085,41120,41202,41202,
+41280,41280,41302,41303,41288,41288,41286,41286,
+41289,41291,41295,41295,41428,41428,41446,41445,
+41426,41426,41425,41425,41400,41477,41738,41714,
+41536,40243,39536,39237,39651,39951,39596,41290,
+41137,41132,41075,41075,41005,41005,41014,41026,
+41076,41076,41104,40527,40524,41819,40597,40915,
+40928,40928,40865,40841,40786,40786,40737,40737,
+40696,40673,40597,40597,40478,40478,40512,40551,
+40710,40710,40757,40757,40671,40656,40667,40667,
+40812,40812,40908,40940,41003,41003,41035,41035,
+41026,41021,41007,41007,40980,40980,40995,41007,
+41053,41053,41081,41081,41092,41095,41097,41097,
+41084,41084,41064,41054,41022,41022,40947,40947,
+40859,40840,40833,40833,40915,40915,40930,40926,
+40887,40887,40832,40832,40792,40796,40855,40855,
+41089,41089,41131,41139,41142,41142,41115,41115,
+41077,41061,41025,41025,40989,40989,40972,40966,
+40958,40958,40969,40969,40999,41004,41003,41003,
+40969,40969,40962,40963,40972,40972,40981,40981,
+40982,40987,41010,41010,41063,41063,41029,41000,
+40890,40890,40850,40850,40891,40907,40948,40948,
+40987,40987,41003,41008,41021,41021,41008,41008,
+40974,40962,40930,40930,40889,40889,40859,40849,
+40828,40828,40799,40799,40779,40773,40765,40765,
+40764,40764,40744,40732,40694,40694,40666,40666,
+40648,40636,40600,40600,40543,40543,40478,40450,
+40373,40373,40327,40327,40322,40315,40281,40281,
+40197,40197,40124,40095,40025,40025,39968,39968,
+39946,39936,39914,39914,39889,39889,39847,39826,
+39757,39757,39686,39686,39639,39622,39577,39577,
+39528,39528,39473,39447,39374,39374,39309,39309,
+39273,39255,39204,39204,39136,39136,39062,39029,
+38935,38935,38853,38853,38809,38792,38747,38747,
+38698,38698,38644,38619,38545,38545,38442,38442,
+38347,38313,38234,38234,38153,38153,38070,38033,
+37936,37936,37849,37849,37806,37788,37740,37740,
+37677,37677,37623,37601,37549,37549,37501,37501,
+37466,37461,37470,37470,37519,37519,37506,37491,
+37436,37436,37434,37434,37495,37530,37645,37645,
+37814,37814,37893,37914,37934,37934,37937,37937,
+37864,37824,37698,37698,37581,37581,37503,34756,
+30988,28245,29337,30186,32341,32946,33971,32297,
+33110,34917,36270,37351,37563,37674,38377,38613,
+38712,38827,38939,38929,39334,39429,39338,39244,
+38988,38757,38872,38895,38780,38391,37990,37613,
+37469,37641,37968,38286,38306,38116,38160,38187,
+38096,38023,37812,37784,37551,37530,37554,37313,
+37308,37314,37757,37709,37617,37737,37588,37582,
+37797,37774,37684,36532,36676,37320,37636,37862,
+38361,37948,37497,37078,36618,37255,37944,37720,
+37726,38062,40183,40183,40207,40223,40281,40281,
+40390,40390,40422,40421,40387,40387,40318,40318,
+40244,40207,40095,40095,39922,39922,39805,39766,
+39687,39687,39599,39599,39521,39490,39410,39410,
+39332,39332,39279,39257,39202,39202,39153,39153,
+39125,39109,39060,39060,38982,38982,38919,38895,
+38841,38841,38766,38766,38683,38651,38570,38570,
+38484,38484,38427,38409,38376,38376,38340,38340,
+38311,38301,38285,38285,38259,38259,38234,38226,
+38212,38212,38141,38141,38046,38014,37955,37955,
+37919,37919,37876,37858,37810,37810,37811,37811,
+37871,37897,37969,37969,38065,38065,38148,38181,
+38266,38266,38341,38341,38347,38341,38304,38304,
+38242,38242,42873,39513,38493,37025,34196,34549,
+35055,36313,37582,37334,37883,38610,38783,39386,
+39697,39444,40350,40395,40288,39104,38947,39112,
+39765,40437,40671,39364,39055,38714,37098,37025,
+38173,39553,39799,39884,38797,38488,39469,42766,
+42552,41888,41017,41219,41745,40773,40058,39466,
+41184,42561,42912,42238,42356,42157,42477,42434,
+42460,40926,40967,40967,41058,41058,41131,41158,
+41220,41220,41200,41200,41110,41080,41020,41020,
+40981,40981,44513,40862,40773,40773,40736,40736,
+40707,40696,40673,40673,40639,40639,40596,40582,
+40549,40549,40541,40541,40543,40545,40552,40552,
+40573,40573,40591,40598,40616,40616,40646,40646,
+40668,40667,40639,40639,40566,40566,40547,40547,
+40566,40566,40622,40622,40690,40711,40749,40749,
+40757,40757,40744,40733,40694,40694,40674,40674,
+40682,40679,40657,40657,40595,40595,40585,40589,
+40620,40620,40603,40603,40547,40525,40473,40473,
+40418,40418,40393,40388,40386,40386,40370,40370,
+40346,40343,40348,40348,40390,40390,40399,40396,
+40375,40375,40349,40349,40332,40331,40347,40347,
+40406,40406,40433,40441,40453,40453,40480,40480,
+40507,40516,40541,40541,40569,40569,40595,40609,
+40645,40645,40644,40644,40612,40615,40658,40658,
+40781,40781,40836,40847,40853,40853,40925,40925,
+41035,41067,41120,41120,41126,41126,41109,41097,
+41056,41056,41051,41051,41086,41105,41170,41170,
+41278,41278,41353,41380,41434,41434,41457,41457,
+41434,41427,41416,41416,41470,41470,41469,41463,
+41426,41426,41412,41412,41393,42573,41096,41720,
+41800,40113,39270,39081,39515,40629,40943,39841,
+41018,41163,41113,41113,41045,41045,41028,41024,
+41026,41026,41031,40782,40258,41986,40838,40960,
+40939,40939,40871,40843,40778,40778,40737,40737,
+40718,40705,40654,40654,40567,40567,40572,40588,
+40663,40663,40694,40694,40663,40666,40707,40707,
+40861,40861,40971,41009,41092,41092,41122,41122,
+41094,41086,41069,41069,41057,41057,41074,41085,
+41118,41118,41157,41157,41205,41216,41227,41227,
+41191,41191,41135,41108,41025,41025,40932,40932,
+40865,40855,40878,40878,41006,41006,41028,41019,
+40957,40957,40919,40919,40933,40947,40999,40999,
+41116,41116,41150,41161,41177,41177,41161,41161,
+41127,41112,41074,41074,41031,41031,41009,41003,
+40988,40988,40994,40994,41019,41022,41016,41016,
+40981,40981,40976,40980,41001,41001,41023,41023,
+41039,41048,41080,41080,41136,41136,41093,41059,
+40931,40931,40883,40883,40929,40948,40996,40996,
+41045,41045,41063,41069,41080,41080,41062,41062,
+41020,41004,40965,40965,40913,40913,40878,40866,
+40843,40843,40812,40812,40790,40783,40774,40774,
+40774,40774,40756,40745,40707,40707,40677,40677,
+40662,40651,40618,40618,40562,40562,40497,40467,
+40389,40389,40339,40339,40327,40318,40287,40287,
+40215,40215,40141,40111,40033,40033,39975,39975,
+39959,39951,39930,39930,39906,39906,39859,39834,
+39754,39754,39676,39676,39631,39613,39568,39568,
+39518,39518,39468,39446,39382,39382,39326,39326,
+39291,39274,39225,39225,39164,39164,39087,39051,
+38948,38948,38864,38864,38826,38807,38755,38755,
+38678,38678,38614,38587,38516,38516,38424,38424,
+38342,38310,38235,38235,38146,38146,38063,38029,
+37941,37941,37856,37856,37804,37784,37737,37737,
+37687,37687,37645,37630,37594,37594,37541,37541,
+37485,37475,37481,37481,37545,37545,37539,37528,
+37482,37482,37485,37485,37547,37584,37706,37706,
+37885,37885,37963,37979,37984,37984,37966,37966,
+37875,37830,37697,37697,37592,37592,36455,29752,
+28535,29072,30743,33896,34587,35231,35762,35262,
+35281,36876,37498,37850,38211,38368,38406,38464,
+38653,38758,38862,38818,38994,39042,39060,39050,
+39028,39193,39216,38876,38596,38308,38133,37825,
+37935,38141,38299,38379,38231,38227,38034,38032,
+38144,37730,37405,37459,37541,37490,37417,37267,
+37216,37228,37838,38043,37975,37555,37530,37586,
+37467,37503,37358,36742,36921,37603,38112,37986,
+37807,37569,37174,36645,37069,37438,37710,38170,
+38267,38341,38292,38450,39265,40224,40279,40279,
+40389,40389,40424,40426,40399,40399,40340,40340,
+40274,40238,40127,40127,39941,39941,39824,39786,
+39715,39715,39630,39630,39549,39518,39439,39439,
+39366,39366,39317,39297,39246,39246,39201,39201,
+39174,39160,39117,39117,39051,39051,38994,38972,
+38920,38920,38839,38839,38741,38704,38615,38615,
+38529,38529,38477,38463,38439,38439,38410,38410,
+38381,38371,38351,38351,38319,38319,38290,38281,
+38264,38264,38187,38187,38080,38047,37985,37985,
+37957,37957,37926,37915,37883,37883,37890,37890,
+37942,37967,38042,38042,38151,38151,38246,38285,
+38384,38384,38474,38474,38490,38485,38446,38446,
+38362,38362,38453,39460,37241,35034,34219,34293,
+34270,35510,37111,37885,37779,38258,38692,38813,
+38902,39761,40163,39812,39561,39390,38470,38608,
+38483,38848,38882,36841,36586,36426,35678,35582,
+35890,40167,40185,41144,40618,39565,39574,42132,
+42669,42529,39391,39446,37295,42502,42006,41139,
+41701,41986,42213,42841,43132,42843,42904,42848,
+42580,40928,40961,40961,41031,41031,41104,41134,
+41212,41212,41192,41192,41092,41060,40998,40998,
+40973,40973,40897,40865,40780,40780,40729,40729,
+40687,40674,40650,40650,40627,40627,40591,40579,
+40555,40555,40557,40557,40571,40576,40589,40589,
+40609,40609,40622,40627,40636,40636,40663,40663,
+40683,40681,40653,40653,40583,40583,40562,40560,
+40575,40575,40623,40623,40682,40702,40744,40744,
+40771,40771,40766,40758,40720,40720,40708,40708,
+40726,40725,40698,40698,40610,40610,40591,40593,
+40628,40628,40610,40610,40547,40523,40471,40471,
+40424,40424,40405,40401,40402,40402,40389,40389,
+40367,40363,40366,40366,40402,40402,40412,40411,
+40397,40397,40385,40385,40383,40386,40401,40401,
+40436,40436,40462,40472,40499,40499,40533,40533,
+40555,40564,40589,40589,40624,40624,40655,40669,
+40708,40708,40697,40697,40649,40645,40677,40677,
+40791,40791,40846,40860,40875,40875,40955,40955,
+41069,41104,41167,41167,41192,41192,41177,41164,
+41110,41110,41081,41081,41089,41101,41158,41158,
+41279,41279,41377,41414,41500,41500,41533,41533,
+41497,41486,41467,41467,41486,41486,41478,41468,
+41425,41425,41405,41405,41389,41374,41311,41311,
+41235,41331,40001,40783,40769,40398,39409,39521,
+41196,41176,41131,41131,41063,41063,41034,41024,
+41005,41005,40998,40998,40255,41424,40979,40979,
+40943,40943,40873,40844,40774,40774,40738,40738,
+40728,40718,40679,40679,40608,40608,40600,40606,
+40643,40643,40669,40669,40663,40673,40728,40728,
+40886,40886,41003,41044,41134,41134,41164,41164,
+41129,41118,41099,41099,41094,41094,41111,41120,
+41148,41148,41191,41191,41254,41269,41285,41285,
+41238,41238,41167,41132,41026,41026,40927,40927,
+40869,40864,40899,40899,41047,41047,41072,41062,
+40989,40989,40961,40961,40999,41015,41063,41063,
+41172,41172,41178,41184,41207,41207,41205,41205,
+41188,41179,41154,41154,41125,41125,41101,41091,
+41061,41061,41051,41051,41064,41063,41046,41046,
+40996,40996,40995,41002,41038,41038,41103,41103,
+41168,41191,41245,41245,41289,41289,41228,41186,
+41039,41039,40971,40971,41007,41025,41078,41078,
+41154,41154,41187,41197,41213,41213,41182,41182,
+41105,41078,41014,41014,40957,40957,40914,40899,
+40869,40869,40836,40836,40809,40801,40786,40786,
+40783,40783,40767,40757,40723,40723,40695,40695,
+40679,40670,40637,40637,40581,40581,40514,40485,
+40406,40406,40354,40354,40341,40334,40307,40307,
+40249,40249,40174,40141,40049,40049,39979,39979,
+39954,39943,39914,39914,39881,39881,39829,39802,
+39722,39722,39643,39643,39594,39575,39527,39527,
+39477,39477,39441,39427,39390,39390,39348,39348,
+39311,39294,39248,39248,39192,39192,39121,39086,
+38984,38984,38903,38903,38872,38851,38783,38783,
+38654,38654,38565,38532,38460,38460,38382,38382,
+38331,38308,38246,38246,38151,38151,38081,38055,
+37999,37999,37919,37919,37841,37816,37764,37764,
+37733,37733,37703,37690,37661,37661,37609,37609,
+37553,37547,37568,37568,37661,37661,37681,37683,
+37671,37671,37694,37694,37759,37795,37910,37910,
+38063,38063,38120,38127,38105,38105,38029,38029,
+37898,37847,37727,37727,37626,37626,35451,29084,
+29005,28989,30326,34254,35549,35780,36725,36598,
+36972,37859,37811,38294,38289,38216,38450,38525,
+38737,38805,38872,38745,38654,38769,38939,38948,
+38942,39293,39256,38890,38745,38369,38267,38095,
+38208,38290,38320,38508,38436,38362,38010,37960,
+38018,37649,37455,37453,37564,37539,37384,37217,
+37182,37271,37799,38049,37896,37641,37654,37656,
+37199,37325,37149,36657,36892,37766,38276,38512,
+38147,37577,36970,36394,37154,37398,37372,38005,
+38208,38147,38194,38233,38789,40227,40292,40292,
+40389,40389,40433,40438,40421,40421,40371,40371,
+40315,40284,40183,40183,40016,40016,39900,39861,
+39780,39780,39697,39697,39629,39601,39533,39533,
+39467,39467,39435,39424,39398,39398,39373,39373,
+39352,39341,39302,39302,39241,39241,39171,39140,
+39060,39060,38960,38960,38859,38822,38737,38737,
+38670,38670,38635,38627,38620,38620,38606,38606,
+38579,38566,38531,38531,38470,38470,38423,38408,
+38381,38381,38296,38296,38186,38154,38101,38101,
+38098,38098,38104,38109,38132,38132,38168,38168,
+38212,38238,38325,38325,38467,38467,38572,38612,
+38704,38704,38797,38797,38826,38824,38780,38780,
+38635,38635,38563,39811,37493,35305,34662,34557,
+34338,34592,35725,36943,37674,37928,38174,38856,
+39012,39090,39594,39729,39882,39910,39123,38686,
+38075,37819,36659,36097,36025,35811,35673,35528,
+35919,40672,40470,41331,40805,40572,40023,40815,
+42255,42564,39208,39138,41244,37531,42072,42536,
+43102,42948,42761,43522,43661,43485,42734,42460,
+42742,40926,40947,40947,40994,40994,41064,41095,
+41184,41184,41153,41153,41025,40986,40916,40916,
+40904,40904,40857,40835,40768,40768,40707,40707,
+40657,40643,40625,40625,40618,40618,40593,40586,
+40573,40573,40603,40603,40643,40654,40669,40669,
+40664,40664,40660,40661,40664,40664,40694,40694,
+40718,40718,40695,40695,40632,40632,40612,40611,
+40628,40628,40664,40664,40699,40715,40755,40755,
+40807,40807,40815,40810,40780,40780,40772,40772,
+40799,40799,40768,40768,40662,40662,40629,40625,
+40643,40643,40617,40617,40554,40532,40480,40480,
+40434,40434,40409,40402,40392,40392,40402,40402,
+40428,40436,40451,40451,40459,40459,40459,40457,
+40449,40449,40467,40467,40515,40529,40550,40550,
+40547,40547,40572,40589,40643,40643,40693,40693,
+40709,40716,40732,40732,40756,40756,40778,40789,
+40818,40818,40793,40793,40730,40719,40727,40727,
+40807,40807,40865,40886,40934,40934,41030,41030,
+41134,41172,41246,41246,41312,41312,41315,41305,
+41254,41254,41205,41205,41181,41182,41213,41213,
+41312,41312,41423,41470,41596,41596,41624,41624,
+41545,41518,41469,41469,41450,41450,41429,41420,
+41393,41393,41378,41378,41361,43231,41257,41257,
+41205,41754,39799,41244,41315,41315,41329,41329,
+41244,41216,41160,41160,41102,41102,41052,41030,
+40968,40968,40944,40944,41095,41191,40979,40979,
+40929,40929,40860,40833,40770,40770,40743,40743,
+40745,40744,40736,40736,40715,40715,40693,40684,
+40659,40659,40680,40680,40727,40756,40850,40850,
+41030,41030,41146,41185,41261,41261,41288,41288,
+41263,41254,41233,41233,41209,41209,41209,41211,
+41223,41223,41257,41257,41321,41337,41349,41349,
+41291,41291,41203,41161,41036,41036,40940,40940,
+40905,40908,40956,40956,41114,41114,41156,41155,
+41108,41108,41105,41105,41153,41168,41189,41189,
+41172,41172,41178,41184,41207,41207,41205,41205,
+41188,41179,41154,41154,41125,41125,41101,41091,
+41061,41061,41051,41051,41064,41063,41046,41046,
+40996,40996,40995,41002,41038,41038,41103,41103,
+41168,41191,41245,41245,41289,41289,41228,41186,
+41039,41039,40971,40971,41007,41025,41078,41078,
+41154,41154,41187,41197,41213,41213,41182,41182,
+41105,41078,41014,41014,40957,40957,40914,40899,
+40869,40869,40836,40836,40809,40801,40786,40786,
+40783,40783,40767,40757,40723,40723,40695,40695,
+40679,40670,40637,40637,40581,40581,40514,40485,
+40406,40406,40354,40354,40341,40334,40307,40307,
+40249,40249,40174,40141,40049,40049,39979,39979,
+39954,39943,39914,39914,39881,39881,39829,39802,
+39722,39722,39643,39643,39594,39575,39527,39527,
+39477,39477,39441,39427,39390,39390,39348,39348,
+39311,39294,39248,39248,39192,39192,39121,39086,
+38984,38984,38903,38903,38872,38851,38783,38783,
+38654,38654,38565,38532,38460,38460,38382,38382,
+38331,38308,38246,38246,38151,38151,38081,38055,
+37999,37999,37919,37919,37841,37816,37764,37764,
+37733,37733,37703,37690,37661,37661,37609,37609,
+37553,37547,37568,37568,37661,37661,37681,37683,
+37671,37671,37694,37694,37759,37795,37910,37910,
+38063,38063,38120,38127,38105,38105,38029,38029,
+37898,37847,37727,37727,37626,36507,34601,28425,
+30041,31121,32787,35030,36506,36368,37544,37670,
+37880,37854,37472,38290,37990,38034,38415,38450,
+38718,38994,38968,38701,38601,38729,38780,38844,
+38967,39226,39201,38970,38624,38470,38402,38274,
+38399,38355,38341,38566,38503,38416,38097,38088,
+37998,37687,37622,37609,37670,37618,37413,37262,
+37381,37452,38074,38045,37920,37844,37856,37817,
+37052,36889,36909,36693,36921,37800,38289,38388,
+38592,37885,37252,36619,37661,37683,37436,38091,
+38300,38101,38185,38170,38317,40227,40292,40292,
+40389,40389,40433,40438,40421,40421,40371,40371,
+40315,40284,40183,40183,40016,40016,39900,39861,
+39780,39780,39697,39697,39629,39601,39533,39533,
+39467,39467,39435,39424,39398,39398,39373,39373,
+39352,39341,39302,39302,39241,39241,39171,39140,
+39060,39060,38960,38960,38859,38822,38737,38737,
+38670,38670,38635,38627,38620,38620,38606,38606,
+38579,38566,38531,38531,38470,38470,38423,38408,
+38381,38381,38296,38296,38186,38154,38101,38101,
+38098,38098,38104,38109,38132,38132,38168,38168,
+38212,38238,38325,38325,38467,38467,38572,38612,
+38704,38704,38797,38797,38826,38824,38780,38780,
+38635,38635,38563,40216,37545,35512,34842,34537,
+34219,34669,35013,36092,37903,37628,37776,38109,
+38126,38226,39365,39854,40416,39802,39698,39542,
+37786,36449,36108,36037,35868,35550,35839,35861,
+36542,40417,40757,40839,40956,40674,39543,40299,
+40681,42119,39886,40074,41882,37500,41236,42239,
+42466,42873,42509,43513,43791,43916,42063,42083,
+42740,40926,40947,40947,40994,40994,41064,41095,
+41184,41184,41153,41153,41025,40986,40916,40916,
+40904,40904,40857,40835,40768,40768,40707,40707,
+40657,40643,40625,40625,40618,40618,40593,40586,
+40573,40573,40603,40603,40643,40654,40669,40669,
+40664,40664,40660,40661,40664,40664,40694,40694,
+40718,40718,40695,40695,40632,40632,40612,40611,
+40628,40628,40664,40664,40699,40715,40755,40755,
+40807,40807,40815,40810,40780,40780,40772,40772,
+40799,40799,40768,40768,40662,40662,40629,40625,
+40643,40643,40617,40617,40554,40532,40480,40480,
+40434,40434,40409,40402,40392,40392,40402,40402,
+40428,40436,40451,40451,40459,40459,40459,40457,
+40449,40449,40467,40467,40515,40529,40550,40550,
+40547,40547,40572,40589,40643,40643,40693,40693,
+40709,40716,40732,40732,40756,40756,40778,40789,
+40818,40818,40793,40793,40730,40719,40727,40727,
+40807,40807,40865,40886,40934,40934,41030,41030,
+41134,41172,41246,41246,41312,41312,41315,41305,
+41254,41254,41205,41205,41181,41182,41213,41213,
+41312,41312,41423,41470,41596,41596,41624,41624,
+41545,41518,41469,41469,41450,41450,41429,41420,
+41393,41393,41378,41378,41361,43132,42480,41257,
+42370,41205,41225,41244,41315,41315,41329,41329,
+41244,41216,41160,41160,41102,41102,41052,41030,
+40968,40968,40944,40944,40652,40984,40979,40979,
+40929,40929,40860,40833,40770,40770,40743,40743,
+40745,40744,40736,40736,40715,40715,40693,40684,
+40659,40659,40680,40680,40727,40756,40850,40850,
+41030,41030,41146,41185,41261,41261,41288,41288,
+41263,41254,41233,41233,41209,41209,41209,41211,
+41223,41223,41257,41257,41321,41337,41349,41349,
+41291,41291,41203,41161,41036,41036,40940,40940,
+40905,40908,40956,40956,41114,41114,41156,41155,
+41108,41108,41105,41105,41153,41168,41189,41189,
+41193,41193,41171,41163,41149,41149,41143,41143,
+41152,41157,41172,41172,41197,41197,41189,41178,
+41133,41133,41104,41104,41105,41100,41071,41071,
+41010,41010,40998,41001,41030,41030,41128,41128,
+41249,41288,41358,41358,41370,41370,41303,41263,
+41131,41131,41049,41049,41045,41051,41090,41090,
+41186,41186,41237,41253,41278,41278,41229,41229,
+41104,41062,40982,40982,40955,40955,40920,40905,
+40864,40864,40831,40831,40808,40799,40778,40778,
+40767,40767,40756,40749,40725,40725,40701,40701,
+40678,40667,40628,40628,40563,40563,40495,40466,
+40391,40391,40352,40352,40354,40350,40326,40326,
+40257,40257,40176,40141,40049,40049,39961,39961,
+39902,39880,39824,39824,39766,39766,39723,39707,
+39664,39664,39598,39598,39535,39512,39462,39462,
+39422,39422,39399,39391,39374,39374,39335,39335,
+39284,39263,39211,39211,39153,39153,39097,39074,
+39008,39008,38945,38945,38906,38882,38802,38802,
+38658,38658,38555,38517,38430,38430,38361,38361,
+38333,38317,38270,38270,38188,38188,38139,38125,
+38099,38099,38026,38026,37928,37896,37836,37836,
+37811,37811,37762,37739,37671,37671,37632,37632,
+37632,37642,37699,37699,37806,37806,37858,37877,
+37915,37915,37974,37974,38038,38064,38135,38135,
+38191,38191,38205,38201,38168,38168,38049,38049,
+37913,37869,37788,37788,36320,33069,30858,29675,
+31004,34503,36659,36105,36398,37548,36893,37317,
+37824,37768,37983,38158,38114,38279,38353,38719,
+38950,38757,38691,38531,38646,38705,38587,38632,
+38395,38408,38526,38516,38372,38232,38270,38287,
+38421,38404,38379,38537,38391,38286,38300,38188,
+38034,37774,37704,37659,37593,37663,37609,37325,
+37325,37506,38008,38096,37968,37703,37709,37568,
+37171,37209,37277,37004,37229,37846,37994,38036,
+38127,38426,38122,38075,38276,38076,37822,37375,
+38240,38318,38064,38177,38124,38841,40309,40309,
+40412,40412,40441,40443,40421,40421,40363,40363,
+40296,40267,40194,40194,40106,40106,40003,39957,
+39831,39831,39736,39736,39698,39679,39627,39627,
+39556,39556,39543,39543,39560,39560,39562,39562,
+39547,39534,39486,39486,39395,39395,39281,39229,
+39085,39085,38970,38970,38915,38894,38851,38851,
+38825,38825,38806,38800,38789,38789,38776,38776,
+38751,38735,38683,38683,38599,38599,38533,38509,
+38463,38463,38385,38385,38304,38283,38255,38255,
+38278,38278,38322,38345,38421,38421,38497,38497,
+38541,38570,38671,38671,38841,38841,38924,38950,
+38991,38991,39050,39050,39079,39071,39004,39004,
+38798,38798,38692,41408,38618,36405,35476,35211,
+35440,36758,36455,36696,37009,37527,37449,38021,
+38060,38187,38257,37972,38415,39333,38510,38020,
+36799,36904,36533,35897,35803,36221,36223,36377,
+37766,38694,38895,39606,39552,39832,40191,40737,
+40304,41046,39227,36959,40556,41641,40710,41023,
+41054,41102,41936,42840,43126,43098,42485,42754,
+43246,40903,40944,40944,41007,41007,41072,41098,
+41165,41165,41102,41102,40945,40898,40819,40819,
+40823,40823,40792,40774,40718,40718,40674,40674,
+40649,40642,40638,40638,40636,40636,40615,40609,
+40600,40600,40646,40646,40707,40718,40716,40716,
+40654,40654,40631,40628,40638,40638,40685,40685,
+40726,40734,40729,40729,40681,40681,40677,40684,
+40724,40724,40757,40757,40761,40766,40785,40785,
+40823,40823,40835,40835,40821,40821,40814,40814,
+40823,40821,40799,40799,40733,40733,40691,40676,
+40644,40644,40599,40599,40558,40540,40488,40488,
+40419,40419,40370,40352,40313,40313,40369,40369,
+40496,40532,40581,40581,40549,40549,40522,40511,
+40489,40489,40532,40532,40626,40653,40695,40695,
+40685,40685,40716,40737,40805,40805,40860,40860,
+40878,40880,40877,40877,40851,40851,40843,40842,
+40850,40850,40825,40825,40784,40775,40774,40774,
+40809,40809,40871,40900,40987,40987,41086,41086,
+41158,41187,41258,41258,41347,41347,41381,41385,
+41376,41376,41370,41370,41373,41374,41375,41375,
+41384,41384,41446,41480,41585,41585,41562,41562,
+41431,41388,41301,41301,41238,41238,41245,41260,
+41328,41328,41350,41350,41309,41294,41260,41260,
+41259,41259,41283,41296,41334,41334,41330,41330,
+41273,41252,41200,41200,41154,41154,41097,41071,
+40998,40998,40959,40959,40970,40968,40951,40951,
+40866,40866,40801,40785,40764,40764,40759,40759,
+40754,40763,40815,40815,40841,40841,40827,40817,
+40778,40778,40807,40807,40882,40922,41041,41041,
+41241,41241,41337,41360,41382,41382,41406,41406,
+41429,41430,41409,41409,41323,41323,41290,41283,
+41284,41284,41282,41282,41293,41294,41285,41285,
+41236,41236,41168,41135,41045,41045,40982,40982,
+40971,40976,41015,41015,41126,41126,41191,41212,
+41248,41248,41266,41266,41257,41252,41231,41231,
+41193,41193,41171,41163,41149,41149,41143,41143,
+41152,41157,41172,41172,41197,41197,41189,41178,
+41133,41133,41104,41104,41105,41100,41071,41071,
+41010,41010,40998,41001,41030,41030,41128,41128,
+41249,41288,41358,41358,41370,41370,41303,41263,
+41131,41131,41049,41049,41045,41051,41090,41090,
+41186,41186,41237,41253,41278,41278,41229,41229,
+41104,41062,40982,40982,40955,40955,40920,40905,
+40864,40864,40831,40831,40808,40799,40778,40778,
+40767,40767,40756,40749,40725,40725,40701,40701,
+40678,40667,40628,40628,40563,40563,40495,40466,
+40391,40391,40352,40352,40354,40350,40326,40326,
+40257,40257,40176,40141,40049,40049,39961,39961,
+39902,39880,39824,39824,39766,39766,39723,39707,
+39664,39664,39598,39598,39535,39512,39462,39462,
+39422,39422,39399,39391,39374,39374,39335,39335,
+39284,39263,39211,39211,39153,39153,39097,39074,
+39008,39008,38945,38945,38906,38882,38802,38802,
+38658,38658,38555,38517,38430,38430,38361,38361,
+38333,38317,38270,38270,38188,38188,38139,38125,
+38099,38099,38026,38026,37928,37896,37836,37836,
+37811,37811,37762,37739,37671,37671,37632,37632,
+37632,37642,37699,37699,37806,37806,37858,37877,
+37915,37915,37974,37974,38038,38064,38135,38135,
+38191,38191,38205,38201,38168,38168,38049,38049,
+37913,37869,37788,37788,35703,30784,29745,30386,
+31364,35088,36913,36748,37012,37620,37062,37803,
+37816,38027,38336,38122,38248,38158,38494,38765,
+38883,38653,38726,38579,38566,38637,38677,38616,
+38424,38395,38460,38414,38268,38118,38327,38324,
+38271,38354,38439,38505,38350,38315,38344,38250,
+38168,38032,37863,37702,37515,37629,37662,37376,
+37353,37299,38064,38041,37870,37666,37715,37568,
+37400,37518,37484,37124,37451,37804,37903,37906,
+37892,38069,38220,38272,38509,37982,38012,37524,
+38332,38162,37882,38101,38240,38776,39210,39728,
+40412,40412,40441,40443,40421,40421,40363,40363,
+40296,40267,40194,40194,40106,40106,40003,39957,
+39831,39831,39736,39736,39698,39679,39627,39627,
+39556,39556,39543,39543,39560,39560,39562,39562,
+39547,39534,39486,39486,39395,39395,39281,39229,
+39085,39085,38970,38970,38915,38894,38851,38851,
+38825,38825,38806,38800,38789,38789,38776,38776,
+38751,38735,38683,38683,38599,38599,38533,38509,
+38463,38463,38385,38385,38304,38283,38255,38255,
+38278,38278,38322,38345,38421,38421,38497,38497,
+38541,38570,38671,38671,38841,38841,38924,38950,
+38991,38991,39050,39050,39079,39071,39004,39004,
+38798,38798,38692,40331,38991,37659,37011,36849,
+37345,37321,36546,36457,36749,37132,36697,37230,
+38167,38103,38071,38234,38079,38984,38517,37597,
+36839,37013,36823,35874,35834,36460,36861,36532,
+37716,39189,39355,39569,39019,39238,39592,40888,
+40668,40629,39076,39121,42476,41398,40823,40513,
+40770,41132,41382,42271,43212,42914,42210,42529,
+42811,40903,40944,40944,41007,41007,41072,41098,
+41165,41165,41102,41102,40945,40898,40819,40819,
+40823,40823,40792,40774,40718,40718,40674,40674,
+40649,40642,40638,40638,40636,40636,40615,40609,
+40600,40600,40646,40646,40707,40718,40716,40716,
+40654,40654,40631,40628,40638,40638,40685,40685,
+40726,40734,40729,40729,40681,40681,40677,40684,
+40724,40724,40757,40757,40761,40766,40785,40785,
+40823,40823,40835,40835,40821,40821,40814,40814,
+40823,40821,40799,40799,40733,40733,40691,40676,
+40644,40644,40599,40599,40558,40540,40488,40488,
+40419,40419,40370,40352,40313,40313,40369,40369,
+40496,40532,40581,40581,40549,40549,40522,40511,
+40489,40489,40532,40532,40626,40653,40695,40695,
+40685,40685,40716,40737,40805,40805,40860,40860,
+40878,40880,40877,40877,40851,40851,40843,40842,
+40850,40850,40825,40825,40784,40775,40774,40774,
+40809,40809,40871,40900,40987,40987,41086,41086,
+41158,41187,41258,41258,41347,41347,41381,41385,
+41376,41376,41370,41370,41373,41374,41375,41375,
+41384,41384,41446,41480,41585,41585,41562,41358,
+41431,41388,41301,41301,41238,41238,41245,41260,
+41328,41328,41350,41350,41309,41294,41260,41260,
+41259,41259,41283,41296,41334,41334,41330,41330,
+41273,41252,41200,41200,41154,41154,41097,41071,
+40998,40998,40959,40959,40970,40968,40951,40951,
+40866,40866,40801,40785,40764,40764,40759,40759,
+40754,40763,40815,38954,39614,40841,40827,40817,
+40778,40778,40807,40807,40882,40922,41041,41041,
+41241,41241,41337,41360,41382,41382,41406,41406,
+41429,41430,41409,41409,41323,41323,41290,41283,
+41284,41284,41282,41282,41293,41294,41285,41285,
+41236,41236,41168,41135,41045,41045,40982,40982,
+40971,40976,41015,41015,41126,41126,41191,41212,
+41248,41248,41266,41266,41257,41252,41231,41231,
+41207,41207,41161,41145,41108,41108,41100,41100,
+41129,41143,41184,41184,41243,41243,41251,41244,
+41202,41202,41168,41168,41156,41147,41110,41110,
+41040,41040,41011,41008,41021,41021,41107,41107,
+41226,41267,41351,41351,41393,41393,41347,41315,
+41198,41198,41108,41108,41081,41079,41095,41095,
+41170,41170,41213,41226,41250,41250,41207,41207,
+41093,41055,40977,40977,40947,40947,40908,40890,
+40840,40840,40799,40799,40770,40758,40728,40728,
+40706,40706,40694,40689,40674,40674,40656,40656,
+40636,40625,40587,40587,40525,40525,40464,40438,
+40374,40374,40337,40337,40335,40329,40301,40301,
+40231,40231,40155,40123,40039,40039,39954,39954,
+39886,39860,39794,39794,39726,39726,39679,39662,
+39621,39621,39553,39553,39483,39460,39411,39411,
+39381,39381,39366,39361,39348,39348,39312,39312,
+39262,39242,39187,39187,39121,39121,39065,39043,
+38985,38985,38924,38924,38879,38854,38774,38774,
+38634,38634,38536,38501,38421,38421,38356,38356,
+38332,38318,38274,38274,38199,38199,38159,38148,
+38132,38132,38079,38079,38002,37975,37924,37924,
+37894,37894,37845,37822,37757,37757,37733,37733,
+37756,37771,37824,37824,37902,37902,37953,37974,
+38029,38029,38110,38110,38186,38214,38274,38274,
+38295,38295,38264,38239,38145,38145,37975,37975,
+37854,37826,37805,37805,32301,29733,29541,31598,
+33487,35830,37236,36862,37644,37879,37777,38140,
+37838,38121,38229,38148,38321,38336,38817,38880,
+38799,38719,38795,38669,38591,38619,38794,38696,
+38558,38545,38354,38349,38299,38206,38387,38403,
+38238,38352,38504,38389,38334,38340,38550,38534,
+38329,38229,38004,37867,37804,37717,37693,37649,
+37545,37749,38018,37959,37893,37664,37599,37443,
+37375,37556,37592,37403,37998,38048,37849,37916,
+37714,37944,37985,38108,38398,37840,37587,37893,
+38055,38003,37946,38310,38635,38999,38917,38947,
+40425,40425,40444,40443,40422,40422,40367,40367,
+40302,40276,40209,40209,40134,40134,40047,40007,
+39894,39894,39805,39805,39766,39749,39701,39701,
+39638,39638,39628,39629,39647,39647,39643,39643,
+39617,39600,39545,39545,39447,39447,39333,39282,
+39143,39143,39038,39038,38994,38979,38951,38951,
+38938,38938,38924,38917,38899,38899,38878,38878,
+38846,38829,38768,38768,38674,38674,38600,38574,
+38514,38514,38449,38449,38399,38388,38385,38385,
+38438,38438,38504,38535,38627,38627,38719,38719,
+38770,38799,38892,38892,39047,39047,39119,39138,
+39167,39167,39210,39210,39214,39196,39104,39104,
+38871,38871,38758,39905,39688,39140,38559,38925,
+38754,37559,37707,37599,37097,37234,36452,36885,
+37839,37689,38117,38113,37951,38359,38429,38061,
+36920,37062,37132,36661,36154,36729,37694,36776,
+37103,39235,38931,38652,39268,39140,38769,40693,
+40952,40734,40033,41794,37076,40713,40040,40534,
+41140,41915,42102,41966,42969,42773,42243,42398,
+40867,40890,40953,40953,41025,41025,41088,41111,
+41164,41164,41111,41111,40976,40936,40866,40866,
+40864,40864,40821,40799,40728,40728,40670,40670,
+40635,40629,40628,40628,40642,40642,40632,40628,
+40620,40620,40662,40662,40717,40726,40715,40715,
+40640,40640,40611,40607,40615,40615,40653,40653,
+40691,40701,40715,40715,40703,40703,40718,40731,
+40779,40779,40805,40805,40793,40791,40791,40791,
+40813,40813,40819,40817,40805,40805,40799,40799,
+40807,40806,40793,40793,40747,40747,40711,40695,
+40654,40654,40606,40606,40570,40550,40492,40492,
+40403,40403,40359,40347,40331,40331,40414,40414,
+40558,40600,40665,40665,40646,40646,40616,40602,
+40568,40568,40600,40600,40683,40707,40739,40739,
+40726,40726,40768,40795,40883,40883,40942,40942,
+40945,40944,40933,40933,40910,40910,40893,40887,
+40875,40875,40845,40845,40811,40803,40797,40797,
+40818,40818,40880,40911,41008,41008,41092,41092,
+41131,41149,41203,41203,41291,41291,41327,41335,
+41337,41337,41345,41345,41359,41360,41353,41353,
+40902,41331,41369,41392,41475,41475,41445,41281,
+40420,41286,41210,41210,41157,41157,41172,41189,
+41263,41263,41287,41287,41246,41235,41221,41221,
+41255,41255,41273,41278,41286,41286,41266,41266,
+41217,41201,41166,41166,41143,41143,41095,41072,
+41006,41006,40965,40965,40965,40959,40931,40931,
+40855,40855,40794,40779,40764,40764,40762,39263,
+39075,38770,38745,38481,40932,40932,40915,40900,
+40841,40841,40872,40872,40967,41013,41145,41145,
+41347,41347,41425,41439,41427,41427,41434,41434,
+41462,41464,41443,41443,41356,41356,41321,41315,
+41319,41319,41302,41302,41286,41277,41254,41254,
+41201,41201,41146,41124,41064,41064,41026,41026,
+41024,41030,41062,41062,41144,41144,41207,41230,
+41285,41285,41315,41315,41304,41297,41266,41266,
+41215,41215,41158,41137,41090,41090,41080,41080,
+41119,41136,41190,41190,41264,41264,41279,41274,
+41235,41235,41198,41198,41181,41170,41129,41129,
+41054,41054,41019,41012,41016,41016,41096,41096,
+41214,41255,41345,41345,41403,41403,41368,41339,
+41230,41230,41137,41137,41098,41091,41098,41098,
+41161,41161,41199,41211,41233,41233,41194,41194,
+41089,41052,40975,40975,40943,40943,40902,40882,
+40827,40827,40782,40782,40752,40738,40703,40703,
+40675,40675,40663,40659,40647,40647,40633,40633,
+40615,40603,40566,40566,40507,40507,40449,40425,
+40365,40365,40328,40328,40324,40317,40288,40288,
+40217,40217,40143,40113,40034,40034,39950,39950,
+39880,39851,39780,39780,39708,39708,39660,39641,
+39601,39601,39532,39532,39459,39434,39386,39386,
+39361,39361,39350,39346,39337,39337,39301,39301,
+39253,39231,39176,39176,39106,39106,39049,39027,
+38972,38972,38912,38912,38864,38839,38758,38758,
+38622,38622,38526,38492,38416,38416,38354,38354,
+38331,38317,38276,38276,38203,38203,38168,38158,
+38147,38147,38102,38102,38037,38013,37966,37966,
+37933,37933,37884,37862,37799,37799,37784,37784,
+37817,37834,37883,37883,37947,37947,37997,38019,
+38080,38080,38172,38172,38254,38282,38339,38339,
+38343,38343,38292,38257,38132,38132,37938,37938,
+37825,37803,37811,36905,30703,29692,30319,34475,
+36247,37363,37177,37610,37883,38115,38390,38251,
+38223,38382,38333,38324,38352,38426,38785,38792,
+38776,38963,38960,38840,38626,38513,38526,38623,
+38601,38571,38523,38490,38401,38660,38730,38567,
+38582,38643,38891,38629,38575,38617,38822,38731,
+38427,37874,37946,37995,38219,38132,37923,38284,
+38042,37710,37780,37783,37917,37836,37578,37685,
+37725,37900,37587,37976,38218,37544,37677,37974,
+37725,37835,38046,38336,38644,38314,38523,38225,
+38293,38249,38531,38733,38737,38725,38193,37906,
+39025,40431,40444,40443,40422,40422,40370,40370,
+40305,40280,40216,40216,40147,40147,40065,40029,
+39924,39924,39839,39839,39799,39782,39737,39737,
+39678,39678,39669,39670,39688,39688,39680,39680,
+39648,39630,39570,39570,39468,39468,39356,39307,
+39174,39174,39072,39072,39033,39020,38999,38999,
+38993,38993,38979,38972,38951,38951,38925,38925,
+38891,38873,38808,38808,38709,38709,38632,38604,
+38539,38539,38478,38478,38443,38438,38449,38449,
+38516,38516,38591,38626,38724,38724,38824,38824,
+38879,38908,38997,38997,39143,39143,39210,39227,
+39251,39251,39285,39285,39277,39255,39149,39149,
+38907,38907,42095,41697,41418,40660,39502,39180,
+38804,39048,39990,40091,38051,37411,36519,37369,
+37762,38034,37963,37587,37814,38582,38477,38392,
+37313,37336,37563,38755,38077,37269,37695,36845,
+37369,37783,39245,39083,39117,39050,38927,38964,
+40444,40624,39100,39649,39581,38773,39737,41350,
+40942,41036,42061,42371,42654,43213,42543,40794,
+40859,40885,40957,40957,41034,41034,41094,41116,
+41164,41164,41117,41117,40994,40957,40892,40892,
+40886,40886,40839,40813,40735,40735,40669,40669,
+40630,40622,40622,40622,40645,40645,40639,40636,
+40629,40629,40669,40669,40721,40729,40713,40713,
+40635,40635,40603,40598,40604,40604,40638,40638,
+40674,40684,40706,40706,40713,40713,40738,40753,
+40804,40804,40827,40827,40807,40801,40793,40793,
+40808,40808,40810,40808,40797,40797,40792,40792,
+40799,40799,40789,40789,40753,40753,40718,40703,
+40658,40658,40610,40610,40575,40556,40494,40494,
+40396,40396,40355,40346,40342,40342,40437,40437,
+40589,40632,40704,40704,40693,40693,40662,40647,
+40607,40607,40633,40633,40710,40731,40758,40758,
+40744,40744,40792,40821,40920,40920,40980,40980,
+40976,40972,40959,40959,40937,40937,40917,40909,
+40886,40886,40855,40855,40825,40817,40807,40807,
+40823,40823,40884,40917,41018,41018,41094,41094,
+41116,41130,41174,41174,41260,41260,41299,41308,
+41314,41314,41330,41330,41347,41349,41340,41340,
+41302,41302,41329,41348,41421,41421,41387,41387,
+41274,41735,40438,40007,41121,41121,41138,41157,
+41232,41232,41255,41255,41215,41206,41202,41202,
+41249,41249,41265,41266,41260,41260,41234,41234,
+41189,41174,41148,41148,41137,41137,41093,41072,
+41008,41008,40967,40910,40962,40344,40924,40924,
+40852,40852,40792,40777,40764,40764,37996,36474,
+36425,40012,40940,40940,40975,40975,40957,40938,
+40870,40870,40902,40902,41007,41056,41193,41193,
+41396,41396,41466,41474,41447,41447,41445,41445,
+41474,41476,41457,41457,41370,41370,41336,41330,
+41336,41336,41313,41313,41282,41270,41239,41239,
+41184,41184,41136,41118,41074,41074,41048,41048,
+41049,41056,41085,41085,41154,41154,41214,41238,
+41299,41299,41337,41337,41327,41317,41283,41283,
+41258,41258,41174,41141,41063,41063,41049,41049,
+41107,41134,41210,41210,41309,41309,41348,41353,
+41340,41340,41308,41308,41273,41255,41200,41200,
+41115,41115,41055,41037,41006,41006,41023,41023,
+41079,41111,41218,41218,41388,41388,41415,41404,
+41323,41323,41233,41233,41170,41149,41110,41110,
+41091,41091,41087,41087,41090,41090,41089,41089,
+41070,41056,41007,41007,40938,40938,40874,40844,
+40765,40765,40694,40694,40647,40627,40570,40570,
+40521,40521,40507,40504,40503,40503,40505,40505,
+40500,40493,40467,40467,40424,40424,40385,40370,
+40326,40326,40282,40282,40250,40236,40196,40196,
+40135,40135,40076,40052,39997,39997,39931,39931,
+39867,39840,39772,39772,39698,39698,39636,39611,
+39547,39547,39465,39465,39393,39371,39328,39328,
+39316,39316,39309,39305,39294,39294,39262,39262,
+39225,39207,39150,39150,39056,39056,38981,38952,
+38880,38880,38804,38804,38752,38726,38653,38653,
+38541,38541,38471,38449,38403,38403,38353,38353,
+38317,38301,38257,38257,38193,38193,38160,38149,
+38133,38133,38131,38131,38141,38139,38121,38121,
+38065,38065,38031,38020,38003,38003,38024,38024,
+38069,38081,38093,38093,38061,38061,38066,38076,
+38120,38120,38227,38227,38349,38388,38466,38466,
+38476,38476,38346,38268,38006,38006,37747,37747,
+37669,37671,37758,35761,31208,31360,31801,35144,
+36849,37215,37697,38298,38153,38520,38417,38258,
+38291,38316,38320,38359,38357,38422,38484,38710,
+38879,38973,38862,38874,38675,38606,38580,38591,
+38630,38644,38496,38394,38320,38688,38744,38646,
+38669,38712,38900,38672,38799,38829,38628,38492,
+38375,37943,38002,38037,38286,38362,38170,38379,
+38230,37925,37619,37567,37763,37669,37493,37624,
+37800,37809,37424,37697,37890,37507,37699,38188,
+38107,38012,38339,38649,38579,38294,38274,38313,
+38613,38712,39075,38733,38476,38227,37487,37487,
+38397,39055,40436,40436,40424,40424,40387,40387,
+40341,40317,40243,40243,40133,40133,40076,40059,
+40036,40036,39980,39980,39911,39887,39840,39840,
+39811,39811,39793,39786,39769,39769,39719,39719,
+39653,39625,39549,39549,39456,39456,39387,39364,
+39311,39311,39252,39252,39202,39187,39164,39164,
+39159,39159,39139,39129,39092,39092,39048,39048,
+39007,38986,38916,38916,38806,38806,38720,38686,
+38602,38602,38560,38560,38581,38597,38659,38659,
+38783,38783,38876,38911,38995,38995,39095,39095,
+39164,39191,39259,39259,39353,39353,39408,39427,
+39469,39469,39482,39482,39412,39370,39229,39229,
+39024,39024,38849,41750,41110,40257,38840,38688,
+38593,39732,40000,39724,37532,36625,36761,37821,
+37933,38456,38000,37759,38496,38203,38588,38633,
+37520,37512,37555,38695,39032,38696,37710,37260,
+37841,37824,39257,40389,39648,39808,39248,39216,
+40891,41088,39199,39519,39924,38611,39217,40348,
+42185,41230,41627,42283,42507,43355,42670,40831,
+40871,40894,40972,40972,41056,41056,41111,41130,
+41165,41165,41166,41166,41132,41121,41092,41092,
+41064,41064,40985,40946,40827,40827,40707,40707,
+40624,40605,40594,40594,40657,40657,40671,40670,
+40653,40653,40671,40671,40699,40702,40687,40687,
+40645,40645,40622,40616,40605,40605,40600,40600,
+40600,40607,40644,40644,40721,40721,40779,40800,
+40849,40849,40861,40861,40830,40818,40791,40791,
+40778,40778,40758,40749,40718,40718,40710,40710,
+40723,40727,40731,40731,40717,40717,40703,40697,
+40680,40680,40644,40644,40608,40586,40511,40511,
+40389,40389,40382,40396,40475,40475,40589,40589,
+40681,40715,40789,40789,40859,40859,40852,40841,
+40786,40786,40761,40761,40762,40760,40749,40749,
+40728,40728,40797,40839,40982,40982,41049,41049,
+41010,41001,40989,40989,41017,41017,41002,40987,
+40930,40930,40879,40879,40854,40848,40843,40843,
+40866,40866,40917,40945,41037,41037,41091,41091,
+41033,41023,41033,41033,41089,41089,41110,41113,
+41626,41110,40915,41012,41138,41141,41135,41135,
+41549,40922,40972,41408,41159,41159,41156,41156,
+41125,41118,41627,40232,40599,41125,41124,41122,
+41117,41117,41100,41100,41082,41079,41084,41084,
+41120,41120,41119,41114,41089,41089,41062,41062,
+41030,41026,41036,41036,41085,41085,41072,41056,
+40991,40991,40318,40671,40635,40505,40906,40964,
+40945,40945,40834,40805,40774,39474,36434,37179,
+38219,41048,41031,41031,41078,41078,41047,41019,
+40913,40913,40944,40944,41084,41142,41293,41293,
+41487,41487,41530,41524,41452,41452,41406,41406,
+41401,40092,41384,41384,41353,41353,41352,41357,
+41381,41381,41349,41349,41288,41264,41211,41211,
+41138,41138,41113,41110,41124,41124,41132,41132,
+41137,41141,41158,41158,41194,41194,41225,41238,
+41267,41267,41318,41318,41362,41368,41351,41351,
+41258,41258,41174,41141,41063,41063,41049,41049,
+41107,41134,41210,41210,41309,41309,41348,41353,
+41340,41340,41308,41308,41273,41255,41200,41200,
+41115,41115,41055,41037,41006,41006,41023,41023,
+41079,41111,41218,41218,41388,41388,41415,41404,
+41323,41323,41233,41233,41170,41149,41110,41110,
+41091,41091,41087,41087,41090,41090,41089,41089,
+41070,41056,41007,41007,40938,40938,40874,40844,
+40765,40765,40694,40694,40647,40627,40570,40570,
+40521,40521,40507,40504,40503,40503,40505,40505,
+40500,40493,40467,40467,40424,40424,40385,40370,
+40326,40326,40282,40282,40250,40236,40196,40196,
+40135,40135,40076,40052,39997,39997,39931,39931,
+39867,39840,39772,39772,39698,39698,39636,39611,
+39547,39547,39465,39465,39393,39371,39328,39328,
+39316,39316,39309,39305,39294,39294,39262,39262,
+39225,39207,39150,39150,39056,39056,38981,38952,
+38880,38880,38804,38804,38752,38726,38653,38653,
+38541,38541,38471,38449,38403,38403,38353,38353,
+38317,38301,38257,38257,38193,38193,38160,38149,
+38133,38133,38131,38131,38141,38139,38121,38121,
+38065,38065,38031,38020,38003,38003,38024,38024,
+38069,38081,38093,38093,38061,38061,38066,38076,
+38120,38120,38227,38227,38349,38388,38466,38466,
+38476,38476,38346,38268,38006,38006,37747,37747,
+37669,37671,36302,34120,31083,31818,33614,36370,
+37146,37144,38212,38342,38126,38504,38385,38241,
+38328,38287,38362,38351,38381,38477,38425,38592,
+38764,38983,39047,38973,38671,38632,38551,38496,
+38498,38461,38318,38262,38352,38521,38636,38819,
+38775,38859,39044,39038,39102,39024,38192,38143,
+38063,38060,38151,38135,38376,38510,38525,38363,
+38162,37903,37682,37671,37852,37666,37543,37562,
+37648,37572,37257,37418,37637,37593,37814,37960,
+38162,38092,38453,39020,38744,38632,38343,38335,
+38890,38875,39096,38835,38396,37892,37395,37290,
+38162,38760,40436,40436,40424,40424,40387,40387,
+40341,40317,40243,40243,40133,40133,40076,40059,
+40036,40036,39980,39980,39911,39887,39840,39840,
+39811,39811,39793,39786,39769,39769,39719,39719,
+39653,39625,39549,39549,39456,39456,39387,39364,
+39311,39311,39252,39252,39202,39187,39164,39164,
+39159,39159,39139,39129,39092,39092,39048,39048,
+39007,38986,38916,38916,38806,38806,38720,38686,
+38602,38602,38560,38560,38581,38597,38659,38659,
+38783,38783,38876,38911,38995,38995,39095,39095,
+39164,39191,39259,39259,39353,39353,39408,39427,
+39469,39469,39482,39482,39412,39370,39229,39229,
+39024,39024,38849,41280,40535,39739,38867,38546,
+38058,39420,39149,38612,37059,36640,36937,37701,
+38616,38707,38630,38278,38592,38971,38924,39179,
+38144,37612,37445,38542,39280,39870,37880,37768,
+39010,39299,39425,39528,40964,37505,37392,39096,
+41373,42243,40621,40317,40551,38203,38191,39174,
+42595,42401,42755,42668,42768,43224,40831,40831,
+40871,40894,40972,40972,41056,41056,41111,41130,
+41165,41165,41166,41166,41132,41121,41092,41092,
+41064,41064,40985,40946,40827,40827,40707,40707,
+40624,40605,40594,40594,40657,40657,40671,40670,
+40653,40653,40671,40671,40699,40702,40687,40687,
+40645,40645,40622,40616,40605,40605,40600,40600,
+40600,40607,40644,40644,40721,40721,40779,40800,
+40849,40849,40861,40861,40830,40818,40791,40791,
+40778,40778,40758,40749,40718,40718,40710,40710,
+40723,40727,40731,40731,40717,40717,40703,40697,
+40680,40680,40644,40644,40608,40586,40511,40511,
+40389,40389,40382,40396,40475,40475,40589,40589,
+40681,40715,40789,40789,40859,40859,40852,40841,
+40786,40786,40761,40761,40762,40760,40749,40749,
+40728,40728,40797,40839,40982,40982,41049,41049,
+41010,41001,40989,40989,41017,41017,41002,40987,
+40930,40930,40879,40879,40854,40848,40843,40843,
+40866,40866,40917,40945,41037,41037,41091,41091,
+41033,41023,41033,40959,41206,41089,40999,41113,
+41911,41507,41428,41120,41671,41586,41135,41135,
+41167,40721,41112,41121,41159,41474,41635,41156,
+41125,41118,41117,41117,41125,40864,41124,41122,
+41117,41117,41100,41100,41082,41079,41084,41084,
+41120,41120,41119,41114,41089,41089,41062,41062,
+41030,41026,41036,41036,41085,41085,41072,41056,
+40991,40415,40424,40322,40236,40636,40964,40964,
+40945,40945,40834,40805,40774,38844,36154,37583,
+40393,41048,41031,41031,41078,41078,41047,41019,
+40913,40913,40944,40944,41084,41142,41293,41293,
+41487,41487,41530,41524,41452,41452,41406,41406,
+41401,41398,41384,41384,41353,41353,41352,41357,
+41381,41381,41349,41349,41288,41264,41211,41211,
+41138,41138,41113,41110,41124,41124,41132,41132,
+41137,41141,41158,41158,41194,41194,41225,41238,
+41267,41267,41318,41318,41362,41368,41351,41351,
+41278,41278,41197,41169,41107,41107,41097,41097,
+41146,41170,41241,41241,41341,41341,41388,41398,
+41402,41402,41379,41379,41336,41315,41256,41256,
+41168,41168,41089,41059,40992,40992,40967,40967,
+40995,41018,41108,41108,41271,41271,41331,41342,
+41336,41336,41285,41285,41207,41177,41110,41110,
+41043,41043,41008,40999,40985,40985,40988,40988,
+40996,40991,40955,40955,40884,40884,40815,40783,
+40694,40694,40610,40610,40551,40527,40462,40462,
+40407,40407,40391,40389,40392,40392,40413,40413,
+40431,40432,40418,40418,40374,40374,40333,40314,
+40261,40261,40199,40199,40146,40127,40083,40083,
+40038,40038,39991,39973,39927,39927,39874,39874,
+39819,39797,39737,39737,39667,39667,39608,39586,
+39531,39531,39461,39461,39394,39372,39326,39326,
+39299,39299,39278,39268,39243,39243,39195,39195,
+39141,39119,39063,39063,38988,38988,38920,38891,
+38818,38818,38736,38736,38672,38646,38581,38581,
+38501,38501,38448,38430,38396,38396,38349,38349,
+38308,38293,38253,38253,38211,38211,38180,38170,
+38145,38145,38153,38153,38190,38199,38210,38210,
+38191,38191,38178,38174,38167,38167,38187,38187,
+38223,38228,38217,38217,38155,38155,38151,38159,
+38201,38201,38300,38300,38401,38431,38482,38482,
+38451,38451,38237,38121,37757,37757,37494,37494,
+37562,36658,34645,32302,31289,33401,35073,37141,
+37084,37350,38345,38415,38496,38621,38722,38510,
+38365,38437,38417,38340,38471,38477,38700,38743,
+38702,38897,38943,38889,38564,38410,38301,38322,
+38232,38265,38355,38309,38263,38385,38521,38653,
+38703,38726,38785,39178,39295,38972,38488,38460,
+38404,38486,38472,38398,38400,38453,38516,38312,
+38026,37944,37474,37440,37674,37633,37377,37212,
+37578,37466,37132,37175,37518,37602,38078,37880,
+37738,38073,38422,38812,39171,39013,38632,38431,
+38268,38303,38524,38593,38236,37748,37753,38020,
+38659,38955,39048,40420,40407,40407,40378,40378,
+40346,40326,40257,40257,40135,40135,40085,40075,
+40077,40077,40046,40046,39985,39965,39920,39920,
+39888,39888,39859,39846,39812,39812,39749,39749,
+39673,39641,39564,39564,39478,39478,39435,39424,
+39416,39416,39385,39385,39345,39336,39324,39324,
+39325,39325,39296,39278,39218,39218,39142,39142,
+39087,39062,38996,38996,38908,38908,38831,38799,
+38714,38714,38684,38684,38728,38757,38854,38854,
+39030,39030,39139,39174,39239,39239,39317,39317,
+39374,39396,39450,39450,39520,39520,39571,39590,
+39631,39631,39626,39626,39527,39476,39319,39319,
+39183,39183,41242,39918,39823,39616,38660,38845,
+39553,39090,38713,38254,36952,36688,37403,39065,
+39507,39024,39270,39212,39118,40221,39694,39294,
+39233,39174,39025,38504,38085,38869,38981,39325,
+39498,39559,38147,36704,37632,40248,38554,37396,
+40564,39259,38918,38314,37737,40239,39287,38118,
+38568,40154,41398,42930,43393,43128,40846,40846,
+40882,40905,40986,40986,41084,41084,41130,41141,
+41151,41151,41167,41167,41181,41182,41173,41173,
+41128,41128,41045,41005,40888,40888,40774,40774,
+40699,40678,40653,40653,40676,40676,40679,40676,
+40663,40663,40663,40663,40667,40667,40659,40659,
+40653,40653,40645,40641,40628,40628,40608,40608,
+40596,40602,40646,40646,40744,40744,40801,40818,
+40841,40841,40842,40842,40829,40822,40797,40797,
+40767,40767,40733,40716,40672,40672,40659,40659,
+40674,40678,40687,40687,40683,40683,40682,40682,
+40682,40682,40654,40654,40618,40598,40539,40539,
+40444,40444,40457,40478,40574,40574,40682,40682,
+40757,40785,40852,40852,40934,40934,40938,40930,
+40885,40885,40860,40860,40850,40846,40837,40837,
+40834,40834,40896,40932,41053,41053,41099,41099,
+41051,41038,41019,41019,41044,41044,41031,41018,
+40966,40966,40924,40924,40872,40867,40893,40893,
+42740,42789,42551,42646,42442,42790,42452,42016,
+42322,41184,40986,40986,41013,41013,41019,41016,
+40999,40999,41009,41009,41046,41054,41063,41063,
+41047,41047,41030,41023,41007,41007,41007,41007,
+41035,41047,41080,41080,40904,41100,41082,41069,
+41023,41023,40984,40984,40966,40964,40765,40966,
+40992,40992,40985,40979,40957,40957,40951,40951,
+40952,40961,41005,41005,40738,40662,41241,40331,
+40419,40210,40767,40704,40175,40460,40709,41186,
+41006,41006,39747,38374,37988,37337,37917,41105,
+41091,41093,41119,41119,41185,41185,41157,41129,
+41014,41014,41037,41037,41173,41223,41340,41340,
+41459,41459,41477,41469,41416,41416,41360,41360,
+41321,41311,41301,41301,41323,41323,41352,41365,
+41398,41398,41370,41370,41304,41280,41224,41224,
+41152,41152,41131,41131,41152,41152,41160,41160,
+41155,41157,41174,41174,41220,41220,41252,41261,
+41278,41278,41328,41328,41383,41392,41381,41381,
+41278,41278,41197,41169,41107,41107,41097,41097,
+41146,41170,41241,41241,41341,41341,41388,41398,
+41402,41402,41379,41379,41336,41315,41256,41256,
+41168,41168,41089,41059,40992,40992,40967,40967,
+40995,41018,41108,41108,41271,41271,41331,41342,
+41336,41336,41285,41285,41207,41177,41110,41110,
+41043,41043,41008,40999,40985,40985,40988,40988,
+40996,40991,40955,40955,40884,40884,40815,40783,
+40694,40694,40610,40610,40551,40527,40462,40462,
+40407,40407,40391,40389,40392,40392,40413,40413,
+40431,40432,40418,40418,40374,40374,40333,40314,
+40261,40261,40199,40199,40146,40127,40083,40083,
+40038,40038,39991,39973,39927,39927,39874,39874,
+39819,39797,39737,39737,39667,39667,39608,39586,
+39531,39531,39461,39461,39394,39372,39326,39326,
+39299,39299,39278,39268,39243,39243,39195,39195,
+39141,39119,39063,39063,38988,38988,38920,38891,
+38818,38818,38736,38736,38672,38646,38581,38581,
+38501,38501,38448,38430,38396,38396,38349,38349,
+38308,38293,38253,38253,38211,38211,38180,38170,
+38145,38145,38153,38153,38190,38199,38210,38210,
+38191,38191,38178,38174,38167,38167,38187,38187,
+38223,38228,38217,38217,38155,38155,38151,38159,
+38201,38201,38300,38300,38401,38431,38482,38482,
+38451,38451,38237,38121,37757,37757,37494,37494,
+37562,36050,32966,31944,33282,35144,36391,36856,
+36948,37769,38119,38364,38577,38603,38642,38473,
+38451,38596,38454,38484,38500,38495,38781,38889,
+38842,38857,38799,38666,38511,38266,38264,38224,
+38318,38421,38440,38366,38279,38253,38391,38516,
+38591,38632,38727,39008,39049,38925,38632,38548,
+38566,38620,38560,38566,38352,38438,38299,38309,
+38082,38022,37512,37389,37451,37287,37047,36948,
+37385,37350,37095,37220,37545,37989,38346,38091,
+38002,38352,38714,38952,38925,38799,38605,37864,
+37643,37866,38715,38582,38813,37764,37900,38056,
+38811,39129,39564,40420,40407,40407,40378,40378,
+40346,40326,40257,40257,40135,40135,40085,40075,
+40077,40077,40046,40046,39985,39965,39920,39920,
+39888,39888,39859,39846,39812,39812,39749,39749,
+39673,39641,39564,39564,39478,39478,39435,39424,
+39416,39416,39385,39385,39345,39336,39324,39324,
+39325,39325,39296,39278,39218,39218,39142,39142,
+39087,39062,38996,38996,38908,38908,38831,38799,
+38714,38714,38684,38684,38728,38757,38854,38854,
+39030,39030,39139,39174,39239,39239,39317,39317,
+39374,39396,39450,39450,39520,39520,39571,39590,
+39631,39631,39626,39626,39527,39476,39319,39319,
+39183,39183,41150,39618,40168,40221,38693,38984,
+39678,39272,38766,38286,37282,37284,38162,38845,
+39403,39210,39457,39467,39673,40172,40257,39707,
+39643,39229,40085,38775,38615,39058,39504,39704,
+40096,39216,37775,37542,37704,40756,40207,41251,
+40833,38869,39208,39049,39052,40196,40695,41108,
+39305,39431,41059,41735,43012,42858,43793,40846,
+40882,40905,40986,40986,41084,41084,41130,41141,
+41151,41151,41167,41167,41181,41182,41173,41173,
+41128,41128,41045,41005,40888,40888,40774,40774,
+40699,40678,40653,40653,40676,40676,40679,40676,
+40663,40663,40663,40663,40667,40667,40659,40659,
+40653,40653,40645,40641,40628,40628,40608,40608,
+40596,40602,40646,40646,40744,40744,40801,40818,
+40841,40841,40842,40842,40829,40822,40797,40797,
+40767,40767,40733,40716,40672,40672,40659,40659,
+40674,40678,40687,40687,40683,40683,40682,40682,
+40682,40682,40654,40654,40618,40598,40539,40539,
+40444,40444,40457,40478,40574,40574,40682,40682,
+40757,40785,40852,40852,40934,40934,40938,40930,
+40885,40885,40860,40860,40850,40846,40837,40837,
+40834,40834,40896,40932,41053,41053,41099,41099,
+41051,41038,41019,41019,41044,41044,41031,41018,
+40966,40966,40924,40924,40872,42667,40707,40825,
+42635,43096,42347,41637,41498,42139,43300,42610,
+42935,40980,40986,40986,41013,41013,41019,41016,
+40999,40999,41009,41009,41046,41054,41063,41063,
+41047,41047,41030,41023,41007,41007,41007,41007,
+41035,41047,41080,41080,41100,41100,41082,41069,
+41023,41023,40984,40984,40966,40964,40966,40870,
+40992,40992,40985,40979,40957,40957,40951,40951,
+40952,40961,41005,41005,41081,41081,39858,40194,
+40838,40610,40536,40705,40642,40243,40751,41174,
+40481,40520,40289,37211,36914,37580,41105,41105,
+41091,41093,41119,41119,41185,41185,41157,41129,
+41014,41014,41037,41037,41173,41223,41340,41340,
+41459,41459,41477,41469,41416,41416,41360,41360,
+41321,41311,41301,41301,41323,41323,41352,41365,
+41398,41398,41370,41370,41304,41280,41224,41224,
+41152,41152,41131,41131,41152,41152,41160,41160,
+41155,41157,41174,41174,41220,41220,41252,41261,
+41278,41278,41328,41328,41383,41392,41381,41381,
+41265,41265,41208,41193,41176,41176,41178,41178,
+41205,41220,41274,41274,41361,41361,41403,41413,
+41418,41418,41398,41398,41355,41335,41279,41279,
+41197,41197,41108,41073,40982,40982,40946,40946,
+40979,40998,41053,41053,41128,41128,41192,41220,
+41298,41298,41295,41295,41210,41178,41104,41104,
+41025,41025,40980,40966,40945,40945,40925,40925,
+40906,40895,40858,40858,40808,40808,40749,40719,
+40635,40635,40552,40552,40493,40469,40408,40408,
+40363,40363,40350,40347,40347,40347,40383,40383,
+40426,40433,40424,40424,40368,40368,40307,40279,
+40202,40202,40120,40120,40061,40041,40000,40000,
+39972,39972,39934,39917,39871,39871,39820,39820,
+39773,39754,39702,39702,39638,39638,39594,39580,
+39548,39548,39495,39495,39432,39410,39356,39356,
+39309,39309,39268,39252,39209,39209,39133,39133,
+39049,39021,38966,38966,38931,38931,38884,38862,
+38799,38799,38715,38715,38639,38612,38550,38550,
+38495,38495,38450,38432,38389,38389,38341,38341,
+38300,38287,38258,38258,38238,38238,38213,38201,
+38168,38168,38160,38160,38180,38190,38217,38217,
+38263,38263,38267,38261,38231,38231,38230,38230,
+38248,38250,38239,38239,38205,38205,38220,38235,
+38294,38294,38374,38374,38422,38432,38439,38439,
+38367,38367,38113,37991,37632,37632,37394,37394,
+37537,34864,32724,31272,34087,35209,36843,36898,
+37081,37734,38151,38350,38573,38641,38735,38681,
+38752,38757,38677,38480,38378,38508,38792,38743,
+38855,38814,38604,38481,38514,38464,38466,38376,
+38314,38338,38289,38294,38314,38223,38257,38366,
+38462,38505,38607,38923,38912,38842,38770,38798,
+38858,38781,38642,38600,38445,38325,38054,38341,
+38104,38002,37628,37378,37232,36953,36970,36926,
+37201,37295,37090,37167,37516,38165,38373,38299,
+38336,38596,38910,39022,38912,38808,38682,38171,
+38111,38475,38951,38652,39037,39003,38478,38185,
+38725,39315,40415,40411,40385,40385,40349,40349,
+40329,40313,40257,40257,40151,40151,40095,40082,
+40065,40065,40042,40042,40013,40000,39962,39962,
+39908,39908,39872,39858,39828,39828,39771,39771,
+39702,39674,39603,39603,39528,39528,39487,39476,
+39462,39462,39440,39440,39419,39415,39415,39415,
+39421,39421,39385,39363,39287,39287,39191,39191,
+39122,39096,39037,39037,38978,38978,38922,38895,
+38822,38822,38795,38795,38833,38862,38968,38968,
+39172,39172,39289,39324,39379,39379,39435,39435,
+39472,39490,39537,39537,39614,39614,39661,39674,
+39697,39697,39681,39681,39594,39546,39390,39390,
+39271,39271,41064,39691,39980,39935,38599,38952,
+39285,39097,39016,38384,37637,38080,38838,39386,
+39377,39493,40190,40062,40343,40084,40273,40805,
+39941,40089,40405,39300,39210,39938,40208,41176,
+40797,38838,39207,39671,37745,41045,40848,40233,
+40175,40250,40263,39966,39393,40272,40595,41576,
+40162,39929,41322,41541,42379,42599,43633,40848,
+40882,40906,40991,40991,41099,41099,41134,41138,
+41123,41123,41124,41124,41138,41139,41125,41125,
+41069,41069,40997,40966,40882,40882,40815,40815,
+40788,40775,40741,40741,40690,40690,40669,40664,
+40662,40662,40656,40656,40644,40640,40635,40635,
+40647,40647,40653,40653,40650,40650,40642,40642,
+40642,40651,40692,40692,40769,40769,40800,40804,
+40794,40794,40795,40795,40815,40818,40811,40811,
+40780,40780,40741,40723,40675,40675,40658,40658,
+40670,40674,40679,40679,40674,40674,40675,40678,
+40687,40687,40664,40664,40628,40614,40578,40578,
+40532,40532,40547,40560,40616,40616,40710,40710,
+40802,40833,40892,40892,40934,40934,40935,40930,
+40904,40904,40912,40912,40937,40946,40965,40965,
+40988,40988,41030,41049,41107,41107,41121,41121,
+41085,41071,41042,41042,41028,41028,41013,41007,
+40985,40985,40958,40958,40902,40161,39555,39585,
+41274,42017,41763,41088,41477,42235,42643,42582,
+42560,41004,43127,42242,41029,41029,41025,41019,
+40991,40991,41008,41008,41067,41085,41110,41110,
+41107,41107,41072,41052,40989,40989,40976,40976,
+41023,41040,41075,41075,41077,41077,41051,41038,
+40998,40998,40954,40954,40921,40913,40907,40907,
+40926,40926,40921,40917,40904,40904,40921,40921,
+40949,40966,41028,41028,41073,40572,39980,40129,
+41175,41047,40826,41275,41215,40415,39497,39805,
+39619,39911,39525,36635,37375,38676,41085,41085,
+41121,41138,41192,41192,41261,41261,41242,41217,
+41118,41118,41131,41131,41238,41272,41333,41333,
+41359,39370,41368,41370,41373,41373,41339,41339,
+41277,41262,41253,41253,41305,41305,41345,41360,
+41393,41393,41376,41376,41331,41313,41271,41271,
+41210,41210,41178,41171,41162,41162,41142,41142,
+41123,41125,41149,41149,41234,41234,41285,41300,
+41325,41325,41363,41363,41394,41395,41369,41369,
+41260,41260,41215,41206,41209,41209,41216,41216,
+41232,41244,41288,41288,41369,41369,41409,41419,
+41424,41424,41406,41406,41363,41343,41290,41290,
+41210,41210,41118,41079,40977,40977,40936,40936,
+40972,40988,41027,41027,41060,41060,41126,41162,
+41277,41277,41298,41298,41212,41178,41101,41101,
+41017,41017,40966,40951,40925,40925,40895,40895,
+40863,40849,40812,40812,40771,40771,40716,40688,
+40607,40607,40525,40525,40466,40441,40382,40382,
+40342,40342,40330,40327,40326,40326,40369,40369,
+40423,40432,40427,40427,40366,40366,40295,40263,
+40174,40174,40083,40083,40021,40001,39960,39960,
+39941,39941,39907,39890,39844,39844,39795,39795,
+39752,39734,39686,39686,39625,39625,39588,39576,
+39555,39555,39510,39510,39451,39427,39370,39370,
+39313,39313,39263,39243,39192,39192,39104,39104,
+39007,38975,38921,38921,38904,38904,38867,38847,
+38789,38789,38705,38705,38624,38595,38536,38536,
+38493,38493,38451,38433,38385,38385,38336,38336,
+38298,38285,38261,38261,38251,38251,38228,38216,
+38179,38179,38164,38164,38177,38186,38222,38222,
+38297,38297,38308,38302,38262,38262,38252,38252,
+38260,38260,38250,38250,38229,38229,38254,38272,
+38338,38338,38407,38407,38430,38431,38417,38417,
+38325,38325,38055,37930,37576,37576,36276,36118,
+36527,33924,34093,34820,34124,35533,36058,37604,
+37888,37896,38661,38722,38778,38993,38914,38969,
+38956,38777,38880,38812,38760,38757,38534,38519,
+38519,38515,38579,38516,38355,38374,38320,38182,
+38136,37923,38105,38105,38137,38304,38405,38419,
+38370,38383,38439,38666,38824,38911,38707,38887,
+39087,38691,38615,38777,38403,38342,38434,38196,
+37918,37682,37424,37150,36909,36891,37050,37036,
+36986,37219,37361,37580,37857,38132,38291,38261,
+38276,38578,38852,38952,38937,38538,38509,38303,
+38379,38665,38844,38704,38790,39890,39247,38744,
+39422,39960,40412,40406,40374,40374,40336,40336,
+40320,40307,40257,40257,40158,40158,40101,40085,
+40059,40059,40040,40040,40026,40015,39981,39981,
+39917,39917,39878,39864,39836,39836,39782,39782,
+39716,39689,39622,39622,39551,39551,39511,39500,
+39484,39484,39466,39466,39454,39452,39458,39458,
+39466,39466,39427,39403,39319,39319,39215,39215,
+39139,39113,39057,39057,39012,39012,38965,38942,
+38875,38875,38848,38848,38884,38914,39023,39023,
+39239,39239,39360,39394,39445,39445,39491,39491,
+39519,39534,39579,39579,39659,39659,39703,39715,
+39728,39728,39708,39708,39625,39578,39424,39424,
+39312,41277,41241,40292,39813,38803,38713,38817,
+38789,39380,38785,38607,38907,39455,40161,40987,
+40954,40907,40918,40597,40571,40326,40849,41543,
+40990,40733,40596,40462,40318,41510,41712,41427,
+40303,39169,39435,37848,38170,38327,39591,39485,
+40069,40692,40036,39811,39864,41467,42252,41533,
+40878,40698,41165,41790,42212,42773,43047,40849,
+40883,40907,40993,40993,41105,41105,41135,41136,
+41110,41110,41104,41104,41119,41118,41102,41102,
+41042,41042,40975,40948,40879,40879,40835,40835,
+40829,40821,40783,40783,40698,40698,40665,40659,
+40662,40662,40653,40653,40634,40630,40625,40625,
+40644,40644,40656,40659,40660,40660,40659,40659,
+40665,40674,40713,40713,40781,40781,40799,40798,
+40771,40771,40771,40771,40807,40815,40818,40818,
+40786,40786,40745,40727,40676,40676,40658,40658,
+40668,40672,40676,40676,40671,40671,40674,40676,
+40690,40690,40669,40669,40633,40622,40596,40596,
+40575,40575,40590,40600,40637,40637,40723,40723,
+40825,40856,40912,40912,40935,40935,40934,40931,
+40915,40915,40937,40937,40979,40994,41025,41025,
+41061,41061,41093,41105,41132,41132,41131,41131,
+41099,41087,41052,41052,41021,41021,41006,41001,
+40994,40994,40972,40972,42096,42054,42280,40928,
+40996,40996,41022,41024,41007,41007,40994,40994,
+41008,41014,41028,41028,41036,41036,41029,41021,
+40989,40989,41009,41009,41078,41097,41131,41131,
+41134,41134,41091,41066,40982,40982,40963,40963,
+41018,41037,41073,41073,41066,41066,41038,41024,
+40986,40986,40939,40939,40900,40889,40880,40880,
+40896,40896,40890,40887,40242,40698,40906,40906,
+40947,40969,41039,41039,41152,41232,41575,41499,
+41743,41846,41141,41186,40384,37317,35782,34840,
+36122,36101,35694,36656,37861,37634,37523,41075,
+41134,41160,41227,39982,38984,41298,41282,41260,
+41167,41167,41175,41175,41268,41295,38785,41329,
+41311,41311,41315,41322,41352,41352,41328,41328,
+41257,41240,41231,41231,41297,41297,41342,41358,
+41389,41389,41378,41378,41342,41329,41294,41294,
+41237,41237,41202,41190,41168,41168,41135,41135,
+41109,41110,41139,41139,41241,41241,41301,41319,
+41346,41346,41380,41380,41399,41396,41364,41364,
+41314,41314,41291,41284,41277,41277,41260,41260,
+41246,41248,41267,41267,41333,41333,41371,41382,
+41397,41397,41382,41382,41341,41324,41279,41279,
+41216,41216,41132,41093,40988,40988,40932,40932,
+40954,40959,40962,40962,40930,40930,40981,41018,
+41155,41155,41224,41224,41193,41177,41126,41126,
+41030,41030,40957,40932,40879,40879,40814,40814,
+40755,40734,40691,40691,40652,40652,40608,40589,
+40533,40533,40460,40460,40394,40370,40312,40312,
+40280,40280,40265,40262,40259,40259,40311,40311,
+40371,40384,40392,40392,40352,40352,40282,40248,
+40148,40148,40029,40029,39928,39899,39854,39854,
+39869,39869,39846,39832,39779,39779,39740,39740,
+39725,39715,39680,39680,39609,39609,39574,39565,
+39557,39557,39524,39524,39472,39449,39385,39385,
+39298,39298,39227,39201,39138,39138,39043,39043,
+38940,38907,38846,38846,38823,38823,38788,38770,
+38717,38717,38651,38651,38591,38571,38527,38527,
+38501,38501,38461,38441,38383,38383,38334,38334,
+38307,38299,38289,38289,38292,38292,38279,38270,
+38240,38240,38218,38218,38211,38216,38245,38245,
+38329,38329,38349,38347,38319,38319,38309,38309,
+38307,38306,38307,38307,38325,38325,38346,38356,
+38384,38384,38394,38394,38360,38342,38284,38284,
+38167,38167,37956,37875,37680,37680,36356,36978,
+36404,33747,34869,35318,34883,35836,36479,37839,
+38081,38033,38716,38777,38811,38980,38915,39073,
+39023,38997,38958,38754,38826,38720,38478,38497,
+38398,38327,38326,38324,38271,38173,38154,38135,
+38045,38081,38140,38091,38207,38351,38405,38507,
+38382,38496,38539,38589,38557,38580,38767,38637,
+38803,38647,38498,38569,38282,38326,38443,37851,
+37683,37591,37394,37182,37061,37097,37156,37216,
+37272,37294,37281,37829,38187,38368,38414,38478,
+38424,38414,38428,38729,38914,38343,38326,38396,
+38287,38481,39026,38978,39037,39841,39964,39344,
+39564,40046,40403,40389,40338,40338,40293,40293,
+40282,40274,40244,40244,40176,40176,40122,40101,
+40053,40053,40022,40022,40010,40002,39970,39970,
+39913,39913,39875,39860,39829,39829,39773,39773,
+39715,39692,39635,39635,39583,39583,39552,39543,
+39527,39527,39528,39528,39545,39549,39560,39560,
+39545,39545,39494,39466,39384,39384,39291,39291,
+39230,39210,39170,39170,39144,39144,39119,39106,
+39070,39070,39060,39060,39092,39118,39216,39216,
+39400,39400,39500,39527,39561,39561,39593,39593,
+39621,39635,39682,39682,39760,39760,39791,39794,
+39779,39779,39731,39731,39646,39602,39471,39471,
+41086,41100,41140,40706,39941,39047,38711,38663,
+39299,39536,39324,39315,39758,40373,40853,41437,
+41348,41124,40873,40702,40713,40184,40760,41111,
+40665,40814,40507,41191,40484,41026,41346,40840,
+39995,39812,39893,37849,38047,38434,39435,39623,
+39744,40305,40705,40263,40112,40785,41378,41779,
+41236,40750,40052,41181,42184,43221,40868,40868,
+40898,40917,40982,40982,41052,41052,41079,41084,
+41087,41087,41090,41090,41086,41081,41061,41061,
+41010,41010,40959,40939,40890,40890,40871,40871,
+40881,40875,40839,40839,40737,40737,40694,40685,
+40682,40682,40670,40670,40651,40647,40644,40644,
+40663,40663,40678,40683,40689,40689,40690,40690,
+40694,40701,40731,40731,40776,40776,40771,40761,
+40718,40718,40716,40716,40766,40779,40796,40796,
+40773,40773,40737,40719,40672,40672,40662,40662,
+40684,40690,40695,40695,40674,40674,40675,40680,
+40704,40704,40705,40705,40692,40691,40697,40697,
+40716,40716,40728,40731,40732,40732,40783,40783,
+40871,40898,40947,40947,40968,40968,40987,40994,
+41012,41012,41053,41053,41092,41109,41152,41152,
+41218,41218,41225,41217,41169,41169,41125,41125,
+41098,41086,41052,41052,41008,41008,40990,40989,
+41004,41004,40926,40926,40867,40865,40916,40916,
+40989,40989,41014,41012,40983,40983,40961,40961,
+40964,40967,40982,40982,41027,41027,41049,41051,
+41037,41037,41050,41050,41090,41100,41118,41118,
+41122,41122,41098,41084,41034,41034,41020,41020,
+41042,41050,41075,41075,41090,41090,41067,41053,
+41007,41007,40947,40947,40897,40882,40860,40860,
+40851,40851,40835,40829,40817,40372,40863,40863,
+40925,40958,41055,41055,40836,40845,41213,41958,
+41886,41590,40443,40117,38690,34800,33336,33142,
+35144,35935,35848,37312,38312,38471,41036,41036,
+41137,40159,40019,39043,38606,38705,38688,41375,
+41295,41295,41271,41271,41301,38884,41277,41277,
+41192,41192,41190,41204,41269,41269,41293,41293,
+41267,41262,41264,41264,41299,41299,41323,41331,
+41348,41348,41349,41349,41342,41339,41330,41330,
+41302,41302,41265,41250,41204,41204,41158,41158,
+41134,41136,41171,41171,41280,41280,41342,41361,
+41389,41389,41403,41403,41393,41386,41361,41361,
+41314,41314,41291,41284,41277,41277,41260,41260,
+41246,41248,41267,41267,41333,41333,41371,41382,
+41397,41397,41382,41382,41341,41324,41279,41279,
+41216,41216,41132,41093,40988,40988,40932,40932,
+40954,40959,40962,40962,40930,40930,40981,41018,
+41155,41155,41224,41224,41193,41177,41126,41126,
+41030,41030,40957,40932,40879,40879,40814,40814,
+40755,40734,40691,40691,40652,40652,40608,40589,
+40533,40533,40460,40460,40394,40370,40312,40312,
+40280,40280,40265,40262,40259,40259,40311,40311,
+40371,40384,40392,40392,40352,40352,40282,40248,
+40148,40148,40029,40029,39928,39899,39854,39854,
+39869,39869,39846,39832,39779,39779,39740,39740,
+39725,39715,39680,39680,39609,39609,39574,39565,
+39557,39557,39524,39524,39472,39449,39385,39385,
+39298,39298,39227,39201,39138,39138,39043,39043,
+38940,38907,38846,38846,38823,38823,38788,38770,
+38717,38717,38651,38651,38591,38571,38527,38527,
+38501,38501,38461,38441,38383,38383,38334,38334,
+38307,38299,38289,38289,38292,38292,38279,38270,
+38240,38240,38218,38218,38211,38216,38245,38245,
+38329,38329,38349,38347,38319,38319,38309,38309,
+38307,38306,38307,38307,38325,38325,38346,38356,
+38384,38384,38394,38394,38360,38342,38284,38284,
+38167,38167,37956,37875,37680,37680,37442,37134,
+36170,33715,35039,35639,35678,36787,37324,38025,
+38168,38223,38623,38754,38921,38961,38978,39044,
+38849,38970,38972,38850,38860,38642,38419,38430,
+38327,38221,38157,38113,38182,37983,38074,38202,
+38171,38180,38164,38126,38288,38287,38337,38469,
+38472,38512,38477,38641,38721,38654,38751,38673,
+38681,38566,38491,38564,38165,38109,38282,37841,
+37787,37690,37325,37203,37186,37335,37329,37335,
+37341,37189,37238,37900,38322,38585,38353,38383,
+38674,38447,38466,38963,38846,38406,38543,38537,
+38237,38400,39105,39152,39216,39464,39801,39799,
+39916,40420,40403,40389,40338,40338,40293,40293,
+40282,40274,40244,40244,40176,40176,40122,40101,
+40053,40053,40022,40022,40010,40002,39970,39970,
+39913,39913,39875,39860,39829,39829,39773,39773,
+39715,39692,39635,39635,39583,39583,39552,39543,
+39527,39527,39528,39528,39545,39549,39560,39560,
+39545,39545,39494,39466,39384,39384,39291,39291,
+39230,39210,39170,39170,39144,39144,39119,39106,
+39070,39070,39060,39060,39092,39118,39216,39216,
+39400,39400,39500,39527,39561,39561,39593,39593,
+39621,39635,39682,39682,39760,39760,39791,39794,
+39779,39779,39731,39731,39646,39602,39471,39471,
+41062,41192,40908,40897,39711,38983,38689,38711,
+38937,39740,40236,40477,40452,41022,41048,41252,
+41090,41070,40960,40875,40674,40214,40774,40821,
+41394,41111,40328,40893,40565,40759,40461,40247,
+39883,39581,39905,37844,38506,39087,39269,39175,
+38689,39315,41063,40924,40176,40617,41078,41283,
+40471,40356,40110,41151,42364,42981,40868,40868,
+40898,40917,40982,40982,41052,41052,41079,41084,
+41087,41087,41090,41090,41086,41081,41061,41061,
+41010,41010,40959,40939,40890,40890,40871,40871,
+40881,40875,40839,40839,40737,40737,40694,40685,
+40682,40682,40670,40670,40651,40647,40644,40644,
+40663,40663,40678,40683,40689,40689,40690,40690,
+40694,40701,40731,40731,40776,40776,40771,40761,
+40718,40718,40716,40716,40766,40779,40796,40796,
+40773,40773,40737,40719,40672,40672,40662,40662,
+40684,40690,40695,40695,40674,40674,40675,40680,
+40704,40704,40705,40705,40692,40691,40697,40697,
+40716,40716,40728,40731,40732,40732,40783,40783,
+40871,40898,40947,40947,40968,40968,40987,40994,
+41012,41012,41053,41053,41092,41109,41152,41152,
+41218,41218,41225,41217,41169,41169,41125,41125,
+41098,41086,41052,41052,41008,41008,40990,40989,
+40828,40293,40635,41611,40867,40865,40916,40916,
+40989,40989,41014,41012,40983,40983,40961,40961,
+40964,40967,40982,40982,41027,41027,41049,41051,
+41037,41037,41050,41050,41090,41100,41118,41661,
+41122,41122,41098,41084,41034,41140,41020,41020,
+41042,41050,41075,41075,41090,41090,41067,41053,
+41007,41007,40947,40947,40897,40882,40860,40860,
+40851,40851,40835,40829,40817,40817,40863,40863,
+40925,40958,41055,41055,41079,41318,41750,41584,
+41038,39511,38664,38056,36743,33974,33297,33940,
+36503,37162,38097,40925,40927,40927,41036,41036,
+41137,41177,41275,41275,41382,41382,38119,38593,
+41295,41295,41271,41271,41301,41302,41277,41277,
+41192,41192,41190,41204,41269,41269,41293,41293,
+41267,41262,41264,41264,41299,41299,41323,41331,
+41348,41348,41349,41349,41342,41339,41330,41330,
+41302,41302,41265,41250,41204,41204,41158,41158,
+41134,41136,41171,41171,41280,41280,41342,41361,
+41389,41389,41403,41403,41393,41386,41361,41361,
+41445,41445,41429,41407,41314,41314,41233,41233,
+41191,41182,41180,41180,41232,41232,41274,41289,
+41320,41320,41313,41313,41268,41254,41220,41220,
+41191,41191,41138,41112,41033,41033,40966,40966,
+40949,40943,40926,40926,40897,40897,40908,40921,
+40972,40972,41063,41063,41149,41169,41181,41181,
+41092,41092,40999,40962,40870,40870,40762,40762,
+40678,40650,40590,40590,40525,40525,40494,40487,
+40481,40481,40429,40429,40354,40327,40266,40266,
+40226,40226,40200,40193,40182,40182,40216,40216,
+40249,40259,40283,40283,40313,40313,40283,40261,
+40182,40182,40035,40035,39861,39813,39749,39749,
+39804,39804,39796,39781,39719,39719,39701,39701,
+39734,39736,39714,39714,39607,39607,39553,39540,
+39523,39523,39492,39492,39452,39431,39365,39365,
+39252,39252,39171,39142,39083,39083,39009,39009,
+38944,38917,38847,38847,38755,38755,38688,38665,
+38612,38612,38582,38582,38581,38578,38561,38561,
+38526,38526,38479,38456,38386,38386,38336,38336,
+38325,38322,38318,38318,38319,38319,38319,38319,
+38319,38319,38306,38306,38285,38279,38273,38273,
+38293,38293,38312,38321,38347,38347,38372,38372,
+38374,38379,38404,38404,38463,38463,38453,38437,
+38368,38368,38294,38294,38225,38197,38124,38124,
+38018,38018,37966,37964,38006,38006,37197,36803,
+35621,33261,35103,36131,37515,37850,38001,38320,
+38305,38313,38528,38650,38697,38740,38924,38907,
+38888,38858,38733,38924,38841,38810,38303,38234,
+38234,38073,38102,38095,37789,37882,38003,38009,
+37974,37891,37903,38095,38112,38121,38186,38247,
+38651,38688,38741,38754,38746,38716,38802,38758,
+38637,38549,38459,38391,38437,38359,38222,37815,
+37839,37760,37342,37298,37406,37442,37354,37289,
+37218,37412,37751,38252,38601,38622,38697,38592,
+38459,38943,38777,39040,38956,38766,38646,38729,
+38495,38615,38966,39222,39622,40342,40367,40367,
+40401,40401,40376,40360,40302,40302,40254,40254,
+40244,40239,40224,40224,40195,40195,40148,40127,
+40064,40064,39999,39999,39947,39929,39893,39893,
+39875,39875,39845,39829,39778,39778,39716,39716,
+39669,39650,39610,39610,39581,39581,39561,39555,
+39544,39544,39568,39568,39619,39629,39632,39632,
+39558,39558,39492,39466,39405,39405,39357,39357,
+39344,39339,39321,39321,39294,39294,39289,39291,
+39301,39301,39322,39322,39356,39374,39428,39428,
+39514,39514,39565,39580,39599,39599,39638,39638,
+39689,39711,39766,39766,39827,39827,39840,39836,
+39802,39802,39725,39725,39638,39597,39478,39478,
+40634,40207,40365,40655,40571,39347,39113,39177,
+39494,40841,40820,40763,41409,41151,40692,41273,
+41166,41095,40833,40716,40227,40038,40263,40930,
+41425,41076,40508,41319,41278,41248,40731,40903,
+41014,39424,37922,37841,38942,39757,40362,39935,
+39981,40077,40806,40789,41029,40282,39591,39518,
+41116,40914,40808,41768,40699,41125,40885,40885,
+40908,40916,40935,40935,40922,40922,40959,40986,
+41089,41089,41131,41131,41088,41074,41051,41051,
+41039,41039,41001,40982,40929,40929,40880,40880,
+40848,40838,40812,40812,40787,40787,40761,40752,
+40724,40724,40710,40710,40715,40716,40717,40717,
+40714,40714,40713,40713,40714,40714,40698,40698,
+40679,40678,40694,40694,40735,40735,40736,40731,
+40709,40709,40702,40702,40718,40723,40729,40729,
+40720,40720,40696,40683,40643,40643,40662,40662,
+40721,40735,40747,40747,40701,40701,40691,40695,
+40723,40723,40757,40757,40786,40799,40832,40832,
+40855,40855,40863,40863,40857,40857,40869,40869,
+40901,40918,40965,40965,41036,41036,41095,41119,
+41176,41176,41205,41205,41193,41197,41225,41225,
+41314,41314,41299,41274,41167,41167,41084,41084,
+41051,41041,41019,41019,41007,41007,40988,39592,
+39267,39944,41262,42020,40841,40846,40890,40890,
+40921,40921,40933,40936,40934,40934,40897,40897,
+40845,40840,40865,40865,41003,41003,41092,41117,
+41149,41149,41132,41132,41080,41061,41021,42866,
+41100,41058,41063,41545,41186,41186,41168,41168,
+41088,41071,41069,41069,41156,41156,41153,41138,
+41068,41068,40993,40993,40946,40929,40893,40893,
+40842,40842,40805,40796,40784,40784,40820,40820,
+40874,40456,40088,39331,39455,38356,37937,35866,
+34639,35615,37473,37670,38247,38649,38624,38967,
+39933,40284,40351,40907,40960,40960,41061,41061,
+41140,41177,41286,41286,41463,41463,41501,38258,
+38533,41416,41341,41341,41285,41259,41186,41186,
+41097,41097,41087,41094,41144,41144,41236,41236,
+41339,41365,41390,41390,41322,41322,41288,41279,
+41274,41274,41280,41280,41299,41307,41328,41328,
+41347,41347,41328,41314,41265,41265,41234,41234,
+41235,41241,41269,41269,41334,41334,41371,41382,
+41396,41396,41391,41391,41364,41361,41375,41375,
+41445,41445,41429,41407,41314,41314,41233,41233,
+41191,41182,41180,41180,41232,41232,41274,41289,
+41320,41320,41313,41313,41268,41254,41220,41220,
+41191,41191,41138,41112,41033,41033,40966,40966,
+40949,40943,40926,40926,40897,40897,40908,40921,
+40972,40972,41063,41063,41149,41169,41181,41181,
+41092,41092,40999,40962,40870,40870,40762,40762,
+40678,40650,40590,40590,40525,40525,40494,40487,
+40481,40481,40429,40429,40354,40327,40266,40266,
+40226,40226,40200,40193,40182,40182,40216,40216,
+40249,40259,40283,40283,40313,40313,40283,40261,
+40182,40182,40035,40035,39861,39813,39749,39749,
+39804,39804,39796,39781,39719,39719,39701,39701,
+39734,39736,39714,39714,39607,39607,39553,39540,
+39523,39523,39492,39492,39452,39431,39365,39365,
+39252,39252,39171,39142,39083,39083,39009,39009,
+38944,38917,38847,38847,38755,38755,38688,38665,
+38612,38612,38582,38582,38581,38578,38561,38561,
+38526,38526,38479,38456,38386,38386,38336,38336,
+38325,38322,38318,38318,38319,38319,38319,38319,
+38319,38319,38306,38306,38285,38279,38273,38273,
+38293,38293,38312,38321,38347,38347,38372,38372,
+38374,38379,38404,38404,38463,38463,38453,38437,
+38368,38368,38294,38294,38225,38197,38124,38124,
+38018,38018,37966,37964,38006,38006,36940,37032,
+36158,33751,34591,36089,37311,37759,37930,38264,
+38197,38358,38416,38381,38473,38644,38802,38793,
+38791,38709,38658,38902,38868,38889,38373,38203,
+38251,38147,38185,38151,37963,38052,38096,38029,
+37823,37826,37981,38081,38078,37984,38118,38159,
+38686,38665,38680,38663,38718,38850,38915,38983,
+38957,38642,38613,38515,38473,38346,38149,37954,
+37877,37873,37621,37546,37698,37604,37499,37427,
+37540,37721,38171,38530,38957,39148,38873,38725,
+38710,38649,38759,38838,39149,38738,38589,39495,
+38867,38702,39177,39396,40336,40342,40367,40367,
+40401,40401,40376,40360,40302,40302,40254,40254,
+40244,40239,40224,40224,40195,40195,40148,40127,
+40064,40064,39999,39999,39947,39929,39893,39893,
+39875,39875,39845,39829,39778,39778,39716,39716,
+39669,39650,39610,39610,39581,39581,39561,39555,
+39544,39544,39568,39568,39619,39629,39632,39632,
+39558,39558,39492,39466,39405,39405,39357,39357,
+39344,39339,39321,39321,39294,39294,39289,39291,
+39301,39301,39322,39322,39356,39374,39428,39428,
+39514,39514,39565,39580,39599,39599,39638,39638,
+39689,39711,39766,39766,39827,39827,39840,39836,
+39802,39802,39725,39725,39638,39597,39478,41656,
+40433,40250,40516,40403,40419,39797,39466,39391,
+39701,40812,40691,40820,41046,41228,41144,41334,
+41278,41168,40285,40093,39819,39587,40803,41548,
+41114,40739,40549,41326,41007,40765,40414,40968,
+40737,39075,37895,39544,39087,39736,39889,39699,
+39939,40103,41022,41092,41870,38336,37529,38195,
+41466,41219,40752,40920,40336,42028,43274,40885,
+40908,40916,40935,40935,40922,40922,40959,40986,
+41089,41089,41131,41131,41088,41074,41051,41051,
+41039,41039,41001,40982,40929,40929,40880,40880,
+40848,40838,40812,40812,40787,40787,40761,40752,
+40724,40724,40710,40710,40715,40716,40717,40717,
+40714,40714,40713,40713,40714,40714,40698,40698,
+40679,40678,40694,40694,40735,40735,40736,40731,
+40709,40709,40702,40702,40718,40723,40729,40729,
+40720,40720,40696,40683,40643,40643,40662,40662,
+40721,40735,40747,40747,40701,40701,40691,40695,
+40723,40723,40757,40757,40786,40799,40832,40832,
+40855,40855,40863,40863,40857,40857,40869,40869,
+40901,40918,40965,40965,41036,41036,41095,41119,
+41176,41176,41205,41205,41193,41197,41225,41225,
+41314,41314,41299,41274,41167,41167,41084,41084,
+41051,41041,41019,41019,41007,40644,39701,39656,
+40469,41700,41205,41647,40841,40846,40890,40890,
+40921,40921,40933,40936,40934,40934,40897,40897,
+40845,40840,40865,40865,41003,41003,41092,41117,
+41149,41149,41132,41132,41080,41061,41021,43072,
+41058,41058,41063,41177,41902,41553,41168,41168,
+41088,41071,41069,41069,41156,41156,41153,41138,
+41068,41068,40993,40993,40946,40929,40893,40893,
+40842,40842,40805,40796,40784,40784,38521,37832,
+37879,37236,36004,35462,34827,34574,34616,35373,
+35321,37187,40337,40127,40315,40423,40726,40772,
+41317,40779,40893,40907,40960,40960,41061,41061,
+41140,41177,41286,41286,41463,41463,41501,38717,
+41416,41416,41341,41341,41285,41259,41186,41186,
+41097,41097,41087,41094,41144,41144,41236,41236,
+41339,41365,41390,41390,41322,41322,41288,41279,
+41274,41274,41280,41280,41299,41307,41328,41328,
+41347,41347,41328,41314,41265,41265,41234,41234,
+41235,41241,41269,41269,41334,41334,41371,41382,
+41396,41396,41391,41391,41364,41361,41375,41375,
+41457,41457,41443,41419,41309,41309,41227,41227,
+41200,41193,41187,41187,41215,41215,41245,41257,
+41289,41289,41280,41280,41236,41221,41193,41193,
+41169,41169,41132,41113,41052,41052,40976,40976,
+40935,40922,40889,40889,40850,40850,40846,40851,
+40879,40879,40960,40960,41062,41090,41122,41122,
+41057,41057,40975,40940,40845,40845,40727,40727,
+40633,40603,40541,40541,40480,40480,40461,40458,
+40464,40464,40417,40417,40338,40309,40251,40251,
+40218,40218,40181,40168,40134,40134,40148,40148,
+40170,40179,40207,40207,40251,40251,40241,40229,
+40179,40179,40053,40053,39888,39843,39781,39781,
+39833,39833,39814,39795,39716,39716,39685,39685,
+39719,39722,39706,39706,39607,39607,39551,39536,
+39512,39512,39475,39475,39436,39416,39350,39350,
+39237,39237,39159,39133,39080,39080,39007,39007,
+38940,38912,38839,38839,38734,38734,38664,38639,
+38590,38590,38561,38561,38560,38557,38548,38548,
+38527,38527,38489,38467,38400,38400,38344,38344,
+38328,38324,38318,38318,38315,38315,38321,38325,
+38339,38339,38329,38329,38301,38293,38277,38277,
+38281,38281,38301,38313,38351,38351,38384,38384,
+38394,38405,38453,38453,38550,38550,38539,38516,
+38416,38416,38312,38312,38237,38210,38151,38151,
+38092,38092,38101,38123,38223,38223,37519,37479,
+36853,33920,34575,35631,37167,37693,37973,38159,
+38309,38375,38345,38378,38461,38497,38644,38655,
+38536,38523,38613,38746,38874,38836,38709,38190,
+38336,38077,38104,38103,38090,38100,38063,37845,
+37835,37882,37983,37989,38104,37774,37782,37920,
+38635,38631,38654,38812,38881,39009,38905,38875,
+38993,38822,38632,38567,38483,38332,38177,38182,
+38104,38026,37867,37807,37940,37786,37785,37773,
+37945,38233,38410,38914,39170,38953,38750,38785,
+38702,38880,38895,38926,39434,38841,38466,39780,
+39478,39296,39392,40326,40336,40341,40361,40361,
+40370,40370,40342,40326,40274,40274,40234,40234,
+40230,40229,40223,40223,40204,40204,40160,40138,
+40074,40074,40001,40001,39935,39914,39871,39871,
+39853,39853,39818,39799,39740,39740,39680,39680,
+39644,39631,39599,39599,39574,39574,39558,39553,
+39547,39547,39574,39574,39622,39631,39628,39628,
+39547,39547,39482,39459,39410,39410,39382,39382,
+39383,39382,39378,39378,39364,39364,39374,39382,
+39410,39410,39436,39436,39461,39472,39507,39507,
+39558,39558,39596,39609,39636,39636,39683,39683,
+39741,39763,39818,39818,39868,39868,39871,39864,
+39823,39823,39749,39749,39648,39616,41326,41141,
+40559,40630,40268,40037,39958,39323,39183,39324,
+39503,40567,41330,41771,41373,41077,41197,41575,
+41195,41019,40383,39656,39718,40460,40994,40787,
+41145,41419,41654,41055,40608,40521,40090,40439,
+39600,38361,37783,38020,39161,40057,39867,39887,
+40240,40799,42095,41714,41876,38220,37599,37869,
+41136,41462,41738,41520,41339,42038,43092,43557,
+40857,40856,40852,40852,40815,40815,40850,40881,
+40993,40993,41040,41040,40996,40984,40968,40968,
+40974,40974,40959,40950,40923,40923,40878,40878,
+40832,40819,40805,40805,40825,40825,40813,40802,
+40760,40760,40737,40737,40741,40742,40743,40743,
+40732,40732,40729,40729,40734,40734,40716,40716,
+40689,40685,40688,40688,40711,40711,40710,40707,
+40694,40694,40689,40689,40694,40696,40702,40702,
+40709,40709,40693,40684,40652,40652,40678,40678,
+40743,40758,40774,40774,40734,40734,40721,40723,
+40742,40742,40776,40776,40816,40833,40877,40877,
+40912,40912,40924,40924,40919,40919,40920,40920,
+40935,40947,40994,40994,41082,41082,41148,41173,
+41229,41229,41245,41245,41216,41213,41229,41229,
+41306,41306,41280,41253,41137,41137,41051,41051,
+41021,41014,41007,41007,41164,39703,39769,41272,
+42607,42583,40427,41069,40815,40821,40859,40859,
+40860,40860,40873,40879,40891,40891,40878,40878,
+40808,40799,40829,40829,40998,40830,41169,41140,
+41175,41175,41152,41152,41084,41057,40991,42546,
+41032,41032,41117,40986,41386,41258,41218,41218,
+41114,41090,41071,41071,41153,41153,41152,41137,
+41069,41069,40991,40991,40936,40921,40895,40895,
+40858,40858,39449,40808,40888,39153,37606,35971,
+35248,33839,33103,32544,32048,33549,35148,37917,
+38315,39420,40946,40385,40276,40423,41039,41399,
+40872,40865,40908,40932,41015,41015,41118,41118,
+41178,41211,41306,41306,41475,41475,41509,41501,
+41422,38778,41331,41331,41253,41221,41139,41139,
+41056,41056,41041,41046,41081,41081,41175,41175,
+41299,41333,41377,41377,41326,41326,41284,41269,
+41238,41238,41245,41245,41285,41300,41337,41337,
+41370,41370,41360,41350,41305,41305,41286,41286,
+41299,41307,41330,41330,41370,41370,41397,41405,
+41420,41420,41402,41402,41356,41349,41363,41363,
+41462,41462,41449,41424,41306,41306,41224,41224,
+41205,41199,41191,41191,41207,41207,41232,41243,
+41273,41273,41263,41263,41220,41206,41179,41179,
+41158,41158,41129,41113,41061,41061,40982,40982,
+40929,40911,40870,40870,40827,40827,40817,40817,
+40833,40833,40910,40910,41019,41049,41091,41091,
+41040,41040,40963,40928,40834,40834,40710,40710,
+40612,40580,40517,40517,40460,40460,40445,40444,
+40456,40456,40411,40411,40329,40301,40244,40244,
+40216,40216,40174,40156,40111,40111,40115,40115,
+40132,40140,40169,40169,40219,40219,40219,40213,
+40177,40177,40062,40062,39903,39859,39798,39798,
+39847,39847,39825,39802,39714,39714,39677,39677,
+39712,39716,39701,39701,39607,39607,39550,39534,
+39507,39507,39467,39467,39428,39408,39343,39343,
+39229,39229,39154,39129,39079,39079,39007,39007,
+38938,38910,38834,38834,38724,38724,38652,38628,
+38580,38580,38552,38552,38549,38548,38541,38541,
+38527,38527,38494,38473,38407,38407,38348,38348,
+38330,38325,38318,38318,38313,38313,38322,38328,
+38347,38347,38341,38341,38309,38299,38280,38280,
+38276,38276,38297,38309,38353,38353,38390,38390,
+38404,38418,38477,38477,38593,38593,38581,38555,
+38440,38440,38322,38322,38244,38217,38166,38166,
+38131,38131,38169,38202,38329,38329,38530,38530,
+37137,32300,32534,35614,37090,37455,37587,37840,
+38118,38106,38143,38110,38060,38363,38485,38511,
+38298,38261,38468,38574,38551,38809,38497,38555,
+38495,38448,38259,38147,38232,38183,38195,38096,
+38058,38150,38295,38295,38329,38262,38337,38461,
+38443,38730,38797,38945,39139,39243,39132,38895,
+38932,39004,38932,38770,38716,38804,38706,38690,
+38716,38704,38735,38547,38409,38090,38300,38526,
+38388,38350,38471,38730,38762,38793,38913,38699,
+38602,39033,39338,39361,39699,39586,39362,39734,
+39717,39831,40326,40326,40337,40341,40358,40358,
+40354,40354,40325,40309,40259,40259,40224,40224,
+40224,40224,40222,40222,40208,40208,40166,40144,
+40079,40079,40002,40002,39930,39907,39860,39860,
+39842,39842,39805,39785,39722,39722,39663,39663,
+39632,39621,39594,39594,39571,39571,39556,39552,
+39548,39548,39577,39577,39623,39632,39625,39625,
+39541,39541,39477,39456,39412,39412,39393,39393,
+39401,39403,39405,39405,39398,39398,39415,39425,
+39463,39463,39492,39492,39510,39519,39545,39545,
+39580,39580,39612,39624,39654,39654,39706,39706,
+39765,39789,39843,39843,39887,39887,39886,39878,
+39834,39834,39760,39760,39654,41049,40151,40093,
+40392,39897,38784,38431,39078,39530,39167,39820,
+39811,41140,41178,41365,41387,41522,41641,41518,
+41718,41476,40840,40987,40714,41435,41367,41115,
+41085,41123,40654,40524,40637,40518,40351,40290,
+39182,37462,38424,38641,38986,39581,39999,41035,
+40844,40979,40770,40694,40440,38088,38100,37931,
+41003,39825,39978,40419,40683,41443,42670,42979,
+43344,40827,40811,40811,40763,40763,40798,40828,
+40945,40945,40995,40995,40950,40939,40927,40927,
+40942,40942,40938,40934,40920,40920,40877,40877,
+40823,40810,40802,40802,40843,40843,40838,40827,
+40778,40778,40750,40750,40754,40755,40755,40755,
+40742,40742,40738,40738,40744,40744,40725,40725,
+40695,40688,40685,40685,40699,40699,40697,40695,
+40687,40687,40682,40682,40682,40683,40689,40689,
+40703,40703,40692,40684,40657,40657,40686,40686,
+40754,40770,40788,40788,40751,40751,40737,40737,
+40751,40751,40785,40785,40831,40849,40897,40897,
+40938,40938,40952,40954,40949,40949,40945,40945,
+40952,40962,41008,41008,41104,41104,41174,41199,
+41254,41254,41262,41262,41225,41220,41231,41231,
+41301,41301,41270,41241,41124,41124,41035,41035,
+41007,41001,41001,40690,39513,40753,43112,42770,
+42461,42053,40320,40402,40802,40808,40843,40843,
+40832,40832,40843,40850,40870,40870,40868,40868,
+41217,41647,40812,40875,40978,41549,41051,41191,
+41188,41188,41162,41162,41087,40709,38671,38368,
+41020,41020,39453,39004,40871,41294,41243,41243,
+41127,41098,41072,41072,38903,38781,41150,41136,
+40363,40190,39965,40005,39967,40916,40895,40895,
+40866,39822,41030,39550,38339,38549,40914,40364,
+38762,36766,38449,38643,38817,40181,41215,41200,
+40586,40095,40158,40172,40155,40781,40807,40807,
+40859,40859,40915,40946,41044,41044,41146,41146,
+41198,41226,41317,41317,41482,41482,41513,41504,
+41424,41424,41326,41326,41237,41202,41117,41117,
+41037,41037,41019,41021,41050,41050,41146,41146,
+41279,41316,41369,41369,41327,41327,41282,41264,
+41221,41221,41227,41227,41278,41297,41341,41341,
+41381,41381,41376,41367,41325,41325,41311,41311,
+41331,41339,41359,41359,41387,41387,41410,41417,
+41431,41431,41408,41408,41352,41343,41356,41356,
+41367,41367,41350,41331,41248,41248,41227,41227,
+41274,41285,41289,41289,41256,41256,41249,41251,
+41263,41263,41249,41249,41217,41204,41171,41171,
+41120,41120,41096,41087,41060,41060,40972,40972,
+40885,40854,40785,40785,40716,40716,40706,40709,
+40739,40739,40776,40776,40814,40828,40861,40861,
+40869,40869,40844,40829,40776,40776,40672,40672,
+40573,40543,40489,40489,40470,40470,40465,40464,
+40461,40461,40402,40402,40314,40287,40240,40240,
+40242,40242,40184,40155,40062,40062,40032,40032,
+40049,40057,40077,40077,40095,40095,40104,40109,
+40123,40123,40098,40098,40042,40024,39994,39994,
+39997,39997,39930,39890,39754,39754,39658,39658,
+39642,39636,39623,39623,39591,39591,39559,39545,
+39509,39509,39459,39459,39410,39387,39325,39325,
+39227,39227,39173,39157,39130,39130,39044,39044,
+38934,38896,38812,38812,38736,38736,38683,38666,
+38632,38632,38580,38580,38518,38503,38484,38484,
+38520,38520,38517,38508,38463,38463,38399,38399,
+38355,38341,38315,38315,38299,38299,38311,38320,
+38351,38351,38349,38349,38318,38311,38304,38304,
+38328,38328,38349,38358,38381,38381,38409,38409,
+38435,38462,38561,38561,38742,38742,38757,38738,
+38627,38627,38508,38508,38433,38416,38402,38402,
+38458,38458,38492,38506,38536,38536,38560,38560,
+38667,32074,31541,33341,37130,37332,37406,37867,
+38005,38016,38075,38097,38080,38311,38351,38264,
+38166,38116,38257,38385,38471,38523,38719,38466,
+38560,38473,38427,38338,38312,38288,38257,38256,
+38253,38280,38324,38465,38575,38677,38699,38633,
+38589,38613,38549,38843,39090,39310,39128,38914,
+38927,39007,38908,38891,38786,38855,38822,38883,
+38937,38988,38959,38886,38778,38495,38448,38634,
+38667,38446,38726,38925,38795,38849,39243,39132,
+39073,39330,39424,39498,40421,40421,40403,40396,
+40379,40379,40344,40344,40348,40348,40340,40340,
+40300,40300,40265,40253,40219,40219,40205,40205,
+40221,40226,40230,40230,40205,40205,40165,40145,
+40092,40092,40025,40025,39958,39932,39873,39873,
+39820,39820,39766,39742,39678,39678,39632,39632,
+39622,39615,39596,39596,39559,39559,39544,39543,
+39548,39548,39563,39563,39575,39575,39566,39566,
+39524,39524,39482,39467,39435,39435,39418,39418,
+39415,39416,39426,39426,39455,39455,39490,39506,
+39549,39549,39570,39570,39560,39561,39576,39576,
+39620,39620,39670,39691,39752,39752,39817,39817,
+39869,39887,39930,39930,39962,39962,39954,39944,
+39902,39902,39857,39857,41927,41235,40379,39938,
+39877,39292,38809,38985,39568,39616,39800,39865,
+40064,41158,41153,40979,41486,41632,41253,41535,
+41828,41591,41363,41083,41213,41281,41297,41087,
+41153,41238,40626,40662,40470,40554,40547,40289,
+39226,38053,38294,38928,39635,40046,40214,40928,
+40349,40585,39957,40264,39830,38004,39379,39180,
+40903,40538,39436,39776,40999,42054,43041,43144,
+43384,40738,40652,40652,40618,40618,40626,40637,
+40683,40683,40710,40710,40699,40699,40709,40709,
+40740,40740,40785,40807,40875,40875,40876,40876,
+40814,40804,40815,40815,40908,40908,40917,40905,
+40841,40841,40784,40784,40761,40756,40745,40745,
+40739,40739,40749,40755,40778,40778,40772,40772,
+40747,40737,40714,40714,40680,40680,40665,40661,
+40658,40658,40655,40655,40653,40657,40676,40676,
+40722,40722,40729,40727,40710,40710,40731,40731,
+40773,40787,40808,40808,40811,40811,40799,40794,
+40777,40777,40785,40785,40814,40831,40882,40882,
+40959,40959,40993,41002,41011,41011,41015,41015,
+41017,41026,41069,41069,41157,41157,41205,41217,
+41233,41233,41218,41218,41182,41173,41161,41161,
+41175,41175,41140,41119,41045,41045,40986,40986,
+40978,40976,40976,39894,39463,41050,42890,42492,
+42674,42370,40505,40405,40241,40773,40772,38949,
+40735,40735,40743,40758,40666,39976,40981,41099,
+41336,41859,41320,40863,41382,41510,41308,41221,
+41352,41130,41120,41120,41095,40291,38489,37017,
+40077,41130,39622,38633,41268,41268,41219,41219,
+41132,41107,41068,41068,41066,41066,41047,41035,
+40997,40997,40921,40921,40840,40822,40820,40820,
+40107,39755,40289,39882,39327,39585,41113,41113,
+40545,38731,39166,39631,39875,40744,40698,40402,
+40333,40164,40173,40740,40774,40788,40827,40827,
+40894,40894,40986,41028,41150,41150,41251,41251,
+41292,41310,41359,41359,41437,41437,41428,41410,
+41323,41323,41230,41230,41159,41132,41069,41069,
+41014,41014,40995,40992,40997,40997,41033,41033,
+41090,41117,41197,41197,41311,41311,41306,41287,
+41194,41194,41193,41193,41281,41310,41369,41369,
+41403,41403,41403,41397,41373,41373,41377,41377,
+41404,41413,41427,41427,41431,41431,41451,41461,
+41491,41491,41452,41452,41355,41331,41306,41306,
+41367,41367,41350,41331,41248,41248,41227,41227,
+41274,41285,41289,41289,41256,41256,41249,41251,
+41263,41263,41249,41249,41217,41204,41171,41171,
+41120,41120,41096,41087,41060,41060,40972,40972,
+40885,40854,40785,40785,40716,40716,40706,40709,
+40739,40739,40776,40776,40814,40828,40861,40861,
+40869,40869,40844,40829,40776,40776,40672,40672,
+40573,40543,40489,40489,40470,40470,40465,40464,
+40461,40461,40402,40402,40314,40287,40240,40240,
+40242,40242,40184,40155,40062,40062,40032,40032,
+40049,40057,40077,40077,40095,40095,40104,40109,
+40123,40123,40098,40098,40042,40024,39994,39994,
+39997,39997,39930,39890,39754,39754,39658,39658,
+39642,39636,39623,39623,39591,39591,39559,39545,
+39509,39509,39459,39459,39410,39387,39325,39325,
+39227,39227,39173,39157,39130,39130,39044,39044,
+38934,38896,38812,38812,38736,38736,38683,38666,
+38632,38632,38580,38580,38518,38503,38484,38484,
+38520,38520,38517,38508,38463,38463,38399,38399,
+38355,38341,38315,38315,38299,38299,38311,38320,
+38351,38351,38349,38349,38318,38311,38304,38304,
+38328,38328,38349,38358,38381,38381,38409,38409,
+38435,38462,38561,38561,38742,38742,38757,38738,
+38627,38627,38508,38508,38433,38416,38402,38402,
+38458,38458,38492,38506,38536,38536,37934,37896,
+38074,34396,31525,31955,36869,37372,37418,37688,
+37754,37945,37950,38049,38061,38282,38343,38272,
+38122,38109,38148,38223,38388,38458,38708,38502,
+38430,38142,38238,38282,37964,38285,38414,38418,
+38572,38614,38594,38660,38673,38716,38761,38572,
+38404,38423,38398,38632,38897,39281,39220,38882,
+38874,39021,38964,38966,38983,38895,38887,38959,
+38962,38897,38819,38755,38804,38692,38517,38468,
+38661,38685,38699,38918,39001,39012,39162,40370,
+40419,39919,40451,40451,40421,40421,40403,40396,
+40379,40379,40344,40344,40348,40348,40340,40340,
+40300,40300,40265,40253,40219,40219,40205,40205,
+40221,40226,40230,40230,40205,40205,40165,40145,
+40092,40092,40025,40025,39958,39932,39873,39873,
+39820,39820,39766,39742,39678,39678,39632,39632,
+39622,39615,39596,39596,39559,39559,39544,39543,
+39548,39548,39563,39563,39575,39575,39566,39566,
+39524,39524,39482,39467,39435,39435,39418,39418,
+39415,39416,39426,39426,39455,39455,39490,39506,
+39549,39549,39570,39570,39560,39561,39576,39576,
+39620,39620,39670,39691,39752,39752,39817,39817,
+39869,39887,39930,39930,39962,39962,39954,39944,
+39902,39902,39857,41853,41804,41314,40675,39612,
+39393,39126,39361,39778,40079,40445,39921,40030,
+41544,41387,40910,41127,41757,41705,41312,41668,
+41721,41923,41495,41090,41196,41727,41685,41329,
+41628,41438,41045,40609,40310,40308,40425,39952,
+39282,38056,37767,38712,40281,40499,40345,36659,
+39797,36446,36232,39845,39182,39732,40280,40404,
+41141,40453,40197,40084,41208,41907,43063,43377,
+43312,40738,40652,40652,40618,40618,40626,40637,
+40683,40683,40710,40710,40699,40699,40709,40709,
+40740,40740,40785,40807,40875,40875,40876,40876,
+40814,40804,40815,40815,40908,40908,40917,40905,
+40841,40841,40784,40784,40761,40756,40745,40745,
+40739,40739,40749,40755,40778,40778,40772,40772,
+40747,40737,40714,40714,40680,40680,40665,40661,
+40658,40658,40655,40655,40653,40657,40676,40676,
+40722,40722,40729,40727,40710,40710,40731,40731,
+40773,40787,40808,40808,40811,40811,40799,40794,
+40777,40777,40785,40785,40814,40831,40882,40882,
+40959,40959,40993,41002,41011,41011,41015,41015,
+41017,41026,41069,41069,41157,41157,41205,41217,
+41233,41233,41218,41218,41182,41173,41161,41161,
+41175,41175,41140,41119,41045,41045,40986,40986,
+40978,40976,39612,38944,39830,41834,42382,42084,
+42413,42170,40967,40753,39880,40773,40772,40772,
+40735,40735,40743,40758,40000,39798,40191,40724,
+41622,41932,41677,41087,41366,41422,41639,41203,
+41169,41130,41120,41120,41095,41083,39300,37405,
+38104,39383,39624,39518,41268,41268,41219,41219,
+41132,41107,41068,41068,41066,41066,41047,41035,
+40997,40997,40921,40921,40840,40822,40820,40820,
+40924,40924,40988,40202,40385,41277,41113,41113,
+41090,39384,39155,39172,39793,40024,40101,40489,
+40309,40741,40740,40740,40774,40788,40827,40827,
+40894,40894,40986,41028,41150,41150,41251,41251,
+41292,41310,41359,41359,41437,41437,41428,41410,
+41323,41323,41230,41230,41159,41132,41069,41069,
+41014,41014,40995,40992,40997,40997,41033,41033,
+41090,41117,41197,41197,41311,41311,41306,41287,
+41194,41194,41193,41193,41281,41310,41369,41369,
+41403,41403,41403,41397,41373,41373,41377,41377,
+41404,41413,41427,41427,41431,41431,41451,41461,
+41491,41491,41452,41452,41355,41331,41306,41306,
+41344,41344,41321,41304,41244,41244,41238,41238,
+41285,41294,41289,41289,41229,41229,41202,41196,
+41191,41191,41171,41171,41146,41136,41112,41112,
+41071,41071,41055,41049,41030,41030,40950,40950,
+40868,40838,40768,40768,40696,40696,40677,40676,
+40690,40690,40680,40680,40663,40663,40676,40676,
+40719,40719,40735,40735,40718,40718,40640,40640,
+40547,40517,40462,40462,40445,40445,40444,40444,
+40440,40440,40392,40392,40316,40293,40254,40254,
+40253,40253,40184,40148,40036,40036,39986,39986,
+39997,40002,40014,40014,40009,40009,40007,40011,
+40032,40032,40034,40034,40016,40011,40007,40007,
+40026,40026,39957,39912,39756,39756,39615,39615,
+39544,39523,39491,39491,39494,39494,39486,39481,
+39459,39459,39417,39417,39370,39348,39290,39290,
+39198,39198,39159,39150,39149,39149,39067,39067,
+38936,38894,38813,38813,38779,38779,38739,38722,
+38677,38677,38623,38623,38564,38549,38535,38535,
+38579,38579,38583,38575,38533,38533,38463,38463,
+38405,38384,38343,38343,38312,38312,38316,38322,
+38344,38344,38360,38360,38372,38381,38408,38408,
+38454,38454,38488,38503,38539,38539,38543,38543,
+38529,38547,38650,38650,38882,38882,38931,38925,
+38847,38847,38752,38752,38687,38675,38681,38681,
+38769,38769,38810,38817,38809,38809,37817,37422,
+37793,36202,31174,30193,36225,37043,37188,37438,
+37447,37733,37765,37910,38014,38044,37928,37825,
+37696,37750,37836,38002,38108,38275,38450,38439,
+38184,38083,37837,37917,38238,38322,38668,38752,
+38812,38844,38952,38915,38831,38742,38593,38512,
+38338,38190,38244,38483,38898,39124,39092,39061,
+39047,38915,39020,38719,38814,38932,38928,38740,
+38717,38615,38670,38650,38532,38669,38895,39178,
+39069,39071,39063,38780,38814,38939,40377,40377,
+40417,40428,40443,40443,40423,40423,40403,40394,
+40371,40371,40359,40359,40364,40361,40344,40344,
+40298,40298,40263,40251,40221,40221,40208,40208,
+40222,40225,40226,40226,40200,40200,40163,40145,
+40094,40094,40026,40026,39962,39936,39869,39869,
+39794,39794,39737,39716,39671,39671,39656,39656,
+39671,39671,39660,39660,39611,39611,39589,39584,
+39587,39587,39579,39579,39556,39549,39534,39534,
+39519,39519,39504,39499,39491,39491,39489,39489,
+39484,39485,39499,39499,39542,39542,39577,39591,
+39627,39627,39639,39639,39626,39627,39646,39646,
+39711,39711,39778,39807,39884,39884,39961,39961,
+40008,40025,40058,40058,40072,40072,40065,40059,
+40035,40035,41702,41716,41552,40803,40436,39240,
+39729,40529,41091,40885,41723,41828,41446,41637,
+41849,41183,40929,41388,42133,42041,41749,41903,
+41583,41322,41778,41810,42017,41835,42174,42064,
+41969,41931,41616,41319,40632,40426,39977,39716,
+40041,38514,38398,38074,40125,40485,39779,36381,
+36272,36165,35942,39315,39393,38944,37520,38293,
+41937,39618,39502,40202,40876,41919,43178,43513,
+43394,43237,43013,40572,40483,40483,40466,40459,
+40443,40443,40453,40453,40480,40492,40523,40523,
+40554,40554,40607,40633,40711,40711,40741,40741,
+40722,40725,40758,40758,40859,40859,40882,40878,
+40833,40833,40786,40786,40762,40757,40754,40754,
+40766,40766,40783,40791,40814,40814,40808,40808,
+40787,40776,40745,40745,40693,40693,40666,40657,
+40641,40641,40634,40634,40642,40648,40673,40673,
+40723,40723,40738,40739,40733,40733,40752,40752,
+40778,40788,40810,40810,40832,40832,40830,40826,
+40808,40808,40811,40811,40832,40844,40885,40885,
+40954,40954,40990,41001,41019,41019,41038,41038,
+41055,41066,41104,41104,41171,41171,41193,41195,
+41180,41180,41175,41175,41184,41180,41156,41156,
+41091,41091,41041,41020,40970,40970,40931,40931,
+40938,39573,38591,38576,41462,41299,41075,42006,
+41426,40758,40742,39987,40742,40738,40717,40717,
+40672,40672,40666,40677,40631,40244,40224,40717,
+41625,42535,42640,41689,41802,41945,41647,40325,
+40656,41092,41054,41054,41066,41065,41049,38233,
+37017,37724,38049,39648,41216,41216,41171,41171,
+41116,41096,41055,41055,41011,41011,40980,41476,
+40947,40947,40882,40882,40801,40784,40778,40778,
+39991,40271,39301,39927,41174,41174,41106,41106,
+41017,40978,40872,41091,40900,40900,40852,40838,
+40812,40812,40807,40807,40827,40841,40887,40887,
+40986,40986,41090,41132,41244,41244,41324,41324,
+41343,41352,41377,41377,41417,41417,41391,41368,
+41274,41274,41183,41183,41127,41104,41049,41049,
+40995,40995,40970,40965,40963,40963,40982,40982,
+41019,41046,41138,41138,41300,41300,41317,41302,
+41210,41210,41206,41206,41287,41314,41373,41373,
+41418,41418,41428,41429,41421,41421,41419,41419,
+41416,41419,41435,41435,41475,41475,41490,41491,
+41483,41483,41435,41435,41369,41350,41325,41325,
+41344,41344,41321,41304,41244,41244,41238,41238,
+41285,41294,41289,41289,41229,41229,41202,41196,
+41191,41191,41171,41171,41146,41136,41112,41112,
+41071,41071,41055,41049,41030,41030,40950,40950,
+40868,40838,40768,40768,40696,40696,40677,40676,
+40690,40690,40680,40680,40663,40663,40676,40676,
+40719,40719,40735,40735,40718,40718,40640,40640,
+40547,40517,40462,40462,40445,40445,40444,40444,
+40440,40440,40392,40392,40316,40293,40254,40254,
+40253,40253,40184,40148,40036,40036,39986,39986,
+39997,40002,40014,40014,40009,40009,40007,40011,
+40032,40032,40034,40034,40016,40011,40007,40007,
+40026,40026,39957,39912,39756,39756,39615,39615,
+39544,39523,39491,39491,39494,39494,39486,39481,
+39459,39459,39417,39417,39370,39348,39290,39290,
+39198,39198,39159,39150,39149,39149,39067,39067,
+38936,38894,38813,38813,38779,38779,38739,38722,
+38677,38677,38623,38623,38564,38549,38535,38535,
+38579,38579,38583,38575,38533,38533,38463,38463,
+38405,38384,38343,38343,38312,38312,38316,38322,
+38344,38344,38360,38360,38372,38381,38408,38408,
+38454,38454,38488,38503,38539,38539,38543,38543,
+38529,38547,38650,38650,38882,38882,38931,38925,
+38847,38847,38752,38752,38687,38675,38681,38681,
+38769,38769,38810,38817,38809,38809,37543,37549,
+38153,35226,30674,30004,36094,37083,37092,37292,
+37273,37506,37698,37735,37770,37888,37786,37716,
+37707,37788,37816,37921,37985,38025,38381,38378,
+38275,38220,37934,38076,38632,38570,38609,38900,
+38882,38935,38825,38825,38878,38703,38624,38499,
+37896,37946,38174,38762,38969,39059,38937,39040,
+38973,38599,38690,38531,38568,38796,38831,38682,
+38708,38885,38749,38819,38872,39227,40256,39222,
+38780,38951,38744,38809,39014,40355,40377,40377,
+40417,40428,40443,40443,40423,40423,40403,40394,
+40371,40371,40359,40359,40364,40361,40344,40344,
+40298,40298,40263,40251,40221,40221,40208,40208,
+40222,40225,40226,40226,40200,40200,40163,40145,
+40094,40094,40026,40026,39962,39936,39869,39869,
+39794,39794,39737,39716,39671,39671,39656,39656,
+39671,39671,39660,39660,39611,39611,39589,39584,
+39587,39587,39579,39579,39556,39549,39534,39534,
+39519,39519,39504,39499,39491,39491,39489,39489,
+39484,39485,39499,39499,39542,39542,39577,39591,
+39627,39627,39639,39639,39626,39627,39646,39646,
+39711,39711,39778,39807,39884,39884,39961,39961,
+40008,40025,40058,40058,40072,40072,40065,40059,
+40035,40035,41539,41722,41413,40908,40321,39207,
+40380,40977,41471,41161,41959,41954,41357,41328,
+41994,41364,41087,41143,41679,41852,41610,41721,
+41659,41324,41854,42011,41764,41528,41691,41931,
+42100,42163,41942,41523,40374,40132,40403,40547,
+40648,39599,39962,38799,39300,39873,40451,36306,
+36200,36094,35882,35806,39657,37262,36699,38299,
+40906,39391,39416,40059,40108,41607,43227,43224,
+43484,43439,43263,43322,40483,40483,40466,40459,
+40443,40443,40453,40453,40480,40492,40523,40523,
+40554,40554,40607,40633,40711,40711,40741,40741,
+40722,40725,40758,40758,40859,40859,40882,40878,
+40833,40833,40786,40786,40762,40757,40754,40754,
+40766,40766,40783,40791,40814,40814,40808,40808,
+40787,40776,40745,40745,40693,40693,40666,40657,
+40641,40641,40634,40634,40642,40648,40673,40673,
+40723,40723,40738,40739,40733,40733,40752,40752,
+40778,40788,40810,40810,40832,40832,40830,40826,
+40808,40808,40811,40811,40832,40844,40885,40885,
+40954,40954,40990,41001,41019,41019,41038,41038,
+41055,41066,41104,41104,41171,41171,41193,41195,
+41180,41180,41175,41175,41184,41180,41156,41156,
+41091,41091,41041,41020,40970,40970,40931,40931,
+40938,39208,39012,40411,40585,40424,40781,41576,
+41227,40758,40742,40742,40742,40738,40717,40717,
+40672,40672,40666,40677,40884,41229,40627,41107,
+41457,41948,42568,42178,42165,42216,41644,40562,
+39784,40354,41054,41054,41066,41065,41049,38323,
+37224,41056,41175,39411,39769,41216,41171,41171,
+41116,41096,41055,41055,41011,41011,40980,40969,
+40947,40947,40882,40882,40801,40784,40234,39751,
+39212,38898,38450,38106,41174,41174,41106,41106,
+41017,40978,40872,40872,40900,40900,40852,40838,
+40812,40812,40807,40807,40827,40841,40887,40887,
+40986,40986,41090,41132,41244,41244,41324,41324,
+41343,41352,41377,41377,41417,41417,41391,41368,
+41274,41274,41183,41183,41127,41104,41049,41049,
+40995,40995,40970,40965,40963,40963,40982,40982,
+41019,41046,41138,41138,41300,41300,41317,41302,
+41210,41210,41206,41206,41287,41314,41373,41373,
+41418,41418,41428,41429,41421,41421,41419,41419,
+41416,41419,41435,41435,41475,41475,41490,41491,
+41483,41483,41435,41435,41369,41350,41325,41325,
+41383,41383,41356,41341,41289,41289,41259,41259,
+41261,41257,41230,41230,41172,41172,41136,41126,
+41106,41106,41080,41080,41059,41052,41045,41045,
+41041,41041,41034,41027,41000,41000,40938,40938,
+40886,40866,40815,40815,40755,40755,40727,40719,
+40703,40703,40661,40661,40622,40614,40613,40613,
+40657,40657,40682,40686,40680,40680,40621,40621,
+40543,40516,40458,40458,40424,40424,40420,40420,
+40425,40425,40397,40397,40343,40326,40290,40290,
+40268,40268,40198,40163,40059,40059,40004,40004,
+40001,40001,40002,40002,39986,39986,39967,39965,
+39965,39965,39947,39947,39912,39906,39916,39916,
+39987,39987,39943,39905,39757,39757,39602,39602,
+39494,39462,39406,39406,39409,39409,39415,39415,
+39411,39411,39385,39385,39352,39335,39279,39279,
+39184,39184,39149,39143,39152,39152,39081,39081,
+38950,38910,38842,38842,38847,38847,38815,38795,
+38724,38724,38683,38683,38672,38670,38669,38669,
+38697,38697,38689,38677,38627,38627,38554,38554,
+38500,38480,38437,38437,38398,38398,38386,38384,
+38385,38385,38418,38418,38482,38507,38567,38567,
+38621,38621,38679,38706,38782,38782,38767,38767,
+38685,37800,38757,38757,38997,38997,39070,39076,
+39034,39034,38964,38964,38902,38889,38888,38888,
+38955,38955,39005,39019,39046,39046,37703,37722,
+38188,35110,31263,30239,35069,36859,37272,37264,
+37157,37215,37627,37726,37660,37797,37673,37670,
+37715,37711,37678,37844,37964,38084,38167,38230,
+38385,38296,38041,38127,38454,38530,38541,38781,
+38778,38898,38749,38742,38746,38575,38519,38459,
+37986,37991,38222,38795,38938,39033,38902,38781,
+38713,38488,38554,38492,38349,38293,38521,38707,
+38768,38865,38744,38799,38869,39255,39330,40270,
+38820,38800,38881,40305,40349,40349,40375,40375,
+40402,40411,40424,40424,40418,40418,40400,40390,
+40360,40360,40352,40352,40370,40373,40366,40366,
+40330,40330,40299,40286,40249,40249,40222,40222,
+40227,40227,40223,40223,40203,40203,40169,40151,
+40098,40098,40026,40026,39962,39935,39867,39867,
+39789,39789,39742,39729,39708,39708,39720,39720,
+39755,39760,39754,39754,39698,39698,39669,39662,
+39657,39657,39632,39632,39589,39575,39549,39549,
+39540,39540,39540,39544,39563,39563,39579,39579,
+39582,39585,39602,39602,39641,39641,39665,39673,
+39692,39692,39700,39700,39695,39700,39731,39731,
+39811,39811,39886,39918,39997,39997,40075,40075,
+40128,40143,40172,40172,40170,40170,40166,40164,
+40158,40158,41660,41553,41351,40754,39924,39468,
+40891,41212,41333,41001,41741,41992,41423,41849,
+41934,41615,41706,41197,41150,41403,41690,41839,
+41798,41722,41643,41651,41618,41540,41872,41913,
+42071,41998,42123,41301,40666,40496,40352,40366,
+40796,40221,40118,39877,39172,39983,40303,36394,
+36304,36213,36036,35968,36053,37370,37288,38007,
+38885,38258,39004,40306,40746,41525,43439,43200,
+43288,43883,43584,43382,40438,40438,40377,40356,
+40316,40316,40321,40321,40377,40396,40435,40435,
+40452,40452,40477,40488,40520,40520,40558,40558,
+40599,40618,40671,40671,40743,40743,40774,40779,
+40770,40770,40755,40755,40746,40747,40758,40758,
+40791,40791,40807,40813,40821,40821,40808,40808,
+40790,40781,40757,40757,40711,40711,40675,40661,
+40626,40626,40615,40615,40638,40648,40674,40674,
+40708,40708,40722,40726,40732,40732,40754,40754,
+40776,40785,40801,40801,40817,40817,40826,40828,
+40833,40833,40849,40849,40873,40882,40908,40908,
+40938,40938,40959,40966,40981,40981,41013,41013,
+41053,41069,41108,41108,41154,41154,41161,41156,
+41127,41127,41149,41149,41217,41226,41203,41203,
+41075,41075,41000,40976,40932,40932,40912,40912,
+40918,39534,39896,41535,40114,39885,40833,40784,
+40751,40751,40710,40710,40703,40697,40676,40676,
+40638,40638,40647,41257,41240,41612,41061,41233,
+41495,41858,41711,41493,42007,42287,42078,40616,
+39645,40241,41002,41002,41019,41022,41016,38760,
+40943,40943,41063,41095,39304,39465,41108,41108,
+41086,41074,41036,41036,40986,40986,40954,40943,
+40923,40923,40873,40873,40814,40501,40806,39837,
+38488,37946,38197,37408,41033,41033,40972,40972,
+40916,40898,40868,40868,40925,40925,40926,40924,
+40908,40908,40897,40897,40894,40902,40945,40945,
+41063,41063,41166,41205,41297,41297,41349,41349,
+41344,41347,41363,41363,41413,41413,41391,41368,
+41271,41271,41183,41183,41136,41116,41060,41060,
+40990,40990,40963,40960,40967,40967,41011,41011,
+41079,41110,41197,41197,41315,41315,41329,41320,
+41259,41259,41253,41253,41299,41318,41369,41369,
+41432,41432,41458,41464,41466,41466,41443,41443,
+41393,41387,41406,41406,41511,41511,41522,41509,
+41439,41439,41392,41392,41389,41389,41389,41389,
+41403,41403,41373,41358,41311,41311,41270,41270,
+41250,41239,41202,41202,41143,41143,41104,41091,
+41064,41064,41036,41036,41015,41011,41011,41011,
+41025,41025,41023,41016,40986,40986,40931,40931,
+40895,40880,40839,40839,40784,40784,40753,40740,
+40709,40709,40652,40652,40601,40590,40581,40581,
+40626,40626,40656,40662,40662,40662,40611,40611,
+40542,40515,40457,40457,40413,40413,40407,40408,
+40418,40418,40399,40399,40357,40341,40307,40307,
+40276,40276,40204,40170,40071,40071,40011,40011,
+40003,40000,39996,39996,39974,39974,39948,39941,
+39931,39931,39904,39904,39860,39854,39871,39871,
+39967,39967,39936,39901,39757,39757,39595,39595,
+39470,39431,39365,39365,39367,39367,39379,39382,
+39387,39387,39371,39371,39343,39328,39274,39274,
+39177,39177,39143,39139,39154,39154,39087,39087,
+38956,38918,38857,38857,38882,38882,38852,38830,
+38748,38748,38714,38714,38725,38729,38735,38735,
+38756,38756,38742,38728,38673,38673,38600,38600,
+38547,38527,38483,38483,38440,38440,38421,38415,
+38405,38405,38446,38446,38537,38570,38646,38646,
+38703,38703,38773,38806,38902,38902,38879,38879,
+38762,38751,38811,38811,39054,39054,39138,39151,
+39126,39126,39068,39068,39008,38996,38991,38991,
+39047,39047,39100,39119,39162,39162,39181,37641,
+37421,36612,34501,31084,33648,35862,37007,37002,
+37130,37102,37455,37771,37907,37669,37599,37569,
+37378,37422,37466,37596,37579,37649,37945,37959,
+38061,38122,38235,38363,38446,38423,38311,38298,
+38212,38239,38478,38449,38523,38241,38297,38241,
+38027,38072,38247,38540,38434,38495,38717,38493,
+38401,38065,37871,37916,38225,38183,38196,37906,
+38118,38265,38330,38589,38655,39114,40278,40278,
+40274,40274,40287,40299,40345,40345,40374,40374,
+40395,40402,40415,40415,40416,40416,40399,40389,
+40355,40355,40349,40349,40374,40378,40376,40376,
+40346,40346,40317,40302,40261,40261,40229,40229,
+40229,40228,40222,40222,40205,40205,40172,40154,
+40099,40099,40026,40026,39961,39934,39867,39867,
+39786,39786,39745,39735,39726,39726,39753,39753,
+39797,39804,39799,39799,39741,39741,39709,39701,
+39691,39691,39658,39658,39604,39588,39558,39558,
+39549,39549,39558,39566,39598,39598,39624,39624,
+39630,39634,39653,39653,39690,39690,39708,39714,
+39724,39724,39730,39730,39729,39737,39773,39773,
+39861,39861,39940,39971,40051,40051,40132,40132,
+40186,40202,40227,40227,40218,40218,40216,40216,
+40218,40218,41521,41499,41254,40829,40692,40476,
+40761,40439,40029,40310,40676,41089,41767,42017,
+41932,41701,41756,41532,40821,40726,40691,40824,
+40972,41626,41466,41483,41457,41788,41772,41423,
+41957,41952,42156,41611,41512,40994,40315,40333,
+40432,39385,39566,37225,39933,40179,40511,40883,
+36526,36468,36341,36307,36421,39856,39201,38240,
+38936,37552,38575,40051,41427,42386,42957,43186,
+42998,44468,44508,43480,43322,40417,40333,40305,
+40254,40254,40256,40256,40326,40348,40391,40391,
+40402,40402,40413,40417,40426,40426,40467,40467,
+40539,40565,40627,40627,40685,40685,40721,40730,
+40739,40739,40739,40739,40738,40741,40761,40761,
+40802,40802,40820,40824,40825,40825,40808,40808,
+40792,40784,40762,40762,40718,40718,40680,40664,
+40618,40618,40605,40605,40635,40647,40674,40674,
+40700,40700,40715,40720,40731,40731,40755,40755,
+40776,40783,40798,40798,40810,40810,40824,40830,
+40845,40845,40868,40868,40893,40901,40919,40919,
+40930,40930,40944,40949,40964,40964,41002,41002,
+41052,41071,41110,41110,41145,41145,41144,41137,
+41101,41101,41136,41136,41234,41249,41226,41226,
+41067,41067,40980,40955,40914,40914,40902,40902,
+40267,39635,41069,41024,40038,40413,40836,40785,
+40747,40747,40693,40693,40683,40677,40656,40656,
+40621,40621,40714,41101,41216,41547,42111,42301,
+41393,40668,40321,40387,41716,41122,40842,40695,
+41069,40307,40384,40975,40997,41001,41001,41001,
+40887,40887,41008,41044,41099,41099,41078,41078,
+41071,41063,41026,41026,40973,40973,40941,40856,
+40911,40911,40869,40869,40820,40513,40819,40819,
+40927,40927,40929,40935,40963,40963,40906,40906,
+40865,40859,40867,40867,40937,40937,40963,40966,
+40955,40955,40942,40942,40927,40933,40973,40973,
+41101,41101,41204,41240,41322,41322,41362,41362,
+41345,41344,41355,41355,41410,41410,41391,41368,
+41270,41270,41183,41183,41141,41122,41066,41066,
+40988,40988,40960,40957,40969,40969,41026,41026,
+41108,41141,41226,41226,41321,41321,41335,41329,
+41284,41284,41275,41275,41305,41321,41366,41366,
+41440,41440,41472,41481,41490,41490,41455,41455,
+41382,41372,41391,41391,41530,41530,41538,41519,
+41418,41418,41371,41371,41400,41409,41421,41421,
+41405,41405,41379,41362,41306,41306,41231,41231,
+41169,41144,41088,41088,41033,41033,40993,40978,
+40950,40950,40935,40935,40942,40946,40962,40962,
+40979,40979,40975,40968,40940,40940,40912,40912,
+40903,40894,40859,40859,40785,40785,40735,40715,
+40664,40664,40592,40592,40530,40513,40494,40494,
+40534,40534,40565,40572,40575,40575,40552,40552,
+40518,40502,40454,40454,40399,40399,40376,40369,
+40360,40360,40348,40348,40332,40326,40310,40310,
+40290,40290,40237,40213,40141,40141,40070,40070,
+40016,40001,39973,39973,39954,39954,39908,39888,
+39833,39833,39795,39795,39774,39775,39805,39805,
+39908,39908,39891,39865,39751,39751,39611,39611,
+39489,39446,39352,39352,39294,39294,39292,39298,
+39324,39324,39341,39341,39347,39341,39302,39302,
+39194,39194,39150,39142,39151,39151,39112,39112,
+39030,39004,38954,38954,38961,38961,38941,38927,
+38878,38878,38890,38890,38944,38954,38950,38950,
+38897,38897,38871,38863,38847,38847,38821,38821,
+38802,38794,38766,38766,38712,38712,38673,38658,
+38629,38629,38681,38681,38810,38856,38959,38959,
+39029,39029,39110,39147,39250,39250,39225,39225,
+39098,39079,39107,39107,39300,39300,39387,39408,
+39424,39424,39398,39398,39353,39341,39325,39325,
+39340,39340,39378,39396,39449,39449,39493,39493,
+37532,36653,35837,32123,32836,35308,36750,37012,
+36932,37133,37510,37578,37746,37290,37217,37373,
+37396,37441,37352,37286,37351,37290,37632,37639,
+37637,38436,38635,38612,38490,38477,38373,38413,
+38315,38214,38163,38121,38049,37935,37965,37975,
+37639,37826,38087,38417,38390,38446,38705,38515,
+38475,38119,37869,37871,38197,38309,38222,37896,
+37915,38242,40232,38412,38865,40295,40280,40280,
+40270,40270,40277,40285,40317,40317,40341,40341,
+40355,40359,40366,40366,40365,40365,40356,40351,
+40335,40335,40341,40341,40369,40375,40376,40376,
+40352,40352,40325,40311,40268,40268,40225,40225,
+40210,40205,40198,40198,40198,40198,40173,40156,
+40099,40099,40036,40036,39991,39973,39928,39928,
+39879,39879,39855,39850,39847,39847,39874,39874,
+39910,39915,39901,39901,39838,39838,39807,39800,
+39796,39796,39774,39774,39734,39723,39710,39710,
+39727,39727,39751,39762,39799,39799,39831,39831,
+39844,39851,39873,39873,39910,39910,39929,39936,
+39948,39948,39961,39961,39974,39984,40021,40021,
+40093,40093,40160,40187,40256,40256,40317,40317,
+40353,40364,40380,40380,40373,40373,40377,40382,
+40400,40400,40412,41322,40643,40540,40804,40734,
+40288,40171,40080,40154,40629,41119,41942,42145,
+42073,41682,41551,41174,40334,40140,40015,40206,
+40909,41386,41690,41796,41835,41521,41896,41154,
+41796,41878,41854,41642,41028,41211,40865,40674,
+40717,40145,39541,39727,40479,40609,40709,40881,
+40726,40339,36491,36464,41260,40855,39279,38817,
+40446,39470,38842,38951,41212,42252,43037,43168,
+43041,43953,44341,43653,43400,42932,40266,40241,
+40188,40188,40171,40171,40216,40232,40263,40263,
+40280,40280,40282,40280,40266,40266,40287,40287,
+40345,40367,40417,40417,40463,40463,40515,40537,
+40591,40591,40631,40631,40652,40664,40698,40698,
+40744,40744,40757,40757,40747,40747,40728,40728,
+40722,40720,40715,40715,40691,40691,40664,40650,
+40614,40614,40611,40611,40649,40663,40690,40690,
+40713,40713,40729,40736,40751,40751,40765,40765,
+40774,40776,40781,40781,40784,40784,40807,40819,
+40856,40856,40885,40885,40896,40899,40899,40899,
+40889,40889,40893,40897,40911,40911,40956,40956,
+41017,41037,41069,41069,41077,41077,41068,41059,
+41026,41026,41069,41069,41174,41191,41177,41177,
+41029,41029,40950,40929,40905,40905,40798,40167,
+38819,40747,41442,40935,40289,40333,40549,40720,
+40681,40681,40601,40601,40561,40549,40527,40527,
+40522,40522,40777,41335,41374,41788,42223,42362,
+42020,40729,40429,40609,40401,40272,40597,41675,
+41229,40855,39915,40930,40940,40940,40931,40931,
+40871,40871,40890,40904,40949,40949,40948,40948,
+40969,40969,40947,40947,40898,40898,40882,40882,
+40898,40898,40875,40875,40820,40810,40816,40816,
+40886,40886,40891,40882,40835,40835,40800,40800,
+40806,40820,40879,40879,40996,40996,41044,41054,
+41058,41058,41044,41044,41013,41013,41043,41043,
+41162,41162,41257,41292,41371,41371,41392,41392,
+41353,41342,41329,41329,41360,41360,41332,41307,
+41212,41212,41132,41132,41099,41084,41038,41038,
+40970,40970,40954,40958,40992,40992,41071,41071,
+41164,41193,41252,41252,41274,41274,41281,41281,
+41275,41275,41269,41269,41270,41275,41299,41299,
+41355,41355,41404,41424,41474,41474,41454,41454,
+41369,41352,41354,41354,41465,41465,41453,41427,
+41310,41310,41275,41275,41342,41364,41404,41404,
+41387,41387,41365,41347,41281,41281,41198,41198,
+41132,41107,41049,41049,40995,40995,40959,40947,
+40924,40924,40922,40922,40942,40950,40966,40966,
+40969,40969,40961,40955,40931,40931,40909,40909,
+40903,40893,40849,40849,40756,40756,40697,40675,
+40628,40628,40562,40562,40504,40488,40470,40470,
+40510,40510,40538,40544,40545,40545,40530,40530,
+40507,40495,40455,40455,40402,40402,40370,40359,
+40335,40335,40316,40316,40304,40300,40293,40293,
+40286,40286,40246,40226,40168,40168,40091,40091,
+40020,40000,39967,39967,39961,39961,39913,39888,
+39812,39812,39776,39776,39776,39783,39813,39813,
+39892,39892,39873,39849,39748,39748,39631,39631,
+39529,39489,39390,39390,39296,39296,39279,39282,
+39314,39314,39344,39344,39367,39365,39332,39332,
+39217,39217,39167,39156,39156,39156,39131,39131,
+39081,39061,39013,39013,38984,38984,38966,38958,
+38938,38938,38973,38973,39032,39040,39022,39022,
+38928,38928,38898,38894,38907,38907,38910,38910,
+38909,38905,38885,38885,38827,38827,38784,38768,
+38737,38737,38788,38788,38915,38961,39061,39061,
+39132,39132,39205,39236,39319,39319,39300,39300,
+39202,39187,39215,39215,39377,39377,39457,39477,
+39504,39504,39493,39493,39459,39450,39435,39435,
+39441,39441,39470,39485,39529,39529,39578,39578,
+39723,37578,37348,36132,30867,31294,34069,36829,
+37042,37100,37535,37458,37626,37003,36856,37268,
+37129,37190,37269,37233,37218,37164,37017,37049,
+37443,37787,38764,38456,37303,37480,37719,37962,
+37938,37464,37178,37285,37471,37757,37624,37643,
+37616,37588,37587,37742,38029,38233,38299,38257,
+38207,38094,38037,38135,38117,38114,38191,38125,
+38101,38084,38287,38526,40306,40306,40283,40283,
+40269,40269,40273,40280,40308,40308,40333,40333,
+40346,40349,40351,40351,40339,40339,40332,40330,
+40327,40327,40338,40338,40362,40367,40366,40366,
+40341,40341,40315,40301,40261,40261,40217,40217,
+40194,40188,40182,40182,40191,40191,40171,40155,
+40097,40097,40042,40042,40009,39998,39967,39967,
+39937,39937,39919,39913,39902,39902,39915,39915,
+39938,39938,39919,39919,39854,39854,39826,39820,
+39819,39819,39812,39812,39791,39787,39789,39789,
+39822,39822,39848,39859,39886,39886,39912,39912,
+39926,39933,39956,39956,39993,39993,40018,40028,
+40049,40049,40071,40071,40088,40097,40130,40130,
+40183,40183,40238,40260,40322,40322,40371,40371,
+40395,40403,40416,40416,40418,40418,40425,40430,
+40449,40449,40462,40658,40042,39689,39851,39883,
+39362,39622,39976,40546,40871,41238,41488,41753,
+41960,41509,41398,41292,41387,41098,40535,40138,
+40372,41183,42106,42167,42217,42188,42061,41848,
+41845,41893,41893,41667,41430,41104,41341,41238,
+41082,40955,40831,40502,41344,41311,40421,41001,
+41220,41002,40950,41278,41072,39991,39507,39612,
+41457,39745,39710,41646,41991,42430,42802,42868,
+43109,43591,43438,43399,45109,43637,43225,40235,
+40193,40193,40174,40174,40196,40205,40227,40227,
+40256,40256,40268,40270,40265,40265,40269,40269,
+40291,40301,40335,40335,40383,40383,40442,40466,
+40530,40530,40582,40582,40611,40624,40659,40659,
+40698,40698,40708,40708,40697,40697,40681,40681,
+40679,40678,40677,40677,40662,40662,40646,40638,
+40619,40619,40626,40626,40662,40674,40703,40703,
+40729,40729,40746,40752,40763,40763,40771,40771,
+40774,40774,40775,40775,40773,40773,40796,40808,
+40848,40848,40874,40874,40877,40877,40874,40874,
+40868,40868,40874,40879,40894,40894,40938,40938,
+40997,41013,41043,41043,41046,41046,41039,41033,
+41010,41010,41043,41043,41123,41135,41124,41124,
+41009,41009,40949,40628,40914,40914,39500,38455,
+39176,42175,41412,41148,41864,41260,40678,40678,
+40645,40645,40561,40561,40504,40488,40466,40466,
+40477,40477,41007,40389,40444,40830,41342,41770,
+42091,41521,40941,40113,39783,40694,40926,39146,
+39568,40340,39641,39395,39334,40930,40921,40921,
+40862,37715,37250,37937,37922,40907,40907,40907,
+38441,40930,40915,40915,40870,40870,40867,40873,
+39375,40908,40888,40888,40818,40802,40797,40797,
+40861,40861,40870,40864,40828,40828,40804,40804,
+40813,40828,40888,40888,41005,41005,41054,41066,
+41074,41074,41061,41061,41032,41031,41055,41055,
+41159,41159,41251,41287,41373,41373,41397,41397,
+41355,41342,41319,41319,41328,41328,41293,41266,
+41174,41174,41094,41094,41062,41048,41008,41008,
+40955,40955,40948,40955,40996,40996,41076,41076,
+41161,41186,41230,41230,41230,41230,41232,41234,
+41239,41239,41238,41238,41237,41239,41254,41254,
+41287,41287,41340,41364,41438,41438,41441,41441,
+41373,41357,41347,41347,41408,41408,41385,41362,
+41265,41265,41239,41239,41299,41320,41364,41364,
+41351,41351,41339,41318,41230,41230,41131,41131,
+41057,41030,40971,40971,40919,40919,40890,40882,
+40871,40871,40892,40892,40943,40957,40976,40976,
+40951,40951,40932,40925,40914,40914,40905,40905,
+40902,40889,40830,40830,40695,40695,40619,40595,
+40553,40553,40500,40500,40450,40437,40423,40423,
+40463,40463,40483,40487,40483,40483,40484,40484,
+40486,40481,40457,40457,40407,40407,40358,40338,
+40282,40282,40252,40252,40248,40249,40258,40258,
+40279,40279,40264,40255,40220,40220,40134,40134,
+40027,39998,39956,39956,39975,39975,39922,39887,
+39771,39771,39737,39737,39782,39797,39828,39828,
+39861,39861,39837,39817,39744,39744,39669,39669,
+39610,39577,39469,39469,39299,39299,39253,39253,
+39296,39296,39351,39351,39406,39412,39390,39390,
+39265,39265,39201,39184,39166,39166,39168,39168,
+39184,39178,39132,39132,39031,39031,39013,39019,
+39062,39062,39141,39141,39211,39215,39169,39169,
+38993,38993,38953,38959,39029,39029,39090,39090,
+39124,39131,39128,39128,39060,39060,39009,38992,
+38956,38956,39004,39004,39127,39171,39269,39269,
+39342,39342,39396,39416,39459,39459,39453,39453,
+39412,39408,39431,39431,39531,39531,39596,39619,
+39666,39666,39683,39683,39674,39671,39659,39659,
+39646,39646,39658,39665,39692,39692,39751,39751,
+39910,39951,37668,37173,33105,32312,32744,35709,
+36607,37000,37620,37514,37463,37381,37198,37400,
+37239,37228,37459,37408,37436,37436,37147,37228,
+37543,38029,38723,38389,37553,37437,37379,37217,
+37122,36991,37116,37227,37266,37729,37669,37598,
+37495,37181,37017,37397,37660,37865,37999,38081,
+38177,38060,37923,37960,38218,37952,37803,38081,
+38132,38181,38138,38470,40346,40331,40289,40289,
+40267,40267,40265,40270,40292,40292,40314,40314,
+40328,40329,40322,40322,40286,40286,40283,40287,
+40309,40309,40332,40332,40347,40350,40345,40345,
+40319,40319,40294,40282,40249,40249,40200,40200,
+40164,40155,40150,40150,40178,40178,40166,40151,
+40092,40092,40052,40052,40047,40046,40046,40046,
+40056,40056,40047,40040,40012,40012,39998,39998,
+39995,39987,39953,39953,39886,39886,39863,39859,
+39866,39866,39888,39888,39905,39916,39950,39950,
+40016,40016,40047,40054,40062,40062,40077,40077,
+40093,40101,40124,40124,40160,40160,40198,40214,
+40254,40254,40293,40293,40318,40327,40347,40347,
+40365,40365,40396,40411,40456,40456,40480,40480,
+40480,40481,40489,40489,40508,40508,40523,40530,
+40549,40549,40563,40311,39705,39719,39507,39445,
+39504,39924,40363,40591,40773,41127,41513,41692,
+41924,41382,41166,41127,41921,41876,41697,41342,
+40867,41420,41933,42157,42283,42207,42142,42059,
+41966,41924,41984,41597,41445,41411,41398,41589,
+41377,41002,40856,41074,41261,37081,41721,41529,
+41713,41682,41474,41960,41787,40423,39669,39696,
+43712,39556,39659,42029,42314,42720,43273,43099,
+43124,43412,43275,44509,44855,46279,44304,43479,
+43461,40204,40181,40181,40156,40151,40154,40154,
+40206,40206,40240,40250,40263,40263,40234,40234,
+40181,40170,40167,40167,40222,40222,40294,40324,
+40409,40409,40482,40482,40527,40544,40580,40580,
+40603,40603,40608,40607,40598,40598,40587,40587,
+40591,40594,40603,40603,40602,40602,40610,40615,
+40630,40630,40655,40655,40687,40699,40728,40728,
+40763,40763,40780,40784,40789,40789,40783,40783,
+40774,40771,40763,40763,40752,40752,40772,40786,
+40833,40833,40852,40852,40837,40832,40822,40822,
+40824,40824,40835,40841,40861,40861,40903,40903,
+40953,40967,40989,40989,40984,40984,40981,40980,
+40977,40977,40991,40991,41019,41023,41016,41016,
+40972,40972,40946,40939,40931,40931,39015,39049,
+40426,41683,41488,41340,42050,40575,40593,40593,
+40572,40572,40480,40480,40387,40364,40341,40341,
+40386,40386,40862,40309,40306,40875,40965,41217,
+41486,41463,41310,40779,39841,40685,40384,38173,
+38318,39868,38670,38466,38708,40909,40898,40898,
+40846,40846,40830,40826,40822,40822,40825,40825,
+40848,38664,40849,40849,40813,40813,40834,39198,
+39138,39901,40918,40918,40814,40788,40758,40758,
+40810,40810,40825,40826,40815,40815,40811,40811,
+40827,40843,40908,40908,41022,41022,41075,41090,
+41106,41106,41098,41098,41071,41068,41082,41082,
+41153,41153,41238,41275,41376,41376,41408,41408,
+41361,41342,41299,41299,41264,41264,41213,41184,
+41095,41095,41018,41018,40988,40976,40950,40950,
+40923,40923,40934,40948,41006,41006,41087,41087,
+41155,41173,41187,41187,41140,41140,41134,41139,
+41166,41166,41174,41174,41169,41167,41161,41161,
+41150,41150,41209,41245,41365,41365,41414,41414,
+41380,41366,41333,41333,41294,41294,41250,41230,
+41175,41175,41167,41167,41210,41229,41283,41283,
+41351,41351,41339,41318,41230,41230,41131,41131,
+41057,41030,40971,40971,40919,40919,40890,40882,
+40871,40871,40892,40892,40943,40957,40976,40976,
+40951,40951,40932,40925,40914,40914,40905,40905,
+40902,40889,40830,40830,40695,40695,40619,40595,
+40553,40553,40500,40500,40450,40437,40423,40423,
+40463,40463,40483,40487,40483,40483,40484,40484,
+40486,40481,40457,40457,40407,40407,40358,40338,
+40282,40282,40252,40252,40248,40249,40258,40258,
+40279,40279,40264,40255,40220,40220,40134,40134,
+40027,39998,39956,39956,39975,39975,39922,39887,
+39771,39771,39737,39737,39782,39797,39828,39828,
+39861,39861,39837,39817,39744,39744,39669,39669,
+39610,39577,39469,39469,39299,39299,39253,39253,
+39296,39296,39351,39351,39406,39412,39390,39390,
+39265,39265,39201,39184,39166,39166,39168,39168,
+39184,39178,39132,39132,39031,39031,39013,39019,
+39062,39062,39141,39141,39211,39215,39169,39169,
+38993,38993,38953,38959,39029,39029,39090,39090,
+39124,39131,39128,39128,39060,39060,39009,38992,
+38956,38956,39004,39004,39127,39171,39269,39269,
+39342,39342,39396,39416,39459,39459,39453,39453,
+39412,39408,39431,39431,39531,39531,39596,39619,
+39666,39666,39683,39683,39674,39671,39659,39659,
+39646,39646,39658,39665,39692,39692,39751,39751,
+39910,39951,38085,37654,35267,34133,33184,33423,
+35543,36740,37639,37795,37616,37633,37329,37297,
+37443,37391,37524,37631,37538,37570,37303,37458,
+37729,38213,38700,38486,37761,37412,37087,36635,
+36738,36747,36814,37023,37053,37589,37632,37422,
+37341,36969,36826,37277,37359,37596,37952,37964,
+38071,37875,37846,37871,37925,37715,37677,37864,
+38013,38231,38549,38717,40346,40331,40289,40289,
+40267,40267,40265,40270,40292,40292,40314,40314,
+40328,40329,40322,40322,40286,40286,40283,40287,
+40309,40309,40332,40332,40347,40350,40345,40345,
+40319,40319,40294,40282,40249,40249,40200,40200,
+40164,40155,40150,40150,40178,40178,40166,40151,
+40092,40092,40052,40052,40047,40046,40046,40046,
+40056,40056,40047,40040,40012,40012,39998,39998,
+39995,39987,39953,39953,39886,39886,39863,39859,
+39866,39866,39888,39888,39905,39916,39950,39950,
+40016,40016,40047,40054,40062,40062,40077,40077,
+40093,40101,40124,40124,40160,40160,40198,40214,
+40254,40254,40293,40293,40318,40327,40347,40347,
+40365,40365,40396,40411,40456,40456,40480,40480,
+40480,40481,40489,40489,40508,40508,40523,40530,
+40549,40549,40563,40530,40385,40323,39757,39267,
+39037,39415,40117,40632,40746,41011,41473,41644,
+41779,41081,40793,40934,41832,41880,41865,41966,
+41949,42031,42146,42241,42439,42203,42076,41947,
+41748,41652,41755,41591,41577,41723,41337,41418,
+41400,41220,41074,41368,40866,41851,37268,41664,
+41773,42020,41812,42599,42812,40837,40299,40701,
+43708,44342,39632,42341,42448,42808,43701,43568,
+42980,43570,43801,45275,44563,45541,44814,43608,
+43262,43329,40181,40181,40156,40151,40154,40154,
+40206,40206,40240,40250,40263,40263,40234,40234,
+40181,40170,40167,40167,40222,40222,40294,40324,
+40409,40409,40482,40482,40527,40544,40580,40580,
+40603,40603,40608,40607,40598,40598,40587,40587,
+40591,40594,40603,40603,40602,40602,40610,40615,
+40630,40630,40655,40655,40687,40699,40728,40728,
+40763,40763,40780,40784,40789,40789,40783,40783,
+40774,40771,40763,40763,40752,40752,40772,40786,
+40833,40833,40852,40852,40837,40832,40822,40822,
+40824,40824,40835,40841,40861,40861,40903,40903,
+40953,40967,40989,40989,40984,40984,40981,40980,
+40977,40977,40991,40991,41019,41023,41016,41016,
+40972,40972,40946,40939,40931,40931,38008,38416,
+40395,41495,42066,41843,40575,40575,41759,41367,
+40572,40572,40480,40480,40387,40364,40341,40341,
+40386,40386,40389,40779,40608,40430,40873,40700,
+40720,41340,41505,41576,39952,40176,39959,38402,
+37994,39073,38356,38092,40906,40909,40898,40898,
+40846,40846,40830,40826,40822,40822,40825,40825,
+40848,40852,40849,40849,40813,40813,40834,39159,
+40928,40928,40918,40918,40814,40788,40758,40758,
+40810,40810,40825,40826,40815,40815,40811,40811,
+40827,40843,40908,40908,41022,41022,41075,41090,
+41106,41106,41098,41098,41071,41068,41082,41082,
+41153,41153,41238,41275,41376,41376,41408,41408,
+41361,41342,41299,41299,41264,41264,41213,41184,
+41095,41095,41018,41018,40988,40976,40950,40950,
+40923,40923,40934,40948,41006,41006,41087,41087,
+41155,41173,41187,41187,41140,41140,41134,41139,
+41166,41166,41174,41174,41169,41167,41161,41161,
+41150,41150,41209,41245,41365,41365,41414,41414,
+41380,41366,41333,41333,41294,41294,41250,41230,
+41175,41175,41167,41167,41210,41229,41283,41283,
+41275,41275,41270,41255,41180,41180,41100,41100,
+41042,41018,40961,40961,40892,40892,40861,40855,
+40854,40854,40891,40891,40959,40975,40994,40994,
+40949,40949,40932,40931,40941,40941,40949,40949,
+40945,40929,40855,40855,40689,40689,40600,40575,
+40538,40538,40502,40502,40466,40457,40447,40447,
+40481,40481,40488,40487,40472,40472,40474,40474,
+40480,40478,40463,40463,40424,40424,40382,40365,
+40319,40319,40285,40285,40266,40264,40273,40273,
+40302,40302,40306,40304,40291,40291,40213,40213,
+40107,40077,40031,40031,40045,40045,40010,39988,
+39908,39908,39882,39882,39903,39909,39916,39916,
+39927,39927,39909,39896,39849,39849,39807,39807,
+39773,39746,39645,39645,39448,39448,39379,39371,
+39397,39397,39446,39446,39502,39510,39498,39498,
+39395,39395,39355,39350,39362,39362,39384,39384,
+39409,39404,39355,39355,39224,39224,39193,39196,
+39241,39241,39326,39326,39401,39409,39372,39372,
+39200,39200,39174,39188,39289,39289,39369,39369,
+39401,39408,39409,39409,39351,39351,39307,39294,
+39266,39266,39305,39305,39406,39442,39526,39526,
+39598,39598,39633,39640,39644,39644,39637,39637,
+39630,39632,39651,39651,39709,39709,39768,39794,
+39859,39859,39902,39902,39913,39913,39907,39907,
+39884,39884,39888,39894,39920,39920,39966,39966,
+40011,40041,40142,38701,37551,36595,33662,32504,
+34286,35239,36184,37452,37610,37658,37813,37468,
+37750,37732,37706,37869,37795,37679,37919,37995,
+38112,38617,38692,38360,37789,37433,37255,36045,
+35544,35787,36431,36871,37136,37598,37741,37512,
+37507,37354,37327,37367,37239,37309,37182,37151,
+37129,37322,37386,37500,37959,37892,37903,37874,
+37721,37871,40366,40366,40330,40314,40269,40269,
+40253,40253,40250,40251,40259,40259,40277,40277,
+40294,40297,40294,40294,40259,40259,40256,40259,
+40281,40281,40295,40295,40304,40304,40296,40296,
+40268,40268,40250,40243,40224,40224,40176,40176,
+40129,40116,40106,40106,40135,40135,40137,40132,
+40101,40101,40094,40094,40111,40119,40141,40141,
+40175,40175,40179,40174,40147,40147,40129,40129,
+40125,40118,40089,40089,40033,40033,40012,40010,
+40019,40019,40067,40067,40121,40143,40197,40197,
+40264,40264,40297,40305,40317,40317,40313,40313,
+40298,40296,40299,40299,40332,40332,40382,40404,
+40466,40466,40513,40513,40531,40536,40544,40544,
+40541,40541,40559,40570,40603,40603,40613,40613,
+40598,40595,40597,40597,40622,40622,40630,40632,
+40630,40630,40630,40630,41734,39901,39453,39336,
+38619,38899,39485,40273,40480,40668,40908,41060,
+41423,41424,41365,41568,41737,41764,41829,41907,
+42108,42207,42324,42446,42424,42333,42139,41995,
+41869,41727,41643,41525,41346,41257,41325,41237,
+41197,40940,40869,40801,39618,39172,41748,42871,
+42475,42630,42584,42761,42716,41355,41122,43816,
+43607,45358,43891,42033,41292,43747,42689,43117,
+43363,43725,44543,45480,44042,45554,44214,43150,
+43448,44226,42792,42559,40135,40115,40071,40071,
+40122,40122,40160,40173,40202,40202,40163,40163,
+40078,40057,40041,40041,40104,40104,40169,40194,
+40256,40256,40328,40328,40387,40408,40450,40450,
+40470,40470,40477,40477,40471,40471,40467,40467,
+40477,40483,40505,40505,40532,40532,40571,40591,
+40647,40647,40686,40686,40699,40705,40724,40724,
+40756,40756,40772,40777,40784,40784,40778,40778,
+40764,40758,40746,40746,40728,40728,40744,40756,
+40801,40801,40827,40827,40819,40817,40815,40815,
+40827,40827,40841,40847,40867,40867,40884,40884,
+40895,40898,40905,40905,40906,40906,40921,40928,
+40950,40950,40953,40953,40937,40931,40919,40919,
+40919,40919,40940,39160,38001,36499,36936,38277,
+39108,40806,40836,40836,42049,41555,41132,40470,
+40453,40453,40346,40346,40229,40200,40169,40169,
+40219,40219,40274,40293,40331,40331,40523,40675,
+40644,41324,41422,41272,40450,39246,38107,39128,
+38967,39052,39158,39085,40884,40902,40908,40908,
+40871,40871,40835,40817,40764,40764,40748,40748,
+40771,40775,40774,40774,40751,40751,40774,40792,
+40859,39989,40853,40853,40767,40747,40728,40728,
+40787,40787,40813,40819,40821,40821,40837,40837,
+40867,40883,40931,40931,40997,40997,41033,41044,
+41065,41065,41072,41072,41067,41069,41083,41083,
+41117,41117,41190,41226,41334,41334,41368,41368,
+41322,41302,41252,41252,41197,41197,41138,41110,
+41026,41026,40957,40957,40931,40925,40923,40923,
+40945,40945,40960,40966,40986,40986,41057,41057,
+41142,41158,41154,41154,41042,41042,41015,41018,
+41059,41059,41091,41091,41109,41112,41111,41111,
+41082,41082,41148,41190,41334,41334,41389,41389,
+41341,41323,41273,41273,41216,41216,41183,41174,
+41161,41161,41154,41154,41157,41165,41198,41198,
+41275,41275,41270,41255,41180,41180,41100,41100,
+41042,41018,40961,40961,40892,40892,40861,40855,
+40854,40854,40891,40891,40959,40975,40994,40994,
+40949,40949,40932,40931,40941,40941,40949,40949,
+40945,40929,40855,40855,40689,40689,40600,40575,
+40538,40538,40502,40502,40466,40457,40447,40447,
+40481,40481,40488,40487,40472,40472,40474,40474,
+40480,40478,40463,40463,40424,40424,40382,40365,
+40319,40319,40285,40285,40266,40264,40273,40273,
+40302,40302,40306,40304,40291,40291,40213,40213,
+40107,40077,40031,40031,40045,40045,40010,39988,
+39908,39908,39882,39882,39903,39909,39916,39916,
+39927,39927,39909,39896,39849,39849,39807,39807,
+39773,39746,39645,39645,39448,39448,39379,39371,
+39397,39397,39446,39446,39502,39510,39498,39498,
+39395,39395,39355,39350,39362,39362,39384,39384,
+39409,39404,39355,39355,39224,39224,39193,39196,
+39241,39241,39326,39326,39401,39409,39372,39372,
+39200,39200,39174,39188,39289,39289,39369,39369,
+39401,39408,39409,39409,39351,39351,39307,39294,
+39266,39266,39305,39305,39406,39442,39526,39526,
+39598,39598,39633,39640,39644,39644,39637,39637,
+39630,39632,39651,39651,39709,39709,39768,39794,
+39859,39859,39902,39902,39913,39913,39907,39907,
+39884,39884,39888,39894,39920,39920,39966,39966,
+40011,40041,40142,40142,37902,36879,34924,33072,
+33603,35285,35965,36432,36842,37708,37961,37764,
+37645,37703,37759,37688,37899,37964,37812,38075,
+38432,38507,38501,38209,38026,37578,37144,35744,
+35175,35649,36373,36643,36975,37790,38107,37968,
+37481,37289,37247,37390,37316,37388,37091,36931,
+36932,37051,37117,37253,37739,37591,37623,37894,
+37787,38025,40366,40366,40330,40314,40269,40269,
+40253,40253,40250,40251,40259,40259,40277,40277,
+40294,40297,40294,40294,40259,40259,40256,40259,
+40281,40281,40295,40295,40304,40304,40296,40296,
+40268,40268,40250,40243,40224,40224,40176,40176,
+40129,40116,40106,40106,40135,40135,40137,40132,
+40101,40101,40094,40094,40111,40119,40141,40141,
+40175,40175,40179,40174,40147,40147,40129,40129,
+40125,40118,40089,40089,40033,40033,40012,40010,
+40019,40019,40067,40067,40121,40143,40197,40197,
+40264,40264,40297,40305,40317,40317,40313,40313,
+40298,40296,40299,40299,40332,40332,40382,40404,
+40466,40466,40513,40513,40531,40536,40544,40544,
+40541,40541,40559,40570,40603,40603,40613,40613,
+40598,40595,40597,40597,40622,40622,40630,40632,
+40630,40630,40630,40630,41604,39573,38973,38985,
+38754,39091,39773,40322,40423,40634,40995,41171,
+41358,41376,41468,41532,41721,41581,41486,41482,
+41758,41976,42248,42272,42275,42225,42209,42399,
+42172,42133,41863,41591,41407,41279,41371,41348,
+41344,41121,40879,40820,41081,40614,42279,42742,
+42378,42658,42874,42826,42451,43558,45091,39978,
+45549,44640,41819,45712,43345,44312,42441,44922,
+43747,43010,45045,47171,43960,43386,43395,43513,
+44433,44482,44630,43193,42811,40115,40071,40071,
+40122,40122,40160,40173,40202,40202,40163,40163,
+40078,40057,40041,40041,40104,40104,40169,40194,
+40256,40256,40328,40328,40387,40408,40450,40450,
+40470,40470,40477,40477,40471,40471,40467,40467,
+40477,40483,40505,40505,40532,40532,40571,40591,
+40647,40647,40686,40686,40699,40705,40724,40724,
+40756,40756,40772,40777,40784,40784,40778,40778,
+40764,40758,40746,40746,40728,40728,40744,40756,
+40801,40801,40827,40827,40819,40817,40815,40815,
+40827,40827,40841,40847,40867,40867,40884,40884,
+40895,40898,40905,40905,40906,40906,40921,40928,
+40950,40950,40953,40953,40937,40931,40919,40919,
+40919,40919,40940,38654,37166,36082,38071,38990,
+40801,40806,40836,42397,41545,41603,41191,40470,
+40453,40453,40346,40346,40229,40200,40169,40169,
+40219,40219,40274,40293,40331,40331,40279,40562,
+40443,40777,40755,40935,41214,39453,37769,38619,
+39087,39315,39167,40806,40884,40902,40908,40908,
+40871,40871,40835,40817,40764,40764,40748,40748,
+40771,40775,40774,40774,40751,40751,40774,40792,
+40859,40859,40853,40853,40767,40747,40728,40728,
+40787,40787,40813,40819,40821,40821,40837,40837,
+40867,40883,40931,40931,40997,40997,41033,41044,
+41065,41065,41072,41072,41067,41069,41083,41083,
+41117,41117,41190,41226,41334,41334,41368,41368,
+41322,41302,41252,41252,41197,41197,41138,41110,
+41026,41026,40957,40957,40931,40925,40923,40923,
+40945,40945,40960,40966,40986,40986,41057,41057,
+41142,41158,41154,41154,41042,41042,41015,41018,
+41059,41059,41091,41091,41109,41112,41111,41111,
+41082,41082,41148,41190,41334,41334,41389,41389,
+41341,41323,41273,41273,41216,41216,41183,41174,
+41161,41161,41154,41154,41157,41165,41198,41198,
+41172,41172,41174,41172,41152,41152,41128,41128,
+41101,41084,41025,41025,40916,40916,40873,40865,
+40869,40869,40908,40908,40968,40983,40997,40997,
+40956,40956,40956,40962,40996,40996,41014,41014,
+41002,40983,40907,40907,40748,40748,40659,40633,
+40594,40594,40569,40569,40542,40535,40527,40527,
+40555,40555,40553,40548,40520,40520,40495,40495,
+40466,40457,40433,40433,40415,40415,40414,40419,
+40439,40439,40418,40418,40355,40340,40320,40320,
+40334,40334,40340,40341,40339,40339,40297,40297,
+40247,40228,40182,40182,40124,40124,40122,40131,
+40172,40172,40156,40156,40076,40053,40020,40020,
+40064,40064,40067,40061,40028,40028,39981,39981,
+39930,39903,39818,39818,39681,39681,39615,39598,
+39583,39583,39580,39580,39590,39590,39575,39575,
+39524,39524,39555,39583,39686,39686,39715,39715,
+39663,39640,39577,39577,39497,39497,39439,39420,
+39378,39378,39400,39400,39461,39475,39488,39488,
+39446,39446,39461,39480,39559,39559,39596,39596,
+39572,39563,39544,39544,39513,39513,39496,39492,
+39492,39492,39530,39530,39597,39625,39693,39693,
+39766,39766,39791,39793,39780,39780,39752,39752,
+39727,39725,39741,39741,39810,39810,39879,39907,
+39977,39977,40027,40027,40042,40046,40049,40049,
+40035,40035,40054,40068,40120,40120,40147,40147,
+40155,40163,40192,40192,40270,37099,36574,33281,
+32932,35442,35556,34959,36301,37863,38093,38192,
+37601,37643,37683,37841,38061,38044,38037,38217,
+38581,38557,38308,38077,37132,36899,36549,35762,
+35768,36276,36432,36618,36842,38038,38502,38334,
+37504,37278,37198,37376,37304,37307,37050,36942,
+36971,37126,37098,37266,37460,37274,37415,37815,
+37810,38215,40248,40248,40230,40223,40206,40206,
+40215,40215,40216,40214,40205,40205,40215,40215,
+40239,40248,40264,40264,40271,40271,40263,40257,
+40238,40238,40224,40224,40227,40225,40213,40213,
+40185,40185,40180,40180,40184,40184,40148,40148,
+40098,40084,40059,40059,40058,40058,40071,40079,
+40100,40100,40131,40131,40158,40168,40189,40189,
+40214,40214,40225,40227,40225,40225,40242,40242,
+40273,40280,40283,40283,40253,40253,40239,40238,
+40245,40245,40302,40302,40371,40393,40435,40435,
+40455,40455,40485,40500,40544,40544,40518,40518,
+40440,40419,40384,40384,40406,40406,40455,40478,
+40549,40549,40591,40591,40582,40579,40578,40578,
+40596,40596,40632,40649,40694,40694,40716,40716,
+40709,40707,40708,40708,40719,40719,40705,40696,
+40664,40664,40634,40634,41296,40179,39285,39218,
+39063,39085,39480,40268,40370,40599,40856,40920,
+41009,41178,41326,41297,41412,41585,41857,41007,
+41573,41577,41984,41887,41860,42035,42131,42287,
+42159,42017,41894,41687,41545,41425,41405,41296,
+41496,41467,41625,41999,41832,42050,42627,42882,
+42701,42790,43055,42720,42172,41245,41646,45007,
+40638,43982,43928,42300,44436,43454,44913,44410,
+43176,42673,42991,45435,45799,44302,43845,43618,
+43372,43325,44884,43488,44510,40052,39996,39996,
+40010,40010,40032,40042,40068,40068,40061,40061,
+40028,40025,40041,40041,40119,40119,40152,40158,
+40152,40152,40189,40189,40257,40281,40332,40332,
+40368,40368,40382,40383,40375,40375,40371,40371,
+40384,40394,40432,40432,40499,40499,40569,40599,
+40681,40681,40716,40716,40690,40683,40676,40676,
+40691,40691,40708,40715,40735,40735,40743,40743,
+40731,40726,40713,40713,40701,40701,40714,40723,
+40758,40758,40803,40803,40832,40842,40866,40866,
+40890,40890,40908,40916,40934,40934,40910,40910,
+40849,40834,40813,40813,40834,40834,40867,40882,
+40925,40925,40934,40934,40907,40897,40874,40874,
+40899,40899,40882,37400,37133,37003,38807,40754,
+40773,40774,40758,42880,41210,41347,41184,40356,
+40324,40324,40200,40200,40087,40053,40001,40001,
+40005,40005,40044,40060,40105,40105,40177,40177,
+40205,40224,40904,40722,40926,39871,38323,38691,
+39301,39645,39382,40795,40900,40925,40947,40947,
+40934,40934,40893,40869,40785,40785,40732,40732,
+40725,40721,40707,40707,40702,40702,40697,40694,
+40685,40685,40678,40678,40673,40678,40715,40715,
+40808,40808,40842,40847,40834,40834,40854,40854,
+40909,40924,40944,40944,40924,40924,40925,40928,
+40943,40943,40970,40970,41006,41017,41040,41040,
+41051,41051,41111,41142,41243,41243,41276,41276,
+41234,41218,41184,41184,41163,41163,41121,41097,
+41020,41020,40961,40961,40949,40951,40976,40976,
+41049,41049,41036,41017,40936,40936,40974,40974,
+41108,41134,41132,41132,40963,40963,40912,40910,
+40950,40950,41010,41010,41082,41103,41139,41139,
+41137,41137,41204,41241,41361,41361,41354,41354,
+41228,41195,41154,41154,41210,41210,41237,41243,
+41245,41245,41216,41216,41165,41152,41139,41139,
+41143,41143,41149,41148,41138,41138,41125,41125,
+41107,41092,41036,41036,40923,40923,40882,40875,
+40883,40883,40921,40921,40973,40986,40996,40996,
+40960,40960,40961,40967,41000,41000,41015,41015,
+40999,40980,40906,40906,40757,40757,40673,40648,
+40611,40611,40591,40591,40573,40567,40560,40560,
+40579,40579,40570,40563,40533,40533,40501,40501,
+40469,40458,40435,40435,40424,40424,40432,40440,
+40472,40472,40455,40455,40391,40374,40350,40350,
+40356,40356,40362,40363,40366,40366,40330,40330,
+40288,40270,40227,40227,40167,40167,40165,40174,
+40218,40218,40203,40203,40119,40095,40062,40062,
+40106,40106,40113,40110,40085,40085,40040,40040,
+39982,39954,39874,39874,39758,39758,39698,39682,
+39661,39661,39648,39648,39649,39647,39632,39632,
+39594,39594,39632,39662,39766,39766,39793,39793,
+39735,39712,39652,39652,39587,39587,39532,39511,
+39462,39462,39472,39472,39520,39532,39545,39545,
+39518,39518,39537,39556,39631,39631,39660,39660,
+39627,39615,39591,39591,39568,39568,39555,39553,
+39559,39559,39599,39599,39662,39686,39748,39748,
+39811,39811,39829,39829,39811,39811,39778,39778,
+39751,39749,39764,39764,39836,39836,39906,39934,
+40007,40007,40061,40061,40081,40087,40095,40095,
+40089,40089,40109,40123,40171,40171,40187,40187,
+40182,40186,40209,40209,40267,38117,37553,34057,
+33271,34911,35549,32613,33391,38027,38028,38314,
+38237,38199,37794,37641,37804,37795,38242,38573,
+38702,37675,37650,37244,34600,34817,35114,35733,
+36038,35994,35985,36161,36199,37128,37603,37788,
+37315,37371,37389,37421,37368,37273,37011,37049,
+37245,37381,37331,37288,37403,37411,37526,37739,
+37853,38716,40220,40220,40207,40201,40187,40187,
+40196,40196,40196,40194,40184,40184,40196,40196,
+40224,40234,40254,40254,40263,40263,40252,40244,
+40216,40216,40194,40194,40192,40189,40176,40176,
+40150,40150,40147,40148,40154,40154,40121,40121,
+40074,40059,40037,40037,40039,40039,40054,40063,
+40090,40090,40124,40124,40153,40163,40185,40185,
+40211,40211,40225,40228,40231,40231,40257,40257,
+40300,40311,40324,40324,40301,40301,40296,40297,
+40310,40310,40372,40372,40441,40463,40501,40501,
+40511,40511,40536,40549,40591,40591,40549,40549,
+40460,40434,40394,40394,40413,40413,40459,40480,
+40545,40545,40595,40595,40583,40578,40566,40566,
+40586,40586,40624,40642,40692,40692,40723,40723,
+40722,40722,40724,40724,40734,40734,40716,40705,
+40671,40671,40631,41522,41554,40504,40512,39718,
+39650,39653,39570,39835,40140,40424,40779,40728,
+40740,40596,40653,40769,41137,41647,41795,41519,
+41507,41463,41591,41761,41981,42000,42058,42156,
+41956,41879,41755,42424,42396,42444,42616,42685,
+42653,42546,42630,42673,42666,42503,42782,43647,
+43287,42108,43076,42856,41064,44302,43808,42731,
+46213,44944,45508,43927,40608,41029,43622,43576,
+44894,43619,43818,44343,45720,46516,46276,43847,
+43422,43795,45817,44289,43937,43996,44862,39983,
+40004,40004,40018,40025,40044,40044,40039,40039,
+40019,40020,40042,40042,40119,40119,40149,40152,
+40140,40140,40174,40174,40241,40264,40313,40313,
+40346,40346,40359,40360,40350,40350,40348,40348,
+40365,40377,40420,40420,40493,40493,40567,40599,
+40685,40685,40718,40718,40688,40680,40671,40671,
+40685,40685,40700,40707,40726,40726,40731,40731,
+40717,40712,40695,40695,40677,40677,40684,40692,
+40721,40721,40762,40762,40796,40808,40838,40838,
+40869,40869,40891,40900,40923,40923,40897,40897,
+40833,40815,40793,40793,40814,40814,40847,40862,
+40905,40905,40914,40914,40889,40880,40858,40858,
+39882,38442,36058,36551,38586,40727,40739,40739,
+40754,41894,42322,40878,41223,40635,40693,40335,
+40299,40299,40172,40172,40055,40019,39958,39958,
+39946,39946,39980,39996,40042,40042,40129,40129,
+40191,40218,40294,40294,40828,40900,40249,39112,
+39544,39926,39982,40798,40897,40921,40937,40937,
+40925,40925,40886,40863,40783,40783,40727,40727,
+40713,40705,40682,40682,40673,40673,40669,40666,
+40658,40658,40658,40658,40666,40676,40718,40718,
+40811,40811,40848,40854,40844,40844,40865,40865,
+40915,40927,40942,40942,40919,40919,40915,40916,
+40924,40924,40948,40948,40984,40997,41021,41021,
+41039,41039,41093,41122,41210,41210,41238,41238,
+41200,41187,41157,41157,41139,41139,41100,41078,
+41003,41003,40953,40953,40954,40960,40988,40988,
+41051,41051,41032,41010,40923,40923,40953,40953,
+41084,41110,41107,41107,40943,40943,40889,40884,
+40916,40916,40972,40972,41046,41069,41109,41109,
+41115,41115,41181,41218,41334,41334,41326,41326,
+41204,41172,41134,41134,41196,41196,41229,41237,
+41246,41246,41212,41212,41152,41135,41116,41116,
+41086,41086,41097,41101,41110,41110,41118,41118,
+41119,41109,41059,41059,40938,40938,40900,40896,
+40915,40915,40949,40949,40984,40992,40994,40994,
+40966,40966,40970,40977,41008,41008,41016,41016,
+40992,40973,40904,40904,40776,40776,40701,40679,
+40646,40646,40639,40639,40636,40634,40627,40627,
+40626,40626,40605,40594,40557,40557,40513,40513,
+40473,40462,40440,40440,40441,40441,40469,40486,
+40541,40541,40532,40532,40466,40446,40414,40414,
+40403,40403,40408,40411,40422,40422,40397,40397,
+40370,40357,40320,40320,40255,40255,40253,40262,
+40314,40314,40299,40299,40207,40182,40148,40148,
+40192,40192,40208,40209,40201,40201,40160,40160,
+40088,40059,39990,39990,39916,39916,39870,39854,
+39821,39821,39789,39789,39773,39766,39753,39753,
+39740,39740,39792,39823,39929,39929,39950,39950,
+39881,39856,39805,39805,39770,39770,39721,39699,
+39637,39637,39624,39624,39643,39649,39662,39662,
+39666,39666,39693,39712,39776,39776,39789,39789,
+39737,39721,39690,39690,39678,39678,39677,39680,
+39697,39697,39741,39741,39793,39812,39859,39859,
+39901,39901,39905,39900,39875,39875,39833,39833,
+39799,39795,39811,39811,39885,39885,39960,39991,
+40070,40070,40132,40132,40162,40172,40193,40193,
+40199,40199,40220,40233,40275,40275,40267,40267,
+40239,40235,40244,40244,40259,38310,37604,34818,
+33832,33826,36398,33712,31887,37420,37886,38242,
+38364,38494,38244,37709,37743,37593,37897,38223,
+38643,37092,36207,35907,33884,33741,34259,35327,
+35445,35599,35382,35361,35430,35959,36401,36973,
+36633,36697,37164,37386,37397,37400,37213,37221,
+37314,37548,37466,37366,37561,37613,37584,37798,
+38590,40148,40165,40165,40158,40155,40148,40148,
+40156,40156,40157,40154,40142,40142,40157,40157,
+40194,40206,40231,40231,40245,40245,40228,40216,
+40171,40171,40132,40132,40121,40116,40100,40100,
+40077,40077,40080,40082,40091,40091,40064,40064,
+40021,40008,39990,39990,39999,39999,40020,40032,
+40069,40069,40111,40111,40141,40152,40176,40176,
+40205,40205,40224,40231,40242,40242,40289,40289,
+40355,40375,40407,40407,40402,40402,40409,40416,
+40445,40445,40514,40514,40585,40604,40634,40634,
+40627,40627,40640,40650,40686,40686,40609,40609,
+40498,40465,40412,40412,40426,40426,40465,40482,
+40534,40534,40604,40604,40583,40573,40542,40542,
+40562,40562,40605,40626,40686,40686,40735,40735,
+40749,40753,40758,40758,40946,40763,40737,40723,
+40682,40682,40638,41544,41822,40339,40680,40194,
+39361,39650,39916,40407,40680,41192,41889,41061,
+40835,40375,41305,41466,41137,41188,41046,41599,
+41970,42179,41685,42014,42132,42085,42072,42085,
+42112,41819,41697,42461,42589,42549,42342,42353,
+42363,42664,42617,42598,43028,43100,43140,43667,
+43297,42998,43434,41920,43390,46118,45701,43261,
+45814,45390,43104,42579,41080,41824,42469,43384,
+41685,44581,41855,42157,45074,46116,45992,43988,
+43484,43887,45494,43301,43942,45772,44533,44705,
+39993,39993,39993,39993,39994,39994,39995,39995,
+40002,40009,40045,40045,40120,40120,40141,40141,
+40118,40118,40144,40144,40210,40232,40276,40276,
+40304,40304,40313,40313,40300,40300,40301,40301,
+40326,40341,40393,40393,40480,40480,40565,40600,
+40693,40693,40724,40724,40684,40674,40658,40658,
+40673,40673,40687,40693,40709,40709,40708,40708,
+40691,40682,40657,40657,40628,40628,40625,40627,
+40644,40644,40678,40678,40720,40737,40779,40779,
+40824,40824,40855,40867,40896,40896,40870,40870,
+40798,40778,40753,40753,40774,40774,40806,40821,
+40861,40861,40872,40872,40852,40844,40825,40825,
+39086,37269,36123,38571,40674,40674,40710,40710,
+40715,42295,41619,40260,40759,39933,39862,40290,
+40252,40252,40115,40115,39992,39951,39870,39870,
+39828,39828,39850,39865,39914,39914,40028,40028,
+40163,40206,40288,40288,40911,40878,40299,38899,
+40029,40185,39720,40028,40424,40910,40915,40915,
+40905,40905,40872,40850,40777,40777,40717,40717,
+40685,40672,40632,40632,40612,40612,40610,40609,
+40604,40604,40619,40619,40654,40672,40726,40726,
+40816,40816,40859,40868,40869,40869,40886,40886,
+40925,40933,40938,40938,40907,40907,40894,40890,
+40886,40886,40904,40904,40941,40955,40984,40984,
+41011,41011,41056,41079,41140,41140,41158,41158,
+41131,41121,41099,41099,41090,41090,41057,41037,
+40966,40966,40934,40934,40965,40977,41012,41012,
+41056,41056,41022,40995,40893,40893,40910,40910,
+41034,41058,41057,41057,40902,40902,40844,40835,
+40846,40846,40893,40893,40972,40998,41047,41047,
+41066,41066,41134,41170,41275,41275,41266,41266,
+41153,41125,41096,41096,41167,41167,41212,41224,
+41245,41245,41204,41204,41125,41101,41068,41068,
+41086,41086,41097,41101,41110,41110,41118,41118,
+41119,41109,41059,41059,40938,40938,40900,40896,
+40915,40915,40949,40949,40984,40992,40994,40994,
+40966,40966,40970,40977,41008,41008,41016,41016,
+40992,40973,40904,40904,40776,40776,40701,40679,
+40646,40646,40639,40639,40636,40634,40627,40627,
+40626,40626,40605,40594,40557,40557,40513,40513,
+40473,40462,40440,40440,40441,40441,40469,40486,
+40541,40541,40532,40532,40466,40446,40414,40414,
+40403,40403,40408,40411,40422,40422,40397,40397,
+40370,40357,40320,40320,40255,40255,40253,40262,
+40314,40314,40299,40299,40207,40182,40148,40148,
+40192,40192,40208,40209,40201,40201,40160,40160,
+40088,40059,39990,39990,39916,39916,39870,39854,
+39821,39821,39789,39789,39773,39766,39753,39753,
+39740,39740,39792,39823,39929,39929,39950,39950,
+39881,39856,39805,39805,39770,39770,39721,39699,
+39637,39637,39624,39624,39643,39649,39662,39662,
+39666,39666,39693,39712,39776,39776,39789,39789,
+39737,39721,39690,39690,39678,39678,39677,39680,
+39697,39697,39741,39741,39793,39812,39859,39859,
+39901,39901,39905,39900,39875,39875,39833,39833,
+39799,39795,39811,39811,39885,39885,39960,39991,
+40070,40070,40132,40132,40162,40172,40193,40193,
+40199,40199,40220,40233,40275,40275,40267,40267,
+40239,40235,40244,40244,40259,38329,37673,35853,
+33993,32607,36732,34918,31159,36263,37659,38403,
+38305,38507,38418,37517,37519,37591,37938,38247,
+38376,35424,34868,34931,34274,33884,34363,35440,
+35394,35142,35265,35271,35372,35327,35227,35800,
+35665,36139,36951,37371,37460,37458,37461,37516,
+37513,39690,37693,37545,37584,37706,37964,38866,
+40148,40148,40165,40165,40158,40155,40148,40148,
+40156,40156,40157,40154,40142,40142,40157,40157,
+40194,40206,40231,40231,40245,40245,40228,40216,
+40171,40171,40132,40132,40121,40116,40100,40100,
+40077,40077,40080,40082,40091,40091,40064,40064,
+40021,40008,39990,39990,39999,39999,40020,40032,
+40069,40069,40111,40111,40141,40152,40176,40176,
+40205,40205,40224,40231,40242,40242,40289,40289,
+40355,40375,40407,40407,40402,40402,40409,40416,
+40445,40445,40514,40514,40585,40604,40634,40634,
+40627,40627,40640,40650,40686,40686,40609,40417,
+40383,40505,40412,40412,40426,40426,40465,40482,
+40534,40534,40604,40604,40583,40573,40542,40542,
+40562,40562,40605,40626,40686,40686,40735,40735,
+40749,40753,40758,41271,40971,40627,40746,41226,
+41423,41257,40183,40576,40861,40371,40438,40005,
+39641,39807,40054,40862,41135,41310,41827,41349,
+40803,41207,41186,41267,41631,41532,41301,41583,
+42030,42284,42625,42522,42539,42057,42070,42173,
+42668,41783,41608,42356,42462,42372,41958,42248,
+42487,42714,42651,42596,42984,43045,43218,43502,
+43694,43644,43850,43326,43054,44589,43716,42088,
+44463,44597,41262,41734,41028,41548,43721,42351,
+41577,44474,41672,43069,45565,45571,45364,41683,
+42925,44819,44224,42452,45171,45722,45646,44016,
+39993,39993,39993,39993,39994,39994,39995,39995,
+40002,40009,40045,40045,40120,40120,40141,40141,
+40118,40118,40144,40144,40210,40232,40276,40276,
+40304,40304,40313,40313,40300,40300,40301,40301,
+40326,40341,40393,40393,40480,40480,40565,40600,
+40693,40693,40724,40724,40684,40674,40658,40658,
+40673,40673,40687,40693,40709,40709,40708,40708,
+40691,40682,40657,40657,40628,40628,40625,40627,
+40644,40644,40678,40678,40720,40737,40779,40779,
+40824,40824,40855,40867,40896,40896,40870,40870,
+40798,40778,40753,40753,40774,40774,40806,40821,
+40861,40861,40872,40872,40852,40844,40825,40209,
+39086,38038,37514,40845,40674,40674,40710,40710,
+40715,42061,40839,39737,40311,39419,39503,40290,
+40252,40252,40115,40115,39992,39951,39870,39870,
+39828,39828,39850,39865,39914,39914,40028,40028,
+40163,40206,40288,40288,40283,40527,40265,39746,
+40271,40586,39948,40549,41103,40910,40915,40915,
+40905,40905,40872,40850,40777,40777,40717,40717,
+40685,40672,40632,40632,40612,40612,40610,40609,
+40604,40604,40619,40619,40654,40672,40726,40726,
+40816,40816,40859,40868,40869,40869,40886,40886,
+40925,40933,40938,40938,40907,40907,40894,40890,
+40886,40886,40904,40904,40941,40955,40984,40984,
+41011,41011,41056,41079,41140,41140,41158,41158,
+41131,41121,41099,41099,41090,41090,41057,41037,
+40966,40966,40934,40934,40965,40977,41012,41012,
+41056,41056,41022,40995,40893,40893,40910,40910,
+41034,41058,41057,41057,40902,40902,40844,40835,
+40846,40846,40893,40893,40972,40998,41047,41047,
+41066,41066,41134,41170,41275,41275,41266,41266,
+41153,41125,41096,41096,41167,41167,41212,41224,
+41245,41245,41204,41204,41125,41101,41068,41068,
+41007,41007,41024,41028,41033,41033,41051,41051,
+41079,41078,41050,41050,40948,40948,40926,40928,
+40965,40965,40983,40983,40975,40971,40960,40960,
+40951,40951,40948,40948,40952,40952,40940,40940,
+40909,40892,40841,40841,40763,40763,40714,40699,
+40675,40675,40693,40693,40726,40730,40717,40717,
+40656,40656,40609,40591,40547,40547,40504,40504,
+40480,40473,40466,40466,40479,40479,40517,40536,
+40592,40592,40607,40607,40582,40571,40543,40543,
+40497,40497,40494,40497,40515,40515,40487,40487,
+40439,40425,40403,40403,40400,40400,40377,40364,
+40323,40323,40299,40299,40287,40283,40274,40274,
+40279,40279,40293,40300,40329,40329,40298,40298,
+40208,40179,40126,40126,40119,40119,40104,40095,
+40062,40062,40030,40030,40013,40009,40004,40004,
+40017,40017,40032,40038,40050,40050,40039,40039,
+40008,39999,39984,39984,39989,39989,39987,39986,
+39984,39984,39963,39963,39923,39909,39877,39877,
+39850,39850,39864,39878,39935,39935,39951,39951,
+39906,39892,39867,39867,39865,39865,39872,39877,
+39895,39895,39937,39937,39983,39997,40015,40015,
+40003,40003,39982,39973,39951,39951,39906,39906,
+39868,39862,39873,39873,39938,39938,40014,40047,
+40135,40135,40220,40220,40271,40291,40339,40339,
+40374,40374,40390,40393,40394,40394,40337,40337,
+40282,40266,40245,40245,40238,38457,38608,35977,
+35014,34122,37654,37128,33365,32028,33006,35882,
+38381,38282,38460,37887,37925,38226,38668,38855,
+38311,34789,33509,33694,33838,33531,34663,36042,
+35779,35507,35053,34247,33791,34756,35076,35398,
+35711,36531,37111,37371,37642,37828,37811,37774,
+37658,37681,37623,37904,38522,38834,40141,40146,
+40157,40157,40160,40160,40148,40140,40116,40116,
+40083,40083,40072,40069,40064,40064,40096,40096,
+40149,40164,40184,40184,40176,40176,40146,40129,
+40074,40074,40018,40018,39989,39979,39959,39959,
+39949,39949,39947,39945,39935,39935,39910,39910,
+39882,39879,39892,39892,39958,39958,39989,39999,
+40013,40013,40037,40037,40057,40067,40094,40094,
+40143,40143,40173,40181,40197,40197,40265,40265,
+40363,40394,40450,40450,40466,40466,40505,40527,
+40598,40598,40682,40682,40737,40752,40770,40770,
+40757,40757,40749,40743,40724,40020,40023,39765,
+39744,40078,39950,40213,40353,40507,40640,40821,
+40862,40884,40791,40860,40869,40923,41142,40435,
+40525,40525,40537,40550,40610,40610,40687,40687,
+40724,40736,40760,41515,41281,41045,41041,41005,
+41057,40628,38035,38126,38588,39429,39396,39629,
+40143,40249,40268,40959,40812,40608,41323,41093,
+40722,40707,40748,40812,41053,41315,41416,41908,
+42020,42236,42291,42528,42542,41837,41792,41734,
+42611,42731,42673,42255,42114,42208,42494,42604,
+42610,42749,42982,43117,43433,43516,43561,43734,
+43983,43851,43819,43833,43673,41562,41285,42598,
+41702,41164,41218,39251,39034,39321,39882,39862,
+40055,40220,42515,43235,42549,43153,44275,44698,
+44483,44461,44351,44924,45119,45584,45408,45516,
+43958,40028,40022,40012,39970,39970,39952,39952,
+39980,39994,40033,40033,40089,40089,40117,40125,
+40138,40138,40181,40181,40236,40252,40275,40275,
+40265,40265,40257,40253,40242,40242,40257,40257,
+40302,40323,40384,40384,40466,40466,40546,40580,
+40668,40668,40701,40701,40673,40666,40663,40663,
+40696,40696,40710,40711,40706,40706,40685,40685,
+40662,40648,40603,40603,40532,40532,40506,40510,
+40562,40562,40475,40475,40503,40519,40573,40573,
+40640,40640,40692,40713,40759,40759,40770,40770,
+40746,40739,40730,40730,40738,40738,40750,40754,
+40763,40763,40773,40773,40783,40783,40879,39956,
+40715,40715,40666,40651,40628,40628,40611,40611,
+40663,41313,39841,38942,39929,40049,40311,40296,
+40250,40250,40107,40107,39966,39917,39809,39809,
+39733,39733,39740,39750,39796,39796,39935,39935,
+40111,40164,40253,40253,40244,40244,40229,39904,
+39291,39533,40802,40778,40811,40808,40806,40806,
+40772,40772,40756,40750,40732,40732,40708,40708,
+40669,40640,40537,40537,40484,40484,40512,40536,
+40622,40622,40692,40692,40731,40746,40780,40780,
+40819,40819,40862,40879,40923,40923,40935,40935,
+40918,40916,40921,40921,40950,40950,40946,40939,
+40905,40905,40884,40884,40885,40893,40931,40931,
+41020,41020,41053,41058,41048,41048,41038,41038,
+41033,41029,41011,41011,40985,40985,40946,40924,
+40855,40855,40867,40867,40968,40995,41025,41025,
+40964,40964,40920,40904,40871,40871,40884,40884,
+40943,40955,40959,40959,40890,40890,40841,40821,
+40774,40774,40764,40764,40804,40820,40856,40856,
+40891,40891,40962,40996,41096,41096,41143,41143,
+41130,41124,41106,41106,41083,41083,41096,41107,
+41144,41144,41109,41109,41026,41004,40975,40975,
+41007,41007,41024,41028,41033,41033,41051,41051,
+41079,41078,41050,41050,40948,40948,40926,40928,
+40965,40965,40983,40983,40975,40971,40960,40960,
+40951,40951,40948,40948,40952,40952,40940,40940,
+40909,40892,40841,40841,40763,40763,40714,40699,
+40675,40675,40693,40693,40726,40730,40717,40717,
+40656,40656,40609,40591,40547,40547,40504,40504,
+40480,40473,40466,40466,40479,40479,40517,40536,
+40592,40592,40607,40607,40582,40571,40543,40543,
+40497,40497,40494,40497,40515,40515,40487,40487,
+40439,40425,40403,40403,40400,40400,40377,40364,
+40323,40323,40299,40299,40287,40283,40274,40274,
+40279,40279,40293,40300,40329,40329,40298,40298,
+40208,40179,40126,40126,40119,40119,40104,40095,
+40062,40062,40030,40030,40013,40009,40004,40004,
+40017,40017,40032,40038,40050,40050,40039,40039,
+40008,39999,39984,39984,39989,39989,39987,39986,
+39984,39984,39963,39963,39923,39909,39877,39877,
+39850,39850,39864,39878,39935,39935,39951,39951,
+39906,39892,39867,39867,39865,39865,39872,39877,
+39895,39895,39937,39937,39983,39997,40015,40015,
+40003,40003,39982,39973,39951,39951,39906,39906,
+39868,39862,39873,39873,39938,39938,40014,40047,
+40135,40135,40220,40220,40271,40291,40339,40339,
+40374,40374,40390,40393,40394,40394,40337,40337,
+40282,40266,40245,40245,40238,38500,38795,35400,
+35020,35162,37718,37997,35285,32200,31603,33326,
+38374,38341,38455,38362,38551,38775,38205,38183,
+38301,36153,34252,33483,33087,33400,34631,36225,
+36206,35966,35383,34500,34193,35043,35836,36261,
+36934,37154,37258,37497,37726,38054,38525,38548,
+38501,38521,38493,38941,40125,40125,40141,40146,
+40157,40157,40160,40160,40148,40140,40116,40116,
+40083,40083,40072,40069,40064,40064,40096,40096,
+40149,40164,40184,40184,40176,40176,40146,40129,
+40074,40074,40018,40018,39989,39979,39959,39959,
+39949,39949,39947,39945,39935,39935,39910,39910,
+39882,39879,39892,39892,39958,39958,39989,39999,
+40013,40013,40037,40037,40057,40067,40094,40094,
+40143,40143,40173,40181,40197,40197,40265,40265,
+40363,40394,40450,40450,40466,40466,40505,40527,
+40598,40598,40682,40682,40737,40752,40770,40770,
+40757,40757,40749,40743,40034,39945,39977,39466,
+39348,39716,39747,39898,40119,40586,40699,40828,
+40850,40939,40734,40593,40599,40750,40806,41043,
+40893,40525,40537,40550,40610,40610,40687,40687,
+40724,40736,41327,41474,41208,41045,40934,41012,
+41043,40701,39257,38588,37845,39380,39828,39727,
+39933,39596,39757,40566,40336,40331,40986,40827,
+40509,40808,40732,40755,40476,41021,41261,41679,
+41776,42127,42326,42474,42229,42159,42177,42082,
+42798,42658,42446,42129,42132,42230,42494,42571,
+42577,42854,43162,43372,43467,43565,43653,43561,
+43789,43849,43674,43855,43569,41712,41519,42013,
+41481,40252,39977,39375,38632,37681,38610,39702,
+40139,41831,42805,43776,40164,43938,44520,45040,
+43015,44225,42049,43458,44941,45288,45179,45489,
+45132,43071,40022,40012,39970,39970,39952,39952,
+39980,39994,40033,40033,40089,40089,40117,40125,
+40138,40138,40181,40181,40236,40252,40275,40275,
+40265,40265,40257,40253,40242,40242,40257,40257,
+40302,40323,40384,40384,40466,40466,40546,40580,
+40668,40668,40701,40701,40673,40666,40663,40663,
+40696,40696,40710,40711,40706,40706,40685,40685,
+40662,40648,40603,40603,40532,40532,40506,40510,
+40562,40562,40475,40475,40503,40519,40573,40573,
+40640,40640,40692,40713,40759,40759,40770,40770,
+40746,40739,40730,40730,40738,40738,40750,40754,
+40763,40763,40773,40773,40783,40783,40775,40775,
+40715,40715,40666,40651,40628,40628,40611,40611,
+40663,41272,40145,39160,40272,40345,40311,40296,
+40250,40250,40107,40107,39966,39917,39809,39809,
+39733,39733,39740,39750,39796,39796,39935,39935,
+40111,40164,40253,40253,40244,40244,40229,40251,
+39141,39027,40832,40893,40810,40812,40806,40806,
+40772,40772,40756,40750,40732,40732,40708,40708,
+40669,40640,39971,40537,40484,40484,40512,40536,
+40622,40622,40692,40692,40731,40746,40780,40780,
+40819,40819,40862,40879,40923,40923,40935,40935,
+40918,40916,40921,40921,40950,40950,40946,40939,
+40905,40905,40884,40884,40885,40893,40931,40931,
+41020,41020,41053,41058,41048,41048,41038,41038,
+41033,41029,41011,41011,40985,40985,40946,40924,
+40855,40855,40867,40867,40968,40995,41025,41025,
+40964,40964,40920,40904,40871,40871,40884,40884,
+40943,40955,40959,40959,40890,40890,40841,40821,
+40774,40774,40764,40764,40804,40820,40856,40856,
+40891,40891,40962,40996,41096,41096,41143,41143,
+41130,41124,41106,41106,41083,41083,41096,41107,
+41144,41144,41109,41109,41026,41004,40975,40975,
+40925,40925,40923,40921,40911,40911,40918,40918,
+40941,40946,40945,40945,40905,40905,40905,40913,
+40949,40949,40973,40973,40974,40969,40945,40945,
+40890,40890,40862,40857,40858,40858,40850,40850,
+40824,40813,40788,40788,40757,40757,40722,40709,
+40675,40675,40684,40684,40714,40717,40703,40703,
+40639,40639,40586,40564,40507,40507,40464,40464,
+40458,40456,40449,40449,40442,40442,40483,40507,
+40586,40586,40638,40638,40656,40655,40634,40634,
+40561,40561,40535,40528,40521,40521,40491,40491,
+40461,40452,40438,40438,40445,40445,40407,40383,
+40303,40303,40280,40280,40315,40324,40331,40331,
+40305,40305,40311,40320,40359,40359,40340,40340,
+40260,40239,40209,40209,40244,40244,40243,40234,
+40188,40188,40141,40141,40118,40113,40114,40114,
+40150,40150,40156,40152,40127,40127,40103,40103,
+40091,40090,40096,40096,40126,40126,40147,40156,
+40174,40174,40151,40151,40093,40072,40025,40025,
+39984,39984,39987,39997,40041,40041,40062,40062,
+40042,40033,40010,40010,39997,39997,39995,39995,
+40000,40000,40020,40020,40046,40051,40055,40055,
+40029,40029,40020,40021,40034,40034,39992,39992,
+39924,39908,39889,39889,39925,39925,40004,40043,
+40159,40159,40287,40287,40375,40407,40477,40477,
+40520,40520,40530,40528,40511,40511,40422,40422,
+40338,40313,40271,40271,40227,38413,38330,35234,
+34538,34706,37654,38464,37388,33466,31658,31629,
+37035,37910,37962,38382,38481,38780,38876,38274,
+37777,36921,35210,33955,33912,34301,35430,36474,
+36457,36492,36212,35995,35806,36152,36252,36548,
+37251,37286,37290,37841,38412,38903,40155,40155,
+40123,40114,40099,40099,40121,40121,40137,40144,
+40159,40159,40154,40154,40132,40122,40090,40090,
+40050,40050,40032,40026,40016,40016,40028,40028,
+40054,40059,40062,40062,40043,40043,40002,39981,
+39919,39919,39860,39860,39829,39820,39807,39807,
+39814,39814,39819,39819,39812,39812,39796,39796,
+39778,39779,39803,39803,39883,39883,39918,39926,
+39938,39938,39964,39964,39987,39998,40027,40027,
+40076,40076,40104,40112,40126,40126,40210,40210,
+40333,40373,40453,40453,40495,40495,40552,40580,
+40662,40662,40743,40743,40788,40799,40815,40815,
+40805,40805,40790,39829,39759,39994,39402,39108,
+39054,39312,39606,39461,39738,40312,40589,40509,
+40585,40571,40523,40523,40442,40796,40580,40773,
+41308,41481,41355,40518,40572,40572,40663,40663,
+40708,41313,41368,41459,40956,40866,40761,41281,
+41460,41271,40270,38983,37903,38966,39690,39367,
+40003,40093,40172,40532,40442,39954,40213,40561,
+40819,40804,40857,40872,40669,40681,41274,41006,
+41425,42027,42053,42252,42300,42313,42527,42466,
+42479,42326,42256,41952,41922,42060,42584,42647,
+42729,42807,43049,43287,43283,43341,43498,43330,
+43550,43859,43837,43567,43103,42130,41113,40597,
+41284,39886,40166,39758,38460,37175,37937,39866,
+41623,42970,43197,40566,41831,44257,44808,43044,
+43429,44860,44633,43678,43653,44930,45020,45079,
+45230,44761,39970,39963,39937,39937,39918,39918,
+39924,39931,39965,39965,40024,40024,40077,40098,
+40155,40155,40211,40211,40240,40249,40259,40259,
+40248,40248,40237,40233,40224,40224,40251,40251,
+40309,40334,40400,40400,40473,40473,40541,40568,
+40638,40638,40666,40666,40647,40644,40646,40646,
+40678,40678,40688,40688,40674,40674,40637,40637,
+40593,40574,40520,40520,40457,40457,40433,40428,
+42639,42681,40322,40322,40343,40360,40423,40423,
+40512,40512,40583,40608,40667,40667,40691,40691,
+40683,40681,40679,40679,40682,40682,40684,40684,
+40681,40681,40684,40684,40693,40694,40687,40687,
+40660,40660,40619,40600,40548,40548,40523,40523,
+40497,41128,40339,39802,40343,40343,40311,40292,
+40226,40226,40062,40062,39893,39837,39719,39719,
+39651,39651,39668,39682,39740,39740,39889,39889,
+40068,40124,40222,40222,40244,40244,40278,40303,
+39788,39436,40493,40488,40646,40679,40686,40686,
+40629,40629,40624,40628,40652,40652,40662,40662,
+40606,38857,38493,39454,40406,40406,40452,40487,
+40618,40618,40726,40726,40778,40795,40828,40828,
+40848,40848,40888,40908,40966,40966,40964,40964,
+40908,40897,40894,40894,40948,40948,40944,40933,
+40884,40884,40855,40855,40857,40866,40906,40906,
+40996,40996,41011,41007,40967,40967,40941,40941,
+40932,40924,40890,40890,40828,40828,40803,40797,
+40787,40787,40837,40837,40941,40966,40979,40979,
+40872,40872,40831,40825,40838,40838,40861,40861,
+40895,40905,40917,40917,40899,40899,40862,40841,
+40774,40774,40724,40724,40720,40721,40732,40732,
+40759,40759,40810,40834,40903,40903,40958,40958,
+40990,40996,40995,40995,40950,40950,40963,40975,
+41025,41025,41013,41013,40958,40942,40919,40919,
+40895,40895,40879,40873,40857,40857,40853,40853,
+40867,40872,40880,40880,40873,40873,40883,40891,
+40922,40922,40956,40956,40974,40972,40943,40943,
+40853,40853,40813,40807,40814,40814,40812,40812,
+40790,40783,40767,40767,40754,40754,40720,40706,
+40664,40664,40660,40660,40677,40678,40665,40665,
+40618,40618,40568,40546,40481,40481,40439,40439,
+40441,40440,40430,40430,40404,40404,40443,40469,
+40560,40560,40630,40630,40664,40668,40652,40652,
+40572,40572,40531,40518,40491,40491,40461,40461,
+40449,40445,40432,40432,40426,40426,40384,40361,
+40283,40283,40263,40263,40305,40316,40324,40324,
+40293,40293,40297,40304,40340,40340,40324,40324,
+40257,40239,40216,40216,40257,40257,40255,40244,
+40189,40189,40134,40134,40106,40101,40104,40104,
+40148,40148,40160,40158,40138,40138,40119,40119,
+40107,40107,40115,40115,40147,40147,40169,40175,
+40189,40189,40169,40169,40121,40103,40060,40060,
+40017,40017,40016,40023,40059,40059,40084,40084,
+40076,40070,40048,40048,40022,40022,40012,40009,
+40006,40006,40016,40016,40034,40038,40041,40041,
+40024,40024,40031,40039,40072,40072,40032,40032,
+39948,39924,39887,39887,39905,39905,39983,40025,
+40157,40157,40306,40306,40411,40447,40523,40523,
+40556,40556,40557,40553,40535,40535,40444,40444,
+40356,40330,40286,40286,38638,38789,38776,35537,
+34553,34882,37110,37922,37990,35198,31759,31418,
+36658,36915,36733,37891,38217,38250,38750,38827,
+38449,37765,36957,35991,35696,35738,35820,36066,
+36281,36612,36447,36583,36673,36816,36802,37176,
+37489,37440,37319,40121,40154,40154,40157,40157,
+40124,40115,40098,40098,40119,40119,40134,40140,
+40152,40152,40144,40144,40121,40110,40081,40081,
+40050,40050,40033,40026,40009,40009,40005,40005,
+40009,40008,40002,40002,39982,39982,39940,39920,
+39855,39855,39799,39799,39771,39764,39757,39757,
+39770,39770,39780,39782,39783,39783,39771,39771,
+39754,39755,39776,39776,39848,39848,39881,39891,
+39908,39908,39940,39940,39970,39982,40012,40012,
+40056,40056,40080,40087,40094,40094,40179,40179,
+40307,40350,40435,40435,40486,40486,40544,40570,
+40646,40646,40724,40724,40768,40784,40815,40815,
+40797,39266,39085,39882,39916,39794,39072,38990,
+38966,38986,39004,39035,39804,40121,40292,39709,
+39605,39752,39882,39960,40073,40475,40803,40998,
+41083,41018,41354,41341,41340,41441,41273,41138,
+41140,40966,41023,40940,40817,40794,40777,41000,
+40977,40773,40138,40102,40188,39268,38341,38206,
+39209,39560,39777,39851,39665,39655,39461,39811,
+40426,40800,40903,41068,41121,41186,41288,41274,
+41407,41500,41829,42019,42110,41786,41742,41738,
+42115,42105,42044,41923,41921,42003,42543,42654,
+42829,42832,42828,42937,42866,42881,42700,43038,
+43165,43188,43892,43876,42817,42149,40935,39507,
+39730,39483,39425,39251,39572,37434,35404,35902,
+36608,39597,40666,40918,41237,41483,44538,42852,
+43592,42531,42326,42954,41687,44825,44774,44772,
+45463,45522,45238,39952,39926,39926,39908,39908,
+39891,39893,39919,39919,39988,39988,40051,40079,
+40152,40152,40210,40210,40227,40232,40242,40242,
+40243,40243,40238,40236,40230,40230,40259,40259,
+40319,40343,40408,40408,40477,40477,40539,40564,
+40625,40625,40650,40650,40635,40632,40634,40634,
+40661,40661,40670,40670,40659,40659,40618,40618,
+40567,40548,40500,40500,40438,40438,40423,42722,
+42284,41119,42036,41852,40313,40330,40392,40392,
+40487,40487,40558,40585,40643,40643,40667,40667,
+40655,40652,40649,40649,40657,40657,40661,40661,
+40659,40659,40658,40658,40660,40658,40648,40648,
+40624,40624,40587,40570,40525,40525,40510,41342,
+40981,40444,40364,40364,40342,40342,40306,40285,
+40216,40216,40041,40041,39855,39795,39675,39675,
+39624,39624,39652,39671,39739,39739,39889,39889,
+40058,40113,40219,40219,40270,40270,40308,40330,
+40395,40395,40473,40473,40611,40640,40645,40645,
+40581,40581,40575,40580,40609,40609,40623,40623,
+39655,40340,39758,40466,40394,40394,40444,40479,
+40609,40609,40722,40722,40780,40799,40838,40838,
+40865,40865,40905,40924,40979,40979,40970,40970,
+40905,40889,40880,40880,40928,40928,40924,40913,
+40865,40865,40841,40841,40855,40865,40904,40904,
+40974,40974,40983,40977,40942,40942,40913,40913,
+40894,40881,40835,40835,40757,40757,40744,40747,
+40776,40776,40838,40838,40921,40938,40941,40941,
+40837,40837,40800,40798,40818,40818,40850,40850,
+40888,40900,40917,40917,40905,40905,40872,40852,
+40790,40790,40732,40732,40711,40706,40704,40704,
+40720,40720,40759,40777,40828,40828,40872,40872,
+40903,40911,40917,40917,40889,40889,40911,40925,
+40978,40978,40980,40980,40945,40934,40911,40911,
+40832,40832,40788,40772,40743,40743,40718,40718,
+40710,40714,40741,40741,40803,40803,40836,40845,
+40865,40865,40916,40916,40975,40979,40940,40940,
+40776,40776,40710,40700,40719,40719,40732,40732,
+40719,40718,40725,40725,40747,40747,40716,40699,
+40638,40638,40606,40606,40597,40593,40583,40583,
+40572,40572,40532,40507,40428,40428,40386,40386,
+40405,40406,40388,40388,40323,40323,40358,40388,
+40504,40504,40610,40610,40677,40690,40686,40686,
+40592,40592,40522,40494,40424,40424,40393,40393,
+40424,40427,40421,40421,40384,40384,40336,40311,
+40239,40239,40228,40228,40283,40296,40307,40307,
+40264,40264,40262,40267,40297,40297,40289,40289,
+40246,40236,40230,40230,40282,40282,40275,40259,
+40188,40188,40115,40115,40078,40071,40078,40078,
+40139,40139,40163,40167,40160,40160,40151,40151,
+40140,40140,40152,40152,40190,40190,40209,40213,
+40215,40215,40200,40200,40175,40164,40132,40132,
+40085,40085,40075,40077,40096,40096,40126,40126,
+40145,40145,40125,40125,40073,40073,40046,40036,
+40015,40015,40004,40004,40005,40006,40007,40007,
+40012,40012,40051,40075,40152,40152,40116,40116,
+39995,39956,39881,39881,39861,39861,39939,39988,
+40152,40152,40347,40347,40486,40531,40619,40619,
+40629,40629,40612,40604,40584,40584,38552,40492,
+40393,40364,40315,40315,38440,38682,38816,36395,
+36429,36322,37486,37645,38045,34900,31929,32636,
+36374,36790,37007,37021,37698,38142,37812,37995,
+38177,38033,37761,37201,36725,36593,36390,36224,
+36406,36544,36471,36665,36716,36917,37117,37306,
+37401,37215,37400,40105,40153,40153,40161,40161,
+40126,40116,40099,40099,40115,40115,40128,40132,
+40135,40135,40122,40122,40094,40085,40062,40062,
+40051,40051,40036,40026,39996,39996,39957,39957,
+39916,39902,39874,39874,39857,39857,39812,39790,
+39722,39722,39672,39672,39651,39648,39652,39652,
+39678,39678,39699,39707,39723,39723,39722,39722,
+39706,39706,39720,39720,39773,39773,39803,39815,
+39844,39844,39891,39891,39935,39950,39983,39983,
+40016,40016,40029,40031,40029,40029,40114,40114,
+40253,40300,40397,40397,40466,40466,40523,40548,
+40610,40610,40681,40681,40725,40747,40814,40814,
+39611,39383,39424,39232,39160,39385,38788,38996,
+39014,39171,39174,39190,40024,39711,39769,39609,
+39580,39567,39915,40046,40091,40933,41058,41189,
+40772,40499,41238,41690,41549,41647,41632,41294,
+41188,40917,40966,40998,41035,41195,41133,40893,
+40706,40469,40064,40044,40112,39549,39502,39394,
+38303,39100,39425,39113,39003,38841,39863,39937,
+40431,40987,41119,41332,41370,41427,41471,41430,
+41414,41452,41780,41678,41402,41798,41394,41806,
+41931,41955,41819,41927,42095,42183,42322,42436,
+42458,42283,42474,42642,42825,42470,43013,42876,
+43033,43102,43463,43704,43079,41619,39711,37461,
+37569,37965,38503,39293,39390,39503,35740,37422,
+38378,39041,40593,42067,42269,41926,44438,43562,
+43732,41021,43072,43923,43158,42525,42990,44366,
+45405,45032,44805,39929,39905,39905,39885,39885,
+39823,39812,39821,39821,39910,39910,39999,40038,
+40144,40144,40206,40206,40197,40196,40204,40204,
+40233,40233,40242,40244,40243,40243,40278,40278,
+40341,40365,40425,40425,40487,40487,40536,40553,
+40596,40596,40617,40617,40610,40609,40609,40609,
+40623,40623,40630,40630,40625,40625,40577,40577,
+40512,40493,40459,40459,40402,40402,40402,42754,
+42347,41588,41507,41618,40252,40268,40331,40331,
+40435,40435,40510,40538,40596,40596,40615,40615,
+40594,40590,40586,40586,40602,40602,40611,40613,
+40614,40614,40606,40606,40591,40585,40567,40567,
+40547,40547,40519,40508,40479,40479,40487,41058,
+40856,40394,40369,40369,40340,40340,40295,40270,
+40197,40197,39994,39994,39775,39707,39585,39585,
+39567,39567,39620,39648,39739,39739,39891,39891,
+40038,40092,40215,40215,40326,40326,40373,40383,
+40387,40387,40447,40447,40540,40558,40561,40561,
+40482,40482,40472,40478,41577,40516,40540,40540,
+40519,40716,40754,40077,38424,40373,40428,40465,
+40591,40591,40714,40714,40782,40806,40857,40857,
+40899,40899,40941,40960,41008,41008,40983,40983,
+40897,40875,40849,40849,40886,40886,40879,40867,
+40821,40821,40813,40813,40851,40865,40900,40900,
+40926,40926,40922,40916,40889,40889,40854,40854,
+40814,40792,40719,40719,40606,40606,40620,40644,
+40757,40757,40841,40841,40876,40880,40861,40861,
+40763,40763,40738,40740,40778,40778,40828,40828,
+40876,40890,40917,40917,40917,40917,40893,40879,
+40825,40825,40753,40753,40693,40674,40644,40644,
+40640,40640,40652,40658,40672,40672,40691,40691,
+40719,40730,40751,40751,40762,40762,40802,40822,
+40882,40882,40912,40912,40920,40918,40897,40897,
+40832,40832,40788,40772,40743,40743,40718,40718,
+40710,40714,40741,40741,40803,40803,40836,40845,
+40865,40865,40916,40916,40975,40979,40940,40940,
+40776,40776,40710,40700,40719,40719,40732,40732,
+40719,40718,40725,40725,40747,40747,40716,40699,
+40638,40638,40606,40606,40597,40593,40583,40583,
+40572,40572,40532,40507,40428,40428,40386,40386,
+40405,40406,40388,40388,40323,40323,40358,40388,
+40504,40504,40610,40610,40677,40690,40686,40686,
+40592,40592,40522,40494,40424,40424,40393,40393,
+40424,40427,40421,40421,40384,40384,40336,40311,
+40239,40239,40228,40228,40283,40296,40307,40307,
+40264,40264,40262,40267,40297,40297,40289,40289,
+40246,40236,40230,40230,40282,40282,40275,40259,
+40188,40188,40115,40115,40078,40071,40078,40078,
+40139,40139,40163,40167,40160,40160,40151,40151,
+40140,40140,40152,40152,40190,40190,40209,40213,
+40215,40215,40200,40200,40175,40164,40132,40132,
+40085,40085,40075,40077,40096,40096,40126,40126,
+40145,40145,40125,40125,40073,40073,40046,40036,
+40015,40015,40004,40004,40005,40006,40007,40007,
+40012,40012,40051,40075,40152,40152,40116,40116,
+39995,39956,39881,39881,39861,39861,39939,39988,
+40152,40152,40347,40347,40486,40531,40619,40619,
+40629,40629,40612,40604,40584,40584,38520,38595,
+40393,40364,40315,40315,38296,38206,38811,37782,
+37190,37569,37711,37452,37727,34907,33093,33932,
+34342,35323,36621,36756,36960,37597,37571,37495,
+37732,37922,38055,38043,37593,37560,37274,37017,
+37105,36883,36654,36701,36587,36781,37091,37285,
+37294,37336,38022,40105,40153,40153,40161,40161,
+40126,40116,40099,40099,40115,40115,40128,40132,
+40135,40135,40122,40122,40094,40085,40062,40062,
+40051,40051,40036,40026,39996,39996,39957,39957,
+39916,39902,39874,39874,39857,39857,39812,39790,
+39722,39722,39672,39672,39651,39648,39652,39652,
+39678,39678,39699,39707,39723,39723,39722,39722,
+39706,39706,39720,39720,39773,39773,39803,39815,
+39844,39844,39891,39891,39935,39950,39983,39983,
+40016,40016,40029,40031,40029,40029,40114,40114,
+40253,40300,40397,40397,40466,40466,40523,40548,
+40610,40610,40681,40681,40725,40747,40814,40480,
+40323,40001,39598,38724,38657,38872,38973,38892,
+38817,39669,39675,39924,39894,39627,39716,39774,
+39966,39909,39930,40269,40422,40997,41077,41307,
+40701,40093,40527,41481,41402,41519,41523,41330,
+41118,40778,40938,40770,41032,41130,41341,41034,
+40651,40120,39662,39662,39696,39784,40011,39875,
+39602,39172,39412,38810,39022,39651,40206,40250,
+40569,41039,41187,41336,41370,41450,41435,41479,
+41467,41474,41261,41538,41509,41679,41748,41759,
+41605,41643,41455,41536,41748,41821,41956,42072,
+41998,42085,42336,42501,42764,42769,42722,42786,
+42880,43047,42935,43687,43566,40439,38740,36993,
+36902,37864,38904,39199,38990,39628,36308,38565,
+38250,39913,39779,41269,44192,44275,43105,43947,
+42092,43242,42090,41982,41712,41497,41348,44418,
+44421,44468,44588,39929,39905,39905,39885,39885,
+39823,39812,39821,39821,39910,39910,39999,40038,
+40144,40144,40206,40206,40197,40196,40204,40204,
+40233,40233,40242,40244,40243,40243,40278,40278,
+40341,40365,40425,40425,40487,40487,40536,40553,
+40596,40596,40617,40617,40610,40609,40609,40609,
+40623,40623,40630,40630,40625,40625,40577,40577,
+40512,40493,40459,40459,40402,40402,40402,42634,
+42591,42063,41752,40234,40252,40268,40331,40331,
+40435,40435,40510,40538,40596,40596,40615,40615,
+40594,40590,40586,40586,40602,40602,40611,40613,
+40614,40614,40606,40606,40591,40585,40567,40567,
+40547,40547,40519,40508,40479,40479,41322,41028,
+41100,40394,40369,40369,40340,40340,40295,40270,
+40197,40197,39994,39994,39775,39707,39585,39585,
+39567,39567,39620,39648,39739,39739,39891,39891,
+40038,40092,40215,40215,40326,40326,40373,40383,
+40387,40387,40447,40447,40540,40558,40561,40561,
+40482,40482,40472,40478,41160,40516,41938,40540,
+40490,39658,38706,39288,37922,40373,40428,40465,
+40591,40591,40714,40714,40782,40806,40857,40857,
+40899,40899,40941,40960,41008,41008,40983,40983,
+40897,40875,40849,40849,40886,40886,40879,40867,
+40821,40821,40813,40813,40851,40865,40900,40900,
+40926,40926,40922,40916,40889,40889,40854,40854,
+40814,40792,40719,40719,40606,40606,40620,40644,
+40757,40757,40841,40841,40876,40880,40861,40861,
+40763,40763,40738,40740,40778,40778,40828,40828,
+40876,40890,40917,40917,40917,40917,40893,40879,
+40825,40825,40753,40753,40693,40674,40644,40644,
+40640,40640,40652,40658,40672,40672,40691,40691,
+40719,40730,40751,40751,40762,40762,40802,40822,
+40882,40882,40912,40912,40920,40918,40897,40897,
+40714,40714,40680,40671,40654,40654,40624,40624,
+40591,40589,40608,40608,40674,40674,40699,40704,
+40704,40704,40765,40765,40863,40879,40857,40857,
+40683,40683,40596,40577,40567,40567,40569,40569,
+40577,40584,40612,40612,40649,40649,40609,40584,
+40495,40495,40440,40440,40424,40420,40416,40416,
+40426,40426,40406,40392,40340,40340,40326,40326,
+40365,40368,40345,40345,40241,40241,40236,40250,
+40327,40327,40409,40409,40471,40489,40517,40517,
+40493,40493,40439,40411,40323,40323,40276,40276,
+40287,40285,40268,40268,40236,40236,40203,40186,
+40135,40135,40123,40123,40154,40162,40171,40171,
+40154,40154,40158,40162,40173,40173,40150,40150,
+40109,40100,40096,40096,40147,40147,40158,40152,
+40111,40111,40052,40052,40008,40003,40017,40017,
+40097,40097,40123,40126,40112,40112,40107,40107,
+40110,40115,40138,40138,40186,40186,40203,40204,
+40194,40194,40184,40184,40177,40174,40165,40165,
+40151,40151,40148,40148,40151,40151,40168,40168,
+40185,40185,40163,40163,40107,40107,40077,40067,
+40045,40045,40013,40013,39985,39980,39984,39984,
+40027,40027,40082,40107,40178,40178,40135,40135,
+40007,39962,39861,39861,39803,39803,39857,39898,
+40050,40050,40265,40265,40432,40484,40577,40577,
+40665,40665,38031,38049,37844,37631,38386,38550,
+40409,40384,40342,40342,38798,38500,40318,38417,
+38348,38336,38218,37457,36877,35160,35404,36579,
+34586,33219,32783,37173,37496,36913,37660,37791,
+37945,38216,38125,38127,37608,37712,37655,37611,
+37658,37599,37413,37277,37275,37548,37923,38189,
+40088,40088,40106,40118,40160,40160,40166,40166,
+40126,40113,40091,40091,40094,40094,40092,40090,
+40079,40079,40068,40068,40056,40052,40042,40042,
+40029,40029,40008,39999,39968,39968,39908,39908,
+39834,39809,39757,39757,39719,39719,39664,39639,
+39572,39572,39531,39531,39528,39533,39558,39558,
+39608,39608,39632,39639,39650,39650,39645,39645,
+39626,39624,39635,39635,39681,39681,39704,39714,
+39736,39736,39778,39778,39826,39841,39868,39868,
+39882,39882,39898,39905,39923,39923,40017,40017,
+40147,40189,40273,40273,40323,40323,40365,40383,
+40435,40435,40513,40513,40555,40157,39875,40092,
+39722,39580,39288,38870,38685,38651,38841,39047,
+39466,39958,39878,39869,39900,39851,39739,39262,
+39257,39201,39269,39604,39642,40079,40332,40288,
+40207,39797,39928,40270,40454,40644,40426,40438,
+40457,40483,40729,41062,41730,41717,41366,40867,
+40561,40136,39608,39493,39501,39753,39783,39338,
+39621,40043,40083,40183,40301,40264,40001,40135,
+40295,40652,40915,41103,41340,41181,41128,41255,
+41210,41137,40998,41393,41578,41030,41252,41355,
+40739,40768,40818,41035,41167,41263,41407,41363,
+41373,41680,42048,42436,42351,43032,42221,42556,
+42630,42747,42725,43440,43133,40810,40452,39360,
+38192,39477,39297,38596,38249,38862,39378,37815,
+37726,40086,39713,40582,40790,40900,41487,42745,
+42400,42682,43165,43409,43725,41289,40772,40682,
+43403,43636,43831,44153,44714,39909,39871,39871,
+39785,39765,39755,39755,39826,39826,39911,39950,
+40061,40061,40115,40115,40089,40085,40091,40091,
+40138,40138,40163,40170,40178,40178,40223,40223,
+40288,40312,40371,40371,40428,40428,40466,40477,
+40501,40501,40532,40532,40557,40565,40580,40580,
+40590,40590,40594,40594,40590,40590,40549,40549,
+40509,40493,42417,42644,40382,40382,40334,41858,
+42186,41910,40193,40193,40209,40224,40285,40285,
+40388,40388,40461,40486,40538,40538,40547,40547,
+40516,40509,40505,40505,40531,40531,40551,40558,
+40571,40571,40572,40572,40561,40554,40529,40529,
+40491,40491,40466,40460,42091,41787,41316,40776,
+41458,40423,40416,40416,40395,40395,40347,40319,
+40230,40230,39996,39996,39744,39666,39522,39522,
+39502,39502,39563,39596,39702,39702,39845,39845,
+39963,40012,40144,40144,40305,40305,40364,40374,
+40366,40366,40402,40402,40465,40476,40469,40469,
+40405,40405,40389,40390,40407,40407,39991,39736,
+40418,38139,38425,39355,40365,40365,40425,40460,
+40575,40575,40677,40677,40725,40745,40795,40795,
+40869,40869,40909,40923,40946,40946,40907,40907,
+40822,40799,40767,40767,40790,40790,40785,40778,
+40748,40748,40765,40765,40829,40845,40867,40867,
+40828,40828,40805,40799,40796,40796,40762,40762,
+40700,40673,40594,40594,40496,40496,40522,40552,
+40677,40677,40753,40753,40758,40755,40727,40727,
+40647,40647,40629,40632,40671,40671,40728,40728,
+40785,40802,40834,40834,40842,40842,40830,40820,
+40782,40782,40710,40710,40632,40606,40550,40550,
+40513,40513,40506,40505,40509,40509,40502,40502,
+40492,40496,40524,40524,40602,40602,40665,40687,
+40734,40734,40758,40758,40768,40768,40759,40759,
+40714,40714,40680,40671,40654,40654,40624,40624,
+40591,40589,40608,40608,40674,40674,40699,40704,
+40704,40704,40765,40765,40863,40879,40857,40857,
+40683,40683,40596,40577,40567,40567,40569,40569,
+40577,40584,40612,40612,40649,40649,40609,40584,
+40495,40495,40440,40440,40424,40420,40416,40416,
+40426,40426,40406,40392,40340,40340,40326,40326,
+40365,40368,40345,40345,40241,40241,40236,40250,
+40327,40327,40409,40409,40471,40489,40517,40517,
+40493,40493,40439,40411,40323,40323,40276,40276,
+40287,40285,40268,40268,40236,40236,40203,40186,
+40135,40135,40123,40123,40154,40162,40171,40171,
+40154,40154,40158,40162,40173,40173,40150,40150,
+40109,40100,40096,40096,40147,40147,40158,40152,
+40111,40111,40052,40052,40008,40003,40017,40017,
+40097,40097,40123,40126,40112,40112,40107,40107,
+40110,40115,40138,40138,40186,40186,40203,40204,
+40194,40194,40184,40184,40177,40174,40165,40165,
+40151,40151,40148,40148,40151,40151,40168,40168,
+40185,40185,40163,40163,40107,40107,40077,40067,
+40045,40045,40013,40013,39985,39980,39984,39984,
+40027,40027,40082,40107,40178,40178,40135,40135,
+40007,39962,39861,39861,39803,39803,39857,39898,
+40050,40050,40265,40265,40432,40484,40577,40577,
+40665,37534,36569,37065,37933,40557,38357,38394,
+38801,40384,38705,38401,38576,40343,40318,38616,
+38620,38677,38293,38189,37465,36148,36983,37695,
+35926,33789,32204,35233,37227,37100,37460,37709,
+37890,38110,37902,37915,37835,37882,37712,37495,
+37555,37606,37620,37656,37636,38207,40006,40006,
+40088,40088,40106,40118,40160,40160,40166,40166,
+40126,40113,40091,40091,40094,40094,40092,40090,
+40079,40079,40068,40068,40056,40052,40042,40042,
+40029,40029,40008,39999,39968,39968,39908,39908,
+39834,39809,39757,39757,39719,39719,39664,39639,
+39572,39572,39531,39531,39528,39533,39558,39558,
+39608,39608,39632,39639,39650,39650,39645,39645,
+39626,39624,39635,39635,39681,39681,39704,39714,
+39736,39736,39778,39778,39826,39841,39868,39868,
+39882,39882,39898,39905,39923,39923,40017,40017,
+40147,40189,40273,40273,40323,40323,40365,40383,
+40435,40435,40513,40513,40555,40134,40016,40157,
+39388,38980,38949,38881,38586,38570,38834,39032,
+39338,39747,39606,39642,39557,39491,39460,39053,
+39119,39095,39077,39279,39379,40034,39920,39835,
+39914,39646,39599,39832,39977,40072,39816,39763,
+39883,40241,40464,40597,41007,41156,40981,40651,
+40722,40367,39523,39416,39272,39632,39655,39299,
+39461,39432,39999,40340,40418,40373,39894,40006,
+40176,40541,40748,40884,41339,41179,41109,41115,
+41007,40996,41186,41412,41574,41191,41055,40894,
+40369,40496,40505,40904,40944,40996,41188,41125,
+41199,41659,42007,41642,42718,43240,42269,42424,
+42514,42516,42246,43266,43092,39362,40484,40018,
+39908,39832,39179,37417,36845,38324,39568,39884,
+40034,38169,39520,39496,40245,40532,40607,42018,
+41757,42029,42492,41595,43274,41125,42879,42789,
+38769,43367,43519,43578,43965,39909,39871,39871,
+39785,39765,39755,39755,39826,39826,39911,39950,
+40061,40061,40115,40115,40089,40085,40091,40091,
+40138,40138,40163,40170,40178,40178,40223,40223,
+40288,40312,40371,40371,40428,40428,40466,40477,
+40501,40501,40532,40532,40557,40565,40580,40580,
+40590,40590,40594,40594,40590,40590,40549,40549,
+40509,42460,41257,41029,40382,40382,40334,40308,
+41910,41664,40193,40193,40209,40224,40285,40285,
+40388,40388,40461,40486,40538,40538,40547,40547,
+40516,40509,40505,40505,40531,40531,40551,40558,
+40571,40571,40572,40572,40561,40554,40529,40529,
+40491,40491,40466,40460,40448,41418,41073,40683,
+40428,40423,40416,40416,40395,40395,40347,40319,
+40230,40230,39996,39996,39744,39666,39522,39522,
+39502,39502,39563,39596,39702,39702,39845,39845,
+39963,40012,40144,40144,40305,40305,40364,40374,
+40366,40366,40402,39538,40465,40476,40469,40469,
+40405,40405,40389,40390,40407,40407,40424,40424,
+40418,39783,39172,39338,40365,40365,40425,40460,
+40575,40575,40677,40677,40725,40745,40795,40795,
+40869,40869,40909,40923,40946,40946,40907,40907,
+40822,40799,40767,40767,40790,40790,40785,40778,
+40748,40748,40765,40765,40829,40845,40867,40867,
+40828,40828,40805,40799,40796,40796,40762,40762,
+40700,40673,40594,40594,40496,40496,40522,40552,
+40677,40677,40753,40753,40758,40755,40727,40727,
+40647,40647,40629,40632,40671,40671,40728,40728,
+40785,40802,40834,40834,40842,40842,40830,40820,
+40782,40782,40710,40710,40632,40606,40550,40550,
+40513,40513,40506,40505,40509,40509,40502,40502,
+40492,40496,40524,40524,40602,40602,40665,40687,
+40734,40734,40758,40758,40768,40768,40759,40759,
+40571,40571,40605,40617,40642,40642,40632,40632,
+40584,40568,40543,40543,40528,40528,40510,40504,
+40487,40487,40547,40547,40659,40685,40709,40709,
+40623,40623,40535,40501,40418,40418,40383,40383,
+40411,40424,40458,40458,40471,40471,40408,40373,
+40261,40261,40203,40203,40212,40215,40221,40221,
+40216,40216,40223,40229,40247,40247,40284,40284,
+40334,40340,40318,40318,40199,40199,40129,40108,
+40075,40075,40051,40051,40049,40062,40128,40128,
+40259,40259,40284,40279,40225,40225,40144,40144,
+40061,40036,39996,39996,40019,40019,40029,40028,
+40016,40016,39986,39986,39952,39944,39944,39944,
+39983,39983,40003,40004,39990,39990,39936,39936,
+39873,39856,39839,39839,39879,39879,39927,39947,
+39996,39996,39988,39988,39941,39935,39956,39956,
+40050,40050,40064,40058,40013,40013,40005,40005,
+40031,40045,40086,40086,40149,40149,40170,40171,
+40158,40158,40142,40142,40131,40132,40149,40149,
+40204,40204,40229,40234,40232,40232,40221,40221,
+40205,40197,40173,40173,40146,40146,40136,40133,
+40128,40128,40082,40082,40013,40001,40003,40003,
+40091,40091,40138,40148,40153,40153,40105,40105,
+40032,40001,39920,39920,39847,39847,39843,39856,
+39919,39919,40074,40074,40212,40279,40477,40477,
+36752,35766,35206,40495,40484,40484,40444,40444,
+38614,38600,38570,38683,40342,40342,40342,38685,
+38582,38566,38427,38390,37485,36635,36977,37621,
+38011,36036,34533,34277,35035,36536,37378,37659,
+38030,38228,37995,37879,37709,37905,37811,37396,
+37421,37513,37450,37498,37535,38271,40066,40066,
+40109,40109,40135,40145,40167,40167,40152,40152,
+40108,40093,40066,40066,40055,40055,40036,40027,
+40003,40003,40005,40005,40027,40031,40028,40028,
+39987,39987,39965,39958,39948,39948,39895,39895,
+39820,39791,39720,39720,39640,39640,39571,39545,
+39481,39481,39450,39450,39463,39475,39525,39525,
+39605,39605,39623,39622,39598,39598,39569,39569,
+39543,39540,39552,39552,39607,39607,39622,39624,
+39619,39619,39630,39630,39659,39667,39676,39676,
+39668,39668,39708,39731,39806,39806,39916,39916,
+40008,40034,40067,40067,40056,40056,40072,40088,
+40152,40152,40248,40248,40421,40231,40082,40026,
+38790,38465,38781,38835,38906,38989,39073,39169,
+39294,39483,39440,39418,39210,39001,38874,38995,
+39104,39094,39111,39214,39256,39827,39793,39695,
+39866,39733,39356,39487,39713,39776,39604,39495,
+39570,40213,40239,40214,40271,40466,40344,40299,
+40431,39797,38236,38680,39063,39198,39249,39219,
+39826,40029,40203,40288,40223,40097,39623,39759,
+40002,40569,40680,40779,41250,41063,40915,40980,
+40904,41000,41358,41491,41555,41358,40840,40631,
+40306,40298,40259,40341,40411,40522,40698,40814,
+41078,41531,41620,41892,43031,42921,42356,42516,
+42544,42333,42472,43159,42905,39840,40184,40183,
+40538,38893,38548,38605,37170,36407,37099,38491,
+40984,38936,38302,38236,39135,40366,39847,40894,
+41720,41813,42100,42199,40084,43205,43174,42960,
+42428,42630,42754,43139,43504,44274,39863,39863,
+39807,39793,39771,39771,39788,39788,39831,39854,
+39925,39925,39959,39959,39941,39939,39948,39948,
+39989,39989,40015,40024,40042,40042,40095,40095,
+40166,40192,40254,40254,40319,40319,40349,40357,
+40366,40366,40420,40420,40495,40518,40561,40561,
+40577,40577,40576,40572,40553,40553,40528,40528,
+40526,42638,41227,41214,42264,40285,40200,40175,
+41860,41264,40178,40178,40199,40216,40276,40276,
+40374,40374,40437,40458,40497,40497,40492,40492,
+40454,40445,40439,40439,40472,40472,40503,40513,
+40542,40542,40570,40570,40591,40591,40569,40569,
+40500,40500,40469,40462,40454,41058,41047,40790,
+40471,40476,40496,40496,40502,40502,40451,40421,
+40322,40322,41637,40017,39763,39678,39509,39509,
+39458,39458,39496,39523,39625,39625,39751,39751,
+39838,39878,39995,39995,40165,40165,40252,40279,
+40325,40325,40378,40378,39743,40400,40394,40394,
+40391,40391,40381,40374,40350,40350,40359,40359,
+40382,40390,40406,39715,40393,40393,40450,40478,
+40565,40565,40613,40613,40599,40603,40640,40640,
+40756,40756,40793,40798,40780,40780,40740,40740,
+40692,40679,40662,40662,40675,40675,40679,40679,
+40676,40676,40723,40723,40804,40820,40818,40818,
+40709,40709,40670,40666,40685,40685,40660,40660,
+40588,40563,40513,40513,40499,40499,40512,40521,
+40549,40549,40578,40578,40599,40601,40591,40591,
+40540,40540,40523,40521,40533,40533,40572,40572,
+40626,40642,40671,40671,40675,40675,40669,40664,
+40642,40642,40598,40598,40545,40522,40463,40463,
+40390,40390,40381,40385,40420,40420,40390,40390,
+40311,40300,40327,40327,40482,40482,40562,40581,
+40595,40595,40562,40562,40511,40503,40508,40508,
+40518,40518,40563,40579,40611,40611,40605,40605,
+40560,40545,40509,40509,40471,40471,40447,40439,
+40425,40425,40486,40486,40595,40623,40650,40650,
+40579,40579,40497,40463,40376,40376,40335,40335,
+40357,40368,40400,40400,40413,40413,40348,40313,
+40201,40201,40142,40142,40154,40157,40163,40163,
+40153,40153,40166,40174,40208,40208,40247,40247,
+40284,40286,40259,40259,40146,40146,40068,40042,
+39988,39988,39949,39949,39942,39954,40019,40019,
+40156,40156,40190,40190,40154,40154,40080,40080,
+39990,39965,39924,39924,39953,39953,39966,39967,
+39963,39963,39929,39929,39884,39874,39867,39867,
+39910,39910,39931,39933,39921,39921,39874,39874,
+39821,39807,39790,39790,39817,39817,39867,39889,
+39954,39954,39963,39963,39924,39922,39949,39949,
+40046,40046,40057,40050,40004,40004,39995,39995,
+40021,40036,40077,40077,40143,40143,40169,40174,
+40168,40168,40156,40156,40143,40145,40165,40165,
+40230,40230,40258,40263,40259,40259,40247,40247,
+40230,40222,40204,40204,40187,40187,40180,40178,
+40174,40174,40132,40132,40071,40059,40057,40057,
+40131,40131,40167,40173,40167,40167,40126,40126,
+40070,40044,39967,39967,39887,39887,39868,39873,
+39914,39914,40044,40044,40160,38468,38124,36907,
+34721,36518,40480,40476,40468,40468,40436,40436,
+40396,40383,40358,40358,40337,40337,40332,40332,
+40339,38264,38299,38620,38350,36528,35984,36962,
+39924,39924,37966,35388,35318,36261,36323,36227,
+36254,36303,36706,36863,37273,37721,37825,36781,
+36577,36720,37634,38373,39963,39996,40074,40074,
+40118,40118,40140,40148,40164,40164,40147,40147,
+40106,40092,40067,40067,40054,40054,40035,40026,
+40004,40004,40007,40007,40029,40033,40028,40028,
+39984,39984,39960,39952,39939,39939,39887,39887,
+39816,39788,39716,39716,39631,39631,39559,39533,
+39469,39469,39437,39437,39450,39463,39511,39511,
+39591,39591,39610,39609,39588,39588,39554,39554,
+39520,39515,39524,39524,39579,39579,39592,39593,
+39585,39585,39582,39582,39594,39597,39599,39599,
+39592,39592,39637,39663,39743,39743,39849,39849,
+39929,39948,39962,39962,39929,39929,39944,39962,
+40034,40034,40192,40192,39916,39726,39578,39731,
+39222,38782,38731,38658,38827,38993,39084,39138,
+39193,39195,39132,39049,38841,38721,38661,38822,
+38745,38658,39077,39086,39087,39439,39572,39567,
+39413,39490,39363,39229,39474,39389,39256,39266,
+39344,39855,39783,39868,40128,40126,39671,38913,
+38832,38291,36981,37762,38384,38380,38403,38644,
+39493,39421,39486,39564,39671,39671,39367,39648,
+39874,40408,40553,40753,41260,41203,41043,41026,
+41046,41072,41344,41275,41132,40984,40852,40583,
+40004,39990,39944,39695,39854,40106,40311,40507,
+40691,41302,41671,41777,42288,42440,42388,42391,
+42388,42510,42321,42963,42659,40692,40921,41266,
+39400,39178,39239,39276,38708,38347,38429,37036,
+39525,40905,41416,42213,41854,40987,38705,41203,
+42050,42324,41127,42265,42685,39793,42272,42064,
+41642,41482,41941,42841,42966,43278,39830,39830,
+39790,39778,39759,39759,39768,39768,39803,39823,
+39886,39886,39916,39916,39902,39901,39911,39911,
+39954,39954,39982,39992,40011,40011,40066,40066,
+40135,40162,40222,40222,40288,40288,40318,40326,
+40334,40334,40394,40394,40480,40507,40559,40559,
+40580,40580,40580,40575,40552,40552,40529,40529,
+40524,41407,39528,38842,42014,42912,43191,40151,
+40126,40126,40168,40168,40194,40212,40271,40271,
+40362,40362,40423,40442,40479,40479,40472,40472,
+40435,40426,40422,40422,40455,40455,40487,40499,
+40530,40530,40560,40560,40584,40585,40567,40567,
+40504,40504,40474,40466,40454,41272,40461,40461,
+40470,40476,40501,40501,40511,40511,40466,40438,
+40341,40341,41707,41504,40870,39667,39505,39505,
+39451,39451,39466,39489,39585,39585,39714,39714,
+39803,39844,39959,39959,40120,40120,40208,40237,
+40295,40295,40355,40355,40372,40375,40374,40374,
+40383,40383,40371,40361,40326,40861,40330,40330,
+40543,40374,40393,40393,40388,40388,40442,40469,
+40551,40551,40589,40589,40563,40565,40599,40599,
+40718,40718,40756,40758,40735,40735,40698,40698,
+40660,40650,40636,40636,40647,40647,40652,40653,
+40655,40655,40704,40704,40784,40799,40796,40796,
+40685,40685,40645,40640,40658,40658,40630,40630,
+40555,40532,40488,40488,40485,40485,40500,40507,
+40526,40526,40544,40544,40556,40556,40548,40548,
+40514,40514,40502,40500,40505,40505,40531,40531,
+40570,40583,40605,40605,40614,40614,40614,40611,
+40599,40599,40567,40567,40521,40501,40442,40442,
+40363,40363,40346,40348,40379,40379,40344,40344,
+40266,40256,40283,40283,40441,40441,40519,40536,
+40543,40543,40501,40501,40444,40434,40443,40443,
+40408,40408,40471,40493,40539,40539,40545,40545,
+40508,40491,40438,40438,40351,40351,40312,40303,
+40299,40299,40360,40360,40463,40490,40526,40526,
+40483,40483,40413,40381,40289,40289,40235,40235,
+40244,40251,40278,40278,40290,40290,40224,40189,
+40077,40077,40019,40019,40035,40039,40044,40044,
+40023,40023,40044,40061,40125,40125,40165,40165,
+40172,40166,40130,40130,40030,40030,39937,39899,
+39804,39804,39735,39735,39721,39732,39796,39796,
+39935,39935,39987,39998,39998,39998,39940,39940,
+39842,39815,39777,39777,39812,39812,39834,39840,
+39847,39847,39809,39809,39742,39725,39707,39707,
+39753,39753,39778,39781,39772,39772,39744,39744,
+39718,39711,39694,39694,39691,39691,39742,39771,
+39867,39867,39908,39908,39890,39895,39935,39935,
+40035,40035,40047,40039,39989,39989,39978,39978,
+40005,40018,40062,40062,40133,40133,40171,40180,
+40191,40191,40190,40190,40175,40177,40203,40203,
+40287,40287,40321,40326,40318,40318,40301,40301,
+40286,40281,40273,40273,40277,40277,40277,40277,
+40272,40272,40242,40242,40202,40191,40179,40179,
+40214,40214,40228,40225,40201,40201,40174,40174,
+40155,40138,40074,40074,39976,39976,39924,39914,
+39909,39909,39987,39987,40056,37980,37597,36801,
+37440,40436,40440,40440,40438,40438,40420,40420,
+40391,40382,40357,40357,40325,40325,40305,40297,
+40274,38487,38489,38282,36917,35732,35755,36304,
+38195,37701,37157,36382,36491,36739,36739,37041,
+37185,36465,36680,37274,39736,39736,39711,37519,
+36792,36983,39824,39824,39958,38418,40089,40089,
+40134,40134,40149,40153,40155,40155,40134,40134,
+40103,40092,40071,40071,40055,40055,40034,40027,
+40011,40011,40015,40015,40035,40037,40029,40029,
+39980,39980,39951,39941,39922,39922,39869,39869,
+39807,39781,39710,39710,39613,39613,39539,39511,
+39448,39448,39413,39413,39424,39436,39484,39484,
+39562,39562,39582,39583,39565,39565,39524,39524,
+39473,39464,39465,39465,39519,39519,39530,39529,
+39512,39512,39482,39482,39459,39451,39436,39436,
+39432,39432,39488,39517,39606,39606,39704,39704,
+39758,39763,39735,39735,39658,39658,39672,39692,
+39783,39783,40081,39484,39469,39260,39204,38970,
+38668,38487,38574,38538,38722,38867,38946,39008,
+39093,38952,38913,38854,38520,38705,38863,38740,
+38653,38609,39118,39133,39162,39401,39515,39514,
+39300,39465,39410,39063,39282,39257,39124,39164,
+39330,39459,39416,39538,40024,39799,39458,38383,
+38189,37850,37346,37690,37921,38052,38127,38438,
+38972,38654,38764,38662,38959,39179,39380,39608,
+39793,40306,40573,40838,41245,41203,41150,40876,
+40886,40897,41080,41017,40964,40786,40573,40349,
+39732,39605,39548,39425,39571,39737,40071,40329,
+40689,41375,41684,41901,42367,42382,42318,42086,
+41983,42105,42446,42943,42815,40932,41665,41327,
+40222,39863,39620,38025,38046,38466,38140,36883,
+39302,40404,40759,41789,42546,41426,38782,42055,
+43493,44127,42828,40062,39580,42849,42285,41613,
+41526,41521,42166,42879,43146,43525,39757,39757,
+39749,39745,39732,39732,39725,39725,39746,39758,
+39804,39804,39828,39828,39820,39822,39837,39837,
+39883,39883,39917,39928,39952,39952,40008,40008,
+40075,40100,40158,40158,40224,40224,40255,40262,
+40269,40269,40342,40342,40451,40486,40555,40555,
+40588,40588,40588,40583,40553,40553,40533,40533,
+40519,40979,38767,39238,41298,42900,42914,40102,
+40104,40104,40144,40144,40182,40202,40260,40260,
+40339,40339,40391,40409,40440,40440,40431,40431,
+40396,40389,40386,40386,40420,40420,40454,40468,
+40505,40505,40539,40539,40567,40571,40562,40562,
+40512,40512,40485,40475,40453,41204,40446,40446,
+40466,40475,40507,40507,40528,40528,40498,40472,
+40381,41613,41408,41320,40708,39639,39496,39496,
+39437,39437,39406,39416,39499,39499,39632,39632,
+39734,39775,39883,39883,40023,40023,40113,40147,
+40228,40228,40304,40304,40318,40322,40021,40330,
+40367,40367,40351,40335,40272,40272,40267,40094,
+40322,40706,40364,40364,40375,40375,40424,40448,
+40519,40519,40536,40536,40490,40486,40513,40513,
+40641,40641,40677,40677,40644,40644,40612,40612,
+40594,40590,40586,40586,40591,40591,40595,40599,
+40610,40610,40665,40665,40740,40754,40747,40747,
+40638,40638,40596,40591,40602,40602,40567,40567,
+40491,40468,40435,40435,40455,40455,40471,40475,
+40481,40481,40477,40477,40467,40465,40458,40458,
+40463,40463,40461,40458,40447,40447,40445,40445,
+40452,40456,40467,40467,40485,40485,40497,40501,
+40510,40510,40503,40503,40473,40457,40402,40402,
+40307,40307,40276,40272,40289,40289,40249,40249,
+40174,40165,40194,40194,40355,40355,40426,40439,
+40431,40431,40374,40374,40306,40296,40308,40308,
+40408,40408,40471,40493,40539,40539,40545,40545,
+40508,40491,40438,40438,40351,40351,40312,40303,
+40299,40299,40360,40360,40463,40490,40526,40526,
+40483,40483,40413,40381,40289,40289,40235,40235,
+40244,40251,40278,40278,40290,40290,40224,40189,
+40077,40077,40019,40019,40035,40039,40044,40044,
+40023,40023,40044,40061,40125,40125,40165,40165,
+40172,40166,40130,40130,40030,40030,39937,39899,
+39804,39804,39735,39735,39721,39732,39796,39796,
+39935,39935,39987,39998,39998,39998,39940,39940,
+39842,39815,39777,39777,39812,39812,39834,39840,
+39847,39847,39809,39809,39742,39725,39707,39707,
+39753,39753,39778,39781,39772,39772,39744,39744,
+39718,39711,39694,39694,39691,39691,39742,39771,
+39867,39867,39908,39908,39890,39895,39935,39935,
+40035,40035,40047,40039,39989,39989,39978,39978,
+40005,40018,40062,40062,40133,40133,40171,40180,
+40191,40191,40190,40190,40175,40177,40203,40203,
+40287,40287,40321,40326,40318,40318,40301,40301,
+40286,40281,40273,40273,40277,40277,40277,40277,
+40272,40272,40242,40242,40202,40191,40179,40179,
+40214,40214,40228,40225,40201,40201,40174,40174,
+40155,40138,40074,40074,39976,39976,39924,39914,
+39909,39909,39987,39987,40056,37896,37754,37815,
+39066,40436,40440,40440,40438,40438,40420,40420,
+40391,40382,40357,40357,40325,40325,40305,40297,
+40274,40274,38737,37143,35394,35719,36294,36630,
+38631,38087,37285,37058,37133,37174,38001,39857,
+39834,39824,39799,39799,39736,39736,39711,39708,
+39723,39723,39824,39824,39958,38717,40089,40089,
+40134,40134,40149,40153,40155,40155,40134,40134,
+40103,40092,40071,40071,40055,40055,40034,40027,
+40011,40011,40015,40015,40035,40037,40029,40029,
+39980,39980,39951,39941,39922,39922,39869,39869,
+39807,39781,39710,39710,39613,39613,39539,39511,
+39448,39448,39413,39413,39424,39436,39484,39484,
+39562,39562,39582,39583,39565,39565,39524,39524,
+39473,39464,39465,39465,39519,39519,39530,39529,
+39512,39512,39482,39482,39459,39451,39436,39436,
+39432,39432,39488,39517,39606,39606,39704,39704,
+39758,39763,39735,39735,39658,39658,39672,39692,
+39783,39783,39216,38920,38819,38909,38911,38457,
+38287,38388,38472,38470,38575,38653,38835,38814,
+38823,38570,38582,38666,38442,38553,38624,38518,
+38563,38602,39143,39176,39206,39235,39339,39378,
+39164,39323,39308,38871,39016,39032,38964,38943,
+39076,39422,39342,39375,39548,39196,38841,38010,
+37809,37523,37360,37602,37636,37771,37984,38168,
+38544,38503,38567,38120,38426,38836,39417,39639,
+39757,40193,40434,40748,41105,41110,41133,40763,
+40823,40830,41040,40927,40805,40567,40358,40195,
+39532,39312,39318,39141,39310,39447,39730,39996,
+40385,40945,41245,41541,41883,41990,42194,42021,
+41694,41732,42363,42751,42745,41908,41959,40564,
+40179,39557,37962,36428,38490,39538,35970,36560,
+39207,40351,40853,41615,38459,42037,42239,43867,
+39786,39786,39761,44392,41412,43972,38534,37703,
+38971,39353,43011,42928,42758,43270,39757,39757,
+39749,39745,39732,39732,39725,39725,39746,39758,
+39804,39804,39828,39828,39820,39822,39837,39837,
+39883,39883,39917,39928,39952,39952,40008,40008,
+40075,40100,40158,40158,40224,40224,40255,40262,
+40269,40269,40342,40342,40451,40486,40555,40555,
+40588,40588,40588,40583,40553,40553,40533,40533,
+42483,41667,39605,40080,41687,43417,43089,40102,
+40104,40104,40144,40144,40182,40202,40260,40260,
+40339,40339,40391,40409,40440,40440,40431,40431,
+40396,40389,40386,40386,40420,40420,40454,40468,
+40505,40505,40539,40539,40567,40571,40562,40562,
+40512,40512,40485,40475,40453,41441,40446,40446,
+40466,40475,40507,40507,40528,40528,40498,40912,
+40605,41648,41763,41924,42130,41083,40455,40144,
+39437,39437,39406,39416,39499,39499,39632,39632,
+39734,39775,39883,39883,40023,40023,40113,40147,
+40228,40228,40304,40304,40318,40322,40330,40330,
+40367,40367,40351,40335,40640,40421,39766,40267,
+40322,40364,40364,40364,40375,40375,40424,40448,
+40519,40519,40536,40536,40490,40486,40513,40513,
+40641,40641,40677,40677,40644,40644,40612,40612,
+40594,40590,40586,40586,40591,40591,40595,40599,
+40610,40610,40665,40665,40740,40754,40747,40747,
+40638,40638,40596,40591,40602,40602,40567,40567,
+40491,40468,40435,40435,40455,40455,40471,40475,
+40481,40481,40477,40477,40467,40465,40458,40458,
+40463,40463,40461,40458,40447,40447,40445,40445,
+40452,40456,40467,40467,40485,40485,40497,40501,
+40510,40510,40503,40503,40473,40457,40402,40402,
+40307,40307,40276,40272,40289,40289,40249,40249,
+40174,40165,40194,40194,40355,40355,40426,40439,
+40431,40431,40374,40374,40306,40296,40308,40308,
+40260,40260,40302,40318,40359,40359,40386,40386,
+40392,40382,40326,40326,40180,40180,40138,40137,
+40174,40174,40242,40242,40312,40329,40342,40342,
+40290,40290,40249,40234,40202,40202,40148,40148,
+40099,40090,40094,40094,40128,40128,40090,40064,
+39980,39980,39932,39932,39934,39933,39924,39924,
+39887,39887,39909,39930,40013,40013,40008,40008,
+39915,39883,39818,39818,39774,39774,39706,39674,
+39579,39579,39539,39539,39576,39588,39609,39609,
+39587,39587,39608,39627,39698,39698,39726,39726,
+39700,39691,39674,39674,39666,39666,39665,39666,
+39668,39668,39632,39632,39574,39555,39521,39521,
+39521,39521,39546,39556,39584,39584,39638,39638,
+39712,39726,39724,39724,39637,39637,39650,39672,
+39763,39763,39844,39844,39889,39912,39981,39981,
+40075,40075,40095,40094,40068,40068,40053,40053,
+40055,40060,40087,40087,40150,40150,40209,40233,
+40297,40297,40325,40325,40307,40307,40322,40322,
+40383,40383,40408,40410,40398,40398,40405,40405,
+40428,40438,40463,40463,40495,40495,40500,40497,
+40478,40478,40492,40492,40542,40542,40490,40490,
+40343,40343,40288,40273,40257,40257,40276,40276,
+40309,40305,40257,40257,40133,40133,40060,40042,
+40025,40025,40002,40002,39304,40121,38534,38080,
+40442,40442,40438,40436,40427,40427,40413,40413,
+40389,40377,40339,40339,40273,40273,40216,40187,
+40108,40108,39894,39894,39830,39806,38591,38245,
+39685,39685,39704,38181,38068,38120,39875,39875,
+39882,39882,39877,39877,39843,39843,39833,39835,
+39852,39852,39927,39927,40025,40056,40116,40116,
+40126,40126,40127,40128,40131,40131,40127,40127,
+40117,40114,40106,40106,40091,40091,40086,40089,
+40105,40105,40099,40099,40072,40060,40030,40030,
+39986,39986,39940,39919,39857,39857,39800,39800,
+39776,39760,39708,39708,39622,39622,39552,39525,
+39456,39456,39410,39410,39406,39409,39429,39429,
+39465,39465,39496,39508,39545,39545,39514,39514,
+39431,39411,39389,39389,39433,39433,39444,39443,
+39431,39431,39353,39353,39252,39222,39177,39177,
+39206,39206,39262,39284,39336,39336,39400,39400,
+39428,39419,39341,39341,39203,39203,39215,39279,
+39591,39008,38991,39160,39014,38716,38324,37942,
+38142,38295,38343,38401,38352,38413,38547,38557,
+38508,38382,38470,38587,38560,38520,38380,38461,
+38600,38694,39213,39158,39010,38519,38531,38683,
+38952,39151,39268,38987,38799,38709,38521,38498,
+38429,38802,38746,38681,38174,37878,37574,37091,
+36998,36896,36742,36700,36719,37075,37301,37423,
+37772,37914,38114,38097,38403,38714,39208,39380,
+39466,39796,39898,39971,40228,40333,40497,40522,
+40626,40696,40877,40674,40419,40272,40116,39840,
+39146,38829,38758,38740,38509,38521,38855,39125,
+39260,39840,40114,40237,40408,40629,41047,41549,
+41702,41366,41949,42042,42046,42446,42023,41749,
+40172,38694,38623,38668,39124,39226,37644,38352,
+39391,41791,39841,41143,39414,42842,43243,39719,
+39695,39695,39684,39684,39650,39640,39626,39626,
+39563,39563,39517,39317,43253,42654,39589,39589,
+39621,39630,39642,39642,39648,39648,39669,39680,
+39717,39717,39742,39742,39743,39748,39773,39773,
+39837,39837,39881,39894,39923,39923,39970,39970,
+40019,40039,40087,40087,40151,40151,40190,40203,
+40226,40226,40311,40311,40425,40466,40554,40554,
+40618,40618,40628,40625,40600,40600,40556,42513,
+41264,39799,39406,40170,41785,42606,42741,40070,
+40037,40037,40081,40081,40146,40171,40227,40227,
+40276,40276,40316,40331,40361,40361,40361,40361,
+40345,40343,40346,40346,40368,40368,40403,40419,
+40462,40462,40487,40487,40495,40499,40508,40508,
+40523,40523,40509,40498,40454,40454,40501,40424,
+40409,40409,40429,40429,40501,40501,41458,40246,
+40642,41593,42089,41892,41975,41051,40357,39883,
+38955,38968,39287,39283,39332,39332,39494,39494,
+39661,39718,39835,39835,39921,39921,39990,40021,
+40108,40108,40206,40206,40251,40266,40296,40296,
+40341,40341,40306,40279,39417,39704,40145,40145,
+40205,40424,40312,40264,40279,40279,40325,40349,
+40427,40427,40453,40453,40411,40408,40430,40430,
+40538,40538,40572,40574,40553,40553,40540,40540,
+40541,40542,40546,40546,40542,40542,40538,40539,
+40548,40548,40582,40582,40625,40635,40647,40647,
+40622,40622,40596,40586,40559,40559,40502,40502,
+40436,40416,40383,40383,40378,40378,40411,40431,
+40496,40496,40480,40480,40393,40373,40360,40360,
+40439,40439,40459,40457,40427,40427,40363,40363,
+40286,40266,40249,40249,40298,40298,40341,40361,
+40411,40411,40443,40443,40433,40423,40377,40377,
+40279,40279,40210,40185,40135,40135,40104,40104,
+40107,40115,40154,40154,40242,40242,40277,40281,
+40264,40264,40224,40224,40195,40191,40206,40206,
+40260,40260,40302,40318,40359,40359,40386,40386,
+40392,40382,40326,40326,40180,40180,40138,40137,
+40174,40174,40242,40242,40312,40329,40342,40342,
+40290,40290,40249,40234,40202,40202,40148,40148,
+40099,40090,40094,40094,40128,40128,40090,40064,
+39980,39980,39932,39932,39934,39933,39924,39924,
+39887,39887,39909,39930,40013,40013,40008,40008,
+39915,39883,39818,39818,39774,39774,39706,39674,
+39579,39579,39539,39539,39576,39588,39609,39609,
+39587,39587,39608,39627,39698,39698,39726,39726,
+39700,39691,39674,39674,39666,39666,39665,39666,
+39668,39668,39632,39632,39574,39555,39521,39521,
+39521,39521,39546,39556,39584,39584,39638,39638,
+39712,39726,39724,39724,39637,39637,39650,39672,
+39763,39763,39844,39844,39889,39912,39981,39981,
+40075,40075,40095,40094,40068,40068,40053,40053,
+40055,40060,40087,40087,40150,40150,40209,40233,
+40297,40297,40325,40325,40307,40307,40322,40322,
+40383,40383,40408,40410,40398,40398,40405,40405,
+40428,40438,40463,40463,40495,40495,40500,40497,
+40478,40478,40492,40492,40542,40542,40490,40490,
+40343,40343,40288,40273,40257,40257,40276,40276,
+40309,40305,40257,40257,40133,40133,40060,40042,
+40025,40025,40002,38869,40075,38711,38278,38038,
+40442,40442,40438,40436,40427,40427,40413,40413,
+40389,40377,40339,40339,40273,40273,40216,40187,
+40108,40108,39894,39894,39830,39806,39752,38548,
+38727,39685,39704,38926,39789,39789,39875,39875,
+39882,39882,39877,39877,39843,39843,39833,39835,
+39852,39852,39927,39927,40025,40056,40116,40116,
+40126,40126,40127,40128,40131,40131,40127,40127,
+40117,40114,40106,40106,40091,40091,40086,40089,
+40105,40105,40099,40099,40072,40060,40030,40030,
+39986,39986,39940,39919,39857,39857,39800,39800,
+39776,39760,39708,39708,39622,39622,39552,39525,
+39456,39456,39410,39410,39406,39409,39429,39429,
+39465,39465,39496,39508,39545,39545,39514,39514,
+39431,39411,39389,39389,39433,39433,39444,39443,
+39431,39431,39353,39353,39252,39222,39177,39177,
+39206,39206,39262,39284,39336,39336,39400,39400,
+39428,39419,39341,39341,39203,39203,39215,39279,
+39591,38910,39082,39184,39092,38904,38643,38120,
+38139,38208,38266,38134,37973,38062,38386,38424,
+38413,38251,38422,38464,38496,38555,38466,38439,
+38508,38611,38950,38847,38705,38231,38159,38089,
+38733,38914,39023,38822,38598,38470,38211,38099,
+38026,38302,38385,38344,37809,37418,36975,36548,
+36506,36469,36560,36634,36613,36765,36830,36959,
+37445,37540,37627,38050,38316,38535,38963,39190,
+39282,39339,39376,39520,39576,39726,40027,40299,
+40438,40456,40643,40496,40258,40223,40103,39780,
+39220,38848,38516,38730,38645,38423,38677,38907,
+39135,39423,39575,39547,39929,39926,39989,41172,
+41500,41065,42078,42218,42411,42335,41959,41831,
+41043,39407,39567,38444,37251,38716,37679,38416,
+39752,41947,41391,39271,39174,39103,39730,39719,
+39695,39695,39684,39684,39650,39640,39626,39626,
+39563,39563,39517,39504,39479,43133,39589,39589,
+39621,39630,39642,39642,39648,39648,39669,39680,
+39717,39717,39742,39742,39743,39748,39773,39773,
+39837,39837,39881,39894,39923,39923,39970,39970,
+40019,40039,40087,40087,40151,40151,40190,40203,
+40226,40226,40311,40311,40425,40466,40554,40554,
+40618,40618,40628,40625,40600,40600,40556,41822,
+41104,41813,39819,39771,41621,41364,42588,40070,
+40037,40037,40081,40081,40146,40171,40227,40227,
+40276,40276,40316,40331,40361,40361,40361,40361,
+40345,40343,40346,40346,40368,40368,40403,40419,
+40462,40462,40487,40487,40495,40499,40508,40508,
+40523,40523,40509,40498,40454,41867,40680,40346,
+40409,40409,40429,40429,40501,40501,40405,39656,
+40615,41506,41933,41634,40925,40922,40179,39293,
+38354,37985,38703,39283,39332,39332,39494,39494,
+39661,39718,39835,39835,39921,39921,39990,40021,
+40108,40108,40206,40206,40251,40266,40296,40296,
+40341,40341,40306,40279,40175,40175,40145,40145,
+40205,40676,40178,40264,40279,40279,40325,40349,
+40427,40427,40453,40453,40411,40408,40430,40430,
+40538,40538,40572,40574,40553,40553,40540,40540,
+40541,40542,40546,40546,40542,40542,40538,40539,
+40548,40548,40582,40582,40625,40635,40647,40647,
+40622,40622,40596,40586,40559,40559,40502,40502,
+40436,40416,40383,40383,40378,40378,40411,40431,
+40496,40496,40480,40480,40393,40373,40360,40360,
+40439,40439,40459,40457,40427,40427,40363,40363,
+40286,40266,40249,40249,40298,40298,40341,40361,
+40411,40411,40443,40443,40433,40423,40377,40377,
+40279,40279,40210,40185,40135,40135,40104,40104,
+40107,40115,40154,40154,40242,40242,40277,40281,
+40264,40264,40224,40224,40195,40191,40206,40206,
+40146,40146,40165,40174,40197,40197,40216,40216,
+40227,40219,40172,40172,40045,40045,40022,40030,
+40091,40091,40164,40164,40215,40225,40231,40231,
+40190,40190,40151,40136,40099,40099,40035,40035,
+39971,39958,39950,39950,39982,39982,39967,39956,
+39911,39911,39880,39880,39872,39864,39835,39835,
+39768,39768,39775,39792,39867,39867,39839,39839,
+39704,39661,39586,39586,39569,39569,39530,39509,
+39444,39444,39423,39423,39461,39466,39455,39455,
+39367,39367,39372,39392,39490,39490,39559,39559,
+39574,39574,39562,39562,39511,39511,39501,39503,
+39524,39524,39498,39498,39434,39415,39381,39381,
+39388,39388,39424,39441,39488,39488,39578,39578,
+39682,39706,39716,39716,39623,39623,39633,39654,
+39750,39750,39838,39838,39888,39912,39982,39982,
+40081,40081,40107,40109,40088,40088,40076,40076,
+40076,40080,40103,40103,40164,40164,40231,40260,
+40341,40341,40382,40382,40371,40371,40382,40382,
+40431,40431,40466,40475,40493,40493,40537,40537,
+40589,40606,40643,40643,40673,40673,40675,40671,
+40645,40645,40647,40647,40683,40668,40556,40556,
+40309,40309,40231,40218,40235,40235,40314,40314,
+40382,40391,40370,40370,40270,40270,40193,40172,
+40142,40142,38716,38382,38291,38049,37852,37973,
+40417,40417,40413,40409,40397,40397,40392,40392,
+40389,40381,40340,40340,40253,40253,40183,40153,
+40071,40071,39942,39942,39868,39842,39792,39792,
+38891,38988,39784,39801,39861,39861,39937,39937,
+39986,40000,40019,40019,40027,40027,40037,40042,
+40057,40057,40090,40090,40120,40127,40132,40132,
+40103,40103,40088,40086,40086,40086,40088,40088,
+40084,40082,40075,40075,40054,40054,40059,40066,
+40095,40095,40087,40087,40043,40025,39983,39983,
+39933,39933,39879,39853,39779,39779,39731,39731,
+39729,39719,39674,39674,39579,39579,39519,39498,
+39453,39453,39414,39414,39389,39382,39366,39366,
+39356,39356,39381,39397,39457,39457,39448,39448,
+39378,39357,39327,39327,39333,39333,39319,39309,
+39277,39277,39185,39185,39079,39049,39007,39007,
+39053,39053,39101,39114,39130,39130,39149,39149,
+39135,39108,38984,38984,38816,38816,38797,38372,
+38507,38754,39105,39174,39132,39056,38881,38510,
+38443,38451,38382,38036,37887,37899,38098,38171,
+38115,38034,38110,38118,38153,38239,38153,38097,
+38161,38229,38238,37961,37826,37855,37769,37798,
+38338,38369,38366,38266,38107,38016,37465,37421,
+37397,37554,37659,37701,37285,36938,36691,36001,
+35961,36087,36304,36501,36720,36986,37042,37142,
+37367,37435,37602,37961,38190,38393,38895,39030,
+39096,38721,38727,39008,38978,39213,39514,40082,
+40286,40368,40197,39940,39583,39956,39855,39670,
+39003,38904,38546,38378,38401,38333,38351,38447,
+38511,38771,38825,38674,39700,39636,39397,40948,
+40879,40535,41818,42264,42454,42022,41962,42009,
+40953,40257,39705,37674,39421,39676,36717,38339,
+40354,40885,37345,39587,37327,40199,42385,39685,
+39735,39735,39728,39728,39668,39647,39610,39610,
+39558,39558,39521,39510,39491,39491,39506,39506,
+39523,39529,39537,39537,39541,39541,39575,39595,
+39663,39663,39691,39691,39670,39670,39693,39693,
+39785,39785,39846,39866,39901,39901,39934,39934,
+39959,39972,40015,40015,40095,40095,40151,40170,
+40208,40208,40291,40291,40390,40427,40513,40513,
+40585,40585,40599,40599,40586,40586,41924,41088,
+41632,42467,41520,39732,42057,42265,42505,42147,
+40002,40002,40035,40035,40094,40115,40158,40158,
+40187,40187,40216,40228,40254,40254,40258,40258,
+40256,40257,40271,40271,40304,40304,40348,40367,
+40419,40419,40442,40442,40435,40436,40451,40451,
+40492,40492,40488,40480,40447,40447,40408,40088,
+40330,40330,40385,40385,40388,41040,39959,39819,
+40297,41479,41216,40633,40284,39924,39596,39095,
+37679,37096,38166,39174,39194,39194,39344,39344,
+39537,39601,39730,39730,39822,39822,39891,39919,
+39991,39991,40099,40099,40186,40215,40272,40272,
+40322,40322,40272,40238,40115,40115,40284,39953,
+40096,39945,39778,40149,40167,40167,40217,40246,
+40335,40335,40374,40374,40345,40343,40364,40364,
+40453,40453,40479,40482,40467,40467,40468,40468,
+40482,40486,40491,40491,40478,40478,40470,40470,
+40477,40477,40495,40495,40511,40519,40541,40541,
+40567,40567,40547,40530,40466,40466,40401,40401,
+40363,40353,40345,40345,40366,40366,40405,40425,
+40488,40488,40457,40457,40342,40316,40297,40297,
+40390,40390,40411,40408,40374,40374,40304,40304,
+40222,40199,40169,40169,40197,40197,40238,40257,
+40318,40318,40366,40366,40374,40368,40335,40335,
+40251,40251,40170,40137,40057,40057,40016,40016,
+40033,40042,40070,40070,40116,40116,40144,40151,
+40157,40157,40139,40139,40123,40120,40126,40126,
+40114,40114,40125,40130,40143,40143,40151,40151,
+40153,40146,40106,40106,40009,40009,40002,40012,
+40076,40076,40148,40148,40195,40206,40214,40214,
+40181,40181,40136,40116,40057,40057,39987,39987,
+39934,39923,39915,39915,39940,39940,39931,39924,
+39893,39893,39869,39869,39859,39849,39813,39813,
+39733,39733,39729,39741,39805,39805,39773,39773,
+39642,39601,39528,39528,39513,39513,39484,39469,
+39421,39421,39401,39401,39425,39426,39411,39411,
+39329,39329,39334,39352,39444,39444,39513,39513,
+39532,39533,39516,39516,39452,39452,39442,39447,
+39485,39485,39465,39465,39394,39375,39343,39343,
+39368,39368,39410,39427,39475,39475,39560,39560,
+39654,39676,39691,39691,39621,39621,39641,39666,
+39763,39763,39844,39844,39880,39899,39962,39962,
+40062,40062,40090,40091,40066,40066,40057,40057,
+40063,40069,40096,40096,40158,40158,40224,40253,
+40330,40330,40372,40372,40366,40368,40383,40383,
+40432,40432,40474,40489,40523,40523,40581,40581,
+40636,40655,40692,40692,40713,40713,40713,40708,
+40683,40683,40670,40670,40675,40650,40516,40516,
+40263,40263,40190,40181,40212,40212,40300,40300,
+40382,40395,40381,40381,40292,40292,40216,40194,
+40167,38635,37823,37004,36580,37540,37938,38005,
+38997,40397,40393,40389,40377,40377,40380,40380,
+40391,40385,40350,40350,40257,40257,40190,40163,
+40093,40093,39978,39978,39898,39873,39825,39825,
+39808,39808,39841,39857,39909,39909,39976,39976,
+40020,40034,40054,40054,40070,40070,40082,40087,
+40099,40099,40120,40120,40134,40135,40128,40128,
+40091,40091,40071,40067,40065,40065,40064,40064,
+40058,40054,40043,40043,40020,40020,40024,40031,
+40059,40059,40052,40052,40014,39999,39958,39958,
+39905,39905,39849,39825,39754,39754,39710,39710,
+39712,39702,39656,39656,39551,39551,39496,39478,
+39449,39449,39415,39415,39382,39370,39342,39342,
+39316,39316,39334,39349,39408,39408,39410,39410,
+39357,39341,39309,39309,39293,39293,39263,39249,
+39203,39203,39117,39117,39030,39007,38976,38976,
+39025,39025,39068,39077,39082,39082,39083,39083,
+39051,39018,38882,38882,38718,38718,38720,37660,
+38048,38389,38829,39089,39147,38939,38764,38661,
+38734,38669,38448,37996,37964,38091,38193,38080,
+37939,37831,37781,37771,37681,37837,37915,37865,
+37797,37750,37630,37447,37316,37424,37410,37424,
+37571,37647,37509,37324,37341,37333,37078,37146,
+37145,36816,36771,36789,36678,36539,36383,36141,
+36192,36257,36833,37023,37032,37089,37118,37152,
+37300,37389,37502,38469,35929,38451,38502,38514,
+38515,38664,38676,38705,38775,39080,39225,39525,
+39609,39761,39731,39280,38743,38977,39058,39097,
+37719,38281,38385,37932,37759,37957,37963,38031,
+38036,38245,38298,38505,39062,39230,39468,39654,
+39752,40257,41310,41500,41566,42110,42631,42500,
+41489,41288,40462,37751,38774,39612,37740,37703,
+40707,38662,38989,39120,38717,38816,39660,40936,
+42728,38601,39715,39715,39658,39639,39604,39604,
+39556,39556,39525,39516,39501,39501,39501,39501,
+39501,39500,39497,39497,39493,39493,39536,39562,
+39652,39652,39682,39682,39643,39639,39659,39659,
+39763,39763,39833,39855,39894,39894,39924,39924,
+39938,39949,39992,39992,40083,40083,40144,40165,
+40206,40206,40286,40286,40376,40410,40488,40488,
+40554,40554,40569,40570,40560,40560,41553,40876,
+41591,41511,40806,40389,41560,42047,42250,42426,
+41958,40005,40029,40029,40075,40091,40126,40126,
+40150,40150,40176,40186,40209,40209,40215,40215,
+40213,40216,40235,40235,40279,40279,40326,40346,
+40397,40397,40419,40419,40409,40410,40423,40423,
+40464,40464,40464,40458,40428,41729,39715,40844,
+40272,40270,42108,41051,40715,40975,41345,39026,
+41297,41318,39991,39621,40390,39857,39640,39794,
+39372,38753,38840,39145,39156,39156,39291,39291,
+39476,39540,39673,39673,39779,39779,39849,39876,
+39936,39936,40049,40049,40154,40189,40261,40261,
+40313,40313,39127,40228,40105,40105,40040,39580,
+40064,40076,40107,40107,40126,40126,40178,40208,
+40301,40301,40346,40346,40324,40324,40345,40345,
+40427,40427,40452,40454,40439,40439,40441,40441,
+40455,40458,40462,40462,40448,40448,40440,40440,
+40449,40449,40465,40465,40474,40480,40502,40502,
+40536,40536,40513,40494,40419,40419,40354,40354,
+40329,40326,40334,40334,40375,40375,40414,40430,
+40473,40473,40433,40433,40323,40298,40275,40275,
+40359,40359,40376,40374,40343,40343,40291,40291,
+40230,40212,40181,40181,40186,40186,40214,40230,
+40284,40284,40331,40331,40343,40341,40314,40314,
+40241,40241,40164,40132,40051,40051,40003,40003,
+40007,40010,40031,40031,40070,40070,40104,40116,
+40138,40138,40130,40130,40108,40103,40102,40102,
+40047,40047,40040,40037,40030,40030,40012,40012,
+39993,39985,39964,39964,39938,39938,39962,39980,
+40049,40049,40119,40119,40158,40168,40180,40180,
+40172,40172,40110,40075,39966,39966,39884,39884,
+39857,39850,39842,39842,39851,39851,39855,39856,
+39857,39857,39849,39849,39833,39820,39768,39768,
+39661,39661,39631,39632,39672,39672,39632,39632,
+39513,39477,39411,39411,39399,39399,39390,39386,
+39377,39377,39361,39361,39351,39344,39319,39319,
+39257,39257,39260,39277,39352,39352,39417,39417,
+39443,39443,39420,39420,39323,39323,39316,39329,
+39402,39402,39395,39395,39310,39289,39268,39268,
+39331,39331,39386,39407,39454,39454,39522,39522,
+39591,39609,39633,39633,39618,39618,39663,39693,
+39799,39799,39861,39861,39859,39868,39913,39913,
+40020,40020,40048,40047,40014,40014,40009,40009,
+40032,40043,40079,40079,40143,40143,40207,40233,
+40300,40300,40342,40342,40350,40356,40380,40380,
+40430,40430,40490,40516,40589,40589,40674,40674,
+40738,40757,40792,40792,40791,40791,40786,40780,
+40758,40758,40710,40710,40647,40598,40417,40417,
+40155,40155,40096,40096,40160,40160,40265,40265,
+40378,40399,40395,40395,40331,40331,38122,38091,
+40215,38612,37073,36326,36154,37673,38090,37976,
+38816,40354,40348,40344,40331,40331,40352,40352,
+40395,40399,40374,40374,40268,40268,40209,40189,
+40152,40152,40059,40059,39967,39941,39901,39901,
+39927,39927,39966,39982,40018,40018,40064,40064,
+40094,40105,40128,40128,40155,40155,40172,40175,
+40182,40182,40179,40179,40162,40151,40119,40119,
+40065,40065,40035,40027,40020,40020,40013,40013,
+40000,39993,39971,39971,39942,39942,39944,39950,
+39974,39974,39973,39973,39950,39938,39901,39901,
+39842,39842,39786,39761,39698,39698,39665,39665,
+39674,39665,39616,39616,39491,39491,39443,39434,
+39439,39439,39416,39416,39366,39345,39293,39293,
+39231,39231,39233,39245,39299,39299,39325,39325,
+39313,39305,39274,39274,39208,39208,39142,39115,
+39040,39040,38967,38967,38930,38923,38918,38918,
+38971,38971,39003,39005,38983,38983,38947,38947,
+38877,38831,38670,38670,38519,38519,38575,37549,
+37933,38270,38754,39039,39155,39103,39013,38940,
+38870,38759,38591,38154,38022,38052,38299,38149,
+37872,37573,37403,37445,37262,37388,37488,37502,
+37593,37632,37167,37175,37236,37560,37542,37516,
+37464,37350,37173,37201,37200,37106,37018,37099,
+37056,36589,36525,36705,36419,36285,36216,36145,
+36092,36265,36795,37024,37028,36871,36824,36793,
+36940,37067,37206,38042,35854,36935,38418,38148,
+38166,38413,38481,38569,38548,38691,38792,38896,
+38890,38926,39259,38714,37992,38025,38389,38434,
+37309,37522,37984,37352,37459,37533,37565,37807,
+37634,37648,37770,38049,38231,38559,38868,39200,
+39441,40065,40814,41136,41396,41717,42483,42459,
+41916,41549,40644,38466,37653,38153,38641,39105,
+41689,39146,37849,38883,38728,39632,39625,42417,
+37728,42430,43652,39676,39633,39620,39593,39593,
+39552,39552,39534,39529,39524,39524,39497,39497,
+39455,39440,39410,39410,39389,39389,39451,39491,
+39631,39631,39667,39667,39587,39573,39585,39585,
+39716,39716,39804,39832,39882,39882,39902,39902,
+39894,39901,39943,39943,40056,40056,40132,40157,
+40206,40206,40275,40275,40343,40370,40432,40432,
+40485,40485,40500,40503,40502,40502,40745,40436,
+41031,41214,40925,40571,41158,41638,41716,41987,
+42033,40012,40018,40018,40033,40040,40055,40055,
+40070,40070,40088,40095,40112,40112,40118,40118,
+40120,40127,40155,40155,40222,40222,40278,40299,
+40350,40350,40368,40368,40352,40351,40360,40360,
+40399,40399,40408,40406,40382,41732,40006,41110,
+40142,40133,42361,41384,40758,40864,41241,41354,
+40630,40129,39886,39586,39459,40491,40393,40233,
+39405,39172,39318,39086,39077,39077,39175,39175,
+39343,39405,39544,39544,39685,39685,39759,39782,
+39817,39817,39937,39937,40084,40133,40235,40235,
+40294,39707,39191,40208,40086,40086,39818,39403,
+39999,40001,40016,40016,40037,40037,40094,40127,
+40232,40232,40291,40291,40281,40284,40307,40307,
+40374,40374,40392,40392,40379,40379,40381,40381,
+40394,40397,40397,40397,40381,40381,40375,40376,
+40389,40389,40398,40398,40394,40397,40418,40418,
+40467,40467,40439,40414,40314,40314,40252,40252,
+40256,40265,40309,40309,40397,40397,40434,40441,
+40440,40440,40382,40382,40282,40257,40231,40231,
+40287,40287,40298,40296,40276,40276,40263,40263,
+40255,40247,40218,40218,40169,40169,40166,40173,
+40210,40210,40255,40255,40277,40279,40269,40269,
+40219,40219,40154,40125,40046,40046,39979,39979,
+39950,39944,39944,39944,39972,39972,40019,40042,
+40103,40103,40114,40114,40080,40069,40052,40052,
+40047,40047,40040,40037,40030,40030,40012,40012,
+39993,39985,39964,39964,39938,39938,39962,39980,
+40049,40049,40119,40119,40158,40168,40180,40180,
+40172,40172,40110,40075,39966,39966,39884,39884,
+39857,39850,39842,39842,39851,39851,39855,39856,
+39857,39857,39849,39849,39833,39820,39768,39768,
+39661,39661,39631,39632,39672,39672,39632,39632,
+39513,39477,39411,39411,39399,39399,39390,39386,
+39377,39377,39361,39361,39351,39344,39319,39319,
+39257,39257,39260,39277,39352,39352,39417,39417,
+39443,39443,39420,39420,39323,39323,39316,39329,
+39402,39402,39395,39395,39310,39289,39268,39268,
+39331,39331,39386,39407,39454,39454,39522,39522,
+39591,39609,39633,39633,39618,39618,39663,39693,
+39799,39799,39861,39861,39859,39868,39913,39913,
+40020,40020,40048,40047,40014,40014,40009,40009,
+40032,40043,40079,40079,40143,40143,40207,40233,
+40300,40300,40342,40342,40350,40356,40380,40380,
+40430,40430,40490,40516,40589,40589,40674,40674,
+40738,40757,40792,40792,40791,40791,40786,40780,
+40758,40758,40710,40710,40647,40598,40417,40417,
+40155,40155,40096,40096,40160,40160,40265,40265,
+40378,40399,40395,40395,37692,37084,36947,36965,
+37175,37375,36344,36095,36331,37379,37790,37919,
+38833,40354,40348,40344,40331,40331,40352,40352,
+40395,40399,40374,40374,40268,40268,40209,40189,
+40152,40152,40059,40059,39967,39941,39901,39901,
+39927,39927,39966,39982,40018,40018,40064,40064,
+40094,40105,40128,40128,40155,40155,40172,40175,
+40182,40182,40179,40179,40162,40151,40119,40119,
+40065,40065,40035,40027,40020,40020,40013,40013,
+40000,39993,39971,39971,39942,39942,39944,39950,
+39974,39974,39973,39973,39950,39938,39901,39901,
+39842,39842,39786,39761,39698,39698,39665,39665,
+39674,39665,39616,39616,39491,39491,39443,39434,
+39439,39439,39416,39416,39366,39345,39293,39293,
+39231,39231,39233,39245,39299,39299,39325,39325,
+39313,39305,39274,39274,39208,39208,39142,39115,
+39040,39040,38967,38967,38930,38923,38918,38918,
+38971,38971,39003,39005,38983,38983,38947,38947,
+38877,38831,38670,38670,38519,38519,38575,37364,
+37519,37764,38424,38804,38970,39073,39029,38960,
+38778,38719,38638,38288,38099,37981,38189,38085,
+37670,37530,37341,37393,37310,37352,37467,37351,
+37189,37388,37154,37249,37276,37448,37461,37465,
+37454,37303,37207,37220,37122,37016,36899,36914,
+37025,36737,36597,36593,36474,36476,36404,36343,
+36385,36397,36714,36807,36798,36757,36605,36567,
+36697,36872,37009,37010,37676,37644,37849,37860,
+38139,37973,38059,38141,38202,38305,38486,38638,
+38840,38723,38900,38379,37647,37378,37627,37950,
+37228,37778,37681,37685,37802,37848,37650,37499,
+37414,37400,37587,37845,38284,38684,38774,39170,
+39562,40087,40261,40997,41201,41612,42023,42026,
+42476,41428,40813,40488,39498,39183,37743,37198,
+42060,37497,36871,42947,39632,39632,39625,41623,
+40978,41246,37792,42254,39018,38177,38606,39593,
+39552,39552,39534,39529,39524,39524,39497,39497,
+39455,39440,39410,39410,39389,39389,39451,39491,
+39631,39631,39667,39667,39587,39573,39585,39585,
+39716,39716,39804,39832,39882,39882,39902,39902,
+39894,39901,39943,39943,40056,40056,40132,40157,
+40206,40206,40275,40275,40343,40370,40432,40432,
+40485,40485,40500,40503,40502,40502,40651,40307,
+41323,41183,41336,41105,40859,40655,40139,41313,
+40012,40012,40018,40018,40033,40040,40055,40055,
+40070,40070,40088,40095,40112,40112,40118,40118,
+40120,40127,40155,40155,40222,40222,40278,40299,
+40350,40350,40368,40368,40352,40351,40360,40360,
+40399,40399,40408,40406,40382,41324,40531,42003,
+42586,42791,42739,42355,41362,41144,41659,40411,
+40358,40336,39980,39571,39994,39978,39929,39842,
+39142,38696,39543,39086,39077,39077,39175,39175,
+39343,39405,39544,39544,39685,39685,39759,39782,
+39817,39817,39937,39937,40084,40133,40235,40235,
+40294,40294,39723,40208,40169,40086,39666,40004,
+39999,40001,40016,40016,40037,40037,40094,40127,
+40232,40232,40291,40291,40281,40284,40307,40307,
+40374,40374,40392,40392,40379,40379,40381,40381,
+40394,40397,40397,40397,40381,40381,40375,40376,
+40389,40389,40398,40398,40394,40397,40418,40418,
+40467,40467,40439,40414,40314,40314,40252,40252,
+40256,40265,40309,40309,40397,40397,40434,40441,
+40440,40440,40382,40382,40282,40257,40231,40231,
+40287,40287,40298,40296,40276,40276,40263,40263,
+40255,40247,40218,40218,40169,40169,40166,40173,
+40210,40210,40255,40255,40277,40279,40269,40269,
+40219,40219,40154,40125,40046,40046,39979,39979,
+39950,39944,39944,39944,39972,39972,40019,40042,
+40103,40103,40114,40114,40080,40069,40052,40052,
+39969,39969,39951,39944,39931,39931,39912,39912,
+39896,39892,39886,39886,39892,39892,39922,39938,
+39992,39992,40034,40034,40042,40043,40043,40043,
+40040,40040,39977,39942,39830,39830,39766,39766,
+39762,39760,39753,39753,39748,39748,39759,39766,
+39790,39790,39789,39789,39760,39742,39683,39683,
+39578,39578,39531,39522,39525,39525,39490,39490,
+39422,39399,39355,39355,39341,39341,39336,39333,
+39328,39328,39310,39310,39291,39282,39255,39255,
+39201,39201,39194,39202,39247,39247,39295,39295,
+39320,39322,39304,39304,39225,39225,39221,39234,
+39301,39301,39308,39308,39251,39236,39222,39222,
+39264,39264,39305,39320,39357,39357,39405,39405,
+39450,39466,39499,39499,39523,39523,39571,39597,
+39680,39680,39734,39734,39742,39751,39791,39791,
+39881,39881,39905,39904,39877,39877,39884,39884,
+39924,39941,39994,39994,40079,40079,40143,40166,
+40216,40216,40257,40257,40278,40292,40335,40335,
+40405,40405,40485,40521,40620,40620,40711,40711,
+40761,40778,40814,40814,40830,40830,40841,40841,
+40837,40837,40762,40762,40627,40554,40332,40332,
+40092,40092,40068,40080,40165,40165,40220,40220,
+36569,36606,35632,34966,35396,35583,35362,34876,
+35067,35326,36324,36617,36894,37374,37611,37645,
+38512,40279,40286,40288,40289,40289,40331,40331,
+40386,40396,40386,40386,40304,40304,40261,40250,
+40234,40234,40186,40186,40125,40106,40079,40079,
+40102,40102,40126,40133,40148,40148,40161,40161,
+40163,40165,40175,40175,40205,40205,40214,40215,
+40207,40207,40190,40190,40165,40151,40108,40108,
+40036,40036,39994,39982,39969,39969,39951,39951,
+39924,39912,39878,39878,39840,39840,39836,39838,
+39851,39851,39854,39854,39847,39841,39813,39813,
+39759,39759,39709,39689,39640,39640,39608,39608,
+39602,39591,39543,39543,39433,39433,39395,39390,
+39404,39404,39373,39373,39302,39276,39210,39210,
+39145,39145,39139,39146,39187,39187,39211,39211,
+39208,39200,39163,39163,39073,39073,38989,38954,
+38861,38861,38797,38797,38786,38785,38791,38791,
+38838,38838,38852,38846,38806,38806,38740,38740,
+38631,38574,38401,38401,38266,38266,37293,36939,
+37196,37238,37708,38110,38230,38354,38374,38408,
+38091,37925,37987,37942,37840,37765,37835,37831,
+37630,37556,37588,37585,37378,37179,37035,37215,
+36996,36714,36985,37012,37093,37319,37302,37245,
+37111,36969,36977,37283,37366,36924,36595,36536,
+36533,36646,36644,36558,36087,36198,36197,36240,
+36582,36305,36313,36137,36060,35906,35956,36096,
+36118,35966,36380,36999,37067,37193,37077,37056,
+37103,37724,37185,37218,37368,37373,37652,38329,
+38580,38546,38390,37821,37134,36757,36904,37081,
+36637,37261,37225,36804,35937,37895,37697,37774,
+37791,37877,37317,38186,38212,39057,39316,39166,
+40234,39580,40003,40278,40328,40720,40783,40785,
+41577,41686,41234,41178,40382,39426,37131,38165,
+38676,42574,38854,39810,39706,39706,44096,38535,
+40242,39386,37804,40546,41054,38345,37996,38614,
+40191,42654,39543,39541,39545,39545,39479,39479,
+39432,39414,39372,39372,39326,39326,39385,39426,
+39576,39576,39626,39626,39557,39544,39542,39542,
+39629,39629,39710,39741,39811,39811,39845,39845,
+39844,39853,39902,39902,40020,40020,40101,40129,
+40181,40181,40251,40251,40310,40331,40376,40376,
+40396,40396,40402,40411,40454,41317,41498,41877,
+41615,41719,42027,41497,40520,39865,40055,41093,
+39947,39947,39944,39944,39945,39949,39964,39964,
+39988,39988,39999,40002,40004,40004,40010,40010,
+40023,40033,40066,40066,40132,40132,40171,40183,
+40210,40210,40223,40223,40226,40233,40263,40263,
+40320,40320,40341,40343,41394,40839,41636,42795,
+42976,42404,40741,39991,40263,40806,41347,40468,
+40206,40601,39614,40346,40147,39981,40054,38854,
+36503,37284,39040,39031,38988,38988,39053,39053,
+39210,39263,39378,39378,39477,39477,39535,39553,
+39590,39590,39706,39706,39846,39894,39996,39996,
+40280,40280,39710,40140,40043,40043,39962,39962,
+39935,39931,39939,39939,39968,39968,40023,40051,
+40139,40139,40190,40190,40187,40192,40218,40218,
+40280,40280,40301,40305,40303,40303,40305,40305,
+40304,40302,40298,40298,40290,40290,40302,40312,
+40348,40348,40360,40360,40338,40335,40341,40341,
+40390,40390,40365,40341,40250,40250,40197,40197,
+40205,40216,40257,40257,40341,40341,40363,40362,
+40338,40338,40277,40277,40202,40181,40157,40157,
+40189,40189,40198,40198,40194,40194,40193,40193,
+40191,40184,40153,40153,40089,40089,40074,40076,
+40101,40101,40147,40147,40184,40193,40205,40205,
+40185,40185,40138,40115,40049,40049,39957,39957,
+39875,39855,39838,39838,39890,39890,39941,39963,
+40015,40015,40037,40037,40020,40013,39997,39997,
+39969,39969,39951,39944,39931,39931,39912,39912,
+39896,39892,39886,39886,39892,39892,39922,39938,
+39992,39992,40034,40034,40042,40043,40043,40043,
+40040,40040,39977,39942,39830,39830,39766,39766,
+39762,39760,39753,39753,39748,39748,39759,39766,
+39790,39790,39789,39789,39760,39742,39683,39683,
+39578,39578,39531,39522,39525,39525,39490,39490,
+39422,39399,39355,39355,39341,39341,39336,39333,
+39328,39328,39310,39310,39291,39282,39255,39255,
+39201,39201,39194,39202,39247,39247,39295,39295,
+39320,39322,39304,39304,39225,39225,39221,39234,
+39301,39301,39308,39308,39251,39236,39222,39222,
+39264,39264,39305,39320,39357,39357,39405,39405,
+39450,39466,39499,39499,39523,39523,39571,39597,
+39680,39680,39734,39734,39742,39751,39791,39791,
+39881,39881,39905,39904,39877,39877,39884,39884,
+39924,39941,39994,39994,40079,40079,40143,40166,
+40216,40216,40257,40257,40278,40292,40335,40335,
+40405,40405,40485,40521,40620,40620,40711,40711,
+40761,40778,40814,40814,40830,40830,40841,40841,
+40837,40837,40762,40762,40627,40554,40332,40332,
+40092,40092,40068,40080,40165,40165,40220,36610,
+35007,33466,33666,33980,35213,35523,35192,35664,
+36263,36404,36274,36525,36592,37361,37481,37520,
+38598,40279,40286,40288,40289,40289,40331,40331,
+40386,40396,40386,40386,40304,40304,40261,40250,
+40234,40234,40186,40186,40125,40106,40079,40079,
+40102,40102,40126,40133,40148,40148,40161,40161,
+40163,40165,40175,40175,40205,40205,40214,40215,
+40207,40207,40190,40190,40165,40151,40108,40108,
+40036,40036,39994,39982,39969,39969,39951,39951,
+39924,39912,39878,39878,39840,39840,39836,39838,
+39851,39851,39854,39854,39847,39841,39813,39813,
+39759,39759,39709,39689,39640,39640,39608,39608,
+39602,39591,39543,39543,39433,39433,39395,39390,
+39404,39404,39373,39373,39302,39276,39210,39210,
+39145,39145,39139,39146,39187,39187,39211,39211,
+39208,39200,39163,39163,39073,39073,38989,38954,
+38861,38861,38797,38797,38786,38785,38791,38791,
+38838,38838,38852,38846,38806,38806,38740,38740,
+38631,38574,38401,38401,38266,38266,37073,36784,
+37079,37286,37566,37941,38146,38241,38357,38384,
+38105,37976,38010,37840,37750,37740,37725,37683,
+37567,37597,37638,37603,37409,37174,36898,37281,
+37069,36782,36804,36962,36991,37558,37591,37496,
+37354,37242,37349,37430,37368,37062,36769,36644,
+36461,36537,36616,36447,35903,36083,36179,36121,
+36479,36292,36263,36105,35862,35431,35798,35717,
+36026,36056,36132,36443,36542,36450,36543,36581,
+36692,37035,37093,36944,37091,37647,37603,38243,
+38254,38183,38249,37659,36788,36375,36719,36884,
+37083,37299,36057,36570,37870,37832,34170,34107,
+35832,36249,37654,38544,38801,37264,39875,40047,
+40502,40174,39906,40093,40167,40403,40564,40761,
+41258,41334,41109,40648,40456,39419,38780,41915,
+38745,39926,39810,39810,39706,39706,44137,38292,
+39916,39200,37168,40536,36081,37648,37990,38087,
+36759,37251,41954,39541,39545,39545,39479,39479,
+39432,39414,39372,39372,39326,39326,39385,39426,
+39576,39576,39626,39626,39557,39544,39542,39542,
+39629,39629,39710,39741,39811,39811,39845,39845,
+39844,39853,39902,39902,40020,40020,40101,40129,
+40181,40181,40251,40251,40310,40331,40376,40376,
+40396,40396,40402,40411,41268,41202,41603,41745,
+41628,41640,41593,40434,40288,39866,40016,40821,
+39947,39947,39944,39944,39945,39949,39964,39964,
+39988,39988,39999,40002,40004,40004,40010,40010,
+40023,40033,40066,40066,40132,40132,40171,40183,
+40210,40210,40223,40223,40226,40233,40263,40263,
+40320,40320,40341,41207,41322,40826,40611,42351,
+43206,42130,41426,40751,41260,41539,41438,41530,
+41405,41084,40216,40058,39465,39373,39286,38099,
+36741,37861,39040,39031,38988,38988,39053,39053,
+39210,39263,39378,39378,39477,39477,39535,39553,
+39590,39590,39706,39706,39846,39894,39996,39996,
+39863,39724,39225,40140,40043,40043,39962,39962,
+39935,39931,39939,39939,39968,39968,40023,40051,
+40139,40139,40190,40190,40187,40192,40218,40218,
+40280,40280,40301,40305,40303,40303,40305,40305,
+40304,40302,40298,40298,40290,40290,40302,40312,
+40348,40348,40360,40360,40338,40335,40341,40341,
+40390,40390,40365,40341,40250,40250,40197,40197,
+40205,40216,40257,40257,40341,40341,40363,40362,
+40338,40338,40277,40277,40202,40181,40157,40157,
+40189,40189,40198,40198,40194,40194,40193,40193,
+40191,40184,40153,40153,40089,40089,40074,40076,
+40101,40101,40147,40147,40184,40193,40205,40205,
+40185,40185,40138,40115,40049,40049,39957,39957,
+39875,39855,39838,39838,39890,39890,39941,39963,
+40015,40015,40037,40037,40020,40013,39997,39997,
+39897,39897,39882,39879,39882,39882,39892,39892,
+39910,39913,39909,39909,39874,39874,39871,39876,
+39902,39902,39899,39899,39863,39850,39823,39823,
+39808,39808,39769,39751,39701,39701,39681,39681,
+39683,39683,39678,39678,39672,39672,39680,39686,
+39708,39708,39694,39694,39642,39621,39565,39565,
+39504,39504,39462,39447,39418,39418,39403,39403,
+39405,39403,39390,39390,39360,39360,39330,39315,
+39274,39274,39245,39245,39248,39245,39223,39223,
+39160,39160,39134,39132,39146,39146,39171,39171,
+39189,39195,39206,39206,39200,39200,39196,39195,
+39195,39195,39206,39206,39218,39218,39205,39205,
+39160,39160,39157,39162,39188,39188,39226,39226,
+39265,39280,39310,39310,39330,39330,39351,39361,
+39389,39389,39456,39456,39531,39558,39615,39615,
+39665,39665,39683,39685,39677,39677,39707,39707,
+39760,39786,39861,39861,39981,39981,40050,40072,
+40107,40107,40138,40138,40163,40179,40237,40237,
+40336,40336,40427,40467,40574,40574,40648,40648,
+40664,40675,40717,40717,40790,40790,40838,40851,
+40874,40874,40815,40815,40624,40540,40311,40311,
+40098,40098,40107,40125,40207,40207,36453,35227,
+33042,31799,33329,34153,35354,36126,36153,36455,
+36493,36405,36032,36360,36328,37143,37546,37563,
+38911,40208,40239,40252,40286,40286,40331,40331,
+40363,40369,40372,40372,40349,40349,40324,40314,
+40290,40290,40282,40282,40282,40278,40258,40258,
+40221,40221,40209,40207,40212,40212,40209,40209,
+40189,40185,40185,40185,40212,40212,40209,40202,
+40174,40174,40158,40158,40153,40143,40103,40103,
+40015,40015,39966,39955,39941,39941,39911,39911,
+39869,39852,39811,39811,39768,39768,39751,39746,
+39740,39740,39737,39737,39739,39736,39720,39720,
+39686,39686,39657,39644,39616,39616,39570,39570,
+39520,39500,39450,39450,39388,39388,39360,39353,
+39343,39343,39288,39288,39210,39183,39131,39131,
+39105,39105,39103,39106,39122,39122,39107,39107,
+39064,39047,39001,39001,38939,38939,38868,38835,
+38745,38745,38668,38668,38637,38630,38622,38622,
+38652,38652,38658,38652,38614,38614,38533,38533,
+38400,38341,38174,38174,38043,38043,37327,36895,
+37083,37252,37409,37637,37882,38138,38244,38243,
+37942,37835,37859,37867,37786,37724,37576,37574,
+37574,37547,37555,37509,37378,37236,36994,37259,
+37097,36904,36623,36783,37048,37426,37670,37776,
+37164,37456,37419,37375,37318,36856,36496,36736,
+36518,36832,36694,36379,36299,36434,36549,36311,
+36191,36078,35888,35739,35623,35588,34987,33551,
+33614,33667,35605,35640,35446,35784,35640,34050,
+33963,36094,36255,36417,36841,37116,37457,38132,
+38132,37749,37884,37234,36269,35915,36171,36511,
+35289,34354,34561,37040,38146,35787,34422,34341,
+34432,34686,34246,37350,37240,35295,36450,37971,
+37224,39753,39973,39925,40056,39967,40123,40709,
+40509,40693,40720,41055,40743,39234,40799,41993,
+40050,40015,39874,39874,39825,39825,44026,37434,
+35920,36287,36287,35725,35656,39023,36437,37615,
+39711,39905,40221,37721,42116,42988,39453,39453,
+39458,39454,39426,39426,39358,39358,39382,39406,
+39503,39503,39574,39574,39589,39590,39578,39578,
+39542,39542,39582,39608,39704,39704,39775,39775,
+39808,39826,39884,39884,39981,39981,40051,40076,
+40128,40128,40207,40207,40277,40297,40327,40327,
+40316,40316,40308,40315,41112,40697,41210,41452,
+41587,41111,40274,39823,39778,39453,40028,40772,
+39871,39871,39811,39811,39832,39843,39880,39880,
+39935,39935,39950,39949,39929,39929,39938,39938,
+39968,39979,40006,40006,40041,40041,40047,40046,
+40038,40038,40056,40056,40091,40119,40224,40224,
+40281,40281,40299,40975,41277,40734,40022,42000,
+42651,42173,41575,41316,41669,41650,41524,41592,
+41621,41277,40941,39997,38850,38595,38448,37653,
+38128,39229,39005,38989,38910,38910,38969,38969,
+39134,39180,39245,39245,39218,39218,39239,39257,
+39330,39330,39416,39416,39477,39504,39578,39578,
+40190,40359,39661,40078,39956,39956,39905,39905,
+39886,39886,39903,39903,39955,39955,39996,40011,
+40051,40051,40070,40070,40059,40063,40090,40090,
+40158,40158,40193,40204,40220,40220,40222,40222,
+40204,40199,40194,40194,40213,40213,40257,40279,
+40348,40348,40367,40367,40328,40317,40304,40304,
+40328,40328,40315,40303,40257,40257,40217,40217,
+40198,40194,40193,40193,40211,40211,40211,40209,
+40199,40199,40168,40168,40124,40112,40099,40099,
+40118,40118,40128,40131,40135,40135,40103,40103,
+40043,40023,39986,39986,39977,39977,39984,39990,
+40016,40016,40062,40062,40104,40117,40140,40140,
+40139,40139,40110,40094,40046,40046,39927,39927,
+39787,39754,39732,39732,39848,39848,39889,39894,
+39877,39877,39888,39888,39924,39932,39935,39935,
+39878,39878,39866,39865,39871,39871,39885,39885,
+39907,39910,39905,39905,39865,39865,39856,39857,
+39875,39875,39865,39865,39826,39812,39781,39781,
+39761,39761,39725,39710,39670,39670,39659,39659,
+39664,39664,39660,39660,39650,39650,39656,39662,
+39682,39682,39668,39668,39614,39591,39535,39535,
+39477,39477,39433,39418,39381,39381,39369,39369,
+39384,39385,39379,39379,39346,39346,39313,39298,
+39254,39254,39225,39225,39232,39229,39207,39207,
+39137,39137,39106,39101,39107,39107,39123,39123,
+39139,39145,39162,39162,39174,39174,39170,39166,
+39153,39153,39162,39162,39185,39187,39173,39173,
+39111,39111,39097,39099,39120,39120,39155,39155,
+39195,39209,39238,39238,39254,39254,39270,39278,
+39299,39299,39367,39367,39451,39479,39535,39535,
+39573,39573,39591,39594,39595,39595,39632,39632,
+39690,39716,39794,39794,39912,39912,39983,40006,
+40047,40047,40088,40088,40120,40137,40197,40197,
+40295,40295,40381,40418,40515,40515,40592,40592,
+40620,40635,40687,40687,40767,40767,40832,40850,
+40879,40879,40826,40826,40630,36831,36164,35700,
+40082,40082,40107,40122,37881,36974,35633,35238,
+34488,34860,35954,36048,36182,36925,37752,40133,
+40199,40199,40259,40259,38080,38012,40159,40159,
+40199,40199,40233,40248,40286,40286,40332,40332,
+40357,40364,40369,40369,40360,40360,40341,40332,
+40308,40308,40309,40309,40321,40319,40299,40299,
+40246,40246,40220,40216,40216,40216,40211,40211,
+40189,40184,40182,40182,40207,40207,40201,40193,
+40159,40159,40141,40141,40138,40131,40092,40092,
+40007,40007,39957,39943,39924,39924,39888,39888,
+39844,39828,39788,39788,39744,39744,39723,39717,
+39707,39707,39700,39700,39701,39697,39682,39682,
+39651,39651,39626,39616,39594,39594,39549,39549,
+39493,39471,39422,39422,39369,39369,39340,39330,
+39311,39311,39254,39254,39180,39157,39110,39110,
+39092,39092,39089,39090,39095,39095,39069,39069,
+39022,39003,38955,38955,38894,38894,38825,38793,
+38703,38703,38624,38624,38589,38579,38566,38566,
+38591,38591,38595,38590,38555,38555,38469,38469,
+38330,38269,38103,38103,37972,37972,37875,36743,
+36912,36893,36892,37154,37708,38102,38315,38327,
+37507,37500,37562,37693,37649,37600,37497,37483,
+37572,37778,37802,37493,37310,37095,37166,37340,
+37232,36875,36741,36828,37138,37554,37638,37609,
+37759,37912,37664,37373,37208,37440,36591,36349,
+36248,36511,36466,36302,36485,36388,36418,36137,
+35726,35523,33335,34690,33405,32985,32706,32663,
+32958,33023,33091,33169,33315,33393,33444,33382,
+33295,33028,32929,32959,33067,35555,35145,36989,
+37377,37925,37618,37403,37075,36186,34292,34995,
+32979,34095,33612,33823,33864,34090,34044,34187,
+34157,34634,34623,34705,34974,34680,34989,36156,
+36262,39115,40686,40853,40150,40207,40338,41450,
+40833,42829,42521,41331,39068,39924,40098,40098,
+40064,40034,39911,39911,39844,39844,39412,39609,
+36054,38242,34379,34571,35068,35616,36041,39344,
+39936,40125,40395,40603,40551,37697,38518,38365,
+43374,39465,39439,39439,39366,39366,39379,39398,
+39483,39483,39556,39556,39582,39585,39570,39570,
+39515,39515,39547,39572,39668,39668,39742,39742,
+39781,39802,39865,39865,39966,39966,40037,40061,
+40112,40112,40188,40188,40254,40271,40296,40296,
+40282,40282,40287,41434,40618,40397,40875,40744,
+40691,40400,40269,40170,39856,39402,39987,40867,
+41762,41869,39786,39786,39817,39830,39862,39862,
+39910,39910,39922,39919,39897,39897,39907,39907,
+39937,39948,39968,39968,39993,39993,39994,39993,
+39984,39984,40007,40007,40044,41899,41637,40195,
+40275,40275,40292,41334,41126,40322,40874,42366,
+42716,42329,41508,40502,41360,41500,41417,41266,
+41158,40892,39924,39289,39320,37860,37250,37543,
+38988,38988,38973,38951,38851,38851,38901,38901,
+39067,39112,39173,39173,39137,39137,39152,39169,
+39237,39237,39313,39313,39362,39387,39469,39469,
+40749,40975,39247,39972,39914,39914,39875,39875,
+39859,39859,39875,39875,39925,39925,39960,39972,
+40001,40001,40012,40012,40002,40006,40035,40035,
+40107,40107,40148,40160,40182,40182,40186,40186,
+40168,40164,40163,40163,40192,40192,40238,40261,
+40328,40328,40344,40344,40302,40291,40275,40275,
+40295,40295,40285,40276,40241,40241,40207,40207,
+40184,40178,40172,40172,40176,40176,40173,40170,
+40162,40162,40137,40137,40104,40095,40085,40085,
+40099,40099,40108,40110,40115,40115,40078,40078,
+40011,39991,39954,39954,39951,39951,39960,39966,
+39990,39990,40030,40030,40066,40077,40097,40097,
+40098,40098,40073,40059,40016,40016,39902,39902,
+39762,39730,39709,39709,39825,39825,39864,39867,
+39843,39843,39853,39853,39894,39903,39911,39911,
+39839,39839,39835,39836,39848,39848,39870,39870,
+39896,39900,39894,39894,39846,39846,39823,39819,
+39818,39818,39796,39796,39754,39737,39702,39702,
+39671,39671,39639,39630,39608,39608,39613,39613,
+39624,39626,39622,39622,39606,39606,39606,39610,
+39629,39629,39613,39613,39555,39532,39473,39473,
+39420,39420,39373,39352,39300,39300,39294,39294,
+39335,39343,39346,39346,39309,39309,39273,39257,
+39209,39209,39183,39183,39198,39196,39171,39171,
+39088,39088,39045,39034,39020,39020,39019,39019,
+39030,39038,39064,39064,39109,39109,39106,39098,
+39061,39061,39065,39065,39107,39112,39094,39094,
+39001,39001,38968,38964,38970,38970,38999,38999,
+39040,39053,39079,39079,39086,39086,39094,39098,
+39110,39110,39179,39179,39275,39304,39355,39355,
+39369,39369,39385,39393,39416,39416,39469,39469,
+39533,39562,39641,39641,39754,39754,39826,39852,
+39909,39909,39975,39975,40025,40048,40111,40111,
+40201,40201,40271,40300,40378,40378,40464,40464,
+40521,40549,40624,40624,40716,40716,40818,40845,
+40885,40885,40849,37742,37341,34753,33580,33077,
+35177,36707,40104,36833,36083,35770,35120,34694,
+34124,35558,36450,36562,36261,36140,36739,40125,
+40229,40229,40308,40308,40251,40228,40174,40174,
+40185,40185,40223,40241,40289,40289,40333,40333,
+40347,40353,40365,40365,40384,40384,40376,40369,
+40348,40348,40365,40365,40399,40401,40382,40382,
+40292,40292,40242,40230,40222,40222,40210,40210,
+40185,40179,40174,40174,40196,40196,40182,40171,
+40126,40126,40103,40103,40106,40100,40068,40068,
+39989,39989,39936,39919,39884,39884,39837,39837,
+39791,39774,39735,39735,39692,39692,39666,39657,
+39637,39637,39624,39624,39618,39614,39596,39596,
+39571,39571,39555,39551,39544,39544,39502,39502,
+39435,39412,39360,39360,39323,39323,39291,39277,
+39238,39238,39178,39178,39120,39101,39070,39070,
+39066,39066,39057,39052,39035,39035,38989,38989,
+38931,38910,38858,38858,38799,38799,38732,38701,
+38613,38613,38528,38528,38482,38468,38447,38447,
+38462,38462,38464,38458,38430,38430,38336,38336,
+38182,38118,37954,37954,37825,37825,37787,36228,
+36211,36730,36754,36823,37314,37585,37930,38075,
+37344,37454,37578,37321,37295,37318,37280,37321,
+37542,38058,37775,37473,36817,36743,36898,36995,
+36784,37043,36492,36893,37263,37656,37413,37531,
+37903,37834,37705,37485,37176,37318,36933,36782,
+36169,36204,36416,36598,36542,36545,36503,36151,
+35609,33158,32826,32785,32748,32587,32432,32416,
+32708,32762,32882,33141,33305,33345,33305,33263,
+33183,33067,33007,32966,32922,32882,32961,36048,
+36752,37071,37591,37732,37575,33549,32799,32517,
+32824,33061,33370,33648,34499,33871,33953,33981,
+33960,34299,34487,34648,34815,34494,34880,36002,
+36033,38655,40815,41258,40809,42144,42388,42230,
+40381,42409,39780,41589,39045,41631,40123,40123,
+40090,40069,39996,39996,39880,39880,39132,37285,
+36403,38243,34447,34572,35026,35380,37872,36978,
+38247,39775,40139,39961,36229,36204,41159,41561,
+39371,39487,39466,39466,39382,39382,39371,39381,
+39443,39443,39518,39518,39562,39567,39549,39549,
+39460,39460,39473,39495,39590,39590,39669,39669,
+39720,39746,39821,39821,39931,39931,40006,40030,
+40080,40080,40149,40149,40200,40213,40223,40223,
+40208,40208,40241,41519,40746,40354,40719,40924,
+40153,40149,40039,39959,40382,39943,40672,40154,
+40638,41251,39740,39740,39794,39807,39827,39827,
+39852,39852,39855,39850,39826,39826,39838,39838,
+39868,39876,39883,39883,39885,39885,39880,39877,
+39870,39870,39906,39906,39942,41948,42378,42203,
+40265,40265,40277,41644,41324,40298,40997,42430,
+42932,41621,40397,39150,41120,41358,41359,40747,
+40159,39870,39431,39400,38974,38031,37919,38144,
+38951,38951,38899,38860,38714,38714,38743,38743,
+38907,38951,39008,39008,38966,38966,38968,38981,
+39039,39039,39091,39091,39118,39143,39247,39247,
+39301,39165,38053,38571,39820,39820,39805,39805,
+39797,39797,39809,39809,39853,39853,39875,39881,
+39886,39886,39883,39883,39874,39879,39912,39912,
+39996,39996,40048,40065,40097,40097,40107,40107,
+40090,40089,40097,40097,40147,40147,40199,40220,
+40279,40279,40288,40288,40241,40228,40208,40208,
+40219,40219,40216,40214,40199,40199,40178,40178,
+40152,40143,40124,40124,40108,40108,40095,40091,
+40085,40085,40075,40075,40062,40059,40055,40055,
+40063,40063,40067,40068,40069,40069,40023,40023,
+39950,39927,39892,39892,39898,39898,39910,39916,
+39935,39935,39961,39961,39980,39987,40001,40001,
+40002,40002,39984,39975,39944,39944,39842,39842,
+39714,39683,39664,39664,39772,39772,39805,39806,
+39776,39776,39784,39784,39829,39841,39858,39858,
+39839,39839,39835,39836,39848,39848,39870,39870,
+39896,39900,39894,39894,39846,39846,39823,39819,
+39818,39818,39796,39796,39754,39737,39702,39702,
+39671,39671,39639,39630,39608,39608,39613,39613,
+39624,39626,39622,39622,39606,39606,39606,39610,
+39629,39629,39613,39613,39555,39532,39473,39473,
+39420,39420,39373,39352,39300,39300,39294,39294,
+39335,39343,39346,39346,39309,39309,39273,39257,
+39209,39209,39183,39183,39198,39196,39171,39171,
+39088,39088,39045,39034,39020,39020,39019,39019,
+39030,39038,39064,39064,39109,39109,39106,39098,
+39061,39061,39065,39065,39107,39112,39094,39094,
+39001,39001,38968,38964,38970,38970,38999,38999,
+39040,39053,39079,39079,39086,39086,39094,39098,
+39110,39110,39179,39179,39275,39304,39355,39355,
+39369,39369,39385,39393,39416,39416,39469,39469,
+39533,39562,39641,39641,39754,39754,39826,39852,
+39909,39909,39975,39975,40025,40048,40111,40111,
+40201,40201,40271,40300,40378,40378,40464,40464,
+40521,40549,40624,40624,40716,40716,40818,40845,
+40885,37300,36687,36547,35794,32738,32268,32188,
+34395,35583,36048,35113,34997,35400,34392,33304,
+33298,35695,36320,36383,36296,35722,35831,40125,
+40229,40229,40308,40308,40251,40228,40174,40174,
+40185,40185,40223,40241,40289,40289,40333,40333,
+40347,40353,40365,40365,40384,40384,40376,40369,
+40348,40348,40365,40365,40399,40401,40382,40382,
+40292,40292,40242,40230,40222,40222,40210,40210,
+40185,40179,40174,40174,40196,40196,40182,40171,
+40126,40126,40103,40103,40106,40100,40068,40068,
+39989,39989,39936,39919,39884,39884,39837,39837,
+39791,39774,39735,39735,39692,39692,39666,39657,
+39637,39637,39624,39624,39618,39614,39596,39596,
+39571,39571,39555,39551,39544,39544,39502,39502,
+39435,39412,39360,39360,39323,39323,39291,39277,
+39238,39238,39178,39178,39120,39101,39070,39070,
+39066,39066,39057,39052,39035,39035,38989,38989,
+38931,38910,38858,38858,38799,38799,38732,38701,
+38613,38613,38528,38528,38482,38468,38447,38447,
+38462,38462,38464,38458,38430,38430,38336,38336,
+38182,38118,37954,37954,37825,37825,37787,36327,
+36049,36364,36478,36660,36763,36170,37371,37614,
+37104,37336,37359,37281,37332,37335,37140,37228,
+37558,37893,37519,37218,36574,36481,36385,36691,
+36624,36466,36647,36707,37062,37130,37008,37049,
+37495,37549,37250,36680,36469,36692,36420,36421,
+36217,36024,36294,36347,36291,36493,36774,36434,
+33793,33154,32700,32700,32661,32527,32442,32364,
+32433,32384,32561,33066,33192,33268,33341,33362,
+33288,33175,33111,33031,32952,32842,32738,32892,
+33282,34198,37209,37059,37383,33465,33014,33047,
+32770,32792,32972,33406,33585,33806,34132,33932,
+33979,34094,33642,33617,34772,34875,36967,35882,
+36091,36694,40204,40976,39539,39291,39499,38421,
+40609,40034,38769,42912,38893,39298,40123,40123,
+40090,40069,39996,39996,39880,39437,39966,37556,
+36239,36371,36233,37252,37617,35089,35245,38405,
+38760,39523,39110,34060,34247,35839,40353,40429,
+41012,37955,39466,39466,39382,39382,39371,39381,
+39443,39443,39518,39518,39562,39567,39549,39549,
+39460,39460,39473,39495,39590,39590,39669,39669,
+39720,39746,39821,39821,39931,39931,40006,40030,
+40080,40080,40149,40149,40200,40213,40223,40223,
+40208,40208,40241,41287,40573,40206,40517,41283,
+41012,39892,40030,39959,40230,40016,39828,39782,
+40153,40807,41359,41555,41341,39807,39827,39827,
+39852,39852,39855,39850,39826,39826,39838,39838,
+39868,39876,39883,39883,39885,39885,39880,39877,
+39870,39870,39906,39906,39942,41785,41999,41743,
+42307,40265,40277,41801,40931,40424,41849,42451,
+42757,40725,39979,39141,41096,41175,40923,40231,
+39681,39906,39617,39119,38721,38191,38704,39007,
+38951,38951,38899,38860,38714,38714,38743,38743,
+38907,38951,39008,39008,38966,38966,38968,38981,
+39039,39039,39091,39091,39118,39143,39247,39247,
+38882,37466,37133,39044,38541,39820,39805,39805,
+39797,39797,39809,39809,39853,39853,39875,39881,
+39886,39886,39883,39883,39874,39879,39912,39912,
+39996,39996,40048,40065,40097,40097,40107,40107,
+40090,40089,40097,40097,40147,40147,40199,40220,
+40279,40279,40288,40288,40241,40228,40208,40208,
+40219,40219,40216,40214,40199,40199,40178,40178,
+40152,40143,40124,40124,40108,40108,40095,40091,
+40085,40085,40075,40075,40062,40059,40055,40055,
+40063,40063,40067,40068,40069,40069,40023,40023,
+39950,39927,39892,39892,39898,39898,39910,39916,
+39935,39935,39961,39961,39980,39987,40001,40001,
+40002,40002,39984,39975,39944,39944,39842,39842,
+39714,39683,39664,39664,39772,39772,39805,39806,
+39776,39776,39784,39784,39829,39841,39858,39858,
+39791,39791,39803,39809,39824,39824,39838,39838,
+39845,39845,39840,39840,39813,39813,39785,39774,
+39749,39749,39735,39735,39723,39716,39687,39687,
+39637,39637,39598,39585,39560,39560,39563,39563,
+39583,39586,39581,39581,39549,39549,39543,39545,
+39561,39561,39556,39556,39515,39495,39429,39429,
+39338,39338,39268,39242,39176,39176,39163,39163,
+39205,39214,39218,39218,39184,39184,39167,39160,
+39141,39141,39137,39137,39154,39149,39110,39110,
+38999,38999,38936,38918,38884,38884,38865,38865,
+38868,38874,38900,38900,38957,38957,38960,38954,
+38919,38919,38912,38912,38935,38934,38908,38908,
+38818,38818,38771,38757,38737,38737,38757,38757,
+38807,38822,38844,38844,38838,38838,38852,38863,
+38902,38902,38963,38963,39020,39035,39049,39049,
+39028,39028,39051,39068,39130,39130,39211,39211,
+39273,39297,39350,39350,39402,39402,39476,39514,
+39631,39631,39768,39768,39867,39900,39967,39967,
+40023,40023,40044,40050,40063,40063,40203,40203,
+40357,40423,40597,40597,40678,40678,36652,35629,
+35680,35533,33955,33244,32181,31299,31522,32196,
+35596,36187,36283,36571,36508,36377,35680,36055,
+36591,36611,36602,36379,36517,36861,37024,40104,
+40341,40341,40357,40357,40287,40263,40216,40216,
+40209,40209,40235,40250,40294,40294,40332,40332,
+40339,40342,40358,40358,40392,40392,40398,40398,
+40393,40393,40421,40421,40457,40461,40444,40444,
+40310,40310,40225,40205,40190,40190,40180,40180,
+40166,40162,40155,40155,40165,40165,40140,40124,
+40068,40068,40035,40035,40032,40027,40007,40007,
+39962,39962,39905,39879,39806,39806,39739,39739,
+39701,39687,39653,39653,39615,39615,39590,39581,
+39559,39559,39530,39530,39500,39487,39451,39451,
+39415,39415,39403,39403,39411,39411,39393,39393,
+39350,39334,39293,39293,39257,39257,39208,39183,
+39114,39114,39064,39064,39049,39045,39034,39034,
+39026,39026,38997,38981,38929,38929,38870,38870,
+38826,38805,38750,38750,38662,38662,38591,38560,
+38482,38482,38398,38398,38347,38331,38301,38301,
+38295,38295,38292,38288,38271,38271,38165,38165,
+37988,37916,37733,37733,37590,37590,37549,37565,
+35217,35456,35499,34893,34852,35510,35581,35482,
+34778,34967,35018,36028,35957,35030,34820,34852,
+34867,35613,34621,34606,34286,34252,34280,35987,
+35915,35999,36261,36330,36282,36053,34199,33692,
+36706,36710,36639,35854,35617,35472,35530,35626,
+35698,35475,35859,36008,35897,36249,36348,36559,
+36322,34909,32699,32724,32533,32309,32189,32003,
+31825,31869,31966,32561,32989,33384,33543,33476,
+33361,33206,33062,32846,32730,32767,32775,32495,
+32495,32587,33641,34307,34165,33741,32076,32880,
+32397,32509,32703,33103,33308,33562,34205,33968,
+33849,33972,33952,34014,34709,35492,35291,35356,
+35697,36549,37754,40174,38523,38697,38813,40246,
+37824,39049,39565,39735,39067,42333,40184,40184,
+40151,40135,40091,40091,40427,42004,41322,38114,
+38965,34595,34041,34108,34300,37457,37962,38149,
+39263,39680,39793,36015,36671,38984,38795,38660,
+38628,39339,39344,39503,39857,36654,37316,39363,
+39428,39428,39472,39472,39474,39470,39448,39448,
+39396,39396,39411,39427,39496,39496,39558,39558,
+39607,39636,39731,39731,39892,39892,39985,40012,
+40056,40056,40090,40090,40081,40076,40063,40063,
+40064,40064,40107,39930,40448,41257,40693,40475,
+40221,39989,40007,39861,39595,38956,38857,39118,
+39637,40403,39630,40200,40625,39832,39823,39823,
+39752,39752,39730,39721,39704,39704,39710,39710,
+39722,39722,39709,39709,39692,39692,39702,39712,
+39747,39747,39808,39808,39834,39950,41478,41654,
+41084,41739,40903,40136,39626,39547,40362,41687,
+42001,39551,39526,39466,40498,40707,41059,40333,
+40570,40210,39111,38480,38114,38978,38907,38907,
+38850,38850,38721,38647,38405,38405,38369,38369,
+38528,38581,38687,38687,38764,38764,38785,38789,
+38786,38786,38807,38807,38848,38884,39026,39026,
+39180,38420,37323,39120,38452,39629,39660,39660,
+39661,39661,39658,39658,39665,39665,39666,39665,
+39657,39657,39648,39648,39647,39657,39705,39705,
+39815,39815,39889,39913,39959,39959,39985,39985,
+39984,39990,40017,40017,40089,40089,40121,40127,
+40128,40128,40108,40108,40071,40061,40049,40049,
+40072,40072,40078,40078,40074,40074,40070,40070,
+40056,40051,40041,40041,40031,40031,40017,40012,
+39998,39998,39996,39996,40007,40010,40013,40013,
+40010,40010,40000,39995,39978,39978,39944,39944,
+39910,39897,39870,39870,39841,39841,39837,39839,
+39854,39854,39850,39850,39831,39824,39808,39808,
+39790,39790,39776,39770,39757,39757,39722,39722,
+39687,39677,39666,39666,39681,39681,39704,39713,
+39737,39737,39749,39749,39750,39753,39767,39767,
+39791,39791,39803,39809,39824,39824,39838,39838,
+39845,39845,39840,39840,39813,39813,39785,39774,
+39749,39749,39735,39735,39723,39716,39687,39687,
+39637,39637,39598,39585,39560,39560,39563,39563,
+39583,39586,39581,39581,39549,39549,39543,39545,
+39561,39561,39556,39556,39515,39495,39429,39429,
+39338,39338,39268,39242,39176,39176,39163,39163,
+39205,39214,39218,39218,39184,39184,39167,39160,
+39141,39141,39137,39137,39154,39149,39110,39110,
+38999,38999,38936,38918,38884,38884,38865,38865,
+38868,38874,38900,38900,38957,38957,38960,38954,
+38919,38919,38912,38912,38935,38934,38908,38908,
+38818,38818,38771,38757,38737,38737,38757,38757,
+38807,38822,38844,38844,38838,38838,38852,38863,
+38902,38902,38963,38963,39020,39035,39049,39049,
+39028,39028,39051,39068,39130,39130,39211,39211,
+39273,39297,39350,39350,39402,39402,39476,39514,
+39631,39631,39768,39768,39867,39900,39967,39967,
+40023,40023,40044,40050,40063,40063,40203,40203,
+40357,40423,40597,40597,36418,36270,35689,34033,
+34448,34763,34089,33720,32747,31497,32383,34453,
+36484,36455,35945,36935,37107,37091,37100,37404,
+37373,36811,36879,36733,35975,36559,37114,40104,
+40341,40341,40357,40357,40287,40263,40216,40216,
+40209,40209,40235,40250,40294,40294,40332,40332,
+40339,40342,40358,40358,40392,40392,40398,40398,
+40393,40393,40421,40421,40457,40461,40444,40444,
+40310,40310,40225,40205,40190,40190,40180,40180,
+40166,40162,40155,40155,40165,40165,40140,40124,
+40068,40068,40035,40035,40032,40027,40007,40007,
+39962,39962,39905,39879,39806,39806,39739,39739,
+39701,39687,39653,39653,39615,39615,39590,39581,
+39559,39559,39530,39530,39500,39487,39451,39451,
+39415,39415,39403,39403,39411,39411,39393,39393,
+39350,39334,39293,39293,39257,39257,39208,39183,
+39114,39114,39064,39064,39049,39045,39034,39034,
+39026,39026,38997,38981,38929,38929,38870,38870,
+38826,38805,38750,38750,38662,38662,38591,38560,
+38482,38482,38398,38398,38347,38331,38301,38301,
+38295,38295,38292,38288,38271,38271,38165,38165,
+37988,37916,37733,37733,37590,37590,37549,37565,
+34643,34398,34220,34317,34487,34918,35078,35038,
+34703,34548,34641,34910,34527,34415,34398,34466,
+34582,34437,34328,34188,34041,34045,34113,34274,
+34381,34526,35932,35982,36082,34648,33905,33340,
+36149,36366,36351,35313,35275,34094,34216,33938,
+33914,35074,35681,35744,35843,35875,35713,36185,
+36004,34151,32382,32475,32338,32180,32085,31789,
+31581,31584,31731,32379,32874,33325,33566,33484,
+33458,33286,33142,32906,32648,32579,32994,32548,
+32401,32325,32739,33208,33245,33308,33263,32923,
+32344,32340,32575,32943,33167,33211,33924,33641,
+33566,33408,33783,33813,34506,34727,35140,35860,
+36546,36171,37334,37738,38197,38481,39712,39944,
+39028,39341,39331,43714,42401,43110,40184,40184,
+40151,40135,40091,40091,39078,42420,39824,38548,
+36129,34447,33916,33985,34535,34852,37466,37886,
+38466,38806,36164,36091,36088,36075,35997,35857,
+35582,35917,35913,35783,38375,39244,39450,39363,
+39428,39428,39472,39472,39474,39470,39448,39448,
+39396,39396,39411,39427,39496,39496,39558,39558,
+39607,39636,39731,39731,39892,39892,39985,40012,
+40056,40056,40090,40090,40081,40076,40063,40063,
+40064,40064,40826,39787,40318,40740,40712,41552,
+41224,39608,39587,39664,39335,38838,38284,38631,
+38955,39800,39068,38924,38950,40822,41311,39823,
+39752,39752,39730,39721,39704,39704,39710,39710,
+39722,39722,39709,39709,39692,39692,39702,39712,
+39747,39747,39808,39808,39834,39467,41288,41723,
+40701,41152,40298,39657,39191,39299,40119,40354,
+40707,39462,39212,39682,40091,40713,40960,40451,
+40509,39745,37907,38016,38479,38978,38907,38907,
+38850,38850,38721,38647,38405,38405,38369,38369,
+38528,38581,38687,38687,38764,38764,38785,38789,
+38786,38786,38807,38807,38848,38884,39026,39026,
+39180,38778,37313,39031,39629,39629,39660,39660,
+39661,39661,39658,39658,39665,39665,39666,39665,
+39657,39657,39648,39648,39647,39657,39705,39705,
+39815,39815,39889,39913,39959,39959,39985,39985,
+39984,39990,40017,40017,40089,40089,40121,40127,
+40128,40128,40108,40108,40071,40061,40049,40049,
+40072,40072,40078,40078,40074,40074,40070,40070,
+40056,40051,40041,40041,40031,40031,40017,40012,
+39998,39998,39996,39996,40007,40010,40013,40013,
+40010,40010,40000,39995,39978,39978,39944,39944,
+39910,39897,39870,39870,39841,39841,39837,39839,
+39854,39854,39850,39850,39831,39824,39808,39808,
+39790,39790,39776,39770,39757,39757,39722,39722,
+39687,39677,39666,39666,39681,39681,39704,39713,
+39737,39737,39749,39749,39750,39753,39767,39767,
+39663,39663,39681,39689,39710,39710,39729,39729,
+39735,39736,39731,39731,39713,39713,39694,39688,
+39677,39677,39677,39677,39678,39674,39653,39653,
+39603,39603,39562,39548,39517,39517,39505,39505,
+39505,39504,39498,39498,39483,39483,39471,39468,
+39464,39464,39453,39453,39429,39413,39355,39355,
+39254,39254,39174,39141,39064,39064,39041,39041,
+39075,39083,39084,39084,39055,39055,39050,39050,
+39056,39056,39059,39059,39058,39049,38999,38999,
+38887,38887,38822,38800,38757,38757,38723,38723,
+38714,38714,38722,38722,38755,38755,38757,38753,
+38731,38731,38720,38720,38718,38712,38678,38678,
+38604,38604,38559,38545,38516,38516,38510,38510,
+38529,38534,38541,38541,38542,38542,38565,38579,
+38624,38624,38679,38679,38720,38728,38724,38724,
+38686,38686,38703,38719,38784,38784,38852,38852,
+38887,38907,38971,38971,39083,39083,39177,39217,
+39326,39326,39488,39488,39630,39674,39757,39757,
+39806,39806,39831,39839,39853,39853,40081,40081,
+40267,40319,36445,36127,36568,36191,35257,34669,
+34689,35363,34635,34385,33233,31940,33764,35199,
+36874,36388,35973,37050,37285,37505,37556,37477,
+37598,36917,36725,36352,35764,36137,36671,40229,
+40423,40423,40398,40398,40319,40294,40245,40245,
+40236,40236,40258,40272,40316,40316,40348,40348,
+40350,40353,40362,40362,38015,37674,37685,40400,
+40393,40393,40403,40403,38148,40427,38866,40424,
+37361,37535,40184,40162,40150,40150,40143,40143,
+40139,38397,38033,37946,40111,40111,40077,40060,
+40007,40007,39971,39971,39961,39956,39939,39939,
+39910,39910,39855,39828,39749,39749,39679,39679,
+39644,39631,39596,39596,39558,39558,39530,39517,
+39486,39486,39444,39444,39399,39382,39338,39338,
+39299,39299,39281,39277,39276,39276,39267,39267,
+39242,39231,39199,39199,39163,39163,39119,39098,
+39039,39039,38995,38995,38977,38969,38949,38949,
+38923,38923,38885,38867,38809,38809,38745,38745,
+38702,38681,38619,38619,38522,38522,38455,38429,
+38367,38367,38294,38294,38244,38226,38188,38188,
+38157,38157,38140,38132,38113,38113,37994,37994,
+37802,37723,37521,37521,37341,37341,37288,37303,
+34386,34192,33976,34007,34156,34509,34657,34925,
+34564,34224,34152,34234,34216,34207,34173,34252,
+34092,33948,33883,33822,33819,33803,33861,34134,
+34241,34353,34560,34466,34320,33805,33506,33337,
+35754,35992,36056,35663,34824,33513,33630,33642,
+33719,33723,33824,35231,35449,35570,35574,35948,
+35833,35159,32266,32297,32080,31935,31857,31387,
+31457,31527,31620,32140,32682,33314,33704,33451,
+33421,33328,33248,32979,32536,32403,32312,32391,
+32373,32225,32245,32438,32681,32839,32628,32488,
+32421,32194,32246,32736,33065,33286,32875,33333,
+33300,33350,33572,33649,34438,36580,36141,35808,
+36531,36395,36909,37706,37351,38263,41365,40118,
+38917,39615,37624,43658,44018,40007,40133,40133,
+40122,40121,40130,39548,38083,36454,35341,34839,
+34605,33762,35995,35520,34083,34624,34846,37559,
+38258,38654,36123,35989,36224,36143,36151,36165,
+36090,36158,36714,36075,35583,36619,35149,39825,
+40501,39436,39382,39382,39384,39384,39386,39386,
+39372,39372,39401,39420,39481,39481,39541,39541,
+39591,39619,39706,39706,39849,39849,39919,39935,
+39946,39946,39953,39953,39939,39931,39910,39910,
+39901,39901,40992,40104,40528,40415,42277,41213,
+40386,39131,39107,39298,39790,39289,38370,38064,
+38173,38883,38606,38820,38956,39340,40480,41058,
+39704,39704,39629,39609,39591,39591,39579,39579,
+39567,39561,39547,39547,39553,39553,39590,39609,
+39674,39674,39746,39746,39796,39581,41167,41757,
+40581,40371,39455,39225,38927,39409,40650,39991,
+40265,39299,38938,39014,39254,39561,39771,40008,
+39757,38705,37884,38755,39094,38807,38731,38731,
+38622,38622,38602,38536,38226,38226,38164,38164,
+38275,38317,38417,38417,38530,38530,38555,38555,
+38531,38531,38550,38550,38615,38656,38799,38799,
+38974,38994,37770,39091,39366,39366,39445,39445,
+39450,39451,39447,39447,39459,39459,39466,39467,
+39466,39466,39459,39459,39453,39459,39495,39495,
+39588,39588,39660,39686,39743,39743,39804,39804,
+39853,39872,39918,39918,39973,39973,39981,39975,
+39939,39939,39913,39913,39903,39903,39914,39914,
+39956,39956,39965,39965,39952,39952,39943,39943,
+39931,39926,39914,39914,39901,39901,39892,39889,
+39883,39883,39895,39895,39915,39921,39928,39928,
+39927,39927,39914,39906,39882,39882,39855,39855,
+39838,39831,39813,39813,39782,39782,39772,39772,
+39779,39779,39759,39759,39720,39708,39681,39681,
+39667,39667,39665,39665,39668,39668,39658,39658,
+39646,39640,39624,39624,39598,39598,39606,39615,
+39648,39648,39652,39652,39632,39629,39634,39634,
+39597,39597,39615,39623,39646,39646,39669,39669,
+39678,39679,39675,39675,39656,39656,39645,39643,
+39647,39647,39655,39655,39654,39650,39631,39631,
+39585,39585,39546,39531,39497,39497,39473,39473,
+39460,39456,39450,39450,39451,39451,39440,39434,
+39418,39418,39402,39402,39384,39371,39318,39318,
+39222,39222,39142,39110,39031,39031,39004,39004,
+39033,39039,39039,39039,39011,39011,39009,39012,
+39025,39025,39025,39025,39012,39000,38947,38947,
+38845,38845,38782,38760,38715,38715,38676,38676,
+38662,38659,38658,38658,38672,38672,38670,38668,
+38656,38656,38643,38643,38630,38620,38585,38585,
+38520,38520,38481,38467,38440,38440,38422,38422,
+38416,38414,38411,38411,38422,38422,38449,38462,
+38503,38503,38558,38558,38600,38608,38604,38604,
+38563,38563,38574,38587,38641,38641,38692,38692,
+38711,38730,38810,38810,38978,38978,39088,39128,
+39216,39216,39375,39375,39532,39582,39674,39674,
+39729,39729,39769,39782,39807,39807,40017,40017,
+36838,35477,34552,35042,34796,34689,35126,32900,
+32378,32664,33063,32978,32586,31191,34206,36565,
+38550,38550,38643,38697,38871,38871,39113,39113,
+39409,36622,35822,35727,35861,35786,36033,37244,
+38135,40431,40380,40380,40308,40286,40246,40246,
+40242,40242,40265,40278,40320,40320,40350,40350,
+40353,40354,40359,40359,40381,40381,40397,40395,
+40372,40372,40373,40373,40384,40385,40381,37052,
+36049,35573,35503,36628,37139,37245,40125,40125,
+40126,40124,40113,40113,40087,40087,40049,40033,
+39987,39987,39951,39951,39937,39930,39912,39912,
+39880,39880,39828,39802,39729,39729,39664,39664,
+39629,39615,39580,39580,39543,39543,39510,39497,
+39458,39458,39410,39410,39364,39346,39303,39303,
+39266,39266,39245,39239,39228,39228,39216,39216,
+39196,39186,39157,39157,39120,39120,39084,39068,
+39024,39024,38980,38980,38948,38935,38904,38904,
+38869,38869,38832,38813,38762,38762,38700,38700,
+38655,38633,38570,38570,38473,38473,38410,38385,
+38331,38331,38263,38263,38216,38197,38156,38156,
+38117,38117,38093,38085,38060,38060,37937,37937,
+37744,37663,37452,37452,37254,37254,37193,34504,
+34189,34125,33919,33740,33753,33750,33793,33945,
+33892,33714,33516,33564,33596,33608,33674,33666,
+33620,33521,33559,33619,33691,33724,33735,33833,
+33906,33959,34155,34240,34311,33945,33737,33402,
+33330,35569,35644,33960,33113,33090,33056,32986,
+32944,32792,32807,32864,32980,33306,33927,35480,
+34913,33715,33629,31720,31676,31647,31702,31654,
+31390,31488,31627,32088,32489,32838,33102,33434,
+33700,33999,34117,33661,33400,32949,32596,31926,
+31987,31993,31882,31813,31669,32176,32220,31972,
+32075,32109,32289,32543,32710,32899,32508,33062,
+33182,33214,33441,33648,34220,34647,34761,35274,
+36148,36635,37124,36893,36929,38287,40149,40683,
+37600,37377,41072,39855,39970,39970,40072,40072,
+40098,40103,40924,39370,36519,35104,35772,34665,
+36241,33494,35615,34689,33748,34181,34594,34964,
+35519,35840,36032,37242,36562,36785,39674,39723,
+39774,39863,39639,39572,35675,35441,35249,35228,
+35652,39992,39353,39353,39355,39358,39371,39371,
+39369,39369,39406,39426,39491,39491,39553,39553,
+39606,39632,39711,39711,39829,39829,39879,39886,
+39877,39877,39882,39882,39890,39887,39868,39868,
+39849,39849,40874,39701,39788,40215,39708,39744,
+39716,39602,39663,39703,40269,39913,39637,38803,
+38033,38153,37906,38661,39032,39089,39446,41175,
+39944,39673,39604,39585,39551,39551,39531,39531,
+39507,39500,39488,39488,39512,39512,39556,39578,
+39643,39643,39734,39734,39416,39679,41256,40507,
+40281,39019,38229,39102,38498,38373,39413,39081,
+39644,38969,38315,38377,38277,38015,37639,37554,
+37640,37460,39241,38709,38705,38687,38605,38605,
+38478,39143,38728,38357,38802,38186,38140,38140,
+38219,38251,38330,38330,38431,38431,38455,38455,
+38435,38435,38467,38467,38547,38591,38731,38731,
+38902,38902,38971,39033,39269,39269,39350,39350,
+39353,39353,39354,39354,39378,39378,39395,39400,
+39409,39409,39404,39404,39394,39397,39424,39424,
+39494,39494,39559,39584,39642,39642,39721,39721,
+39798,39824,39877,39877,39919,39919,39917,39908,
+39864,39864,39841,39841,39845,39850,39871,39871,
+39922,39922,39930,39927,39908,39908,39893,39893,
+39881,39874,39857,39857,39841,39841,39834,39832,
+39831,39831,39846,39846,39866,39872,39883,39883,
+39889,39889,39879,39872,39847,39847,39820,39820,
+39799,39793,39778,39778,39755,39755,39747,39745,
+39748,39748,39724,39724,39683,39670,39647,39647,
+39642,39642,39646,39648,39657,39657,39643,39643,
+39620,39610,39589,39589,39564,39564,39569,39576,
+39601,39601,39600,39600,39579,39575,39577,39577,
+39447,39447,39460,39468,39497,39497,39528,39528,
+39547,39549,39548,39548,39524,39524,39531,39540,
+39580,39580,39604,39604,39598,39593,39576,39576,
+39544,39544,39507,39491,39449,39449,39399,39399,
+39355,39345,39340,39340,39378,39378,39369,39358,
+39313,39313,39286,39286,39280,39271,39233,39233,
+33132,34084,39077,39045,38961,38961,38924,38924,
+38942,38944,38941,38941,38917,38917,38923,38928,
+38956,38956,38948,38948,38908,38888,38831,38831,
+38751,38751,38694,38673,38621,38621,38575,38575,
+38549,38540,38514,38514,38485,38485,38476,38476,
+38487,38487,38471,38471,38430,38414,38374,38374,
+38334,38334,38306,38297,38275,38275,38226,38226,
+38163,38145,38121,38121,38154,38154,38187,38200,
+38231,38231,38284,38284,38333,38341,38338,38338,
+38295,38295,38289,38294,38321,38321,38331,38331,
+38308,38328,38446,38446,38754,38754,38898,38934,
+38973,38973,39122,39122,39313,39375,39491,39491,
+39560,39560,39638,39665,39718,39718,36375,36028,
+35431,34506,34393,34049,32614,32760,33468,32057,
+30974,31286,31439,31339,31050,30708,33765,36631,
+38507,38507,38603,38655,38816,38816,39038,39038,
+39164,39179,36413,35915,35526,35713,35928,36495,
+37411,40442,40329,40329,40276,40262,40243,40243,
+40254,40254,40279,40291,40327,40327,40354,40354,
+40358,40358,40352,40352,40356,40356,40389,40382,
+40315,40315,40297,40297,40286,40282,40274,36961,
+36403,35935,35988,37515,37929,40092,40083,40083,
+40095,40095,40080,40080,40029,40029,39988,39973,
+39941,39941,39908,39908,39885,39876,39849,39849,
+39809,39809,39764,39744,39685,39685,39632,39632,
+39596,39583,39547,39547,39511,39511,39470,39451,
+39394,39394,39336,39336,39289,39271,39232,39232,
+39201,39201,39170,39156,39122,39122,39100,39100,
+39091,39086,39062,39062,39022,39022,39005,39001,
+38998,38998,38954,38954,38884,38859,38800,38800,
+38746,38746,38708,38692,38657,38657,38601,38601,
+38550,38527,38461,38461,38367,38367,38310,38291,
+38253,38253,38201,38201,38155,38137,38091,38091,
+38031,38031,37995,37981,37948,37948,37814,37814,
+37620,37535,37303,37303,37060,37060,36984,34159,
+34029,34160,34080,33710,33527,33611,33643,33690,
+33644,33452,33326,33256,33387,33458,33513,33544,
+33511,33477,33511,33515,33598,33682,33679,33673,
+33710,33751,33956,34111,34256,34128,33876,33805,
+33453,34404,34555,33184,32782,32706,32739,32749,
+32701,32460,32467,32518,32657,32746,32853,35005,
+34717,33007,31472,31619,31656,31601,31537,31572,
+31383,31331,31444,31984,32424,32800,32998,33212,
+33510,33781,34291,34435,33882,33344,32644,31882,
+31802,31822,31746,31532,31527,34099,32589,32067,
+32006,32105,32312,32474,32522,32644,32279,32890,
+33079,33205,33339,33531,36664,34468,34528,34906,
+35510,36101,36763,37095,36949,37338,38740,38584,
+38116,38771,39456,39878,39883,39883,39922,39922,
+40041,40059,39172,42100,36529,35399,36318,37675,
+36612,33548,36007,36126,34489,34308,34643,34878,
+35426,35727,35939,36285,36323,36392,36995,39716,
+39588,39643,39480,39455,35813,35637,35384,35228,
+35596,36624,40726,39290,39293,39301,39340,39340,
+39364,39364,39420,39445,39516,39516,39589,39589,
+39646,39669,39724,39724,39782,39782,39783,39771,
+39714,39714,39720,39720,39784,39795,39783,39783,
+39739,39739,40774,38685,39778,39610,40006,39998,
+39973,39801,39780,39629,39574,39041,38537,38155,
+38427,38727,37860,38195,38978,39096,39416,39902,
+40267,40466,39557,39536,39466,39466,39424,39424,
+39373,39362,39361,39361,39427,39427,39488,39513,
+39577,39577,39713,39700,39230,40110,41155,40451,
+39712,38682,37893,39052,38290,38113,39247,39292,
+39708,38628,38133,38108,37638,37166,36947,37066,
+37282,37323,39099,39345,38431,38402,38304,38304,
+38140,39629,39026,38922,38990,39547,38107,38107,
+38110,38116,38142,38142,38209,38209,38226,38228,
+38224,38224,38289,38289,38402,38453,38591,38591,
+38746,38746,38873,38924,39056,39056,39136,39136,
+39132,39132,39144,39144,39200,39200,39240,39255,
+39286,39286,39289,39289,39270,39266,39267,39267,
+39286,39286,39331,39352,39416,39416,39534,39534,
+39674,39715,39784,39784,39793,39793,39770,39754,
+39696,39696,39683,39683,39719,39736,39781,39781,
+39849,39849,39856,39850,39810,39810,39783,39783,
+39765,39757,39731,39731,39702,39702,39698,39700,
+39713,39713,39735,39735,39753,39759,39777,39777,
+39801,39801,39799,39795,39773,39773,39742,39742,
+39714,39707,39696,39696,39693,39693,39687,39684,
+39676,39676,39645,39645,39601,39591,39576,39576,
+39594,39594,39613,39621,39640,39640,39614,39614,
+39557,39539,39505,39505,39490,39490,39487,39487,
+39491,39491,39479,39479,39460,39454,39447,39447,
+39447,39447,39460,39468,39497,39497,39528,39528,
+39547,39549,39548,39548,39524,39524,39531,39540,
+39580,39580,39604,39604,39598,39593,39576,39576,
+39544,39544,39507,39491,39449,39449,39399,39399,
+39355,39345,39340,39340,39378,39378,39369,39358,
+39313,39313,39286,39286,39280,39271,39233,39233,
+32742,33693,39077,39045,38961,38961,38924,38924,
+38942,38944,38941,38941,38917,38917,38923,38928,
+38956,38956,38948,38948,38908,38888,38831,38831,
+38751,38751,38694,38673,38621,38621,38575,38575,
+38549,38540,38514,38514,38485,38485,38476,38476,
+38487,38487,38471,38471,38430,38414,38374,38374,
+38334,38334,38306,38297,38275,38275,38226,38226,
+38163,38145,38121,38121,38154,38154,38187,38200,
+38231,38231,38284,38284,38333,38341,38338,38338,
+38295,38295,38289,38294,38321,38321,38331,38331,
+38308,38328,38446,38446,38754,38754,38898,38934,
+38973,38973,39122,39122,39313,39375,39491,39491,
+39560,39560,39638,39665,39718,39718,35703,34947,
+34001,33328,33152,32603,30951,31260,32014,31572,
+31142,31002,30653,30140,30418,31680,34006,38391,
+38507,38507,38603,38655,38816,38816,39038,39038,
+39164,39179,39135,36223,35479,35659,35866,36091,
+37334,40442,40329,40329,40276,40262,40243,40243,
+40254,40254,40279,40291,40327,40327,40354,40354,
+40358,40358,40352,40352,40356,40356,40389,40382,
+40315,40315,40297,40297,40286,38438,37608,37406,
+37480,37310,37407,40116,40092,40092,40083,40083,
+40095,40095,40080,40080,40029,40029,39988,39973,
+39941,39941,39908,39908,39885,39876,39849,39849,
+39809,39809,39764,39744,39685,39685,39632,39632,
+39596,39583,39547,39547,39511,39511,39470,39451,
+39394,39394,39336,39336,39289,39271,39232,39232,
+39201,39201,39170,39156,39122,39122,39100,39100,
+39091,39086,39062,39062,39022,39022,39005,39001,
+38998,38998,38954,38954,38884,38859,38800,38800,
+38746,38746,38708,38692,38657,38657,38601,38601,
+38550,38527,38461,38461,38367,38367,38310,38291,
+38253,38253,38201,38201,38155,38137,38091,38091,
+38031,38031,37995,37981,37948,37948,37814,37814,
+37620,37535,37303,37303,37060,37060,36984,34043,
+33908,33925,34084,33885,33527,33457,33573,33499,
+33171,33148,33088,33119,33239,33294,33361,33398,
+33414,33441,33476,33462,33457,33511,33523,33530,
+33509,33548,33672,33747,33971,34092,34045,33867,
+33659,33692,33616,32956,32686,32737,32591,32566,
+32571,32433,32373,32337,32474,32523,32642,33065,
+33485,32036,31306,31870,31597,31510,31424,31311,
+31657,31062,31169,31865,32270,32696,32986,33181,
+33473,34186,34610,34005,32467,31717,33340,31766,
+31492,31511,31479,31373,31166,33488,31706,31646,
+31890,32006,32148,32400,32509,32503,32582,32764,
+32940,33028,33241,33252,35344,34132,34167,34652,
+35249,35668,36132,37135,36821,37551,37767,38588,
+38590,37348,39370,39878,39883,39883,39922,39922,
+40041,40243,42885,40992,36115,35873,35952,34469,
+35889,34599,36210,36186,36375,34431,34733,34966,
+35460,35695,35870,36288,36302,36392,36505,36438,
+39511,39301,39210,39188,38045,35692,35566,35199,
+35487,36075,36496,39290,39293,39301,39340,39340,
+39364,39364,39420,39445,39516,39516,39589,39589,
+39646,39669,39724,39724,39782,39782,39783,39771,
+39714,39714,39720,39720,39784,39795,39783,39783,
+39739,40376,40520,39261,39509,39202,39526,39666,
+39602,39857,39675,39476,39476,38857,38253,37710,
+37466,38293,37839,37911,38536,39245,38967,38452,
+39783,40568,40563,39536,39466,39466,39424,39424,
+39373,39362,39361,39361,39427,39427,39488,39513,
+39577,39577,39713,39795,39007,40330,41165,40439,
+39295,38049,37668,38741,38097,37926,38815,39504,
+40110,38408,38254,38165,37633,37199,36744,37321,
+37198,37266,38105,39234,38431,38402,38304,38304,
+38140,38140,39665,40486,40355,39707,38107,38107,
+38110,38116,38142,38142,38209,38209,38226,38228,
+38224,38224,38289,38289,38402,38453,38591,38591,
+38746,38746,38873,38924,39056,39056,39136,39136,
+39132,39132,39144,39144,39200,39200,39240,39255,
+39286,39286,39289,39289,39270,39266,39267,39267,
+39286,39286,39331,39352,39416,39416,39534,39534,
+39674,39715,39784,39784,39793,39793,39770,39754,
+39696,39696,39683,39683,39719,39736,39781,39781,
+39849,39849,39856,39850,39810,39810,39783,39783,
+39765,39757,39731,39731,39702,39702,39698,39700,
+39713,39713,39735,39735,39753,39759,39777,39777,
+39801,39801,39799,39795,39773,39773,39742,39742,
+39714,39707,39696,39696,39693,39693,39687,39684,
+39676,39676,39645,39645,39601,39591,39576,39576,
+39594,39594,39613,39621,39640,39640,39614,39614,
+39557,39539,39505,39505,39490,39490,39487,39487,
+39491,39491,39479,39479,39460,39454,39447,39447,
+39279,39279,39284,39292,39323,39323,39354,39354,
+39370,39372,39368,39368,39338,39338,39347,39357,
+39401,39401,39431,39431,39437,39435,39421,39421,
+39376,39376,39339,39324,39288,39288,39238,39238,
+39191,39182,39185,39185,39243,39243,39236,39222,
+39162,39162,39122,39122,39114,39107,39078,39078,
+39026,39026,38966,38940,38865,38865,38822,38822,
+38822,38819,38804,38804,38772,38772,38770,38774,
+38798,38798,38783,38783,38732,38712,38657,38657,
+38593,38593,38549,38533,38495,38495,38446,38446,
+38403,38385,38339,38339,38275,38275,38247,38240,
+38235,38235,38207,38207,38163,38144,38094,38094,
+38040,38040,38017,38011,38006,38006,37960,37960,
+37884,37861,37821,37821,37835,37835,37853,37860,
+37876,37876,37914,37914,37955,37960,37942,37942,
+37875,37875,37858,37859,37882,37882,37874,37874,
+37829,37847,37984,37984,38365,38365,38547,38591,
+38637,38637,38814,38814,39051,39132,39299,39299,
+39426,39426,39518,39545,39582,37242,34272,34056,
+33769,32726,33022,32882,32401,32320,31848,31004,
+31034,31046,31023,31630,33771,36370,38395,38395,
+38483,38483,38578,38616,38714,38714,38842,38842,
+38941,38966,38997,36123,35613,35610,35601,35745,
+35837,36835,40102,40102,40156,40172,40199,40199,
+40210,40210,40212,40215,40227,40227,40229,40229,
+40205,40196,40175,40175,40170,40170,37730,37206,
+37571,37615,37893,40137,40117,40110,40096,40096,
+40017,40017,40056,40060,40044,40044,40035,40035,
+40041,40036,40007,40007,39934,39934,39884,39868,
+39834,39834,39796,39796,39762,39749,39712,39712,
+39663,39663,39627,39614,39583,39583,39552,39552,
+39526,39513,39478,39478,39433,39433,39377,39350,
+39277,39277,39207,39207,39158,39140,39104,39104,
+39077,39077,39043,39028,38987,38987,38956,38956,
+38945,38939,38925,38925,38902,38902,38893,38891,
+38890,38890,38846,38846,38770,38741,38674,38674,
+38608,38608,38571,38558,38532,38532,38490,38490,
+38447,38427,38369,38369,38282,38282,38225,38206,
+38167,38167,38118,38118,38072,38053,38005,38005,
+37943,37943,37898,37880,37828,37828,37691,37691,
+37509,37424,37176,37176,36922,36922,36837,33843,
+33697,33534,33091,33240,33797,33672,33374,32602,
+32754,32872,32929,32921,32952,33047,33256,33327,
+33376,33435,33491,33475,33311,33293,33307,33289,
+33232,33226,33184,33276,33390,33624,33743,33702,
+33578,33567,33227,32796,34509,32761,31917,31864,
+31581,32207,32159,32104,32263,32280,32321,32127,
+31868,31686,31727,31640,31505,31370,31269,31377,
+31351,31286,31038,31035,31683,32066,33363,33350,
+33531,34114,33987,33400,30777,32784,32013,31303,
+31110,31553,31695,31858,31826,31132,31515,31571,
+31569,31714,31935,32195,32253,32177,32318,32378,
+32475,32618,32777,32885,33487,33640,33658,34195,
+34326,34846,35923,36452,36718,37316,37799,39048,
+38565,36907,39112,39607,39611,39611,39795,39816,
+39986,41845,37250,39114,35874,35514,34434,34359,
+33984,36505,35542,36729,34236,34437,34969,35195,
+35034,35204,35640,35896,36015,36057,35991,36062,
+36104,39329,39293,39499,39490,37256,35690,35378,
+35770,36132,36952,37412,39258,39257,39246,39246,
+39299,39299,39388,39424,39516,39516,39578,39578,
+39599,39606,39617,39617,39604,39604,39563,39542,
+39471,39471,39480,39480,39693,39735,39733,39733,
+39468,39468,40115,38625,38890,39814,38632,39104,
+39006,39043,39249,39332,39626,39710,39604,38436,
+37716,37465,38560,38174,37414,39357,39487,38754,
+37506,38048,39020,40861,41046,41326,39192,39192,
+39124,39113,39129,39129,39251,39251,39326,39369,
+39512,39512,39362,38459,38390,41197,40892,40423,
+38901,37720,37361,37749,38130,38537,37602,37988,
+38879,38148,37641,37350,37931,37854,36487,36972,
+37157,36807,37768,38306,38399,38185,38080,38080,
+37619,37619,37379,37445,39231,38020,38050,38050,
+37961,37928,37857,37857,37877,37877,37895,37903,
+37928,37928,38031,38031,38169,38225,38373,38373,
+38532,38532,38653,38697,38799,38799,38851,38851,
+38844,38847,38873,38873,38955,38955,39016,39040,
+39097,39097,39116,39116,39093,39087,39071,39071,
+39057,39057,39080,39094,39142,39142,39293,39293,
+39496,39554,39642,39642,39624,39624,39581,39555,
+39474,39474,39455,39455,39503,39523,39582,39582,
+39666,39666,39685,39684,39658,39658,39638,39638,
+39620,39606,39559,39559,39491,39491,39481,39485,
+39517,39517,39551,39551,39572,39581,39603,39603,
+39632,39632,39630,39625,39601,39601,39571,39571,
+39551,39547,39544,39544,39551,39551,39550,39549,
+39543,39543,39509,39509,39461,39448,39434,39434,
+39456,39456,39477,39486,39512,39512,39491,39491,
+39435,39419,39390,39390,39387,39387,39382,39378,
+39365,39365,39344,39344,39328,39321,39303,39303,
+39279,39279,39284,39292,39323,39323,39354,39354,
+39370,39372,39368,39368,39338,39338,39347,39357,
+39401,39401,39431,39431,39437,39435,39421,39421,
+39376,39376,39339,39324,39288,39288,39238,39238,
+39191,39182,39185,39185,39243,39243,39236,39222,
+39162,39162,39122,39122,39114,39107,39078,38006,
+39026,39026,38966,38940,38865,38865,38822,38822,
+38822,38819,38804,38804,38772,38772,38770,38774,
+38798,38798,38783,38783,38732,38712,38657,38657,
+38593,38593,38549,38533,38495,38495,38446,38446,
+38403,38385,38339,38339,38275,38275,38247,38240,
+38235,38235,38207,38207,38163,38144,38094,38094,
+38040,38040,38017,38011,38006,38006,37960,37960,
+37884,37861,37821,37821,37835,37835,37853,37860,
+37876,37876,37914,37914,37955,37960,37942,37942,
+37875,37875,37858,37859,37882,37882,37874,37874,
+37829,37847,37984,37984,38365,38365,38547,38591,
+38637,38637,38814,38814,39051,39132,39299,39299,
+39426,39426,39518,39545,39582,39582,34302,33760,
+34356,33362,33063,32632,31701,31588,31293,30800,
+30805,30864,31898,33181,34690,38350,38395,38395,
+38483,38483,38578,38616,38714,38714,38842,38842,
+38941,38966,38997,36486,35661,35655,35642,35795,
+35578,35604,40102,40102,40156,40172,40199,40199,
+40210,40210,40212,40215,40227,40227,40229,40229,
+40205,40196,40175,40175,37141,37329,37507,37591,
+37977,40143,40137,40137,40117,40110,40096,40096,
+40017,40017,40056,40060,40044,40044,40035,40035,
+40041,40036,40007,40007,39934,39934,39884,39868,
+39834,39834,39796,39796,39762,39749,39712,39712,
+39663,39663,39627,39614,39583,39583,39552,39552,
+39526,39513,39478,39478,39433,39433,39377,39350,
+39277,39277,39207,39207,39158,39140,39104,39104,
+39077,39077,39043,39028,38987,38987,38956,38956,
+38945,38939,38925,38925,38902,38902,38893,38891,
+38890,38890,38846,38846,38770,38741,38674,38674,
+38608,38608,38571,38558,38532,38532,38490,38490,
+38447,38427,38369,38369,38282,38282,38225,38206,
+38167,38167,38118,38118,38072,38053,38005,38005,
+37943,37943,37898,37880,37828,37828,37691,37691,
+37509,37424,37176,37176,36922,36922,36837,33619,
+33505,33331,33014,33030,33132,33671,33634,33017,
+32783,32692,32783,32954,32985,33072,33197,33200,
+33207,33247,33308,33350,33343,33268,33232,33149,
+33122,33127,33018,33063,33137,33205,33308,33468,
+33403,33300,33179,32768,32735,32456,32008,31921,
+31513,31972,31940,31945,32040,32036,32096,32299,
+32075,31790,31521,31485,31498,31371,31251,31259,
+31035,31201,30841,30743,31377,31762,33237,33553,
+33661,32840,31331,31327,31850,33660,32255,31134,
+30649,31461,31548,31716,31651,31282,31182,31396,
+31373,31703,31785,32056,32086,32003,32294,32249,
+32312,32394,32527,32704,33302,33476,33586,33578,
+33627,34404,35684,36147,36979,36563,36541,38740,
+37523,37211,37780,39607,39611,39611,39795,40724,
+39769,37253,37344,39106,35365,34466,34354,34275,
+33996,33863,34344,34587,34220,34546,34821,35134,
+35409,35534,35722,35738,35786,35885,35987,36067,
+36049,36882,39452,39456,39649,38963,36976,39212,
+37136,36448,37197,37707,38095,39257,39246,39246,
+39299,39299,39388,39424,39516,39516,39578,39578,
+39599,39606,39617,39617,39604,39604,39563,39542,
+39471,39471,39480,39480,39693,39168,39733,39733,
+39468,39468,39974,38550,38517,39553,39431,39279,
+39140,39187,39295,39389,39640,39736,39763,39129,
+38226,38644,39467,39075,38512,38174,38955,39081,
+37809,37855,38581,39799,40533,41217,39192,39192,
+39124,39113,39129,39129,39251,39251,39326,39369,
+39512,39150,38957,37919,37810,41051,40309,40607,
+38670,37455,37230,37459,38221,38742,37159,37429,
+37912,37474,37235,37062,37656,37655,36365,37214,
+36917,36600,37860,38530,38571,38185,38080,38080,
+37619,37619,37379,39575,38913,38020,38050,38050,
+37961,37928,37857,37857,37877,37877,37895,37903,
+37928,37928,38031,38031,38169,38225,38373,38373,
+38532,38532,38653,38697,38799,38799,38851,38851,
+38844,38847,38873,38873,38955,38955,39016,39040,
+39097,39097,39116,39116,39093,39087,39071,39071,
+39057,39057,39080,39094,39142,39142,39293,39293,
+39496,39554,39642,39642,39624,39624,39581,39555,
+39474,39474,39455,39455,39503,39523,39582,39582,
+39666,39666,39685,39684,39658,39658,39638,39638,
+39620,39606,39559,39559,39491,39491,39481,39485,
+39517,39517,39551,39551,39572,39581,39603,39603,
+39632,39632,39630,39625,39601,39601,39571,39571,
+39551,39547,39544,39544,39551,39551,39550,39549,
+39543,39543,39509,39509,39461,39448,39434,39434,
+39456,39456,39477,39486,39512,39512,39491,39491,
+39435,39419,39390,39390,39387,39387,39382,39378,
+39365,39365,39344,39344,39328,39321,39303,39303,
+39152,39152,39148,39154,39187,39187,39212,39212,
+39216,39214,39200,39200,39165,39165,39154,39154,
+39161,39161,39189,39189,39228,39233,39218,39218,
+39137,39137,39095,39084,39068,39068,39049,39049,
+39032,39030,39042,39042,39084,39084,39073,39058,
+38997,38997,38948,38948,38924,38916,38893,38893,
+38877,38877,38845,38828,38774,38774,38731,38731,
+38713,38703,38673,38673,38622,38622,38599,38594,
+38592,38592,38572,38572,38538,38522,38478,38478,
+38414,38414,38385,38380,38378,38378,38339,38339,
+38271,38246,38186,38186,38118,38118,38061,38038,
+37977,37977,37933,37933,37922,37907,37849,37849,
+37739,37739,37706,37703,37717,37717,37716,37716,
+37698,37686,37648,37648,37597,37597,37582,37579,
+37580,37580,37595,37595,37616,37611,37568,37568,
+37460,37460,37441,37450,37508,37508,37526,37526,
+37491,37508,37630,37630,37961,37961,38164,38229,
+38349,38349,38586,38586,38855,38953,39172,39172,
+39375,39375,39450,39464,39459,39459,34680,32927,
+33825,32286,32634,32316,31016,30881,30811,30976,
+31309,31607,33314,34309,35298,38341,38394,38394,
+38526,38526,38608,38631,38662,38662,38704,38704,
+38754,38767,38785,38785,36479,36472,36208,36143,
+36290,36477,39813,39813,39994,40042,40103,40103,
+40080,40080,40046,40036,40022,40022,40123,40123,
+39940,39898,39875,37780,37019,36947,37190,39806,
+39948,39948,39973,39973,39962,39958,39951,39951,
+39951,39951,39968,39975,39995,39995,39992,39992,
+39968,39954,39907,39907,39826,39826,39764,39742,
+39690,39690,39636,39636,39599,39583,39541,39541,
+39485,39485,39460,39454,39449,39449,39444,39444,
+39431,39423,39388,39388,39328,39328,39260,39231,
+39152,39152,39074,39074,39017,38998,38959,38959,
+38929,38929,38904,38895,38874,38874,38842,38842,
+38814,38806,38795,38795,38797,38797,38777,38765,
+38723,38723,38675,38675,38641,38626,38578,38578,
+38514,38514,38473,38459,38427,38427,38398,38398,
+38376,38364,38326,38326,38257,38257,38193,38168,
+38103,38103,38039,38039,37987,37967,37925,37925,
+37884,37884,37839,37815,37744,37744,37619,37619,
+37474,37399,37168,37168,36933,36933,33809,33367,
+33336,33157,32886,32925,32972,32824,32704,32727,
+32728,32595,32636,32827,32857,32910,32983,32960,
+32948,32992,33039,33151,33293,33222,33117,33041,
+33001,32984,32908,32934,33006,33068,33134,33189,
+33113,33003,32905,32829,32644,32393,31975,31842,
+31792,31803,31788,31860,31976,31721,31902,32073,
+31944,31646,30859,31322,31522,31324,31269,31147,
+30934,30953,30093,30815,31054,31262,32657,32832,
+33235,32158,31984,32424,30297,30642,32040,31216,
+30851,31197,31465,31631,31524,31170,31257,31147,
+31637,31748,31809,31967,31923,31906,32295,32294,
+32331,32367,32498,32575,32995,33026,33267,33578,
+33374,33339,35497,36239,35895,36792,36549,37992,
+37248,37098,39613,39303,39295,39295,39452,39216,
+41522,37271,34993,38039,34765,33379,33409,33240,
+33946,33782,34150,33854,34419,34384,34630,35358,
+35486,35477,35452,35488,35557,35732,35934,35963,
+35904,36177,39427,39447,39575,39560,39496,39471,
+36669,36998,37719,38049,38262,38527,39113,39113,
+39194,39194,39320,39368,39483,39483,39514,39514,
+39457,39434,39384,39384,39307,39307,39258,39245,
+39225,39225,39237,39237,39009,39007,39042,39049,
+39062,39374,39760,39482,39634,40013,39257,39035,
+39104,38660,38618,38832,39243,39542,39824,39417,
+38980,38558,39579,39758,39125,37906,38446,38924,
+37821,37755,38218,39301,40233,40974,38912,38912,
+38960,38974,38997,38997,39078,39078,39138,39174,
+39108,39376,37950,37098,37376,40741,40450,40740,
+38837,37874,37256,37433,38125,38507,36630,36903,
+37343,36555,36858,36764,37500,37488,37071,37190,
+36207,36086,38339,38489,38519,37197,36647,37752,
+37333,37333,37282,39369,38887,37768,38024,38024,
+37899,37823,37572,37572,37560,37560,37545,37537,
+37518,37518,37604,37604,37744,37813,38023,38023,
+38307,38307,38452,38494,38563,38563,38606,38606,
+38615,38624,38657,38657,38740,38740,38810,38839,
+38912,38912,38937,38937,38913,38906,38895,38895,
+38888,38888,38899,38904,38923,38923,39080,39080,
+39325,39394,39499,39499,39470,39470,39408,39375,
+39265,39265,39216,39216,39243,39258,39310,39310,
+39405,39405,39454,39468,39492,39492,39505,39505,
+39484,39466,39401,39401,39284,39284,39260,39266,
+39317,39317,39363,39363,39390,39399,39417,39417,
+39417,39417,39403,39394,39364,39364,39351,39351,
+39367,39373,39382,39382,39382,39382,39386,39389,
+39399,39399,39369,39369,39307,39289,39258,39258,
+39250,39250,39257,39264,39292,39292,39299,39299,
+39288,39286,39283,39283,39287,39287,39280,39274,
+39255,39255,39237,39237,39227,39220,39197,39197,
+39090,39090,39083,39088,39118,39118,39144,39144,
+39149,39148,39132,39132,39094,39094,39082,39080,
+39082,39082,39110,39110,39154,39160,39148,39148,
+39065,39065,39022,39010,38995,38995,38976,38976,
+38965,38964,38973,38973,39008,39008,38996,38982,
+38924,38924,38876,38876,38852,38843,38828,38828,
+38827,38827,38803,38789,38740,38740,38699,38699,
+38680,38671,38636,38636,38578,38578,38550,38544,
+38538,38538,38513,38513,38478,38463,38419,38419,
+38354,38354,38327,38321,38322,38322,38282,38282,
+38213,38186,38124,38124,38055,38055,37993,37967,
+37898,37898,37848,37848,37835,37819,37757,37757,
+37640,37640,37606,37602,37619,37619,37627,37627,
+37621,37612,37575,37575,37507,37507,37484,37479,
+37480,37480,37490,37490,37502,37495,37448,37448,
+37337,37337,37318,37327,37388,37388,37410,37410,
+37381,37398,37516,37516,37833,37833,38046,38118,
+38263,38263,38515,38515,38787,38885,39110,39110,
+39322,39322,39396,39416,39434,36335,34351,33449,
+32735,30843,30814,31226,30854,30648,30628,31962,
+32385,32952,34479,34980,35930,38322,38379,38379,
+38517,38517,38595,38615,38633,38633,38662,38662,
+38703,38715,38732,38732,38714,38714,38857,38940,
+39213,39213,39711,39711,39920,39974,40038,40038,
+39993,39993,39948,39936,39922,39922,39984,36762,
+36642,37172,37517,37642,39794,39794,39738,39753,
+39881,39881,39911,39911,39900,39897,39894,39894,
+39904,39904,39921,39928,39950,39950,39946,39946,
+39920,39904,39853,39853,39766,39766,39703,39680,
+39631,39631,39579,39579,39544,39528,39488,39488,
+39434,39434,39409,39403,39399,39399,39396,39396,
+39388,39381,39349,39349,39287,39287,39219,39191,
+39113,39113,39035,39035,38977,38957,38915,38915,
+38880,38880,38854,38845,38829,38829,38800,38800,
+38771,38762,38752,38752,38755,38755,38734,38720,
+38674,38674,38629,38629,38600,38587,38543,38543,
+38479,38479,38437,38424,38392,38392,38365,38365,
+38347,38338,38304,38304,38241,38241,38175,38149,
+38083,38083,38014,38014,37963,37944,37902,37902,
+37862,37862,37814,37790,37715,37715,37595,37595,
+37464,37392,37169,37169,36930,36930,34204,33153,
+33032,33053,32909,32970,32941,32765,32693,32583,
+32171,32080,32132,32532,32607,32637,32656,32609,
+32584,32640,32719,32804,32882,32916,32961,33080,
+33071,33060,32804,32758,32797,32990,32936,32987,
+32882,32826,32760,32617,32511,32407,32033,32043,
+32140,31842,31669,31582,31631,31716,31729,31513,
+31214,30491,31342,31437,31333,31125,30952,30667,
+30632,30450,30001,30731,30166,30309,30176,30625,
+30408,31221,31486,31766,31922,30117,29883,30741,
+30982,30921,31509,31379,31416,31353,31387,31492,
+31317,31700,30623,31574,30942,31675,32026,32265,
+32306,32452,32635,32705,32109,32417,32760,32940,
+33787,33886,35021,35302,36609,37268,36986,35718,
+36622,37225,39160,39191,39183,39183,42662,42170,
+40790,36214,35874,35067,34130,34098,34117,32718,
+33172,33473,34086,33794,33875,35933,35494,35460,
+35310,35573,35471,35714,35672,35789,35929,35992,
+35938,37068,39120,39404,39926,39837,39821,36793,
+37137,37291,36885,37155,37551,38088,38169,39088,
+39165,39165,39284,39329,39434,39434,39454,39454,
+39386,39361,39300,39300,39210,39210,39155,39142,
+39132,39132,39375,38747,38633,38607,38568,38682,
+39026,39537,39374,39000,38884,38810,38793,38788,
+38863,38769,38499,38139,38133,38365,38602,39054,
+38227,38106,39441,39957,39787,38169,37314,36581,
+36708,36881,37121,37674,37829,38566,40729,40710,
+40600,39506,39576,39563,39049,39049,39103,39129,
+39203,39309,37124,37159,38354,40362,40524,40991,
+38563,37824,37822,37126,37140,37580,36816,36507,
+36538,36967,36959,36679,37075,37454,37032,35718,
+35041,35815,36712,36102,35990,36926,36732,36468,
+37302,37971,38621,38983,38990,39132,37799,37637,
+37504,37755,37511,37511,37495,37495,37466,37433,
+37299,37299,37362,37362,37486,37553,37766,37766,
+38256,38256,38356,38391,38467,38467,38535,38535,
+38550,38560,38593,38593,38670,38670,38735,38762,
+38834,38834,38861,38861,38843,38839,38832,38832,
+38822,38822,38825,38827,38832,38832,38986,38986,
+39239,39310,39417,39417,39383,39383,39316,39280,
+39167,39167,39117,39117,39148,39165,39216,39216,
+39306,39306,39360,39378,39414,39414,39433,39433,
+39415,39398,39335,39335,39217,39217,39192,39197,
+39247,39247,39291,39291,39318,39327,39341,39341,
+39337,39337,39322,39314,39289,39289,39280,39280,
+39299,39304,39315,39315,39311,39311,39314,39317,
+39329,39329,39302,39302,39247,39229,39200,39200,
+39186,39186,39186,39190,39209,39209,39216,39216,
+39215,39215,39218,39218,39225,39225,39220,39215,
+39195,39195,39178,39178,39172,39166,39140,39140,
+38944,38944,38930,38932,38957,38957,38985,38985,
+38998,38997,38982,38982,38937,38937,38919,38914,
+38909,38909,38936,38936,38989,38999,38993,38993,
+38913,38913,38869,38855,38834,38834,38816,38816,
+38809,38810,38817,38817,38834,38834,38819,38805,
+38757,38757,38712,38712,38688,38683,38683,38683,
+38716,38716,38713,38704,38663,38663,38629,38629,
+38614,38603,38563,38563,38486,38486,38449,38438,
+38424,38424,38391,38391,38350,38334,38288,38288,
+38225,38225,38196,38190,38191,38191,38150,38150,
+38077,38049,37983,37983,37911,37911,37841,37810,
+37728,37728,37666,37666,37642,37624,37552,37552,
+37425,37425,37389,37385,37404,37404,37428,37428,
+37448,37444,37405,37405,37302,37302,37265,37258,
+37260,37260,37260,37260,37254,37241,37186,37186,
+37076,37076,37055,37064,37130,37130,37158,37158,
+37139,37159,37270,37270,37557,37557,37793,37880,
+38082,38082,38364,38364,38636,38737,38967,38967,
+39191,39191,39266,39299,39391,36029,33531,32727,
+31218,30629,30986,30188,30594,30456,30919,32243,
+32322,32737,34436,35115,38266,38275,38336,38336,
+38484,38484,38555,38569,38567,38567,38573,38573,
+38599,38608,38627,38627,38682,38682,38815,38887,
+39118,39118,39484,39484,39750,39816,39882,39882,
+35554,39781,39714,39698,35939,35901,36306,36069,
+35974,37126,37586,39577,39597,39597,39638,39661,
+39732,39732,39771,39771,39760,39759,39765,39765,
+39789,39789,39809,39817,39837,39837,39832,39832,
+39803,39786,39728,39728,39625,39625,39559,39538,
+39496,39496,39451,39451,39422,39409,39374,39374,
+39327,39327,39301,39295,39287,39287,39287,39287,
+39288,39283,39257,39257,39194,39194,39129,39101,
+39029,39029,38951,38951,38892,38871,38822,38822,
+38771,38771,38743,38735,38724,38724,38705,38705,
+38677,38670,38657,38657,38660,38660,38636,38622,
+38571,38571,38530,38530,38512,38501,38464,38464,
+38401,38401,38360,38345,38314,38314,38293,38293,
+38284,38277,38256,38256,38200,38200,38135,38108,
+38037,38037,37964,37964,37912,37893,37853,37853,
+37811,37811,37758,37732,37652,37652,37546,37546,
+37439,37377,37174,37174,36923,36923,36803,33359,
+33429,32739,32687,32764,32828,32768,32687,32410,
+32187,32211,32253,32394,32472,32527,32549,32492,
+32502,32602,32647,32702,32760,32864,32883,32948,
+32858,32950,32903,32731,32708,32781,32756,32807,
+32854,32815,32779,32567,32550,32493,32231,32299,
+32353,32256,32043,31859,31787,31807,31643,31073,
+30685,30719,31092,31045,30821,30473,30457,30212,
+29697,30282,29710,29889,30612,30737,29520,29690,
+29345,30206,30295,30979,31763,31200,29386,30667,
+31120,30628,31449,31366,31171,31152,31111,31453,
+31045,31346,31201,31251,31374,31680,31984,32199,
+32426,32423,32541,32848,32787,32782,32956,34071,
+34038,34114,35138,35210,36238,36982,37026,35891,
+38322,38751,38912,38942,38936,38936,40965,41330,
+37547,35996,34867,34350,34036,33927,33736,32779,
+33311,33921,34507,34664,33665,37707,35279,35208,
+35953,34824,35257,35749,35497,35909,36139,36140,
+36081,36067,36320,39383,39745,39775,39760,36830,
+37254,37313,36879,37032,37310,37880,38152,37720,
+39106,39106,39200,39234,39307,39307,39304,39304,
+39224,39193,39116,39116,38997,38997,38929,38918,
+38924,38924,40466,39633,38655,38448,38508,38675,
+40360,38908,38857,39045,38973,38921,38770,38507,
+38958,39174,39037,38699,37693,37794,38028,38621,
+38338,37729,38683,39158,39724,37966,36736,36101,
+36226,36764,36852,37624,37843,38700,40250,40797,
+40657,40466,39930,39607,40098,40655,39040,39829,
+39366,39107,36873,37145,38274,39639,40290,40769,
+38062,37438,37496,37249,36903,36855,36620,36410,
+36324,36811,36750,36594,37008,37024,36775,35446,
+35416,35669,35636,35280,35574,36991,37271,37158,
+37104,37613,38006,37882,38121,38136,37056,37697,
+37524,37564,37397,37397,37373,37373,37315,37216,
+36783,36783,36785,36785,36867,36925,37135,37135,
+38156,37340,38133,38150,38252,38252,38383,38383,
+38417,38429,38459,38459,38515,38515,38569,38592,
+38656,38656,38687,38687,38689,38690,38691,38691,
+38674,38674,38657,38649,38624,38624,38768,38768,
+39037,39112,39220,39220,39175,39175,39099,39059,
+38935,38935,38891,38891,38937,38958,39010,39010,
+39086,39086,39148,39172,39231,39231,39264,39264,
+39252,39238,39181,39181,39073,39073,39047,39049,
+39090,39090,39130,39130,39155,39162,39170,39170,
+39156,39156,39143,39138,39126,39126,39127,39127,
+39148,39153,39160,39160,39148,39148,39149,39151,
+39164,39164,39148,39148,39109,39096,39072,39072,
+39049,39049,39033,39028,39022,39022,39026,39026,
+39041,39048,39063,39063,39079,39079,39077,39072,
+39051,39051,39040,39040,39039,39033,39006,39006,
+38944,38944,38930,38932,38957,38957,38985,38985,
+38998,38997,38982,38982,38937,38937,38919,38914,
+38909,38909,38936,38936,38989,38999,38993,38993,
+38913,38913,38869,38855,38834,38834,38816,38816,
+38809,38810,38817,38817,38834,38834,38819,38805,
+38757,38757,38712,38712,38688,38683,38683,38683,
+38716,38716,38713,38704,38663,38663,38629,38629,
+38614,38603,38563,38563,38486,38486,38449,38438,
+38424,38424,38391,38391,38350,38334,38288,38288,
+38225,38225,38196,38190,38191,38191,38150,38150,
+38077,38049,37983,37983,37911,37911,37841,37810,
+37728,37728,37666,37666,37642,37624,37552,37552,
+37425,37425,37389,37385,37404,37404,37428,37428,
+37448,37444,37405,37405,37302,37302,37265,37258,
+37260,37260,37260,37260,37254,37241,37186,37186,
+37076,37076,37055,37064,37130,37130,37158,37158,
+37139,37159,37270,37270,37557,37557,37793,37880,
+38082,38082,38364,38364,38636,38737,38967,38967,
+39191,39191,39266,39299,36101,35263,32247,31517,
+30451,30991,30183,30138,30688,30759,31094,32050,
+32215,32572,34078,34489,35668,38275,38336,38336,
+38484,38484,38555,38569,38567,38567,38573,38573,
+38599,38608,38627,38627,38682,38682,38815,38887,
+39118,39118,39484,39484,39750,39816,39882,39882,
+35366,35381,35863,39698,35132,34940,36132,36781,
+37102,39577,39577,39577,39597,39597,39638,39661,
+39732,39732,39771,39771,39760,39759,39765,39765,
+39789,39789,39809,39817,39837,39837,39832,39832,
+39803,39786,39728,39728,39625,39625,39559,39538,
+39496,39496,39451,39451,39422,39409,39374,39374,
+39327,39327,39301,39295,39287,39287,39287,39287,
+39288,39283,39257,39257,39194,39194,39129,39101,
+39029,39029,38951,38951,38892,38871,38822,38822,
+38771,38771,38743,38735,38724,38724,38705,38705,
+38677,38670,38657,38657,38660,38660,38636,38622,
+38571,38571,38530,38530,38512,38501,38464,38464,
+38401,38401,38360,38345,38314,38314,38293,38293,
+38284,38277,38256,38256,38200,38200,38135,38108,
+38037,38037,37964,37964,37912,37893,37853,37853,
+37811,37811,37758,37732,37652,37652,37546,37546,
+37439,37377,37174,37174,36923,36923,36803,33172,
+33324,32741,32580,32604,32661,32610,32632,32345,
+31975,32203,32330,32315,32399,32482,32534,32452,
+32396,32383,32481,32545,32716,32735,32733,32733,
+32709,32776,32815,32733,32682,32614,32633,32679,
+32791,32825,32829,32662,32549,32466,32752,32867,
+32501,32707,32367,31971,32340,32277,31612,30859,
+30645,30911,30906,30786,30600,30246,30035,29926,
+29809,29909,29975,29966,30084,30648,29552,29546,
+29943,30274,30417,30920,31353,31014,30946,30996,
+31180,30703,31483,31424,31400,31363,31333,31398,
+31062,30528,30695,31124,31288,31637,32209,32344,
+32428,32456,32528,32616,32959,32921,32942,34004,
+34220,34314,35327,35844,36157,35811,35714,37475,
+38751,38751,38912,38942,38936,38936,38997,40670,
+37854,35470,34641,34149,34059,33593,33325,33294,
+33679,33914,34700,34504,34629,35742,35040,35242,
+37486,34927,35144,35790,35785,35992,36166,36105,
+36296,36253,36695,39251,39266,39418,37076,36910,
+37375,37283,36522,36452,36958,38268,37869,39042,
+39106,39106,39200,39234,39307,39307,39304,39304,
+39224,39193,39116,39116,38997,38997,38929,38918,
+38924,38924,39085,39085,39098,38544,38315,38313,
+38715,38677,38680,38880,38733,38576,38352,38369,
+38364,38798,38850,38810,38485,38245,38214,38534,
+38477,38170,37392,38174,38830,38082,36640,35720,
+35650,35672,36000,36922,37114,37591,39073,39641,
+39916,40846,40784,40651,41056,41358,39040,39549,
+39433,38974,36649,36943,38226,39294,40252,40668,
+37791,37105,37260,37475,37046,36723,36282,35877,
+36184,36617,36194,36099,36407,36140,36019,35160,
+34797,34742,34712,34686,34881,35694,36530,36916,
+37146,37166,37521,37691,37754,37613,37238,37385,
+37458,37630,37841,37397,37063,37373,37315,37216,
+36783,36783,36785,36785,36867,36925,37135,37135,
+37049,36674,38133,38150,38252,38252,38383,38383,
+38417,38429,38459,38459,38515,38515,38569,38592,
+38656,38656,38687,38687,38689,38690,38691,38691,
+38674,38674,38657,38649,38624,38624,38768,38768,
+39037,39112,39220,39220,39175,39175,39099,39059,
+38935,38935,38891,38891,38937,38958,39010,39010,
+39086,39086,39148,39172,39231,39231,39264,39264,
+39252,39238,39181,39181,39073,39073,39047,39049,
+39090,39090,39130,39130,39155,39162,39170,39170,
+39156,39156,39143,39138,39126,39126,39127,39127,
+39148,39153,39160,39160,39148,39148,39149,39151,
+39164,39164,39148,39148,39109,39096,39072,39072,
+39049,39049,39033,39028,39022,39022,39026,39026,
+39041,39048,39063,39063,39079,39079,39077,39072,
+39051,39051,39040,39040,39039,39033,39006,39006,
+38690,38690,38664,38661,38668,38668,38705,38705,
+38750,38757,38756,38756,38704,38704,38689,38688,
+38697,38697,38722,38722,38757,38764,38770,38770,
+38738,38738,38693,38674,38618,38618,38572,38572,
+38558,38554,38549,38549,38546,38546,38531,38523,
+38496,38496,38469,38469,38457,38460,38489,38489,
+38569,38569,38583,38578,38534,38534,38519,38519,
+38539,38535,38496,38496,38383,38383,38336,38325,
+38320,38320,38273,38273,38204,38177,38121,38121,
+38063,38063,38016,37999,37957,37957,37899,37899,
+37840,37814,37749,37749,37671,37671,37611,37588,
+37530,37530,37452,37452,37377,37344,37258,37258,
+37160,37160,37126,37120,37123,37123,37143,37143,
+37173,37170,37126,37126,36995,36995,36956,36953,
+36977,36977,36972,36972,36933,36917,36869,36869,
+36806,36806,36789,36794,36831,36831,36852,36852,
+36852,36874,36980,36980,37230,37230,37496,37604,
+37880,37880,38163,38163,35566,38480,38681,38681,
+38856,38856,39091,35133,33767,32240,30339,30097,
+29795,30842,30521,30648,30723,30173,30570,31325,
+30636,31248,32698,33090,35001,38118,38181,38181,
+38335,38335,38409,38424,38424,38424,38430,38430,
+38457,38468,38499,38499,38578,38578,38680,38725,
+38849,38849,39151,39151,39456,39524,39562,39562,
+39350,39350,39263,39251,39273,39273,39146,39146,
+39291,39322,39337,39337,39351,39351,39400,39426,
+39509,39509,39549,39549,39529,39528,39542,39542,
+39596,39596,39607,39604,39579,39579,39562,39562,
+39559,39547,39484,39484,39341,39341,39281,39268,
+39266,39266,39258,39258,39250,39246,39235,39235,
+39215,39215,39182,39168,39126,39126,39108,39108,
+39119,39118,39102,39102,39043,39043,38992,38971,
+38917,38917,38853,38853,38801,38779,38717,38717,
+38629,38629,38582,38569,38549,38549,38540,38540,
+38541,38539,38527,38527,38502,38502,38484,38476,
+38456,38456,38422,38422,38386,38372,38333,38333,
+38281,38281,38245,38232,38209,38209,38190,38190,
+38178,38171,38147,38147,38089,38089,38033,38011,
+37962,37962,37902,37902,37854,37835,37787,37787,
+37716,37716,37654,37627,37552,37552,37466,37466,
+37386,37339,37177,37177,36934,36934,36820,36791,
+33157,32841,32631,32591,32591,32344,32257,32250,
+31929,32105,31981,31964,32086,32153,32215,32239,
+32293,32201,32149,32091,32233,32308,32372,32370,
+32378,32407,32493,32416,32357,32349,32429,32572,
+32856,32821,32786,32655,32842,32732,32774,32999,
+32987,32826,32501,31252,31376,31604,31416,30139,
+31304,31490,30657,30369,30341,29395,29666,29606,
+29385,29580,29780,30360,30652,30566,30170,30189,
+30230,30365,30712,30863,31434,31728,31363,30722,
+31344,31272,30998,31119,31459,31406,30978,31386,
+31475,31257,31099,30466,30891,31394,31882,31949,
+32143,32329,32349,32485,32751,32711,32807,32968,
+33329,34172,34121,34638,35384,36179,36841,38337,
+38540,38540,38561,38601,38779,38779,36869,37572,
+38676,34122,33942,33683,33177,33131,33298,33257,
+33921,33840,34291,35924,34453,37252,35298,35226,
+37541,34564,35624,35811,35922,36146,36686,36780,
+36932,36856,36603,36519,36481,36601,36904,36650,
+36974,38644,35223,37183,37273,39051,39072,39072,
+39068,39068,39060,39052,39019,39019,38986,38986,
+38955,38938,38883,38883,38774,38774,38710,38711,
+38779,40053,38712,39357,39587,39159,37156,40695,
+38293,38401,38391,38618,38627,38400,37755,37915,
+38207,38199,38054,38117,37990,37897,38152,38235,
+37987,37909,38012,38150,37928,38730,38321,36933,
+35606,34970,34758,35243,35449,35961,36979,37442,
+37857,38738,39517,40071,40174,40289,40185,38826,
+38559,38283,36742,37059,38226,38799,38727,38762,
+38670,38061,37281,36178,36226,36331,35504,34966,
+35421,35978,35487,35579,35788,35550,35731,35007,
+34910,34921,33652,33663,34047,35187,35711,35860,
+35996,36140,36453,36856,37087,37048,37117,36853,
+37010,37561,37464,37026,36551,36437,35854,35905,
+36393,36541,36307,36307,35881,35808,35877,35877,
+36629,35206,33770,37493,37862,37862,38200,38200,
+38273,38293,38316,38316,38329,38329,38351,38362,
+38394,38394,38435,38435,38489,38502,38514,38514,
+38463,38463,38405,38378,38300,38300,38411,38411,
+38672,38743,38841,38841,38778,38778,38697,38658,
+38540,38540,38537,38537,38646,38680,38743,38743,
+38766,38766,38815,38838,38905,38905,38942,38942,
+38936,38931,38913,38913,38877,38877,38862,38859,
+38862,38862,38876,38876,38896,38902,38908,38908,
+38892,38892,38897,38902,38924,38924,38928,38928,
+38914,38908,38891,38891,38871,38871,38862,38860,
+38859,38859,38875,38875,38899,38906,38915,38915,
+38900,38900,38854,38830,38756,38756,38716,38716,
+38726,38732,38755,38755,38791,38791,38799,38798,
+38782,38782,38779,38779,38789,38786,38759,38759,
+38690,38690,38664,38661,38668,38668,38705,38705,
+38750,38757,38756,38756,38704,38704,38689,38688,
+38697,38697,38722,38722,38757,38764,38770,38770,
+38738,38738,38693,38674,38618,38618,38572,38572,
+38558,38554,38549,38549,38546,38546,38531,38523,
+38496,38496,38469,38469,38457,38460,38489,38489,
+38569,38569,38583,38578,38534,38534,38519,38519,
+38539,38535,38496,38496,38383,38383,38336,38325,
+38320,38320,38273,38273,38204,38177,38121,38121,
+38063,38063,38016,37999,37957,37957,37899,37899,
+37840,37814,37749,37749,37671,37671,37611,37588,
+37530,37530,37452,37452,37377,37344,37258,37258,
+37160,37160,37126,37120,37123,37123,37143,37143,
+37173,37170,37126,37126,36995,36995,36956,36953,
+36977,36977,36972,36972,36933,36917,36869,36869,
+36806,36806,36789,36794,36831,36831,36852,36852,
+36852,36874,36980,36980,37230,37230,37496,37604,
+37880,37880,36604,35779,35592,38480,38681,38681,
+38856,38856,39091,34349,32619,31044,30138,30679,
+30478,30433,30860,31103,30342,30347,30742,30300,
+29612,31360,32933,33203,35424,38118,38181,38181,
+38335,38335,38409,38424,38424,38424,38430,38430,
+38457,38468,38499,38499,38578,38578,38680,38725,
+38849,38849,39151,39151,39456,39524,39562,39562,
+39350,39350,39263,39251,39273,39273,39146,39146,
+39291,39322,39337,39337,39351,39351,39400,39426,
+39509,39509,39549,39549,39529,39528,39542,39542,
+39596,39596,39607,39604,39579,39579,39562,39562,
+39559,39547,39484,39484,39341,39341,39281,39268,
+39266,39266,39258,39258,39250,39246,39235,39235,
+39215,39215,39182,39168,39126,39126,39108,39108,
+39119,39118,39102,39102,39043,39043,38992,38971,
+38917,38917,38853,38853,38801,38779,38717,38717,
+38629,38629,38582,38569,38549,38549,38540,38540,
+38541,38539,38527,38527,38502,38502,38484,38476,
+38456,38456,38422,38422,38386,38372,38333,38333,
+38281,38281,38245,38232,38209,38209,38190,38190,
+38178,38171,38147,38147,38089,38089,38033,38011,
+37962,37962,37902,37902,37854,37835,37787,37787,
+37716,37716,37654,37627,37552,37552,37466,37466,
+37386,37339,37177,37177,36934,36934,36820,36791,
+33617,32925,32510,32540,32453,32510,32272,32458,
+31964,32013,31868,31822,31956,31924,32030,32008,
+31977,32193,32166,32155,32150,32105,32129,32173,
+32209,32207,32355,32370,32332,32305,32303,32418,
+32786,32866,32785,32767,33068,32795,33222,33217,
+33233,32688,32248,32042,31655,31674,30418,31530,
+30393,30674,30418,30250,30035,29842,29355,30015,
+29341,29518,29810,30142,30424,30672,30652,30613,
+30376,30449,30751,30792,31244,31594,31740,30570,
+31214,31196,30988,31033,31297,31486,31319,31423,
+31704,31141,30894,30987,30909,31285,31820,31924,
+32085,32214,32157,32282,32713,32719,32678,32570,
+33012,33926,34393,34913,35446,35192,36796,38337,
+38540,38540,38561,38601,38779,37609,37391,35568,
+36809,34233,33915,33571,33135,33122,32904,33290,
+33595,32961,34157,34674,35417,36440,37607,34880,
+37662,34782,35871,35653,35819,36112,36823,37233,
+37312,37423,37320,37076,36576,36716,37357,36256,
+36317,36060,40076,38849,39014,39051,39072,39072,
+39068,39068,39060,39052,39019,39019,38986,38986,
+38955,38938,38883,38883,38774,38774,38710,38711,
+40599,40458,39539,39708,37462,39775,39762,39040,
+38167,38205,38147,38410,38435,38204,37808,38042,
+38257,38112,38065,38081,37693,37710,38014,38249,
+38036,37944,38221,38144,37664,38607,38632,37894,
+37123,36247,35433,35192,35402,35634,36335,36679,
+37022,37871,38477,39100,40432,40536,40162,38730,
+38354,38135,36559,36513,37786,38817,38469,38469,
+39232,39100,37997,36005,35817,35819,35010,34682,
+35009,35116,35233,35452,35429,35535,35953,35736,
+35639,35829,35038,35170,35498,35857,35724,35211,
+34851,35084,35505,35812,36046,36380,36331,36450,
+36544,37258,36924,36492,35753,36029,35894,35687,
+35725,35655,35564,36307,35881,35808,35877,35877,
+36828,35527,33675,37493,37862,37862,38200,38200,
+38273,38293,38316,38316,38329,38329,38351,38362,
+38394,38394,38435,38435,38489,38502,38514,38514,
+38463,38463,38405,38378,38300,38300,38411,38411,
+38672,38743,38841,38841,38778,38778,38697,38658,
+38540,38540,38537,38537,38646,38680,38743,38743,
+38766,38766,38815,38838,38905,38905,38942,38942,
+38936,38931,38913,38913,38877,38877,38862,38859,
+38862,38862,38876,38876,38896,38902,38908,38908,
+38892,38892,38897,38902,38924,38924,38928,38928,
+38914,38908,38891,38891,38871,38871,38862,38860,
+38859,38859,38875,38875,38899,38906,38915,38915,
+38900,38900,38854,38830,38756,38756,38716,38716,
+38726,38732,38755,38755,38791,38791,38799,38798,
+38782,38782,38779,38779,38789,38786,38759,38759,
+38373,38373,38343,38342,38367,38367,38421,38421,
+38478,38490,38491,38491,38428,38428,38408,38405,
+38413,38413,38438,38438,38474,38485,38500,38500,
+38487,38487,38442,38418,38343,38343,38285,38285,
+38262,38259,38269,38269,38312,38312,38327,38328,
+38319,38319,38298,38298,38280,38282,38309,38309,
+38385,38385,38408,38409,38387,38387,38388,38388,
+38414,38411,38371,38371,38252,38252,38190,38173,
+38147,38147,38090,38090,38023,37998,37942,37942,
+37889,37889,37837,37814,37754,37754,37681,37681,
+37618,37592,37530,37530,37465,37465,37417,37397,
+37349,37349,37258,37258,37157,37119,37029,37029,
+36949,36949,36917,36909,36904,36904,36902,36902,
+36905,36896,36849,36849,36742,36742,36716,36717,
+36754,36754,36752,36752,36705,36687,36649,36649,
+36616,36616,36593,36591,36595,36595,36613,36613,
+36645,36676,36800,36800,37038,37038,37279,37404,
+37789,37789,35927,35899,38148,38216,38389,38389,
+38683,36196,35259,33530,31815,30782,30653,31067,
+30823,30612,30964,31308,30620,30489,30952,30112,
+29757,31076,32841,33157,35547,37897,37965,37965,
+38129,38129,38226,38254,38291,38291,38322,38322,
+38357,38368,38386,38386,38416,38416,38478,38505,
+38575,38575,38835,38835,39139,39204,39222,39222,
+38990,38990,38904,38895,38935,38935,39031,39031,
+39116,39136,39152,39152,39140,39140,39161,39175,
+39226,39226,39260,39260,39261,39266,39289,39289,
+39347,39347,39355,39349,39314,39314,39301,39301,
+39317,39308,39251,39251,39097,39097,39036,39024,
+39027,39027,39037,39037,39049,39053,39059,39059,
+39051,39051,39020,39004,38951,38951,38922,38922,
+38926,38924,38903,38903,38843,38843,38805,38793,
+38763,38763,38713,38713,38659,38636,38576,38576,
+38496,38496,38447,38430,38400,38400,38380,38380,
+38374,38369,38354,38354,38331,38331,38319,38315,
+38303,38303,38272,38272,38234,38220,38185,38185,
+38141,38141,38109,38098,38079,38079,38055,38055,
+38034,38024,37999,37999,37954,37954,37911,37894,
+37852,37852,37801,37801,37762,37745,37696,37696,
+37617,37617,37557,37533,37472,37472,37397,37397,
+37327,37287,37159,37159,36956,36956,36811,36759,
+36645,33451,32539,32590,32544,32512,32237,32390,
+31974,32059,31928,31841,31940,31882,31973,31863,
+31826,31927,32065,32098,32185,31963,31941,32044,
+32005,32026,32155,32102,32158,32173,32230,32276,
+32595,32737,32687,32526,32542,32741,32540,33072,
+32787,32194,31841,31563,31976,31723,30784,31052,
+30816,30972,30144,29508,29490,29715,30155,29292,
+29389,29539,29726,30018,30221,30513,30865,30262,
+30256,31003,31069,31206,31322,31429,31389,30924,
+31057,31105,30879,31210,31339,31294,32496,31700,
+31858,31861,31740,31174,30906,30975,31724,31866,
+32078,32117,31867,31855,32500,32864,32650,32273,
+32207,33611,34479,35023,35308,34101,36991,38257,
+38252,38252,38359,38405,37464,37194,35323,35679,
+35310,34673,33927,33608,32948,32945,33161,33474,
+33367,33170,34535,36789,36715,37324,37437,37707,
+37535,35976,36328,35646,35933,36235,37240,37685,
+37716,37766,37984,37984,37366,36966,37946,37726,
+34097,34732,38686,38686,38929,38985,39022,39022,
+38971,38971,38989,38966,38830,38830,38791,38791,
+38776,38763,38714,38714,38626,38626,38619,39722,
+40059,37364,38727,40600,38438,39718,40160,38256,
+38086,38156,37997,37862,38023,37904,37705,37908,
+38001,37891,37946,38049,37985,38058,38066,37946,
+37855,37772,38046,38031,38143,38759,38799,38692,
+38241,37609,36342,35509,35450,35541,36074,36486,
+36834,37321,37799,38223,40090,40374,40078,38827,
+38657,38632,37323,36757,37725,38865,38607,38260,
+38620,38880,38295,35972,35603,35503,34886,34661,
+35020,34614,35088,35675,34689,34866,35364,35706,
+36480,36841,36302,36359,36075,34742,34383,34209,
+34324,34469,34979,35205,35118,35741,36045,35812,
+35857,36502,36549,36210,35238,35577,35851,35744,
+35562,35682,35467,35535,35391,35280,35189,35189,
+35426,35859,33570,36713,37333,37333,37794,37794,
+37938,37981,38051,38051,38108,38108,38138,38146,
+38155,38155,38192,38192,38267,38284,38293,38293,
+38216,38216,38140,38106,38009,38009,38072,38072,
+38274,38330,38409,38409,38377,38377,38325,38298,
+38212,38212,38233,38233,38352,38390,38466,38466,
+38504,38504,38542,38556,38589,38589,38604,38604,
+38604,38606,38618,38618,38640,38640,38640,38635,
+38616,38616,38615,38615,38638,38645,38656,38656,
+38647,38647,38657,38665,38693,38693,38702,38702,
+38684,38676,38653,38653,38619,38619,38614,38617,
+38634,38634,38659,38659,38683,38689,38695,38695,
+38676,38676,38620,38590,38493,38493,38430,38430,
+38424,38425,38440,38440,38482,38482,38489,38487,
+38469,38469,38474,38474,38498,38497,38467,38467,
+38234,38234,38206,38208,38247,38247,38309,38309,
+38367,38378,38376,38376,38306,38306,38280,38276,
+38279,38279,38306,38306,38351,38364,38384,38384,
+38376,38376,38331,38307,38231,38231,38168,38168,
+38140,38139,38161,38161,38237,38237,38267,38273,
+38272,38272,38249,38249,38225,38224,38243,38243,
+38304,38304,38328,38331,38323,38323,38330,38330,
+38350,38346,38307,38307,38193,38193,38126,38104,
+38064,38064,38004,38004,37945,37924,37872,37872,
+37819,37819,37767,37745,37683,37683,37607,37607,
+37541,37515,37455,37455,37399,37399,37356,37338,
+37287,37287,37192,37192,37087,37049,36959,36959,
+36885,36885,36853,36846,36841,36841,36828,36828,
+36810,36798,36752,36752,36664,36664,36646,36650,
+36687,36687,36687,36687,36640,36624,36589,36589,
+36561,36561,36534,36527,36519,36519,36537,36537,
+36583,36620,36758,36758,37003,37003,37224,37339,
+36196,35942,37901,37901,38056,38128,38328,38328,
+34821,34498,34092,31616,30734,30589,31398,31397,
+31024,31433,31299,31033,30878,30587,30157,30102,
+30732,32005,33792,34488,35569,37802,37871,37871,
+38039,38039,38148,38182,38240,38240,38285,38285,
+38324,38333,38339,38339,38330,38330,38374,38396,
+38459,38459,38709,38709,39007,39071,39091,39091,
+38878,38878,38799,38799,38871,38871,38990,38990,
+39069,39088,39102,39102,39076,39076,39078,39083,
+39108,39108,39134,39134,39150,39159,39187,39187,
+39240,39240,39249,39245,39215,39215,39209,39209,
+39228,39221,39168,39168,39018,39018,38955,38941,
+38936,38936,38946,38946,38966,38972,38982,38982,
+38976,38976,38947,38931,38881,38881,38849,38849,
+38848,38843,38819,38819,38757,38757,38724,38715,
+38694,38694,38647,38647,38591,38568,38511,38511,
+38447,38447,38402,38386,38351,38351,38321,38321,
+38303,38297,38279,38279,38263,38263,38256,38251,
+38238,38238,38207,38207,38172,38159,38126,38126,
+38085,38085,38053,38044,38023,38023,37998,37998,
+37972,37963,37937,37937,37900,37900,37861,37844,
+37801,37801,37752,37752,37717,37702,37655,37655,
+37577,37577,37520,37499,37443,37443,37368,37368,
+37293,37253,37132,37132,36943,36943,36798,36746,
+36632,36632,33174,33031,32737,32783,32702,32667,
+32286,32167,32230,31921,31774,31679,31631,31497,
+31495,31545,31552,31740,32010,32034,32060,32075,
+32066,32092,31908,31881,31882,31877,31892,31902,
+32042,32197,32392,32259,32701,32972,33032,32661,
+32485,31828,31966,31703,31831,31299,30928,29879,
+29542,29333,29036,29698,29931,30250,30305,29437,
+29584,29597,29639,29939,30131,30338,30709,30619,
+31193,31253,31237,31016,31337,31312,31194,31212,
+31329,31426,31600,31573,31529,31520,31291,31365,
+31976,31917,31941,31648,31464,31386,31537,31745,
+31777,32028,32087,32058,32748,32964,32532,32187,
+32154,33785,34460,34754,34555,34374,38212,38212,
+38186,38186,38292,35960,35707,36937,35492,34867,
+33846,33898,33351,34558,33301,33941,33169,33309,
+35889,36237,36409,36632,35908,36144,34447,37169,
+37074,35383,35287,35570,36083,36823,37245,37615,
+37709,37775,38011,38011,38331,38331,37421,40490,
+36186,38606,38674,38674,38907,38961,38999,38999,
+38890,38890,38912,38886,38736,38736,38693,38693,
+38673,38657,38602,38602,38514,38514,39158,39867,
+38676,38830,38360,40063,40050,39335,39635,38677,
+37721,37647,37466,36998,37409,37664,37611,38043,
+38441,38141,37850,37575,37826,37883,37903,37914,
+37726,37601,37901,38071,38232,38863,38476,38482,
+38449,38309,37853,36623,36370,36356,36321,36663,
+36828,37212,37674,37971,38834,38954,38978,39030,
+38548,38311,37696,36436,35895,37573,38248,38366,
+37714,38183,38591,35360,34249,34451,34578,33986,
+34264,34142,34430,34924,34238,34418,34805,35015,
+35921,36354,36208,35720,34900,33999,33742,33476,
+33178,33109,33204,33684,33985,34570,35328,34789,
+34933,34838,34977,35586,34789,34952,34822,34798,
+34971,34831,34198,34918,35290,35205,35096,35096,
+35299,35299,35641,36469,37095,37095,37569,37569,
+37746,37802,37907,37907,38007,38007,38053,38063,
+38066,38066,38101,38101,38179,38196,38202,38202,
+38120,38120,38043,38008,37913,37913,37955,37955,
+38122,38170,38241,38241,38231,38231,38197,38177,
+38110,38110,38135,38135,38245,38282,38361,38361,
+38422,38422,38458,38466,38476,38476,38477,38477,
+38480,38484,38504,38504,38544,38544,38548,38543,
+38516,38516,38513,38513,38540,38548,38562,38562,
+38558,38558,38568,38575,38599,38599,38609,38609,
+38600,38593,38571,38571,38528,38528,38529,38535,
+38567,38567,38591,38591,38598,38599,38594,38594,
+38572,38572,38516,38486,38393,38393,38327,38327,
+38311,38309,38319,38319,38359,38359,38363,38360,
+38341,38341,38347,38347,38377,38376,38343,38343,
+37910,37910,37886,37897,37973,37973,38053,38053,
+38107,38116,38106,38106,38019,38019,37980,37970,
+37963,37963,37995,37995,38063,38084,38118,38118,
+38115,38115,38072,38048,37970,37970,37899,37899,
+37859,37862,37913,37913,38071,38071,38144,38161,
+38174,38174,38148,38148,38108,38099,38095,38095,
+38114,38114,38136,38146,38174,38174,38193,38193,
+38197,38190,38152,38152,38057,38057,37976,37944,
+37866,37866,37799,37799,37764,37750,37710,37710,
+37658,37658,37609,37587,37527,37527,37445,37445,
+37368,37342,37288,37288,37259,37259,37225,37207,
+37148,37148,37046,37046,36934,36895,36811,36811,
+36749,36749,36719,36714,36710,36710,36669,36669,
+36601,36578,36532,36532,36499,36499,36502,36509,
+36547,36547,36550,36550,36508,36494,36466,36466,
+36447,36447,36407,36391,36353,36353,36371,36371,
+36452,36503,36677,36677,36946,36946,37115,37195,
+35662,35736,37733,37733,37850,37930,38212,35383,
+34523,33821,32770,30632,30565,30673,31291,31321,
+31382,31392,31569,31593,30999,30729,30132,30241,
+31422,33031,34293,34630,35473,37582,37652,37652,
+37827,37827,37966,38016,38125,38125,38203,38203,
+38252,38257,38228,38228,38123,38123,38125,38135,
+38190,38190,38419,38419,38700,38761,38791,38791,
+38637,38637,38578,38598,38758,38758,33341,38899,
+38973,38990,38999,38999,38940,38940,38893,38876,
+38833,38833,38840,38840,38894,38913,38952,38952,
+38991,38991,39003,39003,38989,38989,39000,39000,
+39030,39027,38983,38983,38847,38847,38777,38757,
+38730,38730,38737,38737,38774,38785,38802,38802,
+38798,38798,38775,38762,38721,38721,38685,38685,
+38671,38661,38627,38627,38559,38559,38536,38531,
+38532,38532,38493,38493,38429,38407,38362,38362,
+38339,38339,38306,38291,38246,38246,38191,38191,
+38142,38129,38104,38104,38110,38110,38108,38104,
+38088,38088,38056,38056,38028,38017,37991,37991,
+37956,37956,37926,37917,37896,37896,37864,37864,
+37830,37819,37797,37797,37779,37779,37747,37730,
+37679,37679,37633,37633,37611,37598,37557,37557,
+37486,37486,37438,37421,37378,37378,37299,37299,
+37209,37169,37058,37058,36904,36904,36762,36715,
+36619,36619,33669,33703,33686,32856,32905,32679,
+32292,32359,32190,31958,31916,31804,31522,31320,
+31305,31338,31236,31345,31781,31852,31930,31923,
+31983,32027,31822,31807,31851,31797,31670,31783,
+31862,31947,31942,31893,32377,32242,32839,32697,
+32378,32098,31517,31398,30626,30941,30732,29915,
+30585,29659,29875,30143,30163,29867,30033,29456,
+29725,30635,30097,29797,29947,30286,30530,30710,
+31063,31115,31305,31071,31231,31350,31432,31606,
+31734,31776,31952,31957,31829,31677,31378,31452,
+32107,32188,31894,31808,31744,31628,31768,31876,
+31823,31780,32181,31992,32957,32884,32282,31982,
+31692,34704,34074,34043,33239,38086,38100,38100,
+38061,38061,38142,35182,35924,35771,34432,34276,
+33971,33147,33984,33091,33285,35948,34517,33583,
+35751,36217,35922,36426,36068,36395,36421,36928,
+36260,35215,34799,35658,36348,37164,36961,37436,
+37710,37821,38103,38103,38422,38422,38706,40572,
+36561,38634,38674,38674,38861,38906,38944,38944,
+38681,37402,36322,36856,36764,36659,36862,38460,
+38418,38395,38326,38326,38235,40157,40322,40403,
+39431,38465,38277,38893,40180,39704,39708,39881,
+37869,37833,37713,37187,37287,37542,37710,37834,
+37848,38056,37828,37734,37901,37880,37870,37913,
+37621,37687,38031,37994,38247,38433,38301,38261,
+37995,37947,37350,35914,35686,35526,35413,35643,
+35835,36769,37541,38033,37622,37438,37173,36346,
+36640,37382,37383,36199,35372,36279,37524,38204,
+37456,37433,38142,35572,33536,33568,34538,33712,
+33695,33975,33937,34709,34426,34366,34701,34645,
+35085,35389,35744,34980,34501,34276,33572,32872,
+32482,32369,32468,32979,33569,33627,34226,35028,
+34531,34914,34928,34300,34801,34954,34772,34384,
+34315,34148,33986,34327,34613,35212,34974,34974,
+35198,35198,35724,35948,36537,36537,37020,37020,
+37276,37366,37555,37555,37767,37767,37857,37874,
+37867,37867,37897,37897,37978,37994,37993,37993,
+37898,37898,37823,37791,37703,37703,37697,37697,
+37777,37803,37856,37856,37904,37904,37915,37913,
+37891,37891,37924,37924,38003,38036,38127,38127,
+38246,38246,38276,38272,38224,38224,38191,38191,
+38199,38208,38245,38245,38320,38320,38333,38327,
+38288,38288,38281,38281,38314,38326,38349,38349,
+38361,38361,38369,38373,38384,38384,38398,38398,
+38411,38410,38389,38389,38327,38327,38339,38355,
+38424,38424,38444,38444,38406,38391,38358,38358,
+38326,38326,38274,38248,38167,38167,38094,38094,
+38056,38048,38044,38044,38076,38076,38074,38069,
+38045,38045,38054,38054,38094,38094,38055,38055,
+37910,37910,37886,37897,37973,37973,38053,38053,
+38107,38116,38106,38106,38019,38019,37980,37970,
+37963,37963,37995,37995,38063,38084,38118,38118,
+38115,38115,38072,38048,37970,37970,37899,37899,
+37859,37862,37913,37913,38071,38071,38144,38161,
+38174,38174,38148,38148,38108,38099,38095,38095,
+38114,38114,38136,38146,38174,38174,38193,38193,
+38197,38190,38152,38152,38057,38057,37976,37944,
+37866,37866,37799,37799,37764,37750,37710,37710,
+37658,37658,37609,37587,37527,37527,37445,37445,
+37368,37342,37288,37288,37259,37259,37225,37207,
+37148,37148,37046,37046,36934,36895,36811,36811,
+36749,36749,36719,36714,36710,36710,36669,36669,
+36601,36578,36532,36532,36499,36499,36502,36509,
+36547,36547,36550,36550,36508,36494,36466,36466,
+36447,36447,36407,36391,36353,36353,36371,36371,
+36452,36503,36677,36677,36946,36946,37115,37195,
+35464,35473,37733,37733,37850,35756,34732,34566,
+33689,32535,30929,29631,30100,30790,30936,30997,
+30950,31208,31287,31193,30473,30568,30538,31098,
+32341,33509,34165,34459,34833,37582,37652,37652,
+37827,37827,37966,38016,38125,38125,38203,38203,
+38252,38257,38228,38228,38123,38123,38125,38135,
+38190,38190,38419,38419,38700,38761,38791,38791,
+38637,38637,38578,38598,38758,38758,32051,38899,
+38973,38990,38999,38999,38940,38940,38893,38876,
+38833,38833,38840,38840,38894,38913,38952,38952,
+38991,38991,39003,39003,38989,38989,39000,39000,
+39030,39027,38983,38983,38847,38847,38777,38757,
+38730,38730,38737,38737,38774,38785,38802,38802,
+38798,38798,38775,38762,38721,38721,38685,38685,
+38671,38661,38627,38627,38559,38559,38536,38531,
+38532,38532,38493,38493,38429,38407,38362,38362,
+38339,38339,38306,38291,38246,38246,38191,38191,
+38142,38129,38104,38104,38110,38110,38108,38104,
+38088,38088,38056,38056,38028,38017,37991,37991,
+37956,37956,37926,37917,37896,37896,37864,37864,
+37830,37819,37797,37797,37779,37779,37747,37730,
+37679,37679,37633,37633,37611,37598,37557,37557,
+37486,37486,37438,37421,37378,37378,37299,37299,
+37209,37169,37058,37058,36904,36904,36762,36715,
+36619,36619,34348,33948,33841,33688,32782,32680,
+32285,32169,32254,32107,31923,31857,31489,31276,
+31234,31230,31151,31284,31480,31470,31669,31770,
+31877,31863,31819,31715,31674,31685,31567,31722,
+31736,31836,31878,31630,31893,32241,32634,32589,
+32468,31638,31050,30822,30428,30681,30946,30521,
+30660,30403,30286,30226,29865,29825,30101,29644,
+30015,30240,29976,29860,30010,30389,30667,30791,
+30762,30850,30979,31132,31477,31652,31841,31991,
+32006,32060,32286,32233,32094,31792,31709,31622,
+31986,32174,32095,31896,31801,31735,31793,31633,
+31862,33220,31975,31416,32342,32383,31940,32130,
+33005,34596,33648,33655,32865,38086,38100,38100,
+38061,38061,37086,36114,37274,35598,37522,34138,
+32548,33324,33312,33795,34065,35698,35587,35759,
+35860,36220,35848,36500,36628,36369,36622,36841,
+35060,35049,34805,35826,37164,37164,40275,37436,
+37710,37821,38103,38103,38422,38422,38706,41083,
+38318,38634,38674,38674,37062,36701,37008,37059,
+36918,36857,36956,36478,35668,35728,36172,36228,
+35125,36310,35359,35321,37641,40005,38096,40108,
+39466,38266,38194,39715,40148,39551,39342,39550,
+38176,37986,37834,37280,37160,37336,37727,37802,
+37837,38141,38026,37790,37860,37725,37769,37617,
+37709,37851,38055,38016,38268,38431,38563,38546,
+37161,36877,37140,36135,35261,34799,34549,34826,
+35132,36176,36816,37472,37139,37011,36574,35581,
+36690,37518,37976,37477,36368,35249,36260,37402,
+37059,36654,37032,36119,33671,32680,33670,33226,
+33468,33645,33730,34713,34531,33967,34244,34775,
+35155,35442,35269,34358,33512,32913,32712,32424,
+32159,31959,32089,32442,32282,32277,33331,33679,
+34071,34124,34174,34096,34574,34971,34670,34500,
+34335,34090,33966,33991,33988,34621,34910,34974,
+35198,35198,35724,35948,36537,36537,37020,37020,
+37276,37366,37555,37555,37767,37767,37857,37874,
+37867,37867,37897,37897,37978,37994,37993,37993,
+37898,37898,37823,37791,37703,37703,37697,37697,
+37777,37803,37856,37856,37904,37904,37915,37913,
+37891,37891,37924,37924,38003,38036,38127,38127,
+38246,38246,38276,38272,38224,38224,38191,38191,
+38199,38208,38245,38245,38320,38320,38333,38327,
+38288,38288,38281,38281,38314,38326,38349,38349,
+38361,38361,38369,38373,38384,38384,38398,38398,
+38411,38410,38389,38389,38327,38327,38339,38355,
+38424,38424,38444,38444,38406,38391,38358,38358,
+38326,38326,38274,38248,38167,38167,38094,38094,
+38056,38048,38044,38044,38076,38076,38074,38069,
+38045,38045,38054,38054,38094,38094,38055,38055,
+37482,37482,37446,37452,37519,37519,37591,37591,
+37643,37653,37651,37651,37585,37585,37545,37532,
+37510,37510,37540,37540,37615,37640,37695,37695,
+37727,37727,37708,37691,37627,37627,37566,37566,
+37529,37535,37599,37599,37786,37786,37864,37880,
+37881,37881,37861,37861,37841,37837,37838,37838,
+37841,37841,37863,37875,37917,37917,37943,37943,
+37946,37942,37922,37922,37862,37862,37789,37757,
+37669,37669,37596,37596,37562,37547,37501,37501,
+37431,37431,37374,37350,37292,37292,37216,37216,
+37148,37125,37076,37076,37049,37049,37015,36998,
+36939,36939,36841,36841,36737,36703,36632,36632,
+36591,36591,36564,36555,36541,36541,36485,36485,
+36409,36384,36341,36341,36321,36321,36321,36326,
+36352,36352,36357,36357,36327,36315,36289,36289,
+36258,36258,36194,36167,36091,36091,36108,36108,
+36222,36281,36455,36455,36917,36917,36981,33925,
+34670,37049,37411,37411,37668,35202,34393,33875,
+32068,30620,29418,29157,29699,30144,30809,30985,
+31145,30316,29899,29757,29439,30174,30604,31228,
+31743,32431,33098,33261,34015,37137,37282,37282,
+37642,37642,37821,37862,37888,37888,37924,37924,
+37986,37992,37959,37959,37819,37819,37801,37807,
+37850,37850,38019,38019,38227,38268,38262,38262,
+38116,38116,38067,38111,32116,31403,31118,32416,
+38843,38876,38897,38897,38801,38801,38712,38675,
+38584,38584,38549,38549,38591,38606,38638,38638,
+38677,38677,38700,38704,38703,38703,38708,38708,
+38717,38712,38673,38673,38578,38578,38517,38496,
+38451,38451,38451,38451,38496,38509,38535,38535,
+38539,38539,38526,38518,38491,38491,38455,38455,
+38429,38418,38386,38386,38339,38339,38323,38320,
+38322,38322,38284,38284,38214,38190,38146,38146,
+38132,38132,38106,38091,38048,38048,37988,37988,
+37933,37917,37886,37886,37884,37884,37882,37881,
+37872,37872,37849,37849,37827,37818,37799,37799,
+37768,37768,37741,37731,37708,37708,37679,37679,
+37653,37643,37621,37621,37596,37596,37563,37548,
+37505,37505,37459,37459,37428,37415,37378,37378,
+37324,37324,37287,37272,37239,37239,37162,37162,
+37064,37027,36942,36942,36849,36849,36747,36706,
+36604,36604,36540,36540,34216,33532,33632,33508,
+32741,32714,32334,31884,31723,31611,31429,31250,
+31266,31150,31120,31110,31299,31272,31262,31333,
+31400,31565,31491,31609,31808,31806,31598,31889,
+31845,31550,31550,31496,31613,31721,32054,32198,
+32246,31244,30602,30810,31073,31770,31453,30754,
+30476,30449,29999,29728,29661,30670,29970,29988,
+30648,30695,30748,30272,30625,30606,30770,30621,
+30664,30814,31013,31424,32271,32372,32662,32755,
+32797,32854,32779,32757,32672,32511,32341,32278,
+32402,32465,32360,32103,31824,31704,31861,31944,
+31572,31615,31277,31499,31562,31550,31836,33817,
+32685,32862,32047,32240,34257,37905,37887,37887,
+37270,36499,37574,36565,36752,35064,36014,35593,
+35303,35094,34855,34767,34987,35047,35140,35623,
+35694,35814,36035,36023,35895,36034,36281,35747,
+35080,34828,34907,36834,37152,37152,37393,37393,
+37702,37841,38226,38226,38620,38620,38739,38748,
+38674,38674,37085,35379,34291,34552,34164,33686,
+34896,35421,38148,35891,35261,33727,34248,34245,
+34437,34007,36131,36066,38763,36503,38599,38331,
+38132,38922,40019,37105,39671,39152,38678,37804,
+38211,37498,36901,36772,36590,36365,36968,37476,
+37653,37662,37612,37659,37358,37749,38022,37710,
+37714,37654,37523,37816,38005,38001,38271,37935,
+37683,36455,35669,34945,34593,34223,34338,34441,
+35417,38061,38060,37657,37529,38480,39875,39358,
+39398,39209,37638,37811,37977,35584,35334,35294,
+37531,37172,36256,36279,33939,31407,31513,31648,
+32706,34125,34513,35267,34737,33842,34191,34075,
+34961,35636,33794,32385,32020,32073,31996,31687,
+31200,30881,31140,31621,31063,30641,31520,31728,
+31757,32799,33507,33424,33958,34246,34047,34057,
+34074,33688,33825,33913,33920,33764,34010,34338,
+34946,34946,35225,35356,35730,35730,36188,36188,
+36542,36674,36977,36977,37337,37337,37524,37573,
+37632,37632,37695,37695,37771,37784,37774,37774,
+37679,37679,37611,37583,37511,37511,37475,37475,
+37491,37501,37535,37535,37607,37607,37641,37647,
+37647,37647,37668,37668,37711,37738,37831,37831,
+37986,37986,38009,37996,37906,37906,37850,37850,
+37865,37876,37917,37917,37996,37996,38016,38014,
+37983,37983,37980,37980,38011,38022,38046,38046,
+38054,38054,38051,38050,38045,38045,38045,38045,
+38055,38052,38029,38029,37965,37965,37975,37991,
+38058,38058,38082,38082,38057,38046,38013,38013,
+37970,37970,37919,37894,37823,37823,37745,37745,
+37692,37675,37651,37651,37647,37647,37631,37622,
+37597,37597,37621,37621,37683,37688,37651,37651,
+37482,37482,37446,37452,37519,37519,37591,37591,
+37643,37653,37651,37651,37585,37585,37545,37532,
+37510,37510,37540,37540,37615,37640,37695,37695,
+37727,37727,37708,37691,37627,37627,37566,37566,
+37529,37535,37599,37599,37786,37786,37864,37880,
+37881,37881,37861,37861,37841,37837,37838,37838,
+37841,37841,37863,37875,37917,37917,37943,37943,
+37946,37942,37922,37922,37862,37862,37789,37757,
+37669,37669,37596,37596,37562,37547,37501,37501,
+37431,37431,37374,37350,37292,37292,37216,37216,
+37148,37125,37076,37076,37049,37049,37015,36998,
+36939,36939,36841,36841,36737,36703,36632,36632,
+36591,36591,36564,36555,36541,36541,36485,36485,
+36409,36384,36341,36341,36321,36321,36321,36326,
+36352,36352,36357,36357,36327,36315,36289,36289,
+36258,36258,36194,36167,36091,36091,36108,36108,
+36222,36281,36455,36455,36917,36917,34418,33741,
+37049,37049,37411,37411,37668,34821,34024,33271,
+31202,29909,29346,29833,30132,30350,30538,30584,
+30631,29979,29630,29577,30436,30261,30460,31075,
+31827,32292,32464,33558,34503,37137,37282,37282,
+37642,37642,37821,37862,37888,37888,37924,37924,
+37986,37992,37959,37959,37819,37819,37801,37807,
+37850,37850,38019,38019,38227,38268,38262,38262,
+38116,38116,38067,32173,31339,31051,31173,32375,
+38843,38876,38897,38897,38801,38801,38712,38675,
+38584,38584,38549,38549,38591,38606,38638,38638,
+38677,38677,38700,38704,38703,38703,38708,38708,
+38717,38712,38673,38673,38578,38578,38517,38496,
+38451,38451,38451,38451,38496,38509,38535,38535,
+38539,38539,38526,38518,38491,38491,38455,38455,
+38429,38418,38386,38386,38339,38339,38323,38320,
+38322,38322,38284,38284,38214,38190,38146,38146,
+38132,38132,38106,38091,38048,38048,37988,37988,
+37933,37917,37886,37886,37884,37884,37882,37881,
+37872,37872,37849,37849,37827,37818,37799,37799,
+37768,37768,37741,37731,37708,37708,37679,37679,
+37653,37643,37621,37621,37596,37596,37563,37548,
+37505,37505,37459,37459,37428,37415,37378,37378,
+37324,37324,37287,37272,37239,37239,37162,37162,
+37064,37027,36942,36942,36849,36849,36747,36706,
+36604,36604,36540,36540,36488,33615,33591,33402,
+33007,32922,32871,32062,31764,31708,31473,31242,
+31291,31161,31085,31091,31201,31267,31323,30952,
+31239,31541,31239,31455,31663,31855,31864,31893,
+31806,31460,31517,31161,31134,31118,31397,31099,
+31289,30904,30478,30732,30721,31397,30640,30766,
+30216,30115,29881,29873,29741,30869,30861,30274,
+30083,30252,30215,30110,30738,30579,30627,30717,
+30880,31054,31074,31330,32517,32714,32853,32829,
+32937,32974,33046,33030,32845,32653,32539,32466,
+32573,32594,32585,32204,32164,32041,31926,31731,
+31993,31466,31409,31546,31499,31672,32194,32424,
+32183,32389,31454,31951,37867,37905,37887,37887,
+36595,35640,33928,36018,36032,35801,35506,35747,
+36018,34749,34901,34311,34848,34915,34971,35509,
+35565,35637,35656,35643,35801,34243,34242,34572,
+34881,34696,36174,37126,37152,37152,37393,37393,
+37702,37841,38226,39514,39070,38890,39084,39367,
+38674,38674,38767,34512,34969,34885,32959,33144,
+33109,33095,34929,33446,32661,32275,33298,33293,
+33902,33027,35614,38065,36052,37186,38042,38183,
+37966,39325,37141,36863,39162,37721,38068,37287,
+37373,37405,36699,36092,36253,36176,36739,37093,
+37210,37316,37761,37771,37877,37806,37786,37752,
+37837,37977,36826,36906,37400,38128,38529,38424,
+38538,36915,35928,35330,35367,35068,35082,34492,
+35280,37288,35877,34892,35475,35700,36418,35844,
+36708,37650,37057,37445,37968,36792,35634,35094,
+36273,35784,35110,35474,33260,31224,31127,30791,
+31501,33410,33731,34344,33966,33612,34078,34560,
+34697,35107,33376,31982,31778,31968,31606,31022,
+30589,30343,30520,31174,30856,30524,31139,31467,
+31580,32039,32844,33113,33313,33681,33694,33459,
+33510,33396,33457,33706,33848,33273,33288,33986,
+34946,34946,35225,35356,35730,35730,36188,36188,
+36542,36674,36977,36977,37337,37337,37524,37573,
+37632,37632,37695,37695,37771,37784,37774,37774,
+37679,37679,37611,37583,37511,37511,37475,37475,
+37491,37501,37535,37535,37607,37607,37641,37647,
+37647,37647,37668,37668,37711,37738,37831,37831,
+37986,37986,38009,37996,37906,37906,37850,37850,
+37865,37876,37917,37917,37996,37996,38016,38014,
+37983,37983,37980,37980,38011,38022,38046,38046,
+38054,38054,38051,38050,38045,38045,38045,38045,
+38055,38052,38029,38029,37965,37965,37975,37991,
+38058,38058,38082,38082,38057,38046,38013,38013,
+37970,37970,37919,37894,37823,37823,37745,37745,
+37692,37675,37651,37651,37647,37647,37631,37622,
+37597,37597,37621,37621,37683,37688,37651,37651,
+37083,37083,37013,37001,37005,37005,37041,37041,
+37096,37114,37144,37144,37147,37147,37132,37124,
+37098,37098,37110,37110,37162,37185,37250,37250,
+37329,37329,37339,37333,37294,37294,37261,37261,
+37252,37260,37317,37317,37455,37455,37491,37491,
+37452,37452,37446,37446,37484,37500,37539,37539,
+37572,37572,37595,37605,37630,37630,37656,37656,
+37672,37674,37674,37674,37654,37654,37617,37598,
+37542,37542,37469,37469,37405,37377,37303,37303,
+37205,37205,37134,37109,37050,37050,36992,36992,
+36954,36936,36888,36888,36828,36828,36785,36767,
+36721,36721,36641,36641,36556,36529,36479,36479,
+36462,36462,36432,36418,36378,36378,36332,36332,
+36295,36278,36236,36236,36169,36169,36138,36134,
+36144,36144,36149,36149,36139,36132,36104,36104,
+36042,36042,35952,35914,35813,35813,35835,35835,
+35978,36033,36161,36161,34276,34223,34028,34091,
+36960,36960,37237,37237,34896,33986,33453,32605,
+30254,29615,29567,30437,30768,30830,30436,30140,
+30121,30116,29768,29321,30743,30815,30650,31320,
+31880,31913,32133,33146,33987,36872,37027,37027,
+37576,37576,37724,37712,37499,37499,37439,37439,
+37534,37557,37575,37575,37506,37506,37509,37517,
+37549,37549,37643,37643,37763,37778,37731,37731,
+37549,37549,37485,31721,31125,31064,31417,32772,
+38670,38733,38816,38816,38699,38699,38592,38553,
+38466,38466,38397,38397,38377,38375,38385,38385,
+38442,38442,38470,38474,38466,38466,38435,38435,
+38390,38374,38334,38334,38300,38300,38265,38250,
+38204,38204,38198,38198,38234,38247,38272,38272,
+38285,38285,38282,38278,38262,38262,38233,38233,
+38207,38199,38185,38185,38181,38181,38172,38166,
+38148,38148,38095,38095,38021,37995,37937,37937,
+37896,37896,37864,37850,37817,37817,37782,37782,
+37757,37745,37712,37712,37669,37669,37660,37660,
+37673,37673,37666,37666,37646,37638,37618,37618,
+37587,37587,37557,37546,37518,37518,37502,37502,
+37499,37493,37468,37468,37409,37409,37374,37363,
+37346,37346,37300,37300,37240,37219,37176,37176,
+37145,37145,37115,37102,37068,37068,36996,36996,
+36906,36876,36816,36816,36779,36779,36711,36676,
+36575,36575,36478,36478,36382,33914,33782,33515,
+32966,32833,32663,31610,31503,31381,31253,31144,
+31091,31091,31091,31042,30997,31052,31196,31018,
+31174,31350,31447,31507,31386,31529,31952,31724,
+31771,31539,31206,30910,30820,30730,30862,30706,
+30557,30401,30430,30439,30382,30487,30359,30172,
+29897,29746,29720,29830,29944,30065,30050,30115,
+30309,30262,30386,30346,30543,30806,30861,31011,
+31132,31121,30745,31193,32661,32813,32763,32896,
+32982,33111,33121,33063,32977,32798,32800,32845,
+32811,32771,32684,32379,32482,32248,31994,31975,
+32126,31520,31334,31335,31656,32661,33066,31975,
+31987,32088,31510,32487,37530,37598,37751,37751,
+35679,36009,34171,33548,33160,33013,33129,35424,
+35668,35514,34782,35099,35154,34718,34939,35074,
+35122,35127,35410,35664,34011,35699,35694,34040,
+35888,34580,35208,36870,37063,37063,37403,37403,
+37663,37764,37262,38549,37955,37990,36452,38527,
+38553,37084,37991,35464,35104,35210,35295,35198,
+35986,36215,34652,35343,33152,32114,33139,33127,
+33522,32598,34042,34621,36031,36767,37475,37756,
+37575,37608,36926,36970,38606,37926,38030,36960,
+36958,37527,37882,36034,36400,37237,36386,36509,
+36688,37451,37637,37584,37506,37265,37372,37749,
+37916,37948,37381,36827,37569,38468,38823,38731,
+38456,37702,36854,36028,35449,34491,34833,33778,
+32964,32557,31029,31072,32568,32481,32777,31540,
+31883,33673,34242,34997,36861,37530,36624,36173,
+35654,34106,33994,35366,33133,30788,30438,29844,
+30317,32030,32281,33222,33167,33257,34332,34451,
+34216,34266,32688,31923,31520,31352,31071,30626,
+30356,30118,30112,30624,30340,30052,30633,30835,
+31049,31222,31771,32062,32360,32953,33155,33049,
+33114,33308,32928,33106,33580,32931,32688,33031,
+34840,34840,34815,34842,35002,35002,35382,35382,
+35789,35947,36333,36333,36803,36803,37109,37210,
+37403,37403,37541,37541,37609,37622,37616,37616,
+37546,37546,37493,37471,37418,37418,37386,37386,
+37391,37397,37421,37421,37477,37477,37499,37500,
+37487,37487,37479,37479,37494,37513,37591,37591,
+37738,37738,37752,37737,37645,37645,37593,37593,
+37614,37625,37656,37656,37698,37698,37720,37725,
+37726,37726,37730,37730,37746,37750,37755,37755,
+37738,37738,37717,37711,37692,37692,37670,37670,
+37649,37638,37607,37607,37565,37565,37558,37558,
+37569,37569,37606,37606,37658,37670,37674,37674,
+37623,37623,37570,37546,37476,37476,37400,37400,
+37347,37326,37276,37276,37214,37214,37174,37163,
+37144,37144,37183,37183,37270,37283,37257,37257,
+36941,36941,36870,36855,36851,36851,36879,36879,
+36929,36946,36979,36979,36995,36995,36987,36981,
+36958,36958,36968,36968,37015,37038,37104,37104,
+37191,37191,37206,37202,37165,37165,37138,37138,
+37132,37143,37199,37199,37329,37329,37358,37354,
+37307,37307,37305,37305,37357,37377,37423,37423,
+37458,37458,37479,37487,37506,37506,37530,37530,
+37547,37550,37555,37555,37549,37549,37523,37508,
+37464,37464,37395,37395,37328,37299,37224,37224,
+37127,37127,37057,37032,36976,36976,36922,36922,
+36885,36870,36823,36823,36758,36758,36716,36700,
+36659,36659,36588,36588,36511,36487,36442,36442,
+36424,36424,36390,36374,36325,36325,36278,36278,
+36247,36231,36187,36187,36107,36107,36067,36058,
+36058,36058,36058,36058,36051,36045,36015,36015,
+35949,35949,35856,35817,35715,35715,35733,35733,
+35878,35930,36051,36051,33608,33471,33679,36801,
+36927,36927,34282,34071,34027,32973,32171,30948,
+28905,28972,29328,30434,30654,30697,30488,30222,
+29826,29853,29218,29176,30154,30907,30887,30822,
+31036,30991,31430,31826,32031,36853,36988,36988,
+37559,37559,37563,37516,37277,37277,37219,37219,
+37324,37352,37390,37390,37355,37355,37364,37370,
+37389,37389,37469,37469,37591,37611,37584,37584,
+37419,37419,37365,31743,31039,31071,32367,38357,
+38594,38665,38778,38778,38660,38660,38545,38504,
+38413,38413,38332,38332,38294,38288,38293,38293,
+38353,38353,38381,38383,38373,38373,38332,38332,
+38275,38256,38217,38217,38202,38202,38174,38161,
+38118,38118,38110,38110,38143,38155,38179,38179,
+38198,38198,38198,38196,38181,38181,38156,38156,
+38132,38126,38115,38115,38115,38115,38104,38097,
+38076,38076,38022,38022,37950,37924,37866,37866,
+37819,37819,37786,37773,37744,37744,37713,37713,
+37690,37679,37646,37646,37598,37598,37588,37589,
+37603,37603,37599,37599,37581,37573,37550,37550,
+37513,37513,37482,37471,37446,37446,37432,37432,
+37432,37428,37407,37407,37347,37347,37315,37306,
+37296,37296,37246,37246,37174,37151,37104,37104,
+37074,37074,37046,37034,37003,37003,36935,36935,
+36849,36822,36767,36767,36738,36738,36678,36648,
+36176,36554,36457,36457,36366,36337,33966,34127,
+34018,33714,33189,31918,31741,32116,31111,30990,
+30958,30712,30576,30413,30246,30425,30482,30480,
+30712,30735,31282,31286,31283,31559,31716,31563,
+32933,31876,32648,31068,30585,30954,31348,31178,
+30281,29943,30003,30093,30367,30135,30072,29984,
+29812,29971,29757,29738,29864,29895,29816,29932,
+30133,30264,29963,30389,30535,30664,31249,31326,
+31348,31553,31663,31918,32443,32795,33061,33182,
+33323,33375,33332,33312,33214,32927,32866,32768,
+32785,32724,32661,32547,32623,32617,32355,32197,
+32004,31790,31785,31728,31971,32547,31532,31386,
+30535,30719,33990,37318,34238,37520,37669,34719,
+34074,35336,35590,35371,35890,35598,33340,34738,
+34870,34974,34928,35008,34963,34851,34571,34757,
+34785,34830,33604,34631,35262,35864,35947,35712,
+34664,37254,36723,36804,36988,36988,37324,39308,
+37261,38055,37837,37243,35681,35717,36975,36729,
+35275,34864,36043,36474,37301,35716,34939,34618,
+34852,35186,35910,31010,31183,33316,33963,34022,
+34099,34227,33739,31342,34042,34798,37292,37054,
+37073,37134,37039,37026,36910,35100,37497,37819,
+37776,37473,37182,37064,36978,36847,35509,35409,
+35273,36034,36434,36758,37337,37005,36720,36933,
+37176,37297,36015,35518,36782,35693,35652,35542,
+36894,36192,34227,30290,28129,22546,23010,25632,
+21519,22590,26525,25858,26257,25701,26855,25806,
+25433,25091,29745,31161,33132,35062,35758,36427,
+34211,31303,29943,30607,29652,28223,28385,28297,
+28645,30391,30537,31695,33823,33549,32868,29733,
+28811,29142,29869,30002,30453,30123,29707,29528,
+29466,29051,29231,30220,30131,29862,29771,29919,
+30104,30890,31137,31156,31345,31847,32303,32736,
+33040,33499,32544,32157,32563,32230,31721,31782,
+32372,32974,34589,34597,34717,34717,35092,35092,
+35524,35691,36095,36095,36575,36575,36915,37032,
+37280,37280,37458,37458,37538,37554,37558,37558,
+37497,37497,37449,37429,37382,37382,37353,37353,
+37358,37363,37384,37384,37433,37433,37451,37452,
+37437,37437,37425,37425,37436,37452,37520,37520,
+37642,37642,37648,37632,37545,37545,37495,37495,
+37514,37524,37554,37554,37594,37594,37618,37624,
+37629,37629,37631,37631,37638,37640,37641,37641,
+37621,37621,37600,37593,37578,37578,37552,37552,
+37525,37512,37477,37477,37438,37438,37424,37420,
+37414,37414,37447,37447,37510,37525,37536,37536,
+37487,37487,37435,37412,37344,37344,37269,37269,
+37218,37198,37142,37142,37066,37066,37021,37007,
+36987,36987,37027,37027,37117,37131,37108,37108,
+36621,36621,36552,36537,36525,36525,36538,36538,
+36571,36584,36618,36618,36655,36655,36662,36661,
+36646,36646,36657,36657,36696,36716,36784,36784,
+36885,36885,36906,36904,36869,36869,36849,36849,
+36853,36865,36921,36921,37040,37040,37058,37049,
+36988,36988,36995,36995,37071,37097,37153,37153,
+37187,37187,37204,37208,37215,37215,37231,37231,
+37246,37253,37268,37268,37292,37292,37292,37287,
+37264,37264,37209,37209,37140,37113,37041,37041,
+36952,36952,36888,36866,36816,36816,36766,36766,
+36734,36719,36675,36675,36609,36609,36570,36556,
+36527,36527,36476,36476,36423,36405,36369,36369,
+36345,36345,36300,36278,36211,36211,36156,36156,
+36134,36120,36071,36071,35966,35966,35900,35882,
+35857,35857,35842,35842,35840,35833,35802,35802,
+35731,35731,35636,35596,35492,35492,35503,35503,
+35640,35690,35801,35801,33021,32964,33605,36611,
+36855,33938,33188,33233,33284,32151,31274,30274,
+28797,28958,29133,29968,30150,30172,30216,29827,
+29416,29820,29500,29416,30143,30169,29904,30560,
+30752,30676,31112,31088,31314,32743,36935,36935,
+37524,37524,37118,36984,36720,36720,36696,36696,
+36817,36858,36945,36945,36992,36992,37007,37007,
+36992,36992,37051,37051,37200,37238,37279,37279,
+37174,37174,37154,32406,31693,31121,38206,38206,
+38417,38497,38688,38688,38567,38567,38434,38386,
+38286,38286,38178,38178,38104,38088,38080,38080,
+38147,38147,38172,38173,38155,38155,38094,38094,
+38015,37992,37958,37958,37978,37978,37970,37962,
+37924,37924,37916,37916,37938,37948,37972,37972,
+38004,38004,38012,38011,37999,37999,37982,37982,
+37967,37964,37959,37959,37960,37960,37945,37936,
+37906,37906,37850,37850,37786,37762,37707,37707,
+37651,37651,37616,37604,37583,37583,37557,37557,
+37539,37528,37496,37496,37443,37443,37430,37431,
+37448,37448,37448,37448,37432,37423,37394,37394,
+37341,37341,37307,37298,37280,37280,37273,37273,
+37277,37275,37260,37260,37213,37213,37190,37185,
+37182,37182,37124,37124,37030,36999,36940,36940,
+36911,36911,36884,36875,36853,36853,36798,36798,
+36723,36699,36654,36654,36637,36637,36595,36573,
+36500,36500,36408,36408,36342,36311,36219,36219,
+36159,34142,32761,32417,32244,32107,30916,30707,
+30559,30678,30658,30496,30305,30382,30293,30236,
+30590,30882,31083,31282,31080,31146,31639,31718,
+32614,32820,32148,30923,30540,31495,31074,30901,
+30640,30070,30044,30093,30238,30193,30121,29616,
+29654,29694,29826,29750,29773,29607,29644,29842,
+30081,30138,30183,29749,29861,30843,31375,31406,
+31413,32011,32121,32279,32507,32841,33147,33260,
+33385,33411,33434,33341,33155,32784,32670,32600,
+32614,32596,32553,32468,32483,32508,32427,32274,
+32094,32603,31972,31815,31795,32229,31508,31193,
+30376,30864,37318,33642,31606,35438,34884,33944,
+35527,35632,35761,33716,33383,33317,32909,34302,
+35010,34747,34549,34556,34419,34352,34441,34626,
+34890,34797,33174,33962,33906,35461,35582,35857,
+34846,36267,36566,36653,36787,36787,38584,38331,
+38078,37630,37336,36938,36119,36460,35863,36082,
+36001,35600,35091,36297,36632,34110,33773,32052,
+33645,34586,35127,31398,33282,33508,34157,33746,
+33523,34095,33895,33214,34477,33964,35222,37444,
+37102,37174,37477,37160,36821,35202,35050,37504,
+36967,37403,36074,36632,36345,36524,35805,35247,
+35182,35654,35940,36446,36613,36363,36579,37338,
+37702,38015,36598,35604,35268,31705,29895,29535,
+29486,28062,27120,22861,21291,20174,23331,25839,
+22344,25516,26196,23849,22048,24743,25840,23399,
+22507,26613,28393,29062,30746,33252,33848,33554,
+31530,29976,28094,27964,27948,27198,28569,27496,
+27704,29442,30138,31152,33927,33441,31302,28141,
+28176,29272,30009,30146,30424,30019,29358,29256,
+29504,29156,29100,30075,30094,29760,29544,29737,
+29930,30536,30862,30917,31304,31678,32008,32855,
+33033,33215,33244,32997,32664,31703,31209,31386,
+31515,31782,32371,34004,34059,34059,34441,34441,
+34933,35119,35556,35556,36035,36035,36444,36601,
+36977,36977,37252,37252,37367,37396,37427,37427,
+37387,37387,37349,37334,37297,37297,37275,37275,
+37283,37288,37305,37305,37336,37336,37346,37345,
+37330,37330,37312,37312,37319,37328,37368,37368,
+37424,37424,37405,37385,37311,37311,37267,37267,
+37282,37291,37321,37321,37363,37363,37388,37395,
+37404,37404,37398,37398,37390,37387,37379,37379,
+37353,37353,37337,37333,37329,37329,37300,37300,
+37257,37240,37200,37200,37161,37161,37130,37116,
+37077,37077,37096,37096,37173,37193,37216,37216,
+37174,37174,37128,37105,37040,37040,36970,36970,
+36927,36906,36842,36842,36740,36740,36680,36663,
+36634,36634,36673,36673,36767,36783,36770,36770,
+36621,36621,36552,36537,36525,36525,36538,36538,
+36571,36584,36618,36618,36655,36655,36662,36661,
+36646,36646,36657,36657,36696,36716,36784,36784,
+36885,36885,36906,36904,36869,36869,36849,36849,
+36853,36865,36921,36921,37040,37040,37058,37049,
+36988,36988,36995,36995,37071,37097,37153,37153,
+37187,37187,37204,37208,37215,37215,37231,37231,
+37246,37253,37268,37268,37292,37292,37292,37287,
+37264,37264,37209,37209,37140,37113,37041,37041,
+36952,36952,36888,36866,36816,36816,36766,36766,
+36734,36719,36675,36675,36609,36609,36570,36556,
+36527,36527,36476,36476,36423,36405,36369,36369,
+36345,36345,36300,36278,36211,36211,36156,36156,
+36134,36120,36071,36071,35966,35966,35900,35882,
+35857,35857,35842,35842,35840,35833,35802,35802,
+35731,35731,35636,35596,35492,35492,35503,35503,
+35640,35690,35801,35801,32814,33008,36469,36611,
+32848,32466,32285,32355,32453,31403,30654,29787,
+28991,29071,28941,29441,29737,29892,29792,29452,
+29274,30146,29779,28935,29597,29704,29975,30515,
+30560,30416,30673,30539,30640,31251,31759,36935,
+37524,37524,37118,36984,36720,36720,36696,36696,
+36817,36858,36945,36945,36992,36992,37007,37007,
+36992,36992,37051,37051,37200,37238,37279,37279,
+37174,37174,37154,32111,31805,31526,38206,38206,
+38417,38497,38688,38688,38567,38567,38434,38386,
+38286,38286,38178,38178,38104,38088,38080,38080,
+38147,38147,38172,38173,38155,38155,38094,38094,
+38015,37992,37958,37958,37978,37978,37970,37962,
+37924,37924,37916,37916,37938,37948,37972,37972,
+38004,38004,38012,38011,37999,37999,37982,37982,
+37967,37964,37959,37959,37960,37960,37945,37936,
+37906,37906,37850,37850,37786,37762,37707,37707,
+37651,37651,37616,37604,37583,37583,37557,37557,
+37539,37528,37496,37496,37443,37443,37430,37431,
+37448,37448,37448,37448,37432,37423,37394,37394,
+37341,37341,37307,37298,37280,37280,37273,37273,
+37277,37275,37260,37260,37213,37213,37190,37185,
+37182,37182,37124,37124,37030,36999,36940,36940,
+36911,36911,36884,36875,36853,36853,36798,36798,
+36723,36699,36654,36654,36637,36637,36595,36573,
+36500,36500,36408,36408,36342,36311,36219,36219,
+36159,36159,33831,32000,32343,32088,31785,30755,
+30673,30125,30228,30323,30124,30184,30210,29981,
+30257,30507,30998,31144,30899,31298,31379,31622,
+32334,32542,31571,31508,30646,31391,31047,30017,
+30002,29649,29498,29442,29719,29763,29858,29803,
+29758,29741,29721,29645,29696,29628,29695,29587,
+30170,31101,31388,30595,30682,30627,31124,31855,
+31649,32174,32566,32447,32697,32919,33171,33099,
+33005,33481,33462,33298,33005,32633,32570,32555,
+32443,32531,32525,32503,32571,32638,32724,32601,
+32377,32083,31974,31855,31647,32372,31761,30975,
+30174,31094,34404,34260,32249,35238,34141,33139,
+35404,34805,33230,34813,35045,35303,35339,35147,
+35170,34867,34564,34371,34368,34408,34490,34434,
+34552,32773,32952,34463,35012,35735,35929,36248,
+36267,36267,36566,36653,36787,36787,38001,36384,
+37491,35230,36266,35992,35621,34031,33323,34353,
+34097,33304,34045,35616,33716,34852,34220,33490,
+32941,34629,32712,33374,33404,33388,33634,33415,
+33140,32256,33450,33405,32110,32383,36000,38342,
+37725,37838,38110,38401,37274,36729,35161,35453,
+38122,37395,37284,36450,36677,36509,36002,35093,
+35135,35651,35475,35967,36138,36489,37150,37147,
+36982,36991,35621,33964,32699,27098,25445,24593,
+22890,22044,21228,20949,21894,22534,23598,23836,
+24067,24536,26007,26026,23958,24269,25248,24984,
+25877,26585,27110,26941,28017,30583,31149,30449,
+27748,27316,27056,25442,25176,26732,28605,27407,
+26766,28775,29079,30008,32416,31402,29428,28259,
+29013,29703,30595,30827,30976,30523,29626,29031,
+29329,29202,29054,29711,29686,29431,29553,29840,
+29984,30393,30652,30789,31007,31177,31346,32382,
+32658,32878,33144,32915,32757,31496,31178,31231,
+31068,31049,31537,34004,34059,34059,34441,34441,
+34933,35119,35556,35556,36035,36035,36444,36601,
+36977,36977,37252,37252,37367,37396,37427,37427,
+37387,37387,37349,37334,37297,37297,37275,37275,
+37283,37288,37305,37305,37336,37336,37346,37345,
+37330,37330,37312,37312,37319,37328,37368,37368,
+37424,37424,37405,37385,37311,37311,37267,37267,
+37282,37291,37321,37321,37363,37363,37388,37395,
+37404,37404,37398,37398,37390,37387,37379,37379,
+37353,37353,37337,37333,37329,37329,37300,37300,
+37257,37240,37200,37200,37161,37161,37130,37116,
+37077,37077,37096,37096,37173,37193,37216,37216,
+37174,37174,37128,37105,37040,37040,36970,36970,
+36927,36906,36842,36842,36740,36740,36680,36663,
+36634,36634,36673,36673,36767,36783,36770,36770,
+36233,36233,36213,36216,36256,36256,36265,36265,
+36241,36235,36230,36230,36243,36243,36252,36255,
+36262,36262,36286,36286,36322,36341,36401,36401,
+36492,36492,36502,36494,36442,36442,36409,36409,
+36404,36416,36478,36478,36625,36625,36657,36652,
+36595,36595,36608,36608,36690,36716,36758,36758,
+36764,36764,36760,36757,36742,36742,36739,36739,
+36743,36750,36775,36775,36837,36837,36863,36867,
+36865,36865,36839,36839,36802,36789,36757,36757,
+36727,36727,36697,36684,36649,36649,36595,36595,
+36541,36521,36479,36479,36444,36444,36424,36418,
+36405,36405,36389,36389,36376,36366,36332,36332,
+36268,36268,36193,36158,36060,36060,35976,35976,
+35938,35918,35853,35853,35732,35732,35639,35607,
+35534,35534,35483,35483,35465,35455,35427,35427,
+35381,35381,35313,35284,35208,35208,35193,35193,
+35421,35465,32649,32352,35467,35467,36190,32243,
+31715,31809,31599,31147,30864,31003,30576,29257,
+28246,28443,28413,28452,28689,29207,29810,29648,
+29642,29857,29774,29142,29804,30275,30371,29867,
+29625,29562,29553,29458,29353,29470,29487,29526,
+29729,30165,36512,36406,36254,36254,36312,36312,
+36427,29778,29972,36591,36483,36483,36473,36451,
+36350,36350,36375,36375,36877,37004,37133,37133,
+37112,37112,30687,30275,30427,31045,37521,37521,
+38021,38191,38544,38544,38456,38456,38299,38239,
+38098,38098,37938,37938,37819,37790,37765,37765,
+37833,37833,37852,37851,37828,37828,37762,37762,
+37682,37663,37643,37643,37690,37690,37704,37702,
+37683,37683,37675,37675,37680,37687,37714,37714,
+37775,37775,37791,37791,37770,37770,37763,37763,
+37773,37772,37757,37757,37712,37712,37679,37667,
+37639,37639,37600,37600,37561,37546,37507,37507,
+37456,37456,37427,37420,37406,37406,37373,37373,
+37333,37319,37286,37286,37257,37257,37246,37243,
+37240,37240,37232,37232,37220,37209,37164,37164,
+37073,37073,37039,37034,37042,37042,37040,37040,
+37030,37029,37032,37032,37047,37047,37049,37048,
+37041,37041,36965,36965,36842,36801,36718,36718,
+36672,36672,36653,36650,36653,36653,36630,36630,
+36577,36558,36515,36515,36482,36482,36454,36441,
+36410,36410,36358,36358,36299,36274,36204,36204,
+36125,36125,36002,34051,32689,31906,30627,30803,
+31193,31173,30068,29926,30079,29969,29857,29830,
+29863,29921,30422,30559,30728,30860,30780,30620,
+31127,30892,30995,30784,30460,30697,30972,30578,
+30593,29838,29613,29586,29747,29663,29607,29646,
+29761,29846,29841,29787,29754,30284,30288,30325,
+29924,30007,29929,29974,30325,30419,31197,31806,
+32318,32279,32663,32631,32665,32949,33127,33243,
+33503,33446,33109,32945,32757,32582,32593,32716,
+32695,32868,32838,32740,32920,33347,33593,33334,
+32980,32314,32129,31827,32231,32597,32459,30818,
+30645,36699,31794,33286,33390,34510,34609,32838,
+33321,34610,33827,35315,35189,34806,35402,35234,
+35311,34870,34708,34820,34875,34817,33507,32713,
+34650,34807,35125,35369,35480,35897,36050,34405,
+36267,36267,36407,36462,36600,36600,36585,35009,
+33781,33912,33033,33289,31755,32184,33036,34266,
+33713,31748,31100,33035,32256,33625,33571,33179,
+32711,30587,32431,33281,32972,32659,32034,30803,
+32877,32847,34013,35239,33820,31559,33036,37628,
+37471,36970,36591,37352,38186,36921,36207,36311,
+37516,36060,35719,35611,35059,35027,35021,35434,
+35750,35826,36091,36499,37229,36379,35020,33816,
+33994,32858,28105,27744,26466,21714,22744,24535,
+26438,25963,25093,23838,22650,22561,23007,25977,
+24758,25821,26366,25538,24591,26104,28511,26541,
+25824,25240,25696,26695,26562,26017,27098,27900,
+25319,22189,24998,25794,25424,27103,27883,26300,
+26721,28151,27775,27586,28354,27061,26705,29183,
+30052,29785,30325,30775,30802,31758,30935,29782,
+28816,28666,28834,28771,28618,28791,29501,29617,
+29909,30105,30508,30525,30825,31097,31194,31699,
+31874,31914,31971,31519,31225,31578,31591,31493,
+30946,30565,30569,31625,33100,33100,33630,33630,
+34244,34457,34909,34909,35254,35254,35698,35895,
+36439,36439,36863,36863,37068,37129,37229,37229,
+37238,37238,37231,37226,37211,37211,37202,37202,
+37225,37231,37238,37238,37221,37221,37216,37215,
+37208,37208,37208,37208,37231,37232,37215,37215,
+37111,37111,37042,37020,36983,36983,36952,36952,
+36942,36948,36985,36985,37072,37072,37103,37107,
+37094,37094,37064,37064,37038,37030,37016,37016,
+37007,37007,37017,37025,37057,37057,37046,37046,
+36991,36969,36919,36919,36865,36865,36812,36789,
+36725,36725,36700,36700,36730,36739,36750,36750,
+36737,36737,36701,36679,36611,36611,36555,36555,
+36532,36516,36461,36461,36353,36353,36284,36259,
+36210,36210,36225,36225,36304,36321,36324,36324,
+36233,36233,36213,36216,36256,36256,36265,36265,
+36241,36235,36230,36230,36243,36243,36252,36255,
+36262,36262,36286,36286,36322,36341,36401,36401,
+36492,36492,36502,36494,36442,36442,36409,36409,
+36404,36416,36478,36478,36625,36625,36657,36652,
+36595,36595,36608,36608,36690,36716,36758,36758,
+36764,36764,36760,36757,36742,36742,36739,36739,
+36743,36750,36775,36775,36837,36837,36863,36867,
+36865,36865,36839,36839,36802,36789,36757,36757,
+36727,36727,36697,36684,36649,36649,36595,36595,
+36541,36521,36479,36479,36444,36444,36424,36418,
+36405,36405,36389,36389,36376,36366,36332,36332,
+36268,36268,36193,36158,36060,36060,35976,35976,
+35938,35918,35853,35853,35732,35732,35639,35607,
+35534,35534,35483,35483,35465,35455,35427,35427,
+35381,35381,35313,35284,35208,35208,35193,35193,
+35421,32151,32063,32377,35467,35467,36190,31264,
+31063,31001,30912,30622,30291,30426,29741,28455,
+28254,28708,28487,28414,28326,28231,29454,29212,
+28962,29095,29226,29256,30068,30009,29739,29213,
+28900,28773,28652,28642,28804,29069,29129,29157,
+29089,29302,29449,29565,36254,36254,36312,29217,
+36427,29014,29231,29566,36483,36483,36473,36451,
+36350,36350,36375,36375,36877,29575,37133,37133,
+37112,29877,29537,29253,29560,30445,37521,37521,
+38021,38191,38544,38544,38456,38456,38299,38239,
+38098,38098,37938,37938,37819,37790,37765,37765,
+37833,37833,37852,37851,37828,37828,37762,37762,
+37682,37663,37643,37643,37690,37690,37704,37702,
+37683,37683,37675,37675,37680,37687,37714,37714,
+37775,37775,37791,37791,37770,37770,37763,37763,
+37773,37772,37757,37757,37712,37712,37679,37667,
+37639,37639,37600,37600,37561,37546,37507,37507,
+37456,37456,37427,37420,37406,37406,37373,37373,
+37333,37319,37286,37286,37257,37257,37246,37243,
+37240,37240,37232,37232,37220,37209,37164,37164,
+37073,37073,37039,37034,37042,37042,37040,37040,
+37030,37029,37032,37032,37047,37047,37049,37048,
+37041,37041,36965,36965,36842,36801,36718,36718,
+36672,36672,36653,36650,36653,36653,36630,36630,
+36577,36558,36515,36515,36482,36482,36454,36441,
+36410,36410,36358,36358,36299,36274,36204,36204,
+36125,36125,36002,35970,33627,33202,30327,30714,
+30472,30921,31165,30799,30954,30119,29871,29688,
+29577,29512,30139,30183,30143,30438,30118,30549,
+30399,30558,30339,30398,30304,30475,30089,30032,
+29997,29679,29622,29580,29763,29701,29591,29560,
+29646,29688,29771,29764,29757,29649,30139,30199,
+30083,30085,30005,30087,30328,30492,31247,32299,
+32436,32392,32567,32606,32902,33060,33326,33522,
+33529,33435,33012,32929,32784,32784,32799,32936,
+32758,32960,32924,32792,32878,33224,33708,33705,
+33502,32699,32381,32085,31700,31935,32647,30886,
+31145,31770,31399,33208,33556,34379,34182,33711,
+34300,34330,34369,34710,34842,34840,34798,34915,
+34882,32849,32773,34033,32759,32721,32767,32896,
+32750,32761,33557,33967,34127,35543,35564,34174,
+36267,36267,36407,36462,36600,36496,35868,34724,
+32997,33258,32580,33287,33073,31990,31949,31799,
+33180,31887,31209,32565,32831,33143,33362,33099,
+32159,31074,32996,33003,32841,32768,32106,31541,
+31472,34503,34669,34871,33816,32808,33758,36671,
+36574,34515,35733,36385,35780,36891,36268,36238,
+36158,35829,35732,35587,35042,34520,34760,35186,
+35147,35989,36346,36527,35987,34898,34075,31251,
+30082,28247,25021,24911,25407,21074,22831,24007,
+24281,21545,22776,20845,21151,21390,22835,24526,
+23504,23858,24407,23792,22872,24673,27840,25677,
+24082,23574,25141,25646,26197,25904,25777,25988,
+24678,23193,24695,26630,25466,27192,26758,24966,
+25249,28314,28248,27932,27743,27040,27307,29249,
+29568,29469,30266,30711,30984,31433,31171,30633,
+28777,28134,28299,28070,27521,27600,28987,29508,
+30254,30466,30622,30667,30897,31185,31320,31873,
+31869,31837,31634,31341,31322,31324,31243,31397,
+31355,30992,30929,31549,33100,33100,33630,33630,
+34244,34457,34909,34909,35254,35254,35698,35895,
+36439,36439,36863,36863,37068,37129,37229,37229,
+37238,37238,37231,37226,37211,37211,37202,37202,
+37225,37231,37238,37238,37221,37221,37216,37215,
+37208,37208,37208,37208,37231,37232,37215,37215,
+37111,37111,37042,37020,36983,36983,36952,36952,
+36942,36948,36985,36985,37072,37072,37103,37107,
+37094,37094,37064,37064,37038,37030,37016,37016,
+37007,37007,37017,37025,37057,37057,37046,37046,
+36991,36969,36919,36919,36865,36865,36812,36789,
+36725,36725,36700,36700,36730,36739,36750,36750,
+36737,36737,36701,36679,36611,36611,36555,36555,
+36532,36516,36461,36461,36353,36353,36284,36259,
+36210,36210,36225,36225,36304,36321,36324,36324,
+35832,35832,35838,35850,35906,35906,35915,35915,
+35872,35860,35849,35849,35868,35868,35887,35894,
+35913,35913,35925,35925,35936,35943,35968,35968,
+36019,36019,36021,36014,35975,35975,35946,35946,
+35934,35943,35998,35998,36135,36135,36177,36180,
+36150,36150,36173,36173,36241,36260,36295,36295,
+36298,36298,36298,36297,36292,36292,36298,36298,
+36308,36317,36350,36350,36419,36419,36464,36479,
+36512,36512,36520,36520,36502,36496,36485,36485,
+36481,36481,36470,36466,36447,36447,36410,36410,
+36365,36350,36321,36321,36305,36305,36285,36274,
+36243,36243,36215,36215,36200,36193,36172,36172,
+36138,36138,36071,36035,35924,35924,35807,35807,
+35733,35701,35614,35614,35486,35486,35375,35332,
+35224,35224,35142,35142,35111,35098,35067,35067,
+35031,35031,35003,34996,34988,34988,34998,34998,
+35184,32415,33050,35242,35320,35320,35686,30859,
+30834,30353,30281,30021,29855,29472,28685,27821,
+28456,28643,28482,28186,28083,27903,28518,28426,
+28010,28380,28614,28463,29375,29371,29104,28676,
+28377,28118,28116,28210,28372,28616,28717,28719,
+28776,28743,28726,28686,28758,28696,28487,28475,
+28466,28461,28649,36382,36278,36278,36247,36213,
+36070,36070,36057,36057,36419,28507,28584,28891,
+29091,28939,28817,28688,29101,30144,36710,36710,
+37462,37714,38221,38221,38318,38318,38219,38169,
+38017,38017,37819,37819,37674,37633,37582,37582,
+37601,37601,37595,37589,37559,37559,37512,37512,
+37467,37456,37438,37438,37443,37443,37458,37466,
+37489,37489,37490,37490,37468,37467,37488,37488,
+37568,37568,37591,37591,37569,37569,37560,37560,
+37563,37559,37538,37538,37484,37484,37456,37448,
+37434,37434,37412,37412,37387,37378,37349,37349,
+37308,37308,37284,37276,37263,37263,37217,37217,
+37154,37134,37097,37097,37091,37091,37078,37071,
+37049,37049,37025,37025,37003,36988,36937,36937,
+36849,36849,36823,36822,36839,36839,36831,36831,
+36801,36796,36796,36796,36828,36828,36836,36835,
+36823,36823,36753,36753,36641,36604,36528,36528,
+36484,36484,36469,36467,36476,36476,36463,36463,
+36424,36408,36369,36369,36326,36326,36305,36299,
+36293,36293,36264,36264,36220,36199,36132,36132,
+36031,36031,35930,35894,35813,33533,31445,30607,
+30233,29857,30010,29734,30642,30257,29856,29854,
+29486,29315,29761,29669,29605,29760,30109,30268,
+30345,30319,30136,30076,30047,29969,29884,29865,
+29976,29757,29596,29504,29671,29687,29602,29503,
+29557,29572,29312,29698,29630,29641,29493,29685,
+30028,29790,29707,30133,30452,30751,31355,32319,
+32549,32447,32595,32779,33114,33511,33863,33850,
+33549,33333,32944,32851,32690,32691,32698,32752,
+32871,32941,32979,32916,32940,33136,33452,33920,
+33799,33007,32644,32476,32017,33026,32801,31409,
+31843,32346,31576,31782,32400,34235,34220,32438,
+33780,34397,34347,34417,34634,34146,32636,32464,
+34368,32461,32584,32638,32767,32767,32736,32931,
+32773,32806,33193,33412,33420,33790,35356,35425,
+35001,33361,36248,36299,36037,35986,34940,33823,
+32542,32156,31653,32166,32803,31570,33030,31635,
+33292,32712,31520,31743,33253,32623,35033,34663,
+31214,31382,33154,32792,32881,32605,32325,31970,
+33154,34098,34238,34301,33301,31680,31620,33263,
+34583,34758,35258,34153,34743,36716,36533,35910,
+35731,35462,35558,35755,35314,34776,33885,34219,
+34742,35998,36379,36189,35365,33945,32136,27376,
+25516,24561,21911,21857,21522,22217,22933,22962,
+21546,20174,20529,23068,21520,24080,22275,22206,
+22380,22207,23538,22418,22066,25550,24729,24633,
+23698,23611,25150,24307,24440,25427,25008,23851,
+22753,23387,24882,24841,24861,26239,26964,25016,
+25907,28451,28523,28487,28422,26841,27318,29334,
+29129,29040,30435,30803,30942,31106,31025,30740,
+28967,27947,27697,27240,26914,26760,28599,29584,
+30286,30462,30627,30792,30931,31184,31390,31727,
+31704,31888,31487,31344,31262,31219,31196,31574,
+32027,32152,31729,32150,32330,32330,32927,32927,
+33569,33801,34322,34322,34759,34759,35247,35456,
+36014,36014,36466,36466,36718,36800,36956,36956,
+37026,37026,37061,37069,37071,37071,37061,37061,
+37082,37087,37091,37091,37072,37072,37063,37060,
+37052,37052,37056,37056,37086,37084,37044,37044,
+36891,36891,36806,36784,36755,36755,36717,36717,
+36690,36689,36715,36715,36800,36800,36825,36825,
+36800,36800,36761,36761,36726,36716,36700,36700,
+36698,36698,36715,36725,36760,36760,36760,36760,
+36718,36701,36655,36655,36595,36595,36534,36506,
+36431,36431,36384,36384,36390,36392,36393,36393,
+36382,36382,36348,36329,36267,36267,36213,36213,
+36183,36166,36110,36110,36013,36013,35949,35926,
+35878,35878,35862,35862,35889,35893,35885,35885,
+35679,35679,35688,35700,35753,35753,35760,35760,
+35719,35710,35704,35704,35732,35732,35757,35766,
+35786,35786,35791,35791,35788,35789,35797,35797,
+35827,35827,35826,35821,35796,35796,35771,35771,
+35757,35762,35809,35809,35935,35935,35979,35986,
+35972,35972,35998,35998,36055,36073,36104,36104,
+36111,36111,36119,36122,36130,36130,36145,36145,
+36162,36173,36208,36208,36270,36270,36322,36342,
+36394,36394,36415,36415,36400,36395,36386,36386,
+36383,36383,36377,36373,36360,36360,36334,36334,
+36300,36290,36268,36268,36259,36259,36233,36218,
+36172,36172,36128,36128,36103,36095,36082,36082,
+36079,36079,36024,35991,35880,35880,35754,35754,
+35663,35626,35529,35529,35401,35401,35284,35237,
+35119,35119,35025,35025,34989,34975,34942,34942,
+34907,34907,34894,34895,34912,34912,34963,34963,
+31733,31642,33145,35171,35232,35232,31898,31405,
+30801,30933,29852,29307,28966,28538,28279,27709,
+27484,27546,27496,27755,27392,27375,27673,27354,
+27650,28256,28274,28445,28597,28492,28526,28233,
+27999,27839,27480,27340,27361,27605,27847,27882,
+27869,27929,27958,27859,27749,27620,27477,27481,
+27507,27348,27191,27089,27053,27060,27097,27152,
+27179,27294,27404,27471,27549,27776,27804,27845,
+28112,28188,28123,28067,28761,35735,36508,36508,
+37236,37490,38030,38030,38232,38232,38188,38151,
+38012,38012,37813,37813,37664,37620,37553,37553,
+37540,37540,37518,37507,37475,37475,37440,37440,
+37419,37410,37389,37389,37360,37360,37373,37384,
+37430,37430,37438,37438,37403,37399,37415,37415,
+37500,37500,37524,37525,37505,37505,37492,37492,
+37486,37480,37456,37456,37407,37407,37386,37381,
+37377,37377,37360,37360,37338,37329,37302,37302,
+37265,37265,37241,37233,37216,37216,37163,37163,
+37091,37069,37031,37031,37033,37033,37020,37011,
+36983,36983,36950,36950,36920,36904,36853,36853,
+36776,36776,36755,36754,36771,36771,36758,36758,
+36721,36713,36707,36707,36735,36735,36740,36738,
+36723,36723,36660,36660,36563,36531,36464,36464,
+36424,36424,36410,36408,36413,36413,36398,36398,
+36362,36347,36309,36309,36266,36266,36247,36243,
+36241,36241,36217,36217,36176,36156,36091,36091,
+35988,35988,35894,35862,33220,32278,31061,30116,
+29461,29412,29693,29607,29806,29698,30017,29731,
+29187,28934,29179,29328,29203,29384,29476,29604,
+29907,29868,29950,29787,29717,29697,29776,29790,
+29845,30029,29966,29844,29688,29640,29565,29463,
+29414,29402,29386,29344,29401,29464,29348,29410,
+29266,29327,29662,30247,30667,31145,31720,31966,
+32289,33149,33550,33946,35459,35459,35518,35518,
+33727,33245,32880,32777,32561,32795,32940,33059,
+33202,33127,33015,33100,33021,33105,33208,33305,
+33583,35171,35256,34530,33637,33288,33126,33139,
+33992,32338,32301,32715,32678,33717,33930,33876,
+33583,33826,34126,33852,32910,32648,32089,33757,
+33682,32255,33659,33758,32585,32565,32493,32632,
+32843,32970,33318,34248,34453,34175,34107,34167,
+34164,33817,35031,35021,34386,33268,30348,30366,
+30817,30635,32213,31212,29801,31826,32146,32223,
+32832,32494,32418,32727,32783,32425,31867,34092,
+31456,32856,32352,33086,31987,31968,31631,32733,
+33561,33049,33210,33091,33217,32591,29632,29713,
+30912,33595,34348,32723,33822,36313,35417,35836,
+35548,35775,35900,35118,34887,34764,33709,33607,
+35085,34717,33652,32061,28673,25756,23653,21466,
+24196,23958,23367,21792,19471,20244,20123,20262,
+24105,24262,22799,23111,23035,22609,22332,23262,
+22079,22781,22486,23149,23728,22858,23138,22053,
+22211,22395,23347,22301,22611,24039,24258,23424,
+23694,23567,23865,24242,25628,26168,25178,24726,
+25343,27412,27732,28708,27655,27343,26107,27970,
+28729,29101,29424,29745,30126,30118,29750,29775,
+29789,29381,28848,27549,27160,27184,28248,28963,
+29627,29936,30095,30241,30610,30867,30812,30365,
+30283,31036,32157,32045,31989,32300,32134,32125,
+32458,32118,32132,31906,32100,32100,32699,32699,
+33323,33558,34113,34113,34637,34637,35143,35350,
+35878,35878,36309,36309,36563,36646,36808,36808,
+36892,36892,36943,36955,36965,36965,36957,36957,
+36978,36984,36996,36996,36993,36993,36991,36989,
+36981,36981,36986,36986,37013,37011,36974,36974,
+36830,36830,36747,36723,36690,36690,36648,36648,
+36615,36612,36630,36630,36704,36704,36721,36719,
+36692,36692,36651,36651,36617,36606,36589,36589,
+36588,36588,36602,36611,36641,36641,36643,36643,
+36612,36597,36557,36557,36499,36499,36437,36410,
+36335,36335,36286,36286,36288,36287,36284,36284,
+36267,36267,36234,36216,36160,36160,36102,36102,
+36064,36046,35988,35988,35898,35898,35841,35820,
+35776,35776,35748,35748,35747,35743,35723,35723,
+35327,35327,35336,35345,35382,35382,35388,35388,
+35358,35354,35365,35365,35423,35423,35462,35473,
+35496,35496,35480,35480,35441,35426,35392,35392,
+35370,35370,35366,35367,35375,35375,35367,35367,
+35342,35343,35371,35371,35459,35459,35508,35524,
+35552,35552,35587,35587,35617,35628,35651,35651,
+35673,35673,35703,35716,35758,35758,35804,35804,
+35838,35852,35889,35889,35934,35934,36001,36033,
+36130,36130,36181,36181,36173,36170,36163,36163,
+36154,36154,36151,36151,36149,36149,36150,36150,
+36152,36153,36153,36153,36156,36156,36114,36088,
+35999,35999,35912,35912,35855,35844,35850,35850,
+35931,35931,35916,35891,35784,35784,35636,35636,
+35507,35457,35338,35338,35209,35209,35080,35025,
+34880,34880,34762,34762,34716,34699,34660,34660,
+34625,34625,34648,34668,34742,34742,34911,32366,
+31266,32082,35015,35015,35005,32662,32372,31579,
+31113,30641,29625,29204,28661,28341,27992,27494,
+27274,27211,27344,27762,27299,27326,27269,27310,
+27635,28050,28207,28544,28428,28197,28461,27961,
+27707,27516,27063,26919,26953,27142,27252,27264,
+27474,27555,27558,27388,27285,27198,27139,27113,
+27116,26793,26597,26539,26590,26636,26725,26842,
+26855,26921,27045,27098,27148,27499,27604,27661,
+27738,27772,27636,27631,28264,35735,36118,36118,
+36706,36942,37537,37537,38011,38011,38114,38115,
+38019,38019,37827,37827,37673,37621,37514,37514,
+37416,37416,37354,37334,37294,37294,37292,37292,
+37328,37329,37299,37299,37177,37177,37181,37203,
+37307,37307,37330,37330,37261,37249,37253,37253,
+37347,37347,37379,37382,37366,37366,37339,37339,
+37307,37296,37267,37267,37238,37238,37236,37239,
+37257,37257,37255,37255,37234,37225,37204,37204,
+37175,37175,37150,37140,37112,37112,37041,37041,
+36949,36922,36882,36882,36903,36903,36889,36878,
+36832,36832,36778,36778,36727,36708,36660,36660,
+36614,36614,36606,36607,36622,36622,36597,36597,
+36542,36526,36503,36503,36515,36515,36508,36504,
+36481,36481,36437,36437,36381,36361,36321,36321,
+36297,36297,36280,36275,36267,36267,36248,36248,
+36217,36205,36171,36171,36126,36126,36110,36109,
+36117,36117,36099,36099,36065,36047,35986,35986,
+35881,35881,35805,35785,33763,32356,31350,31238,
+30683,29154,29173,29141,29947,29568,29425,29850,
+28920,28608,28971,29222,29186,29308,29485,29598,
+29698,29780,29940,29874,29785,29793,29806,29785,
+29886,29900,29905,29830,29635,29520,29516,29487,
+29368,29336,29335,29375,29388,29289,29194,29175,
+29241,29315,29579,30334,30513,31145,31869,32422,
+35093,35087,35083,35083,35278,35278,35346,35353,
+33614,33150,32850,32728,32513,32781,32979,33178,
+33100,33053,33119,33430,33293,33566,33959,34879,
+34939,34970,35064,35064,34441,34163,33492,33201,
+35407,35407,35511,35511,35565,33932,34031,34083,
+33212,33828,33948,32962,31907,32054,33682,33451,
+33348,33320,33352,33133,33329,32636,32541,33523,
+33670,33090,35121,34683,34568,33876,33976,34073,
+33844,33966,34716,34417,32936,30461,27729,27308,
+28749,30511,31964,30777,30336,32138,30568,31452,
+32119,31051,32503,32488,32134,32260,31930,32371,
+32262,32452,31832,32883,33368,32120,32935,33038,
+33097,32903,33036,33152,33022,32369,31263,31495,
+31773,31748,33464,32316,33537,35680,34994,35767,
+35063,35200,35625,35169,34668,34295,33485,33461,
+34717,34720,32944,31141,26052,22040,21074,25244,
+25076,23612,20870,21923,20976,23320,23264,21080,
+24683,24566,23969,22751,22762,22057,22795,22744,
+22137,24140,22611,22860,22064,23059,24322,23323,
+24145,22553,22294,22327,23809,22860,22944,23369,
+25026,25105,25674,24724,23879,24316,24371,24973,
+25270,25634,26128,27544,27587,25945,25285,27006,
+27890,28979,29479,29289,29611,29823,29546,29370,
+28990,28517,27915,27049,27325,26932,27360,28300,
+29202,29768,29877,30045,30424,30475,30533,29943,
+29953,30548,31542,31466,31598,32292,32316,32207,
+31621,32424,32325,31388,31613,31613,32198,32198,
+32759,32999,33636,33636,34401,34401,34955,35151,
+35581,35581,35940,35940,36185,33064,36436,36436,
+36546,36546,36628,36650,36677,36677,36677,36677,
+36702,36714,36748,36748,36794,36794,36812,36814,
+36806,36806,36812,36812,36835,36835,36807,36807,
+36703,36703,36631,36606,36557,36557,36501,36501,
+36457,36448,36445,36445,36484,36484,36484,36477,
+36443,36443,36401,36401,36367,36356,36337,36337,
+36336,36336,36342,36346,36358,36358,36366,36366,
+36363,36358,36335,36335,36279,36279,36219,36193,
+36121,36121,36071,36071,36067,36063,36051,36051,
+36017,36017,35983,35967,35924,35924,35864,35864,
+35800,35776,35713,35713,35642,35642,35601,35588,
+35560,35560,35499,35499,35427,35403,35353,35353,
+35327,35327,35336,35345,35382,35382,35388,35388,
+35358,35354,35365,35365,35423,35423,35462,35473,
+35496,35496,35480,35480,35441,35426,35392,35392,
+35370,35370,35366,35367,35375,35375,35367,35367,
+35342,35343,35371,35371,35459,35459,35508,35524,
+35552,35552,35587,35587,35617,35628,35651,35651,
+35673,35673,35703,35716,35758,35758,35804,35804,
+35838,35852,35889,35889,35934,35934,36001,36033,
+36130,36130,36181,36181,36173,36170,36163,36163,
+36154,36154,36151,36151,36149,36149,36150,36150,
+36152,36153,36153,36153,36156,36156,36114,36088,
+35999,35999,35912,35912,35855,35844,35850,35850,
+35931,35931,35916,35891,35784,35784,35636,35636,
+35507,35457,35338,35338,35209,35209,35080,35025,
+34880,34880,34762,34762,34716,34699,34660,34660,
+34625,34625,34648,34668,34742,34742,32149,31314,
+31038,32220,35015,31965,32436,32577,31849,31493,
+30945,30646,29781,29427,28917,28364,28049,27447,
+27515,27184,27335,27273,27262,27218,26841,27216,
+27356,27852,28101,28498,28319,28134,27999,27665,
+27365,27173,26680,26578,26665,26799,26838,26861,
+26991,27083,27004,26934,26903,26841,26741,26710,
+26728,26440,26214,26118,26201,26189,26238,26445,
+26499,26573,26637,26691,26756,26943,27076,27172,
+27240,27255,27341,27298,27694,28532,36118,36118,
+36706,36942,37537,37537,38011,38011,38114,38115,
+38019,38019,37827,37827,37673,37621,37514,37514,
+37416,37416,37354,37334,37294,37294,37292,37292,
+37328,37329,37299,37299,37177,37177,37181,37203,
+37307,37307,37330,37330,37261,37249,37253,37253,
+37347,37347,37379,37382,37366,37366,37339,37339,
+37307,37296,37267,37267,37238,37238,37236,37239,
+37257,37257,37255,37255,37234,37225,37204,37204,
+37175,37175,37150,37140,37112,37112,37041,37041,
+36949,36922,36882,36882,36903,36903,36889,36878,
+36832,36832,36778,36778,36727,36708,36660,36660,
+36614,36614,36606,36607,36622,36622,36597,36597,
+36542,36526,36503,36503,36515,36515,36508,36504,
+36481,36481,36437,36437,36381,36361,36321,36321,
+36297,36297,36280,36275,36267,36267,36248,36248,
+36217,36205,36171,36171,36126,36126,36110,36109,
+36117,36117,36099,36099,36065,36047,35986,35986,
+35881,35881,35805,35785,35756,33448,32208,32222,
+31879,30846,29831,28353,28645,29170,29909,29242,
+28523,28667,29037,29007,28696,29265,29282,29449,
+29593,29683,29830,29907,29911,29824,29829,29792,
+29910,29943,29925,30217,29715,29550,29505,29441,
+29304,29270,29292,29406,29395,29357,29264,29364,
+29298,29206,29224,30231,30859,31219,32408,35121,
+35093,35087,35083,35083,35278,35278,35346,35353,
+33873,33501,32741,32835,32737,32727,32937,33120,
+33134,33168,33265,34987,34911,34911,34879,34879,
+34939,34970,35064,35064,35219,35219,35315,35346,
+35407,35407,35511,35511,35565,34347,33896,34786,
+33386,33973,32504,33148,33645,33750,33496,33161,
+33129,33240,33226,32012,33913,33858,33923,33304,
+33983,34479,35098,34596,34433,33923,33906,33479,
+33945,33913,34687,33715,28616,26153,25679,27776,
+30007,30710,30169,29852,31313,31231,30358,30612,
+30563,32888,32233,31308,31749,31842,31236,30838,
+33441,31861,31505,31605,31718,32585,32891,32814,
+32860,32868,32135,32228,32845,32314,31525,31121,
+31393,31956,33816,33272,34084,35683,35094,35958,
+34977,34949,35271,35291,34863,34621,33865,34311,
+34931,33910,31721,26650,23289,25077,24825,25363,
+21690,20647,20511,20549,20478,24004,24320,21718,
+22956,24698,21421,23763,24027,22483,23266,22545,
+23728,21372,24312,23902,23304,22426,22588,23451,
+23860,23228,22764,24005,23882,22282,22151,22063,
+24073,24060,24353,23073,22196,22799,23862,24043,
+24723,25795,25035,26984,27148,26722,26382,25500,
+27412,28631,29337,29041,29187,29689,29599,29193,
+27811,26999,26635,26912,26985,26720,27003,28220,
+28928,29532,29555,29743,30138,30184,30248,30398,
+30656,31096,31005,31091,31172,31883,31966,32190,
+32188,32108,31859,31388,31613,31613,32198,32198,
+32759,32999,33636,33636,34401,34401,34955,35151,
+35581,35581,35940,35940,36185,31863,32402,36436,
+36546,36546,36628,36650,36677,36677,36677,36677,
+36702,36714,36748,36748,36794,36794,36812,36814,
+36806,36806,36812,36812,36835,36835,36807,36807,
+36703,36703,36631,36606,36557,36557,36501,36501,
+36457,36448,36445,36445,36484,36484,36484,36477,
+36443,36443,36401,36401,36367,36356,36337,36337,
+36336,36336,36342,36346,36358,36358,36366,36366,
+36363,36358,36335,36335,36279,36279,36219,36193,
+36121,36121,36071,36071,36067,36063,36051,36051,
+36017,36017,35983,35967,35924,35924,35864,35864,
+35800,35776,35713,35713,35642,35642,35601,35588,
+35560,35560,35499,35499,35427,35403,35353,35353,
+34971,34971,34970,34975,35003,35003,35002,35002,
+34969,34965,34968,34968,35015,35015,35051,35064,
+35090,35090,35072,35072,35024,35006,34960,34960,
+34921,34921,34924,34932,34965,34965,34965,34965,
+34931,34924,34917,34917,34940,34940,34983,35005,
+35070,35070,35119,35119,35135,35142,35162,35162,
+35190,35190,35227,35244,35291,35291,35346,35346,
+35396,35414,35456,35456,35491,35491,35565,35604,
+35724,35724,35798,35798,35803,35805,35808,35808,
+35809,35809,35814,35816,35819,35819,35837,35837,
+35863,35872,35885,35885,35890,35890,35858,35838,
+35765,35765,35682,35682,35614,35600,35596,35596,
+35673,35673,35657,35633,35530,35530,35397,35397,
+35286,35242,35132,35132,35007,35007,34857,34791,
+34605,34605,34458,34458,34408,34393,34369,34369,
+34382,34382,34465,34499,34584,34584,31257,29918,
+30438,31557,31446,31516,31577,31374,31038,30201,
+29668,30197,29909,29193,28379,28068,27883,27938,
+27359,27274,26954,27221,26865,26586,27019,27169,
+27124,27474,27819,27965,27554,27363,27056,26644,
+26540,26403,26255,26201,26189,26298,26310,26198,
+26129,26091,26025,26091,26054,25968,25997,25999,
+26061,26011,25834,25604,25392,25361,25407,25719,
+25880,25975,26047,26097,26043,26099,26104,26078,
+26430,26566,26735,26924,27022,27411,36003,36003,
+36370,36498,36770,36770,37271,37271,37580,37681,
+37879,37879,37845,37845,37686,37622,37459,37459,
+37253,37253,37150,37123,37091,37091,37118,37118,
+37188,37196,37164,37164,37002,37002,36993,37014,
+37130,37130,37153,37153,37073,37057,37056,37056,
+37159,37159,37191,37195,37178,37178,37143,37143,
+37102,37089,37058,37058,37034,37034,37038,37044,
+37070,37070,37068,37068,37041,37030,37005,37005,
+36981,36981,36955,36943,36909,36909,36840,36840,
+36756,36731,36690,36690,36696,36696,36669,36652,
+36596,36596,36521,36521,36450,36427,36388,36388,
+36382,36382,36382,36381,36381,36381,36355,36355,
+36311,36297,36264,36264,36246,36246,36224,36215,
+36187,36187,36165,36165,36146,36138,36119,36119,
+36100,36100,36087,36082,36072,36072,36058,36058,
+36042,36032,36002,36002,35945,35945,35919,35914,
+35915,35915,35903,35903,35882,35872,35836,35836,
+35758,35758,35721,35713,35706,35706,32946,32676,
+32512,32452,32139,31795,29082,28534,28889,28985,
+28841,28220,28817,28452,28424,29657,29891,28733,
+28828,29118,29076,29481,29630,29677,29873,30435,
+30288,30220,30215,30294,30103,29982,29898,29501,
+29447,29423,29370,29428,29327,29850,30038,30249,
+31362,31448,31421,32038,32635,33284,35060,35060,
+35046,35042,35036,35036,35072,35072,35129,35146,
+35174,34014,33321,32841,32107,33891,34836,34836,
+34844,34844,34914,34919,34877,34877,34860,34860,
+34901,34926,35016,35016,35187,35187,35290,35323,
+35384,35384,35484,35484,35543,34916,34544,34368,
+33542,32382,32716,32482,33920,33797,33213,33093,
+32967,32988,33134,32262,33674,33753,32624,33133,
+34341,34824,33714,33585,33959,34203,34101,34132,
+34599,34822,34504,26540,25872,25489,25898,28888,
+30424,29980,30038,31057,30111,29496,29405,31132,
+31229,31595,30159,31008,31340,31796,32290,31117,
+32311,32215,33055,32894,32819,31936,32689,32141,
+31972,32487,32343,30630,29875,31174,31132,31413,
+31257,30099,31281,32109,34372,35235,34858,34802,
+34422,35328,35255,35108,35241,35207,34963,34404,
+32595,24035,21020,19628,20028,20848,21180,24545,
+21405,24538,23026,22944,25139,25040,24960,22925,
+25218,21985,21735,22039,22292,22395,21663,20804,
+21265,22133,22127,23317,22726,22679,22764,21973,
+21618,21727,22046,22068,21574,22076,23077,23254,
+25208,24153,23838,22332,22154,23072,23453,23132,
+23199,24850,25085,25802,25618,24418,25445,24280,
+25414,26737,27796,27765,27721,27004,26865,26853,
+27136,27288,27306,27900,28214,28319,29008,29304,
+29436,29664,29607,29744,30156,30571,30412,30607,
+30501,30685,30459,30680,30806,31282,31299,31324,
+30994,30769,30519,30882,31102,31102,31641,31641,
+32173,32415,33094,33094,33982,33982,34564,34757,
+35140,35140,35407,35407,35534,30249,30074,31580,
+35953,35953,36132,36185,36277,36277,36313,36313,
+36334,36354,36437,36437,36609,36609,36657,36657,
+36606,36606,36585,36585,36602,36598,36566,36566,
+36472,36472,36409,36387,36343,36343,36294,36294,
+36249,36237,36220,36220,36231,36231,36216,36204,
+36164,36164,36117,36117,36078,36066,36044,36044,
+36046,36046,36047,36047,36041,36041,36053,36053,
+36072,36073,36059,36059,36003,36003,35951,35929,
+35874,35874,35827,35827,35812,35802,35769,35769,
+35709,35709,35664,35646,35605,35605,35548,35548,
+35495,35474,35429,35429,35386,35386,35363,35354,
+35336,35336,35249,35249,35124,35084,35006,35006,
+34971,34971,34970,34975,35003,35003,35002,35002,
+34969,34965,34968,34968,35015,35015,35051,35064,
+35090,35090,35072,35072,35024,35006,34960,34960,
+34921,34921,34924,34932,34965,34965,34965,34965,
+34931,34924,34917,34917,34940,34940,34983,35005,
+35070,35070,35119,35119,35135,35142,35162,35162,
+35190,35190,35227,35244,35291,35291,35346,35346,
+35396,35414,35456,35456,35491,35491,35565,35604,
+35724,35724,35798,35798,35803,35805,35808,35808,
+35809,35809,35814,35816,35819,35819,35837,35837,
+35863,35872,35885,35885,35890,35890,35858,35838,
+35765,35765,35682,35682,35614,35600,35596,35596,
+35673,35673,35657,35633,35530,35530,35397,35397,
+35286,35242,35132,35132,35007,35007,34857,34791,
+34605,34605,34458,34458,34408,34393,34369,34369,
+34382,34382,34465,34499,34584,34584,30743,29182,
+30310,30891,31083,31319,31174,31139,30977,30552,
+30213,30214,29594,29226,28256,28540,28284,27561,
+27096,27142,26810,26734,26365,26237,27067,27174,
+27138,27170,27418,27203,27006,26862,26665,26569,
+26478,26304,26184,26089,25951,26106,26206,25979,
+25898,25890,25820,25768,25697,25635,25485,25503,
+25583,25528,25560,25447,25077,25005,25127,25479,
+25573,25532,25571,25588,25603,25647,25670,25765,
+26207,26337,26383,26690,26812,27007,27975,28519,
+36370,36498,36770,36770,37271,37271,37580,37681,
+37879,37879,37845,37845,37686,37622,37459,37459,
+37253,37253,37150,37123,37091,37091,37118,37118,
+37188,37196,37164,37164,37002,37002,36993,37014,
+37130,37130,37153,37153,37073,37057,37056,37056,
+37159,37159,37191,37195,37178,37178,37143,37143,
+37102,37089,37058,37058,37034,37034,37038,37044,
+37070,37070,37068,37068,37041,37030,37005,37005,
+36981,36981,36955,36943,36909,36909,36840,36840,
+36756,36731,36690,36690,36696,36696,36669,36652,
+36596,36596,36521,36521,36450,36427,36388,36388,
+36382,36382,36382,36381,36381,36381,36355,36355,
+36311,36297,36264,36264,36246,36246,36224,36215,
+36187,36187,36165,36165,36146,36138,36119,36119,
+36100,36100,36087,36082,36072,36072,36058,36058,
+36042,36032,36002,36002,35945,35945,35919,35914,
+35915,35915,35903,35903,35882,35872,35836,35836,
+35758,35758,35721,35713,35706,35706,34576,33482,
+32713,32200,31808,31583,30352,29323,29150,29966,
+29511,28783,29697,28999,28866,29324,29261,29657,
+28841,28657,29110,29396,29159,29674,30099,30174,
+30256,30310,30159,30119,30161,30162,30096,29895,
+29817,29546,29704,29713,29451,30081,30412,30523,
+31939,32155,32345,34955,34996,34996,35060,35060,
+35046,35042,35036,35036,35072,35072,35129,35146,
+35174,35174,33645,33144,33174,34793,34836,34836,
+34844,34844,34914,34919,34877,34877,34860,34860,
+34901,34926,35016,35016,35187,35187,35290,35323,
+35384,35384,35484,35484,35543,35553,34641,34210,
+33448,32527,32841,32339,33803,33760,33227,33061,
+32710,31337,33048,32516,32949,32326,32641,34388,
+34091,34111,33689,33724,34073,34450,34157,33929,
+34242,33837,32436,25895,25420,25491,26002,26152,
+28591,28548,29987,30516,30593,30288,30589,29571,
+30708,30453,30940,30956,31137,32372,30481,30407,
+32612,32898,32831,32690,32826,32877,32487,31799,
+29576,31566,31013,31994,29261,29806,28691,31177,
+31317,31225,30327,31039,33480,35226,35161,34800,
+33833,33654,34196,35521,35772,35459,34055,32440,
+28008,22017,20728,19531,20240,20487,23526,24322,
+21196,24133,24602,25201,23741,23884,23573,23556,
+22476,22172,21411,21813,21424,21766,22856,22341,
+20493,21477,21361,21790,20865,21726,21641,20266,
+21316,20456,21554,21882,22193,21773,23035,22862,
+23792,22908,22296,22314,22258,22887,22618,22812,
+22957,24314,24311,25281,23816,23984,24093,23276,
+24873,25767,26999,27064,27080,26813,27123,27496,
+27995,28245,28382,28314,28347,28559,29235,29482,
+29486,30010,29448,29315,30379,30716,30215,30237,
+30279,30294,30401,30476,30607,30991,31094,30998,
+30774,30089,30817,30882,31102,31102,31641,31641,
+32173,32415,33094,33094,33982,33982,34564,34757,
+35140,35140,35407,35407,32007,29947,29499,30681,
+35953,35953,36132,36185,36277,36277,36313,36313,
+36334,36354,36437,36437,36609,36609,36657,36657,
+36606,36606,36585,36585,36602,36598,36566,36566,
+36472,36472,36409,36387,36343,36343,36294,36294,
+36249,36237,36220,36220,36231,36231,36216,36204,
+36164,36164,36117,36117,36078,36066,36044,36044,
+36046,36046,36047,36047,36041,36041,36053,36053,
+36072,36073,36059,36059,36003,36003,35951,35929,
+35874,35874,35827,35827,35812,35802,35769,35769,
+35709,35709,35664,35646,35605,35605,35548,35548,
+35495,35474,35429,35429,35386,35386,35363,35354,
+35336,35336,35249,35249,35124,35084,35006,35006,
+34731,34731,34716,34720,34754,34754,34751,34751,
+34705,34691,34667,34667,34660,34660,34675,34684,
+34716,34716,34716,34716,34694,34686,34667,34667,
+34660,34660,34679,34690,34725,34725,34722,34722,
+34684,34669,34629,34629,34580,34580,34602,34623,
+34703,34703,34766,34766,34789,34798,34819,34819,
+34844,34844,34866,34874,34891,34891,34931,34931,
+34987,35007,35054,35054,35096,35096,35168,35204,
+35312,35312,35387,35387,35411,35420,35439,35439,
+35463,35463,35474,35476,35474,35474,35490,35490,
+35520,35529,35541,35541,35537,35537,35540,35543,
+35549,35549,35527,35527,35480,35464,35423,35423,
+35387,35387,35324,35290,35183,35183,35096,35096,
+35062,35042,34971,34971,34849,34849,34681,34603,
+34377,34377,34209,34209,34171,34167,34181,34181,
+34253,34253,34424,34473,34550,34550,29737,30672,
+30443,29891,30123,30450,30428,30785,30728,30503,
+30518,30485,30053,29359,28747,28091,27688,27005,
+26427,26904,26836,26363,25482,25604,26823,26958,
+26908,26839,26974,26842,26533,26406,26291,26380,
+26295,26128,25977,25882,25755,25699,25675,25676,
+25547,25510,25503,25501,25422,25361,25189,25218,
+25253,25156,25103,24999,24672,24599,24758,25146,
+25199,25172,25198,25184,25156,25211,25279,25421,
+25923,26062,26192,26620,26767,26719,27147,27448,
+28002,36263,36414,36414,36158,36158,36548,36749,
+37366,37366,37668,37668,37575,37522,37355,37355,
+37097,37097,36980,36955,36946,36946,36986,36986,
+37049,37058,37039,37039,36913,36913,36891,36899,
+36960,36960,36960,36960,36896,36884,36893,36893,
+36996,36996,37025,37026,37000,37000,36968,36968,
+36944,36933,36905,36905,36865,36865,36856,36857,
+36873,36873,36856,36856,36815,36800,36769,36769,
+36744,36744,36717,36706,36673,36673,36627,36627,
+36582,36564,36522,36522,36475,36475,36425,36404,
+36347,36347,36262,36262,36178,36155,36123,36123,
+36150,36150,36147,36140,36111,36111,36095,36095,
+36093,36088,36061,36061,36007,36007,35972,35961,
+35936,35936,35924,35924,35924,35922,35909,35909,
+35885,35885,35877,35876,35880,35880,35882,35882,
+35882,35877,35848,35848,35774,35774,35729,35716,
+35698,35698,35687,35687,35690,35689,35684,35684,
+35652,35652,35635,35629,35615,35615,35512,34814,
+34117,32349,31820,31342,30310,29671,29434,29500,
+28683,29113,29262,29009,29191,29227,29467,29408,
+29136,29064,28690,29019,29928,29955,30082,29898,
+30068,30271,30286,30173,30259,30324,30257,30050,
+29945,29866,29865,29697,29495,30358,30831,34849,
+34876,34876,34873,34879,34910,34910,34915,34915,
+34923,34924,34919,34919,34923,34923,34933,34932,
+34919,34919,34704,34704,34645,34650,34731,34731,
+34738,34738,34769,34781,34809,34809,34821,34821,
+34825,34842,34924,34924,35120,35120,35234,35269,
+35332,35332,35428,35428,35503,35520,34424,33649,
+33376,33636,32485,33234,33230,33191,32647,32595,
+31513,31639,33003,33223,33480,32407,32841,33962,
+33686,33726,33485,33790,34241,33410,33175,33091,
+32427,31168,27990,25506,25432,25515,28410,29313,
+30055,29670,30132,30008,29457,29595,30246,29437,
+29234,29076,30402,30004,30326,30767,31413,29966,
+32594,32596,32421,31747,31920,31667,30915,30671,
+28760,29925,29970,30432,29292,26488,25992,29335,
+30723,30159,29914,32385,34164,34936,34235,34453,
+33733,33430,34100,35380,34559,33635,32652,30102,
+26194,19507,19688,20918,19836,20181,20625,23814,
+21381,21639,23821,24473,25083,24861,24505,22712,
+24475,21019,20219,21113,20799,20612,23118,21508,
+21092,20204,21516,21735,20686,20595,19436,20084,
+20164,21483,22217,21907,21978,22307,22167,20861,
+22226,22348,23007,22463,22737,21915,21259,21804,
+22562,22862,22905,23725,23401,23489,23600,23049,
+24946,25856,26215,26578,27018,27406,28107,28512,
+28089,28077,28202,28339,28661,28669,29168,29274,
+29324,29641,29073,29057,30122,29800,29801,30379,
+30310,30315,30934,31076,30971,30847,30546,30786,
+30216,30325,30452,30512,30689,30689,31160,31160,
+31705,31942,32582,32582,33425,33425,34068,34289,
+34750,34750,34941,31338,31372,29900,29507,30632,
+35684,31063,31139,36007,36139,36139,36192,36192,
+36072,36074,36203,36203,36507,36507,36548,36527,
+36382,36382,36333,36333,36365,36364,36326,36326,
+36210,36210,36138,36119,36092,36092,36061,36061,
+36030,36021,36013,36013,36016,36016,35996,35984,
+35943,35943,35892,35892,35851,35838,35814,35814,
+35824,35824,35823,35819,35801,35801,35808,35808,
+35831,35832,35815,35815,35748,35748,35705,35690,
+35661,35661,35621,35621,35591,35574,35522,35522,
+35437,35437,35376,35351,35296,35296,35256,35256,
+35247,35243,35230,35230,35211,35211,35195,35187,
+35166,35166,35071,35071,34939,34894,34799,34799,
+34634,34634,34617,34621,34659,34659,34657,34657,
+34608,34592,34562,34562,34546,34546,34559,34569,
+34604,34604,34607,34607,34586,34578,34560,34560,
+34556,34556,34575,34585,34616,34616,34614,34614,
+34582,34566,34520,34520,34454,34454,34468,34488,
+34567,34567,34631,34631,34656,34666,34687,34687,
+34710,34710,34729,34735,34750,34750,34788,34788,
+34842,34863,34914,34914,34964,34964,35033,35065,
+35161,35161,35234,35234,35267,35280,35308,35308,
+35339,35339,35352,35354,35352,35352,35368,35368,
+35401,35410,35422,35422,35414,35414,35424,35431,
+35457,35457,35453,35453,35418,35402,35358,35358,
+35304,35304,35230,35194,35086,35086,35007,35007,
+34987,34970,34907,34907,34788,34788,34618,34538,
+34306,34306,34132,34132,34093,34095,34140,34140,
+34221,34221,34384,32863,32238,31368,30000,29222,
+29508,29528,29507,29111,29017,29881,29382,29620,
+29894,30020,28145,27458,26514,24885,24814,24802,
+25468,25579,25716,25357,24654,24980,25364,25371,
+25981,26327,26445,26318,25629,25367,25351,25556,
+25611,25692,25594,25414,25358,25155,25036,25049,
+24949,24922,24911,24746,24748,24840,24743,24689,
+24648,24554,24536,24403,24257,24307,24407,24689,
+24773,24885,25209,25028,24830,24758,24815,24914,
+25302,25534,25696,26120,26326,26449,26780,26860,
+27067,27533,28108,36209,35884,35884,36201,36394,
+37049,37049,37437,37437,37418,37390,37272,37272,
+37049,37049,36942,36920,36910,36910,36943,36943,
+36998,37006,36988,36988,36874,36874,36851,36856,
+36906,36906,36901,36901,36839,36828,36836,36836,
+36936,36936,36966,36966,36941,36941,36913,36913,
+36891,36882,36853,36853,36807,36807,36795,36795,
+36805,36805,36786,36786,36743,36727,36692,36692,
+36662,36662,36633,36623,36592,36592,36553,36553,
+36518,36504,36462,36462,36401,36401,36345,36323,
+36264,36264,36177,36177,36092,36069,36035,36035,
+36058,36058,36050,36043,36007,36007,35993,35993,
+36000,35997,35973,35973,35916,35916,35881,35869,
+35848,35848,35839,35839,35839,35837,35825,35825,
+35801,35801,35797,35797,35804,35804,35811,35811,
+35812,35807,35780,35780,35706,35706,35659,35645,
+35621,35621,35610,35610,35619,35621,35621,35621,
+35598,35598,35587,35583,35571,35571,35485,35485,
+35449,35429,34650,33869,32746,32409,31495,30583,
+30307,30445,29646,29007,29208,29264,29321,29192,
+29788,29863,30254,30252,30414,30386,30257,30526,
+30622,30480,30345,30276,29949,29858,29941,30237,
+30625,30119,29859,30342,31742,34837,34830,34830,
+34857,34857,34852,34854,34867,34867,34862,34862,
+34870,34870,34863,34863,34862,34862,34865,34862,
+34844,34844,34672,34672,34626,34628,34687,34687,
+34687,34687,34716,34729,34772,34772,34796,34796,
+34805,34824,34910,34910,35107,35107,35222,35258,
+35320,35320,35419,35419,35500,35520,35546,34241,
+30723,31148,32716,32483,32332,32444,31906,31974,
+32115,32347,32544,31671,32588,33083,31551,33359,
+33176,33248,33508,33549,32602,30843,30638,30632,
+26228,25922,25986,26950,27690,28051,30146,30932,
+30667,29607,30299,30191,29892,30163,31292,29985,
+29549,28902,29551,30415,31009,31028,30644,31362,
+32842,32619,32322,31463,31927,31070,28296,28020,
+27391,26016,26007,25854,26031,26056,25682,25206,
+26299,28035,27716,27049,28419,32348,33076,33667,
+33428,33503,33813,32301,31431,30163,28621,25126,
+20898,19803,21197,21506,20267,18894,20940,19388,
+22373,20319,20498,22608,22959,23636,23587,20709,
+20752,23569,20875,22903,22779,22731,21601,19321,
+19061,19479,17606,19900,19542,18348,20324,21270,
+20939,21604,20234,20404,19766,19602,20029,20741,
+20369,20420,20131,20068,20873,20760,20338,21483,
+21672,22110,21901,21954,22687,22850,22449,24638,
+24839,25373,26167,26646,27086,26260,26111,25983,
+26784,27507,27244,27114,27623,27881,28202,27806,
+28134,28627,28736,28680,29423,29233,29628,30253,
+29930,29940,29984,29880,30453,30156,30064,29852,
+29002,30256,30338,30389,30565,30565,31006,31006,
+31519,31743,32347,32347,33151,33151,33927,34179,
+34662,34662,34776,34776,34685,30930,34713,34713,
+35382,35382,30444,29474,29869,31095,31123,30115,
+30433,36007,36146,36146,36479,36479,36429,36389,
+36237,36237,36206,36206,36262,36270,36251,36251,
+36146,36146,36077,36058,36031,36031,36002,36002,
+35969,35963,35957,35957,35966,35966,35940,35925,
+35874,35874,35817,35817,35778,35765,35742,35742,
+35747,35747,35737,35728,35696,35696,35693,35693,
+35714,35716,35700,35700,35637,35637,35600,35589,
+35565,35565,35529,35529,35499,35482,35426,35426,
+35332,35332,35266,35242,35185,35185,35149,35149,
+35147,35145,35136,35136,35118,35118,35106,35100,
+35086,35086,34994,34994,34863,34817,34716,34716,
+34405,34405,34380,34384,34437,34437,34440,34440,
+34383,34365,34325,34325,34297,34297,34309,34321,
+34367,34367,34373,34373,34345,34337,34316,34316,
+34310,34310,34320,34326,34344,34344,34346,34346,
+34332,34318,34267,34267,34169,34169,34167,34180,
+34252,34252,34312,34312,34342,34353,34375,34375,
+34392,34392,34409,34415,34427,34427,34462,34462,
+34513,34535,34593,34593,34667,34667,34729,34753,
+34810,34810,34878,34878,34938,34960,35008,35008,
+35053,35053,35073,35076,35072,35072,35091,35091,
+35131,35140,35151,35151,35133,35133,35157,35173,
+35231,35231,35265,35265,35258,35250,35210,35210,
+35130,35130,35041,35001,34888,34888,34820,34820,
+34818,34806,34754,34754,34640,34640,34472,34391,
+34157,34157,33966,33966,33924,33942,34071,34071,
+34166,32117,32069,31718,31180,30474,28748,28868,
+29430,29451,30775,30255,29362,30276,29242,29687,
+29419,28562,26936,26306,25494,24884,24717,24551,
+24734,25257,24890,24341,24178,24635,25000,25134,
+25200,25818,25958,25930,25386,25175,25216,25361,
+25319,25363,25252,25153,25149,24903,24775,24735,
+24574,24445,24304,23972,24039,24189,24333,24350,
+24303,24161,24190,24185,24007,24061,24163,24519,
+24708,24800,25076,24952,24735,24825,24746,24591,
+24966,25367,25561,25834,26023,26267,26548,26650,
+26828,27183,27445,27830,35371,35371,35424,35563,
+36201,36201,36758,36758,36953,37000,37040,37040,
+36946,36946,36878,36860,36841,36841,36849,36849,
+36881,36883,36865,36865,36776,36776,36755,36757,
+36791,36791,36776,36776,36714,36702,36708,36708,
+36799,36799,36828,36831,36813,36813,36792,36792,
+36775,36766,36737,36737,36679,36679,36657,36653,
+36654,36654,36628,36628,36582,36565,36523,36523,
+36475,36475,36444,36433,36412,36412,36388,36388,
+36375,36364,36323,36323,36238,36238,36171,36143,
+36079,36079,35989,35989,35905,35880,35839,35839,
+35841,35841,35820,35806,35759,35759,35749,35749,
+35773,35774,35759,35759,35699,35699,35668,35660,
+35649,35649,35643,35643,35640,35637,35626,35626,
+35606,35606,35607,35611,35628,35628,35638,35638,
+35639,35634,35609,35609,35542,35542,35494,35478,
+35445,35445,35435,35435,35454,35460,35469,35469,
+35461,35461,35462,35461,35458,35458,35430,35430,
+35406,35383,35297,34948,34046,33575,32923,31561,
+30947,30798,30424,29959,29677,29312,29025,29491,
+29749,29728,30481,30131,30617,29917,30049,30554,
+30371,31007,30598,29983,30486,30550,30389,30061,
+30068,30639,30686,30658,31175,34830,34792,34792,
+34813,34813,34810,34801,34759,34759,34741,34741,
+34740,34737,34724,34724,34716,34716,34710,34705,
+34689,34689,34648,34648,34616,34605,34582,34582,
+34559,34559,34591,34611,34676,34676,34729,34729,
+34764,34792,34893,34893,35091,35091,35204,35239,
+35299,35299,35405,35405,35504,35531,35573,35573,
+31830,31726,32908,32055,31971,32131,31860,31906,
+32030,32499,32677,32288,32466,32064,32938,32852,
+33032,33222,33151,32955,31670,28676,28997,28785,
+25382,25333,25380,26425,28907,29888,30773,30070,
+29912,29803,30032,29991,30236,30355,30434,29142,
+28772,29096,29371,29832,30311,30771,31569,31320,
+32151,31993,31291,31414,31731,31019,28600,29632,
+28803,26183,25965,25578,25065,25364,25237,24507,
+25799,26170,27630,28429,30166,33123,33662,33944,
+34096,33681,33415,30254,29727,30178,25154,20926,
+21053,20353,21858,20638,18474,17969,19067,18701,
+19263,21625,19443,19464,19662,23056,23176,20596,
+19948,20314,21970,18612,21403,19491,21348,20843,
+20720,20418,19476,19046,19007,19159,19594,20313,
+19722,19730,19887,19547,19297,19345,19374,20484,
+20058,19883,19727,19675,20283,20054,20448,20781,
+21248,22311,22723,22047,22486,22625,23500,24796,
+25366,24878,26254,26492,26584,26614,26859,27218,
+28250,28739,28430,27446,27333,27482,27988,28353,
+29125,28359,28162,28198,29780,29490,30045,29921,
+29752,29808,30088,29842,29835,29408,29245,28801,
+30159,30159,30089,30113,30303,30303,30669,30669,
+31078,31260,31764,31764,32456,32456,33638,33980,
+34508,34508,34398,34398,34247,34209,30627,30143,
+30135,30586,34722,30419,30566,34909,30670,29209,
+29232,35886,36044,36044,36423,36423,36088,35992,
+35846,35846,35883,35883,36012,36047,36089,36089,
+36031,36031,35967,35949,35919,35919,35884,35884,
+35848,35842,35846,35846,35872,35872,35834,35809,
+35721,35721,35647,35647,35618,35607,35582,35582,
+35571,35571,35533,35510,35437,35437,35404,35404,
+35419,35420,35411,35411,35368,35368,35346,35340,
+35328,35328,35301,35301,35278,35261,35200,35200,
+35082,35082,35010,34986,34934,34934,34905,34905,
+34911,34910,34902,34902,34879,34879,34876,34877,
+34882,34882,34806,34806,34680,34632,34519,34519,
+34405,34405,34380,34384,34437,34437,34440,34440,
+34383,34365,34325,34325,34297,34297,34309,34321,
+34367,34367,34373,34373,34345,34337,34316,34316,
+34310,34310,34320,34326,34344,34344,34346,34346,
+34332,34318,34267,34267,34169,34169,34167,34180,
+34252,34252,34312,34312,34342,34353,34375,34375,
+34392,34392,34409,34415,34427,34427,34462,34462,
+34513,34535,34593,34593,34667,34667,34729,34753,
+34810,34810,34878,34878,34938,34960,35008,35008,
+35053,35053,35073,35076,35072,35072,35091,35091,
+35131,35140,35151,35151,35133,35133,35157,35173,
+35231,35231,35265,35265,35258,35250,35210,35210,
+35130,35130,35041,35001,34888,34888,34820,34820,
+34818,34806,34754,34754,34640,34640,34472,34391,
+34157,34157,33966,33966,33924,33942,34071,32180,
+30957,29875,30077,29023,28677,28289,28214,29046,
+28922,30740,29929,29801,29087,28965,28862,28617,
+27859,27276,25432,25226,24986,24950,24774,24170,
+24884,24420,24558,23864,23716,24088,24441,24591,
+24644,25121,25332,25405,25112,24943,24996,25163,
+25060,25014,24922,24858,24850,24610,24496,24455,
+24181,23934,23223,22919,23151,23445,23876,23999,
+23977,23789,23798,23768,23697,23768,23940,24490,
+24536,24543,24842,24888,24704,25032,24800,24349,
+24144,24639,25008,25658,25863,25934,25994,26171,
+26439,26518,26571,26742,27381,27915,35424,35563,
+36201,36201,36758,36758,36953,37000,37040,37040,
+36946,36946,36878,36860,36841,36841,36849,36849,
+36881,36883,36865,36865,36776,36776,36755,36757,
+36791,36791,36776,36776,36714,36702,36708,36708,
+36799,36799,36828,36831,36813,36813,36792,36792,
+36775,36766,36737,36737,36679,36679,36657,36653,
+36654,36654,36628,36628,36582,36565,36523,36523,
+36475,36475,36444,36433,36412,36412,36388,36388,
+36375,36364,36323,36323,36238,36238,36171,36143,
+36079,36079,35989,35989,35905,35880,35839,35839,
+35841,35841,35820,35806,35759,35759,35749,35749,
+35773,35774,35759,35759,35699,35699,35668,35660,
+35649,35649,35643,35643,35640,35637,35626,35626,
+35606,35606,35607,35611,35628,35628,35638,35638,
+35639,35634,35609,35609,35542,35542,35494,35478,
+35445,35445,35435,35435,35454,35460,35469,35469,
+35461,35461,35462,35461,35458,35458,35430,35430,
+35406,35383,35297,35260,34047,33297,32609,31350,
+31640,32447,31930,31267,30813,29993,29980,30013,
+30037,30353,30374,30580,30592,30726,30182,30403,
+30544,31100,30107,30603,30549,30354,30198,30138,
+30445,30788,31091,31174,31400,34830,34792,34792,
+34813,34813,34810,34801,34759,34759,34741,34741,
+34740,34737,34724,34724,34716,34716,34710,34705,
+34689,34689,34648,34648,34616,34605,34582,34582,
+34559,34559,34591,34611,34676,34676,34729,34729,
+34764,34792,34893,34893,35091,35091,35204,35239,
+35299,35299,35405,35405,35504,35531,35573,35573,
+33588,33646,33782,31438,30977,31385,31788,31687,
+31846,31888,32034,32014,31971,32237,32399,33049,
+32995,33140,32890,32516,30986,26849,26038,25798,
+25686,25585,25722,25591,27628,30068,30248,29786,
+29498,29768,30684,30539,29890,29993,29904,28657,
+28278,28685,29907,30012,29867,30921,31302,31428,
+30721,31781,31715,31336,31042,31428,30574,30313,
+29276,27469,26391,26296,24772,24011,24185,24597,
+24775,25667,28680,29930,31851,32501,32709,33147,
+33568,33111,31831,26141,26049,26029,20927,20352,
+20734,19957,19563,20543,16323,17234,17694,19045,
+19375,19375,20252,20584,22111,19790,20051,20313,
+19678,20561,20815,18787,20972,21295,21171,19528,
+20640,20504,19814,18432,18824,19087,18048,19499,
+19343,19374,19614,19668,19863,19730,19418,19701,
+19712,20428,20434,20446,20512,20275,19001,19192,
+21834,22563,22547,22216,22610,22996,23897,25017,
+25117,25309,25674,25935,25941,26808,27490,27709,
+28608,28274,29352,28002,28525,28184,28222,28162,
+28730,29025,28595,28755,28849,28821,29359,29765,
+29637,29678,29630,29407,29142,29340,28846,30091,
+30159,30159,30089,30113,30303,30303,30669,30669,
+31078,31260,31764,31764,32456,28505,28371,33980,
+34508,34508,34398,34398,34247,34209,34169,34169,
+29152,29228,29677,30351,30639,34909,30538,29267,
+29319,35886,36044,36044,36423,36423,36088,35992,
+35846,35846,35883,35883,36012,36047,36089,36089,
+36031,36031,35967,35949,35919,35919,35884,35884,
+35848,35842,35846,35846,35872,35872,35834,35809,
+35721,35721,35647,35647,35618,35607,35582,35582,
+35571,35571,35533,35510,35437,35437,35404,35404,
+35419,35420,35411,35411,35368,35368,35346,35340,
+35328,35328,35301,35301,35278,35261,35200,35200,
+35082,35082,35010,34986,34934,34934,34905,34905,
+34911,34910,34902,34902,34879,34879,34876,34877,
+34882,34882,34806,34806,34680,34632,34519,34519,
+34056,34056,34026,34037,34118,34118,34131,34131,
+34067,34049,34016,34016,34012,34012,34047,34068,
+34139,34139,34137,34137,34069,34044,33987,33987,
+33942,33942,33918,33910,33893,33893,33907,33907,
+33946,33949,33920,33920,33814,33814,33791,33793,
+33826,33826,33865,33865,33902,33913,33930,33930,
+33933,33933,33958,33971,34012,34012,34057,34057,
+34096,34119,34192,34192,34321,34321,34363,34366,
+34337,34337,34384,34384,34499,34538,34622,34622,
+34687,34687,34717,34724,34729,34729,34761,34761,
+34811,34822,34832,34832,34798,34798,34811,34824,
+34878,34878,34940,34940,34984,34995,35003,35003,
+34975,34975,34904,34866,34743,34743,34650,34650,
+34613,34592,34526,34526,34429,34429,34283,34214,
+34014,34014,33833,33833,33819,33836,32223,31083,
+30087,30694,30459,28956,29667,29644,28772,28240,
+28231,29311,28691,28583,27823,27028,27111,26200,
+25772,25799,25328,25360,25030,24584,24138,23938,
+24532,24919,24027,23778,23642,23825,24083,24076,
+23866,24078,24104,24238,24566,24437,24326,24450,
+24486,24482,24406,24303,24233,24236,24165,24061,
+23822,23712,23590,23237,22812,22665,22623,22766,
+22783,23040,23086,23046,23174,23229,23336,23655,
+23600,23605,24495,24521,24284,24181,24406,24347,
+23329,22807,22739,24105,24804,25144,25394,25545,
+25783,26146,26282,26474,26600,26927,27554,34460,
+34539,34539,35068,35068,35692,35906,36352,36352,
+36679,36679,36762,36770,36725,36725,36685,36685,
+36674,36666,36634,36634,36576,36576,36582,36595,
+36657,36657,36650,36650,36575,36558,36548,36548,
+36620,36620,36655,36664,36676,36676,36674,36674,
+36656,36644,36607,36607,36534,36534,36501,36492,
+36482,36482,36455,36455,36421,36403,36349,36349,
+36260,36260,36221,36214,36213,36213,36207,36207,
+36202,36193,36154,36154,36061,36061,35986,35955,
+35877,35877,35790,35790,35724,35697,35630,35630,
+35546,35546,35488,35468,35424,35424,35411,35411,
+35430,35433,35428,35428,35391,35391,35383,35384,
+35400,35400,35391,35391,35364,35355,35340,35340,
+35333,35333,35344,35351,35377,35377,35382,35382,
+35363,35355,35333,35333,35301,35301,35267,35253,
+35216,35216,35208,35208,35232,35238,35240,35240,
+35213,35213,35209,35210,35220,35220,35241,35241,
+35265,35262,35221,35221,33587,33471,34784,34704,
+34494,34494,34325,34325,34253,33565,32335,32148,
+31783,31823,31625,30951,30473,30583,30940,30795,
+30806,29779,29908,29943,29300,29695,30166,30580,
+30770,30745,30981,31119,31209,32117,34662,34662,
+34679,34679,34686,34684,34668,34668,34625,34625,
+34576,34560,34534,34534,34530,34530,34542,34548,
+34567,34567,34581,34581,34582,34571,34517,33917,
+34430,33535,34433,34443,34488,34488,34602,34602,
+34758,34821,34980,34980,35158,35158,35251,35276,
+35307,35307,35419,35419,35582,35622,35659,35659,
+32320,32122,32542,31695,31040,30769,30457,30590,
+30527,30166,30257,30331,30790,30768,31384,32030,
+32356,32388,32309,31851,30330,25375,25010,25285,
+24857,25089,24732,25746,28310,30526,31238,31111,
+30898,29444,30146,30166,30873,30258,30864,29916,
+30247,30928,30310,30069,29688,27897,29438,29791,
+30964,30733,31954,32327,32307,32262,32331,31633,
+30925,29470,27501,25823,25183,25026,25888,26216,
+26200,26097,25684,25766,23776,24988,25796,26343,
+25310,24795,24177,24996,25128,22877,20785,21177,
+19871,16919,16480,18849,17991,18002,19112,18801,
+18222,19446,17532,18593,19397,20878,21064,22299,
+21964,21595,20045,20781,19777,19780,19413,19110,
+19216,20242,20335,18299,19235,18600,17662,19082,
+18475,20073,20636,20665,20560,20230,20104,19976,
+19473,19030,19686,18924,19339,18948,19302,20924,
+23053,23054,22079,21323,22859,23591,25025,25960,
+25772,25446,25102,24748,24452,25641,26329,26169,
+25734,26087,26701,27001,27439,27341,26634,26357,
+26771,28589,28432,28646,29246,29177,29173,29118,
+29069,29092,28474,28336,28167,28304,27872,30006,
+29684,29684,29655,29707,29992,29992,30275,30275,
+30458,30565,30918,30918,31353,27670,26841,26404,
+27322,27960,33932,33932,33841,33810,33751,33751,
+33607,29834,29185,29113,28967,28793,29698,29902,
+29536,28876,28135,26842,26021,27238,29296,35166,
+32364,35129,35278,35278,35516,35602,35792,35792,
+35890,35890,35867,35853,35808,35808,35751,35751,
+35692,35684,35705,35705,35784,35784,35726,35680,
+35509,35509,35401,35401,35406,35402,35377,35377,
+35321,35321,35218,35165,34999,34999,34895,34895,
+34892,34894,34906,34906,34927,34927,34933,34931,
+34920,34920,34912,34912,34921,34911,34851,34851,
+34697,34697,34625,34606,34585,34585,34559,34559,
+34542,34530,34495,34495,34434,34434,34443,34457,
+34515,34515,34485,34485,34383,34339,34219,34219,
+34056,34056,34026,34037,34118,34118,34131,34131,
+34067,34049,34016,34016,34012,34012,34047,34068,
+34139,34139,34137,34137,34069,34044,33987,33987,
+33942,33942,33918,33910,33893,33893,33907,33907,
+33946,33949,33920,33920,33814,33814,33791,33793,
+33826,33826,33865,33865,33902,33913,33930,33930,
+33933,33933,33958,33971,34012,34012,34057,34057,
+34096,34119,34192,34192,34321,34321,34363,34366,
+34337,34337,34384,34384,34499,34538,34622,34622,
+34687,34687,34717,34724,34729,34729,34761,34761,
+34811,34822,34832,34832,34798,34798,34811,34824,
+34878,34878,34940,34940,34984,34995,35003,35003,
+34975,34975,34904,34866,34743,34743,34650,34650,
+34613,34592,34526,34526,34429,34429,34283,34214,
+34014,34014,33833,33833,33819,31736,31062,29827,
+30109,30341,30181,28424,28042,28383,29257,27987,
+29809,29090,28455,28066,27197,26517,26724,25578,
+24809,25043,25170,25006,25135,24143,23654,23697,
+23481,23339,23750,23546,23683,23382,23923,23951,
+23674,23633,23404,23191,24143,24332,24320,24154,
+24115,24091,24177,24145,24105,24119,24488,24422,
+23669,23490,23092,22406,22129,21910,21886,21929,
+22018,22639,22735,22682,22857,22902,22916,23284,
+23367,23517,24565,24662,24475,24091,23944,24011,
+24171,23657,23250,23291,23779,24437,25407,25568,
+25725,26057,26196,26333,26696,26903,27278,28348,
+34539,34539,35068,35068,35692,35906,36352,36352,
+36679,36679,36762,36770,36725,36725,36685,36685,
+36674,36666,36634,36634,36576,36576,36582,36595,
+36657,36657,36650,36650,36575,36558,36548,36548,
+36620,36620,36655,36664,36676,36676,36674,36674,
+36656,36644,36607,36607,36534,36534,36501,36492,
+36482,36482,36455,36455,36421,36403,36349,36349,
+36260,36260,36221,36214,36213,36213,36207,36207,
+36202,36193,36154,36154,36061,36061,35986,35955,
+35877,35877,35790,35790,35724,35697,35630,35630,
+35546,35546,35488,35468,35424,35424,35411,35411,
+35430,35433,35428,35428,35391,35391,35383,35384,
+35400,35400,35391,35391,35364,35355,35340,35340,
+35333,35333,35344,35351,35377,35377,35382,35382,
+35363,35355,35333,35333,35301,35301,35267,35253,
+35216,35216,35208,35208,35232,35238,35240,35240,
+35213,35213,35209,35210,35220,35220,35241,35241,
+35265,35262,35221,35221,34267,34977,34784,34704,
+34494,34494,34325,34325,34253,34231,34199,33379,
+32017,31873,31998,31382,30955,30739,30563,30485,
+30698,29535,29296,29427,30698,31157,31180,31164,
+31444,31247,31042,31078,31223,34619,34662,34662,
+34679,34679,34686,34684,34668,34668,34625,34625,
+34576,34560,34534,34534,34530,34530,34542,34548,
+34567,34567,34581,34581,34582,34571,34517,34517,
+34430,34430,34433,34443,34488,34488,34602,34602,
+34758,34821,34980,34980,35158,35158,35251,35276,
+35307,35307,35419,35419,35582,35622,35659,35659,
+31872,31667,31751,31453,31226,31084,30683,30360,
+30125,30304,30425,30356,30341,30836,30640,31865,
+32562,32863,31713,30659,28842,25528,25401,25203,
+25318,25420,25394,27278,29584,30528,29185,29279,
+28851,28184,29004,29418,31238,31434,31133,30461,
+30026,30619,28852,28882,29298,27325,28968,28296,
+31020,30587,31902,31747,31708,31929,32402,31884,
+31007,30870,30026,28874,27890,27765,27192,26446,
+27701,28772,27106,25732,22650,21632,22772,24301,
+22025,20734,21208,25341,24391,24864,20461,18859,
+17601,19358,18158,17774,19415,18539,18643,19138,
+19224,19294,19966,19583,21812,20457,20354,21342,
+20403,20341,19817,18347,19552,19664,19436,20351,
+18999,18596,18937,18204,18824,17551,18590,18684,
+18526,20154,20174,18407,20711,21011,18872,20588,
+18578,18584,19180,19688,20724,18338,18070,21029,
+23251,23705,23276,22596,23784,24838,26307,25396,
+24866,25522,24911,24486,24003,25329,25915,25926,
+25605,25805,26000,26085,26347,26733,26502,26244,
+26300,26980,27278,27714,29038,29084,28947,28518,
+28513,28505,28310,27755,27464,27377,27355,27423,
+29684,29684,29655,29707,29992,29992,30275,30275,
+30458,30565,30918,30918,31353,27600,26721,25766,
+26507,27031,27850,33932,33841,33810,33751,33751,
+33607,33607,33600,33608,33660,33660,33743,33743,
+29274,26893,26251,25406,25249,26605,28849,31837,
+31836,32029,35278,35278,35516,35602,35792,35792,
+35890,35890,35867,35853,35808,35808,35751,35751,
+35692,35684,35705,35705,35784,35784,35726,35680,
+35509,35509,35401,35401,35406,35402,35377,35377,
+35321,35321,35218,35165,34999,34999,34895,34895,
+34892,34894,34906,34906,34927,34927,34933,34931,
+34920,34920,34912,34912,34921,34911,34851,34851,
+34697,34697,34625,34606,34585,34585,34559,34559,
+34542,34530,34495,34495,34434,34434,34443,34457,
+34515,34515,34485,34485,34383,34339,34219,34219,
+33813,33813,33791,33804,33896,33896,33915,33915,
+33858,33839,33793,33793,33743,33743,33756,33770,
+33836,33836,33829,33829,33755,33727,33664,33664,
+33609,33609,33585,33578,33567,33567,33589,33589,
+33632,33637,33619,33619,33530,33530,33502,33498,
+33506,33506,33530,33530,33565,33574,33585,33585,
+33576,33576,33608,33628,33692,33692,33744,33744,
+33762,33779,33841,33841,33972,33972,34007,34005,
+33959,33959,34006,34006,34129,34171,34254,34254,
+34304,34304,34345,34361,34398,34398,34460,34460,
+34523,34540,34554,34554,34518,34518,34533,34548,
+34609,34609,34678,34678,34724,34738,34759,34759,
+34761,34761,34716,34686,34589,34589,34489,34489,
+34418,34383,34286,34286,34154,34154,34014,33956,
+33806,33806,33695,33695,33723,29888,29227,29211,
+30169,30083,29865,27260,28866,30005,29677,28294,
+28426,28024,28821,28247,26974,26457,26357,25242,
+25101,25017,24716,24562,24469,23551,24378,23619,
+23113,22748,23038,23049,23307,22839,23682,23922,
+23635,23287,23277,23386,23748,24076,24237,24071,
+23993,23940,24090,24124,24079,23851,23763,23709,
+23798,23199,22841,21960,21743,22042,21615,21614,
+21628,22049,22205,22317,22537,22563,22579,23081,
+23687,23936,24442,24770,24757,24220,23920,23939,
+24145,24046,23919,23125,22903,23456,25121,25480,
+25687,26233,26448,26686,26816,26945,27257,32511,
+32658,32658,33303,33303,34188,34516,35270,35270,
+35978,35978,36269,36339,36394,36394,36404,36404,
+36387,36382,36372,36372,36384,36384,36425,36447,
+36513,36513,36531,36531,36490,36478,36461,36461,
+36479,36479,36501,36512,36546,36546,36565,36565,
+36557,36550,36525,36525,36471,36471,36432,36417,
+36382,36382,36342,36342,36314,36299,36254,36254,
+36170,36170,36124,36110,36091,36091,36069,36069,
+36057,36047,36007,36007,35920,35920,35838,35802,
+35710,35710,35610,35610,35540,35508,35424,35424,
+35307,35307,35233,35208,35157,35157,35126,35126,
+35124,35121,35111,35111,35087,35087,35091,35097,
+35129,35129,35129,35129,35101,35093,35080,35080,
+35078,35078,35092,35101,35128,35128,35128,35128,
+35103,35095,35079,35079,35066,35066,35044,35033,
+35003,35003,34998,34998,35016,35021,35025,35025,
+35008,35008,35002,35004,35016,35016,35063,35063,
+35176,35191,35153,35153,34158,34977,34784,34704,
+34494,34494,34325,34325,34240,34216,34182,34182,
+33195,32946,32859,32166,31934,31452,30922,30581,
+30238,29660,29706,30077,31525,31861,31867,31710,
+31818,31732,31200,31077,31151,34384,34489,34489,
+34516,34516,34531,34549,34627,34627,34471,34471,
+34415,34396,34362,34362,34339,34339,34362,34378,
+34431,34431,34472,34472,34549,34531,34358,34358,
+34266,34266,34276,34291,34354,34354,34494,34494,
+34753,34842,35029,35029,35201,35201,35281,35294,
+35277,33385,33320,35459,35636,35677,35705,35705,
+31981,31515,31343,30891,30858,30882,30714,30261,
+29897,29898,30108,30383,30172,30434,30911,32418,
+32851,32924,30344,27144,25914,25272,25486,25358,
+25978,27092,28274,30356,30325,30003,26095,26081,
+26484,31260,31283,30582,30706,30799,30746,30303,
+30352,30033,29102,29088,28959,27724,27666,29501,
+31423,31977,32506,30682,30761,30821,31094,30795,
+30748,31258,30569,29655,30033,30352,29622,28539,
+30182,30835,29154,26366,24153,21973,21752,21888,
+21395,20333,20031,21708,22373,21757,17309,16991,
+16899,18016,18581,19515,19585,21144,21822,23890,
+23082,24047,25810,23777,22013,20188,20140,19672,
+20501,20244,20641,19558,20497,19013,19058,20196,
+19998,19519,19510,19093,17840,18326,17052,18879,
+19097,20533,20583,19506,22454,22575,20835,22162,
+20632,21152,21961,22357,20819,18966,19491,21619,
+23228,23114,23184,23693,24558,26006,26508,25633,
+24950,25077,25142,24602,24528,24950,25326,25479,
+25163,25346,25813,26081,25972,26113,26603,26252,
+25977,26257,26673,27438,28623,28789,28569,28050,
+27941,28123,27519,26936,26864,27027,27189,27365,
+27159,28962,29132,29240,29608,29608,29887,29887,
+29989,30069,30362,30362,30666,27159,26554,25894,
+26396,26582,27182,33568,33542,33533,33515,33515,
+33478,33478,33478,33497,33586,33586,33680,33680,
+29611,26161,25163,24442,25670,27157,28938,31405,
+31675,34797,34719,34719,34963,35065,35338,35338,
+35514,35514,35494,35473,35389,35389,35299,35299,
+35226,35216,35235,35235,35330,35330,35288,35248,
+35091,35091,35011,35011,35050,35057,35053,35053,
+35000,35000,34895,34840,34667,34667,34523,34523,
+34465,34453,34453,34453,34512,34512,34546,34554,
+34567,34567,34575,34575,34586,34574,34504,34504,
+34324,34324,34258,34250,34267,34267,34269,34269,
+34255,34243,34199,34199,34114,34114,34111,34122,
+34183,34183,34174,34174,34105,34072,33974,33974,
+33737,33737,33719,33735,33828,33828,33851,33851,
+33802,33782,33725,33725,33642,33642,33634,33644,
+33698,33698,33689,33689,33621,33595,33537,33537,
+33485,33485,33467,33465,33466,33466,33488,33488,
+33523,33527,33509,33509,33432,33432,33406,33401,
+33402,33402,33422,33422,33455,33464,33472,33472,
+33462,33462,33497,33518,33591,33591,33642,33642,
+33651,33664,33716,33716,33835,33835,33871,33870,
+33835,33835,33882,33882,34001,34039,34113,34113,
+34150,34150,34194,34214,34268,34268,34344,34344,
+34414,34432,34452,34452,34419,34419,34438,34456,
+34524,34524,34591,34591,34627,34638,34658,34658,
+34665,34665,34630,34606,34526,34526,34427,34427,
+34343,34303,34189,34189,34032,34032,33892,33839,
+33713,33713,33655,33655,30549,28718,28955,28661,
+30911,30003,27543,25166,27789,28928,27643,27810,
+27420,26788,27195,28808,27345,25706,25596,24785,
+25072,24270,23770,23720,23859,24005,23339,23162,
+23261,23048,21254,20427,22067,22408,23558,23862,
+23683,23612,23670,23674,23787,23966,24000,24176,
+24045,24117,23807,23742,23545,23132,22966,22740,
+22641,22523,22049,21339,21158,20923,20741,20364,
+20463,20871,21193,21503,21780,21874,22007,22950,
+23320,23496,24065,24225,24471,24738,24419,24212,
+23894,23664,23524,23386,23023,22667,23253,23930,
+24812,26132,26376,26545,26732,26752,26089,31744,
+32005,32005,32693,32693,33606,33953,34771,34771,
+35590,35590,35957,36053,36167,36167,36214,36214,
+36204,36204,36216,36216,36273,36273,36336,36361,
+36429,36429,36465,36465,36450,36443,36427,36427,
+36419,36419,36433,36444,36486,36486,36513,36513,
+36511,36507,36492,36492,36456,36456,36417,36399,
+36351,36351,36304,36304,36277,36262,36222,36222,
+36151,36151,36102,36086,36051,36051,36018,36018,
+36003,35992,35952,35952,35871,35871,35788,35752,
+35651,35651,35543,35543,35465,35431,35343,35343,
+35225,35225,35149,35123,35067,35067,35027,35027,
+35013,35008,34994,34994,34971,34971,34979,34988,
+35022,35022,35028,35028,35007,35001,34990,34990,
+34988,34988,35002,35008,35034,35034,35034,35034,
+35010,35002,34987,34987,34980,34980,34962,34953,
+34924,34924,34920,34920,34934,34938,34946,34946,
+34943,34943,34939,34941,34954,34954,35025,35025,
+35132,35146,35111,33533,32507,32096,32277,32342,
+31818,31399,32114,33243,34233,34209,34165,34165,
+34132,34132,34155,34165,34188,34188,34174,34174,
+34219,34247,34339,34339,33302,32875,33206,34294,
+32727,32230,31536,31542,31817,33011,34421,34421,
+34452,34452,34467,34484,34548,31764,34408,34408,
+34355,34337,34296,34296,34256,34256,34281,34299,
+34368,34368,34412,33123,34463,32636,34272,34272,
+34193,34193,34210,34226,34297,34297,34469,34469,
+32816,32491,31057,29307,29643,31874,32777,30694,
+29434,29481,29899,29956,29328,31763,33117,33296,
+31866,30707,30074,30118,29996,29904,29873,29944,
+29969,29971,30251,29868,30621,31029,31251,31242,
+29994,26458,27798,28173,28042,25668,25338,25719,
+27437,28720,31264,32459,31799,32134,32507,32488,
+32462,32409,32377,32046,32971,32261,31223,29105,
+30171,30242,29680,28233,27877,27460,27830,29202,
+29409,29164,28963,28782,28952,29743,29757,29935,
+30112,29997,29925,29724,29284,29661,30170,30862,
+30703,30816,30636,29984,28762,25870,23569,21575,
+19623,19358,18889,18163,17733,17825,18325,19494,
+20346,22604,22981,23272,24175,25709,26349,28773,
+28642,28495,29633,29760,28293,28203,28107,28256,
+25414,22670,22628,20036,18704,19051,20987,21077,
+21188,21538,21531,21411,20947,20451,19981,20626,
+21943,23144,24298,24243,23577,23681,23345,23127,
+23018,22724,22567,21505,20630,20782,21052,21008,
+21063,21348,21941,23651,23254,23842,24204,23918,
+25744,24935,24266,24716,24923,24527,24855,25119,
+24986,25098,25240,25692,26145,25526,24821,25091,
+25725,25690,25714,26332,27240,27424,27474,27399,
+27230,27326,26794,26596,26471,26533,26507,26302,
+25796,25788,25848,29082,29473,29473,29759,29759,
+29852,29934,30252,30252,26348,25973,25686,25324,
+24744,24199,25758,33394,33406,33407,33401,33401,
+33360,33360,33366,33389,33503,33503,33603,33603,
+33487,29487,33342,27056,26219,25698,25197,26722,
+28231,29495,34533,34533,34759,34860,35136,35136,
+35318,35318,35288,35261,35159,35159,35057,35057,
+34980,34967,34983,34983,35073,35073,35043,35010,
+34880,34880,34825,34825,34878,34888,34894,34894,
+34851,34851,34761,34712,34558,34558,34407,34407,
+34317,34297,34284,34284,34351,34351,34396,34411,
+34440,34440,34456,34456,34461,34447,34371,34371,
+34184,34184,34124,34118,34151,34151,34169,34169,
+34161,34150,34106,34106,34013,34013,34001,34008,
+34059,34059,34053,34053,34002,33974,33889,33889,
+33573,33573,33569,33588,33683,33683,33718,33718,
+33692,33671,33586,33586,33405,33405,33341,33332,
+33352,33352,33337,33337,33290,33272,33230,33230,
+33195,33195,33203,33211,33248,33248,33271,33271,
+33275,33272,33254,33254,33211,33211,33192,33186,
+33176,33176,33185,33185,33213,33219,33225,33225,
+33213,33213,33257,33283,33373,33373,33419,33419,
+33402,33403,33425,33425,33507,33507,33546,33553,
+33557,33557,33616,33616,33710,33737,33781,33781,
+33777,33777,33827,33856,33957,33957,34069,34069,
+34155,34178,34212,34212,34192,34192,34225,34250,
+34338,34338,34397,34397,34399,34401,34408,34408,
+34422,34422,34414,34405,34372,34372,34283,34283,
+34168,34113,33954,33954,33725,33725,33584,33543,
+33478,33478,33576,30682,29600,28311,28390,28541,
+29607,27781,25731,24622,26604,27390,26416,27583,
+26341,26295,28003,27854,26948,26460,25362,24539,
+24488,25584,24126,23864,23632,23561,24181,23232,
+20921,20209,18591,20604,22037,21603,23301,23640,
+23745,23632,23635,23550,23614,23803,23806,24069,
+23956,23825,23528,23496,23054,22635,22511,22343,
+22277,22269,21700,20612,20151,19689,19614,19805,
+20463,20402,20696,21045,21369,21545,21740,22922,
+23189,23465,23937,24081,24316,24460,24149,23924,
+23984,23873,23780,23529,23269,22924,23006,23452,
+24361,25664,25970,26275,26582,26616,26253,29901,
+30521,30521,31309,31309,32221,32588,33507,33507,
+34551,34551,35096,35259,35527,35527,35679,35679,
+35698,35716,35791,35791,35972,35972,36092,36131,
+36203,36203,36287,36287,36348,36358,36348,36348,
+36271,36271,36265,36276,36333,36333,36381,36381,
+36395,36400,36412,36412,36427,36427,36392,36369,
+36285,36285,36219,36219,36191,36179,36153,36153,
+36121,36121,36068,36043,35966,35966,35902,35902,
+35875,35862,35824,35824,35761,35761,35676,35635,
+35517,35517,35384,35384,35283,35243,35148,35148,
+35042,35042,34965,34936,34869,34869,34803,34803,
+34761,34748,34719,34719,34701,34701,34715,34726,
+34770,34770,34791,34791,34789,34788,34786,34786,
+34780,34780,34790,34796,34815,34815,34813,34813,
+34794,34788,34777,34777,34781,34781,34769,34763,
+34745,34745,34739,34739,34739,34743,34761,34761,
+34801,34801,34807,34810,34821,34821,33403,32845,
+32805,33007,32750,32667,32552,32409,32333,31274,
+30391,29739,30559,31710,32782,34188,34114,34114,
+34099,34099,34122,34131,34154,34154,34120,34120,
+34132,34158,34278,34278,34266,34266,34267,34259,
+34216,34216,34168,34168,34224,34239,34255,34255,
+34298,34298,34316,31256,30840,30913,34255,34255,
+34216,34197,34138,34138,34050,34050,34077,34103,
+34208,34208,34250,32160,30932,34150,34043,34043,
+34009,34009,34045,34069,34153,34153,34427,32783,
+32214,31154,30289,29131,29825,31107,31058,29257,
+29094,30129,30757,29864,27761,29125,31307,32259,
+31833,30345,29899,30068,30116,30140,29789,29502,
+29273,29553,29107,29520,30476,28491,26559,26455,
+26345,25984,27504,27478,26022,25217,25619,26650,
+29375,29447,32100,33976,32626,33339,33425,33394,
+33363,33322,33319,32963,35112,34611,33330,29521,
+29375,29355,28590,27685,27394,29098,30310,30547,
+30628,29769,29091,29023,29741,30383,30024,30279,
+30466,29885,29587,29162,29352,29735,30274,30357,
+29615,29217,30088,30252,28914,25680,23578,22051,
+19516,19134,18848,18565,18213,18483,19761,20655,
+21716,24869,25677,25931,26127,27191,27174,28027,
+27938,27602,28144,28320,28374,29608,29716,28498,
+27583,26939,26735,21228,21982,19919,21619,19558,
+19070,21843,22007,21155,19842,19243,19248,21839,
+23015,24006,23994,23172,22983,22894,22580,22037,
+21817,22021,22062,21057,19693,19667,21219,21775,
+21892,20855,21894,21482,21791,22218,22766,23872,
+24886,24853,24772,25434,25222,24306,24510,24811,
+24673,24890,25227,25122,24725,24667,24304,24923,
+25776,25470,25029,25331,26727,26970,26898,26813,
+26748,26839,26772,26594,26359,26568,27539,27539,
+25238,25062,25132,25461,25553,29165,29475,29475,
+29568,29671,30087,30087,30539,25401,25114,24309,
+23045,22851,32950,32950,33060,33087,33107,33107,
+33016,33016,33034,33073,33253,33253,33367,33367,
+33270,29615,32926,32926,33030,27809,26169,25711,
+26798,27986,34118,34118,34288,34374,34632,34632,
+34800,34800,34739,34696,34543,34543,34414,34414,
+34331,34314,34316,34316,34382,34382,34384,34376,
+34330,34330,34347,34347,34429,34452,34485,34485,
+34475,34475,34431,34405,34317,34317,34156,34156,
+33982,33937,33888,33888,33969,33969,34041,34070,
+34148,34148,34184,34184,34170,34148,34057,34057,
+33855,33855,33807,33811,33883,33883,33940,33940,
+33953,33947,33906,33906,33796,33796,33756,33752,
+33769,33769,33770,33770,33758,33746,33695,33695,
+33573,33573,33569,33588,33683,33683,33718,33718,
+33692,33671,33586,33586,33405,33405,33341,33332,
+33352,33352,33337,33337,33290,33272,33230,33230,
+33195,33195,33203,33211,33248,33248,33271,33271,
+33275,33272,33254,33254,33211,33211,33192,33186,
+33176,33176,33185,33185,33213,33219,33225,33225,
+33213,33213,33257,33283,33373,33373,33419,33419,
+33402,33403,33425,33425,33507,33507,33546,33553,
+33557,33557,33616,33616,33710,33737,33781,33781,
+33777,33777,33827,33856,33957,33957,34069,34069,
+34155,34178,34212,34212,34192,34192,34225,34250,
+34338,34338,34397,34397,34399,34401,34408,34408,
+34422,34422,34414,34405,34372,34372,34283,34283,
+34168,34113,33954,33954,33725,33725,33584,33543,
+33478,33478,33576,30066,28212,27927,28082,29912,
+27657,25815,23834,25007,25750,25732,25826,25631,
+25173,25600,26364,26003,25408,24930,24424,24053,
+24267,24808,24263,23856,24228,23659,23833,22623,
+16126,16163,17181,21349,21816,20146,23295,24073,
+24217,23785,23760,23641,23712,23702,23682,23823,
+23768,23470,22799,22598,22433,22091,21981,21860,
+21910,22138,21527,20420,19970,19732,19775,20024,
+20026,20635,20369,20640,21136,21309,21516,22889,
+23283,23524,23790,23957,24178,24212,24064,23936,
+23864,23869,23924,23656,23333,23170,22764,22939,
+23701,25017,25481,25928,26370,26434,26621,29901,
+30521,30521,31309,31309,32221,32588,33507,33507,
+34551,34551,35096,35259,35527,35527,35679,35679,
+35698,35716,35791,35791,35972,35972,36092,36131,
+36203,36203,36287,36287,36348,36358,36348,36348,
+36271,36271,36265,36276,36333,36333,36381,36381,
+36395,36400,36412,36412,36427,36427,36392,36369,
+36285,36285,36219,36219,36191,36179,36153,36153,
+36121,36121,36068,36043,35966,35966,35902,35902,
+35875,35862,35824,35824,35761,35761,35676,35635,
+35517,35517,35384,35384,35283,35243,35148,35148,
+35042,35042,34965,34936,34869,34869,34803,34803,
+34761,34748,34719,34719,34701,34701,34715,34726,
+34770,34770,34791,34791,34789,34788,34786,34786,
+34780,34780,34790,34796,34815,34815,34813,34813,
+34794,34788,34777,34777,34781,34781,34769,34763,
+34745,34745,34739,34739,34739,34743,34761,34761,
+34801,34801,34807,34810,34821,34821,33143,32344,
+32202,32141,31770,31814,32295,32511,32515,31867,
+31424,31055,30432,30893,31578,33301,34114,34114,
+34099,34099,34122,34131,34154,34154,34120,34120,
+34132,34158,34278,34278,34266,34266,34267,34259,
+34216,34216,34168,34168,34224,34239,34255,34255,
+34298,32049,31182,30395,31043,31205,34255,34255,
+34216,34197,34138,34138,34050,34050,34077,34103,
+34208,34208,34250,31560,30266,31370,34043,34043,
+34009,34009,34045,34069,34153,34153,33033,32641,
+32132,30591,30530,30135,29921,29856,29774,29564,
+29221,30123,30896,30696,29453,27739,28480,29968,
+30446,29477,29121,29124,29162,29302,29596,28754,
+28565,28658,28626,28964,28649,26401,26061,25126,
+25701,26654,27069,28335,25700,24927,25201,25277,
+28869,29832,30412,32331,33283,34093,34151,34132,
+34124,34100,34087,33695,34971,34433,32832,30823,
+29818,29165,28852,28506,28575,31230,31434,30792,
+29786,29848,30441,30954,31018,30865,30855,30617,
+30435,29767,29367,28951,28912,29264,30223,30017,
+29040,28476,29743,30193,28897,24987,22646,22049,
+19857,19346,18735,18788,18566,18576,19683,20693,
+22830,25790,26902,27193,27603,26967,26620,26697,
+26809,26648,27839,28790,28119,28997,29101,29232,
+28488,28334,28056,26570,25533,22515,20741,19522,
+18991,20807,20475,21337,20892,20496,20904,22904,
+23257,23075,22766,22314,22637,22638,21129,19655,
+20011,20457,20589,19349,19281,19442,20324,20273,
+21184,20618,21272,20411,22049,23967,24598,25307,
+25299,25380,25422,25480,25447,24622,24606,24782,
+24623,24768,25048,25228,24966,24258,23383,23992,
+25259,25710,25206,25315,26459,26581,26543,26570,
+26490,26388,26295,26022,25854,25959,27539,27539,
+25306,24997,28562,28729,29165,29165,29475,29475,
+29568,29671,30087,30087,30539,24402,24200,23126,
+22370,22551,32950,32950,33060,33087,33107,33107,
+33016,33016,33034,33073,33253,33253,33367,33367,
+33270,33197,32926,32926,33030,33030,28435,26022,
+26277,27441,34118,34118,34288,34374,34632,34632,
+34800,34800,34739,34696,34543,34543,34414,34414,
+34331,34314,34316,34316,34382,34382,34384,34376,
+34330,34330,34347,34347,34429,34452,34485,34485,
+34475,34475,34431,34405,34317,34317,34156,34156,
+33982,33937,33888,33888,33969,33969,34041,34070,
+34148,34148,34184,34184,34170,34148,34057,34057,
+33855,33855,33807,33811,33883,33883,33940,33940,
+33953,33947,33906,33906,33796,33796,33756,33752,
+33769,33769,33770,33770,33758,33746,33695,33695,
+33201,33201,33189,33205,33297,33297,33348,33348,
+33351,33335,33252,33252,33045,33045,32966,32952,
+32966,32966,32969,32969,32965,32958,32925,32925,
+32859,32859,32855,32862,32903,32903,32916,32916,
+32898,32889,32866,32866,32834,32834,32822,32819,
+32814,32814,32814,32814,32821,32823,32825,32825,
+32826,32826,32869,32894,32976,32976,33007,33007,
+32978,32971,32970,32970,33012,33012,33054,33072,
+33119,33119,33196,33196,33277,33301,33342,33342,
+33343,33343,33400,33433,33543,33543,33664,33664,
+33756,33785,33841,33841,33862,33862,33909,33934,
+34016,34016,34070,34070,34065,34065,34073,34073,
+34093,34093,34099,34097,34087,34087,33984,33984,
+33829,33759,33571,33571,33320,33320,33202,33205,
+33334,33334,30127,29671,28735,28219,29547,28521,
+24248,23105,23874,24249,24169,24005,25011,24240,
+24237,25115,24659,24615,24377,23984,23771,22700,
+22731,23767,24382,24287,23256,22918,22413,22134,
+19175,18261,17940,17023,19155,21727,25817,26113,
+25681,23274,23403,23341,23547,23549,23443,23382,
+22839,22468,21716,21266,20968,21174,21069,20953,
+21646,21941,20393,19956,19712,20050,19944,19786,
+20524,20135,20316,20466,20821,20939,21302,22785,
+23141,23410,23398,23545,23696,23986,24075,24189,
+24036,23658,23591,23617,23376,23254,22674,21994,
+21840,22891,23818,24489,25427,25925,26215,29623,
+26494,26545,30284,30284,30878,31157,31956,31956,
+33098,33098,33703,33882,34170,34170,34355,34355,
+34409,34446,34577,34577,34846,34846,35083,35173,
+35386,35386,35623,35623,35798,35846,35913,35913,
+35891,35891,35938,35971,36085,36085,36157,36157,
+36160,36164,36181,36181,36229,36229,36202,36176,
+36078,36078,35996,35996,35954,35943,35930,35930,
+35964,35964,35922,35889,35773,35773,35685,35685,
+35657,35643,35606,35606,35549,35549,35466,35425,
+35310,35310,35167,35167,35043,34997,34892,34892,
+34793,34793,34725,34701,34647,34647,34575,34575,
+34511,34489,34440,34440,34402,34402,34408,34419,
+34462,34462,34491,34491,34500,34503,34509,34509,
+34508,34508,34512,34515,34522,34522,34521,34521,
+34509,34507,34506,34506,34513,34513,34502,34496,
+34474,34474,34466,34466,34462,34466,34494,34494,
+34560,34560,34575,34578,34579,34579,32729,32299,
+32038,32077,31944,31738,31510,31631,31528,31392,
+31556,31282,29828,30178,31424,31362,32189,33998,
+33991,33991,34008,34016,34040,34040,34058,34058,
+34075,34090,34144,34144,34238,34238,34246,34238,
+34191,34191,34120,34120,34060,34048,34042,34042,
+34079,34079,34100,34089,34007,34007,34080,34080,
+32423,34017,33933,33933,33810,33810,33847,33879,
+34001,34001,31803,31038,30628,31554,32270,32217,
+33714,33714,33748,33764,33811,32973,32142,32111,
+32266,31859,31311,30458,28739,28985,29258,30058,
+29600,29253,29949,30380,30243,29706,29492,28751,
+26949,26553,26558,27122,27398,27321,27359,27006,
+28057,27880,26441,26315,25792,26798,26575,25303,
+24546,25298,26851,26239,25870,25647,27209,27857,
+29887,31624,30227,32126,33051,33842,33679,33524,
+33376,33089,32935,32541,32475,32877,32625,30846,
+30010,29634,30436,32108,32583,31775,31644,31364,
+30932,31057,31135,31132,31224,31229,30583,29876,
+29519,29088,29209,29618,30091,28947,27673,28662,
+29511,29657,29229,28077,26422,24838,22861,21717,
+18840,18422,18129,18507,18196,17930,18852,21245,
+24234,26909,26833,26369,25513,25653,25837,26361,
+26642,26813,27309,27827,28106,27394,27297,27251,
+26943,26656,26551,27778,28007,27638,26748,26290,
+24990,20798,20395,20692,23353,22611,23907,23464,
+23310,22992,22708,21627,21488,20294,18708,17796,
+18328,17508,17765,17936,18605,18780,19022,19665,
+21976,22640,22098,22963,25538,25972,25927,25228,
+25280,25287,24389,24104,24718,25044,24585,24320,
+24527,24645,24593,24387,24668,24930,23055,22281,
+22776,25010,25141,25123,26013,25834,25541,25938,
+25822,25636,25480,25580,27424,27216,27569,27569,
+27874,27874,28247,28399,28790,28790,29071,29071,
+29126,29166,23667,23078,22357,21841,21162,20897,
+21756,31361,32147,32147,32326,32362,32360,32360,
+32235,32235,32271,32325,32554,32554,32688,32688,
+32608,32593,32601,32601,32727,32727,32525,26395,
+26127,27094,33853,33853,33594,33569,33699,33699,
+33750,33750,33656,33613,33494,33494,33456,33456,
+33468,33484,33553,33553,33672,33672,33701,33701,
+33671,33671,33724,33724,33841,33872,33909,33909,
+33875,33875,33846,33834,33799,33799,33686,33686,
+33533,33489,33424,33424,33454,33454,33497,33520,
+33591,33591,33650,33650,33668,33660,33600,33600,
+33434,33434,33392,33395,33452,33452,33531,33531,
+33594,33600,33568,33568,33421,33421,33356,33343,
+33347,33347,33364,33364,33388,33385,33344,33344,
+33201,33201,33189,33205,33297,33297,33348,33348,
+33351,33335,33252,33252,33045,33045,32966,32952,
+32966,32966,32969,32969,32965,32958,32925,32925,
+32859,32859,32855,32862,32903,32903,32916,32916,
+32898,32889,32866,32866,32834,32834,32822,32819,
+32814,32814,32814,32814,32821,32823,32825,32825,
+32826,32826,32869,32894,32976,32976,33007,33007,
+32978,32971,32970,32970,33012,33012,33054,33072,
+33119,33119,33196,33196,33277,33301,33342,33342,
+33343,33343,33400,33433,33543,33543,33664,33664,
+33756,33785,33841,33841,33862,33862,33909,33934,
+34016,34016,34070,34070,34065,34065,34073,34073,
+34093,34093,34099,34097,34087,34087,33984,33984,
+33829,33759,33571,33571,33320,33320,33202,33205,
+33334,30497,29782,29439,28978,29573,29314,27745,
+23840,24026,24382,23607,23588,24439,23871,23697,
+24326,24301,24156,24213,23806,24091,23216,22460,
+22664,23526,25669,24089,23772,22615,21951,21047,
+19556,18610,16854,15474,18598,19928,24874,24549,
+24262,23187,23124,23153,23525,23432,23592,22935,
+22511,22046,21537,21227,21074,20873,20687,20571,
+21699,20721,20128,19924,19755,19730,19581,20154,
+19922,19904,20013,20407,20857,21244,21282,22503,
+22703,23097,23276,23323,23368,23759,23984,24117,
+23586,23602,23329,23303,23248,23303,23152,22615,
+22070,22684,23300,24023,24966,25598,25935,26145,
+25957,26011,30284,30284,30878,31157,31956,31956,
+33098,33098,33703,33882,34170,34170,34355,34355,
+34409,34446,34577,34577,34846,34846,35083,35173,
+35386,35386,35623,35623,35798,35846,35913,35913,
+35891,35891,35938,35971,36085,36085,36157,36157,
+36160,36164,36181,36181,36229,36229,36202,36176,
+36078,36078,35996,35996,35954,35943,35930,35930,
+35964,35964,35922,35889,35773,35773,35685,35685,
+35657,35643,35606,35606,35549,35549,35466,35425,
+35310,35310,35167,35167,35043,34997,34892,34892,
+34793,34793,34725,34701,34647,34647,34575,34575,
+34511,34489,34440,34440,34402,34402,34408,34419,
+34462,34462,34491,34491,34500,34503,34509,34509,
+34508,34508,34512,34515,34522,34522,34521,34521,
+34509,34507,34506,34506,34513,34513,34502,34496,
+34474,34474,34466,34466,34462,34466,34494,34494,
+34560,34560,34575,34578,34579,33174,32049,31835,
+31752,32005,32147,32197,32048,31895,31595,31116,
+31314,31299,30457,30762,31582,31673,31834,32676,
+33991,33991,34008,34016,34040,34040,34058,34058,
+34075,34090,34144,34144,34238,34238,34246,34238,
+34191,34191,34120,34120,34060,34048,34042,34042,
+34079,34079,34100,34089,34007,34007,34080,34080,
+31930,34017,33933,33933,33810,33810,33847,33879,
+34001,34001,31102,30549,30446,31702,32113,33711,
+33714,33714,33748,33764,33811,33811,32256,32064,
+32007,31084,30568,29655,28882,29197,29479,29976,
+29794,29781,28877,29923,29715,30166,30513,29801,
+27878,26569,26550,26457,26535,27109,26747,26429,
+26637,26302,25993,25752,25607,26575,26575,24826,
+24191,25349,27055,26845,26589,28386,29245,29335,
+30888,32062,30105,31971,32885,33644,33333,33112,
+32884,32466,32239,31844,32190,31626,32182,31179,
+31056,31179,32122,32569,32168,30479,30955,31062,
+31168,30946,30835,30527,30679,30092,29690,29660,
+29510,28935,28819,29476,30929,30037,26549,25615,
+25572,26079,26158,26155,26053,25078,22856,23186,
+17698,18470,18628,18309,18041,18180,21637,24014,
+25931,25855,25962,25265,25091,25138,25342,26137,
+26273,26710,27389,27396,27463,26937,26828,26815,
+26979,26787,26445,26227,26898,27765,28331,27691,
+27094,23796,23888,22067,22323,21250,21428,21449,
+22602,21897,21683,21377,20864,20683,19758,19211,
+19859,19151,18004,18350,18437,18264,20481,21999,
+23539,24217,23301,23863,25342,25253,25432,25055,
+25056,25043,24031,23360,23806,24858,24626,24157,
+23706,23824,23998,23935,24064,24488,23115,22116,
+22026,23968,24025,23933,25542,25703,25299,25703,
+25537,25159,25069,28811,27424,27216,27569,27569,
+27874,27874,28247,28399,28790,28790,29071,29071,
+29126,29166,23063,22505,21203,20206,19872,21252,
+31361,31361,32147,32147,32326,32362,32360,32360,
+32235,32235,32271,32325,32554,32554,32688,32688,
+32608,32593,32601,32601,32727,32727,32525,26740,
+26284,26364,28014,33853,33594,33569,33699,33699,
+33750,33750,33656,33613,33494,33494,33456,33456,
+33468,33484,33553,33553,33672,33672,33701,33701,
+33671,33671,33724,33724,33841,33872,33909,33909,
+33875,33875,33846,33834,33799,33799,33686,33686,
+33533,33489,33424,33424,33454,33454,33497,33520,
+33591,33591,33650,33650,33668,33660,33600,33600,
+33434,33434,33392,33395,33452,33452,33531,33531,
+33594,33600,33568,33568,33421,33421,33356,33343,
+33347,33347,33364,33364,33388,33385,33344,33344,
+32739,32739,32687,32693,32773,32773,32837,32837,
+32862,32858,32812,32812,32674,32674,32635,32635,
+32675,32675,32726,32726,32775,32777,32741,32741,
+32594,32594,32541,32531,32539,32539,32529,32529,
+32511,32502,32470,32470,32421,32421,32413,32415,
+32436,32436,32434,32434,32410,32405,32400,32400,
+32419,32419,32453,32469,32519,32519,32537,32537,
+32515,32509,32505,32505,32521,32521,32567,32591,
+32666,32666,32766,32766,32856,32888,32956,32956,
+33011,33011,33074,33102,33177,33177,33272,33272,
+33355,33386,33461,33461,33538,33538,33589,33608,
+33655,33655,33706,33706,33729,33739,33763,33763,
+33788,33788,33788,33782,33757,33757,33619,33619,
+33428,33352,33163,33163,32958,32958,32873,32888,
+33051,30163,29323,29506,29264,30128,28694,26673,
+23643,24324,24097,23912,23521,23687,22850,23063,
+23240,23005,23503,23669,23641,24331,23394,22823,
+18457,20329,23904,23333,23514,22251,21605,20284,
+18078,17578,17914,14082,16503,19185,24318,24013,
+23906,23375,23233,23286,23760,23272,23164,22490,
+22164,21769,21243,21049,20650,20236,20276,20254,
+20458,19941,19865,19954,19989,20314,19423,19451,
+19442,19667,19856,20055,20968,21124,20813,22003,
+22246,22719,23049,23082,22524,23628,23886,24106,
+23477,23424,23009,22808,22729,22823,23200,23028,
+22597,22653,23031,23665,24747,25169,25394,25398,
+25485,29818,30098,30098,30206,30338,30890,30890,
+31946,31946,32441,32565,32690,32690,32769,32769,
+32807,32836,32943,32943,33166,33166,33500,33652,
+34079,34079,34507,34507,34793,34889,35091,35091,
+35257,35257,35428,35503,35706,35706,35801,35801,
+35764,35756,35748,35748,35781,35781,35745,35717,
+35616,35616,35520,35520,35466,35460,35484,35484,
+35633,35633,35647,35626,35503,35503,35422,35422,
+35405,35394,35355,35355,35286,35286,35210,35176,
+35091,35091,34957,34957,34817,34767,34655,34655,
+34553,34553,34504,34490,34471,34471,34418,34418,
+34348,34321,34253,34253,34179,34179,34165,34169,
+34201,34201,34226,34226,34235,34239,34253,34253,
+34264,34264,34265,34263,34254,34254,34251,34251,
+34256,34257,34260,34260,34265,34265,34248,34238,
+34207,34207,34195,34195,34197,34204,34237,34237,
+34303,34303,34326,34331,34331,32946,31663,31486,
+31561,31650,31760,31839,31718,31626,31162,30698,
+31080,31367,31090,31065,31304,31600,32295,33358,
+33882,33882,33882,33884,33892,33892,33915,33915,
+33945,33966,34036,34036,34162,34162,34183,34178,
+34132,33188,34030,34030,33920,33890,33850,33850,
+33865,33865,33897,33908,33928,33928,34002,34002,
+31055,30489,33738,33738,33641,33641,33677,33726,
+33931,31567,30237,30284,30897,31611,33422,33422,
+33453,33453,33476,33475,32709,33446,31845,31751,
+31223,30006,29705,29397,29245,29390,29680,29841,
+29537,29524,29882,29654,29622,30286,30456,30071,
+28313,27672,26515,26134,26116,26122,26207,25807,
+26025,25861,25498,25074,24934,24880,25238,24441,
+25302,26083,27401,27105,26812,29924,30701,30697,
+31161,31783,29977,31814,32717,33439,33004,32715,
+32428,31837,31544,31136,31473,31168,31573,31509,
+31612,31832,31808,31551,30941,29608,29764,30002,
+29771,29837,29991,30128,30238,30168,29518,29336,
+29099,28642,28394,28930,30908,30956,29676,24485,
+23555,23287,23544,22816,24177,23678,23317,21919,
+20283,17882,21023,19881,20197,20960,24801,25739,
+26551,24444,23952,24211,24737,24308,24345,25614,
+26471,26901,27415,27396,27289,27183,27015,26824,
+26847,26836,26605,26154,26067,26004,26823,27338,
+28074,27821,26772,26205,24549,22878,22564,23574,
+23254,22406,21086,20111,21911,20051,19382,18764,
+18893,19435,18362,19572,18772,19323,22687,22922,
+23980,23537,24203,24561,24731,24939,25006,24801,
+24545,24580,24134,23741,23394,24245,24257,23945,
+23122,23128,23335,23452,23484,23777,23342,22422,
+22045,23378,23105,22781,23785,24703,24867,25570,
+25388,24673,24445,24495,27999,27650,27595,27595,
+27866,27866,28066,23744,28602,28602,28847,28847,
+28877,28824,28533,22107,20261,19272,19575,30346,
+31151,31151,31463,31463,31493,31487,31424,31424,
+31318,31318,31370,31428,31667,31667,31833,31833,
+31831,31845,31921,31921,32072,32072,32097,32143,
+26463,26200,26645,27382,32723,32715,32749,32749,
+32612,32612,32473,32436,32390,32390,32493,32493,
+32652,32723,32919,32919,33165,33165,33214,33203,
+33103,33103,33138,33138,33289,33323,33344,33344,
+33236,33236,33177,33162,33137,33137,33114,33114,
+33087,33072,33027,33027,32957,32957,32917,32909,
+32907,32907,32971,32971,33062,33083,33097,33097,
+33022,33022,32987,32979,32969,32969,33051,33051,
+33184,33208,33190,33190,33007,33007,32938,32928,
+32948,32948,32987,32987,33026,33020,32955,32955,
+32563,32563,32505,32508,32588,32588,32658,32658,
+32692,32692,32658,32658,32538,32538,32509,32511,
+32554,32554,32613,32613,32672,32675,32639,32639,
+32482,32482,32420,32407,32406,32406,32392,32392,
+32377,32367,32337,32337,32284,32284,32275,32278,
+32300,32300,32298,32298,32270,32263,32257,32257,
+32277,32277,32304,32317,32355,32355,32370,32370,
+32357,32354,32350,32350,32357,32357,32400,32424,
+32501,32501,32606,32606,32702,32737,32813,32813,
+32883,32883,32950,32977,33049,33049,33138,33138,
+33215,33246,33324,33324,33419,33419,33474,33494,
+33535,33535,33590,33590,33623,33634,33662,33662,
+33682,33682,33677,33670,33637,33637,33486,33486,
+33287,33210,33024,33024,32838,32838,32763,32778,
+29751,28747,28333,28987,29558,28029,26272,24569,
+23558,23601,23736,23466,23348,23156,22624,22558,
+22151,22085,22346,22115,22927,23461,23092,22660,
+21147,19363,20997,22263,22495,21124,20474,19562,
+20043,19870,18742,18789,16248,19174,23857,24014,
+23696,23491,23387,23393,23501,22924,22514,21997,
+21617,21165,20504,19948,19374,18750,19036,19852,
+18767,19205,19883,21215,21188,21390,19297,19891,
+19752,20041,20063,20121,20346,20394,20443,20932,
+21361,21614,22454,22669,23139,23903,24107,24076,
+21882,21864,21858,21948,21967,21950,22661,22858,
+22905,22598,22831,23428,24458,24576,24528,23906,
+23766,23909,24156,24411,30049,30146,30607,30607,
+31573,31573,32009,32113,32190,32190,32243,32243,
+32280,32307,32404,32404,32602,32602,32946,33106,
+33567,33567,34039,34039,34367,34481,34723,34723,
+34934,34934,35142,35232,35470,35470,35587,35587,
+35548,35536,35514,35514,35513,35513,35466,35438,
+35345,35345,35236,35236,35158,35150,35185,35185,
+35389,35389,35452,35448,35364,35364,35316,35316,
+35316,35309,35276,35276,35205,35205,35131,35099,
+35018,35018,34885,34885,34745,34693,34580,34580,
+34476,34476,34426,34413,34397,34397,34346,34346,
+34278,34251,34181,34181,34102,34102,34083,34086,
+34114,34114,34136,34136,34145,34149,34162,34162,
+34175,34175,34175,34173,34162,34162,34160,34160,
+34166,34168,34171,34171,34172,34172,34152,34142,
+34111,34111,34100,34100,34104,34111,34144,34144,
+34210,34210,34236,34242,34247,34247,31977,31015,
+30757,31249,31505,31345,30553,30316,30557,31263,
+31299,31182,30587,30239,29992,30459,31168,32345,
+33856,33856,33851,33848,33833,33833,33852,33852,
+33884,33906,33977,33977,34104,34104,34129,34126,
+34085,32595,31590,33983,33869,33838,33795,33795,
+33808,33808,33844,33859,33900,33900,33951,30574,
+30015,33824,33661,33661,33583,33583,33613,33659,
+30407,29259,28775,29579,30624,33379,33353,33353,
+33393,33393,33414,33408,32000,31151,30265,30476,
+30660,29915,29552,29668,30567,30243,29977,29733,
+29698,29324,28750,28826,28922,29293,29664,29935,
+29273,28455,26558,26283,26213,26159,25827,25561,
+25351,25043,24548,24714,24657,24646,24945,24802,
+25141,25641,25489,24387,25269,28684,29904,29931,
+30671,31100,31546,31498,32367,33053,32341,31892,
+31446,30561,30113,30724,31017,30951,31040,30953,
+30235,29890,29221,28996,28832,28616,28528,28496,
+28784,28998,29075,28962,29009,29031,28622,28356,
+28128,28163,28425,28391,28663,29274,29934,30055,
+29906,29772,28877,26480,26383,26136,25996,25817,
+25124,24191,23299,22364,22193,22007,23646,24920,
+25645,26117,26086,25856,26616,26132,26870,25630,
+25661,26345,26917,27041,26971,26820,26898,26914,
+26624,26453,26402,26284,26122,25954,26281,26215,
+26129,26106,26201,26435,27075,27281,27286,26805,
+26323,26349,26008,25845,26671,24883,23957,23929,
+23107,23016,23541,24090,25475,26343,24684,24114,
+23729,24064,24240,24667,24047,23616,23351,23479,
+23395,23093,23756,23923,23240,23084,22306,22109,
+22504,22296,21848,22012,22099,22591,22694,21774,
+20968,21862,22329,22334,21445,21414,21405,23188,
+24173,24419,23870,23674,23512,22966,23074,27645,
+27870,27870,28025,22425,21575,21017,20971,21036,
+20882,20121,19951,19929,18882,18507,18780,30340,
+31073,31073,31301,31301,31172,31132,31056,31056,
+30957,30957,31016,31078,31322,31322,31506,31506,
+31537,31564,31669,31669,31839,31839,31906,31946,
+26313,25506,25157,26118,32454,32458,32470,32470,
+32278,32278,32111,32067,32014,32014,32121,32121,
+32296,32373,32584,32584,32848,32848,32913,32909,
+32824,32824,32875,32875,33033,33069,33092,33092,
+32977,32977,32911,32891,32861,32861,32850,32850,
+32848,32841,32799,32799,32709,32709,32652,32636,
+32618,32618,32686,32686,32798,32826,32861,32861,
+32809,32809,32783,32775,32762,32762,32849,32849,
+32997,33024,33013,33013,32832,32832,32767,32759,
+32786,32786,32831,32831,32872,32865,32793,32793,
+32146,32146,32080,32082,32162,32162,32249,32249,
+32303,32312,32302,32302,32220,32220,32206,32212,
+32255,32255,32320,32320,32387,32394,32361,32361,
+32202,32202,32130,32112,32098,32098,32080,32080,
+32070,32062,32035,32035,31982,31982,31969,31970,
+31986,31986,31980,31980,31953,31946,31939,31939,
+31955,31955,31963,31966,31974,31974,31989,31989,
+32003,32006,32006,32006,31988,31988,32019,32041,
+32117,32117,32230,32230,32341,32382,32479,32479,
+32578,32578,32655,32684,32755,32755,32834,32834,
+32894,32923,33007,33007,33136,33136,33207,33228,
+33269,33269,33338,33338,33390,33407,33437,33437,
+33444,33444,33425,33411,33355,33355,33177,33177,
+32962,32884,32713,32713,32572,32572,32521,29507,
+29230,28206,28080,28503,28698,25642,24750,24273,
+23500,23254,23326,23850,22694,23322,22813,22370,
+21777,21942,21638,21840,22767,22525,22315,22317,
+20968,17952,18199,20386,22178,22521,21784,20842,
+21556,20760,18841,18830,17042,20610,23583,23608,
+23442,23270,23235,23847,22685,22403,22187,21591,
+21211,20829,20209,19886,19591,18641,19422,18937,
+18992,19517,19942,21192,20407,19394,19229,19721,
+20008,19875,19877,19952,20010,20023,20132,20605,
+20796,20951,21899,22743,23587,24091,24015,23803,
+21276,21247,21349,21523,21658,21728,22458,22849,
+22930,22461,22568,22882,23814,23924,23841,23249,
+22958,22977,23556,23736,29784,29824,30068,30068,
+30760,30760,31036,31087,31064,31064,31072,31072,
+31117,31140,31213,31213,31343,31343,31677,31841,
+32328,32328,32874,32874,33304,33456,33785,33785,
+34071,34071,34358,34481,34808,34808,34981,34981,
+34958,34941,34881,34881,34766,34766,34682,34653,
+34593,34593,34445,34445,34288,34268,34328,34328,
+34674,34674,34883,34937,34996,34996,35060,35060,
+35111,35118,35105,35105,35035,35035,34963,34933,
+34859,34859,34728,34728,34586,34534,34418,34418,
+34307,34307,34251,34235,34214,34214,34165,34165,
+34102,34076,34007,34007,33927,33927,33901,33900,
+33920,33920,33936,33936,33942,33945,33955,33955,
+33968,33968,33966,33964,33954,33954,33954,33954,
+33961,33962,33962,33962,33946,33946,33924,33915,
+33891,33891,33883,33883,33891,33899,33931,33931,
+33991,33991,34025,34037,34060,34060,32282,30999,
+30228,30385,30557,30419,29024,28998,29413,30841,
+31176,31110,29935,29209,28773,28894,29309,30378,
+33811,33811,33797,33776,33687,33687,33695,33695,
+33728,33748,33816,33816,33935,33935,33966,33968,
+33945,32400,31383,33857,33748,33718,33680,33680,
+33701,33701,33744,33765,33831,33831,30260,29546,
+29629,33548,33471,33471,31775,33447,33460,30334,
+29400,28466,28289,28823,29603,33092,31440,31664,
+33294,33294,33309,33293,33195,30996,30671,30984,
+31173,30667,30206,30155,30667,30845,30138,29228,
+29098,28717,28185,28382,28485,28161,29074,29628,
+29622,28889,28003,26250,26159,26091,25478,25451,
+25297,24300,24041,24290,24342,23993,24253,24918,
+25101,25273,26575,25466,25812,29245,30200,30531,
+30448,30822,31335,31329,32184,32850,32004,31486,
+30966,32385,30841,30472,30261,30264,29609,29825,
+29618,29316,28493,28223,27999,27781,27711,27858,
+28435,28521,28441,28573,28596,28479,28302,28053,
+28053,27894,27982,28122,28187,28308,29392,30557,
+30292,30192,30491,30392,29799,29323,28827,28376,
+26087,25963,25720,24825,22865,20982,20176,21922,
+22954,25150,25588,25663,26123,26669,27183,26900,
+26958,27024,26663,26911,26941,26483,26368,26441,
+26621,26584,26483,25996,25815,25790,26548,26747,
+26777,26551,26460,26451,26523,26520,26598,26696,
+26584,26217,26746,26140,25926,26479,25710,26381,
+25559,25238,25328,25927,24942,25727,24748,24342,
+24101,24361,24634,24649,23766,23413,23176,23108,
+23035,22547,22164,22723,23081,23205,22783,22574,
+22336,22117,21855,22192,22214,22397,22650,22138,
+21060,20815,21560,21365,21057,21076,21115,22227,
+23357,23738,22836,22470,22396,21947,21692,21776,
+22750,27886,27958,28031,21260,20201,19521,19649,
+19786,19183,18787,18661,18213,17283,16642,18811,
+20282,22707,31025,31025,30400,30257,30164,30164,
+30081,30081,30161,30229,30491,30491,30723,30723,
+30839,30897,31075,31075,31299,31299,31417,31451,
+25986,25369,25603,26577,31880,31921,31900,31900,
+31591,31591,31345,31275,31167,31167,31229,31229,
+31394,31468,31678,31678,31952,31952,32065,32088,
+32088,32088,32200,32200,32373,32415,32451,32451,
+32341,32341,32259,32232,32174,32174,32172,32172,
+32204,32204,32168,32168,32051,32051,31968,31942,
+31897,31897,31975,31975,32127,32172,32245,32245,
+32239,32239,32240,32240,32239,32239,32346,32346,
+32515,32549,32552,32552,32390,32390,32345,32344,
+32387,32387,32444,32444,32484,32475,32391,32391,
+32146,32146,32080,32082,32162,32162,32249,32249,
+32303,32312,32302,32302,32220,32220,32206,32212,
+32255,32255,32320,32320,32387,32394,32361,32361,
+32202,32202,32130,32112,32098,32098,32080,32080,
+32070,32062,32035,32035,31982,31982,31969,31970,
+31986,31986,31980,31980,31953,31946,31939,31939,
+31955,31955,31963,31966,31974,31974,31989,31989,
+32003,32006,32006,32006,31988,31988,32019,32041,
+32117,32117,32230,32230,32341,32382,32479,32479,
+32578,32578,32655,32684,32755,32755,32834,32834,
+32894,32923,33007,33007,33136,33136,33207,33228,
+33269,33269,33338,33338,33390,33407,33437,33437,
+33444,33444,33425,33411,33355,33355,33177,33177,
+32962,32884,32713,32713,32572,32572,32521,29640,
+29166,28026,28198,28650,28367,25637,24748,23874,
+23664,23369,23417,23157,22892,22516,22328,22017,
+21555,21145,21488,22258,22723,22659,22347,21472,
+18664,18584,19932,18736,20477,21652,20855,19919,
+19653,17169,15798,16825,17088,20624,23238,23463,
+23315,24054,23818,23442,22165,21949,21622,21197,
+20974,20694,20168,19908,19699,19341,18910,19147,
+20711,20700,20486,20010,19336,18799,18722,18916,
+19299,19074,19076,19382,19558,19424,19637,20180,
+20332,20453,22120,23143,23907,24070,23904,23234,
+20882,20884,20798,20949,21249,21594,22427,22624,
+22787,22540,22399,22649,23337,23334,23270,22513,
+22204,22171,22513,22961,23327,29824,30068,30068,
+30760,30760,31036,31087,31064,31064,31072,31072,
+31117,31140,31213,31213,31343,31343,31677,31841,
+32328,32328,32874,32874,33304,33456,33785,33785,
+34071,34071,34358,34481,34808,34808,34981,34981,
+34958,34941,34881,34881,34766,34766,34682,34653,
+34593,34593,34445,34445,34288,34268,34328,34328,
+34674,34674,34883,34937,34996,34996,35060,35060,
+35111,35118,35105,35105,35035,35035,34963,34933,
+34859,34859,34728,34728,34586,34534,34418,34418,
+34307,34307,34251,34235,34214,34214,34165,34165,
+34102,34076,34007,34007,33927,33927,33901,33900,
+33920,33920,33936,33936,33942,33945,33955,33955,
+33968,33968,33966,33964,33954,33954,33954,33954,
+33961,33962,33962,33962,33946,33946,33924,33915,
+33891,33891,33883,33883,33891,33899,33931,33931,
+33991,33991,34025,34037,34060,34060,32279,30826,
+29991,30020,30049,29768,28792,28662,28883,29397,
+29505,29687,29465,28878,28568,29232,29612,30385,
+31836,33811,33797,33776,33687,33687,33695,33695,
+33728,33748,33816,33816,33935,33935,33966,33968,
+33529,32409,31474,33857,33748,33718,33680,33680,
+33701,33701,33744,33765,33831,33831,29866,29465,
+29550,30344,30707,30924,33447,33447,33460,30096,
+29139,28248,28020,28304,28659,30507,31210,31515,
+33294,33294,33309,33293,30852,30782,32230,32230,
+31523,31361,30755,30507,30613,30979,30767,29096,
+28858,28518,28143,27565,27877,28057,28359,28998,
+29882,29674,29151,27624,27200,26942,26249,26275,
+26301,25242,24427,24273,24298,24207,24307,24975,
+25181,25550,26374,27286,27862,30337,30490,30873,
+29975,30248,31099,31274,32069,32670,31725,31165,
+30600,31217,30532,29932,28919,28421,29144,29218,
+29322,28892,27876,27453,27299,27333,27202,27376,
+27732,27716,27832,28142,28195,28170,28103,27738,
+27921,28527,28584,28678,29283,29647,30390,30619,
+30057,29491,29783,29732,29174,29989,28834,28147,
+28332,27904,27020,25476,23473,21216,20332,20344,
+20561,22473,23219,24052,25283,25656,26083,26515,
+26733,26742,26457,26653,26317,26310,26249,26266,
+26138,26059,26018,25886,25793,25770,27129,27287,
+26826,26666,26519,26381,26202,26225,26216,25634,
+25486,25679,25197,24460,24324,25293,25104,25424,
+24799,24349,24464,24599,25050,24450,24091,24440,
+24124,23995,23931,23864,23374,23140,22571,22682,
+22554,22173,21758,21357,21342,22400,22728,22902,
+22381,21867,21584,21617,21355,21081,21546,21174,
+20646,19891,20030,20035,20376,20528,20440,20596,
+21548,22251,21589,21203,21157,20833,20692,20679,
+21381,21836,27958,28031,21066,20000,18535,18435,
+18601,18401,18125,18063,17816,16695,15642,16011,
+17433,19172,31025,31025,30400,30257,30164,30164,
+30081,30081,30161,30229,30491,30491,30723,30723,
+30839,30897,31075,31075,31299,31299,31417,31451,
+25947,25652,26404,31655,31880,31921,31900,31900,
+31591,31591,31345,31275,31167,31167,31229,31229,
+31394,31468,31678,31678,31952,31952,32065,32088,
+32088,32088,32200,32200,32373,32415,32451,32451,
+32341,32341,32259,32232,32174,32174,32172,32172,
+32204,32204,32168,32168,32051,32051,31968,31942,
+31897,31897,31975,31975,32127,32172,32245,32245,
+32239,32239,32240,32240,32239,32239,32346,32346,
+32515,32549,32552,32552,32390,32390,32345,32344,
+32387,32387,32444,32444,32484,32475,32391,32391,
+31602,31602,31562,31574,31669,31669,31779,31779,
+31854,31871,31880,31880,31816,31816,31792,31789,
+31803,31803,31833,31833,31860,31862,31842,31842,
+31769,31769,31735,31725,31715,31715,31708,31708,
+31713,31712,31701,31701,31666,31666,31636,31624,
+31592,31592,31580,31580,31588,31589,31588,31588,
+31578,31578,31552,31541,31508,31508,31535,31535,
+31607,31625,31639,31639,31587,31587,31585,31592,
+31632,31632,31738,31738,31876,31926,32045,32045,
+32157,32157,32257,32299,32406,32406,32490,32490,
+32518,32540,32619,32619,32779,32779,32882,32918,
+32995,32995,33096,33096,33167,33184,33206,33206,
+33172,33172,33121,33093,33008,33008,32807,32807,
+32593,32523,32384,32384,32303,32303,32276,32280,
+30046,28624,26515,26423,26946,26739,26190,25929,
+23159,23057,23271,23078,23374,23050,22421,22381,
+22056,21670,22344,22186,22467,23350,26577,22463,
+21322,20883,20864,20672,20859,19766,20086,19905,
+20250,19959,19383,19859,20676,21771,22698,23913,
+24027,23643,23389,22966,22002,21644,21375,21010,
+20832,20679,20294,20033,19743,19358,19005,17807,
+21552,21873,20197,20620,20231,19798,18111,18235,
+18283,18466,18644,18700,18658,19079,19382,19510,
+19894,21218,24299,24237,23888,22912,21554,20502,
+20297,20544,20944,21174,21846,22394,22343,22306,
+22288,22115,22090,22119,22358,22438,22414,21714,
+21028,20478,20804,21067,21445,22333,23058,23641,
+24212,30329,30212,30184,30168,30168,30228,30228,
+30318,30339,30349,30349,30311,30311,30462,30546,
+30812,30812,31278,31278,31793,31965,32312,32312,
+32529,32529,32850,33004,33446,33446,33746,33746,
+33814,33804,33683,33683,33304,33304,33145,33123,
+33168,33168,32946,32946,32609,32558,32642,32642,
+33213,33213,33719,33904,34320,34320,34660,34660,
+34826,34869,34918,34918,34872,34872,34800,34768,
+34679,34679,34547,34547,34419,34370,34257,34257,
+34132,34132,34043,34009,33934,33934,33869,33869,
+33827,33810,33769,33769,33730,33730,33712,33708,
+33709,33709,33711,33711,33707,33705,33704,33704,
+33700,33700,33702,33705,33718,33718,33727,33727,
+33726,33722,33704,33704,33653,33653,33632,33631,
+33638,33638,33646,33646,33654,33661,33682,33682,
+33715,33715,33753,33770,33822,33822,31889,30578,
+29968,30333,30382,29947,29799,30111,30249,29434,
+28934,28780,29217,29439,29868,31219,31159,30785,
+30321,30760,30945,32635,33596,33596,33482,33482,
+33499,33510,33551,33551,33619,33619,33656,33667,
+33686,33686,33656,33656,33601,33590,33587,33587,
+33678,33678,30660,29725,29582,29667,30102,30615,
+33218,33212,33278,33278,33313,33313,33357,29955,
+28384,27080,27498,27856,27898,28682,29140,29138,
+28759,28789,28868,29014,29525,29939,30246,30376,
+30408,31086,30907,30907,31019,31019,31138,32076,
+31580,30752,28794,28577,28686,29722,30309,30737,
+31303,31303,31297,31300,31326,31326,31443,31443,
+31564,31598,31650,30289,25824,24645,24453,25217,
+26064,27261,27742,27929,28807,28773,26132,26090,
+29881,31846,30228,31380,31931,32342,31313,30709,
+30098,29636,29178,29066,28823,29054,28622,29040,
+28429,27606,26860,26590,26414,26284,26160,26298,
+26986,27422,27886,27960,27741,27645,27786,27310,
+28231,28968,28881,29088,29887,30116,29966,29244,
+28872,28778,29299,28350,26242,25298,26313,27354,
+27839,26430,25788,24461,23878,22674,22248,22322,
+21810,19675,18767,18753,21110,22452,24592,26034,
+26067,26065,26006,25485,24987,25556,25857,26102,
+26285,26228,26128,25620,25085,25096,26272,24792,
+24922,25591,25424,25340,25533,25561,25563,25423,
+24757,24826,25134,24992,24658,23734,23085,22731,
+22742,22908,23297,24902,24937,24218,23068,23162,
+23511,23710,23690,23612,23026,22731,22707,22856,
+22584,22545,22083,21413,20509,18813,19797,20114,
+20442,20312,19855,19132,18848,18424,18061,17507,
+17440,18300,18646,18711,18420,18044,17481,16637,
+17038,18040,19024,18800,18459,18911,19404,19647,
+19817,19904,20040,19832,19638,19538,18791,18229,
+17641,16724,16747,17260,17760,17648,17483,16967,
+16163,15724,19111,30379,29794,29592,29174,29174,
+29117,29117,29209,29280,29542,29542,29838,29838,
+30068,30170,30449,30449,30765,30765,31019,31091,
+31197,31197,31606,31606,31702,31674,31442,31442,
+31105,31105,30730,30597,30306,30306,30159,30159,
+30153,30164,30224,30224,30351,30351,30548,30642,
+30917,30917,31190,31190,31352,31401,31481,31481,
+31472,31472,31391,31348,31216,31216,31135,31135,
+31119,31109,31073,31073,31014,31014,30962,30945,
+30914,30914,31000,31000,31158,31204,31275,31275,
+31255,31255,31298,31325,31417,31417,31575,31575,
+31734,31771,31801,31801,31731,31731,31736,31749,
+31806,31806,31862,31862,31882,31872,31797,31797,
+31602,31602,31562,31574,31669,31669,31779,31779,
+31854,31871,31880,31880,31816,31816,31792,31789,
+31803,31803,31833,31833,31860,31862,31842,31842,
+31769,31769,31735,31725,31715,31715,31708,31708,
+31713,31712,31701,31701,31666,31666,31636,31624,
+31592,31592,31580,31580,31588,31589,31588,31588,
+31578,31578,31552,31541,31508,31508,31535,31535,
+31607,31625,31639,31639,31587,31587,31585,31592,
+31632,31632,31738,31738,31876,31926,32045,32045,
+32157,32157,32257,32299,32406,32406,32490,32490,
+32518,32540,32619,32619,32779,32779,32882,32918,
+32995,32995,33096,33096,33167,33184,33206,33206,
+33172,33172,33121,33093,33008,33008,32807,32807,
+32593,32523,32384,32384,32303,32303,32276,30316,
+29561,28776,28051,27837,26812,25328,25259,25239,
+23375,23437,22523,22254,22167,22870,21642,21762,
+21652,21457,21668,21719,22642,23351,22414,22454,
+21214,20382,20425,20805,21142,19931,20055,19757,
+20540,20733,20764,19716,20974,21895,23362,23966,
+23734,23226,23083,22674,22049,21758,21579,21206,
+20926,20672,20276,19207,18903,18231,18004,17796,
+21054,21861,21909,20958,20573,19525,18109,18098,
+18170,18439,18422,18209,18385,18872,19103,19819,
+20688,27507,24510,24598,24379,21075,20721,20136,
+20099,26575,26575,26575,26575,26575,22386,22268,
+22082,21744,21694,21681,21628,21797,21886,21588,
+20966,20234,20113,20576,20970,21735,22657,23233,
+23299,23599,24324,30184,30168,30168,30228,30228,
+30318,30339,30349,30349,30311,30311,30462,30546,
+30812,30812,31278,31278,31793,31965,32312,32312,
+32529,32529,32850,33004,33446,33446,33746,33746,
+33814,33804,33683,33683,33304,33304,33145,33123,
+33168,33168,32946,32946,32609,32558,32642,32642,
+33213,33213,33719,33904,34320,34320,34660,34660,
+34826,34869,34918,34918,34872,34872,34800,34768,
+34679,34679,34547,34547,34419,34370,34257,34257,
+34132,34132,34043,34009,33934,33934,33869,33869,
+33827,33810,33769,33769,33730,33730,33712,33708,
+33709,33709,33711,33711,33707,33705,33704,33704,
+33700,33700,33702,33705,33718,33718,33727,33727,
+33726,33722,33704,33704,33653,33653,33632,33631,
+33638,33638,33646,33646,33654,33661,33682,33682,
+33715,33715,33753,33770,33822,33822,31605,30155,
+29303,29136,28714,28562,29526,29675,29668,29886,
+29463,28759,28562,29245,30298,31096,30675,30201,
+30341,30616,30656,30911,31678,32744,33482,33482,
+33499,33510,33551,33551,33619,33619,33656,33667,
+33686,33686,33656,33656,33601,33590,33587,33587,
+30993,30425,29668,28837,29332,29900,30586,31060,
+33218,33212,33278,33278,33313,33313,33357,29444,
+27715,26533,27132,27357,27425,27502,27447,27186,
+27040,27748,28001,28415,29039,29439,29314,29498,
+31180,31086,30907,30907,31019,31019,31138,31179,
+31268,31536,30430,30270,30306,31374,31925,31310,
+31303,31303,31297,31300,31326,31326,31443,31443,
+31564,31598,31650,31650,26392,26085,25973,25863,
+26338,27053,28458,28258,28088,26227,26076,25998,
+31534,30054,30519,31421,31873,32186,31099,30477,
+29852,29220,28885,28795,29031,28931,28881,28776,
+28104,27288,26638,26469,26197,25694,25733,25845,
+26543,27113,27539,27576,27253,27034,27599,27764,
+28229,28861,28939,28792,29151,29145,28761,28630,
+28615,28405,29037,29470,26450,23899,23332,24799,
+25368,25187,24680,23652,23062,22379,21294,21513,
+21891,21608,21143,20767,19636,20389,21983,23271,
+22447,22311,25415,25529,25813,26618,26502,25841,
+26507,26298,25441,25378,25266,25262,25800,25557,
+25757,25829,26014,26003,25548,24970,25253,25397,
+25445,25470,25616,25443,25255,24148,23385,22738,
+21982,22323,22720,23761,23613,23325,23015,23274,
+23647,23285,23155,22977,22503,22489,22258,22216,
+22151,21924,21390,21170,20915,19761,19322,19177,
+19289,19155,18760,18583,18499,18156,17626,17549,
+17431,17610,17452,17312,17020,16909,16624,16026,
+16060,16362,17147,17225,17221,18402,18798,18771,
+18832,19176,19458,19249,19062,19041,18830,18457,
+17862,16871,16959,16925,17025,17199,17270,17087,
+16225,15938,18017,20070,29794,29592,29174,29174,
+29117,29117,29209,29280,29542,29542,29838,29838,
+30068,30170,30449,30449,30765,30765,31019,31091,
+25445,25219,31606,31606,31702,31674,31442,31442,
+31105,31105,30730,30597,30306,30306,30159,30159,
+30153,30164,30224,30224,30351,30351,30548,30642,
+30917,30917,31190,31190,31352,31401,31481,31481,
+31472,31472,31391,31348,31216,31216,31135,31135,
+31119,31109,31073,31073,31014,31014,30962,30945,
+30914,30914,31000,31000,31158,31204,31275,31275,
+31255,31255,31298,31325,31417,31417,31575,31575,
+31734,31771,31801,31801,31731,31731,31736,31749,
+31806,31806,31862,31862,31882,31872,31797,31797,
+31104,31104,31093,31110,31209,31209,31325,31325,
+31406,31428,31459,31459,31432,31432,31415,31411,
+31407,31407,31421,31421,31436,31438,31432,31432,
+31405,31405,31382,31374,31349,31349,31346,31346,
+31371,31377,31382,31382,31359,31359,31326,31311,
+31266,31266,31253,31253,31270,31274,31277,31277,
+31260,31260,31218,31198,31136,31136,31159,31159,
+31255,31280,31309,31309,31260,31260,31254,31257,
+31283,31283,31373,31373,31503,31552,31669,31669,
+31783,31783,31890,31935,32052,32052,32147,32147,
+32188,32214,32303,32303,32476,32476,32593,32634,
+32726,32726,32829,32829,32893,32910,32924,32924,
+32879,32879,32820,32791,32703,32703,32517,32517,
+32338,32280,32171,32171,32114,32114,32093,30291,
+29249,29241,29589,28585,27278,25181,25261,24354,
+23572,24034,22784,22997,22282,22262,21728,21697,
+21866,22136,21994,22304,22385,22148,21816,21951,
+21346,20805,20281,20121,20686,19521,19966,20309,
+20014,20059,21015,21066,21158,22025,23141,23553,
+23483,23334,23117,22748,22244,22004,21802,21307,
+21013,20757,20428,19887,19445,18924,18632,18442,
+19903,21116,21691,20333,19263,18016,17895,17916,
+18059,18101,18109,18001,18020,18518,18644,19652,
+21841,27883,27593,24385,24236,20308,19715,19197,
+19101,19634,20049,26575,26575,26575,26575,26575,
+21917,21521,21387,21250,21302,21465,21601,21335,
+20706,19644,18952,19675,20566,21549,22197,22684,
+22828,22863,23703,29780,29798,29798,29875,29875,
+29934,29929,29843,29843,29634,29634,29609,29619,
+29695,29695,30007,30007,30450,30593,30871,30871,
+31007,31007,31277,31412,31811,31811,32159,32159,
+32336,32359,32299,32299,31926,31926,31751,31721,
+31747,31747,31490,31490,31155,31116,31253,31253,
+31904,31904,32569,32830,33466,33466,34008,34008,
+34299,34384,34523,34523,34554,34554,34499,34466,
+34350,34350,34234,34234,34162,34133,34063,34063,
+33974,33974,33893,33861,33778,33778,33703,33703,
+33654,33637,33601,33601,33583,33583,33567,33561,
+33549,33549,33530,33530,33508,33502,33491,33491,
+33488,33488,33493,33497,33511,33511,33517,33517,
+33513,33508,33487,33487,33436,33436,33419,33418,
+33430,33430,33442,33442,33451,33456,33467,33467,
+33476,33476,33509,33525,33571,33571,31247,30097,
+29327,28428,27897,28006,29847,30092,29674,29704,
+29629,29051,28936,29894,30849,30005,29374,28914,
+29335,29370,29249,29124,29914,31372,33339,33339,
+33355,33364,33389,33389,33408,33408,33460,33486,
+33566,33566,31265,33576,33538,33533,33543,33543,
+30291,29583,28710,29050,30155,31062,33252,33252,
+33230,33225,33219,33219,33269,33269,30167,28138,
+27103,26553,26973,26836,26829,26777,26682,26360,
+27300,27773,28116,28370,28645,28757,28845,29160,
+30744,30723,30757,30757,30904,30904,31039,31089,
+31202,31202,31209,31209,31220,31230,31271,31271,
+31284,31284,31281,31282,31292,31292,31384,31384,
+31554,31598,31650,31650,30633,29347,28584,26245,
+26400,26506,26499,26470,26397,26247,26013,27355,
+30100,30452,30788,31473,31820,32030,30884,30246,
+29602,29269,28918,28955,28862,28813,28811,28531,
+27919,27230,26572,26417,26011,25649,25637,25814,
+26248,26212,26559,26728,26660,26643,27318,27592,
+27931,28067,27898,28126,28278,28145,27631,27992,
+28049,28246,29383,29653,26455,24784,23955,23647,
+24004,23392,23286,22932,22419,22050,21430,21802,
+22924,24604,24648,25122,21857,20764,20079,19634,
+19435,20082,21912,22805,23937,24787,24624,24241,
+24278,24084,23113,23623,24641,25133,25537,25569,
+25233,25819,26163,26472,26184,25760,25539,25997,
+26343,26567,26258,26054,25625,24533,24169,23510,
+22672,22966,23228,23747,23291,23223,23741,23738,
+23600,23262,22892,22097,21853,21306,20864,20917,
+20994,20888,20534,20311,20225,20269,19826,19337,
+18800,18648,18651,18643,18481,18421,17453,17248,
+17181,17254,17000,16566,16252,16226,16102,15808,
+15555,15440,15318,15708,16369,18142,18397,18200,
+18021,18389,18546,18385,18369,18409,18447,18193,
+17799,17025,17076,17018,16903,16883,17048,16549,
+16340,16522,17774,19087,20471,29263,28813,28813,
+28771,28771,28860,28926,29174,29174,29159,29159,
+29384,29487,29774,29774,30111,30111,30430,30537,
+24480,30749,31049,31049,31244,24120,24219,31247,
+30920,30920,30076,29851,29571,29571,29375,29375,
+29258,29231,29207,29207,29276,29276,29474,29579,
+29902,29902,30213,30213,30391,30455,30596,30596,
+30699,30699,30658,30623,30483,30483,30399,30399,
+30388,30383,30375,30375,30363,30363,30338,30328,
+30304,30304,30358,30358,30470,30499,30523,30523,
+30458,30458,30489,30517,30627,30627,30781,30781,
+30911,30950,31013,31013,31049,31049,31110,31137,
+31213,31213,31276,31276,31294,31287,31236,31236,
+30914,30914,30915,30934,31033,31033,31147,31147,
+31230,31255,31294,31294,31288,31288,31276,31272,
+31264,31264,31275,31275,31292,31295,31293,31293,
+31276,31276,31254,31243,31211,31211,31208,31208,
+31240,31249,31259,31259,31240,31240,31210,31195,
+31151,31151,31138,31138,31155,31159,31161,31161,
+31148,31148,31102,31079,31008,31008,31026,31026,
+31124,31150,31184,31184,31146,31146,31143,31148,
+31174,31174,31257,31257,31377,31424,31533,31533,
+31645,31645,31751,31795,31910,31910,32012,32012,
+32066,32096,32194,32194,32368,32368,32486,32528,
+32620,32620,32717,32717,32775,32789,32800,32800,
+32757,32757,32701,32674,32590,32590,32419,32419,
+32258,32207,32108,32108,32051,32051,32032,31085,
+30642,30696,29981,26201,24583,25503,24556,24279,
+23964,23213,23046,23208,22525,22232,22793,22462,
+22852,22605,22841,22629,22000,21858,21984,20888,
+20933,21153,21193,20299,18953,19754,21150,21892,
+20285,20978,20678,22032,22142,22183,22327,22434,
+23001,22986,22624,22435,22454,22207,21848,21481,
+21325,21033,20695,20373,20029,19914,19564,19247,
+18662,18634,18818,19495,19644,19557,19355,18905,
+18483,18171,18212,18183,17978,18243,18441,20304,
+28008,28633,28207,27707,22560,20684,19240,18889,
+17842,17351,17919,21470,21492,21151,19450,19153,
+19596,20195,20472,20676,20871,21132,21342,21113,
+20836,20335,19534,20047,20583,20875,20824,20930,
+21246,21544,22341,29659,29723,29723,29796,29796,
+29839,29824,29709,29709,29457,29457,29382,29372,
+29389,29389,29630,29630,30015,30139,30376,30376,
+30479,30479,30710,30824,31169,31169,31513,31513,
+31732,31774,31765,31765,31461,31461,31299,31267,
+31266,31266,31007,31007,30701,30668,30810,30810,
+31433,31433,32114,32386,33071,33071,33677,33677,
+34020,34126,34312,34312,34389,34389,34346,34313,
+34188,34188,34084,34084,34044,34026,33981,33981,
+33915,33915,33847,33818,33741,33741,33663,33663,
+33605,33586,33548,33548,33532,33532,33516,33510,
+33494,33494,33467,33467,33436,33427,33415,33415,
+33416,33416,33422,33424,33435,33435,33438,33438,
+33432,33427,33408,33408,33364,33364,33348,33347,
+33356,33356,33366,33366,33376,33380,33388,33388,
+33390,33390,33420,33434,33477,33477,31070,30504,
+30257,28877,27717,27086,27729,27885,27976,29163,
+29909,30441,31055,31114,30703,29278,28747,28396,
+28774,29216,29736,30447,30861,30660,33281,33281,
+33323,33336,33357,33357,33363,33363,33419,33450,
+33553,33553,33571,33571,33530,31788,30686,30110,
+29436,29122,29206,30042,33156,33156,33242,33242,
+33215,33206,33194,28882,27145,26063,24918,24466,
+25264,25735,26604,26837,26751,26242,26411,26697,
+26704,26735,26735,26650,26975,27229,28247,28904,
+30608,30593,30658,30658,30814,30814,30958,31010,
+31135,31135,31164,31164,31177,31186,31217,31217,
+31236,31236,31240,31242,31249,31249,31363,31363,
+31514,31552,31954,30907,25936,25315,23492,25559,
+25858,26123,27204,27897,28518,30014,30332,30546,
+31106,31214,31337,31574,31678,31692,30459,29785,
+30263,28757,28459,28283,28419,28360,28114,27678,
+27168,26773,26008,25701,25581,25414,25248,25055,
+25392,25545,25501,25730,26004,26314,26762,26988,
+27157,27110,26954,26695,26406,26319,26302,26952,
+27441,28006,29016,29063,28853,28066,28308,28164,
+28665,28010,27790,27507,27257,27329,26534,26120,
+25325,22733,21399,22189,24403,24977,24738,23965,
+24124,24535,24385,23718,22962,21896,21659,21569,
+21509,21007,20337,21127,21117,20648,21423,23502,
+25698,26043,26021,25990,25957,25950,25978,25937,
+25895,25839,25612,25021,23342,22224,23044,23687,
+22741,22663,22884,22731,22792,21692,21841,21633,
+21458,21022,20785,20342,19838,20170,20304,19604,
+19208,18367,18350,18088,19308,18472,18467,18852,
+18355,18026,17891,17328,17606,17642,17601,17219,
+16786,16973,16919,16595,15919,15556,15115,14505,
+14573,14726,14437,14600,15368,17196,17559,17593,
+18043,18004,17312,16772,16844,17089,17199,16865,
+17566,17018,16956,17008,17084,16993,16954,16824,
+16819,16884,18121,18846,19466,20385,20904,28779,
+28729,19420,18884,28870,29075,29075,28990,28990,
+29147,29233,29502,29502,29833,29833,30154,30262,
+30480,23527,22695,22539,21868,21539,21090,22836,
+30528,30528,29742,29539,29312,29312,29128,29128,
+28986,28950,28911,28911,28979,28979,29164,29259,
+29553,29553,29848,29848,30035,30105,30269,30269,
+30414,30414,30396,30367,30240,30240,30171,30171,
+30174,30174,30180,30180,30184,30184,30169,30162,
+30142,30142,30181,30181,30267,30285,30288,30288,
+30200,30200,30216,30240,30340,30340,30478,30478,
+30589,30625,30698,30698,30778,30778,30860,30892,
+30974,30974,31042,31042,31062,31058,31019,31019,
+30457,30457,30485,30509,30606,30606,30717,30717,
+30799,30828,30890,30890,30942,30942,30948,30946,
+30929,30929,30938,30938,30966,30972,30982,30982,
+30979,30979,30951,30934,30878,30878,30872,30872,
+30926,30941,30965,30965,30952,30952,30930,30920,
+30887,30887,30876,30876,30882,30884,30888,30888,
+30888,30888,30838,30809,30717,30717,30720,30720,
+30813,30841,30886,30886,30882,30882,30899,30909,
+30942,30942,31007,31007,31094,31130,31216,31216,
+31318,31318,31415,31455,31559,31559,31681,31681,
+31780,31824,31945,31945,32118,32118,32233,32273,
+32359,32359,32436,32436,32470,32478,32483,32483,
+32449,32449,32408,32386,32322,32322,32199,32199,
+32092,32055,31980,31980,31917,31917,31892,31196,
+30821,31037,30676,29172,25301,24690,24195,23803,
+23652,23174,23102,22313,22276,22240,23526,23007,
+22408,21091,21154,21065,21091,21501,21545,21526,
+21147,21265,21116,20537,19765,19506,21341,22416,
+19778,20549,20131,21443,21684,21718,21881,22025,
+22485,22917,22517,22281,22516,22348,21966,21556,
+21276,21189,20870,20626,20318,18963,18709,18614,
+18402,19100,19718,20398,20426,20414,20268,20150,
+19999,18695,18234,18073,18257,18530,19207,20104,
+28156,28840,28372,23609,22479,20906,19642,18943,
+17863,17668,18402,26575,21697,20407,17075,17412,
+19326,22378,20763,20735,20966,21359,21631,21315,
+21023,20416,17769,18842,19792,20380,20056,20159,
+20457,20642,21346,29413,29632,29632,29677,29677,
+29671,29634,29459,29459,29132,29132,28966,28912,
+28809,28809,28859,28859,29068,29133,29253,29253,
+29279,29279,29384,29438,29600,29600,29906,29906,
+30232,30327,30474,30474,30416,30416,30314,30277,
+30191,30191,29932,29932,29733,29720,29858,29858,
+30339,30339,30996,31279,32037,32037,32774,32774,
+33252,33410,33723,33723,33934,33934,33930,33899,
+33751,33751,33681,33681,33730,33745,33772,33772,
+33774,33774,33748,33732,33679,33679,33597,33597,
+33508,33480,33429,33429,33418,33418,33400,33391,
+33368,33368,33322,33322,33267,33254,33236,33236,
+33255,33255,33258,33259,33256,33256,33246,33246,
+33237,33233,33223,33223,33206,33206,33194,33190,
+33184,33184,33186,33186,33196,33198,33200,33200,
+33186,33186,33207,33218,33254,33254,31343,30932,
+30586,30059,29731,29465,29481,29656,29932,30922,
+31511,31825,32156,32118,31865,31506,31548,31569,
+31504,31532,31811,30583,29063,29391,33137,33137,
+33272,33302,33318,32514,32453,33298,33363,33407,
+33564,33564,33593,33593,33530,31273,30138,29507,
+29210,29400,29883,32909,33065,33065,33242,33242,
+33148,33130,28211,27591,25110,24873,25205,25172,
+25729,25766,26605,26973,26789,26244,26557,27028,
+27659,27606,27596,27277,27131,27053,27485,27992,
+30320,30292,30365,30365,30543,30543,30704,30767,
+30921,30921,31041,31041,31066,31066,31042,31042,
+31067,31067,31097,31104,31109,31109,31310,31310,
+31371,26531,25312,24470,22491,22725,24882,27257,
+27799,27838,28030,28466,28895,30129,30535,30958,
+31416,31455,31494,31547,31577,31526,30779,30520,
+30197,28709,28263,27869,27957,27962,27746,27107,
+26645,26282,25866,25732,25560,25508,25249,25152,
+25224,25137,25174,25469,25783,26052,26480,26775,
+26932,26789,26685,26339,26155,26288,26450,27962,
+28284,28519,28235,28171,28166,27663,27600,27584,
+27280,27194,26426,25939,26796,26489,26064,26150,
+26081,25583,24785,24491,25262,25415,25392,25087,
+24698,24546,24977,25300,25616,25835,25299,24603,
+21726,20424,19331,19418,19197,20115,22007,24013,
+25166,25360,25008,23755,24590,24940,25442,25359,
+24849,23613,22360,22376,21371,21889,23296,23784,
+22012,21679,22332,22321,22253,21962,21477,21225,
+20433,18269,18949,18650,18002,18335,18353,17642,
+17333,17494,18189,17768,18325,18000,18073,18512,
+18164,17588,17161,16740,16936,17058,17132,17067,
+16810,16413,16214,15923,15671,15526,15201,14507,
+14579,14591,14494,15005,15840,16977,17158,17352,
+17952,17656,17127,16460,16360,16611,16833,16727,
+17463,16888,16841,17120,16684,16617,16650,16432,
+16472,16549,17824,18344,18379,18062,18856,19497,
+18615,17479,16783,17144,17956,19054,28701,28701,
+28606,28627,28824,28824,29125,29125,29424,29522,
+29711,24036,23983,22181,23036,21297,20101,20593,
+22216,22433,23516,28752,28714,28714,28603,28603,
+28417,28369,28315,28315,28412,28412,28542,28600,
+28765,28765,28985,28985,29190,29275,29496,29496,
+29739,29739,29788,29781,29701,29701,29687,29687,
+29739,29758,29805,29805,29843,29843,29850,29850,
+29841,29841,29840,29840,29854,29844,29786,29786,
+29638,29638,29605,29610,29666,29666,29748,29748,
+29799,29829,29924,29924,30111,30111,30244,30290,
+30386,30386,30465,30465,30495,30500,30495,30495,
+30457,30457,30485,30509,30606,30606,30717,30717,
+30799,30828,30890,30890,30942,30942,30948,30946,
+30929,30929,30938,30938,30966,30972,30982,30982,
+30979,30979,30951,30934,30878,30878,30872,30872,
+30926,30941,30965,30965,30952,30952,30930,30920,
+30887,30887,30876,30876,30882,30884,30888,30888,
+30888,30888,30838,30809,30717,30717,30720,30720,
+30813,30841,30886,30886,30882,30882,30899,30909,
+30942,30942,31007,31007,31094,31130,31216,31216,
+31318,31318,31415,31455,31559,31559,31681,31681,
+31780,31824,31945,31945,32118,32118,32233,32273,
+32359,32359,32436,32436,32470,32478,32483,32483,
+32449,32449,32408,32386,32322,32322,32199,32199,
+32092,32055,31980,31980,31917,31917,31892,31585,
+31007,30857,31177,29875,25891,24574,24716,24054,
+23545,23151,23609,22143,22464,22607,23133,22986,
+21544,20175,19741,19240,20276,20894,21084,22242,
+21635,21593,21302,20378,19386,19175,21591,22538,
+20057,19801,20369,20601,20688,21107,21036,21186,
+21987,22348,22152,21855,22253,22289,21930,21263,
+20961,20857,20592,20385,20146,19345,19264,18856,
+19368,19781,20180,20547,20507,20422,17773,18753,
+20363,19435,18321,17975,18707,18851,18936,19703,
+21288,28083,27659,23056,22043,21222,19901,18757,
+17404,17595,18580,23000,23123,19400,15613,16493,
+17993,21734,21784,21865,22176,22662,23157,21703,
+20950,19773,19185,19619,19669,19565,19363,19298,
+19774,19963,20578,29413,29632,29632,29677,29677,
+29671,29634,29459,29459,26006,29132,28966,28912,
+28809,28809,28859,28859,29068,29133,29253,29253,
+29279,29279,29384,29438,29600,29600,29906,29906,
+30232,30327,30474,30474,30416,30416,30314,30277,
+30191,30191,29932,29932,29733,29720,29858,29858,
+30339,30339,30996,31279,32037,32037,32774,32774,
+33252,33410,33723,33723,33934,33934,33930,33899,
+33751,33751,33681,33681,33730,33745,33772,33772,
+33774,33774,33748,33732,33679,33679,33597,33597,
+33508,33480,33429,33429,33418,33418,33400,33391,
+33368,33368,33322,33322,33267,33254,33236,33236,
+33255,33255,33258,33259,33256,33256,33246,33246,
+33237,33233,33223,33223,33206,33206,33194,33190,
+33184,33184,33186,33186,33196,33198,33200,33200,
+33186,33186,33207,33218,33254,33254,33154,33154,
+31255,33176,33169,33169,33120,33120,33075,33053,
+32988,32988,32968,32968,32991,33158,32992,32946,
+32464,32286,31857,30761,30178,30139,31067,32099,
+33021,33209,32489,31810,31343,31325,31514,33407,
+33564,33564,33593,33593,33530,30498,29691,29180,
+29353,30043,30681,32909,33065,33065,33242,33242,
+29010,26964,26202,25906,25201,25537,25698,25779,
+26374,26249,26626,26736,26512,26259,26441,26964,
+27975,28070,27825,27709,27533,27150,27133,27464,
+28064,30292,30365,30365,30543,30543,30704,30767,
+30921,30921,31041,31041,31066,31066,31042,31042,
+31067,31067,31097,31104,31109,31109,31310,31801,
+27170,25545,25603,26063,25544,25725,26199,27014,
+26235,26233,27171,27722,28006,29056,29554,30239,
+30780,30893,31004,31216,31327,31340,30455,30438,
+30174,28589,28132,27820,27501,27473,27254,26577,
+26291,25938,25743,25573,25392,25473,25440,25256,
+25201,25178,25026,25281,25466,25682,25946,26165,
+26259,26200,26078,26169,26193,26505,27161,27645,
+27786,27664,27509,27474,27311,26458,26031,25927,
+25768,25514,25209,25831,25956,25882,25292,25497,
+25734,25951,26224,26769,26051,25702,25619,25742,
+25571,25261,25003,24231,25131,25183,24087,22747,
+20400,19688,19908,21082,21445,22632,25015,25130,
+24640,23088,22626,22401,23250,23583,23947,23410,
+22512,22161,21542,21359,21965,23370,23320,23359,
+21991,22093,22366,22007,21474,21122,20769,20985,
+20311,18427,18372,18925,17942,16933,16644,16637,
+16687,17884,17606,17777,16963,17908,18049,18232,
+18235,17955,17702,16887,16579,16478,16503,16666,
+16697,16465,16041,15578,15268,15147,14968,14833,
+14767,14472,14431,14854,15660,16435,16611,16982,
+17494,17272,16855,16588,16446,16632,16740,17082,
+17104,17044,17095,17123,16880,16722,16660,16089,
+16092,16403,17676,17752,17217,17603,18230,18718,
+17546,16444,15669,15157,15635,16546,28701,28701,
+28606,28627,28824,28824,29125,29125,29424,29522,
+29711,29711,24217,23728,23219,21082,20469,19974,
+21422,22311,23993,28752,28714,28714,28603,28603,
+28417,28369,28315,28315,28412,28412,28542,28600,
+28765,28765,28985,28985,29190,29275,29496,29496,
+29739,29739,29788,29781,29701,29701,29687,29687,
+29739,29758,29805,29805,29843,29843,29850,29850,
+29841,29841,29840,29840,29854,29844,29786,29786,
+29638,29638,29605,29610,29666,29666,29748,29748,
+29799,29829,29924,29924,30111,30111,30244,30290,
+30386,30386,30465,30465,30495,30500,30495,30495,
+29911,29911,29971,30006,30114,30114,30213,30213,
+30268,30290,30344,30344,30405,30405,30419,30420,
+30406,30406,30414,30414,30440,30449,30471,30471,
+30494,30494,30492,30486,30462,30462,30475,30475,
+30525,30539,30553,30553,30530,30530,30525,30526,
+30538,30538,30547,30547,30547,30548,30555,30555,
+30575,30575,30537,30512,30428,30428,30420,30420,
+30487,30508,30549,30549,30560,30560,30598,30619,
+30678,30678,30740,30740,30792,30814,30879,30879,
+30971,30971,31056,31091,31180,31180,31306,31306,
+31426,31476,31602,31602,31758,31758,31866,31904,
+31987,31987,32051,32051,32070,32075,32083,32083,
+32081,32081,32067,32056,32015,32015,31962,31962,
+31935,31922,31882,31882,31813,31813,31786,31783,
+31137,29922,31139,30298,26254,26224,26663,26325,
+24870,24872,24257,20321,21755,22799,22149,21871,
+20223,14654,14218,14506,14708,16879,19257,19796,
+18364,18541,17153,17063,17457,21167,21967,22095,
+16842,16123,20912,21174,21039,20944,21720,22531,
+23689,23659,22950,22180,21688,21382,20716,19868,
+19643,19676,19683,19614,19390,19012,19041,19372,
+20322,20467,20514,20416,18590,18297,17948,17725,
+17780,19767,19474,18323,17502,18189,18938,19736,
+20381,26575,26575,22961,21850,20363,19581,18536,
+17526,21699,21717,22346,22673,18987,14668,15105,
+15591,15976,16460,17204,18982,19337,19408,20424,
+20570,19420,18110,18417,18555,18291,17247,17417,
+17921,18324,18907,20080,20180,20986,29652,29652,
+29626,29581,29381,29381,25161,24067,24466,28743,
+28566,28566,28476,28476,28323,28295,28306,28306,
+28255,28255,28257,28262,28290,28290,28515,28515,
+28837,28942,29149,29149,29244,29244,29222,29203,
+29124,29124,28914,28914,28771,28760,28851,28851,
+29202,29202,29773,30029,30740,30740,31551,31551,
+32167,32386,32866,32866,33279,33279,33417,33438,
+33404,33404,33409,33409,33473,33494,33530,33530,
+33545,33545,33527,33514,33468,33468,33400,33400,
+33327,33304,33266,33266,33261,33261,33247,33240,
+33216,33216,33166,33166,33106,33090,33067,33067,
+33080,33080,33070,33063,33038,33038,33018,33018,
+33013,33012,33013,33013,33014,33014,33007,33002,
+32987,32987,32982,32982,32990,32992,32990,32990,
+32979,32979,32992,33001,33028,33028,33056,33056,
+33080,33084,33082,33082,33051,33051,33025,33010,
+32964,32964,32935,32935,32944,32801,32562,32422,
+32292,32005,31541,30610,30381,30082,29479,29943,
+30886,32107,31781,30849,28171,26921,26575,30235,
+31222,31786,31674,30994,30005,29071,29507,29853,
+32676,32676,32844,32889,32949,32949,27651,26935,
+27145,26915,26882,27107,27743,27587,27163,26049,
+25851,26064,26340,26189,25706,25759,25769,25963,
+27407,27304,27448,27558,27603,27502,27361,27267,
+27467,30101,30164,30164,30171,30171,30314,30376,
+30541,30541,30699,30699,30894,30858,30481,30481,
+30405,30405,30410,30505,30968,31186,29857,29581,
+29342,28671,27101,26139,26263,26357,26346,26098,
+26024,26057,26330,26510,26820,27469,27986,28499,
+29225,29540,29853,30474,30782,30173,29793,29893,
+29573,27953,27578,27298,26768,26664,26559,25876,
+25513,25216,24848,24797,24988,25395,25453,25636,
+26011,25767,25198,25029,25077,25080,25223,25227,
+25189,25309,25424,25451,25820,26144,26302,26204,
+26206,26162,25850,25294,25138,24720,24701,25038,
+25404,25392,25564,25861,25751,25439,25214,24982,
+24207,24652,25607,25856,25649,25177,25132,24848,
+25161,25339,23978,22584,23929,24555,24539,23878,
+24441,24209,23512,23261,22934,23469,23102,23764,
+24074,23160,23436,23546,23169,22988,23078,22171,
+22599,22801,23450,23673,23640,21718,20979,20431,
+19924,19745,19397,19506,19332,19005,17723,17448,
+17899,17973,18234,18085,17326,16697,18004,18796,
+18632,17661,17660,17063,17344,17041,16657,16537,
+16036,16380,16536,16715,16473,16101,15634,15413,
+15066,14634,14784,14983,15073,15050,15027,15155,
+15024,14711,14663,14637,14515,14420,15044,15783,
+16625,16674,16564,16677,16059,16871,16778,16632,
+16504,16549,16274,16147,16022,16067,15830,14947,
+14805,15272,16685,16732,16516,16586,17071,17480,
+17196,16612,16077,15682,15291,15177,15804,17257,
+28305,28252,28174,28174,28386,28386,28635,28723,
+28911,28911,28577,23716,22924,22138,22404,27828,
+27799,27799,28001,28061,28160,28160,28137,28137,
+27993,27957,27920,27920,28010,28010,28078,28100,
+28145,28145,28255,28255,28413,28483,28674,28674,
+28905,28905,28991,29008,29011,29011,29076,29076,
+29176,29216,29313,29313,29406,29406,29449,29462,
+29477,29477,29457,29457,29420,29394,29299,29299,
+29132,29132,29077,29072,29106,29106,29150,29150,
+29160,29180,29275,29275,29501,29501,29639,29683,
+29766,29766,29832,29832,29858,29867,29887,29887,
+29911,29911,29971,30006,30114,30114,30213,30213,
+30268,30290,30344,30344,30405,30405,30419,30420,
+30406,30406,30414,30414,30440,30449,30471,30471,
+30494,30494,30492,30486,30462,30462,30475,30475,
+30525,30539,30553,30553,30530,30530,30525,30526,
+30538,30538,30547,30547,30547,30548,30555,30555,
+30575,30575,30537,30512,30428,30428,30420,30420,
+30487,30508,30549,30549,30560,30560,30598,30619,
+30678,30678,30740,30740,30792,30814,30879,30879,
+30971,30971,31056,31091,31180,31180,31306,31306,
+31426,31476,31602,31602,31758,31758,31866,31904,
+31987,31987,32051,32051,32070,32075,32083,32083,
+32081,32081,32067,32056,32015,32015,31962,31962,
+31935,31922,31882,31882,31813,31813,31786,31783,
+30791,29901,30893,30335,26575,25179,25256,25199,
+25508,25283,24966,22179,20640,21487,21215,19731,
+19087,14721,14645,15345,15677,16301,18153,17471,
+17638,17984,16067,16110,16664,20913,22143,19860,
+15848,17973,21108,21821,21604,21766,23330,24122,
+24118,23709,23365,22860,21950,21438,20439,19680,
+19467,19345,19306,19223,19134,18944,19193,19640,
+20421,20360,20298,20259,18980,18197,17496,17425,
+17312,19400,19294,18459,17704,18038,18337,19382,
+26575,21860,26575,26575,22017,19971,18702,17775,
+17548,21318,21398,21952,22336,22430,21938,21667,
+18604,15796,16717,17969,18975,19046,18771,19750,
+20018,19766,19299,19235,19026,17667,16850,16286,
+17935,18259,19134,19962,20475,20557,22283,23245,
+23967,29581,29381,29381,29028,24242,23361,24068,
+24338,24601,28476,28476,28323,28295,28306,28306,
+28255,28255,28257,28262,28290,28290,28515,28515,
+28837,28942,29149,29149,29244,29244,29222,29203,
+29124,29124,28914,28914,28771,28760,28851,28851,
+29202,29202,29773,30029,30740,30740,31551,31551,
+32167,32386,32866,32866,33279,33279,33417,33438,
+33404,33404,33409,33409,33473,33494,33530,33530,
+33545,33545,33527,33514,33468,33468,33400,33400,
+33327,33304,33266,33266,33261,33261,33247,33240,
+33216,33216,33166,33166,33106,33090,33067,33067,
+33080,33080,33070,33063,33038,33038,33018,33018,
+33013,33012,33013,33013,33014,33014,33007,33002,
+32987,32987,32982,32982,32990,32992,32990,32990,
+32979,32979,32992,33001,33028,33028,33056,33056,
+33080,33084,33082,33082,33051,33051,33025,33010,
+32964,32964,32935,32935,32944,32966,32925,32643,
+32221,32083,31790,30349,30018,29669,28823,28973,
+29841,31377,31328,30268,26575,26548,27051,30102,
+30328,30256,30604,30531,29595,28797,28603,28352,
+32676,32676,32844,32889,32949,32949,27835,27639,
+28045,28505,28185,27715,26851,26441,26163,25576,
+25697,25734,26618,26495,25984,25352,25562,26030,
+26929,27236,26703,27133,27345,27388,27362,27257,
+27249,30101,30164,30164,30171,30171,30314,30376,
+30541,30541,30699,30396,30179,30858,30481,30481,
+30405,30405,30410,31020,30567,30381,29434,29256,
+28966,28184,26623,25916,25839,26330,26359,26166,
+26180,26163,25960,26107,26286,27139,27228,27624,
+28447,28862,29273,30098,30507,30773,29898,29621,
+29257,27720,27259,26941,26425,26301,26156,25394,
+25002,24676,24530,24463,24512,25116,25256,25459,
+25333,25125,25561,24771,24843,24932,24851,24756,
+24836,25271,25157,25133,25164,25468,25770,25957,
+25715,25497,25103,24978,24978,25069,25115,25216,
+25079,24888,24787,24452,24305,24181,24314,24417,
+24097,24417,25220,25574,25735,25418,24201,20941,
+21463,22124,22647,23769,25142,25808,25179,24775,
+23692,22783,21832,21617,21649,21723,21299,21696,
+22028,21942,21759,21499,21418,21426,21409,21115,
+21334,21235,21382,21509,21482,19291,18461,18654,
+19549,19444,18845,18179,17996,17502,16726,17022,
+17013,16437,16355,16174,16717,17107,17450,18320,
+17962,17522,17485,17308,16978,16828,16716,16367,
+15859,15698,15503,16041,15973,15671,15333,15017,
+14667,14050,13988,13973,14102,14459,14941,15152,
+15084,14821,15043,15217,15075,14170,14519,15090,
+16056,16601,17418,17049,16916,16789,16594,16262,
+15986,15659,15536,15453,15237,15249,15192,15182,
+15156,15262,15792,16131,16266,15878,15843,16477,
+17413,16676,16311,15598,15723,15205,14466,15185,
+16856,28252,28174,28174,28386,28386,28635,28723,
+28911,28911,28577,28577,22842,28067,27828,27828,
+27799,27799,28001,28061,28160,28160,28137,28137,
+27993,27957,27920,27920,28010,28010,28078,28100,
+28145,28145,28255,28255,28413,28483,28674,28674,
+28905,28905,28991,29008,29011,29011,29076,29076,
+29176,29216,29313,29313,29406,29406,29449,29462,
+29477,29477,29457,29457,29420,29394,29299,29299,
+29132,29132,29077,29072,29106,29106,29150,29150,
+29160,29180,29275,29275,29501,29501,29639,29683,
+29766,29766,29832,29832,29858,29867,29887,29887,
+29492,29492,29579,29622,29753,29753,29836,29836,
+29843,29847,29859,29859,29870,29870,29874,29876,
+29882,29882,29892,29892,29906,29915,29942,29942,
+29992,29992,30041,30061,30116,30116,30161,30161,
+30178,30179,30166,30166,30113,30113,30130,30148,
+30226,30226,30272,30272,30269,30271,30285,30285,
+30319,30319,30305,30293,30243,30243,30232,30232,
+30262,30272,30288,30288,30290,30290,30340,30369,
+30461,30461,30531,30531,30562,30579,30632,30632,
+30725,30725,30801,30832,30907,30907,31016,31016,
+31125,31168,31277,31277,31408,31408,31507,31544,
+31630,31630,31694,31694,31714,31722,31746,31746,
+31785,31785,31796,31792,31761,31761,31766,31766,
+31821,31833,31834,31834,31772,31772,31749,31737,
+30726,28482,30090,29428,26360,21643,24419,24701,
+25478,25789,25049,23785,21220,20619,19978,19589,
+19154,16720,16525,16706,16889,17849,17830,15656,
+15111,14540,14852,14943,17062,21450,20799,20448,
+21674,23374,23716,22711,22860,23245,23616,23729,
+23703,23583,23215,22844,21829,21149,20323,19455,
+19290,19320,18922,18939,19032,19134,19552,19602,
+20067,19965,19988,18436,17965,17833,17089,16971,
+16812,16422,18195,17065,17129,17396,17803,17997,
+18961,26575,26575,23322,23414,21375,19552,18020,
+18625,21113,21203,21413,21654,21884,21851,21103,
+16962,14820,15912,17382,18329,18304,18310,19134,
+19761,19940,19169,18366,17873,16924,16031,15028,
+18248,18665,19588,19623,19747,20199,21687,22650,
+23073,23886,24360,29160,25635,25620,25449,23090,
+23387,23665,23962,24404,24777,27878,27886,27886,
+27846,27846,27844,27848,27869,27869,28005,28005,
+28189,28249,28359,28359,28399,28399,28400,28398,
+28386,28386,28248,28248,28123,28113,28190,28190,
+28550,28550,29025,29228,29771,29771,30521,30521,
+31189,31442,32040,32040,32642,32642,32981,33089,
+33286,33286,33382,33382,33377,33371,33346,33346,
+33307,33307,33257,33235,33174,33174,33133,33133,
+33122,33118,33113,33113,33112,33112,33105,33100,
+33084,33084,33047,33047,33006,32991,32964,32964,
+32943,32943,32912,32896,32853,32853,32831,32831,
+32841,32844,32852,32852,32857,32857,32850,32846,
+32830,32830,32823,32823,32829,32831,32836,32836,
+32842,32842,32850,32852,32855,32855,32870,32870,
+32892,32898,32908,32908,32905,32905,32910,32908,
+32893,32893,32856,32856,32845,32746,32723,32441,
+31742,31575,31336,29895,29362,29188,29131,29320,
+29721,31362,31555,30839,26575,26530,26575,29054,
+29147,28963,28941,29176,29106,28170,27863,27859,
+32615,32615,32715,30351,32775,28887,28187,28358,
+28693,27628,26621,26298,25519,25328,25267,25255,
+25246,25822,26954,26902,26130,24921,24503,24464,
+25365,25421,25303,25754,26046,26345,26775,27001,
+27008,27603,28137,28794,29906,29906,29997,30076,
+30380,30380,30535,29748,29870,30044,30297,30744,
+29527,29527,29446,30051,29943,29531,28935,28743,
+28483,27779,26461,26430,26798,26699,26473,26132,
+26020,25858,25625,25853,26100,26695,27091,26752,
+27670,28184,28696,29721,30232,30578,29495,29136,
+28617,27426,26967,26524,25902,25826,25620,24935,
+24680,24624,24209,24153,24165,24908,25114,25370,
+25647,25561,25338,24752,24919,24871,24613,24729,
+24707,24683,24676,24630,24865,25072,25169,25170,
+25061,24890,24501,24583,24870,24971,24824,24674,
+24434,24012,23714,23281,23232,23335,23459,23486,
+23496,23737,23721,23809,24341,25719,25536,23066,
+22553,21171,23151,23974,24701,24866,24488,23677,
+22900,21793,20900,20914,21390,21930,21256,21084,
+20847,20563,20599,20611,21026,20290,19952,19775,
+19768,19871,19662,19626,19799,18800,18284,18302,
+18466,18221,17560,16350,16334,16812,16896,16690,
+16968,16732,16603,16277,16717,16963,17160,17353,
+17086,16568,16312,16415,16342,16213,16246,16069,
+15591,15266,15193,15529,15495,15241,14981,14783,
+14577,14280,14012,13720,13403,13444,13937,15208,
+15343,15042,14656,14797,15331,14854,14709,14768,
+15907,16604,17176,17144,17009,16814,15833,15578,
+15380,15194,15056,14850,14730,14682,14720,15092,
+15191,15214,14989,15287,15592,15657,15809,16209,
+17215,17485,16993,15973,15136,14794,14667,14633,
+15256,28100,27951,27951,27932,27932,28121,28192,
+28359,28359,28287,23458,23034,27696,27681,27681,
+27672,27672,27720,27746,27823,27823,27848,24875,
+27810,27802,27804,27804,27861,27861,27895,27903,
+27908,27908,27946,27946,28029,28065,28164,28164,
+28267,28267,28341,28373,28456,28456,28579,28579,
+28698,28747,28874,28874,29008,29008,29081,29103,
+29143,29143,29133,29133,29087,29061,28982,28982,
+28861,28861,28834,28840,28894,28894,28939,28939,
+28937,28950,29018,29018,29189,29189,29286,29316,
+29367,29367,29402,29402,29413,29420,29443,29443,
+29353,29353,29439,29482,29609,29609,29686,29686,
+29687,29689,29694,29694,29699,29699,29702,29705,
+29715,29715,29726,29726,29740,29748,29778,29778,
+29835,29835,29895,29922,29994,29994,30044,30044,
+30049,30047,30025,30025,29969,29969,29991,30013,
+30104,30104,30158,30158,30157,30160,30175,30175,
+30213,30213,30207,30198,30160,30160,30149,30149,
+30169,30174,30185,30185,30185,30185,30238,30268,
+30367,30367,30439,30439,30465,30479,30531,30531,
+30625,30625,30700,30729,30802,30802,30908,30908,
+31010,31052,31157,31157,31281,31281,31378,31414,
+31499,31499,31565,31565,31591,31600,31628,31628,
+31671,31671,31690,31690,31671,31671,31694,31694,
+31769,31786,31799,31799,31741,31741,31718,31704,
+30832,29799,29335,28716,27068,22805,24609,24476,
+24043,23835,24674,25624,24525,23775,23840,23799,
+23339,19529,18029,18022,19860,19709,19439,18042,
+16555,17267,18592,21751,22372,24124,23810,23594,
+24113,23990,24204,24235,24215,23966,23820,23668,
+23668,23799,23522,23234,22103,21525,20762,19815,
+19526,19362,19164,19130,19271,19465,19160,18490,
+18641,18256,18242,18032,17861,17750,17439,17125,
+17013,16998,17007,16848,17206,17445,17866,18052,
+17699,16823,20687,21334,21757,22050,21974,21671,
+21159,20895,20561,20224,20220,20164,18169,17657,
+15686,15193,15750,16174,17245,17392,18411,19228,
+19262,19091,17507,18171,17706,18191,18271,18244,
+20224,20328,20538,20467,20499,20849,21826,22388,
+22796,22720,22971,22648,22157,21977,22168,22869,
+25216,25237,25520,25534,25646,24769,27751,25412,
+27722,27722,27728,27736,27763,27763,27874,27874,
+28040,28090,28174,28174,28196,28196,28162,28156,
+28159,28159,28043,28043,27925,27917,27989,27989,
+28340,28340,28775,28960,29447,29447,30174,30174,
+30858,31123,31761,31761,32429,32429,32830,32961,
+33217,33217,33341,33341,33330,33321,33288,33288,
+33237,33237,33180,33157,33093,33093,33058,33058,
+33058,33058,33059,33059,33057,33057,33050,33046,
+33031,33031,32998,32998,32962,32948,32920,32920,
+32891,32891,32858,32843,32800,32800,32780,32780,
+32792,32796,32802,32802,32807,32807,32800,32796,
+32780,32780,32772,32772,32776,32778,32783,32783,
+32794,32794,32799,32799,32797,32797,32806,32806,
+32827,32833,32843,32843,32844,32844,32853,32853,
+32843,32843,32804,32804,32813,32552,32364,32086,
+31388,31335,31139,30132,29802,30000,30801,30806,
+30552,31126,31548,31530,29759,26575,26382,25010,
+24928,26471,27917,27341,26568,26559,26525,26440,
+26823,26580,26434,26987,26178,26356,27616,27402,
+26952,26169,25857,25590,25249,25164,25183,25604,
+25549,25638,26094,26272,26098,24886,24507,24174,
+24180,24306,24511,24896,24752,24963,25750,26050,
+26226,26479,27066,27660,29838,29838,29914,29990,
+30292,30292,30446,28766,29071,30241,29866,29866,
+29292,29292,29189,29214,28924,28462,27980,27766,
+27535,26959,26761,26451,26218,26059,25937,25929,
+25898,25824,25814,25786,25686,25881,26158,26384,
+26934,26825,27545,28966,29675,30192,28704,27847,
+26984,26755,26249,25980,25305,24967,24736,24438,
+24332,24042,23884,23902,23975,24718,24859,25081,
+25509,25471,24886,24618,24311,24213,24286,24372,
+24391,24611,24510,24426,24796,25048,25140,24939,
+24884,24877,24745,24593,24501,24112,23940,23872,
+23520,23255,23175,24041,24091,23537,23327,23397,
+23341,22772,22449,22325,21987,21832,21779,21956,
+22759,24646,24748,23342,24486,23397,22450,22904,
+21560,21591,22008,21935,21302,20942,20347,20111,
+19793,19607,20038,20365,19609,19699,19918,19402,
+19022,18464,17364,17177,17671,18832,17961,17422,
+16467,16439,16493,16417,16477,16516,16199,15960,
+15641,15258,14933,14690,15170,15892,16462,16130,
+16032,15795,15268,15088,15035,14938,14808,14674,
+14327,14306,14313,14496,14409,14340,14339,14424,
+14492,14281,14221,14218,14533,14690,14737,15129,
+15363,15191,14927,14970,15147,14869,14836,14974,
+15754,16330,16671,16162,15528,15326,15125,15097,
+14987,15098,14872,15016,15369,15454,14886,14879,
+14989,14896,15154,15148,15099,14991,15079,15229,
+16203,16993,17221,16904,16158,15932,15806,15077,
+14458,14565,16214,18168,27825,27825,27970,28029,
+28181,28181,28140,28140,27695,27605,27599,27599,
+27607,27607,27638,27658,27724,27724,27763,27763,
+27757,27759,27772,27772,27813,27813,27839,27843,
+27843,27843,27863,27863,27923,27949,28020,28020,
+28091,28091,28158,28190,28288,28288,28421,28421,
+28541,28591,28725,28725,28872,28872,28951,28976,
+29023,29023,29020,29020,28977,28955,28884,28884,
+28780,28780,28762,28771,28832,28832,28876,28876,
+28868,28878,28937,28937,29090,29090,29174,29200,
+29242,29242,29268,29268,29274,29279,29301,29301,
+29047,29047,29119,29154,29257,29257,29318,29318,
+29319,29320,29325,29325,29333,29333,29341,29344,
+29359,29359,29376,29376,29389,29399,29436,29436,
+29506,29506,29583,29617,29713,29713,29760,29760,
+29739,29728,29695,29695,29642,29642,29673,29699,
+29801,29801,29866,29866,29873,29879,29900,29900,
+29943,29943,29953,29952,29939,29939,29930,29930,
+29929,29929,29929,29929,29930,29930,29986,30018,
+30124,30124,30196,30196,30213,30226,30275,30275,
+30371,30371,30446,30475,30548,30548,30646,30646,
+30739,30776,30871,30871,30984,30984,31074,31108,
+31191,31191,31265,31265,31308,31323,31356,31356,
+31396,31396,31432,31443,31460,31460,31525,31525,
+31629,31656,31686,31686,31640,31640,31621,31601,
+31071,30335,30082,29298,25581,18299,23672,23814,
+24224,24441,24048,24978,24861,24211,23763,23534,
+23609,19065,18582,19853,20605,19980,19034,19782,
+20279,18937,19264,21575,21851,23173,23385,23905,
+23615,23891,23912,24325,24217,23966,23617,23484,
+23417,23476,23339,23087,22085,21487,20757,19800,
+19619,19543,19519,19343,19280,19201,18797,18245,
+18007,18050,18120,17959,19716,17914,17322,17186,
+17117,17127,17148,17241,17471,17564,17462,17327,
+17477,17218,19122,18792,18810,19661,19713,19274,
+20530,19439,19010,17013,16665,16075,14686,15100,
+15065,15449,15414,15686,16515,17283,17934,18973,
+19154,18908,17852,18510,18508,14840,14921,17744,
+20663,20632,20459,20085,20238,20517,21229,22216,
+22529,22634,22479,22238,21370,21275,21842,24547,
+24330,23808,24299,25639,25642,24635,24556,27457,
+27469,27469,27510,27530,27590,27590,27653,27653,
+27819,27859,27891,27891,27879,27879,27697,27665,
+27686,27686,27614,27614,27523,27517,27574,27574,
+27883,27883,28223,28364,28728,28728,29400,29400,
+30117,30407,31138,31138,31958,31958,32483,32660,
+33018,33018,33204,33204,33205,33197,33160,33160,
+33098,33098,33034,33007,32942,32942,32914,32914,
+32927,32930,32935,32935,32926,32926,32918,32914,
+32901,32901,32875,32875,32847,32836,32807,32807,
+32768,32768,32739,32728,32701,32701,32689,32689,
+32697,32699,32700,32700,32700,32700,32692,32687,
+32674,32674,32665,32665,32664,32664,32667,32667,
+32678,32678,32678,32676,32664,32664,32664,32664,
+32678,32683,32691,32691,32689,32689,32698,32697,
+32688,32688,32647,32647,32742,32297,31921,31673,
+31362,31461,31370,30732,30591,30797,31321,31298,
+31091,31163,31128,30926,30053,29336,26595,24365,
+23500,24722,26341,25966,25601,25704,25080,24533,
+25274,25644,25389,25621,25582,25875,26541,26512,
+26430,26149,25759,25560,25296,25319,25204,25483,
+25303,25486,25407,25395,25615,24284,24368,24095,
+23980,24306,24340,24215,24216,24736,26087,26243,
+26200,26048,26650,27169,27965,29723,29768,29821,
+28207,28141,28213,28387,28727,28935,29419,29419,
+28867,28867,28730,28693,28646,27717,27322,27174,
+26945,26332,26153,26085,26007,25910,25882,25767,
+25682,25581,25577,25490,25409,25778,26110,26230,
+26736,27016,26929,28308,28998,29504,28098,27288,
+26575,26575,25976,25573,24900,24657,24480,24289,
+24054,23845,23790,23654,23620,23801,23922,24943,
+25332,25382,25232,23908,23808,23986,23993,23986,
+24198,24301,24361,24431,24734,24757,24594,24218,
+24185,24287,24648,24568,24394,24220,24231,23943,
+23385,23156,23122,23698,24039,23850,23263,23394,
+23299,22898,22695,22528,21970,21507,21175,21042,
+21096,20912,22796,23073,23007,23924,23712,23815,
+22151,20718,21340,21369,21013,20927,20170,19872,
+19502,19482,19292,18859,18535,17835,18201,17826,
+17448,17135,16549,17178,17980,18700,17714,17063,
+16048,16038,16017,15724,15433,15283,15143,14674,
+14263,13386,12639,12469,14095,14761,15033,15025,
+15030,15074,15037,14942,14784,14758,14690,14603,
+14214,13939,13668,13762,13670,13620,13844,14279,
+14752,14499,14268,14275,14599,15272,15391,15396,
+15330,15214,14984,15000,14979,14873,14695,14731,
+15565,16159,16262,15269,15075,15109,15146,15358,
+15182,14870,14759,14933,15926,15642,15405,14979,
+14882,14863,15395,15446,15156,14982,15163,15453,
+16196,16843,17257,17339,17037,16881,16091,15395,
+14696,14322,14970,16472,27658,27658,27672,27695,
+27799,27799,27735,27735,23204,27457,27363,27363,
+27425,27425,27473,27490,27528,27528,27591,27591,
+27657,27677,27711,27711,27713,27713,27721,27722,
+27722,27722,27712,27712,27720,27726,27747,27747,
+27757,27757,27805,27837,27944,27944,28084,28084,
+28200,28252,28393,28393,28560,28560,28653,28682,
+28742,28742,28760,28760,28737,28723,28681,28681,
+28618,28618,28624,28638,28707,28707,28744,28744,
+28722,28725,28762,28762,28880,28880,28939,28956,
+28978,28978,28988,28988,28983,28986,29001,29001,
+29047,29047,29119,29154,29257,29257,29318,29318,
+29319,29320,29325,29325,29333,29333,29341,29344,
+29359,29359,29376,29376,29389,29399,29436,29436,
+29506,29506,29583,29617,29713,29713,29760,29760,
+29739,29728,29695,29695,29642,29642,29673,29699,
+29801,29801,29866,29866,29873,29879,29900,29900,
+29943,29943,29953,29952,29939,29939,29930,29930,
+29929,29929,29929,29929,29930,29930,29986,30018,
+30124,30124,30196,30196,30213,30226,30275,30275,
+30371,30371,30446,30475,30548,30548,30646,30646,
+30739,30776,30871,30871,30984,30984,31074,31108,
+31191,31191,31265,31265,31308,31323,31356,31356,
+31396,31396,31432,31443,31460,31460,31525,31525,
+31629,31656,31686,31686,31640,31640,31621,31601,
+31194,30624,31048,30488,28671,20027,22353,23168,
+23867,24133,24279,24040,24337,23860,23167,23294,
+22599,19663,20293,20914,20799,20443,20717,20507,
+19755,18917,19625,21282,22058,23583,23369,23979,
+24156,23718,23603,23812,23766,23809,23808,23799,
+23547,23216,23188,23138,22030,21431,20815,19937,
+19875,19903,19715,19310,19089,18815,18582,18278,
+17931,18047,18090,17963,17957,17917,17201,16981,
+17018,17678,18037,19483,18406,17981,17570,18347,
+19071,21092,21424,21496,19837,21743,21633,19614,
+19091,18791,18455,17542,17172,16231,15089,15113,
+15215,14833,14787,14650,15688,16403,17074,18482,
+18971,18878,17414,18314,18494,18903,19647,20532,
+20388,20236,20238,18863,19082,19700,20821,21334,
+21705,22583,21824,21989,21848,21657,22444,23942,
+24518,24511,25615,25639,25646,25667,24621,27457,
+27469,27469,27510,27530,27590,27590,27653,27653,
+27819,27859,27891,27891,27879,27879,27697,27665,
+27686,27686,27614,27614,27523,27517,27574,27574,
+27883,27883,28223,28364,28728,28728,29400,29400,
+30117,30407,31138,31138,31958,31958,32483,32660,
+33018,33018,33204,33204,33205,33197,33160,33160,
+33098,33098,33034,33007,32942,32942,32914,32914,
+32927,32930,32935,32935,32926,32926,32918,32914,
+32901,32901,32875,32875,32847,32836,32807,32807,
+32768,32768,32739,32728,32701,32701,32689,32689,
+32697,32699,32700,32700,32700,32700,32692,32687,
+32674,32674,32665,32665,32664,32664,32667,32667,
+32678,32678,32678,32676,32664,32664,32664,32664,
+32678,32683,32691,32691,32689,32689,32698,32697,
+32688,32688,32647,32647,32521,31919,31662,31619,
+31732,31782,31783,31598,31462,31523,31474,31230,
+31091,31356,31245,30816,29951,29786,29277,25973,
+24738,24594,25709,25612,25286,24243,23778,23111,
+23818,24229,24594,24705,25018,25344,25586,25754,
+25888,25940,25411,25125,25233,25265,25406,25031,
+25316,25185,25205,25432,25490,24379,23924,23741,
+23641,23747,23396,22842,23350,24019,25800,25779,
+25845,25508,25813,26160,27148,27508,29768,27909,
+27822,27697,27550,27728,28031,28511,28561,28699,
+28867,28867,28730,28693,27669,27078,26556,26411,
+26209,25908,25809,25781,25709,25597,25552,25452,
+25458,25535,25537,25453,25501,25752,25937,26087,
+26442,26880,27106,27609,28027,28449,27212,26575,
+26575,26575,25554,25143,24722,24568,24535,23944,
+23898,23779,23689,23601,23559,23629,23699,23900,
+25042,25161,24697,23726,23032,23717,23767,23825,
+23977,24315,24444,24660,24526,24522,24136,23591,
+23728,23998,24500,24477,24301,24341,24316,24095,
+23536,23291,23281,23572,23615,24227,24233,24086,
+23878,22967,23294,23430,22800,22715,22439,20961,
+20483,20777,22542,24225,23878,23284,23154,22784,
+21669,20598,20953,20916,20620,21121,19663,20053,
+19628,18829,19282,19265,18249,17299,16849,16084,
+16180,17125,17664,17791,18014,17139,16649,16025,
+15520,15441,15244,14437,14166,14087,14473,13973,
+13132,11217,10920,11502,13462,14297,14375,13816,
+14008,14175,14740,14533,14484,14542,14576,14473,
+14040,13590,13340,13267,13195,13160,13442,13975,
+14259,14548,14434,14480,15199,15350,15493,15550,
+15549,15509,15310,15123,14991,15021,14814,14576,
+14962,15386,15480,15449,15152,15420,15508,15577,
+15344,14922,14787,14737,15031,15213,15319,14755,
+14452,14322,15226,15548,15571,15173,15345,15774,
+16434,16657,16600,16971,16927,16944,16417,15810,
+15416,14745,14485,15389,27658,27658,27672,27695,
+27799,27799,27735,27735,23135,23499,27363,27363,
+27425,27425,27473,27490,27528,27528,27591,27591,
+27657,27677,27711,27711,27713,27713,27721,27722,
+27722,27722,27712,27712,27720,27726,27747,27747,
+27757,27757,27805,27837,27944,27944,28084,28084,
+28200,28252,28393,28393,28560,28560,28653,28682,
+28742,28742,28760,28760,28737,28723,28681,28681,
+28618,28618,28624,28638,28707,28707,28744,28744,
+28722,28725,28762,28762,28880,28880,28939,28956,
+28978,28978,28988,28988,28983,28986,29001,29001,
+28771,28771,28780,28785,28796,28796,28835,28835,
+28889,28912,28970,28970,29043,29043,29072,29079,
+29081,29081,29099,29099,29129,29143,29188,29188,
+29257,29257,29318,29342,29405,29405,29413,29413,
+29361,29344,29314,29314,29306,29306,29331,29347,
+29404,29404,29454,29454,29482,29495,29526,29526,
+29566,29566,29588,29593,29602,29602,29600,29600,
+29591,29590,29591,29591,29608,29608,29661,29689,
+29777,29777,29841,29841,29860,29874,29924,29924,
+30023,30023,30107,30142,30231,30231,30330,30330,
+30407,30440,30528,30528,30640,30640,30725,30757,
+30830,30830,30927,30927,31018,31044,31079,31079,
+31065,31065,31117,31146,31244,31244,31343,31343,
+31418,31437,31464,31464,31424,31424,31371,31182,
+29569,27851,27701,30389,30582,24318,18739,20983,
+22729,23797,24260,24202,23903,23228,22777,22674,
+22625,21731,21384,21160,22215,22287,22317,21758,
+22595,22740,23187,23834,23609,24083,24301,24474,
+23823,23577,23548,23683,23729,23600,23629,23360,
+23085,22897,22780,22494,21545,21257,20897,20316,
+20243,20160,19505,19161,19090,18685,18452,18339,
+18340,18391,18310,17826,17632,17567,17341,17196,
+17444,19046,19290,19523,19944,20161,20389,20995,
+21444,21979,22008,21840,21739,21640,21400,20057,
+19293,19066,18396,17150,16603,15989,15221,15207,
+15249,14431,13628,13341,13309,13457,14809,16844,
+17758,18462,18378,18416,18483,18897,19333,18595,
+19037,19017,18780,25335,16669,16524,20497,20744,
+21069,20561,21160,19968,21162,22130,25187,25557,
+25624,25631,25660,25665,26662,27083,27110,27110,
+27138,27138,27330,27387,27486,27486,27549,27549,
+27642,26441,27687,27687,26058,25944,26306,27311,
+27291,27291,27246,27246,27225,27238,27321,27321,
+27590,27590,27863,27978,28283,28283,28922,28922,
+29658,29964,30755,30755,31663,31663,32204,32372,
+32672,32672,32879,32879,32977,33003,33030,33030,
+33003,33003,32959,32940,32888,32888,32847,32847,
+32829,32821,32799,32799,32771,32771,32752,32744,
+32726,32726,32699,32699,32674,32665,32641,32641,
+32614,32614,32617,32623,32650,32650,32658,32658,
+32642,32635,32617,32617,32600,32600,32591,32589,
+32584,32584,32573,32573,32560,32555,32546,32546,
+32535,32535,32528,32525,32521,32521,32522,32522,
+32533,32534,32526,32526,32493,32493,32468,32456,
+32417,32417,32377,32386,32283,31961,31894,31861,
+31798,31615,31669,31756,31677,31406,31277,31006,
+30624,30885,31222,31459,30699,30289,30136,28849,
+28154,27877,26924,26575,26421,25674,25689,25840,
+25852,25673,25562,25231,25212,25214,25102,24932,
+24999,25473,25403,25371,24973,24876,24848,24594,
+24171,24590,24487,24734,24634,24307,24001,24034,
+24107,23640,23291,24057,23890,23913,24769,24671,
+24617,24964,24841,24729,24960,25293,25731,26379,
+26509,26631,26832,26917,26575,27659,27728,27880,
+27670,27635,27420,26952,26655,26495,25934,25631,
+25339,25098,25042,25130,25228,25244,25327,25722,
+25695,25590,25427,25324,25377,25365,25418,25356,
+25576,25781,25925,26519,26717,27248,26091,25549,
+25127,24534,24057,23929,24112,24020,23748,23493,
+23345,23134,23406,23445,23422,23410,23249,23182,
+23219,23380,23529,23311,22514,22368,21996,23203,
+23422,23708,24265,24208,23834,23235,23466,22726,
+22719,23007,24127,24735,24927,24541,24330,23995,
+23524,23182,23099,23139,23242,23299,23204,23173,
+22970,22795,23028,22702,22216,22098,21952,21024,
+21136,21126,21102,20793,20263,20661,20546,20323,
+21007,20667,20786,20563,20125,19900,20071,20178,
+20356,19138,18537,17933,14523,14607,16200,18452,
+18538,18156,17594,17635,16677,15541,15145,14944,
+14614,13707,11987,11620,11938,12435,12343,11722,
+11680,12936,13826,14464,14864,14811,14699,14287,
+14327,14578,14615,14338,14156,13201,13162,13137,
+13345,13260,13138,12962,13222,13387,13837,14174,
+14193,14413,14550,14812,15174,15030,15022,15476,
+15686,15809,15909,16069,16108,15316,14910,14474,
+13723,13654,14470,15118,15411,15324,15771,16043,
+15629,15137,14948,14763,14799,14958,14942,14095,
+13763,13873,14394,14963,15520,16017,16169,16237,
+16621,16640,16558,16539,16642,16598,16470,16258,
+15799,14802,14581,14377,16909,19154,27543,27535,
+27529,27529,27437,27437,23338,27164,25637,25659,
+25680,25690,27353,27372,27382,27382,27463,27463,
+27592,27626,27664,27664,27596,27596,27596,27603,
+27639,27639,27623,27623,27588,27582,27585,27585,
+27605,27605,27632,27649,27706,27706,27799,27799,
+27893,27939,28076,28076,28260,28260,28359,28391,
+28452,28452,28504,28504,28527,28531,28528,28528,
+28499,28499,28515,28531,28593,28593,28617,28617,
+28586,28584,28609,28609,28708,28708,28757,28769,
+28786,28786,28789,28789,28777,28774,28768,28768,
+28771,28771,28780,28785,28796,28796,28835,28835,
+28889,28912,28970,28970,29043,29043,29072,29079,
+29081,29081,29099,29099,29129,29143,29188,29188,
+29257,29257,29318,29342,29405,29405,29413,29413,
+29361,29344,29314,29314,29306,29306,29331,29347,
+29404,29404,29454,29454,29482,29495,29526,29526,
+29566,29566,29588,29593,29602,29602,29600,29600,
+29591,29590,29591,29591,29608,29608,29661,29689,
+29777,29777,29841,29841,29860,29874,29924,29924,
+30023,30023,30107,30142,30231,30231,30330,30330,
+30407,30440,30528,30528,30640,30640,30725,30757,
+30830,30830,30927,30927,31018,31044,31079,31079,
+31065,31065,31117,31146,31244,31244,31343,31343,
+31418,31437,31464,31464,31424,31424,31371,30587,
+29001,28023,27796,27471,29982,24699,19130,21221,
+22313,23318,23846,23885,23993,24063,22533,21998,
+22971,22185,21243,20638,22824,22162,21981,22136,
+22122,22106,22641,22803,22476,23434,24291,24640,
+23396,23396,23395,23291,23334,23382,23535,23220,
+22917,22415,22149,21822,21468,21276,20967,20425,
+20310,20067,19319,19211,19209,18619,18369,18279,
+18401,18548,18533,17938,17775,17714,17820,17661,
+17578,18053,18500,18715,19635,20048,20424,21182,
+21686,26575,22571,22315,21983,21261,20042,19460,
+18882,18553,18216,17446,17074,16497,15759,15623,
+15297,14234,13768,13568,12931,13104,13813,16179,
+17023,18075,18228,18294,18483,19219,19489,18856,
+18813,18631,18760,19231,25346,18407,21126,21281,
+21042,20213,20456,20639,24647,22530,25225,25552,
+25621,25624,25654,25659,26662,27083,27110,27110,
+27138,25404,24826,24124,24157,24196,24410,24583,
+24896,25492,25598,25740,27475,26364,27341,27311,
+27291,27291,27246,27246,27225,27238,27321,27321,
+27590,27590,27863,27978,28283,28283,28922,28922,
+29658,29964,30755,30755,31663,31663,32204,32372,
+32672,32672,32879,32879,32977,33003,33030,33030,
+33003,33003,32959,32940,32888,32888,32847,32847,
+32829,32821,32799,32799,32771,32771,32752,32744,
+32726,32726,32699,32699,32674,32665,32641,32641,
+32614,32614,32617,32623,32650,32650,32658,32658,
+32642,32635,32617,32617,32600,32600,32591,32589,
+32584,32584,32573,32573,32560,32555,32546,32546,
+32535,32535,32528,32525,32521,32521,32522,32522,
+32533,32534,32526,32526,32493,32493,32468,32456,
+32417,32064,32049,32080,32183,32033,31924,31909,
+31637,31524,31477,31709,31616,31466,31411,31426,
+31182,30885,30976,31094,30877,30582,30358,29008,
+27957,26722,26470,26341,26505,26065,25886,25910,
+25866,25847,25811,25602,25545,25381,24808,24777,
+24816,25602,25627,25434,24800,24656,24313,23893,
+24225,24134,24040,24019,24051,23866,24244,24361,
+23546,23759,24136,24476,23833,23361,24458,24382,
+24253,24450,24490,24325,24446,24382,24519,25156,
+25401,25626,25897,26078,26321,26584,26979,27120,
+27194,27145,27107,26368,26167,25945,25648,25518,
+25217,25037,25117,25248,26575,25537,25557,25536,
+25636,25582,25327,25420,25385,25538,25499,25535,
+25516,25535,25392,25971,26078,26008,25341,24884,
+24473,23866,23827,23823,23823,23660,23488,23112,
+22948,23080,23228,23301,23208,23217,23307,23265,
+23101,23232,23265,23194,21938,20613,21712,23142,
+23384,23691,23513,24078,23509,22846,23290,22882,
+22882,23202,24098,24509,24591,24386,24176,24049,
+23556,23159,22916,23132,23245,23219,23092,22925,
+22987,22756,22497,22394,22440,22326,22118,21757,
+20797,20784,20382,20333,20607,20735,20245,20576,
+20976,19694,20025,20710,20574,20838,20162,19234,
+18755,17672,16686,15486,15417,15987,17666,18782,
+18435,17557,16216,16138,15923,14677,14347,14353,
+13398,12216,11132,10764,10879,11222,11751,12254,
+12876,14141,14643,14903,14968,14973,14969,14792,
+14697,14671,14280,13849,13590,12404,11967,11807,
+12174,12150,12055,12419,12719,13042,13725,14044,
+14446,15015,14979,14969,15152,15174,15224,15645,
+15753,15816,16045,16132,16128,15187,14839,14668,
+13433,13222,13906,14747,15081,15394,15993,16037,
+15575,15211,14939,14662,14807,15077,14693,13932,
+13918,14202,14436,14755,15336,16422,16457,16433,
+16683,16804,16652,16507,16370,16550,16667,16440,
+16711,14937,15055,15108,16503,17919,19573,27535,
+27529,27529,27437,27437,23711,27164,25668,25688,
+25702,25709,27353,27372,27382,27382,27463,27463,
+27592,27626,27664,27664,27596,27596,27596,27603,
+27639,27639,27623,27623,27588,27582,27585,27585,
+27605,27605,27632,27649,27706,27706,27799,27799,
+27893,27939,28076,28076,28260,28260,28359,28391,
+28452,28452,28504,28504,28527,28531,28528,28528,
+28499,28499,28515,28531,28593,28593,28617,28617,
+28586,28584,28609,28609,28708,28708,28757,28769,
+28786,28786,28789,28789,28777,28774,28768,28768,
+28666,28666,28642,28632,28603,28603,28622,28622,
+28685,28712,28782,28782,28871,28871,28906,28912,
+28910,28910,28922,28922,28945,28958,28999,28999,
+29068,29068,29123,29144,29194,29194,29188,29188,
+29132,29114,29081,29081,29067,29067,29085,29097,
+29146,29146,29194,29194,29223,29234,29259,29259,
+29283,29283,29305,29315,29342,29342,29357,29357,
+29357,29360,29375,29375,29410,29410,29461,29485,
+29555,29555,29609,29609,29628,29642,29693,29693,
+29793,29793,29884,29924,30025,30025,30132,30132,
+30210,30241,30320,30320,30412,30412,30482,30509,
+30574,30574,30674,30674,30779,30808,30852,30852,
+30832,30832,30898,30937,31066,31066,31155,31155,
+31179,31185,31193,31193,31326,31326,31111,29609,
+28777,30816,30832,27755,29197,24666,20912,21675,
+22770,23070,23075,23140,23275,23429,23818,23391,
+22840,22927,22835,23169,23022,22619,22483,22486,
+21640,20937,21674,21516,21713,23008,23620,24085,
+23576,23149,23238,23040,23139,23235,22984,22699,
+22284,21559,21317,21364,21468,21274,20686,20086,
+19930,19665,19323,19351,19347,18518,18319,18205,
+18225,18335,19271,18189,18067,18065,18109,18192,
+17982,17758,17838,17970,18368,19843,20413,21551,
+26575,26575,26575,22892,22191,21105,19718,19226,
+18859,18673,18158,17362,17176,17036,15931,15663,
+15055,13998,13696,13760,13258,13320,13767,15515,
+16301,16966,17508,17767,18029,18674,19152,19361,
+19217,18952,18655,19123,20469,25333,21059,21387,
+20963,19718,20080,20594,21365,21702,25308,25542,
+25613,25618,26241,26241,26936,26938,26951,26951,
+26974,26974,25008,24325,24134,24067,24313,24650,
+25030,25437,25500,25571,25982,27205,27190,27179,
+27143,27143,27144,27144,27205,27252,27430,27430,
+27791,27791,28109,28240,28578,28578,29149,29149,
+29753,30008,30681,30681,31468,31468,31953,32107,
+32395,32395,32577,32577,32650,32674,32725,32725,
+32780,32780,32778,32770,32732,32732,32680,32680,
+32630,32613,32582,32582,32563,32563,32550,32547,
+32538,32538,32516,32516,32494,32486,32469,32469,
+32457,32457,32476,32490,32537,32537,32555,32555,
+32536,32529,32513,32513,32498,32498,32489,32488,
+32488,32488,32482,32482,32470,32466,32449,32449,
+32419,32419,32396,32388,32373,32373,32359,32359,
+32357,32354,32344,32344,32318,32318,32299,31968,
+31714,31568,31665,31889,32069,31886,31677,31600,
+31542,31358,31343,31476,31478,31263,31140,31209,
+31216,30869,30803,30794,30809,30795,30802,29657,
+28592,27466,26846,27005,27094,26991,26637,26415,
+25392,25135,25262,24667,24367,24402,24049,24649,
+24974,25357,25331,25048,24483,24482,24248,23555,
+23945,23836,23809,23817,24058,24436,24302,24289,
+24163,24374,24690,24034,23247,23292,24264,24248,
+23999,23668,23900,23826,23965,24035,24148,24517,
+24554,24610,24998,25327,25692,25746,25845,26006,
+26459,26287,26318,26220,26068,25863,25623,25486,
+25469,25253,25261,25348,25305,25276,25251,25357,
+25607,25841,25781,25745,25729,25641,25600,25572,
+25466,25317,25377,25539,25504,25454,24550,24205,
+23880,23610,23594,23607,23436,23358,23214,22829,
+22719,22767,22825,22909,23038,23135,23190,23183,
+23216,23028,23019,22044,22128,20683,21066,23067,
+23045,23445,23774,23978,23432,22925,23367,23873,
+23880,24041,24175,24443,24492,24049,24060,24124,
+23688,23365,23049,23069,23199,23210,23031,23385,
+23160,22761,22519,22470,22775,22668,22448,21959,
+21035,20667,20531,20486,20634,19396,19345,20968,
+19152,20049,20463,20324,19984,19461,18019,18055,
+16895,15889,15864,15747,16238,17055,18091,18101,
+15623,16842,15682,15575,15253,14313,13727,13333,
+11585,11117,12275,12279,11820,11905,12375,12719,
+13023,13737,13991,14142,14331,14175,14110,14290,
+14672,14349,13420,12926,12409,11337,10478,9843,
+10379,10637,10857,11868,12558,13157,13177,13432,
+13963,15036,15270,15307,15250,15266,15308,15590,
+15720,15837,16069,15985,15824,15381,15274,15000,
+13613,13095,13218,14118,14545,14871,15543,15595,
+15450,15021,14759,14571,14567,14480,14276,13563,
+13627,14020,14553,14642,15132,15716,15719,15809,
+16688,16978,16732,16515,16717,16309,17001,17342,
+17431,15741,15511,15143,16243,17300,19007,25298,
+25604,25624,25647,25645,27082,27047,27005,27005,
+27198,27198,27294,27317,27336,27336,27424,27424,
+27569,27605,27636,27636,27539,27539,27520,27521,
+27541,27541,27509,27509,27466,27456,27452,27452,
+27470,27470,27496,27512,27568,27568,27651,27651,
+27735,27778,27904,27904,28078,28078,28173,28203,
+28261,28261,28334,28334,28391,28408,28438,28438,
+28444,28444,28474,28492,28549,28549,28567,28567,
+28537,28534,28549,28549,28623,28623,28664,28677,
+28704,28704,28714,28714,28709,28705,28690,28690,
+28653,28653,28623,28610,28575,28575,28587,28587,
+28644,28670,28735,28735,28822,28822,28855,28861,
+28858,28858,28865,28865,28882,28893,28930,28930,
+29000,29000,29055,29076,29125,29125,29120,29120,
+29068,29050,29015,29015,28990,28990,29005,29017,
+29071,29071,29119,29119,29144,29153,29173,29173,
+29184,29184,29207,29218,29253,29253,29276,29276,
+29284,29290,29311,29311,29356,29356,29406,29428,
+29491,29491,29541,29541,29559,29573,29625,29625,
+29725,29725,29819,29859,29966,29966,30079,30079,
+30159,30190,30265,30265,30344,30344,30408,30433,
+30494,30494,30591,30591,30695,30724,30770,30770,
+30757,30757,30829,30870,31003,31003,31077,31077,
+31077,31076,31073,31073,31234,31234,29243,28165,
+28514,30770,28424,27625,28679,24382,22990,21090,
+22842,22336,22045,21781,21090,21274,21321,20912,
+21689,21669,20901,20640,21430,21604,22082,22502,
+22056,22350,22261,22163,22249,22785,23143,23357,
+23488,23384,23417,24174,24175,23913,22947,22530,
+22007,21501,21346,21180,20609,19591,18965,19390,
+19266,19131,19555,19741,19477,18357,18228,18119,
+17931,18077,19627,17739,17641,17728,17923,17857,
+17737,17882,17973,18057,19292,20056,20433,19133,
+19502,21192,21608,21508,21261,20947,20876,20603,
+18768,18836,18795,18055,17809,17424,16489,16132,
+16032,15199,15246,14824,14377,13988,14159,14670,
+15316,15841,16638,17314,17521,18043,18290,18542,
+18809,18896,18721,19169,19876,20128,25413,25455,
+25471,22147,21135,20461,20491,20116,21210,25556,
+25612,25609,25649,25648,26905,26906,26917,26917,
+26938,26938,27027,24568,24490,24460,24682,24962,
+25177,25542,25714,25896,27158,27158,27162,27156,
+27124,27124,27148,27148,27237,27299,27522,27522,
+27938,27938,28293,28437,28805,28805,29344,29344,
+29866,30089,30682,30682,31383,31383,31836,31985,
+32282,32282,32449,32449,32487,32505,32556,32556,
+32654,32654,32674,32671,32639,32639,32584,32584,
+32520,32502,32469,32469,32463,32463,32459,32458,
+32457,32457,32440,32440,32418,32411,32397,32397,
+32391,32391,32416,32430,32479,32479,32501,32501,
+32484,32478,32466,32466,32454,32454,32447,32446,
+32447,32447,32444,32444,32437,32432,32415,32415,
+32376,32376,32345,32335,32312,32312,32290,32290,
+32281,32277,32268,32268,32250,32250,32239,32233,
+32212,32212,32162,32162,32019,31875,31654,31557,
+31612,31664,31652,31688,31772,31581,30707,30564,
+30496,30693,30699,30710,30879,30902,30943,30980,
+30815,30416,29216,28715,28236,27288,26910,26454,
+26156,25698,25178,24058,23836,23749,24399,24545,
+24672,24677,24619,24562,24167,23971,23515,23444,
+22410,22828,23882,23918,24161,24226,24444,24765,
+25339,25039,23607,22905,23367,23653,24033,24003,
+23951,23642,23423,23188,22721,23058,22978,23164,
+23451,23409,24180,24536,24555,24684,24763,24892,
+25017,25006,25172,25457,25578,25687,25668,25656,
+25692,25762,25782,25805,25685,25828,25860,25940,
+26018,26083,25938,25875,25927,26020,25978,25867,
+25535,25362,25183,24707,24334,23914,23137,22990,
+23041,23233,23049,22871,22884,22786,22614,22311,
+22294,22253,22055,22506,22671,22662,22655,22865,
+23154,23262,23237,23242,23281,22940,22013,20677,
+22485,23277,23615,23225,24672,24662,24455,23753,
+23347,23254,23129,23180,23078,23294,23254,23406,
+23742,23763,23624,23502,23614,23690,23588,23519,
+23408,23173,23085,22974,22864,22924,23324,23111,
+22327,21959,21653,21099,20101,19434,18781,18042,
+19139,18390,17102,16375,16196,15919,15399,15066,
+14698,15752,15909,16294,17713,17786,17414,15676,
+15246,15230,15295,15261,14835,13174,13340,12722,
+12349,12470,12157,11943,11900,11732,12272,12801,
+13073,13549,13882,14056,14043,13855,13665,13703,
+13693,13268,12924,12698,12424,11449,10616,10291,
+9757,9958,10044,11107,11805,12502,13704,13955,
+14074,14400,14657,15017,15062,15024,14962,15130,
+15321,15473,16272,15357,15159,14730,14467,14241,
+13384,12903,12601,12957,13410,13826,14554,14808,
+14821,14393,14252,14284,14182,14245,14257,14366,
+14385,14424,14978,15545,15799,14956,14773,14495,
+16249,17614,17382,17999,17783,17298,16687,16967,
+17228,16735,16543,16161,16133,16833,18254,21915,
+23178,25271,25576,25528,25331,26025,27007,27007,
+27187,27187,27281,27304,27332,27332,27424,27424,
+27567,27601,27627,27627,27522,27522,27492,27486,
+27488,27488,27448,27448,27406,27396,27390,27390,
+27402,27402,27431,27450,27515,27515,27606,27606,
+27691,27732,27855,27855,28021,28021,28112,28142,
+28200,28200,28278,28278,28347,28369,28411,28411,
+28433,28433,28470,28488,28544,28544,28561,28561,
+28533,28530,28541,28541,28602,28602,28642,28656,
+28688,28688,28705,28705,28704,28700,28684,28684,
+28667,28667,28632,28617,28583,28583,28579,28579,
+28607,28621,28663,28663,28727,28727,28753,28757,
+28753,28753,28747,28747,28741,28745,28770,28770,
+28841,28841,28900,28923,28975,28975,28984,28984,
+28953,28938,28895,28895,28826,28826,28832,28848,
+28925,28925,28977,28977,28985,28986,28983,28983,
+28964,28964,28984,28998,29050,29050,29099,29099,
+29132,29147,29192,29192,29259,29259,29309,29328,
+29371,29371,29406,29406,29424,29439,29493,29493,
+29593,29593,29692,29736,29854,29854,29982,29982,
+30076,30108,30174,30174,30216,30216,30257,30276,
+30327,30327,30411,30411,30501,30529,30581,30581,
+30598,30598,30684,30727,30856,30856,30880,30880,
+30809,30788,30753,30753,29267,28855,28544,30773,
+30773,30773,28442,27492,27327,25300,23985,22987,
+22040,21626,22099,22171,22331,22255,21216,21030,
+20614,21119,20331,20330,21836,22549,22984,23014,
+22830,22570,22299,22330,22576,22911,23218,23409,
+23541,23736,24004,24387,24310,23992,23156,22788,
+22516,21170,20745,20567,20378,20034,19492,19394,
+19489,19570,19849,19832,19178,18148,18204,18203,
+17953,17998,19013,17661,17603,17580,17811,17799,
+17758,17943,17964,17994,19281,20071,20451,18425,
+18060,18461,20757,20893,20891,20798,20696,20652,
+18999,18871,18817,18189,17910,17616,17150,16835,
+16388,16043,15749,15270,14833,14674,14594,14855,
+15151,15428,16163,16763,17056,17260,17478,17941,
+18493,18569,18599,19097,19509,19512,20972,21299,
+25459,25471,25473,25482,25519,25528,25545,25562,
+25567,25539,21001,21929,23615,26864,26876,26876,
+26890,26890,26878,24333,24212,24135,24333,24845,
+25124,25632,25865,26078,27137,27137,27139,27140,
+27139,27139,27227,27227,27385,27486,27829,27829,
+28410,28410,28888,29079,29551,29551,30001,30001,
+30267,30389,30730,30730,31160,31160,31515,31655,
+31995,31995,32115,32115,32025,32015,32057,32057,
+32277,32277,32359,32373,32358,32358,32296,32296,
+32202,32176,32146,32146,32181,32181,32209,32218,
+32245,32245,32244,32244,32221,32216,32212,32212,
+32224,32224,32254,32268,32315,32315,32342,32342,
+32341,32341,32342,32342,32341,32341,32338,32338,
+32339,32339,32347,32347,32354,32352,32335,32335,
+32275,32275,32220,32201,32157,32157,32109,32109,
+32081,32075,32071,32071,32083,32083,32099,32104,
+32118,32118,32070,32070,31877,32017,32029,32053,
+31878,31875,31898,31833,31740,31546,30931,30705,
+30597,30513,30488,30532,30797,30813,30739,30782,
+30727,30620,29781,29358,28951,27941,27347,26822,
+26466,26325,26038,24780,24520,24243,24210,24252,
+24383,24370,24450,24533,24533,24250,23942,23994,
+24022,23906,24449,24370,24281,24675,25156,25590,
+25381,24277,23327,22969,23461,23662,24073,24062,
+23982,23800,23549,23342,23015,22825,22674,22674,
+22965,26575,23729,23945,24173,24212,24388,24484,
+24754,24943,24911,25149,25208,25295,25507,25511,
+25424,25575,25709,25700,25797,25820,25832,25889,
+25962,26045,26216,26214,26114,25938,25857,25718,
+25479,25333,25149,24256,23734,23373,23117,22965,
+22814,23051,22903,22874,22817,22539,22372,22175,
+22149,22100,22148,22248,22369,22535,22680,22952,
+23189,23200,23114,22925,22191,21651,21142,21360,
+20549,22743,22868,23132,24517,24679,24611,23991,
+23804,23377,22909,22794,23092,23150,23161,23164,
+23523,23423,23383,23627,23802,23902,24124,24124,
+24018,23740,23733,23790,23965,23474,23708,23127,
+22818,22419,22015,21388,20556,19611,18896,18719,
+19075,19674,18826,16134,15500,14985,16145,16082,
+15615,15394,14513,15942,16249,15962,14425,13985,
+14330,15026,13819,14151,12950,12531,12545,12049,
+12027,11785,11579,11263,11257,11182,11996,12785,
+13388,14085,14126,14080,14034,14017,13906,13350,
+12984,12632,12393,12280,12188,11766,11106,10890,
+9671,9620,9731,10246,10571,11007,12921,13728,
+14047,14464,14604,14766,14959,15039,15129,15206,
+15208,15126,15065,15063,15021,14634,14321,13986,
+13160,12651,12375,12844,13207,13569,14311,14475,
+14490,14304,14129,14177,13874,14065,14537,15261,
+15494,15457,15667,15734,15922,15232,14849,14949,
+16350,17668,18017,18544,18278,17869,17263,17088,
+17004,16958,16897,16789,16099,16714,18248,22418,
+23744,24999,25628,25527,25876,25916,25717,25726,
+27192,27192,27264,27290,27347,27347,27447,27447,
+27573,27599,27607,27607,27489,27489,27421,27395,
+27334,27334,27267,27267,27240,27232,27221,27221,
+27212,27212,27255,27284,27390,27390,27512,27512,
+27608,27650,27763,27763,27903,27903,27983,28010,
+28067,28067,28162,28162,28255,28288,28359,28359,
+28424,28424,28477,28499,28551,28551,28570,28570,
+28549,28545,28546,28546,28575,28575,28611,28628,
+28676,28676,28713,28713,28725,28725,28712,28712,
+28667,28667,28632,28617,28583,28583,28579,28579,
+28607,28621,28663,28663,28727,28727,28753,28757,
+28753,28753,28747,28747,28741,28745,28770,28770,
+28841,28841,28900,28923,28975,28975,28984,28984,
+28953,28938,28895,28895,28826,28826,28832,28848,
+28925,28925,28977,28977,28985,28986,28983,28983,
+28964,28964,28984,28998,29050,29050,29099,29099,
+29132,29147,29192,29192,29259,29259,29309,29328,
+29371,29371,29406,29406,29424,29439,29493,29493,
+29593,29593,29692,29736,29854,29854,29982,29982,
+30076,30108,30174,30174,30216,30216,30257,30276,
+30327,30327,30411,30411,30501,30529,30581,30581,
+30598,30598,30684,30727,30856,30856,30880,30880,
+30809,30788,30753,29461,26575,28300,30798,30773,
+29058,28557,25554,25087,24292,23892,23890,23311,
+22561,22023,22282,21954,22134,22196,20787,20385,
+19713,20677,20767,21223,22375,22973,23143,23205,
+23091,22913,22328,22571,22754,23255,23547,23821,
+24041,24081,24250,24325,24290,24100,23287,22830,
+22216,21110,20464,20775,21715,21502,20685,20171,
+20006,19573,19769,19452,18845,18223,18304,18233,
+17888,17855,17840,17926,17832,17734,17899,18081,
+18129,18290,18218,18197,19821,20332,20221,20861,
+19892,19306,20719,20859,20896,20768,20698,20650,
+19137,18951,18823,18299,17990,17847,17535,17403,
+17419,16542,16177,16035,15607,15114,14978,14839,
+14385,14228,14172,14465,14870,16053,16464,16913,
+18071,18418,18510,18542,19019,19674,20418,20726,
+21051,25465,25498,25519,25543,25540,25535,25516,
+21727,21216,25575,25593,25647,26864,26876,26876,
+26890,26890,26878,26880,23969,23996,24341,24684,
+25656,27058,27058,27058,27137,27137,27139,27140,
+27139,27139,27227,27227,27385,27486,27829,27829,
+28410,28410,28888,29079,29551,29551,30001,30001,
+30267,30389,30730,30730,31160,31160,31515,31655,
+31995,31995,32115,32115,32025,32015,32057,32057,
+32277,32277,32359,32373,32358,32358,32296,32296,
+32202,32176,32146,32146,32181,32181,32209,32218,
+32245,32245,32244,32244,32221,32216,32212,32212,
+32224,32224,32254,32268,32315,32315,32342,32342,
+32341,32341,32342,32342,32341,32341,32338,32338,
+32339,32339,32347,32347,32354,32352,32335,32335,
+32275,32275,32220,32201,32157,32157,32109,32109,
+32081,32075,32071,32071,32083,32083,32099,32104,
+32118,32118,32070,32070,31877,31800,31612,31612,
+31997,31901,31857,31733,31641,31559,31183,30722,
+30503,30305,30253,30258,30453,30536,30523,30548,
+30651,30734,30120,29763,29468,28600,27875,27129,
+26575,26484,26394,25874,25277,24838,24552,24341,
+24309,24093,24137,24365,25069,25225,25173,25234,
+25145,25229,25236,25168,25238,25581,25689,25620,
+24379,23963,23489,23289,23446,23879,24054,24064,
+24083,23853,23644,23387,23102,22982,22888,22857,
+23071,23277,23225,23626,23351,23703,23856,24084,
+24374,24527,24894,25040,25144,25020,25122,25285,
+25175,25257,25434,25540,25553,25666,25630,25674,
+25732,25797,26100,26098,26015,25711,25651,25580,
+25296,25034,24740,23836,23356,23091,23088,23018,
+22925,22950,22896,22739,22428,22210,22075,22024,
+21960,21900,21861,21907,21983,22071,22465,22644,
+23055,23200,23007,22938,22797,22088,21701,20663,
+21543,22280,22454,22733,23168,23986,24201,24070,
+23825,23552,23132,23040,23198,23074,23096,23191,
+23311,23430,23370,23379,23489,23431,23905,24111,
+24251,24078,24212,24045,24050,23590,23309,23085,
+22873,22753,22196,21629,20916,19572,18781,17853,
+18332,18867,18847,16523,15947,17330,16918,16941,
+16684,15352,13819,14746,14230,13705,13090,13613,
+14247,15246,14360,14085,13402,13549,13095,12645,
+11674,11256,10718,9893,10293,11415,12808,13131,
+13259,13659,13733,13732,13693,13676,13527,12583,
+12166,12007,12497,12398,12566,12247,12169,12062,
+10186,9053,9271,9742,9786,10028,11578,12519,
+13251,14191,14638,14804,14893,15007,15183,15254,
+15056,14900,14807,14810,14761,14447,14153,13965,
+13248,12840,12459,12634,13074,13510,14194,14386,
+14510,14376,14311,14186,13874,14159,14790,15694,
+15848,15790,15956,15983,15622,15465,15452,15713,
+16962,17824,18614,18966,18769,18504,18300,17998,
+17657,17487,17451,17189,16253,17007,18875,23172,
+24486,25319,25791,25777,25697,25860,25914,26172,
+27192,27192,27264,27290,27347,27347,27447,27447,
+27573,27599,27607,27607,27489,27489,27421,27395,
+27334,27334,27267,27267,27240,27232,27221,27221,
+27212,27212,27255,27284,27390,27390,27512,27512,
+27608,27650,27763,27763,27903,27903,27983,28010,
+28067,28067,28162,28162,28255,28288,28359,28359,
+28424,28424,28477,28499,28551,28551,28570,28570,
+28549,28545,28546,28546,28575,28575,28611,28628,
+28676,28676,28713,28713,28725,28725,28712,28712,
+28642,28642,28616,28610,28607,28607,28607,28607,
+28611,28615,28634,28634,28677,28677,28700,28705,
+28708,28708,28694,28694,28670,28666,28671,28671,
+28715,28715,28758,28777,28828,28828,28852,28852,
+28852,28845,28808,28808,28711,28711,28709,28724,
+28807,28807,28841,28841,28813,28804,28789,28789,
+28784,28784,28799,28806,28835,28835,28878,28878,
+28924,28946,29007,29007,29104,29104,29177,29204,
+29267,29267,29318,29318,29343,29361,29421,29421,
+29522,29522,29612,29649,29746,29746,29863,29863,
+29962,29994,30055,30055,30091,30091,30116,30126,
+30145,30145,30212,30212,30298,30327,30386,30386,
+30433,30433,30531,30575,30693,30693,30681,30681,
+30285,29873,29505,29006,28317,28363,28196,25727,
+24885,24427,24097,23767,23636,22939,22609,21703,
+22712,22916,21954,22429,21438,21114,20621,20415,
+20253,20459,20772,20884,22048,21758,21674,22195,
+22416,22160,22581,22900,23156,23549,23843,23980,
+24254,24302,24398,24436,24470,24109,22844,22031,
+21370,21284,21377,21526,21878,21794,21550,21031,
+21060,20674,18142,20329,18064,18323,20813,19846,
+19440,19243,19035,18707,18573,18386,18712,18745,
+18640,18831,18557,18741,19886,20140,20346,20584,
+20657,20726,20896,20967,20889,20851,20858,20825,
+19463,19485,19493,19280,19306,18944,18731,18580,
+18412,17840,17338,16768,16091,15805,15757,15223,
+15240,15031,14549,14311,14164,15051,15620,16227,
+17162,17464,17795,18364,18684,19086,19943,20205,
+20318,20721,21007,21123,20708,19935,19216,17608,
+16995,17643,19071,19309,19465,19978,20498,20898,
+25615,25625,25633,25411,24939,23539,23945,25364,
+25579,25685,27046,27046,27092,27092,27108,27115,
+27133,27133,27285,27285,27543,27686,28143,28143,
+28844,28844,29385,29591,30083,30083,30471,30471,
+30623,30679,30814,30814,30938,30938,31124,31215,
+31479,31479,31550,31550,31441,31424,31450,31450,
+31645,31645,31749,31777,31818,31818,31810,31810,
+31750,31737,31738,31738,31813,31813,31878,31904,
+31968,31968,32007,32007,32007,32010,32021,32021,
+32044,32044,32070,32083,32118,32118,32149,32149,
+32170,32178,32199,32199,32212,32212,32212,32212,
+32214,32214,32227,32227,32241,32242,32227,32227,
+32163,32163,32088,32058,31984,31984,31916,31916,
+31878,31870,31873,31873,31910,31910,31656,31509,
+31589,31948,32017,32017,31868,31800,31612,31612,
+31447,31447,31184,31938,31792,31849,31651,31304,
+30998,30591,30425,30223,30064,30174,30293,30372,
+30368,30379,30061,29758,29374,28507,28350,28260,
+28279,27588,26564,26219,25720,25573,25187,25021,
+25053,25121,25247,25473,25881,25922,25985,25759,
+25424,25248,25102,25015,25450,25288,25114,24773,
+24083,23881,23746,23450,23308,23245,23807,23945,
+23978,23701,23499,23296,22995,22835,22780,23024,
+23133,23192,23156,23088,23007,22977,23100,23254,
+23973,24230,24488,24557,24687,24706,24660,24676,
+24708,24705,24847,24836,24851,24908,24783,24841,
+24941,25090,25541,25613,25444,24929,24674,24407,
+23973,23641,23461,23567,23341,23274,23135,23042,
+22949,22868,22660,22342,21760,21811,21690,21472,
+21441,21480,21486,21492,21459,21879,21751,21984,
+22856,23196,23323,23113,22926,22945,22916,22962,
+22798,20718,21197,22288,21000,21317,23101,21850,
+23163,23190,23127,22926,22757,22550,22632,22616,
+22792,22710,22866,22977,23113,23253,23569,23932,
+24210,24617,24432,24024,22758,22341,21986,22005,
+21849,21685,20735,20730,20531,20777,21082,20224,
+16481,16862,18050,18564,19114,19352,18673,18369,
+17966,16974,16156,15871,14043,13840,14138,13513,
+13808,14892,13699,12945,12299,12511,12150,11238,
+9912,10013,10285,10165,9354,8572,9235,10144,
+11686,13293,13615,13738,11936,10924,10628,11404,
+11532,10941,13112,12823,13706,13606,13145,12359,
+11732,11705,11444,9857,10314,10664,11316,11433,
+11818,13310,14080,14555,14938,14990,15036,14691,
+14521,14338,14133,14056,14046,14023,13902,13667,
+13288,13057,12509,12231,12378,12823,13496,13747,
+14001,14154,14064,13824,13549,14140,14793,15402,
+15544,15553,16090,15893,16503,17237,17754,18212,
+18685,18802,18630,18307,18609,19144,19913,20079,
+19849,19287,18822,17979,18513,19834,21693,24544,
+25141,25674,25867,25706,25897,25127,25242,25686,
+27193,27193,27292,27321,27367,27367,27461,27461,
+27577,27600,27601,27601,27486,27486,27392,27350,
+27238,27238,27132,27132,27081,27064,27034,26504,
+27015,27015,27127,27153,27175,27175,27324,27324,
+27462,27513,27635,27635,27756,27756,27843,27878,
+27963,27963,28102,28102,28241,28288,28384,28384,
+28458,28458,28512,28531,28573,28573,28580,28580,
+28552,28549,28552,28552,28594,28594,28632,28648,
+28686,28686,28711,28711,28717,28716,28699,28699,
+28642,28642,28616,28610,28607,28607,28607,28607,
+28611,28615,28634,28634,28677,28677,28700,28705,
+28708,28708,28694,28694,28670,28666,28671,28671,
+28715,28715,28758,28777,28828,28828,28852,28852,
+28852,28845,28808,28808,28711,28711,28709,28724,
+28807,28807,28841,28841,28813,28804,28789,28789,
+28784,28784,28799,28806,28835,28835,28878,28878,
+28924,28946,29007,29007,29104,29104,29177,29204,
+29267,29267,29318,29318,29343,29361,29421,29421,
+29522,29522,29612,29649,29746,29746,29863,29863,
+29962,29994,30055,30055,30091,30091,30116,30126,
+30145,30145,30212,30212,30298,30327,30386,30386,
+30433,30433,30531,30575,30693,30693,30681,30681,
+30580,30564,30552,30552,26575,26440,26142,24755,
+24063,23550,24116,24394,24342,23049,22193,22565,
+21364,21936,21792,21559,21337,21068,20628,20630,
+20618,20983,21391,21472,22272,21906,21869,22225,
+22279,22087,22567,22737,22984,23390,23757,24070,
+24443,24554,24591,24510,24335,24041,22173,21779,
+21540,21516,21322,20868,20975,21168,21127,21131,
+20888,19352,20485,17531,17492,18084,19914,19089,
+17924,18122,19320,19308,19067,19026,19430,19450,
+19299,19558,19236,19226,19993,20093,20217,20318,
+20466,20665,20804,20860,20884,20827,20763,20654,
+19882,19814,19836,19862,19808,19748,19381,18991,
+18873,18126,17806,17372,17140,16428,16206,15801,
+15550,15400,15390,14758,14449,14986,15501,16031,
+16837,17122,17402,17954,18267,18497,19408,19793,
+19996,20252,20404,20491,20216,19984,18646,16936,
+16959,17132,17694,17449,17605,18676,19429,19698,
+20978,21637,25623,25382,24938,24934,23551,24265,
+25591,25685,27046,27046,27092,27092,27108,27115,
+27133,27133,27285,27285,27543,27686,28143,28143,
+28844,28844,29385,29591,30083,30083,30471,30471,
+30623,30679,30814,30814,30938,30938,31124,31215,
+31479,31479,31550,31550,31441,31424,31450,31450,
+31645,31645,31749,31777,31818,31818,31810,31810,
+31750,31737,31738,31738,31813,31813,31878,31904,
+31968,31968,32007,32007,32007,32010,32021,32021,
+32044,32044,32070,32083,32118,32118,32149,32149,
+32170,32178,32199,32199,32212,32212,32212,32212,
+32214,32214,32227,32227,32241,32242,32227,32227,
+32163,32163,32088,32058,31984,31984,31916,31916,
+31878,31870,31873,31873,31910,31910,31924,31356,
+31228,31404,31695,31671,31803,31800,31612,31612,
+31447,31447,31184,31954,31840,31796,31766,31526,
+31435,31275,31120,30823,30477,30418,30485,30099,
+29947,29937,29972,29799,29448,28939,29004,29267,
+29299,28842,27816,26548,26260,25872,25228,25014,
+25083,25869,26086,26155,25924,25815,25878,25790,
+25546,25075,24685,24934,24921,24894,24701,24392,
+24177,23892,23709,23304,23218,23158,23173,23306,
+23480,23377,23356,23265,23017,22907,22843,23000,
+23169,23296,23362,23267,23131,22971,23017,23114,
+23659,23941,24207,24354,24496,24529,24504,24462,
+24489,24405,24394,24542,24676,24558,24472,24507,
+24658,24824,25005,24995,24767,24231,23960,23668,
+23464,23545,23720,23480,23424,23448,23307,23170,
+22936,22515,22206,21863,21564,21582,21582,21226,
+21327,21292,21417,21428,21379,21429,20969,21710,
+22579,22945,23114,23218,23168,23143,23013,22960,
+23061,22965,22127,21949,22326,22374,20921,22605,
+21789,22733,22994,22953,22879,22659,22748,22841,
+22936,22852,22866,23121,23240,23396,23794,24101,
+24298,23997,23404,22438,21411,21294,21272,21083,
+20812,20788,20663,20828,20854,21436,21278,20520,
+19594,19510,17934,17485,18273,18854,18237,17974,
+15364,16550,13924,13983,15080,15303,14499,12462,
+12509,12949,12534,12073,11505,11742,12403,12666,
+11938,12163,12749,11203,10284,9397,9788,10866,
+11407,12916,13206,13185,11297,10351,9803,10538,
+10835,11198,12001,12081,13504,13851,13438,12950,
+12453,12429,12065,10442,10580,11189,11924,12163,
+12432,13364,13883,14322,14777,14887,14898,14347,
+13984,13644,13277,13252,13310,13528,13502,13371,
+12875,12623,12107,11840,12026,12473,13196,13426,
+13690,14084,14005,13868,13782,14166,14725,15611,
+15810,16018,16597,16568,17107,17289,17913,18377,
+18958,18992,18469,18606,18901,19053,20118,20800,
+21269,20055,20007,19620,20391,21796,23355,24504,
+24924,25648,25932,25766,25825,25259,25406,25814,
+27193,27193,27292,27321,27367,27367,27461,27461,
+27577,27600,27601,27601,27486,27486,27392,27350,
+27238,27238,27132,27132,27081,27064,27034,27034,
+27015,27015,27127,27153,27175,27175,27324,27324,
+27462,27513,27635,27635,27756,27756,27843,27878,
+27963,27963,28102,28102,28241,28288,28384,28384,
+28458,28458,28512,28531,28573,28573,28580,28580,
+28552,28549,28552,28552,28594,28594,28632,28648,
+28686,28686,28711,28711,28717,28716,28699,28699,
+28546,28546,28545,28554,28601,28601,28629,28629,
+28626,28628,28637,28637,28671,28671,28697,28706,
+28725,28725,28718,28718,28690,28681,28667,28667,
+28665,28665,28686,28699,28741,28741,28778,28778,
+28808,28810,28787,28787,28685,28685,28674,28685,
+28752,28752,28751,28751,28683,28667,28653,28653,
+28705,28705,28713,28708,28675,28675,28680,28680,
+28721,28742,28808,28808,28924,28924,29035,29080,
+29199,29199,29289,29289,29326,29346,29409,29409,
+29507,29507,29572,29595,29645,29645,29730,29730,
+29823,29855,29925,29925,29991,29991,30008,30007,
+29985,29985,30032,30032,30127,30159,30226,30226,
+30279,30279,30370,30410,30517,30517,30529,30529,
+30499,29264,28362,26575,25479,24967,24676,23870,
+23786,23734,24445,24584,24344,22939,23028,23021,
+21324,21427,21229,21789,19874,19712,20941,20480,
+20014,20311,21498,22265,21994,21768,21955,22211,
+22207,22222,22680,22929,23045,23391,23842,23984,
+24299,24406,24522,24343,24103,23750,22055,21466,
+21661,21595,20857,20161,19866,20381,20847,20019,
+19793,19373,20722,18028,17952,18583,20244,20109,
+18047,18174,18689,19108,19213,19763,19846,19870,
+19847,19895,19851,19846,20063,20173,20373,20485,
+20528,20585,20699,20758,20709,20713,20290,20012,
+20206,20113,20072,19985,19949,20142,19998,19510,
+19635,18834,18361,17691,17268,17648,16917,16455,
+15866,15643,15231,15298,14924,15087,15414,15749,
+16479,16635,16992,17616,17904,18146,19095,19351,
+19425,19688,19818,19965,19919,19693,19154,15204,
+15617,16523,17293,17409,17632,18149,18590,18770,
+19552,20301,22449,25236,24946,25015,23547,24094,
+25566,25681,25687,25691,25696,25699,27080,27082,
+27090,27090,27283,27283,27619,27784,28274,28274,
+28949,28949,29424,29595,29977,29977,30361,30361,
+30613,30684,30791,30791,30747,30747,30785,30816,
+30934,30934,30994,30994,30999,31002,31011,31011,
+31030,31030,31095,31131,31238,31238,31318,31318,
+31340,31353,31400,31400,31492,31492,31584,31623,
+31724,31724,31811,31811,31853,31867,31895,31895,
+31913,31913,31932,31940,31961,31961,31996,31996,
+32040,32056,32095,32095,32121,32121,32126,32127,
+32125,32125,32132,32132,32140,32140,32132,32132,
+32091,32091,32015,31983,31898,31898,31848,31848,
+31809,31796,31766,31766,31814,31814,31816,31594,
+31443,31382,31417,31328,31368,31540,31677,31671,
+31525,31664,31912,30989,30812,30812,31882,31772,
+31583,31494,31442,31325,30710,30643,30582,30013,
+29778,29725,29792,29841,29642,29327,29520,29820,
+30075,29559,29081,28214,26722,26538,26296,26212,
+26251,26282,26288,26218,25882,25890,25927,25996,
+25750,25296,24632,24717,24577,24488,24421,24177,
+23828,23548,23328,23106,23023,22997,22752,22761,
+22988,23172,23168,23144,22972,22958,22919,22981,
+23173,23344,23483,23380,23174,22991,23017,23078,
+23336,23555,23866,24090,24200,24282,24337,24291,
+24297,24204,24278,24239,24282,24241,24083,24222,
+24325,24317,24231,24216,24107,23716,23581,23477,
+23619,23776,23767,23686,23611,23534,23283,23029,
+22717,22105,21706,21412,21326,21374,21191,21275,
+21231,21283,21570,21515,21488,21231,21366,21678,
+22126,22444,22375,23264,23070,23016,22784,22619,
+22614,22760,22729,22788,22614,22626,22440,20875,
+22772,22905,22888,22649,22614,22543,22577,22775,
+23083,23244,23277,23517,23595,23703,23973,23937,
+23763,22163,21298,21090,20210,20295,20427,20202,
+20167,19971,20397,20735,21275,21564,21400,21127,
+19092,20100,20115,18189,18380,18815,17728,17551,
+17223,14495,14496,14886,12745,14025,15828,13327,
+12424,13198,12040,12213,12422,11989,12171,13206,
+12441,12410,12415,11130,10082,9228,10913,11356,
+11426,11962,11686,11465,10011,9286,8776,8465,
+9507,9708,11579,11423,12838,13445,13244,12974,
+12064,11900,11474,10312,10876,11479,12260,12688,
+13114,13758,14101,14401,14739,14780,14696,14057,
+13354,12815,12350,12258,12248,12485,12588,12560,
+12128,11765,11307,11116,11345,11704,12423,12714,
+12993,13340,13440,13437,13812,14261,14579,15565,
+15848,16143,16891,17016,17353,17417,17737,18039,
+19160,19206,18504,19471,19628,19618,20617,21450,
+22234,22147,21249,21039,22332,24085,24771,24872,
+25066,25548,26002,25857,25606,25696,25866,25696,
+27161,27161,27343,27378,27367,27367,27425,27425,
+27534,27558,27574,27574,27498,27498,27407,27363,
+27233,27233,27085,27085,26976,26943,26887,26887,
+26956,26164,26999,26995,26935,26935,27078,27078,
+27270,27338,27480,27480,27591,27591,27699,27747,
+27877,27877,28078,28078,28271,28332,28443,28443,
+28486,28486,28522,28534,28559,28559,28548,28548,
+28507,28503,28522,28522,28622,28622,28666,28674,
+28675,28675,28665,28665,28649,28639,28608,28608,
+28505,28505,28510,28523,28586,28586,28621,28621,
+28618,28620,28630,28630,28661,28661,28690,28702,
+28727,28727,28726,28726,28702,28694,28677,28677,
+28666,28666,28678,28688,28723,28723,28762,28762,
+28801,28804,28784,28784,28677,28677,28663,28672,
+28734,28734,28726,28726,28652,28634,28622,28622,
+28686,28686,28693,28685,28638,28638,28632,28632,
+28669,28689,28755,28755,28874,28874,28990,29038,
+29164,29164,29261,29261,29302,29324,29389,29389,
+29486,29486,29544,29562,29598,29598,29673,29673,
+29759,29792,29864,29864,29940,29940,29960,29958,
+29930,29930,29977,29977,30077,30111,30185,30185,
+30245,30245,30328,30364,30461,30461,30486,30486,
+29938,28035,26445,25670,24893,25000,25207,25173,
+25172,25118,24635,24859,25118,23868,23966,23774,
+23414,23402,23077,21025,20433,20436,19841,19745,
+20572,21993,22014,21741,21911,22075,22303,22593,
+22674,22828,23276,23384,23357,23588,23792,23967,
+24036,23992,23821,23508,23058,22740,22080,21653,
+21287,21571,21496,21065,20916,21129,21381,20846,
+20625,20521,20919,21085,21083,21632,20004,20049,
+19382,19280,19315,19404,19404,19754,20014,20010,
+19991,20148,20189,20311,20529,20180,20256,20404,
+20764,20762,20415,20223,20523,20465,20452,20307,
+20565,20387,20373,20364,20453,20705,20722,20416,
+20399,19916,19254,18889,17923,18139,18104,17250,
+16871,16506,15534,15314,15121,14999,15288,15557,
+16210,16360,16549,16916,17120,17041,18122,18466,
+18599,18800,19006,19116,19344,19407,19398,19143,
+18317,17305,16825,16878,15660,16012,17482,19307,
+19500,18983,19983,20884,21366,21848,22977,23742,
+25531,25675,25680,25687,25698,25703,27078,27083,
+27099,27099,27310,27310,27662,27829,28314,28314,
+28960,28960,29400,29556,29897,29897,30261,30261,
+30525,30597,30695,30695,30622,30622,30626,30642,
+30719,30719,30776,30776,30814,30824,30837,30837,
+30823,30823,30881,30916,31036,31036,31135,31135,
+31179,31200,31261,31261,31364,31364,31465,31507,
+31619,31619,31722,31722,31781,31800,31837,31837,
+31856,31856,31876,31883,31905,31905,31942,31942,
+31992,32010,32056,32056,32088,32088,32096,32097,
+32096,32096,32101,32101,32106,32106,32098,32098,
+32062,32062,31989,31071,30922,30706,30839,30872,
+31792,31775,31741,31741,31778,31778,31380,30826,
+30504,30368,30903,31249,31344,31006,31123,31299,
+31547,31640,31756,30917,30757,30757,30568,30568,
+31380,31191,31064,30954,30770,30650,30530,30212,
+30022,29818,29554,29521,29435,29411,29333,29321,
+29388,29382,29407,29297,28588,28145,26817,26647,
+26575,26571,26541,26470,26323,26249,26123,25828,
+25736,25433,24682,24467,24136,23961,23726,23555,
+23046,22945,22847,22685,22578,22591,22655,22678,
+22813,22993,23048,23110,23310,23403,23493,23527,
+23581,23702,23913,23821,23633,23090,22933,22785,
+22848,23030,23338,23706,23790,23894,24056,24086,
+24036,23792,23714,23750,23647,23611,23646,23768,
+23700,23594,22871,23674,23332,23527,23588,23656,
+23651,23589,23841,24018,23790,23412,22839,22412,
+21782,21121,20954,20872,20895,20967,21080,21318,
+21525,21683,22176,22504,22470,21943,21761,21882,
+22001,21961,22102,22482,22194,22727,22664,22555,
+22439,21984,22587,22597,22380,22503,22572,22435,
+22374,22397,22480,22490,22466,22542,22591,22757,
+23144,23272,23449,23972,24156,24199,23031,22140,
+21461,20284,20077,19638,19328,19289,19111,18850,
+18757,18445,18071,18321,18597,19203,19602,19932,
+18888,17471,17384,17922,19366,19284,15937,16501,
+18577,16933,15728,15148,15801,15156,11920,10583,
+10489,10724,10876,11016,11101,10573,10172,9851,
+10294,10739,10216,10796,10428,9090,8840,8752,
+8662,9006,9033,10093,10875,10666,10471,11555,
+13068,14226,13762,14074,11829,10216,10735,11049,
+11106,11096,11302,12049,12208,12228,12472,12688,
+13069,13990,14433,14669,14366,14177,14155,14168,
+13796,13266,12510,12177,11723,11375,11667,12090,
+12128,11725,10758,9915,9682,9589,10238,10813,
+11303,11791,12209,12750,14074,14564,14716,15459,
+15953,16213,17752,18271,18331,18296,17909,17711,
+18536,19426,19897,19050,18508,18553,19715,20858,
+21995,23993,24473,24515,24362,24594,25089,25554,
+25437,25502,25840,25856,25854,26061,26830,26830,
+27135,27135,27331,27367,27352,27352,27407,27407,
+27508,27533,27553,27553,27493,27493,27402,27356,
+27215,27215,27053,27053,26932,26896,26835,26835,
+26921,24773,24463,24633,26869,26869,27009,27009,
+27199,27266,27411,27411,27521,27521,27636,27687,
+27830,27830,28044,28044,28247,28310,28426,28426,
+28470,28470,28507,28518,28544,28544,28535,28535,
+28498,28496,28519,28519,28624,28624,28664,28671,
+28663,28663,28642,28642,28621,28609,28572,28572,
+28397,28397,28412,28432,28521,28521,28574,28574,
+28575,28578,28591,28591,28628,28628,28666,28682,
+28722,28722,28744,28744,28738,28734,28724,28724,
+28704,28704,28700,28700,28710,28710,28744,28744,
+28799,28805,28785,28785,28662,28662,28636,28643,
+28699,28699,28686,28686,28610,28593,28586,28586,
+28666,28666,28669,28656,28591,28591,28566,28566,
+28591,28607,28667,28667,28787,28787,28898,28943,
+29060,29060,29163,29163,29216,29241,29309,29309,
+29402,29402,29447,29459,29470,29470,29519,29519,
+29588,29616,29690,29690,29791,29791,29827,29830,
+29808,29808,29870,29870,29986,30028,30124,30124,
+30211,30211,30263,30285,30339,30339,30410,30410,
+29580,27304,26515,26029,25409,25305,25137,24740,
+24690,24421,23698,23864,24137,23939,23577,23459,
+23060,23153,23069,21751,20867,19722,20159,21228,
+22233,22951,22282,22120,22063,22296,22466,22677,
+22782,22922,23017,23232,23303,23597,23870,23966,
+23863,23438,23257,23003,22764,22538,22036,21917,
+21701,21580,21450,21418,21626,21706,21834,22900,
+21031,21148,22190,23257,23096,22643,20621,20592,
+19741,19824,19892,19977,20065,20057,20047,20091,
+20176,20164,20249,20157,20276,20372,20424,20540,
+20459,20468,20072,20578,20612,20500,20539,20353,
+20557,20496,20468,20363,20616,20581,20231,20138,
+20414,20258,19599,19079,18337,18254,18182,17576,
+17361,17568,16290,16777,15435,16160,16311,15772,
+15737,15811,15957,16377,16460,16728,17125,17699,
+17918,18176,18448,18673,19028,19240,19290,19223,
+19142,19291,18576,18061,17349,18259,18233,18953,
+19849,19600,19380,20112,20758,21403,22833,23510,
+24236,25673,25674,25683,25700,25707,27093,27111,
+27174,27174,27433,27433,27795,27955,28393,28393,
+28932,28932,29273,29388,29626,29626,29911,29911,
+30153,30217,30300,30300,30217,30217,30180,30174,
+30183,30183,30238,30238,30332,30358,30394,30394,
+30365,30365,30419,30454,30575,30575,30699,30699,
+30781,30816,30909,30909,31040,31040,31161,31211,
+31335,31335,31476,31476,31581,31614,31674,31674,
+31702,31702,31732,31744,31775,31775,31823,31823,
+31879,31901,31960,31960,32011,32011,32031,32035,
+32035,32035,32034,32034,32034,32032,32021,32021,
+31988,31988,31930,31908,30734,30569,30609,30562,
+30588,30855,31067,31704,31688,31688,31678,30700,
+30288,30108,30641,31091,31305,31054,31146,31231,
+31424,31455,31544,30689,30628,30628,30484,30484,
+30381,31328,31164,30890,30646,30553,30445,30221,
+30058,29894,29565,29510,29334,29242,29236,29303,
+29263,29204,29176,28824,28543,28098,26951,26731,
+26577,26572,26545,26480,26323,26233,26104,25714,
+25620,25374,24759,24266,24134,23858,23700,23279,
+22689,22520,22496,22282,22306,22256,22424,22559,
+22702,23055,23233,23371,23662,23823,23962,24055,
+24054,24049,23924,24010,23841,23204,22874,22615,
+22630,22861,23161,23554,23636,23652,23828,23930,
+23803,23575,23414,23566,23554,23594,23617,23595,
+23445,23386,22767,23375,23688,23716,23724,23686,
+23452,23393,23353,23592,23332,23006,22214,21591,
+21290,20709,20555,20533,20622,20618,20808,21497,
+22005,22253,21077,22325,22436,22324,22239,22059,
+21850,21904,21916,22063,22188,22277,22455,22432,
+22388,22401,22831,22757,22516,22714,22849,22701,
+22627,22453,22204,22224,22376,22597,22690,22891,
+23326,23488,23690,23843,23568,22956,21697,20874,
+20580,19724,19400,19322,18992,18816,18681,18574,
+18401,17985,17830,17811,17760,17676,17868,17945,
+17754,15601,15162,15068,17578,16705,14148,14243,
+15683,17637,15049,13527,16221,15523,12999,10796,
+11998,11398,10211,9744,9650,10028,10238,10777,
+10957,11502,10840,10988,10177,9007,8389,8447,
+8108,8770,8804,9263,10151,10074,10162,12232,
+13225,13360,13027,12866,12924,12669,11767,9604,
+7901,8148,9008,10926,11508,11723,12299,12565,
+12922,13678,13988,14073,13834,13609,13631,13916,
+13695,13209,12166,11933,11561,11149,11275,11643,
+11678,11291,10426,9411,8919,8687,9691,10355,
+10821,11456,11940,12475,13413,13911,14098,14731,
+15366,15913,17664,18048,18250,18568,18353,18110,
+18242,18638,18743,18337,17666,17748,18922,20318,
+21577,23642,24375,24556,24286,24386,24745,25115,
+25093,25135,25690,25687,25686,25850,26870,26870,
+27052,27052,27240,27280,27292,27292,27348,27348,
+27429,27453,27485,27485,27465,27465,27370,27316,
+27140,27140,26951,26951,26819,26779,26715,26715,
+26812,24280,23548,23427,23978,26753,26887,26887,
+27031,27087,27221,27221,27340,27340,27469,27528,
+27690,27690,27917,27917,28121,28187,28315,28315,
+28383,28383,28433,28450,28486,28486,28502,28502,
+28495,28499,28529,28529,28613,28613,28636,28637,
+28617,28617,28582,28582,28549,28533,28481,28481,
+28397,28397,28412,28432,28521,28521,28574,28574,
+28575,28578,28591,28591,28628,28628,28666,28682,
+28722,28722,28744,28744,28738,28734,28724,28724,
+28704,28704,28700,28700,28710,28710,28744,28744,
+28799,28805,28785,28785,28662,28662,28636,28643,
+28699,28699,28686,28686,28610,28593,28586,28586,
+28666,28666,28669,28656,28591,28591,28566,28566,
+28591,28607,28667,28667,28787,28787,28898,28943,
+29060,29060,29163,29163,29216,29241,29309,29309,
+29402,29402,29447,29459,29470,29470,29519,29519,
+29588,29616,29690,29690,29791,29791,29827,29830,
+29808,29808,29870,29870,29986,30028,30124,30124,
+30211,30211,30263,30285,30339,30339,29457,28992,
+28494,26539,26335,26111,25654,25463,25208,24622,
+24284,24022,24184,24296,24283,23521,22390,22875,
+22682,22708,22680,21752,21139,20373,21885,22652,
+22689,23006,22547,22299,22692,22943,23077,23312,
+23351,23330,23362,23410,23440,23657,23732,23839,
+23736,23280,22955,22634,22589,22505,22181,22100,
+21906,21753,21678,21687,22061,22119,21903,21715,
+23435,21697,23585,23294,22963,20835,20827,20510,
+20105,20004,19983,19735,20067,20029,20168,20102,
+20207,20233,20307,20251,20397,20393,20498,20634,
+20502,20503,20297,20313,20310,20270,20275,20219,
+20264,20275,20334,20715,20707,20660,20143,20340,
+20568,20434,20046,19502,18595,18301,18180,17746,
+17556,17709,17265,16777,16324,15819,16159,16178,
+16863,16965,17040,15924,16680,16033,16498,16892,
+16961,17609,17881,18194,18690,18980,19195,19319,
+19091,19084,19511,19048,18686,18954,18699,18733,
+19735,19731,18668,19667,20576,21518,22883,23629,
+25650,25672,25673,25680,25701,25708,27093,27111,
+27174,27174,27433,27433,27795,27955,28393,28393,
+28932,28932,29273,29388,29626,29626,29911,29911,
+30153,30217,30300,30300,30217,30217,30180,30174,
+30183,30183,30238,30238,30332,30358,30394,30394,
+30365,30365,30419,30454,30575,30575,30699,30699,
+30781,30816,30909,30909,31040,31040,31161,31211,
+31335,31335,31476,31476,31581,31614,31674,31674,
+31702,31702,31732,31744,31775,31775,31823,31823,
+31879,31901,31960,31960,32011,32011,32031,32035,
+32035,32035,32034,32034,32034,32032,32021,32021,
+31988,31988,31930,31908,31858,30945,30797,30635,
+30546,30544,30632,30825,31688,31688,31678,31669,
+30470,30264,30596,30842,30903,31029,31022,31225,
+31321,31321,31452,30689,30628,30628,30484,30484,
+30381,31151,30214,30953,30544,30409,30280,30184,
+30009,29876,29637,29489,29322,29081,29026,29088,
+29134,28999,28991,28695,28389,28066,26680,26575,
+26575,26553,26492,26401,26207,26130,26010,25588,
+25389,25182,24598,24351,24020,23659,23168,22904,
+22607,22360,22274,22095,22100,22156,22423,22496,
+22829,23472,23849,24044,24217,24206,24276,24223,
+24191,24150,24098,24049,23954,23362,23027,22654,
+22586,22684,23077,23451,23546,23598,23763,23770,
+23717,23132,23220,23368,23417,23511,23568,23486,
+23376,23317,23435,23439,23651,23484,23123,22841,
+22515,22684,22954,22754,22532,22282,21683,21294,
+20975,20535,20442,20406,20339,20373,20619,21527,
+22190,22364,21537,21732,22257,22789,22480,22276,
+21880,21911,21898,21962,22144,22304,22402,22426,
+22401,22510,22632,22637,22468,22784,23010,22986,
+22952,22909,22887,22894,23005,22824,22883,22971,
+23369,23521,23507,22599,21907,21579,20855,20293,
+20025,19343,19077,18947,18853,18657,18498,18299,
+18158,17938,17385,17282,17299,16917,16457,16786,
+17042,16782,15011,16370,16333,16634,14173,14263,
+14876,16539,16262,14053,14504,14090,14145,13096,
+12710,12445,11015,11272,10907,10949,10601,10617,
+10907,11138,11127,10276,9465,8744,8668,9293,
+9568,9998,10465,10180,9611,10490,11317,12556,
+12820,12674,10400,11424,12502,12608,12423,8831,
+6447,6177,6459,8119,8907,9802,11861,12611,
+13135,13436,13466,13393,13175,13203,13370,13665,
+13564,13306,12324,12063,11971,11635,11711,11869,
+11713,11305,10032,9471,9314,9025,9493,10133,
+10625,11463,11863,12274,13219,13674,14108,14874,
+15154,15730,18077,18540,18742,18782,18772,18578,
+18043,17955,18092,17951,17180,16994,18311,19824,
+21085,22829,23574,24143,24679,24800,24924,24968,
+24855,24878,25653,25752,25636,25658,25876,26870,
+27052,27052,27240,27280,27292,27292,27348,27348,
+27429,27453,27485,27485,27465,27465,27370,27316,
+27140,27140,26951,26951,26819,26779,26715,26715,
+23811,23500,22830,22679,23199,26753,26887,26887,
+27031,27087,27221,27221,27340,27340,27469,27528,
+27690,27690,27917,27917,28121,28187,28315,28315,
+28383,28383,28433,28450,28486,28486,28502,28502,
+28495,28499,28529,28529,28613,28613,28636,28637,
+28617,28617,28582,28582,28549,28533,28481,28481,
+28262,28262,28266,28286,28380,28380,28443,28443,
+28457,28466,28495,28495,28555,28555,28609,28632,
+28687,28687,28739,28739,28771,28782,28805,28805,
+28810,28810,28788,28775,28732,28732,28739,28739,
+28803,28810,28781,28781,28630,28630,28599,28606,
+28669,28669,28687,28687,28656,28650,28656,28656,
+28708,28708,28709,28701,28656,28656,28631,28631,
+28633,28642,28683,28683,28785,28785,28841,28858,
+28885,28885,28945,28945,29015,29045,29120,29120,
+29214,29214,29256,29266,29276,29276,29300,29300,
+29333,29352,29421,29421,29553,29553,29639,29666,
+29712,29712,29835,29835,29985,30045,30191,30442,
+30349,30349,30379,29613,29143,28812,28007,27267,
+26228,25650,25777,25845,25870,25856,25670,25009,
+24918,25007,24917,24465,23994,22975,22728,22071,
+21860,21685,20899,22030,22517,23047,23412,23595,
+23395,23267,23047,23143,23657,23412,23524,23675,
+23635,23525,23550,23648,23738,23774,23737,23751,
+24199,23992,23661,22786,22115,22062,22216,21879,
+21589,21635,21739,21743,21296,21436,21666,23391,
+21429,21209,22765,23007,22415,20100,20064,19979,
+20096,20161,20107,20147,20015,19479,19811,19828,
+19799,19991,19932,19642,19110,19055,18966,19202,
+18735,18758,18714,18715,18704,18775,18944,19076,
+19106,19336,19455,20950,21056,21091,20947,20862,
+20233,20069,19713,19458,19068,18986,18828,18254,
+17892,17716,17827,17221,16965,16322,16274,17004,
+16034,15981,15883,17186,16273,17386,16430,17627,
+17449,17455,17496,17592,17766,18039,17834,18768,
+19212,19195,19086,19163,19181,19429,19228,17837,
+19585,19470,19305,19508,20403,21309,22882,23625,
+25501,25670,25676,25679,27069,27069,27162,27216,
+27397,27397,27710,27710,28007,28128,28439,28439,
+28793,28793,29003,29073,29214,29214,29335,29335,
+29403,29429,29493,29493,29567,29567,29591,29597,
+29600,29600,29657,29657,29750,29790,29898,29898,
+30045,30045,30132,30160,30208,30208,30286,30286,
+30371,30410,30522,30522,30698,30698,30825,30870,
+30969,30969,31133,31133,31294,31345,31441,31441,
+31488,31488,31547,31573,31647,31647,31715,31715,
+31757,31777,31836,31836,31914,31914,31947,31954,
+31958,31958,31958,31958,31959,31955,31934,31934,
+31879,31879,31847,31840,31004,30902,30576,30437,
+30403,30447,30577,30674,31561,31561,31531,31504,
+31400,31400,30715,30579,30294,30637,30909,31044,
+30308,30308,30382,30386,30337,30337,30288,30288,
+30264,30252,30210,30210,30503,30426,30360,30216,
+30029,29853,29608,29469,29402,29007,28923,28839,
+28636,28524,28430,28312,28160,27986,26888,26639,
+26556,26409,26270,26130,25893,25730,25566,25004,
+24841,24631,24009,24029,23537,23010,22916,22621,
+22434,22514,22490,22375,22907,23545,24046,24223,
+24110,24570,24775,24813,24847,24794,24705,24416,
+24268,24176,24072,24039,23945,23466,23128,22842,
+22640,22721,22968,23326,23371,23357,23282,23433,
+23377,23111,22974,22894,22945,22957,22870,22954,
+22994,22975,23446,23499,23476,23047,22598,22370,
+22089,21964,21869,21798,21583,21093,21304,21215,
+20989,20984,21053,20826,20513,20678,20915,20772,
+21802,22274,20645,21805,21863,22723,22601,22163,
+21814,21764,21789,22044,21855,22215,22305,22549,
+22576,22648,22549,22592,22679,22674,22646,22841,
+23226,23277,23316,23411,23439,23496,23293,22906,
+22246,21936,21567,20953,20517,20174,19542,19341,
+19161,18924,18738,18560,18135,17968,17813,17362,
+17101,16977,15902,16390,16937,16713,14904,16734,
+14651,16257,14325,16364,15956,14101,15948,15471,
+16078,13583,12560,13229,13262,13437,13311,12653,
+12666,11995,11232,10893,11056,9473,9479,9501,
+8430,7242,7174,8031,8911,9162,8980,9029,
+8792,9504,10398,11037,11000,11070,11780,11827,
+11509,9804,7343,7076,7089,6435,7552,11632,
+12283,12124,8034,6772,7160,7401,9277,10869,
+12143,12973,12924,12975,12248,12483,12353,12174,
+11943,11502,10482,10674,11284,11969,11986,11898,
+11643,11497,11121,10575,10514,10539,10606,10780,
+10979,11619,11785,11713,12271,13072,14103,14757,
+15036,15334,17494,18215,18411,18157,17857,17511,
+17142,17399,17669,17357,16699,16330,17544,18955,
+20257,21343,21892,22684,24254,24667,24915,25248,
+25277,25253,25662,25702,25506,25485,25694,25730,
+26848,26848,26941,26989,27137,27137,27253,27253,
+27302,27322,27365,27365,27393,27393,27285,27216,
+26983,26983,26785,26785,26701,26676,26636,26636,
+22665,22184,21613,21356,21382,21639,22827,23438,
+26947,26955,26950,26950,27077,27077,27218,27279,
+27440,27440,27629,27629,27772,27829,27965,27965,
+28127,28127,28238,28276,28358,28358,28455,28455,
+28532,28552,28576,28576,28544,28544,28527,28522,
+28515,28515,28490,28490,28460,28440,28377,28377,
+28262,28262,28266,28286,28380,28380,28443,28443,
+28457,28466,28495,28495,28555,28555,28609,28632,
+28687,28687,28739,28739,28771,28782,28805,28805,
+28810,28810,26900,28775,28732,28732,28739,28739,
+28803,28810,28781,28781,28630,28630,28599,28606,
+28669,28669,28687,28687,28656,28650,28656,28656,
+28708,28708,28709,28701,28656,28656,28631,28631,
+28633,28642,28683,28683,28785,28785,28841,28858,
+28885,28885,28945,28945,29015,29045,29120,29120,
+29214,29214,29256,29266,29276,29276,29300,29300,
+29333,29352,29421,29421,29553,29553,29639,29666,
+29712,29712,29835,29835,29985,30045,30543,30312,
+30349,30349,30379,28861,28207,26698,27425,26499,
+26022,25604,25674,25763,25662,25500,25412,25183,
+24917,24520,24863,24531,23650,23202,22739,22266,
+21804,21781,22051,22642,22680,22844,22968,22842,
+23002,23020,23048,23135,23291,23400,23648,23674,
+23617,23618,23678,23721,23785,23883,24225,24493,
+24408,24183,23702,22543,21973,21999,22212,21832,
+21520,21029,21114,21147,20801,21010,20725,22654,
+20837,20179,22138,22155,22423,19727,19401,19863,
+19983,19873,19778,19727,19448,19527,19273,19291,
+19000,18935,18736,18216,17607,17726,17631,17493,
+17531,17553,17593,17680,17745,17931,18036,18145,
+18251,18532,18791,20661,20803,20865,20814,20773,
+20401,20131,19676,19153,19054,18926,18777,18207,
+17991,18093,17838,17761,17009,17214,16421,17092,
+15938,16819,15603,16564,17108,16337,16420,17493,
+16296,16645,16980,17045,17333,17410,17606,18269,
+18597,18743,18660,18761,19067,19318,19558,19710,
+20134,22737,19555,19486,20493,21547,25035,25219,
+25519,25670,25674,25679,27069,27069,27162,27216,
+27397,27397,27710,27710,28007,28128,28439,28439,
+28793,28793,29003,29073,29214,29214,29335,29335,
+29403,29429,29493,29493,29567,29567,29591,29597,
+29600,29600,29657,29657,29750,29790,29898,29898,
+30045,30045,30132,30160,30208,30208,30286,30286,
+30371,30410,30522,30522,30698,30698,30825,30870,
+30969,30969,31133,31133,31294,31345,31441,31441,
+31488,31488,31547,31573,31647,31647,31715,31715,
+31757,31777,31836,31836,31914,31914,31947,31954,
+31958,31958,31958,31958,31959,31955,31934,31934,
+31879,31879,31847,31840,30619,30624,30254,30167,
+30304,30379,30553,30682,31561,31561,31531,31504,
+31400,31400,30689,30257,30333,30869,31029,31137,
+30308,30308,30382,30386,30337,30337,30288,30288,
+30264,30252,30210,30210,30083,30083,29957,29917,
+29847,29885,29506,29323,29267,29056,28954,28863,
+28643,28485,28425,28303,28203,28049,27268,26742,
+26543,26335,26144,25904,25567,25489,25371,25030,
+24806,24578,24113,23747,23368,22855,22776,22497,
+22385,22476,22550,23504,24037,24395,24742,24872,
+24910,24607,24549,24760,24803,24890,24770,24458,
+24307,24175,23874,23805,23705,23221,22983,22741,
+22580,22658,22973,23273,23244,23259,23260,23363,
+23342,22939,22809,22591,22857,22791,22521,22741,
+22768,22737,22930,22974,22919,22517,22189,21880,
+21194,21347,21361,21340,21306,21315,21417,21464,
+21515,21408,21298,21252,20945,20727,20814,21083,
+21529,22091,22138,20757,21493,22444,22247,21895,
+21664,21613,21690,21967,22061,22108,22257,22293,
+22449,22321,22393,22744,22527,22787,22519,22998,
+23235,23315,23155,23426,23195,22572,22318,22111,
+21613,21160,20758,20252,19916,19757,19333,19060,
+18845,18521,18456,18284,17914,17803,17634,17043,
+16788,16668,15383,16575,16502,16715,16656,16616,
+14507,14436,14312,15872,15569,13145,12842,13408,
+13498,12568,12224,11128,12616,13320,13495,13036,
+12809,12617,10891,11476,11037,10336,9985,9502,
+7898,7449,7723,9179,9663,9840,9909,10624,
+11345,11725,11703,11254,10452,10553,10879,11001,
+9819,8136,7628,8284,7837,6594,5744,6723,
+11485,11744,11719,6538,6807,6985,8090,9088,
+10768,12379,12939,12745,12819,12525,12358,11828,
+11443,11014,9520,9855,10353,11083,11027,11007,
+11053,11081,11093,11151,11263,11443,11410,11254,
+11138,12042,12388,12523,12903,13244,13616,14299,
+14401,14674,16540,17155,17570,17820,17857,17824,
+18019,18127,18030,17114,16233,15909,17040,18311,
+19558,20914,21573,22823,24125,23947,24203,24876,
+25193,25602,25672,25682,25677,25469,25669,25697,
+26848,26848,26941,26989,27137,27137,27253,27253,
+27302,27322,27365,27365,27393,27393,27285,27216,
+26983,26983,26785,26785,26701,26676,26636,26636,
+21417,21041,20388,20414,20569,20924,21842,22596,
+26947,26955,26950,26950,27077,27077,27218,27279,
+27440,27440,27629,27629,27772,27829,27965,27965,
+28127,28127,28238,28276,28358,28358,28455,28455,
+28532,28552,28576,28576,28544,28544,28527,28522,
+28515,28515,28490,28490,28460,28440,28377,28377,
+28248,28248,28257,28273,28349,28349,28402,28402,
+28416,28424,28458,28458,28528,28528,28584,28605,
+28655,28655,28717,28717,28775,28795,28835,28835,
+28849,28849,28826,28810,28757,28757,28747,28747,
+28791,28794,28765,28765,28618,28618,28645,28658,
+28689,28689,28699,28699,28717,28728,28763,28763,
+28826,28826,28831,28822,28778,28778,28740,28740,
+28718,28720,28750,28750,28846,28846,28875,28876,
+28854,28854,28865,28865,28905,28924,28982,28982,
+29063,29063,29105,29117,29137,29137,29165,29165,
+29194,29216,29296,29296,29454,29454,29586,29635,
+29752,29752,29918,29918,30074,30133,30276,30276,
+30417,30417,30451,28337,27518,26575,26572,26345,
+25969,25609,25676,25696,25424,25365,25368,24929,
+24427,24257,23076,22829,23175,22506,21976,22112,
+22718,23002,23233,22973,22671,22417,22208,22229,
+22210,22007,22114,22133,22414,22743,22797,23100,
+23069,23261,23766,23894,23926,24300,24405,24346,
+24007,23547,23270,22319,22026,21821,21826,21734,
+20712,21083,20571,20964,20541,19417,20480,19282,
+20053,19310,20058,19359,19912,19592,19504,19520,
+19246,19117,19142,18524,18367,18064,17773,17367,
+17147,16639,16468,16528,15985,16300,16089,16280,
+16314,16279,16430,16598,16828,17143,17242,17326,
+17545,17944,18295,20161,20126,20238,20403,20366,
+20311,19979,19819,19089,18869,18772,18493,17935,
+17906,17847,17553,17428,17437,16711,16787,17093,
+16077,15860,16480,16819,17062,16487,16191,16374,
+17349,16348,17596,16660,16917,17006,17265,19169,
+18231,18530,18801,18666,18856,19270,19134,19253,
+19389,19362,19266,20340,21355,23791,25334,25416,
+25573,25667,25677,25682,27256,27256,27384,27450,
+27649,27649,27936,27936,28163,28251,28465,28465,
+28690,28690,28813,28853,28928,28928,28978,28978,
+28994,29009,29068,29068,29188,29188,29251,29270,
+29306,29306,29387,29387,29486,29534,29674,29674,
+29882,29882,29986,30013,30045,30045,30109,30109,
+30190,30230,30346,30346,30533,30533,30654,30695,
+30778,30778,30936,30936,31107,31164,31280,31280,
+31358,31358,31431,31462,31542,31542,31616,31616,
+31660,31679,31738,31738,31819,31819,31849,31855,
+31852,31852,31849,31849,31852,31850,31839,31839,
+31802,31802,31787,31780,30640,30633,30412,30012,
+29891,30245,30440,30578,31448,31448,31459,31451,
+31400,31400,30026,29724,29913,30714,31013,31058,
+30342,30342,30329,30316,30268,30268,30248,30248,
+30257,30256,30240,30240,30151,30151,30016,29963,
+29826,29826,29506,29299,29212,29036,28863,28863,
+28591,28494,28410,28880,28888,28888,27777,27426,
+26952,26350,26022,25758,25448,25447,25439,25129,
+24857,24605,24103,23921,23470,22808,22791,22702,
+22802,22996,23557,24634,24895,25017,25134,24979,
+24837,24932,24947,24877,24822,24657,24606,24371,
+24246,24119,23734,23526,23383,22950,22808,22559,
+22449,22643,22906,23117,23063,22956,23108,23190,
+23187,22985,22758,22466,22437,22478,22435,22381,
+22471,22485,22470,22457,22428,22031,21797,21601,
+21416,21300,21257,21443,21332,21268,21392,21571,
+21666,21614,21446,21420,21299,21038,20932,21358,
+21529,21659,22439,21867,21529,21948,21740,21145,
+21354,21351,21411,21786,21950,22085,22296,22362,
+22475,22668,22524,22589,22540,22412,22408,23019,
+23084,23176,22948,22992,22801,22235,21838,21563,
+20773,20448,20017,19705,19452,19329,18757,18659,
+18485,18296,18191,17910,17691,17550,17337,16773,
+16572,16428,16436,15959,16028,16234,16548,16446,
+16199,14033,13742,13203,12650,15018,15074,12469,
+12873,11098,11747,12613,13070,13314,13477,12911,
+12536,12155,11096,10855,10470,8705,8534,8619,
+8750,9116,9701,9349,8810,8324,11010,11441,
+11543,11247,10921,10382,9788,9623,9927,10245,
+9628,9211,8167,7182,6546,5996,5242,5517,
+10485,10980,11307,6778,7060,7417,8685,9130,
+9696,11381,12321,12713,12855,12616,12480,11838,
+11348,10684,9325,9261,9530,10306,10391,10315,
+10089,9879,9444,9443,9895,10444,11340,11437,
+11403,11651,11841,12032,12317,12445,12749,13960,
+14411,14083,15282,14797,16895,17765,18010,18230,
+18464,18562,18367,17311,16564,16223,17062,18145,
+19026,20982,21599,22229,23318,23662,23572,24445,
+25388,25561,25660,25643,25636,25498,25683,25692,
+26789,26789,26836,26876,27028,27028,27137,27137,
+27168,27182,27226,27226,27273,27273,27190,27132,
+26927,26927,26760,26760,26706,26690,26668,26668,
+19856,20085,19271,19919,20424,20763,20609,20875,
+26884,26880,26833,26833,26890,26890,27004,27052,
+27183,27183,27349,27349,27476,27531,27678,27678,
+27886,27886,28019,28062,28143,28143,28270,28270,
+28396,28429,28471,28471,28429,28429,28413,28411,
+28416,28416,28405,28405,28388,28377,28334,28334,
+28262,28262,28274,28290,28355,28355,28399,28399,
+28410,28419,28451,28451,28521,28521,28575,28594,
+28638,28638,28702,28702,28767,28790,28833,28833,
+28847,28847,28826,28810,28758,28758,28742,25326,
+26898,28772,28748,28748,28614,28614,28672,28685,
+28698,28698,28703,28703,28731,28748,28799,28799,
+28878,28878,28888,28882,28838,28838,28792,28792,
+28760,28759,28785,28785,28883,28883,28905,28903,
+28869,28869,28859,28859,28880,28892,28936,28936,
+29011,29011,29053,29067,29094,29094,29129,29129,
+29163,29187,29274,29274,29438,29438,29586,29643,
+29786,29786,29966,29966,30122,30179,30311,30311,
+30412,30412,30439,27826,26575,26377,26271,26221,
+26009,25522,25366,24862,25144,24558,24331,23611,
+23784,24021,23753,23516,22836,23275,23660,24117,
+24523,24424,24066,23699,23542,22896,22158,22012,
+22320,22982,22930,22573,22134,22244,22609,22706,
+22847,23074,23749,23992,23972,24239,24130,23839,
+22208,21678,21531,21694,21608,21258,21014,21067,
+20601,19913,20076,17832,18131,19211,17934,19048,
+17707,18498,17912,18338,18220,17482,17713,17442,
+16535,16526,16498,15891,15385,15141,13715,13750,
+13732,13688,13780,13837,14004,14096,14190,14611,
+14802,14942,15207,15371,15644,16500,16804,17013,
+17434,17575,17767,19265,19361,19504,19925,19970,
+19927,20108,19760,19631,18973,18722,18543,17847,
+17769,17664,17368,17378,17112,16987,15831,15899,
+16718,16074,16567,16555,16993,17153,17315,16640,
+17498,17674,16387,17763,16647,16735,16662,17069,
+17541,17995,18599,18733,18357,19247,18518,18708,
+19418,19801,23231,23886,24069,24334,25576,25593,
+25626,25662,25683,25691,27370,27370,27505,27568,
+27754,27754,28015,28015,28217,28294,28477,28477,
+28667,28667,28763,28793,28846,28846,28882,28882,
+28895,28909,28966,28966,29081,29081,29150,29174,
+29227,29227,29319,29319,29420,29468,29614,29614,
+29827,29827,29935,29965,30002,30002,30069,30069,
+30148,30187,30304,30304,30491,30491,30610,30650,
+30729,30729,30882,30882,31048,31104,31226,31226,
+31321,31321,31397,31427,31503,31503,31576,31576,
+31621,31641,31700,31700,31779,31779,31805,31809,
+31801,31801,31796,31796,31799,31799,31794,31794,
+31774,31774,31763,31757,31740,31740,31631,30542,
+30469,30347,30345,30533,31404,31404,30841,30544,
+31352,30319,30059,30127,30229,30435,30395,30395,
+30365,30365,30338,30323,30279,30279,30259,30259,
+30265,30265,30258,30258,30191,30191,30054,29995,
+29833,29833,29486,29357,29077,28982,29127,28845,
+28794,28794,28848,28861,28870,28870,28829,28829,
+28765,28746,28711,28711,28634,28634,28590,28581,
+25407,25053,24371,23977,23785,23300,23325,23555,
+24468,24630,24927,25009,24482,24206,23782,23570,
+23456,24316,24550,24436,24049,23993,24082,24007,
+23793,23501,23119,22924,22756,22383,22359,22341,
+22361,22482,22746,22519,22565,22499,22698,22866,
+22928,22724,22612,22459,22401,22375,22409,22279,
+22322,22180,22188,22115,22015,21821,21899,21734,
+21666,21688,21625,21560,21508,21538,21430,21340,
+21336,21188,21113,21219,21226,21172,21228,21703,
+22008,22439,22688,22194,21777,21181,20999,20675,
+20473,20573,20756,21136,21283,21412,21633,21739,
+21917,22227,22379,22403,22445,22478,22498,22452,
+22352,22282,21964,21687,21308,20674,20401,20013,
+19803,19768,19513,19086,18891,18713,18440,18220,
+18056,17669,18330,18137,16962,16823,16643,15434,
+15839,15496,14116,13860,13942,14750,14857,14769,
+13675,14796,14502,12442,12640,14860,13438,12925,
+12215,11462,11340,12662,12880,12990,12889,12415,
+12132,11682,10089,9595,9205,9707,9987,9776,
+9191,9446,8598,8636,8112,9809,10264,10129,
+9950,9784,9127,8746,7563,7441,7654,7582,
+7825,8432,9132,8742,7929,7685,7748,6774,
+5976,6613,10807,7640,6308,6646,9555,9980,
+9681,10296,11402,11971,12315,12527,12573,12058,
+11112,9980,8492,7954,7653,8255,8972,9591,
+10026,9852,9325,8721,8713,8935,9606,10112,
+10474,10448,10087,10174,11241,11994,12740,13394,
+14856,15232,16371,16749,16420,15831,15647,15233,
+14983,15011,15126,15564,15833,16176,18630,19334,
+20037,21101,21363,20503,21851,22307,23373,24174,
+24674,24902,25405,25489,25549,25591,25681,25682,
+26823,26823,26851,26882,27013,27013,27107,27107,
+27132,27143,27181,27181,27224,27224,27156,27107,
+26931,26931,26782,26782,26731,26716,26697,26697,
+18901,19634,18921,17141,18344,19802,17631,13747,
+13735,15870,18114,19973,26118,26120,26125,26969,
+27082,27082,27238,27238,27366,27423,27574,27574,
+27794,27794,27926,27967,28041,28041,28170,28170,
+28308,28346,28401,28401,28372,28372,28364,28364,
+28374,28374,28370,28370,28363,28355,28326,28326,
+28339,28339,28363,28374,28404,28404,28419,28419,
+28417,28422,28446,28446,28513,28513,28554,28567,
+28590,28590,28648,28648,28731,28757,28802,28802,
+28809,28809,28794,28784,28749,28749,28715,28715,
+28692,28685,28676,25686,28603,28603,28751,28770,
+28724,28724,28711,28711,28748,28775,28871,28871,
+29016,29016,29055,29054,29007,29007,28941,28941,
+28883,28876,28892,28892,29001,29001,29017,29011,
+28961,28961,28898,28898,28849,28841,28841,28841,
+28894,28894,28939,28959,29011,29011,29074,29074,
+29132,29166,29274,29274,29446,29446,29628,29705,
+29913,29913,30122,30122,30268,30315,29190,28965,
+28929,30336,28701,26575,26575,26501,26435,26363,
+26174,25499,24894,24778,24966,24840,24188,23806,
+24081,23985,23613,23481,23702,24307,24252,24424,
+24074,23699,23564,22921,23259,22793,22707,22873,
+23087,23183,23109,22904,22459,22382,22358,22338,
+22394,22620,23676,23890,24145,24093,23360,22534,
+21483,21132,20951,20510,20774,20573,20511,20319,
+20359,19819,18666,19082,18627,17338,18364,17206,
+17660,17972,17023,17049,17181,16626,16239,16136,
+15941,15610,15492,15042,14628,14045,12947,12922,
+12840,12909,13436,13559,13856,13942,14077,14390,
+14642,14835,15213,15467,16331,17476,18303,18476,
+18505,18605,18488,18718,19056,19185,19560,19624,
+19537,19813,20050,20117,19221,18985,18681,17871,
+17685,17542,17385,17283,17232,16946,16850,16786,
+16766,16741,16290,16754,16938,17214,17178,17135,
+17640,16337,17375,16519,17873,16903,16705,16805,
+17266,17696,18209,18360,18633,17827,19028,23272,
+22908,22984,24376,25473,25546,25568,25582,25598,
+25632,25670,27511,27511,27741,27741,27869,27916,
+28024,28024,28194,28194,28337,28391,28517,28517,
+28642,28642,28687,28698,28705,28705,28729,28729,
+28773,28793,28842,28842,28896,28896,28966,29000,
+29103,29103,29226,29226,29330,29379,29517,29517,
+29706,29706,29821,29860,29937,29937,30025,30025,
+30101,30139,30254,30254,30432,30432,30545,30583,
+30660,30660,30791,30791,30927,30981,31110,31110,
+31255,31255,31337,31362,31407,31407,31470,31470,
+31524,31547,31602,31602,31672,31672,31683,31681,
+31656,31656,31640,31640,31643,31647,31668,31668,
+31703,31703,31709,31704,31671,31671,31591,31591,
+31435,31383,31283,31283,31297,31297,30624,30102,
+29907,29889,29850,30063,30314,30393,30423,30423,
+30440,30440,30423,30412,30381,30381,30344,30344,
+30313,30308,30315,30315,30320,30320,30181,30108,
+29880,29880,29464,29412,29337,28990,28887,28952,
+28878,28878,28863,28861,28870,28870,28829,28829,
+28756,28723,28638,28638,28532,28532,28480,28466,
+28453,28453,24754,24106,23891,23493,23542,24019,
+24681,24716,24738,24385,23507,23054,22994,23928,
+24039,24630,24516,24353,23855,23739,23765,22919,
+22465,22072,22015,22100,22322,21984,22178,22160,
+22174,22226,22375,22283,22320,22261,22826,22940,
+22877,22717,22618,22512,22351,22519,22393,22412,
+22391,22333,22327,22262,22296,22156,22028,21887,
+21783,21783,21630,21544,21533,21422,21390,21329,
+21214,21132,21118,21214,21280,21288,21364,21598,
+22182,22461,22225,21707,21393,20474,20601,20310,
+20088,20134,20253,20917,20986,21064,21255,21349,
+21466,21708,21784,21844,21986,21961,21860,21370,
+21634,21343,21022,20672,20650,20162,19923,19661,
+19353,18925,18799,18597,18396,18327,18001,17895,
+17770,17402,17264,17076,16628,16463,15319,15683,
+15435,15106,13637,13364,13224,13193,13101,12888,
+12519,13234,12573,14305,12668,12645,12021,11982,
+12216,11869,11366,11475,11781,11937,12155,11790,
+11578,11184,10240,10231,10434,10593,10242,9620,
+9927,9433,8844,8910,9577,10020,10223,10034,
+9627,8973,8328,7720,6397,6403,5980,6559,
+6246,6585,7372,6993,6002,6482,7120,7238,
+5743,6242,8203,8891,7593,6373,7903,8449,
+8785,10369,10981,11376,11390,10283,10825,11841,
+11293,10237,8425,7903,7656,7988,8205,8367,
+8905,9404,9550,9455,9502,9480,9221,9958,
+10483,11301,10974,10931,11723,11977,12460,14050,
+14674,14993,14619,14578,14370,12884,13328,13247,
+13281,13241,13233,13470,13675,13786,15005,16025,
+18241,20613,21422,21474,22066,22260,22837,23409,
+23731,24028,24980,25174,25397,25515,25665,25666,
+25674,25678,27006,27007,27033,27033,27065,27065,
+27075,27079,27087,27087,27096,27096,27075,27058,
+26995,26995,26899,26899,26841,26825,26806,20563,
+15049,17061,18606,15373,18080,18901,19057,18954,
+16306,14874,17084,18874,25462,25491,25512,25568,
+26826,26826,26957,26957,27102,27164,27329,27329,
+27562,27562,27681,27712,27744,27744,27859,27859,
+28018,28069,28163,28163,28205,28205,28233,28243,
+28263,28263,28282,28282,28301,28309,28326,28326,
+28339,28339,28363,28374,28404,28404,28419,28419,
+28417,28422,28446,28446,28513,28513,28554,28567,
+28590,28590,28648,28648,28731,28757,28802,28802,
+28809,28809,28794,28784,28749,28749,28715,28715,
+28692,28685,28676,28676,25699,25730,25674,28770,
+28724,28724,28711,28711,28748,28775,28871,28871,
+29016,29016,29055,29054,29007,29007,28941,28941,
+28883,28876,28892,28892,29001,29001,29017,29011,
+28961,28961,28898,28898,28849,28841,28841,28841,
+28894,28894,28939,28959,29011,29011,29074,29074,
+29132,29166,29274,29274,29446,29446,29628,29705,
+29913,29913,30122,30122,30268,28971,28709,30402,
+28508,28192,27652,26443,26385,26488,26523,26332,
+26053,25604,25378,25380,25083,24790,24243,23747,
+24181,24398,23831,23808,24483,24985,24775,24478,
+24032,23938,23866,23260,23314,22947,22991,22841,
+23331,22996,22881,22872,22615,22287,21996,22086,
+22231,22552,23158,23488,23964,23613,22384,21366,
+20752,20757,20455,20218,20388,19732,19861,19931,
+19481,17886,18646,17528,17373,18393,18161,17667,
+17428,16837,16359,16384,16216,15323,15320,15211,
+15172,14876,14587,14057,13443,12918,12042,12142,
+12281,12879,12940,13116,13424,13520,13691,14127,
+14412,14750,15248,15678,16942,17229,17801,17893,
+17955,18095,18055,18305,18671,18827,19251,19323,
+19305,19569,19866,19980,20052,19891,18912,18100,
+17706,17673,17430,17317,17240,16589,16754,16298,
+16757,16799,16749,16731,16769,17259,17252,17142,
+17224,17659,17743,17761,16867,16895,17991,16756,
+17207,17762,18309,18661,17965,19626,18600,23240,
+23189,23194,24482,25486,25553,25568,25591,25607,
+25624,25670,27511,27511,27741,27741,27869,27916,
+28024,28024,28194,28194,28337,28391,28517,28517,
+28642,28642,28687,28698,28705,28705,28729,28729,
+28773,28793,28842,28842,28896,28896,28966,29000,
+29103,29103,29226,29226,29330,29379,29517,29517,
+29706,29706,29821,29860,29937,29937,30025,30025,
+30101,30139,30254,30254,30432,30432,30545,30583,
+30660,30660,30791,30791,30927,30981,31110,31110,
+31255,31255,31337,31362,31407,31407,31470,31470,
+31524,31547,31602,31602,31672,31672,31683,31681,
+31656,31656,31640,31640,31643,31647,31668,31668,
+31703,31703,31709,31704,31671,31671,31591,31591,
+31435,31383,31283,31283,31297,31297,31312,29907,
+29810,29802,29864,30103,30289,30393,30423,30423,
+30440,30440,30423,30412,30381,30381,30344,30344,
+30313,30308,30315,30315,30320,30320,30181,30108,
+29930,29776,29468,29448,29078,28990,29094,28927,
+28774,28878,28519,28360,28392,28870,28829,28829,
+28756,28723,28638,28638,28532,28532,28480,28466,
+28453,28453,24906,24177,23666,24109,24339,24616,
+24547,24392,24173,23895,23916,24009,23887,24068,
+24086,24418,24236,23888,22335,22629,22445,21771,
+21637,21669,22263,22101,21808,21935,22051,21915,
+21904,21953,21986,22060,22216,22465,22821,22880,
+23010,22836,22756,22670,22632,22659,22625,22654,
+22614,22587,22566,22511,22431,22241,22088,22086,
+21861,21844,21699,21502,21478,21434,21273,21233,
+21243,21248,21342,21320,21371,21579,21639,21676,
+21915,21512,21341,20784,20251,20315,20181,19898,
+19738,19852,20158,20717,20681,20717,20779,20828,
+21022,21164,21191,21181,21359,21366,21308,20825,
+20721,20614,20174,20057,20069,19513,19245,19313,
+18857,18590,18693,18255,17875,17720,17418,17288,
+17204,17037,16864,16683,16229,16035,15917,14406,
+15144,14783,14403,13317,14411,13821,12582,12541,
+12265,14273,14142,12453,13423,13321,13281,12642,
+12578,12234,11768,11488,11131,11229,11238,10981,
+10621,10661,10030,10003,10079,9947,9795,9535,
+9057,8943,8757,9229,9394,9566,9560,9419,
+8852,8387,8183,7347,5983,5906,5705,6429,
+6421,6127,6234,5840,5748,5579,5651,5828,
+5448,5774,7602,12374,8088,7584,9430,10069,
+10199,8356,8296,8344,8520,6999,10044,11102,
+10207,8788,7693,7684,7773,8402,8152,8746,
+9787,9954,9825,10065,10709,11295,11748,11694,
+11609,11602,11448,11390,11590,11674,11936,13276,
+13369,12863,12715,11741,11009,10633,10701,11622,
+12235,12245,12064,11848,11782,11718,12220,13110,
+14641,19113,20712,21375,22086,22045,22416,22798,
+23132,23458,24558,24757,25102,25368,25649,25652,
+25662,25664,27006,27007,27033,27033,27065,27065,
+27075,27079,27087,27087,27096,27096,27075,27058,
+26995,26995,26899,26899,26841,26825,26806,20745,
+14885,15542,18587,18673,18422,18242,16405,18871,
+16737,14632,15439,17854,25398,25457,25479,25542,
+26826,26826,26957,26957,27102,27164,27329,27329,
+27562,27562,27681,27712,27744,27744,27859,27859,
+28018,28069,28163,28163,28205,28205,28233,28243,
+28263,28263,28282,28282,28301,28309,28326,28326,
+28372,28372,28396,28400,28393,28393,28393,28393,
+28403,28409,28428,28428,28462,28462,28476,28479,
+28478,28478,28511,28511,28577,28592,28610,28610,
+28582,28582,28550,28535,28488,28488,28425,28425,
+28365,28358,28381,28381,28341,28341,28580,28596,
+25417,25371,25520,28469,28688,28756,28877,28877,
+29087,29087,29149,29153,29112,29112,29115,29115,
+29038,29021,29015,29015,29114,29114,29123,29114,
+29058,29058,28962,28962,28867,28840,28802,28802,
+28815,28815,28855,28879,28955,28955,29079,29079,
+29212,29268,29416,29416,29582,29582,29746,29817,
+30012,30012,30191,30191,30351,30395,30460,30460,
+26575,26544,26229,25400,25746,26003,26014,25785,
+25593,25178,24969,24684,24396,23962,23778,24212,
+24531,24343,24169,24568,24526,23355,23766,23466,
+23525,23359,23202,23210,23216,23050,22711,22537,
+22879,21898,21794,21873,21626,21440,21240,21710,
+22806,23092,21898,21217,21892,21334,20861,20698,
+20346,19444,19721,19382,19607,19517,19080,18673,
+18287,17011,16424,16596,16414,16663,16114,16156,
+15497,15444,14551,14595,13888,13673,13132,13023,
+12946,12871,12824,12581,10686,10798,11087,11299,
+11888,12246,12306,12580,12870,13038,13200,13887,
+16146,16310,15808,15793,15826,16023,16578,16708,
+17055,17136,17307,17612,17774,17954,17897,18088,
+18254,18694,19418,19566,20527,20640,20136,18475,
+18102,17185,17420,17346,17273,17074,16927,16850,
+16997,16123,16958,16933,17119,17366,17669,17662,
+17590,17475,17681,17749,17590,17526,17729,17811,
+17922,17976,18697,19105,25365,25389,25256,25300,
+25433,25441,25516,25572,27121,27121,27350,27350,
+27542,27622,27830,27830,28036,28036,28130,28157,
+28205,28205,28308,28308,28424,28471,28591,28591,
+28713,28713,28722,28714,28656,28656,28607,28607,
+28605,28615,28665,28665,28760,28760,28849,28889,
+28998,28998,29132,29132,29249,29299,29431,29431,
+29590,29590,29713,29760,29877,29877,29988,29988,
+30066,30104,30216,30216,30384,30384,30491,30527,
+30605,30605,30721,30721,30841,30889,31015,31015,
+31163,31163,31237,31257,31287,31287,31341,31341,
+31398,31420,31466,31466,31509,31509,31504,31496,
+31459,31459,31440,31440,31449,31459,31499,31499,
+31571,31571,31599,31601,31585,31585,31509,31509,
+31401,31359,31253,31253,31201,30246,29808,29587,
+29685,29851,30413,30413,30415,30429,30500,30500,
+30553,30553,30545,30537,30507,30507,30445,30445,
+30377,30362,30357,30357,30382,30382,30265,30205,
+29916,29704,29467,29364,29361,29217,29175,29175,
+28970,28970,27866,26575,26575,27125,27446,27519,
+28736,28702,28577,28577,28491,28491,28443,28429,
+28409,28409,25158,24734,25011,24685,24477,24187,
+23643,23562,23360,23331,23233,23283,23253,23103,
+22817,21818,22239,20342,20216,20441,20247,20654,
+21466,21636,22181,22080,22007,21626,21308,21185,
+21460,21348,21263,22819,23049,23055,22989,23094,
+23093,22976,22831,22747,22538,22471,22452,22490,
+22468,22477,22363,22282,22202,22035,22047,22108,
+21953,21796,21786,21362,21360,21284,21332,21313,
+21246,21190,21250,21294,21295,21176,20903,20377,
+20182,19219,18723,18380,17609,19017,19479,19459,
+19089,19485,19607,20039,20096,20093,20175,20094,
+20131,20074,19946,20064,20064,20261,20193,19958,
+19725,19392,19538,19369,19172,18823,18571,18406,
+17980,17654,17628,17663,17635,17461,16863,16668,
+16452,16464,16414,16167,15798,15672,15514,14932,
+14747,13341,14101,13943,12607,12174,11839,11572,
+12215,13098,11659,11307,11199,11270,10924,10781,
+10613,10435,10186,9970,9500,9587,9808,9184,
+9069,8588,8890,8794,8247,8328,8739,8646,
+8037,7783,7808,8067,8309,8549,8448,8047,
+8125,7521,6291,6454,5753,5441,5175,5499,
+5970,6120,7130,7202,6298,6504,8761,9769,
+5815,4275,4679,7379,7685,6184,8348,9551,
+9965,9015,7210,6972,9579,10416,10465,9457,
+9572,8646,6787,6201,6451,5972,6642,6981,
+8343,8489,8590,8816,9046,9181,8942,8627,
+8274,8663,8796,8924,9413,9966,10554,11552,
+11299,10412,9324,9074,9486,10271,9698,9957,
+10663,10460,10853,10978,10764,10676,10675,10917,
+11525,13884,15466,17061,21051,21346,21232,21300,
+22136,22332,23060,23324,23600,24163,24673,24843,
+25637,25639,25648,25649,25654,25653,25653,25654,
+25659,25658,25660,25659,25667,25667,25668,25664,
+25651,25650,25629,25626,27005,26983,26963,26963,
+19104,17162,16044,17792,17065,16630,15826,15506,
+15363,14512,12275,12659,16617,18199,20085,25511,
+26643,26643,26723,26723,26855,26912,27061,27061,
+27248,27248,27361,27395,27453,27453,27559,27559,
+27683,27728,27829,27829,27936,27936,28012,28040,
+28101,28101,28170,28170,28230,28254,28310,28310,
+28372,28372,28396,28400,28393,28393,28393,28393,
+28403,28409,28428,28428,28462,28462,28476,28479,
+28478,28478,28511,28511,28577,28592,28610,28610,
+28582,28582,28550,28535,28488,28488,28425,28425,
+28365,28358,28381,28381,28341,28341,28580,28596,
+28438,28438,25492,24928,24869,28756,28877,28877,
+29087,29087,29149,29153,29112,29112,29115,29115,
+29038,29021,29015,29015,29114,29114,29123,29114,
+29058,29058,28962,28962,28867,28840,28802,28802,
+28815,28815,28855,28879,28955,28955,29079,29079,
+29212,29268,29416,29416,29582,29582,29746,29817,
+30012,30012,30191,30191,29086,28785,28216,27411,
+26382,26188,25967,25667,25605,25511,25330,25283,
+25234,25011,24726,24468,23821,23838,23861,24316,
+24042,23879,24026,24152,23651,22321,22687,22270,
+22341,22643,22982,23963,23837,23334,23199,23182,
+22837,20910,20382,20663,21020,21034,20776,20354,
+20675,21805,21860,21469,20972,20860,20421,20134,
+20048,19826,19345,19209,19356,19256,18152,17371,
+17168,15820,15913,13997,14779,15420,15275,15271,
+14677,14113,13460,13093,12898,12160,11857,11845,
+12002,12116,12194,12075,10481,10571,10951,11251,
+11807,12080,12104,12312,12893,13654,13651,15453,
+15752,15857,15316,15301,15349,15604,16120,16232,
+16457,16507,16661,17047,17188,17332,17269,17446,
+17662,18225,19026,19190,20174,20206,19842,18132,
+17900,17102,17578,17490,17411,17173,17099,17065,
+17156,17196,17144,16991,17061,17255,17572,17637,
+17561,17504,17491,17434,17543,17485,17195,17269,
+17533,17680,18270,18809,19352,25367,25257,25304,
+25429,25450,25522,25582,27121,27121,27350,27350,
+27542,27622,27830,27830,28036,28036,28130,28157,
+28205,28205,28308,28308,28424,28471,28591,28591,
+28713,28713,28722,28714,28656,28656,28607,28607,
+28605,28615,28665,28665,28760,28760,28849,28889,
+28998,28998,29132,29132,29249,29299,29431,29431,
+29590,29590,29713,29760,29877,29877,29988,29988,
+30066,30104,30216,30216,30384,30384,30491,30527,
+30605,30605,30721,30721,30841,30889,31015,31015,
+31163,31163,31237,31257,31287,31287,31341,31341,
+31398,31420,31466,31466,31509,31509,31504,31496,
+31459,31459,31440,31440,31449,31459,31499,31499,
+31571,31571,31599,31601,31585,31585,31509,31509,
+31401,31359,31253,31253,30336,29788,29359,28866,
+28922,29149,29861,30413,30415,30429,30500,30500,
+30553,30553,30545,30537,30507,30507,30445,30445,
+30377,30362,30357,30357,30382,30382,30265,30205,
+30023,29876,29485,29434,29402,29217,29175,29175,
+28970,28067,27148,26572,26567,26538,26475,26515,
+26761,28702,28577,28577,28491,28491,28443,28429,
+28409,28409,25423,25270,24982,24375,24155,23918,
+23373,23162,22893,23052,22634,22810,22446,20906,
+20514,20380,20403,20260,20074,20246,20192,20021,
+20166,21860,22055,21818,21758,21486,21247,21443,
+21216,21459,22488,23104,23177,23254,23235,23132,
+23071,22810,22686,22560,22338,22254,22275,22174,
+22115,22041,21960,21855,21734,21741,21718,21728,
+21857,21723,21702,21555,21424,21574,21478,21403,
+21340,21128,20999,20739,20530,20409,20240,18412,
+18042,17959,18006,17512,17705,18325,18682,18649,
+19341,19440,19517,19713,19800,19960,19951,19902,
+19800,19765,19799,19798,19916,19871,19789,19447,
+19207,19043,19043,18783,18924,17832,17694,17842,
+17523,17203,16995,17051,16973,17053,16677,16166,
+16116,16209,16065,15740,15360,15423,15215,14706,
+14508,14394,12791,12749,13595,12903,11757,11451,
+12738,11876,11427,10918,11329,11320,10910,10756,
+10814,10220,9958,9621,9228,8924,9126,8897,
+8770,8629,8523,8330,7918,8269,8552,8439,
+7877,7943,8072,8308,8525,8674,8044,7787,
+7554,7507,6691,6732,6085,6096,5833,5081,
+5680,6715,9408,9676,9459,8815,6439,6330,
+5037,4361,4861,6481,7793,6183,7693,8016,
+8097,7361,7074,6573,8369,9135,9540,8133,
+7566,7314,5826,5475,5295,4644,4761,4366,
+6801,7901,8094,8466,8328,8061,7396,7468,
+7808,8414,8525,8482,8820,8870,9143,10484,
+10203,9369,8594,8368,9051,9799,9008,9895,
+10206,10443,10952,11019,10947,10802,10922,11096,
+11215,12154,13520,15145,18490,20907,21104,21196,
+21882,21912,22555,22809,23077,23576,24185,24369,
+25610,25618,25634,25641,25648,25648,25647,25646,
+25653,25655,25656,25655,25665,25665,25668,25664,
+25648,25647,25622,25619,27005,26983,26963,26963,
+19679,18416,17072,16683,16756,16131,13983,12769,
+10678,11869,12507,12632,17175,18814,25395,25501,
+26643,26643,26723,26723,26855,26912,27061,27061,
+27248,27248,27361,27395,27453,27453,27559,27559,
+27683,27728,27829,27829,27936,27936,28012,28040,
+28101,28101,28170,28170,28230,28254,28310,28310,
+28341,28341,28350,28346,28312,28312,28316,28316,
+28354,28365,28378,28378,28361,28361,28346,28341,
+28332,28332,28343,28343,28373,28374,28348,28348,
+28260,28260,28141,28081,27894,27894,27942,27942,
+27931,27944,28014,28014,28172,28172,28264,28242,
+28035,28035,28049,25109,24800,24693,25415,28904,
+29094,29094,29152,27734,27487,29289,29320,29320,
+29228,29205,29181,29181,29261,29261,29263,29255,
+29206,29206,29103,29103,28994,28958,28887,28887,
+28848,28848,28871,28892,28974,28974,29156,29156,
+29368,29447,29625,29625,29770,29770,29880,29915,
+29980,29980,30063,30063,30189,28166,26908,25718,
+25420,25560,25593,25348,25049,24847,24735,24676,
+24653,24531,24383,24153,23496,23415,23528,23707,
+23542,23321,23809,23435,22938,23202,23859,22496,
+22030,22586,22736,24120,23576,22114,21692,21765,
+21289,19716,19238,18967,20005,20512,20103,18735,
+18867,19656,19953,20572,20563,20745,20400,20434,
+20006,19608,19515,19221,19055,18885,17492,16501,
+16837,15675,14844,16884,13039,13101,13572,13916,
+13668,12950,12093,11626,11299,10848,10739,10897,
+11384,11434,11480,10147,10244,10399,11016,13619,
+13310,12180,12755,13447,14589,14745,14388,14412,
+15211,15331,15355,15411,15516,15642,15746,15790,
+15924,16004,16117,16451,16685,16833,17171,17406,
+17915,18318,18429,18604,19515,19673,19471,17426,
+16932,17504,17553,17506,17372,17165,17148,17118,
+17128,17115,17038,17114,17191,16154,17423,17475,
+17468,17436,17424,17459,17304,17170,17006,16803,
+16951,17233,18133,18632,19178,25252,25299,25343,
+25480,25490,25635,27044,27382,27382,27655,27655,
+27782,27832,27955,27955,28069,28069,28129,28152,
+28212,28212,28322,28322,28450,28505,28653,28653,
+28806,28806,28788,28757,28627,28627,28466,28466,
+28358,28348,28412,28412,28650,28650,28781,28824,
+28903,28903,29033,29033,29171,29224,29355,29355,
+29489,29489,29613,29666,29800,29800,29926,29926,
+30008,30047,30158,30158,30317,30317,30424,30463,
+30549,30549,30669,30669,30790,30837,30948,30948,
+31051,31051,31110,31129,31163,31163,31224,31224,
+31290,31310,31350,31350,31371,31371,31355,31345,
+31313,31313,31300,31300,31313,31325,31366,31366,
+31431,31431,31466,31475,31481,31481,31435,31435,
+31351,31314,31212,31212,30207,29799,29417,29105,
+29126,29153,29648,30093,30485,30498,30561,30561,
+30635,30635,30635,30629,30595,30595,30522,30522,
+30436,30410,30366,30366,30344,30344,30260,30204,
+30005,30005,29822,29567,29555,29543,29375,29375,
+28323,27658,26575,26545,26501,26424,26168,26243,
+26517,28574,28453,28453,26768,28390,28352,28340,
+28317,28317,28166,25429,24969,24427,24374,27979,
+23451,22944,22605,22633,22555,22408,22429,21034,
+20234,20299,20254,20019,19478,19615,19662,19921,
+20548,21181,21754,21777,21584,21568,21696,21997,
+22315,22853,23150,23355,23470,23400,23143,23004,
+22886,22662,22545,22401,22142,22099,22041,21923,
+21837,21765,21664,21538,21530,21593,21470,21325,
+21739,21713,21779,21751,21708,21612,21564,21436,
+21226,20745,20397,19971,19605,19254,18954,17533,
+17545,17353,17456,17639,18080,17896,18396,18689,
+19059,19213,19516,19665,19636,19718,19810,19796,
+19733,19700,19655,19604,19683,19711,19607,19397,
+19334,19196,18966,18871,18681,17750,17190,17393,
+16782,16646,16544,16692,16602,16515,16256,15915,
+15904,15999,15825,15733,15569,15362,15094,14722,
+13743,14285,13822,13304,11872,12823,11572,12609,
+12776,12322,11296,10639,10651,11105,10337,10263,
+10227,9828,9531,8929,8613,8294,8757,8320,
+8210,8116,8011,8162,7976,8060,7835,7950,
+8117,8315,8470,8591,8309,8183,7601,7520,
+7361,7073,6833,6102,5641,5570,5489,5345,
+6822,8699,9579,9730,9569,5585,6029,6161,
+5145,5206,5415,8863,6373,5669,7108,7617,
+7788,7141,6674,7214,8079,7968,7256,5940,
+6115,6870,5796,4502,4602,4316,4591,4246,
+5514,7046,7131,7474,7316,7165,6876,7018,
+7636,8176,8118,8198,8218,8060,7933,8656,
+9682,8718,8326,7780,9600,9975,9271,9181,
+9836,10600,10515,10835,10535,10547,10776,11174,
+11166,11572,12382,13691,17042,18194,20208,20806,
+20866,20930,21739,21933,22434,22807,23114,23324,
+24127,24288,24362,24556,24733,24732,25616,25616,
+25625,25626,25621,25617,25634,25634,25635,25633,
+25626,25625,25606,25604,25598,25591,25612,25604,
+25570,19467,18119,14222,13445,14415,14893,13791,
+11274,12389,12688,12964,17783,18940,24594,25431,
+25585,25583,26674,26674,26762,26796,26876,26876,
+26962,26962,27087,27138,27269,27269,27368,27368,
+27415,27439,27512,27512,27657,27657,27777,27825,
+27943,27943,28072,28072,28169,28204,28279,28279,
+28306,28306,28312,28305,28266,28266,28267,28267,
+28307,28317,28325,28325,28294,28294,28273,28266,
+28253,28253,28255,28255,28269,28263,28220,28220,
+28107,28107,27954,25612,25426,25440,25469,25500,
+25604,25631,25657,25646,28106,28106,28168,28143,
+27959,27959,27970,27970,28293,24193,24280,28886,
+25499,26323,29184,29232,29382,29382,29404,29404,
+29323,29303,29286,29286,29365,29365,29371,29364,
+29321,29321,29211,29211,29088,29046,28957,28957,
+28897,28897,28915,28935,29021,29021,29216,29216,
+29447,29529,29709,29709,29824,29824,29917,29230,
+28860,28634,28967,29039,30101,25723,24578,24698,
+24299,24519,24483,24354,23964,23809,23905,23919,
+23487,22980,22577,22563,22376,23267,23094,22951,
+23688,24016,22597,25033,24403,23577,23347,23314,
+23730,24016,24192,23425,22193,21054,20636,20797,
+20957,20696,19194,19240,21233,21579,21828,20020,
+18748,18591,19823,20246,20619,20107,19996,18926,
+18661,18369,18180,18247,18021,17912,16469,16803,
+16040,14505,14222,14541,11348,10078,9675,9124,
+9077,9879,9808,8955,8694,9050,9232,9457,
+9208,9319,9522,9711,9828,10031,12705,12957,
+12702,13172,14024,14172,13736,13754,13357,13668,
+14396,14514,14555,14624,14772,14908,14890,14930,
+15024,15059,15153,15200,15401,15527,15966,16117,
+16345,16579,16750,16933,17741,18177,15483,15346,
+15511,15749,16335,16507,16650,17030,17132,17113,
+16891,16873,16978,17143,17269,16011,17231,17386,
+16120,17444,17339,17216,16927,16755,15978,16008,
+16317,16876,18097,18579,23135,23756,23932,24048,
+25482,25495,26965,27091,27457,27457,27739,27739,
+27847,27889,27990,27990,28076,28076,28121,28141,
+28197,28197,28305,28305,28435,28492,28641,28641,
+28789,28789,28751,28710,28546,28546,28355,28355,
+28228,28218,28297,28297,28589,28589,28742,28789,
+28867,28867,28996,28996,29134,29187,29316,29316,
+29445,29445,29571,29624,29763,29763,29894,29894,
+29978,30017,30130,30130,30290,30290,30398,30437,
+30525,30525,30644,30644,30764,30809,30915,30915,
+31005,31005,31059,31078,31115,31115,31178,31178,
+31247,31267,31306,31306,31319,31319,31301,31292,
+31261,31261,31252,31252,31266,31277,31318,31318,
+31381,31381,31416,31425,31435,31435,31399,31399,
+31326,31292,31195,31195,31110,30056,29702,29811,
+30662,30662,30534,30534,30522,30531,30582,30582,
+30652,30652,30653,30647,30617,30617,30545,30545,
+30459,30431,30379,30379,30333,30333,30247,30189,
+29987,29987,29858,29858,29708,29639,29446,29446,
+26575,26573,26549,26396,26312,26192,25986,26055,
+26251,28529,28415,28415,28344,28344,28311,28300,
+28281,28281,28140,28140,28040,28008,27953,27953,
+28040,22803,22360,22161,22094,21943,21213,20609,
+20530,20557,20410,20526,20702,20524,19986,20149,
+20796,21450,21674,21760,21876,22622,22928,23105,
+23372,23380,23399,23278,23199,23094,22707,22610,
+22614,22350,22167,21911,21401,21187,20980,20565,
+20218,19827,19189,19241,19364,20038,20381,20319,
+20592,21151,21630,21837,21728,21588,21156,20680,
+20400,19475,18616,17344,17024,17054,17081,18035,
+18352,18613,18827,19011,19126,18924,18757,18741,
+18841,19020,19189,19615,19624,19737,19793,19574,
+19273,18802,18600,18590,18493,18135,18348,18851,
+18836,18366,18275,18094,18096,17868,17476,17123,
+16902,16067,15997,16075,15954,15743,15523,15398,
+15570,15708,15637,15427,15145,14974,14801,14490,
+13936,14090,13315,13082,12008,12265,11795,10696,
+10771,10750,11473,11124,10114,10012,9660,9233,
+9112,8573,8187,8089,8162,8072,8158,7606,
+7694,8070,8407,8581,8614,8549,8357,8237,
+8119,8011,8000,7706,7628,7422,7320,7171,
+7032,6868,6826,5365,5344,5374,5316,4950,
+7494,8878,9452,9514,9426,8862,4943,5162,
+5586,5804,6410,9302,6863,8819,7803,7985,
+8061,7791,7841,8084,7521,6603,6056,6947,
+6851,6873,4411,4115,4206,4257,4976,5369,
+3802,3774,3696,3658,5950,6500,6619,6603,
+6504,7601,7262,6287,6112,6295,6170,5774,
+8196,8765,7796,8069,8485,8491,8424,8345,
+9079,8958,9205,9947,9963,10021,10434,10977,
+11404,12522,13328,14095,15249,14992,16294,17451,
+17948,19807,20936,21055,21555,21752,21824,21857,
+22267,22515,22693,23255,23703,23850,25568,25568,
+25568,25568,25558,25557,25574,25574,25588,25579,
+25594,25593,25564,25565,25546,25566,25590,25587,
+25586,25578,25567,19010,17563,14009,13486,14173,
+13431,10947,11444,13281,23061,19326,23856,24088,
+25509,25517,26671,26671,26746,26773,26832,26832,
+26890,26890,27010,27061,27195,27195,27288,27288,
+27325,27346,27419,27419,27568,27568,27697,27749,
+27881,27881,28025,28025,28131,28168,28247,28247,
+28173,28173,28169,28159,28114,28114,28103,28103,
+28127,28130,28118,28118,28064,28064,28038,28028,
+28007,28007,27979,27979,27957,27935,27847,27847,
+27662,27662,25651,25189,23820,23838,23668,23922,
+24973,25244,25475,25447,27940,27940,27986,27990,
+25633,25648,27970,27970,28150,24233,24026,24091,
+23187,22355,22800,29434,29665,29665,28381,29622,
+29610,29613,29640,29640,29729,29729,29759,29761,
+29742,29742,29604,29604,29423,29358,29215,29215,
+29101,29101,29109,29130,29229,29229,29441,29441,
+29681,29762,29924,29924,29910,29910,29976,29979,
+28920,29924,28150,27696,26575,25248,24195,22920,
+23487,23904,23701,24026,23453,23321,23382,23062,
+23513,22814,22863,22674,23220,22841,22155,23278,
+23696,22650,21036,24145,23513,21999,21551,21671,
+22532,23001,23252,22224,20805,19181,19033,18469,
+18821,17093,17952,18228,19145,20103,21182,21493,
+20777,19780,19230,19084,19531,19382,19309,18890,
+19320,19008,18804,18279,18030,17017,13788,14747,
+15474,15389,13626,11530,9379,9090,8839,8467,
+8334,8320,8246,8179,8221,8835,9129,9235,
+9259,9301,9341,9855,9937,10125,11849,12055,
+12666,13009,13459,13548,13719,13797,13794,14023,
+14075,14153,14286,14332,14409,14553,14609,14630,
+14553,14576,14615,14670,14804,14935,15234,15314,
+15469,15853,16221,16340,15117,14738,14001,14105,
+14314,14687,15255,15419,14582,16295,16592,16760,
+16735,16279,16778,15572,17036,17006,15672,16311,
+16693,17807,17673,17558,17115,16722,16079,15679,
+16109,16784,20876,21188,21979,22424,22779,22830,
+25575,25584,27039,27177,27572,27572,27865,27865,
+27950,27979,28043,28043,28080,28080,28086,28092,
+28121,28121,28214,28214,28344,28397,28529,28529,
+28623,28623,28511,28439,28186,28186,27949,27949,
+27830,27833,27967,27967,28390,28390,28614,28678,
+28778,28778,28909,28909,29032,29081,29198,29198,
+29328,29328,29457,29511,29655,29655,29792,29792,
+29883,29926,30049,30049,30219,30219,30335,30376,
+30465,30465,30575,30575,30682,30721,30812,30812,
+30882,30882,30931,30949,30993,30993,31065,31065,
+31137,31160,31196,31196,31196,31196,31177,31169,
+31146,31146,31143,31143,31160,31171,31209,31209,
+31265,31265,31294,31301,31308,31308,31289,31289,
+31247,31224,30863,31055,31051,31051,30110,29934,
+30108,30756,30693,30693,30637,30627,30625,30625,
+30654,30654,30653,30650,30635,30635,30583,30583,
+30514,30489,30432,30432,30309,28807,28352,27288,
+28311,29917,29858,29858,29847,29805,29608,28510,
+26572,26573,26554,26437,26433,26575,26090,26161,
+26265,28425,28341,28341,28216,28216,28198,28193,
+28189,28189,28125,28125,26233,28015,27953,27953,
+25651,22761,22431,21746,21728,21692,21421,21140,
+21438,21389,21174,21150,21163,21190,23066,21132,
+21184,21528,21742,21841,22096,23067,23257,23504,
+23528,23468,23423,23266,24237,24058,22632,22559,
+22414,22094,21878,21594,20982,20446,19045,18201,
+17931,17461,17091,17325,17316,18129,18567,19096,
+20341,20971,21342,21674,21662,21543,21096,20320,
+19490,18196,16786,16689,16634,16670,17212,18371,
+18719,18855,18733,18853,18860,18702,18599,18646,
+18940,19008,19159,19282,19546,19653,19209,19334,
+19293,18723,18037,17275,17161,17260,18208,18792,
+18784,18689,18324,18185,17982,17330,16262,16038,
+15213,15038,15235,15606,15590,15338,14823,14860,
+15082,15524,15352,15142,14760,14575,14331,14210,
+14075,12063,12844,11753,12290,11977,11495,10543,
+10382,10098,9911,10399,9820,9467,9218,8940,
+8923,8121,8050,7913,7927,7919,7665,7132,
+7453,7974,8137,8067,7964,7877,7701,7312,
+7373,7465,7539,7128,6817,6607,6724,6764,
+6983,7147,7099,6877,7125,6734,6488,4631,
+6945,8547,9145,9283,9251,8768,5248,4894,
+5631,9044,6166,9824,10086,10024,9611,8773,
+8715,5918,8269,8590,8451,7618,7082,6496,
+5982,5178,3983,4444,4342,3801,5198,6853,
+5076,4517,4129,3491,4842,7311,6239,6155,
+5980,5465,6669,7211,4456,5228,5763,5169,
+5178,5005,8385,8392,7326,7438,7759,8711,
+8682,9246,9534,9292,9280,9451,10317,10536,
+10960,12356,12994,14083,14923,15645,15561,16543,
+17014,17485,19973,20279,20614,20695,20603,20583,
+20880,21008,21212,21755,22448,22733,25475,25481,
+25484,25479,25472,25468,25500,25500,25495,25503,
+25529,25531,25540,25544,25535,25562,25571,25569,
+25580,25580,25580,25552,25519,25508,13588,13310,
+13413,10108,10674,13815,21959,22514,22633,22567,
+25353,25368,25421,25431,25553,25616,26792,26792,
+26804,26804,25639,25632,27003,27003,27075,27075,
+27137,27167,27251,27251,27395,27395,27525,27580,
+27724,27724,27888,27888,28004,28043,28121,28121,
+28173,28173,28169,28159,28114,28114,28103,28103,
+28127,28130,28118,28118,28064,28064,28038,28028,
+28007,28007,27979,27979,27957,27935,27847,27847,
+27662,27662,25660,25188,23702,23630,23312,23514,
+24817,25127,25403,25359,27940,27940,27986,27990,
+25631,25631,27970,27970,28150,23744,23606,23734,
+23978,23906,23888,25238,26376,29665,29622,29622,
+29610,29613,29640,29640,29729,29729,29759,29761,
+29742,29742,29604,29604,29423,29358,29215,29215,
+29101,29101,29109,29130,29229,29229,29441,29441,
+29681,29762,29924,29924,29910,26575,26575,29979,
+28194,28227,26899,25727,25898,24836,23881,22780,
+23143,24051,24485,24536,24138,23048,23253,23104,
+23187,23045,22781,22190,23016,22714,22648,23589,
+22349,19605,19766,18629,18155,18522,18812,18402,
+19115,19436,19580,16090,15958,15680,16133,16349,
+16934,19693,20164,19756,18511,18424,18634,20167,
+18706,17701,19791,16259,17508,18809,17289,17969,
+18574,18443,18072,17577,17407,17104,11639,11254,
+14300,13242,12990,11924,9179,8491,8312,8024,
+7998,8090,8146,8096,8160,8666,8961,9073,
+9016,9089,9206,9836,9962,10205,11612,11770,
+12305,12563,13013,13131,13303,13392,13411,13567,
+13617,13714,13843,13904,13980,14177,14276,14291,
+14151,14126,14171,14224,14345,14438,14648,14701,
+14868,15223,15614,15682,12877,12811,12865,12982,
+13235,13549,13313,14372,14577,15238,15000,16000,
+16350,16432,15276,16848,16857,15458,17138,18702,
+18999,19055,19204,17859,17227,16582,15702,15404,
+15962,16811,21063,21359,22055,22408,22757,22841,
+25570,25579,27039,27177,27572,27572,27865,27865,
+27950,27979,28043,28043,28080,28080,28086,28092,
+28121,28121,28214,28214,28344,28397,28529,28529,
+28623,28623,28511,28439,28186,28186,27949,27949,
+27830,27833,27967,27967,28390,28390,28614,28678,
+28778,28778,28909,28909,29032,29081,29198,29198,
+29328,29328,29457,29511,29655,29655,29792,29792,
+29883,29926,30049,30049,30219,30219,30335,30376,
+30465,30465,30575,30575,30682,30721,30812,30812,
+30882,30882,30931,30949,30993,30993,31065,31065,
+31137,31160,31196,31196,31196,31196,31177,31169,
+31146,31146,31143,31143,31160,31171,31209,31209,
+31265,31265,31294,31301,31308,31308,31289,31289,
+31247,31224,31150,31150,31051,31051,30948,30898,
+30756,30559,30693,30693,30637,30627,30625,30625,
+30654,30654,30653,30650,30635,30635,30583,30583,
+30514,30489,30432,30432,27091,26575,26475,26477,
+26575,26575,29858,29858,29847,29805,29608,26575,
+26558,26575,26575,26469,26197,26575,26251,26282,
+26310,26564,28341,28341,28216,28216,28198,28193,
+28189,28189,28125,28125,28044,28015,27953,24478,
+23127,22659,22357,21904,21839,21914,25546,25484,
+21791,21577,21326,21370,21423,21084,20952,21126,
+21311,21351,22393,22682,23026,23524,23591,23593,
+23412,23352,23275,23265,24085,23004,22518,22344,
+22165,21851,21631,21341,20611,20062,19364,18257,
+17102,17095,17313,17500,17702,17909,18262,18822,
+20187,20821,21242,21544,21554,21505,21039,20372,
+19438,17299,17222,17456,17607,18293,18722,19268,
+19352,19402,19635,19723,19532,19075,18689,18602,
+19013,19114,19174,19279,19373,19484,18965,18755,
+18534,18372,18019,17678,16255,16441,16785,16613,
+15843,16714,17784,17801,17257,16828,15455,15872,
+14976,14258,14323,14670,14997,14999,14098,14273,
+14868,15101,14965,14996,14591,14418,14141,12030,
+13379,13097,11299,12146,11636,10433,9990,9847,
+9588,9468,10605,9602,8836,8885,8743,8655,
+8579,8357,8138,8146,8027,7802,7845,7679,
+7887,7789,7289,7074,6914,7076,7238,7397,
+7452,7303,7108,5650,5374,6536,6717,6852,
+6995,7387,7442,7871,7348,7453,7095,6170,
+7273,8277,8827,8967,8972,8612,4523,4016,
+4908,8142,9700,9725,9923,9909,9122,8795,
+8383,8812,6452,8169,7986,7447,6519,5270,
+4635,4171,3961,4021,3772,3465,3489,3566,
+3784,3709,3424,3333,3464,4070,5638,6068,
+6078,5387,5340,5151,5613,6028,6066,4904,
+4648,5303,6778,6941,8906,9190,8090,8712,
+8935,8331,8580,9189,9224,9437,9218,9964,
+10477,11282,12220,12694,15021,15312,15596,15903,
+15404,16488,18007,19839,19886,20161,20327,20276,
+20610,20668,20482,20805,21367,21597,25409,25424,
+25433,25434,25422,25418,25436,25423,25410,25432,
+25470,25474,25496,25505,25498,25549,25560,25557,
+25562,25565,25575,25559,25521,25516,17253,13924,
+13248,10659,9502,12173,21494,21865,22336,22466,
+25292,25299,25377,25390,25527,25599,26792,26792,
+26804,26804,25636,25626,27003,27003,27075,27075,
+27137,27167,27251,27251,27395,27395,27525,27580,
+27724,27724,27888,27888,28004,28043,28121,28121,
+27877,27877,27878,27876,27863,27863,27836,27836,
+27787,27765,27709,27709,27658,27658,27611,27587,
+27509,27509,25696,25697,25700,25663,25427,25458,
+25100,24894,24651,24263,23987,24085,23520,23512,
+23742,24260,25118,24967,21942,21556,20938,21342,
+21786,22350,22716,22426,22046,21681,21890,22024,
+23755,22757,22773,22746,29665,29665,29722,29722,
+29805,25577,29923,29923,30029,30029,30091,30158,
+30431,30431,30297,30297,29761,29617,29431,29431,
+29292,29292,29299,29323,29438,29438,29643,29643,
+29860,28428,27877,26578,22720,23935,24002,25710,
+26034,25884,24170,23903,23682,23962,23701,23102,
+23333,23936,24041,23596,23599,23247,22704,22120,
+21732,22066,22409,22002,22388,22326,21369,17158,
+17660,18233,18188,18503,18468,20885,19693,18648,
+17528,17643,17835,18133,17896,17952,20102,20866,
+21192,21104,21290,21217,19052,17674,15633,16607,
+16652,16533,16581,16576,18681,18603,18739,18656,
+16275,15860,15490,15977,15884,15399,9776,9773,
+9674,9299,8785,8315,7836,7753,7725,7683,
+7682,7729,7999,8229,8464,8766,8785,8760,
+8849,9046,10818,11168,10786,10782,10831,10906,
+11892,11812,12029,12097,12606,12676,12786,12988,
+12950,13046,13111,13169,13211,13366,13584,13565,
+13660,13693,13596,13528,13825,13892,13902,13923,
+13072,13032,13195,13324,13304,11650,11201,11120,
+10927,11382,11999,12317,12635,12712,13665,13981,
+14489,14787,15133,15997,16685,17771,17914,17732,
+18626,19083,18984,19091,17878,17195,16310,16545,
+18362,18997,20721,20797,20842,20996,20950,21754,
+25498,25514,25544,25591,27502,27502,27822,27822,
+27948,27987,28057,28057,28093,28093,28050,28028,
+27957,27957,27967,27967,28063,28093,28154,28154,
+28123,28123,27923,25638,25314,25247,25163,25103,
+24871,24820,24992,24987,28028,28028,28291,28374,
+28522,28522,28758,28758,28894,28941,29037,29037,
+29194,29194,29322,29371,29489,29489,29617,29617,
+29718,29767,29911,29911,30118,30118,30247,30289,
+30370,30370,30456,30456,30533,30564,30642,30642,
+30719,30719,30774,30796,30846,30846,30924,30924,
+30998,31019,31055,31055,31049,31049,31035,31030,
+31020,31020,31029,31029,31047,31057,31091,31091,
+31145,31145,31155,31152,31125,31125,31098,31098,
+31080,31069,31033,31033,30969,30969,30933,30924,
+30919,30919,30866,30866,30775,30744,30674,30674,
+30603,30603,30581,30579,30590,30590,30584,30584,
+30575,30560,30496,30496,26053,24389,24049,24725,
+25088,25353,25798,26175,26529,26575,26432,26158,
+26120,26281,26396,26247,26088,26007,26118,26222,
+26280,26305,26290,28181,26575,28046,28051,28055,
+28069,28069,28049,28049,28040,28024,27953,27953,
+23274,23025,22840,22446,22557,22548,22263,21941,
+21839,21447,21486,21496,21577,21624,21575,21747,
+22316,22712,23287,23283,23322,23326,23271,23346,
+22940,22594,22309,22264,22237,22241,22109,22063,
+21890,21321,20834,20507,20194,19841,18890,16819,
+17160,17365,17816,18185,18355,18748,18991,19410,
+20441,20891,21161,21324,21191,21310,21168,20775,
+20080,19508,19083,19096,19143,19294,19542,19761,
+19592,19458,19101,19146,19741,19085,18904,18220,
+17977,18604,18919,18946,18822,18731,18325,18089,
+17417,16964,17368,17550,16542,15854,15427,16875,
+17071,17193,17652,17765,17742,16510,15592,14169,
+14016,13577,13482,13657,14132,13875,14131,14577,
+14545,14382,14078,13707,13573,12008,13311,12745,
+12588,12551,11451,10583,11265,10115,9718,9790,
+9157,8904,8772,8463,8506,8461,8307,8318,
+8006,7516,7858,7892,7640,7388,7132,6530,
+6424,6066,5781,5670,5622,5469,5457,5476,
+5953,5994,5599,4988,4849,5238,6520,7073,
+7458,7717,7780,7845,7964,8025,8039,7566,
+6658,5648,4731,6716,7462,6953,7144,7301,
+8209,8607,8792,8921,9138,9022,9086,7954,
+9047,9111,9096,7166,6412,6325,6685,5337,
+5132,3912,4547,5715,6843,5548,3346,3233,
+3234,3172,3081,6839,7188,7352,6455,5711,
+5807,6082,6654,5733,5500,5090,4686,4518,
+4736,5174,5547,5462,6257,6847,7010,8051,
+8330,7730,8705,8715,8837,8103,8205,9224,
+9443,10243,10818,11332,12344,12669,12327,12731,
+14047,14501,13549,13931,14284,15894,16553,16510,
+19690,19552,19561,15881,15718,20936,15474,15432,
+22877,23213,23089,23163,25260,25237,25223,14726,
+14313,14085,14567,15016,16138,19354,25408,25419,
+25463,25461,25485,25480,25463,25452,23817,23716,
+23449,13888,9727,8645,13239,14921,16238,25032,
+21147,21064,20302,20334,21409,22341,23340,23715,
+24360,24461,24774,24912,26880,26880,26809,26809,
+26887,26924,27029,27029,27140,27140,27246,27295,
+27435,27435,27614,27614,27730,27767,27838,27838,
+27877,27877,27878,27876,27863,27863,27836,27836,
+27787,27765,27709,27709,27658,27658,27611,27587,
+27509,27509,25688,25690,25691,25655,25596,25552,
+25191,24984,24713,24450,24286,24202,23663,23653,
+23701,24320,25101,24949,21628,21098,20958,20994,
+21141,21289,22288,21979,21571,20875,21432,21580,
+22165,22556,21967,17087,18763,22131,29722,29722,
+29805,23188,20693,24081,30029,30029,30091,30158,
+30431,30431,30297,30297,29761,29617,29431,29431,
+29292,29292,29299,29323,29438,29438,26575,26575,
+29860,26462,25421,24559,22969,22097,23966,24626,
+24618,24818,23505,23007,23358,23238,24279,24148,
+23806,23884,23394,22261,21942,20560,18798,18910,
+19015,19757,20153,20754,21002,21089,19381,15967,
+16004,16797,19947,20534,21042,20409,19474,18713,
+18537,18748,18827,18487,18587,18538,18863,19741,
+20533,21278,21102,20102,17676,17073,16166,16582,
+16400,16694,16599,16343,16106,16542,16567,16509,
+15064,15065,15750,15461,15224,14781,8928,9084,
+9148,8811,8581,8210,7636,7548,7574,7619,
+7574,7534,7770,8042,8291,8517,8501,8471,
+8594,8782,9666,10751,10372,10396,10460,10511,
+11452,11359,11478,11522,11986,12048,12172,12465,
+12384,12456,12446,12517,12598,12725,12892,12917,
+13024,13058,12965,12999,13286,13525,13499,13579,
+12637,12675,12722,12789,13466,12514,10461,10161,
+10109,10304,11169,11285,11571,12209,12562,12947,
+13792,14164,14568,15452,16325,17504,17601,17677,
+18699,18103,18749,18936,17892,17474,17074,18956,
+18834,19224,20574,20600,20483,20910,21152,21443,
+25489,25507,25539,25594,27502,27502,27822,27822,
+27948,27987,28057,28057,28093,28093,28050,28028,
+27957,27957,27967,27967,28063,28093,28154,28154,
+28123,28123,27923,25618,25218,25188,24913,24903,
+24582,24757,25048,25023,28028,28028,28291,28374,
+28522,28522,28758,28758,28894,28941,29037,29037,
+29194,29194,29322,29371,29489,29489,29617,29617,
+29718,29767,29911,29911,30118,30118,30247,30289,
+30370,30370,30456,30456,30533,30564,30642,30642,
+30719,30719,30774,30796,30846,30846,30924,30924,
+30998,31019,31055,31055,31049,31049,31035,31030,
+31020,31020,31029,31029,31047,31057,31091,31091,
+31145,31145,31155,31152,31125,31125,31098,31098,
+31080,31069,31033,31033,30969,30969,30933,30924,
+30919,30919,30866,30866,30775,30744,30674,30674,
+30603,30603,30581,30579,30590,30590,30584,30584,
+30575,30560,30496,30496,25318,23574,22205,23721,
+24029,24360,24881,25162,25434,25816,25844,25837,
+25932,26020,26070,25964,25839,25779,25955,26115,
+26191,26299,26243,26136,26416,26575,28051,28055,
+28069,28069,28049,28049,28040,28024,27953,27953,
+25596,25585,25582,25564,25555,25548,25541,25528,
+25501,22008,21430,21581,21549,21611,21515,22448,
+23057,23051,22769,22904,23225,23124,23047,22976,
+22548,22597,22646,22354,22378,22298,22031,21893,
+21691,21026,20636,20322,19347,18328,16888,17168,
+17319,17440,17897,18051,18339,18991,19081,19431,
+20438,20741,20903,21133,20999,21163,21211,20996,
+20554,19880,19701,19274,19570,19868,20105,20232,
+20288,20039,19336,18634,19639,18908,18681,17842,
+18224,18436,18677,18665,18503,18456,18012,17638,
+16691,15315,15859,16718,16872,16152,15141,13999,
+14049,14314,17523,17643,17501,17101,16543,15535,
+13705,13141,12904,13592,14211,14160,14243,14358,
+14271,14130,13955,13860,13453,13265,12865,11290,
+12519,11161,11535,11127,10182,10343,10688,9615,
+9612,9462,9028,8521,8322,8132,8041,8029,
+8083,7935,7807,7705,7376,7068,6655,6359,
+6279,5742,5118,4797,5477,8629,8647,8636,
+8542,8479,8412,8214,8094,7836,5795,6405,
+7269,7646,7684,7836,7816,7899,7916,7633,
+6923,6705,5773,5222,5004,6174,6564,6803,
+7751,8361,8272,8820,7281,8633,8868,8999,
+8931,8422,8318,8300,6379,7169,7692,6779,
+6853,7008,7704,7634,7520,5567,3285,3648,
+3847,2985,6491,7077,7667,8009,7668,6466,
+6151,5734,6090,6568,5682,5423,5073,4641,
+4634,4825,4722,4904,4964,6753,6758,6558,
+7414,8486,8272,8331,7951,8608,7731,8049,
+8890,9969,10303,10924,11403,11507,11779,12816,
+13036,11970,13001,13465,14056,15023,15412,15913,
+15667,15518,15518,14898,14566,14258,13660,13570,
+14115,14649,15337,22415,15274,15104,14486,13556,
+13452,12608,12549,12930,13686,23332,25356,25382,
+25438,25431,25461,25463,25447,25440,23773,23766,
+23668,23051,15223,11609,11636,13913,15268,24924,
+20630,20457,19776,19846,20894,21811,22751,23110,
+23919,24109,24571,24795,26880,26880,26809,26809,
+26887,26924,27029,27029,27140,27140,27246,27295,
+27435,27435,27614,27614,27730,27767,27838,27838,
+27591,27591,27605,27607,27602,27602,27572,27572,
+27522,27501,27442,27442,27367,27367,25651,25431,
+25075,25152,25275,25355,25316,25331,25365,25372,
+25076,24880,24151,23815,23744,23947,23990,23641,
+23655,23483,23161,24679,21359,20840,20871,20852,
+20914,20857,20562,20887,20899,19687,20787,21233,
+22098,22421,21482,18886,16399,17879,29621,29621,
+29702,24375,24269,22418,20136,21049,25708,30351,
+30701,30701,30592,30592,30059,29862,29407,29407,
+28147,27956,27731,26575,26457,26014,24977,24614,
+24250,23551,23313,23334,22802,21981,22258,23655,
+23466,23398,23144,22621,22445,21432,22668,23874,
+23425,23135,21987,19557,17270,16818,18253,18408,
+17997,17607,18077,18992,20202,20435,19218,17652,
+17340,16355,17898,18562,19032,19353,18777,18541,
+18495,18896,19287,19245,18899,18677,18019,17823,
+17764,17843,17695,17948,16647,16464,16215,16177,
+16321,16859,16726,16699,16674,16293,16058,15890,
+15467,15499,15340,14499,13325,11861,9301,9324,
+8502,8174,7976,9006,7976,7212,7279,7490,
+7491,7497,7782,8020,8218,8346,8316,8304,
+8474,8647,9455,9973,10034,10077,10146,10174,
+10198,10255,10291,10330,10444,10548,11726,12126,
+12153,12222,12184,12271,12386,12442,12428,12410,
+12531,12570,12578,12670,12864,12938,13094,12977,
+11954,11900,12680,12649,12652,10650,9996,9242,
+9542,9793,9924,10101,10292,11023,11447,11928,
+12805,13274,13690,14767,15838,17108,17133,15946,
+16673,18157,18954,19198,19341,19282,17644,19454,
+19946,20118,20497,20527,21665,22191,23691,23809,
+25483,25500,25559,25601,25638,25645,27703,27703,
+27875,27922,27986,27986,27976,27976,27901,27865,
+27762,27762,27719,27719,27766,27808,27972,27972,
+27904,27904,27685,25625,25014,24930,22143,22710,
+22839,24798,25288,25329,25646,25643,27953,25680,
+25571,25603,28744,28744,28896,28940,29006,29006,
+29154,29154,29252,29285,29351,29351,29465,29465,
+29590,29646,29801,29801,30008,30008,30140,30184,
+30271,30271,30355,30355,30422,30449,30523,30523,
+30601,30601,30658,30680,30736,30736,30807,30807,
+30871,30888,30915,30915,30897,30897,30884,30882,
+30881,30881,30905,30905,30936,30950,30985,30985,
+31032,31032,31025,31012,30954,30954,30904,30904,
+30888,30880,30850,30850,30804,30804,30806,30815,
+30853,30853,30840,30840,30781,30757,30697,30697,
+30605,30605,30584,30585,30609,30609,30606,30606,
+30604,30591,30525,30525,25237,23119,22046,22820,
+23174,23533,24280,24611,24963,25382,25477,25549,
+25597,25587,25562,25560,25583,25595,25768,25913,
+26049,26074,26102,26003,26442,27914,27927,27930,
+27928,27928,27904,27904,27941,25205,24731,24331,
+24113,25643,25620,25605,25596,25583,25558,25552,
+25541,25545,25589,25584,21743,21664,23743,23499,
+23724,23787,22943,23095,23234,22946,22739,22790,
+22545,22505,22654,23631,22332,22256,21966,21784,
+21501,20847,20487,20151,18176,16735,16885,17408,
+17351,17189,17265,17281,17562,18187,18774,19550,
+20260,20525,20745,20900,20961,21005,21148,21076,
+20951,20341,20257,20272,20337,20419,20483,20499,
+20482,20451,20232,19657,19583,18750,18444,16249,
+17591,18025,18429,18354,18219,18082,17293,15903,
+13836,13500,13571,15557,16470,16276,15879,13781,
+13596,14166,15879,16782,17316,16792,16260,14943,
+13592,12846,12656,13113,13528,13782,13331,13505,
+13728,13673,13587,13594,13176,13042,11444,12189,
+12069,12009,11024,9958,10307,9710,9368,9165,
+8808,9020,8371,8217,8064,7923,8047,7920,
+7757,7146,7119,6912,6493,6215,6048,5571,
+5463,5259,6415,8211,8602,8642,8608,8559,
+8465,8420,8384,8228,8126,8054,5828,3794,
+5707,4360,6840,7590,7521,7646,7706,7238,
+6005,5031,5823,6291,6427,4388,2924,2960,
+4345,7100,6919,8025,8581,8227,8669,8502,
+8571,8133,7758,7961,7724,6674,6085,5559,
+6147,6848,7576,7439,7360,7149,7220,7177,
+4904,3037,6680,7265,7817,8085,7980,7741,
+7590,6217,6394,6653,5632,5457,5589,6004,
+5894,5725,5371,5348,5449,6042,6241,6500,
+7174,7433,7603,8373,8189,8237,7991,8073,
+8320,9529,9579,9629,10980,11788,11766,12299,
+11963,12280,12521,13362,13573,15346,15183,14163,
+13648,13761,13965,14461,14371,14099,13791,13822,
+13991,13712,13363,12967,12607,12633,12635,12582,
+12454,11942,11862,12644,13311,22725,23049,23450,
+23728,23731,23881,23950,24018,23971,23447,23410,
+23320,23201,22569,22346,13132,13898,14847,14327,
+14346,13903,19510,19564,20177,20839,22051,22393,
+23457,23719,24137,24261,17989,25502,26701,26701,
+26728,26746,26810,26810,26903,26903,27001,27047,
+27178,27178,27354,27354,27460,27492,27551,27551,
+27473,27473,27495,27500,27500,27500,27472,27472,
+27426,27407,27351,27351,25559,25577,25166,24977,
+24315,24308,24385,24469,24226,24434,24561,24634,
+24470,24323,24316,24227,24106,24068,23636,23739,
+24465,22812,22370,21847,20836,20581,20735,20840,
+20713,20496,20299,20252,20203,19568,16277,19009,
+20616,21142,20750,19073,18645,20278,20638,22766,
+23015,29624,24535,22097,22532,19198,16682,30322,
+30698,30698,30598,23530,24415,23361,23469,23046,
+23809,23765,23541,21902,21685,21266,20786,20379,
+20186,19841,20960,17666,22400,23405,23262,22612,
+21204,21034,21613,23030,24065,23926,23429,23576,
+24084,23861,23527,20706,17076,17309,21811,21829,
+21497,19757,18677,19213,20569,20980,20879,19412,
+18553,17751,17453,17794,18262,18898,17471,17905,
+17809,17066,16452,16563,16705,16829,16879,16738,
+17807,17504,17606,17490,16846,16004,15910,16291,
+16261,16354,16496,16336,16202,15477,14657,13862,
+13426,13056,12222,10619,10020,8975,8433,8080,
+7704,7355,7146,7001,6837,6838,6937,7169,
+7258,7360,7658,7810,7925,7976,7989,8051,
+8338,8527,9047,9585,9619,9634,9727,9806,
+9881,9951,9960,9979,10423,10522,11473,11725,
+11750,11813,11684,11667,11626,11502,11538,11589,
+11791,11818,11844,11959,12105,12199,12299,12351,
+11381,11106,11017,10910,10102,9209,8739,8491,
+8463,8439,8440,8494,8587,8884,9141,9161,
+9735,10339,10478,13667,14213,15321,16568,16580,
+16868,17645,18204,18487,18567,18666,18695,19254,
+19675,19744,19952,20243,21654,22427,25326,25341,
+25468,25483,25550,25588,25628,25633,27651,27651,
+27837,27885,27944,27944,27907,27907,27822,27784,
+27681,27681,27629,27629,27674,27719,27898,27898,
+23956,27838,22782,25492,21193,19758,19992,20016,
+20153,22133,25499,25539,25178,25141,25462,25459,
+25088,25147,28782,28782,28920,28958,29011,29011,
+29154,29154,29237,29261,29304,29304,29411,29411,
+29549,29608,29767,29767,29965,29965,30094,30138,
+30229,30229,30314,30314,30378,30405,30476,30476,
+30552,30552,30609,30632,30689,30689,30757,30757,
+30813,30829,30849,30849,30825,30825,30811,30808,
+30810,30810,30841,30841,30882,30898,30935,30935,
+30978,30978,30966,30948,30877,30877,30818,30818,
+30801,30792,30759,30759,30713,30713,30721,30733,
+30782,30782,30787,30787,30753,30736,30689,30689,
+30603,30603,30588,30591,30623,30623,30618,30618,
+30611,30595,28758,26686,24494,23235,23060,21031,
+20665,21950,23031,23528,23816,24348,24484,24589,
+24802,24806,24795,24968,25157,25375,25556,25593,
+25670,26048,27897,27897,27875,27875,27884,27883,
+27871,27871,26176,25757,25121,24391,24154,24037,
+23958,23895,23755,23720,23713,23635,23284,23123,
+22754,22245,21963,21310,22279,24008,24108,25054,
+25043,24840,23242,22953,22754,22638,22320,22641,
+22788,22706,22502,22188,22038,21913,21700,21525,
+21327,20727,20391,19970,18708,17644,16485,16388,
+16452,16526,16320,16315,16444,18129,18942,19169,
+19645,19783,19818,20070,20157,20322,20570,20507,
+20329,20300,20261,20096,19867,20072,20109,19770,
+19554,19272,16270,18082,19071,18569,18038,15980,
+13353,16001,16650,17283,14499,13290,13003,14343,
+15094,12930,13005,12852,12923,12961,12901,12801,
+13704,14685,16232,16477,16441,16114,15203,13715,
+12772,12820,12921,12966,13344,13479,13256,13199,
+13268,13089,12923,12685,12323,10680,12029,11638,
+10957,9905,10164,9048,10207,8648,8499,8093,
+7819,7829,7551,7640,7553,7462,7729,7670,
+7500,6973,6756,6630,6643,6261,5776,5235,
+5200,7313,8954,8727,5580,4588,4413,4191,
+3694,3585,3614,3836,7515,7604,7661,7557,
+7122,5732,5376,5361,2768,2762,4700,4635,
+6267,5604,6043,6067,6240,4420,3073,3430,
+4669,7020,7415,7703,8061,7653,7026,6712,
+7739,7145,5924,6789,5897,5746,5464,5220,
+5891,6487,6817,6859,6872,6863,6871,6902,
+6952,6945,6924,6970,7182,7515,7516,7515,
+7388,7283,6921,6691,7107,6952,6814,6537,
+6335,6077,5782,5946,6132,6472,6504,6748,
+7021,6806,6742,7480,7083,7166,7549,8055,
+9483,7907,8531,9924,10147,9941,9539,10603,
+11318,11869,11912,12144,12049,12215,12531,12606,
+12202,11652,11628,11686,11338,11039,10567,10273,
+10093,9351,9131,8891,8749,8580,8653,8374,
+8430,8231,7976,8290,8719,10160,12005,13431,
+22757,22977,23338,23291,23364,23307,22882,22722,
+22320,15062,21995,22152,22816,22823,23850,14094,
+12675,11974,12113,12006,12167,11664,11914,12064,
+13228,14001,13382,12544,11332,12070,15464,16755,
+26687,26697,26737,26737,26820,26820,26924,26969,
+27089,27089,27256,27256,27348,27377,27423,27423,
+27162,27162,27211,27224,27242,27242,27231,27231,
+25567,25517,25519,25520,24051,24226,23884,23947,
+23836,23912,23925,24015,23603,23628,23420,23543,
+23572,23739,23766,23962,24100,23667,23747,23676,
+23441,22484,21903,21053,20706,20474,20367,20399,
+20374,20168,19758,19618,19660,19645,19518,19256,
+19297,20774,19041,18432,17939,17919,17991,20279,
+20692,22216,29242,18933,20553,18970,22031,20582,
+22947,21268,21727,21644,21728,20797,20167,19092,
+20818,20822,19892,20804,19216,19281,17189,17383,
+14011,14308,14363,15102,21470,23190,23591,22205,
+20016,20961,21909,22553,24152,23446,22652,22443,
+23534,23786,23370,21487,19844,19824,22288,22120,
+21043,18570,16241,16782,16866,17127,16361,18118,
+17812,15478,13579,14052,14434,16376,17205,17026,
+16678,16260,15867,15843,15990,16189,15885,17328,
+17654,18218,18374,18423,17057,16846,16242,16146,
+16003,15857,15288,14965,14851,14372,13978,13448,
+12585,11989,11216,9496,9257,9030,8468,8158,
+7789,7129,6937,6789,6633,6653,6713,6893,
+7042,7225,7655,7852,8017,8161,8196,8226,
+8381,8519,8907,9138,9565,9596,9678,9748,
+9816,9875,9883,9910,10044,10123,10484,10586,
+10395,10425,10361,10348,10466,10366,10428,10498,
+11124,11166,11025,11291,12018,12117,12326,12405,
+11250,10847,10711,10550,9599,8855,8507,8752,
+8216,8123,7858,7762,7737,7888,8183,8610,
+10703,13636,14283,15043,14273,14337,16449,16709,
+17069,17260,15890,16158,16590,16785,17008,17469,
+17665,17835,17774,18292,19971,21255,25290,25310,
+25426,25441,25518,25580,27244,27244,27508,27508,
+27715,27763,27802,27802,27674,27674,27570,27535,
+27467,27467,27419,27419,27507,27555,27704,23835,
+22282,22029,21925,21636,19882,20716,19333,19510,
+19258,22124,23127,25484,24581,24373,24307,24650,
+28462,28462,28989,28989,29035,29049,29072,29072,
+29195,29195,29232,29233,29207,29207,29294,29294,
+29474,29543,29702,29702,29854,29854,29971,30015,
+30118,30118,30211,30211,30270,30295,30358,30358,
+30424,30424,30475,30499,30562,30562,30623,30623,
+30654,30660,30658,30658,30612,30612,30591,30588,
+30592,30592,30648,30648,30720,30744,30789,30789,
+30823,30823,30789,30761,30659,30659,30574,30574,
+30550,30536,30487,30487,30412,30412,30418,30429,
+30485,30485,30546,30546,30598,30612,30631,30631,
+30590,30590,30604,30618,30673,30673,30655,30655,
+30617,30588,28387,27347,23548,23151,22620,20678,
+19700,22036,22413,22967,23463,23725,23794,23936,
+24101,24133,24185,24458,24682,25008,25284,25312,
+25415,26012,25698,25700,27809,27809,25703,25703,
+27717,27717,27757,25244,24745,24174,23944,23909,
+23961,23881,23831,23764,23712,23674,23244,23243,
+25572,22714,22432,22237,24097,24320,24685,25176,
+24314,23771,23379,23102,22937,22815,22459,24087,
+24019,22876,22507,22153,22013,21942,21564,21414,
+21221,20597,20321,20016,18025,16400,16219,15976,
+15908,15814,15593,15688,16217,17926,18525,18883,
+19285,19377,19364,19567,19651,19745,19839,19781,
+19832,19617,19549,19503,19301,19232,18962,19051,
+18863,18839,16168,15096,17296,18402,17609,16205,
+12490,12471,14980,16800,16065,13333,12732,12705,
+14046,13926,12386,12223,12490,12562,12451,12255,
+12431,13163,13709,14148,15344,15340,14980,13623,
+12400,12312,12532,12704,12933,12561,12504,12389,
+12275,12109,11983,12088,11964,9936,11178,9525,
+10467,9239,8898,8506,9258,7855,7805,7640,
+7227,7281,7193,6996,6975,7022,7116,7067,
+7016,6684,6488,6408,6353,6105,5637,5900,
+7944,8461,8509,8152,7711,3820,3676,3368,
+3261,3356,3631,2893,3279,7182,7766,8136,
+7676,3091,4905,6016,4775,4810,2705,4346,
+3773,4737,6236,6230,5944,3055,2893,3403,
+6659,6927,7106,7550,7148,6834,7507,6386,
+6938,6740,6711,5728,5399,5174,4892,5025,
+5602,6220,6701,6796,6827,6750,6704,6706,
+6799,6812,6806,6785,6846,7095,6921,6650,
+6260,6304,6448,6765,7016,7046,7091,7047,
+6939,6633,6359,6436,6444,6714,6626,7009,
+6724,6570,6302,6817,6332,6284,6458,6316,
+8733,7607,8936,9353,9077,7809,7297,8857,
+9914,11228,11462,12000,11858,12057,11991,11679,
+11359,10880,10733,10157,10023,9430,8660,8409,
+8159,7564,7483,7345,7331,8146,8265,7562,
+6977,6673,6851,7036,7505,8331,9603,10867,
+14445,22324,22585,22836,22596,22514,22429,22226,
+14670,10627,11493,13699,21986,22363,22677,22130,
+13777,12287,11911,11489,11723,11215,10606,10419,
+11350,11853,12106,12888,12360,12308,13281,13950,
+15024,26632,26585,26585,26642,26642,26789,26831,
+26892,26892,27016,27016,27058,27064,27051,27051,
+27162,27162,27211,27224,27242,27242,27231,27231,
+25547,25502,25496,25501,23920,23957,23511,23540,
+23396,23462,23494,23561,23007,22986,22660,22824,
+22834,23056,23238,23637,23413,23414,23506,23410,
+23172,21654,21382,20882,20214,20022,20031,19862,
+19835,19788,19281,19169,19211,19608,19723,20111,
+20556,20658,18333,18365,17889,17619,20008,20534,
+20079,20572,18831,17271,20144,20193,20110,19399,
+19906,20367,20867,20794,20908,18054,17838,17942,
+21291,21210,20816,20383,19973,17747,13289,15707,
+14812,14507,15038,15162,19179,20226,21234,19217,
+18875,19972,23301,23541,24091,22882,22184,21680,
+21372,21409,21633,21307,21768,22374,21966,21480,
+20170,18081,17410,15752,12058,12599,15139,17163,
+17169,15161,13416,14219,14782,12408,12929,14852,
+16583,16120,15753,15251,15609,15967,16131,16060,
+16274,17965,18052,18022,17735,17585,17387,15659,
+15308,14599,13716,13395,13388,12863,12575,12201,
+11374,10995,10675,10006,9655,9295,8463,7971,
+7534,7015,6705,6580,6544,6584,6591,6766,
+6947,7207,7751,7984,8162,8392,8456,8488,
+8527,8591,8694,9154,9429,9574,9672,9735,
+9794,9851,9865,9894,10011,10066,10397,10426,
+10200,10209,10148,10162,10320,10270,10338,10392,
+11017,11084,10974,11279,11990,12044,12169,12215,
+11014,10682,10531,10345,9223,8152,7877,8474,
+8094,8093,7653,7383,7292,7599,8055,8565,
+12780,13169,13730,14263,13195,13459,15760,16000,
+16274,16641,15054,15125,15768,15973,17119,16499,
+17127,17340,17659,17940,19952,21036,25275,25294,
+25415,25427,25510,25572,27244,27244,27508,27508,
+27715,27763,27802,27802,27674,27674,27570,27535,
+27467,27467,27419,27419,27507,27555,23679,22731,
+20369,20322,20257,20382,20462,20240,18857,18049,
+17923,21105,22435,25557,24926,24764,24537,24524,
+28462,28462,28989,28989,29035,29049,29072,29072,
+29195,29195,29232,29233,29207,29207,29294,29294,
+29474,29543,29702,29702,29854,29854,29971,30015,
+30118,30118,30211,30211,30270,30295,30358,30358,
+30424,30424,30475,30499,30562,30562,30623,30623,
+30654,30660,30658,30658,30612,30612,30591,30588,
+30592,30592,30648,30648,30720,30744,30789,30789,
+30823,30823,30789,30761,30659,30659,30574,30574,
+30550,30536,30487,30487,30412,30412,30418,30429,
+30485,30485,30546,30546,30598,30612,30631,30631,
+30590,30590,30604,30618,30673,30673,30655,30655,
+30617,30588,28174,26423,23518,23148,22477,21440,
+21296,21689,21632,22015,22697,23007,23160,23299,
+23257,23428,23308,23892,24261,24594,24991,25071,
+25176,25903,25696,25698,27809,27809,25703,25703,
+27717,27717,27757,25016,24568,24092,23979,23939,
+23895,23837,23837,23755,23728,23646,23343,23285,
+23123,22850,22774,22733,23093,24649,25007,24301,
+23792,23239,23098,22565,22954,24221,24251,24242,
+23188,22881,22523,22161,22064,21917,21524,21387,
+21132,20604,20219,20011,18130,16302,15900,15716,
+15782,15711,15822,15918,16293,17813,18152,18339,
+18754,18830,18892,18978,18969,18987,18914,18824,
+18805,19005,18970,18673,18534,18345,18003,17619,
+17274,17132,15441,14770,15933,18313,17425,15681,
+12375,12098,14213,16676,16560,15309,12354,12183,
+12215,11924,11760,11768,12007,12049,12265,12539,
+13240,14047,14048,14204,14376,14878,15196,13486,
+13167,13155,12237,12442,12576,12555,12416,12196,
+12100,11413,11556,9827,10969,11198,10684,10211,
+8867,9482,8630,8409,7990,7600,7415,7280,
+6674,6590,6613,6711,6886,7066,7044,7010,
+6989,6804,6641,6482,6193,6014,5387,6231,
+8681,8688,8351,8044,7676,3211,3238,3222,
+3056,3072,3285,3005,2537,3012,7578,7704,
+7988,2945,5739,2668,2551,2836,3120,4743,
+3223,4216,5951,3487,3647,2948,2945,3286,
+6580,6869,6705,6489,7081,6924,6254,6374,
+5304,5150,4715,4926,4965,5862,5558,4839,
+5060,5331,6193,6412,6564,6558,6560,6600,
+6774,6796,6787,6747,6787,6843,6334,5711,
+5454,5967,6556,6628,6478,6458,6587,6577,
+6635,6677,7750,7205,6726,6674,6476,6818,
+6365,6188,5929,5680,5704,5653,5739,5406,
+5098,6676,7024,7247,6936,6928,6812,8571,
+9840,10646,11176,11407,11412,11832,10725,10214,
+9298,8725,8998,8631,8495,8290,7632,7298,
+7309,7376,7331,6761,6147,6430,7502,6863,
+6940,6234,6468,6516,6825,7639,8363,9341,
+11775,12823,21787,22460,22279,22158,22070,21936,
+21638,9048,8525,10025,13373,21641,22351,22080,
+14157,12697,10878,11388,11695,11522,10760,10248,
+10253,11085,11982,13357,13709,12997,12669,12446,
+12947,14555,15365,26585,26642,26642,26789,26831,
+26892,26892,27016,27016,27058,27064,27051,27051,
+21687,21962,21835,22179,22741,22840,25534,25536,
+25508,25476,25376,25368,22760,22664,20943,20899,
+20411,20566,20291,20487,20260,20605,20800,21005,
+21437,21668,21922,22339,22777,23009,22930,23157,
+22844,22465,22087,21533,20284,19755,19527,18148,
+17824,17823,19186,19211,19168,19210,19331,19267,
+19146,19462,20541,20460,20196,19918,19538,19640,
+19136,19494,20003,20190,19834,21015,21084,20654,
+20762,20974,15517,14607,14007,15017,16695,16651,
+14131,13381,12962,13509,16506,17547,12691,12334,
+12196,15351,18747,18560,16650,14735,15655,17463,
+19186,21485,22281,22657,23040,21476,17845,14885,
+19822,19395,21881,22569,22341,22112,20756,21011,
+21427,19092,17362,15670,15755,16309,16788,16505,
+15400,14301,14841,15573,15935,14969,14238,15735,
+16167,15934,15668,14304,14828,15399,15754,15578,
+14110,16050,16022,15789,14173,13868,13716,14105,
+13564,14282,11729,11680,11917,11796,11622,11624,
+10977,10611,10181,9141,8595,8146,7315,6956,
+6649,6433,6512,6664,9527,6989,7036,7315,
+7578,7887,8386,8456,8419,8368,8714,9472,
+9731,9793,9841,9514,9109,9140,9836,9909,
+10292,10464,10293,10272,9934,9912,9913,9978,
+10018,10048,10082,10127,10316,10556,10761,10796,
+10371,10086,9860,10685,10483,10505,10407,10382,
+10345,10205,10071,9879,8847,8964,9191,10259,
+10761,10998,10761,10711,10656,11011,10942,11159,
+12318,12143,12461,13146,13796,13867,9466,8615,
+8188,9105,13242,11999,13310,13809,14206,14932,
+15399,15796,16685,17026,19310,20431,22044,22210,
+25344,25362,26932,27003,27145,27145,27339,27339,
+27515,27557,27594,27594,27458,27458,27347,27316,
+27269,27269,27319,27319,24426,22117,21538,20754,
+17864,17642,17366,18091,18144,18172,17981,17438,
+17496,19613,21085,22248,24509,24585,24912,24730,
+28563,28563,29059,29059,29130,29153,29197,29197,
+29245,29245,29251,29247,29222,29222,29298,29298,
+29452,29507,29630,29630,29734,29734,29841,29885,
+29999,29999,30089,30089,30130,30148,30200,30200,
+30266,30266,30320,30346,30422,30422,30472,30472,
+30463,30456,30432,30432,30395,30395,30343,30320,
+30257,30257,30263,30263,30318,30341,30399,30399,
+30480,30480,30453,30424,30306,30306,30183,30183,
+30104,30077,30014,30014,29977,29977,30003,30021,
+30084,30084,30195,30195,30320,30362,30443,30443,
+30463,30463,30505,30525,30583,30583,30572,30572,
+30533,30499,30369,30369,25647,24759,23849,22048,
+21153,20309,19986,19652,19955,21935,22406,22590,
+22940,23024,23193,23436,23663,24054,24594,24763,
+24923,25371,25670,25692,25708,25710,27763,27741,
+27662,27662,25379,24828,24350,23956,23924,23912,
+23796,23754,23701,23572,23520,23430,23295,23175,
+22998,22992,23112,24397,23489,23608,23811,23469,
+23094,23010,23334,23082,22804,22647,23094,24129,
+22613,22303,22283,21995,21877,21799,21359,21313,
+21200,20696,20362,20052,19418,18865,15962,16035,
+16047,15831,15131,15415,16423,17575,17769,17829,
+17906,17939,17956,17895,17820,17800,17498,17052,
+16114,14613,14408,14325,14192,14016,13767,13349,
+13205,13196,13415,13659,14000,17700,16932,14715,
+12109,11491,11404,16044,16132,15210,11625,11587,
+11646,11647,11662,11462,13809,14578,14711,12608,
+11678,12915,13815,14475,13910,11763,11914,13304,
+12975,12760,12159,12448,12202,11860,11798,11764,
+11695,11467,10918,10734,10060,9227,9675,9185,
+8925,8002,7331,6990,6510,6242,6239,6292,
+6082,5847,5698,6067,6269,6440,6707,6670,
+6699,6663,6643,6344,5283,4905,4736,4764,
+6528,7370,8122,7979,7743,2873,2774,2834,
+2674,2496,2534,4154,6998,6986,6934,6948,
+6916,6753,6590,6674,5877,2357,5508,2219,
+2178,4254,4315,2077,2045,2543,3820,4686,
+5881,5877,5701,4969,4732,4595,4030,3756,
+3577,3526,3592,3513,3451,3674,3944,4599,
+4716,4746,4558,4454,4430,5013,5304,6405,
+5900,5585,5565,4420,5326,5652,6613,4612,
+4633,4913,5082,5189,5470,5790,5877,5651,
+5547,5589,5957,5930,5591,5234,5188,6053,
+5319,5174,4965,4515,4317,4294,4566,4042,
+3465,4426,5737,6323,6893,7357,8091,8049,
+7835,6901,4097,3763,3765,4720,5336,5396,
+4025,3766,3738,5100,6012,6346,4628,4593,
+6070,7259,5367,5240,4566,4443,4233,4030,
+3956,4089,4188,3992,4865,4866,6360,7215,
+8163,8744,9299,10009,10371,10691,11418,11730,
+11879,9759,8641,7607,9319,10877,12445,21615,
+21585,13340,12967,13041,12851,12657,11824,11003,
+9509,9818,10360,11240,11204,10637,11496,11662,
+12363,12456,12584,12761,13039,13581,14062,15206,
+15744,24780,24420,24444,25085,24190,18844,19061,
+21450,21591,21361,21820,22327,22402,25509,25509,
+25471,25442,25331,25324,22379,22377,20114,20135,
+19644,19997,19701,19746,19468,20039,20225,20481,
+20962,21075,21493,21975,22262,22387,22346,22181,
+22568,22706,22461,21807,19637,19380,19390,18867,
+18042,17108,18642,18830,18887,18760,18747,18858,
+19436,19307,18909,16910,16597,19077,19265,18643,
+18021,18992,18576,19011,19487,18987,18868,17263,
+15765,15650,17094,17716,18187,19533,19377,19426,
+18414,17607,18022,16793,14647,14193,15817,16572,
+17678,18388,18741,19004,14500,14361,16540,18279,
+19701,20512,17256,17460,20501,19247,16367,16850,
+19955,21056,21514,21785,21824,21470,21418,20497,
+20586,17299,17266,15408,16504,17037,17403,15657,
+15468,14657,15550,15522,15528,15542,15822,16066,
+16192,15991,15099,14822,15089,15487,15521,14723,
+12981,13596,13897,13784,13336,13307,13295,13586,
+13330,12832,12975,12821,12724,11287,11255,11148,
+10232,9844,9047,7718,7215,6919,6336,6288,
+6322,6529,6756,7050,7408,9809,7390,7515,
+7754,8081,8728,9720,10273,8560,8800,9530,
+9739,9823,9861,9865,9871,9882,9882,9860,
+9997,10206,10118,10197,9985,9966,9950,9987,
+10034,10078,10141,10178,10356,10547,10738,10752,
+10324,10014,9773,10238,10354,10379,10292,10276,
+10252,10198,10162,10108,9982,9970,10041,11059,
+11507,11682,11383,11340,11424,11807,11519,11556,
+12450,12324,11735,12454,13128,9347,6975,7002,
+7016,11709,10858,11283,12242,13876,13223,14122,
+14582,14973,15734,16063,18928,20091,21821,22002,
+25320,25341,26932,27003,27145,27145,27339,27339,
+27515,27557,27594,27594,27458,27458,27347,27316,
+27269,27269,27319,27319,23985,20521,19654,19015,
+17503,17180,16601,16534,17199,17642,17434,17445,
+17194,18720,20040,21432,24279,24474,24938,25353,
+28563,28563,29059,29059,29130,29153,29197,29197,
+29245,29245,29251,29247,29222,29222,29298,29298,
+29452,29507,29630,29630,29734,29734,29841,29885,
+29999,29999,30089,30089,30130,30148,30200,30200,
+30266,30266,30320,30346,30422,30422,30472,30472,
+30463,30456,30432,30432,30395,30395,30343,30320,
+30257,30257,30263,30263,30318,30341,30399,30399,
+30480,30480,30453,30424,30306,30306,30183,30183,
+30104,30077,30014,30014,29977,29977,30003,30021,
+30084,30084,30195,30195,30320,30362,30443,30443,
+30463,30463,30505,30525,30583,30583,30572,30572,
+30533,30499,30369,30369,30316,30316,26845,23611,
+22731,21745,20602,20703,20671,21426,21387,22111,
+22417,22469,22753,23332,23484,23968,24405,24573,
+24713,25084,25341,25654,25700,25705,27763,27741,
+27662,27662,25406,24934,24567,24051,23960,23905,
+23832,23738,23665,23549,23510,23518,23216,24215,
+23221,23265,23333,23591,23507,23454,23470,23419,
+23362,23247,23311,23116,22706,24155,23111,23075,
+22555,22195,22130,21904,21816,21700,21357,21217,
+21094,20789,20487,20135,19369,18919,16802,15928,
+15757,15674,15288,15549,16265,17294,17436,17556,
+17712,17726,17742,17575,17425,17331,16725,16122,
+15315,14273,13878,13613,13418,13374,13105,13018,
+12894,12998,13169,13514,14179,17012,16059,13719,
+11937,11470,11440,15711,15449,13223,11689,11615,
+11608,11479,11468,11660,14712,15041,14941,13641,
+13062,11306,11635,11461,11296,11218,11256,12910,
+12098,12128,13053,12247,12322,12711,11196,11063,
+10962,10629,10297,9451,9416,9392,9201,8418,
+9014,8049,6849,6415,6113,6068,6091,6108,
+5633,5290,4830,5145,5573,6158,7730,7105,
+6904,6519,6400,6046,5473,5214,4928,4295,
+4011,4028,7596,3576,2978,2658,2747,2839,
+2497,2535,4111,6938,6958,6927,6765,6657,
+4747,4310,3433,2392,2142,1850,1856,1876,
+1924,1988,5239,2121,2129,2317,2454,2725,
+4669,4507,4200,3316,3152,3244,3322,3168,
+2951,2754,2789,2832,3126,3383,3593,4127,
+4193,4279,4316,4440,4611,4861,5094,6289,
+4922,5799,4722,5288,5172,6279,4629,4581,
+4733,5020,5150,5238,5513,5910,5979,5926,
+5904,5952,6082,6004,5794,5360,5269,5229,
+5091,4930,4723,4349,4356,4303,3655,3221,
+3068,3506,4866,6240,7612,6963,8026,6479,
+5634,4261,3918,5214,6092,5618,5312,5180,
+4728,3756,3203,3887,5157,5320,5065,6457,
+7128,5925,5137,5992,6146,5462,5348,5109,
+5201,4882,3699,3705,4372,5042,4965,5700,
+6672,6984,8295,9036,9213,9724,10614,10901,
+11529,11083,10922,10827,10704,10916,11234,12502,
+13114,13362,13219,13616,13684,13181,12797,12054,
+9719,9364,9879,10338,9522,8324,10207,11985,
+12682,12984,13059,12862,12735,12843,12657,13241,
+14114,13963,14774,14939,15475,15400,15176,18536,
+17598,17792,18760,18970,19632,19903,21472,21412,
+20510,20220,19197,19163,18494,18488,17880,17994,
+18791,18953,18560,18964,18914,19588,19835,20043,
+20602,20776,20711,21595,21878,22174,22450,21084,
+21551,23822,22763,22494,20581,20038,19294,17799,
+17791,17423,17384,18108,18289,18282,18205,18304,
+18259,18524,18896,17843,18643,16118,16922,15988,
+14726,17962,17952,18642,19687,18661,17189,16147,
+16682,16850,17770,18737,19874,19914,19476,18933,
+17908,17563,17184,16085,16526,16973,16994,17241,
+17110,17227,17859,18856,17709,19480,19956,20373,
+19464,18383,17566,18024,20989,19661,20761,20653,
+19506,20533,20943,20947,20865,20713,20079,20487,
+18306,18627,17954,15510,17017,16734,16600,15684,
+14292,13732,15146,15035,15113,14871,14706,15616,
+14571,14353,15222,15100,16767,15460,15261,13746,
+12828,12976,14034,14004,13382,13827,13577,13586,
+13130,12301,9738,9854,10041,9962,9561,9319,
+8464,7984,7197,6276,6225,6300,6322,6371,
+6359,6715,7059,7375,9813,9921,7796,7793,
+8002,8288,8905,9041,9010,9568,9483,9476,
+9568,9603,10112,9666,9708,9744,9448,9017,
+8939,9197,9816,10862,10599,10600,10566,10572,
+10651,10714,10398,10382,10453,10453,10491,10520,
+10817,10840,10548,10365,10352,10340,10287,10244,
+10200,10165,10320,10348,10719,10756,11521,11937,
+11831,11926,12459,12991,12700,12662,12988,13065,
+12477,11597,9515,7235,6878,7717,7485,8055,
+6851,10587,10563,11911,9438,13313,14322,13169,
+13832,14194,15443,15776,16672,17859,19040,19227,
+21019,21260,24013,25471,25527,25541,25583,25594,
+27327,27361,27408,27408,27348,27348,27260,27236,
+27202,27202,24778,24104,23061,20136,18299,17512,
+16750,16531,16100,15195,15392,15920,16746,16850,
+16523,17306,18864,19916,22116,24189,25330,25574,
+28139,28139,28608,28608,28841,28909,29013,29013,
+28998,28998,29035,29067,29191,29191,29328,29328,
+29419,29453,29534,29534,29627,29627,29740,29788,
+29918,29918,30000,30000,30005,30011,30041,30041,
+30115,30115,30170,30214,30383,30383,30428,30428,
+30395,30382,30355,30355,30339,30339,30265,30189,
+29879,29879,29791,29791,29765,29774,29843,29843,
+30017,30017,30031,30014,29918,29918,29773,29773,
+29627,29588,29542,29542,29622,29622,29701,29732,
+29808,29808,29938,29938,30082,30131,30233,30233,
+30292,30292,30336,30349,30374,30374,30378,30378,
+30376,30367,30329,30329,30303,30303,30282,30271,
+23921,22834,21704,21441,21586,22321,22286,21982,
+20958,21032,20754,22146,23543,24099,24385,24522,
+24661,25000,25208,25422,25981,25697,25704,25708,
+25711,25704,25692,25288,24909,24431,24176,23917,
+23844,23787,23699,23660,23532,23567,23508,23377,
+23272,23155,23296,23414,23493,23623,23599,23491,
+23395,23119,23068,22887,22890,22958,22824,22803,
+22403,22239,22222,21914,21652,21643,21306,21322,
+21180,20782,20501,20142,19248,18610,17758,15970,
+15758,15725,15762,15650,15685,16863,17017,17164,
+17428,17528,17559,17395,17147,16856,16195,15752,
+15202,14357,13994,13912,13798,13758,13625,13454,
+13336,13287,13696,14129,14490,16166,14797,13246,
+11722,11550,11561,15329,14296,12819,11794,11924,
+11834,11809,12231,12354,13069,13535,13464,11975,
+13939,14125,13502,14290,13856,10684,10917,12762,
+11620,11342,11551,11985,11985,11767,11283,11423,
+11126,10389,10225,10365,9617,9189,8954,8344,
+7993,7422,6728,6503,6341,6200,6201,6074,
+5638,5340,5044,4734,5012,5472,6835,6618,
+6569,6231,5861,5441,5162,5007,4821,4422,
+4316,4080,3856,3245,2890,2591,2443,2438,
+6941,6935,6921,6878,6860,6811,6489,6243,
+3638,2049,2171,2202,2016,1894,1800,4213,
+1779,1786,1863,1901,2475,1972,2033,2194,
+3142,3033,2863,2775,2750,2711,2761,2714,
+2566,2369,2409,2479,2829,2967,3078,3667,
+3918,4119,4561,4795,4991,5883,6178,5631,
+5757,6621,6674,6116,6638,6801,6515,6080,
+4749,5791,5816,6213,6966,6192,5922,5993,
+6033,6121,6250,6161,5941,5665,5639,5561,
+5368,5173,4897,3810,3051,2804,2956,3684,
+4097,4465,5490,6577,7406,7120,7279,4097,
+3332,3465,5233,5386,4977,2764,3019,4790,
+5233,3428,2898,3924,4768,4252,6792,8117,
+7871,6855,7292,6975,7446,6355,6914,6056,
+6572,6803,5282,3972,4211,4605,4426,4926,
+5725,5471,6317,8597,9132,9268,9669,9859,
+9916,10389,10261,10394,10512,10662,10921,12097,
+11972,12211,12689,13236,13360,13952,13916,13332,
+11063,9550,9500,8942,7902,7162,11402,11655,
+12152,12869,13050,13552,13247,13039,12720,12393,
+13174,14011,13735,14563,14204,15215,15475,15790,
+15852,16114,16989,17432,18126,17988,19511,19331,
+18366,18164,16589,16574,17015,16962,16897,17145,
+17510,17611,17623,17903,17609,18383,18829,19232,
+20137,20520,20817,21291,21485,21423,21861,22182,
+22635,23243,23532,23674,23389,22935,22341,18016,
+18118,17867,15233,15739,16291,15758,16037,14664,
+12762,14802,15453,17478,17338,18292,18484,18257,
+17446,16447,15522,14361,18094,18257,17526,16514,
+14757,17743,19677,19859,19902,19081,18367,18869,
+18213,17664,17840,17039,16548,16086,15743,14821,
+14472,17846,19326,20112,20319,19977,19858,19858,
+19723,19703,19054,20131,19320,19721,20031,20563,
+20258,19891,19593,17776,17763,18293,18846,19778,
+14659,19351,15070,15914,13250,14466,13504,13711,
+13806,13588,14379,14742,14753,15465,15483,15464,
+15143,15039,14789,14814,15032,15089,14954,14799,
+14085,12711,14204,14045,11749,11680,11365,13035,
+12679,10872,8640,8173,7844,7069,6764,6453,
+6233,6630,6937,6842,6889,6979,6988,7069,
+7117,7359,7261,7269,7480,7640,7845,8173,
+8268,8341,8471,8540,8608,8766,8855,9014,
+9694,9685,9665,9649,9652,9680,9574,9488,
+9427,9224,9207,9705,10393,10428,10426,10633,
+10788,10865,9927,9625,9207,9001,9082,9250,
+10609,10704,10171,10531,10059,9995,10772,10336,
+10445,10613,11167,11269,11423,11299,11323,11369,
+11465,11535,12690,13049,12838,12474,13264,11648,
+10230,9502,8816,8726,8203,7723,6114,4788,
+4227,4123,6036,5783,11732,12593,13405,11849,
+12510,12863,14070,14314,14688,15510,16545,17132,
+19590,19944,23282,25354,25436,25454,25533,25548,
+27257,27290,27341,27341,27307,27307,27235,27216,
+27187,24002,22760,22075,21375,19599,18676,17584,
+16029,15555,15167,14677,14549,14470,14966,14357,
+14373,14806,15487,16379,19373,20306,20767,25209,
+25219,25257,25411,25437,25479,25519,25550,25539,
+25561,25518,25485,25466,29081,29081,29289,29289,
+29377,29407,29472,29472,29557,29557,29674,29725,
+29868,29868,29956,29956,29953,29956,29970,29970,
+30037,30037,30113,30161,24507,30324,23680,23202,
+22578,21493,21689,22403,23337,22359,30178,30093,
+29756,29756,29639,29639,29555,29551,29619,29619,
+29807,29807,29829,29815,29726,29726,29590,29590,
+29442,29406,29377,29377,29495,29495,29594,29631,
+29715,29715,29850,29850,29995,30045,30150,30150,
+30218,30218,30264,30277,30295,30295,30307,30307,
+30320,30320,30309,30309,30296,30296,30276,30268,
+30246,30246,30184,30184,23576,23019,29853,22594,
+21956,21631,21519,23254,23442,23715,24260,24502,
+24693,24882,24893,24927,25075,25222,25354,25512,
+25830,25843,25719,25723,25714,25586,24922,24694,
+24102,23968,23906,23910,23773,23758,23618,23564,
+23543,23393,23459,23554,23610,23621,23512,23355,
+23250,23297,22167,22486,22643,22425,22271,21947,
+22745,23016,23368,22213,21563,21149,21278,21250,
+21137,20784,20509,20130,19470,19325,19171,18259,
+16980,16648,16213,16000,15817,15754,15795,16034,
+16400,16803,17059,17057,16840,16446,14796,14257,
+14424,14275,14137,13802,13640,13699,13804,14024,
+13984,13945,14985,14248,15474,15657,14278,13344,
+13817,12895,13001,15594,15542,15507,12080,13739,
+13838,13981,13952,12039,12049,13088,13531,12540,
+12828,13007,13326,14185,14121,11051,10826,10791,
+11128,11554,11894,10941,10745,10530,10974,10929,
+10748,9429,10888,9049,10475,9482,8264,7711,
+7487,7246,6918,6759,6612,5715,5472,5289,
+5483,5489,5401,5170,5305,5543,6153,6234,
+6163,5745,6204,6314,3988,3738,3431,2954,
+2905,3003,3340,3112,2737,2529,2701,4062,
+6509,6549,6524,6292,6095,1954,1707,1644,
+1623,1587,1568,1589,1614,1699,1697,1787,
+1983,2021,1818,1932,1900,2270,2357,2253,
+1892,1893,1920,2038,2104,2179,2276,2252,
+2307,2407,2432,2502,2843,3130,3330,3639,
+3703,3935,4896,4943,5906,7416,7541,6108,
+7798,6154,7549,7007,7199,5554,6713,6787,
+5301,6875,6787,6771,6466,6457,6348,5944,
+6017,5960,5733,5511,5244,5127,5317,5726,
+7202,7945,8242,7966,7403,8065,7682,7314,
+6530,5364,5484,6194,6959,6446,6082,4012,
+3382,3561,3677,2696,3416,8263,6274,4180,
+3523,4106,3092,3828,6110,6797,4656,3326,
+3390,5452,6114,5710,4509,4342,4883,7897,
+7585,7465,4486,3574,3995,4069,3624,3347,
+3340,3448,3674,4585,6266,7494,8784,8746,
+8645,8370,8286,8879,9957,10230,10195,11101,
+11410,10924,9732,9963,11075,12910,13407,13242,
+12342,11806,11750,9999,9741,9518,9682,9873,
+10481,10281,10775,10755,11214,11626,11868,12683,
+12544,12608,13142,13862,14417,19133,15455,16014,
+15271,15271,15711,15958,16204,16256,15166,15162,
+15307,15966,16517,16500,16493,16371,15655,15516,
+16536,16735,16915,17116,16975,17653,18068,18546,
+19575,20011,20366,20739,20773,20783,20815,21031,
+21370,21882,22261,22543,22732,22777,21457,20145,
+19392,18822,16670,15424,16204,17054,17193,17417,
+15556,15400,16824,17342,16766,17525,17656,17603,
+17884,18042,18348,17787,17014,15777,14055,17636,
+19244,15314,18755,18523,19481,18213,18205,18553,
+19064,18308,17132,17199,16760,15875,14487,14897,
+16725,18466,18260,18873,19198,18448,18808,18167,
+19402,19260,19033,19219,19430,19845,19924,19909,
+18958,18474,17071,18906,18537,15116,13019,19690,
+13666,15518,14273,13955,13039,12254,12590,14590,
+15060,14985,14839,14405,14442,15149,15610,15607,
+15234,15065,14803,14452,14776,14852,14769,14679,
+14522,13904,13964,13737,11009,10671,10331,11484,
+12610,8846,7728,7175,6868,6480,6396,6354,
+6395,6476,6614,6952,7061,7229,7370,7504,
+7729,7672,7492,7332,7468,7675,7893,8196,
+8242,8253,8358,8462,8584,8864,8960,9113,
+10320,10305,9718,9605,9594,9564,9333,9269,
+9252,8743,8687,8714,8722,8749,8954,10067,
+10413,10555,10691,9572,9110,8711,8663,8676,
+8855,8991,9123,9409,10007,10164,11211,11382,
+12254,12697,12499,12575,11715,11686,10937,10806,
+10858,10912,10635,10583,11100,11082,9545,9581,
+9416,8942,8468,8150,7799,7394,7208,6841,
+6480,6805,7113,9606,12013,12815,10958,11826,
+11993,12076,12890,13137,13298,13998,14429,14832,
+20202,20658,22781,25185,25298,25331,25543,25555,
+27094,27130,27195,27195,27212,27212,27199,27194,
+27183,24206,22699,21976,21581,20078,18944,18060,
+16133,15491,14978,14370,14219,14146,14648,14469,
+14332,14459,14653,15140,17649,18931,19832,21766,
+22000,22076,23258,23386,23775,24261,24651,24765,
+25144,25230,25328,25194,28514,28514,29042,29042,
+29185,29219,29249,29249,29299,29299,29429,29494,
+29687,29687,29814,29814,29814,29808,29778,29778,
+29784,29784,29979,30022,23466,22807,21871,21630,
+21174,20326,20836,20647,20168,20007,20069,21114,
+22853,29523,29363,29363,29049,28995,29039,29039,
+29199,29199,29214,29203,29133,29133,29061,29061,
+28991,28985,29028,29028,29220,29220,29363,29414,
+29523,29523,29667,29667,29797,29842,29939,29939,
+30018,30018,30070,30086,30111,30111,30151,30151,
+30199,30215,30247,30247,30265,30265,30256,30248,
+30221,30221,30179,30179,30165,23984,23437,23005,
+22509,22308,21909,23106,23239,23476,24131,24413,
+24606,24666,24645,24674,24867,24987,25060,25005,
+25019,25138,25645,25721,25755,25695,25606,25483,
+24680,24440,24178,23994,24007,23948,23727,23698,
+23583,23557,23592,23674,23716,23545,23537,23376,
+23536,23486,23350,23358,23120,22363,22907,23142,
+23486,23475,23199,22726,21837,21461,21424,21288,
+21138,20796,20495,20289,19745,19488,19290,18802,
+18151,17721,16501,16401,16317,16118,15927,15746,
+15524,15924,16417,17073,17013,16889,16243,15703,
+14567,14618,14746,15060,14150,14302,14354,14336,
+14535,14071,15370,15721,16276,16674,14079,13125,
+13969,14263,14310,14230,15741,15504,15226,14910,
+11938,13793,14646,14714,12348,13046,14104,14102,
+13690,13077,13559,13321,13794,11230,10973,10951,
+10729,10757,11205,10876,11337,10833,9765,9649,
+9322,9229,9124,8937,8379,8017,7686,7090,
+6831,6637,6614,6614,6571,6176,5889,5664,
+5677,5678,5622,5363,5331,5403,5943,6077,
+6117,6284,7058,6970,3581,3359,3117,2767,
+2738,2760,2532,2334,2241,2314,2273,2155,
+2008,1967,1960,1965,1814,1726,1737,1600,
+1508,1406,1380,1374,1441,1495,1556,2026,
+2199,2211,1990,1946,1982,2020,1953,1849,
+1853,1935,2044,2102,2130,2106,2033,2034,
+2058,2295,2421,2502,3065,3234,3458,3454,
+3436,4083,6819,4711,7249,7576,7852,5834,
+7913,7932,7886,7473,4906,7488,7566,7423,
+6840,6449,6367,6474,6129,5506,5255,6772,
+7124,7254,6728,7999,7816,8044,8112,8227,
+7863,5669,6515,4765,4077,5257,6791,6597,
+5535,5382,5638,5842,5100,5093,5710,4348,
+2755,2083,2250,2364,2448,5542,5859,4477,
+3227,2606,2857,6161,5976,4235,2590,4425,
+5417,5481,4657,4178,4680,8180,7468,6462,
+6244,6687,7117,6798,6635,4216,3548,3302,
+3528,3485,3470,3650,4329,5438,7837,8022,
+7660,7490,7564,8528,9308,10891,10889,11937,
+11979,11516,9800,9502,9755,10879,11318,11623,
+12152,12140,11882,11799,12074,11420,10830,9905,
+8771,9041,9290,9791,9545,10018,10511,12339,
+12458,12611,12881,13404,14602,15098,15512,15624,
+15130,15411,15517,15665,16046,15809,14679,14681,
+14742,15000,15405,15273,13949,13799,14034,14990,
+15883,16018,16012,16235,16177,16864,17278,17798,
+18844,19175,19511,19517,19343,19334,19264,19352,
+19465,19749,19960,20252,21661,21832,20324,20080,
+19487,18909,18225,16261,15209,17391,17990,17995,
+18185,17609,17039,17742,17792,17901,17686,17325,
+17394,17660,17747,17924,18306,17604,18292,18585,
+19163,19370,18841,19392,17762,16927,18309,18216,
+15946,15202,15411,15757,16656,16648,17185,17964,
+18522,18387,17906,17949,17251,16839,17996,18488,
+18470,18474,18620,18873,17300,19099,19474,19486,
+19204,19118,19022,12787,18060,17898,17831,12009,
+17163,16285,16462,15407,10660,13197,14090,14405,
+14414,14528,15238,14996,15189,15763,15758,15596,
+15151,15222,15250,14799,14829,14844,14683,14585,
+14328,14035,13891,13729,13504,13381,13168,12832,
+12438,7289,6781,6615,6521,6516,6592,6675,
+7477,7359,7320,7337,7344,7348,7568,7761,
+7919,7870,7679,7525,7663,7875,8073,8292,
+8312,8327,8485,8612,8728,8859,8876,8904,
+8916,8983,9050,9396,9347,9273,9082,9036,
+9007,8412,8302,8266,8227,8270,8389,8885,
+9313,10416,10715,9775,9257,8525,8426,8416,
+8645,8793,8988,9697,10355,10515,11397,11472,
+12424,12604,12430,12294,10179,9881,9715,9485,
+9515,9546,9461,9910,9325,9283,9084,8712,
+8659,9030,8981,8523,8732,9166,7967,7268,
+7134,7549,8031,8816,12118,10756,11005,11218,
+11262,11363,12299,12525,12602,13176,13632,14115,
+19923,20409,22657,25154,25268,25303,25537,25550,
+27094,27130,27195,27195,27212,27212,27199,27194,
+24308,24112,27172,22265,21380,20387,19691,18935,
+17283,15370,14905,14199,13949,13777,13873,14037,
+14150,14289,14373,14495,16690,17720,17421,20961,
+21534,21589,22661,22695,23106,23638,24123,24238,
+24860,25021,25320,25530,28514,28514,29042,29042,
+29185,29219,29249,29249,29299,29299,29429,29494,
+29687,29687,29814,29814,29814,29808,29778,29778,
+29784,29784,29979,23343,22585,21776,20189,20925,
+20853,20747,20596,20309,20352,20149,20269,21086,
+21554,21898,23978,29363,29049,28995,29039,29039,
+29199,29199,29214,29203,29133,29133,29061,29061,
+28991,28985,29028,29028,29220,29220,29363,29414,
+29523,29523,29667,29667,29797,29842,29939,29939,
+30018,30018,30070,30086,30111,30111,30151,30151,
+30199,30215,30247,30247,30265,30265,30256,30248,
+30221,30221,30179,30179,30165,30135,30006,24000,
+23124,22769,22360,22871,23115,23281,23830,24081,
+24261,24386,24404,24435,24574,24664,24711,24685,
+24669,24794,25485,25617,25708,25736,25708,25652,
+25503,25005,24725,24328,24333,24301,24020,23864,
+23748,23511,23494,23622,23796,23674,23143,23663,
+23834,23785,23550,23370,23339,24060,23913,23857,
+23502,23277,22942,22472,22314,21977,21753,21522,
+21150,20459,20148,20216,19832,19573,19350,18765,
+18562,18145,17184,17028,16627,16104,15991,15941,
+17367,17119,15240,16049,16784,17059,16803,16230,
+15270,14799,14680,15228,14760,14259,14390,14541,
+15806,15278,15997,16848,16606,17464,16186,14598,
+12517,14343,15971,15960,13681,15902,15272,15054,
+14344,14381,14627,12009,14678,14625,14561,13765,
+14122,13242,12194,13503,13259,13206,13028,12895,
+12441,10767,10467,10555,10486,10177,9413,9071,
+8816,8667,8649,8489,8062,7681,7309,6814,
+6560,6324,6464,6534,6549,6316,6140,5974,
+5762,5695,5661,5397,6174,5371,5720,5870,
+5943,6323,6979,6753,3448,3168,2956,2837,
+2869,2715,2167,2286,2696,2910,2778,3441,
+2080,2140,2151,1882,1707,1748,1777,1674,
+1460,1302,1286,1318,1481,1575,1715,1773,
+1701,1620,1652,1657,1637,1703,1719,1783,
+1858,4082,5325,1955,1993,1980,2034,2122,
+2235,2590,2787,3056,4048,5391,6363,7343,
+7529,7835,8019,5490,7985,7269,5156,7430,
+8151,5289,7897,7582,7354,5595,6917,7443,
+7086,6519,5708,5637,4538,4006,4570,6277,
+6773,6721,6027,6757,6728,6046,5519,4502,
+2164,2036,1976,2104,2566,3833,5017,3976,
+3125,4424,4782,4720,3559,3646,3826,4051,
+3923,3218,3260,4053,4351,4251,4178,3841,
+5164,6040,6446,4772,2753,2519,5113,6153,
+5905,5266,4831,5553,7877,7590,7094,6088,
+6197,6634,6942,7062,6904,5172,3819,3422,
+3981,3956,3690,4919,4760,5126,5546,6135,
+6287,6747,6203,7306,9835,10847,11077,11426,
+11233,11169,9929,10227,10299,10436,10856,10813,
+10513,11531,11575,12424,12464,12089,11549,7797,
+7302,7441,8076,8769,14025,9463,10235,11600,
+11981,12378,13125,14157,14446,14844,15275,15436,
+14205,14702,14679,14465,14376,14283,14005,13814,
+13288,12580,12315,12123,12145,12445,12836,13866,
+13992,14037,14111,14218,14393,14869,15178,15715,
+17098,17557,17820,17616,17508,17503,17557,17602,
+17644,17708,17816,18120,18836,19000,19007,19088,
+18957,18691,18262,18252,17608,17028,17664,16965,
+18594,18434,18200,17817,17762,17694,17218,17434,
+17462,16796,16441,16201,16306,16320,16526,16398,
+16587,16609,16379,16123,16114,16027,15902,15912,
+14488,13060,9870,13334,15104,16337,17820,17694,
+17347,16778,16225,15614,16257,16021,15744,12414,
+10970,12425,13084,15952,16503,17154,16957,16393,
+16317,16981,17077,16778,16291,15419,14022,14110,
+12902,11895,12786,12865,13582,13566,14161,14475,
+12953,12864,15468,15963,16632,15508,15715,17470,
+15673,15476,15382,15023,14840,14679,14187,14068,
+13784,13820,13615,13372,12821,10863,9665,7352,
+7153,7863,8471,11333,11220,10504,8249,8292,
+8017,7745,7455,6993,6945,7053,7511,7754,
+7942,8128,8173,8227,8418,8519,8590,8662,
+8706,8773,8906,8924,8882,8692,8595,8524,
+8412,8467,8353,8083,8000,7959,7906,7859,
+7782,7815,7937,8073,8449,8730,9996,9383,
+9314,9448,10695,10722,9626,9544,10372,10205,
+10718,10923,10760,10953,10908,10806,10643,10618,
+10610,10737,11125,11115,10762,11218,11203,10891,
+11079,11118,11659,11370,10730,9174,8957,9090,
+9699,9733,9560,9334,9299,8864,7889,7979,
+8215,9501,9740,9884,9905,9877,8535,10995,
+11989,11026,11920,12204,12466,12733,13391,13679,
+15682,16243,18317,19860,21066,21381,25350,25382,
+25539,25587,25588,25600,25629,25636,25643,23561,
+23361,23054,22253,21651,20973,19799,19193,18632,
+16305,15757,15342,14830,14474,13926,13312,13283,
+13339,13619,13733,14362,15022,14566,15199,16615,
+20777,20223,19780,20234,20388,20595,19895,19908,
+20424,20736,20951,21854,22770,23267,28359,28359,
+28523,28510,28281,28281,28434,28434,28654,28749,
+29003,29003,29272,29272,29480,29523,29535,29535,
+29434,29434,29175,22705,22821,23116,23061,22570,
+21814,20618,20916,21198,21969,22272,23007,23054,
+22556,22589,23318,23952,24780,28512,28495,28495,
+28479,28479,28433,28413,28357,28357,28436,28436,
+28602,28670,28842,28842,29049,29049,29219,29284,
+29435,29435,29576,29576,29663,29693,29757,29757,
+29817,29817,29879,29903,29966,29966,30038,30038,
+30093,30113,30155,30155,30177,30177,30173,30166,
+30141,30141,30122,30122,30092,30065,29959,29959,
+25106,23554,22830,22162,22510,22628,23007,23249,
+23491,23830,23962,24091,23945,23801,23634,23454,
+23587,23870,24621,25015,25059,25387,25462,25526,
+25586,25553,25449,25047,24907,24757,24433,24319,
+24176,23933,23873,23722,23771,23729,23707,23987,
+23965,23931,22931,23294,23343,24599,25585,25583,
+24399,24237,23488,22867,22293,22044,21556,21289,
+21065,20775,20555,20492,20295,20079,20015,19344,
+18993,17931,18366,18354,17667,17044,16590,16026,
+18179,18199,17080,16916,18276,18202,16857,17461,
+17339,14778,14756,14753,15485,15640,15397,15717,
+17070,16898,17049,17449,17317,18574,18698,18751,
+18423,18132,17777,16173,16367,16461,15750,15355,
+15032,14885,13039,13148,14515,12605,12509,14069,
+13973,13849,13386,13169,10460,12427,12284,11524,
+10408,10401,11098,9966,9778,9572,9104,8775,
+8667,9671,9589,9536,9212,9084,8850,8504,
+8350,8186,5630,5591,5750,5901,5882,5851,
+5750,5656,5537,5799,6884,5356,5469,5591,
+5634,5614,6438,7504,7485,7455,7384,7167,
+6924,6582,2729,2584,2523,2188,2130,2417,
+6121,6069,5882,3775,2124,1905,1497,1377,
+1264,1203,1207,1343,1817,1981,1739,2413,
+2340,2628,1536,1558,1538,1569,1621,1910,
+1939,2154,2280,2337,2421,2508,7520,2625,
+2404,2537,2706,7212,3132,7120,3569,8407,
+3913,3925,5799,8310,7048,8548,7238,8264,
+7884,6874,7814,6896,7655,7511,7202,6895,
+6621,6581,6443,7106,6072,4319,4649,7125,
+7218,6350,4240,3546,3544,3507,3230,3070,
+2542,2219,1836,1405,1356,1389,1243,1046,
+1104,2517,3649,4592,4830,5840,5788,6405,
+6773,4528,2190,2856,2934,2949,3225,4035,
+5798,5948,5206,3780,3515,3102,2444,2150,
+3307,5037,6634,6129,3743,2625,2707,6985,
+7202,6172,4169,5908,8193,6903,7649,6491,
+4163,5767,7991,6753,5899,4745,5313,5341,
+6836,7664,9840,10076,10793,10551,9781,9641,
+9288,8846,9170,9307,9226,10225,10807,11152,
+10712,10348,10084,11215,11893,11601,11218,10437,
+10107,9737,9962,10025,10609,10879,10883,12140,
+11739,12007,11755,12036,12690,13142,13573,13642,
+14772,14560,14462,14157,13916,13630,13112,13040,
+12755,12717,12735,12719,12443,12488,12600,12569,
+12772,12741,13504,13535,13822,14356,14604,14842,
+15253,15907,16124,16841,16969,16924,17100,17168,
+17251,17372,17547,17793,18348,18536,18644,18757,
+18706,18641,18311,18178,18193,18342,18094,18067,
+17951,18244,18235,17766,17598,17495,17324,17085,
+16776,15919,15586,15261,15137,14959,15479,15685,
+15683,15467,15044,15019,14996,13005,9722,9858,
+12049,13541,14212,14987,15782,16498,17399,17157,
+16750,15977,15478,15090,14480,14275,13837,13166,
+12756,12464,12140,14232,14972,15331,15465,15372,
+15203,15288,15141,14479,13302,13021,12357,12626,
+12837,13200,13400,13602,14222,14411,14527,14679,
+14561,14587,14615,16282,15511,16325,16523,16745,
+16743,15235,15552,14689,13318,13269,13941,13806,
+13656,13437,13302,13116,11676,11107,11200,7299,
+7050,6934,6995,7056,7245,9425,8140,8174,
+7938,7641,7340,7021,7105,7319,7882,8135,
+8334,8553,8608,8657,8757,8802,8800,8806,
+8827,8857,8864,8814,8721,8511,8427,8352,
+8413,8228,8021,7750,7731,7766,7815,7861,
+7826,8081,8234,8329,10067,10251,8901,9049,
+9389,9603,10077,11160,11293,10869,10968,11453,
+11535,11690,11426,11562,11559,10929,10830,10823,
+10821,10930,11312,11324,11070,11107,11092,11257,
+11434,11609,11994,11115,11862,9681,9620,10235,
+9656,9523,9268,8846,9357,9060,8154,8746,
+9854,9695,10690,11577,10420,8677,6620,11473,
+11766,12230,13769,12385,12934,13413,13945,14040,
+15607,16010,18028,19533,20826,21164,25328,25360,
+25527,25580,25583,25596,25615,25613,22318,21863,
+21561,21400,21253,20898,20689,19580,18826,18420,
+17089,16635,16177,15051,14713,14262,13202,13077,
+13044,14307,14509,14344,13311,13702,14199,15103,
+15504,16215,17009,17324,17701,18519,18903,18999,
+19117,19413,19512,20111,20869,21140,28359,28359,
+28523,28510,28281,28281,28434,28434,28654,28749,
+29003,29003,29272,29272,29480,29523,29535,29535,
+22221,21273,21326,21369,22535,28475,28325,23738,
+23040,22380,22072,22092,22365,22463,22507,22802,
+22894,23078,23890,28554,28522,28512,28495,28495,
+28479,28479,28433,28413,28357,28357,28436,28436,
+28602,28670,28842,28842,29049,29049,29219,29284,
+29435,29435,29576,29576,29663,29693,29757,29757,
+29817,29817,29879,29903,29966,29966,30038,30038,
+30093,30113,30155,30155,30177,30177,30173,30166,
+30141,30141,30122,30122,30092,30065,29959,29959,
+29850,24452,23508,22377,21766,21956,22957,23091,
+23251,23555,23669,23696,23524,23360,23224,22958,
+23000,23197,23721,23967,24146,24808,24959,25121,
+25292,25174,25112,24977,24895,24812,24584,24422,
+24248,23937,23836,23762,23775,23855,23848,24733,
+24024,23830,23144,23008,23415,24644,25603,25606,
+24702,24555,23874,23058,22483,21935,21430,21318,
+22599,21077,21012,21024,20624,20393,20129,19471,
+19239,18672,18824,18207,18095,16655,16612,16409,
+18645,18674,18720,17353,18764,17690,14840,14862,
+14877,15050,15970,15920,17419,15443,15464,16411,
+17294,17327,17079,17473,17675,18268,18421,18517,
+18741,18298,16938,17512,16972,16415,15652,15293,
+14929,14757,13325,14733,14333,13876,14043,13779,
+13705,10882,13199,12953,12674,10250,12025,11866,
+10135,10150,10337,9802,9617,9386,9965,9848,
+9761,9674,9615,9552,9290,9129,8917,8709,
+8535,8360,8025,7798,7569,5944,5757,5758,
+5735,5698,5613,6057,7057,6206,5569,5630,
+6023,7297,7614,7904,7720,7657,7571,7305,
+7075,6696,2767,2715,2499,2231,2123,2042,
+2049,4227,5836,5650,5540,1951,1373,1299,
+1230,1236,1320,1462,1649,1611,1536,2250,
+2424,1697,1459,1480,1520,1584,1921,2024,
+2992,2711,2174,6116,7161,2426,2146,2147,
+2196,7641,2773,2993,3652,7443,8135,8194,
+7834,7692,8672,8640,8636,8463,8600,6862,
+7361,8004,7805,7521,6599,7073,6419,5424,
+4215,5999,5959,5945,6207,5120,5768,6913,
+6991,6115,2478,2467,3098,4792,3965,2459,
+1440,1392,2958,3090,894,756,795,899,
+954,2499,3697,4893,4913,5376,5432,4397,
+2974,2336,2384,3507,5253,7008,6148,6333,
+6630,5671,4632,2092,2014,2039,2065,2629,
+4582,6461,6642,5508,2630,2709,2873,7729,
+7656,5456,3430,5220,7532,7731,8259,7904,
+4780,5857,8385,8215,7100,6769,4118,6898,
+8882,9393,9529,9651,9829,9595,8577,7949,
+7400,7082,6979,6739,7726,9487,10539,10592,
+11034,11275,11176,12194,10501,11174,11281,12012,
+11517,11274,11010,10833,10649,11924,12396,11357,
+11524,11800,12759,13057,12776,13299,13572,13839,
+13334,13789,13722,13068,12903,12562,12604,12618,
+12575,12794,13013,13006,12560,12327,12147,11748,
+11622,11857,12693,13340,13614,14051,14149,14329,
+14670,14804,14893,15730,16402,16731,16791,16943,
+17075,17824,17989,18189,18028,18084,18163,18190,
+18237,18313,18427,18422,18357,18187,17942,17924,
+17810,17740,17760,17732,17634,17450,17254,17180,
+16943,16253,15627,15005,14580,15017,15389,15433,
+15502,15274,14935,14579,13546,12543,12657,13630,
+13433,13380,12594,12922,13783,13991,15897,16175,
+15709,15093,14875,14520,14132,13964,13652,13125,
+13026,12967,13347,13763,13854,14021,13653,13117,
+12391,12829,13538,14207,12689,11709,12151,11763,
+14805,14476,14425,14442,14501,14437,15830,14355,
+15704,14511,14407,14432,13903,15119,15220,15857,
+16274,16222,16119,15736,15683,14159,13778,13551,
+13352,12748,12926,12777,12163,11060,9541,7474,
+7233,7253,10165,9588,7123,7893,8121,8129,
+7838,7550,7271,7133,7325,7615,8221,8461,
+8636,8824,8864,8893,8916,8898,8860,8800,
+8787,8773,8694,8620,8532,8382,8323,8251,
+8259,7941,7757,7568,7570,7678,7908,7926,
+7927,8146,8076,8198,8574,8547,8507,8782,
+8840,9181,10128,10686,10955,11112,11364,11250,
+11292,11426,11782,12239,12006,12170,11373,11352,
+12132,11769,11317,11328,11667,11734,11828,11791,
+12367,12327,12252,11899,11572,10880,10538,9908,
+9429,10424,11577,10241,9136,9390,9631,9571,
+8384,11350,11430,11190,6220,5692,5439,11285,
+11556,11999,13715,14173,13305,14394,14635,14691,
+15802,16034,17757,19528,22881,23098,25304,25335,
+25467,25529,25553,25569,25565,22101,21783,20708,
+20402,20248,20199,20132,19880,19495,18478,18150,
+16954,16471,15958,14738,14237,13789,13179,12981,
+12822,14160,14240,13248,12490,12906,13307,13833,
+14101,14455,15504,15830,16165,16793,17009,17186,
+16133,17318,18195,19070,19445,19558,20484,20552,
+20711,21092,21593,21814,22471,22532,23067,23381,
+23732,23785,24225,24254,25457,28852,28974,28974,
+28884,21927,28407,22400,27999,27999,27948,27948,
+28079,28113,23649,28152,28074,23805,23715,23427,
+23716,23905,27916,27916,28093,28121,28080,28080,
+28008,28008,27973,27967,27971,27971,28126,28126,
+28364,28458,28688,28688,28936,28936,29128,29198,
+29359,29359,29509,29509,29600,29629,29675,29675,
+29698,29698,29743,29765,29834,29834,29912,29912,
+29969,29989,30029,30029,30047,30047,30049,30048,
+30042,30042,30028,30028,29991,29972,29921,29921,
+29836,29836,25231,22990,22514,21850,22694,22780,
+22917,23175,23249,23288,23133,23005,22905,22788,
+22764,22750,22925,23355,23666,24195,24455,24683,
+24922,24968,24935,24820,24798,24759,24597,24463,
+24292,23935,23841,23815,23834,23826,24575,23910,
+23850,23783,23602,23509,24096,24431,24989,25021,
+24821,24675,24174,22651,22345,22041,23044,22942,
+23298,23113,22909,21347,20776,20649,20497,19989,
+19590,19066,19218,18267,18085,18743,18644,16874,
+18423,18446,18593,18702,18754,17701,18495,15232,
+15642,16524,18325,18113,17877,16611,15796,17095,
+17447,17467,17314,17402,17497,17852,16355,17608,
+17254,13173,17943,17533,17049,16509,15442,15090,
+14750,14459,12628,13106,14255,13488,13864,13486,
+13422,10947,12893,12124,11799,10686,10551,11620,
+10175,10101,10284,10124,10594,10458,10183,10055,
+9934,9762,9669,9575,9318,9174,9017,8852,
+8694,8499,8264,8089,7875,6383,5780,5648,
+5543,5510,5459,6300,6994,6436,5817,6320,
+6903,7649,8616,8834,7554,7396,7416,7168,
+7012,6713,2565,2453,2419,2147,2019,1893,
+1842,1818,2100,4961,3997,2113,1560,1424,
+1368,1437,1715,1951,2148,2228,2486,2228,
+1757,1492,1433,1468,1544,1823,2024,2247,
+2464,2875,3093,3609,3545,3254,2405,2358,
+5676,7627,8217,8303,8229,4069,8309,8390,
+4630,7818,6004,8790,8714,7411,6789,8374,
+8007,6905,7483,4980,5766,5263,5275,4779,
+4472,3854,3626,4149,5410,6149,6373,5777,
+4857,4106,3332,3330,4041,4340,3192,1892,
+1326,1754,2781,2699,1975,1269,774,777,
+756,1759,2371,2983,5223,6388,5798,3865,
+2315,1879,4736,6212,6184,2624,1964,2176,
+6974,7682,6934,2847,1854,1945,3666,5427,
+7777,7297,4999,3291,2864,3176,5895,7944,
+7061,3993,4026,6717,7841,8303,8161,7616,
+4894,6841,8838,8917,8615,7976,7267,7455,
+8658,8934,8325,7226,7203,7255,6822,6590,
+6041,5612,8793,9794,10035,11009,11079,11211,
+10693,10861,11485,11408,11734,11505,11264,11062,
+11980,12337,11836,10929,11204,11078,9946,9494,
+10610,11999,13618,13817,13543,13388,13360,13379,
+12423,12399,12361,12258,12238,12280,12420,12551,
+12644,12677,13020,13045,12882,12705,12557,12382,
+12729,12618,12950,13095,13414,13557,13502,13687,
+14169,14384,14535,14583,14533,14416,14336,14289,
+14202,14444,14627,15261,15742,16193,16272,16365,
+16537,16822,17646,18012,18212,18530,18483,18376,
+17929,17800,17638,17375,17243,17131,17143,17088,
+17028,16792,16429,16017,15143,14788,14700,12184,
+11995,15139,15498,12893,15495,12998,12842,12888,
+12335,12647,13623,14194,14170,14082,14457,14362,
+14214,14279,14552,13969,13505,13788,14020,13688,
+13623,13697,13855,13800,14027,14763,14683,14610,
+14766,14929,15055,15175,15137,15114,15158,15192,
+15110,14888,14707,14621,14483,15757,14295,14119,
+14008,13861,13673,13659,13738,11785,13935,14009,
+15215,13604,12185,11539,11248,11721,12507,12330,
+12165,10067,9867,9320,6160,5613,5593,8982,
+8080,6898,7327,7657,7956,8251,8206,8472,
+10257,7767,6828,7255,7752,8202,8803,8939,
+8990,8956,8921,8887,9030,8961,8882,8765,
+8521,8496,8439,8417,8410,8448,8446,8392,
+8299,8180,7998,8125,8219,8398,8777,8726,
+8627,8321,7936,7900,8032,8156,8387,8910,
+9158,9697,9583,9580,9507,9327,9354,9448,
+9839,10020,10362,11726,12393,12784,13149,13395,
+13264,13015,12424,12461,12962,13674,13758,13705,
+13536,13414,13313,13225,13059,12485,10908,11286,
+10905,10848,11173,10171,9770,9399,8669,8572,
+8670,8434,7749,10088,9750,9695,9946,11473,
+12264,9206,14658,14928,15095,14629,15231,15562,
+16785,16867,18375,19831,25122,25169,25286,25314,
+25425,25489,25525,25543,25395,25399,21993,19730,
+17763,19217,21762,21913,21826,19677,18888,17871,
+16636,15779,15631,14959,14723,14413,14144,14132,
+13961,13501,13383,12714,13018,12971,11993,11667,
+11651,11883,12637,13068,13850,14003,13607,14375,
+14287,14641,15036,15964,16643,17856,18562,18664,
+18848,18876,19315,19500,20773,20694,21336,21509,
+22283,22350,23119,23398,24910,25223,25223,25229,
+25542,25544,25544,25588,27852,27852,27831,27831,
+27976,28014,28059,28059,27972,27972,27897,27867,
+27793,27793,27753,27753,27946,27975,27930,27930,
+27848,27848,27826,27828,27860,27860,28034,28034,
+28277,28375,28617,28617,28884,28884,29083,29155,
+29314,29314,29470,29470,29570,29599,29643,29643,
+29648,29648,29684,29706,29774,29774,29855,29855,
+29915,29934,29972,29972,29986,29986,29990,29991,
+29994,29994,29985,29985,29950,29934,29897,29897,
+29827,29827,29730,25175,23101,22975,22053,21423,
+21794,22378,22456,22521,22654,22626,22547,22341,
+22302,22255,22354,22481,22579,22889,23138,23371,
+23800,23971,24111,24278,24323,24358,24381,24355,
+24302,24075,23950,23740,23535,23491,23569,24211,
+23342,23327,23646,23691,23784,23903,23809,23666,
+23171,22863,22588,21716,21290,21123,21447,21535,
+21560,21643,23391,23441,22700,22582,22165,21785,
+22245,19998,20067,20003,22225,21944,19545,18933,
+18536,18572,18487,18538,18516,18401,18145,18127,
+18212,18093,17990,17849,17732,17738,17666,17616,
+17618,17107,17348,17451,17159,17606,17542,17430,
+17238,17194,17130,16913,16750,16511,15839,15444,
+15059,14433,14003,13112,13776,11605,13593,13306,
+12557,12000,11310,12519,12276,10796,11042,11867,
+11120,11062,10784,9845,9490,9633,9725,9665,
+10084,9859,9726,9614,9326,9177,9024,8786,
+7864,6760,6795,7992,8097,7736,7474,6779,
+5772,5556,5415,6601,6755,5957,5802,6395,
+7351,7616,7476,7561,7295,7347,7209,6036,
+3913,3304,2522,2217,2140,1987,1926,1871,
+1822,1820,1802,1731,1816,2343,3534,3431,
+3221,2508,2765,2976,3136,3060,2817,2200,
+2106,2240,2693,2892,3131,3217,3160,3277,
+3229,3641,4910,6805,5438,5386,5362,5369,
+5504,5719,5890,5972,7704,6475,6542,8366,
+5676,5437,8260,8596,6153,7931,7722,7129,
+6252,5935,5947,5596,5152,4802,3951,3618,
+4414,3272,3312,3351,5359,5960,7213,4637,
+3047,2726,3123,3421,3209,2364,2007,1713,
+1177,959,989,2567,3303,3961,4183,3755,
+3886,2804,1989,2864,6416,4662,3258,1856,
+5048,4716,4188,1995,2049,6346,6819,7626,
+5501,5311,6052,7486,7371,7098,5052,5154,
+6379,6826,6262,5243,4419,6290,7965,7505,
+6774,6660,8260,8468,8552,8803,5542,4245,
+5182,8188,8848,8676,7632,8161,8066,9170,
+8871,9112,9212,9230,9250,9219,8611,9886,
+10196,10322,9744,8396,6998,7691,8533,9869,
+12215,11302,11826,11572,11465,11449,11251,11616,
+11966,12840,13018,13267,11048,9657,9348,11368,
+12124,13231,13708,13543,13304,12801,12671,12418,
+12284,12359,12246,12427,12448,12521,12689,12653,
+12493,12445,12885,12958,13087,13099,13003,12861,
+12817,12806,12873,12919,12960,13049,13287,13426,
+13750,14017,14258,14547,14580,14543,14235,13953,
+13622,12126,12049,12402,12943,13274,13196,13263,
+13015,13213,15019,16262,16774,17428,17492,17387,
+17121,16839,16693,16581,16532,16535,16638,16799,
+16822,16590,16231,13441,15310,15000,12639,10444,
+10217,11445,12416,15224,15144,13430,13422,13487,
+13484,13687,13673,13593,13858,13966,13781,13757,
+13823,14209,14394,14180,13402,13710,13974,13717,
+13778,13802,13710,13889,14185,14566,14555,14602,
+14654,14191,14465,14975,14863,14837,14895,14766,
+14527,14610,14491,14374,14265,14236,14154,13876,
+13893,13788,10435,10527,11484,13402,13399,13385,
+13198,12908,11512,10959,12004,11813,11098,10851,
+10809,9691,8229,7295,8012,7506,7186,7542,
+7398,7230,7445,7748,8003,8595,8781,8866,
+10667,7072,7301,8107,8420,8664,8907,8900,
+8840,8699,8654,8870,8810,8779,8742,8686,
+8679,8469,8439,8432,8451,8544,8597,8943,
+8800,9835,8638,8717,8924,9038,8942,8815,
+8711,8483,8384,8157,8268,8391,8471,8941,
+9303,9869,9578,9408,9130,8925,8967,9121,
+9627,9838,10015,10849,11235,12202,12956,13527,
+13640,13799,13054,13034,13080,13485,14142,13800,
+13851,13755,12617,13562,13504,12435,12722,12396,
+10831,10325,10392,9606,9288,9000,8504,8402,
+8357,9520,9080,8742,9154,9755,11086,10632,
+11623,12604,12938,13222,13722,14724,15671,16095,
+17770,17838,19839,20909,25049,25093,25164,25203,
+25273,25361,25448,25467,21963,21716,21691,21861,
+21642,21776,22058,21858,21589,19480,18759,17876,
+16738,16122,15724,14519,14006,13449,13777,13694,
+13574,13080,12734,11622,12359,12603,12828,12544,
+12362,12579,11355,11582,13085,12948,13009,12231,
+12643,13045,13484,14503,15143,16144,18149,18542,
+18617,18270,17655,17459,17159,16924,17593,18202,
+18689,19003,20423,20534,21729,21944,22130,22198,
+24637,24609,24513,24830,27627,27627,27639,27639,
+27767,27803,27858,27858,27771,27771,27711,27692,
+27658,27658,27638,27638,27650,27644,27604,27604,
+27535,27535,27570,27601,27721,27721,27906,27906,
+28086,28169,28403,28403,28730,28730,28944,29015,
+29155,29155,29331,29331,29478,29516,29561,29561,
+29515,29515,29525,29540,29604,29604,29691,29691,
+29760,29780,29811,29811,29803,29803,29810,29818,
+29846,29846,29863,29863,29843,29835,29814,29814,
+29794,29794,29702,29672,29616,24534,22975,22019,
+21265,21663,21833,21825,22018,22190,22234,22171,
+22115,22056,22066,22167,22174,22564,22674,22876,
+23215,23389,23558,23766,23854,23941,24088,24116,
+24024,23864,23815,23643,23341,23300,23216,23234,
+23174,23244,23232,23210,23275,23398,23413,23332,
+23015,22823,22637,22044,21713,21437,21327,21240,
+18702,20195,25601,25612,25609,25606,25572,24789,
+20303,20008,21583,21563,21701,21390,20585,20307,
+17983,17858,17480,17379,17175,17216,17519,17783,
+17533,17423,17543,17646,17575,17529,17546,17605,
+17653,17666,17281,17677,17294,17605,17268,16975,
+16889,16635,16506,16409,16458,16347,16043,15798,
+15507,14957,14492,13088,13761,13715,13390,13424,
+13269,11492,12246,10801,10434,11398,10446,11052,
+11132,11054,10905,10979,11005,10933,10339,9859,
+9400,8188,8115,8001,7678,7487,7304,7460,
+7088,7316,8339,8290,8214,7930,7709,7333,
+6406,5869,5502,6340,6516,5894,6025,6552,
+7361,7555,7776,7268,7062,7206,6971,5785,
+3731,3394,2510,2376,2354,2392,2201,2105,
+1933,1969,1951,1744,1752,2126,3303,3408,
+3306,2268,2304,2745,3455,3532,3317,2669,
+2631,2692,3002,3108,3037,2358,2152,2093,
+2292,2341,2200,5118,5132,5099,5234,5298,
+5518,5808,5894,5962,6000,6004,6145,6828,
+7882,8073,8330,5785,6204,7462,7314,6514,
+5419,5256,5234,5430,5025,4576,3566,3271,
+2907,2743,2765,2747,5159,6858,6687,5081,
+3514,4062,4967,5066,4222,2146,1727,1522,
+1279,987,815,1186,1816,2012,3184,3215,
+2613,1032,1903,5031,5149,2814,598,5350,
+4980,4891,2250,1903,4593,8070,7870,7503,
+7645,7488,7312,2694,2369,2786,8679,8534,
+8070,6775,6572,6410,5930,7160,8649,9089,
+9062,8896,8649,8596,8463,8073,6691,5989,
+8418,8904,8924,8210,8220,8299,9213,9333,
+9414,9496,9460,9789,8584,8551,9784,10147,
+10317,9708,7764,6918,7049,11119,11920,10897,
+11538,11643,11586,11316,10974,10245,10373,10523,
+11000,12075,12399,12451,12111,11744,11313,12951,
+12853,13512,13426,13083,12632,12329,12529,12311,
+11903,11460,11519,12124,12290,12406,12606,12560,
+12389,12667,12753,12801,12947,13006,12956,12875,
+12806,12749,12718,12735,12754,12787,12983,13071,
+13306,13587,13889,14434,14634,14772,14822,14701,
+14388,13452,12826,12693,12452,12646,12011,11626,
+11404,11882,12440,12823,12714,12723,12863,11843,
+11414,10412,13425,14461,14625,14851,14823,13459,
+15446,14925,14865,15175,15560,14864,14566,14150,
+13748,10861,12821,11955,11541,12821,13149,13503,
+13965,13962,13818,13006,12215,12542,12513,12495,
+12564,11746,11899,13321,13231,12872,12720,13064,
+13153,13551,13573,13758,13994,14206,14250,14391,
+14152,14252,14327,14583,14544,14545,14450,14495,
+14463,14234,14135,14045,13884,12219,13882,13769,
+13838,11172,13720,13338,12080,13615,13277,12749,
+10833,10429,10784,11513,11146,10687,9906,9955,
+9471,6902,7286,7661,8158,8287,8348,8305,
+8284,8329,8632,8821,9009,10484,11360,11391,
+11241,8761,8711,8715,8742,8761,8706,8642,
+8592,8591,8622,8877,8906,8917,8924,8949,
+8960,8963,8700,8671,8672,8757,9163,9106,
+10241,9338,9300,9331,9214,9123,8729,8597,
+8557,8638,8645,8662,8617,8589,8758,9178,
+9940,10636,10649,9806,9467,8885,8837,8947,
+9560,9863,10238,11211,11507,12660,13465,13805,
+13942,14226,14262,14222,13449,13234,13798,12588,
+10084,12438,13422,12232,13641,13137,12641,11511,
+10394,10026,9697,9036,8767,8529,8053,8794,
+8724,9057,9158,9435,10495,12007,12841,13095,
+13445,13639,14159,14415,14836,15280,16064,16140,
+17927,18108,20212,21202,25076,25111,25181,25218,
+25288,25374,25458,25477,22019,21823,21712,21961,
+21867,21983,22033,21624,21313,19065,18406,17800,
+16701,16398,15880,14713,14147,13732,13132,12496,
+12999,12411,12122,11835,11549,11877,11962,11924,
+11910,11484,11530,11581,11568,10634,11871,11778,
+11775,12162,12638,13786,14328,14684,16392,17364,
+17632,17666,17054,17282,17942,17986,18690,17745,
+17727,17924,19426,19639,21218,21613,21914,21976,
+24553,24528,24522,24746,27627,27627,27639,27639,
+27767,27803,27858,27858,27771,27771,27711,27692,
+27658,27658,27638,27638,27650,27644,27604,27604,
+27535,27535,27570,27601,27721,27721,27906,27906,
+28086,28169,28403,28403,28730,28730,28944,29015,
+29155,29155,29331,29331,29478,29516,29561,29561,
+29515,29515,29525,29540,29604,29604,29691,29691,
+29760,29780,29811,29811,29803,29803,29810,29818,
+29846,29846,29863,29863,29843,29835,29814,29814,
+29794,29794,29702,29672,29616,29616,24051,23069,
+22215,21025,20748,21162,21420,21518,21737,21966,
+22012,21986,21946,21965,22030,22250,22369,22517,
+22733,22778,23007,23323,23434,23512,23651,23572,
+23682,23595,23539,23362,22928,22864,22858,22936,
+22917,22902,22940,22986,22982,23166,23126,23098,
+23132,22999,22853,22435,22033,21751,21390,21200,
+20057,20804,25606,25616,25621,25623,25594,24970,
+21389,21058,22333,22289,22227,21911,21072,20799,
+18415,17728,17252,16581,16339,16159,16559,16728,
+16776,17017,17125,17195,17188,16970,16879,17299,
+17386,15685,17674,17639,17577,15847,16711,17223,
+16912,16756,16608,16305,16157,13664,15872,15726,
+15679,14812,15202,13630,13474,14240,14071,13643,
+13177,11650,11851,10721,10427,10624,10295,10413,
+11165,10985,11002,11694,11664,11266,10663,10364,
+8626,7978,7840,7703,7415,7279,7242,7326,
+7064,7400,8424,8407,8347,8097,7875,7564,
+6630,5944,5488,5770,5859,5824,6115,6637,
+7403,7720,7949,7737,7528,7671,7107,5535,
+3842,3569,2681,2300,2494,2932,2880,2631,
+2077,1982,1932,1860,1884,2050,3047,3456,
+3424,2168,1686,1522,2116,2680,2993,2912,
+2746,2635,2474,2359,2210,1906,1820,1806,
+2002,2158,2193,5022,5029,4997,5144,5153,
+5440,5733,5553,5468,6038,6269,6524,6729,
+6524,6318,6168,7297,7132,5307,5232,5913,
+4943,4723,4656,4953,4953,4672,3465,2893,
+2553,2368,2360,2477,4444,5560,5975,3911,
+2639,1937,4142,5132,4976,2733,1957,1532,
+1156,997,850,736,691,534,424,597,
+782,2454,4795,5323,2250,905,1219,3739,
+3733,2794,2152,2229,2084,3166,5150,6556,
+5924,2794,2605,3016,3171,7076,8102,7798,
+7105,6384,6541,6757,6495,7259,9180,9522,
+9415,9206,8454,8135,7330,8553,9082,9330,
+9390,9371,9364,8572,8130,8674,9503,9770,
+10065,10062,9903,10228,10074,8688,8879,9337,
+9123,8838,8476,8737,10347,10015,11687,11604,
+11908,11260,11285,11069,10879,10473,10246,9900,
+9733,10690,11441,11917,12459,12134,12443,12547,
+12424,12328,11826,11581,11648,11201,11344,11379,
+11465,10853,11264,11848,12435,12350,12449,12501,
+12545,12566,12556,12554,12593,12627,12656,12669,
+12654,12635,12612,12601,12577,12468,12414,12359,
+12354,12424,12517,13090,13040,12705,12647,12697,
+12707,12566,12469,12599,11808,11501,10942,10359,
+10259,9932,9393,9339,9174,9564,9953,10346,
+11346,11804,11949,11738,11737,11589,12016,12229,
+12434,12534,11652,11374,10498,9895,9440,10009,
+10083,8528,9317,9256,9528,9752,9903,10380,
+10902,13075,13457,13879,13176,13532,13338,13179,
+13210,12863,12682,12346,11550,10061,10192,10248,
+10935,11334,12074,12545,12843,12776,12694,12660,
+12791,12845,12838,12526,12639,12803,13204,13409,
+13311,12931,12668,11848,11659,11962,11299,8286,
+7950,8869,7209,7685,8018,7766,8898,7736,
+11478,7159,9331,9153,8896,8666,6997,5993,
+6094,7500,8220,9057,9210,9282,9645,10114,
+10719,10892,10588,10677,11249,11381,11330,10330,
+11037,10095,10886,10674,8998,8670,9778,9784,
+10327,10324,9745,9716,10182,10221,10379,10579,
+10950,10959,10636,10564,9231,9149,10398,10483,
+10734,11186,10855,10741,9791,9488,8838,8806,
+8684,8853,9054,9760,9575,9577,10071,10152,
+10976,11679,12287,12276,12200,10507,10152,9967,
+10223,11026,11304,13330,13601,13973,13649,14298,
+13983,14308,14570,15380,15285,14678,13590,12376,
+12589,12465,12319,12323,12247,10191,9844,9684,
+8954,8721,8626,8518,8454,8297,9691,9792,
+10002,10831,11458,11910,12494,12749,12930,13040,
+13076,13156,13625,14058,14750,16098,16595,17532,
+17773,18104,18966,19676,20835,21170,21838,22092,
+23078,23661,23929,24127,25489,25508,25521,22761,
+22591,22399,21861,20258,19684,18456,18112,17822,
+16869,16340,15668,14054,13116,12243,10670,10379,
+10299,11295,11058,10801,10314,8916,8649,10075,
+9791,8302,8288,8346,9251,9348,8656,10096,
+9945,11095,10530,11333,11619,11826,12424,12678,
+12995,13409,13588,14097,15328,15851,16430,16214,
+15792,15952,16466,16370,15633,16629,17806,18179,
+20499,20586,20503,21045,22221,22243,22229,22324,
+22488,23345,27467,27467,27467,27467,27441,27442,
+27469,27469,27507,27507,27558,27562,27534,27534,
+27440,27440,27460,27486,27597,27597,27767,27767,
+27936,28013,28227,28227,28524,28524,28712,28773,
+28889,28889,29078,29078,29259,29308,29373,29373,
+29329,29329,29327,29336,29379,29379,29463,29463,
+29539,29560,29593,29593,29592,29592,29598,29604,
+29626,29626,29655,29655,29666,29672,29693,29693,
+29719,29719,29683,29664,29603,29603,29529,29529,
+29437,22942,22505,21375,20543,20481,19745,20961,
+21177,21389,21575,21623,21640,21697,21749,21797,
+21972,22052,22173,22416,22580,22371,22814,22841,
+22855,22834,22878,22877,22862,22708,22699,22875,
+22784,22709,22645,22642,22672,22610,22549,22790,
+22458,22437,22454,22087,22579,27716,27656,27656,
+27559,27496,27276,27276,27077,27077,25613,25081,
+21608,20796,19741,19680,23499,23684,23163,23076,
+22528,22379,22464,22007,22275,22173,18424,18481,
+18208,17902,17867,18746,25289,25282,18471,17604,
+17567,17590,15837,15523,17199,17091,17121,18465,
+16622,14478,15389,16297,15994,15952,15194,14550,
+15907,15677,15353,14512,12872,14930,14714,13915,
+14196,13159,11776,11440,11133,11240,11660,11527,
+11949,12167,12224,12195,11965,11693,10686,9037,
+8164,8228,8926,8824,7402,7200,7230,7037,
+6982,7244,8573,8559,8492,8189,7962,7706,
+6522,6190,6080,6041,6049,5872,4817,4521,
+3916,4301,5718,7036,8478,8153,7521,7171,
+3430,3222,4276,3511,3456,3240,3536,3606,
+4181,4599,4768,2503,2285,3117,5411,6587,
+6934,6374,2591,1789,1451,1380,1377,2022,
+2158,1995,1892,1809,1741,1753,1824,1924,
+2176,2292,2218,2205,2370,2622,2928,3034,
+3637,5308,5311,5522,5606,5783,5739,6041,
+4797,4496,3613,3415,3544,3875,4148,4517,
+4846,4665,4425,3962,3804,3569,2586,1963,
+1706,1696,1763,1883,2523,4134,5764,6782,
+5511,3608,2014,3763,6057,4130,2733,2129,
+4521,4920,3613,1443,1573,1959,3409,4488,
+4174,3411,4127,4785,5881,5547,4075,4105,
+4487,4427,5293,5937,5182,3570,2773,2430,
+5422,7112,6834,5496,4180,3702,4242,4224,
+4128,6681,7580,7408,6923,6629,10464,11105,
+7609,7756,8206,9004,10169,13595,13323,10157,
+9414,9824,10473,10586,10620,10296,10339,10702,
+10938,11068,10909,10573,11223,11177,10507,9902,
+10859,11517,12444,12666,11811,11349,11629,11682,
+11204,10718,10090,9445,10063,9872,8367,7336,
+7053,7832,8436,9381,10222,10339,10267,10538,
+10284,10719,9936,9596,10523,10081,10484,10623,
+11142,11247,11560,12168,12178,12188,12264,12321,
+12384,12434,12437,12435,12461,12485,12507,12523,
+12511,12498,12492,12505,12519,12613,12593,12563,
+12337,12183,12119,12001,12161,11730,11467,11426,
+11377,11077,10890,10674,10219,9924,9395,8791,
+8648,8306,7958,7619,7426,7294,7346,7419,
+7277,6907,6334,4896,4475,4465,4657,4763,
+5793,5855,5729,5636,5409,5495,10587,12199,
+11238,11321,12360,12600,12485,12450,13354,13655,
+13717,13715,12323,11899,11806,11411,10536,11108,
+11162,11544,11686,11276,10481,9122,7387,7246,
+7745,8085,11809,11280,11016,10484,13228,10609,
+10891,10833,10424,10041,10029,10106,10242,10049,
+9634,9004,8379,8488,6807,7453,6910,6960,
+7264,7288,7108,7525,7055,4848,4473,4427,
+5749,7623,9373,9244,9095,8995,7584,6675,
+6522,7399,8031,8926,8929,8699,8509,8481,
+8679,8902,9246,9330,9379,9414,10452,10508,
+10447,10457,8368,8280,9337,9699,9326,9313,
+9874,9906,9332,9335,9892,9978,10185,10473,
+10671,10704,10522,10426,9136,9041,9174,9358,
+10810,10971,10709,10562,10620,9244,8810,8983,
+8715,9065,9455,10229,10827,10797,10765,11096,
+11753,11993,12678,12435,12864,11363,10861,10774,
+10783,11776,12133,12953,13199,13745,14385,14598,
+14940,15316,15582,15661,14773,13600,13035,12843,
+12580,12383,10230,8986,8623,8035,7995,7847,
+7831,7815,7859,9242,9295,9385,9855,10542,
+10959,11640,11981,12113,12112,12185,12332,12600,
+12797,12991,13551,13935,14539,15737,16541,17028,
+18307,18295,19267,19924,21054,21305,21931,22202,
+23190,23816,24081,24250,25497,25508,25521,25522,
+25526,25510,21631,20128,19180,18065,17880,17370,
+16215,15538,14802,13144,12192,11304,10554,10539,
+10749,10854,10667,10345,9685,8546,9377,8008,
+9413,9110,7897,8910,9255,8784,8864,8973,
+8759,9172,9644,10448,10813,10994,11537,11476,
+11312,11289,11408,11656,12473,13020,13596,14617,
+14856,15106,16641,16937,16402,16189,17009,17726,
+20291,20310,20116,20393,21734,21838,21832,21950,
+22129,23083,27467,27467,27467,27467,27441,27442,
+27469,27469,27507,27507,27558,27562,27534,27534,
+27440,27440,27460,27486,27597,27597,27767,27767,
+27936,28013,28227,28227,28524,28524,28712,28773,
+28889,28889,29078,29078,29259,29308,29373,29373,
+29329,29329,29327,29336,29379,29379,29463,29463,
+29539,29560,29593,29593,29592,29592,29598,29604,
+29626,29626,29655,29655,29666,29672,29693,29693,
+29719,29719,29683,29664,29603,29603,25588,24961,
+24525,29393,23026,22337,21560,21075,20619,20108,
+20696,20974,21224,21327,21432,21609,21639,21676,
+21791,21830,21833,22141,22282,22430,22686,22671,
+22776,22662,22669,22641,22613,22389,22450,22742,
+22764,22760,22668,22645,22647,22533,22399,22395,
+22393,22676,22814,27706,27716,27716,27656,27656,
+27559,27496,27276,27276,27077,27077,25622,25149,
+23927,23704,23276,23112,23679,23685,23089,22984,
+22310,20477,21907,21879,22371,22428,22288,22267,
+23303,23756,18451,19355,25324,25337,21612,20904,
+21794,21674,21056,17143,17340,17132,18571,16554,
+18076,16548,16052,15747,13261,13118,15644,15622,
+15672,12259,11634,11913,12872,14797,14834,14921,
+13876,13450,11299,11352,11230,11674,12207,12356,
+12558,12490,12706,12277,11939,11637,9387,9360,
+8393,9118,8945,8788,7270,7042,7009,6854,
+6915,7239,8658,8630,8524,8018,7529,7066,
+6444,6284,6262,6241,6212,6136,5529,4862,
+4290,3791,3379,3471,5244,6642,6014,7462,
+8089,8125,6791,6013,4799,3381,3341,2842,
+3186,4240,5253,5812,3156,2611,4530,5578,
+5710,3397,2232,1847,1505,1438,1412,1459,
+1528,1588,1834,1970,1905,1723,1710,1749,
+1784,1782,1770,1806,2020,2508,3095,3072,
+3021,3033,3160,3414,3518,3471,3812,3224,
+3205,3272,4076,3303,4126,3458,3421,3724,
+4346,4454,4333,3702,3360,3418,3398,2973,
+2049,1965,2078,2089,2351,3849,5881,7095,
+6484,4206,2240,3277,4851,4346,3250,2810,
+5290,5712,4594,2346,2038,2381,3321,3908,
+4231,2625,2645,3153,4561,3887,4732,5165,
+5493,5370,5331,4723,4249,3402,3208,4464,
+6644,6338,5612,3962,3850,3813,3645,3796,
+5336,8318,7869,6873,5938,5994,6183,6897,
+7660,7768,7237,7145,7060,8288,7088,7308,
+7730,8151,9260,11128,10275,10044,10285,10277,
+10340,10465,9333,9591,10717,10900,11029,11355,
+11874,12097,11893,11523,11230,10919,11495,10288,
+9079,8733,9175,9272,9584,9608,9420,9675,
+9812,9473,9037,8467,7759,8658,8877,8788,
+8849,9191,10581,10495,10430,10092,10444,10219,
+11492,11629,11799,12039,12078,12090,12111,12146,
+12192,12270,12273,12273,12300,12335,12373,12417,
+12414,12401,12393,12415,12517,12755,12879,12882,
+12873,12780,12739,12552,12550,12403,12475,12369,
+12272,10838,10317,9863,9175,8812,8470,7917,
+7704,7857,7214,7389,7270,7253,7150,6975,
+6409,6282,6101,5727,5432,5218,6549,6469,
+6053,7862,7974,8086,8386,8181,8061,7851,
+7119,8309,9036,9759,8765,9159,9630,9279,
+8139,8103,8313,8335,8261,8530,9208,9310,
+7077,10816,11253,11390,13575,13700,13775,13784,
+12129,11215,9599,9586,9591,9796,12396,9828,
+9140,8648,8351,8031,7845,7882,7343,7888,
+7846,7126,6292,5791,5848,5683,4882,6113,
+7132,7486,7366,7090,5680,4858,6334,8435,
+10080,10011,9884,10209,10732,10780,11087,10923,
+10211,9942,9049,8990,9003,6637,6660,6904,
+7112,7458,8701,8517,8015,7724,7773,7968,
+8877,8919,9910,9828,9303,9236,7672,7758,
+7895,8137,8612,8745,9689,9822,9815,10089,
+10477,10478,9156,8972,8937,9152,9352,9590,
+11172,11394,11323,10371,9553,9190,8773,8845,
+9832,9836,10296,11068,12279,11870,12032,12420,
+12651,12335,12726,13054,13057,12819,11744,11676,
+11939,12007,12665,13210,13406,14542,14772,14945,
+15166,15966,14696,15895,13917,13744,13680,13203,
+12572,10092,7642,6841,6664,6987,7370,7494,
+7543,7891,7389,9386,10622,10796,11378,11728,
+12044,12635,12708,12722,12556,12570,12667,12953,
+13128,13333,13821,14148,14473,15505,16035,16904,
+17720,18199,18603,19075,19819,20118,21903,22265,
+23132,23828,24220,24322,24585,24638,25113,25528,
+25544,25529,21778,21363,19437,18012,17266,16698,
+15409,14681,13938,12741,11967,11336,10752,10582,
+10443,10160,9867,9502,8910,8799,7774,9049,
+9013,7519,8575,8264,8060,6996,7046,7971,
+7828,8188,8541,9307,9577,10095,9879,9799,
+9759,9673,9866,10260,11164,11614,12052,12891,
+13142,13409,14689,15058,15470,14525,15329,16395,
+18079,18312,18255,18330,19219,19251,19707,19873,
+20148,21247,24438,24524,27382,27382,27406,27417,
+27441,27441,27482,27482,27574,27590,27582,27582,
+27443,27443,27397,27393,27423,27423,27574,27574,
+27799,27884,28087,28087,28295,28295,28430,28475,
+28567,28567,28754,28754,28952,29010,29108,29108,
+29122,29122,29131,29134,29150,29150,29220,29220,
+29306,29335,29392,29392,29438,29438,29445,29444,
+29431,29431,29448,29448,29477,29494,29545,29545,
+29620,29620,29621,29610,29556,29556,29492,29492,
+29419,29396,29361,23859,22617,22153,21586,20900,
+20520,20807,20880,20882,20985,21353,21409,21608,
+21753,21367,21833,22012,22132,21884,22535,24122,
+24177,22647,22565,22485,22364,22261,22316,22450,
+22514,22810,22809,22876,22907,22996,22886,22918,
+27854,27854,27807,27788,27734,27734,27664,27664,
+27563,27516,27382,27382,27159,27159,24789,24412,
+24374,24219,24879,24867,25192,25192,25090,25039,
+20595,20275,20069,19899,24456,24586,24399,24292,
+24557,24702,24963,24935,25319,25349,23203,22662,
+22648,22450,20841,20708,18827,18738,18565,18424,
+16527,17670,16163,15553,15446,13452,14016,14168,
+15265,12990,14913,14868,14658,15262,15422,14649,
+13591,12762,11171,11077,11051,12057,12103,12736,
+12730,13047,12864,12333,12033,11689,9996,10193,
+9644,9102,8237,7705,7136,6981,7101,6948,
+7304,8199,8644,8578,8444,7497,7005,6782,
+6602,6504,6482,6594,6641,6622,6307,6061,
+5809,8131,7715,3691,4463,5090,4978,7640,
+8284,8275,6869,5950,4785,2654,2650,2506,
+2405,2882,3360,6120,6572,6051,4680,4086,
+3697,5080,3831,2102,1699,1616,1588,1765,
+2157,2849,3639,3367,3127,3166,3248,3019,
+2767,2642,2441,2355,2696,3089,3317,3191,
+3137,3329,3603,3799,3601,3348,3196,3070,
+3049,3987,3351,3212,3135,2798,2670,2807,
+3726,4123,4256,3927,3685,4015,5576,4738,
+2276,2049,1993,2043,2703,4362,5984,7174,
+7522,5287,2504,3206,4353,3834,2835,2611,
+5213,5413,4175,2147,1708,1780,2403,2653,
+2640,2604,2766,2953,2783,2490,2354,2524,
+2840,3162,3373,3497,4693,6877,6747,6199,
+4455,8348,8890,4328,4200,3981,4733,6454,
+6592,7393,8583,8106,6218,6753,7166,7774,
+7957,8365,8089,8097,8178,8432,8575,8711,
+10149,10353,10364,10133,10807,11069,11703,11424,
+10999,10422,10123,10335,10074,10324,10256,10741,
+10872,11147,11635,11296,10981,9661,9005,8180,
+8789,9774,12356,12553,12610,12661,11236,11005,
+10613,10409,10215,9855,9939,9604,9474,9685,
+9481,10150,10576,10537,10554,9561,9324,11233,
+11779,11887,11961,11991,11965,11937,11930,11965,
+12013,12098,12111,12104,12090,12101,12123,12181,
+12203,12208,12249,12236,12305,12369,12447,12466,
+12730,12779,12897,13029,13091,13093,13356,13268,
+13218,12921,12383,10996,10265,9982,9716,9219,
+9004,9585,9477,9552,9767,9342,9234,9131,
+9165,9310,9471,9712,9851,9886,9994,9445,
+9480,8292,9187,8900,9129,9222,9087,7579,
+7931,8424,9478,9840,10042,10088,9924,9670,
+9238,9211,9389,14372,13402,13167,11869,11798,
+11527,11378,10989,11013,12281,12316,12204,12228,
+12335,12253,11956,11811,11441,11229,11185,11148,
+10916,10725,9766,10895,10858,10720,10154,6853,
+6878,6354,10747,11074,11453,10825,9088,12680,
+13641,12521,13687,13299,12311,14562,14063,12733,
+11794,11646,11596,11632,11840,11585,9113,9117,
+8045,5717,5908,6379,7183,7480,7526,7525,
+7430,7295,7004,6861,6722,6542,6521,6553,
+6767,7096,7510,7642,7465,7390,7386,7436,
+7563,7958,8212,9555,9819,9928,9954,10185,
+10566,10629,10864,10906,10966,11440,11426,11213,
+10071,9819,9612,9647,9874,10196,11659,12424,
+12587,13043,13114,13225,13350,13537,13518,13562,
+13398,13382,13483,12986,12915,13209,13092,12915,
+13280,13924,14128,14337,14455,14577,14397,14983,
+14997,15857,15835,15772,14927,13544,12608,11868,
+11433,10181,7423,8810,11077,11561,11697,11777,
+11526,11481,10182,12349,12506,12815,13012,12328,
+12859,15417,15366,15207,14799,14672,14421,14728,
+14852,15030,15442,15699,15920,16710,17363,17727,
+18749,18886,18930,19211,19635,20077,22342,22770,
+23472,23792,21692,21301,20203,20127,20206,25024,
+25294,25308,25461,20642,19041,17285,16498,15727,
+14200,13601,12907,11361,11148,10429,9142,9319,
+7864,7289,8455,8166,7939,6589,7875,7334,
+5908,5679,6422,5444,6679,6159,6246,6313,
+6419,6161,6679,6516,6637,6766,7095,7344,
+7671,8514,9028,9610,10761,11312,11826,12640,
+12830,12919,13081,13244,14038,14401,14700,15084,
+16081,16550,16386,17107,17809,17780,18091,18130,
+18321,19608,23424,23551,27306,27306,27352,27367,
+27395,27395,27442,27442,27542,27561,27559,27559,
+27413,27413,27348,27336,27341,27341,27486,27486,
+27714,27796,27978,27978,28149,28149,28267,28308,
+28395,28395,28581,28581,28782,28845,28962,28962,
+29013,29013,29035,29041,29048,29048,29115,29115,
+29206,29238,29304,29304,29367,29367,29376,29374,
+29351,29351,29365,29365,29401,29421,29481,29481,
+29572,29572,29587,29580,29533,29533,29474,29474,
+29413,29397,29383,29383,29320,29320,23940,29217,
+29170,29170,22154,21796,21562,21439,21570,21656,
+21750,21836,21818,21650,20640,21059,21930,22025,
+22162,22350,22513,28538,28615,28615,28555,28515,
+23355,28373,28225,28225,28118,28076,27971,27971,
+27889,27889,27829,27803,27733,27733,27657,27657,
+27557,27514,27401,27401,27183,27183,24965,24419,
+24577,24632,25607,25601,25646,25650,25653,25648,
+27001,27001,26144,25622,25579,25580,25540,25543,
+25029,24941,24770,24746,24318,24237,23281,22500,
+22379,22163,20177,19977,17693,17936,17678,16783,
+14331,17153,15494,14915,16057,15738,14951,14937,
+15128,14614,14465,14229,13914,14222,13772,12619,
+11453,11110,10882,11495,12186,12786,13127,13139,
+12880,12888,12367,11638,10920,9419,8515,7976,
+7723,7403,7285,7174,6975,7200,7450,6872,
+6809,6732,6439,6279,6165,6153,6146,6115,
+5882,5697,5497,5416,5644,6007,6064,8465,
+6243,5924,5674,5874,6393,5642,5275,4561,
+4981,4754,4888,5100,5588,4756,4714,4864,
+5050,4926,4689,4214,4575,4698,4664,4500,
+2856,3877,2346,2282,2261,2324,2489,3421,
+4006,4328,4153,3566,3515,5365,5349,4164,
+2167,2257,2629,4090,4552,4632,3886,3433,
+3195,3114,3066,2961,2485,2409,2413,2374,
+2347,2321,2509,2567,2549,2415,2402,2444,
+4143,4486,4149,4480,4624,4918,5710,4058,
+3105,2228,2266,2518,3755,4592,5538,7631,
+8559,7800,3888,2790,2875,4064,3424,2655,
+3408,4194,4441,4019,4288,3577,2993,3447,
+4050,5079,5526,5924,6279,6127,5738,5533,
+4854,5237,5064,6170,6907,8623,8855,8994,
+4189,4160,4205,5237,4422,4561,6055,7022,
+9229,8660,8644,8094,6487,6567,6538,7509,
+7731,7947,8563,8731,9011,9001,9246,9653,
+10271,11089,11465,12218,12523,12102,12743,12830,
+13738,13906,14186,14135,13871,13676,13291,12993,
+12931,12980,13181,13270,13202,12972,12879,12768,
+11612,11924,12373,12867,12680,11721,11365,10700,
+10613,9871,11762,11688,11658,11577,11462,11339,
+11380,11315,10602,10633,10843,11178,11333,11492,
+12153,12267,12312,12271,12159,12067,11863,11849,
+11868,11936,11957,11961,11947,11961,11995,12074,
+12103,12120,12113,12096,12084,12101,12129,12144,
+12258,12237,12270,12328,12374,12446,12777,12769,
+12881,12836,12810,12718,12398,12210,11337,10972,
+10725,10522,10159,9970,9838,9776,9734,9778,
+9866,9574,9590,9722,9686,9598,9373,9085,
+8852,8871,8983,9010,9111,9181,9406,11025,
+11576,11829,14172,14137,12175,11592,11396,11412,
+11925,12000,13630,13574,12727,12661,10772,10531,
+10040,9865,9869,9865,9775,9796,9903,10166,
+10566,10677,10825,10933,11439,11925,11344,11637,
+11767,11753,11744,11477,11577,11459,10903,10537,
+9935,10966,11224,11299,11201,11250,11505,12275,
+13312,13554,13671,12633,12232,11973,13678,13547,
+11070,10811,11352,11818,11655,11177,11613,11351,
+11073,7121,7395,7646,7738,7610,9426,6865,
+6678,6520,6455,6499,6544,6627,6674,6747,
+6859,6957,7128,7241,7269,7291,7453,7593,
+7812,8391,8708,8956,10163,10271,10258,10333,
+10225,10283,10721,10781,11044,11092,11189,9666,
+8990,8842,9043,9684,10041,10582,11904,12106,
+12904,13413,13523,13621,13812,13834,13916,13653,
+13413,13568,13429,13818,13747,13843,13672,13548,
+13730,13602,13569,13390,12813,13325,13139,12453,
+12609,12149,15374,15307,11528,11603,12021,12120,
+12046,11687,12106,11987,12065,12142,12249,11599,
+11705,11710,13268,13525,13695,13985,15256,15573,
+15029,16578,16444,16287,15840,14842,15723,15810,
+16086,16274,16519,16675,16730,17145,17447,17837,
+18644,18698,18779,19159,20127,20720,21959,22412,
+23526,23621,22856,20713,17005,19966,23605,20988,
+19807,20048,21359,18955,18240,16572,15845,14975,
+13489,12764,12221,11062,10332,9857,9071,8587,
+8589,8211,7952,7635,5712,7133,5433,5081,
+6278,6120,6020,4976,5543,4735,5270,4887,
+5732,5424,6007,5845,6266,6150,6560,6860,
+7250,8322,9019,9799,11335,11914,12354,12600,
+12646,12742,13024,12964,13311,14601,14920,13156,
+14515,15042,15492,15922,15331,15360,15370,15411,
+15539,16740,20461,20876,25412,25424,25450,25490,
+25567,25569,27225,27225,27323,27342,27346,27346,
+27218,27218,27136,27117,27103,27103,27227,27227,
+27392,27439,27509,27509,27583,27583,27674,27711,
+27799,27799,27987,27987,28187,28263,28446,28446,
+28651,28651,28735,28752,28749,28749,28815,28815,
+28927,28968,29059,29059,29149,29149,29172,29171,
+29143,29143,29158,29158,29206,29230,29304,29304,
+29422,29422,29467,29473,29455,29455,29422,29422,
+29407,29401,29384,29384,29342,29342,29313,29302,
+29277,29277,29216,23925,22935,29117,28990,22507,
+21743,22007,28883,21475,21595,22065,22096,21893,
+22014,22163,22342,22609,22960,28783,28699,28655,
+28521,28521,28283,28283,28156,28107,27994,27994,
+27894,27894,27812,27780,27702,27702,27603,27603,
+27510,27472,27373,27373,27214,27214,27145,27126,
+27101,27101,27114,27114,27122,27125,27128,27128,
+27117,27117,27074,27057,27016,27016,25633,25632,
+24966,24671,24033,23884,22648,22474,22352,21994,
+21472,21294,18802,19181,19572,16450,15663,17411,
+14963,14633,14734,14669,15439,14608,14391,14229,
+13850,13356,13365,13035,12616,12504,12878,11414,
+11135,11040,11126,12511,12705,13202,13193,13092,
+12850,12937,12509,11688,10861,9592,8919,8202,
+7681,7280,7154,7038,6779,6675,6941,6564,
+6424,6378,6271,6211,6181,8590,6406,6354,
+5909,5779,5708,5514,5573,5720,6053,6158,
+6240,6265,6250,6236,6602,6344,6393,6702,
+7363,8437,9452,9581,9476,8311,7195,6421,
+5158,5141,4715,4331,4089,4120,3778,3383,
+3320,2979,3112,2940,3178,3242,3243,3500,
+3880,4225,4473,4382,4171,3323,2784,2375,
+2127,2135,2325,4119,5306,6049,6172,5946,
+5734,5478,5414,5361,5273,5236,5190,3065,
+2649,2462,2464,2515,2506,2421,2415,2899,
+5102,2996,3352,4138,4440,5694,6796,6349,
+4683,3616,3036,2678,2813,2995,3684,6694,
+7404,7319,5054,4037,4785,5997,5639,4323,
+3172,3975,4673,4661,4497,4191,4009,4301,
+4473,4740,4828,5051,5579,5921,6043,6076,
+6028,5923,6995,7151,6769,7115,7186,7655,
+5065,4436,4714,4829,6193,7118,5289,5809,
+6442,6928,7109,6906,6452,5866,6130,6833,
+7683,8420,8340,8471,8636,8742,9205,9801,
+10742,10995,11224,11809,11967,12085,12334,12403,
+13495,13636,13592,13607,13489,13401,13514,13400,
+13309,13297,13259,13223,13138,12946,12810,12757,
+12736,12754,12802,12709,12557,12418,12143,12013,
+11925,11981,12084,12209,12321,12271,12166,11875,
+11740,11647,11527,11525,11689,11753,11771,11888,
+11988,12108,12170,12179,12092,12022,11830,11806,
+11806,11837,11847,11850,11852,11866,11894,11985,
+12031,12059,12064,12048,12033,12022,12042,12057,
+12177,12148,12158,12109,12093,12117,12435,12472,
+12561,12580,12593,12564,12441,12373,12586,12347,
+11884,11805,10424,10570,10460,10280,10219,10189,
+10206,10230,10256,11594,10946,10879,10948,10793,
+10488,10569,10780,10862,11072,11219,11552,12141,
+12616,12739,14602,14434,12529,11761,11479,11416,
+11823,11891,13643,13683,12799,12599,10817,10584,
+9939,9691,9715,9656,9566,9671,9878,10184,
+10490,10431,10669,11452,11900,12237,12169,12134,
+11833,11650,11388,11000,11087,11181,11157,11882,
+11845,11786,11739,11703,11326,10969,11092,11839,
+13083,12968,13545,13709,13523,13792,13580,13348,
+11741,11544,11557,11261,11375,11165,10805,10615,
+10498,7507,9992,10011,9450,9364,6462,5931,
+5884,5978,6447,6676,6813,7022,7083,7097,
+7057,7049,7049,7178,7257,7388,7774,8007,
+9162,9987,10193,10328,10419,10490,10449,10463,
+10321,10347,10731,10766,11008,10994,10998,10657,
+8719,8848,9240,9698,10203,10635,11940,12784,
+13020,13448,13540,13827,13974,14000,13947,13833,
+13814,13908,14174,14122,14314,14414,14430,14427,
+14214,14172,14076,13193,13802,12872,12018,12537,
+12357,11724,11968,12273,12540,12754,12807,12656,
+12539,12215,11686,11657,12187,12163,12093,13314,
+13707,13805,13973,14468,14675,14801,16170,16470,
+16796,17077,17029,17077,15183,16887,16821,16966,
+17161,17221,17256,17321,17320,17729,17990,18293,
+18822,18877,19381,20135,20893,21256,22288,22710,
+23722,23721,23174,22503,20216,21032,20979,24328,
+24859,24868,19526,18156,17481,15949,15193,14456,
+12906,12146,11467,10174,9518,8965,8216,7905,
+7977,6432,7069,5418,6320,4739,4574,5960,
+5575,4487,5259,4333,4126,3826,3848,4541,
+4918,5128,4906,5281,5470,5662,6142,6456,
+6857,8032,8832,9746,11517,12137,12561,13738,
+12316,11793,12177,12628,13199,15164,16459,15982,
+15856,15923,16026,16081,16060,14752,15146,15262,
+15372,16392,20405,20664,25384,25396,25420,25464,
+25553,25560,27225,27225,27323,27342,27346,27346,
+27218,27218,27136,27117,27103,27103,27227,27227,
+27392,27439,27509,27509,27583,27583,27674,27711,
+27799,27799,27987,27987,28187,28263,28446,28446,
+28651,28651,28735,28752,28749,28749,28815,28815,
+28927,28968,29059,29059,29149,29149,29172,29171,
+29143,29143,29158,29158,29206,29230,29304,29304,
+29422,29422,29467,29473,29455,29455,29422,29422,
+29407,29401,29384,29384,29342,29342,29313,29302,
+29277,29277,29216,29216,29155,29117,28990,28990,
+23979,22999,23105,28890,23406,28920,23090,22298,
+28908,22518,22650,23151,28783,28783,28699,28655,
+28521,28521,28283,28283,28156,28107,27994,27994,
+27894,27894,27812,27780,27702,27702,27603,27603,
+27510,27472,27373,27373,27214,27214,27145,27126,
+27101,27101,27114,27114,27122,27125,27128,27128,
+27117,27117,27074,27057,27016,27016,25631,25624,
+24822,24382,23497,23292,21797,21695,21623,21299,
+20764,20674,18913,18488,19261,18579,17713,17040,
+14241,14079,14840,14132,13913,14055,13362,13060,
+12911,12559,12434,12294,11990,11924,12044,11159,
+11055,11087,12892,13219,13319,13392,13278,12970,
+12430,12570,12225,11517,10424,9824,9733,8827,
+7924,7336,7240,7147,6904,6755,6675,6502,
+6325,6181,6132,6132,6173,6418,6377,8284,
+5840,5692,5591,5435,5438,5489,5625,5674,
+5690,5605,5523,5422,5299,5334,5427,5625,
+5668,5641,5992,6130,5858,4927,4723,4525,
+4437,4508,4564,4640,4508,4516,4380,4330,
+4248,4120,3801,3632,3338,3298,3257,3298,
+3452,3671,4039,4103,4083,3866,3691,3538,
+3223,3168,3329,4263,4642,4724,4254,3747,
+3155,2312,2162,2160,2242,2314,2430,2547,
+2552,2535,2528,2523,2518,2552,3049,5413,
+3632,2960,3001,3239,3449,6620,7095,6339,
+5464,5378,5273,4742,3525,3478,3961,5369,
+5634,5475,4448,4393,4714,4712,3943,3187,
+3235,3874,4371,5448,5229,5195,4242,3975,
+3858,3637,3512,3505,3756,3905,4068,4389,
+4482,4541,7644,7373,7324,4696,4727,5362,
+5722,5655,7007,7246,5889,5977,6307,6564,
+6798,6958,6775,6576,6487,6678,7064,8868,
+9107,9311,9503,9539,9548,10162,10348,10719,
+11155,11293,11107,11320,11490,11668,12776,13213,
+13291,13237,13136,13117,13052,13025,13204,13131,
+13021,12964,12860,12808,12749,12674,12577,12566,
+12529,12515,12544,12496,12430,12409,12409,12398,
+12388,12420,12423,12424,12369,12314,12258,12184,
+12178,12199,12190,12163,12235,11993,11842,11820,
+11668,11701,11738,11688,11615,11709,11702,11713,
+11704,11661,11639,11625,11621,11632,11651,11704,
+11737,11773,11853,11904,11957,12018,12023,12012,
+12014,11998,11965,11998,12165,12149,12246,12198,
+12063,11976,11984,11980,12011,12020,12092,12072,
+11980,11974,12032,12035,12180,12150,12085,12024,
+11701,11657,11579,11507,11354,11345,11857,11815,
+11313,11174,11132,11190,11703,11884,12422,13674,
+15293,15332,16114,16105,15856,15396,13585,13539,
+14674,14716,14690,14287,14054,14009,13013,12831,
+10901,10322,10213,10165,10222,10257,10193,10341,
+10356,10217,10523,10143,10415,10803,11716,11295,
+11657,11450,11776,11752,12595,12448,11919,11817,
+11988,11800,12014,11481,11923,11857,12186,11714,
+11601,10182,9885,10213,11796,12149,11832,12064,
+10657,10345,11334,11458,10980,10637,10182,8107,
+7773,6729,6542,6529,6694,6699,6770,6960,
+7094,7173,7435,7597,7756,7939,7912,7779,
+7278,7058,6932,7140,7408,7716,8398,9857,
+10029,10311,10350,10442,10854,10924,10936,10981,
+11152,11119,9795,10984,11090,11161,10991,10919,
+9329,9179,9081,9392,9923,10510,12465,12983,
+13597,14568,14936,15040,14176,14151,14446,15367,
+15584,15167,15471,15588,16344,15893,15507,15859,
+16080,16040,15869,15952,14367,15753,15802,14726,
+15533,15449,15011,14708,14658,14971,15093,15198,
+15182,15094,13427,12360,12042,13071,14424,14602,
+15160,16246,16594,15141,17159,17438,17752,17824,
+17978,18437,18630,18754,18810,18684,18719,18641,
+18621,18638,18753,18927,19167,19526,19284,19998,
+20491,20792,21283,21961,22524,22696,23037,23071,
+23239,23107,23321,23120,23019,22818,21291,18416,
+17090,16518,14550,14174,13570,12950,12473,11883,
+10686,9953,9253,7540,7114,7600,6058,5800,
+5545,5752,5742,4481,4201,5366,4740,4086,
+3928,3943,3601,3515,2885,3229,3141,3191,
+3195,3821,3822,4469,4757,5025,5265,5305,
+5308,5807,6329,7032,8792,9612,10134,10058,
+9626,9794,10378,11059,12053,13922,14424,14934,
+14359,14319,14498,15054,15137,15648,15171,15202,
+15204,15431,16840,17305,19577,19715,20084,20570,
+21282,21497,25433,25452,25439,25443,25440,25449,
+25459,25464,25477,25499,25536,25534,25643,25644,
+25644,25659,26781,26781,26795,26795,26914,26964,
+27092,27092,27251,27251,27380,27453,27684,27684,
+28119,28119,28312,28351,28351,28351,28432,28432,
+28574,28623,28730,28730,28816,28816,28859,28870,
+28879,28879,28920,28920,28982,29010,29090,29090,
+29210,29210,29273,29288,29299,29299,29304,29304,
+29311,29306,29278,29278,29211,29211,29174,29167,
+29160,29160,29124,29124,29066,29032,28924,28924,
+28914,28914,28942,28960,29016,29016,29036,29036,
+29014,29001,28953,28953,28826,28826,28728,28678,
+28527,28527,28341,28341,28182,28123,27979,27979,
+27829,27829,27699,27647,27517,27517,27394,27394,
+27321,27290,27206,27206,27091,27091,27128,27133,
+27126,27126,27121,27121,27113,27110,27101,27101,
+27064,27064,25083,24504,23015,22695,22051,21682,
+21826,16224,21382,15439,15043,14880,14710,15281,
+15369,15540,16138,16105,15600,14731,14282,14037,
+12830,12669,12526,12312,12263,12245,12129,12050,
+12006,11757,11678,11589,11516,11505,11674,11577,
+11418,11307,12877,13146,12892,12590,12353,12445,
+11864,11505,11079,9979,9981,9924,9841,9916,
+9276,8640,7520,7407,7184,7202,7160,7270,
+7059,6859,6743,6816,7019,7940,7857,6457,
+5905,5704,5532,5327,5311,5330,5419,5455,
+5456,5335,5194,5059,4392,4039,3814,3642,
+3622,3586,3446,3324,3222,3088,3107,3208,
+3453,3478,3407,3107,2983,3086,2868,2916,
+3046,3531,3840,4145,4577,4685,4745,4739,
+4699,4633,4435,4323,4214,4045,4024,4061,
+4248,4378,4510,4661,4622,4481,3809,3362,
+2965,2529,2467,2479,2662,2789,2917,3119,
+3163,3192,3216,3215,3201,3195,3212,3257,
+3258,3172,3024,2894,2994,3091,3818,3229,
+3226,3230,3309,3455,3967,4091,4004,3596,
+3614,3949,6954,9806,10833,10769,10024,9683,
+6197,5367,5122,6721,7701,6821,5851,5374,
+5227,7007,8014,8915,8530,7549,7624,8021,
+8023,7995,8572,7734,7632,7253,7291,7152,
+6866,6971,7076,7438,7336,7364,7349,7419,
+7531,7912,8325,8782,10868,11111,12207,12400,
+12120,12201,12439,12534,12554,12787,12757,12780,
+12883,12778,12702,12739,12713,12679,12584,12533,
+12558,12488,12385,12348,12404,12366,12294,12241,
+12251,12231,12184,12169,12168,12125,12037,12014,
+11995,11969,11944,11930,11926,11931,11936,11926,
+11909,11934,11977,12028,12287,12340,12377,12418,
+12434,12431,12392,12363,12426,12210,11955,12078,
+12018,11963,11919,11947,11845,11873,11752,11715,
+11670,11595,11579,11576,11594,11603,11605,11599,
+11602,11618,11701,11761,11825,11960,12006,12033,
+12072,12071,12037,12061,12221,12206,12304,12256,
+12118,12014,12008,11986,11970,11957,12011,11981,
+11895,11901,11989,12010,12174,12188,12151,12123,
+11867,11850,11789,11714,11543,11507,11944,11870,
+11333,11118,11038,11052,11478,11610,12092,12811,
+14632,14677,15692,15741,15548,15216,13603,13255,
+14525,14539,14462,14072,14048,13902,12843,12933,
+11472,10747,10518,10463,10459,10228,10154,10275,
+10054,10123,10061,10576,10742,10782,11191,11486,
+11722,11652,11389,11401,11952,12139,12494,12406,
+12251,12400,12372,11884,11656,11713,11548,8318,
+7691,8032,9189,9360,9042,9143,9216,11053,
+10232,10054,9482,7985,6300,6444,6590,6656,
+6791,6712,6613,6552,6701,7343,7482,6931,
+7020,7169,7434,7611,7840,8186,8427,8795,
+9784,7616,7257,7317,7533,7814,8506,9978,
+10162,10465,10513,10593,11049,10969,10878,10779,
+10887,9576,9469,9602,9861,10415,11356,11386,
+11265,10177,10736,11940,11921,12352,13270,13688,
+14243,15064,15499,15528,14280,14135,14362,14761,
+15573,15657,15700,15852,16492,16518,17004,16899,
+16831,16448,15760,15634,15612,15614,16504,16464,
+16301,15813,15432,13965,14203,14387,15465,15303,
+15150,15374,15379,15872,17096,16882,17030,16716,
+16472,17499,17696,18068,18163,18369,18353,18532,
+18601,18284,19386,19445,19484,19404,19421,19446,
+19474,19638,19945,20148,20318,20489,20610,20842,
+21202,21431,21834,22313,22809,22925,23059,22918,
+22972,21305,20980,20847,22139,19348,18330,16385,
+15608,14785,13181,12548,11721,11585,10962,10440,
+9503,9128,8840,7740,7410,6963,6614,6324,
+5926,4361,5000,4744,4448,3454,4055,3454,
+3509,2458,2996,2339,2856,2424,2818,2843,
+3055,3215,3526,4165,4440,4729,5089,5208,
+5349,5796,6296,6985,8792,9690,10338,10487,
+10606,10769,10198,10564,10988,12263,12780,13183,
+13813,14155,14571,14882,15608,15797,14915,14887,
+14879,15185,16767,17131,19181,19368,19658,20056,
+21122,21286,25421,25432,25410,25401,25398,25407,
+25424,25432,25449,25474,25518,25525,25643,25642,
+25640,25656,26781,26781,26795,26795,26914,26964,
+27092,27092,27251,27251,27380,27453,27684,27684,
+28119,28119,28312,28351,28351,28351,28432,28432,
+28574,28623,28730,28730,28816,28816,28859,28870,
+28879,28879,28920,28920,28982,29010,29090,29090,
+29210,29210,29273,29288,29299,29299,29304,29304,
+29311,29306,29278,29278,29211,29211,29174,29167,
+29160,29160,29124,29124,29066,29032,28924,28924,
+28914,28914,28942,28960,29016,29016,29036,29036,
+29014,29001,28953,28953,28826,28826,28728,28678,
+28527,28527,28341,28341,28182,28123,27979,27979,
+27829,27829,27699,27647,27517,27517,27394,27394,
+27321,27290,27206,27206,27091,27091,27128,27133,
+27126,27126,27121,27121,27113,27110,27101,27101,
+27064,27064,24812,24031,22146,21804,21057,16401,
+15715,14387,14012,14014,13555,13201,12945,16043,
+14215,14591,15528,15166,14886,14145,13911,13356,
+12243,12141,12048,11889,11836,11878,11834,11775,
+11666,11511,11420,11378,11390,11443,11684,11961,
+12140,11663,12694,12526,11990,11326,10787,10755,
+10645,10505,10834,10159,10013,9811,10299,9909,
+9368,7913,7649,7496,7250,7246,7385,7599,
+7507,7326,7169,7994,8147,6879,7961,6579,
+6251,6106,5984,5429,5380,5356,5354,5359,
+5364,5323,5271,5201,5040,4968,4926,4892,
+4781,4622,4257,4071,3915,3993,3706,3657,
+3561,3497,3440,3375,3373,3396,3752,3532,
+3448,4138,4961,5916,3680,3958,4219,4548,
+4604,4614,4489,4389,4232,3829,3662,3558,
+3622,3762,3924,4085,4002,3746,2918,2643,
+2512,2489,2565,2695,3023,3174,3266,3296,
+3257,3245,3235,3227,3209,3181,3220,3287,
+3413,3430,3422,3500,3591,3675,3654,3546,
+3422,3280,3276,3317,3372,3412,3446,3488,
+4324,5849,9582,9396,10809,10784,10269,10166,
+9087,8067,8682,8831,8962,9092,9311,9404,
+9499,9721,9845,9963,10299,10293,10272,8587,
+8459,8572,8049,7882,7762,7545,7558,7565,
+7492,7551,10585,10577,8814,8287,7970,8105,
+8312,9017,10842,11740,12074,12213,12605,12665,
+12346,12391,12590,12666,12684,12643,12677,12687,
+12661,12674,12571,12441,12363,12286,12125,12088,
+12132,12108,12013,11982,12038,12000,11946,11931,
+11969,11973,11957,11942,11932,11871,11780,11765,
+11789,11789,11788,11798,11793,11793,11789,11784,
+11778,11841,11905,11969,12225,12259,12267,12244,
+12238,12229,12244,12274,12415,12400,12273,12194,
+12312,12283,12220,12211,12197,12175,12034,11972,
+11857,11693,11552,11558,11585,11589,11581,11539,
+11518,11510,11549,11597,11694,11872,11986,12052,
+12336,12403,12925,12984,12917,12883,12809,12755,
+12675,12573,12544,12500,11950,11911,11847,11808,
+11855,11864,11877,11891,11964,11962,11963,11958,
+11871,11923,12257,12609,13055,13017,12877,12831,
+12243,11838,11268,11199,10966,11000,11143,11427,
+11841,11924,12740,12916,12684,12722,12049,12060,
+12023,12410,12128,11816,11687,11429,11702,11845,
+11174,10905,10093,10128,10537,10169,10362,10873,
+9920,9864,10421,10462,10571,10644,10809,10559,
+11326,11250,11592,11831,12072,12220,12147,11698,
+11456,11511,11921,11258,11265,9482,8366,7830,
+6914,7296,8390,7888,8056,8446,8881,9258,
+10124,10022,10286,8986,7906,7345,6876,6841,
+6792,6823,6778,6839,7342,7324,7371,7794,
+7651,7613,7270,7301,7482,7935,8231,9461,
+7989,7790,7437,7716,7882,8160,9624,9844,
+10314,10697,11224,11346,11755,11746,10875,9272,
+9159,9120,9265,9497,9780,10336,10581,12012,
+11780,11890,11366,11744,12785,13106,13781,14127,
+15337,15429,15826,15842,14534,14398,14421,15784,
+15910,16069,15925,16793,17643,16983,16993,16836,
+16096,16129,16169,16485,16652,17438,17661,17495,
+16951,16840,15737,16246,14423,14801,14702,15077,
+15328,15700,17907,18372,18468,18778,18775,18749,
+18083,17945,18022,19445,19575,19673,19854,19921,
+19550,19452,20140,20180,20246,20220,20326,20472,
+20579,20692,20991,21110,21120,21327,21407,21511,
+21691,21799,22183,22581,22665,22648,22555,22344,
+22274,20789,20516,20073,19809,16700,16135,14914,
+14172,13708,12355,11491,10979,10582,10096,9589,
+8768,8515,7980,7057,6233,6109,5720,5529,
+5628,4753,4607,3571,3784,3772,2768,2932,
+2689,1929,2337,2161,1632,1740,1899,2124,
+2683,2973,3242,3768,4046,4365,5007,5276,
+5575,6248,6695,7267,8717,9412,10003,10616,
+10594,9629,10236,10019,10321,11340,11945,12499,
+13586,13741,14029,14638,15060,15169,15879,16086,
+16072,16436,17350,17687,17150,17249,17407,18038,
+18997,19412,22642,22755,22841,22870,22848,22910,
+25406,25414,25444,25465,25481,25487,25544,25549,
+25549,25551,25545,25548,25581,25584,25628,25640,
+25645,25645,25632,25628,25648,25657,27251,27251,
+27645,27645,27824,27865,27887,27887,28012,28012,
+28170,28228,28365,28365,28521,28521,28608,28632,
+28668,28668,28720,28720,28782,28809,28886,28886,
+29006,29006,29069,29084,29096,29096,29096,29096,
+29084,29059,28950,28950,28715,28715,28622,28616,
+28678,28678,28776,28776,28788,28784,28752,28752,
+28741,28741,28771,28789,28849,28849,28871,28871,
+28854,28843,28802,28802,28720,28720,28624,28576,
+28430,28430,28246,28246,28090,28025,27861,27861,
+27667,27667,27533,27485,27381,27381,25694,25692,
+25694,25692,25691,25692,26965,26965,27012,27026,
+27043,27043,27059,27059,27063,27061,27048,27048,
+25641,25632,23628,22637,22106,21732,21111,20773,
+20062,14426,14511,14492,12400,12265,12494,14638,
+14623,14790,15068,14917,13706,12769,12039,11965,
+11791,12076,11850,11642,11591,11529,11424,11397,
+11389,11374,11488,11479,11563,11602,11915,12025,
+12254,12032,11923,11645,11339,10125,10012,9926,
+10196,10682,11104,11293,10596,10469,10180,10271,
+9597,9106,9046,8947,8959,8991,9011,8960,
+9000,8561,8417,8301,8459,6542,6346,6215,
+6106,6079,6041,5907,5363,5222,4938,4844,
+4790,4764,4785,4821,4874,4860,4812,4620,
+4487,4349,4132,4059,4019,3998,3956,3928,
+3826,3771,3725,3682,3677,3680,3700,3812,
+3731,3521,3714,3477,3220,3233,3360,3810,
+4039,4231,4442,4500,4478,4172,4056,3883,
+3870,3904,3985,3991,3855,3585,2960,2823,
+2777,2971,3171,3363,3620,3689,3682,3428,
+3385,3393,3470,3517,3560,3646,3702,3747,
+3751,3736,3744,3741,3732,3719,3715,3743,
+3821,3904,3941,3963,4017,9871,4221,4718,
+6072,10336,10777,10476,9877,9798,9670,9641,
+9457,9521,9620,9877,9994,10092,10279,10327,
+10334,11563,10802,10882,11098,11081,10919,9260,
+9089,8860,8389,8233,8042,7978,7959,7952,
+8261,8490,8797,10977,10224,10097,9983,10149,
+10184,10882,11890,12113,12309,12397,12475,12513,
+12434,12349,12469,12505,12511,12487,12493,12464,
+12389,12348,12272,12132,12039,11963,11819,11799,
+11848,11838,11791,11755,11735,11710,11694,11705,
+11717,11720,11600,11586,11647,11645,11638,11650,
+11686,11694,11696,11686,11677,11673,11581,11587,
+11596,11631,11725,11751,11964,11975,11986,11997,
+12016,12041,12126,12185,12372,12429,12373,12347,
+12209,12213,12180,12152,12152,12133,12066,12035,
+11969,11841,11513,11473,11416,11403,11401,11425,
+11518,11537,11652,11653,11685,11672,11632,11657,
+11855,11927,12555,12762,12780,12782,12741,12708,
+12655,12582,12558,12510,11837,11783,11685,11640,
+11715,11731,11757,11776,11830,11818,11821,11804,
+11718,11745,12043,12511,12924,12913,12710,12539,
+12207,11861,11246,11165,10786,10735,10722,10688,
+10662,10680,11282,11283,11279,11210,11050,11010,
+11024,10999,11008,10851,10553,10551,10642,10652,
+10609,10749,10307,10342,10577,10569,10636,10563,
+10199,10167,10005,9971,10657,10605,10047,10031,
+10791,11486,10879,11068,11522,12020,11281,11389,
+11649,11765,11142,11532,10632,10590,10945,8824,
+9052,8707,8370,7858,7817,8145,8327,8507,
+8922,9163,9170,9881,9882,9878,8241,8424,
+8149,8036,8105,8657,9438,9170,8903,8930,
+9750,9972,10283,9758,9535,9751,9596,9643,
+8184,8199,7946,8040,8184,8406,9657,9810,
+10228,10513,11124,9328,9863,11423,10712,9037,
+9093,9223,9726,10031,10417,12452,11741,12974,
+11825,11581,11660,11986,12174,12555,13351,13851,
+14197,16351,16954,17070,16733,15528,15210,15712,
+15949,16251,16899,17570,17917,16820,17031,16241,
+15228,15071,15262,15923,16314,16591,17014,17810,
+17238,17041,16884,17245,17068,17205,17491,19431,
+19800,20078,20456,20590,20583,20022,20076,20747,
+20547,21117,21253,21459,21523,21555,21585,21568,
+21551,21507,21508,21518,21595,21634,21725,21803,
+21814,21825,21821,21806,21713,21694,21691,21697,
+21507,21102,21748,21202,21644,21573,21519,21243,
+21124,20706,19630,17912,16046,15132,14369,13158,
+12728,12042,11263,10807,10321,9319,8842,8401,
+7549,7125,6685,5777,5320,4965,4712,4462,
+4162,3683,3193,3194,2987,2731,2512,2316,
+1911,1827,1674,1596,1808,1676,1840,2050,
+2450,2599,2730,3100,3268,3494,4092,4442,
+4811,5603,5871,6190,6841,7232,7659,8590,
+9152,9644,10567,10952,11262,11696,12579,12283,
+12808,13081,13371,14787,15598,16408,17105,17286,
+17130,17289,17424,17408,17378,17695,18149,18699,
+19346,19129,21545,21479,21639,21588,21657,21716,
+24004,24054,24376,24489,24543,24567,24645,24686,
+25107,25476,25454,25466,25016,25012,25244,25316,
+25345,25366,25318,25350,25424,25457,25583,25585,
+25549,25549,25545,25559,25574,25591,27828,27828,
+27989,28052,28207,28207,28404,28404,28512,28543,
+28586,28586,28641,28641,28700,28727,28802,28802,
+28921,28921,28983,28997,29004,29004,28986,28986,
+28958,28923,28776,28776,25643,25639,25663,25699,
+25700,25707,28582,28582,28632,28640,28635,28635,
+28626,28626,28658,28675,28735,28735,28756,28756,
+28742,28732,28697,28697,28632,28632,28543,28498,
+28360,28360,28179,28179,28027,27963,27797,27797,
+27591,27591,27461,27418,27330,27330,25695,25693,
+25693,25686,25688,25688,26922,26922,26967,26982,
+27008,27008,27035,27035,27044,27043,27030,27030,
+25630,25621,23348,22547,22391,22223,21396,21099,
+20352,15631,14828,13837,13685,13494,13453,13114,
+13778,13880,14396,14731,13970,12632,11829,11604,
+11362,11322,11305,11308,11318,11324,11347,11363,
+11456,11547,11743,11897,11951,12008,12222,12174,
+11993,11827,11696,11556,10155,11341,11323,11319,
+11032,11154,11895,11647,10710,10490,11015,10874,
+10263,10059,10026,9972,9981,9924,10021,9465,
+9296,9119,7949,7294,6775,6454,6332,6385,
+6511,6497,6474,6408,6350,6270,5706,5604,
+5523,5278,5131,4976,4687,4537,4407,4253,
+4227,4215,4287,4293,4249,3924,3769,3688,
+3630,4246,5503,6227,5868,5270,3308,3198,
+3172,3239,3299,3355,3747,4367,4215,3064,
+3021,3023,3180,3328,3503,3831,3954,4035,
+4075,4012,3899,3585,3433,3316,3248,3280,
+3355,3594,3710,3788,3787,3729,3673,3635,
+3700,3825,4291,4552,4766,4969,4995,4981,
+4972,5003,5132,5340,5227,5343,5040,5005,
+4958,4901,5007,5194,5754,6131,6601,7477,
+7846,8374,11137,11145,10580,10543,10472,10494,
+10584,10659,10753,11068,12293,11369,11646,11723,
+11724,12067,11952,12039,12348,12309,12104,11923,
+11912,11818,11675,11611,11569,11538,11535,11546,
+11549,11665,11646,11810,11877,11935,12166,12196,
+12223,12291,12206,12240,12297,12274,12215,12090,
+11983,11953,11895,11880,11851,11809,11844,11789,
+11706,11661,11619,11567,11528,11521,11450,11443,
+11473,11442,11426,11423,11485,11514,11549,11575,
+11552,11528,11384,11373,11447,11515,11548,11571,
+11570,11545,11510,11449,11434,11435,11378,11398,
+11415,11434,11484,11500,11732,11768,11809,11860,
+11874,11874,11860,11867,12017,12090,12097,12127,
+12243,12233,12210,12134,12101,12075,11980,11968,
+11727,11640,11603,11565,11443,11419,11455,11472,
+11503,11513,11510,11503,11459,11420,11401,11408,
+11507,11551,11594,11783,12234,12253,12324,12311,
+12224,12174,12178,12138,11645,11600,11539,11475,
+11458,11457,11539,11550,11603,11632,11694,11689,
+11734,11730,11730,11665,11551,11510,11423,11371,
+11303,11180,10936,10921,11074,11051,11077,10962,
+10685,10653,10750,10724,10713,10664,10591,10562,
+10414,10368,10305,10228,10215,10202,10218,10200,
+10140,10081,10110,10095,10102,10132,10136,10147,
+10161,10174,10091,9949,9890,9878,9832,9866,
+9872,9922,9958,10134,11292,11879,11186,11270,
+11490,11345,11467,11587,11424,10974,10499,8813,
+8875,8913,8542,8269,8163,8393,8486,8476,
+8393,8437,8450,8517,8545,8569,8767,9857,
+9862,9439,9427,9783,9860,9884,9772,9869,
+9915,9986,10382,10356,10429,10421,10611,10775,
+9086,9426,8734,10011,8925,8805,9901,10042,
+10014,10245,10500,10554,10610,10565,10452,8894,
+8970,9072,9639,10073,10911,12592,12913,12793,
+13277,11346,11664,11799,11828,12101,12697,13318,
+13683,15717,16342,16617,16412,16161,14673,14487,
+14648,15799,16139,16467,17433,17562,16625,16324,
+16167,15746,15887,15770,16021,16257,15323,15299,
+15460,14263,14705,15676,16732,17213,17790,20157,
+20549,20799,20894,20815,20529,20282,20802,20894,
+21140,20771,21312,21311,20787,21250,21235,21257,
+21342,21417,21396,21258,21426,21219,21397,21488,
+21508,21484,21325,20870,20663,20416,20114,20030,
+20115,20626,20945,20690,19948,19392,19751,19322,
+18978,19019,16631,16162,14153,13442,12737,11620,
+11144,10714,10231,10054,9807,9066,8520,8174,
+7460,7071,6648,5672,5158,4670,3888,3639,
+3454,3230,3370,2877,2564,2353,2208,1935,
+1856,1810,1830,1833,1865,1893,1955,2056,
+2311,2432,2554,2859,3063,3266,3784,4094,
+4441,5209,5589,5967,6725,7140,7570,8654,
+9241,9815,10724,11198,11569,11765,11922,12085,
+12425,12494,12717,13371,15643,16128,17220,17456,
+17842,18019,17291,17112,17600,17799,17963,18226,
+18225,18093,18212,17991,18495,18480,18784,18935,
+21222,21352,22513,22879,22984,23051,23151,23206,
+24327,25412,25437,25444,24238,24277,24303,24446,
+24516,24596,24612,24683,24792,24794,25004,24897,
+24217,24205,24143,24245,24379,24669,25642,25641,
+27466,27545,27769,27769,28118,28118,28293,28340,
+28397,28397,28452,28452,28492,28512,28577,28577,
+28695,28695,28754,28757,28721,28721,28594,28594,
+28494,28422,28164,28164,24244,24198,24064,24330,
+25128,25239,27872,27872,28053,28099,28144,28144,
+28145,28145,28185,28204,28256,28256,28260,28260,
+28259,28257,28248,28248,28216,28216,28176,28149,
+28053,28053,27895,27895,27766,27711,27562,27562,
+25700,25695,25698,25697,27221,27221,27184,27184,
+27123,27091,25691,25691,25695,25695,26860,26874,
+26923,26923,26977,26977,27000,27004,27006,27006,
+27007,27007,24688,24136,23289,23193,22186,21966,
+21103,20355,19484,14632,13814,13613,13376,13194,
+11383,13865,13132,13455,13308,12711,12071,11907,
+11653,11603,11602,11723,11878,11926,12132,12149,
+12149,12158,12170,12140,12340,12321,12449,12502,
+12155,12023,11356,11219,11758,11522,11639,11239,
+12202,12239,12075,11581,10863,10797,10746,10673,
+11119,11070,10424,10399,10404,10384,10134,9975,
+9899,9894,8661,8190,7829,7682,7555,7491,
+7333,7192,7037,6742,6570,6468,5594,5417,
+5231,4871,4695,4530,4293,4221,4194,4145,
+4084,3990,3656,3496,3400,3327,3303,3299,
+3367,3528,3757,4091,4100,4040,3759,3623,
+3516,3394,3358,3331,3225,3150,3055,2909,
+2884,2919,3128,3333,4233,6497,7005,7111,
+6843,5135,4205,3981,4001,4015,4095,4153,
+4224,4362,4417,4453,4470,4484,5360,5496,
+5582,5695,6417,6943,7408,8954,9144,9294,
+9540,9614,9727,9950,10066,10127,10121,9524,
+8701,7329,7608,8086,8808,8926,9145,9696,
+9970,11087,11515,11551,11429,11471,11309,11347,
+11413,11509,11449,12444,12411,12000,12112,12148,
+12197,12342,12406,12411,12484,12434,12373,12155,
+11908,11822,11737,11682,11649,11605,11282,11593,
+11682,11736,11886,11924,11871,11896,11959,11954,
+12010,12048,12032,12045,12004,11973,11849,11765,
+11723,11687,11622,11598,11572,11520,11494,11474,
+11541,11525,11517,11464,11367,11352,11321,11304,
+11290,11275,11278,11289,11409,11426,11461,11442,
+11390,11365,11255,11254,11327,11393,11412,11426,
+11439,11427,11419,11418,11422,11441,11461,11459,
+11373,11339,11329,11330,11439,11467,11496,11526,
+11529,11525,11539,11566,11684,11871,12137,12188,
+12057,12049,12034,11995,11980,11968,11892,11884,
+11644,11571,11550,11532,11447,11433,11470,11460,
+11466,11453,11416,11404,11365,11353,11346,11359,
+11444,11472,11495,11653,12102,12125,12213,12208,
+12125,12074,12079,12043,11575,11551,11514,11483,
+11469,11463,11512,11504,11541,11551,11613,11609,
+11655,11647,11643,11574,11465,11436,11386,11353,
+11303,11201,10961,10948,11114,11100,11136,11041,
+10767,10729,10800,10760,10737,10683,10622,10610,
+10502,10470,10415,10334,10312,10294,10328,10337,
+10309,10304,10328,10297,10231,10200,10154,10136,
+10127,10131,10142,10136,10133,10113,10086,10078,
+9961,9952,9947,10082,11137,11402,10891,10994,
+11086,11250,11214,11276,11052,11212,11585,11137,
+9219,8924,8175,8424,8584,8705,8700,8628,
+8389,8291,8581,8231,8414,8543,8999,9298,
+9602,10384,10174,10217,10298,10244,10045,9900,
+9842,9817,10170,10148,10243,10316,10477,10549,
+9509,9278,9936,8870,8894,8902,9648,9783,
+9760,10082,10409,10525,10654,10618,9169,8778,
+8816,8843,9503,9857,10392,11728,12822,12872,
+12900,11505,11200,10878,10792,10842,11401,11883,
+12590,14203,14802,16399,15999,16735,15683,15026,
+13642,15677,14616,15180,16734,18297,18397,18423,
+18184,16261,17015,16556,16505,16553,16803,16323,
+16042,15790,16840,17116,18537,19041,19594,20474,
+20672,20736,20365,20687,20643,20525,20335,20842,
+21004,21031,21000,20600,20875,20819,20753,20764,
+20731,20954,20899,20564,20439,20311,20220,20662,
+20665,20595,20310,19835,19634,19366,19137,18987,
+19724,19665,20026,19647,18468,17954,17453,17190,
+16786,15957,15615,14888,12741,12154,11444,10512,
+9434,9186,8820,8899,8690,8259,7703,7494,
+6979,6657,6278,5354,4860,4358,3540,3233,
+3021,3095,3059,2874,2607,2025,1863,1852,
+1528,1479,1602,1576,1601,1657,1700,1780,
+2022,2161,2304,2634,2882,3143,3701,4003,
+4291,4908,5223,5617,6281,6577,6918,7690,
+8224,8801,10032,10553,10997,11590,11757,12744,
+12104,12216,12350,12632,12974,13949,16047,16798,
+17691,18534,17919,17895,17525,17540,17511,17621,
+17435,17214,17527,17602,17946,17811,18131,18238,
+20831,20885,22221,22580,22688,22753,22862,22887,
+24144,25379,25406,25411,24131,24216,24255,24425,
+24514,24586,24741,24831,24928,24993,25084,25070,
+24472,24115,23888,24063,24186,24546,25627,25622,
+27466,27545,27769,27769,28118,28118,28293,28340,
+28397,28397,28452,28452,28492,28512,28577,28577,
+28695,28695,28754,28757,28721,28721,28594,28594,
+28494,28422,28164,28164,24162,23841,23512,23779,
+24847,24929,27872,27872,28053,28099,28144,28144,
+28145,28145,28185,28204,28256,28256,28260,28260,
+28259,28257,28248,28248,28216,28216,28176,28149,
+28053,28053,27895,27895,27766,27711,27562,27562,
+25696,25690,25691,25692,27221,27221,27184,27184,
+27123,27091,25693,25691,25694,25696,26860,26874,
+26923,26923,26977,26977,27000,27004,27006,27006,
+27007,27007,24761,24227,23380,23243,22391,22224,
+21368,20657,19912,19537,14084,13351,12367,12689,
+13005,13037,12764,12954,12761,12919,12942,12140,
+11954,11900,11882,11959,12096,12148,12737,12568,
+12542,12546,12520,12452,12424,12359,12361,12193,
+11846,11760,11237,11200,11617,11714,11573,11917,
+12743,12589,12361,11696,10910,10944,10878,11278,
+12155,11945,10935,10853,10795,10791,10926,10732,
+10694,10539,10105,9121,8578,8335,8213,8076,
+7779,7610,7440,7100,6932,6810,5845,5620,
+5388,4932,4717,4510,4291,4168,4130,4049,
+3991,3953,4052,3930,3907,3899,3898,3912,
+3807,3721,3637,3562,3643,3772,3918,3915,
+3883,3817,3788,3759,3675,3621,3561,3448,
+3395,3380,3399,3429,3473,3611,7641,7743,
+7991,7988,7940,7813,4593,4674,4759,4768,
+4777,5504,6400,7733,7939,8029,6103,6386,
+6559,6771,9330,9557,9996,10335,10492,10591,
+10754,10731,10747,10659,10692,10664,10697,10692,
+9650,8823,10523,10619,10975,11132,11600,11786,
+11685,11759,12104,12149,12024,12044,11901,11953,
+12494,12117,11995,12163,12218,12253,12387,12442,
+12510,12559,12633,12569,12486,12391,12308,12059,
+11784,11666,10480,10098,10056,10309,10575,11537,
+11656,11696,11818,11833,11762,11750,11749,11751,
+11796,11828,11815,11791,11723,11693,11570,11520,
+11506,11483,11445,11424,11398,11358,11348,11340,
+11429,11424,11423,11371,11270,11256,11239,11238,
+11240,11257,11266,11273,11351,11342,11351,11310,
+11264,11255,11186,11201,11281,11331,11334,11334,
+11339,11337,11341,11370,11380,11395,11391,11377,
+11279,11241,11234,11240,11357,11386,11413,11442,
+11447,11446,11465,11490,11598,11747,11995,12025,
+11354,11373,11451,11543,11575,11589,11570,11535,
+11489,11420,11403,11405,11437,11457,11478,11457,
+11420,11383,11320,11303,11290,11299,11299,11299,
+11302,11282,11301,11276,11215,11234,11318,11335,
+11298,11285,11311,11296,11280,11284,11283,11324,
+11433,11433,11416,11402,11363,11351,11352,11345,
+11237,11220,11289,11265,11241,11237,11267,11270,
+11239,11189,11136,11095,10963,10946,10949,10977,
+10997,11003,11050,11010,10881,10764,10681,10672,
+10764,10769,10758,10726,10735,10696,10585,10573,
+10580,10603,10614,10616,10630,10608,10530,10502,
+10531,10532,10657,10653,10639,10631,10615,10617,
+10653,10688,10746,10790,10781,10757,10711,10660,
+10608,10520,10524,10511,10426,10243,10057,9361,
+9095,9247,8986,9339,9546,9471,9611,10255,
+10673,10913,11203,11403,11412,11380,11244,11203,
+11229,11082,10933,10793,10490,10444,9945,9559,
+9368,9352,9868,9992,9373,9238,9343,9356,
+9696,9720,9708,9562,9093,9046,9459,9515,
+9216,9414,9737,9867,9960,10047,10256,10515,
+10798,11007,11776,12053,12290,12786,13487,13575,
+13776,13899,13994,14208,14418,14488,14539,14748,
+14811,15456,16307,16624,16611,16531,16353,15608,
+14797,14404,14025,16573,16847,18188,18596,18922,
+19280,19202,19057,18431,18062,17800,17529,17653,
+17141,17752,17371,17388,18166,18359,18568,18434,
+19229,18762,19040,19618,19650,19574,19457,19199,
+19249,19098,18992,18825,18836,18801,18819,18800,
+18655,18356,18263,18173,18096,18083,18277,18241,
+18178,18066,17834,17746,17694,17377,17191,17006,
+16667,16503,16553,16421,16537,16687,16709,15724,
+15234,14794,14519,13760,12579,12098,11617,10677,
+10252,9849,9141,8840,8556,8000,7716,7423,
+6777,6429,6050,5225,4782,4335,3518,3165,
+2834,2268,2015,1792,1494,1396,1323,1220,
+1174,1132,1139,1148,1158,1218,1269,1352,
+1572,1687,1807,2079,2240,2446,2924,3248,
+3508,4033,4262,4526,5015,5296,5614,6406,
+6882,7401,8518,9090,9713,10633,10968,11156,
+11142,10989,10921,11321,11716,12214,14414,14916,
+15361,16321,16166,16037,15964,15868,15837,16115,
+16322,16758,16877,17079,17177,17097,16835,16784,
+16811,16752,19061,19729,19503,19658,19773,20121,
+19997,20847,22880,23210,23563,23736,23933,24311,
+24521,24706,25047,25176,25297,25393,25393,25313,
+24791,24472,24563,24508,24025,24115,25482,25556,
+25613,25658,27397,27397,27781,27781,28000,28065,
+28169,28169,28260,28260,28320,28337,28356,28356,
+28351,28351,28345,28323,28216,28216,25641,25640,
+25608,25595,25561,25567,24502,24620,24600,24700,
+24754,24729,24447,24246,24969,25576,25642,25650,
+27482,27482,27550,27571,27608,27608,25699,25699,
+25701,25702,25710,25710,25699,25700,27585,27581,
+27559,27559,25695,25694,25694,25694,25694,25695,
+25697,25695,25742,25725,25633,25753,25696,25696,
+25696,25695,25692,25693,25693,25693,26802,26816,
+26872,26872,26914,26914,26951,26964,26989,26989,
+27007,27007,25634,25224,24629,24552,24327,24277,
+23663,23125,21987,21742,17711,17326,17091,13856,
+13522,13243,12923,12892,12952,13854,12517,12803,
+12970,13121,12993,12791,12627,12966,13193,12792,
+12433,12302,12300,12233,12046,11965,11909,11728,
+11655,11572,11449,11555,11699,11745,11799,12146,
+11866,11813,11975,11649,11813,11842,11976,11745,
+11335,11139,11251,10957,10783,10743,11340,11535,
+11587,11449,11748,11612,11332,11514,11402,10858,
+9915,9237,10082,9405,9218,8790,6958,6344,
+6106,5704,5565,5520,5441,5361,5286,5255,
+5232,5273,5462,5515,5559,5840,6174,5963,
+5101,4703,4258,3986,3970,3898,4144,4450,
+4651,8539,5098,8477,4890,4745,4597,4395,
+4362,4368,4458,4549,4499,4414,4417,4341,
+4858,5347,5366,9027,8969,10155,10045,10043,
+9057,9047,9119,10080,10593,10714,10274,10182,
+10070,10030,10288,10324,10441,10540,10367,10409,
+10475,10520,10644,10794,10882,10949,11028,11078,
+11125,11230,11375,11435,11519,11579,11590,11678,
+11720,11778,12934,12032,12386,12557,12892,12916,
+12749,12754,12704,12691,12705,12715,12720,12708,
+12667,12507,12488,12382,12139,12069,12097,12007,
+11890,11866,11990,11954,11964,11893,11739,11728,
+11674,11666,11630,11621,11637,11632,11578,11568,
+11553,11504,11477,11458,11429,11418,11480,11458,
+11440,11410,11328,11297,11195,11176,11179,11186,
+11195,11186,11170,11126,11100,11082,11067,11067,
+11072,11076,11166,11156,11048,11046,11083,11113,
+11114,11117,11151,11133,11022,10994,10991,10999,
+11041,11069,11165,11213,11222,11220,11215,11224,
+11225,11278,11296,11328,11397,11401,11393,11382,
+11386,11395,11436,11451,11379,11374,11364,11354,
+11337,11335,11393,11452,11476,11489,11493,11480,
+11460,11436,11434,11443,11463,11467,11472,11424,
+11380,11343,11292,11285,11280,11302,11305,11305,
+11299,11275,11290,11256,11188,11201,11273,11286,
+11249,11244,11278,11271,11271,11278,11274,11296,
+11392,11377,11335,11316,11279,11289,11307,11320,
+11244,11236,11305,11267,11232,11218,11242,11253,
+11235,11225,11193,11169,11048,11027,11022,11036,
+11055,11068,11145,11127,11018,10931,10855,10849,
+10950,10965,10970,10975,10999,10971,10859,10832,
+10818,10800,10797,10795,10819,10810,10749,10754,
+10787,10791,10816,10917,10916,10984,11007,11028,
+11108,11166,11227,11244,11208,11168,11061,10990,
+10923,10863,10890,10927,10941,10903,10826,10589,
+10494,10325,10390,10394,10447,10638,10783,10924,
+11182,11179,11197,11040,11011,10983,10781,10726,
+10759,10580,10495,10354,9618,8634,8011,6956,
+7416,7883,8552,9479,8985,8912,9038,9061,
+9410,9427,9416,9304,8864,8852,9331,9407,
+9125,9353,9679,9809,9885,9971,10191,10481,
+10776,10995,11727,11948,12128,12476,13090,13116,
+11887,13417,12006,12873,13179,14429,14549,14694,
+14617,14460,14063,14293,14943,15038,15124,14051,
+14174,13986,14533,15181,14360,15818,16419,15954,
+16522,17362,16342,15408,15265,15185,15455,15837,
+16326,17023,17070,16576,16950,17113,16963,17771,
+18091,18361,18782,18934,18977,18869,18761,18542,
+18454,18367,18335,18263,18227,18131,17965,17864,
+17671,17376,17243,17195,17175,17124,16995,16848,
+16738,16633,16424,16280,16253,16088,16016,15988,
+16048,16094,16329,16410,16530,16436,15015,14800,
+14521,13854,12872,12517,11600,11076,10710,10007,
+9682,9388,8898,8703,8514,8092,7845,7566,
+6916,6555,6171,5360,4948,4540,3775,3435,
+3114,2502,2215,1945,1543,1405,1304,1174,
+1123,1081,1090,1101,1119,1180,1222,1290,
+1461,1552,1648,1898,2062,2279,2846,3160,
+3458,4050,4352,4660,5238,5565,5904,6621,
+6989,7350,8074,8556,8684,9139,9320,9436,
+9657,9901,10259,11228,11757,12300,14387,14951,
+15848,15965,15716,15639,15439,15433,15444,15848,
+16107,16274,16480,16602,16670,16612,16450,16355,
+16086,16086,18677,19284,19216,19405,19849,20071,
+20163,20630,22906,23107,23473,23661,23878,24270,
+24469,24656,25005,25140,25271,25399,25416,25421,
+25243,25131,25106,24893,24592,24663,25549,25549,
+25614,25639,27397,27397,27781,27781,28000,28065,
+28169,28169,28260,28260,28320,28337,28356,28356,
+28351,28351,28345,28323,28216,28216,25633,25637,
+25618,25618,25597,25601,24836,24965,24865,24963,
+24957,24966,25134,25172,25475,25658,25674,25672,
+27482,27482,27550,27571,27608,27608,25688,25687,
+25686,25689,25689,25695,25695,25697,27585,27581,
+27559,27559,25697,25696,25696,25694,25691,25691,
+25698,25697,25757,25683,25680,25698,25690,25694,
+25696,25697,25694,25694,25692,25691,26802,26816,
+26872,26872,26914,26914,26951,26964,26989,26989,
+27007,27007,25637,25249,24685,24601,24377,24325,
+23726,23231,22175,21921,18265,18027,17872,17521,
+14357,13960,13230,12976,12817,12882,12949,13154,
+12085,12618,13041,13689,13023,13500,12504,12654,
+12230,12015,11965,11865,11752,11655,11627,11531,
+11558,11634,11786,11840,11814,11764,11799,11651,
+11376,11819,11854,11810,11711,11583,11674,11857,
+11405,11032,10835,11081,11183,11208,11560,11738,
+11483,11175,11433,11282,11458,11734,11355,10954,
+9644,9482,10226,9534,9356,9090,7196,6967,
+6755,6138,6090,6064,5912,5792,5677,5381,
+5193,5009,5073,5082,5088,5442,5746,6329,
+5572,5599,6054,5726,5546,5349,5386,5583,
+5691,9011,7715,7727,5627,5090,4822,4387,
+4386,9135,4676,4792,4958,5065,5135,5477,
+5692,5961,6233,6542,6721,6916,9536,9573,
+10092,10379,10520,10504,10861,10592,9960,10203,
+10140,10151,10454,10499,10561,10637,10516,10572,
+10669,10715,10835,10969,11051,11115,11195,11249,
+11302,11424,11575,11641,11753,11838,11882,12049,
+12128,12224,12465,12612,12662,12890,12928,12840,
+12852,12850,12711,12783,12797,12799,12799,12773,
+12730,12564,12546,12444,12174,12532,12509,12069,
+11967,11947,12075,12026,12023,11872,11677,11627,
+11532,11516,11485,11498,11522,11510,11429,11388,
+11340,11260,11235,11225,11245,11267,11359,11379,
+11372,11349,11276,11248,11150,11134,11136,11138,
+11127,11113,11093,11052,11040,11034,11043,11052,
+11059,11056,11136,11117,10997,10995,11036,11075,
+11076,11076,11089,11057,10932,10893,10897,10918,
+10994,11036,11139,11186,11188,11178,11158,11161,
+11160,11209,11221,11248,11300,11299,11288,11287,
+11304,11331,11417,11451,11393,11401,11387,11368,
+11424,11423,11445,11473,11491,11500,11505,11501,
+11493,11493,11513,11516,11497,11489,11478,11427,
+11393,11369,11360,11357,11340,11340,11334,11320,
+11282,11257,11173,11164,11238,11249,11258,11259,
+11259,11237,11232,11229,11240,11261,11275,11307,
+11330,11315,11260,11234,11217,11215,11232,11252,
+11286,11287,11291,11247,11219,11199,11175,11182,
+11189,11202,11198,11182,11116,11090,10977,10969,
+10979,10995,11126,11132,11129,11099,11058,11047,
+11064,11066,11063,11066,11071,11066,11033,11027,
+11036,11035,11029,11027,11041,11031,11004,10992,
+11007,11014,11051,11062,11148,11303,11390,11451,
+11578,11630,11642,11666,11672,11647,11548,11495,
+11456,11437,11443,11450,11453,11424,11514,11346,
+11096,10979,10979,10954,10843,10970,11240,11286,
+11152,10951,10756,10459,10290,10220,10010,9955,
+8814,9490,9489,9867,9195,9130,9086,7238,
+7298,7367,7182,7076,7050,7736,8094,7606,
+7205,7499,8376,8481,9231,9313,8568,8727,
+8880,9534,10271,10390,10311,10340,10172,9603,
+9854,10015,10714,10449,11565,11783,11673,11001,
+10918,10826,10602,11109,11480,13563,13655,13732,
+12059,12333,12656,12662,12791,12591,12548,12420,
+12302,12108,12806,13686,13725,13367,13492,13537,
+13314,13079,12856,12751,12999,13349,14185,14947,
+15368,16749,16626,16908,16785,16274,16678,16537,
+17118,17426,17960,18141,18269,18254,18210,18073,
+17998,17879,18008,17971,17871,17829,17564,17394,
+17175,16764,16475,16334,16211,16109,16016,15713,
+15458,15239,14829,14618,14465,14328,14427,14594,
+15163,15403,15785,15862,14860,14646,14007,13614,
+13162,11795,11321,10785,9746,9270,8913,8332,
+8105,7941,7769,7744,7710,7534,7373,7158,
+6596,6255,5880,5075,4681,4301,3617,3315,
+3023,2444,2162,1884,1466,1329,1230,1092,
+1025,970,950,951,962,1003,1036,1093,
+1267,1371,1490,1798,1998,2249,2880,3197,
+3506,4136,4444,4769,5450,5811,6173,6857,
+7160,7438,8298,8341,8143,8260,8377,8601,
+9360,9856,10388,11471,11962,12411,14810,15388,
+15992,16121,15443,15528,16161,16145,16023,16037,
+15830,15996,16298,16326,16343,16181,16031,15846,
+15817,15920,17182,17761,18240,18472,19436,19589,
+19675,20144,21102,21512,22458,22745,23030,23576,
+23971,24200,24653,24833,25132,25319,25369,25398,
+25481,25465,25468,25419,25319,25335,25578,25563,
+25591,25380,25328,25319,25650,25646,25667,26751,
+27987,27987,28118,28118,28204,28214,28179,28179,
+25646,25650,25644,25654,25669,25665,25634,25638,
+25634,25345,24982,24950,24798,24722,24612,24754,
+24649,24717,24824,24815,24914,25028,25111,25094,
+25174,25209,25331,25410,25374,25335,25220,25254,
+25546,25675,25683,25686,27204,27204,27196,27185,
+27142,27142,25706,25703,25703,25700,25695,25695,
+25702,25705,25745,25706,25709,25700,25716,25765,
+25791,25806,25778,25761,25647,25602,25583,25492,
+25466,25406,25193,25105,24980,24763,24689,24587,
+24877,24810,24816,24693,24561,24477,24176,24109,
+21984,20996,20258,20008,19008,18920,18783,18569,
+18565,18215,14286,13877,13492,12962,12850,12879,
+13098,13310,12733,13329,13401,13525,12785,13062,
+12808,12575,12412,12685,11919,11912,11799,11581,
+11339,11398,11497,11451,11540,11728,11647,11590,
+11657,11720,11801,11802,11475,11553,11217,11390,
+11401,11522,11028,11340,11461,11303,11490,11924,
+11044,11923,11218,11550,11159,11808,11893,11048,
+10152,10095,10510,9728,9512,9293,8949,8794,
+7834,7573,7160,7072,6770,6621,6451,6073,
+5849,5570,5213,4999,4899,4757,4737,4750,
+4924,5307,6813,6411,5994,5904,6062,6143,
+6166,6160,6121,6055,5804,5533,5257,4766,
+9675,4426,4413,4515,4736,5687,6284,6762,
+7298,7365,7332,7073,6890,6617,6506,6774,
+7343,9659,10159,10183,9952,10029,10102,10199,
+10230,10266,10451,10499,10471,10632,10703,10760,
+10847,10886,10929,11037,11110,11188,11335,11400,
+11462,11589,11662,11748,11979,13218,13036,12435,
+12527,12955,12886,13196,13087,13058,13020,12994,
+12853,12811,12787,12765,12761,12748,12748,12749,
+12758,12676,12590,12888,12998,12961,11771,11647,
+12647,12889,12794,12729,12654,11629,11608,11589,
+11559,11369,11346,11392,11446,11441,11514,10448,
+10538,11049,11069,11060,11206,11237,11202,11211,
+11202,11183,11135,11113,11094,11082,11078,11073,
+11047,11025,11001,10958,10948,10948,10999,11016,
+11039,11033,10983,10961,10972,10966,11009,11055,
+11068,11085,11095,11077,11030,10984,10979,10983,
+11018,11040,11074,11053,10979,10967,11001,11007,
+10983,11054,11097,11137,11245,11262,11305,11339,
+11362,11387,11444,11469,11491,11494,11460,11447,
+11443,11462,11476,11490,11492,11485,11466,11458,
+11449,11450,11473,11475,11451,11445,11439,11421,
+11409,11404,11428,11426,11404,11377,11361,11333,
+11266,11244,11150,11151,11236,11254,11277,11276,
+11283,11243,11215,11193,11160,11163,11163,11185,
+11200,11201,11182,11171,11159,11149,11151,11160,
+11208,11214,11214,11203,11197,11187,11157,11161,
+11159,11187,11218,11225,11224,11221,11123,11126,
+11132,11144,11241,11258,11288,11325,11356,11369,
+11390,11405,11427,11444,11448,11448,11427,11426,
+11434,11447,11450,11465,11530,11543,11549,11546,
+11535,11524,11507,11495,11440,11424,11464,11499,
+11730,11883,11957,12150,12286,12350,12454,12459,
+12453,12403,12365,12327,12187,12092,12126,11833,
+11498,11293,11052,10908,10712,10569,10734,10668,
+10529,10436,10355,9821,10051,9941,8874,7876,
+7857,8305,8071,8261,8430,8166,8413,8005,
+8139,9964,9874,9805,9592,7583,7388,7026,
+6887,7104,9009,7721,7765,9476,8988,9029,
+8985,9170,8912,9778,8986,8763,8646,7884,
+7861,7994,8543,9032,9674,11176,11061,11270,
+12176,12325,12563,12833,12958,13051,12987,12989,
+11183,11355,11376,11526,13379,13599,13756,14288,
+14408,14701,15621,15824,16017,15826,15303,15726,
+15468,15219,15397,15267,15230,15327,15900,16177,
+16423,16496,16322,16201,15662,15519,15397,15349,
+15364,15473,15832,15982,16143,16417,16592,16673,
+16746,16689,16580,16602,16656,16672,16652,16620,
+16504,16434,16339,16387,16632,16709,16793,16755,
+16594,16443,16057,15828,15600,15211,15070,14879,
+14498,13620,13299,12492,12035,11564,10661,10248,
+9338,8590,8291,8035,7628,7482,7372,7132,
+7007,6886,6671,6575,6484,6262,6119,5948,
+5530,5297,5042,4490,4198,3896,3291,2985,
+2669,2016,1711,1448,1171,1125,1097,1005,
+931,838,725,689,678,748,829,954,
+1299,1495,1690,2075,2257,2468,2902,3136,
+3339,3850,4140,4455,5106,5432,5757,6902,
+7433,7099,7985,7722,7969,9464,9873,10321,
+11210,11591,11904,11559,11689,11821,12322,12768,
+13184,15090,15320,15549,15870,15942,15891,15845,
+15514,15606,15525,15605,16284,16477,16573,16629,
+15943,16464,16965,17581,18432,18623,19655,19820,
+19858,20153,20638,20792,21775,21803,22091,22747,
+23380,23713,24265,24477,24862,24935,25013,24943,
+25600,25603,25610,25610,25612,25614,25602,25600,
+25602,25328,25168,25197,25605,25604,25655,25677,
+27928,27928,28062,28062,28145,28150,28092,28092,
+25507,25513,25506,25522,25519,25511,25476,25483,
+25414,25293,25068,25065,25042,25044,24930,24811,
+24649,24588,24573,24592,24708,24983,25132,25161,
+25265,25287,25345,25371,25358,25369,25411,25428,
+25591,25592,25624,25640,27087,27087,27078,27059,
+25702,25706,25849,25810,25801,25756,25749,25737,
+25737,25731,25724,25715,25719,25708,25708,25701,
+25687,25621,25566,25498,25327,25221,25132,24984,
+25005,24930,24635,24533,24402,24186,24150,24043,
+24436,24352,24450,24360,24343,24272,23932,23846,
+21560,20594,20132,20014,19643,19635,19683,19740,
+19874,19821,19774,19559,18349,17329,15202,14718,
+13920,13588,13330,12936,12882,12784,12837,12818,
+12779,12812,12815,11670,12162,12194,12202,12120,
+11370,11316,11432,11421,11587,11461,11275,11220,
+11083,11466,11653,11820,11796,11913,11840,11790,
+11345,11446,11684,11955,11766,12257,10949,11600,
+12218,12346,11774,11674,11198,10841,10978,10931,
+10455,10381,10190,10483,10058,9884,9733,9681,
+9685,9599,9582,9555,9274,9238,8992,8854,
+8793,8725,7395,7329,7778,7568,7597,7543,
+7217,6808,6823,7269,7184,6932,6702,6591,
+6490,6424,6421,6457,6559,6605,6627,6578,
+6504,6381,6100,6302,6296,6934,7339,7685,
+7554,7629,7584,7279,7166,7150,7134,6944,
+6648,6339,6577,9904,10222,10370,10407,10466,
+10498,10538,10723,10809,10851,11049,11139,11220,
+11366,11439,11514,12032,12919,12860,12039,12139,
+12246,12484,12624,12681,13593,13638,13592,13158,
+13009,13004,12978,12976,12972,12959,12933,12938,
+12895,12817,12752,12606,12552,12514,12475,12474,
+12494,12486,12430,12691,11922,12867,12811,10909,
+11829,11773,12668,12625,11769,11680,11607,11543,
+11420,11385,11357,11379,11407,11431,11444,11437,
+11418,11355,11320,11288,11256,11239,11158,11129,
+11108,11084,11034,11011,10997,10986,10987,10992,
+10993,10985,10971,10934,10918,10906,10959,10964,
+10994,10988,10919,10911,10959,10939,10945,10924,
+10907,10907,10915,10917,10902,10898,10911,10908,
+10913,10922,10920,10924,10892,10907,10958,10966,
+10949,10967,10980,10994,11065,11088,11148,11207,
+11237,11258,11281,11298,11351,11387,11386,11407,
+11429,11435,11443,11440,11428,11425,11435,11443,
+11462,11494,11505,11513,11506,11491,11472,11424,
+11405,11388,11393,11397,11383,11388,11392,11380,
+11337,11311,11312,11249,11149,11148,11247,11251,
+11254,11245,11230,11220,11191,11184,11176,11171,
+11173,11170,11172,11170,11174,11182,11181,11190,
+11215,11217,11225,11215,11217,11208,11153,11153,
+11088,11107,11212,11223,11245,11254,11260,11278,
+11290,11297,11211,11215,11220,11239,11364,11382,
+11339,11372,11478,11552,11590,11604,11589,11586,
+11543,11534,11527,11544,11682,11710,11722,11747,
+11721,11721,11720,11709,11605,11585,11580,11580,
+11632,11724,11904,12150,12230,12303,12502,12537,
+12550,12500,12459,12420,12204,12135,12032,11754,
+11596,11372,10932,10000,9446,8849,8568,8466,
+8380,8746,9039,10725,10822,10783,10609,10510,
+10856,9891,10022,10095,10833,10160,10304,10862,
+10975,10928,10382,10220,10272,8900,8957,8715,
+9448,9612,9374,9166,9003,8966,9174,9148,
+8915,8892,8937,8632,8822,8860,9161,7414,
+7362,7472,7989,8334,9455,10654,10597,10739,
+10846,10938,10137,11057,11078,11151,10322,10163,
+10782,11630,11984,11566,12917,13136,13130,13703,
+13985,14050,14246,14437,14610,15171,15455,15558,
+15783,15739,15757,15771,15704,15286,13749,14110,
+15625,15577,15616,15594,15509,15500,15506,15500,
+15161,15178,15971,15959,15894,16059,16313,16436,
+16596,16602,16614,16461,16270,16199,14750,13905,
+13872,13967,14180,14423,14828,15014,15149,15221,
+15200,16227,15956,15809,15088,14713,14538,14331,
+13792,13156,12764,11865,11390,10924,10072,9687,
+9326,8707,8435,8173,7634,7355,7073,6441,
+6126,5824,5305,5128,4988,4771,4672,4571,
+4349,4241,4125,3865,3713,3538,3134,2905,
+2652,2132,1886,1677,1436,1364,1302,1160,
+1070,974,862,837,840,957,1071,1237,
+1670,1902,2132,2585,2798,3030,3433,3658,
+3887,4369,4615,4855,5257,5459,5841,6827,
+7039,6280,6688,7068,7537,9355,9968,10604,
+11747,12158,12440,11897,11887,11894,12219,12570,
+13406,14302,14455,14737,15120,15236,15366,15438,
+15522,15586,15432,15552,16174,16579,17101,17210,
+16788,16879,17076,17423,18035,18261,20046,20179,
+20318,20440,20377,20503,21265,21226,21977,22661,
+25387,25419,25484,25510,25541,25573,25622,25611,
+25645,25645,27200,27188,27139,27139,27125,27125,
+27117,27130,27202,27202,27460,27460,27650,27716,
+27851,27851,27932,27932,25672,25648,27803,27803,
+25237,25137,25022,25177,25015,25009,24962,24882,
+24450,24305,24510,24558,24480,24467,24306,24464,
+24326,24278,24081,24030,24039,24662,24814,24957,
+25298,25316,25332,25362,25335,25391,25512,25567,
+25631,25596,25591,25528,25569,25618,25649,25745,
+25800,25920,26287,26089,26024,25918,25856,25831,
+25765,25779,25770,25741,25723,25700,25630,25579,
+25519,25338,25205,25074,24748,24582,24508,24231,
+24123,24001,23694,23544,23514,23240,23163,23028,
+22907,22757,22731,22429,22169,21980,21257,21119,
+20265,19864,19699,19573,19345,19276,19190,19118,
+18922,18926,19277,19191,19014,18639,18442,18206,
+16827,16501,16116,14291,14082,15009,13542,13384,
+13233,12911,12747,12597,12391,12257,12240,12149,
+11674,11326,12311,12437,12351,12165,11850,11769,
+11389,11438,11459,11742,12070,12139,11639,11608,
+11556,11880,12076,11320,11055,11500,12374,12002,
+12025,11884,10702,10613,10558,10235,10118,10189,
+10761,10659,9965,9629,9678,9554,9664,9957,
+9556,9494,9434,9431,9350,9351,9356,9360,
+9350,9336,9375,9367,9460,9500,9584,9592,
+9723,9709,9682,9633,9808,9742,9375,7842,
+7454,6592,6246,6128,6134,6206,6275,6343,
+6562,6498,6392,6521,6646,6936,7056,7183,
+7413,7442,7445,7507,7521,7450,7477,7736,
+8202,11091,11107,11157,11073,11105,10856,10756,
+10758,10777,10877,10964,11075,11338,11471,11595,
+11819,13128,13252,12147,12220,12299,12426,12497,
+12503,13038,12833,12924,13059,13109,13094,13199,
+13252,13218,13056,12979,12943,12810,12718,12672,
+12536,12486,12426,12309,12262,12229,12215,12229,
+12250,12269,12255,12220,12088,11999,11956,11857,
+11811,11777,11738,11731,11722,11662,11595,11545,
+11407,11383,11374,11387,11406,11422,11425,11405,
+11372,11280,11231,11189,11134,11122,11115,11108,
+11098,11082,11027,10993,10961,10911,10899,10894,
+10899,10900,10897,10871,10851,10829,10792,10784,
+10851,10884,10831,10845,10931,10924,10939,10901,
+10857,10845,10843,10850,10769,10796,10918,10921,
+10900,10899,10808,10828,10937,10951,10882,10893,
+10902,10914,10978,10985,10956,10980,11018,11101,
+11174,11209,11220,11247,11338,11394,11429,11442,
+11389,11409,11429,11447,11442,11445,11457,11463,
+11478,11503,11510,11518,11512,11501,11484,11439,
+11420,11401,11402,11404,11391,11406,11418,11414,
+11382,11357,11353,11267,11153,11137,11219,11224,
+11234,11250,11249,11252,11235,11227,11215,11197,
+11193,11187,11190,11192,11199,11207,11201,11203,
+11212,11207,11210,11201,11208,11205,11163,11168,
+11105,11123,11224,11236,11262,11278,11294,11339,
+11366,11387,11329,11341,11350,11365,11482,11493,
+11438,11465,11568,11647,11699,11731,11758,11769,
+11744,11766,11759,11773,11894,11913,11923,11944,
+11921,11924,11929,11918,11818,11790,11778,11768,
+11765,11779,11818,12007,12142,12258,12483,12520,
+12539,12525,12494,12440,12235,12342,12273,12057,
+11904,11736,11429,11202,11067,10041,9641,9309,
+8964,9063,9736,11231,10085,9938,9782,9428,
+10605,10744,10934,11392,11683,11675,11641,11489,
+11482,11390,10627,10316,10360,8912,8988,9780,
+10107,10248,9766,9409,9232,9148,9227,9060,
+9272,9460,8917,8896,9194,9274,9132,9007,
+9035,8981,9192,9333,9956,10391,10176,10094,
+8455,8625,8619,8939,9277,9634,10651,10784,
+11038,11353,12063,12233,12260,11033,12130,10124,
+12397,10427,10398,9755,9786,10173,13515,13776,
+12746,12395,13814,13297,12224,12390,12698,12924,
+13705,14012,14208,14410,15500,15630,15674,15595,
+15196,15073,15636,15586,15456,15534,15702,15768,
+15802,15785,15735,15224,14944,14947,13201,12011,
+11685,11418,11499,11650,12111,12238,12378,12385,
+12391,12361,12351,12434,13008,12744,12840,12906,
+12875,12762,12579,12040,11716,11378,10698,10359,
+10024,9354,9003,8632,7819,7389,6949,6079,
+5679,5316,4728,4527,4367,4111,3987,3853,
+3550,3395,3238,2934,2789,2645,2366,2219,
+2059,1709,1537,1376,1178,1106,1051,933,
+866,802,786,809,862,1069,1227,1432,
+1931,2189,2444,2923,3111,3272,3691,3923,
+4172,4709,4977,5232,5702,6206,6566,6929,
+6703,6260,6628,7006,7485,9247,9895,10549,
+11676,12256,12642,13087,12403,13260,13079,12958,
+13443,14211,14368,14657,15074,15193,15320,15397,
+15483,15529,15357,15499,16166,16790,17353,17473,
+17135,17397,17479,18024,18492,18588,20192,20158,
+20256,20381,20350,20495,21260,21341,21923,22503,
+25360,25388,25453,25478,25514,25549,25605,25588,
+25627,25632,27200,27188,27139,27139,27125,27125,
+27117,27130,27202,27202,27460,27460,27650,27716,
+27851,27851,27932,27932,25672,25653,27803,27803,
+25150,25135,24940,24769,24586,24461,24458,24407,
+24123,24139,23892,24007,24153,24279,24220,24208,
+24143,24255,24228,24170,24342,24650,24804,25198,
+25451,25491,25543,25550,25548,25552,25627,25661,
+25718,25804,25800,25800,25764,25701,25715,25754,
+25797,25920,26138,26061,25998,25870,25841,25819,
+25769,25743,25741,25682,25636,25580,25441,25351,
+25260,25002,24851,24689,24325,24164,24094,23828,
+23773,23639,23388,23276,23300,23074,22996,22982,
+22761,22564,22545,22217,21947,21778,20949,20774,
+20221,19850,19727,19642,19467,19389,19285,19107,
+18844,18819,19147,19046,18921,18656,18564,18408,
+17268,17076,16939,16632,16348,16259,16197,16039,
+16018,15461,14407,14109,12934,12731,12581,12342,
+12262,12220,12422,12632,12531,12399,12096,11983,
+11540,11487,11390,11613,12138,12287,11991,12111,
+11924,11894,11742,11608,11533,11696,11890,11576,
+11523,11596,10212,10077,10036,9997,10044,10134,
+10682,10573,10175,10100,10051,10200,10081,9810,
+9839,9734,9674,9633,9605,9624,9653,9702,
+9721,9744,9857,9882,10002,10096,10201,10230,
+10398,10403,10397,10373,10525,10448,10062,9938,
+9634,9324,8885,6930,5542,5378,5361,5181,
+5243,5347,5770,5881,6039,9507,9249,9343,
+9275,9351,9424,9601,9744,9894,10256,10445,
+11075,11383,11534,11596,11400,11396,11133,11025,
+11035,11066,11201,11306,11434,11726,11878,12028,
+13417,13644,13757,13299,13226,12703,12818,12848,
+12803,12879,13305,13008,13088,13146,13090,13066,
+13117,13080,12901,12820,12759,12624,12537,12488,
+12365,12309,12256,12161,12124,12097,12077,12084,
+12086,12090,12079,12049,11966,11912,11900,11857,
+11817,11792,11728,11710,11694,11628,11573,11532,
+11415,11395,11385,11392,11401,11406,11379,11343,
+11298,11186,11132,11086,11028,11022,11028,11053,
+11058,11052,11004,10965,10924,10851,10829,10820,
+10832,10843,10851,10842,10822,10794,10727,10700,
+10750,10765,10714,10739,10852,10858,10882,10854,
+10812,10801,10805,10817,10742,10781,10905,10906,
+10867,10851,10744,10733,10835,10846,10791,10815,
+10838,10878,10954,10969,10946,10969,11003,11069,
+11131,11156,11152,11173,11260,11320,11360,11381,
+11236,11276,11385,11461,11493,11501,11482,11474,
+11470,11465,11469,11479,11509,11527,11543,11555,
+11550,11541,11508,11490,11467,11438,11433,11427,
+11424,11423,11422,11413,11402,11392,11282,11273,
+11330,11341,11333,11327,11350,11345,11314,11302,
+11300,11300,11303,11305,11300,11301,11303,11299,
+11294,11287,11293,11295,11271,11275,11208,11217,
+11230,11249,11244,11246,11308,11312,11264,11297,
+11319,11347,11472,11507,11588,11653,11672,11693,
+11625,11644,11688,11738,11734,11758,11836,11864,
+11874,11927,12019,12044,12119,12164,12219,12312,
+12346,12379,12461,12483,12498,12499,12440,12424,
+12434,12394,12228,12110,12113,12136,12216,12265,
+12299,12327,12419,12462,12381,12370,12365,12245,
+12265,12404,12515,12527,12485,12488,12508,12439,
+12287,12148,12021,10517,10368,11277,10167,10151,
+10249,11794,12134,12069,11786,11668,11106,8457,
+10168,10041,9956,9936,9913,9898,9900,10007,
+10449,10466,9546,9049,8929,8904,8860,8741,
+9264,9692,8889,8815,8741,8768,8800,8873,
+8911,8944,9090,9117,9205,9232,9174,9108,
+8976,9004,8973,9136,9215,9294,9431,9489,
+9541,9372,9447,9236,10198,10362,10364,10368,
+10293,5949,5250,5503,5895,6375,11011,6498,
+5963,5511,5085,9529,8845,9421,10144,10679,
+11242,13279,13782,15181,15786,15885,15382,15116,
+14909,14693,14368,14295,14455,14641,14614,14750,
+15855,15776,15021,14622,14636,14360,13741,12158,
+11339,11570,11767,11592,10974,10878,10720,10305,
+10076,9855,9505,9403,9365,9438,9553,9684,
+9879,9903,9858,9590,9395,9174,8693,8446,
+8187,7653,7374,7083,6468,6153,5839,5274,
+5033,4841,4578,4507,4440,4255,4113,3930,
+3450,3171,2871,2264,1987,1743,1411,1310,
+1230,1069,976,874,760,750,771,882,
+949,1023,1252,1378,1515,1850,2043,2274,
+2755,2987,3187,3463,3595,3748,4085,4277,
+4486,4924,5151,5376,5786,5963,6116,6394,
+6542,6710,7170,7488,8315,9193,9667,10133,
+10965,11289,11536,10944,11392,11304,11791,12238,
+14550,14465,15980,16163,15611,15719,15669,15717,
+15840,16342,16460,16937,17403,17829,17916,17934,
+17818,17929,18148,18470,18593,18714,19806,19927,
+20499,20536,20561,20657,20843,20933,21100,21868,
+24574,24611,27037,27037,27039,27043,27059,27059,
+27119,27119,27175,27182,27162,27162,27136,27136,
+27090,27104,27221,27221,27544,27544,27707,27749,
+27795,27795,27764,27764,27674,27628,25211,25203,
+24709,24581,24213,24250,22496,20928,22182,22035,
+21897,21687,21806,22692,22697,22919,23026,23350,
+23388,23722,24160,24391,24590,24259,25177,25353,
+25654,25773,25856,25947,25930,25973,26033,26029,
+26009,26012,26054,26084,26133,26131,26116,26154,
+26141,26140,26028,25955,25874,25745,25690,25637,
+25531,25459,25390,25195,25067,24924,24615,24456,
+24296,23981,23835,23697,23363,23190,22966,22514,
+22467,22230,21868,21767,21662,21408,21220,21005,
+20568,20291,20040,19462,19158,18813,18234,18131,
+17864,17438,17730,17675,17886,17849,17796,17690,
+17744,17531,17430,17304,17605,17274,17049,16741,
+16410,16210,15857,15574,15383,15382,16123,16116,
+15819,15715,15776,15666,15306,15131,14867,14220,
+12690,12541,12282,12165,12657,12523,12193,12085,
+11720,11621,11635,11494,11438,11470,11390,11387,
+11492,10984,10564,10652,11017,10853,10490,10402,
+10225,10200,10335,10213,10352,10425,10549,10486,
+10672,10612,10666,10755,10584,10370,10305,10262,
+10203,10216,10345,10363,10288,10301,10378,10438,
+10474,10499,10449,10465,10547,10524,10424,10389,
+10397,10346,10294,10200,10146,10115,10079,10060,
+10163,10111,10067,9997,9617,8344,7735,6663,
+6917,7211,8051,9759,11150,10916,10415,10611,
+11079,11212,11602,11763,11654,11682,11517,11515,
+11503,11484,11486,11495,11507,11548,11551,11679,
+11757,11844,12356,12150,12218,12925,12769,12536,
+12636,12690,12742,12834,12873,12929,13047,13081,
+13161,13161,13066,13033,12965,12930,12886,12815,
+12770,12705,12564,12516,12459,12387,12344,12324,
+12260,12243,12213,12163,12127,12103,12060,12042,
+12024,11992,11972,11945,11905,11884,11854,11818,
+11799,11779,11755,11735,11720,11677,11647,11616,
+11552,11518,11487,11436,11416,11393,11342,11310,
+11274,11193,11151,11112,11049,11031,11016,10994,
+10977,10957,10897,10861,10822,10749,10724,10711,
+10721,10735,10749,10757,10748,10729,10682,10659,
+10641,10630,10642,10656,10675,10673,10658,10610,
+10588,10572,10573,10592,10619,10685,10811,10834,
+10867,10876,10882,10890,10893,10896,10809,10810,
+10809,10806,10894,10894,10821,10840,10865,10924,
+10954,10983,11030,11049,11067,11108,11148,11177,
+11182,11209,11310,11386,11428,11452,11469,11480,
+11492,11507,11517,11525,11544,11554,11563,11566,
+11560,11550,11525,11512,11497,11480,11480,11479,
+11482,11482,11480,11466,11453,11440,11324,11313,
+11371,11390,11389,11392,11434,11436,11410,11399,
+11392,11387,11378,11377,11370,11378,11386,11392,
+11406,11406,11414,11411,11381,11374,11283,11286,
+11295,11319,11323,11339,11433,11453,11417,11456,
+11475,11494,11590,11611,11679,11737,11758,11788,
+11742,11771,11825,11893,11894,11927,12006,12034,
+12038,12091,12186,12210,12273,12299,12340,12457,
+12516,12571,12682,12720,12748,12828,12784,12727,
+12733,12688,12536,12358,12296,12281,12307,12337,
+12655,12520,12647,12691,12856,12853,12807,12757,
+12752,12743,12836,12845,12777,12795,12815,12778,
+12695,12664,12611,12321,12186,12181,12446,12414,
+12341,12347,12552,12233,11507,11242,8839,8245,
+8085,7970,8107,8215,9975,9952,9971,10081,
+10474,10492,9499,9078,9008,8952,8968,8869,
+9559,9614,8845,8813,8773,8772,8772,8791,
+8807,8831,9138,9262,9280,9121,9005,8909,
+8975,8752,8774,8856,8304,9132,9315,9405,
+9480,9577,9605,9642,10004,10082,10227,10524,
+9838,8524,7558,7485,9793,6740,7948,5658,
+5175,5404,5891,9027,9529,9549,10193,10566,
+11062,12150,12700,13184,15348,15557,15163,15167,
+15084,14966,14727,14632,14727,14697,14547,14578,
+15604,15542,14802,15111,13432,13208,12168,11970,
+11794,11453,11270,11068,10601,10340,10068,9582,
+9324,9104,8751,8632,8550,8457,8458,8473,
+8470,8430,8349,8080,7914,7736,7372,7192,
+7007,6638,6453,6266,5881,5680,5479,5098,
+4930,4782,4544,4462,4384,4198,4076,3929,
+3581,3392,3192,2794,2608,2438,2178,2080,
+1982,1758,1632,1509,1391,1393,1424,1527,
+1588,1660,1890,2021,2160,2460,2591,2782,
+3268,3465,3604,3879,4035,4208,4554,4727,
+4894,5248,5424,5595,5916,6066,6214,6521,
+6695,6895,7406,7726,8584,9391,9834,10288,
+11157,11540,11864,11543,13188,12069,13232,13859,
+16075,14700,16840,16759,15692,15804,15802,16432,
+16691,17117,17329,17490,17930,18260,18029,18107,
+17858,17981,18168,18425,18537,18704,19833,19959,
+20478,20686,20805,20779,20565,20656,20846,21618,
+24498,24525,27037,27037,27039,27043,27059,27059,
+27119,27119,27175,27182,27162,27162,27136,27136,
+27090,27104,27221,27221,27544,27544,27707,27749,
+27795,27795,27764,27764,27674,27628,25142,25093,
+24466,24600,24332,24233,23237,24166,24226,22073,
+22064,22107,22239,22363,23132,23141,23135,23162,
+23481,23327,23980,23301,23277,23275,23503,23823,
+25601,25737,25849,25883,25921,25980,26083,26081,
+26059,26025,26040,26035,26037,26037,26031,25995,
+25973,25939,25801,25721,25633,25489,25417,25354,
+25233,25166,25086,24880,24745,24569,24238,24087,
+23909,23547,23378,23216,22924,22783,22655,22351,
+22195,21967,21206,21170,21156,20932,20746,20539,
+20115,19885,19655,19139,18860,18483,17766,17567,
+17394,17275,17615,17482,17829,17784,17765,17463,
+17330,17227,17159,17045,17352,17165,16851,16746,
+16504,16341,16007,15657,15394,15311,15887,15816,
+15449,15301,15384,15298,15033,14910,14697,14130,
+12614,12486,12254,12152,12659,12547,12237,12146,
+11817,11731,11753,11590,11466,11405,11143,11157,
+11111,10778,10509,10564,10874,10769,10567,10432,
+10430,10572,10806,10651,10533,10369,10370,10367,
+10361,10356,10382,10412,10363,10344,10361,10405,
+10444,10506,10625,10632,10538,10538,10597,10626,
+10647,10656,10581,10587,10659,10623,10519,10484,
+10503,10465,10431,10396,10382,10393,10451,10496,
+10655,10708,10794,10880,11316,11326,11324,11200,
+10951,10958,10907,11009,11502,11556,11171,11242,
+11474,11511,11817,11867,11724,11732,11563,11577,
+11590,11645,11686,11729,11797,11864,11896,12053,
+12128,12195,13501,13284,12806,12575,12634,12690,
+13576,13561,13452,13333,13310,13140,13061,13043,
+13059,12994,12924,12903,12873,12844,12819,12786,
+12729,12668,12580,12530,12482,12406,12355,12324,
+12231,12209,12186,12151,12132,12131,12126,12124,
+12123,12117,12101,12090,12056,12021,11993,11934,
+11900,11876,11831,11808,11790,11748,11720,11688,
+11614,11575,11533,11452,11415,11376,11302,11265,
+11227,11150,11111,11074,11006,10976,10951,10906,
+10888,10871,10829,10805,10783,10742,10731,10722,
+10713,10710,10705,10682,10666,10651,10624,10617,
+10621,10650,10674,10693,10691,10672,10649,10611,
+10604,10610,10635,10653,10673,10708,10817,10823,
+10830,10831,10835,10845,10853,10862,10781,10784,
+10783,10774,10860,10859,10788,10810,10840,10918,
+10958,10995,11056,11077,11093,11119,11146,11159,
+11183,11210,11232,11297,11335,11364,11408,11425,
+11416,11444,11515,11518,11438,11442,11515,11531,
+11520,11521,11447,11452,11532,11566,11567,11572,
+11577,11574,11565,11539,11524,11508,11446,11439,
+11466,11483,11492,11504,11530,11534,11526,11506,
+11490,11473,11438,11428,11430,11442,11457,11471,
+11495,11505,11472,11472,11528,11516,11393,11389,
+11387,11395,11415,11438,11496,11525,11553,11601,
+11621,11636,11663,11676,11706,11756,11832,11860,
+11847,11882,11916,11982,12041,12075,12207,12236,
+12261,12337,12375,12406,12470,12501,12533,12600,
+12654,12743,12899,13006,13043,13106,13097,13106,
+13090,13021,12868,12727,12622,12550,12862,12523,
+12533,12933,12961,12969,13077,13173,13170,13045,
+13106,13090,13134,13124,13056,13064,13098,13078,
+13087,13087,13071,13011,12935,12922,12822,12733,
+12644,12525,12345,11989,11255,10997,10644,10277,
+10296,10183,10024,9253,9765,9746,9954,10006,
+10268,10275,9476,9372,9321,9265,10511,10410,
+9581,9230,8837,8781,8802,8827,7555,7813,
+8364,8754,9795,9828,9480,8627,8349,8079,
+8020,7312,9031,9442,9822,9739,9597,9800,
+10032,10585,10953,11285,11967,12249,12475,12636,
+12570,12414,11863,11503,11107,8899,8549,8273,
+8508,5658,9011,10363,8875,8991,9264,9485,
+9757,10660,11185,11661,12561,12934,13254,13655,
+14497,14495,14350,14233,14435,14172,13753,13213,
+12891,12707,12514,12150,11956,11747,10472,10321,
+10236,10063,9964,9836,9447,9181,8872,8343,
+8126,7959,7807,7819,7875,8011,8083,8141,
+8205,8209,8184,8049,7948,7825,7529,7360,
+7173,6767,6553,6338,5906,5696,5495,5128,
+4966,4821,4580,4494,4418,4268,4187,4099,
+3902,3803,3699,3477,3361,3238,2994,2861,
+2708,2338,2130,1957,1808,1822,1871,2024,
+2119,2191,2432,2549,2674,2984,3126,3267,
+3665,3875,4052,4411,4568,4733,5024,5149,
+5276,5557,5699,5838,6106,6240,6375,6664,
+6824,7001,7433,8468,8761,9452,9855,10295,
+11308,11711,12143,12174,12448,14340,16201,16514,
+14986,15943,17107,16984,15556,16770,16840,17291,
+17331,17410,17728,17799,17963,17875,17802,17785,
+17791,17895,18183,18161,18377,18483,19095,19298,
+19776,20071,20524,20549,20631,20691,20696,20226,
+20520,20675,22459,22579,23917,24269,24609,24580,
+24702,24732,24830,24999,27240,27240,27179,27179,
+27013,26998,27090,27090,27355,27355,27471,27495,
+25655,25653,25153,25146,25021,24969,24798,24711,
+24729,24718,24294,22043,23806,21397,19769,20714,
+21122,21728,22030,22187,22572,22716,23560,23688,
+23891,24174,23229,23280,23454,24379,25157,25328,
+25626,25758,25851,25865,25911,25941,26002,26006,
+25987,25915,25903,25877,25850,25842,25832,25777,
+25753,25676,25521,25460,25367,25170,25066,24973,
+24799,24713,24630,24429,24325,24195,23895,23725,
+23554,23218,23044,22878,22657,22517,22384,22112,
+21938,21795,21448,21274,21133,20754,20631,20399,
+20036,19822,19557,19104,18845,18601,18187,18066,
+18006,17762,17734,17783,17735,17669,17632,17183,
+17005,16863,16594,16378,16324,16006,15735,15590,
+15299,15161,15016,14799,14750,14675,15075,15007,
+14812,14676,14737,14641,14270,14146,13841,13466,
+12935,12831,12564,12483,12532,12381,12191,12113,
+11951,11860,11620,11364,11212,11140,10970,10926,
+10814,10600,10527,10492,10401,10387,10371,10363,
+10349,10340,10437,10409,10385,10440,10513,10532,
+10573,10579,10601,10602,10532,10553,10598,10620,
+10640,10672,10685,10689,10680,10674,10669,10659,
+10714,10713,10667,10671,10667,10673,10752,10757,
+10706,10728,10876,10965,10963,11002,11459,11029,
+11016,10977,11326,11315,11447,11428,11496,11414,
+11169,11164,11023,11100,11118,11336,11616,11665,
+11628,11633,11708,11689,11592,11612,11668,11730,
+11745,11834,11914,12372,12032,12095,12168,12261,
+12780,12568,12513,12578,12661,13866,13858,13729,
+13299,13169,13240,13097,13080,13094,13042,12993,
+12993,12940,12904,12873,12804,12785,12752,12707,
+12709,12674,12615,12588,12553,12497,12402,12384,
+12355,12342,12329,12309,12299,12299,12284,12283,
+12278,12257,12248,12235,12179,12152,12123,12057,
+12024,11996,11936,11905,11880,11821,11787,11747,
+11660,11614,11565,11469,11421,11374,11285,11243,
+11204,11130,11093,11057,10981,10949,10912,10851,
+10827,10806,10774,10763,10753,10729,10716,10703,
+10681,10677,10674,10697,10720,10747,10799,10840,
+10903,10909,10882,10845,10765,10695,10596,10567,
+10578,10591,10631,10649,10666,10685,10787,10782,
+10765,10766,10778,10817,10846,10875,10899,10918,
+10931,10935,10948,10936,10821,10821,10828,10862,
+10887,10916,10970,10996,11017,11063,11174,11192,
+11269,11286,11278,11307,11333,11347,11364,11379,
+11370,11420,11521,11543,11486,11507,11601,11637,
+11611,11614,11558,11554,11594,11615,11625,11626,
+11624,11632,11655,11671,11668,11673,11682,11679,
+11676,11669,11667,11665,11669,11674,11680,11699,
+11711,11721,11733,11740,11753,11761,11764,11765,
+11761,11764,11725,11745,11824,11835,11796,11809,
+11785,11793,11800,11806,11814,11819,11824,11841,
+11857,11876,11925,11958,11992,12065,12174,12207,
+12198,12226,12255,12308,12368,12388,12509,12546,
+12579,12673,12710,12754,13304,13372,13382,13431,
+13454,13514,13681,13764,13829,13907,13912,13941,
+13978,14040,13989,13980,13960,13920,13863,13841,
+13820,13788,13754,13580,13603,13597,13608,13530,
+13479,13463,13476,13470,13423,13481,13577,13603,
+13611,13573,13466,13244,13160,12982,12766,12683,
+12641,12232,12261,12124,11768,11651,11443,11186,
+11252,11127,10905,10826,10576,10490,10631,10599,
+10619,10545,9998,9731,9567,9380,10672,10536,
+7635,7543,7742,7943,8433,8689,9931,10229,
+10950,10627,10168,10339,9964,9817,9645,9439,
+10016,10262,10840,10947,7191,7448,8121,8411,
+8572,8626,8618,8692,9175,9545,9996,12451,
+11431,12458,12157,11050,10878,9952,9063,7971,
+5738,5552,6105,7621,8090,9274,9036,9036,
+8930,8276,7803,7371,7121,7160,7279,7738,
+8129,8637,11319,11694,12415,12774,12548,12590,
+12865,12800,12651,12241,11769,11243,5995,4162,
+8206,8255,8646,8823,9091,9091,8980,8698,
+8485,8251,7922,7867,7881,8023,8122,8217,
+8411,8503,8572,8617,8590,8526,8741,8558,
+7880,7398,7146,6899,6446,6248,6073,5792,
+5677,5578,5404,5333,5264,5134,5072,5009,
+4887,4832,4774,4646,4571,4485,4296,4197,
+4093,3873,3761,3657,3501,3456,3437,3447,
+3469,3656,3709,3652,3732,3930,4171,4669,
+4888,4882,4901,4872,4925,4988,5169,5291,
+5439,5842,6085,6322,6777,6970,7140,7401,
+7484,7546,8783,8849,8935,9231,9468,9781,
+10552,10985,11447,12352,13090,13882,14491,14853,
+16674,16962,17306,17317,17283,17281,17407,17252,
+17392,17396,17364,17355,17245,17550,17622,17662,
+17930,18059,18248,18481,18596,18731,19012,19119,
+19350,19691,20232,20306,20392,20519,20591,20674,
+20088,20140,21528,21674,23156,23588,24102,24110,
+24447,24428,24593,24734,25214,25205,25500,25497,
+25479,25468,25437,25439,27259,27259,27349,27366,
+25621,25612,24806,24718,24358,24078,23986,24205,
+20097,19956,19858,19826,19950,20123,19638,20421,
+18864,20603,20593,20951,21340,21564,21819,22375,
+22668,22967,24641,24877,25020,25240,25322,25384,
+25436,25442,25447,25446,25446,25449,25440,25433,
+25417,25366,25317,25259,25181,25131,25080,24985,
+24942,24900,24823,24770,24693,24510,24403,24311,
+24098,23948,23850,23616,23516,23408,23209,23103,
+22988,22740,22608,22474,22192,22050,21882,21559,
+21394,21219,20883,20726,20625,20330,20272,20106,
+19852,19714,19597,19327,19189,19041,18725,18549,
+18508,18368,17996,17630,17640,17502,17076,16749,
+16515,16539,15884,15667,15455,15067,14801,14633,
+14296,14168,14075,13913,13923,13865,14226,14186,
+14085,14019,14105,14046,13732,13650,13365,13111,
+12884,12794,12550,12476,12409,12266,12131,12067,
+11967,11882,11548,11292,11164,11068,10854,10782,
+10701,10615,10609,10588,10489,10490,10496,10516,
+10531,10549,10606,10630,10661,10731,10822,10861,
+10962,11000,11035,11070,11004,11019,11037,11040,
+11043,11051,11061,11078,11130,11164,11204,11288,
+11413,11445,11443,11447,11390,11331,11371,11299,
+11012,10896,10906,11832,11833,11829,11174,12507,
+11590,10756,10716,10740,10759,10758,10755,10773,
+10775,11133,11175,11263,11149,11273,11707,11770,
+11674,11741,11856,11934,11853,12010,12172,12185,
+12186,12264,12328,12385,12380,12416,12458,12557,
+13567,13290,13215,13013,13094,13154,13223,13034,
+12999,13010,13081,13061,12950,12935,12906,12914,
+13007,13016,12989,12965,12922,12895,12855,12802,
+12806,12790,12764,12759,12753,12752,12727,12735,
+12721,12714,12705,12684,12674,12650,12594,12577,
+12558,12513,12492,12462,12416,12382,12337,12269,
+12230,12179,12084,12037,11990,11883,11830,11776,
+11670,11617,11562,11454,11404,11357,11258,11206,
+11149,11045,10994,10951,10882,10860,10851,10881,
+10906,10921,10917,10916,10901,10861,10824,10776,
+11036,11041,11048,11083,11115,10939,11003,11015,
+11091,11092,11084,10996,10980,10917,10729,10700,
+10674,10640,10583,10607,10644,10710,10826,10844,
+10873,10880,10886,10899,10910,10918,10934,10939,
+10940,10939,10929,10930,10853,10861,10871,10908,
+10938,10965,11025,11053,11077,11148,11271,11293,
+11287,11305,11304,11346,11386,11407,11384,11403,
+11424,11476,11560,11582,11515,11538,11614,11620,
+11577,11581,11578,11572,11566,11557,11633,11638,
+11585,11602,11689,11733,11676,11690,11764,11763,
+11767,11753,11760,11752,11744,11750,11756,11791,
+11817,11839,11874,11885,11889,11887,11878,11870,
+11842,11839,11838,11856,11878,11899,11951,11977,
+12018,12052,12025,12035,12061,12064,12071,12090,
+12152,12171,12168,12205,12190,12260,12406,12430,
+12521,12570,12631,12712,12718,12724,12769,12799,
+12890,13260,13405,13468,13569,13638,13720,13852,
+13874,13902,13971,14051,14035,14144,14179,14220,
+14282,14299,14272,14275,14278,14276,14271,14268,
+14322,14329,14323,14303,14105,14074,14035,13925,
+13846,13786,13656,13637,13602,13687,13757,13806,
+13824,13753,13675,13501,13326,13209,12980,12878,
+12767,12351,12223,12101,11883,11780,11667,11451,
+11359,11256,11065,10986,10824,10711,10742,10687,
+10571,10491,10339,10174,10339,9376,9093,9051,
+8998,9270,10340,11030,11411,11496,11699,11023,
+11431,10971,11073,11075,10177,9700,9624,9527,
+11189,11722,11635,10256,10679,11264,11794,10620,
+10640,10321,9746,9102,7639,7727,8013,9750,
+10215,12912,10434,10691,11087,10196,9812,7631,
+6310,5885,6678,6473,6991,10272,8699,8735,
+8620,7913,7229,2544,3959,4980,6249,10373,
+10452,8662,10259,10288,10626,11575,12024,12411,
+12829,12929,12959,12805,12645,12482,12166,11890,
+11521,10446,10163,11301,7689,7120,7140,7701,
+7941,8100,8251,8281,8300,8336,8373,8424,
+8549,8607,8649,9202,9141,9043,8736,8549,
+7844,7416,7208,7012,6665,6513,6382,6157,
+6057,5960,5752,5652,5555,5365,5276,5196,
+5067,5022,4983,4914,4877,4834,4733,4680,
+4619,4496,4438,4387,4329,4320,4310,4285,
+4226,4261,4541,4090,4601,4525,4511,4480,
+4514,4572,4718,5038,5242,5490,6041,6327,
+6610,7133,7361,7564,7925,8085,8229,8464,
+9364,9441,9537,9574,9615,9760,9894,10084,
+10494,11642,11525,11822,12545,13203,14345,14761,
+15155,16984,17342,17581,17701,17740,17774,17615,
+17527,17512,17251,17300,17147,17358,17390,17347,
+17897,18007,18015,18315,18538,18632,18952,19045,
+19229,19383,19553,19632,19753,19838,19928,20087,
+19995,20049,20113,20225,20761,21369,22951,23024,
+24272,24172,24281,24234,23995,23983,24054,24043,
+23733,23693,23438,23643,26922,26922,26911,26915,
+26947,26947,26917,26917,26922,26922,19015,18777,
+18408,18276,18709,19997,20185,19661,19369,21249,
+20042,19884,20407,20362,20974,21211,22805,23421,
+23703,23997,24460,24635,24716,24800,24800,24798,
+24766,24767,24806,24872,24945,25006,25028,25075,
+25093,25093,24979,24971,24879,24811,24715,24608,
+24573,24518,24405,24360,24306,24187,24091,24007,
+23843,23742,23621,23401,23308,23197,22995,22887,
+22788,22552,22429,22290,22004,21840,21703,21382,
+21201,21053,20836,20690,20560,20311,20230,20109,
+19853,19740,19596,19316,19132,18938,18371,17901,
+17969,17907,17292,17445,17099,16678,16702,16238,
+15766,15570,15114,14934,14749,14426,14301,14161,
+14090,13988,13815,13625,13488,13420,13355,13299,
+13257,13159,13119,13065,12916,12852,12674,12531,
+12538,12466,12314,12247,12151,12022,11988,11923,
+11727,11652,11283,11136,11157,11088,10962,10911,
+10875,10807,10725,10717,10696,10706,10810,10836,
+10759,10775,10809,10828,10850,10905,10952,10989,
+11174,11211,11170,11206,11201,11211,11241,11237,
+11208,11216,11278,11304,11454,11508,11575,11740,
+12027,12050,11911,11854,11577,12018,11943,11876,
+11751,11704,11666,11643,11704,11819,11763,13369,
+12997,11256,10597,10959,11230,11336,12449,12430,
+12157,12138,12079,12091,11812,11799,11830,11828,
+11816,11878,11920,13133,12119,12169,12233,12282,
+12327,12437,13781,13720,13496,13211,13067,12932,
+12743,12781,12961,13006,13042,13102,13117,13137,
+13084,13066,13130,13152,13142,13123,13090,13077,
+13057,13016,12963,12953,12952,12965,12946,12942,
+12967,12962,12978,12999,12949,12963,13021,13020,
+12954,12933,12928,12891,12863,12838,12780,12764,
+12731,12693,12673,12621,12511,12469,12423,12307,
+12254,12204,12101,12050,12001,11902,11855,11813,
+11710,11654,11597,11480,11417,11355,11238,11188,
+11141,11059,11056,11527,11462,11430,11399,11024,
+11004,10988,10956,10942,10924,10814,11025,11025,
+10857,10845,10844,11015,11040,11078,10929,10909,
+10965,10912,10792,10763,10980,10921,10690,10683,
+10734,10729,10655,10643,10617,10657,10721,10755,
+10901,10923,10927,10939,10946,10949,10951,10953,
+10932,10920,10882,10894,10950,10969,10968,11007,
+11115,11132,11172,11182,11188,11223,11255,11268,
+11327,11358,11369,11426,11470,11490,11458,11465,
+11472,11497,11565,11575,11496,11516,11593,11616,
+11586,11603,11631,11639,11645,11651,11727,11730,
+11671,11681,11758,11792,11733,11745,11821,11825,
+11835,11832,11844,11840,11839,11845,11851,11884,
+11908,11928,11966,11982,11991,12002,12002,12003,
+11996,12000,12006,12033,12056,12076,12120,12139,
+12173,12193,12163,12171,12190,12198,12214,12251,
+12314,12329,12328,12358,12346,12406,12517,12672,
+12651,12767,12854,13048,13080,13122,13251,13319,
+13441,13544,13674,13747,13852,13906,13976,14077,
+14141,14202,14341,14352,14395,14462,14495,14522,
+14546,14558,14527,14542,14553,14578,14597,14615,
+14666,14697,14713,14709,14634,14599,14510,14397,
+14236,14142,13950,13910,13891,13963,14018,14038,
+14004,13952,13894,13694,13591,13421,13265,13126,
+12985,12569,12460,12354,12165,12076,11980,11799,
+11721,11628,11436,11349,11178,11033,11049,10989,
+10886,10831,10716,10665,10890,10858,10840,10844,
+10963,11058,11132,11167,11306,11299,11280,11158,
+11044,10940,11041,11354,10033,10025,10102,10210,
+9247,7830,8157,9017,9359,9467,9413,9202,
+8816,7745,7261,7004,7139,7455,8560,7551,
+8283,8122,8374,7848,7504,9125,4831,4345,
+4126,4198,4424,6621,5812,7233,9032,9048,
+8227,7815,7627,7515,7849,8282,8768,9487,
+9749,9987,10431,10392,10505,12188,12359,12639,
+13225,13483,13677,13759,13660,13520,13186,12887,
+12509,11703,11274,10792,9995,9558,7075,7199,
+7409,7595,7895,8041,8191,8492,8644,8795,
+9061,9162,9763,9681,9563,9397,8964,8715,
+8472,7510,7283,7067,6674,6499,6340,6065,
+5932,5800,5533,5406,5288,5091,5020,4969,
+4925,4930,4950,5015,5056,5094,5155,5164,
+5149,5063,5008,4962,4887,4865,4855,4886,
+4857,4937,4920,4892,4914,5017,5100,5224,
+5583,5804,6048,6563,6819,7078,7548,7753,
+7938,8256,8387,8502,8701,8789,8869,9799,
+9867,9919,10017,10063,10114,10710,10837,10921,
+10742,10903,12132,12019,12524,13190,14019,14514,
+15032,16885,17286,17470,17772,17860,17904,17782,
+17454,17337,17158,17129,17145,16967,16993,17090,
+17528,17698,17890,18056,18299,18427,18715,18851,
+19042,19159,19365,19456,19545,19604,19650,19779,
+19693,19625,19863,19955,20522,21149,22825,22849,
+24164,24188,24146,24142,23942,23976,23958,23989,
+23639,23562,23311,23430,26922,26922,26911,26915,
+26947,26947,26917,26917,26922,26922,19678,19475,
+20155,19965,19861,21857,18478,19829,20753,21076,
+19314,19105,19424,19042,19855,21786,22322,22757,
+22924,22936,21924,22194,22113,22274,22344,22419,
+22519,22599,22675,23958,24135,24280,24402,24541,
+24633,24735,24731,24668,24583,24524,24455,24325,
+24299,24252,24140,24096,24045,23929,23832,23762,
+23619,23509,23387,23176,23086,22969,22753,22637,
+22537,22300,22183,22045,21762,21627,21480,21178,
+21027,20878,20692,20573,20447,20222,20135,20013,
+19743,19616,19469,19132,18958,18769,17868,18141,
+18154,17282,17251,16754,16424,16438,15910,15474,
+15227,15214,14542,14363,14180,13888,13794,13694,
+13721,13663,13526,13395,13278,13224,13170,13110,
+13066,12960,12920,12870,12743,12698,12542,12445,
+12474,12420,12287,12220,12119,11970,11924,11846,
+11638,11567,11206,11093,11138,11094,11021,10994,
+10978,10940,10869,10867,10851,10863,10967,11000,
+10931,10956,11008,11037,11067,11132,11178,11213,
+11381,11408,11358,11379,11369,11379,11420,11427,
+11413,11457,11535,11574,11724,11759,11787,11840,
+12071,11959,11429,11311,11908,12024,11951,11875,
+11774,11735,11710,11701,11717,11735,11924,12324,
+12472,11051,11305,11543,13017,13084,12833,12792,
+12495,12488,12389,12366,12110,12056,12065,12082,
+12879,12625,12121,12207,12426,12366,12413,12461,
+12498,12593,12628,12672,12752,13028,12818,12873,
+13171,13215,13331,13383,13188,13189,13201,13217,
+13131,13130,13193,13205,13186,13160,13166,13143,
+13108,13031,13020,12997,13052,13048,13034,13087,
+13112,13146,13180,13165,13117,13150,13201,13178,
+13080,13065,13066,13039,13014,12984,12905,12885,
+12861,12797,12769,12714,12554,12503,12447,12333,
+12271,12222,12139,12102,12070,11986,11948,11910,
+11815,11752,11692,11596,11585,11687,11718,11692,
+11698,11944,11915,11858,11685,11309,11266,11231,
+11225,11321,11220,11019,11350,11195,11152,11122,
+11080,11069,10899,10882,10882,10883,10888,10968,
+10901,10944,10880,10857,10963,10902,10713,10713,
+10803,10805,10729,10666,10653,10626,10692,10738,
+10923,10965,10988,11029,11044,11051,11053,11052,
+11028,11007,10965,10973,11019,11034,11026,11049,
+11144,11151,11174,11180,11184,11224,11262,11285,
+11340,11354,11405,11451,11481,11498,11394,11406,
+11511,11541,11464,11480,11656,11683,11673,11725,
+11747,11774,11830,11846,11880,11884,11825,11824,
+11889,11889,11781,11790,11799,11811,11897,11915,
+11875,11903,11917,11927,11946,11954,11970,11975,
+11983,11993,12101,12116,12108,12140,12178,12198,
+12247,12267,12290,12328,12348,12363,12392,12402,
+12307,12324,12436,12449,12450,12469,12490,12542,
+12571,12610,12701,12734,12765,12812,12832,12853,
+12916,12946,12968,13321,13367,13439,13572,13643,
+13720,13843,13985,14030,14133,14206,14240,14345,
+14362,14433,14568,14642,14780,14906,14947,15002,
+15111,15137,15106,15152,15173,15198,15270,15288,
+15353,15371,15374,15372,15304,15299,15311,15239,
+15191,15138,14936,14897,14804,14723,14751,14713,
+14550,14493,14501,14382,14267,14208,13984,13863,
+13672,13386,13382,13059,12928,12856,12758,12597,
+12512,12425,12244,12154,12081,11897,11740,11671,
+11549,11495,11444,11347,11300,11256,11170,11131,
+11184,11192,11373,11362,11380,11396,11538,11614,
+11554,11581,11811,11786,11972,11703,11274,10730,
+9754,8652,8716,8516,8340,8121,7728,7695,
+7737,9024,9427,9625,9052,9075,10211,10236,
+9814,9711,9756,9806,9665,9152,8984,8864,
+8818,8779,8834,6907,6858,6943,7510,9285,
+8981,9260,9273,9271,8681,8220,7630,6447,
+6086,5981,6197,6534,7038,8405,9123,9801,
+11169,12590,12292,13222,15273,15422,15680,15609,
+15238,13584,12696,12226,11127,10512,9888,8668,
+8060,7994,8795,7286,4021,5104,6616,7293,
+8966,9807,9869,9804,9697,9545,9141,8913,
+8696,7768,7564,7372,7025,6867,6718,6439,
+6306,6181,5973,5885,5815,5757,5762,5792,
+5917,6012,6126,6396,6553,6715,7007,7117,
+7201,7268,7246,7179,6904,6664,6361,5799,
+5559,5459,5594,5753,5945,6335,6510,6671,
+6920,7005,7072,7165,7199,7241,7323,7365,
+7408,7510,7577,7657,7885,8039,8227,9688,
+9928,10091,12080,12268,12301,12143,12149,12132,
+12077,12173,12326,11721,12373,12625,13188,13495,
+13660,14088,14602,14916,15464,15694,15776,17034,
+16921,16872,16750,16751,16801,16847,16818,16952,
+17420,17559,17799,18140,18300,18439,18259,18466,
+18861,18529,18722,18894,19155,18999,19042,19240,
+19034,19100,19245,19302,19117,19265,19358,19533,
+20235,20314,20502,20706,20895,20914,20949,21044,
+21177,21331,21344,21412,21852,21930,22632,22990,
+23593,23621,23550,23522,23553,23460,23436,23665,
+23112,23046,23020,23016,22906,22854,22223,22149,
+21875,21944,21989,22380,21686,22176,22322,20760,
+20734,21328,22143,22305,22426,21509,22860,23001,
+23262,23421,23467,23748,23880,23966,24127,24174,
+24207,24216,24217,24189,24137,24096,24030,23939,
+23886,23844,23887,23841,23675,23539,23574,23484,
+23222,23098,22988,22721,22478,22346,22126,21998,
+21962,21700,21571,21432,21095,20993,20898,20569,
+20477,20298,20123,19960,19754,19349,18681,18463,
+17868,17684,17652,17348,17117,16509,16227,16166,
+16185,15592,15786,16264,14868,15121,15212,14986,
+14695,14761,13706,13566,13436,12713,12614,12542,
+12458,12438,12784,12844,12943,12925,12569,12542,
+12754,12679,12347,12322,12544,12519,12321,12238,
+12230,12192,12070,12016,11925,11811,11797,11744,
+11581,11547,11619,11550,11273,11265,11257,11254,
+11297,11303,11322,11317,11300,11306,11330,11375,
+11419,11448,11409,11441,11546,11603,11595,11598,
+11612,11602,11526,11511,11525,11542,11622,11672,
+11689,11831,11997,12067,12163,12182,12596,12653,
+13079,11517,12303,12234,12159,12007,11923,11840,
+11809,11899,12126,11926,11878,12056,13948,13767,
+12822,12732,12708,12678,12468,12420,12208,12127,
+12077,12082,12053,12067,12125,12526,12865,12763,
+12497,12535,12622,12661,12615,13699,12671,12705,
+12745,12847,12974,13031,13280,13546,13311,13406,
+13457,13430,13368,13380,13438,13422,13392,13383,
+13336,13363,13335,13326,13302,13363,13333,13307,
+13268,13275,13337,13378,13431,13413,13283,13296,
+13359,13364,13373,13418,13430,13434,13429,13414,
+13388,13368,13263,13228,13253,13234,13139,13111,
+13084,12970,12929,12891,12847,12802,12681,12604,
+12559,12529,12507,12473,12448,12456,12467,12489,
+12558,12599,12657,12852,12932,12931,12906,12884,
+12862,12739,12613,12520,12402,12357,12366,12188,
+12076,12056,11794,12215,12061,11763,11636,11509,
+11305,11144,11057,10949,10923,10891,10921,10924,
+10884,10742,10758,10762,10731,10703,10695,10689,
+10745,10763,10714,10696,10681,10768,10885,10929,
+10989,11023,11049,11091,11133,11142,11129,11133,
+11150,11177,11202,11222,11244,11265,11315,11336,
+11257,11261,11336,11336,11338,11339,11349,11354,
+11354,11366,11417,11469,11507,11531,11451,11475,
+11591,11639,11569,11588,11752,11768,11747,11770,
+11779,11793,11833,11845,11880,11897,11849,11861,
+11951,11964,11866,11888,11900,11912,11989,12001,
+11956,11973,11982,11991,12010,12022,12045,12062,
+12078,12094,12214,12232,12227,12258,12293,12307,
+12343,12357,12374,12403,12421,12435,12473,12490,
+12408,12445,12565,12586,12597,12617,12633,12670,
+12687,12703,12755,12770,12787,12814,12829,12847,
+12907,12937,12960,13036,13166,13267,13447,13553,
+13649,13811,13879,13937,14062,14196,14233,14369,
+14393,14478,14645,14718,14858,15002,15045,15095,
+15211,15261,15248,15307,15330,15363,15447,15466,
+15533,15590,15608,15620,15576,15574,15594,15542,
+15518,15480,15278,15223,15172,15081,15042,15001,
+14860,14821,14840,14743,14671,14597,14422,14288,
+14139,13925,13840,13643,13287,13208,13112,12964,
+12887,12811,12655,12579,12517,12357,12211,12148,
+12032,11978,11924,11816,11758,11699,11570,11505,
+11526,11463,11603,11556,11501,11478,11580,11580,
+11495,11508,11741,11715,11534,11538,11341,11169,
+9954,7929,7794,7682,7655,7630,7626,6133,
+7090,7656,9679,9750,9791,9818,9755,7222,
+6882,6924,9086,7039,8032,8026,10105,9900,
+8695,9269,9908,9932,9928,9750,9076,10302,
+10197,10254,8974,9242,9090,9172,9183,9022,
+8894,8751,8264,7962,7487,6787,6596,6622,
+7480,8272,9143,10630,11141,11508,12049,14196,
+14011,13898,13807,13648,12848,11429,12419,9441,
+8979,9153,8145,7821,7632,7833,8049,8279,
+9482,9527,9517,9372,9266,9144,8871,8737,
+8642,7780,7703,7622,7440,7339,7229,6987,
+6858,6730,6493,6394,6317,6242,6251,6293,
+6477,6619,6786,7189,7418,7655,8133,8359,
+8549,8794,8855,8874,8756,8597,8344,7400,
+6708,5988,5369,5400,5501,5909,6234,6591,
+7180,7356,7456,7493,7465,7439,7397,7393,
+7407,7541,7584,7645,8415,8674,10297,11063,
+11866,12100,12674,12845,12986,12984,12978,12946,
+13034,13141,13544,12549,12731,12851,13094,13281,
+13509,13863,14092,14307,14709,14899,15049,14906,
+14944,15054,16889,16049,16132,16457,16896,17043,
+17457,17607,17843,18151,17026,17106,18034,18046,
+18174,18361,18515,19012,19003,18926,18983,19098,
+18953,18977,19099,19153,18987,19089,19159,19269,
+20088,20149,20320,20457,20652,20747,20759,20827,
+20917,21074,21072,21162,21655,21751,22507,22884,
+23489,23535,23532,23486,23526,23691,23587,23731,
+23432,23416,23442,23272,23320,23257,22695,22647,
+22154,22194,22628,22667,22814,22847,22930,22828,
+22997,23079,22981,23067,23104,23366,23103,23627,
+23673,23717,23678,23785,23614,24027,24099,24097,
+24038,24005,23999,24025,23985,23945,23881,23781,
+23720,23665,23677,23608,23396,23210,23242,23131,
+22840,22716,22581,22304,22045,21913,21725,21584,
+21543,21303,21168,20976,20662,20493,20394,20059,
+19898,19754,19549,19383,19156,18683,18007,17771,
+17331,16730,16559,16162,16026,15904,15703,15983,
+15422,15883,16157,16536,14622,14479,15524,14815,
+14300,13846,13549,13412,12864,12622,12535,13006,
+12946,12918,12897,12865,12857,12837,12765,12736,
+12702,12615,12285,12260,12480,12455,12254,12171,
+12166,12133,12028,11987,11911,11827,11829,11791,
+11657,11634,11715,11659,11387,11383,11382,11381,
+11426,11441,11464,11465,11460,11472,11502,11556,
+11604,11636,11602,11634,11737,11789,11776,11773,
+11771,11753,11669,11633,11635,11639,11693,11732,
+11748,11934,12115,12193,12335,12398,12859,13041,
+13577,13419,12448,12371,12289,12143,12067,12002,
+11974,12023,12161,12289,12426,12631,13977,13803,
+12948,12810,12776,12748,12558,12521,12319,12238,
+12196,12204,12296,13047,12625,12366,12416,12464,
+12582,12610,12695,12744,13164,12728,12781,12821,
+13409,12965,13253,13291,13555,13566,13472,13464,
+13488,13433,13440,13441,13518,13523,13457,13447,
+13510,13532,13523,13520,13532,13541,13538,13498,
+13462,13421,13508,13505,13541,13545,13419,13406,
+13376,13460,13516,13524,13555,13558,13561,13549,
+13545,13526,13431,13361,13367,13335,13193,13156,
+13133,13066,13046,13016,12994,12954,12847,12787,
+12767,12757,12734,12741,12756,12836,12897,12987,
+13236,13333,13402,13546,13409,13417,13208,12963,
+12918,12920,13013,13004,13014,12891,12906,12857,
+12794,12627,12456,12470,12307,11959,11797,11636,
+11287,11174,11095,10982,10939,10896,10839,10834,
+10758,10698,10688,10697,10708,10710,10712,10699,
+10738,10755,10708,10691,10709,10809,10923,10969,
+11036,11073,11101,11152,11198,11210,11202,11207,
+11223,11247,11267,11283,11295,11311,11357,11373,
+11295,11299,11373,11372,11371,11366,11373,11374,
+11378,11388,11495,11533,11464,11483,11521,11543,
+11654,11715,11710,11724,11737,11747,11779,11800,
+11798,11809,11840,11857,11877,11914,11920,11940,
+11965,11982,11938,11962,12003,12010,12064,12067,
+12064,12063,12038,12047,12086,12103,12107,12160,
+12222,12251,12339,12362,12366,12398,12421,12431,
+12439,12446,12471,12492,12489,12503,12539,12559,
+12559,12607,12654,12676,12713,12730,12745,12770,
+12779,12789,12818,12830,12830,12842,12815,12840,
+12986,13017,13045,13107,13161,13202,13283,13428,
+13481,13658,13739,13821,13969,14039,14120,14310,
+14356,14441,14632,14734,14855,15009,15057,15113,
+15218,15271,15258,15345,15387,15422,15542,15581,
+15598,15663,15717,15738,15750,15760,15796,15780,
+15756,15739,15656,15623,15527,15397,15386,15350,
+15250,15203,15173,15095,15038,14980,14797,14722,
+14618,14445,14402,14286,13956,13807,13568,13436,
+13372,13303,13174,13100,13017,12869,12781,12715,
+12534,12477,12470,12376,12318,12259,12132,12063,
+12009,11870,11839,11762,11626,11557,11461,11345,
+11319,11268,11221,11167,11148,10986,10841,10691,
+10193,10416,10329,6965,6766,6675,6644,2476,
+4525,10117,10202,10205,7222,7215,7246,7417,
+7567,7780,11210,7486,10144,9691,8823,8841,
+9133,9302,9465,9729,9817,9856,9809,9740,
+9646,9413,9866,9705,9358,8783,8704,8549,
+8489,8435,8185,7965,7679,7018,6298,5998,
+5894,5845,6459,6907,7346,7867,9045,9613,
+10055,10635,10804,13063,12862,12809,12454,12062,
+11882,11662,9521,9335,9189,8865,8814,9834,
+9734,9661,9537,9217,9053,8892,8593,8474,
+8429,8379,7736,7437,7377,7329,7448,7209,
+7066,6916,6629,6507,6423,6365,6392,6461,
+6725,6924,7156,7701,8012,8345,9042,9388,
+9712,10223,10390,10498,10540,10470,10336,9846,
+9368,8650,6876,6235,5977,6171,6471,6920,
+7854,8158,8337,8415,8381,8342,8242,8221,
+8220,8284,8909,9549,10464,10694,11749,12132,
+12304,12401,12650,12800,12946,13282,13464,13629,
+13830,13858,13656,15122,15346,13433,13647,13781,
+13909,14070,14184,14297,14471,14394,14234,14062,
+14147,14369,14497,14553,14700,15716,16769,16931,
+17235,16924,17034,17134,17359,18092,18510,18585,
+18666,18378,18297,18592,18885,18941,18967,19051,
+19007,19067,19260,19275,19340,19339,19123,19150,
+19645,19714,20080,20182,20021,20103,20383,20459,
+20502,20476,20395,20452,20699,20799,21013,21224,
+21468,21532,21616,21803,21856,22194,22452,22336,
+22193,22228,22486,22275,22489,22346,22429,22231,
+22318,22429,22388,22425,22895,23018,23032,22857,
+22596,22777,23093,23146,23249,23351,23468,23519,
+23545,23582,23641,23684,23733,23760,23831,23834,
+23841,23835,23809,23789,23733,23687,23639,23517,
+23440,23362,23208,23111,22982,22774,22675,22554,
+22284,22152,22011,21744,21667,21531,21269,21124,
+20918,20674,20598,20443,19922,19674,19669,19444,
+19263,19164,19247,19089,19032,18740,18495,18343,
+17380,17217,17354,17056,16567,16459,16265,15455,
+15830,15597,15093,15633,14482,14922,14171,13858,
+13756,13590,13482,13086,12984,12840,12795,12761,
+12721,12709,12912,13084,13662,13631,13495,13452,
+13105,12718,12776,12731,12632,12592,12534,12441,
+12334,12299,12154,12121,12069,11997,11943,11916,
+11874,11854,11830,11777,11566,11563,11569,11570,
+11585,11585,11566,11570,11644,11653,11617,11656,
+11746,11767,11763,11785,11871,11887,11815,11811,
+11794,11775,11742,11702,11722,11707,11741,11775,
+11748,11802,11867,11894,12151,12247,12298,12505,
+12783,12769,12880,12887,13023,12492,12463,12439,
+12552,12568,12965,13019,12816,12825,13059,13044,
+12692,12582,12502,12478,12424,12403,12323,12385,
+12479,12527,12332,12366,12327,12406,12526,12916,
+12670,12704,12734,13497,12734,12765,12857,13507,
+13600,13062,13442,13613,13475,13425,13356,13396,
+13404,13450,13437,13425,13411,13430,13422,13396,
+13486,13516,13532,13554,13578,13588,13565,13530,
+13596,13551,13481,13502,13532,13540,13480,13552,
+13499,13567,13606,13595,13656,13662,13632,13602,
+13549,13520,13503,13465,13377,13340,13287,13259,
+13274,13222,13175,13168,13132,13106,13083,13043,
+13019,13001,13036,13060,13073,13192,13316,13430,
+13666,13762,13934,13986,13899,13540,13286,13198,
+13170,13286,13145,13143,13359,13329,13277,12954,
+12911,12881,12638,12386,12340,12111,11946,11781,
+11098,11050,11089,11052,11071,10896,10821,10798,
+10770,10750,10761,10746,10733,10729,10710,10680,
+10684,10681,10702,10724,10753,10823,10900,10943,
+11014,11050,11103,11157,11169,11180,11232,11234,
+11233,11242,11276,11284,11194,11207,11311,11341,
+11271,11285,11411,11423,11344,11358,11460,11469,
+11470,11473,11549,11561,11504,11515,11547,11566,
+11674,11749,11769,11792,11781,11799,11840,11878,
+11901,11914,11908,11918,11938,11964,11984,11998,
+11987,12002,11965,11994,12085,12100,12132,12146,
+12166,12189,12161,12174,12232,12249,12238,12280,
+12368,12384,12405,12419,12419,12441,12461,12472,
+12481,12494,12531,12565,12562,12581,12618,12637,
+12659,12696,12706,12721,12762,12776,12791,12817,
+12830,12844,12882,12902,12906,12931,12915,12941,
+13076,13103,13127,13177,13191,13214,13269,13290,
+13292,13329,13353,13380,13452,13495,13638,13832,
+13969,14057,14211,14319,14417,14585,14667,14761,
+14891,14971,14981,15113,15179,15181,15353,15406,
+15416,15509,15600,15646,15705,15749,15816,15887,
+15883,15906,15961,15970,15922,15932,15986,15976,
+15948,15924,15887,15807,15767,15735,15573,15535,
+15517,15443,15431,15365,15180,15074,14996,14791,
+14663,14487,14223,14134,13888,13752,13690,13628,
+13431,13377,13392,13316,13272,13232,13153,13114,
+13070,12982,12938,12887,12787,12729,12611,12492,
+12487,12429,12318,12264,12292,12199,12123,12065,
+11927,11853,11801,11614,11484,11366,11006,10856,
+10757,10413,8774,8570,8210,8045,7922,7715,
+7661,7639,7485,7413,7356,7260,7206,7157,
+7267,7299,7299,7197,7123,7017,6768,6658,
+6565,6448,6421,6382,6366,6391,6432,6562,
+6680,6843,7264,7491,7749,8299,8540,8740,
+8973,9060,10139,11435,12381,10608,10665,10713,
+10811,10720,10737,10856,10312,10385,10474,10847,
+10906,12129,11960,11846,12339,12046,10945,10709,
+10227,10033,9807,9297,8957,8702,8115,5918,
+7634,8383,8015,7491,8676,8598,6263,6566,
+6600,6642,6795,7906,6790,6232,6372,6526,
+6933,7217,7553,8281,8673,10235,9339,9598,
+9856,10407,10673,10907,11236,11317,11341,11228,
+11210,11042,10400,10096,9766,9144,8935,8806,
+8690,8596,8525,8438,8436,8439,8048,12560,
+10077,10296,10547,10746,11048,11168,12521,12639,
+12716,12791,12962,13073,13212,13522,15219,15316,
+15430,14272,14378,13805,13903,13979,15674,15596,
+15592,15633,15727,15793,16008,16031,16256,16213,
+16109,16143,17090,17180,16891,17168,17162,17245,
+17365,17104,17519,17923,18029,18086,18185,17783,
+17681,17273,17195,17293,18236,18287,18335,18370,
+18339,18373,18591,17922,17960,17990,17649,17709,
+17859,18176,18734,18938,18494,18583,19085,19231,
+19594,19709,19648,19723,19850,19928,19907,20053,
+20125,20208,20372,20479,20760,21047,21430,21518,
+21693,21784,21855,22029,22189,22245,22303,22356,
+22477,22559,22549,22616,22761,22800,22757,22764,
+22484,22490,22588,22587,22684,22749,22816,22889,
+22914,22936,22956,22976,22998,22977,22956,22903,
+22870,22747,22644,22577,22425,22332,22250,22057,
+21947,21836,21507,21502,21457,21297,21165,21067,
+20876,20760,20652,20486,20464,20331,20053,19928,
+19612,19331,19384,19262,18807,18690,18721,17825,
+17611,18147,18377,18249,17890,18043,17967,17132,
+16199,16677,16149,15951,16142,16049,15462,15685,
+15344,15737,14273,14140,13870,13733,13596,13356,
+13257,13171,13060,13028,13009,13002,13143,13151,
+13239,13239,13147,13404,14055,14017,13939,13882,
+13407,13196,13091,13034,12832,12784,12726,12628,
+12506,12474,12350,12326,12292,12238,12180,12163,
+12159,12148,12092,12044,11895,11901,11920,11930,
+11950,11967,11951,11959,12020,12019,11958,11954,
+12035,12026,11984,11976,12014,11991,11913,11907,
+11897,11894,11885,11886,11931,11927,11933,11932,
+11884,11886,11940,12053,12518,12534,12431,12458,
+12562,12594,12929,12988,13187,13278,13277,13282,
+12847,12833,13219,13182,12910,12876,12805,12783,
+12595,12536,12474,12483,12699,12695,13000,13277,
+13321,13144,12688,12717,12670,13496,13283,12901,
+12988,13848,13648,13064,13008,13041,13113,13152,
+13178,13271,13360,13390,13383,13410,13424,13520,
+13526,13549,13583,13590,13543,13517,13511,13494,
+13503,13507,13496,13500,13509,13524,13589,13600,
+13674,13660,13605,13614,13642,13616,13692,13587,
+13507,13580,13561,13534,13516,13508,13476,13477,
+13418,13398,13441,13435,13381,13387,13385,13391,
+13461,13335,13260,13231,13134,13091,13060,13120,
+13094,12970,13113,13143,13175,13351,13456,13665,
+13747,13748,13809,13849,13743,13693,13311,13197,
+13068,13102,13185,13164,13075,13093,13043,12884,
+12782,12648,12429,12324,12208,11929,11838,11726,
+11541,11451,11450,11421,11319,11265,11051,11005,
+10974,10947,10982,10980,10941,10938,10937,10940,
+10945,10951,10969,10984,11001,11043,11078,11103,
+11141,11166,11224,11265,11245,11257,11337,11343,
+11340,11343,11376,11383,11321,11332,11399,11427,
+11386,11399,11504,11515,11444,11456,11571,11577,
+11563,11569,11559,11578,11589,11602,11632,11649,
+11732,11765,11722,11739,11769,11783,11796,11815,
+11910,11919,11846,11852,11859,11909,11988,12001,
+12049,12065,11961,11994,12095,12115,12082,12098,
+12097,12128,12142,12156,12263,12278,12214,12240,
+12322,12338,12408,12425,12432,12470,12506,12524,
+12534,12551,12580,12618,12615,12632,12638,12653,
+12679,12710,12662,12674,12766,12781,12820,12855,
+12875,12890,12923,12941,12957,12996,13019,13039,
+13056,13076,13097,13117,13071,13091,13218,13245,
+13190,13251,13283,13316,13382,13418,13452,13541,
+13753,13853,13976,14053,14149,14266,14443,14533,
+14689,14761,14812,14887,14914,14987,15185,15250,
+15224,15327,15400,15438,15503,15543,15585,15668,
+15705,15735,15764,15794,15823,15882,15997,16020,
+15986,15988,16047,16038,15985,15975,15938,15918,
+15899,15849,15791,15757,15715,15673,15558,15441,
+15429,15326,15134,15022,14907,14671,14569,14455,
+14339,14019,13972,13859,13790,13739,13643,13594,
+13545,13447,13391,13342,13248,13199,13153,13052,
+12994,12946,12865,12820,12794,12681,12553,12511,
+12521,12472,12412,12289,12212,12135,11959,11861,
+11762,11530,11400,11259,10851,10681,10561,10231,
+10031,10007,10118,10024,9754,6790,6572,6424,
+6820,10783,9445,6812,6946,7085,7412,7606,
+7814,8172,8299,8345,8309,8250,8100,7600,
+7298,6962,6294,6022,5839,5737,5776,5872,
+6202,6410,6625,7033,7220,7423,12154,8305,
+8443,12014,8983,9086,9410,9651,10690,11133,
+11466,11461,11727,10757,11715,11471,11272,11108,
+10477,10299,10297,10028,9773,9664,9408,9185,
+8666,8575,8356,8293,8838,8995,8938,7000,
+8715,8655,6050,6054,6166,6486,6997,7080,
+9291,9421,9065,9301,7889,7887,8074,8222,
+8407,8936,9263,9603,10231,10494,10715,11031,
+11133,11202,11245,11227,11185,11030,10915,10774,
+10401,10182,9944,9341,9089,8815,10423,10581,
+10730,10832,10913,10995,11181,12709,12757,12862,
+12959,13081,13258,13262,13267,13515,13681,15118,
+15294,15268,15177,15144,15098,15200,15187,15192,
+15194,15392,15408,15465,15391,15542,15651,16497,
+16797,16884,16465,16646,16988,17257,17326,16815,
+16444,16496,16652,17113,17348,17566,17631,17237,
+17135,16907,17149,17451,17847,17870,17965,17040,
+17055,17090,17167,17203,17262,17379,17436,17481,
+17612,17681,17727,17800,17714,18018,18612,18681,
+18871,19049,19129,19203,19111,19185,19264,19409,
+19462,19506,19487,19557,19676,19900,20022,20141,
+20623,20707,20823,21044,21202,21179,21290,21370,
+21208,21362,21756,21794,21744,21922,22035,22070,
+21780,21794,21873,21908,22188,22248,22288,22290,
+22254,22249,22383,22354,22220,22183,21996,21940,
+21891,21746,21652,21580,21442,21165,21129,21107,
+21092,21017,20841,20772,20609,19773,19659,19553,
+19402,19545,19759,19799,19476,19351,19257,19110,
+18722,18086,18463,18587,18033,17857,17854,17698,
+17601,17492,17149,17036,16223,15975,15950,16375,
+16332,15562,16028,16008,15110,15010,15269,14448,
+14638,14456,14173,14080,13885,13789,14062,13933,
+13731,13681,13509,13489,13602,13624,13750,13737,
+13450,13433,13492,13439,13420,13376,13175,13125,
+13129,13028,12933,12886,12797,12757,12361,12233,
+12214,12193,12278,12261,12257,12233,12249,12235,
+12214,12202,12029,12018,12160,12161,12059,12067,
+12175,12212,12241,12242,12041,12035,12026,12015,
+12132,12112,12019,11999,11997,11965,11942,11932,
+11965,11965,11925,11931,11941,11958,12042,12064,
+12067,12105,12072,12123,12354,12382,12375,12427,
+12503,12535,12518,12542,12492,12483,12489,12491,
+12671,12660,12531,12469,12414,12403,12391,12391,
+12423,12455,12512,12524,12585,12534,12532,12579,
+12622,12647,12671,12696,12719,12780,13402,13196,
+12935,12968,13008,13041,13036,13422,13274,13306,
+13222,13260,13371,13352,13445,13458,13423,13465,
+13474,13484,13505,13513,13512,13559,13505,13499,
+13530,13551,13569,13568,13680,13660,13676,13682,
+13678,13698,13667,13668,13607,13653,13619,13617,
+13720,13719,13457,13447,13532,13531,13522,13573,
+13557,13555,13584,13471,13454,13439,13315,13294,
+13351,13311,13326,13343,13301,13105,13050,12973,
+12924,12899,12963,12954,12888,13077,13241,13407,
+13437,13485,13517,13521,13507,13454,13204,13083,
+12979,12840,12771,12724,12530,12458,12476,12417,
+12384,12345,12314,12281,12356,12086,12005,11913,
+11773,11704,11635,11496,11367,11307,11241,11215,
+11169,11121,11106,11097,11121,11116,11081,11089,
+11094,11104,11163,11176,11157,11186,11201,11215,
+11242,11255,11264,11282,11288,11294,11301,11305,
+11309,11320,11327,11336,11357,11369,11382,11413,
+11427,11442,11470,11482,11494,11513,11644,11654,
+11641,11646,11633,11644,11649,11656,11671,11678,
+11753,11769,11718,11728,11749,11759,11770,11792,
+11889,11902,11842,11856,11870,11934,12019,12037,
+12090,12108,12005,12033,12132,12146,12103,12114,
+12108,12128,12138,12149,12252,12265,12201,12233,
+12317,12338,12417,12437,12448,12491,12527,12545,
+12549,12562,12585,12608,12595,12604,12595,12604,
+12625,12649,12601,12617,12717,12738,12784,12835,
+12861,12884,12927,12949,12966,13004,13024,13040,
+13049,13063,13080,13090,13042,13057,13177,13201,
+13146,13203,13234,13267,13331,13362,13394,13463,
+13581,13610,13602,13646,13705,13919,14091,14210,
+14346,14399,14459,14588,14642,14718,14924,14993,
+14985,15101,15173,15214,15262,15313,15355,15447,
+15484,15522,15557,15593,15633,15709,15830,15866,
+15854,15884,15960,16027,16016,16031,16046,16047,
+16051,16031,16019,16007,16002,15984,15884,15847,
+15883,15856,15799,15763,15712,15568,15468,15387,
+15211,15132,15065,14758,14655,14564,14393,14284,
+14036,13933,13880,13836,13753,13712,13674,13589,
+13537,13494,13419,13373,13344,13225,13097,13051,
+13056,13011,12961,12871,12819,12774,12677,12627,
+12580,12465,12402,12337,12110,12039,12009,11862,
+11744,11671,11524,11450,11380,11329,11370,11320,
+11260,11152,10997,8356,8300,8219,8183,8211,
+8291,8547,8688,8803,8985,9049,9092,9149,
+9142,9118,8999,8909,8783,8408,8164,7898,
+7365,7150,10415,6728,6692,6706,9941,6351,
+6740,6545,7307,8037,11003,11115,10026,10109,
+10218,10400,11665,11686,11662,11555,11396,11274,
+10878,10738,10692,10499,10258,10146,10206,10127,
+10084,9976,9953,9685,9564,9519,9879,9836,
+9765,9764,9751,9785,9900,9442,9819,9875,
+10646,10213,6888,7215,7249,7292,7419,7505,
+7607,7875,8049,8252,8738,9004,9268,11463,
+9947,10126,10397,10498,10578,10672,10686,10681,
+10611,10547,10464,11524,11562,11614,11590,11563,
+11528,11435,11413,11418,11537,13047,13131,13180,
+13238,13283,13337,13480,13605,13697,13752,13818,
+13720,13641,13495,13028,14642,14712,15074,15143,
+15204,15284,15407,15462,15618,15771,16143,16496,
+16718,16112,16132,16226,16426,16914,17085,16791,
+16586,16822,16992,17128,17101,17032,16759,16492,
+16315,16409,16521,16579,17113,17653,17715,16995,
+17031,17233,17734,17943,18024,17270,17311,17275,
+17858,18292,18353,17530,17197,17532,18061,18342,
+18507,17882,17987,18173,18254,18399,18610,18884,
+18940,18999,19111,19169,19234,19360,19432,19515,
+19846,19474,19476,19451,19646,19740,20185,20447,
+20266,20554,21019,21075,21153,21201,21321,21285,
+20899,20908,20928,20928,21257,21290,21314,21274,
+21150,21135,21299,21224,21051,21012,20823,20786,
+20759,20669,20583,20492,20423,19959,19922,19881,
+20067,20023,19868,19786,19663,18966,18847,18731,
+18495,18381,18507,18428,18395,18481,18383,18253,
+17704,17601,17891,17799,17317,17190,16370,16242,
+16151,16049,15729,15816,16352,16156,15921,15049,
+15056,14963,14946,14788,14720,14649,14221,14160,
+14382,14257,14002,13936,13803,13737,14046,13995,
+13823,13792,13637,13616,13723,13723,13835,13808,
+13493,13461,13506,13428,13400,13352,13150,13101,
+13109,13018,12928,12888,12813,12781,12394,12286,
+12276,12267,12372,12365,12372,12368,12393,12388,
+12383,12379,12213,12210,12349,12350,12244,12248,
+12350,12375,12397,12391,12180,12169,12155,12133,
+12243,12216,12110,12083,12073,12026,11996,11978,
+11998,11992,11949,11948,11956,11973,12062,12090,
+12099,12146,12114,12151,12358,12387,12385,12439,
+12505,12521,12473,12482,12421,12395,12397,12399,
+12590,12585,12466,12431,12389,12392,12401,12408,
+12512,12485,12499,12513,12536,12712,12863,12947,
+12617,12638,12666,12692,12719,12775,12864,12898,
+13601,12973,13026,13435,13081,13122,13510,13501,
+13403,13299,13368,13392,13416,13456,13472,13501,
+13518,13521,13525,13532,13533,13493,13437,13444,
+13438,13432,13518,13443,13524,13535,13542,13540,
+13547,13537,13521,13517,13511,13537,13461,13547,
+13551,13549,13489,13410,13508,13516,13597,13610,
+13455,13455,13481,13453,13431,13412,13267,13234,
+13282,13238,13207,13171,13099,13063,13015,12959,
+12912,12886,12865,12860,12782,12738,12822,12866,
+12960,12982,13017,13021,13039,13008,12887,12817,
+12752,12664,12565,12507,12309,12248,12266,12214,
+12189,12166,12084,12038,11997,11925,11875,11824,
+11749,11705,11648,11549,11440,11393,11335,11304,
+11259,11219,11206,11197,11222,11224,11192,11206,
+11215,11228,11288,11301,11280,11303,11313,11322,
+11338,11343,11370,11361,11360,11363,11370,11375,
+11380,11394,11403,11414,11437,11451,11465,11496,
+11510,11525,11552,11564,11576,11594,11724,11733,
+11732,11742,11754,11777,11790,11800,11823,11833,
+11841,11858,11865,11871,11882,11887,11892,11904,
+11911,11918,11933,11942,11952,11973,12060,12072,
+12020,12031,12042,12062,12072,12081,12098,12108,
+12117,12139,12147,12159,12185,12200,12215,12252,
+12381,12401,12331,12350,12369,12403,12498,12513,
+12462,12472,12483,12501,12509,12518,12536,12547,
+12557,12583,12597,12613,12647,12665,12682,12718,
+12766,12783,12782,12795,12806,12828,12837,12845,
+12972,12983,12886,12907,12922,12937,12974,12995,
+13017,13066,13198,13225,13171,13195,13219,13269,
+13294,13318,13463,13484,13413,13463,13571,13596,
+13644,13682,13729,13799,13781,13832,13955,13998,
+14081,14283,14293,14348,14437,14477,14484,14532,
+14570,14608,14707,14765,14826,14949,15000,15053,
+15142,15200,15247,15349,15384,15434,15520,15554,
+15583,15644,15674,15703,15762,15791,15829,15902,
+15921,15953,16039,16060,16026,16062,16125,16128,
+16124,16112,16094,16039,16005,15978,15921,15886,
+15860,15789,15743,15692,15616,15555,15477,15336,
+15194,15029,14954,14900,14846,14747,14704,14664,
+14495,14435,14420,14326,14278,14226,14124,14075,
+13947,13883,13863,13616,13560,13532,13496,13430,
+13402,13366,13214,13171,13124,13022,12967,12911,
+12815,12754,12670,12545,12556,12499,12370,12317,
+12216,12106,12051,11997,11894,11844,11796,11697,
+11647,11595,11486,11424,11357,11202,11115,11024,
+10826,10715,10597,10375,10249,10123,9927,9867,
+9839,10131,10222,10405,11043,11864,11815,12090,
+12291,12487,12873,13031,13011,13248,13402,13523,
+12987,12986,13022,13090,13196,13246,13248,13292,
+13268,13347,13388,13430,13500,13517,13559,13522,
+13566,13604,13653,13683,13773,13808,13765,13780,
+13827,13843,13622,13588,13651,13635,13590,13551,
+13415,13314,13344,13298,13134,13103,13144,13114,
+13132,13116,11158,13037,11120,11085,11069,11073,
+11033,11028,11030,11239,11262,11276,11384,11458,
+11541,11680,11591,11710,11605,12974,13030,12995,
+13025,12992,12916,14216,14407,14388,14269,14352,
+14579,14720,14793,15036,15114,15177,15284,15278,
+15162,15199,15199,15228,14943,15113,15155,15194,
+15351,15422,15784,15907,16053,16163,16049,16004,
+15778,15792,15481,15438,15574,15585,15610,15632,
+15646,15701,15759,15791,15946,15952,16026,16296,
+16453,16660,17212,17083,16676,16837,17143,17196,
+17065,17215,17188,16862,16577,16535,16890,16907,
+17095,17215,17218,17271,17340,17448,17701,18092,
+18356,18401,18499,18539,18521,18595,18702,18731,
+18744,18769,18572,18625,18885,18902,18887,18904,
+18936,18934,18747,18761,18780,18792,18732,18809,
+18959,18963,19045,19044,18659,18644,18742,18728,
+18674,18650,18532,18465,18429,18393,18657,18618,
+18348,18252,18412,18372,18295,18271,18032,17597,
+16974,16921,17334,17376,17396,17337,17343,17061,
+16607,16507,16340,15950,15883,15818,15918,16023,
+16318,16243,15457,15580,15938,15133,15045,14927,
+15002,14947,14708,14656,15011,15355,15117,15073,
+15146,14642,14174,14081,14866,14388,13957,14190,
+14103,14019,13931,13874,13839,13798,13460,13394,
+13643,13615,13235,13213,13438,13434,13385,13359,
+12909,12884,12860,12809,12898,12872,12823,12799,
+12736,12720,12861,12847,12822,12815,12656,12668,
+12879,12879,12564,12568,12786,12843,12847,12839,
+12802,12787,12780,12736,12696,12670,12444,12419,
+12411,12356,12279,12259,12227,12213,12201,12178,
+12173,12163,12081,12076,12083,12094,12129,12127,
+12100,12101,12097,12074,12083,12093,12282,12294,
+12202,12212,12223,12240,12277,12292,12424,12466,
+12488,12491,12484,12481,12371,12342,12330,12330,
+12294,12299,12371,12403,12362,12378,12441,12461,
+12434,12481,12562,12585,12597,12620,12656,12701,
+12720,12742,12886,12903,12946,12976,12923,12933,
+12989,13013,12959,12988,13460,13162,13072,13090,
+13181,13183,13138,13156,13319,13251,13250,13279,
+13257,13266,13293,13307,13419,13597,13605,13230,
+13334,13347,13358,13358,13293,13295,13384,13382,
+13383,13357,13329,13322,13312,13304,13287,13257,
+13194,13190,13217,13215,13180,13181,13185,13185,
+13181,13178,13180,13166,13149,13136,13105,13088,
+13258,13394,13039,13017,12970,12947,12963,12921,
+12861,12841,12972,12918,12953,12715,12726,12813,
+12922,12894,13018,12953,12657,12636,12710,12814,
+12939,12314,12287,12266,12287,12257,12239,12168,
+12285,12235,12015,11984,11894,11831,11851,11826,
+11730,11706,11636,11604,11590,11581,11635,11641,
+11592,11563,11564,11563,11562,11561,11559,11555,
+11552,11549,11545,11544,11543,11545,11548,11550,
+11561,11568,11575,11591,11600,11610,11627,11635,
+11642,11654,11726,11731,11669,11670,11671,11671,
+11672,11673,11676,11679,11683,11695,11791,11800,
+11799,11811,11823,11847,11858,11869,11887,11895,
+11901,11909,11912,11913,11914,11914,11913,11913,
+11915,11917,11924,11929,11937,11955,12042,12054,
+12007,12020,12034,12063,12078,12091,12118,12130,
+12141,12167,12174,12184,12206,12216,12227,12250,
+12371,12384,12301,12315,12329,12357,12450,12465,
+12417,12431,12445,12473,12487,12502,12528,12542,
+12555,12582,12594,12607,12633,12646,12659,12683,
+12725,12737,12729,12740,12751,12773,12785,12797,
+12930,12944,12851,12879,12894,12911,12944,12962,
+12981,13018,13141,13160,13090,13105,13121,13154,
+13174,13192,13325,13344,13269,13314,13424,13449,
+13494,13520,13557,13590,13542,13571,13659,13693,
+13772,13848,13824,13855,13918,13945,13958,14010,
+14038,14075,14090,14120,14150,14322,14399,14465,
+14603,14669,14728,14861,14914,14965,15082,15125,
+15145,15206,15241,15269,15335,15372,15419,15517,
+15550,15599,15690,15724,15706,15773,15857,15882,
+15926,15943,15954,15962,15953,15951,15943,15935,
+15941,15924,15912,15902,15901,15893,15862,15831,
+15786,15776,15776,15758,15739,15700,15678,15656,
+15608,15570,15556,15490,15451,15416,15324,15283,
+15240,15159,15120,15076,15020,14995,14948,14865,
+14832,14794,14658,14625,14592,14535,14507,14482,
+14450,14424,14378,14323,14356,14327,14240,14215,
+14139,14068,14033,14000,13940,13906,13874,13818,
+13794,13777,13740,13725,13715,13703,13700,13699,
+13712,13719,13731,13768,13788,13810,13848,13876,
+13901,13958,14007,14052,14182,14252,14077,14172,
+14212,14249,14323,14358,14390,14441,14461,14474,
+14492,14499,14506,14520,14530,14541,14583,14586,
+14595,14624,14643,14666,14706,14727,14743,14781,
+14800,14821,14848,14852,14901,14847,14795,14778,
+14783,14764,14717,14717,14782,14763,14735,14717,
+14625,14581,14626,14599,14410,14190,14194,14111,
+14099,14049,13914,13888,14022,14146,13998,14023,
+14127,14006,14060,13793,13828,13941,14064,14111,
+14156,14225,14253,14283,14330,14354,14544,14683,
+14922,14990,14584,14637,14825,14911,14813,14854,
+14943,14998,15044,15131,15153,14842,14710,14682,
+14660,15004,14939,14850,14710,14731,14733,14752,
+14764,14760,14781,14907,14968,15086,15231,15393,
+15760,15968,16012,15906,15926,15885,15638,15544,
+15530,15536,15561,15564,15662,15684,15745,15799,
+15833,15879,15863,15885,15711,15785,16039,16071,
+15910,15965,15947,16019,15975,16009,16383,16418,
+16584,16663,16651,16679,16799,16844,16873,16971,
+17076,17146,17322,17391,17388,17445,17566,17416,
+17394,17420,17171,17189,17551,17628,17680,17710,
+17798,17767,17538,17532,17495,17491,17402,17394,
+17478,17475,17681,17694,17232,17218,17334,17315,
+17146,17125,16975,16952,16909,16874,16935,16900,
+16580,16506,16729,16693,16801,16883,16707,16805,
+16832,16790,17032,16987,16911,16823,16798,16747,
+16292,16242,16168,15924,16013,15955,15844,15783,
+15775,15300,15552,15493,15370,15299,14808,14542,
+15154,14687,14848,14793,15030,14506,14280,14246,
+14470,14434,14280,14142,14270,14221,13793,13743,
+13966,13915,13847,13808,13797,13762,13427,13370,
+13622,13594,13217,13197,13424,13422,13374,13348,
+12902,12881,12859,12817,12911,12890,12858,12842,
+12790,12795,12945,12940,12935,12937,12789,12817,
+13031,13038,12736,12745,12962,13020,13023,13012,
+12969,12948,12933,12873,12824,12788,12543,12507,
+12487,12410,12323,12294,12244,12221,12203,12171,
+12161,12150,12067,12062,12070,12085,12121,12121,
+12099,12103,12102,12083,12091,12103,12289,12300,
+12208,12216,12226,12243,12281,12298,12431,12477,
+12501,12506,12500,12499,12389,12364,12351,12350,
+12315,12320,12391,12420,12378,12391,12450,12468,
+12440,12486,12567,12590,12600,12623,12660,12706,
+12728,12749,12890,12902,12940,12967,12903,12920,
+12965,12983,12921,12962,13036,13114,13055,13033,
+13115,13171,13082,13597,13684,13485,13567,13250,
+13235,13233,13265,13690,13738,13253,13196,13207,
+13295,13293,13299,13284,13201,13191,13245,13222,
+13217,13175,13145,13137,13125,13124,13105,13076,
+13008,13001,13022,13016,12978,12972,12969,12968,
+12965,12964,12969,12965,12951,12946,12930,12921,
+13189,13382,12903,12888,12856,12837,12853,12815,
+12755,12737,12796,12774,12648,12606,12631,12606,
+12623,12602,12595,12566,12521,12505,12459,12443,
+12424,12391,12370,12353,12331,12310,12302,12257,
+12187,12160,12137,12112,12027,11965,11991,11968,
+11879,11860,11786,11764,11756,11748,11798,11795,
+11736,11729,11726,11723,11714,11708,11701,11686,
+11679,11672,11659,11653,11649,11646,11647,11649,
+11658,11664,11671,11687,11696,11705,11720,11727,
+11734,11743,11813,11815,11749,11748,11746,11743,
+11741,11740,11742,11744,11748,11759,11855,11866,
+11874,11880,11886,11898,11903,11908,11916,11920,
+11922,11924,11925,11925,11926,11927,11929,11935,
+11939,11945,11960,11969,11980,12006,12019,12034,
+12065,12081,12096,12126,12139,12152,12175,12185,
+12194,12209,12215,12220,12230,12235,12240,12252,
+12257,12265,12283,12293,12304,12329,12342,12357,
+12387,12403,12418,12448,12463,12476,12503,12514,
+12526,12549,12556,12566,12584,12592,12601,12620,
+12630,12640,12665,12677,12692,12722,12739,12756,
+12796,12813,12825,12859,12876,12890,12918,12930,
+12984,13024,13067,13074,13054,13060,13003,13016,
+13081,13092,13163,13178,13095,13136,13254,13278,
+13235,13262,13361,13428,13431,13456,13492,13513,
+13479,13535,13615,13635,13676,13697,13669,13708,
+13763,13783,13789,13815,13862,13873,13892,13926,
+14026,14067,14122,14187,14203,14248,14415,14464,
+14486,14581,14642,14682,14756,14786,14784,14871,
+14967,15019,15045,15080,15034,15103,15223,15259,
+15234,15265,15293,15349,15408,15432,15445,15467,
+15517,15572,15599,15609,15639,15643,15636,15637,
+15626,15627,15646,15644,15641,15646,15657,15658,
+15620,15619,15633,15634,15653,15648,15605,15591,
+15526,15497,15538,15515,15399,15376,15352,15303,
+15281,15255,15204,15179,15157,15115,15094,15075,
+15039,15023,15004,14961,14943,14927,14897,14882,
+14866,14842,14828,14819,14798,14786,14771,14735,
+14716,14698,14660,14645,14632,14610,14602,14591,
+14576,14568,14566,14576,14580,14592,14588,14594,
+14604,14623,14636,14645,14663,14669,14674,14679,
+14682,14684,14681,14674,14669,14660,14654,14650,
+14646,14648,14651,14660,14663,14669,14681,14688,
+14696,14710,14715,14720,14722,14717,14709,14679,
+14667,14647,14593,14569,14540,14502,14474,14459,
+14437,14432,14425,14411,14475,14474,14474,14475,
+14446,14436,14453,14447,14412,14397,14394,14370,
+14364,14353,14331,14323,14351,14317,14215,14217,
+14278,14284,14287,14324,14367,14383,14418,14455,
+14506,14595,14653,14719,14766,14789,14845,14876,
+14919,14921,14766,14741,14765,14703,14646,14582,
+14436,14388,14392,14336,14305,14281,14188,14196,
+14211,14224,14314,14468,14341,14373,14394,14470,
+14547,14643,15119,15335,14990,14750,14842,14806,
+14965,15197,14901,14995,15228,15435,15819,15847,
+15770,15498,15361,15289,15149,15283,15134,15201,
+15255,15270,15343,15371,15488,15806,16023,16059,
+16162,16317,16481,16529,16465,16418,16327,16055,
+15758,15894,16175,16451,16577,16737,16801,16922,
+16802,16813,17019,16986,16927,16669,16497,16555,
+17215,17235,17150,17180,17297,17306,17345,17348,
+17173,17129,17101,17094,17259,17254,17237,17229,
+17271,17253,17203,17190,16927,16886,17048,17033,
+16872,16853,16660,16599,16666,16645,16971,16947,
+16537,16444,16619,16580,16438,16326,15830,15573,
+15584,15550,15467,15435,15444,15409,15481,15447,
+15315,15279,15254,15166,15049,15045,14879,14894,
+15232,14693,14693,14652,14339,14304,14978,14948,
+14469,14870,14395,14364,14387,14324,14478,14423,
+14220,14277,14040,13961,14014,13974,13570,13534,
+13580,13535,13492,13469,13639,13621,13558,13526,
+13550,13537,13471,13460,13335,13318,13448,13433,
+13227,13213,13170,13153,13233,13217,13011,12999,
+13096,13119,13215,13208,13201,13198,13150,13145,
+13170,13169,13074,13072,13082,13073,13066,13052,
+13006,12983,12960,12903,12861,12830,12720,12687,
+12505,12399,12330,12303,12317,12296,12263,12218,
+12162,12150,12148,12140,12117,12109,12174,12173,
+12269,12268,12153,12145,12195,12200,12181,12190,
+12155,12183,12254,12269,12259,12275,12404,12437,
+12395,12402,12381,12384,12476,12486,12439,12439,
+12350,12356,12375,12384,12366,12378,12537,12550,
+12432,12470,12491,12512,12565,12587,12599,12644,
+12739,12761,12770,12789,12822,12856,12853,12871,
+12916,12923,13000,13038,12966,12986,13033,13055,
+13022,13029,13040,13053,13095,13098,13148,13133,
+13077,13079,13154,13121,13087,13074,13050,13055,
+13065,13061,13069,13068,13085,13078,13134,13125,
+13007,12971,12969,12964,13049,13043,12965,12945,
+12959,12953,12891,12881,12923,12904,12842,12829,
+12805,12794,12783,12773,12840,12833,12812,12806,
+12729,12712,12729,12722,12680,12673,12705,12683,
+12635,12623,12674,12662,12591,12564,12611,12595,
+12572,12555,12556,12522,12468,12455,12448,12434,
+12434,12388,12286,12270,12347,12333,12317,12257,
+12154,12133,12200,12180,12055,12014,12077,12062,
+11955,11942,11931,11913,11905,11899,11889,11883,
+11879,11869,11863,11857,11844,11839,11832,11820,
+11813,11808,11799,11797,11821,11814,11793,11795,
+11801,11805,11811,11823,11858,11864,11846,11850,
+11854,11858,11859,11860,11858,11856,11854,11850,
+11848,11847,11846,11846,11848,11854,11858,11863,
+11970,11974,11977,11985,11995,11998,11998,12001,
+12004,12008,12011,12013,12019,12022,12025,12032,
+12035,12039,12048,12051,12056,12065,12069,12073,
+12082,12086,12089,12095,12098,12101,12108,12111,
+12115,12123,12128,12133,12147,12156,12165,12186,
+12199,12213,12242,12257,12274,12308,12325,12341,
+12375,12390,12406,12433,12445,12456,12474,12482,
+12510,12530,12505,12507,12515,12519,12523,12533,
+12539,12546,12563,12573,12584,12608,12622,12636,
+12666,12681,12696,12725,12740,12753,12778,12790,
+12858,12893,12908,12917,12943,12951,12869,12885,
+12985,12996,13028,13041,12955,12981,13093,13108,
+13041,13054,13135,13182,13195,13205,13193,13200,
+13142,13152,13247,13250,13252,13256,13215,13229,
+13284,13294,13231,13247,13320,13364,13328,13352,
+13476,13502,13531,13575,13549,13573,13698,13719,
+13739,13765,13764,13778,13823,13832,13768,13798,
+13882,13892,13920,13933,13852,13887,14001,14024,
+13990,14019,13995,14042,14109,14132,14137,14161,
+14207,14270,14305,14322,14381,14392,14386,14406,
+14409,14418,14436,14445,14442,14451,14470,14473,
+14429,14425,14445,14465,14507,14516,14504,14511,
+14461,14481,14560,14563,14496,14498,14500,14501,
+14497,14493,14482,14475,14464,14443,14434,14425,
+14406,14395,14382,14349,14337,14325,14301,14290,
+14276,14247,14233,14217,14193,14189,14179,14160,
+14151,14141,14122,14112,14102,14083,14074,14065,
+14045,14034,14021,14000,13989,13979,13958,13947,
+13936,13914,13902,13894,13881,13872,13864,13842,
+13837,13831,13819,13815,13812,13809,13809,13813,
+13816,13819,13822,13827,13831,13832,13833,13833,
+13831,13829,13828,13828,13836,13841,13840,13847,
+13851,13857,13872,13879,13887,13903,13912,13923,
+13947,13962,13980,14020,14116,14132,14162,14177,
+14181,14191,14198,14203,14196,14192,14193,14183,
+14176,14163,14152,14142,14149,14118,14040,14027,
+14080,14066,14040,14004,14010,13993,13932,13914,
+13898,13846,13813,13782,13709,13674,13645,13581,
+13541,13518,13449,13439,13450,13454,13484,13484,
+13407,13416,13498,13541,13551,13567,13516,13532,
+13548,13586,13603,13619,13711,13730,13766,13799,
+13819,13832,13868,13888,13962,14018,14155,14230,
+14602,14605,14370,14359,14424,14467,14581,14651,
+14545,14641,14684,14561,14586,14600,14518,14554,
+14713,14727,14787,14807,14830,14864,14942,14952,
+14927,14938,14988,14996,14998,15006,15022,15029,
+14761,14788,15099,15110,15137,15149,15134,15093,
+14848,14859,15221,15225,15224,15186,14957,14965,
+15253,15301,15246,15248,15269,15266,15334,15331,
+15056,15031,14961,14955,15223,15216,15227,15267,
+15287,15277,15170,15157,14939,14936,15150,15205,
+15098,15074,14940,15095,15398,15407,15658,15645,
+14907,14657,14796,14674,14607,14590,14582,14568,
+14619,14601,14411,14392,14466,14473,14595,14575,
+14551,14532,14586,14519,14355,14335,14141,14121,
+13947,13896,14218,14196,13807,13791,14083,14105,
+14132,14035,14068,14049,14023,13986,13978,13959,
+13906,13889,13881,13853,13840,13824,13492,13479,
+13466,13447,13444,13435,13637,13630,13653,13641,
+13614,13609,13632,13628,13417,13413,13601,13599,
+13519,13517,13492,13492,13534,13529,13330,13327,
+13463,13492,13562,13551,13534,13519,13492,13445,
+13392,13369,13314,13285,13195,13117,13082,13046,
+12959,12921,12880,12799,12741,12705,12634,12600,
+12388,12286,12237,12217,12243,12228,12194,12163,
+12135,12132,12154,12154,12132,12140,12202,12207,
+12330,12333,12229,12237,12326,12329,12207,12213,
+12203,12227,12304,12311,12260,12269,12377,12396,
+12340,12345,12324,12331,12460,12487,12451,12456,
+12396,12404,12379,12387,12392,12405,12562,12573,
+12441,12479,12493,12505,12540,12553,12557,12589,
+12689,12703,12672,12685,12709,12736,12748,12759,
+12802,12816,12930,12961,12853,12868,12922,12934,
+12915,12935,12990,12991,12924,12927,12991,12974,
+12917,12924,12989,12949,12917,12920,12914,12884,
+12863,12864,12891,12873,12911,12910,12974,12972,
+12836,12802,12801,12797,12901,12992,12869,12825,
+12867,12952,12851,12837,12895,12885,12803,12796,
+12782,12775,12768,12755,12743,12732,12713,12702,
+12591,12556,12573,12563,12516,12507,12495,12470,
+12432,12424,12466,12460,12421,12409,12458,12451,
+12433,12426,12430,12412,12369,12361,12366,12360,
+12371,12336,12259,12252,12326,12318,12308,12268,
+12201,12193,12264,12257,12161,12143,12203,12195,
+12109,12100,12092,12077,12070,12063,12051,12046,
+12041,12032,12027,12023,12017,12014,12012,12007,
+12007,12005,12002,12000,12035,12023,11994,11992,
+11987,11985,11982,11987,12028,12026,11965,11961,
+11958,11952,11949,11946,11942,11940,11939,11939,
+11939,11940,11944,11946,11949,11955,11959,11963,
+12033,12035,12036,12038,12039,12039,12039,12039,
+12039,12038,12038,12038,12039,12040,12041,12045,
+12047,12049,12056,12061,12065,12075,12081,12086,
+12097,12103,12110,12122,12128,12133,12146,12152,
+12158,12170,12175,12181,12194,12201,12208,12221,
+12229,12236,12253,12260,12268,12286,12295,12303,
+12320,12329,12337,12353,12361,12369,12383,12391,
+12398,12413,12421,12427,12444,12452,12461,12478,
+12488,12498,12519,12530,12541,12564,12575,12587,
+12634,12646,12632,12651,12661,12670,12709,12716,
+12702,12715,12722,12729,12757,12764,12760,12778,
+12803,12814,12902,12915,12917,12944,12981,12995,
+13019,13032,13036,13055,13063,13072,13055,13062,
+13068,13086,13131,13134,13113,13117,13138,13152,
+13153,13160,13178,13188,13199,13225,13250,13263,
+13278,13294,13311,13343,13355,13370,13387,13399,
+13425,13444,13442,13448,13464,13466,13466,13469,
+13471,13475,13505,13510,13504,13515,13515,13529,
+13590,13607,13615,13657,13676,13697,13657,13677,
+13737,13776,13758,13775,13805,13819,13833,13849,
+13877,13883,13852,13858,13862,13870,13874,13878,
+13884,13889,13893,13903,13908,13914,13926,13933,
+13940,13953,13959,13965,13976,13980,13984,13991,
+13993,13994,13995,13995,13992,13987,13984,13980,
+13971,13966,13962,13951,13945,13938,13924,13916,
+13907,13890,13882,13873,13851,13841,13831,13810,
+13800,13792,13769,13759,13749,13728,13716,13707,
+13687,13678,13670,13656,13649,13644,13634,13631,
+13627,13622,13619,13616,13615,13616,13616,13617,
+13616,13616,13625,13628,13629,13629,13633,13632,
+13626,13618,13615,13608,13601,13594,13571,13561,
+13554,13543,13538,13533,13528,13527,13527,13533,
+13541,13555,13589,13601,13619,13635,13653,13672,
+13766,13782,13739,13771,13859,13876,13891,13898,
+13898,13898,13903,13897,13835,13825,13861,13849,
+13819,13805,13771,13745,13714,13674,13652,13634,
+13605,13582,13546,13512,13491,13473,13467,13453,
+13419,13383,13364,13348,13346,13334,13299,13278,
+13271,13265,13272,13270,13269,13286,13292,13293,
+13299,13302,13303,13316,13327,13335,13354,13362,
+13373,13401,13418,13429,13447,13460,13477,13513,
+13604,13617,13575,13598,13621,13644,13682,13699,
+13739,13755,13881,13955,13991,14015,14126,14148,
+14166,14211,14402,14358,14419,14514,14665,14652,
+14714,14720,14730,14755,14680,14584,14513,14524,
+14735,14719,14668,14652,14675,14696,14910,14967,
+14951,14930,15001,14983,14983,14906,14897,14868,
+14746,14777,15177,15191,15238,15251,15266,15263,
+14912,14915,14976,14978,14970,14965,15153,15090,
+14976,14896,14884,14879,14358,14348,14551,14571,
+14566,14559,14577,14570,14340,14281,14292,14290,
+14290,14289,14273,14319,14517,14509,14239,14230,
+14176,14164,14178,14317,14088,14080,14085,14078,
+14070,14055,13977,13966,14017,14007,13995,13982,
+13921,13905,13881,13846,13840,13824,13791,13774,
+13778,13744,13704,13686,13642,13626,13668,13632,
+13589,13576,13554,13548,13559,13549,13525,13524,
+13499,13499,13500,13528,13670,13669,13468,13468,
+13472,13519,13669,13664,13467,13461,13436,13465,
+13592,13582,13382,13372,13362,13382,13502,13490,
+13292,13283,13437,13420,13257,13249,13398,13390,
+13422,13406,13365,13355,13357,13344,13346,13313,
+13277,13257,13205,13179,13162,13093,13008,12976,
+12913,12878,12814,12712,12543,12509,12433,12403,
+12387,12344,12337,12315,12189,12174,12163,12145,
+12250,12244,12128,12128,12129,12133,12137,12142,
+12152,12159,12305,12351,12223,12228,12245,12252,
+12352,12383,12399,12403,12248,12254,12241,12251,
+12285,12291,12300,12306,12285,12296,12321,12328,
+12419,12425,12351,12378,12499,12508,12403,12415,
+12510,12559,12556,12570,12614,12626,12665,12698,
+12700,12714,12739,12752,12771,12794,12793,12804,
+12837,12849,12863,12890,12918,12928,12824,12834,
+12921,12952,12960,12966,13018,13031,13040,12975,
+12987,12989,12966,12980,13013,12944,12924,12924,
+12797,12791,12874,12865,12762,12765,12815,12811,
+12810,12798,12782,12763,12752,12747,12743,12864,
+12820,12791,12959,12923,12894,12866,12856,12847,
+12833,12827,12866,12871,12883,12865,12980,12950,
+12914,13003,12887,12679,12652,12698,12693,12666,
+12647,12445,12430,12424,12416,12528,12512,12504,
+12544,12610,12564,12593,12367,12291,12285,12282,
+12279,12274,12271,12267,12260,12257,12252,12242,
+12237,12231,12220,12214,12208,12194,12188,12182,
+12173,12168,12163,12153,12148,12202,12174,12220,
+12206,12228,12252,12250,12218,12145,12162,12144,
+12104,12101,12096,12093,12091,12085,12081,12077,
+12069,12064,12058,12049,12045,12040,12032,12028,
+12024,12017,12014,12012,12010,12009,12009,12010,
+12012,12013,12017,12019,12021,12025,12028,12030,
+12068,12068,12067,12064,12062,12059,12055,12052,
+12050,12046,12044,12042,12040,12040,12040,12043,
+12045,12047,12054,12059,12065,12078,12085,12091,
+12107,12116,12124,12140,12149,12157,12172,12178,
+12185,12198,12203,12208,12216,12219,12223,12228,
+12230,12233,12236,12238,12240,12244,12247,12250,
+12257,12261,12265,12277,12284,12291,12307,12316,
+12326,12348,12359,12372,12397,12410,12423,12450,
+12464,12477,12503,12515,12527,12549,12560,12570,
+12613,12621,12602,12615,12620,12625,12656,12660,
+12641,12649,12653,12657,12679,12685,12678,12692,
+12716,12725,12811,12822,12822,12847,12883,12896,
+12919,12930,12934,12955,12964,12972,12956,12963,
+12968,12988,13033,13037,13015,13018,13039,13048,
+13046,13049,13058,13062,13067,13079,13095,13102,
+13101,13110,13121,13139,13146,13156,13167,13176,
+13203,13220,13219,13226,13247,13252,13254,13258,
+13260,13262,13287,13289,13276,13274,13264,13268,
+13306,13310,13317,13333,13340,13346,13280,13288,
+13339,13356,13329,13338,13354,13364,13375,13387,
+13405,13412,13380,13385,13391,13401,13406,13410,
+13417,13421,13424,13429,13432,13435,13439,13442,
+13444,13449,13451,13453,13457,13459,13462,13465,
+13466,13468,13471,13473,13475,13479,13480,13483,
+13487,13489,13492,13498,13501,13503,13507,13509,
+13511,13513,13513,13513,13509,13507,13505,13496,
+13491,13485,13471,13465,13456,13439,13430,13421,
+13401,13392,13383,13367,13360,13352,13340,13336,
+13332,13327,13325,13323,13322,13321,13321,13321,
+13321,13321,13319,13317,13315,13308,13304,13299,
+13288,13289,13280,13263,13256,13248,13225,13217,
+13208,13187,13179,13172,13154,13147,13141,13131,
+13127,13124,13121,13120,13121,13123,13125,13126,
+13191,13192,13131,13131,13202,13199,13197,13191,
+13181,13168,13167,13158,13091,13083,13125,13115,
+13090,13084,13086,13081,13066,13058,13052,13052,
+13078,13080,13065,13067,13064,13068,13100,13104,
+13087,13089,13090,13092,13124,13125,13102,13098,
+13098,13098,13113,13113,13115,13116,13117,13118,
+13121,13123,13124,13132,13140,13145,13160,13168,
+13176,13196,13214,13223,13241,13252,13263,13306,
+13408,13422,13355,13370,13379,13404,13415,13429,
+13457,13470,13589,13636,13662,13674,13761,13773,
+13776,13792,13794,13801,13838,13846,13851,13868,
+13881,13889,13912,13921,13922,13943,13968,13982,
+14024,14043,14049,14048,14029,14040,14104,14114,
+14090,14125,14252,14263,14330,14352,14329,14366,
+14310,14304,14347,14306,14317,14316,14325,14324,
+13968,13971,14034,14028,14012,14013,14227,14193,
+14122,14120,14205,14202,13928,13928,14147,14183,
+14185,14180,14203,14198,13963,13900,13907,13901,
+13899,13893,13871,13905,14107,14096,13808,13799,
+13789,13778,13796,13785,13674,13668,13676,13684,
+13830,13809,13735,13727,13791,13769,13764,13764,
+13724,13725,13714,13666,13661,13653,13610,13600,
+13614,13588,13554,13543,13509,13499,13536,13519,
+13481,13474,13465,13461,13474,13468,13446,13447,
+13426,13429,13433,13469,13617,13620,13429,13434,
+13444,13503,13657,13657,13471,13469,13450,13485,
+13616,13607,13413,13402,13392,13409,13525,13510,
+13304,13291,13438,13408,13236,13221,13355,13339,
+13363,13330,13282,13264,13254,13235,13232,13191,
+13151,13129,13076,13051,13036,12972,12891,12863,
+12810,12781,12725,12636,12474,12448,12387,12364,
+12355,12323,12320,12302,12184,12173,12163,12148,
+12253,12247,12132,12131,12132,12135,12138,12142,
+12152,12158,12304,12349,12220,12225,12242,12248,
+12348,12377,12391,12394,12236,12240,12227,12235,
+12268,12272,12279,12283,12259,12269,12295,12301,
+12390,12398,12322,12345,12467,12475,12363,12374,
+12469,12519,12520,12537,12580,12588,12624,12644,
+12642,12654,12679,12692,12712,12733,12729,12740,
+12768,12778,12790,12811,12837,12844,12727,12732,
+12817,12842,12844,12848,12879,12882,12896,12907,
+12926,12931,12924,12936,12962,12866,12846,12843,
+12754,12701,12789,12779,12674,12674,12733,12788,
+12775,12756,12717,12690,12688,12688,12688,12689,
+12738,12672,12859,12828,12804,12911,12962,12986,
+12905,13057,12980,13027,13081,13113,13133,13155,
+13158,13049,12954,12936,12689,12689,12700,12753,
+12798,12843,12813,12801,12792,12780,12776,12765,
+12681,12598,12598,12706,12748,12740,12716,12630,
+12590,12579,12526,12477,12369,12364,12362,12395,
+12385,12432,12474,12511,12500,12501,12488,12507,
+12495,12492,12486,12429,12346,12341,12346,12339,
+12245,12277,12275,12257,12269,12320,12328,12215,
+12173,12170,12164,12244,12238,12197,12200,12151,
+12100,12095,12090,12082,12077,12073,12066,12063,
+12059,12055,12054,12053,12053,12053,12054,12057,
+12058,12060,12063,12064,12066,12068,12069,12069,
+12111,12113,12114,12116,12116,12117,12117,12117,
+12116,12115,12114,12113,12110,12109,12108,12105,
+12104,12103,12101,12100,12099,12099,12099,12099,
+12101,12101,12103,12105,12107,12109,12114,12116,
+12119,12125,12128,12131,12137,12141,12144,12152,
+12157,12161,12170,12174,12178,12189,12194,12199,
+12211,12216,12222,12235,12241,12248,12260,12267,
+12273,12287,12294,12299,12360,12367,12325,12336,
+12340,12345,12418,12423,12365,12373,12377,12380,
+12387,12390,12394,12413,12489,12495,12424,12429,
+12435,12448,12458,12465,12481,12491,12567,12586,
+12535,12546,12687,12700,12638,12652,12723,12735,
+12750,12760,12770,12781,12709,12715,12721,12725,
+12754,12761,12742,12742,12765,12765,12814,12799,
+12735,12733,12824,12824,12840,12840,12824,12825,
+12789,12792,12850,12865,12846,12851,12845,12852,
+12852,12870,12897,12904,12891,12898,12907,12922,
+12961,12965,12926,12929,12968,12969,12979,12979,
+12996,12994,12963,12957,12977,12974,12931,12928,
+12927,12933,12973,12973,12958,12959,12932,12918,
+12869,12874,12981,12987,12993,13008,13019,13026,
+13047,13052,12981,12990,13050,13054,12979,12982,
+12986,12989,12987,12987,13064,13060,13033,12999,
+12962,12956,12945,12939,12933,12923,12918,12914,
+12988,12984,12901,12900,12884,12882,12882,12882,
+12882,12885,12888,12890,12896,12899,12902,12908,
+12911,12914,12918,12920,12921,12922,12921,12920,
+12917,12915,12911,12904,12900,12895,12884,12880,
+12874,12863,12857,12851,12840,12836,12831,12822,
+12818,12815,12810,12808,12806,12804,12804,12804,
+12805,12806,12807,12810,12811,12812,12815,12816,
+12818,12819,12820,12820,12820,12819,12818,12814,
+12812,12809,12803,12800,12797,12789,12784,12780,
+12853,12848,12829,12817,12813,12809,12802,12799,
+12787,12785,12798,12798,12800,12800,12804,12805,
+12803,12805,12818,12819,12822,12825,12821,12823,
+12829,12829,12835,12833,12818,12816,12831,12827,
+12814,12804,12803,12798,12759,12755,12767,12760,
+12757,12754,12749,12746,12748,12746,12746,12748,
+12749,12753,12748,12757,12763,12772,12791,12800,
+12811,12836,12863,12875,12897,12909,12924,12942,
+12936,12946,12981,12989,12992,13005,13011,13016,
+13025,13028,13022,13026,13036,13038,13041,13044,
+13061,13083,13141,13145,13192,13199,13207,13209,
+13143,13153,13138,13151,13348,13407,13413,13425,
+13278,13292,13460,13514,13539,13549,13548,13554,
+13570,13582,13585,13588,13580,13580,13609,13607,
+13573,13571,13621,13619,13587,13581,13601,13600,
+13612,13612,13565,13558,13551,13556,13594,13600,
+13628,13642,13628,13635,13639,13647,13640,13617,
+13440,13447,13472,13478,13674,13678,13492,13492,
+13477,13475,13481,13508,13670,13663,13683,13675,
+13642,13616,13610,13604,13424,13422,13528,13554,
+13594,13593,13588,13589,13474,13477,13576,13581,
+13621,13626,13503,13462,13361,13367,13473,13478,
+13501,13510,13511,13512,13455,13454,13495,13498,
+13497,13492,13493,13487,13447,13425,13390,13383,
+13383,13376,13365,13349,13338,13331,13297,13289,
+13275,13233,13226,13220,13207,13200,13226,13280,
+13443,13433,13392,13380,13221,13175,13211,13196,
+13244,13226,13034,12965,13007,12986,12867,12846,
+12828,12787,12769,12747,12692,12671,12658,12613,
+12582,12560,12603,12582,12518,12466,12460,12441,
+12376,12359,12363,12339,12323,12310,12265,12256,
+12358,12360,12344,12337,12336,12330,12292,12279,
+12286,12282,12265,12263,12179,12180,12270,12269,
+12179,12179,12173,12191,12277,12277,12186,12188,
+12183,12207,12296,12299,12207,12212,12189,12220,
+12323,12330,12331,12339,12346,12366,12395,12404,
+12404,12412,12414,12432,12451,12458,12360,12368,
+12459,12494,12511,12525,12551,12567,12577,12605,
+12632,12637,12631,12631,12623,12613,12609,12606,
+12612,12616,12628,12637,12638,12642,12651,12654,
+12641,12648,12652,12655,12658,12661,12666,12674,
+12663,12667,12674,12679,12609,12616,12619,12622,
+12704,12998,12956,12896,12889,12858,12855,12854,
+12703,12695,12703,12690,12689,12685,12675,12651,
+12642,12640,12674,12670,12659,12639,12567,12560,
+12500,12493,12565,12558,12468,12463,12451,12447,
+12518,12512,12429,12426,12422,12421,12419,12595,
+12579,12551,12508,12493,12628,12591,12590,12706,
+12648,12743,12718,12784,12845,12827,12769,12742,
+12808,12767,12743,12725,12691,12674,12597,12506,
+12544,12513,12477,12536,12572,12557,12558,12553,
+12614,12609,12598,12567,12562,12509,12478,12473,
+12423,12398,12497,12393,12253,12248,12244,12235,
+12230,12225,12214,12209,12203,12191,12184,12178,
+12167,12161,12154,12142,12136,12131,12219,12198,
+12174,12140,12131,12125,12113,12108,12104,12097,
+12095,12096,12098,12100,12101,12105,12106,12108,
+12104,12105,12105,12107,12107,12108,12109,12109,
+12109,12110,12110,12110,12110,12110,12110,12109,
+12109,12108,12107,12107,12106,12106,12106,12105,
+12105,12106,12106,12107,12108,12109,12111,12113,
+12114,12119,12121,12124,12129,12132,12135,12142,
+12146,12150,12159,12163,12168,12176,12181,12186,
+12196,12201,12206,12215,12220,12225,12234,12239,
+12243,12252,12257,12260,12317,12321,12276,12283,
+12286,12290,12358,12362,12303,12309,12312,12315,
+12323,12327,12331,12350,12426,12432,12362,12368,
+12374,12387,12396,12404,12418,12426,12502,12516,
+12464,12472,12609,12620,12555,12564,12632,12642,
+12652,12660,12668,12675,12602,12608,12614,12619,
+12647,12657,12638,12641,12670,12672,12722,12713,
+12652,12653,12749,12751,12771,12775,12760,12763,
+12729,12732,12790,12803,12784,12788,12778,12783,
+12780,12792,12816,12820,12800,12803,12809,12816,
+12852,12853,12809,12809,12845,12843,12850,12849,
+12864,12862,12830,12823,12843,12840,12796,12793,
+12792,12797,12837,12835,12818,12818,12790,12772,
+12720,12724,12829,12833,12836,12847,12856,12861,
+12877,12881,12806,12811,12871,12874,12796,12798,
+12801,12803,12801,12801,12882,12880,12853,12820,
+12783,12779,12769,12765,12759,12750,12746,12741,
+12814,12809,12722,12716,12714,12711,12708,12707,
+12707,12708,12709,12710,12714,12715,12718,12724,
+12727,12730,12736,12739,12742,12747,12749,12751,
+12753,12754,12754,12753,12752,12750,12746,12743,
+12739,12732,12728,12723,12714,12709,12704,12693,
+12688,12682,12673,12668,12663,12653,12649,12645,
+12637,12634,12631,12626,12624,12622,12618,12616,
+12615,12613,12612,12611,12610,12610,12610,12609,
+12609,12609,12609,12609,12608,12608,12608,12608,
+12692,12692,12675,12673,12673,12673,12674,12674,
+12665,12667,12682,12683,12689,12690,12693,12694,
+12692,12692,12703,12703,12704,12703,12698,12697,
+12701,12700,12705,12702,12687,12686,12702,12701,
+12690,12685,12687,12686,12656,12656,12674,12677,
+12679,12680,12686,12688,12695,12702,12706,12710,
+12716,12722,12718,12730,12737,12745,12761,12769,
+12778,12798,12823,12831,12845,12852,12864,12873,
+12863,12869,12896,12901,12902,12910,12915,12919,
+12925,12928,12923,12927,12938,12941,12946,12950,
+12969,12993,13052,13058,13107,13114,13123,13125,
+13058,13068,13051,13063,13260,13316,13322,13332,
+13180,13192,13359,13413,13435,13443,13440,13446,
+13461,13470,13473,13476,13469,13470,13501,13500,
+13466,13465,13518,13516,13485,13481,13503,13502,
+13514,13514,13466,13459,13451,13454,13490,13495,
+13521,13532,13515,13522,13523,13530,13523,13500,
+13322,13330,13359,13367,13566,13575,13389,13393,
+13385,13388,13386,13439,13607,13607,13640,13638,
+13610,13593,13591,13589,13414,13413,13520,13547,
+13586,13584,13574,13572,13454,13449,13544,13544,
+13574,13574,13445,13394,13289,13291,13389,13391,
+13411,13416,13416,13416,13355,13355,13396,13400,
+13400,13396,13399,13394,13355,13335,13299,13294,
+13292,13285,13272,13254,13240,13230,13190,13180,
+13163,13111,13100,13089,13064,13052,13074,13118,
+13278,13262,13213,13195,13030,12977,13009,12992,
+13037,13017,12821,12752,12794,12774,12656,12637,
+12622,12588,12574,12555,12510,12494,12487,12454,
+12429,12415,12472,12458,12401,12364,12365,12353,
+12302,12295,12305,12295,12285,12278,12244,12240,
+12347,12358,12345,12341,12346,12342,12306,12296,
+12301,12298,12281,12278,12194,12192,12279,12276,
+12182,12180,12172,12186,12270,12268,12172,12173,
+12166,12187,12274,12274,12177,12180,12158,12187,
+12290,12296,12296,12303,12312,12332,12361,12370,
+12371,12379,12382,12400,12418,12425,12328,12335,
+12425,12463,12481,12488,12501,12510,12514,12539,
+12567,12577,12577,12582,12582,12583,12581,12579,
+12579,12576,12581,12578,12575,12575,12577,12579,
+12564,12568,12570,12572,12575,12577,12579,12581,
+12568,12570,12572,12575,12503,12506,12508,12511,
+12593,12898,12850,12759,12733,12712,12982,12945,
+12880,12814,12805,12799,12653,12658,12653,12661,
+12584,12583,12620,12619,12611,12597,12550,12547,
+12510,12507,12591,12605,12524,12525,12525,12524,
+12603,12749,12651,12631,12553,12511,12430,12430,
+12426,12425,12419,12418,12416,12413,12425,12420,
+12400,12397,12395,12389,12385,12382,12373,12367,
+12361,12350,12344,12340,12328,12322,12317,12306,
+12300,12297,12287,12283,12278,12271,12268,12264,
+12259,12255,12254,12249,12248,12245,12242,12241,
+12447,12448,12517,12493,12324,12306,12294,12430,
+12421,12409,12391,12423,12382,12314,12208,12201,
+12188,12181,12174,12163,12160,12156,12147,12142,
+12137,12130,12126,12123,12117,12115,12113,12108,
+12107,12105,12104,12103,12103,12103,12103,12103,
+12087,12086,12086,12085,12084,12084,12084,12085,
+12084,12085,12085,12086,12086,12087,12087,12088,
+12088,12088,12089,12089,12089,12090,12090,12090,
+12090,12090,12090,12091,12092,12092,12093,12094,
+12095,12096,12097,12099,12101,12103,12104,12108,
+12110,12112,12117,12120,12122,12128,12131,12134,
+12141,12144,12148,12155,12159,12164,12172,12175,
+12180,12188,12193,12198,12207,12212,12215,12225,
+12229,12234,12244,12249,12254,12262,12267,12272,
+12282,12287,12292,12302,12307,12312,12322,12328,
+12333,12343,12349,12354,12365,12371,12376,12386,
+12392,12397,12408,12413,12418,12428,12432,12437,
+12511,12517,12518,12522,12516,12520,12482,12485,
+12520,12554,12556,12560,12557,12561,12526,12528,
+12537,12541,12602,12607,12610,12619,12610,12616,
+12624,12630,12598,12609,12615,12620,12632,12636,
+12642,12652,12656,12661,12669,12672,12675,12680,
+12682,12684,12687,12687,12687,12687,12686,12685,
+12682,12680,12678,12674,12672,12669,12663,12660,
+12657,12652,12649,12646,12642,12640,12638,12634,
+12632,12632,12630,12629,12629,12628,12628,12629,
+12659,12659,12654,12632,12629,12629,12629,12629,
+12628,12627,12626,12625,12623,12621,12620,12616,
+12614,12612,12607,12605,12603,12598,12596,12594,
+12590,12589,12588,12585,12584,12583,12581,12581,
+12581,12582,12582,12583,12586,12587,12589,12591,
+12593,12595,12599,12601,12603,12607,12609,12611,
+12614,12615,12616,12617,12618,12618,12618,12618,
+12617,12615,12614,12612,12609,12607,12605,12601,
+12598,12596,12592,12590,12588,12583,12581,12579,
+12576,12574,12573,12570,12569,12568,12567,12567,
+12566,12566,12566,12567,12568,12568,12569,12571,
+12572,12572,12574,12575,12576,12579,12580,12580,
+12607,12608,12587,12590,12625,12626,12604,12605,
+12600,12611,12665,12665,12660,12660,12651,12653,
+12672,12672,12674,12674,12674,12674,12674,12674,
+12674,12674,12677,12678,12676,12677,12681,12682,
+12681,12684,12687,12689,12689,12691,12706,12713,
+12715,12717,12724,12727,12727,12734,12740,12744,
+12744,12747,12755,12761,12762,12765,12771,12774,
+12766,12757,12696,12698,12791,12792,12733,12723,
+12723,12724,12727,12729,12729,12733,12743,12745,
+12787,12789,12772,12773,12766,12771,12853,12859,
+12852,12872,12920,12927,12953,12962,12979,12990,
+12949,12960,13018,13030,13100,13131,13127,13137,
+13127,13136,13191,13221,13244,13252,13208,13215,
+13261,13283,13294,13297,13309,13312,13322,13325,
+13324,13324,13324,13324,13318,13318,13329,13328,
+13263,13263,13307,13307,13263,13265,13320,13323,
+13360,13371,13362,13366,13379,13383,13347,13343,
+13316,13322,13336,13341,13410,13419,13351,13357,
+13419,13423,13377,13381,13412,13416,13437,13439,
+13438,13421,13339,13339,13308,13308,13319,13324,
+13345,13344,13388,13386,13385,13388,13419,13416,
+13414,13410,13293,13254,13212,13209,13248,13245,
+13243,13236,13228,13224,13182,13178,13209,13207,
+13203,13198,13183,13178,13170,13155,13132,13127,
+13124,13117,13164,13159,13150,13141,13122,13112,
+13089,13057,13011,13000,12982,12969,13004,12993,
+13018,13004,12971,12956,12903,12865,12858,12841,
+12755,12738,12741,12712,12707,12689,12632,12614,
+12597,12566,12558,12542,12424,12409,12402,12376,
+12360,12347,12346,12335,12306,12285,12284,12275,
+12262,12256,12243,12231,12233,12228,12217,12215,
+12291,12291,12246,12243,12230,12228,12204,12210,
+12273,12271,12211,12209,12165,12174,12256,12255,
+12239,12238,12237,12240,12257,12257,12225,12224,
+12160,12151,12170,12171,12246,12248,12241,12252,
+12281,12284,12255,12258,12295,12312,12322,12327,
+12343,12349,12351,12360,12354,12359,12278,12284,
+12359,12385,12382,12386,12376,12381,12353,12364,
+12406,12413,12426,12436,12448,12462,12453,12461,
+12455,12457,12471,12473,12472,12470,12466,12465,
+12447,12442,12440,12439,12404,12404,12404,12407,
+12409,12410,12414,12417,12418,12421,12423,12424,
+12427,12430,12433,12438,12446,12447,12439,12440,
+12448,12453,12456,12457,12461,12461,12452,12450,
+12450,12451,12451,12452,12452,12452,12453,12455,
+12456,12457,12457,12458,12459,12459,12460,12461,
+12460,12560,12551,12542,12522,12511,12691,12643,
+12616,12594,12562,12549,12756,12655,12425,12422,
+12413,12410,12405,12395,12389,12384,12373,12367,
+12360,12347,12340,12333,12320,12314,12307,12295,
+12291,12283,12273,12271,12264,12257,12254,12250,
+12245,12242,12239,12235,12234,12232,12229,12228,
+12227,12224,12223,12222,12219,12218,12217,12214,
+12212,12210,12205,12204,12201,12195,12192,12188,
+12181,12178,12175,12169,12164,12161,12153,12150,
+12146,12138,12134,12131,12124,12120,12117,12110,
+12106,12104,12099,12097,12095,12092,12090,12089,
+12080,12080,12081,12083,12084,12085,12088,12089,
+12090,12093,12095,12096,12100,12102,12104,12107,
+12109,12110,12113,12115,12116,12119,12120,12121,
+12122,12123,12123,12124,12124,12124,12124,12123,
+12123,12122,12121,12120,12119,12118,12116,12114,
+12113,12112,12110,12109,12108,12106,12105,12105,
+12103,12103,12102,12102,12102,12103,12104,12104,
+12105,12107,12109,12110,12114,12116,12118,12123,
+12126,12129,12135,12138,12142,12150,12154,12158,
+12167,12171,12175,12184,12189,12194,12204,12209,
+12214,12223,12228,12233,12243,12248,12253,12262,
+12267,12272,12281,12286,12290,12299,12303,12307,
+12375,12379,12356,12361,12377,12381,12344,12347,
+12368,12404,12411,12414,12399,12401,12373,12377,
+12389,12392,12414,12417,12410,12414,12418,12421,
+12427,12429,12412,12417,12419,12422,12426,12429,
+12432,12437,12440,12443,12448,12451,12453,12459,
+12462,12464,12469,12472,12474,12480,12483,12485,
+12491,12494,12496,12502,12505,12507,12512,12515,
+12518,12524,12527,12530,12536,12539,12543,12549,
+12551,12554,12561,12564,12567,12574,12577,12580,
+12587,12590,12605,12598,12601,12604,12610,12613,
+12616,12620,12623,12625,12629,12631,12632,12635,
+12636,12637,12638,12639,12639,12639,12639,12639,
+12638,12637,12636,12633,12632,12631,12628,12626,
+12623,12619,12616,12614,12608,12605,12603,12597,
+12594,12591,12586,12584,12581,12576,12573,12570,
+12566,12563,12561,12557,12555,12554,12551,12549,
+12549,12547,12546,12546,12545,12545,12544,12545,
+12545,12545,12547,12547,12548,12550,12551,12552,
+12556,12558,12560,12563,12565,12567,12572,12573,
+12575,12579,12582,12585,12589,12590,12590,12593,
+12596,12601,12605,12609,12610,12607,12610,12612,
+12616,12618,12621,12625,12638,12642,12634,12643,
+12640,12632,12690,12699,12698,12702,12691,12788,
+12810,12891,12921,12871,12869,12815,12826,12825,
+12845,12834,12834,12843,12832,12838,12815,12823,
+12803,12794,12787,12802,12798,12784,12793,12798,
+12829,12850,12883,12863,12911,13043,13053,13067,
+13086,13044,13101,13012,12969,12944,12923,12913,
+12911,12882,12830,12837,12923,12929,12863,12970,
+12943,12974,13034,13070,12989,13017,13082,13052,
+13065,13003,12984,12983,12956,12976,13050,13058,
+13063,13024,13062,13063,13108,13117,13114,13151,
+13152,13171,13334,13340,13393,13355,13387,13392,
+13303,13340,13307,13281,13257,13246,13200,13239,
+13314,13249,13264,13246,13285,13300,13314,13349,
+13373,13347,13312,13286,13272,13261,13286,13271,
+13244,13240,13281,13320,13257,13239,13289,13278,
+13299,13320,13290,13288,13314,13288,13258,13257,
+13287,13295,13266,13272,13293,13272,13228,13220,
+13288,13287,13224,13207,13189,13188,13196,13194,
+13196,13172,13064,13061,13067,13063,13040,13030,
+13041,13036,13092,13087,13116,13112,13116,13109,
+13090,13083,12973,12931,12908,12900,12912,12904,
+12890,12872,12859,12851,12817,12808,12825,12812,
+12801,12794,12764,12757,12754,12737,12719,12712,
+12700,12693,12759,12757,12749,12741,12731,12724,
+12705,12687,12680,12673,12662,12654,12652,12635,
+12623,12615,12604,12595,12587,12569,12556,12548,
+12439,12430,12504,12501,12485,12476,12457,12448,
+12437,12419,12418,12409,12287,12278,12273,12259,
+12250,12242,12229,12221,12207,12192,12189,12182,
+12181,12175,12159,12149,12154,12150,12151,12148,
+12211,12205,12148,12147,12129,12128,12111,12124,
+12200,12200,12134,12134,12112,12125,12211,12212,
+12221,12222,12218,12221,12217,12219,12224,12225,
+12142,12146,12149,12153,12262,12265,12257,12262,
+12270,12272,12244,12247,12280,12291,12289,12291,
+12306,12308,12313,12315,12295,12296,12221,12221,
+12282,12297,12287,12290,12265,12267,12234,12237,
+12273,12276,12286,12288,12294,12296,12276,12278,
+12267,12269,12285,12290,12289,12290,12291,12293,
+12283,12283,12283,12284,12277,12278,12280,12282,
+12283,12284,12285,12287,12285,12286,12289,12289,
+12290,12289,12288,12286,12285,12284,12281,12280,
+12277,12272,12272,12271,12269,12268,12267,12265,
+12265,12263,12262,12260,12260,12258,12257,12256,
+12255,12254,12253,12251,12251,12250,12249,12248,
+12248,12246,12246,12245,12244,12244,12243,12243,
+12242,12242,12242,12241,12241,12240,12240,12241,
+12240,12240,12240,12240,12240,12239,12239,12239,
+12239,12239,12239,12239,12239,12239,12239,12238,
+12238,12238,12236,12235,12235,12233,12232,12232,
+12229,12228,12227,12225,12224,12222,12219,12217,
+12215,12212,12210,12207,12202,12199,12197,12190,
+12187,12184,12177,12173,12171,12163,12159,12156,
+12147,12143,12140,12132,12129,12125,12118,12115,
+12112,12106,12103,12100,12095,12092,12090,12088,
+12086,12085,12082,12081,12081,12079,12079,12079,
+12117,12103,12099,12125,12152,12127,12157,12127,
+12125,12134,12139,12155,12165,12170,12140,12113,
+12119,12112,12122,12150,12146,12149,12155,12178,
+12176,12138,12118,12139,12140,12156,12102,12103,
+12104,12112,12105,12098,12102,12101,12099,12100,
+12095,12095,12093,12091,12085,12081,12083,12079,
+12076,12075,12075,12073,12073,12072,12072,12071,
+12071,12072,12072,12073,12075,12076,12077,12080,
+12081,12083,12087,12090,12092,12097,12101,12104,
+12111,12115,12119,12127,12131,12135,12144,12148,
+12153,12163,12168,12173,12182,12187,12193,12203,
+12208,12214,12223,12229,12234,12244,12249,12254,
+12263,12268,12272,12282,12286,12290,12299,12302,
+12306,12313,12317,12320,12327,12330,12333,12339,
+12341,12344,12349,12351,12354,12358,12360,12362,
+12366,12368,12370,12373,12375,12376,12379,12381,
+12382,12384,12385,12386,12388,12389,12391,12393,
+12394,12395,12398,12399,12400,12402,12404,12405,
+12407,12409,12410,12413,12415,12416,12420,12421,
+12423,12426,12428,12430,12434,12436,12438,12443,
+12445,12447,12452,12455,12457,12463,12465,12467,
+12472,12475,12478,12483,12486,12489,12494,12497,
+12500,12505,12507,12509,12515,12517,12520,12524,
+12526,12529,12533,12535,12536,12540,12542,12543,
+12546,12547,12549,12549,12551,12552,12553,12554,
+12554,12555,12556,12556,12557,12557,12557,12557,
+12557,12558,12558,12558,12558,12557,12557,12557,
+12557,12556,12558,12556,12558,12557,12558,12560,
+12558,12559,12559,12563,12563,12566,12569,12573,
+12571,12597,12587,12582,12575,12585,12581,12590,
+12607,12596,12612,12606,12605,12607,12615,12603,
+12611,12604,12622,12630,12633,12641,12646,12626,
+12632,12628,12639,12632,12635,12645,12674,12677,
+12665,12656,12657,12661,12649,12659,12651,12664,
+12697,12684,12686,12685,12698,12675,12683,12680,
+12696,12684,12700,12702,12707,12713,12720,12702,
+12689,12697,12699,12711,12751,12734,12719,12746,
+12737,12733,12727,12727,12753,12742,12745,12777,
+12767,12765,12786,12768,12762,12773,12782,12773,
+12788,12794,12827,12858,12861,12856,12880,12871,
+12850,12860,12951,12963,12867,12869,12853,12862,
+12876,12860,12874,12891,12891,12881,12916,12885,
+12986,13008,12977,12965,12976,12981,12997,12994,
+12989,12989,13000,12977,12994,13025,12989,12994,
+12998,12988,12992,12997,12987,13007,13008,13011,
+13031,13045,13049,13020,13009,13006,13021,13034,
+13045,13021,13014,13014,13015,13038,13024,13035,
+13024,13033,13010,13009,13037,13061,13069,13041,
+13004,13046,13026,13023,13021,13014,13008,13033,
+13009,13070,13055,13027,13052,13046,13072,13020,
+13028,13053,13070,13057,13037,13023,13048,13050,
+13061,13046,13009,13005,13015,13019,13033,13040,
+13031,12995,12989,13002,12992,12980,12949,12937,
+12935,12930,12919,12914,12910,12898,12889,12883,
+12873,12867,12858,12845,12841,12836,12827,12820,
+12807,12794,12793,12786,12771,12764,12757,12747,
+12720,12714,12699,12692,12634,12609,12589,12582,
+12587,12580,12553,12533,12525,12518,12520,12514,
+12493,12481,12474,12468,12472,12465,12472,12465,
+12455,12449,12453,12447,12440,12421,12399,12393,
+12356,12350,12344,12332,12326,12319,12307,12301,
+12295,12283,12277,12271,12258,12253,12247,12235,
+12230,12224,12214,12208,12203,12192,12187,12182,
+12173,12168,12164,12155,12150,12146,12139,12135,
+12132,12125,12122,12119,12114,12111,12109,12104,
+12102,12101,12097,12096,12095,12092,12091,12090,
+12089,12088,12088,12087,12086,12086,12086,12086,
+12086,12088,12089,12090,12091,12092,12093,12095,
+12096,12097,12099,12100,12102,12105,12106,12107,
+12110,12112,12113,12116,12118,12119,12121,12122,
+12123,12126,12128,12129,12132,12133,12134,12137,
+12139,12141,12145,12146,12148,12152,12154,12157,
+12161,12164,12166,12170,12172,12174,12176,12179,
+12180,12184,12185,12188,12191,12192,12194,12197,
+12198,12200,12202,12203,12204,12206,12207,12208,
+12209,12210,12211,12213,12213,12213,12214,12215,
+12215,12215,12215,12215,12215,12216,12215,12216,
+12216,12216,12215,12215,12216,12215,12215,12215,
+12215,12215,12215,12215,12215,12215,12215,12215,
+12215,12215,12215,12215,12215,12215,12215,12215,
+12215,12215,12215,12215,12215,12215,12215,12215,
+12215,12215,12214,12213,12213,12212,12211,12211,
+12210,12209,12208,12208,12206,12205,12203,12200,
+12199,12198,12194,12193,12191,12187,12184,12182,
+12177,12175,12173,12167,12165,12162,12156,12153,
+12150,12144,12141,12137,12132,12129,12126,12120,
+12117,12115,12112,12109,12111,12109,12104,12097,
+12093,12097,12093,12080,12086,12086,12086,12087,
+12090,12081,12086,12096,12101,12096,12091,12096,
+12123,12113,12108,12090,12112,12154,12126,12151,
+12088,12087,12090,12101,12099,12104,12098,12124,
+12111,12110,12111,12130,12149,12141,12129,12129,
+12120,12126,12122,12138,12135,12121,12116,12108,
+12113,12142,12104,12119,12119,12137,12123,12128,
+12140,12121,12125,12104,12099,12104,12111,12108,
+12130,12105,12107,12088,12090,12069,12083,12113,
+12090,12093,12095,12095,12094,12097,12123,12115,
+12091,12080,12080,12079,12089,12097,12105,12097,
+12089,12082,12090,12078,12082,12079,12099,12112,
+12152,12115,12107,12102,12110,12117,12108,12115,
+12115,12114,12121,12119,12126,12129,12132,12139,
+12143,12146,12154,12158,12162,12169,12173,12176,
+12184,12188,12192,12200,12204,12208,12215,12218,
+12222,12230,12233,12237,12244,12248,12252,12258,
+12261,12265,12271,12275,12278,12284,12287,12290,
+12297,12299,12301,12307,12310,12312,12318,12320,
+12323,12327,12330,12332,12336,12339,12340,12344,
+12346,12348,12352,12354,12355,12359,12361,12363,
+12366,12368,12370,12373,12375,12376,12380,12381,
+12382,12386,12387,12389,12392,12394,12396,12399,
+12401,12402,12406,12408,12409,12413,12415,12417,
+12420,12422,12424,12427,12429,12431,12435,12437,
+12439,12443,12445,12447,12451,12453,12455,12460,
+12462,12464,12468,12471,12473,12478,12480,12482,
+12486,12488,12491,12496,12498,12500,12505,12507,
+12509,12512,12515,12517,12522,12525,12527,12537,
+12538,12537,12541,12544,12548,12551,12559,12563,
+12578,12585,12590,12582,12579,12596,12610,12593,
+12596,12607,12595,12601,12612,12612,12600,12634,
+12620,12633,12672,12643,12627,12651,12653,12650,
+12661,12654,12659,12692,12682,12643,12642,12647,
+12639,12679,12704,12692,12682,12672,12676,12678,
+12684,12682,12683,12679,12681,12694,12705,12687,
+12715,12680,12667,12676,12681,12689,12716,12699,
+12693,12682,12693,12717,12686,12676,12673,12717,
+12691,12710,12712,12714,12715,12694,12715,12715,
+12705,12735,12697,12709,12707,12702,12722,12724,
+12715,12756,12746,12721,12717,12726,12724,12719,
+12728,12737,12739,12761,12754,12754,12747,12742,
+12737,12743,12780,12800,12796,12804,12795,12790,
+12782,12808,12865,12881,12768,12785,12771,12790,
+12782,12763,12794,12789,12789,12793,12788,12796,
+12901,12871,12889,12879,12878,12870,12874,12879,
+12876,12878,12882,12877,12884,12888,12876,12897,
+12874,12885,12881,12874,12882,12894,12901,12890,
+12902,12892,12916,12899,12884,12889,12904,12884,
+12889,12897,12901,12910,12879,12882,12879,12886,
+12893,12884,12907,12890,12903,12891,12879,12878,
+12908,12885,12902,12873,12876,12858,12884,12904,
+12877,12878,12887,12887,12861,12847,12859,12887,
+12866,12859,12866,12872,12868,12847,12834,12851,
+12839,12842,12825,12846,12837,12859,12844,12828,
+12851,12876,12819,12849,12826,12804,12788,12788,
+12778,12759,12752,12752,12746,12746,12725,12721,
+12722,12711,12696,12678,12675,12671,12664,12658,
+12647,12636,12636,12631,12619,12613,12606,12599,
+12575,12569,12557,12552,12495,12472,12453,12448,
+12456,12450,12425,12408,12401,12396,12401,12396,
+12377,12367,12363,12358,12365,12360,12369,12364,
+12356,12351,12360,12355,12351,12335,12315,12311,
+12279,12275,12271,12263,12259,12256,12248,12244,
+12241,12233,12230,12226,12219,12215,12213,12206,
+12202,12199,12192,12189,12186,12179,12176,12174,
+12168,12165,12162,12156,12153,12151,12145,12143,
+12140,12135,12133,12132,12127,12125,12123,12118,
+12116,12114,12110,12109,12107,12103,12101,12100,
+12096,12095,12093,12090,12090,12089,12087,12086,
+12085,12084,12083,12083,12082,12081,12081,12080,
+12079,12079,12078,12078,12078,12078,12078,12078,
+12078,12078,12078,12079,12079,12079,12080,12080,
+12080,12081,12082,12082,12083,12084,12084,12086,
+12086,12087,12089,12089,12090,12091,12092,12093,
+12094,12095,12096,12099,12100,12101,12103,12104,
+12105,12107,12108,12109,12111,12113,12114,12116,
+12117,12118,12120,12121,12122,12124,12125,12126,
+12128,12129,12130,12132,12132,12133,12135,12136,
+12136,12139,12139,12140,12142,12142,12143,12144,
+12145,12145,12146,12147,12147,12148,12148,12149,
+12149,12150,12150,12150,12151,12151,12151,12151,
+12151,12151,12151,12151,12151,12151,12151,12151,
+12151,12151,12150,12150,12150,12149,12149,12148,
+12147,12147,12146,12145,12145,12144,12143,12142,
+12141,12140,12139,12138,12136,12136,12133,12132,
+12132,12132,12147,12170,12168,12174,12161,12169,
+12194,12229,12225,12214,12176,12198,12160,12154,
+12130,12132,12110,12115,12127,12154,12138,12108,
+12112,12119,12097,12106,12105,12108,12103,12112,
+12147,12129,12139,12118,12107,12089,12085,12106,
+12090,12079,12085,12093,12105,12091,12088,12093,
+12111,12099,12100,12095,12099,12090,12100,12090,
+12066,12069,12070,12064,12073,12069,12086,12078,
+12076,12094,12094,12082,12079,12097,12095,12087,
+12085,12110,12084,12085,12102,12085,12078,12089,
+12107,12086,12094,12119,12105,12100,12117,12121,
+12109,12113,12128,12106,12106,12113,12123,12121,
+12122,12122,12109,12105,12122,12118,12106,12103,
+12122,12124,12118,12152,12131,12123,12140,12137,
+12142,12156,12166,12161,12133,12121,12140,12128,
+12131,12141,12128,12110,12145,12150,12123,12126,
+12131,12119,12125,12147,12163,12155,12174,12175,
+12163,12143,12141,12167,12131,12125,12127,12128,
+12129,12143,12132,12139,12133,12141,12137,12140,
+12141,12142,12143,12146,12148,12148,12151,12152,
+12154,12157,12158,12160,12166,12171,12171,12172,
+12174,12177,12188,12187,12198,12181,12183,12196,
+12202,12191,12194,12215,12203,12206,12203,12202,
+12203,12207,12208,12210,12214,12220,12223,12220,
+12221,12223,12227,12228,12230,12233,12235,12237,
+12240,12242,12243,12246,12248,12250,12253,12254,
+12256,12258,12260,12261,12264,12266,12267,12270,
+12272,12273,12276,12278,12279,12282,12284,12285,
+12287,12289,12290,12293,12294,12295,12298,12299,
+12300,12302,12302,12305,12307,12307,12309,12313,
+12311,12315,12315,12316,12317,12318,12319,12320,
+12322,12323,12324,12329,12327,12330,12329,12329,
+12336,12338,12335,12334,12336,12348,12339,12349,
+12337,12348,12348,12342,12354,12363,12368,12367,
+12367,12360,12364,12355,12353,12351,12350,12350,
+12351,12353,12354,12354,12354,12355,12357,12359,
+12358,12358,12361,12363,12362,12366,12362,12364,
+12365,12367,12365,12365,12366,12368,12366,12366,
+12370,12374,12370,12379,12384,12375,12385,12392,
+12380,12395,12394,12398,12416,12382,12393,12397,
+12389,12386,12430,12417,12409,12425,12434,12411,
+12422,12426,12411,12452,12435,12430,12426,12415,
+12408,12447,12420,12436,12451,12436,12472,12437,
+12435,12448,12428,12424,12479,12444,12446,12433,
+12424,12482,12446,12418,12432,12415,12417,12436,
+12430,12435,12438,12421,12454,12444,12463,12440,
+12426,12422,12424,12445,12432,12424,12424,12423,
+12431,12433,12453,12424,12424,12434,12442,12424,
+12433,12424,12425,12434,12432,12424,12431,12426,
+12427,12425,12425,12427,12427,12428,12428,12427,
+12427,12428,12427,12427,12428,12426,12427,12426,
+12426,12426,12425,12425,12424,12424,12424,12424,
+12423,12423,12422,12421,12420,12420,12418,12418,
+12417,12415,12414,12413,12411,12411,12410,12407,
+12406,12405,12403,12402,12401,12398,12397,12395,
+12393,12391,12390,12387,12385,12384,12381,12380,
+12378,12375,12373,12371,12367,12366,12364,12360,
+12358,12356,12352,12350,12348,12344,12342,12340,
+12336,12334,12332,12328,12325,12323,12319,12317,
+12314,12310,12307,12305,12300,12299,12297,12292,
+12290,12288,12283,12281,12278,12274,12271,12269,
+12265,12262,12260,12257,12254,12252,12248,12245,
+12243,12239,12237,12234,12230,12228,12226,12222,
+12220,12218,12215,12213,12211,12207,12205,12203,
+12200,12198,12196,12192,12191,12189,12186,12184,
+12183,12179,12178,12176,12174,12173,12172,12169,
+12167,12166,12163,12162,12161,12159,12157,12156,
+12154,12153,12152,12150,12149,12148,12146,12145,
+12145,12143,12142,12141,12140,12139,12138,12137,
+12136,12136,12134,12134,12133,12132,12132,12132,
+12131,12130,12130,12129,12128,12128,12127,12127,
+12127,12126,12125,12125,12124,12124,12123,12123,
+12122,12122,12121,12121,12121,12120,12120,12120,
+12119,12119,12119,12118,12118,12117,12117,12117,
+12116,12116,12115,12115,12114,12114,12114,12113,
+12113,12112,12112,12111,12111,12110,12110,12109,
+12109,12108,12108,12107,12106,12106,12105,12105,
+12104,12103,12102,12102,12101,12100,12100,12098,
+12098,12097,12096,12095,12095,12093,12092,12092,
+12090,12090,12090,12088,12088,12087,12085,12085,
+12084,12082,12081,12081,12079,12078,12077,12076,
+12075,12074,12072,12071,12070,12069,12068,12067,
+12065,12065,12064,12062,12061,12060,12059,12058,
+12057,12055,12054,12054,12052,12051,12050,12049,
+12049,12048,12047,12046,12045,12044,12043,12043,
+12041,12041,12040,12039,12038,12037,12036,12036,
+12035,12034,12033,12033,12032,12031,12031,12030,
+12030,12029,12028,12028,12028,12027,12027,12027,
+12026,12026,12026,12025,12025,12025,12024,12024,
+12024,12024,12024,12024,12024,12024,12024,12024,
+12024,12024,12024,12024,12025,12025,12025,12025,
+12026,12026,12026,12027,12027,12028,12028,12029,
+12029,12030,12030,12031,12031,12032,12032,12033,
+12034,12034,12035,12036,12038,12037,12038,12039,
+12040,12043,12041,12044,12045,12046,12051,12048,
+12049,12056,12053,12054,12062,12065,12056,12060,
+12069,12066,12061,12064,12070,12064,12065,12065,
+12118,12118,12118,12118,12119,12119,12119,12119,
+12120,12120,12120,12121,12121,12121,12122,12122,
+12122,12123,12123,12123,12124,12124,12124,12125,
+12125,12126,12126,12126,12127,12127,12128,12128,
+12128,12129,12129,12130,12130,12131,12131,12132,
+12132,12132,12132,12132,12133,12133,12134,12134,
+12135,12135,12136,12137,12137,12137,12138,12139,
+12139,12140,12140,12140,12141,12142,12142,12143,
+12143,12144,12145,12145,12146,12147,12147,12147,
+12148,12149,12149,12150,12151,12151,12152,12153,
+12153,12154,12154,12155,12156,12156,12157,12158,
+12158,12159,12160,12160,12161,12162,12162,12163,
+12164,12165,12165,12166,12167,12167,12168,12169,
+12169,12170,12171,12172,12173,12173,12174,12174,
+12174,12175,12176,12177,12177,12178,12179,12179,
+12180,12181,12181,12183,12183,12184,12185,12185,
+12186,12187,12188,12188,12189,12190,12191,12192,
+12192,12193,12194,12195,12195,12196,12197,12197,
+12198,12199,12200,12201,12201,12202,12203,12203,
+12204,12205,12206,12206,12207,12208,12208,12210,
+12210,12211,12212,12212,12213,12214,12214,12215,
+12215,12215,12216,12217,12217,12218,12219,12219,
+12220,12221,12221,12222,12223,12223,12224,12225,
+12225,12226,12227,12227,12228,12229,12229,12230,
+12231,12231,12232,12232,12233,12233,12234,12235,
+12235,12236,12236,12237,12238,12238,12239,12239,
+12240,12240,12241,12241,12242,12243,12243,12243,
+12244,12245,12245,12246,12246,12246,12247,12248,
+12248,12249,12249,12249,12250,12250,12251,12251,
+12252,12252,12253,12253,12253,12254,12254,12255,
+12255,12256,12256,12256,12257,12257,12257,12257,
+12257,12258,12258,12258,12259,12259,12259,12260,
+12260,12260,12261,12261,12261,12262,12262,12262,
+12263,12263,12263,12264,12264,12264,12264,12265,
+12265,12265,12265,12266,12266,12266,12266,12267,
+12267,12267,12267,12268,12268,12268,12268,12268,
+12269,12269,12269,12269,12269,12269,12270,12270,
+12270,12270,12270,12270,12270,12270,12271,12271,
+12271,12271,12271,12271,12271,12271,12271,12271,
+12271,12271,12271,12271,12271,12271,12271,12271,
+12271,12271,12271,12271,12271,12271,12271,12271,
+12271,12271,12271,12271,12270,12270,12270,12270,
+12270,12270,12270,12269,12269,12269,12269,12269,
+12268,12268,12268,12268,12267,12267,12267,12267,
+12266,12266,12266,12265,12265,12265,12264,12264,
+12264,12263,12263,12262,12262,12262,12261,12261,
+12261,12260,12260,12259,12259,12258,12258,12257,
+12257,12257,12257,12256,12256,12255,12255,12254,
+12254,12253,12253,12252,12251,12251,12250,12250,
+12249,12248,12248,12247,12246,12246,12245,12244,
+12244,12243,12242,12242,12241,12240,12240,12239,
+12238,12238,12237,12236,12236,12235,12234,12234,
+12233,12232,12232,12231,12230,12229,12229,12228,
+12227,12227,12226,12225,12224,12223,12223,12222,
+12221,12221,12220,12219,12218,12218,12217,12216,
+12216,12215,12215,12214,12213,12213,12212,12211,
+12211,12210,12209,12208,12208,12207,12206,12206,
+12205,12204,12204,12203,12202,12202,12201,12200,
+12200,12199,12198,12198,12197,12196,12196,12195,
+12194,12194,12193,12192,12192,12191,12190,12190,
+12189,12188,12188,12187,12186,12186,12185,12185,
+12184,12183,12183,12182,12182,12181,12181,12180,
+12179,12179,12178,12178,12177,12176,12176,12176,
+12175,12174,12174,12174,12174,12173,12173,12172,
+12172,12171,12171,12170,12169,12169,12169,12168,
+12168,12167,12166,12166,12166,12165,12165,12164,
+12163,12163,12163,12162,12162,12161,12161,12160,
+12160,12159,12159,12158,12158,12157,12157,12156,
+12156,12156,12155,12155,12154,12154,12153,12153,
+12152,12152,12151,12151,12150,12150,12149,12149,
+12149,12148,12148,12147,12147,12146,12146,12145,
+12145,12144,12144,12143,12143,12142,12142,12142,
+12141,12141,12140,12140,12139,12139,12138,12138,
+12138,12137,12137,12136,12136,12135,12135,12134,
+12134,12134,12133,12133,12132,12132,12132,12132,
+12131,12131,12131,12130,12130,12130,12129,12129,
+12128,12128,12128,12127,12127,12126,12126,12126,
+12125,12125,12125,12124,12124,12123,12123,12123,
+12122,12122,12122,12121,12121,12121,12121,12120,
+12120,12120,12119,12119,12119,12119,12118,12118,
+12118,12118,12117,12117,12117,12117,12116,12116,
+12116,12116,12116,12115,12115,12115,12115,12115,
+12114,12114,12114,12114,12114,12114,12114,12113,
+12113,12113,12113,12113,12113,12113,12113,12113,
+12113,12113,12113,12113,12113,12113,12113,12113,
+12113,12113,12113,12113,12113,12113,12113,12113,
+12113,12113,12113,12113,12113,12113,12113,12113,
+12113,12113,12113,12114,12114,12114,12114,12114,
+12114,12115,12115,12115,12115,12115,12115,12116,
+12116,12116,12116,12116,12117,12117,12117,12117,
diff --git a/src/template_parser.c b/src/template_parser.c
new file mode 100644
index 0000000..706fee9
--- /dev/null
+++ b/src/template_parser.c
@@ -0,0 +1,134 @@
+#include "template_parser.h"
+#include "magics_template_parser.h"
+#include "results_template_parser.h"
+
+#define DBG_MSG 0 
+
+
+extern xmlNode *root_node, *magics_node, *results_node;
+extern xmlDoc *param_doc;
+
+extern int magics_template_parser();
+extern int results_template_parser();
+
+
+int template_parser(  char *Filename, const char *varname )
+
+{
+        xmlDoc         *doc = NULL;
+        xmlNode        *root_element = NULL;
+
+        doc = xmlReadFile( Filename, NULL, 0 );
+        if ( doc == NULL )
+        {
+                  printf( "Error: Could not parse the file \"%s\"\n", Filename );
+        	  return (1);
+        }
+        else
+        {
+                  /* 
+		     Get the name of the root element node 
+		     If "magics" , call "magics" parser
+		     If "results", call "results" parser
+		  */                      
+
+                  root_element = xmlDocGetRootElement( doc );
+		  
+		  if( !strcmp( root_element->name, "magics" ) )
+		  {
+                  	if ( magics_template_parser( root_element ) == 1 )
+		  	{
+				printf( "Un-Supported version of Magics++! \n" );
+	        		return (2);
+			}
+		  }
+		  else if( !strcmp( root_element->name, "results" ) )
+		  {
+                  	results_template_parser( root_element, varname );
+			 /* Needs some error handling */
+		  }
+
+                  /*** free the document ***/
+                  xmlFreeDoc( doc );
+        }
+
+        /*** Free the global variables that may
+         *   have been allocated by the parser. 
+        ***/
+
+        xmlCleanupParser();
+
+        return (0);
+}
+
+
+int init_XMLtemplate_parser( char *Filename )
+
+{
+        param_doc = xmlReadFile( Filename, NULL, 0 );
+        if ( param_doc == NULL )
+        {
+                  printf( "Error: Could not parse the file \"%s\"\n", Filename );
+        	  return (1);
+        }
+        else
+        {
+		  fprintf( stderr, "XML file %s being parsed \n", Filename );
+                  root_node = xmlDocGetRootElement( param_doc );
+        }
+        return 0;
+}
+
+
+int updatemagics_and_results_nodes(  )
+
+{
+    xmlNode *cur_node = NULL;
+	
+    if( root_node == NULL )
+    {
+        printf( "Invalid Root Node\n" );
+    	return 0;
+    }
+
+    for ( cur_node = root_node->children; cur_node; cur_node = cur_node->next )
+    {   
+        if ( cur_node->type == XML_ELEMENT_NODE )
+        {   
+    
+#if 0
+            fprintf( stdout, "Node Name: %s \n", cur_node->name );
+#endif
+            if( !strcmp( cur_node->name, "magics" ) ) 
+            {
+		magics_node = cur_node;
+#if 0
+                fprintf( stdout, "Node Name: %s \n", cur_node->name );
+#endif
+	    }  
+
+            if( !strcmp( cur_node->name, "results" ) ) 
+            {
+		results_node = cur_node;
+#if 0
+                fprintf( stdout, "Node Name: %s \n", cur_node->name );
+#endif
+	    }  
+	}
+    }
+    return 0;
+}
+
+
+int quit_XMLtemplate_parser( )
+
+{
+        xmlFreeDoc( param_doc );
+        xmlCleanupParser( );
+	if( param_doc == NULL )
+		printf( "Cleaned XML parser\n" );
+#if 0
+        fprintf( stdout, "Cleaned XML parser\n" );
+#endif
+	return 0;
+}
diff --git a/src/template_parser.h b/src/template_parser.h
new file mode 100644
index 0000000..9063c71
--- /dev/null
+++ b/src/template_parser.h
@@ -0,0 +1,22 @@
+#ifndef TEMPLATE_PARSER_HH
+#define TEMPLATE_PARSER_HH
+
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <locale.h>
+
+#if  defined  (HAVE_LIBXML2)
+#include<libxml/parser.h>
+#include<libxml/tree.h>
+
+
+int template_parser( char *Filename, const char *varname );
+int init_XMLtemplate_parser( char *Filename );
+int updatemagics_and_results_nodes( );
+int quit_XMLtemplate_parser( );
+
+
+#endif
+
+#endif
diff --git a/src/timebase.h b/src/timebase.h
new file mode 100644
index 0000000..57111ab
--- /dev/null
+++ b/src/timebase.h
@@ -0,0 +1,23 @@
+#ifndef  _TIMEBASE_H
+#define  _TIMEBASE_H
+
+/* date format:  YYYYMMDD */
+/* time format:  hhmmss   */
+
+void decode_julday(int calendar, int julday, int *year, int *mon, int *day);
+int  encode_julday(int calendar, int year, int month, int day);
+
+int date_to_julday(int calendar, int date);
+int julday_to_date(int calendar, int julday);
+
+int time_to_sec(int time);
+int sec_to_time(int secofday);
+
+void   julday_add_seconds(int seconds, int *julday, int *secofday);
+void   julday_add(int days, int secs, int *julday, int *secofday);
+double julday_sub(int julday1, int secofday1, int julday2, int secofday2, int *days, int *secs);
+
+void encode_juldaysec(int calendar, int year, int month, int day, int hour, int minute, int *julday, int *secofday);
+void decode_juldaysec(int calendar, int julday, int secofday, int *year, int *month, int *day, int *hour, int *minute);
+
+#endif  /* _TIMEBASE_H */
diff --git a/src/timer.c b/src/timer.c
new file mode 100644
index 0000000..0e11391
--- /dev/null
+++ b/src/timer.c
@@ -0,0 +1,340 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#if defined (HAVE_SYS_TIMES_H)
+#include <sys/times.h>
+#endif
+
+
+void cdoProcessTime(double *utime, double *stime)
+{
+#if defined (HAVE_SYS_TIMES_H)
+  struct tms tbuf;
+  double clock_ticks = 0;
+
+  if ( (int)times(&tbuf) == -1 )
+    {
+      *utime = 0;
+      *stime = 0;
+    }
+  else
+    {
+#if defined (_SC_CLK_TCK)
+      clock_ticks = (double) sysconf(_SC_CLK_TCK);
+#endif
+      if ( clock_ticks > 0 )
+	{
+	  *utime = ((double) tbuf.tms_utime) / clock_ticks; 
+	  *stime = ((double) tbuf.tms_stime) / clock_ticks;
+	  /*
+	    printf("utime  %g\n", ((double) tbuf.tms_utime) / clock_ticks);
+	    printf("stime  %g\n", ((double) tbuf.tms_stime) / clock_ticks);
+	    printf("cutime %g\n", ((double) tbuf.tms_cutime) / clock_ticks);
+	    printf("cstime %g\n", ((double) tbuf.tms_cstime) / clock_ticks);
+	  */
+	}
+      else
+	{
+	  *utime = 0;
+	  *stime = 0;
+	}
+    }
+#else
+  *utime = 0;
+  *stime = 0;
+#endif
+}
+
+
+void util_init_real_time(void);
+void util_read_real_time(void *it);
+void util_diff_real_time(void *it1, void *it2, double *t);
+
+
+FILE *rt_unit = NULL;
+
+enum {rt_stat_undef, rt_stat_on, rt_stat_off};
+
+/* minimal internal time needed to do one measurement */
+
+double tm_shift = 0.0;
+
+/* average total overhead for one timer_start & timer_stop pair */
+
+double tm_overhead = 0.0;
+
+
+#define  MAX_TIMER    128  /* max number of timers allowed */
+
+
+typedef struct {
+  int    reserved;
+  int    calls;
+  int    stat;
+  double tot;
+  double min;
+  double max;
+  double last;
+  char   mark1[32]; /* max: 16 on IBM; 8 for double (all other) */
+  char   text[128];
+}
+RT_TYPE;
+
+RT_TYPE rt[MAX_TIMER];
+RT_TYPE rt_init = {0, 0, 0, 0, 1.e30, 0, 0, "", "noname"};
+int timer_need_init = 1;
+int top_timer = 0;
+
+static
+void set_time_mark(void *mark)
+{
+  util_read_real_time(mark);
+}
+
+static
+double get_time_val(void *mark0)
+{
+  double dt;
+  char mark[32];
+
+  util_read_real_time(mark);
+  util_diff_real_time(mark0, mark, &dt);
+
+  dt -= tm_shift;
+
+  return (dt);
+}
+
+int ntests = 100; /* tests need about n microsecs on pwr4 */
+
+static
+double m1(void)
+{
+  double dt, dt0;
+  int i;
+  char mark[32];
+
+  dt0 = 1.0;
+  for ( i = 0; i < ntests; i++ )
+    {
+      set_time_mark(mark);
+      dt = get_time_val(mark);
+      if ( dt < dt0 ) dt0 = dt;
+    }
+
+  return (dt0);
+}
+
+static
+double m2(void)
+{
+  char mark1[32], mark2[32];
+  double dt1, dt2, dt0;
+  int i;
+
+  dt0 = 1.0;
+  for ( i = 0; i < ntests; i++ )
+    {
+      set_time_mark(mark2);
+      set_time_mark(mark1);
+      dt1 = get_time_val(mark1);
+      dt2 = get_time_val(mark2);
+      if ( dt2 < dt0 ) dt0 = dt2;
+      if ( dt2 < dt1 ) fprintf(rt_unit, "estimate_overhead: internal error\n");
+    }
+
+  return (dt0);
+}
+
+static
+void estimate_overhead(void)
+{
+  tm_shift    = m1();
+  tm_overhead = m2();
+}
+
+
+static
+void timer_init(void)
+{
+  rt_unit = stderr;
+
+  util_init_real_time();
+
+  estimate_overhead();
+
+  timer_need_init = 0;
+}
+
+
+int timer_new(const char *text)
+{
+  int it;
+
+  if ( timer_need_init ) timer_init();
+
+  if ( top_timer > MAX_TIMER )
+    {
+      for ( it = 0; it < MAX_TIMER; it++ )
+	fprintf(stderr, "timer %3d:  %s\n", it, rt[it].text);
+
+      fprintf(stderr, "timer_new: MAX_TIMER too small!\n");
+    }
+
+  it = top_timer;
+  top_timer++;
+
+  rt[it] = rt_init;
+  rt[it].reserved = 1;
+
+  if ( text ) strcpy(rt[it].text, text);
+
+  return (it);
+}
+
+static
+void timer_check(int it)
+{
+  if ( it < 0 || it > (top_timer-1) )
+    fprintf(rt_unit, "timer: invalid timer id %d\n", it);
+}
+
+
+double timer_val(int it)
+{
+  double val, dt;
+
+  timer_check(it);
+
+  val = rt[it].tot;
+
+  if ( rt[it].stat == rt_stat_on )
+    {
+      dt = get_time_val(rt[it].mark1);
+      val += dt;
+    }
+
+  return (val);
+}
+
+static
+void timer_header(void)
+{
+  fprintf(rt_unit, "\nTimer report:  shift = %g\n", tm_shift);
+  fprintf(rt_unit,
+	  "timer  calls        t_min    t_average        t_max      t_total  text\n");
+}
+
+
+void timer_report(void)
+{
+  int it;
+  double total, avg;
+
+  timer_header();
+
+  for ( it = 0; it < top_timer; it++ )
+    {
+      total = timer_val(it);
+
+      avg = rt[it].tot;
+      if ( rt[it].calls > 0 ) avg /= rt[it].calls;
+
+      if ( rt[it].stat != rt_stat_undef )
+	fprintf(rt_unit, "%4d %7d %12.4g %12.4g %12.4g %12.4g  %s\n",
+		it, rt[it].calls, rt[it].min, avg, rt[it].max, total, rt[it].text);
+    }
+
+}
+
+
+void timer_start(int it)
+{
+  timer_check(it);
+
+  if ( rt[it].stat == rt_stat_on )
+    fprintf(rt_unit, "timer_start: timer_stop call missing\n");
+
+  set_time_mark(rt[it].mark1);
+
+  rt[it].stat = rt_stat_on;
+}
+
+
+void timer_stop(int it)
+{
+  double dt;
+
+  timer_check(it);
+
+  if ( rt[it].stat != rt_stat_on )
+    {
+      if ( rt[it].stat == rt_stat_off )
+        fprintf(rt_unit, "timer_stop: timer_start call missing\n");
+      else
+        fprintf(rt_unit, "timer_stop: undefined timer >%s<\n", rt[it].text);
+    }
+
+  dt = get_time_val(rt[it].mark1);
+
+  rt[it].last  = dt;
+  rt[it].tot  += dt;
+  rt[it].calls++;
+  if ( dt < rt[it].min ) rt[it].min = dt;
+  if ( dt > rt[it].max ) rt[it].max = dt;
+
+  rt[it].stat = rt_stat_off;
+}
+
+
+
+#include "counter.h"
+
+static
+void counter_init(counter_t *counter)
+{
+  counter->cputime = 0;
+}
+
+
+void counter_start(counter_t *counter)
+{
+  counter_init(counter);
+
+  if ( timer_need_init ) timer_init();
+
+  set_time_mark(counter->mark);
+}
+
+
+void counter_stop(counter_t *counter)
+{
+  counter->cputime = get_time_val(counter->mark);
+}
+
+
+double counter_cputime(counter_t counter)
+{
+  return (counter.cputime);
+}
diff --git a/src/userlog.c b/src/userlog.c
new file mode 100644
index 0000000..6661447
--- /dev/null
+++ b/src/userlog.c
@@ -0,0 +1,1018 @@
+#if  defined  (HAVE_CONFIG_H)
+#  include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <time.h>
+/* #include <pwd.h> */
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>  /* write, close */
+#include <fcntl.h>
+#include <errno.h>
+#include <stdlib.h>  /* qsort */
+
+#include "cdo.h"
+#include "dtypes.h"
+#include "process.h"
+
+#if ! defined (VERSION)
+#  define  VERSION  "0.0.1"
+#endif
+
+#define  MAX_LEN  65536
+
+#define  LOGSSIZE  32
+#define  LOGOSIZE  40
+
+#undef HAVE_LOCK
+#if defined (F_UNLCK) && defined (F_RDLCK) && defined (F_WRLCK)
+#define HAVE_LOCK
+#endif
+
+#if defined (HAVE_LOCK)
+static
+void filestatus(struct flock *lock)
+{
+  switch(lock->l_type) {
+    case F_UNLCK:
+      printf("Status: F_UNLCK\n");
+      break;
+    case F_RDLCK:
+      printf("Status: F_RDLCK (PID: %d)\n", lock->l_pid);
+      break;
+    case F_WRLCK:
+      printf("Status: F_WRLCK (PID: %d)\n", lock->l_pid);
+      break;
+  }
+}
+#endif
+
+
+void cdolog(const char *prompt, double cputime)
+{
+#if defined (HAVE_LOCK)
+#if defined (LOGPATH)
+#define  XSTRING(x)	#x
+#define  STRING(x)	XSTRING(x)
+  char logfilename[] = STRING(LOGPATH) "/cdo.log";
+  int  logfileno;
+  char *username;
+  char timestr[30];
+  time_t date_and_time_in_sec;
+  struct tm *date_and_time;
+  int streamID;
+  const char *streamName;
+  int len, slen, olen, pos;
+  int loper;
+  char logstring[MAX_LEN];
+  int i;
+  int status;
+  struct flock mylock;
+
+  memset(logstring, 0, MAX_LEN);
+
+  date_and_time_in_sec = time(NULL);
+  timestr[0] = 0;
+
+  if ( date_and_time_in_sec != -1 )
+    {
+      date_and_time = localtime(&date_and_time_in_sec);
+      (void) strftime(timestr, sizeof(timestr), "%d/%m/%Y %H:%M", date_and_time);
+    }
+
+  username = getenv("LOGNAME");
+  if ( username == NULL )
+    {
+      username = getenv("USER");
+      if ( username == NULL ) username = "unknown";
+    }
+
+  slen = sprintf(logstring, "%s %-8s %7.2f %s %-3s",
+		 timestr,  username, cputime, VERSION, prompt);
+
+  for ( streamID = 0; streamID < cdoStreamCnt(); streamID++ )
+    {
+      streamName = cdoStreamName(streamID);
+      pos = 0;
+      while ( pos < (int) strlen(streamName) )
+	{
+	  len = 0;
+	  loper = 0;
+	  if ( streamName[pos++] == '-' ) loper = 1;
+	  while ( streamName[pos+len] != ' ' &&  streamName[pos+len] != '\0' ) len++;
+	  if ( len && loper )
+	    {
+	      for ( olen = 1; olen < len; olen++ )
+		if ( streamName[pos+olen] == ',' ) break;
+
+	      sprintf(logstring+slen, " %.*s", olen, &streamName[pos]);
+	      slen += olen + 1;
+	    }
+	  pos += len + 1;
+	}
+    }
+
+  sprintf(logstring+slen, "\n");
+  slen++;
+
+  errno = 0;
+  logfileno = open(logfilename, O_WRONLY | O_APPEND);
+  if ( errno )
+    {
+      errno = 0;
+      return;
+    }
+
+  mylock.l_type   = F_WRLCK;
+  mylock.l_whence = SEEK_SET;
+  mylock.l_start  = 0;
+  mylock.l_len    = 0;
+
+  /*
+  status = fcntl(logfileno, F_SETLKW, &mylock);
+  */
+  for ( i = 0; i < 100; i++ )
+    {
+      status = fcntl(logfileno, F_SETLK, &mylock);
+      if ( status == 0 ) break;
+      usleep(10000);
+    }
+
+  if ( status == 0 )
+    {
+      status = write(logfileno, logstring, slen);
+
+      mylock.l_type   = F_UNLCK;
+      status = fcntl(logfileno, F_SETLK, &mylock);
+    }
+
+  close(logfileno);
+
+  errno = 0;
+
+  return;
+
+#endif
+#endif
+}
+
+
+#include <math.h>
+/*
+ * convert an IMB float to single precision number v1.0
+ *
+ *                      Wesley Ebisuzaki
+ */
+static
+float ibm2flt(unsigned char *ibm) {
+
+	int positive, power;
+	unsigned int abspower;
+	long int mant;
+	double value, exp;
+
+	positive = (ibm[0] & 0x80) == 0;
+	mant = (ibm[1] << 16) + (ibm[2] << 8) + ibm[3];
+	power = (int) (ibm[0] & 0x7f) - 64;
+	abspower = power > 0 ? power : -power;
+
+
+	/* calc exp */
+	exp = 16.0;
+	value = 1.0;
+	while (abspower) {
+		if (abspower & 1) {
+			value *= exp;
+		}
+		exp = exp * exp;
+		abspower >>= 1;
+	}
+
+	if (power < 0) value = 1.0 / value;
+	value = value * mant / 16777216.0;
+	if (positive == 0) value = -value;
+	return (float)value;
+}
+
+/*
+ * convert a float to an IBM single precision number v1.0
+ *
+ *                      Wesley Ebisuzaki
+ *
+ * doesn't handle subnormal numbers
+ */
+
+static
+int flt2ibm(float x, unsigned char *ibm) {
+
+	int sign, exp, i;
+	double mant;
+
+	if ( !(fabs((double)x) > 0) ) {
+		ibm[0] = ibm[1] = ibm[2] = ibm[3] = 0;
+		return 0;
+	}
+
+	/* sign bit */
+	if (x < 0.0) {
+		sign = 128;
+		x = -x;
+	}
+	else sign = 0;
+
+	mant = frexp((double) x, &exp);
+
+	/* round up by adding 2**-24 */
+	/* mant = mant + 1.0/16777216.0; */
+
+	if (mant >= 1.0) {
+		mant = 0.5;
+		exp++;
+	}
+	while (exp & 3) {
+		mant *= 0.5;
+		exp++;
+	}
+	
+	exp = exp/4 + 64;
+
+	if (exp < 0) {
+		fprintf(stderr,"underflow in flt2ibm\n");
+		ibm[0] = ibm[1] = ibm[2] = ibm[3] = 0;
+		return 0;
+	}
+	if (exp > 127) {
+		fprintf(stderr,"overflow in flt2ibm\n");
+		ibm[0] = sign | 127;
+		ibm[1] = ibm[2] = ibm[3] = 255;
+		return -1;
+	}
+
+	/* normal number */
+
+	ibm[0] = sign | exp;
+
+	mant = mant * 256.0;
+	i = (int) floor(mant);
+	mant = mant - i;
+	ibm[1] = i;
+
+	mant = mant * 256.0;
+	i = (int) floor(mant);
+	mant = mant - i;
+	ibm[2] = i;
+
+	ibm[3] = (int) floor(mant*256.0);
+
+	return 0;
+}
+
+
+#define  GET_UINT4(xb)        ((int) (((int)xb[0]<<24) + \
+                                      ((int)xb[1]<<16) + \
+                                      ((int)xb[2]<<8)  + \
+                                      ((int)xb[3])))
+#define  GET_UINT8(xb)        ((INT64) (((INT64)xb[0]<<56) + \
+                                        ((INT64)xb[1]<<48) + \
+                                        ((INT64)xb[2]<<40) + \
+                                        ((INT64)xb[3]<<32) + \
+                                        ((INT64)xb[4]<<24) + \
+                                        ((INT64)xb[5]<<16) + \
+                                        ((INT64)xb[6]<<8)  + \
+					((INT64)xb[7])))
+
+#define  PUT_UINT4(xb, iv)    ((*(xb)   = (iv) >> 24), \
+                               (*(xb+1) = (iv) >> 16), \
+                               (*(xb+2) = (iv) >>  8), \
+                               (*(xb+3) = (iv)))
+#define  PUT_UINT8(xb, iv)    ((*(xb)   = (iv) >> 56), \
+                               (*(xb+1) = (iv) >> 48), \
+                               (*(xb+2) = (iv) >> 40), \
+                               (*(xb+3) = (iv) >> 32), \
+                               (*(xb+4) = (iv) >> 24), \
+                               (*(xb+5) = (iv) >> 16), \
+                               (*(xb+6) = (iv) >>  8), \
+                               (*(xb+7) = (iv)))
+
+
+void cdologs(int noper)
+{
+#if defined (HAVE_LOCK)
+#if defined (LOGPATH)
+#define  XSTRING(x)	#x
+#define  STRING(x)	XSTRING(x)
+  char logfilename[] = STRING(LOGPATH) "/cdo.logs";
+  int  logfileno;
+  char timestr[30];
+  time_t date_and_time_in_sec;
+  struct tm *date_and_time;
+  int i;
+  int status;
+  int uselock = 1;
+  int date = 0, ncdo = 0, nhours = 0;
+  int date0 = 0, ncdo0, noper0, nhours0;
+  double cputime0;
+  INT64 nvals0;
+  unsigned char logbuf[LOGSSIZE];
+  unsigned char *logdate   =  logbuf;
+  unsigned char *logncdo   = &logbuf[4];
+  unsigned char *lognoper  = &logbuf[8];
+  unsigned char *logctime  = &logbuf[12];
+  unsigned char *lognvals  = &logbuf[16];
+  unsigned char *lognhours = &logbuf[24];
+  const size_t logsize = LOGSSIZE;
+  size_t bufsize;
+  struct flock mylock;
+  struct stat filestat;
+  off_t nvals;
+  int processID;
+  double cputime;
+
+  nvals = 0;
+  cputime = 0;
+  for ( processID = 0; processID < noper; processID++ )
+    {
+      cputime += processInqCputime(processID);
+      nvals += processInqNvals(processID);
+    }
+
+  memset(logbuf, 0, logsize);
+
+  date_and_time_in_sec = time(NULL);
+
+  if ( date_and_time_in_sec != -1 )
+    {
+      date_and_time = localtime(&date_and_time_in_sec);
+      (void) strftime(timestr, sizeof(timestr), "%Y%m%d", date_and_time);
+      date = atoi(timestr);
+    }
+
+  errno = 0;
+  logfileno = open(logfilename, O_RDWR);
+  if ( errno )
+    {
+      errno = 0;
+      return;
+    }
+
+
+  if ( (int) lseek(logfileno, (off_t) 0, SEEK_END) == 0 ) uselock = 0;
+  status = (int) lseek(logfileno, 0, SEEK_SET);
+  
+  if ( uselock )
+    {
+      /*
+	memset(&mylock, 0, sizeof(struct flock));
+	status = fcntl(logfileno, F_GETLK, &mylock);
+	filestatus(&mylock);
+      */
+
+      mylock.l_type   = F_WRLCK;
+      mylock.l_whence = SEEK_SET;
+      mylock.l_start  = 0;
+      mylock.l_len    = 0;
+
+      /*
+	status = fcntl(logfileno, F_SETLKW, &mylock);
+      */
+      for ( i = 0; i < 100; i++ )
+	{
+	  status = fcntl(logfileno, F_SETLK, &mylock);
+	  if ( status == 0 ) break;
+	  usleep(10000);
+	}
+      errno = 0;
+      if ( status != 0 ) goto endlabel;
+    }
+
+  status = fstat(logfileno, &filestat);
+  errno = 0;
+  if ( status != 0 ) goto endlabel;
+
+  bufsize = (size_t) filestat.st_size;
+
+  if ( bufsize > 0 )
+    {
+      status = (int) lseek(logfileno, (off_t) (bufsize-logsize), SEEK_SET);
+      status = (int) read(logfileno, logbuf, logsize);
+
+      date0    = GET_UINT4(logdate);
+      ncdo0    = GET_UINT4(logncdo);
+      noper0   = GET_UINT4(lognoper);
+      cputime0 = (double) ibm2flt(logctime);
+      nvals0   = GET_UINT8(lognvals);
+      nhours0  = GET_UINT4(lognhours);
+
+      if ( date == date0 )
+	{
+	  ncdo = ncdo0;
+	  nhours = nhours0;
+	  noper += noper0;
+	  cputime += cputime0;
+	  nvals += (off_t) nvals0;
+	  status = (int) lseek(logfileno, (off_t) (bufsize-logsize), SEEK_SET);
+	}
+    }
+
+  if ( date >= date0 )
+    {
+      ncdo++;
+
+      while ( cputime >= 3600 ) { cputime -= 3600; nhours++; }
+
+      PUT_UINT4(logdate, date);
+      PUT_UINT4(logncdo, ncdo);
+      PUT_UINT4(lognoper, noper);
+      flt2ibm((float)cputime, logctime);
+      PUT_UINT8(lognvals, nvals);
+      PUT_UINT4(lognhours, nhours);
+
+      status = (int) write(logfileno, logbuf, logsize);
+    }
+
+ endlabel:
+
+  if ( uselock )
+    {
+      mylock.l_type = F_UNLCK;
+      status = fcntl(logfileno, F_SETLK, &mylock);
+    }
+
+  close(logfileno);
+
+  errno = 0;
+
+  return;
+
+#endif
+#endif
+}
+
+
+void dumplogs(const char *logfilename)
+{
+#if defined (HAVE_LOCK)
+  int  logfileno;
+  int status;
+  int date0 = 0, ncdo0, noper0, nhours0;
+  int nlogs;
+  int i;
+  double cputime0;
+  INT64 nvals0;
+  unsigned char logbuf[LOGSSIZE];
+  unsigned char *logdate   =  logbuf;
+  unsigned char *logncdo   = &logbuf[4];
+  unsigned char *lognoper  = &logbuf[8];
+  unsigned char *logctime  = &logbuf[12];
+  unsigned char *lognvals  = &logbuf[16];
+  unsigned char *lognhours = &logbuf[24];
+  unsigned char *buffer = NULL;
+  const size_t logsize = LOGSSIZE;
+  size_t bufsize;
+  struct flock mylock;
+  struct stat filestat;
+
+  errno = 0;
+  logfileno = open(logfilename, O_RDONLY);
+  if ( errno )
+    {
+      cdoAbort("Open failed on %s", logfilename);
+      errno = 0;
+      return;
+    }
+
+  memset(&mylock, 0, sizeof(struct flock));
+  status = fcntl(logfileno, F_GETLK, &mylock);
+  filestatus(&mylock);
+
+  status = fstat(logfileno, &filestat);
+  errno = 0;
+  if ( status != 0 ) return;
+
+  bufsize = (size_t) filestat.st_size;
+
+  if ( bufsize > 0 )
+    {
+      buffer = (unsigned char *) malloc(bufsize);
+
+      status = (int) read(logfileno, buffer, bufsize);
+
+      nlogs = bufsize / logsize;
+      for ( i = 0; i < nlogs; i++ )
+	{
+	  memcpy(logbuf, &buffer[i*logsize], logsize);
+	  date0    = GET_UINT4(logdate);
+	  ncdo0    = GET_UINT4(logncdo);
+	  noper0   = GET_UINT4(lognoper);
+	  cputime0 = (double) ibm2flt(logctime);
+	  nvals0   = GET_UINT8(lognvals);
+	  nhours0  = GET_UINT4(lognhours);
+
+	  if ( sizeof(INT64) > sizeof(long) )
+	    fprintf(stdout, "%8d %10d %10d %19lld %10d %8.2f\n",
+		    date0, ncdo0, noper0, (long long)nvals0, nhours0, cputime0);
+	  else
+	    fprintf(stdout, "%8d %10d %10d %19ld %10d %8.2f\n",
+		    date0, ncdo0, noper0, (long)nvals0, nhours0, cputime0);
+	}
+
+      free(buffer);
+    }
+
+  close(logfileno);
+
+  errno = 0;
+
+  return;
+#endif
+}
+
+
+void daylogs(const char *logfilename)
+{
+  int  logfileno;
+  int status;
+  int date0 = 0, ncdo0, noper0, nhours0;
+  int nlogs;
+  int i;
+  double cputime0;
+  INT64 nvals0;
+  unsigned char logbuf[LOGSSIZE];
+  unsigned char *logdate   =  logbuf;
+  unsigned char *logncdo   = &logbuf[4];
+  unsigned char *lognoper  = &logbuf[8];
+  unsigned char *logctime  = &logbuf[12];
+  unsigned char *lognvals  = &logbuf[16];
+  unsigned char *lognhours = &logbuf[24];
+  unsigned char *buffer = NULL;
+  const size_t logsize = LOGSSIZE;
+  size_t bufsize;
+  struct stat filestat;
+
+  errno = 0;
+  logfileno = open(logfilename, O_RDONLY);
+  if ( errno )
+    {
+      cdoAbort("Open failed on %s", logfilename);
+      errno = 0;
+      return;
+    }
+
+  status = fstat(logfileno, &filestat);
+  errno = 0;
+  if ( status != 0 ) return;
+
+  bufsize = (size_t) filestat.st_size;
+
+  if ( bufsize > 0 )
+    {
+      buffer = (unsigned char *) malloc(bufsize);
+
+      status = (int) read(logfileno, buffer, bufsize);
+
+      fprintf(stdout, "# day           noper         size [MB]    time [s]\n");
+      nlogs = bufsize / logsize;
+      for ( i = 0; i < nlogs; i++ )
+	{
+	  memcpy(logbuf, &buffer[i*logsize], logsize);
+	  date0    = GET_UINT4(logdate);
+	  ncdo0    = GET_UINT4(logncdo);
+	  noper0   = GET_UINT4(lognoper);
+	  cputime0 = (double) ibm2flt(logctime);
+	  nvals0   = GET_UINT8(lognvals);
+	  nhours0  = GET_UINT4(lognhours);
+
+	  fprintf(stdout, "%8d %12d %12d %12d\n",
+		  date0, noper0, (int)(8*nvals0/(1024*1024)), (int) (nhours0*3600.+cputime0));
+	}
+
+      free(buffer);
+    }
+
+  close(logfileno);
+
+  errno = 0;
+
+  return;
+}
+
+
+void monlogs(const char *logfilename)
+{
+  int  logfileno;
+  int status;
+  int date0 = 0, ncdo0, noper0, nhours0;
+  int nlogs;
+  int i;
+  double cputime0;
+  INT64 nvals0;
+  unsigned char logbuf[LOGSSIZE];
+  unsigned char *logdate   =  logbuf;
+  unsigned char *logncdo   = &logbuf[4];
+  unsigned char *lognoper  = &logbuf[8];
+  unsigned char *logctime  = &logbuf[12];
+  unsigned char *lognvals  = &logbuf[16];
+  unsigned char *lognhours = &logbuf[24];
+  unsigned char *buffer = NULL;
+  int ymon = 0, ymon0 = 0;
+  unsigned int noper = 0;
+  double size = 0, cputime = 0;
+  const size_t logsize = LOGSSIZE;
+  size_t bufsize;
+  struct stat filestat;
+
+  errno = 0;
+  logfileno = open(logfilename, O_RDONLY);
+  if ( errno )
+    {
+      cdoAbort("Open failed on %s", logfilename);
+      errno = 0;
+      return;
+    }
+
+  status = fstat(logfileno, &filestat);
+  errno = 0;
+  if ( status != 0 ) return;
+
+  bufsize = (size_t) filestat.st_size;
+
+  if ( bufsize > 0 )
+    {
+      buffer = (unsigned char *) malloc(bufsize);
+
+      status = (int) read(logfileno, buffer, bufsize);
+
+      fprintf(stdout, "# month         noper         size [GB]    time [h]\n");
+      nlogs = bufsize / logsize;
+      for ( i = 0; i < nlogs; i++ )
+	{
+	  memcpy(logbuf, &buffer[i*logsize], logsize);
+	  date0    = GET_UINT4(logdate);
+	  ncdo0    = GET_UINT4(logncdo);
+	  noper0   = GET_UINT4(lognoper);
+	  cputime0 = (double) ibm2flt(logctime);
+	  nvals0   = GET_UINT8(lognvals);
+	  nhours0  = GET_UINT4(lognhours);
+
+	  if ( i == 0 ) ymon0 = date0/100;
+	  ymon = date0/100;
+
+	  if ( ymon != ymon0 )
+	    {
+	      if ( i )
+		fprintf(stdout, "%6d   %12u %12d %12d\n",
+			ymon0, noper, (int)(8*size/(1024*1024*1024)), (int) (cputime/3600));
+		
+	      noper = 0;
+	      size  = 0;
+              cputime = 0;
+	    }
+	  noper += noper0;
+	  size += nvals0;
+	  cputime += (nhours0*3600.+cputime0);
+	  
+	  ymon0 = ymon;
+	}
+      fprintf(stdout, "%6d   %12u %12d %12d\n",
+	      ymon0, noper, (int)(8*size/(1024*1024*1024)), (int) (cputime/3600));
+      
+      free(buffer);
+    }
+
+  close(logfileno);
+
+  errno = 0;
+
+  return;
+}
+
+
+void cdologo(int noper)
+{
+#if defined (HAVE_LOCK)
+#if defined (LOGPATH)
+#define  XSTRING(x)	#x
+#define  STRING(x)	XSTRING(x)
+  char logfilename[] = STRING(LOGPATH) "/cdo.logo";
+  int  logfileno;
+  int i;
+  int status;
+  int uselock = 1;
+  int nhours = 0;
+  int nhours0 = 0;
+  double cputime0 = 0;
+  INT64 nvals0 = 0;
+  unsigned char logbuf[LOGOSIZE];
+  unsigned char *logname   =  logbuf;
+  unsigned char *lognocc   = &logbuf[16];
+  unsigned char *lognvals  = &logbuf[20];
+  unsigned char *lognhours = &logbuf[28];
+  unsigned char *logctime  = &logbuf[32];
+  unsigned char *buffer = NULL;
+  const size_t logsize = LOGOSIZE;
+  size_t bufsize, newbufsize;
+  struct flock mylock;
+  struct stat filestat;
+  int nocc = 0;
+  int nbuf;
+  int processID;
+  off_t onvals[256];
+  double ocputime[256];
+  const char *oname[256];
+
+  for ( processID = 0; processID < noper; processID++ )
+    {
+      ocputime[processID] = processInqCputime(processID);
+      onvals[processID]   = processInqNvals(processID);
+      oname[processID]    = processInqOpername2(processID);
+    }
+
+  memset(logbuf, 0, logsize);
+
+  errno = 0;
+  logfileno = open(logfilename, O_RDWR);
+  if ( errno )
+    {
+      errno = 0;
+      return;
+    }
+
+  if ( (int) lseek(logfileno, (off_t) 0, SEEK_END) == 0 ) uselock = 0;
+  status = (int) lseek(logfileno, 0, SEEK_SET);
+  
+  if ( uselock )
+    {
+      mylock.l_type   = F_WRLCK;
+      mylock.l_whence = SEEK_SET;
+      mylock.l_start  = 0;
+      mylock.l_len    = 0;
+
+      /*
+	status = fcntl(logfileno, F_SETLKW, &mylock);
+      */
+      for ( i = 0; i < 100; i++ )
+	{
+	  status = fcntl(logfileno, F_SETLK, &mylock);
+	  if ( status == 0 ) break;
+	  usleep(10000);
+	}
+      errno = 0;
+      if ( status != 0 ) goto endlabel;
+    }
+
+  status = fstat(logfileno, &filestat);
+  errno = 0;
+  if ( status != 0 ) goto endlabel;
+
+  bufsize = (size_t) filestat.st_size;
+
+  newbufsize = bufsize + noper*logsize;
+  buffer = (unsigned char *) malloc(newbufsize);
+  if ( bufsize > 0 )
+    status = (int) read(logfileno, buffer, bufsize);
+
+  for ( processID = 0; processID < noper; processID++ )
+    {
+      if ( oname[processID] == NULL ) break; /* baustelle !! */
+      nbuf = (int) (bufsize / logsize);
+
+      for ( i = 0; i < nbuf; i++ )
+	{
+	  memcpy(logbuf, buffer+i*logsize, logsize);
+	  nocc     = GET_UINT4(lognocc);
+	  nvals0   = GET_UINT8(lognvals);
+	  nhours0  = GET_UINT4(lognhours);
+	  cputime0 = (double) ibm2flt(logctime);
+
+	  if ( strcmp((const char*)logname, oname[processID]) == 0 ) break;
+	}
+
+      if ( i == nbuf )
+	{
+	  nocc     = 0;
+	  nvals0   = 0;
+          nhours0  = 0;
+          cputime0 = 0;
+	  bufsize += logsize;
+	  strcpy((char *)logname, oname[processID]);
+	}
+
+      nocc++;
+	  
+      nvals0   += (off_t) onvals[processID];
+      nhours0  += nhours;
+      cputime0 += ocputime[processID];
+      while ( cputime0 >= 3600 ) { cputime0 -= 3600; nhours0++; }
+
+      PUT_UINT4(lognocc, nocc);
+      PUT_UINT8(lognvals, nvals0);
+      PUT_UINT4(lognhours, nhours0);
+      flt2ibm((float)cputime0, logctime);
+
+      memcpy(buffer+i*logsize, logbuf, logsize);
+    }
+
+  status = (int) lseek(logfileno, 0, SEEK_SET);
+  status = (int) write(logfileno, buffer, bufsize);
+
+  free(buffer);
+
+ endlabel:
+
+  if ( uselock )
+    {
+      mylock.l_type = F_UNLCK;
+      status = fcntl(logfileno, F_SETLK, &mylock);
+    }
+
+  close(logfileno);
+
+  errno = 0;
+
+  return;
+
+#endif
+#endif
+}
+
+
+typedef struct
+{
+  int      nocc;
+  INT64    nvals;
+  double   time;
+  double   perc;
+  char     name[128];
+}
+LogInfo;
+
+static
+int cmplognocc(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  LogInfo *x = (LogInfo *) s1;
+  LogInfo *y = (LogInfo *) s2;
+
+  if      ( x->nocc < y->nocc ) cmp =  1;
+  else if ( x->nocc > y->nocc ) cmp = -1;
+
+  return (cmp);
+}
+
+static
+int cmplognvals(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  LogInfo *x = (LogInfo *) s1;
+  LogInfo *y = (LogInfo *) s2;
+
+  if      ( x->nvals < y->nvals ) cmp =  1;
+  else if ( x->nvals > y->nvals ) cmp = -1;
+
+  return (cmp);
+}
+
+static
+int cmplogtime(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  LogInfo *x = (LogInfo *) s1;
+  LogInfo *y = (LogInfo *) s2;
+
+  if      ( x->time < y->time ) cmp =  1;
+  else if ( x->time > y->time ) cmp = -1;
+
+  return (cmp);
+}
+
+static
+int cmplogperc(const void *s1, const void *s2)
+{
+  int cmp = 0;
+  LogInfo *x = (LogInfo *) s1;
+  LogInfo *y = (LogInfo *) s2;
+
+  if      ( x->perc < y->perc ) cmp =  1;
+  else if ( x->perc > y->perc ) cmp = -1;
+
+  return (cmp);
+}
+
+static
+int cmplogname(const void *s1, const void *s2)
+{
+  LogInfo *x = (LogInfo *) s1;
+  LogInfo *y = (LogInfo *) s2;
+
+  return (strcmp(x->name, y->name));
+}
+
+
+void dumplogo(const char *logfilename, int dumptype)
+{
+#if defined (HAVE_LOCK)
+  int logfileno;
+  int status;
+  int nocc;
+  int nhours0;
+  int nlogs;
+  int i;
+  int mem;
+  double cputime0;
+  INT64 nvals0;
+  unsigned char logbuf[LOGOSIZE];
+  unsigned char *logname   =  logbuf;
+  unsigned char *lognocc   = &logbuf[16];
+  unsigned char *lognvals  = &logbuf[20];
+  unsigned char *lognhours = &logbuf[28];
+  unsigned char *logctime  = &logbuf[32];
+  unsigned char *buffer = NULL;
+  const size_t logsize = LOGOSIZE;
+  size_t bufsize;
+  struct flock mylock;
+  struct stat filestat;
+  LogInfo **logInfo;
+
+  errno = 0;
+  logfileno = open(logfilename, O_RDONLY);
+  if ( errno )
+    {
+      cdoAbort("Open failed on %s", logfilename);
+      errno = 0;
+      return;
+    }
+
+  memset(&mylock, 0, sizeof(struct flock));
+  status = fcntl(logfileno, F_GETLK, &mylock);
+  filestatus(&mylock);
+
+  status = fstat(logfileno, &filestat);
+  errno = 0;
+  if ( status != 0 ) return;
+
+  bufsize = (size_t) filestat.st_size;
+
+  if ( bufsize > 0 )
+    {
+      fprintf(stdout, "# num name                     call        mem [GB]    time [h]     perc [s]\n");
+      buffer = (unsigned char *) malloc(bufsize);
+
+      status = (int) read(logfileno, buffer, bufsize);
+
+      nlogs = bufsize / logsize;
+
+      logInfo    = (LogInfo **) malloc(nlogs*sizeof(LogInfo *));
+      logInfo[0] = (LogInfo *) malloc(nlogs*sizeof(LogInfo));
+      for ( i = 1; i < nlogs; i++ ) logInfo[i] = logInfo[0] + i;
+
+      for ( i = 0; i < nlogs; i++ )
+	{
+	  memcpy(logbuf, &buffer[i*logsize], logsize);
+	  nocc     = GET_UINT4(lognocc);
+	  nvals0   = GET_UINT8(lognvals);
+	  nhours0  = GET_UINT4(lognhours);
+	  cputime0 = (double) ibm2flt(logctime);
+
+	  strcpy(logInfo[i]->name, (const char *)logname);
+	  logInfo[i]->nocc  = nocc;
+	  logInfo[i]->nvals = nvals0;
+	  logInfo[i]->time  = nhours0 + cputime0/3600;
+	  logInfo[i]->perc  = 3600*logInfo[i]->time/nocc;
+	}
+
+      if      ( dumptype == 1 )
+	qsort(logInfo[0], nlogs, sizeof(LogInfo), cmplogname);
+      else if ( dumptype == 2 )
+	qsort(logInfo[0], nlogs, sizeof(LogInfo), cmplognocc);
+      else if ( dumptype == 3 )
+	qsort(logInfo[0], nlogs, sizeof(LogInfo), cmplognvals);
+      else if ( dumptype == 4 )
+	qsort(logInfo[0], nlogs, sizeof(LogInfo), cmplogtime);
+      else if ( dumptype == 5 )
+	qsort(logInfo[0], nlogs, sizeof(LogInfo), cmplogperc);
+
+      for ( i = 0; i < nlogs; i++ )
+	{
+	  mem = (int)(8*logInfo[i]->nvals/(1024*1024*1024));
+	  if ( sizeof(INT64) > sizeof(long) )
+	    fprintf(stdout, "%4d  %-16s %12d %12d %12.3f %12.3f\n", i+1, logInfo[i]->name, 
+		    logInfo[i]->nocc, mem, logInfo[i]->time, logInfo[i]->perc);
+	  else
+	    fprintf(stdout, "%4d  %-16s %12d %12d %12.3f %12.3f\n", i+1, logInfo[i]->name,
+		    logInfo[i]->nocc, mem, logInfo[i]->time, logInfo[i]->perc);
+	}
+
+      free(logInfo[0]);
+      free(logInfo);
+      free(buffer);
+    }
+
+  close(logfileno);
+
+  errno = 0;
+
+  return;
+#endif
+}
diff --git a/src/util.c b/src/util.c
new file mode 100644
index 0000000..56b907c
--- /dev/null
+++ b/src/util.c
@@ -0,0 +1,368 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <stdio.h>
+#include <string.h>
+#include <ctype.h>   /* tolower */
+
+#include "cdi.h"
+#include "cdo.h"
+#include "cdo_int.h"
+#include "modules.h"
+#include "util.h"
+
+
+char *getProgname(char *string)
+{
+  char *progname;
+
+#if defined (_WIN32)
+  /*  progname = strrchr(string, '\\'); */
+  progname = " cdo";
+#else
+  progname = strrchr(string, '/');
+#endif
+
+  if ( progname == NULL ) progname = string;
+  else                    progname++;
+
+  return (progname);
+}
+
+char *getOperator(const char *argument)
+{
+  char *operatorArg = NULL;
+  char *blankpos;
+  size_t len;
+
+  if ( argument )
+    {
+      blankpos = strchr(argument, ' ');
+
+      if ( blankpos )
+	len = blankpos - argument;
+      else
+	len = strlen(argument);
+
+      operatorArg = (char *) malloc(len+1);
+
+      memcpy(operatorArg, argument, len);
+      operatorArg[len] = '\0';
+    }
+
+  return (operatorArg);
+}
+
+char *operatorAlias(char *operatorName);
+
+char *getOperatorName(const char *operatorArg)
+{
+  char *commapos;
+  char *operatorName = NULL;
+  size_t len;
+
+  if ( operatorArg )
+    {
+      if ( operatorArg[0] == '-' ) operatorArg++;
+
+      commapos = strchr(operatorArg, ',');
+
+      if ( commapos )
+	len = commapos - operatorArg;
+      else
+	len = strlen(operatorArg);
+
+      operatorName = (char *) malloc(len+1);
+
+      memcpy(operatorName, operatorArg, len);
+      operatorName[len] = '\0';
+    }
+
+  /*  return (operatorName); */
+  return (operatorAlias(operatorName));
+}
+
+
+char *makeArgument(int argc, char *argv[])
+{
+  char *argument = NULL;
+  int iarg;
+  size_t len, pos = 0, off = 0;
+
+  if ( argv[0][0] == '-' ) off = 1;
+  for ( iarg = 0; iarg < argc; iarg++ )
+    {
+      len = strlen(argv[iarg]) + 1 - off;
+      argument = (char *) realloc(argument, pos+len);
+      strcpy(&argument[pos], argv[iarg]+off);
+      pos += len;
+      argument[pos-1] = ' ';
+      off = 0;
+    }
+
+  if ( argc )
+    argument[pos-1] = '\0';
+
+  return (argument);
+}
+
+
+char *getFileArg(char *argument)
+{
+  char *fileArg = NULL;
+  char *parg;
+  char *blankpos;
+  size_t len;
+
+  if ( argument )
+    {
+      blankpos = strchr(argument, ' ');
+
+      if ( blankpos )
+	{
+	  parg = blankpos + 1;
+	  len = strlen(parg);
+	  fileArg = (char *) malloc(len+1);
+	  strcpy(fileArg, parg);
+	}
+    }
+
+  return (fileArg);
+}
+
+
+void input_int(char *arg, int intarr[], int maxint, int *nintfound)
+{
+  int nint = 0;
+
+  intarr[nint++] = atoi(arg);
+
+  while ( (arg = strchr(arg, ',')) && (nint < maxint) )
+    intarr[nint++] = atoi(++arg);
+    
+  *nintfound = nint;
+}
+
+
+void strtolower(char *str)
+{
+  int i, len;
+
+  if ( str )
+    {
+      len = (int) strlen(str);
+      for ( i = 0; i < len; i++ )
+	str[i] = tolower((int) str[i]);
+    }
+}
+
+
+const char *seas_name_dec[4] = {"DJF", "MAM", "JJA", "SON"};
+const char *seas_name_jan[4] = {"JFM", "AMJ", "JAS", "OND"};
+
+int get_season_start(void)
+{
+  int season_start = START_DEC;
+  char *envstr;
+
+  envstr = getenv("CDO_SEASON_START");
+  if ( envstr )
+    {
+      if      ( strcmp(envstr, "DEC") == 0 ) season_start = START_DEC;
+      else if ( strcmp(envstr, "JAN") == 0 ) season_start = START_JAN;
+      
+      if ( cdoVerbose )
+	{
+	  if      ( season_start == START_DEC )
+	    cdoPrint("Set SEASON_START to December");
+	  else if ( season_start == START_JAN )
+	    cdoPrint("Set SEASON_START to January");
+	}
+    }
+
+  return (season_start);
+}
+
+
+void get_season_name(const char *seas_name[4])
+{
+  long i;
+
+  if ( get_season_start() == START_DEC )
+    for ( i = 0; i < 4; ++i ) seas_name[i] = seas_name_dec[i];
+  else
+    for ( i = 0; i < 4; ++i ) seas_name[i] = seas_name_jan[i];
+}
+
+
+//#include <sys/types.h>
+#include <sys/stat.h>
+//#include <unistd.h>
+
+int fileExists(const char *filename)
+{
+  int status = 0;
+  struct stat buf;
+
+  if ( stat(filename, &buf) == 0 )
+    {
+      if ( buf.st_size > 0 ) status = 1;
+    }
+
+  return (status);
+}
+
+
+int userFileOverwrite(const char *filename)
+{
+  int status = 0, len;
+  char line[1024], *pline;
+
+  fprintf(stderr, "File %s already exists, overwrite? (yes/no): ", filename);
+  readline(stdin, line, 1024);
+  pline = line;
+  while ( isspace((int) *pline) ) pline++;
+  len = strlen(pline);
+  if ( len == 3 )
+    {
+      if ( pline[0] == 'y' && pline[1] == 'e' && pline[2] == 's' )
+	status = 1;
+      else if ( pline[0] == 'Y' && pline[1] == 'E' && pline[2] == 'S' )
+	status = 1;
+    }
+  else if ( len == 1 )
+    {
+      if ( pline[0] == 'y' ) status = 1;
+    }
+
+  return (status);
+}
+
+int stdin_is_tty  = 0;
+int stdout_is_tty = 0;
+
+void init_is_tty(void)
+{
+  struct stat statbuf;
+  fstat(0, &statbuf);
+  if ( S_ISCHR(statbuf.st_mode) ) stdin_is_tty = 1;  
+  fstat(1, &statbuf);
+  if ( S_ISCHR(statbuf.st_mode) ) stdout_is_tty = 1;  
+}
+
+
+int ps_lhead = FALSE;
+int ps_nch   = 0;
+int ps_cval  = -1;
+
+void progressInit(void)
+{
+  ps_lhead = FALSE;
+  ps_nch   = 0;;
+  ps_cval  = -1;
+}
+
+
+void progressStatus(double offset, double refval, double curval)
+{
+  int ival;
+
+  if ( !stdout_is_tty ) return;
+
+  offset = offset < 0 ? 0: offset;
+  offset = offset > 1 ? 1: offset;
+  refval = refval < 0 ? 0: refval;
+  refval = refval > 1 ? 1: refval;
+  curval = curval < 0 ? 0: curval;
+  curval = curval > 1 ? 1: curval;
+
+  ival = (offset + refval*curval)*100;
+
+  if ( ps_cval == -1 )
+    {
+      ps_nch = fprintf(stdout, "%s: %3d%%", processInqPrompt(), 0);
+      fflush(stdout);
+      ps_lhead = TRUE;
+    }
+
+  if ( ival != ps_cval )
+    {
+      ps_cval = ival;
+      fprintf(stdout, "\b\b\b\b%3d%%", ps_cval);
+      fflush(stdout);
+    }
+
+  if ( ps_cval == 100 && ps_lhead )
+    {
+      ps_lhead = FALSE;
+      while ( ps_nch-- ) fprintf(stdout, "\b \b");
+      fflush(stdout);
+    }
+}
+
+
+int datatype2str(int datatype, char *datatypestr)
+{
+  int status = 0;
+
+  if      ( datatype == DATATYPE_PACK   ) strcpy(datatypestr, "P0");
+  else if ( datatype > 0 && datatype <= 32  ) sprintf(datatypestr, "P%d", datatype);
+  else if ( datatype == DATATYPE_CPX32  ) strcpy(datatypestr, "C32");
+  else if ( datatype == DATATYPE_CPX64  ) strcpy(datatypestr, "C64");
+  else if ( datatype == DATATYPE_FLT32  ) strcpy(datatypestr, "F32");
+  else if ( datatype == DATATYPE_FLT64  ) strcpy(datatypestr, "F64");
+  else if ( datatype == DATATYPE_INT8   ) strcpy(datatypestr, "I8");
+  else if ( datatype == DATATYPE_INT16  ) strcpy(datatypestr, "I16");
+  else if ( datatype == DATATYPE_INT32  ) strcpy(datatypestr, "I32");
+  else if ( datatype == DATATYPE_UINT8  ) strcpy(datatypestr, "U8");
+  else if ( datatype == DATATYPE_UINT16 ) strcpy(datatypestr, "U16");
+  else if ( datatype == DATATYPE_UINT32 ) strcpy(datatypestr, "U32");
+  else                                  { strcpy(datatypestr, "-1"); status = -1;}
+
+  return (status);
+}
+
+
+int str2datatype(const char *datatypestr)
+{
+  int datatype = -1;
+  size_t len;
+
+  len = strlen(datatypestr);
+
+  if ( len > 1 )
+    {
+      int ilen = atoi(datatypestr+1);
+      if      ( memcmp(datatypestr, "P0",  len) == 0 ) datatype = DATATYPE_PACK;
+      else if ( memcmp(datatypestr, "P",     1) == 0 &&
+		ilen > 0 && ilen <= 32 )               datatype = atoi(datatypestr+1);
+      else if ( memcmp(datatypestr, "C32", len) == 0 ) datatype = DATATYPE_CPX32;
+      else if ( memcmp(datatypestr, "C64", len) == 0 ) datatype = DATATYPE_CPX64;
+      else if ( memcmp(datatypestr, "F32", len) == 0 ) datatype = DATATYPE_FLT32;
+      else if ( memcmp(datatypestr, "F64", len) == 0 ) datatype = DATATYPE_FLT64;
+      else if ( memcmp(datatypestr, "I8",  len) == 0 ) datatype = DATATYPE_INT8;
+      else if ( memcmp(datatypestr, "I16", len) == 0 ) datatype = DATATYPE_INT16;
+      else if ( memcmp(datatypestr, "I32", len) == 0 ) datatype = DATATYPE_INT32;
+      else if ( memcmp(datatypestr, "U8",  len) == 0 ) datatype = DATATYPE_UINT8;
+      else if ( memcmp(datatypestr, "U16", len) == 0 ) datatype = DATATYPE_UINT16;
+      else if ( memcmp(datatypestr, "U32", len) == 0 ) datatype = DATATYPE_UINT32;
+      else if ( memcmp(datatypestr, "real",   len) == 0 ) datatype = DATATYPE_FLT32;
+      else if ( memcmp(datatypestr, "double", len) == 0 ) datatype = DATATYPE_FLT64;
+    }
+
+  return (datatype);
+}
diff --git a/src/util.h b/src/util.h
new file mode 100644
index 0000000..5bb0f52
--- /dev/null
+++ b/src/util.h
@@ -0,0 +1,44 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#ifndef _UTIL_H
+#define _UTIL_H
+
+char *getProgname(char *string);
+char *getOperator(const char *argument);
+char *getOperatorName(const char *xoperator);
+
+char *makeArgument(int argc, char *argv[]);
+char *getFileArg(char *argument);
+
+enum {START_DEC, START_JAN};
+int get_season_start(void);
+void get_season_name(const char *seas_name[4]);
+
+void init_is_tty(void);
+
+void progressInit(void);
+void progressStatus(double offset, double refval, double curval);
+
+int fileExists(const char *filename);
+int userFileOverwrite(const char *filename);
+
+/* convert a CDI datatype to string */
+int datatype2str(int datatype, char *datatypestr);
+int str2datatype(const char *datatypestr);
+
+#endif  /* _UTIL_H */
diff --git a/src/vinterp.c b/src/vinterp.c
new file mode 100644
index 0000000..c6cf9e0
--- /dev/null
+++ b/src/vinterp.c
@@ -0,0 +1,427 @@
+#include <stdio.h>
+#include <stdlib.h> /* exit */
+#include <string.h>
+#include <math.h>
+
+#ifndef _VINTERP_H
+#  include "vinterp.h"
+#endif
+
+#define  SCALEHEIGHT     (-7000.)
+#define  SCALESLP        (101325.0)
+
+#define  C_EARTH_GRAV    (9.80665)
+#define  C_RKBOL         (1.380658e-23)     /* Boltzmann constant in J/K   */
+#define  C_RNAVO         (6.0221367e+23)    /* Avogadro constant in 1/mol  */
+#define  C_RMD           (28.9644)          /* molecular weight of dry air */
+#define  C_R             (C_RKBOL * C_RNAVO)
+#define  C_EARTH_RD      (1000. * C_R / C_RMD)
+
+double Grav          = C_EARTH_GRAV;
+double RD            = C_EARTH_RD;
+
+int Mars = 0;
+
+
+void h2p(double * restrict phlev, const double * restrict hlev, long nphlev)
+{
+  long k;
+  double exp_arg;
+  double height;
+
+  for ( k = 0; k < nphlev; k++ )
+    {
+      height  = hlev[k];
+      /*
+	unitsel == 1 : hlev[k] is given in meters
+	unitsel == 2 : hlev[k] is given in kilometers
+	h2p needs meters (MKSC-standard)
+      */
+
+      exp_arg = height / SCALEHEIGHT;
+
+      phlev[k] = SCALESLP * exp(exp_arg);
+    }
+
+}  /* h2p */
+
+
+void p2h(double * restrict hlev, const double * restrict plev, long nphlev)
+{
+  long  k;
+
+  for ( k = 0; k < nphlev; k++ )
+    {
+      hlev[k] = log(plev[k]/SCALESLP)*SCALEHEIGHT;
+    }
+
+}  /* p2h */
+
+
+void presh(double * restrict fullp, double * halfp, const double *restrict vct,
+	   const double *restrict ps, long nhlev, long ngp)
+{
+  long i, lh;
+  double zp, ze;
+  double *halfpres = halfp;
+
+  if ( ps == NULL )
+    {
+      fprintf(stderr, "ps undefined!\n");
+      exit(EXIT_FAILURE);
+    }
+
+  for ( lh = 0; lh < nhlev; lh++ )
+    {
+      zp = vct[lh];
+      ze = vct[lh+nhlev+1];
+
+      for ( i = 0; i < ngp; i++ ) halfpres[i] = zp + ze * ps[i];
+
+      halfpres += ngp;
+    }
+  memcpy(halfpres, ps, ngp*sizeof(double));
+
+  if ( fullp )
+    {
+      halfpres = halfp;
+      for ( i = 0; i < ngp*nhlev; i++ )
+	fullp[i] = 0.5 * (halfpres[i] + halfpres[i+ngp]);
+    }
+
+} /* presh */
+
+
+void genind(int *nx, const double * restrict plev, const double * restrict fullp, long ngp, long nplev, long nhlev)
+{
+  long  i, lp, lh;
+  int *nxl;
+  double pres;
+
+  memset(nx, 0, ngp*nplev*sizeof(int));
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, lh, pres, nxl)
+#endif
+  for ( lp = 0; lp < nplev; lp++ )
+    {
+      pres = plev[lp];
+      nxl  = nx + lp*ngp;
+      for ( lh = 0; lh < nhlev; lh++ )
+	for ( i = 0; i < ngp ; i++ )
+	   {
+	     if ( pres > fullp[lh*ngp+i] ) nxl[i] = lh;
+	   }
+    }
+
+}  /* genind */
+
+
+void genindmiss(int *nx, const double * restrict plev, int ngp, int nplev, const double * restrict ps_prog, int * restrict pnmiss)
+{
+  long i, lp;
+  int *nxl;
+  double pres;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, pres, nxl)
+#endif
+  for ( lp = 0; lp < nplev; lp++ )
+    {
+      pnmiss[lp] = 0;
+      pres = plev[lp];
+      nxl  = nx + lp*ngp;
+      for ( i = 0; i < ngp; i++ )
+	{
+	  if ( pres > ps_prog[i] )
+	    {
+	      nxl[i] = -1;
+	      pnmiss[lp]++;
+	    }
+	}
+    }
+
+}  /* genindmiss */
+
+
+void extra_P(double * restrict slp, const double * restrict halfp, const double * restrict fullp,
+	     const double * restrict geop, const double * restrict temp, long ngp)
+{
+  double alpha, tstar, tmsl, zprt, zprtal;
+  double zrg;
+  double zlapse = 0.0065;
+  long j;
+
+  zrg = 1.0 / Grav;
+
+  for ( j = 0; j < ngp; ++j )
+    {
+      if ( geop[j] < 0.0001 && geop[j] > -0.0001 ) slp[j] = halfp[j];
+      else
+	{
+	  alpha = RD * zlapse * zrg;
+	  tstar = (1.0 + alpha * (halfp[j]/fullp[j] - 1.0)) * temp[j];
+
+	  if ( tstar < 255.0 ) tstar = 0.5 * (255.0 + tstar);
+
+	  tmsl = tstar + zlapse * zrg * geop[j];
+	  if ( tmsl > 290.5 && tstar > 290.5 )
+	    {
+	      tstar = 0.5 * (290.5 + tstar);
+	      tmsl  = tstar;
+	    }
+
+	  if ( tmsl-tstar < 0.000001 && tstar-tmsl < 0.000001 )
+	    alpha = 0.0;
+	  else if ( geop[j] > 0.0001 || geop[j] < -0.0001 )
+	    alpha = RD * (tmsl-tstar) / geop[j];
+
+	  zprt   = geop[j] / (RD * tstar);
+	  zprtal = zprt * alpha;
+	  slp[j] = halfp[j] * exp(zprt*(1.0-zprtal*(0.5-zprtal/3.0)));
+	}
+    }
+
+}  /* extrap */
+
+
+static 
+double extra_T(double pres, double halfp, double fullp, double geop, double temp)
+{
+  double tstar, ztsz, z1, ztmsl, zalph, peval, zhts, zalp;
+  double zrg;
+  double zlapse = 0.0065;
+
+  zrg   = 1.0 / Grav;
+  tstar = (1.0 + zlapse * RD * zrg * (halfp/fullp - 1.0)) * temp;
+  ztsz  = tstar;
+  z1    = tstar + zlapse * zrg * geop;
+
+  if ( tstar < 255.0 ) tstar = 0.5 * (255.0 + tstar);
+
+  ztmsl = tstar + zlapse * zrg * geop;
+
+  if ( ztmsl > 290.5 && tstar > 290.5 )
+    {
+      tstar = 0.5 * (290.5 + tstar);
+      ztmsl = tstar;
+    }
+
+  if ( ztmsl > 290.5 && tstar <= 290.5 ) ztmsl=290.5;
+
+  zalph = RD*zlapse*zrg;
+
+  if ( ztmsl-tstar < 0.000001 && tstar-ztmsl < 0.000001 ) zalph=0.0;
+
+  if ( (ztmsl-tstar > 0.000001 || tstar-ztmsl > 0.000001 ) &&
+       (geop > 0.0001 || geop < -0.0001) )
+    zalph = RD*(ztmsl-tstar)/geop;
+
+  if ( pres <= halfp )
+    peval = ((halfp-pres)*temp+ (pres-fullp)*tstar)/ (halfp-fullp);
+  else
+    {
+      ztmsl = z1;
+      tstar = ztsz;
+      zhts  = geop * zrg;
+
+      if ( zhts > 2000. && z1 > 298. )
+	{
+	  ztmsl = 298.;
+	  if ( zhts < 2500. ) ztmsl = 0.002*((2500.-zhts)*z1+(zhts-2000.)*ztmsl);
+	}
+
+      if ( (ztmsl-tstar) < 0.000001 )
+	zalph = 0.;
+      else if (geop > 0.0001 || geop < -0.0001)
+	zalph = RD*(ztmsl-tstar)/geop;
+      else
+	zalph = RD*zlapse*zrg;
+
+      zalp  = zalph*log(pres/halfp);
+      peval = tstar*(1.0+zalp*(1.0+zalp*(0.5+0.16666666667*zalp)));
+    }
+
+  return peval;
+
+}  /* extra_T */
+
+
+static 
+double extra_Z(double pres, double halfp, double fullp, double geop, double temp)
+{
+  double alpha, tstar, tmsl, zalp, zalpal;
+  double zrg;
+  double zlapse = 0.0065;
+
+  zrg   = 1.0 / Grav;
+  alpha = RD * zlapse * zrg;
+  tstar = (1.0 + alpha * (halfp/fullp - 1.0)) * temp;
+
+  if ( tstar < 255.0 ) tstar = 0.5 * (255.0 + tstar);
+
+  tmsl = tstar + zlapse * zrg * geop;
+
+  if ( tmsl > 290.5 && tstar > 290.5 )
+    {
+      tstar = 0.5 * (290.5 + tstar);
+      tmsl  = tstar;
+    }
+
+  if ( tmsl > 290.5 && tstar <= 290.5 ) tmsl = 290.5;
+
+  if ( tmsl-tstar < 0.000001 && tstar-tmsl < 0.000001 )
+    alpha = 0.0;
+  else if ( geop > 0.0001 || geop < -0.0001 )
+    alpha = RD * (tmsl-tstar) / geop;
+
+  zalp   = log(pres/halfp);
+  zalpal = zalp * alpha;
+
+  return ((geop - RD*tstar*zalp*(1.0 + zalpal*(0.5 + zalpal/6.0)))*zrg);
+
+}  /* extra_Z */
+
+
+void interp_X(const double * restrict gt, double *pt, const double * restrict hyb_press, const int *nx,
+	      const double * restrict plev, long nplev, long ngp, long nhlev, double missval)
+{
+  long lp, i;
+  long nl, nh;
+  const int *nxl;
+  double *ptl;
+  double pres;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, pres, nl, nh, nxl, ptl)
+#endif
+  for ( lp = 0; lp < nplev; lp++ )
+    {
+      pres = plev[lp];
+      nxl  = nx + lp*ngp;
+      ptl  = pt + lp*ngp;
+      for ( i = 0; i < ngp; i++ )
+	{
+	  if ( nxl[i] == -1 )
+	    ptl[i] = missval;
+	  else
+	    {
+	      nl = nxl[i] * ngp + i;
+	      nh = nl + ngp;
+	      if ( nh >= ngp*nhlev )
+		ptl[i] = gt[nl];
+	      else
+		ptl[i] =  gt[nl] + (pres-hyb_press[nl])
+		       * (gt[nh] - gt[nl]) / (hyb_press[nh] - hyb_press[nl]);
+	    }
+	}
+    }
+}  /* interp_X */
+
+
+void interp_T(const double * restrict geop, const double * restrict gt, double *pt, const double * restrict fullp,
+	      const double * restrict halfp, const int *nx, const double * restrict plev, long nplev, long ngp,
+	      long nhlev, double missval)
+{
+  long lp, i;
+  long nl, nh;
+  const int *nxl;
+  double *ptl;
+  double pres;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, pres, nl, nh, nxl, ptl)
+#endif
+  for ( lp = 0; lp < nplev; lp++ )
+    {
+      pres = plev[lp];
+      nxl  = nx + lp*ngp;
+      ptl  = pt + lp*ngp;
+#if defined (CRAY)
+#pragma _CRI inline extra_T
+#endif
+      for ( i = 0; i < ngp; i++ )
+	{
+	  nl = nxl[i];
+	  if ( nl < 0 )
+	    ptl[i] = missval;
+	  else
+	    {
+	      if ( nl > nhlev-2 )
+		{
+		  if ( Mars )
+		    ptl[i] = gt[(nhlev-1)*ngp+i];
+		  else
+#if defined (SX)
+#pragma cdir inline
+#endif
+		    ptl[i] = extra_T(pres, halfp[nhlev*ngp+i],
+				     fullp[(nhlev-1)*ngp+i], geop[i],
+				     gt[(nhlev-1)*ngp+i]);
+		}
+	      else
+		{
+		  nh = nl + 1;
+		  ptl[i] =  gt[nl*ngp+i] + (pres-fullp[nl*ngp+i])
+                         * (gt[nh*ngp+i] - gt[nl*ngp+i])
+                         / (fullp[nh*ngp+i] - fullp[nl*ngp+i]);
+		}
+	    }
+	}
+    }
+}  /* interp_T */
+
+
+void interp_Z(const double * restrict geop, const double * restrict gz, double *pz, const double * restrict fullp,
+	      const double * restrict halfp, const int *nx, const double * restrict gt, const double * restrict plev,
+	      long nplev, long ngp, long nhlev, double missval)
+{
+  long lp, i;
+  long nl, nh;
+  const int *nxl;
+  double *pzl;
+  double pres;
+
+#if defined (_OPENMP)
+#pragma omp parallel for default(shared) private(i, pres, nl, nh, nxl, pzl)
+#endif
+  for ( lp = 0; lp < nplev; lp++ )
+    {
+      pres = plev[lp];
+      nxl  = nx + lp*ngp;
+      pzl  = pz + lp*ngp;
+#if defined (CRAY)
+#pragma _CRI inline extra_Z
+#endif
+      for ( i = 0; i < ngp; i++ )
+	{
+	  nl = nxl[i];
+	  if ( nl < 0 )
+	    pzl[i] = missval;
+	  else
+	    {
+	      if ( pres > halfp[(nl+1)*ngp+i] ) nl++;
+
+	      if ( nl > nhlev-1 )
+		{
+		  if ( Mars )
+		    pzl[i] = gt[(nhlev-1)*ngp+i];
+		  else
+#if defined (SX)
+#pragma cdir inline
+#endif
+		    pzl[i] = extra_Z(pres, halfp[nhlev*ngp+i],
+				     fullp[(nhlev-1)*ngp+i], geop[i],
+				     gt[(nhlev-1)*ngp+i]);
+		}
+	      else
+		{
+		  nh = nl + 1;
+		  pzl[i] =  gz[nl*ngp+i] + (pres-halfp[nl*ngp+i])
+		         * (gz[nh*ngp+i] - gz[nl*ngp+i])
+                         / (halfp[nh*ngp+i] - halfp[nl*ngp+i]);
+		}
+	    }
+	}
+    }
+}  /* interp_Z */
diff --git a/src/vinterp.h b/src/vinterp.h
new file mode 100644
index 0000000..9a361be
--- /dev/null
+++ b/src/vinterp.h
@@ -0,0 +1,32 @@
+#ifndef _VINTERP_H
+#define _VINTERP_H
+
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
+void h2p(double * restrict phlev, const double * restrict hlev, long nphlev);
+
+void presh(double * restrict fullp, double * halfp, const double *restrict vct,
+	   const double *restrict ps, long nhlev, long ngp);
+
+void genind(int *nx, const double * restrict plev, const double * restrict fullp, long ngp, long nplev, long nhlev);
+void genindmiss(int *nx, const double * restrict plev, int ngp, int nplev, const double * restrict ps_prog, int * restrict pnmiss);
+
+void extra_P(double * restrict slp, const double * restrict halfp, const double * restrict fullp,
+	     const double * restrict geop, const double * restrict temp, long ngp);
+
+void interp_T(const double * restrict geop, const double * restrict gt, double *pt, const double * restrict fullp,
+	      const double * restrict halfp, const int *nx, const double * restrict plev, long nplev, long ngp,
+	      long nhlev, double missval);
+void interp_Z(const double * restrict geop, const double * restrict gz, double *pz, const double * restrict fullp,
+	      const double * restrict halfp, const int *nx, const double * restrict gt, const double * restrict plev,
+	      long nplev, long ngp, long nhlev, double missval);
+void interp_X(const double * restrict gt, double *pt, const double * restrict hyb_press, const int *nx,
+	      const double * restrict plev, long nplev, long ngp, long nhlev, double missval);
+
+#if defined(__cplusplus)
+}
+#endif
+
+#endif  /* _VINTERP_H */
diff --git a/src/zaxis.c b/src/zaxis.c
new file mode 100644
index 0000000..21e80b0
--- /dev/null
+++ b/src/zaxis.c
@@ -0,0 +1,485 @@
+/*
+  This file is part of CDO. CDO is a collection of Operators to
+  manipulate and analyse Climate model Data.
+
+  Copyright (C) 2003-2012 Uwe Schulzweida, Uwe.Schulzweida at zmaw.de
+  See COPYING file for copying and redistribution conditions.
+
+  This program is free software; you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation; version 2 of the License.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+*/
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+
+#include <cdi.h>
+#include "cdo.h"
+#include "cdo_int.h"
+#include "error.h"
+
+#define UNDEFID -1
+
+#define MAX_LINE_LEN 65536
+
+
+typedef struct {
+  double *vals;
+  double *lbounds;
+  double *ubounds;
+  double *vct;
+  int     vctsize;
+  int     type;
+  int     size;
+  char    name[CDI_MAX_NAME];
+  char    longname[CDI_MAX_NAME];
+  char    units[CDI_MAX_NAME];
+}
+zaxis_t;
+
+
+void zaxisInit(zaxis_t *zaxis)
+{
+  zaxis->vals        = NULL;
+  zaxis->lbounds     = NULL;
+  zaxis->ubounds     = NULL;
+  zaxis->vct         = NULL;
+  zaxis->type        = UNDEFID;
+  zaxis->vctsize     = 0;
+  zaxis->size        = 0;
+  zaxis->name[0]     = 0;
+  zaxis->longname[0] = 0;
+  zaxis->units[0]    = 0;
+}
+
+
+static int getoptname(char *optname, const char *optstring, int nopt)
+{
+  int i, nerr = 0;
+  size_t namelen;
+  const char *pname;
+  const char *pend;
+
+  pname = optstring;
+  pend  = optstring;
+
+  for ( i = 0; i < nopt; i++ )
+    {
+      pend = strchr(pname, ',');
+      if ( pend == NULL )
+	break;
+      else
+	pname = pend + 1;
+    }
+
+  if ( pend )
+    {
+      pend = strchr(pname, ',');
+      if ( pend == NULL )
+	namelen = strlen(pname);
+      else
+	namelen = pend - pname;
+
+      memcpy(optname, pname, namelen);
+      optname[namelen] = '\0';
+    }
+  else
+    nerr = 1;
+
+  return (nerr);
+}
+
+
+int zaxisDefine(zaxis_t zaxis)
+{
+  int zaxisID = UNDEFID;
+
+  if ( zaxis.type == -1 ) Error("zaxistype undefined!");
+
+  if ( zaxis.size == 0 ) Error("zaxis size undefined!");
+
+  zaxisID = zaxisCreate(zaxis.type, zaxis.size);
+
+  if ( zaxis.vals )
+    {
+      zaxisDefLevels(zaxisID, zaxis.vals);
+      free(zaxis.vals);
+    }
+  if ( zaxis.lbounds )
+    {
+      zaxisDefLbounds(zaxisID, zaxis.lbounds);
+      free(zaxis.lbounds);
+    }
+  if ( zaxis.ubounds )
+    {
+      zaxisDefUbounds(zaxisID, zaxis.ubounds);
+      free(zaxis.ubounds);
+    }
+
+  if ( zaxis.name[0] )     zaxisDefName(zaxisID, zaxis.name);
+  if ( zaxis.longname[0] ) zaxisDefLongname(zaxisID, zaxis.longname);
+  if ( zaxis.units[0] )    zaxisDefUnits(zaxisID, zaxis.units);
+
+  if ( zaxis.type == ZAXIS_HYBRID || zaxis.type == ZAXIS_HYBRID_HALF )
+    {
+      if ( zaxis.vctsize && zaxis.vct )
+	zaxisDefVct(zaxisID, zaxis.vctsize, zaxis.vct);
+      else
+	Warning("vct undefined!");	    
+    }
+
+  return (zaxisID);
+}
+
+
+static char *skipSeparator(char *pline)
+{
+  while ( isspace((int) *pline) ) pline++;
+  if ( *pline == '=' || *pline == ':' ) pline++;
+  while ( isspace((int) *pline) ) pline++;
+
+  return (pline);
+}
+
+
+int zaxisFromFile(FILE *gfp)
+{
+  char line[MAX_LINE_LEN], *pline;
+  int zaxisID;
+  zaxis_t zaxis;
+
+  zaxisInit(&zaxis);
+
+  while ( readline(gfp, line, MAX_LINE_LEN) )
+    {
+      if ( line[0] == '#' ) continue;
+      if ( line[0] == '\0' ) continue;
+      pline = line;
+      while ( isspace((int) *pline) ) pline++;
+      if ( pline[0] == '\0' ) continue;
+      if ( memcmp(pline, "zaxistype", 9) == 0 || 
+	   memcmp(pline, "type", 4) == 0 )
+	{
+	  if ( *pline == 'z' )
+	    pline = skipSeparator(pline + 9);
+	  else
+	    pline = skipSeparator(pline + 4);
+
+	  if ( memcmp(pline, "pressure", 6) == 0 )
+	    zaxis.type = ZAXIS_PRESSURE;
+	  else if ( memcmp(pline, "hybrid_half", 11)  == 0 )
+	    zaxis.type = ZAXIS_HYBRID_HALF;
+	  else if ( memcmp(pline, "hybrid", 6)  == 0 )
+	    zaxis.type = ZAXIS_HYBRID;
+	  else if ( memcmp(pline, "height", 6) == 0 )
+	    zaxis.type = ZAXIS_HEIGHT;
+	  else if ( memcmp(pline, "depth below sea", 15) == 0 ||
+		    memcmp(pline, "depth_below_sea", 15) == 0 )
+	    zaxis.type = ZAXIS_DEPTH_BELOW_SEA;
+	  else if ( memcmp(pline, "depth below land", 16) == 0 ||
+		    memcmp(pline, "depth_below_land", 16) == 0 )
+	    zaxis.type = ZAXIS_DEPTH_BELOW_LAND;
+	  else if ( memcmp(pline, "isentropic", 10)  == 0 )
+	    zaxis.type = ZAXIS_ISENTROPIC;
+	  else if ( memcmp(pline, "surface", 7)  == 0 )
+	    zaxis.type = ZAXIS_SURFACE;
+	  else if ( memcmp(pline, "generic", 7)  == 0 )
+	    zaxis.type = ZAXIS_GENERIC;
+	  else
+	    Warning("Invalid zaxisname : %s", pline);
+	}
+      else if ( memcmp(pline, "size", 4)  == 0 )
+	{
+	  zaxis.size = atol(skipSeparator(pline + 4));
+	}
+      else if ( memcmp(pline, "vctsize", 7)  == 0 )
+	{
+	  zaxis.vctsize = atol(skipSeparator(pline + 7));
+	}
+      else if ( memcmp(pline, "name", 4)  == 0 )
+	{
+	  strcpy(zaxis.name, skipSeparator(pline + 4));
+	}
+      else if ( memcmp(pline, "longname", 8)  == 0 )
+	{
+	  strcpy(zaxis.longname, skipSeparator(pline + 8));
+	}
+      else if ( memcmp(pline, "units", 5)  == 0 )
+	{
+	  strcpy(zaxis.units, skipSeparator(pline + 5));
+	}
+      else if ( memcmp(pline, "levels", 6)  == 0 )
+	{
+	  int i;
+	  double flev;
+
+	  if ( zaxis.size > 0 )
+	    {
+	      pline = skipSeparator(pline + 6);
+	  
+	      zaxis.vals = (double *) malloc(zaxis.size*sizeof(double));
+	      for ( i = 0; i < zaxis.size; i++ )
+		{
+		  pline = skipSeparator(pline);
+		  if ( strlen(pline) == 0 )
+		    {
+		      if ( ! readline(gfp, line, MAX_LINE_LEN) )
+			{
+			  Warning("Incomplete command: >levels<");
+			  break;
+			}
+		      pline = line;
+		      pline = skipSeparator(pline);
+		    }
+		  flev = 0;
+		  sscanf(pline, "%lg", &flev);
+		  zaxis.vals[i] = flev;
+		  while ( isalnum((int) *pline) ||
+			  isdigit((int) *pline) ||
+			  ispunct((int) *pline) ) pline++;
+		}
+	    }
+	  else
+	    {
+	      Warning("size undefined!");
+	    }
+	}
+      else if ( memcmp(pline, "vct", 3)  == 0 )
+	{
+	  int i;
+	  double flev;
+
+	  if ( zaxis.vctsize > 0 )
+	    {
+	      pline = skipSeparator(pline + 3);
+	  
+	      zaxis.vct = (double *) malloc(zaxis.vctsize*sizeof(double));
+	      for ( i = 0; i < zaxis.vctsize; i++ )
+		{
+		  pline = skipSeparator(pline);
+		  if ( strlen(pline) == 0 )
+		    {
+		      if ( ! readline(gfp, line, MAX_LINE_LEN) )
+			{
+			  Warning("Incomplete command: >vct<");
+			  break;
+			}
+		      pline = line;
+		      pline = skipSeparator(pline);
+		    }
+		  flev = 0;
+		  sscanf(pline, "%lg", &flev);
+		  zaxis.vct[i] = flev;
+		  while ( isalnum((int) *pline) ||
+			  isdigit((int) *pline) ||
+			  ispunct((int) *pline) ) pline++;
+		}
+	    }
+	  else
+	    {
+	      Warning("vctsize undefined!");
+	    }
+	}
+      else if ( memcmp(pline, "lbounds", 7)  == 0 )
+	{
+	  int i;
+	  double flev;
+
+	  if ( zaxis.size > 0 )
+	    {
+	      pline = skipSeparator(pline + 7);
+	  
+	      zaxis.lbounds = (double *) malloc(zaxis.size*sizeof(double));
+	      for ( i = 0; i < zaxis.size; i++ )
+		{
+		  pline = skipSeparator(pline);
+		  if ( strlen(pline) == 0 )
+		    {
+		      if ( ! readline(gfp, line, MAX_LINE_LEN) )
+			{
+			  Warning("Incomplete command: >lbounds<");
+			  break;
+			}
+		      pline = line;
+		      pline = skipSeparator(pline);
+		    }
+		  flev = 0;
+		  sscanf(pline, "%lg", &flev);
+		  zaxis.lbounds[i] = flev;
+		  while ( isalnum((int) *pline) ||
+			  isdigit((int) *pline) ||
+			  ispunct((int) *pline) ) pline++;
+		}
+	    }
+	  else
+	    {
+	      Warning("size undefined!");
+	    }
+	}
+      else if ( memcmp(pline, "ubounds", 7)  == 0 )
+	{
+	  int i;
+	  double flev;
+
+	  if ( zaxis.size > 0 )
+	    {
+	      pline = skipSeparator(pline + 7);
+	  
+	      zaxis.ubounds = (double *) malloc(zaxis.size*sizeof(double));
+	      for ( i = 0; i < zaxis.size; i++ )
+		{
+		  pline = skipSeparator(pline);
+		  if ( strlen(pline) == 0 )
+		    {
+		      if ( ! readline(gfp, line, MAX_LINE_LEN) )
+			{
+			  Warning("Incomplete command: >ubounds<");
+			  break;
+			}
+		      pline = line;
+		      pline = skipSeparator(pline);
+		    }
+		  flev = 0;
+		  sscanf(pline, "%lg", &flev);
+		  zaxis.ubounds[i] = flev;
+		  while ( isalnum((int) *pline) ||
+			  isdigit((int) *pline) ||
+			  ispunct((int) *pline) ) pline++;
+		}
+	    }
+	  else
+	    {
+	      Warning("size undefined!");
+	    }
+	}
+      else
+	Warning("Invalid zaxis command : >%s<", pline);
+    }
+
+  zaxisID = zaxisDefine(zaxis);
+
+  return (zaxisID);
+}
+
+
+int zaxisFromName(const char *zaxisname)
+{
+  const char *pline;
+  int zaxisID = UNDEFID;
+  zaxis_t zaxis;
+
+  zaxisInit(&zaxis);
+
+  pline = zaxisname;
+  if ( memcmp(pline, "surface", 7) == 0 ) /* surface */
+    {
+      zaxis.type = ZAXIS_SURFACE;
+      zaxis.size = 1;
+      zaxis.vals = (double *) malloc(zaxis.size*sizeof(double));
+      zaxis.vals[0] = 0;
+    }
+
+  if ( zaxis.type != -1 ) zaxisID = zaxisDefine(zaxis);
+
+  return (zaxisID);
+}
+
+
+int cdoDefineZaxis(const char *zaxisfile)
+{
+  FILE *zfp;
+  int zaxisID = -1;
+
+  zfp = fopen(zaxisfile, "r");
+  if ( zfp == NULL )
+    {
+      zaxisID = zaxisFromName(zaxisfile);
+
+      if ( zaxisID == -1 ) cdoAbort("Open failed on %s!", zaxisfile);
+    }
+  else
+    {
+      zaxisID = zaxisFromFile(zfp);
+      fclose(zfp);
+    }
+
+  if ( zaxisID == -1 ) cdoAbort("Invalid zaxis description file %s!", zaxisfile);
+
+  return (zaxisID);
+}
+
+
+void defineZaxis(const char *zaxisarg)
+{
+  char zaxisfile[4096];
+  int nfile = 0;
+
+  while ( getoptname(zaxisfile, zaxisarg, nfile++) == 0 )
+    {      
+      (void) cdoDefineZaxis(zaxisfile);
+    }
+}
+
+
+int zaxis2ltype(int zaxisID)
+{
+  int ltype;
+  int zaxistype;
+
+  zaxistype = zaxisInqType(zaxisID);
+
+  ltype = zaxisInqLtype(zaxisID);
+
+  if ( ltype <= 0 ) ltype = ztype2ltype(zaxistype);
+
+  return (ltype);
+}
+
+
+int ztype2ltype(int zaxistype)
+{
+  int ltype;
+
+  ltype = -1;
+  if      ( zaxistype == ZAXIS_SURFACE           )  ltype =   1;
+  else if ( zaxistype == ZAXIS_PRESSURE          )  ltype = 100;
+  else if ( zaxistype == ZAXIS_ALTITUDE          )  ltype = 103;
+  else if ( zaxistype == ZAXIS_HEIGHT            )  ltype = 105;
+  else if ( zaxistype == ZAXIS_SIGMA             )  ltype = 107;
+  else if ( zaxistype == ZAXIS_HYBRID            )  ltype = 109;
+  else if ( zaxistype == ZAXIS_HYBRID_HALF       )  ltype = 109;
+  else if ( zaxistype == ZAXIS_DEPTH_BELOW_LAND  )  ltype = 111;
+  else if ( zaxistype == ZAXIS_ISENTROPIC        )  ltype = 113;
+  else if ( zaxistype == ZAXIS_DEPTH_BELOW_SEA   )  ltype = 160;
+  else cdoWarning("zaxis type %d not supported", zaxistype);
+
+  return (ltype);
+}
+
+
+int ltype2ztype(int ltype)
+{
+  int zaxistype = -1;
+
+  if      ( ltype ==   1 ) zaxistype = ZAXIS_SURFACE;
+  else if ( ltype ==   0 ) zaxistype = ZAXIS_SURFACE;
+  else if ( ltype == 100 ) zaxistype = ZAXIS_PRESSURE;
+  else if ( ltype == 103 ) zaxistype = ZAXIS_ALTITUDE;
+  else if ( ltype == 105 ) zaxistype = ZAXIS_HEIGHT;
+  else if ( ltype == 107 ) zaxistype = ZAXIS_SIGMA;
+  else if ( ltype == 109 ) zaxistype = ZAXIS_HYBRID;
+  else if ( ltype == 110 ) zaxistype = ZAXIS_HYBRID_HALF;
+  else if ( ltype == 111 ) zaxistype = ZAXIS_DEPTH_BELOW_LAND;
+  else if ( ltype == 113 ) zaxistype = ZAXIS_ISENTROPIC;
+  else if ( ltype == 160 ) zaxistype = ZAXIS_DEPTH_BELOW_SEA;
+  else                     zaxistype = ZAXIS_GENERIC;
+
+  return (zaxistype);
+}
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644
index 0000000..c754a4d
--- /dev/null
+++ b/test/Makefile.am
@@ -0,0 +1,26 @@
+CLEANFILES =
+
+export
+
+TESTS = $(top_srcdir)/test/test_info.py
+
+#	$(top_srcdir)/test/test_diff.py
+#	$(top_srcdir)/test/test_Arith.py
+#	$(top_srcdir)/test/test_Arithc.py
+#	$(top_srcdir)/test/test_Selvar.py
+#	$(top_srcdir)/test/test_intgridbil.py
+
+EXTRA_DIST = $(TESTS) $(top_srcdir)/test/testStreams.py
+
+CDO   = $(top_builddir)/src/cdo
+
+PYTHONPATH = $(top_srcdir)/contrib/python:$(top_srcdir)/test
+
+listTests:
+	@echo $(TESTS)
+
+test: $(TESTS)
+
+.PHONY: $(TESTS)
+
+CLEANFILES += `ls *.pyc`
diff --git a/test/Makefile.in b/test/Makefile.in
new file mode 100644
index 0000000..baa05f5
--- /dev/null
+++ b/test/Makefile.in
@@ -0,0 +1,545 @@
+# Makefile.in generated by automake 1.11.5 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
+# 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
+# This Makefile.in is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+ at SET_MAKE@
+VPATH = @srcdir@
+am__make_dryrun = \
+  { \
+    am__dry=no; \
+    case $$MAKEFLAGS in \
+      *\\[\ \	]*) \
+        echo 'am--echo: ; @echo "AM"  OK' | $(MAKE) -f - 2>/dev/null \
+          | grep '^AM OK$$' >/dev/null || am__dry=yes;; \
+      *) \
+        for am__flg in $$MAKEFLAGS; do \
+          case $$am__flg in \
+            *=*|--*) ;; \
+            *n*) am__dry=yes; break;; \
+          esac; \
+        done;; \
+    esac; \
+    test $$am__dry = yes; \
+  }
+pkgdatadir = $(datadir)/@PACKAGE@
+pkgincludedir = $(includedir)/@PACKAGE@
+pkglibdir = $(libdir)/@PACKAGE@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+subdir = test
+DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/m4/acx_options.m4 \
+	$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
+	$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
+	$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
+	$(top_srcdir)/acinclude.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+	$(ACLOCAL_M4)
+mkinstalldirs = $(SHELL) $(top_srcdir)/config/mkinstalldirs
+CONFIG_HEADER = $(top_builddir)/src/config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+SOURCES =
+DIST_SOURCES =
+am__can_run_installinfo = \
+  case $$AM_UPDATE_INFO_DIR in \
+    n|no|NO) false;; \
+    *) (install-info --version) >/dev/null 2>&1;; \
+  esac
+am__tty_colors = \
+red=; grn=; lgn=; blu=; std=
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+AMTAR = @AMTAR@
+AR = @AR@
+AS = @AS@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CLDFLAGS = @CLDFLAGS@
+CLIBS = @CLIBS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CXX = @CXX@
+CXXCPP = @CXXCPP@
+CXXDEPMODE = @CXXDEPMODE@
+CXXFLAGS = @CXXFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+ENABLE_CDI_LIB = @ENABLE_CDI_LIB@
+ENABLE_CGRIBEX = @ENABLE_CGRIBEX@
+ENABLE_EXTRA = @ENABLE_EXTRA@
+ENABLE_GRIB = @ENABLE_GRIB@
+ENABLE_IEG = @ENABLE_IEG@
+ENABLE_SERVICE = @ENABLE_SERVICE@
+EXEEXT = @EXEEXT@
+FCFLAGS = @FCFLAGS@
+FGREP = @FGREP@
+GREP = @GREP@
+GRIB_API_INCLUDE = @GRIB_API_INCLUDE@
+GRIB_API_LIBS = @GRIB_API_LIBS@
+HDF5_INCLUDE = @HDF5_INCLUDE@
+HDF5_LIBS = @HDF5_LIBS@
+HDF5_ROOT = @HDF5_ROOT@
+HOST_NAME = @HOST_NAME@
+INCLUDES = @INCLUDES@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+JASPER_LIBS = @JASPER_LIBS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAGICS_INCLUDE = @MAGICS_INCLUDE@
+MAGICS_LIBS = @MAGICS_LIBS@
+MAGICS_ROOT = @MAGICS_ROOT@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MKDIR_P = @MKDIR_P@
+NC_CONFIG = @NC_CONFIG@
+NETCDF_INCLUDE = @NETCDF_INCLUDE@
+NETCDF_LIBS = @NETCDF_LIBS@
+NETCDF_ROOT = @NETCDF_ROOT@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+PROJ_INCLUDE = @PROJ_INCLUDE@
+PROJ_LDFLAGS = @PROJ_LDFLAGS@
+PTHREAD_CC = @PTHREAD_CC@
+PTHREAD_CFLAGS = @PTHREAD_CFLAGS@
+PTHREAD_LIBS = @PTHREAD_LIBS@
+RANLIB = @RANLIB@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+STRIP = @STRIP@
+SYSTEM_TYPE = @SYSTEM_TYPE@
+SZLIB_INCLUDE = @SZLIB_INCLUDE@
+SZLIB_LIBS = @SZLIB_LIBS@
+THREADS_INCLUDE = @THREADS_INCLUDE@
+THREADS_LIBS = @THREADS_LIBS@
+UDUNITS_INCLUDE = @UDUNITS_INCLUDE@
+UDUNITS_LDFLAGS = @UDUNITS_LDFLAGS@
+USER_NAME = @USER_NAME@
+VERSION = @VERSION@
+XML2_LIBS = @XML2_LIBS@
+ZLIB_INCLUDE = @ZLIB_INCLUDE@
+ZLIB_LIBS = @ZLIB_LIBS@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_CXX = @ac_ct_CXX@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+ax_pthread_config = @ax_pthread_config@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+subdirs = @subdirs@
+sysconfdir = @sysconfdir@
+target_alias = @target_alias@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+CLEANFILES = `ls *.pyc`
+TESTS = $(top_srcdir)/test/test_info.py
+
+#	$(top_srcdir)/test/test_diff.py
+#	$(top_srcdir)/test/test_Arith.py
+#	$(top_srcdir)/test/test_Arithc.py
+#	$(top_srcdir)/test/test_Selvar.py
+#	$(top_srcdir)/test/test_intgridbil.py
+EXTRA_DIST = $(TESTS) $(top_srcdir)/test/testStreams.py
+CDO = $(top_builddir)/src/cdo
+PYTHONPATH = $(top_srcdir)/contrib/python:$(top_srcdir)/test
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+	@for dep in $?; do \
+	  case '$(am__configure_deps)' in \
+	    *$$dep*) \
+	      ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+	        && { if test -f $@; then exit 0; else break; fi; }; \
+	      exit 1;; \
+	  esac; \
+	done; \
+	echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu test/Makefile'; \
+	$(am__cd) $(top_srcdir) && \
+	  $(AUTOMAKE) --gnu test/Makefile
+.PRECIOUS: Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+	@case '$?' in \
+	  *config.status*) \
+	    cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+	  *) \
+	    echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+	    cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+	esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+	cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+	-rm -f *.lo
+
+clean-libtool:
+	-rm -rf .libs _libs
+tags: TAGS
+TAGS:
+
+ctags: CTAGS
+CTAGS:
+
+
+check-TESTS: $(TESTS)
+	@failed=0; all=0; xfail=0; xpass=0; skip=0; \
+	srcdir=$(srcdir); export srcdir; \
+	list=' $(TESTS) '; \
+	$(am__tty_colors); \
+	if test -n "$$list"; then \
+	  for tst in $$list; do \
+	    if test -f ./$$tst; then dir=./; \
+	    elif test -f $$tst; then dir=; \
+	    else dir="$(srcdir)/"; fi; \
+	    if $(TESTS_ENVIRONMENT) $${dir}$$tst; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xpass=`expr $$xpass + 1`; \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=XPASS; \
+	      ;; \
+	      *) \
+		col=$$grn; res=PASS; \
+	      ;; \
+	      esac; \
+	    elif test $$? -ne 77; then \
+	      all=`expr $$all + 1`; \
+	      case " $(XFAIL_TESTS) " in \
+	      *[\ \	]$$tst[\ \	]*) \
+		xfail=`expr $$xfail + 1`; \
+		col=$$lgn; res=XFAIL; \
+	      ;; \
+	      *) \
+		failed=`expr $$failed + 1`; \
+		col=$$red; res=FAIL; \
+	      ;; \
+	      esac; \
+	    else \
+	      skip=`expr $$skip + 1`; \
+	      col=$$blu; res=SKIP; \
+	    fi; \
+	    echo "$${col}$$res$${std}: $$tst"; \
+	  done; \
+	  if test "$$all" -eq 1; then \
+	    tests="test"; \
+	    All=""; \
+	  else \
+	    tests="tests"; \
+	    All="All "; \
+	  fi; \
+	  if test "$$failed" -eq 0; then \
+	    if test "$$xfail" -eq 0; then \
+	      banner="$$All$$all $$tests passed"; \
+	    else \
+	      if test "$$xfail" -eq 1; then failures=failure; else failures=failures; fi; \
+	      banner="$$All$$all $$tests behaved as expected ($$xfail expected $$failures)"; \
+	    fi; \
+	  else \
+	    if test "$$xpass" -eq 0; then \
+	      banner="$$failed of $$all $$tests failed"; \
+	    else \
+	      if test "$$xpass" -eq 1; then passes=pass; else passes=passes; fi; \
+	      banner="$$failed of $$all $$tests did not behave as expected ($$xpass unexpected $$passes)"; \
+	    fi; \
+	  fi; \
+	  dashes="$$banner"; \
+	  skipped=""; \
+	  if test "$$skip" -ne 0; then \
+	    if test "$$skip" -eq 1; then \
+	      skipped="($$skip test was not run)"; \
+	    else \
+	      skipped="($$skip tests were not run)"; \
+	    fi; \
+	    test `echo "$$skipped" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$skipped"; \
+	  fi; \
+	  report=""; \
+	  if test "$$failed" -ne 0 && test -n "$(PACKAGE_BUGREPORT)"; then \
+	    report="Please report to $(PACKAGE_BUGREPORT)"; \
+	    test `echo "$$report" | wc -c` -le `echo "$$banner" | wc -c` || \
+	      dashes="$$report"; \
+	  fi; \
+	  dashes=`echo "$$dashes" | sed s/./=/g`; \
+	  if test "$$failed" -eq 0; then \
+	    col="$$grn"; \
+	  else \
+	    col="$$red"; \
+	  fi; \
+	  echo "$${col}$$dashes$${std}"; \
+	  echo "$${col}$$banner$${std}"; \
+	  test -z "$$skipped" || echo "$${col}$$skipped$${std}"; \
+	  test -z "$$report" || echo "$${col}$$report$${std}"; \
+	  echo "$${col}$$dashes$${std}"; \
+	  test "$$failed" -eq 0; \
+	else :; fi
+
+distdir: $(DISTFILES)
+	@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+	list='$(DISTFILES)'; \
+	  dist_files=`for file in $$list; do echo $$file; done | \
+	  sed -e "s|^$$srcdirstrip/||;t" \
+	      -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+	case $$dist_files in \
+	  */*) $(MKDIR_P) `echo "$$dist_files" | \
+			   sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+			   sort -u` ;; \
+	esac; \
+	for file in $$dist_files; do \
+	  if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+	  if test -d $$d/$$file; then \
+	    dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+	    if test -d "$(distdir)/$$file"; then \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+	      cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+	      find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+	    fi; \
+	    cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+	  else \
+	    test -f "$(distdir)/$$file" \
+	    || cp -p $$d/$$file "$(distdir)/$$file" \
+	    || exit 1; \
+	  fi; \
+	done
+check-am: all-am
+	$(MAKE) $(AM_MAKEFLAGS) check-TESTS
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+	@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+	if test -z '$(STRIP)'; then \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	      install; \
+	else \
+	  $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+	    install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+	    "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+	fi
+mostlyclean-generic:
+
+clean-generic:
+	-test -z "$(CLEANFILES)" || rm -f $(CLEANFILES)
+
+distclean-generic:
+	-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+	-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+	@echo "This command is intended for maintainers to use"
+	@echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+	-rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+	-rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: check-am install-am install-strip
+
+.PHONY: all all-am check check-TESTS check-am clean clean-generic \
+	clean-libtool distclean distclean-generic distclean-libtool \
+	distdir dvi dvi-am html html-am info info-am install \
+	install-am install-data install-data-am install-dvi \
+	install-dvi-am install-exec install-exec-am install-html \
+	install-html-am install-info install-info-am install-man \
+	install-pdf install-pdf-am install-ps install-ps-am \
+	install-strip installcheck installcheck-am installdirs \
+	maintainer-clean maintainer-clean-generic mostlyclean \
+	mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+	uninstall uninstall-am
+
+
+export
+
+listTests:
+	@echo $(TESTS)
+
+test: $(TESTS)
+
+.PHONY: $(TESTS)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/test/README b/test/README
new file mode 100644
index 0000000..7173942
--- /dev/null
+++ b/test/README
@@ -0,0 +1,20 @@
+Test the cdo-operators
+======================
+
+To test the cdo operators use:
+    make
+or
+    make test
+or
+    ./test_operators
+
+The cdo operators are tested with python-unittests using the python-bindings for cdo.
+The python-bindings are located at cdo/contrib/python/cdo.py.
+The use is roughly exlained at:
+    https://code.zmaw.de/projects/cdo/wiki/Cdo%7Brbpy%7D
+    TODO: Provide a more thorough documentation/tutorial.
+The documentation of the python unittest framework can be found at:
+    http://docs.python.org/library/unittest.html
+
+The tests are grouped by operator. An operator is tested with the help of its file test_operator.py, which can comprise several tests.
+
diff --git a/test/testStreams.py b/test/testStreams.py
new file mode 100644
index 0000000..9a85472
--- /dev/null
+++ b/test/testStreams.py
@@ -0,0 +1,46 @@
+from cdo import *
+def createInputFiles(nfiles,resolution,cdo,cdoOptions):
+  timeDefaults  = '-settunits,days -settaxis,20010101,12:00:00'
+  randomEnlarge = lambda  resolution: '-mul -random,'+resolution+' -enlarge,'+resolution
+  fileList      = {}
+  cdo.debug     = False
+
+  FileKeys = ['1d','2d','3d','1d_withTime','2d_withTime','3d_withTime']
+  for i,key in enumerate(FileKeys):
+    fileList[key] = []
+    if '1d' == key:
+      # vertical levels only
+      for j in xrange(0,nfiles):
+        fileList[key].append(cdo.stdatm(0,10,20,50, options = cdoOptions))
+
+    elif '2d' == key:
+      for j in xrange(0,nfiles):
+	fileList[key].append(cdo.setcode(130,input = "-setname,'T' -random,"+resolution, options = cdoOptions))
+
+    elif '3d' == key:
+      for j in xrange(0,nfiles):
+	fileList[key].append(cdo.enlarge(resolution, input = '-stdatm,0,10,20,50', options = cdoOptions))
+
+    elif '1d_withTime' == key:
+      # temporal axis only
+      for j in xrange(0,nfiles):
+	fileList[key].append(cdo.setcode(130,input = cdo.setname('T',input = timeDefaults+' -for,1,400', options = cdoOptions)))
+
+    elif '2d_withTime' == key:
+      for j in xrange(0,nfiles):
+	fileList[key].append(cdo.setcode(130,input = cdo.setname('T',input = randomEnlarge(resolution) +' ' +timeDefaults+ ' -for,1,400', options = cdoOptions)))
+
+    elif '3d_withTime' == key:
+      for j in xrange(0,nfiles):
+	fileList[key].append(cdo.enlarge(resolution, input = '-mul '+timeDefaults+ ' -stdatm,0,10,20 -for,1,400', options = cdoOptions))
+
+  return fileList
+
+
+if __name__ == '__main__':
+  cdo = Cdo()
+  a = createInputFiles(5,'r36x18',cdo,'-f nc')
+  for i,value in enumerate(a):
+    files = a[value]
+    for f in files:
+      print(' '.join([value,f,os.path.exists(f).__str__()]))
diff --git a/test/test_info.py b/test/test_info.py
new file mode 100755
index 0000000..15fc3d1
--- /dev/null
+++ b/test/test_info.py
@@ -0,0 +1,37 @@
+#!/usr/bin/env python
+import unittest
+from cdo import *
+
+
+class TestInfo(unittest.TestCase):
+
+    # check operators: (s)infov,showlevel
+    def test_info(self):
+        cdo  = Cdo()
+
+        info = cdo.sinfo(input = "-stdatm,0")
+        self.assertEqual("File format: GRIB",info[0])
+
+        sinfov = cdo.sinfov(input = "-stdatm,0,10,20,50,100,500,1000",options = "-f nc")
+        self.assertEqual("P",sinfov[2].split(' ')[-1])
+        self.assertEqual("T",sinfov[3].split(' ')[-1])
+
+        infov  = cdo.infov( input = "-stdatm,0,10,20,50,100,500,1000",options = "-f nc")
+        self.assertEqual("1013.2", infov[1].split(' ')[-15])
+        self.assertEqual("T", infov[-1].split(' ')[-1])
+
+        units  = cdo.showunit( input = "-stdatm,0", options = "-f nc")
+        self.assertEqual(["hPa","K"],units[0].split(' '))
+
+        levels = cdo.showlevel(input = "-stdatm,0")
+        self.assertEqual([0,0],map(float,levels))
+        levels = cdo.showlevel(input = "-stdatm,10,20,30")[0].split(' ')
+        self.assertEqual([10,20,30],map(float,levels))
+
+        code = cdo.showcode(input="-topo,r1x1")
+        self.assertEqual("-1",code[0])
+        code = cdo.showcode(input="-setcode,111 -topo,r1x1")
+        self.assertEqual("111",code[0])
+
+if __name__ == '__main__':
+    unittest.main()

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/cdo.git



More information about the debian-science-commits mailing list